From xen-devel-bounces@lists.xen.org Thu Nov 01 01:13:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 01:13:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTjKn-0005fM-UG; Thu, 01 Nov 2012 01:12:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ronny.hegewald@online.de>) id 1TTjKm-0005fH-DC
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 01:12:36 +0000
Received: from [85.158.139.83:2264] by server-4.bemta-5.messagelabs.com id
	AA/EE-15011-38CC1905; Thu, 01 Nov 2012 01:12:35 +0000
X-Env-Sender: ronny.hegewald@online.de
X-Msg-Ref: server-8.tower-182.messagelabs.com!1351732354!16941321!1
X-Originating-IP: [212.227.17.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gNzUwNzY=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gNzUwNzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9647 invoked from network); 1 Nov 2012 01:12:35 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.17.9)
	by server-8.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 01:12:35 -0000
Received: from server2-groupware.localnet (kons-d9be1c11.pool.mediaWays.net
	[217.190.28.17])
	by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis)
	id 0Lpgco-1Srexo1Nsk-00fXX3; Thu, 01 Nov 2012 02:12:34 +0100
From: Ronny Hegewald <ronny.hegewald@online.de>
To: xen-devel@lists.xen.org
Date: Thu, 1 Nov 2012 02:18:14 +0000
User-Agent: KMail/1.11.4 (Linux/3.0.3; KDE/4.2.4; i686; ; )
MIME-Version: 1.0
Content-Disposition: inline
Message-Id: <201211010218.14872.ronny.hegewald@online.de>
X-Provags-ID: V02:K0:OhYehV/ZLEZZANDWp750tdUbWc6X8BBlkDJR2nlbP2b
	QHqdmNFSDcFJQtWlv7K76MpfkrG/F/9W1ryOo/xSVN+Upw3cP2
	uFNDvwqYG/AEJt82dcYwMR3k7eFKx0dIoldypAC00XmKFMyp4P
	r6XB5t4QEA/CtuoiAvxvEOk1lBT0kkLp5I5zH/3J3z2JLgqdCB
	Zo2PKQb9jacI+eM+wajZdnF1yO4MvYrubnwXgYIe2Lo3WGDDXS
	tyII0sEjTmDmRSXOl8BkjNjN9CHs9auwiIWL73BDT3lXKj8ogK
	7vh/NmFqT5o1/K0+FGKBVNSMIHVzL+Cbt837na2e9c2jhKgksu
	vTOxPw75I7VjRZlUy2UmM/aGAtakT8Lw9hr8Ki7vDe1phqC/1K
	1/3x/GMxprgAd4ojx/FB6v7cLSIo2KSfoQ=
Subject: [Xen-devel] [PATCH] fix vfb related assertion problem when starting
	pv-domU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

When a config-file for a pv-domU has a vfb section with a vnc=0 option then a 
"xl create" for that domU crashes with the message


xl: libxl.c:252: libxl_defbool_val: Assertion `!libxl_defbool_is_default(db)' 
failed.


and the domU hangs early in the start.

This patch fixes the cause of the assertion and let the domU start normally.

This problem exists since xen 4.2.

--- tools/libxl/libxl.c.org	2012-11-01 01:35:52.000000000 +0000
+++ tools/libxl/libxl.c	2012-11-01 01:36:20.000000000 +0000
@@ -2949,6 +2949,8 @@ int libxl__device_vfb_setdefault(libxl__
         }
 
         libxl_defbool_setdefault(&vfb->vnc.findunused, true);
+    } else {
+        libxl_defbool_setdefault(&vfb->vnc.findunused, false);
     }
 
     libxl_defbool_setdefault(&vfb->sdl.enable, false);




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 01:13:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 01:13:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTjKn-0005fM-UG; Thu, 01 Nov 2012 01:12:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ronny.hegewald@online.de>) id 1TTjKm-0005fH-DC
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 01:12:36 +0000
Received: from [85.158.139.83:2264] by server-4.bemta-5.messagelabs.com id
	AA/EE-15011-38CC1905; Thu, 01 Nov 2012 01:12:35 +0000
X-Env-Sender: ronny.hegewald@online.de
X-Msg-Ref: server-8.tower-182.messagelabs.com!1351732354!16941321!1
X-Originating-IP: [212.227.17.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gNzUwNzY=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gNzUwNzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9647 invoked from network); 1 Nov 2012 01:12:35 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.17.9)
	by server-8.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 01:12:35 -0000
Received: from server2-groupware.localnet (kons-d9be1c11.pool.mediaWays.net
	[217.190.28.17])
	by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis)
	id 0Lpgco-1Srexo1Nsk-00fXX3; Thu, 01 Nov 2012 02:12:34 +0100
From: Ronny Hegewald <ronny.hegewald@online.de>
To: xen-devel@lists.xen.org
Date: Thu, 1 Nov 2012 02:18:14 +0000
User-Agent: KMail/1.11.4 (Linux/3.0.3; KDE/4.2.4; i686; ; )
MIME-Version: 1.0
Content-Disposition: inline
Message-Id: <201211010218.14872.ronny.hegewald@online.de>
X-Provags-ID: V02:K0:OhYehV/ZLEZZANDWp750tdUbWc6X8BBlkDJR2nlbP2b
	QHqdmNFSDcFJQtWlv7K76MpfkrG/F/9W1ryOo/xSVN+Upw3cP2
	uFNDvwqYG/AEJt82dcYwMR3k7eFKx0dIoldypAC00XmKFMyp4P
	r6XB5t4QEA/CtuoiAvxvEOk1lBT0kkLp5I5zH/3J3z2JLgqdCB
	Zo2PKQb9jacI+eM+wajZdnF1yO4MvYrubnwXgYIe2Lo3WGDDXS
	tyII0sEjTmDmRSXOl8BkjNjN9CHs9auwiIWL73BDT3lXKj8ogK
	7vh/NmFqT5o1/K0+FGKBVNSMIHVzL+Cbt837na2e9c2jhKgksu
	vTOxPw75I7VjRZlUy2UmM/aGAtakT8Lw9hr8Ki7vDe1phqC/1K
	1/3x/GMxprgAd4ojx/FB6v7cLSIo2KSfoQ=
Subject: [Xen-devel] [PATCH] fix vfb related assertion problem when starting
	pv-domU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

When a config-file for a pv-domU has a vfb section with a vnc=0 option then a 
"xl create" for that domU crashes with the message


xl: libxl.c:252: libxl_defbool_val: Assertion `!libxl_defbool_is_default(db)' 
failed.


and the domU hangs early in the start.

This patch fixes the cause of the assertion and let the domU start normally.

This problem exists since xen 4.2.

--- tools/libxl/libxl.c.org	2012-11-01 01:35:52.000000000 +0000
+++ tools/libxl/libxl.c	2012-11-01 01:36:20.000000000 +0000
@@ -2949,6 +2949,8 @@ int libxl__device_vfb_setdefault(libxl__
         }
 
         libxl_defbool_setdefault(&vfb->vnc.findunused, true);
+    } else {
+        libxl_defbool_setdefault(&vfb->vnc.findunused, false);
     }
 
     libxl_defbool_setdefault(&vfb->sdl.enable, false);




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 01:39:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 01:39:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTjkD-0006Am-7E; Thu, 01 Nov 2012 01:38:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TTjkB-0006Ah-T5
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 01:38:52 +0000
Received: from [85.158.143.35:16771] by server-1.bemta-4.messagelabs.com id
	55/8E-27934-BA2D1905; Thu, 01 Nov 2012 01:38:51 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1351733930!16014468!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY3OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24139 invoked from network); 1 Nov 2012 01:38:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-14.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 01:38:50 -0000
X-IronPort-AV: E=Sophos;i="4.80,690,1344211200"; d="scan'208";a="15529328"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 01:38:49 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 1 Nov 2012 01:38:48 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TTjk8-0007KG-SS;
	Thu, 01 Nov 2012 01:38:48 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TTjk8-0004gD-S0;
	Thu, 01 Nov 2012 01:38:48 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14280-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 1 Nov 2012 01:38:48 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14280: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14280 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14280/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-i386-i386-xl             9 guest-start               fail REGR. vs. 14076
 test-i386-i386-xl-qemuu-winxpsp3  7 windows-install       fail REGR. vs. 14076
 test-i386-i386-xl-winxpsp3    7 windows-install           fail REGR. vs. 14076
 test-i386-i386-xl-win         7 windows-install           fail REGR. vs. 14076

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-sedf     11 guest-localmigrate          fail pass in 14192
 test-amd64-i386-win           7 windows-install             fail pass in 14192
 test-amd64-amd64-xl-sedf 14 guest-localmigrate/x10 fail in 14192 pass in 14186

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore         fail REGR. vs. 14076

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check      fail in 14192 never pass

version targeted for testing:
 xen                  2bca7e58a3df
baseline version:
 xen                  40ccbee890e1

------------------------------------------------------------
People who touched revisions under test:
  Andres Lagar-Cavilla <andres@lagarcavilla.org>
  Bastian Blank <waldi@debian.org>
  Chuang Cao <chuang.cao@oracle.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jason McCarver <slam@parasite.cc>
  Joe Jin <joe.jin@oracle.com>
  Keir Fraser <keir@xen.org>
  Matt Wilson <msw@amazon.com>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Olaf Hering <olaf@aepfle.de>
  Roger Pau Monne <roger.pau@citrix.com>
  Sander Eikelenboom <linux@eikelenboom.it>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            fail    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 632 lines long.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 01:39:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 01:39:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTjkD-0006Am-7E; Thu, 01 Nov 2012 01:38:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TTjkB-0006Ah-T5
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 01:38:52 +0000
Received: from [85.158.143.35:16771] by server-1.bemta-4.messagelabs.com id
	55/8E-27934-BA2D1905; Thu, 01 Nov 2012 01:38:51 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1351733930!16014468!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY3OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24139 invoked from network); 1 Nov 2012 01:38:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-14.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 01:38:50 -0000
X-IronPort-AV: E=Sophos;i="4.80,690,1344211200"; d="scan'208";a="15529328"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 01:38:49 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 1 Nov 2012 01:38:48 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TTjk8-0007KG-SS;
	Thu, 01 Nov 2012 01:38:48 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TTjk8-0004gD-S0;
	Thu, 01 Nov 2012 01:38:48 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14280-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 1 Nov 2012 01:38:48 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14280: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14280 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14280/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-i386-i386-xl             9 guest-start               fail REGR. vs. 14076
 test-i386-i386-xl-qemuu-winxpsp3  7 windows-install       fail REGR. vs. 14076
 test-i386-i386-xl-winxpsp3    7 windows-install           fail REGR. vs. 14076
 test-i386-i386-xl-win         7 windows-install           fail REGR. vs. 14076

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-sedf     11 guest-localmigrate          fail pass in 14192
 test-amd64-i386-win           7 windows-install             fail pass in 14192
 test-amd64-amd64-xl-sedf 14 guest-localmigrate/x10 fail in 14192 pass in 14186

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore         fail REGR. vs. 14076

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check      fail in 14192 never pass

version targeted for testing:
 xen                  2bca7e58a3df
baseline version:
 xen                  40ccbee890e1

------------------------------------------------------------
People who touched revisions under test:
  Andres Lagar-Cavilla <andres@lagarcavilla.org>
  Bastian Blank <waldi@debian.org>
  Chuang Cao <chuang.cao@oracle.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jason McCarver <slam@parasite.cc>
  Joe Jin <joe.jin@oracle.com>
  Keir Fraser <keir@xen.org>
  Matt Wilson <msw@amazon.com>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Olaf Hering <olaf@aepfle.de>
  Roger Pau Monne <roger.pau@citrix.com>
  Sander Eikelenboom <linux@eikelenboom.it>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            fail    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 632 lines long.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 02:14:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 02:14:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTkHm-0002xm-CP; Thu, 01 Nov 2012 02:13:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <raistlin.df@gmail.com>) id 1TTkHl-0002fT-82
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 02:13:33 +0000
Received: from [85.158.139.83:12832] by server-9.bemta-5.messagelabs.com id
	C1/CA-29295-CCAD1905; Thu, 01 Nov 2012 02:13:32 +0000
X-Env-Sender: raistlin.df@gmail.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1351736011!23617624!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21164 invoked from network); 1 Nov 2012 02:13:31 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-6.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 02:13:31 -0000
Received: by mail-ea0-f173.google.com with SMTP id a1so974470eaa.32
	for <xen-devel@lists.xen.org>; Wed, 31 Oct 2012 19:13:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:subject:from:to:cc:date:in-reply-to:references
	:content-type:x-mailer:mime-version;
	bh=xdHVECy2wLY+DLVYVfRF50kVl/dpSxyiTXFhM6/s8b8=;
	b=YcbjQoxCahHu038mPj7gIJhBMxswPQ1A5wfppnYwXvxpWe22EBjJ6e3yFeO4dPdtyZ
	n2q0PwTjVuKh2dziwLRdlptdcRYGuMKWAGeVtR+qdRpvpp6Z1lAeR5DxRcbsUwN23J3P
	kDRNdMstPAUgwhyWU+E9snuPYlbFeZpvf+7r3Hn3Yi6Mrasm0uAbEASXN8Ura0Y+ZcQA
	uv3C5hrKRQ5Uw8CQHwePiPGLvo2k+wpQ5pw4PmfZPO9s0oIQE2/iz2OXEdzJ5RjBqnv/
	OiQrXnIlVSWbTGgxMGH+wY5iTjAnZUjLNG4JE4o5Y1rmsxkI9lv24Juf4rbNkj/KxuNp
	2zsw==
Received: by 10.14.199.134 with SMTP id x6mr92592827een.31.1351736011508;
	Wed, 31 Oct 2012 19:13:31 -0700 (PDT)
Received: from [192.168.0.40] (ip-143-31.sn3.eutelia.it. [213.136.143.31])
	by mx.google.com with ESMTPS id e1sm11482925eem.3.2012.10.31.19.13.28
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 31 Oct 2012 19:13:30 -0700 (PDT)
Message-ID: <1351736001.18330.139.camel@Solace>
From: Dario Faggioli <raistlin@linux.it>
To: Tim Deegan <tim@xen.org>
Date: Thu, 01 Nov 2012 03:13:21 +0100
In-Reply-To: <20121029223555.GA24388@ocelot.phlegethon.org>
References: <60d00f38-98a3-4ec2-acbd-b49dafaada56@default>
	<20121029223555.GA24388@ocelot.phlegethon.org>
X-Mailer: Evolution 3.4.4-1
Mime-Version: 1.0
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	"Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	George Shuklin <george.shuklin@gmail.com>,
	Olaf Hering <olaf@aepfle.de>, xen-devel@lists.xen.org,
	Zhigang Wang <zhigang.x.wang@oracle.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0208552959545569884=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--===============0208552959545569884==
Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature";
	boundary="=-jrQPAMTpPwECh/tIGrmE"


--=-jrQPAMTpPwECh/tIGrmE
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, 2012-10-29 at 22:35 +0000, Tim Deegan wrote:
> At 10:06 -0700 on 29 Oct (1351505175), Dan Magenheimer wrote:
> > In the case of a dying domain, a XENMEM_release operation
> > is implied and must be executed by the hypervisor.
> >=20
> > Ideally, the quantity of unclaimed memory for each domain and
> > for the system should be query-able.  This may require additional
> > memory_op hypercalls.
> >=20
> > I'd very much appreciate feedback on this proposed design!
>=20
> As I said, I'm not opposed to this, though even after reading through
> the other thread I'm not convinced that it's necessary (except in cases
> where guest-controlled operations are allowed to consume unbounded
> memory, which frankly gives me the heebie-jeebies).
>=20
Let me also ask something.

Playing with NUMA systems I've been in the situation where it would be
nice to know not only how much free memory we have in general, but how
much free memory there is in a specific (set of) node(s), and that in
many places, from the hypervisor, to libxc, to top level toolstack.

Right now I ask this to Xen, but that is indeed prone to races and
TOCTOU issues if we allow for domain creation and ballooning
(tmem/paging/...) to happen concurrently between themselves and between
each other (as noted in the long thread that preceded this one).

Question is, the "claim" mechanism you're proposing is by no means NUMA
node-aware, right?

Thanks and Regards,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-jrQPAMTpPwECh/tIGrmE
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCR2sEACgkQk4XaBE3IOsRsfQCfbb/6tuBlKmKCmEokERwH2Tja
gNAAoKKG2iiMHTey7J1N85ONU7Mq0sjS
=ynoL
-----END PGP SIGNATURE-----

--=-jrQPAMTpPwECh/tIGrmE--



--===============0208552959545569884==
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.xen.org
http://lists.xen.org/xen-devel

--===============0208552959545569884==--



From xen-devel-bounces@lists.xen.org Thu Nov 01 02:14:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 02:14:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTkHm-0002xm-CP; Thu, 01 Nov 2012 02:13:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <raistlin.df@gmail.com>) id 1TTkHl-0002fT-82
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 02:13:33 +0000
Received: from [85.158.139.83:12832] by server-9.bemta-5.messagelabs.com id
	C1/CA-29295-CCAD1905; Thu, 01 Nov 2012 02:13:32 +0000
X-Env-Sender: raistlin.df@gmail.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1351736011!23617624!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21164 invoked from network); 1 Nov 2012 02:13:31 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-6.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 02:13:31 -0000
Received: by mail-ea0-f173.google.com with SMTP id a1so974470eaa.32
	for <xen-devel@lists.xen.org>; Wed, 31 Oct 2012 19:13:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:subject:from:to:cc:date:in-reply-to:references
	:content-type:x-mailer:mime-version;
	bh=xdHVECy2wLY+DLVYVfRF50kVl/dpSxyiTXFhM6/s8b8=;
	b=YcbjQoxCahHu038mPj7gIJhBMxswPQ1A5wfppnYwXvxpWe22EBjJ6e3yFeO4dPdtyZ
	n2q0PwTjVuKh2dziwLRdlptdcRYGuMKWAGeVtR+qdRpvpp6Z1lAeR5DxRcbsUwN23J3P
	kDRNdMstPAUgwhyWU+E9snuPYlbFeZpvf+7r3Hn3Yi6Mrasm0uAbEASXN8Ura0Y+ZcQA
	uv3C5hrKRQ5Uw8CQHwePiPGLvo2k+wpQ5pw4PmfZPO9s0oIQE2/iz2OXEdzJ5RjBqnv/
	OiQrXnIlVSWbTGgxMGH+wY5iTjAnZUjLNG4JE4o5Y1rmsxkI9lv24Juf4rbNkj/KxuNp
	2zsw==
Received: by 10.14.199.134 with SMTP id x6mr92592827een.31.1351736011508;
	Wed, 31 Oct 2012 19:13:31 -0700 (PDT)
Received: from [192.168.0.40] (ip-143-31.sn3.eutelia.it. [213.136.143.31])
	by mx.google.com with ESMTPS id e1sm11482925eem.3.2012.10.31.19.13.28
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 31 Oct 2012 19:13:30 -0700 (PDT)
Message-ID: <1351736001.18330.139.camel@Solace>
From: Dario Faggioli <raistlin@linux.it>
To: Tim Deegan <tim@xen.org>
Date: Thu, 01 Nov 2012 03:13:21 +0100
In-Reply-To: <20121029223555.GA24388@ocelot.phlegethon.org>
References: <60d00f38-98a3-4ec2-acbd-b49dafaada56@default>
	<20121029223555.GA24388@ocelot.phlegethon.org>
X-Mailer: Evolution 3.4.4-1
Mime-Version: 1.0
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	"Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	George Shuklin <george.shuklin@gmail.com>,
	Olaf Hering <olaf@aepfle.de>, xen-devel@lists.xen.org,
	Zhigang Wang <zhigang.x.wang@oracle.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0208552959545569884=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--===============0208552959545569884==
Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature";
	boundary="=-jrQPAMTpPwECh/tIGrmE"


--=-jrQPAMTpPwECh/tIGrmE
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, 2012-10-29 at 22:35 +0000, Tim Deegan wrote:
> At 10:06 -0700 on 29 Oct (1351505175), Dan Magenheimer wrote:
> > In the case of a dying domain, a XENMEM_release operation
> > is implied and must be executed by the hypervisor.
> >=20
> > Ideally, the quantity of unclaimed memory for each domain and
> > for the system should be query-able.  This may require additional
> > memory_op hypercalls.
> >=20
> > I'd very much appreciate feedback on this proposed design!
>=20
> As I said, I'm not opposed to this, though even after reading through
> the other thread I'm not convinced that it's necessary (except in cases
> where guest-controlled operations are allowed to consume unbounded
> memory, which frankly gives me the heebie-jeebies).
>=20
Let me also ask something.

Playing with NUMA systems I've been in the situation where it would be
nice to know not only how much free memory we have in general, but how
much free memory there is in a specific (set of) node(s), and that in
many places, from the hypervisor, to libxc, to top level toolstack.

Right now I ask this to Xen, but that is indeed prone to races and
TOCTOU issues if we allow for domain creation and ballooning
(tmem/paging/...) to happen concurrently between themselves and between
each other (as noted in the long thread that preceded this one).

Question is, the "claim" mechanism you're proposing is by no means NUMA
node-aware, right?

Thanks and Regards,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-jrQPAMTpPwECh/tIGrmE
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCR2sEACgkQk4XaBE3IOsRsfQCfbb/6tuBlKmKCmEokERwH2Tja
gNAAoKKG2iiMHTey7J1N85ONU7Mq0sjS
=ynoL
-----END PGP SIGNATURE-----

--=-jrQPAMTpPwECh/tIGrmE--



--===============0208552959545569884==
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.xen.org
http://lists.xen.org/xen-devel

--===============0208552959545569884==--



From xen-devel-bounces@lists.xen.org Thu Nov 01 05:43:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 05:43:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTnY6-0001GX-40; Thu, 01 Nov 2012 05:42:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rientjes@google.com>) id 1TTnY4-0001GS-8S
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 05:42:36 +0000
Received: from [85.158.139.211:24490] by server-9.bemta-5.messagelabs.com id
	66/9E-29295-BCB02905; Thu, 01 Nov 2012 05:42:35 +0000
X-Env-Sender: rientjes@google.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1351748553!17979063!1
X-Originating-IP: [209.85.220.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28066 invoked from network); 1 Nov 2012 05:42:34 -0000
Received: from mail-pa0-f43.google.com (HELO mail-pa0-f43.google.com)
	(209.85.220.43)
	by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 05:42:34 -0000
Received: by mail-pa0-f43.google.com with SMTP id fb1so1603196pad.30
	for <xen-devel@lists.xensource.com>;
	Wed, 31 Oct 2012 22:42:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113;
	h=date:from:x-x-sender:to:cc:subject:message-id:user-agent
	:mime-version:content-type;
	bh=EqdKn6LbzJGdB9Dly+uPZVHJd0PFo3sPP8pek9Qkzv8=;
	b=Q2BqGD/ltM3gevB/BqKxzBKQjFXBEW7QeMdrhH5Pzg9BcU+0NmKTnXoT3WZvvU65+V
	ZcEmvf4j44LMSfSMXDAreTEg0oKYnVIKpnqm/8aZlH8RU5gLg8gtyu4earrdCT4hmrUe
	FeTl8O8LKporNqJqLeSJ7PINx/I3XbJl0r8Tc7w/rGG1w9kFXR971zwdP6JonUXOeQLn
	PYYXKHW+P/3BiGE2ICKe2a5Pnx6AvKrUEdjCjkRb4y4q3pjiEjpa3dbZ5vNK3+DKJaW0
	GRFz656mGQ4Qgsnpa0FlivyX5HFU55TF+IDzXazscX6v/5xemoPRqiA4ObfDbpXLMDOE
	EN0g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=date:from:x-x-sender:to:cc:subject:message-id:user-agent
	:mime-version:content-type:x-gm-message-state;
	bh=EqdKn6LbzJGdB9Dly+uPZVHJd0PFo3sPP8pek9Qkzv8=;
	b=eL6XElcO4k96onRMd7Izsyyduj4e/Qy86DWT2yINASh2CpqXx2+qNND/VHPrxio3a5
	sTi6Xgp14kj5yFWZillRZbQ1shjXy24KMLrM+AlV278PPqhPbQq61kGCuEliLuiMJXuq
	o/EHdhMH8882z0LCdONRuhFppCYK8AK5CdH06/6J5SgIhios8o3kyoim3QC9nGaQ2bYb
	y//rAftYsaiy6tKGBcHcmUTxb3BTBBolna83Nvt0mAnheCAiAlHzaShjiSZlnF66egxb
	cOdBZi8Ssx6dSJ03E2VFfU71sLMmGuc/9HRjxHzKCBcdY9OTvcQRtbDUZaVKs1y5xCmb
	VFvQ==
Received: by 10.66.85.227 with SMTP id k3mr108120548paz.79.1351748552759;
	Wed, 31 Oct 2012 22:42:32 -0700 (PDT)
Received: from [2620:0:1008:1101:be30:5bff:fed8:5e64]
	([2620:0:1008:1101:be30:5bff:fed8:5e64])
	by mx.google.com with ESMTPS id ok3sm3481617pbb.11.2012.10.31.22.42.31
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 31 Oct 2012 22:42:31 -0700 (PDT)
Date: Wed, 31 Oct 2012 22:42:30 -0700 (PDT)
From: David Rientjes <rientjes@google.com>
X-X-Sender: rientjes@chino.kir.corp.google.com
To: Linus Torvalds <torvalds@linux-foundation.org>, 
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, 
	Jeremy Fitzhardinge <jeremy@goop.org>
Message-ID: <alpine.DEB.2.00.1210312239120.31758@chino.kir.corp.google.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
MIME-Version: 1.0
X-Gm-Message-State: ALoCoQki2wafRNQkB+pGHOm31Dtc44NqGk8cEuVHnNbCn8M5fpsXKwCtYPMD4M8v+CRvCsPiYJAVwgNd4myvHlnNuQkE4HomxKYpki02OIquTZ6c2IX0dtV9oyef93Ny7LSmhwesVf4VedIlrsvSl/2OJlG/IrbqYnfp2DRfDg22C1roMQwqn+WPy/UvKVbnWWE3+wJDSd3W54VQPhki2q+i1yY61GBKEw==
Cc: xen-devel@lists.xensource.com, x86@kernel.org, linux-kernel@vger.kernel.org,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [Xen-devel] [patch] x86,
 xen: fix build dependency when USB_SUPPORT is not enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CONFIG_XEN_DOM0 must depend on CONFIG_USB_SUPPORT, otherwise there is no 
definition of xen_dbgp_reset_prep() and xen_dbgp_external_startup() 
resulting in the following link error:

drivers/built-in.o: In function `dbgp_reset_prep':
(.text+0x1e03c5): undefined reference to `xen_dbgp_reset_prep'
drivers/built-in.o: In function `dbgp_external_startup':
(.text+0x1e0d55): undefined reference to `xen_dbgp_external_startup'

Signed-off-by: David Rientjes <rientjes@google.com>
---
 arch/x86/xen/Kconfig |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig
--- a/arch/x86/xen/Kconfig
+++ b/arch/x86/xen/Kconfig
@@ -17,6 +17,7 @@ config XEN_DOM0
 	def_bool y
 	depends on XEN && PCI_XEN && SWIOTLB_XEN
 	depends on X86_LOCAL_APIC && X86_IO_APIC && ACPI && PCI
+	depends on USB_SUPPORT
 
 # Dummy symbol since people have come to rely on the PRIVILEGED_GUEST
 # name in tools.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 05:43:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 05:43:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTnY6-0001GX-40; Thu, 01 Nov 2012 05:42:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rientjes@google.com>) id 1TTnY4-0001GS-8S
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 05:42:36 +0000
Received: from [85.158.139.211:24490] by server-9.bemta-5.messagelabs.com id
	66/9E-29295-BCB02905; Thu, 01 Nov 2012 05:42:35 +0000
X-Env-Sender: rientjes@google.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1351748553!17979063!1
X-Originating-IP: [209.85.220.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28066 invoked from network); 1 Nov 2012 05:42:34 -0000
Received: from mail-pa0-f43.google.com (HELO mail-pa0-f43.google.com)
	(209.85.220.43)
	by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 05:42:34 -0000
Received: by mail-pa0-f43.google.com with SMTP id fb1so1603196pad.30
	for <xen-devel@lists.xensource.com>;
	Wed, 31 Oct 2012 22:42:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113;
	h=date:from:x-x-sender:to:cc:subject:message-id:user-agent
	:mime-version:content-type;
	bh=EqdKn6LbzJGdB9Dly+uPZVHJd0PFo3sPP8pek9Qkzv8=;
	b=Q2BqGD/ltM3gevB/BqKxzBKQjFXBEW7QeMdrhH5Pzg9BcU+0NmKTnXoT3WZvvU65+V
	ZcEmvf4j44LMSfSMXDAreTEg0oKYnVIKpnqm/8aZlH8RU5gLg8gtyu4earrdCT4hmrUe
	FeTl8O8LKporNqJqLeSJ7PINx/I3XbJl0r8Tc7w/rGG1w9kFXR971zwdP6JonUXOeQLn
	PYYXKHW+P/3BiGE2ICKe2a5Pnx6AvKrUEdjCjkRb4y4q3pjiEjpa3dbZ5vNK3+DKJaW0
	GRFz656mGQ4Qgsnpa0FlivyX5HFU55TF+IDzXazscX6v/5xemoPRqiA4ObfDbpXLMDOE
	EN0g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=date:from:x-x-sender:to:cc:subject:message-id:user-agent
	:mime-version:content-type:x-gm-message-state;
	bh=EqdKn6LbzJGdB9Dly+uPZVHJd0PFo3sPP8pek9Qkzv8=;
	b=eL6XElcO4k96onRMd7Izsyyduj4e/Qy86DWT2yINASh2CpqXx2+qNND/VHPrxio3a5
	sTi6Xgp14kj5yFWZillRZbQ1shjXy24KMLrM+AlV278PPqhPbQq61kGCuEliLuiMJXuq
	o/EHdhMH8882z0LCdONRuhFppCYK8AK5CdH06/6J5SgIhios8o3kyoim3QC9nGaQ2bYb
	y//rAftYsaiy6tKGBcHcmUTxb3BTBBolna83Nvt0mAnheCAiAlHzaShjiSZlnF66egxb
	cOdBZi8Ssx6dSJ03E2VFfU71sLMmGuc/9HRjxHzKCBcdY9OTvcQRtbDUZaVKs1y5xCmb
	VFvQ==
Received: by 10.66.85.227 with SMTP id k3mr108120548paz.79.1351748552759;
	Wed, 31 Oct 2012 22:42:32 -0700 (PDT)
Received: from [2620:0:1008:1101:be30:5bff:fed8:5e64]
	([2620:0:1008:1101:be30:5bff:fed8:5e64])
	by mx.google.com with ESMTPS id ok3sm3481617pbb.11.2012.10.31.22.42.31
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 31 Oct 2012 22:42:31 -0700 (PDT)
Date: Wed, 31 Oct 2012 22:42:30 -0700 (PDT)
From: David Rientjes <rientjes@google.com>
X-X-Sender: rientjes@chino.kir.corp.google.com
To: Linus Torvalds <torvalds@linux-foundation.org>, 
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, 
	Jeremy Fitzhardinge <jeremy@goop.org>
Message-ID: <alpine.DEB.2.00.1210312239120.31758@chino.kir.corp.google.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
MIME-Version: 1.0
X-Gm-Message-State: ALoCoQki2wafRNQkB+pGHOm31Dtc44NqGk8cEuVHnNbCn8M5fpsXKwCtYPMD4M8v+CRvCsPiYJAVwgNd4myvHlnNuQkE4HomxKYpki02OIquTZ6c2IX0dtV9oyef93Ny7LSmhwesVf4VedIlrsvSl/2OJlG/IrbqYnfp2DRfDg22C1roMQwqn+WPy/UvKVbnWWE3+wJDSd3W54VQPhki2q+i1yY61GBKEw==
Cc: xen-devel@lists.xensource.com, x86@kernel.org, linux-kernel@vger.kernel.org,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [Xen-devel] [patch] x86,
 xen: fix build dependency when USB_SUPPORT is not enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CONFIG_XEN_DOM0 must depend on CONFIG_USB_SUPPORT, otherwise there is no 
definition of xen_dbgp_reset_prep() and xen_dbgp_external_startup() 
resulting in the following link error:

drivers/built-in.o: In function `dbgp_reset_prep':
(.text+0x1e03c5): undefined reference to `xen_dbgp_reset_prep'
drivers/built-in.o: In function `dbgp_external_startup':
(.text+0x1e0d55): undefined reference to `xen_dbgp_external_startup'

Signed-off-by: David Rientjes <rientjes@google.com>
---
 arch/x86/xen/Kconfig |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig
--- a/arch/x86/xen/Kconfig
+++ b/arch/x86/xen/Kconfig
@@ -17,6 +17,7 @@ config XEN_DOM0
 	def_bool y
 	depends on XEN && PCI_XEN && SWIOTLB_XEN
 	depends on X86_LOCAL_APIC && X86_IO_APIC && ACPI && PCI
+	depends on USB_SUPPORT
 
 # Dummy symbol since people have come to rely on the PRIVILEGED_GUEST
 # name in tools.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 06:17:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 06:17:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTo57-0001xO-3L; Thu, 01 Nov 2012 06:16:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TTo55-0001xJ-H5
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 06:16:43 +0000
Received: from [85.158.139.211:18733] by server-1.bemta-5.messagelabs.com id
	B3/61-05877-AC312905; Thu, 01 Nov 2012 06:16:42 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1351750600!18467931!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY3OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7956 invoked from network); 1 Nov 2012 06:16:41 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 06:16:41 -0000
X-IronPort-AV: E=Sophos;i="4.80,691,1344211200"; d="scan'208";a="15531047"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 06:16:40 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 1 Nov 2012 06:16:39 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TTo51-0000L3-Ey;
	Thu, 01 Nov 2012 06:16:39 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TTo51-0001aD-A5;
	Thu, 01 Nov 2012 06:16:39 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14286-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 1 Nov 2012 06:16:39 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14286: regressions - trouble:
	broken/fail/pass
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14286 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14286/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-i386-i386-xl             9 guest-start               fail REGR. vs. 14076
 test-i386-i386-xl-qemuu-winxpsp3  7 windows-install       fail REGR. vs. 14076
 test-i386-i386-xl-winxpsp3    7 windows-install           fail REGR. vs. 14076
 test-i386-i386-xl-win         7 windows-install           fail REGR. vs. 14076

Tests which are failing intermittently (not blocking):
 test-amd64-i386-win-vcpus1    3 host-install(3)           broken pass in 14280
 test-amd64-amd64-xl-sedf     11 guest-localmigrate fail in 14280 pass in 14286
 test-amd64-i386-win           7 windows-install    fail in 14280 pass in 14286

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore         fail REGR. vs. 14076

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check      fail in 14280 never pass

version targeted for testing:
 xen                  2bca7e58a3df
baseline version:
 xen                  40ccbee890e1

------------------------------------------------------------
People who touched revisions under test:
  Andres Lagar-Cavilla <andres@lagarcavilla.org>
  Bastian Blank <waldi@debian.org>
  Chuang Cao <chuang.cao@oracle.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jason McCarver <slam@parasite.cc>
  Joe Jin <joe.jin@oracle.com>
  Keir Fraser <keir@xen.org>
  Matt Wilson <msw@amazon.com>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Olaf Hering <olaf@aepfle.de>
  Roger Pau Monne <roger.pau@citrix.com>
  Sander Eikelenboom <linux@eikelenboom.it>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            fail    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     pass    
 test-amd64-i386-win-vcpus1                                   broken  
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 632 lines long.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 06:17:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 06:17:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTo57-0001xO-3L; Thu, 01 Nov 2012 06:16:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TTo55-0001xJ-H5
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 06:16:43 +0000
Received: from [85.158.139.211:18733] by server-1.bemta-5.messagelabs.com id
	B3/61-05877-AC312905; Thu, 01 Nov 2012 06:16:42 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1351750600!18467931!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY3OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7956 invoked from network); 1 Nov 2012 06:16:41 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 06:16:41 -0000
X-IronPort-AV: E=Sophos;i="4.80,691,1344211200"; d="scan'208";a="15531047"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 06:16:40 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 1 Nov 2012 06:16:39 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TTo51-0000L3-Ey;
	Thu, 01 Nov 2012 06:16:39 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TTo51-0001aD-A5;
	Thu, 01 Nov 2012 06:16:39 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14286-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 1 Nov 2012 06:16:39 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14286: regressions - trouble:
	broken/fail/pass
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14286 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14286/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-i386-i386-xl             9 guest-start               fail REGR. vs. 14076
 test-i386-i386-xl-qemuu-winxpsp3  7 windows-install       fail REGR. vs. 14076
 test-i386-i386-xl-winxpsp3    7 windows-install           fail REGR. vs. 14076
 test-i386-i386-xl-win         7 windows-install           fail REGR. vs. 14076

Tests which are failing intermittently (not blocking):
 test-amd64-i386-win-vcpus1    3 host-install(3)           broken pass in 14280
 test-amd64-amd64-xl-sedf     11 guest-localmigrate fail in 14280 pass in 14286
 test-amd64-i386-win           7 windows-install    fail in 14280 pass in 14286

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore         fail REGR. vs. 14076

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check      fail in 14280 never pass

version targeted for testing:
 xen                  2bca7e58a3df
baseline version:
 xen                  40ccbee890e1

------------------------------------------------------------
People who touched revisions under test:
  Andres Lagar-Cavilla <andres@lagarcavilla.org>
  Bastian Blank <waldi@debian.org>
  Chuang Cao <chuang.cao@oracle.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jason McCarver <slam@parasite.cc>
  Joe Jin <joe.jin@oracle.com>
  Keir Fraser <keir@xen.org>
  Matt Wilson <msw@amazon.com>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Olaf Hering <olaf@aepfle.de>
  Roger Pau Monne <roger.pau@citrix.com>
  Sander Eikelenboom <linux@eikelenboom.it>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            fail    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     pass    
 test-amd64-i386-win-vcpus1                                   broken  
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 632 lines long.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 06:18:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 06:18:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTo6V-00021t-Iz; Thu, 01 Nov 2012 06:18:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TTo6U-00021a-63
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 06:18:10 +0000
Received: from [85.158.137.99:57027] by server-14.bemta-3.messagelabs.com id
	0D/F5-12788-12412905; Thu, 01 Nov 2012 06:18:09 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1351750688!14099882!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY3OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20048 invoked from network); 1 Nov 2012 06:18:08 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 06:18:08 -0000
X-IronPort-AV: E=Sophos;i="4.80,691,1344211200"; d="scan'208";a="15531058"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 06:18:08 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 1 Nov 2012 06:18:07 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TTo6R-0000Lz-Ki;
	Thu, 01 Nov 2012 06:18:07 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TTo6R-00020U-In;
	Thu, 01 Nov 2012 06:18:07 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <E1TTo6R-00020U-In@woking.cam.xci-test.com>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 1 Nov 2012 06:18:07 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com, keir@xen.org, stefano.stabellini@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing bisection] complete test-i386-i386-xl
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

branch xen-4.2-testing
xen branch xen-4.2-testing
job test-i386-i386-xl
test guest-start

Tree: linux git://xenbits.xen.org/linux-pvops.git
Tree: qemu git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
  Bug introduced:  051e2a30e3fb
  Bug not present: c23d938e3e64


  changeset:   25886:051e2a30e3fb
  user:        Ian Campbell <Ian.Campbell@citrix.com>
  date:        Fri Oct 26 16:40:18 2012 +0100
      
      libxl: handle errors from xc_sharing_* info functions
      
      On a 32 bit hypervisor xl info currently reports:
      sharing_freed_memory   : 72057594037927935
      sharing_used_memory    : 72057594037927935
      
      Eat the ENOSYS and turn it into 0. Log and propagate other errors.
      
      I don't have a 32 bit system handy, so tested on x86_64 with a libxc
      hacked to return -ENOSYS and -EINVAL.
      
      Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
      Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
      Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
      Committed-by: Ian Campbell <ian.campbell@citrix.com>
      
      xen-unstable changeset: 25894:95a971c8058f
      Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
      Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
      
      


For bisection revision-tuple graph see:
   http://www.chiark.greenend.org.uk/~xensrcts/results/bisect.xen-4.2-testing.test-i386-i386-xl.guest-start.html
Revision IDs in each graph node refer, respectively, to the Trees above.

----------------------------------------
Searching for failure / basis pass:
 14280 fail [host=bush-cricket] / 14076 [host=earwig] 13927 [host=itch-mite] 13925 ok.
Failure / basis pass flights: 14280 / 13925
Tree: linux git://xenbits.xen.org/linux-pvops.git
Tree: qemu git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
Latest a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
Basis pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
Generating revisions with ./adhoc-revtuple-generator  git://xenbits.xen.org/linux-pvops.git#a938a246d34912423c560f475ccf1ce0c71d9d00-a938a246d34912423c560f475ccf1ce0c71d9d00 git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git#bacc0d302445c75f18f4c826750fb5853b60e7ca-bacc0d302445c75f18f4c826750fb5853b60e7ca git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git#cdf4d2bb4006805f209712fbb8ed1f83127e9984-cdf4d2bb4006805f209712fbb8ed1f83127e9984 http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg#27db446078b5-2bca7e58a3df
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-4.2-testing.hg
searching for changes
no changes found
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-4.2-testing.hg
searching for changes
no changes found
Loaded 1001 nodes in revision graph
Searching for test results:
 13925 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 13927 [host=itch-mite]
 14076 [host=earwig]
 14185 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14170 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14171 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14187 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14160 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14150 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14172 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14200 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14188 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14174 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14153 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14175 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14189 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14156 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14176 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14158 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14190 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14162 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14163 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14165 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14178 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14186 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14166 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14180 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14168 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14169 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14191 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14181 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14202 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14182 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14193 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14183 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14184 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14173 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14194 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14196 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14198 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14277 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14192 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14278 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 747c216a612c
 14281 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 8c1fb247f394
 14282 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 cd0ae0ba4653
 14283 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 051e2a30e3fb
 14280 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14285 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 c23d938e3e64
 14287 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 051e2a30e3fb
 14290 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 c23d938e3e64
 14291 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 051e2a30e3fb
 14292 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 c23d938e3e64
 14293 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 051e2a30e3fb
Searching for interesting versions
 Result found: flight 13925 (pass), for basis pass
 Result found: flight 14150 (fail), for basis failure
 Repro found: flight 14202 (pass), for basis pass
 Repro found: flight 14277 (fail), for basis failure
 0 revisions at a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 c23d938e3e64
No revisions left to test, checking graph state.
 Result found: flight 14285 (pass), for last pass
 Result found: flight 14287 (fail), for first failure
 Repro found: flight 14290 (pass), for last pass
 Repro found: flight 14291 (fail), for first failure
 Repro found: flight 14292 (pass), for last pass
 Repro found: flight 14293 (fail), for first failure

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
  Bug introduced:  051e2a30e3fb
  Bug not present: c23d938e3e64

pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-4.2-testing.hg
searching for changes
no changes found

  changeset:   25886:051e2a30e3fb
  user:        Ian Campbell <Ian.Campbell@citrix.com>
  date:        Fri Oct 26 16:40:18 2012 +0100
      
      libxl: handle errors from xc_sharing_* info functions
      
      On a 32 bit hypervisor xl info currently reports:
      sharing_freed_memory   : 72057594037927935
      sharing_used_memory    : 72057594037927935
      
      Eat the ENOSYS and turn it into 0. Log and propagate other errors.
      
      I don't have a 32 bit system handy, so tested on x86_64 with a libxc
      hacked to return -ENOSYS and -EINVAL.
      
      Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
      Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
      Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
      Committed-by: Ian Campbell <ian.campbell@citrix.com>
      
      xen-unstable changeset: 25894:95a971c8058f
      Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
      Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
      
      

Revision graph left in /home/xc_osstest/results/bisect.xen-4.2-testing.test-i386-i386-xl.guest-start.{dot,ps,png,html}.
----------------------------------------
14293: tolerable ALL FAIL

flight 14293 xen-4.2-testing real-bisect [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14293/

Failures :-/ but no regressions.

Tests which did not succeed,
including tests which could not be run:
 test-i386-i386-xl             9 guest-start             fail baseline untested


jobs:
 test-i386-i386-xl                                            fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 06:18:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 06:18:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTo6V-00021t-Iz; Thu, 01 Nov 2012 06:18:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TTo6U-00021a-63
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 06:18:10 +0000
Received: from [85.158.137.99:57027] by server-14.bemta-3.messagelabs.com id
	0D/F5-12788-12412905; Thu, 01 Nov 2012 06:18:09 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1351750688!14099882!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY3OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20048 invoked from network); 1 Nov 2012 06:18:08 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 06:18:08 -0000
X-IronPort-AV: E=Sophos;i="4.80,691,1344211200"; d="scan'208";a="15531058"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 06:18:08 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 1 Nov 2012 06:18:07 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TTo6R-0000Lz-Ki;
	Thu, 01 Nov 2012 06:18:07 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TTo6R-00020U-In;
	Thu, 01 Nov 2012 06:18:07 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <E1TTo6R-00020U-In@woking.cam.xci-test.com>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 1 Nov 2012 06:18:07 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com, keir@xen.org, stefano.stabellini@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing bisection] complete test-i386-i386-xl
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

branch xen-4.2-testing
xen branch xen-4.2-testing
job test-i386-i386-xl
test guest-start

Tree: linux git://xenbits.xen.org/linux-pvops.git
Tree: qemu git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
  Bug introduced:  051e2a30e3fb
  Bug not present: c23d938e3e64


  changeset:   25886:051e2a30e3fb
  user:        Ian Campbell <Ian.Campbell@citrix.com>
  date:        Fri Oct 26 16:40:18 2012 +0100
      
      libxl: handle errors from xc_sharing_* info functions
      
      On a 32 bit hypervisor xl info currently reports:
      sharing_freed_memory   : 72057594037927935
      sharing_used_memory    : 72057594037927935
      
      Eat the ENOSYS and turn it into 0. Log and propagate other errors.
      
      I don't have a 32 bit system handy, so tested on x86_64 with a libxc
      hacked to return -ENOSYS and -EINVAL.
      
      Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
      Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
      Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
      Committed-by: Ian Campbell <ian.campbell@citrix.com>
      
      xen-unstable changeset: 25894:95a971c8058f
      Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
      Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
      
      


For bisection revision-tuple graph see:
   http://www.chiark.greenend.org.uk/~xensrcts/results/bisect.xen-4.2-testing.test-i386-i386-xl.guest-start.html
Revision IDs in each graph node refer, respectively, to the Trees above.

----------------------------------------
Searching for failure / basis pass:
 14280 fail [host=bush-cricket] / 14076 [host=earwig] 13927 [host=itch-mite] 13925 ok.
Failure / basis pass flights: 14280 / 13925
Tree: linux git://xenbits.xen.org/linux-pvops.git
Tree: qemu git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
Latest a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
Basis pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
Generating revisions with ./adhoc-revtuple-generator  git://xenbits.xen.org/linux-pvops.git#a938a246d34912423c560f475ccf1ce0c71d9d00-a938a246d34912423c560f475ccf1ce0c71d9d00 git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git#bacc0d302445c75f18f4c826750fb5853b60e7ca-bacc0d302445c75f18f4c826750fb5853b60e7ca git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git#cdf4d2bb4006805f209712fbb8ed1f83127e9984-cdf4d2bb4006805f209712fbb8ed1f83127e9984 http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg#27db446078b5-2bca7e58a3df
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-4.2-testing.hg
searching for changes
no changes found
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-4.2-testing.hg
searching for changes
no changes found
Loaded 1001 nodes in revision graph
Searching for test results:
 13925 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 13927 [host=itch-mite]
 14076 [host=earwig]
 14185 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14170 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14171 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14187 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14160 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14150 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14172 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14200 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14188 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14174 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14153 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14175 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14189 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14156 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14176 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14158 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14190 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14162 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14163 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14165 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14178 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14186 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14166 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14180 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14168 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14169 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14191 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14181 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14202 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14182 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14193 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14183 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14184 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14173 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14194 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14196 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14198 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27db446078b5
 14277 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14192 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14278 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 747c216a612c
 14281 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 8c1fb247f394
 14282 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 cd0ae0ba4653
 14283 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 051e2a30e3fb
 14280 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14285 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 c23d938e3e64
 14287 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 051e2a30e3fb
 14290 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 c23d938e3e64
 14291 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 051e2a30e3fb
 14292 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 c23d938e3e64
 14293 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 051e2a30e3fb
Searching for interesting versions
 Result found: flight 13925 (pass), for basis pass
 Result found: flight 14150 (fail), for basis failure
 Repro found: flight 14202 (pass), for basis pass
 Repro found: flight 14277 (fail), for basis failure
 0 revisions at a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 c23d938e3e64
No revisions left to test, checking graph state.
 Result found: flight 14285 (pass), for last pass
 Result found: flight 14287 (fail), for first failure
 Repro found: flight 14290 (pass), for last pass
 Repro found: flight 14291 (fail), for first failure
 Repro found: flight 14292 (pass), for last pass
 Repro found: flight 14293 (fail), for first failure

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
  Bug introduced:  051e2a30e3fb
  Bug not present: c23d938e3e64

pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-4.2-testing.hg
searching for changes
no changes found

  changeset:   25886:051e2a30e3fb
  user:        Ian Campbell <Ian.Campbell@citrix.com>
  date:        Fri Oct 26 16:40:18 2012 +0100
      
      libxl: handle errors from xc_sharing_* info functions
      
      On a 32 bit hypervisor xl info currently reports:
      sharing_freed_memory   : 72057594037927935
      sharing_used_memory    : 72057594037927935
      
      Eat the ENOSYS and turn it into 0. Log and propagate other errors.
      
      I don't have a 32 bit system handy, so tested on x86_64 with a libxc
      hacked to return -ENOSYS and -EINVAL.
      
      Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
      Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
      Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
      Committed-by: Ian Campbell <ian.campbell@citrix.com>
      
      xen-unstable changeset: 25894:95a971c8058f
      Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
      Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
      
      

Revision graph left in /home/xc_osstest/results/bisect.xen-4.2-testing.test-i386-i386-xl.guest-start.{dot,ps,png,html}.
----------------------------------------
14293: tolerable ALL FAIL

flight 14293 xen-4.2-testing real-bisect [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14293/

Failures :-/ but no regressions.

Tests which did not succeed,
including tests which could not be run:
 test-i386-i386-xl             9 guest-start             fail baseline untested


jobs:
 test-i386-i386-xl                                            fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 06:36:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 06:36:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TToNb-0002Tr-8x; Thu, 01 Nov 2012 06:35:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TToNZ-0002Tm-BV
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 06:35:49 +0000
Received: from [193.109.254.147:19233] by server-4.bemta-14.messagelabs.com id
	65/01-18856-44812905; Thu, 01 Nov 2012 06:35:48 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1351751745!2358914!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzYxNzc4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7071 invoked from network); 1 Nov 2012 06:35:46 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-15.tower-27.messagelabs.com with SMTP;
	1 Nov 2012 06:35:46 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 31 Oct 2012 23:35:14 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,691,1344236400"; 
	d="scan'208,223";a="213837549"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by orsmga001.jf.intel.com with ESMTP; 31 Oct 2012 23:35:45 -0700
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 31 Oct 2012 23:35:44 -0700
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Thu, 1 Nov 2012 14:34:46 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thread-Topic: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
Thread-Index: AQHNs7Z0Ti91BiFLfUibRvXA4zlK85fUjX6A
Date: Thu, 1 Nov 2012 06:34:45 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<5089676602000078000A4928@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC82923353723C7@SHSMSX101.ccr.corp.intel.com>
	<508A89CB020000780008E6ED@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
In-Reply-To: <20121026201409.GF2708@phenom.dumpdata.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_002_DE8DF0795D48FD4CA783C40EC8292335377346SHSMSX101ccrcorpi_"
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_DE8DF0795D48FD4CA783C40EC8292335377346SHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Thanks! updated as attached.

Jinsong

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>From f514b97628945cfac00efb0d456f133d44754c9d Mon Sep 17 00:00:00 2001
From: Liu, Jinsong <jinsong.liu@intel.com>
Date: Thu, 1 Nov 2012 21:02:36 +0800
Subject: [PATCH 1/2] Xen acpi pad implement

PAD is acpi Processor Aggregator Device which provides a control point
that enables the platform to perform specific processor configuration
and control that applies to all processors in the platform.

This patch is to implement Xen acpi pad logic. When running under Xen
virt platform, native pad driver would not work. Instead Xen pad driver,
a self-contained and very thin logic level, would take over acpi pad staff.
When acpi pad notify OSPM, xen pad logic intercept and parse _PUR object
and then hypercall to hyervisor for the rest work, say, core parking.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 drivers/xen/Makefile             |    1 +
 drivers/xen/xen_acpi_pad.c       |  206 ++++++++++++++++++++++++++++++++++=
++++
 include/xen/interface/platform.h |   17 +++
 3 files changed, 224 insertions(+), 0 deletions(-)
 create mode 100644 drivers/xen/xen_acpi_pad.c

diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 0e86370..a2af622 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -29,6 +29,7 @@ obj-$(CONFIG_XEN_MCE_LOG)		+=3D mcelog.o
 obj-$(CONFIG_XEN_PCIDEV_BACKEND)	+=3D xen-pciback/
 obj-$(CONFIG_XEN_PRIVCMD)		+=3D xen-privcmd.o
 obj-$(CONFIG_XEN_ACPI_PROCESSOR)	+=3D xen-acpi-processor.o
+obj-$(CONFIG_XEN_DOM0)			+=3D xen_acpi_pad.o
 xen-evtchn-y				:=3D evtchn.o
 xen-gntdev-y				:=3D gntdev.o
 xen-gntalloc-y				:=3D gntalloc.o
diff --git a/drivers/xen/xen_acpi_pad.c b/drivers/xen/xen_acpi_pad.c
new file mode 100644
index 0000000..e8c26a4
--- /dev/null
+++ b/drivers/xen/xen_acpi_pad.c
@@ -0,0 +1,206 @@
+/*
+ * xen_acpi_pad.c - Xen pad interface
+ *
+ * Copyright (c) 2012, Intel Corporation.
+ *    Author: Liu, Jinsong <jinsong.liu@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License f=
or
+ * more details.
+ */
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <acpi/acpi_bus.h>
+#include <acpi/acpi_drivers.h>
+#include <asm/xen/hypercall.h>
+#include <xen/interface/version.h>
+
+#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"acpi_pad"
+#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
+#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
+
+static DEFINE_MUTEX(xen_pad_lock);
+
+static int xen_pad_set_idle_cpus(int num_cpus)
+{
+	struct xen_platform_op op;
+
+	if (num_cpus < 0)
+		return -EINVAL;
+
+	/* set cpu nums expected to be idled */
+	op.cmd =3D XENPF_core_parking;
+	op.u.core_parking.type =3D XEN_CORE_PARKING_SET;
+	op.u.core_parking.idle_nums =3D num_cpus;
+
+	return HYPERVISOR_dom0_op(&op);
+}
+
+/*
+ * Cannot get idle cpus by using hypercall once (shared with _SET)
+ * because of the characteristic of Xen continue_hypercall_on_cpu
+ */
+static int xen_pad_get_idle_cpus(void)
+{
+	int ret;
+	struct xen_platform_op op;
+
+	/* get cpu nums actually be idled */
+	op.cmd =3D XENPF_core_parking;
+	op.u.core_parking.type =3D XEN_CORE_PARKING_GET;
+	ret =3D HYPERVISOR_dom0_op(&op);
+	if (ret < 0)
+		return ret;
+
+	return op.u.core_parking.idle_nums;
+}
+
+/*
+ * Query firmware how many CPUs should be idle
+ * return -1 on failure
+ */
+static int xen_acpi_pad_pur(acpi_handle handle)
+{
+	struct acpi_buffer buffer =3D {ACPI_ALLOCATE_BUFFER, NULL};
+	union acpi_object *package;
+	int num =3D -1;
+
+	if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))
+		return num;
+
+	if (!buffer.length || !buffer.pointer)
+		return num;
+
+	package =3D buffer.pointer;
+
+	if (package->type =3D=3D ACPI_TYPE_PACKAGE &&
+		package->package.count =3D=3D 2 &&
+		package->package.elements[0].integer.value =3D=3D 1) /* rev 1 */
+
+		num =3D package->package.elements[1].integer.value;
+
+	kfree(buffer.pointer);
+	return num;
+}
+
+/* Notify firmware how many CPUs are idle */
+static void xen_acpi_pad_ost(acpi_handle handle, int stat,
+	uint32_t idle_cpus)
+{
+	union acpi_object params[3] =3D {
+		{.type =3D ACPI_TYPE_INTEGER,},
+		{.type =3D ACPI_TYPE_INTEGER,},
+		{.type =3D ACPI_TYPE_BUFFER,},
+	};
+	struct acpi_object_list arg_list =3D {3, params};
+
+	params[0].integer.value =3D ACPI_PROCESSOR_AGGREGATOR_NOTIFY;
+	params[1].integer.value =3D  stat;
+	params[2].buffer.length =3D 4;
+	params[2].buffer.pointer =3D (void *)&idle_cpus;
+	acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
+}
+
+static void xen_acpi_pad_handle_notify(acpi_handle handle)
+{
+	int num_cpus;
+
+	num_cpus =3D xen_acpi_pad_pur(handle);
+	if (num_cpus < 0)
+		return;
+
+	mutex_lock(&xen_pad_lock);
+	if (xen_pad_set_idle_cpus(num_cpus)) {
+		mutex_unlock(&xen_pad_lock);
+		return;
+	}
+
+	num_cpus =3D xen_pad_get_idle_cpus();
+	if (num_cpus < 0) {
+		mutex_unlock(&xen_pad_lock);
+		return;
+	}
+	mutex_unlock(&xen_pad_lock);
+
+	xen_acpi_pad_ost(handle, 0, num_cpus);
+}
+
+static void xen_acpi_pad_notify(acpi_handle handle, u32 event,
+	void *data)
+{
+	switch (event) {
+	case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
+		xen_acpi_pad_handle_notify(handle);
+		break;
+	default:
+		pr_warn("Unsupported event [0x%x]\n", event);
+		break;
+	}
+}
+
+static int xen_acpi_pad_add(struct acpi_device *device)
+{
+	acpi_status status;
+
+	strcpy(acpi_device_name(device), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
+	strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);
+
+	status =3D acpi_install_notify_handler(device->handle,
+		 ACPI_DEVICE_NOTIFY, xen_acpi_pad_notify, device);
+	if (ACPI_FAILURE(status))
+		return -ENODEV;
+
+	return 0;
+}
+
+static int xen_acpi_pad_remove(struct acpi_device *device,
+	int type)
+{
+	mutex_lock(&xen_pad_lock);
+	xen_pad_set_idle_cpus(0);
+	mutex_unlock(&xen_pad_lock);
+
+	acpi_remove_notify_handler(device->handle,
+		ACPI_DEVICE_NOTIFY, xen_acpi_pad_notify);
+	return 0;
+}
+
+static const struct acpi_device_id pad_device_ids[] =3D {
+	{"ACPI000C", 0},
+	{"", 0},
+};
+
+static struct acpi_driver xen_acpi_pad_driver =3D {
+	.name =3D "processor_aggregator",
+	.class =3D ACPI_PROCESSOR_AGGREGATOR_CLASS,
+	.ids =3D pad_device_ids,
+	.ops =3D {
+		.add =3D xen_acpi_pad_add,
+		.remove =3D xen_acpi_pad_remove,
+	},
+};
+
+static int __init xen_acpi_pad_init(void)
+{
+	int ret =3D -ENOSYS;
+	unsigned int version =3D HYPERVISOR_xen_version(XENVER_version, NULL);
+	unsigned int major =3D version >> 16;
+	unsigned int minor =3D version & 0xffff;
+
+	/* Only DOM0 is responsible for Xen acpi pad */
+	if (!xen_initial_domain())
+		return -ENODEV;
+
+	/* Only Xen4.2 or later support Xen acpi pad */
+	if (((major =3D=3D 4) && (minor >=3D 2)) || (major > 4))
+		ret =3D acpi_bus_register_driver(&xen_acpi_pad_driver);
+
+	return ret;
+}
+subsys_initcall(xen_acpi_pad_init);
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platf=
orm.h
index 4755b5f..a3be54c 100644
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
@@ -324,6 +324,22 @@ struct xenpf_cpu_ol {
 };
 DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
=20
+/*
+ * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd,
+ * which are already occupied at Xen hypervisor side.
+ */
+#define XENPF_core_parking	60
+struct xenpf_core_parking {
+	/* IN variables */
+#define XEN_CORE_PARKING_SET	1
+#define XEN_CORE_PARKING_GET	2
+	uint32_t type;
+	/* IN variables:  set cpu nums expected to be idled */
+	/* OUT variables: get cpu nums actually be idled */
+	uint32_t idle_nums;
+};
+DEFINE_GUEST_HANDLE_STRUCT(xenpf_core_parking);
+
 struct xen_platform_op {
 	uint32_t cmd;
 	uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -341,6 +357,7 @@ struct xen_platform_op {
 		struct xenpf_set_processor_pminfo set_pminfo;
 		struct xenpf_pcpuinfo          pcpu_info;
 		struct xenpf_cpu_ol            cpu_ol;
+		struct xenpf_core_parking      core_parking;
 		uint8_t                        pad[128];
 	} u;
 };
--=20
1.7.1

--_002_DE8DF0795D48FD4CA783C40EC8292335377346SHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
	name="0001-Xen-acpi-pad-implement.patch"
Content-Description: 0001-Xen-acpi-pad-implement.patch
Content-Disposition: attachment;
	filename="0001-Xen-acpi-pad-implement.patch"; size=8184;
	creation-date="Thu, 01 Nov 2012 06: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W5fcGxh
dGZvcm1fb3AgewogCQlzdHJ1Y3QgeGVucGZfc2V0X3Byb2Nlc3Nvcl9wbWluZm8gc2V0X3BtaW5m
bzsKIAkJc3RydWN0IHhlbnBmX3BjcHVpbmZvICAgICAgICAgIHBjcHVfaW5mbzsKIAkJc3RydWN0
IHhlbnBmX2NwdV9vbCAgICAgICAgICAgIGNwdV9vbDsKKwkJc3RydWN0IHhlbnBmX2NvcmVfcGFy
a2luZyAgICAgIGNvcmVfcGFya2luZzsKIAkJdWludDhfdCAgICAgICAgICAgICAgICAgICAgICAg
IHBhZFsxMjhdOwogCX0gdTsKIH07Ci0tIAoxLjcuMQoK

--_002_DE8DF0795D48FD4CA783C40EC8292335377346SHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_002_DE8DF0795D48FD4CA783C40EC8292335377346SHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Thu Nov 01 06:36:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 06:36:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TToNb-0002Tr-8x; Thu, 01 Nov 2012 06:35:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TToNZ-0002Tm-BV
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 06:35:49 +0000
Received: from [193.109.254.147:19233] by server-4.bemta-14.messagelabs.com id
	65/01-18856-44812905; Thu, 01 Nov 2012 06:35:48 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1351751745!2358914!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzYxNzc4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7071 invoked from network); 1 Nov 2012 06:35:46 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-15.tower-27.messagelabs.com with SMTP;
	1 Nov 2012 06:35:46 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 31 Oct 2012 23:35:14 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,691,1344236400"; 
	d="scan'208,223";a="213837549"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by orsmga001.jf.intel.com with ESMTP; 31 Oct 2012 23:35:45 -0700
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 31 Oct 2012 23:35:44 -0700
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Thu, 1 Nov 2012 14:34:46 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thread-Topic: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
Thread-Index: AQHNs7Z0Ti91BiFLfUibRvXA4zlK85fUjX6A
Date: Thu, 1 Nov 2012 06:34:45 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<5089676602000078000A4928@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC82923353723C7@SHSMSX101.ccr.corp.intel.com>
	<508A89CB020000780008E6ED@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
In-Reply-To: <20121026201409.GF2708@phenom.dumpdata.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_002_DE8DF0795D48FD4CA783C40EC8292335377346SHSMSX101ccrcorpi_"
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_DE8DF0795D48FD4CA783C40EC8292335377346SHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Thanks! updated as attached.

Jinsong

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>From f514b97628945cfac00efb0d456f133d44754c9d Mon Sep 17 00:00:00 2001
From: Liu, Jinsong <jinsong.liu@intel.com>
Date: Thu, 1 Nov 2012 21:02:36 +0800
Subject: [PATCH 1/2] Xen acpi pad implement

PAD is acpi Processor Aggregator Device which provides a control point
that enables the platform to perform specific processor configuration
and control that applies to all processors in the platform.

This patch is to implement Xen acpi pad logic. When running under Xen
virt platform, native pad driver would not work. Instead Xen pad driver,
a self-contained and very thin logic level, would take over acpi pad staff.
When acpi pad notify OSPM, xen pad logic intercept and parse _PUR object
and then hypercall to hyervisor for the rest work, say, core parking.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 drivers/xen/Makefile             |    1 +
 drivers/xen/xen_acpi_pad.c       |  206 ++++++++++++++++++++++++++++++++++=
++++
 include/xen/interface/platform.h |   17 +++
 3 files changed, 224 insertions(+), 0 deletions(-)
 create mode 100644 drivers/xen/xen_acpi_pad.c

diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 0e86370..a2af622 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -29,6 +29,7 @@ obj-$(CONFIG_XEN_MCE_LOG)		+=3D mcelog.o
 obj-$(CONFIG_XEN_PCIDEV_BACKEND)	+=3D xen-pciback/
 obj-$(CONFIG_XEN_PRIVCMD)		+=3D xen-privcmd.o
 obj-$(CONFIG_XEN_ACPI_PROCESSOR)	+=3D xen-acpi-processor.o
+obj-$(CONFIG_XEN_DOM0)			+=3D xen_acpi_pad.o
 xen-evtchn-y				:=3D evtchn.o
 xen-gntdev-y				:=3D gntdev.o
 xen-gntalloc-y				:=3D gntalloc.o
diff --git a/drivers/xen/xen_acpi_pad.c b/drivers/xen/xen_acpi_pad.c
new file mode 100644
index 0000000..e8c26a4
--- /dev/null
+++ b/drivers/xen/xen_acpi_pad.c
@@ -0,0 +1,206 @@
+/*
+ * xen_acpi_pad.c - Xen pad interface
+ *
+ * Copyright (c) 2012, Intel Corporation.
+ *    Author: Liu, Jinsong <jinsong.liu@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License f=
or
+ * more details.
+ */
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <acpi/acpi_bus.h>
+#include <acpi/acpi_drivers.h>
+#include <asm/xen/hypercall.h>
+#include <xen/interface/version.h>
+
+#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"acpi_pad"
+#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
+#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
+
+static DEFINE_MUTEX(xen_pad_lock);
+
+static int xen_pad_set_idle_cpus(int num_cpus)
+{
+	struct xen_platform_op op;
+
+	if (num_cpus < 0)
+		return -EINVAL;
+
+	/* set cpu nums expected to be idled */
+	op.cmd =3D XENPF_core_parking;
+	op.u.core_parking.type =3D XEN_CORE_PARKING_SET;
+	op.u.core_parking.idle_nums =3D num_cpus;
+
+	return HYPERVISOR_dom0_op(&op);
+}
+
+/*
+ * Cannot get idle cpus by using hypercall once (shared with _SET)
+ * because of the characteristic of Xen continue_hypercall_on_cpu
+ */
+static int xen_pad_get_idle_cpus(void)
+{
+	int ret;
+	struct xen_platform_op op;
+
+	/* get cpu nums actually be idled */
+	op.cmd =3D XENPF_core_parking;
+	op.u.core_parking.type =3D XEN_CORE_PARKING_GET;
+	ret =3D HYPERVISOR_dom0_op(&op);
+	if (ret < 0)
+		return ret;
+
+	return op.u.core_parking.idle_nums;
+}
+
+/*
+ * Query firmware how many CPUs should be idle
+ * return -1 on failure
+ */
+static int xen_acpi_pad_pur(acpi_handle handle)
+{
+	struct acpi_buffer buffer =3D {ACPI_ALLOCATE_BUFFER, NULL};
+	union acpi_object *package;
+	int num =3D -1;
+
+	if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))
+		return num;
+
+	if (!buffer.length || !buffer.pointer)
+		return num;
+
+	package =3D buffer.pointer;
+
+	if (package->type =3D=3D ACPI_TYPE_PACKAGE &&
+		package->package.count =3D=3D 2 &&
+		package->package.elements[0].integer.value =3D=3D 1) /* rev 1 */
+
+		num =3D package->package.elements[1].integer.value;
+
+	kfree(buffer.pointer);
+	return num;
+}
+
+/* Notify firmware how many CPUs are idle */
+static void xen_acpi_pad_ost(acpi_handle handle, int stat,
+	uint32_t idle_cpus)
+{
+	union acpi_object params[3] =3D {
+		{.type =3D ACPI_TYPE_INTEGER,},
+		{.type =3D ACPI_TYPE_INTEGER,},
+		{.type =3D ACPI_TYPE_BUFFER,},
+	};
+	struct acpi_object_list arg_list =3D {3, params};
+
+	params[0].integer.value =3D ACPI_PROCESSOR_AGGREGATOR_NOTIFY;
+	params[1].integer.value =3D  stat;
+	params[2].buffer.length =3D 4;
+	params[2].buffer.pointer =3D (void *)&idle_cpus;
+	acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
+}
+
+static void xen_acpi_pad_handle_notify(acpi_handle handle)
+{
+	int num_cpus;
+
+	num_cpus =3D xen_acpi_pad_pur(handle);
+	if (num_cpus < 0)
+		return;
+
+	mutex_lock(&xen_pad_lock);
+	if (xen_pad_set_idle_cpus(num_cpus)) {
+		mutex_unlock(&xen_pad_lock);
+		return;
+	}
+
+	num_cpus =3D xen_pad_get_idle_cpus();
+	if (num_cpus < 0) {
+		mutex_unlock(&xen_pad_lock);
+		return;
+	}
+	mutex_unlock(&xen_pad_lock);
+
+	xen_acpi_pad_ost(handle, 0, num_cpus);
+}
+
+static void xen_acpi_pad_notify(acpi_handle handle, u32 event,
+	void *data)
+{
+	switch (event) {
+	case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
+		xen_acpi_pad_handle_notify(handle);
+		break;
+	default:
+		pr_warn("Unsupported event [0x%x]\n", event);
+		break;
+	}
+}
+
+static int xen_acpi_pad_add(struct acpi_device *device)
+{
+	acpi_status status;
+
+	strcpy(acpi_device_name(device), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
+	strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);
+
+	status =3D acpi_install_notify_handler(device->handle,
+		 ACPI_DEVICE_NOTIFY, xen_acpi_pad_notify, device);
+	if (ACPI_FAILURE(status))
+		return -ENODEV;
+
+	return 0;
+}
+
+static int xen_acpi_pad_remove(struct acpi_device *device,
+	int type)
+{
+	mutex_lock(&xen_pad_lock);
+	xen_pad_set_idle_cpus(0);
+	mutex_unlock(&xen_pad_lock);
+
+	acpi_remove_notify_handler(device->handle,
+		ACPI_DEVICE_NOTIFY, xen_acpi_pad_notify);
+	return 0;
+}
+
+static const struct acpi_device_id pad_device_ids[] =3D {
+	{"ACPI000C", 0},
+	{"", 0},
+};
+
+static struct acpi_driver xen_acpi_pad_driver =3D {
+	.name =3D "processor_aggregator",
+	.class =3D ACPI_PROCESSOR_AGGREGATOR_CLASS,
+	.ids =3D pad_device_ids,
+	.ops =3D {
+		.add =3D xen_acpi_pad_add,
+		.remove =3D xen_acpi_pad_remove,
+	},
+};
+
+static int __init xen_acpi_pad_init(void)
+{
+	int ret =3D -ENOSYS;
+	unsigned int version =3D HYPERVISOR_xen_version(XENVER_version, NULL);
+	unsigned int major =3D version >> 16;
+	unsigned int minor =3D version & 0xffff;
+
+	/* Only DOM0 is responsible for Xen acpi pad */
+	if (!xen_initial_domain())
+		return -ENODEV;
+
+	/* Only Xen4.2 or later support Xen acpi pad */
+	if (((major =3D=3D 4) && (minor >=3D 2)) || (major > 4))
+		ret =3D acpi_bus_register_driver(&xen_acpi_pad_driver);
+
+	return ret;
+}
+subsys_initcall(xen_acpi_pad_init);
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platf=
orm.h
index 4755b5f..a3be54c 100644
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
@@ -324,6 +324,22 @@ struct xenpf_cpu_ol {
 };
 DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
=20
+/*
+ * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd,
+ * which are already occupied at Xen hypervisor side.
+ */
+#define XENPF_core_parking	60
+struct xenpf_core_parking {
+	/* IN variables */
+#define XEN_CORE_PARKING_SET	1
+#define XEN_CORE_PARKING_GET	2
+	uint32_t type;
+	/* IN variables:  set cpu nums expected to be idled */
+	/* OUT variables: get cpu nums actually be idled */
+	uint32_t idle_nums;
+};
+DEFINE_GUEST_HANDLE_STRUCT(xenpf_core_parking);
+
 struct xen_platform_op {
 	uint32_t cmd;
 	uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -341,6 +357,7 @@ struct xen_platform_op {
 		struct xenpf_set_processor_pminfo set_pminfo;
 		struct xenpf_pcpuinfo          pcpu_info;
 		struct xenpf_cpu_ol            cpu_ol;
+		struct xenpf_core_parking      core_parking;
 		uint8_t                        pad[128];
 	} u;
 };
--=20
1.7.1

--_002_DE8DF0795D48FD4CA783C40EC8292335377346SHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
	name="0001-Xen-acpi-pad-implement.patch"
Content-Description: 0001-Xen-acpi-pad-implement.patch
Content-Disposition: attachment;
	filename="0001-Xen-acpi-pad-implement.patch"; size=8184;
	creation-date="Thu, 01 Nov 2012 06:25:57 GMT";
	modification-date="Thu, 01 Nov 2012 13:29:12 GMT"
Content-Transfer-Encoding: base64

RnJvbSBmNTE0Yjk3NjI4OTQ1Y2ZhYzAwZWZiMGQ0NTZmMTMzZDQ0NzU0YzlkIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBMaXUsIEppbnNvbmcgPGppbnNvbmcubGl1QGludGVsLmNvbT4K
RGF0ZTogVGh1LCAxIE5vdiAyMDEyIDIxOjAyOjM2ICswODAwClN1YmplY3Q6IFtQQVRDSCAxLzJd
IFhlbiBhY3BpIH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FsxMjhdOwogCX0gdTsKIH07Ci0tIAoxLjcuMQoK

--_002_DE8DF0795D48FD4CA783C40EC8292335377346SHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_002_DE8DF0795D48FD4CA783C40EC8292335377346SHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Thu Nov 01 06:39:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 06:39:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TToQt-0002f0-5e; Thu, 01 Nov 2012 06:39:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TToQr-0002eu-U9
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 06:39:14 +0000
Received: from [85.158.139.83:56213] by server-9.bemta-5.messagelabs.com id
	E3/97-29295-11912905; Thu, 01 Nov 2012 06:39:13 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1351751951!25529376!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzYxNzc4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8447 invoked from network); 1 Nov 2012 06:39:12 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-4.tower-182.messagelabs.com with SMTP;
	1 Nov 2012 06:39:12 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga102.jf.intel.com with ESMTP; 31 Oct 2012 23:38:40 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,691,1344236400"; 
	d="scan'208,223";a="235568496"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by orsmga002.jf.intel.com with ESMTP; 31 Oct 2012 23:38:50 -0700
Received: from fmsmsx101.amr.corp.intel.com (10.19.9.52) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 31 Oct 2012 23:38:50 -0700
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX101.amr.corp.intel.com (10.19.9.52) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 31 Oct 2012 23:38:50 -0700
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Thu, 1 Nov 2012 14:38:42 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Thread-Topic: [PATCH 2/2] Revert pad config check in xen_check_mwait
Thread-Index: Ac2yq1FN1e+6ZP87QOCrcigNApJpmAFT/F+A
Date: Thu, 1 Nov 2012 06:38:41 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537735C@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC8292335371593@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC8292335371593@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_002_DE8DF0795D48FD4CA783C40EC829233537735CSHSMSX101ccrcorpi_"
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 2/2] Revert pad config check in
	xen_check_mwait
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_DE8DF0795D48FD4CA783C40EC829233537735CSHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Updated, adding version check at mwait routine.

Thanks,
Jinsong

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>From 27e28963d4d25e4c998b5b5ea3828a02e6de9470 Mon Sep 17 00:00:00 2001
From: Liu, Jinsong <jinsong.liu@intel.com>
Date: Thu, 1 Nov 2012 21:18:43 +0800
Subject: [PATCH 2/2] Revert pad config check in xen_check_mwait

With Xen acpi pad logic added into kernel, we can now revert xen mwait rela=
ted
patch df88b2d96e36d9a9e325bfcd12eb45671cbbc937. The reason is, when running=
 under
newer Xen platform, Xen pad driver would be early loaded, so native pad dri=
ver
would fail to be loaded, and hence no mwait/monitor #UD risk again.

Another point is, only Xen4.2 or later support Xen acpi pad, so we won't ex=
pose
mwait cpuid capability when running under older Xen platform.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 arch/x86/xen/enlighten.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 586d838..9e22e41 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -287,8 +287,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *b=
x,
=20
 static bool __init xen_check_mwait(void)
 {
-#if defined(CONFIG_ACPI) && !defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR) && =
\
-	!defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR_MODULE)
+#ifdef CONFIG_ACPI
 	struct xen_platform_op op =3D {
 		.cmd			=3D XENPF_set_processor_pminfo,
 		.u.set_pminfo.id	=3D -1,
@@ -297,6 +296,10 @@ static bool __init xen_check_mwait(void)
 	uint32_t buf[3];
 	unsigned int ax, bx, cx, dx;
 	unsigned int mwait_mask;
+	unsigned int version =3D HYPERVISOR_xen_version(XENVER_version, NULL);
+	unsigned int major =3D version >> 16;
+	unsigned int minor =3D version & 0xffff;
+
=20
 	/* We need to determine whether it is OK to expose the MWAIT
 	 * capability to the kernel to harvest deeper than C3 states from ACPI
@@ -309,6 +312,13 @@ static bool __init xen_check_mwait(void)
 	if (!xen_initial_domain())
 		return false;
=20
+	/*
+	 * When running under platform earlier than Xen4.2, do not expose
+	 * mwait, to avoid the risk of loading native acpi pad driver
+	 */
+	if (((major =3D=3D 4) && (minor < 2)) || (major < 4))
+		return false;
+
 	ax =3D 1;
 	cx =3D 0;
=20
--=20
1.7.1

--_002_DE8DF0795D48FD4CA783C40EC829233537735CSHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
	name="0002-Revert-pad-config-check-in-xen_check_mwait.patch"
Content-Description: 0002-Revert-pad-config-check-in-xen_check_mwait.patch
Content-Disposition: attachment;
	filename="0002-Revert-pad-config-check-in-xen_check_mwait.patch"; size=2139;
	creation-date="Thu, 01 Nov 2012 06:25:57 GMT";
	modification-date="Thu, 01 Nov 2012 13:29:12 GMT"
Content-Transfer-Encoding: base64

RnJvbSAyN2UyODk2M2Q0ZDI1ZTRjOTk4YjViNWVhMzgyOGEwM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JiAweGZmZmY7CisKIAogCS8qIFdl
IG5lZWQgdG8gZGV0ZXJtaW5lIHdoZXRoZXIgaXQgaXMgT0sgdG8gZXhwb3NlIHRoZSBNV0FJVAog
CSAqIGNhcGFiaWxpdHkgdG8gdGhlIGtlcm5lbCB0byBoYXJ2ZXN0IGRlZXBlciB0aGFuIEMzIHN0
YXRlcyBmcm9tIEFDUEkKQEAgLTMwOSw2ICszMTIsMTMgQEAgc3RhdGljIGJvb2wgX19pbml0IHhl
bl9jaGVja19td2FpdCh2b2lkKQogCWlmICgheGVuX2luaXRpYWxfZG9tYWluKCkpCiAJCXJldHVy
biBmYWxzZTsKIAorCS8qCisJICogV2hlbiBydW5uaW5nIHVuZGVyIHBsYXRmb3JtIGVhcmxpZXIg
dGhhbiBYZW40LjIsIGRvIG5vdCBleHBvc2UKKwkgKiBtd2FpdCwgdG8gYXZvaWQgdGhlIHJpc2sg
b2YgbG9hZGluZyBuYXRpdmUgYWNwaSBwYWQgZHJpdmVyCisJICovCisJaWYgKCgobWFqb3IgPT0g
NCkgJiYgKG1pbm9yIDwgMikpIHx8IChtYWpvciA8IDQpKQorCQlyZXR1cm4gZmFsc2U7CisKIAlh
eCA9IDE7CiAJY3ggPSAwOwogCi0tIAoxLjcuMQoK

--_002_DE8DF0795D48FD4CA783C40EC829233537735CSHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_002_DE8DF0795D48FD4CA783C40EC829233537735CSHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Thu Nov 01 06:39:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 06:39:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TToQt-0002f0-5e; Thu, 01 Nov 2012 06:39:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TToQr-0002eu-U9
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 06:39:14 +0000
Received: from [85.158.139.83:56213] by server-9.bemta-5.messagelabs.com id
	E3/97-29295-11912905; Thu, 01 Nov 2012 06:39:13 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1351751951!25529376!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzYxNzc4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8447 invoked from network); 1 Nov 2012 06:39:12 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-4.tower-182.messagelabs.com with SMTP;
	1 Nov 2012 06:39:12 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga102.jf.intel.com with ESMTP; 31 Oct 2012 23:38:40 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,691,1344236400"; 
	d="scan'208,223";a="235568496"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by orsmga002.jf.intel.com with ESMTP; 31 Oct 2012 23:38:50 -0700
Received: from fmsmsx101.amr.corp.intel.com (10.19.9.52) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 31 Oct 2012 23:38:50 -0700
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX101.amr.corp.intel.com (10.19.9.52) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 31 Oct 2012 23:38:50 -0700
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Thu, 1 Nov 2012 14:38:42 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Thread-Topic: [PATCH 2/2] Revert pad config check in xen_check_mwait
Thread-Index: Ac2yq1FN1e+6ZP87QOCrcigNApJpmAFT/F+A
Date: Thu, 1 Nov 2012 06:38:41 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537735C@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC8292335371593@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC8292335371593@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_002_DE8DF0795D48FD4CA783C40EC829233537735CSHSMSX101ccrcorpi_"
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 2/2] Revert pad config check in
	xen_check_mwait
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_DE8DF0795D48FD4CA783C40EC829233537735CSHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Updated, adding version check at mwait routine.

Thanks,
Jinsong

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>From 27e28963d4d25e4c998b5b5ea3828a02e6de9470 Mon Sep 17 00:00:00 2001
From: Liu, Jinsong <jinsong.liu@intel.com>
Date: Thu, 1 Nov 2012 21:18:43 +0800
Subject: [PATCH 2/2] Revert pad config check in xen_check_mwait

With Xen acpi pad logic added into kernel, we can now revert xen mwait rela=
ted
patch df88b2d96e36d9a9e325bfcd12eb45671cbbc937. The reason is, when running=
 under
newer Xen platform, Xen pad driver would be early loaded, so native pad dri=
ver
would fail to be loaded, and hence no mwait/monitor #UD risk again.

Another point is, only Xen4.2 or later support Xen acpi pad, so we won't ex=
pose
mwait cpuid capability when running under older Xen platform.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 arch/x86/xen/enlighten.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 586d838..9e22e41 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -287,8 +287,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *b=
x,
=20
 static bool __init xen_check_mwait(void)
 {
-#if defined(CONFIG_ACPI) && !defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR) && =
\
-	!defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR_MODULE)
+#ifdef CONFIG_ACPI
 	struct xen_platform_op op =3D {
 		.cmd			=3D XENPF_set_processor_pminfo,
 		.u.set_pminfo.id	=3D -1,
@@ -297,6 +296,10 @@ static bool __init xen_check_mwait(void)
 	uint32_t buf[3];
 	unsigned int ax, bx, cx, dx;
 	unsigned int mwait_mask;
+	unsigned int version =3D HYPERVISOR_xen_version(XENVER_version, NULL);
+	unsigned int major =3D version >> 16;
+	unsigned int minor =3D version & 0xffff;
+
=20
 	/* We need to determine whether it is OK to expose the MWAIT
 	 * capability to the kernel to harvest deeper than C3 states from ACPI
@@ -309,6 +312,13 @@ static bool __init xen_check_mwait(void)
 	if (!xen_initial_domain())
 		return false;
=20
+	/*
+	 * When running under platform earlier than Xen4.2, do not expose
+	 * mwait, to avoid the risk of loading native acpi pad driver
+	 */
+	if (((major =3D=3D 4) && (minor < 2)) || (major < 4))
+		return false;
+
 	ax =3D 1;
 	cx =3D 0;
=20
--=20
1.7.1

--_002_DE8DF0795D48FD4CA783C40EC829233537735CSHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
	name="0002-Revert-pad-config-check-in-xen_check_mwait.patch"
Content-Description: 0002-Revert-pad-config-check-in-xen_check_mwait.patch
Content-Disposition: attachment;
	filename="0002-Revert-pad-config-check-in-xen_check_mwait.patch"; size=2139;
	creation-date="Thu, 01 Nov 2012 06:25:57 GMT";
	modification-date="Thu, 01 Nov 2012 13:29:12 GMT"
Content-Transfer-Encoding: base64

RnJvbSAyN2UyODk2M2Q0ZDI1ZTRjOTk4YjViNWVhMzgyOGEwMmU2ZGU5NDcwIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBMaXUsIEppbnNvbmcgPGppbnNvbmcubGl1QGludGVsLmNvbT4K
RGF0ZTogVGh1LCAxIE5vdiAyMDEyIDIxOjE4OjQzICswODAwClN1YmplY3Q6IFtQQVRDSCAyLzJd
IFJldmVydCBwYWQgY29uZmlnIGNoZWNrIGluIHhlbl9jaGVja19td2FpdAoKV2l0aCBYZW4gYWNw
aSBwYWQgbG9naWMgYWRkZWQgaW50byBrZXJuZWwsIHdlIGNhbiBub3cgcmV2ZXJ0IHhlbiBtd2Fp
dCByZWxhdGVkCnBhdGNoIGRmODhiMmQ5NmUzNmQ5YTllMzI1YmZjZDEyZWI0NTY3MWNiYmM5Mzcu
IFRoZSByZWFzb24gaX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5vdCBleHBvc2UKKwkgKiBtd2FpdCwgdG8gYXZvaWQgdGhlIHJpc2sg
b2YgbG9hZGluZyBuYXRpdmUgYWNwaSBwYWQgZHJpdmVyCisJICovCisJaWYgKCgobWFqb3IgPT0g
NCkgJiYgKG1pbm9yIDwgMikpIHx8IChtYWpvciA8IDQpKQorCQlyZXR1cm4gZmFsc2U7CisKIAlh
eCA9IDE7CiAJY3ggPSAwOwogCi0tIAoxLjcuMQoK

--_002_DE8DF0795D48FD4CA783C40EC829233537735CSHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_002_DE8DF0795D48FD4CA783C40EC829233537735CSHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Thu Nov 01 08:04:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 08:04:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTpl1-0004kZ-OL; Thu, 01 Nov 2012 08:04:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TTpl0-0004kU-3Y
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 08:04:06 +0000
Received: from [193.109.254.147:51233] by server-16.bemta-14.messagelabs.com
	id D7/ED-09215-5FC22905; Thu, 01 Nov 2012 08:04:05 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1351757043!3541323!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODI5MzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19196 invoked from network); 1 Nov 2012 08:04:04 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 08:04:04 -0000
X-IronPort-AV: E=Sophos;i="4.80,691,1344211200"; d="scan'208";a="213085810"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 08:04:03 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 1 Nov 2012 04:04:02 -0400
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TTpkv-0007os-Sx;
	Thu, 01 Nov 2012 08:04:02 +0000
Message-ID: <1351756924.25014.29.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Ronny Hegewald <ronny.hegewald@online.de>
Date: Thu, 1 Nov 2012 09:02:04 +0100
In-Reply-To: <201211010218.14872.ronny.hegewald@online.de>
References: <201211010218.14872.ronny.hegewald@online.de>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] fix vfb related assertion problem when
 starting pv-domU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-01 at 02:18 +0000, Ronny Hegewald wrote:
> When a config-file for a pv-domU has a vfb section with a vnc=0 option then a 
> "xl create" for that domU crashes with the message
> 
> 
> xl: libxl.c:252: libxl_defbool_val: Assertion `!libxl_defbool_is_default(db)' 
> failed.
> 
> 
> and the domU hangs early in the start.
> 
> This patch fixes the cause of the assertion and let the domU start normally.
> 
> This problem exists since xen 4.2.

This seems like a good fix, in order to for us to apply it please can
you "sign off" as described in
http://wiki.xen.org/wiki/Submitting_Xen_Patches#Signing_off_a_patch

I do wonder if perhaps libxl__device_vfb_add ought to be gating a bunch
of those accesses on vnc.enabled though.

Ian.
> 
> --- tools/libxl/libxl.c.org	2012-11-01 01:35:52.000000000 +0000
> +++ tools/libxl/libxl.c	2012-11-01 01:36:20.000000000 +0000
> @@ -2949,6 +2949,8 @@ int libxl__device_vfb_setdefault(libxl__
>          }
>  
>          libxl_defbool_setdefault(&vfb->vnc.findunused, true);
> +    } else {
> +        libxl_defbool_setdefault(&vfb->vnc.findunused, false);
>      }
>  
>      libxl_defbool_setdefault(&vfb->sdl.enable, false);
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 08:04:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 08:04:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTpl1-0004kZ-OL; Thu, 01 Nov 2012 08:04:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TTpl0-0004kU-3Y
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 08:04:06 +0000
Received: from [193.109.254.147:51233] by server-16.bemta-14.messagelabs.com
	id D7/ED-09215-5FC22905; Thu, 01 Nov 2012 08:04:05 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1351757043!3541323!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODI5MzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19196 invoked from network); 1 Nov 2012 08:04:04 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 08:04:04 -0000
X-IronPort-AV: E=Sophos;i="4.80,691,1344211200"; d="scan'208";a="213085810"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 08:04:03 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 1 Nov 2012 04:04:02 -0400
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TTpkv-0007os-Sx;
	Thu, 01 Nov 2012 08:04:02 +0000
Message-ID: <1351756924.25014.29.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Ronny Hegewald <ronny.hegewald@online.de>
Date: Thu, 1 Nov 2012 09:02:04 +0100
In-Reply-To: <201211010218.14872.ronny.hegewald@online.de>
References: <201211010218.14872.ronny.hegewald@online.de>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] fix vfb related assertion problem when
 starting pv-domU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-01 at 02:18 +0000, Ronny Hegewald wrote:
> When a config-file for a pv-domU has a vfb section with a vnc=0 option then a 
> "xl create" for that domU crashes with the message
> 
> 
> xl: libxl.c:252: libxl_defbool_val: Assertion `!libxl_defbool_is_default(db)' 
> failed.
> 
> 
> and the domU hangs early in the start.
> 
> This patch fixes the cause of the assertion and let the domU start normally.
> 
> This problem exists since xen 4.2.

This seems like a good fix, in order to for us to apply it please can
you "sign off" as described in
http://wiki.xen.org/wiki/Submitting_Xen_Patches#Signing_off_a_patch

I do wonder if perhaps libxl__device_vfb_add ought to be gating a bunch
of those accesses on vnc.enabled though.

Ian.
> 
> --- tools/libxl/libxl.c.org	2012-11-01 01:35:52.000000000 +0000
> +++ tools/libxl/libxl.c	2012-11-01 01:36:20.000000000 +0000
> @@ -2949,6 +2949,8 @@ int libxl__device_vfb_setdefault(libxl__
>          }
>  
>          libxl_defbool_setdefault(&vfb->vnc.findunused, true);
> +    } else {
> +        libxl_defbool_setdefault(&vfb->vnc.findunused, false);
>      }
>  
>      libxl_defbool_setdefault(&vfb->sdl.enable, false);
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 08:13:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 08:13:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTptx-00050e-P6; Thu, 01 Nov 2012 08:13:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TTptw-00050Z-DX
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 08:13:20 +0000
Received: from [85.158.143.99:39854] by server-3.bemta-4.messagelabs.com id
	98/C1-06841-F1F22905; Thu, 01 Nov 2012 08:13:19 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1351757598!22904955!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODA0NTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5525 invoked from network); 1 Nov 2012 08:13:19 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 08:13:19 -0000
X-IronPort-AV: E=Sophos;i="4.80,691,1344211200"; d="scan'208";a="43115760"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 08:13:17 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 1 Nov 2012 04:13:17 -0400
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TTpts-0008EJ-On;
	Thu, 01 Nov 2012 08:13:16 +0000
Message-ID: <1351757479.25014.31.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Lenar Shakirov <shakirov@cg.ru>
Date: Thu, 1 Nov 2012 09:11:19 +0100
In-Reply-To: <50913EC6.3040105@zarafa.cg.ru>
References: <50913EC6.3040105@zarafa.cg.ru>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?Q?=D0=AE=D1=81=D1=83=D0=BF=D0=BE=D0=B2_=D0=A0=D0=B0=D0=B4?=
	=?UTF-8?Q?=D0=B8=D0=BA?= <usupov.radik@cg.ru>
Subject: Re: [Xen-devel] Xen 4.1.3 booting VM from phy:/dev/cdrom regression
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-10-31 at 15:07 +0000, Lenar Shakirov wrote:
> Hi,
> 
> I have the regression with booting VM from "phy:/dev/cdrom" on xen
> 4.1.3, but it works with 4.1.2.
> 
> Backport of commit
> http://xenbits.xen.org/gitweb/?p=qemu-xen-4.2-testing.git;a=commit;h=effd5676225761abdab90becac519716515c3be4 to 4.1.3 fix my trouble.

CCing Ian J (tools backport maintainer) and Jan (stable branch
maintainer). The referenced patch is a revert so presumably the original
patch should not have been backported in the first place.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 08:13:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 08:13:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTptx-00050e-P6; Thu, 01 Nov 2012 08:13:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TTptw-00050Z-DX
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 08:13:20 +0000
Received: from [85.158.143.99:39854] by server-3.bemta-4.messagelabs.com id
	98/C1-06841-F1F22905; Thu, 01 Nov 2012 08:13:19 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1351757598!22904955!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODA0NTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5525 invoked from network); 1 Nov 2012 08:13:19 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 08:13:19 -0000
X-IronPort-AV: E=Sophos;i="4.80,691,1344211200"; d="scan'208";a="43115760"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 08:13:17 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 1 Nov 2012 04:13:17 -0400
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TTpts-0008EJ-On;
	Thu, 01 Nov 2012 08:13:16 +0000
Message-ID: <1351757479.25014.31.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Lenar Shakirov <shakirov@cg.ru>
Date: Thu, 1 Nov 2012 09:11:19 +0100
In-Reply-To: <50913EC6.3040105@zarafa.cg.ru>
References: <50913EC6.3040105@zarafa.cg.ru>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?Q?=D0=AE=D1=81=D1=83=D0=BF=D0=BE=D0=B2_=D0=A0=D0=B0=D0=B4?=
	=?UTF-8?Q?=D0=B8=D0=BA?= <usupov.radik@cg.ru>
Subject: Re: [Xen-devel] Xen 4.1.3 booting VM from phy:/dev/cdrom regression
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-10-31 at 15:07 +0000, Lenar Shakirov wrote:
> Hi,
> 
> I have the regression with booting VM from "phy:/dev/cdrom" on xen
> 4.1.3, but it works with 4.1.2.
> 
> Backport of commit
> http://xenbits.xen.org/gitweb/?p=qemu-xen-4.2-testing.git;a=commit;h=effd5676225761abdab90becac519716515c3be4 to 4.1.3 fix my trouble.

CCing Ian J (tools backport maintainer) and Jan (stable branch
maintainer). The referenced patch is a revert so presumably the original
patch should not have been backported in the first place.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 08:48:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 08:48:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTqRm-0005f7-Og; Thu, 01 Nov 2012 08:48:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TTqRk-0005f2-IP
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 08:48:16 +0000
Received: from [85.158.137.99:56518] by server-2.bemta-3.messagelabs.com id
	56/01-04744-F4732905; Thu, 01 Nov 2012 08:48:15 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1351759693!12207203!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY3OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9536 invoked from network); 1 Nov 2012 08:48:15 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 08:48:15 -0000
X-IronPort-AV: E=Sophos;i="4.80,692,1344211200"; d="scan'208";a="15532527"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 08:48:07 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 1 Nov 2012 08:48:06 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TTqRa-0001BA-Gn;
	Thu, 01 Nov 2012 08:48:06 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TTqRa-0006RC-B8;
	Thu, 01 Nov 2012 08:48:06 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14289-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 1 Nov 2012 08:48:06 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14289: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14289 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14289/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14179
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14179
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14179
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14179

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass

version targeted for testing:
 xen                  bf249cd5f2c1
baseline version:
 xen                  bf249cd5f2c1

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 08:48:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 08:48:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTqRm-0005f7-Og; Thu, 01 Nov 2012 08:48:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TTqRk-0005f2-IP
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 08:48:16 +0000
Received: from [85.158.137.99:56518] by server-2.bemta-3.messagelabs.com id
	56/01-04744-F4732905; Thu, 01 Nov 2012 08:48:15 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1351759693!12207203!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY3OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9536 invoked from network); 1 Nov 2012 08:48:15 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 08:48:15 -0000
X-IronPort-AV: E=Sophos;i="4.80,692,1344211200"; d="scan'208";a="15532527"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 08:48:07 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 1 Nov 2012 08:48:06 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TTqRa-0001BA-Gn;
	Thu, 01 Nov 2012 08:48:06 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TTqRa-0006RC-B8;
	Thu, 01 Nov 2012 08:48:06 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14289-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 1 Nov 2012 08:48:06 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14289: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14289 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14289/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14179
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14179
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14179
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14179

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass

version targeted for testing:
 xen                  bf249cd5f2c1
baseline version:
 xen                  bf249cd5f2c1

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 11:03:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 11:03:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTsYP-0007xt-DS; Thu, 01 Nov 2012 11:03:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TTsYN-0007xm-K5
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 11:03:15 +0000
Received: from [85.158.139.83:61262] by server-6.bemta-5.messagelabs.com id
	05/9D-19321-2F652905; Thu, 01 Nov 2012 11:03:14 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1351767793!28277907!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25222 invoked from network); 1 Nov 2012 11:03:13 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-12.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 11:03:13 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TTsYJ-000GJb-Qi; Thu, 01 Nov 2012 11:03:11 +0000
Date: Thu, 1 Nov 2012 11:03:11 +0000
From: Tim Deegan <tim@xen.org>
To: Robert Phillips <robert.phillips@citrix.com>
Message-ID: <20121101110311.GB61948@ocelot.phlegethon.org>
References: <1350411302-5470-1-git-send-email-robert.phillips@citrix.com>
	<20121022161009.GK12577@ocelot.phlegethon.org>
	<048EAD622912254A9DEA24C1734613C18C86D22EDE@FTLPMAILBOX02.citrite.net>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <048EAD622912254A9DEA24C1734613C18C86D22EDE@FTLPMAILBOX02.citrite.net>
User-Agent: Mutt/1.4.2.1i
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
	in Xen.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi Robert,

I've spent a bit more time digging around and I think I have a better
idea of why you've done things the way you did.  The 'simple' version I
was thinking of doesn't work as well as I thought. :|

At 13:45 -0400 on 22 Oct (1350913547), Robert Phillips wrote:
> I believe the bug was toward the end of the function where it used to
> call clear_page(l1) The function copies bits from l1 into a temporary
> bitmap, then copies them from there to the user-provided dirty_bitmap.
> When it's done, it clears the page at l1.  But two framebuffers might
> cohabit that page, not overlapping but at distinction areas within it.
> Reading the dirtiness for one frame buffer and then clearing the whole
> page wipes out information "owned" by the other frame buffer.  This
> bug would not show up if there is only one frame buffer so your live
> migration code is ok.

Yep, understood.

> And when it's time to look for dirty bits, we know precisely which
> PTEs to look at.  The old code used to scan all page tables
> periodically and we would see a performance hit with precisely that
> periodicity.

Was this caused by the 2-second timeout where it would try to unmap the
vram if it hadn't been dirtied in that time?  Were you finding that it
would unmap and then immediately try to map it again?

> One unfortunate bit of complexity relates to the fact that several
> PTEs can map to the same guest physical page.  We have to bookkeep
> them all

The old code basically relied on this not happening (assuming that
framebuffers would be mapped only once).  Is that assumption just
wrong?  Is it broken by things like DirectX?

> so each PTEs that maps to a guest physical page must be
> represented by its own dv_paddr_link, and, for the set that relate to
> the same guest page, they are all linked together.  The head of the
> linked list is the entry in the range's pl_tab array that corresponds
> to that guest physical page.

Right; you've built a complete reverse mapping from pfn to ptes.

> re: " since we already maintain a sparse bitmap to hold the dirty log"
> I don't believe the dirty log is maintained except when page_mode is set for PG_log_dirty.
> That mode exists for live migrate and the discipline for entering/leaving it is quite different than the finer granularity needed for dirty vram.

Sorry, I had got confused there.  I was thinking that we could move over
more to PG_log_dirty-style operation, where we'd trap on writes and
update the bitmap (since we now keep that bitmap as a trie the
sparseness would be OK).  But on closer inspection the cost of clearing
all the mappings when the bitmap is cleared would be either too much
overhead (throw away _all_ shadows every time) or about as complex as
the mechanism needed to scan the _PAGE_DIRTY bits.

I think I have a better idea of the intention of the patch now; I'll go
over the code in detail today.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 11:03:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 11:03:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTsYP-0007xt-DS; Thu, 01 Nov 2012 11:03:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TTsYN-0007xm-K5
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 11:03:15 +0000
Received: from [85.158.139.83:61262] by server-6.bemta-5.messagelabs.com id
	05/9D-19321-2F652905; Thu, 01 Nov 2012 11:03:14 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1351767793!28277907!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25222 invoked from network); 1 Nov 2012 11:03:13 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-12.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 11:03:13 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TTsYJ-000GJb-Qi; Thu, 01 Nov 2012 11:03:11 +0000
Date: Thu, 1 Nov 2012 11:03:11 +0000
From: Tim Deegan <tim@xen.org>
To: Robert Phillips <robert.phillips@citrix.com>
Message-ID: <20121101110311.GB61948@ocelot.phlegethon.org>
References: <1350411302-5470-1-git-send-email-robert.phillips@citrix.com>
	<20121022161009.GK12577@ocelot.phlegethon.org>
	<048EAD622912254A9DEA24C1734613C18C86D22EDE@FTLPMAILBOX02.citrite.net>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <048EAD622912254A9DEA24C1734613C18C86D22EDE@FTLPMAILBOX02.citrite.net>
User-Agent: Mutt/1.4.2.1i
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
	in Xen.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi Robert,

I've spent a bit more time digging around and I think I have a better
idea of why you've done things the way you did.  The 'simple' version I
was thinking of doesn't work as well as I thought. :|

At 13:45 -0400 on 22 Oct (1350913547), Robert Phillips wrote:
> I believe the bug was toward the end of the function where it used to
> call clear_page(l1) The function copies bits from l1 into a temporary
> bitmap, then copies them from there to the user-provided dirty_bitmap.
> When it's done, it clears the page at l1.  But two framebuffers might
> cohabit that page, not overlapping but at distinction areas within it.
> Reading the dirtiness for one frame buffer and then clearing the whole
> page wipes out information "owned" by the other frame buffer.  This
> bug would not show up if there is only one frame buffer so your live
> migration code is ok.

Yep, understood.

> And when it's time to look for dirty bits, we know precisely which
> PTEs to look at.  The old code used to scan all page tables
> periodically and we would see a performance hit with precisely that
> periodicity.

Was this caused by the 2-second timeout where it would try to unmap the
vram if it hadn't been dirtied in that time?  Were you finding that it
would unmap and then immediately try to map it again?

> One unfortunate bit of complexity relates to the fact that several
> PTEs can map to the same guest physical page.  We have to bookkeep
> them all

The old code basically relied on this not happening (assuming that
framebuffers would be mapped only once).  Is that assumption just
wrong?  Is it broken by things like DirectX?

> so each PTEs that maps to a guest physical page must be
> represented by its own dv_paddr_link, and, for the set that relate to
> the same guest page, they are all linked together.  The head of the
> linked list is the entry in the range's pl_tab array that corresponds
> to that guest physical page.

Right; you've built a complete reverse mapping from pfn to ptes.

> re: " since we already maintain a sparse bitmap to hold the dirty log"
> I don't believe the dirty log is maintained except when page_mode is set for PG_log_dirty.
> That mode exists for live migrate and the discipline for entering/leaving it is quite different than the finer granularity needed for dirty vram.

Sorry, I had got confused there.  I was thinking that we could move over
more to PG_log_dirty-style operation, where we'd trap on writes and
update the bitmap (since we now keep that bitmap as a trie the
sparseness would be OK).  But on closer inspection the cost of clearing
all the mappings when the bitmap is cleared would be either too much
overhead (throw away _all_ shadows every time) or about as complex as
the mechanism needed to scan the _PAGE_DIRTY bits.

I think I have a better idea of the intention of the patch now; I'll go
over the code in detail today.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 11:05:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 11:05:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTsa2-00082A-UL; Thu, 01 Nov 2012 11:04:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <weiyj.lk@gmail.com>) id 1TTpyV-0005Bz-18
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 08:18:03 +0000
Received: from [85.158.143.35:16211] by server-3.bemta-4.messagelabs.com id
	D9/36-06841-A3032905; Thu, 01 Nov 2012 08:18:02 +0000
X-Env-Sender: weiyj.lk@gmail.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1351757879!11716670!1
X-Originating-IP: [209.85.216.50]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7778 invoked from network); 1 Nov 2012 08:18:01 -0000
Received: from mail-qa0-f50.google.com (HELO mail-qa0-f50.google.com)
	(209.85.216.50)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 08:18:01 -0000
Received: by mail-qa0-f50.google.com with SMTP id t11so86136qaa.9
	for <xen-devel@lists.xensource.com>;
	Thu, 01 Nov 2012 01:17:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:cc:content-type;
	bh=xYjK2ZUt1Jpw8/fba39Tv9HYhaRUlnkKSKyjh+dA4Gc=;
	b=iiJui2QYiVtgpNSh872PiWLKUwSqatCqLDBXOVayTWCkTmwX1NELJSYpgBtp7IMq0f
	QcKT/8qn5pFVQvrlX2bNql4DC0910MTZTE9EqZMyDux0DGzy4dEpA54dgwmLNeSbMvhg
	jF40/WXhUJsyjoDkegVorvbMqYdYkQeRlPwvuEFtOtf8EoVyW1PXnboYBhSwMD28I/TA
	V8AOH6kLnFLHR5pfDDMv3MOaMaP7oE7IWesqwRK3fcnz758ji9nAZgTB8BJB2papTSjg
	yo9g9EZIfrOV8qX8Ou5UDtugaFuoEbnPo2Yb5b3lM6z3ZZDsQ2CE/wgSaMjEgZpcxl7V
	KMQA==
MIME-Version: 1.0
Received: by 10.224.222.141 with SMTP id ig13mr21623855qab.75.1351757879649;
	Thu, 01 Nov 2012 01:17:59 -0700 (PDT)
Received: by 10.229.207.197 with HTTP; Thu, 1 Nov 2012 01:17:59 -0700 (PDT)
Date: Thu, 1 Nov 2012 16:17:59 +0800
Message-ID: <CAPgLHd_4Ehr62ifhr0wSTqp=xa9EmtO1RW4AVtfUtRR4Cui-+A@mail.gmail.com>
From: Wei Yongjun <weiyj.lk@gmail.com>
To: konrad.wilk@oracle.com, jeremy@goop.org, tglx@linutronix.de, 
	mingo@redhat.com, hpa@zytor.com, mukesh.rathor@oracle.com
X-Mailman-Approved-At: Thu, 01 Nov 2012 11:04:57 +0000
Cc: linux-kernel@vger.kernel.org, yongjun_wei@trendmicro.com.cn, x86@kernel.org,
	xen-devel@lists.xensource.com, virtualization@lists.linux-foundation.org
Subject: [Xen-devel] [PATCH -next] xen/x86: remove duplicated include from
	enlighten.c
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Remove duplicated include.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 arch/x86/xen/enlighten.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index eb9a567..4c694a7 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -45,7 +45,6 @@
 #include <xen/hvm.h>
 #include <xen/hvc-console.h>
 #include <xen/acpi.h>
-#include <xen/features.h>
 
 #include <asm/paravirt.h>
 #include <asm/apic.h>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 11:05:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 11:05:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTsa2-00082A-UL; Thu, 01 Nov 2012 11:04:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <weiyj.lk@gmail.com>) id 1TTpyV-0005Bz-18
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 08:18:03 +0000
Received: from [85.158.143.35:16211] by server-3.bemta-4.messagelabs.com id
	D9/36-06841-A3032905; Thu, 01 Nov 2012 08:18:02 +0000
X-Env-Sender: weiyj.lk@gmail.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1351757879!11716670!1
X-Originating-IP: [209.85.216.50]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7778 invoked from network); 1 Nov 2012 08:18:01 -0000
Received: from mail-qa0-f50.google.com (HELO mail-qa0-f50.google.com)
	(209.85.216.50)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 08:18:01 -0000
Received: by mail-qa0-f50.google.com with SMTP id t11so86136qaa.9
	for <xen-devel@lists.xensource.com>;
	Thu, 01 Nov 2012 01:17:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:cc:content-type;
	bh=xYjK2ZUt1Jpw8/fba39Tv9HYhaRUlnkKSKyjh+dA4Gc=;
	b=iiJui2QYiVtgpNSh872PiWLKUwSqatCqLDBXOVayTWCkTmwX1NELJSYpgBtp7IMq0f
	QcKT/8qn5pFVQvrlX2bNql4DC0910MTZTE9EqZMyDux0DGzy4dEpA54dgwmLNeSbMvhg
	jF40/WXhUJsyjoDkegVorvbMqYdYkQeRlPwvuEFtOtf8EoVyW1PXnboYBhSwMD28I/TA
	V8AOH6kLnFLHR5pfDDMv3MOaMaP7oE7IWesqwRK3fcnz758ji9nAZgTB8BJB2papTSjg
	yo9g9EZIfrOV8qX8Ou5UDtugaFuoEbnPo2Yb5b3lM6z3ZZDsQ2CE/wgSaMjEgZpcxl7V
	KMQA==
MIME-Version: 1.0
Received: by 10.224.222.141 with SMTP id ig13mr21623855qab.75.1351757879649;
	Thu, 01 Nov 2012 01:17:59 -0700 (PDT)
Received: by 10.229.207.197 with HTTP; Thu, 1 Nov 2012 01:17:59 -0700 (PDT)
Date: Thu, 1 Nov 2012 16:17:59 +0800
Message-ID: <CAPgLHd_4Ehr62ifhr0wSTqp=xa9EmtO1RW4AVtfUtRR4Cui-+A@mail.gmail.com>
From: Wei Yongjun <weiyj.lk@gmail.com>
To: konrad.wilk@oracle.com, jeremy@goop.org, tglx@linutronix.de, 
	mingo@redhat.com, hpa@zytor.com, mukesh.rathor@oracle.com
X-Mailman-Approved-At: Thu, 01 Nov 2012 11:04:57 +0000
Cc: linux-kernel@vger.kernel.org, yongjun_wei@trendmicro.com.cn, x86@kernel.org,
	xen-devel@lists.xensource.com, virtualization@lists.linux-foundation.org
Subject: [Xen-devel] [PATCH -next] xen/x86: remove duplicated include from
	enlighten.c
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Remove duplicated include.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 arch/x86/xen/enlighten.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index eb9a567..4c694a7 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -45,7 +45,6 @@
 #include <xen/hvm.h>
 #include <xen/hvc-console.h>
 #include <xen/acpi.h>
-#include <xen/features.h>
 
 #include <asm/paravirt.h>
 #include <asm/apic.h>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 11:08:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 11:08:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTsct-0008FR-Mj; Thu, 01 Nov 2012 11:07:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <robert.phillips@citrix.com>) id 1TTsct-0008FM-7E
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 11:07:55 +0000
Received: from [85.158.137.99:37267] by server-10.bemta-3.messagelabs.com id
	9A/A1-19806-A0852905; Thu, 01 Nov 2012 11:07:54 +0000
X-Env-Sender: robert.phillips@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1351768072!12164610!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODA2OTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11487 invoked from network); 1 Nov 2012 11:07:53 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 11:07:53 -0000
X-IronPort-AV: E=Sophos;i="4.80,692,1344211200"; d="scan'208";a="43126338"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 11:07:45 +0000
Received: from FTLPMAILBOX02.citrite.net ([10.13.98.209]) by
	FTLPMAILMX01.citrite.net ([10.13.107.65]) with mapi;
	Thu, 1 Nov 2012 07:07:45 -0400
From: Robert Phillips <robert.phillips@citrix.com>
To: "Tim (Xen.org)" <tim@xen.org>
Date: Thu, 1 Nov 2012 07:07:32 -0400
Thread-Topic: [Xen-devel] [PATCH] Provide support for multiple frame buffers
	in Xen.
Thread-Index: Ac24IH3eO1oMoGjARAis+272YCC8pAAAEjAA
Message-ID: <048EAD622912254A9DEA24C1734613C18C876559B2@FTLPMAILBOX02.citrite.net>
References: <1350411302-5470-1-git-send-email-robert.phillips@citrix.com>
	<20121022161009.GK12577@ocelot.phlegethon.org>
	<048EAD622912254A9DEA24C1734613C18C86D22EDE@FTLPMAILBOX02.citrite.net>
	<20121101110311.GB61948@ocelot.phlegethon.org>
In-Reply-To: <20121101110311.GB61948@ocelot.phlegethon.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
 in Xen.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Thanks, Tim, for your review.

I still owe xen-devel a revised version of the patch that adheres better to the Xen coding style conventions.
(Excuse my ignorance but) are those documented somewhere?

-- rsp

-----Original Message-----
From: Tim Deegan [mailto:tim@xen.org] 
Sent: Thursday, November 01, 2012 7:03 AM
To: Robert Phillips
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers in Xen.

Hi Robert,

I've spent a bit more time digging around and I think I have a better idea of why you've done things the way you did.  The 'simple' version I was thinking of doesn't work as well as I thought. :|

At 13:45 -0400 on 22 Oct (1350913547), Robert Phillips wrote:
> I believe the bug was toward the end of the function where it used to 
> call clear_page(l1) The function copies bits from l1 into a temporary 
> bitmap, then copies them from there to the user-provided dirty_bitmap.
> When it's done, it clears the page at l1.  But two framebuffers might 
> cohabit that page, not overlapping but at distinction areas within it.
> Reading the dirtiness for one frame buffer and then clearing the whole 
> page wipes out information "owned" by the other frame buffer.  This 
> bug would not show up if there is only one frame buffer so your live 
> migration code is ok.

Yep, understood.

> And when it's time to look for dirty bits, we know precisely which 
> PTEs to look at.  The old code used to scan all page tables 
> periodically and we would see a performance hit with precisely that 
> periodicity.

Was this caused by the 2-second timeout where it would try to unmap the vram if it hadn't been dirtied in that time?  Were you finding that it would unmap and then immediately try to map it again?

> One unfortunate bit of complexity relates to the fact that several 
> PTEs can map to the same guest physical page.  We have to bookkeep 
> them all

The old code basically relied on this not happening (assuming that framebuffers would be mapped only once).  Is that assumption just wrong?  Is it broken by things like DirectX?

> so each PTEs that maps to a guest physical page must be represented by 
> its own dv_paddr_link, and, for the set that relate to the same guest 
> page, they are all linked together.  The head of the linked list is 
> the entry in the range's pl_tab array that corresponds to that guest 
> physical page.

Right; you've built a complete reverse mapping from pfn to ptes.

> re: " since we already maintain a sparse bitmap to hold the dirty log"
> I don't believe the dirty log is maintained except when page_mode is set for PG_log_dirty.
> That mode exists for live migrate and the discipline for entering/leaving it is quite different than the finer granularity needed for dirty vram.

Sorry, I had got confused there.  I was thinking that we could move over more to PG_log_dirty-style operation, where we'd trap on writes and update the bitmap (since we now keep that bitmap as a trie the sparseness would be OK).  But on closer inspection the cost of clearing all the mappings when the bitmap is cleared would be either too much overhead (throw away _all_ shadows every time) or about as complex as the mechanism needed to scan the _PAGE_DIRTY bits.

I think I have a better idea of the intention of the patch now; I'll go over the code in detail today.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 11:08:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 11:08:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTsct-0008FR-Mj; Thu, 01 Nov 2012 11:07:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <robert.phillips@citrix.com>) id 1TTsct-0008FM-7E
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 11:07:55 +0000
Received: from [85.158.137.99:37267] by server-10.bemta-3.messagelabs.com id
	9A/A1-19806-A0852905; Thu, 01 Nov 2012 11:07:54 +0000
X-Env-Sender: robert.phillips@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1351768072!12164610!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODA2OTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11487 invoked from network); 1 Nov 2012 11:07:53 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 11:07:53 -0000
X-IronPort-AV: E=Sophos;i="4.80,692,1344211200"; d="scan'208";a="43126338"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 11:07:45 +0000
Received: from FTLPMAILBOX02.citrite.net ([10.13.98.209]) by
	FTLPMAILMX01.citrite.net ([10.13.107.65]) with mapi;
	Thu, 1 Nov 2012 07:07:45 -0400
From: Robert Phillips <robert.phillips@citrix.com>
To: "Tim (Xen.org)" <tim@xen.org>
Date: Thu, 1 Nov 2012 07:07:32 -0400
Thread-Topic: [Xen-devel] [PATCH] Provide support for multiple frame buffers
	in Xen.
Thread-Index: Ac24IH3eO1oMoGjARAis+272YCC8pAAAEjAA
Message-ID: <048EAD622912254A9DEA24C1734613C18C876559B2@FTLPMAILBOX02.citrite.net>
References: <1350411302-5470-1-git-send-email-robert.phillips@citrix.com>
	<20121022161009.GK12577@ocelot.phlegethon.org>
	<048EAD622912254A9DEA24C1734613C18C86D22EDE@FTLPMAILBOX02.citrite.net>
	<20121101110311.GB61948@ocelot.phlegethon.org>
In-Reply-To: <20121101110311.GB61948@ocelot.phlegethon.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
 in Xen.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Thanks, Tim, for your review.

I still owe xen-devel a revised version of the patch that adheres better to the Xen coding style conventions.
(Excuse my ignorance but) are those documented somewhere?

-- rsp

-----Original Message-----
From: Tim Deegan [mailto:tim@xen.org] 
Sent: Thursday, November 01, 2012 7:03 AM
To: Robert Phillips
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers in Xen.

Hi Robert,

I've spent a bit more time digging around and I think I have a better idea of why you've done things the way you did.  The 'simple' version I was thinking of doesn't work as well as I thought. :|

At 13:45 -0400 on 22 Oct (1350913547), Robert Phillips wrote:
> I believe the bug was toward the end of the function where it used to 
> call clear_page(l1) The function copies bits from l1 into a temporary 
> bitmap, then copies them from there to the user-provided dirty_bitmap.
> When it's done, it clears the page at l1.  But two framebuffers might 
> cohabit that page, not overlapping but at distinction areas within it.
> Reading the dirtiness for one frame buffer and then clearing the whole 
> page wipes out information "owned" by the other frame buffer.  This 
> bug would not show up if there is only one frame buffer so your live 
> migration code is ok.

Yep, understood.

> And when it's time to look for dirty bits, we know precisely which 
> PTEs to look at.  The old code used to scan all page tables 
> periodically and we would see a performance hit with precisely that 
> periodicity.

Was this caused by the 2-second timeout where it would try to unmap the vram if it hadn't been dirtied in that time?  Were you finding that it would unmap and then immediately try to map it again?

> One unfortunate bit of complexity relates to the fact that several 
> PTEs can map to the same guest physical page.  We have to bookkeep 
> them all

The old code basically relied on this not happening (assuming that framebuffers would be mapped only once).  Is that assumption just wrong?  Is it broken by things like DirectX?

> so each PTEs that maps to a guest physical page must be represented by 
> its own dv_paddr_link, and, for the set that relate to the same guest 
> page, they are all linked together.  The head of the linked list is 
> the entry in the range's pl_tab array that corresponds to that guest 
> physical page.

Right; you've built a complete reverse mapping from pfn to ptes.

> re: " since we already maintain a sparse bitmap to hold the dirty log"
> I don't believe the dirty log is maintained except when page_mode is set for PG_log_dirty.
> That mode exists for live migrate and the discipline for entering/leaving it is quite different than the finer granularity needed for dirty vram.

Sorry, I had got confused there.  I was thinking that we could move over more to PG_log_dirty-style operation, where we'd trap on writes and update the bitmap (since we now keep that bitmap as a trie the sparseness would be OK).  But on closer inspection the cost of clearing all the mappings when the bitmap is cleared would be either too much overhead (throw away _all_ shadows every time) or about as complex as the mechanism needed to scan the _PAGE_DIRTY bits.

I think I have a better idea of the intention of the patch now; I'll go over the code in detail today.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 11:15:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 11:15:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTsjX-00008h-IZ; Thu, 01 Nov 2012 11:14:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TTsjV-00008b-RR
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 11:14:46 +0000
Received: from [85.158.143.99:8427] by server-2.bemta-4.messagelabs.com id
	19/41-28922-5A952905; Thu, 01 Nov 2012 11:14:45 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1351768482!18584807!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODMyMzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13366 invoked from network); 1 Nov 2012 11:14:44 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-14.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 11:14:44 -0000
X-IronPort-AV: E=Sophos;i="4.80,692,1344211200"; d="scan'208";a="213096870"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 11:14:42 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 1 Nov 2012 07:14:42 -0400
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[0.0.0.0])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TTsjR-0007yG-BG;
	Thu, 01 Nov 2012 11:14:41 +0000
Message-ID: <509259A0.9010509@eu.citrix.com>
Date: Thu, 1 Nov 2012 12:14:40 +0100
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "Liu, Jinsong" <jinsong.liu@intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537668D@SHSMSX101.ccr.corp.intel.com>
	<50912B5F02000078000A5B8E@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335376A97@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC8292335376A97@SHSMSX101.ccr.corp.intel.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 01/02] Handles broken page occurred before
	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Are you actually using "hg email" (or patchbomb) to send these?

Having changes to patches included in-line to replies makes it hard to 
keep track of what the newest version is.  Tradition is to send the 
whole series again, with "v2" or "v3" added to the end. If you're using 
patchbomb, the relevant command would be:

$ hg email -o --flag "v3"

Also, the second patch doesn't seem to apply to xen-unstable tip anymore 
-- can you rebase?

  -George

On 31/10/12 17:14, Liu, Jinsong wrote:
> [snip]
>> If you use scope restricted local variables (which I appreciate),
>> please declare them in the innermost possible scope, ...
>>
>>> +
>>> +        d = rcu_lock_domain_by_id(domctl->domain); +        if ( d
>>> != NULL ) +        {
>>> +            pfn = domctl->u.set_broken_page_p2m.pfn; +
>>> +            mfn = get_gfn_query(d, pfn, &pt);
>> ... i.e. here (and then both assignments can become initializers
>> at once).
>>
>>> +            if ( !mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ) +
>>> { +                put_gfn(d, pfn);
>>> +                rcu_unlock_domain(d);
>>> +                ret = -EINVAL;
>>> +                break;
>>> +            }
>>> +
>>> +            if ( p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt )
>>> +                ret = -EINVAL;
>> The two if() conditions can be easily joined (the more that they
>> both produce -EINVAL).
>>
> Thanks, updated as attached.
>
> Jinsong
>
> ======================
>
> Handles broken page occurred before migration
>
> This patch handles guest broken page which occurred before migration.
>
> At sender, the broken page would be mapped but not copied to target
> (otherwise it may trigger more serious error, say, SRAR error).
> While its pfn_type and pfn number would be transferred to target
> so that target take appropriate action.
>
> At target, it would set p2m as p2m_ram_broken for broken page, so that
> if guest access the broken page again, it would kill itself as expected.
>
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
>
> diff -r e84a79d11d7a tools/libxc/xc_domain.c
> --- a/tools/libxc/xc_domain.c	Thu Nov 01 01:41:03 2012 +0800
> +++ b/tools/libxc/xc_domain.c	Thu Nov 01 07:52:41 2012 +0800
> @@ -283,6 +283,22 @@
>       return ret;
>   }
>   
> +/* set broken page p2m */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn)
> +{
> +    int ret;
> +    DECLARE_DOMCTL;
> +
> +    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
> +    domctl.domain = (domid_t)domid;
> +    domctl.u.set_broken_page_p2m.pfn = pfn;
> +    ret = do_domctl(xch, &domctl);
> +
> +    return ret ? -1 : 0;
> +}
> +
>   /* get info from hvm guest for save */
>   int xc_domain_hvm_getcontext(xc_interface *xch,
>                                uint32_t domid,
> diff -r e84a79d11d7a tools/libxc/xc_domain_restore.c
> --- a/tools/libxc/xc_domain_restore.c	Thu Nov 01 01:41:03 2012 +0800
> +++ b/tools/libxc/xc_domain_restore.c	Thu Nov 01 07:52:41 2012 +0800
> @@ -962,9 +962,15 @@
>   
>       countpages = count;
>       for (i = oldcount; i < buf->nr_pages; ++i)
> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
> +    {
> +        unsigned long pagetype;
> +
> +        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
> +        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
> +             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
> +             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>               --countpages;
> +    }
>   
>       if (!countpages)
>           return count;
> @@ -1200,6 +1206,17 @@
>               /* a bogus/unmapped/allocate-only page: skip it */
>               continue;
>   
> +        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
> +        {
> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
> +            {
> +                ERROR("Set p2m for broken page failed, "
> +                      "dom=%d, pfn=%lx\n", dom, pfn);
> +                goto err_mapped;
> +            }
> +            continue;
> +        }
> +
>           if (pfn_err[i])
>           {
>               ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
> diff -r e84a79d11d7a tools/libxc/xc_domain_save.c
> --- a/tools/libxc/xc_domain_save.c	Thu Nov 01 01:41:03 2012 +0800
> +++ b/tools/libxc/xc_domain_save.c	Thu Nov 01 07:52:41 2012 +0800
> @@ -1277,6 +1277,13 @@
>                   if ( !hvm )
>                       gmfn = pfn_to_mfn(gmfn);
>   
> +                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                {
> +                    pfn_type[j] |= pfn_batch[j];
> +                    ++run;
> +                    continue;
> +                }
> +
>                   if ( pfn_err[j] )
>                   {
>                       if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
> @@ -1371,8 +1378,12 @@
>                       }
>                   }
>   
> -                /* skip pages that aren't present or are alloc-only */
> +                /*
> +                 * skip pages that aren't present,
> +                 * or are broken, or are alloc-only
> +                 */
>                   if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
> +                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
>                       || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>                       continue;
>   
> diff -r e84a79d11d7a tools/libxc/xenctrl.h
> --- a/tools/libxc/xenctrl.h	Thu Nov 01 01:41:03 2012 +0800
> +++ b/tools/libxc/xenctrl.h	Thu Nov 01 07:52:41 2012 +0800
> @@ -575,6 +575,17 @@
>                             xc_domaininfo_t *info);
>   
>   /**
> + * This function set p2m for broken page
> + * &parm xch a handle to an open hypervisor interface
> + * @parm domid the domain id which broken page belong to
> + * @parm pfn the pfn number of the broken page
> + * @return 0 on success, -1 on failure
> + */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn);
> +
> +/**
>    * This function returns information about the context of a hvm domain
>    * @parm xch a handle to an open hypervisor interface
>    * @parm domid the domain to get information from
> diff -r e84a79d11d7a xen/arch/x86/domctl.c
> --- a/xen/arch/x86/domctl.c	Thu Nov 01 01:41:03 2012 +0800
> +++ b/xen/arch/x86/domctl.c	Thu Nov 01 07:52:41 2012 +0800
> @@ -209,12 +209,18 @@
>                   for ( j = 0; j < k; j++ )
>                   {
>                       unsigned long type = 0;
> +                    p2m_type_t t;
>   
> -                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
> +                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
>   
>                       if ( unlikely(!page) ||
>                            unlikely(is_xen_heap_page(page)) )
> -                        type = XEN_DOMCTL_PFINFO_XTAB;
> +                    {
> +                        if ( p2m_is_broken(t) )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
> +                        else
> +                            type = XEN_DOMCTL_PFINFO_XTAB;
> +                    }
>                       else
>                       {
>                           switch( page->u.inuse.type_info & PGT_type_mask )
> @@ -235,6 +241,9 @@
>   
>                           if ( page->u.inuse.type_info & PGT_pinned )
>                               type |= XEN_DOMCTL_PFINFO_LPINTAB;
> +
> +                        if ( page->count_info & PGC_broken )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
>                       }
>   
>                       if ( page )
> @@ -1568,6 +1577,29 @@
>       }
>       break;
>   
> +    case XEN_DOMCTL_set_broken_page_p2m:
> +    {
> +        struct domain *d;
> +
> +        d = rcu_lock_domain_by_id(domctl->domain);
> +        if ( d != NULL )
> +        {
> +            p2m_type_t pt;
> +            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
> +            mfn_t mfn = get_gfn_query(d, pfn, &pt);
> +
> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
> +                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
> +                ret = -EINVAL;
> +
> +            put_gfn(d, pfn);
> +            rcu_unlock_domain(d);
> +        }
> +        else
> +            ret = -ESRCH;
> +    }
> +    break;
> +
>       default:
>           ret = iommu_do_domctl(domctl, u_domctl);
>           break;
> diff -r e84a79d11d7a xen/include/public/domctl.h
> --- a/xen/include/public/domctl.h	Thu Nov 01 01:41:03 2012 +0800
> +++ b/xen/include/public/domctl.h	Thu Nov 01 07:52:41 2012 +0800
> @@ -136,6 +136,7 @@
>   #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
>   #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
>   #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
> +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
>   #define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
>   #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
>   
> @@ -835,6 +836,12 @@
>   typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
>   DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
>   
> +struct xen_domctl_set_broken_page_p2m {
> +    uint64_aligned_t pfn;
> +};
> +typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
> +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
> +
>   struct xen_domctl {
>       uint32_t cmd;
>   #define XEN_DOMCTL_createdomain                   1
> @@ -900,6 +907,7 @@
>   #define XEN_DOMCTL_set_access_required           64
>   #define XEN_DOMCTL_audit_p2m                     65
>   #define XEN_DOMCTL_set_virq_handler              66
> +#define XEN_DOMCTL_set_broken_page_p2m           67
>   #define XEN_DOMCTL_gdbsx_guestmemio            1000
>   #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>   #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
> @@ -955,6 +963,7 @@
>           struct xen_domctl_audit_p2m         audit_p2m;
>           struct xen_domctl_set_virq_handler  set_virq_handler;
>           struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>           struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>           struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>           uint8_t                             pad[128];


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 11:15:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 11:15:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTsjX-00008h-IZ; Thu, 01 Nov 2012 11:14:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TTsjV-00008b-RR
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 11:14:46 +0000
Received: from [85.158.143.99:8427] by server-2.bemta-4.messagelabs.com id
	19/41-28922-5A952905; Thu, 01 Nov 2012 11:14:45 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1351768482!18584807!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODMyMzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13366 invoked from network); 1 Nov 2012 11:14:44 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-14.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 11:14:44 -0000
X-IronPort-AV: E=Sophos;i="4.80,692,1344211200"; d="scan'208";a="213096870"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 11:14:42 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 1 Nov 2012 07:14:42 -0400
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[0.0.0.0])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TTsjR-0007yG-BG;
	Thu, 01 Nov 2012 11:14:41 +0000
Message-ID: <509259A0.9010509@eu.citrix.com>
Date: Thu, 1 Nov 2012 12:14:40 +0100
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "Liu, Jinsong" <jinsong.liu@intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537668D@SHSMSX101.ccr.corp.intel.com>
	<50912B5F02000078000A5B8E@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335376A97@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC8292335376A97@SHSMSX101.ccr.corp.intel.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 01/02] Handles broken page occurred before
	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Are you actually using "hg email" (or patchbomb) to send these?

Having changes to patches included in-line to replies makes it hard to 
keep track of what the newest version is.  Tradition is to send the 
whole series again, with "v2" or "v3" added to the end. If you're using 
patchbomb, the relevant command would be:

$ hg email -o --flag "v3"

Also, the second patch doesn't seem to apply to xen-unstable tip anymore 
-- can you rebase?

  -George

On 31/10/12 17:14, Liu, Jinsong wrote:
> [snip]
>> If you use scope restricted local variables (which I appreciate),
>> please declare them in the innermost possible scope, ...
>>
>>> +
>>> +        d = rcu_lock_domain_by_id(domctl->domain); +        if ( d
>>> != NULL ) +        {
>>> +            pfn = domctl->u.set_broken_page_p2m.pfn; +
>>> +            mfn = get_gfn_query(d, pfn, &pt);
>> ... i.e. here (and then both assignments can become initializers
>> at once).
>>
>>> +            if ( !mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ) +
>>> { +                put_gfn(d, pfn);
>>> +                rcu_unlock_domain(d);
>>> +                ret = -EINVAL;
>>> +                break;
>>> +            }
>>> +
>>> +            if ( p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt )
>>> +                ret = -EINVAL;
>> The two if() conditions can be easily joined (the more that they
>> both produce -EINVAL).
>>
> Thanks, updated as attached.
>
> Jinsong
>
> ======================
>
> Handles broken page occurred before migration
>
> This patch handles guest broken page which occurred before migration.
>
> At sender, the broken page would be mapped but not copied to target
> (otherwise it may trigger more serious error, say, SRAR error).
> While its pfn_type and pfn number would be transferred to target
> so that target take appropriate action.
>
> At target, it would set p2m as p2m_ram_broken for broken page, so that
> if guest access the broken page again, it would kill itself as expected.
>
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
>
> diff -r e84a79d11d7a tools/libxc/xc_domain.c
> --- a/tools/libxc/xc_domain.c	Thu Nov 01 01:41:03 2012 +0800
> +++ b/tools/libxc/xc_domain.c	Thu Nov 01 07:52:41 2012 +0800
> @@ -283,6 +283,22 @@
>       return ret;
>   }
>   
> +/* set broken page p2m */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn)
> +{
> +    int ret;
> +    DECLARE_DOMCTL;
> +
> +    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
> +    domctl.domain = (domid_t)domid;
> +    domctl.u.set_broken_page_p2m.pfn = pfn;
> +    ret = do_domctl(xch, &domctl);
> +
> +    return ret ? -1 : 0;
> +}
> +
>   /* get info from hvm guest for save */
>   int xc_domain_hvm_getcontext(xc_interface *xch,
>                                uint32_t domid,
> diff -r e84a79d11d7a tools/libxc/xc_domain_restore.c
> --- a/tools/libxc/xc_domain_restore.c	Thu Nov 01 01:41:03 2012 +0800
> +++ b/tools/libxc/xc_domain_restore.c	Thu Nov 01 07:52:41 2012 +0800
> @@ -962,9 +962,15 @@
>   
>       countpages = count;
>       for (i = oldcount; i < buf->nr_pages; ++i)
> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
> +    {
> +        unsigned long pagetype;
> +
> +        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
> +        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
> +             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
> +             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>               --countpages;
> +    }
>   
>       if (!countpages)
>           return count;
> @@ -1200,6 +1206,17 @@
>               /* a bogus/unmapped/allocate-only page: skip it */
>               continue;
>   
> +        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
> +        {
> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
> +            {
> +                ERROR("Set p2m for broken page failed, "
> +                      "dom=%d, pfn=%lx\n", dom, pfn);
> +                goto err_mapped;
> +            }
> +            continue;
> +        }
> +
>           if (pfn_err[i])
>           {
>               ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
> diff -r e84a79d11d7a tools/libxc/xc_domain_save.c
> --- a/tools/libxc/xc_domain_save.c	Thu Nov 01 01:41:03 2012 +0800
> +++ b/tools/libxc/xc_domain_save.c	Thu Nov 01 07:52:41 2012 +0800
> @@ -1277,6 +1277,13 @@
>                   if ( !hvm )
>                       gmfn = pfn_to_mfn(gmfn);
>   
> +                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                {
> +                    pfn_type[j] |= pfn_batch[j];
> +                    ++run;
> +                    continue;
> +                }
> +
>                   if ( pfn_err[j] )
>                   {
>                       if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
> @@ -1371,8 +1378,12 @@
>                       }
>                   }
>   
> -                /* skip pages that aren't present or are alloc-only */
> +                /*
> +                 * skip pages that aren't present,
> +                 * or are broken, or are alloc-only
> +                 */
>                   if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
> +                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
>                       || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>                       continue;
>   
> diff -r e84a79d11d7a tools/libxc/xenctrl.h
> --- a/tools/libxc/xenctrl.h	Thu Nov 01 01:41:03 2012 +0800
> +++ b/tools/libxc/xenctrl.h	Thu Nov 01 07:52:41 2012 +0800
> @@ -575,6 +575,17 @@
>                             xc_domaininfo_t *info);
>   
>   /**
> + * This function set p2m for broken page
> + * &parm xch a handle to an open hypervisor interface
> + * @parm domid the domain id which broken page belong to
> + * @parm pfn the pfn number of the broken page
> + * @return 0 on success, -1 on failure
> + */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn);
> +
> +/**
>    * This function returns information about the context of a hvm domain
>    * @parm xch a handle to an open hypervisor interface
>    * @parm domid the domain to get information from
> diff -r e84a79d11d7a xen/arch/x86/domctl.c
> --- a/xen/arch/x86/domctl.c	Thu Nov 01 01:41:03 2012 +0800
> +++ b/xen/arch/x86/domctl.c	Thu Nov 01 07:52:41 2012 +0800
> @@ -209,12 +209,18 @@
>                   for ( j = 0; j < k; j++ )
>                   {
>                       unsigned long type = 0;
> +                    p2m_type_t t;
>   
> -                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
> +                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
>   
>                       if ( unlikely(!page) ||
>                            unlikely(is_xen_heap_page(page)) )
> -                        type = XEN_DOMCTL_PFINFO_XTAB;
> +                    {
> +                        if ( p2m_is_broken(t) )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
> +                        else
> +                            type = XEN_DOMCTL_PFINFO_XTAB;
> +                    }
>                       else
>                       {
>                           switch( page->u.inuse.type_info & PGT_type_mask )
> @@ -235,6 +241,9 @@
>   
>                           if ( page->u.inuse.type_info & PGT_pinned )
>                               type |= XEN_DOMCTL_PFINFO_LPINTAB;
> +
> +                        if ( page->count_info & PGC_broken )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
>                       }
>   
>                       if ( page )
> @@ -1568,6 +1577,29 @@
>       }
>       break;
>   
> +    case XEN_DOMCTL_set_broken_page_p2m:
> +    {
> +        struct domain *d;
> +
> +        d = rcu_lock_domain_by_id(domctl->domain);
> +        if ( d != NULL )
> +        {
> +            p2m_type_t pt;
> +            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
> +            mfn_t mfn = get_gfn_query(d, pfn, &pt);
> +
> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
> +                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
> +                ret = -EINVAL;
> +
> +            put_gfn(d, pfn);
> +            rcu_unlock_domain(d);
> +        }
> +        else
> +            ret = -ESRCH;
> +    }
> +    break;
> +
>       default:
>           ret = iommu_do_domctl(domctl, u_domctl);
>           break;
> diff -r e84a79d11d7a xen/include/public/domctl.h
> --- a/xen/include/public/domctl.h	Thu Nov 01 01:41:03 2012 +0800
> +++ b/xen/include/public/domctl.h	Thu Nov 01 07:52:41 2012 +0800
> @@ -136,6 +136,7 @@
>   #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
>   #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
>   #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
> +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
>   #define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
>   #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
>   
> @@ -835,6 +836,12 @@
>   typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
>   DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
>   
> +struct xen_domctl_set_broken_page_p2m {
> +    uint64_aligned_t pfn;
> +};
> +typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
> +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
> +
>   struct xen_domctl {
>       uint32_t cmd;
>   #define XEN_DOMCTL_createdomain                   1
> @@ -900,6 +907,7 @@
>   #define XEN_DOMCTL_set_access_required           64
>   #define XEN_DOMCTL_audit_p2m                     65
>   #define XEN_DOMCTL_set_virq_handler              66
> +#define XEN_DOMCTL_set_broken_page_p2m           67
>   #define XEN_DOMCTL_gdbsx_guestmemio            1000
>   #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>   #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
> @@ -955,6 +963,7 @@
>           struct xen_domctl_audit_p2m         audit_p2m;
>           struct xen_domctl_set_virq_handler  set_virq_handler;
>           struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>           struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>           struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>           uint8_t                             pad[128];


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 11:45:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 11:45:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTtDD-0000j7-6a; Thu, 01 Nov 2012 11:45:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TTtDB-0000j2-Nl
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 11:45:25 +0000
Received: from [85.158.138.51:31520] by server-15.bemta-3.messagelabs.com id
	2D/01-09445-0D062905; Thu, 01 Nov 2012 11:45:20 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1351770318!28182061!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODA2OTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16481 invoked from network); 1 Nov 2012 11:45:20 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 11:45:20 -0000
X-IronPort-AV: E=Sophos;i="4.80,692,1344211200"; d="scan'208";a="43129230"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 11:45:18 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 1 Nov 2012 07:45:17 -0400
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TTtD2-0000ro-ST;
	Thu, 01 Nov 2012 11:45:17 +0000
Message-ID: <1351770199.25014.46.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Robert Phillips <robert.phillips@citrix.com>
Date: Thu, 1 Nov 2012 12:43:19 +0100
In-Reply-To: <048EAD622912254A9DEA24C1734613C18C876559B2@FTLPMAILBOX02.citrite.net>
References: <1350411302-5470-1-git-send-email-robert.phillips@citrix.com>
	<20121022161009.GK12577@ocelot.phlegethon.org>
	<048EAD622912254A9DEA24C1734613C18C86D22EDE@FTLPMAILBOX02.citrite.net>
	<20121101110311.GB61948@ocelot.phlegethon.org>
	<048EAD622912254A9DEA24C1734613C18C876559B2@FTLPMAILBOX02.citrite.net>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
 in Xen.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Please can you avoid top posting, it makes conversations harder to
follow.

On Thu, 2012-11-01 at 11:07 +0000, Robert Phillips wrote:
> Thanks, Tim, for your review.
> 
> I still owe xen-devel a revised version of the patch that adheres better to the Xen coding style conventions.
> (Excuse my ignorance but) are those documented somewhere?

It's in the file "CODING_STYLE" at the top-level of the source tree.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 11:45:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 11:45:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTtDD-0000j7-6a; Thu, 01 Nov 2012 11:45:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TTtDB-0000j2-Nl
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 11:45:25 +0000
Received: from [85.158.138.51:31520] by server-15.bemta-3.messagelabs.com id
	2D/01-09445-0D062905; Thu, 01 Nov 2012 11:45:20 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1351770318!28182061!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODA2OTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16481 invoked from network); 1 Nov 2012 11:45:20 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 11:45:20 -0000
X-IronPort-AV: E=Sophos;i="4.80,692,1344211200"; d="scan'208";a="43129230"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 11:45:18 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 1 Nov 2012 07:45:17 -0400
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TTtD2-0000ro-ST;
	Thu, 01 Nov 2012 11:45:17 +0000
Message-ID: <1351770199.25014.46.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Robert Phillips <robert.phillips@citrix.com>
Date: Thu, 1 Nov 2012 12:43:19 +0100
In-Reply-To: <048EAD622912254A9DEA24C1734613C18C876559B2@FTLPMAILBOX02.citrite.net>
References: <1350411302-5470-1-git-send-email-robert.phillips@citrix.com>
	<20121022161009.GK12577@ocelot.phlegethon.org>
	<048EAD622912254A9DEA24C1734613C18C86D22EDE@FTLPMAILBOX02.citrite.net>
	<20121101110311.GB61948@ocelot.phlegethon.org>
	<048EAD622912254A9DEA24C1734613C18C876559B2@FTLPMAILBOX02.citrite.net>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
 in Xen.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Please can you avoid top posting, it makes conversations harder to
follow.

On Thu, 2012-11-01 at 11:07 +0000, Robert Phillips wrote:
> Thanks, Tim, for your review.
> 
> I still owe xen-devel a revised version of the patch that adheres better to the Xen coding style conventions.
> (Excuse my ignorance but) are those documented somewhere?

It's in the file "CODING_STYLE" at the top-level of the source tree.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 11:54:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 11:54:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTtLv-00011W-7K; Thu, 01 Nov 2012 11:54:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TTtLt-00011R-BX
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 11:54:25 +0000
Received: from [85.158.143.99:2631] by server-3.bemta-4.messagelabs.com id
	FD/73-06841-0F262905; Thu, 01 Nov 2012 11:54:24 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1351770862!22904143!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODMyMzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9736 invoked from network); 1 Nov 2012 11:54:23 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 11:54:23 -0000
X-IronPort-AV: E=Sophos;i="4.80,692,1344211200"; d="scan'208";a="213099651"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 11:54:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 1 Nov 2012 07:54:21 -0400
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[0.0.0.0])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TTtLp-0001Ga-IS;
	Thu, 01 Nov 2012 11:54:21 +0000
Message-ID: <509262EC.90108@eu.citrix.com>
Date: Thu, 1 Nov 2012 12:54:20 +0100
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "Liu, Jinsong" <jinsong.liu@intel.com>
References: <DE8DF0795D48FD4CA783C40EC82923353766A5@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923353766A5@SHSMSX101.ccr.corp.intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH 02/02] Handles broken page occurred during
	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 31/10/12 12:21, Liu, Jinsong wrote:
> Handles broken page occurred during migration
>
> This patch handles broken page which occurred during migration.
>
> It monitors the critical area of live migration (from vMCE point of view,
> the copypages stage of migration is the critical area while other areas are not).
>
> If a vMCE occur at the critical area of live migration, it marks the broken page
> to dirty map, so that at copypages stage of migration, its pfn_type
> and pfn number would transfer to target and then take appropriate action.
>
> At target, it would set p2m as p2m_ram_broken for broken page, so that if
> guest access the broken page again, it would kill itself as expected.
>
> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

[snip]

> diff -r 3313ee9f6142 xen/arch/x86/cpu/mcheck/mce_intel.c
> --- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Thu Oct 25 05:49:11 2012 +0800
> +++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Tue Oct 30 06:07:05 2012 +0800
> @@ -342,6 +342,22 @@
>                       goto vmce_failed;
>                   }
>   
> +                if ( unlikely(d->arch.vmce_monitor) )
> +                {
> +                    /*
> +                     * vMCE occur during migration
> +                     *
> +                     * mark broken page to dirty bitmap, so that at copypages
> +                     * stage of migration, its pfn_type and pfn number would
> +                     * transfer to target and then take appropriate action
> +                     *
> +                     * At target, it would set p2m as p2m_ram_broken for broken
> +                     * page, so that if guest access the broken page again, it
> +                     * would kill itself as expected.
> +                     */
> +                    paging_mark_dirty(d, mfn);
> +                }
> +

Given that logdirty is only enabled when we're doing some kind of 
migration (Remus or otherwise), wouldn't it make sense to just 
unconditionally call paging_mark_dirty(), rather than doing all this 
stuff with vmce_monitor?  paging_mark_dirty() is already a no-op if 
live-migration is not enabled; and if it is enabled, you probably want 
whoever is using logdirty to go through and deal with the broken page 
anyway.

So it seems like you could just add paging_mark_dirty() to the previous 
patch, and get rid of the rest of this patch entirely.

  -George


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 11:54:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 11:54:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTtLv-00011W-7K; Thu, 01 Nov 2012 11:54:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TTtLt-00011R-BX
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 11:54:25 +0000
Received: from [85.158.143.99:2631] by server-3.bemta-4.messagelabs.com id
	FD/73-06841-0F262905; Thu, 01 Nov 2012 11:54:24 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1351770862!22904143!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODMyMzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9736 invoked from network); 1 Nov 2012 11:54:23 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 11:54:23 -0000
X-IronPort-AV: E=Sophos;i="4.80,692,1344211200"; d="scan'208";a="213099651"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 11:54:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 1 Nov 2012 07:54:21 -0400
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[0.0.0.0])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TTtLp-0001Ga-IS;
	Thu, 01 Nov 2012 11:54:21 +0000
Message-ID: <509262EC.90108@eu.citrix.com>
Date: Thu, 1 Nov 2012 12:54:20 +0100
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "Liu, Jinsong" <jinsong.liu@intel.com>
References: <DE8DF0795D48FD4CA783C40EC82923353766A5@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923353766A5@SHSMSX101.ccr.corp.intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH 02/02] Handles broken page occurred during
	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 31/10/12 12:21, Liu, Jinsong wrote:
> Handles broken page occurred during migration
>
> This patch handles broken page which occurred during migration.
>
> It monitors the critical area of live migration (from vMCE point of view,
> the copypages stage of migration is the critical area while other areas are not).
>
> If a vMCE occur at the critical area of live migration, it marks the broken page
> to dirty map, so that at copypages stage of migration, its pfn_type
> and pfn number would transfer to target and then take appropriate action.
>
> At target, it would set p2m as p2m_ram_broken for broken page, so that if
> guest access the broken page again, it would kill itself as expected.
>
> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

[snip]

> diff -r 3313ee9f6142 xen/arch/x86/cpu/mcheck/mce_intel.c
> --- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Thu Oct 25 05:49:11 2012 +0800
> +++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Tue Oct 30 06:07:05 2012 +0800
> @@ -342,6 +342,22 @@
>                       goto vmce_failed;
>                   }
>   
> +                if ( unlikely(d->arch.vmce_monitor) )
> +                {
> +                    /*
> +                     * vMCE occur during migration
> +                     *
> +                     * mark broken page to dirty bitmap, so that at copypages
> +                     * stage of migration, its pfn_type and pfn number would
> +                     * transfer to target and then take appropriate action
> +                     *
> +                     * At target, it would set p2m as p2m_ram_broken for broken
> +                     * page, so that if guest access the broken page again, it
> +                     * would kill itself as expected.
> +                     */
> +                    paging_mark_dirty(d, mfn);
> +                }
> +

Given that logdirty is only enabled when we're doing some kind of 
migration (Remus or otherwise), wouldn't it make sense to just 
unconditionally call paging_mark_dirty(), rather than doing all this 
stuff with vmce_monitor?  paging_mark_dirty() is already a no-op if 
live-migration is not enabled; and if it is enabled, you probably want 
whoever is using logdirty to go through and deal with the broken page 
anyway.

So it seems like you could just add paging_mark_dirty() to the previous 
patch, and get rid of the rest of this patch entirely.

  -George


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 12:50:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 12:50:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTuDa-0002Rq-1X; Thu, 01 Nov 2012 12:49:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TTuDY-0002Rl-7d
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 12:49:52 +0000
Received: from [85.158.139.211:44640] by server-15.bemta-5.messagelabs.com id
	C6/00-26920-FEF62905; Thu, 01 Nov 2012 12:49:51 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1351774189!16972613!1
X-Originating-IP: [141.146.126.227]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuMjI3ID0+IDgzOTM3MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16889 invoked from network); 1 Nov 2012 12:49:51 -0000
Received: from acsinet15.oracle.com (HELO acsinet15.oracle.com)
	(141.146.126.227)
	by server-9.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 12:49:51 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA1CnQN3009551
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 1 Nov 2012 12:49:27 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA1CnN3Q004707
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 1 Nov 2012 12:49:24 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA1CnKM7021511; Thu, 1 Nov 2012 07:49:20 -0500
Received: from localhost.localdomain (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 01 Nov 2012 05:49:19 -0700
Date: Thu, 1 Nov 2012 08:49:13 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: David Rientjes <rientjes@google.com>, JBeulich@suse.com
Message-ID: <20121101124912.GA10743@localhost.localdomain>
References: <alpine.DEB.2.00.1210312239120.31758@chino.kir.corp.google.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.00.1210312239120.31758@chino.kir.corp.google.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Jeremy Fitzhardinge <jeremy@goop.org>, xen-devel@lists.xensource.com,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [Xen-devel] [patch] x86,
 xen: fix build dependency when USB_SUPPORT is not enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Oct 31, 2012 at 10:42:30PM -0700, David Rientjes wrote:
> CONFIG_XEN_DOM0 must depend on CONFIG_USB_SUPPORT, otherwise there is no 
> definition of xen_dbgp_reset_prep() and xen_dbgp_external_startup() 
> resulting in the following link error:
> 
> drivers/built-in.o: In function `dbgp_reset_prep':
> (.text+0x1e03c5): undefined reference to `xen_dbgp_reset_prep'
> drivers/built-in.o: In function `dbgp_external_startup':
> (.text+0x1e0d55): undefined reference to `xen_dbgp_external_startup'

There is another patch that needs to be Acked and picked up by
Greg KH that fixes this.

Let me poke Jan Beulich to repost it with the appropiate Acks.
> 
> Signed-off-by: David Rientjes <rientjes@google.com>
> ---
>  arch/x86/xen/Kconfig |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig
> --- a/arch/x86/xen/Kconfig
> +++ b/arch/x86/xen/Kconfig
> @@ -17,6 +17,7 @@ config XEN_DOM0
>  	def_bool y
>  	depends on XEN && PCI_XEN && SWIOTLB_XEN
>  	depends on X86_LOCAL_APIC && X86_IO_APIC && ACPI && PCI
> +	depends on USB_SUPPORT
>  
>  # Dummy symbol since people have come to rely on the PRIVILEGED_GUEST
>  # name in tools.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 12:50:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 12:50:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTuDa-0002Rq-1X; Thu, 01 Nov 2012 12:49:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TTuDY-0002Rl-7d
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 12:49:52 +0000
Received: from [85.158.139.211:44640] by server-15.bemta-5.messagelabs.com id
	C6/00-26920-FEF62905; Thu, 01 Nov 2012 12:49:51 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1351774189!16972613!1
X-Originating-IP: [141.146.126.227]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuMjI3ID0+IDgzOTM3MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16889 invoked from network); 1 Nov 2012 12:49:51 -0000
Received: from acsinet15.oracle.com (HELO acsinet15.oracle.com)
	(141.146.126.227)
	by server-9.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 12:49:51 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA1CnQN3009551
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 1 Nov 2012 12:49:27 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA1CnN3Q004707
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 1 Nov 2012 12:49:24 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA1CnKM7021511; Thu, 1 Nov 2012 07:49:20 -0500
Received: from localhost.localdomain (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 01 Nov 2012 05:49:19 -0700
Date: Thu, 1 Nov 2012 08:49:13 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: David Rientjes <rientjes@google.com>, JBeulich@suse.com
Message-ID: <20121101124912.GA10743@localhost.localdomain>
References: <alpine.DEB.2.00.1210312239120.31758@chino.kir.corp.google.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.00.1210312239120.31758@chino.kir.corp.google.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Jeremy Fitzhardinge <jeremy@goop.org>, xen-devel@lists.xensource.com,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [Xen-devel] [patch] x86,
 xen: fix build dependency when USB_SUPPORT is not enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Oct 31, 2012 at 10:42:30PM -0700, David Rientjes wrote:
> CONFIG_XEN_DOM0 must depend on CONFIG_USB_SUPPORT, otherwise there is no 
> definition of xen_dbgp_reset_prep() and xen_dbgp_external_startup() 
> resulting in the following link error:
> 
> drivers/built-in.o: In function `dbgp_reset_prep':
> (.text+0x1e03c5): undefined reference to `xen_dbgp_reset_prep'
> drivers/built-in.o: In function `dbgp_external_startup':
> (.text+0x1e0d55): undefined reference to `xen_dbgp_external_startup'

There is another patch that needs to be Acked and picked up by
Greg KH that fixes this.

Let me poke Jan Beulich to repost it with the appropiate Acks.
> 
> Signed-off-by: David Rientjes <rientjes@google.com>
> ---
>  arch/x86/xen/Kconfig |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig
> --- a/arch/x86/xen/Kconfig
> +++ b/arch/x86/xen/Kconfig
> @@ -17,6 +17,7 @@ config XEN_DOM0
>  	def_bool y
>  	depends on XEN && PCI_XEN && SWIOTLB_XEN
>  	depends on X86_LOCAL_APIC && X86_IO_APIC && ACPI && PCI
> +	depends on USB_SUPPORT
>  
>  # Dummy symbol since people have come to rely on the PRIVILEGED_GUEST
>  # name in tools.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 13:40:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 13:40:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTuzv-0003R2-EU; Thu, 01 Nov 2012 13:39:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TTuzt-0003Qx-DA
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 13:39:49 +0000
Received: from [85.158.143.35:53998] by server-1.bemta-4.messagelabs.com id
	5E/9B-27934-4AB72905; Thu, 01 Nov 2012 13:39:48 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1351777143!5208937!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjI1ODE4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27303 invoked from network); 1 Nov 2012 13:39:04 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-4.tower-21.messagelabs.com with SMTP;
	1 Nov 2012 13:39:04 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga101.ch.intel.com with ESMTP; 01 Nov 2012 06:39:02 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,693,1344236400"; d="scan'208";a="212228165"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by azsmga001.ch.intel.com with ESMTP; 01 Nov 2012 06:39:02 -0700
Received: from fmsmsx119.amr.corp.intel.com (10.18.22.143) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 1 Nov 2012 06:39:01 -0700
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	fmsmsx119.amr.corp.intel.com (10.18.22.143) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 1 Nov 2012 06:39:01 -0700
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Thu, 1 Nov 2012 21:39:00 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Thread-Topic: [PATCH 02/02] Handles broken page occurred during migration
Thread-Index: AQHNuCegST9jWMNZSlWheBhAdddc/ZfU9vJQ
Date: Thu, 1 Nov 2012 13:38:59 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335377834@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC82923353766A5@SHSMSX101.ccr.corp.intel.com>
	<509262EC.90108@eu.citrix.com>
In-Reply-To: <509262EC.90108@eu.citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH 02/02] Handles broken page occurred during
	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> On 31/10/12 12:21, Liu, Jinsong wrote:
>> Handles broken page occurred during migration
>> 
>> This patch handles broken page which occurred during migration.
>> 
>> It monitors the critical area of live migration (from vMCE point of
>> view, 
>> the copypages stage of migration is the critical area while other
>> areas are not). 
>> 
>> If a vMCE occur at the critical area of live migration, it marks the
>> broken page to dirty map, so that at copypages stage of migration,
>> its pfn_type 
>> and pfn number would transfer to target and then take appropriate
>> action. 
>> 
>> At target, it would set p2m as p2m_ram_broken for broken page, so
>> that if 
>> guest access the broken page again, it would kill itself as expected.
>> 
>> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
>> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
> 
> [snip]
> 
>> diff -r 3313ee9f6142 xen/arch/x86/cpu/mcheck/mce_intel.c
>> --- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Thu Oct 25 05:49:11 2012
>> +0800 +++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Tue Oct 30 06:07:05
>>                       2012 +0800 @@ -342,6 +342,22 @@ goto
>>                   vmce_failed; }
>> 
>> +                if ( unlikely(d->arch.vmce_monitor) ) +            
>> { +                    /*
>> +                     * vMCE occur during migration +               
>> * +                     * mark broken page to dirty bitmap, so that
>> at copypages +                     * stage of migration, its
>> pfn_type and pfn number would +                     * transfer to
>> target and then take appropriate action +                     * +   
>> * At target, it would set p2m as p2m_ram_broken for broken +        
>> * page, so that if guest access the broken page again, it +         
>> * would kill itself as expected. +                     */ +         
>> paging_mark_dirty(d, mfn); +                }
>> +
> 
> Given that logdirty is only enabled when we're doing some kind of
> migration (Remus or otherwise), wouldn't it make sense to just
> unconditionally call paging_mark_dirty(), rather than doing all this
> stuff with vmce_monitor?  paging_mark_dirty() is already a no-op if
> live-migration is not enabled; and if it is enabled, you probably want
> whoever is using logdirty to go through and deal with the broken page
> anyway.

That's just what I concerned -- can we guarantee paging log dirty mode only occur during live migration/remus?
say, under the case vram_tracking (hap_enable_vram_tracking) it also enable log dirty.

> 
> So it seems like you could just add paging_mark_dirty() to the
> previous patch, and get rid of the rest of this patch entirely.
> 

Currently I just find 2 cases which use log dirty mode: live migration/remus and vram tracking. So if we can make sure that log dirty would not used more in the future, it's fine to me to simplify my code by unconditionally call paging_mark_dirty at mce handler.

What do you think?

Thanks,
Jinsong


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 13:40:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 13:40:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTuzv-0003R2-EU; Thu, 01 Nov 2012 13:39:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TTuzt-0003Qx-DA
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 13:39:49 +0000
Received: from [85.158.143.35:53998] by server-1.bemta-4.messagelabs.com id
	5E/9B-27934-4AB72905; Thu, 01 Nov 2012 13:39:48 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1351777143!5208937!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjI1ODE4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27303 invoked from network); 1 Nov 2012 13:39:04 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-4.tower-21.messagelabs.com with SMTP;
	1 Nov 2012 13:39:04 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga101.ch.intel.com with ESMTP; 01 Nov 2012 06:39:02 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,693,1344236400"; d="scan'208";a="212228165"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by azsmga001.ch.intel.com with ESMTP; 01 Nov 2012 06:39:02 -0700
Received: from fmsmsx119.amr.corp.intel.com (10.18.22.143) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 1 Nov 2012 06:39:01 -0700
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	fmsmsx119.amr.corp.intel.com (10.18.22.143) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 1 Nov 2012 06:39:01 -0700
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Thu, 1 Nov 2012 21:39:00 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Thread-Topic: [PATCH 02/02] Handles broken page occurred during migration
Thread-Index: AQHNuCegST9jWMNZSlWheBhAdddc/ZfU9vJQ
Date: Thu, 1 Nov 2012 13:38:59 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335377834@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC82923353766A5@SHSMSX101.ccr.corp.intel.com>
	<509262EC.90108@eu.citrix.com>
In-Reply-To: <509262EC.90108@eu.citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH 02/02] Handles broken page occurred during
	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> On 31/10/12 12:21, Liu, Jinsong wrote:
>> Handles broken page occurred during migration
>> 
>> This patch handles broken page which occurred during migration.
>> 
>> It monitors the critical area of live migration (from vMCE point of
>> view, 
>> the copypages stage of migration is the critical area while other
>> areas are not). 
>> 
>> If a vMCE occur at the critical area of live migration, it marks the
>> broken page to dirty map, so that at copypages stage of migration,
>> its pfn_type 
>> and pfn number would transfer to target and then take appropriate
>> action. 
>> 
>> At target, it would set p2m as p2m_ram_broken for broken page, so
>> that if 
>> guest access the broken page again, it would kill itself as expected.
>> 
>> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
>> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
> 
> [snip]
> 
>> diff -r 3313ee9f6142 xen/arch/x86/cpu/mcheck/mce_intel.c
>> --- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Thu Oct 25 05:49:11 2012
>> +0800 +++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Tue Oct 30 06:07:05
>>                       2012 +0800 @@ -342,6 +342,22 @@ goto
>>                   vmce_failed; }
>> 
>> +                if ( unlikely(d->arch.vmce_monitor) ) +            
>> { +                    /*
>> +                     * vMCE occur during migration +               
>> * +                     * mark broken page to dirty bitmap, so that
>> at copypages +                     * stage of migration, its
>> pfn_type and pfn number would +                     * transfer to
>> target and then take appropriate action +                     * +   
>> * At target, it would set p2m as p2m_ram_broken for broken +        
>> * page, so that if guest access the broken page again, it +         
>> * would kill itself as expected. +                     */ +         
>> paging_mark_dirty(d, mfn); +                }
>> +
> 
> Given that logdirty is only enabled when we're doing some kind of
> migration (Remus or otherwise), wouldn't it make sense to just
> unconditionally call paging_mark_dirty(), rather than doing all this
> stuff with vmce_monitor?  paging_mark_dirty() is already a no-op if
> live-migration is not enabled; and if it is enabled, you probably want
> whoever is using logdirty to go through and deal with the broken page
> anyway.

That's just what I concerned -- can we guarantee paging log dirty mode only occur during live migration/remus?
say, under the case vram_tracking (hap_enable_vram_tracking) it also enable log dirty.

> 
> So it seems like you could just add paging_mark_dirty() to the
> previous patch, and get rid of the rest of this patch entirely.
> 

Currently I just find 2 cases which use log dirty mode: live migration/remus and vram tracking. So if we can make sure that log dirty would not used more in the future, it's fine to me to simplify my code by unconditionally call paging_mark_dirty at mce handler.

What do you think?

Thanks,
Jinsong


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 14:25:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 14:25:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTvhJ-0004ci-35; Thu, 01 Nov 2012 14:24:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TTvhH-0004ca-Sg
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 14:24:40 +0000
Received: from [85.158.143.99:32632] by server-2.bemta-4.messagelabs.com id
	E8/85-28922-72682905; Thu, 01 Nov 2012 14:24:39 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1351779876!18465768!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24193 invoked from network); 1 Nov 2012 14:24:36 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-8.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 14:24:36 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TTvhC-000Gvp-EL; Thu, 01 Nov 2012 14:24:34 +0000
Date: Thu, 1 Nov 2012 14:24:34 +0000
From: Tim Deegan <tim@xen.org>
To: Robert Phillips <robert.phillips@citrix.com>
Message-ID: <20121101142434.GC61948@ocelot.phlegethon.org>
References: <1350411302-5470-1-git-send-email-robert.phillips@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1350411302-5470-1-git-send-email-robert.phillips@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: Robert Phillips <robert.phillips@virtualcomputer.com>,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
	in Xen.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi, 

At 14:15 -0400 on 16 Oct (1350396902), Robert Phillips wrote:
> From: Robert Phillips <robert.phillips@virtualcomputer.com>
> 
> Support is provided for both shadow and hardware assisted paging (HAP) modes.
> This code bookkeeps the set of video frame buffers (vram),
> detects when the guest has modified any of those buffers and, upon request,
> returns a bitmap of the modified pages.
> 
> This lets other software components re-paint the portions of the monitor (or monitors) that have changed.
> Each monitor has a frame buffer of some size at some position in guest physical memory.
> The set of frame buffers being tracked can change over time as monitors are plugged and unplugged.

Having read through this in detail, it's looking very plausible. :)
A few style nits:
 - please use the Xen spacings around 'if ( foo )' and 'for ( x; y; z )';
 - there's a bit of trailing whitespace in the new file, and a few
   places where indentation seems to have gone a bit wrong;
 - please make sure the whole thing is linewrapped to <80 characters; and
 - there's no need for braces around single-line blocks.

More substantive comments:
 - I think the dirty_vram.c and dirty_vram.h files belong under mm/
   rather than under hvm/.  The ``#include "../mm/mm-locks.h"'' is 
   an indicator that this is really MM code. 
 - Please use xzalloc() rather than xmalloc() + memset(0).  It avoids
   the sizes of alloc and memset getting out of sync.
 - The i386 build is dead, so you can drop some #ifdef __i386__ sections.
 - There really ought to be some limit on how many PTEs you're willing
   to track.  Otherwise a large guest can consume lots and lots of Xen's
   memory by making lots of PTEs that point to framebuffers.  That
   might also lead to performance problems, e.g. in the unshadow
   function that walks over all those liked lists. 
   Also, I think that the memory for the paddr_links ought to come from
   the shadow pool (i.e. using domain->arch.paging.alloc_page())
   rather than soaking up otherwise free memory.

A few other detailed comments below...

> +/* Free a paddr_link struct, given address of its predecessor in linked list */
> +dv_paddr_link_t *
> +free_paddr_link(struct domain *d,
> +                dv_paddr_link_t **ppl,
> +                dv_paddr_link_t *pl)
> +{
> +    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
> +    dv_paddr_link_t *npl; /* next pl */
> +
> +    ASSERT( paging_locked_by_me(d) );
> +    /* extension mapping? */
> +    if (ppl) /* yes. free it */
> +    {
> +        pl = (*ppl);

This assignment seems like it should always be a noop.  Would it be
correct to replace it with ASSERT(pl == *ppl)?

> +        (*ppl) = npl = pl->pl_next;
> +    }
> +    else  /* main table */
> +    {
> +        /* move 2nd mapping to main table.
> +         * and free 2nd mapping */
> +        dv_paddr_link_t * spl;
> +        spl = pl->pl_next;
> +        if (spl == NULL)
> +        {
> +            pl->sl1ma = INVALID_PADDR;
> +            return pl;
> +        }
> +        pl->sl1ma = spl->sl1ma;
> +        pl->pl_next = spl->pl_next;
> +        npl = pl; /* reprocess main table entry again */
> +        pl = spl;

OK, that took a lot of staring at to be sure it's right. :)  I'd be
inclined to just put all paddr_links in the linked list (and have an
array of pointers rather than an array of paddr_link_ts).  Is it worth
having the extra complexity here, and at the callers, to avoid a single
memory read?

> +    }
> +    pl->sl1ma = INVALID_PADDR;
> +    pl->pl_next = dirty_vram->pl_free;
> +    dirty_vram->pl_free = pl;
> +    return npl;
> +}
> +
> +
> +/* dirty_vram_range_update()
> + * This is called whenever a level 1 page table entry is modified.
> + * If the L1PTE is being cleared, the function removes any paddr_links
> + * that refer to it.
> + * If the L1PTE is being set to a frame buffer page, a paddr_link is
> + * created for that page's entry in pl_tab.
> + * Returns 1 iff entry found and set or cleared.
> + */
> +int dirty_vram_range_update(struct domain *d,
> +                            unsigned long gfn,
> +                            paddr_t sl1ma,
> +                            int set)
> +{
> +    int effective = 0;
> +    dv_range_t *range;
> +
> +    ASSERT(paging_locked_by_me(d));
> +    range = dirty_vram_range_find_gfn(d, gfn);
> +    if ( range )
> +    {

I think this would be more readable as 'if ( !range ) return 0' here 
rather than indenting most of the function. 

> +        unsigned long i = gfn - range->begin_pfn;
> +        dv_paddr_link_t *pl = &range->pl_tab[ i ];
> +        dv_paddr_link_t **ppl = NULL;
> +        int len = 0;
> +
> +        /* find matching entry (pl), if any, and its predecessor
> +         * in linked list (ppl) */
> +        while (pl != NULL)
> +        {
> +            if (pl->sl1ma == sl1ma || pl->sl1ma == INVALID_PADDR )
> +                break;
> +            ppl = &pl->pl_next;
> +            pl = *ppl;
> +            len++;
> +        }
> +            
> +        if (set)
> +        {
> +            /* Did we find sl1ma in either the main table or the linked list? */
> +            if (pl == NULL) /* no, so we'll need to alloc a link */
> +            {
> +                ASSERT(ppl != NULL);
> +                /* alloc link and append it to list */
> +                (*ppl) = pl = alloc_paddr_link(d);
> +                if (pl == NULL)
> +                    goto out;

This needs to signal some sort of error.  Otherwise, if we can't add
this sl1e to the list we'll just silently fail to track it.

> +            }
> +            if ( pl->sl1ma != sl1ma )
> +            {

ASSERT(pl->sl1ma == INVALID_PADDR) ? 

> +                pl->sl1ma = sl1ma;
> +                range->nr_mappings++;
> +            }
> +            effective = 1;
> +            if (len > range->mappings_hwm)
> +            {
> +                range->mappings_hwm = len;
> +#if DEBUG_update_vram_mapping
> +                gdprintk(XENLOG_DEBUG,
> +                         "[%lx] set      sl1ma:%lx hwm:%d mappings:%d freepages:%d\n",
> +                         gfn, sl1ma,
> +                         range->mappings_hwm,
> +                         range->nr_mappings,
> +                         d->arch.paging.shadow.free_pages);
> +#endif
> +            }
> +        }
> +        else /* clear */
> +        {
> +            if (pl && pl->sl1ma == sl1ma )
> +            {
> +#if DEBUG_update_vram_mapping
> +                gdprintk(XENLOG_DEBUG,
> +                         "[%lx] clear    sl1ma:%lx mappings:%d\n",
> +                         gfn, sl1ma,
> +                         range->nr_mappings-1);
> +#endif
> +                free_paddr_link(d, ppl, pl);
> +                if ( --range->nr_mappings == 0 )
> +                {
> +                    dirty_vram_range_free(d, range);

What's this for?  If the guest unmaps the framebuffer and remaps it (or
if the shadow PTs of the mappings are temporarily discarded) this will
stop us from tracking the new mappings until the toolstack asks for the
bitmap (and then it will be expensive to go and find the mappings).

> +                }
> +                effective = 1;
> +            }
> +        }
> +    }
> + out:
> +    return effective;
> +}

> +/* shadow_track_dirty_vram()
> + * This is the API called by the guest to determine which pages in the range
> + * from [begin_pfn:begin_pfn+nr) have been dirtied since the last call.
> + * It creates the domain's dv_dirty_vram on demand. 
> + * It creates ranges on demand when some [begin_pfn:nr) is first encountered.
> + * To collect the dirty bitmask it calls shadow_scan_dirty_flags().
> + * It copies the dirty bitmask into guest storage.
> + */
> +int shadow_track_dirty_vram(struct domain *d,
> +                            unsigned long begin_pfn,
> +                            unsigned long nr,
> +                            XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
> +{
> +    int rc = 0;
> +    unsigned long end_pfn = begin_pfn + nr;
> +    int flush_tlb = 0;
> +    dv_range_t *range;
> +    struct p2m_domain *p2m = p2m_get_hostp2m(d);
> +
> +    if (end_pfn < begin_pfn
> +            || begin_pfn > p2m->max_mapped_pfn
> +            || end_pfn >= p2m->max_mapped_pfn)

I know you just copied this from the old definition but the limits seem
wrong here -- I think it should be:

    if ( end_pfn < begin_pfn || end_pfn > p2m->max_mapped_pfn + 1 )


> +/* hap_clean_vram_tracking_range()
> + * For all the pages in the range specified by [begin_pfn,nr),
> + * note in the dirty bitmap any page that has been marked as read-write,
> + * which signifies that the page has been dirtied, and reset the page
> + * to ram_logdirty. 
> + */
> +void hap_clean_vram_tracking_range(struct domain *d,
> +                                   unsigned long begin_pfn,
> +                                   unsigned long nr,
> +                                   uint8_t *dirty_bitmap)
> +{
> +    int i;
> +    unsigned long pfn;
> +    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
> +    dv_range_t *range;
> +
> +    ASSERT(p2m_locked_by_me(p2m_get_hostp2m(d)));
> +    ASSERT(paging_locked_by_me(d));
> +    
> +    if ( !dirty_vram )
> +    {
> +        gdprintk(XENLOG_DEBUG, "Should only be called while tracking dirty vram.\n");
> +        return;
> +    }
> +
> +    range = dirty_vram_range_find(d, begin_pfn, nr);
> +    if (!range)
> +        return;

Oughtn't we to return all 1s in the bitmap here?  If the range isn't
currently being tracked we should conservatively assume it's all dirty,
right?

> +
> +    /* set l1e entries of P2M table to be read-only. */
> +    /* On first write, it page faults, its entry is changed to read-write,
> +     * its bit in the dirty bitmap is set, and on retry the write succeeds. */
> +    for (i = 0, pfn = range->begin_pfn; pfn < range->end_pfn; i++, pfn++)
> +    {
> +        p2m_type_t pt;
> +        pt = p2m_change_type(d, pfn, p2m_ram_rw, p2m_ram_logdirty);
> +        if (pt == p2m_ram_rw)
> +            dirty_bitmap[i >> 3] |= (1 << (i & 7));
> +    }
> +    flush_tlb_mask(d->domain_dirty_cpumask);
> +}
> +
> +static void hap_vram_tracking_init(struct domain *d)
> +{
> +    paging_log_dirty_init(d, hap_enable_vram_tracking,
> +                          hap_disable_vram_tracking,
> +                          NULL);
> +}
> +
> +/* hap_track_dirty_vram()
> + * Create the domain's dv_dirty_vram struct on demand.
> + * Create a dirty vram range on demand when some [begin_pfn:begin_pfn+nr] is first encountered.
> + * Collect the guest_dirty bitmask, a bit mask of the dirties vram pages, by
> + * calling paging_log_dirty_range().
> + */
> +int hap_track_dirty_vram(struct domain *d,
> +                         unsigned long begin_pfn,
> +                         unsigned long nr,
> +                         XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
> +{
> +    long rc = 0;
> +    dv_dirty_vram_t *dirty_vram;
> +    int restart_log_dirty = 0;
> +
> +    paging_lock(d);
> +    dirty_vram = d->arch.hvm_domain.dirty_vram;
> +    if ( nr )
> +    {
> +        dv_range_t *range = NULL;
> +        int size = (nr + BITS_PER_LONG - 1) / BITS_PER_LONG;
> +        unsigned long dirty_bitmap[size];

All the users of this array cast to (uint8_t *) -- just declare it as
uint8_t * instead?

> +
> +        /* Already tracking dirty vram? */
> +        if ( paging_mode_log_dirty(d) && dirty_vram ) /* yes */
> +        {
> +            /* Handle the addition of another range */
> +            range = dirty_vram_range_find(d, begin_pfn, nr);
> +            if ( !range )
> +            {
> +                rc = -ENOMEM;
> +                if ( !(range = dirty_vram_range_alloc(d, begin_pfn, nr)) )
> +                    goto param_fail;
> +                restart_log_dirty = 1;
> +            }
> +        }
> +        /* Just starting to track dirty vram? */
> +        else if ( !paging_mode_log_dirty(d) && !dirty_vram ) /* yes */
> +        {
> +            rc = -ENOMEM;
> +            if ( !(dirty_vram = dirty_vram_alloc(d)) )
> +                goto param_fail;
> +            
> +            if ( !(range = dirty_vram_range_find_or_alloc(d, begin_pfn, nr)) )
> +                goto param_fail;
> +
> +            restart_log_dirty = 1;
> +            /* Initialize callbacks for vram tracking */
> +            hap_vram_tracking_init(d);
> +        }
> +        else
> +        {
> +            /* Test for invalid combination */
> +            if ( !paging_mode_log_dirty(d) && dirty_vram )
> +                rc = -EINVAL;
> +            else /* logging dirty of all memory, not tracking dirty vram */
> +                rc = -ENODATA;
> +            goto param_fail;
> +        }
> +        
> +        if (restart_log_dirty) 
> +        {
> +            /* disable then enable log dirty */

Why disable and re-enable?  The call to paging_log_dirty_range() below
will reset the p2m entries of the range you care about, so I think all
you need to do is enable it in the 'just starting' case above.

And, since you know you're in HAP mode, not in log-dirty mode, and
already have the paging lock, you can just set 
d->arch.paging.mode |= PG_log_dirty there rather than jumping through
the paging_log_dirty_enable() path and messing with locks.

> +            paging_unlock(d);
> +            if (paging_mode_log_dirty(d))
> +                paging_log_dirty_disable(d);
> +          
> +            rc = paging_log_dirty_enable(d);
> +            paging_lock(d);
> +            if (rc != 0)
> +                goto param_fail;
> +        }
> +        
> +        paging_unlock(d);
> +        memset(dirty_bitmap, 0x00, size * BYTES_PER_LONG);
> +	paging_log_dirty_range(d, begin_pfn, nr, (uint8_t*)dirty_bitmap);
> +        rc = -EFAULT;
> +        if ( copy_to_guest(guest_dirty_bitmap,
> +                           (uint8_t*)dirty_bitmap,
> +                           size * BYTES_PER_LONG) == 0 )
> +        {
> +            rc = 0;
> +        }
> +    }
> +    else
> +    {
> +        /* If zero pages specified while already tracking dirty vram
> +         * then stop tracking */
> +        if ( paging_mode_log_dirty(d) && dirty_vram ) {
> +            paging_unlock(d);
> +            rc = paging_log_dirty_disable(d);
> +            paging_lock(d);
> +            dirty_vram_free(d);

This is different from the shadow case -- there, IIUC, you just ignore
requests where nr == 0; here, you tear down all vram tracking.
Can you choose one of those, and document it in the public header?

> +        } else /* benign no-op */
> +        {
> +            rc = 0;
> +        }
> +        paging_unlock(d);
> +    }
> +
> +    return rc;


> +/* paging_mark_dirty_hap()
> + * Make a hap page writeable and mark it as dirty.
> + * This done atomically under the p2m and paging locks to avoid leaving
> + * a window where the page might be modified without being marked as dirty.
> + */

I'm perplexed by this -- AFAICT it's either not necessary (because all
log-dirty read/clean ops are done with the domain paused) or not sufficient
(because although the bitmap and the PTE are updated under the p2m lock,
the actual dirtying of the page happens at some other time).  Can you
spell out for me exactly what this is protecting against?

> +typedef int (*hash_pfn_callback_t)(struct vcpu *v,
> +                                   mfn_t smfn,
> +                                   unsigned long begin_pfn,
> +                                   unsigned long end_pfn,
> +                                   int *removed);
> +
> +static int hash_pfn_foreach(struct vcpu *v, 
> +                            unsigned int callback_mask, 
> +                            hash_pfn_callback_t callbacks[], 
> +                            unsigned long begin_pfn,
> +                            unsigned long end_pfn)
> +/* Walk the hash table looking at the types of the entries and 
> + * calling the appropriate callback function for each entry. 
> + * The mask determines which shadow types we call back for, and the array
> + * of callbacks tells us which function to call.
> + * Any callback may return non-zero to let us skip the rest of the scan. 
> + *
> + * WARNING: Callbacks MUST NOT add or remove hash entries unless they 
> + * then return non-zero to terminate the scan. */

This code duplication is a bit much.  I think you should recast the
existing hash_foreach() function to take a pointer as its fourth
argument instead of an MFN, and then make the existing callers just cast
their MFN argument as a pointer.   The you can use the same function,
passing a pointer to a struct { begin, end, removed }.

Please make the changes to hash_foreach() in a separate patch from the
dirty_vram stuff. 

> @@ -1211,12 +1164,14 @@ static int shadow_set_l1e(struct vcpu *v,
>                  shadow_l1e_remove_flags(new_sl1e, _PAGE_RW);
>                  /* fall through */
>              case 0:
> -                shadow_vram_get_l1e(new_sl1e, sl1e, sl1mfn, d);
> +                shadow_vram_fix_l1e(old_sl1e, new_sl1e, sl1e, sl1mfn, d);
>                  break;
>              }
>          }
>      } 
>  
> +    shadow_vram_fix_l1e(old_sl1e, new_sl1e, sl1e, sl1mfn, d);

Why is this being called twice here?

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 14:25:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 14:25:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTvhJ-0004ci-35; Thu, 01 Nov 2012 14:24:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TTvhH-0004ca-Sg
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 14:24:40 +0000
Received: from [85.158.143.99:32632] by server-2.bemta-4.messagelabs.com id
	E8/85-28922-72682905; Thu, 01 Nov 2012 14:24:39 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1351779876!18465768!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24193 invoked from network); 1 Nov 2012 14:24:36 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-8.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 14:24:36 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TTvhC-000Gvp-EL; Thu, 01 Nov 2012 14:24:34 +0000
Date: Thu, 1 Nov 2012 14:24:34 +0000
From: Tim Deegan <tim@xen.org>
To: Robert Phillips <robert.phillips@citrix.com>
Message-ID: <20121101142434.GC61948@ocelot.phlegethon.org>
References: <1350411302-5470-1-git-send-email-robert.phillips@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1350411302-5470-1-git-send-email-robert.phillips@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: Robert Phillips <robert.phillips@virtualcomputer.com>,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
	in Xen.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi, 

At 14:15 -0400 on 16 Oct (1350396902), Robert Phillips wrote:
> From: Robert Phillips <robert.phillips@virtualcomputer.com>
> 
> Support is provided for both shadow and hardware assisted paging (HAP) modes.
> This code bookkeeps the set of video frame buffers (vram),
> detects when the guest has modified any of those buffers and, upon request,
> returns a bitmap of the modified pages.
> 
> This lets other software components re-paint the portions of the monitor (or monitors) that have changed.
> Each monitor has a frame buffer of some size at some position in guest physical memory.
> The set of frame buffers being tracked can change over time as monitors are plugged and unplugged.

Having read through this in detail, it's looking very plausible. :)
A few style nits:
 - please use the Xen spacings around 'if ( foo )' and 'for ( x; y; z )';
 - there's a bit of trailing whitespace in the new file, and a few
   places where indentation seems to have gone a bit wrong;
 - please make sure the whole thing is linewrapped to <80 characters; and
 - there's no need for braces around single-line blocks.

More substantive comments:
 - I think the dirty_vram.c and dirty_vram.h files belong under mm/
   rather than under hvm/.  The ``#include "../mm/mm-locks.h"'' is 
   an indicator that this is really MM code. 
 - Please use xzalloc() rather than xmalloc() + memset(0).  It avoids
   the sizes of alloc and memset getting out of sync.
 - The i386 build is dead, so you can drop some #ifdef __i386__ sections.
 - There really ought to be some limit on how many PTEs you're willing
   to track.  Otherwise a large guest can consume lots and lots of Xen's
   memory by making lots of PTEs that point to framebuffers.  That
   might also lead to performance problems, e.g. in the unshadow
   function that walks over all those liked lists. 
   Also, I think that the memory for the paddr_links ought to come from
   the shadow pool (i.e. using domain->arch.paging.alloc_page())
   rather than soaking up otherwise free memory.

A few other detailed comments below...

> +/* Free a paddr_link struct, given address of its predecessor in linked list */
> +dv_paddr_link_t *
> +free_paddr_link(struct domain *d,
> +                dv_paddr_link_t **ppl,
> +                dv_paddr_link_t *pl)
> +{
> +    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
> +    dv_paddr_link_t *npl; /* next pl */
> +
> +    ASSERT( paging_locked_by_me(d) );
> +    /* extension mapping? */
> +    if (ppl) /* yes. free it */
> +    {
> +        pl = (*ppl);

This assignment seems like it should always be a noop.  Would it be
correct to replace it with ASSERT(pl == *ppl)?

> +        (*ppl) = npl = pl->pl_next;
> +    }
> +    else  /* main table */
> +    {
> +        /* move 2nd mapping to main table.
> +         * and free 2nd mapping */
> +        dv_paddr_link_t * spl;
> +        spl = pl->pl_next;
> +        if (spl == NULL)
> +        {
> +            pl->sl1ma = INVALID_PADDR;
> +            return pl;
> +        }
> +        pl->sl1ma = spl->sl1ma;
> +        pl->pl_next = spl->pl_next;
> +        npl = pl; /* reprocess main table entry again */
> +        pl = spl;

OK, that took a lot of staring at to be sure it's right. :)  I'd be
inclined to just put all paddr_links in the linked list (and have an
array of pointers rather than an array of paddr_link_ts).  Is it worth
having the extra complexity here, and at the callers, to avoid a single
memory read?

> +    }
> +    pl->sl1ma = INVALID_PADDR;
> +    pl->pl_next = dirty_vram->pl_free;
> +    dirty_vram->pl_free = pl;
> +    return npl;
> +}
> +
> +
> +/* dirty_vram_range_update()
> + * This is called whenever a level 1 page table entry is modified.
> + * If the L1PTE is being cleared, the function removes any paddr_links
> + * that refer to it.
> + * If the L1PTE is being set to a frame buffer page, a paddr_link is
> + * created for that page's entry in pl_tab.
> + * Returns 1 iff entry found and set or cleared.
> + */
> +int dirty_vram_range_update(struct domain *d,
> +                            unsigned long gfn,
> +                            paddr_t sl1ma,
> +                            int set)
> +{
> +    int effective = 0;
> +    dv_range_t *range;
> +
> +    ASSERT(paging_locked_by_me(d));
> +    range = dirty_vram_range_find_gfn(d, gfn);
> +    if ( range )
> +    {

I think this would be more readable as 'if ( !range ) return 0' here 
rather than indenting most of the function. 

> +        unsigned long i = gfn - range->begin_pfn;
> +        dv_paddr_link_t *pl = &range->pl_tab[ i ];
> +        dv_paddr_link_t **ppl = NULL;
> +        int len = 0;
> +
> +        /* find matching entry (pl), if any, and its predecessor
> +         * in linked list (ppl) */
> +        while (pl != NULL)
> +        {
> +            if (pl->sl1ma == sl1ma || pl->sl1ma == INVALID_PADDR )
> +                break;
> +            ppl = &pl->pl_next;
> +            pl = *ppl;
> +            len++;
> +        }
> +            
> +        if (set)
> +        {
> +            /* Did we find sl1ma in either the main table or the linked list? */
> +            if (pl == NULL) /* no, so we'll need to alloc a link */
> +            {
> +                ASSERT(ppl != NULL);
> +                /* alloc link and append it to list */
> +                (*ppl) = pl = alloc_paddr_link(d);
> +                if (pl == NULL)
> +                    goto out;

This needs to signal some sort of error.  Otherwise, if we can't add
this sl1e to the list we'll just silently fail to track it.

> +            }
> +            if ( pl->sl1ma != sl1ma )
> +            {

ASSERT(pl->sl1ma == INVALID_PADDR) ? 

> +                pl->sl1ma = sl1ma;
> +                range->nr_mappings++;
> +            }
> +            effective = 1;
> +            if (len > range->mappings_hwm)
> +            {
> +                range->mappings_hwm = len;
> +#if DEBUG_update_vram_mapping
> +                gdprintk(XENLOG_DEBUG,
> +                         "[%lx] set      sl1ma:%lx hwm:%d mappings:%d freepages:%d\n",
> +                         gfn, sl1ma,
> +                         range->mappings_hwm,
> +                         range->nr_mappings,
> +                         d->arch.paging.shadow.free_pages);
> +#endif
> +            }
> +        }
> +        else /* clear */
> +        {
> +            if (pl && pl->sl1ma == sl1ma )
> +            {
> +#if DEBUG_update_vram_mapping
> +                gdprintk(XENLOG_DEBUG,
> +                         "[%lx] clear    sl1ma:%lx mappings:%d\n",
> +                         gfn, sl1ma,
> +                         range->nr_mappings-1);
> +#endif
> +                free_paddr_link(d, ppl, pl);
> +                if ( --range->nr_mappings == 0 )
> +                {
> +                    dirty_vram_range_free(d, range);

What's this for?  If the guest unmaps the framebuffer and remaps it (or
if the shadow PTs of the mappings are temporarily discarded) this will
stop us from tracking the new mappings until the toolstack asks for the
bitmap (and then it will be expensive to go and find the mappings).

> +                }
> +                effective = 1;
> +            }
> +        }
> +    }
> + out:
> +    return effective;
> +}

> +/* shadow_track_dirty_vram()
> + * This is the API called by the guest to determine which pages in the range
> + * from [begin_pfn:begin_pfn+nr) have been dirtied since the last call.
> + * It creates the domain's dv_dirty_vram on demand. 
> + * It creates ranges on demand when some [begin_pfn:nr) is first encountered.
> + * To collect the dirty bitmask it calls shadow_scan_dirty_flags().
> + * It copies the dirty bitmask into guest storage.
> + */
> +int shadow_track_dirty_vram(struct domain *d,
> +                            unsigned long begin_pfn,
> +                            unsigned long nr,
> +                            XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
> +{
> +    int rc = 0;
> +    unsigned long end_pfn = begin_pfn + nr;
> +    int flush_tlb = 0;
> +    dv_range_t *range;
> +    struct p2m_domain *p2m = p2m_get_hostp2m(d);
> +
> +    if (end_pfn < begin_pfn
> +            || begin_pfn > p2m->max_mapped_pfn
> +            || end_pfn >= p2m->max_mapped_pfn)

I know you just copied this from the old definition but the limits seem
wrong here -- I think it should be:

    if ( end_pfn < begin_pfn || end_pfn > p2m->max_mapped_pfn + 1 )


> +/* hap_clean_vram_tracking_range()
> + * For all the pages in the range specified by [begin_pfn,nr),
> + * note in the dirty bitmap any page that has been marked as read-write,
> + * which signifies that the page has been dirtied, and reset the page
> + * to ram_logdirty. 
> + */
> +void hap_clean_vram_tracking_range(struct domain *d,
> +                                   unsigned long begin_pfn,
> +                                   unsigned long nr,
> +                                   uint8_t *dirty_bitmap)
> +{
> +    int i;
> +    unsigned long pfn;
> +    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
> +    dv_range_t *range;
> +
> +    ASSERT(p2m_locked_by_me(p2m_get_hostp2m(d)));
> +    ASSERT(paging_locked_by_me(d));
> +    
> +    if ( !dirty_vram )
> +    {
> +        gdprintk(XENLOG_DEBUG, "Should only be called while tracking dirty vram.\n");
> +        return;
> +    }
> +
> +    range = dirty_vram_range_find(d, begin_pfn, nr);
> +    if (!range)
> +        return;

Oughtn't we to return all 1s in the bitmap here?  If the range isn't
currently being tracked we should conservatively assume it's all dirty,
right?

> +
> +    /* set l1e entries of P2M table to be read-only. */
> +    /* On first write, it page faults, its entry is changed to read-write,
> +     * its bit in the dirty bitmap is set, and on retry the write succeeds. */
> +    for (i = 0, pfn = range->begin_pfn; pfn < range->end_pfn; i++, pfn++)
> +    {
> +        p2m_type_t pt;
> +        pt = p2m_change_type(d, pfn, p2m_ram_rw, p2m_ram_logdirty);
> +        if (pt == p2m_ram_rw)
> +            dirty_bitmap[i >> 3] |= (1 << (i & 7));
> +    }
> +    flush_tlb_mask(d->domain_dirty_cpumask);
> +}
> +
> +static void hap_vram_tracking_init(struct domain *d)
> +{
> +    paging_log_dirty_init(d, hap_enable_vram_tracking,
> +                          hap_disable_vram_tracking,
> +                          NULL);
> +}
> +
> +/* hap_track_dirty_vram()
> + * Create the domain's dv_dirty_vram struct on demand.
> + * Create a dirty vram range on demand when some [begin_pfn:begin_pfn+nr] is first encountered.
> + * Collect the guest_dirty bitmask, a bit mask of the dirties vram pages, by
> + * calling paging_log_dirty_range().
> + */
> +int hap_track_dirty_vram(struct domain *d,
> +                         unsigned long begin_pfn,
> +                         unsigned long nr,
> +                         XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
> +{
> +    long rc = 0;
> +    dv_dirty_vram_t *dirty_vram;
> +    int restart_log_dirty = 0;
> +
> +    paging_lock(d);
> +    dirty_vram = d->arch.hvm_domain.dirty_vram;
> +    if ( nr )
> +    {
> +        dv_range_t *range = NULL;
> +        int size = (nr + BITS_PER_LONG - 1) / BITS_PER_LONG;
> +        unsigned long dirty_bitmap[size];

All the users of this array cast to (uint8_t *) -- just declare it as
uint8_t * instead?

> +
> +        /* Already tracking dirty vram? */
> +        if ( paging_mode_log_dirty(d) && dirty_vram ) /* yes */
> +        {
> +            /* Handle the addition of another range */
> +            range = dirty_vram_range_find(d, begin_pfn, nr);
> +            if ( !range )
> +            {
> +                rc = -ENOMEM;
> +                if ( !(range = dirty_vram_range_alloc(d, begin_pfn, nr)) )
> +                    goto param_fail;
> +                restart_log_dirty = 1;
> +            }
> +        }
> +        /* Just starting to track dirty vram? */
> +        else if ( !paging_mode_log_dirty(d) && !dirty_vram ) /* yes */
> +        {
> +            rc = -ENOMEM;
> +            if ( !(dirty_vram = dirty_vram_alloc(d)) )
> +                goto param_fail;
> +            
> +            if ( !(range = dirty_vram_range_find_or_alloc(d, begin_pfn, nr)) )
> +                goto param_fail;
> +
> +            restart_log_dirty = 1;
> +            /* Initialize callbacks for vram tracking */
> +            hap_vram_tracking_init(d);
> +        }
> +        else
> +        {
> +            /* Test for invalid combination */
> +            if ( !paging_mode_log_dirty(d) && dirty_vram )
> +                rc = -EINVAL;
> +            else /* logging dirty of all memory, not tracking dirty vram */
> +                rc = -ENODATA;
> +            goto param_fail;
> +        }
> +        
> +        if (restart_log_dirty) 
> +        {
> +            /* disable then enable log dirty */

Why disable and re-enable?  The call to paging_log_dirty_range() below
will reset the p2m entries of the range you care about, so I think all
you need to do is enable it in the 'just starting' case above.

And, since you know you're in HAP mode, not in log-dirty mode, and
already have the paging lock, you can just set 
d->arch.paging.mode |= PG_log_dirty there rather than jumping through
the paging_log_dirty_enable() path and messing with locks.

> +            paging_unlock(d);
> +            if (paging_mode_log_dirty(d))
> +                paging_log_dirty_disable(d);
> +          
> +            rc = paging_log_dirty_enable(d);
> +            paging_lock(d);
> +            if (rc != 0)
> +                goto param_fail;
> +        }
> +        
> +        paging_unlock(d);
> +        memset(dirty_bitmap, 0x00, size * BYTES_PER_LONG);
> +	paging_log_dirty_range(d, begin_pfn, nr, (uint8_t*)dirty_bitmap);
> +        rc = -EFAULT;
> +        if ( copy_to_guest(guest_dirty_bitmap,
> +                           (uint8_t*)dirty_bitmap,
> +                           size * BYTES_PER_LONG) == 0 )
> +        {
> +            rc = 0;
> +        }
> +    }
> +    else
> +    {
> +        /* If zero pages specified while already tracking dirty vram
> +         * then stop tracking */
> +        if ( paging_mode_log_dirty(d) && dirty_vram ) {
> +            paging_unlock(d);
> +            rc = paging_log_dirty_disable(d);
> +            paging_lock(d);
> +            dirty_vram_free(d);

This is different from the shadow case -- there, IIUC, you just ignore
requests where nr == 0; here, you tear down all vram tracking.
Can you choose one of those, and document it in the public header?

> +        } else /* benign no-op */
> +        {
> +            rc = 0;
> +        }
> +        paging_unlock(d);
> +    }
> +
> +    return rc;


> +/* paging_mark_dirty_hap()
> + * Make a hap page writeable and mark it as dirty.
> + * This done atomically under the p2m and paging locks to avoid leaving
> + * a window where the page might be modified without being marked as dirty.
> + */

I'm perplexed by this -- AFAICT it's either not necessary (because all
log-dirty read/clean ops are done with the domain paused) or not sufficient
(because although the bitmap and the PTE are updated under the p2m lock,
the actual dirtying of the page happens at some other time).  Can you
spell out for me exactly what this is protecting against?

> +typedef int (*hash_pfn_callback_t)(struct vcpu *v,
> +                                   mfn_t smfn,
> +                                   unsigned long begin_pfn,
> +                                   unsigned long end_pfn,
> +                                   int *removed);
> +
> +static int hash_pfn_foreach(struct vcpu *v, 
> +                            unsigned int callback_mask, 
> +                            hash_pfn_callback_t callbacks[], 
> +                            unsigned long begin_pfn,
> +                            unsigned long end_pfn)
> +/* Walk the hash table looking at the types of the entries and 
> + * calling the appropriate callback function for each entry. 
> + * The mask determines which shadow types we call back for, and the array
> + * of callbacks tells us which function to call.
> + * Any callback may return non-zero to let us skip the rest of the scan. 
> + *
> + * WARNING: Callbacks MUST NOT add or remove hash entries unless they 
> + * then return non-zero to terminate the scan. */

This code duplication is a bit much.  I think you should recast the
existing hash_foreach() function to take a pointer as its fourth
argument instead of an MFN, and then make the existing callers just cast
their MFN argument as a pointer.   The you can use the same function,
passing a pointer to a struct { begin, end, removed }.

Please make the changes to hash_foreach() in a separate patch from the
dirty_vram stuff. 

> @@ -1211,12 +1164,14 @@ static int shadow_set_l1e(struct vcpu *v,
>                  shadow_l1e_remove_flags(new_sl1e, _PAGE_RW);
>                  /* fall through */
>              case 0:
> -                shadow_vram_get_l1e(new_sl1e, sl1e, sl1mfn, d);
> +                shadow_vram_fix_l1e(old_sl1e, new_sl1e, sl1e, sl1mfn, d);
>                  break;
>              }
>          }
>      } 
>  
> +    shadow_vram_fix_l1e(old_sl1e, new_sl1e, sl1e, sl1mfn, d);

Why is this being called twice here?

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 14:38:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 14:38:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTvu0-00053w-EK; Thu, 01 Nov 2012 14:37:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TTvty-00053p-OX
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 14:37:47 +0000
Received: from [85.158.143.35:26975] by server-1.bemta-4.messagelabs.com id
	64/D7-27934-A3982905; Thu, 01 Nov 2012 14:37:46 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1351780644!5449422!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY4ODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13855 invoked from network); 1 Nov 2012 14:37:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 14:37:24 -0000
X-IronPort-AV: E=Sophos;i="4.80,693,1344211200"; d="scan'208";a="15539926"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 14:37:23 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 1 Nov 2012 14:37:23 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TTvtb-0003DR-Ju;
	Thu, 01 Nov 2012 14:37:23 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TTvta-00011F-Ur;
	Thu, 01 Nov 2012 14:37:23 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14294-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 1 Nov 2012 14:37:23 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14294: regressions - trouble:
	broken/fail/pass
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14294 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14294/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-i386-i386-xl             9 guest-start               fail REGR. vs. 14076
 test-i386-i386-xl-qemuu-winxpsp3  7 windows-install       fail REGR. vs. 14076
 test-i386-i386-xl-win         7 windows-install           fail REGR. vs. 14076
 test-i386-i386-xl-winxpsp3    7 windows-install  fail in 14286 REGR. vs. 14076

Tests which are failing intermittently (not blocking):
 test-i386-i386-xl-winxpsp3    3 host-install(3)           broken pass in 14286
 test-amd64-i386-win-vcpus1    3 host-install(3)  broken in 14286 pass in 14294

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore         fail REGR. vs. 14076

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  2bca7e58a3df
baseline version:
 xen                  40ccbee890e1

------------------------------------------------------------
People who touched revisions under test:
  Andres Lagar-Cavilla <andres@lagarcavilla.org>
  Bastian Blank <waldi@debian.org>
  Chuang Cao <chuang.cao@oracle.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jason McCarver <slam@parasite.cc>
  Joe Jin <joe.jin@oracle.com>
  Keir Fraser <keir@xen.org>
  Matt Wilson <msw@amazon.com>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Olaf Hering <olaf@aepfle.de>
  Roger Pau Monne <roger.pau@citrix.com>
  Sander Eikelenboom <linux@eikelenboom.it>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            fail    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     pass    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   broken  


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 632 lines long.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 14:38:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 14:38:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTvu0-00053w-EK; Thu, 01 Nov 2012 14:37:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TTvty-00053p-OX
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 14:37:47 +0000
Received: from [85.158.143.35:26975] by server-1.bemta-4.messagelabs.com id
	64/D7-27934-A3982905; Thu, 01 Nov 2012 14:37:46 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1351780644!5449422!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY4ODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13855 invoked from network); 1 Nov 2012 14:37:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 14:37:24 -0000
X-IronPort-AV: E=Sophos;i="4.80,693,1344211200"; d="scan'208";a="15539926"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 14:37:23 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 1 Nov 2012 14:37:23 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TTvtb-0003DR-Ju;
	Thu, 01 Nov 2012 14:37:23 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TTvta-00011F-Ur;
	Thu, 01 Nov 2012 14:37:23 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14294-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 1 Nov 2012 14:37:23 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14294: regressions - trouble:
	broken/fail/pass
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14294 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14294/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-i386-i386-xl             9 guest-start               fail REGR. vs. 14076
 test-i386-i386-xl-qemuu-winxpsp3  7 windows-install       fail REGR. vs. 14076
 test-i386-i386-xl-win         7 windows-install           fail REGR. vs. 14076
 test-i386-i386-xl-winxpsp3    7 windows-install  fail in 14286 REGR. vs. 14076

Tests which are failing intermittently (not blocking):
 test-i386-i386-xl-winxpsp3    3 host-install(3)           broken pass in 14286
 test-amd64-i386-win-vcpus1    3 host-install(3)  broken in 14286 pass in 14294

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore         fail REGR. vs. 14076

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  2bca7e58a3df
baseline version:
 xen                  40ccbee890e1

------------------------------------------------------------
People who touched revisions under test:
  Andres Lagar-Cavilla <andres@lagarcavilla.org>
  Bastian Blank <waldi@debian.org>
  Chuang Cao <chuang.cao@oracle.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jason McCarver <slam@parasite.cc>
  Joe Jin <joe.jin@oracle.com>
  Keir Fraser <keir@xen.org>
  Matt Wilson <msw@amazon.com>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Olaf Hering <olaf@aepfle.de>
  Roger Pau Monne <roger.pau@citrix.com>
  Sander Eikelenboom <linux@eikelenboom.it>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            fail    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     pass    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   broken  


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 632 lines long.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 15:50:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 15:50:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTx20-0006M3-LV; Thu, 01 Nov 2012 15:50:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TTx1z-0006Ly-Ig
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 15:50:07 +0000
Received: from [85.158.137.99:12700] by server-13.bemta-3.messagelabs.com id
	44/0F-24887-E2A92905; Thu, 01 Nov 2012 15:50:06 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1351785003!12206389!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODMyMzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3390 invoked from network); 1 Nov 2012 15:50:05 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 15:50:05 -0000
X-IronPort-AV: E=Sophos;i="4.80,693,1344211200"; d="scan'208";a="213130606"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	01 Nov 2012 15:50:03 +0000
Received: from kaball.uk.xensource.com (10.80.2.59) by
	FTLPEX01CL03.citrite.net (10.13.107.80) with Microsoft SMTP Server id
	14.2.318.1; Thu, 1 Nov 2012 11:50:02 -0400
Date: Thu, 1 Nov 2012 15:49:24 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Jan Beulich <JBeulich@suse.com>
In-Reply-To: <504F625D020000780009AA85@nat28.tlf.novell.com>
Message-ID: <alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
References: <504F3355.2070201@tiscali.it>
	<504F5182020000780009A9CC@nat28.tlf.novell.com>
	<504F39F0.10701@tiscali.it>
	<504F625D020000780009AA85@nat28.tlf.novell.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
X-Originating-IP: [10.80.2.59]
Cc: xen-devel <xen-devel@lists.xen.org>,
	George Dunlap <george.dunlap@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"fantonifabio@tiscali.it" <fantonifabio@tiscali.it>
Subject: Re: [Xen-devel] Start xen on UEFI system with grub
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 11 Sep 2012, Jan Beulich wrote:
> >>> On 11.09.12 at 15:17, Fabio Fantoni <fantonifabio@tiscali.it> wrote:
> > xen.efi not compile when we build xen on Wheezy and probably is not 
> > possible boot with lvm volume, fallback options ecc...
> 
> Just get a suitable tool chain installed then.
> 
> > UEFI with grub2 seem the best option but with xen hypervisor seem not 
> > load efi variable.
> 
> Sure, because only xen.efi has the code to deal with such.
> 
> (Btw., I assume you aren't aware that any boot manager
> whatsoever, other than the one coming with EFI, is sort of
> bogus under EFI?)

Unfortunately it looks like more and more people are of the opinion that
grub2 is useful even on UEFI firmware.
For example, it is pretty clear that Ubuntu is still going to boot Xen
via grub2 no matter how the firmware looks like.


What would it take to make Xen work properly with grub2 on a UEFI firmware?
I think that we should add it as a work item for Xen 4.3.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 15:50:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 15:50:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTx20-0006M3-LV; Thu, 01 Nov 2012 15:50:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TTx1z-0006Ly-Ig
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 15:50:07 +0000
Received: from [85.158.137.99:12700] by server-13.bemta-3.messagelabs.com id
	44/0F-24887-E2A92905; Thu, 01 Nov 2012 15:50:06 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1351785003!12206389!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODMyMzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3390 invoked from network); 1 Nov 2012 15:50:05 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 15:50:05 -0000
X-IronPort-AV: E=Sophos;i="4.80,693,1344211200"; d="scan'208";a="213130606"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	01 Nov 2012 15:50:03 +0000
Received: from kaball.uk.xensource.com (10.80.2.59) by
	FTLPEX01CL03.citrite.net (10.13.107.80) with Microsoft SMTP Server id
	14.2.318.1; Thu, 1 Nov 2012 11:50:02 -0400
Date: Thu, 1 Nov 2012 15:49:24 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Jan Beulich <JBeulich@suse.com>
In-Reply-To: <504F625D020000780009AA85@nat28.tlf.novell.com>
Message-ID: <alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
References: <504F3355.2070201@tiscali.it>
	<504F5182020000780009A9CC@nat28.tlf.novell.com>
	<504F39F0.10701@tiscali.it>
	<504F625D020000780009AA85@nat28.tlf.novell.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
X-Originating-IP: [10.80.2.59]
Cc: xen-devel <xen-devel@lists.xen.org>,
	George Dunlap <george.dunlap@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"fantonifabio@tiscali.it" <fantonifabio@tiscali.it>
Subject: Re: [Xen-devel] Start xen on UEFI system with grub
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 11 Sep 2012, Jan Beulich wrote:
> >>> On 11.09.12 at 15:17, Fabio Fantoni <fantonifabio@tiscali.it> wrote:
> > xen.efi not compile when we build xen on Wheezy and probably is not 
> > possible boot with lvm volume, fallback options ecc...
> 
> Just get a suitable tool chain installed then.
> 
> > UEFI with grub2 seem the best option but with xen hypervisor seem not 
> > load efi variable.
> 
> Sure, because only xen.efi has the code to deal with such.
> 
> (Btw., I assume you aren't aware that any boot manager
> whatsoever, other than the one coming with EFI, is sort of
> bogus under EFI?)

Unfortunately it looks like more and more people are of the opinion that
grub2 is useful even on UEFI firmware.
For example, it is pretty clear that Ubuntu is still going to boot Xen
via grub2 no matter how the firmware looks like.


What would it take to make Xen work properly with grub2 on a UEFI firmware?
I think that we should add it as a work item for Xen 4.3.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 15:52:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 15:52:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTx3v-0006Uk-62; Thu, 01 Nov 2012 15:52:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TTx3t-0006Ud-EI
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 15:52:05 +0000
Received: from [85.158.139.211:36512] by server-12.bemta-5.messagelabs.com id
	DC/40-02886-4AA92905; Thu, 01 Nov 2012 15:52:04 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1351785121!18453007!1
X-Originating-IP: [141.146.126.227]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuMjI3ID0+IDgzOTM3MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12927 invoked from network); 1 Nov 2012 15:52:03 -0000
Received: from acsinet15.oracle.com (HELO acsinet15.oracle.com)
	(141.146.126.227)
	by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 15:52:03 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA1Fpp5i014342
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 1 Nov 2012 15:51:52 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA1FpoWI015708
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 1 Nov 2012 15:51:50 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA1Fpnjs032505; Thu, 1 Nov 2012 10:51:49 -0500
MIME-Version: 1.0
Message-ID: <d8398003-5113-472e-bd8c-524a84d3f906@default>
Date: Thu, 1 Nov 2012 08:51:45 -0700 (PDT)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Dario Faggioli <raistlin@linux.it>, Tim Deegan <tim@xen.org>
References: <60d00f38-98a3-4ec2-acbd-b49dafaada56@default>
	<20121029223555.GA24388@ocelot.phlegethon.org>
	<1351736001.18330.139.camel@Solace>
In-Reply-To: <1351736001.18330.139.camel@Solace>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Olaf Hering <olaf@aepfle.de>, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	George Shuklin <george.shuklin@gmail.com>, xen-devel@lists.xen.org,
	Zhigang Wang <zhigang.x.wang@oracle.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Dario Faggioli [mailto:raistlin@linux.it]
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> 
> On Mon, 2012-10-29 at 22:35 +0000, Tim Deegan wrote:
> > At 10:06 -0700 on 29 Oct (1351505175), Dan Magenheimer wrote:
> > > In the case of a dying domain, a XENMEM_release operation
> > > is implied and must be executed by the hypervisor.
> > >
> > > Ideally, the quantity of unclaimed memory for each domain and
> > > for the system should be query-able.  This may require additional
> > > memory_op hypercalls.
> > >
> > > I'd very much appreciate feedback on this proposed design!
> >
> > As I said, I'm not opposed to this, though even after reading through
> > the other thread I'm not convinced that it's necessary (except in cases
> > where guest-controlled operations are allowed to consume unbounded
> > memory, which frankly gives me the heebie-jeebies).
> >
> Let me also ask something.
> 
> Playing with NUMA systems I've been in the situation where it would be
> nice to know not only how much free memory we have in general, but how
> much free memory there is in a specific (set of) node(s), and that in
> many places, from the hypervisor, to libxc, to top level toolstack.
> 
> Right now I ask this to Xen, but that is indeed prone to races and
> TOCTOU issues if we allow for domain creation and ballooning

TOCTOU... hadn't seen that term before, but I agree it describes
the problem succinctly.  Thanks, I will begin using that now!

> (tmem/paging/...) to happen concurrently between themselves and between
> each other (as noted in the long thread that preceded this one).
> 
> Question is, the "claim" mechanism you're proposing is by no means NUMA
> node-aware, right?

I hadn't thought about NUMA, but I think the claim mechanism
could be augmented to attempt to stake a claim on a specified
node, or on any node that has sufficient memory.  AFAICT
this might complicate the arithmetic a bit but should work.
Let me prototype the NUMA-ignorant mechanism first though...

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 15:52:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 15:52:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTx3v-0006Uk-62; Thu, 01 Nov 2012 15:52:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TTx3t-0006Ud-EI
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 15:52:05 +0000
Received: from [85.158.139.211:36512] by server-12.bemta-5.messagelabs.com id
	DC/40-02886-4AA92905; Thu, 01 Nov 2012 15:52:04 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1351785121!18453007!1
X-Originating-IP: [141.146.126.227]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuMjI3ID0+IDgzOTM3MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12927 invoked from network); 1 Nov 2012 15:52:03 -0000
Received: from acsinet15.oracle.com (HELO acsinet15.oracle.com)
	(141.146.126.227)
	by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 15:52:03 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA1Fpp5i014342
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 1 Nov 2012 15:51:52 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA1FpoWI015708
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 1 Nov 2012 15:51:50 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA1Fpnjs032505; Thu, 1 Nov 2012 10:51:49 -0500
MIME-Version: 1.0
Message-ID: <d8398003-5113-472e-bd8c-524a84d3f906@default>
Date: Thu, 1 Nov 2012 08:51:45 -0700 (PDT)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Dario Faggioli <raistlin@linux.it>, Tim Deegan <tim@xen.org>
References: <60d00f38-98a3-4ec2-acbd-b49dafaada56@default>
	<20121029223555.GA24388@ocelot.phlegethon.org>
	<1351736001.18330.139.camel@Solace>
In-Reply-To: <1351736001.18330.139.camel@Solace>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Olaf Hering <olaf@aepfle.de>, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	George Shuklin <george.shuklin@gmail.com>, xen-devel@lists.xen.org,
	Zhigang Wang <zhigang.x.wang@oracle.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Dario Faggioli [mailto:raistlin@linux.it]
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> 
> On Mon, 2012-10-29 at 22:35 +0000, Tim Deegan wrote:
> > At 10:06 -0700 on 29 Oct (1351505175), Dan Magenheimer wrote:
> > > In the case of a dying domain, a XENMEM_release operation
> > > is implied and must be executed by the hypervisor.
> > >
> > > Ideally, the quantity of unclaimed memory for each domain and
> > > for the system should be query-able.  This may require additional
> > > memory_op hypercalls.
> > >
> > > I'd very much appreciate feedback on this proposed design!
> >
> > As I said, I'm not opposed to this, though even after reading through
> > the other thread I'm not convinced that it's necessary (except in cases
> > where guest-controlled operations are allowed to consume unbounded
> > memory, which frankly gives me the heebie-jeebies).
> >
> Let me also ask something.
> 
> Playing with NUMA systems I've been in the situation where it would be
> nice to know not only how much free memory we have in general, but how
> much free memory there is in a specific (set of) node(s), and that in
> many places, from the hypervisor, to libxc, to top level toolstack.
> 
> Right now I ask this to Xen, but that is indeed prone to races and
> TOCTOU issues if we allow for domain creation and ballooning

TOCTOU... hadn't seen that term before, but I agree it describes
the problem succinctly.  Thanks, I will begin using that now!

> (tmem/paging/...) to happen concurrently between themselves and between
> each other (as noted in the long thread that preceded this one).
> 
> Question is, the "claim" mechanism you're proposing is by no means NUMA
> node-aware, right?

I hadn't thought about NUMA, but I think the claim mechanism
could be augmented to attempt to stake a claim on a specified
node, or on any node that has sufficient memory.  AFAICT
this might complicate the arithmetic a bit but should work.
Let me prototype the NUMA-ignorant mechanism first though...

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 16:08:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 16:08:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTxIu-0007Kn-MT; Thu, 01 Nov 2012 16:07:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TTxIs-0007Ki-FW
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 16:07:34 +0000
Received: from [85.158.138.51:33146] by server-10.bemta-3.messagelabs.com id
	AF/D5-19806-54E92905; Thu, 01 Nov 2012 16:07:33 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1351786051!20223178!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzYyMDIw\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1573 invoked from network); 1 Nov 2012 16:07:32 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-3.tower-174.messagelabs.com with SMTP;
	1 Nov 2012 16:07:32 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 01 Nov 2012 09:06:22 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,693,1344236400"; d="scan'208";a="214023247"
Received: from fmsmsx107.amr.corp.intel.com ([10.19.9.54])
	by orsmga001.jf.intel.com with ESMTP; 01 Nov 2012 09:06:52 -0700
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX107.amr.corp.intel.com (10.19.9.54) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 1 Nov 2012 09:06:52 -0700
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Fri, 2 Nov 2012 00:06:51 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Thread-Topic: [PATCH 01/02] Handles broken page occurred before migration
Thread-Index: AQHNuCIVIm/L3sGKQI2O8U05ITu8CJfVIufg
Date: Thu, 1 Nov 2012 16:06:50 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335377C29@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537668D@SHSMSX101.ccr.corp.intel.com>
	<50912B5F02000078000A5B8E@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335376A97@SHSMSX101.ccr.corp.intel.com>
	<509259A0.9010509@eu.citrix.com>
In-Reply-To: <509259A0.9010509@eu.citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 01/02] Handles broken page occurred before
	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> Are you actually using "hg email" (or patchbomb) to send these?
> 
> Having changes to patches included in-line to replies makes it hard to
> keep track of what the newest version is.  Tradition is to send the
> whole series again, with "v2" or "v3" added to the end. If you're
> using patchbomb, the relevant command would be:
> 
> $ hg email -o --flag "v3"

OK, I will use 'hg email' next time updating vmce patch.
(I'm just not habit of using it, say, defaultly the patch is included as text in the email body for easy reviewing, but when I use 'a' hoping to attach patch file, the patch context disappear in the email body -- only patch description left in the email body)

> 
> Also, the second patch doesn't seem to apply to xen-unstable tip
> anymore -- can you rebase?
> 
>   -George

Sure.

Thanks,
Jinsong

> 
> On 31/10/12 17:14, Liu, Jinsong wrote:
>> [snip]
>>> If you use scope restricted local variables (which I appreciate),
>>> please declare them in the innermost possible scope, ...
>>> 
>>>> +
>>>> +        d = rcu_lock_domain_by_id(domctl->domain); +        if (
>>>> d != NULL ) +        { +            pfn =
>>>> domctl->u.set_broken_page_p2m.pfn; + +            mfn =
>>>> get_gfn_query(d, pfn, &pt); 
>>> ... i.e. here (and then both assignments can become initializers at
>>> once). 
>>> 
>>>> +            if ( !mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ) +
>>>> { +                put_gfn(d, pfn);
>>>> +                rcu_unlock_domain(d);
>>>> +                ret = -EINVAL;
>>>> +                break;
>>>> +            }
>>>> +
>>>> +            if ( p2m_change_type(d, pfn, pt, p2m_ram_broken) !=
>>>> pt ) +                ret = -EINVAL;
>>> The two if() conditions can be easily joined (the more that they
>>> both produce -EINVAL). 
>>> 
>> Thanks, updated as attached.
>> 
>> Jinsong
>> 
>> ======================
>> 
>> Handles broken page occurred before migration
>> 
>> This patch handles guest broken page which occurred before migration.
>> 
>> At sender, the broken page would be mapped but not copied to target
>> (otherwise it may trigger more serious error, say, SRAR error).
>> While its pfn_type and pfn number would be transferred to target
>> so that target take appropriate action.
>> 
>> At target, it would set p2m as p2m_ram_broken for broken page, so
>> that 
>> if guest access the broken page again, it would kill itself as
>> expected. 
>> 
>> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
>> 
>> diff -r e84a79d11d7a tools/libxc/xc_domain.c
>> --- a/tools/libxc/xc_domain.c	Thu Nov 01 01:41:03 2012 +0800
>> +++ b/tools/libxc/xc_domain.c	Thu Nov 01 07:52:41 2012 +0800 @@
>>       -283,6 +283,22 @@ return ret;
>>   }
>> 
>> +/* set broken page p2m */
>> +int xc_set_broken_page_p2m(xc_interface *xch,
>> +                           uint32_t domid,
>> +                           unsigned long pfn)
>> +{
>> +    int ret;
>> +    DECLARE_DOMCTL;
>> +
>> +    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
>> +    domctl.domain = (domid_t)domid;
>> +    domctl.u.set_broken_page_p2m.pfn = pfn;
>> +    ret = do_domctl(xch, &domctl);
>> +
>> +    return ret ? -1 : 0;
>> +}
>> +
>>   /* get info from hvm guest for save */
>>   int xc_domain_hvm_getcontext(xc_interface *xch,
>>                                uint32_t domid,
>> diff -r e84a79d11d7a tools/libxc/xc_domain_restore.c
>> --- a/tools/libxc/xc_domain_restore.c	Thu Nov 01 01:41:03 2012 +0800
>> +++ b/tools/libxc/xc_domain_restore.c	Thu Nov 01 07:52:41 2012 +0800
>> @@ -962,9 +962,15 @@ 
>> 
>>       countpages = count;
>>       for (i = oldcount; i < buf->nr_pages; ++i)
>> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
>> XEN_DOMCTL_PFINFO_XTAB 
>> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
>> XEN_DOMCTL_PFINFO_XALLOC) +    { +        unsigned long pagetype;
>> +
>> +        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
>> +        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
>> +             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
>> +             pagetype == XEN_DOMCTL_PFINFO_XALLOC )              
>> --countpages; +    }
>> 
>>       if (!countpages)
>>           return count;
>> @@ -1200,6 +1206,17 @@
>>               /* a bogus/unmapped/allocate-only page: skip it */    
>> continue; 
>> 
>> +        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN ) +        {
>> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) ) +         
>> { +                ERROR("Set p2m for broken page failed, "
>> +                      "dom=%d, pfn=%lx\n", dom, pfn);
>> +                goto err_mapped;
>> +            }
>> +            continue;
>> +        }
>> +
>>           if (pfn_err[i])
>>           {
>>               ERROR("unexpected PFN mapping failure pfn %lx map_mfn
>> %lx p2m_mfn %lx", 
>> diff -r e84a79d11d7a tools/libxc/xc_domain_save.c
>> --- a/tools/libxc/xc_domain_save.c	Thu Nov 01 01:41:03 2012 +0800
>> +++ b/tools/libxc/xc_domain_save.c	Thu Nov 01 07:52:41 2012 +0800 @@
>>                   -1277,6 +1277,13 @@ if ( !hvm )
>>                       gmfn = pfn_to_mfn(gmfn);
>> 
>> +                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN ) +   
>> { +                    pfn_type[j] |= pfn_batch[j];
>> +                    ++run;
>> +                    continue;
>> +                }
>> +
>>                   if ( pfn_err[j] )
>>                   {
>>                       if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
>>                       @@ -1371,8 +1378,12 @@ }
>>                   }
>> 
>> -                /* skip pages that aren't present or are alloc-only
>> */ +                /* +                 * skip pages that aren't
>> present, +                 * or are broken, or are alloc-only +     
>>                   */ if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
>> +                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
>>                       || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>>                       continue;
>> 
>> diff -r e84a79d11d7a tools/libxc/xenctrl.h
>> --- a/tools/libxc/xenctrl.h	Thu Nov 01 01:41:03 2012 +0800
>> +++ b/tools/libxc/xenctrl.h	Thu Nov 01 07:52:41 2012 +0800 @@ -575,6
>>                             +575,17 @@ xc_domaininfo_t *info);
>> 
>>   /**
>> + * This function set p2m for broken page
>> + * &parm xch a handle to an open hypervisor interface
>> + * @parm domid the domain id which broken page belong to
>> + * @parm pfn the pfn number of the broken page
>> + * @return 0 on success, -1 on failure
>> + */
>> +int xc_set_broken_page_p2m(xc_interface *xch,
>> +                           uint32_t domid,
>> +                           unsigned long pfn);
>> +
>> +/**
>>    * This function returns information about the context of a hvm
>> domain 
>>    * @parm xch a handle to an open hypervisor interface
>>    * @parm domid the domain to get information from
>> diff -r e84a79d11d7a xen/arch/x86/domctl.c
>> --- a/xen/arch/x86/domctl.c	Thu Nov 01 01:41:03 2012 +0800
>> +++ b/xen/arch/x86/domctl.c	Thu Nov 01 07:52:41 2012 +0800 @@
>>                   -209,12 +209,18 @@ for ( j = 0; j < k; j++ )
>>                   {
>>                       unsigned long type = 0;
>> +                    p2m_type_t t;
>> 
>> -                    page = get_page_from_gfn(d, arr[j], NULL,
>> P2M_ALLOC); +                    page = get_page_from_gfn(d, arr[j],
>> &t, P2M_ALLOC); 
>> 
>>                       if ( unlikely(!page) ||
>>                            unlikely(is_xen_heap_page(page)) )
>> -                        type = XEN_DOMCTL_PFINFO_XTAB; +           
>> { +                        if ( p2m_is_broken(t) )
>> +                            type = XEN_DOMCTL_PFINFO_BROKEN; +     
>> else +                            type = XEN_DOMCTL_PFINFO_XTAB; +  
>>                       } else
>>                       {
>>                           switch( page->u.inuse.type_info &
>> PGT_type_mask ) @@ -235,6 +241,9 @@ 
>> 
>>                           if ( page->u.inuse.type_info & PGT_pinned )
>>                               type |= XEN_DOMCTL_PFINFO_LPINTAB; +
>> +                        if ( page->count_info & PGC_broken )
>> +                            type = XEN_DOMCTL_PFINFO_BROKEN;       
>> } 
>> 
>>                       if ( page )
>> @@ -1568,6 +1577,29 @@
>>       }
>>       break;
>> 
>> +    case XEN_DOMCTL_set_broken_page_p2m:
>> +    {
>> +        struct domain *d;
>> +
>> +        d = rcu_lock_domain_by_id(domctl->domain); +        if ( d
>> != NULL ) +        {
>> +            p2m_type_t pt;
>> +            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
>> +            mfn_t mfn = get_gfn_query(d, pfn, &pt); +
>> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt)
>> || +                         (p2m_change_type(d, pfn, pt,
>> p2m_ram_broken) != pt)) ) +                ret = -EINVAL;
>> +
>> +            put_gfn(d, pfn);
>> +            rcu_unlock_domain(d);
>> +        }
>> +        else
>> +            ret = -ESRCH;
>> +    }
>> +    break;
>> +
>>       default:
>>           ret = iommu_do_domctl(domctl, u_domctl);
>>           break;
>> diff -r e84a79d11d7a xen/include/public/domctl.h
>> --- a/xen/include/public/domctl.h	Thu Nov 01 01:41:03 2012 +0800
>> +++ b/xen/include/public/domctl.h	Thu Nov 01 07:52:41 2012 +0800 @@
>>   -136,6 +136,7 @@ #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
>>   #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
>>   #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page
>> */ +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
>>   #define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
>>   #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
>> 
>> @@ -835,6 +836,12 @@
>>   typedef struct xen_domctl_set_access_required
>>   xen_domctl_set_access_required_t;
>> DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t); 
>> 
>> +struct xen_domctl_set_broken_page_p2m {
>> +    uint64_aligned_t pfn;
>> +};
>> +typedef struct xen_domctl_set_broken_page_p2m
>> xen_domctl_set_broken_page_p2m_t;
>>   +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t); +
>>       struct xen_domctl { uint32_t cmd;
>>   #define XEN_DOMCTL_createdomain                   1 @@ -900,6
>>   +907,7 @@ #define XEN_DOMCTL_set_access_required           64
>>   #define XEN_DOMCTL_audit_p2m                     65
>>   #define XEN_DOMCTL_set_virq_handler              66
>> +#define XEN_DOMCTL_set_broken_page_p2m           67
>>   #define XEN_DOMCTL_gdbsx_guestmemio            1000
>>   #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>>   #define XEN_DOMCTL_gdbsx_unpausevcpu           1002 @@ -955,6
>>           +963,7 @@ struct xen_domctl_audit_p2m         audit_p2m;
>>           struct xen_domctl_set_virq_handler  set_virq_handler;
>>           struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
>> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>>           struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>>           struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>>           uint8_t                             pad[128];


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 16:08:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 16:08:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTxIu-0007Kn-MT; Thu, 01 Nov 2012 16:07:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TTxIs-0007Ki-FW
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 16:07:34 +0000
Received: from [85.158.138.51:33146] by server-10.bemta-3.messagelabs.com id
	AF/D5-19806-54E92905; Thu, 01 Nov 2012 16:07:33 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1351786051!20223178!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzYyMDIw\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1573 invoked from network); 1 Nov 2012 16:07:32 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-3.tower-174.messagelabs.com with SMTP;
	1 Nov 2012 16:07:32 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 01 Nov 2012 09:06:22 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,693,1344236400"; d="scan'208";a="214023247"
Received: from fmsmsx107.amr.corp.intel.com ([10.19.9.54])
	by orsmga001.jf.intel.com with ESMTP; 01 Nov 2012 09:06:52 -0700
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX107.amr.corp.intel.com (10.19.9.54) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 1 Nov 2012 09:06:52 -0700
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Fri, 2 Nov 2012 00:06:51 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Thread-Topic: [PATCH 01/02] Handles broken page occurred before migration
Thread-Index: AQHNuCIVIm/L3sGKQI2O8U05ITu8CJfVIufg
Date: Thu, 1 Nov 2012 16:06:50 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335377C29@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537668D@SHSMSX101.ccr.corp.intel.com>
	<50912B5F02000078000A5B8E@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335376A97@SHSMSX101.ccr.corp.intel.com>
	<509259A0.9010509@eu.citrix.com>
In-Reply-To: <509259A0.9010509@eu.citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 01/02] Handles broken page occurred before
	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> Are you actually using "hg email" (or patchbomb) to send these?
> 
> Having changes to patches included in-line to replies makes it hard to
> keep track of what the newest version is.  Tradition is to send the
> whole series again, with "v2" or "v3" added to the end. If you're
> using patchbomb, the relevant command would be:
> 
> $ hg email -o --flag "v3"

OK, I will use 'hg email' next time updating vmce patch.
(I'm just not habit of using it, say, defaultly the patch is included as text in the email body for easy reviewing, but when I use 'a' hoping to attach patch file, the patch context disappear in the email body -- only patch description left in the email body)

> 
> Also, the second patch doesn't seem to apply to xen-unstable tip
> anymore -- can you rebase?
> 
>   -George

Sure.

Thanks,
Jinsong

> 
> On 31/10/12 17:14, Liu, Jinsong wrote:
>> [snip]
>>> If you use scope restricted local variables (which I appreciate),
>>> please declare them in the innermost possible scope, ...
>>> 
>>>> +
>>>> +        d = rcu_lock_domain_by_id(domctl->domain); +        if (
>>>> d != NULL ) +        { +            pfn =
>>>> domctl->u.set_broken_page_p2m.pfn; + +            mfn =
>>>> get_gfn_query(d, pfn, &pt); 
>>> ... i.e. here (and then both assignments can become initializers at
>>> once). 
>>> 
>>>> +            if ( !mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ) +
>>>> { +                put_gfn(d, pfn);
>>>> +                rcu_unlock_domain(d);
>>>> +                ret = -EINVAL;
>>>> +                break;
>>>> +            }
>>>> +
>>>> +            if ( p2m_change_type(d, pfn, pt, p2m_ram_broken) !=
>>>> pt ) +                ret = -EINVAL;
>>> The two if() conditions can be easily joined (the more that they
>>> both produce -EINVAL). 
>>> 
>> Thanks, updated as attached.
>> 
>> Jinsong
>> 
>> ======================
>> 
>> Handles broken page occurred before migration
>> 
>> This patch handles guest broken page which occurred before migration.
>> 
>> At sender, the broken page would be mapped but not copied to target
>> (otherwise it may trigger more serious error, say, SRAR error).
>> While its pfn_type and pfn number would be transferred to target
>> so that target take appropriate action.
>> 
>> At target, it would set p2m as p2m_ram_broken for broken page, so
>> that 
>> if guest access the broken page again, it would kill itself as
>> expected. 
>> 
>> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
>> 
>> diff -r e84a79d11d7a tools/libxc/xc_domain.c
>> --- a/tools/libxc/xc_domain.c	Thu Nov 01 01:41:03 2012 +0800
>> +++ b/tools/libxc/xc_domain.c	Thu Nov 01 07:52:41 2012 +0800 @@
>>       -283,6 +283,22 @@ return ret;
>>   }
>> 
>> +/* set broken page p2m */
>> +int xc_set_broken_page_p2m(xc_interface *xch,
>> +                           uint32_t domid,
>> +                           unsigned long pfn)
>> +{
>> +    int ret;
>> +    DECLARE_DOMCTL;
>> +
>> +    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
>> +    domctl.domain = (domid_t)domid;
>> +    domctl.u.set_broken_page_p2m.pfn = pfn;
>> +    ret = do_domctl(xch, &domctl);
>> +
>> +    return ret ? -1 : 0;
>> +}
>> +
>>   /* get info from hvm guest for save */
>>   int xc_domain_hvm_getcontext(xc_interface *xch,
>>                                uint32_t domid,
>> diff -r e84a79d11d7a tools/libxc/xc_domain_restore.c
>> --- a/tools/libxc/xc_domain_restore.c	Thu Nov 01 01:41:03 2012 +0800
>> +++ b/tools/libxc/xc_domain_restore.c	Thu Nov 01 07:52:41 2012 +0800
>> @@ -962,9 +962,15 @@ 
>> 
>>       countpages = count;
>>       for (i = oldcount; i < buf->nr_pages; ++i)
>> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
>> XEN_DOMCTL_PFINFO_XTAB 
>> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
>> XEN_DOMCTL_PFINFO_XALLOC) +    { +        unsigned long pagetype;
>> +
>> +        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
>> +        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
>> +             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
>> +             pagetype == XEN_DOMCTL_PFINFO_XALLOC )              
>> --countpages; +    }
>> 
>>       if (!countpages)
>>           return count;
>> @@ -1200,6 +1206,17 @@
>>               /* a bogus/unmapped/allocate-only page: skip it */    
>> continue; 
>> 
>> +        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN ) +        {
>> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) ) +         
>> { +                ERROR("Set p2m for broken page failed, "
>> +                      "dom=%d, pfn=%lx\n", dom, pfn);
>> +                goto err_mapped;
>> +            }
>> +            continue;
>> +        }
>> +
>>           if (pfn_err[i])
>>           {
>>               ERROR("unexpected PFN mapping failure pfn %lx map_mfn
>> %lx p2m_mfn %lx", 
>> diff -r e84a79d11d7a tools/libxc/xc_domain_save.c
>> --- a/tools/libxc/xc_domain_save.c	Thu Nov 01 01:41:03 2012 +0800
>> +++ b/tools/libxc/xc_domain_save.c	Thu Nov 01 07:52:41 2012 +0800 @@
>>                   -1277,6 +1277,13 @@ if ( !hvm )
>>                       gmfn = pfn_to_mfn(gmfn);
>> 
>> +                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN ) +   
>> { +                    pfn_type[j] |= pfn_batch[j];
>> +                    ++run;
>> +                    continue;
>> +                }
>> +
>>                   if ( pfn_err[j] )
>>                   {
>>                       if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
>>                       @@ -1371,8 +1378,12 @@ }
>>                   }
>> 
>> -                /* skip pages that aren't present or are alloc-only
>> */ +                /* +                 * skip pages that aren't
>> present, +                 * or are broken, or are alloc-only +     
>>                   */ if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
>> +                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
>>                       || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>>                       continue;
>> 
>> diff -r e84a79d11d7a tools/libxc/xenctrl.h
>> --- a/tools/libxc/xenctrl.h	Thu Nov 01 01:41:03 2012 +0800
>> +++ b/tools/libxc/xenctrl.h	Thu Nov 01 07:52:41 2012 +0800 @@ -575,6
>>                             +575,17 @@ xc_domaininfo_t *info);
>> 
>>   /**
>> + * This function set p2m for broken page
>> + * &parm xch a handle to an open hypervisor interface
>> + * @parm domid the domain id which broken page belong to
>> + * @parm pfn the pfn number of the broken page
>> + * @return 0 on success, -1 on failure
>> + */
>> +int xc_set_broken_page_p2m(xc_interface *xch,
>> +                           uint32_t domid,
>> +                           unsigned long pfn);
>> +
>> +/**
>>    * This function returns information about the context of a hvm
>> domain 
>>    * @parm xch a handle to an open hypervisor interface
>>    * @parm domid the domain to get information from
>> diff -r e84a79d11d7a xen/arch/x86/domctl.c
>> --- a/xen/arch/x86/domctl.c	Thu Nov 01 01:41:03 2012 +0800
>> +++ b/xen/arch/x86/domctl.c	Thu Nov 01 07:52:41 2012 +0800 @@
>>                   -209,12 +209,18 @@ for ( j = 0; j < k; j++ )
>>                   {
>>                       unsigned long type = 0;
>> +                    p2m_type_t t;
>> 
>> -                    page = get_page_from_gfn(d, arr[j], NULL,
>> P2M_ALLOC); +                    page = get_page_from_gfn(d, arr[j],
>> &t, P2M_ALLOC); 
>> 
>>                       if ( unlikely(!page) ||
>>                            unlikely(is_xen_heap_page(page)) )
>> -                        type = XEN_DOMCTL_PFINFO_XTAB; +           
>> { +                        if ( p2m_is_broken(t) )
>> +                            type = XEN_DOMCTL_PFINFO_BROKEN; +     
>> else +                            type = XEN_DOMCTL_PFINFO_XTAB; +  
>>                       } else
>>                       {
>>                           switch( page->u.inuse.type_info &
>> PGT_type_mask ) @@ -235,6 +241,9 @@ 
>> 
>>                           if ( page->u.inuse.type_info & PGT_pinned )
>>                               type |= XEN_DOMCTL_PFINFO_LPINTAB; +
>> +                        if ( page->count_info & PGC_broken )
>> +                            type = XEN_DOMCTL_PFINFO_BROKEN;       
>> } 
>> 
>>                       if ( page )
>> @@ -1568,6 +1577,29 @@
>>       }
>>       break;
>> 
>> +    case XEN_DOMCTL_set_broken_page_p2m:
>> +    {
>> +        struct domain *d;
>> +
>> +        d = rcu_lock_domain_by_id(domctl->domain); +        if ( d
>> != NULL ) +        {
>> +            p2m_type_t pt;
>> +            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
>> +            mfn_t mfn = get_gfn_query(d, pfn, &pt); +
>> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt)
>> || +                         (p2m_change_type(d, pfn, pt,
>> p2m_ram_broken) != pt)) ) +                ret = -EINVAL;
>> +
>> +            put_gfn(d, pfn);
>> +            rcu_unlock_domain(d);
>> +        }
>> +        else
>> +            ret = -ESRCH;
>> +    }
>> +    break;
>> +
>>       default:
>>           ret = iommu_do_domctl(domctl, u_domctl);
>>           break;
>> diff -r e84a79d11d7a xen/include/public/domctl.h
>> --- a/xen/include/public/domctl.h	Thu Nov 01 01:41:03 2012 +0800
>> +++ b/xen/include/public/domctl.h	Thu Nov 01 07:52:41 2012 +0800 @@
>>   -136,6 +136,7 @@ #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
>>   #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
>>   #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page
>> */ +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
>>   #define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
>>   #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
>> 
>> @@ -835,6 +836,12 @@
>>   typedef struct xen_domctl_set_access_required
>>   xen_domctl_set_access_required_t;
>> DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t); 
>> 
>> +struct xen_domctl_set_broken_page_p2m {
>> +    uint64_aligned_t pfn;
>> +};
>> +typedef struct xen_domctl_set_broken_page_p2m
>> xen_domctl_set_broken_page_p2m_t;
>>   +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t); +
>>       struct xen_domctl { uint32_t cmd;
>>   #define XEN_DOMCTL_createdomain                   1 @@ -900,6
>>   +907,7 @@ #define XEN_DOMCTL_set_access_required           64
>>   #define XEN_DOMCTL_audit_p2m                     65
>>   #define XEN_DOMCTL_set_virq_handler              66
>> +#define XEN_DOMCTL_set_broken_page_p2m           67
>>   #define XEN_DOMCTL_gdbsx_guestmemio            1000
>>   #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>>   #define XEN_DOMCTL_gdbsx_unpausevcpu           1002 @@ -955,6
>>           +963,7 @@ struct xen_domctl_audit_p2m         audit_p2m;
>>           struct xen_domctl_set_virq_handler  set_virq_handler;
>>           struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
>> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>>           struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>>           struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>>           uint8_t                             pad[128];


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 16:43:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 16:43:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTxrJ-0007zE-SF; Thu, 01 Nov 2012 16:43:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TTxrI-0007z9-3R
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 16:43:08 +0000
Received: from [85.158.143.99:36431] by server-1.bemta-4.messagelabs.com id
	77/07-27934-B96A2905; Thu, 01 Nov 2012 16:43:07 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1351788183!27691887!1
X-Originating-IP: [141.146.126.227]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuMjI3ID0+IDgzOTM3MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9650 invoked from network); 1 Nov 2012 16:43:06 -0000
Received: from acsinet15.oracle.com (HELO acsinet15.oracle.com)
	(141.146.126.227)
	by server-3.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 16:43:06 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA1Ggvos024280
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 1 Nov 2012 16:42:58 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA1Ggudu007205
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 1 Nov 2012 16:42:57 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA1Gguji002261; Thu, 1 Nov 2012 11:42:56 -0500
MIME-Version: 1.0
Message-ID: <38bc9a60-827c-41f8-a667-e08960b8c135@default>
Date: Thu, 1 Nov 2012 09:42:52 -0700 (PDT)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, Ian Jackson
	<Ian.Jackson@eu.citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__1351788176109146638abhmt102.oracle.com"
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] xen-tmem-list-parse: fix ugly parse output
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__1351788176109146638abhmt102.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

Hmmm... It appears I never posted the corrected version of this patch
so it never made it upstream.  See:

http://lists.xen.org/archives/html/xen-devel/2011-11/msg00587.html=20
http://lists.xen.org/archives/html/xen-devel/2011-11/msg02145.html=20

It would be good if this very minor fix was also applied to 4.2
(and, if possible, 4.1).

Thanks,
Dan

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

The program xen-tmem-list-parse parses the output of xm/xl tmem-list
into human-readable format.  A missing NULL terminator sometimes
causes garbage to be spewed where the two-letter pool type
should be output.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
---
 tools/misc/xen-tmem-list-parse.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/misc/xen-tmem-list-parse.c b/tools/misc/xen-tmem-list-pa=
rse.c
index 977e4d3..f32b107 100644
--- a/tools/misc/xen-tmem-list-parse.c
+++ b/tools/misc/xen-tmem-list-parse.c
@@ -243,6 +243,7 @@ void parse_pool(char *s)
     unsigned long long flush_objs =3D parse(s,"ot");
=20
     parse_string(s,"PT",pool_type,2);
+    pool_type[2] =3D '\0';
     if (pool_type[1] =3D=3D 'S')
         return; /* no need to repeat print data for shared pools */
     printf("domid%lu,id%lu[%s]:pgp=3D%llu(max=3D%llu) obj=3D%llu(%llu) "
@@ -286,6 +287,7 @@ void parse_shared_pool(char *s)
     unsigned long long flush_objs =3D parse(s,"ot");
=20
     parse_string(s,"PT",pool_type,2);
+    pool_type[2] =3D '\0';
     parse_sharers(s,"SC",buf,BUFSIZE);
     printf("poolid=3D%lu[%s] uuid=3D%llx.%llx, shared-by:%s: "
            "pgp=3D%llu(max=3D%llu) obj=3D%llu(%llu) "
--=20
1.7.1

--__1351788176109146638abhmt102.oracle.com
Content-Type: application/octet-stream;
 name="0001-Fix-ugly-parse-output-for-xen-tmem-list-parse.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="0001-Fix-ugly-parse-output-for-xen-tmem-list-parse.patch"

RnJvbTogRGFuIE1hZ2VuaGVpbWVyIDxkYW4ubWFnZW5oZWltZXJAb3JhY2xlLmNvbT4KRGF0ZTog
VGh1LCAxIE5vdiAyMDEyIDEwOjI0OjU2IC0wNjAwClN1YmplY3Q6IFtQQVRDSF0gRml4IHVnbHkg
cGFyc2Ugb3V0cHV0IGZvciB4ZW4tdG1lbS1saXN0LXBhcnNlCgpUaGUgcHJvZ3JhbSB4ZW4tdG1l
bS1saXN0LXBhcnNlIHBhcnNlcyB0aGUgb3V0cHV0IG9mIHhtL3hsIHRtZW0tbGlzdAppbnRvIGh1
bWFuLXJlYWRhYmxlIGZvcm1hdC4gIEEgbWlzc2luZyBOVUxMIHRlcm1pbmF0b3Igc29tZXRpbWVz
CmNhdXNlcyBnYXJiYWdlIHRvIGJlIHNwZXdlZCB3aGVyZSB0aGUgdHdvLWxldHRlciBwb29sIHR5
cG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KHMs
Im90Iik7CiAKICAgICBwYXJzZV9zdHJpbmcocywiUFQiLHBvb2xfdHlwZSwyKTsKKyAgICBwb29s
X3R5cGVbMl0gPSAnXDAnOwogICAgIHBhcnNlX3NoYXJlcnMocywiU0MiLGJ1ZixCVUZTSVpFKTsK
ICAgICBwcmludGYoInBvb2xpZD0lbHVbJXNdIHV1aWQ9JWxseC4lbGx4LCBzaGFyZWQtYnk6JXM6
ICIKICAgICAgICAgICAgInBncD0lbGx1KG1heD0lbGx1KSBvYmo9JWxsdSglbGx1KSAiCi0tIAox
LjcuMQoK
--__1351788176109146638abhmt102.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__1351788176109146638abhmt102.oracle.com--


From xen-devel-bounces@lists.xen.org Thu Nov 01 16:43:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 16:43:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTxrJ-0007zE-SF; Thu, 01 Nov 2012 16:43:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TTxrI-0007z9-3R
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 16:43:08 +0000
Received: from [85.158.143.99:36431] by server-1.bemta-4.messagelabs.com id
	77/07-27934-B96A2905; Thu, 01 Nov 2012 16:43:07 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1351788183!27691887!1
X-Originating-IP: [141.146.126.227]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuMjI3ID0+IDgzOTM3MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9650 invoked from network); 1 Nov 2012 16:43:06 -0000
Received: from acsinet15.oracle.com (HELO acsinet15.oracle.com)
	(141.146.126.227)
	by server-3.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 16:43:06 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA1Ggvos024280
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 1 Nov 2012 16:42:58 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA1Ggudu007205
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 1 Nov 2012 16:42:57 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA1Gguji002261; Thu, 1 Nov 2012 11:42:56 -0500
MIME-Version: 1.0
Message-ID: <38bc9a60-827c-41f8-a667-e08960b8c135@default>
Date: Thu, 1 Nov 2012 09:42:52 -0700 (PDT)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, Ian Jackson
	<Ian.Jackson@eu.citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__1351788176109146638abhmt102.oracle.com"
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] xen-tmem-list-parse: fix ugly parse output
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__1351788176109146638abhmt102.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

Hmmm... It appears I never posted the corrected version of this patch
so it never made it upstream.  See:

http://lists.xen.org/archives/html/xen-devel/2011-11/msg00587.html=20
http://lists.xen.org/archives/html/xen-devel/2011-11/msg02145.html=20

It would be good if this very minor fix was also applied to 4.2
(and, if possible, 4.1).

Thanks,
Dan

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

The program xen-tmem-list-parse parses the output of xm/xl tmem-list
into human-readable format.  A missing NULL terminator sometimes
causes garbage to be spewed where the two-letter pool type
should be output.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
---
 tools/misc/xen-tmem-list-parse.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/misc/xen-tmem-list-parse.c b/tools/misc/xen-tmem-list-pa=
rse.c
index 977e4d3..f32b107 100644
--- a/tools/misc/xen-tmem-list-parse.c
+++ b/tools/misc/xen-tmem-list-parse.c
@@ -243,6 +243,7 @@ void parse_pool(char *s)
     unsigned long long flush_objs =3D parse(s,"ot");
=20
     parse_string(s,"PT",pool_type,2);
+    pool_type[2] =3D '\0';
     if (pool_type[1] =3D=3D 'S')
         return; /* no need to repeat print data for shared pools */
     printf("domid%lu,id%lu[%s]:pgp=3D%llu(max=3D%llu) obj=3D%llu(%llu) "
@@ -286,6 +287,7 @@ void parse_shared_pool(char *s)
     unsigned long long flush_objs =3D parse(s,"ot");
=20
     parse_string(s,"PT",pool_type,2);
+    pool_type[2] =3D '\0';
     parse_sharers(s,"SC",buf,BUFSIZE);
     printf("poolid=3D%lu[%s] uuid=3D%llx.%llx, shared-by:%s: "
            "pgp=3D%llu(max=3D%llu) obj=3D%llu(%llu) "
--=20
1.7.1

--__1351788176109146638abhmt102.oracle.com
Content-Type: application/octet-stream;
 name="0001-Fix-ugly-parse-output-for-xen-tmem-list-parse.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="0001-Fix-ugly-parse-output-for-xen-tmem-list-parse.patch"

RnJvbTogRGFuIE1hZ2VuaGVpbWVyIDxkYW4ubWFnZW5oZWltZXJAb3JhY2xlLmNvbT4KRGF0ZTog
VGh1LCAxIE5vdiAyMDEyIDEwOjI0OjU2IC0wNjAwClN1YmplY3Q6IFtQQVRDSF0gRml4IHVnbHkg
cGFyc2Ugb3V0cHV0IGZvciB4ZW4tdG1lbS1saXN0LXBhcnNlCgpUaGUgcHJvZ3JhbSB4ZW4tdG1l
bS1saXN0LXBhcnNlIHBhcnNlcyB0aGUgb3V0cHV0IG9mIHhtL3hsIHRtZW0tbGlzdAppbnRvIGh1
bWFuLXJlYWRhYmxlIGZvcm1hdC4gIEEgbWlzc2luZyBOVUxMIHRlcm1pbmF0b3Igc29tZXRpbWVz
CmNhdXNlcyBnYXJiYWdlIHRvIGJlIHNwZXdlZCB3aGVyZSB0aGUgdHdvLWxldHRlciBwb29sIHR5
cGUKc2hvdWxkIGJlIG91dHB1dC4KClNpZ25lZC1vZmYtYnk6IERhbiBNYWdlbmhlaW1lciA8ZGFu
Lm1hZ2VuaGVpbWVyQG9yYWNsZS5jb20+Ci0tLQogdG9vbHMvbWlzYy94ZW4tdG1lbS1saXN0LXBh
cnNlL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BwcmludGYoInBvb2xpZD0lbHVbJXNdIHV1aWQ9JWxseC4lbGx4LCBzaGFyZWQtYnk6JXM6
ICIKICAgICAgICAgICAgInBncD0lbGx1KG1heD0lbGx1KSBvYmo9JWxsdSglbGx1KSAiCi0tIAox
LjcuMQoK
--__1351788176109146638abhmt102.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__1351788176109146638abhmt102.oracle.com--


From xen-devel-bounces@lists.xen.org Thu Nov 01 17:01:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 17:01:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTy8K-0008O2-NU; Thu, 01 Nov 2012 17:00:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TTy8J-0008Nx-Fg
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 17:00:43 +0000
Received: from [85.158.137.99:37371] by server-16.bemta-3.messagelabs.com id
	E7/7E-07461-ABAA2905; Thu, 01 Nov 2012 17:00:42 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1351789239!17332318!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16140 invoked from network); 1 Nov 2012 17:00:40 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 17:00:40 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TTy7s-000HK2-JL; Thu, 01 Nov 2012 17:00:16 +0000
Date: Thu, 1 Nov 2012 17:00:16 +0000
From: Tim Deegan <tim@xen.org>
To: Peter Maloney <peter.maloney@brockmann-consult.de>
Message-ID: <20121101170016.GD61948@ocelot.phlegethon.org>
References: <5082DD8C.2030608@brockmann-consult.de>
	<20121022135920.GE12577@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121022135920.GE12577@ocelot.phlegethon.org>
User-Agent: Mutt/1.4.2.1i
Cc: Andres Lagar-Cavilla <andres@lagarcavilla.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] xen-unstable,
	winxp32 very poor performance on AMD FX-8150,
	I bisected and changeset is 24770:7f79475d3de7
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

At 14:59 +0100 on 22 Oct (1350917960), Tim Deegan wrote:
> At 19:21 +0200 on 20 Oct (1350760876), Peter Maloney wrote:
> > The change was 8 months ago
> > 
> > changeset:   24770:7f79475d3de7
> > user:        Andres Lagar-Cavilla <andres@lagarcavilla.org>
> > date:        Fri Feb 10 16:07:07 2012 +0000
> > summary:     x86/mm: Make p2m lookups fully synchronized wrt modifications
> 
> This change was bad for performnace across the board and most of it has
> since been either reverted or amended, but clearly we missed something
> here. 
> 
> It's interesting that Win8 isn't slowed down.  I wonder whether that's to
> do with the way it drives the VGA card -- IIRC it uses a generic VESA
> driver rather than a Cirrus one. 

In fact this is to do with the APIC.  On my test system, a busy 2-vcpu
VM is making about 300k/s accesses to the APIC TPR.  These accesses are
all trapped and emulated by Xen, and that emulation has got more
expensive as part of this change.

Later Windows OSes have a feature called 'lazy IRQL' which makes those
accesses go away, but sadly that's not been done for WinXP.  On modern
Intel CPUs, the hardware acceleration for TPR accesses works for XP; on
AMD it requires the OS to use 'MOV reg32, CR8' to access the TPR instead
of MMIO, which XP is clearly not doing. :(

Peter: if you have the option, you might find that installing the PV
drivers that ship with Citrix XenServer 6.0 makes things work better.

Andres: even though this load of APIC emulations is pretty extreme, it's
surprising that the VM runs faster on shadow pagetables!  Any ideas for
where this slowdown is coming from?

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 17:01:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 17:01:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTy8K-0008O2-NU; Thu, 01 Nov 2012 17:00:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TTy8J-0008Nx-Fg
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 17:00:43 +0000
Received: from [85.158.137.99:37371] by server-16.bemta-3.messagelabs.com id
	E7/7E-07461-ABAA2905; Thu, 01 Nov 2012 17:00:42 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1351789239!17332318!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16140 invoked from network); 1 Nov 2012 17:00:40 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 17:00:40 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TTy7s-000HK2-JL; Thu, 01 Nov 2012 17:00:16 +0000
Date: Thu, 1 Nov 2012 17:00:16 +0000
From: Tim Deegan <tim@xen.org>
To: Peter Maloney <peter.maloney@brockmann-consult.de>
Message-ID: <20121101170016.GD61948@ocelot.phlegethon.org>
References: <5082DD8C.2030608@brockmann-consult.de>
	<20121022135920.GE12577@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121022135920.GE12577@ocelot.phlegethon.org>
User-Agent: Mutt/1.4.2.1i
Cc: Andres Lagar-Cavilla <andres@lagarcavilla.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] xen-unstable,
	winxp32 very poor performance on AMD FX-8150,
	I bisected and changeset is 24770:7f79475d3de7
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

At 14:59 +0100 on 22 Oct (1350917960), Tim Deegan wrote:
> At 19:21 +0200 on 20 Oct (1350760876), Peter Maloney wrote:
> > The change was 8 months ago
> > 
> > changeset:   24770:7f79475d3de7
> > user:        Andres Lagar-Cavilla <andres@lagarcavilla.org>
> > date:        Fri Feb 10 16:07:07 2012 +0000
> > summary:     x86/mm: Make p2m lookups fully synchronized wrt modifications
> 
> This change was bad for performnace across the board and most of it has
> since been either reverted or amended, but clearly we missed something
> here. 
> 
> It's interesting that Win8 isn't slowed down.  I wonder whether that's to
> do with the way it drives the VGA card -- IIRC it uses a generic VESA
> driver rather than a Cirrus one. 

In fact this is to do with the APIC.  On my test system, a busy 2-vcpu
VM is making about 300k/s accesses to the APIC TPR.  These accesses are
all trapped and emulated by Xen, and that emulation has got more
expensive as part of this change.

Later Windows OSes have a feature called 'lazy IRQL' which makes those
accesses go away, but sadly that's not been done for WinXP.  On modern
Intel CPUs, the hardware acceleration for TPR accesses works for XP; on
AMD it requires the OS to use 'MOV reg32, CR8' to access the TPR instead
of MMIO, which XP is clearly not doing. :(

Peter: if you have the option, you might find that installing the PV
drivers that ship with Citrix XenServer 6.0 makes things work better.

Andres: even though this load of APIC emulations is pretty extreme, it's
surprising that the VM runs faster on shadow pagetables!  Any ideas for
where this slowdown is coming from?

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 17:29:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 17:29:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTyZl-0000hX-1o; Thu, 01 Nov 2012 17:29:05 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1TTyZj-0000hL-FN
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 17:29:03 +0000
Received: from [85.158.143.35:23122] by server-3.bemta-4.messagelabs.com id
	87/EA-06841-E51B2905; Thu, 01 Nov 2012 17:29:02 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-6.tower-21.messagelabs.com!1351790939!15999624!1
X-Originating-IP: [209.85.210.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15369 invoked from network); 1 Nov 2012 17:29:00 -0000
Received: from mail-ia0-f173.google.com (HELO mail-ia0-f173.google.com)
	(209.85.210.173)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 17:29:00 -0000
Received: by mail-ia0-f173.google.com with SMTP id m10so2597405iam.32
	for <xen-devel@lists.xen.org>; Thu, 01 Nov 2012 10:28:59 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer
	:x-gm-message-state;
	bh=mFnGL9grTfH7TD+Wd+9+waZcIlRWY3kbRGXMqtoRDIA=;
	b=lz8iKo8swLODsOsUYo4chjFj0LIT7iF4Y7qGiSf1yXHn84Wy+9Lqf+k7TZEhi9WQ+1
	FfEmxvpia8tKC/KrL5qV3nyRchAuxxjOx/HRh5fHoYUslijRJ2UrEg+e9uJd6joW5uno
	0MsG/4tHzCm5t3JK0ObiUgX+G+GtkK5jVARVdksdGpV0bknvkRfPJ69kuAEU1FYdST1t
	i7CynsFbZbcXvxjxkB68IN8YXr73EPncv0hY2HdPkPk+Z3BM7XEG1YL2NjBtfjrP6QHw
	b1nUQqTNSd+MH280JyU/44WV1Z9pWuaWsZsZpdu5bxZsg/n+Fhr55yEuvSrHukToLXBr
	dx+Q==
Received: by 10.50.212.8 with SMTP id ng8mr1982325igc.64.1351790938998;
	Thu, 01 Nov 2012 10:28:58 -0700 (PDT)
Received: from andress-macbook.gridcentric.ca ([206.223.182.18])
	by mx.google.com with ESMTPS id pq3sm13370056igc.8.2012.11.01.10.28.57
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 01 Nov 2012 10:28:58 -0700 (PDT)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
In-Reply-To: <20121101170016.GD61948@ocelot.phlegethon.org>
Date: Thu, 1 Nov 2012 13:28:59 -0400
Message-Id: <E9577EEC-5F2E-4DFB-913F-C470D77CCF5C@gridcentric.ca>
References: <5082DD8C.2030608@brockmann-consult.de>
	<20121022135920.GE12577@ocelot.phlegethon.org>
	<20121101170016.GD61948@ocelot.phlegethon.org>
To: Tim Deegan <tim@xen.org>
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQmhYZEkDvP/b1Jrax0wsiPurRyuaxknOl3o6Gypc34ljhmvJTSTAK09c5zlJt3rdWZTs+Xw
Cc: Peter Maloney <peter.maloney@brockmann-consult.de>,
	Andres Lagar-Cavilla <andres@lagarcavilla.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] xen-unstable,
	winxp32 very poor performance on AMD FX-8150,
	I bisected and changeset is 24770:7f79475d3de7
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Nov 1, 2012, at 1:00 PM, Tim Deegan <tim@xen.org> wrote:

> Hi,
> 
> At 14:59 +0100 on 22 Oct (1350917960), Tim Deegan wrote:
>> At 19:21 +0200 on 20 Oct (1350760876), Peter Maloney wrote:
>>> The change was 8 months ago
>>> 
>>> changeset:   24770:7f79475d3de7
>>> user:        Andres Lagar-Cavilla <andres@lagarcavilla.org>
>>> date:        Fri Feb 10 16:07:07 2012 +0000
>>> summary:     x86/mm: Make p2m lookups fully synchronized wrt modifications
>> 
>> This change was bad for performnace across the board and most of it has
>> since been either reverted or amended, but clearly we missed something
>> here. 
>> 
>> It's interesting that Win8 isn't slowed down.  I wonder whether that's to
>> do with the way it drives the VGA card -- IIRC it uses a generic VESA
>> driver rather than a Cirrus one. 
> 
> In fact this is to do with the APIC.  On my test system, a busy 2-vcpu
> VM is making about 300k/s accesses to the APIC TPR.  These accesses are
> all trapped and emulated by Xen, and that emulation has got more
> expensive as part of this change.
> 
> Later Windows OSes have a feature called 'lazy IRQL' which makes those
> accesses go away, but sadly that's not been done for WinXP.  On modern
> Intel CPUs, the hardware acceleration for TPR accesses works for XP; on
> AMD it requires the OS to use 'MOV reg32, CR8' to access the TPR instead
> of MMIO, which XP is clearly not doing. :(
> 
> Peter: if you have the option, you might find that installing the PV
> drivers that ship with Citrix XenServer 6.0 makes things work better.
> 
> Andres: even though this load of APIC emulations is pretty extreme, it's
> surprising that the VM runs faster on shadow pagetables!  Any ideas for
> where this slowdown is coming from?

Not any immediate ideas without profiling.

However, most callers of hvmemul_do_io pass a stub zero ram_gpa address. We might be madly hitting the p2m locks for no reason there.

How about the following patch, Peter, Tim?
diff -r 5171750d133e xen/arch/x86/hvm/emulate.c
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -60,24 +60,28 @@ static int hvmemul_do_io(
     ioreq_t *p = get_ioreq(curr);
     unsigned long ram_gfn = paddr_to_pfn(ram_gpa);
     p2m_type_t p2mt;
-    struct page_info *ram_page;
+    struct page_info *ram_page = NULL;
     int rc;
 
     /* Check for paged out page */
-    ram_page = get_page_from_gfn(curr->domain, ram_gfn, &p2mt, P2M_UNSHARE);
-    if ( p2m_is_paging(p2mt) )
+    if ( ram_gpa != INVALID_MFN )
     {
-        if ( ram_page )
-            put_page(ram_page);
-        p2m_mem_paging_populate(curr->domain, ram_gfn);
-        return X86EMUL_RETRY;
-    }
-    if ( p2m_is_shared(p2mt) )
-    {
-        if ( ram_page )
-            put_page(ram_page);
-        return X86EMUL_RETRY;
-    }
+        ram_page = get_page_from_gfn(curr->domain, ram_gfn, &p2mt, P2M_UNSHARE);
+        if ( p2m_is_paging(p2mt) )
+        {
+            if ( ram_page )
+                put_page(ram_page);
+            p2m_mem_paging_populate(curr->domain, ram_gfn);
+            return X86EMUL_RETRY;
+        }
+        if ( p2m_is_shared(p2mt) )
+        {
+            if ( ram_page )
+                put_page(ram_page);
+            return X86EMUL_RETRY;
+        }
+    } else
+        value = 0; /* for pvalue */
 
     /*
      * Weird-sized accesses have undefined behaviour: we discard writes
@@ -455,7 +459,7 @@ static int __hvmemul_read(
             return X86EMUL_UNHANDLEABLE;
         gpa = (((paddr_t)vio->mmio_gpfn << PAGE_SHIFT) | off);
         if ( (off + bytes) <= PAGE_SIZE )
-            return hvmemul_do_mmio(gpa, &reps, bytes, 0,
+            return hvmemul_do_mmio(gpa, &reps, bytes, INVALID_MFN,
                                    IOREQ_READ, 0, p_data);
     }
 
@@ -480,7 +484,8 @@ static int __hvmemul_read(
             addr, &gpa, bytes, &reps, pfec, hvmemul_ctxt);
         if ( rc != X86EMUL_OKAY )
             return rc;
-        return hvmemul_do_mmio(gpa, &reps, bytes, 0, IOREQ_READ, 0, p_data);
+        return hvmemul_do_mmio(gpa, &reps, bytes, INVALID_MFN,
+                                IOREQ_READ, 0, p_data);
     case HVMCOPY_gfn_paged_out:
         return X86EMUL_RETRY;
     case HVMCOPY_gfn_shared:
@@ -552,7 +557,7 @@ static int hvmemul_write(
         unsigned int off = addr & (PAGE_SIZE - 1);
         gpa = (((paddr_t)vio->mmio_gpfn << PAGE_SHIFT) | off);
         if ( (off + bytes) <= PAGE_SIZE )
-            return hvmemul_do_mmio(gpa, &reps, bytes, 0,
+            return hvmemul_do_mmio(gpa, &reps, bytes, INVALID_MFN,
                                    IOREQ_WRITE, 0, p_data);
     }
 
@@ -573,7 +578,7 @@ static int hvmemul_write(
             addr, &gpa, bytes, &reps, pfec, hvmemul_ctxt);
         if ( rc != X86EMUL_OKAY )
             return rc;
-        return hvmemul_do_mmio(gpa, &reps, bytes, 0,
+        return hvmemul_do_mmio(gpa, &reps, bytes, INVALID_MFN,
                                IOREQ_WRITE, 0, p_data);
     case HVMCOPY_gfn_paged_out:
         return X86EMUL_RETRY;
@@ -804,7 +809,7 @@ static int hvmemul_read_io(
 {
     unsigned long reps = 1;
     *val = 0;
-    return hvmemul_do_pio(port, &reps, bytes, 0, IOREQ_READ, 0, val);
+    return hvmemul_do_pio(port, &reps, bytes, INVALID_MFN, IOREQ_READ, 0, val);
 }
 
 static int hvmemul_write_io(
@@ -814,7 +819,7 @@ static int hvmemul_write_io(
     struct x86_emulate_ctxt *ctxt)
 {
     unsigned long reps = 1;
-    return hvmemul_do_pio(port, &reps, bytes, 0, IOREQ_WRITE, 0, &val);
+    return hvmemul_do_pio(port, &reps, bytes, INVALID_MFN, IOREQ_WRITE, 0, &val);
 }
 
 static int hvmemul_read_cr(
diff -r 5171750d133e xen/arch/x86/hvm/io.c
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -231,7 +231,7 @@ int handle_pio(uint16_t port, int size, 
     if ( dir == IOREQ_WRITE )
         data = guest_cpu_user_regs()->eax;
 
-    rc = hvmemul_do_pio(port, &reps, size, 0, dir, 0, &data);
+    rc = hvmemul_do_pio(port, &reps, size, INVALID_MFN, dir, 0, &data);
 
     switch ( rc )
     {



> 
> Cheers,
> 
> Tim.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 17:29:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 17:29:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTyZl-0000hX-1o; Thu, 01 Nov 2012 17:29:05 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1TTyZj-0000hL-FN
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 17:29:03 +0000
Received: from [85.158.143.35:23122] by server-3.bemta-4.messagelabs.com id
	87/EA-06841-E51B2905; Thu, 01 Nov 2012 17:29:02 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-6.tower-21.messagelabs.com!1351790939!15999624!1
X-Originating-IP: [209.85.210.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15369 invoked from network); 1 Nov 2012 17:29:00 -0000
Received: from mail-ia0-f173.google.com (HELO mail-ia0-f173.google.com)
	(209.85.210.173)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 17:29:00 -0000
Received: by mail-ia0-f173.google.com with SMTP id m10so2597405iam.32
	for <xen-devel@lists.xen.org>; Thu, 01 Nov 2012 10:28:59 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer
	:x-gm-message-state;
	bh=mFnGL9grTfH7TD+Wd+9+waZcIlRWY3kbRGXMqtoRDIA=;
	b=lz8iKo8swLODsOsUYo4chjFj0LIT7iF4Y7qGiSf1yXHn84Wy+9Lqf+k7TZEhi9WQ+1
	FfEmxvpia8tKC/KrL5qV3nyRchAuxxjOx/HRh5fHoYUslijRJ2UrEg+e9uJd6joW5uno
	0MsG/4tHzCm5t3JK0ObiUgX+G+GtkK5jVARVdksdGpV0bknvkRfPJ69kuAEU1FYdST1t
	i7CynsFbZbcXvxjxkB68IN8YXr73EPncv0hY2HdPkPk+Z3BM7XEG1YL2NjBtfjrP6QHw
	b1nUQqTNSd+MH280JyU/44WV1Z9pWuaWsZsZpdu5bxZsg/n+Fhr55yEuvSrHukToLXBr
	dx+Q==
Received: by 10.50.212.8 with SMTP id ng8mr1982325igc.64.1351790938998;
	Thu, 01 Nov 2012 10:28:58 -0700 (PDT)
Received: from andress-macbook.gridcentric.ca ([206.223.182.18])
	by mx.google.com with ESMTPS id pq3sm13370056igc.8.2012.11.01.10.28.57
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 01 Nov 2012 10:28:58 -0700 (PDT)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
In-Reply-To: <20121101170016.GD61948@ocelot.phlegethon.org>
Date: Thu, 1 Nov 2012 13:28:59 -0400
Message-Id: <E9577EEC-5F2E-4DFB-913F-C470D77CCF5C@gridcentric.ca>
References: <5082DD8C.2030608@brockmann-consult.de>
	<20121022135920.GE12577@ocelot.phlegethon.org>
	<20121101170016.GD61948@ocelot.phlegethon.org>
To: Tim Deegan <tim@xen.org>
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQmhYZEkDvP/b1Jrax0wsiPurRyuaxknOl3o6Gypc34ljhmvJTSTAK09c5zlJt3rdWZTs+Xw
Cc: Peter Maloney <peter.maloney@brockmann-consult.de>,
	Andres Lagar-Cavilla <andres@lagarcavilla.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] xen-unstable,
	winxp32 very poor performance on AMD FX-8150,
	I bisected and changeset is 24770:7f79475d3de7
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Nov 1, 2012, at 1:00 PM, Tim Deegan <tim@xen.org> wrote:

> Hi,
> 
> At 14:59 +0100 on 22 Oct (1350917960), Tim Deegan wrote:
>> At 19:21 +0200 on 20 Oct (1350760876), Peter Maloney wrote:
>>> The change was 8 months ago
>>> 
>>> changeset:   24770:7f79475d3de7
>>> user:        Andres Lagar-Cavilla <andres@lagarcavilla.org>
>>> date:        Fri Feb 10 16:07:07 2012 +0000
>>> summary:     x86/mm: Make p2m lookups fully synchronized wrt modifications
>> 
>> This change was bad for performnace across the board and most of it has
>> since been either reverted or amended, but clearly we missed something
>> here. 
>> 
>> It's interesting that Win8 isn't slowed down.  I wonder whether that's to
>> do with the way it drives the VGA card -- IIRC it uses a generic VESA
>> driver rather than a Cirrus one. 
> 
> In fact this is to do with the APIC.  On my test system, a busy 2-vcpu
> VM is making about 300k/s accesses to the APIC TPR.  These accesses are
> all trapped and emulated by Xen, and that emulation has got more
> expensive as part of this change.
> 
> Later Windows OSes have a feature called 'lazy IRQL' which makes those
> accesses go away, but sadly that's not been done for WinXP.  On modern
> Intel CPUs, the hardware acceleration for TPR accesses works for XP; on
> AMD it requires the OS to use 'MOV reg32, CR8' to access the TPR instead
> of MMIO, which XP is clearly not doing. :(
> 
> Peter: if you have the option, you might find that installing the PV
> drivers that ship with Citrix XenServer 6.0 makes things work better.
> 
> Andres: even though this load of APIC emulations is pretty extreme, it's
> surprising that the VM runs faster on shadow pagetables!  Any ideas for
> where this slowdown is coming from?

Not any immediate ideas without profiling.

However, most callers of hvmemul_do_io pass a stub zero ram_gpa address. We might be madly hitting the p2m locks for no reason there.

How about the following patch, Peter, Tim?
diff -r 5171750d133e xen/arch/x86/hvm/emulate.c
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -60,24 +60,28 @@ static int hvmemul_do_io(
     ioreq_t *p = get_ioreq(curr);
     unsigned long ram_gfn = paddr_to_pfn(ram_gpa);
     p2m_type_t p2mt;
-    struct page_info *ram_page;
+    struct page_info *ram_page = NULL;
     int rc;
 
     /* Check for paged out page */
-    ram_page = get_page_from_gfn(curr->domain, ram_gfn, &p2mt, P2M_UNSHARE);
-    if ( p2m_is_paging(p2mt) )
+    if ( ram_gpa != INVALID_MFN )
     {
-        if ( ram_page )
-            put_page(ram_page);
-        p2m_mem_paging_populate(curr->domain, ram_gfn);
-        return X86EMUL_RETRY;
-    }
-    if ( p2m_is_shared(p2mt) )
-    {
-        if ( ram_page )
-            put_page(ram_page);
-        return X86EMUL_RETRY;
-    }
+        ram_page = get_page_from_gfn(curr->domain, ram_gfn, &p2mt, P2M_UNSHARE);
+        if ( p2m_is_paging(p2mt) )
+        {
+            if ( ram_page )
+                put_page(ram_page);
+            p2m_mem_paging_populate(curr->domain, ram_gfn);
+            return X86EMUL_RETRY;
+        }
+        if ( p2m_is_shared(p2mt) )
+        {
+            if ( ram_page )
+                put_page(ram_page);
+            return X86EMUL_RETRY;
+        }
+    } else
+        value = 0; /* for pvalue */
 
     /*
      * Weird-sized accesses have undefined behaviour: we discard writes
@@ -455,7 +459,7 @@ static int __hvmemul_read(
             return X86EMUL_UNHANDLEABLE;
         gpa = (((paddr_t)vio->mmio_gpfn << PAGE_SHIFT) | off);
         if ( (off + bytes) <= PAGE_SIZE )
-            return hvmemul_do_mmio(gpa, &reps, bytes, 0,
+            return hvmemul_do_mmio(gpa, &reps, bytes, INVALID_MFN,
                                    IOREQ_READ, 0, p_data);
     }
 
@@ -480,7 +484,8 @@ static int __hvmemul_read(
             addr, &gpa, bytes, &reps, pfec, hvmemul_ctxt);
         if ( rc != X86EMUL_OKAY )
             return rc;
-        return hvmemul_do_mmio(gpa, &reps, bytes, 0, IOREQ_READ, 0, p_data);
+        return hvmemul_do_mmio(gpa, &reps, bytes, INVALID_MFN,
+                                IOREQ_READ, 0, p_data);
     case HVMCOPY_gfn_paged_out:
         return X86EMUL_RETRY;
     case HVMCOPY_gfn_shared:
@@ -552,7 +557,7 @@ static int hvmemul_write(
         unsigned int off = addr & (PAGE_SIZE - 1);
         gpa = (((paddr_t)vio->mmio_gpfn << PAGE_SHIFT) | off);
         if ( (off + bytes) <= PAGE_SIZE )
-            return hvmemul_do_mmio(gpa, &reps, bytes, 0,
+            return hvmemul_do_mmio(gpa, &reps, bytes, INVALID_MFN,
                                    IOREQ_WRITE, 0, p_data);
     }
 
@@ -573,7 +578,7 @@ static int hvmemul_write(
             addr, &gpa, bytes, &reps, pfec, hvmemul_ctxt);
         if ( rc != X86EMUL_OKAY )
             return rc;
-        return hvmemul_do_mmio(gpa, &reps, bytes, 0,
+        return hvmemul_do_mmio(gpa, &reps, bytes, INVALID_MFN,
                                IOREQ_WRITE, 0, p_data);
     case HVMCOPY_gfn_paged_out:
         return X86EMUL_RETRY;
@@ -804,7 +809,7 @@ static int hvmemul_read_io(
 {
     unsigned long reps = 1;
     *val = 0;
-    return hvmemul_do_pio(port, &reps, bytes, 0, IOREQ_READ, 0, val);
+    return hvmemul_do_pio(port, &reps, bytes, INVALID_MFN, IOREQ_READ, 0, val);
 }
 
 static int hvmemul_write_io(
@@ -814,7 +819,7 @@ static int hvmemul_write_io(
     struct x86_emulate_ctxt *ctxt)
 {
     unsigned long reps = 1;
-    return hvmemul_do_pio(port, &reps, bytes, 0, IOREQ_WRITE, 0, &val);
+    return hvmemul_do_pio(port, &reps, bytes, INVALID_MFN, IOREQ_WRITE, 0, &val);
 }
 
 static int hvmemul_read_cr(
diff -r 5171750d133e xen/arch/x86/hvm/io.c
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -231,7 +231,7 @@ int handle_pio(uint16_t port, int size, 
     if ( dir == IOREQ_WRITE )
         data = guest_cpu_user_regs()->eax;
 
-    rc = hvmemul_do_pio(port, &reps, size, 0, dir, 0, &data);
+    rc = hvmemul_do_pio(port, &reps, size, INVALID_MFN, dir, 0, &data);
 
     switch ( rc )
     {



> 
> Cheers,
> 
> Tim.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 17:43:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 17:43:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTymq-00017O-C9; Thu, 01 Nov 2012 17:42:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TTymp-00017J-Kc
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 17:42:35 +0000
Received: from [85.158.138.51:9127] by server-15.bemta-3.messagelabs.com id
	E2/0A-09445-A84B2905; Thu, 01 Nov 2012 17:42:34 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1351791754!19427771!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY4ODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23024 invoked from network); 1 Nov 2012 17:42:34 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 17:42:34 -0000
X-IronPort-AV: E=Sophos;i="4.80,695,1344211200"; d="scan'208";a="15543619"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 17:42:33 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 1 Nov 2012 17:42:32 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TTymm-0004cT-UB;
	Thu, 01 Nov 2012 17:42:32 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TTymm-0008Ei-Nh;
	Thu, 01 Nov 2012 17:42:32 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14299-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 1 Nov 2012 17:42:32 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [linux-3.0 test] 14299: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14299 linux-3.0 real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14299/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-pv            5 xen-boot                  fail REGR. vs. 14199

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14199
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14199
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14199
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14199

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass

version targeted for testing:
 linux                27d0858dbcf199838b8c50a3e94d397bf326d986
baseline version:
 linux                d9ee258b13506301b6da6450cf7a1692826b471e

------------------------------------------------------------
People who touched revisions under test:
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           fail    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 27d0858dbcf199838b8c50a3e94d397bf326d986
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Wed Oct 31 09:51:59 2012 -0700

    Linux 3.0.50

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 17:43:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 17:43:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTymq-00017O-C9; Thu, 01 Nov 2012 17:42:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TTymp-00017J-Kc
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 17:42:35 +0000
Received: from [85.158.138.51:9127] by server-15.bemta-3.messagelabs.com id
	E2/0A-09445-A84B2905; Thu, 01 Nov 2012 17:42:34 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1351791754!19427771!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY4ODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23024 invoked from network); 1 Nov 2012 17:42:34 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 17:42:34 -0000
X-IronPort-AV: E=Sophos;i="4.80,695,1344211200"; d="scan'208";a="15543619"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 17:42:33 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 1 Nov 2012 17:42:32 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TTymm-0004cT-UB;
	Thu, 01 Nov 2012 17:42:32 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TTymm-0008Ei-Nh;
	Thu, 01 Nov 2012 17:42:32 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14299-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 1 Nov 2012 17:42:32 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [linux-3.0 test] 14299: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14299 linux-3.0 real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14299/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-pv            5 xen-boot                  fail REGR. vs. 14199

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14199
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14199
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14199
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14199

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass

version targeted for testing:
 linux                27d0858dbcf199838b8c50a3e94d397bf326d986
baseline version:
 linux                d9ee258b13506301b6da6450cf7a1692826b471e

------------------------------------------------------------
People who touched revisions under test:
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           fail    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 27d0858dbcf199838b8c50a3e94d397bf326d986
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Wed Oct 31 09:51:59 2012 -0700

    Linux 3.0.50

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 17:46:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 17:46:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTyqh-0001H3-1V; Thu, 01 Nov 2012 17:46:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TTyqf-0001Gx-VO
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 17:46:34 +0000
Received: from [85.158.139.83:3738] by server-4.bemta-5.messagelabs.com id
	E0/15-15011-975B2905; Thu, 01 Nov 2012 17:46:33 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1351791992!28333682!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY4ODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15291 invoked from network); 1 Nov 2012 17:46:32 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 17:46:32 -0000
X-IronPort-AV: E=Sophos;i="4.80,695,1344211200"; d="scan'208";a="15543667"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 17:46:19 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 1 Nov 2012 17:46:18 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TTyqQ-0004dw-KA; Thu, 01 Nov 2012 17:46:18 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TTyqQ-0002qi-9x;
	Thu, 01 Nov 2012 17:46:18 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20626.46441.914578.814812@mariner.uk.xensource.com>
Date: Thu, 1 Nov 2012 17:46:17 +0000
To: xen.org <ian.jackson@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Tim Deegan <tim@xen.org>, Ian Campbell <ian.campbell@citrix.com>,
	Jan Beulich <JBeulich@suse.com>
Subject: [Xen-devel] [PATCH 4.2] properly handle errors from page sharing
	hypercalls
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

xen.org writes ("[xen-4.2-testing bisection] complete test-i386-i386-xl"):
> branch xen-4.2-testing
> xen branch xen-4.2-testing
> job test-i386-i386-xl
> test guest-start
> 
> Tree: linux git://xenbits.xen.org/linux-pvops.git
> Tree: qemu git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
> Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
> Tree: xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
> 
> *** Found and reproduced problem changeset ***
> 
>   Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
>   Bug introduced:  051e2a30e3fb
>   Bug not present: c23d938e3e64
> 
> 
>   changeset:   25886:051e2a30e3fb
>   user:        Ian Campbell <Ian.Campbell@citrix.com>
>   date:        Fri Oct 26 16:40:18 2012 +0100
> 
>       libxl: handle errors from xc_sharing_* info functions
> 
>       On a 32 bit hypervisor xl info currently reports:
>       sharing_freed_memory   : 72057594037927935
>       sharing_used_memory    : 72057594037927935
> 
>       Eat the ENOSYS and turn it into 0. Log and propagate other errors.
> 
>       I don't have a 32 bit system handy, so tested on x86_64 with a libxc
>       hacked to return -ENOSYS and -EINVAL.
> 
>       Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>       Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
>       Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
>       Committed-by: Ian Campbell <ian.campbell@citrix.com>
> 
>       xen-unstable changeset: 25894:95a971c8058f
>       Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
>       Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

I have been investigating this.

I don't see how it could possibly have ever worked.  AFAICT the
problem is as follows:

 * XENMEM_get_sharing_freed_pages is handled by subarch_memory_op.
   On 32-bit, it is not supported and returs ENOSYS.

 * Eventually, this causes the ioctl IOCTL_PRIVCMD_HYPERCALL to return
   -1 setting errno to ENOSYS.  This return value is propagated by
   libxc, with xc_sharing_freed_pages returning -1.

 * So in libxl_get_physinfo l==-1.  But the code mistakenly assumes
   that xc_sharing_freed_pages would have returned -errno.
   We therefore take the LIBXL__LOG_ERRNOVAL branch.

 * Additionally because we failed to make the errno value nonnegative
   again (if l is -errno, then LIBXL__LOG_ERRNOVAL should take -l for
   the errno value), libxl__logv does not in fact log the supposed
   errno value of 1.  (Which would be EPERM.)

I don't think this patch in this form can ever have worked as
intended.  The only reason we didn't spot that this doesn't work when
this patch was tested in xen-unstable is that xen-unstable doesn't
have 32-bit any more.  The tests described in the commit message must
have involved making the same mistake as in the patch, of course.

I have committed the attached patch to xen-4.2-testing.hg.  Hopefully
this will get us a test push.  After that we should consider what
other backports are needed.

Ian.

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1351791764 0
# Node ID 9d2ad9218dcc5a541ca09f47f60d7c3fec1039eb
# Parent  4727c234198d51fdd248c3ba92560faa147b2ac6
libxl: properly handle errors from page sharing hypercalls

25886:051e2a30e3fb (25894:95a971c8058f in xen-unstable) is wrong
because it assumes that xc_sharing_freed_pages etc. return -errnoval
on error.  However, like other libxc calls they return -1 setting
errno.

Correct this, checking for l<0 and then testing errno against ENOSYS,
and also log the correct errno value.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

diff -r 4727c234198d -r 9d2ad9218dcc tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Fri Oct 26 17:03:13 2012 +0100
+++ b/tools/libxl/libxl.c	Thu Nov 01 17:42:44 2012 +0000
@@ -3653,21 +3653,25 @@ int libxl_get_physinfo(libxl_ctx *ctx, l
     physinfo->free_pages = xcphysinfo.free_pages;
     physinfo->scrub_pages = xcphysinfo.scrub_pages;
     l = xc_sharing_freed_pages(ctx->xch);
-    if (l == -ENOSYS) {
-        l = 0;
-    } else if (l < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, l,
-                            "getting sharing freed pages");
-        return ERROR_FAIL;
+    if (l < 0) {
+        if (errno == ENOSYS) {
+            l = 0;
+        } else {
+            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
+                             "getting sharing freed pages");
+            return ERROR_FAIL;
+        }
     }
     physinfo->sharing_freed_pages = l;
     l = xc_sharing_used_frames(ctx->xch);
-    if (l == -ENOSYS) {
-        l = 0;
-    } else if (l < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, l,
-                            "getting sharing used frames");
-        return ERROR_FAIL;
+    if (l < 0) {
+        if (errno == ENOSYS) {
+            l = 0;
+        } else {
+            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
+                             "getting sharing used frames");
+            return ERROR_FAIL;
+        }
     }
     physinfo->sharing_used_frames = l;
     physinfo->nr_nodes = xcphysinfo.nr_nodes;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 17:46:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 17:46:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTyqh-0001H3-1V; Thu, 01 Nov 2012 17:46:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TTyqf-0001Gx-VO
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 17:46:34 +0000
Received: from [85.158.139.83:3738] by server-4.bemta-5.messagelabs.com id
	E0/15-15011-975B2905; Thu, 01 Nov 2012 17:46:33 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1351791992!28333682!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY4ODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15291 invoked from network); 1 Nov 2012 17:46:32 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 17:46:32 -0000
X-IronPort-AV: E=Sophos;i="4.80,695,1344211200"; d="scan'208";a="15543667"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 17:46:19 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 1 Nov 2012 17:46:18 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TTyqQ-0004dw-KA; Thu, 01 Nov 2012 17:46:18 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TTyqQ-0002qi-9x;
	Thu, 01 Nov 2012 17:46:18 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20626.46441.914578.814812@mariner.uk.xensource.com>
Date: Thu, 1 Nov 2012 17:46:17 +0000
To: xen.org <ian.jackson@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Tim Deegan <tim@xen.org>, Ian Campbell <ian.campbell@citrix.com>,
	Jan Beulich <JBeulich@suse.com>
Subject: [Xen-devel] [PATCH 4.2] properly handle errors from page sharing
	hypercalls
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

xen.org writes ("[xen-4.2-testing bisection] complete test-i386-i386-xl"):
> branch xen-4.2-testing
> xen branch xen-4.2-testing
> job test-i386-i386-xl
> test guest-start
> 
> Tree: linux git://xenbits.xen.org/linux-pvops.git
> Tree: qemu git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
> Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
> Tree: xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
> 
> *** Found and reproduced problem changeset ***
> 
>   Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
>   Bug introduced:  051e2a30e3fb
>   Bug not present: c23d938e3e64
> 
> 
>   changeset:   25886:051e2a30e3fb
>   user:        Ian Campbell <Ian.Campbell@citrix.com>
>   date:        Fri Oct 26 16:40:18 2012 +0100
> 
>       libxl: handle errors from xc_sharing_* info functions
> 
>       On a 32 bit hypervisor xl info currently reports:
>       sharing_freed_memory   : 72057594037927935
>       sharing_used_memory    : 72057594037927935
> 
>       Eat the ENOSYS and turn it into 0. Log and propagate other errors.
> 
>       I don't have a 32 bit system handy, so tested on x86_64 with a libxc
>       hacked to return -ENOSYS and -EINVAL.
> 
>       Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>       Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
>       Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
>       Committed-by: Ian Campbell <ian.campbell@citrix.com>
> 
>       xen-unstable changeset: 25894:95a971c8058f
>       Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
>       Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

I have been investigating this.

I don't see how it could possibly have ever worked.  AFAICT the
problem is as follows:

 * XENMEM_get_sharing_freed_pages is handled by subarch_memory_op.
   On 32-bit, it is not supported and returs ENOSYS.

 * Eventually, this causes the ioctl IOCTL_PRIVCMD_HYPERCALL to return
   -1 setting errno to ENOSYS.  This return value is propagated by
   libxc, with xc_sharing_freed_pages returning -1.

 * So in libxl_get_physinfo l==-1.  But the code mistakenly assumes
   that xc_sharing_freed_pages would have returned -errno.
   We therefore take the LIBXL__LOG_ERRNOVAL branch.

 * Additionally because we failed to make the errno value nonnegative
   again (if l is -errno, then LIBXL__LOG_ERRNOVAL should take -l for
   the errno value), libxl__logv does not in fact log the supposed
   errno value of 1.  (Which would be EPERM.)

I don't think this patch in this form can ever have worked as
intended.  The only reason we didn't spot that this doesn't work when
this patch was tested in xen-unstable is that xen-unstable doesn't
have 32-bit any more.  The tests described in the commit message must
have involved making the same mistake as in the patch, of course.

I have committed the attached patch to xen-4.2-testing.hg.  Hopefully
this will get us a test push.  After that we should consider what
other backports are needed.

Ian.

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1351791764 0
# Node ID 9d2ad9218dcc5a541ca09f47f60d7c3fec1039eb
# Parent  4727c234198d51fdd248c3ba92560faa147b2ac6
libxl: properly handle errors from page sharing hypercalls

25886:051e2a30e3fb (25894:95a971c8058f in xen-unstable) is wrong
because it assumes that xc_sharing_freed_pages etc. return -errnoval
on error.  However, like other libxc calls they return -1 setting
errno.

Correct this, checking for l<0 and then testing errno against ENOSYS,
and also log the correct errno value.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

diff -r 4727c234198d -r 9d2ad9218dcc tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Fri Oct 26 17:03:13 2012 +0100
+++ b/tools/libxl/libxl.c	Thu Nov 01 17:42:44 2012 +0000
@@ -3653,21 +3653,25 @@ int libxl_get_physinfo(libxl_ctx *ctx, l
     physinfo->free_pages = xcphysinfo.free_pages;
     physinfo->scrub_pages = xcphysinfo.scrub_pages;
     l = xc_sharing_freed_pages(ctx->xch);
-    if (l == -ENOSYS) {
-        l = 0;
-    } else if (l < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, l,
-                            "getting sharing freed pages");
-        return ERROR_FAIL;
+    if (l < 0) {
+        if (errno == ENOSYS) {
+            l = 0;
+        } else {
+            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
+                             "getting sharing freed pages");
+            return ERROR_FAIL;
+        }
     }
     physinfo->sharing_freed_pages = l;
     l = xc_sharing_used_frames(ctx->xch);
-    if (l == -ENOSYS) {
-        l = 0;
-    } else if (l < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, l,
-                            "getting sharing used frames");
-        return ERROR_FAIL;
+    if (l < 0) {
+        if (errno == ENOSYS) {
+            l = 0;
+        } else {
+            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
+                             "getting sharing used frames");
+            return ERROR_FAIL;
+        }
     }
     physinfo->sharing_used_frames = l;
     physinfo->nr_nodes = xcphysinfo.nr_nodes;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 18:05:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 18:05:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTz8x-0001n9-V6; Thu, 01 Nov 2012 18:05:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rdunlap@infradead.org>) id 1TTyQG-0000KB-4R
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 17:19:16 +0000
Received: from [85.158.139.211:63750] by server-16.bemta-5.messagelabs.com id
	67/75-04786-31FA2905; Thu, 01 Nov 2012 17:19:15 +0000
X-Env-Sender: rdunlap@infradead.org
X-Msg-Ref: server-3.tower-206.messagelabs.com!1351790352!18512055!1
X-Originating-IP: [85.118.1.10]
X-SpamReason: No, hits=2.3 required=7.0 tests=UNIQUE_WORDS,
  UPPERCASE_50_75
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19379 invoked from network); 1 Nov 2012 17:19:13 -0000
Received: from casper.infradead.org (HELO casper.infradead.org) (85.118.1.10)
	by server-3.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 17:19:13 -0000
Received: from static-50-53-38-135.bvtn.or.frontiernet.net ([50.53.38.135]
	helo=[192.168.1.7])
	by casper.infradead.org with esmtpsa (Exim 4.76 #1 (Red Hat Linux))
	id 1TTyPq-0000es-S5; Thu, 01 Nov 2012 17:18:51 +0000
Message-ID: <5092AEF7.5020609@infradead.org>
Date: Thu, 01 Nov 2012 10:18:47 -0700
From: Randy Dunlap <rdunlap@infradead.org>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.15) Gecko/20110323 Thunderbird/3.1.9
MIME-Version: 1.0
To: Stephen Rothwell <sfr@canb.auug.org.au>
References: <20121101163622.129b59967d2ee76e6946874a@canb.auug.org.au>
In-Reply-To: <20121101163622.129b59967d2ee76e6946874a@canb.auug.org.au>
Content-Type: multipart/mixed; boundary="------------010605010902080307000907"
X-Mailman-Approved-At: Thu, 01 Nov 2012 18:05:25 +0000
Cc: Jeremy Fitzhardinge <jeremy@goop.org>, xen-devel@lists.xensource.com,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	linux-next@vger.kernel.org
Subject: Re: [Xen-devel] linux-next: Tree for Nov 1 (xen)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.
--------------010605010902080307000907
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On 10/31/2012 10:36 PM, Stephen Rothwell wrote:

> Hi all,
> 
> New trees: rr-fixes and swiotlb
> 
> Changes since 20121031:
> 


arch/x86/xen/enlighten.c:109:0: warning: "xen_pvh_domain" redefined
include/xen/xen.h:23:0: note: this is the location of the previous definition

Full randconfig file is attached.

-- 
~Randy

--------------010605010902080307000907
Content-Type: text/plain;
 name="config-r8493"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="config-r8493"

#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 3.7.0-rc3 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_GPIO=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_DEFAULT_IDLE=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_ARCH_HAS_CPU_AUTOPROBE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ZONE_DMA32=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11"
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_HAVE_IRQ_WORK=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_EXTABLE_SORT=y

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
# CONFIG_KERNEL_GZIP is not set
CONFIG_KERNEL_BZIP2=y
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SYSVIPC=y
CONFIG_FHANDLE=y
CONFIG_HAVE_GENERIC_HARDIRQS=y

#
# IRQ subsystem
#
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_IRQ_DOMAIN=y
# CONFIG_IRQ_DOMAIN_DEBUG is not set
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_ARCH_CLOCKSOURCE_DATA=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_GENERIC_CMOS_UPDATE=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
# CONFIG_NO_HZ is not set
CONFIG_HIGH_RES_TIMERS=y

#
# CPU/Task time and stats accounting
#
CONFIG_TICK_CPU_ACCOUNTING=y
# CONFIG_IRQ_TIME_ACCOUNTING is not set
# CONFIG_BSD_PROCESS_ACCT is not set

#
# RCU Subsystem
#
CONFIG_TINY_PREEMPT_RCU=y
CONFIG_PREEMPT_RCU=y
# CONFIG_TREE_RCU_TRACE is not set
CONFIG_RCU_BOOST=y
CONFIG_RCU_BOOST_PRIO=1
CONFIG_RCU_BOOST_DELAY=500
CONFIG_IKCONFIG=m
CONFIG_LOG_BUF_SHIFT=17
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
CONFIG_CHECKPOINT_RESTORE=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
# CONFIG_IPC_NS is not set
# CONFIG_PID_NS is not set
# CONFIG_SCHED_AUTOGROUP is not set
CONFIG_SYSFS_DEPRECATED=y
# CONFIG_SYSFS_DEPRECATED_V2 is not set
# CONFIG_RELAY is not set
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_ANON_INODES=y
CONFIG_EXPERT=y
CONFIG_HAVE_UID16=y
CONFIG_UID16=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_HOTPLUG=y
# CONFIG_PRINTK is not set
CONFIG_BUG=y
CONFIG_ELF_CORE=y
# CONFIG_PCSPKR_PLATFORM is not set
CONFIG_HAVE_PCSPKR_PLATFORM=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
# CONFIG_EPOLL is not set
# CONFIG_SIGNALFD is not set
# CONFIG_TIMERFD is not set
# CONFIG_EVENTFD is not set
# CONFIG_SHMEM is not set
# CONFIG_AIO is not set
# CONFIG_EMBEDDED is not set
CONFIG_HAVE_PERF_EVENTS=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLUB_DEBUG=y
CONFIG_COMPAT_BRK=y
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
CONFIG_PROFILING=y
# CONFIG_OPROFILE is not set
CONFIG_HAVE_OPROFILE=y
CONFIG_OPROFILE_NMI_TIMER=y
CONFIG_KPROBES=y
CONFIG_JUMP_LABEL=y
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_KRETPROBES=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_OPTPROBES=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
CONFIG_HAVE_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_PERF_EVENTS_NMI=y
CONFIG_HAVE_PERF_REGS=y
CONFIG_HAVE_PERF_USER_STACK_DUMP=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
CONFIG_HAVE_CMPXCHG_LOCAL=y
CONFIG_HAVE_CMPXCHG_DOUBLE=y
CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y
CONFIG_GENERIC_KERNEL_THREAD=y
CONFIG_GENERIC_KERNEL_EXECVE=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_HAVE_RCU_USER_QS=y
CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_MODULES_USE_ELF_RELA=y

#
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
CONFIG_MODULE_FORCE_LOAD=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_MODULE_FORCE_UNLOAD is not set
CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_MODULE_SIG=y
CONFIG_MODULE_SIG_FORCE=y
# CONFIG_MODULE_SIG_SHA1 is not set
# CONFIG_MODULE_SIG_SHA224 is not set
CONFIG_MODULE_SIG_SHA256=y
# CONFIG_MODULE_SIG_SHA384 is not set
# CONFIG_MODULE_SIG_SHA512 is not set
# CONFIG_BLOCK is not set
CONFIG_ASN1=y
CONFIG_UNINLINE_SPIN_UNLOCK=y
CONFIG_FREEZER=y

#
# Processor type and features
#
# CONFIG_ZONE_DMA is not set
# CONFIG_SMP is not set
CONFIG_X86_MPPARSE=y
# CONFIG_X86_EXTENDED_PLATFORM is not set
CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
CONFIG_SCHED_OMIT_FRAME_POINTER=y
# CONFIG_KVMTOOL_TEST_ENABLE is not set
CONFIG_PARAVIRT_GUEST=y
# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
CONFIG_XEN=y
# CONFIG_XEN_PRIVILEGED_GUEST is not set
CONFIG_XEN_MAX_DOMAIN_MEMORY=500
CONFIG_XEN_SAVE_RESTORE=y
# CONFIG_XEN_DEBUG_FS is not set
CONFIG_XEN_X86_PVH=y
# CONFIG_KVM_GUEST is not set
CONFIG_PARAVIRT=y
CONFIG_PARAVIRT_CLOCK=y
CONFIG_PARAVIRT_DEBUG=y
CONFIG_NO_BOOTMEM=y
# CONFIG_MEMTEST is not set
# CONFIG_MK8 is not set
# CONFIG_MPSC is not set
# CONFIG_MCORE2 is not set
# CONFIG_MATOM is not set
CONFIG_GENERIC_CPU=y
CONFIG_X86_INTERNODE_CACHE_SHIFT=6
CONFIG_X86_CMPXCHG=y
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_XADD=y
CONFIG_X86_WP_WORKS_OK=y
CONFIG_X86_TSC=y
CONFIG_X86_CMPXCHG64=y
CONFIG_X86_CMOV=y
CONFIG_X86_MINIMUM_CPU_FAMILY=64
CONFIG_X86_DEBUGCTLMSR=y
# CONFIG_PROCESSOR_SELECT is not set
CONFIG_CPU_SUP_INTEL=y
CONFIG_CPU_SUP_AMD=y
CONFIG_CPU_SUP_CENTAUR=y
CONFIG_HPET_TIMER=y
# CONFIG_DMI is not set
CONFIG_SWIOTLB=y
CONFIG_IOMMU_HELPER=y
CONFIG_NR_CPUS=1
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
CONFIG_PREEMPT_COUNT=y
CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
# CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS is not set
CONFIG_X86_MCE=y
CONFIG_X86_MCE_INTEL=y
# CONFIG_X86_MCE_AMD is not set
CONFIG_X86_MCE_THRESHOLD=y
CONFIG_X86_MCE_INJECT=m
CONFIG_X86_THERMAL_VECTOR=y
CONFIG_I8K=m
# CONFIG_MICROCODE is not set
CONFIG_X86_MSR=m
CONFIG_X86_CPUID=m
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_DIRECT_GBPAGES=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_SPARSEMEM_MANUAL=y
CONFIG_SPARSEMEM=y
CONFIG_HAVE_MEMORY_PRESENT=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=y
# CONFIG_SPARSEMEM_VMEMMAP is not set
CONFIG_HAVE_MEMBLOCK=y
CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
CONFIG_ARCH_DISCARD_MEMBLOCK=y
CONFIG_MEMORY_ISOLATION=y
# CONFIG_MEMORY_HOTPLUG is not set
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=999999
# CONFIG_COMPACTION is not set
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_ZONE_DMA_FLAG=0
CONFIG_VIRT_TO_BUS=y
CONFIG_MMU_NOTIFIER=y
CONFIG_KSM=y
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
CONFIG_MEMORY_FAILURE=y
# CONFIG_TRANSPARENT_HUGEPAGE is not set
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_NEED_PER_CPU_KM=y
CONFIG_CLEANCACHE=y
# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
CONFIG_X86_RESERVE_LOW=64
CONFIG_MTRR=y
CONFIG_MTRR_SANITIZER=y
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
# CONFIG_X86_PAT is not set
# CONFIG_ARCH_RANDOM is not set
CONFIG_X86_SMAP=y
# CONFIG_SECCOMP is not set
CONFIG_CC_STACKPROTECTOR=y
# CONFIG_HZ_100 is not set
# CONFIG_HZ_250 is not set
CONFIG_HZ_300=y
# CONFIG_HZ_1000 is not set
CONFIG_HZ=300
CONFIG_SCHED_HRTICK=y
# CONFIG_KEXEC is not set
# CONFIG_CRASH_DUMP is not set
CONFIG_PHYSICAL_START=0x1000000
# CONFIG_RELOCATABLE is not set
CONFIG_PHYSICAL_ALIGN=0x1000000
# CONFIG_COMPAT_VDSO is not set
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE=""
CONFIG_CMDLINE_OVERRIDE=y
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y

#
# Power management and ACPI options
#
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
CONFIG_HIBERNATE_CALLBACKS=y
CONFIG_PM_SLEEP=y
CONFIG_PM_AUTOSLEEP=y
CONFIG_PM_WAKELOCKS=y
CONFIG_PM_WAKELOCKS_LIMIT=100
# CONFIG_PM_WAKELOCKS_GC is not set
CONFIG_PM_RUNTIME=y
CONFIG_PM=y
# CONFIG_PM_DEBUG is not set
# CONFIG_SFI is not set

#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=m
CONFIG_CPU_FREQ_STAT=m
# CONFIG_CPU_FREQ_STAT_DETAILS is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
CONFIG_CPU_FREQ_GOV_USERSPACE=m
CONFIG_CPU_FREQ_GOV_ONDEMAND=m
# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set

#
# x86 CPU frequency scaling drivers
#
CONFIG_X86_P4_CLOCKMOD=m

#
# shared options
#
CONFIG_X86_SPEEDSTEP_LIB=m
# CONFIG_CPU_IDLE is not set
# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set

#
# Memory power savings
#
# CONFIG_I7300_IDLE is not set

#
# Bus options (PCI etc.)
#
# CONFIG_PCI is not set
# CONFIG_ISA_DMA_API is not set
CONFIG_PCCARD=m
CONFIG_PCMCIA=m
CONFIG_PCMCIA_LOAD_CIS=y

#
# PC-card bridges
#

#
# Executable file formats / Emulations
#
CONFIG_BINFMT_ELF=y
CONFIG_COMPAT_BINFMT_ELF=y
CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
# CONFIG_HAVE_AOUT is not set
CONFIG_BINFMT_MISC=m
CONFIG_COREDUMP=y
CONFIG_IA32_EMULATION=y
CONFIG_IA32_AOUT=m
# CONFIG_X86_X32 is not set
CONFIG_COMPAT=y
CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
CONFIG_SYSVIPC_COMPAT=y
CONFIG_KEYS_COMPAT=y
CONFIG_HAVE_TEXT_POKE_SMP=y
CONFIG_X86_DEV_DMA_OPS=y
# CONFIG_NET is not set
CONFIG_HAVE_BPF_JIT=y

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH=""
# CONFIG_DEVTMPFS is not set
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=m
# CONFIG_FIRMWARE_IN_KERNEL is not set
CONFIG_EXTRA_FIRMWARE=""
CONFIG_DEBUG_DRIVER=y
CONFIG_DEBUG_DEVRES=y
CONFIG_SYS_HYPERVISOR=y
# CONFIG_GENERIC_CPU_DEVICES is not set
CONFIG_REGMAP=y
CONFIG_REGMAP_SPI=y
CONFIG_REGMAP_IRQ=y
# CONFIG_DMA_SHARED_BUFFER is not set

#
# Bus devices
#
CONFIG_OMAP_OCP2SCP=m
# CONFIG_MTD is not set
CONFIG_PARPORT=m
# CONFIG_PARPORT_PC is not set
# CONFIG_PARPORT_GSC is not set
# CONFIG_PARPORT_AX88796 is not set
CONFIG_PARPORT_1284=y
CONFIG_PARPORT_NOT_PC=y

#
# Misc devices
#
# CONFIG_SENSORS_LIS3LV02D is not set
CONFIG_AD525X_DPOT=m
# CONFIG_AD525X_DPOT_SPI is not set
CONFIG_ENCLOSURE_SERVICES=m
# CONFIG_TI_DAC7512 is not set
# CONFIG_VMWARE_BALLOON is not set
CONFIG_BMP085=y
CONFIG_BMP085_SPI=m
# CONFIG_C2PORT is not set

#
# EEPROM support
#
CONFIG_EEPROM_AT25=m
# CONFIG_EEPROM_93CX6 is not set
# CONFIG_EEPROM_93XX46 is not set

#
# Texas Instruments shared transport line discipline
#
# CONFIG_SENSORS_LIS3_SPI is not set

#
# Altera FPGA firmware download module
#
CONFIG_HAVE_IDE=y

#
# SCSI device support
#
CONFIG_SCSI_MOD=y
# CONFIG_SCSI_DMA is not set
# CONFIG_SCSI_NETLINK is not set
CONFIG_MACINTOSH_DRIVERS=y

#
# Input device support
#
CONFIG_INPUT=m
# CONFIG_INPUT_FF_MEMLESS is not set
CONFIG_INPUT_POLLDEV=m
CONFIG_INPUT_SPARSEKMAP=m
CONFIG_INPUT_MATRIXKMAP=m

#
# Userland interfaces
#
# CONFIG_INPUT_MOUSEDEV is not set
CONFIG_INPUT_JOYDEV=m
CONFIG_INPUT_EVDEV=m
# CONFIG_INPUT_EVBUG is not set

#
# Input Device Drivers
#
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TABLET is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
CONFIG_INPUT_MISC=y
CONFIG_INPUT_AD714X=m
CONFIG_INPUT_AD714X_SPI=m
CONFIG_INPUT_MC13783_PWRBUTTON=m
# CONFIG_INPUT_GPIO_TILT_POLLED is not set
# CONFIG_INPUT_ATI_REMOTE2 is not set
CONFIG_INPUT_KEYSPAN_REMOTE=m
CONFIG_INPUT_POWERMATE=m
# CONFIG_INPUT_YEALINK is not set
# CONFIG_INPUT_CM109 is not set
CONFIG_INPUT_UINPUT=m
# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
CONFIG_INPUT_DA9052_ONKEY=m
# CONFIG_INPUT_PCAP is not set
CONFIG_INPUT_ADXL34X=m
# CONFIG_INPUT_ADXL34X_SPI is not set
# CONFIG_INPUT_CMA3000 is not set
# CONFIG_INPUT_XEN_KBDDEV_FRONTEND is not set

#
# Hardware I/O ports
#
CONFIG_SERIO=m
CONFIG_SERIO_I8042=m
CONFIG_SERIO_SERPORT=m
CONFIG_SERIO_CT82C710=m
CONFIG_SERIO_PARKBD=m
# CONFIG_SERIO_LIBPS2 is not set
# CONFIG_SERIO_RAW is not set
CONFIG_SERIO_ALTERA_PS2=m
# CONFIG_SERIO_PS2MULT is not set
CONFIG_SERIO_ARC_PS2=m
# CONFIG_GAMEPORT is not set

#
# Character devices
#
# CONFIG_VT is not set
CONFIG_UNIX98_PTYS=y
# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
# CONFIG_LEGACY_PTYS is not set
# CONFIG_SERIAL_NONSTANDARD is not set
# CONFIG_TRACE_SINK is not set
CONFIG_DEVKMEM=y

#
# Serial drivers
#
CONFIG_SERIAL_8250=m
CONFIG_FIX_EARLYCON_MEM=y
# CONFIG_SERIAL_8250_CS is not set
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
# CONFIG_SERIAL_8250_EXTENDED is not set

#
# Non-8250 serial port support
#
# CONFIG_SERIAL_MAX3100 is not set
CONFIG_SERIAL_MAX310X=y
CONFIG_SERIAL_CORE=y
# CONFIG_SERIAL_SCCNXP is not set
# CONFIG_SERIAL_TIMBERDALE is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_IFX6X60 is not set
# CONFIG_SERIAL_XILINX_PS_UART is not set
CONFIG_SERIAL_ARC=m
CONFIG_SERIAL_ARC_NR_PORTS=1
CONFIG_TTY_PRINTK=y
# CONFIG_PRINTER is not set
# CONFIG_PPDEV is not set
CONFIG_HVC_DRIVER=y
# CONFIG_HVC_XEN is not set
CONFIG_VIRTIO_CONSOLE=m
CONFIG_IPMI_HANDLER=m
CONFIG_IPMI_PANIC_EVENT=y
CONFIG_IPMI_PANIC_STRING=y
# CONFIG_IPMI_DEVICE_INTERFACE is not set
CONFIG_IPMI_SI=m
# CONFIG_IPMI_WATCHDOG is not set
CONFIG_IPMI_POWEROFF=m
CONFIG_HW_RANDOM=m
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
# CONFIG_HW_RANDOM_VIA is not set
# CONFIG_HW_RANDOM_VIRTIO is not set
# CONFIG_NVRAM is not set
# CONFIG_R3964 is not set

#
# PCMCIA character devices
#
CONFIG_SYNCLINK_CS=m
CONFIG_CARDMAN_4000=m
# CONFIG_CARDMAN_4040 is not set
# CONFIG_MWAVE is not set
# CONFIG_HANGCHECK_TIMER is not set
# CONFIG_TCG_TPM is not set
CONFIG_TELCLOCK=m
# CONFIG_I2C is not set
CONFIG_SPI=y
CONFIG_SPI_DEBUG=y
CONFIG_SPI_MASTER=y

#
# SPI Master Controller Drivers
#
# CONFIG_SPI_ALTERA is not set
CONFIG_SPI_BITBANG=m
CONFIG_SPI_BUTTERFLY=m
# CONFIG_SPI_GPIO is not set
CONFIG_SPI_LM70_LLP=m
CONFIG_SPI_OC_TINY=m
# CONFIG_SPI_PXA2XX_PCI is not set
# CONFIG_SPI_XILINX is not set
CONFIG_SPI_DESIGNWARE=m

#
# SPI Protocol Masters
#
# CONFIG_SPI_SPIDEV is not set
# CONFIG_SPI_TLE62X0 is not set
CONFIG_HSI=m
CONFIG_HSI_BOARDINFO=y

#
# HSI clients
#
CONFIG_HSI_CHAR=m

#
# PPS support
#
# CONFIG_PPS is not set

#
# PPS generators support
#

#
# PTP clock support
#

#
# Enable Device Drivers -> PPS to see the PTP clock options.
#
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
CONFIG_GPIOLIB=y
CONFIG_DEBUG_GPIO=y
CONFIG_GPIO_SYSFS=y
# CONFIG_GPIO_DA9052 is not set

#
# Memory mapped GPIO drivers:
#
# CONFIG_GPIO_GENERIC_PLATFORM is not set
CONFIG_GPIO_IT8761E=m

#
# I2C GPIO expanders:
#
# CONFIG_GPIO_ARIZONA is not set

#
# PCI GPIO expanders:
#

#
# SPI GPIO expanders:
#
# CONFIG_GPIO_MAX7301 is not set
CONFIG_GPIO_MCP23S08=m
# CONFIG_GPIO_MC33880 is not set
CONFIG_GPIO_74X164=m

#
# AC97 GPIO expanders:
#

#
# MODULbus GPIO expanders:
#
# CONFIG_W1 is not set
# CONFIG_POWER_SUPPLY is not set
CONFIG_POWER_AVS=y
CONFIG_HWMON=m
CONFIG_HWMON_VID=m
CONFIG_HWMON_DEBUG_CHIP=y

#
# Native drivers
#
# CONFIG_SENSORS_AD7314 is not set
# CONFIG_SENSORS_ADCXX is not set
CONFIG_SENSORS_DA9052_ADC=m
CONFIG_SENSORS_F71805F=m
CONFIG_SENSORS_F71882FG=m
# CONFIG_SENSORS_GPIO_FAN is not set
CONFIG_SENSORS_CORETEMP=m
# CONFIG_SENSORS_IBMAEM is not set
CONFIG_SENSORS_IBMPEX=m
# CONFIG_SENSORS_IT87 is not set
CONFIG_SENSORS_LM70=m
CONFIG_SENSORS_MAX1111=m
# CONFIG_SENSORS_MAX197 is not set
# CONFIG_SENSORS_NTC_THERMISTOR is not set
CONFIG_SENSORS_PC87360=m
CONFIG_SENSORS_PC87427=m
# CONFIG_SENSORS_SHT15 is not set
CONFIG_SENSORS_SMSC47M1=m
# CONFIG_SENSORS_SMSC47B397 is not set
# CONFIG_SENSORS_SCH56XX_COMMON is not set
CONFIG_SENSORS_ADS7871=m
# CONFIG_SENSORS_VIA_CPUTEMP is not set
CONFIG_SENSORS_VT1211=m
CONFIG_SENSORS_W83627HF=m
CONFIG_SENSORS_W83627EHF=m
CONFIG_SENSORS_APPLESMC=m
# CONFIG_SENSORS_MC13783_ADC is not set
CONFIG_THERMAL=m
CONFIG_THERMAL_HWMON=y
CONFIG_CPU_THERMAL=y
CONFIG_FAIR_SHARE=y
CONFIG_STEP_WISE=y
CONFIG_USER_SPACE=y
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set
# CONFIG_WATCHDOG is not set
CONFIG_SSB_POSSIBLE=y

#
# Sonics Silicon Backplane
#
CONFIG_SSB=m
CONFIG_SSB_PCMCIAHOST_POSSIBLE=y
# CONFIG_SSB_PCMCIAHOST is not set
CONFIG_SSB_SDIOHOST_POSSIBLE=y
# CONFIG_SSB_SDIOHOST is not set
CONFIG_SSB_SILENT=y
CONFIG_BCMA_POSSIBLE=y

#
# Broadcom specific AMBA
#
CONFIG_BCMA=m
# CONFIG_BCMA_DRIVER_GMAC_CMN is not set
# CONFIG_BCMA_DEBUG is not set

#
# Multifunction device drivers
#
CONFIG_MFD_CORE=y
# CONFIG_MFD_SM501 is not set
# CONFIG_HTC_PASIC3 is not set
# CONFIG_MFD_TPS65912_SPI is not set
# CONFIG_MFD_STMPE is not set
# CONFIG_MFD_TMIO is not set
CONFIG_PMIC_DA9052=y
CONFIG_MFD_DA9052_SPI=y
CONFIG_MFD_ARIZONA=y
CONFIG_MFD_ARIZONA_SPI=m
CONFIG_MFD_WM5102=y
CONFIG_MFD_WM5110=y
# CONFIG_MFD_WM831X_SPI is not set
CONFIG_MFD_MC13783=m
CONFIG_MFD_MC13XXX=m
CONFIG_MFD_MC13XXX_SPI=m
# CONFIG_ABX500_CORE is not set
CONFIG_EZX_PCAP=y
# CONFIG_REGULATOR is not set
CONFIG_MEDIA_SUPPORT=m

#
# Multimedia core support
#
# CONFIG_MEDIA_CAMERA_SUPPORT is not set
# CONFIG_MEDIA_ANALOG_TV_SUPPORT is not set
# CONFIG_MEDIA_DIGITAL_TV_SUPPORT is not set
CONFIG_MEDIA_RADIO_SUPPORT=y
# CONFIG_MEDIA_RC_SUPPORT is not set
CONFIG_VIDEO_DEV=m
CONFIG_VIDEO_V4L2=m
# CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set

#
# Media drivers
#
CONFIG_MEDIA_USB_SUPPORT=y

#
# Supported MMC/SDIO adapters
#
CONFIG_RADIO_ADAPTERS=y
# CONFIG_RADIO_SI470X is not set
# CONFIG_USB_MR800 is not set
CONFIG_USB_DSBR=m
# CONFIG_RADIO_SHARK2 is not set
CONFIG_USB_KEENE=m

#
# Texas Instruments WL128x FM driver (ST based)
#

#
# Media ancillary drivers (tuners, sensors, i2c, frontends)
#

#
# Encoders, decoders, sensors and other helper chips
#

#
# Audio decoders, processors and mixers
#

#
# RDS decoders
#

#
# Video decoders
#

#
# Video and audio decoders
#

#
# MPEG video encoders
#
# CONFIG_VIDEO_CX2341X is not set

#
# Video encoders
#

#
# Camera sensor devices
#

#
# Flash devices
#

#
# Video improvement chips
#

#
# Miscelaneous helper chips
#

#
# Sensors used on soc_camera driver
#
CONFIG_MEDIA_ATTACH=y

#
# Customize TV tuners
#

#
# Customise DVB Frontends
#

#
# Tools to develop new frontends
#
CONFIG_DVB_DUMMY_FE=m

#
# Graphics support
#
# CONFIG_DRM is not set
# CONFIG_VGASTATE is not set
# CONFIG_VIDEO_OUTPUT_CONTROL is not set
CONFIG_FB=m
# CONFIG_FIRMWARE_EDID is not set
# CONFIG_FB_DDC is not set
# CONFIG_FB_BOOT_VESA_SUPPORT is not set
CONFIG_FB_CFB_FILLRECT=m
CONFIG_FB_CFB_COPYAREA=m
CONFIG_FB_CFB_IMAGEBLIT=m
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
CONFIG_FB_SYS_FILLRECT=m
CONFIG_FB_SYS_COPYAREA=m
CONFIG_FB_SYS_IMAGEBLIT=m
# CONFIG_FB_FOREIGN_ENDIAN is not set
CONFIG_FB_SYS_FOPS=m
# CONFIG_FB_WMT_GE_ROPS is not set
CONFIG_FB_DEFERRED_IO=y
CONFIG_FB_HECUBA=m
# CONFIG_FB_SVGALIB is not set
# CONFIG_FB_MACMODES is not set
# CONFIG_FB_BACKLIGHT is not set
CONFIG_FB_MODE_HELPERS=y
# CONFIG_FB_TILEBLITTING is not set

#
# Frame buffer hardware drivers
#
CONFIG_FB_ARC=m
# CONFIG_FB_VGA16 is not set
CONFIG_FB_N411=m
CONFIG_FB_HGA=m
CONFIG_FB_S1D13XXX=m
CONFIG_FB_TMIO=m
CONFIG_FB_TMIO_ACCELL=y
CONFIG_FB_SMSCUFX=m
# CONFIG_FB_UDL is not set
# CONFIG_FB_VIRTUAL is not set
# CONFIG_XEN_FBDEV_FRONTEND is not set
CONFIG_FB_METRONOME=m
# CONFIG_FB_BROADSHEET is not set
CONFIG_FB_AUO_K190X=m
CONFIG_FB_AUO_K1900=m
CONFIG_FB_AUO_K1901=m
CONFIG_EXYNOS_VIDEO=y
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
CONFIG_LOGO=y
CONFIG_LOGO_LINUX_MONO=y
CONFIG_LOGO_LINUX_VGA16=y
# CONFIG_LOGO_LINUX_CLUT224 is not set
# CONFIG_SOUND is not set

#
# HID support
#
CONFIG_HID=m
# CONFIG_HIDRAW is not set
# CONFIG_UHID is not set
# CONFIG_HID_GENERIC is not set

#
# Special HID drivers
#

#
# USB HID support
#
# CONFIG_USB_HID is not set
CONFIG_HID_PID=y

#
# USB HID Boot Protocol drivers
#
# CONFIG_USB_KBD is not set
CONFIG_USB_MOUSE=m
# CONFIG_USB_ARCH_HAS_OHCI is not set
# CONFIG_USB_ARCH_HAS_EHCI is not set
# CONFIG_USB_ARCH_HAS_XHCI is not set
CONFIG_USB_SUPPORT=y
CONFIG_USB_COMMON=m
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB=m
# CONFIG_USB_DEBUG is not set
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y

#
# Miscellaneous USB options
#
# CONFIG_USB_DYNAMIC_MINORS is not set
# CONFIG_USB_SUSPEND is not set
CONFIG_USB_OTG_WHITELIST=y
CONFIG_USB_OTG_BLACKLIST_HUB=y
CONFIG_USB_DWC3=m
CONFIG_USB_DWC3_DEBUG=y
# CONFIG_USB_DWC3_VERBOSE is not set
# CONFIG_USB_MON is not set
# CONFIG_USB_WUSB_CBAF is not set

#
# USB Host Controller Drivers
#
CONFIG_USB_C67X00_HCD=m
CONFIG_USB_OXU210HP_HCD=m
# CONFIG_USB_ISP116X_HCD is not set
CONFIG_USB_ISP1760_HCD=m
CONFIG_USB_ISP1362_HCD=m
CONFIG_USB_U132_HCD=m
# CONFIG_USB_SL811_HCD is not set
CONFIG_USB_R8A66597_HCD=m
# CONFIG_USB_RENESAS_USBHS_HCD is not set
CONFIG_USB_HCD_BCMA=m
CONFIG_USB_HCD_SSB=m
CONFIG_USB_MUSB_HDRC=m
# CONFIG_USB_MUSB_TUSB6010 is not set
CONFIG_MUSB_PIO_ONLY=y
CONFIG_USB_CHIPIDEA=m
CONFIG_USB_CHIPIDEA_UDC=y
# CONFIG_USB_CHIPIDEA_HOST is not set
CONFIG_USB_CHIPIDEA_DEBUG=y
CONFIG_USB_RENESAS_USBHS=m

#
# USB Device Class drivers
#
# CONFIG_USB_ACM is not set
CONFIG_USB_PRINTER=m
# CONFIG_USB_WDM is not set
# CONFIG_USB_TMC is not set

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
#

#
# also be needed; see USB_STORAGE Help for more info
#

#
# USB Imaging devices
#
CONFIG_USB_MDC800=m

#
# USB port drivers
#
CONFIG_USB_USS720=m
# CONFIG_USB_SERIAL is not set

#
# USB Miscellaneous drivers
#
CONFIG_USB_EMI62=m
CONFIG_USB_EMI26=m
# CONFIG_USB_ADUTUX is not set
# CONFIG_USB_SEVSEG is not set
CONFIG_USB_RIO500=m
# CONFIG_USB_LEGOTOWER is not set
CONFIG_USB_LCD=m
# CONFIG_USB_LED is not set
CONFIG_USB_CYPRESS_CY7C63=m
# CONFIG_USB_CYTHERM is not set
# CONFIG_USB_IDMOUSE is not set
CONFIG_USB_FTDI_ELAN=m
# CONFIG_USB_APPLEDISPLAY is not set
CONFIG_USB_SISUSBVGA=m
CONFIG_USB_LD=m
# CONFIG_USB_TRANCEVIBRATOR is not set
CONFIG_USB_IOWARRIOR=m
# CONFIG_USB_TEST is not set
CONFIG_USB_ISIGHTFW=m
# CONFIG_USB_YUREX is not set
CONFIG_USB_EZUSB_FX2=m

#
# USB Physical Layer drivers
#
# CONFIG_OMAP_USB2 is not set
CONFIG_USB_GADGET=m
CONFIG_USB_GADGET_DEBUG=y
# CONFIG_USB_GADGET_DEBUG_FS is not set
CONFIG_USB_GADGET_VBUS_DRAW=2
CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2

#
# USB Peripheral Controller
#
# CONFIG_USB_R8A66597 is not set
CONFIG_USB_RENESAS_USBHS_UDC=m
# CONFIG_USB_MV_UDC is not set
CONFIG_USB_GADGET_MUSB_HDRC=m
CONFIG_USB_M66592=m
# CONFIG_USB_NET2272 is not set
CONFIG_USB_DUMMY_HCD=m
CONFIG_USB_LIBCOMPOSITE=m
# CONFIG_USB_ZERO is not set
# CONFIG_USB_GADGETFS is not set
CONFIG_USB_FUNCTIONFS=m
CONFIG_USB_FUNCTIONFS_GENERIC=y
CONFIG_USB_G_SERIAL=m
# CONFIG_USB_G_PRINTER is not set
CONFIG_USB_G_HID=m
CONFIG_USB_G_DBGP=m
CONFIG_USB_G_DBGP_PRINTK=y
# CONFIG_USB_G_DBGP_SERIAL is not set
CONFIG_USB_G_WEBCAM=m

#
# OTG and related infrastructure
#
CONFIG_USB_OTG_UTILS=y
CONFIG_USB_GPIO_VBUS=m
CONFIG_NOP_USB_XCEIV=m
CONFIG_MMC=m
CONFIG_MMC_DEBUG=y
# CONFIG_MMC_UNSAFE_RESUME is not set
CONFIG_MMC_CLKGATE=y

#
# MMC/SD/SDIO Card Drivers
#
CONFIG_SDIO_UART=m
CONFIG_MMC_TEST=m

#
# MMC/SD/SDIO Host Controller Drivers
#
# CONFIG_MMC_SDHCI is not set
CONFIG_MMC_SPI=m
# CONFIG_MMC_VUB300 is not set
CONFIG_MMC_USHC=m
CONFIG_MEMSTICK=m
CONFIG_MEMSTICK_DEBUG=y

#
# MemoryStick drivers
#
# CONFIG_MEMSTICK_UNSAFE_RESUME is not set

#
# MemoryStick Host Controller Drivers
#
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=m

#
# LED drivers
#
CONFIG_LEDS_GPIO=m
# CONFIG_LEDS_DA9052 is not set
# CONFIG_LEDS_DAC124S085 is not set
# CONFIG_LEDS_LT3593 is not set
CONFIG_LEDS_MC13783=m
CONFIG_LEDS_OT200=m
CONFIG_LEDS_TRIGGERS=y

#
# LED Triggers
#
CONFIG_LEDS_TRIGGER_TIMER=m
CONFIG_LEDS_TRIGGER_ONESHOT=m
CONFIG_LEDS_TRIGGER_HEARTBEAT=m
# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
# CONFIG_LEDS_TRIGGER_CPU is not set
# CONFIG_LEDS_TRIGGER_GPIO is not set
CONFIG_LEDS_TRIGGER_DEFAULT_ON=m

#
# iptables trigger is under Netfilter config (LED target)
#
# CONFIG_LEDS_TRIGGER_TRANSIENT is not set
CONFIG_ACCESSIBILITY=y
CONFIG_EDAC=y

#
# Reporting subsystems
#
# CONFIG_EDAC_LEGACY_SYSFS is not set
CONFIG_EDAC_DEBUG=y
CONFIG_EDAC_MM_EDAC=m
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set

#
# RTC interfaces
#
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_DEV=y
CONFIG_RTC_INTF_DEV_UIE_EMUL=y
CONFIG_RTC_DRV_TEST=m

#
# SPI RTC drivers
#
CONFIG_RTC_DRV_M41T93=m
# CONFIG_RTC_DRV_M41T94 is not set
# CONFIG_RTC_DRV_DS1305 is not set
CONFIG_RTC_DRV_DS1390=m
CONFIG_RTC_DRV_MAX6902=m
# CONFIG_RTC_DRV_R9701 is not set
CONFIG_RTC_DRV_RS5C348=m
# CONFIG_RTC_DRV_DS3234 is not set
CONFIG_RTC_DRV_PCF2123=m

#
# Platform RTC drivers
#
# CONFIG_RTC_DRV_CMOS is not set
CONFIG_RTC_DRV_DS1286=m
# CONFIG_RTC_DRV_DS1511 is not set
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_DA9052 is not set
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_M48T86 is not set
CONFIG_RTC_DRV_M48T35=m
CONFIG_RTC_DRV_M48T59=m
# CONFIG_RTC_DRV_MSM6242 is not set
CONFIG_RTC_DRV_BQ4802=m
CONFIG_RTC_DRV_RP5C01=m
CONFIG_RTC_DRV_V3020=m
# CONFIG_RTC_DRV_DS2404 is not set

#
# on-CPU RTC drivers
#
CONFIG_RTC_DRV_PCAP=m
CONFIG_RTC_DRV_MC13XXX=m
# CONFIG_DMADEVICES is not set
# CONFIG_AUXDISPLAY is not set
# CONFIG_UIO is not set
CONFIG_VIRTIO=m

#
# Virtio drivers
#
CONFIG_VIRTIO_BALLOON=m
# CONFIG_VIRTIO_MMIO is not set

#
# Microsoft Hyper-V guest support
#

#
# Xen driver support
#
# CONFIG_XEN_BALLOON is not set
# CONFIG_XEN_DEV_EVTCHN is not set
# CONFIG_XENFS is not set
CONFIG_XEN_SYS_HYPERVISOR=y
CONFIG_XEN_GNTDEV=m
CONFIG_XEN_GRANT_DEV_ALLOC=m
CONFIG_XEN_TMEM=y
CONFIG_XEN_PRIVCMD=m
CONFIG_XEN_HAVE_PVMMU=y
CONFIG_STAGING=y
CONFIG_ECHO=m
CONFIG_COMEDI=m
# CONFIG_COMEDI_DEBUG is not set
CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB=2048
CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB=20480
# CONFIG_COMEDI_MISC_DRIVERS is not set
CONFIG_COMEDI_PCMCIA_DRIVERS=y
CONFIG_COMEDI_CB_DAS16_CS=m
CONFIG_COMEDI_DAS08_CS=m
# CONFIG_COMEDI_NI_DAQ_700_CS is not set
CONFIG_COMEDI_NI_DAQ_DIO24_CS=m
# CONFIG_COMEDI_NI_MIO_CS is not set
CONFIG_COMEDI_QUATECH_DAQP_CS=m
CONFIG_COMEDI_USB_DRIVERS=y
# CONFIG_COMEDI_DT9812 is not set
CONFIG_COMEDI_USBDUX=m
# CONFIG_COMEDI_USBDUXFAST is not set
CONFIG_COMEDI_USBDUXSIGMA=m
CONFIG_COMEDI_VMK80XX=m
CONFIG_COMEDI_8255=m
CONFIG_COMEDI_FC=m
CONFIG_COMEDI_DAS08=m
# CONFIG_ASUS_OLED is not set
CONFIG_PANEL=m
CONFIG_PANEL_PARPORT=0
CONFIG_PANEL_PROFILE=5
# CONFIG_PANEL_CHANGE_MESSAGE is not set
CONFIG_TRANZPORT=m
# CONFIG_ZSMALLOC is not set
# CONFIG_FT1000 is not set

#
# Speakup console speech
#
CONFIG_STAGING_MEDIA=y

#
# Android
#
CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=y
# CONFIG_ANDROID_LOGGER is not set
# CONFIG_ANDROID_TIMED_OUTPUT is not set
# CONFIG_ANDROID_LOW_MEMORY_KILLER is not set
CONFIG_ANDROID_INTF_ALARM_DEV=y
# CONFIG_IPACK_BUS is not set
# CONFIG_CED1401 is not set
# CONFIG_DGRP is not set
# CONFIG_X86_PLATFORM_DEVICES is not set

#
# Hardware Spinlock drivers
#
CONFIG_CLKEVT_I8253=y
CONFIG_CLKBLD_I8253=y
CONFIG_IOMMU_SUPPORT=y

#
# Remoteproc drivers (EXPERIMENTAL)
#
CONFIG_REMOTEPROC=m
CONFIG_STE_MODEM_RPROC=m

#
# Rpmsg drivers
#
# CONFIG_VIRT_DRIVERS is not set
CONFIG_PM_DEVFREQ=y

#
# DEVFREQ Governors
#
CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y
# CONFIG_DEVFREQ_GOV_PERFORMANCE is not set
# CONFIG_DEVFREQ_GOV_POWERSAVE is not set
# CONFIG_DEVFREQ_GOV_USERSPACE is not set

#
# DEVFREQ Drivers
#
CONFIG_EXTCON=m

#
# Extcon Device Drivers
#
CONFIG_EXTCON_GPIO=m
# CONFIG_EXTCON_ARIZONA is not set
# CONFIG_MEMORY is not set
# CONFIG_IIO is not set
CONFIG_PWM=y

#
# Firmware Drivers
#
CONFIG_EDD=m
CONFIG_EDD_OFF=y
# CONFIG_FIRMWARE_MEMMAP is not set
CONFIG_DELL_RBU=m
CONFIG_DCDBAS=m
CONFIG_ISCSI_IBFT_FIND=y
CONFIG_GOOGLE_FIRMWARE=y

#
# Google Firmware Drivers
#

#
# File systems
#
CONFIG_DCACHE_WORD_ACCESS=y
# CONFIG_FS_POSIX_ACL is not set
CONFIG_EXPORTFS=y
# CONFIG_FILE_LOCKING is not set
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY_USER=y
# CONFIG_FANOTIFY is not set
CONFIG_QUOTA=y
# CONFIG_PRINT_QUOTA_WARNING is not set
# CONFIG_QUOTA_DEBUG is not set
# CONFIG_QFMT_V1 is not set
# CONFIG_QFMT_V2 is not set
CONFIG_QUOTACTL=y
CONFIG_QUOTACTL_COMPAT=y
# CONFIG_AUTOFS4_FS is not set
CONFIG_FUSE_FS=m
# CONFIG_CUSE is not set

#
# Caches
#
# CONFIG_FSCACHE is not set

#
# Pseudo filesystems
#
# CONFIG_PROC_FS is not set
CONFIG_SYSFS=y
# CONFIG_HUGETLBFS is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_CONFIGFS_FS=m
# CONFIG_MISC_FILESYSTEMS is not set
CONFIG_NLS=m
CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set
CONFIG_NLS_CODEPAGE_737=m
# CONFIG_NLS_CODEPAGE_775 is not set
# CONFIG_NLS_CODEPAGE_850 is not set
CONFIG_NLS_CODEPAGE_852=m
CONFIG_NLS_CODEPAGE_855=m
CONFIG_NLS_CODEPAGE_857=m
CONFIG_NLS_CODEPAGE_860=m
# CONFIG_NLS_CODEPAGE_861 is not set
CONFIG_NLS_CODEPAGE_862=m
CONFIG_NLS_CODEPAGE_863=m
# CONFIG_NLS_CODEPAGE_864 is not set
CONFIG_NLS_CODEPAGE_865=m
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
CONFIG_NLS_CODEPAGE_936=m
# CONFIG_NLS_CODEPAGE_950 is not set
# CONFIG_NLS_CODEPAGE_932 is not set
CONFIG_NLS_CODEPAGE_949=m
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
CONFIG_NLS_CODEPAGE_1251=m
CONFIG_NLS_ASCII=m
CONFIG_NLS_ISO8859_1=m
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
CONFIG_NLS_ISO8859_4=m
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
CONFIG_NLS_ISO8859_9=m
CONFIG_NLS_ISO8859_13=m
CONFIG_NLS_ISO8859_14=m
CONFIG_NLS_ISO8859_15=m
CONFIG_NLS_KOI8_R=m
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_MAC_ROMAN is not set
CONFIG_NLS_MAC_CELTIC=m
CONFIG_NLS_MAC_CENTEURO=m
# CONFIG_NLS_MAC_CROATIAN is not set
# CONFIG_NLS_MAC_CYRILLIC is not set
# CONFIG_NLS_MAC_GAELIC is not set
CONFIG_NLS_MAC_GREEK=m
CONFIG_NLS_MAC_ICELAND=m
# CONFIG_NLS_MAC_INUIT is not set
# CONFIG_NLS_MAC_ROMANIAN is not set
# CONFIG_NLS_MAC_TURKISH is not set
# CONFIG_NLS_UTF8 is not set

#
# Kernel hacking
#
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
CONFIG_ENABLE_WARN_DEPRECATED=y
CONFIG_ENABLE_MUST_CHECK=y
CONFIG_FRAME_WARN=2048
CONFIG_MAGIC_SYSRQ=y
# CONFIG_STRIP_ASM_SYMS is not set
CONFIG_READABLE_ASM=y
CONFIG_UNUSED_SYMBOLS=y
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
# CONFIG_DEBUG_SECTION_MISMATCH is not set
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_SHIRQ is not set
CONFIG_LOCKUP_DETECTOR=y
CONFIG_HARDLOCKUP_DETECTOR=y
CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y
CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=1
# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
# CONFIG_PANIC_ON_OOPS is not set
CONFIG_PANIC_ON_OOPS_VALUE=0
# CONFIG_DETECT_HUNG_TASK is not set
CONFIG_DEBUG_OBJECTS=y
# CONFIG_DEBUG_OBJECTS_SELFTEST is not set
CONFIG_DEBUG_OBJECTS_FREE=y
# CONFIG_DEBUG_OBJECTS_TIMERS is not set
# CONFIG_DEBUG_OBJECTS_WORK is not set
# CONFIG_DEBUG_OBJECTS_RCU_HEAD is not set
# CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER is not set
CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
# CONFIG_SLUB_STATS is not set
CONFIG_HAVE_DEBUG_KMEMLEAK=y
# CONFIG_DEBUG_KMEMLEAK is not set
# CONFIG_DEBUG_PREEMPT is not set
CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_PI_LIST=y
CONFIG_RT_MUTEX_TESTER=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_LOCK_ALLOC=y
CONFIG_PROVE_LOCKING=y
CONFIG_PROVE_RCU=y
# CONFIG_PROVE_RCU_REPEATEDLY is not set
CONFIG_PROVE_RCU_DELAY=y
CONFIG_SPARSE_RCU_POINTER=y
CONFIG_LOCKDEP=y
CONFIG_LOCK_STAT=y
CONFIG_DEBUG_LOCKDEP=y
CONFIG_TRACE_IRQFLAGS=y
CONFIG_DEBUG_ATOMIC_SLEEP=y
CONFIG_DEBUG_LOCKING_API_SELFTESTS=y
CONFIG_STACKTRACE=y
# CONFIG_DEBUG_STACK_USAGE is not set
CONFIG_DEBUG_KOBJECT=y
# CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_DEBUG_INFO is not set
# CONFIG_DEBUG_VM is not set
CONFIG_DEBUG_VIRTUAL=y
CONFIG_DEBUG_WRITECOUNT=y
# CONFIG_DEBUG_MEMORY_INIT is not set
CONFIG_DEBUG_LIST=y
CONFIG_TEST_LIST_SORT=y
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
CONFIG_DEBUG_CREDENTIALS=y
CONFIG_ARCH_WANT_FRAME_POINTERS=y
CONFIG_FRAME_POINTER=y
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_RCU_TRACE is not set
CONFIG_KPROBES_SANITY_TEST=y
CONFIG_BACKTRACE_SELF_TEST=m
CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
CONFIG_NOTIFIER_ERROR_INJECTION=m
# CONFIG_PM_NOTIFIER_ERROR_INJECT is not set
# CONFIG_FAULT_INJECTION is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_FENTRY=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_TRACING_SUPPORT=y
# CONFIG_FTRACE is not set
# CONFIG_RBTREE_TEST is not set
# CONFIG_INTERVAL_TREE_TEST is not set
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
CONFIG_HAVE_ARCH_KMEMCHECK=y
CONFIG_KMEMCHECK=y
# CONFIG_KMEMCHECK_DISABLED_BY_DEFAULT is not set
# CONFIG_KMEMCHECK_ENABLED_BY_DEFAULT is not set
CONFIG_KMEMCHECK_ONESHOT_BY_DEFAULT=y
CONFIG_KMEMCHECK_QUEUE_SIZE=64
CONFIG_KMEMCHECK_SHADOW_COPY_SHIFT=5
CONFIG_KMEMCHECK_PARTIAL_OK=y
CONFIG_KMEMCHECK_BITOPS_OK=y
# CONFIG_TEST_KSTRTOX is not set
# CONFIG_STRICT_DEVMEM is not set
CONFIG_X86_VERBOSE_BOOTUP=y
CONFIG_EARLY_PRINTK=y
CONFIG_DEBUG_STACKOVERFLOW=y
CONFIG_X86_PTDUMP=y
CONFIG_DEBUG_RODATA=y
# CONFIG_DEBUG_RODATA_TEST is not set
CONFIG_DEBUG_SET_MODULE_RONX=y
# CONFIG_DEBUG_NX_TEST is not set
# CONFIG_DEBUG_TLBFLUSH is not set
CONFIG_IOMMU_STRESS=y
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
# CONFIG_X86_DECODER_SELFTEST is not set
CONFIG_IO_DELAY_TYPE_0X80=0
CONFIG_IO_DELAY_TYPE_0XED=1
CONFIG_IO_DELAY_TYPE_UDELAY=2
CONFIG_IO_DELAY_TYPE_NONE=3
# CONFIG_IO_DELAY_0X80 is not set
# CONFIG_IO_DELAY_0XED is not set
# CONFIG_IO_DELAY_UDELAY is not set
CONFIG_IO_DELAY_NONE=y
CONFIG_DEFAULT_IO_DELAY_TYPE=3
# CONFIG_DEBUG_BOOT_PARAMS is not set
CONFIG_CPA_DEBUG=y
# CONFIG_OPTIMIZE_INLINING is not set
# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
# CONFIG_DEBUG_NMI_SELFTEST is not set

#
# Security options
#
CONFIG_KEYS=y
# CONFIG_ENCRYPTED_KEYS is not set
CONFIG_KEYS_DEBUG_PROC_KEYS=y
CONFIG_SECURITY_DMESG_RESTRICT=y
CONFIG_SECURITY=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_PATH=y
CONFIG_SECURITY_YAMA=y
# CONFIG_SECURITY_YAMA_STACKED is not set
# CONFIG_IMA is not set
# CONFIG_EVM is not set
CONFIG_DEFAULT_SECURITY_YAMA=y
# CONFIG_DEFAULT_SECURITY_DAC is not set
CONFIG_DEFAULT_SECURITY="yama"
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
# CONFIG_CRYPTO_FIPS is not set
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=m
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER=m
CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=m
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_PCOMP=m
CONFIG_CRYPTO_PCOMP2=y
CONFIG_CRYPTO_MANAGER=m
CONFIG_CRYPTO_MANAGER2=y
# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
CONFIG_CRYPTO_GF128MUL=m
CONFIG_CRYPTO_NULL=m
CONFIG_CRYPTO_WORKQUEUE=y
CONFIG_CRYPTO_CRYPTD=m
CONFIG_CRYPTO_AUTHENC=m
CONFIG_CRYPTO_TEST=m
CONFIG_CRYPTO_ABLK_HELPER_X86=m
CONFIG_CRYPTO_GLUE_HELPER_X86=m

#
# Authenticated Encryption with Associated Data
#
# CONFIG_CRYPTO_CCM is not set
# CONFIG_CRYPTO_GCM is not set
CONFIG_CRYPTO_SEQIV=m

#
# Block modes
#
CONFIG_CRYPTO_CBC=m
CONFIG_CRYPTO_CTR=m
CONFIG_CRYPTO_CTS=m
CONFIG_CRYPTO_ECB=m
CONFIG_CRYPTO_LRW=m
CONFIG_CRYPTO_PCBC=m
CONFIG_CRYPTO_XTS=m

#
# Hash modes
#
# CONFIG_CRYPTO_HMAC is not set
# CONFIG_CRYPTO_XCBC is not set
# CONFIG_CRYPTO_VMAC is not set

#
# Digest
#
# CONFIG_CRYPTO_CRC32C is not set
CONFIG_CRYPTO_CRC32C_X86_64=y
CONFIG_CRYPTO_CRC32C_INTEL=m
# CONFIG_CRYPTO_GHASH is not set
# CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set
# CONFIG_CRYPTO_MICHAEL_MIC is not set
# CONFIG_CRYPTO_RMD128 is not set
# CONFIG_CRYPTO_RMD160 is not set
CONFIG_CRYPTO_RMD256=m
CONFIG_CRYPTO_RMD320=m
# CONFIG_CRYPTO_SHA1 is not set
# CONFIG_CRYPTO_SHA1_SSSE3 is not set
CONFIG_CRYPTO_SHA256=y
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_TGR192 is not set
CONFIG_CRYPTO_WP512=m
CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=m

#
# Ciphers
#
CONFIG_CRYPTO_AES=m
CONFIG_CRYPTO_AES_X86_64=m
# CONFIG_CRYPTO_AES_NI_INTEL is not set
CONFIG_CRYPTO_ANUBIS=m
CONFIG_CRYPTO_ARC4=m
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_BLOWFISH_X86_64 is not set
# CONFIG_CRYPTO_CAMELLIA is not set
CONFIG_CRYPTO_CAMELLIA_X86_64=m
CONFIG_CRYPTO_CAST5=m
CONFIG_CRYPTO_CAST5_AVX_X86_64=m
CONFIG_CRYPTO_CAST6=m
CONFIG_CRYPTO_CAST6_AVX_X86_64=m
CONFIG_CRYPTO_DES=m
# CONFIG_CRYPTO_FCRYPT is not set
CONFIG_CRYPTO_KHAZAD=m
CONFIG_CRYPTO_SALSA20=m
# CONFIG_CRYPTO_SALSA20_X86_64 is not set
CONFIG_CRYPTO_SEED=m
CONFIG_CRYPTO_SERPENT=m
CONFIG_CRYPTO_SERPENT_SSE2_X86_64=m
CONFIG_CRYPTO_SERPENT_AVX_X86_64=m
# CONFIG_CRYPTO_TEA is not set
CONFIG_CRYPTO_TWOFISH=m
CONFIG_CRYPTO_TWOFISH_COMMON=m
CONFIG_CRYPTO_TWOFISH_X86_64=m
CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=m
CONFIG_CRYPTO_TWOFISH_AVX_X86_64=m

#
# Compression
#
CONFIG_CRYPTO_DEFLATE=m
CONFIG_CRYPTO_ZLIB=m
CONFIG_CRYPTO_LZO=m

#
# Random Number Generation
#
CONFIG_CRYPTO_ANSI_CPRNG=m
# CONFIG_CRYPTO_HW is not set
CONFIG_ASYMMETRIC_KEY_TYPE=y
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
CONFIG_PUBLIC_KEY_ALGO_RSA=y
CONFIG_X509_CERTIFICATE_PARSER=y
CONFIG_HAVE_KVM=y
CONFIG_VIRTUALIZATION=y
# CONFIG_BINARY_PRINTF is not set

#
# Library routines
#
CONFIG_BITREVERSE=m
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GENERIC_FIND_FIRST_BIT=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_IO=y
# CONFIG_CRC_CCITT is not set
# CONFIG_CRC16 is not set
CONFIG_CRC_T10DIF=m
CONFIG_CRC_ITU_T=m
CONFIG_CRC32=m
CONFIG_CRC32_SELFTEST=y
# CONFIG_CRC32_SLICEBY8 is not set
# CONFIG_CRC32_SLICEBY4 is not set
# CONFIG_CRC32_SARWATE is not set
CONFIG_CRC32_BIT=y
CONFIG_CRC7=m
# CONFIG_LIBCRC32C is not set
# CONFIG_CRC8 is not set
CONFIG_ZLIB_INFLATE=m
CONFIG_ZLIB_DEFLATE=m
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
# CONFIG_XZ_DEC is not set
# CONFIG_XZ_DEC_BCJ is not set
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_NLATTR=y
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
CONFIG_AVERAGE=y
CONFIG_CLZ_TAB=y
CONFIG_CORDIC=m
# CONFIG_DDR is not set
CONFIG_MPILIB=y
CONFIG_OID_REGISTRY=y

--------------010605010902080307000907
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.xen.org
http://lists.xen.org/xen-devel

--------------010605010902080307000907--


From xen-devel-bounces@lists.xen.org Thu Nov 01 18:05:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 18:05:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TTz8x-0001n9-V6; Thu, 01 Nov 2012 18:05:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rdunlap@infradead.org>) id 1TTyQG-0000KB-4R
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 17:19:16 +0000
Received: from [85.158.139.211:63750] by server-16.bemta-5.messagelabs.com id
	67/75-04786-31FA2905; Thu, 01 Nov 2012 17:19:15 +0000
X-Env-Sender: rdunlap@infradead.org
X-Msg-Ref: server-3.tower-206.messagelabs.com!1351790352!18512055!1
X-Originating-IP: [85.118.1.10]
X-SpamReason: No, hits=2.3 required=7.0 tests=UNIQUE_WORDS,
  UPPERCASE_50_75
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19379 invoked from network); 1 Nov 2012 17:19:13 -0000
Received: from casper.infradead.org (HELO casper.infradead.org) (85.118.1.10)
	by server-3.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 17:19:13 -0000
Received: from static-50-53-38-135.bvtn.or.frontiernet.net ([50.53.38.135]
	helo=[192.168.1.7])
	by casper.infradead.org with esmtpsa (Exim 4.76 #1 (Red Hat Linux))
	id 1TTyPq-0000es-S5; Thu, 01 Nov 2012 17:18:51 +0000
Message-ID: <5092AEF7.5020609@infradead.org>
Date: Thu, 01 Nov 2012 10:18:47 -0700
From: Randy Dunlap <rdunlap@infradead.org>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.15) Gecko/20110323 Thunderbird/3.1.9
MIME-Version: 1.0
To: Stephen Rothwell <sfr@canb.auug.org.au>
References: <20121101163622.129b59967d2ee76e6946874a@canb.auug.org.au>
In-Reply-To: <20121101163622.129b59967d2ee76e6946874a@canb.auug.org.au>
Content-Type: multipart/mixed; boundary="------------010605010902080307000907"
X-Mailman-Approved-At: Thu, 01 Nov 2012 18:05:25 +0000
Cc: Jeremy Fitzhardinge <jeremy@goop.org>, xen-devel@lists.xensource.com,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	linux-next@vger.kernel.org
Subject: Re: [Xen-devel] linux-next: Tree for Nov 1 (xen)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.
--------------010605010902080307000907
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On 10/31/2012 10:36 PM, Stephen Rothwell wrote:

> Hi all,
> 
> New trees: rr-fixes and swiotlb
> 
> Changes since 20121031:
> 


arch/x86/xen/enlighten.c:109:0: warning: "xen_pvh_domain" redefined
include/xen/xen.h:23:0: note: this is the location of the previous definition

Full randconfig file is attached.

-- 
~Randy

--------------010605010902080307000907
Content-Type: text/plain;
 name="config-r8493"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="config-r8493"

#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 3.7.0-rc3 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_GPIO=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_DEFAULT_IDLE=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_ARCH_HAS_CPU_AUTOPROBE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ZONE_DMA32=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11"
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_HAVE_IRQ_WORK=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_EXTABLE_SORT=y

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
# CONFIG_KERNEL_GZIP is not set
CONFIG_KERNEL_BZIP2=y
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SYSVIPC=y
CONFIG_FHANDLE=y
CONFIG_HAVE_GENERIC_HARDIRQS=y

#
# IRQ subsystem
#
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_IRQ_DOMAIN=y
# CONFIG_IRQ_DOMAIN_DEBUG is not set
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_ARCH_CLOCKSOURCE_DATA=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_GENERIC_CMOS_UPDATE=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
# CONFIG_NO_HZ is not set
CONFIG_HIGH_RES_TIMERS=y

#
# CPU/Task time and stats accounting
#
CONFIG_TICK_CPU_ACCOUNTING=y
# CONFIG_IRQ_TIME_ACCOUNTING is not set
# CONFIG_BSD_PROCESS_ACCT is not set

#
# RCU Subsystem
#
CONFIG_TINY_PREEMPT_RCU=y
CONFIG_PREEMPT_RCU=y
# CONFIG_TREE_RCU_TRACE is not set
CONFIG_RCU_BOOST=y
CONFIG_RCU_BOOST_PRIO=1
CONFIG_RCU_BOOST_DELAY=500
CONFIG_IKCONFIG=m
CONFIG_LOG_BUF_SHIFT=17
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
CONFIG_CHECKPOINT_RESTORE=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
# CONFIG_IPC_NS is not set
# CONFIG_PID_NS is not set
# CONFIG_SCHED_AUTOGROUP is not set
CONFIG_SYSFS_DEPRECATED=y
# CONFIG_SYSFS_DEPRECATED_V2 is not set
# CONFIG_RELAY is not set
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_ANON_INODES=y
CONFIG_EXPERT=y
CONFIG_HAVE_UID16=y
CONFIG_UID16=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_HOTPLUG=y
# CONFIG_PRINTK is not set
CONFIG_BUG=y
CONFIG_ELF_CORE=y
# CONFIG_PCSPKR_PLATFORM is not set
CONFIG_HAVE_PCSPKR_PLATFORM=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
# CONFIG_EPOLL is not set
# CONFIG_SIGNALFD is not set
# CONFIG_TIMERFD is not set
# CONFIG_EVENTFD is not set
# CONFIG_SHMEM is not set
# CONFIG_AIO is not set
# CONFIG_EMBEDDED is not set
CONFIG_HAVE_PERF_EVENTS=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLUB_DEBUG=y
CONFIG_COMPAT_BRK=y
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
CONFIG_PROFILING=y
# CONFIG_OPROFILE is not set
CONFIG_HAVE_OPROFILE=y
CONFIG_OPROFILE_NMI_TIMER=y
CONFIG_KPROBES=y
CONFIG_JUMP_LABEL=y
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_KRETPROBES=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_OPTPROBES=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
CONFIG_HAVE_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_PERF_EVENTS_NMI=y
CONFIG_HAVE_PERF_REGS=y
CONFIG_HAVE_PERF_USER_STACK_DUMP=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
CONFIG_HAVE_CMPXCHG_LOCAL=y
CONFIG_HAVE_CMPXCHG_DOUBLE=y
CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y
CONFIG_GENERIC_KERNEL_THREAD=y
CONFIG_GENERIC_KERNEL_EXECVE=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_HAVE_RCU_USER_QS=y
CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_MODULES_USE_ELF_RELA=y

#
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
CONFIG_MODULE_FORCE_LOAD=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_MODULE_FORCE_UNLOAD is not set
CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_MODULE_SIG=y
CONFIG_MODULE_SIG_FORCE=y
# CONFIG_MODULE_SIG_SHA1 is not set
# CONFIG_MODULE_SIG_SHA224 is not set
CONFIG_MODULE_SIG_SHA256=y
# CONFIG_MODULE_SIG_SHA384 is not set
# CONFIG_MODULE_SIG_SHA512 is not set
# CONFIG_BLOCK is not set
CONFIG_ASN1=y
CONFIG_UNINLINE_SPIN_UNLOCK=y
CONFIG_FREEZER=y

#
# Processor type and features
#
# CONFIG_ZONE_DMA is not set
# CONFIG_SMP is not set
CONFIG_X86_MPPARSE=y
# CONFIG_X86_EXTENDED_PLATFORM is not set
CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
CONFIG_SCHED_OMIT_FRAME_POINTER=y
# CONFIG_KVMTOOL_TEST_ENABLE is not set
CONFIG_PARAVIRT_GUEST=y
# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
CONFIG_XEN=y
# CONFIG_XEN_PRIVILEGED_GUEST is not set
CONFIG_XEN_MAX_DOMAIN_MEMORY=500
CONFIG_XEN_SAVE_RESTORE=y
# CONFIG_XEN_DEBUG_FS is not set
CONFIG_XEN_X86_PVH=y
# CONFIG_KVM_GUEST is not set
CONFIG_PARAVIRT=y
CONFIG_PARAVIRT_CLOCK=y
CONFIG_PARAVIRT_DEBUG=y
CONFIG_NO_BOOTMEM=y
# CONFIG_MEMTEST is not set
# CONFIG_MK8 is not set
# CONFIG_MPSC is not set
# CONFIG_MCORE2 is not set
# CONFIG_MATOM is not set
CONFIG_GENERIC_CPU=y
CONFIG_X86_INTERNODE_CACHE_SHIFT=6
CONFIG_X86_CMPXCHG=y
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_XADD=y
CONFIG_X86_WP_WORKS_OK=y
CONFIG_X86_TSC=y
CONFIG_X86_CMPXCHG64=y
CONFIG_X86_CMOV=y
CONFIG_X86_MINIMUM_CPU_FAMILY=64
CONFIG_X86_DEBUGCTLMSR=y
# CONFIG_PROCESSOR_SELECT is not set
CONFIG_CPU_SUP_INTEL=y
CONFIG_CPU_SUP_AMD=y
CONFIG_CPU_SUP_CENTAUR=y
CONFIG_HPET_TIMER=y
# CONFIG_DMI is not set
CONFIG_SWIOTLB=y
CONFIG_IOMMU_HELPER=y
CONFIG_NR_CPUS=1
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
CONFIG_PREEMPT_COUNT=y
CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
# CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS is not set
CONFIG_X86_MCE=y
CONFIG_X86_MCE_INTEL=y
# CONFIG_X86_MCE_AMD is not set
CONFIG_X86_MCE_THRESHOLD=y
CONFIG_X86_MCE_INJECT=m
CONFIG_X86_THERMAL_VECTOR=y
CONFIG_I8K=m
# CONFIG_MICROCODE is not set
CONFIG_X86_MSR=m
CONFIG_X86_CPUID=m
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_DIRECT_GBPAGES=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_SPARSEMEM_MANUAL=y
CONFIG_SPARSEMEM=y
CONFIG_HAVE_MEMORY_PRESENT=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=y
# CONFIG_SPARSEMEM_VMEMMAP is not set
CONFIG_HAVE_MEMBLOCK=y
CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
CONFIG_ARCH_DISCARD_MEMBLOCK=y
CONFIG_MEMORY_ISOLATION=y
# CONFIG_MEMORY_HOTPLUG is not set
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=999999
# CONFIG_COMPACTION is not set
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_ZONE_DMA_FLAG=0
CONFIG_VIRT_TO_BUS=y
CONFIG_MMU_NOTIFIER=y
CONFIG_KSM=y
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
CONFIG_MEMORY_FAILURE=y
# CONFIG_TRANSPARENT_HUGEPAGE is not set
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_NEED_PER_CPU_KM=y
CONFIG_CLEANCACHE=y
# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
CONFIG_X86_RESERVE_LOW=64
CONFIG_MTRR=y
CONFIG_MTRR_SANITIZER=y
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
# CONFIG_X86_PAT is not set
# CONFIG_ARCH_RANDOM is not set
CONFIG_X86_SMAP=y
# CONFIG_SECCOMP is not set
CONFIG_CC_STACKPROTECTOR=y
# CONFIG_HZ_100 is not set
# CONFIG_HZ_250 is not set
CONFIG_HZ_300=y
# CONFIG_HZ_1000 is not set
CONFIG_HZ=300
CONFIG_SCHED_HRTICK=y
# CONFIG_KEXEC is not set
# CONFIG_CRASH_DUMP is not set
CONFIG_PHYSICAL_START=0x1000000
# CONFIG_RELOCATABLE is not set
CONFIG_PHYSICAL_ALIGN=0x1000000
# CONFIG_COMPAT_VDSO is not set
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE=""
CONFIG_CMDLINE_OVERRIDE=y
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y

#
# Power management and ACPI options
#
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
CONFIG_HIBERNATE_CALLBACKS=y
CONFIG_PM_SLEEP=y
CONFIG_PM_AUTOSLEEP=y
CONFIG_PM_WAKELOCKS=y
CONFIG_PM_WAKELOCKS_LIMIT=100
# CONFIG_PM_WAKELOCKS_GC is not set
CONFIG_PM_RUNTIME=y
CONFIG_PM=y
# CONFIG_PM_DEBUG is not set
# CONFIG_SFI is not set

#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=m
CONFIG_CPU_FREQ_STAT=m
# CONFIG_CPU_FREQ_STAT_DETAILS is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
CONFIG_CPU_FREQ_GOV_USERSPACE=m
CONFIG_CPU_FREQ_GOV_ONDEMAND=m
# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set

#
# x86 CPU frequency scaling drivers
#
CONFIG_X86_P4_CLOCKMOD=m

#
# shared options
#
CONFIG_X86_SPEEDSTEP_LIB=m
# CONFIG_CPU_IDLE is not set
# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set

#
# Memory power savings
#
# CONFIG_I7300_IDLE is not set

#
# Bus options (PCI etc.)
#
# CONFIG_PCI is not set
# CONFIG_ISA_DMA_API is not set
CONFIG_PCCARD=m
CONFIG_PCMCIA=m
CONFIG_PCMCIA_LOAD_CIS=y

#
# PC-card bridges
#

#
# Executable file formats / Emulations
#
CONFIG_BINFMT_ELF=y
CONFIG_COMPAT_BINFMT_ELF=y
CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
# CONFIG_HAVE_AOUT is not set
CONFIG_BINFMT_MISC=m
CONFIG_COREDUMP=y
CONFIG_IA32_EMULATION=y
CONFIG_IA32_AOUT=m
# CONFIG_X86_X32 is not set
CONFIG_COMPAT=y
CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
CONFIG_SYSVIPC_COMPAT=y
CONFIG_KEYS_COMPAT=y
CONFIG_HAVE_TEXT_POKE_SMP=y
CONFIG_X86_DEV_DMA_OPS=y
# CONFIG_NET is not set
CONFIG_HAVE_BPF_JIT=y

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH=""
# CONFIG_DEVTMPFS is not set
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=m
# CONFIG_FIRMWARE_IN_KERNEL is not set
CONFIG_EXTRA_FIRMWARE=""
CONFIG_DEBUG_DRIVER=y
CONFIG_DEBUG_DEVRES=y
CONFIG_SYS_HYPERVISOR=y
# CONFIG_GENERIC_CPU_DEVICES is not set
CONFIG_REGMAP=y
CONFIG_REGMAP_SPI=y
CONFIG_REGMAP_IRQ=y
# CONFIG_DMA_SHARED_BUFFER is not set

#
# Bus devices
#
CONFIG_OMAP_OCP2SCP=m
# CONFIG_MTD is not set
CONFIG_PARPORT=m
# CONFIG_PARPORT_PC is not set
# CONFIG_PARPORT_GSC is not set
# CONFIG_PARPORT_AX88796 is not set
CONFIG_PARPORT_1284=y
CONFIG_PARPORT_NOT_PC=y

#
# Misc devices
#
# CONFIG_SENSORS_LIS3LV02D is not set
CONFIG_AD525X_DPOT=m
# CONFIG_AD525X_DPOT_SPI is not set
CONFIG_ENCLOSURE_SERVICES=m
# CONFIG_TI_DAC7512 is not set
# CONFIG_VMWARE_BALLOON is not set
CONFIG_BMP085=y
CONFIG_BMP085_SPI=m
# CONFIG_C2PORT is not set

#
# EEPROM support
#
CONFIG_EEPROM_AT25=m
# CONFIG_EEPROM_93CX6 is not set
# CONFIG_EEPROM_93XX46 is not set

#
# Texas Instruments shared transport line discipline
#
# CONFIG_SENSORS_LIS3_SPI is not set

#
# Altera FPGA firmware download module
#
CONFIG_HAVE_IDE=y

#
# SCSI device support
#
CONFIG_SCSI_MOD=y
# CONFIG_SCSI_DMA is not set
# CONFIG_SCSI_NETLINK is not set
CONFIG_MACINTOSH_DRIVERS=y

#
# Input device support
#
CONFIG_INPUT=m
# CONFIG_INPUT_FF_MEMLESS is not set
CONFIG_INPUT_POLLDEV=m
CONFIG_INPUT_SPARSEKMAP=m
CONFIG_INPUT_MATRIXKMAP=m

#
# Userland interfaces
#
# CONFIG_INPUT_MOUSEDEV is not set
CONFIG_INPUT_JOYDEV=m
CONFIG_INPUT_EVDEV=m
# CONFIG_INPUT_EVBUG is not set

#
# Input Device Drivers
#
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TABLET is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
CONFIG_INPUT_MISC=y
CONFIG_INPUT_AD714X=m
CONFIG_INPUT_AD714X_SPI=m
CONFIG_INPUT_MC13783_PWRBUTTON=m
# CONFIG_INPUT_GPIO_TILT_POLLED is not set
# CONFIG_INPUT_ATI_REMOTE2 is not set
CONFIG_INPUT_KEYSPAN_REMOTE=m
CONFIG_INPUT_POWERMATE=m
# CONFIG_INPUT_YEALINK is not set
# CONFIG_INPUT_CM109 is not set
CONFIG_INPUT_UINPUT=m
# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
CONFIG_INPUT_DA9052_ONKEY=m
# CONFIG_INPUT_PCAP is not set
CONFIG_INPUT_ADXL34X=m
# CONFIG_INPUT_ADXL34X_SPI is not set
# CONFIG_INPUT_CMA3000 is not set
# CONFIG_INPUT_XEN_KBDDEV_FRONTEND is not set

#
# Hardware I/O ports
#
CONFIG_SERIO=m
CONFIG_SERIO_I8042=m
CONFIG_SERIO_SERPORT=m
CONFIG_SERIO_CT82C710=m
CONFIG_SERIO_PARKBD=m
# CONFIG_SERIO_LIBPS2 is not set
# CONFIG_SERIO_RAW is not set
CONFIG_SERIO_ALTERA_PS2=m
# CONFIG_SERIO_PS2MULT is not set
CONFIG_SERIO_ARC_PS2=m
# CONFIG_GAMEPORT is not set

#
# Character devices
#
# CONFIG_VT is not set
CONFIG_UNIX98_PTYS=y
# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
# CONFIG_LEGACY_PTYS is not set
# CONFIG_SERIAL_NONSTANDARD is not set
# CONFIG_TRACE_SINK is not set
CONFIG_DEVKMEM=y

#
# Serial drivers
#
CONFIG_SERIAL_8250=m
CONFIG_FIX_EARLYCON_MEM=y
# CONFIG_SERIAL_8250_CS is not set
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
# CONFIG_SERIAL_8250_EXTENDED is not set

#
# Non-8250 serial port support
#
# CONFIG_SERIAL_MAX3100 is not set
CONFIG_SERIAL_MAX310X=y
CONFIG_SERIAL_CORE=y
# CONFIG_SERIAL_SCCNXP is not set
# CONFIG_SERIAL_TIMBERDALE is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_IFX6X60 is not set
# CONFIG_SERIAL_XILINX_PS_UART is not set
CONFIG_SERIAL_ARC=m
CONFIG_SERIAL_ARC_NR_PORTS=1
CONFIG_TTY_PRINTK=y
# CONFIG_PRINTER is not set
# CONFIG_PPDEV is not set
CONFIG_HVC_DRIVER=y
# CONFIG_HVC_XEN is not set
CONFIG_VIRTIO_CONSOLE=m
CONFIG_IPMI_HANDLER=m
CONFIG_IPMI_PANIC_EVENT=y
CONFIG_IPMI_PANIC_STRING=y
# CONFIG_IPMI_DEVICE_INTERFACE is not set
CONFIG_IPMI_SI=m
# CONFIG_IPMI_WATCHDOG is not set
CONFIG_IPMI_POWEROFF=m
CONFIG_HW_RANDOM=m
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
# CONFIG_HW_RANDOM_VIA is not set
# CONFIG_HW_RANDOM_VIRTIO is not set
# CONFIG_NVRAM is not set
# CONFIG_R3964 is not set

#
# PCMCIA character devices
#
CONFIG_SYNCLINK_CS=m
CONFIG_CARDMAN_4000=m
# CONFIG_CARDMAN_4040 is not set
# CONFIG_MWAVE is not set
# CONFIG_HANGCHECK_TIMER is not set
# CONFIG_TCG_TPM is not set
CONFIG_TELCLOCK=m
# CONFIG_I2C is not set
CONFIG_SPI=y
CONFIG_SPI_DEBUG=y
CONFIG_SPI_MASTER=y

#
# SPI Master Controller Drivers
#
# CONFIG_SPI_ALTERA is not set
CONFIG_SPI_BITBANG=m
CONFIG_SPI_BUTTERFLY=m
# CONFIG_SPI_GPIO is not set
CONFIG_SPI_LM70_LLP=m
CONFIG_SPI_OC_TINY=m
# CONFIG_SPI_PXA2XX_PCI is not set
# CONFIG_SPI_XILINX is not set
CONFIG_SPI_DESIGNWARE=m

#
# SPI Protocol Masters
#
# CONFIG_SPI_SPIDEV is not set
# CONFIG_SPI_TLE62X0 is not set
CONFIG_HSI=m
CONFIG_HSI_BOARDINFO=y

#
# HSI clients
#
CONFIG_HSI_CHAR=m

#
# PPS support
#
# CONFIG_PPS is not set

#
# PPS generators support
#

#
# PTP clock support
#

#
# Enable Device Drivers -> PPS to see the PTP clock options.
#
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
CONFIG_GPIOLIB=y
CONFIG_DEBUG_GPIO=y
CONFIG_GPIO_SYSFS=y
# CONFIG_GPIO_DA9052 is not set

#
# Memory mapped GPIO drivers:
#
# CONFIG_GPIO_GENERIC_PLATFORM is not set
CONFIG_GPIO_IT8761E=m

#
# I2C GPIO expanders:
#
# CONFIG_GPIO_ARIZONA is not set

#
# PCI GPIO expanders:
#

#
# SPI GPIO expanders:
#
# CONFIG_GPIO_MAX7301 is not set
CONFIG_GPIO_MCP23S08=m
# CONFIG_GPIO_MC33880 is not set
CONFIG_GPIO_74X164=m

#
# AC97 GPIO expanders:
#

#
# MODULbus GPIO expanders:
#
# CONFIG_W1 is not set
# CONFIG_POWER_SUPPLY is not set
CONFIG_POWER_AVS=y
CONFIG_HWMON=m
CONFIG_HWMON_VID=m
CONFIG_HWMON_DEBUG_CHIP=y

#
# Native drivers
#
# CONFIG_SENSORS_AD7314 is not set
# CONFIG_SENSORS_ADCXX is not set
CONFIG_SENSORS_DA9052_ADC=m
CONFIG_SENSORS_F71805F=m
CONFIG_SENSORS_F71882FG=m
# CONFIG_SENSORS_GPIO_FAN is not set
CONFIG_SENSORS_CORETEMP=m
# CONFIG_SENSORS_IBMAEM is not set
CONFIG_SENSORS_IBMPEX=m
# CONFIG_SENSORS_IT87 is not set
CONFIG_SENSORS_LM70=m
CONFIG_SENSORS_MAX1111=m
# CONFIG_SENSORS_MAX197 is not set
# CONFIG_SENSORS_NTC_THERMISTOR is not set
CONFIG_SENSORS_PC87360=m
CONFIG_SENSORS_PC87427=m
# CONFIG_SENSORS_SHT15 is not set
CONFIG_SENSORS_SMSC47M1=m
# CONFIG_SENSORS_SMSC47B397 is not set
# CONFIG_SENSORS_SCH56XX_COMMON is not set
CONFIG_SENSORS_ADS7871=m
# CONFIG_SENSORS_VIA_CPUTEMP is not set
CONFIG_SENSORS_VT1211=m
CONFIG_SENSORS_W83627HF=m
CONFIG_SENSORS_W83627EHF=m
CONFIG_SENSORS_APPLESMC=m
# CONFIG_SENSORS_MC13783_ADC is not set
CONFIG_THERMAL=m
CONFIG_THERMAL_HWMON=y
CONFIG_CPU_THERMAL=y
CONFIG_FAIR_SHARE=y
CONFIG_STEP_WISE=y
CONFIG_USER_SPACE=y
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set
# CONFIG_WATCHDOG is not set
CONFIG_SSB_POSSIBLE=y

#
# Sonics Silicon Backplane
#
CONFIG_SSB=m
CONFIG_SSB_PCMCIAHOST_POSSIBLE=y
# CONFIG_SSB_PCMCIAHOST is not set
CONFIG_SSB_SDIOHOST_POSSIBLE=y
# CONFIG_SSB_SDIOHOST is not set
CONFIG_SSB_SILENT=y
CONFIG_BCMA_POSSIBLE=y

#
# Broadcom specific AMBA
#
CONFIG_BCMA=m
# CONFIG_BCMA_DRIVER_GMAC_CMN is not set
# CONFIG_BCMA_DEBUG is not set

#
# Multifunction device drivers
#
CONFIG_MFD_CORE=y
# CONFIG_MFD_SM501 is not set
# CONFIG_HTC_PASIC3 is not set
# CONFIG_MFD_TPS65912_SPI is not set
# CONFIG_MFD_STMPE is not set
# CONFIG_MFD_TMIO is not set
CONFIG_PMIC_DA9052=y
CONFIG_MFD_DA9052_SPI=y
CONFIG_MFD_ARIZONA=y
CONFIG_MFD_ARIZONA_SPI=m
CONFIG_MFD_WM5102=y
CONFIG_MFD_WM5110=y
# CONFIG_MFD_WM831X_SPI is not set
CONFIG_MFD_MC13783=m
CONFIG_MFD_MC13XXX=m
CONFIG_MFD_MC13XXX_SPI=m
# CONFIG_ABX500_CORE is not set
CONFIG_EZX_PCAP=y
# CONFIG_REGULATOR is not set
CONFIG_MEDIA_SUPPORT=m

#
# Multimedia core support
#
# CONFIG_MEDIA_CAMERA_SUPPORT is not set
# CONFIG_MEDIA_ANALOG_TV_SUPPORT is not set
# CONFIG_MEDIA_DIGITAL_TV_SUPPORT is not set
CONFIG_MEDIA_RADIO_SUPPORT=y
# CONFIG_MEDIA_RC_SUPPORT is not set
CONFIG_VIDEO_DEV=m
CONFIG_VIDEO_V4L2=m
# CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set

#
# Media drivers
#
CONFIG_MEDIA_USB_SUPPORT=y

#
# Supported MMC/SDIO adapters
#
CONFIG_RADIO_ADAPTERS=y
# CONFIG_RADIO_SI470X is not set
# CONFIG_USB_MR800 is not set
CONFIG_USB_DSBR=m
# CONFIG_RADIO_SHARK2 is not set
CONFIG_USB_KEENE=m

#
# Texas Instruments WL128x FM driver (ST based)
#

#
# Media ancillary drivers (tuners, sensors, i2c, frontends)
#

#
# Encoders, decoders, sensors and other helper chips
#

#
# Audio decoders, processors and mixers
#

#
# RDS decoders
#

#
# Video decoders
#

#
# Video and audio decoders
#

#
# MPEG video encoders
#
# CONFIG_VIDEO_CX2341X is not set

#
# Video encoders
#

#
# Camera sensor devices
#

#
# Flash devices
#

#
# Video improvement chips
#

#
# Miscelaneous helper chips
#

#
# Sensors used on soc_camera driver
#
CONFIG_MEDIA_ATTACH=y

#
# Customize TV tuners
#

#
# Customise DVB Frontends
#

#
# Tools to develop new frontends
#
CONFIG_DVB_DUMMY_FE=m

#
# Graphics support
#
# CONFIG_DRM is not set
# CONFIG_VGASTATE is not set
# CONFIG_VIDEO_OUTPUT_CONTROL is not set
CONFIG_FB=m
# CONFIG_FIRMWARE_EDID is not set
# CONFIG_FB_DDC is not set
# CONFIG_FB_BOOT_VESA_SUPPORT is not set
CONFIG_FB_CFB_FILLRECT=m
CONFIG_FB_CFB_COPYAREA=m
CONFIG_FB_CFB_IMAGEBLIT=m
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
CONFIG_FB_SYS_FILLRECT=m
CONFIG_FB_SYS_COPYAREA=m
CONFIG_FB_SYS_IMAGEBLIT=m
# CONFIG_FB_FOREIGN_ENDIAN is not set
CONFIG_FB_SYS_FOPS=m
# CONFIG_FB_WMT_GE_ROPS is not set
CONFIG_FB_DEFERRED_IO=y
CONFIG_FB_HECUBA=m
# CONFIG_FB_SVGALIB is not set
# CONFIG_FB_MACMODES is not set
# CONFIG_FB_BACKLIGHT is not set
CONFIG_FB_MODE_HELPERS=y
# CONFIG_FB_TILEBLITTING is not set

#
# Frame buffer hardware drivers
#
CONFIG_FB_ARC=m
# CONFIG_FB_VGA16 is not set
CONFIG_FB_N411=m
CONFIG_FB_HGA=m
CONFIG_FB_S1D13XXX=m
CONFIG_FB_TMIO=m
CONFIG_FB_TMIO_ACCELL=y
CONFIG_FB_SMSCUFX=m
# CONFIG_FB_UDL is not set
# CONFIG_FB_VIRTUAL is not set
# CONFIG_XEN_FBDEV_FRONTEND is not set
CONFIG_FB_METRONOME=m
# CONFIG_FB_BROADSHEET is not set
CONFIG_FB_AUO_K190X=m
CONFIG_FB_AUO_K1900=m
CONFIG_FB_AUO_K1901=m
CONFIG_EXYNOS_VIDEO=y
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
CONFIG_LOGO=y
CONFIG_LOGO_LINUX_MONO=y
CONFIG_LOGO_LINUX_VGA16=y
# CONFIG_LOGO_LINUX_CLUT224 is not set
# CONFIG_SOUND is not set

#
# HID support
#
CONFIG_HID=m
# CONFIG_HIDRAW is not set
# CONFIG_UHID is not set
# CONFIG_HID_GENERIC is not set

#
# Special HID drivers
#

#
# USB HID support
#
# CONFIG_USB_HID is not set
CONFIG_HID_PID=y

#
# USB HID Boot Protocol drivers
#
# CONFIG_USB_KBD is not set
CONFIG_USB_MOUSE=m
# CONFIG_USB_ARCH_HAS_OHCI is not set
# CONFIG_USB_ARCH_HAS_EHCI is not set
# CONFIG_USB_ARCH_HAS_XHCI is not set
CONFIG_USB_SUPPORT=y
CONFIG_USB_COMMON=m
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB=m
# CONFIG_USB_DEBUG is not set
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y

#
# Miscellaneous USB options
#
# CONFIG_USB_DYNAMIC_MINORS is not set
# CONFIG_USB_SUSPEND is not set
CONFIG_USB_OTG_WHITELIST=y
CONFIG_USB_OTG_BLACKLIST_HUB=y
CONFIG_USB_DWC3=m
CONFIG_USB_DWC3_DEBUG=y
# CONFIG_USB_DWC3_VERBOSE is not set
# CONFIG_USB_MON is not set
# CONFIG_USB_WUSB_CBAF is not set

#
# USB Host Controller Drivers
#
CONFIG_USB_C67X00_HCD=m
CONFIG_USB_OXU210HP_HCD=m
# CONFIG_USB_ISP116X_HCD is not set
CONFIG_USB_ISP1760_HCD=m
CONFIG_USB_ISP1362_HCD=m
CONFIG_USB_U132_HCD=m
# CONFIG_USB_SL811_HCD is not set
CONFIG_USB_R8A66597_HCD=m
# CONFIG_USB_RENESAS_USBHS_HCD is not set
CONFIG_USB_HCD_BCMA=m
CONFIG_USB_HCD_SSB=m
CONFIG_USB_MUSB_HDRC=m
# CONFIG_USB_MUSB_TUSB6010 is not set
CONFIG_MUSB_PIO_ONLY=y
CONFIG_USB_CHIPIDEA=m
CONFIG_USB_CHIPIDEA_UDC=y
# CONFIG_USB_CHIPIDEA_HOST is not set
CONFIG_USB_CHIPIDEA_DEBUG=y
CONFIG_USB_RENESAS_USBHS=m

#
# USB Device Class drivers
#
# CONFIG_USB_ACM is not set
CONFIG_USB_PRINTER=m
# CONFIG_USB_WDM is not set
# CONFIG_USB_TMC is not set

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
#

#
# also be needed; see USB_STORAGE Help for more info
#

#
# USB Imaging devices
#
CONFIG_USB_MDC800=m

#
# USB port drivers
#
CONFIG_USB_USS720=m
# CONFIG_USB_SERIAL is not set

#
# USB Miscellaneous drivers
#
CONFIG_USB_EMI62=m
CONFIG_USB_EMI26=m
# CONFIG_USB_ADUTUX is not set
# CONFIG_USB_SEVSEG is not set
CONFIG_USB_RIO500=m
# CONFIG_USB_LEGOTOWER is not set
CONFIG_USB_LCD=m
# CONFIG_USB_LED is not set
CONFIG_USB_CYPRESS_CY7C63=m
# CONFIG_USB_CYTHERM is not set
# CONFIG_USB_IDMOUSE is not set
CONFIG_USB_FTDI_ELAN=m
# CONFIG_USB_APPLEDISPLAY is not set
CONFIG_USB_SISUSBVGA=m
CONFIG_USB_LD=m
# CONFIG_USB_TRANCEVIBRATOR is not set
CONFIG_USB_IOWARRIOR=m
# CONFIG_USB_TEST is not set
CONFIG_USB_ISIGHTFW=m
# CONFIG_USB_YUREX is not set
CONFIG_USB_EZUSB_FX2=m

#
# USB Physical Layer drivers
#
# CONFIG_OMAP_USB2 is not set
CONFIG_USB_GADGET=m
CONFIG_USB_GADGET_DEBUG=y
# CONFIG_USB_GADGET_DEBUG_FS is not set
CONFIG_USB_GADGET_VBUS_DRAW=2
CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2

#
# USB Peripheral Controller
#
# CONFIG_USB_R8A66597 is not set
CONFIG_USB_RENESAS_USBHS_UDC=m
# CONFIG_USB_MV_UDC is not set
CONFIG_USB_GADGET_MUSB_HDRC=m
CONFIG_USB_M66592=m
# CONFIG_USB_NET2272 is not set
CONFIG_USB_DUMMY_HCD=m
CONFIG_USB_LIBCOMPOSITE=m
# CONFIG_USB_ZERO is not set
# CONFIG_USB_GADGETFS is not set
CONFIG_USB_FUNCTIONFS=m
CONFIG_USB_FUNCTIONFS_GENERIC=y
CONFIG_USB_G_SERIAL=m
# CONFIG_USB_G_PRINTER is not set
CONFIG_USB_G_HID=m
CONFIG_USB_G_DBGP=m
CONFIG_USB_G_DBGP_PRINTK=y
# CONFIG_USB_G_DBGP_SERIAL is not set
CONFIG_USB_G_WEBCAM=m

#
# OTG and related infrastructure
#
CONFIG_USB_OTG_UTILS=y
CONFIG_USB_GPIO_VBUS=m
CONFIG_NOP_USB_XCEIV=m
CONFIG_MMC=m
CONFIG_MMC_DEBUG=y
# CONFIG_MMC_UNSAFE_RESUME is not set
CONFIG_MMC_CLKGATE=y

#
# MMC/SD/SDIO Card Drivers
#
CONFIG_SDIO_UART=m
CONFIG_MMC_TEST=m

#
# MMC/SD/SDIO Host Controller Drivers
#
# CONFIG_MMC_SDHCI is not set
CONFIG_MMC_SPI=m
# CONFIG_MMC_VUB300 is not set
CONFIG_MMC_USHC=m
CONFIG_MEMSTICK=m
CONFIG_MEMSTICK_DEBUG=y

#
# MemoryStick drivers
#
# CONFIG_MEMSTICK_UNSAFE_RESUME is not set

#
# MemoryStick Host Controller Drivers
#
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=m

#
# LED drivers
#
CONFIG_LEDS_GPIO=m
# CONFIG_LEDS_DA9052 is not set
# CONFIG_LEDS_DAC124S085 is not set
# CONFIG_LEDS_LT3593 is not set
CONFIG_LEDS_MC13783=m
CONFIG_LEDS_OT200=m
CONFIG_LEDS_TRIGGERS=y

#
# LED Triggers
#
CONFIG_LEDS_TRIGGER_TIMER=m
CONFIG_LEDS_TRIGGER_ONESHOT=m
CONFIG_LEDS_TRIGGER_HEARTBEAT=m
# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
# CONFIG_LEDS_TRIGGER_CPU is not set
# CONFIG_LEDS_TRIGGER_GPIO is not set
CONFIG_LEDS_TRIGGER_DEFAULT_ON=m

#
# iptables trigger is under Netfilter config (LED target)
#
# CONFIG_LEDS_TRIGGER_TRANSIENT is not set
CONFIG_ACCESSIBILITY=y
CONFIG_EDAC=y

#
# Reporting subsystems
#
# CONFIG_EDAC_LEGACY_SYSFS is not set
CONFIG_EDAC_DEBUG=y
CONFIG_EDAC_MM_EDAC=m
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set

#
# RTC interfaces
#
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_DEV=y
CONFIG_RTC_INTF_DEV_UIE_EMUL=y
CONFIG_RTC_DRV_TEST=m

#
# SPI RTC drivers
#
CONFIG_RTC_DRV_M41T93=m
# CONFIG_RTC_DRV_M41T94 is not set
# CONFIG_RTC_DRV_DS1305 is not set
CONFIG_RTC_DRV_DS1390=m
CONFIG_RTC_DRV_MAX6902=m
# CONFIG_RTC_DRV_R9701 is not set
CONFIG_RTC_DRV_RS5C348=m
# CONFIG_RTC_DRV_DS3234 is not set
CONFIG_RTC_DRV_PCF2123=m

#
# Platform RTC drivers
#
# CONFIG_RTC_DRV_CMOS is not set
CONFIG_RTC_DRV_DS1286=m
# CONFIG_RTC_DRV_DS1511 is not set
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_DA9052 is not set
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_M48T86 is not set
CONFIG_RTC_DRV_M48T35=m
CONFIG_RTC_DRV_M48T59=m
# CONFIG_RTC_DRV_MSM6242 is not set
CONFIG_RTC_DRV_BQ4802=m
CONFIG_RTC_DRV_RP5C01=m
CONFIG_RTC_DRV_V3020=m
# CONFIG_RTC_DRV_DS2404 is not set

#
# on-CPU RTC drivers
#
CONFIG_RTC_DRV_PCAP=m
CONFIG_RTC_DRV_MC13XXX=m
# CONFIG_DMADEVICES is not set
# CONFIG_AUXDISPLAY is not set
# CONFIG_UIO is not set
CONFIG_VIRTIO=m

#
# Virtio drivers
#
CONFIG_VIRTIO_BALLOON=m
# CONFIG_VIRTIO_MMIO is not set

#
# Microsoft Hyper-V guest support
#

#
# Xen driver support
#
# CONFIG_XEN_BALLOON is not set
# CONFIG_XEN_DEV_EVTCHN is not set
# CONFIG_XENFS is not set
CONFIG_XEN_SYS_HYPERVISOR=y
CONFIG_XEN_GNTDEV=m
CONFIG_XEN_GRANT_DEV_ALLOC=m
CONFIG_XEN_TMEM=y
CONFIG_XEN_PRIVCMD=m
CONFIG_XEN_HAVE_PVMMU=y
CONFIG_STAGING=y
CONFIG_ECHO=m
CONFIG_COMEDI=m
# CONFIG_COMEDI_DEBUG is not set
CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB=2048
CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB=20480
# CONFIG_COMEDI_MISC_DRIVERS is not set
CONFIG_COMEDI_PCMCIA_DRIVERS=y
CONFIG_COMEDI_CB_DAS16_CS=m
CONFIG_COMEDI_DAS08_CS=m
# CONFIG_COMEDI_NI_DAQ_700_CS is not set
CONFIG_COMEDI_NI_DAQ_DIO24_CS=m
# CONFIG_COMEDI_NI_MIO_CS is not set
CONFIG_COMEDI_QUATECH_DAQP_CS=m
CONFIG_COMEDI_USB_DRIVERS=y
# CONFIG_COMEDI_DT9812 is not set
CONFIG_COMEDI_USBDUX=m
# CONFIG_COMEDI_USBDUXFAST is not set
CONFIG_COMEDI_USBDUXSIGMA=m
CONFIG_COMEDI_VMK80XX=m
CONFIG_COMEDI_8255=m
CONFIG_COMEDI_FC=m
CONFIG_COMEDI_DAS08=m
# CONFIG_ASUS_OLED is not set
CONFIG_PANEL=m
CONFIG_PANEL_PARPORT=0
CONFIG_PANEL_PROFILE=5
# CONFIG_PANEL_CHANGE_MESSAGE is not set
CONFIG_TRANZPORT=m
# CONFIG_ZSMALLOC is not set
# CONFIG_FT1000 is not set

#
# Speakup console speech
#
CONFIG_STAGING_MEDIA=y

#
# Android
#
CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=y
# CONFIG_ANDROID_LOGGER is not set
# CONFIG_ANDROID_TIMED_OUTPUT is not set
# CONFIG_ANDROID_LOW_MEMORY_KILLER is not set
CONFIG_ANDROID_INTF_ALARM_DEV=y
# CONFIG_IPACK_BUS is not set
# CONFIG_CED1401 is not set
# CONFIG_DGRP is not set
# CONFIG_X86_PLATFORM_DEVICES is not set

#
# Hardware Spinlock drivers
#
CONFIG_CLKEVT_I8253=y
CONFIG_CLKBLD_I8253=y
CONFIG_IOMMU_SUPPORT=y

#
# Remoteproc drivers (EXPERIMENTAL)
#
CONFIG_REMOTEPROC=m
CONFIG_STE_MODEM_RPROC=m

#
# Rpmsg drivers
#
# CONFIG_VIRT_DRIVERS is not set
CONFIG_PM_DEVFREQ=y

#
# DEVFREQ Governors
#
CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y
# CONFIG_DEVFREQ_GOV_PERFORMANCE is not set
# CONFIG_DEVFREQ_GOV_POWERSAVE is not set
# CONFIG_DEVFREQ_GOV_USERSPACE is not set

#
# DEVFREQ Drivers
#
CONFIG_EXTCON=m

#
# Extcon Device Drivers
#
CONFIG_EXTCON_GPIO=m
# CONFIG_EXTCON_ARIZONA is not set
# CONFIG_MEMORY is not set
# CONFIG_IIO is not set
CONFIG_PWM=y

#
# Firmware Drivers
#
CONFIG_EDD=m
CONFIG_EDD_OFF=y
# CONFIG_FIRMWARE_MEMMAP is not set
CONFIG_DELL_RBU=m
CONFIG_DCDBAS=m
CONFIG_ISCSI_IBFT_FIND=y
CONFIG_GOOGLE_FIRMWARE=y

#
# Google Firmware Drivers
#

#
# File systems
#
CONFIG_DCACHE_WORD_ACCESS=y
# CONFIG_FS_POSIX_ACL is not set
CONFIG_EXPORTFS=y
# CONFIG_FILE_LOCKING is not set
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY_USER=y
# CONFIG_FANOTIFY is not set
CONFIG_QUOTA=y
# CONFIG_PRINT_QUOTA_WARNING is not set
# CONFIG_QUOTA_DEBUG is not set
# CONFIG_QFMT_V1 is not set
# CONFIG_QFMT_V2 is not set
CONFIG_QUOTACTL=y
CONFIG_QUOTACTL_COMPAT=y
# CONFIG_AUTOFS4_FS is not set
CONFIG_FUSE_FS=m
# CONFIG_CUSE is not set

#
# Caches
#
# CONFIG_FSCACHE is not set

#
# Pseudo filesystems
#
# CONFIG_PROC_FS is not set
CONFIG_SYSFS=y
# CONFIG_HUGETLBFS is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_CONFIGFS_FS=m
# CONFIG_MISC_FILESYSTEMS is not set
CONFIG_NLS=m
CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set
CONFIG_NLS_CODEPAGE_737=m
# CONFIG_NLS_CODEPAGE_775 is not set
# CONFIG_NLS_CODEPAGE_850 is not set
CONFIG_NLS_CODEPAGE_852=m
CONFIG_NLS_CODEPAGE_855=m
CONFIG_NLS_CODEPAGE_857=m
CONFIG_NLS_CODEPAGE_860=m
# CONFIG_NLS_CODEPAGE_861 is not set
CONFIG_NLS_CODEPAGE_862=m
CONFIG_NLS_CODEPAGE_863=m
# CONFIG_NLS_CODEPAGE_864 is not set
CONFIG_NLS_CODEPAGE_865=m
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
CONFIG_NLS_CODEPAGE_936=m
# CONFIG_NLS_CODEPAGE_950 is not set
# CONFIG_NLS_CODEPAGE_932 is not set
CONFIG_NLS_CODEPAGE_949=m
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
CONFIG_NLS_CODEPAGE_1251=m
CONFIG_NLS_ASCII=m
CONFIG_NLS_ISO8859_1=m
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
CONFIG_NLS_ISO8859_4=m
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
CONFIG_NLS_ISO8859_9=m
CONFIG_NLS_ISO8859_13=m
CONFIG_NLS_ISO8859_14=m
CONFIG_NLS_ISO8859_15=m
CONFIG_NLS_KOI8_R=m
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_MAC_ROMAN is not set
CONFIG_NLS_MAC_CELTIC=m
CONFIG_NLS_MAC_CENTEURO=m
# CONFIG_NLS_MAC_CROATIAN is not set
# CONFIG_NLS_MAC_CYRILLIC is not set
# CONFIG_NLS_MAC_GAELIC is not set
CONFIG_NLS_MAC_GREEK=m
CONFIG_NLS_MAC_ICELAND=m
# CONFIG_NLS_MAC_INUIT is not set
# CONFIG_NLS_MAC_ROMANIAN is not set
# CONFIG_NLS_MAC_TURKISH is not set
# CONFIG_NLS_UTF8 is not set

#
# Kernel hacking
#
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
CONFIG_ENABLE_WARN_DEPRECATED=y
CONFIG_ENABLE_MUST_CHECK=y
CONFIG_FRAME_WARN=2048
CONFIG_MAGIC_SYSRQ=y
# CONFIG_STRIP_ASM_SYMS is not set
CONFIG_READABLE_ASM=y
CONFIG_UNUSED_SYMBOLS=y
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
# CONFIG_DEBUG_SECTION_MISMATCH is not set
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_SHIRQ is not set
CONFIG_LOCKUP_DETECTOR=y
CONFIG_HARDLOCKUP_DETECTOR=y
CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y
CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=1
# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
# CONFIG_PANIC_ON_OOPS is not set
CONFIG_PANIC_ON_OOPS_VALUE=0
# CONFIG_DETECT_HUNG_TASK is not set
CONFIG_DEBUG_OBJECTS=y
# CONFIG_DEBUG_OBJECTS_SELFTEST is not set
CONFIG_DEBUG_OBJECTS_FREE=y
# CONFIG_DEBUG_OBJECTS_TIMERS is not set
# CONFIG_DEBUG_OBJECTS_WORK is not set
# CONFIG_DEBUG_OBJECTS_RCU_HEAD is not set
# CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER is not set
CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
# CONFIG_SLUB_STATS is not set
CONFIG_HAVE_DEBUG_KMEMLEAK=y
# CONFIG_DEBUG_KMEMLEAK is not set
# CONFIG_DEBUG_PREEMPT is not set
CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_PI_LIST=y
CONFIG_RT_MUTEX_TESTER=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_LOCK_ALLOC=y
CONFIG_PROVE_LOCKING=y
CONFIG_PROVE_RCU=y
# CONFIG_PROVE_RCU_REPEATEDLY is not set
CONFIG_PROVE_RCU_DELAY=y
CONFIG_SPARSE_RCU_POINTER=y
CONFIG_LOCKDEP=y
CONFIG_LOCK_STAT=y
CONFIG_DEBUG_LOCKDEP=y
CONFIG_TRACE_IRQFLAGS=y
CONFIG_DEBUG_ATOMIC_SLEEP=y
CONFIG_DEBUG_LOCKING_API_SELFTESTS=y
CONFIG_STACKTRACE=y
# CONFIG_DEBUG_STACK_USAGE is not set
CONFIG_DEBUG_KOBJECT=y
# CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_DEBUG_INFO is not set
# CONFIG_DEBUG_VM is not set
CONFIG_DEBUG_VIRTUAL=y
CONFIG_DEBUG_WRITECOUNT=y
# CONFIG_DEBUG_MEMORY_INIT is not set
CONFIG_DEBUG_LIST=y
CONFIG_TEST_LIST_SORT=y
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
CONFIG_DEBUG_CREDENTIALS=y
CONFIG_ARCH_WANT_FRAME_POINTERS=y
CONFIG_FRAME_POINTER=y
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_RCU_TRACE is not set
CONFIG_KPROBES_SANITY_TEST=y
CONFIG_BACKTRACE_SELF_TEST=m
CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
CONFIG_NOTIFIER_ERROR_INJECTION=m
# CONFIG_PM_NOTIFIER_ERROR_INJECT is not set
# CONFIG_FAULT_INJECTION is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_FENTRY=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_TRACING_SUPPORT=y
# CONFIG_FTRACE is not set
# CONFIG_RBTREE_TEST is not set
# CONFIG_INTERVAL_TREE_TEST is not set
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
CONFIG_HAVE_ARCH_KMEMCHECK=y
CONFIG_KMEMCHECK=y
# CONFIG_KMEMCHECK_DISABLED_BY_DEFAULT is not set
# CONFIG_KMEMCHECK_ENABLED_BY_DEFAULT is not set
CONFIG_KMEMCHECK_ONESHOT_BY_DEFAULT=y
CONFIG_KMEMCHECK_QUEUE_SIZE=64
CONFIG_KMEMCHECK_SHADOW_COPY_SHIFT=5
CONFIG_KMEMCHECK_PARTIAL_OK=y
CONFIG_KMEMCHECK_BITOPS_OK=y
# CONFIG_TEST_KSTRTOX is not set
# CONFIG_STRICT_DEVMEM is not set
CONFIG_X86_VERBOSE_BOOTUP=y
CONFIG_EARLY_PRINTK=y
CONFIG_DEBUG_STACKOVERFLOW=y
CONFIG_X86_PTDUMP=y
CONFIG_DEBUG_RODATA=y
# CONFIG_DEBUG_RODATA_TEST is not set
CONFIG_DEBUG_SET_MODULE_RONX=y
# CONFIG_DEBUG_NX_TEST is not set
# CONFIG_DEBUG_TLBFLUSH is not set
CONFIG_IOMMU_STRESS=y
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
# CONFIG_X86_DECODER_SELFTEST is not set
CONFIG_IO_DELAY_TYPE_0X80=0
CONFIG_IO_DELAY_TYPE_0XED=1
CONFIG_IO_DELAY_TYPE_UDELAY=2
CONFIG_IO_DELAY_TYPE_NONE=3
# CONFIG_IO_DELAY_0X80 is not set
# CONFIG_IO_DELAY_0XED is not set
# CONFIG_IO_DELAY_UDELAY is not set
CONFIG_IO_DELAY_NONE=y
CONFIG_DEFAULT_IO_DELAY_TYPE=3
# CONFIG_DEBUG_BOOT_PARAMS is not set
CONFIG_CPA_DEBUG=y
# CONFIG_OPTIMIZE_INLINING is not set
# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
# CONFIG_DEBUG_NMI_SELFTEST is not set

#
# Security options
#
CONFIG_KEYS=y
# CONFIG_ENCRYPTED_KEYS is not set
CONFIG_KEYS_DEBUG_PROC_KEYS=y
CONFIG_SECURITY_DMESG_RESTRICT=y
CONFIG_SECURITY=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_PATH=y
CONFIG_SECURITY_YAMA=y
# CONFIG_SECURITY_YAMA_STACKED is not set
# CONFIG_IMA is not set
# CONFIG_EVM is not set
CONFIG_DEFAULT_SECURITY_YAMA=y
# CONFIG_DEFAULT_SECURITY_DAC is not set
CONFIG_DEFAULT_SECURITY="yama"
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
# CONFIG_CRYPTO_FIPS is not set
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=m
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER=m
CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=m
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_PCOMP=m
CONFIG_CRYPTO_PCOMP2=y
CONFIG_CRYPTO_MANAGER=m
CONFIG_CRYPTO_MANAGER2=y
# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
CONFIG_CRYPTO_GF128MUL=m
CONFIG_CRYPTO_NULL=m
CONFIG_CRYPTO_WORKQUEUE=y
CONFIG_CRYPTO_CRYPTD=m
CONFIG_CRYPTO_AUTHENC=m
CONFIG_CRYPTO_TEST=m
CONFIG_CRYPTO_ABLK_HELPER_X86=m
CONFIG_CRYPTO_GLUE_HELPER_X86=m

#
# Authenticated Encryption with Associated Data
#
# CONFIG_CRYPTO_CCM is not set
# CONFIG_CRYPTO_GCM is not set
CONFIG_CRYPTO_SEQIV=m

#
# Block modes
#
CONFIG_CRYPTO_CBC=m
CONFIG_CRYPTO_CTR=m
CONFIG_CRYPTO_CTS=m
CONFIG_CRYPTO_ECB=m
CONFIG_CRYPTO_LRW=m
CONFIG_CRYPTO_PCBC=m
CONFIG_CRYPTO_XTS=m

#
# Hash modes
#
# CONFIG_CRYPTO_HMAC is not set
# CONFIG_CRYPTO_XCBC is not set
# CONFIG_CRYPTO_VMAC is not set

#
# Digest
#
# CONFIG_CRYPTO_CRC32C is not set
CONFIG_CRYPTO_CRC32C_X86_64=y
CONFIG_CRYPTO_CRC32C_INTEL=m
# CONFIG_CRYPTO_GHASH is not set
# CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set
# CONFIG_CRYPTO_MICHAEL_MIC is not set
# CONFIG_CRYPTO_RMD128 is not set
# CONFIG_CRYPTO_RMD160 is not set
CONFIG_CRYPTO_RMD256=m
CONFIG_CRYPTO_RMD320=m
# CONFIG_CRYPTO_SHA1 is not set
# CONFIG_CRYPTO_SHA1_SSSE3 is not set
CONFIG_CRYPTO_SHA256=y
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_TGR192 is not set
CONFIG_CRYPTO_WP512=m
CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=m

#
# Ciphers
#
CONFIG_CRYPTO_AES=m
CONFIG_CRYPTO_AES_X86_64=m
# CONFIG_CRYPTO_AES_NI_INTEL is not set
CONFIG_CRYPTO_ANUBIS=m
CONFIG_CRYPTO_ARC4=m
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_BLOWFISH_X86_64 is not set
# CONFIG_CRYPTO_CAMELLIA is not set
CONFIG_CRYPTO_CAMELLIA_X86_64=m
CONFIG_CRYPTO_CAST5=m
CONFIG_CRYPTO_CAST5_AVX_X86_64=m
CONFIG_CRYPTO_CAST6=m
CONFIG_CRYPTO_CAST6_AVX_X86_64=m
CONFIG_CRYPTO_DES=m
# CONFIG_CRYPTO_FCRYPT is not set
CONFIG_CRYPTO_KHAZAD=m
CONFIG_CRYPTO_SALSA20=m
# CONFIG_CRYPTO_SALSA20_X86_64 is not set
CONFIG_CRYPTO_SEED=m
CONFIG_CRYPTO_SERPENT=m
CONFIG_CRYPTO_SERPENT_SSE2_X86_64=m
CONFIG_CRYPTO_SERPENT_AVX_X86_64=m
# CONFIG_CRYPTO_TEA is not set
CONFIG_CRYPTO_TWOFISH=m
CONFIG_CRYPTO_TWOFISH_COMMON=m
CONFIG_CRYPTO_TWOFISH_X86_64=m
CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=m
CONFIG_CRYPTO_TWOFISH_AVX_X86_64=m

#
# Compression
#
CONFIG_CRYPTO_DEFLATE=m
CONFIG_CRYPTO_ZLIB=m
CONFIG_CRYPTO_LZO=m

#
# Random Number Generation
#
CONFIG_CRYPTO_ANSI_CPRNG=m
# CONFIG_CRYPTO_HW is not set
CONFIG_ASYMMETRIC_KEY_TYPE=y
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
CONFIG_PUBLIC_KEY_ALGO_RSA=y
CONFIG_X509_CERTIFICATE_PARSER=y
CONFIG_HAVE_KVM=y
CONFIG_VIRTUALIZATION=y
# CONFIG_BINARY_PRINTF is not set

#
# Library routines
#
CONFIG_BITREVERSE=m
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GENERIC_FIND_FIRST_BIT=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_IO=y
# CONFIG_CRC_CCITT is not set
# CONFIG_CRC16 is not set
CONFIG_CRC_T10DIF=m
CONFIG_CRC_ITU_T=m
CONFIG_CRC32=m
CONFIG_CRC32_SELFTEST=y
# CONFIG_CRC32_SLICEBY8 is not set
# CONFIG_CRC32_SLICEBY4 is not set
# CONFIG_CRC32_SARWATE is not set
CONFIG_CRC32_BIT=y
CONFIG_CRC7=m
# CONFIG_LIBCRC32C is not set
# CONFIG_CRC8 is not set
CONFIG_ZLIB_INFLATE=m
CONFIG_ZLIB_DEFLATE=m
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
# CONFIG_XZ_DEC is not set
# CONFIG_XZ_DEC_BCJ is not set
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_NLATTR=y
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
CONFIG_AVERAGE=y
CONFIG_CLZ_TAB=y
CONFIG_CORDIC=m
# CONFIG_DDR is not set
CONFIG_MPILIB=y
CONFIG_OID_REGISTRY=y

--------------010605010902080307000907
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.xen.org
http://lists.xen.org/xen-devel

--------------010605010902080307000907--


From xen-devel-bounces@lists.xen.org Thu Nov 01 19:30:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 19:30:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU0Se-0003FN-SD; Thu, 01 Nov 2012 19:29:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TU0Sd-0003FE-W0
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 19:29:52 +0000
Received: from [85.158.143.35:46403] by server-3.bemta-4.messagelabs.com id
	7C/A5-06841-FADC2905; Thu, 01 Nov 2012 19:29:51 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1351798188!5485441!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjI2Mjk2\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2909 invoked from network); 1 Nov 2012 19:29:49 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-2.tower-21.messagelabs.com with SMTP;
	1 Nov 2012 19:29:49 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga102.ch.intel.com with ESMTP; 01 Nov 2012 12:29:47 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,695,1344236400"; d="scan'208";a="212390028"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by azsmga001.ch.intel.com with ESMTP; 01 Nov 2012 12:29:40 -0700
Received: from fmsmsx119.amr.corp.intel.com (10.18.22.143) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 1 Nov 2012 12:29:39 -0700
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	fmsmsx119.amr.corp.intel.com (10.18.22.143) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 1 Nov 2012 12:29:39 -0700
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Fri, 2 Nov 2012 03:29:37 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Thread-Topic: [PATCH 02/02] Handles broken page occurred during migration
Thread-Index: AQHNuCegST9jWMNZSlWheBhAdddc/ZfU9vJQgABjrxA=
Date: Thu, 1 Nov 2012 19:29:36 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335377F80@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC82923353766A5@SHSMSX101.ccr.corp.intel.com>
	<509262EC.90108@eu.citrix.com> 
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH 02/02] Handles broken page occurred during
	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>> 
>> Given that logdirty is only enabled when we're doing some kind of
>> migration (Remus or otherwise), wouldn't it make sense to just
>> unconditionally call paging_mark_dirty(), rather than doing all this
>> stuff with vmce_monitor?  paging_mark_dirty() is already a no-op if
>> live-migration is not enabled; and if it is enabled, you probably
>> want whoever is using logdirty to go through and deal with the
>> broken page anyway.
> 
> That's just what I concerned -- can we guarantee paging log dirty
> mode only occur during live migration/remus? 
> say, under the case vram_tracking (hap_enable_vram_tracking) it also
> enable log dirty. 
> 
>> 
>> So it seems like you could just add paging_mark_dirty() to the
>> previous patch, and get rid of the rest of this patch entirely.
>> 
> 
> Currently I just find 2 cases which use log dirty mode: live
> migration/remus and vram tracking. So if we can make sure that log
> dirty would not used more in the future, it's fine to me to simplify
> my code by unconditionally call paging_mark_dirty at mce handler.   
> 
> What do you think?
> 
> Thanks,
> Jinsong

Anyway, I udpated first -- considering currently log dirty indeed only used by 2 cases (migration and vram), I simplify the code and merge 2 patches into 1. Will send out via 'hg email'.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 19:30:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 19:30:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU0Se-0003FN-SD; Thu, 01 Nov 2012 19:29:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TU0Sd-0003FE-W0
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 19:29:52 +0000
Received: from [85.158.143.35:46403] by server-3.bemta-4.messagelabs.com id
	7C/A5-06841-FADC2905; Thu, 01 Nov 2012 19:29:51 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1351798188!5485441!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjI2Mjk2\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2909 invoked from network); 1 Nov 2012 19:29:49 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-2.tower-21.messagelabs.com with SMTP;
	1 Nov 2012 19:29:49 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga102.ch.intel.com with ESMTP; 01 Nov 2012 12:29:47 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,695,1344236400"; d="scan'208";a="212390028"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by azsmga001.ch.intel.com with ESMTP; 01 Nov 2012 12:29:40 -0700
Received: from fmsmsx119.amr.corp.intel.com (10.18.22.143) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 1 Nov 2012 12:29:39 -0700
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	fmsmsx119.amr.corp.intel.com (10.18.22.143) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 1 Nov 2012 12:29:39 -0700
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Fri, 2 Nov 2012 03:29:37 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Thread-Topic: [PATCH 02/02] Handles broken page occurred during migration
Thread-Index: AQHNuCegST9jWMNZSlWheBhAdddc/ZfU9vJQgABjrxA=
Date: Thu, 1 Nov 2012 19:29:36 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335377F80@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC82923353766A5@SHSMSX101.ccr.corp.intel.com>
	<509262EC.90108@eu.citrix.com> 
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH 02/02] Handles broken page occurred during
	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>> 
>> Given that logdirty is only enabled when we're doing some kind of
>> migration (Remus or otherwise), wouldn't it make sense to just
>> unconditionally call paging_mark_dirty(), rather than doing all this
>> stuff with vmce_monitor?  paging_mark_dirty() is already a no-op if
>> live-migration is not enabled; and if it is enabled, you probably
>> want whoever is using logdirty to go through and deal with the
>> broken page anyway.
> 
> That's just what I concerned -- can we guarantee paging log dirty
> mode only occur during live migration/remus? 
> say, under the case vram_tracking (hap_enable_vram_tracking) it also
> enable log dirty. 
> 
>> 
>> So it seems like you could just add paging_mark_dirty() to the
>> previous patch, and get rid of the rest of this patch entirely.
>> 
> 
> Currently I just find 2 cases which use log dirty mode: live
> migration/remus and vram tracking. So if we can make sure that log
> dirty would not used more in the future, it's fine to me to simplify
> my code by unconditionally call paging_mark_dirty at mce handler.   
> 
> What do you think?
> 
> Thanks,
> Jinsong

Anyway, I udpated first -- considering currently log dirty indeed only used by 2 cases (migration and vram), I simplify the code and merge 2 patches into 1. Will send out via 'hg email'.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 19:33:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 19:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU0Vg-0003NG-FO; Thu, 01 Nov 2012 19:33:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TU0Ve-0003NA-VP
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 19:32:59 +0000
Received: from [85.158.143.99:54509] by server-3.bemta-4.messagelabs.com id
	69/57-06841-A6EC2905; Thu, 01 Nov 2012 19:32:58 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1351798376!22961470!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjI2Mjk2\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10249 invoked from network); 1 Nov 2012 19:32:57 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-2.tower-216.messagelabs.com with SMTP;
	1 Nov 2012 19:32:57 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga102.ch.intel.com with ESMTP; 01 Nov 2012 12:32:55 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,695,1344236400"; d="scan'208";a="212391095"
Received: from ljsromley.bj.intel.com ([10.240.192.102])
	by azsmga001.ch.intel.com with ESMTP; 01 Nov 2012 12:32:54 -0700
MIME-Version: 1.0
X-Mercurial-Node: 730dd3f22a12fd97814b54fb337e018b7c2bc83c
Message-Id: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
User-Agent: Mercurial-patchbomb/1.4
Date: Fri, 02 Nov 2012 11:25:29 +0800
From: Liu Jinsong <jinsong.liu@intel.com>
To: george.dunlap@eu.citrix.com, ian.jackson@eu.citrix.com, jbeulich@suse.com
Cc: xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH] Handle broken page with regard to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Generally, there are 2 cases:
1. broken page occurs before migration
2. broken page occurs during migration

At the sender
  for case 1, the broken page would be mapped but not copied to target
  (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number would be transferred to target
  so that target take appropriate action.

  for case 2, mce handler marks the broken page to dirty bitmap, so that
  at copypages stage of migration, its pfn_type and pfn number would be
  transferred to target and then take appropriate action.

At the target
  it would set p2m as p2m_ram_broken for broken page, so that if guest
  access the broken page again, it would kill itself as expected.

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/tools/libxc/xc_domain.c	Fri Nov 02 11:08:37 2012 +0800
@@ -283,6 +283,22 @@
     return ret;
 }
 
+/* set broken page p2m */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn)
+{
+    int ret;
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
+    domctl.domain = (domid_t)domid;
+    domctl.u.set_broken_page_p2m.pfn = pfn;
+    ret = do_domctl(xch, &domctl);
+
+    return ret ? -1 : 0;
+}
+
 /* get info from hvm guest for save */
 int xc_domain_hvm_getcontext(xc_interface *xch,
                              uint32_t domid,
diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/tools/libxc/xc_domain_restore.c	Fri Nov 02 11:08:37 2012 +0800
@@ -962,9 +962,15 @@
 
     countpages = count;
     for (i = oldcount; i < buf->nr_pages; ++i)
-        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
-            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
+    {
+        unsigned long pagetype;
+
+        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
+        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
+             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
+             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
             --countpages;
+    }
 
     if (!countpages)
         return count;
@@ -1200,6 +1206,17 @@
             /* a bogus/unmapped/allocate-only page: skip it */
             continue;
 
+        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
+        {
+            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
+            {
+                ERROR("Set p2m for broken page failed, "
+                      "dom=%d, pfn=%lx\n", dom, pfn);
+                goto err_mapped;
+            }
+            continue;
+        }
+
         if (pfn_err[i])
         {
             ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/tools/libxc/xc_domain_save.c	Fri Nov 02 11:08:37 2012 +0800
@@ -1277,6 +1277,13 @@
                 if ( !hvm )
                     gmfn = pfn_to_mfn(gmfn);
 
+                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                {
+                    pfn_type[j] |= pfn_batch[j];
+                    ++run;
+                    continue;
+                }
+
                 if ( pfn_err[j] )
                 {
                     if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
@@ -1371,8 +1378,12 @@
                     }
                 }
 
-                /* skip pages that aren't present or are alloc-only */
+                /*
+                 * skip pages that aren't present,
+                 * or are broken, or are alloc-only
+                 */
                 if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
+                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
                     || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
                     continue;
 
diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Fri Nov 02 11:08:37 2012 +0800
+++ b/tools/libxc/xenctrl.h	Fri Nov 02 11:08:37 2012 +0800
@@ -575,6 +575,17 @@
                           xc_domaininfo_t *info);
 
 /**
+ * This function set p2m for broken page
+ * &parm xch a handle to an open hypervisor interface
+ * @parm domid the domain id which broken page belong to
+ * @parm pfn the pfn number of the broken page
+ * @return 0 on success, -1 on failure
+ */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn);
+
+/**
  * This function returns information about the context of a hvm domain
  * @parm xch a handle to an open hypervisor interface
  * @parm domid the domain to get information from
diff -r d675797494bd -r 730dd3f22a12 xen/arch/x86/cpu/mcheck/mcaction.c
--- a/xen/arch/x86/cpu/mcheck/mcaction.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Fri Nov 02 11:08:37 2012 +0800
@@ -1,5 +1,6 @@
 #include <xen/types.h>
 #include <xen/sched.h>
+#include <asm/p2m.h>
 #include "mcaction.h"
 #include "vmce.h"
 #include "mce.h"
@@ -91,6 +92,24 @@
                     goto vmce_failed;
                 }
 
+                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram &&
+                     paging_mode_log_dirty(d) )
+                {
+                    /*
+                     * vMCE occur during migration
+                     *
+                     *   At sender, it marks broken page to dirty bitmap,
+                     *   so that at copypages stage of migration, brokan
+                     *   page's pfn_type and pfn number would be transferred
+                     *   to target and then take appropriate action.
+                     *
+                     *   At target, it would set p2m as p2m_ram_broken for
+                     *   broken page, so that if guest access the broken page
+                     *   again, it would kill itself as expected.
+                     */
+                    paging_mark_dirty(d, mfn);
+                }
+
                 if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
                 {
                     printk("Unmap broken memory %lx for DOM%d failed\n",
diff -r d675797494bd -r 730dd3f22a12 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/xen/arch/x86/domctl.c	Fri Nov 02 11:08:37 2012 +0800
@@ -209,12 +209,18 @@
                 for ( j = 0; j < k; j++ )
                 {
                     unsigned long type = 0;
+                    p2m_type_t t;
 
-                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
+                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
 
                     if ( unlikely(!page) ||
                          unlikely(is_xen_heap_page(page)) )
-                        type = XEN_DOMCTL_PFINFO_XTAB;
+                    {
+                        if ( p2m_is_broken(t) )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
+                        else
+                            type = XEN_DOMCTL_PFINFO_XTAB;
+                    }
                     else
                     {
                         switch( page->u.inuse.type_info & PGT_type_mask )
@@ -235,6 +241,9 @@
 
                         if ( page->u.inuse.type_info & PGT_pinned )
                             type |= XEN_DOMCTL_PFINFO_LPINTAB;
+
+                        if ( page->count_info & PGC_broken )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
                     }
 
                     if ( page )
@@ -1568,6 +1577,29 @@
     }
     break;
 
+    case XEN_DOMCTL_set_broken_page_p2m:
+    {
+        struct domain *d;
+        
+        d = rcu_lock_domain_by_id(domctl->domain);
+        if ( d != NULL )
+        {
+            p2m_type_t pt;
+            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
+            mfn_t mfn = get_gfn_query(d, pfn, &pt);
+
+            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
+                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
+                ret = -EINVAL;
+
+            put_gfn(d, pfn);
+            rcu_unlock_domain(d);
+        }
+        else
+            ret = -ESRCH;
+    }
+    break;
+
     default:
         ret = iommu_do_domctl(domctl, u_domctl);
         break;
diff -r d675797494bd -r 730dd3f22a12 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Fri Nov 02 11:08:37 2012 +0800
+++ b/xen/include/public/domctl.h	Fri Nov 02 11:08:37 2012 +0800
@@ -136,6 +136,7 @@
 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
 #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
 #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
+#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
 #define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
 
@@ -835,6 +836,12 @@
 typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
 
+struct xen_domctl_set_broken_page_p2m {
+    uint64_aligned_t pfn;
+};
+typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -900,6 +907,7 @@
 #define XEN_DOMCTL_set_access_required           64
 #define XEN_DOMCTL_audit_p2m                     65
 #define XEN_DOMCTL_set_virq_handler              66
+#define XEN_DOMCTL_set_broken_page_p2m           67
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -955,6 +963,7 @@
         struct xen_domctl_audit_p2m         audit_p2m;
         struct xen_domctl_set_virq_handler  set_virq_handler;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
+        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
         uint8_t                             pad[128];

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 19:33:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 19:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU0Vg-0003NG-FO; Thu, 01 Nov 2012 19:33:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TU0Ve-0003NA-VP
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 19:32:59 +0000
Received: from [85.158.143.99:54509] by server-3.bemta-4.messagelabs.com id
	69/57-06841-A6EC2905; Thu, 01 Nov 2012 19:32:58 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1351798376!22961470!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjI2Mjk2\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10249 invoked from network); 1 Nov 2012 19:32:57 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-2.tower-216.messagelabs.com with SMTP;
	1 Nov 2012 19:32:57 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga102.ch.intel.com with ESMTP; 01 Nov 2012 12:32:55 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,695,1344236400"; d="scan'208";a="212391095"
Received: from ljsromley.bj.intel.com ([10.240.192.102])
	by azsmga001.ch.intel.com with ESMTP; 01 Nov 2012 12:32:54 -0700
MIME-Version: 1.0
X-Mercurial-Node: 730dd3f22a12fd97814b54fb337e018b7c2bc83c
Message-Id: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
User-Agent: Mercurial-patchbomb/1.4
Date: Fri, 02 Nov 2012 11:25:29 +0800
From: Liu Jinsong <jinsong.liu@intel.com>
To: george.dunlap@eu.citrix.com, ian.jackson@eu.citrix.com, jbeulich@suse.com
Cc: xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH] Handle broken page with regard to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Generally, there are 2 cases:
1. broken page occurs before migration
2. broken page occurs during migration

At the sender
  for case 1, the broken page would be mapped but not copied to target
  (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number would be transferred to target
  so that target take appropriate action.

  for case 2, mce handler marks the broken page to dirty bitmap, so that
  at copypages stage of migration, its pfn_type and pfn number would be
  transferred to target and then take appropriate action.

At the target
  it would set p2m as p2m_ram_broken for broken page, so that if guest
  access the broken page again, it would kill itself as expected.

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/tools/libxc/xc_domain.c	Fri Nov 02 11:08:37 2012 +0800
@@ -283,6 +283,22 @@
     return ret;
 }
 
+/* set broken page p2m */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn)
+{
+    int ret;
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
+    domctl.domain = (domid_t)domid;
+    domctl.u.set_broken_page_p2m.pfn = pfn;
+    ret = do_domctl(xch, &domctl);
+
+    return ret ? -1 : 0;
+}
+
 /* get info from hvm guest for save */
 int xc_domain_hvm_getcontext(xc_interface *xch,
                              uint32_t domid,
diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/tools/libxc/xc_domain_restore.c	Fri Nov 02 11:08:37 2012 +0800
@@ -962,9 +962,15 @@
 
     countpages = count;
     for (i = oldcount; i < buf->nr_pages; ++i)
-        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
-            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
+    {
+        unsigned long pagetype;
+
+        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
+        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
+             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
+             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
             --countpages;
+    }
 
     if (!countpages)
         return count;
@@ -1200,6 +1206,17 @@
             /* a bogus/unmapped/allocate-only page: skip it */
             continue;
 
+        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
+        {
+            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
+            {
+                ERROR("Set p2m for broken page failed, "
+                      "dom=%d, pfn=%lx\n", dom, pfn);
+                goto err_mapped;
+            }
+            continue;
+        }
+
         if (pfn_err[i])
         {
             ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/tools/libxc/xc_domain_save.c	Fri Nov 02 11:08:37 2012 +0800
@@ -1277,6 +1277,13 @@
                 if ( !hvm )
                     gmfn = pfn_to_mfn(gmfn);
 
+                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                {
+                    pfn_type[j] |= pfn_batch[j];
+                    ++run;
+                    continue;
+                }
+
                 if ( pfn_err[j] )
                 {
                     if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
@@ -1371,8 +1378,12 @@
                     }
                 }
 
-                /* skip pages that aren't present or are alloc-only */
+                /*
+                 * skip pages that aren't present,
+                 * or are broken, or are alloc-only
+                 */
                 if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
+                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
                     || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
                     continue;
 
diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Fri Nov 02 11:08:37 2012 +0800
+++ b/tools/libxc/xenctrl.h	Fri Nov 02 11:08:37 2012 +0800
@@ -575,6 +575,17 @@
                           xc_domaininfo_t *info);
 
 /**
+ * This function set p2m for broken page
+ * &parm xch a handle to an open hypervisor interface
+ * @parm domid the domain id which broken page belong to
+ * @parm pfn the pfn number of the broken page
+ * @return 0 on success, -1 on failure
+ */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn);
+
+/**
  * This function returns information about the context of a hvm domain
  * @parm xch a handle to an open hypervisor interface
  * @parm domid the domain to get information from
diff -r d675797494bd -r 730dd3f22a12 xen/arch/x86/cpu/mcheck/mcaction.c
--- a/xen/arch/x86/cpu/mcheck/mcaction.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Fri Nov 02 11:08:37 2012 +0800
@@ -1,5 +1,6 @@
 #include <xen/types.h>
 #include <xen/sched.h>
+#include <asm/p2m.h>
 #include "mcaction.h"
 #include "vmce.h"
 #include "mce.h"
@@ -91,6 +92,24 @@
                     goto vmce_failed;
                 }
 
+                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram &&
+                     paging_mode_log_dirty(d) )
+                {
+                    /*
+                     * vMCE occur during migration
+                     *
+                     *   At sender, it marks broken page to dirty bitmap,
+                     *   so that at copypages stage of migration, brokan
+                     *   page's pfn_type and pfn number would be transferred
+                     *   to target and then take appropriate action.
+                     *
+                     *   At target, it would set p2m as p2m_ram_broken for
+                     *   broken page, so that if guest access the broken page
+                     *   again, it would kill itself as expected.
+                     */
+                    paging_mark_dirty(d, mfn);
+                }
+
                 if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
                 {
                     printk("Unmap broken memory %lx for DOM%d failed\n",
diff -r d675797494bd -r 730dd3f22a12 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/xen/arch/x86/domctl.c	Fri Nov 02 11:08:37 2012 +0800
@@ -209,12 +209,18 @@
                 for ( j = 0; j < k; j++ )
                 {
                     unsigned long type = 0;
+                    p2m_type_t t;
 
-                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
+                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
 
                     if ( unlikely(!page) ||
                          unlikely(is_xen_heap_page(page)) )
-                        type = XEN_DOMCTL_PFINFO_XTAB;
+                    {
+                        if ( p2m_is_broken(t) )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
+                        else
+                            type = XEN_DOMCTL_PFINFO_XTAB;
+                    }
                     else
                     {
                         switch( page->u.inuse.type_info & PGT_type_mask )
@@ -235,6 +241,9 @@
 
                         if ( page->u.inuse.type_info & PGT_pinned )
                             type |= XEN_DOMCTL_PFINFO_LPINTAB;
+
+                        if ( page->count_info & PGC_broken )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
                     }
 
                     if ( page )
@@ -1568,6 +1577,29 @@
     }
     break;
 
+    case XEN_DOMCTL_set_broken_page_p2m:
+    {
+        struct domain *d;
+        
+        d = rcu_lock_domain_by_id(domctl->domain);
+        if ( d != NULL )
+        {
+            p2m_type_t pt;
+            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
+            mfn_t mfn = get_gfn_query(d, pfn, &pt);
+
+            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
+                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
+                ret = -EINVAL;
+
+            put_gfn(d, pfn);
+            rcu_unlock_domain(d);
+        }
+        else
+            ret = -ESRCH;
+    }
+    break;
+
     default:
         ret = iommu_do_domctl(domctl, u_domctl);
         break;
diff -r d675797494bd -r 730dd3f22a12 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Fri Nov 02 11:08:37 2012 +0800
+++ b/xen/include/public/domctl.h	Fri Nov 02 11:08:37 2012 +0800
@@ -136,6 +136,7 @@
 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
 #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
 #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
+#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
 #define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
 
@@ -835,6 +836,12 @@
 typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
 
+struct xen_domctl_set_broken_page_p2m {
+    uint64_aligned_t pfn;
+};
+typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -900,6 +907,7 @@
 #define XEN_DOMCTL_set_access_required           64
 #define XEN_DOMCTL_audit_p2m                     65
 #define XEN_DOMCTL_set_virq_handler              66
+#define XEN_DOMCTL_set_broken_page_p2m           67
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -955,6 +963,7 @@
         struct xen_domctl_audit_p2m         audit_p2m;
         struct xen_domctl_set_virq_handler  set_virq_handler;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
+        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
         uint8_t                             pad[128];

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 19:58:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 19:58:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU0tT-0003yh-R2; Thu, 01 Nov 2012 19:57:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jbeulich@suse.com>) id 1TU0tS-0003yc-Cw
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 19:57:34 +0000
Received: from [85.158.138.51:15829] by server-5.bemta-3.messagelabs.com id
	F4/3E-26311-D24D2905; Thu, 01 Nov 2012 19:57:33 +0000
X-Env-Sender: jbeulich@suse.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1351799852!19439493!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5036 invoked from network); 1 Nov 2012 19:57:33 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-174.messagelabs.com with SMTP;
	1 Nov 2012 19:57:33 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 01 Nov 2012 19:57:31 +0000
Message-Id: <5092D42A020000780008EB7B@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 01 Nov 2012 19:57:30 +0000
From: "Jan Beulich" <jbeulich@suse.com>
To: <stefano.stabellini@eu.citrix.com>
References: <504F3355.2070201@tiscali.it>
	<504F5182020000780009A9CC@nat28.tlf.novell.com>
	<504F39F0.10701@tiscali.it>
	<504F625D020000780009AA85@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
In-Reply-To: <alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: konrad.wilk@oracle.com, george.dunlap@citrix.com, fantonifabio@tiscali.it,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Start xen on UEFI system with grub
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> Stefano Stabellini <stefano.stabellini@eu.citrix.com> 11/01/12 4:50 PM >>>
>On Tue, 11 Sep 2012, Jan Beulich wrote:
>> >>> On 11.09.12 at 15:17, Fabio Fantoni <fantonifabio@tiscali.it> wrote:
>> > xen.efi not compile when we build xen on Wheezy and probably is not 
>> > possible boot with lvm volume, fallback options ecc...
>> 
>> Just get a suitable tool chain installed then.
>> 
>> > UEFI with grub2 seem the best option but with xen hypervisor seem not 
>> > load efi variable.
>> 
>> Sure, because only xen.efi has the code to deal with such.
>> 
>> (Btw., I assume you aren't aware that any boot manager
>> whatsoever, other than the one coming with EFI, is sort of
>> bogus under EFI?)
>
>Unfortunately it looks like more and more people are of the opinion that
>grub2 is useful even on UEFI firmware.
>For example, it is pretty clear that Ubuntu is still going to boot Xen
>via grub2 no matter how the firmware looks like.

Then they need to be tought how to do it properly, the more that Linux itself
now is capable of booting without a boot loader (other than the EFI one).

>What would it take to make Xen work properly with grub2 on a UEFI firmware?

I can't be that difficult.

>I think that we should add it as a work item for Xen 4.3.

If you have someone to do that work. I'm willing to review the resulting
changes, but I currently don't see me doing anything here (as being totally
unimportant and - just to repeat that - conceptually wrong).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 19:58:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 19:58:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU0tT-0003yh-R2; Thu, 01 Nov 2012 19:57:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jbeulich@suse.com>) id 1TU0tS-0003yc-Cw
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 19:57:34 +0000
Received: from [85.158.138.51:15829] by server-5.bemta-3.messagelabs.com id
	F4/3E-26311-D24D2905; Thu, 01 Nov 2012 19:57:33 +0000
X-Env-Sender: jbeulich@suse.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1351799852!19439493!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5036 invoked from network); 1 Nov 2012 19:57:33 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-174.messagelabs.com with SMTP;
	1 Nov 2012 19:57:33 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 01 Nov 2012 19:57:31 +0000
Message-Id: <5092D42A020000780008EB7B@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 01 Nov 2012 19:57:30 +0000
From: "Jan Beulich" <jbeulich@suse.com>
To: <stefano.stabellini@eu.citrix.com>
References: <504F3355.2070201@tiscali.it>
	<504F5182020000780009A9CC@nat28.tlf.novell.com>
	<504F39F0.10701@tiscali.it>
	<504F625D020000780009AA85@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
In-Reply-To: <alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: konrad.wilk@oracle.com, george.dunlap@citrix.com, fantonifabio@tiscali.it,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Start xen on UEFI system with grub
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> Stefano Stabellini <stefano.stabellini@eu.citrix.com> 11/01/12 4:50 PM >>>
>On Tue, 11 Sep 2012, Jan Beulich wrote:
>> >>> On 11.09.12 at 15:17, Fabio Fantoni <fantonifabio@tiscali.it> wrote:
>> > xen.efi not compile when we build xen on Wheezy and probably is not 
>> > possible boot with lvm volume, fallback options ecc...
>> 
>> Just get a suitable tool chain installed then.
>> 
>> > UEFI with grub2 seem the best option but with xen hypervisor seem not 
>> > load efi variable.
>> 
>> Sure, because only xen.efi has the code to deal with such.
>> 
>> (Btw., I assume you aren't aware that any boot manager
>> whatsoever, other than the one coming with EFI, is sort of
>> bogus under EFI?)
>
>Unfortunately it looks like more and more people are of the opinion that
>grub2 is useful even on UEFI firmware.
>For example, it is pretty clear that Ubuntu is still going to boot Xen
>via grub2 no matter how the firmware looks like.

Then they need to be tought how to do it properly, the more that Linux itself
now is capable of booting without a boot loader (other than the EFI one).

>What would it take to make Xen work properly with grub2 on a UEFI firmware?

I can't be that difficult.

>I think that we should add it as a work item for Xen 4.3.

If you have someone to do that work. I'm willing to review the resulting
changes, but I currently don't see me doing anything here (as being totally
unimportant and - just to repeat that - conceptually wrong).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:05:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:05:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU10h-0004H3-OM; Thu, 01 Nov 2012 20:05:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jbeulich@suse.com>) id 1TU10g-0004Gy-JU
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 20:05:02 +0000
Received: from [85.158.138.51:11643] by server-7.bemta-3.messagelabs.com id
	42/DE-01713-DE5D2905; Thu, 01 Nov 2012 20:05:01 +0000
X-Env-Sender: jbeulich@suse.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1351800301!9652787!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13948 invoked from network); 1 Nov 2012 20:05:01 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-174.messagelabs.com with SMTP;
	1 Nov 2012 20:05:01 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 01 Nov 2012 20:05:00 +0000
Message-Id: <5092D5EA020000780008EB85@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 01 Nov 2012 20:04:58 +0000
From: "Jan Beulich" <jbeulich@suse.com>
To: <rientjes@google.com>,<konrad.wilk@oracle.com>
References: <alpine.DEB.2.00.1210312239120.31758@chino.kir.corp.google.com>
	<20121101124912.GA10743@localhost.localdomain>
In-Reply-To: <20121101124912.GA10743@localhost.localdomain>
Mime-Version: 1.0
Content-Disposition: inline
Cc: jeremy@goop.org, xen-devel@lists.xensource.com, x86@kernel.org,
	linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com,
	tglx@linutronix.de, torvalds@linux-foundation.org
Subject: Re: [Xen-devel] [patch] x86,
 xen: fix build dependency when USB_SUPPORT is not enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> 11/01/12 1:49 PM >>>
>On Wed, Oct 31, 2012 at 10:42:30PM -0700, David Rientjes wrote:
>> CONFIG_XEN_DOM0 must depend on CONFIG_USB_SUPPORT, otherwise there is no 
>> definition of xen_dbgp_reset_prep() and xen_dbgp_external_startup() 
>> resulting in the following link error:
>> 
>> drivers/built-in.o: In function `dbgp_reset_prep':
>> (.text+0x1e03c5): undefined reference to `xen_dbgp_reset_prep'
>> drivers/built-in.o: In function `dbgp_external_startup':
>> (.text+0x1e0d55): undefined reference to `xen_dbgp_external_startup'
>
>There is another patch that needs to be Acked and picked up by
>Greg KH that fixes this.
>
>Let me poke Jan Beulich to repost it with the appropiate Acks.

It's been picked up already, but another dependency problem was found with
it (due to not having used CONFIG_USB_SUPPORT as dependency, as I had
first submitted).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:05:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:05:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU10h-0004H3-OM; Thu, 01 Nov 2012 20:05:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jbeulich@suse.com>) id 1TU10g-0004Gy-JU
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 20:05:02 +0000
Received: from [85.158.138.51:11643] by server-7.bemta-3.messagelabs.com id
	42/DE-01713-DE5D2905; Thu, 01 Nov 2012 20:05:01 +0000
X-Env-Sender: jbeulich@suse.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1351800301!9652787!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13948 invoked from network); 1 Nov 2012 20:05:01 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-174.messagelabs.com with SMTP;
	1 Nov 2012 20:05:01 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 01 Nov 2012 20:05:00 +0000
Message-Id: <5092D5EA020000780008EB85@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 01 Nov 2012 20:04:58 +0000
From: "Jan Beulich" <jbeulich@suse.com>
To: <rientjes@google.com>,<konrad.wilk@oracle.com>
References: <alpine.DEB.2.00.1210312239120.31758@chino.kir.corp.google.com>
	<20121101124912.GA10743@localhost.localdomain>
In-Reply-To: <20121101124912.GA10743@localhost.localdomain>
Mime-Version: 1.0
Content-Disposition: inline
Cc: jeremy@goop.org, xen-devel@lists.xensource.com, x86@kernel.org,
	linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com,
	tglx@linutronix.de, torvalds@linux-foundation.org
Subject: Re: [Xen-devel] [patch] x86,
 xen: fix build dependency when USB_SUPPORT is not enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> 11/01/12 1:49 PM >>>
>On Wed, Oct 31, 2012 at 10:42:30PM -0700, David Rientjes wrote:
>> CONFIG_XEN_DOM0 must depend on CONFIG_USB_SUPPORT, otherwise there is no 
>> definition of xen_dbgp_reset_prep() and xen_dbgp_external_startup() 
>> resulting in the following link error:
>> 
>> drivers/built-in.o: In function `dbgp_reset_prep':
>> (.text+0x1e03c5): undefined reference to `xen_dbgp_reset_prep'
>> drivers/built-in.o: In function `dbgp_external_startup':
>> (.text+0x1e0d55): undefined reference to `xen_dbgp_external_startup'
>
>There is another patch that needs to be Acked and picked up by
>Greg KH that fixes this.
>
>Let me poke Jan Beulich to repost it with the appropiate Acks.

It's been picked up already, but another dependency problem was found with
it (due to not having used CONFIG_USB_SUPPORT as dependency, as I had
first submitted).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:20:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:20:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1Fg-0004dA-AT; Thu, 01 Nov 2012 20:20:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TU1Fe-0004d5-7q
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 20:20:30 +0000
Received: from [85.158.139.83:4565] by server-16.bemta-5.messagelabs.com id
	34/2A-04786-D89D2905; Thu, 01 Nov 2012 20:20:29 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1351801227!24077995!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY4ODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11183 invoked from network); 1 Nov 2012 20:20:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 20:20:28 -0000
X-IronPort-AV: E=Sophos;i="4.80,695,1344211200"; d="scan'208";a="15545742"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 20:20:26 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 1 Nov 2012 20:20:26 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TU1Fa-000622-Eq;
	Thu, 01 Nov 2012 20:20:26 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TU1Fa-0001Ct-E6;
	Thu, 01 Nov 2012 20:20:26 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <E1TU1Fa-0001Ct-E6@woking.cam.xci-test.com>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 1 Nov 2012 20:20:26 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com, keir@xen.org, stefano.stabellini@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing bisection] complete
	test-i386-i386-xl-qemuu-winxpsp3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

branch xen-4.2-testing
xen branch xen-4.2-testing
job test-i386-i386-xl-qemuu-winxpsp3
test windows-install

Tree: linux git://xenbits.xen.org/linux-pvops.git
Tree: qemu git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
  Bug introduced:  051e2a30e3fb
  Bug not present: c23d938e3e64


  changeset:   25886:051e2a30e3fb
  user:        Ian Campbell <Ian.Campbell@citrix.com>
  date:        Fri Oct 26 16:40:18 2012 +0100
      
      libxl: handle errors from xc_sharing_* info functions
      
      On a 32 bit hypervisor xl info currently reports:
      sharing_freed_memory   : 72057594037927935
      sharing_used_memory    : 72057594037927935
      
      Eat the ENOSYS and turn it into 0. Log and propagate other errors.
      
      I don't have a 32 bit system handy, so tested on x86_64 with a libxc
      hacked to return -ENOSYS and -EINVAL.
      
      Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
      Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
      Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
      Committed-by: Ian Campbell <ian.campbell@citrix.com>
      
      xen-unstable changeset: 25894:95a971c8058f
      Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
      Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
      
      


For bisection revision-tuple graph see:
   http://www.chiark.greenend.org.uk/~xensrcts/results/bisect.xen-4.2-testing.test-i386-i386-xl-qemuu-winxpsp3.windows-install.html
Revision IDs in each graph node refer, respectively, to the Trees above.

----------------------------------------
Searching for failure / basis pass:
 14280 fail [host=bush-cricket] / 14076 ok.
Failure / basis pass flights: 14280 / 14076
Tree: linux git://xenbits.xen.org/linux-pvops.git
Tree: qemu git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
Latest a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
Basis pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 40ccbee890e1
Generating revisions with ./adhoc-revtuple-generator  git://xenbits.xen.org/linux-pvops.git#a938a246d34912423c560f475ccf1ce0c71d9d00-a938a246d34912423c560f475ccf1ce0c71d9d00 git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git#bacc0d302445c75f18f4c826750fb5853b60e7ca-bacc0d302445c75f18f4c826750fb5853b60e7ca git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git#cdf4d2bb4006805f209712fbb8ed1f83127e9984-cdf4d2bb4006805f209712fbb8ed1f83127e9984 http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg#40ccbee890e1-2bca7e58a3df
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-4.2-testing.hg
searching for changes
no changes found
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-4.2-testing.hg
searching for changes
no changes found
Loaded 1001 nodes in revision graph
Searching for test results:
 14076 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 40ccbee890e1
 14160 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14150 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14153 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14156 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14186 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14173 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14295 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 40ccbee890e1
 14296 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14192 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14297 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 87900aea9c6b
 14280 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14300 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27312134166b
 14301 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 c23d938e3e64
 14327 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 051e2a30e3fb
 14305 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 051e2a30e3fb
 14309 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 c23d938e3e64
 14328 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 c23d938e3e64
 14330 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 051e2a30e3fb
Searching for interesting versions
 Result found: flight 14076 (pass), for basis pass
 Result found: flight 14150 (fail), for basis failure
 Repro found: flight 14295 (pass), for basis pass
 Repro found: flight 14296 (fail), for basis failure
 0 revisions at a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 c23d938e3e64
No revisions left to test, checking graph state.
 Result found: flight 14301 (pass), for last pass
 Result found: flight 14305 (fail), for first failure
 Repro found: flight 14309 (pass), for last pass
 Repro found: flight 14327 (fail), for first failure
 Repro found: flight 14328 (pass), for last pass
 Repro found: flight 14330 (fail), for first failure

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
  Bug introduced:  051e2a30e3fb
  Bug not present: c23d938e3e64

pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-4.2-testing.hg
searching for changes
no changes found

  changeset:   25886:051e2a30e3fb
  user:        Ian Campbell <Ian.Campbell@citrix.com>
  date:        Fri Oct 26 16:40:18 2012 +0100
      
      libxl: handle errors from xc_sharing_* info functions
      
      On a 32 bit hypervisor xl info currently reports:
      sharing_freed_memory   : 72057594037927935
      sharing_used_memory    : 72057594037927935
      
      Eat the ENOSYS and turn it into 0. Log and propagate other errors.
      
      I don't have a 32 bit system handy, so tested on x86_64 with a libxc
      hacked to return -ENOSYS and -EINVAL.
      
      Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
      Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
      Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
      Committed-by: Ian Campbell <ian.campbell@citrix.com>
      
      xen-unstable changeset: 25894:95a971c8058f
      Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
      Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
      
      

Revision graph left in /home/xc_osstest/results/bisect.xen-4.2-testing.test-i386-i386-xl-qemuu-winxpsp3.windows-install.{dot,ps,png,html}.
----------------------------------------
14330: tolerable ALL FAIL

flight 14330 xen-4.2-testing real-bisect [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14330/

Failures :-/ but no regressions.

Tests which did not succeed,
including tests which could not be run:
 test-i386-i386-xl-qemuu-winxpsp3  7 windows-install     fail baseline untested


jobs:
 test-i386-i386-xl-qemuu-winxpsp3                             fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:20:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:20:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1Fg-0004dA-AT; Thu, 01 Nov 2012 20:20:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TU1Fe-0004d5-7q
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 20:20:30 +0000
Received: from [85.158.139.83:4565] by server-16.bemta-5.messagelabs.com id
	34/2A-04786-D89D2905; Thu, 01 Nov 2012 20:20:29 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1351801227!24077995!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY4ODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11183 invoked from network); 1 Nov 2012 20:20:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 20:20:28 -0000
X-IronPort-AV: E=Sophos;i="4.80,695,1344211200"; d="scan'208";a="15545742"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 20:20:26 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 1 Nov 2012 20:20:26 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TU1Fa-000622-Eq;
	Thu, 01 Nov 2012 20:20:26 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TU1Fa-0001Ct-E6;
	Thu, 01 Nov 2012 20:20:26 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <E1TU1Fa-0001Ct-E6@woking.cam.xci-test.com>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 1 Nov 2012 20:20:26 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com, keir@xen.org, stefano.stabellini@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing bisection] complete
	test-i386-i386-xl-qemuu-winxpsp3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

branch xen-4.2-testing
xen branch xen-4.2-testing
job test-i386-i386-xl-qemuu-winxpsp3
test windows-install

Tree: linux git://xenbits.xen.org/linux-pvops.git
Tree: qemu git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
  Bug introduced:  051e2a30e3fb
  Bug not present: c23d938e3e64


  changeset:   25886:051e2a30e3fb
  user:        Ian Campbell <Ian.Campbell@citrix.com>
  date:        Fri Oct 26 16:40:18 2012 +0100
      
      libxl: handle errors from xc_sharing_* info functions
      
      On a 32 bit hypervisor xl info currently reports:
      sharing_freed_memory   : 72057594037927935
      sharing_used_memory    : 72057594037927935
      
      Eat the ENOSYS and turn it into 0. Log and propagate other errors.
      
      I don't have a 32 bit system handy, so tested on x86_64 with a libxc
      hacked to return -ENOSYS and -EINVAL.
      
      Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
      Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
      Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
      Committed-by: Ian Campbell <ian.campbell@citrix.com>
      
      xen-unstable changeset: 25894:95a971c8058f
      Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
      Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
      
      


For bisection revision-tuple graph see:
   http://www.chiark.greenend.org.uk/~xensrcts/results/bisect.xen-4.2-testing.test-i386-i386-xl-qemuu-winxpsp3.windows-install.html
Revision IDs in each graph node refer, respectively, to the Trees above.

----------------------------------------
Searching for failure / basis pass:
 14280 fail [host=bush-cricket] / 14076 ok.
Failure / basis pass flights: 14280 / 14076
Tree: linux git://xenbits.xen.org/linux-pvops.git
Tree: qemu git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
Latest a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
Basis pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 40ccbee890e1
Generating revisions with ./adhoc-revtuple-generator  git://xenbits.xen.org/linux-pvops.git#a938a246d34912423c560f475ccf1ce0c71d9d00-a938a246d34912423c560f475ccf1ce0c71d9d00 git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git#bacc0d302445c75f18f4c826750fb5853b60e7ca-bacc0d302445c75f18f4c826750fb5853b60e7ca git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git#cdf4d2bb4006805f209712fbb8ed1f83127e9984-cdf4d2bb4006805f209712fbb8ed1f83127e9984 http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg#40ccbee890e1-2bca7e58a3df
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-4.2-testing.hg
searching for changes
no changes found
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-4.2-testing.hg
searching for changes
no changes found
Loaded 1001 nodes in revision graph
Searching for test results:
 14076 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 40ccbee890e1
 14160 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14150 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14153 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14156 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14186 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14173 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14295 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 40ccbee890e1
 14296 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14192 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14297 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 87900aea9c6b
 14280 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 2bca7e58a3df
 14300 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 27312134166b
 14301 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 c23d938e3e64
 14327 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 051e2a30e3fb
 14305 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 051e2a30e3fb
 14309 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 c23d938e3e64
 14328 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 c23d938e3e64
 14330 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 051e2a30e3fb
Searching for interesting versions
 Result found: flight 14076 (pass), for basis pass
 Result found: flight 14150 (fail), for basis failure
 Repro found: flight 14295 (pass), for basis pass
 Repro found: flight 14296 (fail), for basis failure
 0 revisions at a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 c23d938e3e64
No revisions left to test, checking graph state.
 Result found: flight 14301 (pass), for last pass
 Result found: flight 14305 (fail), for first failure
 Repro found: flight 14309 (pass), for last pass
 Repro found: flight 14327 (fail), for first failure
 Repro found: flight 14328 (pass), for last pass
 Repro found: flight 14330 (fail), for first failure

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
  Bug introduced:  051e2a30e3fb
  Bug not present: c23d938e3e64

pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-4.2-testing.hg
searching for changes
no changes found

  changeset:   25886:051e2a30e3fb
  user:        Ian Campbell <Ian.Campbell@citrix.com>
  date:        Fri Oct 26 16:40:18 2012 +0100
      
      libxl: handle errors from xc_sharing_* info functions
      
      On a 32 bit hypervisor xl info currently reports:
      sharing_freed_memory   : 72057594037927935
      sharing_used_memory    : 72057594037927935
      
      Eat the ENOSYS and turn it into 0. Log and propagate other errors.
      
      I don't have a 32 bit system handy, so tested on x86_64 with a libxc
      hacked to return -ENOSYS and -EINVAL.
      
      Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
      Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
      Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
      Committed-by: Ian Campbell <ian.campbell@citrix.com>
      
      xen-unstable changeset: 25894:95a971c8058f
      Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
      Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
      
      

Revision graph left in /home/xc_osstest/results/bisect.xen-4.2-testing.test-i386-i386-xl-qemuu-winxpsp3.windows-install.{dot,ps,png,html}.
----------------------------------------
14330: tolerable ALL FAIL

flight 14330 xen-4.2-testing real-bisect [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14330/

Failures :-/ but no regressions.

Tests which did not succeed,
including tests which could not be run:
 test-i386-i386-xl-qemuu-winxpsp3  7 windows-install     fail baseline untested


jobs:
 test-i386-i386-xl-qemuu-winxpsp3                             fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:34:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:34:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1Sm-00050P-9G; Thu, 01 Nov 2012 20:34:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TU1Sl-00050G-2K
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:34:03 +0000
Received: from [85.158.139.83:47016] by server-13.bemta-5.messagelabs.com id
	92/E7-27809-ABCD2905; Thu, 01 Nov 2012 20:34:02 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-10.tower-182.messagelabs.com!1351802040!28634408!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13190 invoked from network); 1 Nov 2012 20:34:01 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-10.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 20:34:01 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148030866;
	Thu, 01 Nov 2012 16:33:38 -0400
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com, xen-devel@lists.xen.org,
	samuel.thibault@ens-lyon.org
Date: Thu,  1 Nov 2012 16:33:25 -0400
Message-Id: <1351802007-19178-2-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM 2/9] add xenbus_read_uuid to mini-os
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Similar to xenbus_read_integer, this function reads a xenstore path
and parses it as a uuid. See include/xenbus.h for details.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

diff --git a/extras/mini-os/include/xenbus.h b/extras/mini-os/include/xenbus.h
index cd6316e..f619066 100644
--- a/extras/mini-os/include/xenbus.h
+++ b/extras/mini-os/include/xenbus.h
@@ -95,6 +95,10 @@ char *xenbus_transaction_end(xenbus_transaction_t, int abort,
 /* Read path and parse it as an integer.  Returns -1 on error. */
 int xenbus_read_integer(const char *path);
 
+/* Read path and parse it as 16 byte uuid. Returns 1 if
+ * read and parsing were successful, 0 if not */
+int xenbus_read_uuid(const char* path, unsigned char uuid[16]);
+
 /* Contraction of snprintf and xenbus_write(path/node). */
 char* xenbus_printf(xenbus_transaction_t xbt,
                                   const char* node, const char* path,
diff --git a/extras/mini-os/xenbus/xenbus.c b/extras/mini-os/xenbus/xenbus.c
index 8c899f3..ee1691b 100644
--- a/extras/mini-os/xenbus/xenbus.c
+++ b/extras/mini-os/xenbus/xenbus.c
@@ -719,6 +719,33 @@ int xenbus_read_integer(const char *path)
     return t;
 }
 
+int xenbus_read_uuid(const char* path, unsigned char uuid[16]) {
+   char * res, *buf;
+   res = xenbus_read(XBT_NIL, path, &buf);
+   if(res) {
+      printk("Failed to read %s.\n", path);
+      free(res);
+      return 0;
+   }
+   if(strlen(buf) != ((2*16)+4) /* 16 hex bytes and 4 hyphens */
+         || sscanf(buf,
+            "%2hhx%2hhx%2hhx%2hhx-"
+            "%2hhx%2hhx-"
+            "%2hhx%2hhx-"
+            "%2hhx%2hhx-"
+            "%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx",
+            uuid, uuid + 1, uuid + 2, uuid + 3,
+            uuid + 4, uuid + 5, uuid + 6, uuid + 7,
+            uuid + 8, uuid + 9, uuid + 10, uuid + 11,
+            uuid + 12, uuid + 13, uuid + 14, uuid + 15) != 16) {
+      printk("Xenbus path %s value %s is not a uuid!\n", path, buf);
+      free(buf);
+      return 0;
+   }
+   free(buf);
+   return 1;
+}
+
 char* xenbus_printf(xenbus_transaction_t xbt,
                                   const char* node, const char* path,
                                   const char* fmt, ...)
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:34:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:34:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1Sm-00050P-9G; Thu, 01 Nov 2012 20:34:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TU1Sl-00050G-2K
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:34:03 +0000
Received: from [85.158.139.83:47016] by server-13.bemta-5.messagelabs.com id
	92/E7-27809-ABCD2905; Thu, 01 Nov 2012 20:34:02 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-10.tower-182.messagelabs.com!1351802040!28634408!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13190 invoked from network); 1 Nov 2012 20:34:01 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-10.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 20:34:01 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148030866;
	Thu, 01 Nov 2012 16:33:38 -0400
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com, xen-devel@lists.xen.org,
	samuel.thibault@ens-lyon.org
Date: Thu,  1 Nov 2012 16:33:25 -0400
Message-Id: <1351802007-19178-2-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM 2/9] add xenbus_read_uuid to mini-os
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Similar to xenbus_read_integer, this function reads a xenstore path
and parses it as a uuid. See include/xenbus.h for details.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

diff --git a/extras/mini-os/include/xenbus.h b/extras/mini-os/include/xenbus.h
index cd6316e..f619066 100644
--- a/extras/mini-os/include/xenbus.h
+++ b/extras/mini-os/include/xenbus.h
@@ -95,6 +95,10 @@ char *xenbus_transaction_end(xenbus_transaction_t, int abort,
 /* Read path and parse it as an integer.  Returns -1 on error. */
 int xenbus_read_integer(const char *path);
 
+/* Read path and parse it as 16 byte uuid. Returns 1 if
+ * read and parsing were successful, 0 if not */
+int xenbus_read_uuid(const char* path, unsigned char uuid[16]);
+
 /* Contraction of snprintf and xenbus_write(path/node). */
 char* xenbus_printf(xenbus_transaction_t xbt,
                                   const char* node, const char* path,
diff --git a/extras/mini-os/xenbus/xenbus.c b/extras/mini-os/xenbus/xenbus.c
index 8c899f3..ee1691b 100644
--- a/extras/mini-os/xenbus/xenbus.c
+++ b/extras/mini-os/xenbus/xenbus.c
@@ -719,6 +719,33 @@ int xenbus_read_integer(const char *path)
     return t;
 }
 
+int xenbus_read_uuid(const char* path, unsigned char uuid[16]) {
+   char * res, *buf;
+   res = xenbus_read(XBT_NIL, path, &buf);
+   if(res) {
+      printk("Failed to read %s.\n", path);
+      free(res);
+      return 0;
+   }
+   if(strlen(buf) != ((2*16)+4) /* 16 hex bytes and 4 hyphens */
+         || sscanf(buf,
+            "%2hhx%2hhx%2hhx%2hhx-"
+            "%2hhx%2hhx-"
+            "%2hhx%2hhx-"
+            "%2hhx%2hhx-"
+            "%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx",
+            uuid, uuid + 1, uuid + 2, uuid + 3,
+            uuid + 4, uuid + 5, uuid + 6, uuid + 7,
+            uuid + 8, uuid + 9, uuid + 10, uuid + 11,
+            uuid + 12, uuid + 13, uuid + 14, uuid + 15) != 16) {
+      printk("Xenbus path %s value %s is not a uuid!\n", path, buf);
+      free(buf);
+      return 0;
+   }
+   free(buf);
+   return 1;
+}
+
 char* xenbus_printf(xenbus_transaction_t xbt,
                                   const char* node, const char* path,
                                   const char* fmt, ...)
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:34:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:34:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1Si-000507-TW; Thu, 01 Nov 2012 20:34:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TU1Si-000500-3m
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:34:00 +0000
Received: from [85.158.139.211:31855] by server-7.bemta-5.messagelabs.com id
	43/22-23096-7BCD2905; Thu, 01 Nov 2012 20:33:59 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-6.tower-206.messagelabs.com!1351802036!18540838!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3013 invoked from network); 1 Nov 2012 20:33:58 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 20:33:58 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148030843;
	Thu, 01 Nov 2012 16:33:38 -0400
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com, xen-devel@lists.xen.org,
	samuel.thibault@ens-lyon.org
Date: Thu,  1 Nov 2012 16:33:24 -0400
Message-Id: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM 1/9] Disable -DGNT_DEBUG and -DGNTMAP_DEBUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Disabling the above flags in default mini-os build. They generate a
lot of spam.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

diff --git a/extras/mini-os/minios.mk b/extras/mini-os/minios.mk
index 48ed768..f42f48b 100644
--- a/extras/mini-os/minios.mk
+++ b/extras/mini-os/minios.mk
@@ -20,8 +20,8 @@ DEF_CFLAGS += -g
 #DEF_CFLAGS += -DMM_DEBUG
 #DEF_CFLAGS += -DFS_DEBUG
 #DEF_CFLAGS += -DLIBC_DEBUG
-DEF_CFLAGS += -DGNT_DEBUG
-DEF_CFLAGS += -DGNTMAP_DEBUG
+#DEF_CFLAGS += -DGNT_DEBUG
+#DEF_CFLAGS += -DGNTMAP_DEBUG
 else
 DEF_CFLAGS += -O3
 endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:34:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:34:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1Si-000507-TW; Thu, 01 Nov 2012 20:34:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TU1Si-000500-3m
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:34:00 +0000
Received: from [85.158.139.211:31855] by server-7.bemta-5.messagelabs.com id
	43/22-23096-7BCD2905; Thu, 01 Nov 2012 20:33:59 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-6.tower-206.messagelabs.com!1351802036!18540838!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3013 invoked from network); 1 Nov 2012 20:33:58 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 20:33:58 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148030843;
	Thu, 01 Nov 2012 16:33:38 -0400
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com, xen-devel@lists.xen.org,
	samuel.thibault@ens-lyon.org
Date: Thu,  1 Nov 2012 16:33:24 -0400
Message-Id: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM 1/9] Disable -DGNT_DEBUG and -DGNTMAP_DEBUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Disabling the above flags in default mini-os build. They generate a
lot of spam.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

diff --git a/extras/mini-os/minios.mk b/extras/mini-os/minios.mk
index 48ed768..f42f48b 100644
--- a/extras/mini-os/minios.mk
+++ b/extras/mini-os/minios.mk
@@ -20,8 +20,8 @@ DEF_CFLAGS += -g
 #DEF_CFLAGS += -DMM_DEBUG
 #DEF_CFLAGS += -DFS_DEBUG
 #DEF_CFLAGS += -DLIBC_DEBUG
-DEF_CFLAGS += -DGNT_DEBUG
-DEF_CFLAGS += -DGNTMAP_DEBUG
+#DEF_CFLAGS += -DGNT_DEBUG
+#DEF_CFLAGS += -DGNTMAP_DEBUG
 else
 DEF_CFLAGS += -O3
 endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:34:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:34:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1Su-00051h-2J; Thu, 01 Nov 2012 20:34:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TU1Sr-000519-2g
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:34:09 +0000
Received: from [85.158.138.51:41257] by server-15.bemta-3.messagelabs.com id
	27/F9-09445-FBCD2905; Thu, 01 Nov 2012 20:34:07 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-8.tower-174.messagelabs.com!1351802041!28289883!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24016 invoked from network); 1 Nov 2012 20:34:03 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-8.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 20:34:03 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148030871;
	Thu, 01 Nov 2012 16:33:38 -0400
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com, xen-devel@lists.xen.org,
	samuel.thibault@ens-lyon.org
Date: Thu,  1 Nov 2012 16:33:26 -0400
Message-Id: <1351802007-19178-3-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM 3/9] add tpmfront, tpm_tis,
	and tpmback drivers to mini-os
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch adds 3 new drivers to mini-os.

tpmfront - paravirtualized tpm frontend driver
tpmback - paravirtualized tpm backend driver
tpm_tis - hardware tpm driver

Unfortunately these drivers were derived from GPL
licensed linux kernel drivers so they must carry
the GPL license. However, since mini-os now
supports conditional compilation, hopefully these
drivers can be included into the xen tree and
conditionally removed from non-gpl projects.
By default they are disabled in the makefile.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

diff --git a/extras/mini-os/Makefile b/extras/mini-os/Makefile
index 2422db3..2302a23 100644
--- a/extras/mini-os/Makefile
+++ b/extras/mini-os/Makefile
@@ -22,6 +22,9 @@ CONFIG_QEMU_XS_ARGS ?= n
 CONFIG_TEST ?= n
 CONFIG_PCIFRONT ?= n
 CONFIG_BLKFRONT ?= y
+CONFIG_TPMFRONT ?= n
+CONFIG_TPM_TIS ?= n
+CONFIG_TPMBACK ?= n
 CONFIG_NETFRONT ?= y
 CONFIG_FBFRONT ?= y
 CONFIG_KBDFRONT ?= y
@@ -36,6 +39,9 @@ flags-$(CONFIG_SPARSE_BSS) += -DCONFIG_SPARSE_BSS
 flags-$(CONFIG_QEMU_XS_ARGS) += -DCONFIG_QEMU_XS_ARGS
 flags-$(CONFIG_PCIFRONT) += -DCONFIG_PCIFRONT
 flags-$(CONFIG_BLKFRONT) += -DCONFIG_BLKFRONT
+flags-$(CONFIG_TPMFRONT) += -DCONFIG_TPMFRONT
+flags-$(CONFIG_TPM_TIS) += -DCONFIG_TPM_TIS
+flags-$(CONFIG_TPMBACK) += -DCONFIG_TPMBACK
 flags-$(CONFIG_NETFRONT) += -DCONFIG_NETFRONT
 flags-$(CONFIG_KBDFRONT) += -DCONFIG_KBDFRONT
 flags-$(CONFIG_FBFRONT) += -DCONFIG_FBFRONT
@@ -67,6 +73,9 @@ TARGET := mini-os
 SUBDIRS := lib xenbus console
 
 src-$(CONFIG_BLKFRONT) += blkfront.c
+src-$(CONFIG_TPMFRONT) += tpmfront.c
+src-$(CONFIG_TPM_TIS) += tpm_tis.c
+src-$(CONFIG_TPMBACK) += tpmback.c
 src-y += daytime.c
 src-y += events.c
 src-$(CONFIG_FBFRONT) += fbfront.c
diff --git a/extras/mini-os/include/lib.h b/extras/mini-os/include/lib.h
index d4641b6..935bede 100644
--- a/extras/mini-os/include/lib.h
+++ b/extras/mini-os/include/lib.h
@@ -142,6 +142,8 @@ enum fd_type {
     FTYPE_FB,
     FTYPE_MEM,
     FTYPE_SAVEFILE,
+    FTYPE_TPMFRONT,
+    FTYPE_TPM_TIS,
 };
 
 LIST_HEAD(evtchn_port_list, evtchn_port_info);
@@ -185,6 +187,20 @@ extern struct file {
 	struct {
 	    struct consfront_dev *dev;
 	} cons;
+#ifdef CONFIG_TPMFRONT
+	struct {
+	   struct tpmfront_dev *dev;
+	   int respgot;
+	   off_t offset;
+	} tpmfront;
+#endif
+#ifdef CONFIG_TPM_TIS
+	struct {
+	   struct tpm_chip *dev;
+	   int respgot;
+	   off_t offset;
+	} tpm_tis;
+#endif
 #ifdef CONFIG_XENBUS
         struct {
             /* To each xenbus FD is associated a queue of watch events for this
diff --git a/extras/mini-os/include/tpm_tis.h b/extras/mini-os/include/tpm_tis.h
new file mode 100644
index 0000000..1faca0d
--- /dev/null
+++ b/extras/mini-os/include/tpm_tis.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * This code has been derived from drivers/char/tpm.c
+ * from the linux kernel
+ *
+ * Copyright (C) 2004 IBM Corporation
+ *
+ * This code has also been derived from drivers/char/tpm/tpm_tis.c
+ * from the linux kernel
+ *
+ * Copyright (C) 2005, 2006 IBM Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, version 2
+ * of the License
+ */
+#ifndef TPM_TIS_H
+#define TPM_TIS_H
+
+#include <mini-os/types.h>
+#include <mini-os/byteorder.h>
+
+#define TPM_TIS_EN_LOCL0 1
+#define TPM_TIS_EN_LOCL1 (1 << 1)
+#define TPM_TIS_EN_LOCL2 (1 << 2)
+#define TPM_TIS_EN_LOCL3 (1 << 3)
+#define TPM_TIS_EN_LOCL4 (1 << 4)
+#define TPM_TIS_EN_LOCLALL (TPM_TIS_EN_LOCL0 | TPM_TIS_EN_LOCL1  | TPM_TIS_EN_LOCL2 | TPM_TIS_EN_LOCL3 | TPM_TIS_EN_LOCL4)
+#define TPM_TIS_LOCL_INT_TO_FLAG(x) (1 << x)
+#define TPM_BASEADDR 0xFED40000
+#define TPM_PROBE_IRQ 0xFFFF
+
+struct tpm_chip;
+
+struct tpm_chip* init_tpm_tis(unsigned long baseaddr, int localities, unsigned int irq);
+void shutdown_tpm_tis(struct tpm_chip* tpm);
+
+int tpm_tis_request_locality(struct tpm_chip* tpm, int locality);
+int tpm_tis_cmd(struct tpm_chip* tpm, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen);
+
+#ifdef HAVE_LIBC
+#include <sys/stat.h>
+#include <fcntl.h>
+/* POSIX IO functions:
+ * use tpm_tis_open() to get a file descriptor to the tpm device
+ * use write() on the fd to send a command to the backend. You must
+ * include the entire command in a single call to write().
+ * use read() on the fd to read the response. You can use
+ * fstat() to get the size of the response and lseek() to seek on it.
+ */
+int tpm_tis_open(struct tpm_chip* tpm);
+int tpm_tis_posix_read(int fd, uint8_t* buf, size_t count);
+int tpm_tis_posix_write(int fd, const uint8_t* buf, size_t count);
+int tpm_tis_posix_fstat(int fd, struct stat* buf);
+#endif
+
+#endif
diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
new file mode 100644
index 0000000..ff86732
--- /dev/null
+++ b/extras/mini-os/include/tpmback.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * This code has been derived from drivers/xen/tpmback/tpmback.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * which was itself derived from drivers/xen/netback/netback.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2002-2004, K A Fraser
+ *
+ * This code has also been derived from drivers/xen/tpmback/xenbus.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (C) 2005 IBM Corporation
+ * Copyright (C) 2005 Rusty Russell <rusty@rustcorp.com.au>
+ *
+ * This code has also been derived from drivers/xen/tpmback/interface.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * which was itself also derived from drvivers/xen/netback/interface.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2004, Keir Fraser
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, version 2
+ * of the License
+ */
+
+#include <xen/io/tpmif.h>
+#include <xen/io/xenbus.h>
+#include <mini-os/types.h>
+#include <xen/xen.h>
+#ifndef TPMBACK_H
+#define TPMBACK_H
+
+struct tpmcmd {
+   domid_t domid;		/* Domid of the frontend */
+   unsigned int handle;	/* Handle of the frontend */
+   unsigned char uuid[16];			/* uuid of the tpm interface */
+
+   unsigned int req_len;		/* Size of the command in buf - set by tpmback driver */
+   uint8_t* req;			/* tpm command bits, allocated by driver, DON'T FREE IT */
+   unsigned int resp_len;	/* Size of the outgoing command,
+				   you set this before passing the cmd object to tpmback_resp */
+   uint8_t* resp;		/* Buffer for response - YOU MUST ALLOCATE IT, YOU MUST ALSO FREE IT */
+};
+typedef struct tpmcmd tpmcmd_t;
+
+/* Initialize the tpm backend driver */
+void init_tpmback(void);
+
+/* Shutdown tpm backend driver */
+void shutdown_tpmback(void);
+
+/* Blocks until a tpm command is sent from any front end.
+ * Returns a pointer to the tpm command to handle.
+ * Do not try to free this pointer or the req buffer
+ * This function will return NULL if the tpm backend driver
+ * is shutdown or any other error occurs */
+tpmcmd_t* tpmback_req_any(void);
+
+/* Blocks until a tpm command from the frontend at domid/handle
+ * is sent.
+ * Returns NULL if domid/handle is not connected, tpmback is
+ * shutdown or shutting down, or if there is an error
+ */
+tpmcmd_t* tpmback_req(domid_t domid, unsigned int handle);
+
+/* Send the response to the tpm command back to the frontend
+ * This function will free the tpmcmd object, but you must free the resp
+ * buffer yourself */
+void tpmback_resp(tpmcmd_t* tpmcmd);
+
+/* Waits for the first frontend to connect and then sets domid and handle appropriately.
+ * If one or more frontends are already connected, this will set domid and handle to one
+ * of them arbitrarily. The main use for this function is to wait until a single
+ * frontend connection has occured.
+ * returns 0 on success, non-zero on failure */
+int tpmback_wait_for_frontend_connect(domid_t *domid, unsigned int *handle);
+
+/* returns the number of frontends connected */
+int tpmback_num_frontends(void);
+
+/* Returns the uuid of the specified frontend, NULL on error.
+ * The return value is internally allocated, so don't free it */
+unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle);
+
+/* Specify a function to call when a new tpm device connects */
+void tpmback_set_open_callback(void (*cb)(domid_t, unsigned int));
+
+/* Specify a function to call when a tpm device disconnects */
+void tpmback_set_close_callback(void (*cb)(domid_t, unsigned int));
+
+//Not Implemented
+void tpmback_set_suspend_callback(void (*cb)(domid_t, unsigned int));
+void tpmback_set_resume_callback(void (*cb)(domid_t, unsigned int));
+
+#endif
diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include/tpmfront.h
new file mode 100644
index 0000000..fd2cb17
--- /dev/null
+++ b/extras/mini-os/include/tpmfront.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * This code has been derived from drivers/char/tpm_vtpm.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (C) 2006 IBM Corporation
+ *
+ * This code has also been derived from drivers/char/tpm_xen.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * which was itself derived from drivers/xen/netfront/netfront.c
+ * from the linux kernel
+ *
+ * Copyright (c) 2002-2004, K A Fraser
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, version 2 of the
+ * License.
+ */
+#ifndef TPMFRONT_H
+#define TPMFRONT_H
+
+#include <mini-os/types.h>
+#include <mini-os/os.h>
+#include <mini-os/events.h>
+#include <mini-os/wait.h>
+#include <xen/xen.h>
+#include <xen/io/xenbus.h>
+#include <xen/io/tpmif.h>
+
+struct tpmfront_dev {
+   grant_ref_t ring_ref;
+   evtchn_port_t evtchn;
+
+   tpmif_tx_interface_t* tx;
+
+   void** pages;
+
+   domid_t bedomid;
+   char* nodename;
+   char* bepath;
+
+   XenbusState state;
+
+   uint8_t waiting;
+   struct wait_queue_head waitq;
+
+   uint8_t* respbuf;
+   size_t resplen;
+
+#ifdef HAVE_LIBC
+   int fd;
+#endif
+
+};
+
+
+/*Initialize frontend */
+struct tpmfront_dev* init_tpmfront(const char* nodename);
+/*Shutdown frontend */
+void shutdown_tpmfront(struct tpmfront_dev* dev);
+
+/* Send a tpm command to the backend and wait for the response
+ *
+ * @dev - frontend device
+ * @req - request buffer
+ * @reqlen - length of request buffer
+ * @resp - *resp will be set to internal response buffer, don't free it! Value is undefined on error
+ * @resplen - *resplen will be set to the length of the response. Value is undefined on error
+ *
+ * returns 0 on success, non zero on failure.
+ * */
+int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen);
+
+#ifdef HAVE_LIBC
+#include <sys/stat.h>
+/* POSIX IO functions:
+ * use tpmfront_open() to get a file descriptor to the tpm device
+ * use write() on the fd to send a command to the backend. You must
+ * include the entire command in a single call to write().
+ * use read() on the fd to read the response. You can use
+ * fstat() to get the size of the response and lseek() to seek on it.
+ */
+int tpmfront_open(struct tpmfront_dev* dev);
+int tpmfront_posix_read(int fd, uint8_t* buf, size_t count);
+int tpmfront_posix_write(int fd, const uint8_t* buf, size_t count);
+int tpmfront_posix_fstat(int fd, struct stat* buf);
+#endif
+
+
+#endif
diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
index 6cb97b1..d212969 100644
--- a/extras/mini-os/lib/sys.c
+++ b/extras/mini-os/lib/sys.c
@@ -27,6 +27,8 @@
 #include <netfront.h>
 #include <blkfront.h>
 #include <fbfront.h>
+#include <tpmfront.h>
+#include <tpm_tis.h>
 #include <xenbus.h>
 #include <xenstore.h>
 
@@ -294,6 +296,16 @@ int read(int fd, void *buf, size_t nbytes)
 	    return blkfront_posix_read(fd, buf, nbytes);
         }
 #endif
+#ifdef CONFIG_TPMFRONT
+        case FTYPE_TPMFRONT: {
+	    return tpmfront_posix_read(fd, buf, nbytes);
+        }
+#endif
+#ifdef CONFIG_TPM_TIS
+        case FTYPE_TPM_TIS: {
+	    return tpm_tis_posix_read(fd, buf, nbytes);
+        }
+#endif
 	default:
 	    break;
     }
@@ -330,6 +342,14 @@ int write(int fd, const void *buf, size_t nbytes)
 	case FTYPE_BLK:
 	    return blkfront_posix_write(fd, buf, nbytes);
 #endif
+#ifdef CONFIG_TPMFRONT
+	case FTYPE_TPMFRONT:
+	    return tpmfront_posix_write(fd, buf, nbytes);
+#endif
+#ifdef CONFIG_TPM_TIS
+	case FTYPE_TPM_TIS:
+	    return tpm_tis_posix_write(fd, buf, nbytes);
+#endif
 	default:
 	    break;
     }
@@ -341,8 +361,16 @@ int write(int fd, const void *buf, size_t nbytes)
 off_t lseek(int fd, off_t offset, int whence)
 {
     switch(files[fd].type) {
+#if defined(CONFIG_BLKFRONT) || defined(CONFIG_TPMFRONT) || defined(CONFIG_TPM_TIS)
 #ifdef CONFIG_BLKFRONT
        case FTYPE_BLK:
+#endif
+#ifdef CONFIG_TPMFRNT
+       case FTYPE_TPMFRONT:
+#endif
+#ifdef CONFIG_TPM_TIS
+       case FTYPE_TPM_TIS:
+#endif
 	  switch (whence) {
 	     case SEEK_SET:
 		files[fd].file.offset = offset;
@@ -420,6 +448,18 @@ int close(int fd)
 	    files[fd].type = FTYPE_NONE;
 	    return 0;
 #endif
+#ifdef CONFIG_TPMFRONT
+	case FTYPE_TPMFRONT:
+            shutdown_tpmfront(files[fd].tpmfront.dev);
+	    files[fd].type = FTYPE_NONE;
+	    return 0;
+#endif
+#ifdef CONFIG_TPM_TIS
+	case FTYPE_TPM_TIS:
+            shutdown_tpm_tis(files[fd].tpm_tis.dev);
+	    files[fd].type = FTYPE_NONE;
+	    return 0;
+#endif
 #ifdef CONFIG_KBDFRONT
 	case FTYPE_KBD:
             shutdown_kbdfront(files[fd].kbd.dev);
@@ -489,6 +529,14 @@ int fstat(int fd, struct stat *buf)
 	case FTYPE_BLK:
 	   return blkfront_posix_fstat(fd, buf);
 #endif
+#ifdef CONFIG_TPMFRONT
+	case FTYPE_TPMFRONT:
+	   return tpmfront_posix_fstat(fd, buf);
+#endif
+#ifdef CONFIG_TPM_TIS
+	case FTYPE_TPM_TIS:
+	   return tpm_tis_posix_fstat(fd, buf);
+#endif
 	default:
 	    break;
     }
diff --git a/extras/mini-os/tpm_tis.c b/extras/mini-os/tpm_tis.c
new file mode 100644
index 0000000..e8ca69f
--- /dev/null
+++ b/extras/mini-os/tpm_tis.c
@@ -0,0 +1,1354 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * This code has been derived from drivers/char/tpm.c
+ * from the linux kernel
+ *
+ * Copyright (C) 2004 IBM Corporation
+ *
+ * This code has also been derived from drivers/char/tpm/tpm_tis.c
+ * from the linux kernel
+ *
+ * Copyright (C) 2005, 2006 IBM Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, version 2
+ * of the License
+ */
+#include <mini-os/ioremap.h>
+#include <mini-os/iorw.h>
+#include <mini-os/tpm_tis.h>
+#include <mini-os/os.h>
+#include <mini-os/sched.h>
+#include <mini-os/byteorder.h>
+#include <mini-os/events.h>
+#include <mini-os/wait.h>
+#include <mini-os/xmalloc.h>
+#include <errno.h>
+#include <stdbool.h>
+
+#ifndef min
+	#define min( a, b ) ( ((a) < (b)) ? (a) : (b) )
+#endif
+
+#define TPM_HEADER_SIZE 10
+
+#define TPM_BUFSIZE 2048
+
+struct tpm_input_header {
+        uint16_t  tag;
+        uint32_t  length;
+        uint32_t  ordinal;
+}__attribute__((packed));
+
+struct tpm_output_header {
+        uint16_t  tag;
+        uint32_t  length;
+        uint32_t  return_code;
+}__attribute__((packed));
+
+struct  stclear_flags_t {
+        uint16_t  tag;
+        uint8_t      deactivated;
+        uint8_t      disableForceClear;
+        uint8_t      physicalPresence;
+        uint8_t      physicalPresenceLock;
+        uint8_t      bGlobalLock;
+}__attribute__((packed));
+
+struct  tpm_version_t {
+        uint8_t      Major;
+        uint8_t      Minor;
+        uint8_t      revMajor;
+        uint8_t      revMinor;
+}__attribute__((packed));
+
+struct  tpm_version_1_2_t {
+        uint16_t  tag;
+        uint8_t      Major;
+        uint8_t      Minor;
+        uint8_t      revMajor;
+        uint8_t      revMinor;
+}__attribute__((packed));
+
+struct  timeout_t {
+        uint32_t  a;
+        uint32_t  b;
+        uint32_t  c;
+        uint32_t  d;
+}__attribute__((packed));
+
+struct duration_t {
+        uint32_t  tpm_short;
+        uint32_t  tpm_medium;
+        uint32_t  tpm_long;
+}__attribute__((packed));
+
+struct permanent_flags_t {
+        uint16_t  tag;
+        uint8_t      disable;
+        uint8_t      ownership;
+        uint8_t      deactivated;
+        uint8_t      readPubek;
+        uint8_t      disableOwnerClear;
+        uint8_t      allowMaintenance;
+        uint8_t      physicalPresenceLifetimeLock;
+        uint8_t      physicalPresenceHWEnable;
+        uint8_t      physicalPresenceCMDEnable;
+        uint8_t      CEKPUsed;
+        uint8_t      TPMpost;
+        uint8_t      TPMpostLock;
+        uint8_t      FIPS;
+        uint8_t      operator;
+        uint8_t      enableRevokeEK;
+        uint8_t      nvLocked;
+        uint8_t      readSRKPub;
+        uint8_t      tpmEstablished;
+        uint8_t      maintenanceDone;
+        uint8_t      disableFullDALogicInfo;
+}__attribute__((packed));
+
+typedef union {
+        struct  permanent_flags_t perm_flags;
+        struct  stclear_flags_t stclear_flags;
+        bool    owned;
+        uint32_t  num_pcrs;
+        struct  tpm_version_t   tpm_version;
+        struct  tpm_version_1_2_t tpm_version_1_2;
+        uint32_t  manufacturer_id;
+        struct timeout_t  timeout;
+        struct duration_t duration;
+} cap_t;
+
+struct  tpm_getcap_params_in {
+        uint32_t  cap;
+        uint32_t  subcap_size;
+        uint32_t  subcap;
+}__attribute__((packed));
+
+struct  tpm_getcap_params_out {
+        uint32_t  cap_size;
+        cap_t   cap;
+}__attribute__((packed));
+
+struct  tpm_readpubek_params_out {
+        uint8_t      algorithm[4];
+        uint8_t      encscheme[2];
+        uint8_t      sigscheme[2];
+        uint32_t  paramsize;
+        uint8_t      parameters[12]; /*assuming RSA*/
+        uint32_t  keysize;
+        uint8_t      modulus[256];
+        uint8_t      checksum[20];
+}__attribute__((packed));
+
+typedef union {
+        struct  tpm_input_header in;
+        struct  tpm_output_header out;
+} tpm_cmd_header;
+
+#define TPM_DIGEST_SIZE 20
+struct tpm_pcrread_out {
+        uint8_t      pcr_result[TPM_DIGEST_SIZE];
+}__attribute__((packed));
+
+struct tpm_pcrread_in {
+        uint32_t  pcr_idx;
+}__attribute__((packed));
+
+struct tpm_pcrextend_in {
+        uint32_t  pcr_idx;
+        uint8_t      hash[TPM_DIGEST_SIZE];
+}__attribute__((packed));
+
+typedef union {
+        struct  tpm_getcap_params_out getcap_out;
+        struct  tpm_readpubek_params_out readpubek_out;
+        uint8_t      readpubek_out_buffer[sizeof(struct tpm_readpubek_params_out)];
+        struct  tpm_getcap_params_in getcap_in;
+        struct  tpm_pcrread_in  pcrread_in;
+        struct  tpm_pcrread_out pcrread_out;
+        struct  tpm_pcrextend_in pcrextend_in;
+} tpm_cmd_params;
+
+struct tpm_cmd_t {
+        tpm_cmd_header  header;
+        tpm_cmd_params  params;
+}__attribute__((packed));
+
+
+enum tpm_duration {
+   TPM_SHORT = 0,
+   TPM_MEDIUM = 1,
+   TPM_LONG = 2,
+   TPM_UNDEFINED,
+};
+
+#define TPM_MAX_ORDINAL 243
+#define TPM_MAX_PROTECTED_ORDINAL 12
+#define TPM_PROTECTED_ORDINAL_MASK 0xFF
+
+extern const uint8_t tpm_protected_ordinal_duration[TPM_MAX_PROTECTED_ORDINAL];
+extern const uint8_t tpm_ordinal_duration[TPM_MAX_ORDINAL];
+
+#define TPM_DIGEST_SIZE 20
+#define TPM_ERROR_SIZE 10
+#define TPM_RET_CODE_IDX 6
+
+/* tpm_capabilities */
+#define TPM_CAP_FLAG cpu_to_be32(4)
+#define TPM_CAP_PROP cpu_to_be32(5)
+#define CAP_VERSION_1_1 cpu_to_be32(0x06)
+#define CAP_VERSION_1_2 cpu_to_be32(0x1A)
+
+/* tpm_sub_capabilities */
+#define TPM_CAP_PROP_PCR cpu_to_be32(0x101)
+#define TPM_CAP_PROP_MANUFACTURER cpu_to_be32(0x103)
+#define TPM_CAP_FLAG_PERM cpu_to_be32(0x108)
+#define TPM_CAP_FLAG_VOL cpu_to_be32(0x109)
+#define TPM_CAP_PROP_OWNER cpu_to_be32(0x111)
+#define TPM_CAP_PROP_TIS_TIMEOUT cpu_to_be32(0x115)
+#define TPM_CAP_PROP_TIS_DURATION cpu_to_be32(0x120)
+
+
+#define TPM_INTERNAL_RESULT_SIZE 200
+#define TPM_TAG_RQU_COMMAND cpu_to_be16(193)
+#define TPM_ORD_GET_CAP cpu_to_be32(101)
+
+extern const struct tpm_input_header tpm_getcap_header;
+
+
+
+const uint8_t tpm_protected_ordinal_duration[TPM_MAX_PROTECTED_ORDINAL] = {
+   TPM_UNDEFINED,          /* 0 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 5 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 10 */
+   TPM_SHORT,
+};
+
+const uint8_t tpm_ordinal_duration[TPM_MAX_ORDINAL] = {
+   TPM_UNDEFINED,          /* 0 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 5 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 10 */
+   TPM_SHORT,
+   TPM_MEDIUM,
+   TPM_LONG,
+   TPM_LONG,
+   TPM_MEDIUM,             /* 15 */
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_MEDIUM,
+   TPM_LONG,
+   TPM_SHORT,              /* 20 */
+   TPM_SHORT,
+   TPM_MEDIUM,
+   TPM_MEDIUM,
+   TPM_MEDIUM,
+   TPM_SHORT,              /* 25 */
+   TPM_SHORT,
+   TPM_MEDIUM,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_MEDIUM,             /* 30 */
+   TPM_LONG,
+   TPM_MEDIUM,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,              /* 35 */
+   TPM_MEDIUM,
+   TPM_MEDIUM,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_MEDIUM,             /* 40 */
+   TPM_LONG,
+   TPM_MEDIUM,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,              /* 45 */
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_LONG,
+   TPM_MEDIUM,             /* 50 */
+   TPM_MEDIUM,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 55 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_MEDIUM,             /* 60 */
+   TPM_MEDIUM,
+   TPM_MEDIUM,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_MEDIUM,             /* 65 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 70 */
+   TPM_SHORT,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 75 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_LONG,               /* 80 */
+   TPM_UNDEFINED,
+   TPM_MEDIUM,
+   TPM_LONG,
+   TPM_SHORT,
+   TPM_UNDEFINED,          /* 85 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 90 */
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_UNDEFINED,          /* 95 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_MEDIUM,             /* 100 */
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 105 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 110 */
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,              /* 115 */
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_LONG,               /* 120 */
+   TPM_LONG,
+   TPM_MEDIUM,
+   TPM_UNDEFINED,
+   TPM_SHORT,
+   TPM_SHORT,              /* 125 */
+   TPM_SHORT,
+   TPM_LONG,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,              /* 130 */
+   TPM_MEDIUM,
+   TPM_UNDEFINED,
+   TPM_SHORT,
+   TPM_MEDIUM,
+   TPM_UNDEFINED,          /* 135 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 140 */
+   TPM_SHORT,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 145 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 150 */
+   TPM_MEDIUM,
+   TPM_MEDIUM,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_UNDEFINED,          /* 155 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 160 */
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 165 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_LONG,               /* 170 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 175 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_MEDIUM,             /* 180 */
+   TPM_SHORT,
+   TPM_MEDIUM,
+   TPM_MEDIUM,
+   TPM_MEDIUM,
+   TPM_MEDIUM,             /* 185 */
+   TPM_SHORT,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 190 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 195 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 200 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,
+   TPM_SHORT,              /* 205 */
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_MEDIUM,             /* 210 */
+   TPM_UNDEFINED,
+   TPM_MEDIUM,
+   TPM_MEDIUM,
+   TPM_MEDIUM,
+   TPM_UNDEFINED,          /* 215 */
+   TPM_MEDIUM,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,
+   TPM_SHORT,              /* 220 */
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_UNDEFINED,          /* 225 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 230 */
+   TPM_LONG,
+   TPM_MEDIUM,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 235 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 240 */
+   TPM_UNDEFINED,
+   TPM_MEDIUM,
+};
+
+const struct tpm_input_header tpm_getcap_header = {
+        .tag = TPM_TAG_RQU_COMMAND,
+        .length = cpu_to_be32(22),
+        .ordinal = TPM_ORD_GET_CAP
+};
+
+
+enum tis_access {
+   TPM_ACCESS_VALID = 0x80,
+   TPM_ACCESS_ACTIVE_LOCALITY = 0x20,	/* (R) */
+   TPM_ACCESS_RELINQUISH_LOCALITY = 0x20,/* (W) */
+   TPM_ACCESS_REQUEST_PENDING = 0x04,	/* (W) */
+   TPM_ACCESS_REQUEST_USE = 0x02,	/* (W) */
+};
+
+enum tis_status {
+   TPM_STS_VALID = 0x80,		/* (R) */
+   TPM_STS_COMMAND_READY = 0x40,	/* (R) */
+   TPM_STS_DATA_AVAIL = 0x10,		/* (R) */
+   TPM_STS_DATA_EXPECT = 0x08,		/* (R) */
+   TPM_STS_GO = 0x20,			/* (W) */
+};
+
+enum tis_int_flags {
+   TPM_GLOBAL_INT_ENABLE = 0x80000000,
+   TPM_INTF_BURST_COUNT_STATIC = 0x100,
+   TPM_INTF_CMD_READY_INT = 0x080,
+   TPM_INTF_INT_EDGE_FALLING = 0x040,
+   TPM_INTF_INT_EDGE_RISING = 0x020,
+   TPM_INTF_INT_LEVEL_LOW = 0x010,
+   TPM_INTF_INT_LEVEL_HIGH = 0x008,
+   TPM_INTF_LOCALITY_CHANGE_INT = 0x004,
+   TPM_INTF_STS_VALID_INT = 0x002,
+   TPM_INTF_DATA_AVAIL_INT = 0x001,
+};
+
+enum tis_defaults {
+   TIS_MEM_BASE = 0xFED40000,
+   TIS_MEM_LEN  = 0x5000,
+   TIS_SHORT_TIMEOUT = 750, /*ms*/
+   TIS_LONG_TIMEOUT = 2000, /*2 sec */
+};
+
+#define TPM_TIMEOUT 5
+
+#define TPM_ACCESS(t, l)                   (((uint8_t*)t->pages[l]) + 0x0000)
+#define TPM_INT_ENABLE(t, l)               ((uint32_t*)(((uint8_t*)t->pages[l]) + 0x0008))
+#define TPM_INT_VECTOR(t, l)               (((uint8_t*)t->pages[l]) + 0x000C)
+#define TPM_INT_STATUS(t, l)               (((uint8_t*)t->pages[l]) + 0x0010)
+#define TPM_INTF_CAPS(t, l)                ((uint32_t*)(((uint8_t*)t->pages[l]) + 0x0014))
+#define TPM_STS(t, l)                      ((uint8_t*)(((uint8_t*)t->pages[l]) + 0x0018))
+#define TPM_DATA_FIFO(t, l)                (((uint8_t*)t->pages[l]) + 0x0024)
+
+#define TPM_DID_VID(t, l)                  ((uint32_t*)(((uint8_t*)t->pages[l]) + 0x0F00))
+#define TPM_RID(t, l)                      (((uint8_t*)t->pages[l]) + 0x0F04)
+
+struct tpm_chip {
+   int enabled_localities;
+   int locality;
+   unsigned long baseaddr;
+   uint8_t* pages[5];
+   int did, vid, rid;
+
+   uint8_t data_buffer[TPM_BUFSIZE];
+   int data_len;
+
+   s_time_t timeout_a, timeout_b, timeout_c, timeout_d;
+   s_time_t duration[3];
+
+#ifdef HAVE_LIBC
+   int fd;
+#endif
+
+   unsigned int irq;
+   struct wait_queue_head read_queue;
+   struct wait_queue_head int_queue;
+};
+
+
+static void __init_tpm_chip(struct tpm_chip* tpm) {
+   tpm->enabled_localities = TPM_TIS_EN_LOCLALL;
+   tpm->locality = -1;
+   tpm->baseaddr = 0;
+   tpm->pages[0] = tpm->pages[1] = tpm->pages[2] = tpm->pages[3] = tpm->pages[4] = NULL;
+   tpm->vid = 0;
+   tpm->did = 0;
+   tpm->irq = 0;
+   init_waitqueue_head(&tpm->read_queue);
+   init_waitqueue_head(&tpm->int_queue);
+
+   tpm->data_len = -1;
+
+#ifdef HAVE_LIBC
+   tpm->fd = -1;
+#endif
+}
+
+/*
+ * Returns max number of nsecs to wait
+ */
+s_time_t tpm_calc_ordinal_duration(struct tpm_chip *chip,
+      uint32_t ordinal)
+{
+   int duration_idx = TPM_UNDEFINED;
+   s_time_t duration = 0;
+
+   if (ordinal < TPM_MAX_ORDINAL)
+      duration_idx = tpm_ordinal_duration[ordinal];
+   else if ((ordinal & TPM_PROTECTED_ORDINAL_MASK) <
+	 TPM_MAX_PROTECTED_ORDINAL)
+      duration_idx =
+	 tpm_protected_ordinal_duration[ordinal &
+	 TPM_PROTECTED_ORDINAL_MASK];
+
+   if (duration_idx != TPM_UNDEFINED) {
+      duration = chip->duration[duration_idx];
+   }
+
+   if (duration <= 0) {
+      return SECONDS(120);
+   }
+   else
+   {
+      return duration;
+   }
+}
+
+
+static int locality_enabled(struct tpm_chip* tpm, int l) {
+   return tpm->enabled_localities & (1 << l);
+}
+
+static int check_locality(struct tpm_chip* tpm, int l) {
+   if(locality_enabled(tpm, l) && (ioread8(TPM_ACCESS(tpm, l)) &
+	    (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) ==
+	 (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) {
+      return l;
+   }
+   return -1;
+}
+
+void release_locality(struct tpm_chip* tpm, int l, int force)
+{
+   if (locality_enabled(tpm, l) && (force || (ioread8(TPM_ACCESS(tpm, l)) &
+	       (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID)) ==
+	    (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID))) {
+      iowrite8(TPM_ACCESS(tpm, l), TPM_ACCESS_RELINQUISH_LOCALITY);
+   }
+}
+
+int tpm_tis_request_locality(struct tpm_chip* tpm, int l) {
+
+   s_time_t stop;
+   /*Make sure locality is valid */
+   if(!locality_enabled(tpm, l)) {
+      printk("tpm_tis_change_locality() Tried to change to locality %d, but it is disabled or invalid!\n", l);
+      return -1;
+   }
+   /* Check if we already have the current locality */
+   if(check_locality(tpm, l) >= 0) {
+      return tpm->locality = l;
+   }
+   /* Set the new locality*/
+   iowrite8(TPM_ACCESS(tpm, l), TPM_ACCESS_REQUEST_USE);
+
+   if(tpm->irq) {
+      /* Wait for interrupt */
+      wait_event_deadline(tpm->int_queue, (check_locality(tpm, l) >= 0), NOW() + tpm->timeout_a);
+
+      /* FIXME: Handle timeout event, should return error in that case */
+      return l;
+   } else {
+      /* Wait for burstcount */
+      stop = NOW() + tpm->timeout_a;
+      do {
+	 if(check_locality(tpm, l) >= 0) {
+	    return tpm->locality = l;
+	 }
+	 msleep(TPM_TIMEOUT);
+      } while(NOW() < stop);
+   }
+
+   printk("REQ LOCALITY FAILURE\n");
+   return -1;
+}
+
+static uint8_t tpm_tis_status(struct tpm_chip* tpm) {
+   return ioread8(TPM_STS(tpm, tpm->locality));
+}
+
+/* This causes the current command to be aborted */
+static void tpm_tis_ready(struct tpm_chip* tpm) {
+   iowrite8(TPM_STS(tpm, tpm->locality), TPM_STS_COMMAND_READY);
+}
+#define tpm_tis_cancel_cmd(v) tpm_tis_ready(v)
+
+static int get_burstcount(struct tpm_chip* tpm) {
+   s_time_t stop;
+   int burstcnt;
+
+   stop = NOW() + tpm->timeout_d;
+   do {
+      burstcnt = ioread8((TPM_STS(tpm, tpm->locality) + 1));
+      burstcnt += ioread8(TPM_STS(tpm, tpm->locality) + 2) << 8;
+
+      if (burstcnt) {
+	 return burstcnt;
+      }
+      msleep(TPM_TIMEOUT);
+   } while(NOW() < stop);
+   return -EBUSY;
+}
+
+static int wait_for_stat(struct tpm_chip* tpm, uint8_t mask,
+      unsigned long timeout, struct wait_queue_head* queue) {
+   s_time_t stop;
+   uint8_t status;
+
+   status = tpm_tis_status(tpm);
+   if((status & mask) == mask) {
+      return 0;
+   }
+
+   if(tpm->irq) {
+      wait_event_deadline(*queue, ((tpm_tis_status(tpm) & mask) == mask), timeout);
+      /* FIXME: Check for timeout and return -ETIME */
+      return 0;
+   } else {
+      stop = NOW() + timeout;
+      do {
+	 msleep(TPM_TIMEOUT);
+	 status = tpm_tis_status(tpm);
+	 if((status & mask) == mask)
+	    return 0;
+      } while( NOW() < stop);
+   }
+   return -ETIME;
+}
+
+static int recv_data(struct tpm_chip* tpm, uint8_t* buf, size_t count) {
+   int size = 0;
+   int burstcnt;
+   while( size < count &&
+	 wait_for_stat(tpm,
+	    TPM_STS_DATA_AVAIL | TPM_STS_VALID,
+	    tpm->timeout_c,
+	    &tpm->read_queue)
+	 == 0) {
+      burstcnt = get_burstcount(tpm);
+      for(; burstcnt > 0 && size < count; --burstcnt)
+      {
+	 buf[size++] = ioread8(TPM_DATA_FIFO(tpm, tpm->locality));
+      }
+   }
+   return size;
+}
+
+int tpm_tis_recv(struct tpm_chip* tpm, uint8_t* buf, size_t count) {
+   int size = 0;
+   int expected, status;
+
+   if (count < TPM_HEADER_SIZE) {
+      size = -EIO;
+      goto out;
+   }
+
+   /* read first 10 bytes, including tag, paramsize, and result */
+   if((size =
+	    recv_data(tpm, buf, TPM_HEADER_SIZE)) < TPM_HEADER_SIZE) {
+      printk("Error reading tpm cmd header\n");
+      goto out;
+   }
+
+   expected = be32_to_cpu(*((uint32_t*)(buf + 2)));
+   if(expected > count) {
+      size = -EIO;
+      goto out;
+   }
+
+   if((size += recv_data(tpm, & buf[TPM_HEADER_SIZE],
+	       expected - TPM_HEADER_SIZE)) < expected) {
+      printk("Unable to read rest of tpm command size=%d expected=%d\n", size, expected);
+      size = -ETIME;
+      goto out;
+   }
+
+   wait_for_stat(tpm, TPM_STS_VALID, tpm->timeout_c, &tpm->int_queue);
+   status = tpm_tis_status(tpm);
+   if(status & TPM_STS_DATA_AVAIL) {
+      printk("Error: left over data\n");
+      size = -EIO;
+      goto out;
+   }
+
+out:
+   tpm_tis_ready(tpm);
+   release_locality(tpm, tpm->locality, 0);
+   return size;
+}
+int tpm_tis_send(struct tpm_chip* tpm, uint8_t* buf, size_t len) {
+   int rc;
+   int status, burstcnt = 0;
+   int count = 0;
+   uint32_t ordinal;
+
+   if(tpm_tis_request_locality(tpm, tpm->locality) < 0) {
+      return -EBUSY;
+   }
+
+   status = tpm_tis_status(tpm);
+   if((status & TPM_STS_COMMAND_READY) == 0) {
+      tpm_tis_ready(tpm);
+      if(wait_for_stat(tpm, TPM_STS_COMMAND_READY, tpm->timeout_b, &tpm->int_queue) < 0) {
+	 rc = -ETIME;
+	 goto out_err;
+      }
+   }
+
+   while(count < len - 1) {
+      burstcnt = get_burstcount(tpm);
+      for(;burstcnt > 0 && count < len -1; --burstcnt) {
+	 iowrite8(TPM_DATA_FIFO(tpm, tpm->locality), buf[count++]);
+      }
+
+      wait_for_stat(tpm, TPM_STS_VALID, tpm->timeout_c, &tpm->int_queue);
+      status = tpm_tis_status(tpm);
+      if((status & TPM_STS_DATA_EXPECT) == 0) {
+	 rc = -EIO;
+	 goto out_err;
+      }
+   }
+
+   /*Write last byte*/
+   iowrite8(TPM_DATA_FIFO(tpm, tpm->locality), buf[count]);
+   wait_for_stat(tpm, TPM_STS_VALID, tpm->timeout_c, &tpm->read_queue);
+   status = tpm_tis_status(tpm);
+   if((status & TPM_STS_DATA_EXPECT) != 0) {
+      rc = -EIO;
+      goto out_err;
+   }
+
+   /*go and do it*/
+   iowrite8(TPM_STS(tpm, tpm->locality), TPM_STS_GO);
+
+   if(tpm->irq) {
+      /*Wait for interrupt */
+      ordinal = be32_to_cpu(*(buf + 6));
+      if(wait_for_stat(tpm,
+	       TPM_STS_DATA_AVAIL | TPM_STS_VALID,
+	       tpm_calc_ordinal_duration(tpm, ordinal),
+	       &tpm->read_queue) < 0) {
+	 rc = -ETIME;
+	 goto out_err;
+      }
+   }
+#ifdef HAVE_LIBC
+   if(tpm->fd >= 0) {
+      files[tpm->fd].read = 0;
+      files[tpm->fd].tpm_tis.respgot = 0;
+      files[tpm->fd].tpm_tis.offset = 0;
+   }
+#endif
+   return len;
+
+out_err:
+   tpm_tis_ready(tpm);
+   release_locality(tpm, tpm->locality, 0);
+   return rc;
+}
+
+static void tpm_tis_irq_handler(evtchn_port_t port, struct pt_regs *regs, void* data)
+{
+   struct tpm_chip* tpm = data;
+   uint32_t interrupt;
+   int i;
+
+   interrupt = ioread32(TPM_INT_STATUS(tpm, tpm->locality));
+   if(interrupt == 0) {
+      return;
+   }
+
+   if(interrupt & TPM_INTF_DATA_AVAIL_INT) {
+      wake_up(&tpm->read_queue);
+   }
+   if(interrupt & TPM_INTF_LOCALITY_CHANGE_INT) {
+      for(i = 0; i < 5; ++i) {
+	 if(check_locality(tpm, i) >= 0) {
+	    break;
+	 }
+      }
+   }
+   if(interrupt & (TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_STS_VALID_INT |
+	    TPM_INTF_CMD_READY_INT)) {
+      wake_up(&tpm->int_queue);
+   }
+
+   /* Clear interrupts handled with TPM_EOI */
+   iowrite32(TPM_INT_STATUS(tpm, tpm->locality), interrupt);
+   ioread32(TPM_INT_STATUS(tpm, tpm->locality));
+   return;
+}
+
+/*
+ * Internal kernel interface to transmit TPM commands
+ */
+static ssize_t tpm_transmit(struct tpm_chip *chip, const uint8_t *buf,
+      size_t bufsiz)
+{
+   ssize_t rc;
+   uint32_t count, ordinal;
+   s_time_t stop;
+
+   count = be32_to_cpu(*((uint32_t *) (buf + 2)));
+   ordinal = be32_to_cpu(*((uint32_t *) (buf + 6)));
+   if (count == 0)
+      return -ENODATA;
+   if (count > bufsiz) {
+      printk("Error: invalid count value %x %zx \n", count, bufsiz);
+      return -E2BIG;
+   }
+
+   //down(&chip->tpm_mutex);
+
+   if ((rc = tpm_tis_send(chip, (uint8_t *) buf, count)) < 0) {
+      printk("tpm_transmit: tpm_send: error %ld\n", rc);
+      goto out;
+   }
+
+   if (chip->irq)
+      goto out_recv;
+
+   stop = NOW() + tpm_calc_ordinal_duration(chip, ordinal);
+   do {
+      uint8_t status = tpm_tis_status(chip);
+      if ((status & (TPM_STS_DATA_AVAIL | TPM_STS_VALID)) ==
+	    (TPM_STS_DATA_AVAIL | TPM_STS_VALID))
+	 goto out_recv;
+
+      if ((status == TPM_STS_COMMAND_READY)) {
+	 printk("TPM Error: Operation Canceled\n");
+	 rc = -ECANCELED;
+	 goto out;
+      }
+
+      msleep(TPM_TIMEOUT);    /* CHECK */
+      rmb();
+   } while (NOW() < stop);
+
+   /* Cancel the command */
+   tpm_tis_cancel_cmd(chip);
+   printk("TPM Operation Timed out\n");
+   rc = -ETIME;
+   goto out;
+
+out_recv:
+   if((rc = tpm_tis_recv(chip, (uint8_t *) buf, bufsiz)) < 0) {
+      printk("tpm_transmit: tpm_recv: error %d\n", rc);
+   }
+out:
+   //up(&chip->tpm_mutex);
+   return rc;
+}
+
+static ssize_t transmit_cmd(struct tpm_chip *chip, struct tpm_cmd_t *cmd,
+                            int len, const char *desc)
+{
+        int err;
+
+        len = tpm_transmit(chip,(uint8_t *) cmd, len);
+        if (len <  0)
+                return len;
+        if (len == TPM_ERROR_SIZE) {
+                err = be32_to_cpu(cmd->header.out.return_code);
+                printk("A TPM error (%d) occurred %s\n", err, desc);
+                return err;
+        }
+        return 0;
+}
+
+int tpm_get_timeouts(struct tpm_chip *chip)
+{
+   struct tpm_cmd_t tpm_cmd;
+   struct timeout_t *timeout_cap;
+   struct duration_t *duration_cap;
+   ssize_t rc;
+   uint32_t timeout;
+   unsigned int scale = 1;
+
+   tpm_cmd.header.in = tpm_getcap_header;
+   tpm_cmd.params.getcap_in.cap = TPM_CAP_PROP;
+   tpm_cmd.params.getcap_in.subcap_size = cpu_to_be32(4);
+   tpm_cmd.params.getcap_in.subcap = TPM_CAP_PROP_TIS_TIMEOUT;
+
+   if((rc = transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE,
+	 "attempting to determine the timeouts")) != 0) {
+      printk("transmit failed %d\n", rc);
+      goto duration;
+   }
+
+   if(be32_to_cpu(tpm_cmd.header.out.return_code) != 0 ||
+         be32_to_cpu(tpm_cmd.header.out.length) !=
+         sizeof(tpm_cmd.header.out) + sizeof(uint32_t) + 4 * sizeof(uint32_t)) {
+      return -EINVAL;
+   }
+
+   timeout_cap = &tpm_cmd.params.getcap_out.cap.timeout;
+   /* Don't overwrite default if value is 0 */
+   timeout = be32_to_cpu(timeout_cap->a);
+   if(timeout && timeout < 1000) {
+      /* timeouts in msc rather usec */
+      scale = 1000;
+   }
+   if (timeout)
+      chip->timeout_a = MICROSECS(timeout * scale); /*Convert to msec */
+   timeout = be32_to_cpu(timeout_cap->b);
+   if (timeout)
+      chip->timeout_b = MICROSECS(timeout * scale); /*Convert to msec */
+   timeout = be32_to_cpu(timeout_cap->c);
+   if (timeout)
+      chip->timeout_c = MICROSECS(timeout * scale); /*Convert to msec */
+   timeout = be32_to_cpu(timeout_cap->d);
+   if (timeout)
+      chip->timeout_d = MICROSECS(timeout * scale); /*Convert to msec */
+
+duration:
+   tpm_cmd.header.in = tpm_getcap_header;
+   tpm_cmd.params.getcap_in.cap = TPM_CAP_PROP;
+   tpm_cmd.params.getcap_in.subcap_size = cpu_to_be32(4);
+   tpm_cmd.params.getcap_in.subcap = TPM_CAP_PROP_TIS_DURATION;
+
+   if((rc = transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE,
+	 "attempting to determine the durations")) < 0) {
+      return rc;
+   }
+
+   if(be32_to_cpu(tpm_cmd.header.out.return_code) != 0 ||
+         be32_to_cpu(tpm_cmd.header.out.length) !=
+         sizeof(tpm_cmd.header.out) + sizeof(uint32_t) + 3 * sizeof(uint32_t)) {
+      return -EINVAL;
+   }
+
+   duration_cap = &tpm_cmd.params.getcap_out.cap.duration;
+   chip->duration[TPM_SHORT] = MICROSECS(be32_to_cpu(duration_cap->tpm_short));
+   chip->duration[TPM_MEDIUM] = MICROSECS(be32_to_cpu(duration_cap->tpm_medium));
+   chip->duration[TPM_LONG] = MICROSECS(be32_to_cpu(duration_cap->tpm_long));
+
+   /* The Broadcom BCM0102 chipset in a Dell Latitude D820 gets the above
+    * value wrong and apparently reports msecs rather than usecs. So we
+    * fix up the resulting too-small TPM_SHORT value to make things work.
+    */
+   if (chip->duration[TPM_SHORT] < MILLISECS(10)) {
+      chip->duration[TPM_SHORT] = SECONDS(1);
+      chip->duration[TPM_MEDIUM] *= 1000;
+      chip->duration[TPM_LONG] *= 1000;
+      printk("Adjusting TPM timeout parameters\n");
+   }
+
+   return 0;
+}
+
+
+
+void tpm_continue_selftest(struct tpm_chip* chip) {
+   uint8_t data[] = {
+      0, 193,                 /* TPM_TAG_RQU_COMMAND */
+      0, 0, 0, 10,            /* length */
+      0, 0, 0, 83,            /* TPM_ORD_GetCapability */
+   };
+
+   tpm_transmit(chip, data, sizeof(data));
+}
+
+ssize_t tpm_getcap(struct tpm_chip *chip, uint32_t subcap_id, cap_t *cap,
+                   const char *desc)
+{
+        struct tpm_cmd_t tpm_cmd;
+        int rc;
+
+        tpm_cmd.header.in = tpm_getcap_header;
+        if (subcap_id == CAP_VERSION_1_1 || subcap_id == CAP_VERSION_1_2) {
+                tpm_cmd.params.getcap_in.cap = subcap_id;
+                /*subcap field not necessary */
+                tpm_cmd.params.getcap_in.subcap_size = cpu_to_be32(0);
+                tpm_cmd.header.in.length -= cpu_to_be32(sizeof(uint32_t));
+        } else {
+                if (subcap_id == TPM_CAP_FLAG_PERM ||
+                    subcap_id == TPM_CAP_FLAG_VOL)
+                        tpm_cmd.params.getcap_in.cap = TPM_CAP_FLAG;
+                else
+                        tpm_cmd.params.getcap_in.cap = TPM_CAP_PROP;
+                tpm_cmd.params.getcap_in.subcap_size = cpu_to_be32(4);
+                tpm_cmd.params.getcap_in.subcap = subcap_id;
+        }
+        rc = transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE, desc);
+        if (!rc)
+                *cap = tpm_cmd.params.getcap_out.cap;
+        return rc;
+}
+
+
+struct tpm_chip* init_tpm_tis(unsigned long baseaddr, int localities, unsigned int irq)
+{
+   int i;
+   unsigned long addr;
+   struct tpm_chip* tpm = NULL;
+   uint32_t didvid;
+   uint32_t intfcaps;
+   uint32_t intmask;
+
+   printk("============= Init TPM TIS Driver ==============\n");
+
+   /*Sanity check the localities input */
+   if(localities & ~TPM_TIS_EN_LOCLALL) {
+      printk("init_tpm_tis() Invalid locality specification! %X\n", localities);
+      goto abort_egress;
+   }
+
+   printk("IOMEM Machine Base Address: %lX\n", baseaddr);
+
+   /* Create the tpm data structure */
+   tpm = malloc(sizeof(struct tpm_chip));
+   __init_tpm_chip(tpm);
+
+   /* Set the enabled localities - if 0 we leave default as all enabled */
+   if(localities != 0) {
+      tpm->enabled_localities = localities;
+   }
+   printk("Enabled Localities: ");
+   for(i = 0; i < 5; ++i) {
+      if(locality_enabled(tpm, i)) {
+	 printk("%d ", i);
+      }
+   }
+   printk("\n");
+
+   /* Set the base machine address */
+   tpm->baseaddr = baseaddr;
+
+   /* Set default timeouts */
+   tpm->timeout_a = MILLISECS(TIS_SHORT_TIMEOUT);
+   tpm->timeout_b = MILLISECS(TIS_LONG_TIMEOUT);
+   tpm->timeout_c = MILLISECS(TIS_SHORT_TIMEOUT);
+   tpm->timeout_d = MILLISECS(TIS_SHORT_TIMEOUT);
+
+   /*Map the mmio pages */
+   addr = tpm->baseaddr;
+   for(i = 0; i < 5; ++i) {
+      if(locality_enabled(tpm, i)) {
+	 /* Map the page in now */
+	 if((tpm->pages[i] = ioremap_nocache(addr, PAGE_SIZE)) == NULL) {
+	    printk("Unable to map iomem page a address %p\n", addr);
+	    goto abort_egress;
+	 }
+
+	 /* Set default locality to the first enabled one */
+	 if (tpm->locality < 0) {
+	    if(tpm_tis_request_locality(tpm, i) < 0) {
+	       printk("Unable to request locality %d??\n", i);
+	       goto abort_egress;
+	    }
+	 }
+      }
+      addr += PAGE_SIZE;
+   }
+
+
+   /* Get the vendor and device ids */
+   didvid = ioread32(TPM_DID_VID(tpm, tpm->locality));
+   tpm->did = didvid >> 16;
+   tpm->vid = didvid & 0xFFFF;
+
+
+   /* Get the revision id */
+   tpm->rid = ioread8(TPM_RID(tpm, tpm->locality));
+
+   printk("1.2 TPM (device-id=0x%X vendor-id = %X rev-id = %X)\n", tpm->did, tpm->vid, tpm->rid);
+
+   intfcaps = ioread32(TPM_INTF_CAPS(tpm, tpm->locality));
+   printk("TPM interface capabilities (0x%x):\n", intfcaps);
+   if (intfcaps & TPM_INTF_BURST_COUNT_STATIC)
+      printk("\tBurst Count Static\n");
+   if (intfcaps & TPM_INTF_CMD_READY_INT)
+      printk("\tCommand Ready Int Support\n");
+   if (intfcaps & TPM_INTF_INT_EDGE_FALLING)
+      printk("\tInterrupt Edge Falling\n");
+   if (intfcaps & TPM_INTF_INT_EDGE_RISING)
+      printk("\tInterrupt Edge Rising\n");
+   if (intfcaps & TPM_INTF_INT_LEVEL_LOW)
+      printk("\tInterrupt Level Low\n");
+   if (intfcaps & TPM_INTF_INT_LEVEL_HIGH)
+      printk("\tInterrupt Level High\n");
+   if (intfcaps & TPM_INTF_LOCALITY_CHANGE_INT)
+      printk("\tLocality Change Int Support\n");
+   if (intfcaps & TPM_INTF_STS_VALID_INT)
+      printk("\tSts Valid Int Support\n");
+   if (intfcaps & TPM_INTF_DATA_AVAIL_INT)
+      printk("\tData Avail Int Support\n");
+
+   /*Interupt setup */
+   intmask = ioread32(TPM_INT_ENABLE(tpm, tpm->locality));
+
+   intmask |= TPM_INTF_CMD_READY_INT
+      | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT
+      | TPM_INTF_STS_VALID_INT;
+
+   iowrite32(TPM_INT_ENABLE(tpm, tpm->locality), intmask);
+
+   /*If interupts are enabled, handle it */
+   if(irq) {
+      if(irq != TPM_PROBE_IRQ) {
+	 tpm->irq = irq;
+      } else {
+	 /*FIXME add irq probing feature later */
+	 printk("IRQ probing not implemented\n");
+      }
+   }
+
+   if(tpm->irq) {
+      iowrite8(TPM_INT_VECTOR(tpm, tpm->locality), tpm->irq);
+
+      if(bind_pirq(tpm->irq, 1, tpm_tis_irq_handler, tpm) != 0) {
+	 printk("Unabled to request irq: %u for use\n", tpm->irq);
+	 printk("Will use polling mode\n");
+	 tpm->irq = 0;
+      } else {
+	 /* Clear all existing */
+	 iowrite32(TPM_INT_STATUS(tpm, tpm->locality), ioread32(TPM_INT_STATUS(tpm, tpm->locality)));
+
+	 /* Turn on interrupts */
+	 iowrite32(TPM_INT_ENABLE(tpm, tpm->locality), intmask | TPM_GLOBAL_INT_ENABLE);
+      }
+   }
+
+   if(tpm_get_timeouts(tpm)) {
+      printk("Could not get TPM timeouts and durations\n");
+      goto abort_egress;
+   }
+   tpm_continue_selftest(tpm);
+
+
+   return tpm;
+abort_egress:
+   if(tpm != NULL) {
+      shutdown_tpm_tis(tpm);
+   }
+   return NULL;
+}
+
+void shutdown_tpm_tis(struct tpm_chip* tpm){
+   int i;
+
+   printk("Shutting down tpm_tis device\n");
+
+   iowrite32(TPM_INT_ENABLE(tpm, tpm->locality), ~TPM_GLOBAL_INT_ENABLE);
+
+   /*Unmap all of the mmio pages */
+   for(i = 0; i < 5; ++i) {
+      if(tpm->pages[i] != NULL) {
+	 iounmap(tpm->pages[i], PAGE_SIZE);
+	 tpm->pages[i] = NULL;
+      }
+   }
+   free(tpm);
+   return;
+}
+
+
+int tpm_tis_cmd(struct tpm_chip* tpm, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen)
+{
+   if(tpm->locality < 0) {
+      printk("tpm_tis_cmd() failed! locality not set!\n");
+      return -1;
+   }
+   if(reqlen > TPM_BUFSIZE) {
+      reqlen = TPM_BUFSIZE;
+   }
+   memcpy(tpm->data_buffer, req, reqlen);
+   *resplen = tpm_transmit(tpm, tpm->data_buffer, TPM_BUFSIZE);
+
+   *resp = malloc(*resplen);
+   memcpy(*resp, tpm->data_buffer, *resplen);
+   return 0;
+}
+
+#ifdef HAVE_LIBC
+int tpm_tis_open(struct tpm_chip* tpm)
+{
+   /* Silently prevent multiple opens */
+   if(tpm->fd != -1) {
+      return tpm->fd;
+   }
+
+   tpm->fd = alloc_fd(FTYPE_TPM_TIS);
+   printk("tpm_tis_open() -> %d\n", tpm->fd);
+   files[tpm->fd].tpm_tis.dev = tpm;
+   files[tpm->fd].tpm_tis.offset = 0;
+   files[tpm->fd].tpm_tis.respgot = 0;
+   return tpm->fd;
+}
+
+int tpm_tis_posix_write(int fd, const uint8_t* buf, size_t count)
+{
+   struct tpm_chip* tpm;
+   tpm = files[fd].tpm_tis.dev;
+
+   if(tpm->locality < 0) {
+      printk("tpm_tis_posix_write() failed! locality not set!\n");
+      errno = EINPROGRESS;
+      return -1;
+   }
+   if(count == 0) {
+      return 0;
+   }
+
+   /* Return an error if we are already processing a command */
+   if(count > TPM_BUFSIZE) {
+      count = TPM_BUFSIZE;
+   }
+   /* Send the command now */
+   memcpy(tpm->data_buffer, buf, count);
+   if((tpm->data_len = tpm_transmit(tpm, tpm->data_buffer, TPM_BUFSIZE)) < 0) {
+      errno = EIO;
+      return -1;
+   }
+   return count;
+}
+
+int tpm_tis_posix_read(int fd, uint8_t* buf, size_t count)
+{
+   int rc;
+   struct tpm_chip* tpm;
+   tpm = files[fd].tpm_tis.dev;
+
+   if(count == 0) {
+      return 0;
+   }
+
+   /* If there is no tpm resp to read, return EIO */
+   if(tpm->data_len < 0) {
+      errno = EIO;
+      return -1;
+   }
+
+
+   /* Handle EOF case */
+   if(files[fd].tpm_tis.offset >= tpm->data_len) {
+      rc = 0;
+   } else {
+      rc = min(tpm->data_len - files[fd].tpm_tis.offset, count);
+      memcpy(buf, tpm->data_buffer + files[fd].tpm_tis.offset, rc);
+   }
+   files[fd].tpm_tis.offset += rc;
+   /* Reset the data pending flag */
+   return rc;
+}
+int tpm_tis_posix_fstat(int fd, struct stat* buf)
+{
+   struct tpm_chip* tpm;
+   tpm = files[fd].tpm_tis.dev;
+
+   buf->st_mode = O_RDWR;
+   buf->st_uid = 0;
+   buf->st_gid = 0;
+   buf->st_size = be32_to_cpu(*((uint32_t*)(tpm->data_buffer + 2)));
+   buf->st_atime = buf->st_mtime = buf->st_ctime = time(NULL);
+   return 0;
+}
+
+
+#endif
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
new file mode 100644
index 0000000..658fed1
--- /dev/null
+++ b/extras/mini-os/tpmback.c
@@ -0,0 +1,1102 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * This code has been derived from drivers/xen/tpmback/tpmback.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * which was itself derived from drivers/xen/netback/netback.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2002-2004, K A Fraser
+ *
+ * This code has also been derived from drivers/xen/tpmback/xenbus.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (C) 2005 IBM Corporation
+ * Copyright (C) 2005 Rusty Russell <rusty@rustcorp.com.au>
+ *
+ * This code has also been derived from drivers/xen/tpmback/interface.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * which was itself also derived from drvivers/xen/netback/interface.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2004, Keir Fraser
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, version 2
+ * of the License
+ */
+#include <mini-os/os.h>
+#include <mini-os/xenbus.h>
+#include <mini-os/events.h>
+#include <errno.h>
+#include <mini-os/gnttab.h>
+#include <xen/io/xenbus.h>
+#include <xen/io/tpmif.h>
+#include <xen/io/protocols.h>
+#include <mini-os/xmalloc.h>
+#include <time.h>
+#include <mini-os/tpmback.h>
+#include <mini-os/lib.h>
+#include <fcntl.h>
+#include <mini-os/mm.h>
+#include <mini-os/posix/sys/mman.h>
+#include <mini-os/semaphore.h>
+#include <mini-os/wait.h>
+
+
+#ifndef HAVE_LIBC
+#define strtoul simple_strtoul
+#endif
+
+//#define TPMBACK_PRINT_DEBUG
+#ifdef TPMBACK_PRINT_DEBUG
+#define TPMBACK_DEBUG(fmt,...) printk("Tpmback:Debug("__FILE__":%d) " fmt, __LINE__, ##__VA_ARGS__)
+#define TPMBACK_DEBUG_MORE(fmt,...) printk(fmt, ##__VA_ARGS__)
+#else
+#define TPMBACK_DEBUG(fmt,...)
+#endif
+#define TPMBACK_ERR(fmt,...) printk("Tpmback:Error " fmt, ##__VA_ARGS__)
+#define TPMBACK_LOG(fmt,...) printk("Tpmback:Info " fmt, ##__VA_ARGS__)
+
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+
+/* Default size of the tpmif array at initialization */
+#define DEF_ARRAY_SIZE 1
+
+/* tpmif and tpmdev flags */
+#define TPMIF_CLOSED 1
+#define TPMIF_REQ_READY 2
+
+struct tpmif {
+   domid_t domid;
+   unsigned int handle;
+
+   char* fe_path;
+   char* fe_state_path;
+
+   /* Locally bound event channel*/
+   evtchn_port_t evtchn;
+
+   /* Shared page */
+   tpmif_tx_interface_t* tx;
+
+   /* pointer to TPMIF_RX_RING_SIZE pages */
+   void** pages;
+
+   enum xenbus_state state;
+   enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
+
+   unsigned char uuid[16];
+
+   /* state flags */
+   int flags;
+};
+typedef struct tpmif tpmif_t;
+
+struct tpmback_dev {
+
+   tpmif_t** tpmlist;
+   unsigned long num_tpms;
+   unsigned long num_alloc;
+
+   struct gntmap map;
+
+   /* True if at least one tpmif has a request to be handled */
+   int flags;
+
+   xenbus_event_queue events;
+
+   /* Callbacks */
+   void (*open_callback)(domid_t, unsigned int);
+   void (*close_callback)(domid_t, unsigned int);
+   void (*suspend_callback)(domid_t, unsigned int);
+   void (*resume_callback)(domid_t, unsigned int);
+};
+typedef struct tpmback_dev tpmback_dev_t;
+
+enum { EV_NONE, EV_NEWFE, EV_STCHNG } tpm_ev_enum;
+
+/* Global objects */
+static struct thread* eventthread = NULL;
+static tpmback_dev_t gtpmdev = {
+   .tpmlist = NULL,
+   .num_tpms = 0,
+   .num_alloc = 0,
+   .flags = TPMIF_CLOSED,
+   .events = NULL,
+   .open_callback = NULL,
+   .close_callback = NULL,
+   .suspend_callback = NULL,
+   .resume_callback = NULL,
+};
+struct wait_queue_head waitq;
+int globalinit = 0;
+
+/************************************
+ * TPMIF SORTED ARRAY FUNCTIONS
+ * tpmback_dev_t.tpmlist is a sorted array, sorted by domid and then handle number
+ * Duplicates are not allowed
+ * **********************************/
+
+inline void tpmif_req_ready(tpmif_t* tpmif) {
+   tpmif->flags |= TPMIF_REQ_READY;
+   gtpmdev.flags |= TPMIF_REQ_READY;
+}
+
+inline void tpmdev_check_req(void) {
+   int i;
+   int flags;
+   local_irq_save(flags);
+   for(i = 0; i < gtpmdev.num_tpms; ++i) {
+      if(gtpmdev.tpmlist[i]->flags & TPMIF_REQ_READY) {
+	 gtpmdev.flags |= TPMIF_REQ_READY;
+	 local_irq_restore(flags);
+	 return;
+      }
+   }
+   gtpmdev.flags &= ~TPMIF_REQ_READY;
+   local_irq_restore(flags);
+}
+
+inline void tpmif_req_finished(tpmif_t* tpmif) {
+   tpmif->flags &= ~TPMIF_REQ_READY;
+   tpmdev_check_req();
+}
+
+int __get_tpmif_index(int st, int n, domid_t domid, unsigned int handle)
+{
+   int i = st + n /2;
+   tpmif_t* tmp;
+
+   if( n <= 0 )
+      return -1;
+
+   tmp = gtpmdev.tpmlist[i];
+   if(domid == tmp->domid && tmp->handle == handle) {
+      return i;
+   } else if ( (domid < tmp->domid) ||
+	 (domid == tmp->domid && handle < tmp->handle)) {
+      return __get_tpmif_index(st, n/2, domid, handle);
+   } else {
+      return __get_tpmif_index(i + 1, n/2 - ((n +1) % 2), domid, handle);
+   }
+}
+
+/* Returns the array index of the tpmif domid/handle. Returns -1 if no such tpmif exists */
+int get_tpmif_index(domid_t domid, unsigned int handle)
+{
+   int flags;
+   int index;
+   local_irq_save(flags);
+   index = __get_tpmif_index(0, gtpmdev.num_tpms, domid, handle);
+   local_irq_restore(flags);
+   return index;
+}
+
+/* Returns the tpmif domid/handle or NULL if none exists */
+tpmif_t* get_tpmif(domid_t domid, unsigned int handle)
+{
+   int flags;
+   int i;
+   tpmif_t* ret;
+   local_irq_save(flags);
+   i = get_tpmif_index(domid, handle);
+   if (i < 0) {
+      ret = NULL;
+   } else {
+      ret = gtpmdev.tpmlist[i];
+   }
+   local_irq_restore(flags);
+   return ret;
+}
+
+/* Remove the given tpmif. Returns 0 if it was removed, -1 if it was not removed */
+int remove_tpmif(tpmif_t* tpmif)
+{
+   int i, j;
+   char* err;
+   int flags;
+   local_irq_save(flags);
+
+   /* Find the index in the array if it exists */
+   i = get_tpmif_index(tpmif->domid, tpmif->handle);
+   if (i < 0) {
+      goto error;
+   }
+
+   /* Remove the interface from the list */
+   for(j = i; j < gtpmdev.num_tpms - 1; ++j) {
+      gtpmdev.tpmlist[j] = gtpmdev.tpmlist[j+1];
+   }
+   gtpmdev.tpmlist[j] = NULL;
+   --gtpmdev.num_tpms;
+
+   /* If removed tpm was the only ready tpm, then we need to check and turn off the ready flag */
+   tpmdev_check_req();
+
+   local_irq_restore(flags);
+
+   /* Stop listening for events on this tpm interface */
+   if((err = xenbus_unwatch_path_token(XBT_NIL, tpmif->fe_state_path, tpmif->fe_state_path))) {
+      TPMBACK_ERR("Unable to unwatch path token `%s' Error was %s Ignoring..\n", tpmif->fe_state_path, err);
+      free(err);
+   }
+
+   return 0;
+error:
+   local_irq_restore(flags);
+   return -1;
+}
+
+/* Insert tpmif into dev->tpmlist. Returns 0 on success and non zero on error.
+ * It is an error to insert a tpmif with the same domid and handle
+ * number
+ * as something already in the list */
+int insert_tpmif(tpmif_t* tpmif)
+{
+   int flags;
+   unsigned int i, j;
+   tpmif_t* tmp;
+   char* err;
+
+   local_irq_save(flags);
+
+   /*Check if we need to allocate more space */
+   if (gtpmdev.num_tpms == gtpmdev.num_alloc) {
+      gtpmdev.num_alloc *= 2;
+      gtpmdev.tpmlist = realloc(gtpmdev.tpmlist, gtpmdev.num_alloc);
+   }
+
+   /*Find where to put the new interface */
+   for(i = 0; i < gtpmdev.num_tpms; ++i)
+   {
+      tmp = gtpmdev.tpmlist[i];
+      if(tpmif->domid == tmp->domid && tpmif->handle == tmp->handle) {
+	 TPMBACK_ERR("Tried to insert duplicate tpm interface %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
+	 goto error;
+      }
+      if((tpmif->domid < tmp->domid) ||
+	    (tpmif->domid == tmp->domid && tpmif->handle < tmp->handle)) {
+	 break;
+      }
+   }
+
+   /*Shift all the tpm pointers past i down one */
+   for(j = gtpmdev.num_tpms; j > i; --j) {
+      gtpmdev.tpmlist[j] = gtpmdev.tpmlist[j-1];
+   }
+
+   /*Add the new interface */
+   gtpmdev.tpmlist[i] = tpmif;
+   ++gtpmdev.num_tpms;
+
+   /*Should not be needed, anything inserted with ready flag is probably an error */
+   tpmdev_check_req();
+
+   local_irq_restore(flags);
+
+   /*Listen for state changes on the new interface */
+   if((err = xenbus_watch_path_token(XBT_NIL, tpmif->fe_state_path, tpmif->fe_state_path, &gtpmdev.events)))
+   {
+      /* if we got an error here we should carefully remove the interface and then return */
+      TPMBACK_ERR("Unable to watch path token `%s' Error was %s\n", tpmif->fe_state_path, err);
+      free(err);
+      remove_tpmif(tpmif);
+      goto error_post_irq;
+   }
+
+   return 0;
+error:
+   local_irq_restore(flags);
+error_post_irq:
+   return -1;
+}
+
+
+/*****************
+ * CHANGE BACKEND STATE
+ * *****************/
+/*Attempts to change the backend state in xenstore
+ * returns 0 on success and non-zero on error */
+int tpmif_change_state(tpmif_t* tpmif, enum xenbus_state state)
+{
+   char path[512];
+   char *value;
+   char *err;
+   enum xenbus_state readst;
+   TPMBACK_DEBUG("Backend state change %u/%u from=%d to=%d\n", (unsigned int) tpmif->domid, tpmif->handle, tpmif->state, state);
+   if (tpmif->state == state)
+      return 0;
+
+   snprintf(path, 512, "backend/vtpm/%u/%u/state", (unsigned int) tpmif->domid, tpmif->handle);
+
+   if((err = xenbus_read(XBT_NIL, path, &value))) {
+      TPMBACK_ERR("Unable to read backend state %s, error was %s\n", path, err);
+      free(err);
+      return -1;
+   }
+   if(sscanf(value, "%d", &readst) != 1) {
+      TPMBACK_ERR("Non integer value (%s) in %s ??\n", value, path);
+      free(value);
+      return -1;
+   }
+   free(value);
+
+   /* It's possible that the backend state got updated by hotplug or something else behind our back */
+   if(readst != tpmif->state) {
+      TPMBACK_DEBUG("tpm interface state was %d but xenstore state was %d!\n", tpmif->state, readst);
+      tpmif->state = readst;
+   }
+
+   /*If if the state isnt changing, then we dont update xenstore b/c we dont want to fire extraneous events */
+   if(tpmif->state == state) {
+      return 0;
+   }
+
+   /*update xenstore*/
+   snprintf(path, 512, "backend/vtpm/%u/%u", (unsigned int) tpmif->domid, tpmif->handle);
+   if((err = xenbus_printf(XBT_NIL, path, "state", "%u", state))) {
+      TPMBACK_ERR("Error writing to xenstore %s, error was %s new state=%d\n", path, err, state);
+      free(err);
+      return -1;
+   }
+
+   tpmif->state = state;
+
+   return 0;
+}
+/**********************************
+ * TPMIF CREATION AND DELETION
+ * *******************************/
+inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
+{
+   tpmif_t* tpmif;
+   tpmif = malloc(sizeof(*tpmif));
+   tpmif->domid = domid;
+   tpmif->handle = handle;
+   tpmif->fe_path = NULL;
+   tpmif->fe_state_path = NULL;
+   tpmif->state = XenbusStateInitialising;
+   tpmif->status = DISCONNECTED;
+   tpmif->tx = NULL;
+   tpmif->pages = NULL;
+   tpmif->flags = 0;
+   memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
+   return tpmif;
+}
+
+void __free_tpmif(tpmif_t* tpmif)
+{
+   if(tpmif->pages) {
+      free(tpmif->pages);
+   }
+   if(tpmif->fe_path) {
+      free(tpmif->fe_path);
+   }
+   if(tpmif->fe_state_path) {
+      free(tpmif->fe_state_path);
+   }
+   free(tpmif);
+}
+/* Creates a new tpm interface, adds it to the sorted array and returns it.
+ * returns NULL on error
+ * If the tpm interface already exists, it is returned*/
+tpmif_t* new_tpmif(domid_t domid, unsigned int handle)
+{
+   tpmif_t* tpmif;
+   char* err;
+   char path[512];
+
+   /* Make sure we haven't already created this tpm
+    * Double events can occur */
+   if((tpmif = get_tpmif(domid, handle)) != NULL) {
+      return tpmif;
+   }
+
+   tpmif = __init_tpmif(domid, handle);
+
+   /* Get the uuid from xenstore */
+   snprintf(path, 512, "backend/vtpm/%u/%u/uuid", (unsigned int) domid, handle);
+   if((!xenbus_read_uuid(path, tpmif->uuid))) {
+      TPMBACK_ERR("Error reading %s\n", path);
+      goto error;
+   }
+
+   /* allocate pages to be used for shared mapping */
+   if((tpmif->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE)) == NULL) {
+      goto error;
+   }
+   memset(tpmif->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
+
+   if(tpmif_change_state(tpmif, XenbusStateInitWait)) {
+      goto error;
+   }
+
+   snprintf(path, 512, "backend/vtpm/%u/%u/frontend", (unsigned int) domid, handle);
+   if((err = xenbus_read(XBT_NIL, path, &tpmif->fe_path))) {
+      TPMBACK_ERR("Error creating new tpm instance xenbus_read(%s), Error = %s", path, err);
+      free(err);
+      goto error;
+   }
+
+   /*Set the state path */
+   tpmif->fe_state_path = malloc(strlen(tpmif->fe_path) + 7);
+   strcpy(tpmif->fe_state_path, tpmif->fe_path);
+   strcat(tpmif->fe_state_path, "/state");
+
+   if(insert_tpmif(tpmif)) {
+      goto error;
+   }
+   TPMBACK_DEBUG("New tpmif %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
+   /* Do the callback now */
+   if(gtpmdev.open_callback) {
+      gtpmdev.open_callback(tpmif->domid, tpmif->handle);
+   }
+   return tpmif;
+error:
+   __free_tpmif(tpmif);
+   return NULL;
+
+}
+
+/* Removes tpmif from dev->tpmlist and frees it's memory usage */
+void free_tpmif(tpmif_t* tpmif)
+{
+   char* err;
+   char path[512];
+   TPMBACK_DEBUG("Free tpmif %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
+   if(tpmif->flags & TPMIF_CLOSED) {
+      TPMBACK_ERR("Tried to free an instance twice! Theres a bug somewhere!\n");
+      BUG();
+   }
+   tpmif->flags = TPMIF_CLOSED;
+
+   tpmif_change_state(tpmif, XenbusStateClosing);
+
+   /* Unmap share page and unbind event channel */
+   if(tpmif->status == CONNECTED) {
+      tpmif->status = DISCONNECTING;
+      mask_evtchn(tpmif->evtchn);
+
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1)) {
+	 TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
+      }
+
+      unbind_evtchn(tpmif->evtchn);
+   }
+   tpmif->status = DISCONNECTED;
+   tpmif_change_state(tpmif, XenbusStateClosed);
+
+   /* Do the callback now */
+   if(gtpmdev.close_callback) {
+      gtpmdev.close_callback(tpmif->domid, tpmif->handle);
+   }
+
+   /* remove from array */
+   remove_tpmif(tpmif);
+
+   /* Wake up anyone possibly waiting on this interface and let them exit */
+   wake_up(&waitq);
+   schedule();
+
+   /* Remove the old xenbus entries */
+   snprintf(path, 512, "backend/vtpm/%u/%u", (unsigned int) tpmif->domid, tpmif->handle);
+   if((err = xenbus_rm(XBT_NIL, path))) {
+      TPMBACK_ERR("Error cleaning up xenbus entries path=%s error=%s\n", path, err);
+      free(err);
+   }
+
+   TPMBACK_LOG("Frontend %u/%u disconnected\n", (unsigned int) tpmif->domid, tpmif->handle);
+
+   /* free memory */
+   __free_tpmif(tpmif);
+
+}
+
+/**********************
+ * REMAINING TPMBACK FUNCTIONS
+ * ********************/
+
+/*Event channel handler */
+void tpmback_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
+{
+   tpmif_t* tpmif = (tpmif_t*) data;
+   tpmif_tx_request_t* tx = &tpmif->tx->ring[0].req;
+   /* Throw away 0 size events, these can trigger from event channel unmasking */
+   if(tx->size == 0)
+      return;
+
+   TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
+   tpmif_req_ready(tpmif);
+   wake_up(&waitq);
+
+}
+
+/* Connect to frontend */
+int connect_fe(tpmif_t* tpmif)
+{
+   char path[512];
+   char* err, *value;
+   uint32_t domid;
+   grant_ref_t ringref;
+   evtchn_port_t evtchn;
+
+   /* If already connected then quit */
+   if (tpmif->status == CONNECTED) {
+      TPMBACK_DEBUG("%u/%u tried to connect while it was already connected?\n", (unsigned int) tpmif->domid, tpmif->handle);
+      return 0;
+   }
+
+   /* Fetch the grant reference */
+   snprintf(path, 512, "%s/ring-ref", tpmif->fe_path);
+   if((err = xenbus_read(XBT_NIL, path, &value))) {
+      TPMBACK_ERR("Error creating new tpm instance xenbus_read(%s) Error = %s", path, err);
+      free(err);
+      return -1;
+   }
+   if(sscanf(value, "%d", &ringref) != 1) {
+      TPMBACK_ERR("Non integer value (%s) in %s ??\n", value, path);
+      free(value);
+      return -1;
+   }
+   free(value);
+
+
+   /* Fetch the event channel*/
+   snprintf(path, 512, "%s/event-channel", tpmif->fe_path);
+   if((err = xenbus_read(XBT_NIL, path, &value))) {
+      TPMBACK_ERR("Error creating new tpm instance xenbus_read(%s) Error = %s", path, err);
+      free(err);
+      return -1;
+   }
+   if(sscanf(value, "%d", &evtchn) != 1) {
+      TPMBACK_ERR("Non integer value (%s) in %s ??\n", value, path);
+      free(value);
+      return -1;
+   }
+   free(value);
+
+   domid = tpmif->domid;
+   if((tpmif->tx = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
+      TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
+      return -1;
+   }
+   memset(tpmif->tx, 0, PAGE_SIZE);
+
+   /*Bind the event channel */
+   if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler, tpmif, &tpmif->evtchn)))
+   {
+      TPMBACK_ERR("%u/%u Unable to bind to interdomain event channel!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error_post_map;
+   }
+   unmask_evtchn(tpmif->evtchn);
+
+   /* Write the ready flag and change status to connected */
+   snprintf(path, 512, "backend/vtpm/%u/%u", (unsigned int) tpmif->domid, tpmif->handle);
+   if((err = xenbus_printf(XBT_NIL, path, "ready", "%u", 1))) {
+      TPMBACK_ERR("%u/%u Unable to write ready flag on connect_fe()\n", (unsigned int) tpmif->domid, tpmif->handle);
+      free(err);
+      goto error_post_evtchn;
+   }
+   tpmif->status = CONNECTED;
+   if((tpmif_change_state(tpmif, XenbusStateConnected))){
+      goto error_post_evtchn;
+   }
+
+   TPMBACK_LOG("Frontend %u/%u connected\n", (unsigned int) tpmif->domid, tpmif->handle);
+
+   return 0;
+error_post_evtchn:
+   mask_evtchn(tpmif->evtchn);
+   unbind_evtchn(tpmif->evtchn);
+error_post_map:
+   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1);
+   return -1;
+}
+
+static int frontend_changed(tpmif_t* tpmif)
+{
+   int state = xenbus_read_integer(tpmif->fe_state_path);
+   if(state < 0) {
+      state = XenbusStateUnknown;
+   }
+
+   TPMBACK_DEBUG("Frontend %u/%u state changed to %d\n", (unsigned int) tpmif->domid, tpmif->handle, state);
+
+   switch (state) {
+      case XenbusStateInitialising:
+      case XenbusStateInitialised:
+	 break;
+
+      case XenbusStateConnected:
+	 if(connect_fe(tpmif)) {
+	    TPMBACK_ERR("Failed to connect to front end %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
+	    tpmif_change_state(tpmif, XenbusStateClosed);
+	    return -1;
+	 }
+	 break;
+
+      case XenbusStateClosing:
+	 tpmif_change_state(tpmif, XenbusStateClosing);
+	 break;
+
+      case XenbusStateUnknown: /* keep it here */
+      case XenbusStateClosed:
+	 free_tpmif(tpmif);
+	 break;
+
+      default:
+	 TPMBACK_DEBUG("BAD STATE CHANGE %u/%u state = %d for tpmif\n", (unsigned int) tpmif->domid, tpmif->handle, state);
+	 return -1;
+   }
+   return 0;
+}
+
+
+/* parses the string that comes out of xenbus_watch_wait_return. */
+static int parse_eventstr(const char* evstr, domid_t* domid, unsigned int* handle)
+{
+   int ret;
+   char cmd[40];
+   char* err;
+   char* value;
+   unsigned int udomid = 0;
+   tpmif_t* tpmif;
+   /* First check for new frontends, this occurs when /backend/vtpm/<domid>/<handle> gets created. Note we what the sscanf to fail on the last %s */
+   if (sscanf(evstr, "backend/vtpm/%u/%u/%40s", &udomid, handle, cmd) == 2) {
+      *domid = udomid;
+      /* Make sure the entry exists, if this event triggers because the entry dissapeared then ignore it */
+      if((err = xenbus_read(XBT_NIL, evstr, &value))) {
+	 free(err);
+	 return EV_NONE;
+      }
+      free(value);
+      /* Make sure the tpmif entry does not already exist, this should not happen */
+      if((tpmif = get_tpmif(*domid, *handle)) != NULL) {
+	 TPMBACK_DEBUG("Duplicate tpm entries! %u %u\n", tpmif->domid, tpmif->handle);
+	 return EV_NONE;
+      }
+      return EV_NEWFE;
+   } else if((ret = sscanf(evstr, "/local/domain/%u/device/vtpm/%u/%40s", &udomid, handle, cmd)) == 3) {
+      *domid = udomid;
+      if (!strcmp(cmd, "state"))
+	 return EV_STCHNG;
+   }
+   return EV_NONE;
+}
+
+void handle_backend_event(char* evstr) {
+   tpmif_t* tpmif;
+   domid_t domid;
+   unsigned int handle;
+   int event;
+
+   TPMBACK_DEBUG("Xenbus Event: %s\n", evstr);
+
+   event = parse_eventstr(evstr, &domid, &handle);
+
+   switch(event) {
+      case EV_NEWFE:
+	 if(new_tpmif(domid, handle) == NULL) {
+	    TPMBACK_ERR("Failed to create new tpm instance %u/%u\n", (unsigned int) domid, handle);
+	 }
+	 wake_up(&waitq);
+	 break;
+      case EV_STCHNG:
+	 if((tpmif = get_tpmif(domid, handle))) {
+	    frontend_changed(tpmif);
+	 } else {
+	    TPMBACK_DEBUG("Event Received for non-existant tpm! instance=%u/%u xenbus_event=%s\n", (unsigned int) domid, handle, evstr);
+	 }
+	 break;
+   }
+}
+
+/* Runs through the given path and creates events recursively
+ * for all of its children.
+ * @path - xenstore path to scan */
+static void generate_backend_events(const char* path)
+{
+   char* err;
+   int i, len;
+   char **dirs;
+   char *entry;
+
+   if((err = xenbus_ls(XBT_NIL, path, &dirs)) != NULL) {
+      free(err);
+      return;
+   }
+
+   for(i = 0; dirs[i] != NULL; ++i) {
+      len = strlen(path) + strlen(dirs[i]) + 2;
+      entry = malloc(len);
+      snprintf(entry, len, "%s/%s", path, dirs[i]);
+
+      /* Generate and handle event for the entry itself */
+      handle_backend_event(entry);
+
+      /* Do children */
+      generate_backend_events(entry);
+
+      /* Cleanup */
+      free(entry);
+      free(dirs[i]);
+   }
+   free(dirs);
+   return;
+}
+
+unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle)
+{
+   tpmif_t* tpmif;
+   if((tpmif = get_tpmif(domid, handle)) == NULL) {
+      TPMBACK_DEBUG("get_uuid() failed, %u/%u is an invalid frontend\n", (unsigned int) domid, handle);
+      return NULL;
+   }
+
+   return tpmif->uuid;
+}
+
+void tpmback_set_open_callback(void (*cb)(domid_t, unsigned int))
+{
+   gtpmdev.open_callback = cb;
+}
+void tpmback_set_close_callback(void (*cb)(domid_t, unsigned int))
+{
+   gtpmdev.close_callback = cb;
+}
+void tpmback_set_suspend_callback(void (*cb)(domid_t, unsigned int))
+{
+   gtpmdev.suspend_callback = cb;
+}
+void tpmback_set_resume_callback(void (*cb)(domid_t, unsigned int))
+{
+   gtpmdev.resume_callback = cb;
+}
+
+static void event_listener(void)
+{
+   const char* bepath = "backend/vtpm";
+   char **path;
+   char* err;
+
+   /* Setup the backend device watch */
+   if((err = xenbus_watch_path_token(XBT_NIL, bepath, bepath, &gtpmdev.events)) != NULL) {
+      TPMBACK_ERR("xenbus_watch_path_token(%s) failed with error %s!\n", bepath, err);
+      free(err);
+      goto egress;
+   }
+
+   /* Check for any frontends that connected before we set the watch.
+    * This is almost guaranteed to happen if both domains are started
+    * immediatly one after the other.
+    * We do this by manually generating events on everything in the backend
+    * path */
+   generate_backend_events(bepath);
+
+   /* Wait and listen for changes in frontend connections */
+   while(1) {
+      path = xenbus_wait_for_watch_return(&gtpmdev.events);
+
+      /*If quit flag was set then exit */
+      if(gtpmdev.flags & TPMIF_CLOSED) {
+	 TPMBACK_DEBUG("listener thread got quit event. Exiting..\n");
+	 free(path);
+	 break;
+      }
+      handle_backend_event(*path);
+      free(path);
+
+   }
+
+   if((err = xenbus_unwatch_path_token(XBT_NIL, bepath, bepath)) != NULL) {
+      free(err);
+   }
+egress:
+   return;
+}
+
+void event_thread(void* p) {
+   event_listener();
+}
+
+void init_tpmback(void)
+{
+   if(!globalinit) {
+      init_waitqueue_head(&waitq);
+      globalinit = 1;
+   }
+   printk("============= Init TPM BACK ================\n");
+   gtpmdev.tpmlist = malloc(sizeof(tpmif_t*) * DEF_ARRAY_SIZE);
+   gtpmdev.num_alloc = DEF_ARRAY_SIZE;
+   gtpmdev.num_tpms = 0;
+   gtpmdev.flags = 0;
+
+   gtpmdev.open_callback = gtpmdev.close_callback = NULL;
+   gtpmdev.suspend_callback = gtpmdev.resume_callback = NULL;
+
+   eventthread = create_thread("tpmback-listener", event_thread, NULL);
+
+}
+
+void shutdown_tpmback(void)
+{
+   /* Disable callbacks */
+   gtpmdev.open_callback = gtpmdev.close_callback = NULL;
+   gtpmdev.suspend_callback = gtpmdev.resume_callback = NULL;
+
+   TPMBACK_LOG("Shutting down tpm backend\n");
+   /* Set the quit flag */
+   gtpmdev.flags = TPMIF_CLOSED;
+
+   //printk("num tpms is %d\n", gtpmdev.num_tpms);
+   /*Free all backend instances */
+   while(gtpmdev.num_tpms) {
+      free_tpmif(gtpmdev.tpmlist[0]);
+   }
+   free(gtpmdev.tpmlist);
+   gtpmdev.tpmlist = NULL;
+   gtpmdev.num_alloc = 0;
+
+   /* Wake up anyone possibly waiting on the device and let them exit */
+   wake_up(&waitq);
+   schedule();
+}
+
+inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, unsigned char uuid[16])
+{
+   tpmcmd->domid = domid;
+   tpmcmd->handle = handle;
+   memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
+   tpmcmd->req = NULL;
+   tpmcmd->req_len = 0;
+   tpmcmd->resp = NULL;
+   tpmcmd->resp_len = 0;
+}
+
+tpmcmd_t* get_request(tpmif_t* tpmif) {
+   tpmcmd_t* cmd;
+   tpmif_tx_request_t* tx;
+   int offset;
+   int tocopy;
+   int i;
+   uint32_t domid;
+   int flags;
+
+   local_irq_save(flags);
+
+   /* Allocate the cmd object to hold the data */
+   if((cmd = malloc(sizeof(*cmd))) == NULL) {
+      goto error;
+   }
+   init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);
+
+   tx = &tpmif->tx->ring[0].req;
+   cmd->req_len = tx->size;
+   /* Allocate the buffer */
+   if(cmd->req_len) {
+      if((cmd->req = malloc(cmd->req_len)) == NULL) {
+	 goto error;
+      }
+   }
+   /* Copy the bits from the shared pages */
+   offset = 0;
+   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->req_len; ++i) {
+      tx = &tpmif->tx->ring[i].req;
+
+      /* Map the page with the data */
+      domid = (uint32_t)tpmif->domid;
+      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_READ)) == NULL) {
+	 TPMBACK_ERR("%u/%u Unable to map shared page during read!\n", (unsigned int) tpmif->domid, tpmif->handle);
+	 goto error;
+      }
+
+      /* do the copy now */
+      tocopy = min(cmd->req_len - offset, PAGE_SIZE);
+      memcpy(&cmd->req[offset], tpmif->pages[i], tocopy);
+      offset += tocopy;
+
+      /* release the page */
+      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
+
+   }
+
+#ifdef TPMBACK_PRINT_DEBUG
+   TPMBACK_DEBUG("Received Tpm Command from %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->req_len);
+   for(i = 0; i < cmd->req_len; ++i) {
+      if (!(i % 30)) {
+	 TPMBACK_DEBUG_MORE("\n");
+      }
+      TPMBACK_DEBUG_MORE("%02hhX ", cmd->req[i]);
+   }
+   TPMBACK_DEBUG_MORE("\n\n");
+#endif
+
+   local_irq_restore(flags);
+   return cmd;
+error:
+   if(cmd != NULL) {
+      if (cmd->req != NULL) {
+	 free(cmd->req);
+	 cmd->req = NULL;
+      }
+      free(cmd);
+      cmd = NULL;
+   }
+   local_irq_restore(flags);
+   return NULL;
+
+}
+
+void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
+{
+   tpmif_tx_request_t* tx;
+   int offset;
+   int i;
+   uint32_t domid;
+   int tocopy;
+   int flags;
+
+   local_irq_save(flags);
+
+   tx = &tpmif->tx->ring[0].req;
+   tx->size = cmd->resp_len;
+
+   offset = 0;
+   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->resp_len; ++i) {
+      tx = &tpmif->tx->ring[i].req;
+
+      /* Map the page with the data */
+      domid = (uint32_t)tpmif->domid;
+      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_WRITE)) == NULL) {
+	 TPMBACK_ERR("%u/%u Unable to map shared page during write!\n", (unsigned int) tpmif->domid, tpmif->handle);
+	 goto error;
+      }
+
+      /* do the copy now */
+      tocopy = min(cmd->resp_len - offset, PAGE_SIZE);
+      memcpy(tpmif->pages[i], &cmd->resp[offset], tocopy);
+      offset += tocopy;
+
+      /* release the page */
+      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
+
+   }
+
+#ifdef TPMBACK_PRINT_DEBUG
+   TPMBACK_DEBUG("Sent response to %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->resp_len);
+   for(i = 0; i < cmd->resp_len; ++i) {
+      if (!(i % 30)) {
+	 TPMBACK_DEBUG_MORE("\n");
+      }
+      TPMBACK_DEBUG_MORE("%02hhX ", cmd->resp[i]);
+   }
+   TPMBACK_DEBUG_MORE("\n\n");
+#endif
+   /* clear the ready flag and send the event channel notice to the frontend */
+   tpmif_req_finished(tpmif);
+   notify_remote_via_evtchn(tpmif->evtchn);
+error:
+   local_irq_restore(flags);
+   return;
+}
+
+tpmcmd_t* tpmback_req_any(void)
+{
+   int i;
+   /* Block until something has a request */
+   wait_event(waitq, (gtpmdev.flags & (TPMIF_REQ_READY | TPMIF_CLOSED)));
+
+   /* Check if were shutting down */
+   if(gtpmdev.flags & TPMIF_CLOSED) {
+      /* if something was waiting for us to give up the queue so it can shutdown, let it finish */
+      schedule();
+      return NULL;
+   }
+
+   for(i = 0; i < gtpmdev.num_tpms; ++i) {
+      if(gtpmdev.tpmlist[i]->flags & TPMIF_REQ_READY) {
+	 return get_request(gtpmdev.tpmlist[i]);
+      }
+   }
+
+   TPMBACK_ERR("backend request ready flag was set but no interfaces were actually ready\n");
+   return NULL;
+}
+
+tpmcmd_t* tpmback_req(domid_t domid, unsigned int handle)
+{
+   tpmif_t* tpmif;
+   tpmif = get_tpmif(domid, handle);
+   if(tpmif == NULL) {
+      return NULL;
+   }
+
+   wait_event(waitq, (tpmif->flags & (TPMIF_REQ_READY | TPMIF_CLOSED) || gtpmdev.flags & TPMIF_CLOSED));
+
+   /* Check if were shutting down */
+   if(tpmif->flags & TPMIF_CLOSED || gtpmdev.flags & TPMIF_CLOSED) {
+      /* if something was waiting for us to give up the queue so it can free this instance, let it finish */
+      schedule();
+      return NULL;
+   }
+
+   return get_request(tpmif);
+}
+
+void tpmback_resp(tpmcmd_t* tpmcmd)
+{
+   tpmif_t* tpmif;
+
+   /* Get the associated interface, if it doesnt exist then just quit */
+   tpmif = get_tpmif(tpmcmd->domid, tpmcmd->handle);
+   if(tpmif == NULL) {
+      TPMBACK_ERR("Tried to send a reponse to non existant frontend %u/%u\n", (unsigned int) tpmcmd->domid, tpmcmd->handle);
+      goto end;
+   }
+
+   if(!(tpmif->flags & TPMIF_REQ_READY)) {
+      TPMBACK_ERR("Tried to send response to a frontend that was not waiting for one %u/%u\n", (unsigned int) tpmcmd->domid, tpmcmd->handle);
+      goto end;
+   }
+
+   /* Send response to frontend */
+   send_response(tpmcmd, tpmif);
+
+end:
+   if(tpmcmd->req != NULL) {
+      free(tpmcmd->req);
+   }
+   free(tpmcmd);
+   return;
+}
+
+int tpmback_wait_for_frontend_connect(domid_t *domid, unsigned int *handle)
+{
+   tpmif_t* tpmif;
+   int flags;
+   wait_event(waitq, ((gtpmdev.num_tpms > 0) || gtpmdev.flags & TPMIF_CLOSED));
+   if(gtpmdev.flags & TPMIF_CLOSED) {
+      return -1;
+   }
+   local_irq_save(flags);
+   tpmif = gtpmdev.tpmlist[0];
+   *domid = tpmif->domid;
+   *handle = tpmif->handle;
+   local_irq_restore(flags);
+
+   return 0;
+}
+
+int tpmback_num_frontends(void)
+{
+   return gtpmdev.num_tpms;
+}
diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
new file mode 100644
index 0000000..0218d7f
--- /dev/null
+++ b/extras/mini-os/tpmfront.c
@@ -0,0 +1,608 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * This code has been derived from drivers/char/tpm_vtpm.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (C) 2006 IBM Corporation
+ *
+ * This code has also been derived from drivers/char/tpm_xen.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * which was itself derived from drivers/xen/netfront/netfront.c
+ * from the linux kernel
+ *
+ * Copyright (c) 2002-2004, K A Fraser
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, version 2 of the
+ * License.
+ */
+#include <mini-os/os.h>
+#include <mini-os/xenbus.h>
+#include <mini-os/xmalloc.h>
+#include <mini-os/events.h>
+#include <mini-os/wait.h>
+#include <mini-os/gnttab.h>
+#include <xen/io/xenbus.h>
+#include <xen/io/tpmif.h>
+#include <mini-os/tpmfront.h>
+#include <fcntl.h>
+
+//#define TPMFRONT_PRINT_DEBUG
+#ifdef TPMFRONT_PRINT_DEBUG
+#define TPMFRONT_DEBUG(fmt,...) printk("Tpmfront:Debug("__FILE__":%d) " fmt, __LINE__, ##__VA_ARGS__)
+#define TPMFRONT_DEBUG_MORE(fmt,...) printk(fmt, ##__VA_ARGS__)
+#else
+#define TPMFRONT_DEBUG(fmt,...)
+#endif
+#define TPMFRONT_ERR(fmt,...) printk("Tpmfront:Error " fmt, ##__VA_ARGS__)
+#define TPMFRONT_LOG(fmt,...) printk("Tpmfront:Info " fmt, ##__VA_ARGS__)
+
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+
+void tpmfront_handler(evtchn_port_t port, struct pt_regs *regs, void *data) {
+   struct tpmfront_dev* dev = (struct tpmfront_dev*) data;
+   /*If we get a response when we didnt make a request, just ignore it */
+   if(!dev->waiting) {
+      return;
+   }
+
+   dev->waiting = 0;
+#ifdef HAVE_LIBC
+   if(dev->fd >= 0) {
+      files[dev->fd].read = 1;
+   }
+#endif
+   wake_up(&dev->waitq);
+}
+
+static int publish_xenbus(struct tpmfront_dev* dev) {
+   xenbus_transaction_t xbt;
+   int retry;
+   char* err;
+   /* Write the grant reference and event channel to xenstore */
+again:
+   if((err = xenbus_transaction_start(&xbt))) {
+      TPMFRONT_ERR("Unable to start xenbus transaction, error was %s\n", err);
+      free(err);
+      return -1;
+   }
+
+   if((err = xenbus_printf(xbt, dev->nodename, "ring-ref", "%u", (unsigned int) dev->ring_ref))) {
+      TPMFRONT_ERR("Unable to write %s/ring-ref, error was %s\n", dev->nodename, err);
+      free(err);
+      goto abort_transaction;
+   }
+
+   if((err = xenbus_printf(xbt, dev->nodename, "event-channel", "%u", (unsigned int) dev->evtchn))) {
+      TPMFRONT_ERR("Unable to write %s/event-channel, error was %s\n", dev->nodename, err);
+      free(err);
+      goto abort_transaction;
+   }
+
+   if((err = xenbus_transaction_end(xbt, 0, &retry))) {
+      TPMFRONT_ERR("Unable to complete xenbus transaction, error was %s\n", err);
+      free(err);
+      return -1;
+   }
+   if(retry) {
+      goto again;
+   }
+
+   return 0;
+abort_transaction:
+   if((err = xenbus_transaction_end(xbt, 1, &retry))) {
+      free(err);
+   }
+   return -1;
+}
+
+static int wait_for_backend_connect(xenbus_event_queue* events, char* path)
+{
+   int state;
+
+   TPMFRONT_LOG("Waiting for backend connection..\n");
+   /* Wait for the backend to connect */
+   while(1) {
+      state = xenbus_read_integer(path);
+      if ( state < 0)
+	 state = XenbusStateUnknown;
+      switch(state) {
+	 /* Bad states, we quit with error */
+	 case XenbusStateUnknown:
+	 case XenbusStateClosing:
+	 case XenbusStateClosed:
+	    TPMFRONT_ERR("Unable to connect to backend\n");
+	    return -1;
+	 /* If backend is connected then break out of loop */
+	 case XenbusStateConnected:
+	    TPMFRONT_LOG("Backend Connected\n");
+	    return 0;
+	 default:
+	    xenbus_wait_for_watch(events);
+      }
+   }
+
+}
+
+static int wait_for_backend_closed(xenbus_event_queue* events, char* path)
+{
+   int state;
+
+   TPMFRONT_LOG("Waiting for backend to close..\n");
+   while(1) {
+      state = xenbus_read_integer(path);
+      if ( state < 0)
+	 state = XenbusStateUnknown;
+      switch(state) {
+	 case XenbusStateUnknown:
+	    TPMFRONT_ERR("Backend Unknown state, forcing shutdown\n");
+	    return -1;
+	 case XenbusStateClosed:
+	    TPMFRONT_LOG("Backend Closed\n");
+	    return 0;
+	 default:
+	    xenbus_wait_for_watch(events);
+      }
+   }
+
+}
+
+static int wait_for_backend_state_changed(struct tpmfront_dev* dev, XenbusState state) {
+   char* err;
+   int ret = 0;
+   xenbus_event_queue events = NULL;
+   char path[512];
+
+   snprintf(path, 512, "%s/state", dev->bepath);
+   /*Setup the watch to wait for the backend */
+   if((err = xenbus_watch_path_token(XBT_NIL, path, path, &events))) {
+      TPMFRONT_ERR("Could not set a watch on %s, error was %s\n", path, err);
+      free(err);
+      return -1;
+   }
+
+   /* Do the actual wait loop now */
+   switch(state) {
+      case XenbusStateConnected:
+	 ret = wait_for_backend_connect(&events, path);
+	 break;
+      case XenbusStateClosed:
+	 ret = wait_for_backend_closed(&events, path);
+	 break;
+      default:
+	 break;
+   }
+
+   if((err = xenbus_unwatch_path_token(XBT_NIL, path, path))) {
+      TPMFRONT_ERR("Unable to unwatch %s, error was %s, ignoring..\n", path, err);
+      free(err);
+   }
+   return ret;
+}
+
+static int tpmfront_connect(struct tpmfront_dev* dev)
+{
+   char* err;
+   /* Create shared page */
+   dev->tx = (tpmif_tx_interface_t*) alloc_page();
+   if(dev->tx == NULL) {
+      TPMFRONT_ERR("Unable to allocate page for shared memory\n");
+      goto error;
+   }
+   memset(dev->tx, 0, PAGE_SIZE);
+   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->tx), 0);
+   TPMFRONT_DEBUG("grant ref is %lu\n", (unsigned long) dev->ring_ref);
+
+   /*Create event channel */
+   if(evtchn_alloc_unbound(dev->bedomid, tpmfront_handler, dev, &dev->evtchn)) {
+      TPMFRONT_ERR("Unable to allocate event channel\n");
+      goto error_postmap;
+   }
+   unmask_evtchn(dev->evtchn);
+   TPMFRONT_DEBUG("event channel is %lu\n", (unsigned long) dev->evtchn);
+
+   /* Write the entries to xenstore */
+   if(publish_xenbus(dev)) {
+      goto error_postevtchn;
+   }
+
+   /* Change state to connected */
+   dev->state = XenbusStateConnected;
+
+   /* Tell the backend that we are ready */
+   if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", dev->state))) {
+      TPMFRONT_ERR("Unable to write to xenstore %s/state, value=%u", dev->nodename, XenbusStateConnected);
+      free(err);
+      goto error;
+   }
+
+   return 0;
+error_postevtchn:
+      mask_evtchn(dev->evtchn);
+      unbind_evtchn(dev->evtchn);
+error_postmap:
+      gnttab_end_access(dev->ring_ref);
+      free_page(dev->tx);
+error:
+   return -1;
+}
+
+struct tpmfront_dev* init_tpmfront(const char* _nodename)
+{
+   struct tpmfront_dev* dev;
+   const char* nodename;
+   char path[512];
+   char* value, *err;
+   unsigned long long ival;
+   int i;
+
+   printk("============= Init TPM Front ================\n");
+
+   dev = malloc(sizeof(struct tpmfront_dev));
+   memset(dev, 0, sizeof(struct tpmfront_dev));
+
+#ifdef HAVE_LIBC
+   dev->fd = -1;
+#endif
+
+   nodename = _nodename ? _nodename : "device/vtpm/0";
+   dev->nodename = strdup(nodename);
+
+   init_waitqueue_head(&dev->waitq);
+
+   /* Get backend domid */
+   snprintf(path, 512, "%s/backend-id", dev->nodename);
+   if((err = xenbus_read(XBT_NIL, path, &value))) {
+      TPMFRONT_ERR("Unable to read %s during tpmfront initialization! error = %s\n", path, err);
+      free(err);
+      goto error;
+   }
+   if(sscanf(value, "%llu", &ival) != 1) {
+      TPMFRONT_ERR("%s has non-integer value (%s)\n", path, value);
+      free(value);
+      goto error;
+   }
+   free(value);
+   dev->bedomid = ival;
+
+   /* Get backend xenstore path */
+   snprintf(path, 512, "%s/backend", dev->nodename);
+   if((err = xenbus_read(XBT_NIL, path, &dev->bepath))) {
+      TPMFRONT_ERR("Unable to read %s during tpmfront initialization! error = %s\n", path, err);
+      free(err);
+      goto error;
+   }
+
+   /* Create and publish grant reference and event channel */
+   if (tpmfront_connect(dev)) {
+      goto error;
+   }
+
+   /* Wait for backend to connect */
+   if( wait_for_backend_state_changed(dev, XenbusStateConnected)) {
+      goto error;
+   }
+
+   /* Allocate pages that will contain the messages */
+   dev->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE);
+   if(dev->pages == NULL) {
+      goto error;
+   }
+   memset(dev->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
+   for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
+      dev->pages[i] = (void*)alloc_page();
+      if(dev->pages[i] == NULL) {
+	 goto error;
+      }
+   }
+
+   TPMFRONT_LOG("Initialization Completed successfully\n");
+
+   return dev;
+
+error:
+   shutdown_tpmfront(dev);
+   return NULL;
+}
+void shutdown_tpmfront(struct tpmfront_dev* dev)
+{
+   char* err;
+   char path[512];
+   int i;
+   tpmif_tx_request_t* tx;
+   if(dev == NULL) {
+      return;
+   }
+   TPMFRONT_LOG("Shutting down tpmfront\n");
+   /* disconnect */
+   if(dev->state == XenbusStateConnected) {
+      dev->state = XenbusStateClosing;
+      //FIXME: Transaction for this?
+      /* Tell backend we are closing */
+      if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
+	 free(err);
+      }
+
+      /* Clean up xenstore entries */
+      snprintf(path, 512, "%s/event-channel", dev->nodename);
+      if((err = xenbus_rm(XBT_NIL, path))) {
+	 free(err);
+      }
+      snprintf(path, 512, "%s/ring-ref", dev->nodename);
+      if((err = xenbus_rm(XBT_NIL, path))) {
+	 free(err);
+      }
+
+      /* Tell backend we are closed */
+      dev->state = XenbusStateClosed;
+      if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
+	 TPMFRONT_ERR("Unable to write to %s, error was %s", dev->nodename, err);
+	 free(err);
+      }
+
+      /* Wait for the backend to close and unmap shared pages, ignore any errors */
+      wait_for_backend_state_changed(dev, XenbusStateClosed);
+
+      /* Cleanup any shared pages */
+      if(dev->pages) {
+	 for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
+	    if(dev->pages[i]) {
+	       tx = &dev->tx->ring[i].req;
+	       if(tx->ref != 0) {
+		  gnttab_end_access(tx->ref);
+	       }
+	       free_page(dev->pages[i]);
+	    }
+	 }
+	 free(dev->pages);
+      }
+
+      /* Close event channel and unmap shared page */
+      mask_evtchn(dev->evtchn);
+      unbind_evtchn(dev->evtchn);
+      gnttab_end_access(dev->ring_ref);
+
+      free_page(dev->tx);
+
+   }
+
+   /* Cleanup memory usage */
+   if(dev->respbuf) {
+      free(dev->respbuf);
+   }
+   if(dev->bepath) {
+      free(dev->bepath);
+   }
+   if(dev->nodename) {
+      free(dev->nodename);
+   }
+   free(dev);
+}
+
+int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
+{
+   int i;
+   tpmif_tx_request_t* tx = NULL;
+   /* Error Checking */
+   if(dev == NULL || dev->state != XenbusStateConnected) {
+      TPMFRONT_ERR("Tried to send message through disconnected frontend\n");
+      return -1;
+   }
+
+#ifdef TPMFRONT_PRINT_DEBUG
+   TPMFRONT_DEBUG("Sending Msg to backend size=%u", (unsigned int) length);
+   for(i = 0; i < length; ++i) {
+      if(!(i % 30)) {
+	 TPMFRONT_DEBUG_MORE("\n");
+      }
+      TPMFRONT_DEBUG_MORE("%02X ", msg[i]);
+   }
+   TPMFRONT_DEBUG_MORE("\n");
+#endif
+
+   /* Copy to shared pages now */
+   for(i = 0; length > 0 && i < TPMIF_TX_RING_SIZE; ++i) {
+      /* Share the page */
+      tx = &dev->tx->ring[i].req;
+      tx->unused = 0;
+      tx->addr = virt_to_mach(dev->pages[i]);
+      tx->ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->pages[i]), 0);
+      /* Copy the bits to the page */
+      tx->size = length > PAGE_SIZE ? PAGE_SIZE : length;
+      memcpy(dev->pages[i], &msg[i * PAGE_SIZE], tx->size);
+
+      /* Update counters */
+      length -= tx->size;
+   }
+   dev->waiting = 1;
+   dev->resplen = 0;
+#ifdef HAVE_LIBC
+   if(dev->fd >= 0) {
+      files[dev->fd].read = 0;
+      files[dev->fd].tpmfront.respgot = 0;
+      files[dev->fd].tpmfront.offset = 0;
+   }
+#endif
+   notify_remote_via_evtchn(dev->evtchn);
+   return 0;
+}
+int tpmfront_recv(struct tpmfront_dev* dev, uint8_t** msg, size_t *length)
+{
+   tpmif_tx_request_t* tx;
+   int i;
+   if(dev == NULL || dev->state != XenbusStateConnected) {
+      TPMFRONT_ERR("Tried to receive message from disconnected frontend\n");
+      return -1;
+   }
+   /*Wait for the response */
+   wait_event(dev->waitq, (!dev->waiting));
+
+   /* Initialize */
+   *msg = NULL;
+   *length = 0;
+
+   /* special case, just quit */
+   tx = &dev->tx->ring[0].req;
+   if(tx->size == 0 ) {
+       goto quit;
+   }
+   /* Get the total size */
+   tx = &dev->tx->ring[0].req;
+   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
+      tx = &dev->tx->ring[i].req;
+      *length += tx->size;
+   }
+   /* Alloc the buffer */
+   if(dev->respbuf) {
+      free(dev->respbuf);
+   }
+   *msg = dev->respbuf = malloc(*length);
+   dev->resplen = *length;
+   /* Copy the bits */
+   tx = &dev->tx->ring[0].req;
+   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
+      tx = &dev->tx->ring[i].req;
+      memcpy(&(*msg)[i * PAGE_SIZE], dev->pages[i], tx->size);
+      gnttab_end_access(tx->ref);
+      tx->ref = 0;
+   }
+#ifdef TPMFRONT_PRINT_DEBUG
+   TPMFRONT_DEBUG("Received response from backend size=%u", (unsigned int) *length);
+   for(i = 0; i < *length; ++i) {
+      if(!(i % 30)) {
+	 TPMFRONT_DEBUG_MORE("\n");
+      }
+      TPMFRONT_DEBUG_MORE("%02X ", (*msg)[i]);
+   }
+   TPMFRONT_DEBUG_MORE("\n");
+#endif
+#ifdef HAVE_LIBC
+   if(dev->fd >= 0) {
+      files[dev->fd].tpmfront.respgot = 1;
+   }
+#endif
+quit:
+   return 0;
+}
+
+int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen)
+{
+   int rc;
+   if((rc = tpmfront_send(dev, req, reqlen))) {
+      return rc;
+   }
+   if((rc = tpmfront_recv(dev, resp, resplen))) {
+      return rc;
+   }
+
+   return 0;
+}
+
+#ifdef HAVE_LIBC
+#include <errno.h>
+int tpmfront_open(struct tpmfront_dev* dev)
+{
+   /* Silently prevent multiple opens */
+   if(dev->fd != -1) {
+      return dev->fd;
+   }
+
+   dev->fd = alloc_fd(FTYPE_TPMFRONT);
+   printk("tpmfront_open(%s) -> %d\n", dev->nodename, dev->fd);
+   files[dev->fd].tpmfront.dev = dev;
+   files[dev->fd].tpmfront.offset = 0;
+   files[dev->fd].tpmfront.respgot = 0;
+   return dev->fd;
+}
+
+int tpmfront_posix_write(int fd, const uint8_t* buf, size_t count)
+{
+   int rc;
+   struct tpmfront_dev* dev;
+   dev = files[fd].tpmfront.dev;
+
+   if(count == 0) {
+      return 0;
+   }
+
+   /* Return an error if we are already processing a command */
+   if(dev->waiting) {
+      errno = EINPROGRESS;
+      return -1;
+   }
+   /* Send the command now */
+   if((rc = tpmfront_send(dev, buf, count)) != 0) {
+      errno = EIO;
+      return -1;
+   }
+   return count;
+}
+
+int tpmfront_posix_read(int fd, uint8_t* buf, size_t count)
+{
+   int rc;
+   uint8_t* dummybuf;
+   size_t dummysz;
+   struct tpmfront_dev* dev;
+
+   dev = files[fd].tpmfront.dev;
+
+   if(count == 0) {
+      return 0;
+   }
+
+   /* get the response if we haven't already */
+   if(files[dev->fd].tpmfront.respgot == 0) {
+      if ((rc = tpmfront_recv(dev, &dummybuf, &dummysz)) != 0) {
+	 errno = EIO;
+	 return -1;
+      }
+   }
+
+   /* handle EOF case */
+   if(files[dev->fd].tpmfront.offset >= dev->resplen) {
+      return 0;
+   }
+
+   /* Compute the number of bytes and do the copy operation */
+   if((rc = min(count, dev->resplen - files[dev->fd].tpmfront.offset)) != 0) {
+      memcpy(buf, dev->respbuf + files[dev->fd].tpmfront.offset, rc);
+      files[dev->fd].tpmfront.offset += rc;
+   }
+
+   return rc;
+}
+
+int tpmfront_posix_fstat(int fd, struct stat* buf)
+{
+   uint8_t* dummybuf;
+   size_t dummysz;
+   int rc;
+   struct tpmfront_dev* dev = files[fd].tpmfront.dev;
+
+   /* If we have a response waiting, then read it now from the backend
+    * so we can get its length*/
+   if(dev->waiting || (files[dev->fd].read == 1 && !files[dev->fd].tpmfront.respgot)) {
+      if ((rc = tpmfront_recv(dev, &dummybuf, &dummysz)) != 0) {
+	 errno = EIO;
+	 return -1;
+      }
+   }
+
+   buf->st_mode = O_RDWR;
+   buf->st_uid = 0;
+   buf->st_gid = 0;
+   buf->st_size = dev->resplen;
+   buf->st_atime = buf->st_mtime = buf->st_ctime = time(NULL);
+
+   return 0;
+}
+
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:34:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:34:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1Su-00051h-2J; Thu, 01 Nov 2012 20:34:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TU1Sr-000519-2g
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:34:09 +0000
Received: from [85.158.138.51:41257] by server-15.bemta-3.messagelabs.com id
	27/F9-09445-FBCD2905; Thu, 01 Nov 2012 20:34:07 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-8.tower-174.messagelabs.com!1351802041!28289883!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24016 invoked from network); 1 Nov 2012 20:34:03 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-8.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 20:34:03 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148030871;
	Thu, 01 Nov 2012 16:33:38 -0400
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com, xen-devel@lists.xen.org,
	samuel.thibault@ens-lyon.org
Date: Thu,  1 Nov 2012 16:33:26 -0400
Message-Id: <1351802007-19178-3-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM 3/9] add tpmfront, tpm_tis,
	and tpmback drivers to mini-os
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch adds 3 new drivers to mini-os.

tpmfront - paravirtualized tpm frontend driver
tpmback - paravirtualized tpm backend driver
tpm_tis - hardware tpm driver

Unfortunately these drivers were derived from GPL
licensed linux kernel drivers so they must carry
the GPL license. However, since mini-os now
supports conditional compilation, hopefully these
drivers can be included into the xen tree and
conditionally removed from non-gpl projects.
By default they are disabled in the makefile.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

diff --git a/extras/mini-os/Makefile b/extras/mini-os/Makefile
index 2422db3..2302a23 100644
--- a/extras/mini-os/Makefile
+++ b/extras/mini-os/Makefile
@@ -22,6 +22,9 @@ CONFIG_QEMU_XS_ARGS ?= n
 CONFIG_TEST ?= n
 CONFIG_PCIFRONT ?= n
 CONFIG_BLKFRONT ?= y
+CONFIG_TPMFRONT ?= n
+CONFIG_TPM_TIS ?= n
+CONFIG_TPMBACK ?= n
 CONFIG_NETFRONT ?= y
 CONFIG_FBFRONT ?= y
 CONFIG_KBDFRONT ?= y
@@ -36,6 +39,9 @@ flags-$(CONFIG_SPARSE_BSS) += -DCONFIG_SPARSE_BSS
 flags-$(CONFIG_QEMU_XS_ARGS) += -DCONFIG_QEMU_XS_ARGS
 flags-$(CONFIG_PCIFRONT) += -DCONFIG_PCIFRONT
 flags-$(CONFIG_BLKFRONT) += -DCONFIG_BLKFRONT
+flags-$(CONFIG_TPMFRONT) += -DCONFIG_TPMFRONT
+flags-$(CONFIG_TPM_TIS) += -DCONFIG_TPM_TIS
+flags-$(CONFIG_TPMBACK) += -DCONFIG_TPMBACK
 flags-$(CONFIG_NETFRONT) += -DCONFIG_NETFRONT
 flags-$(CONFIG_KBDFRONT) += -DCONFIG_KBDFRONT
 flags-$(CONFIG_FBFRONT) += -DCONFIG_FBFRONT
@@ -67,6 +73,9 @@ TARGET := mini-os
 SUBDIRS := lib xenbus console
 
 src-$(CONFIG_BLKFRONT) += blkfront.c
+src-$(CONFIG_TPMFRONT) += tpmfront.c
+src-$(CONFIG_TPM_TIS) += tpm_tis.c
+src-$(CONFIG_TPMBACK) += tpmback.c
 src-y += daytime.c
 src-y += events.c
 src-$(CONFIG_FBFRONT) += fbfront.c
diff --git a/extras/mini-os/include/lib.h b/extras/mini-os/include/lib.h
index d4641b6..935bede 100644
--- a/extras/mini-os/include/lib.h
+++ b/extras/mini-os/include/lib.h
@@ -142,6 +142,8 @@ enum fd_type {
     FTYPE_FB,
     FTYPE_MEM,
     FTYPE_SAVEFILE,
+    FTYPE_TPMFRONT,
+    FTYPE_TPM_TIS,
 };
 
 LIST_HEAD(evtchn_port_list, evtchn_port_info);
@@ -185,6 +187,20 @@ extern struct file {
 	struct {
 	    struct consfront_dev *dev;
 	} cons;
+#ifdef CONFIG_TPMFRONT
+	struct {
+	   struct tpmfront_dev *dev;
+	   int respgot;
+	   off_t offset;
+	} tpmfront;
+#endif
+#ifdef CONFIG_TPM_TIS
+	struct {
+	   struct tpm_chip *dev;
+	   int respgot;
+	   off_t offset;
+	} tpm_tis;
+#endif
 #ifdef CONFIG_XENBUS
         struct {
             /* To each xenbus FD is associated a queue of watch events for this
diff --git a/extras/mini-os/include/tpm_tis.h b/extras/mini-os/include/tpm_tis.h
new file mode 100644
index 0000000..1faca0d
--- /dev/null
+++ b/extras/mini-os/include/tpm_tis.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * This code has been derived from drivers/char/tpm.c
+ * from the linux kernel
+ *
+ * Copyright (C) 2004 IBM Corporation
+ *
+ * This code has also been derived from drivers/char/tpm/tpm_tis.c
+ * from the linux kernel
+ *
+ * Copyright (C) 2005, 2006 IBM Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, version 2
+ * of the License
+ */
+#ifndef TPM_TIS_H
+#define TPM_TIS_H
+
+#include <mini-os/types.h>
+#include <mini-os/byteorder.h>
+
+#define TPM_TIS_EN_LOCL0 1
+#define TPM_TIS_EN_LOCL1 (1 << 1)
+#define TPM_TIS_EN_LOCL2 (1 << 2)
+#define TPM_TIS_EN_LOCL3 (1 << 3)
+#define TPM_TIS_EN_LOCL4 (1 << 4)
+#define TPM_TIS_EN_LOCLALL (TPM_TIS_EN_LOCL0 | TPM_TIS_EN_LOCL1  | TPM_TIS_EN_LOCL2 | TPM_TIS_EN_LOCL3 | TPM_TIS_EN_LOCL4)
+#define TPM_TIS_LOCL_INT_TO_FLAG(x) (1 << x)
+#define TPM_BASEADDR 0xFED40000
+#define TPM_PROBE_IRQ 0xFFFF
+
+struct tpm_chip;
+
+struct tpm_chip* init_tpm_tis(unsigned long baseaddr, int localities, unsigned int irq);
+void shutdown_tpm_tis(struct tpm_chip* tpm);
+
+int tpm_tis_request_locality(struct tpm_chip* tpm, int locality);
+int tpm_tis_cmd(struct tpm_chip* tpm, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen);
+
+#ifdef HAVE_LIBC
+#include <sys/stat.h>
+#include <fcntl.h>
+/* POSIX IO functions:
+ * use tpm_tis_open() to get a file descriptor to the tpm device
+ * use write() on the fd to send a command to the backend. You must
+ * include the entire command in a single call to write().
+ * use read() on the fd to read the response. You can use
+ * fstat() to get the size of the response and lseek() to seek on it.
+ */
+int tpm_tis_open(struct tpm_chip* tpm);
+int tpm_tis_posix_read(int fd, uint8_t* buf, size_t count);
+int tpm_tis_posix_write(int fd, const uint8_t* buf, size_t count);
+int tpm_tis_posix_fstat(int fd, struct stat* buf);
+#endif
+
+#endif
diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
new file mode 100644
index 0000000..ff86732
--- /dev/null
+++ b/extras/mini-os/include/tpmback.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * This code has been derived from drivers/xen/tpmback/tpmback.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * which was itself derived from drivers/xen/netback/netback.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2002-2004, K A Fraser
+ *
+ * This code has also been derived from drivers/xen/tpmback/xenbus.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (C) 2005 IBM Corporation
+ * Copyright (C) 2005 Rusty Russell <rusty@rustcorp.com.au>
+ *
+ * This code has also been derived from drivers/xen/tpmback/interface.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * which was itself also derived from drvivers/xen/netback/interface.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2004, Keir Fraser
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, version 2
+ * of the License
+ */
+
+#include <xen/io/tpmif.h>
+#include <xen/io/xenbus.h>
+#include <mini-os/types.h>
+#include <xen/xen.h>
+#ifndef TPMBACK_H
+#define TPMBACK_H
+
+struct tpmcmd {
+   domid_t domid;		/* Domid of the frontend */
+   unsigned int handle;	/* Handle of the frontend */
+   unsigned char uuid[16];			/* uuid of the tpm interface */
+
+   unsigned int req_len;		/* Size of the command in buf - set by tpmback driver */
+   uint8_t* req;			/* tpm command bits, allocated by driver, DON'T FREE IT */
+   unsigned int resp_len;	/* Size of the outgoing command,
+				   you set this before passing the cmd object to tpmback_resp */
+   uint8_t* resp;		/* Buffer for response - YOU MUST ALLOCATE IT, YOU MUST ALSO FREE IT */
+};
+typedef struct tpmcmd tpmcmd_t;
+
+/* Initialize the tpm backend driver */
+void init_tpmback(void);
+
+/* Shutdown tpm backend driver */
+void shutdown_tpmback(void);
+
+/* Blocks until a tpm command is sent from any front end.
+ * Returns a pointer to the tpm command to handle.
+ * Do not try to free this pointer or the req buffer
+ * This function will return NULL if the tpm backend driver
+ * is shutdown or any other error occurs */
+tpmcmd_t* tpmback_req_any(void);
+
+/* Blocks until a tpm command from the frontend at domid/handle
+ * is sent.
+ * Returns NULL if domid/handle is not connected, tpmback is
+ * shutdown or shutting down, or if there is an error
+ */
+tpmcmd_t* tpmback_req(domid_t domid, unsigned int handle);
+
+/* Send the response to the tpm command back to the frontend
+ * This function will free the tpmcmd object, but you must free the resp
+ * buffer yourself */
+void tpmback_resp(tpmcmd_t* tpmcmd);
+
+/* Waits for the first frontend to connect and then sets domid and handle appropriately.
+ * If one or more frontends are already connected, this will set domid and handle to one
+ * of them arbitrarily. The main use for this function is to wait until a single
+ * frontend connection has occured.
+ * returns 0 on success, non-zero on failure */
+int tpmback_wait_for_frontend_connect(domid_t *domid, unsigned int *handle);
+
+/* returns the number of frontends connected */
+int tpmback_num_frontends(void);
+
+/* Returns the uuid of the specified frontend, NULL on error.
+ * The return value is internally allocated, so don't free it */
+unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle);
+
+/* Specify a function to call when a new tpm device connects */
+void tpmback_set_open_callback(void (*cb)(domid_t, unsigned int));
+
+/* Specify a function to call when a tpm device disconnects */
+void tpmback_set_close_callback(void (*cb)(domid_t, unsigned int));
+
+//Not Implemented
+void tpmback_set_suspend_callback(void (*cb)(domid_t, unsigned int));
+void tpmback_set_resume_callback(void (*cb)(domid_t, unsigned int));
+
+#endif
diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include/tpmfront.h
new file mode 100644
index 0000000..fd2cb17
--- /dev/null
+++ b/extras/mini-os/include/tpmfront.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * This code has been derived from drivers/char/tpm_vtpm.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (C) 2006 IBM Corporation
+ *
+ * This code has also been derived from drivers/char/tpm_xen.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * which was itself derived from drivers/xen/netfront/netfront.c
+ * from the linux kernel
+ *
+ * Copyright (c) 2002-2004, K A Fraser
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, version 2 of the
+ * License.
+ */
+#ifndef TPMFRONT_H
+#define TPMFRONT_H
+
+#include <mini-os/types.h>
+#include <mini-os/os.h>
+#include <mini-os/events.h>
+#include <mini-os/wait.h>
+#include <xen/xen.h>
+#include <xen/io/xenbus.h>
+#include <xen/io/tpmif.h>
+
+struct tpmfront_dev {
+   grant_ref_t ring_ref;
+   evtchn_port_t evtchn;
+
+   tpmif_tx_interface_t* tx;
+
+   void** pages;
+
+   domid_t bedomid;
+   char* nodename;
+   char* bepath;
+
+   XenbusState state;
+
+   uint8_t waiting;
+   struct wait_queue_head waitq;
+
+   uint8_t* respbuf;
+   size_t resplen;
+
+#ifdef HAVE_LIBC
+   int fd;
+#endif
+
+};
+
+
+/*Initialize frontend */
+struct tpmfront_dev* init_tpmfront(const char* nodename);
+/*Shutdown frontend */
+void shutdown_tpmfront(struct tpmfront_dev* dev);
+
+/* Send a tpm command to the backend and wait for the response
+ *
+ * @dev - frontend device
+ * @req - request buffer
+ * @reqlen - length of request buffer
+ * @resp - *resp will be set to internal response buffer, don't free it! Value is undefined on error
+ * @resplen - *resplen will be set to the length of the response. Value is undefined on error
+ *
+ * returns 0 on success, non zero on failure.
+ * */
+int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen);
+
+#ifdef HAVE_LIBC
+#include <sys/stat.h>
+/* POSIX IO functions:
+ * use tpmfront_open() to get a file descriptor to the tpm device
+ * use write() on the fd to send a command to the backend. You must
+ * include the entire command in a single call to write().
+ * use read() on the fd to read the response. You can use
+ * fstat() to get the size of the response and lseek() to seek on it.
+ */
+int tpmfront_open(struct tpmfront_dev* dev);
+int tpmfront_posix_read(int fd, uint8_t* buf, size_t count);
+int tpmfront_posix_write(int fd, const uint8_t* buf, size_t count);
+int tpmfront_posix_fstat(int fd, struct stat* buf);
+#endif
+
+
+#endif
diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
index 6cb97b1..d212969 100644
--- a/extras/mini-os/lib/sys.c
+++ b/extras/mini-os/lib/sys.c
@@ -27,6 +27,8 @@
 #include <netfront.h>
 #include <blkfront.h>
 #include <fbfront.h>
+#include <tpmfront.h>
+#include <tpm_tis.h>
 #include <xenbus.h>
 #include <xenstore.h>
 
@@ -294,6 +296,16 @@ int read(int fd, void *buf, size_t nbytes)
 	    return blkfront_posix_read(fd, buf, nbytes);
         }
 #endif
+#ifdef CONFIG_TPMFRONT
+        case FTYPE_TPMFRONT: {
+	    return tpmfront_posix_read(fd, buf, nbytes);
+        }
+#endif
+#ifdef CONFIG_TPM_TIS
+        case FTYPE_TPM_TIS: {
+	    return tpm_tis_posix_read(fd, buf, nbytes);
+        }
+#endif
 	default:
 	    break;
     }
@@ -330,6 +342,14 @@ int write(int fd, const void *buf, size_t nbytes)
 	case FTYPE_BLK:
 	    return blkfront_posix_write(fd, buf, nbytes);
 #endif
+#ifdef CONFIG_TPMFRONT
+	case FTYPE_TPMFRONT:
+	    return tpmfront_posix_write(fd, buf, nbytes);
+#endif
+#ifdef CONFIG_TPM_TIS
+	case FTYPE_TPM_TIS:
+	    return tpm_tis_posix_write(fd, buf, nbytes);
+#endif
 	default:
 	    break;
     }
@@ -341,8 +361,16 @@ int write(int fd, const void *buf, size_t nbytes)
 off_t lseek(int fd, off_t offset, int whence)
 {
     switch(files[fd].type) {
+#if defined(CONFIG_BLKFRONT) || defined(CONFIG_TPMFRONT) || defined(CONFIG_TPM_TIS)
 #ifdef CONFIG_BLKFRONT
        case FTYPE_BLK:
+#endif
+#ifdef CONFIG_TPMFRNT
+       case FTYPE_TPMFRONT:
+#endif
+#ifdef CONFIG_TPM_TIS
+       case FTYPE_TPM_TIS:
+#endif
 	  switch (whence) {
 	     case SEEK_SET:
 		files[fd].file.offset = offset;
@@ -420,6 +448,18 @@ int close(int fd)
 	    files[fd].type = FTYPE_NONE;
 	    return 0;
 #endif
+#ifdef CONFIG_TPMFRONT
+	case FTYPE_TPMFRONT:
+            shutdown_tpmfront(files[fd].tpmfront.dev);
+	    files[fd].type = FTYPE_NONE;
+	    return 0;
+#endif
+#ifdef CONFIG_TPM_TIS
+	case FTYPE_TPM_TIS:
+            shutdown_tpm_tis(files[fd].tpm_tis.dev);
+	    files[fd].type = FTYPE_NONE;
+	    return 0;
+#endif
 #ifdef CONFIG_KBDFRONT
 	case FTYPE_KBD:
             shutdown_kbdfront(files[fd].kbd.dev);
@@ -489,6 +529,14 @@ int fstat(int fd, struct stat *buf)
 	case FTYPE_BLK:
 	   return blkfront_posix_fstat(fd, buf);
 #endif
+#ifdef CONFIG_TPMFRONT
+	case FTYPE_TPMFRONT:
+	   return tpmfront_posix_fstat(fd, buf);
+#endif
+#ifdef CONFIG_TPM_TIS
+	case FTYPE_TPM_TIS:
+	   return tpm_tis_posix_fstat(fd, buf);
+#endif
 	default:
 	    break;
     }
diff --git a/extras/mini-os/tpm_tis.c b/extras/mini-os/tpm_tis.c
new file mode 100644
index 0000000..e8ca69f
--- /dev/null
+++ b/extras/mini-os/tpm_tis.c
@@ -0,0 +1,1354 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * This code has been derived from drivers/char/tpm.c
+ * from the linux kernel
+ *
+ * Copyright (C) 2004 IBM Corporation
+ *
+ * This code has also been derived from drivers/char/tpm/tpm_tis.c
+ * from the linux kernel
+ *
+ * Copyright (C) 2005, 2006 IBM Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, version 2
+ * of the License
+ */
+#include <mini-os/ioremap.h>
+#include <mini-os/iorw.h>
+#include <mini-os/tpm_tis.h>
+#include <mini-os/os.h>
+#include <mini-os/sched.h>
+#include <mini-os/byteorder.h>
+#include <mini-os/events.h>
+#include <mini-os/wait.h>
+#include <mini-os/xmalloc.h>
+#include <errno.h>
+#include <stdbool.h>
+
+#ifndef min
+	#define min( a, b ) ( ((a) < (b)) ? (a) : (b) )
+#endif
+
+#define TPM_HEADER_SIZE 10
+
+#define TPM_BUFSIZE 2048
+
+struct tpm_input_header {
+        uint16_t  tag;
+        uint32_t  length;
+        uint32_t  ordinal;
+}__attribute__((packed));
+
+struct tpm_output_header {
+        uint16_t  tag;
+        uint32_t  length;
+        uint32_t  return_code;
+}__attribute__((packed));
+
+struct  stclear_flags_t {
+        uint16_t  tag;
+        uint8_t      deactivated;
+        uint8_t      disableForceClear;
+        uint8_t      physicalPresence;
+        uint8_t      physicalPresenceLock;
+        uint8_t      bGlobalLock;
+}__attribute__((packed));
+
+struct  tpm_version_t {
+        uint8_t      Major;
+        uint8_t      Minor;
+        uint8_t      revMajor;
+        uint8_t      revMinor;
+}__attribute__((packed));
+
+struct  tpm_version_1_2_t {
+        uint16_t  tag;
+        uint8_t      Major;
+        uint8_t      Minor;
+        uint8_t      revMajor;
+        uint8_t      revMinor;
+}__attribute__((packed));
+
+struct  timeout_t {
+        uint32_t  a;
+        uint32_t  b;
+        uint32_t  c;
+        uint32_t  d;
+}__attribute__((packed));
+
+struct duration_t {
+        uint32_t  tpm_short;
+        uint32_t  tpm_medium;
+        uint32_t  tpm_long;
+}__attribute__((packed));
+
+struct permanent_flags_t {
+        uint16_t  tag;
+        uint8_t      disable;
+        uint8_t      ownership;
+        uint8_t      deactivated;
+        uint8_t      readPubek;
+        uint8_t      disableOwnerClear;
+        uint8_t      allowMaintenance;
+        uint8_t      physicalPresenceLifetimeLock;
+        uint8_t      physicalPresenceHWEnable;
+        uint8_t      physicalPresenceCMDEnable;
+        uint8_t      CEKPUsed;
+        uint8_t      TPMpost;
+        uint8_t      TPMpostLock;
+        uint8_t      FIPS;
+        uint8_t      operator;
+        uint8_t      enableRevokeEK;
+        uint8_t      nvLocked;
+        uint8_t      readSRKPub;
+        uint8_t      tpmEstablished;
+        uint8_t      maintenanceDone;
+        uint8_t      disableFullDALogicInfo;
+}__attribute__((packed));
+
+typedef union {
+        struct  permanent_flags_t perm_flags;
+        struct  stclear_flags_t stclear_flags;
+        bool    owned;
+        uint32_t  num_pcrs;
+        struct  tpm_version_t   tpm_version;
+        struct  tpm_version_1_2_t tpm_version_1_2;
+        uint32_t  manufacturer_id;
+        struct timeout_t  timeout;
+        struct duration_t duration;
+} cap_t;
+
+struct  tpm_getcap_params_in {
+        uint32_t  cap;
+        uint32_t  subcap_size;
+        uint32_t  subcap;
+}__attribute__((packed));
+
+struct  tpm_getcap_params_out {
+        uint32_t  cap_size;
+        cap_t   cap;
+}__attribute__((packed));
+
+struct  tpm_readpubek_params_out {
+        uint8_t      algorithm[4];
+        uint8_t      encscheme[2];
+        uint8_t      sigscheme[2];
+        uint32_t  paramsize;
+        uint8_t      parameters[12]; /*assuming RSA*/
+        uint32_t  keysize;
+        uint8_t      modulus[256];
+        uint8_t      checksum[20];
+}__attribute__((packed));
+
+typedef union {
+        struct  tpm_input_header in;
+        struct  tpm_output_header out;
+} tpm_cmd_header;
+
+#define TPM_DIGEST_SIZE 20
+struct tpm_pcrread_out {
+        uint8_t      pcr_result[TPM_DIGEST_SIZE];
+}__attribute__((packed));
+
+struct tpm_pcrread_in {
+        uint32_t  pcr_idx;
+}__attribute__((packed));
+
+struct tpm_pcrextend_in {
+        uint32_t  pcr_idx;
+        uint8_t      hash[TPM_DIGEST_SIZE];
+}__attribute__((packed));
+
+typedef union {
+        struct  tpm_getcap_params_out getcap_out;
+        struct  tpm_readpubek_params_out readpubek_out;
+        uint8_t      readpubek_out_buffer[sizeof(struct tpm_readpubek_params_out)];
+        struct  tpm_getcap_params_in getcap_in;
+        struct  tpm_pcrread_in  pcrread_in;
+        struct  tpm_pcrread_out pcrread_out;
+        struct  tpm_pcrextend_in pcrextend_in;
+} tpm_cmd_params;
+
+struct tpm_cmd_t {
+        tpm_cmd_header  header;
+        tpm_cmd_params  params;
+}__attribute__((packed));
+
+
+enum tpm_duration {
+   TPM_SHORT = 0,
+   TPM_MEDIUM = 1,
+   TPM_LONG = 2,
+   TPM_UNDEFINED,
+};
+
+#define TPM_MAX_ORDINAL 243
+#define TPM_MAX_PROTECTED_ORDINAL 12
+#define TPM_PROTECTED_ORDINAL_MASK 0xFF
+
+extern const uint8_t tpm_protected_ordinal_duration[TPM_MAX_PROTECTED_ORDINAL];
+extern const uint8_t tpm_ordinal_duration[TPM_MAX_ORDINAL];
+
+#define TPM_DIGEST_SIZE 20
+#define TPM_ERROR_SIZE 10
+#define TPM_RET_CODE_IDX 6
+
+/* tpm_capabilities */
+#define TPM_CAP_FLAG cpu_to_be32(4)
+#define TPM_CAP_PROP cpu_to_be32(5)
+#define CAP_VERSION_1_1 cpu_to_be32(0x06)
+#define CAP_VERSION_1_2 cpu_to_be32(0x1A)
+
+/* tpm_sub_capabilities */
+#define TPM_CAP_PROP_PCR cpu_to_be32(0x101)
+#define TPM_CAP_PROP_MANUFACTURER cpu_to_be32(0x103)
+#define TPM_CAP_FLAG_PERM cpu_to_be32(0x108)
+#define TPM_CAP_FLAG_VOL cpu_to_be32(0x109)
+#define TPM_CAP_PROP_OWNER cpu_to_be32(0x111)
+#define TPM_CAP_PROP_TIS_TIMEOUT cpu_to_be32(0x115)
+#define TPM_CAP_PROP_TIS_DURATION cpu_to_be32(0x120)
+
+
+#define TPM_INTERNAL_RESULT_SIZE 200
+#define TPM_TAG_RQU_COMMAND cpu_to_be16(193)
+#define TPM_ORD_GET_CAP cpu_to_be32(101)
+
+extern const struct tpm_input_header tpm_getcap_header;
+
+
+
+const uint8_t tpm_protected_ordinal_duration[TPM_MAX_PROTECTED_ORDINAL] = {
+   TPM_UNDEFINED,          /* 0 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 5 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 10 */
+   TPM_SHORT,
+};
+
+const uint8_t tpm_ordinal_duration[TPM_MAX_ORDINAL] = {
+   TPM_UNDEFINED,          /* 0 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 5 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 10 */
+   TPM_SHORT,
+   TPM_MEDIUM,
+   TPM_LONG,
+   TPM_LONG,
+   TPM_MEDIUM,             /* 15 */
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_MEDIUM,
+   TPM_LONG,
+   TPM_SHORT,              /* 20 */
+   TPM_SHORT,
+   TPM_MEDIUM,
+   TPM_MEDIUM,
+   TPM_MEDIUM,
+   TPM_SHORT,              /* 25 */
+   TPM_SHORT,
+   TPM_MEDIUM,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_MEDIUM,             /* 30 */
+   TPM_LONG,
+   TPM_MEDIUM,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,              /* 35 */
+   TPM_MEDIUM,
+   TPM_MEDIUM,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_MEDIUM,             /* 40 */
+   TPM_LONG,
+   TPM_MEDIUM,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,              /* 45 */
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_LONG,
+   TPM_MEDIUM,             /* 50 */
+   TPM_MEDIUM,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 55 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_MEDIUM,             /* 60 */
+   TPM_MEDIUM,
+   TPM_MEDIUM,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_MEDIUM,             /* 65 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 70 */
+   TPM_SHORT,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 75 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_LONG,               /* 80 */
+   TPM_UNDEFINED,
+   TPM_MEDIUM,
+   TPM_LONG,
+   TPM_SHORT,
+   TPM_UNDEFINED,          /* 85 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 90 */
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_UNDEFINED,          /* 95 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_MEDIUM,             /* 100 */
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 105 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 110 */
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,              /* 115 */
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_LONG,               /* 120 */
+   TPM_LONG,
+   TPM_MEDIUM,
+   TPM_UNDEFINED,
+   TPM_SHORT,
+   TPM_SHORT,              /* 125 */
+   TPM_SHORT,
+   TPM_LONG,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,              /* 130 */
+   TPM_MEDIUM,
+   TPM_UNDEFINED,
+   TPM_SHORT,
+   TPM_MEDIUM,
+   TPM_UNDEFINED,          /* 135 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 140 */
+   TPM_SHORT,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 145 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 150 */
+   TPM_MEDIUM,
+   TPM_MEDIUM,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_UNDEFINED,          /* 155 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 160 */
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 165 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_LONG,               /* 170 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 175 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_MEDIUM,             /* 180 */
+   TPM_SHORT,
+   TPM_MEDIUM,
+   TPM_MEDIUM,
+   TPM_MEDIUM,
+   TPM_MEDIUM,             /* 185 */
+   TPM_SHORT,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 190 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 195 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 200 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,
+   TPM_SHORT,              /* 205 */
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_MEDIUM,             /* 210 */
+   TPM_UNDEFINED,
+   TPM_MEDIUM,
+   TPM_MEDIUM,
+   TPM_MEDIUM,
+   TPM_UNDEFINED,          /* 215 */
+   TPM_MEDIUM,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,
+   TPM_SHORT,              /* 220 */
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_SHORT,
+   TPM_UNDEFINED,          /* 225 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 230 */
+   TPM_LONG,
+   TPM_MEDIUM,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,          /* 235 */
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_UNDEFINED,
+   TPM_SHORT,              /* 240 */
+   TPM_UNDEFINED,
+   TPM_MEDIUM,
+};
+
+const struct tpm_input_header tpm_getcap_header = {
+        .tag = TPM_TAG_RQU_COMMAND,
+        .length = cpu_to_be32(22),
+        .ordinal = TPM_ORD_GET_CAP
+};
+
+
+enum tis_access {
+   TPM_ACCESS_VALID = 0x80,
+   TPM_ACCESS_ACTIVE_LOCALITY = 0x20,	/* (R) */
+   TPM_ACCESS_RELINQUISH_LOCALITY = 0x20,/* (W) */
+   TPM_ACCESS_REQUEST_PENDING = 0x04,	/* (W) */
+   TPM_ACCESS_REQUEST_USE = 0x02,	/* (W) */
+};
+
+enum tis_status {
+   TPM_STS_VALID = 0x80,		/* (R) */
+   TPM_STS_COMMAND_READY = 0x40,	/* (R) */
+   TPM_STS_DATA_AVAIL = 0x10,		/* (R) */
+   TPM_STS_DATA_EXPECT = 0x08,		/* (R) */
+   TPM_STS_GO = 0x20,			/* (W) */
+};
+
+enum tis_int_flags {
+   TPM_GLOBAL_INT_ENABLE = 0x80000000,
+   TPM_INTF_BURST_COUNT_STATIC = 0x100,
+   TPM_INTF_CMD_READY_INT = 0x080,
+   TPM_INTF_INT_EDGE_FALLING = 0x040,
+   TPM_INTF_INT_EDGE_RISING = 0x020,
+   TPM_INTF_INT_LEVEL_LOW = 0x010,
+   TPM_INTF_INT_LEVEL_HIGH = 0x008,
+   TPM_INTF_LOCALITY_CHANGE_INT = 0x004,
+   TPM_INTF_STS_VALID_INT = 0x002,
+   TPM_INTF_DATA_AVAIL_INT = 0x001,
+};
+
+enum tis_defaults {
+   TIS_MEM_BASE = 0xFED40000,
+   TIS_MEM_LEN  = 0x5000,
+   TIS_SHORT_TIMEOUT = 750, /*ms*/
+   TIS_LONG_TIMEOUT = 2000, /*2 sec */
+};
+
+#define TPM_TIMEOUT 5
+
+#define TPM_ACCESS(t, l)                   (((uint8_t*)t->pages[l]) + 0x0000)
+#define TPM_INT_ENABLE(t, l)               ((uint32_t*)(((uint8_t*)t->pages[l]) + 0x0008))
+#define TPM_INT_VECTOR(t, l)               (((uint8_t*)t->pages[l]) + 0x000C)
+#define TPM_INT_STATUS(t, l)               (((uint8_t*)t->pages[l]) + 0x0010)
+#define TPM_INTF_CAPS(t, l)                ((uint32_t*)(((uint8_t*)t->pages[l]) + 0x0014))
+#define TPM_STS(t, l)                      ((uint8_t*)(((uint8_t*)t->pages[l]) + 0x0018))
+#define TPM_DATA_FIFO(t, l)                (((uint8_t*)t->pages[l]) + 0x0024)
+
+#define TPM_DID_VID(t, l)                  ((uint32_t*)(((uint8_t*)t->pages[l]) + 0x0F00))
+#define TPM_RID(t, l)                      (((uint8_t*)t->pages[l]) + 0x0F04)
+
+struct tpm_chip {
+   int enabled_localities;
+   int locality;
+   unsigned long baseaddr;
+   uint8_t* pages[5];
+   int did, vid, rid;
+
+   uint8_t data_buffer[TPM_BUFSIZE];
+   int data_len;
+
+   s_time_t timeout_a, timeout_b, timeout_c, timeout_d;
+   s_time_t duration[3];
+
+#ifdef HAVE_LIBC
+   int fd;
+#endif
+
+   unsigned int irq;
+   struct wait_queue_head read_queue;
+   struct wait_queue_head int_queue;
+};
+
+
+static void __init_tpm_chip(struct tpm_chip* tpm) {
+   tpm->enabled_localities = TPM_TIS_EN_LOCLALL;
+   tpm->locality = -1;
+   tpm->baseaddr = 0;
+   tpm->pages[0] = tpm->pages[1] = tpm->pages[2] = tpm->pages[3] = tpm->pages[4] = NULL;
+   tpm->vid = 0;
+   tpm->did = 0;
+   tpm->irq = 0;
+   init_waitqueue_head(&tpm->read_queue);
+   init_waitqueue_head(&tpm->int_queue);
+
+   tpm->data_len = -1;
+
+#ifdef HAVE_LIBC
+   tpm->fd = -1;
+#endif
+}
+
+/*
+ * Returns max number of nsecs to wait
+ */
+s_time_t tpm_calc_ordinal_duration(struct tpm_chip *chip,
+      uint32_t ordinal)
+{
+   int duration_idx = TPM_UNDEFINED;
+   s_time_t duration = 0;
+
+   if (ordinal < TPM_MAX_ORDINAL)
+      duration_idx = tpm_ordinal_duration[ordinal];
+   else if ((ordinal & TPM_PROTECTED_ORDINAL_MASK) <
+	 TPM_MAX_PROTECTED_ORDINAL)
+      duration_idx =
+	 tpm_protected_ordinal_duration[ordinal &
+	 TPM_PROTECTED_ORDINAL_MASK];
+
+   if (duration_idx != TPM_UNDEFINED) {
+      duration = chip->duration[duration_idx];
+   }
+
+   if (duration <= 0) {
+      return SECONDS(120);
+   }
+   else
+   {
+      return duration;
+   }
+}
+
+
+static int locality_enabled(struct tpm_chip* tpm, int l) {
+   return tpm->enabled_localities & (1 << l);
+}
+
+static int check_locality(struct tpm_chip* tpm, int l) {
+   if(locality_enabled(tpm, l) && (ioread8(TPM_ACCESS(tpm, l)) &
+	    (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) ==
+	 (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) {
+      return l;
+   }
+   return -1;
+}
+
+void release_locality(struct tpm_chip* tpm, int l, int force)
+{
+   if (locality_enabled(tpm, l) && (force || (ioread8(TPM_ACCESS(tpm, l)) &
+	       (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID)) ==
+	    (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID))) {
+      iowrite8(TPM_ACCESS(tpm, l), TPM_ACCESS_RELINQUISH_LOCALITY);
+   }
+}
+
+int tpm_tis_request_locality(struct tpm_chip* tpm, int l) {
+
+   s_time_t stop;
+   /*Make sure locality is valid */
+   if(!locality_enabled(tpm, l)) {
+      printk("tpm_tis_change_locality() Tried to change to locality %d, but it is disabled or invalid!\n", l);
+      return -1;
+   }
+   /* Check if we already have the current locality */
+   if(check_locality(tpm, l) >= 0) {
+      return tpm->locality = l;
+   }
+   /* Set the new locality*/
+   iowrite8(TPM_ACCESS(tpm, l), TPM_ACCESS_REQUEST_USE);
+
+   if(tpm->irq) {
+      /* Wait for interrupt */
+      wait_event_deadline(tpm->int_queue, (check_locality(tpm, l) >= 0), NOW() + tpm->timeout_a);
+
+      /* FIXME: Handle timeout event, should return error in that case */
+      return l;
+   } else {
+      /* Wait for burstcount */
+      stop = NOW() + tpm->timeout_a;
+      do {
+	 if(check_locality(tpm, l) >= 0) {
+	    return tpm->locality = l;
+	 }
+	 msleep(TPM_TIMEOUT);
+      } while(NOW() < stop);
+   }
+
+   printk("REQ LOCALITY FAILURE\n");
+   return -1;
+}
+
+static uint8_t tpm_tis_status(struct tpm_chip* tpm) {
+   return ioread8(TPM_STS(tpm, tpm->locality));
+}
+
+/* This causes the current command to be aborted */
+static void tpm_tis_ready(struct tpm_chip* tpm) {
+   iowrite8(TPM_STS(tpm, tpm->locality), TPM_STS_COMMAND_READY);
+}
+#define tpm_tis_cancel_cmd(v) tpm_tis_ready(v)
+
+static int get_burstcount(struct tpm_chip* tpm) {
+   s_time_t stop;
+   int burstcnt;
+
+   stop = NOW() + tpm->timeout_d;
+   do {
+      burstcnt = ioread8((TPM_STS(tpm, tpm->locality) + 1));
+      burstcnt += ioread8(TPM_STS(tpm, tpm->locality) + 2) << 8;
+
+      if (burstcnt) {
+	 return burstcnt;
+      }
+      msleep(TPM_TIMEOUT);
+   } while(NOW() < stop);
+   return -EBUSY;
+}
+
+static int wait_for_stat(struct tpm_chip* tpm, uint8_t mask,
+      unsigned long timeout, struct wait_queue_head* queue) {
+   s_time_t stop;
+   uint8_t status;
+
+   status = tpm_tis_status(tpm);
+   if((status & mask) == mask) {
+      return 0;
+   }
+
+   if(tpm->irq) {
+      wait_event_deadline(*queue, ((tpm_tis_status(tpm) & mask) == mask), timeout);
+      /* FIXME: Check for timeout and return -ETIME */
+      return 0;
+   } else {
+      stop = NOW() + timeout;
+      do {
+	 msleep(TPM_TIMEOUT);
+	 status = tpm_tis_status(tpm);
+	 if((status & mask) == mask)
+	    return 0;
+      } while( NOW() < stop);
+   }
+   return -ETIME;
+}
+
+static int recv_data(struct tpm_chip* tpm, uint8_t* buf, size_t count) {
+   int size = 0;
+   int burstcnt;
+   while( size < count &&
+	 wait_for_stat(tpm,
+	    TPM_STS_DATA_AVAIL | TPM_STS_VALID,
+	    tpm->timeout_c,
+	    &tpm->read_queue)
+	 == 0) {
+      burstcnt = get_burstcount(tpm);
+      for(; burstcnt > 0 && size < count; --burstcnt)
+      {
+	 buf[size++] = ioread8(TPM_DATA_FIFO(tpm, tpm->locality));
+      }
+   }
+   return size;
+}
+
+int tpm_tis_recv(struct tpm_chip* tpm, uint8_t* buf, size_t count) {
+   int size = 0;
+   int expected, status;
+
+   if (count < TPM_HEADER_SIZE) {
+      size = -EIO;
+      goto out;
+   }
+
+   /* read first 10 bytes, including tag, paramsize, and result */
+   if((size =
+	    recv_data(tpm, buf, TPM_HEADER_SIZE)) < TPM_HEADER_SIZE) {
+      printk("Error reading tpm cmd header\n");
+      goto out;
+   }
+
+   expected = be32_to_cpu(*((uint32_t*)(buf + 2)));
+   if(expected > count) {
+      size = -EIO;
+      goto out;
+   }
+
+   if((size += recv_data(tpm, & buf[TPM_HEADER_SIZE],
+	       expected - TPM_HEADER_SIZE)) < expected) {
+      printk("Unable to read rest of tpm command size=%d expected=%d\n", size, expected);
+      size = -ETIME;
+      goto out;
+   }
+
+   wait_for_stat(tpm, TPM_STS_VALID, tpm->timeout_c, &tpm->int_queue);
+   status = tpm_tis_status(tpm);
+   if(status & TPM_STS_DATA_AVAIL) {
+      printk("Error: left over data\n");
+      size = -EIO;
+      goto out;
+   }
+
+out:
+   tpm_tis_ready(tpm);
+   release_locality(tpm, tpm->locality, 0);
+   return size;
+}
+int tpm_tis_send(struct tpm_chip* tpm, uint8_t* buf, size_t len) {
+   int rc;
+   int status, burstcnt = 0;
+   int count = 0;
+   uint32_t ordinal;
+
+   if(tpm_tis_request_locality(tpm, tpm->locality) < 0) {
+      return -EBUSY;
+   }
+
+   status = tpm_tis_status(tpm);
+   if((status & TPM_STS_COMMAND_READY) == 0) {
+      tpm_tis_ready(tpm);
+      if(wait_for_stat(tpm, TPM_STS_COMMAND_READY, tpm->timeout_b, &tpm->int_queue) < 0) {
+	 rc = -ETIME;
+	 goto out_err;
+      }
+   }
+
+   while(count < len - 1) {
+      burstcnt = get_burstcount(tpm);
+      for(;burstcnt > 0 && count < len -1; --burstcnt) {
+	 iowrite8(TPM_DATA_FIFO(tpm, tpm->locality), buf[count++]);
+      }
+
+      wait_for_stat(tpm, TPM_STS_VALID, tpm->timeout_c, &tpm->int_queue);
+      status = tpm_tis_status(tpm);
+      if((status & TPM_STS_DATA_EXPECT) == 0) {
+	 rc = -EIO;
+	 goto out_err;
+      }
+   }
+
+   /*Write last byte*/
+   iowrite8(TPM_DATA_FIFO(tpm, tpm->locality), buf[count]);
+   wait_for_stat(tpm, TPM_STS_VALID, tpm->timeout_c, &tpm->read_queue);
+   status = tpm_tis_status(tpm);
+   if((status & TPM_STS_DATA_EXPECT) != 0) {
+      rc = -EIO;
+      goto out_err;
+   }
+
+   /*go and do it*/
+   iowrite8(TPM_STS(tpm, tpm->locality), TPM_STS_GO);
+
+   if(tpm->irq) {
+      /*Wait for interrupt */
+      ordinal = be32_to_cpu(*(buf + 6));
+      if(wait_for_stat(tpm,
+	       TPM_STS_DATA_AVAIL | TPM_STS_VALID,
+	       tpm_calc_ordinal_duration(tpm, ordinal),
+	       &tpm->read_queue) < 0) {
+	 rc = -ETIME;
+	 goto out_err;
+      }
+   }
+#ifdef HAVE_LIBC
+   if(tpm->fd >= 0) {
+      files[tpm->fd].read = 0;
+      files[tpm->fd].tpm_tis.respgot = 0;
+      files[tpm->fd].tpm_tis.offset = 0;
+   }
+#endif
+   return len;
+
+out_err:
+   tpm_tis_ready(tpm);
+   release_locality(tpm, tpm->locality, 0);
+   return rc;
+}
+
+static void tpm_tis_irq_handler(evtchn_port_t port, struct pt_regs *regs, void* data)
+{
+   struct tpm_chip* tpm = data;
+   uint32_t interrupt;
+   int i;
+
+   interrupt = ioread32(TPM_INT_STATUS(tpm, tpm->locality));
+   if(interrupt == 0) {
+      return;
+   }
+
+   if(interrupt & TPM_INTF_DATA_AVAIL_INT) {
+      wake_up(&tpm->read_queue);
+   }
+   if(interrupt & TPM_INTF_LOCALITY_CHANGE_INT) {
+      for(i = 0; i < 5; ++i) {
+	 if(check_locality(tpm, i) >= 0) {
+	    break;
+	 }
+      }
+   }
+   if(interrupt & (TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_STS_VALID_INT |
+	    TPM_INTF_CMD_READY_INT)) {
+      wake_up(&tpm->int_queue);
+   }
+
+   /* Clear interrupts handled with TPM_EOI */
+   iowrite32(TPM_INT_STATUS(tpm, tpm->locality), interrupt);
+   ioread32(TPM_INT_STATUS(tpm, tpm->locality));
+   return;
+}
+
+/*
+ * Internal kernel interface to transmit TPM commands
+ */
+static ssize_t tpm_transmit(struct tpm_chip *chip, const uint8_t *buf,
+      size_t bufsiz)
+{
+   ssize_t rc;
+   uint32_t count, ordinal;
+   s_time_t stop;
+
+   count = be32_to_cpu(*((uint32_t *) (buf + 2)));
+   ordinal = be32_to_cpu(*((uint32_t *) (buf + 6)));
+   if (count == 0)
+      return -ENODATA;
+   if (count > bufsiz) {
+      printk("Error: invalid count value %x %zx \n", count, bufsiz);
+      return -E2BIG;
+   }
+
+   //down(&chip->tpm_mutex);
+
+   if ((rc = tpm_tis_send(chip, (uint8_t *) buf, count)) < 0) {
+      printk("tpm_transmit: tpm_send: error %ld\n", rc);
+      goto out;
+   }
+
+   if (chip->irq)
+      goto out_recv;
+
+   stop = NOW() + tpm_calc_ordinal_duration(chip, ordinal);
+   do {
+      uint8_t status = tpm_tis_status(chip);
+      if ((status & (TPM_STS_DATA_AVAIL | TPM_STS_VALID)) ==
+	    (TPM_STS_DATA_AVAIL | TPM_STS_VALID))
+	 goto out_recv;
+
+      if ((status == TPM_STS_COMMAND_READY)) {
+	 printk("TPM Error: Operation Canceled\n");
+	 rc = -ECANCELED;
+	 goto out;
+      }
+
+      msleep(TPM_TIMEOUT);    /* CHECK */
+      rmb();
+   } while (NOW() < stop);
+
+   /* Cancel the command */
+   tpm_tis_cancel_cmd(chip);
+   printk("TPM Operation Timed out\n");
+   rc = -ETIME;
+   goto out;
+
+out_recv:
+   if((rc = tpm_tis_recv(chip, (uint8_t *) buf, bufsiz)) < 0) {
+      printk("tpm_transmit: tpm_recv: error %d\n", rc);
+   }
+out:
+   //up(&chip->tpm_mutex);
+   return rc;
+}
+
+static ssize_t transmit_cmd(struct tpm_chip *chip, struct tpm_cmd_t *cmd,
+                            int len, const char *desc)
+{
+        int err;
+
+        len = tpm_transmit(chip,(uint8_t *) cmd, len);
+        if (len <  0)
+                return len;
+        if (len == TPM_ERROR_SIZE) {
+                err = be32_to_cpu(cmd->header.out.return_code);
+                printk("A TPM error (%d) occurred %s\n", err, desc);
+                return err;
+        }
+        return 0;
+}
+
+int tpm_get_timeouts(struct tpm_chip *chip)
+{
+   struct tpm_cmd_t tpm_cmd;
+   struct timeout_t *timeout_cap;
+   struct duration_t *duration_cap;
+   ssize_t rc;
+   uint32_t timeout;
+   unsigned int scale = 1;
+
+   tpm_cmd.header.in = tpm_getcap_header;
+   tpm_cmd.params.getcap_in.cap = TPM_CAP_PROP;
+   tpm_cmd.params.getcap_in.subcap_size = cpu_to_be32(4);
+   tpm_cmd.params.getcap_in.subcap = TPM_CAP_PROP_TIS_TIMEOUT;
+
+   if((rc = transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE,
+	 "attempting to determine the timeouts")) != 0) {
+      printk("transmit failed %d\n", rc);
+      goto duration;
+   }
+
+   if(be32_to_cpu(tpm_cmd.header.out.return_code) != 0 ||
+         be32_to_cpu(tpm_cmd.header.out.length) !=
+         sizeof(tpm_cmd.header.out) + sizeof(uint32_t) + 4 * sizeof(uint32_t)) {
+      return -EINVAL;
+   }
+
+   timeout_cap = &tpm_cmd.params.getcap_out.cap.timeout;
+   /* Don't overwrite default if value is 0 */
+   timeout = be32_to_cpu(timeout_cap->a);
+   if(timeout && timeout < 1000) {
+      /* timeouts in msc rather usec */
+      scale = 1000;
+   }
+   if (timeout)
+      chip->timeout_a = MICROSECS(timeout * scale); /*Convert to msec */
+   timeout = be32_to_cpu(timeout_cap->b);
+   if (timeout)
+      chip->timeout_b = MICROSECS(timeout * scale); /*Convert to msec */
+   timeout = be32_to_cpu(timeout_cap->c);
+   if (timeout)
+      chip->timeout_c = MICROSECS(timeout * scale); /*Convert to msec */
+   timeout = be32_to_cpu(timeout_cap->d);
+   if (timeout)
+      chip->timeout_d = MICROSECS(timeout * scale); /*Convert to msec */
+
+duration:
+   tpm_cmd.header.in = tpm_getcap_header;
+   tpm_cmd.params.getcap_in.cap = TPM_CAP_PROP;
+   tpm_cmd.params.getcap_in.subcap_size = cpu_to_be32(4);
+   tpm_cmd.params.getcap_in.subcap = TPM_CAP_PROP_TIS_DURATION;
+
+   if((rc = transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE,
+	 "attempting to determine the durations")) < 0) {
+      return rc;
+   }
+
+   if(be32_to_cpu(tpm_cmd.header.out.return_code) != 0 ||
+         be32_to_cpu(tpm_cmd.header.out.length) !=
+         sizeof(tpm_cmd.header.out) + sizeof(uint32_t) + 3 * sizeof(uint32_t)) {
+      return -EINVAL;
+   }
+
+   duration_cap = &tpm_cmd.params.getcap_out.cap.duration;
+   chip->duration[TPM_SHORT] = MICROSECS(be32_to_cpu(duration_cap->tpm_short));
+   chip->duration[TPM_MEDIUM] = MICROSECS(be32_to_cpu(duration_cap->tpm_medium));
+   chip->duration[TPM_LONG] = MICROSECS(be32_to_cpu(duration_cap->tpm_long));
+
+   /* The Broadcom BCM0102 chipset in a Dell Latitude D820 gets the above
+    * value wrong and apparently reports msecs rather than usecs. So we
+    * fix up the resulting too-small TPM_SHORT value to make things work.
+    */
+   if (chip->duration[TPM_SHORT] < MILLISECS(10)) {
+      chip->duration[TPM_SHORT] = SECONDS(1);
+      chip->duration[TPM_MEDIUM] *= 1000;
+      chip->duration[TPM_LONG] *= 1000;
+      printk("Adjusting TPM timeout parameters\n");
+   }
+
+   return 0;
+}
+
+
+
+void tpm_continue_selftest(struct tpm_chip* chip) {
+   uint8_t data[] = {
+      0, 193,                 /* TPM_TAG_RQU_COMMAND */
+      0, 0, 0, 10,            /* length */
+      0, 0, 0, 83,            /* TPM_ORD_GetCapability */
+   };
+
+   tpm_transmit(chip, data, sizeof(data));
+}
+
+ssize_t tpm_getcap(struct tpm_chip *chip, uint32_t subcap_id, cap_t *cap,
+                   const char *desc)
+{
+        struct tpm_cmd_t tpm_cmd;
+        int rc;
+
+        tpm_cmd.header.in = tpm_getcap_header;
+        if (subcap_id == CAP_VERSION_1_1 || subcap_id == CAP_VERSION_1_2) {
+                tpm_cmd.params.getcap_in.cap = subcap_id;
+                /*subcap field not necessary */
+                tpm_cmd.params.getcap_in.subcap_size = cpu_to_be32(0);
+                tpm_cmd.header.in.length -= cpu_to_be32(sizeof(uint32_t));
+        } else {
+                if (subcap_id == TPM_CAP_FLAG_PERM ||
+                    subcap_id == TPM_CAP_FLAG_VOL)
+                        tpm_cmd.params.getcap_in.cap = TPM_CAP_FLAG;
+                else
+                        tpm_cmd.params.getcap_in.cap = TPM_CAP_PROP;
+                tpm_cmd.params.getcap_in.subcap_size = cpu_to_be32(4);
+                tpm_cmd.params.getcap_in.subcap = subcap_id;
+        }
+        rc = transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE, desc);
+        if (!rc)
+                *cap = tpm_cmd.params.getcap_out.cap;
+        return rc;
+}
+
+
+struct tpm_chip* init_tpm_tis(unsigned long baseaddr, int localities, unsigned int irq)
+{
+   int i;
+   unsigned long addr;
+   struct tpm_chip* tpm = NULL;
+   uint32_t didvid;
+   uint32_t intfcaps;
+   uint32_t intmask;
+
+   printk("============= Init TPM TIS Driver ==============\n");
+
+   /*Sanity check the localities input */
+   if(localities & ~TPM_TIS_EN_LOCLALL) {
+      printk("init_tpm_tis() Invalid locality specification! %X\n", localities);
+      goto abort_egress;
+   }
+
+   printk("IOMEM Machine Base Address: %lX\n", baseaddr);
+
+   /* Create the tpm data structure */
+   tpm = malloc(sizeof(struct tpm_chip));
+   __init_tpm_chip(tpm);
+
+   /* Set the enabled localities - if 0 we leave default as all enabled */
+   if(localities != 0) {
+      tpm->enabled_localities = localities;
+   }
+   printk("Enabled Localities: ");
+   for(i = 0; i < 5; ++i) {
+      if(locality_enabled(tpm, i)) {
+	 printk("%d ", i);
+      }
+   }
+   printk("\n");
+
+   /* Set the base machine address */
+   tpm->baseaddr = baseaddr;
+
+   /* Set default timeouts */
+   tpm->timeout_a = MILLISECS(TIS_SHORT_TIMEOUT);
+   tpm->timeout_b = MILLISECS(TIS_LONG_TIMEOUT);
+   tpm->timeout_c = MILLISECS(TIS_SHORT_TIMEOUT);
+   tpm->timeout_d = MILLISECS(TIS_SHORT_TIMEOUT);
+
+   /*Map the mmio pages */
+   addr = tpm->baseaddr;
+   for(i = 0; i < 5; ++i) {
+      if(locality_enabled(tpm, i)) {
+	 /* Map the page in now */
+	 if((tpm->pages[i] = ioremap_nocache(addr, PAGE_SIZE)) == NULL) {
+	    printk("Unable to map iomem page a address %p\n", addr);
+	    goto abort_egress;
+	 }
+
+	 /* Set default locality to the first enabled one */
+	 if (tpm->locality < 0) {
+	    if(tpm_tis_request_locality(tpm, i) < 0) {
+	       printk("Unable to request locality %d??\n", i);
+	       goto abort_egress;
+	    }
+	 }
+      }
+      addr += PAGE_SIZE;
+   }
+
+
+   /* Get the vendor and device ids */
+   didvid = ioread32(TPM_DID_VID(tpm, tpm->locality));
+   tpm->did = didvid >> 16;
+   tpm->vid = didvid & 0xFFFF;
+
+
+   /* Get the revision id */
+   tpm->rid = ioread8(TPM_RID(tpm, tpm->locality));
+
+   printk("1.2 TPM (device-id=0x%X vendor-id = %X rev-id = %X)\n", tpm->did, tpm->vid, tpm->rid);
+
+   intfcaps = ioread32(TPM_INTF_CAPS(tpm, tpm->locality));
+   printk("TPM interface capabilities (0x%x):\n", intfcaps);
+   if (intfcaps & TPM_INTF_BURST_COUNT_STATIC)
+      printk("\tBurst Count Static\n");
+   if (intfcaps & TPM_INTF_CMD_READY_INT)
+      printk("\tCommand Ready Int Support\n");
+   if (intfcaps & TPM_INTF_INT_EDGE_FALLING)
+      printk("\tInterrupt Edge Falling\n");
+   if (intfcaps & TPM_INTF_INT_EDGE_RISING)
+      printk("\tInterrupt Edge Rising\n");
+   if (intfcaps & TPM_INTF_INT_LEVEL_LOW)
+      printk("\tInterrupt Level Low\n");
+   if (intfcaps & TPM_INTF_INT_LEVEL_HIGH)
+      printk("\tInterrupt Level High\n");
+   if (intfcaps & TPM_INTF_LOCALITY_CHANGE_INT)
+      printk("\tLocality Change Int Support\n");
+   if (intfcaps & TPM_INTF_STS_VALID_INT)
+      printk("\tSts Valid Int Support\n");
+   if (intfcaps & TPM_INTF_DATA_AVAIL_INT)
+      printk("\tData Avail Int Support\n");
+
+   /*Interupt setup */
+   intmask = ioread32(TPM_INT_ENABLE(tpm, tpm->locality));
+
+   intmask |= TPM_INTF_CMD_READY_INT
+      | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT
+      | TPM_INTF_STS_VALID_INT;
+
+   iowrite32(TPM_INT_ENABLE(tpm, tpm->locality), intmask);
+
+   /*If interupts are enabled, handle it */
+   if(irq) {
+      if(irq != TPM_PROBE_IRQ) {
+	 tpm->irq = irq;
+      } else {
+	 /*FIXME add irq probing feature later */
+	 printk("IRQ probing not implemented\n");
+      }
+   }
+
+   if(tpm->irq) {
+      iowrite8(TPM_INT_VECTOR(tpm, tpm->locality), tpm->irq);
+
+      if(bind_pirq(tpm->irq, 1, tpm_tis_irq_handler, tpm) != 0) {
+	 printk("Unabled to request irq: %u for use\n", tpm->irq);
+	 printk("Will use polling mode\n");
+	 tpm->irq = 0;
+      } else {
+	 /* Clear all existing */
+	 iowrite32(TPM_INT_STATUS(tpm, tpm->locality), ioread32(TPM_INT_STATUS(tpm, tpm->locality)));
+
+	 /* Turn on interrupts */
+	 iowrite32(TPM_INT_ENABLE(tpm, tpm->locality), intmask | TPM_GLOBAL_INT_ENABLE);
+      }
+   }
+
+   if(tpm_get_timeouts(tpm)) {
+      printk("Could not get TPM timeouts and durations\n");
+      goto abort_egress;
+   }
+   tpm_continue_selftest(tpm);
+
+
+   return tpm;
+abort_egress:
+   if(tpm != NULL) {
+      shutdown_tpm_tis(tpm);
+   }
+   return NULL;
+}
+
+void shutdown_tpm_tis(struct tpm_chip* tpm){
+   int i;
+
+   printk("Shutting down tpm_tis device\n");
+
+   iowrite32(TPM_INT_ENABLE(tpm, tpm->locality), ~TPM_GLOBAL_INT_ENABLE);
+
+   /*Unmap all of the mmio pages */
+   for(i = 0; i < 5; ++i) {
+      if(tpm->pages[i] != NULL) {
+	 iounmap(tpm->pages[i], PAGE_SIZE);
+	 tpm->pages[i] = NULL;
+      }
+   }
+   free(tpm);
+   return;
+}
+
+
+int tpm_tis_cmd(struct tpm_chip* tpm, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen)
+{
+   if(tpm->locality < 0) {
+      printk("tpm_tis_cmd() failed! locality not set!\n");
+      return -1;
+   }
+   if(reqlen > TPM_BUFSIZE) {
+      reqlen = TPM_BUFSIZE;
+   }
+   memcpy(tpm->data_buffer, req, reqlen);
+   *resplen = tpm_transmit(tpm, tpm->data_buffer, TPM_BUFSIZE);
+
+   *resp = malloc(*resplen);
+   memcpy(*resp, tpm->data_buffer, *resplen);
+   return 0;
+}
+
+#ifdef HAVE_LIBC
+int tpm_tis_open(struct tpm_chip* tpm)
+{
+   /* Silently prevent multiple opens */
+   if(tpm->fd != -1) {
+      return tpm->fd;
+   }
+
+   tpm->fd = alloc_fd(FTYPE_TPM_TIS);
+   printk("tpm_tis_open() -> %d\n", tpm->fd);
+   files[tpm->fd].tpm_tis.dev = tpm;
+   files[tpm->fd].tpm_tis.offset = 0;
+   files[tpm->fd].tpm_tis.respgot = 0;
+   return tpm->fd;
+}
+
+int tpm_tis_posix_write(int fd, const uint8_t* buf, size_t count)
+{
+   struct tpm_chip* tpm;
+   tpm = files[fd].tpm_tis.dev;
+
+   if(tpm->locality < 0) {
+      printk("tpm_tis_posix_write() failed! locality not set!\n");
+      errno = EINPROGRESS;
+      return -1;
+   }
+   if(count == 0) {
+      return 0;
+   }
+
+   /* Return an error if we are already processing a command */
+   if(count > TPM_BUFSIZE) {
+      count = TPM_BUFSIZE;
+   }
+   /* Send the command now */
+   memcpy(tpm->data_buffer, buf, count);
+   if((tpm->data_len = tpm_transmit(tpm, tpm->data_buffer, TPM_BUFSIZE)) < 0) {
+      errno = EIO;
+      return -1;
+   }
+   return count;
+}
+
+int tpm_tis_posix_read(int fd, uint8_t* buf, size_t count)
+{
+   int rc;
+   struct tpm_chip* tpm;
+   tpm = files[fd].tpm_tis.dev;
+
+   if(count == 0) {
+      return 0;
+   }
+
+   /* If there is no tpm resp to read, return EIO */
+   if(tpm->data_len < 0) {
+      errno = EIO;
+      return -1;
+   }
+
+
+   /* Handle EOF case */
+   if(files[fd].tpm_tis.offset >= tpm->data_len) {
+      rc = 0;
+   } else {
+      rc = min(tpm->data_len - files[fd].tpm_tis.offset, count);
+      memcpy(buf, tpm->data_buffer + files[fd].tpm_tis.offset, rc);
+   }
+   files[fd].tpm_tis.offset += rc;
+   /* Reset the data pending flag */
+   return rc;
+}
+int tpm_tis_posix_fstat(int fd, struct stat* buf)
+{
+   struct tpm_chip* tpm;
+   tpm = files[fd].tpm_tis.dev;
+
+   buf->st_mode = O_RDWR;
+   buf->st_uid = 0;
+   buf->st_gid = 0;
+   buf->st_size = be32_to_cpu(*((uint32_t*)(tpm->data_buffer + 2)));
+   buf->st_atime = buf->st_mtime = buf->st_ctime = time(NULL);
+   return 0;
+}
+
+
+#endif
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
new file mode 100644
index 0000000..658fed1
--- /dev/null
+++ b/extras/mini-os/tpmback.c
@@ -0,0 +1,1102 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * This code has been derived from drivers/xen/tpmback/tpmback.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * which was itself derived from drivers/xen/netback/netback.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2002-2004, K A Fraser
+ *
+ * This code has also been derived from drivers/xen/tpmback/xenbus.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (C) 2005 IBM Corporation
+ * Copyright (C) 2005 Rusty Russell <rusty@rustcorp.com.au>
+ *
+ * This code has also been derived from drivers/xen/tpmback/interface.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * which was itself also derived from drvivers/xen/netback/interface.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2004, Keir Fraser
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, version 2
+ * of the License
+ */
+#include <mini-os/os.h>
+#include <mini-os/xenbus.h>
+#include <mini-os/events.h>
+#include <errno.h>
+#include <mini-os/gnttab.h>
+#include <xen/io/xenbus.h>
+#include <xen/io/tpmif.h>
+#include <xen/io/protocols.h>
+#include <mini-os/xmalloc.h>
+#include <time.h>
+#include <mini-os/tpmback.h>
+#include <mini-os/lib.h>
+#include <fcntl.h>
+#include <mini-os/mm.h>
+#include <mini-os/posix/sys/mman.h>
+#include <mini-os/semaphore.h>
+#include <mini-os/wait.h>
+
+
+#ifndef HAVE_LIBC
+#define strtoul simple_strtoul
+#endif
+
+//#define TPMBACK_PRINT_DEBUG
+#ifdef TPMBACK_PRINT_DEBUG
+#define TPMBACK_DEBUG(fmt,...) printk("Tpmback:Debug("__FILE__":%d) " fmt, __LINE__, ##__VA_ARGS__)
+#define TPMBACK_DEBUG_MORE(fmt,...) printk(fmt, ##__VA_ARGS__)
+#else
+#define TPMBACK_DEBUG(fmt,...)
+#endif
+#define TPMBACK_ERR(fmt,...) printk("Tpmback:Error " fmt, ##__VA_ARGS__)
+#define TPMBACK_LOG(fmt,...) printk("Tpmback:Info " fmt, ##__VA_ARGS__)
+
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+
+/* Default size of the tpmif array at initialization */
+#define DEF_ARRAY_SIZE 1
+
+/* tpmif and tpmdev flags */
+#define TPMIF_CLOSED 1
+#define TPMIF_REQ_READY 2
+
+struct tpmif {
+   domid_t domid;
+   unsigned int handle;
+
+   char* fe_path;
+   char* fe_state_path;
+
+   /* Locally bound event channel*/
+   evtchn_port_t evtchn;
+
+   /* Shared page */
+   tpmif_tx_interface_t* tx;
+
+   /* pointer to TPMIF_RX_RING_SIZE pages */
+   void** pages;
+
+   enum xenbus_state state;
+   enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
+
+   unsigned char uuid[16];
+
+   /* state flags */
+   int flags;
+};
+typedef struct tpmif tpmif_t;
+
+struct tpmback_dev {
+
+   tpmif_t** tpmlist;
+   unsigned long num_tpms;
+   unsigned long num_alloc;
+
+   struct gntmap map;
+
+   /* True if at least one tpmif has a request to be handled */
+   int flags;
+
+   xenbus_event_queue events;
+
+   /* Callbacks */
+   void (*open_callback)(domid_t, unsigned int);
+   void (*close_callback)(domid_t, unsigned int);
+   void (*suspend_callback)(domid_t, unsigned int);
+   void (*resume_callback)(domid_t, unsigned int);
+};
+typedef struct tpmback_dev tpmback_dev_t;
+
+enum { EV_NONE, EV_NEWFE, EV_STCHNG } tpm_ev_enum;
+
+/* Global objects */
+static struct thread* eventthread = NULL;
+static tpmback_dev_t gtpmdev = {
+   .tpmlist = NULL,
+   .num_tpms = 0,
+   .num_alloc = 0,
+   .flags = TPMIF_CLOSED,
+   .events = NULL,
+   .open_callback = NULL,
+   .close_callback = NULL,
+   .suspend_callback = NULL,
+   .resume_callback = NULL,
+};
+struct wait_queue_head waitq;
+int globalinit = 0;
+
+/************************************
+ * TPMIF SORTED ARRAY FUNCTIONS
+ * tpmback_dev_t.tpmlist is a sorted array, sorted by domid and then handle number
+ * Duplicates are not allowed
+ * **********************************/
+
+inline void tpmif_req_ready(tpmif_t* tpmif) {
+   tpmif->flags |= TPMIF_REQ_READY;
+   gtpmdev.flags |= TPMIF_REQ_READY;
+}
+
+inline void tpmdev_check_req(void) {
+   int i;
+   int flags;
+   local_irq_save(flags);
+   for(i = 0; i < gtpmdev.num_tpms; ++i) {
+      if(gtpmdev.tpmlist[i]->flags & TPMIF_REQ_READY) {
+	 gtpmdev.flags |= TPMIF_REQ_READY;
+	 local_irq_restore(flags);
+	 return;
+      }
+   }
+   gtpmdev.flags &= ~TPMIF_REQ_READY;
+   local_irq_restore(flags);
+}
+
+inline void tpmif_req_finished(tpmif_t* tpmif) {
+   tpmif->flags &= ~TPMIF_REQ_READY;
+   tpmdev_check_req();
+}
+
+int __get_tpmif_index(int st, int n, domid_t domid, unsigned int handle)
+{
+   int i = st + n /2;
+   tpmif_t* tmp;
+
+   if( n <= 0 )
+      return -1;
+
+   tmp = gtpmdev.tpmlist[i];
+   if(domid == tmp->domid && tmp->handle == handle) {
+      return i;
+   } else if ( (domid < tmp->domid) ||
+	 (domid == tmp->domid && handle < tmp->handle)) {
+      return __get_tpmif_index(st, n/2, domid, handle);
+   } else {
+      return __get_tpmif_index(i + 1, n/2 - ((n +1) % 2), domid, handle);
+   }
+}
+
+/* Returns the array index of the tpmif domid/handle. Returns -1 if no such tpmif exists */
+int get_tpmif_index(domid_t domid, unsigned int handle)
+{
+   int flags;
+   int index;
+   local_irq_save(flags);
+   index = __get_tpmif_index(0, gtpmdev.num_tpms, domid, handle);
+   local_irq_restore(flags);
+   return index;
+}
+
+/* Returns the tpmif domid/handle or NULL if none exists */
+tpmif_t* get_tpmif(domid_t domid, unsigned int handle)
+{
+   int flags;
+   int i;
+   tpmif_t* ret;
+   local_irq_save(flags);
+   i = get_tpmif_index(domid, handle);
+   if (i < 0) {
+      ret = NULL;
+   } else {
+      ret = gtpmdev.tpmlist[i];
+   }
+   local_irq_restore(flags);
+   return ret;
+}
+
+/* Remove the given tpmif. Returns 0 if it was removed, -1 if it was not removed */
+int remove_tpmif(tpmif_t* tpmif)
+{
+   int i, j;
+   char* err;
+   int flags;
+   local_irq_save(flags);
+
+   /* Find the index in the array if it exists */
+   i = get_tpmif_index(tpmif->domid, tpmif->handle);
+   if (i < 0) {
+      goto error;
+   }
+
+   /* Remove the interface from the list */
+   for(j = i; j < gtpmdev.num_tpms - 1; ++j) {
+      gtpmdev.tpmlist[j] = gtpmdev.tpmlist[j+1];
+   }
+   gtpmdev.tpmlist[j] = NULL;
+   --gtpmdev.num_tpms;
+
+   /* If removed tpm was the only ready tpm, then we need to check and turn off the ready flag */
+   tpmdev_check_req();
+
+   local_irq_restore(flags);
+
+   /* Stop listening for events on this tpm interface */
+   if((err = xenbus_unwatch_path_token(XBT_NIL, tpmif->fe_state_path, tpmif->fe_state_path))) {
+      TPMBACK_ERR("Unable to unwatch path token `%s' Error was %s Ignoring..\n", tpmif->fe_state_path, err);
+      free(err);
+   }
+
+   return 0;
+error:
+   local_irq_restore(flags);
+   return -1;
+}
+
+/* Insert tpmif into dev->tpmlist. Returns 0 on success and non zero on error.
+ * It is an error to insert a tpmif with the same domid and handle
+ * number
+ * as something already in the list */
+int insert_tpmif(tpmif_t* tpmif)
+{
+   int flags;
+   unsigned int i, j;
+   tpmif_t* tmp;
+   char* err;
+
+   local_irq_save(flags);
+
+   /*Check if we need to allocate more space */
+   if (gtpmdev.num_tpms == gtpmdev.num_alloc) {
+      gtpmdev.num_alloc *= 2;
+      gtpmdev.tpmlist = realloc(gtpmdev.tpmlist, gtpmdev.num_alloc);
+   }
+
+   /*Find where to put the new interface */
+   for(i = 0; i < gtpmdev.num_tpms; ++i)
+   {
+      tmp = gtpmdev.tpmlist[i];
+      if(tpmif->domid == tmp->domid && tpmif->handle == tmp->handle) {
+	 TPMBACK_ERR("Tried to insert duplicate tpm interface %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
+	 goto error;
+      }
+      if((tpmif->domid < tmp->domid) ||
+	    (tpmif->domid == tmp->domid && tpmif->handle < tmp->handle)) {
+	 break;
+      }
+   }
+
+   /*Shift all the tpm pointers past i down one */
+   for(j = gtpmdev.num_tpms; j > i; --j) {
+      gtpmdev.tpmlist[j] = gtpmdev.tpmlist[j-1];
+   }
+
+   /*Add the new interface */
+   gtpmdev.tpmlist[i] = tpmif;
+   ++gtpmdev.num_tpms;
+
+   /*Should not be needed, anything inserted with ready flag is probably an error */
+   tpmdev_check_req();
+
+   local_irq_restore(flags);
+
+   /*Listen for state changes on the new interface */
+   if((err = xenbus_watch_path_token(XBT_NIL, tpmif->fe_state_path, tpmif->fe_state_path, &gtpmdev.events)))
+   {
+      /* if we got an error here we should carefully remove the interface and then return */
+      TPMBACK_ERR("Unable to watch path token `%s' Error was %s\n", tpmif->fe_state_path, err);
+      free(err);
+      remove_tpmif(tpmif);
+      goto error_post_irq;
+   }
+
+   return 0;
+error:
+   local_irq_restore(flags);
+error_post_irq:
+   return -1;
+}
+
+
+/*****************
+ * CHANGE BACKEND STATE
+ * *****************/
+/*Attempts to change the backend state in xenstore
+ * returns 0 on success and non-zero on error */
+int tpmif_change_state(tpmif_t* tpmif, enum xenbus_state state)
+{
+   char path[512];
+   char *value;
+   char *err;
+   enum xenbus_state readst;
+   TPMBACK_DEBUG("Backend state change %u/%u from=%d to=%d\n", (unsigned int) tpmif->domid, tpmif->handle, tpmif->state, state);
+   if (tpmif->state == state)
+      return 0;
+
+   snprintf(path, 512, "backend/vtpm/%u/%u/state", (unsigned int) tpmif->domid, tpmif->handle);
+
+   if((err = xenbus_read(XBT_NIL, path, &value))) {
+      TPMBACK_ERR("Unable to read backend state %s, error was %s\n", path, err);
+      free(err);
+      return -1;
+   }
+   if(sscanf(value, "%d", &readst) != 1) {
+      TPMBACK_ERR("Non integer value (%s) in %s ??\n", value, path);
+      free(value);
+      return -1;
+   }
+   free(value);
+
+   /* It's possible that the backend state got updated by hotplug or something else behind our back */
+   if(readst != tpmif->state) {
+      TPMBACK_DEBUG("tpm interface state was %d but xenstore state was %d!\n", tpmif->state, readst);
+      tpmif->state = readst;
+   }
+
+   /*If if the state isnt changing, then we dont update xenstore b/c we dont want to fire extraneous events */
+   if(tpmif->state == state) {
+      return 0;
+   }
+
+   /*update xenstore*/
+   snprintf(path, 512, "backend/vtpm/%u/%u", (unsigned int) tpmif->domid, tpmif->handle);
+   if((err = xenbus_printf(XBT_NIL, path, "state", "%u", state))) {
+      TPMBACK_ERR("Error writing to xenstore %s, error was %s new state=%d\n", path, err, state);
+      free(err);
+      return -1;
+   }
+
+   tpmif->state = state;
+
+   return 0;
+}
+/**********************************
+ * TPMIF CREATION AND DELETION
+ * *******************************/
+inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
+{
+   tpmif_t* tpmif;
+   tpmif = malloc(sizeof(*tpmif));
+   tpmif->domid = domid;
+   tpmif->handle = handle;
+   tpmif->fe_path = NULL;
+   tpmif->fe_state_path = NULL;
+   tpmif->state = XenbusStateInitialising;
+   tpmif->status = DISCONNECTED;
+   tpmif->tx = NULL;
+   tpmif->pages = NULL;
+   tpmif->flags = 0;
+   memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
+   return tpmif;
+}
+
+void __free_tpmif(tpmif_t* tpmif)
+{
+   if(tpmif->pages) {
+      free(tpmif->pages);
+   }
+   if(tpmif->fe_path) {
+      free(tpmif->fe_path);
+   }
+   if(tpmif->fe_state_path) {
+      free(tpmif->fe_state_path);
+   }
+   free(tpmif);
+}
+/* Creates a new tpm interface, adds it to the sorted array and returns it.
+ * returns NULL on error
+ * If the tpm interface already exists, it is returned*/
+tpmif_t* new_tpmif(domid_t domid, unsigned int handle)
+{
+   tpmif_t* tpmif;
+   char* err;
+   char path[512];
+
+   /* Make sure we haven't already created this tpm
+    * Double events can occur */
+   if((tpmif = get_tpmif(domid, handle)) != NULL) {
+      return tpmif;
+   }
+
+   tpmif = __init_tpmif(domid, handle);
+
+   /* Get the uuid from xenstore */
+   snprintf(path, 512, "backend/vtpm/%u/%u/uuid", (unsigned int) domid, handle);
+   if((!xenbus_read_uuid(path, tpmif->uuid))) {
+      TPMBACK_ERR("Error reading %s\n", path);
+      goto error;
+   }
+
+   /* allocate pages to be used for shared mapping */
+   if((tpmif->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE)) == NULL) {
+      goto error;
+   }
+   memset(tpmif->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
+
+   if(tpmif_change_state(tpmif, XenbusStateInitWait)) {
+      goto error;
+   }
+
+   snprintf(path, 512, "backend/vtpm/%u/%u/frontend", (unsigned int) domid, handle);
+   if((err = xenbus_read(XBT_NIL, path, &tpmif->fe_path))) {
+      TPMBACK_ERR("Error creating new tpm instance xenbus_read(%s), Error = %s", path, err);
+      free(err);
+      goto error;
+   }
+
+   /*Set the state path */
+   tpmif->fe_state_path = malloc(strlen(tpmif->fe_path) + 7);
+   strcpy(tpmif->fe_state_path, tpmif->fe_path);
+   strcat(tpmif->fe_state_path, "/state");
+
+   if(insert_tpmif(tpmif)) {
+      goto error;
+   }
+   TPMBACK_DEBUG("New tpmif %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
+   /* Do the callback now */
+   if(gtpmdev.open_callback) {
+      gtpmdev.open_callback(tpmif->domid, tpmif->handle);
+   }
+   return tpmif;
+error:
+   __free_tpmif(tpmif);
+   return NULL;
+
+}
+
+/* Removes tpmif from dev->tpmlist and frees it's memory usage */
+void free_tpmif(tpmif_t* tpmif)
+{
+   char* err;
+   char path[512];
+   TPMBACK_DEBUG("Free tpmif %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
+   if(tpmif->flags & TPMIF_CLOSED) {
+      TPMBACK_ERR("Tried to free an instance twice! Theres a bug somewhere!\n");
+      BUG();
+   }
+   tpmif->flags = TPMIF_CLOSED;
+
+   tpmif_change_state(tpmif, XenbusStateClosing);
+
+   /* Unmap share page and unbind event channel */
+   if(tpmif->status == CONNECTED) {
+      tpmif->status = DISCONNECTING;
+      mask_evtchn(tpmif->evtchn);
+
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1)) {
+	 TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
+      }
+
+      unbind_evtchn(tpmif->evtchn);
+   }
+   tpmif->status = DISCONNECTED;
+   tpmif_change_state(tpmif, XenbusStateClosed);
+
+   /* Do the callback now */
+   if(gtpmdev.close_callback) {
+      gtpmdev.close_callback(tpmif->domid, tpmif->handle);
+   }
+
+   /* remove from array */
+   remove_tpmif(tpmif);
+
+   /* Wake up anyone possibly waiting on this interface and let them exit */
+   wake_up(&waitq);
+   schedule();
+
+   /* Remove the old xenbus entries */
+   snprintf(path, 512, "backend/vtpm/%u/%u", (unsigned int) tpmif->domid, tpmif->handle);
+   if((err = xenbus_rm(XBT_NIL, path))) {
+      TPMBACK_ERR("Error cleaning up xenbus entries path=%s error=%s\n", path, err);
+      free(err);
+   }
+
+   TPMBACK_LOG("Frontend %u/%u disconnected\n", (unsigned int) tpmif->domid, tpmif->handle);
+
+   /* free memory */
+   __free_tpmif(tpmif);
+
+}
+
+/**********************
+ * REMAINING TPMBACK FUNCTIONS
+ * ********************/
+
+/*Event channel handler */
+void tpmback_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
+{
+   tpmif_t* tpmif = (tpmif_t*) data;
+   tpmif_tx_request_t* tx = &tpmif->tx->ring[0].req;
+   /* Throw away 0 size events, these can trigger from event channel unmasking */
+   if(tx->size == 0)
+      return;
+
+   TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
+   tpmif_req_ready(tpmif);
+   wake_up(&waitq);
+
+}
+
+/* Connect to frontend */
+int connect_fe(tpmif_t* tpmif)
+{
+   char path[512];
+   char* err, *value;
+   uint32_t domid;
+   grant_ref_t ringref;
+   evtchn_port_t evtchn;
+
+   /* If already connected then quit */
+   if (tpmif->status == CONNECTED) {
+      TPMBACK_DEBUG("%u/%u tried to connect while it was already connected?\n", (unsigned int) tpmif->domid, tpmif->handle);
+      return 0;
+   }
+
+   /* Fetch the grant reference */
+   snprintf(path, 512, "%s/ring-ref", tpmif->fe_path);
+   if((err = xenbus_read(XBT_NIL, path, &value))) {
+      TPMBACK_ERR("Error creating new tpm instance xenbus_read(%s) Error = %s", path, err);
+      free(err);
+      return -1;
+   }
+   if(sscanf(value, "%d", &ringref) != 1) {
+      TPMBACK_ERR("Non integer value (%s) in %s ??\n", value, path);
+      free(value);
+      return -1;
+   }
+   free(value);
+
+
+   /* Fetch the event channel*/
+   snprintf(path, 512, "%s/event-channel", tpmif->fe_path);
+   if((err = xenbus_read(XBT_NIL, path, &value))) {
+      TPMBACK_ERR("Error creating new tpm instance xenbus_read(%s) Error = %s", path, err);
+      free(err);
+      return -1;
+   }
+   if(sscanf(value, "%d", &evtchn) != 1) {
+      TPMBACK_ERR("Non integer value (%s) in %s ??\n", value, path);
+      free(value);
+      return -1;
+   }
+   free(value);
+
+   domid = tpmif->domid;
+   if((tpmif->tx = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
+      TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
+      return -1;
+   }
+   memset(tpmif->tx, 0, PAGE_SIZE);
+
+   /*Bind the event channel */
+   if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler, tpmif, &tpmif->evtchn)))
+   {
+      TPMBACK_ERR("%u/%u Unable to bind to interdomain event channel!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error_post_map;
+   }
+   unmask_evtchn(tpmif->evtchn);
+
+   /* Write the ready flag and change status to connected */
+   snprintf(path, 512, "backend/vtpm/%u/%u", (unsigned int) tpmif->domid, tpmif->handle);
+   if((err = xenbus_printf(XBT_NIL, path, "ready", "%u", 1))) {
+      TPMBACK_ERR("%u/%u Unable to write ready flag on connect_fe()\n", (unsigned int) tpmif->domid, tpmif->handle);
+      free(err);
+      goto error_post_evtchn;
+   }
+   tpmif->status = CONNECTED;
+   if((tpmif_change_state(tpmif, XenbusStateConnected))){
+      goto error_post_evtchn;
+   }
+
+   TPMBACK_LOG("Frontend %u/%u connected\n", (unsigned int) tpmif->domid, tpmif->handle);
+
+   return 0;
+error_post_evtchn:
+   mask_evtchn(tpmif->evtchn);
+   unbind_evtchn(tpmif->evtchn);
+error_post_map:
+   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1);
+   return -1;
+}
+
+static int frontend_changed(tpmif_t* tpmif)
+{
+   int state = xenbus_read_integer(tpmif->fe_state_path);
+   if(state < 0) {
+      state = XenbusStateUnknown;
+   }
+
+   TPMBACK_DEBUG("Frontend %u/%u state changed to %d\n", (unsigned int) tpmif->domid, tpmif->handle, state);
+
+   switch (state) {
+      case XenbusStateInitialising:
+      case XenbusStateInitialised:
+	 break;
+
+      case XenbusStateConnected:
+	 if(connect_fe(tpmif)) {
+	    TPMBACK_ERR("Failed to connect to front end %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
+	    tpmif_change_state(tpmif, XenbusStateClosed);
+	    return -1;
+	 }
+	 break;
+
+      case XenbusStateClosing:
+	 tpmif_change_state(tpmif, XenbusStateClosing);
+	 break;
+
+      case XenbusStateUnknown: /* keep it here */
+      case XenbusStateClosed:
+	 free_tpmif(tpmif);
+	 break;
+
+      default:
+	 TPMBACK_DEBUG("BAD STATE CHANGE %u/%u state = %d for tpmif\n", (unsigned int) tpmif->domid, tpmif->handle, state);
+	 return -1;
+   }
+   return 0;
+}
+
+
+/* parses the string that comes out of xenbus_watch_wait_return. */
+static int parse_eventstr(const char* evstr, domid_t* domid, unsigned int* handle)
+{
+   int ret;
+   char cmd[40];
+   char* err;
+   char* value;
+   unsigned int udomid = 0;
+   tpmif_t* tpmif;
+   /* First check for new frontends, this occurs when /backend/vtpm/<domid>/<handle> gets created. Note we what the sscanf to fail on the last %s */
+   if (sscanf(evstr, "backend/vtpm/%u/%u/%40s", &udomid, handle, cmd) == 2) {
+      *domid = udomid;
+      /* Make sure the entry exists, if this event triggers because the entry dissapeared then ignore it */
+      if((err = xenbus_read(XBT_NIL, evstr, &value))) {
+	 free(err);
+	 return EV_NONE;
+      }
+      free(value);
+      /* Make sure the tpmif entry does not already exist, this should not happen */
+      if((tpmif = get_tpmif(*domid, *handle)) != NULL) {
+	 TPMBACK_DEBUG("Duplicate tpm entries! %u %u\n", tpmif->domid, tpmif->handle);
+	 return EV_NONE;
+      }
+      return EV_NEWFE;
+   } else if((ret = sscanf(evstr, "/local/domain/%u/device/vtpm/%u/%40s", &udomid, handle, cmd)) == 3) {
+      *domid = udomid;
+      if (!strcmp(cmd, "state"))
+	 return EV_STCHNG;
+   }
+   return EV_NONE;
+}
+
+void handle_backend_event(char* evstr) {
+   tpmif_t* tpmif;
+   domid_t domid;
+   unsigned int handle;
+   int event;
+
+   TPMBACK_DEBUG("Xenbus Event: %s\n", evstr);
+
+   event = parse_eventstr(evstr, &domid, &handle);
+
+   switch(event) {
+      case EV_NEWFE:
+	 if(new_tpmif(domid, handle) == NULL) {
+	    TPMBACK_ERR("Failed to create new tpm instance %u/%u\n", (unsigned int) domid, handle);
+	 }
+	 wake_up(&waitq);
+	 break;
+      case EV_STCHNG:
+	 if((tpmif = get_tpmif(domid, handle))) {
+	    frontend_changed(tpmif);
+	 } else {
+	    TPMBACK_DEBUG("Event Received for non-existant tpm! instance=%u/%u xenbus_event=%s\n", (unsigned int) domid, handle, evstr);
+	 }
+	 break;
+   }
+}
+
+/* Runs through the given path and creates events recursively
+ * for all of its children.
+ * @path - xenstore path to scan */
+static void generate_backend_events(const char* path)
+{
+   char* err;
+   int i, len;
+   char **dirs;
+   char *entry;
+
+   if((err = xenbus_ls(XBT_NIL, path, &dirs)) != NULL) {
+      free(err);
+      return;
+   }
+
+   for(i = 0; dirs[i] != NULL; ++i) {
+      len = strlen(path) + strlen(dirs[i]) + 2;
+      entry = malloc(len);
+      snprintf(entry, len, "%s/%s", path, dirs[i]);
+
+      /* Generate and handle event for the entry itself */
+      handle_backend_event(entry);
+
+      /* Do children */
+      generate_backend_events(entry);
+
+      /* Cleanup */
+      free(entry);
+      free(dirs[i]);
+   }
+   free(dirs);
+   return;
+}
+
+unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle)
+{
+   tpmif_t* tpmif;
+   if((tpmif = get_tpmif(domid, handle)) == NULL) {
+      TPMBACK_DEBUG("get_uuid() failed, %u/%u is an invalid frontend\n", (unsigned int) domid, handle);
+      return NULL;
+   }
+
+   return tpmif->uuid;
+}
+
+void tpmback_set_open_callback(void (*cb)(domid_t, unsigned int))
+{
+   gtpmdev.open_callback = cb;
+}
+void tpmback_set_close_callback(void (*cb)(domid_t, unsigned int))
+{
+   gtpmdev.close_callback = cb;
+}
+void tpmback_set_suspend_callback(void (*cb)(domid_t, unsigned int))
+{
+   gtpmdev.suspend_callback = cb;
+}
+void tpmback_set_resume_callback(void (*cb)(domid_t, unsigned int))
+{
+   gtpmdev.resume_callback = cb;
+}
+
+static void event_listener(void)
+{
+   const char* bepath = "backend/vtpm";
+   char **path;
+   char* err;
+
+   /* Setup the backend device watch */
+   if((err = xenbus_watch_path_token(XBT_NIL, bepath, bepath, &gtpmdev.events)) != NULL) {
+      TPMBACK_ERR("xenbus_watch_path_token(%s) failed with error %s!\n", bepath, err);
+      free(err);
+      goto egress;
+   }
+
+   /* Check for any frontends that connected before we set the watch.
+    * This is almost guaranteed to happen if both domains are started
+    * immediatly one after the other.
+    * We do this by manually generating events on everything in the backend
+    * path */
+   generate_backend_events(bepath);
+
+   /* Wait and listen for changes in frontend connections */
+   while(1) {
+      path = xenbus_wait_for_watch_return(&gtpmdev.events);
+
+      /*If quit flag was set then exit */
+      if(gtpmdev.flags & TPMIF_CLOSED) {
+	 TPMBACK_DEBUG("listener thread got quit event. Exiting..\n");
+	 free(path);
+	 break;
+      }
+      handle_backend_event(*path);
+      free(path);
+
+   }
+
+   if((err = xenbus_unwatch_path_token(XBT_NIL, bepath, bepath)) != NULL) {
+      free(err);
+   }
+egress:
+   return;
+}
+
+void event_thread(void* p) {
+   event_listener();
+}
+
+void init_tpmback(void)
+{
+   if(!globalinit) {
+      init_waitqueue_head(&waitq);
+      globalinit = 1;
+   }
+   printk("============= Init TPM BACK ================\n");
+   gtpmdev.tpmlist = malloc(sizeof(tpmif_t*) * DEF_ARRAY_SIZE);
+   gtpmdev.num_alloc = DEF_ARRAY_SIZE;
+   gtpmdev.num_tpms = 0;
+   gtpmdev.flags = 0;
+
+   gtpmdev.open_callback = gtpmdev.close_callback = NULL;
+   gtpmdev.suspend_callback = gtpmdev.resume_callback = NULL;
+
+   eventthread = create_thread("tpmback-listener", event_thread, NULL);
+
+}
+
+void shutdown_tpmback(void)
+{
+   /* Disable callbacks */
+   gtpmdev.open_callback = gtpmdev.close_callback = NULL;
+   gtpmdev.suspend_callback = gtpmdev.resume_callback = NULL;
+
+   TPMBACK_LOG("Shutting down tpm backend\n");
+   /* Set the quit flag */
+   gtpmdev.flags = TPMIF_CLOSED;
+
+   //printk("num tpms is %d\n", gtpmdev.num_tpms);
+   /*Free all backend instances */
+   while(gtpmdev.num_tpms) {
+      free_tpmif(gtpmdev.tpmlist[0]);
+   }
+   free(gtpmdev.tpmlist);
+   gtpmdev.tpmlist = NULL;
+   gtpmdev.num_alloc = 0;
+
+   /* Wake up anyone possibly waiting on the device and let them exit */
+   wake_up(&waitq);
+   schedule();
+}
+
+inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, unsigned char uuid[16])
+{
+   tpmcmd->domid = domid;
+   tpmcmd->handle = handle;
+   memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
+   tpmcmd->req = NULL;
+   tpmcmd->req_len = 0;
+   tpmcmd->resp = NULL;
+   tpmcmd->resp_len = 0;
+}
+
+tpmcmd_t* get_request(tpmif_t* tpmif) {
+   tpmcmd_t* cmd;
+   tpmif_tx_request_t* tx;
+   int offset;
+   int tocopy;
+   int i;
+   uint32_t domid;
+   int flags;
+
+   local_irq_save(flags);
+
+   /* Allocate the cmd object to hold the data */
+   if((cmd = malloc(sizeof(*cmd))) == NULL) {
+      goto error;
+   }
+   init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);
+
+   tx = &tpmif->tx->ring[0].req;
+   cmd->req_len = tx->size;
+   /* Allocate the buffer */
+   if(cmd->req_len) {
+      if((cmd->req = malloc(cmd->req_len)) == NULL) {
+	 goto error;
+      }
+   }
+   /* Copy the bits from the shared pages */
+   offset = 0;
+   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->req_len; ++i) {
+      tx = &tpmif->tx->ring[i].req;
+
+      /* Map the page with the data */
+      domid = (uint32_t)tpmif->domid;
+      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_READ)) == NULL) {
+	 TPMBACK_ERR("%u/%u Unable to map shared page during read!\n", (unsigned int) tpmif->domid, tpmif->handle);
+	 goto error;
+      }
+
+      /* do the copy now */
+      tocopy = min(cmd->req_len - offset, PAGE_SIZE);
+      memcpy(&cmd->req[offset], tpmif->pages[i], tocopy);
+      offset += tocopy;
+
+      /* release the page */
+      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
+
+   }
+
+#ifdef TPMBACK_PRINT_DEBUG
+   TPMBACK_DEBUG("Received Tpm Command from %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->req_len);
+   for(i = 0; i < cmd->req_len; ++i) {
+      if (!(i % 30)) {
+	 TPMBACK_DEBUG_MORE("\n");
+      }
+      TPMBACK_DEBUG_MORE("%02hhX ", cmd->req[i]);
+   }
+   TPMBACK_DEBUG_MORE("\n\n");
+#endif
+
+   local_irq_restore(flags);
+   return cmd;
+error:
+   if(cmd != NULL) {
+      if (cmd->req != NULL) {
+	 free(cmd->req);
+	 cmd->req = NULL;
+      }
+      free(cmd);
+      cmd = NULL;
+   }
+   local_irq_restore(flags);
+   return NULL;
+
+}
+
+void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
+{
+   tpmif_tx_request_t* tx;
+   int offset;
+   int i;
+   uint32_t domid;
+   int tocopy;
+   int flags;
+
+   local_irq_save(flags);
+
+   tx = &tpmif->tx->ring[0].req;
+   tx->size = cmd->resp_len;
+
+   offset = 0;
+   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->resp_len; ++i) {
+      tx = &tpmif->tx->ring[i].req;
+
+      /* Map the page with the data */
+      domid = (uint32_t)tpmif->domid;
+      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_WRITE)) == NULL) {
+	 TPMBACK_ERR("%u/%u Unable to map shared page during write!\n", (unsigned int) tpmif->domid, tpmif->handle);
+	 goto error;
+      }
+
+      /* do the copy now */
+      tocopy = min(cmd->resp_len - offset, PAGE_SIZE);
+      memcpy(tpmif->pages[i], &cmd->resp[offset], tocopy);
+      offset += tocopy;
+
+      /* release the page */
+      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
+
+   }
+
+#ifdef TPMBACK_PRINT_DEBUG
+   TPMBACK_DEBUG("Sent response to %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->resp_len);
+   for(i = 0; i < cmd->resp_len; ++i) {
+      if (!(i % 30)) {
+	 TPMBACK_DEBUG_MORE("\n");
+      }
+      TPMBACK_DEBUG_MORE("%02hhX ", cmd->resp[i]);
+   }
+   TPMBACK_DEBUG_MORE("\n\n");
+#endif
+   /* clear the ready flag and send the event channel notice to the frontend */
+   tpmif_req_finished(tpmif);
+   notify_remote_via_evtchn(tpmif->evtchn);
+error:
+   local_irq_restore(flags);
+   return;
+}
+
+tpmcmd_t* tpmback_req_any(void)
+{
+   int i;
+   /* Block until something has a request */
+   wait_event(waitq, (gtpmdev.flags & (TPMIF_REQ_READY | TPMIF_CLOSED)));
+
+   /* Check if were shutting down */
+   if(gtpmdev.flags & TPMIF_CLOSED) {
+      /* if something was waiting for us to give up the queue so it can shutdown, let it finish */
+      schedule();
+      return NULL;
+   }
+
+   for(i = 0; i < gtpmdev.num_tpms; ++i) {
+      if(gtpmdev.tpmlist[i]->flags & TPMIF_REQ_READY) {
+	 return get_request(gtpmdev.tpmlist[i]);
+      }
+   }
+
+   TPMBACK_ERR("backend request ready flag was set but no interfaces were actually ready\n");
+   return NULL;
+}
+
+tpmcmd_t* tpmback_req(domid_t domid, unsigned int handle)
+{
+   tpmif_t* tpmif;
+   tpmif = get_tpmif(domid, handle);
+   if(tpmif == NULL) {
+      return NULL;
+   }
+
+   wait_event(waitq, (tpmif->flags & (TPMIF_REQ_READY | TPMIF_CLOSED) || gtpmdev.flags & TPMIF_CLOSED));
+
+   /* Check if were shutting down */
+   if(tpmif->flags & TPMIF_CLOSED || gtpmdev.flags & TPMIF_CLOSED) {
+      /* if something was waiting for us to give up the queue so it can free this instance, let it finish */
+      schedule();
+      return NULL;
+   }
+
+   return get_request(tpmif);
+}
+
+void tpmback_resp(tpmcmd_t* tpmcmd)
+{
+   tpmif_t* tpmif;
+
+   /* Get the associated interface, if it doesnt exist then just quit */
+   tpmif = get_tpmif(tpmcmd->domid, tpmcmd->handle);
+   if(tpmif == NULL) {
+      TPMBACK_ERR("Tried to send a reponse to non existant frontend %u/%u\n", (unsigned int) tpmcmd->domid, tpmcmd->handle);
+      goto end;
+   }
+
+   if(!(tpmif->flags & TPMIF_REQ_READY)) {
+      TPMBACK_ERR("Tried to send response to a frontend that was not waiting for one %u/%u\n", (unsigned int) tpmcmd->domid, tpmcmd->handle);
+      goto end;
+   }
+
+   /* Send response to frontend */
+   send_response(tpmcmd, tpmif);
+
+end:
+   if(tpmcmd->req != NULL) {
+      free(tpmcmd->req);
+   }
+   free(tpmcmd);
+   return;
+}
+
+int tpmback_wait_for_frontend_connect(domid_t *domid, unsigned int *handle)
+{
+   tpmif_t* tpmif;
+   int flags;
+   wait_event(waitq, ((gtpmdev.num_tpms > 0) || gtpmdev.flags & TPMIF_CLOSED));
+   if(gtpmdev.flags & TPMIF_CLOSED) {
+      return -1;
+   }
+   local_irq_save(flags);
+   tpmif = gtpmdev.tpmlist[0];
+   *domid = tpmif->domid;
+   *handle = tpmif->handle;
+   local_irq_restore(flags);
+
+   return 0;
+}
+
+int tpmback_num_frontends(void)
+{
+   return gtpmdev.num_tpms;
+}
diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
new file mode 100644
index 0000000..0218d7f
--- /dev/null
+++ b/extras/mini-os/tpmfront.c
@@ -0,0 +1,608 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * This code has been derived from drivers/char/tpm_vtpm.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (C) 2006 IBM Corporation
+ *
+ * This code has also been derived from drivers/char/tpm_xen.c
+ * from the xen 2.6.18 linux kernel
+ *
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * which was itself derived from drivers/xen/netfront/netfront.c
+ * from the linux kernel
+ *
+ * Copyright (c) 2002-2004, K A Fraser
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, version 2 of the
+ * License.
+ */
+#include <mini-os/os.h>
+#include <mini-os/xenbus.h>
+#include <mini-os/xmalloc.h>
+#include <mini-os/events.h>
+#include <mini-os/wait.h>
+#include <mini-os/gnttab.h>
+#include <xen/io/xenbus.h>
+#include <xen/io/tpmif.h>
+#include <mini-os/tpmfront.h>
+#include <fcntl.h>
+
+//#define TPMFRONT_PRINT_DEBUG
+#ifdef TPMFRONT_PRINT_DEBUG
+#define TPMFRONT_DEBUG(fmt,...) printk("Tpmfront:Debug("__FILE__":%d) " fmt, __LINE__, ##__VA_ARGS__)
+#define TPMFRONT_DEBUG_MORE(fmt,...) printk(fmt, ##__VA_ARGS__)
+#else
+#define TPMFRONT_DEBUG(fmt,...)
+#endif
+#define TPMFRONT_ERR(fmt,...) printk("Tpmfront:Error " fmt, ##__VA_ARGS__)
+#define TPMFRONT_LOG(fmt,...) printk("Tpmfront:Info " fmt, ##__VA_ARGS__)
+
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+
+void tpmfront_handler(evtchn_port_t port, struct pt_regs *regs, void *data) {
+   struct tpmfront_dev* dev = (struct tpmfront_dev*) data;
+   /*If we get a response when we didnt make a request, just ignore it */
+   if(!dev->waiting) {
+      return;
+   }
+
+   dev->waiting = 0;
+#ifdef HAVE_LIBC
+   if(dev->fd >= 0) {
+      files[dev->fd].read = 1;
+   }
+#endif
+   wake_up(&dev->waitq);
+}
+
+static int publish_xenbus(struct tpmfront_dev* dev) {
+   xenbus_transaction_t xbt;
+   int retry;
+   char* err;
+   /* Write the grant reference and event channel to xenstore */
+again:
+   if((err = xenbus_transaction_start(&xbt))) {
+      TPMFRONT_ERR("Unable to start xenbus transaction, error was %s\n", err);
+      free(err);
+      return -1;
+   }
+
+   if((err = xenbus_printf(xbt, dev->nodename, "ring-ref", "%u", (unsigned int) dev->ring_ref))) {
+      TPMFRONT_ERR("Unable to write %s/ring-ref, error was %s\n", dev->nodename, err);
+      free(err);
+      goto abort_transaction;
+   }
+
+   if((err = xenbus_printf(xbt, dev->nodename, "event-channel", "%u", (unsigned int) dev->evtchn))) {
+      TPMFRONT_ERR("Unable to write %s/event-channel, error was %s\n", dev->nodename, err);
+      free(err);
+      goto abort_transaction;
+   }
+
+   if((err = xenbus_transaction_end(xbt, 0, &retry))) {
+      TPMFRONT_ERR("Unable to complete xenbus transaction, error was %s\n", err);
+      free(err);
+      return -1;
+   }
+   if(retry) {
+      goto again;
+   }
+
+   return 0;
+abort_transaction:
+   if((err = xenbus_transaction_end(xbt, 1, &retry))) {
+      free(err);
+   }
+   return -1;
+}
+
+static int wait_for_backend_connect(xenbus_event_queue* events, char* path)
+{
+   int state;
+
+   TPMFRONT_LOG("Waiting for backend connection..\n");
+   /* Wait for the backend to connect */
+   while(1) {
+      state = xenbus_read_integer(path);
+      if ( state < 0)
+	 state = XenbusStateUnknown;
+      switch(state) {
+	 /* Bad states, we quit with error */
+	 case XenbusStateUnknown:
+	 case XenbusStateClosing:
+	 case XenbusStateClosed:
+	    TPMFRONT_ERR("Unable to connect to backend\n");
+	    return -1;
+	 /* If backend is connected then break out of loop */
+	 case XenbusStateConnected:
+	    TPMFRONT_LOG("Backend Connected\n");
+	    return 0;
+	 default:
+	    xenbus_wait_for_watch(events);
+      }
+   }
+
+}
+
+static int wait_for_backend_closed(xenbus_event_queue* events, char* path)
+{
+   int state;
+
+   TPMFRONT_LOG("Waiting for backend to close..\n");
+   while(1) {
+      state = xenbus_read_integer(path);
+      if ( state < 0)
+	 state = XenbusStateUnknown;
+      switch(state) {
+	 case XenbusStateUnknown:
+	    TPMFRONT_ERR("Backend Unknown state, forcing shutdown\n");
+	    return -1;
+	 case XenbusStateClosed:
+	    TPMFRONT_LOG("Backend Closed\n");
+	    return 0;
+	 default:
+	    xenbus_wait_for_watch(events);
+      }
+   }
+
+}
+
+static int wait_for_backend_state_changed(struct tpmfront_dev* dev, XenbusState state) {
+   char* err;
+   int ret = 0;
+   xenbus_event_queue events = NULL;
+   char path[512];
+
+   snprintf(path, 512, "%s/state", dev->bepath);
+   /*Setup the watch to wait for the backend */
+   if((err = xenbus_watch_path_token(XBT_NIL, path, path, &events))) {
+      TPMFRONT_ERR("Could not set a watch on %s, error was %s\n", path, err);
+      free(err);
+      return -1;
+   }
+
+   /* Do the actual wait loop now */
+   switch(state) {
+      case XenbusStateConnected:
+	 ret = wait_for_backend_connect(&events, path);
+	 break;
+      case XenbusStateClosed:
+	 ret = wait_for_backend_closed(&events, path);
+	 break;
+      default:
+	 break;
+   }
+
+   if((err = xenbus_unwatch_path_token(XBT_NIL, path, path))) {
+      TPMFRONT_ERR("Unable to unwatch %s, error was %s, ignoring..\n", path, err);
+      free(err);
+   }
+   return ret;
+}
+
+static int tpmfront_connect(struct tpmfront_dev* dev)
+{
+   char* err;
+   /* Create shared page */
+   dev->tx = (tpmif_tx_interface_t*) alloc_page();
+   if(dev->tx == NULL) {
+      TPMFRONT_ERR("Unable to allocate page for shared memory\n");
+      goto error;
+   }
+   memset(dev->tx, 0, PAGE_SIZE);
+   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->tx), 0);
+   TPMFRONT_DEBUG("grant ref is %lu\n", (unsigned long) dev->ring_ref);
+
+   /*Create event channel */
+   if(evtchn_alloc_unbound(dev->bedomid, tpmfront_handler, dev, &dev->evtchn)) {
+      TPMFRONT_ERR("Unable to allocate event channel\n");
+      goto error_postmap;
+   }
+   unmask_evtchn(dev->evtchn);
+   TPMFRONT_DEBUG("event channel is %lu\n", (unsigned long) dev->evtchn);
+
+   /* Write the entries to xenstore */
+   if(publish_xenbus(dev)) {
+      goto error_postevtchn;
+   }
+
+   /* Change state to connected */
+   dev->state = XenbusStateConnected;
+
+   /* Tell the backend that we are ready */
+   if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", dev->state))) {
+      TPMFRONT_ERR("Unable to write to xenstore %s/state, value=%u", dev->nodename, XenbusStateConnected);
+      free(err);
+      goto error;
+   }
+
+   return 0;
+error_postevtchn:
+      mask_evtchn(dev->evtchn);
+      unbind_evtchn(dev->evtchn);
+error_postmap:
+      gnttab_end_access(dev->ring_ref);
+      free_page(dev->tx);
+error:
+   return -1;
+}
+
+struct tpmfront_dev* init_tpmfront(const char* _nodename)
+{
+   struct tpmfront_dev* dev;
+   const char* nodename;
+   char path[512];
+   char* value, *err;
+   unsigned long long ival;
+   int i;
+
+   printk("============= Init TPM Front ================\n");
+
+   dev = malloc(sizeof(struct tpmfront_dev));
+   memset(dev, 0, sizeof(struct tpmfront_dev));
+
+#ifdef HAVE_LIBC
+   dev->fd = -1;
+#endif
+
+   nodename = _nodename ? _nodename : "device/vtpm/0";
+   dev->nodename = strdup(nodename);
+
+   init_waitqueue_head(&dev->waitq);
+
+   /* Get backend domid */
+   snprintf(path, 512, "%s/backend-id", dev->nodename);
+   if((err = xenbus_read(XBT_NIL, path, &value))) {
+      TPMFRONT_ERR("Unable to read %s during tpmfront initialization! error = %s\n", path, err);
+      free(err);
+      goto error;
+   }
+   if(sscanf(value, "%llu", &ival) != 1) {
+      TPMFRONT_ERR("%s has non-integer value (%s)\n", path, value);
+      free(value);
+      goto error;
+   }
+   free(value);
+   dev->bedomid = ival;
+
+   /* Get backend xenstore path */
+   snprintf(path, 512, "%s/backend", dev->nodename);
+   if((err = xenbus_read(XBT_NIL, path, &dev->bepath))) {
+      TPMFRONT_ERR("Unable to read %s during tpmfront initialization! error = %s\n", path, err);
+      free(err);
+      goto error;
+   }
+
+   /* Create and publish grant reference and event channel */
+   if (tpmfront_connect(dev)) {
+      goto error;
+   }
+
+   /* Wait for backend to connect */
+   if( wait_for_backend_state_changed(dev, XenbusStateConnected)) {
+      goto error;
+   }
+
+   /* Allocate pages that will contain the messages */
+   dev->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE);
+   if(dev->pages == NULL) {
+      goto error;
+   }
+   memset(dev->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
+   for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
+      dev->pages[i] = (void*)alloc_page();
+      if(dev->pages[i] == NULL) {
+	 goto error;
+      }
+   }
+
+   TPMFRONT_LOG("Initialization Completed successfully\n");
+
+   return dev;
+
+error:
+   shutdown_tpmfront(dev);
+   return NULL;
+}
+void shutdown_tpmfront(struct tpmfront_dev* dev)
+{
+   char* err;
+   char path[512];
+   int i;
+   tpmif_tx_request_t* tx;
+   if(dev == NULL) {
+      return;
+   }
+   TPMFRONT_LOG("Shutting down tpmfront\n");
+   /* disconnect */
+   if(dev->state == XenbusStateConnected) {
+      dev->state = XenbusStateClosing;
+      //FIXME: Transaction for this?
+      /* Tell backend we are closing */
+      if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
+	 free(err);
+      }
+
+      /* Clean up xenstore entries */
+      snprintf(path, 512, "%s/event-channel", dev->nodename);
+      if((err = xenbus_rm(XBT_NIL, path))) {
+	 free(err);
+      }
+      snprintf(path, 512, "%s/ring-ref", dev->nodename);
+      if((err = xenbus_rm(XBT_NIL, path))) {
+	 free(err);
+      }
+
+      /* Tell backend we are closed */
+      dev->state = XenbusStateClosed;
+      if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
+	 TPMFRONT_ERR("Unable to write to %s, error was %s", dev->nodename, err);
+	 free(err);
+      }
+
+      /* Wait for the backend to close and unmap shared pages, ignore any errors */
+      wait_for_backend_state_changed(dev, XenbusStateClosed);
+
+      /* Cleanup any shared pages */
+      if(dev->pages) {
+	 for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
+	    if(dev->pages[i]) {
+	       tx = &dev->tx->ring[i].req;
+	       if(tx->ref != 0) {
+		  gnttab_end_access(tx->ref);
+	       }
+	       free_page(dev->pages[i]);
+	    }
+	 }
+	 free(dev->pages);
+      }
+
+      /* Close event channel and unmap shared page */
+      mask_evtchn(dev->evtchn);
+      unbind_evtchn(dev->evtchn);
+      gnttab_end_access(dev->ring_ref);
+
+      free_page(dev->tx);
+
+   }
+
+   /* Cleanup memory usage */
+   if(dev->respbuf) {
+      free(dev->respbuf);
+   }
+   if(dev->bepath) {
+      free(dev->bepath);
+   }
+   if(dev->nodename) {
+      free(dev->nodename);
+   }
+   free(dev);
+}
+
+int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
+{
+   int i;
+   tpmif_tx_request_t* tx = NULL;
+   /* Error Checking */
+   if(dev == NULL || dev->state != XenbusStateConnected) {
+      TPMFRONT_ERR("Tried to send message through disconnected frontend\n");
+      return -1;
+   }
+
+#ifdef TPMFRONT_PRINT_DEBUG
+   TPMFRONT_DEBUG("Sending Msg to backend size=%u", (unsigned int) length);
+   for(i = 0; i < length; ++i) {
+      if(!(i % 30)) {
+	 TPMFRONT_DEBUG_MORE("\n");
+      }
+      TPMFRONT_DEBUG_MORE("%02X ", msg[i]);
+   }
+   TPMFRONT_DEBUG_MORE("\n");
+#endif
+
+   /* Copy to shared pages now */
+   for(i = 0; length > 0 && i < TPMIF_TX_RING_SIZE; ++i) {
+      /* Share the page */
+      tx = &dev->tx->ring[i].req;
+      tx->unused = 0;
+      tx->addr = virt_to_mach(dev->pages[i]);
+      tx->ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->pages[i]), 0);
+      /* Copy the bits to the page */
+      tx->size = length > PAGE_SIZE ? PAGE_SIZE : length;
+      memcpy(dev->pages[i], &msg[i * PAGE_SIZE], tx->size);
+
+      /* Update counters */
+      length -= tx->size;
+   }
+   dev->waiting = 1;
+   dev->resplen = 0;
+#ifdef HAVE_LIBC
+   if(dev->fd >= 0) {
+      files[dev->fd].read = 0;
+      files[dev->fd].tpmfront.respgot = 0;
+      files[dev->fd].tpmfront.offset = 0;
+   }
+#endif
+   notify_remote_via_evtchn(dev->evtchn);
+   return 0;
+}
+int tpmfront_recv(struct tpmfront_dev* dev, uint8_t** msg, size_t *length)
+{
+   tpmif_tx_request_t* tx;
+   int i;
+   if(dev == NULL || dev->state != XenbusStateConnected) {
+      TPMFRONT_ERR("Tried to receive message from disconnected frontend\n");
+      return -1;
+   }
+   /*Wait for the response */
+   wait_event(dev->waitq, (!dev->waiting));
+
+   /* Initialize */
+   *msg = NULL;
+   *length = 0;
+
+   /* special case, just quit */
+   tx = &dev->tx->ring[0].req;
+   if(tx->size == 0 ) {
+       goto quit;
+   }
+   /* Get the total size */
+   tx = &dev->tx->ring[0].req;
+   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
+      tx = &dev->tx->ring[i].req;
+      *length += tx->size;
+   }
+   /* Alloc the buffer */
+   if(dev->respbuf) {
+      free(dev->respbuf);
+   }
+   *msg = dev->respbuf = malloc(*length);
+   dev->resplen = *length;
+   /* Copy the bits */
+   tx = &dev->tx->ring[0].req;
+   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
+      tx = &dev->tx->ring[i].req;
+      memcpy(&(*msg)[i * PAGE_SIZE], dev->pages[i], tx->size);
+      gnttab_end_access(tx->ref);
+      tx->ref = 0;
+   }
+#ifdef TPMFRONT_PRINT_DEBUG
+   TPMFRONT_DEBUG("Received response from backend size=%u", (unsigned int) *length);
+   for(i = 0; i < *length; ++i) {
+      if(!(i % 30)) {
+	 TPMFRONT_DEBUG_MORE("\n");
+      }
+      TPMFRONT_DEBUG_MORE("%02X ", (*msg)[i]);
+   }
+   TPMFRONT_DEBUG_MORE("\n");
+#endif
+#ifdef HAVE_LIBC
+   if(dev->fd >= 0) {
+      files[dev->fd].tpmfront.respgot = 1;
+   }
+#endif
+quit:
+   return 0;
+}
+
+int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen)
+{
+   int rc;
+   if((rc = tpmfront_send(dev, req, reqlen))) {
+      return rc;
+   }
+   if((rc = tpmfront_recv(dev, resp, resplen))) {
+      return rc;
+   }
+
+   return 0;
+}
+
+#ifdef HAVE_LIBC
+#include <errno.h>
+int tpmfront_open(struct tpmfront_dev* dev)
+{
+   /* Silently prevent multiple opens */
+   if(dev->fd != -1) {
+      return dev->fd;
+   }
+
+   dev->fd = alloc_fd(FTYPE_TPMFRONT);
+   printk("tpmfront_open(%s) -> %d\n", dev->nodename, dev->fd);
+   files[dev->fd].tpmfront.dev = dev;
+   files[dev->fd].tpmfront.offset = 0;
+   files[dev->fd].tpmfront.respgot = 0;
+   return dev->fd;
+}
+
+int tpmfront_posix_write(int fd, const uint8_t* buf, size_t count)
+{
+   int rc;
+   struct tpmfront_dev* dev;
+   dev = files[fd].tpmfront.dev;
+
+   if(count == 0) {
+      return 0;
+   }
+
+   /* Return an error if we are already processing a command */
+   if(dev->waiting) {
+      errno = EINPROGRESS;
+      return -1;
+   }
+   /* Send the command now */
+   if((rc = tpmfront_send(dev, buf, count)) != 0) {
+      errno = EIO;
+      return -1;
+   }
+   return count;
+}
+
+int tpmfront_posix_read(int fd, uint8_t* buf, size_t count)
+{
+   int rc;
+   uint8_t* dummybuf;
+   size_t dummysz;
+   struct tpmfront_dev* dev;
+
+   dev = files[fd].tpmfront.dev;
+
+   if(count == 0) {
+      return 0;
+   }
+
+   /* get the response if we haven't already */
+   if(files[dev->fd].tpmfront.respgot == 0) {
+      if ((rc = tpmfront_recv(dev, &dummybuf, &dummysz)) != 0) {
+	 errno = EIO;
+	 return -1;
+      }
+   }
+
+   /* handle EOF case */
+   if(files[dev->fd].tpmfront.offset >= dev->resplen) {
+      return 0;
+   }
+
+   /* Compute the number of bytes and do the copy operation */
+   if((rc = min(count, dev->resplen - files[dev->fd].tpmfront.offset)) != 0) {
+      memcpy(buf, dev->respbuf + files[dev->fd].tpmfront.offset, rc);
+      files[dev->fd].tpmfront.offset += rc;
+   }
+
+   return rc;
+}
+
+int tpmfront_posix_fstat(int fd, struct stat* buf)
+{
+   uint8_t* dummybuf;
+   size_t dummysz;
+   int rc;
+   struct tpmfront_dev* dev = files[fd].tpmfront.dev;
+
+   /* If we have a response waiting, then read it now from the backend
+    * so we can get its length*/
+   if(dev->waiting || (files[dev->fd].read == 1 && !files[dev->fd].tpmfront.respgot)) {
+      if ((rc = tpmfront_recv(dev, &dummybuf, &dummysz)) != 0) {
+	 errno = EIO;
+	 return -1;
+      }
+   }
+
+   buf->st_mode = O_RDWR;
+   buf->st_uid = 0;
+   buf->st_gid = 0;
+   buf->st_size = dev->resplen;
+   buf->st_atime = buf->st_mtime = buf->st_ctime = time(NULL);
+
+   return 0;
+}
+
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:34:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:34:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1Sp-00050v-Ln; Thu, 01 Nov 2012 20:34:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TU1So-00050f-5v
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:34:06 +0000
Received: from [85.158.143.99:6368] by server-2.bemta-4.messagelabs.com id
	B7/4C-28922-DBCD2905; Thu, 01 Nov 2012 20:34:05 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-4.tower-216.messagelabs.com!1351802043!22999381!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11977 invoked from network); 1 Nov 2012 20:34:04 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-4.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 20:34:04 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148030877;
	Thu, 01 Nov 2012 16:33:38 -0400
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com, xen-devel@lists.xen.org,
	samuel.thibault@ens-lyon.org
Date: Thu,  1 Nov 2012 16:33:27 -0400
Message-Id: <1351802007-19178-4-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM 4/9] fix bug in lseek for mini-os
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

lseek always used files[fd].file.offset. It should
use the offset of whatever union member is actually
being used.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
index d212969..d108920 100644
--- a/extras/mini-os/lib/sys.c
+++ b/extras/mini-os/lib/sys.c
@@ -360,45 +360,54 @@ int write(int fd, const void *buf, size_t nbytes)
 
 off_t lseek(int fd, off_t offset, int whence)
 {
+    off_t* target = NULL;
     switch(files[fd].type) {
-#if defined(CONFIG_BLKFRONT) || defined(CONFIG_TPMFRONT) || defined(CONFIG_TPM_TIS)
 #ifdef CONFIG_BLKFRONT
        case FTYPE_BLK:
+          target = &files[fd].blk.offset;
+          break;
 #endif
 #ifdef CONFIG_TPMFRNT
        case FTYPE_TPMFRONT:
+          target = &files[fd].tpmfront.offset;
+          break;
 #endif
 #ifdef CONFIG_TPM_TIS
        case FTYPE_TPM_TIS:
+          target = &files[fd].tpm_tis.offset;
+          break;
 #endif
-	  switch (whence) {
-	     case SEEK_SET:
-		files[fd].file.offset = offset;
-		break;
-	     case SEEK_CUR:
-		files[fd].file.offset += offset;
-		break;
-	     case SEEK_END:
-		{
-		   struct stat st;
-		   int ret;
-		   ret = fstat(fd, &st);
-		   if (ret)
-		      return -1;
-		   files[fd].file.offset = st.st_size + offset;
-		   break;
-		}
-	     default:
-		errno = EINVAL;
-		return -1;
-	  }
-	  return files[fd].file.offset;
-	  break;
-#endif
-       default: /* Not implemented on this FTYPE */
-	  errno = ESPIPE;
-	  return (off_t) -1;
+       case FTYPE_FILE:
+          target = &files[fd].file.offset;
+          break;
+       default:
+          /* Not implemented for this filetype */
+          errno = ESPIPE;
+          return (off_t) -1;
+    }
+
+    switch (whence) {
+       case SEEK_SET:
+          *target = offset;
+          break;
+       case SEEK_CUR:
+          *target += offset;
+          break;
+       case SEEK_END:
+          {
+             struct stat st;
+             int ret;
+             ret = fstat(fd, &st);
+             if (ret)
+                return -1;
+             *target = st.st_size + offset;
+             break;
+          }
+       default:
+          errno = EINVAL;
+          return -1;
     }
+    return *target;
 }
 
 int fsync(int fd) {
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:34:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:34:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1Sp-00050v-Ln; Thu, 01 Nov 2012 20:34:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TU1So-00050f-5v
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:34:06 +0000
Received: from [85.158.143.99:6368] by server-2.bemta-4.messagelabs.com id
	B7/4C-28922-DBCD2905; Thu, 01 Nov 2012 20:34:05 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-4.tower-216.messagelabs.com!1351802043!22999381!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11977 invoked from network); 1 Nov 2012 20:34:04 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-4.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 20:34:04 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148030877;
	Thu, 01 Nov 2012 16:33:38 -0400
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com, xen-devel@lists.xen.org,
	samuel.thibault@ens-lyon.org
Date: Thu,  1 Nov 2012 16:33:27 -0400
Message-Id: <1351802007-19178-4-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM 4/9] fix bug in lseek for mini-os
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

lseek always used files[fd].file.offset. It should
use the offset of whatever union member is actually
being used.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
index d212969..d108920 100644
--- a/extras/mini-os/lib/sys.c
+++ b/extras/mini-os/lib/sys.c
@@ -360,45 +360,54 @@ int write(int fd, const void *buf, size_t nbytes)
 
 off_t lseek(int fd, off_t offset, int whence)
 {
+    off_t* target = NULL;
     switch(files[fd].type) {
-#if defined(CONFIG_BLKFRONT) || defined(CONFIG_TPMFRONT) || defined(CONFIG_TPM_TIS)
 #ifdef CONFIG_BLKFRONT
        case FTYPE_BLK:
+          target = &files[fd].blk.offset;
+          break;
 #endif
 #ifdef CONFIG_TPMFRNT
        case FTYPE_TPMFRONT:
+          target = &files[fd].tpmfront.offset;
+          break;
 #endif
 #ifdef CONFIG_TPM_TIS
        case FTYPE_TPM_TIS:
+          target = &files[fd].tpm_tis.offset;
+          break;
 #endif
-	  switch (whence) {
-	     case SEEK_SET:
-		files[fd].file.offset = offset;
-		break;
-	     case SEEK_CUR:
-		files[fd].file.offset += offset;
-		break;
-	     case SEEK_END:
-		{
-		   struct stat st;
-		   int ret;
-		   ret = fstat(fd, &st);
-		   if (ret)
-		      return -1;
-		   files[fd].file.offset = st.st_size + offset;
-		   break;
-		}
-	     default:
-		errno = EINVAL;
-		return -1;
-	  }
-	  return files[fd].file.offset;
-	  break;
-#endif
-       default: /* Not implemented on this FTYPE */
-	  errno = ESPIPE;
-	  return (off_t) -1;
+       case FTYPE_FILE:
+          target = &files[fd].file.offset;
+          break;
+       default:
+          /* Not implemented for this filetype */
+          errno = ESPIPE;
+          return (off_t) -1;
+    }
+
+    switch (whence) {
+       case SEEK_SET:
+          *target = offset;
+          break;
+       case SEEK_CUR:
+          *target += offset;
+          break;
+       case SEEK_END:
+          {
+             struct stat st;
+             int ret;
+             ret = fstat(fd, &st);
+             if (ret)
+                return -1;
+             *target = st.st_size + offset;
+             break;
+          }
+       default:
+          errno = EINVAL;
+          return -1;
     }
+    return *target;
 }
 
 int fsync(int fd) {
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:35:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:35:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1TX-0005BP-QA; Thu, 01 Nov 2012 20:34:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TU1TV-0005Az-W4
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:34:50 +0000
Received: from [85.158.137.99:23348] by server-8.bemta-3.messagelabs.com id
	C8/84-07786-9ECD2905; Thu, 01 Nov 2012 20:34:49 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1351802086!12234877!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAzMjEzNQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9042 invoked from network); 1 Nov 2012 20:34:48 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-6.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 20:34:48 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA1KYjW1006726
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 1 Nov 2012 20:34:46 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA1KYidM016094
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 1 Nov 2012 20:34:44 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA1KYhG1004358; Thu, 1 Nov 2012 15:34:44 -0500
MIME-Version: 1.0
Message-ID: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
Date: Thu, 1 Nov 2012 13:34:40 -0700 (PDT)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: "Keir (Xen.org)" <keir@xen.org>, Jan Beulich <JBeulich@novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: xen-devel@lists.xen.org
Subject: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi Keir and Jan --

With the plan to obsolete the x86 32-bit hypervisor at 4.3,
when prototyping the "claim" hypercall/subop, can I assume
that the CONFIG_X86 code in the hypervisor and, specifically
any separation of the concepts of xen_heap from dom_heap,
can be ignored?

Or will the ARM version of the hypervisor be requiring
a similar separation of xen_heap vs dom_heap?

If the CONFIG_X86/separation code will no longer be used,
shall I submit a patch to delete the code in page_alloc.c
and memory.c?  Or can you (Keir or Jan) just delete it?

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:35:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:35:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1TX-0005BP-QA; Thu, 01 Nov 2012 20:34:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TU1TV-0005Az-W4
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:34:50 +0000
Received: from [85.158.137.99:23348] by server-8.bemta-3.messagelabs.com id
	C8/84-07786-9ECD2905; Thu, 01 Nov 2012 20:34:49 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1351802086!12234877!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAzMjEzNQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9042 invoked from network); 1 Nov 2012 20:34:48 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-6.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 20:34:48 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA1KYjW1006726
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 1 Nov 2012 20:34:46 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA1KYidM016094
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 1 Nov 2012 20:34:44 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA1KYhG1004358; Thu, 1 Nov 2012 15:34:44 -0500
MIME-Version: 1.0
Message-ID: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
Date: Thu, 1 Nov 2012 13:34:40 -0700 (PDT)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: "Keir (Xen.org)" <keir@xen.org>, Jan Beulich <JBeulich@novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: xen-devel@lists.xen.org
Subject: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi Keir and Jan --

With the plan to obsolete the x86 32-bit hypervisor at 4.3,
when prototyping the "claim" hypercall/subop, can I assume
that the CONFIG_X86 code in the hypervisor and, specifically
any separation of the concepts of xen_heap from dom_heap,
can be ignored?

Or will the ARM version of the hypervisor be requiring
a similar separation of xen_heap vs dom_heap?

If the CONFIG_X86/separation code will no longer be used,
shall I submit a patch to delete the code in page_alloc.c
and memory.c?  Or can you (Keir or Jan) just delete it?

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:35:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:35:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1U1-0005IR-8B; Thu, 01 Nov 2012 20:35:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TU1Ty-0005Hl-NV
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:35:19 +0000
Received: from [85.158.138.51:27704] by server-5.bemta-3.messagelabs.com id
	7B/B4-26311-60DD2905; Thu, 01 Nov 2012 20:35:18 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-8.tower-174.messagelabs.com!1351802113!28289966!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25710 invoked from network); 1 Nov 2012 20:35:15 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-8.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 20:35:15 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148031095;
	Thu, 01 Nov 2012 16:35:09 -0400
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu,  1 Nov 2012 16:34:56 -0400
Message-Id: <1351802096-19224-1-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM 5/9] add vtpm support to libxl
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch adds vtpm support to libxl. It adds vtpm parsing to config
files and 3 new xl commands:
vtpm-attach
vtpm-detach
vtpm-list

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 428da21..fe4fac9 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -298,6 +298,35 @@ Specifies the networking provision (both emulated network adapters,
 and Xen virtual interfaces) to provided to the guest.  See
 F<docs/misc/xl-network-configuration.markdown>.
 
+=item B<vtpm=[ "VTPM_SPEC_STRING", "VTPM_SPEC_STRING", ...]>
+
+Specifies the virtual trusted platform module to be
+provided to the guest. Please see F<docs/misc/vtpm.txt>
+for more details.
+
+Each B<VTPM_SPEC_STRING> is a comma-separated list of C<KEY=VALUE>
+settings, from the following list:
+
+=over 4
+
+=item C<backend=DOMAIN>
+
+Specify the backend domain name of id. This value is required!
+If this domain is a guest, the backend should be set to the
+vtpm domain name. If this domain is a vtpm, the
+backend should be set to the vtpm manager domain name.
+
+=item C<uuid=UUID>
+
+Specify the uuid of this vtpm device. The uuid is used to uniquely
+identify the vtpm device. You can create one using the uuidgen
+program on unix systems. If left unspecified, a new uuid
+will be randomly generated every time the domain boots.
+If this is a vtpm domain, you should specify a value. The
+value is optional if this is a guest domain.
+
+=back
+
 =item B<vfb=[ "VFB_SPEC_STRING", "VFB_SPEC_STRING", ...]>
 
 Specifies the paravirtual framebuffer devices which should be supplied
diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index 7b1f2cf..097fe43 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -1106,6 +1106,31 @@ List virtual network interfaces for a domain.
 
 =back
 
+=head2 VTPM DEVICES
+
+=over 4
+
+=item B<vtpm-attach> I<domain-id> I<vtpm-device>
+
+Creates a new vtpm device in the domain specified by I<domain-id>.
+I<vtpm-device> describes the device to attach, using the same format as the
+B<vtpm> string in the domain config file. See L<xl.cfg> for
+more information.
+
+=item B<vtpm-detach> I<domain-id> I<devid|uuid>
+
+Removes the vtpm device from the domain specified by I<domain-id>.
+I<devid> is the numeric device id given to the virtual trusted
+platform module device. You will need to run B<xl vtpm-list> to determine that number.
+Alternatively the I<uuid> of the vtpm can be used to
+select the virtual device to detach.
+
+=item B<vtpm-list> I<domain-id>
+
+List virtual trusted platform modules for a domain.
+
+=back
+
 =head1 PCI PASS-THROUGH
 
 =over 4
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 665385b..be457f4 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1710,6 +1710,243 @@ out:
 }
 
 /******************************************************************************/
+int libxl__device_vtpm_setdefault(libxl__gc *gc, libxl_device_vtpm *vtpm)
+{
+   if(libxl_uuid_is_nil(&vtpm->uuid)) {
+      libxl_uuid_generate(&vtpm->uuid);
+   }
+   return 0;
+}
+
+static int libxl__device_from_vtpm(libxl__gc *gc, uint32_t domid,
+                                   libxl_device_vtpm *vtpm,
+                                   libxl__device *device)
+{
+   device->backend_devid   = vtpm->devid;
+   device->backend_domid   = vtpm->backend_domid;
+   device->backend_kind    = LIBXL__DEVICE_KIND_VTPM;
+   device->devid           = vtpm->devid;
+   device->domid           = domid;
+   device->kind            = LIBXL__DEVICE_KIND_VTPM;
+
+   return 0;
+}
+
+void libxl__device_vtpm_add(libxl__egc *egc, uint32_t domid,
+                           libxl_device_vtpm *vtpm,
+                           libxl__ao_device *aodev)
+{
+    STATE_AO_GC(aodev->ao);
+    flexarray_t *front;
+    flexarray_t *back;
+    libxl__device *device;
+    char *dompath, **l;
+    unsigned int nb, rc;
+
+    rc = libxl__device_vtpm_setdefault(gc, vtpm);
+    if (rc) goto out;
+
+    front = flexarray_make(gc, 16, 1);
+    back = flexarray_make(gc, 16, 1);
+
+    if(vtpm->devid == -1) {
+        if (!(dompath = libxl__xs_get_dompath(gc, domid))) {
+            rc = ERROR_FAIL;
+            goto out;
+        }
+        l = libxl__xs_directory(gc, XBT_NULL,
+              GCSPRINTF("%s/device/vtpm", dompath), &nb);
+        if(l == NULL || nb == 0) {
+            vtpm->devid = 0;
+        } else {
+            vtpm->devid = strtoul(l[nb - 1], NULL, 10) + 1;
+        }
+    }
+
+    GCNEW(device);
+    rc = libxl__device_from_vtpm(gc, domid, vtpm, device);
+    if ( rc != 0 ) goto out;
+
+    flexarray_append(back, "frontend-id");
+    flexarray_append(back, GCSPRINTF("%d", domid));
+    flexarray_append(back, "online");
+    flexarray_append(back, "1");
+    flexarray_append(back, "state");
+    flexarray_append(back, GCSPRINTF("%d", 1));
+    flexarray_append(back, "handle");
+    flexarray_append(back, GCSPRINTF("%d", vtpm->devid));
+
+    flexarray_append(back, "uuid");
+    flexarray_append(back, GCSPRINTF(LIBXL_UUID_FMT, LIBXL_UUID_BYTES(vtpm->uuid)));
+    flexarray_append(back, "resume");
+    flexarray_append(back, "False");
+
+    flexarray_append(front, "backend-id");
+    flexarray_append(front, GCSPRINTF("%d", vtpm->backend_domid));
+    flexarray_append(front, "state");
+    flexarray_append(front, GCSPRINTF("%d", 1));
+    flexarray_append(front, "handle");
+    flexarray_append(front, GCSPRINTF("%d", vtpm->devid));
+
+    libxl__device_generic_add(gc, XBT_NULL, device,
+                             libxl__xs_kvs_of_flexarray(gc, back, back->count),
+                             libxl__xs_kvs_of_flexarray(gc, front, front->count));
+
+    aodev->dev = device;
+    aodev->action = DEVICE_CONNECT;
+    libxl__wait_device_connection(egc, aodev);
+
+    rc = 0;
+out:
+    aodev->rc = rc;
+    if(rc) aodev->callback(egc, aodev);
+    return;
+}
+
+libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx, uint32_t domid, int *num)
+{
+    GC_INIT(ctx);
+
+    libxl_device_vtpm* vtpms = NULL;
+    char* fe_path = NULL;
+    char** dir = NULL;
+    unsigned int ndirs = 0;
+
+    *num = 0;
+
+    fe_path = libxl__sprintf(gc, "%s/device/vtpm", libxl__xs_get_dompath(gc, domid));
+    dir = libxl__xs_directory(gc, XBT_NULL, fe_path, &ndirs);
+    if(dir) {
+       vtpms = malloc(sizeof(*vtpms) * ndirs);
+       libxl_device_vtpm* vtpm;
+       libxl_device_vtpm* end = vtpms + ndirs;
+       for(vtpm = vtpms; vtpm < end; ++vtpm, ++dir) {
+          char* tmp;
+          const char* be_path = libxl__xs_read(gc, XBT_NULL,
+                GCSPRINTF("%s/%s/backend",
+                   fe_path, *dir));
+
+          vtpm->devid = atoi(*dir);
+
+          tmp = libxl__xs_read(gc, XBT_NULL,
+                GCSPRINTF("%s/%s/backend_id",
+                   fe_path, *dir));
+          vtpm->backend_domid = atoi(tmp);
+
+          tmp = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/uuid", be_path));
+          if(tmp) {
+             if(libxl_uuid_from_string(&(vtpm->uuid), tmp)) {
+                LOG(ERROR, "%s/uuid is a malformed uuid?? (%s) Probably a bug!!\n", be_path, tmp);
+                exit(1);
+             }
+          }
+       }
+    }
+    *num = ndirs;
+
+    GC_FREE;
+    return vtpms;
+}
+
+int libxl_device_vtpm_getinfo(libxl_ctx *ctx,
+                              uint32_t domid,
+                              libxl_device_vtpm *vtpm,
+                              libxl_vtpminfo *vtpminfo)
+{
+    GC_INIT(ctx);
+    char *dompath, *vtpmpath;
+    char *val;
+    int rc = 0;
+
+    libxl_vtpminfo_init(vtpminfo);
+    dompath = libxl__xs_get_dompath(gc, domid);
+    vtpminfo->devid = vtpm->devid;
+
+    vtpmpath = GCSPRINTF("%s/device/vtpm/%d", dompath, vtpminfo->devid);
+    vtpminfo->backend = xs_read(ctx->xsh, XBT_NULL,
+          GCSPRINTF("%s/backend", vtpmpath), NULL);
+    if (!vtpminfo->backend) {
+        goto err;
+    }
+    if(!libxl__xs_read(gc, XBT_NULL, vtpminfo->backend)) {
+       goto err;
+    }
+
+    val = libxl__xs_read(gc, XBT_NULL,
+          GCSPRINTF("%s/backend-id", vtpmpath));
+    vtpminfo->backend_id = val ? strtoul(val, NULL, 10) : -1;
+
+    val = libxl__xs_read(gc, XBT_NULL,
+          GCSPRINTF("%s/state", vtpmpath));
+    vtpminfo->state = val ? strtoul(val, NULL, 10) : -1;
+
+    val = libxl__xs_read(gc, XBT_NULL,
+          GCSPRINTF("%s/event-channel", vtpmpath));
+    vtpminfo->evtch = val ? strtoul(val, NULL, 10) : -1;
+
+    val = libxl__xs_read(gc, XBT_NULL,
+          GCSPRINTF("%s/ring-ref", vtpmpath));
+    vtpminfo->rref = val ? strtoul(val, NULL, 10) : -1;
+
+    vtpminfo->frontend = xs_read(ctx->xsh, XBT_NULL,
+          GCSPRINTF("%s/frontend", vtpminfo->backend), NULL);
+
+    val = libxl__xs_read(gc, XBT_NULL,
+          GCSPRINTF("%s/frontend-id", vtpminfo->backend));
+    vtpminfo->frontend_id = val ? strtoul(val, NULL, 10) : -1;
+
+    val = libxl__xs_read(gc, XBT_NULL,
+          GCSPRINTF("%s/uuid", vtpminfo->backend));
+    if(val == NULL) {
+       LOG(ERROR, "%s/uuid does not exist!\n", vtpminfo->backend);
+       goto err;
+    }
+    if(libxl_uuid_from_string(&(vtpminfo->uuid), val)) {
+       LOG(ERROR,
+             "%s/uuid is a malformed uuid?? (%s) Probably a bug!\n",
+             vtpminfo->backend, val);
+       goto err;
+    }
+
+    goto exit;
+err:
+    rc = ERROR_FAIL;
+exit:
+    GC_FREE;
+    return rc;
+}
+
+int libxl_devid_to_device_vtpm(libxl_ctx *ctx,
+                               uint32_t domid,
+                               int devid,
+                               libxl_device_vtpm *vtpm)
+{
+    libxl_device_vtpm *vtpms;
+    int nb, i;
+    int rc;
+
+    vtpms = libxl_device_vtpm_list(ctx, domid, &nb);
+    if (!vtpms)
+        return ERROR_FAIL;
+
+    memset(vtpm, 0, sizeof (libxl_device_vtpm));
+    rc = 1;
+    for (i = 0; i < nb; ++i) {
+        if(devid == vtpms[i].devid) {
+            vtpm->backend_domid = vtpms[i].backend_domid;
+            vtpm->devid = vtpms[i].devid;
+            libxl_uuid_copy(&vtpm->uuid, &vtpms[i].uuid);
+            rc = 0;
+            break;
+        }
+    }
+
+    libxl_device_vtpm_list_free(vtpms, nb);
+    return rc;
+}
+
+
+/******************************************************************************/
 
 int libxl__device_disk_setdefault(libxl__gc *gc, libxl_device_disk *disk)
 {
@@ -3046,6 +3283,8 @@ out:
  * libxl_device_disk_destroy
  * libxl_device_nic_remove
  * libxl_device_nic_destroy
+ * libxl_device_vtpm_remove
+ * libxl_device_vtpm_destroy
  * libxl_device_vkb_remove
  * libxl_device_vkb_destroy
  * libxl_device_vfb_remove
@@ -3097,6 +3336,10 @@ DEFINE_DEVICE_REMOVE(vkb, destroy, 1)
 DEFINE_DEVICE_REMOVE(vfb, remove, 0)
 DEFINE_DEVICE_REMOVE(vfb, destroy, 1)
 
+/* vtpm */
+DEFINE_DEVICE_REMOVE(vtpm, remove, 0)
+DEFINE_DEVICE_REMOVE(vtpm, destroy, 1)
+
 #undef DEFINE_DEVICE_REMOVE
 
 /******************************************************************************/
@@ -3105,6 +3348,7 @@ DEFINE_DEVICE_REMOVE(vfb, destroy, 1)
 /* The following functions are defined:
  * libxl_device_disk_add
  * libxl_device_nic_add
+ * libxl_device_vtpm_add
  */
 
 #define DEFINE_DEVICE_ADD(type)                                         \
@@ -3131,6 +3375,9 @@ DEFINE_DEVICE_ADD(disk)
 /* nic */
 DEFINE_DEVICE_ADD(nic)
 
+/* vtpm */
+DEFINE_DEVICE_ADD(vtpm)
+
 #undef DEFINE_DEVICE_ADD
 
 /******************************************************************************/
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 7a7c419..e2ba549 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -478,13 +478,14 @@ typedef struct {
     libxl_domain_create_info c_info;
     libxl_domain_build_info b_info;
 
-    int num_disks, num_nics, num_pcidevs, num_vfbs, num_vkbs;
+    int num_disks, num_nics, num_pcidevs, num_vfbs, num_vkbs, num_vtpms;
 
     libxl_device_disk *disks;
     libxl_device_nic *nics;
     libxl_device_pci *pcidevs;
     libxl_device_vfb *vfbs;
     libxl_device_vkb *vkbs;
+    libxl_device_vtpm *vtpms;
 
     libxl_action_on_shutdown on_poweroff;
     libxl_action_on_shutdown on_reboot;
@@ -645,6 +646,9 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
                                 int *nb_vcpu, int *nr_vcpus_out);
 void libxl_vcpuinfo_list_free(libxl_vcpuinfo *, int nr_vcpus);
 
+void libxl_device_vtpm_list_free(libxl_device_vtpm*, int nr_vtpms);
+void libxl_vtpminfo_list_free(libxl_vtpminfo *, int nr_vtpms);
+
 /*
  * Devices
  * =======
@@ -745,6 +749,23 @@ libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx, uint32_t domid, int *num
 int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
                               libxl_device_nic *nic, libxl_nicinfo *nicinfo);
 
+/* Virtual TPMs */
+int libxl_device_vtpm_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vtpm *vtpm,
+                          const libxl_asyncop_how *ao_how)
+                          LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vtpm_remove(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_vtpm *vtpm,
+                            const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vtpm_destroy(libxl_ctx *ctx, uint32_t domid,
+                              libxl_device_vtpm *vtpm,
+                              const libxl_asyncop_how *ao_how)
+                              LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx, uint32_t domid, int *num);
+int libxl_device_vtpm_getinfo(libxl_ctx *ctx, uint32_t domid,
+                               libxl_device_vtpm *vtpm, libxl_vtpminfo *vtpminfo);
+
 /* Keyboard */
 int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb,
                          const libxl_asyncop_how *ao_how)
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index e81747b..9d20086 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -55,6 +55,8 @@ void libxl_domain_config_dispose(libxl_domain_config *d_config)
         libxl_device_vkb_dispose(&d_config->vkbs[i]);
     free(d_config->vkbs);
 
+    libxl_device_vtpm_list_free(d_config->vtpms, d_config->num_vtpms);
+
     libxl_domain_create_info_dispose(&d_config->c_info);
     libxl_domain_build_info_dispose(&d_config->b_info);
 }
@@ -601,6 +603,8 @@ static void domcreate_bootloader_done(libxl__egc *egc,
 static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *aodevs,
                                 int ret);
 
+static void domcreate_attach_vtpms(libxl__egc *egc, libxl__multidev *multidev,
+                                   int ret);
 static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *aodevs,
                                  int ret);
 
@@ -1085,13 +1089,13 @@ static void domcreate_devmodel_started(libxl__egc *egc,
     if (d_config->num_nics > 0) {
         /* Attach nics */
         libxl__multidev_begin(ao, &dcs->multidev);
-        dcs->multidev.callback = domcreate_attach_pci;
+        dcs->multidev.callback = domcreate_attach_vtpms;
         libxl__add_nics(egc, ao, domid, d_config, &dcs->multidev);
         libxl__multidev_prepared(egc, &dcs->multidev, 0);
         return;
     }
 
-    domcreate_attach_pci(egc, &dcs->multidev, 0);
+    domcreate_attach_vtpms(egc, &dcs->multidev, 0);
     return;
 
 error_out:
@@ -1099,6 +1103,39 @@ error_out:
     domcreate_complete(egc, dcs, ret);
 }
 
+static void domcreate_attach_vtpms(libxl__egc *egc,
+                                   libxl__multidev *multidev,
+                                   int ret)
+{
+   libxl__domain_create_state *dcs = CONTAINER_OF(multidev, *dcs, multidev);
+   STATE_AO_GC(dcs->ao);
+   int domid = dcs->guest_domid;
+
+   libxl_domain_config* const d_config = dcs->guest_config;
+
+   if(ret) {
+       LOG(ERROR, "unable to add nic devices");
+       goto error_out;
+   }
+
+    /* Plug vtpm devices */
+   if (d_config->num_vtpms > 0) {
+       /* Attach vtpms */
+       libxl__multidev_begin(ao, &dcs->multidev);
+       dcs->multidev.callback = domcreate_attach_pci;
+       libxl__add_vtpms(egc, ao, domid, d_config, &dcs->multidev);
+       libxl__multidev_prepared(egc, &dcs->multidev, 0);
+       return;
+   }
+
+   domcreate_attach_pci(egc, multidev, 0);
+   return;
+
+error_out:
+   assert(ret);
+   domcreate_complete(egc, dcs, ret);
+}
+
 static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
                                  int ret)
 {
@@ -1112,7 +1149,7 @@ static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
     libxl_domain_config *const d_config = dcs->guest_config;
 
     if (ret) {
-        LOG(ERROR, "unable to add nic devices");
+        LOG(ERROR, "unable to add vtpm devices");
         goto error_out;
     }
 
diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index c3283f1..51dd06e 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -497,6 +497,7 @@ void libxl__multidev_prepared(libxl__egc *egc,
  * The following functions are defined:
  * libxl__add_disks
  * libxl__add_nics
+ * libxl__add_vtpms
  */
 
 #define DEFINE_DEVICES_ADD(type)                                        \
@@ -515,6 +516,7 @@ void libxl__multidev_prepared(libxl__egc *egc,
 
 DEFINE_DEVICES_ADD(disk)
 DEFINE_DEVICES_ADD(nic)
+DEFINE_DEVICES_ADD(vtpm)
 
 #undef DEFINE_DEVICES_ADD
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 8f220cb..cba3616 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -958,6 +958,7 @@ _hidden int libxl__device_disk_setdefault(libxl__gc *gc,
                                           libxl_device_disk *disk);
 _hidden int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic,
                                          uint32_t domid);
+_hidden int libxl__device_vtpm_setdefault(libxl__gc *gc, libxl_device_vtpm *vtpm);
 _hidden int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb);
 _hidden int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb);
 _hidden int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci);
@@ -2007,6 +2008,10 @@ _hidden void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
                                    libxl_device_nic *nic,
                                    libxl__ao_device *aodev);
 
+_hidden void libxl__device_vtpm_add(libxl__egc *egc, uint32_t domid,
+                                   libxl_device_vtpm *vtpm,
+                                   libxl__ao_device *aodev);
+
 /* Internal function to connect a vkb device */
 _hidden int libxl__device_vkb_add(libxl__gc *gc, uint32_t domid,
                                   libxl_device_vkb *vkb);
@@ -2439,6 +2444,10 @@ _hidden void libxl__add_nics(libxl__egc *egc, libxl__ao *ao, uint32_t domid,
                              libxl_domain_config *d_config,
                              libxl__multidev *multidev);
 
+_hidden void libxl__add_vtpms(libxl__egc *egc, libxl__ao *ao, uint32_t domid,
+                             libxl_domain_config *d_config,
+                             libxl__multidev *multidev);
+
 /*----- device model creation -----*/
 
 /* First layer; wraps libxl__spawn_spawn. */
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index de111a6..7eac4a8 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -395,6 +395,12 @@ libxl_device_pci = Struct("device_pci", [
     ("permissive", bool),
     ])
 
+libxl_device_vtpm = Struct("device_vtpm", [
+    ("backend_domid",    libxl_domid),
+    ("devid",            libxl_devid),
+    ("uuid",             libxl_uuid),
+])
+
 libxl_diskinfo = Struct("diskinfo", [
     ("backend", string),
     ("backend_id", uint32),
@@ -418,6 +424,18 @@ libxl_nicinfo = Struct("nicinfo", [
     ("rref_rx", integer),
     ], dir=DIR_OUT)
 
+libxl_vtpminfo = Struct("vtpminfo", [
+    ("backend", string),
+    ("backend_id", uint32),
+    ("frontend", string),
+    ("frontend_id", uint32),
+    ("devid", libxl_devid),
+    ("state", integer),
+    ("evtch", integer),
+    ("rref", integer),
+    ("uuid", libxl_uuid),
+    ], dir=DIR_OUT)
+
 libxl_vcpuinfo = Struct("vcpuinfo", [
     ("vcpuid", uint32),
     ("cpu", uint32),
diff --git a/tools/libxl/libxl_types_internal.idl b/tools/libxl/libxl_types_internal.idl
index 5ac8c9c..c40120e 100644
--- a/tools/libxl/libxl_types_internal.idl
+++ b/tools/libxl/libxl_types_internal.idl
@@ -19,6 +19,7 @@ libxl__device_kind = Enumeration("device_kind", [
     (5, "VFB"),
     (6, "VKBD"),
     (7, "CONSOLE"),
+    (8, "VTPM"),
     ])
 
 libxl__console_backend = Enumeration("console_backend", [
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 55cd299..8f78790 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -463,6 +463,33 @@ int libxl_pipe(libxl_ctx *ctx, int pipes[2])
     return 0;
 }
 
+int libxl_uuid_to_device_vtpm(libxl_ctx *ctx, uint32_t domid,
+                            libxl_uuid* uuid, libxl_device_vtpm *vtpm)
+{
+    libxl_device_vtpm *vtpms;
+    int nb, i;
+    int rc;
+
+    vtpms = libxl_device_vtpm_list(ctx, domid, &nb);
+    if (!vtpms)
+        return ERROR_FAIL;
+
+    memset(vtpm, 0, sizeof (libxl_device_vtpm));
+    rc = 1;
+    for (i = 0; i < nb; ++i) {
+        if(!libxl_uuid_compare(uuid, &vtpms[i].uuid)) {
+            vtpm->backend_domid = vtpms[i].backend_domid;
+            vtpm->devid = vtpms[i].devid;
+            libxl_uuid_copy(&vtpm->uuid, &vtpms[i].uuid);
+            rc = 0;
+            break;
+        }
+    }
+
+    libxl_device_vtpm_list_free(vtpms, nb);
+    return rc;
+}
+
 int libxl_mac_to_device_nic(libxl_ctx *ctx, uint32_t domid,
                             const char *mac, libxl_device_nic *nic)
 {
@@ -819,6 +846,22 @@ void libxl_cpupoolinfo_list_free(libxl_cpupoolinfo *list, int nr)
     free(list);
 }
 
+void libxl_vtpminfo_list_free(libxl_vtpminfo* list, int nr)
+{
+   int i;
+   for (i = 0; i < nr; i++)
+      libxl_vtpminfo_dispose(&list[i]);
+   free(list);
+}
+
+void libxl_device_vtpm_list_free(libxl_device_vtpm* list, int nr)
+{
+   int i;
+   for (i = 0; i < nr; i++)
+      libxl_device_vtpm_dispose(&list[i]);
+   free(list);
+}
+
 int libxl_domid_valid_guest(uint32_t domid)
 {
     /* returns 1 if the value _could_ be a valid guest domid, 0 otherwise
diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
index 83aaac7..40f3f30 100644
--- a/tools/libxl/libxl_utils.h
+++ b/tools/libxl/libxl_utils.h
@@ -64,6 +64,11 @@ int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid, int devid,
 int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid, const char *vdev,
                                libxl_device_disk *disk);
 
+int libxl_uuid_to_device_vtpm(libxl_ctx *ctx, uint32_t domid,
+                               libxl_uuid *uuid, libxl_device_vtpm *vtpm);
+int libxl_devid_to_device_vtpm(libxl_ctx *ctx, uint32_t domid,
+                               int devid, libxl_device_vtpm *vtpm);
+
 int libxl_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *bitmap, int n_bits);
     /* Allocated bimap is from malloc, libxl_bitmap_dispose() to be
      * called by the application when done. */
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index 0b2f848..be6f38b 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -79,6 +79,9 @@ int main_networkdetach(int argc, char **argv);
 int main_blockattach(int argc, char **argv);
 int main_blocklist(int argc, char **argv);
 int main_blockdetach(int argc, char **argv);
+int main_vtpmattach(int argc, char **argv);
+int main_vtpmlist(int argc, char **argv);
+int main_vtpmdetach(int argc, char **argv);
 int main_uptime(int argc, char **argv);
 int main_tmem_list(int argc, char **argv);
 int main_tmem_freeze(int argc, char **argv);
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index a43b371..65f83bd 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -573,7 +573,7 @@ static void parse_config_data(const char *config_source,
     const char *buf;
     long l;
     XLU_Config *config;
-    XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids;
+    XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids, *vtpms;
     XLU_ConfigList *ioports, *irqs, *iomem;
     int num_ioports, num_irqs, num_iomem;
     int pci_power_mgmt = 0;
@@ -1048,6 +1048,58 @@ static void parse_config_data(const char *config_source,
         }
     }
 
+    if (!xlu_cfg_get_list(config, "vtpm", &vtpms, 0, 0)) {
+        d_config->num_vtpms = 0;
+        d_config->vtpms = NULL;
+        while ((buf = xlu_cfg_get_listitem (vtpms, d_config->num_vtpms)) != NULL) {
+            libxl_device_vtpm *vtpm;
+            char * buf2 = strdup(buf);
+            char *p, *p2;
+            bool got_backend = false;
+
+            d_config->vtpms = (libxl_device_vtpm *) realloc(d_config->vtpms,
+                  sizeof(libxl_device_vtpm) * (d_config->num_vtpms+1));
+            vtpm = d_config->vtpms + d_config->num_vtpms;
+            libxl_device_vtpm_init(vtpm);
+            vtpm->devid = d_config->num_vtpms;
+
+            p = strtok(buf2, ",");
+            if(p) {
+               do {
+                  while(*p == ' ')
+                     ++p;
+                  if ((p2 = strchr(p, '=')) == NULL)
+                     break;
+                  *p2 = '\0';
+                  if (!strcmp(p, "backend")) {
+                     if(domain_qualifier_to_domid(p2 + 1, &(vtpm->backend_domid), 0))
+                     {
+                        fprintf(stderr,
+                              "Specified vtpm backend domain `%s' does not exist!\n", p2 + 1);
+                        exit(1);
+                     }
+                     got_backend = true;
+                  } else if(!strcmp(p, "uuid")) {
+                     if( libxl_uuid_from_string(&vtpm->uuid, p2 + 1) ) {
+                        fprintf(stderr,
+                              "Failed to parse vtpm UUID: %s\n", p2 + 1);
+                        exit(1);
+                    }
+                  } else {
+                     fprintf(stderr, "Unknown string `%s' in vtpm spec\n", p);
+                     exit(1);
+                  }
+               } while ((p = strtok(NULL, ",")) != NULL);
+            }
+            if(!got_backend) {
+               fprintf(stderr, "vtpm spec missing required backend field!\n");
+               exit(1);
+            }
+            free(buf2);
+            d_config->num_vtpms++;
+        }
+    }
+
     if (!xlu_cfg_get_list (config, "vif", &nics, 0, 0)) {
         d_config->num_nics = 0;
         d_config->nics = NULL;
@@ -1073,7 +1125,7 @@ static void parse_config_data(const char *config_source,
 
             p = strtok(buf2, ",");
             if (!p)
-                goto skip;
+                goto skip_nic;
             do {
                 while (*p == ' ')
                     p++;
@@ -1137,7 +1189,7 @@ static void parse_config_data(const char *config_source,
                     fprintf(stderr, "the accel parameter for vifs is currently not supported\n");
                 }
             } while ((p = strtok(NULL, ",")) != NULL);
-skip:
+skip_nic:
             free(buf2);
             d_config->num_nics++;
         }
@@ -5634,6 +5686,132 @@ int main_blockdetach(int argc, char **argv)
     return rc;
 }
 
+int main_vtpmattach(int argc, char **argv)
+{
+    int opt;
+    libxl_device_vtpm vtpm;
+    char *oparg;
+    unsigned int val;
+    uint32_t domid;
+
+    if ((opt = def_getopt(argc, argv, "", "vtpm-attach", 1)) != -1)
+        return opt;
+
+    if (domain_qualifier_to_domid(argv[optind], &domid, 0) < 0) {
+        fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
+        return 1;
+    }
+    ++optind;
+
+    libxl_device_vtpm_init(&vtpm);
+    for (argv += optind, argc -= optind; argc > 0; ++argv, --argc) {
+        if (MATCH_OPTION("uuid", *argv, oparg)) {
+            if(libxl_uuid_from_string(&(vtpm.uuid), oparg)) {
+                fprintf(stderr, "Invalid uuid specified (%s)\n", oparg);
+                return 1;
+            }
+        } else if (MATCH_OPTION("backend", *argv, oparg)) {
+            if(domain_qualifier_to_domid(oparg, &val, 0)) {
+                fprintf(stderr,
+                      "Specified backend domain does not exist, defaulting to Dom0\n");
+                val = 0;
+            }
+            vtpm.backend_domid = val;
+        } else {
+            fprintf(stderr, "unrecognized argument `%s'\n", *argv);
+            return 1;
+        }
+    }
+
+    if(dryrun_only) {
+       char* json = libxl_device_vtpm_to_json(ctx, &vtpm);
+       printf("vtpm: %s\n", json);
+       free(json);
+       libxl_device_vtpm_dispose(&vtpm);
+       if (ferror(stdout) || fflush(stdout)) { perror("stdout"); exit(-1); }
+       return 0;
+    }
+
+    if (libxl_device_vtpm_add(ctx, domid, &vtpm, 0)) {
+        fprintf(stderr, "libxl_device_vtpm_add failed.\n");
+        return 1;
+    }
+    libxl_device_vtpm_dispose(&vtpm);
+    return 0;
+}
+
+int main_vtpmlist(int argc, char **argv)
+{
+    int opt;
+    libxl_device_vtpm *vtpms;
+    libxl_vtpminfo vtpminfo;
+    int nb, i;
+
+    if ((opt = def_getopt(argc, argv, "", "vtpm-list", 1)) != -1)
+        return opt;
+
+    /*      Idx  BE   UUID   Hdl  Sta  evch rref  BE-path */
+    printf("%-3s %-2s %-36s %-6s %-5s %-6s %-5s %-10s\n",
+           "Idx", "BE", "Uuid", "handle", "state", "evt-ch", "ring-ref", "BE-path");
+    for (argv += optind, argc -= optind; argc > 0; --argc, ++argv) {
+        uint32_t domid;
+        if (domain_qualifier_to_domid(*argv, &domid, 0) < 0) {
+            fprintf(stderr, "%s is an invalid domain identifier\n", *argv);
+            continue;
+        }
+        if (!(vtpms = libxl_device_vtpm_list(ctx, domid, &nb))) {
+            continue;
+        }
+        for (i = 0; i < nb; ++i) {
+           if(!libxl_device_vtpm_getinfo(ctx, domid, &vtpms[i], &vtpminfo)) {
+              /*      Idx  BE     UUID             Hdl Sta evch rref BE-path*/
+              printf("%-3d %-2d " LIBXL_UUID_FMT " %6d %5d %6d %8d %-30s\n",
+                    vtpminfo.devid, vtpminfo.backend_id,
+                    LIBXL_UUID_BYTES(vtpminfo.uuid),
+                    vtpminfo.devid, vtpminfo.state, vtpminfo.evtch,
+                    vtpminfo.rref, vtpminfo.backend);
+
+              libxl_vtpminfo_dispose(&vtpminfo);
+           }
+           libxl_device_vtpm_dispose(&vtpms[i]);
+        }
+        free(vtpms);
+    }
+    return 0;
+}
+
+int main_vtpmdetach(int argc, char **argv)
+{
+    uint32_t domid;
+    int opt, rc=0;
+    libxl_device_vtpm vtpm;
+    libxl_uuid uuid;
+
+    if ((opt = def_getopt(argc, argv, "", "vtpm-detach", 2)) != -1)
+        return opt;
+
+    domid = find_domain(argv[optind]);
+
+    if ( libxl_uuid_from_string(&uuid, argv[optind+1])) {
+        if (libxl_devid_to_device_vtpm(ctx, domid, atoi(argv[optind+1]), &vtpm)) {
+            fprintf(stderr, "Unknown device %s.\n", argv[optind+1]);
+            return 1;
+        }
+    } else {
+        if (libxl_uuid_to_device_vtpm(ctx, domid, &uuid, &vtpm)) {
+            fprintf(stderr, "Unknown device %s.\n", argv[optind+1]);
+            return 1;
+        }
+    }
+    rc = libxl_device_vtpm_remove(ctx, domid, &vtpm, 0);
+    if (rc) {
+        fprintf(stderr, "libxl_device_vtpm_remove failed.\n");
+    }
+    libxl_device_vtpm_dispose(&vtpm);
+    return rc;
+}
+
+
 static char *uptime_to_string(unsigned long uptime, int short_mode)
 {
     int sec, min, hour, day;
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index d3a215d..ac58642 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -341,6 +341,21 @@ struct cmd_spec cmd_table[] = {
       "Destroy a domain's virtual block device",
       "<Domain> <DevId>",
     },
+    { "vtpm-attach",
+      &main_vtpmattach, 1, 1,
+      "Create a new virtual TPM device",
+      "<Domain> [uuid=<uuid>] [backend=<BackDomain>]",
+    },
+    { "vtpm-list",
+      &main_vtpmlist, 0, 0,
+      "List virtual TPM devices for a domain",
+      "<Domain(s)>",
+    },
+    { "vtpm-detach",
+      &main_vtpmdetach, 0, 1,
+      "Destroy a domain's virtual TPM device",
+      "<Domain> <DevId|uuid>",
+    },
     { "uptime",
       &main_uptime, 0, 0,
       "Print uptime for all/some domains",
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:35:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:35:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1U1-0005IR-8B; Thu, 01 Nov 2012 20:35:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TU1Ty-0005Hl-NV
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:35:19 +0000
Received: from [85.158.138.51:27704] by server-5.bemta-3.messagelabs.com id
	7B/B4-26311-60DD2905; Thu, 01 Nov 2012 20:35:18 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-8.tower-174.messagelabs.com!1351802113!28289966!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25710 invoked from network); 1 Nov 2012 20:35:15 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-8.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 20:35:15 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148031095;
	Thu, 01 Nov 2012 16:35:09 -0400
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu,  1 Nov 2012 16:34:56 -0400
Message-Id: <1351802096-19224-1-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM 5/9] add vtpm support to libxl
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch adds vtpm support to libxl. It adds vtpm parsing to config
files and 3 new xl commands:
vtpm-attach
vtpm-detach
vtpm-list

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 428da21..fe4fac9 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -298,6 +298,35 @@ Specifies the networking provision (both emulated network adapters,
 and Xen virtual interfaces) to provided to the guest.  See
 F<docs/misc/xl-network-configuration.markdown>.
 
+=item B<vtpm=[ "VTPM_SPEC_STRING", "VTPM_SPEC_STRING", ...]>
+
+Specifies the virtual trusted platform module to be
+provided to the guest. Please see F<docs/misc/vtpm.txt>
+for more details.
+
+Each B<VTPM_SPEC_STRING> is a comma-separated list of C<KEY=VALUE>
+settings, from the following list:
+
+=over 4
+
+=item C<backend=DOMAIN>
+
+Specify the backend domain name of id. This value is required!
+If this domain is a guest, the backend should be set to the
+vtpm domain name. If this domain is a vtpm, the
+backend should be set to the vtpm manager domain name.
+
+=item C<uuid=UUID>
+
+Specify the uuid of this vtpm device. The uuid is used to uniquely
+identify the vtpm device. You can create one using the uuidgen
+program on unix systems. If left unspecified, a new uuid
+will be randomly generated every time the domain boots.
+If this is a vtpm domain, you should specify a value. The
+value is optional if this is a guest domain.
+
+=back
+
 =item B<vfb=[ "VFB_SPEC_STRING", "VFB_SPEC_STRING", ...]>
 
 Specifies the paravirtual framebuffer devices which should be supplied
diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index 7b1f2cf..097fe43 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -1106,6 +1106,31 @@ List virtual network interfaces for a domain.
 
 =back
 
+=head2 VTPM DEVICES
+
+=over 4
+
+=item B<vtpm-attach> I<domain-id> I<vtpm-device>
+
+Creates a new vtpm device in the domain specified by I<domain-id>.
+I<vtpm-device> describes the device to attach, using the same format as the
+B<vtpm> string in the domain config file. See L<xl.cfg> for
+more information.
+
+=item B<vtpm-detach> I<domain-id> I<devid|uuid>
+
+Removes the vtpm device from the domain specified by I<domain-id>.
+I<devid> is the numeric device id given to the virtual trusted
+platform module device. You will need to run B<xl vtpm-list> to determine that number.
+Alternatively the I<uuid> of the vtpm can be used to
+select the virtual device to detach.
+
+=item B<vtpm-list> I<domain-id>
+
+List virtual trusted platform modules for a domain.
+
+=back
+
 =head1 PCI PASS-THROUGH
 
 =over 4
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 665385b..be457f4 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1710,6 +1710,243 @@ out:
 }
 
 /******************************************************************************/
+int libxl__device_vtpm_setdefault(libxl__gc *gc, libxl_device_vtpm *vtpm)
+{
+   if(libxl_uuid_is_nil(&vtpm->uuid)) {
+      libxl_uuid_generate(&vtpm->uuid);
+   }
+   return 0;
+}
+
+static int libxl__device_from_vtpm(libxl__gc *gc, uint32_t domid,
+                                   libxl_device_vtpm *vtpm,
+                                   libxl__device *device)
+{
+   device->backend_devid   = vtpm->devid;
+   device->backend_domid   = vtpm->backend_domid;
+   device->backend_kind    = LIBXL__DEVICE_KIND_VTPM;
+   device->devid           = vtpm->devid;
+   device->domid           = domid;
+   device->kind            = LIBXL__DEVICE_KIND_VTPM;
+
+   return 0;
+}
+
+void libxl__device_vtpm_add(libxl__egc *egc, uint32_t domid,
+                           libxl_device_vtpm *vtpm,
+                           libxl__ao_device *aodev)
+{
+    STATE_AO_GC(aodev->ao);
+    flexarray_t *front;
+    flexarray_t *back;
+    libxl__device *device;
+    char *dompath, **l;
+    unsigned int nb, rc;
+
+    rc = libxl__device_vtpm_setdefault(gc, vtpm);
+    if (rc) goto out;
+
+    front = flexarray_make(gc, 16, 1);
+    back = flexarray_make(gc, 16, 1);
+
+    if(vtpm->devid == -1) {
+        if (!(dompath = libxl__xs_get_dompath(gc, domid))) {
+            rc = ERROR_FAIL;
+            goto out;
+        }
+        l = libxl__xs_directory(gc, XBT_NULL,
+              GCSPRINTF("%s/device/vtpm", dompath), &nb);
+        if(l == NULL || nb == 0) {
+            vtpm->devid = 0;
+        } else {
+            vtpm->devid = strtoul(l[nb - 1], NULL, 10) + 1;
+        }
+    }
+
+    GCNEW(device);
+    rc = libxl__device_from_vtpm(gc, domid, vtpm, device);
+    if ( rc != 0 ) goto out;
+
+    flexarray_append(back, "frontend-id");
+    flexarray_append(back, GCSPRINTF("%d", domid));
+    flexarray_append(back, "online");
+    flexarray_append(back, "1");
+    flexarray_append(back, "state");
+    flexarray_append(back, GCSPRINTF("%d", 1));
+    flexarray_append(back, "handle");
+    flexarray_append(back, GCSPRINTF("%d", vtpm->devid));
+
+    flexarray_append(back, "uuid");
+    flexarray_append(back, GCSPRINTF(LIBXL_UUID_FMT, LIBXL_UUID_BYTES(vtpm->uuid)));
+    flexarray_append(back, "resume");
+    flexarray_append(back, "False");
+
+    flexarray_append(front, "backend-id");
+    flexarray_append(front, GCSPRINTF("%d", vtpm->backend_domid));
+    flexarray_append(front, "state");
+    flexarray_append(front, GCSPRINTF("%d", 1));
+    flexarray_append(front, "handle");
+    flexarray_append(front, GCSPRINTF("%d", vtpm->devid));
+
+    libxl__device_generic_add(gc, XBT_NULL, device,
+                             libxl__xs_kvs_of_flexarray(gc, back, back->count),
+                             libxl__xs_kvs_of_flexarray(gc, front, front->count));
+
+    aodev->dev = device;
+    aodev->action = DEVICE_CONNECT;
+    libxl__wait_device_connection(egc, aodev);
+
+    rc = 0;
+out:
+    aodev->rc = rc;
+    if(rc) aodev->callback(egc, aodev);
+    return;
+}
+
+libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx, uint32_t domid, int *num)
+{
+    GC_INIT(ctx);
+
+    libxl_device_vtpm* vtpms = NULL;
+    char* fe_path = NULL;
+    char** dir = NULL;
+    unsigned int ndirs = 0;
+
+    *num = 0;
+
+    fe_path = libxl__sprintf(gc, "%s/device/vtpm", libxl__xs_get_dompath(gc, domid));
+    dir = libxl__xs_directory(gc, XBT_NULL, fe_path, &ndirs);
+    if(dir) {
+       vtpms = malloc(sizeof(*vtpms) * ndirs);
+       libxl_device_vtpm* vtpm;
+       libxl_device_vtpm* end = vtpms + ndirs;
+       for(vtpm = vtpms; vtpm < end; ++vtpm, ++dir) {
+          char* tmp;
+          const char* be_path = libxl__xs_read(gc, XBT_NULL,
+                GCSPRINTF("%s/%s/backend",
+                   fe_path, *dir));
+
+          vtpm->devid = atoi(*dir);
+
+          tmp = libxl__xs_read(gc, XBT_NULL,
+                GCSPRINTF("%s/%s/backend_id",
+                   fe_path, *dir));
+          vtpm->backend_domid = atoi(tmp);
+
+          tmp = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/uuid", be_path));
+          if(tmp) {
+             if(libxl_uuid_from_string(&(vtpm->uuid), tmp)) {
+                LOG(ERROR, "%s/uuid is a malformed uuid?? (%s) Probably a bug!!\n", be_path, tmp);
+                exit(1);
+             }
+          }
+       }
+    }
+    *num = ndirs;
+
+    GC_FREE;
+    return vtpms;
+}
+
+int libxl_device_vtpm_getinfo(libxl_ctx *ctx,
+                              uint32_t domid,
+                              libxl_device_vtpm *vtpm,
+                              libxl_vtpminfo *vtpminfo)
+{
+    GC_INIT(ctx);
+    char *dompath, *vtpmpath;
+    char *val;
+    int rc = 0;
+
+    libxl_vtpminfo_init(vtpminfo);
+    dompath = libxl__xs_get_dompath(gc, domid);
+    vtpminfo->devid = vtpm->devid;
+
+    vtpmpath = GCSPRINTF("%s/device/vtpm/%d", dompath, vtpminfo->devid);
+    vtpminfo->backend = xs_read(ctx->xsh, XBT_NULL,
+          GCSPRINTF("%s/backend", vtpmpath), NULL);
+    if (!vtpminfo->backend) {
+        goto err;
+    }
+    if(!libxl__xs_read(gc, XBT_NULL, vtpminfo->backend)) {
+       goto err;
+    }
+
+    val = libxl__xs_read(gc, XBT_NULL,
+          GCSPRINTF("%s/backend-id", vtpmpath));
+    vtpminfo->backend_id = val ? strtoul(val, NULL, 10) : -1;
+
+    val = libxl__xs_read(gc, XBT_NULL,
+          GCSPRINTF("%s/state", vtpmpath));
+    vtpminfo->state = val ? strtoul(val, NULL, 10) : -1;
+
+    val = libxl__xs_read(gc, XBT_NULL,
+          GCSPRINTF("%s/event-channel", vtpmpath));
+    vtpminfo->evtch = val ? strtoul(val, NULL, 10) : -1;
+
+    val = libxl__xs_read(gc, XBT_NULL,
+          GCSPRINTF("%s/ring-ref", vtpmpath));
+    vtpminfo->rref = val ? strtoul(val, NULL, 10) : -1;
+
+    vtpminfo->frontend = xs_read(ctx->xsh, XBT_NULL,
+          GCSPRINTF("%s/frontend", vtpminfo->backend), NULL);
+
+    val = libxl__xs_read(gc, XBT_NULL,
+          GCSPRINTF("%s/frontend-id", vtpminfo->backend));
+    vtpminfo->frontend_id = val ? strtoul(val, NULL, 10) : -1;
+
+    val = libxl__xs_read(gc, XBT_NULL,
+          GCSPRINTF("%s/uuid", vtpminfo->backend));
+    if(val == NULL) {
+       LOG(ERROR, "%s/uuid does not exist!\n", vtpminfo->backend);
+       goto err;
+    }
+    if(libxl_uuid_from_string(&(vtpminfo->uuid), val)) {
+       LOG(ERROR,
+             "%s/uuid is a malformed uuid?? (%s) Probably a bug!\n",
+             vtpminfo->backend, val);
+       goto err;
+    }
+
+    goto exit;
+err:
+    rc = ERROR_FAIL;
+exit:
+    GC_FREE;
+    return rc;
+}
+
+int libxl_devid_to_device_vtpm(libxl_ctx *ctx,
+                               uint32_t domid,
+                               int devid,
+                               libxl_device_vtpm *vtpm)
+{
+    libxl_device_vtpm *vtpms;
+    int nb, i;
+    int rc;
+
+    vtpms = libxl_device_vtpm_list(ctx, domid, &nb);
+    if (!vtpms)
+        return ERROR_FAIL;
+
+    memset(vtpm, 0, sizeof (libxl_device_vtpm));
+    rc = 1;
+    for (i = 0; i < nb; ++i) {
+        if(devid == vtpms[i].devid) {
+            vtpm->backend_domid = vtpms[i].backend_domid;
+            vtpm->devid = vtpms[i].devid;
+            libxl_uuid_copy(&vtpm->uuid, &vtpms[i].uuid);
+            rc = 0;
+            break;
+        }
+    }
+
+    libxl_device_vtpm_list_free(vtpms, nb);
+    return rc;
+}
+
+
+/******************************************************************************/
 
 int libxl__device_disk_setdefault(libxl__gc *gc, libxl_device_disk *disk)
 {
@@ -3046,6 +3283,8 @@ out:
  * libxl_device_disk_destroy
  * libxl_device_nic_remove
  * libxl_device_nic_destroy
+ * libxl_device_vtpm_remove
+ * libxl_device_vtpm_destroy
  * libxl_device_vkb_remove
  * libxl_device_vkb_destroy
  * libxl_device_vfb_remove
@@ -3097,6 +3336,10 @@ DEFINE_DEVICE_REMOVE(vkb, destroy, 1)
 DEFINE_DEVICE_REMOVE(vfb, remove, 0)
 DEFINE_DEVICE_REMOVE(vfb, destroy, 1)
 
+/* vtpm */
+DEFINE_DEVICE_REMOVE(vtpm, remove, 0)
+DEFINE_DEVICE_REMOVE(vtpm, destroy, 1)
+
 #undef DEFINE_DEVICE_REMOVE
 
 /******************************************************************************/
@@ -3105,6 +3348,7 @@ DEFINE_DEVICE_REMOVE(vfb, destroy, 1)
 /* The following functions are defined:
  * libxl_device_disk_add
  * libxl_device_nic_add
+ * libxl_device_vtpm_add
  */
 
 #define DEFINE_DEVICE_ADD(type)                                         \
@@ -3131,6 +3375,9 @@ DEFINE_DEVICE_ADD(disk)
 /* nic */
 DEFINE_DEVICE_ADD(nic)
 
+/* vtpm */
+DEFINE_DEVICE_ADD(vtpm)
+
 #undef DEFINE_DEVICE_ADD
 
 /******************************************************************************/
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 7a7c419..e2ba549 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -478,13 +478,14 @@ typedef struct {
     libxl_domain_create_info c_info;
     libxl_domain_build_info b_info;
 
-    int num_disks, num_nics, num_pcidevs, num_vfbs, num_vkbs;
+    int num_disks, num_nics, num_pcidevs, num_vfbs, num_vkbs, num_vtpms;
 
     libxl_device_disk *disks;
     libxl_device_nic *nics;
     libxl_device_pci *pcidevs;
     libxl_device_vfb *vfbs;
     libxl_device_vkb *vkbs;
+    libxl_device_vtpm *vtpms;
 
     libxl_action_on_shutdown on_poweroff;
     libxl_action_on_shutdown on_reboot;
@@ -645,6 +646,9 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
                                 int *nb_vcpu, int *nr_vcpus_out);
 void libxl_vcpuinfo_list_free(libxl_vcpuinfo *, int nr_vcpus);
 
+void libxl_device_vtpm_list_free(libxl_device_vtpm*, int nr_vtpms);
+void libxl_vtpminfo_list_free(libxl_vtpminfo *, int nr_vtpms);
+
 /*
  * Devices
  * =======
@@ -745,6 +749,23 @@ libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx, uint32_t domid, int *num
 int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
                               libxl_device_nic *nic, libxl_nicinfo *nicinfo);
 
+/* Virtual TPMs */
+int libxl_device_vtpm_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vtpm *vtpm,
+                          const libxl_asyncop_how *ao_how)
+                          LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vtpm_remove(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_vtpm *vtpm,
+                            const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vtpm_destroy(libxl_ctx *ctx, uint32_t domid,
+                              libxl_device_vtpm *vtpm,
+                              const libxl_asyncop_how *ao_how)
+                              LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx, uint32_t domid, int *num);
+int libxl_device_vtpm_getinfo(libxl_ctx *ctx, uint32_t domid,
+                               libxl_device_vtpm *vtpm, libxl_vtpminfo *vtpminfo);
+
 /* Keyboard */
 int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb,
                          const libxl_asyncop_how *ao_how)
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index e81747b..9d20086 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -55,6 +55,8 @@ void libxl_domain_config_dispose(libxl_domain_config *d_config)
         libxl_device_vkb_dispose(&d_config->vkbs[i]);
     free(d_config->vkbs);
 
+    libxl_device_vtpm_list_free(d_config->vtpms, d_config->num_vtpms);
+
     libxl_domain_create_info_dispose(&d_config->c_info);
     libxl_domain_build_info_dispose(&d_config->b_info);
 }
@@ -601,6 +603,8 @@ static void domcreate_bootloader_done(libxl__egc *egc,
 static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *aodevs,
                                 int ret);
 
+static void domcreate_attach_vtpms(libxl__egc *egc, libxl__multidev *multidev,
+                                   int ret);
 static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *aodevs,
                                  int ret);
 
@@ -1085,13 +1089,13 @@ static void domcreate_devmodel_started(libxl__egc *egc,
     if (d_config->num_nics > 0) {
         /* Attach nics */
         libxl__multidev_begin(ao, &dcs->multidev);
-        dcs->multidev.callback = domcreate_attach_pci;
+        dcs->multidev.callback = domcreate_attach_vtpms;
         libxl__add_nics(egc, ao, domid, d_config, &dcs->multidev);
         libxl__multidev_prepared(egc, &dcs->multidev, 0);
         return;
     }
 
-    domcreate_attach_pci(egc, &dcs->multidev, 0);
+    domcreate_attach_vtpms(egc, &dcs->multidev, 0);
     return;
 
 error_out:
@@ -1099,6 +1103,39 @@ error_out:
     domcreate_complete(egc, dcs, ret);
 }
 
+static void domcreate_attach_vtpms(libxl__egc *egc,
+                                   libxl__multidev *multidev,
+                                   int ret)
+{
+   libxl__domain_create_state *dcs = CONTAINER_OF(multidev, *dcs, multidev);
+   STATE_AO_GC(dcs->ao);
+   int domid = dcs->guest_domid;
+
+   libxl_domain_config* const d_config = dcs->guest_config;
+
+   if(ret) {
+       LOG(ERROR, "unable to add nic devices");
+       goto error_out;
+   }
+
+    /* Plug vtpm devices */
+   if (d_config->num_vtpms > 0) {
+       /* Attach vtpms */
+       libxl__multidev_begin(ao, &dcs->multidev);
+       dcs->multidev.callback = domcreate_attach_pci;
+       libxl__add_vtpms(egc, ao, domid, d_config, &dcs->multidev);
+       libxl__multidev_prepared(egc, &dcs->multidev, 0);
+       return;
+   }
+
+   domcreate_attach_pci(egc, multidev, 0);
+   return;
+
+error_out:
+   assert(ret);
+   domcreate_complete(egc, dcs, ret);
+}
+
 static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
                                  int ret)
 {
@@ -1112,7 +1149,7 @@ static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
     libxl_domain_config *const d_config = dcs->guest_config;
 
     if (ret) {
-        LOG(ERROR, "unable to add nic devices");
+        LOG(ERROR, "unable to add vtpm devices");
         goto error_out;
     }
 
diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index c3283f1..51dd06e 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -497,6 +497,7 @@ void libxl__multidev_prepared(libxl__egc *egc,
  * The following functions are defined:
  * libxl__add_disks
  * libxl__add_nics
+ * libxl__add_vtpms
  */
 
 #define DEFINE_DEVICES_ADD(type)                                        \
@@ -515,6 +516,7 @@ void libxl__multidev_prepared(libxl__egc *egc,
 
 DEFINE_DEVICES_ADD(disk)
 DEFINE_DEVICES_ADD(nic)
+DEFINE_DEVICES_ADD(vtpm)
 
 #undef DEFINE_DEVICES_ADD
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 8f220cb..cba3616 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -958,6 +958,7 @@ _hidden int libxl__device_disk_setdefault(libxl__gc *gc,
                                           libxl_device_disk *disk);
 _hidden int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic,
                                          uint32_t domid);
+_hidden int libxl__device_vtpm_setdefault(libxl__gc *gc, libxl_device_vtpm *vtpm);
 _hidden int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb);
 _hidden int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb);
 _hidden int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci);
@@ -2007,6 +2008,10 @@ _hidden void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
                                    libxl_device_nic *nic,
                                    libxl__ao_device *aodev);
 
+_hidden void libxl__device_vtpm_add(libxl__egc *egc, uint32_t domid,
+                                   libxl_device_vtpm *vtpm,
+                                   libxl__ao_device *aodev);
+
 /* Internal function to connect a vkb device */
 _hidden int libxl__device_vkb_add(libxl__gc *gc, uint32_t domid,
                                   libxl_device_vkb *vkb);
@@ -2439,6 +2444,10 @@ _hidden void libxl__add_nics(libxl__egc *egc, libxl__ao *ao, uint32_t domid,
                              libxl_domain_config *d_config,
                              libxl__multidev *multidev);
 
+_hidden void libxl__add_vtpms(libxl__egc *egc, libxl__ao *ao, uint32_t domid,
+                             libxl_domain_config *d_config,
+                             libxl__multidev *multidev);
+
 /*----- device model creation -----*/
 
 /* First layer; wraps libxl__spawn_spawn. */
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index de111a6..7eac4a8 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -395,6 +395,12 @@ libxl_device_pci = Struct("device_pci", [
     ("permissive", bool),
     ])
 
+libxl_device_vtpm = Struct("device_vtpm", [
+    ("backend_domid",    libxl_domid),
+    ("devid",            libxl_devid),
+    ("uuid",             libxl_uuid),
+])
+
 libxl_diskinfo = Struct("diskinfo", [
     ("backend", string),
     ("backend_id", uint32),
@@ -418,6 +424,18 @@ libxl_nicinfo = Struct("nicinfo", [
     ("rref_rx", integer),
     ], dir=DIR_OUT)
 
+libxl_vtpminfo = Struct("vtpminfo", [
+    ("backend", string),
+    ("backend_id", uint32),
+    ("frontend", string),
+    ("frontend_id", uint32),
+    ("devid", libxl_devid),
+    ("state", integer),
+    ("evtch", integer),
+    ("rref", integer),
+    ("uuid", libxl_uuid),
+    ], dir=DIR_OUT)
+
 libxl_vcpuinfo = Struct("vcpuinfo", [
     ("vcpuid", uint32),
     ("cpu", uint32),
diff --git a/tools/libxl/libxl_types_internal.idl b/tools/libxl/libxl_types_internal.idl
index 5ac8c9c..c40120e 100644
--- a/tools/libxl/libxl_types_internal.idl
+++ b/tools/libxl/libxl_types_internal.idl
@@ -19,6 +19,7 @@ libxl__device_kind = Enumeration("device_kind", [
     (5, "VFB"),
     (6, "VKBD"),
     (7, "CONSOLE"),
+    (8, "VTPM"),
     ])
 
 libxl__console_backend = Enumeration("console_backend", [
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 55cd299..8f78790 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -463,6 +463,33 @@ int libxl_pipe(libxl_ctx *ctx, int pipes[2])
     return 0;
 }
 
+int libxl_uuid_to_device_vtpm(libxl_ctx *ctx, uint32_t domid,
+                            libxl_uuid* uuid, libxl_device_vtpm *vtpm)
+{
+    libxl_device_vtpm *vtpms;
+    int nb, i;
+    int rc;
+
+    vtpms = libxl_device_vtpm_list(ctx, domid, &nb);
+    if (!vtpms)
+        return ERROR_FAIL;
+
+    memset(vtpm, 0, sizeof (libxl_device_vtpm));
+    rc = 1;
+    for (i = 0; i < nb; ++i) {
+        if(!libxl_uuid_compare(uuid, &vtpms[i].uuid)) {
+            vtpm->backend_domid = vtpms[i].backend_domid;
+            vtpm->devid = vtpms[i].devid;
+            libxl_uuid_copy(&vtpm->uuid, &vtpms[i].uuid);
+            rc = 0;
+            break;
+        }
+    }
+
+    libxl_device_vtpm_list_free(vtpms, nb);
+    return rc;
+}
+
 int libxl_mac_to_device_nic(libxl_ctx *ctx, uint32_t domid,
                             const char *mac, libxl_device_nic *nic)
 {
@@ -819,6 +846,22 @@ void libxl_cpupoolinfo_list_free(libxl_cpupoolinfo *list, int nr)
     free(list);
 }
 
+void libxl_vtpminfo_list_free(libxl_vtpminfo* list, int nr)
+{
+   int i;
+   for (i = 0; i < nr; i++)
+      libxl_vtpminfo_dispose(&list[i]);
+   free(list);
+}
+
+void libxl_device_vtpm_list_free(libxl_device_vtpm* list, int nr)
+{
+   int i;
+   for (i = 0; i < nr; i++)
+      libxl_device_vtpm_dispose(&list[i]);
+   free(list);
+}
+
 int libxl_domid_valid_guest(uint32_t domid)
 {
     /* returns 1 if the value _could_ be a valid guest domid, 0 otherwise
diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
index 83aaac7..40f3f30 100644
--- a/tools/libxl/libxl_utils.h
+++ b/tools/libxl/libxl_utils.h
@@ -64,6 +64,11 @@ int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid, int devid,
 int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid, const char *vdev,
                                libxl_device_disk *disk);
 
+int libxl_uuid_to_device_vtpm(libxl_ctx *ctx, uint32_t domid,
+                               libxl_uuid *uuid, libxl_device_vtpm *vtpm);
+int libxl_devid_to_device_vtpm(libxl_ctx *ctx, uint32_t domid,
+                               int devid, libxl_device_vtpm *vtpm);
+
 int libxl_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *bitmap, int n_bits);
     /* Allocated bimap is from malloc, libxl_bitmap_dispose() to be
      * called by the application when done. */
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index 0b2f848..be6f38b 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -79,6 +79,9 @@ int main_networkdetach(int argc, char **argv);
 int main_blockattach(int argc, char **argv);
 int main_blocklist(int argc, char **argv);
 int main_blockdetach(int argc, char **argv);
+int main_vtpmattach(int argc, char **argv);
+int main_vtpmlist(int argc, char **argv);
+int main_vtpmdetach(int argc, char **argv);
 int main_uptime(int argc, char **argv);
 int main_tmem_list(int argc, char **argv);
 int main_tmem_freeze(int argc, char **argv);
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index a43b371..65f83bd 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -573,7 +573,7 @@ static void parse_config_data(const char *config_source,
     const char *buf;
     long l;
     XLU_Config *config;
-    XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids;
+    XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids, *vtpms;
     XLU_ConfigList *ioports, *irqs, *iomem;
     int num_ioports, num_irqs, num_iomem;
     int pci_power_mgmt = 0;
@@ -1048,6 +1048,58 @@ static void parse_config_data(const char *config_source,
         }
     }
 
+    if (!xlu_cfg_get_list(config, "vtpm", &vtpms, 0, 0)) {
+        d_config->num_vtpms = 0;
+        d_config->vtpms = NULL;
+        while ((buf = xlu_cfg_get_listitem (vtpms, d_config->num_vtpms)) != NULL) {
+            libxl_device_vtpm *vtpm;
+            char * buf2 = strdup(buf);
+            char *p, *p2;
+            bool got_backend = false;
+
+            d_config->vtpms = (libxl_device_vtpm *) realloc(d_config->vtpms,
+                  sizeof(libxl_device_vtpm) * (d_config->num_vtpms+1));
+            vtpm = d_config->vtpms + d_config->num_vtpms;
+            libxl_device_vtpm_init(vtpm);
+            vtpm->devid = d_config->num_vtpms;
+
+            p = strtok(buf2, ",");
+            if(p) {
+               do {
+                  while(*p == ' ')
+                     ++p;
+                  if ((p2 = strchr(p, '=')) == NULL)
+                     break;
+                  *p2 = '\0';
+                  if (!strcmp(p, "backend")) {
+                     if(domain_qualifier_to_domid(p2 + 1, &(vtpm->backend_domid), 0))
+                     {
+                        fprintf(stderr,
+                              "Specified vtpm backend domain `%s' does not exist!\n", p2 + 1);
+                        exit(1);
+                     }
+                     got_backend = true;
+                  } else if(!strcmp(p, "uuid")) {
+                     if( libxl_uuid_from_string(&vtpm->uuid, p2 + 1) ) {
+                        fprintf(stderr,
+                              "Failed to parse vtpm UUID: %s\n", p2 + 1);
+                        exit(1);
+                    }
+                  } else {
+                     fprintf(stderr, "Unknown string `%s' in vtpm spec\n", p);
+                     exit(1);
+                  }
+               } while ((p = strtok(NULL, ",")) != NULL);
+            }
+            if(!got_backend) {
+               fprintf(stderr, "vtpm spec missing required backend field!\n");
+               exit(1);
+            }
+            free(buf2);
+            d_config->num_vtpms++;
+        }
+    }
+
     if (!xlu_cfg_get_list (config, "vif", &nics, 0, 0)) {
         d_config->num_nics = 0;
         d_config->nics = NULL;
@@ -1073,7 +1125,7 @@ static void parse_config_data(const char *config_source,
 
             p = strtok(buf2, ",");
             if (!p)
-                goto skip;
+                goto skip_nic;
             do {
                 while (*p == ' ')
                     p++;
@@ -1137,7 +1189,7 @@ static void parse_config_data(const char *config_source,
                     fprintf(stderr, "the accel parameter for vifs is currently not supported\n");
                 }
             } while ((p = strtok(NULL, ",")) != NULL);
-skip:
+skip_nic:
             free(buf2);
             d_config->num_nics++;
         }
@@ -5634,6 +5686,132 @@ int main_blockdetach(int argc, char **argv)
     return rc;
 }
 
+int main_vtpmattach(int argc, char **argv)
+{
+    int opt;
+    libxl_device_vtpm vtpm;
+    char *oparg;
+    unsigned int val;
+    uint32_t domid;
+
+    if ((opt = def_getopt(argc, argv, "", "vtpm-attach", 1)) != -1)
+        return opt;
+
+    if (domain_qualifier_to_domid(argv[optind], &domid, 0) < 0) {
+        fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
+        return 1;
+    }
+    ++optind;
+
+    libxl_device_vtpm_init(&vtpm);
+    for (argv += optind, argc -= optind; argc > 0; ++argv, --argc) {
+        if (MATCH_OPTION("uuid", *argv, oparg)) {
+            if(libxl_uuid_from_string(&(vtpm.uuid), oparg)) {
+                fprintf(stderr, "Invalid uuid specified (%s)\n", oparg);
+                return 1;
+            }
+        } else if (MATCH_OPTION("backend", *argv, oparg)) {
+            if(domain_qualifier_to_domid(oparg, &val, 0)) {
+                fprintf(stderr,
+                      "Specified backend domain does not exist, defaulting to Dom0\n");
+                val = 0;
+            }
+            vtpm.backend_domid = val;
+        } else {
+            fprintf(stderr, "unrecognized argument `%s'\n", *argv);
+            return 1;
+        }
+    }
+
+    if(dryrun_only) {
+       char* json = libxl_device_vtpm_to_json(ctx, &vtpm);
+       printf("vtpm: %s\n", json);
+       free(json);
+       libxl_device_vtpm_dispose(&vtpm);
+       if (ferror(stdout) || fflush(stdout)) { perror("stdout"); exit(-1); }
+       return 0;
+    }
+
+    if (libxl_device_vtpm_add(ctx, domid, &vtpm, 0)) {
+        fprintf(stderr, "libxl_device_vtpm_add failed.\n");
+        return 1;
+    }
+    libxl_device_vtpm_dispose(&vtpm);
+    return 0;
+}
+
+int main_vtpmlist(int argc, char **argv)
+{
+    int opt;
+    libxl_device_vtpm *vtpms;
+    libxl_vtpminfo vtpminfo;
+    int nb, i;
+
+    if ((opt = def_getopt(argc, argv, "", "vtpm-list", 1)) != -1)
+        return opt;
+
+    /*      Idx  BE   UUID   Hdl  Sta  evch rref  BE-path */
+    printf("%-3s %-2s %-36s %-6s %-5s %-6s %-5s %-10s\n",
+           "Idx", "BE", "Uuid", "handle", "state", "evt-ch", "ring-ref", "BE-path");
+    for (argv += optind, argc -= optind; argc > 0; --argc, ++argv) {
+        uint32_t domid;
+        if (domain_qualifier_to_domid(*argv, &domid, 0) < 0) {
+            fprintf(stderr, "%s is an invalid domain identifier\n", *argv);
+            continue;
+        }
+        if (!(vtpms = libxl_device_vtpm_list(ctx, domid, &nb))) {
+            continue;
+        }
+        for (i = 0; i < nb; ++i) {
+           if(!libxl_device_vtpm_getinfo(ctx, domid, &vtpms[i], &vtpminfo)) {
+              /*      Idx  BE     UUID             Hdl Sta evch rref BE-path*/
+              printf("%-3d %-2d " LIBXL_UUID_FMT " %6d %5d %6d %8d %-30s\n",
+                    vtpminfo.devid, vtpminfo.backend_id,
+                    LIBXL_UUID_BYTES(vtpminfo.uuid),
+                    vtpminfo.devid, vtpminfo.state, vtpminfo.evtch,
+                    vtpminfo.rref, vtpminfo.backend);
+
+              libxl_vtpminfo_dispose(&vtpminfo);
+           }
+           libxl_device_vtpm_dispose(&vtpms[i]);
+        }
+        free(vtpms);
+    }
+    return 0;
+}
+
+int main_vtpmdetach(int argc, char **argv)
+{
+    uint32_t domid;
+    int opt, rc=0;
+    libxl_device_vtpm vtpm;
+    libxl_uuid uuid;
+
+    if ((opt = def_getopt(argc, argv, "", "vtpm-detach", 2)) != -1)
+        return opt;
+
+    domid = find_domain(argv[optind]);
+
+    if ( libxl_uuid_from_string(&uuid, argv[optind+1])) {
+        if (libxl_devid_to_device_vtpm(ctx, domid, atoi(argv[optind+1]), &vtpm)) {
+            fprintf(stderr, "Unknown device %s.\n", argv[optind+1]);
+            return 1;
+        }
+    } else {
+        if (libxl_uuid_to_device_vtpm(ctx, domid, &uuid, &vtpm)) {
+            fprintf(stderr, "Unknown device %s.\n", argv[optind+1]);
+            return 1;
+        }
+    }
+    rc = libxl_device_vtpm_remove(ctx, domid, &vtpm, 0);
+    if (rc) {
+        fprintf(stderr, "libxl_device_vtpm_remove failed.\n");
+    }
+    libxl_device_vtpm_dispose(&vtpm);
+    return rc;
+}
+
+
 static char *uptime_to_string(unsigned long uptime, int short_mode)
 {
     int sec, min, hour, day;
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index d3a215d..ac58642 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -341,6 +341,21 @@ struct cmd_spec cmd_table[] = {
       "Destroy a domain's virtual block device",
       "<Domain> <DevId>",
     },
+    { "vtpm-attach",
+      &main_vtpmattach, 1, 1,
+      "Create a new virtual TPM device",
+      "<Domain> [uuid=<uuid>] [backend=<BackDomain>]",
+    },
+    { "vtpm-list",
+      &main_vtpmlist, 0, 0,
+      "List virtual TPM devices for a domain",
+      "<Domain(s)>",
+    },
+    { "vtpm-detach",
+      &main_vtpmdetach, 0, 1,
+      "Destroy a domain's virtual TPM device",
+      "<Domain> <DevId|uuid>",
+    },
     { "uptime",
       &main_uptime, 0, 0,
       "Print uptime for all/some domains",
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:36:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:36:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1Uv-0005V2-Sk; Thu, 01 Nov 2012 20:36:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TU1Ut-0005U8-IG
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:36:16 +0000
Received: from [85.158.138.51:33023] by server-1.bemta-3.messagelabs.com id
	36/15-12169-E3DD2905; Thu, 01 Nov 2012 20:36:14 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-14.tower-174.messagelabs.com!1351802165!21991508!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY,UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28940 invoked from network); 1 Nov 2012 20:36:06 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-14.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 20:36:06 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148031189;
	Thu, 01 Nov 2012 16:35:56 -0400
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com, xen-devel@lists.xen.org,
	stefano.stabellini@eu.citrix.com
Date: Thu,  1 Nov 2012 16:35:49 -0400
Message-Id: <1351802150-19258-3-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM 8/9] add stubdom/vtpmmgr code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add the code base for vtpmmgrdom. Makefile changes
next patch.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

diff --git a/stubdom/vtpmmgr/Makefile b/stubdom/vtpmmgr/Makefile
new file mode 100644
index 0000000..88c83c3
--- /dev/null
+++ b/stubdom/vtpmmgr/Makefile
@@ -0,0 +1,32 @@
+# Copyright (c) 2010-2012 United States Government, as represented by
+# the Secretary of Defense.  All rights reserved.
+#
+# THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+# ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+# INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+# DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+# SOFTWARE.
+#
+
+XEN_ROOT=../..
+
+PSSL_DIR=../polarssl-$(XEN_TARGET_ARCH)/library
+PSSL_OBJS=aes.o sha1.o entropy.o ctr_drbg.o bignum.o sha4.o havege.o timing.o entropy_poll.o
+
+TARGET=vtpmmgr.a
+OBJS=vtpmmgr.o vtpm_cmd_handler.o vtpm_storage.o init.o tpmrsa.o tpm.o log.o
+
+CFLAGS+=-Werror -Iutil -Icrypto -Itcs
+CFLAGS+=-Wno-declaration-after-statement -Wno-unused-label
+
+build: $(TARGET)
+$(TARGET): $(OBJS)
+	ar -rcs $@ $^ $(foreach obj,$(PSSL_OBJS),$(PSSL_DIR)/$(obj))
+
+clean:
+	rm -f $(TARGET) $(OBJS)
+
+distclean: clean
+
+.PHONY: clean distclean
diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
new file mode 100644
index 0000000..a158020
--- /dev/null
+++ b/stubdom/vtpmmgr/init.c
@@ -0,0 +1,553 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+#include <stdint.h>
+#include <stdlib.h>
+
+#include <xen/xen.h>
+#include <mini-os/tpmback.h>
+#include <mini-os/tpmfront.h>
+#include <mini-os/tpm_tis.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <polarssl/sha1.h>
+
+#include "log.h"
+#include "vtpmmgr.h"
+#include "vtpm_storage.h"
+#include "tpm.h"
+#include "marshal.h"
+
+struct Opts {
+   enum {
+      TPMDRV_TPM_TIS,
+      TPMDRV_TPMFRONT,
+   } tpmdriver;
+   unsigned long tpmiomem;
+   unsigned int tpmirq;
+   unsigned int tpmlocality;
+   int gen_owner_auth;
+};
+
+// --------------------------- Well Known Auths --------------------------
+const TPM_AUTHDATA WELLKNOWN_SRK_AUTH = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+const TPM_AUTHDATA WELLKNOWN_OWNER_AUTH = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+
+struct vtpm_globals vtpm_globals = {
+   .tpm_fd = -1,
+   .storage_key = TPM_KEY_INIT,
+   .storage_key_handle = 0,
+   .oiap = { .AuthHandle = 0 }
+};
+
+static int tpm_entropy_source(void* dummy, unsigned char* data, size_t len, size_t* olen) {
+   UINT32 sz = len;
+   TPM_RESULT rc = TPM_GetRandom(&sz, data);
+   *olen = sz;
+   return rc == TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
+}
+
+static TPM_RESULT check_tpm_version(void) {
+   TPM_RESULT status;
+   UINT32 rsize;
+   BYTE* res = NULL;
+   TPM_CAP_VERSION_INFO vinfo;
+
+   TPMTRYRETURN(TPM_GetCapability(
+            TPM_CAP_VERSION_VAL,
+            0,
+            NULL,
+            &rsize,
+            &res));
+   if(rsize < 4) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid size returned by GetCapability!\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   unpack_TPM_CAP_VERSION_INFO(res, &vinfo, UNPACK_ALIAS);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Hardware TPM:\n");
+   vtpmloginfo(VTPM_LOG_VTPM, " version: %hhd %hhd %hhd %hhd\n",
+         vinfo.version.major, vinfo.version.minor, vinfo.version.revMajor, vinfo.version.revMinor);
+   vtpmloginfo(VTPM_LOG_VTPM, " specLevel: %hd\n", vinfo.specLevel);
+   vtpmloginfo(VTPM_LOG_VTPM, " errataRev: %hhd\n", vinfo.errataRev);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorID: %c%c%c%c\n",
+         vinfo.tpmVendorID[0], vinfo.tpmVendorID[1],
+         vinfo.tpmVendorID[2], vinfo.tpmVendorID[3]);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecificSize: %hd\n", vinfo.vendorSpecificSize);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecific: ");
+   for(int i = 0; i < vinfo.vendorSpecificSize; ++i) {
+      vtpmloginfomore(VTPM_LOG_VTPM, "%02hhx", vinfo.vendorSpecific[i]);
+   }
+   vtpmloginfomore(VTPM_LOG_VTPM, "\n");
+
+abort_egress:
+   free(res);
+   return status;
+}
+
+static TPM_RESULT flush_tpm(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   const TPM_RESOURCE_TYPE reslist[] = { TPM_RT_KEY, TPM_RT_AUTH, TPM_RT_TRANS, TPM_RT_COUNTER, TPM_RT_DAA_TPM, TPM_RT_CONTEXT };
+   BYTE* keylist = NULL;
+   UINT32 keylistSize;
+   BYTE* ptr;
+
+   //Iterate through each resource type and flush all handles
+   for(int i = 0; i < sizeof(reslist) / sizeof(TPM_RESOURCE_TYPE); ++i) {
+      TPM_RESOURCE_TYPE beres = cpu_to_be32(reslist[i]);
+      UINT16 size;
+      TPMTRYRETURN(TPM_GetCapability(
+               TPM_CAP_HANDLE,
+               sizeof(TPM_RESOURCE_TYPE),
+               (BYTE*)(&beres),
+               &keylistSize,
+               &keylist));
+
+      ptr = keylist;
+      ptr = unpack_UINT16(ptr, &size);
+
+      //Flush each handle
+      if(size) {
+         vtpmloginfo(VTPM_LOG_VTPM, "Flushing %u handle(s) of type %lu\n", size, (unsigned long) reslist[i]);
+         for(int j = 0; j < size; ++j) {
+            TPM_HANDLE h;
+            ptr = unpack_TPM_HANDLE(ptr, &h);
+            TPMTRYRETURN(TPM_FlushSpecific(h, reslist[i]));
+         }
+      }
+
+      free(keylist);
+      keylist = NULL;
+   }
+
+   goto egress;
+abort_egress:
+   free(keylist);
+egress:
+   return status;
+}
+
+
+static TPM_RESULT try_take_ownership(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_PUBKEY pubEK = TPM_PUBKEY_INIT;
+
+   // If we can read PubEK then there is no owner and we should take it.
+   status = TPM_ReadPubek(&pubEK);
+
+   switch(status) {
+      case TPM_DISABLED_CMD:
+         //Cannot read ek? TPM has owner
+         vtpmloginfo(VTPM_LOG_VTPM, "Failed to readEK meaning TPM has an owner. Creating Keys off existing SRK.\n");
+         status = TPM_SUCCESS;
+         break;
+      case TPM_NO_ENDORSEMENT:
+         {
+            //If theres no ek, we have to create one
+            TPM_KEY_PARMS keyInfo = {
+               .algorithmID = TPM_ALG_RSA,
+               .encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1,
+               .sigScheme = TPM_SS_NONE,
+               .parmSize = 12,
+               .parms.rsa = {
+                  .keyLength = RSA_KEY_SIZE,
+                  .numPrimes = 2,
+                  .exponentSize = 0,
+                  .exponent = NULL,
+               },
+            };
+            TPMTRYRETURN(TPM_CreateEndorsementKeyPair(&keyInfo, &pubEK));
+         }
+         //fall through to take ownership
+      case TPM_SUCCESS:
+         {
+            //Construct the Srk
+            TPM_KEY srk = {
+               .ver = TPM_STRUCT_VER_1_1,
+               .keyUsage = TPM_KEY_STORAGE,
+               .keyFlags = 0x00,
+               .authDataUsage = TPM_AUTH_ALWAYS,
+               .algorithmParms = {
+                  .algorithmID = TPM_ALG_RSA,
+                  .encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1,
+                  .sigScheme =  TPM_SS_NONE,
+                  .parmSize = 12,
+                  .parms.rsa = {
+                     .keyLength = RSA_KEY_SIZE,
+                     .numPrimes = 2,
+                     .exponentSize = 0,
+                     .exponent = NULL,
+                  },
+               },
+               .PCRInfoSize = 0,
+               .pubKey = {
+                  .keyLength = 0,
+                  .key = NULL,
+               },
+               .encDataSize = 0,
+            };
+
+            TPMTRYRETURN(TPM_TakeOwnership(
+                     &pubEK,
+                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
+                     (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+                     &srk,
+                     NULL,
+                     &vtpm_globals.oiap));
+
+            TPMTRYRETURN(TPM_DisablePubekRead(
+                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
+                     &vtpm_globals.oiap));
+         }
+         break;
+      default:
+         break;
+   }
+abort_egress:
+   free_TPM_PUBKEY(&pubEK);
+   return status;
+}
+
+static void init_storage_key(TPM_KEY* key) {
+   key->ver.major = 1;
+   key->ver.minor = 1;
+   key->ver.revMajor = 0;
+   key->ver.revMinor = 0;
+
+   key->keyUsage = TPM_KEY_BIND;
+   key->keyFlags = 0;
+   key->authDataUsage = TPM_AUTH_ALWAYS;
+
+   TPM_KEY_PARMS* p = &key->algorithmParms;
+   p->algorithmID = TPM_ALG_RSA;
+   p->encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
+   p->sigScheme = TPM_SS_NONE;
+   p->parmSize = 12;
+
+   TPM_RSA_KEY_PARMS* r = &p->parms.rsa;
+   r->keyLength = RSA_KEY_SIZE;
+   r->numPrimes = 2;
+   r->exponentSize = 0;
+   r->exponent = NULL;
+
+   key->PCRInfoSize = 0;
+   key->encDataSize = 0;
+   key->encData = NULL;
+}
+
+static int parse_auth_string(char* authstr, BYTE* target, const TPM_AUTHDATA wellknown, int allowrandom) {
+   int rc;
+   /* well known owner auth */
+   if(!strcmp(authstr, "well-known")) {
+      memcpy(target, wellknown, sizeof(TPM_AUTHDATA));
+   }
+   /* Create a randomly generated owner auth */
+   else if(allowrandom && !strcmp(authstr, "random")) {
+      return 1;
+   }
+   /* owner auth is a raw hash */
+   else if(!strncmp(authstr, "hash:", 5)) {
+      authstr += 5;
+      if((rc = strlen(authstr)) != 40) {
+         vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth hex string `%s' must be exactly 40 characters (20 bytes) long, length=%d\n", authstr, rc);
+         return -1;
+      }
+      for(int j = 0; j < 20; ++j) {
+         if(sscanf(authstr, "%hhX", target + j) != 1) {
+            vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth string `%s' is not a valid hex string\n", authstr);
+            return -1;
+         }
+         authstr += 2;
+      }
+   }
+   /* owner auth is a string that will be hashed */
+   else if(!strncmp(authstr, "text:", 5)) {
+      authstr += 5;
+      sha1((const unsigned char*)authstr, strlen(authstr), target);
+   }
+   else {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid auth string %s\n", authstr);
+      return -1;
+   }
+
+   return 0;
+}
+
+int parse_cmdline_opts(int argc, char** argv, struct Opts* opts)
+{
+   int rc;
+   int i;
+
+   //Set defaults
+   memcpy(vtpm_globals.owner_auth, WELLKNOWN_OWNER_AUTH, sizeof(TPM_AUTHDATA));
+   memcpy(vtpm_globals.srk_auth, WELLKNOWN_SRK_AUTH, sizeof(TPM_AUTHDATA));
+
+   for(i = 1; i < argc; ++i) {
+      if(!strncmp(argv[i], "owner_auth:", 10)) {
+         if((rc = parse_auth_string(argv[i] + 10, vtpm_globals.owner_auth, WELLKNOWN_OWNER_AUTH, 1)) < 0) {
+            goto err_invalid;
+         }
+         if(rc == 1) {
+            opts->gen_owner_auth = 1;
+         }
+      }
+      else if(!strncmp(argv[i], "srk_auth:", 8)) {
+         if((rc = parse_auth_string(argv[i] + 8, vtpm_globals.srk_auth, WELLKNOWN_SRK_AUTH, 0)) != 0) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmdriver=", 10)) {
+         if(!strcmp(argv[i] + 10, "tpm_tis")) {
+            opts->tpmdriver = TPMDRV_TPM_TIS;
+         } else if(!strcmp(argv[i] + 10, "tpmfront")) {
+            opts->tpmdriver = TPMDRV_TPMFRONT;
+         } else {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmiomem=",9)) {
+         if(sscanf(argv[i] + 9, "0x%lX", &opts->tpmiomem) != 1) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmirq=",7)) {
+         if(!strcmp(argv[i] + 7, "probe")) {
+            opts->tpmirq = TPM_PROBE_IRQ;
+         } else if( sscanf(argv[i] + 7, "%u", &opts->tpmirq) != 1) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmlocality=",12)) {
+         if(sscanf(argv[i] + 12, "%u", &opts->tpmlocality) != 1 || opts->tpmlocality > 4) {
+            goto err_invalid;
+         }
+      }
+   }
+
+   switch(opts->tpmdriver) {
+      case TPMDRV_TPM_TIS:
+         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpm_tis driver\n");
+         break;
+      case TPMDRV_TPMFRONT:
+         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpmfront driver\n");
+         break;
+   }
+
+   return 0;
+err_invalid:
+   vtpmlogerror(VTPM_LOG_VTPM, "Invalid Option %s\n", argv[i]);
+   return -1;
+}
+
+
+
+static TPM_RESULT vtpmmgr_create(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_AUTH_SESSION osap = TPM_AUTH_SESSION_INIT;
+   TPM_AUTHDATA sharedsecret;
+
+   // Take ownership if TPM is unowned
+   TPMTRYRETURN(try_take_ownership());
+
+   // Generate storage key's auth
+   memset(&vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA));
+
+   TPMTRYRETURN( TPM_OSAP(
+            TPM_ET_KEYHANDLE,
+            TPM_SRK_KEYHANDLE,
+            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+            &sharedsecret,
+            &osap) );
+
+   init_storage_key(&vtpm_globals.storage_key);
+
+   //initialize the storage key
+   TPMTRYRETURN( TPM_CreateWrapKey(
+            TPM_SRK_KEYHANDLE,
+            (const TPM_AUTHDATA*)&sharedsecret,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.storage_key,
+            &osap) );
+
+   //Load Storage Key
+   TPMTRYRETURN( TPM_LoadKey(
+            TPM_SRK_KEYHANDLE,
+            &vtpm_globals.storage_key,
+            &vtpm_globals.storage_key_handle,
+            (const TPM_AUTHDATA*) &vtpm_globals.srk_auth,
+            &vtpm_globals.oiap));
+
+   //Make sure TPM has commited changes
+   TPMTRYRETURN( TPM_SaveState() );
+
+   //Create new disk image
+   TPMTRYRETURN(vtpm_storage_new_header());
+
+   goto egress;
+abort_egress:
+egress:
+   vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager\n");
+
+   //End the OSAP session
+   if(osap.AuthHandle) {
+      TPM_TerminateHandle(osap.AuthHandle);
+   }
+
+   return status;
+}
+
+TPM_RESULT vtpmmgr_init(int argc, char** argv) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   /* Default commandline options */
+   struct Opts opts = {
+      .tpmdriver = TPMDRV_TPM_TIS,
+      .tpmiomem = TPM_BASEADDR,
+      .tpmirq = 0,
+      .tpmlocality = 0,
+      .gen_owner_auth = 0,
+   };
+
+   if(parse_cmdline_opts(argc, argv, &opts) != 0) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Command line parsing failed! exiting..\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   //Setup storage system
+   if(vtpm_storage_init() != 0) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize storage subsystem!\n");
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   //Setup tpmback device
+   init_tpmback();
+
+   //Setup tpm access
+   switch(opts.tpmdriver) {
+      case TPMDRV_TPM_TIS:
+         {
+            struct tpm_chip* tpm;
+            if((tpm = init_tpm_tis(opts.tpmiomem, TPM_TIS_LOCL_INT_TO_FLAG(opts.tpmlocality), opts.tpmirq)) == NULL) {
+               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+               status = TPM_IOERROR;
+               goto abort_egress;
+            }
+            vtpm_globals.tpm_fd = tpm_tis_open(tpm);
+            tpm_tis_request_locality(tpm, opts.tpmlocality);
+         }
+         break;
+      case TPMDRV_TPMFRONT:
+         {
+            struct tpmfront_dev* tpmfront_dev;
+            if((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
+               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+               status = TPM_IOERROR;
+               goto abort_egress;
+            }
+            vtpm_globals.tpm_fd = tpmfront_open(tpmfront_dev);
+         }
+         break;
+   }
+
+   //Get the version of the tpm
+   TPMTRYRETURN(check_tpm_version());
+
+   // Blow away all stale handles left in the tpm
+   if(flush_tpm() != TPM_SUCCESS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_FlushResources failed, continuing anyway..\n");
+   }
+
+   /* Initialize the rng */
+   entropy_init(&vtpm_globals.entropy);
+   entropy_add_source(&vtpm_globals.entropy, tpm_entropy_source, NULL, 0);
+   entropy_gather(&vtpm_globals.entropy);
+   ctr_drbg_init(&vtpm_globals.ctr_drbg, entropy_func, &vtpm_globals.entropy, NULL, 0);
+   ctr_drbg_set_prediction_resistance( &vtpm_globals.ctr_drbg, CTR_DRBG_PR_OFF );
+
+   // Generate Auth for Owner
+   if(opts.gen_owner_auth) {
+      vtpmmgr_rand(vtpm_globals.owner_auth, sizeof(TPM_AUTHDATA));
+   }
+
+   // Create OIAP session for service's authorized commands
+   TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
+
+   /* Load the Manager data, if it fails create a new manager */
+   if (vtpm_storage_load_header() != TPM_SUCCESS) {
+      /* If the OIAP session was closed by an error, create a new one */
+      if(vtpm_globals.oiap.AuthHandle == 0) {
+         TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
+      }
+      vtpmloginfo(VTPM_LOG_VTPM, "Failed to read manager file. Assuming first time initialization.\n");
+      TPMTRYRETURN( vtpmmgr_create() );
+   }
+
+   goto egress;
+abort_egress:
+   vtpmmgr_shutdown();
+egress:
+   return status;
+}
+
+void vtpmmgr_shutdown(void)
+{
+   /* Cleanup resources */
+   free_TPM_KEY(&vtpm_globals.storage_key);
+
+   /* Cleanup TPM resources */
+   TPM_EvictKey(vtpm_globals.storage_key_handle);
+   TPM_TerminateHandle(vtpm_globals.oiap.AuthHandle);
+
+   /* Close tpmback */
+   shutdown_tpmback();
+
+   /* Close the storage system and blkfront */
+   vtpm_storage_shutdown();
+
+   /* Close tpmfront/tpm_tis */
+   close(vtpm_globals.tpm_fd);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
+}
diff --git a/stubdom/vtpmmgr/log.c b/stubdom/vtpmmgr/log.c
new file mode 100644
index 0000000..a82c913
--- /dev/null
+++ b/stubdom/vtpmmgr/log.c
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "tcg.h"
+
+char *module_names[] = { "",
+                                "TPM",
+                                "TPM",
+                                "VTPM",
+                                "VTPM",
+                                "TXDATA",
+                              };
+// Helper code for the consts, eg. to produce messages for error codes.
+
+typedef struct error_code_entry_t {
+  TPM_RESULT code;
+  char * code_name;
+  char * msg;
+} error_code_entry_t;
+
+static const error_code_entry_t error_msgs [] = {
+  { TPM_SUCCESS, "TPM_SUCCESS", "Successful completion of the operation" },
+  { TPM_AUTHFAIL, "TPM_AUTHFAIL", "Authentication failed" },
+  { TPM_BADINDEX, "TPM_BADINDEX", "The index to a PCR, DIR or other register is incorrect" },
+  { TPM_BAD_PARAMETER, "TPM_BAD_PARAMETER", "One or more parameter is bad" },
+  { TPM_AUDITFAILURE, "TPM_AUDITFAILURE", "An operation completed successfully but the auditing of that operation failed." },
+  { TPM_CLEAR_DISABLED, "TPM_CLEAR_DISABLED", "The clear disable flag is set and all clear operations now require physical access" },
+  { TPM_DEACTIVATED, "TPM_DEACTIVATED", "The TPM is deactivated" },
+  { TPM_DISABLED, "TPM_DISABLED", "The TPM is disabled" },
+  { TPM_DISABLED_CMD, "TPM_DISABLED_CMD", "The target command has been disabled" },
+  { TPM_FAIL, "TPM_FAIL", "The operation failed" },
+  { TPM_BAD_ORDINAL, "TPM_BAD_ORDINAL", "The ordinal was unknown or inconsistent" },
+  { TPM_INSTALL_DISABLED, "TPM_INSTALL_DISABLED", "The ability to install an owner is disabled" },
+  { TPM_INVALID_KEYHANDLE, "TPM_INVALID_KEYHANDLE", "The key handle presented was invalid" },
+  { TPM_KEYNOTFOUND, "TPM_KEYNOTFOUND", "The target key was not found" },
+  { TPM_INAPPROPRIATE_ENC, "TPM_INAPPROPRIATE_ENC", "Unacceptable encryption scheme" },
+  { TPM_MIGRATEFAIL, "TPM_MIGRATEFAIL", "Migration authorization failed" },
+  { TPM_INVALID_PCR_INFO, "TPM_INVALID_PCR_INFO", "PCR information could not be interpreted" },
+  { TPM_NOSPACE, "TPM_NOSPACE", "No room to load key." },
+  { TPM_NOSRK, "TPM_NOSRK", "There is no SRK set" },
+  { TPM_NOTSEALED_BLOB, "TPM_NOTSEALED_BLOB", "An encrypted blob is invalid or was not created by this TPM" },
+  { TPM_OWNER_SET, "TPM_OWNER_SET", "There is already an Owner" },
+  { TPM_RESOURCES, "TPM_RESOURCES", "The TPM has insufficient internal resources to perform the requested action." },
+  { TPM_SHORTRANDOM, "TPM_SHORTRANDOM", "A random string was too short" },
+  { TPM_SIZE, "TPM_SIZE", "The TPM does not have the space to perform the operation." },
+  { TPM_WRONGPCRVAL, "TPM_WRONGPCRVAL", "The named PCR value does not match the current PCR value." },
+  { TPM_BAD_PARAM_SIZE, "TPM_BAD_PARAM_SIZE", "The paramSize argument to the command has the incorrect value" },
+  { TPM_SHA_THREAD, "TPM_SHA_THREAD", "There is no existing SHA-1 thread." },
+  { TPM_SHA_ERROR, "TPM_SHA_ERROR", "The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error." },
+  { TPM_FAILEDSELFTEST, "TPM_FAILEDSELFTEST", "Self-test has failed and the TPM has shutdown." },
+  { TPM_AUTH2FAIL, "TPM_AUTH2FAIL", "The authorization for the second key in a 2 key function failed authorization" },
+  { TPM_BADTAG, "TPM_BADTAG", "The tag value sent to for a command is invalid" },
+  { TPM_IOERROR, "TPM_IOERROR", "An IO error occurred transmitting information to the TPM" },
+  { TPM_ENCRYPT_ERROR, "TPM_ENCRYPT_ERROR", "The encryption process had a problem." },
+  { TPM_DECRYPT_ERROR, "TPM_DECRYPT_ERROR", "The decryption process did not complete." },
+  { TPM_INVALID_AUTHHANDLE, "TPM_INVALID_AUTHHANDLE", "An invalid handle was used." },
+  { TPM_NO_ENDORSEMENT, "TPM_NO_ENDORSEMENT", "The TPM does not a EK installed" },
+  { TPM_INVALID_KEYUSAGE, "TPM_INVALID_KEYUSAGE", "The usage of a key is not allowed" },
+  { TPM_WRONG_ENTITYTYPE, "TPM_WRONG_ENTITYTYPE", "The submitted entity type is not allowed" },
+  { TPM_INVALID_POSTINIT, "TPM_INVALID_POSTINIT", "The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup" },
+  { TPM_INAPPROPRIATE_SIG, "TPM_INAPPROPRIATE_SIG", "Signed data cannot include additional DER information" },
+  { TPM_BAD_KEY_PROPERTY, "TPM_BAD_KEY_PROPERTY", "The key properties in TPM_KEY_PARMs are not supported by this TPM" },
+
+  { TPM_BAD_MIGRATION, "TPM_BAD_MIGRATION", "The migration properties of this key are incorrect." },
+  { TPM_BAD_SCHEME, "TPM_BAD_SCHEME", "The signature or encryption scheme for this key is incorrect or not permitted in this situation." },
+  { TPM_BAD_DATASIZE, "TPM_BAD_DATASIZE", "The size of the data (or blob) parameter is bad or inconsistent with the referenced key" },
+  { TPM_BAD_MODE, "TPM_BAD_MODE", "A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob." },
+  { TPM_BAD_PRESENCE, "TPM_BAD_PRESENCE", "Either the physicalPresence or physicalPresenceLock bits have the wrong value" },
+  { TPM_BAD_VERSION, "TPM_BAD_VERSION", "The TPM cannot perform this version of the capability" },
+  { TPM_NO_WRAP_TRANSPORT, "TPM_NO_WRAP_TRANSPORT", "The TPM does not allow for wrapped transport sessions" },
+  { TPM_AUDITFAIL_UNSUCCESSFUL, "TPM_AUDITFAIL_UNSUCCESSFUL", "TPM audit construction failed and the underlying command was returning a failure code also" },
+  { TPM_AUDITFAIL_SUCCESSFUL, "TPM_AUDITFAIL_SUCCESSFUL", "TPM audit construction failed and the underlying command was returning success" },
+  { TPM_NOTRESETABLE, "TPM_NOTRESETABLE", "Attempt to reset a PCR register that does not have the resettable attribute" },
+  { TPM_NOTLOCAL, "TPM_NOTLOCAL", "Attempt to reset a PCR register that requires locality and locality modifier not part of command transport" },
+  { TPM_BAD_TYPE, "TPM_BAD_TYPE", "Make identity blob not properly typed" },
+  { TPM_INVALID_RESOURCE, "TPM_INVALID_RESOURCE", "When saving context identified resource type does not match actual resource" },
+  { TPM_NOTFIPS, "TPM_NOTFIPS", "The TPM is attempting to execute a command only available when in FIPS mode" },
+  { TPM_INVALID_FAMILY, "TPM_INVALID_FAMILY", "The command is attempting to use an invalid family ID" },
+  { TPM_NO_NV_PERMISSION, "TPM_NO_NV_PERMISSION", "The permission to manipulate the NV storage is not available" },
+  { TPM_REQUIRES_SIGN, "TPM_REQUIRES_SIGN", "The operation requires a signed command" },
+  { TPM_KEY_NOTSUPPORTED, "TPM_KEY_NOTSUPPORTED", "Wrong operation to load an NV key" },
+  { TPM_AUTH_CONFLICT, "TPM_AUTH_CONFLICT", "NV_LoadKey blob requires both owner and blob authorization" },
+  { TPM_AREA_LOCKED, "TPM_AREA_LOCKED", "The NV area is locked and not writtable" },
+  { TPM_BAD_LOCALITY, "TPM_BAD_LOCALITY", "The locality is incorrect for the attempted operation" },
+  { TPM_READ_ONLY, "TPM_READ_ONLY", "The NV area is read only and can't be written to" },
+  { TPM_PER_NOWRITE, "TPM_PER_NOWRITE", "There is no protection on the write to the NV area" },
+  { TPM_FAMILYCOUNT, "TPM_FAMILYCOUNT", "The family count value does not match" },
+  { TPM_WRITE_LOCKED, "TPM_WRITE_LOCKED", "The NV area has already been written to" },
+  { TPM_BAD_ATTRIBUTES, "TPM_BAD_ATTRIBUTES", "The NV area attributes conflict" },
+  { TPM_INVALID_STRUCTURE, "TPM_INVALID_STRUCTURE", "The structure tag and version are invalid or inconsistent" },
+  { TPM_KEY_OWNER_CONTROL, "TPM_KEY_OWNER_CONTROL", "The key is under control of the TPM Owner and can only be evicted by the TPM Owner." },
+  { TPM_BAD_COUNTER, "TPM_BAD_COUNTER", "The counter handle is incorrect" },
+  { TPM_NOT_FULLWRITE, "TPM_NOT_FULLWRITE", "The write is not a complete write of the area" },
+  { TPM_CONTEXT_GAP, "TPM_CONTEXT_GAP", "The gap between saved context counts is too large" },
+  { TPM_MAXNVWRITES, "TPM_MAXNVWRITES", "The maximum number of NV writes without an owner has been exceeded" },
+  { TPM_NOOPERATOR, "TPM_NOOPERATOR", "No operator authorization value is set" },
+  { TPM_RESOURCEMISSING, "TPM_RESOURCEMISSING", "The resource pointed to by context is not loaded" },
+  { TPM_DELEGATE_LOCK, "TPM_DELEGATE_LOCK", "The delegate administration is locked" },
+  { TPM_DELEGATE_FAMILY, "TPM_DELEGATE_FAMILY", "Attempt to manage a family other then the delegated family" },
+  { TPM_DELEGATE_ADMIN, "TPM_DELEGATE_ADMIN", "Delegation table management not enabled" },
+  { TPM_TRANSPORT_EXCLUSIVE, "TPM_TRANSPORT_EXCLUSIVE", "There was a command executed outside of an exclusive transport session" },
+};
+
+
+// helper function for the error codes:
+const char* tpm_get_error_name (TPM_RESULT code) {
+  // just do a linear scan for now
+  unsigned i;
+  for (i = 0; i < sizeof(error_msgs)/sizeof(error_msgs[0]); i++)
+    if (code == error_msgs[i].code)
+      return error_msgs[i].code_name;
+
+    return("Unknown Error Code");
+}
diff --git a/stubdom/vtpmmgr/log.h b/stubdom/vtpmmgr/log.h
new file mode 100644
index 0000000..5c7abf5
--- /dev/null
+++ b/stubdom/vtpmmgr/log.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __VTPM_LOG_H__
+#define __VTPM_LOG_H__
+
+#include <stdint.h>             // for uint32_t
+#include <stddef.h>             // for pointer NULL
+#include <stdio.h>
+#include "tcg.h"
+
+// =========================== LOGGING ==============================
+
+// the logging module numbers
+#define VTPM_LOG_TPM         1
+#define VTPM_LOG_TPM_DEEP    2
+#define VTPM_LOG_VTPM        3
+#define VTPM_LOG_VTPM_DEEP   4
+#define VTPM_LOG_TXDATA      5
+
+extern char *module_names[];
+
+// Default to standard logging
+#ifndef LOGGING_MODULES
+#define LOGGING_MODULES (BITMASK(VTPM_LOG_VTPM)|BITMASK(VTPM_LOG_TPM))
+#endif
+
+// bit-access macros
+#define BITMASK(idx)      ( 1U << (idx) )
+#define GETBIT(num,idx)   ( ((num) & BITMASK(idx)) >> idx )
+#define SETBIT(num,idx)   (num) |= BITMASK(idx)
+#define CLEARBIT(num,idx) (num) &= ( ~ BITMASK(idx) )
+
+#define vtpmloginfo(module, fmt, args...) \
+  if (GETBIT (LOGGING_MODULES, module) == 1) {				\
+    fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); \
+  }
+
+#define vtpmloginfomore(module, fmt, args...) \
+  if (GETBIT (LOGGING_MODULES, module) == 1) {			      \
+    fprintf (stdout, fmt,##args);				      \
+  }
+
+#define vtpmlogerror(module, fmt, args...) \
+  fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
+
+//typedef UINT32 tpm_size_t;
+
+// helper function for the error codes:
+const char* tpm_get_error_name (TPM_RESULT code);
+
+#endif // _VTPM_LOG_H_
diff --git a/stubdom/vtpmmgr/marshal.h b/stubdom/vtpmmgr/marshal.h
new file mode 100644
index 0000000..77d32f0
--- /dev/null
+++ b/stubdom/vtpmmgr/marshal.h
@@ -0,0 +1,528 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef MARSHAL_H
+#define MARSHAL_H
+
+#include <stdlib.h>
+#include <mini-os/byteorder.h>
+#include <mini-os/endian.h>
+#include "tcg.h"
+
+typedef enum UnpackPtr {
+   UNPACK_ALIAS,
+   UNPACK_ALLOC
+} UnpackPtr;
+
+inline BYTE* pack_BYTE(BYTE* ptr, BYTE t) {
+   ptr[0] = t;
+   return ++ptr;
+}
+
+inline BYTE* unpack_BYTE(BYTE* ptr, BYTE* t) {
+   t[0] = ptr[0];
+   return ++ptr;
+}
+
+#define pack_BOOL(p, t) pack_BYTE(p, t)
+#define unpack_BOOL(p, t) unpack_BYTE(p, t)
+
+inline BYTE* pack_UINT16(BYTE* ptr, UINT16 t) {
+   BYTE* b = (BYTE*)&t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   ptr[0] = b[1];
+   ptr[1] = b[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   ptr[0] = b[0];
+   ptr[1] = b[1];
+#endif
+   return ptr + sizeof(UINT16);
+}
+
+inline BYTE* unpack_UINT16(BYTE* ptr, UINT16* t) {
+   BYTE* b = (BYTE*)t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   b[0] = ptr[1];
+   b[1] = ptr[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   b[0] = ptr[0];
+   b[1] = ptr[1];
+#endif
+   return ptr + sizeof(UINT16);
+}
+
+inline BYTE* pack_UINT32(BYTE* ptr, UINT32 t) {
+   BYTE* b = (BYTE*)&t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   ptr[3] = b[0];
+   ptr[2] = b[1];
+   ptr[1] = b[2];
+   ptr[0] = b[3];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   ptr[0] = b[0];
+   ptr[1] = b[1];
+   ptr[2] = b[2];
+   ptr[3] = b[3];
+#endif
+   return ptr + sizeof(UINT32);
+}
+
+inline BYTE* unpack_UINT32(BYTE* ptr, UINT32* t) {
+   BYTE* b = (BYTE*)t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   b[0] = ptr[3];
+   b[1] = ptr[2];
+   b[2] = ptr[1];
+   b[3] = ptr[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   b[0] = ptr[0];
+   b[1] = ptr[1];
+   b[2] = ptr[2];
+   b[3] = ptr[3];
+#endif
+   return ptr + sizeof(UINT32);
+}
+
+#define pack_TPM_RESULT(p, t) pack_UINT32(p, t)
+#define pack_TPM_PCRINDEX(p, t) pack_UINT32(p, t)
+#define pack_TPM_DIRINDEX(p, t) pack_UINT32(p, t)
+#define pack_TPM_HANDLE(p, t) pack_UINT32(p, t)
+#define pack_TPM_AUTHHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_HASHHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_HMACHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_ENCHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TPM_KEY_HANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_ENTITYHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TPM_RESOURCE_TYPE(p, t) pack_UINT32(p, t)
+#define pack_TPM_COMMAND_CODE(p, t) pack_UINT32(p, t)
+#define pack_TPM_PROTOCOL_ID(p, t) pack_UINT16(p, t)
+#define pack_TPM_AUTH_DATA_USAGE(p, t) pack_BYTE(p, t)
+#define pack_TPM_ENTITY_TYPE(p, t) pack_UINT16(p, t)
+#define pack_TPM_ALGORITHM_ID(p, t) pack_UINT32(p, t)
+#define pack_TPM_KEY_USAGE(p, t) pack_UINT16(p, t)
+#define pack_TPM_STARTUP_TYPE(p, t) pack_UINT16(p, t)
+#define pack_TPM_CAPABILITY_AREA(p, t) pack_UINT32(p, t)
+#define pack_TPM_ENC_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_SIG_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_MIGRATE_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_PHYSICAL_PRESENCE(p, t) pack_UINT16(p, t)
+#define pack_TPM_KEY_FLAGS(p, t) pack_UINT32(p, t)
+
+#define unpack_TPM_RESULT(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_PCRINDEX(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_DIRINDEX(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_HANDLE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_AUTHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_HASHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_HMACHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_ENCHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TPM_KEY_HANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_ENTITYHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TPM_RESOURCE_TYPE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_COMMAND_CODE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_PROTOCOL_ID(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_AUTH_DATA_USAGE(p, t) unpack_BYTE(p, t)
+#define unpack_TPM_ENTITY_TYPE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_ALGORITHM_ID(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_KEY_USAGE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_STARTUP_TYPE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_CAPABILITY_AREA(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_ENC_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_SIG_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_MIGRATE_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_PHYSICAL_PRESENCE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_KEY_FLAGS(p, t) unpack_UINT32(p, t)
+
+#define pack_TPM_AUTH_HANDLE(p, t) pack_UINT32(p, t);
+#define pack_TCS_CONTEXT_HANDLE(p, t) pack_UINT32(p, t);
+#define pack_TCS_KEY_HANDLE(p, t) pack_UINT32(p, t);
+
+#define unpack_TPM_AUTH_HANDLE(p, t) unpack_UINT32(p, t);
+#define unpack_TCS_CONTEXT_HANDLE(p, t) unpack_UINT32(p, t);
+#define unpack_TCS_KEY_HANDLE(p, t) unpack_UINT32(p, t);
+
+inline BYTE* pack_BUFFER(BYTE* ptr, const BYTE* buf, UINT32 size) {
+   memcpy(ptr, buf, size);
+   return ptr + size;
+}
+
+inline BYTE* unpack_BUFFER(BYTE* ptr, BYTE* buf, UINT32 size) {
+   memcpy(buf, ptr, size);
+   return ptr + size;
+}
+
+inline BYTE* unpack_ALIAS(BYTE* ptr, BYTE** buf, UINT32 size) {
+   *buf = ptr;
+   return ptr + size;
+}
+
+inline BYTE* unpack_ALLOC(BYTE* ptr, BYTE** buf, UINT32 size) {
+   if(size) {
+      *buf = malloc(size);
+      memcpy(*buf, ptr, size);
+   } else {
+      *buf = NULL;
+   }
+   return ptr + size;
+}
+
+inline BYTE* unpack_PTR(BYTE* ptr, BYTE** buf, UINT32 size, UnpackPtr alloc) {
+   if(alloc == UNPACK_ALLOC) {
+      return unpack_ALLOC(ptr, buf, size);
+   } else {
+      return unpack_ALIAS(ptr, buf, size);
+   }
+}
+
+inline BYTE* pack_TPM_AUTHDATA(BYTE* ptr, const TPM_AUTHDATA* d) {
+   return pack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_AUTHDATA(BYTE* ptr, TPM_AUTHDATA* d) {
+   return unpack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
+}
+
+#define pack_TPM_SECRET(p, t) pack_TPM_AUTHDATA(p, t)
+#define pack_TPM_ENCAUTH(p, t) pack_TPM_AUTHDATA(p, t)
+#define pack_TPM_PAYLOAD_TYPE(p, t) pack_BYTE(p, t)
+#define pack_TPM_TAG(p, t) pack_UINT16(p, t)
+#define pack_TPM_STRUCTURE_TAG(p, t) pack_UINT16(p, t)
+
+#define unpack_TPM_SECRET(p, t) unpack_TPM_AUTHDATA(p, t)
+#define unpack_TPM_ENCAUTH(p, t) unpack_TPM_AUTHDATA(p, t)
+#define unpack_TPM_PAYLOAD_TYPE(p, t) unpack_BYTE(p, t)
+#define unpack_TPM_TAG(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_STRUCTURE_TAG(p, t) unpack_UINT16(p, t)
+
+inline BYTE* pack_TPM_VERSION(BYTE* ptr, const TPM_VERSION* t) {
+   ptr[0] = t->major;
+   ptr[1] = t->minor;
+   ptr[2] = t->revMajor;
+   ptr[3] = t->revMinor;
+   return ptr + 4;
+}
+
+inline BYTE* unpack_TPM_VERSION(BYTE* ptr, TPM_VERSION* t) {
+   t->major = ptr[0];
+   t->minor = ptr[1];
+   t->revMajor = ptr[2];
+   t->revMinor = ptr[3];
+   return ptr + 4;
+}
+
+inline BYTE* pack_TPM_CAP_VERSION_INFO(BYTE* ptr, const TPM_CAP_VERSION_INFO* v) {
+   ptr = pack_TPM_STRUCTURE_TAG(ptr, v->tag);
+   ptr = pack_TPM_VERSION(ptr, &v->version);
+   ptr = pack_UINT16(ptr, v->specLevel);
+   ptr = pack_BYTE(ptr, v->errataRev);
+   ptr = pack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));
+   ptr = pack_UINT16(ptr, v->vendorSpecificSize);
+   ptr = pack_BUFFER(ptr, v->vendorSpecific, v->vendorSpecificSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_CAP_VERSION_INFO(BYTE* ptr, TPM_CAP_VERSION_INFO* v, UnpackPtr alloc) {
+   ptr = unpack_TPM_STRUCTURE_TAG(ptr, &v->tag);
+   ptr = unpack_TPM_VERSION(ptr, &v->version);
+   ptr = unpack_UINT16(ptr, &v->specLevel);
+   ptr = unpack_BYTE(ptr, &v->errataRev);
+   ptr = unpack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));
+   ptr = unpack_UINT16(ptr, &v->vendorSpecificSize);
+   ptr = unpack_PTR(ptr, &v->vendorSpecific, v->vendorSpecificSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_DIGEST(BYTE* ptr, const TPM_DIGEST* d) {
+   return pack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_DIGEST(BYTE* ptr, TPM_DIGEST* d) {
+   return unpack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
+}
+
+#define pack_TPM_PCRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_PCRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_COMPOSITE_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_COMPOSITE_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_DIRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_DIRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_HMAC(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_HMAC(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_CHOSENID_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_CHOSENID_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+inline BYTE* pack_TPM_NONCE(BYTE* ptr, const TPM_NONCE* n) {
+   return pack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_NONCE(BYTE* ptr, TPM_NONCE* n) {
+   return unpack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* pack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, const TPM_SYMMETRIC_KEY_PARMS* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_UINT32(ptr, k->blockSize);
+   ptr = pack_UINT32(ptr, k->ivSize);
+   return pack_BUFFER(ptr, k->IV, k->ivSize);
+}
+
+inline BYTE* unpack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, TPM_SYMMETRIC_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_UINT32(ptr, &k->blockSize);
+   ptr = unpack_UINT32(ptr, &k->ivSize);
+   return unpack_PTR(ptr, &k->IV, k->ivSize, alloc);
+}
+
+inline BYTE* pack_TPM_RSA_KEY_PARMS(BYTE* ptr, const TPM_RSA_KEY_PARMS* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_UINT32(ptr, k->numPrimes);
+   ptr = pack_UINT32(ptr, k->exponentSize);
+   return pack_BUFFER(ptr, k->exponent, k->exponentSize);
+}
+
+inline BYTE* unpack_TPM_RSA_KEY_PARMS(BYTE* ptr, TPM_RSA_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_UINT32(ptr, &k->numPrimes);
+   ptr = unpack_UINT32(ptr, &k->exponentSize);
+   return unpack_PTR(ptr, &k->exponent, k->exponentSize, alloc);
+}
+
+inline BYTE* pack_TPM_KEY_PARMS(BYTE* ptr, const TPM_KEY_PARMS* k) {
+   ptr = pack_TPM_ALGORITHM_ID(ptr, k->algorithmID);
+   ptr = pack_TPM_ENC_SCHEME(ptr, k->encScheme);
+   ptr = pack_TPM_SIG_SCHEME(ptr, k->sigScheme);
+   ptr = pack_UINT32(ptr, k->parmSize);
+
+   if(k->parmSize) {
+      switch(k->algorithmID) {
+         case TPM_ALG_RSA:
+            return pack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa);
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            return pack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym);
+      }
+   }
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_KEY_PARMS(BYTE* ptr, TPM_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_ALGORITHM_ID(ptr, &k->algorithmID);
+   ptr = unpack_TPM_ENC_SCHEME(ptr, &k->encScheme);
+   ptr = unpack_TPM_SIG_SCHEME(ptr, &k->sigScheme);
+   ptr = unpack_UINT32(ptr, &k->parmSize);
+
+   if(k->parmSize) {
+      switch(k->algorithmID) {
+         case TPM_ALG_RSA:
+            return unpack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa, alloc);
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            return unpack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym, alloc);
+      }
+   }
+   return ptr;
+}
+
+inline BYTE* pack_TPM_STORE_PUBKEY(BYTE* ptr, const TPM_STORE_PUBKEY* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_BUFFER(ptr, k->key, k->keyLength);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_STORE_PUBKEY(BYTE* ptr, TPM_STORE_PUBKEY* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_PTR(ptr, &k->key, k->keyLength, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PUBKEY(BYTE* ptr, const TPM_PUBKEY* k) {
+   ptr = pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
+   return pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
+}
+
+inline BYTE* unpack_TPM_PUBKEY(BYTE* ptr, TPM_PUBKEY* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
+   return unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
+}
+
+inline BYTE* pack_TPM_PCR_SELECTION(BYTE* ptr, const TPM_PCR_SELECTION* p) {
+   ptr = pack_UINT16(ptr, p->sizeOfSelect);
+   ptr = pack_BUFFER(ptr, p->pcrSelect, p->sizeOfSelect);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_SELECTION(BYTE* ptr, TPM_PCR_SELECTION* p, UnpackPtr alloc) {
+   ptr = unpack_UINT16(ptr, &p->sizeOfSelect);
+   ptr = unpack_PTR(ptr, &p->pcrSelect, p->sizeOfSelect, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PCR_INFO(BYTE* ptr, const TPM_PCR_INFO* p) {
+   ptr = pack_TPM_PCR_SELECTION(ptr, &p->pcrSelection);
+   ptr = pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
+   ptr = pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_INFO(BYTE* ptr, TPM_PCR_INFO* p, UnpackPtr alloc) {
+   ptr = unpack_TPM_PCR_SELECTION(ptr, &p->pcrSelection, alloc);
+   ptr = unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
+   ptr = unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PCR_COMPOSITE(BYTE* ptr, const TPM_PCR_COMPOSITE* p) {
+   ptr = pack_TPM_PCR_SELECTION(ptr, &p->select);
+   ptr = pack_UINT32(ptr, p->valueSize);
+   ptr = pack_BUFFER(ptr, (const BYTE*)p->pcrValue, p->valueSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_COMPOSITE(BYTE* ptr, TPM_PCR_COMPOSITE* p, UnpackPtr alloc) {
+   ptr = unpack_TPM_PCR_SELECTION(ptr, &p->select, alloc);
+   ptr = unpack_UINT32(ptr, &p->valueSize);
+   ptr = unpack_PTR(ptr, (BYTE**)&p->pcrValue, p->valueSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_KEY(BYTE* ptr, const TPM_KEY* k) {
+   ptr = pack_TPM_VERSION(ptr, &k->ver);
+   ptr = pack_TPM_KEY_USAGE(ptr, k->keyUsage);
+   ptr = pack_TPM_KEY_FLAGS(ptr, k->keyFlags);
+   ptr = pack_TPM_AUTH_DATA_USAGE(ptr, k->authDataUsage);
+   ptr = pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
+   ptr = pack_UINT32(ptr, k->PCRInfoSize);
+   if(k->PCRInfoSize) {
+      ptr = pack_TPM_PCR_INFO(ptr, &k->PCRInfo);
+   }
+   ptr = pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
+   ptr = pack_UINT32(ptr, k->encDataSize);
+   return pack_BUFFER(ptr, k->encData, k->encDataSize);
+}
+
+inline BYTE* unpack_TPM_KEY(BYTE* ptr, TPM_KEY* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &k->ver);
+   ptr = unpack_TPM_KEY_USAGE(ptr, &k->keyUsage);
+   ptr = unpack_TPM_KEY_FLAGS(ptr, &k->keyFlags);
+   ptr = unpack_TPM_AUTH_DATA_USAGE(ptr, &k->authDataUsage);
+   ptr = unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
+   ptr = unpack_UINT32(ptr, &k->PCRInfoSize);
+   if(k->PCRInfoSize) {
+      ptr = unpack_TPM_PCR_INFO(ptr, &k->PCRInfo, alloc);
+   }
+   ptr = unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
+   ptr = unpack_UINT32(ptr, &k->encDataSize);
+   return unpack_PTR(ptr, &k->encData, k->encDataSize, alloc);
+}
+
+inline BYTE* pack_TPM_BOUND_DATA(BYTE* ptr, const TPM_BOUND_DATA* b, UINT32 payloadSize) {
+   ptr = pack_TPM_VERSION(ptr, &b->ver);
+   ptr = pack_TPM_PAYLOAD_TYPE(ptr, b->payload);
+   return pack_BUFFER(ptr, b->payloadData, payloadSize);
+}
+
+inline BYTE* unpack_TPM_BOUND_DATA(BYTE* ptr, TPM_BOUND_DATA* b, UINT32 payloadSize, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &b->ver);
+   ptr = unpack_TPM_PAYLOAD_TYPE(ptr, &b->payload);
+   return unpack_PTR(ptr, &b->payloadData, payloadSize, alloc);
+}
+
+inline BYTE* pack_TPM_STORED_DATA(BYTE* ptr, const TPM_STORED_DATA* d) {
+   ptr = pack_TPM_VERSION(ptr, &d->ver);
+   ptr = pack_UINT32(ptr, d->sealInfoSize);
+   if(d->sealInfoSize) {
+      ptr = pack_TPM_PCR_INFO(ptr, &d->sealInfo);
+   }
+   ptr = pack_UINT32(ptr, d->encDataSize);
+   ptr = pack_BUFFER(ptr, d->encData, d->encDataSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_STORED_DATA(BYTE* ptr, TPM_STORED_DATA* d, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &d->ver);
+   ptr = unpack_UINT32(ptr, &d->sealInfoSize);
+   if(d->sealInfoSize) {
+      ptr = unpack_TPM_PCR_INFO(ptr, &d->sealInfo, alloc);
+   }
+   ptr = unpack_UINT32(ptr, &d->encDataSize);
+   ptr = unpack_PTR(ptr, &d->encData, d->encDataSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_AUTH_SESSION(BYTE* ptr, const TPM_AUTH_SESSION* auth) {
+   ptr = pack_TPM_AUTH_HANDLE(ptr, auth->AuthHandle);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+   ptr = pack_TPM_AUTHDATA(ptr, &auth->HMAC);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_AUTH_SESSION(BYTE* ptr, TPM_AUTH_SESSION* auth) {
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = unpack_BOOL(ptr, &auth->fContinueAuthSession);
+   ptr = unpack_TPM_AUTHDATA(ptr, &auth->HMAC);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_RQU_HEADER(BYTE* ptr,
+      TPM_TAG tag,
+      UINT32 size,
+      TPM_COMMAND_CODE ord) {
+   ptr = pack_UINT16(ptr, tag);
+   ptr = pack_UINT32(ptr, size);
+   return pack_UINT32(ptr, ord);
+}
+
+inline BYTE* unpack_TPM_RQU_HEADER(BYTE* ptr,
+      TPM_TAG* tag,
+      UINT32* size,
+      TPM_COMMAND_CODE* ord) {
+   ptr = unpack_UINT16(ptr, tag);
+   ptr = unpack_UINT32(ptr, size);
+   ptr = unpack_UINT32(ptr, ord);
+   return ptr;
+}
+
+#define pack_TPM_RSP_HEADER(p, t, s, r) pack_TPM_RQU_HEADER(p, t, s, r);
+#define unpack_TPM_RSP_HEADER(p, t, s, r) unpack_TPM_RQU_HEADER(p, t, s, r);
+
+#endif
diff --git a/stubdom/vtpmmgr/minios.cfg b/stubdom/vtpmmgr/minios.cfg
new file mode 100644
index 0000000..3fb383d
--- /dev/null
+++ b/stubdom/vtpmmgr/minios.cfg
@@ -0,0 +1,14 @@
+CONFIG_TPMFRONT=y
+CONFIG_TPM_TIS=y
+CONFIG_TPMBACK=y
+CONFIG_START_NETWORK=n
+CONFIG_TEST=n
+CONFIG_PCIFRONT=n
+CONFIG_BLKFRONT=y
+CONFIG_NETFRONT=n
+CONFIG_FBFRONT=n
+CONFIG_KBDFRONT=n
+CONFIG_CONSFRONT=n
+CONFIG_XENBUS=y
+CONFIG_LWIP=n
+CONFIG_XC=n
diff --git a/stubdom/vtpmmgr/tcg.h b/stubdom/vtpmmgr/tcg.h
new file mode 100644
index 0000000..7687eae
--- /dev/null
+++ b/stubdom/vtpmmgr/tcg.h
@@ -0,0 +1,707 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005 Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __TCG_H__
+#define __TCG_H__
+
+#include <stdlib.h>
+#include <stdint.h>
+
+// **************************** CONSTANTS *********************************
+
+// BOOL values
+#define TRUE 0x01
+#define FALSE 0x00
+
+#define TCPA_MAX_BUFFER_LENGTH 0x2000
+
+//
+// TPM_COMMAND_CODE values
+#define TPM_PROTECTED_ORDINAL 0x00000000UL
+#define TPM_UNPROTECTED_ORDINAL 0x80000000UL
+#define TPM_CONNECTION_ORDINAL 0x40000000UL
+#define TPM_VENDOR_ORDINAL 0x20000000UL
+
+#define TPM_ORD_OIAP                     (10UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OSAP                     (11UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuth               (12UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_TakeOwnership            (13UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthAsymStart      (14UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthAsymFinish     (15UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthOwner          (16UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Extend                   (20UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PcrRead                  (21UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Quote                    (22UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Seal                     (23UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Unseal                   (24UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DirWriteAuth             (25UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DirRead                  (26UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_UnBind                   (30UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateWrapKey            (31UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadKey                  (32UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetPubKey                (33UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_EvictKey                 (34UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateMigrationBlob      (40UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReWrapKey                (41UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ConvertMigrationBlob     (42UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_AuthorizeMigrationKey    (43UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateMaintenanceArchive (44UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadMaintenanceArchive   (45UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_KillMaintenanceFeature   (46UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadManuMaintPub         (47UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadManuMaintPub         (48UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CertifyKey               (50UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Sign                     (60UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetRandom                (70UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_StirRandom               (71UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SelfTestFull             (80UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SelfTestStartup          (81UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CertifySelfTest          (82UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ContinueSelfTest         (83UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetTestResult            (84UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Reset                    (90UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerClear               (91UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisableOwnerClear        (92UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ForceClear               (93UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisableForceClear        (94UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapabilitySigned      (100UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapability            (101UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapabilityOwner       (102UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerSetDisable          (110UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalEnable           (111UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalDisable          (112UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetOwnerInstall          (113UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalSetDeactivated   (114UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetTempDeactivated       (115UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateEndorsementKeyPair (120UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_MakeIdentity             (121UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ActivateIdentity         (122UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadPubek                (124UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerReadPubek           (125UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisablePubekRead         (126UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetAuditEvent            (130UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetAuditEventSigned      (131UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetOrdinalAuditStatus    (140UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetOrdinalAuditStatus    (141UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Terminate_Handle         (150UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Init                     (151UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveState                (152UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Startup                  (153UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetRedirection           (154UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Start                (160UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Update               (161UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Complete             (162UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1CompleteExtend       (163UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_FieldUpgrade             (170UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveKeyContext           (180UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadKeyContext           (181UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveAuthContext          (182UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadAuthContext          (183UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveContext                      (184UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadContext                      (185UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_FlushSpecific                    (186UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PCR_Reset                        (200UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_DefineSpace                   (204UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_WriteValue                    (205UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_WriteValueAuth                (206UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_ReadValue                     (207UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_ReadValueAuth                 (208UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_UpdateVerification      (209UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_Manage                  (210UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_CreateKeyDelegation     (212UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_CreateOwnerDelegation   (213UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_VerifyDelegation        (214UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_LoadOwnerDelegation     (216UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_ReadAuth                (217UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_ReadTable               (219UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateCounter                    (220UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_IncrementCounter                 (221UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadCounter                      (222UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseCounter                   (223UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseCounterOwner              (224UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_EstablishTransport               (230UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ExecuteTransport                 (231UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseTransportSigned           (232UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetTicks                         (241UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_TickStampBlob                    (242UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_MAX                              (256UL + TPM_PROTECTED_ORDINAL)
+
+#define TSC_ORD_PhysicalPresence         (10UL + TPM_CONNECTION_ORDINAL)
+
+
+
+//
+// TPM_RESULT values
+//
+// just put in the whole table from spec 1.2
+
+#define TPM_BASE   0x0 // The start of TPM return codes
+#define TPM_VENDOR_ERROR 0x00000400 // Mask to indicate that the error code is vendor specific for vendor specific commands
+#define TPM_NON_FATAL  0x00000800 // Mask to indicate that the error code is a non-fatal failure.
+
+#define TPM_SUCCESS   TPM_BASE // Successful completion of the operation
+#define TPM_AUTHFAIL      TPM_BASE + 1 // Authentication failed
+#define TPM_BADINDEX      TPM_BASE + 2 // The index to a PCR, DIR or other register is incorrect
+#define TPM_BAD_PARAMETER     TPM_BASE + 3 // One or more parameter is bad
+#define TPM_AUDITFAILURE     TPM_BASE + 4 // An operation completed successfully but the auditing of that operation failed.
+#define TPM_CLEAR_DISABLED     TPM_BASE + 5 // The clear disable flag is set and all clear operations now require physical access
+#define TPM_DEACTIVATED     TPM_BASE + 6 // The TPM is deactivated
+#define TPM_DISABLED      TPM_BASE + 7 // The TPM is disabled
+#define TPM_DISABLED_CMD     TPM_BASE + 8 // The target command has been disabled
+#define TPM_FAIL       TPM_BASE + 9 // The operation failed
+#define TPM_BAD_ORDINAL     TPM_BASE + 10 // The ordinal was unknown or inconsistent
+#define TPM_INSTALL_DISABLED   TPM_BASE + 11 // The ability to install an owner is disabled
+#define TPM_INVALID_KEYHANDLE  TPM_BASE + 12 // The key handle presented was invalid
+#define TPM_KEYNOTFOUND     TPM_BASE + 13 // The target key was not found
+#define TPM_INAPPROPRIATE_ENC  TPM_BASE + 14 // Unacceptable encryption scheme
+#define TPM_MIGRATEFAIL     TPM_BASE + 15 // Migration authorization failed
+#define TPM_INVALID_PCR_INFO   TPM_BASE + 16 // PCR information could not be interpreted
+#define TPM_NOSPACE      TPM_BASE + 17 // No room to load key.
+#define TPM_NOSRK       TPM_BASE + 18 // There is no SRK set
+#define TPM_NOTSEALED_BLOB     TPM_BASE + 19 // An encrypted blob is invalid or was not created by this TPM
+#define TPM_OWNER_SET      TPM_BASE + 20 // There is already an Owner
+#define TPM_RESOURCES      TPM_BASE + 21 // The TPM has insufficient internal resources to perform the requested action.
+#define TPM_SHORTRANDOM     TPM_BASE + 22 // A random string was too short
+#define TPM_SIZE       TPM_BASE + 23 // The TPM does not have the space to perform the operation.
+#define TPM_WRONGPCRVAL     TPM_BASE + 24 // The named PCR value does not match the current PCR value.
+#define TPM_BAD_PARAM_SIZE     TPM_BASE + 25 // The paramSize argument to the command has the incorrect value
+#define TPM_SHA_THREAD      TPM_BASE + 26 // There is no existing SHA-1 thread.
+#define TPM_SHA_ERROR      TPM_BASE + 27 // The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error.
+#define TPM_FAILEDSELFTEST     TPM_BASE + 28 // Self-test has failed and the TPM has shutdown.
+#define TPM_AUTH2FAIL      TPM_BASE + 29 // The authorization for the second key in a 2 key function failed authorization
+#define TPM_BADTAG       TPM_BASE + 30 // The tag value sent to for a command is invalid
+#define TPM_IOERROR      TPM_BASE + 31 // An IO error occurred transmitting information to the TPM
+#define TPM_ENCRYPT_ERROR     TPM_BASE + 32 // The encryption process had a problem.
+#define TPM_DECRYPT_ERROR     TPM_BASE + 33 // The decryption process did not complete.
+#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 // An invalid handle was used.
+#define TPM_NO_ENDORSEMENT     TPM_BASE + 35 // The TPM does not a EK installed
+#define TPM_INVALID_KEYUSAGE   TPM_BASE + 36 // The usage of a key is not allowed
+#define TPM_WRONG_ENTITYTYPE   TPM_BASE + 37 // The submitted entity type is not allowed
+#define TPM_INVALID_POSTINIT   TPM_BASE + 38 // The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup
+#define TPM_INAPPROPRIATE_SIG  TPM_BASE + 39 // Signed data cannot include additional DER information
+#define TPM_BAD_KEY_PROPERTY   TPM_BASE + 40 // The key properties in TPM_KEY_PARMs are not supported by this TPM
+
+#define TPM_BAD_MIGRATION      TPM_BASE + 41 // The migration properties of this key are incorrect.
+#define TPM_BAD_SCHEME       TPM_BASE + 42 // The signature or encryption scheme for this key is incorrect or not permitted in this situation.
+#define TPM_BAD_DATASIZE      TPM_BASE + 43 // The size of the data (or blob) parameter is bad or inconsistent with the referenced key
+#define TPM_BAD_MODE       TPM_BASE + 44 // A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob.
+#define TPM_BAD_PRESENCE      TPM_BASE + 45 // Either the physicalPresence or physicalPresenceLock bits have the wrong value
+#define TPM_BAD_VERSION      TPM_BASE + 46 // The TPM cannot perform this version of the capability
+#define TPM_NO_WRAP_TRANSPORT     TPM_BASE + 47 // The TPM does not allow for wrapped transport sessions
+#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 // TPM audit construction failed and the underlying command was returning a failure code also
+#define TPM_AUDITFAIL_SUCCESSFUL   TPM_BASE + 49 // TPM audit construction failed and the underlying command was returning success
+#define TPM_NOTRESETABLE      TPM_BASE + 50 // Attempt to reset a PCR register that does not have the resettable attribute
+#define TPM_NOTLOCAL       TPM_BASE + 51 // Attempt to reset a PCR register that requires locality and locality modifier not part of command transport
+#define TPM_BAD_TYPE       TPM_BASE + 52 // Make identity blob not properly typed
+#define TPM_INVALID_RESOURCE     TPM_BASE + 53 // When saving context identified resource type does not match actual resource
+#define TPM_NOTFIPS       TPM_BASE + 54 // The TPM is attempting to execute a command only available when in FIPS mode
+#define TPM_INVALID_FAMILY      TPM_BASE + 55 // The command is attempting to use an invalid family ID
+#define TPM_NO_NV_PERMISSION     TPM_BASE + 56 // The permission to manipulate the NV storage is not available
+#define TPM_REQUIRES_SIGN      TPM_BASE + 57 // The operation requires a signed command
+#define TPM_KEY_NOTSUPPORTED     TPM_BASE + 58 // Wrong operation to load an NV key
+#define TPM_AUTH_CONFLICT      TPM_BASE + 59 // NV_LoadKey blob requires both owner and blob authorization
+#define TPM_AREA_LOCKED      TPM_BASE + 60 // The NV area is locked and not writtable
+#define TPM_BAD_LOCALITY      TPM_BASE + 61 // The locality is incorrect for the attempted operation
+#define TPM_READ_ONLY       TPM_BASE + 62 // The NV area is read only and can't be written to
+#define TPM_PER_NOWRITE      TPM_BASE + 63 // There is no protection on the write to the NV area
+#define TPM_FAMILYCOUNT      TPM_BASE + 64 // The family count value does not match
+#define TPM_WRITE_LOCKED      TPM_BASE + 65 // The NV area has already been written to
+#define TPM_BAD_ATTRIBUTES      TPM_BASE + 66 // The NV area attributes conflict
+#define TPM_INVALID_STRUCTURE     TPM_BASE + 67 // The structure tag and version are invalid or inconsistent
+#define TPM_KEY_OWNER_CONTROL     TPM_BASE + 68 // The key is under control of the TPM Owner and can only be evicted by the TPM Owner.
+#define TPM_BAD_COUNTER      TPM_BASE + 69 // The counter handle is incorrect
+#define TPM_NOT_FULLWRITE      TPM_BASE + 70 // The write is not a complete write of the area
+#define TPM_CONTEXT_GAP      TPM_BASE + 71 // The gap between saved context counts is too large
+#define TPM_MAXNVWRITES      TPM_BASE + 72 // The maximum number of NV writes without an owner has been exceeded
+#define TPM_NOOPERATOR       TPM_BASE + 73 // No operator authorization value is set
+#define TPM_RESOURCEMISSING     TPM_BASE + 74 // The resource pointed to by context is not loaded
+#define TPM_DELEGATE_LOCK      TPM_BASE + 75 // The delegate administration is locked
+#define TPM_DELEGATE_FAMILY     TPM_BASE + 76 // Attempt to manage a family other then the delegated family
+#define TPM_DELEGATE_ADMIN      TPM_BASE + 77 // Delegation table management not enabled
+#define TPM_TRANSPORT_EXCLUSIVE    TPM_BASE + 78 // There was a command executed outside of an exclusive transport session
+
+// TPM_STARTUP_TYPE values
+#define TPM_ST_CLEAR 0x0001
+#define TPM_ST_STATE 0x0002
+#define TPM_ST_DEACTIVATED 0x003
+
+// TPM_TAG values
+#define TPM_TAG_RQU_COMMAND 0x00c1
+#define TPM_TAG_RQU_AUTH1_COMMAND 0x00c2
+#define TPM_TAG_RQU_AUTH2_COMMAND 0x00c3
+#define TPM_TAG_RSP_COMMAND 0x00c4
+#define TPM_TAG_RSP_AUTH1_COMMAND 0x00c5
+#define TPM_TAG_RSP_AUTH2_COMMAND 0x00c6
+
+// TPM_PAYLOAD_TYPE values
+#define TPM_PT_ASYM 0x01
+#define TPM_PT_BIND 0x02
+#define TPM_PT_MIGRATE 0x03
+#define TPM_PT_MAINT 0x04
+#define TPM_PT_SEAL 0x05
+
+// TPM_ENTITY_TYPE values
+#define TPM_ET_KEYHANDLE 0x0001
+#define TPM_ET_OWNER 0x0002
+#define TPM_ET_DATA 0x0003
+#define TPM_ET_SRK 0x0004
+#define TPM_ET_KEY 0x0005
+
+/// TPM_ResourceTypes
+#define TPM_RT_KEY      0x00000001
+#define TPM_RT_AUTH     0x00000002
+#define TPM_RT_HASH     0x00000003
+#define TPM_RT_TRANS    0x00000004
+#define TPM_RT_CONTEXT  0x00000005
+#define TPM_RT_COUNTER  0x00000006
+#define TPM_RT_DELEGATE 0x00000007
+#define TPM_RT_DAA_TPM  0x00000008
+#define TPM_RT_DAA_V0   0x00000009
+#define TPM_RT_DAA_V1   0x0000000A
+
+
+
+// TPM_PROTOCOL_ID values
+#define TPM_PID_OIAP 0x0001
+#define TPM_PID_OSAP 0x0002
+#define TPM_PID_ADIP 0x0003
+#define TPM_PID_ADCP 0x0004
+#define TPM_PID_OWNER 0x0005
+
+// TPM_ALGORITHM_ID values
+#define TPM_ALG_RSA 0x00000001
+#define TPM_ALG_SHA 0x00000004
+#define TPM_ALG_HMAC 0x00000005
+#define TPM_ALG_AES128 0x00000006
+#define TPM_ALG_MFG1 0x00000007
+#define TPM_ALG_AES192 0x00000008
+#define TPM_ALG_AES256 0x00000009
+#define TPM_ALG_XOR 0x0000000A
+
+// TPM_ENC_SCHEME values
+#define TPM_ES_NONE 0x0001
+#define TPM_ES_RSAESPKCSv15 0x0002
+#define TPM_ES_RSAESOAEP_SHA1_MGF1 0x0003
+
+// TPM_SIG_SCHEME values
+#define TPM_SS_NONE 0x0001
+#define TPM_SS_RSASSAPKCS1v15_SHA1 0x0002
+#define TPM_SS_RSASSAPKCS1v15_DER 0x0003
+
+/*
+ * TPM_CAPABILITY_AREA Values for TPM_GetCapability ([TPM_Part2], Section 21.1)
+ */
+#define TPM_CAP_ORD                     0x00000001
+#define TPM_CAP_ALG                     0x00000002
+#define TPM_CAP_PID                     0x00000003
+#define TPM_CAP_FLAG                    0x00000004
+#define TPM_CAP_PROPERTY                0x00000005
+#define TPM_CAP_VERSION                 0x00000006
+#define TPM_CAP_KEY_HANDLE              0x00000007
+#define TPM_CAP_CHECK_LOADED            0x00000008
+#define TPM_CAP_SYM_MODE                0x00000009
+#define TPM_CAP_KEY_STATUS              0x0000000C
+#define TPM_CAP_NV_LIST                 0x0000000D
+#define TPM_CAP_MFR                     0x00000010
+#define TPM_CAP_NV_INDEX                0x00000011
+#define TPM_CAP_TRANS_ALG               0x00000012
+#define TPM_CAP_HANDLE                  0x00000014
+#define TPM_CAP_TRANS_ES                0x00000015
+#define TPM_CAP_AUTH_ENCRYPT            0x00000017
+#define TPM_CAP_SELECT_SIZE             0x00000018
+#define TPM_CAP_DA_LOGIC                0x00000019
+#define TPM_CAP_VERSION_VAL             0x0000001A
+
+/* subCap definitions ([TPM_Part2], Section 21.2) */
+#define TPM_CAP_PROP_PCR                0x00000101
+#define TPM_CAP_PROP_DIR                0x00000102
+#define TPM_CAP_PROP_MANUFACTURER       0x00000103
+#define TPM_CAP_PROP_KEYS               0x00000104
+#define TPM_CAP_PROP_MIN_COUNTER        0x00000107
+#define TPM_CAP_FLAG_PERMANENT          0x00000108
+#define TPM_CAP_FLAG_VOLATILE           0x00000109
+#define TPM_CAP_PROP_AUTHSESS           0x0000010A
+#define TPM_CAP_PROP_TRANSESS           0x0000010B
+#define TPM_CAP_PROP_COUNTERS           0x0000010C
+#define TPM_CAP_PROP_MAX_AUTHSESS       0x0000010D
+#define TPM_CAP_PROP_MAX_TRANSESS       0x0000010E
+#define TPM_CAP_PROP_MAX_COUNTERS       0x0000010F
+#define TPM_CAP_PROP_MAX_KEYS           0x00000110
+#define TPM_CAP_PROP_OWNER              0x00000111
+#define TPM_CAP_PROP_CONTEXT            0x00000112
+#define TPM_CAP_PROP_MAX_CONTEXT        0x00000113
+#define TPM_CAP_PROP_FAMILYROWS         0x00000114
+#define TPM_CAP_PROP_TIS_TIMEOUT        0x00000115
+#define TPM_CAP_PROP_STARTUP_EFFECT     0x00000116
+#define TPM_CAP_PROP_DELEGATE_ROW       0x00000117
+#define TPM_CAP_PROP_MAX_DAASESS        0x00000119
+#define TPM_CAP_PROP_DAASESS            0x0000011A
+#define TPM_CAP_PROP_CONTEXT_DIST       0x0000011B
+#define TPM_CAP_PROP_DAA_INTERRUPT      0x0000011C
+#define TPM_CAP_PROP_SESSIONS           0x0000011D
+#define TPM_CAP_PROP_MAX_SESSIONS       0x0000011E
+#define TPM_CAP_PROP_CMK_RESTRICTION    0x0000011F
+#define TPM_CAP_PROP_DURATION           0x00000120
+#define TPM_CAP_PROP_ACTIVE_COUNTER     0x00000122
+#define TPM_CAP_PROP_MAX_NV_AVAILABLE   0x00000123
+#define TPM_CAP_PROP_INPUT_BUFFER       0x00000124
+
+// TPM_KEY_USAGE values
+#define TPM_KEY_EK 0x0000
+#define TPM_KEY_SIGNING 0x0010
+#define TPM_KEY_STORAGE 0x0011
+#define TPM_KEY_IDENTITY 0x0012
+#define TPM_KEY_AUTHCHANGE 0X0013
+#define TPM_KEY_BIND 0x0014
+#define TPM_KEY_LEGACY 0x0015
+
+// TPM_AUTH_DATA_USAGE values
+#define TPM_AUTH_NEVER 0x00
+#define TPM_AUTH_ALWAYS 0x01
+
+// Key Handle of owner and srk
+#define TPM_OWNER_KEYHANDLE 0x40000001
+#define TPM_SRK_KEYHANDLE 0x40000000
+
+
+
+// *************************** TYPEDEFS *********************************
+typedef unsigned char BYTE;
+typedef unsigned char BOOL;
+typedef uint16_t UINT16;
+typedef uint32_t UINT32;
+typedef uint64_t UINT64;
+
+typedef UINT32 TPM_RESULT;
+typedef UINT32 TPM_PCRINDEX;
+typedef UINT32 TPM_DIRINDEX;
+typedef UINT32 TPM_HANDLE;
+typedef TPM_HANDLE TPM_AUTHHANDLE;
+typedef TPM_HANDLE TCPA_HASHHANDLE;
+typedef TPM_HANDLE TCPA_HMACHANDLE;
+typedef TPM_HANDLE TCPA_ENCHANDLE;
+typedef TPM_HANDLE TPM_KEY_HANDLE;
+typedef TPM_HANDLE TCPA_ENTITYHANDLE;
+typedef UINT32 TPM_RESOURCE_TYPE;
+typedef UINT32 TPM_COMMAND_CODE;
+typedef UINT16 TPM_PROTOCOL_ID;
+typedef BYTE TPM_AUTH_DATA_USAGE;
+typedef UINT16 TPM_ENTITY_TYPE;
+typedef UINT32 TPM_ALGORITHM_ID;
+typedef UINT16 TPM_KEY_USAGE;
+typedef UINT16 TPM_STARTUP_TYPE;
+typedef UINT32 TPM_CAPABILITY_AREA;
+typedef UINT16 TPM_ENC_SCHEME;
+typedef UINT16 TPM_SIG_SCHEME;
+typedef UINT16 TPM_MIGRATE_SCHEME;
+typedef UINT16 TPM_PHYSICAL_PRESENCE;
+typedef UINT32 TPM_KEY_FLAGS;
+
+#define TPM_DIGEST_SIZE 20  // Don't change this
+typedef BYTE TPM_AUTHDATA[TPM_DIGEST_SIZE];
+typedef TPM_AUTHDATA TPM_SECRET;
+typedef TPM_AUTHDATA TPM_ENCAUTH;
+typedef BYTE TPM_PAYLOAD_TYPE;
+typedef UINT16 TPM_TAG;
+typedef UINT16 TPM_STRUCTURE_TAG;
+
+// Data Types of the TCS
+typedef UINT32 TCS_AUTHHANDLE;  // Handle addressing a authorization session
+typedef UINT32 TCS_CONTEXT_HANDLE; // Basic context handle
+typedef UINT32 TCS_KEY_HANDLE;  // Basic key handle
+
+// ************************* STRUCTURES **********************************
+
+typedef struct TPM_VERSION {
+  BYTE major;
+  BYTE minor;
+  BYTE revMajor;
+  BYTE revMinor;
+} TPM_VERSION;
+
+static const TPM_VERSION TPM_STRUCT_VER_1_1 = { 1,1,0,0 };
+
+typedef struct TPM_CAP_VERSION_INFO {
+   TPM_STRUCTURE_TAG tag;
+   TPM_VERSION version;
+   UINT16 specLevel;
+   BYTE errataRev;
+   BYTE tpmVendorID[4];
+   UINT16 vendorSpecificSize;
+   BYTE* vendorSpecific;
+} TPM_CAP_VERSION_INFO;
+
+inline void free_TPM_CAP_VERSION_INFO(TPM_CAP_VERSION_INFO* v) {
+   free(v->vendorSpecific);
+   v->vendorSpecific = NULL;
+}
+
+typedef struct TPM_DIGEST {
+  BYTE digest[TPM_DIGEST_SIZE];
+} TPM_DIGEST;
+
+typedef TPM_DIGEST TPM_PCRVALUE;
+typedef TPM_DIGEST TPM_COMPOSITE_HASH;
+typedef TPM_DIGEST TPM_DIRVALUE;
+typedef TPM_DIGEST TPM_HMAC;
+typedef TPM_DIGEST TPM_CHOSENID_HASH;
+
+typedef struct TPM_NONCE {
+  BYTE nonce[TPM_DIGEST_SIZE];
+} TPM_NONCE;
+
+typedef struct TPM_SYMMETRIC_KEY_PARMS {
+   UINT32 keyLength;
+   UINT32 blockSize;
+   UINT32 ivSize;
+   BYTE* IV;
+} TPM_SYMMETRIC_KEY_PARMS;
+
+inline void free_TPM_SYMMETRIC_KEY_PARMS(TPM_SYMMETRIC_KEY_PARMS* p) {
+   free(p->IV);
+   p->IV = NULL;
+}
+
+#define TPM_SYMMETRIC_KEY_PARMS_INIT { 0, 0, 0, NULL }
+
+typedef struct TPM_RSA_KEY_PARMS {
+  UINT32 keyLength;
+  UINT32 numPrimes;
+  UINT32 exponentSize;
+  BYTE* exponent;
+} TPM_RSA_KEY_PARMS;
+
+#define TPM_RSA_KEY_PARMS_INIT { 0, 0, 0, NULL }
+
+inline void free_TPM_RSA_KEY_PARMS(TPM_RSA_KEY_PARMS* p) {
+   free(p->exponent);
+   p->exponent = NULL;
+}
+
+typedef struct TPM_KEY_PARMS {
+  TPM_ALGORITHM_ID algorithmID;
+  TPM_ENC_SCHEME encScheme;
+  TPM_SIG_SCHEME sigScheme;
+  UINT32 parmSize;
+  union {
+     TPM_SYMMETRIC_KEY_PARMS sym;
+     TPM_RSA_KEY_PARMS rsa;
+  } parms;
+} TPM_KEY_PARMS;
+
+#define TPM_KEY_PARMS_INIT { 0, 0, 0, 0 }
+
+inline void free_TPM_KEY_PARMS(TPM_KEY_PARMS* p) {
+   if(p->parmSize) {
+      switch(p->algorithmID) {
+         case TPM_ALG_RSA:
+            free_TPM_RSA_KEY_PARMS(&p->parms.rsa);
+            break;
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            free_TPM_SYMMETRIC_KEY_PARMS(&p->parms.sym);
+            break;
+      }
+   }
+}
+
+typedef struct TPM_STORE_PUBKEY {
+  UINT32 keyLength;
+  BYTE* key;
+} TPM_STORE_PUBKEY;
+
+#define TPM_STORE_PUBKEY_INIT { 0, NULL }
+
+inline void free_TPM_STORE_PUBKEY(TPM_STORE_PUBKEY* p) {
+   free(p->key);
+   p->key = NULL;
+}
+
+typedef struct TPM_PUBKEY {
+  TPM_KEY_PARMS algorithmParms;
+  TPM_STORE_PUBKEY pubKey;
+} TPM_PUBKEY;
+
+#define TPM_PUBKEY_INIT { TPM_KEY_PARMS_INIT, TPM_STORE_PUBKEY_INIT }
+
+inline void free_TPM_PUBKEY(TPM_PUBKEY* k) {
+   free_TPM_KEY_PARMS(&k->algorithmParms);
+   free_TPM_STORE_PUBKEY(&k->pubKey);
+}
+
+typedef struct TPM_PCR_SELECTION {
+   UINT16 sizeOfSelect;
+   BYTE* pcrSelect;
+} TPM_PCR_SELECTION;
+
+#define TPM_PCR_SELECTION_INIT { 0, NULL }
+
+inline void free_TPM_PCR_SELECTION(TPM_PCR_SELECTION* p) {
+   free(p->pcrSelect);
+   p->pcrSelect = NULL;
+}
+
+typedef struct TPM_PCR_INFO {
+   TPM_PCR_SELECTION pcrSelection;
+   TPM_COMPOSITE_HASH digestAtRelease;
+   TPM_COMPOSITE_HASH digestAtCreation;
+} TPM_PCR_INFO;
+
+#define TPM_PCR_INFO_INIT { TPM_PCR_SELECTION_INIT }
+
+inline void free_TPM_PCR_INFO(TPM_PCR_INFO* p) {
+   free_TPM_PCR_SELECTION(&p->pcrSelection);
+}
+
+typedef struct TPM_PCR_COMPOSITE {
+  TPM_PCR_SELECTION select;
+  UINT32 valueSize;
+  TPM_PCRVALUE* pcrValue;
+} TPM_PCR_COMPOSITE;
+
+#define TPM_PCR_COMPOSITE_INIT { TPM_PCR_SELECTION_INIT, 0, NULL }
+
+inline void free_TPM_PCR_COMPOSITE(TPM_PCR_COMPOSITE* p) {
+   free_TPM_PCR_SELECTION(&p->select);
+   free(p->pcrValue);
+   p->pcrValue = NULL;
+}
+
+typedef struct TPM_KEY {
+  TPM_VERSION         ver;
+  TPM_KEY_USAGE       keyUsage;
+  TPM_KEY_FLAGS       keyFlags;
+  TPM_AUTH_DATA_USAGE authDataUsage;
+  TPM_KEY_PARMS       algorithmParms;
+  UINT32              PCRInfoSize;
+  TPM_PCR_INFO        PCRInfo;
+  TPM_STORE_PUBKEY    pubKey;
+  UINT32              encDataSize;
+  BYTE*               encData;
+} TPM_KEY;
+
+#define TPM_KEY_INIT { .algorithmParms = TPM_KEY_PARMS_INIT,\
+   .PCRInfoSize = 0, .PCRInfo = TPM_PCR_INFO_INIT, \
+   .pubKey = TPM_STORE_PUBKEY_INIT, \
+   .encDataSize = 0, .encData = NULL }
+
+inline void free_TPM_KEY(TPM_KEY* k) {
+   if(k->PCRInfoSize) {
+      free_TPM_PCR_INFO(&k->PCRInfo);
+   }
+   free_TPM_STORE_PUBKEY(&k->pubKey);
+   free(k->encData);
+   k->encData = NULL;
+}
+
+typedef struct TPM_BOUND_DATA {
+  TPM_VERSION ver;
+  TPM_PAYLOAD_TYPE payload;
+  BYTE* payloadData;
+} TPM_BOUND_DATA;
+
+#define TPM_BOUND_DATA_INIT { .payloadData = NULL }
+
+inline void free_TPM_BOUND_DATA(TPM_BOUND_DATA* d) {
+   free(d->payloadData);
+   d->payloadData = NULL;
+}
+
+typedef struct TPM_STORED_DATA {
+  TPM_VERSION ver;
+  UINT32 sealInfoSize;
+  TPM_PCR_INFO sealInfo;
+  UINT32 encDataSize;
+  BYTE* encData;
+} TPM_STORED_DATA;
+
+#define TPM_STORED_DATA_INIT { .sealInfoSize = 0, sealInfo = TPM_PCR_INFO_INIT,\
+   .encDataSize = 0, .encData = NULL }
+
+inline void free_TPM_STORED_DATA(TPM_STORED_DATA* d) {
+   if(d->sealInfoSize) {
+      free_TPM_PCR_INFO(&d->sealInfo);
+   }
+   free(d->encData);
+   d->encData = NULL;
+}
+
+typedef struct TPM_AUTH_SESSION {
+  TPM_AUTHHANDLE  AuthHandle;
+  TPM_NONCE   NonceOdd;   // system
+  TPM_NONCE   NonceEven;   // TPM
+  BOOL   fContinueAuthSession;
+  TPM_AUTHDATA  HMAC;
+} TPM_AUTH_SESSION;
+
+#define TPM_AUTH_SESSION_INIT { .AuthHandle = 0, .fContinueAuthSession = FALSE }
+
+// ---------------------- Functions for checking TPM_RESULTs -----------------
+
+#include <stdio.h>
+
+// FIXME: Review use of these and delete unneeded ones.
+
+// these are really badly dependent on local structure:
+// DEPENDS: local var 'status' of type TPM_RESULT
+// DEPENDS: label 'abort_egress' which cleans up and returns the status
+#define ERRORDIE(s) do { status = s; \
+                         fprintf (stderr, "*** ERRORDIE in %s at %s: %i\n", __func__, __FILE__, __LINE__); \
+                         goto abort_egress; } \
+                    while (0)
+
+// DEPENDS: local var 'status' of type TPM_RESULT
+// DEPENDS: label 'abort_egress' which cleans up and returns the status
+// Try command c. If it fails, set status to s and goto abort.
+#define TPMTRY(s,c) if (c != TPM_SUCCESS) { \
+                       status = s; \
+                       printf("ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
+                       goto abort_egress; \
+                    } else {\
+                       status = c; \
+                    }
+
+// Try command c. If it fails, print error message, set status to actual return code. Goto abort
+#define TPMTRYRETURN(c) do { status = c; \
+                             if (status != TPM_SUCCESS) { \
+                               fprintf(stderr, "ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
+                               goto abort_egress; \
+                             } \
+                        } while(0)
+
+
+#endif //__TCPA_H__
diff --git a/stubdom/vtpmmgr/tpm.c b/stubdom/vtpmmgr/tpm.c
new file mode 100644
index 0000000..123a27c
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm.c
@@ -0,0 +1,938 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <malloc.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <polarssl/sha1.h>
+
+#include "tcg.h"
+#include "tpm.h"
+#include "log.h"
+#include "marshal.h"
+#include "tpmrsa.h"
+#include "vtpmmgr.h"
+
+#define TCPA_MAX_BUFFER_LENGTH 0x2000
+
+#define TPM_BEGIN(TAG, ORD) \
+   const TPM_TAG intag = TAG;\
+TPM_TAG tag = intag;\
+UINT32 paramSize;\
+const TPM_COMMAND_CODE ordinal = ORD;\
+TPM_RESULT status = TPM_SUCCESS;\
+BYTE in_buf[TCPA_MAX_BUFFER_LENGTH];\
+BYTE out_buf[TCPA_MAX_BUFFER_LENGTH];\
+UINT32 out_len = sizeof(out_buf);\
+BYTE* ptr = in_buf;\
+/*Print a log message */\
+vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);\
+/* Pack the header*/\
+ptr = pack_TPM_TAG(ptr, tag);\
+ptr += sizeof(UINT32);\
+ptr = pack_TPM_COMMAND_CODE(ptr, ordinal)\
+
+#define TPM_AUTH_BEGIN() \
+   sha1_context sha1_ctx;\
+BYTE* authbase = ptr - sizeof(TPM_COMMAND_CODE);\
+TPM_DIGEST paramDigest;\
+sha1_starts(&sha1_ctx)
+
+#define TPM_AUTH1_GEN(HMACkey, auth) do {\
+   sha1_finish(&sha1_ctx, paramDigest.digest);\
+   generateAuth(&paramDigest, HMACkey, auth);\
+   ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_AUTH2_GEN(HMACkey, auth) do {\
+   generateAuth(&paramDigest, HMACkey, auth);\
+   ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_TRANSMIT() do {\
+   /* Pack the command size */\
+   paramSize = ptr - in_buf;\
+   pack_UINT32(in_buf + sizeof(TPM_TAG), paramSize);\
+   if((status = TPM_TransmitData(in_buf, paramSize, out_buf, &out_len)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH_VERIFY_BEGIN() do {\
+   UINT32 buf[2] = { cpu_to_be32(status), cpu_to_be32(ordinal) };\
+   sha1_starts(&sha1_ctx);\
+   sha1_update(&sha1_ctx, (unsigned char*)buf, sizeof(buf));\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH1_VERIFY(HMACkey, auth) do {\
+   sha1_finish(&sha1_ctx, paramDigest.digest);\
+   ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+   if((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH2_VERIFY(HMACkey, auth) do {\
+   ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+   if((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+
+
+#define TPM_UNPACK_VERIFY() do { \
+   ptr = out_buf;\
+   ptr = unpack_TPM_RSP_HEADER(ptr, \
+         &(tag), &(paramSize), &(status));\
+   if((status) != TPM_SUCCESS || (tag) != (intag +3)) { \
+      vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s\n", tpm_get_error_name(status));\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH_HASH() do {\
+   sha1_update(&sha1_ctx, authbase, ptr - authbase);\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH_SKIP() do {\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH_ERR_CHECK(auth) do {\
+   if(status != TPM_SUCCESS || auth->fContinueAuthSession == FALSE) {\
+      vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM\n", auth->AuthHandle);\
+      auth->AuthHandle = 0;\
+   }\
+} while(0)
+
+static void xorEncrypt(const TPM_SECRET* sharedSecret,
+      TPM_NONCE* nonce,
+      const TPM_AUTHDATA* inAuth0,
+      TPM_ENCAUTH outAuth0,
+      const TPM_AUTHDATA* inAuth1,
+      TPM_ENCAUTH outAuth1) {
+   BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
+   BYTE XORkey[TPM_DIGEST_SIZE];
+   BYTE* ptr = XORbuffer;
+   ptr = pack_TPM_SECRET(ptr, sharedSecret);
+   ptr = pack_TPM_NONCE(ptr, nonce);
+
+   sha1(XORbuffer, ptr - XORbuffer, XORkey);
+
+   if(inAuth0) {
+      for(int i = 0; i < TPM_DIGEST_SIZE; ++i) {
+         outAuth0[i] = XORkey[i] ^ (*inAuth0)[i];
+      }
+   }
+   if(inAuth1) {
+      for(int i = 0; i < TPM_DIGEST_SIZE; ++i) {
+         outAuth1[i] = XORkey[i] ^ (*inAuth1)[i];
+      }
+   }
+
+}
+
+static void generateAuth(const TPM_DIGEST* paramDigest,
+      const TPM_SECRET* HMACkey,
+      TPM_AUTH_SESSION *auth)
+{
+   //Generate new OddNonce
+   vtpmmgr_rand((BYTE*)auth->NonceOdd.nonce, sizeof(TPM_NONCE));
+
+   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
+   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
+   BYTE* ptr = hmacText;
+
+   ptr = pack_TPM_DIGEST(ptr, paramDigest);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+
+   sha1_hmac((BYTE *) HMACkey, sizeof(TPM_DIGEST),
+         (BYTE *) hmacText, sizeof(hmacText),
+         auth->HMAC);
+}
+
+static TPM_RESULT verifyAuth(const TPM_DIGEST* paramDigest,
+      /*[IN]*/ const TPM_SECRET *HMACkey,
+      /*[IN,OUT]*/ TPM_AUTH_SESSION *auth)
+{
+
+   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
+   TPM_AUTHDATA hm;
+   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
+   BYTE* ptr = hmacText;
+
+   ptr = pack_TPM_DIGEST(ptr, paramDigest);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+
+   sha1_hmac( (BYTE *) HMACkey, sizeof(TPM_DIGEST),
+         (BYTE *) hmacText, sizeof(hmacText),
+         hm);
+
+   // Compare correct HMAC with provided one.
+   if (memcmp(hm, auth->HMAC, sizeof(TPM_DIGEST)) == 0) { // 0 indicates equality
+      return TPM_SUCCESS;
+   } else {
+      vtpmlogerror(VTPM_LOG_TPM, "Auth Session verification failed!\n");
+      return TPM_AUTHFAIL;
+   }
+}
+
+
+
+// ------------------------------------------------------------------
+// Authorization Commands
+// ------------------------------------------------------------------
+
+TPM_RESULT TPM_OIAP(TPM_AUTH_SESSION*   auth)  // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OIAP);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
+   auth->fContinueAuthSession = TRUE;
+
+   ptr = unpack_UINT32(ptr, &auth->AuthHandle);
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OIAP.\n", auth->AuthHandle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_OSAP(TPM_ENTITY_TYPE  entityType,  // in
+      UINT32    entityValue, // in
+      const TPM_AUTHDATA* usageAuth, //in
+      TPM_SECRET *sharedSecret, //out
+      TPM_AUTH_SESSION *auth)
+{
+   BYTE* nonceOddOSAP;
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OSAP);
+
+   ptr = pack_TPM_ENTITY_TYPE(ptr, entityType);
+   ptr = pack_UINT32(ptr, entityValue);
+
+   //nonce Odd OSAP
+   nonceOddOSAP = ptr;
+   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
+   ptr += TPM_DIGEST_SIZE;
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, &auth->AuthHandle);
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+
+   //Calculate session secret
+   sha1_context ctx;
+   sha1_hmac_starts(&ctx, *usageAuth, TPM_DIGEST_SIZE);
+   sha1_hmac_update(&ctx, ptr, TPM_DIGEST_SIZE); //ptr = nonceEvenOSAP
+   sha1_hmac_update(&ctx, nonceOddOSAP, TPM_DIGEST_SIZE);
+   sha1_hmac_finish(&ctx, *sharedSecret);
+
+   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
+   auth->fContinueAuthSession = FALSE;
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OSAP.\n", auth->AuthHandle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_TakeOwnership(
+      const TPM_PUBKEY *pubEK, //in
+      const TPM_AUTHDATA* ownerAuth, //in
+      const TPM_AUTHDATA* srkAuth, //in
+      const TPM_KEY* inSrk, //in
+      TPM_KEY* outSrk, //out, optional
+      TPM_AUTH_SESSION*   auth)   // in, out
+{
+   int keyAlloced = 0;
+   tpmrsa_context ek_rsa = TPMRSA_CTX_INIT;
+
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_TakeOwnership);
+   TPM_AUTH_BEGIN();
+
+   tpmrsa_set_pubkey(&ek_rsa,
+         pubEK->pubKey.key, pubEK->pubKey.keyLength,
+         pubEK->algorithmParms.parms.rsa.exponent,
+         pubEK->algorithmParms.parms.rsa.exponentSize);
+
+   /* Pack the protocol ID */
+   ptr = pack_UINT16(ptr, TPM_PID_OWNER);
+
+   /* Pack the encrypted owner auth */
+   ptr = pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength / 8);
+   tpmrsa_pub_encrypt_oaep(&ek_rsa,
+         ctr_drbg_random, &vtpm_globals.ctr_drbg,
+         sizeof(TPM_SECRET),
+         (BYTE*) ownerAuth,
+         ptr);
+   ptr += pubEK->algorithmParms.parms.rsa.keyLength / 8;
+
+   /* Pack the encrypted srk auth */
+   ptr = pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength / 8);
+   tpmrsa_pub_encrypt_oaep(&ek_rsa,
+         ctr_drbg_random, &vtpm_globals.ctr_drbg,
+         sizeof(TPM_SECRET),
+         (BYTE*) srkAuth,
+         ptr);
+   ptr += pubEK->algorithmParms.parms.rsa.keyLength / 8;
+
+   /* Pack the Srk key */
+   ptr = pack_TPM_KEY(ptr, inSrk);
+
+   /* Hash everything up to here */
+   TPM_AUTH_HASH();
+
+   /* Generate the authorization */
+   TPM_AUTH1_GEN(ownerAuth, auth);
+
+   /* Send the command to the tpm*/
+   TPM_TRANSMIT();
+   /* Unpack and validate the header */
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   if(outSrk != NULL) {
+      /* If the user wants a copy of the srk we give it to them */
+      keyAlloced = 1;
+      ptr = unpack_TPM_KEY(ptr, outSrk, UNPACK_ALLOC);
+   } else {
+      /*otherwise just parse past it */
+      TPM_KEY temp;
+      ptr = unpack_TPM_KEY(ptr, &temp, UNPACK_ALIAS);
+   }
+
+   /* Hash the output key */
+   TPM_AUTH_HASH();
+
+   /* Verify authorizaton */
+   TPM_AUTH1_VERIFY(ownerAuth, auth);
+
+   goto egress;
+abort_egress:
+   if(keyAlloced) {
+      free_TPM_KEY(outSrk);
+   }
+egress:
+   tpmrsa_free(&ek_rsa);
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+
+TPM_RESULT TPM_DisablePubekRead (
+      const TPM_AUTHDATA* ownerAuth,
+      TPM_AUTH_SESSION*   auth)
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_DisablePubekRead);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(ownerAuth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   TPM_AUTH1_VERIFY(ownerAuth, auth);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+
+TPM_RESULT TPM_TerminateHandle(TPM_AUTHHANDLE  handle)  // in
+{
+   if(handle == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Terminate_Handle);
+
+   ptr = pack_TPM_AUTHHANDLE(ptr, handle);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM_TerminateHandle\n", handle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_Extend( TPM_PCRINDEX  pcrNum,  // in
+      TPM_DIGEST  inDigest, // in
+      TPM_PCRVALUE*  outDigest) // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Extend);
+
+   ptr = pack_TPM_PCRINDEX(ptr, pcrNum);
+   ptr = pack_TPM_DIGEST(ptr, &inDigest);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_TPM_PCRVALUE(ptr, outDigest);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_Seal(
+      TPM_KEY_HANDLE  keyHandle,  // in
+      UINT32    pcrInfoSize, // in
+      TPM_PCR_INFO*    pcrInfo,  // in
+      UINT32    inDataSize,  // in
+      const BYTE*    inData,   // in
+      TPM_STORED_DATA* sealedData, //out
+      const TPM_SECRET* osapSharedSecret, //in
+      const TPM_AUTHDATA* sealedDataAuth, //in
+      TPM_AUTH_SESSION*   pubAuth  // in, out
+      )
+{
+   int dataAlloced = 0;
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_Seal);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, keyHandle);
+
+   TPM_AUTH_SKIP();
+
+   xorEncrypt(osapSharedSecret, &pubAuth->NonceEven,
+         sealedDataAuth, ptr,
+         NULL, NULL);
+   ptr += sizeof(TPM_ENCAUTH);
+
+   ptr = pack_UINT32(ptr, pcrInfoSize);
+   ptr = pack_TPM_PCR_INFO(ptr, pcrInfo);
+
+   ptr = pack_UINT32(ptr, inDataSize);
+   ptr = pack_BUFFER(ptr, inData, inDataSize);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(osapSharedSecret, pubAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_TPM_STORED_DATA(ptr, sealedData, UNPACK_ALLOC);
+   dataAlloced = 1;
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(osapSharedSecret, pubAuth);
+
+   goto egress;
+abort_egress:
+   if(dataAlloced) {
+      free_TPM_STORED_DATA(sealedData);
+   }
+egress:
+   TPM_AUTH_ERR_CHECK(pubAuth);
+   return status;
+}
+
+TPM_RESULT TPM_Unseal(
+      TPM_KEY_HANDLE parentHandle, // in
+      const TPM_STORED_DATA* sealedData,
+      UINT32*   outSize,  // out
+      BYTE**    out, //out
+      const TPM_AUTHDATA* key_usage_auth, //in
+      const TPM_AUTHDATA* data_usage_auth, //in
+      TPM_AUTH_SESSION*   keyAuth,  // in, out
+      TPM_AUTH_SESSION*   dataAuth  // in, out
+      )
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH2_COMMAND, TPM_ORD_Unseal);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, parentHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_TPM_STORED_DATA(ptr, sealedData);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(key_usage_auth, keyAuth);
+   TPM_AUTH2_GEN(data_usage_auth, dataAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, outSize);
+   ptr = unpack_ALLOC(ptr, out, *outSize);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(key_usage_auth, keyAuth);
+   TPM_AUTH2_VERIFY(data_usage_auth, dataAuth);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(keyAuth);
+   TPM_AUTH_ERR_CHECK(dataAuth);
+   return status;
+}
+
+TPM_RESULT TPM_Bind(
+      const TPM_KEY* key,
+      const BYTE* in,
+      UINT32 ilen,
+      BYTE* out)
+{
+   TPM_RESULT status;
+   tpmrsa_context rsa = TPMRSA_CTX_INIT;
+   TPM_BOUND_DATA boundData;
+   uint8_t plain[TCPA_MAX_BUFFER_LENGTH];
+   BYTE* ptr = plain;
+
+   vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);
+
+   tpmrsa_set_pubkey(&rsa,
+         key->pubKey.key, key->pubKey.keyLength,
+         key->algorithmParms.parms.rsa.exponent,
+         key->algorithmParms.parms.rsa.exponentSize);
+
+   // Fill boundData's accessory information
+   boundData.ver = TPM_STRUCT_VER_1_1;
+   boundData.payload = TPM_PT_BIND;
+   boundData.payloadData = (BYTE*)in;
+
+   //marshall the bound data object
+   ptr = pack_TPM_BOUND_DATA(ptr, &boundData, ilen);
+
+   // Encrypt the data
+   TPMTRYRETURN(tpmrsa_pub_encrypt_oaep(&rsa,
+            ctr_drbg_random, &vtpm_globals.ctr_drbg,
+            ptr - plain,
+            plain,
+            out));
+
+abort_egress:
+   tpmrsa_free(&rsa);
+   return status;
+
+}
+
+TPM_RESULT TPM_UnBind(
+      TPM_KEY_HANDLE  keyHandle,  // in
+      UINT32 ilen, //in
+      const BYTE* in, //
+      UINT32* olen, //
+      BYTE*    out, //out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth //in, out
+      )
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_UnBind);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, keyHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_UINT32(ptr, ilen);
+   ptr = pack_BUFFER(ptr, in, ilen);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(usage_auth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, olen);
+   if(*olen > ilen) {
+      vtpmlogerror(VTPM_LOG_TPM, "Output length < input length!\n");
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+   ptr = unpack_BUFFER(ptr, out, *olen);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(usage_auth, auth);
+
+abort_egress:
+egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+TPM_RESULT TPM_CreateWrapKey(
+      TPM_KEY_HANDLE  hWrappingKey,  // in
+      const TPM_AUTHDATA* osapSharedSecret,
+      const TPM_AUTHDATA* dataUsageAuth, //in
+      const TPM_AUTHDATA* dataMigrationAuth, //in
+      TPM_KEY*     key, //in, out
+      TPM_AUTH_SESSION*   pAuth)    // in, out
+{
+   int keyAlloced = 0;
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_CreateWrapKey);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, hWrappingKey);
+
+   TPM_AUTH_SKIP();
+
+   //Encrypted auths
+   xorEncrypt(osapSharedSecret, &pAuth->NonceEven,
+         dataUsageAuth, ptr,
+         dataMigrationAuth, ptr + sizeof(TPM_ENCAUTH));
+   ptr += sizeof(TPM_ENCAUTH) * 2;
+
+   ptr = pack_TPM_KEY(ptr, key);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(osapSharedSecret, pAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   keyAlloced = 1;
+   ptr = unpack_TPM_KEY(ptr, key, UNPACK_ALLOC);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(osapSharedSecret, pAuth);
+
+   goto egress;
+abort_egress:
+   if(keyAlloced) {
+      free_TPM_KEY(key);
+   }
+egress:
+   TPM_AUTH_ERR_CHECK(pAuth);
+   return status;
+}
+
+TPM_RESULT TPM_LoadKey(
+      TPM_KEY_HANDLE  parentHandle, //
+      const TPM_KEY* key, //in
+      TPM_HANDLE*  keyHandle,    // out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth)
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_LoadKey);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, parentHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_TPM_KEY(ptr, key);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(usage_auth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, keyHandle);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(usage_auth, auth);
+
+   vtpmloginfo(VTPM_LOG_TPM, "Key Handle: 0x%x opened by TPM_LoadKey\n", *keyHandle);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+TPM_RESULT TPM_EvictKey( TPM_KEY_HANDLE  hKey)  // in
+{
+   if(hKey == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_EvictKey);
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, hKey);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   vtpmloginfo(VTPM_LOG_TPM, "Key handle: 0x%x closed by TPM_EvictKey\n", hKey);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle,
+      TPM_RESOURCE_TYPE rt) {
+   if(handle == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_FlushSpecific);
+
+   ptr = pack_TPM_HANDLE(ptr, handle);
+   ptr = pack_TPM_RESOURCE_TYPE(ptr, rt);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_GetRandom( UINT32*    bytesRequested, // in, out
+      BYTE*    randomBytes) // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetRandom);
+
+   // check input params
+   if (bytesRequested == NULL || randomBytes == NULL){
+      return TPM_BAD_PARAMETER;
+   }
+
+   ptr = pack_UINT32(ptr, *bytesRequested);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, bytesRequested);
+   ptr = unpack_BUFFER(ptr, randomBytes, *bytesRequested);
+
+abort_egress:
+   return status;
+}
+
+
+TPM_RESULT TPM_ReadPubek(
+      TPM_PUBKEY* pubEK //out
+      )
+{
+   BYTE* antiReplay = NULL;
+   BYTE* kptr = NULL;
+   BYTE digest[TPM_DIGEST_SIZE];
+   sha1_context ctx;
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_ReadPubek);
+
+   //antiReplay nonce
+   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
+   antiReplay = ptr;
+   ptr += TPM_DIGEST_SIZE;
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   //unpack and allocate the key
+   kptr = ptr;
+   ptr = unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
+
+   //Verify the checksum
+   sha1_starts(&ctx);
+   sha1_update(&ctx, kptr, ptr - kptr);
+   sha1_update(&ctx, antiReplay, TPM_DIGEST_SIZE);
+   sha1_finish(&ctx, digest);
+
+   //ptr points to the checksum computed by TPM
+   if(memcmp(digest, ptr, TPM_DIGEST_SIZE)) {
+      vtpmlogerror(VTPM_LOG_TPM, "TPM_ReadPubek: Checksum returned by TPM was invalid!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   goto egress;
+abort_egress:
+   if(kptr != NULL) { //If we unpacked the pubEK, we have to free it
+      free_TPM_PUBKEY(pubEK);
+   }
+egress:
+   return status;
+}
+
+
+TPM_RESULT TPM_SaveState(void)
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_SaveState);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_GetCapability(
+      TPM_CAPABILITY_AREA capArea,
+      UINT32 subCapSize,
+      const BYTE* subCap,
+      UINT32* respSize,
+      BYTE** resp)
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetCapability);
+
+   ptr = pack_TPM_CAPABILITY_AREA(ptr, capArea);
+   ptr = pack_UINT32(ptr, subCapSize);
+   ptr = pack_BUFFER(ptr, subCap, subCapSize);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, respSize);
+   ptr = unpack_ALLOC(ptr, resp, *respSize);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_CreateEndorsementKeyPair(
+      const TPM_KEY_PARMS* keyInfo,
+      TPM_PUBKEY* pubEK)
+{
+   BYTE* kptr = NULL;
+   sha1_context ctx;
+   TPM_DIGEST checksum;
+   TPM_DIGEST hash;
+   TPM_NONCE antiReplay;
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_CreateEndorsementKeyPair);
+
+   //Make anti replay nonce
+   vtpmmgr_rand(antiReplay.nonce, sizeof(antiReplay.nonce));
+
+   ptr = pack_TPM_NONCE(ptr, &antiReplay);
+   ptr = pack_TPM_KEY_PARMS(ptr, keyInfo);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   sha1_starts(&ctx);
+
+   kptr = ptr;
+   ptr = unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
+
+   /* Hash the pub key blob */
+   sha1_update(&ctx, kptr, ptr - kptr);
+   ptr = unpack_TPM_DIGEST(ptr, &checksum);
+
+   sha1_update(&ctx, antiReplay.nonce, sizeof(antiReplay.nonce));
+
+   sha1_finish(&ctx, hash.digest);
+   if(memcmp(checksum.digest, hash.digest, TPM_DIGEST_SIZE)) {
+      vtpmloginfo(VTPM_LOG_VTPM, "TPM_CreateEndorsementKey: Checkum verification failed!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   goto egress;
+abort_egress:
+   if(kptr) {
+      free_TPM_PUBKEY(pubEK);
+   }
+egress:
+   return status;
+}
+
+TPM_RESULT TPM_TransmitData(
+      BYTE* in,
+      UINT32 insize,
+      BYTE* out,
+      UINT32* outsize) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   UINT32 i;
+   vtpmloginfo(VTPM_LOG_TXDATA, "Sending buffer = 0x");
+   for(i = 0 ; i < insize ; i++)
+      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", in[i]);
+
+   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
+
+   ssize_t size = 0;
+
+   // send the request
+   size = write (vtpm_globals.tpm_fd, in, insize);
+   if (size < 0) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "write() failed : %s\n", strerror(errno));
+      ERRORDIE (TPM_IOERROR);
+   }
+   else if ((UINT32) size < insize) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "Wrote %d instead of %d bytes!\n", (int) size, insize);
+      ERRORDIE (TPM_IOERROR);
+   }
+
+   // read the response
+   size = read (vtpm_globals.tpm_fd, out, *outsize);
+   if (size < 0) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "read() failed : %s\n", strerror(errno));
+      ERRORDIE (TPM_IOERROR);
+   }
+
+   vtpmloginfo(VTPM_LOG_TXDATA, "Receiving buffer = 0x");
+   for(i = 0 ; i < size ; i++)
+      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out[i]);
+
+   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
+
+   *outsize = size;
+   goto egress;
+
+abort_egress:
+egress:
+   return status;
+}
diff --git a/stubdom/vtpmmgr/tpm.h b/stubdom/vtpmmgr/tpm.h
new file mode 100644
index 0000000..304e145
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm.h
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005/2006, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __TPM_H__
+#define __TPM_H__
+
+#include "tcg.h"
+
+// ------------------------------------------------------------------
+// Exposed API
+// ------------------------------------------------------------------
+
+// TPM v1.1B Command Set
+
+// Authorzation
+TPM_RESULT TPM_OIAP(
+      TPM_AUTH_SESSION*   auth //out
+      );
+
+TPM_RESULT TPM_OSAP (
+      TPM_ENTITY_TYPE entityType,  // in
+      UINT32    entityValue, // in
+      const TPM_AUTHDATA* usageAuth, //in
+      TPM_SECRET *sharedSecret, //out
+      TPM_AUTH_SESSION *auth);
+
+TPM_RESULT TPM_TakeOwnership(
+      const TPM_PUBKEY *pubEK, //in
+      const TPM_AUTHDATA* ownerAuth, //in
+      const TPM_AUTHDATA* srkAuth, //in
+      const TPM_KEY* inSrk, //in
+      TPM_KEY* outSrk, //out, optional
+      TPM_AUTH_SESSION*   auth   // in, out
+      );
+
+TPM_RESULT TPM_DisablePubekRead (
+      const TPM_AUTHDATA* ownerAuth,
+      TPM_AUTH_SESSION*   auth
+      );
+
+TPM_RESULT TPM_TerminateHandle ( TPM_AUTHHANDLE  handle  // in
+      );
+
+TPM_RESULT TPM_FlushSpecific ( TPM_HANDLE  handle,  // in
+      TPM_RESOURCE_TYPE resourceType //in
+      );
+
+// TPM Mandatory
+TPM_RESULT TPM_Extend ( TPM_PCRINDEX  pcrNum,  // in
+      TPM_DIGEST   inDigest, // in
+      TPM_PCRVALUE*   outDigest // out
+      );
+
+TPM_RESULT TPM_PcrRead ( TPM_PCRINDEX  pcrNum,  // in
+      TPM_PCRVALUE*  outDigest // out
+      );
+
+TPM_RESULT TPM_Quote ( TCS_KEY_HANDLE  keyHandle,  // in
+      TPM_NONCE   antiReplay,  // in
+      UINT32*    PcrDataSize, // in, out
+      BYTE**    PcrData,  // in, out
+      TPM_AUTH_SESSION*   privAuth,  // in, out
+      UINT32*    sigSize,  // out
+      BYTE**    sig    // out
+      );
+
+TPM_RESULT TPM_Seal(
+      TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32    pcrInfoSize, // in
+      TPM_PCR_INFO*    pcrInfo,  // in
+      UINT32    inDataSize,  // in
+      const BYTE*    inData,   // in
+      TPM_STORED_DATA* sealedData, //out
+      const TPM_SECRET* osapSharedSecret, //in
+      const TPM_AUTHDATA* sealDataAuth, //in
+      TPM_AUTH_SESSION*   pubAuth  // in, out
+      );
+
+TPM_RESULT TPM_Unseal (
+      TPM_KEY_HANDLE parentHandle, // in
+      const TPM_STORED_DATA* sealedData,
+      UINT32*   outSize,  // out
+      BYTE**    out, //out
+      const TPM_AUTHDATA* key_usage_auth, //in
+      const TPM_AUTHDATA* data_usage_auth, //in
+      TPM_AUTH_SESSION*   keyAuth,  // in, out
+      TPM_AUTH_SESSION*   dataAuth  // in, out
+      );
+
+TPM_RESULT TPM_DirWriteAuth ( TPM_DIRINDEX  dirIndex,  // in
+      TPM_DIRVALUE  newContents, // in
+      TPM_AUTH_SESSION*   ownerAuth  // in, out
+      );
+
+TPM_RESULT TPM_DirRead ( TPM_DIRINDEX  dirIndex, // in
+      TPM_DIRVALUE*  dirValue // out
+      );
+
+TPM_RESULT TPM_Bind(
+      const TPM_KEY* key, //in
+      const BYTE* in, //in
+      UINT32 ilen, //in
+      BYTE* out //out, must be at least cipher block size
+      );
+
+TPM_RESULT TPM_UnBind (
+      TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32 ilen, //in
+      const BYTE* in, //
+      UINT32*   outDataSize, // out
+      BYTE*    outData, //out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth //in, out
+      );
+
+TPM_RESULT TPM_CreateWrapKey (
+      TCS_KEY_HANDLE  hWrappingKey,  // in
+      const TPM_AUTHDATA* osapSharedSecret,
+      const TPM_AUTHDATA* dataUsageAuth, //in
+      const TPM_AUTHDATA* dataMigrationAuth, //in
+      TPM_KEY*     key, //in
+      TPM_AUTH_SESSION*   pAuth    // in, out
+      );
+
+TPM_RESULT TPM_LoadKey (
+      TPM_KEY_HANDLE  parentHandle, //
+      const TPM_KEY* key, //in
+      TPM_HANDLE*  keyHandle,    // out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth
+      );
+
+TPM_RESULT TPM_GetPubKey (  TCS_KEY_HANDLE  hKey,   // in
+      TPM_AUTH_SESSION*   pAuth,   // in, out
+      UINT32*    pcPubKeySize, // out
+      BYTE**    prgbPubKey  // out
+      );
+
+TPM_RESULT TPM_EvictKey ( TCS_KEY_HANDLE  hKey  // in
+      );
+
+TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle, //in
+      TPM_RESOURCE_TYPE rt //in
+      );
+
+TPM_RESULT TPM_Sign ( TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32    areaToSignSize, // in
+      BYTE*    areaToSign,  // in
+      TPM_AUTH_SESSION*   privAuth,  // in, out
+      UINT32*    sigSize,  // out
+      BYTE**    sig    // out
+      );
+
+TPM_RESULT TPM_GetRandom (  UINT32*    bytesRequested, // in, out
+      BYTE*    randomBytes  // out
+      );
+
+TPM_RESULT TPM_StirRandom (  UINT32    inDataSize, // in
+      BYTE*    inData  // in
+      );
+
+TPM_RESULT TPM_ReadPubek (
+      TPM_PUBKEY* pubEK //out
+      );
+
+TPM_RESULT TPM_GetCapability(
+      TPM_CAPABILITY_AREA capArea,
+      UINT32 subCapSize,
+      const BYTE* subCap,
+      UINT32* respSize,
+      BYTE** resp);
+
+TPM_RESULT TPM_SaveState(void);
+
+TPM_RESULT TPM_CreateEndorsementKeyPair(
+      const TPM_KEY_PARMS* keyInfo,
+      TPM_PUBKEY* pubEK);
+
+TPM_RESULT TPM_TransmitData(
+      BYTE* in,
+      UINT32 insize,
+      BYTE* out,
+      UINT32* outsize);
+
+#endif //TPM_H
diff --git a/stubdom/vtpmmgr/tpmrsa.c b/stubdom/vtpmmgr/tpmrsa.c
new file mode 100644
index 0000000..56094e7
--- /dev/null
+++ b/stubdom/vtpmmgr/tpmrsa.c
@@ -0,0 +1,175 @@
+/*
+ *  The RSA public-key cryptosystem
+ *
+ *  Copyright (C) 2006-2011, Brainspark B.V.
+ *
+ *  This file is part of PolarSSL (http://www.polarssl.org)
+ *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
+ *
+ *  All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ *  RSA was designed by Ron Rivest, Adi Shamir and Len Adleman.
+ *
+ *  http://theory.lcs.mit.edu/~rivest/rsapaper.pdf
+ *  http://www.cacr.math.uwaterloo.ca/hac/about/chap8.pdf
+ */
+
+#include "tcg.h"
+#include "polarssl/sha1.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "tpmrsa.h"
+
+#define HASH_LEN 20
+
+void tpmrsa_set_pubkey(tpmrsa_context* ctx,
+      const unsigned char* key,
+      int keylen,
+      const unsigned char* exponent,
+      int explen) {
+
+   tpmrsa_free(ctx);
+
+   if(explen == 0) { //Default e= 2^16+1
+      mpi_lset(&ctx->E, 65537);
+   } else {
+      mpi_read_binary(&ctx->E, exponent, explen);
+   }
+   mpi_read_binary(&ctx->N, key, keylen);
+
+   ctx->len = ( mpi_msb(&ctx->N) + 7) >> 3;
+}
+
+static TPM_RESULT tpmrsa_public( tpmrsa_context *ctx,
+      const unsigned char *input,
+      unsigned char *output )
+{
+   int ret;
+   size_t olen;
+   mpi T;
+
+   mpi_init( &T );
+
+   MPI_CHK( mpi_read_binary( &T, input, ctx->len ) );
+
+   if( mpi_cmp_mpi( &T, &ctx->N ) >= 0 )
+   {
+      mpi_free( &T );
+      return TPM_ENCRYPT_ERROR;
+   }
+
+   olen = ctx->len;
+   MPI_CHK( mpi_exp_mod( &T, &T, &ctx->E, &ctx->N, &ctx->RN ) );
+   MPI_CHK( mpi_write_binary( &T, output, olen ) );
+
+cleanup:
+
+   mpi_free( &T );
+
+   if( ret != 0 )
+      return TPM_ENCRYPT_ERROR;
+
+   return TPM_SUCCESS;
+}
+
+static void mgf_mask( unsigned char *dst, int dlen, unsigned char *src, int slen)
+{
+   unsigned char mask[HASH_LEN];
+   unsigned char counter[4] = {0, 0, 0, 0};
+   int i;
+   sha1_context mctx;
+
+   //We always hash the src with the counter, so save the partial hash
+   sha1_starts(&mctx);
+   sha1_update(&mctx, src, slen);
+
+   // Generate and apply dbMask
+   while(dlen > 0) {
+      //Copy the sha1 context
+      sha1_context ctx = mctx;
+
+      //compute hash for input || counter
+      sha1_update(&ctx, counter, sizeof(counter));
+      sha1_finish(&ctx, mask);
+
+      //Apply the mask
+      for(i = 0; i < (dlen < HASH_LEN ? dlen : HASH_LEN); ++i) {
+         *(dst++) ^= mask[i];
+      }
+
+      //Increment counter
+      ++counter[3];
+
+      dlen -= HASH_LEN;
+   }
+}
+
+/*
+ * Add the message padding, then do an RSA operation
+ */
+TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
+      int (*f_rng)(void *, unsigned char *, size_t),
+      void *p_rng,
+      size_t ilen,
+      const unsigned char *input,
+      unsigned char *output )
+{
+   int ret;
+   int olen;
+   unsigned char* seed = output + 1;
+   unsigned char* db = output + HASH_LEN +1;
+
+   olen = ctx->len-1;
+
+   if( f_rng == NULL )
+      return TPM_ENCRYPT_ERROR;
+
+   if( ilen > olen - 2 * HASH_LEN - 1)
+      return TPM_ENCRYPT_ERROR;
+
+   output[0] = 0;
+
+   //Encoding parameter p
+   sha1((unsigned char*)"TCPA", 4, db);
+
+   //PS
+   memset(db + HASH_LEN, 0,
+         olen - ilen - 2 * HASH_LEN - 1);
+
+   //constant 1 byte
+   db[olen - ilen - HASH_LEN -1] = 0x01;
+
+   //input string
+   memcpy(db + olen - ilen - HASH_LEN,
+         input, ilen);
+
+   //Generate random seed
+   if( ( ret = f_rng( p_rng, seed, HASH_LEN ) ) != 0 )
+      return TPM_ENCRYPT_ERROR;
+
+   // maskedDB: Apply dbMask to DB
+   mgf_mask( db, olen - HASH_LEN, seed, HASH_LEN);
+
+   // maskedSeed: Apply seedMask to seed
+   mgf_mask( seed, HASH_LEN, db, olen - HASH_LEN);
+
+   // Do the crypto op
+   return tpmrsa_public(ctx, output, output);
+}
diff --git a/stubdom/vtpmmgr/tpmrsa.h b/stubdom/vtpmmgr/tpmrsa.h
new file mode 100644
index 0000000..59579e7
--- /dev/null
+++ b/stubdom/vtpmmgr/tpmrsa.h
@@ -0,0 +1,67 @@
+/**
+ * \file rsa.h
+ *
+ * \brief The RSA public-key cryptosystem
+ *
+ *  Copyright (C) 2006-2010, Brainspark B.V.
+ *
+ *  This file is part of PolarSSL (http://www.polarssl.org)
+ *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
+ *
+ *  All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef TPMRSA_H
+#define TPMRSA_H
+
+#include "tcg.h"
+#include <polarssl/bignum.h>
+
+/* tpm software key */
+typedef struct
+{
+    size_t len;                 /*!<  size(N) in chars  */
+
+    mpi N;                      /*!<  public modulus    */
+    mpi E;                      /*!<  public exponent   */
+
+    mpi RN;                     /*!<  cached R^2 mod N  */
+}
+tpmrsa_context;
+
+#define TPMRSA_CTX_INIT { 0, {0, 0, NULL}, {0, 0, NULL}, {0, 0, NULL}}
+
+/* Setup the rsa context using tpm public key data */
+void tpmrsa_set_pubkey(tpmrsa_context* ctx,
+      const unsigned char* key,
+      int keylen,
+      const unsigned char* exponent,
+      int explen);
+
+/* Do rsa public crypto */
+TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
+      int (*f_rng)(void *, unsigned char *, size_t),
+      void *p_rng,
+      size_t ilen,
+      const unsigned char *input,
+      unsigned char *output );
+
+/* free tpmrsa key */
+inline void tpmrsa_free( tpmrsa_context *ctx ) {
+   mpi_free( &ctx->RN ); mpi_free( &ctx->E  ); mpi_free( &ctx->N  );
+}
+
+#endif /* tpmrsa.h */
diff --git a/stubdom/vtpmmgr/uuid.h b/stubdom/vtpmmgr/uuid.h
new file mode 100644
index 0000000..4737645
--- /dev/null
+++ b/stubdom/vtpmmgr/uuid.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPMMGR_UUID_H
+#define VTPMMGR_UUID_H
+
+#define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
+#define UUID_FMTLEN ((2*16)+4) /* 16 hex bytes plus 4 hypens */
+#define UUID_BYTES(uuid) uuid[0], uuid[1], uuid[2], uuid[3], \
+                                uuid[4], uuid[5], uuid[6], uuid[7], \
+                                uuid[8], uuid[9], uuid[10], uuid[11], \
+                                uuid[12], uuid[13], uuid[14], uuid[15]
+
+
+typedef uint8_t uuid_t[16];
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_cmd_handler.c b/stubdom/vtpmmgr/vtpm_cmd_handler.c
new file mode 100644
index 0000000..f82a2a9
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_cmd_handler.c
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <inttypes.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "marshal.h"
+#include "log.h"
+#include "vtpm_storage.h"
+#include "vtpmmgr.h"
+#include "tpm.h"
+#include "tcg.h"
+
+static TPM_RESULT vtpmmgr_SaveHashKey(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+
+   if(tpmcmd->req_len != VTPM_COMMAND_HEADER_SIZE + HASHKEYSZ) {
+      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_ORD_SAVEHASHKEY hashkey too short!\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   /* Do the command */
+   TPMTRYRETURN(vtpm_storage_save_hashkey(uuid, tpmcmd->req + VTPM_COMMAND_HEADER_SIZE));
+
+abort_egress:
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         VTPM_TAG_RSP, VTPM_COMMAND_HEADER_SIZE, status);
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+
+   return status;
+}
+
+static TPM_RESULT vtpmmgr_LoadHashKey(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+
+   TPMTRYRETURN(vtpm_storage_load_hashkey(uuid, tpmcmd->resp + VTPM_COMMAND_HEADER_SIZE));
+
+   tpmcmd->resp_len += HASHKEYSZ;
+
+abort_egress:
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         VTPM_TAG_RSP, tpmcmd->resp_len, status);
+
+   return status;
+}
+
+
+TPM_RESULT vtpmmgr_handle_cmd(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_TAG tag;
+   UINT32 size;
+   TPM_COMMAND_CODE ord;
+
+   unpack_TPM_RQU_HEADER(tpmcmd->req,
+         &tag, &size, &ord);
+
+   /* Handle the command now */
+   switch(tag) {
+      case VTPM_TAG_REQ:
+         //This is a vTPM command
+         switch(ord) {
+            case VTPM_ORD_SAVEHASHKEY:
+               return vtpmmgr_SaveHashKey(uuid, tpmcmd);
+            case VTPM_ORD_LOADHASHKEY:
+               return vtpmmgr_LoadHashKey(uuid, tpmcmd);
+            default:
+               vtpmlogerror(VTPM_LOG_VTPM, "Invalid vTPM Ordinal %" PRIu32 "\n", ord);
+               status = TPM_BAD_ORDINAL;
+         }
+         break;
+      case TPM_TAG_RQU_COMMAND:
+      case TPM_TAG_RQU_AUTH1_COMMAND:
+      case TPM_TAG_RQU_AUTH2_COMMAND:
+         //This is a TPM passthrough command
+         switch(ord) {
+            case TPM_ORD_GetRandom:
+               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_GetRandom\n");
+               break;
+            case TPM_ORD_PcrRead:
+               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_PcrRead\n");
+               break;
+            default:
+               vtpmlogerror(VTPM_LOG_VTPM, "TPM Disallowed Passthrough ord=%" PRIu32 "\n", ord);
+               status = TPM_DISABLED_CMD;
+               goto abort_egress;
+         }
+
+         size = TCPA_MAX_BUFFER_LENGTH;
+         TPMTRYRETURN(TPM_TransmitData(tpmcmd->req, tpmcmd->req_len, tpmcmd->resp, &size));
+         tpmcmd->resp_len = size;
+
+         unpack_TPM_RESULT(tpmcmd->resp + sizeof(TPM_TAG) + sizeof(UINT32), &status);
+         return status;
+
+         break;
+      default:
+         vtpmlogerror(VTPM_LOG_VTPM, "Invalid tag=%" PRIu16 "\n", tag);
+         status = TPM_BADTAG;
+   }
+
+abort_egress:
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         tag + 3, tpmcmd->resp_len, status);
+
+   return status;
+}
diff --git a/stubdom/vtpmmgr/vtpm_manager.h b/stubdom/vtpmmgr/vtpm_manager.h
new file mode 100644
index 0000000..a2bbcca
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_manager.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPM_MANAGER_H
+#define VTPM_MANAGER_H
+
+#define VTPM_TAG_REQ 0x01c1
+#define VTPM_TAG_RSP 0x01c4
+#define COMMAND_BUFFER_SIZE 4096
+
+// Header size
+#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
+
+//************************ Command Codes ****************************
+#define VTPM_ORD_BASE       0x0000
+#define VTPM_PRIV_MASK      0x01000000 // Priviledged VTPM Command
+#define VTPM_PRIV_BASE      (VTPM_ORD_BASE | VTPM_PRIV_MASK)
+
+// Non-priviledged VTPM Commands (From DMI's)
+#define VTPM_ORD_SAVEHASHKEY      (VTPM_ORD_BASE + 1) // DMI requests encryption key for persistent storage
+#define VTPM_ORD_LOADHASHKEY      (VTPM_ORD_BASE + 2) // DMI requests symkey to be regenerated
+
+//************************ Return Codes ****************************
+#define VTPM_SUCCESS               0
+#define VTPM_FAIL                  1
+#define VTPM_UNSUPPORTED           2
+#define VTPM_FORBIDDEN             3
+#define VTPM_RESTORE_CONTEXT_FAILED    4
+#define VTPM_INVALID_REQUEST       5
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_storage.c b/stubdom/vtpmmgr/vtpm_storage.c
new file mode 100644
index 0000000..3862fdb
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_storage.c
@@ -0,0 +1,783 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+/***************************************************************
+ * DISK IMAGE LAYOUT
+ * *************************************************************
+ * All data is stored in BIG ENDIAN format
+ * *************************************************************
+ * Section 1: Header
+ *
+ * 10 bytes 	id			ID String "VTPMMGRDOM"
+ * uint32_t	version	Disk 		Image version number (current == 1)
+ * uint32_t     storage_key_len		Length of the Boot Key
+ * BYTEARRAY    storage_key		TPM boot key
+ *
+ * *************************************************************
+ * Section 2: Key Data Table (starts at offset 4096)
+ *
+ * This is a list of blocks, each is RSA_CIPHER_SIZE long
+ * and is encrypted with the storage key.
+ *
+ * The first block always exists and it contains:
+ * uint32_t num_vtpms                   Number of vtpms (number of remaining blocks)
+ *
+ * The rest of the blocks look like this:
+ * 16 bytes	uuid			uuid of the owner of this key and hash
+ * 20 bytes	hash			Sha1 hash of vTPM's data, supplied by vTPM
+ * 32 bytes	key			AES-256 Encryption Key, supplied by vTPM
+ *
+ * *************************************************************
+ */
+#define DISKVERS 1
+#define IDSTR "VTPMMGRDOM"
+#define IDSTRLEN 10
+#define AES_BLOCK_SIZE 16
+#define AES_KEY_BITS 256
+#define AES_KEY_SIZE (AES_KEY_BITS/8)
+#define BUF_SIZE 4096
+
+#define UUID_TBL_ENT_SIZE (sizeof(uuid_t) + sizeof(uint32_t))
+
+#define HEADERSZ (10 + 4 + 4)
+
+#define TRY_READ(buf, size, msg) do {\
+   int rc; \
+   if((rc = read(blkfront_fd, buf, (size))) != (size)) { \
+      vtpmlogerror(VTPM_LOG_VTPM, "read() failed! " msg " : rc=(%d/%d), error=(%s)\n", rc, (int)(size), strerror(errno)); \
+      status = TPM_IOERROR;\
+      goto abort_egress;\
+   } \
+} while(0)
+
+#define TRY_WRITE(buf, size, msg) do {\
+   int rc; \
+   if((rc = write(blkfront_fd, buf, (size))) != (size)) { \
+      vtpmlogerror(VTPM_LOG_VTPM, "write() failed! " msg " : rc=(%d/%d), error=(%s)\n", rc, (int)(size), strerror(errno)); \
+      status = TPM_IOERROR;\
+      goto abort_egress;\
+   } \
+} while(0)
+
+#include <blkfront.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <mini-os/byteorder.h>
+#include <polarssl/aes.h>
+
+#include "vtpm_manager.h"
+#include "log.h"
+#include "marshal.h"
+#include "tpm.h"
+#include "uuid.h"
+
+#include "vtpmmgr.h"
+#include "vtpm_storage.h"
+
+#define MAX(a,b) ( ((a) > (b)) ? (a) : (b) )
+#define MIN(a,b) ( ((a) < (b)) ? (a) : (b) )
+
+/* blkfront device objets */
+static struct blkfront_dev* blkdev = NULL;
+static int blkfront_fd = -1;
+
+struct Vtpm {
+   uuid_t uuid;
+   int offset;
+};
+struct Storage {
+   int aes_offset;
+   int uuid_offset;
+   int end_offset;
+
+   int num_vtpms;
+   int num_vtpms_alloced;
+   struct Vtpm* vtpms;
+};
+
+/* Global storage data */
+static struct Storage g_store = {
+   .vtpms = NULL,
+};
+
+static int get_offset(void) {
+   return lseek(blkfront_fd, 0, SEEK_CUR);
+}
+
+static void reset_store(void) {
+   g_store.aes_offset = 0;
+   g_store.uuid_offset = 0;
+   g_store.end_offset = 0;
+
+   g_store.num_vtpms = 0;
+   g_store.num_vtpms_alloced = 0;
+   free(g_store.vtpms);
+   g_store.vtpms = NULL;
+}
+
+static int vtpm_get_index(const uuid_t uuid) {
+   int st = 0;
+   int ed = g_store.num_vtpms-1;
+   while(st <= ed) {
+      int mid = ((unsigned int)st + (unsigned int)ed) >> 1; //avoid overflow
+      int c = memcmp(uuid, &g_store.vtpms[mid].uuid, sizeof(uuid_t));
+      if(c == 0) {
+         return mid;
+      } else if(c > 0) {
+         st = mid + 1;
+      } else {
+         ed = mid - 1;
+      }
+   }
+   return -(st + 1);
+}
+
+static void vtpm_add(const uuid_t uuid, int offset, int index) {
+   /* Realloc more space if needed */
+   if(g_store.num_vtpms >= g_store.num_vtpms_alloced) {
+      g_store.num_vtpms_alloced += 16;
+      g_store.vtpms = realloc(
+            g_store.vtpms,
+            sizeof(struct Vtpm) * g_store.num_vtpms_alloced);
+   }
+
+   /* Move everybody after the new guy */
+   for(int i = g_store.num_vtpms; i > index; --i) {
+      g_store.vtpms[i] = g_store.vtpms[i-1];
+   }
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Registered vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+
+   /* Finally add new one */
+   memcpy(g_store.vtpms[index].uuid, uuid, sizeof(uuid_t));
+   g_store.vtpms[index].offset = offset;
+   ++g_store.num_vtpms;
+}
+
+#if 0
+static void vtpm_remove(int index) {
+   for(i = index; i < g_store.num_vtpms; ++i) {
+      g_store.vtpms[i] = g_store.vtpms[i+1];
+   }
+   --g_store.num_vtpms;
+}
+#endif
+
+static int pack_uuid_table(uint8_t* table, int size, int* nvtpms) {
+   uint8_t* ptr = table;
+   while(*nvtpms < g_store.num_vtpms && size >= 0)
+   {
+      /* Pack the uuid */
+      memcpy(ptr, (uint8_t*)g_store.vtpms[*nvtpms].uuid, sizeof(uuid_t));
+      ptr+= sizeof(uuid_t);
+
+
+      /* Pack the offset */
+      ptr = pack_UINT32(ptr, g_store.vtpms[*nvtpms].offset);
+
+      ++*nvtpms;
+      size -= UUID_TBL_ENT_SIZE;
+   }
+   return ptr - table;
+}
+
+/* Extract the uuids */
+static int extract_uuid_table(uint8_t* table, int size) {
+   uint8_t* ptr = table;
+   for(;size >= UUID_TBL_ENT_SIZE; size -= UUID_TBL_ENT_SIZE) {
+      int index;
+      uint32_t v32;
+
+      /*uuid_t is just an array of bytes, so we can do a direct cast here */
+      uint8_t* uuid = ptr;
+      ptr += sizeof(uuid_t);
+
+      /* Get the offset of the key */
+      ptr = unpack_UINT32(ptr, &v32);
+
+      /* Insert the new vtpm in sorted order */
+      if((index = vtpm_get_index(uuid)) >= 0) {
+         vtpmlogerror(VTPM_LOG_VTPM, "Vtpm (" UUID_FMT ") exists multiple times! ignoring...\n", UUID_BYTES(uuid));
+         continue;
+      }
+      index = -index -1;
+
+      vtpm_add(uuid, v32, index);
+
+   }
+   return ptr - table;
+}
+
+static void vtpm_decrypt_block(aes_context* aes,
+      uint8_t* iv,
+      uint8_t* cipher,
+      uint8_t* plain,
+      int cipher_sz,
+      int* overlap)
+{
+   int bytes_ext;
+   /* Decrypt */
+   aes_crypt_cbc(aes, AES_DECRYPT,
+         cipher_sz,
+         iv, cipher, plain + *overlap);
+
+   /* Extract */
+   bytes_ext = extract_uuid_table(plain, cipher_sz + *overlap);
+
+   /* Copy left overs to the beginning */
+   *overlap = cipher_sz + *overlap - bytes_ext;
+   memcpy(plain, plain + bytes_ext, *overlap);
+}
+
+static int vtpm_encrypt_block(aes_context* aes,
+      uint8_t* iv,
+      uint8_t* plain,
+      uint8_t* cipher,
+      int block_sz,
+      int* overlap,
+      int* num_vtpms)
+{
+   int bytes_to_crypt;
+   int bytes_packed;
+
+   /* Pack the uuid table */
+   bytes_packed = *overlap + pack_uuid_table(plain + *overlap, block_sz - *overlap, num_vtpms);
+   bytes_to_crypt = MIN(bytes_packed, block_sz);
+
+   /* Add padding if we aren't on a multiple of the block size */
+   if(bytes_to_crypt & (AES_BLOCK_SIZE-1)) {
+      int oldsz = bytes_to_crypt;
+      //add padding
+      bytes_to_crypt += AES_BLOCK_SIZE - (bytes_to_crypt & (AES_BLOCK_SIZE-1));
+      //fill padding with random bytes
+      vtpmmgr_rand(plain + oldsz, bytes_to_crypt - oldsz);
+      *overlap = 0;
+   } else {
+      *overlap = bytes_packed - bytes_to_crypt;
+   }
+
+   /* Encrypt this chunk */
+   aes_crypt_cbc(aes, AES_ENCRYPT,
+            bytes_to_crypt,
+            iv, plain, cipher);
+
+   /* Copy the left over partials to the beginning */
+   memcpy(plain, plain + bytes_to_crypt, *overlap);
+
+   return bytes_to_crypt;
+}
+
+static TPM_RESULT vtpm_storage_new_vtpm(const uuid_t uuid, int index) {
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
+   uint8_t buf[BUF_SIZE];
+   uint8_t* ptr;
+   int cipher_sz;
+   aes_context aes;
+
+   /* Add new vtpm to the table */
+   vtpm_add(uuid, g_store.end_offset, index);
+   g_store.end_offset += RSA_CIPHER_SIZE;
+
+   /* Compute the new end location of the encrypted uuid table */
+   cipher_sz = AES_BLOCK_SIZE; //IV
+   cipher_sz += g_store.num_vtpms * UUID_TBL_ENT_SIZE; //uuid table
+   cipher_sz += (AES_BLOCK_SIZE - (cipher_sz & (AES_BLOCK_SIZE -1))) & (AES_BLOCK_SIZE-1); //aes padding
+
+   /* Does this overlap any key data? If so they need to be relocated */
+   int uuid_end = (g_store.uuid_offset + cipher_sz + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+   for(int i = 0; i < g_store.num_vtpms; ++i) {
+      if(g_store.vtpms[i].offset < uuid_end) {
+
+         vtpmloginfo(VTPM_LOG_VTPM, "Relocating vtpm data\n");
+
+         //Read the hashkey cipher text
+         lseek(blkfront_fd, g_store.vtpms[i].offset, SEEK_SET);
+         TRY_READ(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
+
+         //Write the cipher text to new offset
+         lseek(blkfront_fd, g_store.end_offset, SEEK_SET);
+         TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
+
+         //Save new offset
+         g_store.vtpms[i].offset = g_store.end_offset;
+         g_store.end_offset += RSA_CIPHER_SIZE;
+      }
+   }
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Generating a new symmetric key\n");
+
+   /* Generate an aes key */
+   TPMTRYRETURN(vtpmmgr_rand(plain, AES_KEY_SIZE));
+   aes_setkey_enc(&aes, plain, AES_KEY_BITS);
+   ptr = plain + AES_KEY_SIZE;
+
+   /* Pack the crypted size */
+   ptr = pack_UINT32(ptr, cipher_sz);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Binding encrypted key\n");
+
+   /* Seal the key and size */
+   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
+            plain,
+            ptr - plain,
+            buf));
+
+   /* Write the sealed key to disk */
+   lseek(blkfront_fd, g_store.aes_offset, SEEK_SET);
+   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm aes key");
+
+   /* ENCRYPT AND WRITE UUID TABLE */
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Encrypting the uuid table\n");
+
+   int num_vtpms = 0;
+   int overlap = 0;
+   int bytes_crypted;
+   uint8_t iv[AES_BLOCK_SIZE];
+
+   /* Generate the iv for the first block */
+   TPMTRYRETURN(vtpmmgr_rand(iv, AES_BLOCK_SIZE));
+
+   /* Copy the iv to the cipher text buffer to be written to disk */
+   memcpy(buf, iv, AES_BLOCK_SIZE);
+   ptr = buf + AES_BLOCK_SIZE;
+
+   /* Encrypt the first block of the uuid table */
+   bytes_crypted = vtpm_encrypt_block(&aes,
+         iv, //iv
+         plain, //plaintext
+         ptr, //cipher text
+         BUF_SIZE - AES_BLOCK_SIZE,
+         &overlap,
+         &num_vtpms);
+
+   /* Write the iv followed by the crypted table*/
+   TRY_WRITE(buf, bytes_crypted + AES_BLOCK_SIZE, "vtpm uuid table");
+
+   /* Decrement the number of bytes encrypted */
+   cipher_sz -= bytes_crypted + AES_BLOCK_SIZE;
+
+   /* If there are more vtpms, encrypt and write them block by block */
+   while(cipher_sz > 0) {
+      /* Encrypt the next block of the uuid table */
+      bytes_crypted = vtpm_encrypt_block(&aes,
+               iv,
+               plain,
+               buf,
+               BUF_SIZE,
+               &overlap,
+               &num_vtpms);
+
+      /* Write the cipher text to disk */
+      TRY_WRITE(buf, bytes_crypted, "vtpm uuid table");
+
+      cipher_sz -= bytes_crypted;
+   }
+
+   goto egress;
+abort_egress:
+egress:
+   return status;
+}
+
+
+/**************************************
+ * PUBLIC FUNCTIONS
+ * ***********************************/
+
+int vtpm_storage_init(void) {
+   struct blkfront_info info;
+   if((blkdev = init_blkfront(NULL, &info)) == NULL) {
+      return -1;
+   }
+   if((blkfront_fd = blkfront_open(blkdev)) < 0) {
+      return -1;
+   }
+   return 0;
+}
+
+void vtpm_storage_shutdown(void) {
+   reset_store();
+   close(blkfront_fd);
+}
+
+TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ])
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   int index;
+   uint8_t cipher[RSA_CIPHER_SIZE];
+   uint8_t clear[RSA_CIPHER_SIZE];
+   UINT32 clear_size;
+
+   /* Find the index of this uuid */
+   if((index = vtpm_get_index(uuid)) < 0) {
+      index = -index-1;
+      vtpmlogerror(VTPM_LOG_VTPM, "LoadKey failure: Unrecognized uuid! " UUID_FMT "\n", UUID_BYTES(uuid));
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   /* Read the table entry */
+   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
+   TRY_READ(cipher, RSA_CIPHER_SIZE, "vtpm hashkey data");
+
+   /* Decrypt the table entry */
+   TPMTRYRETURN(TPM_UnBind(
+            vtpm_globals.storage_key_handle,
+            RSA_CIPHER_SIZE,
+            cipher,
+            &clear_size,
+            clear,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.oiap));
+
+   if(clear_size < HASHKEYSZ) {
+      vtpmloginfo(VTPM_LOG_VTPM, "Decrypted Hash key size (%" PRIu32 ") was too small!\n", clear_size);
+      status = TPM_RESOURCES;
+      goto abort_egress;
+   }
+
+   memcpy(hashkey, clear, HASHKEYSZ);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Loaded hash and key for vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+   goto egress;
+abort_egress:
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load key\n");
+egress:
+   return status;
+}
+
+TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ])
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   int index;
+   uint8_t buf[RSA_CIPHER_SIZE];
+
+   /* Find the index of this uuid */
+   if((index = vtpm_get_index(uuid)) < 0) {
+      index = -index-1;
+      /* Create a new vtpm */
+      TPMTRYRETURN( vtpm_storage_new_vtpm(uuid, index) );
+   }
+
+   /* Encrypt the hash and key */
+   TPMTRYRETURN( TPM_Bind(&vtpm_globals.storage_key,
+            hashkey,
+            HASHKEYSZ,
+            buf));
+
+   /* Write to disk */
+   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
+   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey data");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saved hash and key for vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+   goto egress;
+abort_egress:
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to save key\n");
+egress:
+   return status;
+}
+
+TPM_RESULT vtpm_storage_new_header()
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t buf[BUF_SIZE];
+   uint8_t keybuf[AES_KEY_SIZE + sizeof(uint32_t)];
+   uint8_t* ptr = buf;
+   uint8_t* sptr;
+
+   /* Clear everything first */
+   reset_store();
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Creating new disk image header\n");
+
+   /*Copy the ID string */
+   memcpy(ptr, IDSTR, IDSTRLEN);
+   ptr += IDSTRLEN;
+
+   /*Copy the version */
+   ptr = pack_UINT32(ptr, DISKVERS);
+
+   /*Save the location of the key size */
+   sptr = ptr;
+   ptr += sizeof(UINT32);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saving root storage key..\n");
+
+   /* Copy the storage key */
+   ptr = pack_TPM_KEY(ptr, &vtpm_globals.storage_key);
+
+   /* Now save the size */
+   pack_UINT32(sptr, ptr - (sptr + 4));
+
+   /* Create a fake aes key and set cipher text size to 0 */
+   memset(keybuf, 0, sizeof(keybuf));
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Binding uuid table symmetric key..\n");
+
+   /* Save the location of the aes key */
+   g_store.aes_offset = ptr - buf;
+
+   /* Store the fake aes key and vtpm count */
+   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
+         keybuf,
+         sizeof(keybuf),
+         ptr));
+   ptr+= RSA_CIPHER_SIZE;
+
+   /* Write the header to disk */
+   lseek(blkfront_fd, 0, SEEK_SET);
+   TRY_WRITE(buf, ptr-buf, "vtpm header");
+
+   /* Save the location of the uuid table */
+   g_store.uuid_offset = get_offset();
+
+   /* Save the end offset */
+   g_store.end_offset = (g_store.uuid_offset + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saved new manager disk header.\n");
+
+   goto egress;
+abort_egress:
+egress:
+   return status;
+}
+
+
+TPM_RESULT vtpm_storage_load_header(void)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint32_t v32;
+   uint8_t buf[BUF_SIZE];
+   uint8_t* ptr = buf;
+   aes_context aes;
+
+   /* Clear everything first */
+   reset_store();
+
+   /* Read the header from disk */
+   lseek(blkfront_fd, 0, SEEK_SET);
+   TRY_READ(buf, IDSTRLEN + sizeof(UINT32) + sizeof(UINT32), "vtpm header");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Loading disk image header\n");
+
+   /* Verify the ID string */
+   if(memcmp(ptr, IDSTR, IDSTRLEN)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid ID string in disk image!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+   ptr+=IDSTRLEN;
+
+   /* Unpack the version */
+   ptr = unpack_UINT32(ptr, &v32);
+
+   /* Verify the version */
+   if(v32 != DISKVERS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unsupported disk image version number %" PRIu32 "\n", v32);
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   /* Size of the storage key */
+   ptr = unpack_UINT32(ptr, &v32);
+
+   /* Sanity check */
+   if(v32 > BUF_SIZE) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Size of storage key (%" PRIu32 ") is too large!\n", v32);
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* read the storage key */
+   TRY_READ(buf, v32, "storage pub key");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Unpacking storage key\n");
+
+   /* unpack the storage key */
+   ptr = unpack_TPM_KEY(buf, &vtpm_globals.storage_key, UNPACK_ALLOC);
+
+   /* Load Storage Key into the TPM */
+   TPMTRYRETURN( TPM_LoadKey(
+            TPM_SRK_KEYHANDLE,
+            &vtpm_globals.storage_key,
+            &vtpm_globals.storage_key_handle,
+            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+            &vtpm_globals.oiap));
+
+   /* Initialize the storage key auth */
+   memset(vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA));
+
+   /* Store the offset of the aes key */
+   g_store.aes_offset = get_offset();
+
+   /* Read the rsa cipher text for the aes key */
+   TRY_READ(buf, RSA_CIPHER_SIZE, "aes key");
+   ptr = buf + RSA_CIPHER_SIZE;
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Unbinding uuid table symmetric key\n");
+
+   /* Decrypt the aes key protecting the uuid table */
+   UINT32 datalen;
+   TPMTRYRETURN(TPM_UnBind(
+            vtpm_globals.storage_key_handle,
+            RSA_CIPHER_SIZE,
+            buf,
+            &datalen,
+            ptr,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.oiap));
+
+   /* Validate the length of the output buffer */
+   if(datalen < AES_KEY_SIZE + sizeof(UINT32)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unbound AES key size (%d) was too small! expected (%ld)\n", datalen, AES_KEY_SIZE + sizeof(UINT32));
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* Extract the aes key */
+   aes_setkey_dec(&aes, ptr, AES_KEY_BITS);
+   ptr+= AES_KEY_SIZE;
+
+   /* Extract the ciphertext size */
+   ptr = unpack_UINT32(ptr, &v32);
+   int cipher_size = v32;
+
+   /* Sanity check */
+   if(cipher_size & (AES_BLOCK_SIZE-1)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Cipher text size (%" PRIu32 ") is not a multiple of the aes block size! (%d)\n", v32, AES_BLOCK_SIZE);
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* Save the location of the uuid table */
+   g_store.uuid_offset = get_offset();
+
+   /* Only decrypt the table if there are vtpms to decrypt */
+   if(cipher_size > 0) {
+      int rbytes;
+      int overlap = 0;
+      uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
+      uint8_t iv[AES_BLOCK_SIZE];
+
+      vtpmloginfo(VTPM_LOG_VTPM, "Decrypting uuid table\n");
+
+      /* Pre allocate the vtpm array */
+      g_store.num_vtpms_alloced = cipher_size / UUID_TBL_ENT_SIZE;
+      g_store.vtpms = malloc(sizeof(struct Vtpm) * g_store.num_vtpms_alloced);
+
+      /* Read the iv and the first chunk of cipher text */
+      rbytes = MIN(cipher_size, BUF_SIZE);
+      TRY_READ(buf, rbytes, "vtpm uuid table\n");
+      cipher_size -= rbytes;
+
+      /* Copy the iv */
+      memcpy(iv, buf, AES_BLOCK_SIZE);
+      ptr = buf + AES_BLOCK_SIZE;
+
+      /* Remove the iv from the number of bytes to decrypt */
+      rbytes -= AES_BLOCK_SIZE;
+
+      /* Decrypt and extract vtpms */
+      vtpm_decrypt_block(&aes,
+            iv, ptr, plain,
+            rbytes, &overlap);
+
+      /* Read the rest of the table if there is more */
+      while(cipher_size > 0) {
+         /* Read next chunk of cipher text */
+         rbytes = MIN(cipher_size, BUF_SIZE);
+         TRY_READ(buf, rbytes, "vtpm uuid table");
+         cipher_size -= rbytes;
+
+         /* Decrypt a block of text */
+         vtpm_decrypt_block(&aes,
+               iv, buf, plain,
+               rbytes, &overlap);
+
+      }
+      vtpmloginfo(VTPM_LOG_VTPM, "Loaded %d vtpms!\n", g_store.num_vtpms);
+   }
+
+   /* The end of the key table, new vtpms go here */
+   int uuid_end = (get_offset() + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+   g_store.end_offset = uuid_end;
+
+   /* Compute the end offset while validating vtpms*/
+   for(int i = 0; i < g_store.num_vtpms; ++i) {
+      /* offset must not collide with previous data */
+      if(g_store.vtpms[i].offset < uuid_end) {
+         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
+               " offset (%d) is before end of uuid table (%d)!\n",
+               UUID_BYTES(g_store.vtpms[i].uuid),
+               g_store.vtpms[i].offset, uuid_end);
+         status = TPM_IOERROR;
+         goto abort_egress;
+      }
+      /* offset must be at a multiple of cipher size */
+      if(g_store.vtpms[i].offset & (RSA_CIPHER_SIZE-1)) {
+         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
+               " offset(%d) is not at a multiple of the rsa cipher text size (%d)!\n",
+               UUID_BYTES(g_store.vtpms[i].uuid),
+               g_store.vtpms[i].offset, RSA_CIPHER_SIZE);
+         status = TPM_IOERROR;
+         goto abort_egress;
+      }
+      /* Save the last offset */
+      if(g_store.vtpms[i].offset >= g_store.end_offset) {
+         g_store.end_offset = g_store.vtpms[i].offset + RSA_CIPHER_SIZE;
+      }
+   }
+
+   goto egress;
+abort_egress:
+   //An error occured somewhere
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load manager data!\n");
+
+   //Clear the data store
+   reset_store();
+
+   //Reset the storage key structure
+   free_TPM_KEY(&vtpm_globals.storage_key);
+   {
+      TPM_KEY key = TPM_KEY_INIT;
+      vtpm_globals.storage_key = key;
+   }
+
+   //Reset the storage key handle
+   TPM_EvictKey(vtpm_globals.storage_key_handle);
+   vtpm_globals.storage_key_handle = 0;
+egress:
+   return status;
+}
+
+#if 0
+/* For testing disk IO */
+void add_fake_vtpms(int num) {
+   for(int i = 0; i < num; ++i) {
+      uint32_t ind = cpu_to_be32(i);
+
+      uuid_t uuid;
+      memset(uuid, 0, sizeof(uuid_t));
+      memcpy(uuid, &ind, sizeof(ind));
+      int index = vtpm_get_index(uuid);
+      index = -index-1;
+
+      vtpm_storage_new_vtpm(uuid, index);
+   }
+}
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_storage.h b/stubdom/vtpmmgr/vtpm_storage.h
new file mode 100644
index 0000000..a5a5fd7
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_storage.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPM_STORAGE_H
+#define VTPM_STORAGE_h
+
+#include "uuid.h"
+
+#define VTPM_NVMKEY_SIZE 32
+#define HASHKEYSZ (sizeof(TPM_DIGEST) + VTPM_NVMKEY_SIZE)
+
+/* Initialize the storage system and its virtual disk */
+int vtpm_storage_init(void);
+
+/* Shutdown the storage system and its virtual disk */
+void vtpm_storage_shutdown(void);
+
+/* Loads Sha1 hash and 256 bit AES key from disk and stores them
+ * packed together in outbuf. outbuf must be freed
+ * by the caller using buffer_free()
+ */
+TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ]);
+
+/* inbuf must contain a sha1 hash followed by a 256 bit AES key.
+ * Encrypts and stores the hash and key to disk */
+TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ]);
+
+/* Load the vtpm manager data - call this on startup */
+TPM_RESULT vtpm_storage_load_header(void);
+
+/* Saves the vtpm manager data - call this on shutdown */
+TPM_RESULT vtpm_storage_new_header(void);
+
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpmmgr.c b/stubdom/vtpmmgr/vtpmmgr.c
new file mode 100644
index 0000000..563f4e8
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpmmgr.c
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdint.h>
+#include <mini-os/tpmback.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "log.h"
+
+#include "vtpmmgr.h"
+#include "tcg.h"
+
+
+void main_loop(void) {
+   tpmcmd_t* tpmcmd;
+   uint8_t respbuf[TCPA_MAX_BUFFER_LENGTH];
+
+   while(1) {
+      /* Wait for requests from a vtpm */
+      vtpmloginfo(VTPM_LOG_VTPM, "Waiting for commands from vTPM's:\n");
+      if((tpmcmd = tpmback_req_any()) == NULL) {
+         vtpmlogerror(VTPM_LOG_VTPM, "NULL tpmcmd\n");
+         continue;
+      }
+
+      tpmcmd->resp = respbuf;
+
+      /* Process the command */
+      vtpmmgr_handle_cmd(tpmcmd->uuid, tpmcmd);
+
+      /* Send response */
+      tpmback_resp(tpmcmd);
+   }
+}
+
+int main(int argc, char** argv)
+{
+   int rc = 0;
+   sleep(2);
+   vtpmloginfo(VTPM_LOG_VTPM, "Starting vTPM manager domain\n");
+
+   /* Initialize the vtpm manager */
+   if(vtpmmgr_init(argc, argv) != TPM_SUCCESS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize vtpmmgr domain!\n");
+      rc = -1;
+      goto exit;
+   }
+
+   main_loop();
+
+   vtpmloginfo(VTPM_LOG_VTPM, "vTPM Manager shutting down...\n");
+
+   vtpmmgr_shutdown();
+
+exit:
+   return rc;
+
+}
diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
new file mode 100644
index 0000000..50a1992
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPMMGR_H
+#define VTPMMGR_H
+
+#include <mini-os/tpmback.h>
+#include <polarssl/entropy.h>
+#include <polarssl/ctr_drbg.h>
+
+#include "uuid.h"
+#include "tcg.h"
+#include "vtpm_manager.h"
+
+#define RSA_KEY_SIZE 0x0800
+#define RSA_CIPHER_SIZE (RSA_KEY_SIZE / 8)
+
+struct vtpm_globals {
+   int tpm_fd;
+   TPM_KEY             storage_key;
+   TPM_HANDLE          storage_key_handle;       // Key used by persistent store
+   TPM_AUTH_SESSION    oiap;                // OIAP session for storageKey
+   TPM_AUTHDATA        storage_key_usage_auth;
+
+   TPM_AUTHDATA        owner_auth;
+   TPM_AUTHDATA        srk_auth;
+
+   entropy_context     entropy;
+   ctr_drbg_context    ctr_drbg;
+};
+
+// --------------------------- Global Values --------------------------
+extern struct vtpm_globals vtpm_globals;   // Key info and DMI states
+
+TPM_RESULT vtpmmgr_init(int argc, char** argv);
+void vtpmmgr_shutdown(void);
+
+TPM_RESULT vtpmmgr_handle_cmd(const uuid_t uuid, tpmcmd_t* tpmcmd);
+
+inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes) {
+   return ctr_drbg_random(&vtpm_globals.ctr_drbg, bytes, num_bytes) == 0 ? 0 : TPM_FAIL;
+}
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:36:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:36:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1Uv-0005V2-Sk; Thu, 01 Nov 2012 20:36:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TU1Ut-0005U8-IG
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:36:16 +0000
Received: from [85.158.138.51:33023] by server-1.bemta-3.messagelabs.com id
	36/15-12169-E3DD2905; Thu, 01 Nov 2012 20:36:14 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-14.tower-174.messagelabs.com!1351802165!21991508!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY,UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28940 invoked from network); 1 Nov 2012 20:36:06 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-14.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 20:36:06 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148031189;
	Thu, 01 Nov 2012 16:35:56 -0400
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com, xen-devel@lists.xen.org,
	stefano.stabellini@eu.citrix.com
Date: Thu,  1 Nov 2012 16:35:49 -0400
Message-Id: <1351802150-19258-3-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM 8/9] add stubdom/vtpmmgr code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add the code base for vtpmmgrdom. Makefile changes
next patch.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

diff --git a/stubdom/vtpmmgr/Makefile b/stubdom/vtpmmgr/Makefile
new file mode 100644
index 0000000..88c83c3
--- /dev/null
+++ b/stubdom/vtpmmgr/Makefile
@@ -0,0 +1,32 @@
+# Copyright (c) 2010-2012 United States Government, as represented by
+# the Secretary of Defense.  All rights reserved.
+#
+# THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+# ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+# INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+# DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+# SOFTWARE.
+#
+
+XEN_ROOT=../..
+
+PSSL_DIR=../polarssl-$(XEN_TARGET_ARCH)/library
+PSSL_OBJS=aes.o sha1.o entropy.o ctr_drbg.o bignum.o sha4.o havege.o timing.o entropy_poll.o
+
+TARGET=vtpmmgr.a
+OBJS=vtpmmgr.o vtpm_cmd_handler.o vtpm_storage.o init.o tpmrsa.o tpm.o log.o
+
+CFLAGS+=-Werror -Iutil -Icrypto -Itcs
+CFLAGS+=-Wno-declaration-after-statement -Wno-unused-label
+
+build: $(TARGET)
+$(TARGET): $(OBJS)
+	ar -rcs $@ $^ $(foreach obj,$(PSSL_OBJS),$(PSSL_DIR)/$(obj))
+
+clean:
+	rm -f $(TARGET) $(OBJS)
+
+distclean: clean
+
+.PHONY: clean distclean
diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
new file mode 100644
index 0000000..a158020
--- /dev/null
+++ b/stubdom/vtpmmgr/init.c
@@ -0,0 +1,553 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+#include <stdint.h>
+#include <stdlib.h>
+
+#include <xen/xen.h>
+#include <mini-os/tpmback.h>
+#include <mini-os/tpmfront.h>
+#include <mini-os/tpm_tis.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <polarssl/sha1.h>
+
+#include "log.h"
+#include "vtpmmgr.h"
+#include "vtpm_storage.h"
+#include "tpm.h"
+#include "marshal.h"
+
+struct Opts {
+   enum {
+      TPMDRV_TPM_TIS,
+      TPMDRV_TPMFRONT,
+   } tpmdriver;
+   unsigned long tpmiomem;
+   unsigned int tpmirq;
+   unsigned int tpmlocality;
+   int gen_owner_auth;
+};
+
+// --------------------------- Well Known Auths --------------------------
+const TPM_AUTHDATA WELLKNOWN_SRK_AUTH = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+const TPM_AUTHDATA WELLKNOWN_OWNER_AUTH = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+
+struct vtpm_globals vtpm_globals = {
+   .tpm_fd = -1,
+   .storage_key = TPM_KEY_INIT,
+   .storage_key_handle = 0,
+   .oiap = { .AuthHandle = 0 }
+};
+
+static int tpm_entropy_source(void* dummy, unsigned char* data, size_t len, size_t* olen) {
+   UINT32 sz = len;
+   TPM_RESULT rc = TPM_GetRandom(&sz, data);
+   *olen = sz;
+   return rc == TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
+}
+
+static TPM_RESULT check_tpm_version(void) {
+   TPM_RESULT status;
+   UINT32 rsize;
+   BYTE* res = NULL;
+   TPM_CAP_VERSION_INFO vinfo;
+
+   TPMTRYRETURN(TPM_GetCapability(
+            TPM_CAP_VERSION_VAL,
+            0,
+            NULL,
+            &rsize,
+            &res));
+   if(rsize < 4) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid size returned by GetCapability!\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   unpack_TPM_CAP_VERSION_INFO(res, &vinfo, UNPACK_ALIAS);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Hardware TPM:\n");
+   vtpmloginfo(VTPM_LOG_VTPM, " version: %hhd %hhd %hhd %hhd\n",
+         vinfo.version.major, vinfo.version.minor, vinfo.version.revMajor, vinfo.version.revMinor);
+   vtpmloginfo(VTPM_LOG_VTPM, " specLevel: %hd\n", vinfo.specLevel);
+   vtpmloginfo(VTPM_LOG_VTPM, " errataRev: %hhd\n", vinfo.errataRev);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorID: %c%c%c%c\n",
+         vinfo.tpmVendorID[0], vinfo.tpmVendorID[1],
+         vinfo.tpmVendorID[2], vinfo.tpmVendorID[3]);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecificSize: %hd\n", vinfo.vendorSpecificSize);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecific: ");
+   for(int i = 0; i < vinfo.vendorSpecificSize; ++i) {
+      vtpmloginfomore(VTPM_LOG_VTPM, "%02hhx", vinfo.vendorSpecific[i]);
+   }
+   vtpmloginfomore(VTPM_LOG_VTPM, "\n");
+
+abort_egress:
+   free(res);
+   return status;
+}
+
+static TPM_RESULT flush_tpm(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   const TPM_RESOURCE_TYPE reslist[] = { TPM_RT_KEY, TPM_RT_AUTH, TPM_RT_TRANS, TPM_RT_COUNTER, TPM_RT_DAA_TPM, TPM_RT_CONTEXT };
+   BYTE* keylist = NULL;
+   UINT32 keylistSize;
+   BYTE* ptr;
+
+   //Iterate through each resource type and flush all handles
+   for(int i = 0; i < sizeof(reslist) / sizeof(TPM_RESOURCE_TYPE); ++i) {
+      TPM_RESOURCE_TYPE beres = cpu_to_be32(reslist[i]);
+      UINT16 size;
+      TPMTRYRETURN(TPM_GetCapability(
+               TPM_CAP_HANDLE,
+               sizeof(TPM_RESOURCE_TYPE),
+               (BYTE*)(&beres),
+               &keylistSize,
+               &keylist));
+
+      ptr = keylist;
+      ptr = unpack_UINT16(ptr, &size);
+
+      //Flush each handle
+      if(size) {
+         vtpmloginfo(VTPM_LOG_VTPM, "Flushing %u handle(s) of type %lu\n", size, (unsigned long) reslist[i]);
+         for(int j = 0; j < size; ++j) {
+            TPM_HANDLE h;
+            ptr = unpack_TPM_HANDLE(ptr, &h);
+            TPMTRYRETURN(TPM_FlushSpecific(h, reslist[i]));
+         }
+      }
+
+      free(keylist);
+      keylist = NULL;
+   }
+
+   goto egress;
+abort_egress:
+   free(keylist);
+egress:
+   return status;
+}
+
+
+static TPM_RESULT try_take_ownership(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_PUBKEY pubEK = TPM_PUBKEY_INIT;
+
+   // If we can read PubEK then there is no owner and we should take it.
+   status = TPM_ReadPubek(&pubEK);
+
+   switch(status) {
+      case TPM_DISABLED_CMD:
+         //Cannot read ek? TPM has owner
+         vtpmloginfo(VTPM_LOG_VTPM, "Failed to readEK meaning TPM has an owner. Creating Keys off existing SRK.\n");
+         status = TPM_SUCCESS;
+         break;
+      case TPM_NO_ENDORSEMENT:
+         {
+            //If theres no ek, we have to create one
+            TPM_KEY_PARMS keyInfo = {
+               .algorithmID = TPM_ALG_RSA,
+               .encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1,
+               .sigScheme = TPM_SS_NONE,
+               .parmSize = 12,
+               .parms.rsa = {
+                  .keyLength = RSA_KEY_SIZE,
+                  .numPrimes = 2,
+                  .exponentSize = 0,
+                  .exponent = NULL,
+               },
+            };
+            TPMTRYRETURN(TPM_CreateEndorsementKeyPair(&keyInfo, &pubEK));
+         }
+         //fall through to take ownership
+      case TPM_SUCCESS:
+         {
+            //Construct the Srk
+            TPM_KEY srk = {
+               .ver = TPM_STRUCT_VER_1_1,
+               .keyUsage = TPM_KEY_STORAGE,
+               .keyFlags = 0x00,
+               .authDataUsage = TPM_AUTH_ALWAYS,
+               .algorithmParms = {
+                  .algorithmID = TPM_ALG_RSA,
+                  .encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1,
+                  .sigScheme =  TPM_SS_NONE,
+                  .parmSize = 12,
+                  .parms.rsa = {
+                     .keyLength = RSA_KEY_SIZE,
+                     .numPrimes = 2,
+                     .exponentSize = 0,
+                     .exponent = NULL,
+                  },
+               },
+               .PCRInfoSize = 0,
+               .pubKey = {
+                  .keyLength = 0,
+                  .key = NULL,
+               },
+               .encDataSize = 0,
+            };
+
+            TPMTRYRETURN(TPM_TakeOwnership(
+                     &pubEK,
+                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
+                     (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+                     &srk,
+                     NULL,
+                     &vtpm_globals.oiap));
+
+            TPMTRYRETURN(TPM_DisablePubekRead(
+                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
+                     &vtpm_globals.oiap));
+         }
+         break;
+      default:
+         break;
+   }
+abort_egress:
+   free_TPM_PUBKEY(&pubEK);
+   return status;
+}
+
+static void init_storage_key(TPM_KEY* key) {
+   key->ver.major = 1;
+   key->ver.minor = 1;
+   key->ver.revMajor = 0;
+   key->ver.revMinor = 0;
+
+   key->keyUsage = TPM_KEY_BIND;
+   key->keyFlags = 0;
+   key->authDataUsage = TPM_AUTH_ALWAYS;
+
+   TPM_KEY_PARMS* p = &key->algorithmParms;
+   p->algorithmID = TPM_ALG_RSA;
+   p->encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
+   p->sigScheme = TPM_SS_NONE;
+   p->parmSize = 12;
+
+   TPM_RSA_KEY_PARMS* r = &p->parms.rsa;
+   r->keyLength = RSA_KEY_SIZE;
+   r->numPrimes = 2;
+   r->exponentSize = 0;
+   r->exponent = NULL;
+
+   key->PCRInfoSize = 0;
+   key->encDataSize = 0;
+   key->encData = NULL;
+}
+
+static int parse_auth_string(char* authstr, BYTE* target, const TPM_AUTHDATA wellknown, int allowrandom) {
+   int rc;
+   /* well known owner auth */
+   if(!strcmp(authstr, "well-known")) {
+      memcpy(target, wellknown, sizeof(TPM_AUTHDATA));
+   }
+   /* Create a randomly generated owner auth */
+   else if(allowrandom && !strcmp(authstr, "random")) {
+      return 1;
+   }
+   /* owner auth is a raw hash */
+   else if(!strncmp(authstr, "hash:", 5)) {
+      authstr += 5;
+      if((rc = strlen(authstr)) != 40) {
+         vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth hex string `%s' must be exactly 40 characters (20 bytes) long, length=%d\n", authstr, rc);
+         return -1;
+      }
+      for(int j = 0; j < 20; ++j) {
+         if(sscanf(authstr, "%hhX", target + j) != 1) {
+            vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth string `%s' is not a valid hex string\n", authstr);
+            return -1;
+         }
+         authstr += 2;
+      }
+   }
+   /* owner auth is a string that will be hashed */
+   else if(!strncmp(authstr, "text:", 5)) {
+      authstr += 5;
+      sha1((const unsigned char*)authstr, strlen(authstr), target);
+   }
+   else {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid auth string %s\n", authstr);
+      return -1;
+   }
+
+   return 0;
+}
+
+int parse_cmdline_opts(int argc, char** argv, struct Opts* opts)
+{
+   int rc;
+   int i;
+
+   //Set defaults
+   memcpy(vtpm_globals.owner_auth, WELLKNOWN_OWNER_AUTH, sizeof(TPM_AUTHDATA));
+   memcpy(vtpm_globals.srk_auth, WELLKNOWN_SRK_AUTH, sizeof(TPM_AUTHDATA));
+
+   for(i = 1; i < argc; ++i) {
+      if(!strncmp(argv[i], "owner_auth:", 10)) {
+         if((rc = parse_auth_string(argv[i] + 10, vtpm_globals.owner_auth, WELLKNOWN_OWNER_AUTH, 1)) < 0) {
+            goto err_invalid;
+         }
+         if(rc == 1) {
+            opts->gen_owner_auth = 1;
+         }
+      }
+      else if(!strncmp(argv[i], "srk_auth:", 8)) {
+         if((rc = parse_auth_string(argv[i] + 8, vtpm_globals.srk_auth, WELLKNOWN_SRK_AUTH, 0)) != 0) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmdriver=", 10)) {
+         if(!strcmp(argv[i] + 10, "tpm_tis")) {
+            opts->tpmdriver = TPMDRV_TPM_TIS;
+         } else if(!strcmp(argv[i] + 10, "tpmfront")) {
+            opts->tpmdriver = TPMDRV_TPMFRONT;
+         } else {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmiomem=",9)) {
+         if(sscanf(argv[i] + 9, "0x%lX", &opts->tpmiomem) != 1) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmirq=",7)) {
+         if(!strcmp(argv[i] + 7, "probe")) {
+            opts->tpmirq = TPM_PROBE_IRQ;
+         } else if( sscanf(argv[i] + 7, "%u", &opts->tpmirq) != 1) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmlocality=",12)) {
+         if(sscanf(argv[i] + 12, "%u", &opts->tpmlocality) != 1 || opts->tpmlocality > 4) {
+            goto err_invalid;
+         }
+      }
+   }
+
+   switch(opts->tpmdriver) {
+      case TPMDRV_TPM_TIS:
+         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpm_tis driver\n");
+         break;
+      case TPMDRV_TPMFRONT:
+         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpmfront driver\n");
+         break;
+   }
+
+   return 0;
+err_invalid:
+   vtpmlogerror(VTPM_LOG_VTPM, "Invalid Option %s\n", argv[i]);
+   return -1;
+}
+
+
+
+static TPM_RESULT vtpmmgr_create(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_AUTH_SESSION osap = TPM_AUTH_SESSION_INIT;
+   TPM_AUTHDATA sharedsecret;
+
+   // Take ownership if TPM is unowned
+   TPMTRYRETURN(try_take_ownership());
+
+   // Generate storage key's auth
+   memset(&vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA));
+
+   TPMTRYRETURN( TPM_OSAP(
+            TPM_ET_KEYHANDLE,
+            TPM_SRK_KEYHANDLE,
+            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+            &sharedsecret,
+            &osap) );
+
+   init_storage_key(&vtpm_globals.storage_key);
+
+   //initialize the storage key
+   TPMTRYRETURN( TPM_CreateWrapKey(
+            TPM_SRK_KEYHANDLE,
+            (const TPM_AUTHDATA*)&sharedsecret,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.storage_key,
+            &osap) );
+
+   //Load Storage Key
+   TPMTRYRETURN( TPM_LoadKey(
+            TPM_SRK_KEYHANDLE,
+            &vtpm_globals.storage_key,
+            &vtpm_globals.storage_key_handle,
+            (const TPM_AUTHDATA*) &vtpm_globals.srk_auth,
+            &vtpm_globals.oiap));
+
+   //Make sure TPM has commited changes
+   TPMTRYRETURN( TPM_SaveState() );
+
+   //Create new disk image
+   TPMTRYRETURN(vtpm_storage_new_header());
+
+   goto egress;
+abort_egress:
+egress:
+   vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager\n");
+
+   //End the OSAP session
+   if(osap.AuthHandle) {
+      TPM_TerminateHandle(osap.AuthHandle);
+   }
+
+   return status;
+}
+
+TPM_RESULT vtpmmgr_init(int argc, char** argv) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   /* Default commandline options */
+   struct Opts opts = {
+      .tpmdriver = TPMDRV_TPM_TIS,
+      .tpmiomem = TPM_BASEADDR,
+      .tpmirq = 0,
+      .tpmlocality = 0,
+      .gen_owner_auth = 0,
+   };
+
+   if(parse_cmdline_opts(argc, argv, &opts) != 0) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Command line parsing failed! exiting..\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   //Setup storage system
+   if(vtpm_storage_init() != 0) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize storage subsystem!\n");
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   //Setup tpmback device
+   init_tpmback();
+
+   //Setup tpm access
+   switch(opts.tpmdriver) {
+      case TPMDRV_TPM_TIS:
+         {
+            struct tpm_chip* tpm;
+            if((tpm = init_tpm_tis(opts.tpmiomem, TPM_TIS_LOCL_INT_TO_FLAG(opts.tpmlocality), opts.tpmirq)) == NULL) {
+               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+               status = TPM_IOERROR;
+               goto abort_egress;
+            }
+            vtpm_globals.tpm_fd = tpm_tis_open(tpm);
+            tpm_tis_request_locality(tpm, opts.tpmlocality);
+         }
+         break;
+      case TPMDRV_TPMFRONT:
+         {
+            struct tpmfront_dev* tpmfront_dev;
+            if((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
+               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+               status = TPM_IOERROR;
+               goto abort_egress;
+            }
+            vtpm_globals.tpm_fd = tpmfront_open(tpmfront_dev);
+         }
+         break;
+   }
+
+   //Get the version of the tpm
+   TPMTRYRETURN(check_tpm_version());
+
+   // Blow away all stale handles left in the tpm
+   if(flush_tpm() != TPM_SUCCESS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_FlushResources failed, continuing anyway..\n");
+   }
+
+   /* Initialize the rng */
+   entropy_init(&vtpm_globals.entropy);
+   entropy_add_source(&vtpm_globals.entropy, tpm_entropy_source, NULL, 0);
+   entropy_gather(&vtpm_globals.entropy);
+   ctr_drbg_init(&vtpm_globals.ctr_drbg, entropy_func, &vtpm_globals.entropy, NULL, 0);
+   ctr_drbg_set_prediction_resistance( &vtpm_globals.ctr_drbg, CTR_DRBG_PR_OFF );
+
+   // Generate Auth for Owner
+   if(opts.gen_owner_auth) {
+      vtpmmgr_rand(vtpm_globals.owner_auth, sizeof(TPM_AUTHDATA));
+   }
+
+   // Create OIAP session for service's authorized commands
+   TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
+
+   /* Load the Manager data, if it fails create a new manager */
+   if (vtpm_storage_load_header() != TPM_SUCCESS) {
+      /* If the OIAP session was closed by an error, create a new one */
+      if(vtpm_globals.oiap.AuthHandle == 0) {
+         TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
+      }
+      vtpmloginfo(VTPM_LOG_VTPM, "Failed to read manager file. Assuming first time initialization.\n");
+      TPMTRYRETURN( vtpmmgr_create() );
+   }
+
+   goto egress;
+abort_egress:
+   vtpmmgr_shutdown();
+egress:
+   return status;
+}
+
+void vtpmmgr_shutdown(void)
+{
+   /* Cleanup resources */
+   free_TPM_KEY(&vtpm_globals.storage_key);
+
+   /* Cleanup TPM resources */
+   TPM_EvictKey(vtpm_globals.storage_key_handle);
+   TPM_TerminateHandle(vtpm_globals.oiap.AuthHandle);
+
+   /* Close tpmback */
+   shutdown_tpmback();
+
+   /* Close the storage system and blkfront */
+   vtpm_storage_shutdown();
+
+   /* Close tpmfront/tpm_tis */
+   close(vtpm_globals.tpm_fd);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
+}
diff --git a/stubdom/vtpmmgr/log.c b/stubdom/vtpmmgr/log.c
new file mode 100644
index 0000000..a82c913
--- /dev/null
+++ b/stubdom/vtpmmgr/log.c
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "tcg.h"
+
+char *module_names[] = { "",
+                                "TPM",
+                                "TPM",
+                                "VTPM",
+                                "VTPM",
+                                "TXDATA",
+                              };
+// Helper code for the consts, eg. to produce messages for error codes.
+
+typedef struct error_code_entry_t {
+  TPM_RESULT code;
+  char * code_name;
+  char * msg;
+} error_code_entry_t;
+
+static const error_code_entry_t error_msgs [] = {
+  { TPM_SUCCESS, "TPM_SUCCESS", "Successful completion of the operation" },
+  { TPM_AUTHFAIL, "TPM_AUTHFAIL", "Authentication failed" },
+  { TPM_BADINDEX, "TPM_BADINDEX", "The index to a PCR, DIR or other register is incorrect" },
+  { TPM_BAD_PARAMETER, "TPM_BAD_PARAMETER", "One or more parameter is bad" },
+  { TPM_AUDITFAILURE, "TPM_AUDITFAILURE", "An operation completed successfully but the auditing of that operation failed." },
+  { TPM_CLEAR_DISABLED, "TPM_CLEAR_DISABLED", "The clear disable flag is set and all clear operations now require physical access" },
+  { TPM_DEACTIVATED, "TPM_DEACTIVATED", "The TPM is deactivated" },
+  { TPM_DISABLED, "TPM_DISABLED", "The TPM is disabled" },
+  { TPM_DISABLED_CMD, "TPM_DISABLED_CMD", "The target command has been disabled" },
+  { TPM_FAIL, "TPM_FAIL", "The operation failed" },
+  { TPM_BAD_ORDINAL, "TPM_BAD_ORDINAL", "The ordinal was unknown or inconsistent" },
+  { TPM_INSTALL_DISABLED, "TPM_INSTALL_DISABLED", "The ability to install an owner is disabled" },
+  { TPM_INVALID_KEYHANDLE, "TPM_INVALID_KEYHANDLE", "The key handle presented was invalid" },
+  { TPM_KEYNOTFOUND, "TPM_KEYNOTFOUND", "The target key was not found" },
+  { TPM_INAPPROPRIATE_ENC, "TPM_INAPPROPRIATE_ENC", "Unacceptable encryption scheme" },
+  { TPM_MIGRATEFAIL, "TPM_MIGRATEFAIL", "Migration authorization failed" },
+  { TPM_INVALID_PCR_INFO, "TPM_INVALID_PCR_INFO", "PCR information could not be interpreted" },
+  { TPM_NOSPACE, "TPM_NOSPACE", "No room to load key." },
+  { TPM_NOSRK, "TPM_NOSRK", "There is no SRK set" },
+  { TPM_NOTSEALED_BLOB, "TPM_NOTSEALED_BLOB", "An encrypted blob is invalid or was not created by this TPM" },
+  { TPM_OWNER_SET, "TPM_OWNER_SET", "There is already an Owner" },
+  { TPM_RESOURCES, "TPM_RESOURCES", "The TPM has insufficient internal resources to perform the requested action." },
+  { TPM_SHORTRANDOM, "TPM_SHORTRANDOM", "A random string was too short" },
+  { TPM_SIZE, "TPM_SIZE", "The TPM does not have the space to perform the operation." },
+  { TPM_WRONGPCRVAL, "TPM_WRONGPCRVAL", "The named PCR value does not match the current PCR value." },
+  { TPM_BAD_PARAM_SIZE, "TPM_BAD_PARAM_SIZE", "The paramSize argument to the command has the incorrect value" },
+  { TPM_SHA_THREAD, "TPM_SHA_THREAD", "There is no existing SHA-1 thread." },
+  { TPM_SHA_ERROR, "TPM_SHA_ERROR", "The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error." },
+  { TPM_FAILEDSELFTEST, "TPM_FAILEDSELFTEST", "Self-test has failed and the TPM has shutdown." },
+  { TPM_AUTH2FAIL, "TPM_AUTH2FAIL", "The authorization for the second key in a 2 key function failed authorization" },
+  { TPM_BADTAG, "TPM_BADTAG", "The tag value sent to for a command is invalid" },
+  { TPM_IOERROR, "TPM_IOERROR", "An IO error occurred transmitting information to the TPM" },
+  { TPM_ENCRYPT_ERROR, "TPM_ENCRYPT_ERROR", "The encryption process had a problem." },
+  { TPM_DECRYPT_ERROR, "TPM_DECRYPT_ERROR", "The decryption process did not complete." },
+  { TPM_INVALID_AUTHHANDLE, "TPM_INVALID_AUTHHANDLE", "An invalid handle was used." },
+  { TPM_NO_ENDORSEMENT, "TPM_NO_ENDORSEMENT", "The TPM does not a EK installed" },
+  { TPM_INVALID_KEYUSAGE, "TPM_INVALID_KEYUSAGE", "The usage of a key is not allowed" },
+  { TPM_WRONG_ENTITYTYPE, "TPM_WRONG_ENTITYTYPE", "The submitted entity type is not allowed" },
+  { TPM_INVALID_POSTINIT, "TPM_INVALID_POSTINIT", "The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup" },
+  { TPM_INAPPROPRIATE_SIG, "TPM_INAPPROPRIATE_SIG", "Signed data cannot include additional DER information" },
+  { TPM_BAD_KEY_PROPERTY, "TPM_BAD_KEY_PROPERTY", "The key properties in TPM_KEY_PARMs are not supported by this TPM" },
+
+  { TPM_BAD_MIGRATION, "TPM_BAD_MIGRATION", "The migration properties of this key are incorrect." },
+  { TPM_BAD_SCHEME, "TPM_BAD_SCHEME", "The signature or encryption scheme for this key is incorrect or not permitted in this situation." },
+  { TPM_BAD_DATASIZE, "TPM_BAD_DATASIZE", "The size of the data (or blob) parameter is bad or inconsistent with the referenced key" },
+  { TPM_BAD_MODE, "TPM_BAD_MODE", "A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob." },
+  { TPM_BAD_PRESENCE, "TPM_BAD_PRESENCE", "Either the physicalPresence or physicalPresenceLock bits have the wrong value" },
+  { TPM_BAD_VERSION, "TPM_BAD_VERSION", "The TPM cannot perform this version of the capability" },
+  { TPM_NO_WRAP_TRANSPORT, "TPM_NO_WRAP_TRANSPORT", "The TPM does not allow for wrapped transport sessions" },
+  { TPM_AUDITFAIL_UNSUCCESSFUL, "TPM_AUDITFAIL_UNSUCCESSFUL", "TPM audit construction failed and the underlying command was returning a failure code also" },
+  { TPM_AUDITFAIL_SUCCESSFUL, "TPM_AUDITFAIL_SUCCESSFUL", "TPM audit construction failed and the underlying command was returning success" },
+  { TPM_NOTRESETABLE, "TPM_NOTRESETABLE", "Attempt to reset a PCR register that does not have the resettable attribute" },
+  { TPM_NOTLOCAL, "TPM_NOTLOCAL", "Attempt to reset a PCR register that requires locality and locality modifier not part of command transport" },
+  { TPM_BAD_TYPE, "TPM_BAD_TYPE", "Make identity blob not properly typed" },
+  { TPM_INVALID_RESOURCE, "TPM_INVALID_RESOURCE", "When saving context identified resource type does not match actual resource" },
+  { TPM_NOTFIPS, "TPM_NOTFIPS", "The TPM is attempting to execute a command only available when in FIPS mode" },
+  { TPM_INVALID_FAMILY, "TPM_INVALID_FAMILY", "The command is attempting to use an invalid family ID" },
+  { TPM_NO_NV_PERMISSION, "TPM_NO_NV_PERMISSION", "The permission to manipulate the NV storage is not available" },
+  { TPM_REQUIRES_SIGN, "TPM_REQUIRES_SIGN", "The operation requires a signed command" },
+  { TPM_KEY_NOTSUPPORTED, "TPM_KEY_NOTSUPPORTED", "Wrong operation to load an NV key" },
+  { TPM_AUTH_CONFLICT, "TPM_AUTH_CONFLICT", "NV_LoadKey blob requires both owner and blob authorization" },
+  { TPM_AREA_LOCKED, "TPM_AREA_LOCKED", "The NV area is locked and not writtable" },
+  { TPM_BAD_LOCALITY, "TPM_BAD_LOCALITY", "The locality is incorrect for the attempted operation" },
+  { TPM_READ_ONLY, "TPM_READ_ONLY", "The NV area is read only and can't be written to" },
+  { TPM_PER_NOWRITE, "TPM_PER_NOWRITE", "There is no protection on the write to the NV area" },
+  { TPM_FAMILYCOUNT, "TPM_FAMILYCOUNT", "The family count value does not match" },
+  { TPM_WRITE_LOCKED, "TPM_WRITE_LOCKED", "The NV area has already been written to" },
+  { TPM_BAD_ATTRIBUTES, "TPM_BAD_ATTRIBUTES", "The NV area attributes conflict" },
+  { TPM_INVALID_STRUCTURE, "TPM_INVALID_STRUCTURE", "The structure tag and version are invalid or inconsistent" },
+  { TPM_KEY_OWNER_CONTROL, "TPM_KEY_OWNER_CONTROL", "The key is under control of the TPM Owner and can only be evicted by the TPM Owner." },
+  { TPM_BAD_COUNTER, "TPM_BAD_COUNTER", "The counter handle is incorrect" },
+  { TPM_NOT_FULLWRITE, "TPM_NOT_FULLWRITE", "The write is not a complete write of the area" },
+  { TPM_CONTEXT_GAP, "TPM_CONTEXT_GAP", "The gap between saved context counts is too large" },
+  { TPM_MAXNVWRITES, "TPM_MAXNVWRITES", "The maximum number of NV writes without an owner has been exceeded" },
+  { TPM_NOOPERATOR, "TPM_NOOPERATOR", "No operator authorization value is set" },
+  { TPM_RESOURCEMISSING, "TPM_RESOURCEMISSING", "The resource pointed to by context is not loaded" },
+  { TPM_DELEGATE_LOCK, "TPM_DELEGATE_LOCK", "The delegate administration is locked" },
+  { TPM_DELEGATE_FAMILY, "TPM_DELEGATE_FAMILY", "Attempt to manage a family other then the delegated family" },
+  { TPM_DELEGATE_ADMIN, "TPM_DELEGATE_ADMIN", "Delegation table management not enabled" },
+  { TPM_TRANSPORT_EXCLUSIVE, "TPM_TRANSPORT_EXCLUSIVE", "There was a command executed outside of an exclusive transport session" },
+};
+
+
+// helper function for the error codes:
+const char* tpm_get_error_name (TPM_RESULT code) {
+  // just do a linear scan for now
+  unsigned i;
+  for (i = 0; i < sizeof(error_msgs)/sizeof(error_msgs[0]); i++)
+    if (code == error_msgs[i].code)
+      return error_msgs[i].code_name;
+
+    return("Unknown Error Code");
+}
diff --git a/stubdom/vtpmmgr/log.h b/stubdom/vtpmmgr/log.h
new file mode 100644
index 0000000..5c7abf5
--- /dev/null
+++ b/stubdom/vtpmmgr/log.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __VTPM_LOG_H__
+#define __VTPM_LOG_H__
+
+#include <stdint.h>             // for uint32_t
+#include <stddef.h>             // for pointer NULL
+#include <stdio.h>
+#include "tcg.h"
+
+// =========================== LOGGING ==============================
+
+// the logging module numbers
+#define VTPM_LOG_TPM         1
+#define VTPM_LOG_TPM_DEEP    2
+#define VTPM_LOG_VTPM        3
+#define VTPM_LOG_VTPM_DEEP   4
+#define VTPM_LOG_TXDATA      5
+
+extern char *module_names[];
+
+// Default to standard logging
+#ifndef LOGGING_MODULES
+#define LOGGING_MODULES (BITMASK(VTPM_LOG_VTPM)|BITMASK(VTPM_LOG_TPM))
+#endif
+
+// bit-access macros
+#define BITMASK(idx)      ( 1U << (idx) )
+#define GETBIT(num,idx)   ( ((num) & BITMASK(idx)) >> idx )
+#define SETBIT(num,idx)   (num) |= BITMASK(idx)
+#define CLEARBIT(num,idx) (num) &= ( ~ BITMASK(idx) )
+
+#define vtpmloginfo(module, fmt, args...) \
+  if (GETBIT (LOGGING_MODULES, module) == 1) {				\
+    fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); \
+  }
+
+#define vtpmloginfomore(module, fmt, args...) \
+  if (GETBIT (LOGGING_MODULES, module) == 1) {			      \
+    fprintf (stdout, fmt,##args);				      \
+  }
+
+#define vtpmlogerror(module, fmt, args...) \
+  fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
+
+//typedef UINT32 tpm_size_t;
+
+// helper function for the error codes:
+const char* tpm_get_error_name (TPM_RESULT code);
+
+#endif // _VTPM_LOG_H_
diff --git a/stubdom/vtpmmgr/marshal.h b/stubdom/vtpmmgr/marshal.h
new file mode 100644
index 0000000..77d32f0
--- /dev/null
+++ b/stubdom/vtpmmgr/marshal.h
@@ -0,0 +1,528 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef MARSHAL_H
+#define MARSHAL_H
+
+#include <stdlib.h>
+#include <mini-os/byteorder.h>
+#include <mini-os/endian.h>
+#include "tcg.h"
+
+typedef enum UnpackPtr {
+   UNPACK_ALIAS,
+   UNPACK_ALLOC
+} UnpackPtr;
+
+inline BYTE* pack_BYTE(BYTE* ptr, BYTE t) {
+   ptr[0] = t;
+   return ++ptr;
+}
+
+inline BYTE* unpack_BYTE(BYTE* ptr, BYTE* t) {
+   t[0] = ptr[0];
+   return ++ptr;
+}
+
+#define pack_BOOL(p, t) pack_BYTE(p, t)
+#define unpack_BOOL(p, t) unpack_BYTE(p, t)
+
+inline BYTE* pack_UINT16(BYTE* ptr, UINT16 t) {
+   BYTE* b = (BYTE*)&t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   ptr[0] = b[1];
+   ptr[1] = b[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   ptr[0] = b[0];
+   ptr[1] = b[1];
+#endif
+   return ptr + sizeof(UINT16);
+}
+
+inline BYTE* unpack_UINT16(BYTE* ptr, UINT16* t) {
+   BYTE* b = (BYTE*)t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   b[0] = ptr[1];
+   b[1] = ptr[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   b[0] = ptr[0];
+   b[1] = ptr[1];
+#endif
+   return ptr + sizeof(UINT16);
+}
+
+inline BYTE* pack_UINT32(BYTE* ptr, UINT32 t) {
+   BYTE* b = (BYTE*)&t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   ptr[3] = b[0];
+   ptr[2] = b[1];
+   ptr[1] = b[2];
+   ptr[0] = b[3];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   ptr[0] = b[0];
+   ptr[1] = b[1];
+   ptr[2] = b[2];
+   ptr[3] = b[3];
+#endif
+   return ptr + sizeof(UINT32);
+}
+
+inline BYTE* unpack_UINT32(BYTE* ptr, UINT32* t) {
+   BYTE* b = (BYTE*)t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   b[0] = ptr[3];
+   b[1] = ptr[2];
+   b[2] = ptr[1];
+   b[3] = ptr[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   b[0] = ptr[0];
+   b[1] = ptr[1];
+   b[2] = ptr[2];
+   b[3] = ptr[3];
+#endif
+   return ptr + sizeof(UINT32);
+}
+
+#define pack_TPM_RESULT(p, t) pack_UINT32(p, t)
+#define pack_TPM_PCRINDEX(p, t) pack_UINT32(p, t)
+#define pack_TPM_DIRINDEX(p, t) pack_UINT32(p, t)
+#define pack_TPM_HANDLE(p, t) pack_UINT32(p, t)
+#define pack_TPM_AUTHHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_HASHHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_HMACHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_ENCHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TPM_KEY_HANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_ENTITYHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TPM_RESOURCE_TYPE(p, t) pack_UINT32(p, t)
+#define pack_TPM_COMMAND_CODE(p, t) pack_UINT32(p, t)
+#define pack_TPM_PROTOCOL_ID(p, t) pack_UINT16(p, t)
+#define pack_TPM_AUTH_DATA_USAGE(p, t) pack_BYTE(p, t)
+#define pack_TPM_ENTITY_TYPE(p, t) pack_UINT16(p, t)
+#define pack_TPM_ALGORITHM_ID(p, t) pack_UINT32(p, t)
+#define pack_TPM_KEY_USAGE(p, t) pack_UINT16(p, t)
+#define pack_TPM_STARTUP_TYPE(p, t) pack_UINT16(p, t)
+#define pack_TPM_CAPABILITY_AREA(p, t) pack_UINT32(p, t)
+#define pack_TPM_ENC_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_SIG_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_MIGRATE_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_PHYSICAL_PRESENCE(p, t) pack_UINT16(p, t)
+#define pack_TPM_KEY_FLAGS(p, t) pack_UINT32(p, t)
+
+#define unpack_TPM_RESULT(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_PCRINDEX(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_DIRINDEX(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_HANDLE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_AUTHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_HASHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_HMACHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_ENCHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TPM_KEY_HANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_ENTITYHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TPM_RESOURCE_TYPE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_COMMAND_CODE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_PROTOCOL_ID(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_AUTH_DATA_USAGE(p, t) unpack_BYTE(p, t)
+#define unpack_TPM_ENTITY_TYPE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_ALGORITHM_ID(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_KEY_USAGE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_STARTUP_TYPE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_CAPABILITY_AREA(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_ENC_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_SIG_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_MIGRATE_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_PHYSICAL_PRESENCE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_KEY_FLAGS(p, t) unpack_UINT32(p, t)
+
+#define pack_TPM_AUTH_HANDLE(p, t) pack_UINT32(p, t);
+#define pack_TCS_CONTEXT_HANDLE(p, t) pack_UINT32(p, t);
+#define pack_TCS_KEY_HANDLE(p, t) pack_UINT32(p, t);
+
+#define unpack_TPM_AUTH_HANDLE(p, t) unpack_UINT32(p, t);
+#define unpack_TCS_CONTEXT_HANDLE(p, t) unpack_UINT32(p, t);
+#define unpack_TCS_KEY_HANDLE(p, t) unpack_UINT32(p, t);
+
+inline BYTE* pack_BUFFER(BYTE* ptr, const BYTE* buf, UINT32 size) {
+   memcpy(ptr, buf, size);
+   return ptr + size;
+}
+
+inline BYTE* unpack_BUFFER(BYTE* ptr, BYTE* buf, UINT32 size) {
+   memcpy(buf, ptr, size);
+   return ptr + size;
+}
+
+inline BYTE* unpack_ALIAS(BYTE* ptr, BYTE** buf, UINT32 size) {
+   *buf = ptr;
+   return ptr + size;
+}
+
+inline BYTE* unpack_ALLOC(BYTE* ptr, BYTE** buf, UINT32 size) {
+   if(size) {
+      *buf = malloc(size);
+      memcpy(*buf, ptr, size);
+   } else {
+      *buf = NULL;
+   }
+   return ptr + size;
+}
+
+inline BYTE* unpack_PTR(BYTE* ptr, BYTE** buf, UINT32 size, UnpackPtr alloc) {
+   if(alloc == UNPACK_ALLOC) {
+      return unpack_ALLOC(ptr, buf, size);
+   } else {
+      return unpack_ALIAS(ptr, buf, size);
+   }
+}
+
+inline BYTE* pack_TPM_AUTHDATA(BYTE* ptr, const TPM_AUTHDATA* d) {
+   return pack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_AUTHDATA(BYTE* ptr, TPM_AUTHDATA* d) {
+   return unpack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
+}
+
+#define pack_TPM_SECRET(p, t) pack_TPM_AUTHDATA(p, t)
+#define pack_TPM_ENCAUTH(p, t) pack_TPM_AUTHDATA(p, t)
+#define pack_TPM_PAYLOAD_TYPE(p, t) pack_BYTE(p, t)
+#define pack_TPM_TAG(p, t) pack_UINT16(p, t)
+#define pack_TPM_STRUCTURE_TAG(p, t) pack_UINT16(p, t)
+
+#define unpack_TPM_SECRET(p, t) unpack_TPM_AUTHDATA(p, t)
+#define unpack_TPM_ENCAUTH(p, t) unpack_TPM_AUTHDATA(p, t)
+#define unpack_TPM_PAYLOAD_TYPE(p, t) unpack_BYTE(p, t)
+#define unpack_TPM_TAG(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_STRUCTURE_TAG(p, t) unpack_UINT16(p, t)
+
+inline BYTE* pack_TPM_VERSION(BYTE* ptr, const TPM_VERSION* t) {
+   ptr[0] = t->major;
+   ptr[1] = t->minor;
+   ptr[2] = t->revMajor;
+   ptr[3] = t->revMinor;
+   return ptr + 4;
+}
+
+inline BYTE* unpack_TPM_VERSION(BYTE* ptr, TPM_VERSION* t) {
+   t->major = ptr[0];
+   t->minor = ptr[1];
+   t->revMajor = ptr[2];
+   t->revMinor = ptr[3];
+   return ptr + 4;
+}
+
+inline BYTE* pack_TPM_CAP_VERSION_INFO(BYTE* ptr, const TPM_CAP_VERSION_INFO* v) {
+   ptr = pack_TPM_STRUCTURE_TAG(ptr, v->tag);
+   ptr = pack_TPM_VERSION(ptr, &v->version);
+   ptr = pack_UINT16(ptr, v->specLevel);
+   ptr = pack_BYTE(ptr, v->errataRev);
+   ptr = pack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));
+   ptr = pack_UINT16(ptr, v->vendorSpecificSize);
+   ptr = pack_BUFFER(ptr, v->vendorSpecific, v->vendorSpecificSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_CAP_VERSION_INFO(BYTE* ptr, TPM_CAP_VERSION_INFO* v, UnpackPtr alloc) {
+   ptr = unpack_TPM_STRUCTURE_TAG(ptr, &v->tag);
+   ptr = unpack_TPM_VERSION(ptr, &v->version);
+   ptr = unpack_UINT16(ptr, &v->specLevel);
+   ptr = unpack_BYTE(ptr, &v->errataRev);
+   ptr = unpack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));
+   ptr = unpack_UINT16(ptr, &v->vendorSpecificSize);
+   ptr = unpack_PTR(ptr, &v->vendorSpecific, v->vendorSpecificSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_DIGEST(BYTE* ptr, const TPM_DIGEST* d) {
+   return pack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_DIGEST(BYTE* ptr, TPM_DIGEST* d) {
+   return unpack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
+}
+
+#define pack_TPM_PCRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_PCRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_COMPOSITE_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_COMPOSITE_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_DIRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_DIRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_HMAC(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_HMAC(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_CHOSENID_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_CHOSENID_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+inline BYTE* pack_TPM_NONCE(BYTE* ptr, const TPM_NONCE* n) {
+   return pack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_NONCE(BYTE* ptr, TPM_NONCE* n) {
+   return unpack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* pack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, const TPM_SYMMETRIC_KEY_PARMS* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_UINT32(ptr, k->blockSize);
+   ptr = pack_UINT32(ptr, k->ivSize);
+   return pack_BUFFER(ptr, k->IV, k->ivSize);
+}
+
+inline BYTE* unpack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, TPM_SYMMETRIC_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_UINT32(ptr, &k->blockSize);
+   ptr = unpack_UINT32(ptr, &k->ivSize);
+   return unpack_PTR(ptr, &k->IV, k->ivSize, alloc);
+}
+
+inline BYTE* pack_TPM_RSA_KEY_PARMS(BYTE* ptr, const TPM_RSA_KEY_PARMS* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_UINT32(ptr, k->numPrimes);
+   ptr = pack_UINT32(ptr, k->exponentSize);
+   return pack_BUFFER(ptr, k->exponent, k->exponentSize);
+}
+
+inline BYTE* unpack_TPM_RSA_KEY_PARMS(BYTE* ptr, TPM_RSA_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_UINT32(ptr, &k->numPrimes);
+   ptr = unpack_UINT32(ptr, &k->exponentSize);
+   return unpack_PTR(ptr, &k->exponent, k->exponentSize, alloc);
+}
+
+inline BYTE* pack_TPM_KEY_PARMS(BYTE* ptr, const TPM_KEY_PARMS* k) {
+   ptr = pack_TPM_ALGORITHM_ID(ptr, k->algorithmID);
+   ptr = pack_TPM_ENC_SCHEME(ptr, k->encScheme);
+   ptr = pack_TPM_SIG_SCHEME(ptr, k->sigScheme);
+   ptr = pack_UINT32(ptr, k->parmSize);
+
+   if(k->parmSize) {
+      switch(k->algorithmID) {
+         case TPM_ALG_RSA:
+            return pack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa);
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            return pack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym);
+      }
+   }
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_KEY_PARMS(BYTE* ptr, TPM_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_ALGORITHM_ID(ptr, &k->algorithmID);
+   ptr = unpack_TPM_ENC_SCHEME(ptr, &k->encScheme);
+   ptr = unpack_TPM_SIG_SCHEME(ptr, &k->sigScheme);
+   ptr = unpack_UINT32(ptr, &k->parmSize);
+
+   if(k->parmSize) {
+      switch(k->algorithmID) {
+         case TPM_ALG_RSA:
+            return unpack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa, alloc);
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            return unpack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym, alloc);
+      }
+   }
+   return ptr;
+}
+
+inline BYTE* pack_TPM_STORE_PUBKEY(BYTE* ptr, const TPM_STORE_PUBKEY* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_BUFFER(ptr, k->key, k->keyLength);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_STORE_PUBKEY(BYTE* ptr, TPM_STORE_PUBKEY* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_PTR(ptr, &k->key, k->keyLength, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PUBKEY(BYTE* ptr, const TPM_PUBKEY* k) {
+   ptr = pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
+   return pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
+}
+
+inline BYTE* unpack_TPM_PUBKEY(BYTE* ptr, TPM_PUBKEY* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
+   return unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
+}
+
+inline BYTE* pack_TPM_PCR_SELECTION(BYTE* ptr, const TPM_PCR_SELECTION* p) {
+   ptr = pack_UINT16(ptr, p->sizeOfSelect);
+   ptr = pack_BUFFER(ptr, p->pcrSelect, p->sizeOfSelect);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_SELECTION(BYTE* ptr, TPM_PCR_SELECTION* p, UnpackPtr alloc) {
+   ptr = unpack_UINT16(ptr, &p->sizeOfSelect);
+   ptr = unpack_PTR(ptr, &p->pcrSelect, p->sizeOfSelect, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PCR_INFO(BYTE* ptr, const TPM_PCR_INFO* p) {
+   ptr = pack_TPM_PCR_SELECTION(ptr, &p->pcrSelection);
+   ptr = pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
+   ptr = pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_INFO(BYTE* ptr, TPM_PCR_INFO* p, UnpackPtr alloc) {
+   ptr = unpack_TPM_PCR_SELECTION(ptr, &p->pcrSelection, alloc);
+   ptr = unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
+   ptr = unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PCR_COMPOSITE(BYTE* ptr, const TPM_PCR_COMPOSITE* p) {
+   ptr = pack_TPM_PCR_SELECTION(ptr, &p->select);
+   ptr = pack_UINT32(ptr, p->valueSize);
+   ptr = pack_BUFFER(ptr, (const BYTE*)p->pcrValue, p->valueSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_COMPOSITE(BYTE* ptr, TPM_PCR_COMPOSITE* p, UnpackPtr alloc) {
+   ptr = unpack_TPM_PCR_SELECTION(ptr, &p->select, alloc);
+   ptr = unpack_UINT32(ptr, &p->valueSize);
+   ptr = unpack_PTR(ptr, (BYTE**)&p->pcrValue, p->valueSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_KEY(BYTE* ptr, const TPM_KEY* k) {
+   ptr = pack_TPM_VERSION(ptr, &k->ver);
+   ptr = pack_TPM_KEY_USAGE(ptr, k->keyUsage);
+   ptr = pack_TPM_KEY_FLAGS(ptr, k->keyFlags);
+   ptr = pack_TPM_AUTH_DATA_USAGE(ptr, k->authDataUsage);
+   ptr = pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
+   ptr = pack_UINT32(ptr, k->PCRInfoSize);
+   if(k->PCRInfoSize) {
+      ptr = pack_TPM_PCR_INFO(ptr, &k->PCRInfo);
+   }
+   ptr = pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
+   ptr = pack_UINT32(ptr, k->encDataSize);
+   return pack_BUFFER(ptr, k->encData, k->encDataSize);
+}
+
+inline BYTE* unpack_TPM_KEY(BYTE* ptr, TPM_KEY* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &k->ver);
+   ptr = unpack_TPM_KEY_USAGE(ptr, &k->keyUsage);
+   ptr = unpack_TPM_KEY_FLAGS(ptr, &k->keyFlags);
+   ptr = unpack_TPM_AUTH_DATA_USAGE(ptr, &k->authDataUsage);
+   ptr = unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
+   ptr = unpack_UINT32(ptr, &k->PCRInfoSize);
+   if(k->PCRInfoSize) {
+      ptr = unpack_TPM_PCR_INFO(ptr, &k->PCRInfo, alloc);
+   }
+   ptr = unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
+   ptr = unpack_UINT32(ptr, &k->encDataSize);
+   return unpack_PTR(ptr, &k->encData, k->encDataSize, alloc);
+}
+
+inline BYTE* pack_TPM_BOUND_DATA(BYTE* ptr, const TPM_BOUND_DATA* b, UINT32 payloadSize) {
+   ptr = pack_TPM_VERSION(ptr, &b->ver);
+   ptr = pack_TPM_PAYLOAD_TYPE(ptr, b->payload);
+   return pack_BUFFER(ptr, b->payloadData, payloadSize);
+}
+
+inline BYTE* unpack_TPM_BOUND_DATA(BYTE* ptr, TPM_BOUND_DATA* b, UINT32 payloadSize, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &b->ver);
+   ptr = unpack_TPM_PAYLOAD_TYPE(ptr, &b->payload);
+   return unpack_PTR(ptr, &b->payloadData, payloadSize, alloc);
+}
+
+inline BYTE* pack_TPM_STORED_DATA(BYTE* ptr, const TPM_STORED_DATA* d) {
+   ptr = pack_TPM_VERSION(ptr, &d->ver);
+   ptr = pack_UINT32(ptr, d->sealInfoSize);
+   if(d->sealInfoSize) {
+      ptr = pack_TPM_PCR_INFO(ptr, &d->sealInfo);
+   }
+   ptr = pack_UINT32(ptr, d->encDataSize);
+   ptr = pack_BUFFER(ptr, d->encData, d->encDataSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_STORED_DATA(BYTE* ptr, TPM_STORED_DATA* d, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &d->ver);
+   ptr = unpack_UINT32(ptr, &d->sealInfoSize);
+   if(d->sealInfoSize) {
+      ptr = unpack_TPM_PCR_INFO(ptr, &d->sealInfo, alloc);
+   }
+   ptr = unpack_UINT32(ptr, &d->encDataSize);
+   ptr = unpack_PTR(ptr, &d->encData, d->encDataSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_AUTH_SESSION(BYTE* ptr, const TPM_AUTH_SESSION* auth) {
+   ptr = pack_TPM_AUTH_HANDLE(ptr, auth->AuthHandle);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+   ptr = pack_TPM_AUTHDATA(ptr, &auth->HMAC);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_AUTH_SESSION(BYTE* ptr, TPM_AUTH_SESSION* auth) {
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = unpack_BOOL(ptr, &auth->fContinueAuthSession);
+   ptr = unpack_TPM_AUTHDATA(ptr, &auth->HMAC);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_RQU_HEADER(BYTE* ptr,
+      TPM_TAG tag,
+      UINT32 size,
+      TPM_COMMAND_CODE ord) {
+   ptr = pack_UINT16(ptr, tag);
+   ptr = pack_UINT32(ptr, size);
+   return pack_UINT32(ptr, ord);
+}
+
+inline BYTE* unpack_TPM_RQU_HEADER(BYTE* ptr,
+      TPM_TAG* tag,
+      UINT32* size,
+      TPM_COMMAND_CODE* ord) {
+   ptr = unpack_UINT16(ptr, tag);
+   ptr = unpack_UINT32(ptr, size);
+   ptr = unpack_UINT32(ptr, ord);
+   return ptr;
+}
+
+#define pack_TPM_RSP_HEADER(p, t, s, r) pack_TPM_RQU_HEADER(p, t, s, r);
+#define unpack_TPM_RSP_HEADER(p, t, s, r) unpack_TPM_RQU_HEADER(p, t, s, r);
+
+#endif
diff --git a/stubdom/vtpmmgr/minios.cfg b/stubdom/vtpmmgr/minios.cfg
new file mode 100644
index 0000000..3fb383d
--- /dev/null
+++ b/stubdom/vtpmmgr/minios.cfg
@@ -0,0 +1,14 @@
+CONFIG_TPMFRONT=y
+CONFIG_TPM_TIS=y
+CONFIG_TPMBACK=y
+CONFIG_START_NETWORK=n
+CONFIG_TEST=n
+CONFIG_PCIFRONT=n
+CONFIG_BLKFRONT=y
+CONFIG_NETFRONT=n
+CONFIG_FBFRONT=n
+CONFIG_KBDFRONT=n
+CONFIG_CONSFRONT=n
+CONFIG_XENBUS=y
+CONFIG_LWIP=n
+CONFIG_XC=n
diff --git a/stubdom/vtpmmgr/tcg.h b/stubdom/vtpmmgr/tcg.h
new file mode 100644
index 0000000..7687eae
--- /dev/null
+++ b/stubdom/vtpmmgr/tcg.h
@@ -0,0 +1,707 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005 Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __TCG_H__
+#define __TCG_H__
+
+#include <stdlib.h>
+#include <stdint.h>
+
+// **************************** CONSTANTS *********************************
+
+// BOOL values
+#define TRUE 0x01
+#define FALSE 0x00
+
+#define TCPA_MAX_BUFFER_LENGTH 0x2000
+
+//
+// TPM_COMMAND_CODE values
+#define TPM_PROTECTED_ORDINAL 0x00000000UL
+#define TPM_UNPROTECTED_ORDINAL 0x80000000UL
+#define TPM_CONNECTION_ORDINAL 0x40000000UL
+#define TPM_VENDOR_ORDINAL 0x20000000UL
+
+#define TPM_ORD_OIAP                     (10UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OSAP                     (11UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuth               (12UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_TakeOwnership            (13UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthAsymStart      (14UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthAsymFinish     (15UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthOwner          (16UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Extend                   (20UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PcrRead                  (21UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Quote                    (22UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Seal                     (23UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Unseal                   (24UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DirWriteAuth             (25UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DirRead                  (26UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_UnBind                   (30UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateWrapKey            (31UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadKey                  (32UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetPubKey                (33UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_EvictKey                 (34UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateMigrationBlob      (40UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReWrapKey                (41UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ConvertMigrationBlob     (42UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_AuthorizeMigrationKey    (43UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateMaintenanceArchive (44UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadMaintenanceArchive   (45UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_KillMaintenanceFeature   (46UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadManuMaintPub         (47UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadManuMaintPub         (48UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CertifyKey               (50UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Sign                     (60UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetRandom                (70UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_StirRandom               (71UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SelfTestFull             (80UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SelfTestStartup          (81UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CertifySelfTest          (82UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ContinueSelfTest         (83UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetTestResult            (84UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Reset                    (90UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerClear               (91UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisableOwnerClear        (92UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ForceClear               (93UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisableForceClear        (94UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapabilitySigned      (100UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapability            (101UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapabilityOwner       (102UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerSetDisable          (110UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalEnable           (111UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalDisable          (112UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetOwnerInstall          (113UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalSetDeactivated   (114UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetTempDeactivated       (115UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateEndorsementKeyPair (120UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_MakeIdentity             (121UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ActivateIdentity         (122UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadPubek                (124UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerReadPubek           (125UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisablePubekRead         (126UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetAuditEvent            (130UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetAuditEventSigned      (131UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetOrdinalAuditStatus    (140UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetOrdinalAuditStatus    (141UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Terminate_Handle         (150UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Init                     (151UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveState                (152UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Startup                  (153UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetRedirection           (154UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Start                (160UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Update               (161UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Complete             (162UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1CompleteExtend       (163UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_FieldUpgrade             (170UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveKeyContext           (180UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadKeyContext           (181UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveAuthContext          (182UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadAuthContext          (183UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveContext                      (184UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadContext                      (185UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_FlushSpecific                    (186UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PCR_Reset                        (200UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_DefineSpace                   (204UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_WriteValue                    (205UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_WriteValueAuth                (206UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_ReadValue                     (207UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_ReadValueAuth                 (208UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_UpdateVerification      (209UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_Manage                  (210UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_CreateKeyDelegation     (212UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_CreateOwnerDelegation   (213UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_VerifyDelegation        (214UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_LoadOwnerDelegation     (216UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_ReadAuth                (217UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_ReadTable               (219UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateCounter                    (220UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_IncrementCounter                 (221UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadCounter                      (222UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseCounter                   (223UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseCounterOwner              (224UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_EstablishTransport               (230UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ExecuteTransport                 (231UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseTransportSigned           (232UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetTicks                         (241UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_TickStampBlob                    (242UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_MAX                              (256UL + TPM_PROTECTED_ORDINAL)
+
+#define TSC_ORD_PhysicalPresence         (10UL + TPM_CONNECTION_ORDINAL)
+
+
+
+//
+// TPM_RESULT values
+//
+// just put in the whole table from spec 1.2
+
+#define TPM_BASE   0x0 // The start of TPM return codes
+#define TPM_VENDOR_ERROR 0x00000400 // Mask to indicate that the error code is vendor specific for vendor specific commands
+#define TPM_NON_FATAL  0x00000800 // Mask to indicate that the error code is a non-fatal failure.
+
+#define TPM_SUCCESS   TPM_BASE // Successful completion of the operation
+#define TPM_AUTHFAIL      TPM_BASE + 1 // Authentication failed
+#define TPM_BADINDEX      TPM_BASE + 2 // The index to a PCR, DIR or other register is incorrect
+#define TPM_BAD_PARAMETER     TPM_BASE + 3 // One or more parameter is bad
+#define TPM_AUDITFAILURE     TPM_BASE + 4 // An operation completed successfully but the auditing of that operation failed.
+#define TPM_CLEAR_DISABLED     TPM_BASE + 5 // The clear disable flag is set and all clear operations now require physical access
+#define TPM_DEACTIVATED     TPM_BASE + 6 // The TPM is deactivated
+#define TPM_DISABLED      TPM_BASE + 7 // The TPM is disabled
+#define TPM_DISABLED_CMD     TPM_BASE + 8 // The target command has been disabled
+#define TPM_FAIL       TPM_BASE + 9 // The operation failed
+#define TPM_BAD_ORDINAL     TPM_BASE + 10 // The ordinal was unknown or inconsistent
+#define TPM_INSTALL_DISABLED   TPM_BASE + 11 // The ability to install an owner is disabled
+#define TPM_INVALID_KEYHANDLE  TPM_BASE + 12 // The key handle presented was invalid
+#define TPM_KEYNOTFOUND     TPM_BASE + 13 // The target key was not found
+#define TPM_INAPPROPRIATE_ENC  TPM_BASE + 14 // Unacceptable encryption scheme
+#define TPM_MIGRATEFAIL     TPM_BASE + 15 // Migration authorization failed
+#define TPM_INVALID_PCR_INFO   TPM_BASE + 16 // PCR information could not be interpreted
+#define TPM_NOSPACE      TPM_BASE + 17 // No room to load key.
+#define TPM_NOSRK       TPM_BASE + 18 // There is no SRK set
+#define TPM_NOTSEALED_BLOB     TPM_BASE + 19 // An encrypted blob is invalid or was not created by this TPM
+#define TPM_OWNER_SET      TPM_BASE + 20 // There is already an Owner
+#define TPM_RESOURCES      TPM_BASE + 21 // The TPM has insufficient internal resources to perform the requested action.
+#define TPM_SHORTRANDOM     TPM_BASE + 22 // A random string was too short
+#define TPM_SIZE       TPM_BASE + 23 // The TPM does not have the space to perform the operation.
+#define TPM_WRONGPCRVAL     TPM_BASE + 24 // The named PCR value does not match the current PCR value.
+#define TPM_BAD_PARAM_SIZE     TPM_BASE + 25 // The paramSize argument to the command has the incorrect value
+#define TPM_SHA_THREAD      TPM_BASE + 26 // There is no existing SHA-1 thread.
+#define TPM_SHA_ERROR      TPM_BASE + 27 // The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error.
+#define TPM_FAILEDSELFTEST     TPM_BASE + 28 // Self-test has failed and the TPM has shutdown.
+#define TPM_AUTH2FAIL      TPM_BASE + 29 // The authorization for the second key in a 2 key function failed authorization
+#define TPM_BADTAG       TPM_BASE + 30 // The tag value sent to for a command is invalid
+#define TPM_IOERROR      TPM_BASE + 31 // An IO error occurred transmitting information to the TPM
+#define TPM_ENCRYPT_ERROR     TPM_BASE + 32 // The encryption process had a problem.
+#define TPM_DECRYPT_ERROR     TPM_BASE + 33 // The decryption process did not complete.
+#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 // An invalid handle was used.
+#define TPM_NO_ENDORSEMENT     TPM_BASE + 35 // The TPM does not a EK installed
+#define TPM_INVALID_KEYUSAGE   TPM_BASE + 36 // The usage of a key is not allowed
+#define TPM_WRONG_ENTITYTYPE   TPM_BASE + 37 // The submitted entity type is not allowed
+#define TPM_INVALID_POSTINIT   TPM_BASE + 38 // The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup
+#define TPM_INAPPROPRIATE_SIG  TPM_BASE + 39 // Signed data cannot include additional DER information
+#define TPM_BAD_KEY_PROPERTY   TPM_BASE + 40 // The key properties in TPM_KEY_PARMs are not supported by this TPM
+
+#define TPM_BAD_MIGRATION      TPM_BASE + 41 // The migration properties of this key are incorrect.
+#define TPM_BAD_SCHEME       TPM_BASE + 42 // The signature or encryption scheme for this key is incorrect or not permitted in this situation.
+#define TPM_BAD_DATASIZE      TPM_BASE + 43 // The size of the data (or blob) parameter is bad or inconsistent with the referenced key
+#define TPM_BAD_MODE       TPM_BASE + 44 // A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob.
+#define TPM_BAD_PRESENCE      TPM_BASE + 45 // Either the physicalPresence or physicalPresenceLock bits have the wrong value
+#define TPM_BAD_VERSION      TPM_BASE + 46 // The TPM cannot perform this version of the capability
+#define TPM_NO_WRAP_TRANSPORT     TPM_BASE + 47 // The TPM does not allow for wrapped transport sessions
+#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 // TPM audit construction failed and the underlying command was returning a failure code also
+#define TPM_AUDITFAIL_SUCCESSFUL   TPM_BASE + 49 // TPM audit construction failed and the underlying command was returning success
+#define TPM_NOTRESETABLE      TPM_BASE + 50 // Attempt to reset a PCR register that does not have the resettable attribute
+#define TPM_NOTLOCAL       TPM_BASE + 51 // Attempt to reset a PCR register that requires locality and locality modifier not part of command transport
+#define TPM_BAD_TYPE       TPM_BASE + 52 // Make identity blob not properly typed
+#define TPM_INVALID_RESOURCE     TPM_BASE + 53 // When saving context identified resource type does not match actual resource
+#define TPM_NOTFIPS       TPM_BASE + 54 // The TPM is attempting to execute a command only available when in FIPS mode
+#define TPM_INVALID_FAMILY      TPM_BASE + 55 // The command is attempting to use an invalid family ID
+#define TPM_NO_NV_PERMISSION     TPM_BASE + 56 // The permission to manipulate the NV storage is not available
+#define TPM_REQUIRES_SIGN      TPM_BASE + 57 // The operation requires a signed command
+#define TPM_KEY_NOTSUPPORTED     TPM_BASE + 58 // Wrong operation to load an NV key
+#define TPM_AUTH_CONFLICT      TPM_BASE + 59 // NV_LoadKey blob requires both owner and blob authorization
+#define TPM_AREA_LOCKED      TPM_BASE + 60 // The NV area is locked and not writtable
+#define TPM_BAD_LOCALITY      TPM_BASE + 61 // The locality is incorrect for the attempted operation
+#define TPM_READ_ONLY       TPM_BASE + 62 // The NV area is read only and can't be written to
+#define TPM_PER_NOWRITE      TPM_BASE + 63 // There is no protection on the write to the NV area
+#define TPM_FAMILYCOUNT      TPM_BASE + 64 // The family count value does not match
+#define TPM_WRITE_LOCKED      TPM_BASE + 65 // The NV area has already been written to
+#define TPM_BAD_ATTRIBUTES      TPM_BASE + 66 // The NV area attributes conflict
+#define TPM_INVALID_STRUCTURE     TPM_BASE + 67 // The structure tag and version are invalid or inconsistent
+#define TPM_KEY_OWNER_CONTROL     TPM_BASE + 68 // The key is under control of the TPM Owner and can only be evicted by the TPM Owner.
+#define TPM_BAD_COUNTER      TPM_BASE + 69 // The counter handle is incorrect
+#define TPM_NOT_FULLWRITE      TPM_BASE + 70 // The write is not a complete write of the area
+#define TPM_CONTEXT_GAP      TPM_BASE + 71 // The gap between saved context counts is too large
+#define TPM_MAXNVWRITES      TPM_BASE + 72 // The maximum number of NV writes without an owner has been exceeded
+#define TPM_NOOPERATOR       TPM_BASE + 73 // No operator authorization value is set
+#define TPM_RESOURCEMISSING     TPM_BASE + 74 // The resource pointed to by context is not loaded
+#define TPM_DELEGATE_LOCK      TPM_BASE + 75 // The delegate administration is locked
+#define TPM_DELEGATE_FAMILY     TPM_BASE + 76 // Attempt to manage a family other then the delegated family
+#define TPM_DELEGATE_ADMIN      TPM_BASE + 77 // Delegation table management not enabled
+#define TPM_TRANSPORT_EXCLUSIVE    TPM_BASE + 78 // There was a command executed outside of an exclusive transport session
+
+// TPM_STARTUP_TYPE values
+#define TPM_ST_CLEAR 0x0001
+#define TPM_ST_STATE 0x0002
+#define TPM_ST_DEACTIVATED 0x003
+
+// TPM_TAG values
+#define TPM_TAG_RQU_COMMAND 0x00c1
+#define TPM_TAG_RQU_AUTH1_COMMAND 0x00c2
+#define TPM_TAG_RQU_AUTH2_COMMAND 0x00c3
+#define TPM_TAG_RSP_COMMAND 0x00c4
+#define TPM_TAG_RSP_AUTH1_COMMAND 0x00c5
+#define TPM_TAG_RSP_AUTH2_COMMAND 0x00c6
+
+// TPM_PAYLOAD_TYPE values
+#define TPM_PT_ASYM 0x01
+#define TPM_PT_BIND 0x02
+#define TPM_PT_MIGRATE 0x03
+#define TPM_PT_MAINT 0x04
+#define TPM_PT_SEAL 0x05
+
+// TPM_ENTITY_TYPE values
+#define TPM_ET_KEYHANDLE 0x0001
+#define TPM_ET_OWNER 0x0002
+#define TPM_ET_DATA 0x0003
+#define TPM_ET_SRK 0x0004
+#define TPM_ET_KEY 0x0005
+
+/// TPM_ResourceTypes
+#define TPM_RT_KEY      0x00000001
+#define TPM_RT_AUTH     0x00000002
+#define TPM_RT_HASH     0x00000003
+#define TPM_RT_TRANS    0x00000004
+#define TPM_RT_CONTEXT  0x00000005
+#define TPM_RT_COUNTER  0x00000006
+#define TPM_RT_DELEGATE 0x00000007
+#define TPM_RT_DAA_TPM  0x00000008
+#define TPM_RT_DAA_V0   0x00000009
+#define TPM_RT_DAA_V1   0x0000000A
+
+
+
+// TPM_PROTOCOL_ID values
+#define TPM_PID_OIAP 0x0001
+#define TPM_PID_OSAP 0x0002
+#define TPM_PID_ADIP 0x0003
+#define TPM_PID_ADCP 0x0004
+#define TPM_PID_OWNER 0x0005
+
+// TPM_ALGORITHM_ID values
+#define TPM_ALG_RSA 0x00000001
+#define TPM_ALG_SHA 0x00000004
+#define TPM_ALG_HMAC 0x00000005
+#define TPM_ALG_AES128 0x00000006
+#define TPM_ALG_MFG1 0x00000007
+#define TPM_ALG_AES192 0x00000008
+#define TPM_ALG_AES256 0x00000009
+#define TPM_ALG_XOR 0x0000000A
+
+// TPM_ENC_SCHEME values
+#define TPM_ES_NONE 0x0001
+#define TPM_ES_RSAESPKCSv15 0x0002
+#define TPM_ES_RSAESOAEP_SHA1_MGF1 0x0003
+
+// TPM_SIG_SCHEME values
+#define TPM_SS_NONE 0x0001
+#define TPM_SS_RSASSAPKCS1v15_SHA1 0x0002
+#define TPM_SS_RSASSAPKCS1v15_DER 0x0003
+
+/*
+ * TPM_CAPABILITY_AREA Values for TPM_GetCapability ([TPM_Part2], Section 21.1)
+ */
+#define TPM_CAP_ORD                     0x00000001
+#define TPM_CAP_ALG                     0x00000002
+#define TPM_CAP_PID                     0x00000003
+#define TPM_CAP_FLAG                    0x00000004
+#define TPM_CAP_PROPERTY                0x00000005
+#define TPM_CAP_VERSION                 0x00000006
+#define TPM_CAP_KEY_HANDLE              0x00000007
+#define TPM_CAP_CHECK_LOADED            0x00000008
+#define TPM_CAP_SYM_MODE                0x00000009
+#define TPM_CAP_KEY_STATUS              0x0000000C
+#define TPM_CAP_NV_LIST                 0x0000000D
+#define TPM_CAP_MFR                     0x00000010
+#define TPM_CAP_NV_INDEX                0x00000011
+#define TPM_CAP_TRANS_ALG               0x00000012
+#define TPM_CAP_HANDLE                  0x00000014
+#define TPM_CAP_TRANS_ES                0x00000015
+#define TPM_CAP_AUTH_ENCRYPT            0x00000017
+#define TPM_CAP_SELECT_SIZE             0x00000018
+#define TPM_CAP_DA_LOGIC                0x00000019
+#define TPM_CAP_VERSION_VAL             0x0000001A
+
+/* subCap definitions ([TPM_Part2], Section 21.2) */
+#define TPM_CAP_PROP_PCR                0x00000101
+#define TPM_CAP_PROP_DIR                0x00000102
+#define TPM_CAP_PROP_MANUFACTURER       0x00000103
+#define TPM_CAP_PROP_KEYS               0x00000104
+#define TPM_CAP_PROP_MIN_COUNTER        0x00000107
+#define TPM_CAP_FLAG_PERMANENT          0x00000108
+#define TPM_CAP_FLAG_VOLATILE           0x00000109
+#define TPM_CAP_PROP_AUTHSESS           0x0000010A
+#define TPM_CAP_PROP_TRANSESS           0x0000010B
+#define TPM_CAP_PROP_COUNTERS           0x0000010C
+#define TPM_CAP_PROP_MAX_AUTHSESS       0x0000010D
+#define TPM_CAP_PROP_MAX_TRANSESS       0x0000010E
+#define TPM_CAP_PROP_MAX_COUNTERS       0x0000010F
+#define TPM_CAP_PROP_MAX_KEYS           0x00000110
+#define TPM_CAP_PROP_OWNER              0x00000111
+#define TPM_CAP_PROP_CONTEXT            0x00000112
+#define TPM_CAP_PROP_MAX_CONTEXT        0x00000113
+#define TPM_CAP_PROP_FAMILYROWS         0x00000114
+#define TPM_CAP_PROP_TIS_TIMEOUT        0x00000115
+#define TPM_CAP_PROP_STARTUP_EFFECT     0x00000116
+#define TPM_CAP_PROP_DELEGATE_ROW       0x00000117
+#define TPM_CAP_PROP_MAX_DAASESS        0x00000119
+#define TPM_CAP_PROP_DAASESS            0x0000011A
+#define TPM_CAP_PROP_CONTEXT_DIST       0x0000011B
+#define TPM_CAP_PROP_DAA_INTERRUPT      0x0000011C
+#define TPM_CAP_PROP_SESSIONS           0x0000011D
+#define TPM_CAP_PROP_MAX_SESSIONS       0x0000011E
+#define TPM_CAP_PROP_CMK_RESTRICTION    0x0000011F
+#define TPM_CAP_PROP_DURATION           0x00000120
+#define TPM_CAP_PROP_ACTIVE_COUNTER     0x00000122
+#define TPM_CAP_PROP_MAX_NV_AVAILABLE   0x00000123
+#define TPM_CAP_PROP_INPUT_BUFFER       0x00000124
+
+// TPM_KEY_USAGE values
+#define TPM_KEY_EK 0x0000
+#define TPM_KEY_SIGNING 0x0010
+#define TPM_KEY_STORAGE 0x0011
+#define TPM_KEY_IDENTITY 0x0012
+#define TPM_KEY_AUTHCHANGE 0X0013
+#define TPM_KEY_BIND 0x0014
+#define TPM_KEY_LEGACY 0x0015
+
+// TPM_AUTH_DATA_USAGE values
+#define TPM_AUTH_NEVER 0x00
+#define TPM_AUTH_ALWAYS 0x01
+
+// Key Handle of owner and srk
+#define TPM_OWNER_KEYHANDLE 0x40000001
+#define TPM_SRK_KEYHANDLE 0x40000000
+
+
+
+// *************************** TYPEDEFS *********************************
+typedef unsigned char BYTE;
+typedef unsigned char BOOL;
+typedef uint16_t UINT16;
+typedef uint32_t UINT32;
+typedef uint64_t UINT64;
+
+typedef UINT32 TPM_RESULT;
+typedef UINT32 TPM_PCRINDEX;
+typedef UINT32 TPM_DIRINDEX;
+typedef UINT32 TPM_HANDLE;
+typedef TPM_HANDLE TPM_AUTHHANDLE;
+typedef TPM_HANDLE TCPA_HASHHANDLE;
+typedef TPM_HANDLE TCPA_HMACHANDLE;
+typedef TPM_HANDLE TCPA_ENCHANDLE;
+typedef TPM_HANDLE TPM_KEY_HANDLE;
+typedef TPM_HANDLE TCPA_ENTITYHANDLE;
+typedef UINT32 TPM_RESOURCE_TYPE;
+typedef UINT32 TPM_COMMAND_CODE;
+typedef UINT16 TPM_PROTOCOL_ID;
+typedef BYTE TPM_AUTH_DATA_USAGE;
+typedef UINT16 TPM_ENTITY_TYPE;
+typedef UINT32 TPM_ALGORITHM_ID;
+typedef UINT16 TPM_KEY_USAGE;
+typedef UINT16 TPM_STARTUP_TYPE;
+typedef UINT32 TPM_CAPABILITY_AREA;
+typedef UINT16 TPM_ENC_SCHEME;
+typedef UINT16 TPM_SIG_SCHEME;
+typedef UINT16 TPM_MIGRATE_SCHEME;
+typedef UINT16 TPM_PHYSICAL_PRESENCE;
+typedef UINT32 TPM_KEY_FLAGS;
+
+#define TPM_DIGEST_SIZE 20  // Don't change this
+typedef BYTE TPM_AUTHDATA[TPM_DIGEST_SIZE];
+typedef TPM_AUTHDATA TPM_SECRET;
+typedef TPM_AUTHDATA TPM_ENCAUTH;
+typedef BYTE TPM_PAYLOAD_TYPE;
+typedef UINT16 TPM_TAG;
+typedef UINT16 TPM_STRUCTURE_TAG;
+
+// Data Types of the TCS
+typedef UINT32 TCS_AUTHHANDLE;  // Handle addressing a authorization session
+typedef UINT32 TCS_CONTEXT_HANDLE; // Basic context handle
+typedef UINT32 TCS_KEY_HANDLE;  // Basic key handle
+
+// ************************* STRUCTURES **********************************
+
+typedef struct TPM_VERSION {
+  BYTE major;
+  BYTE minor;
+  BYTE revMajor;
+  BYTE revMinor;
+} TPM_VERSION;
+
+static const TPM_VERSION TPM_STRUCT_VER_1_1 = { 1,1,0,0 };
+
+typedef struct TPM_CAP_VERSION_INFO {
+   TPM_STRUCTURE_TAG tag;
+   TPM_VERSION version;
+   UINT16 specLevel;
+   BYTE errataRev;
+   BYTE tpmVendorID[4];
+   UINT16 vendorSpecificSize;
+   BYTE* vendorSpecific;
+} TPM_CAP_VERSION_INFO;
+
+inline void free_TPM_CAP_VERSION_INFO(TPM_CAP_VERSION_INFO* v) {
+   free(v->vendorSpecific);
+   v->vendorSpecific = NULL;
+}
+
+typedef struct TPM_DIGEST {
+  BYTE digest[TPM_DIGEST_SIZE];
+} TPM_DIGEST;
+
+typedef TPM_DIGEST TPM_PCRVALUE;
+typedef TPM_DIGEST TPM_COMPOSITE_HASH;
+typedef TPM_DIGEST TPM_DIRVALUE;
+typedef TPM_DIGEST TPM_HMAC;
+typedef TPM_DIGEST TPM_CHOSENID_HASH;
+
+typedef struct TPM_NONCE {
+  BYTE nonce[TPM_DIGEST_SIZE];
+} TPM_NONCE;
+
+typedef struct TPM_SYMMETRIC_KEY_PARMS {
+   UINT32 keyLength;
+   UINT32 blockSize;
+   UINT32 ivSize;
+   BYTE* IV;
+} TPM_SYMMETRIC_KEY_PARMS;
+
+inline void free_TPM_SYMMETRIC_KEY_PARMS(TPM_SYMMETRIC_KEY_PARMS* p) {
+   free(p->IV);
+   p->IV = NULL;
+}
+
+#define TPM_SYMMETRIC_KEY_PARMS_INIT { 0, 0, 0, NULL }
+
+typedef struct TPM_RSA_KEY_PARMS {
+  UINT32 keyLength;
+  UINT32 numPrimes;
+  UINT32 exponentSize;
+  BYTE* exponent;
+} TPM_RSA_KEY_PARMS;
+
+#define TPM_RSA_KEY_PARMS_INIT { 0, 0, 0, NULL }
+
+inline void free_TPM_RSA_KEY_PARMS(TPM_RSA_KEY_PARMS* p) {
+   free(p->exponent);
+   p->exponent = NULL;
+}
+
+typedef struct TPM_KEY_PARMS {
+  TPM_ALGORITHM_ID algorithmID;
+  TPM_ENC_SCHEME encScheme;
+  TPM_SIG_SCHEME sigScheme;
+  UINT32 parmSize;
+  union {
+     TPM_SYMMETRIC_KEY_PARMS sym;
+     TPM_RSA_KEY_PARMS rsa;
+  } parms;
+} TPM_KEY_PARMS;
+
+#define TPM_KEY_PARMS_INIT { 0, 0, 0, 0 }
+
+inline void free_TPM_KEY_PARMS(TPM_KEY_PARMS* p) {
+   if(p->parmSize) {
+      switch(p->algorithmID) {
+         case TPM_ALG_RSA:
+            free_TPM_RSA_KEY_PARMS(&p->parms.rsa);
+            break;
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            free_TPM_SYMMETRIC_KEY_PARMS(&p->parms.sym);
+            break;
+      }
+   }
+}
+
+typedef struct TPM_STORE_PUBKEY {
+  UINT32 keyLength;
+  BYTE* key;
+} TPM_STORE_PUBKEY;
+
+#define TPM_STORE_PUBKEY_INIT { 0, NULL }
+
+inline void free_TPM_STORE_PUBKEY(TPM_STORE_PUBKEY* p) {
+   free(p->key);
+   p->key = NULL;
+}
+
+typedef struct TPM_PUBKEY {
+  TPM_KEY_PARMS algorithmParms;
+  TPM_STORE_PUBKEY pubKey;
+} TPM_PUBKEY;
+
+#define TPM_PUBKEY_INIT { TPM_KEY_PARMS_INIT, TPM_STORE_PUBKEY_INIT }
+
+inline void free_TPM_PUBKEY(TPM_PUBKEY* k) {
+   free_TPM_KEY_PARMS(&k->algorithmParms);
+   free_TPM_STORE_PUBKEY(&k->pubKey);
+}
+
+typedef struct TPM_PCR_SELECTION {
+   UINT16 sizeOfSelect;
+   BYTE* pcrSelect;
+} TPM_PCR_SELECTION;
+
+#define TPM_PCR_SELECTION_INIT { 0, NULL }
+
+inline void free_TPM_PCR_SELECTION(TPM_PCR_SELECTION* p) {
+   free(p->pcrSelect);
+   p->pcrSelect = NULL;
+}
+
+typedef struct TPM_PCR_INFO {
+   TPM_PCR_SELECTION pcrSelection;
+   TPM_COMPOSITE_HASH digestAtRelease;
+   TPM_COMPOSITE_HASH digestAtCreation;
+} TPM_PCR_INFO;
+
+#define TPM_PCR_INFO_INIT { TPM_PCR_SELECTION_INIT }
+
+inline void free_TPM_PCR_INFO(TPM_PCR_INFO* p) {
+   free_TPM_PCR_SELECTION(&p->pcrSelection);
+}
+
+typedef struct TPM_PCR_COMPOSITE {
+  TPM_PCR_SELECTION select;
+  UINT32 valueSize;
+  TPM_PCRVALUE* pcrValue;
+} TPM_PCR_COMPOSITE;
+
+#define TPM_PCR_COMPOSITE_INIT { TPM_PCR_SELECTION_INIT, 0, NULL }
+
+inline void free_TPM_PCR_COMPOSITE(TPM_PCR_COMPOSITE* p) {
+   free_TPM_PCR_SELECTION(&p->select);
+   free(p->pcrValue);
+   p->pcrValue = NULL;
+}
+
+typedef struct TPM_KEY {
+  TPM_VERSION         ver;
+  TPM_KEY_USAGE       keyUsage;
+  TPM_KEY_FLAGS       keyFlags;
+  TPM_AUTH_DATA_USAGE authDataUsage;
+  TPM_KEY_PARMS       algorithmParms;
+  UINT32              PCRInfoSize;
+  TPM_PCR_INFO        PCRInfo;
+  TPM_STORE_PUBKEY    pubKey;
+  UINT32              encDataSize;
+  BYTE*               encData;
+} TPM_KEY;
+
+#define TPM_KEY_INIT { .algorithmParms = TPM_KEY_PARMS_INIT,\
+   .PCRInfoSize = 0, .PCRInfo = TPM_PCR_INFO_INIT, \
+   .pubKey = TPM_STORE_PUBKEY_INIT, \
+   .encDataSize = 0, .encData = NULL }
+
+inline void free_TPM_KEY(TPM_KEY* k) {
+   if(k->PCRInfoSize) {
+      free_TPM_PCR_INFO(&k->PCRInfo);
+   }
+   free_TPM_STORE_PUBKEY(&k->pubKey);
+   free(k->encData);
+   k->encData = NULL;
+}
+
+typedef struct TPM_BOUND_DATA {
+  TPM_VERSION ver;
+  TPM_PAYLOAD_TYPE payload;
+  BYTE* payloadData;
+} TPM_BOUND_DATA;
+
+#define TPM_BOUND_DATA_INIT { .payloadData = NULL }
+
+inline void free_TPM_BOUND_DATA(TPM_BOUND_DATA* d) {
+   free(d->payloadData);
+   d->payloadData = NULL;
+}
+
+typedef struct TPM_STORED_DATA {
+  TPM_VERSION ver;
+  UINT32 sealInfoSize;
+  TPM_PCR_INFO sealInfo;
+  UINT32 encDataSize;
+  BYTE* encData;
+} TPM_STORED_DATA;
+
+#define TPM_STORED_DATA_INIT { .sealInfoSize = 0, sealInfo = TPM_PCR_INFO_INIT,\
+   .encDataSize = 0, .encData = NULL }
+
+inline void free_TPM_STORED_DATA(TPM_STORED_DATA* d) {
+   if(d->sealInfoSize) {
+      free_TPM_PCR_INFO(&d->sealInfo);
+   }
+   free(d->encData);
+   d->encData = NULL;
+}
+
+typedef struct TPM_AUTH_SESSION {
+  TPM_AUTHHANDLE  AuthHandle;
+  TPM_NONCE   NonceOdd;   // system
+  TPM_NONCE   NonceEven;   // TPM
+  BOOL   fContinueAuthSession;
+  TPM_AUTHDATA  HMAC;
+} TPM_AUTH_SESSION;
+
+#define TPM_AUTH_SESSION_INIT { .AuthHandle = 0, .fContinueAuthSession = FALSE }
+
+// ---------------------- Functions for checking TPM_RESULTs -----------------
+
+#include <stdio.h>
+
+// FIXME: Review use of these and delete unneeded ones.
+
+// these are really badly dependent on local structure:
+// DEPENDS: local var 'status' of type TPM_RESULT
+// DEPENDS: label 'abort_egress' which cleans up and returns the status
+#define ERRORDIE(s) do { status = s; \
+                         fprintf (stderr, "*** ERRORDIE in %s at %s: %i\n", __func__, __FILE__, __LINE__); \
+                         goto abort_egress; } \
+                    while (0)
+
+// DEPENDS: local var 'status' of type TPM_RESULT
+// DEPENDS: label 'abort_egress' which cleans up and returns the status
+// Try command c. If it fails, set status to s and goto abort.
+#define TPMTRY(s,c) if (c != TPM_SUCCESS) { \
+                       status = s; \
+                       printf("ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
+                       goto abort_egress; \
+                    } else {\
+                       status = c; \
+                    }
+
+// Try command c. If it fails, print error message, set status to actual return code. Goto abort
+#define TPMTRYRETURN(c) do { status = c; \
+                             if (status != TPM_SUCCESS) { \
+                               fprintf(stderr, "ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
+                               goto abort_egress; \
+                             } \
+                        } while(0)
+
+
+#endif //__TCPA_H__
diff --git a/stubdom/vtpmmgr/tpm.c b/stubdom/vtpmmgr/tpm.c
new file mode 100644
index 0000000..123a27c
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm.c
@@ -0,0 +1,938 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <malloc.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <polarssl/sha1.h>
+
+#include "tcg.h"
+#include "tpm.h"
+#include "log.h"
+#include "marshal.h"
+#include "tpmrsa.h"
+#include "vtpmmgr.h"
+
+#define TCPA_MAX_BUFFER_LENGTH 0x2000
+
+#define TPM_BEGIN(TAG, ORD) \
+   const TPM_TAG intag = TAG;\
+TPM_TAG tag = intag;\
+UINT32 paramSize;\
+const TPM_COMMAND_CODE ordinal = ORD;\
+TPM_RESULT status = TPM_SUCCESS;\
+BYTE in_buf[TCPA_MAX_BUFFER_LENGTH];\
+BYTE out_buf[TCPA_MAX_BUFFER_LENGTH];\
+UINT32 out_len = sizeof(out_buf);\
+BYTE* ptr = in_buf;\
+/*Print a log message */\
+vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);\
+/* Pack the header*/\
+ptr = pack_TPM_TAG(ptr, tag);\
+ptr += sizeof(UINT32);\
+ptr = pack_TPM_COMMAND_CODE(ptr, ordinal)\
+
+#define TPM_AUTH_BEGIN() \
+   sha1_context sha1_ctx;\
+BYTE* authbase = ptr - sizeof(TPM_COMMAND_CODE);\
+TPM_DIGEST paramDigest;\
+sha1_starts(&sha1_ctx)
+
+#define TPM_AUTH1_GEN(HMACkey, auth) do {\
+   sha1_finish(&sha1_ctx, paramDigest.digest);\
+   generateAuth(&paramDigest, HMACkey, auth);\
+   ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_AUTH2_GEN(HMACkey, auth) do {\
+   generateAuth(&paramDigest, HMACkey, auth);\
+   ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_TRANSMIT() do {\
+   /* Pack the command size */\
+   paramSize = ptr - in_buf;\
+   pack_UINT32(in_buf + sizeof(TPM_TAG), paramSize);\
+   if((status = TPM_TransmitData(in_buf, paramSize, out_buf, &out_len)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH_VERIFY_BEGIN() do {\
+   UINT32 buf[2] = { cpu_to_be32(status), cpu_to_be32(ordinal) };\
+   sha1_starts(&sha1_ctx);\
+   sha1_update(&sha1_ctx, (unsigned char*)buf, sizeof(buf));\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH1_VERIFY(HMACkey, auth) do {\
+   sha1_finish(&sha1_ctx, paramDigest.digest);\
+   ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+   if((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH2_VERIFY(HMACkey, auth) do {\
+   ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+   if((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+
+
+#define TPM_UNPACK_VERIFY() do { \
+   ptr = out_buf;\
+   ptr = unpack_TPM_RSP_HEADER(ptr, \
+         &(tag), &(paramSize), &(status));\
+   if((status) != TPM_SUCCESS || (tag) != (intag +3)) { \
+      vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s\n", tpm_get_error_name(status));\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH_HASH() do {\
+   sha1_update(&sha1_ctx, authbase, ptr - authbase);\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH_SKIP() do {\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH_ERR_CHECK(auth) do {\
+   if(status != TPM_SUCCESS || auth->fContinueAuthSession == FALSE) {\
+      vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM\n", auth->AuthHandle);\
+      auth->AuthHandle = 0;\
+   }\
+} while(0)
+
+static void xorEncrypt(const TPM_SECRET* sharedSecret,
+      TPM_NONCE* nonce,
+      const TPM_AUTHDATA* inAuth0,
+      TPM_ENCAUTH outAuth0,
+      const TPM_AUTHDATA* inAuth1,
+      TPM_ENCAUTH outAuth1) {
+   BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
+   BYTE XORkey[TPM_DIGEST_SIZE];
+   BYTE* ptr = XORbuffer;
+   ptr = pack_TPM_SECRET(ptr, sharedSecret);
+   ptr = pack_TPM_NONCE(ptr, nonce);
+
+   sha1(XORbuffer, ptr - XORbuffer, XORkey);
+
+   if(inAuth0) {
+      for(int i = 0; i < TPM_DIGEST_SIZE; ++i) {
+         outAuth0[i] = XORkey[i] ^ (*inAuth0)[i];
+      }
+   }
+   if(inAuth1) {
+      for(int i = 0; i < TPM_DIGEST_SIZE; ++i) {
+         outAuth1[i] = XORkey[i] ^ (*inAuth1)[i];
+      }
+   }
+
+}
+
+static void generateAuth(const TPM_DIGEST* paramDigest,
+      const TPM_SECRET* HMACkey,
+      TPM_AUTH_SESSION *auth)
+{
+   //Generate new OddNonce
+   vtpmmgr_rand((BYTE*)auth->NonceOdd.nonce, sizeof(TPM_NONCE));
+
+   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
+   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
+   BYTE* ptr = hmacText;
+
+   ptr = pack_TPM_DIGEST(ptr, paramDigest);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+
+   sha1_hmac((BYTE *) HMACkey, sizeof(TPM_DIGEST),
+         (BYTE *) hmacText, sizeof(hmacText),
+         auth->HMAC);
+}
+
+static TPM_RESULT verifyAuth(const TPM_DIGEST* paramDigest,
+      /*[IN]*/ const TPM_SECRET *HMACkey,
+      /*[IN,OUT]*/ TPM_AUTH_SESSION *auth)
+{
+
+   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
+   TPM_AUTHDATA hm;
+   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
+   BYTE* ptr = hmacText;
+
+   ptr = pack_TPM_DIGEST(ptr, paramDigest);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+
+   sha1_hmac( (BYTE *) HMACkey, sizeof(TPM_DIGEST),
+         (BYTE *) hmacText, sizeof(hmacText),
+         hm);
+
+   // Compare correct HMAC with provided one.
+   if (memcmp(hm, auth->HMAC, sizeof(TPM_DIGEST)) == 0) { // 0 indicates equality
+      return TPM_SUCCESS;
+   } else {
+      vtpmlogerror(VTPM_LOG_TPM, "Auth Session verification failed!\n");
+      return TPM_AUTHFAIL;
+   }
+}
+
+
+
+// ------------------------------------------------------------------
+// Authorization Commands
+// ------------------------------------------------------------------
+
+TPM_RESULT TPM_OIAP(TPM_AUTH_SESSION*   auth)  // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OIAP);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
+   auth->fContinueAuthSession = TRUE;
+
+   ptr = unpack_UINT32(ptr, &auth->AuthHandle);
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OIAP.\n", auth->AuthHandle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_OSAP(TPM_ENTITY_TYPE  entityType,  // in
+      UINT32    entityValue, // in
+      const TPM_AUTHDATA* usageAuth, //in
+      TPM_SECRET *sharedSecret, //out
+      TPM_AUTH_SESSION *auth)
+{
+   BYTE* nonceOddOSAP;
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OSAP);
+
+   ptr = pack_TPM_ENTITY_TYPE(ptr, entityType);
+   ptr = pack_UINT32(ptr, entityValue);
+
+   //nonce Odd OSAP
+   nonceOddOSAP = ptr;
+   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
+   ptr += TPM_DIGEST_SIZE;
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, &auth->AuthHandle);
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+
+   //Calculate session secret
+   sha1_context ctx;
+   sha1_hmac_starts(&ctx, *usageAuth, TPM_DIGEST_SIZE);
+   sha1_hmac_update(&ctx, ptr, TPM_DIGEST_SIZE); //ptr = nonceEvenOSAP
+   sha1_hmac_update(&ctx, nonceOddOSAP, TPM_DIGEST_SIZE);
+   sha1_hmac_finish(&ctx, *sharedSecret);
+
+   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
+   auth->fContinueAuthSession = FALSE;
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OSAP.\n", auth->AuthHandle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_TakeOwnership(
+      const TPM_PUBKEY *pubEK, //in
+      const TPM_AUTHDATA* ownerAuth, //in
+      const TPM_AUTHDATA* srkAuth, //in
+      const TPM_KEY* inSrk, //in
+      TPM_KEY* outSrk, //out, optional
+      TPM_AUTH_SESSION*   auth)   // in, out
+{
+   int keyAlloced = 0;
+   tpmrsa_context ek_rsa = TPMRSA_CTX_INIT;
+
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_TakeOwnership);
+   TPM_AUTH_BEGIN();
+
+   tpmrsa_set_pubkey(&ek_rsa,
+         pubEK->pubKey.key, pubEK->pubKey.keyLength,
+         pubEK->algorithmParms.parms.rsa.exponent,
+         pubEK->algorithmParms.parms.rsa.exponentSize);
+
+   /* Pack the protocol ID */
+   ptr = pack_UINT16(ptr, TPM_PID_OWNER);
+
+   /* Pack the encrypted owner auth */
+   ptr = pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength / 8);
+   tpmrsa_pub_encrypt_oaep(&ek_rsa,
+         ctr_drbg_random, &vtpm_globals.ctr_drbg,
+         sizeof(TPM_SECRET),
+         (BYTE*) ownerAuth,
+         ptr);
+   ptr += pubEK->algorithmParms.parms.rsa.keyLength / 8;
+
+   /* Pack the encrypted srk auth */
+   ptr = pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength / 8);
+   tpmrsa_pub_encrypt_oaep(&ek_rsa,
+         ctr_drbg_random, &vtpm_globals.ctr_drbg,
+         sizeof(TPM_SECRET),
+         (BYTE*) srkAuth,
+         ptr);
+   ptr += pubEK->algorithmParms.parms.rsa.keyLength / 8;
+
+   /* Pack the Srk key */
+   ptr = pack_TPM_KEY(ptr, inSrk);
+
+   /* Hash everything up to here */
+   TPM_AUTH_HASH();
+
+   /* Generate the authorization */
+   TPM_AUTH1_GEN(ownerAuth, auth);
+
+   /* Send the command to the tpm*/
+   TPM_TRANSMIT();
+   /* Unpack and validate the header */
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   if(outSrk != NULL) {
+      /* If the user wants a copy of the srk we give it to them */
+      keyAlloced = 1;
+      ptr = unpack_TPM_KEY(ptr, outSrk, UNPACK_ALLOC);
+   } else {
+      /*otherwise just parse past it */
+      TPM_KEY temp;
+      ptr = unpack_TPM_KEY(ptr, &temp, UNPACK_ALIAS);
+   }
+
+   /* Hash the output key */
+   TPM_AUTH_HASH();
+
+   /* Verify authorizaton */
+   TPM_AUTH1_VERIFY(ownerAuth, auth);
+
+   goto egress;
+abort_egress:
+   if(keyAlloced) {
+      free_TPM_KEY(outSrk);
+   }
+egress:
+   tpmrsa_free(&ek_rsa);
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+
+TPM_RESULT TPM_DisablePubekRead (
+      const TPM_AUTHDATA* ownerAuth,
+      TPM_AUTH_SESSION*   auth)
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_DisablePubekRead);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(ownerAuth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   TPM_AUTH1_VERIFY(ownerAuth, auth);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+
+TPM_RESULT TPM_TerminateHandle(TPM_AUTHHANDLE  handle)  // in
+{
+   if(handle == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Terminate_Handle);
+
+   ptr = pack_TPM_AUTHHANDLE(ptr, handle);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM_TerminateHandle\n", handle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_Extend( TPM_PCRINDEX  pcrNum,  // in
+      TPM_DIGEST  inDigest, // in
+      TPM_PCRVALUE*  outDigest) // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Extend);
+
+   ptr = pack_TPM_PCRINDEX(ptr, pcrNum);
+   ptr = pack_TPM_DIGEST(ptr, &inDigest);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_TPM_PCRVALUE(ptr, outDigest);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_Seal(
+      TPM_KEY_HANDLE  keyHandle,  // in
+      UINT32    pcrInfoSize, // in
+      TPM_PCR_INFO*    pcrInfo,  // in
+      UINT32    inDataSize,  // in
+      const BYTE*    inData,   // in
+      TPM_STORED_DATA* sealedData, //out
+      const TPM_SECRET* osapSharedSecret, //in
+      const TPM_AUTHDATA* sealedDataAuth, //in
+      TPM_AUTH_SESSION*   pubAuth  // in, out
+      )
+{
+   int dataAlloced = 0;
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_Seal);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, keyHandle);
+
+   TPM_AUTH_SKIP();
+
+   xorEncrypt(osapSharedSecret, &pubAuth->NonceEven,
+         sealedDataAuth, ptr,
+         NULL, NULL);
+   ptr += sizeof(TPM_ENCAUTH);
+
+   ptr = pack_UINT32(ptr, pcrInfoSize);
+   ptr = pack_TPM_PCR_INFO(ptr, pcrInfo);
+
+   ptr = pack_UINT32(ptr, inDataSize);
+   ptr = pack_BUFFER(ptr, inData, inDataSize);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(osapSharedSecret, pubAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_TPM_STORED_DATA(ptr, sealedData, UNPACK_ALLOC);
+   dataAlloced = 1;
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(osapSharedSecret, pubAuth);
+
+   goto egress;
+abort_egress:
+   if(dataAlloced) {
+      free_TPM_STORED_DATA(sealedData);
+   }
+egress:
+   TPM_AUTH_ERR_CHECK(pubAuth);
+   return status;
+}
+
+TPM_RESULT TPM_Unseal(
+      TPM_KEY_HANDLE parentHandle, // in
+      const TPM_STORED_DATA* sealedData,
+      UINT32*   outSize,  // out
+      BYTE**    out, //out
+      const TPM_AUTHDATA* key_usage_auth, //in
+      const TPM_AUTHDATA* data_usage_auth, //in
+      TPM_AUTH_SESSION*   keyAuth,  // in, out
+      TPM_AUTH_SESSION*   dataAuth  // in, out
+      )
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH2_COMMAND, TPM_ORD_Unseal);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, parentHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_TPM_STORED_DATA(ptr, sealedData);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(key_usage_auth, keyAuth);
+   TPM_AUTH2_GEN(data_usage_auth, dataAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, outSize);
+   ptr = unpack_ALLOC(ptr, out, *outSize);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(key_usage_auth, keyAuth);
+   TPM_AUTH2_VERIFY(data_usage_auth, dataAuth);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(keyAuth);
+   TPM_AUTH_ERR_CHECK(dataAuth);
+   return status;
+}
+
+TPM_RESULT TPM_Bind(
+      const TPM_KEY* key,
+      const BYTE* in,
+      UINT32 ilen,
+      BYTE* out)
+{
+   TPM_RESULT status;
+   tpmrsa_context rsa = TPMRSA_CTX_INIT;
+   TPM_BOUND_DATA boundData;
+   uint8_t plain[TCPA_MAX_BUFFER_LENGTH];
+   BYTE* ptr = plain;
+
+   vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);
+
+   tpmrsa_set_pubkey(&rsa,
+         key->pubKey.key, key->pubKey.keyLength,
+         key->algorithmParms.parms.rsa.exponent,
+         key->algorithmParms.parms.rsa.exponentSize);
+
+   // Fill boundData's accessory information
+   boundData.ver = TPM_STRUCT_VER_1_1;
+   boundData.payload = TPM_PT_BIND;
+   boundData.payloadData = (BYTE*)in;
+
+   //marshall the bound data object
+   ptr = pack_TPM_BOUND_DATA(ptr, &boundData, ilen);
+
+   // Encrypt the data
+   TPMTRYRETURN(tpmrsa_pub_encrypt_oaep(&rsa,
+            ctr_drbg_random, &vtpm_globals.ctr_drbg,
+            ptr - plain,
+            plain,
+            out));
+
+abort_egress:
+   tpmrsa_free(&rsa);
+   return status;
+
+}
+
+TPM_RESULT TPM_UnBind(
+      TPM_KEY_HANDLE  keyHandle,  // in
+      UINT32 ilen, //in
+      const BYTE* in, //
+      UINT32* olen, //
+      BYTE*    out, //out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth //in, out
+      )
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_UnBind);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, keyHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_UINT32(ptr, ilen);
+   ptr = pack_BUFFER(ptr, in, ilen);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(usage_auth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, olen);
+   if(*olen > ilen) {
+      vtpmlogerror(VTPM_LOG_TPM, "Output length < input length!\n");
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+   ptr = unpack_BUFFER(ptr, out, *olen);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(usage_auth, auth);
+
+abort_egress:
+egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+TPM_RESULT TPM_CreateWrapKey(
+      TPM_KEY_HANDLE  hWrappingKey,  // in
+      const TPM_AUTHDATA* osapSharedSecret,
+      const TPM_AUTHDATA* dataUsageAuth, //in
+      const TPM_AUTHDATA* dataMigrationAuth, //in
+      TPM_KEY*     key, //in, out
+      TPM_AUTH_SESSION*   pAuth)    // in, out
+{
+   int keyAlloced = 0;
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_CreateWrapKey);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, hWrappingKey);
+
+   TPM_AUTH_SKIP();
+
+   //Encrypted auths
+   xorEncrypt(osapSharedSecret, &pAuth->NonceEven,
+         dataUsageAuth, ptr,
+         dataMigrationAuth, ptr + sizeof(TPM_ENCAUTH));
+   ptr += sizeof(TPM_ENCAUTH) * 2;
+
+   ptr = pack_TPM_KEY(ptr, key);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(osapSharedSecret, pAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   keyAlloced = 1;
+   ptr = unpack_TPM_KEY(ptr, key, UNPACK_ALLOC);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(osapSharedSecret, pAuth);
+
+   goto egress;
+abort_egress:
+   if(keyAlloced) {
+      free_TPM_KEY(key);
+   }
+egress:
+   TPM_AUTH_ERR_CHECK(pAuth);
+   return status;
+}
+
+TPM_RESULT TPM_LoadKey(
+      TPM_KEY_HANDLE  parentHandle, //
+      const TPM_KEY* key, //in
+      TPM_HANDLE*  keyHandle,    // out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth)
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_LoadKey);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, parentHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_TPM_KEY(ptr, key);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(usage_auth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, keyHandle);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(usage_auth, auth);
+
+   vtpmloginfo(VTPM_LOG_TPM, "Key Handle: 0x%x opened by TPM_LoadKey\n", *keyHandle);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+TPM_RESULT TPM_EvictKey( TPM_KEY_HANDLE  hKey)  // in
+{
+   if(hKey == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_EvictKey);
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, hKey);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   vtpmloginfo(VTPM_LOG_TPM, "Key handle: 0x%x closed by TPM_EvictKey\n", hKey);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle,
+      TPM_RESOURCE_TYPE rt) {
+   if(handle == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_FlushSpecific);
+
+   ptr = pack_TPM_HANDLE(ptr, handle);
+   ptr = pack_TPM_RESOURCE_TYPE(ptr, rt);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_GetRandom( UINT32*    bytesRequested, // in, out
+      BYTE*    randomBytes) // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetRandom);
+
+   // check input params
+   if (bytesRequested == NULL || randomBytes == NULL){
+      return TPM_BAD_PARAMETER;
+   }
+
+   ptr = pack_UINT32(ptr, *bytesRequested);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, bytesRequested);
+   ptr = unpack_BUFFER(ptr, randomBytes, *bytesRequested);
+
+abort_egress:
+   return status;
+}
+
+
+TPM_RESULT TPM_ReadPubek(
+      TPM_PUBKEY* pubEK //out
+      )
+{
+   BYTE* antiReplay = NULL;
+   BYTE* kptr = NULL;
+   BYTE digest[TPM_DIGEST_SIZE];
+   sha1_context ctx;
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_ReadPubek);
+
+   //antiReplay nonce
+   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
+   antiReplay = ptr;
+   ptr += TPM_DIGEST_SIZE;
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   //unpack and allocate the key
+   kptr = ptr;
+   ptr = unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
+
+   //Verify the checksum
+   sha1_starts(&ctx);
+   sha1_update(&ctx, kptr, ptr - kptr);
+   sha1_update(&ctx, antiReplay, TPM_DIGEST_SIZE);
+   sha1_finish(&ctx, digest);
+
+   //ptr points to the checksum computed by TPM
+   if(memcmp(digest, ptr, TPM_DIGEST_SIZE)) {
+      vtpmlogerror(VTPM_LOG_TPM, "TPM_ReadPubek: Checksum returned by TPM was invalid!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   goto egress;
+abort_egress:
+   if(kptr != NULL) { //If we unpacked the pubEK, we have to free it
+      free_TPM_PUBKEY(pubEK);
+   }
+egress:
+   return status;
+}
+
+
+TPM_RESULT TPM_SaveState(void)
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_SaveState);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_GetCapability(
+      TPM_CAPABILITY_AREA capArea,
+      UINT32 subCapSize,
+      const BYTE* subCap,
+      UINT32* respSize,
+      BYTE** resp)
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetCapability);
+
+   ptr = pack_TPM_CAPABILITY_AREA(ptr, capArea);
+   ptr = pack_UINT32(ptr, subCapSize);
+   ptr = pack_BUFFER(ptr, subCap, subCapSize);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, respSize);
+   ptr = unpack_ALLOC(ptr, resp, *respSize);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_CreateEndorsementKeyPair(
+      const TPM_KEY_PARMS* keyInfo,
+      TPM_PUBKEY* pubEK)
+{
+   BYTE* kptr = NULL;
+   sha1_context ctx;
+   TPM_DIGEST checksum;
+   TPM_DIGEST hash;
+   TPM_NONCE antiReplay;
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_CreateEndorsementKeyPair);
+
+   //Make anti replay nonce
+   vtpmmgr_rand(antiReplay.nonce, sizeof(antiReplay.nonce));
+
+   ptr = pack_TPM_NONCE(ptr, &antiReplay);
+   ptr = pack_TPM_KEY_PARMS(ptr, keyInfo);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   sha1_starts(&ctx);
+
+   kptr = ptr;
+   ptr = unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
+
+   /* Hash the pub key blob */
+   sha1_update(&ctx, kptr, ptr - kptr);
+   ptr = unpack_TPM_DIGEST(ptr, &checksum);
+
+   sha1_update(&ctx, antiReplay.nonce, sizeof(antiReplay.nonce));
+
+   sha1_finish(&ctx, hash.digest);
+   if(memcmp(checksum.digest, hash.digest, TPM_DIGEST_SIZE)) {
+      vtpmloginfo(VTPM_LOG_VTPM, "TPM_CreateEndorsementKey: Checkum verification failed!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   goto egress;
+abort_egress:
+   if(kptr) {
+      free_TPM_PUBKEY(pubEK);
+   }
+egress:
+   return status;
+}
+
+TPM_RESULT TPM_TransmitData(
+      BYTE* in,
+      UINT32 insize,
+      BYTE* out,
+      UINT32* outsize) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   UINT32 i;
+   vtpmloginfo(VTPM_LOG_TXDATA, "Sending buffer = 0x");
+   for(i = 0 ; i < insize ; i++)
+      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", in[i]);
+
+   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
+
+   ssize_t size = 0;
+
+   // send the request
+   size = write (vtpm_globals.tpm_fd, in, insize);
+   if (size < 0) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "write() failed : %s\n", strerror(errno));
+      ERRORDIE (TPM_IOERROR);
+   }
+   else if ((UINT32) size < insize) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "Wrote %d instead of %d bytes!\n", (int) size, insize);
+      ERRORDIE (TPM_IOERROR);
+   }
+
+   // read the response
+   size = read (vtpm_globals.tpm_fd, out, *outsize);
+   if (size < 0) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "read() failed : %s\n", strerror(errno));
+      ERRORDIE (TPM_IOERROR);
+   }
+
+   vtpmloginfo(VTPM_LOG_TXDATA, "Receiving buffer = 0x");
+   for(i = 0 ; i < size ; i++)
+      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out[i]);
+
+   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
+
+   *outsize = size;
+   goto egress;
+
+abort_egress:
+egress:
+   return status;
+}
diff --git a/stubdom/vtpmmgr/tpm.h b/stubdom/vtpmmgr/tpm.h
new file mode 100644
index 0000000..304e145
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm.h
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005/2006, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __TPM_H__
+#define __TPM_H__
+
+#include "tcg.h"
+
+// ------------------------------------------------------------------
+// Exposed API
+// ------------------------------------------------------------------
+
+// TPM v1.1B Command Set
+
+// Authorzation
+TPM_RESULT TPM_OIAP(
+      TPM_AUTH_SESSION*   auth //out
+      );
+
+TPM_RESULT TPM_OSAP (
+      TPM_ENTITY_TYPE entityType,  // in
+      UINT32    entityValue, // in
+      const TPM_AUTHDATA* usageAuth, //in
+      TPM_SECRET *sharedSecret, //out
+      TPM_AUTH_SESSION *auth);
+
+TPM_RESULT TPM_TakeOwnership(
+      const TPM_PUBKEY *pubEK, //in
+      const TPM_AUTHDATA* ownerAuth, //in
+      const TPM_AUTHDATA* srkAuth, //in
+      const TPM_KEY* inSrk, //in
+      TPM_KEY* outSrk, //out, optional
+      TPM_AUTH_SESSION*   auth   // in, out
+      );
+
+TPM_RESULT TPM_DisablePubekRead (
+      const TPM_AUTHDATA* ownerAuth,
+      TPM_AUTH_SESSION*   auth
+      );
+
+TPM_RESULT TPM_TerminateHandle ( TPM_AUTHHANDLE  handle  // in
+      );
+
+TPM_RESULT TPM_FlushSpecific ( TPM_HANDLE  handle,  // in
+      TPM_RESOURCE_TYPE resourceType //in
+      );
+
+// TPM Mandatory
+TPM_RESULT TPM_Extend ( TPM_PCRINDEX  pcrNum,  // in
+      TPM_DIGEST   inDigest, // in
+      TPM_PCRVALUE*   outDigest // out
+      );
+
+TPM_RESULT TPM_PcrRead ( TPM_PCRINDEX  pcrNum,  // in
+      TPM_PCRVALUE*  outDigest // out
+      );
+
+TPM_RESULT TPM_Quote ( TCS_KEY_HANDLE  keyHandle,  // in
+      TPM_NONCE   antiReplay,  // in
+      UINT32*    PcrDataSize, // in, out
+      BYTE**    PcrData,  // in, out
+      TPM_AUTH_SESSION*   privAuth,  // in, out
+      UINT32*    sigSize,  // out
+      BYTE**    sig    // out
+      );
+
+TPM_RESULT TPM_Seal(
+      TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32    pcrInfoSize, // in
+      TPM_PCR_INFO*    pcrInfo,  // in
+      UINT32    inDataSize,  // in
+      const BYTE*    inData,   // in
+      TPM_STORED_DATA* sealedData, //out
+      const TPM_SECRET* osapSharedSecret, //in
+      const TPM_AUTHDATA* sealDataAuth, //in
+      TPM_AUTH_SESSION*   pubAuth  // in, out
+      );
+
+TPM_RESULT TPM_Unseal (
+      TPM_KEY_HANDLE parentHandle, // in
+      const TPM_STORED_DATA* sealedData,
+      UINT32*   outSize,  // out
+      BYTE**    out, //out
+      const TPM_AUTHDATA* key_usage_auth, //in
+      const TPM_AUTHDATA* data_usage_auth, //in
+      TPM_AUTH_SESSION*   keyAuth,  // in, out
+      TPM_AUTH_SESSION*   dataAuth  // in, out
+      );
+
+TPM_RESULT TPM_DirWriteAuth ( TPM_DIRINDEX  dirIndex,  // in
+      TPM_DIRVALUE  newContents, // in
+      TPM_AUTH_SESSION*   ownerAuth  // in, out
+      );
+
+TPM_RESULT TPM_DirRead ( TPM_DIRINDEX  dirIndex, // in
+      TPM_DIRVALUE*  dirValue // out
+      );
+
+TPM_RESULT TPM_Bind(
+      const TPM_KEY* key, //in
+      const BYTE* in, //in
+      UINT32 ilen, //in
+      BYTE* out //out, must be at least cipher block size
+      );
+
+TPM_RESULT TPM_UnBind (
+      TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32 ilen, //in
+      const BYTE* in, //
+      UINT32*   outDataSize, // out
+      BYTE*    outData, //out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth //in, out
+      );
+
+TPM_RESULT TPM_CreateWrapKey (
+      TCS_KEY_HANDLE  hWrappingKey,  // in
+      const TPM_AUTHDATA* osapSharedSecret,
+      const TPM_AUTHDATA* dataUsageAuth, //in
+      const TPM_AUTHDATA* dataMigrationAuth, //in
+      TPM_KEY*     key, //in
+      TPM_AUTH_SESSION*   pAuth    // in, out
+      );
+
+TPM_RESULT TPM_LoadKey (
+      TPM_KEY_HANDLE  parentHandle, //
+      const TPM_KEY* key, //in
+      TPM_HANDLE*  keyHandle,    // out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth
+      );
+
+TPM_RESULT TPM_GetPubKey (  TCS_KEY_HANDLE  hKey,   // in
+      TPM_AUTH_SESSION*   pAuth,   // in, out
+      UINT32*    pcPubKeySize, // out
+      BYTE**    prgbPubKey  // out
+      );
+
+TPM_RESULT TPM_EvictKey ( TCS_KEY_HANDLE  hKey  // in
+      );
+
+TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle, //in
+      TPM_RESOURCE_TYPE rt //in
+      );
+
+TPM_RESULT TPM_Sign ( TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32    areaToSignSize, // in
+      BYTE*    areaToSign,  // in
+      TPM_AUTH_SESSION*   privAuth,  // in, out
+      UINT32*    sigSize,  // out
+      BYTE**    sig    // out
+      );
+
+TPM_RESULT TPM_GetRandom (  UINT32*    bytesRequested, // in, out
+      BYTE*    randomBytes  // out
+      );
+
+TPM_RESULT TPM_StirRandom (  UINT32    inDataSize, // in
+      BYTE*    inData  // in
+      );
+
+TPM_RESULT TPM_ReadPubek (
+      TPM_PUBKEY* pubEK //out
+      );
+
+TPM_RESULT TPM_GetCapability(
+      TPM_CAPABILITY_AREA capArea,
+      UINT32 subCapSize,
+      const BYTE* subCap,
+      UINT32* respSize,
+      BYTE** resp);
+
+TPM_RESULT TPM_SaveState(void);
+
+TPM_RESULT TPM_CreateEndorsementKeyPair(
+      const TPM_KEY_PARMS* keyInfo,
+      TPM_PUBKEY* pubEK);
+
+TPM_RESULT TPM_TransmitData(
+      BYTE* in,
+      UINT32 insize,
+      BYTE* out,
+      UINT32* outsize);
+
+#endif //TPM_H
diff --git a/stubdom/vtpmmgr/tpmrsa.c b/stubdom/vtpmmgr/tpmrsa.c
new file mode 100644
index 0000000..56094e7
--- /dev/null
+++ b/stubdom/vtpmmgr/tpmrsa.c
@@ -0,0 +1,175 @@
+/*
+ *  The RSA public-key cryptosystem
+ *
+ *  Copyright (C) 2006-2011, Brainspark B.V.
+ *
+ *  This file is part of PolarSSL (http://www.polarssl.org)
+ *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
+ *
+ *  All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ *  RSA was designed by Ron Rivest, Adi Shamir and Len Adleman.
+ *
+ *  http://theory.lcs.mit.edu/~rivest/rsapaper.pdf
+ *  http://www.cacr.math.uwaterloo.ca/hac/about/chap8.pdf
+ */
+
+#include "tcg.h"
+#include "polarssl/sha1.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "tpmrsa.h"
+
+#define HASH_LEN 20
+
+void tpmrsa_set_pubkey(tpmrsa_context* ctx,
+      const unsigned char* key,
+      int keylen,
+      const unsigned char* exponent,
+      int explen) {
+
+   tpmrsa_free(ctx);
+
+   if(explen == 0) { //Default e= 2^16+1
+      mpi_lset(&ctx->E, 65537);
+   } else {
+      mpi_read_binary(&ctx->E, exponent, explen);
+   }
+   mpi_read_binary(&ctx->N, key, keylen);
+
+   ctx->len = ( mpi_msb(&ctx->N) + 7) >> 3;
+}
+
+static TPM_RESULT tpmrsa_public( tpmrsa_context *ctx,
+      const unsigned char *input,
+      unsigned char *output )
+{
+   int ret;
+   size_t olen;
+   mpi T;
+
+   mpi_init( &T );
+
+   MPI_CHK( mpi_read_binary( &T, input, ctx->len ) );
+
+   if( mpi_cmp_mpi( &T, &ctx->N ) >= 0 )
+   {
+      mpi_free( &T );
+      return TPM_ENCRYPT_ERROR;
+   }
+
+   olen = ctx->len;
+   MPI_CHK( mpi_exp_mod( &T, &T, &ctx->E, &ctx->N, &ctx->RN ) );
+   MPI_CHK( mpi_write_binary( &T, output, olen ) );
+
+cleanup:
+
+   mpi_free( &T );
+
+   if( ret != 0 )
+      return TPM_ENCRYPT_ERROR;
+
+   return TPM_SUCCESS;
+}
+
+static void mgf_mask( unsigned char *dst, int dlen, unsigned char *src, int slen)
+{
+   unsigned char mask[HASH_LEN];
+   unsigned char counter[4] = {0, 0, 0, 0};
+   int i;
+   sha1_context mctx;
+
+   //We always hash the src with the counter, so save the partial hash
+   sha1_starts(&mctx);
+   sha1_update(&mctx, src, slen);
+
+   // Generate and apply dbMask
+   while(dlen > 0) {
+      //Copy the sha1 context
+      sha1_context ctx = mctx;
+
+      //compute hash for input || counter
+      sha1_update(&ctx, counter, sizeof(counter));
+      sha1_finish(&ctx, mask);
+
+      //Apply the mask
+      for(i = 0; i < (dlen < HASH_LEN ? dlen : HASH_LEN); ++i) {
+         *(dst++) ^= mask[i];
+      }
+
+      //Increment counter
+      ++counter[3];
+
+      dlen -= HASH_LEN;
+   }
+}
+
+/*
+ * Add the message padding, then do an RSA operation
+ */
+TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
+      int (*f_rng)(void *, unsigned char *, size_t),
+      void *p_rng,
+      size_t ilen,
+      const unsigned char *input,
+      unsigned char *output )
+{
+   int ret;
+   int olen;
+   unsigned char* seed = output + 1;
+   unsigned char* db = output + HASH_LEN +1;
+
+   olen = ctx->len-1;
+
+   if( f_rng == NULL )
+      return TPM_ENCRYPT_ERROR;
+
+   if( ilen > olen - 2 * HASH_LEN - 1)
+      return TPM_ENCRYPT_ERROR;
+
+   output[0] = 0;
+
+   //Encoding parameter p
+   sha1((unsigned char*)"TCPA", 4, db);
+
+   //PS
+   memset(db + HASH_LEN, 0,
+         olen - ilen - 2 * HASH_LEN - 1);
+
+   //constant 1 byte
+   db[olen - ilen - HASH_LEN -1] = 0x01;
+
+   //input string
+   memcpy(db + olen - ilen - HASH_LEN,
+         input, ilen);
+
+   //Generate random seed
+   if( ( ret = f_rng( p_rng, seed, HASH_LEN ) ) != 0 )
+      return TPM_ENCRYPT_ERROR;
+
+   // maskedDB: Apply dbMask to DB
+   mgf_mask( db, olen - HASH_LEN, seed, HASH_LEN);
+
+   // maskedSeed: Apply seedMask to seed
+   mgf_mask( seed, HASH_LEN, db, olen - HASH_LEN);
+
+   // Do the crypto op
+   return tpmrsa_public(ctx, output, output);
+}
diff --git a/stubdom/vtpmmgr/tpmrsa.h b/stubdom/vtpmmgr/tpmrsa.h
new file mode 100644
index 0000000..59579e7
--- /dev/null
+++ b/stubdom/vtpmmgr/tpmrsa.h
@@ -0,0 +1,67 @@
+/**
+ * \file rsa.h
+ *
+ * \brief The RSA public-key cryptosystem
+ *
+ *  Copyright (C) 2006-2010, Brainspark B.V.
+ *
+ *  This file is part of PolarSSL (http://www.polarssl.org)
+ *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
+ *
+ *  All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef TPMRSA_H
+#define TPMRSA_H
+
+#include "tcg.h"
+#include <polarssl/bignum.h>
+
+/* tpm software key */
+typedef struct
+{
+    size_t len;                 /*!<  size(N) in chars  */
+
+    mpi N;                      /*!<  public modulus    */
+    mpi E;                      /*!<  public exponent   */
+
+    mpi RN;                     /*!<  cached R^2 mod N  */
+}
+tpmrsa_context;
+
+#define TPMRSA_CTX_INIT { 0, {0, 0, NULL}, {0, 0, NULL}, {0, 0, NULL}}
+
+/* Setup the rsa context using tpm public key data */
+void tpmrsa_set_pubkey(tpmrsa_context* ctx,
+      const unsigned char* key,
+      int keylen,
+      const unsigned char* exponent,
+      int explen);
+
+/* Do rsa public crypto */
+TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
+      int (*f_rng)(void *, unsigned char *, size_t),
+      void *p_rng,
+      size_t ilen,
+      const unsigned char *input,
+      unsigned char *output );
+
+/* free tpmrsa key */
+inline void tpmrsa_free( tpmrsa_context *ctx ) {
+   mpi_free( &ctx->RN ); mpi_free( &ctx->E  ); mpi_free( &ctx->N  );
+}
+
+#endif /* tpmrsa.h */
diff --git a/stubdom/vtpmmgr/uuid.h b/stubdom/vtpmmgr/uuid.h
new file mode 100644
index 0000000..4737645
--- /dev/null
+++ b/stubdom/vtpmmgr/uuid.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPMMGR_UUID_H
+#define VTPMMGR_UUID_H
+
+#define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
+#define UUID_FMTLEN ((2*16)+4) /* 16 hex bytes plus 4 hypens */
+#define UUID_BYTES(uuid) uuid[0], uuid[1], uuid[2], uuid[3], \
+                                uuid[4], uuid[5], uuid[6], uuid[7], \
+                                uuid[8], uuid[9], uuid[10], uuid[11], \
+                                uuid[12], uuid[13], uuid[14], uuid[15]
+
+
+typedef uint8_t uuid_t[16];
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_cmd_handler.c b/stubdom/vtpmmgr/vtpm_cmd_handler.c
new file mode 100644
index 0000000..f82a2a9
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_cmd_handler.c
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <inttypes.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "marshal.h"
+#include "log.h"
+#include "vtpm_storage.h"
+#include "vtpmmgr.h"
+#include "tpm.h"
+#include "tcg.h"
+
+static TPM_RESULT vtpmmgr_SaveHashKey(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+
+   if(tpmcmd->req_len != VTPM_COMMAND_HEADER_SIZE + HASHKEYSZ) {
+      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_ORD_SAVEHASHKEY hashkey too short!\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   /* Do the command */
+   TPMTRYRETURN(vtpm_storage_save_hashkey(uuid, tpmcmd->req + VTPM_COMMAND_HEADER_SIZE));
+
+abort_egress:
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         VTPM_TAG_RSP, VTPM_COMMAND_HEADER_SIZE, status);
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+
+   return status;
+}
+
+static TPM_RESULT vtpmmgr_LoadHashKey(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+
+   TPMTRYRETURN(vtpm_storage_load_hashkey(uuid, tpmcmd->resp + VTPM_COMMAND_HEADER_SIZE));
+
+   tpmcmd->resp_len += HASHKEYSZ;
+
+abort_egress:
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         VTPM_TAG_RSP, tpmcmd->resp_len, status);
+
+   return status;
+}
+
+
+TPM_RESULT vtpmmgr_handle_cmd(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_TAG tag;
+   UINT32 size;
+   TPM_COMMAND_CODE ord;
+
+   unpack_TPM_RQU_HEADER(tpmcmd->req,
+         &tag, &size, &ord);
+
+   /* Handle the command now */
+   switch(tag) {
+      case VTPM_TAG_REQ:
+         //This is a vTPM command
+         switch(ord) {
+            case VTPM_ORD_SAVEHASHKEY:
+               return vtpmmgr_SaveHashKey(uuid, tpmcmd);
+            case VTPM_ORD_LOADHASHKEY:
+               return vtpmmgr_LoadHashKey(uuid, tpmcmd);
+            default:
+               vtpmlogerror(VTPM_LOG_VTPM, "Invalid vTPM Ordinal %" PRIu32 "\n", ord);
+               status = TPM_BAD_ORDINAL;
+         }
+         break;
+      case TPM_TAG_RQU_COMMAND:
+      case TPM_TAG_RQU_AUTH1_COMMAND:
+      case TPM_TAG_RQU_AUTH2_COMMAND:
+         //This is a TPM passthrough command
+         switch(ord) {
+            case TPM_ORD_GetRandom:
+               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_GetRandom\n");
+               break;
+            case TPM_ORD_PcrRead:
+               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_PcrRead\n");
+               break;
+            default:
+               vtpmlogerror(VTPM_LOG_VTPM, "TPM Disallowed Passthrough ord=%" PRIu32 "\n", ord);
+               status = TPM_DISABLED_CMD;
+               goto abort_egress;
+         }
+
+         size = TCPA_MAX_BUFFER_LENGTH;
+         TPMTRYRETURN(TPM_TransmitData(tpmcmd->req, tpmcmd->req_len, tpmcmd->resp, &size));
+         tpmcmd->resp_len = size;
+
+         unpack_TPM_RESULT(tpmcmd->resp + sizeof(TPM_TAG) + sizeof(UINT32), &status);
+         return status;
+
+         break;
+      default:
+         vtpmlogerror(VTPM_LOG_VTPM, "Invalid tag=%" PRIu16 "\n", tag);
+         status = TPM_BADTAG;
+   }
+
+abort_egress:
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         tag + 3, tpmcmd->resp_len, status);
+
+   return status;
+}
diff --git a/stubdom/vtpmmgr/vtpm_manager.h b/stubdom/vtpmmgr/vtpm_manager.h
new file mode 100644
index 0000000..a2bbcca
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_manager.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPM_MANAGER_H
+#define VTPM_MANAGER_H
+
+#define VTPM_TAG_REQ 0x01c1
+#define VTPM_TAG_RSP 0x01c4
+#define COMMAND_BUFFER_SIZE 4096
+
+// Header size
+#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
+
+//************************ Command Codes ****************************
+#define VTPM_ORD_BASE       0x0000
+#define VTPM_PRIV_MASK      0x01000000 // Priviledged VTPM Command
+#define VTPM_PRIV_BASE      (VTPM_ORD_BASE | VTPM_PRIV_MASK)
+
+// Non-priviledged VTPM Commands (From DMI's)
+#define VTPM_ORD_SAVEHASHKEY      (VTPM_ORD_BASE + 1) // DMI requests encryption key for persistent storage
+#define VTPM_ORD_LOADHASHKEY      (VTPM_ORD_BASE + 2) // DMI requests symkey to be regenerated
+
+//************************ Return Codes ****************************
+#define VTPM_SUCCESS               0
+#define VTPM_FAIL                  1
+#define VTPM_UNSUPPORTED           2
+#define VTPM_FORBIDDEN             3
+#define VTPM_RESTORE_CONTEXT_FAILED    4
+#define VTPM_INVALID_REQUEST       5
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_storage.c b/stubdom/vtpmmgr/vtpm_storage.c
new file mode 100644
index 0000000..3862fdb
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_storage.c
@@ -0,0 +1,783 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+/***************************************************************
+ * DISK IMAGE LAYOUT
+ * *************************************************************
+ * All data is stored in BIG ENDIAN format
+ * *************************************************************
+ * Section 1: Header
+ *
+ * 10 bytes 	id			ID String "VTPMMGRDOM"
+ * uint32_t	version	Disk 		Image version number (current == 1)
+ * uint32_t     storage_key_len		Length of the Boot Key
+ * BYTEARRAY    storage_key		TPM boot key
+ *
+ * *************************************************************
+ * Section 2: Key Data Table (starts at offset 4096)
+ *
+ * This is a list of blocks, each is RSA_CIPHER_SIZE long
+ * and is encrypted with the storage key.
+ *
+ * The first block always exists and it contains:
+ * uint32_t num_vtpms                   Number of vtpms (number of remaining blocks)
+ *
+ * The rest of the blocks look like this:
+ * 16 bytes	uuid			uuid of the owner of this key and hash
+ * 20 bytes	hash			Sha1 hash of vTPM's data, supplied by vTPM
+ * 32 bytes	key			AES-256 Encryption Key, supplied by vTPM
+ *
+ * *************************************************************
+ */
+#define DISKVERS 1
+#define IDSTR "VTPMMGRDOM"
+#define IDSTRLEN 10
+#define AES_BLOCK_SIZE 16
+#define AES_KEY_BITS 256
+#define AES_KEY_SIZE (AES_KEY_BITS/8)
+#define BUF_SIZE 4096
+
+#define UUID_TBL_ENT_SIZE (sizeof(uuid_t) + sizeof(uint32_t))
+
+#define HEADERSZ (10 + 4 + 4)
+
+#define TRY_READ(buf, size, msg) do {\
+   int rc; \
+   if((rc = read(blkfront_fd, buf, (size))) != (size)) { \
+      vtpmlogerror(VTPM_LOG_VTPM, "read() failed! " msg " : rc=(%d/%d), error=(%s)\n", rc, (int)(size), strerror(errno)); \
+      status = TPM_IOERROR;\
+      goto abort_egress;\
+   } \
+} while(0)
+
+#define TRY_WRITE(buf, size, msg) do {\
+   int rc; \
+   if((rc = write(blkfront_fd, buf, (size))) != (size)) { \
+      vtpmlogerror(VTPM_LOG_VTPM, "write() failed! " msg " : rc=(%d/%d), error=(%s)\n", rc, (int)(size), strerror(errno)); \
+      status = TPM_IOERROR;\
+      goto abort_egress;\
+   } \
+} while(0)
+
+#include <blkfront.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <mini-os/byteorder.h>
+#include <polarssl/aes.h>
+
+#include "vtpm_manager.h"
+#include "log.h"
+#include "marshal.h"
+#include "tpm.h"
+#include "uuid.h"
+
+#include "vtpmmgr.h"
+#include "vtpm_storage.h"
+
+#define MAX(a,b) ( ((a) > (b)) ? (a) : (b) )
+#define MIN(a,b) ( ((a) < (b)) ? (a) : (b) )
+
+/* blkfront device objets */
+static struct blkfront_dev* blkdev = NULL;
+static int blkfront_fd = -1;
+
+struct Vtpm {
+   uuid_t uuid;
+   int offset;
+};
+struct Storage {
+   int aes_offset;
+   int uuid_offset;
+   int end_offset;
+
+   int num_vtpms;
+   int num_vtpms_alloced;
+   struct Vtpm* vtpms;
+};
+
+/* Global storage data */
+static struct Storage g_store = {
+   .vtpms = NULL,
+};
+
+static int get_offset(void) {
+   return lseek(blkfront_fd, 0, SEEK_CUR);
+}
+
+static void reset_store(void) {
+   g_store.aes_offset = 0;
+   g_store.uuid_offset = 0;
+   g_store.end_offset = 0;
+
+   g_store.num_vtpms = 0;
+   g_store.num_vtpms_alloced = 0;
+   free(g_store.vtpms);
+   g_store.vtpms = NULL;
+}
+
+static int vtpm_get_index(const uuid_t uuid) {
+   int st = 0;
+   int ed = g_store.num_vtpms-1;
+   while(st <= ed) {
+      int mid = ((unsigned int)st + (unsigned int)ed) >> 1; //avoid overflow
+      int c = memcmp(uuid, &g_store.vtpms[mid].uuid, sizeof(uuid_t));
+      if(c == 0) {
+         return mid;
+      } else if(c > 0) {
+         st = mid + 1;
+      } else {
+         ed = mid - 1;
+      }
+   }
+   return -(st + 1);
+}
+
+static void vtpm_add(const uuid_t uuid, int offset, int index) {
+   /* Realloc more space if needed */
+   if(g_store.num_vtpms >= g_store.num_vtpms_alloced) {
+      g_store.num_vtpms_alloced += 16;
+      g_store.vtpms = realloc(
+            g_store.vtpms,
+            sizeof(struct Vtpm) * g_store.num_vtpms_alloced);
+   }
+
+   /* Move everybody after the new guy */
+   for(int i = g_store.num_vtpms; i > index; --i) {
+      g_store.vtpms[i] = g_store.vtpms[i-1];
+   }
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Registered vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+
+   /* Finally add new one */
+   memcpy(g_store.vtpms[index].uuid, uuid, sizeof(uuid_t));
+   g_store.vtpms[index].offset = offset;
+   ++g_store.num_vtpms;
+}
+
+#if 0
+static void vtpm_remove(int index) {
+   for(i = index; i < g_store.num_vtpms; ++i) {
+      g_store.vtpms[i] = g_store.vtpms[i+1];
+   }
+   --g_store.num_vtpms;
+}
+#endif
+
+static int pack_uuid_table(uint8_t* table, int size, int* nvtpms) {
+   uint8_t* ptr = table;
+   while(*nvtpms < g_store.num_vtpms && size >= 0)
+   {
+      /* Pack the uuid */
+      memcpy(ptr, (uint8_t*)g_store.vtpms[*nvtpms].uuid, sizeof(uuid_t));
+      ptr+= sizeof(uuid_t);
+
+
+      /* Pack the offset */
+      ptr = pack_UINT32(ptr, g_store.vtpms[*nvtpms].offset);
+
+      ++*nvtpms;
+      size -= UUID_TBL_ENT_SIZE;
+   }
+   return ptr - table;
+}
+
+/* Extract the uuids */
+static int extract_uuid_table(uint8_t* table, int size) {
+   uint8_t* ptr = table;
+   for(;size >= UUID_TBL_ENT_SIZE; size -= UUID_TBL_ENT_SIZE) {
+      int index;
+      uint32_t v32;
+
+      /*uuid_t is just an array of bytes, so we can do a direct cast here */
+      uint8_t* uuid = ptr;
+      ptr += sizeof(uuid_t);
+
+      /* Get the offset of the key */
+      ptr = unpack_UINT32(ptr, &v32);
+
+      /* Insert the new vtpm in sorted order */
+      if((index = vtpm_get_index(uuid)) >= 0) {
+         vtpmlogerror(VTPM_LOG_VTPM, "Vtpm (" UUID_FMT ") exists multiple times! ignoring...\n", UUID_BYTES(uuid));
+         continue;
+      }
+      index = -index -1;
+
+      vtpm_add(uuid, v32, index);
+
+   }
+   return ptr - table;
+}
+
+static void vtpm_decrypt_block(aes_context* aes,
+      uint8_t* iv,
+      uint8_t* cipher,
+      uint8_t* plain,
+      int cipher_sz,
+      int* overlap)
+{
+   int bytes_ext;
+   /* Decrypt */
+   aes_crypt_cbc(aes, AES_DECRYPT,
+         cipher_sz,
+         iv, cipher, plain + *overlap);
+
+   /* Extract */
+   bytes_ext = extract_uuid_table(plain, cipher_sz + *overlap);
+
+   /* Copy left overs to the beginning */
+   *overlap = cipher_sz + *overlap - bytes_ext;
+   memcpy(plain, plain + bytes_ext, *overlap);
+}
+
+static int vtpm_encrypt_block(aes_context* aes,
+      uint8_t* iv,
+      uint8_t* plain,
+      uint8_t* cipher,
+      int block_sz,
+      int* overlap,
+      int* num_vtpms)
+{
+   int bytes_to_crypt;
+   int bytes_packed;
+
+   /* Pack the uuid table */
+   bytes_packed = *overlap + pack_uuid_table(plain + *overlap, block_sz - *overlap, num_vtpms);
+   bytes_to_crypt = MIN(bytes_packed, block_sz);
+
+   /* Add padding if we aren't on a multiple of the block size */
+   if(bytes_to_crypt & (AES_BLOCK_SIZE-1)) {
+      int oldsz = bytes_to_crypt;
+      //add padding
+      bytes_to_crypt += AES_BLOCK_SIZE - (bytes_to_crypt & (AES_BLOCK_SIZE-1));
+      //fill padding with random bytes
+      vtpmmgr_rand(plain + oldsz, bytes_to_crypt - oldsz);
+      *overlap = 0;
+   } else {
+      *overlap = bytes_packed - bytes_to_crypt;
+   }
+
+   /* Encrypt this chunk */
+   aes_crypt_cbc(aes, AES_ENCRYPT,
+            bytes_to_crypt,
+            iv, plain, cipher);
+
+   /* Copy the left over partials to the beginning */
+   memcpy(plain, plain + bytes_to_crypt, *overlap);
+
+   return bytes_to_crypt;
+}
+
+static TPM_RESULT vtpm_storage_new_vtpm(const uuid_t uuid, int index) {
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
+   uint8_t buf[BUF_SIZE];
+   uint8_t* ptr;
+   int cipher_sz;
+   aes_context aes;
+
+   /* Add new vtpm to the table */
+   vtpm_add(uuid, g_store.end_offset, index);
+   g_store.end_offset += RSA_CIPHER_SIZE;
+
+   /* Compute the new end location of the encrypted uuid table */
+   cipher_sz = AES_BLOCK_SIZE; //IV
+   cipher_sz += g_store.num_vtpms * UUID_TBL_ENT_SIZE; //uuid table
+   cipher_sz += (AES_BLOCK_SIZE - (cipher_sz & (AES_BLOCK_SIZE -1))) & (AES_BLOCK_SIZE-1); //aes padding
+
+   /* Does this overlap any key data? If so they need to be relocated */
+   int uuid_end = (g_store.uuid_offset + cipher_sz + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+   for(int i = 0; i < g_store.num_vtpms; ++i) {
+      if(g_store.vtpms[i].offset < uuid_end) {
+
+         vtpmloginfo(VTPM_LOG_VTPM, "Relocating vtpm data\n");
+
+         //Read the hashkey cipher text
+         lseek(blkfront_fd, g_store.vtpms[i].offset, SEEK_SET);
+         TRY_READ(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
+
+         //Write the cipher text to new offset
+         lseek(blkfront_fd, g_store.end_offset, SEEK_SET);
+         TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
+
+         //Save new offset
+         g_store.vtpms[i].offset = g_store.end_offset;
+         g_store.end_offset += RSA_CIPHER_SIZE;
+      }
+   }
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Generating a new symmetric key\n");
+
+   /* Generate an aes key */
+   TPMTRYRETURN(vtpmmgr_rand(plain, AES_KEY_SIZE));
+   aes_setkey_enc(&aes, plain, AES_KEY_BITS);
+   ptr = plain + AES_KEY_SIZE;
+
+   /* Pack the crypted size */
+   ptr = pack_UINT32(ptr, cipher_sz);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Binding encrypted key\n");
+
+   /* Seal the key and size */
+   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
+            plain,
+            ptr - plain,
+            buf));
+
+   /* Write the sealed key to disk */
+   lseek(blkfront_fd, g_store.aes_offset, SEEK_SET);
+   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm aes key");
+
+   /* ENCRYPT AND WRITE UUID TABLE */
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Encrypting the uuid table\n");
+
+   int num_vtpms = 0;
+   int overlap = 0;
+   int bytes_crypted;
+   uint8_t iv[AES_BLOCK_SIZE];
+
+   /* Generate the iv for the first block */
+   TPMTRYRETURN(vtpmmgr_rand(iv, AES_BLOCK_SIZE));
+
+   /* Copy the iv to the cipher text buffer to be written to disk */
+   memcpy(buf, iv, AES_BLOCK_SIZE);
+   ptr = buf + AES_BLOCK_SIZE;
+
+   /* Encrypt the first block of the uuid table */
+   bytes_crypted = vtpm_encrypt_block(&aes,
+         iv, //iv
+         plain, //plaintext
+         ptr, //cipher text
+         BUF_SIZE - AES_BLOCK_SIZE,
+         &overlap,
+         &num_vtpms);
+
+   /* Write the iv followed by the crypted table*/
+   TRY_WRITE(buf, bytes_crypted + AES_BLOCK_SIZE, "vtpm uuid table");
+
+   /* Decrement the number of bytes encrypted */
+   cipher_sz -= bytes_crypted + AES_BLOCK_SIZE;
+
+   /* If there are more vtpms, encrypt and write them block by block */
+   while(cipher_sz > 0) {
+      /* Encrypt the next block of the uuid table */
+      bytes_crypted = vtpm_encrypt_block(&aes,
+               iv,
+               plain,
+               buf,
+               BUF_SIZE,
+               &overlap,
+               &num_vtpms);
+
+      /* Write the cipher text to disk */
+      TRY_WRITE(buf, bytes_crypted, "vtpm uuid table");
+
+      cipher_sz -= bytes_crypted;
+   }
+
+   goto egress;
+abort_egress:
+egress:
+   return status;
+}
+
+
+/**************************************
+ * PUBLIC FUNCTIONS
+ * ***********************************/
+
+int vtpm_storage_init(void) {
+   struct blkfront_info info;
+   if((blkdev = init_blkfront(NULL, &info)) == NULL) {
+      return -1;
+   }
+   if((blkfront_fd = blkfront_open(blkdev)) < 0) {
+      return -1;
+   }
+   return 0;
+}
+
+void vtpm_storage_shutdown(void) {
+   reset_store();
+   close(blkfront_fd);
+}
+
+TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ])
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   int index;
+   uint8_t cipher[RSA_CIPHER_SIZE];
+   uint8_t clear[RSA_CIPHER_SIZE];
+   UINT32 clear_size;
+
+   /* Find the index of this uuid */
+   if((index = vtpm_get_index(uuid)) < 0) {
+      index = -index-1;
+      vtpmlogerror(VTPM_LOG_VTPM, "LoadKey failure: Unrecognized uuid! " UUID_FMT "\n", UUID_BYTES(uuid));
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   /* Read the table entry */
+   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
+   TRY_READ(cipher, RSA_CIPHER_SIZE, "vtpm hashkey data");
+
+   /* Decrypt the table entry */
+   TPMTRYRETURN(TPM_UnBind(
+            vtpm_globals.storage_key_handle,
+            RSA_CIPHER_SIZE,
+            cipher,
+            &clear_size,
+            clear,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.oiap));
+
+   if(clear_size < HASHKEYSZ) {
+      vtpmloginfo(VTPM_LOG_VTPM, "Decrypted Hash key size (%" PRIu32 ") was too small!\n", clear_size);
+      status = TPM_RESOURCES;
+      goto abort_egress;
+   }
+
+   memcpy(hashkey, clear, HASHKEYSZ);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Loaded hash and key for vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+   goto egress;
+abort_egress:
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load key\n");
+egress:
+   return status;
+}
+
+TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ])
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   int index;
+   uint8_t buf[RSA_CIPHER_SIZE];
+
+   /* Find the index of this uuid */
+   if((index = vtpm_get_index(uuid)) < 0) {
+      index = -index-1;
+      /* Create a new vtpm */
+      TPMTRYRETURN( vtpm_storage_new_vtpm(uuid, index) );
+   }
+
+   /* Encrypt the hash and key */
+   TPMTRYRETURN( TPM_Bind(&vtpm_globals.storage_key,
+            hashkey,
+            HASHKEYSZ,
+            buf));
+
+   /* Write to disk */
+   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
+   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey data");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saved hash and key for vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+   goto egress;
+abort_egress:
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to save key\n");
+egress:
+   return status;
+}
+
+TPM_RESULT vtpm_storage_new_header()
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t buf[BUF_SIZE];
+   uint8_t keybuf[AES_KEY_SIZE + sizeof(uint32_t)];
+   uint8_t* ptr = buf;
+   uint8_t* sptr;
+
+   /* Clear everything first */
+   reset_store();
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Creating new disk image header\n");
+
+   /*Copy the ID string */
+   memcpy(ptr, IDSTR, IDSTRLEN);
+   ptr += IDSTRLEN;
+
+   /*Copy the version */
+   ptr = pack_UINT32(ptr, DISKVERS);
+
+   /*Save the location of the key size */
+   sptr = ptr;
+   ptr += sizeof(UINT32);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saving root storage key..\n");
+
+   /* Copy the storage key */
+   ptr = pack_TPM_KEY(ptr, &vtpm_globals.storage_key);
+
+   /* Now save the size */
+   pack_UINT32(sptr, ptr - (sptr + 4));
+
+   /* Create a fake aes key and set cipher text size to 0 */
+   memset(keybuf, 0, sizeof(keybuf));
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Binding uuid table symmetric key..\n");
+
+   /* Save the location of the aes key */
+   g_store.aes_offset = ptr - buf;
+
+   /* Store the fake aes key and vtpm count */
+   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
+         keybuf,
+         sizeof(keybuf),
+         ptr));
+   ptr+= RSA_CIPHER_SIZE;
+
+   /* Write the header to disk */
+   lseek(blkfront_fd, 0, SEEK_SET);
+   TRY_WRITE(buf, ptr-buf, "vtpm header");
+
+   /* Save the location of the uuid table */
+   g_store.uuid_offset = get_offset();
+
+   /* Save the end offset */
+   g_store.end_offset = (g_store.uuid_offset + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saved new manager disk header.\n");
+
+   goto egress;
+abort_egress:
+egress:
+   return status;
+}
+
+
+TPM_RESULT vtpm_storage_load_header(void)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint32_t v32;
+   uint8_t buf[BUF_SIZE];
+   uint8_t* ptr = buf;
+   aes_context aes;
+
+   /* Clear everything first */
+   reset_store();
+
+   /* Read the header from disk */
+   lseek(blkfront_fd, 0, SEEK_SET);
+   TRY_READ(buf, IDSTRLEN + sizeof(UINT32) + sizeof(UINT32), "vtpm header");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Loading disk image header\n");
+
+   /* Verify the ID string */
+   if(memcmp(ptr, IDSTR, IDSTRLEN)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid ID string in disk image!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+   ptr+=IDSTRLEN;
+
+   /* Unpack the version */
+   ptr = unpack_UINT32(ptr, &v32);
+
+   /* Verify the version */
+   if(v32 != DISKVERS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unsupported disk image version number %" PRIu32 "\n", v32);
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   /* Size of the storage key */
+   ptr = unpack_UINT32(ptr, &v32);
+
+   /* Sanity check */
+   if(v32 > BUF_SIZE) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Size of storage key (%" PRIu32 ") is too large!\n", v32);
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* read the storage key */
+   TRY_READ(buf, v32, "storage pub key");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Unpacking storage key\n");
+
+   /* unpack the storage key */
+   ptr = unpack_TPM_KEY(buf, &vtpm_globals.storage_key, UNPACK_ALLOC);
+
+   /* Load Storage Key into the TPM */
+   TPMTRYRETURN( TPM_LoadKey(
+            TPM_SRK_KEYHANDLE,
+            &vtpm_globals.storage_key,
+            &vtpm_globals.storage_key_handle,
+            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+            &vtpm_globals.oiap));
+
+   /* Initialize the storage key auth */
+   memset(vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA));
+
+   /* Store the offset of the aes key */
+   g_store.aes_offset = get_offset();
+
+   /* Read the rsa cipher text for the aes key */
+   TRY_READ(buf, RSA_CIPHER_SIZE, "aes key");
+   ptr = buf + RSA_CIPHER_SIZE;
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Unbinding uuid table symmetric key\n");
+
+   /* Decrypt the aes key protecting the uuid table */
+   UINT32 datalen;
+   TPMTRYRETURN(TPM_UnBind(
+            vtpm_globals.storage_key_handle,
+            RSA_CIPHER_SIZE,
+            buf,
+            &datalen,
+            ptr,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.oiap));
+
+   /* Validate the length of the output buffer */
+   if(datalen < AES_KEY_SIZE + sizeof(UINT32)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unbound AES key size (%d) was too small! expected (%ld)\n", datalen, AES_KEY_SIZE + sizeof(UINT32));
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* Extract the aes key */
+   aes_setkey_dec(&aes, ptr, AES_KEY_BITS);
+   ptr+= AES_KEY_SIZE;
+
+   /* Extract the ciphertext size */
+   ptr = unpack_UINT32(ptr, &v32);
+   int cipher_size = v32;
+
+   /* Sanity check */
+   if(cipher_size & (AES_BLOCK_SIZE-1)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Cipher text size (%" PRIu32 ") is not a multiple of the aes block size! (%d)\n", v32, AES_BLOCK_SIZE);
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* Save the location of the uuid table */
+   g_store.uuid_offset = get_offset();
+
+   /* Only decrypt the table if there are vtpms to decrypt */
+   if(cipher_size > 0) {
+      int rbytes;
+      int overlap = 0;
+      uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
+      uint8_t iv[AES_BLOCK_SIZE];
+
+      vtpmloginfo(VTPM_LOG_VTPM, "Decrypting uuid table\n");
+
+      /* Pre allocate the vtpm array */
+      g_store.num_vtpms_alloced = cipher_size / UUID_TBL_ENT_SIZE;
+      g_store.vtpms = malloc(sizeof(struct Vtpm) * g_store.num_vtpms_alloced);
+
+      /* Read the iv and the first chunk of cipher text */
+      rbytes = MIN(cipher_size, BUF_SIZE);
+      TRY_READ(buf, rbytes, "vtpm uuid table\n");
+      cipher_size -= rbytes;
+
+      /* Copy the iv */
+      memcpy(iv, buf, AES_BLOCK_SIZE);
+      ptr = buf + AES_BLOCK_SIZE;
+
+      /* Remove the iv from the number of bytes to decrypt */
+      rbytes -= AES_BLOCK_SIZE;
+
+      /* Decrypt and extract vtpms */
+      vtpm_decrypt_block(&aes,
+            iv, ptr, plain,
+            rbytes, &overlap);
+
+      /* Read the rest of the table if there is more */
+      while(cipher_size > 0) {
+         /* Read next chunk of cipher text */
+         rbytes = MIN(cipher_size, BUF_SIZE);
+         TRY_READ(buf, rbytes, "vtpm uuid table");
+         cipher_size -= rbytes;
+
+         /* Decrypt a block of text */
+         vtpm_decrypt_block(&aes,
+               iv, buf, plain,
+               rbytes, &overlap);
+
+      }
+      vtpmloginfo(VTPM_LOG_VTPM, "Loaded %d vtpms!\n", g_store.num_vtpms);
+   }
+
+   /* The end of the key table, new vtpms go here */
+   int uuid_end = (get_offset() + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+   g_store.end_offset = uuid_end;
+
+   /* Compute the end offset while validating vtpms*/
+   for(int i = 0; i < g_store.num_vtpms; ++i) {
+      /* offset must not collide with previous data */
+      if(g_store.vtpms[i].offset < uuid_end) {
+         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
+               " offset (%d) is before end of uuid table (%d)!\n",
+               UUID_BYTES(g_store.vtpms[i].uuid),
+               g_store.vtpms[i].offset, uuid_end);
+         status = TPM_IOERROR;
+         goto abort_egress;
+      }
+      /* offset must be at a multiple of cipher size */
+      if(g_store.vtpms[i].offset & (RSA_CIPHER_SIZE-1)) {
+         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
+               " offset(%d) is not at a multiple of the rsa cipher text size (%d)!\n",
+               UUID_BYTES(g_store.vtpms[i].uuid),
+               g_store.vtpms[i].offset, RSA_CIPHER_SIZE);
+         status = TPM_IOERROR;
+         goto abort_egress;
+      }
+      /* Save the last offset */
+      if(g_store.vtpms[i].offset >= g_store.end_offset) {
+         g_store.end_offset = g_store.vtpms[i].offset + RSA_CIPHER_SIZE;
+      }
+   }
+
+   goto egress;
+abort_egress:
+   //An error occured somewhere
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load manager data!\n");
+
+   //Clear the data store
+   reset_store();
+
+   //Reset the storage key structure
+   free_TPM_KEY(&vtpm_globals.storage_key);
+   {
+      TPM_KEY key = TPM_KEY_INIT;
+      vtpm_globals.storage_key = key;
+   }
+
+   //Reset the storage key handle
+   TPM_EvictKey(vtpm_globals.storage_key_handle);
+   vtpm_globals.storage_key_handle = 0;
+egress:
+   return status;
+}
+
+#if 0
+/* For testing disk IO */
+void add_fake_vtpms(int num) {
+   for(int i = 0; i < num; ++i) {
+      uint32_t ind = cpu_to_be32(i);
+
+      uuid_t uuid;
+      memset(uuid, 0, sizeof(uuid_t));
+      memcpy(uuid, &ind, sizeof(ind));
+      int index = vtpm_get_index(uuid);
+      index = -index-1;
+
+      vtpm_storage_new_vtpm(uuid, index);
+   }
+}
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_storage.h b/stubdom/vtpmmgr/vtpm_storage.h
new file mode 100644
index 0000000..a5a5fd7
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_storage.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPM_STORAGE_H
+#define VTPM_STORAGE_h
+
+#include "uuid.h"
+
+#define VTPM_NVMKEY_SIZE 32
+#define HASHKEYSZ (sizeof(TPM_DIGEST) + VTPM_NVMKEY_SIZE)
+
+/* Initialize the storage system and its virtual disk */
+int vtpm_storage_init(void);
+
+/* Shutdown the storage system and its virtual disk */
+void vtpm_storage_shutdown(void);
+
+/* Loads Sha1 hash and 256 bit AES key from disk and stores them
+ * packed together in outbuf. outbuf must be freed
+ * by the caller using buffer_free()
+ */
+TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ]);
+
+/* inbuf must contain a sha1 hash followed by a 256 bit AES key.
+ * Encrypts and stores the hash and key to disk */
+TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ]);
+
+/* Load the vtpm manager data - call this on startup */
+TPM_RESULT vtpm_storage_load_header(void);
+
+/* Saves the vtpm manager data - call this on shutdown */
+TPM_RESULT vtpm_storage_new_header(void);
+
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpmmgr.c b/stubdom/vtpmmgr/vtpmmgr.c
new file mode 100644
index 0000000..563f4e8
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpmmgr.c
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdint.h>
+#include <mini-os/tpmback.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "log.h"
+
+#include "vtpmmgr.h"
+#include "tcg.h"
+
+
+void main_loop(void) {
+   tpmcmd_t* tpmcmd;
+   uint8_t respbuf[TCPA_MAX_BUFFER_LENGTH];
+
+   while(1) {
+      /* Wait for requests from a vtpm */
+      vtpmloginfo(VTPM_LOG_VTPM, "Waiting for commands from vTPM's:\n");
+      if((tpmcmd = tpmback_req_any()) == NULL) {
+         vtpmlogerror(VTPM_LOG_VTPM, "NULL tpmcmd\n");
+         continue;
+      }
+
+      tpmcmd->resp = respbuf;
+
+      /* Process the command */
+      vtpmmgr_handle_cmd(tpmcmd->uuid, tpmcmd);
+
+      /* Send response */
+      tpmback_resp(tpmcmd);
+   }
+}
+
+int main(int argc, char** argv)
+{
+   int rc = 0;
+   sleep(2);
+   vtpmloginfo(VTPM_LOG_VTPM, "Starting vTPM manager domain\n");
+
+   /* Initialize the vtpm manager */
+   if(vtpmmgr_init(argc, argv) != TPM_SUCCESS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize vtpmmgr domain!\n");
+      rc = -1;
+      goto exit;
+   }
+
+   main_loop();
+
+   vtpmloginfo(VTPM_LOG_VTPM, "vTPM Manager shutting down...\n");
+
+   vtpmmgr_shutdown();
+
+exit:
+   return rc;
+
+}
diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
new file mode 100644
index 0000000..50a1992
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPMMGR_H
+#define VTPMMGR_H
+
+#include <mini-os/tpmback.h>
+#include <polarssl/entropy.h>
+#include <polarssl/ctr_drbg.h>
+
+#include "uuid.h"
+#include "tcg.h"
+#include "vtpm_manager.h"
+
+#define RSA_KEY_SIZE 0x0800
+#define RSA_CIPHER_SIZE (RSA_KEY_SIZE / 8)
+
+struct vtpm_globals {
+   int tpm_fd;
+   TPM_KEY             storage_key;
+   TPM_HANDLE          storage_key_handle;       // Key used by persistent store
+   TPM_AUTH_SESSION    oiap;                // OIAP session for storageKey
+   TPM_AUTHDATA        storage_key_usage_auth;
+
+   TPM_AUTHDATA        owner_auth;
+   TPM_AUTHDATA        srk_auth;
+
+   entropy_context     entropy;
+   ctr_drbg_context    ctr_drbg;
+};
+
+// --------------------------- Global Values --------------------------
+extern struct vtpm_globals vtpm_globals;   // Key info and DMI states
+
+TPM_RESULT vtpmmgr_init(int argc, char** argv);
+void vtpmmgr_shutdown(void);
+
+TPM_RESULT vtpmmgr_handle_cmd(const uuid_t uuid, tpmcmd_t* tpmcmd);
+
+inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes) {
+   return ctr_drbg_random(&vtpm_globals.ctr_drbg, bytes, num_bytes) == 0 ? 0 : TPM_FAIL;
+}
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:36:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:36:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1V8-0005Yu-4F; Thu, 01 Nov 2012 20:36:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TU1V6-0005YK-4Z
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:36:28 +0000
Received: from [85.158.137.99:16199] by server-14.bemta-3.messagelabs.com id
	7A/31-12788-B4DD2905; Thu, 01 Nov 2012 20:36:27 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-2.tower-217.messagelabs.com!1351802165!17261497!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD,UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1967 invoked from network); 1 Nov 2012 20:36:06 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-2.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 20:36:06 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148031185;
	Thu, 01 Nov 2012 16:35:56 -0400
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com, xen-devel@lists.xen.org,
	stefano.stabellini@eu.citrix.com
Date: Thu,  1 Nov 2012 16:35:48 -0400
Message-Id: <1351802150-19258-2-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM 7/9] add vtpm-stubdom code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add the code base for vtpm-stubdom to the stubdom
heirarchy. Makefile changes in later patch.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

diff --git a/stubdom/vtpm/Makefile b/stubdom/vtpm/Makefile
new file mode 100644
index 0000000..686c0ea
--- /dev/null
+++ b/stubdom/vtpm/Makefile
@@ -0,0 +1,37 @@
+# Copyright (c) 2010-2012 United States Government, as represented by
+# the Secretary of Defense.  All rights reserved.
+#
+# THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+# ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+# INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+# DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+# SOFTWARE.
+#
+
+XEN_ROOT=../..
+
+PSSL_DIR=../polarssl-$(XEN_TARGET_ARCH)/library
+PSSL_OBJS=aes.o sha1.o entropy.o ctr_drbg.o sha4.o
+
+TARGET=vtpm.a
+OBJS=vtpm.o vtpm_cmd.o vtpmblk.o vtpm_pcrs.o
+
+
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/build
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/tpm
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/crypto
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)
+
+$(TARGET): $(OBJS)
+	ar -cr $@ $(OBJS) $(TPMEMU_OBJS) $(foreach obj,$(PSSL_OBJS),$(PSSL_DIR)/$(obj))
+
+$(OBJS): vtpm_manager.h
+
+vtpm_manager.h:
+	ln -s ../vtpmmgr/vtpm_manager.h vtpm_manager.h
+
+clean:
+	-rm $(TARGET) $(OBJS) vtpm_manager.h
+
+.PHONY: clean
diff --git a/stubdom/vtpm/minios.cfg b/stubdom/vtpm/minios.cfg
new file mode 100644
index 0000000..31652ee
--- /dev/null
+++ b/stubdom/vtpm/minios.cfg
@@ -0,0 +1,14 @@
+CONFIG_TPMFRONT=y
+CONFIG_TPM_TIS=n
+CONFIG_TPMBACK=y
+CONFIG_START_NETWORK=n
+CONFIG_TEST=n
+CONFIG_PCIFRONT=n
+CONFIG_BLKFRONT=y
+CONFIG_NETFRONT=n
+CONFIG_FBFRONT=n
+CONFIG_KBDFRONT=n
+CONFIG_CONSFRONT=n
+CONFIG_XENBUS=y
+CONFIG_LWIP=n
+CONFIG_XC=n
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
new file mode 100644
index 0000000..71aef78
--- /dev/null
+++ b/stubdom/vtpm/vtpm.c
@@ -0,0 +1,404 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <syslog.h>
+#include <stdbool.h>
+#include <errno.h>
+#include <sys/time.h>
+#include <xen/xen.h>
+#include <tpmback.h>
+#include <tpmfront.h>
+
+#include <polarssl/entropy.h>
+#include <polarssl/ctr_drbg.h>
+
+#include "tpm/tpm_emulator_extern.h"
+#include "tpm/tpm_marshalling.h"
+#include "vtpm.h"
+#include "vtpm_cmd.h"
+#include "vtpm_pcrs.h"
+#include "vtpmblk.h"
+
+#define TPM_LOG_INFO LOG_INFO
+#define TPM_LOG_ERROR LOG_ERR
+#define TPM_LOG_DEBUG LOG_DEBUG
+
+/* Global commandline options - default values */
+struct Opt_args opt_args = {
+   .startup = ST_CLEAR,
+   .loglevel = TPM_LOG_INFO,
+   .hwinitpcrs = VTPM_PCRNONE,
+   .tpmconf = 0,
+   .enable_maint_cmds = false,
+};
+
+static uint32_t badords[32];
+static unsigned int n_badords = 0;
+
+entropy_context entropy;
+ctr_drbg_context ctr_drbg;
+
+struct tpmfront_dev* tpmfront_dev;
+
+void vtpm_get_extern_random_bytes(void *buf, size_t nbytes)
+{
+   ctr_drbg_random(&ctr_drbg, buf, nbytes);
+}
+
+int vtpm_read_from_file(uint8_t **data, size_t *data_length) {
+   return read_vtpmblk(tpmfront_dev, data, data_length);
+}
+
+int vtpm_write_to_file(uint8_t *data, size_t data_length) {
+   return write_vtpmblk(tpmfront_dev, data, data_length);
+}
+
+int vtpm_extern_init_fake(void) {
+   return 0;
+}
+
+void vtpm_extern_release_fake(void) {
+}
+
+
+void vtpm_log(int priority, const char *fmt, ...)
+{
+   if(opt_args.loglevel >= priority) {
+      va_list v;
+      va_start(v, fmt);
+      vprintf(fmt, v);
+      va_end(v);
+   }
+}
+
+static uint64_t vtpm_get_ticks(void)
+{
+  static uint64_t old_t = 0;
+  uint64_t new_t, res_t;
+  struct timeval tv;
+  gettimeofday(&tv, NULL);
+  new_t = (uint64_t)tv.tv_sec * 1000000 + (uint64_t)tv.tv_usec;
+  res_t = (old_t > 0) ? new_t - old_t : 0;
+  old_t = new_t;
+  return res_t;
+}
+
+
+static int tpm_entropy_source(void* dummy, unsigned char* data, size_t len, size_t* olen) {
+   UINT32 sz = len;
+   TPM_RESULT rc = VTPM_GetRandom(tpmfront_dev, data, &sz);
+   *olen = sz;
+   return rc == TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
+}
+
+int init_random(void) {
+   /* Initialize the rng */
+   entropy_init(&entropy);
+   entropy_add_source(&entropy, tpm_entropy_source, NULL, 0);
+   entropy_gather(&entropy);
+   ctr_drbg_init(&ctr_drbg, entropy_func, &entropy, NULL, 0);
+   ctr_drbg_set_prediction_resistance( &ctr_drbg, CTR_DRBG_PR_OFF );
+
+   return 0;
+}
+
+int check_ordinal(tpmcmd_t* tpmcmd) {
+   TPM_COMMAND_CODE ord;
+   UINT32 len = 4;
+   BYTE* ptr;
+   unsigned int i;
+
+   if(tpmcmd->req_len < 10) {
+      return true;
+   }
+
+   ptr = tpmcmd->req + 6;
+   tpm_unmarshal_UINT32(&ptr, &len, &ord);
+
+   for(i = 0; i < n_badords; ++i) {
+      if(ord == badords[i]) {
+         error("Disabled command ordinal (%" PRIu32") requested!\n");
+         return false;
+      }
+   }
+   return true;
+}
+
+static void main_loop(void) {
+   tpmcmd_t* tpmcmd = NULL;
+   domid_t domid;		/* Domid of frontend */
+   unsigned int handle;	/* handle of frontend */
+   int res = -1;
+
+   info("VTPM Initializing\n");
+
+   /* Set required tpm config args */
+   opt_args.tpmconf |= TPM_CONF_STRONG_PERSISTENCE;
+   opt_args.tpmconf &= ~TPM_CONF_USE_INTERNAL_PRNG;
+   opt_args.tpmconf |= TPM_CONF_GENERATE_EK;
+   opt_args.tpmconf |= TPM_CONF_GENERATE_SEED_DAA;
+
+   /* Initialize the emulator */
+   tpm_emulator_init(opt_args.startup, opt_args.tpmconf);
+
+   /* Initialize any requested PCRs with hardware TPM values */
+   if(vtpm_initialize_hw_pcrs(tpmfront_dev, opt_args.hwinitpcrs) != TPM_SUCCESS) {
+      error("Failed to initialize PCRs with hardware TPM values");
+      goto abort_postpcrs;
+   }
+
+   /* Wait for the frontend domain to connect */
+   info("Waiting for frontend domain to connect..");
+   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
+      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
+   } else {
+      error("Unable to attach to a frontend");
+   }
+
+   tpmcmd = tpmback_req(domid, handle);
+   while(tpmcmd) {
+      /* Handle the request */
+      if(tpmcmd->req_len) {
+	 tpmcmd->resp = NULL;
+	 tpmcmd->resp_len = 0;
+
+         /* First check for disabled ordinals */
+         if(!check_ordinal(tpmcmd)) {
+            create_error_response(tpmcmd, TPM_BAD_ORDINAL);
+         }
+         /* If not disabled, do the command */
+         else {
+            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
+               error("tpm_handle_command() failed");
+               create_error_response(tpmcmd, TPM_FAIL);
+            }
+         }
+      }
+
+      /* Send the response */
+      tpmback_resp(tpmcmd);
+
+      /* Wait for the next request */
+      tpmcmd = tpmback_req(domid, handle);
+
+   }
+
+abort_postpcrs:
+   info("VTPM Shutting down\n");
+
+   tpm_emulator_shutdown();
+}
+
+int parse_cmd_line(int argc, char** argv)
+{
+   char sval[25];
+   char* logstr = NULL;
+   /* Parse the command strings */
+   for(unsigned int i = 1; i < argc; ++i) {
+      if (sscanf(argv[i], "loglevel=%25s", sval) == 1){
+	 if (!strcmp(sval, "debug")) {
+	    opt_args.loglevel = TPM_LOG_DEBUG;
+	    logstr = "debug";
+	 }
+	 else if (!strcmp(sval, "info")) {
+	    logstr = "info";
+	    opt_args.loglevel = TPM_LOG_INFO;
+	 }
+	 else if (!strcmp(sval, "error")) {
+	    logstr = "error";
+	    opt_args.loglevel = TPM_LOG_ERROR;
+	 }
+      }
+      else if (!strcmp(argv[i], "clear")) {
+	 opt_args.startup = ST_CLEAR;
+      }
+      else if (!strcmp(argv[i], "save")) {
+	 opt_args.startup = ST_SAVE;
+      }
+      else if (!strcmp(argv[i], "deactivated")) {
+	 opt_args.startup = ST_DEACTIVATED;
+      }
+      else if (!strncmp(argv[i], "maintcmds=", 10)) {
+         if(!strcmp(argv[i] + 10, "1")) {
+            opt_args.enable_maint_cmds = true;
+         } else if(!strcmp(argv[i] + 10, "0")) {
+            opt_args.enable_maint_cmds = false;
+         }
+      }
+      else if(!strncmp(argv[i], "hwinitpcr=", 10)) {
+         char *pch = argv[i] + 10;
+         unsigned int v1, v2;
+         pch = strtok(pch, ",");
+         while(pch != NULL) {
+            if(!strcmp(pch, "all")) {
+               //Set all
+               opt_args.hwinitpcrs = VTPM_PCRALL;
+            } else if(!strcmp(pch, "none")) {
+               //Set none
+               opt_args.hwinitpcrs = VTPM_PCRNONE;
+            } else if(sscanf(pch, "%u", &v1) == 1) {
+               //Set one
+               if(v1 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               opt_args.hwinitpcrs |= (1 << v1);
+            } else if(sscanf(pch, "%u-%u", &v1, &v2) == 2) {
+               //Set range
+               if(v1 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               if(v2 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               if(v2 < v1) {
+                  unsigned tp = v1;
+                  v1 = v2;
+                  v2 = tp;
+               }
+               for(unsigned int i = v1; i <= v2; ++i) {
+                  opt_args.hwinitpcrs |= (1 << i);
+               }
+            } else {
+               error("hwintipcr error: Invalid PCR specification : %s", pch);
+               return -1;
+            }
+            pch = strtok(NULL, ",");
+         }
+      }
+      else {
+	 error("Invalid command line option `%s'", argv[i]);
+      }
+
+   }
+
+   /* Check Errors and print results */
+   switch(opt_args.startup) {
+      case ST_CLEAR:
+	 info("Startup mode is `clear'");
+	 break;
+      case ST_SAVE:
+	 info("Startup mode is `save'");
+	 break;
+      case ST_DEACTIVATED:
+	 info("Startup mode is `deactivated'");
+	 break;
+      default:
+	 error("Invalid startup mode %d", opt_args.startup);
+	 return -1;
+   }
+
+   if(opt_args.hwinitpcrs & (VTPM_PCRALL))
+   {
+      char pcrstr[1024];
+      char* ptr = pcrstr;
+
+      pcrstr[0] = '\0';
+      info("The following PCRs will be initialized with values from the hardware TPM:");
+      for(unsigned int i = 0; i < TPM_NUM_PCR; ++i) {
+         if(opt_args.hwinitpcrs & (1 << i)) {
+            ptr += sprintf(ptr, "%u, ", i);
+         }
+      }
+      /* get rid of the last comma if any numbers were printed */
+      *(ptr -2) = '\0';
+
+      info("\t%s", pcrstr);
+   } else {
+      info("All PCRs initialized to default values");
+   }
+
+   if(!opt_args.enable_maint_cmds) {
+      info("TPM Maintenance Commands disabled");
+      badords[n_badords++] = TPM_ORD_CreateMaintenanceArchive;
+      badords[n_badords++] = TPM_ORD_LoadMaintenanceArchive;
+      badords[n_badords++] = TPM_ORD_KillMaintenanceFeature;
+      badords[n_badords++] = TPM_ORD_LoadManuMaintPub;
+      badords[n_badords++] = TPM_ORD_ReadManuMaintPub;
+   } else {
+      info("TPM Maintenance Commands enabled");
+   }
+
+   info("Log level set to %s", logstr);
+
+   return 0;
+}
+
+void cleanup_opt_args(void) {
+}
+
+int main(int argc, char **argv)
+{
+   //FIXME: initializing blkfront without this sleep causes the domain to crash on boot
+   sleep(2);
+
+   /* Setup extern function pointers */
+   tpm_extern_init = vtpm_extern_init_fake;
+   tpm_extern_release = vtpm_extern_release_fake;
+   tpm_malloc = malloc;
+   tpm_free = free;
+   tpm_log = vtpm_log;
+   tpm_get_ticks = vtpm_get_ticks;
+   tpm_get_extern_random_bytes = vtpm_get_extern_random_bytes;
+   tpm_write_to_storage = vtpm_write_to_file;
+   tpm_read_from_storage = vtpm_read_from_file;
+
+   info("starting TPM Emulator (1.2.%d.%d-%d)", VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD);
+   if(parse_cmd_line(argc, argv)) {
+      error("Error parsing commandline\n");
+      return -1;
+   }
+
+   /* Initialize devices */
+   init_tpmback();
+   if((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
+      error("Unable to initialize tpmfront device");
+      goto abort_posttpmfront;
+   }
+
+   /* Seed the RNG with entropy from hardware TPM */
+   if(init_random()) {
+      error("Unable to initialize RNG");
+      goto abort_postrng;
+   }
+
+   /* Initialize blkfront device */
+   if(init_vtpmblk(tpmfront_dev)) {
+      error("Unable to initialize Blkfront persistent storage");
+      goto abort_postvtpmblk;
+   }
+
+   /* Run main loop */
+   main_loop();
+
+   /* Shutdown blkfront */
+   shutdown_vtpmblk();
+abort_postvtpmblk:
+abort_postrng:
+
+   /* Close devices */
+   shutdown_tpmfront(tpmfront_dev);
+abort_posttpmfront:
+   shutdown_tpmback();
+
+   cleanup_opt_args();
+
+   return 0;
+}
diff --git a/stubdom/vtpm/vtpm.h b/stubdom/vtpm/vtpm.h
new file mode 100644
index 0000000..5919e44
--- /dev/null
+++ b/stubdom/vtpm/vtpm.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef VTPM_H
+#define VTPM_H
+
+#include <stdbool.h>
+
+/* For testing */
+#define VERS_CMD "\x00\xC1\x00\x00\x00\x16\x00\x00\x00\x65\x00\x00\x00\x05\x00\x00\x00\x04\x00\x00\x01\x03"
+#define VERS_CMD_LEN 22
+
+/* Global commandline options */
+struct Opt_args {
+   enum StartUp {
+      ST_CLEAR = 1,
+      ST_SAVE = 2,
+      ST_DEACTIVATED = 3
+   } startup;
+   unsigned long hwinitpcrs;
+   int loglevel;
+   uint32_t tpmconf;
+   bool enable_maint_cmds;
+};
+extern struct Opt_args opt_args;
+
+#endif
diff --git a/stubdom/vtpm/vtpm_cmd.c b/stubdom/vtpm/vtpm_cmd.c
new file mode 100644
index 0000000..7eae98b
--- /dev/null
+++ b/stubdom/vtpm/vtpm_cmd.c
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <types.h>
+#include <xen/xen.h>
+#include <mm.h>
+#include <gnttab.h>
+#include "tpm/tpm_marshalling.h"
+#include "vtpm_manager.h"
+#include "vtpm_cmd.h"
+#include <tpmback.h>
+
+#define TRYFAILGOTO(C) \
+   if((C)) { \
+      status = TPM_FAIL; \
+      goto abort_egress; \
+   }
+#define TRYFAILGOTOMSG(C, msg) \
+   if((C)) { \
+      status = TPM_FAIL; \
+      error(msg); \
+      goto abort_egress; \
+   }
+#define CHECKSTATUSGOTO(ret, fname) \
+   if((ret) != TPM_SUCCESS) { \
+      error("%s failed with error code (%lu)", fname, (unsigned long) ret); \
+      status = ord; \
+      goto abort_egress; \
+   }
+
+#define ERR_MALFORMED "Malformed response from backend"
+#define ERR_TPMFRONT "Error sending command through frontend device"
+
+struct shpage {
+   void* page;
+   grant_ref_t grantref;
+};
+
+typedef struct shpage shpage_t;
+
+static inline int pack_header(uint8_t** bptr, UINT32* len, TPM_TAG tag, UINT32 size, TPM_COMMAND_CODE ord)
+{
+   return *bptr == NULL ||
+	 tpm_marshal_UINT16(bptr, len, tag) ||
+	 tpm_marshal_UINT32(bptr, len, size) ||
+	 tpm_marshal_UINT32(bptr, len, ord);
+}
+
+static inline int unpack_header(uint8_t** bptr, UINT32* len, TPM_TAG* tag, UINT32* size, TPM_COMMAND_CODE* ord)
+{
+   return *bptr == NULL ||
+	 tpm_unmarshal_UINT16(bptr, len, tag) ||
+	 tpm_unmarshal_UINT32(bptr, len, size) ||
+	 tpm_unmarshal_UINT32(bptr, len, ord);
+}
+
+int create_error_response(tpmcmd_t* tpmcmd, TPM_RESULT errorcode)
+{
+   TPM_TAG tag;
+   UINT32 len = tpmcmd->req_len;
+   uint8_t* respptr;
+   uint8_t* cmdptr = tpmcmd->req;
+
+   if(!tpm_unmarshal_UINT16(&cmdptr, &len, &tag)) {
+      switch (tag) {
+         case TPM_TAG_RQU_COMMAND:
+            tag = TPM_TAG_RSP_COMMAND;
+            break;
+         case TPM_TAG_RQU_AUTH1_COMMAND:
+            tag = TPM_TAG_RQU_AUTH2_COMMAND;
+            break;
+         case TPM_TAG_RQU_AUTH2_COMMAND:
+            tag = TPM_TAG_RQU_AUTH2_COMMAND;
+            break;
+      }
+   } else {
+      tag = TPM_TAG_RSP_COMMAND;
+   }
+
+   tpmcmd->resp_len = len = 10;
+   tpmcmd->resp = respptr = tpm_malloc(tpmcmd->resp_len);
+
+   return pack_header(&respptr, &len, tag, len, errorcode);
+}
+
+TPM_RESULT VTPM_GetRandom(struct tpmfront_dev* tpmfront_dev, BYTE* bytes, UINT32 *numbytes) {
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* cmdbuf, *resp, *bptr;
+   size_t resplen = 0;
+   UINT32 len;
+
+   /*Ask the real tpm for random bytes for the seed */
+   TPM_TAG tag = TPM_TAG_RQU_COMMAND;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = TPM_ORD_GetRandom;
+   len = size = sizeof(TPM_TAG) + sizeof(UINT32) + sizeof(TPM_COMMAND_CODE) + sizeof(UINT32);
+
+   /*Create the raw tpm command */
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   TRYFAILGOTO(tpm_marshal_UINT32(&bptr, &len, *numbytes));
+
+   /* Send cmd, wait for response */
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen),
+      ERR_TPMFRONT);
+
+   bptr = resp; len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   //Check return status of command
+   CHECKSTATUSGOTO(ord, "TPM_GetRandom()");
+
+   // Get the number of random bytes in the response
+   TRYFAILGOTOMSG(tpm_unmarshal_UINT32(&bptr, &len, &size), ERR_MALFORMED);
+   *numbytes = size;
+
+   //Get the random bytes out, tpm may give us less bytes than what we wanrt
+   TRYFAILGOTOMSG(tpm_unmarshal_BYTE_ARRAY(&bptr, &len, bytes, *numbytes), ERR_MALFORMED);
+
+   goto egress;
+abort_egress:
+egress:
+   free(cmdbuf);
+   return status;
+
+}
+
+TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* bptr, *resp;
+   uint8_t* cmdbuf = NULL;
+   size_t resplen = 0;
+   UINT32 len;
+
+   TPM_TAG tag = VTPM_TAG_REQ;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = VTPM_ORD_LOADHASHKEY;
+
+   /*Create the command*/
+   len = size = VTPM_COMMAND_HEADER_SIZE;
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+
+   /* Send the command to vtpm_manager */
+   info("Requesting Encryption key from backend");
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   /* Unpack response header */
+   bptr = resp;
+   len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   /* Check return code */
+   CHECKSTATUSGOTO(ord, "VTPM_LoadHashKey()");
+
+   /* Get the size of the key */
+   *data_length = size - VTPM_COMMAND_HEADER_SIZE;
+
+   /* Copy the key bits */
+   *data = malloc(*data_length);
+   memcpy(*data, bptr, *data_length);
+
+   goto egress;
+abort_egress:
+   error("VTPM_LoadHashKey failed");
+egress:
+   free(cmdbuf);
+   return status;
+}
+
+TPM_RESULT VTPM_SaveHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* bptr, *resp;
+   uint8_t* cmdbuf = NULL;
+   size_t resplen = 0;
+   UINT32 len;
+
+   TPM_TAG tag = VTPM_TAG_REQ;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = VTPM_ORD_SAVEHASHKEY;
+
+   /*Create the command*/
+   len = size = VTPM_COMMAND_HEADER_SIZE + data_length;
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   memcpy(bptr, data, data_length);
+   bptr += data_length;
+
+   /* Send the command to vtpm_manager */
+   info("Sending encryption key to backend");
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   /* Unpack response header */
+   bptr = resp;
+   len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   /* Check return code */
+   CHECKSTATUSGOTO(ord, "VTPM_SaveHashKey()");
+
+   goto egress;
+abort_egress:
+   error("VTPM_SaveHashKey failed");
+egress:
+   free(cmdbuf);
+   return status;
+}
+
+TPM_RESULT VTPM_PCRRead(struct tpmfront_dev* tpmfront_dev, UINT32 pcrIndex, BYTE* outDigest)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t *cmdbuf, *resp, *bptr;
+   size_t resplen = 0;
+   UINT32 len;
+
+   /*Just send a TPM_PCRRead Command to the HW tpm */
+   TPM_TAG tag = TPM_TAG_RQU_COMMAND;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = TPM_ORD_PCRRead;
+   len = size = sizeof(TPM_TAG) + sizeof(UINT32) + sizeof(TPM_COMMAND_CODE) + sizeof(UINT32);
+
+   /*Create the raw tpm cmd */
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   TRYFAILGOTO(tpm_marshal_UINT32(&bptr, &len, pcrIndex));
+
+   /*Send Cmd wait for response */
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   bptr = resp; len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   //Check return status of command
+   CHECKSTATUSGOTO(ord, "TPM_PCRRead");
+
+   //Get the ptr value
+   memcpy(outDigest, bptr, sizeof(TPM_PCRVALUE));
+
+   goto egress;
+abort_egress:
+egress:
+   free(cmdbuf);
+   return status;
+
+}
diff --git a/stubdom/vtpm/vtpm_cmd.h b/stubdom/vtpm/vtpm_cmd.h
new file mode 100644
index 0000000..b0bfa22
--- /dev/null
+++ b/stubdom/vtpm/vtpm_cmd.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef MANAGER_H
+#define MANAGER_H
+
+#include <tpmfront.h>
+#include <tpmback.h>
+#include "tpm/tpm_structures.h"
+
+/* Create a command response error header */
+int create_error_response(tpmcmd_t* tpmcmd, TPM_RESULT errorcode);
+/* Request random bytes from hardware tpm, returns 0 on success */
+TPM_RESULT VTPM_GetRandom(struct tpmfront_dev* tpmfront_dev, BYTE* bytes, UINT32* numbytes);
+/* Retreive 256 bit AES encryption key from manager */
+TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length);
+/* Manager securely saves our 256 bit AES encryption key */
+TPM_RESULT VTPM_SaveHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length);
+/* Send a TPM_PCRRead command passthrough the manager to the hw tpm */
+TPM_RESULT VTPM_PCRRead(struct tpmfront_dev* tpmfront_dev, UINT32 pcrIndex, BYTE* outDigest);
+
+#endif
diff --git a/stubdom/vtpm/vtpm_pcrs.c b/stubdom/vtpm/vtpm_pcrs.c
new file mode 100644
index 0000000..22a6cef
--- /dev/null
+++ b/stubdom/vtpm/vtpm_pcrs.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include "vtpm_pcrs.h"
+#include "vtpm_cmd.h"
+#include "tpm/tpm_data.h"
+
+#define PCR_VALUE      tpmData.permanent.data.pcrValue
+
+static int write_pcr_direct(unsigned int pcrIndex, uint8_t* val) {
+   if(pcrIndex > TPM_NUM_PCR) {
+      return TPM_BADINDEX;
+   }
+   memcpy(&PCR_VALUE[pcrIndex], val, sizeof(TPM_PCRVALUE));
+   return TPM_SUCCESS;
+}
+
+TPM_RESULT vtpm_initialize_hw_pcrs(struct tpmfront_dev* tpmfront_dev, unsigned long pcrs)
+{
+   TPM_RESULT rc = TPM_SUCCESS;
+   uint8_t digest[sizeof(TPM_PCRVALUE)];
+
+   for(unsigned int i = 0; i < TPM_NUM_PCR; ++i) {
+      if(pcrs & 1 << i) {
+         if((rc = VTPM_PCRRead(tpmfront_dev, i, digest)) != TPM_SUCCESS) {
+            error("TPM_PCRRead failed with error : %d", rc);
+            return rc;
+         }
+         write_pcr_direct(i, digest);
+      }
+   }
+
+   return rc;
+}
diff --git a/stubdom/vtpm/vtpm_pcrs.h b/stubdom/vtpm/vtpm_pcrs.h
new file mode 100644
index 0000000..11835f9
--- /dev/null
+++ b/stubdom/vtpm/vtpm_pcrs.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef VTPM_PCRS_H
+#define VTPM_PCRS_H
+
+#include "tpm/tpm_structures.h"
+
+#define VTPM_PCR0 1
+#define VTPM_PCR1 1 << 1
+#define VTPM_PCR2 1 << 2
+#define VTPM_PCR3 1 << 3
+#define VTPM_PCR4 1 << 4
+#define VTPM_PCR5 1 << 5
+#define VTPM_PCR6 1 << 6
+#define VTPM_PCR7 1 << 7
+#define VTPM_PCR8 1 << 8
+#define VTPM_PCR9 1 << 9
+#define VTPM_PCR10 1 << 10
+#define VTPM_PCR11 1 << 11
+#define VTPM_PCR12 1 << 12
+#define VTPM_PCR13 1 << 13
+#define VTPM_PCR14 1 << 14
+#define VTPM_PCR15 1 << 15
+#define VTPM_PCR16 1 << 16
+#define VTPM_PCR17 1 << 17
+#define VTPM_PCR18 1 << 18
+#define VTPM_PCR19 1 << 19
+#define VTPM_PCR20 1 << 20
+#define VTPM_PCR21 1 << 21
+#define VTPM_PCR22 1 << 22
+#define VTPM_PCR23 1 << 23
+
+#define VTPM_PCRALL (1 << TPM_NUM_PCR) - 1
+#define VTPM_PCRNONE 0
+
+#define VTPM_NUMPCRS 24
+
+struct tpmfront_dev;
+
+TPM_RESULT vtpm_initialize_hw_pcrs(struct tpmfront_dev* tpmfront_dev, unsigned long pcrs);
+
+
+#endif
diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
new file mode 100644
index 0000000..b343bd8
--- /dev/null
+++ b/stubdom/vtpm/vtpmblk.c
@@ -0,0 +1,307 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <mini-os/byteorder.h>
+#include "vtpmblk.h"
+#include "tpm/tpm_marshalling.h"
+#include "vtpm_cmd.h"
+#include "polarssl/aes.h"
+#include "polarssl/sha1.h"
+#include <blkfront.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+
+/*Encryption key and block sizes */
+#define BLKSZ 16
+
+static struct blkfront_dev* blkdev = NULL;
+static int blkfront_fd = -1;
+
+int init_vtpmblk(struct tpmfront_dev* tpmfront_dev)
+{
+   struct blkfront_info blkinfo;
+   info("Initializing persistent NVM storage\n");
+
+   if((blkdev = init_blkfront(NULL, &blkinfo)) == NULL) {
+      error("BLKIO: ERROR Unable to initialize blkfront");
+      return -1;
+   }
+   if (blkinfo.info & VDISK_READONLY || blkinfo.mode != O_RDWR) {
+      error("BLKIO: ERROR block device is read only!");
+      goto error;
+   }
+   if((blkfront_fd = blkfront_open(blkdev)) == -1) {
+      error("Unable to open blkfront file descriptor!");
+      goto error;
+   }
+
+   return 0;
+error:
+   shutdown_blkfront(blkdev);
+   blkdev = NULL;
+   return -1;
+}
+
+void shutdown_vtpmblk(void)
+{
+   close(blkfront_fd);
+   blkfront_fd = -1;
+   blkdev = NULL;
+}
+
+int write_vtpmblk_raw(uint8_t *data, size_t data_length)
+{
+   int rc;
+   uint32_t lenbuf;
+   debug("Begin Write data=%p len=%u", data, data_length);
+
+   lenbuf = cpu_to_be32((uint32_t)data_length);
+
+   lseek(blkfront_fd, 0, SEEK_SET);
+   if((rc = write(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
+      error("write(length) failed! error was %s", strerror(errno));
+      return -1;
+   }
+   if((rc = write(blkfront_fd, data, data_length)) != data_length) {
+      error("write(data) failed! error was %s", strerror(errno));
+      return -1;
+   }
+
+   info("Wrote %u bytes to NVM persistent storage", data_length);
+
+   return 0;
+}
+
+int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
+{
+   int rc;
+   uint32_t lenbuf;
+
+   lseek(blkfront_fd, 0, SEEK_SET);
+   if(( rc = read(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
+      error("read(length) failed! error was %s", strerror(errno));
+      return -1;
+   }
+   *data_length = (size_t) cpu_to_be32(lenbuf);
+   if(*data_length == 0) {
+      error("read 0 data_length for NVM");
+      return -1;
+   }
+
+   *data = tpm_malloc(*data_length);
+   if((rc = read(blkfront_fd, *data, *data_length)) != *data_length) {
+      error("read(data) failed! error was %s", strerror(errno));
+      return -1;
+   }
+
+   info("Read %u bytes from NVM persistent storage", *data_length);
+   return 0;
+}
+
+int encrypt_vtpmblk(uint8_t* clear, size_t clear_len, uint8_t** cipher, size_t* cipher_len, uint8_t* symkey)
+{
+   int rc = 0;
+   uint8_t iv[BLKSZ];
+   aes_context aes_ctx;
+   UINT32 temp;
+   int mod;
+
+   uint8_t* clbuf = NULL;
+
+   uint8_t* ivptr;
+   int ivlen;
+
+   uint8_t* cptr;	//Cipher block pointer
+   int clen;	//Cipher block length
+
+   /*Create a new 256 bit encryption key */
+   if(symkey == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+   tpm_get_extern_random_bytes(symkey, NVMKEYSZ);
+
+   /*Setup initialization vector - random bits and then 4 bytes clear text size at the end*/
+   temp = sizeof(UINT32);
+   ivlen = BLKSZ - temp;
+   tpm_get_extern_random_bytes(iv, ivlen);
+   ivptr = iv + ivlen;
+   tpm_marshal_UINT32(&ivptr, &temp, (UINT32) clear_len);
+
+   /*The clear text needs to be padded out to a multiple of BLKSZ */
+   mod = clear_len % BLKSZ;
+   clen = mod ? clear_len + BLKSZ - mod : clear_len;
+   clbuf = malloc(clen);
+   if (clbuf == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+   memcpy(clbuf, clear, clear_len);
+   /* zero out the padding bits - FIXME: better / more secure way to handle these? */
+   if(clen - clear_len) {
+      memset(clbuf + clear_len, 0, clen - clear_len);
+   }
+
+   /* Setup the ciphertext buffer */
+   *cipher_len = BLKSZ + clen;		/*iv + ciphertext */
+   cptr = *cipher = malloc(*cipher_len);
+   if (*cipher == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Copy the IV to cipher text blob*/
+   memcpy(cptr, iv, BLKSZ);
+   cptr += BLKSZ;
+
+   /* Setup encryption */
+   aes_setkey_enc(&aes_ctx, symkey, 256);
+
+   /* Do encryption now */
+   aes_crypt_cbc(&aes_ctx, AES_ENCRYPT, clen, iv, clbuf, cptr);
+
+   goto egress;
+abort_egress:
+egress:
+   free(clbuf);
+   return rc;
+}
+int decrypt_vtpmblk(uint8_t* cipher, size_t cipher_len, uint8_t** clear, size_t* clear_len, uint8_t* symkey)
+{
+   int rc = 0;
+   uint8_t iv[BLKSZ];
+   uint8_t* ivptr;
+   UINT32 u32, temp;
+   aes_context aes_ctx;
+
+   uint8_t* cptr = cipher;	//cipher block pointer
+   int clen = cipher_len;	//cipher block length
+
+   /* Pull out the initialization vector */
+   memcpy(iv, cipher, BLKSZ);
+   cptr += BLKSZ;
+   clen -= BLKSZ;
+
+   /* Setup the clear text buffer */
+   if((*clear = malloc(clen)) == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Get the length of clear text from last 4 bytes of iv */
+   temp = sizeof(UINT32);
+   ivptr = iv + BLKSZ - temp;
+   tpm_unmarshal_UINT32(&ivptr, &temp, &u32);
+   *clear_len = u32;
+
+   /* Setup decryption */
+   aes_setkey_dec(&aes_ctx, symkey, 256);
+
+   /* Do decryption now */
+   if ((clen % BLKSZ) != 0) {
+      error("Decryption Error: Cipher block size was not a multiple of %u", BLKSZ);
+      rc = -1;
+      goto abort_egress;
+   }
+   aes_crypt_cbc(&aes_ctx, AES_DECRYPT, clen, iv, cptr, *clear);
+
+   goto egress;
+abort_egress:
+egress:
+   return rc;
+}
+
+int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length) {
+   int rc;
+   uint8_t* cipher = NULL;
+   size_t cipher_len = 0;
+   uint8_t hashkey[HASHKEYSZ];
+   uint8_t* symkey = hashkey + HASHSZ;
+
+   /* Encrypt the data */
+   if((rc = encrypt_vtpmblk(data, data_length, &cipher, &cipher_len, symkey))) {
+      goto abort_egress;
+   }
+   /* Write to disk */
+   if((rc = write_vtpmblk_raw(cipher, cipher_len))) {
+      goto abort_egress;
+   }
+   /* Get sha1 hash of data */
+   sha1(cipher, cipher_len, hashkey);
+
+   /* Send hash and key to manager */
+   if((rc = VTPM_SaveHashKey(tpmfront_dev, hashkey, HASHKEYSZ)) != TPM_SUCCESS) {
+      goto abort_egress;
+   }
+   goto egress;
+abort_egress:
+egress:
+   free(cipher);
+   return rc;
+}
+
+int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data_length) {
+   int rc;
+   uint8_t* cipher = NULL;
+   size_t cipher_len = 0;
+   size_t keysize;
+   uint8_t* hashkey = NULL;
+   uint8_t hash[HASHSZ];
+   uint8_t* symkey;
+
+   /* Retreive the hash and the key from the manager */
+   if((rc = VTPM_LoadHashKey(tpmfront_dev, &hashkey, &keysize)) != TPM_SUCCESS) {
+      goto abort_egress;
+   }
+   if(keysize != HASHKEYSZ) {
+      error("Manager returned a hashkey of invalid size! expected %d, actual %d", NVMKEYSZ, keysize);
+      rc = -1;
+      goto abort_egress;
+   }
+   symkey = hashkey + HASHSZ;
+
+   /* Read from disk now */
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len))) {
+      goto abort_egress;
+   }
+
+   /* Compute the hash of the cipher text and compare */
+   sha1(cipher, cipher_len, hash);
+   if(memcmp(hash, hashkey, HASHSZ)) {
+      int i;
+      error("NVM Storage Checksum failed!");
+      printf("Expected: ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hashkey[i]);
+      }
+      printf("\n");
+      printf("Actual:   ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hash[i]);
+      }
+      printf("\n");
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Decrypt the blob */
+   if((rc = decrypt_vtpmblk(cipher, cipher_len, data, data_length, symkey))) {
+      goto abort_egress;
+   }
+   goto egress;
+abort_egress:
+egress:
+   free(cipher);
+   free(hashkey);
+   return rc;
+}
diff --git a/stubdom/vtpm/vtpmblk.h b/stubdom/vtpm/vtpmblk.h
new file mode 100644
index 0000000..282ce6a
--- /dev/null
+++ b/stubdom/vtpm/vtpmblk.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef NVM_H
+#define NVM_H
+#include <mini-os/types.h>
+#include <xen/xen.h>
+#include <tpmfront.h>
+
+#define NVMKEYSZ 32
+#define HASHSZ 20
+#define HASHKEYSZ (NVMKEYSZ + HASHSZ)
+
+int init_vtpmblk(struct tpmfront_dev* tpmfront_dev);
+void shutdown_vtpmblk(void);
+
+/* Encrypts and writes data to blk device */
+int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t *data, size_t data_length);
+/* Reads, Decrypts, and returns data from blk device */
+int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t **data, size_t *data_length);
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:36:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:36:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1V8-0005Yu-4F; Thu, 01 Nov 2012 20:36:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TU1V6-0005YK-4Z
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:36:28 +0000
Received: from [85.158.137.99:16199] by server-14.bemta-3.messagelabs.com id
	7A/31-12788-B4DD2905; Thu, 01 Nov 2012 20:36:27 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-2.tower-217.messagelabs.com!1351802165!17261497!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD,UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1967 invoked from network); 1 Nov 2012 20:36:06 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-2.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 20:36:06 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148031185;
	Thu, 01 Nov 2012 16:35:56 -0400
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com, xen-devel@lists.xen.org,
	stefano.stabellini@eu.citrix.com
Date: Thu,  1 Nov 2012 16:35:48 -0400
Message-Id: <1351802150-19258-2-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM 7/9] add vtpm-stubdom code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add the code base for vtpm-stubdom to the stubdom
heirarchy. Makefile changes in later patch.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

diff --git a/stubdom/vtpm/Makefile b/stubdom/vtpm/Makefile
new file mode 100644
index 0000000..686c0ea
--- /dev/null
+++ b/stubdom/vtpm/Makefile
@@ -0,0 +1,37 @@
+# Copyright (c) 2010-2012 United States Government, as represented by
+# the Secretary of Defense.  All rights reserved.
+#
+# THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+# ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+# INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+# DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+# SOFTWARE.
+#
+
+XEN_ROOT=../..
+
+PSSL_DIR=../polarssl-$(XEN_TARGET_ARCH)/library
+PSSL_OBJS=aes.o sha1.o entropy.o ctr_drbg.o sha4.o
+
+TARGET=vtpm.a
+OBJS=vtpm.o vtpm_cmd.o vtpmblk.o vtpm_pcrs.o
+
+
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/build
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/tpm
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/crypto
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)
+
+$(TARGET): $(OBJS)
+	ar -cr $@ $(OBJS) $(TPMEMU_OBJS) $(foreach obj,$(PSSL_OBJS),$(PSSL_DIR)/$(obj))
+
+$(OBJS): vtpm_manager.h
+
+vtpm_manager.h:
+	ln -s ../vtpmmgr/vtpm_manager.h vtpm_manager.h
+
+clean:
+	-rm $(TARGET) $(OBJS) vtpm_manager.h
+
+.PHONY: clean
diff --git a/stubdom/vtpm/minios.cfg b/stubdom/vtpm/minios.cfg
new file mode 100644
index 0000000..31652ee
--- /dev/null
+++ b/stubdom/vtpm/minios.cfg
@@ -0,0 +1,14 @@
+CONFIG_TPMFRONT=y
+CONFIG_TPM_TIS=n
+CONFIG_TPMBACK=y
+CONFIG_START_NETWORK=n
+CONFIG_TEST=n
+CONFIG_PCIFRONT=n
+CONFIG_BLKFRONT=y
+CONFIG_NETFRONT=n
+CONFIG_FBFRONT=n
+CONFIG_KBDFRONT=n
+CONFIG_CONSFRONT=n
+CONFIG_XENBUS=y
+CONFIG_LWIP=n
+CONFIG_XC=n
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
new file mode 100644
index 0000000..71aef78
--- /dev/null
+++ b/stubdom/vtpm/vtpm.c
@@ -0,0 +1,404 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <syslog.h>
+#include <stdbool.h>
+#include <errno.h>
+#include <sys/time.h>
+#include <xen/xen.h>
+#include <tpmback.h>
+#include <tpmfront.h>
+
+#include <polarssl/entropy.h>
+#include <polarssl/ctr_drbg.h>
+
+#include "tpm/tpm_emulator_extern.h"
+#include "tpm/tpm_marshalling.h"
+#include "vtpm.h"
+#include "vtpm_cmd.h"
+#include "vtpm_pcrs.h"
+#include "vtpmblk.h"
+
+#define TPM_LOG_INFO LOG_INFO
+#define TPM_LOG_ERROR LOG_ERR
+#define TPM_LOG_DEBUG LOG_DEBUG
+
+/* Global commandline options - default values */
+struct Opt_args opt_args = {
+   .startup = ST_CLEAR,
+   .loglevel = TPM_LOG_INFO,
+   .hwinitpcrs = VTPM_PCRNONE,
+   .tpmconf = 0,
+   .enable_maint_cmds = false,
+};
+
+static uint32_t badords[32];
+static unsigned int n_badords = 0;
+
+entropy_context entropy;
+ctr_drbg_context ctr_drbg;
+
+struct tpmfront_dev* tpmfront_dev;
+
+void vtpm_get_extern_random_bytes(void *buf, size_t nbytes)
+{
+   ctr_drbg_random(&ctr_drbg, buf, nbytes);
+}
+
+int vtpm_read_from_file(uint8_t **data, size_t *data_length) {
+   return read_vtpmblk(tpmfront_dev, data, data_length);
+}
+
+int vtpm_write_to_file(uint8_t *data, size_t data_length) {
+   return write_vtpmblk(tpmfront_dev, data, data_length);
+}
+
+int vtpm_extern_init_fake(void) {
+   return 0;
+}
+
+void vtpm_extern_release_fake(void) {
+}
+
+
+void vtpm_log(int priority, const char *fmt, ...)
+{
+   if(opt_args.loglevel >= priority) {
+      va_list v;
+      va_start(v, fmt);
+      vprintf(fmt, v);
+      va_end(v);
+   }
+}
+
+static uint64_t vtpm_get_ticks(void)
+{
+  static uint64_t old_t = 0;
+  uint64_t new_t, res_t;
+  struct timeval tv;
+  gettimeofday(&tv, NULL);
+  new_t = (uint64_t)tv.tv_sec * 1000000 + (uint64_t)tv.tv_usec;
+  res_t = (old_t > 0) ? new_t - old_t : 0;
+  old_t = new_t;
+  return res_t;
+}
+
+
+static int tpm_entropy_source(void* dummy, unsigned char* data, size_t len, size_t* olen) {
+   UINT32 sz = len;
+   TPM_RESULT rc = VTPM_GetRandom(tpmfront_dev, data, &sz);
+   *olen = sz;
+   return rc == TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
+}
+
+int init_random(void) {
+   /* Initialize the rng */
+   entropy_init(&entropy);
+   entropy_add_source(&entropy, tpm_entropy_source, NULL, 0);
+   entropy_gather(&entropy);
+   ctr_drbg_init(&ctr_drbg, entropy_func, &entropy, NULL, 0);
+   ctr_drbg_set_prediction_resistance( &ctr_drbg, CTR_DRBG_PR_OFF );
+
+   return 0;
+}
+
+int check_ordinal(tpmcmd_t* tpmcmd) {
+   TPM_COMMAND_CODE ord;
+   UINT32 len = 4;
+   BYTE* ptr;
+   unsigned int i;
+
+   if(tpmcmd->req_len < 10) {
+      return true;
+   }
+
+   ptr = tpmcmd->req + 6;
+   tpm_unmarshal_UINT32(&ptr, &len, &ord);
+
+   for(i = 0; i < n_badords; ++i) {
+      if(ord == badords[i]) {
+         error("Disabled command ordinal (%" PRIu32") requested!\n");
+         return false;
+      }
+   }
+   return true;
+}
+
+static void main_loop(void) {
+   tpmcmd_t* tpmcmd = NULL;
+   domid_t domid;		/* Domid of frontend */
+   unsigned int handle;	/* handle of frontend */
+   int res = -1;
+
+   info("VTPM Initializing\n");
+
+   /* Set required tpm config args */
+   opt_args.tpmconf |= TPM_CONF_STRONG_PERSISTENCE;
+   opt_args.tpmconf &= ~TPM_CONF_USE_INTERNAL_PRNG;
+   opt_args.tpmconf |= TPM_CONF_GENERATE_EK;
+   opt_args.tpmconf |= TPM_CONF_GENERATE_SEED_DAA;
+
+   /* Initialize the emulator */
+   tpm_emulator_init(opt_args.startup, opt_args.tpmconf);
+
+   /* Initialize any requested PCRs with hardware TPM values */
+   if(vtpm_initialize_hw_pcrs(tpmfront_dev, opt_args.hwinitpcrs) != TPM_SUCCESS) {
+      error("Failed to initialize PCRs with hardware TPM values");
+      goto abort_postpcrs;
+   }
+
+   /* Wait for the frontend domain to connect */
+   info("Waiting for frontend domain to connect..");
+   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
+      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
+   } else {
+      error("Unable to attach to a frontend");
+   }
+
+   tpmcmd = tpmback_req(domid, handle);
+   while(tpmcmd) {
+      /* Handle the request */
+      if(tpmcmd->req_len) {
+	 tpmcmd->resp = NULL;
+	 tpmcmd->resp_len = 0;
+
+         /* First check for disabled ordinals */
+         if(!check_ordinal(tpmcmd)) {
+            create_error_response(tpmcmd, TPM_BAD_ORDINAL);
+         }
+         /* If not disabled, do the command */
+         else {
+            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
+               error("tpm_handle_command() failed");
+               create_error_response(tpmcmd, TPM_FAIL);
+            }
+         }
+      }
+
+      /* Send the response */
+      tpmback_resp(tpmcmd);
+
+      /* Wait for the next request */
+      tpmcmd = tpmback_req(domid, handle);
+
+   }
+
+abort_postpcrs:
+   info("VTPM Shutting down\n");
+
+   tpm_emulator_shutdown();
+}
+
+int parse_cmd_line(int argc, char** argv)
+{
+   char sval[25];
+   char* logstr = NULL;
+   /* Parse the command strings */
+   for(unsigned int i = 1; i < argc; ++i) {
+      if (sscanf(argv[i], "loglevel=%25s", sval) == 1){
+	 if (!strcmp(sval, "debug")) {
+	    opt_args.loglevel = TPM_LOG_DEBUG;
+	    logstr = "debug";
+	 }
+	 else if (!strcmp(sval, "info")) {
+	    logstr = "info";
+	    opt_args.loglevel = TPM_LOG_INFO;
+	 }
+	 else if (!strcmp(sval, "error")) {
+	    logstr = "error";
+	    opt_args.loglevel = TPM_LOG_ERROR;
+	 }
+      }
+      else if (!strcmp(argv[i], "clear")) {
+	 opt_args.startup = ST_CLEAR;
+      }
+      else if (!strcmp(argv[i], "save")) {
+	 opt_args.startup = ST_SAVE;
+      }
+      else if (!strcmp(argv[i], "deactivated")) {
+	 opt_args.startup = ST_DEACTIVATED;
+      }
+      else if (!strncmp(argv[i], "maintcmds=", 10)) {
+         if(!strcmp(argv[i] + 10, "1")) {
+            opt_args.enable_maint_cmds = true;
+         } else if(!strcmp(argv[i] + 10, "0")) {
+            opt_args.enable_maint_cmds = false;
+         }
+      }
+      else if(!strncmp(argv[i], "hwinitpcr=", 10)) {
+         char *pch = argv[i] + 10;
+         unsigned int v1, v2;
+         pch = strtok(pch, ",");
+         while(pch != NULL) {
+            if(!strcmp(pch, "all")) {
+               //Set all
+               opt_args.hwinitpcrs = VTPM_PCRALL;
+            } else if(!strcmp(pch, "none")) {
+               //Set none
+               opt_args.hwinitpcrs = VTPM_PCRNONE;
+            } else if(sscanf(pch, "%u", &v1) == 1) {
+               //Set one
+               if(v1 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               opt_args.hwinitpcrs |= (1 << v1);
+            } else if(sscanf(pch, "%u-%u", &v1, &v2) == 2) {
+               //Set range
+               if(v1 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               if(v2 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               if(v2 < v1) {
+                  unsigned tp = v1;
+                  v1 = v2;
+                  v2 = tp;
+               }
+               for(unsigned int i = v1; i <= v2; ++i) {
+                  opt_args.hwinitpcrs |= (1 << i);
+               }
+            } else {
+               error("hwintipcr error: Invalid PCR specification : %s", pch);
+               return -1;
+            }
+            pch = strtok(NULL, ",");
+         }
+      }
+      else {
+	 error("Invalid command line option `%s'", argv[i]);
+      }
+
+   }
+
+   /* Check Errors and print results */
+   switch(opt_args.startup) {
+      case ST_CLEAR:
+	 info("Startup mode is `clear'");
+	 break;
+      case ST_SAVE:
+	 info("Startup mode is `save'");
+	 break;
+      case ST_DEACTIVATED:
+	 info("Startup mode is `deactivated'");
+	 break;
+      default:
+	 error("Invalid startup mode %d", opt_args.startup);
+	 return -1;
+   }
+
+   if(opt_args.hwinitpcrs & (VTPM_PCRALL))
+   {
+      char pcrstr[1024];
+      char* ptr = pcrstr;
+
+      pcrstr[0] = '\0';
+      info("The following PCRs will be initialized with values from the hardware TPM:");
+      for(unsigned int i = 0; i < TPM_NUM_PCR; ++i) {
+         if(opt_args.hwinitpcrs & (1 << i)) {
+            ptr += sprintf(ptr, "%u, ", i);
+         }
+      }
+      /* get rid of the last comma if any numbers were printed */
+      *(ptr -2) = '\0';
+
+      info("\t%s", pcrstr);
+   } else {
+      info("All PCRs initialized to default values");
+   }
+
+   if(!opt_args.enable_maint_cmds) {
+      info("TPM Maintenance Commands disabled");
+      badords[n_badords++] = TPM_ORD_CreateMaintenanceArchive;
+      badords[n_badords++] = TPM_ORD_LoadMaintenanceArchive;
+      badords[n_badords++] = TPM_ORD_KillMaintenanceFeature;
+      badords[n_badords++] = TPM_ORD_LoadManuMaintPub;
+      badords[n_badords++] = TPM_ORD_ReadManuMaintPub;
+   } else {
+      info("TPM Maintenance Commands enabled");
+   }
+
+   info("Log level set to %s", logstr);
+
+   return 0;
+}
+
+void cleanup_opt_args(void) {
+}
+
+int main(int argc, char **argv)
+{
+   //FIXME: initializing blkfront without this sleep causes the domain to crash on boot
+   sleep(2);
+
+   /* Setup extern function pointers */
+   tpm_extern_init = vtpm_extern_init_fake;
+   tpm_extern_release = vtpm_extern_release_fake;
+   tpm_malloc = malloc;
+   tpm_free = free;
+   tpm_log = vtpm_log;
+   tpm_get_ticks = vtpm_get_ticks;
+   tpm_get_extern_random_bytes = vtpm_get_extern_random_bytes;
+   tpm_write_to_storage = vtpm_write_to_file;
+   tpm_read_from_storage = vtpm_read_from_file;
+
+   info("starting TPM Emulator (1.2.%d.%d-%d)", VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD);
+   if(parse_cmd_line(argc, argv)) {
+      error("Error parsing commandline\n");
+      return -1;
+   }
+
+   /* Initialize devices */
+   init_tpmback();
+   if((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
+      error("Unable to initialize tpmfront device");
+      goto abort_posttpmfront;
+   }
+
+   /* Seed the RNG with entropy from hardware TPM */
+   if(init_random()) {
+      error("Unable to initialize RNG");
+      goto abort_postrng;
+   }
+
+   /* Initialize blkfront device */
+   if(init_vtpmblk(tpmfront_dev)) {
+      error("Unable to initialize Blkfront persistent storage");
+      goto abort_postvtpmblk;
+   }
+
+   /* Run main loop */
+   main_loop();
+
+   /* Shutdown blkfront */
+   shutdown_vtpmblk();
+abort_postvtpmblk:
+abort_postrng:
+
+   /* Close devices */
+   shutdown_tpmfront(tpmfront_dev);
+abort_posttpmfront:
+   shutdown_tpmback();
+
+   cleanup_opt_args();
+
+   return 0;
+}
diff --git a/stubdom/vtpm/vtpm.h b/stubdom/vtpm/vtpm.h
new file mode 100644
index 0000000..5919e44
--- /dev/null
+++ b/stubdom/vtpm/vtpm.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef VTPM_H
+#define VTPM_H
+
+#include <stdbool.h>
+
+/* For testing */
+#define VERS_CMD "\x00\xC1\x00\x00\x00\x16\x00\x00\x00\x65\x00\x00\x00\x05\x00\x00\x00\x04\x00\x00\x01\x03"
+#define VERS_CMD_LEN 22
+
+/* Global commandline options */
+struct Opt_args {
+   enum StartUp {
+      ST_CLEAR = 1,
+      ST_SAVE = 2,
+      ST_DEACTIVATED = 3
+   } startup;
+   unsigned long hwinitpcrs;
+   int loglevel;
+   uint32_t tpmconf;
+   bool enable_maint_cmds;
+};
+extern struct Opt_args opt_args;
+
+#endif
diff --git a/stubdom/vtpm/vtpm_cmd.c b/stubdom/vtpm/vtpm_cmd.c
new file mode 100644
index 0000000..7eae98b
--- /dev/null
+++ b/stubdom/vtpm/vtpm_cmd.c
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <types.h>
+#include <xen/xen.h>
+#include <mm.h>
+#include <gnttab.h>
+#include "tpm/tpm_marshalling.h"
+#include "vtpm_manager.h"
+#include "vtpm_cmd.h"
+#include <tpmback.h>
+
+#define TRYFAILGOTO(C) \
+   if((C)) { \
+      status = TPM_FAIL; \
+      goto abort_egress; \
+   }
+#define TRYFAILGOTOMSG(C, msg) \
+   if((C)) { \
+      status = TPM_FAIL; \
+      error(msg); \
+      goto abort_egress; \
+   }
+#define CHECKSTATUSGOTO(ret, fname) \
+   if((ret) != TPM_SUCCESS) { \
+      error("%s failed with error code (%lu)", fname, (unsigned long) ret); \
+      status = ord; \
+      goto abort_egress; \
+   }
+
+#define ERR_MALFORMED "Malformed response from backend"
+#define ERR_TPMFRONT "Error sending command through frontend device"
+
+struct shpage {
+   void* page;
+   grant_ref_t grantref;
+};
+
+typedef struct shpage shpage_t;
+
+static inline int pack_header(uint8_t** bptr, UINT32* len, TPM_TAG tag, UINT32 size, TPM_COMMAND_CODE ord)
+{
+   return *bptr == NULL ||
+	 tpm_marshal_UINT16(bptr, len, tag) ||
+	 tpm_marshal_UINT32(bptr, len, size) ||
+	 tpm_marshal_UINT32(bptr, len, ord);
+}
+
+static inline int unpack_header(uint8_t** bptr, UINT32* len, TPM_TAG* tag, UINT32* size, TPM_COMMAND_CODE* ord)
+{
+   return *bptr == NULL ||
+	 tpm_unmarshal_UINT16(bptr, len, tag) ||
+	 tpm_unmarshal_UINT32(bptr, len, size) ||
+	 tpm_unmarshal_UINT32(bptr, len, ord);
+}
+
+int create_error_response(tpmcmd_t* tpmcmd, TPM_RESULT errorcode)
+{
+   TPM_TAG tag;
+   UINT32 len = tpmcmd->req_len;
+   uint8_t* respptr;
+   uint8_t* cmdptr = tpmcmd->req;
+
+   if(!tpm_unmarshal_UINT16(&cmdptr, &len, &tag)) {
+      switch (tag) {
+         case TPM_TAG_RQU_COMMAND:
+            tag = TPM_TAG_RSP_COMMAND;
+            break;
+         case TPM_TAG_RQU_AUTH1_COMMAND:
+            tag = TPM_TAG_RQU_AUTH2_COMMAND;
+            break;
+         case TPM_TAG_RQU_AUTH2_COMMAND:
+            tag = TPM_TAG_RQU_AUTH2_COMMAND;
+            break;
+      }
+   } else {
+      tag = TPM_TAG_RSP_COMMAND;
+   }
+
+   tpmcmd->resp_len = len = 10;
+   tpmcmd->resp = respptr = tpm_malloc(tpmcmd->resp_len);
+
+   return pack_header(&respptr, &len, tag, len, errorcode);
+}
+
+TPM_RESULT VTPM_GetRandom(struct tpmfront_dev* tpmfront_dev, BYTE* bytes, UINT32 *numbytes) {
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* cmdbuf, *resp, *bptr;
+   size_t resplen = 0;
+   UINT32 len;
+
+   /*Ask the real tpm for random bytes for the seed */
+   TPM_TAG tag = TPM_TAG_RQU_COMMAND;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = TPM_ORD_GetRandom;
+   len = size = sizeof(TPM_TAG) + sizeof(UINT32) + sizeof(TPM_COMMAND_CODE) + sizeof(UINT32);
+
+   /*Create the raw tpm command */
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   TRYFAILGOTO(tpm_marshal_UINT32(&bptr, &len, *numbytes));
+
+   /* Send cmd, wait for response */
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen),
+      ERR_TPMFRONT);
+
+   bptr = resp; len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   //Check return status of command
+   CHECKSTATUSGOTO(ord, "TPM_GetRandom()");
+
+   // Get the number of random bytes in the response
+   TRYFAILGOTOMSG(tpm_unmarshal_UINT32(&bptr, &len, &size), ERR_MALFORMED);
+   *numbytes = size;
+
+   //Get the random bytes out, tpm may give us less bytes than what we wanrt
+   TRYFAILGOTOMSG(tpm_unmarshal_BYTE_ARRAY(&bptr, &len, bytes, *numbytes), ERR_MALFORMED);
+
+   goto egress;
+abort_egress:
+egress:
+   free(cmdbuf);
+   return status;
+
+}
+
+TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* bptr, *resp;
+   uint8_t* cmdbuf = NULL;
+   size_t resplen = 0;
+   UINT32 len;
+
+   TPM_TAG tag = VTPM_TAG_REQ;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = VTPM_ORD_LOADHASHKEY;
+
+   /*Create the command*/
+   len = size = VTPM_COMMAND_HEADER_SIZE;
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+
+   /* Send the command to vtpm_manager */
+   info("Requesting Encryption key from backend");
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   /* Unpack response header */
+   bptr = resp;
+   len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   /* Check return code */
+   CHECKSTATUSGOTO(ord, "VTPM_LoadHashKey()");
+
+   /* Get the size of the key */
+   *data_length = size - VTPM_COMMAND_HEADER_SIZE;
+
+   /* Copy the key bits */
+   *data = malloc(*data_length);
+   memcpy(*data, bptr, *data_length);
+
+   goto egress;
+abort_egress:
+   error("VTPM_LoadHashKey failed");
+egress:
+   free(cmdbuf);
+   return status;
+}
+
+TPM_RESULT VTPM_SaveHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* bptr, *resp;
+   uint8_t* cmdbuf = NULL;
+   size_t resplen = 0;
+   UINT32 len;
+
+   TPM_TAG tag = VTPM_TAG_REQ;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = VTPM_ORD_SAVEHASHKEY;
+
+   /*Create the command*/
+   len = size = VTPM_COMMAND_HEADER_SIZE + data_length;
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   memcpy(bptr, data, data_length);
+   bptr += data_length;
+
+   /* Send the command to vtpm_manager */
+   info("Sending encryption key to backend");
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   /* Unpack response header */
+   bptr = resp;
+   len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   /* Check return code */
+   CHECKSTATUSGOTO(ord, "VTPM_SaveHashKey()");
+
+   goto egress;
+abort_egress:
+   error("VTPM_SaveHashKey failed");
+egress:
+   free(cmdbuf);
+   return status;
+}
+
+TPM_RESULT VTPM_PCRRead(struct tpmfront_dev* tpmfront_dev, UINT32 pcrIndex, BYTE* outDigest)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t *cmdbuf, *resp, *bptr;
+   size_t resplen = 0;
+   UINT32 len;
+
+   /*Just send a TPM_PCRRead Command to the HW tpm */
+   TPM_TAG tag = TPM_TAG_RQU_COMMAND;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = TPM_ORD_PCRRead;
+   len = size = sizeof(TPM_TAG) + sizeof(UINT32) + sizeof(TPM_COMMAND_CODE) + sizeof(UINT32);
+
+   /*Create the raw tpm cmd */
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   TRYFAILGOTO(tpm_marshal_UINT32(&bptr, &len, pcrIndex));
+
+   /*Send Cmd wait for response */
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   bptr = resp; len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   //Check return status of command
+   CHECKSTATUSGOTO(ord, "TPM_PCRRead");
+
+   //Get the ptr value
+   memcpy(outDigest, bptr, sizeof(TPM_PCRVALUE));
+
+   goto egress;
+abort_egress:
+egress:
+   free(cmdbuf);
+   return status;
+
+}
diff --git a/stubdom/vtpm/vtpm_cmd.h b/stubdom/vtpm/vtpm_cmd.h
new file mode 100644
index 0000000..b0bfa22
--- /dev/null
+++ b/stubdom/vtpm/vtpm_cmd.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef MANAGER_H
+#define MANAGER_H
+
+#include <tpmfront.h>
+#include <tpmback.h>
+#include "tpm/tpm_structures.h"
+
+/* Create a command response error header */
+int create_error_response(tpmcmd_t* tpmcmd, TPM_RESULT errorcode);
+/* Request random bytes from hardware tpm, returns 0 on success */
+TPM_RESULT VTPM_GetRandom(struct tpmfront_dev* tpmfront_dev, BYTE* bytes, UINT32* numbytes);
+/* Retreive 256 bit AES encryption key from manager */
+TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length);
+/* Manager securely saves our 256 bit AES encryption key */
+TPM_RESULT VTPM_SaveHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length);
+/* Send a TPM_PCRRead command passthrough the manager to the hw tpm */
+TPM_RESULT VTPM_PCRRead(struct tpmfront_dev* tpmfront_dev, UINT32 pcrIndex, BYTE* outDigest);
+
+#endif
diff --git a/stubdom/vtpm/vtpm_pcrs.c b/stubdom/vtpm/vtpm_pcrs.c
new file mode 100644
index 0000000..22a6cef
--- /dev/null
+++ b/stubdom/vtpm/vtpm_pcrs.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include "vtpm_pcrs.h"
+#include "vtpm_cmd.h"
+#include "tpm/tpm_data.h"
+
+#define PCR_VALUE      tpmData.permanent.data.pcrValue
+
+static int write_pcr_direct(unsigned int pcrIndex, uint8_t* val) {
+   if(pcrIndex > TPM_NUM_PCR) {
+      return TPM_BADINDEX;
+   }
+   memcpy(&PCR_VALUE[pcrIndex], val, sizeof(TPM_PCRVALUE));
+   return TPM_SUCCESS;
+}
+
+TPM_RESULT vtpm_initialize_hw_pcrs(struct tpmfront_dev* tpmfront_dev, unsigned long pcrs)
+{
+   TPM_RESULT rc = TPM_SUCCESS;
+   uint8_t digest[sizeof(TPM_PCRVALUE)];
+
+   for(unsigned int i = 0; i < TPM_NUM_PCR; ++i) {
+      if(pcrs & 1 << i) {
+         if((rc = VTPM_PCRRead(tpmfront_dev, i, digest)) != TPM_SUCCESS) {
+            error("TPM_PCRRead failed with error : %d", rc);
+            return rc;
+         }
+         write_pcr_direct(i, digest);
+      }
+   }
+
+   return rc;
+}
diff --git a/stubdom/vtpm/vtpm_pcrs.h b/stubdom/vtpm/vtpm_pcrs.h
new file mode 100644
index 0000000..11835f9
--- /dev/null
+++ b/stubdom/vtpm/vtpm_pcrs.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef VTPM_PCRS_H
+#define VTPM_PCRS_H
+
+#include "tpm/tpm_structures.h"
+
+#define VTPM_PCR0 1
+#define VTPM_PCR1 1 << 1
+#define VTPM_PCR2 1 << 2
+#define VTPM_PCR3 1 << 3
+#define VTPM_PCR4 1 << 4
+#define VTPM_PCR5 1 << 5
+#define VTPM_PCR6 1 << 6
+#define VTPM_PCR7 1 << 7
+#define VTPM_PCR8 1 << 8
+#define VTPM_PCR9 1 << 9
+#define VTPM_PCR10 1 << 10
+#define VTPM_PCR11 1 << 11
+#define VTPM_PCR12 1 << 12
+#define VTPM_PCR13 1 << 13
+#define VTPM_PCR14 1 << 14
+#define VTPM_PCR15 1 << 15
+#define VTPM_PCR16 1 << 16
+#define VTPM_PCR17 1 << 17
+#define VTPM_PCR18 1 << 18
+#define VTPM_PCR19 1 << 19
+#define VTPM_PCR20 1 << 20
+#define VTPM_PCR21 1 << 21
+#define VTPM_PCR22 1 << 22
+#define VTPM_PCR23 1 << 23
+
+#define VTPM_PCRALL (1 << TPM_NUM_PCR) - 1
+#define VTPM_PCRNONE 0
+
+#define VTPM_NUMPCRS 24
+
+struct tpmfront_dev;
+
+TPM_RESULT vtpm_initialize_hw_pcrs(struct tpmfront_dev* tpmfront_dev, unsigned long pcrs);
+
+
+#endif
diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
new file mode 100644
index 0000000..b343bd8
--- /dev/null
+++ b/stubdom/vtpm/vtpmblk.c
@@ -0,0 +1,307 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <mini-os/byteorder.h>
+#include "vtpmblk.h"
+#include "tpm/tpm_marshalling.h"
+#include "vtpm_cmd.h"
+#include "polarssl/aes.h"
+#include "polarssl/sha1.h"
+#include <blkfront.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+
+/*Encryption key and block sizes */
+#define BLKSZ 16
+
+static struct blkfront_dev* blkdev = NULL;
+static int blkfront_fd = -1;
+
+int init_vtpmblk(struct tpmfront_dev* tpmfront_dev)
+{
+   struct blkfront_info blkinfo;
+   info("Initializing persistent NVM storage\n");
+
+   if((blkdev = init_blkfront(NULL, &blkinfo)) == NULL) {
+      error("BLKIO: ERROR Unable to initialize blkfront");
+      return -1;
+   }
+   if (blkinfo.info & VDISK_READONLY || blkinfo.mode != O_RDWR) {
+      error("BLKIO: ERROR block device is read only!");
+      goto error;
+   }
+   if((blkfront_fd = blkfront_open(blkdev)) == -1) {
+      error("Unable to open blkfront file descriptor!");
+      goto error;
+   }
+
+   return 0;
+error:
+   shutdown_blkfront(blkdev);
+   blkdev = NULL;
+   return -1;
+}
+
+void shutdown_vtpmblk(void)
+{
+   close(blkfront_fd);
+   blkfront_fd = -1;
+   blkdev = NULL;
+}
+
+int write_vtpmblk_raw(uint8_t *data, size_t data_length)
+{
+   int rc;
+   uint32_t lenbuf;
+   debug("Begin Write data=%p len=%u", data, data_length);
+
+   lenbuf = cpu_to_be32((uint32_t)data_length);
+
+   lseek(blkfront_fd, 0, SEEK_SET);
+   if((rc = write(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
+      error("write(length) failed! error was %s", strerror(errno));
+      return -1;
+   }
+   if((rc = write(blkfront_fd, data, data_length)) != data_length) {
+      error("write(data) failed! error was %s", strerror(errno));
+      return -1;
+   }
+
+   info("Wrote %u bytes to NVM persistent storage", data_length);
+
+   return 0;
+}
+
+int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
+{
+   int rc;
+   uint32_t lenbuf;
+
+   lseek(blkfront_fd, 0, SEEK_SET);
+   if(( rc = read(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
+      error("read(length) failed! error was %s", strerror(errno));
+      return -1;
+   }
+   *data_length = (size_t) cpu_to_be32(lenbuf);
+   if(*data_length == 0) {
+      error("read 0 data_length for NVM");
+      return -1;
+   }
+
+   *data = tpm_malloc(*data_length);
+   if((rc = read(blkfront_fd, *data, *data_length)) != *data_length) {
+      error("read(data) failed! error was %s", strerror(errno));
+      return -1;
+   }
+
+   info("Read %u bytes from NVM persistent storage", *data_length);
+   return 0;
+}
+
+int encrypt_vtpmblk(uint8_t* clear, size_t clear_len, uint8_t** cipher, size_t* cipher_len, uint8_t* symkey)
+{
+   int rc = 0;
+   uint8_t iv[BLKSZ];
+   aes_context aes_ctx;
+   UINT32 temp;
+   int mod;
+
+   uint8_t* clbuf = NULL;
+
+   uint8_t* ivptr;
+   int ivlen;
+
+   uint8_t* cptr;	//Cipher block pointer
+   int clen;	//Cipher block length
+
+   /*Create a new 256 bit encryption key */
+   if(symkey == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+   tpm_get_extern_random_bytes(symkey, NVMKEYSZ);
+
+   /*Setup initialization vector - random bits and then 4 bytes clear text size at the end*/
+   temp = sizeof(UINT32);
+   ivlen = BLKSZ - temp;
+   tpm_get_extern_random_bytes(iv, ivlen);
+   ivptr = iv + ivlen;
+   tpm_marshal_UINT32(&ivptr, &temp, (UINT32) clear_len);
+
+   /*The clear text needs to be padded out to a multiple of BLKSZ */
+   mod = clear_len % BLKSZ;
+   clen = mod ? clear_len + BLKSZ - mod : clear_len;
+   clbuf = malloc(clen);
+   if (clbuf == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+   memcpy(clbuf, clear, clear_len);
+   /* zero out the padding bits - FIXME: better / more secure way to handle these? */
+   if(clen - clear_len) {
+      memset(clbuf + clear_len, 0, clen - clear_len);
+   }
+
+   /* Setup the ciphertext buffer */
+   *cipher_len = BLKSZ + clen;		/*iv + ciphertext */
+   cptr = *cipher = malloc(*cipher_len);
+   if (*cipher == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Copy the IV to cipher text blob*/
+   memcpy(cptr, iv, BLKSZ);
+   cptr += BLKSZ;
+
+   /* Setup encryption */
+   aes_setkey_enc(&aes_ctx, symkey, 256);
+
+   /* Do encryption now */
+   aes_crypt_cbc(&aes_ctx, AES_ENCRYPT, clen, iv, clbuf, cptr);
+
+   goto egress;
+abort_egress:
+egress:
+   free(clbuf);
+   return rc;
+}
+int decrypt_vtpmblk(uint8_t* cipher, size_t cipher_len, uint8_t** clear, size_t* clear_len, uint8_t* symkey)
+{
+   int rc = 0;
+   uint8_t iv[BLKSZ];
+   uint8_t* ivptr;
+   UINT32 u32, temp;
+   aes_context aes_ctx;
+
+   uint8_t* cptr = cipher;	//cipher block pointer
+   int clen = cipher_len;	//cipher block length
+
+   /* Pull out the initialization vector */
+   memcpy(iv, cipher, BLKSZ);
+   cptr += BLKSZ;
+   clen -= BLKSZ;
+
+   /* Setup the clear text buffer */
+   if((*clear = malloc(clen)) == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Get the length of clear text from last 4 bytes of iv */
+   temp = sizeof(UINT32);
+   ivptr = iv + BLKSZ - temp;
+   tpm_unmarshal_UINT32(&ivptr, &temp, &u32);
+   *clear_len = u32;
+
+   /* Setup decryption */
+   aes_setkey_dec(&aes_ctx, symkey, 256);
+
+   /* Do decryption now */
+   if ((clen % BLKSZ) != 0) {
+      error("Decryption Error: Cipher block size was not a multiple of %u", BLKSZ);
+      rc = -1;
+      goto abort_egress;
+   }
+   aes_crypt_cbc(&aes_ctx, AES_DECRYPT, clen, iv, cptr, *clear);
+
+   goto egress;
+abort_egress:
+egress:
+   return rc;
+}
+
+int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length) {
+   int rc;
+   uint8_t* cipher = NULL;
+   size_t cipher_len = 0;
+   uint8_t hashkey[HASHKEYSZ];
+   uint8_t* symkey = hashkey + HASHSZ;
+
+   /* Encrypt the data */
+   if((rc = encrypt_vtpmblk(data, data_length, &cipher, &cipher_len, symkey))) {
+      goto abort_egress;
+   }
+   /* Write to disk */
+   if((rc = write_vtpmblk_raw(cipher, cipher_len))) {
+      goto abort_egress;
+   }
+   /* Get sha1 hash of data */
+   sha1(cipher, cipher_len, hashkey);
+
+   /* Send hash and key to manager */
+   if((rc = VTPM_SaveHashKey(tpmfront_dev, hashkey, HASHKEYSZ)) != TPM_SUCCESS) {
+      goto abort_egress;
+   }
+   goto egress;
+abort_egress:
+egress:
+   free(cipher);
+   return rc;
+}
+
+int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data_length) {
+   int rc;
+   uint8_t* cipher = NULL;
+   size_t cipher_len = 0;
+   size_t keysize;
+   uint8_t* hashkey = NULL;
+   uint8_t hash[HASHSZ];
+   uint8_t* symkey;
+
+   /* Retreive the hash and the key from the manager */
+   if((rc = VTPM_LoadHashKey(tpmfront_dev, &hashkey, &keysize)) != TPM_SUCCESS) {
+      goto abort_egress;
+   }
+   if(keysize != HASHKEYSZ) {
+      error("Manager returned a hashkey of invalid size! expected %d, actual %d", NVMKEYSZ, keysize);
+      rc = -1;
+      goto abort_egress;
+   }
+   symkey = hashkey + HASHSZ;
+
+   /* Read from disk now */
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len))) {
+      goto abort_egress;
+   }
+
+   /* Compute the hash of the cipher text and compare */
+   sha1(cipher, cipher_len, hash);
+   if(memcmp(hash, hashkey, HASHSZ)) {
+      int i;
+      error("NVM Storage Checksum failed!");
+      printf("Expected: ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hashkey[i]);
+      }
+      printf("\n");
+      printf("Actual:   ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hash[i]);
+      }
+      printf("\n");
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Decrypt the blob */
+   if((rc = decrypt_vtpmblk(cipher, cipher_len, data, data_length, symkey))) {
+      goto abort_egress;
+   }
+   goto egress;
+abort_egress:
+egress:
+   free(cipher);
+   free(hashkey);
+   return rc;
+}
diff --git a/stubdom/vtpm/vtpmblk.h b/stubdom/vtpm/vtpmblk.h
new file mode 100644
index 0000000..282ce6a
--- /dev/null
+++ b/stubdom/vtpm/vtpmblk.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef NVM_H
+#define NVM_H
+#include <mini-os/types.h>
+#include <xen/xen.h>
+#include <tpmfront.h>
+
+#define NVMKEYSZ 32
+#define HASHSZ 20
+#define HASHKEYSZ (NVMKEYSZ + HASHSZ)
+
+int init_vtpmblk(struct tpmfront_dev* tpmfront_dev);
+void shutdown_vtpmblk(void);
+
+/* Encrypts and writes data to blk device */
+int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t *data, size_t data_length);
+/* Reads, Decrypts, and returns data from blk device */
+int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t **data, size_t *data_length);
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:36:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:36:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1VF-0005c2-Oo; Thu, 01 Nov 2012 20:36:37 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TU1VE-0005bQ-Jw
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:36:36 +0000
Received: from [193.109.254.147:54834] by server-12.bemta-14.messagelabs.com
	id 7A/51-00510-35DD2905; Thu, 01 Nov 2012 20:36:35 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-11.tower-27.messagelabs.com!1351802192!2496558!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15453 invoked from network); 1 Nov 2012 20:36:34 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-11.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 20:36:34 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148031245;
	Thu, 01 Nov 2012 16:35:56 -0400
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com, xen-devel@lists.xen.org,
	stefano.stabellini@eu.citrix.com
Date: Thu,  1 Nov 2012 16:35:50 -0400
Message-Id: <1351802150-19258-4-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM 9/9] vtpm/vtpmmgr and required libs to
	stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add 3 new libraries to stubdom:
libgmp
polarssl
Berlios TPM Emulator 0.7.4

Also adds makefile structure for vtpm-stubdom and vtpmmgrdom

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 50ba360..96801b2 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -31,6 +31,18 @@ GRUB_VERSION=0.97
 OCAML_URL?=http://caml.inria.fr/pub/distrib/ocaml-3.11
 OCAML_VERSION=3.11.0
 
+GMP_VERSION=4.3.2
+#GMP_URL?=$(XEN_EXTFILES_URL)
+GMP_URL?=ftp://ftp.gmplib.org/pub/gmp-$(GMP_VERSION)
+
+POLARSSL_VERSION=1.1.4
+#POLARSSL_URL?=$(XEN_EXTFILES_URL)
+POLARSSL_URL?=http://polarssl.org/code/releases
+
+TPMEMU_VERSION=0.7.4
+#TPMEMU_URL?=$(XEN_EXTFILES_URL)
+TPMEMU_URL?=http://download.berlios.de/tpm-emulator
+
 WGET=wget -c
 
 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
@@ -74,12 +86,12 @@ TARGET_CPPFLAGS += -I$(XEN_ROOT)/xen/include
 
 TARGET_LDFLAGS += -nostdlib -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
 
-TARGETS=ioemu c caml grub xenstore
+TARGETS=ioemu c caml grub xenstore vtpm vtpmmgr
 
 .PHONY: all
 all: build
 ifeq ($(STUBDOM_SUPPORTED),1)
-build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom
+build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom vtpm-stubdom vtpmmgrdom
 else
 build: genpath
 endif
@@ -176,6 +188,76 @@ lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
 	touch $@
 
 #############
+# cross-gmp
+#############
+gmp-$(GMP_VERSION).tar.bz2:
+	$(WGET) $(GMP_URL)/$@
+
+.PHONY: cross-gmp
+ifeq ($(XEN_TARGET_ARCH), x86_32)
+   GMPEXT=ABI=32
+endif
+gmp-$(XEN_TARGET_ARCH): gmp-$(GMP_VERSION).tar.bz2 $(NEWLIB_STAMPFILE)
+	tar xjf $<
+	mv gmp-$(GMP_VERSION) $@
+	#patch -d $@ -p0 < gmp.patch
+	cd $@; CPPFLAGS="-isystem $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include $(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" CC=$(CC) $(GMPEXT) ./configure --disable-shared --enable-static --disable-fft --without-readline --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf
+	sed -i 's/#define HAVE_OBSTACK_VPRINTF 1/\/\/#define HAVE_OBSTACK_VPRINTF 1/' $@/config.h
+	touch $@
+
+GMP_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libgmp.a
+cross-gmp: $(GMP_STAMPFILE)
+$(GMP_STAMPFILE): gmp-$(XEN_TARGET_ARCH)
+	( cd $< && \
+	  $(MAKE) && \
+	  $(MAKE) install )
+
+#############
+# cross-polarssl
+#############
+polarssl-$(POLARSSL_VERSION)-gpl.tgz:
+	$(WGET) $(POLARSSL_URL)/$@
+
+polarssl-$(XEN_TARGET_ARCH): polarssl-$(POLARSSL_VERSION)-gpl.tgz
+	tar xzf $<
+	mv polarssl-$(POLARSSL_VERSION) $@
+	patch -d $@ -p1 < polarssl.patch
+	touch $@
+
+POLARSSL_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libpolarssl.a
+cross-polarssl: $(POLARSSL_STAMPFILE)
+$(POLARSSL_STAMPFILE): polarssl-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) lwip-$(XEN_TARGET_ARCH)
+	 ( cd $</library && \
+	   make CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I $(realpath $(MINI_OS)/include)" && \
+	   mkdir -p $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include && \
+	   cp -r ../include/* $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include && \
+	   mkdir -p $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib && \
+	   $(INSTALL_DATA) libpolarssl.a $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ )
+
+#############
+# cross-tpmemu
+#############
+tpm_emulator-$(TPMEMU_VERSION).tar.gz:
+	$(WGET) $(TPMEMU_URL)/$@
+
+tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
+	tar xzf $<
+	mv tpm_emulator-$(TPMEMU_VERSION) $@
+	patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
+	mkdir $@/build
+	cd $@/build; cmake .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
+	touch $@
+
+TPMEMU_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm.a
+$(TPMEMU_STAMPFILE): tpm_emulator-$(XEN_TARGET_ARCH) $(GMP_STAMPFILE)
+	( cd $</build && make VERBOSE=1 tpm_crypto tpm  )
+	cp $</build/crypto/libtpm_crypto.a $(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm_crypto.a
+	cp $</build/tpm/libtpm.a $(TPMEMU_STAMPFILE)
+
+.PHONY: cross-tpmemu
+cross-tpmemu: $(TPMEMU_STAMPFILE)
+
+#############
 # Cross-ocaml
 #############
 
@@ -319,6 +401,24 @@ c: $(CROSS_ROOT)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
 
 ######
+# VTPM
+######
+
+.PHONY: vtpm
+vtpm: cross-polarssl cross-tpmemu
+	make -C $(MINI_OS) links
+	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+
+######
+# VTPMMGR
+######
+
+.PHONY: vtpmmgr
+vtpmmgr: cross-polarssl
+	make -C $(MINI_OS) links
+	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+
+######
 # Grub
 ######
 
@@ -362,6 +462,14 @@ caml-stubdom: mini-os-$(XEN_TARGET_ARCH)-caml lwip-$(XEN_TARGET_ARCH) libxc cros
 c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxc c
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/c/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS=$(CURDIR)/c/main.a
 
+.PHONY: vtpm-stubdom
+vtpm-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpm vtpm
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpm/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpm/vtpm.a" APP_LDLIBS="-ltpm -ltpm_crypto -lgmp"
+
+.PHONY: vtpmmgrdom
+vtpmmgrdom: mini-os-$(XEN_TARGET_ARCH)-vtpmmgr vtpmmgr
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpmmgr/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpmmgr/vtpmmgr.a" APP_LDLIBS="-lm"
+
 .PHONY: pv-grub
 pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxc grub
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/grub/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a
@@ -375,7 +483,7 @@ xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxc xenstore
 #########
 
 ifeq ($(STUBDOM_SUPPORTED),1)
-install: genpath install-readme install-ioemu install-grub install-xenstore
+install: genpath install-readme install-ioemu install-grub install-xenstore install-vtpm install-vtpmmgr
 else
 install: genpath
 endif
@@ -399,6 +507,14 @@ install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/boot"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/xenstore-stubdom.gz"
 
+install-vtpm: vtpm-stubdom
+	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-vtpm/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpm-stubdom.gz"
+
+install-vtpmmgr: vtpm-stubdom
+	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-vtpmmgr/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpmmgrdom.gz"
+
 #######
 # clean
 #######
@@ -411,8 +527,12 @@ clean:
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-caml
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
+	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
+	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
 	$(MAKE) DESTDIR= -C caml clean
 	$(MAKE) DESTDIR= -C c clean
+	$(MAKE) -C vtpm clean
+	$(MAKE) -C vtpmmgr clean
 	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f $(STUBDOMPATH)
 	[ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
@@ -426,6 +546,10 @@ crossclean: clean
 	rm -fr newlib-$(XEN_TARGET_ARCH)
 	rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH)
 	rm -fr libxc-$(XEN_TARGET_ARCH) ioemu
+	rm -fr gmp-$(XEN_TARGET_ARCH)
+	rm -fr polarssl-$(XEN_TARGET_ARCH)
+	rm -fr openssl-$(XEN_TARGET_ARCH)
+	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -f mk-headers-$(XEN_TARGET_ARCH)
 	rm -fr ocaml-$(XEN_TARGET_ARCH)
 	rm -fr include
@@ -434,6 +558,10 @@ crossclean: clean
 .PHONY: patchclean
 patchclean: crossclean
 	rm -fr newlib-$(NEWLIB_VERSION)
+	rm -fr gmp-$(XEN_TARGET_ARCH)
+	rm -fr polarssl-$(XEN_TARGET_ARCH)
+	rm -fr openssl-$(XEN_TARGET_ARCH)
+	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -fr lwip-$(XEN_TARGET_ARCH)
 	rm -fr grub-upstream
 
@@ -442,10 +570,14 @@ patchclean: crossclean
 downloadclean: patchclean
 	rm -f newlib-$(NEWLIB_VERSION).tar.gz
 	rm -f zlib-$(ZLIB_VERSION).tar.gz
+	rm -f gmp-$(GMP_VERSION).tar.gz
+	rm -f tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	rm -f pciutils-$(LIBPCI_VERSION).tar.bz2
 	rm -f grub-$(GRUB_VERSION).tar.gz
 	rm -f lwip-$(LWIP_VERSION).tar.gz
 	rm -f ocaml-$(OCAML_VERSION).tar.gz
+	rm -f polarssl-$(POLARSSL_VERSION)-gpl.tgz
+	rm -f openssl-$(POLARSSL_VERSION)-gpl.tgz
 
 .PHONY: distclean
 distclean: downloadclean
diff --git a/stubdom/polarssl.patch b/stubdom/polarssl.patch
new file mode 100644
index 0000000..d387d4e
--- /dev/null
+++ b/stubdom/polarssl.patch
@@ -0,0 +1,64 @@
+diff -Naur polarssl-1.1.4/include/polarssl/config.h polarssl-x86_64/include/polarssl/config.h
+--- polarssl-1.1.4/include/polarssl/config.h	2011-12-22 05:06:27.000000000 -0500
++++ polarssl-x86_64/include/polarssl/config.h	2012-10-30 17:18:07.567001000 -0400
+@@ -164,8 +164,8 @@
+  * application.
+  *
+  * Uncomment this macro to prevent loading of default entropy functions.
+-#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
+  */
++#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
+
+ /**
+  * \def POLARSSL_NO_PLATFORM_ENTROPY
+@@ -175,8 +175,8 @@
+  * standards like the /dev/urandom or Windows CryptoAPI.
+  *
+  * Uncomment this macro to disable the built-in platform entropy functions.
+-#define POLARSSL_NO_PLATFORM_ENTROPY
+  */
++#define POLARSSL_NO_PLATFORM_ENTROPY
+
+ /**
+  * \def POLARSSL_PKCS1_V21
+@@ -426,8 +426,8 @@
+  * Requires: POLARSSL_TIMING_C
+  *
+  * This module enables the HAVEGE random number generator.
+- */
+ #define POLARSSL_HAVEGE_C
++ */
+
+ /**
+  * \def POLARSSL_MD_C
+@@ -490,7 +490,7 @@
+  *
+  * This module provides TCP/IP networking routines.
+  */
+-#define POLARSSL_NET_C
++//#define POLARSSL_NET_C
+
+ /**
+  * \def POLARSSL_PADLOCK_C
+@@ -644,8 +644,8 @@
+  * Caller:  library/havege.c
+  *
+  * This module is used by the HAVEGE random number generator.
+- */
+ #define POLARSSL_TIMING_C
++ */
+
+ /**
+  * \def POLARSSL_VERSION_C
+diff -Naur polarssl-1.1.4/library/bignum.c polarssl-x86_64/library/bignum.c
+--- polarssl-1.1.4/library/bignum.c	2012-04-29 16:15:55.000000000 -0400
++++ polarssl-x86_64/library/bignum.c	2012-10-30 17:21:52.135000999 -0400
+@@ -1101,7 +1101,7 @@
+             Z.p[i - t - 1] = ~0;
+         else
+         {
+-#if defined(POLARSSL_HAVE_LONGLONG)
++#if 0 //defined(POLARSSL_HAVE_LONGLONG)
+             t_udbl r;
+
+             r  = (t_udbl) X.p[i] << biL;
diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
new file mode 100644
index 0000000..b84eff1
--- /dev/null
+++ b/stubdom/tpmemu-0.7.4.patch
@@ -0,0 +1,12 @@
+diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
+--- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c	2012-04-27 10:55:46.581963398 -0400
++++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c	2012-04-27 10:56:02.193034152 -0400
+@@ -249,7 +249,7 @@
+ #else /* TPM_NO_EXTERN */
+
+ int (*tpm_extern_init)(void)                                      = NULL;
+-int (*tpm_extern_release)(void)                                   = NULL;
++void (*tpm_extern_release)(void)                                   = NULL;
+ void* (*tpm_malloc)(size_t size)                                  = NULL;
+ void (*tpm_free)(/*const*/ void *ptr)                             = NULL;
+ void (*tpm_log)(int priority, const char *fmt, ...)               = NULL;
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:36:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:36:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1VF-0005c2-Oo; Thu, 01 Nov 2012 20:36:37 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TU1VE-0005bQ-Jw
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:36:36 +0000
Received: from [193.109.254.147:54834] by server-12.bemta-14.messagelabs.com
	id 7A/51-00510-35DD2905; Thu, 01 Nov 2012 20:36:35 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-11.tower-27.messagelabs.com!1351802192!2496558!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15453 invoked from network); 1 Nov 2012 20:36:34 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-11.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 20:36:34 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148031245;
	Thu, 01 Nov 2012 16:35:56 -0400
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com, xen-devel@lists.xen.org,
	stefano.stabellini@eu.citrix.com
Date: Thu,  1 Nov 2012 16:35:50 -0400
Message-Id: <1351802150-19258-4-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM 9/9] vtpm/vtpmmgr and required libs to
	stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add 3 new libraries to stubdom:
libgmp
polarssl
Berlios TPM Emulator 0.7.4

Also adds makefile structure for vtpm-stubdom and vtpmmgrdom

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 50ba360..96801b2 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -31,6 +31,18 @@ GRUB_VERSION=0.97
 OCAML_URL?=http://caml.inria.fr/pub/distrib/ocaml-3.11
 OCAML_VERSION=3.11.0
 
+GMP_VERSION=4.3.2
+#GMP_URL?=$(XEN_EXTFILES_URL)
+GMP_URL?=ftp://ftp.gmplib.org/pub/gmp-$(GMP_VERSION)
+
+POLARSSL_VERSION=1.1.4
+#POLARSSL_URL?=$(XEN_EXTFILES_URL)
+POLARSSL_URL?=http://polarssl.org/code/releases
+
+TPMEMU_VERSION=0.7.4
+#TPMEMU_URL?=$(XEN_EXTFILES_URL)
+TPMEMU_URL?=http://download.berlios.de/tpm-emulator
+
 WGET=wget -c
 
 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
@@ -74,12 +86,12 @@ TARGET_CPPFLAGS += -I$(XEN_ROOT)/xen/include
 
 TARGET_LDFLAGS += -nostdlib -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
 
-TARGETS=ioemu c caml grub xenstore
+TARGETS=ioemu c caml grub xenstore vtpm vtpmmgr
 
 .PHONY: all
 all: build
 ifeq ($(STUBDOM_SUPPORTED),1)
-build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom
+build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom vtpm-stubdom vtpmmgrdom
 else
 build: genpath
 endif
@@ -176,6 +188,76 @@ lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
 	touch $@
 
 #############
+# cross-gmp
+#############
+gmp-$(GMP_VERSION).tar.bz2:
+	$(WGET) $(GMP_URL)/$@
+
+.PHONY: cross-gmp
+ifeq ($(XEN_TARGET_ARCH), x86_32)
+   GMPEXT=ABI=32
+endif
+gmp-$(XEN_TARGET_ARCH): gmp-$(GMP_VERSION).tar.bz2 $(NEWLIB_STAMPFILE)
+	tar xjf $<
+	mv gmp-$(GMP_VERSION) $@
+	#patch -d $@ -p0 < gmp.patch
+	cd $@; CPPFLAGS="-isystem $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include $(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" CC=$(CC) $(GMPEXT) ./configure --disable-shared --enable-static --disable-fft --without-readline --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf
+	sed -i 's/#define HAVE_OBSTACK_VPRINTF 1/\/\/#define HAVE_OBSTACK_VPRINTF 1/' $@/config.h
+	touch $@
+
+GMP_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libgmp.a
+cross-gmp: $(GMP_STAMPFILE)
+$(GMP_STAMPFILE): gmp-$(XEN_TARGET_ARCH)
+	( cd $< && \
+	  $(MAKE) && \
+	  $(MAKE) install )
+
+#############
+# cross-polarssl
+#############
+polarssl-$(POLARSSL_VERSION)-gpl.tgz:
+	$(WGET) $(POLARSSL_URL)/$@
+
+polarssl-$(XEN_TARGET_ARCH): polarssl-$(POLARSSL_VERSION)-gpl.tgz
+	tar xzf $<
+	mv polarssl-$(POLARSSL_VERSION) $@
+	patch -d $@ -p1 < polarssl.patch
+	touch $@
+
+POLARSSL_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libpolarssl.a
+cross-polarssl: $(POLARSSL_STAMPFILE)
+$(POLARSSL_STAMPFILE): polarssl-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) lwip-$(XEN_TARGET_ARCH)
+	 ( cd $</library && \
+	   make CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I $(realpath $(MINI_OS)/include)" && \
+	   mkdir -p $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include && \
+	   cp -r ../include/* $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include && \
+	   mkdir -p $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib && \
+	   $(INSTALL_DATA) libpolarssl.a $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ )
+
+#############
+# cross-tpmemu
+#############
+tpm_emulator-$(TPMEMU_VERSION).tar.gz:
+	$(WGET) $(TPMEMU_URL)/$@
+
+tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
+	tar xzf $<
+	mv tpm_emulator-$(TPMEMU_VERSION) $@
+	patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
+	mkdir $@/build
+	cd $@/build; cmake .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
+	touch $@
+
+TPMEMU_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm.a
+$(TPMEMU_STAMPFILE): tpm_emulator-$(XEN_TARGET_ARCH) $(GMP_STAMPFILE)
+	( cd $</build && make VERBOSE=1 tpm_crypto tpm  )
+	cp $</build/crypto/libtpm_crypto.a $(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm_crypto.a
+	cp $</build/tpm/libtpm.a $(TPMEMU_STAMPFILE)
+
+.PHONY: cross-tpmemu
+cross-tpmemu: $(TPMEMU_STAMPFILE)
+
+#############
 # Cross-ocaml
 #############
 
@@ -319,6 +401,24 @@ c: $(CROSS_ROOT)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
 
 ######
+# VTPM
+######
+
+.PHONY: vtpm
+vtpm: cross-polarssl cross-tpmemu
+	make -C $(MINI_OS) links
+	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+
+######
+# VTPMMGR
+######
+
+.PHONY: vtpmmgr
+vtpmmgr: cross-polarssl
+	make -C $(MINI_OS) links
+	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+
+######
 # Grub
 ######
 
@@ -362,6 +462,14 @@ caml-stubdom: mini-os-$(XEN_TARGET_ARCH)-caml lwip-$(XEN_TARGET_ARCH) libxc cros
 c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxc c
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/c/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS=$(CURDIR)/c/main.a
 
+.PHONY: vtpm-stubdom
+vtpm-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpm vtpm
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpm/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpm/vtpm.a" APP_LDLIBS="-ltpm -ltpm_crypto -lgmp"
+
+.PHONY: vtpmmgrdom
+vtpmmgrdom: mini-os-$(XEN_TARGET_ARCH)-vtpmmgr vtpmmgr
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpmmgr/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpmmgr/vtpmmgr.a" APP_LDLIBS="-lm"
+
 .PHONY: pv-grub
 pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxc grub
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/grub/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a
@@ -375,7 +483,7 @@ xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxc xenstore
 #########
 
 ifeq ($(STUBDOM_SUPPORTED),1)
-install: genpath install-readme install-ioemu install-grub install-xenstore
+install: genpath install-readme install-ioemu install-grub install-xenstore install-vtpm install-vtpmmgr
 else
 install: genpath
 endif
@@ -399,6 +507,14 @@ install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/boot"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/xenstore-stubdom.gz"
 
+install-vtpm: vtpm-stubdom
+	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-vtpm/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpm-stubdom.gz"
+
+install-vtpmmgr: vtpm-stubdom
+	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-vtpmmgr/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpmmgrdom.gz"
+
 #######
 # clean
 #######
@@ -411,8 +527,12 @@ clean:
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-caml
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
+	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
+	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
 	$(MAKE) DESTDIR= -C caml clean
 	$(MAKE) DESTDIR= -C c clean
+	$(MAKE) -C vtpm clean
+	$(MAKE) -C vtpmmgr clean
 	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f $(STUBDOMPATH)
 	[ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
@@ -426,6 +546,10 @@ crossclean: clean
 	rm -fr newlib-$(XEN_TARGET_ARCH)
 	rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH)
 	rm -fr libxc-$(XEN_TARGET_ARCH) ioemu
+	rm -fr gmp-$(XEN_TARGET_ARCH)
+	rm -fr polarssl-$(XEN_TARGET_ARCH)
+	rm -fr openssl-$(XEN_TARGET_ARCH)
+	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -f mk-headers-$(XEN_TARGET_ARCH)
 	rm -fr ocaml-$(XEN_TARGET_ARCH)
 	rm -fr include
@@ -434,6 +558,10 @@ crossclean: clean
 .PHONY: patchclean
 patchclean: crossclean
 	rm -fr newlib-$(NEWLIB_VERSION)
+	rm -fr gmp-$(XEN_TARGET_ARCH)
+	rm -fr polarssl-$(XEN_TARGET_ARCH)
+	rm -fr openssl-$(XEN_TARGET_ARCH)
+	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -fr lwip-$(XEN_TARGET_ARCH)
 	rm -fr grub-upstream
 
@@ -442,10 +570,14 @@ patchclean: crossclean
 downloadclean: patchclean
 	rm -f newlib-$(NEWLIB_VERSION).tar.gz
 	rm -f zlib-$(ZLIB_VERSION).tar.gz
+	rm -f gmp-$(GMP_VERSION).tar.gz
+	rm -f tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	rm -f pciutils-$(LIBPCI_VERSION).tar.bz2
 	rm -f grub-$(GRUB_VERSION).tar.gz
 	rm -f lwip-$(LWIP_VERSION).tar.gz
 	rm -f ocaml-$(OCAML_VERSION).tar.gz
+	rm -f polarssl-$(POLARSSL_VERSION)-gpl.tgz
+	rm -f openssl-$(POLARSSL_VERSION)-gpl.tgz
 
 .PHONY: distclean
 distclean: downloadclean
diff --git a/stubdom/polarssl.patch b/stubdom/polarssl.patch
new file mode 100644
index 0000000..d387d4e
--- /dev/null
+++ b/stubdom/polarssl.patch
@@ -0,0 +1,64 @@
+diff -Naur polarssl-1.1.4/include/polarssl/config.h polarssl-x86_64/include/polarssl/config.h
+--- polarssl-1.1.4/include/polarssl/config.h	2011-12-22 05:06:27.000000000 -0500
++++ polarssl-x86_64/include/polarssl/config.h	2012-10-30 17:18:07.567001000 -0400
+@@ -164,8 +164,8 @@
+  * application.
+  *
+  * Uncomment this macro to prevent loading of default entropy functions.
+-#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
+  */
++#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
+
+ /**
+  * \def POLARSSL_NO_PLATFORM_ENTROPY
+@@ -175,8 +175,8 @@
+  * standards like the /dev/urandom or Windows CryptoAPI.
+  *
+  * Uncomment this macro to disable the built-in platform entropy functions.
+-#define POLARSSL_NO_PLATFORM_ENTROPY
+  */
++#define POLARSSL_NO_PLATFORM_ENTROPY
+
+ /**
+  * \def POLARSSL_PKCS1_V21
+@@ -426,8 +426,8 @@
+  * Requires: POLARSSL_TIMING_C
+  *
+  * This module enables the HAVEGE random number generator.
+- */
+ #define POLARSSL_HAVEGE_C
++ */
+
+ /**
+  * \def POLARSSL_MD_C
+@@ -490,7 +490,7 @@
+  *
+  * This module provides TCP/IP networking routines.
+  */
+-#define POLARSSL_NET_C
++//#define POLARSSL_NET_C
+
+ /**
+  * \def POLARSSL_PADLOCK_C
+@@ -644,8 +644,8 @@
+  * Caller:  library/havege.c
+  *
+  * This module is used by the HAVEGE random number generator.
+- */
+ #define POLARSSL_TIMING_C
++ */
+
+ /**
+  * \def POLARSSL_VERSION_C
+diff -Naur polarssl-1.1.4/library/bignum.c polarssl-x86_64/library/bignum.c
+--- polarssl-1.1.4/library/bignum.c	2012-04-29 16:15:55.000000000 -0400
++++ polarssl-x86_64/library/bignum.c	2012-10-30 17:21:52.135000999 -0400
+@@ -1101,7 +1101,7 @@
+             Z.p[i - t - 1] = ~0;
+         else
+         {
+-#if defined(POLARSSL_HAVE_LONGLONG)
++#if 0 //defined(POLARSSL_HAVE_LONGLONG)
+             t_udbl r;
+
+             r  = (t_udbl) X.p[i] << biL;
diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
new file mode 100644
index 0000000..b84eff1
--- /dev/null
+++ b/stubdom/tpmemu-0.7.4.patch
@@ -0,0 +1,12 @@
+diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
+--- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c	2012-04-27 10:55:46.581963398 -0400
++++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c	2012-04-27 10:56:02.193034152 -0400
+@@ -249,7 +249,7 @@
+ #else /* TPM_NO_EXTERN */
+
+ int (*tpm_extern_init)(void)                                      = NULL;
+-int (*tpm_extern_release)(void)                                   = NULL;
++void (*tpm_extern_release)(void)                                   = NULL;
+ void* (*tpm_malloc)(size_t size)                                  = NULL;
+ void (*tpm_free)(/*const*/ void *ptr)                             = NULL;
+ void (*tpm_log)(int priority, const char *fmt, ...)               = NULL;
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:40:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:40:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1Yp-0006KW-H7; Thu, 01 Nov 2012 20:40:19 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TU1Uv-0005Uu-Ke
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:36:18 +0000
Received: from [193.109.254.147:12184] by server-13.bemta-14.messagelabs.com
	id F9/98-11239-04DD2905; Thu, 01 Nov 2012 20:36:16 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-12.tower-27.messagelabs.com!1351802168!8576896!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=Mail larger than max spam size
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22623 invoked from network); 1 Nov 2012 20:36:10 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-12.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 20:36:10 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148031182;
	Thu, 01 Nov 2012 16:35:56 -0400
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com, xen-devel@lists.xen.org,
	stefano.stabellini@eu.citrix.com
Date: Thu,  1 Nov 2012 16:35:47 -0400
Message-Id: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
X-Mailman-Approved-At: Thu, 01 Nov 2012 20:40:18 +0000
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Remove the old vtpm process model. It doesn't work very
well and is no longer supported.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

diff --git a/tools/Makefile b/tools/Makefile
index d8c8cc0..2ca43b9 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -18,8 +18,6 @@ SUBDIRS-$(CONFIG_XCUTILS) += xcutils
 SUBDIRS-$(CONFIG_X86) += firmware
 SUBDIRS-y += console
 SUBDIRS-y += xenmon
-SUBDIRS-$(VTPM_TOOLS) += vtpm_manager
-SUBDIRS-$(VTPM_TOOLS) += vtpm
 SUBDIRS-y += xenstat
 SUBDIRS-$(CONFIG_Linux) += $(SUBDIRS-libaio)
 SUBDIRS-$(CONFIG_Linux) += memshr 
diff --git a/tools/blktap2/drivers/hashtable.c b/tools/blktap2/drivers/hashtable.c
index 631306b..90a6b85 100644
--- a/tools/blktap2/drivers/hashtable.c
+++ b/tools/blktap2/drivers/hashtable.c
@@ -3,7 +3,6 @@
 /*
  * There are duplicates of this code in:
  *  - tools/xenstore/hashtable.c
- *  - tools/vtpm_manager/util/hashtable.c
  */
 
 #include "hashtable.h"
diff --git a/tools/blktap2/drivers/hashtable.h b/tools/blktap2/drivers/hashtable.h
index 89aa3dc..56ca053 100644
--- a/tools/blktap2/drivers/hashtable.h
+++ b/tools/blktap2/drivers/hashtable.h
@@ -3,7 +3,6 @@
 /*
  * There are duplicates of this code in:
  *  - tools/xenstore/hashtable.h
- *  - tools/vtpm_manager/util/hashtable.h
  */
 
 #ifndef __HASHTABLE_CWC22_H__
diff --git a/tools/blktap2/drivers/hashtable_itr.c b/tools/blktap2/drivers/hashtable_itr.c
index 402e06b..731917c 100644
--- a/tools/blktap2/drivers/hashtable_itr.c
+++ b/tools/blktap2/drivers/hashtable_itr.c
@@ -1,10 +1,5 @@
 /* Copyright (C) 2002, 2004 Christopher Clark  <firstname.lastname@cl.cam.ac.uk> */
 
-/*
- * There are duplicates of this code in:
- *  - tools/vtpm_manager/util/hashtable_itr.c
- */
-
 #include "hashtable.h"
 #include "hashtable_private.h"
 #include "hashtable_itr.h"
diff --git a/tools/blktap2/drivers/hashtable_itr.h b/tools/blktap2/drivers/hashtable_itr.h
index 3d80638..81da838 100644
--- a/tools/blktap2/drivers/hashtable_itr.h
+++ b/tools/blktap2/drivers/hashtable_itr.h
@@ -1,10 +1,5 @@
 /* Copyright (C) 2002, 2004 Christopher Clark <firstname.lastname@cl.cam.ac.uk> */
 
-/*
- * There are duplicates of this code in:
- *  - tools/vtpm_manager/util/hashtable_itr.h
- */
-
 #ifndef __HASHTABLE_ITR_CWC22__
 #define __HASHTABLE_ITR_CWC22__
 #include "hashtable.h"
diff --git a/tools/blktap2/drivers/hashtable_private.h b/tools/blktap2/drivers/hashtable_private.h
index 5a13a65..954ecc3 100644
--- a/tools/blktap2/drivers/hashtable_private.h
+++ b/tools/blktap2/drivers/hashtable_private.h
@@ -3,7 +3,6 @@
 /*
  * There are duplicates of this code in:
  *  - tools/xenstore/hashtable_private.h
- *  - tools/vtpm_manager/util/hashtable_private.h
  */
 
 #ifndef __HASHTABLE_PRIVATE_CWC22_H__
diff --git a/tools/configure.ac b/tools/configure.ac
index e708f01..586313d 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -40,7 +40,6 @@ m4_include([m4/fetcher.m4])
 # Enable/disable options
 AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
 AX_ARG_DEFAULT_ENABLE([monitors], [Disable xenstat and xentop monitoring tools])
-AX_ARG_DEFAULT_DISABLE([vtpm], [Enable Virtual Trusted Platform Module])
 AX_ARG_DEFAULT_DISABLE([xenapi], [Enable Xen API Bindings])
 AX_ARG_DEFAULT_ENABLE([ocamltools], [Disable Ocaml tools])
 AX_ARG_DEFAULT_DISABLE([miniterm], [Enable miniterm])
diff --git a/tools/examples/README b/tools/examples/README
index 5b0314e..2225d5c 100644
--- a/tools/examples/README
+++ b/tools/examples/README
@@ -25,13 +25,7 @@ vif-bridge          - virtual network start/stop script in bridged mode
 vif-common.sh       - sourced by vif-bridge 
 vif-nat             - xen virtual network start/stop script in NAT mode 
 vif-route           - xen virtual network start/stop script in routed mode
-vtpm                - called by xen-backend.agent to bind/unbind vTPM devices
-vtpm-common.sh      - common code for vTPM handling
-vtpm-delete         - remove an entry from the vTPM table given the
-                      domain's name
-vtpm-hotplug-common.sh - sourced by vtpm
-vtpm-migration.sh   - sourced by external-device-migrate
-xen-backend.agent   - calls block, vif-*, vtpm scripts to add, remove, hotplug
+xen-backend.agent   - calls block, vif-* scripts to add, remove, hotplug
                       devices  
 xen-backend.rules   - hotplug script rules
 xend-config.sxp     - default xend configuration file
diff --git a/tools/examples/xmexample.pv-grub b/tools/examples/xmexample.pv-grub
index 85f847c..e04e6c1 100644
--- a/tools/examples/xmexample.pv-grub
+++ b/tools/examples/xmexample.pv-grub
@@ -105,20 +105,6 @@ disk = [ 'phy:hda1,hda1,w' ]
 # configured in xend-config.sxp.
 
 #----------------------------------------------------------------------------
-# Define to which TPM instance the user domain should communicate.
-# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
-# where INSTANCE indicates the instance number of the TPM the VM
-# should be talking to and DOM provides the domain where the backend
-# is located.
-# Note that no two virtual machines should try to connect to the same
-# TPM instance. The handling of all TPM instances does require
-# some management effort in so far that VM configration files (and thus
-# a VM) should be associated with a TPM instance throughout the lifetime
-# of the VM / VM configuration file. The instance number must be
-# greater or equal to 1.
-#vtpm = [ 'instance=1,backend=0' ]
-
-#----------------------------------------------------------------------------
 # Configure the behaviour when a domain exits.  There are three 'reasons'
 # for a domain to stop: poweroff, reboot, and crash.  For each of these you
 # may specify:
diff --git a/tools/examples/xmexample1 b/tools/examples/xmexample1
index 330aaf0..c951200 100644
--- a/tools/examples/xmexample1
+++ b/tools/examples/xmexample1
@@ -101,20 +101,6 @@ disk = [ 'phy:hda1,hda1,w' ]
 # configured in xend-config.sxp.
 
 #----------------------------------------------------------------------------
-# Define to which TPM instance the user domain should communicate.
-# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
-# where INSTANCE indicates the instance number of the TPM the VM
-# should be talking to and DOM provides the domain where the backend
-# is located.
-# Note that no two virtual machines should try to connect to the same
-# TPM instance. The handling of all TPM instances does require
-# some management effort in so far that VM configration files (and thus
-# a VM) should be associated with a TPM instance throughout the lifetime
-# of the VM / VM configuration file. The instance number must be
-# greater or equal to 1.
-#vtpm = [ 'instance=1,backend=0' ]
-
-#----------------------------------------------------------------------------
 # Set the kernel command line for the new domain.
 # You only need to define the IP parameters and hostname if the domain's
 # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
diff --git a/tools/examples/xmexample2 b/tools/examples/xmexample2
index 4e5eb3d..8c5137e 100644
--- a/tools/examples/xmexample2
+++ b/tools/examples/xmexample2
@@ -137,20 +137,6 @@ disk = [ 'phy:sda%d,sda1,w' % (7+vmid),
 # configured in xend-config.sxp.
 
 #----------------------------------------------------------------------------
-# Define to which TPM instance the user domain should communicate.
-# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
-# where INSTANCE indicates the instance number of the TPM the VM
-# should be talking to and DOM provides the domain where the backend
-# is located.
-# Note that no two virtual machines should try to connect to the same
-# TPM instance. The handling of all TPM instances does require
-# some management effort in so far that VM configration files (and thus
-# a VM) should be associated with a TPM instance throughout the lifetime
-# of the VM / VM configuration file. The instance number must be
-# greater or equal to 1.
-#vtpm = ['instance=%d,backend=0' % (vmid) ]
-
-#----------------------------------------------------------------------------
 # Set the kernel command line for the new domain.
 # You only need to define the IP parameters and hostname if the domain's
 # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
diff --git a/tools/examples/xmexample3 b/tools/examples/xmexample3
index dc22ce1..ae799f9 100644
--- a/tools/examples/xmexample3
+++ b/tools/examples/xmexample3
@@ -122,20 +122,6 @@ disk = [ 'phy:hda%d,hda1,w' % (vmid)]
 # configured in xend-config.sxp.
 
 #----------------------------------------------------------------------------
-# Define to which TPM instance the user domain should communicate.
-# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
-# where INSTANCE indicates the instance number of the TPM the VM
-# should be talking to and DOM provides the domain where the backend
-# is located.
-# Note that no two virtual machines should try to connect to the same
-# TPM instance. The handling of all TPM instances does require
-# some management effort in so far that VM configration files (and thus
-# a VM) should be associated with a TPM instance throughout the lifetime
-# of the VM / VM configuration file. The instance number must be
-# greater or equal to 1.
-#vtpm = ['instance=%d,backend=0' % (vmid) ]
-
-#----------------------------------------------------------------------------
 # Set the kernel command line for the new domain.
 # You only need to define the IP parameters and hostname if the domain's
 # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 0166790..0605559 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -18,14 +18,12 @@ XEN_SCRIPTS += vif-setup
 XEN_SCRIPTS += block
 XEN_SCRIPTS += block-enbd block-nbd
 XEN_SCRIPTS += blktap
-XEN_SCRIPTS += vtpm vtpm-delete
 XEN_SCRIPTS += xen-hotplug-cleanup
 XEN_SCRIPTS += external-device-migrate
 XEN_SCRIPTS += vscsi
 XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
 XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
-XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
-XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
+XEN_SCRIPT_DATA += block-common.sh
 
 UDEV_RULES_DIR = $(CONFIG_DIR)/udev
 UDEV_RULES = xen-backend.rules xend.rules
diff --git a/tools/hotplug/Linux/vtpm b/tools/hotplug/Linux/vtpm
deleted file mode 100644
index 38a4532..0000000
--- a/tools/hotplug/Linux/vtpm
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-dir=$(dirname "$0")
-. "$dir/vtpm-hotplug-common.sh"
-
-vtpm_fatal_error=0
-
-case "$command" in
-  add)
-    vtpm_create_instance
-  ;;
-  remove)
-    vtpm_remove_instance
-  ;;
-esac
-
-if [ $vtpm_fatal_error -eq 0 ]; then
-	log debug "Successful vTPM operation '$command'."
-	success
-else
-	fatal "Error while executing vTPM operation '$command'."
-fi
diff --git a/tools/hotplug/Linux/vtpm-common.sh b/tools/hotplug/Linux/vtpm-common.sh
deleted file mode 100644
index d0d7935..0000000
--- a/tools/hotplug/Linux/vtpm-common.sh
+++ /dev/null
@@ -1,448 +0,0 @@
-#
-# Copyright (c) 2005 IBM Corporation
-# Copyright (c) 2005 XenSource Ltd.
-#
-# 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
-#
-
-dir=$(dirname "$0")
-. "$dir/logging.sh"
-. "$dir/locking.sh"
-
-VTPMDB="/var/vtpm/vtpm.db"
-
-#In the vtpm-impl file some commands should be defined:
-#      vtpm_create, vtpm_setup, vtpm_start, etc. (see below)
-if [ -r "$dir/vtpm-impl.alt" ]; then
-	. "$dir/vtpm-impl.alt"
-elif [ -r "$dir/vtpm-impl" ]; then
-	. "$dir/vtpm-impl"
-else
-	function vtpm_create () {
-		true
-	}
-	function vtpm_setup() {
-		true
-	}
-	function vtpm_start() {
-		true
-	}
-	function vtpm_suspend() {
-		true
-	}
-	function vtpm_resume() {
-		true
-	}
-	function vtpm_delete() {
-		true
-	}
-	function vtpm_migrate() {
-		echo "Error: vTPM migration accross machines not implemented."
-	}
-	function vtpm_migrate_local() {
-		echo "Error: local vTPM migration not supported"
-	}
-	function vtpm_migrate_recover() {
-		true
-	}
-fi
-
-
-#Find the instance number for the vtpm given the name of the domain
-# Parameters
-# - vmname : the name of the vm
-# Return value
-#  Returns '0' if instance number could not be found, otherwise
-#  it returns the instance number in the variable 'instance'
-function vtpmdb_find_instance () {
-	local vmname ret instance
-	vmname=$1
-	ret=0
-
-	instance=$(cat $VTPMDB |                   \
-	          awk -vvmname=$vmname             \
-	          '{                               \
-	             if ( 1 != index($1,"#")) {    \
-	               if ( $1 == vmname ) {       \
-	                 print $2;                 \
-	                 exit;                     \
-	               }                           \
-	             }                             \
-	           }')
-	if [ "$instance" != "" ]; then
-		ret=$instance
-	fi
-	echo "$ret"
-}
-
-
-# Check whether a particular instance number is still available
-# returns "0" if it is not available, "1" otherwise.
-function vtpmdb_is_free_instancenum () {
-	local instance instances avail i
-	instance=$1
-	avail=1
-	#Allowed instance number range: 1-255
-	if [ $instance -eq 0 -o $instance -gt 255 ]; then
-		avail=0
-	else
-		instances=$(cat $VTPMDB |                \
-		           awk                          \
-		           '{                            \
-		               if (1 != index($1,"#")) { \
-		                 printf("%s ",$2);       \
-		               }                         \
-		            }')
-		for i in $instances; do
-			if [ $i -eq $instance ]; then
-				avail=0
-				break
-			fi
-		done
-	fi
-	echo "$avail"
-}
-
-
-# Get an available instance number given the database
-# Returns an unused instance number
-function vtpmdb_get_free_instancenum () {
-	local ctr instances don found
-	instances=$(cat $VTPMDB |                \
-	           awk                          \
-	           '{                            \
-	               if (1 != index($1,"#")) { \
-	                 printf("%s ",$2);       \
-	               }                         \
-	            }')
-	ctr=1
-	don=0
-	while [ $don -eq 0 ]; do
-		found=0
-		for i in $instances; do
-			if [ $i -eq $ctr ]; then
-				found=1;
-				break;
-			fi
-		done
-
-		if [ $found -eq 0 ]; then
-			don=1
-			break
-		fi
-		let ctr=ctr+1
-	done
-	echo "$ctr"
-}
-
-
-# Add a domain name and instance number to the DB file
-function vtpmdb_add_instance () {
-	local res vmname inst
-	vmname=$1
-	inst=$2
-
-	if [ ! -f $VTPMDB ]; then
-		echo "#Database for VM to vTPM association" > $VTPMDB
-		echo "#1st column: domain name" >> $VTPMDB
-		echo "#2nd column: TPM instance number" >> $VTPMDB
-	fi
-	res=$(vtpmdb_validate_entry $vmname $inst)
-	if [ $res -eq 0 ]; then
-		echo "$vmname $inst" >> $VTPMDB
-	fi
-}
-
-
-#Validate whether an entry is the same as passed to this
-#function
-function vtpmdb_validate_entry () {
-	local res rc vmname inst
-	rc=0
-	vmname=$1
-	inst=$2
-
-	res=$(cat $VTPMDB |            \
-	     awk -vvmname=$vmname     \
-	          -vinst=$inst         \
-	     '{                        \
-	         if ( 1 == index($1,"#")) {\
-	         } else                \
-	         if ( $1 == vmname &&  \
-	              $2 == inst) {    \
-	            printf("1");       \
-	            exit;              \
-	         } else                \
-	         if ( $1 == vmname ||  \
-	              $2 == inst) {    \
-	            printf("2");       \
-	            exit;              \
-	         }                     \
-	     }')
-
-	if [ "$res" == "1" ]; then
-		rc=1
-	elif [ "$res" == "2" ]; then
-		rc=2
-	fi
-	echo "$rc"
-}
-
-
-#Remove an entry from the vTPM database given its domain name
-#and instance number
-function vtpmdb_remove_entry () {
-	local vmname instance VTPMDB_TMP
-	vmname=$1
-	instance=$2
-	VTPMDB_TMP="$VTPMDB".tmp
-
-	$(cat $VTPMDB |            \
-	 awk -vvmname=$vmname     \
-	 '{                        \
-	    if ( $1 != vmname ) {  \
-	      print $0;            \
-	    }                      \
-	 '} > $VTPMDB_TMP)
-	if [ -e $VTPMDB_TMP ]; then
-		mv -f $VTPMDB_TMP $VTPMDB
-		vtpm_delete $instance
-	else
-		log err "Error creating temporary file '$VTPMDB_TMP'."
-	fi
-}
-
-
-# Find the reason for the creation of this device:
-# Returns 'resume' or 'create'
-function vtpm_get_create_reason () {
-	local resume
-	resume=$(xenstore_read $XENBUS_PATH/resume)
-	if [ "$resume" == "True" ]; then
-		echo "resume"
-	else
-		echo "create"
-	fi
-}
-
-
-#Create a vTPM instance
-# If no entry in the TPM database is found, the instance is
-# created and an entry added to the database.
-function vtpm_create_instance () {
-	local res instance domname reason uuid
-	uuid=$(xenstore_read "$XENBUS_PATH"/uuid)
-	reason=$(vtpm_get_create_reason)
-
-	claim_lock vtpmdb
-
-	instance="0"
-
-	if [ "$uuid" != "" ]; then
-		instance=$(vtpmdb_find_instance $uuid)
-	fi
-	if [ "$instance" == "0" ]; then
-		domname=$(xenstore_read "$XENBUS_PATH"/domain)
-		instance=$(vtpmdb_find_instance $domname)
-	fi
-
-	if [ "$instance" == "0" -a "$reason" != "create" ]; then
-		release_lock vtpmdb
-		return
-	fi
-
-	if [ "$instance" == "0" ]; then
-		#Try to give the preferred instance to the domain
-		instance=$(xenstore_read "$XENBUS_PATH"/pref_instance)
-		if [ "$instance" != "" ]; then
-			res=$(vtpmdb_is_free_instancenum $instance)
-			if [ $res -eq 0 ]; then
-				instance=$(vtpmdb_get_free_instancenum)
-			fi
-		else
-			instance=$(vtpmdb_get_free_instancenum)
-		fi
-
-		vtpm_create $instance
-
-		if [ $vtpm_fatal_error -eq 0 ]; then
-			if [ "$uuid" != "" ]; then
-				vtpmdb_add_instance $uuid $instance
-			else
-				vtpmdb_add_instance $domname $instance
-			fi
-		fi
-	else
-		if [ "$reason" == "resume" ]; then
-			vtpm_resume $instance
-		else
-			vtpm_start $instance
-		fi
-	fi
-
-	release_lock vtpmdb
-
-	xenstore_write $XENBUS_PATH/instance $instance
-}
-
-
-#Remove an instance when a VM is terminating or suspending.
-#Since it is assumed that the VM will appear again, the
-#entry is kept in the VTPMDB file.
-function vtpm_remove_instance () {
-	local instance reason domname uuid
-	#Stop script execution quietly if path does not exist (anymore)
-	xenstore-exists "$XENBUS_PATH"/domain
-	uuid=$(xenstore_read "$XENBUS_PATH"/uuid)
-
-	claim_lock vtpmdb
-
-	instance="0"
-
-	if [ "$uuid" != "" ]; then
-		instance=$(vtpmdb_find_instance $uuid)
-	fi
-
-	if [ "$instance" == "0" ]; then
-		domname=$(xenstore_read "$XENBUS_PATH"/domain)
-		instance=$(vtpmdb_find_instance $domname)
-	fi
-
-	if [ "$instance" != "0" ]; then
-		vtpm_suspend $instance
-	fi
-
-	release_lock vtpmdb
-}
-
-
-#Remove an entry in the VTPMDB file given the domain's name
-#1st parameter: The name of the domain
-function vtpm_delete_instance () {
-	local instance
-
-	claim_lock vtpmdb
-
-	instance=$(vtpmdb_find_instance $1)
-	if [ "$instance" != "0" ]; then
-		vtpmdb_remove_entry $1 $instance
-	fi
-
-	release_lock vtpmdb
-}
-
-# Determine whether the given address is local to this machine
-# Return values:
-#  "-1" : the given machine name is invalid
-#  "0"  : this is not an address of this machine
-#  "1"  : this is an address local to this machine
-function vtpm_isLocalAddress() {
-	local addr res
-	addr=$(ping $1 -c 1 |  \
-	       awk '{ print substr($3,2,length($3)-2); exit }')
-	if [ "$addr" == "" ]; then
-		echo "-1"
-		return
-	fi
-	res=$(ifconfig | grep "inet addr" |  \
-	     awk -vaddr=$addr               \
-	     '{                              \
-	        if ( addr == substr($2, 6)) {\
-	          print "1";                 \
-	        }                            \
-	     }'                              \
-	    )
-	if [ "$res" == "" ]; then
-		echo "0"
-		return
-	fi
-	echo "1"
-}
-
-# Perform a migration step. This function differentiates between migration
-# to the local host or to a remote machine.
-# Parameters:
-# 1st: destination host to migrate to
-# 2nd: name of the domain to migrate
-# 3rd: the migration step to perform
-function vtpm_migration_step() {
-	local res=$(vtpm_isLocalAddress $1)
-	if [ "$res" == "0" ]; then
-		vtpm_migrate $1 $2 $3
-	else
-		vtpm_migrate_local
-	fi
-}
-
-# Recover from migration due to an error. This function differentiates
-# between migration to the local host or to a remote machine.
-# Parameters:
-# 1st: destination host the migration was going to
-# 2nd: name of the domain that was to be migrated
-# 3rd: the last successful migration step that was done
-function vtpm_recover() {
-	local res
-	res=$(vtpm_isLocalAddress $1)
-	if [ "$res" == "0" ]; then
-		vtpm_migrate_recover $1 $2 $3
-	fi
-}
-
-
-#Determine the domain id given a domain's name.
-#1st parameter: name of the domain
-#return value: domain id  or -1 if domain id could not be determined
-function vtpm_domid_from_name () {
-	local id name ids
-	ids=$(xenstore-list /local/domain)
-	for id in $ids; do
-		name=$(xenstore-read /local/domain/$id/name)
-		if [ "$name" == "$1" ]; then
-			echo "$id"
-			return
-		fi
-	done
-	echo "-1"
-}
-
-#Determine the virtual TPM's instance number using the domain ID.
-#1st parm: domain ID
-function vtpm_uuid_by_domid() {
-	echo $(xenstore-read /local/domain/0/backend/vtpm/$1/0/uuid)
-}
-
-
-# Determine the vTPM's UUID by the name of the VM
-function vtpm_uuid_from_vmname() {
-	local domid=$(vtpm_domid_from_name $1)
-	if [ "$domid" != "-1" ]; then
-		echo $(vtpm_uuid_by_domid $domid)
-		return
-	fi
-	echo ""
-}
-
-#Add a virtual TPM instance number and its associated domain name
-#to the VTPMDB file and activate usage of this virtual TPM instance
-#by writing the instance number into the xenstore
-#1st parm: name of virtual machine
-#2nd parm: instance of associated virtual TPM
-function vtpm_add_and_activate() {
-	local domid=$(vtpm_domid_from_name $1)
-	local vtpm_uuid=$(vtpm_uuid_from_vmname $1)
-	if [ "$vtpm_uuid" != "" -a "$domid" != "-1" ]; then
-		vtpmdb_add_instance $vtpm_uuid $2
-		xenstore-write backend/vtpm/$domid/0/instance $2
-	fi
-}
diff --git a/tools/hotplug/Linux/vtpm-delete b/tools/hotplug/Linux/vtpm-delete
deleted file mode 100644
index b75b95b..0000000
--- a/tools/hotplug/Linux/vtpm-delete
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-
-# This scripts must be called the following way:
-# vtpm-delete <vtpm uuid>
-# or
-# vtpm-delete --vmname <vm name>
-
-dir=$(dirname "$0")
-. "$dir/vtpm-common.sh"
-
-if [ "$1" == "--vmname" ]; then
-	vtpm_uuid=$(vtpm_uuid_from_vmname $2)
-	if [ "$vtpm_uuid" != "" ];then
-		vtpm_delete_instance $vtpm_uuid
-	fi
-else
-	vtpm_delete_instance $1
-fi
diff --git a/tools/hotplug/Linux/vtpm-hotplug-common.sh b/tools/hotplug/Linux/vtpm-hotplug-common.sh
deleted file mode 100644
index 9fd35e7..0000000
--- a/tools/hotplug/Linux/vtpm-hotplug-common.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Copyright (c) 2005 IBM Corporation
-# Copyright (c) 2005 XenSource Ltd.
-#
-# 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
-#
-
-dir=$(dirname "$0")
-. "$dir/xen-hotplug-common.sh"
-
-findCommand "$@"
-if [ "$command" != "online" ]  &&
-   [ "$command" != "offline" ] &&
-   [ "$command" != "add" ]     &&
-   [ "$command" != "remove" ]
-then
-	log err "Invalid command: $command"
-	exit 1
-fi
-
-
-XENBUS_PATH="${XENBUS_PATH:?}"
-
-. "$dir/vtpm-common.sh"
diff --git a/tools/hotplug/Linux/vtpm-impl b/tools/hotplug/Linux/vtpm-impl
deleted file mode 100644
index 4f9a1fd..0000000
--- a/tools/hotplug/Linux/vtpm-impl
+++ /dev/null
@@ -1,208 +0,0 @@
-#!/bin/bash
-# ===================================================================
-# 
-# Copyright (c) 2005, Intel Corp.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-#   * Redistributions of source code must retain the above copyright 
-#     notice, this list of conditions and the following disclaimer.
-#   * Redistributions in binary form must reproduce the above 
-#     copyright notice, this list of conditions and the following 
-#     disclaimer in the documentation and/or other materials provided 
-#     with the distribution.
-#   * Neither the name of Intel Corporation nor the names of its 
-#     contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-# OF THE POSSIBILITY OF SUCH DAMAGE.
-# ===================================================================
-
-#            |        SRC        |    TAG  |      CMD SIZE     |        ORD       |mtype|strt
-TPM_CMD_OPEN=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x11\\x01\\x00\\x00\\x01\\x01\\x01
-TPM_CMD_RESM=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x11\\x01\\x00\\x00\\x01\\x01\\x02
-TPM_CMD_CLOS=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x0e\\x01\\x00\\x00\\x02
-TPM_CMD_DELE=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x0e\\x01\\x00\\x00\\x03
-
-TPM_TYPE_PVM=\\x01
-TPM_TYPE_HVM=\\x02
-
-TPM_SUCCESS=00000000
-
-TX_VTPM_MANAGER=/var/vtpm/fifos/from_console.fifo
-RX_VTPM_MANAGER=/var/vtpm/fifos/to_console.fifo
-
-VTPM_MIG=/usr/bin/vtpm_migrator
-
-# -------------------- Helpers for binary streams -----------
-
-function str_to_hex32() {
- printf "%0.8x" $1
-}
-
-function hex32_to_bin() {
- local inst=$(str_to_hex32 $1);
- 
- local n1=`echo $inst | sed 's/\(..\)....../\\\\x\1/'`
- local n2=`echo $inst | sed 's/..\(..\)..../\\\\x\1/'`
- local n3=`echo $inst | sed 's/....\(..\)../\\\\x\1/'`
- local n4=`echo $inst | sed 's/......\(..\)/\\\\x\1/'`
-
- echo "$n1$n2$n3$n4"
-}
-
-function vtpm_manager_cmd() {
- local cmd=$1;
- local inst=$2;
- local inst_bin=$(hex32_to_bin $inst);
-
- claim_lock vtpm_mgr
-
- #send cmd to vtpm_manager
- printf "$cmd$inst_bin" > $TX_VTPM_MANAGER
-
- #recv response
- set +e
- local resp_hex=`dd skip=10 bs=1 count=4 if=$RX_VTPM_MANAGER 2> /dev/null | xxd -ps`
- set -e
-
- release_lock vtpm_mgr
-
- #return whether the command was successful
- if [ $resp_hex -ne $TPM_SUCCESS ]; then
-   vtpm_fatal_error=1
-   false
-  else
-   true
- fi
-}
-
-# Helper to get vm type to pass to vtpm_manager open/resume
-function vtpm_get_type() {
- local inst=$(xenstore_read $XENBUS_PATH/frontend-id)
- local vm=$(xenstore_read /local/domain/$inst/vm)
- if [ "$vm" != "" ]; then
-  local ostype=$(xenstore-read $vm/image/ostype)
-  if [ "$ostype" == "hvm" ]; then
-   echo $TPM_TYPE_HVM;
-  else
-   echo $TPM_TYPE_PVM;
-  fi
- fi
-}
-
-# ------------------ Command handlers -----------------
-
-# Create new vtpm instance & set it up for use
-function vtpm_create () {
- # Creation is handled implicitly by the manager on first setup
- # so just set it up for use
- $(vtpm_start $1)
-}
-
-# Setup vtpm instance for use.
-function vtpm_start() {
- local vmtype=$(vtpm_get_type);
- $(vtpm_manager_cmd $TPM_CMD_OPEN$vmtype $1)
-}
-
-function vtpm_resume() {
- local vmtype=$(vtpm_get_type);
- $(vtpm_manager_cmd $TPM_CMD_RESM$vmtype $1)
-}
-
-# Reset the vtpm AKA clear PCRs
-function vtpm_reset() {
- #not used by current implemenation
- true
-}
-
-# Shutdown the vtpm while the vm is down
-# This could be a suspend of shutdown
-# we cannot distinquish, so save the state
-# and decide on startup if we should keep is
-function vtpm_suspend() {
- $(vtpm_manager_cmd $TPM_CMD_CLOS $1)
-}
-
-
-function vtpm_delete() {
- local inst=$1
- if $(vtpm_manager_cmd $TPM_CMD_DELE $inst); then
-   rm -f /var/vtpm/vtpm_dm_$1.data
-   true
- else 
-   vtpm_fatal_error=1
-   false
- fi
-}
-
-# Perform a migration step. This function differentiates between migration
-# to the local host or to a remote machine.
-# Parameters:
-# 1st: destination host to migrate to
-# 2nd: name of the domain to migrate
-# 3rd: the migration step to perform
-function vtpm_migrate() {
- local instance res
-
- instance=$(vtpmdb_find_instance $2)
- if [ "$instance" == "" ]; then
-  log err "VTPM Migratoin failed. Unable to translation of domain name"
-  echo "Error: VTPM Migration failed while looking up instance number"
- fi
-
- case "$3" in
-  0)
-   #Incicate migration supported
-   echo "0" 
-  ;;
-
-  1)
-   # Get Public Key from Destination
-   # Call vtpm_manager's migration part 1
-   claim_lock vtpm_mgr
-   $VTPM_MIG $1 $2 $instance $3
-   release_lock vtpm_mgr
-  ;;
-
-  2)
-   # Call manager's migration step 2 and send result to destination
-   # If successful remove from db
-   claim_lock vtpm_mgr
-   $VTPM_MIG $1 $2 $instance $3
-   release_lock vtpm_mgr
-  ;;
-
-  3)
-   if `ps x | grep "$VTPM_MIG $1"`; then
-    log err "VTPM Migration failed to complete."
-    echo "Error: VTPM Migration failed to complete."
-   fi
-  ;;
- esac
- 
-}
-
-
-function vtpm_migrate_recover() {
- echo "Error: Recovery not supported yet" 
-}
-
-function vtpm_migrate_local() {
- echo "Error: local vTPM migration not supported"
-}
diff --git a/tools/hotplug/Linux/vtpm-migration.sh b/tools/hotplug/Linux/vtpm-migration.sh
deleted file mode 100644
index 7e38ae2..0000000
--- a/tools/hotplug/Linux/vtpm-migration.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (c) 2005 IBM Corporation
-#
-# 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
-#
-
-dir=$(dirname "$0")
-. "$dir/vtpm-common.sh"
diff --git a/tools/hotplug/Linux/xen-backend.rules b/tools/hotplug/Linux/xen-backend.rules
index c591a3f..a0d409e 100644
--- a/tools/hotplug/Linux/xen-backend.rules
+++ b/tools/hotplug/Linux/xen-backend.rules
@@ -1,6 +1,5 @@
 SUBSYSTEM=="xen-backend", KERNEL=="tap*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/blktap $env{ACTION}"
 SUBSYSTEM=="xen-backend", KERNEL=="vbd*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/block $env{ACTION}"
-SUBSYSTEM=="xen-backend", KERNEL=="vtpm*", RUN+="/etc/xen/scripts/vtpm $env{ACTION}"
 SUBSYSTEM=="xen-backend", KERNEL=="vif2-*", RUN+="/etc/xen/scripts/vif2 $env{ACTION}"
 SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="online", RUN+="/etc/xen/scripts/vif-setup online type_if=vif"
 SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="offline", RUN+="/etc/xen/scripts/vif-setup offline type_if=vif"
diff --git a/tools/vtpm/Makefile b/tools/vtpm/Makefile
deleted file mode 100644
index 7b3efa5..0000000
--- a/tools/vtpm/Makefile
+++ /dev/null
@@ -1,74 +0,0 @@
-XEN_ROOT = $(CURDIR)/../..
-
-# Base definitions and rules
-include $(XEN_ROOT)/tools/vtpm/Rules.mk
-
-# Dir name for emulator (as dom0 tpm driver)
-TPM_EMULATOR_DIR = tpm_emulator
-# Dir name for vtpm instance
-VTPM_DIR = vtpm
-ORIG_DIR = orig
-
-# Emulator tarball name
-TPM_EMULATOR_NAME = tpm_emulator-0.5.1
-TPM_EMULATOR_TARFILE = $(TPM_EMULATOR_NAME).tar.gz
-
-GMP_HEADER = /usr/include/gmp.h
-
-.PHONY: all
-all: build
-
-.PHONY: build
-build: build_sub
-
-.PHONY: install
-install: build
-	$(MAKE) -C $(VTPM_DIR) install-recursive
-
-.PHONY: clean
-clean:
-	@if [ -d $(TPM_EMULATOR_DIR) ]; \
-		then $(MAKE) -C $(TPM_EMULATOR_DIR) clean; \
-	fi
-	@if [ -d $(VTPM_DIR) ]; \
-		then $(MAKE) -C $(VTPM_DIR) clean; \
-	fi
-
-.PHONY: mrproper
-mrproper:
-	rm -f $(TPM_EMULATOR_TARFILE) tpm_emulator.patch.old vtpm.patch.old
-	rm -rf $(TPM_EMULATOR_DIR) $(VTPM_DIR) $(ORIG_DIR)
-
-# Download Swiss emulator
-$(TPM_EMULATOR_TARFILE):
-	wget http://download.berlios.de/tpm-emulator/$(TPM_EMULATOR_TARFILE)
-
-# Create vtpm dirs
-$(VTPM_DIR)/tpmd/tpmd: $(TPM_EMULATOR_TARFILE) vtpm-0.5.1.patch
-	rm -rf $(VTPM_DIR)
-	tar -xzf $(TPM_EMULATOR_TARFILE)
-	mv $(TPM_EMULATOR_NAME) $(VTPM_DIR)
-
-	set -e; cd $(VTPM_DIR); \
-	patch -p1 < ../vtpm-0.5.1.patch; \
-	patch -p1 < ../vtpm-0.5.1-LDLIBS.patch
-
-orig: $(TPM_EMULATOR_TARFILE)
-	mkdir $(ORIG_DIR);
-	set -e; cd $(ORIG_DIR); \
-	tar -xzf ../$(TPM_EMULATOR_TARFILE);
-
-updatepatches: clean orig
-	find $(VTPM_DIR) -name "*.orig" -print | xargs rm -f; 
-	mv vtpm.patch vtpm.patch.old; 
-	diff -uprN $(TPM_EMULATOR_DIR) $(VTPM_DIR) > vtpm.patch || true;
-
-.PHONY: build_sub
-build_sub: $(VTPM_DIR)/tpmd/tpmd
-	set -e; if [ -e $(GMP_HEADER) ]; then \
-		$(MAKE) -C $(VTPM_DIR) version; \
-		$(MAKE) -C $(VTPM_DIR) all-recursive; \
-	else \
-		echo "=== Unable to build VTPMs. libgmp could not be found."; \
-	fi
-
diff --git a/tools/vtpm/README b/tools/vtpm/README
deleted file mode 100644
index 2008cbd..0000000
--- a/tools/vtpm/README
+++ /dev/null
@@ -1,45 +0,0 @@
-
-Directory Structure
-===================
-tools/vtpm/tpm_emulator-0.2b.tar.gz    -> TPM Emulator downloaded at build time that will
-                                          be patched and used for our vtpms
-tools/vtpm/vtpm.patch                  -> patch applied to tpm_emulator to make vtpm
-tools/vtpm/vtpm/                       -> (created on build) tpm_emulator moved to ring 3,
-                                          listens on a pair of fifos for TPM commands,
-                                          persistent state is sent via named fifo to vtpm
-                                            manager, which encrypts it and protects it.
-tools/vtpm/tpm_emulator.patch          -> To allow for debugging and testing on non-TPM
-                                          platforms, this patches the emulator to allow
-                                          it to be inserted into the dom0 kernel
-tools/vtpm/tpm_emulator-0.2            -> (created on build) directory containing patched emulator
-
-Compile Flags
-===================
-VTPM_MULTI_VM                -> Defined (not finished): VTPMs run in their own VMs
-                                Not Defined (default): VTPMs are processes
-
-Requirements
-============
-- xen-unstable 
-- IBM frontend/backend vtpm driver patch
-- vtpm_managerd
-- GNU MP Big number library (GMP)
-
-vtpmd Flow (for vtpm_manager. vtpmd never run by default)
-============================
-- Launch the VTPM manager (vtpm_managerd) which which begins listening to the BE with one thread
-  and listens to a named fifo that is shared by the vtpms to commuincate with the manager.
-- VTPM Manager listens to TPM BE.
-- When xend launches a tpm frontend equipped VM it contacts the manager over the vtpm backend. 
-- When the manager receives the open message from the BE, it launches a vtpm
-- Xend allows the VM to continue booting. 
-- When a TPM request is issued to the front end, the front end transmits the TPM request to the backend.
-- The manager receives the TPM requests and uses a named fifo to forward the request to the vtpm.
-- The fifo listener begins listening for the reply from vtpm for the request.
-- Vtpm processes request and replies to manager over shared named fifo.
-- If needed, the vtpm may send a request to the vtpm_manager at any time to save it's secrets to disk.
-- Manager receives response from vtpm and passes it back to backend for forwarding to guest.
-
-tpm_emulator flow
-==================
-Read documentation in tpm_emulator-0.2 directory
diff --git a/tools/vtpm/Rules.mk b/tools/vtpm/Rules.mk
deleted file mode 100644
index 548cff0..0000000
--- a/tools/vtpm/Rules.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-# Base definitions and rules (XEN_ROOT must be defined in including Makefile)
-include $(XEN_ROOT)/tools/Rules.mk
-
-#
-# Tool definitions
-#
-
-# General compiler flags
-CFLAGS   = -Werror -g3
-
-# Generic project files
-HDRS	= $(wildcard *.h)
-SRCS	= $(wildcard *.c)
-OBJS	= $(patsubst %.c,%.o,$(SRCS))
-
-# Generic (non-header) dependencies
-$(SRCS): Makefile $(XEN_ROOT)/tools/Rules.mk $(XEN_ROOT)/tools/vtpm/Rules.mk
-
-$(OBJS): $(SRCS)
-
--include $(DEPS)
-
-BUILD_EMULATOR = y
-
-# Make sure these are just rules
-.PHONY : all build install clean
diff --git a/tools/vtpm/tpm_emulator.patch b/tools/vtpm/tpm_emulator.patch
deleted file mode 100644
index c34c665..0000000
--- a/tools/vtpm/tpm_emulator.patch
+++ /dev/null
@@ -1,1919 +0,0 @@
-diff -uprN orig/tpm_emulator-0.4/AUTHORS tpm_emulator/AUTHORS
---- orig/tpm_emulator-0.4/AUTHORS	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/AUTHORS	2006-07-24 14:35:35.000000000 -0700
-@@ -1,2 +1,3 @@
- Mario Strasser <mast@gmx.net>
- Heiko Stamer <stamer@gaos.org> [DAA]
-+INTEL Corp <> [Dropped to Ring3]
-diff -uprN orig/tpm_emulator-0.4/ChangeLog tpm_emulator/ChangeLog
---- orig/tpm_emulator-0.4/ChangeLog	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/ChangeLog	2006-07-24 14:35:35.000000000 -0700
-@@ -1,3 +1,6 @@
-+????-??-?? Intel Corp
-+	* Moved module out of kernel to run as a ring 3 app
-+
- 2006-06-23  Mario Strasser <mast@gmx.net>
- 	* tpm_startup.c: behaviour of ST_CLEAR and storage of
- 		persistent data adapted
-diff -uprN orig/tpm_emulator-0.4/crypto/gmp_kernel_wrapper.c tpm_emulator/crypto/gmp_kernel_wrapper.c
---- orig/tpm_emulator-0.4/crypto/gmp_kernel_wrapper.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/crypto/gmp_kernel_wrapper.c	2006-07-24 14:35:35.000000000 -0700
-@@ -1,5 +1,6 @@
- /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
-  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-+ * Copyright (C) 2005 INTEL Corp
-  *
-  * This module is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published
-@@ -24,15 +25,10 @@ int __gmp_junk;
- void __attribute__ ((regparm(0))) __gmp_assert_fail(const char *filename, 
-   int linenum, const char *expr) 
- {
--  panic(KERN_CRIT TPM_MODULE_NAME "%s:%d: GNU MP assertion failed: %s\n", 
-+  error("%s:%d: GNU MP assertion failed: %s\n", 
-     filename, linenum, expr);
- }
- 
--void __attribute__ ((regparm(0))) abort(void)
--{
--  panic(KERN_CRIT TPM_MODULE_NAME "GNU MP abort() was called\n");
--}
--
- /* overwrite GNU MP random functions (used by mpz/millerrabin.c) */ 
- 
- void __attribute__ ((regparm(0))) gmp_randinit(gmp_randstate_t rstate, 
-@@ -77,20 +73,19 @@ void __attribute__ ((regparm(0))) mpz_ur
- 
- void __attribute__ ((regparm(0))) *kernel_allocate(size_t size)
- {
--  void *ret  = (void*)kmalloc(size, GFP_KERNEL);
--  if (!ret) panic(KERN_CRIT TPM_MODULE_NAME 
--    "GMP: cannot allocate memory (size=%u)\n", size);
-+  void *ret  = (void*)malloc(size);
-+  if (!ret) error("GMP: cannot allocate memory (size=%Zu)\n", size);
-   return ret;
- }
- 
- void __attribute__ ((regparm(0))) *kernel_reallocate(void *oldptr, 
-   size_t old_size, size_t new_size)
- {
--  void *ret = (void*)kmalloc(new_size, GFP_KERNEL);
--  if (!ret) panic(KERN_CRIT TPM_MODULE_NAME "GMP: Cannot reallocate memory "
--    "(old_size=%u new_size=%u)\n", old_size, new_size);
-+  void *ret = (void*)malloc(new_size);
-+  if (!ret) error("GMP: Cannot reallocate memory "
-+    "(old_size=%Zu new_size=%Zu)\n", old_size, new_size);
-   memcpy(ret, oldptr, old_size);
--  kfree(oldptr);
-+  free(oldptr);
-   return ret;
- }
- 
-@@ -99,7 +94,7 @@ void __attribute__ ((regparm(0))) kernel
-   /* overwrite used memory */
-   if (blk_ptr != NULL) { 
-     memset(blk_ptr, 0, blk_size);
--    kfree(blk_ptr);
-+    free(blk_ptr);
-   }
- }
- 
-diff -uprN orig/tpm_emulator-0.4/crypto/rsa.c tpm_emulator/crypto/rsa.c
---- orig/tpm_emulator-0.4/crypto/rsa.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/crypto/rsa.c	2006-07-24 14:35:35.000000000 -0700
-@@ -1,5 +1,6 @@
- /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
-  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-+ * Copyright (C) 2005 INTEL Corp
-  *
-  * This module is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published
-@@ -381,7 +382,7 @@ static int encode_message(int type, uint
-       msg[0] = 0x00;
-       get_random_bytes(&msg[1], SHA1_DIGEST_LENGTH);
-       sha1_init(&ctx);
--      sha1_update(&ctx, "TCPA", 4);
-+      sha1_update(&ctx, (uint8_t *) "TCPA", 4);
-       sha1_final(&ctx, &msg[1 + SHA1_DIGEST_LENGTH]);
-       memset(&msg[1 + 2 * SHA1_DIGEST_LENGTH], 0x00, 
-         msg_len - data_len - 2 * SHA1_DIGEST_LENGTH - 2);
-@@ -429,7 +430,7 @@ static int decode_message(int type, uint
-       mask_generation(&msg[1], SHA1_DIGEST_LENGTH,
-         &msg[1 + SHA1_DIGEST_LENGTH], msg_len - SHA1_DIGEST_LENGTH - 1);
-       sha1_init(&ctx);
--      sha1_update(&ctx, "TCPA", 4);
-+      sha1_update(&ctx, (uint8_t *) "TCPA", 4);
-       sha1_final(&ctx, &msg[1]);
-       if (memcmp(&msg[1], &msg[1 + SHA1_DIGEST_LENGTH], 
-           SHA1_DIGEST_LENGTH) != 0) return -1;
-diff -uprN orig/tpm_emulator-0.4/linux_module.c tpm_emulator/linux_module.c
---- orig/tpm_emulator-0.4/linux_module.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/linux_module.c	1969-12-31 16:00:00.000000000 -0800
-@@ -1,195 +0,0 @@
--/* Software-Based Trusted Platform Module (TPM) Emulator for Linux 
-- * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-- *
-- * This module is free software; you can redistribute it and/or modify 
-- * it under the terms of the GNU General Public License as published 
-- * by the Free Software Foundation; either version 2 of the License, 
-- * or (at your option) any later version.  
-- *
-- * This module 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.
-- *
-- * $Id: linux_module.c 91 2006-03-13 13:51:41Z mast $
-- */
--
--#include <linux/module.h>
--#include <linux/kernel.h>
--#include <linux/init.h>
--#include <linux/miscdevice.h>
--#include <linux/poll.h>
--#include "linux_module.h"
--#include "tpm/tpm_emulator.h"
--
--MODULE_LICENSE("GPL");
--MODULE_AUTHOR("Mario Strasser <mast@gmx.net>");
--MODULE_DESCRIPTION("Trusted Platform Module (TPM) Emulator");
--MODULE_SUPPORTED_DEVICE(TPM_DEVICE_NAME);
--
--/* module startup parameters */
--char *startup = "save";
--module_param(startup, charp, 0444);
--MODULE_PARM_DESC(startup, " Sets the startup mode of the TPM. "
--  "Possible values are 'clear', 'save' (default) and 'deactivated.");
--char *storage_file = "/var/tpm/tpm_emulator-1.2.0.2";
--module_param(storage_file, charp, 0644);
--MODULE_PARM_DESC(storage_file, " Sets the persistent-data storage " 
--  "file of the TPM.");
--
--/* TPM lock */
--static struct semaphore tpm_mutex;
--
--/* TPM command response */
--static struct {
--  uint8_t *data;
--  uint32_t size;
--} tpm_response;
--
--/* module state */
--#define STATE_IS_OPEN 0
--static uint32_t module_state;
--static struct timespec old_time;
--
--static int tpm_open(struct inode *inode, struct file *file)
--{
--  debug("%s()", __FUNCTION__);
--  if (test_and_set_bit(STATE_IS_OPEN, (void*)&module_state)) return -EBUSY;
--  return 0;
--}
--
--static int tpm_release(struct inode *inode, struct file *file)
--{
--  debug("%s()", __FUNCTION__);
--  clear_bit(STATE_IS_OPEN, (void*)&module_state);
--  down(&tpm_mutex);
--  if (tpm_response.data != NULL) {
--    kfree(tpm_response.data);
--    tpm_response.data = NULL;
--  }
--  up(&tpm_mutex);
--  return 0;
--}
--
--static ssize_t tpm_read(struct file *file, char *buf, size_t count, loff_t *ppos)
--{
--  debug("%s(%d)", __FUNCTION__, count);
--  down(&tpm_mutex);
--  if (tpm_response.data != NULL) {
--    count = min(count, (size_t)tpm_response.size - (size_t)*ppos);
--    count -= copy_to_user(buf, &tpm_response.data[*ppos], count);
--    *ppos += count;
--    if ((size_t)tpm_response.size == (size_t)*ppos) {
--      kfree(tpm_response.data);
--      tpm_response.data = NULL;
--    }
--  } else {
--    count = 0;
--  }
--  up(&tpm_mutex);
--  return count;
--}
--
--static ssize_t tpm_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
--{
--  debug("%s(%d)", __FUNCTION__, count);
--  down(&tpm_mutex);
--  *ppos = 0;
--  if (tpm_response.data != NULL) kfree(tpm_response.data);
--  if (tpm_handle_command(buf, count, &tpm_response.data, 
--                         &tpm_response.size) != 0) { 
--    count = -EILSEQ;
--    tpm_response.data = NULL;
--  }
--  up(&tpm_mutex);
--  return count;
--}
--
--#define TPMIOC_CANCEL   _IO('T', 0x00)
--#define TPMIOC_TRANSMIT _IO('T', 0x01)
--
--static int tpm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
--{
--  debug("%s(%d, %p)", __FUNCTION__, cmd, (char*)arg);
--  if (cmd == TPMIOC_TRANSMIT) {
--    uint32_t count = ntohl(*(uint32_t*)(arg + 2));
--    down(&tpm_mutex);
--    if (tpm_response.data != NULL) kfree(tpm_response.data);
--    if (tpm_handle_command((char*)arg, count, &tpm_response.data,
--                           &tpm_response.size) == 0) {
--      tpm_response.size -= copy_to_user((char*)arg, tpm_response.data,
--                            tpm_response.size);
--      kfree(tpm_response.data);
--      tpm_response.data = NULL;
--    } else {
--      tpm_response.size = 0;
--      tpm_response.data = NULL;
--    }
--    up(&tpm_mutex);
--    return tpm_response.size;
--  }
--  return -1;
--}
--
--struct file_operations fops = {
--  .owner   = THIS_MODULE,
--  .open    = tpm_open,
--  .release = tpm_release,
--  .read    = tpm_read,
--  .write   = tpm_write,
--  .ioctl   = tpm_ioctl,
--};
--
--static struct miscdevice tpm_dev = {
--  .minor      = TPM_DEVICE_MINOR, 
--  .name       = TPM_DEVICE_NAME, 
--  .fops       = &fops,
--};
--
--int __init init_tpm_module(void)
--{
--  int res = misc_register(&tpm_dev);
--  if (res != 0) {
--    error("misc_register() failed for minor %d\n", TPM_DEVICE_MINOR);
--    return res;
--  }
--  /* initialize variables */
--  sema_init(&tpm_mutex, 1);
--  module_state = 0;
--  tpm_response.data = NULL;
--  old_time = current_kernel_time();
--  /* initialize TPM emulator */
--  if (!strcmp(startup, "clear")) {
--    tpm_emulator_init(1);
--  } else if (!strcmp(startup, "save")) {
--    tpm_emulator_init(2);
--  } else if (!strcmp(startup, "deactivated")) {
--    tpm_emulator_init(3);
--  } else {
--    error("invalid startup mode '%s'; must be 'clear', "
--      "'save' (default) or 'deactivated", startup);
--    misc_deregister(&tpm_dev);
--    return -EINVAL;
--  }
--  return 0;
--}
--
--void __exit cleanup_tpm_module(void)
--{
--  tpm_emulator_shutdown();
--  misc_deregister(&tpm_dev);
--  if (tpm_response.data != NULL) kfree(tpm_response.data);
--}
--
--module_init(init_tpm_module);
--module_exit(cleanup_tpm_module);
--
--uint64_t tpm_get_ticks(void)
--{
--  struct timespec new_time = current_kernel_time();
--  uint64_t ticks = (uint64_t)(new_time.tv_sec - old_time.tv_sec) * 1000000
--                   + (new_time.tv_nsec - old_time.tv_nsec) / 1000;
--  old_time = new_time;
--  return (ticks > 0) ? ticks : 1;
--}
--
-diff -uprN orig/tpm_emulator-0.4/linux_module.h tpm_emulator/linux_module.h
---- orig/tpm_emulator-0.4/linux_module.h	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/linux_module.h	2006-07-24 14:35:35.000000000 -0700
-@@ -1,5 +1,6 @@
- /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
-  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-+ * Copyright (C) 2005 INTEL Corp
-  *
-  * This module is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published
-@@ -17,54 +18,62 @@
- #ifndef _LINUX_MODULE_H_
- #define _LINUX_MODULE_H_
- 
--#include <linux/version.h>
--#include <linux/kernel.h>
--#include <linux/slab.h>
-+#include <malloc.h>
-+#include <stdint.h>
-+#include <stdio.h>
-+#include <string.h>
- #include <linux/types.h>
--#include <linux/string.h>
--#include <linux/random.h>
--#include <linux/time.h>
--#include <asm/byteorder.h>
- 
--/* module settings */
-+#include <endian.h>
-+#define __BYTEORDER_HAS_U64__
-+#ifdef LITTLE_ENDIAN
-+ #include <linux/byteorder/little_endian.h>
-+#else
-+ #include <linux/byteorder/big_endian.h>
-+#endif
- 
-+/* module settings */
-+#define min(A,B) ((A)<(B)?(A):(B))
-+#ifndef STR
- #define STR(s) __STR__(s)
- #define __STR__(s) #s
-+#endif
- #include "tpm_version.h"
- 
- #define TPM_DEVICE_MINOR  224
- #define TPM_DEVICE_NAME   "tpm"
- #define TPM_MODULE_NAME   "tpm_emulator"
- 
--/* debug and log output functions */
--
- #ifdef DEBUG
--#define debug(fmt, ...) printk(KERN_DEBUG "%s %s:%d: Debug: " fmt "\n", \
--                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define debug(fmt, ...) printf("TPMD: %s:%d: Debug: " fmt "\n", \
-+                        __FILE__, __LINE__, ## __VA_ARGS__)
- #else
- #define debug(fmt, ...) 
- #endif
--#define info(fmt, ...)  printk(KERN_INFO "%s %s:%d: Info: " fmt "\n", \
--                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
--#define error(fmt, ...) printk(KERN_ERR "%s %s:%d: Error: " fmt "\n", \
--                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
--#define alert(fmt, ...) printk(KERN_ALERT "%s %s:%d: Alert: " fmt "\n", \
--                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define info(fmt, ...)  printf("TPMD: %s:%d: Info: " fmt "\n", \
-+                        __FILE__, __LINE__, ## __VA_ARGS__)
-+#define error(fmt, ...) printf("TPMD: %s:%d: Error: " fmt "\n", \
-+                        __FILE__, __LINE__, ## __VA_ARGS__)
-+#define alert(fmt, ...) printf("TPMD: %s:%d: Alert: " fmt "\n", \
-+                        __FILE__, __LINE__, ## __VA_ARGS__)
- 
- /* memory allocation */
- 
- static inline void *tpm_malloc(size_t size) 
- {
--  return kmalloc(size, GFP_KERNEL);  
-+  return malloc(size);  
- }
- 
- static inline void tpm_free(const void *ptr)
- {
--  if (ptr != NULL) kfree(ptr);
-+  if (ptr != NULL) free( (void *) ptr);
- }
- 
- /* random numbers */
- 
-+//FIXME;
-+void get_random_bytes(void *buf, int nbytes);
-+
- static inline void tpm_get_random_bytes(void *buf, int nbytes)
- {
-   get_random_bytes(buf, nbytes);
-@@ -84,9 +93,9 @@ uint64_t tpm_get_ticks(void);
- #define CPU_TO_LE16(x) __cpu_to_le16(x)
- 
- #define BE64_TO_CPU(x) __be64_to_cpu(x)
--#define LE64_TO_CPU(x) __be64_to_cpu(x)
-+#define LE64_TO_CPU(x) __le64_to_cpu(x)
- #define BE32_TO_CPU(x) __be32_to_cpu(x)
--#define LE32_TO_CPU(x) __be32_to_cpu(x)
-+#define LE32_TO_CPU(x) __le32_to_cpu(x)
- #define BE16_TO_CPU(x) __be16_to_cpu(x)
- #define LE16_TO_CPU(x) __le16_to_cpu(x)
- 
-diff -uprN orig/tpm_emulator-0.4/Makefile tpm_emulator/Makefile
---- orig/tpm_emulator-0.4/Makefile	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/Makefile	2006-07-24 14:35:35.000000000 -0700
-@@ -1,24 +1,40 @@
- # Software-Based Trusted Platform Module (TPM) Emulator for Linux
- # Copyright (C) 2004 Mario Strasser <mast@gmx.net>
-+# Copyright (C) 2006 INTEL Corp.
- #
- # $Id: Makefile 115 2006-06-23 10:36:44Z mast $
- 
--# kernel settings
--KERNEL_RELEASE := $(shell uname -r)
--KERNEL_BUILD   := /lib/modules/$(KERNEL_RELEASE)/build
--MOD_SUBDIR     := misc
-+COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
- 
- # module settings
--MODULE_NAME    := tpm_emulator
-+BIN            := tpm_emulator
- VERSION_MAJOR  := 0
- VERSION_MINOR  := 4
- VERSION_BUILD  := $(shell date +"%s")
- 
--# enable/disable DEBUG messages
--EXTRA_CFLAGS   += -Wall -DDEBUG -g  
-+# Installation program and options
-+INSTALL         = install
-+INSTALL_PROG    = $(INSTALL) -m0755
-+INSTALL_DIR     = $(INSTALL) -d -m0755
-+
-+# Xen tools installation directory
-+TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin
-+
-+CC      := gcc
-+CFLAGS  += -g -Wall $(INCLUDE) -DDEBUG
-+CFLAGS  += -I. -Itpm
-+
-+# Is the simulator running in it's own vm?
-+#CFLAGS += -DVTPM_MULTI_VM
-+
-+ifeq ($(COMPILE_ARCH),x86_64)
-+LIBDIR = lib64
-+else
-+LIBDIR = lib
-+endif
- 
- # GNU MP configuration
--GMP_LIB        := /usr/lib/libgmp.a
-+GMP_LIB        := /usr/$(LIBDIR)/libgmp.a
- GMP_HEADER     := /usr/include/gmp.h
- 
- # sources and objects
-@@ -27,38 +43,32 @@ DIRS           := . crypto tpm 
- SRCS           := $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.c))
- OBJS           := $(patsubst %.c, %.o, $(SRCS))
- SRCS           += $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.h))
--DISTSRC        := ./README ./AUTHORS ./ChangeLog ./Makefile $(SRCS)
--DISTDIR        := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)
- 
--obj-m               := $(MODULE_NAME).o
--$(MODULE_NAME)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
-+obj-m               := $(BIN)
-+$(BIN)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
- 
- EXTRA_CFLAGS   += -I$(src) -I$(src)/crypto -I$(src)/tpm 
- 
- # do not print "Entering directory ..."
- MAKEFLAGS      += --no-print-directory
- 
--all:	$(src)/crypto/gmp.h $(src)/crypto/libgmp.a version
--	@$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules
-+all: $(BIN)
- 
--install:
--	@$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules_install
--	test -d /var/tpm || mkdir /var/tpm
--	test -c /dev/tpm || mknod /dev/tpm c 10 224
--	chmod 666 /dev/tpm
--	depmod -a
-+$(BIN):	$(src)/crypto/gmp.h $(src)/crypto/libgmp.a version $(SRCS) $(OBJS)
-+	$(CC) $(CFLAGS) $(OBJS) $(src)/crypto/libgmp.a -o $(BIN)
-+
-+%.o: %.c
-+	$(CC) $(CFLAGS) -c $< -o $@
-+
-+install: $(BIN)
-+	$(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)
-+	@if [ ! -d "/var/tpm" ]; then mkdir /var/tpm; fi
- 
- clean:
--	@$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) clean
--	rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a
-+	rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a $(OBJS)
- 
--dist:	$(DISTSRC)
--	rm -rf $(DISTDIR)
--	mkdir $(DISTDIR)
--	cp --parents $(DISTSRC) $(DISTDIR)/
--	rm -f $(DISTDIR)/crypto/gmp.h 
--	tar -chzf $(DISTDIR).tar.gz $(DISTDIR)
--	rm -rf $(DISTDIR)
-+mrproper: clean
-+	rm -f $(BIN) tpm_version.h
- 
- $(src)/crypto/libgmp.a:
- 	test -f $(src)/crypto/libgmp.a || ln -s $(GMP_LIB) $(src)/crypto/libgmp.a
-@@ -88,4 +98,3 @@ version:
- 	@echo "#endif /* _TPM_VERSION_H_ */" >> $(src)/tpm_version.h
- 
- .PHONY: all install clean dist gmp version
--
-diff -uprN orig/tpm_emulator-0.4/README tpm_emulator/README
---- orig/tpm_emulator-0.4/README	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/README	2006-07-24 14:35:35.000000000 -0700
-@@ -13,7 +13,8 @@ $Id: README 113 2006-06-18 12:38:13Z hst
- Copyright
- --------------------------------------------------------------------------
- Copyright (C) 2004 Mario Strasser <mast@gmx.net> and Swiss Federal 
--Institute of Technology (ETH) Zurich.
-+                   Institute of Technology (ETH) Zurich.
-+Copyright (C) 2005 INTEL Corp 
-               
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
-@@ -43,6 +44,12 @@ Example:
- GMP_LIB        := /usr/lib/libgmp.a
- GMP_HEADER     := /usr/include/gmp.h
- 
-+GNU MP Library on 64 bit Systems
-+--------------------------------------------------------------------------
-+Some 64-bit kernels have problems with importing the user-space gmp 
-+library (/usr/lib*/libgmp.a) into kernel space.  These kernels will require
-+that the gmp library be recompiled for kernel space with -mcmodel=kernel.
-+
- Installation
- --------------------------------------------------------------------------
- The compilation and installation process uses the build environment for 
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_capability.c tpm_emulator/tpm/tpm_capability.c
---- orig/tpm_emulator-0.4/tpm/tpm_capability.c	2006-06-23 19:37:07.000000000 +0900
-+++ tpm_emulator/tpm/tpm_capability.c	2007-12-28 22:50:19.000000000 +0900
-@@ -701,7 +701,10 @@ TPM_RESULT TPM_GetCapabilityOwner(TPM_VE
-   TPM_RESULT res;
-   
-   info("TPM_GetCapabilityOwner()");
--  
-+ 
-+  if (!tpmData.permanent.flags.owned) {
-+    return TPM_NOSRK;
-+  } 
-   /* Verify owner authorization */
-   res = tpm_verify_auth(auth1, tpmData.permanent.data.ownerAuth, TPM_KH_OWNER);
-   if (res != TPM_SUCCESS) return res;
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c tpm_emulator/tpm/tpm_cmd_handler.c
---- orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c	2006-06-23 19:37:07.000000000 +0900
-+++ tpm_emulator/tpm/tpm_cmd_handler.c	2007-09-12 20:23:00.000000000 +0900
-@@ -565,7 +565,7 @@ static TPM_RESULT execute_TPM_Seal(TPM_R
-   if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle)
-       || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth)
-       || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize)
--      || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)
-+      || (pcrInfoSize >0 && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo))
-       || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize)
-       || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize)
-       || len != 0) return TPM_BAD_PARAMETER;
-@@ -798,7 +798,7 @@ static TPM_RESULT execute_TPM_Sealx(TPM_
-   if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle)
-       || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth)
-       || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize)
--      || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)
-+      || (pcrInfoSize > 0 && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo))
-       || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize)
-       || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize)
-       || len != 0) return TPM_BAD_PARAMETER;
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_credentials.c tpm_emulator/tpm/tpm_credentials.c
---- orig/tpm_emulator-0.4/tpm/tpm_credentials.c	2006-06-23 19:37:07.000000000 +0900
-+++ tpm_emulator/tpm/tpm_credentials.c	2007-09-12 20:23:30.000000000 +0900
-@@ -47,20 +47,20 @@ int tpm_compute_pubkey_checksum(TPM_NONC
- 
- TPM_RESULT tpm_get_pubek(TPM_PUBKEY *pubEndorsementKey)
- {
--  UINT32 key_length;
-+  size_t key_length;
-   if (!tpmData.permanent.data.endorsementKey.size) return TPM_NO_ENDORSEMENT;
-   /* setup TPM_PUBKEY structure */
--  key_length = tpmData.permanent.data.endorsementKey.size;
--  pubEndorsementKey->pubKey.keyLength = key_length >> 3;
-+  pubEndorsementKey->pubKey.keyLength = tpmData.permanent.data.endorsementKey.size >> 3;
-   pubEndorsementKey->pubKey.key = tpm_malloc(pubEndorsementKey->pubKey.keyLength);
-   if (pubEndorsementKey->pubKey.key == NULL) return TPM_FAIL;
-   rsa_export_modulus(&tpmData.permanent.data.endorsementKey,
--    pubEndorsementKey->pubKey.key,
--    &pubEndorsementKey->pubKey.keyLength);
-+		     pubEndorsementKey->pubKey.key,
-+		     &key_length);
-+  pubEndorsementKey->pubKey.keyLength = key_length;
-   pubEndorsementKey->algorithmParms.algorithmID = TPM_ALG_RSA;
-   pubEndorsementKey->algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
-   pubEndorsementKey->algorithmParms.sigScheme = TPM_SS_NONE;
--  pubEndorsementKey->algorithmParms.parms.rsa.keyLength = key_length;
-+  pubEndorsementKey->algorithmParms.parms.rsa.keyLength = key_length << 3;
-   pubEndorsementKey->algorithmParms.parms.rsa.numPrimes = 2;
-   pubEndorsementKey->algorithmParms.parms.rsa.exponentSize = 0;
-   pubEndorsementKey->algorithmParms.parms.rsa.exponent = NULL;
-@@ -175,6 +175,7 @@ TPM_RESULT TPM_OwnerReadInternalPub(TPM_
- {
-   TPM_RESULT res;
-   TPM_KEY_DATA *srk = &tpmData.permanent.data.srk;
-+  size_t key_length;
-   info("TPM_OwnerReadInternalPub()");
-   /* verify authorization */
-   res = tpm_verify_auth(auth1, tpmData.permanent.data.ownerAuth, TPM_KH_OWNER);
-@@ -186,7 +187,8 @@ TPM_RESULT TPM_OwnerReadInternalPub(TPM_
-     publicPortion->pubKey.key = tpm_malloc(publicPortion->pubKey.keyLength);
-     if (publicPortion->pubKey.key == NULL) return TPM_FAIL;
-     rsa_export_modulus(&srk->key, publicPortion->pubKey.key, 
--      &publicPortion->pubKey.keyLength);
-+      &key_length);
-+    publicPortion->pubKey.keyLength = key_length;
-     publicPortion->algorithmParms.algorithmID = TPM_ALG_RSA;
-     publicPortion->algorithmParms.encScheme = srk->encScheme;
-     publicPortion->algorithmParms.sigScheme = srk->sigScheme;
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_crypto.c tpm_emulator/tpm/tpm_crypto.c
---- orig/tpm_emulator-0.4/tpm/tpm_crypto.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_crypto.c	2006-07-24 14:35:35.000000000 -0700
-@@ -182,7 +182,8 @@ TPM_RESULT TPM_CertifyKey(TPM_KEY_HANDLE
-   TPM_KEY_DATA *cert, *key;
-   sha1_ctx_t sha1_ctx;
-   BYTE *buf, *p;
--  UINT32 length;
-+  UINT32 length32;
-+  size_t length;
-   info("TPM_CertifyKey()");
-   /* get keys */
-   cert = tpm_get_key(certHandle);
-@@ -264,14 +265,15 @@ TPM_RESULT TPM_CertifyKey(TPM_KEY_HANDLE
-   /* compute the digest of the CERTIFY_INFO[2] structure and sign it */
-   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
-   p = buf = tpm_malloc(length);
-+  length32=(UINT32) length;
-   if (buf == NULL
--      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length, certifyInfo)) {
-+      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length32, certifyInfo)) {
-     free_TPM_KEY_PARMS(certifyInfo->algorithmParms);
-     return TPM_FAIL;
-   }
-   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
-   sha1_init(&sha1_ctx);
--  sha1_update(&sha1_ctx, buf, length);
-+  sha1_update(&sha1_ctx, buf, (size_t) length);
-   sha1_final(&sha1_ctx, buf);
-   res = tpm_sign(cert, auth1, FALSE, buf, SHA1_DIGEST_LENGTH, outData, outDataSize);
-   tpm_free(buf);
-@@ -292,7 +294,8 @@ TPM_RESULT TPM_CertifyKey2(TPM_KEY_HANDL
-   TPM_KEY_DATA *cert, *key;
-   sha1_ctx_t sha1_ctx;
-   BYTE *buf, *p;
--  UINT32 length;
-+  size_t length;
-+  UINT32 length32;
-   info("TPM_CertifyKey2()");
-   /* get keys */
-   cert = tpm_get_key(certHandle);
-@@ -362,8 +365,9 @@ TPM_RESULT TPM_CertifyKey2(TPM_KEY_HANDL
-   /* compute the digest of the CERTIFY_INFO[2] structure and sign it */
-   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
-   p = buf = tpm_malloc(length);
-+  length32 = (UINT32) length;
-   if (buf == NULL
--      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length, certifyInfo)) {
-+      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length32, certifyInfo)) {
-     free_TPM_KEY_PARMS(certifyInfo->algorithmParms);
-     return TPM_FAIL;
-   }
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_daa.c tpm_emulator/tpm/tpm_daa.c
---- orig/tpm_emulator-0.4/tpm/tpm_daa.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_daa.c	2006-07-24 14:35:35.000000000 -0700
-@@ -716,14 +716,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x00", 1);
-+      sha1_update(&sha1, (BYTE *) "\x00", 1);
-       sha1_final(&sha1, scratch);
-       sha1_init(&sha1);
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey, 
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x01", 1);
-+      sha1_update(&sha1, (BYTE *) "\x01", 1);
-       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
-       mpz_init(f), mpz_init(q);
-       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
-@@ -805,14 +805,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x00", 1);
-+      sha1_update(&sha1, (BYTE *) "\x00", 1);
-       sha1_final(&sha1, scratch);
-       sha1_init(&sha1);
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey, 
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x01", 1);
-+      sha1_update(&sha1, (BYTE *) "\x01", 1);
-       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
-       mpz_init(f), mpz_init(q);
-       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
-@@ -1489,14 +1489,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x00", 1);
-+      sha1_update(&sha1, (BYTE *) "\x00", 1);
-       sha1_final(&sha1, scratch);
-       sha1_init(&sha1);
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey, 
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x01", 1);
-+      sha1_update(&sha1, (BYTE *) "\x01", 1);
-       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
-       mpz_init(f), mpz_init(q);
-       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
-@@ -1712,14 +1712,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x00", 1);
-+      sha1_update(&sha1, (BYTE *) "\x00", 1);
-       sha1_final(&sha1, scratch);
-       sha1_init(&sha1);
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey, 
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x01", 1);
-+      sha1_update(&sha1, (BYTE *) "\x01", 1);
-       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
-       mpz_init(f), mpz_init(q);
-       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
-@@ -1793,14 +1793,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x00", 1);
-+      sha1_update(&sha1, (BYTE *) "\x00", 1);
-       sha1_final(&sha1, scratch);
-       sha1_init(&sha1);
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey, 
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x01", 1);
-+      sha1_update(&sha1, (BYTE *) "\x01", 1);
-       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
-       mpz_init(f), mpz_init(q);
-       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
-@@ -2918,14 +2918,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x00", 1);
-+      sha1_update(&sha1, (BYTE *) "\x00", 1);
-       sha1_final(&sha1, scratch);
-       sha1_init(&sha1);
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey, 
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x01", 1);
-+      sha1_update(&sha1, (BYTE *) "\x01", 1);
-       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
-       mpz_init(f), mpz_init(q);
-       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
-@@ -3143,7 +3143,7 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
-         sha1_init(&sha1);
-         sha1_update(&sha1, (BYTE*) &session->DAA_session.DAA_digest, 
-           sizeof(session->DAA_session.DAA_digest));
--        sha1_update(&sha1, "\x01", 1);
-+        sha1_update(&sha1, (BYTE *) "\x01", 1);
-         sha1_update(&sha1, inputData1, inputSize1);
-         sha1_final(&sha1, (BYTE*) &session->DAA_session.DAA_digest);
-       }
-@@ -3172,7 +3172,7 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
-         sha1_init(&sha1);
-         sha1_update(&sha1, (BYTE*) &session->DAA_session.DAA_digest, 
-           sizeof(session->DAA_session.DAA_digest));
--        sha1_update(&sha1, "\x00", 1);
-+        sha1_update(&sha1, (BYTE*) "\x00", 1);
-         rsa_export_modulus(&aikData->key, scratch, &size);
-         sha1_update(&sha1, scratch, size);
-         sha1_final(&sha1, (BYTE*) &session->DAA_session.DAA_digest);
-@@ -3229,14 +3229,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x00", 1);
-+      sha1_update(&sha1, (BYTE *) "\x00", 1);
-       sha1_final(&sha1, scratch);
-       sha1_init(&sha1);
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey, 
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x01", 1);
-+      sha1_update(&sha1, (BYTE *) "\x01", 1);
-       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
-       mpz_init(f), mpz_init(q);
-       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
-@@ -3309,14 +3309,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x00", 1);
-+      sha1_update(&sha1, (BYTE *) "\x00", 1);
-       sha1_final(&sha1, scratch);
-       sha1_init(&sha1);
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey, 
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x01", 1);
-+      sha1_update(&sha1, (BYTE *) "\x01", 1);
-       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
-       mpz_init(f), mpz_init(q);
-       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_data.c tpm_emulator/tpm/tpm_data.c
---- orig/tpm_emulator-0.4/tpm/tpm_data.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_data.c	2006-07-24 14:35:35.000000000 -0700
-@@ -40,6 +40,7 @@ static inline void init_pcr_attr(int pcr
- void tpm_init_data(void)
- {
-   /* endorsement key */
-+#ifndef TPM_GENERATE_EK
-   uint8_t ek_n[] =  "\xa8\xdb\xa9\x42\xa8\xf3\xb8\x06\x85\x90\x76\x93\xad\xf7"
-     "\x74\xec\x3f\xd3\x3d\x9d\xe8\x2e\xff\x15\xed\x0e\xce\x5f\x93"
-     "\x92\xeb\xd1\x96\x2b\x72\x18\x81\x79\x12\x9d\x9c\x40\xd7\x1a"
-@@ -77,6 +78,8 @@ void tpm_init_data(void)
-     "\xd1\xc0\x8b\x5b\xa2\x2e\xa7\x15\xca\x50\x75\x10\x48\x9c\x2b"
-     "\x18\xb9\x67\x8f\x5d\x64\xc3\x28\x9f\x2f\x16\x2f\x08\xda\x47"
-     "\xec\x86\x43\x0c\x80\x99\x07\x34\x0f";
-+#endif
-+
-   int i;
-   /* reset all data to NULL, FALSE or 0 */
-   memset(&tpmData, 0, sizeof(tpmData));
-@@ -152,44 +155,43 @@ void tpm_release_data(void)
- 
- #ifdef TPM_STORE_TO_FILE
- 
--#include <linux/fs.h>
--#include <linux/unistd.h>
--#include <asm/uaccess.h>
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+#include <fcntl.h>
-+#include <unistd.h>
- 
- #define TPM_STORAGE_FILE "/var/tpm/tpm_emulator-1.2." STR(VERSION_MAJOR) "." STR(VERSION_MINOR) 
- 
- static int write_to_file(uint8_t *data, size_t data_length)
- {
-   int res;
--  struct file *fp;
--  mm_segment_t old_fs = get_fs();
--  fp = filp_open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
--  if (IS_ERR(fp)) return -1;
--  set_fs(get_ds());
--  res = fp->f_op->write(fp, data, data_length, &fp->f_pos);
--  set_fs(old_fs);
--  filp_close(fp, NULL);
-+  int fp;
-+  fp = open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
-+  res = write(fp, data, data_length);
-+  close(fp);
-   return (res == data_length) ? 0 : -1;
- }
- 
- static int read_from_file(uint8_t **data, size_t *data_length)
- {
-   int res;
--  struct file *fp;
--  mm_segment_t old_fs = get_fs();
--  fp = filp_open(TPM_STORAGE_FILE, O_RDONLY, 0);
--  if (IS_ERR(fp)) return -1;
--  *data_length = (size_t)fp->f_dentry->d_inode->i_size;
--  /* *data_length = i_size_read(fp->f_dentry->d_inode); */
-+  int fp, file_status;
-+  struct stat file_info;
-+  fp = open(TPM_STORAGE_FILE, O_RDONLY, 0);
-+  file_status = fstat(fp, &file_info);
-+  if (file_status < 0) {
-+    close(fp);
-+    return -1;
-+  } 
-+
-+  *data_length = file_info.st_size; 
-   *data = tpm_malloc(*data_length);
-   if (*data == NULL) {
--    filp_close(fp, NULL);
-+    close(fp);
-     return -1;
-   }
--  set_fs(get_ds());
--  res = fp->f_op->read(fp, *data, *data_length, &fp->f_pos);
--  set_fs(old_fs);
--  filp_close(fp, NULL);
-+  res = read(fp, *data, *data_length);
-+  close(fp);
-   if (res != *data_length) {
-     tpm_free(*data);
-     return -1;
-@@ -216,23 +218,30 @@ static int read_from_file(uint8_t **data
- int tpm_store_permanent_data(void)
- {
-   uint8_t *buf, *ptr;
--  size_t buf_length, len;
-+  UINT32 buf_length, len;
- 
-   /* marshal data */
--  buf_length = len = sizeof_TPM_STCLEAR_FLAGS(tpmData.stclear.flags)
--    + sizeof_TPM_PERMANENT_FLAGS(tpmData.permanent.flags) + 2
--    + sizeof_TPM_PERMANENT_DATA(tpmData.permanent.data);
-+  buf_length = len = 4 + sizeof_TPM_STCLEAR_FLAGS(tpmData.stclear.flags)
-+    + sizeof_TPM_PERMANENT_FLAGS(tpmData.permanent.flags) 
-+    + sizeof_TPM_STANY_FLAGS(tpmData.stany.flags) + 2
-+    + sizeof_TPM_STCLEAR_DATA(tpmData.stclear.data) 
-+    + sizeof_TPM_PERMANENT_DATA(tpmData.permanent.data)
-+    + sizeof_TPM_STANY_DATA(tpmData.stany.data);
-   buf = ptr = tpm_malloc(buf_length);
-   if (buf == NULL
-       || tpm_marshal_TPM_VERSION(&ptr, &len, &tpmData.permanent.data.version)
-       || tpm_marshal_TPM_STCLEAR_FLAGS(&ptr, &len, &tpmData.stclear.flags)
-       || tpm_marshal_TPM_PERMANENT_FLAGS(&ptr, &len, &tpmData.permanent.flags)
-+      || tpm_marshal_TPM_STANY_FLAGS(&ptr, &len, &tpmData.stany.flags)
-       || tpm_marshal_BOOL(&ptr, &len, tpmData.permanent.flags.selfTestSucceeded)
-       || tpm_marshal_BOOL(&ptr, &len, tpmData.permanent.flags.owned)
--      || tpm_marshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)) {
-+      || tpm_marshal_TPM_STCLEAR_DATA(&ptr, &len, &tpmData.stclear.data)
-+      || tpm_marshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)
-+      || tpm_marshal_TPM_STANY_DATA(&ptr, &len, &tpmData.stany.data)) {
-     tpm_free(buf);
-     return -1;
-   }
-+
-   if (write_to_file(buf, buf_length - len)) {
-     tpm_free(buf);
-     return -1; 
-@@ -244,31 +253,36 @@ int tpm_store_permanent_data(void)
- int tpm_restore_permanent_data(void)
- {
-   uint8_t *buf, *ptr;
--  size_t buf_length, len;
-+  size_t buf_length;
-+  UINT32 len;
-   TPM_VERSION ver;
- 
-   /* read data */
-   if (read_from_file(&buf, &buf_length)) return -1;
-   ptr = buf;
--  len = buf_length;
-+  len = (uint32_t) buf_length;
-   /* unmarshal data */
-   if (tpm_unmarshal_TPM_VERSION(&ptr, &len, &ver)
-       || memcmp(&ver, &tpmData.permanent.data.version, sizeof(TPM_VERSION))
-       || tpm_unmarshal_TPM_STCLEAR_FLAGS(&ptr, &len, &tpmData.stclear.flags)
-       || tpm_unmarshal_TPM_PERMANENT_FLAGS(&ptr, &len, &tpmData.permanent.flags)
-+      || tpm_unmarshal_TPM_STANY_FLAGS(&ptr, &len, &tpmData.stany.flags)
-       || tpm_unmarshal_BOOL(&ptr, &len, &tpmData.permanent.flags.selfTestSucceeded)
-       || tpm_unmarshal_BOOL(&ptr, &len, &tpmData.permanent.flags.owned)
--      || tpm_unmarshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)) {
-+      || tpm_unmarshal_TPM_STCLEAR_DATA(&ptr, &len, &tpmData.stclear.data)
-+      || tpm_unmarshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)
-+      || tpm_unmarshal_TPM_STANY_DATA(&ptr, &len, &tpmData.stany.data)) {
-     tpm_free(buf);
-     return -1;
-   }
-+
-   tpm_free(buf);
-   return 0;
- }
- 
- int tpm_erase_permanent_data(void)
- {
--  int res = write_to_file("", 0);
-+  int res = write_to_file((uint8_t *) "", 0);
-   return res;
- }
- 
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_deprecated.c tpm_emulator/tpm/tpm_deprecated.c
---- orig/tpm_emulator-0.4/tpm/tpm_deprecated.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_deprecated.c	2006-07-24 14:35:35.000000000 -0700
-@@ -1,6 +1,7 @@
- /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
-  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-  *                    Swiss Federal Institute of Technology (ETH) Zurich
-+ * Copyright (C) 2005 INTEL Corp
-  *
-  * This module is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published
-@@ -50,7 +51,7 @@ TPM_RESULT TPM_SaveKeyContext(TPM_KEY_HA
-   BYTE *ptr;
-   UINT32 len;
-   info("TPM_SaveKeyContext()");
--  res = TPM_SaveContext(keyHandle, TPM_RT_KEY, "SaveKeyContext..", 
-+  res = TPM_SaveContext(keyHandle, TPM_RT_KEY, (BYTE*)"SaveKeyContext..", 
-                         keyContextSize, &contextBlob);
-   if (res != TPM_SUCCESS) return res;
-   len = *keyContextSize;
-@@ -82,7 +83,7 @@ TPM_RESULT TPM_SaveAuthContext(TPM_AUTHH
-   BYTE *ptr;
-   UINT32 len;
-   info("TPM_SaveAuthContext()");
--  res = TPM_SaveContext(authHandle, TPM_RT_KEY, "SaveAuthContext.", 
-+  res = TPM_SaveContext(authHandle, TPM_RT_KEY, (BYTE*)"SaveAuthContext.", 
-                         authContextSize, &contextBlob);
-   if (res != TPM_SUCCESS) return res;
-   len = *authContextSize;
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_emulator.h tpm_emulator/tpm/tpm_emulator.h
---- orig/tpm_emulator-0.4/tpm/tpm_emulator.h	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_emulator.h	2006-07-24 14:35:35.000000000 -0700
-@@ -1,5 +1,6 @@
- /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
-  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-+ * Copyright (C) 2005 INTEL Corp
-  *
-  * This module is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published
-@@ -22,7 +23,8 @@
- /* TPM configuration */
- #define TPM_STORE_TO_FILE       1
- #undef  TPM_STRONG_PERSISTENCE
--#undef  TPM_GENERATE_EK
-+//#undef  TPM_GENERATE_EK
-+#define  TPM_GENERATE_EK
- #undef  TPM_GENERATE_SEED_DAA
- 
- #define TPM_MANUFACTURER 0x4554485A /* 'ETHZ' */        
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_marshalling.c tpm_emulator/tpm/tpm_marshalling.c
---- orig/tpm_emulator-0.4/tpm/tpm_marshalling.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_marshalling.c	2006-07-24 14:35:35.000000000 -0700
-@@ -1312,7 +1312,7 @@ int tpm_unmarshal_TPM_STANY_FLAGS(BYTE *
- 
- int tpm_marshal_RSA(BYTE **ptr, UINT32 *length, rsa_private_key_t *v)
- {
--  UINT32 m_len, e_len, q_len;
-+  size_t m_len, e_len, q_len;
-   if (*length < sizeof_RSA((*v))) return -1;
-   if (v->size > 0) {
-     rsa_export_modulus(v, &(*ptr)[6], &m_len);
-@@ -1460,6 +1460,66 @@ int tpm_unmarshal_TPM_PERMANENT_DATA(BYT
-   return 0;
- }
- 
-+int tpm_marshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v)
-+{
-+  if (tpm_marshal_TPM_STRUCTURE_TAG(ptr, length, v->tag)
-+    || tpm_marshal_TPM_NONCE(ptr, length, &v->contextNonceKey)
-+    || tpm_marshal_TPM_COUNT_ID(ptr, length, v->countID) ) return -1;
-+
-+  return 0;
-+}
-+
-+int tpm_unmarshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v)
-+{
-+  if (tpm_unmarshal_TPM_STRUCTURE_TAG(ptr, length, &v->tag)
-+    || tpm_unmarshal_TPM_NONCE(ptr, length, &v->contextNonceKey)
-+    || tpm_unmarshal_TPM_COUNT_ID(ptr, length, &v->countID) ) return -1;
-+
-+  return 0;
-+}
-+
-+int tpm_marshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v)
-+{
-+  UINT32 i;
-+  if (tpm_marshal_TPM_STRUCTURE_TAG(ptr, length, v->tag)
-+    || tpm_marshal_TPM_NONCE(ptr, length, &v->contextNonceSession)
-+    || tpm_marshal_TPM_DIGEST(ptr, length, &v->auditDigest)
-+    || tpm_marshal_BOOL(ptr, length, v->auditSession)
-+    || tpm_marshal_TPM_CURRENT_TICKS(ptr, length, &v->currentTicks)
-+    || tpm_marshal_UINT32(ptr, length, v->contextCount)
-+    || tpm_marshal_UINT32_ARRAY(ptr, length, v->contextList, TPM_MAX_SESSION_LIST)) return -1;
-+  for (i = 0; i < TPM_MAX_SESSIONS; i++) {
-+    if (tpm_marshal_TPM_SESSION_DATA(ptr, length, &v->sessions[i])) return -1;
-+  }
-+  for (i = 0; i < TPM_MAX_SESSIONS_DAA; i++) {
-+    if (tpm_marshal_TPM_DAA_SESSION_DATA(ptr, length, &v->sessionsDAA[i])) return -1;
-+  }
-+  if (tpm_marshal_TPM_TRANSHANDLE(ptr, length, v->transExclusive)) return -1;
-+
-+  return 0;
-+}
-+
-+int tpm_unmarshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v)
-+{
-+  UINT32 i;
-+  if (tpm_unmarshal_TPM_STRUCTURE_TAG(ptr, length, &v->tag)
-+    || tpm_unmarshal_TPM_NONCE(ptr, length, &v->contextNonceSession)
-+    || tpm_unmarshal_TPM_DIGEST(ptr, length, &v->auditDigest)
-+    || tpm_unmarshal_BOOL(ptr, length, &v->auditSession)
-+    || tpm_unmarshal_TPM_CURRENT_TICKS(ptr, length, &v->currentTicks)
-+    || tpm_unmarshal_UINT32(ptr, length, &v->contextCount)
-+    || tpm_unmarshal_UINT32_ARRAY(ptr, length, v->contextList, TPM_MAX_SESSION_LIST)) return -1;
-+  for (i = 0; i < TPM_MAX_SESSIONS; i++) {
-+    if (tpm_unmarshal_TPM_SESSION_DATA(ptr, length, &v->sessions[i])) return -1;
-+  }
-+  for (i = 0; i < TPM_MAX_SESSIONS_DAA; i++) {
-+    if (tpm_unmarshal_TPM_DAA_SESSION_DATA(ptr, length, &v->sessionsDAA[i])) return -1;
-+  }
-+  if (tpm_unmarshal_TPM_TRANSHANDLE(ptr, length, &v->transExclusive)) return -1;
-+
-+  return 0;
-+}
-+
- int tpm_marshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v)
- {
-   if (tpm_marshal_BYTE(ptr, length, v->type)
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_marshalling.h tpm_emulator/tpm/tpm_marshalling.h
---- orig/tpm_emulator-0.4/tpm/tpm_marshalling.h	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_marshalling.h	2006-07-24 14:35:35.000000000 -0700
-@@ -432,6 +432,12 @@ int tpm_unmarshal_TPM_KEY_DATA(BYTE **pt
- int tpm_marshal_TPM_PERMANENT_DATA(BYTE **ptr, UINT32 *length, TPM_PERMANENT_DATA *);
- int tpm_unmarshal_TPM_PERMANENT_DATA(BYTE **ptr, UINT32 *length, TPM_PERMANENT_DATA *);
- 
-+int tpm_marshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v);
-+int tpm_unmarshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v);
-+
-+int tpm_marshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v);
-+int tpm_unmarshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v);
-+
- int tpm_marshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v);
- int tpm_unmarshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v);
- 
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_owner.c tpm_emulator/tpm/tpm_owner.c
---- orig/tpm_emulator-0.4/tpm/tpm_owner.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_owner.c	2006-07-24 14:35:35.000000000 -0700
-@@ -108,7 +108,7 @@ TPM_RESULT TPM_TakeOwnership(TPM_PROTOCO
-   TPM_RESULT res;
-   rsa_private_key_t *ek = &tpmData.permanent.data.endorsementKey;
-   TPM_KEY_DATA *srk = &tpmData.permanent.data.srk;
--  UINT32 buf_size = ek->size >> 3;
-+  size_t buf_size = ek->size >> 3, key_length; 
-   BYTE buf[buf_size];
- 
-   info("TPM_TakeOwnership()");
-@@ -173,7 +173,8 @@ TPM_RESULT TPM_TakeOwnership(TPM_PROTOCO
-     return TPM_FAIL;
-   }
-   rsa_export_modulus(&srk->key, srkPub->pubKey.key,
--    &srkPub->pubKey.keyLength);
-+		     &key_length);
-+  srkPub->pubKey.keyLength = (UINT32) key_length;
-   /* setup tpmProof and set state to owned */
-   tpm_get_random_bytes(tpmData.permanent.data.tpmProof.nonce, 
-     sizeof(tpmData.permanent.data.tpmProof.nonce));
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_startup.c tpm_emulator/tpm/tpm_startup.c
---- orig/tpm_emulator-0.4/tpm/tpm_startup.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_startup.c	2006-07-24 14:35:35.000000000 -0700
-@@ -41,26 +41,29 @@ void TPM_Init(TPM_STARTUP_TYPE startupTy
- TPM_RESULT TPM_Startup(TPM_STARTUP_TYPE startupType)
- {
-   int i;
-+  int restore_fail;
-   info("TPM_Startup(%d)", startupType);
-   if (tpmData.stany.flags.postInitialise == FALSE) return TPM_INVALID_POSTINIT;
--  /* reset STANY_FLAGS */
--  SET_TO_ZERO(&tpmData.stany.flags);
--  tpmData.stany.flags.tag = TPM_TAG_STANY_FLAGS;
--  /* reset STANY_DATA (invalidates ALL sessions) */
--  SET_TO_ZERO(&tpmData.stany.data);
--  tpmData.stany.data.tag = TPM_TAG_STANY_DATA;
--  /* init session-context nonce */
--  SET_TO_RAND(&tpmData.stany.data.contextNonceSession);
-+
-+  /* try and restore state to get EK, SRK, etc */
-+  restore_fail = tpm_restore_permanent_data();
-+
-   /* set data and flags according to the given startup type */
-   if (startupType == TPM_ST_CLEAR) {
--    /* if available, restore permanent data */
--    tpm_restore_permanent_data();
-+    /* reset STANY_FLAGS */
-+    SET_TO_ZERO(&tpmData.stany.flags);
-+    tpmData.stany.flags.tag = TPM_TAG_STANY_FLAGS;
-+    /* reset STANY_DATA (invalidates ALL sessions) */
-+    SET_TO_ZERO(&tpmData.stany.data);
-+    tpmData.stany.data.tag = TPM_TAG_STANY_DATA;
-+    /* init session-context nonce */
-+    SET_TO_RAND(&tpmData.stany.data.contextNonceSession);
-     /* reset PCR values */
-     for (i = 0; i < TPM_NUM_PCR; i++) {
--      if (tpmData.permanent.data.pcrAttrib[i].pcrReset)
--        SET_TO_ZERO(tpmData.permanent.data.pcrValue[i].digest);
-+      if (!tpmData.permanent.data.pcrAttrib[i].pcrReset)
-+        SET_TO_ZERO(&tpmData.permanent.data.pcrValue[i].digest);
-       else
--        SET_TO_0xFF(tpmData.permanent.data.pcrValue[i].digest);
-+        SET_TO_0xFF(&tpmData.permanent.data.pcrValue[i].digest);
-     }
-     /* reset STCLEAR_FLAGS */
-     SET_TO_ZERO(&tpmData.stclear.flags);
-@@ -79,7 +82,8 @@ TPM_RESULT TPM_Startup(TPM_STARTUP_TYPE 
-     /* init key-context nonce */
-     SET_TO_RAND(&tpmData.stclear.data.contextNonceKey);
-   } else if (startupType == TPM_ST_STATE) {
--    if (tpm_restore_permanent_data()) {
-+    /* restore must have been successful for TPM_ST_STATE */
-+    if (restore_fail) {
-       error("restoring permanent data failed");
-       tpmData.permanent.data.testResult = "tpm_restore_permanent_data() failed";
-       tpmData.permanent.flags.selfTestSucceeded = FALSE;
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_storage.c tpm_emulator/tpm/tpm_storage.c
---- orig/tpm_emulator-0.4/tpm/tpm_storage.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_storage.c	2006-07-24 14:35:35.000000000 -0700
-@@ -58,6 +58,7 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
-                         BYTE *enc, UINT32 *enc_size)
- {
-   UINT32 len;
-+  size_t enc_size32 = *enc_size;
-   BYTE *buf, *ptr;
-   rsa_public_key_t pub_key;
-   int scheme;
-@@ -72,7 +73,7 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
-   if (buf == NULL
-       || tpm_marshal_TPM_SEALED_DATA(&ptr, &len, seal)
-       || rsa_encrypt(&pub_key, scheme, buf, sizeof_TPM_SEALED_DATA((*seal)),
--                     enc, enc_size)) {
-+                     enc, &enc_size32)) {
-     tpm_free(buf);
-     rsa_release_public_key(&pub_key);
-     return -1;
-@@ -85,7 +86,8 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
- int decrypt_sealed_data(TPM_KEY_DATA *key, BYTE *enc, UINT32 enc_size,
-                         TPM_SEALED_DATA *seal, BYTE **buf) 
- {
--  UINT32 len;
-+  size_t len;
-+  UINT32 len32;
-   BYTE *ptr;
-   int scheme;
-   switch (key->encScheme) {
-@@ -96,8 +98,12 @@ int decrypt_sealed_data(TPM_KEY_DATA *ke
-   len = enc_size;
-   *buf = ptr = tpm_malloc(len);
-   if (*buf == NULL
--      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len)
--      || tpm_unmarshal_TPM_SEALED_DATA(&ptr, &len, seal)) {
-+      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len) ){
-+    tpm_free(*buf);
-+    return -1;
-+  }
-+  len32 = len;
-+  if (tpm_unmarshal_TPM_SEALED_DATA(&ptr, &len32, seal)) {
-     tpm_free(*buf);
-     return -1;
-   }
-@@ -240,11 +246,12 @@ TPM_RESULT TPM_Unseal(TPM_KEY_HANDLE par
- 
- TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE keyHandle, UINT32 inDataSize,
-                       BYTE *inData, TPM_AUTH *auth1, 
--                      UINT32 *outDataSize, BYTE **outData)
-+                      UINT32 *outDataSize32, BYTE **outData)
- {
-   TPM_RESULT res;
-   TPM_KEY_DATA *key;
-   int scheme;
-+  size_t outDataSize;
-   
-   info("TPM_UnBind()");
-   /* get key */
-@@ -262,8 +269,8 @@ TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE key
-   /* the size of the input data muss be greater than zero */
-   if (inDataSize == 0) return TPM_BAD_PARAMETER;
-   /* decrypt data */
--  *outDataSize = inDataSize;
--  *outData = tpm_malloc(*outDataSize);
-+  outDataSize = inDataSize;
-+  *outData = tpm_malloc(outDataSize);
-   if (*outData == NULL) return TPM_NOSPACE;
-   switch (key->encScheme) {
-     case TPM_ES_RSAESOAEP_SHA1_MGF1: scheme = RSA_ES_OAEP_SHA1; break;
-@@ -271,20 +278,21 @@ TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE key
-     default: tpm_free(*outData); return TPM_DECRYPT_ERROR;
-   }
-   if (rsa_decrypt(&key->key, scheme, inData, inDataSize, 
--      *outData, outDataSize)) {
-+      *outData, &outDataSize)) {
-     tpm_free(*outData);
-     return TPM_DECRYPT_ERROR;
-   }
-   /* verify data if it is of type TPM_BOUND_DATA */
-   if (key->encScheme == TPM_ES_RSAESOAEP_SHA1_MGF1 
-       || key->keyUsage != TPM_KEY_LEGACY) {
--    if (*outDataSize < 5 || memcmp(*outData, "\x01\x01\00\x00\x02", 5) != 0) {
-+    if (outDataSize < 5 || memcmp(*outData, "\x01\x01\00\x00\x02", 5) != 0) {
-       tpm_free(*outData);
-       return TPM_DECRYPT_ERROR;
-     }
--    *outDataSize -= 5;
--    memmove(*outData, &(*outData)[5], *outDataSize);
-+    outDataSize -= 5;
-+    memmove(*outData, &(*outData)[5], outDataSize);
-   }
-+  *outDataSize32 = (UINT32) outDataSize;
-   return TPM_SUCCESS;
- }
- 
-@@ -334,12 +342,13 @@ int compute_pubkey_digest(TPM_PUBKEY *ke
- }
- 
- int encrypt_private_key(TPM_KEY_DATA *key, TPM_STORE_ASYMKEY *store,
--                        BYTE *enc, UINT32 *enc_size)
-+                        BYTE *enc, UINT32 *enc_size32)
- {
-   UINT32 len;
-   BYTE *buf, *ptr;
-   rsa_public_key_t pub_key;
-   int scheme;
-+  size_t enc_size;
-   switch (key->encScheme) {
-     case TPM_ES_RSAESOAEP_SHA1_MGF1: scheme = RSA_ES_OAEP_SHA1; break;
-     case TPM_ES_RSAESPKCSv15: scheme = RSA_ES_PKCSV15; break;
-@@ -351,11 +360,12 @@ int encrypt_private_key(TPM_KEY_DATA *ke
-   if (buf == NULL
-       || tpm_marshal_TPM_STORE_ASYMKEY(&ptr, &len, store)
-       || rsa_encrypt(&pub_key, scheme, buf, sizeof_TPM_STORE_ASYMKEY((*store)),
--                     enc, enc_size)) {
-+                     enc, &enc_size)) {
-     tpm_free(buf);
-     rsa_release_public_key(&pub_key);
-     return -1;
-   }
-+  *enc_size32 = (UINT32) enc_size;
-   tpm_free(buf);
-   rsa_release_public_key(&pub_key);
-   return 0;
-@@ -364,7 +374,8 @@ int encrypt_private_key(TPM_KEY_DATA *ke
- int decrypt_private_key(TPM_KEY_DATA *key, BYTE *enc, UINT32 enc_size, 
-                         TPM_STORE_ASYMKEY *store, BYTE **buf) 
- {
--  UINT32 len;
-+  UINT32 len32;
-+  size_t len;
-   BYTE *ptr;
-   int scheme;
-   switch (key->encScheme) {
-@@ -375,8 +386,12 @@ int decrypt_private_key(TPM_KEY_DATA *ke
-   len = enc_size;
-   *buf = ptr = tpm_malloc(len);
-   if (*buf == NULL
--      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len)
--      || tpm_unmarshal_TPM_STORE_ASYMKEY(&ptr, &len, store)) {
-+      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len) ) {
-+    tpm_free(*buf);
-+    return -1;
-+  }
-+  len32 = (UINT32) len;
-+  if (tpm_unmarshal_TPM_STORE_ASYMKEY(&ptr, &len32, store)) {  
-     tpm_free(*buf);
-     return -1;
-   }
-@@ -394,7 +409,7 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
-   TPM_SESSION_DATA *session;
-   TPM_STORE_ASYMKEY store;
-   rsa_private_key_t rsa;
--  UINT32 key_length;
-+  size_t key_length;
- 
-   info("TPM_CreateWrapKey()");
-   /* get parent key */
-@@ -450,11 +465,11 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
-     }
-   }
-   /* generate key and store it */
--  key_length = keyInfo->algorithmParms.parms.rsa.keyLength;
--  if (rsa_generate_key(&rsa, key_length)) return TPM_FAIL;
--  wrappedKey->pubKey.keyLength = key_length >> 3;
-+  if (rsa_generate_key(&rsa, keyInfo->algorithmParms.parms.rsa.keyLength)) 
-+    return TPM_FAIL;
-+  wrappedKey->pubKey.keyLength = keyInfo->algorithmParms.parms.rsa.keyLength >> 3;
-   wrappedKey->pubKey.key = tpm_malloc(wrappedKey->pubKey.keyLength);
--  store.privKey.keyLength = key_length >> 4;
-+  store.privKey.keyLength = keyInfo->algorithmParms.parms.rsa.keyLength >> 4;
-   store.privKey.key = tpm_malloc(store.privKey.keyLength);
-   wrappedKey->encDataSize = parent->key.size >> 3;
-   wrappedKey->encData = tpm_malloc(wrappedKey->encDataSize);
-@@ -466,9 +481,11 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
-     tpm_free(wrappedKey->encData);
-     return TPM_NOSPACE;
-   }
--  rsa_export_modulus(&rsa, wrappedKey->pubKey.key, 
--    &wrappedKey->pubKey.keyLength);
--  rsa_export_prime1(&rsa, store.privKey.key, &store.privKey.keyLength);
-+  rsa_export_modulus(&rsa, wrappedKey->pubKey.key,
-+		     &key_length);
-+  wrappedKey->pubKey.keyLength = (UINT32) key_length;
-+  rsa_export_prime1(&rsa, store.privKey.key, &key_length);
-+  store.privKey.keyLength = (UINT32) key_length;
-   rsa_release_private_key(&rsa);
-   /* compute the digest of the wrapped key (without encData) */
-   if (compute_key_digest(wrappedKey, &store.pubDataDigest)) {
-@@ -602,6 +619,7 @@ TPM_RESULT TPM_LoadKey2(TPM_KEY_HANDLE p
- 
- int tpm_setup_key_parms(TPM_KEY_DATA *key, TPM_KEY_PARMS *parms)
- {
-+  size_t key_length;
-   parms->algorithmID = TPM_ALG_RSA;
-   parms->encScheme = key->encScheme;
-   parms->sigScheme = key->sigScheme;
-@@ -611,7 +629,8 @@ int tpm_setup_key_parms(TPM_KEY_DATA *ke
-   parms->parms.rsa.exponent = tpm_malloc(parms->parms.rsa.exponentSize);
-   if (parms->parms.rsa.exponent == NULL) return -1;
-   rsa_export_exponent(&key->key, parms->parms.rsa.exponent,
--    &parms->parms.rsa.exponentSize);
-+    &key_length);
-+  parms->parms.rsa.exponentSize = (UINT32) key_length;
-   parms->parmSize = 12 + parms->parms.rsa.exponentSize;
-   return 0;
- }
-@@ -622,6 +641,7 @@ TPM_RESULT TPM_GetPubKey(TPM_KEY_HANDLE 
-   TPM_RESULT res;
-   TPM_KEY_DATA *key;
-   TPM_DIGEST digest;
-+  size_t key_length;
-   info("TPM_GetPubKey()");
-   /* get key */
-   if (keyHandle == TPM_KH_SRK
-@@ -650,8 +670,8 @@ TPM_RESULT TPM_GetPubKey(TPM_KEY_HANDLE 
-   pubKey->pubKey.keyLength = key->key.size >> 3;
-   pubKey->pubKey.key = tpm_malloc(pubKey->pubKey.keyLength);
-   if (pubKey->pubKey.key == NULL) return TPM_NOSPACE;
--  rsa_export_modulus(&key->key, pubKey->pubKey.key, 
--    &pubKey->pubKey.keyLength);
-+  rsa_export_modulus(&key->key, pubKey->pubKey.key, &key_length);
-+  pubKey->pubKey.keyLength = (UINT32) key_length;
-   if (tpm_setup_key_parms(key, &pubKey->algorithmParms) != 0) {
-     error("TPM_GetPubKey(): tpm_setup_key_parms() failed.");
-     tpm_free(pubKey->pubKey.key);
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_structures.h tpm_emulator/tpm/tpm_structures.h
---- orig/tpm_emulator-0.4/tpm/tpm_structures.h	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_structures.h	2006-07-24 14:35:35.000000000 -0700
-@@ -1958,6 +1958,7 @@ typedef struct tdTPM_DAA_ISSUER {
-   TPM_DIGEST DAA_digest_gamma;
-   BYTE DAA_generic_q[26];
- } TPM_DAA_ISSUER;
-+#define sizeof_TPM_DAA_ISSUER(s) (2 + (20 * 6) + 26 )
- 
- /*
-  * TPM_DAA_TPM ([TPM_Part2], Section 22.4)
-@@ -1973,6 +1974,7 @@ typedef struct tdTPM_DAA_TPM {
-   TPM_DIGEST DAA_rekey;
-   UINT32 DAA_count;
- } TPM_DAA_TPM;
-+#define sizeof_TPM_DAA_TPM(s) (2 + (4 * 20) + 4)
- 
- /*
-  * TPM_DAA_CONTEXT ([TPM_Part2], Section 22.5)
-@@ -1987,6 +1989,7 @@ typedef struct tdTPM_DAA_CONTEXT {
-   BYTE DAA_scratch[256];
-   BYTE DAA_stage;
- } TPM_DAA_CONTEXT;
-+#define sizeof_TPM_DAA_CONTEXT(s) (2 + (3 * 20) + 256 + 1)
- 
- /*
-  * TPM_DAA_JOINDATA ([TPM_Part2], Section 22.6)
-@@ -1998,6 +2001,7 @@ typedef struct tdTPM_DAA_JOINDATA {
-   BYTE DAA_join_u1[138];
-   TPM_DIGEST DAA_digest_n0;
- } TPM_DAA_JOINDATA;
-+#define sizeof_TPM_DAA_JOINDATA(s) (1 + 1 + 20)
- 
- /*
-  * TPM_DAA_BLOB ([TPM_Part2], Section 22.8)
-@@ -2202,6 +2206,7 @@ typedef struct tdTPM_STCLEAR_DATA {
-   //UINT32 ownerReference;
-   //BOOL disableResetLock;
- } TPM_STCLEAR_DATA;
-+#define sizeof_TPM_STCLEAR_DATA(s) (2 + 20 + 4)
- 
- /*
-  * TPM_SESSION_DATA
-@@ -2238,6 +2243,11 @@ typedef struct tdTPM_DAA_SESSION_DATA {
-   TPM_DAA_JOINDATA DAA_joinSession;
-   TPM_HANDLE handle;
- } TPM_DAA_SESSION_DATA;
-+#define sizeof_TPM_DAA_SESSION_DATA(s) ( 1 \
-+  + sizeof_TPM_DAA_ISSUER(s.DAA_issuerSettings) \
-+  + sizeof_TPM_DAA_TPM(s.DAA_tpmSpecific) \
-+  + sizeof_TPM_DAA_CONTEXT(s.DAA_session) \
-+  + sizeof_TPM_DAA_JOINDATA(s.DAA_joinSession) + 4)
- 
- /*
-  * TPM_STANY_DATA ([TPM_Part2], Section 7.6)
-@@ -2262,6 +2272,11 @@ typedef struct tdTPM_STANY_DATA {
-   TPM_DAAHANDLE currentDAA;
-   TPM_TRANSHANDLE transExclusive;
- } TPM_STANY_DATA;
-+#define sizeof_TPM_STANY_DATA(s) (2 + 20 + 20 + 1 \
-+  + sizeof_TPM_CURRENT_TICKS(s.currentTicks) \
-+  + 4 + (4 * TPM_MAX_SESSION_LIST) \
-+  + (sizeof_TPM_SESSION_DATA(s.sessions[0]) * TPM_MAX_SESSION_LIST) \
-+  + (sizeof_TPM_DAA_SESSION_DATA(s.sessionsDAA[0]) * TPM_MAX_SESSIONS_DAA) + 4)
- 
- /*
-  * TPM_DATA
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_testing.c tpm_emulator/tpm/tpm_testing.c
---- orig/tpm_emulator-0.4/tpm/tpm_testing.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_testing.c	2006-07-24 14:35:35.000000000 -0700
-@@ -1,6 +1,7 @@
- /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
-  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-  *                    Swiss Federal Institute of Technology (ETH) Zurich
-+ * Copyright (C) 2005 INTEL Corp
-  *
-  * This module is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published
-@@ -95,24 +96,24 @@ static int tpm_test_sha1(void)
-   struct {
-     uint8_t *data; uint32_t repetitions; uint8_t *digest;
-   } test_cases[] =  {{
--    "abc", 1,
--    "\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D"
-+	(uint8_t*)"abc", 1,
-+    (uint8_t*)"\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D"
-   }, {
--    "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 1,
--    "\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29\xE5\xE5\x46\x70\xF1"
-+    (uint8_t*)"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 1,
-+    (uint8_t*)"\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29\xE5\xE5\x46\x70\xF1"
-   }, {
--    "a", 1000000,
--    "\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F"
-+    (uint8_t*)"a", 1000000,
-+    (uint8_t*)"\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F"
-   }, {
--    "0123456701234567012345670123456701234567012345670123456701234567", 10,
--    "\xDE\xA3\x56\xA2\xCD\xDD\x90\xC7\xA7\xEC\xED\xC5\xEB\xB5\x63\x93\x4F\x46\x04\x52"
-+    (uint8_t*)"0123456701234567012345670123456701234567012345670123456701234567", 10,
-+    (uint8_t*)"\xDE\xA3\x56\xA2\xCD\xDD\x90\xC7\xA7\xEC\xED\xC5\xEB\xB5\x63\x93\x4F\x46\x04\x52"
-   }};
- 
-   debug("tpm_test_sha1()");
-   for (i = 0; i < sizeof(test_cases) / sizeof(test_cases[0]); i++) {
-     sha1_init(&ctx);
-     for (j = 0; j < test_cases[i].repetitions; j++)
--      sha1_update(&ctx, test_cases[i].data, strlen(test_cases[i].data));
-+      sha1_update(&ctx, test_cases[i].data, strlen((char*)test_cases[i].data));
-     sha1_final(&ctx, digest);
-     if (memcmp(digest, test_cases[i].digest, SHA1_DIGEST_LENGTH) != 0) return -1;
-   }
-@@ -128,41 +129,41 @@ static int tpm_test_hmac(void)
-   struct {
-     uint8_t *key, key_len, *data, data_len, *digest;
-   } test_cases[] = {{
--    "\x0b", 20, "Hi There", 8,
--    "\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"
-+    (uint8_t*)"\x0b", 20, (uint8_t*)"Hi There", 8,
-+    (uint8_t*)"\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"
-   }, {
--    "Jefe", 4, "what do ya want for nothing?", 28,
--    "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79"
-+    (uint8_t*)"Jefe", 4, (uint8_t*)"what do ya want for nothing?", 28,
-+    (uint8_t*)"\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79"
-   }, {
--    "\xaa", 20, "\xdd", 50,
--    "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3"
-+    (uint8_t*)"\xaa", 20, (uint8_t*)"\xdd", 50,
-+    (uint8_t*)"\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3"
-   }, {
--    "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
--    "\x15\x16\x17\x18\x19", 25, "\xcd", 50,
--    "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda"
-+    (uint8_t*)"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
-+    "\x15\x16\x17\x18\x19", 25, (uint8_t*)"\xcd", 50,
-+    (uint8_t*)"\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda"
-   }, {
--    "\x0c", 20, "Test With Truncation", 20,
--    "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04"
-+    (uint8_t*)"\x0c", 20, (uint8_t*)"Test With Truncation", 20,
-+    (uint8_t*)"\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04"
-   }, {
--    "\xaa", 80, "Test Using Larger Than Block-Size Key - Hash Key First", 54,
--    "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12"
-+    (uint8_t*)"\xaa", 80, (uint8_t*)"Test Using Larger Than Block-Size Key - Hash Key First", 54,
-+    (uint8_t*)"\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12"
-   }, {
--    "\xaa", 80,
--    "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", 73,
--    "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91"
-+    (uint8_t*)"\xaa", 80,
-+    (uint8_t*)"Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", 73,
-+    (uint8_t*)"\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91"
-   }};
- 
-   debug("tpm_test_hmac()");
-   for (i = 0; i < sizeof(test_cases) / sizeof(test_cases[0]); i++) {
--    if (strlen(test_cases[i].key) < test_cases[i].key_len) {
-+    if (strlen((char*)test_cases[i].key) < test_cases[i].key_len) {
-       uint8_t key[test_cases[i].key_len];
-       memset(key, test_cases[i].key[0], test_cases[i].key_len);
-       hmac_init(&ctx, key, test_cases[i].key_len);
-     } else {
-       hmac_init(&ctx, test_cases[i].key, test_cases[i].key_len);
-     }
--    for (j = 0; j < test_cases[i].data_len; j += strlen(test_cases[i].data)) {
--      hmac_update(&ctx, test_cases[i].data, strlen(test_cases[i].data));
-+    for (j = 0; j < test_cases[i].data_len; j += strlen((char*)test_cases[i].data)) {
-+      hmac_update(&ctx, test_cases[i].data, strlen((char*)test_cases[i].data));
-     }
-     hmac_final(&ctx, digest);
-     if (memcmp(digest, test_cases[i].digest, SHA1_DIGEST_LENGTH) != 0) return -1;
-@@ -173,9 +174,9 @@ static int tpm_test_hmac(void)
- static int tpm_test_rsa_EK(void)
- {
-   int res = 0;
--  char *data = "RSA PKCS #1 v1.5 Test-String";
-+  uint8_t *data = (uint8_t*)"RSA PKCS #1 v1.5 Test-String";
-   uint8_t buf[256];
--  size_t buf_len, data_len = strlen(data);
-+  size_t buf_len, data_len = strlen((char*)data);
-   rsa_private_key_t priv_key;
-   rsa_public_key_t pub_key;
- 
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_ticks.c tpm_emulator/tpm/tpm_ticks.c
---- orig/tpm_emulator-0.4/tpm/tpm_ticks.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_ticks.c	2006-07-24 14:35:35.000000000 -0700
-@@ -1,6 +1,7 @@
- /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
-  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-  *                    Swiss Federal Institute of Technology (ETH) Zurich
-+ * Copyright (C) 2005 INTEL Corp
-  *
-  * This module is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published
-@@ -39,9 +40,7 @@ TPM_RESULT TPM_SetTickType(TPM_TICKTYPE 
- TPM_RESULT TPM_GetTicks(TPM_CURRENT_TICKS *currentTime)
- {
-   info("TPM_GetTicks()");
--  memcpy(currentTime, &tpmData.stany.data.currentTicks, 
--    sizeof(TPM_CURRENT_TICKS));
--  return TPM_SUCCESS;
-+  return TPM_DISABLED_CMD;
- }
- 
- TPM_RESULT TPM_TickStampBlob(TPM_KEY_HANDLE keyHandle, TPM_NONCE *antiReplay,
-@@ -49,64 +48,11 @@ TPM_RESULT TPM_TickStampBlob(TPM_KEY_HAN
-                              TPM_CURRENT_TICKS *currentTicks, 
-                              UINT32 *sigSize, BYTE **sig)
- {
--  TPM_RESULT res;
--  TPM_KEY_DATA *key;
--  BYTE *info, *p;
--  UINT32 info_length, length;
-   info("TPM_TickStampBlob()");
--  /* get key */
--  key = tpm_get_key(keyHandle);
--  if (key == NULL) return TPM_INVALID_KEYHANDLE;
--  /* verify authorization */ 
--  res = tpm_verify_auth(auth1, key->usageAuth, keyHandle);
--  if (res != TPM_SUCCESS) return res;
--  if (key->keyUsage != TPM_KEY_SIGNING && key->keyUsage != TPM_KEY_LEGACY
--      && key->keyUsage != TPM_KEY_IDENTITY) return TPM_INVALID_KEYUSAGE;
--  /* get current ticks */
--  TPM_GetTicks(currentTicks);
--  /* sign data using signature scheme PKCS1_SHA1 and TPM_SIGN_INFO container */
--  *sigSize = key->key.size >> 3;
--  *sig = tpm_malloc(*sigSize);
--  if (*sig == NULL) return TPM_FAIL; 
--  /* setup TPM_SIGN_INFO structure */
--  info_length = 30 + sizeof(TPM_DIGEST) + sizeof_TPM_CURRENT_TICKS(currentTicks);
--  info = tpm_malloc(info_length);
--  if (info == NULL) {
--    tpm_free(*sig);
--    return TPM_FAIL;
--  }
--  memcpy(&info[0], "\x05\x00TSTP", 6);
--  memcpy(&info[6], antiReplay->nonce, 20);
--  *(UINT32*)&info[26] = CPU_TO_BE32(20
--                        + sizeof_TPM_CURRENT_TICKS(currentTicks));
--  memcpy(&info[30], digestToStamp->digest, sizeof(TPM_DIGEST));
--  p = &info[30 + sizeof(TPM_DIGEST)]; 
--  length = sizeof_TPM_CURRENT_TICKS(currentTicks);
--  if (tpm_marshal_TPM_CURRENT_TICKS(&p, &length, currentTicks)
--      || rsa_sign(&key->key, RSA_SSA_PKCS1_SHA1, info, info_length, *sig)) {   
--    tpm_free(*sig);
--    tpm_free(info);
--    return TPM_FAIL;
--  } 
--  return TPM_SUCCESS;
-+  return TPM_DISABLED_CMD;
- }
- 
- void tpm_update_ticks(void)
- {
--  if (tpmData.stany.data.currentTicks.tag == 0) {
--    tpmData.stany.data.currentTicks.tag = TPM_TAG_CURRENT_TICKS;
--    tpmData.stany.data.currentTicks.currentTicks += tpm_get_ticks();
--/* removed since v1.2 rev 94
--    tpmData.stany.data.currentTicks.tickType = tpmData.permanent.data.tickType;
--*/
--    tpm_get_random_bytes(tpmData.stany.data.currentTicks.tickNonce.nonce, 
--      sizeof(TPM_NONCE));
--    tpmData.stany.data.currentTicks.tickRate = 1;
--/* removed since v1.2 rev 94
--    tpmData.stany.data.currentTicks.tickSecurity = TICK_SEC_NO_CHECK;
--*/
--  } else {
--    tpmData.stany.data.currentTicks.currentTicks += tpm_get_ticks();   
--  }
- }
- 
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_transport.c tpm_emulator/tpm/tpm_transport.c
---- orig/tpm_emulator-0.4/tpm/tpm_transport.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_transport.c	2006-07-24 14:35:35.000000000 -0700
-@@ -189,7 +189,7 @@ static void decrypt_wrapped_command(BYTE
-     sha1_init(&sha1);
-     sha1_update(&sha1, auth->nonceEven.nonce, sizeof(auth->nonceEven.nonce));
-     sha1_update(&sha1, auth->nonceOdd.nonce, sizeof(auth->nonceOdd.nonce));
--    sha1_update(&sha1, "in", 2);
-+    sha1_update(&sha1, (BYTE*)"in", 2);
-     sha1_update(&sha1, secret, sizeof(TPM_SECRET));
-     j = CPU_TO_BE32(i);
-     sha1_update(&sha1, (BYTE*)&j, 4);
-@@ -211,7 +211,7 @@ static void encrypt_wrapped_command(BYTE
-     sha1_init(&sha1);
-     sha1_update(&sha1, auth->nonceEven.nonce, sizeof(auth->nonceEven.nonce));
-     sha1_update(&sha1, auth->nonceOdd.nonce, sizeof(auth->nonceOdd.nonce));
--    sha1_update(&sha1, "out", 3);
-+    sha1_update(&sha1, (BYTE*)"out", 3);
-     sha1_update(&sha1, secret, sizeof(TPM_SECRET));
-     j = CPU_TO_BE32(i);
-     sha1_update(&sha1, (BYTE*)&j, 4);
-diff -uprN orig/tpm_emulator-0.4/tpmd.c tpm_emulator/tpmd.c
---- orig/tpm_emulator-0.4/tpmd.c	1969-12-31 16:00:00.000000000 -0800
-+++ tpm_emulator/tpmd.c	2006-07-24 14:35:35.000000000 -0700
-@@ -0,0 +1,156 @@
-+/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
-+ * Copyright (C) 2005 INTEL Corp
-+ *
-+ * This module is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published
-+ * by the Free Software Foundation; either version 2 of the License,
-+ * or (at your option) any later version.
-+ *
-+ * This module 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.
-+ *
-+ */
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <string.h>
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+#include <fcntl.h>
-+#include <sys/time.h>
-+
-+#include "tpm_emulator.h"
-+
-+#define TPM_RX_FNAME "/var/tpm/tpm_in.fifo"
-+#define TPM_TX_FNAME "/var/tpm/tpm_out.fifo"
-+
-+#define BUFFER_SIZE 2048
-+
-+static int devurandom=0;
-+	  
-+void get_random_bytes(void *buf, int nbytes) {
-+  
-+  if (devurandom == 0) {
-+    devurandom = open("/dev/urandom", O_RDONLY);
-+  }
-+
-+  if (read(devurandom, buf, nbytes) != nbytes) {
-+      printf("Can't get random number.\n");
-+      exit(-1);
-+  }
-+}
-+
-+uint64_t tpm_get_ticks(void)
-+{
-+  //struct timeval tv;
-+  //int gettimeofday(&tv, struct timezone *tz);
-+  return 0;
-+}
-+
-+int main(int argc, char **argv)
-+{
-+  uint8_t in[BUFFER_SIZE], *out;
-+  uint32_t out_size;
-+  int in_size, written;
-+  int i;
-+  struct stat file_info;
-+
-+  int tpm_tx_fh=-1, tpm_rx_fh=-1;
-+  if (argc < 2) {
-+    printf("Usage: tpmd clear|save|deactivated\n" );
-+	  return -1;
-+  }
-+
-+  /* initialize TPM emulator */
-+  if (!strcmp(argv[1], "clear")) {
-+    printf("Initializing tpm: %s\n", argv[1]);
-+    tpm_emulator_init(1);
-+  } else if (!strcmp(argv[1], "save")) { 
-+    printf("Initializing tpm: %s\n", argv[1]);
-+    tpm_emulator_init(2);
-+  } else if (!strcmp(argv[1], "deactivated")) {
-+    printf("Initializing tpm: %s\n", argv[1]);
-+    tpm_emulator_init(3);
-+  } else {
-+    printf("invalid startup mode '%s'; must be 'clear', "
-+      "'save' (default) or 'deactivated", argv[1]);
-+    return -1;
-+  }
-+
-+  if ( stat(TPM_RX_FNAME, &file_info) == -1) {
-+    if ( mkfifo(TPM_RX_FNAME, S_IWUSR | S_IRUSR ) ) {
-+      printf("Failed to create fifo %s.\n", TPM_RX_FNAME);
-+      return -1;
-+    }
-+  }
-+
-+  if ( stat(TPM_TX_FNAME, &file_info) == -1) {
-+    if ( mkfifo(TPM_TX_FNAME, S_IWUSR | S_IRUSR ) ) {
-+      printf("Failed to create fifo %s.\n", TPM_TX_FNAME);
-+      return -1;
-+    }
-+  }
-+
-+  while (1) {
-+abort_command:
-+    if (tpm_rx_fh < 0) {
-+      tpm_rx_fh = open(TPM_RX_FNAME, O_RDONLY);
-+    }
-+    
-+    if (tpm_rx_fh < 0) {
-+      printf("ERROR: failed to open devices to listen to guest.\n");
-+      return -1;
-+    }
-+    
-+    if (tpm_tx_fh < 0) {
-+      tpm_tx_fh = open(TPM_TX_FNAME, O_WRONLY);
-+    }
-+
-+    if (tpm_tx_fh < 0) {
-+      printf("ERROR: failed to open devices to respond to guest.\n");
-+      return -1;
-+    }
-+
-+    in_size = read(tpm_rx_fh, in, BUFFER_SIZE);
-+    if (in_size < 6) { // Magic size of minium TPM command
-+      printf("Recv[%d] to small: 0x", in_size);
-+      if (in_size <= 0) {
-+          close(tpm_rx_fh);
-+          tpm_rx_fh = -1;
-+          goto abort_command;
-+      }
-+    } else { 
-+      printf("Recv[%d]: 0x", in_size);
-+      for (i=0; i< in_size; i++) 
-+        printf("%x ", in[i]);
-+      printf("\n");
-+    }
-+
-+    
-+    if (tpm_handle_command(in, in_size, &out, &out_size) != 0) { 
-+        printf("ERROR: Handler Failed.\n");
-+    }
-+
-+    written = write(tpm_tx_fh, out, out_size);
-+
-+    if (written != out_size ) {
-+      printf("ERROR: Part of response not written %d/%d.\nAttempt: ", written, out_size);
-+    } else {
-+      printf("Sent[%Zu]: ", out_size);
-+    }
-+    for (i=0; i< out_size; i++)
-+      printf("%x ", out[i]);
-+    printf("\n");
-+    tpm_free(out);
-+
-+  } // loop
-+
-+  tpm_emulator_shutdown();
-+
-+  close(tpm_tx_fh);
-+  close(tpm_rx_fh);
-+
-+}
-Binary files orig/tpm_emulator-0.4/tpm_emulator and tpm_emulator/tpm_emulator differ
-diff -uprN orig/tpm_emulator-0.4/tpm_version.h tpm_emulator/tpm_version.h
---- orig/tpm_emulator-0.4/tpm_version.h	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm_version.h	2006-07-24 14:35:41.000000000 -0700
-@@ -2,5 +2,5 @@
- #define _TPM_VERSION_H_
- #define VERSION_MAJOR 0
- #define VERSION_MINOR 4
--#define VERSION_BUILD 1151058734
-+#define VERSION_BUILD 1153776940
- #endif /* _TPM_VERSION_H_ */
diff --git a/tools/vtpm/vtpm-0.5.1-LDLIBS.patch b/tools/vtpm/vtpm-0.5.1-LDLIBS.patch
deleted file mode 100644
index 95586c1..0000000
--- a/tools/vtpm/vtpm-0.5.1-LDLIBS.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naurp tpm_emulator-0.5.1/tpmd/Makefile tpm_emulator-0.5.1/tpmd/Makefile
---- tpm_emulator-0.5.1/tpmd/Makefile
-+++ tpm_emulator-0.5.1/tpmd/Makefile
-@@ -8,7 +8,7 @@ WFLAGS  := -Wall -Wno-unused -Wpointer-a
-            #WFLAGS  += -Wextra -Wcast-qual -Wmissing-prototypes -Wmissing-declarations -Wstrict-aliasing
- CFLAGS  += $(WFLAGS) -g -I.. -I. -O2 -fno-strict-aliasing
- CFLAGS  += -I../../../../tools/vtpm_manager/manager
--LDFLAGS += -lgmp
-+LDLIBS  += -lgmp
- 
- BINDIR  := /usr/bin/
- 
diff --git a/tools/vtpm/vtpm-0.5.1.patch b/tools/vtpm/vtpm-0.5.1.patch
deleted file mode 100644
index 2aeb745..0000000
--- a/tools/vtpm/vtpm-0.5.1.patch
+++ /dev/null
@@ -1,766 +0,0 @@
-diff -Naurp tpm_emulator-0.5.1/Makefile tpm5-test/Makefile
---- tpm_emulator-0.5.1/Makefile	2008-02-14 03:22:48.000000000 -0500
-+++ tpm5-test/Makefile	2009-07-15 09:45:28.000000000 -0400
-@@ -10,7 +10,7 @@ VERSION_MINOR  := 5
- VERSION_BUILD  := $(shell date +"%s")
- VERSION_SUFFIX := .1
- 
--SUBDIRS := tpmd tpmd_dev tddl
-+SUBDIRS := tpmd 
- 
- all: version all-recursive
- 
-@@ -48,12 +48,12 @@ user_install: user
- modules_install: modules
- 	@$(MAKE) -C tpmd_dev install || exit -1
- 
--DIRS    := . tpm crypto tpmd tpmd_dev tddl tpmd_dev_openbsd
-+DIRS    := . tpm crypto tpmd 
- DISTSRC := $(foreach dir, $(DIRS), $(wildcard $(dir)/*.c))
- DISTSRC += $(foreach dir, $(DIRS), $(wildcard $(dir)/*.h))
--DIRS    := . tpmd tpmd_dev tddl tpmd_dev_openbsd
-+DIRS    := . tpmd 
- DISTSRC += $(foreach dir, $(DIRS), $(dir)/Makefile)
--DISTSRC += ./README ./AUTHORS ./ChangeLog tpmd_dev/tpmd_dev.rules.in
-+DISTSRC += ./README ./AUTHORS ./ChangeLog 
- DISTDIR := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_SUFFIX)
- 
- dist: $(DISTSRC)
-diff -Naurp tpm_emulator-0.5.1/tpm/tpm_capability.c tpm5-test/tpm/tpm_capability.c
---- tpm_emulator-0.5.1/tpm/tpm_capability.c	2008-02-14 03:22:48.000000000 -0500
-+++ tpm5-test/tpm/tpm_capability.c	2009-07-16 12:04:20.000000000 -0400
-@@ -136,8 +136,19 @@ static TPM_RESULT cap_property(UINT32 su
- 
-     case TPM_CAP_PROP_TIS_TIMEOUT:
-       debug("[TPM_CAP_PROP_TIS_TIMEOUT]");
--      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT */
--      return TPM_FAIL;
-+      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT: Measure these values and determine correct ones */
-+      UINT32 len = *respSize = 16;
-+      BYTE *ptr = *resp = tpm_malloc(*respSize);
-+      if (ptr == NULL || 
-+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
-+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
-+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
-+          tpm_marshal_UINT32(&ptr, &len, 200000)) {
-+        tpm_free(*resp);
-+        return TPM_FAIL;
-+      }
-+      return TPM_SUCCESS;
-+
- 
-     case TPM_CAP_PROP_STARTUP_EFFECT:
-       debug("[TPM_CAP_PROP_STARTUP_EFFECT]");
-@@ -189,8 +200,12 @@ static TPM_RESULT cap_property(UINT32 su
- 
-     case TPM_CAP_PROP_DURATION:
-       debug("[TPM_CAP_PROP_DURATION]");
--      /* TODO: TPM_CAP_PROP_DURATION */
--      return TPM_FAIL;
-+      /* TODO: TPM_CAP_PROP_DURATION: Measure these values and return accurate ones */
-+      BYTE dur[]= {0x0,0x0,0x0,0xc,0x0,0x7,0xa1,0x20,0x0,0x1e,0x84,0x80,0x11,0xe1,0xa3,0x0}; 
-+      *respSize = 16;
-+      *resp = tpm_malloc(*respSize);
-+      memcpy(*resp,dur,16); 
-+
- 
-     case TPM_CAP_PROP_ACTIVE_COUNTER:
-       debug("[TPM_CAP_PROP_ACTIVE_COUNTER]");
-diff -Naurp tpm_emulator-0.5.1/tpmd/Makefile tpm5-test/tpmd/Makefile
---- tpm_emulator-0.5.1/tpmd/Makefile	2008-02-14 03:22:48.000000000 -0500
-+++ tpm5-test/tpmd/Makefile	2009-07-16 12:08:26.000000000 -0400
-@@ -8,9 +8,10 @@ WFLAGS  := -Wall -Wno-unused -Wpointer-a
-            -Wwrite-strings -Wsign-compare -Wno-multichar
-            #WFLAGS  += -Wextra -Wcast-qual -Wmissing-prototypes -Wmissing-declarations -Wstrict-aliasing
- CFLAGS  += $(WFLAGS) -g -I.. -I. -O2 -fno-strict-aliasing
-+CFLAGS  += -I../../../../tools/vtpm_manager/manager
- LDFLAGS += -lgmp
- 
--BINDIR  := /usr/sbin/
-+BINDIR  := /usr/bin/
- 
- TPMD    := tpmd
- DIRS    := ../tpm ../crypto
-@@ -18,6 +19,8 @@ SRCS    := $(foreach dir, $(DIRS), $(wil
- OBJS    := $(patsubst %.c, %.o, $(SRCS))
- OBJS    := $(foreach dir, $(DIRS), $(patsubst $(dir)/%.o, %.o, $(filter $(dir)/%.o, $(OBJS))))
- 
-+VTPM_BIN := vtpmd
-+
- vpath %.c $(strip $(DIRS))
- 
- all: $(TPMD)
-@@ -32,10 +35,8 @@ TPMD_GROUP ?= tss
- INSTALL    ?= install
- 
- install: $(TPMD)
--	$(INSTALL) -m 755 -o $(TPMD_USER) -g $(TPMD_GROUP) -d $(DESTDIR)/var/lib/tpm
--	$(INSTALL) -m 755 -o $(TPMD_USER) -g $(TPMD_GROUP) -d $(DESTDIR)/var/run/tpm
- 	$(INSTALL) -D -d $(DESTDIR)/$(BINDIR)
--	$(INSTALL) -m 755 $(TPMD) $(DESTDIR)/$(BINDIR)
-+	$(INSTALL) -m 755 $(TPMD) $(DESTDIR)/$(BINDIR)/$(VTPM_BIN)
- 
- .PHONY: all clean install
- 
-diff -Naurp tpm_emulator-0.5.1/tpmd/tpmd.c tpm5-test/tpmd/tpmd.c
---- tpm_emulator-0.5.1/tpmd/tpmd.c	2008-02-14 03:22:48.000000000 -0500
-+++ tpm5-test/tpmd/tpmd.c	2009-07-16 11:19:05.000000000 -0400
-@@ -32,6 +32,9 @@
- #include <grp.h>
- #include "tpm_emulator_config.h"
- #include "tpm/tpm_emulator.h"
-+#include "tpm/tpm_structures.h"
-+#include "tpm/tpm_marshalling.h"
-+#include "vtpm_manager.h"
- 
- #define TPM_DAEMON_NAME     "tpmd"
- #define TPM_CMD_BUF_SIZE    4096
-@@ -39,6 +42,24 @@
- #define TPM_RANDOM_DEVICE   "/dev/urandom"
- #undef  TPM_MKDIRS
- 
-+#ifdef VTPM_MULTI_VM
-+ #define DEV_BE "/dev/vtpm"
-+ #define DEV_FE "/dev/tpm"
-+#else
-+ #define PVM_RX_FIFO_D "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
-+ #define PVM_TX_FIFO "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
-+ #define HVM_RX_FIFO_D "/var/vtpm/socks/%d.socket"
-+
-+ #define VTPM_RX_FIFO_D "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
-+ #define VTPM_TX_FIFO "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
-+
-+ static char *vtpm_rx_name=NULL;
-+#endif
-+
-+ static int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
-+
-+#define BUFFER_SIZE 2048
-+
- static volatile int stopflag = 0;
- static int is_daemon = 0;
- static int opt_debug = 0;
-@@ -49,6 +70,8 @@ static const char *opt_storage_file = "/
- static uid_t opt_uid = 0;
- static gid_t opt_gid = 0;
- static int tpm_startup = 2;
-+static int vtpm_type = VTPM_TYPE_PVM;
-+int dmi_id = 0;
- static int rand_fh;
- 
- void tpm_log(int priority, const char *fmt, ...)
-@@ -90,56 +113,241 @@ uint64_t tpm_get_ticks(void)
- 
- int tpm_write_to_file(uint8_t *data, size_t data_length)
- {
--    int fh;
--    ssize_t res;
--    fh = open(opt_storage_file, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
--    if (fh < 0) return -1;
--    while (data_length > 0) {
--        res = write(fh, data, data_length);
--	if (res < 0) {
--	    close(fh);
--	    return -1;
--	}
--	data_length -= res; 
--	data += res;
-+  int res, out_data_size, in_header_size;
-+  BYTE *ptr, *out_data, *in_header;
-+  UINT32 result, len, in_rsp_size;
-+  UINT16 tag = VTPM_TAG_REQ;
-+	
-+  printf("Saving NVM\n");
-+  if (vtpm_tx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
-+#else
-+	vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
-+#endif
-+  }
-+
-+  if (vtpm_tx_fh < 0) {
-+		return -1;
-+  }
-+ 
-+  // Send request to VTPM Manager to encrypt data
-+#ifdef VTPM_MUTLI_VM
-+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT + data_length;
-+#else
-+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV + data_length;
-+#endif
-+  
-+  out_data = ptr = (BYTE *) malloc(len);
-+
-+  if (ptr == NULL
-+#ifndef VTPM_MUTLI_VM
-+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
-+#endif
-+	  || tpm_marshal_UINT16(&ptr, &len, tag)
-+#ifdef VTPM_MUTLI_VM
-+	  || tpm_marshal_UINT32(&ptr, &len, out_data_size)
-+#else
-+	  || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
-+#endif  
-+	  || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_SAVENVM)
-+	  || tpm_marshal_BYTE_ARRAY(&ptr, &len, data, data_length)) {
-+	free(out_data);
-+	return -1;
-+  }
-+  
-+  printf("\tSending SaveNVM Command.\n");
-+  res = write(vtpm_tx_fh, out_data, out_data_size);
-+  free(out_data);
-+  if (res != out_data_size) return -1;
-+
-+  if (vtpm_rx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+    vtpm_rx_fh = vtpm_tx_fh
-+#else
-+    if (vtpm_rx_name == NULL) {
-+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
-+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
-     }
--    close(fh);
--    return 0;
-+	vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
-+#endif
-+  }
-+
-+  if (vtpm_rx_fh < 0) {
-+		return -1;
-+  }
-+  
-+  // Read Header of response so we can get the size & status
-+#ifdef VTPM_MUTLI_VM
-+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
-+#else
-+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
-+#endif
-+  in_header = ptr = malloc(in_header_size);
-+  
-+  printf("\tReading SaveNVM header.\n");
-+  res = read(vtpm_rx_fh, in_header, in_header_size);
-+
-+  if ( (res != in_header_size)
-+#ifndef VTPM_MUTLI_VM
-+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
-+#endif
-+	   || tpm_unmarshal_UINT16(&ptr, &len, &tag)
-+	   || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
-+	   || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
-+	  free(in_header);
-+	  return -1;
-+  }
-+  free(in_header);
-+  
-+  if (result != VTPM_SUCCESS) {
-+      return -1;  
-+  }
-+
-+#ifdef VTPM_MUTLI_VM
-+  close(vtpm_tx_fh); close(vtpm_rx_fh);
-+#endif
-+	  
-+  printf("\tFinishing up SaveNVM\n");
-+  return (0);
- }
- 
- int tpm_read_from_file(uint8_t **data, size_t *data_length)
- {
--    int fh;
--    ssize_t res;
--    size_t total_length;
--    fh = open(opt_storage_file, O_RDONLY);
--    if (fh < 0) return -1;
--    total_length = lseek(fh, 0, SEEK_END);
--    lseek(fh, 0, SEEK_SET);
--    *data = tpm_malloc(total_length);
--    if (*data == NULL) {
--        close(fh);
--        return -1;
--    }
--    *data_length = 0;
--    while (total_length > 0) {
--        res = read(fh, &(*data)[*data_length], total_length);
--	if (res < 0) {
--	    close(fh);
--	    tpm_free(*data);
--	    return -1;
--	}
--        *data_length += res;
--	total_length -= res;
-+  int res, out_data_size, in_header_size;
-+  uint8_t *ptr, *out_data, *in_header;
-+  UINT16 tag = VTPM_TAG_REQ;
-+  UINT32 len, in_rsp_size, result;
-+#ifdef VTPM_MUTLI_VM
-+	int vtpm_rx_fh, vtpm_tx_fh;
-+#endif
-+	
-+  printf("Loading NVM.\n");
-+  if (vtpm_tx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
-+#else
-+	vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
-+#endif
-+  }
-+
-+  if (vtpm_tx_fh < 0) {
-+	printf("Error in read_from_file:301\n");
-+		return -1;
-+  }
-+ 
-+  // Send request to VTPM Manager to encrypt data
-+#ifdef VTPM_MUTLI_VM
-+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
-+#else
-+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
-+#endif
-+  out_data = ptr = (BYTE *) malloc(len);
-+
-+  if (ptr == NULL
-+#ifndef VTPM_MUTLI_VM
-+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
-+#endif  
-+      || tpm_marshal_UINT16(&ptr, &len, tag)
-+#ifdef VTPM_MUTLI_VM
-+      || tpm_marshal_UINT32(&ptr, &len, out_data_size)
-+#else
-+      || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
-+#endif
-+      || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_LOADNVM)) {
-+    free(out_data);
-+    printf("Error in read_from_file:325\n");
-+
-+    return -1;
-+  }
-+
-+  printf("\tSending LoadNVM command\n");
-+  res = write(vtpm_tx_fh, out_data, out_data_size);
-+  free(out_data);
-+  if (res != out_data_size) 
-+    {
-+	printf("Error in read_from_file:335\n");
-+	return -1;
-+    }
-+
-+    if (vtpm_rx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+    vtpm_rx_fh = vtpm_tx_fh;
-+#else
-+    if (vtpm_rx_name == NULL) {
-+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
-+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
-     }
--    close(fh);
--    return 0;
-+	vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
-+#endif
-+  }
-+
-+  if (vtpm_rx_fh < 0) {
-+	printf("Error in read_from_file:352\n");	
-+	return -1;
-+  }
-+  
-+  // Read Header of response so we can get the size & status
-+#ifdef VTPM_MUTLI_VM
-+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
-+#else
-+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
-+#endif
-+  in_header = ptr = malloc(in_header_size);
-+  
-+  printf("\tReading LoadNVM header\n");
-+  res = read(vtpm_rx_fh, in_header, in_header_size);
-+
-+  if ( (res != in_header_size)
-+#ifndef VTPM_MUTLI_VM
-+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
-+#endif
-+       || tpm_unmarshal_UINT16(&ptr, &len, &tag)
-+       || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
-+       || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
-+      free(in_header);
-+      printf("Error in read_from_file:375\n");     
-+      return -1;
-+  }
-+  free(in_header);
-+  
-+  if (result != VTPM_SUCCESS) {
-+    printf("Error in read_from_file:381\n");
-+    return -1;  
-+  }
-+
-+  // Read Encrypted data from VTPM Manager
-+  *data_length = in_rsp_size - VTPM_COMMAND_HEADER_SIZE_CLT;
-+  *data = (uint8_t *) malloc(*data_length);
-+
-+  printf("\tReading clear data from LoadNVM.\n");
-+  res = read(vtpm_rx_fh, *data, *data_length);
-+#ifdef VTPM_MUTLI_VM
-+  close(vtpm_rx_fh);close(vtpm_tx_fh);
-+#endif 
-+	
-+  printf("\tReturing from loading NVM\n");
-+  if (res != (int)*data_length) {
-+      free(*data);
-+      printf("Error in read_from_file:398\n");
-+      return -1;
-+  } else {
-+      return 0;
-+  }
-+
-+
-+    
- }
- 
- static void print_usage(char *name)
- {
-     printf("usage: %s [-d] [-f] [-s storage file] [-u unix socket name] "
--           "[-o user name] [-g group name] [-h] [startup mode]\n", name);
-+           "[-o user name] [-g group name] [-h]"
-+#ifdef VTPM_MULTI_VM
-+	   "clear|save|deactivated\n", name);
-+#else
-+	   "clear|save|deactivated pvm|hvm vtpmid\n", name);
-+#endif
-     printf("  d : enable debug mode\n");
-     printf("  f : forces the application to run in the foreground\n");
-     printf("  s : storage file to use (default: %s)\n", opt_storage_file);
-@@ -205,7 +413,13 @@ static void parse_options(int argc, char
-                 exit(EXIT_SUCCESS);
-         }
-     }
--    if (optind < argc) {
-+    /*Make sure we have all required options*/
-+#ifdef VTPM_MULTI_VM
-+#define EXTRA_OPTS 0
-+#else
-+#define EXTRA_OPTS 2
-+#endif
-+    if (optind < argc - EXTRA_OPTS ) {
-         debug("startup mode = '%s'", argv[optind]);
-         if (!strcmp(argv[optind], "clear")) {
-             tpm_startup = 1;
-@@ -219,6 +433,25 @@ static void parse_options(int argc, char
-             print_usage(argv[0]);
-             exit(EXIT_SUCCESS);
-         }
-+#ifndef VTPM_MULTI_VM
-+        ++optind;
-+	if(!strcmp(argv[optind], "pvm")) {
-+		vtpm_type = VTPM_TYPE_PVM;	// Get commands from vTPM Manager through fifo
-+	} else if (!strcmp(argv[optind], "hvm")) {
-+		vtpm_type = VTPM_TYPE_HVM;	// Get commands from qemu via socket
-+        } else {
-+		error("Invalid vm mode '%s'; must be 'pvm', "
-+			"or 'hvm' ", argv[optind]);
-+		print_usage(argv[0]);
-+		exit(EXIT_SUCCESS);
-+	}
-+        ++optind;
-+	dmi_id = atoi(argv[optind]);
-+#endif
-+    } else {
-+	error("Invalid number of arguments");
-+	print_usage(argv[0]);
-+	exit(EXIT_SUCCESS);
-     }
- }
- 
-@@ -348,93 +581,180 @@ static int init_socket(const char *name)
- 
- static void main_loop(void)
- {
--    int sock, fh, res;
--    int32_t in_len;
-+    int32_t in_len, written;
-     uint32_t out_len;
--    uint8_t in[TPM_CMD_BUF_SIZE], *out;
-+    uint8_t in[TPM_CMD_BUF_SIZE], *out, *addressed_out;
-+    int guest_id=-1;
-+    int i;
-+    char *vtpm_rx_file=NULL;
-+    int res;
-+
-+#ifndef VTPM_MULTI_VM
-+    int sockfd = -1;
-     struct sockaddr_un addr;
--    socklen_t addr_len;
--    fd_set rfds;
--    struct timeval tv;
-+    struct sockaddr_un client_addr;
-+    unsigned int client_length;
-+#endif
-+
-+    int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
-+
-+#ifndef VTPM_MULTI_VM
-+  if (vtpm_type == VTPM_TYPE_PVM) {
-+    vtpm_rx_file = malloc(10 + strlen(PVM_RX_FIFO_D));
-+    sprintf(vtpm_rx_file, PVM_RX_FIFO_D, (uint32_t) dmi_id);
-+  } else {
-+    vtpm_rx_file = malloc(10 + strlen(HVM_RX_FIFO_D));
-+    sprintf(vtpm_rx_file, HVM_RX_FIFO_D, (uint32_t) dmi_id);
-+
-+    if ( (sockfd = socket(PF_UNIX,SOCK_STREAM,0)) < 0) {
-+          error("Unable to create socket. errno = %d\n", errno);
-+      exit (-1);
-+    }
-+
-+    memset(&addr, 0, sizeof(addr));
-+    addr.sun_family = AF_UNIX;
-+    strcpy(addr.sun_path,vtpm_rx_file );
-+    unlink(addr.sun_path);
-+  }
-+#endif
- 
-     info("staring main loop");
--    /* open UNIX socket */
--    sock = init_socket(opt_socket_name);
--    if (sock < 0) exit(EXIT_FAILURE);
-     /* init tpm emulator */
--    debug("initializing TPM emulator: %d", tpm_startup);
-+#ifdef VTPM_MULTI_VM
-+    debug("initializing TPM emulator: state=%d", tpm_startup);
-+#else
-+    debug("initializing TPM emulator: state=%d, type=%d, id=%d", tpm_startup, vtpm_type, dmi_id);
-+#endif
-     tpm_emulator_init(tpm_startup);
-     /* start command processing */
-     while (!stopflag) {
-         /* wait for incomming connections */
-         debug("waiting for connections...");
--        FD_ZERO(&rfds);
--        FD_SET(sock, &rfds);
--        tv.tv_sec = 10;
--        tv.tv_usec = 0;
--        res = select(sock + 1, &rfds, NULL, NULL, &tv);
--        if (res < 0) {
--            error("select(sock) failed: %s", strerror(errno));
--            break;
--        } else if (res == 0) {
--            continue;
--        }
--        addr_len = sizeof(addr);
--        fh = accept(sock, (struct sockaddr*)&addr, &addr_len);
--        if (fh < 0) {
--            error("accept() failed: %s", strerror(errno));
--            continue;
--        }
-+	if (vtpm_rx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+	    vtpm_rx_fh = open(DEV_BE, O_RDWR);
-+#else
-+	    if (vtpm_type == VTPM_TYPE_PVM)
-+	    {
-+		vtpm_rx_fh = open(vtpm_rx_file, O_RDONLY);
-+	    } else {
-+		if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
-+		    error("Unable to bind(). errno = %d\n", errno);
-+		    exit (-1);
-+		}
-+
-+		if (listen(sockfd, 10) <0) {
-+		    error("Unable to listen(). errno = %d\n", errno);
-+		    exit (-1);
-+		} 
-+
-+		 memset(&client_addr, 0, sizeof(client_addr));
-+		 client_length = sizeof(client_addr);
-+
-+		 vtpm_rx_fh = vtpm_tx_fh = accept(sockfd, (struct sockaddr *)&client_addr, &client_length);
-+	    }
-+#endif
-+	}
-+	
-+	/*Error Checking*/
-+	if (vtpm_rx_fh < 0) {
-+	  error("Failed to open devices to listen to guest.\n");
-+	  exit(-1);
-+	}
-+
-         /* receive and handle commands */
-         in_len = 0;
-         do {
-             debug("waiting for commands...");
--            FD_ZERO(&rfds);
--            FD_SET(fh, &rfds);
--            tv.tv_sec = TPM_COMMAND_TIMEOUT;
--            tv.tv_usec = 0;
--            res = select(fh + 1, &rfds, NULL, NULL, &tv);
--            if (res < 0) {
--                error("select(fh) failed: %s", strerror(errno));
--                close(fh);
--                break;
--            } else if (res == 0) {
--#ifdef TPMD_DISCONNECT_IDLE_CLIENTS	    
--                info("connection closed due to inactivity");
--                close(fh);
--                break;
--#else		
--                continue;
--#endif		
--            }
--            in_len = read(fh, in, sizeof(in));
--            if (in_len > 0) {
-+
-+            in_len = read(vtpm_rx_fh, in, sizeof(in));
-+	    /*Magic size of minimum TPM command is 6*/
-+		//FIXME Magic size check may not be required anymore
-+            if (in_len < 6) {
-+		info("Recv incomplete command of %d bytes.", in_len);
-+		if (in_len <= 0) {
-+		    close(vtpm_rx_fh);
-+		    vtpm_rx_fh = -1;
-+		    continue;
-+                 }
-+	    } else {
-+		/*Debug Printouts*/
-                 debug("received %d bytes", in_len);
-+		debug_nostop("Recv[%d]: 0x", in_len);
-+		for (i=0; i< in_len; i++) 
-+		    debug_more("%x ", in[i]);
-+		debug_more("\n");
-+		/*Multiple Guest check*/
-+		if (guest_id == -1) {
-+		    guest_id = *((int32_t *) in);
-+		} else {
-+		    if (guest_id != *((int32_t *) in) ) {
-+			error("WARNING: More than one guest attached\n");
-+		    }
-+		}
-+
-+		/*Open tx handle now*/
-+		if (vtpm_tx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+		    vtpm_tx_fh = open(DEV_BE, O_RDWR);
-+		    vtpm_rx_fh = vtpm_tx_fh;
-+#else
-+		    if (vtpm_type == VTPM_TYPE_PVM) {
-+			vtpm_tx_fh = open(PVM_TX_FIFO, O_WRONLY);
-+     		    } // No need to open the other direction for HVM
-+#endif
-+		}
-+		if (vtpm_tx_fh < 0) {
-+		  error("Failed to open devices to respond to guest.\n");
-+		  exit(-1);
-+		}
-+
-+		/*Handle the TPM command now*/
-                 out = NULL;
--                res = tpm_handle_command(in, in_len, &out, &out_len);
-+                res = tpm_handle_command(in + sizeof(uint32_t), in_len - sizeof(uint32_t), &out, &out_len);
-                 if (res < 0) {
-                     error("tpm_handle_command() failed");
-                 } else {
-                     debug("sending %d bytes", out_len);
-+		    //FIXME this prepending may or may not be needed
-+		    /*Prepend the first 4 bytes of the in buffer.. why?*/
-+		    addressed_out = (uint8_t *) tpm_malloc(sizeof(uint32_t) + out_len);
-+		    *(uint32_t *) addressed_out = *(uint32_t *) in;
-+		    memcpy(addressed_out + sizeof(uint32_t), out, out_len);
-+		    out_len += sizeof(uint32_t);
-+		    /*End Prepend*/
-+
-+		    /*Perform write operation now*/
-                     while (out_len > 0) {
--                        res = write(fh, out, out_len);
-+                        res = write(vtpm_tx_fh, addressed_out, out_len);
-+
-                         if (res < 0) {
-                             error("write(%d) failed: %s", out_len, strerror(errno));
-                             break;
--                        }
-+                        } else {
-+			  debug_nostop("Sent[%Zu]: ", out_len);
-+			  for (i=0; (unsigned int)i< out_len; i++)
-+			    debug_more("%x ", addressed_out[i]);
-+			  debug_more("\n");
-+			}
-                         out_len	-= res;
-                     }
-                     tpm_free(out);
-+		    tpm_free(addressed_out);
-                 }
-             }
-         } while (in_len > 0);
--        close(fh);
-+        //close(fh);
-     }
-+    
-     /* shutdown tpm emulator */
-     tpm_emulator_shutdown();
--    /* close socket */
--    close(sock);
--    unlink(opt_socket_name);
-+    /* Close handles */
-+    close(vtpm_tx_fh);
-+#ifndef VTPM_MULTI_VM
-+    close(vtpm_rx_fh);
-+    free(vtpm_rx_file);
-+#endif
-     info("main loop stopped");
- }
- 
-@@ -450,12 +770,13 @@ int main(int argc, char **argv)
-     /* open random device */
-     init_random();
-     /* init signal handlers */
--    init_signal_handler();
-+    //init_signal_handler();
-     /* unless requested otherwiese, fork and daemonize process */
--    if (!opt_foreground) daemonize();
-+    //if (!opt_foreground) daemonize();
-     /* start main processing loop */
-     main_loop();
-     info("stopping TPM Emulator daemon");
-     closelog();
-     return 0;
- }
-+
-diff -Naurp tpm_emulator-0.5.1/tpmd/tpm_emulator_config.h tpm5-test/tpmd/tpm_emulator_config.h
---- tpm_emulator-0.5.1/tpmd/tpm_emulator_config.h	2008-02-14 03:22:48.000000000 -0500
-+++ tpm5-test/tpmd/tpm_emulator_config.h	2009-07-16 11:25:26.000000000 -0400
-@@ -29,23 +29,28 @@
- 
- /* TPM emulator configuration */
- 
--#undef  TPM_STRONG_PERSISTENCE
--#undef  TPM_GENERATE_EK
-+#define  TPM_STRONG_PERSISTENCE
-+#define  TPM_GENERATE_EK
- #undef  TPM_GENERATE_SEED_DAA
- #undef  TPM_MEMORY_ALIGNMENT_MANDATORY
- 
-+extern int dmi_id;
-+
- /* log macros */
- 
- void tpm_log(int priority, const char *fmt, ...);
- 
--#define debug(fmt, ...) tpm_log(LOG_DEBUG, "%s:%d: Debug: " fmt "\n", \
--                                __FILE__, __LINE__, ## __VA_ARGS__)
--#define info(fmt, ...)  tpm_log(LOG_INFO, "%s:%d: Info: " fmt "\n", \
--                                __FILE__, __LINE__, ## __VA_ARGS__)
--#define error(fmt, ...) tpm_log(LOG_ERR, "%s:%d: Error: " fmt "\n", \
--                                __FILE__, __LINE__, ## __VA_ARGS__)
--#define alert(fmt, ...) tpm_log(LOG_ALERT, "%s:%d: Alert: " fmt "\n", \
--                                __FILE__, __LINE__, ## __VA_ARGS__)
-+#define debug(fmt, ...) tpm_log(LOG_DEBUG, "VTPMD[%d]: %s:%d: Debug: " fmt "\n", \
-+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define info(fmt, ...)  tpm_log(LOG_INFO, "VTPMD[%d]: %s:%d: Info: " fmt "\n", \
-+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define error(fmt, ...) tpm_log(LOG_ERR, "VTPMD[%d]: %s:%d: Error: " fmt "\n", \
-+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define alert(fmt, ...) tpm_log(LOG_ALERT, "VTPMD[%d]: %s:%d: Alert: " fmt "\n", \
-+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define debug_nostop(fmt, ...) tpm_log(LOG_DEBUG, "VTPMD[%d]: %s:%d: Debug: " fmt, \
-+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define debug_more(fmt, ...) tpm_log(LOG_DEBUG, fmt, ## __VA_ARGS__)
- 
- /*  min/max macros that also do strict type-checking */
- 
diff --git a/tools/vtpm/vtpm.patch b/tools/vtpm/vtpm.patch
deleted file mode 100644
index e896b25..0000000
--- a/tools/vtpm/vtpm.patch
+++ /dev/null
@@ -1,716 +0,0 @@
-diff -uprN tpm_emulator/AUTHORS vtpm/AUTHORS
---- tpm_emulator/AUTHORS	2006-12-08 12:51:29.000000000 -0800
-+++ vtpm/AUTHORS	2006-12-13 16:38:52.000000000 -0800
-@@ -1,3 +1,3 @@
- Mario Strasser <mast@gmx.net>
- Heiko Stamer <stamer@gaos.org> [DAA]
--INTEL Corp <> [Dropped to Ring3]
-+INTEL Corp <> [VTPM Extensions]
-diff -uprN tpm_emulator/ChangeLog vtpm/ChangeLog
---- tpm_emulator/ChangeLog	2006-12-08 12:51:29.000000000 -0800
-+++ vtpm/ChangeLog	2006-12-13 16:38:52.000000000 -0800
-@@ -1,5 +1,6 @@
- ????-??-?? Intel Corp
- 	* Moved module out of kernel to run as a ring 3 app
-+	* Modified save_to_file and load_from_file to call xen VTPM manager
- 
- 2006-06-23  Mario Strasser <mast@gmx.net>
- 	* tpm_startup.c: behaviour of ST_CLEAR and storage of
-diff -uprN tpm_emulator/linux_module.h vtpm/linux_module.h
---- tpm_emulator/linux_module.h	2006-12-08 12:51:29.000000000 -0800
-+++ vtpm/linux_module.h	2007-01-09 14:49:06.000000000 -0800
-@@ -44,18 +44,26 @@
- #define TPM_DEVICE_NAME   "tpm"
- #define TPM_MODULE_NAME   "tpm_emulator"
- 
-+/* debug and log output functions */
-+extern int dmi_id; 
-+
- #ifdef DEBUG
--#define debug(fmt, ...) printf("TPMD: %s:%d: Debug: " fmt "\n", \
--                        __FILE__, __LINE__, ## __VA_ARGS__)
-+#define debug(fmt, ...) printf("TPMD[%d]: %s:%d: Debug: " fmt "\n", \
-+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define debug_nostop(fmt, ...) printf("TPMD[%d]: %s:%d: Debug: " fmt, \
-+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define debug_more(fmt, ...) printf( fmt, ## __VA_ARGS__ )
- #else
- #define debug(fmt, ...) 
-+#define debug_nostop(fmt, ...) 
-+#define debug_more(fmt, ...)
- #endif
--#define info(fmt, ...)  printf("TPMD: %s:%d: Info: " fmt "\n", \
--                        __FILE__, __LINE__, ## __VA_ARGS__)
--#define error(fmt, ...) printf("TPMD: %s:%d: Error: " fmt "\n", \
--                        __FILE__, __LINE__, ## __VA_ARGS__)
--#define alert(fmt, ...) printf("TPMD: %s:%d: Alert: " fmt "\n", \
--                        __FILE__, __LINE__, ## __VA_ARGS__)
-+#define info(fmt, ...)  printf("TPMD[%d]: %s:%d: Info: " fmt "\n", \
-+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define error(fmt, ...) printf("TPMD[%d]: %s:%d: Error: " fmt "\n", \
-+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define alert(fmt, ...) printf("TPMD[%d]: %s:%d: Alert: " fmt "\n", \
-+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
- 
- /* memory allocation */
- 
-diff -uprN tpm_emulator/Makefile vtpm/Makefile
---- tpm_emulator/Makefile	2006-12-08 12:51:29.000000000 -0800
-+++ vtpm/Makefile	2006-12-13 16:38:52.000000000 -0800
-@@ -7,7 +7,7 @@
- COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
- 
- # module settings
--BIN            := tpm_emulator
-+BIN            := vtpmd
- VERSION_MAJOR  := 0
- VERSION_MINOR  := 4
- VERSION_BUILD  := $(shell date +"%s")
-@@ -22,7 +22,7 @@ TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin
- 
- CC      := gcc
- CFLAGS  += -g -Wall $(INCLUDE) -DDEBUG
--CFLAGS  += -I. -Itpm
-+CFLAGS  += -I. -Itpm -I../../vtpm_manager/manager
- 
- # Is the simulator running in it's own vm?
- #CFLAGS += -DVTPM_MULTI_VM
-@@ -62,7 +62,6 @@ $(BIN):	$(src)/crypto/gmp.h $(src)/crypt
- 
- install: $(BIN)
- 	$(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)
--	@if [ ! -d "/var/tpm" ]; then mkdir /var/tpm; fi
- 
- clean:
- 	rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a $(OBJS)
-@@ -98,3 +97,4 @@ version:
- 	@echo "#endif /* _TPM_VERSION_H_ */" >> $(src)/tpm_version.h
- 
- .PHONY: all install clean dist gmp version
-+
-diff -uprN tpm_emulator/tpm/tpm_capability.c vtpm/tpm/tpm_capability.c
---- tpm_emulator/tpm/tpm_capability.c	2006-06-23 03:37:07.000000000 -0700
-+++ vtpm/tpm/tpm_capability.c	2007-01-10 10:00:49.000000000 -0800
-@@ -136,8 +136,18 @@ static TPM_RESULT cap_property(UINT32 su
- 
-     case TPM_CAP_PROP_TIS_TIMEOUT:
-       debug("[TPM_CAP_PROP_TIS_TIMEOUT]");
--      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT */
--      return TPM_FAIL;
-+      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT: Measure these values and determine correct ones */
-+      UINT32 len = *respSize = 16;
-+      BYTE *ptr = *resp = tpm_malloc(*respSize);
-+      if (ptr == NULL || 
-+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
-+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
-+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
-+          tpm_marshal_UINT32(&ptr, &len, 200000)) {
-+        tpm_free(*resp);
-+        return TPM_FAIL;
-+      }
-+      return TPM_SUCCESS;
- 
-     case TPM_CAP_PROP_STARTUP_EFFECT:
-       debug("[TPM_CAP_PROP_STARTUP_EFFECT]");
-@@ -190,7 +200,11 @@ static TPM_RESULT cap_property(UINT32 su
- 
-     case TPM_CAP_PROP_DURATION:
-       debug("[TPM_CAP_PROP_DURATION]");
--      /* TODO: TPM_CAP_PROP_DURATION */
-+      /* TODO: TPM_CAP_PROP_DURATION: Measure these values and return accurate ones */
-+      BYTE dur[]= {0x0,0x0,0x0,0xc,0x0,0x7,0xa1,0x20,0x0,0x1e,0x84,0x80,0x11,0xe1,0xa3,0x0}; 
-+      *respSize = 16;
-+      *resp = tpm_malloc(*respSize);
-+      memcpy(*resp,dur,16); 
-       return TPM_FAIL;
- 
-     case TPM_CAP_PROP_ACTIVE_COUNTER:
-diff -uprN tpm_emulator/tpm/tpm_cmd_handler.c vtpm/tpm/tpm_cmd_handler.c
---- tpm_emulator/tpm/tpm_cmd_handler.c	2008-02-27 16:35:41.000000000 -0500
-+++ vtpm/tpm/tpm_cmd_handler.c	2008-02-28 14:43:28.000000000 -0500
-@@ -94,12 +94,18 @@ void tpm_compute_out_param_digest(TPM_CO
-   sha1_ctx_t sha1;
-   UINT32 res = CPU_TO_BE32(rsp->result);
-   UINT32 ord = CPU_TO_BE32(ordinal);
-+  UINT32 offset = 0;
- 
-   /* compute SHA1 hash */
-   sha1_init(&sha1);
-   sha1_update(&sha1, (BYTE*)&res, 4);
-   sha1_update(&sha1, (BYTE*)&ord, 4);
--  sha1_update(&sha1, rsp->param, rsp->paramSize);
-+  if (ordinal == TPM_ORD_LoadKey2) {
-+      offset = 4;
-+  }
-+  if (rsp->paramSize - offset > 0) {
-+      sha1_update(&sha1, rsp->param + offset, rsp->paramSize - offset);
-+  }
-   sha1_final(&sha1, rsp->auth1->digest);
-   if (rsp->auth2 != NULL) memcpy(rsp->auth2->digest, 
-     rsp->auth1->digest, sizeof(rsp->auth1->digest));
-diff -uprN tpm_emulator/tpm/tpm_data.c vtpm/tpm/tpm_data.c
---- tpm_emulator/tpm/tpm_data.c	2008-02-27 16:35:41.000000000 -0500
-+++ vtpm/tpm/tpm_data.c	2008-02-27 16:35:40.000000000 -0500
-@@ -1,6 +1,7 @@
- /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
-  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-  *                    Swiss Federal Institute of Technology (ETH) Zurich
-+ * Copyright (C) 2005 INTEL Corp
-  *
-  * This module is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published
-@@ -15,10 +16,15 @@
-  * $Id: tpm_data.c 98 2006-05-07 14:16:29Z hstamer $
-  */
- 
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+#include <fcntl.h>
-+#include <unistd.h>
-+
- #include "tpm_emulator.h"
- #include "tpm_structures.h"
- #include "tpm_marshalling.h"
--#include "linux_module.h"
-+#include "vtpm_manager.h"
- 
- TPM_DATA tpmData;
- 
-@@ -158,45 +164,232 @@ void tpm_release_data(void)
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
--#include <unistd.h>
- 
--#define TPM_STORAGE_FILE "/var/tpm/tpm_emulator-1.2." STR(VERSION_MAJOR) "." STR(VERSION_MINOR) 
-+ static int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
-+
-+#ifdef VTPM_MUTLI_VM
-+ #define DEV_FE "/dev/tpm"
-+#else
-+ #define VTPM_RX_FIFO_D  "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
-+ #define VTPM_TX_FIFO  "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
-+
-+ extern int dmi_id;
-+ static char *vtpm_rx_name=NULL; 
-+#endif
- 
- static int write_to_file(uint8_t *data, size_t data_length)
- {
--  int res;
--  int fp;
--  fp = open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
--  res = write(fp, data, data_length);
--  close(fp);
--  return (res == data_length) ? 0 : -1;
-+  int res, out_data_size, in_header_size;
-+  BYTE *ptr, *out_data, *in_header;
-+  UINT32 result, len, in_rsp_size;
-+  UINT16 tag = VTPM_TAG_REQ;
-+	
-+  printf("Saving NVM\n");
-+  if (vtpm_tx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
-+#else
-+	vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
-+#endif
-+  }
-+
-+  if (vtpm_tx_fh < 0) {
-+		return -1;
-+  }
-+ 
-+  // Send request to VTPM Manager to encrypt data
-+#ifdef VTPM_MUTLI_VM
-+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT + data_length;
-+#else
-+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV + data_length;
-+#endif
-+  
-+  out_data = ptr = (BYTE *) malloc(len);
-+
-+  if (ptr == NULL
-+#ifndef VTPM_MUTLI_VM
-+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
-+#endif
-+	  || tpm_marshal_UINT16(&ptr, &len, tag)
-+#ifdef VTPM_MUTLI_VM
-+	  || tpm_marshal_UINT32(&ptr, &len, out_data_size)
-+#else
-+	  || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
-+#endif  
-+	  || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_SAVENVM)
-+	  || tpm_marshal_BYTE_ARRAY(&ptr, &len, data, data_length)) {
-+	free(out_data);
-+	return -1;
-+  }
-+  
-+  printf("\tSending SaveNVM Command.\n");
-+  res = write(vtpm_tx_fh, out_data, out_data_size);
-+  free(out_data);
-+  if (res != out_data_size) return -1;
-+
-+  if (vtpm_rx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+    vtpm_rx_fh = vtpm_tx_fh
-+#else
-+    if (vtpm_rx_name == NULL) {
-+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
-+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
-+    }
-+	vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
-+#endif
-+  }
-+
-+  if (vtpm_rx_fh < 0) {
-+		return -1;
-+  }
-+  
-+  // Read Header of response so we can get the size & status
-+#ifdef VTPM_MUTLI_VM
-+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
-+#else
-+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
-+#endif
-+  in_header = ptr = malloc(in_header_size);
-+  
-+  printf("\tReading SaveNVM header.\n");
-+  res = read(vtpm_rx_fh, in_header, in_header_size);
-+
-+  if ( (res != in_header_size)
-+#ifndef VTPM_MUTLI_VM
-+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
-+#endif
-+	   || tpm_unmarshal_UINT16(&ptr, &len, &tag)
-+	   || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
-+	   || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
-+	  free(in_header);
-+	  return -1;
-+  }
-+  free(in_header);
-+  
-+  if (result != VTPM_SUCCESS) {
-+      return -1;  
-+  }
-+
-+#ifdef VTPM_MUTLI_VM
-+  close(vtpm_tx_fh); close(vtpm_rx_fh);
-+#endif
-+	  
-+  printf("\tFinishing up SaveNVM\n");
-+  return (0);
- }
- 
- static int read_from_file(uint8_t **data, size_t *data_length)
- {
--  int res;
--  int fp, file_status;
--  struct stat file_info;
--  fp = open(TPM_STORAGE_FILE, O_RDONLY, 0);
--  file_status = fstat(fp, &file_info);
--  if (file_status < 0) {
--    close(fp);
--    return -1;
--  } 
-+  int res, out_data_size, in_header_size;
-+  uint8_t *ptr, *out_data, *in_header;
-+  UINT16 tag = VTPM_TAG_REQ;
-+  UINT32 len, in_rsp_size, result;
-+#ifdef VTPM_MUTLI_VM
-+	int vtpm_rx_fh, vtpm_tx_fh;
-+#endif
-+	
-+  printf("Loading NVM.\n");
-+  if (vtpm_tx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
-+#else
-+	vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
-+#endif
-+  }
- 
--  *data_length = file_info.st_size; 
--  *data = tpm_malloc(*data_length);
--  if (*data == NULL) {
--    close(fp);
-+  if (vtpm_tx_fh < 0) {
-+		return -1;
-+  }
-+ 
-+  // Send request to VTPM Manager to encrypt data
-+#ifdef VTPM_MUTLI_VM
-+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
-+#else
-+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
-+#endif
-+  out_data = ptr = (BYTE *) malloc(len);
-+
-+  if (ptr == NULL
-+#ifndef VTPM_MUTLI_VM
-+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
-+#endif  
-+      || tpm_marshal_UINT16(&ptr, &len, tag)
-+#ifdef VTPM_MUTLI_VM
-+      || tpm_marshal_UINT32(&ptr, &len, out_data_size)
-+#else
-+      || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
-+#endif
-+      || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_LOADNVM)) {
-+    free(out_data);
-     return -1;
-   }
--  res = read(fp, *data, *data_length);
--  close(fp);
-+
-+  printf("\tSending LoadNVM command\n");
-+  res = write(vtpm_tx_fh, out_data, out_data_size);
-+  free(out_data);
-+  if (res != out_data_size) return -1;
-+
-+    if (vtpm_rx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+    vtpm_rx_fh = vtpm_tx_fh;
-+#else
-+    if (vtpm_rx_name == NULL) {
-+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
-+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
-+    }
-+	vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
-+#endif
-+  }
-+
-+  if (vtpm_rx_fh < 0) {
-+		return -1;
-+  }
-+  
-+  // Read Header of response so we can get the size & status
-+#ifdef VTPM_MUTLI_VM
-+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
-+#else
-+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
-+#endif
-+  in_header = ptr = malloc(in_header_size);
-+  
-+  printf("\tReading LoadNVM header\n");
-+  res = read(vtpm_rx_fh, in_header, in_header_size);
-+
-+  if ( (res != in_header_size)
-+#ifndef VTPM_MUTLI_VM
-+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
-+#endif
-+       || tpm_unmarshal_UINT16(&ptr, &len, &tag)
-+       || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
-+       || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
-+      free(in_header);
-+      return -1;
-+  }
-+  free(in_header);
-+  
-+  if (result != VTPM_SUCCESS) {
-+      return -1;  
-+  }
-+
-+  // Read Encrypted data from VTPM Manager
-+  *data_length = in_rsp_size - VTPM_COMMAND_HEADER_SIZE_CLT;
-+  *data = (uint8_t *) malloc(*data_length);
-+
-+  printf("\tReading clear data from LoadNVM.\n");
-+  res = read(vtpm_rx_fh, *data, *data_length);
-+#ifdef VTPM_MUTLI_VM
-+  close(vtpm_rx_fh);close(vtpm_tx_fh);
-+#endif 
-+	
-+  printf("\tReturing from loading NVM\n");
-   if (res != *data_length) {
--    tpm_free(*data);
--    return -1;
-+      free(*data);
-+      return -1;
-+  } else {
-+      return 0;
-   }
--  return 0;
-+
- }
- 
- #else
-diff -uprN tpm_emulator/tpmd.c vtpm/tpmd.c
---- tpm_emulator/tpmd.c	2006-12-08 12:51:29.000000000 -0800
-+++ vtpm/tpmd.c	2007-01-09 14:48:56.000000000 -0800
-@@ -21,12 +21,24 @@
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <sys/time.h>
-+#include <sys/socket.h>
-+#include <sys/un.h>
-+#include <errno.h>
- 
- #include "tpm_emulator.h"
-+#include "vtpm_manager.h"
- 
--#define TPM_RX_FNAME "/var/tpm/tpm_in.fifo"
--#define TPM_TX_FNAME "/var/tpm/tpm_out.fifo"
-+#ifdef VTPM_MULTI_VM
-+ #define DEV_BE "/dev/vtpm"
-+#else
-+ #define PVM_RX_FIFO_D "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
-+ #define PVM_TX_FIFO "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
- 
-+ #define HVM_RX_FIFO_D "/var/vtpm/socks/%d.socket"
-+#endif
-+
-+ int dmi_id;
-+						
- #define BUFFER_SIZE 2048
- 
- static int devurandom=0;
-@@ -38,7 +50,7 @@ void get_random_bytes(void *buf, int nby
-   }
- 
-   if (read(devurandom, buf, nbytes) != nbytes) {
--      printf("Can't get random number.\n");
-+      error("Can't get random number.\n");
-       exit(-1);
-   }
- }
-@@ -52,105 +64,182 @@ uint64_t tpm_get_ticks(void)
- 
- int main(int argc, char **argv)
- {
--  uint8_t in[BUFFER_SIZE], *out;
-+  uint8_t type, in[BUFFER_SIZE], *out, *addressed_out;
-+  char *vtpm_rx_file=NULL;
-   uint32_t out_size;
-   int in_size, written;
--  int i;
--  struct stat file_info;
-+  int i, guest_id=-1;
- 
--  int tpm_tx_fh=-1, tpm_rx_fh=-1;
-+#ifndef VTPM_MULTI_VM
-+  int sockfd = -1;
-+  struct sockaddr_un addr;
-+  struct sockaddr_un client_addr;
-+  unsigned int client_length;
-+
-+#endif
-+ 
-+  int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
-+#ifdef VTPM_MULTI_VM
-   if (argc < 2) {
--    printf("Usage: tpmd clear|save|deactivated\n" );
-+    error("Usage: tpmd clear|save|deactivated\n" );
-+#else
-+  if (argc < 4) {
-+    error("Usage: tpmd clear|save|deactivated pvm|hvm vtpmid\n" );
-+#endif
- 	  return -1;
-   }
- 
-+#ifndef VTPM_MULTI_VM
-+  /* setup type of vm */
-+  if (!strcmp(argv[2], "pvm")) {
-+    type = VTPM_TYPE_PVM; // Get commands from vTPM Manager through fifo
-+  } else if (!strcmp(argv[2], "hvm")) {
-+    type = VTPM_TYPE_HVM; // Get commands from qemu via socket
-+  } else {
-+    error("invalid vTPM type '%s'.\n", argv[2]);
-+  }
-+
-+  dmi_id = atoi(argv[3]);
-+
-+  if (type == VTPM_TYPE_PVM) {
-+    vtpm_rx_file = malloc(10 + strlen(PVM_RX_FIFO_D));
-+    sprintf(vtpm_rx_file, PVM_RX_FIFO_D, (uint32_t) dmi_id);
-+  } else {
-+    vtpm_rx_file = malloc(10 + strlen(HVM_RX_FIFO_D));
-+    sprintf(vtpm_rx_file, HVM_RX_FIFO_D, (uint32_t) dmi_id);
-+
-+    if ( (sockfd = socket(PF_UNIX,SOCK_STREAM,0)) < 0) {
-+          error("Unable to create socket. errno = %d\n", errno);
-+      exit (-1);
-+    }
-+
-+    memset(&addr, 0, sizeof(addr));
-+    addr.sun_family = AF_UNIX;
-+    strcpy(addr.sun_path,vtpm_rx_file );
-+    unlink(addr.sun_path);
-+  }
-+#endif
-+
-+#ifdef VTPM_MULTI_VM
-+  info("Initializing tpm state: %s\n", argv[1]);
-+#else
-+  info("Initializing tpm state: %s, type: %s, id: %d\n", argv[1], argv[2], dmi_id);
-+#endif
-+
-   /* initialize TPM emulator */
-   if (!strcmp(argv[1], "clear")) {
--    printf("Initializing tpm: %s\n", argv[1]);
-     tpm_emulator_init(1);
--  } else if (!strcmp(argv[1], "save")) { 
--    printf("Initializing tpm: %s\n", argv[1]);
-+  } else if (!strcmp(argv[1], "save")) {
-     tpm_emulator_init(2);
-   } else if (!strcmp(argv[1], "deactivated")) {
--    printf("Initializing tpm: %s\n", argv[1]);
-     tpm_emulator_init(3);
-   } else {
--    printf("invalid startup mode '%s'; must be 'clear', "
-+    error("invalid startup mode '%s'; must be 'clear', "
-       "'save' (default) or 'deactivated", argv[1]);
-     return -1;
-   }
--
--  if ( stat(TPM_RX_FNAME, &file_info) == -1) {
--    if ( mkfifo(TPM_RX_FNAME, S_IWUSR | S_IRUSR ) ) {
--      printf("Failed to create fifo %s.\n", TPM_RX_FNAME);
--      return -1;
--    }
--  }
--
--  if ( stat(TPM_TX_FNAME, &file_info) == -1) {
--    if ( mkfifo(TPM_TX_FNAME, S_IWUSR | S_IRUSR ) ) {
--      printf("Failed to create fifo %s.\n", TPM_TX_FNAME);
--      return -1;
--    }
--  }
--
-+  
-   while (1) {
- abort_command:
--    if (tpm_rx_fh < 0) {
--      tpm_rx_fh = open(TPM_RX_FNAME, O_RDONLY);
-+    if (vtpm_rx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+      vtpm_rx_fh = open(DEV_BE, O_RDWR);
-+#else
-+      if (type == VTPM_TYPE_PVM) {
-+        vtpm_rx_fh = open(vtpm_rx_file, O_RDONLY);
-+      } else {
-+        if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
-+          error("Unable to bind(). errno = %d\n", errno);
-+          exit (-1);
-+        }
-+
-+        if (listen(sockfd, 10) <0) {
-+          error("Unable to listen(). errno = %d\n", errno);
-+          exit (-1);
-+        }
-+
-+        memset(&client_addr, 0, sizeof(client_addr));
-+        client_length = sizeof(client_addr);
-+
-+        vtpm_rx_fh = vtpm_tx_fh = accept(sockfd, (struct sockaddr *)&client_addr, &client_length);
-+      }
-+#endif
-     }
-     
--    if (tpm_rx_fh < 0) {
--      printf("ERROR: failed to open devices to listen to guest.\n");
-+    if (vtpm_rx_fh < 0) {
-+      error("Failed to open devices to listen to guest.\n");
-       return -1;
-     }
-     
--    if (tpm_tx_fh < 0) {
--      tpm_tx_fh = open(TPM_TX_FNAME, O_WRONLY);
--    }
--
--    if (tpm_tx_fh < 0) {
--      printf("ERROR: failed to open devices to respond to guest.\n");
--      return -1;
--    }
--
--    in_size = read(tpm_rx_fh, in, BUFFER_SIZE);
-+    in_size = read(vtpm_rx_fh, in, BUFFER_SIZE);
-     if (in_size < 6) { // Magic size of minium TPM command
--      printf("Recv[%d] to small: 0x", in_size);
-+      info("Recv incomplete command of %d bytes.", in_size);
-       if (in_size <= 0) {
--          close(tpm_rx_fh);
--          tpm_rx_fh = -1;
-+          close(vtpm_rx_fh);
-+          vtpm_rx_fh = -1;
-           goto abort_command;
-       }
-     } else { 
--      printf("Recv[%d]: 0x", in_size);
-+      debug_nostop("Recv[%d]: 0x", in_size);
-       for (i=0; i< in_size; i++) 
--        printf("%x ", in[i]);
--      printf("\n");
-+        debug_more("%x ", in[i]);
-+      debug_more("\n");
-     }
- 
--    
--    if (tpm_handle_command(in, in_size, &out, &out_size) != 0) { 
--        printf("ERROR: Handler Failed.\n");
-+    if (guest_id == -1) {
-+        guest_id = *((uint32_t *) in);
-+    } else {
-+        if (guest_id != *((uint32_t *) in) ) {
-+            error("WARNING: More than one guest attached\n");
-+        }
-+    }
-+
-+    if (vtpm_tx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+      vtpm_tx_fh = open(DEV_BE, O_RDWR);
-+      vtpm_rx_fh = vtpm_tx_fh;
-+#else
-+      if (type == VTPM_TYPE_PVM) {
-+        vtpm_tx_fh = open(PVM_TX_FIFO, O_WRONLY);
-+      } // No need to open the other direction for HVM
-+#endif
-+    }
-+
-+    if (vtpm_tx_fh < 0) {
-+      error("Failed to open devices to respond to guest.\n");
-+      return -1;
-+    }
-+
-+    // Handle the command, but skip the domain id header    
-+    if (tpm_handle_command(in + sizeof(uint32_t), in_size - sizeof(uint32_t), &out, &out_size) != 0) { 
-+      error("Handler Failed.\n");
-     }
- 
--    written = write(tpm_tx_fh, out, out_size);
-+    addressed_out = (uint8_t *) tpm_malloc(sizeof(uint32_t) + out_size);
-+    *(uint32_t *) addressed_out = *(uint32_t *) in;
-+    memcpy(addressed_out + sizeof(uint32_t), out, out_size);
-+
-+    written = write(vtpm_tx_fh, addressed_out, out_size + sizeof(uint32_t));
- 
--    if (written != out_size ) {
--      printf("ERROR: Part of response not written %d/%d.\nAttempt: ", written, out_size);
-+    if (written != out_size + sizeof(uint32_t)) {
-+      error("Part of response not written %d/%d.\n", written, out_size);
-     } else {
--      printf("Sent[%Zu]: ", out_size);
-+      debug_nostop("Sent[%Zu]: ", out_size + sizeof(uint32_t));
-+      for (i=0; i< out_size+ sizeof(uint32_t); i++)
-+        debug_more("%x ", addressed_out[i]);
-+      debug_more("\n");
-     }
--    for (i=0; i< out_size; i++)
--      printf("%x ", out[i]);
--    printf("\n");
-     tpm_free(out);
-+    tpm_free(addressed_out);
- 
-   } // loop
- 
-   tpm_emulator_shutdown();
- 
--  close(tpm_tx_fh);
--  close(tpm_rx_fh);
-+  close(vtpm_tx_fh);
-+#ifndef VTPM_MUTLI_VM
-+  close(vtpm_rx_fh);
-+  free (vtpm_rx_file);
-+#endif
- 
- }
diff --git a/tools/vtpm_manager/COPYING b/tools/vtpm_manager/COPYING
deleted file mode 100644
index c4b86b7..0000000
--- a/tools/vtpm_manager/COPYING
+++ /dev/null
@@ -1,32 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
diff --git a/tools/vtpm_manager/Makefile b/tools/vtpm_manager/Makefile
deleted file mode 100644
index 632f41b..0000000
--- a/tools/vtpm_manager/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-XEN_ROOT = $(CURDIR)/../..
-
-# Base definitions and rules
-include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
-
-SUBDIRS		= crypto tcs util manager migration
-OPENSSL_HEADER	= /usr/include/openssl/crypto.h
-
-.PHONY: all clean install
-all clean install: %: subdirs-%
-
-.PHONY: mrproper
-mrproper:
-	@set -e; for subdir in $(SUBDIRS); do \
-		$(MAKE) -C $$subdir $@; \
-	done
-
-
diff --git a/tools/vtpm_manager/README b/tools/vtpm_manager/README
deleted file mode 100644
index f0d1e98..0000000
--- a/tools/vtpm_manager/README
+++ /dev/null
@@ -1,94 +0,0 @@
-// ===================================================================
-//
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above
-//     copyright notice, this list of conditions and the following
-//     disclaimer in the documentation and/or other materials provided
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-
-Directory Structure
-===================
-tools/vtpm_manager/crypto    -> crypto files
-tools/vtpm_manager/TCS       -> TCS implementation
-tools/vtpm_manager/util      -> Utility Library. Include disk-io and buffers.
-tools/vtpm_manager/manager   -> VTPM Manager
-
-Compile Flags
-===================
-LOGGING_MODULES              -> How extensive logging happens
-                                see util/log.h for more info
-
-VTPM_MULTI_VM                -> Defined: VTPMs run in their own VMs
-                                Not Defined (default): VTPMs are processes
-
-# Debugging flags that may disappear without notice in the future
-
-DUMMY_BACKEND                -> vtpm_manager listens on /tmp/in.fifo and 
-                                /tmp/out.fifo rather than backend
-
-MANUAL_DM_LAUNCH             -> Must manually launch & kill VTPMs
-
-WELL_KNOWN_OWNER_AUTH        -> Rather than randomly generating the password for the owner,
-                                use a well known value. This is useful for debugging and for
-                                poor bios which do not support clearing TPM if OwnerAuth is
-                                lost. However this has no protection from malicious app
-                                issuing a TPM_OwnerClear to wipe the TPM 
-
-Requirements
-============
-- xen-unstable 
-- vtpm frontend/backend driver patch
-- OpenSSL Library
-
-Single-VM Flow
-============================
-- Launch the VTPM manager (vtpm_managerd) which which begins listening to the BE with one thread
-  and listens to a named fifo that is shared by the vtpms to commuincate with the manager.
-- VTPM Manager listens to TPM BE.
-- When xend launches a tpm frontend equipped VM it contacts the manager over the vtpm backend. 
-- When the manager receives the open message from the BE, it launches a vtpm
-- Xend allows the VM to continue booting. 
-- When a TPM request is issued to the front end, the front end transmits the TPM request to the backend.
-- The manager receives the TPM requests and uses a named fifo to forward the request to the vtpm.
-- The fifo listener begins listening for the reply from vtpm for the request.
-- Vtpm processes request and replies to manager over shared named fifo.
-- If needed, the vtpm may send a request to the vtpm_manager at any time to save it's secrets to disk.
-- Manager receives response from vtpm and passes it back to backend for forwarding to guest.
-
-NOTES:
-* SaveService SHOULD seal it's table before saving it to disk. However,
-  the current Xen infrastructure does not provide a mechanism for this to be
-  unsealed later. Specifically, the auth and wrapped key must be available ONLY
-  to the service, or it's not even worth encrypting
-
-  In the future the vtpm manager will be protected by an early boot mechanism
-  that will allow for better protection of it's data.
-
-TODO:
-- Timeout on crashed vtpms
-- create lock for shared fifo for talking to vtpms.
diff --git a/tools/vtpm_manager/Rules.mk b/tools/vtpm_manager/Rules.mk
deleted file mode 100644
index 651772b..0000000
--- a/tools/vtpm_manager/Rules.mk
+++ /dev/null
@@ -1,59 +0,0 @@
-# Base definitions and rules (XEN_ROOT must be defined in including Makefile)
-include $(XEN_ROOT)/tools/Rules.mk
-
-#
-# Tool definitions
-#
-
-# General compiler flags
-CFLAGS	= -Werror -g3
-
-# Generic project files
-HDRS	= $(wildcard *.h)
-SRCS	= $(wildcard *.c)
-OBJS	= $(patsubst %.c,%.o,$(SRCS))
-
-# Generic (non-header) dependencies
-$(SRCS): Makefile $(XEN_ROOT)/tools/Rules.mk $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
-
-$(OBJS): $(SRCS)
-
--include $(FILES)
-
-# Make sure these are just rules
-.PHONY : all build install clean
-
-#
-# Project-specific definitions
-#
-
-# Need UNIX98 spec for pthread rwlocks
-CFLAGS += -D_GNU_SOURCE
-
-# Logging Level. See utils/tools.h for usage
-CFLAGS += -DLOGGING_MODULES="(BITMASK(VTPM_LOG_TCS)|BITMASK(VTPM_LOG_VTSP)|BITMASK(VTPM_LOG_VTPM))"
-
-# Silent Mode
-#CFLAGS += -DLOGGING_MODULES=0x0
-#CFLAGS += -DLOGGING_MODULES=0xff
-
-# Use frontend/backend pairs between manager & DMs?
-#CFLAGS += -DVTPM_MULTI_VM
-
-# vtpm_manager listens on fifo's rather than backend
-#CFLAGS += -DDUMMY_BACKEND
-
-# TCS talks to fifo's rather than /dev/tpm. TPM Emulator assumed on fifos
-#CFLAGS += -DDUMMY_TPM
-
-# Do not have manager launch DMs.
-#CFLAGS += -DMANUAL_DM_LAUNCH
-
-# Fixed OwnerAuth
-#CFLAGS += -DWELL_KNOWN_OWNER_AUTH
-
-# Include
-CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/crypto
-CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/util
-CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/tcs
-CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/manager
diff --git a/tools/vtpm_manager/crypto/Makefile b/tools/vtpm_manager/crypto/Makefile
deleted file mode 100644
index 13b61c9..0000000
--- a/tools/vtpm_manager/crypto/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-XEN_ROOT = $(CURDIR)/../../..
-include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
-
-BIN		= libtcpaCrypto.a
-
-.PHONY: all
-all: build
-
-.PHONY: build
-build: $(BIN)
-
-.PHONY: install
-install: build
-
-.PHONY: clean
-clean:
-	rm -f *.a *.so *.o *.rpm $(DEP_FILES)
-
-.PHONY: mrproper
-mrproper: clean
-	rm -f *~
-
-$(BIN): $(OBJS)
-	$(AR) rcs $(BIN) $(OBJS)
diff --git a/tools/vtpm_manager/crypto/crypto.c b/tools/vtpm_manager/crypto/crypto.c
deleted file mode 100644
index 7dae655..0000000
--- a/tools/vtpm_manager/crypto/crypto.c
+++ /dev/null
@@ -1,88 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// crypto.c
-// 
-//  This file will handle all the TPM Crypto functionality
-// 
-// ==================================================================
-
-#include <string.h>
-#include <openssl/crypto.h>
-#include <openssl/err.h>
-#include <openssl/evp.h>
-#include <openssl/rand.h>
-#include "crypto.h"
-#include "log.h"
-
-/**
- * Initialize cryptography library
- * @rand: random seed
- * @size: size of @rand
- */
-void Crypto_Init(const BYTE* rand, int size) {
-	ERR_load_crypto_strings();
-  CRYPTO_malloc_init();
-  OpenSSL_add_all_algorithms();
-  SYM_CIPHER = EVP_aes_128_cbc();
-  RAND_poll();
-  if (rand == NULL)
-    return;
-
-  RAND_add(rand, size, size);
-}
-
-/**
- * Shutdown cryptography library
- */
-void Crypto_Exit() {
-  ERR_free_strings();
-  ERR_remove_state(0);
-  EVP_cleanup();
-}
-
-
-/**
- * Get random data
- * @data: (OUT) Random data
- * @size: Size of @data
- */
-void Crypto_GetRandom(void* data, int size) {
-  int result;
-  
-  result = RAND_pseudo_bytes((BYTE*) data, size);
-  
-  if (result <= 0) 
-    vtpmlogerror (VTPM_LOG_CRYPTO, "RAND_pseudo_bytes failed: %s\n",
-	     ERR_error_string (ERR_get_error(), NULL));
-}
diff --git a/tools/vtpm_manager/crypto/crypto.h b/tools/vtpm_manager/crypto/crypto.h
deleted file mode 100644
index 488d4d6..0000000
--- a/tools/vtpm_manager/crypto/crypto.h
+++ /dev/null
@@ -1,175 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// crypto.h
-// 
-//  This file defines the TPM Crypto API
-//
-// ==================================================================
-
-#ifndef __CRYPTO_H__
-#define __CRYPTO_H__
-
-#include <stddef.h>
-#include <stdint.h>
-#include <stdbool.h>
-
-#include "tcg.h"
-#include "sym_crypto.h"
-
-#define CRYPTO_MAX_SIG_SIZE (2048 / 8)
-#define CRYPTO_MAX_RSA_KEY_SIZE (4096 / 8) //in bytes
-
-#define OAEP_P "TCPA"
-#define OAEP_P_SIZE 4
-
-// Algorithms supported by crypto. Stored in CRYPTO_INFO.algorithmID
-#define CRYPTO_ALGORITH_RSA 0x01
-
-// Supported Encryption Schemes CRYPTO_INFO.encScheme
-#define CRYPTO_ES_NONE 0x0001
-#define CRYPTO_ES_RSAESPKCSv15 0x0002
-#define CRYPTO_ES_RSAESOAEP_SHA1_MGF1 0x0003
-
-// Supported Signature schemes CRYPTO_INFO.sigScheme
-#define CRYPTO_SS_NONE 0x0001
-#define CRYPTO_SS_RSASSAPKCS1v15_SHA1 0x0002
-#define CRYPTO_SS_RSASSAPKCS1v15_DER 0x0003
-
-typedef struct CRYPTO_INFO {
-  void *keyInfo;
-  UINT32 algorithmID;
-  UINT32 encScheme;
-  UINT32 sigScheme;
-} CRYPTO_INFO;
-
-
-void Crypto_Init(const BYTE* rand, int size);
-
-void Crypto_Exit();
-
-void Crypto_GetRandom(void* data, int size);
-
-void Crypto_HMAC(   const BYTE* text, 
-                    int text_len, 
-                    const BYTE* key, 
-                    int key_len,
-                    BYTE* digest);
-
-TPM_RESULT Crypto_HMAC_buf (const buffer_t * text,
-                            const buffer_t * key,
-                            BYTE * o_digest); /* presumably of 20 bytes */
-    
-void Crypto_SHA1Full(   const BYTE* text, 
-                        UINT32 size,
-                        BYTE* hash); //Complete 3part SHA1
-
-// o_hash needs to be large enough to hold the digest, ie 20 bytes
-TPM_RESULT Crypto_SHA1Full_buf (const buffer_t * buf,
-                                BYTE * o_hash);
-    
-void Crypto_SHA1Start(UINT32* maxNumBytes);
-void Crypto_SHA1Update(int numBytes, const BYTE* hashData);
-void Crypto_SHA1Complete(   int hashDataSize, 
-                            const BYTE* hashData, 
-                            BYTE* hashValue);
-
-void Crypto_RSACreateKey(   /*in*/ UINT32 keySize,
-                            /*in*/ UINT32 pubExpSize, 
-                            /*in*/ BYTE *pubExp,
-                            /*out*/ UINT32 *privExpSize, 
-                            /*out*/ BYTE *privExp,
-                            /*out*/ UINT32 *modulusSize,
-                            /*out*/ BYTE *modulus,
-                            /*out*/ CRYPTO_INFO *keys);
-                            
-void Crypto_RSABuildCryptoInfo( /*[IN]*/ UINT32 pubExpSize, 
-                                /*[IN]*/ BYTE *pubExp,
-                                /*[IN]*/ UINT32 privExpSize, 
-                                /*[IN]*/ BYTE *privExp,
-                                /*[IN]*/ UINT32 modulusSize, 
-                                /*[IN]*/ BYTE *modulus, 
-                                /*[OUT]*/ CRYPTO_INFO* cryptoInfo);
-                                
-void Crypto_RSABuildCryptoInfoPublic(   /*[IN]*/ UINT32 pubExpSize, 
-                                        /*[IN]*/ BYTE *pubExp,
-                                        /*[IN]*/ UINT32 modulusSize, 
-                                        /*[IN]*/ BYTE *modulus, 
-                                        CRYPTO_INFO* cryptoInfo);
-
-//
-// symmetric pack and unpack operations
-//
-TPM_RESULT Crypto_RSAPackCryptoInfo (const CRYPTO_INFO* cryptoInfo,
-                                     BYTE ** io_buf, UINT32 * io_buflen);
-
-TPM_RESULT Crypto_RSAUnpackCryptoInfo (CRYPTO_INFO * ci,
-                                       BYTE * in, UINT32 len,
-                                       UINT32 * o_lenread);
-
-                             
-// return 0 on success, -1 on error
-int Crypto_RSAEnc(  CRYPTO_INFO *keys,
-                    UINT32 inDataSize,
-                    BYTE *inData,
-                    /*out*/ UINT32 *outDataSize,
-                    /*out*/ BYTE *outData);
-
-// return 0 on success, -1 on error
-int Crypto_RSADec(  CRYPTO_INFO *keys,
-                    UINT32 inDataSize,
-                    BYTE *inData,
-                    /*out*/ UINT32 *outDataSize,
-                    /*out*/ BYTE *outData);
-
-// return 0 on success, -1 on error
-int Crypto_RSASign( CRYPTO_INFO *keys,
-                    UINT32 inDataSize,
-                    BYTE *inData,
-                    /*out*/ UINT32 *sigSize,
-                    /*out*/ BYTE *sig);
-
-bool Crypto_RSAVerify(  CRYPTO_INFO *keys,
-                        UINT32 inDataSize,
-                        BYTE *inData,
-                        UINT32 sigSize,
-                        BYTE *sig);
-
-//private:
-int RSA_verify_DER(int dtype, unsigned char *m, unsigned int m_len,
-                   unsigned char *sigbuf, unsigned int siglen, CRYPTO_INFO *key);
-
-int RSA_sign_DER(int type, unsigned char *m, unsigned int m_len,
-              unsigned char *sigret, unsigned int *siglen, CRYPTO_INFO *key);
-
-#endif // __CRYPTO_H__
diff --git a/tools/vtpm_manager/crypto/hash.c b/tools/vtpm_manager/crypto/hash.c
deleted file mode 100644
index c73114a..0000000
--- a/tools/vtpm_manager/crypto/hash.c
+++ /dev/null
@@ -1,153 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// hash.c
-// 
-//  This file will handle all the TPM Hash functionality
-//
-// ==================================================================
-
-#include <string.h>
-#include <openssl/crypto.h>
-#include <openssl/err.h>
-#include <openssl/evp.h>
-#include <openssl/rand.h>
-#include <openssl/hmac.h>
-#include <openssl/sha.h>
-#include <openssl/bn.h>
-#include <openssl/rsa.h>
-
-#include "tcg.h"         // for TPM_SUCCESS
-#include "crypto.h"
-
-static SHA_CTX g_shaContext;
-
-void Crypto_HMAC(   const BYTE* text, 
-                    int text_len, 
-                    const BYTE* key, 
-                    int key_len, 
-                    BYTE* digest) {
-  if (text == NULL || key == NULL || text_len == 0 || key_len == 0) 
-    return;
-  
-  HMAC(EVP_sha1(), key, key_len, text, text_len, digest, NULL);
-}
-
-TPM_RESULT Crypto_HMAC_buf (const buffer_t * text,
-			    const buffer_t * key,
-			    BYTE * o_digest) { /* presumably of 20 bytes */
-  
-  Crypto_HMAC (text->bytes, text->size, 
-	       key->bytes, key->size,
-	       o_digest);
-  
-  return TPM_SUCCESS;
-}
-
-
-/*
- * SHA1
- * (OUT) Create a SHA1 hash of text. Calls all three SHA1 steps internally
- */
-void Crypto_SHA1Full( const BYTE* text, 
-      uint32_t size, 
-      BYTE* hash) {
-
-  if (text == NULL || size == 0) 
-    return;
-  
-  // Run SHA1Start + SHAUpdate (if necessary) + SHAComplete
-  uint32_t maxBytes; // Not used for anything
-  Crypto_SHA1Start(&maxBytes);
-  
-  while (size > 64){
-    Crypto_SHA1Update(64, text); 
-    size -= 64;
-    text += 64;
-  }
-  
-  Crypto_SHA1Complete(size, text, hash);
-}
-
-// same thing using buffer_t
-TPM_RESULT Crypto_SHA1Full_buf (const buffer_t * buf,
-                                 BYTE * o_digest) {
-
-  if (buf->bytes == NULL || buf->size == 0) 
-    return TPM_BAD_PARAMETER;
-  
-  Crypto_SHA1Full (buf->bytes, buf->size, o_digest);
-  
-  return TPM_SUCCESS;
-}
-
-
-/*
- * Initialize SHA1
- * (OUT) Maximum number of bytes that can be sent to SHA1Update. 
- *   Must be a multiple of 64 bytes.
- */
-void Crypto_SHA1Start(uint32_t* maxNumBytes) {
-  int max = SHA_CBLOCK;
-  // Initialize the crypto library
-  SHA1_Init(&g_shaContext);
-  *maxNumBytes = max;
-}
-
-/*
- * Process SHA1
- * @numBytes: (IN) The number of bytes in hashData. 
- *       Must be a multiple of 64 bytes.
- * @hashData: (IN) Bytes to be hashed.
- */
-void Crypto_SHA1Update(int numBytes, const BYTE* hashData) {
-
-  if (hashData == NULL || numBytes == 0 || numBytes%64 != 0) 
-    return;
-  
-  SHA1_Update(&g_shaContext, hashData, numBytes); 
-}
-
-/*
- * Complete the SHA1 process
- * @hashDataSize: (IN) Number of bytes in hashData.
- *       Must be a multiple of 64 bytes.
- * @hashData: (IN) Final bytes to be hashed.
- * @hashValue: (OUT) The output of the SHA-1 hash.
- */
-void Crypto_SHA1Complete(int hashDataSize, 
-			 const BYTE* hashData, 
-			 BYTE* hashValue) {
-  SHA1_Update(&g_shaContext, hashData, hashDataSize);
-  SHA1_Final(hashValue, &g_shaContext);
-}
diff --git a/tools/vtpm_manager/crypto/rsa.c b/tools/vtpm_manager/crypto/rsa.c
deleted file mode 100644
index 7737dc6..0000000
--- a/tools/vtpm_manager/crypto/rsa.c
+++ /dev/null
@@ -1,434 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// rsa.c
-// 
-//  This file will handle all the TPM RSA crypto functionality
-// 
-// ==================================================================
-
-#include <string.h>
-#include <openssl/crypto.h>
-#include <openssl/evp.h>
-#include <openssl/bn.h>
-#include <openssl/rsa.h>
-#include <openssl/rand.h>
-#include <openssl/x509.h>
-
-#include <openssl/err.h>
-#include <stdio.h>
-
-#include "tcg.h"
-#include "buffer.h"
-#include "crypto.h"
-#include "log.h"
-
-void Crypto_RSACreateKey(   /*in*/ UINT32 keySize,
-                            /*in*/ UINT32 pubExpSize, 
-                            /*in*/ BYTE *pubExp,
-                            /*out*/ UINT32 *privExpSize, 
-                            /*out*/ BYTE *privExp,
-                            /*out*/ UINT32 *modulusSize,        
-                            /*out*/ BYTE *modulus,
-                            /*out*/ CRYPTO_INFO *keys) {
-  unsigned long e_value;
-  
-  if (pubExpSize == 0) // Default e = 2^16+1
-    e_value = (0x01 << 16) + 1;
-  else {
-    // This is not supported, but the following line MIGHT work
-    // under then assumption that the format is BigNum compatable
-    // Though it's not in the spec, so who knows what it is.
-    // Forcing the default.
-    //BN_bin2bn(pubExp, pubExpSize, NULL);
-    e_value = (0x01 << 16) + 1;
-  }
-
-  RSA *rsa = RSA_generate_key(keySize, e_value, NULL, NULL);
-  
-  if (keys) {
-    keys->keyInfo = rsa;
-    keys->algorithmID = CRYPTO_ALGORITH_RSA;
-  }
-  
-  if (modulus)   *modulusSize   = BN_bn2bin(rsa->n, modulus);
-  if (privExp)   *privExpSize   = BN_bn2bin(rsa->d, privExp);
-}
-
-// Create a CRYPTO_INFO struct from the BYTE * key parts. 
-// If pubExp info is NULL, use TCG default.
-// If there is a remainder while calculating the privExp, return FALSE.
-
-void Crypto_RSABuildCryptoInfo( /*[IN]*/ UINT32 pubExpSize, 
-                                /*[IN]*/ BYTE *pubExp,
-                                /*[IN]*/ UINT32 privExpSize, 
-                                /*[IN]*/ BYTE *privExp,
-                                /*[IN]*/ UINT32 modulusSize, 
-                                /*[IN]*/ BYTE *modulus, 
-                                CRYPTO_INFO* cryptoInfo) {
-  cryptoInfo->keyInfo = RSA_new();
-  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
-  
-  rsa->e = BN_new();
-  
-  if (pubExpSize == 0) { // Default e = 2^16+1
-    BN_set_bit(rsa->e, 16);
-    BN_set_bit(rsa->e, 0);
-  } else {
-    // This is not supported, but the following line MIGHT work
-    // under then assumption that the format is BigNum compatable
-    // Though it's not in the spec, so who knows what it is.
-    // Forcing the default.
-    //BN_bin2bn(pubExp, pubExpSize, NULL);
-    BN_set_bit(rsa->e, 16);
-    BN_set_bit(rsa->e, 0);
-  }
-  
-  rsa->n = BN_bin2bn(modulus, modulusSize, NULL);
-  rsa->d = BN_bin2bn(privExp, privExpSize, NULL);
-}
-
-// Create a CRYPTO_INFO struct from the BYTE * key parts. 
-// If pubExp info is NULL, use TCG default.
-// If there is a remainder while calculating the privExp, return FALSE.
-
-void Crypto_RSABuildCryptoInfoPublic(   /*[IN]*/ UINT32 pubExpSize, 
-                                        /*[IN]*/ BYTE *pubExp,
-                                        /*[IN]*/ UINT32 modulusSize, 
-                                        /*[IN]*/ BYTE *modulus, 
-                                        CRYPTO_INFO* cryptoInfo) {
-  cryptoInfo->keyInfo = RSA_new();
-  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
-  
-  rsa->e = BN_new();
-  
-  if (pubExpSize == 0) { // Default e = 2^16+1
-    BN_set_bit(rsa->e, 16);
-    BN_set_bit(rsa->e, 0);
-  } else {
-    // This is not supported, but the following line MIGHT work
-    // under then assumption that the format is BigNum compatable
-    // Though it's not in the spec, so who knows what it is.
-    // Forcing the default.
-    //BN_bin2bn(pubExp, pubExpSize, NULL);
-    BN_set_bit(rsa->e, 16);
-    BN_set_bit(rsa->e, 0);
-  }
-  
-  rsa->n = BN_bin2bn(modulus, modulusSize, NULL);
-  
-}
-
-int Crypto_RSAEnc(  CRYPTO_INFO *key,
-		    UINT32 inDataSize,
-		    BYTE *inData,
-		    /*out*/ UINT32 *outDataSize,
-		    /*out*/ BYTE *outData) {
-  RSA *rsa = (RSA *) key->keyInfo;
-  UINT32 paddedDataSize = RSA_size (rsa);
-  BYTE *paddedData = (BYTE *)malloc(sizeof(BYTE) * paddedDataSize);
-  int rc;
-    
-  if (paddedData == NULL) 
-    return -1;
-
-  *outDataSize = 0;
-  
-  switch (key->encScheme) {
-  case CRYPTO_ES_RSAESPKCSv15:
-    if (RSA_padding_add_PKCS1_type_2(paddedData, paddedDataSize, inData, inDataSize) <= 0) {
-      rc = -1; 
-      goto abort_egress;
-    }
-    break;
-  case CRYPTO_ES_RSAESOAEP_SHA1_MGF1:
-    if (RSA_padding_add_PKCS1_OAEP(paddedData,paddedDataSize,inData,inDataSize, (BYTE *) OAEP_P,OAEP_P_SIZE) <= 0 ) {
-      rc = -1; 
-      goto abort_egress;
-    }
-    break;
-  default:
-    rc = -1; 
-    goto abort_egress;
-  }
-  
-  rc = RSA_public_encrypt(paddedDataSize, paddedData, outData, rsa, RSA_NO_PADDING);
-  if (rc == -1)
-    goto abort_egress; 
-   
-  *outDataSize = rc;
-  
-  if (rc > 0) rc = 0;
-  
-  goto egress;
-  
- abort_egress:
- egress:
-  
-  if (paddedData) 
-    free (paddedData);
-  return rc;
-  
-}
-
-int Crypto_RSADec(  CRYPTO_INFO *key,
-                    UINT32 inDataSize,
-                    BYTE *inData,
-                    /*out*/ UINT32 *outDataSize,
-                    /*out*/ BYTE *outData) {
-  
-  RSA *rsa = (RSA *) key->keyInfo;
-  UINT32 paddedDataSize = RSA_size (rsa);
-  BYTE *paddedData = (BYTE *)malloc(sizeof(BYTE) * paddedDataSize);
-  int rc;
-  
-  if (paddedData == NULL)
-    goto abort_egress;
-  
-  rc = RSA_private_decrypt(inDataSize, inData, paddedData, rsa, RSA_NO_PADDING);
-  if (rc == -1) {
-    vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_private_decrypt: %s\n", ERR_error_string(ERR_get_error(), NULL));
-    goto abort_egress;
-  }
-  
-  paddedDataSize = rc;
-  
-  switch (key->encScheme) {
-  case CRYPTO_ES_RSAESPKCSv15:
-    rc = RSA_padding_check_PKCS1_type_2 (outData, paddedDataSize,
-					 paddedData + 1, paddedDataSize - 1,
-					 RSA_size(rsa));
-    if (rc == -1) {
-      vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_padding_check_PKCS1_type_2: %s\n", 
-	      ERR_error_string(ERR_get_error(), NULL));
-      goto abort_egress;
-    }
-    *outDataSize = rc;
-    break;
-  case CRYPTO_ES_RSAESOAEP_SHA1_MGF1:
-    rc = RSA_padding_check_PKCS1_OAEP(outData, paddedDataSize,
-				      paddedData + 1, paddedDataSize - 1,
-				      RSA_size(rsa),
-				      (BYTE *) OAEP_P, OAEP_P_SIZE);
-    if (rc == -1) {
-      vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_padding_check_PKCS1_OAEP: %s\n",
-	      ERR_error_string(ERR_get_error(), NULL));
-      goto abort_egress;
-    }
-    *outDataSize = rc;
-    break;
-  default:
-    *outDataSize = 0;
-  }
-  
-  free(paddedData); paddedData = NULL;
-  goto egress;
-  
- abort_egress:
-  
-  if (paddedData) 
-    free (paddedData);
-  return -1;
-  
- egress:
-  return 0;
-}
-
-// Signs either a SHA1 digest of a message or a DER encoding of a message
-// Textual messages MUST be encoded or Hashed before sending into this function
-// It will NOT SHA the message.
-int Crypto_RSASign( CRYPTO_INFO *key,
-                    UINT32 inDataSize,
-                    BYTE *inData,
-                    /*out*/ UINT32 *sigSize,
-                    /*out*/ BYTE *sig) {
-  int status;
-  unsigned int intSigSize;
-  
-  switch(key->sigScheme) {
-  case CRYPTO_SS_RSASSAPKCS1v15_SHA1: 
-    status = RSA_sign(NID_sha1, inData, inDataSize, sig, &intSigSize, (RSA *) key->keyInfo);
-    break;
-  case CRYPTO_SS_RSASSAPKCS1v15_DER:
-    //        status = Crypto_RSA_sign_DER(NID_md5_sha1, inData, inDataSize, sig, &intSigSize, key);
-    vtpmlogerror(VTPM_LOG_CRYPTO, "Crypto: Unimplemented sign type (%d)\n", key->sigScheme);
-    status = 0;
-    break;
-  default:
-    status = 0;
-  }
-  
-  if (status == 0) {
-    *sigSize = 0;
-    vtpmlogerror(VTPM_LOG_CRYPTO, "%s\n", ERR_error_string(ERR_get_error(), NULL));
-    return -1;
-  }
-  
-  *sigSize = (UINT32) intSigSize;
-  return 0;
-}
-
-bool Crypto_RSAVerify(  CRYPTO_INFO *key,
-                        UINT32 inDataSize,
-                        BYTE *inData,
-                        UINT32 sigSize,
-                        BYTE *sig) {
-  int status;
-  
-  switch(key->sigScheme){
-  case CRYPTO_SS_RSASSAPKCS1v15_SHA1: 
-    status = RSA_verify(NID_sha1, inData, inDataSize, sig, sigSize, (RSA *) key->keyInfo);
-    break;
-  case CRYPTO_SS_RSASSAPKCS1v15_DER:
-    //status = Crypto_RSA_verify_DER(NID_md5_sha1, inData, inDataSize, sig, sigSize, key);
-    vtpmlogerror(VTPM_LOG_CRYPTO, "Crypto: Unimplemented sign type (%d)\n", key->sigScheme);
-    status = 0;
-    break;
-  default:
-    status = 0;
-  }
-  
-  if (status) 
-    return(1);
-  else {
-    vtpmlogerror(VTPM_LOG_CRYPTO, "RSA verify: %s\n", ERR_error_string(ERR_get_error(), NULL));
-    return(0);
-  }
-  
-}
-
-// helper which packs everything into a BIO!
-
-// packs the parameters first, then the private key, then the public key
-// if *io_buf is NULL, allocate it here as needed. otherwise its size is in
-// *io_buflen
-TPM_RESULT Crypto_RSAPackCryptoInfo (const CRYPTO_INFO* cryptoInfo,
-                                      BYTE ** io_buf, UINT32 * io_buflen) {
-  TPM_RESULT status = TPM_SUCCESS;
-  BYTE * buf;
-  long len, outlen = *io_buflen;
-  
-  const long PARAMSLEN = 3*sizeof(UINT32);
-  
-  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
-  
-  BIO *mem = BIO_new(BIO_s_mem());
-  
-  
-  // write the openssl keys to the BIO
-  if ( i2d_RSAPrivateKey_bio (mem, rsa) == 0 ) {
-    ERR_print_errors_fp (stderr);
-    ERRORDIE (TPM_SIZE);
-  }
-  if ( i2d_RSAPublicKey_bio (mem, rsa) == 0 ) {
-    ERR_print_errors_fp (stderr);
-    ERRORDIE (TPM_SIZE);
-  }
-  
-  // get the buffer out
-  len = BIO_get_mem_data (mem, &buf);
-  
-  // see if we need to allocate a return buffer
-  if (*io_buf == NULL) {
-    *io_buf = (BYTE*) malloc (PARAMSLEN + len);
-    if (*io_buf == NULL) 
-      ERRORDIE (TPM_SIZE);
-  } else {                      // *io_buf is already allocated
-    if (outlen < len + PARAMSLEN) 
-      ERRORDIE (TPM_SIZE); // but not large enough!  
-  }
-  
-  // copy over the parameters (three UINT32's starting at algorithmID)
-  memcpy (*io_buf, &cryptoInfo->algorithmID, PARAMSLEN);
-  
-  // copy over the DER keys
-  memcpy (*io_buf + PARAMSLEN, buf, len);
-  
-  *io_buflen = len + PARAMSLEN;
-  
-  goto egress;
-  
-  
- abort_egress:
- egress:
-  
-  BIO_free (mem);
-  
-  return status;
-}
-
-
-
-// sets up ci, and returns the number of bytes read in o_lenread
-TPM_RESULT Crypto_RSAUnpackCryptoInfo (CRYPTO_INFO * ci,
-                                        BYTE * in, UINT32 len,
-                                        UINT32 * o_lenread) {
-  
-  TPM_RESULT status = TPM_SUCCESS;
-  long l;
-  BIO *mem;
-  RSA *rsa;
-  
-  // first load up the params
-  l = 3 * sizeof(UINT32);
-  memcpy (&ci->algorithmID, in, l);
-  len -= l;
-  in += l;
-  
-  // and now the openssl keys, private first
-  mem = BIO_new_mem_buf (in, len);
-  
-  if ( (rsa = d2i_RSAPrivateKey_bio (mem, NULL)) == NULL ) {
-    ERR_print_errors_fp (stderr);
-    ERRORDIE (TPM_BAD_PARAMETER);
-  }
-  // now use the same RSA object and fill in the private key
-  if ( d2i_RSAPublicKey_bio (mem, &rsa) == NULL ) {
-    ERR_print_errors_fp (stderr);
-    ERRORDIE (TPM_BAD_PARAMETER);
-  }
-  
-  ci->keyInfo = rsa;          // needs to be freed somehow later
-  
-  // FIXME: havent figured out yet how to tell how many bytes were read in the
-  // above oprations! so o_lenread is not set
-  
-  goto egress;
-  
- abort_egress:
- egress:
-  
-  BIO_free (mem);
- 
-  return status;  
-}
diff --git a/tools/vtpm_manager/crypto/sym_crypto.c b/tools/vtpm_manager/crypto/sym_crypto.c
deleted file mode 100644
index 3d86e19..0000000
--- a/tools/vtpm_manager/crypto/sym_crypto.c
+++ /dev/null
@@ -1,237 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// sym_crypto.c
-// 
-//     Symmetric crypto portion of crypto 
-// 
-// ==================================================================
-
-#include <openssl/evp.h>
-#include <openssl/rand.h>
-
-#include "tcg.h"
-#include "sym_crypto.h"
-
-typedef enum crypt_op_type_t {
-  CRYPT_ENCRYPT,
-  CRYPT_DECRYPT
-} crypt_op_type_t;
-
-TPM_RESULT ossl_symcrypto_op (symkey_t* key,
-                              const buffer_t* in,
-                              const buffer_t* iv,
-                              buffer_t * out,
-                              crypt_op_type_t optype);
-
-
-// this is initialized in Crypto_Init()
-const EVP_CIPHER * SYM_CIPHER = NULL;
-
-const BYTE ZERO_IV[EVP_MAX_IV_LENGTH] = {0};
-
-
-TPM_RESULT Crypto_symcrypto_initkey (symkey_t * key, const buffer_t* keybits) {
-  TPM_RESULT status = TPM_SUCCESS;
-  
-  EVP_CIPHER_CTX_init (&key->context);
-  
-  key->cipher = SYM_CIPHER;
-  
-  TPMTRYRETURN( buffer_init_copy (&key->key, keybits));
-    
-  goto egress;
-  
- abort_egress:
-  EVP_CIPHER_CTX_cleanup (&key->context);
-  
- egress:
-  
-  return status;
-}
-
-
-
-TPM_RESULT Crypto_symcrypto_genkey (symkey_t * key) {
-  int res;
-  TPM_RESULT status = TPM_SUCCESS;
-  
-  // hmm, EVP_CIPHER_CTX_init does not return a value
-  EVP_CIPHER_CTX_init (&key->context);
-  
-  key->cipher = SYM_CIPHER;
-  
-  TPMTRYRETURN( buffer_init (&key->key, EVP_CIPHER_key_length(key->cipher), NULL)) ;
-  
-  // and generate the key material
-  res = RAND_pseudo_bytes (key->key.bytes, key->key.size);
-  if (res < 0) 
-    ERRORDIE (TPM_SHORTRANDOM);
-  
-  
-  goto egress;
-  
- abort_egress:
-  EVP_CIPHER_CTX_cleanup (&key->context);
-  buffer_free (&key->key);
-  
- egress:
-  return status;  
-}
-
-
-TPM_RESULT Crypto_symcrypto_encrypt (symkey_t* key,
-                              const buffer_t* clear,
-                              buffer_t* o_cipher) {
-  TPM_RESULT status = TPM_SUCCESS;
-  
-  buffer_t iv, cipher_alias;
-  
-  buffer_init_const (&iv, EVP_MAX_IV_LENGTH, ZERO_IV);
-  
-  buffer_init (o_cipher,
-	       clear->size +
-	       EVP_CIPHER_iv_length(key->cipher) +
-	       EVP_CIPHER_block_size (key->cipher),
-				 0);
-  
-  // copy the IV into the front
-  buffer_copy (o_cipher, &iv);
-  
-  // make an alias into which we'll put the ciphertext
-  buffer_init_alias (&cipher_alias, o_cipher, EVP_CIPHER_iv_length(key->cipher), 0);
-  
-  TPMTRYRETURN( ossl_symcrypto_op (key, clear, &iv, &cipher_alias, CRYPT_ENCRYPT) );
-
-  // set the output size correctly
-  o_cipher->size += cipher_alias.size;
-  
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  
-  return status;
-  
-}
-
-
-
-TPM_RESULT Crypto_symcrypto_decrypt (symkey_t* key,
-                              const buffer_t* cipher,
-                              buffer_t* o_clear) {
-  TPM_RESULT status = TPM_SUCCESS;
-  
-  buffer_t iv, cipher_alias;
-  
-  // alias for the IV
-  buffer_init_alias (&iv, cipher, 0, EVP_CIPHER_iv_length(key->cipher));
-  
-  // make an alias to where the ciphertext is, after the IV
-  buffer_init_alias (&cipher_alias, cipher, EVP_CIPHER_iv_length(key->cipher), 0);
-  
-  // prepare the output buffer
-  TPMTRYRETURN( buffer_init (o_clear,
-			cipher->size
-			- EVP_CIPHER_iv_length(key->cipher)
-			+ EVP_CIPHER_block_size(key->cipher), 
-			0) );
-  
-  // and decrypt
-  TPMTRYRETURN ( ossl_symcrypto_op (key, &cipher_alias, &iv, o_clear, CRYPT_DECRYPT) );
-  
-  goto egress;
-  
- abort_egress:
-  buffer_free (o_clear);
-  
- egress:
-  
-  return status;
-}
-
-
-
-TPM_RESULT Crypto_symcrypto_freekey (symkey_t * key) {
-  buffer_memset (&key->key, 0);
-  buffer_free (&key->key);
-  
-  EVP_CIPHER_CTX_cleanup (&key->context);
-  
-  return TPM_SUCCESS;
-}
-
-
-TPM_RESULT ossl_symcrypto_op (symkey_t* key,
-                              const buffer_t* in,
-                              const buffer_t* iv,
-                              buffer_t * out,
-                              crypt_op_type_t optype) {
-  TPM_RESULT status = TPM_SUCCESS;
-  
-  int inlen, outlen;
-  tpm_size_t running;
-  
-  if ( ! EVP_CipherInit_ex (&key->context,
-			    key->cipher, NULL, key->key.bytes, iv->bytes,
-			    optype == CRYPT_ENCRYPT ? 1 : 0) ) 
-    ERRORDIE (TPM_FAIL);
-  
-  
-  
-  inlen = in->size;
-  
-  outlen  = 0;
-  running = 0;
-  
-  
-  if ( ! EVP_CipherUpdate (&key->context, out->bytes, &outlen, in->bytes, inlen) )
-    ERRORDIE (TPM_FAIL);
-
-  running += outlen;
-  
-  if ( ! EVP_CipherFinal_ex (&key->context, out->bytes + running, &outlen) )
-    ERRORDIE (TPM_FAIL);
-  
-  running += outlen;
-  
-  out->size = running;
-  
-  goto egress;
-  
- abort_egress:
- egress:
-  
-  return status;
-}
diff --git a/tools/vtpm_manager/crypto/sym_crypto.h b/tools/vtpm_manager/crypto/sym_crypto.h
deleted file mode 100644
index 7fb59a8..0000000
--- a/tools/vtpm_manager/crypto/sym_crypto.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// sym_crypto.h
-// 
-//     Symmetric Crypto 
-// 
-// ==================================================================
-
-#ifndef _SYM_CRYPTO_H
-#define _SYM_CRYPTO_H
-
-#include <openssl/evp.h>
-#include "buffer.h"
-
-typedef struct symkey_t {
-  buffer_t key;
-  
-  EVP_CIPHER_CTX context;
-  const EVP_CIPHER * cipher;
-} symkey_t;
-
-extern const EVP_CIPHER * SYM_CIPHER;
-
-TPM_RESULT Crypto_symcrypto_genkey (symkey_t * key);
-
-TPM_RESULT Crypto_symcrypto_initkey (symkey_t * key, const buffer_t* keybits);
-
-
-// these functions will allocate their output buffers
-TPM_RESULT Crypto_symcrypto_encrypt (symkey_t* key,
-                              const buffer_t* clear,
-                              buffer_t* o_cipher);
-
-TPM_RESULT Crypto_symcrypto_decrypt (symkey_t* key,
-                              const buffer_t* cipher,
-                              buffer_t* o_clear);
-
-// only free the internal parts, not the 'key' ptr
-TPM_RESULT Crypto_symcrypto_freekey (symkey_t * key);
-
-#endif /* _SYM_CRYPTO_H */
diff --git a/tools/vtpm_manager/manager/Makefile b/tools/vtpm_manager/manager/Makefile
deleted file mode 100644
index a33c18a..0000000
--- a/tools/vtpm_manager/manager/Makefile
+++ /dev/null
@@ -1,38 +0,0 @@
-XEN_ROOT = $(CURDIR)/../../..
-include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
-
-BIN		= vtpm_managerd
-
-.PHONY: all
-all: build
-
-.PHONY: build
-build: $(BIN)
-
-.PHONY: install
-install: build
-	if [ ! -d "$(DESTDIR)/var/vtpm/fifos" ]; \
-		then mkdir -p $(DESTDIR)/var/vtpm/fifos; \
-	fi
-	if [ ! -d "$(DESTDIR)/var/vtpm/socks" ]; \
-		then mkdir -p $(DESTDIR)/var/vtpm/socks; \
-	fi
-	$(INSTALL_PROG) $(BIN) $(DESTDIR)$(BINDIR)
-
-.PHONY: clean
-clean:
-	rm -f $(BIN)
-	rm -f *.a *.so *.o *.rpm $(DEP_FILES)
-
-.PHONY: mrproper
-mrproper: clean
-	rm -f *~
-
-$(BIN): $(OBJS)
-	$(CC) $(LDFLAGS) $^ $(LIBS) -o $@
-
-# libraries
-LIBS += ../tcs/libTCS.a ../util/libTCGUtils.a ../crypto/libtcpaCrypto.a
-LIBS += -lcrypto $(PTHREAD_LIBS) -lm
-CFLAGS += $(PTHREAD_CFLAGS)
-LDFLAGS += $(PTHREAD_LDFLAGS)
diff --git a/tools/vtpm_manager/manager/dmictl.c b/tools/vtpm_manager/manager/dmictl.c
deleted file mode 100644
index 5c3cf7e..0000000
--- a/tools/vtpm_manager/manager/dmictl.c
+++ /dev/null
@@ -1,266 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-//   dmictl.c
-// 
-//     Functions for creating and destroying DMIs
-//
-// ==================================================================
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-
-#include "vtpmpriv.h"
-#include "bsg.h"
-#include "buffer.h"
-#include "log.h"
-#include "hashtable.h"
-#include "hashtable_itr.h"
-#include "vtpm_ipc.h"
-
-#define TPM_EMULATOR_PATH "/usr/bin/vtpmd"
-
-// if dmi_res is non-null, then return a pointer to new object.
-// Also, this does not fill in the measurements. They should be filled by
-// design dependent code or saveNVM
-TPM_RESULT init_dmi(UINT32 dmi_id, BYTE dmi_type, VTPM_DMI_RESOURCE **dmi_res) {
-
-  TPM_RESULT status=TPM_SUCCESS;
-  VTPM_DMI_RESOURCE *new_dmi=NULL;
-  UINT32 *dmi_id_key=NULL;
-
-  if ((new_dmi = (VTPM_DMI_RESOURCE *) malloc (sizeof(VTPM_DMI_RESOURCE))) == NULL) {
-      status = TPM_RESOURCES;
-      goto abort_egress;
-  }
-  memset(new_dmi, 0, sizeof(VTPM_DMI_RESOURCE));
-  new_dmi->dmi_id = dmi_id;
-  new_dmi->dmi_type = dmi_type;
-  new_dmi->connected = FALSE;
-  new_dmi->TCSContext = 0;
-
-  new_dmi->NVMLocation = (char *) malloc(11 + strlen(DMI_NVM_FILE));
-  sprintf(new_dmi->NVMLocation, DMI_NVM_FILE, (uint32_t) new_dmi->dmi_id);
-
-  if ((dmi_id_key = (UINT32 *) malloc (sizeof(UINT32))) == NULL) {
-    status = TPM_RESOURCES;
-    goto abort_egress;
-  }
-  *dmi_id_key = new_dmi->dmi_id;
-
-  // install into map
-  if (!hashtable_insert(vtpm_globals->dmi_map, dmi_id_key, new_dmi)){
-    vtpmlogerror(VTPM_LOG_VTPM, "Failed to insert instance into table. Aborting.\n", dmi_id);
-    status = TPM_FAIL;
-    goto abort_egress;
-  }
-
-  if (dmi_res)
-    *dmi_res = new_dmi;
-
-  goto egress;
-
- abort_egress:
-  if (new_dmi) {
-    free(new_dmi->NVMLocation);
-    free(new_dmi);
-  }
-  free(dmi_id_key);
-
- egress:
-  return status;
-}
-
-TPM_RESULT close_dmi(VTPM_DMI_RESOURCE *dmi_res) {
-  if (dmi_res == NULL) 
-    return TPM_SUCCESS;
-
-  if (dmi_res->dmi_id == VTPM_CTL_DM) 
-    return(TPM_BAD_PARAMETER);
-
-  TCS_CloseContext(dmi_res->TCSContext);
-  dmi_res->connected = FALSE;
-
-  vtpm_globals->connected_dmis--;
-
-  return (VTPM_Close_DMI_Extra(dmi_res) );
-}
-	
-TPM_RESULT VTPM_Handle_New_DMI(const buffer_t *param_buf) {
-  
-  VTPM_DMI_RESOURCE *new_dmi=NULL;
-  TPM_RESULT status=TPM_FAIL;
-  BYTE dmi_type, vm_type, startup_mode;
-  UINT32 dmi_id; 
-
-  if (param_buf == NULL) { // Assume creation of Dom 0 control
-    dmi_type = VTPM_TYPE_NON_MIGRATABLE;
-    dmi_id = VTPM_CTL_DM;
-  } else if (buffer_len(param_buf) != sizeof(BYTE) * 3  + sizeof(UINT32)) {
-    vtpmloginfo(VTPM_LOG_VTPM, "New DMI command wrong length: %d.\n", buffer_len(param_buf));
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  } else {
-    vtpm_globals->connected_dmis++; // Put this here so we don't count Dom0
-    BSG_UnpackList( param_buf->bytes, 4,
-		    BSG_TYPE_BYTE, &dmi_type,
-		    BSG_TYPE_BYTE, &startup_mode,
-		    BSG_TYPE_BYTE, &vm_type,
-		    BSG_TYPE_UINT32,  &dmi_id);
-  }
-
-  if ((dmi_type != VTPM_TYPE_NON_MIGRATABLE) && (dmi_type != VTPM_TYPE_MIGRATABLE)) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Creation of VTPM with illegal type.\n");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  new_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
-  if (new_dmi == NULL) { 
-    vtpmloginfo(VTPM_LOG_VTPM, "Creating new DMI instance %d attached.\n", dmi_id );
-    // Brand New DMI. Initialize the persistent pieces
-    TPMTRYRETURN(init_dmi(dmi_id, dmi_type, &new_dmi) );  
-  } else 
-    vtpmloginfo(VTPM_LOG_VTPM, "Re-attaching DMI instance %d.\n", dmi_id);
-
-  if (new_dmi->connected) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Attempt to re-attach, currently attached instance %d. Ignoring\n", dmi_id);
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-  
-  if (new_dmi->dmi_type == VTPM_TYPE_MIGRATED) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Attempt to re-attach previously migrated instance %d without recovering first. Ignoring\n", dmi_id);
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  // Initialize the Non-persistent pieces
-  TPMTRYRETURN( TCS_OpenContext(&new_dmi->TCSContext) );
-  
-  new_dmi->connected = TRUE;  
-
-  // Design specific new DMI code. 
-  // Includes: create IPCs, Measuring DMI, and maybe launching DMI
-  TPMTRYRETURN(VTPM_New_DMI_Extra(new_dmi, vm_type, startup_mode) );
-  goto egress;
-  
- abort_egress:
-  vtpmlogerror(VTPM_LOG_VTPM, "Failed to create DMI id=%d due to status=%s. Cleaning.\n", dmi_id, tpm_get_error_name(status));
-  close_dmi(new_dmi );
-	
- egress:
-  return status;
-}
-
-TPM_RESULT VTPM_Handle_Close_DMI( const buffer_t *param_buf) {
-  
-  TPM_RESULT status=TPM_FAIL;
-  VTPM_DMI_RESOURCE *dmi_res=NULL;
-  UINT32 dmi_id;
-  
-  if ((param_buf == NULL) || (buffer_len(param_buf) != sizeof(UINT32)) ) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Closing DMI has bad size.");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-  
-  BSG_UnpackList( param_buf->bytes, 1,
-		  BSG_TYPE_UINT32, &dmi_id);
-  
-  vtpmloginfo(VTPM_LOG_VTPM, "Closing DMI %d.\n", dmi_id);
-  
-  dmi_res = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
-  if (dmi_res == NULL ) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Trying to close nonexistent DMI.\n");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-	
-  if (!dmi_res->connected) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Closing non-connected DMI.\n");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-  
-  // Close Dmi
-	TPMTRYRETURN(close_dmi( dmi_res ));
-  
-  status=TPM_SUCCESS;    
-  goto egress;
-  
- abort_egress:
- egress:
-  
-  return status;
-}
-
-TPM_RESULT VTPM_Handle_Delete_DMI( const buffer_t *param_buf) {
-  
-  TPM_RESULT status=TPM_FAIL;
-  VTPM_DMI_RESOURCE *dmi_res=NULL;
-  UINT32 dmi_id;
-    
-  if ((param_buf == NULL) || (buffer_len(param_buf) != sizeof(UINT32)) ) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Closing DMI has bad size.\n");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-  
-  BSG_UnpackList( param_buf->bytes, 1,
-		  BSG_TYPE_UINT32, &dmi_id);
-  
-  vtpmloginfo(VTPM_LOG_VTPM, "Deleting DMI %d.\n", dmi_id);    
-  
-  dmi_res = (VTPM_DMI_RESOURCE *) hashtable_remove(vtpm_globals->dmi_map, &dmi_id);
-  if (dmi_res == NULL) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Closing non-existent DMI.\n");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-  
-  //vtpm scripts delete file dmi_res->NVMLocation for us
-  
-  // Close DMI first
-  TPMTRYRETURN(close_dmi( dmi_res ));
-  free ( dmi_res );
-	
-  status=TPM_SUCCESS;    
-  goto egress;
-  
- abort_egress:
- egress:
-  
-  return status;
-}
diff --git a/tools/vtpm_manager/manager/migration.c b/tools/vtpm_manager/manager/migration.c
deleted file mode 100644
index 54da708..0000000
--- a/tools/vtpm_manager/manager/migration.c
+++ /dev/null
@@ -1,307 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-//   dmictl.c
-// 
-//     Functions for creating and destroying DMIs
-//
-// ==================================================================
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-
-#include "vtpmpriv.h"
-#include "bsg.h"
-#include "buffer.h"
-#include "log.h"
-#include "hashtable.h"
-
-TPM_RESULT VTPM_Handle_Migrate_In( const buffer_t *param_buf,
-                                   buffer_t *result_buf) {
-
-  TPM_RESULT status=TPM_FAIL;
-  VTPM_DMI_RESOURCE *mig_dmi=NULL;
-  UINT32 dmi_id;
-  buffer_t dmi_state_abuf = NULL_BUF, enc_dmi_abuf = NULL_BUF, clear_dmi_blob = NULL_BUF;
-
-  if (param_buf == NULL) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Migration Out Failed due to bad parameter.\n");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  struct pack_buf_t enc_dmi_state_pack;
-
-  BSG_UnpackList(param_buf->bytes, 2, 
-                 BSG_TYPE_UINT32, &dmi_id,
-                 BSG_TPM_SIZE32_DATA, &enc_dmi_state_pack) ;
-
-  vtpmloginfo(VTPM_LOG_VTPM, "Migrating VTPM in dmi %d.\n", dmi_id);
-
-  mig_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
-  if (mig_dmi) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Incoming VTPM claims unavailable id: %d.\n", dmi_id);
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }    
-
-  /** UnBind Blob **/
-  TPMTRYRETURN( buffer_init_alias_convert( &enc_dmi_abuf, 
-                                           enc_dmi_state_pack.size, 
-                                           enc_dmi_state_pack.data) );
-
-  TPMTRYRETURN( envelope_decrypt( &enc_dmi_abuf,
-                                   vtpm_globals->manager_tcs_handle,
-                                   vtpm_globals->storageKeyHandle,
-                                   (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
-                                   &clear_dmi_blob) );
-
-  // Create new dmi
-  TPMTRYRETURN( init_dmi(dmi_id, VTPM_TYPE_MIGRATABLE, &mig_dmi ) ); 
-
-  /** Open Blob **/
-  struct pack_buf_t dmi_state_pack;
-
-  BSG_UnpackList(clear_dmi_blob.bytes, 2, 
-                 BSG_TPM_DIGEST, &mig_dmi->DMI_measurement,
-                 BSG_TPM_SIZE32_DATA, &dmi_state_pack);
-
-  TPMTRYRETURN( buffer_init_alias_convert(&dmi_state_abuf, 
-                                          dmi_state_pack.size, 
-                                          dmi_state_pack.data) ); 
-
-  TPMTRYRETURN( VTPM_Handle_Save_NVM(mig_dmi, &dmi_state_abuf, NULL ) );
-
-  status=TPM_SUCCESS;
-  goto egress;
-
- abort_egress:
-    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Migration IN of instance %d failed because of %s.\n", dmi_id, tpm_get_error_name(status) );
-
- egress:
-  buffer_free(&clear_dmi_blob);
-  buffer_free(&dmi_state_abuf);
- 
-  return status;
-}
-
-TPM_RESULT VTPM_Handle_Migrate_Out( const buffer_t *param_buf,
-                                    buffer_t *result_buf) {
-
-  TPM_RESULT status=TPM_FAIL;
-  VTPM_DMI_RESOURCE *mig_dmi;
-  UINT32 dmi_id;
-  VTPM_MIGKEY_LIST *last_mig, *mig_key;
-  buffer_t dmi_state=NULL_BUF, clear_dmi_blob=NULL_BUF;
-
-  if (param_buf == NULL) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Migration Out Failed due to bad parameter.\n");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  struct pack_buf_t name_pack;
-
-  BSG_UnpackList( param_buf->bytes, 2,
-                  BSG_TYPE_UINT32, &dmi_id,
-                  BSG_TPM_SIZE32_DATA, &name_pack);
-
-  vtpmloginfo(VTPM_LOG_VTPM, "Migrating out dmi %d.\n", dmi_id);
-
-  mig_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
-  if (mig_dmi == NULL) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Non-existent VTPM instance (%d) in migration.\n", dmi_id );
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  if (mig_dmi->dmi_type != VTPM_TYPE_MIGRATABLE) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Bad VTPM type (%d) in migration of instance (%d).\n", mig_dmi->dmi_type, dmi_id );
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  /** Find migration key for dest **/
-  last_mig = NULL;
-  mig_key = vtpm_globals->mig_keys;
-  while (mig_key != NULL) {
-    if (mig_key->name_size == name_pack.size)
-      if (memcmp(mig_key->name, name_pack.data, name_pack.size) == 0) {
-        break;
-      }
-    
-    last_mig = mig_key;
-    mig_key = mig_key->next;
-  }
-     
-  if (!mig_key) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Unknown Migration target host.\n");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  /** Mark vtpm as migrated **/
-  mig_dmi->dmi_type = VTPM_TYPE_MIGRATED;
-
-  /** Build Blob **/
-  TPMTRYRETURN( VTPM_Handle_Load_NVM(mig_dmi, NULL, &dmi_state) );
-
-  TPMTRYRETURN( buffer_init(&clear_dmi_blob, sizeof(TPM_DIGEST) + sizeof(UINT32) + buffer_len(&dmi_state), NULL ) ); 
-
-  struct pack_constbuf_t dmi_state_pack;
-
-  dmi_state_pack.size = buffer_len(&dmi_state);
-  dmi_state_pack.data = dmi_state.bytes;
-
-  BSG_PackList(clear_dmi_blob.bytes, 2, 
-               BSG_TPM_DIGEST, &mig_dmi->DMI_measurement,
-               BSG_TPM_SIZE32_DATA, &dmi_state_pack);
-
-  /** Bind Blob **/
-  TPMTRYRETURN( envelope_encrypt( &clear_dmi_blob,
-                                  &mig_key->key,
-                                  result_buf) );
-
-  if (last_mig)
-    last_mig->next = mig_key->next;
-  else 
-    vtpm_globals->mig_keys = mig_key->next;
-  
-  free(mig_key->name);
-  free(mig_key);
-
-  status=TPM_SUCCESS;
-  goto egress;
-
- abort_egress:
-    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Migration OUT of instance %d failed because of %s. Migratoin recovery may be needed.\n", dmi_id, tpm_get_error_name(status) );
-
-    //TODO: Create and implement a policy for what happens to mig_key on failed migrations.
-
- egress:
-
-  buffer_free(&clear_dmi_blob);
-  buffer_free(&dmi_state);
-
-  return status;
-}
-
-
-TPM_RESULT VTPM_Handle_Get_Migration_key( const buffer_t *param_buf,
-                                          buffer_t *result_buf) {
-
-  TPM_RESULT status=TPM_FAIL;
-
-  vtpmloginfo(VTPM_LOG_VTPM, "Getting Migration Public Key.\n");
-
-  struct pack_buf_t pubkey_exp_pack, pubkey_mod_pack;
-  TPM_KEY mig_key;
-
-  // Unpack/return key structure
-  BSG_Unpack(BSG_TPM_KEY, vtpm_globals->storageKeyWrap.bytes , &mig_key);
-  TPM_RSA_KEY_PARMS rsaKeyParms;
-
-  BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
-               mig_key.algorithmParms.parms,
-               &rsaKeyParms);
-
-  pubkey_exp_pack.size = rsaKeyParms.exponentSize;
-  pubkey_exp_pack.data = rsaKeyParms.exponent;
-  pubkey_mod_pack.size = mig_key.pubKey.keyLength;
-  pubkey_mod_pack.data = mig_key.pubKey.key;
-
-  TPMTRYRETURN( buffer_init( result_buf, 2*sizeof(UINT32) + 
-                                         pubkey_exp_pack.size + 
-                                         pubkey_mod_pack.size, NULL ) );
-
-  BSG_PackList( result_buf->bytes, 2,
-                  BSG_TPM_SIZE32_DATA, &pubkey_exp_pack,
-                  BSG_TPM_SIZE32_DATA, &pubkey_mod_pack);
-
-
-  status=TPM_SUCCESS;
-  goto egress;
-
- abort_egress:
-    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Get Migration Key failed because of %s.\n", tpm_get_error_name(status) );
- egress:
-
-  return status;
-}
-
-TPM_RESULT VTPM_Handle_Load_Migration_key( const buffer_t *param_buf,
-                                           buffer_t *result_buf) {
-
-  TPM_RESULT status=TPM_FAIL;
-  VTPM_MIGKEY_LIST *mig_key;
-
-  vtpmloginfo(VTPM_LOG_VTPM, "Loading Migration Public Key.\n");
-
-  //FIXME: Review all uses of unpacking pack_buf_t and ensure free.
-  //FIXME: Review all declarations/initializations of buffer_t that could have a goto that skips them and then tries to free them
-
-  struct pack_buf_t name_pack, pubkey_exp_pack, pubkey_mod_pack;
-
-  //FIXME: scan list and verify name is not already in the list
-
-  BSG_UnpackList( param_buf->bytes, 3,
-                  BSG_TPM_SIZE32_DATA, &name_pack,
-                  BSG_TPM_SIZE32_DATA, &pubkey_exp_pack,
-                  BSG_TPM_SIZE32_DATA, &pubkey_mod_pack);
-
-  //TODO: Maintain a persistent list for pub_keys.
-  //TODO: Verify pub_key is trusted
-
-  mig_key = (VTPM_MIGKEY_LIST *) malloc(sizeof(VTPM_MIGKEY_LIST));
-  memset(mig_key, 0, sizeof(VTPM_MIGKEY_LIST) );
-  mig_key->name_size = name_pack.size;
-  mig_key->name = name_pack.data;
-
-  mig_key->key.encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
-  Crypto_RSABuildCryptoInfoPublic( pubkey_exp_pack.size,
-                                   pubkey_exp_pack.data,
-                                   pubkey_mod_pack.size,
-                                   pubkey_mod_pack.data,
-                                   &mig_key->key);
-
-
-  mig_key->next = vtpm_globals->mig_keys;
-  vtpm_globals->mig_keys = mig_key;
-
-  // free(name_pack.data); Do not free. data is now part of mig_key.
-  free(pubkey_exp_pack.data);
-  free(pubkey_mod_pack.data);
-
-  return TPM_SUCCESS;
-}
diff --git a/tools/vtpm_manager/manager/securestorage.c b/tools/vtpm_manager/manager/securestorage.c
deleted file mode 100644
index d5e6ffd..0000000
--- a/tools/vtpm_manager/manager/securestorage.c
+++ /dev/null
@@ -1,512 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// securestorage.c
-// 
-//  Functions regarding securely storing DMI secrets.
-//
-// ==================================================================
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-
-#include "tcg.h"
-#include "vtpm_manager.h"
-#include "vtpmpriv.h"
-#include "vtsp.h"
-#include "bsg.h"
-#include "crypto.h"
-#include "hashtable.h"
-#include "hashtable_itr.h"
-#include "buffer.h"
-#include "log.h"
-
-TPM_RESULT envelope_encrypt(const buffer_t     *inbuf,
-                            CRYPTO_INFO        *asymkey,
-                            buffer_t           *sealed_data) {
-  TPM_RESULT status = TPM_SUCCESS;
-  symkey_t    symkey;
-  buffer_t    data_cipher = NULL_BUF,
-              symkey_cipher = NULL_BUF;
-  
-  UINT32 i;
-  struct pack_constbuf_t symkey_cipher32, data_cipher32;
-  
-  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Enveloping Input[%d]: 0x", buffer_len(inbuf));
-  for (i=0; i< buffer_len(inbuf); i++)
-    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", inbuf->bytes[i]);
-  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-  
-  // Generate a sym key and encrypt state with it
-  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_symcrypto_genkey (&symkey) );
-  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_symcrypto_encrypt (&symkey, inbuf, &data_cipher) );
-  
-  // Encrypt symmetric key
-  TPMTRYRETURN( VTSP_Bind(    asymkey, 
-			      &symkey.key, 
-			      &symkey_cipher) );
-  
-  // Create output blob: symkey_size + symkey_cipher + state_cipher_size + state_cipher
-  
-  symkey_cipher32.size = buffer_len(&symkey_cipher);
-  symkey_cipher32.data = symkey_cipher.bytes;
-  
-  data_cipher32.size = buffer_len(&data_cipher);
-  data_cipher32.data = data_cipher.bytes;
-  
-  TPMTRYRETURN( buffer_init(sealed_data, 2 * sizeof(UINT32) + symkey_cipher32.size + data_cipher32.size, NULL));
-  
-  BSG_PackList(sealed_data->bytes, 2,
-	       BSG_TPM_SIZE32_DATA, &symkey_cipher32,
-	       BSG_TPM_SIZE32_DATA, &data_cipher32);
-
-  vtpmloginfo(VTPM_LOG_VTPM, "Saved %d bytes of E(symkey) + %d bytes of E(data)\n", buffer_len(&symkey_cipher), buffer_len(&data_cipher));
-
-  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Enveloping Output[%d]: 0x", buffer_len(sealed_data));
-  for (i=0; i< buffer_len(sealed_data); i++)
-    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", sealed_data->bytes[i]);
-  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-
-  goto egress;
-
- abort_egress:
-  vtpmlogerror(VTPM_LOG_VTPM, "Failed to envelope encrypt\n.");
-  
- egress:
-  
-  buffer_free ( &data_cipher);
-  buffer_free ( &symkey_cipher);
-  Crypto_symcrypto_freekey (&symkey);
-  
-  return status;
-}
-
-TPM_RESULT envelope_decrypt(const buffer_t     *cipher,
-                            TCS_CONTEXT_HANDLE TCSContext,
-			    TPM_HANDLE         keyHandle,
-			    const TPM_AUTHDATA *key_usage_auth,
-                            buffer_t           *unsealed_data) {
-
-  TPM_RESULT status = TPM_SUCCESS;
-  symkey_t    symkey;
-  buffer_t    data_cipher = NULL_BUF, 
-              symkey_clear = NULL_BUF, 
-              symkey_cipher = NULL_BUF;
-  struct pack_buf_t symkey_cipher32, data_cipher32;
-  int i;
-
-  memset(&symkey, 0, sizeof(symkey_t));
-
-  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Envelope Decrypt Input[%d]: 0x", buffer_len(cipher) );
-  for (i=0; i< buffer_len(cipher); i++)
-    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cipher->bytes[i]);
-  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-  
-  BSG_UnpackList(cipher->bytes, 2,
-		 BSG_TPM_SIZE32_DATA, &symkey_cipher32,
-		 BSG_TPM_SIZE32_DATA, &data_cipher32);
-  
-  TPMTRYRETURN( buffer_init_alias_convert (&symkey_cipher, 
-				           symkey_cipher32.size, 
-				           symkey_cipher32.data) );
-  
-  TPMTRYRETURN( buffer_init_alias_convert (&data_cipher, 
-				           data_cipher32.size, 
-				           data_cipher32.data) );
-
-  // Decrypt Symmetric Key
-  TPMTRYRETURN( VTSP_Unbind(  TCSContext,
-			      keyHandle,
-			      &symkey_cipher,
-			      key_usage_auth,
-			      &symkey_clear,
-			      &(vtpm_globals->keyAuth) ) );
-  
-  // create symmetric key using saved bits
-  Crypto_symcrypto_initkey (&symkey, &symkey_clear);
-  
-  // Decrypt State
-  TPMTRY(TPM_DECRYPT_ERROR, Crypto_symcrypto_decrypt (&symkey, &data_cipher, unsealed_data) );
-
-  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Envelope Decrypte Output[%d]: 0x", buffer_len(unsealed_data));
-  for (i=0; i< buffer_len(unsealed_data); i++)
-    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", unsealed_data->bytes[i]);
-  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-  
-  goto egress;
-  
- abort_egress:
-  vtpmlogerror(VTPM_LOG_VTPM, "Failed to envelope decrypt data\n.");
-  
- egress:
-  buffer_free ( &data_cipher);
-  buffer_free ( &symkey_clear);
-  buffer_free ( &symkey_cipher);
-  Crypto_symcrypto_freekey (&symkey);
-  
-  return status;
-}
-
-TPM_RESULT VTPM_Handle_Save_NVM(VTPM_DMI_RESOURCE *myDMI, 
-				const buffer_t *inbuf, 
-				buffer_t *outbuf) {
-  
-  TPM_RESULT status = TPM_SUCCESS;
-  int fh;
-  long bytes_written;
-  buffer_t sealed_NVM = NULL_BUF;
-  
-  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Saving %d bytes of NVM.\n", buffer_len(inbuf));
-
-  TPMTRYRETURN( envelope_encrypt(inbuf,
-                                 &vtpm_globals->storageKey,
-                                 &sealed_NVM) );
-				  
-  // Write sealed blob off disk from NVMLocation
-  // TODO: How to properly return from these. Do we care if we return failure
-  //       after writing the file? We can't get the old one back.
-  // TODO: Backup old file and try and recover that way.
-  fh = open(myDMI->NVMLocation, O_WRONLY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
-  if ( (bytes_written = write(fh, sealed_NVM.bytes, buffer_len(&sealed_NVM) ) != (long) buffer_len(&sealed_NVM))) {
-    vtpmlogerror(VTPM_LOG_VTPM, "We just overwrote a DMI_NVM and failed to finish. %ld/%ld bytes.\n", bytes_written, (long)buffer_len(&sealed_NVM));
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-  close(fh);
-  
-  Crypto_SHA1Full (sealed_NVM.bytes, buffer_len(&sealed_NVM), (BYTE *) &myDMI->NVM_measurement);   
-  
-  goto egress;
-  
- abort_egress:
-  vtpmlogerror(VTPM_LOG_VTPM, "Failed to save NVM\n.");
-  
- egress:
-  buffer_free(&sealed_NVM);
-  return status;
-}
-
-
-/* Expected Params: inbuf = null, outbuf = sealed blob size, sealed blob.*/
-TPM_RESULT VTPM_Handle_Load_NVM(VTPM_DMI_RESOURCE *myDMI, 
-				const buffer_t    *inbuf, 
-				buffer_t          *outbuf) {
-  
-  TPM_RESULT status = TPM_SUCCESS;
-
-  buffer_t sealed_NVM = NULL_BUF;
-  long fh_size;
-  int fh, stat_ret, i;
-  struct stat file_stat;
-  TPM_DIGEST sealedNVMHash;
-   
-  if (myDMI->NVMLocation == NULL) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Unable to load NVM because the file name NULL.\n");
-    status = TPM_AUTHFAIL;
-    goto abort_egress;
-  }
-  
-  //Read sealed blob off disk from NVMLocation
-  fh = open(myDMI->NVMLocation, O_RDONLY);
-  stat_ret = fstat(fh, &file_stat);
-  if (stat_ret == 0) 
-    fh_size = file_stat.st_size;
-  else {
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-  
-  TPMTRYRETURN( buffer_init( &sealed_NVM, fh_size, NULL) );
-  if (read(fh, sealed_NVM.bytes, buffer_len(&sealed_NVM)) != fh_size) {
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-  close(fh);
-  
-  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Load_NVMing[%d],\n", buffer_len(&sealed_NVM));
-  
-  Crypto_SHA1Full(sealed_NVM.bytes, buffer_len(&sealed_NVM), (BYTE *) &sealedNVMHash);    
-  
-  // Verify measurement of sealed blob.
-  if (memcmp(&sealedNVMHash, &myDMI->NVM_measurement, sizeof(TPM_DIGEST)) ) {
-    vtpmlogerror(VTPM_LOG_VTPM, "VTPM LoadNVM NVM measurement check failed.\n");
-    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Correct hash: ");
-    for (i=0; i< sizeof(TPM_DIGEST); i++)
-      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", ((BYTE*)&myDMI->NVM_measurement)[i]);
-    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-
-    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Measured hash: ");
-    for (i=0; i< sizeof(TPM_DIGEST); i++)
-      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", ((BYTE*)&sealedNVMHash)[i]);
-    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-    
-    status = TPM_AUTHFAIL;
-    goto abort_egress;
-  }
-  
-  TPMTRYRETURN( envelope_decrypt(&sealed_NVM,
-                                 myDMI->TCSContext,
-		        	 vtpm_globals->storageKeyHandle,
-			         (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
-                                 outbuf) );  
-  goto egress;
-  
- abort_egress:
-  vtpmlogerror(VTPM_LOG_VTPM, "Failed to load NVM\n.");
-  
- egress:
-  buffer_free( &sealed_NVM );
-  
-  return status;
-}
-
-
-TPM_RESULT VTPM_SaveManagerData(void) {
-  TPM_RESULT status=TPM_SUCCESS;
-  int fh, dmis=-1;
-
-  BYTE *flat_boot_key=NULL, *flat_dmis=NULL, *flat_enc=NULL;
-  buffer_t clear_flat_global=NULL_BUF, enc_flat_global=NULL_BUF;
-  UINT32 storageKeySize = buffer_len(&vtpm_globals->storageKeyWrap);
-  UINT32 bootKeySize = buffer_len(&vtpm_globals->bootKeyWrap);
-  struct pack_buf_t storage_key_pack = {storageKeySize, vtpm_globals->storageKeyWrap.bytes};
-  struct pack_buf_t boot_key_pack = {bootKeySize, vtpm_globals->bootKeyWrap.bytes};
-  BYTE vtpm_manager_gen = VTPM_MANAGER_GEN;
-
-  struct hashtable_itr *dmi_itr;
-  VTPM_DMI_RESOURCE *dmi_res;
-
-  UINT32 boot_key_size = 0, flat_dmis_size = 0;
-
-  // Initially fill these with buffer sizes for each data type. Later fill
-  // in actual size, once flattened.
-  boot_key_size =  sizeof(UINT32) +       // bootkeysize
-                   bootKeySize;           // boot key
-
-  TPMTRYRETURN(buffer_init(&clear_flat_global,sizeof(BYTE) + // manager version
-                                              3*sizeof(TPM_DIGEST) + // Auths
-                                              sizeof(UINT32) +// storagekeysize
-                                              storageKeySize, NULL) ); // storage key
-
-
-  flat_boot_key = (BYTE *) malloc( boot_key_size );
-  flat_enc = (BYTE *) malloc( sizeof(UINT32) );
-
-  boot_key_size = BSG_PackList(flat_boot_key, 1,
-                               BSG_TPM_SIZE32_DATA, &boot_key_pack);
-
-  BSG_PackList(clear_flat_global.bytes, 4,
-                BSG_TYPE_BYTE,    &vtpm_manager_gen,
-                BSG_TPM_AUTHDATA, &vtpm_globals->owner_usage_auth,
-                BSG_TPM_SECRET,   &vtpm_globals->storage_key_usage_auth,
-                BSG_TPM_SIZE32_DATA, &storage_key_pack);
-
-  TPMTRYRETURN(envelope_encrypt(&clear_flat_global,
-                                &vtpm_globals->bootKey,
-                                &enc_flat_global) );
-
-  BSG_PackConst(buffer_len(&enc_flat_global), 4, flat_enc);
-
-  // Per DMI values to be saved (if any exit)
-  if (hashtable_count(vtpm_globals->dmi_map) > 1) {
-
-    flat_dmis = (BYTE *) malloc( 
-                     (hashtable_count(vtpm_globals->dmi_map) - 1) * // num DMIS (-1 for Dom0)
-                     (sizeof(UINT32) +sizeof(BYTE) + 2*sizeof(TPM_DIGEST)) ); // Per DMI info
-
-    dmi_itr = hashtable_iterator(vtpm_globals->dmi_map);
-    do {
-      dmi_res = (VTPM_DMI_RESOURCE *) hashtable_iterator_value(dmi_itr);
-      dmis++;
-
-      // No need to save dmi0.
-      if (dmi_res->dmi_id == 0)
-        continue;
-
-
-      flat_dmis_size += BSG_PackList( flat_dmis + flat_dmis_size, 4,
-                                        BSG_TYPE_UINT32, &dmi_res->dmi_id,
-                                        BSG_TYPE_BYTE, &dmi_res->dmi_type,
-                                        BSG_TPM_DIGEST, &dmi_res->NVM_measurement,
-                                        BSG_TPM_DIGEST, &dmi_res->DMI_measurement);
-
-    } while (hashtable_iterator_advance(dmi_itr));
-  }
-
-  fh = open(STATE_FILE, O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
-  if (fh == -1) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Unable to open %s file for write.\n", STATE_FILE);
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  if ( ( write(fh, flat_boot_key, boot_key_size) != boot_key_size ) ||
-       ( write(fh, flat_enc, sizeof(UINT32)) != sizeof(UINT32) ) ||
-       ( write(fh, enc_flat_global.bytes, buffer_len(&enc_flat_global)) != buffer_len(&enc_flat_global) ) ||
-       ( write(fh, flat_dmis, flat_dmis_size) != flat_dmis_size ) ) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Failed to completely write service data.\n");
-    status = TPM_IOERROR;
-    goto abort_egress;
- }
-
-  goto egress;
-
- abort_egress:
- egress:
-
-  free(flat_boot_key);
-  free(flat_enc);
-  buffer_free(&enc_flat_global);
-  free(flat_dmis);
-  close(fh);
-
-  vtpmloginfo(VTPM_LOG_VTPM, "Saved VTPM Manager state (status = %d, dmis = %d)\n", (int) status, dmis);
-  return status;
-}
-
-TPM_RESULT VTPM_LoadManagerData(void) {
-
-  TPM_RESULT status=TPM_SUCCESS;
-  int fh, stat_ret, dmis=0;
-  long fh_size = 0, step_size;
-  BYTE *flat_table=NULL;
-  buffer_t  unsealed_data, enc_table_abuf;
-  struct pack_buf_t storage_key_pack, boot_key_pack;
-  UINT32 *dmi_id_key, enc_size;
-  BYTE vtpm_manager_gen;
-
-  VTPM_DMI_RESOURCE *dmi_res;
-  UINT32 dmi_id;
-  BYTE dmi_type;
-  struct stat file_stat;
-
-  TPM_HANDLE boot_key_handle;
-  TPM_AUTHDATA boot_usage_auth;
-  memset(&boot_usage_auth, 0, sizeof(TPM_AUTHDATA));
-
-  fh = open(STATE_FILE, O_RDONLY );
-  stat_ret = fstat(fh, &file_stat);
-  if (stat_ret == 0)
-    fh_size = file_stat.st_size;
-  else {
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  flat_table = (BYTE *) malloc(fh_size);
-
-  if ((long) read(fh, flat_table, fh_size) != fh_size ) {
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  // Read Boot Key
-  step_size = BSG_UnpackList( flat_table, 2,
-                              BSG_TPM_SIZE32_DATA, &boot_key_pack,
-                              BSG_TYPE_UINT32, &enc_size);
-
-  TPMTRYRETURN(buffer_init(&vtpm_globals->bootKeyWrap, 0, 0) );
-  TPMTRYRETURN(buffer_init_alias_convert(&enc_table_abuf, enc_size, flat_table + step_size) );
-  TPMTRYRETURN(buffer_append_raw(&vtpm_globals->bootKeyWrap, boot_key_pack.size, boot_key_pack.data) );
-
-  //Load Boot Key
-  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
-                              TPM_SRK_KEYHANDLE,
-                              &vtpm_globals->bootKeyWrap,
-                              &SRK_AUTH,
-                              &boot_key_handle,
-                              &vtpm_globals->keyAuth,
-                              &vtpm_globals->bootKey,
-                              FALSE) );
-
-  TPMTRYRETURN( envelope_decrypt(&enc_table_abuf,
-                                 vtpm_globals->manager_tcs_handle,
-                                 boot_key_handle,
-                                 (const TPM_AUTHDATA*) &boot_usage_auth,
-                                 &unsealed_data) );
-  step_size += enc_size;
-
-  if (*unsealed_data.bytes != VTPM_MANAGER_GEN) {
-      // Once there is more than one gen, this will include some compatability stuff
-      vtpmlogerror(VTPM_LOG_VTPM, "Warning: Manager Data file is gen %d, which this manager is gen %d.\n", vtpm_manager_gen, VTPM_MANAGER_GEN);
-  }
-
-  // Global Values needing to be saved
-  BSG_UnpackList( unsealed_data.bytes, 4,
-                  BSG_TYPE_BYTE,    &vtpm_manager_gen, 
-                  BSG_TPM_AUTHDATA, &vtpm_globals->owner_usage_auth,
-                  BSG_TPM_SECRET,   &vtpm_globals->storage_key_usage_auth,
-                  BSG_TPM_SIZE32_DATA, &storage_key_pack);
-
-  TPMTRYRETURN(buffer_init(&vtpm_globals->storageKeyWrap, 0, 0) );
-  TPMTRYRETURN(buffer_append_raw(&vtpm_globals->storageKeyWrap, storage_key_pack.size, storage_key_pack.data) );
-
-  // Per DMI values to be saved
-  while ( step_size < fh_size ){
-    if (fh_size - step_size < (long) (sizeof(UINT32) + sizeof(BYTE) + 2*sizeof(TPM_DIGEST))) {
-      vtpmlogerror(VTPM_LOG_VTPM, "Encountered %ld extra bytes at end of manager state.\n", fh_size-step_size);
-      step_size = fh_size;
-    } else {
-      step_size += BSG_UnpackList(flat_table + step_size, 2,
-                                 BSG_TYPE_UINT32, &dmi_id,
-                                 BSG_TYPE_BYTE, &dmi_type);
-
-      //TODO: Try and gracefully recover from problems.
-      TPMTRYRETURN(init_dmi(dmi_id, dmi_type, &dmi_res) );
-      dmis++;
-
-      step_size += BSG_UnpackList(flat_table + step_size, 2,
-                                 BSG_TPM_DIGEST, &dmi_res->NVM_measurement,
-                                 BSG_TPM_DIGEST, &dmi_res->DMI_measurement);
-    }
-
-  }
-
-  vtpmloginfo(VTPM_LOG_VTPM, "Loaded saved state (dmis = %d).\n", dmis);
-  goto egress;
-
- abort_egress:
-  vtpmlogerror(VTPM_LOG_VTPM, "Failed to load service data with error = %s\n", tpm_get_error_name(status));
- egress:
-
-  free(flat_table);
-  close(fh);
-
-  // TODO: Could be nice and evict BootKey. (Need to add EvictKey to VTSP.
-
-  return status;
-}
-
diff --git a/tools/vtpm_manager/manager/tpmpassthrough.c b/tools/vtpm_manager/manager/tpmpassthrough.c
deleted file mode 100644
index 9b1e5f8..0000000
--- a/tools/vtpm_manager/manager/tpmpassthrough.c
+++ /dev/null
@@ -1,110 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// tpmpassthrough.c
-// 
-//  Functions regarding passing DMI requests to HWTPM
-//
-// ==================================================================
-
-#include "tcg.h"
-#include "vtpm_manager.h"
-#include "vtpmpriv.h"
-#include "vtsp.h"
-#include "log.h"
-
-TPM_RESULT VTPM_Handle_TPM_Command( VTPM_DMI_RESOURCE *dmi,
-				    buffer_t *inbuf,  
-				    buffer_t *outbuf) {
-  
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_COMMAND_CODE *ord;               
-  
-  ord = (TPM_COMMAND_CODE *) (inbuf->bytes + sizeof(TPM_TAG) + sizeof(UINT32));
-  
-  switch (*ord) {
-    
-    // Forbidden for DMI use
-  case TPM_ORD_TakeOwnership:
-  case TPM_ORD_ChangeAuthOwner:
-  case TPM_ORD_DirWriteAuth:
-  case TPM_ORD_DirRead:
-  case TPM_ORD_AuthorizeMigrationKey:
-  case TPM_ORD_CreateMaintenanceArchive:
-  case TPM_ORD_LoadMaintenanceArchive:
-  case TPM_ORD_KillMaintenanceFeature:
-  case TPM_ORD_LoadManuMaintPub:
-  case TPM_ORD_ReadManuMaintPub:
-  case TPM_ORD_SelfTestFull:
-  case TPM_ORD_SelfTestStartup:
-  case TPM_ORD_CertifySelfTest:
-  case TPM_ORD_ContinueSelfTest:
-  case TPM_ORD_GetTestResult:
-  case TPM_ORD_Reset:
-  case TPM_ORD_OwnerClear:
-  case TPM_ORD_DisableOwnerClear:
-  case TPM_ORD_ForceClear:
-  case TPM_ORD_DisableForceClear:
-  case TPM_ORD_GetCapabilityOwner:
-  case TPM_ORD_OwnerSetDisable:
-  case TPM_ORD_PhysicalEnable:
-  case TPM_ORD_PhysicalDisable:
-  case TPM_ORD_SetOwnerInstall:
-  case TPM_ORD_PhysicalSetDeactivated:
-  case TPM_ORD_SetTempDeactivated:
-  case TPM_ORD_CreateEndorsementKeyPair:
-  case TPM_ORD_GetAuditEvent:
-  case TPM_ORD_GetAuditEventSigned:
-  case TPM_ORD_GetOrdinalAuditStatus:
-  case TPM_ORD_SetOrdinalAuditStatus:
-  case TPM_ORD_SetRedirection:
-  case TPM_ORD_FieldUpgrade:
-  case TSC_ORD_PhysicalPresence:
-    status = TPM_DISABLED_CMD;
-    goto abort_egress;
-    break;
-    
-  } // End ORD Switch
-  
-  // Call TCS with command
-  
-  TPMTRY(TPM_IOERROR, VTSP_RawTransmit( dmi->TCSContext,inbuf, outbuf) );
-  
-  goto egress;
-  
- abort_egress:
-  vtpmloginfo(VTPM_LOG_VTPM, "TPM Command Failed in tpmpassthrough.\n");
- egress:
-  
-  return status;
-}
diff --git a/tools/vtpm_manager/manager/vtpm_ipc.c b/tools/vtpm_manager/manager/vtpm_ipc.c
deleted file mode 100644
index 319dc83..0000000
--- a/tools/vtpm_manager/manager/vtpm_ipc.c
+++ /dev/null
@@ -1,141 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-//
-// vtpm_ipc.c Implements ipc routines using file io. This file can
-// be replaced with other ipc types.
-//
-// ===================================================================
-
-#include <sys/stat.h>
-#include "vtpm_ipc.h"
-#include "vtpmpriv.h"
-#include "log.h"
-
-int vtpm_ipc_init(vtpm_ipc_handle_t *ipc_h, char* name, int flags, BOOL create) {
-  ipc_h->name = name;
-  ipc_h->flags = flags;
-  ipc_h->fh = VTPM_IPC_CLOSED;
-
-  if (create)
-    return(vtpm_ipc_create(ipc_h));
-  else
-    return 0;
-}
-
-// Create the file that needs opening. Used only for FIFOs
-// FYI: This may cause problems in other file IO schemes. We'll see.
-int vtpm_ipc_create(vtpm_ipc_handle_t *ipc_h) {
-  int fh;
-  struct stat file_info;
-
-  if ((!ipc_h) || (!ipc_h->name))
-    return -1;
-
-  if ( stat(ipc_h->name, &file_info) == -1) {
-    if ( mkfifo(ipc_h->name, S_IWUSR | S_IRUSR ) ) {
-      vtpmlogerror(VTPM_LOG_VTPM, "Failed to create fifo %s.\n", ipc_h->name);
-      return -1;
-    }
-  }
-
-  ipc_h->fh = VTPM_IPC_CLOSED;
-
-  return 0;
-}
-
-
-// Read size bytes. If FH isn't open, open it.
-int vtpm_ipc_read(vtpm_ipc_handle_t *ipc_h, vtpm_ipc_handle_t *alt_ipc_h, BYTE *bytes, UINT32 size){
-  vtpm_ipc_handle_t *my_ipc_h;
-  int result;
-  
-  if (ipc_h) {
-    my_ipc_h = ipc_h;
-  } else {
-    my_ipc_h = alt_ipc_h;
-  }
-  
-  if (my_ipc_h->fh == VTPM_IPC_CLOSED) {   
-    my_ipc_h->fh = open(my_ipc_h->name, my_ipc_h->flags);
-  }
-
-  if ( my_ipc_h->fh == VTPM_IPC_CLOSED ) {
-    vtpmlogerror(VTPM_LOG_VTPM, "VTPM ERROR: Can't open %s for reading.\n", my_ipc_h->name);
-    return -1;
-  }
-
-  result = read(my_ipc_h->fh, bytes, size);
-  if (result < 0) {
-    my_ipc_h->fh = VTPM_IPC_CLOSED;
-  }
-
-  return (result);
-}
-
-// Write size bytes. If FH isn't open, open it.
-int vtpm_ipc_write(vtpm_ipc_handle_t *ipc_h, vtpm_ipc_handle_t *alt_ipc_h, BYTE *bytes, UINT32 size) {
-  vtpm_ipc_handle_t *my_ipc_h;
-  int result;
-
-  if (ipc_h) {
-    my_ipc_h = ipc_h;
-  } else {
-    my_ipc_h = alt_ipc_h;
-  }
-
-  if (my_ipc_h->fh == VTPM_IPC_CLOSED) {
-    my_ipc_h->fh = open(my_ipc_h->name, my_ipc_h->flags);
-  }
-
-  if ( my_ipc_h->fh == VTPM_IPC_CLOSED ) {
-    vtpmlogerror(VTPM_LOG_VTPM, "VTPM ERROR: Can't open %s for writing.\n", my_ipc_h->name);
-    return -1;
-  }
-
-  result = write(my_ipc_h->fh, bytes, size);
-  if (result < 0) {
-    my_ipc_h->fh = VTPM_IPC_CLOSED;
-  }
-
-  return (result);
-}
-
-// Mark file as closed and try and close it. Errors not reported.
-void vtpm_ipc_close(vtpm_ipc_handle_t *ipc_h) {
-
-  if (ipc_h) {
-    close(ipc_h->fh);
-    ipc_h->fh = VTPM_IPC_CLOSED;
-  }
-
-}
diff --git a/tools/vtpm_manager/manager/vtpm_ipc.h b/tools/vtpm_manager/manager/vtpm_ipc.h
deleted file mode 100644
index 529c4a2..0000000
--- a/tools/vtpm_manager/manager/vtpm_ipc.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// ===================================================================
-//
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above
-//     copyright notice, this list of conditions and the following
-//     disclaimer in the documentation and/or other materials provided
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-//
-// vtpm_ipc.h Header for interprocess communication between VTPM manager
-// and Guests or VTPMs
-//
-// ===================================================================
-
-#ifndef __VTPM_IO_H__
-#define __VTPM_IO_H__
-
-#include "tcg.h"
-
-#define VTPM_IPC_CLOSED -1
-
-// Represents an (somewhat) abstracted io handle.
-typedef struct vtpm_ipc_handle_t {
-  int fh;              // IO handle.
-  int flags;           // Flags for opening. This may need to become
-                       // a void *, but for now files use an int.
-  char *name;          // Names for debugging as well as filenames
-                       // for file-based io.
-} vtpm_ipc_handle_t;
-
-
-int vtpm_ipc_init(vtpm_ipc_handle_t *ioh, char* name, int flags, BOOL create);
-
-// Create the file that needs opening. Used only for FIFOs
-// FYI: This may cause problems in other file IO schemes. We'll see.
-int vtpm_ipc_create(vtpm_ipc_handle_t *ioh);
-
-// Read size bytes. If FH isn't open, open it.
-int vtpm_ipc_read(vtpm_ipc_handle_t *ioh, vtpm_ipc_handle_t *alt_ioh, BYTE *bytes, UINT32 size);
-
-// Write size bytes. If FH isn't open, open it.
-int vtpm_ipc_write(vtpm_ipc_handle_t *ioh, vtpm_ipc_handle_t *alt_ioh, BYTE *bytes, UINT32 size);
-
-// Mark file as closed and try and close it. Errors not reported.
-void vtpm_ipc_close(vtpm_ipc_handle_t *ioh);
-
-#endif
diff --git a/tools/vtpm_manager/manager/vtpm_lock.c b/tools/vtpm_manager/manager/vtpm_lock.c
deleted file mode 100644
index e737d60..0000000
--- a/tools/vtpm_manager/manager/vtpm_lock.c
+++ /dev/null
@@ -1,63 +0,0 @@
-// ===================================================================
-//
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above
-//     copyright notice, this list of conditions and the following
-//     disclaimer in the documentation and/or other materials provided
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-//
-// vtpm_lock.c Provided controlled sync around access to vtpm structures
-//
-// ===================================================================
-
-#include <pthread.h>
-#include "vtpm_lock.h"
-
-static pthread_rwlock_t vtpm_lock;
-
-void vtpm_lock_init() {
-
-  pthread_rwlock_init( &vtpm_lock, NULL);
-}
-
-void vtpm_lock_destroy(){
-  pthread_rwlock_destroy(&vtpm_lock);
-}
-
-void vtpm_lock_rdlock(){
-  pthread_rwlock_rdlock(&vtpm_lock);
-}
-
-void vtpm_lock_wrlock(){
-  pthread_rwlock_wrlock(&vtpm_lock);
-}
-
-void vtpm_lock_unlock(){
-  pthread_rwlock_unlock(&vtpm_lock);
-}
-
diff --git a/tools/vtpm_manager/manager/vtpm_lock.h b/tools/vtpm_manager/manager/vtpm_lock.h
deleted file mode 100644
index 53a339d..0000000
--- a/tools/vtpm_manager/manager/vtpm_lock.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// ===================================================================
-//
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above
-//     copyright notice, this list of conditions and the following
-//     disclaimer in the documentation and/or other materials provided
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-//
-// vtpm_lock.h Provided controlled sync around access to vtpm structures
-//
-// ===================================================================
-
-#ifndef __VTPM_LOCK_H__
-#define __VTPM_LOCK_H__
-
-void vtpm_lock_init();
-void vtpm_lock_destroy();
-
-void vtpm_lock_rdlock();
-void vtpm_lock_wrlock();
-void vtpm_lock_unlock();
-
-#endif
diff --git a/tools/vtpm_manager/manager/vtpm_manager.c b/tools/vtpm_manager/manager/vtpm_manager.c
deleted file mode 100644
index e089f78..0000000
--- a/tools/vtpm_manager/manager/vtpm_manager.c
+++ /dev/null
@@ -1,285 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtpm_manager.c
-// 
-//  This file will house the main logic of the VTPM Manager
-//
-// ==================================================================
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-
-#include "vtpm_manager.h"
-#include "vtpmpriv.h"
-#include "vtsp.h"
-#include "bsg.h"
-#include "hashtable.h"
-#include "hashtable_itr.h"
-
-#include "log.h"
-#include "buffer.h"
-
-VTPM_GLOBALS *vtpm_globals=NULL;
-
-// --------------------------- Well Known Auths --------------------------
-const TPM_AUTHDATA SRK_AUTH = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-                                  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-
-#ifdef WELL_KNOWN_OWNER_AUTH
-static BYTE FIXED_OWNER_AUTH[20] =  {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-                                  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-#endif
-
-
-// -------------------------- Hash table functions --------------------
-
-static unsigned int hashfunc32(void *ky) {
-  return (* (UINT32 *) ky);
-}
-
-static int equals32(void *k1, void *k2) {
-  return (*(UINT32 *) k1 == *(UINT32 *) k2);
-}
-
-// --------------------------- Functions ------------------------------
-
-TPM_RESULT VTPM_Create_Manager(){
-  
-  TPM_RESULT status = TPM_SUCCESS;
-  
-  // Generate Auth for Owner
-#ifdef WELL_KNOWN_OWNER_AUTH 
-  memcpy(vtpm_globals->owner_usage_auth, FIXED_OWNER_AUTH, sizeof(TPM_AUTHDATA));
-#else    
-  Crypto_GetRandom(vtpm_globals->owner_usage_auth, sizeof(TPM_AUTHDATA) );
-#endif
-
-  // Take Owership of TPM
-  CRYPTO_INFO ek_cryptoInfo;
-  
-  status = VTSP_ReadPubek(vtpm_globals->manager_tcs_handle, &ek_cryptoInfo);
-  
-  // If we can read PubEK then there is no owner and we should take it.
-  // We use the abilty to read the pubEK to flag that the TPM is owned.
-  // FIXME: Change to just trying to take ownership and react to the status
-  if (status == TPM_SUCCESS) { 
-    TPMTRYRETURN(VTSP_TakeOwnership(vtpm_globals->manager_tcs_handle,
-				    (const TPM_AUTHDATA*)&vtpm_globals->owner_usage_auth, 
-				    &SRK_AUTH,
-				    &ek_cryptoInfo,
-				    &vtpm_globals->keyAuth)); 
-  
-    TPMTRYRETURN(VTSP_DisablePubekRead(vtpm_globals->manager_tcs_handle,
-                                       (const TPM_AUTHDATA*)&vtpm_globals->owner_usage_auth,  
-                                       &vtpm_globals->keyAuth));     
-  } else {
-    vtpmloginfo(VTPM_LOG_VTPM, "Failed to readEK meaning TPM has an owner. Creating Keys off existing SRK.\n");
-  }
-  
-  // Generate storage key's auth
-  Crypto_GetRandom(  &vtpm_globals->storage_key_usage_auth, 
-		     sizeof(TPM_AUTHDATA) );
-  
-  TCS_AUTH osap;
-  TPM_AUTHDATA sharedsecret;
-  
-  TPMTRYRETURN( VTSP_OSAP(vtpm_globals->manager_tcs_handle,
-			  TPM_ET_KEYHANDLE,
-			  TPM_SRK_KEYHANDLE, 
-			  &SRK_AUTH,
-			  &sharedsecret, 
-			  &osap) ); 
-
-  osap.fContinueAuthSession = FALSE;
- 
- 
-  TPMTRYRETURN( VTSP_CreateWrapKey( vtpm_globals->manager_tcs_handle,
-				    TPM_KEY_BIND,
-				    (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
-				    TPM_SRK_KEYHANDLE, 
-				    (const TPM_AUTHDATA*)&sharedsecret,
-				    &vtpm_globals->storageKeyWrap,
-				    &osap) );
-  
-  // Generate boot key's auth
-  TPM_AUTHDATA bootKeyWrapAuth;
-  memset(&bootKeyWrapAuth, 0, sizeof(bootKeyWrapAuth));
-  
-  TPMTRYRETURN( VTSP_OSAP(vtpm_globals->manager_tcs_handle,
-			  TPM_ET_KEYHANDLE,
-			  TPM_SRK_KEYHANDLE, 
-			  &SRK_AUTH,
-			  &sharedsecret, 
-			  &osap) ); 
-
-  osap.fContinueAuthSession = FALSE;
- 
-  // FIXME: This key protects the global secrets on disk. It should use TPM
-  //        PCR bindings to limit its use to legit configurations.
-  //        Current binds are open, implying a Trusted VM contains this code.
-  //        If this VM is not Trusted, use measurement and PCR bindings.
-  TPMTRYRETURN( VTSP_CreateWrapKey( vtpm_globals->manager_tcs_handle,
-				    TPM_KEY_BIND,
-				    (const TPM_AUTHDATA*)&bootKeyWrapAuth,
-				    TPM_SRK_KEYHANDLE, 
-				    (const TPM_AUTHDATA*)&sharedsecret,
-				    &vtpm_globals->bootKeyWrap,
-				    &osap) );
-
-  // Populate CRYPTO_INFO vtpm_globals->bootKey. This does not load it into the TPM
-  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
-                              TPM_SRK_KEYHANDLE,
-                              &vtpm_globals->bootKeyWrap,
-                              NULL,
-                              NULL,
-                              NULL,
-                              &vtpm_globals->bootKey,
-                              TRUE ) );
-
-  TPMTRYRETURN( VTSP_SaveState(vtpm_globals->manager_tcs_handle) );
-  goto egress;
-  
- abort_egress:
-  exit(1);
-  
- egress:
-  vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager (Status = %d).\n", status);
-  return status;
-  
-}
-
-///////////////////////////////////////////////////////////////////////////////
-TPM_RESULT VTPM_Init_Manager() {
-  TPM_RESULT status = TPM_FAIL, serviceStatus;   
-  BYTE *randomsead;
-  UINT32 randomsize=256;
-
-  if ((vtpm_globals = (VTPM_GLOBALS *) malloc(sizeof(VTPM_GLOBALS))) == NULL){
-    status = TPM_FAIL;
-    goto abort_egress;
-  }
-  memset(vtpm_globals, 0, sizeof(VTPM_GLOBALS));
-
-  vtpm_globals->connected_dmis = 0;
-
-  if ((vtpm_globals->dmi_map = create_hashtable(10, hashfunc32, equals32)) == NULL){
-    status = TPM_FAIL;
-    goto abort_egress;
-  }
-  
-  // Create new TCS Object
-  vtpm_globals->manager_tcs_handle = 0;
- 
-  TPMTRYRETURN(TCS_create());
-  
-  // Create TCS Context for service
-  TPMTRYRETURN( TCS_OpenContext(&vtpm_globals->manager_tcs_handle ) );
-
-  TPMTRYRETURN( TCSP_GetRandom(vtpm_globals->manager_tcs_handle, 
-			       &randomsize, 
-			       &randomsead));
-  
-  Crypto_Init(randomsead, randomsize);
-  TPMTRYRETURN( TCS_FreeMemory (vtpm_globals->manager_tcs_handle, randomsead)); 
-	
-  // Create OIAP session for service's authorized commands
-  TPMTRYRETURN( VTSP_OIAP( vtpm_globals->manager_tcs_handle, 
-			   &vtpm_globals->keyAuth) );
-  vtpm_globals->keyAuth.fContinueAuthSession = TRUE;
-
-  vtpm_globals->mig_keys = NULL;
-
-  // If fails, create new Manager.
-  serviceStatus = VTPM_LoadManagerData();
-  if (serviceStatus == TPM_IOERROR) {
-    vtpmloginfo(VTPM_LOG_VTPM, "Failed to read manager file. Assuming first time initialization.\n");
-    TPMTRYRETURN( VTPM_Create_Manager() );    
-    TPMTRYRETURN( VTPM_SaveManagerData() );
-  } else if (serviceStatus != TPM_SUCCESS) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Failed to read existing manager file");
-    exit(1);
-  }
-
-  //Load Storage Key 
-  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
-			      TPM_SRK_KEYHANDLE,
-			      &vtpm_globals->storageKeyWrap,
-			      &SRK_AUTH,
-			      &vtpm_globals->storageKeyHandle,
-			      &vtpm_globals->keyAuth,
-			      &vtpm_globals->storageKey,
-                              FALSE ) );
-
-  // Create entry for Dom0 for control messages
-  TPMTRYRETURN( VTPM_Handle_New_DMI(NULL) );
-  
-  goto egress;
-  
- abort_egress:
- egress:
-  
-  return(status);
-}
-
-/////////////////////////////////////////////////////////////////////////////// 
-void VTPM_Stop_Manager() {
-  VTPM_DMI_RESOURCE *dmi_res;
-  struct hashtable_itr *dmi_itr;
-  
-  // Close all the TCS contexts. TCS should evict keys based on this
-  if (hashtable_count(vtpm_globals->dmi_map) > 0) {
-    dmi_itr = hashtable_iterator(vtpm_globals->dmi_map);
-    do {
-      dmi_res = (VTPM_DMI_RESOURCE *) hashtable_iterator_value(dmi_itr);
-      if (dmi_res->connected) 
-	close_dmi( dmi_res ); // Not really interested in return code
-      
-    } while (hashtable_iterator_advance(dmi_itr));
-		free (dmi_itr);
-  }
-  
-  if ( VTPM_SaveManagerData() != TPM_SUCCESS ) 
-    vtpmlogerror(VTPM_LOG_VTPM, "Unable to save manager data.\n");
-
-  TCS_CloseContext(vtpm_globals->manager_tcs_handle);
-  TCS_destroy();
-  
-  hashtable_destroy(vtpm_globals->dmi_map, 1);
-  free(vtpm_globals);
-  
-  Crypto_Exit();
-	
-  vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
-}
diff --git a/tools/vtpm_manager/manager/vtpm_manager.h b/tools/vtpm_manager/manager/vtpm_manager.h
deleted file mode 100644
index a324a8f..0000000
--- a/tools/vtpm_manager/manager/vtpm_manager.h
+++ /dev/null
@@ -1,150 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtpm_manager.h
-// 
-//  Public Interface header for VTPM Manager
-//
-// ==================================================================
-
-#ifndef __VTPM_MANAGER_H__
-#define __VTPM_MANAGER_H__
-
-#define VTPM_TAG_REQ 0x01c1
-#define VTPM_TAG_RSP 0x01c4
-#define COMMAND_BUFFER_SIZE 4096
-
-// Header sizes. Note Header MAY include the DMI
-#define VTPM_COMMAND_HEADER_SIZE_CLT ( 2 + 4 + 4)
-//                    sizeof(TPM_TAG + UINT32 + TPM_COMMAND_CODE)
-#define VTPM_COMMAND_HEADER_SIZE_SRV ( 4 + VTPM_COMMAND_HEADER_SIZE_CLT )
-//                    sizeof( UINT32 + VTPM_COMMAND_HEADER_SIZE_CLT)
-
-//************************ Command Codes ****************************
-#define VTPM_ORD_BASE       0x0000
-#define VTPM_PRIV_MASK      0x01000000 // Priviledged VTPM Command
-#define VTPM_PRIV_BASE      (VTPM_ORD_BASE | VTPM_PRIV_MASK)
-
-// Non-priviledged VTPM Commands (From DMI's)
-#define VTPM_ORD_SAVENVM      (VTPM_ORD_BASE + 1) // DMI Saves Secrets
-#define VTPM_ORD_LOADNVM      (VTPM_ORD_BASE + 2) // DMI Loads Secrets
-#define VTPM_ORD_TPMCOMMAND   (VTPM_ORD_BASE + 3) // DMI issues HW TPM Command
-#define VTPM_ORD_GET_MIG_KEY  (VTPM_ORD_BASE + 4) // Get manager's migration key
-#define VTPM_ORD_LOAD_MIG_KEY (VTPM_ORD_BASE + 5) // load dest migration key 
-
-// Priviledged VTPM Commands (From management console)
-#define VTPM_ORD_OPEN         (VTPM_PRIV_BASE + 1) // Creates/reopens DMI
-#define VTPM_ORD_CLOSE        (VTPM_PRIV_BASE + 2) // Closes a DMI
-#define VTPM_ORD_DELETE       (VTPM_PRIV_BASE + 3) // Permemently Deletes DMI
-#define VTPM_ORD_MIGRATE_IN   (VTPM_PRIV_BASE + 4) // Load migrated VTPM
-#define VTPM_ORD_MIGRATE_OUT  (VTPM_PRIV_BASE + 5) // migrate VTPM to dest 
-
-//************************ Return Codes ****************************
-#define VTPM_TYPE_PVM 1 // Paravirtualized Domain
-#define VTPM_TYPE_HVM 2 // HVM Domain
-
-//************************ Return Codes ****************************
-#define VTPM_SUCCESS               0
-#define VTPM_FAIL                  1
-#define VTPM_UNSUPPORTED           2
-#define VTPM_FORBIDDEN             3
-#define VTPM_RESTORE_CONTEXT_FAILED    4
-#define VTPM_INVALID_REQUEST       5
-
-//*********************** Parameter Values *************************
-#define VTPM_TYPE_NON_MIGRATABLE  0x00
-#define VTPM_TYPE_MIGRATABLE      0x01
-#define VTPM_TYPE_MIGRATED        0xFF // VTPM has been migrated.
-                                       // VTPM can be recovered or deleted only
-
-/******************* Command Parameter API *************************
-
-VTPM Command Format
-  dmi: 4 bytes                  // Source of message. 
-                                // WARNING: This is prepended by the channel. 
-                                // Thus it is received by VTPM Manager, 
-                                // but not sent by DMI
-  tpm tag: 2 bytes
-  command size: 4 bytes         // Size of command including header but not DMI
-  ord: 4 bytes                  // Command ordinal above
-  parameters: size - 10 bytes   // Command Parameter
-
-VTPM Response Format
-  tpm tag: 2 bytes
-  response_size: 4 bytes
-  status: 4 bytes         
-  parameters: size - 10 bytes
-
-
-VTPM_Open:
-  Input Parameters:
-    mig_type: 1 byte 
-    startup_mode: 1 byte // Cold Boot = 1, resume = 2, deactive = 3
-    domain type: 1 byte
-    instance_id: 4 bytes
-  Output Parameters:
-    None
-    
-VTPM_Close
-  Input Parameters:
-    instance_id: 4 bytes
-  Output Parameters:
-    None
-
-VTPM_Delete
-  Input Parameters:
-    instance_id: 4 bytes
-  Output Parameters:
-    None
-
-VTPM_SaveNVM
-  Input Parameters:
-    data: n bytes (Header indicates size of data)
-  Output Parameters:
-    None
-
-VTPM_LoadNVM
-  Input Parameters:
-    None
-  Output Parameters:
-    data: n bytes (Header indicates size of data)
-
-VTPM_TPMCommand
-  Input Parameters:
-    TPM Command Byte Stream: n bytes 
-  Output Parameters:
-    TPM Reponse Byte Stream: n bytes 
-
-*********************************************************************/
-
-#endif //_VTPM_MANAGER_H_
diff --git a/tools/vtpm_manager/manager/vtpm_manager_handler.c b/tools/vtpm_manager/manager/vtpm_manager_handler.c
deleted file mode 100644
index 2001074..0000000
--- a/tools/vtpm_manager/manager/vtpm_manager_handler.c
+++ /dev/null
@@ -1,488 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtpm_manager_handler.c
-// 
-//  This file will house the main logic of the VTPM Manager
-//
-// ==================================================================
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-
-#include "vtpm_manager.h"
-#include "vtpmpriv.h"
-#include "vtsp.h"
-#include "bsg.h"
-#include "hashtable.h"
-#include "hashtable_itr.h"
-#include "log.h"
-#include "buffer.h"
-
-#define vtpmhandlerloginfo(module,fmt,args...) vtpmloginfo (module, "[%s]: " fmt, thread_name, ##args );
-#define vtpmhandlerloginfomore(module,fmt,args...) vtpmloginfomore (module, fmt, ##args );
-#define vtpmhandlerlogerror(module,fmt,args...) vtpmlogerror (module, "[%s]: " fmt, thread_name, ##args );
-
-// ---------------------- Prototypes -------------------
-TPM_RESULT vtpm_manager_handle_vtpm_cmd(VTPM_DMI_RESOURCE *dmi_res,
-					TPM_COMMAND_CODE ord,
-					buffer_t *command_buf,
-					buffer_t *result_buf,
-                                        BOOL is_priv,
-                                        char *thread_name);
-
-TPM_RESULT vtpm_manager_handle_tpm_cmd(vtpm_ipc_handle_t *tx_ipc_h,
-                                       vtpm_ipc_handle_t *rx_ipc_h,
-                                       VTPM_DMI_RESOURCE *dmi_res,
-                                       BYTE *cmd_header,
-                                       buffer_t *param_buf,
-                                       buffer_t *result_buf,
-                                       char *thread_name);
-
-TPM_RESULT VTPM_Manager_Handler( vtpm_ipc_handle_t *tx_ipc_h, 
-                                 vtpm_ipc_handle_t *rx_ipc_h,
-                                 BOOL fw_tpm,   // Forward TPM cmds?
-                                 vtpm_ipc_handle_t *fw_tx_ipc_h, 
-                                 vtpm_ipc_handle_t *fw_rx_ipc_h,
-                                 BOOL is_priv,
-                                 char *thread_name) {
-  TPM_RESULT      status =  TPM_FAIL; // Should never return
-  UINT32          dmi, in_param_size, cmd_size, out_param_size, out_message_size, reply_size;
-  BYTE            *cmd_header=NULL, *in_param=NULL, *out_message=NULL, *reply;
-  buffer_t        *command_buf=NULL, *result_buf=NULL;
-  TPM_TAG         tag;
-  TPM_COMMAND_CODE ord;
-  VTPM_DMI_RESOURCE *dmi_res;
-  int  size_read, size_write, i;
-  BOOL add_header=TRUE; // This indicates to prepend a header on result_buf before sending
-  
-  cmd_header = (BYTE *) malloc(VTPM_COMMAND_HEADER_SIZE_SRV);
-  command_buf = (buffer_t *) malloc(sizeof(buffer_t));
-  result_buf = (buffer_t *) malloc(sizeof(buffer_t));
- 
-  // ------------------------ Main Loop --------------------------------
-  while(1) {
-    
-    vtpmhandlerloginfo(VTPM_LOG_VTPM, "%s waiting for messages.\n", thread_name);
-
-    // --------------------- Read Cmd from Sender ----------------
-    
-    // Read command header 
-    size_read = vtpm_ipc_read(rx_ipc_h, NULL, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
-    if (size_read > 0) {
-      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "RECV[%d]: 0x", size_read);
-      for (i=0; i<size_read; i++) 
-	vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
-    } else {
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s can't read from ipc. Errono = %d. Aborting... \n", thread_name, errno);
-      goto abort_command;
-    }
-
-    if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
-      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "\n");
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command shorter than normal header (%d bytes). Aborting...\n", size_read);
-      goto abort_command;
-    }
-    
-    // Unpack header
-    BSG_UnpackList(cmd_header, 4,
-    		   BSG_TYPE_UINT32, &dmi,
-    		   BSG_TPM_TAG, &tag,
-    		   BSG_TYPE_UINT32, &in_param_size,
-    		   BSG_TPM_COMMAND_CODE, &ord );
-    
-    // Using the header info, read the parameters of the command
-    // Note that in_param_size is in the client's context
-    cmd_size = in_param_size - VTPM_COMMAND_HEADER_SIZE_CLT;
-    if (cmd_size > 0) {
-      in_param = (BYTE *) malloc(cmd_size);
-      size_read = vtpm_ipc_read( rx_ipc_h, NULL, in_param, cmd_size);
-      if (size_read > 0) {
-	for (i=0; i<size_read; i++) 
-	  vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
-	
-      } else {
-        vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s had error reading cmd from ipc. Aborting... \n", thread_name);
-	goto abort_command;
-      }
-      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-      
-      if (size_read < (int) cmd_size) {
-	vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-	vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d). Aborting...\n", size_read, cmd_size);
-	goto abort_command;
-      }
-    } else {
-      in_param = NULL;
-      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-    }
-
-    // Init the buffers used to handle the command and the response
-    if ( (buffer_init_convert(command_buf, cmd_size, in_param) != TPM_SUCCESS) || 
-	 (buffer_init(result_buf, 0, 0) != TPM_SUCCESS) ) {
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Failed to setup buffers. Aborting...\n");
-      goto abort_command;
-    }
-    
-    // -------------- Dispatch Commands to Handlers -----------
-    if ((tag == VTPM_TAG_REQ) && (ord & VTPM_PRIV_MASK)) {
-      vtpm_lock_wrlock();
-    } else {
-      vtpm_lock_rdlock();
-    }
-
-    if ( !(dmi_res = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi)) ||
-         (!dmi_res->connected) ) {
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Attempted access to non-existent or disconnected DMI %d. Aborting...\n", dmi);
-      status = TPM_BAD_PARAMETER;
-      // We have no one to reply to, they don't exist.
-      goto abort_command;
-    }
-
-    if (tag == VTPM_TAG_REQ) { 
-    
-      status = vtpm_manager_handle_vtpm_cmd(dmi_res, ord, command_buf, result_buf, is_priv, thread_name);
-
-    } else { // This is not a VTPM Command at all.
-      if (fw_tpm) { 
-        status = vtpm_manager_handle_tpm_cmd(fw_tx_ipc_h, fw_rx_ipc_h, dmi_res, cmd_header, command_buf, result_buf, thread_name);
-
-        // This means calling the DMI failed, not that the cmd failed in the DMI
-        // Since the return will be interpretted by a TPM app, all errors are IO_ERRORs to the app
-        if (status != TPM_SUCCESS) { 
-          status = TPM_IOERROR;
-	  goto abort_with_error;
-        }
-        // Unlike all other commands, forwarded commands yield a result_buf that includes the DMI's status. This
-        // should be forwarded to the caller VM
-        add_header = FALSE;
-      } else {
-        // We are not supposed to forward TPM commands at all.
-        int i;
-        vtpmhandlerlogerror(VTPM_LOG_VTPM, "Attempt to use unsupported direct access to TPM.\n");
-        vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "Bad Command. dmi:%d, tag:%d, size:%d, ord:%d, Params: ", dmi, tag, in_param_size, ord);
-        for (i=0; i<cmd_size; i++)
-          vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
-
-        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-
-        status = TPM_FAIL;
-        goto abort_with_error;
-     }
-
-    } // end else for is VTPM Command
-
-    // ------------------- Respond to Sender ------------------
-
-    // Errors while handling responses jump here to reply with error messages
-    // NOTE: Currently there are no recoverable errors in multi-VM mode. If one
-    //       is added to the code, this ifdef should be removed.
-    //       Also note this is NOT referring to errors in commands, but rather
-    //       this is about I/O errors and such.
-#ifndef VTPM_MULTI_VM
- abort_with_error:
-#endif
-   
-    if (add_header) { 
-      // Prepend VTPM header with destination DM stamped
-      out_param_size = buffer_len(result_buf);
-      out_message_size = VTPM_COMMAND_HEADER_SIZE_CLT + out_param_size;
-      reply_size = VTPM_COMMAND_HEADER_SIZE_SRV + out_param_size;
-      out_message = (BYTE *) malloc (reply_size);
-      reply = out_message;
-    
-      BSG_PackList(out_message, 4,
-		   BSG_TYPE_UINT32, (BYTE *) &dmi,
-		   BSG_TPM_TAG, (BYTE *) &tag,
-		   BSG_TYPE_UINT32, (BYTE *) &out_message_size,
-		   BSG_TPM_RESULT, (BYTE *) &status);
-    
-      if (buffer_len(result_buf) > 0) 
-        memcpy(out_message + VTPM_COMMAND_HEADER_SIZE_SRV, result_buf->bytes, out_param_size);
-      //Note: Send message + dmi_id
-    } else {
-      reply = result_buf->bytes;
-      reply_size = buffer_len(result_buf);
-    }  
-    size_write = vtpm_ipc_write(tx_ipc_h, (dmi_res ? dmi_res->tx_vtpm_ipc_h : NULL), reply, reply_size );
-    if (size_write > 0) {
-      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT: 0x");
-      for (i=0; i < reply_size; i++) 
-	vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", reply[i]);
-      
-      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");            
-    } else {
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s had error writing to ipc. Aborting... \n", thread_name);
-      goto abort_command;
-    }
-    free(out_message); out_message=NULL;
-    
-    if (size_write < (int)reply_size) {
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s unable to write full command to ipc (%d/%d)\n", thread_name, size_write, reply_size);
-      goto abort_command;
-    }
-    
-    // On certain failures an error message cannot be sent. 
-    // This marks the beginning of cleanup in preperation for the next command.
-  abort_command:
-    //free buffers
-    bzero(cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
-    //free(in_param); // This was converted to command_buf. No need to free 
-    buffer_free(result_buf);
-    buffer_free(command_buf);
-
-    // If we have a write lock, save the manager table
-    if ((tag == VTPM_TAG_REQ) && (ord & VTPM_PRIV_MASK) &&
-        (VTPM_SaveManagerData() != TPM_SUCCESS) ) {
-       vtpmhandlerlogerror(VTPM_LOG_VTPM, "ERROR: Unable to save manager data.\n");
-    }
-
-    vtpm_lock_unlock();
-    add_header = TRUE; // Reset to the default
-  } // End while(1)
-  
-}
-
-/////////////////////////////////////////////////////////////////////////
-TPM_RESULT vtpm_manager_handle_vtpm_cmd(VTPM_DMI_RESOURCE *dmi_res, 
-					TPM_COMMAND_CODE ord,
-					buffer_t *command_buf,
-					buffer_t *result_buf,
-                                        BOOL is_priv,
-                                        char *thread_name) {
-
-  TPM_RESULT status = TPM_FAIL;
-
-  switch (ord) {                
-  case VTPM_ORD_SAVENVM:
-    status= VTPM_Handle_Save_NVM(dmi_res,
-                                 command_buf, 
-                                 result_buf);
-    break;
-
-  case VTPM_ORD_LOADNVM:
-    status= VTPM_Handle_Load_NVM(dmi_res, 
-                                 command_buf, 
-                                 result_buf);
-    break;
-
-  case VTPM_ORD_TPMCOMMAND:
-    status= VTPM_Handle_TPM_Command(dmi_res, 
-                                    command_buf, 
-                                    result_buf);
-    break;
-
-  case VTPM_ORD_GET_MIG_KEY:
-    status = VTPM_Handle_Get_Migration_key(command_buf, 
-                                           result_buf);
-    break;
-
-  case VTPM_ORD_LOAD_MIG_KEY:
-    status = VTPM_Handle_Load_Migration_key(command_buf, 
-                                           result_buf);
-    break;
-   
-  default:
-    // Privileged handlers can do maintanance
-    if (is_priv) {
-      switch (ord) {
-      case VTPM_ORD_OPEN:
-        status = VTPM_Handle_New_DMI(command_buf);
-        break;
-
-      case VTPM_ORD_CLOSE:
-        status = VTPM_Handle_Close_DMI(command_buf);
-        break;
-
-      case VTPM_ORD_DELETE:
-        status = VTPM_Handle_Delete_DMI(command_buf);
-        break;
-
-      case VTPM_ORD_MIGRATE_IN:
-        status = VTPM_Handle_Migrate_In(command_buf, result_buf);
-        break;
-
-      case VTPM_ORD_MIGRATE_OUT:
-        status = VTPM_Handle_Migrate_Out(command_buf, result_buf);
-        break;
-
-      default:
-        status = TPM_BAD_ORDINAL;
-      } // switch
-    } else { // is priv command
-
-        status = TPM_BAD_ORDINAL;
-    } // inner switch
-  } // outer switch
-
-  return(status);
-}
-      
-/////////////////////////////////////////////////////////////////////
-TPM_RESULT vtpm_manager_handle_tpm_cmd(vtpm_ipc_handle_t *tx_ipc_h,
-                                       vtpm_ipc_handle_t *rx_ipc_h,
-				       VTPM_DMI_RESOURCE *dmi_res, 
-				       BYTE *cmd_header,
-				       buffer_t *param_buf,
-				       buffer_t *result_buf,
-                                       char *thread_name) {
-
-  TPM_RESULT status = TPM_FAIL;
-  UINT32 dmi_dst;
-  TPM_COMMAND_CODE ord;
-  TPM_TAG tag_out;
-  UINT32 dmi_cmd_size, in_param_size, adj_param_size;
-  BYTE *dmi_cmd, *in_param;
-  int  size_read, size_write, i;
-
-  //// Dom0 can't talk to the BE, so this must be a broken FE/BE or badness
-  if (dmi_res->dmi_id == VTPM_CTL_DM) {
-    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Illegal use of TPM command from dom0\n");
-    status = TPM_FAIL;
-    goto abort_with_error;
-  } 
-
-  vtpmhandlerloginfo(VTPM_LOG_VTPM, "Forwarding command to DMI.\n");
-   
-  //Forward TPM CMD stamped with dmi_id to DMI for handling
-  if (buffer_len(param_buf)) {
-    dmi_cmd = (BYTE *) malloc(VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf));
-    dmi_cmd_size = VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf);
-    memcpy(dmi_cmd, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
-    memcpy(dmi_cmd + VTPM_COMMAND_HEADER_SIZE_SRV, param_buf->bytes, buffer_len(param_buf));
-    size_write = vtpm_ipc_write(tx_ipc_h, dmi_res->tx_tpm_ipc_h, dmi_cmd, dmi_cmd_size);
-
-    if (size_write > 0) {
-      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT (DMI): 0x");
-      for (i=0; i<VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf); i++) {
-        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", dmi_cmd[i]);
-      }
-      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-    } else {
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error writing to DMI. Aborting... \n");
-      status = TPM_IOERROR;
-      goto abort_with_error;
-    }
-    free(dmi_cmd);
-  } else {
-    dmi_cmd_size = VTPM_COMMAND_HEADER_SIZE_SRV;
-    size_write = vtpm_ipc_write(tx_ipc_h, dmi_res->tx_tpm_ipc_h, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV );
-    if (size_write > 0) {
-      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT (DMI): 0x");
-      for (i=0; i<VTPM_COMMAND_HEADER_SIZE_SRV; i++) 
-        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
-
-      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-    } else {
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error writing to DMI. Aborting... \n");
-      status = TPM_IOERROR;
-      goto abort_with_error;
-    }
-  }
-    
-  if (size_write != (int) dmi_cmd_size) 
-    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Could not write entire command to DMI (%d/%d)\n", size_write, dmi_cmd_size);
-
-  buffer_free(param_buf);
-  
-  // Read header for response to TPM command from DMI
-  size_read = vtpm_ipc_read( rx_ipc_h, dmi_res->rx_tpm_ipc_h, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
-  if (size_read > 0) {
-    vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "RECV (DMI): 0x");
-    for (i=0; i<size_read; i++) 
-      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
-
-  } else {
-    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error reading from DMI. Aborting... \n");
-    status = TPM_IOERROR;
-    goto abort_with_error;
-  }
-  
-  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
-    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command from DMI shorter than normal header. Aborting...\n");
-    status = TPM_IOERROR;
-    goto abort_with_error;
-  }
-
-  // Unpack response from DMI for TPM command
-  BSG_UnpackList(cmd_header, 4,
-                 BSG_TYPE_UINT32, &dmi_dst,
-                 BSG_TPM_TAG, &tag_out,
-                 BSG_TYPE_UINT32, &in_param_size,
-                 BSG_TPM_COMMAND_CODE, &status );
-  
-  // If response has parameters, read them.
-  // Note that in_param_size is in the client's context
-  adj_param_size = in_param_size - VTPM_COMMAND_HEADER_SIZE_CLT;
-  if (adj_param_size > 0) {
-    in_param = (BYTE *) malloc(adj_param_size);
-    size_read = vtpm_ipc_read(rx_ipc_h, dmi_res->rx_tpm_ipc_h, in_param, adj_param_size);
-    if (size_read > 0) {
-      for (i=0; i<size_read; i++) 
-        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
-
-    } else {
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error reading from BE. Aborting... \n");
-      goto abort_with_error;
-    }
-    vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
-   
-    if (size_read < (int)adj_param_size) {
-      vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command read(%d) from DMI is shorter than header indicates(%d). Aborting...\n", size_read, adj_param_size);
-      status = TPM_IOERROR;
-      goto abort_with_error;
-    }
-  } else {
-    in_param = NULL;
-    vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
-  }
-   
-  if ( (buffer_init(result_buf, VTPM_COMMAND_HEADER_SIZE_SRV, cmd_header) != TPM_SUCCESS) || 
-       (buffer_append_raw(result_buf, adj_param_size, in_param) != TPM_SUCCESS) ) {
-    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Failed to setup buffers. Aborting...\n");
-    status = TPM_FAIL;
-    goto abort_with_error;
-  }
- 
-  vtpmhandlerloginfo(VTPM_LOG_VTPM, "Sending DMI's response to guest.\n");
-
-  status = TPM_SUCCESS;
-
- abort_with_error:
-
-  return status;
-}
-
diff --git a/tools/vtpm_manager/manager/vtpmd.c b/tools/vtpm_manager/manager/vtpmd.c
deleted file mode 100644
index cf58ba3..0000000
--- a/tools/vtpm_manager/manager/vtpmd.c
+++ /dev/null
@@ -1,371 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtpmd.c
-// 
-//  Application
-//
-// ===================================================================
-
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <string.h>
-#include <pthread.h>
-#include "vtpm_manager.h"
-#include "vtpmpriv.h"
-#include "tcg.h"
-#include "log.h"
-#include "vtpm_ipc.h"
-
-#define TPM_EMULATOR_PATH "/usr/bin/vtpmd"
-
-#define VTPM_BE_FNAME          "/dev/vtpm"
-#define VTPM_DUMMY_TX_BE_FNAME "/var/vtpm/fifos/dummy_out.fifo"
-#define VTPM_DUMMY_RX_BE_FNAME "/var/vtpm/fifos/dummy_in.fifo"
-#define VTPM_TX_TPM_FNAME      "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
-#define VTPM_RX_TPM_FNAME      "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
-#define VTPM_TX_VTPM_FNAME     "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
-#define VTPM_RX_VTPM_FNAME     "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
-#define VTPM_TX_HP_FNAME       "/var/vtpm/fifos/to_console.fifo"
-#define VTPM_RX_HP_FNAME       "/var/vtpm/fifos/from_console.fifo"
-
-#define VTPM_TYPE_PVM_STRING "pvm"
-#define VTPM_TYPE_HVM_STRING "hvm"
-
-struct vtpm_thread_params_s {
-  vtpm_ipc_handle_t *tx_ipc_h;
-  vtpm_ipc_handle_t *rx_ipc_h;
-  BOOL fw_tpm;
-  vtpm_ipc_handle_t *fw_tx_ipc_h;
-  vtpm_ipc_handle_t *fw_rx_ipc_h;
-  BOOL is_priv;
-  char *thread_name;
-};
-
-// This is needed to all extra_close_dmi to close this to prevent a
-// broken pipe when no DMIs are left.
-static vtpm_ipc_handle_t *g_rx_tpm_ipc_h;
-
-void *vtpm_manager_thread(void *arg_void) {
-  TPM_RESULT *status = (TPM_RESULT *) malloc(sizeof(TPM_RESULT) );
-  struct vtpm_thread_params_s *arg = (struct vtpm_thread_params_s *) arg_void;
-
-  *status = VTPM_Manager_Handler(arg->tx_ipc_h, arg->rx_ipc_h,
-                                 arg->fw_tpm, arg->fw_tx_ipc_h, arg->fw_rx_ipc_h,
-                                 arg->is_priv, arg->thread_name);
-
-  return (status);
-}
-
-
-void signal_handler(int reason) {
-  if (pthread_equal(pthread_self(), vtpm_globals->master_pid)) {
-    vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager shutting down for signal %d.\n", reason);
-  } else {
-    // For old Linux Thread machines, signals are delivered to each thread. Deal with them.
-    vtpmloginfo(VTPM_LOG_VTPM, "Child shutting down\n");
-    pthread_exit(NULL);
-  }
-
-  VTPM_Stop_Manager();
-  exit(-1);
-}
-
-struct sigaction ctl_c_handler;
-
-TPM_RESULT VTPM_New_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res, BYTE vm_type, BYTE startup_mode) {
-
-  TPM_RESULT status = TPM_SUCCESS;
-  int fh;
-  char dmi_id_str[11]; // UINT32s are up to 10 digits + NULL
-  char *tx_vtpm_name, *tx_tpm_name, *vm_type_string;
-  struct stat file_info;
-
-  if (dmi_res->dmi_id == VTPM_CTL_DM) {
-    dmi_res->tx_tpm_ipc_h = NULL;
-    dmi_res->rx_tpm_ipc_h = NULL;
-    dmi_res->tx_vtpm_ipc_h = NULL;
-    dmi_res->rx_vtpm_ipc_h = NULL;
-  } else {
-    // Create a pair of fifo pipes
-    dmi_res->rx_tpm_ipc_h = NULL;
-    dmi_res->rx_vtpm_ipc_h = NULL;
-
-    if ( ((dmi_res->tx_tpm_ipc_h = (vtpm_ipc_handle_t *) malloc (sizeof(vtpm_ipc_handle_t))) == NULL ) ||
-         ((dmi_res->tx_vtpm_ipc_h =(vtpm_ipc_handle_t *) malloc (sizeof(vtpm_ipc_handle_t))) == NULL ) ||
-         ((tx_tpm_name = (char *) malloc(11 + strlen(VTPM_TX_TPM_FNAME))) == NULL ) ||
-         ((tx_vtpm_name =(char *) malloc(11 + strlen(VTPM_TX_VTPM_FNAME))) == NULL) ) {
-      status =TPM_RESOURCES;
-      goto abort_egress;
-    }
-
-    sprintf(tx_tpm_name, VTPM_TX_TPM_FNAME, (uint32_t) dmi_res->dmi_id);
-    sprintf(tx_vtpm_name, VTPM_TX_VTPM_FNAME, (uint32_t) dmi_res->dmi_id);
-
-    if ( (vtpm_ipc_init(dmi_res->tx_tpm_ipc_h, tx_tpm_name, O_WRONLY | O_NONBLOCK, TRUE) != 0) ||
-         (vtpm_ipc_init(dmi_res->tx_vtpm_ipc_h, tx_vtpm_name, O_WRONLY, TRUE) != 0) ) { //FIXME: O_NONBLOCK?
-      status = TPM_IOERROR;
-      goto abort_egress;
-    }
-
-    // Measure DMI
-    // FIXME: This will measure DMI. Until then use a fixed DMI_Measurement value
-    // Also, this mechanism is specific to 1 VM architecture.
-    /*
-    fh = open(TPM_EMULATOR_PATH, O_RDONLY);
-    stat_ret = fstat(fh, &file_stat);
-    if (stat_ret == 0)
-      dmi_size = file_stat.st_size;
-    else {
-      vtpmlogerror(VTPM_LOG_VTPM, "Could not open vtpmd!!\n");
-      status = TPM_IOERROR;
-      goto abort_egress;
-    }
-    dmi_buffer
-    */
-    memset(&dmi_res->DMI_measurement, 0xcc, sizeof(TPM_DIGEST));
-
-    if (vm_type == VTPM_TYPE_PVM)
-      vm_type_string = (BYTE *)&VTPM_TYPE_PVM_STRING;
-    else
-      vm_type_string = (BYTE *)&VTPM_TYPE_HVM_STRING;
-
-    // Launch DMI
-    sprintf(dmi_id_str, "%d", (int) dmi_res->dmi_id);
-#ifdef MANUAL_DM_LAUNCH
-    vtpmlogerror(VTPM_LOG_VTPM, "Manually start VTPM with dmi=%s now.\n", dmi_id_str);
-    dmi_res->dmi_pid = 0;
-#else
-    pid_t pid = fork();
-
-    if (pid == -1) {
-      vtpmlogerror(VTPM_LOG_VTPM, "Could not fork to launch vtpm\n");
-      status = TPM_RESOURCES;
-      goto abort_egress;
-    } else if (pid == 0) {
-      switch (startup_mode) {
-      case TPM_ST_CLEAR:
-        execl (TPM_EMULATOR_PATH, "vtpmd", "clear", vm_type_string, dmi_id_str, NULL);
-        break;
-      case TPM_ST_STATE:
-        execl (TPM_EMULATOR_PATH, "vtpmd", "save", vm_type_string, dmi_id_str, NULL);
-        break;
-      case TPM_ST_DEACTIVATED:
-        execl (TPM_EMULATOR_PATH, "vtpmd", "deactivated", vm_type_string, dmi_id_str, NULL);
-        break;
-      default:
-        status = TPM_BAD_PARAMETER;
-        goto abort_egress;
-      }
-
-      // Returning from these at all is an error.
-      vtpmlogerror(VTPM_LOG_VTPM, "Could not exec to launch vtpm\n");
-    } else {
-      dmi_res->dmi_pid = pid;
-      vtpmloginfo(VTPM_LOG_VTPM, "Launching DMI on PID = %d\n", pid);
-    }
-#endif // MANUAL_DM_LAUNCH
-
-  } // If DMI = VTPM_CTL_DM
-    status = TPM_SUCCESS;
-
-abort_egress:
-  return (status);
-}
-
-TPM_RESULT VTPM_Close_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res) {
-  TPM_RESULT status = TPM_SUCCESS;
-
-  if (vtpm_globals->connected_dmis == 0) {
-    // No more DMI's connected. Close fifo to prevent a broken pipe.
-    // This is hackish. Need to think of another way.
-    vtpm_ipc_close(g_rx_tpm_ipc_h);
-  }
-
-  
-  if (dmi_res->dmi_id != VTPM_CTL_DM) {
-    vtpm_ipc_close(dmi_res->tx_tpm_ipc_h);
-    vtpm_ipc_close(dmi_res->tx_vtpm_ipc_h);
-
-    free(dmi_res->tx_tpm_ipc_h->name);
-    free(dmi_res->tx_vtpm_ipc_h->name);
-
-#ifndef MANUAL_DM_LAUNCH
-    if (dmi_res->dmi_id != VTPM_CTL_DM) {
-      if (dmi_res->dmi_pid != 0) {
-        vtpmloginfo(VTPM_LOG_VTPM, "Killing dmi on pid %d.\n", dmi_res->dmi_pid);
-        if (kill(dmi_res->dmi_pid, SIGKILL) !=0) {
-          vtpmloginfo(VTPM_LOG_VTPM, "DMI on pid %d is already dead.\n", dmi_res->dmi_pid);
-        } else if (waitpid(dmi_res->dmi_pid, NULL, 0) != dmi_res->dmi_pid) {
-          vtpmlogerror(VTPM_LOG_VTPM, "DMI on pid %d failed to stop.\n", dmi_res->dmi_pid);
-          status = TPM_FAIL;
-        }
-      } else {
-        vtpmlogerror(VTPM_LOG_VTPM, "Could not kill dmi because it's pid was 0.\n");
-        status = TPM_FAIL;
-      }
-    }
-#endif
-
-  } //endif ! dom0
-  return status;
-}
-
-
-int main(int argc, char **argv) {
-  vtpm_ipc_handle_t *tx_be_ipc_h, *rx_be_ipc_h, rx_tpm_ipc_h, rx_vtpm_ipc_h, tx_hp_ipc_h, rx_hp_ipc_h; 
-  struct vtpm_thread_params_s be_thread_params, dmi_thread_params, hp_thread_params;
-  pthread_t be_thread, dmi_thread, hp_thread;
-
-#ifdef DUMMY_BACKEND
-  vtpm_ipc_handle_t tx_dummy_ipc_h, rx_dummy_ipc_h;
-#else
-  vtpm_ipc_handle_t real_be_ipc_h;
-#endif
-
-  vtpmloginfo(VTPM_LOG_VTPM, "Starting VTPM.\n");
- 
-  // -------------------- Initialize Manager ----------------- 
-  if (VTPM_Init_Manager() != TPM_SUCCESS) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Closing vtpmd due to error during startup.\n");
-    return -1;
-  }
-  
-  // -------------------- Setup Ctrl+C Handlers --------------
-  ctl_c_handler.sa_handler = signal_handler;
-  sigemptyset(&ctl_c_handler.sa_mask);
-  ctl_c_handler.sa_flags = 0;    
-  
-  if (sigaction(SIGINT, &ctl_c_handler, NULL) == -1) 
-    vtpmlogerror(VTPM_LOG_VTPM, "Could not install SIGINT handler. Ctl+break will not stop manager gently.\n");
-  
-  // For easier debuggin with gdb
-  if (sigaction(SIGHUP, &ctl_c_handler, NULL) == -1) 
-    vtpmlogerror(VTPM_LOG_VTPM, "Could not install SIGHUP handler. Ctl+break will not stop manager gently.\n");    
-  
-  sigset_t sig_mask;
-  sigemptyset(&sig_mask);
-  sigaddset(&sig_mask, SIGPIPE);
-  sigprocmask(SIG_BLOCK, &sig_mask, NULL);
-  
-  // ------------------- Set up file ipc structures ----------
-#ifdef DUMMY_BACKEND
-  if ( (vtpm_ipc_init(&tx_dummy_ipc_h, VTPM_DUMMY_TX_BE_FNAME, O_RDWR, TRUE) != 0) ||
-       (vtpm_ipc_init(&rx_dummy_ipc_h, VTPM_DUMMY_RX_BE_FNAME, O_RDWR, TRUE) != 0) ) {
-
-    vtpmlogerror(VTPM_LOG_VTPM, "Unable to create Dummy BE FIFOs.\n");
-    exit(-1);
-  }
-
-  tx_be_ipc_h = &tx_dummy_ipc_h;
-  rx_be_ipc_h = &rx_dummy_ipc_h;
-#else
-  vtpm_ipc_init(&real_be_ipc_h, VTPM_BE_FNAME, O_RDWR, FALSE);
-
-  tx_be_ipc_h = &real_be_ipc_h;
-  rx_be_ipc_h = &real_be_ipc_h;
-#endif
-
-  if ( (vtpm_ipc_init(&rx_tpm_ipc_h, VTPM_RX_TPM_FNAME, O_RDONLY, TRUE) != 0) ||
-       (vtpm_ipc_init(&rx_vtpm_ipc_h, VTPM_RX_VTPM_FNAME, O_RDWR, TRUE) != 0) || //FIXME: O_RDONLY?
-       (vtpm_ipc_init(&tx_hp_ipc_h,  VTPM_TX_HP_FNAME, O_RDWR, TRUE) != 0)    ||
-       (vtpm_ipc_init(&rx_hp_ipc_h,  VTPM_RX_HP_FNAME, O_RDWR, TRUE) != 0) ) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Unable to create initial FIFOs.\n");
-    exit(-1);
-  }
-
-  g_rx_tpm_ipc_h = &rx_tpm_ipc_h;
-
-  // -------------------- Set up thread params ------------- 
-
-  be_thread_params.tx_ipc_h = tx_be_ipc_h;
-  be_thread_params.rx_ipc_h = rx_be_ipc_h;
-  be_thread_params.fw_tpm = TRUE;
-  be_thread_params.fw_tx_ipc_h = NULL;
-  be_thread_params.fw_rx_ipc_h = &rx_tpm_ipc_h;
-  be_thread_params.is_priv = FALSE;
-  be_thread_params.thread_name = "Backend Listener";
-
-  dmi_thread_params.tx_ipc_h = NULL;
-  dmi_thread_params.rx_ipc_h = &rx_vtpm_ipc_h;
-  dmi_thread_params.fw_tpm = FALSE; 
-  dmi_thread_params.fw_tx_ipc_h = NULL;
-  dmi_thread_params.fw_rx_ipc_h = NULL;
-  dmi_thread_params.is_priv = FALSE; 
-  dmi_thread_params.thread_name = "VTPM Listener";
-
-  hp_thread_params.tx_ipc_h = &tx_hp_ipc_h;
-  hp_thread_params.rx_ipc_h = &rx_hp_ipc_h;
-  hp_thread_params.fw_tpm = FALSE;
-  hp_thread_params.fw_tx_ipc_h = NULL;
-  hp_thread_params.fw_rx_ipc_h = NULL;
-  hp_thread_params.is_priv = TRUE;
-  hp_thread_params.thread_name = "Hotplug Listener";
-
-  // --------------------- Launch Threads -----------------
-
-  vtpm_lock_init();
-
-  vtpm_globals->master_pid = pthread_self();
-  
-  if (pthread_create(&be_thread, NULL, vtpm_manager_thread, &be_thread_params) != 0) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch BE Thread.\n");
-    exit(-1);
-  }
-  
-  if (pthread_create(&dmi_thread, NULL, vtpm_manager_thread, &dmi_thread_params) != 0) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch DMI Thread.\n");
-    exit(-1);
-  }
-
- 
-  if (pthread_create(&hp_thread, NULL, vtpm_manager_thread, &hp_thread_params) != 0) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch HP Thread.\n");
-    exit(-1);
-  }
- 
-  //Join the other threads until exit time.
-  pthread_join(be_thread, NULL);
-  pthread_join(dmi_thread, NULL);
-  pthread_join(hp_thread, NULL);
- 
-  vtpmlogerror(VTPM_LOG_VTPM, "VTPM Manager shut down unexpectedly.\n");
- 
-  VTPM_Stop_Manager();
-  vtpm_lock_destroy();
-  return 0;
-}
diff --git a/tools/vtpm_manager/manager/vtpmpriv.h b/tools/vtpm_manager/manager/vtpmpriv.h
deleted file mode 100644
index 41e8d2d..0000000
--- a/tools/vtpm_manager/manager/vtpmpriv.h
+++ /dev/null
@@ -1,186 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtpmpriv.h
-// 
-//  Structures and functions private to the manager
-//
-// ==================================================================
-
-#ifndef __VTPMPRIV_H__
-#define __VTPMPRIV_H__
-
-#include "vtpm_manager.h"
-#include "tcg.h"
-#include "tcs.h"
-#include "buffer.h"
-#include "crypto.h"
-#include "vtpm_ipc.h"
-
-#define VTPM_MANAGER_GEN   2     // This is incremented when the manager's table
-                                 // is changed. It's used for backwards compatability
-
-#define STATE_FILE         "/var/vtpm/VTPM"
-#define DMI_NVM_FILE       "/var/vtpm/vtpm_dm_%d.data"
-#define VTPM_CTL_DM        0
-
-// ------------------------ Private Structures -----------------------
-typedef struct VTPM_DMI_RESOURCE_T {
-  // I/O info for Manager to talk to DMI's and controllers
-  vtpm_ipc_handle_t      *tx_vtpm_ipc_h;    // TX VTPM Results to DMI
-  vtpm_ipc_handle_t      *rx_vtpm_ipc_h;    // RX VTPM Commands from DMI
-  vtpm_ipc_handle_t      *tx_tpm_ipc_h;     // TX TPM Commands to DMI
-  vtpm_ipc_handle_t      *rx_tpm_ipc_h;     // RX TPM Results from DMI
- 
-#ifndef VTPM_MULTI_VM 
-  pid_t                 dmi_pid;
-#endif
-
-  // Non-persistent Information
-  bool                  connected;
-  UINT32                dmi_domain_id;
-  TCS_CONTEXT_HANDLE    TCSContext;     // TCS Handle
-  char                  *NVMLocation;   // NULL term string indicating location
-                                        // of NVM.
-  // Persistent Information about DMI
-  UINT32                dmi_id;
-  BYTE                  dmi_type;
-  TPM_DIGEST            NVM_measurement;  // Equal to the SHA1 of the blob
-  TPM_DIGEST            DMI_measurement;  // Correct measurement of the owning DMI
-} VTPM_DMI_RESOURCE;
-
-typedef struct tdVTPM_MIGKEY_LIST {
-  UINT32                name_size;
-  BYTE                  *name; // Name of destination (IP addr, domain name, etc)
-  CRYPTO_INFO           key;
-  struct tdVTPM_MIGKEY_LIST *next;
-} VTPM_MIGKEY_LIST;
-
-
-typedef struct tdVTPM_GLOBALS {
-  // Non-persistent data
-#ifndef VTPM_MULTI_VM
-  pid_t               master_pid;
-#endif
-
-  int                 connected_dmis;     // To close guest_rx when no dmis are connected
-
-  struct hashtable    *dmi_map;               // Table of all DMI's known indexed by persistent instance #
-  VTPM_MIGKEY_LIST    *mig_keys;              // Table of migration keys
-                      // Currently keys are loaded at migration time,
-                      // TODO: Make VTPM man store a keys persistently
-                      //       and update script to check if key is needed
-                      //       before fetching it.
-
-  TCS_CONTEXT_HANDLE  manager_tcs_handle;     // TCS Handle used by manager
-  TPM_HANDLE          storageKeyHandle;       // Key used by persistent store
-  CRYPTO_INFO         storageKey;             // For software encryption
-  CRYPTO_INFO         bootKey;                // For saving table
-  TCS_AUTH            keyAuth;                // OIAP session for storageKey 
-    
-  // Persistent Data
-  TPM_AUTHDATA        owner_usage_auth;       // OwnerAuth of real TPM
-  buffer_t            storageKeyWrap;         // Wrapped copy of storageKey
-  TPM_AUTHDATA        srk_usage_auth;
-  TPM_AUTHDATA        storage_key_usage_auth; 
-
-  buffer_t            bootKeyWrap;            // Wrapped copy of boot key 
-
-}VTPM_GLOBALS;
-
-// --------------------------- Global Values --------------------------
-extern VTPM_GLOBALS *vtpm_globals;   // Key info and DMI states
-extern const TPM_AUTHDATA SRK_AUTH;  // SRK Well Known Auth Value
-
-// ********************** VTPM Functions *************************
-TPM_RESULT VTPM_Init_Manager(); // Start VTPM Service
-void VTPM_Stop_Manager();  // Stop VTPM Service
-TPM_RESULT VTPM_Manager_Handler(vtpm_ipc_handle_t *tx_ipc_h,
-                                vtpm_ipc_handle_t *rx_ipc_h,
-                                BOOL fw_tpm,   // Should forward TPM cmds
-                                vtpm_ipc_handle_t *fw_tx_ipc_h,
-                                vtpm_ipc_handle_t *fw_rx_ipc_h,
-                                BOOL is_priv,
-                                char *client_name);
-
-// ********************** Command Handler Prototypes ***********************
-
-TPM_RESULT VTPM_Handle_Load_NVM(       VTPM_DMI_RESOURCE *myDMI, 
-                                        const buffer_t *inbuf, 
-                                        buffer_t *outbuf);
-
-TPM_RESULT VTPM_Handle_Save_NVM(       VTPM_DMI_RESOURCE *myDMI, 
-                                        const buffer_t *inbuf, 
-                                        buffer_t *outbuf);
-
-TPM_RESULT VTPM_Handle_TPM_Command(    VTPM_DMI_RESOURCE *dmi, 
-                                        buffer_t *inbuf, 
-                                        buffer_t *outbuf);
-
-TPM_RESULT VTPM_Handle_New_DMI(const buffer_t *param_buf);
-                                
-TPM_RESULT VTPM_Handle_Close_DMI(const buffer_t *param_buf);
-                                   
-TPM_RESULT VTPM_Handle_Delete_DMI(const buffer_t *param_buf);
-
-TPM_RESULT VTPM_Handle_Migrate_In( const buffer_t *param_buf,
-                                   buffer_t *result_buf);
-
-TPM_RESULT VTPM_Handle_Migrate_Out ( const buffer_t *param_buf,
-                                     buffer_t *result_buf);
-
-TPM_RESULT VTPM_Handle_Get_Migration_key( const buffer_t *param_buf,
-                                          buffer_t *result_buf);
-
-TPM_RESULT VTPM_SaveManagerData(void);
-TPM_RESULT VTPM_LoadManagerData(void);
-
-TPM_RESULT VTPM_New_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res, BYTE vm_type, BYTE startup_mode);
-
-TPM_RESULT VTPM_Close_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res);
-
-// Helper functions
-TPM_RESULT close_dmi(VTPM_DMI_RESOURCE *dmi_res);
-TPM_RESULT init_dmi(UINT32 dmi_id, BYTE type,  VTPM_DMI_RESOURCE **dmi_res);
-
-TPM_RESULT envelope_encrypt(const buffer_t     *inbuf,
-                             CRYPTO_INFO        *asymkey,
-                             buffer_t           *sealed_data);
-
-TPM_RESULT envelope_decrypt(const buffer_t     *cipher,
-                            TCS_CONTEXT_HANDLE TCSContext,
-                            TPM_HANDLE         keyHandle,
-                            const TPM_AUTHDATA *key_usage_auth,
-                            buffer_t           *unsealed_data);
-
-#endif // __VTPMPRIV_H__
diff --git a/tools/vtpm_manager/manager/vtsp.c b/tools/vtpm_manager/manager/vtsp.c
deleted file mode 100644
index fc8a66f..0000000
--- a/tools/vtpm_manager/manager/vtsp.c
+++ /dev/null
@@ -1,1042 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtsp.c
-// 
-//  Higher level interface to TCS for use in service.
-//
-// ==================================================================
-
-#include <string.h>
-#include "tcg.h"
-#include "tcs.h"
-#include "bsg.h"
-#include "log.h"
-#include "crypto.h"
-#include "vtsp.h"
-#include "buffer.h"
-
-#define  RSA_KEY_SIZE 0x0800
-
-/***********************************************************************************
- * GenerateAuth: Generate authorization info to be sent back to application
- *
- * Parameters: outParamDigestText  The concatenation of output parameters to be SHA1ed
- *    outParamDigestTextSize Size of inParamDigestText
- *    HMACkey     Key to be used for HMACing
- *          For OIAP use key.authUsage or PersistStore.ownerAuth
- *          For OSAP use shared secret
- *    pAuth     Authorization information from the application
- *
- * Return:  TPM_SUCCESS   Authorization data created
- *    TPM_AUTHFAIL   Invalid (NULL) HMACkey presented for OSAP
- *************************************************************************************/
-TPM_RESULT GenerateAuth( /*[IN]*/ const BYTE *inParamDigestText,
-			 /*[IN]*/ UINT32 inParamDigestTextSize,
-			 /*[IN]*/ const TPM_SECRET *HMACkey,  
-			 /*[IN,OUT]*/ TCS_AUTH *auth) {
-    
-  if (inParamDigestText == NULL || auth == NULL) 
-    return (TPM_AUTHFAIL);
-  else {
-    
-    //Generate new OddNonce
-    Crypto_GetRandom(auth->NonceOdd.nonce, sizeof(TPM_NONCE));
-    
-    // Create SHA1 inParamDigest
-    TPM_DIGEST inParamDigest;
-    Crypto_SHA1Full(inParamDigestText, inParamDigestTextSize, (BYTE *) &inParamDigest);
-    
-    // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
-    BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
-    
-    BSG_PackList(   hmacText, 4, 
-		    BSG_TPM_DIGEST, &inParamDigest,
-		    BSG_TPM_NONCE, &(auth->NonceEven),
-		    BSG_TPM_NONCE, &(auth->NonceOdd), 
-		    BSG_TYPE_BOOL, &(auth->fContinueAuthSession) );
-    
-    Crypto_HMAC((BYTE *) hmacText, sizeof(hmacText), (BYTE *) HMACkey, sizeof(TPM_DIGEST), (BYTE *) &(auth->HMAC));
-    
-    return(TPM_SUCCESS);
-    
-  }
-}
-
-/***********************************************************************************
- * VerifyAuth: Verify the authdata for a command requiring authorization
- *
- * Parameters: inParamDigestText  The concatenation of parameters to be SHA1ed
- *    inParamDigestTextSize Size of inParamDigestText
- *    authDataUsage   AuthDataUsage for the Entity being used
- *          Key->authDataUsage or TPM_AUTH_OWNER
- *    HMACkey     Key to be used for HMACing
- *          For OIAP use key.authUsage or PersistStore.ownerAuth
- *          For OSAP use NULL (It will be aquired from the Auth Session)
- *          If unknown (default), assume OIAP
- *    sessionAuth    A TCS_AUTH info for the session
- *    pAuth     Authorization information from the application
- *              hContext        If specified, on failed Auth, VerifyAuth will
- *                                      generate a new OIAP session in place of themselves
- *                                      destroyed session.
- *
- * Return:  TPM_SUCCESS   Authorization Verified
- *    TPM_AUTHFAIL   Authorization Failed
- *    TPM_FAIL    Failure during SHA1 routines
- *************************************************************************************/
-TPM_RESULT VerifyAuth( /*[IN]*/ const BYTE *outParamDigestText,
-		       /*[IN]*/ UINT32 outParamDigestTextSize,
-		       /*[IN]*/ const TPM_SECRET *HMACkey,  
-		       /*[IN,OUT]*/ TCS_AUTH *auth,
-		       /*[IN]*/  TCS_CONTEXT_HANDLE hContext) {
-  if (outParamDigestText == NULL || auth == NULL) 
-    return (TPM_AUTHFAIL);
-  
-  
-  // Create SHA1 inParamDigest
-  TPM_DIGEST outParamDigest;
-  Crypto_SHA1Full(outParamDigestText, outParamDigestTextSize, (BYTE *) &outParamDigest);
-  
-  // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
-  TPM_DIGEST hm;
-  BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
-  
-  BSG_PackList(   hmacText, 4, 
-		  BSG_TPM_DIGEST, &outParamDigest,
-		  BSG_TPM_NONCE, &(auth->NonceEven),
-		  BSG_TPM_NONCE, &(auth->NonceOdd), 
-		  BSG_TYPE_BOOL, &(auth->fContinueAuthSession) );
-  
-  Crypto_HMAC((BYTE *) hmacText, sizeof(hmacText),
-	      (BYTE *) HMACkey, sizeof(TPM_DIGEST), (BYTE *) &hm);
-    
-  // Compare correct HMAC with provided one.
-  if (memcmp (&hm, &(auth->HMAC), sizeof(TPM_DIGEST)) == 0) { // 0 indicates equality
-    if (!auth->fContinueAuthSession) 
-      vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM by fContinue=0.\n", auth->AuthHandle);
-    
-    return (TPM_SUCCESS);
-  } else {
-    // If specified, reconnect the OIAP session.
-    // NOTE: This only works for TCS's that never have a 0 context. 
-    if (hContext) {
-      vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM due to failure.\n", auth->AuthHandle);
-      VTSP_OIAP( hContext, auth);
-    }
-    return (TPM_AUTHFAIL);
-  }
-}
-
-TPM_RESULT VTSP_OIAP(const TCS_CONTEXT_HANDLE hContext,
-		     TCS_AUTH *auth) {
-  
-  vtpmloginfo(VTPM_LOG_VTSP, "OIAP.\n");
-  TPM_RESULT status = TPM_SUCCESS;                           
-  TPMTRYRETURN( TCSP_OIAP(hContext,
-			  &auth->AuthHandle,
-			  &auth->NonceEven) );
-
-  memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
-  auth->fContinueAuthSession = FALSE;
-
-  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x opened by TPM_OIAP.\n", auth->AuthHandle);
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  
-  return status;
-}
-
-TPM_RESULT VTSP_OSAP(const TCS_CONTEXT_HANDLE hContext,
-		     const TPM_ENTITY_TYPE entityType,
-		     const UINT32 entityValue,
-		     const TPM_AUTHDATA *usageAuth,
-		     TPM_SECRET *sharedSecret, 
-		     TCS_AUTH *auth) {
-  
-  vtpmloginfo(VTPM_LOG_VTSP, "OSAP.\n");
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_NONCE nonceEvenOSAP, nonceOddOSAP;
-  
-  Crypto_GetRandom((BYTE *) &nonceOddOSAP, sizeof(TPM_NONCE) ); 
-  
-  TPMTRYRETURN( TCSP_OSAP(    hContext,
-			      entityType,
-			      entityValue, 
-			      nonceOddOSAP,
-			      &auth->AuthHandle, 
-			      &auth->NonceEven, 
-			      &nonceEvenOSAP) );
-  
-  // Calculating Session Secret
-  BYTE sharedSecretText[TPM_DIGEST_SIZE * 2];
-  
-  BSG_PackList(  sharedSecretText, 2,
-		 BSG_TPM_NONCE, &nonceEvenOSAP,
-		 BSG_TPM_NONCE, &nonceOddOSAP);
-  
-  Crypto_HMAC(sharedSecretText, sizeof(sharedSecretText), (BYTE *) usageAuth, TPM_DIGEST_SIZE, (BYTE *) sharedSecret);       
-
-  memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
-  auth->fContinueAuthSession = FALSE;
-   
-  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x opened by TPM_OSAP.\n", auth->AuthHandle);
-
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  
-  return status;
-}
-
-
-TPM_RESULT VTSP_TerminateHandle(const TCS_CONTEXT_HANDLE hContext,
-                                const TCS_AUTH *auth) {
-
-  vtpmloginfo(VTPM_LOG_VTSP, "Terminate Handle.\n");
-  TPM_RESULT status = TPM_SUCCESS;
-  TPMTRYRETURN( TCSP_TerminateHandle(hContext, auth->AuthHandle) );
-
-  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM_TerminateHandle.\n", auth->AuthHandle);
-  goto egress;
-
- abort_egress:
-
- egress:
-
-  return status;
-}
-
-
-TPM_RESULT VTSP_ReadPubek(   const TCS_CONTEXT_HANDLE hContext,
-                             CRYPTO_INFO *crypto_info) {
-  
-  TPM_RESULT status;
-  TPM_NONCE antiReplay;
-  TPM_DIGEST   checksum;
-  BYTE *pubEKtext;
-  UINT32 pubEKtextsize;
-  
-  vtpmloginfo(VTPM_LOG_VTSP, "Reading Public EK.\n");
-  
-  // GenerateAuth new nonceOdd    
-  Crypto_GetRandom(&antiReplay, sizeof(TPM_NONCE) );
-  
-  
-  TPMTRYRETURN( TCSP_ReadPubek(  hContext,
-				 antiReplay,
-				 &pubEKtextsize,
-				 &pubEKtext,
-				 &checksum) );
-  
-  
-  // Extract the remaining output parameters
-  TPM_PUBKEY pubEK;
-  
-  BSG_Unpack(BSG_TPM_PUBKEY, pubEKtext, (BYTE *) &pubEK);
-  
-  // Build CryptoInfo for the bindingKey
-  TPM_RSA_KEY_PARMS rsaKeyParms;
-  
-  BSG_Unpack(BSG_TPM_RSA_KEY_PARMS, 
-	     pubEK.algorithmParms.parms, 
-	     &rsaKeyParms);
-  
-  Crypto_RSABuildCryptoInfoPublic(rsaKeyParms.exponentSize, 
-				  rsaKeyParms.exponent, 
-				  pubEK.pubKey.keyLength, 
-				  pubEK.pubKey.key, 
-				  crypto_info);
-    
-  // Destroy rsaKeyParms
-  BSG_Destroy(BSG_TPM_RSA_KEY_PARMS, &rsaKeyParms);
-
-  // Set encryption scheme
-  crypto_info->encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
-  //crypto_info->encScheme = pubEK.algorithmParms.encScheme;
-  crypto_info->algorithmID = pubEK.algorithmParms.algorithmID;
-  
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  
-  return status;
-}
-
-TPM_RESULT VTSP_TakeOwnership(   const TCS_CONTEXT_HANDLE hContext,
-                                 const TPM_AUTHDATA *ownerAuth, 
-                                 const TPM_AUTHDATA *srkAuth,
-                                 CRYPTO_INFO *ek_cryptoInfo,
-                                 TCS_AUTH *auth) {
-  
-  vtpmloginfo(VTPM_LOG_VTSP, "Taking Ownership of TPM.\n");
-  
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_COMMAND_CODE command = TPM_ORD_TakeOwnership;
-  TPM_PROTOCOL_ID proto_id = TPM_PID_OWNER;
-  BYTE *new_srk;
-  
-  BYTE *paramText;        // Digest to make Auth.
-  UINT32 paramTextSize;
-  
-  // vars for srkpubkey parameter
-  TPM_KEY srkPub;
-  TPM_KEY_PARMS srkKeyInfo = {TPM_ALG_RSA, TPM_ES_RSAESOAEP_SHA1_MGF1, TPM_SS_NONE, 12, 0};
-  BYTE srkRSAkeyInfo[12] = { 0x00, 0x00, (RSA_KEY_SIZE >> 8), 0x00,   0x00, 0x00, 0x00, 0x02,   0x00, 0x00, 0x00, 0x00};
-  srkKeyInfo.parms = (BYTE *) &srkRSAkeyInfo;
-  
-  struct pack_buf_t srkText;
-  
-  //These values are accurate for an enc(AuthData).
-  struct pack_buf_t encOwnerAuth, encSrkAuth;
-  
-  encOwnerAuth.data = (BYTE *)malloc(sizeof(BYTE) * 256);
-  encSrkAuth.data = (BYTE *)malloc(sizeof(BYTE) * 256);
-  
-  if (encOwnerAuth.data == NULL || encSrkAuth.data == NULL) {
-    vtpmloginfo(VTPM_LOG_VTSP, "Could not malloc encrypted auths.\n");
-    status = TPM_RESOURCES;
-    goto abort_egress;
-  }
-  
-  Crypto_RSAEnc(ek_cryptoInfo, sizeof(TPM_SECRET), (BYTE *) ownerAuth, &encOwnerAuth.size, encOwnerAuth.data);
-  Crypto_RSAEnc(ek_cryptoInfo, sizeof(TPM_SECRET), (BYTE *) srkAuth, &encSrkAuth.size, encSrkAuth.data);
-  
-  
-  // Build srk public key struct
-  srkPub.ver = TPM_STRUCT_VER_1_1;
-  srkPub.keyUsage = TPM_KEY_STORAGE;
-  srkPub.keyFlags = 0x00;
-  srkPub.authDataUsage = TPM_AUTH_ALWAYS;
-  memcpy(&srkPub.algorithmParms, &srkKeyInfo, sizeof(TPM_KEY_PARMS));
-  srkPub.PCRInfoSize = 0;
-  srkPub.PCRInfo = 0;
-  srkPub.pubKey.keyLength= 0;
-  srkPub.encDataSize = 0;
-  
-  srkText.data = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
-  srkText.size = BSG_Pack(BSG_TPM_KEY, (BYTE *) &srkPub, srkText.data);
-  
-  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
-  
-  paramTextSize = BSG_PackList(paramText, 5,
-			       BSG_TPM_COMMAND_CODE,&command,
-			       BSG_TPM_PROTOCOL_ID, &proto_id,
-			       BSG_TPM_SIZE32_DATA, &encOwnerAuth,
-			       BSG_TPM_SIZE32_DATA, &encSrkAuth,
-			       BSG_TPM_KEY, &srkPub);
-  
-  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize, ownerAuth, auth) );
-  
-  new_srk = srkText.data;
-  TPMTRYRETURN( TCSP_TakeOwnership ( hContext,
-				     proto_id,
-				     encOwnerAuth.size, 
-				     encOwnerAuth.data,
-				     encSrkAuth.size,
-				     encSrkAuth.data,
-				     &srkText.size,
-				     &new_srk, 
-				     auth ) );
-  
-  
-  paramTextSize = BSG_PackList(paramText, 2, 
-			       BSG_TPM_RESULT, &status,
-			       BSG_TPM_COMMAND_CODE, &command);
-  memcpy(paramText + paramTextSize, new_srk, srkText.size);
-  paramTextSize += srkText.size;
-  
-  
-  TPMTRYRETURN( VerifyAuth(  paramText, paramTextSize,
-			     ownerAuth, auth, 
-			     hContext) );
-  
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  
-  free(srkText.data);
-  free(encSrkAuth.data);
-  free(encOwnerAuth.data);
-  free(paramText);
-  
-  TCS_FreeMemory(hContext, new_srk);
-  
-  return status;
-}
-
-TPM_RESULT VTSP_DisablePubekRead( const TCS_CONTEXT_HANDLE    hContext,
-                                  const TPM_AUTHDATA          *ownerAuth, 
-                                  TCS_AUTH                    *auth) {
-  
-  vtpmloginfo(VTPM_LOG_VTSP, "Disabling Pubek Read.\n");
-  
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_COMMAND_CODE command = TPM_ORD_DisablePubekRead;
-  
-  BYTE *paramText;        // Digest to make Auth.
-  UINT32 paramTextSize;
-    
-  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
-  
-  paramTextSize = BSG_PackList(paramText, 1,
-			       BSG_TPM_COMMAND_CODE, &command);
-  
-  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
-			      ownerAuth, auth) );
-  
-  // Call TCS
-  TPMTRYRETURN( TCSP_DisablePubekRead ( hContext, // in
-                                        auth) );
-  
-  // Verify Auth
-  paramTextSize = BSG_PackList(paramText, 2,
-			       BSG_TPM_RESULT, &status,
-			       BSG_TPM_COMMAND_CODE, &command);
-  
-  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
-			    ownerAuth, auth, 
-			    hContext) );
-  goto egress;
-  
- abort_egress:
- egress:
-  free(paramText);
-  return status;
-}
-
-TPM_RESULT VTSP_CreateWrapKey(  const TCS_CONTEXT_HANDLE hContext,
-                                const TPM_KEY_USAGE      usage,
-                                const TPM_AUTHDATA       *newKeyAuth,
-                                const TCS_KEY_HANDLE     parentHandle, 
-                                const TPM_AUTHDATA       *osapSharedSecret,
-                                buffer_t                 *pubKeyBuf,
-                                TCS_AUTH                 *auth) {
-  
-  int i;
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_COMMAND_CODE command = TPM_ORD_CreateWrapKey;
-  
-  vtpmloginfo(VTPM_LOG_VTSP, "Creating new key of type %d.\n", usage);
-  
-  // vars for Calculate encUsageAuth
-  BYTE *paramText;      
-  UINT32 paramTextSize;
-  
-  // vars for Calculate encUsageAuth
-  BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
-  TPM_DIGEST XORKey1;
-  UINT32 XORbufferSize;
-  TPM_SECRET encUsageAuth, encMigrationAuth;
-  
-  // vars for Flatten newKey prototype
-  BYTE *flatKey = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
-  UINT32 flatKeySize = TCPA_MAX_BUFFER_LENGTH;                                    
-  struct pack_buf_t newKeyText;
-  
-  // Fill in newKey
-  TPM_KEY newKey;
-  
-  BYTE RSAkeyInfo[12] = { 0x00, 0x00, (RSA_KEY_SIZE >> 8), 0x00,   0x00, 0x00, 0x00, 0x02,   0x00, 0x00, 0x00, 0x00};
-  newKey.algorithmParms.algorithmID = TPM_ALG_RSA;
-  newKey.algorithmParms.parms = (BYTE *) &RSAkeyInfo;
-  newKey.algorithmParms.parmSize = 12;
-  
-  switch (usage) {
-  case TPM_KEY_SIGNING:
-    vtpmloginfo(VTPM_LOG_VTSP, "Creating Signing Key...\n");
-    newKey.keyUsage = TPM_KEY_SIGNING;
-    newKey.algorithmParms.encScheme = TPM_ES_NONE;
-    newKey.algorithmParms.sigScheme = TPM_SS_RSASSAPKCS1v15_SHA1;
-    break;
-  case TPM_KEY_STORAGE:
-    vtpmloginfo(VTPM_LOG_VTSP, "Creating Storage Key...\n");
-    newKey.keyUsage = TPM_KEY_STORAGE;
-    newKey.algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
-    newKey.algorithmParms.sigScheme = TPM_SS_NONE;
-    break;
-  case TPM_KEY_BIND:
-    vtpmloginfo(VTPM_LOG_VTSP, "Creating Binding Key...\n");
-    newKey.keyUsage = TPM_KEY_BIND;
-    newKey.algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
-    newKey.algorithmParms.sigScheme = TPM_SS_NONE;
-    break;
-  default:
-    vtpmloginfo(VTPM_LOG_VTSP, "Cannot create key. Invalid Key Type.\n");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-  
-  
-  newKey.ver = TPM_STRUCT_VER_1_1;
-  
-  newKey.keyFlags = 0;
-  newKey.authDataUsage = TPM_AUTH_ALWAYS;
-  newKey.pubKey.keyLength= 0;
-  newKey.encDataSize = 0;
-  newKey.encData = NULL;
-  
-  // FIXME: Support PCR bindings
-  newKey.PCRInfoSize = 0;
-  newKey.PCRInfo = NULL;
-  
-  // Calculate encUsageAuth                                    
-  XORbufferSize = BSG_PackList(  XORbuffer, 2, 
-				 BSG_TPM_SECRET, osapSharedSecret,
-				 BSG_TPM_NONCE, &auth->NonceEven);
-  Crypto_SHA1Full(XORbuffer, XORbufferSize, (BYTE *) &XORKey1);
-  
-  // FIXME: No support for migratable keys.
-  for (i=0; i < TPM_DIGEST_SIZE; i++) 
-    ((BYTE *) &encUsageAuth)[i] = ((BYTE *) &XORKey1)[i] ^ ((BYTE *) newKeyAuth)[i];
-  
-  // Flatten newKey prototype
-  flatKeySize = BSG_Pack(BSG_TPM_KEY, (BYTE *) &newKey, flatKey);
-  newKeyText.data = flatKey;
-  newKeyText.size = flatKeySize;
-  
-  // Generate HMAC
-  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
-  
-  paramTextSize = BSG_PackList(paramText, 3,
-			       BSG_TPM_COMMAND_CODE, &command,
-			       BSG_TPM_AUTHDATA, &encUsageAuth,
-			       BSG_TPM_AUTHDATA, &encMigrationAuth);
-  memcpy(paramText + paramTextSize, newKeyText.data, newKeyText.size);
-  paramTextSize += newKeyText.size;
-  
-  
-  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
-			      osapSharedSecret, auth) );
-  
-  // Call TCS
-  TPMTRYRETURN( TCSP_CreateWrapKey(  hContext, 
-				     parentHandle,
-				     encUsageAuth,
-				     encMigrationAuth,
-				     &newKeyText.size,
-				     &newKeyText.data,
-				     auth) );
-  
-  // Verify Auth
-  paramTextSize = BSG_PackList(paramText, 2,
-			       BSG_TPM_RESULT, &status,
-			       BSG_TPM_COMMAND_CODE, &command);
-  memcpy(paramText + paramTextSize, newKeyText.data, newKeyText.size);
-  paramTextSize += newKeyText.size;
-  
-  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
-			    osapSharedSecret, auth, 0) );
-  
-  // Unpack/return key structure
-  TPMTRYRETURN(buffer_init(pubKeyBuf, 0, 0) );
-  TPMTRYRETURN(buffer_append_raw(pubKeyBuf, newKeyText.size, newKeyText.data) );
-  
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  
-  free(flatKey);
-  free(paramText);
-  TCS_FreeMemory(hContext, newKeyText.data);
-  
-  return status;
-}
-
-TPM_RESULT VTSP_LoadKey(const TCS_CONTEXT_HANDLE    hContext,
-                        const TCS_KEY_HANDLE        hUnwrappingKey,
-                        const buffer_t              *rgbWrappedKeyBlob,
-                        const TPM_AUTHDATA          *parentAuth,
-                        TPM_HANDLE                  *newKeyHandle,
-                        TCS_AUTH                    *auth,
-                        CRYPTO_INFO                 *cryptoinfo,
-                        const BOOL                  skipTPMLoad) { 
-  
-  
-  vtpmloginfo(VTPM_LOG_VTSP, "Loading Key %s.\n", (!skipTPMLoad ? "into TPM" : "only into memory"));
-  
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_COMMAND_CODE command = TPM_ORD_LoadKey;
-
-  BYTE *paramText=NULL;        // Digest to make Auth.
-  UINT32 paramTextSize;
-
-  // SkipTPMLoad stops key from being loaded into TPM, but still generates CRYPTO_INFO for it
-  if (! skipTPMLoad) { 
-  
-    if ((rgbWrappedKeyBlob == NULL) || (parentAuth == NULL) || 
-        (newKeyHandle==NULL) || (auth==NULL)) {
-      status = TPM_BAD_PARAMETER;
-      goto abort_egress;
-    }
-  
-    // Generate Extra TCS Parameters
-    TPM_HANDLE phKeyHMAC;
-  
-    paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
-  
-    paramTextSize = BSG_PackList(paramText, 1,
-  			         BSG_TPM_COMMAND_CODE, &command);
-  
-    memcpy(paramText + paramTextSize, rgbWrappedKeyBlob->bytes, buffer_len(rgbWrappedKeyBlob));
-    paramTextSize += buffer_len(rgbWrappedKeyBlob);
-  
-    TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
-			      parentAuth, auth) );
-  
-    // Call TCS
-    TPMTRYRETURN( TCSP_LoadKeyByBlob(  hContext,
-				       hUnwrappingKey,
-				       buffer_len(rgbWrappedKeyBlob),
-				       rgbWrappedKeyBlob->bytes,
-				       auth,
-				       newKeyHandle,
-				       &phKeyHMAC) );
-  
-    // Verify Auth
-    paramTextSize = BSG_PackList(paramText, 3,
-			         BSG_TPM_RESULT, &status,
-			         BSG_TPM_COMMAND_CODE, &command,
-			         BSG_TPM_HANDLE, newKeyHandle);
-  
-    TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
-			      parentAuth, auth, 
-			      hContext) );
-  } 
-  
-  // Build cryptoinfo structure for software crypto function. 
-  if (cryptoinfo != NULL) {
-    TPM_KEY newKey;
-    
-    // Unpack/return key structure
-    BSG_Unpack(BSG_TPM_KEY, rgbWrappedKeyBlob->bytes , &newKey);
-    TPM_RSA_KEY_PARMS rsaKeyParms;
-    
-    BSG_Unpack(BSG_TPM_RSA_KEY_PARMS, 
-	       newKey.algorithmParms.parms, 
-	       &rsaKeyParms);
-    
-    Crypto_RSABuildCryptoInfoPublic(rsaKeyParms.exponentSize, 
-				    rsaKeyParms.exponent, 
-				    newKey.pubKey.keyLength, 
-				    newKey.pubKey.key, 
-				    cryptoinfo);
-    
-    // Destroy rsaKeyParms
-    BSG_Destroy(BSG_TPM_RSA_KEY_PARMS, &rsaKeyParms);
-    
-    // Set encryption scheme
-    cryptoinfo->encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
-  }
-  
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  
-  free(paramText);
-  return status;
-}
-
-TPM_RESULT VTSP_Unbind( const TCS_CONTEXT_HANDLE    hContext,
-                        const TPM_KEY_HANDLE        key_handle,
-                        const buffer_t              *bound_data,
-                        const TPM_AUTHDATA          *usage_auth,
-                        buffer_t                    *clear_data,
-                        TCS_AUTH                    *auth) {
-  
-  vtpmloginfo(VTPM_LOG_VTSP, "Unbinding %d bytes of data.\n", buffer_len(bound_data));
-  
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_COMMAND_CODE command = TPM_ORD_UnBind;
-  
-  BYTE *paramText;        // Digest to make Auth.
-  UINT32 paramTextSize;
-  
-  // Generate Extra TCS Parameters
-  struct pack_buf_t clear_data32;
-  BYTE *clear_data_text;
-  UINT32 clear_data_size;
-  
-  struct pack_buf_t bound_data32 = {bound_data->size, bound_data->bytes};
-  
-  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
-  
-  paramTextSize = BSG_PackList(paramText, 2,
-			       BSG_TPM_COMMAND_CODE, &command,
-			       BSG_TPM_SIZE32_DATA, &bound_data32);
-  
-  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
-			      usage_auth, auth) );
-  
-  // Call TCS
-  TPMTRYRETURN( TCSP_UnBind( hContext,
-			     key_handle,
-			     buffer_len(bound_data),
-			     bound_data->bytes,
-			     auth,
-			     &clear_data_size,
-			     &clear_data_text) );
-  
-  
-  // Verify Auth
-  clear_data32.size = clear_data_size;
-  clear_data32.data = clear_data_text;
-  paramTextSize = BSG_PackList(paramText, 3,
-			       BSG_TPM_RESULT, &status,
-			       BSG_TPM_COMMAND_CODE, &command,
-			       BSG_TPM_SIZE32_DATA, &clear_data32);
-  
-  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
-			    usage_auth, auth, 
-			    hContext) );
-  
-  // Unpack/return key structure
-  TPMTRYRETURN(buffer_init(clear_data, 0, 0));
-  TPMTRYRETURN(buffer_append_raw (clear_data, clear_data_size, clear_data_text) );
-  
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  
-  free(paramText);
-  TCS_FreeMemory(hContext, clear_data_text);
-  
-  return status;
-}
-
-TPM_RESULT VTSP_Bind(   CRYPTO_INFO *cryptoInfo, 
-			const buffer_t *inData, 
-			buffer_t *outData)               
-{
-  vtpmloginfo(VTPM_LOG_VTSP, "Binding %d bytes of data.\n", buffer_len(inData));
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_BOUND_DATA boundData;
-  UINT32 i;
-  
-  // Fill boundData's accessory information
-  boundData.ver = TPM_STRUCT_VER_1_1;
-  boundData.payload = TPM_PT_BIND;
-  boundData.payloadData = inData->bytes;
-  
-  // Pack boundData before encryption
-  BYTE* flatBoundData = (BYTE *)malloc(sizeof(BYTE) * 
-				       (sizeof(TPM_VERSION) +
-					sizeof(TPM_PAYLOAD_TYPE) +
-					buffer_len(inData)));
-  if (flatBoundData == NULL) {
-    return TPM_NOSPACE;
-  }
-  UINT32 flatBoundDataSize = 0;
-  flatBoundDataSize = BSG_PackList(  flatBoundData, 2, 
-				     BSG_TPM_VERSION, &boundData.ver, 
-				     BSG_TYPE_BYTE, &boundData.payload);
-  
-  memcpy(flatBoundData+flatBoundDataSize, inData->bytes, buffer_len(inData));
-  flatBoundDataSize += buffer_len(inData);
-  
-  BYTE out_tmp[RSA_KEY_SIZE/8]; // RSAEnc does not do blocking, So this is what will come out.
-  UINT32 out_tmp_size;
-  
-  // Encrypt flatBoundData
-  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_RSAEnc( cryptoInfo, 
-                                           flatBoundDataSize, 
-                                           flatBoundData, 
-                                           &out_tmp_size, 
-                                           out_tmp) );
-  
-  if (out_tmp_size > RSA_KEY_SIZE/8) {
-    // The result of RSAEnc should be a fixed size based on key size.
-    vtpmlogerror(VTPM_LOG_VTSP, "Enc buffer just overflowed.\n");
-  }
-  
-  buffer_init(outData, 0, NULL);
-  buffer_append_raw(outData, out_tmp_size, out_tmp);
-  
-  vtpmloginfo(VTPM_LOG_TXDATA, "Bind Generated[%d] = 0x", out_tmp_size);
-  for(i = 0 ; i < out_tmp_size ; i++) {
-    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out_tmp[i]);
-  }
-  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
-
-  goto egress;
-  abort_egress: 
-  egress:
- 
-  // Free flatBoundData
-  free(flatBoundData);
-  
-  return TPM_SUCCESS;
-}
-
-TPM_RESULT VTSP_Seal(const TCS_CONTEXT_HANDLE    hContext,
-                     const TPM_KEY_HANDLE        keyHandle,
-                     const TPM_AUTHDATA          *sealDataAuth,
-                     const TPM_PCR_COMPOSITE     *pcrComp,
-                     const buffer_t              *inData,
-                     TPM_STORED_DATA             *sealedData,                                   
-                     const TPM_SECRET            *osapSharedSecret,
-                     TCS_AUTH                    *auth) {
-
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_COMMAND_CODE command = TPM_ORD_Seal;
-
-  BYTE *paramText;        // Digest to make Auth.
-  UINT32 paramTextSize;
-
-  // Generate PCR_Info Struct from Comp
-  TPM_PCR_INFO pcrInfo;
-  UINT32 pcrInfoSize, flatpcrSize;
-  BYTE flatpcr[3 +                          // PCR_Select = 3 1 byte banks
-               sizeof(UINT16) +             //              2 byte UINT16
-               sizeof(UINT32) +             // PCR_Comp   = 4 byte UINT32
-               24 * sizeof(TPM_PCRVALUE) ]; //              up to 24 PCRs
-
-  if (pcrComp != NULL) {
-      //printf("\n\tBinding to PCRs: ");
-      //for(int i = 0 ; i < pcrComp->select.sizeOfSelect ; i++)
-      //printf("%2.2x", pcrComp->select.pcrSelect[i]);
-
-      memcpy(&pcrInfo.pcrSelection, &pcrComp->select, sizeof(TPM_PCR_SELECTION));
-
-      flatpcrSize = BSG_Pack(BSG_TPM_PCR_COMPOSITE, (BYTE *) pcrComp, flatpcr);
-      Crypto_SHA1Full((BYTE *) flatpcr, flatpcrSize, (BYTE *) &(pcrInfo.digestAtRelease));
-      memset(&(pcrInfo.digestAtCreation), 0, sizeof(TPM_DIGEST));
-      pcrInfoSize = BSG_Pack(BSG_TPM_PCR_INFO, (BYTE *) &pcrInfo, flatpcr);
-  } else {
-      //printf("\n\tBinding to no PCRS.");
-      pcrInfoSize = 0;
-  }
-
-  // Calculate encUsageAuth
-  BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
-  UINT32 XORbufferSize = sizeof(XORbuffer);
-  TPM_DIGEST XORKey;
-  TPM_ENCAUTH encAuth;
-
-  BSG_PackList( XORbuffer, 2,
-                BSG_TPM_SECRET, osapSharedSecret,
-                BSG_TPM_NONCE, &auth->NonceEven );
-
-  Crypto_SHA1Full(XORbuffer, XORbufferSize, (BYTE *) &XORKey);
-
-  int i;
-  for (i=0; i < TPM_DIGEST_SIZE; i++)
-    ((BYTE *) &encAuth)[i] = ((BYTE *) &XORKey)[i] ^ ((BYTE *) sealDataAuth)[i];
-
-  // Generate Extra TCS Parameters
-  UINT32 inDataSize = buffer_len(inData);
-  struct pack_buf_t inData_pack = {inDataSize, inData->bytes};
-  struct pack_buf_t pcrInfo_pack = {pcrInfoSize, flatpcr};
-
-  UINT32 sealedDataSize;
-  BYTE *flatSealedData=NULL;
-
-  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
-
-  paramTextSize = BSG_PackList(paramText, 4,
-                               BSG_TPM_COMMAND_CODE, &command,
-                               BSG_TPM_ENCAUTH, &encAuth,
-                               BSG_TPM_SIZE32_DATA, &pcrInfo_pack,
-                               BSG_TPM_SIZE32_DATA, &inData_pack);
-
-  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
-                              osapSharedSecret, auth) );
-
-  // Call TCS
-  TPMTRYRETURN( TCSP_Seal( hContext,
-                           keyHandle,
-                           encAuth,
-                           pcrInfoSize,
-                           flatpcr,
-                           inDataSize,
-                           inData->bytes,
-                           auth,
-                           &sealedDataSize,
-                           &flatSealedData) );
-
-  // Unpack/return key structure
-  BSG_Unpack( BSG_TPM_STORED_DATA, flatSealedData, sealedData );
-
-  paramTextSize = BSG_PackList(paramText, 3,
-                               BSG_TPM_RESULT, &status,
-                               BSG_TPM_COMMAND_CODE, &command,
-                               BSG_TPM_STORED_DATA, sealedData);
-
-  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
-                            osapSharedSecret, auth,
-                            0) );
-
-
-  goto egress;
-
- abort_egress:
- egress:
-
-  if (flatSealedData)
-    TCS_FreeMemory( hContext, flatSealedData);
-
-  free(paramText);
-  return status;
-}
-
-
-TPM_RESULT VTSP_Unseal(const TCS_CONTEXT_HANDLE    hContext,
-                       const TPM_KEY_HANDLE        keyHandle,
-                       const TPM_STORED_DATA       *sealedData,
-                       const TPM_AUTHDATA          *key_usage_auth,
-                       const TPM_AUTHDATA          *data_usage_auth,
-                       buffer_t                    *outData,
-                       TCS_AUTH                    *auth,
-                       TCS_AUTH                    *dataAuth) {
-
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_COMMAND_CODE command = TPM_ORD_Unseal;
-
-  BYTE *paramText;        // Digest to make Auth.
-  UINT32 paramTextSize;
-
-  // Generate Extra TCS Parameters
-  UINT32 sealDataSize, clearDataSize;
-  BYTE *flatSealedData= (BYTE *) malloc(sizeof(TPM_VERSION) +
-                                        2 * sizeof(UINT32) +
-                                        sealedData->sealInfoSize +
-                                        sealedData->encDataSize),
-       *clearData=NULL;
-
-  sealDataSize = BSG_Pack(BSG_TPM_STORED_DATA, sealedData, flatSealedData );
-
-  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
-
-  paramTextSize = BSG_PackList(paramText, 2,
-                               BSG_TPM_COMMAND_CODE, &command,
-                               BSG_TPM_STORED_DATA, sealedData);
-
-  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
-                              key_usage_auth, auth) );
-
-  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
-                              data_usage_auth, dataAuth) );
-  // Call TCS
-  TPMTRYRETURN( TCSP_Unseal(  hContext,
-                              keyHandle,
-                              sealDataSize,
-                              flatSealedData,
-                              auth,
-                              dataAuth,
-                              &clearDataSize,
-                              &clearData) );
-
-  // Verify Auth
-  struct pack_buf_t clearData_pack = {clearDataSize, clearData};
-
-  paramTextSize = BSG_PackList(paramText, 3,
-                               BSG_TPM_RESULT, &status,
-                               BSG_TPM_COMMAND_CODE, &command,
-                               BSG_TPM_SIZE32_DATA, &clearData_pack);
-
-  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
-                            key_usage_auth, auth,
-                            hContext) );
-
-  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
-                            data_usage_auth, dataAuth,
-                            hContext) );
-
-  // Unpack/return key structure
-  TPMTRYRETURN( buffer_init(outData, clearDataSize, clearData) );
-
-  goto egress;
-
- abort_egress:
- egress:
-
-  if (flatSealedData)
-    TCS_FreeMemory( hContext, clearData);
-
-  free(paramText);
-  return status;
-}
-
-TPM_RESULT VTSP_SaveState( const TCS_CONTEXT_HANDLE    hContext) {
-
-  vtpmloginfo(VTPM_LOG_VTSP, "Calling TPM_SaveState.\n");
-
-  TPM_RESULT status = TPM_SUCCESS;
-
-  // Call TCS
-  return ( TCSP_SaveState ( hContext ) );
-
-}
-
-
-// Function Reaches into unsupported TCS command, beware.
-TPM_RESULT VTSP_RawTransmit(const TCS_CONTEXT_HANDLE    hContext,
-                            const buffer_t *inbuf,
-                            buffer_t *outbuf ) {
-  
-  vtpmloginfo(VTPM_LOG_VTSP, "Passthrough in use.\n");
-  TPM_RESULT status = TPM_SUCCESS;
-  
-  // Generate Extra TCS Parameters
-  BYTE *resultText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
-  UINT32 resultTextSize =  TCPA_MAX_BUFFER_LENGTH;
-  
-  // Call TCS                          
-  TPMTRYRETURN( TCSP_RawTransmitData(buffer_len(inbuf), inbuf->bytes, 
-				     &resultTextSize, resultText) );
-  
-  // Unpack/return key structure
-  TPMTRYRETURN(buffer_init (outbuf, resultTextSize, resultText) );                                
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  TCS_FreeMemory(hContext, resultText);
-  free(resultText);
-  return status;
-}
diff --git a/tools/vtpm_manager/manager/vtsp.h b/tools/vtpm_manager/manager/vtsp.h
deleted file mode 100644
index 2fb0440..0000000
--- a/tools/vtpm_manager/manager/vtsp.h
+++ /dev/null
@@ -1,126 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtsp.h
-// 
-//  Higher level interface to TCS.
-//
-// ==================================================================
-
-#ifndef __VTSP_H__
-#define __VTSP_H__
-
-#include "tcg.h"
-#include "tcs.h"
-
-#define KEY_BUFFER_SIZE 2048
-
-TPM_RESULT VTSP_RawTransmit(const TCS_CONTEXT_HANDLE    hContext,
-                            const buffer_t *inbuf,
-                            buffer_t *outbuf );
-
-TPM_RESULT VTSP_OIAP(  const TCS_CONTEXT_HANDLE hContext,
-                       TCS_AUTH *auth);
-                       
-TPM_RESULT VTSP_OSAP(  const TCS_CONTEXT_HANDLE hContext,
-                       const TPM_ENTITY_TYPE entityType,
-                       const UINT32 entityValue,
-                       const TPM_AUTHDATA *usageAuth,
-                       TPM_SECRET *sharedsecret, 
-                       TCS_AUTH *auth);
-
-TPM_RESULT VTSP_TerminateHandle(const TCS_CONTEXT_HANDLE hContext,
-                                const TCS_AUTH *auth);
-
-TPM_RESULT VTSP_ReadPubek(   const TCS_CONTEXT_HANDLE hContext,
-                             CRYPTO_INFO *cypto_info);
-
-TPM_RESULT VTSP_TakeOwnership(   const TCS_CONTEXT_HANDLE hContext,
-                                 const TPM_AUTHDATA *ownerAuth, 
-                                 const TPM_AUTHDATA *srkAuth,
-                                 CRYPTO_INFO *ek_cryptoInfo,
-                                 TCS_AUTH *auth);
-                               
-TPM_RESULT VTSP_DisablePubekRead( const TCS_CONTEXT_HANDLE    hContext,
-                                  const TPM_AUTHDATA *ownerAuth, 
-                                  TCS_AUTH                    *auth);
-                               
-TPM_RESULT VTSP_CreateWrapKey(  const TCS_CONTEXT_HANDLE hContext,
-                                const TPM_KEY_USAGE      usage,
-                                const TPM_AUTHDATA       *newKeyAuth,
-                                const TCS_KEY_HANDLE     parentHandle, 
-                                const TPM_AUTHDATA       *osapSharedSecret,
-                                buffer_t                 *pubKeyBuf,
-                                TCS_AUTH                 *auth);
-
-TPM_RESULT VTSP_LoadKey(const TCS_CONTEXT_HANDLE    hContext,
-                        const TCS_KEY_HANDLE        hUnwrappingKey,
-                        const buffer_t              *rgbWrappedKeyBlob,
-                        const TPM_AUTHDATA          *parentAuth,
-                        TPM_HANDLE                  *newKeyHandle,
-                        TCS_AUTH                    *pAuth,
-                        CRYPTO_INFO                 *cryptoinfo,
-                        const BOOL                  skipTPMLoad);
-
-TPM_RESULT VTSP_Unbind( const TCS_CONTEXT_HANDLE    hContext,
-                        const TPM_KEY_HANDLE        key_handle,
-                        const buffer_t              *bound_data,
-                        const TPM_AUTHDATA          *usage_auth,
-                        buffer_t                    *clear_data,
-                        TCS_AUTH                    *auth);
-                        
-TPM_RESULT VTSP_Bind(   CRYPTO_INFO *cryptoInfo,
-            const buffer_t *inData, 
-            buffer_t *outData);
-                        
-TPM_RESULT VTSP_Seal(const TCS_CONTEXT_HANDLE    hContext,
-                     const TPM_KEY_HANDLE        keyHandle,
-                     const TPM_AUTHDATA          *sealDataAuth,
-                     const TPM_PCR_COMPOSITE     *pcrComp,
-                     const buffer_t              *inData,
-                     TPM_STORED_DATA             *sealedData,                                   
-                     const TPM_SECRET            *osapSharedSecret,
-                     TCS_AUTH                    *auth);
-
-TPM_RESULT VTSP_Unseal(const TCS_CONTEXT_HANDLE    hContext,
-                       const TPM_KEY_HANDLE        keyHandle,
-                       const TPM_STORED_DATA       *sealedData,
-                       const TPM_AUTHDATA          *key_usage_auth,
-                       const TPM_AUTHDATA          *data_usage_auth,
-                       buffer_t                    *outData,
-                       TCS_AUTH                    *auth,
-                       TCS_AUTH                    *dataAuth);
-
-TPM_RESULT VTSP_SaveState( const TCS_CONTEXT_HANDLE    hContext);
-
-#endif //_VTSP_H_
diff --git a/tools/vtpm_manager/migration/Makefile b/tools/vtpm_manager/migration/Makefile
deleted file mode 100644
index e33ae95..0000000
--- a/tools/vtpm_manager/migration/Makefile
+++ /dev/null
@@ -1,42 +0,0 @@
-XEN_ROOT = $(CURDIR)/../../..
-include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
-
-VPATH = ../manager
-
-BIND		= vtpm_migratord
-BINC		= vtpm_migrator
-
-SRCSD    = vtpm_manager_if.c vtpm_migratord.c vtpm_migratord_handler.c vtpm_ipc.c
-SRCSC    = vtpm_manager_if.c vtpm_migrator_if.c vtpm_migratorc.c vtpm_ipc.c
-
-OBJSD    = $(patsubst %.c,%.o,$(SRCSD))
-OBJSC    = $(patsubst %.c,%.o,$(SRCSC))
-
-.PHONY: all
-all: build
-
-.PHONY: build
-build: $(BIND) $(BINC)
-
-.PHONY: install
-install: build
-	$(INSTALL_PROG) $(BIND) $(DESTDIR)$(BINDIR)
-	$(INSTALL_PROG) $(BINC) $(DESTDIR)$(BINDIR)
-
-.PHONY: clean
-clean:
-	rm -f $(BINC) $(BIND)
-	rm -f *.a *.so *.o *.rpm $(DEP_FILES)
-
-.PHONY: mrproper
-mrproper: clean
-	rm -f *~
-
-$(BIND): $(OBJSD)
-	$(CC) $(LDFLAGS) $^ $(LIBS) -o $@
-
-$(BINC): $(OBJSC)
-	$(CC) $(LDFLAGS) $^ $(LIBS) -o $@
-
-# libraries
-LIBS += ../util/libTCGUtils.a
diff --git a/tools/vtpm_manager/migration/vtpm_manager_if.c b/tools/vtpm_manager/migration/vtpm_manager_if.c
deleted file mode 100644
index 08986f4..0000000
--- a/tools/vtpm_manager/migration/vtpm_manager_if.c
+++ /dev/null
@@ -1,186 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtpm_manager_if.c
-// 
-//  Provides functions to call local vtpm manager interface (Hotplug)
-//
-// ==================================================================
-
-#include <stdio.h>
-#include <fcntl.h>
-#include <malloc.h>
-#include <string.h>
-
-#include "tcg.h"
-#include "buffer.h"
-#include "log.h"
-#include "vtpm_ipc.h"
-#include "bsg.h"
-#include "vtpm_migrator.h"
-#include "vtpm_manager.h"
-
-#define VTPM_TX_HP_FNAME       "/var/vtpm/fifos/from_console.fifo"
-#define VTPM_RX_HP_FNAME       "/var/vtpm/fifos/to_console.fifo"
-
-static vtpm_ipc_handle_t tx_ipc_h, rx_ipc_h;
-
-TPM_RESULT vtpm_manager_open(){
-
-  if ( (vtpm_ipc_init(&tx_ipc_h,  VTPM_TX_HP_FNAME, O_RDWR, TRUE) != 0) ||  //FIXME: wronly
-       (vtpm_ipc_init(&rx_ipc_h,  VTPM_RX_HP_FNAME, O_RDWR, TRUE) != 0) ) { //FIXME: rdonly
-    vtpmlogerror(VTPM_LOG_VTPM, "Unable to connect to vtpm_manager.\n");
-    return TPM_IOERROR;
-  } 
-
-  return TPM_SUCCESS;
-}
-
-void vtpm_manager_close() {
-
-  vtpm_ipc_close(&tx_ipc_h);
-  vtpm_ipc_close(&rx_ipc_h);
-}
-
-
-TPM_RESULT vtpm_manager_command(TPM_COMMAND_CODE ord,
-                                buffer_t *command_param_buf,
-                                TPM_RESULT *cmd_status, /* out */
-                                buffer_t *result_param_buf) {
-
-  TPM_RESULT status = TPM_FAIL;
-  int  size_read, size_write, i;
-  BYTE *adj_command, response_header[VTPM_COMMAND_HEADER_SIZE_SRV];
-  UINT32 dmi_id=0, adj_command_size, out_param_size, adj_param_size;
-  TPM_TAG tag=VTPM_TAG_REQ;
-
-  if ( (!command_param_buf) || (!result_param_buf) || (!cmd_status) ) {
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }   
-  
-  adj_command_size = VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(command_param_buf);
-  adj_command = (BYTE *) malloc( adj_command_size );
-  if (!adj_command) {
-    status = TPM_RESOURCES;
-    goto abort_egress;
-  }
-
-  out_param_size = VTPM_COMMAND_HEADER_SIZE + buffer_len(command_param_buf);
-  BSG_PackList(adj_command, 4,
-                 BSG_TYPE_UINT32, &dmi_id,
-                 BSG_TPM_TAG, &tag,
-                 BSG_TYPE_UINT32, &out_param_size,
-                 BSG_TPM_COMMAND_CODE, &ord );
-
-  memcpy(adj_command + VTPM_COMMAND_HEADER_SIZE_SRV, command_param_buf->bytes, buffer_len(command_param_buf));
-
-  size_write = vtpm_ipc_write(&tx_ipc_h, NULL, adj_command, adj_command_size);
-
-  if (size_write > 0) {
-    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT (MGR): 0x");
-    for (i=0; i< adj_command_size; i++) {
-      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", adj_command[i]);
-    }
-    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-  } else {
-    vtpmlogerror(VTPM_LOG_VTPM, "Error writing VTPM Manager console.\n");
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  if (size_write != (int) adj_command_size )
-    vtpmlogerror(VTPM_LOG_VTPM, "Could not write entire command to mgr (%d/%d)\n", size_write, adj_command_size);
-
-  // Read header for response to manager command
-  size_read = vtpm_ipc_read(&rx_ipc_h, NULL, response_header, VTPM_COMMAND_HEADER_SIZE_SRV);
-  if (size_read > 0) {
-    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV (MGR): 0x");
-    for (i=0; i<size_read; i++)
-      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", response_header[i]);
-
-  } else {
-    vtpmlogerror(VTPM_LOG_VTPM, "Error reading from vtpm manager.\n");
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Command from vtpm_manager shorter than std header.\n");
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  // Unpack response from DMI for TPM command
-  BSG_UnpackList(response_header, 4,
-                 BSG_TYPE_UINT32, &dmi_id,
-                 BSG_TPM_TAG, &tag,
-                 BSG_TYPE_UINT32, &out_param_size,
-                 BSG_TPM_COMMAND_CODE, cmd_status );
-
-  // If response has parameters, read them.
-  // Note that out_param_size is in the client's context
-  adj_param_size = out_param_size - VTPM_COMMAND_HEADER_SIZE;
-  if (adj_param_size > 0) {
-    TPMTRYRETURN( buffer_init( result_param_buf, adj_param_size, NULL) );
-    size_read = vtpm_ipc_read(&rx_ipc_h, NULL, result_param_buf->bytes, adj_param_size);
-    if (size_read > 0) {
-      for (i=0; i< size_read; i++)
-        vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_param_buf->bytes[i]);
-
-    } else {
-      vtpmlogerror(VTPM_LOG_VTPM, "Error reading from vtpm manager.\n");
-      goto abort_egress;
-    }
-    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
-
-    if (size_read < (int)adj_param_size) {
-      vtpmloginfomore(VTPM_LOG_VTPM, "\n");
-      vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
-      status = TPM_IOERROR;
-      goto abort_egress;
-    }
-  } else {
-    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
-  }
-
-  status=TPM_SUCCESS;
-  goto egress;
-
- abort_egress:
- egress:
-
-  return status;
-}
-
-
diff --git a/tools/vtpm_manager/migration/vtpm_migrator.h b/tools/vtpm_manager/migration/vtpm_migrator.h
deleted file mode 100644
index 8d52e66..0000000
--- a/tools/vtpm_manager/migration/vtpm_migrator.h
+++ /dev/null
@@ -1,104 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtpm_migrator.h
-// 
-//  Public Interface header for VTPM Migrator 
-//
-// ==================================================================
-
-#ifndef __VTPM_MIGRATOR_H__
-#define __VTPM_MIGRATOR_H__
-
-#define VTPM_MTAG_REQ 0x02c1
-#define VTPM_MTAG_RSP 0x02c4
-
-// Header sizes. 
-#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
-//               sizeof(TPM_TAG + UINT32 + TPM_COMMAND_CODE)
-
-//*********************** Connection Info **************************
-#define VTPM_MIG_PORT 48879 
-
-//************************ Command Codes ***************************
-#define VTPM_MORD_MIG_STEP1     0x00
-#define VTPM_MORD_MIG_STEP2     0x01
-#define VTPM_MORD_MIG_STEP3     0x02
-#define VTPM_MORD_MIG_STEP4     0x03
-
-//************************ Return Codes ****************************
-#define VTPM_SUCCESS               0
-#define VTPM_FAIL                  1
-
-/******************* Command Parameter API *************************
-
-VTPM Command Format
-  tpm tag: 2 bytes
-  command size: 4 bytes         // Size of command including header but not DMI
-  ord: 4 bytes                  // Command ordinal above
-  parameters: size - 10 bytes   // Command Parameter
-
-VTPM Response Format
-  tpm tag: 2 bytes
-  response_size: 4 bytes
-  status: 4 bytes         
-  parameters: size - 10 bytes
-
-
-VTPM_Mig_Phase1:
-    Unsupported: (Handled by scripts)
-    
-VTPM_Mig_Phase2
-  Input Parameters:
-    domain_name_size: 4 bytes
-    domain_name : domain_name_size bytes
-  Output Parameters:
-    pub_exp_size: 4 bytes
-    pub_exp: pub_exp_size bytes
-    pub_mod_size: 4 bytes
-    pub_mod: pub_mod_size bytes
-
-VTPM_Mig_Phase3
-  Input Parameters:
-    vtpm_state_size: 4 bytes
-    vtpm_state: vtpm_state_size bytes
-  Output Parameters:
-    none
-
-VTPM_Mig_Phase4
-    Unsupported: (Handled by scripts)
-
-
-*********************************************************************/
-
-#endif //_VTPM_MANAGER_H_
diff --git a/tools/vtpm_manager/migration/vtpm_migrator_if.c b/tools/vtpm_manager/migration/vtpm_migrator_if.c
deleted file mode 100644
index de48b2d..0000000
--- a/tools/vtpm_manager/migration/vtpm_migrator_if.c
+++ /dev/null
@@ -1,219 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtpm_migrator_if.c
-// 
-//  Provides functions to call open network connection & call
-//  a function on the vtpm_migratord on the destination
-//
-// ==================================================================
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <string.h>
-#include <malloc.h>
-
-#include "tcg.h"
-#include "buffer.h"
-#include "log.h"
-#include "bsg.h"
-#include "vtpm_migrator.h"
-
-static int sock_desc;
-
-
-TPM_RESULT vtpm_migratord_open(char *server_address){
-
-  TPM_RESULT status = TPM_FAIL;
-
-  /* network variables */
-  struct in_addr ip_addr;
-  struct sockaddr_in server_addr;
-  int addr_len;
-  struct hostent *dns_info=NULL;
-
-  /* set up connection to server*/
-  dns_info = gethostbyname(server_address);
-  ip_addr.s_addr = *((unsigned long *) dns_info->h_addr_list[0]);
-
-  if(ip_addr.s_addr < 0) {
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  /* set up server variable */
-  memset((char *)&server_addr, 0, sizeof(server_addr));
-  server_addr.sin_family = AF_INET;
-  server_addr.sin_port = htons(VTPM_MIG_PORT);
-  server_addr.sin_addr.s_addr = ip_addr.s_addr;
-
-  /* open socket, make connection */
-  sock_desc = socket(AF_INET, SOCK_STREAM, 0);
-
-  if (sock_desc < 0 ) {
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  if (connect(sock_desc,
-              (struct sockaddr *)&server_addr,
-              sizeof(server_addr)) < 0 ) {
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  status = TPM_SUCCESS;
-  goto egress;
-
- abort_egress:
- egress:
-
-  return status;
-}
-
-void vtpm_migratord_close() {
-  close(sock_desc);
-}
-
-
-TPM_RESULT vtpm_migratord_command(TPM_COMMAND_CODE ord,
-                                buffer_t *command_param_buf,
-                                TPM_RESULT *cmd_status, /* out */
-                                buffer_t *result_param_buf) {
-
-  TPM_RESULT status = TPM_FAIL;
-  int  size_read, size_write, i;
-  BYTE *command, response_header[VTPM_COMMAND_HEADER_SIZE];
-  UINT32 dmi_id=0, command_size, out_param_size, adj_param_size;
-  TPM_TAG tag=VTPM_MTAG_REQ;
-
-  if ( (!command_param_buf) || (!result_param_buf) || (!cmd_status) ) {
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }   
-  
-  command_size = VTPM_COMMAND_HEADER_SIZE + buffer_len(command_param_buf);
-  command = (BYTE *) malloc( command_size );
-  if (!command) {
-    status = TPM_RESOURCES;
-    goto abort_egress;
-  }
-
-  BSG_PackList(command, 3,
-                 BSG_TPM_TAG, &tag,
-                 BSG_TYPE_UINT32, &command_size,
-                 BSG_TPM_COMMAND_CODE, &ord );
-
-  memcpy(command + VTPM_COMMAND_HEADER_SIZE, command_param_buf->bytes, buffer_len(command_param_buf));
-
-  size_write = write(sock_desc, command, command_size);
-
-  if (size_write > 0) {
-    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT (MIGd): 0x");
-    for (i=0; i< command_size; i++) {
-      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", command[i]);
-    }
-    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-  } else {
-    vtpmlogerror(VTPM_LOG_VTPM, "Error writing to migration server via network.\n");
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  if (size_write != (int) command_size )
-    vtpmlogerror(VTPM_LOG_VTPM, "Could not write entire command to migration server (%d/%d)\n", size_write, command_size);
-
-  // Read header for response 
-  size_read = read(sock_desc, response_header, VTPM_COMMAND_HEADER_SIZE);
-  if (size_read > 0) {
-    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV (MIGd): 0x");
-    for (i=0; i<size_read; i++)
-      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", response_header[i]);
-
-  } else {
-    vtpmlogerror(VTPM_LOG_VTPM, "Error reading from Migration Server.\n");
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Command from migration server shorter than std header.\n");
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  // Unpack response from DMI for TPM command
-  BSG_UnpackList(response_header, 3,
-                 BSG_TPM_TAG, &tag,
-                 BSG_TYPE_UINT32, &out_param_size,
-                 BSG_TPM_COMMAND_CODE, cmd_status );
-
-  // If response has parameters, read them.
-  adj_param_size = out_param_size - VTPM_COMMAND_HEADER_SIZE;
-  if (adj_param_size > 0) {
-    TPMTRYRETURN( buffer_init( result_param_buf, adj_param_size, NULL) );
-    size_read = read(sock_desc, result_param_buf->bytes, adj_param_size);
-    if (size_read > 0) {
-      for (i=0; i< size_read; i++)
-        vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_param_buf->bytes[i]);
-
-    } else {
-      vtpmlogerror(VTPM_LOG_VTPM, "Error reading from migration server.\n");
-      goto abort_egress;
-    }
-    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
-
-    if (size_read < (int)adj_param_size) {
-      vtpmloginfomore(VTPM_LOG_VTPM, "\n");
-      vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
-      status = TPM_IOERROR;
-      goto abort_egress;
-    }
-  } else {
-    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
-  }
-
-  status=TPM_SUCCESS;
-  goto egress;
-
- abort_egress:
- egress:
-
-  return status;
-}
-
-
diff --git a/tools/vtpm_manager/migration/vtpm_migratorc.c b/tools/vtpm_manager/migration/vtpm_migratorc.c
deleted file mode 100644
index 18b3bdb..0000000
--- a/tools/vtpm_manager/migration/vtpm_migratorc.c
+++ /dev/null
@@ -1,211 +0,0 @@
-// ===================================================================
-//
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above
-//     copyright notice, this list of conditions and the following
-//     disclaimer in the documentation and/or other materials provided
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-
-#include <stdio.h>
-#include <string.h>
-
-#include "tcg.h"
-#include "log.h"
-#include "bsg.h"
-#include "buffer.h"
-#include "vtpm_migrator.h"
-#include "vtpm_manager.h"
-
-TPM_RESULT handle_vtpm_mig_step2(char *server_addr, 
-                                 char *name, 
-                                 UINT32 instance) {
-  TPM_RESULT status, cmd_status;
-  buffer_t out_param_buf=NULL_BUF, mig_key_buf=NULL_BUF, empty_buf=NULL_BUF;
-  UINT32 offset; 
-  struct pack_buf_t addr_data32;
-
-  //===== Get Destination's Public Migration Key ======
-  TPMTRYRETURN( vtpm_migratord_open(server_addr) );
-
-  TPMTRYRETURN( vtpm_migratord_command(VTPM_MORD_MIG_STEP2,
-                                     &out_param_buf,
-                                     &cmd_status, 
-                                     &mig_key_buf) ); 
-  vtpm_migratord_close();
-
-  TPMTRYRETURN(cmd_status);
-
-  //===== Load migration key into vtpm_manager ========
-
-  addr_data32.data = (BYTE *)server_addr;
-  addr_data32.size = strlen(server_addr) + 1; // Include the null
-
-  TPMTRYRETURN ( buffer_init ( &out_param_buf, 
-                               sizeof(UINT32) + addr_data32.size +buffer_len(&mig_key_buf),
-                               NULL ) ) ;
-
-  offset =  BSG_PackList(out_param_buf.bytes, 1,
-               BSG_TPM_SIZE32_DATA, &addr_data32);
-
-  memcpy(out_param_buf.bytes + offset , mig_key_buf.bytes, buffer_len(&mig_key_buf) );
-
-  TPMTRYRETURN ( vtpm_manager_open() );
-
-  TPMTRYRETURN ( vtpm_manager_command(VTPM_ORD_LOAD_MIG_KEY,
-                                      &out_param_buf,
-                                      &cmd_status,
-                                      &empty_buf) );
-
-  vtpm_manager_close();
-
-  TPMTRYRETURN(cmd_status);
-
-  goto egress;
-
- abort_egress:
- egress:
-
-  buffer_free(&mig_key_buf);
-  buffer_free(&out_param_buf);
-
-  return status;
-}
-
-
-TPM_RESULT handle_vtpm_mig_step3(char *server_addr, 
-                                 char *name, 
-                                 UINT32 instance) {
-  TPM_RESULT status, cmd_status;
-  buffer_t out_param_buf=NULL_BUF, state_buf=NULL_BUF, empty_buf=NULL_BUF;
-  struct pack_buf_t addr_data32, name_data32, state_data32;
-
-  //===== Get vtpm state from vtpm_manager ========
-  addr_data32.data = (BYTE *)server_addr;
-  addr_data32.size = strlen(server_addr) + 1; // Include the null
-
-  TPMTRYRETURN ( buffer_init ( &out_param_buf,
-                               (2 * sizeof(UINT32)) + addr_data32.size,
-                               NULL ) ) ;
-
-  BSG_PackList(out_param_buf.bytes, 2,
-                 BSG_TYPE_UINT32, &instance, 
-                 BSG_TPM_SIZE32_DATA, &addr_data32);
-
-  TPMTRYRETURN ( vtpm_manager_open() );
-
-  TPMTRYRETURN ( vtpm_manager_command(VTPM_ORD_MIGRATE_OUT,
-                                      &out_param_buf,
-                                      &cmd_status,
-                                      &state_buf) );
-
-  vtpm_manager_close();
-
-  TPMTRYRETURN(cmd_status);
-
-  TPMTRYRETURN( buffer_free( &out_param_buf ) );
-
-  //===== Send vtpm state to destination ======
-  name_data32.data = (BYTE *)name;
-  name_data32.size = strlen(name) + 1; // Include the null
-  state_data32.data = state_buf.bytes;
-  state_data32.size = buffer_len(&state_buf);
-
-  TPMTRYRETURN( buffer_init( &out_param_buf,
-                             2 * sizeof(UINT32) + name_data32.size + state_data32.size,
-                             NULL ) ) ;
-                             
-  BSG_PackList(out_param_buf.bytes, 2,
-                 BSG_TPM_SIZE32_DATA, &name_data32,
-                 BSG_TPM_SIZE32_DATA, &state_data32);
-
-  TPMTRYRETURN( vtpm_migratord_open(server_addr) );
-
-  TPMTRYRETURN( vtpm_migratord_command(VTPM_MORD_MIG_STEP3,
-                                     &out_param_buf,
-                                     &cmd_status, 
-                                     &empty_buf) ); 
-  vtpm_migratord_close();
-
-  TPMTRYRETURN(cmd_status);
-
-  goto egress;
-
- abort_egress:
- egress:
-
-  buffer_free( &out_param_buf);
-  buffer_free( &state_buf);
-  buffer_free( &empty_buf);
-
-  return status;
-}
-
-
-// Usage vtpm_migrator addr domain_name instance step
-
-int main(int argc, char **argv) {
-
-    /* variables for processing of command */
-    TPM_RESULT status = TPM_FAIL;
-    char *server_addr, *name;
-    UINT32 instance, step;
-
-    if (argc != 5) {
-      vtpmlogerror(VTPM_LOG_VTPM, "Usage: vtpm_migrator addr vm_name instance step\n");
-      vtpmlogerror(VTPM_LOG_VTPM, "       params given %d\n", argc);
-      status= TPM_BAD_PARAMETER;
-      goto abort_egress;
-    }
-
-    server_addr = argv[1];
-    name = argv[2];
-    instance = atoi( argv[3] );
-    step = atoi( argv[4] );    
-
-    switch (step) {
-    case VTPM_MORD_MIG_STEP2:
-      status = handle_vtpm_mig_step2(server_addr, name, instance);
-      break;
- 
-    case VTPM_MORD_MIG_STEP3:
-      status = handle_vtpm_mig_step3(server_addr, name, instance);
-      break;
-
-    default:
-      status = TPM_BAD_PARAMETER;
-      goto abort_egress;
-      break;
-    }
- 
-    goto egress;
- abort_egress:
- egress:
-
-    return status;
-}
-
diff --git a/tools/vtpm_manager/migration/vtpm_migratord.c b/tools/vtpm_manager/migration/vtpm_migratord.c
deleted file mode 100644
index ea18c8c..0000000
--- a/tools/vtpm_manager/migration/vtpm_migratord.c
+++ /dev/null
@@ -1,202 +0,0 @@
-// ===================================================================
-//
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above
-//     copyright notice, this list of conditions and the following
-//     disclaimer in the documentation and/or other materials provided
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <string.h>
-
-#include "tcg.h"
-#include "log.h"
-#include "bsg.h"
-#include "buffer.h"
-#include "vtpm_migrator.h"
-
-void build_error_msg( buffer_t *buf, TPM_RESULT status) {
-  TPM_TAG tag = VTPM_MTAG_RSP;
-  UINT32 out_param_size = VTPM_COMMAND_HEADER_SIZE;
-
-  buffer_init(buf, out_param_size, NULL);
- 
-  BSG_PackList(buf->bytes, 3,
-                 BSG_TPM_TAG, &tag,
-                 BSG_TYPE_UINT32, &out_param_size,
-                 BSG_TPM_RESULT, &status );
-}
-
-int main() {
-
-    /* network variables */
-    int sock_descr, client_sock=-1, len;
-    struct sockaddr_in addr;
-    struct sockaddr_in client_addr;
-    unsigned int client_length;
-    int bytes;
-
-    /* variables for processing of command */
-    TPM_RESULT status = TPM_FAIL;
-    BYTE cmd_header[VTPM_COMMAND_HEADER_SIZE];
-    TPM_TAG tag;
-    TPM_COMMAND_CODE ord;
-    UINT32 in_param_size, adj_param_size;
-    int i, size_read, size_write;
-    buffer_t in_param_buf=NULL_BUF, result_buf=NULL_BUF;
-
-
-    /* setup socket */
-    sock_descr = socket(AF_INET, SOCK_STREAM, 0);
-
-    memset(&addr, 0, sizeof(addr));
-    addr.sin_family = AF_INET;
-    addr.sin_addr.s_addr = htonl(INADDR_ANY);
-    addr.sin_port = htons(VTPM_MIG_PORT);
-
-    if (bind(sock_descr, (struct sockaddr *)&addr, sizeof(addr)) == -1 ) {
-        vtpmlogerror(VTPM_LOG_VTPM, "Failed to bind to port %d.\n", VTPM_MIG_PORT);
-        return 1;
-    }
-        
-    listen(sock_descr, 10);
-
-    for(;;) {
-        // ============ clear client info and wait for connection ==========
-        memset(&client_addr, 0, sizeof(client_addr));
-        client_length = sizeof(client_addr);
-
-        vtpmloginfo(VTPM_LOG_VTPM, "Waiting for incoming migrations...\n");
-        client_sock=accept(sock_descr, &client_addr, &client_length);
-        if (client_sock == -1) {
-            vtpmlogerror(VTPM_LOG_VTPM, "Incoming connectionn failed.\n");
-            goto abort_command;
-        } else {
-            vtpmloginfo(VTPM_LOG_VTPM, "Incoming connection accepted.\n");
-        }
-
-        // =================== Read incoming command ======================
-        size_read = read( client_sock, cmd_header, VTPM_COMMAND_HEADER_SIZE);
-        if (size_read > 0) {
-            vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV: 0x");
-            for (i=0; i<size_read; i++)
-                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
-
-        } else {
-            vtpmlogerror(VTPM_LOG_VTPM, "Error reading from socket.\n");
-            build_error_msg(&result_buf, TPM_IOERROR);
-            goto abort_command_with_error;
-        }
-
-        if (size_read < (int) VTPM_COMMAND_HEADER_SIZE) {
-            vtpmlogerror(VTPM_LOG_VTPM, "Command from socket shorter than std header.\n");
-            build_error_msg(&result_buf, TPM_BAD_PARAMETER);
-            goto abort_command_with_error;
-        }
-
-        // Unpack response from client
-        BSG_UnpackList(cmd_header, 3,
-                       BSG_TPM_TAG, &tag,
-                       BSG_TYPE_UINT32, &in_param_size,
-                       BSG_TPM_COMMAND_CODE, &ord );
-
-
-        // If response has parameters, read them.
-        // Note that out_param_size is in the client's context
-        adj_param_size = in_param_size - VTPM_COMMAND_HEADER_SIZE;
-        if (adj_param_size > 0) {
-            buffer_init( &in_param_buf, adj_param_size, NULL);
-            size_read = read(client_sock, in_param_buf.bytes, adj_param_size);
-            if (size_read > 0) {
-                for (i=0; i< size_read; i++)
-                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param_buf.bytes[i]);
-
-            } else {
-                vtpmlogerror(VTPM_LOG_VTPM, "Error reading from socket.\n");
-                build_error_msg(&result_buf, TPM_IOERROR);
-                goto abort_command_with_error;
-            }
-            vtpmloginfomore(VTPM_LOG_VTPM, "\n");
-
-            if (size_read < (int)adj_param_size) {
-                vtpmloginfomore(VTPM_LOG_VTPM, "\n");
-                vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
-                build_error_msg(&result_buf, TPM_BAD_PARAMETER);
-                goto abort_command_with_error;
-            }
-        } else {
-            vtpmloginfomore(VTPM_LOG_VTPM, "\n");
-        }
-
-        /* Handle Command */
-        switch (ord) {
-        case VTPM_MORD_MIG_STEP2:
-          handle_vtpm_mig_step2(&in_param_buf, &result_buf);
-          break;
- 
-        case VTPM_MORD_MIG_STEP3:
-          handle_vtpm_mig_step3(&in_param_buf, &result_buf);
-          break;
-
-        default:
-            build_error_msg(&result_buf, TPM_BAD_PARAMETER);
-            goto abort_command_with_error;
-        }
-
-  abort_command_with_error:
-        /* Write Response */
-        size_write = write(client_sock, result_buf.bytes, buffer_len(&result_buf));
-
-        if (size_write > 0) {
-            vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT: 0x");
-            for (i=0; i< buffer_len(&result_buf); i++) {
-                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_buf.bytes[i]);
-            }
-            vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-        } else {
-            vtpmlogerror(VTPM_LOG_VTPM, "Error writing response to client.\n");
-            goto abort_command;
-        }
-
-        if (size_write != (int) buffer_len(&result_buf) )
-           vtpmlogerror(VTPM_LOG_VTPM, "Could not send entire response to client(%d/%d)\n", size_write, buffer_len(&result_buf));
-
-  abort_command:
-        close(client_sock);
-        buffer_free(&in_param_buf);
-        buffer_free(&result_buf);
-
-    } // For (;;)
-
-    return 0;
-}
-
diff --git a/tools/vtpm_manager/migration/vtpm_migratord_handler.c b/tools/vtpm_manager/migration/vtpm_migratord_handler.c
deleted file mode 100644
index 0a8a2d5..0000000
--- a/tools/vtpm_manager/migration/vtpm_migratord_handler.c
+++ /dev/null
@@ -1,177 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "tcg.h"
-#include "bsg.h"
-#include "log.h"
-#include "vtpm_migrator.h"
-#include "vtpm_manager.h"
-
-#define VTPM_SH_CMD_HDR  "bash -c \"cd /etc/xen/scripts; source /etc/xen/scripts/vtpm-common.sh;"
-#define VTPM_SH_CMD_FTR  "\""
-#define VTPM_SH_GETINST  "vtpmdb_get_free_instancenum"
-#define VTPM_SH_ADD      "vtpm_add_and_activate"
-#define VTPM_SH_RESUME   "vtpm_resume"
-
-// This must be updated to the longest command name. Currently GETINST
-#define VTPM_SH_CMD_SIZE (strlen(VTPM_SH_CMD_HDR) + strlen(VTPM_SH_CMD_FTR) + 1 + strlen(VTPM_SH_GETINST) + 2)
-
-void handle_vtpm_mig_step2(buffer_t *in_param_buf, buffer_t *result_buf)
-{
-  TPM_TAG tag = VTPM_TAG_RSP;
-  buffer_t out_param_buf= NULL_BUF, mig_key_buf=NULL_BUF; 
-  TPM_RESULT status=TPM_SUCCESS, cmd_status;
-  UINT32 out_param_size;
-  
-  if ( (!in_param_buf) || (!result_buf) ) {
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  // ================= Call manager and get mig key ===============
-  TPMTRYRETURN( vtpm_manager_open() ); 
-  TPMTRYRETURN( vtpm_manager_command(VTPM_ORD_GET_MIG_KEY,
-                                     &out_param_buf, // Empty
-                                     &cmd_status,
-                                     &mig_key_buf) );
-  
-  vtpm_manager_close();
-
-  TPMTRYRETURN(cmd_status);
-
-  // ==================== return the  mig key =====================
-  out_param_size =  VTPM_COMMAND_HEADER_SIZE + buffer_len(&mig_key_buf);
-
-  TPMTRYRETURN( buffer_init(result_buf, 
-                            out_param_size,
-                            NULL) );
-
-  BSG_PackList( result_buf->bytes, 3,
-                  BSG_TPM_TAG, &tag,
-                  BSG_TYPE_UINT32, &out_param_size,
-                  BSG_TPM_RESULT, &status);
-
-  memcpy(result_buf->bytes + VTPM_COMMAND_HEADER_SIZE, 
-         mig_key_buf.bytes, buffer_len(&mig_key_buf));
-
-  goto egress;
-
- abort_egress:
-  buffer_free(result_buf);
-  build_error_msg(result_buf, status);
-
- egress:
-  return;
-}
-
-void handle_vtpm_mig_step3(buffer_t *in_param_buf, buffer_t *result_buf)
-{
-  TPM_TAG tag = VTPM_TAG_RSP;
-  buffer_t out_param_buf= NULL_BUF, mig_key_buf=NULL_BUF, empty_buf=NULL_BUF;
-  TPM_RESULT status=TPM_SUCCESS, cmd_status;
-  UINT32 out_param_size, instance;
-  char *shell_cmd_str=NULL;
-  size_t shell_cmd_strlen;
-  FILE *shell_f=NULL;
-
-  if ( (!in_param_buf) || (!result_buf) ) {
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  // ================= Read Parameters ===============
-  struct pack_buf_t name_data32, state_data32;
-
-  BSG_UnpackList(in_param_buf->bytes, 2,
-                 BSG_TPM_SIZE32_DATA, &name_data32,
-                 BSG_TPM_SIZE32_DATA, &state_data32);
-
-  // Before using this string, protect us from a non-null term array.
-  if (name_data32.data[name_data32.size -1] != 0x00) {
-    name_data32.data[name_data32.size -1] = 0x00;
-  }
-
-  // ====== Call hotplug-script and get an instance ======
-  shell_cmd_strlen = VTPM_SH_CMD_SIZE + name_data32.size + 10;
-  shell_cmd_str = (char *) malloc(shell_cmd_strlen); // 10 is just padding for the UINT32
-
-  snprintf(shell_cmd_str, shell_cmd_strlen,
-	VTPM_SH_CMD_HDR VTPM_SH_GETINST VTPM_SH_CMD_FTR);
-
-  shell_f = popen(shell_cmd_str, "r");
-  fscanf(shell_f, "%d", &instance);
-  pclose(shell_f);
-  
-  // ====== Call hotplug-script and add instance ======
-  snprintf(shell_cmd_str, shell_cmd_strlen,
-	VTPM_SH_CMD_HDR VTPM_SH_ADD " %s %d" VTPM_SH_CMD_FTR,
-	name_data32.data, instance);
-  system(shell_cmd_str);
-
-  // ========= Call vtpm_manager and load VTPM =======
-  TPMTRYRETURN( buffer_init( &out_param_buf, 
-                             2*sizeof(UINT32) + state_data32.size,
-                             NULL) );
-
-  BSG_PackList(out_param_buf.bytes, 2,
-                 BSG_TYPE_UINT32, &instance,
-                 BSG_TPM_SIZE32_DATA, &state_data32);
-
-  TPMTRYRETURN( vtpm_manager_open() ); 
-  TPMTRYRETURN( vtpm_manager_command(VTPM_ORD_MIGRATE_IN,
-                                     &out_param_buf,
-                                     &cmd_status,
-                                     &empty_buf) );
-
-  vtpm_manager_close();
-
-  TPMTRYRETURN(cmd_status);
-
-  // ====== Call hotplug-script and resume instance ======
-  snprintf(shell_cmd_str, shell_cmd_strlen,
-	VTPM_SH_CMD_HDR VTPM_SH_RESUME " %d" VTPM_SH_CMD_FTR, instance);
-  system(shell_cmd_str);
-
-  goto egress;
- abort_egress:
- egress:
-  free(shell_cmd_str);
-
-  // In this case no params come back, so reuse build_error_msg even for succes.
-  build_error_msg(result_buf, status);
-  return;
-}
-
diff --git a/tools/vtpm_manager/tcs/Makefile b/tools/vtpm_manager/tcs/Makefile
deleted file mode 100644
index 11af91e..0000000
--- a/tools/vtpm_manager/tcs/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-XEN_ROOT = $(CURDIR)/../../..
-include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
-
-BIN		= libTCS.a
-
-.PHONY: all
-all: build
-
-.PHONY: build
-build: $(BIN)
-
-.PHONY: install
-install: build
-
-.PHONY: clean
-clean:
-	rm -f *.a *.so *.o *.rpm $(DEP_FILES)
-
-.PHONY: mrproper
-mrproper: clean
-	rm -f *~
-
-$(BIN): $(OBJS)
-	$(AR) rcs $(BIN) $(OBJS)
diff --git a/tools/vtpm_manager/tcs/contextmgr.c b/tools/vtpm_manager/tcs/contextmgr.c
deleted file mode 100644
index cf3803c..0000000
--- a/tools/vtpm_manager/tcs/contextmgr.c
+++ /dev/null
@@ -1,224 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// contextmgr.c
-// 
-//  This file contains the context management functions for TCS.
-// 
-// ==================================================================
-
-#include <stdio.h>
-#include <string.h>
-#include <malloc.h>
-#include "tcs.h"
-#include "contextmgr.h"
-#include "log.h"
-#include "hashtable.h"
-
-BYTE* AddMemBlock(CONTEXT_HANDLE* pContextHandle, // in
-		  int    BlockSize)  { // in
-  
-  BLOCK* pCurrentBlock = NULL;
-  BLOCK* pBlock = NULL;
-                    
-  // check incoming params
-  if (pContextHandle == NULL || BlockSize == 0)
-    return NULL;
-
-  // Create New Block
-  pBlock = (BLOCK *)malloc(sizeof(BLOCK));
-  if (pBlock == NULL)
-    return (0);
-
-  pBlock->aMemory = (BYTE *)malloc(sizeof(BYTE) * BlockSize);
-  if (pBlock->aMemory == NULL)
-    return (0);
-
-  memset(pBlock->aMemory, 0, BlockSize);
-  pBlock->nBlockSize = BlockSize;
-  pBlock->pNextBlock = NULL;
-  
-  // search for the last block created where to add the 
-  // newly created block
-  if(pContextHandle->pTopBlock != NULL) {
-    pCurrentBlock = pContextHandle->pTopBlock;
-    while(pCurrentBlock->pNextBlock != NULL)
-      pCurrentBlock = pCurrentBlock->pNextBlock;
-    
-    
-    pCurrentBlock->pNextBlock= pBlock;
-  } else
-    pContextHandle->pTopBlock = pBlock;
-  
-  
-  pContextHandle->nBlockCount++;
-  
-  return pBlock->aMemory;
-}
-
-
-BOOL DeleteMemBlock(CONTEXT_HANDLE* pContextHandle, // in
-                    BYTE*   pTCPA_BYTEs) { // in
-  BLOCK* pCurrentBlock = NULL;
-  BLOCK* pParentBlock = NULL;
-  BOOL bFound = FALSE;
-  
-  if (pContextHandle == NULL) 
-    return FALSE;
-
-  
-  // Search for the Block in the context by aMemory pointer
-  pParentBlock = NULL;
-  pCurrentBlock = pContextHandle->pTopBlock;
-  
-  while(pCurrentBlock != NULL) {
-    // If aMemory block is found, delete it 
-    if(pCurrentBlock->aMemory == pTCPA_BYTEs || pTCPA_BYTEs == NULL) {
-      // if it is the top Block, remove it from the top, 
-      // otherwise remove it from the ParentBlock and stitch 
-      // the NextBlock to the ParentBlock
-      if(pParentBlock == NULL)
-	pContextHandle->pTopBlock = pContextHandle->pTopBlock->pNextBlock;
-      else
-	pParentBlock->pNextBlock = pCurrentBlock->pNextBlock;
-      
-      // delete memory Block associated with pointer pTCPA_BYTEs
-      free(pCurrentBlock->aMemory);
-      pCurrentBlock->aMemory = NULL;
-      
-      free(pCurrentBlock);
-      pCurrentBlock = pParentBlock;
-      
-      pContextHandle->nBlockCount--;
-      bFound = TRUE;
-    }
-  
-    if(pCurrentBlock != NULL) {
-      pParentBlock = pCurrentBlock;
-      pCurrentBlock = pCurrentBlock->pNextBlock;
-    }
-  }
-  
-  return bFound;
-}
-
-BOOL AddHandleToList(TCS_CONTEXT_HANDLE hContext, // in
-		     TPM_RESOURCE_TYPE type, // in
-		     TPM_HANDLE    handle)  { // in
-  HANDLE_LIST* pNewHandle = NULL;
-
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Adding Handle to list\n");
-  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
-
-  if (pContextHandle == NULL)
-    return 0;
-  
-  pNewHandle = (HANDLE_LIST *)malloc(sizeof(HANDLE_LIST));
-  
-  if (pNewHandle == NULL) 
-    return (0);
-  
-  pNewHandle->handle = handle;
-  pNewHandle->type = type;
-  pNewHandle->pNextHandle = pContextHandle->pHandleList;
-  
-  pContextHandle->pHandleList = pNewHandle;
-  
-  return 1;
-}
-
-BOOL DeleteHandleFromList(   TCS_CONTEXT_HANDLE hContext, // in		     
-                             TPM_HANDLE          handle) { // in
-    
-  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
-
-  HANDLE_LIST *pCurrentHandle = pContextHandle->pHandleList, 
-              *pLastHandle = pCurrentHandle;
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Deleting Handle from list\n");
-  
-  if (pContextHandle == NULL)
-    return 0;
-  
-  while (1) {
-    
-    if (pCurrentHandle->handle == handle) { // Found element
-      if (pCurrentHandle == pLastHandle) { // First element in list 
-	pContextHandle->pHandleList = pCurrentHandle->pNextHandle;
-	free(pCurrentHandle);
-      } else { // Ordinary element
-	pLastHandle->pNextHandle = pCurrentHandle->pNextHandle;
-	free(pCurrentHandle);
-      }
-      
-      return 1;
-      
-    } else { // Not found yet;
-      pLastHandle = pCurrentHandle;
-      pCurrentHandle = pCurrentHandle->pNextHandle;
-      if (pCurrentHandle == NULL) // Found end of list
-	return 0;
-    }
-    
-  }
-}
-
-BOOL FreeHandleList(    CONTEXT_HANDLE*     pContextHandle) { // in
-  HANDLE_LIST* pCurrentHandle;
-  BOOL returncode = TRUE;
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Freeing all handles for context\n");
-  
-  if (pContextHandle == NULL)
-    return 1;
-  
-  pCurrentHandle = pContextHandle->pHandleList;
-  while (pCurrentHandle != NULL) {
-    
-    switch (pCurrentHandle->type) {
-    case TPM_RT_KEY:
-      returncode = returncode && !TCSP_EvictKey(pContextHandle->handle, pCurrentHandle->handle);
-      break;
-    case TPM_RT_AUTH:
-      returncode = returncode && !TCSP_TerminateHandle(pContextHandle->handle, pCurrentHandle->handle);
-      break;
-    default:
-      returncode = FALSE;
-    }
-    
-    pCurrentHandle = pCurrentHandle->pNextHandle;
-    
-  }
-  
-  return 1;
-}
diff --git a/tools/vtpm_manager/tcs/contextmgr.h b/tools/vtpm_manager/tcs/contextmgr.h
deleted file mode 100644
index e3fdf0f..0000000
--- a/tools/vtpm_manager/tcs/contextmgr.h
+++ /dev/null
@@ -1,82 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// contextmgr.c
-// 
-//  This file contains the context management functions for TCS.
-// 
-// ==================================================================
-
-#ifndef __CONTEXTMGR_H__
-#define __CONTEXTMGR_H__
-
-#include "tcg.h"
-
-#define BLOCK_SIZE 300
-
-typedef struct block {
-  int nBlockSize;
-  BYTE* aMemory;
-  struct block* pNextBlock;
-} BLOCK;
-
-typedef struct handle_List {
-  TPM_HANDLE handle;
-  TPM_RESOURCE_TYPE type;
-  struct handle_List* pNextHandle;
-} HANDLE_LIST;
-
-typedef struct context_handle {
-  TCS_CONTEXT_HANDLE handle;
-  int nBlockCount;
-  BLOCK* pTopBlock;
-  HANDLE_LIST* pHandleList;
-} CONTEXT_HANDLE;
-
-BYTE* AddMemBlock(  CONTEXT_HANDLE*     pContextHandle, // in
-                    int                 BlockSize);  // in
-
-BOOL DeleteMemBlock(CONTEXT_HANDLE* pContextHandle, // in
-                    BYTE*           pTCPA_BYTEs); // in
-
-
-BOOL AddHandleToList(   TCS_CONTEXT_HANDLE hContext, // in	
-                        TPM_RESOURCE_TYPE   type, // in
-                        TPM_HANDLE          handle); // in
-
-BOOL DeleteHandleFromList(   TCS_CONTEXT_HANDLE hContext, // in	
-                             TPM_HANDLE          handle); // in
-
-BOOL FreeHandleList(    CONTEXT_HANDLE*     pContextHandle); // in
-
-#endif //_CONTEXTMGR_H_
diff --git a/tools/vtpm_manager/tcs/tcs.c b/tools/vtpm_manager/tcs/tcs.c
deleted file mode 100644
index 7c1378c..0000000
--- a/tools/vtpm_manager/tcs/tcs.c
+++ /dev/null
@@ -1,1192 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// tcs.c
-// 
-//  This file contains the functions that implement a TCS.
-// 
-// ==================================================================
-
-#include <stdio.h>
-#include <string.h>
-#include <malloc.h>
-
-#include "tcg.h"
-#include "bsg.h"
-#include "tcs.h"
-#include "contextmgr.h"
-#include "tpmddl.h"
-#include "log.h"
-#include "hashtable.h"
-#include "hashtable_itr.h"
-
-// Static Global Vars for the TCS
-static int TCS_m_nCount = 0;
-
-#define TCPA_MAX_BUFFER_LENGTH 0x2000
-
-static BYTE InBuf [TCPA_MAX_BUFFER_LENGTH];
-static BYTE OutBuf[TCPA_MAX_BUFFER_LENGTH];
-
-struct hashtable *context_ht;
-
-// -------------------------- Hash table functions --------------------
-
-static unsigned int hashfunc32(void *ky) {
-  return (* (UINT32 *) ky);
-}
-
-static int equals32(void *k1, void *k2) {
-  return (*(UINT32 *) k1 == *(UINT32 *) k2);
-}
-
-CONTEXT_HANDLE *LookupContext( TCS_CONTEXT_HANDLE  hContext) {
-  return( (CONTEXT_HANDLE *) hashtable_search(context_ht, &hContext) );
-}
-
-// ---------------------------------------------------------------------------------
-// Initialization/Uninitialization SubComponent API
-// ---------------------------------------------------------------------------------
-TPM_RESULT TCS_create() {
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TPM_RESULT result = TPM_FAIL;
-  
-  if (TCS_m_nCount == 0) {
-    vtpmloginfo(VTPM_LOG_TCS, "Constructing new TCS:\n");
-    hRes = TDDL_Open();
-
-    context_ht = create_hashtable(10, hashfunc32, equals32);
-	  
-    if ((hRes == TDDL_SUCCESS) && (context_ht != NULL)) {
-      result = TPM_SUCCESS;
-      TCS_m_nCount++;
-    } else {
-      result = TPM_IOERROR;
-      hashtable_destroy(context_ht, 1);
-    }
-  } else
-    TCS_m_nCount++;
-    
-  return(result);
-}
-
-
-void TCS_destroy()
-{
-  TCS_m_nCount--;
-  
-  if (TCS_m_nCount == 0) {
-    vtpmloginfo(VTPM_LOG_TCS, "Destructing TCS:\n");
-    TDDL_Close();
-
-    struct hashtable_itr *context_itr;
-    TCS_CONTEXT_HANDLE  *hContext;
-    
-    // Close all the TCS contexts. TCS should evict keys based on this
-    if (hashtable_count(context_ht) > 0) {
-      context_itr = hashtable_iterator(context_ht);
-      do {
-        hContext = (TCS_CONTEXT_HANDLE *) hashtable_iterator_key(context_itr);
-	if (TCS_CloseContext(*hContext) != TPM_SUCCESS) 
-	    vtpmlogerror(VTPM_LOG_TCS, "Failed to close context %d properly.\n", *hContext);
-      
-      } while (hashtable_iterator_advance(context_itr));
-      free(context_itr);
-    }
-    hashtable_destroy(context_ht, 1);
-  }
-  
-}
-
-TPM_RESULT TCS_Malloc(  TCS_CONTEXT_HANDLE  hContext, // in
-                        UINT32              MemSize, // in
-                        BYTE**              ppMemPtr) {// out
-
-  TPM_RESULT returnCode = TPM_FAIL;
-  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
-  
-  if (pContextHandle != NULL && ppMemPtr != NULL) {
-    *ppMemPtr = (BYTE *)AddMemBlock(pContextHandle, MemSize);
-    returnCode = TPM_SUCCESS;
-  }
-  
-  return returnCode;
-}
-
-TPM_RESULT TCS_FreeMemory(  TCS_CONTEXT_HANDLE  hContext, // in
-                            BYTE*               pMemory) { // in
-  TPM_RESULT returnCode = TPM_FAIL;
-  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
-  
-  if ( (pContextHandle != NULL && pMemory != NULL) &&
-       (DeleteMemBlock(pContextHandle, pMemory) == TRUE) )
-    returnCode = TPM_SUCCESS;
- 
-  
-  return returnCode;
-}
-
-TPM_RESULT TCS_OpenContext(TCS_CONTEXT_HANDLE* hContext) { // out
-  TPM_RESULT returnCode = TPM_FAIL;
-  TCS_CONTEXT_HANDLE *newContext;
-  
-  vtpmloginfo(VTPM_LOG_TCS, "Calling TCS_OpenContext:\n");
-  
-  if (hContext) {
-    CONTEXT_HANDLE* pContextHandle = (CONTEXT_HANDLE *) malloc(sizeof(CONTEXT_HANDLE));
-    if (pContextHandle == NULL) 
-      return TPM_SIZE;
-    
-    // initialize to 0
-    pContextHandle->nBlockCount = 0;
-    pContextHandle->pTopBlock = NULL;
-    pContextHandle->pHandleList = NULL;
-    
-    // Create New Block
-    AddMemBlock(pContextHandle, BLOCK_SIZE);
-    
-    newContext = (TCS_CONTEXT_HANDLE *) malloc(sizeof(TCS_CONTEXT_HANDLE));
-    *newContext = (TCS_CONTEXT_HANDLE) (((uintptr_t) pContextHandle >> 2) & 0xffffffff);
-    
-    if (hashtable_search(context_ht, &newContext) !=NULL)
-    	*newContext += 1;
-    
-    pContextHandle->handle = *newContext;
-    if (!hashtable_insert(context_ht, newContext, pContextHandle)) {
-        free(newContext);
-        free(pContextHandle);
-    	returnCode = TPM_FAIL;
-    } else {
-    	*hContext = *newContext;
-    	returnCode = TPM_SUCCESS;
-    }
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCS_CloseContext(TCS_CONTEXT_HANDLE hContext) {// in
-  //FIXME: TCS SHOULD Track failed auths and make sure
-  //we don't try and re-free them here.
-  TPM_RESULT returnCode = TPM_FAIL;
-  
-  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
-  
-  if(pContextHandle != NULL) {
-    // Print test info
-    vtpmloginfo(VTPM_LOG_TCS, "Calling TCS_CloseContext.\n");
-      
-    // free memory for all the blocks
-    DeleteMemBlock(pContextHandle, NULL );      
-    pContextHandle->pTopBlock = NULL;
-    
-    FreeHandleList(pContextHandle);
-    if (pContextHandle->pHandleList != NULL) 
-      vtpmlogerror(VTPM_LOG_TCS, "Not all handles evicted from TPM.\n");
-    
-    // Release the TPM's resources
-    if (hashtable_remove(context_ht, &hContext) == NULL) 
-      vtpmlogerror(VTPM_LOG_TCS, "Not all handles evicted from TPM.\n");
-    
-    free(pContextHandle);
-    returnCode = TPM_SUCCESS;
-  }
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Finished closing context\n");
-  return(returnCode);
-}
-
-// ------------------------------------------------------------------
-// Internal Functions
-// ------------------------------------------------------------------
-int packAuth(BYTE* dst, TCS_AUTH* auth) {
-  // CHECK: according to the command specs, the outgoing auth params are:
-  // nonceEven
-  // nonceOdd
-  // continueAuthSession
-  // auth digest for return params
-  //
-  // this is a bit different than this code...
-  
-  return BSG_PackList(dst, 4, 
-		      BSG_TYPE_UINT32, &(auth->AuthHandle), 
-		      BSG_TPM_NONCE, &(auth->NonceOdd), 
-		      BSG_TYPE_BOOL, &(auth->fContinueAuthSession), 
-		      BSG_TPM_AUTHDATA, &(auth->HMAC));
-}
-
-int unpackAuth(TCS_AUTH* auth, BYTE* src) {
-  return BSG_UnpackList(src, 3, 
-			BSG_TPM_NONCE, &(auth->NonceEven), 
-			BSG_TYPE_BOOL, &(auth->fContinueAuthSession), 
-			BSG_TPM_AUTHDATA, &(auth->HMAC));
-}
-
-// ------------------------------------------------------------------
-// Authorization Commands
-// ------------------------------------------------------------------
-
-TPM_RESULT TCSP_OIAP(TCS_CONTEXT_HANDLE hContext, // in
-		     TCS_AUTHHANDLE*  authHandle, // out 
-		     TPM_NONCE*   nonce0)  // out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_OIAP;
-  UINT32 paramSize = 0;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (authHandle == NULL || nonce0 == NULL) 
-    return TPM_BAD_PARAMETER;
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 3, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal);
-    
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) 
-      == TDDL_SUCCESS) {
-    
-    // unpack to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList( OutBuf, 3, 
-			    BSG_TPM_TAG, &tag, 
-			    BSG_TYPE_UINT32, &paramSize, 
-			    BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
-      // Extract the remaining output parameters
-      BSG_UnpackList(OutBuf+i, 2, 
-		     BSG_TYPE_UINT32, authHandle, 
-		     BSG_TPM_NONCE, nonce0);
-      
-      if (!AddHandleToList(hContext, TPM_RT_AUTH, *authHandle)) 
-        vtpmlogerror(VTPM_LOG_TCS, "New AuthHandle not recorded\n");
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "Failed with return code %s\n", tpm_get_error_name(returnCode));
-    
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCSP_OSAP(TCS_CONTEXT_HANDLE hContext,  // in
-		     TPM_ENTITY_TYPE  entityType,  // in
-		     UINT32    entityValue, // in
-		     TPM_NONCE   nonceOddOSAP, // in
-		     TCS_AUTHHANDLE*  authHandle,  // out 
-		     TPM_NONCE*   nonceEven,  // out
-		     TPM_NONCE*   nonceEvenOSAP) // out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_OSAP;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (authHandle == NULL || nonceEven == NULL || nonceEvenOSAP == NULL)
-    return TPM_BAD_PARAMETER;
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 6, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT16, &entityType, 
-			  BSG_TYPE_UINT32, &entityValue, 
-			  BSG_TPM_NONCE, &nonceOddOSAP);
-  
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) 
-            == TDDL_SUCCESS) {
-
-    // unpack to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
-      // Extract the remaining output parameters
-      BSG_UnpackList(OutBuf+i, 3, 
-		     BSG_TYPE_UINT32, authHandle, 
-		     BSG_TPM_NONCE, nonceEven, 
-		     BSG_TPM_NONCE, nonceEvenOSAP);
-      
-      if (!AddHandleToList(hContext, TPM_RT_AUTH, *authHandle)) {
-	    vtpmlogerror(VTPM_LOG_TCS, "New AuthHandle not recorded\n");
-      }
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "Failed with return code %s\n", tpm_get_error_name(returnCode));
-    
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCSP_TakeOwnership(TCS_CONTEXT_HANDLE hContext,   // in
-			      UINT16    protocolID,   // in
-			      UINT32    encOwnerAuthSize, // in 
-			      BYTE*    encOwnerAuth,  // in
-			      UINT32    encSrkAuthSize,  // in
-			      BYTE*    encSrkAuth,   // in
-			      UINT32*    SrkSize,   // in, out
-			      BYTE**    Srk,    // in, out
-			      TCS_AUTH*   ownerAuth)   // in, out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_TakeOwnership;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (encOwnerAuth == NULL || encSrkAuth == NULL || SrkSize == NULL || *Srk == NULL) 
-    return TPM_BAD_PARAMETER;
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 5, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT16, &protocolID, 
-			  BSG_TYPE_UINT32, &encOwnerAuthSize);
-  
-  memcpy(InBuf+InLength, encOwnerAuth, encOwnerAuthSize);
-  InLength += encOwnerAuthSize;
-  InLength += BSG_Pack(   BSG_TYPE_UINT32, 
-			  &encSrkAuthSize, 
-			  InBuf+InLength);
-  memcpy(InBuf+InLength, encSrkAuth, encSrkAuthSize);
-  InLength += encSrkAuthSize;
-  memcpy(InBuf+InLength, *Srk, *SrkSize);
-  InLength += *SrkSize;
-  InLength += packAuth(InBuf+InLength, ownerAuth);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, 
-	   &InLength, 
-	   InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) 
-              == TDDL_SUCCESS){
-    
-    // unpack to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList( OutBuf, 3, 
-			    BSG_TPM_TAG, &tag, 
-			    BSG_TYPE_UINT32, &paramSize, 
-			    BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
-      // Extract the remaining output parameters
-      TPM_KEY srkPub;
-      i += BSG_Unpack(BSG_TPM_KEY,  OutBuf+i,  &srkPub); 
-      unpackAuth(ownerAuth, OutBuf+i);
-      
-      // fill output params
-      BYTE tempBuf[1024];
-      *SrkSize = BSG_Pack(BSG_TPM_KEY,  &srkPub, tempBuf);
-      if (TCS_Malloc(hContext, *SrkSize, Srk) == TPM_FAIL) {
-	return(TPM_SIZE);
-      }
-      memcpy(*Srk, tempBuf, *SrkSize);
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d", paramSize);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_TakeOwnership Failed with return code %s\n", tpm_get_error_name(returnCode));
-  }
-  
-  return(returnCode);
-}
-
-
-TPM_RESULT TCSP_DisablePubekRead (  TCS_CONTEXT_HANDLE hContext, // in
-                                    TCS_AUTH*   ownerAuth) { // in, out
- 
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_DisablePubekRead;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
-    
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 3, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal);
-  
-  InLength += packAuth(InBuf+InLength, ownerAuth);
- 
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) 
-              == TDDL_SUCCESS){
-    
-    // unpack to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList( OutBuf, 3, 
-			    BSG_TPM_TAG, &tag, 
-			    BSG_TYPE_UINT32, &paramSize, 
-			    BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
-      // Extract the remaining output parameters
-      unpackAuth(ownerAuth, OutBuf+i);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_DisablePubekRead Failed with return code %s\n", tpm_get_error_name(returnCode));
-  }
-  
-  return(returnCode);
-}
-
-
-TPM_RESULT TCSP_TerminateHandle(TCS_CONTEXT_HANDLE hContext, // in
-                                TCS_AUTHHANDLE  handle)  // in
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_Terminate_Handle;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 4, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT32, &handle);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) 
-              == TDDL_SUCCESS) {
-    
-    // unpack to get the tag, paramSize, & returnCode
-    BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (!DeleteHandleFromList(hContext, handle)) 
-      vtpmlogerror(VTPM_LOG_TCS, "KeyHandle not removed from list\n");
-       
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
-      // Print debug info
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d", paramSize);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_TerminateHandle Failed with return code %s\n", tpm_get_error_name(returnCode));
-    
-  }
-  
-  return(returnCode);
-}
-
-// TPM Mandatory
-TPM_RESULT TCSP_Extend( TCS_CONTEXT_HANDLE hContext, // in
-                        TPM_PCRINDEX  pcrNum,  // in
-                        TPM_DIGEST  inDigest, // in
-                        TPM_PCRVALUE*  outDigest) // out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_Extend;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 5, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT32, &pcrNum, 
-			  BSG_TPM_DIGEST, &inDigest);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) 
-              == TDDL_SUCCESS) {
-    
-    // unpack to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND){
-      // Extract the remaining output parameters
-      BSG_Unpack(BSG_TPM_PCRVALUE, OutBuf+i, outDigest);
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Extend Failed with return code %s\n", tpm_get_error_name(returnCode));
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCSP_Seal(   TCS_CONTEXT_HANDLE hContext,  // in
-                        TCS_KEY_HANDLE  keyHandle,  // in
-                        TPM_ENCAUTH   encAuth,  // in
-                        UINT32    pcrInfoSize, // in
-                        BYTE*    PcrInfo,  // in
-                        UINT32    inDataSize,  // in
-                        BYTE*    inData,   // in
-                        TCS_AUTH*   pubAuth,  // in, out
-                        UINT32*    SealedDataSize, // out
-                        BYTE**    SealedData)  // out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_Seal;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (inData == NULL || pubAuth == NULL || SealedDataSize == NULL || SealedData == NULL)
-    return TPM_BAD_PARAMETER;
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 6, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT32, &keyHandle, 
-			  BSG_TPM_ENCAUTH, encAuth, 
-			  BSG_TYPE_UINT32, &pcrInfoSize);
-  memcpy(InBuf+InLength, PcrInfo, pcrInfoSize);
-  InLength += pcrInfoSize;
-  InLength += BSG_Pack(BSG_TYPE_UINT32, &inDataSize, InBuf+InLength);
-  memcpy(InBuf+InLength, inData, inDataSize);
-  InLength += inDataSize;
-  InLength += packAuth(InBuf+InLength, pubAuth);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-    
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) 
-              == TDDL_SUCCESS) {
-    // unpack OutBuf to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
-      // Extract the remaining output parameters
-      TPM_STORED_DATA sealedData;
-      
-      i += BSG_Unpack(BSG_TPM_STORED_DATA, OutBuf+i, &sealedData); 
-      unpackAuth(pubAuth, OutBuf+i);
-      
-      // fill SealedData
-      BYTE tempBuf[1024];
-      *SealedDataSize = BSG_Pack(BSG_TPM_STORED_DATA, &sealedData, tempBuf);
-      if (TCS_Malloc(hContext, *SealedDataSize, SealedData) == TPM_FAIL) {
-	return TPM_SIZE;
-      }
-      memcpy(*SealedData, tempBuf, *SealedDataSize);
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Seal Failed with return code %s\n", tpm_get_error_name(returnCode));
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCSP_Unseal(TCS_CONTEXT_HANDLE hContext,  // in
-		       TCS_KEY_HANDLE  parentHandle, // in
-		       UINT32    SealedDataSize, // in
-		       BYTE*    SealedData,  // in
-		       TCS_AUTH*   parentAuth,  // in, out
-		       TCS_AUTH*   dataAuth,  // in, out
-		       UINT32*   DataSize,  // out
-		       BYTE**    Data)   // out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_AUTH2_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_Unseal;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (SealedData == NULL || parentAuth == NULL || dataAuth == NULL || 
-      DataSize == NULL || Data == NULL) 
-    return TPM_BAD_PARAMETER;
-  
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 4, 
-			              BSG_TPM_TAG, &tag, 
-                          BSG_TYPE_UINT32, &paramSize, 
-                          BSG_TPM_COMMAND_CODE, &ordinal, 
-                          BSG_TYPE_UINT32, &parentHandle);
-  memcpy(InBuf+InLength, SealedData, SealedDataSize);
-  InLength += SealedDataSize;
-  InLength += packAuth(InBuf+InLength, parentAuth);
-  InLength += packAuth(InBuf+InLength, dataAuth);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-    
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
-    // unpack OutBuf to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList( OutBuf, 3, 
-                            BSG_TPM_TAG, &tag, 
-                            BSG_TYPE_UINT32, &paramSize, 
-                            BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH2_COMMAND) {
-      // Extract the remaining output parameters
-      i += BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, DataSize);
-      if (TCS_Malloc(hContext, *DataSize, Data) == TPM_FAIL) {
-        return TPM_SIZE;
-      }
-      memcpy(*Data, OutBuf+i, *DataSize);
-      i += *DataSize;
-      i += unpackAuth(parentAuth, OutBuf+i);
-      unpackAuth(dataAuth, OutBuf+i);
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Unseal Failed with return code %s\n", tpm_get_error_name(returnCode));
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCSP_UnBind(TCS_CONTEXT_HANDLE hContext,  // in
-		       TCS_KEY_HANDLE  keyHandle,  // in
-		       UINT32    inDataSize,  // in
-		       BYTE*    inData,   // in
-		       TCS_AUTH*   privAuth,  // in, out
-		       UINT32*   outDataSize, // out
-		       BYTE**    outData)  // out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_UnBind;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (inData == NULL || privAuth == NULL || outDataSize == NULL || outData == NULL)
-    return TPM_BAD_PARAMETER;
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 5, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT32, &keyHandle, 
-			  BSG_TYPE_UINT32, &inDataSize);
-  memcpy(InBuf+InLength, inData, inDataSize);
-  InLength += inDataSize;
-  InLength += packAuth(InBuf+InLength, privAuth);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "\n\tSending paramSize = %d", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
-    // unpack OutBuf to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
-      // Extract the remaining output parameters
-      i += BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, outDataSize);
-      if (TCS_Malloc(hContext, *outDataSize, outData) == TPM_FAIL)
-        return TPM_SIZE;
-    
-      memcpy(*outData, OutBuf+i, *outDataSize);
-      i += *outDataSize;
-      unpackAuth(privAuth, OutBuf+i);
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_UnBind Failed with return code %s\n", tpm_get_error_name(returnCode));
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCSP_CreateWrapKey(TCS_CONTEXT_HANDLE hContext,   // in
-			      TCS_KEY_HANDLE  hWrappingKey,  // in
-			      TPM_ENCAUTH  KeyUsageAuth,  // in
-			      TPM_ENCAUTH  KeyMigrationAuth, // in
-			      UINT32*    pcKeySize,   // in, out
-			      BYTE**    prgbKey,   // in, out
-			      TCS_AUTH*   pAuth)    // in, out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_CreateWrapKey;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (pcKeySize == NULL || *prgbKey == NULL || pAuth == NULL)
-    return TPM_BAD_PARAMETER;
-  
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 6, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT32, &hWrappingKey, 
-			  BSG_TPM_ENCAUTH, KeyUsageAuth, 
-			  BSG_TPM_ENCAUTH, KeyMigrationAuth); 
-  memcpy(InBuf+InLength, *prgbKey, *pcKeySize);
-  InLength += *pcKeySize;
-  InLength += packAuth(InBuf+InLength, pAuth);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
-    // unpack OutBuf to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_RESULT, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
-      // Extract the remaining output parameters
-      TPM_KEY wrappedKey;
-      
-      i += BSG_Unpack(BSG_TPM_KEY, OutBuf+i, &wrappedKey);
-      unpackAuth(pAuth, OutBuf+i);
-      
-      // Fill prgbKey
-      BYTE tempBuf[1024];
-      *pcKeySize = BSG_Pack(BSG_TPM_KEY, &wrappedKey, tempBuf);
-      if (TCS_Malloc(hContext, *pcKeySize, prgbKey) == TPM_FAIL) 
-        return TPM_SIZE;
-      
-      memcpy(*prgbKey, tempBuf, *pcKeySize);
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_CreateWrapKey Failed with return code %s\n", tpm_get_error_name(returnCode)); 
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCSP_LoadKeyByBlob(TCS_CONTEXT_HANDLE hContext,    // in
-			      TCS_KEY_HANDLE  hUnwrappingKey,   // in
-			      UINT32    cWrappedKeyBlobSize, // in
-			      BYTE*    rgbWrappedKeyBlob,  // in
-			      TCS_AUTH*   pAuth,     // in, out
-			      TCS_KEY_HANDLE*  phKeyTCSI,    // out
-			      TCS_KEY_HANDLE*  phKeyHMAC)    // out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_LoadKey;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (rgbWrappedKeyBlob == NULL || pAuth == NULL || phKeyTCSI == NULL || phKeyHMAC == NULL) 
-    return TPM_BAD_PARAMETER; 
-  
-  *phKeyHMAC = hUnwrappingKey; // the parent key is the one that the TPM use to make the HMAC calc
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 4, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT32, &hUnwrappingKey);
-  memcpy(InBuf+InLength, rgbWrappedKeyBlob, cWrappedKeyBlobSize);
-  InLength += cWrappedKeyBlobSize;
-  InLength += packAuth(InBuf+InLength, pAuth);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
-    // unpack OutBuf to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
-      // Extract the remaining output parameters
-      i += BSG_Unpack(BSG_TYPE_UINT32, 
-		      OutBuf+i, 
-		      phKeyTCSI);
-      unpackAuth(pAuth, OutBuf+i);
-      
-      if (!AddHandleToList(hContext, TPM_RT_KEY, *phKeyTCSI)) {
-        vtpmlogerror(VTPM_LOG_TCS, "New KeyHandle not recorded\n");
-      }
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-     } else 
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_LoadKeyByBlob Failed with return code %s\n", tpm_get_error_name(returnCode));
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCSP_EvictKey(TCS_CONTEXT_HANDLE hContext, // in
-			 TCS_KEY_HANDLE  hKey)  // in
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_EvictKey;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 4, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT32, &hKey);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
-    // unpack OutBuf to get the tag, paramSize, & returnCode
-    BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (!DeleteHandleFromList(hContext, hKey)) {
-      vtpmlogerror(VTPM_LOG_TCS, "KeyHandle not removed from list\n");
-    }	 
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else {
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_EvictKey Failed with return code %s\n", tpm_get_error_name(returnCode));
-    }
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCSP_GetRandom(TCS_CONTEXT_HANDLE hContext,  // in
-			  UINT32*    bytesRequested, // in, out
-			  BYTE**    randomBytes) // out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_GetRandom;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (bytesRequested == NULL || *randomBytes == NULL){
-    return TPM_BAD_PARAMETER;
-  }
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 4, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT32, bytesRequested);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
-    // unpack OutBuf to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
-      // Extract the remaining output parameters
-      BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, bytesRequested);
-      if (TCS_Malloc(hContext, *bytesRequested, randomBytes) == TPM_FAIL) {
-        return TPM_SIZE;
-      }
-      memcpy(*randomBytes, OutBuf+i+sizeof(UINT32), *bytesRequested);
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else {
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_GetRandom Failed with return code %s\n", tpm_get_error_name(returnCode));
-    }
-  }
-  
-  return(returnCode);
-}
-
-
-TPM_RESULT TCSP_ReadPubek(TCS_CONTEXT_HANDLE   hContext,               // in
-			  TPM_NONCE            antiReplay,             // in
-			  UINT32*              pubEndorsementKeySize,  // out
-			  BYTE**               pubEndorsementKey,      // out
-			  TPM_DIGEST*          checksum)               // out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_ReadPubek;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32   OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (pubEndorsementKeySize == NULL || pubEndorsementKey == NULL || checksum == NULL) {
-    return TPM_BAD_PARAMETER;
-  }
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 4, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TPM_NONCE, &antiReplay);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
-    // unpack OutBuf to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
-      // Extract the remaining output parameters
-      TPM_PUBKEY pubEK;
-      i += BSG_UnpackList(OutBuf+i, 2, 
-			  BSG_TPM_PUBKEY, &pubEK, 
-			  BSG_TPM_DIGEST, checksum);
-      
-      // fill EndorsementKey
-      BYTE tempBuf[1024];
-      *pubEndorsementKeySize = BSG_Pack(BSG_TPM_PUBKEY, &pubEK, tempBuf);
-      if (TCS_Malloc(hContext, *pubEndorsementKeySize, pubEndorsementKey) == TPM_FAIL) {
-        return TPM_SIZE;
-      }
-      memcpy(*pubEndorsementKey, tempBuf, *pubEndorsementKeySize);
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else {
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_ReadPubek Failed with return code %s\n", tpm_get_error_name(returnCode));
-    }
-  }
-  
-  return(returnCode);
-}
-
-
-TPM_RESULT TCSP_SaveState(TCS_CONTEXT_HANDLE   hContext)  // in
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_SaveState;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 3,
-                          BSG_TPM_TAG, &tag,
-                          BSG_TYPE_UINT32, &paramSize,
-                          BSG_TPM_COMMAND_CODE, &ordinal);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
-    // unpack OutBuf to get the tag, paramSize, & returnCode
-    BSG_UnpackList(OutBuf, 3,
-                           BSG_TPM_TAG, &tag,
-                           BSG_TYPE_UINT32, &paramSize,
-                           BSG_TPM_COMMAND_CODE, &returnCode);
-
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else {
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_SaveState Failed with return code %s\n", tpm_get_error_name(returnCode));
-    }
-  }
-
-  return(returnCode);
-}
-
-
-TPM_RESULT TCSP_RawTransmitData(   UINT32 inDataSize,  // in
-				   BYTE *inData,       // in
-				   UINT32 *outDataSize,// in/out
-				   BYTE *outData) {    // out     
-  
-  TDDL_RESULT hRes;
-  
-  vtpmloginfo(VTPM_LOG_TCS, "Calling TransmitData directly.\n");
-  //FIXME: Add Context Management
-  hRes = TDDL_TransmitData( inData, 
-			    inDataSize, 
-			    outData, 
-			    outDataSize);
-  
-  if (hRes == TDDL_SUCCESS) {
-    return TPM_SUCCESS;
-  } else {
-    vtpmlogerror(VTPM_LOG_TCS, "TCSP_RawTransmitData Failed with return code %s\n", tpm_get_error_name(TPM_IOERROR));
-    return TPM_IOERROR;
-  }
-  
-}
diff --git a/tools/vtpm_manager/tcs/tcs.h b/tools/vtpm_manager/tcs/tcs.h
deleted file mode 100644
index 83b9cd0..0000000
--- a/tools/vtpm_manager/tcs/tcs.h
+++ /dev/null
@@ -1,245 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// tcs.h
-// 
-//  This file declares the TCS API
-// 
-// ==================================================================
-
-#ifndef __TCS_H__
-#define __TCS_H__
-
-#include "tcg.h"
-#include "contextmgr.h"
-#include "buffer.h"
-
-#define HANDLE_NULL 0
-
-// ------------------------------------------------------------------
-// Exposed API
-// ------------------------------------------------------------------
-
-TPM_RESULT TCS_create();
-void TCS_destroy();
-
-TPM_RESULT TCS_OpenContext( /* OUT */ TCS_CONTEXT_HANDLE* hContext );
-
-TPM_RESULT TCS_CloseContext ( /* IN */ TCS_CONTEXT_HANDLE hContext );
-
-TPM_RESULT TCS_Malloc ( TCS_CONTEXT_HANDLE hContext, // in
-			UINT32   MemSize, // in
-			BYTE**   ppMemPtr ); //out
-
-TPM_RESULT TCS_FreeMemory ( TCS_CONTEXT_HANDLE hContext, // in
-			    BYTE*    pMemory);  // in
-
-// ------------------------------------------------------------------
-// Exposed API
-// ------------------------------------------------------------------
-
-// TPM v1.1B Command Set
-
-// Authorzation
-TPM_RESULT TCSP_OIAP( TCS_CONTEXT_HANDLE hContext, // in
-		      TCS_AUTHHANDLE*  authHandle, // out 
-		      TPM_NONCE*   nonce0  // out
-		      );
-
-TPM_RESULT TCSP_OSAP (  TCS_CONTEXT_HANDLE hContext,  // in
-			TPM_ENTITY_TYPE entityType,  // in
-			UINT32    entityValue, // in
-			TPM_NONCE   nonceOddOSAP, // in
-			TCS_AUTHHANDLE*  authHandle,  // out 
-			TPM_NONCE*   nonceEven,  // out
-			TPM_NONCE*   nonceEvenOSAP // out
-			);
-
-TPM_RESULT TCSP_TakeOwnership (  TCS_CONTEXT_HANDLE hContext,   // in
-				 UINT16    protocolID,   // in
-				 UINT32    encOwnerAuthSize, // in 
-				 BYTE*    encOwnerAuth,  // in
-				 UINT32    encSrkAuthSize,  // in
-				 BYTE*    encSrkAuth,   // in
-				 UINT32*    SrkSize,   // in, out
-				 BYTE**    Srk,    // in, out
-				 TCS_AUTH*   ownerAuth   // in, out
-				 );
-
-TPM_RESULT TCSP_DisablePubekRead (  TCS_CONTEXT_HANDLE hContext, // in
-                                    TCS_AUTH*   ownerAuth // in, out
-                                    );
-
-TPM_RESULT TCSP_TerminateHandle (  TCS_CONTEXT_HANDLE hContext, // in
-				   TCS_AUTHHANDLE  handle  // in
-				   );
-
-TPM_RESULT TCSP_FlushSpecific (  TCS_CONTEXT_HANDLE hContext, // in
-				 TCS_AUTHHANDLE  handle,  // in
-				 TPM_RESOURCE_TYPE resourceType //in 
-				 );
-
-// TPM Mandatory
-TPM_RESULT TCSP_Extend (  TCS_CONTEXT_HANDLE hContext, // in
-			  TPM_PCRINDEX  pcrNum,  // in
-			  TPM_DIGEST   inDigest, // in
-			  TPM_PCRVALUE*   outDigest // out
-			  );
-
-TPM_RESULT TCSP_PcrRead (  TCS_CONTEXT_HANDLE hContext, // in
-			   TPM_PCRINDEX  pcrNum,  // in
-			   TPM_PCRVALUE*  outDigest // out
-			   );
-
-TPM_RESULT TCSP_Quote (  TCS_CONTEXT_HANDLE hContext,  // in
-			 TCS_KEY_HANDLE  keyHandle,  // in
-			 TPM_NONCE   antiReplay,  // in
-			 UINT32*    PcrDataSize, // in, out
-			 BYTE**    PcrData,  // in, out
-			 TCS_AUTH*   privAuth,  // in, out
-			 UINT32*    sigSize,  // out
-			 BYTE**    sig    // out
-			 );
-
-TPM_RESULT TCSP_Seal (  TCS_CONTEXT_HANDLE hContext,  // in
-			TCS_KEY_HANDLE  keyHandle,  // in
-			TPM_ENCAUTH  encAuth,  // in
-			UINT32    pcrInfoSize, // in
-			BYTE*    PcrInfo,  // in
-			UINT32    inDataSize,  // in
-			BYTE*    inData,   // in
-			TCS_AUTH*   pubAuth,  // in, out
-			UINT32*    SealedDataSize, // out
-			BYTE**    SealedData  // out
-			);
-
-TPM_RESULT TCSP_Unseal (  TCS_CONTEXT_HANDLE hContext,  // in
-			  TCS_KEY_HANDLE  parentHandle, // in
-			  UINT32    SealedDataSize, // in
-			  BYTE*    SealedData,  // in
-			  TCS_AUTH*   parentAuth,  // in, out
-			  TCS_AUTH*   dataAuth,  // in, out
-			  UINT32*    DataSize,  // out
-			  BYTE**    Data   // out
-			  );
-
-TPM_RESULT TCSP_DirWriteAuth (  TCS_CONTEXT_HANDLE hContext,  // in
-				TPM_DIRINDEX  dirIndex,  // in
-				TPM_DIRVALUE  newContents, // in
-				TCS_AUTH*   ownerAuth  // in, out
-				);
-
-TPM_RESULT TCSP_DirRead (  TCS_CONTEXT_HANDLE hContext, // in
-			   TPM_DIRINDEX  dirIndex, // in
-			   TPM_DIRVALUE*  dirValue // out
-			   );
-
-TPM_RESULT TCSP_UnBind (  TCS_CONTEXT_HANDLE hContext,  // in
-			  TCS_KEY_HANDLE  keyHandle,  // in
-			  UINT32    inDataSize,  // in
-			  BYTE*    inData,   // in
-			  TCS_AUTH*   privAuth,  // in, out
-			  UINT32*    outDataSize, // out
-			  BYTE**    outData   // out
-			  );
-
-TPM_RESULT TCSP_CreateWrapKey (  TCS_CONTEXT_HANDLE hContext,   // in
-				 TCS_KEY_HANDLE  hWrappingKey,  // in
-				 TPM_ENCAUTH  KeyUsageAuth,  // in
-				 TPM_ENCAUTH  KeyMigrationAuth, // in
-				 UINT32*    pcKeySize,   // in, out
-				 BYTE**    prgbKey,   // in, out
-				 TCS_AUTH*   pAuth    // in, out
-				 );
-
-TPM_RESULT TCSP_LoadKeyByBlob (  TCS_CONTEXT_HANDLE hContext,    // in
-				 TCS_KEY_HANDLE  hUnwrappingKey,   // in
-				 UINT32    cWrappedKeyBlobSize, // in
-				 BYTE*    rgbWrappedKeyBlob,  // in
-				 TCS_AUTH*   pAuth,     // in, out
-				 TCS_KEY_HANDLE*  phKeyTCSI,    // out
-				 TCS_KEY_HANDLE*  phKeyHMAC    // out
-				 );
-
-TPM_RESULT TCSP_GetPubKey (  TCS_CONTEXT_HANDLE hContext,  // in
-			     TCS_KEY_HANDLE  hKey,   // in
-			     TCS_AUTH*   pAuth,   // in, out
-			     UINT32*    pcPubKeySize, // out
-			     BYTE**    prgbPubKey  // out
-			     ); 
-
-TPM_RESULT TCSP_EvictKey (  TCS_CONTEXT_HANDLE hContext, // in
-			    TCS_KEY_HANDLE  hKey  // in
-			    );
-
-TPM_RESULT TCSP_Sign (  TCS_CONTEXT_HANDLE hContext,  // in
-			TCS_KEY_HANDLE  keyHandle,  // in
-			UINT32    areaToSignSize, // in
-			BYTE*    areaToSign,  // in
-			TCS_AUTH*   privAuth,  // in, out
-			UINT32*    sigSize,  // out
-			BYTE**    sig    // out
-			);
-
-TPM_RESULT TCSP_GetRandom (  TCS_CONTEXT_HANDLE hContext,  // in
-			     UINT32*    bytesRequested, // in, out
-			     BYTE**    randomBytes  // out
-			     );
-
-TPM_RESULT TCSP_StirRandom (  TCS_CONTEXT_HANDLE hContext, // in
-			      UINT32    inDataSize, // in
-			      BYTE*    inData  // in
-			      );
-
-TPM_RESULT TCSP_ReadPubek (  TCS_CONTEXT_HANDLE hContext,    // in
-			     TPM_NONCE   antiReplay,    // in
-			     UINT32*    pubEndorsementKeySize, // out
-			     BYTE**    pubEndorsementKey,  // out
-			     TPM_DIGEST*  checksum    // out
-			     );
-
-
-// Non-Standard TCSP calls
-TPM_RESULT TCSP_SaveState(TCS_CONTEXT_HANDLE   hContext);  // in
-
-//Give direct access to TransmitData.
-// Key and Auth Management is done before transfering command to TDDL.
-TPM_RESULT TCSP_RawTransmitData(UINT32 inDataSize,  // in
-				BYTE *inData,       // in
-				UINT32 *outDataSize,// in/out
-				BYTE *outData);     // out
-
-///////////// Private Functions ////////////////////
-CONTEXT_HANDLE* LookupContext( TCS_CONTEXT_HANDLE hContext);
-
-#endif //TCS_H
diff --git a/tools/vtpm_manager/tcs/tpmddl.h b/tools/vtpm_manager/tcs/tpmddl.h
deleted file mode 100644
index e7e54f1..0000000
--- a/tools/vtpm_manager/tcs/tpmddl.h
+++ /dev/null
@@ -1,69 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// tpmddl.c
-// 
-//  This file defines the TDDLI API
-//
-// ==================================================================
-
-#ifndef __TPMDDL_H__
-#define __TPMDDL_H__
-
-#define TDDL_CAP_PROP_MANUFACTURER 0x0001
-
-#define TDDL_E_FAIL 1
-#define TDDL_E_SUCCESS 0
-#define TDDL_SUCCESS 0
-
-typedef unsigned int TDDL_UINT32;
-typedef TDDL_UINT32 TDDL_RESULT;
-typedef unsigned char TDDL_BYTE;
-
-TDDL_RESULT TDDL_Open();
-void TDDL_Close();
-TDDL_RESULT TDDL_TransmitData( TDDL_BYTE* in,
-			       TDDL_UINT32 insize,
-			       TDDL_BYTE* out,
-			       TDDL_UINT32* outsize);
-TDDL_RESULT TDDL_GetStatus();
-TDDL_RESULT TDDL_GetCapability( TDDL_UINT32 cap,
-				TDDL_UINT32 sub,
-				TDDL_BYTE* buffer,
-				TDDL_UINT32* size);
-TDDL_RESULT TDDL_SetCapability( TDDL_UINT32 cap,
-				TDDL_UINT32 sub,
-				TDDL_BYTE* buffer,
-				TDDL_UINT32* size);
-
-#endif // __TPMDDL_H__
diff --git a/tools/vtpm_manager/tcs/transmit.c b/tools/vtpm_manager/tcs/transmit.c
deleted file mode 100644
index 74bbdca..0000000
--- a/tools/vtpm_manager/tcs/transmit.c
+++ /dev/null
@@ -1,147 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-
-#include <unistd.h>
-#include <stdio.h>
-#include <errno.h>
-#include <fcntl.h>
-
-#include "tcg.h"
-#include "buffer.h"
-#include "log.h"
-#include "tpmddl.h"
-
-// flag to track whether TDDL has been opened
-static int g_TDDL_open = 0;
-static int g_tx_fd = -1;              // the fd to the TPM
-
-#ifndef DUMMY_TPM
- #define TPM_TX_FNAME "/dev/tpm0"
- static int *g_rx_fdp = &g_tx_fd;
-#else
- #define TPM_TX_FNAME "/var/tpm/tpm_in.fifo"
- #define TPM_RX_FNAME "/var/tpm/tpm_out.fifo"
- static int g_rx_fd = -1;
- static int *g_rx_fdp = &g_rx_fd;              // the fd to the TPM
-#endif
-
-TPM_RESULT
-TDDL_TransmitData( TDDL_BYTE* in,
-		   TDDL_UINT32 insize,
-		   TDDL_BYTE* out,
-		   TDDL_UINT32* outsize) {
-  TPM_RESULT status = TPM_SUCCESS;
-  TDDL_UINT32 i;
-  
-  vtpmloginfo(VTPM_LOG_TXDATA, "Sending buffer = 0x");
-  for(i = 0 ; i < insize ; i++) 
-    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", in[i]);
-
-  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
-  
-  ssize_t size = 0;
-  
-  // send the request
-  size = write (g_tx_fd, in, insize);
-  if (size < 0) {
-    vtpmlogerror(VTPM_LOG_TXDATA, "write() failed");
-    ERRORDIE (TPM_IOERROR);
-  }
-  else if ((TDDL_UINT32) size < insize) {
-    vtpmlogerror(VTPM_LOG_TXDATA, "Wrote %d instead of %d bytes!\n", (int) size, insize);
-    // ... ?
-  }
-
-  // read the response
-  size = read (*g_rx_fdp, out, TCPA_MAX_BUFFER_LENGTH);
-  if (size < 0) {
-    vtpmlogerror(VTPM_LOG_TXDATA, "read() failed");
-    ERRORDIE (TPM_IOERROR);
-  }
-  
-  vtpmloginfo(VTPM_LOG_TXDATA, "Receiving buffer = 0x");
-  for(i = 0 ; i < size ; i++) 
-    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out[i]);
-
-  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
-
-  *outsize = size;
-  // close connection
-  goto egress;
-  
- abort_egress:
- egress:
-  return status;
-}
-
-TPM_RESULT TDDL_Open() {
-  
-  TDDL_RESULT status = TDDL_SUCCESS;
-  
-  if (g_TDDL_open)
-    return TPM_FAIL;
-
-#ifdef DUMMY_TPM  
-  *g_rx_fdp = open (TPM_RX_FNAME, O_RDWR);
-#endif
-
-  g_tx_fd = open (TPM_TX_FNAME, O_RDWR);
-  if (g_tx_fd < 0) {
-    vtpmlogerror(VTPM_LOG_TXDATA, "TPM open failed");
-    return TPM_IOERROR;
-  }
-  
-  g_TDDL_open = 1;
-  
-  return status;
-}
-
-void TDDL_Close() {
-  if (! g_TDDL_open)
-        return;
-
-  if (g_tx_fd>= 0) {
-    if (close(g_tx_fd) < 0) 
-      vtpmlogerror(VTPM_LOG_TXDATA, "closeing tpm failed");
-    g_tx_fd = -1;
-  }
-    
-  if (*g_rx_fdp>= 0) {
-    if (close(*g_rx_fdp) < 0) 
-      vtpmlogerror(VTPM_LOG_TXDATA, "closeing tpm failed");
-    *g_rx_fdp = -1;
-  }
-
-  g_TDDL_open = 0;
-  
-}
diff --git a/tools/vtpm_manager/util/Makefile b/tools/vtpm_manager/util/Makefile
deleted file mode 100644
index 36bc38f..0000000
--- a/tools/vtpm_manager/util/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-XEN_ROOT = $(CURDIR)/../../..
-include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
-
-BIN		= libTCGUtils.a
-
-.PHONY: all
-all: build
-
-.PHONY: build
-build: $(BIN)
-
-.PHONY: install
-install: build
-
-.PHONY: clean
-clean:
-	rm -f *.a *.so *.o *.rpm $(DEP_FILES)
-
-.PHONY: mrproper
-mrproper: clean
-	rm -f *~
-
-$(BIN): $(OBJS)
-	$(AR) rcs $(BIN) $(OBJS)
diff --git a/tools/vtpm_manager/util/bsg.c b/tools/vtpm_manager/util/bsg.c
deleted file mode 100644
index fa36ce7..0000000
--- a/tools/vtpm_manager/util/bsg.c
+++ /dev/null
@@ -1,829 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// bsg.cpp
-// 
-//  This file will handle all the TPM Byte Stream functions
-// 
-// ==================================================================
-
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-#include <malloc.h>
-#include "tcg.h"
-#include "crypto.h"
-#include "bsg.h"
-#include "log.h"
-
-static int g_log_recursion_level = 0;
-
-// a largest buffer size. if we get a buf size bigger than this when unpacking,
-// will complain!
-#define BSG_MAX_BUF_SIZE (1<<18)
-
-#define bsglog(fmt, ...) do { \
-    int __i; \
-    for (__i=0; __i < g_log_recursion_level; __i++) {		     \
-      vtpmloginfomore (VTPM_LOG_BSG, "%s", "  ");			     \
-    }								       \
-    vtpmloginfomore (VTPM_LOG_BSG, fmt, __VA_ARGS__);			       \
-  } while (0)
-
-
-// FIXME:  trigger the selfcheck--need to use glibc hook to do this
-//BOOL dummy1 = BSG_static_selfcheck();
-
-
-// Interpretting Types
-// -------------------
-// 
-// Incoming Types are composed of two parts {format, info} squished into a
-// BSG_UINT32.  The first 4 bits is a format spec indicating what type of
-// data it is.  If the first 4 bits are zero the info corresponds to a value in
-// BSG_s_fmt[]. This is a structure whose composition is described in
-// BSG_s_fmt[]. If the value is non-zero, info corresponds to the size of the
-// data (in bytes) being passed in. For example a UINT32 being passed in would
-// have a format of (__FMT_CONST | 4). If both, the format and info are zero,
-// this is interpretted as the end of the structure, and the result is returned.
-
-// these flags are mutually exclusive, so I'll just make them
-// format values which indicate the semantics of the 'info' part and the source
-// data. The above description has been accordingly adjusted.
-
-// format values for determining what type of data the incoming type is
-// it's a 4 bit value, occupying the high 4 bits
-#define __FMT_CONST (1UL << 28) // Constant sized value
-#define __FMT_DATA  (2UL << 28) // Believed to be raw data NOT {size,data}
-#define __FMT_SIZE  (3UL << 28) // A size. Used in FMT_SIZE??_DATA.
-#define __FMT_HSIZE (4UL << 28) // A number of handles
-#define __FMT_PACKED (5UL << 28) // 'info' is unused; the source data consists
-                                 // of {size32, data} but we're to pack only the
-                                 // data as that is already packed, and so
-                                 // can/must be unpacked without
-                                 // explicitly reading it size
-
-#define __FMT_MASK  0x0FFFFFFFUL // this masks out the 4-bit format
-#define __FMT_MASK_SIZE(type)   ((type) & __FMT_MASK)
-#define __FMT_MASK_FORMAT(type) ((type) & (~__FMT_MASK))
-
-// constant (8/16/32-bits)
-#define FMT_U8 (__FMT_CONST | 1UL)
-#define FMT_U16 (__FMT_CONST | 2UL)
-#define FMT_U32 (__FMT_CONST | 4UL)
-
-// const with a compiler-computed size
-#define FMT_SIZEOF(type) (__FMT_CONST | sizeof(type))
-
-// other data (size bytes) 
-// Used primarily for DIGESTS -> FMT_DATA(20)
-#define FMT_DATA(size) (__FMT_DATA | ((BSG_UINT32) (size) & __FMT_MASK))
-
-// 16/32-bit size followed by N bytes of data
-#define FMT_SIZE16_DATA (__FMT_SIZE | 2UL)
-#define FMT_SIZE32_DATA (__FMT_SIZE | 4UL)
-
-// 16-bit size followed by N key handles
-#define FMT_SIZE16_HANDLES (__FMT_HSIZE | 2UL)
-
-#define DIGEST_SIZE 20 
-typedef BSG_UINT32 BSG_HANDLE;
-
-// TCPA_AUTH has 11 fields!
-#define MAX_FIELDS 11
-typedef struct BSG_Format
-{
-  BSG_Type type;
-  const char* name;
-  BSG_UINT32 fields[MAX_FIELDS + 1];
-} BSG_Format;
-
-/*
- * TCPA structure data formats
- */
-// this has to be manually kept in sync with the
-// Type enum!! the static_selfcheck() function should be used regularly!
-static BSG_Format s_fmt[] =
-{
-  {BSG_TYPE_UINT32, "BSG_TYPE_UINT32", {FMT_U32, 0}},
-  {BSG_TYPE_UINT16, "BSG_TYPE_UINT16", {FMT_U16, 0}},
-  {BSG_TYPE_BYTE, "BSG_TYPE_BYTE", {FMT_U8, 0}},
-  {BSG_TYPE_BOOL, "BSG_TYPE_BOOL", {FMT_U8, 0}},
-  {BSG_TPM_SIZE32_DATA, "BSG_TPM_SIZE32_DATA", {FMT_SIZE32_DATA, 0}},
-  {BSG_TPM_TAG, "BSG_TPM_TAG", {FMT_SIZEOF(TPM_TAG), 0}},
-  {BSG_TPM_HANDLE, "BSG_TPM_HANDLE", {FMT_SIZEOF(TPM_HANDLE), 0}},
-  {BSG_TPM_RESULT, "BSG_TPM_RESULT", {FMT_SIZEOF(TPM_RESULT), 0}},
-  {BSG_TPM_RESOURCE_TYPE, "BSG_TPM_RESOURCE_TYPE", {FMT_SIZEOF(TPM_RESOURCE_TYPE), 0}},
-  {BSG_TPM_COMMAND_CODE, "BSG_TPM_COMMAND_CODE", {FMT_U32, 0}},
-  {BSG_TPM_AUTH_DATA_USAGE, "BSG_TPM_AUTH_DATA_USAGE", {FMT_U8, 0}},
-  {BSG_TPM_ALGORITHM_ID, "BSG_TPM_ALGORITHM_ID", {FMT_U32, 0}},
-  {BSG_TPM_PROTOCOL_ID, "BSG_TPM_PROTOCOL_ID", {FMT_SIZEOF(TPM_PROTOCOL_ID), 0}},
-  {BSG_TPM_KEY_USAGE, "BSG_TPM_KEY_USAGE", {FMT_U16, 0}},
-  {BSG_TPM_ENC_SCHEME, "BSG_TPM_ENC_SCHEME", {FMT_U16, 0}},
-  {BSG_TPM_SIG_SCHEME, "BSG_TPM_SIG_SCHEME", {FMT_U16, 0}},
-  {BSG_TPM_MIGRATE_SCHEME, "BSG_TPM_MIGRATE_SCHEME", {FMT_U16, 0}},
-  {BSG_TPM_KEY_FLAGS, "BSG_TPM_KEY_FLAGS", {FMT_U32, 0}},
-    
-  {BSG_TPM_AUTHDATA, "BSG_TPM_AUTHDATA", {FMT_DATA(DIGEST_SIZE), 0}},
-  {BSG_TPM_SECRET, "BSG_TPM_SECRET", {BSG_TPM_AUTHDATA, 0}},
-  {BSG_TPM_ENCAUTH, "BSG_TPM_ENCAUTH", {BSG_TPM_AUTHDATA, 0}},
-  {BSG_TPM_PAYLOAD_TYPE, "BSG_TPM_PAYLOAD_TYPE", {FMT_SIZEOF(TPM_PAYLOAD_TYPE), 0}},
-  
-  {BSG_TPM_VERSION, "BSG_TPM_VERSION", {FMT_DATA(4), 0}}, // vers 1.2
-  {BSG_TPM_DIGEST, "BSG_TPM_DIGEST", {FMT_DATA(DIGEST_SIZE), 0}},
-  {BSG_TPM_COMPOSITE_HASH, "BSG_TPM_COMPOSITE_HASH", {BSG_TPM_DIGEST, 0}},
-  {BSG_TPM_CHOSENID_HASH, "BSG_TPM_CHOSENID_HASH", {BSG_TPM_DIGEST, 0}},
-  
-  {BSG_TPM_NONCE, "BSG_TPM_NONCE", {FMT_DATA(DIGEST_SIZE), 0}},
-  {BSG_TPM_KEY_HANDLE, "BSG_TPM_KEY_HANDLE", {FMT_SIZEOF(TPM_KEY_HANDLE), 0}},
-  {BSG_TPM_KEY_HANDLE_LIST, "BSG_TPM_KEY_HANDLE_LIST",
-   {FMT_SIZE16_HANDLES, 0}},
-  
-  {BSG_TPM_KEY_PARMS, "BSG_TPM_KEY_PARMS", {
-      BSG_TPM_ALGORITHM_ID,
-      BSG_TPM_ENC_SCHEME,
-      BSG_TPM_SIG_SCHEME,
-      FMT_SIZE32_DATA,
-      0}},
-  {BSG_TPM_RSA_KEY_PARMS, "BSG_TPM_RSA_KEY_PARMS", {
-      FMT_U32, FMT_U32, FMT_SIZE32_DATA, 0}},
-  {BSG_TPM_STORE_PUBKEY, "BSG_TPM_STORE_PUBKEY", {FMT_SIZE32_DATA, 0}},
-  {BSG_TPM_PUBKEY, "BSG_TPM_PUBKEY", {BSG_TPM_KEY_PARMS, BSG_TPM_STORE_PUBKEY, 0}},
-  {BSG_TPM_KEY, "BSG_TPM_KEY", {
-      BSG_TPM_VERSION,
-      BSG_TPM_KEY_USAGE,
-      BSG_TPM_KEY_FLAGS,
-      BSG_TPM_AUTH_DATA_USAGE,
-      BSG_TPM_KEY_PARMS,
-      FMT_SIZE32_DATA,        // the PCR_INFO
-      BSG_TPM_STORE_PUBKEY,
-      FMT_SIZE32_DATA,        // the encrypted part
-      0}},
-  
-  {BSG_TPM_MIGRATIONKEYAUTH, "BSG_TPM_MIGRATIONKEYAUTH", {
-      BSG_TPM_PUBKEY,
-      BSG_TPM_MIGRATE_SCHEME,
-      BSG_TPM_DIGEST, 0}},
-  
-  {BSG_TCPA_AUDIT_EVENT, "TCPA_AUDIT_EVENT", {
-      BSG_TPM_COMMAND_CODE,
-      BSG_TPM_RESULT, 0 }},
-  
-  {BSG_TCPA_EVENT_CERT, "TCPA_EVENT_CERT", {
-      BSG_TPM_DIGEST,
-      BSG_TPM_DIGEST,
-      FMT_DATA(2),
-      FMT_SIZE32_DATA, 0}},
-  
-  {BSG_TPM_PCR_SELECTION, "BSG_TPM_PCR_SELECTION", {FMT_SIZE16_DATA, 0} },
-  {BSG_TPM_PCR_COMPOSITE, "BSG_TPM_PCR_COMPOSITE", { BSG_TPM_PCR_SELECTION,
-						     FMT_SIZE32_DATA,
-						     0} },
-
-  {BSG_TPM_PCR_INFO, "BSG_TPM_PCR_INFO", { BSG_TPM_PCR_SELECTION,
-					   BSG_TPM_COMPOSITE_HASH, 
-					   BSG_TPM_COMPOSITE_HASH,
-					   0} },
-  
-  
-  {BSG_TPM_STORED_DATA, "BSG_TPM_STORED_DATA", {
-      BSG_TPM_VERSION,
-      FMT_SIZE32_DATA,
-      FMT_SIZE32_DATA,
-      0}},
-  {BSG_TPM_SYMMETRIC_KEY, "BSG_TPM_SYMMETRIC_KEY", {
-      BSG_TPM_ALGORITHM_ID,
-      BSG_TPM_ENC_SCHEME,
-      FMT_SIZE16_DATA,
-      0}},
-  {BSG_TPM_STORE_PRIVKEY, "BSG_TPM_STORE_PRIVKEY", {FMT_SIZE32_DATA, 0}},
-  {BSG_TPM_STORE_ASYMKEY, "BSG_TPM_STORE_ASYMKEY", {
-      BSG_TPM_PAYLOAD_TYPE,
-      BSG_TPM_SECRET,
-      BSG_TPM_SECRET,
-      BSG_TPM_DIGEST,
-      BSG_TPM_STORE_PRIVKEY,
-      0}},
-  {BSG_TPM_MIGRATE_ASYMKEY, "BSG_TPM_MIGRATE_ASYMKEY", {
-      BSG_TPM_PAYLOAD_TYPE,
-      BSG_TPM_SECRET,
-      BSG_TPM_DIGEST,
-      FMT_U32,
-      BSG_TPM_STORE_PRIVKEY,
-      0}},
-  
-  {BSG_TPM_QUOTE_INFO, "BSG_TPM_QUOTE_INFO", {
-      BSG_TPM_VERSION,
-      FMT_DATA(4),
-      BSG_TPM_COMPOSITE_HASH,
-      BSG_TPM_NONCE,
-      0}},
-  
-  {BSG_TPM_IDENTITY_CONTENTS, "BSG_TPM_IDENTITY_CONTENTS", {
-      BSG_TPM_VERSION,
-      FMT_U32,
-      BSG_TPM_CHOSENID_HASH,
-      BSG_TPM_PUBKEY,
-      0}},
-  
-  {BSG_TPM_PCRVALUE, "BSG_TPM_PCRVALUE", {FMT_DATA(DIGEST_SIZE), 0}},
-  
-  {BSG_TCPA_PCR_FLAGS, "TCPA_PCR_FLAGS", {
-      FMT_U8,
-      FMT_U8,
-      0}},
-  
-  {BSG_TCS_AUTH, "TCS_AUTH", {
-      BSG_TYPE_UINT32, 
-      BSG_TPM_NONCE, 
-      BSG_TPM_NONCE, 
-      BSG_TYPE_BOOL, 
-      BSG_TPM_AUTHDATA, 
-      0}},
-  
-  {BSG_TPM_KEY_NONSENSITIVE, "BSG_TPM_KEY_NONSENSITIVE", {
-      BSG_TPM_VERSION,
-      BSG_TPM_KEY_USAGE,
-      BSG_TPM_KEY_FLAGS,
-      BSG_TPM_AUTH_DATA_USAGE,
-      BSG_TPM_KEY_PARMS,
-      FMT_SIZE32_DATA,
-      BSG_TPM_STORE_PUBKEY,
-      0}},
-  
-  {BSG_PACKED, "BSG_PACKED", {
-      __FMT_PACKED,
-      0 }},
-  
-  {BSG_TYPE_MAX, "", {0}},
-};
-
-
-static const BSG_Format* find_format (BSG_Type t) {
-  BSG_Format * f = s_fmt;
-  
-  if (t >= BSG_TYPE_MAX) {
-    return NULL;
-  }
-  
-  // WARNING: this depends on the enum and s_fmt[] array being in sync! make
-  // sure to run the static_selfcheck() to make sure
-  f = s_fmt + (t - BSG_TYPE_FIRST);
-  
-  return f;
-}
-
-//
-// a consistency-checking routine which can be run at compile time
-// (ie. immediately after compilation)
-//
-// tasks:
-// - verify that s_fmt has one entry per Type t, and that entry is at s_fmt[t]
-//
-// conditions:
-// - need that s_fmt[0] is the first type listed in the Type enum! ie the first
-//   Type has value 0, not 1
-//
-// FIXME: should have a function be passed in here which is called if the test
-// fails. Then the caller can decide what to do: abort, notify, whatever
-// 
-BOOL BSG_static_selfcheck ()
-{
-  int i;
-
-  for (i=BSG_TYPE_FIRST; i <= BSG_TYPE_MAX; i++) {
-    if (s_fmt[i - BSG_TYPE_FIRST].type != i) {
-      bsglog ("%s\n", "BSG: static_selfcheck failed!\n");
-      bsglog ("failure at %i, allegedly %s\n",
-	      i, s_fmt[i - BSG_TYPE_FIRST].name);
-      abort();
-      return FALSE;
-    }
-  }
-  
-  bsglog ("%s\n", "BSG: static_selfcheck success!");
-  return TRUE;
-}
-
-
-/**
- * Flatten a TCPA structure into a buffer in big-endian format
- * @type: TCPA structure type
- * @src: (IN) TCPA structure (OUT) end of TCPA structure
- * @dst: (OUT) flattened data
- * Returns: Flattened size or -1 for unknown types
- */
-// make it so that it can just run through the whole process and return
-// the packed size, without packing anything. this will be done if dst is NULL.
-static int BSG_Pack_private(BSG_Type type, const BSG_BYTE** src, BSG_BYTE* dst)
-{
-  // check incoming parameters
-  if (*src == NULL)
-    return 0;
-  
-  const BSG_BYTE* s = *src;
-  BSG_BYTE* d = dst;
-  
-  BSG_UINT32 size   = __FMT_MASK_SIZE(type);
-  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
-  
-  if (format == __FMT_CONST) // We are dealing with a fixed length value eg. UINT32
-    {
-      BSG_UINT32 val = 0;
-      switch (size) {
-      case 1: val = * (BYTE*) s; break;
-      case 2: val = * (unsigned short*) s; break;
-      case 4: val = * (BSG_UINT32*) s; break;
-      }
-      if (dst)
-	BSG_PackConst(val, size, d);
-
-      s += size;
-      d += size;
-    } else if (format == __FMT_DATA) { // We are dealing with raw data. Not sure when
-    // this is used.
-    
-      if (dst) {
-        bsglog ("BSG: __FMT_DATA size %d, src %p, dst %p\n", size, s, d);
-        memcpy(d, s, size);
-      }
-
-      s += size;
-      d += size;
-  } else if (format == __FMT_SIZE || format == __FMT_HSIZE) { // It's a size, followed by that much data or handles
-    
-    BSG_UINT32 psize = 0;
-    switch (size) {
-    case 1: psize = * (BYTE*) s; break;
-    case 2: psize = * (unsigned short*) s; break;
-    case 4: psize = * (BSG_UINT32*) s; break;
-    }
-        
-    if (dst)
-      BSG_PackConst(psize, size, d);
-
-    s += size;
-    d += size;
-    
-    // now 's' points to an address, so cast it to BSG_BYTE**
-    const BSG_BYTE* pdata = * ((BSG_BYTE**) s);
-    s += sizeof(BSG_BYTE*);
-    
-    if (format == __FMT_HSIZE) {// This is a list of psize Handles
-      if (dst) {
-	BSG_HANDLE* d2 = (BSG_HANDLE*) d;
-	BSG_HANDLE* p2 = (BSG_HANDLE*) pdata;
-	BSG_UINT32 i;
-	for (i = 0; i < psize; i++) 
-	  d2[i] = BSG_UnpackConst((BSG_BYTE*)(p2 + i), 4);
-	
-      }
-      d += psize * sizeof(BSG_HANDLE);
-    } else {// If it's not psize handles, it's psize data.
-      if (psize > 0) {
-	if (dst) {
-	  bsglog ("BSG: __FMT_SIZE, size=%d, src=%p, dst=%p\n",
-		  psize, pdata, d);
-	  memcpy(d, pdata, psize);
-	}
-      }
-      d += psize;
-    }
-  } else if (format == __FMT_PACKED) {
-    // the source buffer is a pack_constbuf_t, which has a size and a
-    // pointer. just copy the buffer value, the size is not included in the
-    // output stream.
-    pack_constbuf_t * buf = (pack_constbuf_t*) s;
-    
-    if (dst) {
-      bsglog ("BSG: __FMT_PACKED, size=%d, src=%p, dst=%p\n",
-	      buf->size, buf->data, d);
-      memcpy(d, buf->data, buf->size);
-    }
-        
-    s += buf->size;
-    d += buf->size;
-  } else if (format == 0) {// No flags are set. This is a structure & it should
-                          // be looked up in the bsg_s_fmt[]
-    
-    const BSG_Format* x = find_format (type);
-    if (x == NULL) {
-      vtpmloginfo(VTPM_LOG_BSG, "BSG_Pack: cannot find type %d\n", type);
-      return -1;
-    }
-    
-    if (dst)
-      bsglog ("BSG_Pack type %s\n", x->name);
-    
-    
-    // iterate through the fields
-    const BSG_UINT32* f = x->fields;
-    for (; *f; f++) {
-      int fsize;
-      
-      g_log_recursion_level++;
-      fsize = BSG_Pack_private((BSG_Type) *f, &s, dst ? d : NULL);
-      g_log_recursion_level--;
-      
-      if (fsize <= 0)
-	return fsize;
-      
-      d += fsize;
-    }
-  } else {
-    vtpmlogerror(VTPM_LOG_BSG, "BSG_Pack(): Unknown format %d\n", format);
-    return -1;
-  }
-  
-  *src = s;
-  return (d - dst);
-}
-
-/**
- * Unflatten a TCPA structure from a buffer in big-endian format
- * @type: TCPA structure type
- * @src: flattened data
- * @dst: (IN) TCPA structure (OUT) end of TCPA structure
- * Returns: Flattened size
- * Note: Returns flattened size NOT the unpacked structure size
- */
-static int BSG_Unpack_private(BSG_Type type, const BSG_BYTE* src, BSG_BYTE** dst) {
-  // check incoming parameters
-  if (src == NULL)
-    return 0;
-  
-  
-  const BSG_BYTE* s = src;
-  BSG_BYTE* d = dst ? *dst:NULL;
-  if (dst && !d)
-    dst = NULL;
-  
-  BSG_UINT32 size = __FMT_MASK_SIZE(type);
-  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
-  
-  if (format == __FMT_CONST) {// We are dealing with a fixed length value ie. UINT32
-
-    BSG_UINT32 val = BSG_UnpackConst(s, size);
-
-    if (dst) {
-      switch (size) {
-      case 1: *(BYTE *) d = (BSG_BYTE) val; break;
-      case 2: *(unsigned short*) d = (unsigned short) val; break;
-      case 4: *(BSG_UINT32*) d = (BSG_UINT32) val; break;
-      }
-    }
-
-    s += size;
-    d += size;
-  } else if (format == __FMT_DATA) {// We are dealing with raw data. Not sure when this is used.
-    if (dst)
-      memcpy(d, s, size);
-
-    d += size;
-    s += size;
-  } else if (format == __FMT_SIZE || format == __FMT_HSIZE) {// It's a size, followed by that much data or handles
-    
-    BSG_UINT32 psize = BSG_UnpackConst(s, size);
-    
-    if (psize > BSG_MAX_BUF_SIZE) {
-      vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack runs into var-sized data bigger than %u bytes!!\n",
-	       BSG_MAX_BUF_SIZE);
-      return -1;
-    }
-    
-    if (dst) {
-      switch (size) {
-      case 1: *(BYTE *) d = (BSG_BYTE) psize; break;
-      case 2: *(unsigned short*) d = (unsigned short) psize; break;
-      case 4: *(BSG_UINT32*) d = (BSG_UINT32) psize; break;
-      }
-    }
-
-    s += size;
-    d += size;
-    
-    BSG_BYTE* pdata = NULL;
-    
-    if (psize) {
-      if (format == __FMT_HSIZE) { // This is a list of psize Handles
-	if (dst) {
-	  BSG_HANDLE* s2 = (BSG_HANDLE*) s;
-	  pdata = (BSG_BYTE *)malloc(psize * sizeof(BSG_HANDLE));
-          if (!pdata)
-            return -1;
-          
-	  BSG_HANDLE* p2 = (BSG_HANDLE*) pdata;
-	  BSG_UINT32 i;
-	  for (i = 0; i < psize; i++) {
-	    BSG_PackConst(s2[i], 4, (BSG_BYTE*)(p2 + i));
-	  }
-	}
-	s += psize * sizeof(BSG_HANDLE);
-      } else { // If it's not psize handles, it's psize data.
-	if (dst) {
-	  pdata = (BSG_BYTE *)malloc(sizeof(BSG_BYTE) * psize);
-          if (!pdata)
-            return -1;
-	  memcpy(pdata, s, psize);
-	}
-	s += psize;
-      }
-    }
-    if (dst)
-      *(void**) d = pdata;
-
-    d += sizeof(void*);
-  } else if (format == __FMT_PACKED) {
-
-    // this doesn't make sense for unpacking!
-    vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack() called with format __FMT_PACKED. "
-							   "This does not make sense\n");
-    
-    return -1;
-  } else if (format == 0) {// No flags are set. This is a structure & it should
-                          // be looked up in the bsg_s_fmt[]
-
-    const BSG_Format* x = find_format (type);
-    if (x == NULL) {
-      vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack: cannot find type %d\n", type);
-      return -1;
-    }
-    
-    const BSG_UINT32* f = x->fields;
-    for (; *f; f++) {
-      int fsize = BSG_Unpack_private((BSG_Type) *f, s, dst ? &d:NULL);
-      if (fsize <= 0)
-	return fsize;
-      s += fsize;
-    }
-  }
-
-  if (dst)
-    *dst = d;
-  return (s - src);
-}
-
-/**
- * Free memory associated with unpacked TCPA structure
- * @type: TCPA structure type
- * @src: (IN) TCPA structure (OUT) end of TCPA structure
- * Note: Destroy should be called on all structures created with Unpack
- *       to ensure that any allocated memory is freed
- */
-static void BSG_Destroy_private(BSG_Type type, BSG_BYTE** src) {
-  BSG_BYTE* s = *src;
-  
-  BSG_UINT32 size = __FMT_MASK_SIZE(type);
-  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
-  
-  if ((src == NULL) || (*src == NULL)) {
-        vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy() called with NULL src\n");
-    return;
-  }
-
-  if (format == __FMT_CONST || format == __FMT_DATA)
-    s += size;
-  else if (format == __FMT_SIZE || format == __FMT_HSIZE) {
-    s += size;
-    BSG_BYTE* ptr = *(BSG_BYTE**) s;
-    free(ptr);
-    s += sizeof(void*);
-  } else if (format == __FMT_PACKED) {
-
-    // this doesn't make sense for unpacking, hence also for Destroy()
-    vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy() called with format __FMT_PACKED. "
-							   "This does not make sense\n");
-    
-    return;
-  } else if (format == 0) {
-    const BSG_Format* x = find_format (type);
-    if (x == NULL) {
-      vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy: cannot find type %d\n", type);
-      return;
-    }
-    
-    const BSG_UINT32* f = x->fields;
-    for (; *f; f++)
-      BSG_Destroy_private((BSG_Type) *f, &s);
-  }
-
-  *src = s;
-}
-
-int BSG_Pack(BSG_Type type, const void* src, BSG_BYTE* dst)
-{
-  const BSG_BYTE* src2 = (const BSG_BYTE*) src;
-  return BSG_Pack_private(type, &src2, dst);
-}
-
-int BSG_Unpack(BSG_Type type, const BSG_BYTE* src, void* dst)
-{
-  BSG_BYTE* dst2 = (BSG_BYTE*) dst;
-  return BSG_Unpack_private(type, src, dst ? &dst2:NULL);
-}
-
-void BSG_Destroy(BSG_Type type, void* src)
-{
-  BSG_BYTE* src2 = (BSG_BYTE*) src;
-  BSG_Destroy_private(type, &src2);
-}
-    
-/**
- * Pack a 8/16/32-bit constant into a buffer in big-endian format
- * @val: constant value
- * @size: constant size in bytes (1, 2, or 4)
- * @dst: (OUT) buffer
- */
-void BSG_PackConst(BSG_UINT32 val, int size, BSG_BYTE* dst) {
-  bsglog ("BSG: PackConst on %d of size %i into address %p\n", val, size, dst);
-  
-  switch (size) {
-  case 4:
-    dst[0] = (BSG_BYTE)((val >> 24) & 0xff);
-    dst[1] = (BSG_BYTE)((val >> 16) & 0xff);
-    dst[2] = (BSG_BYTE)((val >> 8) & 0xff);
-    dst[3] = (BSG_BYTE)(val & 0xff);
-    break;
-  case 2:
-    dst[0] = (BSG_BYTE)((val >> 8) & 0xff);
-    dst[1] = (BSG_BYTE)(val & 0xff);
-    break;
-  case 1:
-    dst[0] = (BSG_BYTE)(val & 0xff);
-    break;
-  }
-}
-
-/**
- * Unpack a 8/16/32-bit constant from a buffer in big-endian format
- * @src: buffer
- * @size: constant size in bytes (1, 2, or 4)
- */
-BSG_UINT32 BSG_UnpackConst(const BSG_BYTE* src, int size) {
-  BSG_UINT32 val = 0;
-  
-  if (src == NULL) 
-    return 0;
-  
-  switch (size) {
-  case 4:
-    val = (((BSG_UINT32) src[0]) << 24
-	   | ((BSG_UINT32) src[1]) << 16
-	   | ((BSG_UINT32) src[2]) << 8
-	   | (BSG_UINT32) src[3]);
-    break;
-  case 2:
-    val = (((BSG_UINT32) src[0]) << 8 | (BSG_UINT32) src[1]);
-    break;
-  case 1:
-    val = (BSG_UINT32) src[0];
-    break;
-  }  
-  return val;
-}
-
-// Pack a list of parameters. Beware not to send values, but rather you must
-// send a pointer to your values Instead. This includes UINT32's.
-int BSG_PackList( BSG_BYTE* dst, int ParamCount, ... ) {
-  int ParamNumber;
-  BSG_Type format; 
-  BSG_BYTE* val = NULL;
-  int size=0;
-  
-  va_list paramList;
-  va_start( paramList, ParamCount );
-
-  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
-    //Strangeness with int is because gcc wanted an int rather than a enum of ints.
-    format =  (BSG_Type) va_arg( paramList, int );
-    val = va_arg( paramList, BSG_BYTE* );    
-    size += BSG_Pack(format, val, dst == NULL ? NULL : dst + size);
-  }
-  
-  va_end (paramList);
-  
-  return size;
-}
-
-// Unpack a list of parameters. 
-int BSG_UnpackList( const BSG_BYTE* src, int ParamCount, ... ) {
-  int ParamNumber = 0;
-  BSG_Type format; 
-  BSG_BYTE* val = NULL;
-  int size = 0;
-  
-  va_list paramList;
-  va_start( paramList, ParamCount );
-  
-  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
-    format = (BSG_Type) va_arg( paramList, int );
-    val  = va_arg( paramList, BSG_BYTE* );
-    
-    size += BSG_Unpack(format, src + size, val);
-  }
-  
-  va_end( paramList );   
-  
-  return size;
-}
-
-// Destroy any memory allocated by calls to unpack 
-void BSG_DestroyList(int ParamCount, ... ) {
-  int ParamNumber = 0;
-  BSG_Type argType; 
-  BSG_BYTE* paramValue = NULL;
-  
-  va_list paramList;
-  va_start( paramList, ParamCount );
-  
-  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
-    argType = (BSG_Type) va_arg( paramList, int );
-    paramValue  = va_arg( paramList, BSG_BYTE* );
-    
-    BSG_Destroy(argType, paramValue);
-  }
-  
-  va_end( paramList );   
-  
-  return;
-}
-
-
-// and a tuple version
-TPM_RESULT BSG_DestroyTuple (int numParams, pack_tuple_t params[]) {
-  int i;
-  
-  for (i = 0; i < numParams; i++)
-    BSG_Destroy (params[i].type, params[i].addr);
-
-  return TPM_SUCCESS;
-}
-
-
-//
-// wrappers of Pack and PackList which malloc the ouput buffer. to be freed
-// by the caller later
-//
-
-int BSG_PackMalloc (BSG_Type type, const void* src, BSG_BYTE** o_dst) {
-  int size = BSG_Pack (type, src, NULL);
-  BSG_BYTE * dest = (BSG_BYTE*) malloc (size);
-  if (dest == NULL)
-    return -1;
-
-  size = BSG_Pack(type, src, dest);
-  *o_dst = dest;
-  return size;
-}
-
-
-
-int BSG_PackListMalloc(BSG_BYTE** outBuffer, int ParamCount, ... ) {
-  va_list args;
-  int size;
-  
-  va_start (args, ParamCount);
-  size = BSG_PackList (NULL, ParamCount, args);
-  va_end (args);
-  
-  BSG_BYTE * dest = (BSG_BYTE*) malloc (size);
-  if (dest == NULL)
-    return -1;
-
-  va_start (args, ParamCount);
-  size = BSG_PackList (dest, ParamCount, args);
-  va_end (args);
-  
-  *outBuffer = dest;
-  return size;
-}
diff --git a/tools/vtpm_manager/util/bsg.h b/tools/vtpm_manager/util/bsg.h
deleted file mode 100644
index 0896812..0000000
--- a/tools/vtpm_manager/util/bsg.h
+++ /dev/null
@@ -1,166 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// bsg.h
-// 
-//  This file contains API's for the TPM Byte Stream functions
-//
-// ==================================================================
-
-#ifndef __BSG_H__
-#define __BSG_H__
-
-#include <stdarg.h>
-#include "buffer.h"
-
-typedef unsigned int BSG_UINT32;
-typedef unsigned char BSG_BYTE;
-
-// forward decl
-struct pack_const_tuple_t;
-
-struct pack_tuple_t;
-
-
-/**
- * Byte stream generator
- */
-// this has to be manually kept in sync with the
-// s_fmt array!!
-// but now we have a self-check function which can make sure things are well
-// (if used!) 
-typedef enum BSG_Type
-{ 
-  BSG_TYPE_FIRST = 1,
-  BSG_TYPE_UINT32 = 1, // start at 1 so that Type 0 only serves as an
-                       // unused/special value
-  BSG_TYPE_UINT16,
-  BSG_TYPE_BYTE,
-  BSG_TYPE_BOOL,
-  BSG_TPM_SIZE32_DATA,  // a 32 bit unsigned size, followed by
-                        // a pointer to that much data. can pass a
-                        // struct pack_buf_t as the param
-  BSG_TPM_TAG,
-  BSG_TPM_HANDLE,
-  BSG_TPM_RESULT,
-  BSG_TPM_RESOURCE_TYPE,
-  BSG_TPM_COMMAND_CODE,
-  BSG_TPM_AUTH_DATA_USAGE,
-  BSG_TPM_ALGORITHM_ID,
-  BSG_TPM_PROTOCOL_ID,
-  BSG_TPM_KEY_USAGE,
-  BSG_TPM_ENC_SCHEME,
-  BSG_TPM_SIG_SCHEME,
-  BSG_TPM_MIGRATE_SCHEME,
-  BSG_TPM_KEY_FLAGS,
-  BSG_TPM_AUTHDATA,
-  BSG_TPM_SECRET,
-  BSG_TPM_ENCAUTH,
-  BSG_TPM_PAYLOAD_TYPE,
-  
-  BSG_TPM_VERSION,
-  BSG_TPM_DIGEST,
-  BSG_TPM_COMPOSITE_HASH,
-  BSG_TPM_CHOSENID_HASH,
-  BSG_TPM_NONCE,
-  BSG_TPM_KEY_HANDLE,
-  BSG_TPM_KEY_HANDLE_LIST,
-  BSG_TPM_KEY_PARMS,
-  BSG_TPM_RSA_KEY_PARMS,
-  BSG_TPM_STORE_PUBKEY,
-  BSG_TPM_PUBKEY,
-  BSG_TPM_KEY,
-  
-  BSG_TPM_MIGRATIONKEYAUTH,
-  BSG_TCPA_AUDIT_EVENT,
-  BSG_TCPA_EVENT_CERT,
-  BSG_TPM_PCR_SELECTION,
-  BSG_TPM_PCR_COMPOSITE,
-  BSG_TPM_PCR_INFO,
-  BSG_TPM_STORED_DATA,
-  BSG_TPM_SYMMETRIC_KEY,
-  BSG_TPM_STORE_PRIVKEY,
-  BSG_TPM_STORE_ASYMKEY,
-  BSG_TPM_MIGRATE_ASYMKEY,
-  BSG_TPM_QUOTE_INFO,
-  BSG_TPM_IDENTITY_CONTENTS,
-  BSG_TPM_PCRVALUE,
-  BSG_TCPA_PCR_FLAGS,
-  BSG_TCS_AUTH,
-  
-  // this is the BSG_TPM_KEY struct without the encData field
-  BSG_TPM_KEY_NONSENSITIVE,
-  
-  BSG_PACKED,
-  
-  BSG_TYPE_MAX
-} BSG_Type;
-
-struct pack_const_tuple_t {
-  BSG_Type type;
-  const void * addr;
-};
-
-
-typedef struct pack_tuple_t {
-  BSG_Type type;
-  void * addr;
-} pack_tuple_t;
-
-int BSG_Pack(BSG_Type type, const void* src, BSG_BYTE* dst);
-int BSG_Unpack(BSG_Type type, const BSG_BYTE* src, void* dst);
-void BSG_Destroy(BSG_Type type, void* src);
-
-// wrappers of Pack and PackList which malloc the ouput buffer. to be freed
-// by the caller later. returns size of allocated buffer, or -1 in case
-// allocation failed
-int BSG_PackMalloc (BSG_Type type, const void* src, BSG_BYTE** o_dst);
-int BSG_PackListMalloc (BSG_BYTE** outBuffer, int ParamCount, ... );
-
-// a va_list version of PackList
-int BSG_PackList(BSG_BYTE* outBuffer, int ParamCount, ... );
-int BSG_UnpackList(const BSG_BYTE* inBuffer, int ParamCount, ... );
-void BSG_DestroyList(int ParamCount, ... );
-
-// wrapper of PackList which uses a buffer_t
-TPM_RESULT BSG_PackListBuf (buffer_t * o_buf, int ParamCount, ...);
-
-// and a tuple version
-TPM_RESULT BSG_DestroyTuple (int numParams, pack_tuple_t params[]);
-
-void BSG_PackConst(BSG_UINT32 val, int size, BSG_BYTE* dst);
-BSG_UINT32 BSG_UnpackConst(const BSG_BYTE* src, int size);
-
-BOOL BSG_static_selfcheck ();
-
-#endif
diff --git a/tools/vtpm_manager/util/buffer.c b/tools/vtpm_manager/util/buffer.c
deleted file mode 100644
index df48bc2..0000000
--- a/tools/vtpm_manager/util/buffer.c
+++ /dev/null
@@ -1,226 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-
-
-#include <stdarg.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/param.h>
-
-#include "tcg.h"
-#include "bsg.h"
-#include "buffer.h"
-
-static TPM_RESULT buffer_priv_realloc (buffer_t * buf, tpm_size_t newsize);
-
-//
-// buffer functions!
-//
-
-TPM_RESULT buffer_init (buffer_t * buf, tpm_size_t initsize, const BYTE* initval) {
-  if (initsize == 0) {
-    memset(buf, 0, sizeof(*buf));
-    return TPM_SUCCESS;
-  }
-  
-  
-  buf->bytes = (BYTE*) malloc (initsize);
-  if (buf->bytes == NULL) 
-    return TPM_RESOURCES;
-  
-  buf->size = initsize;
-  buf->alloc_size = initsize;
-  
-  if (initval)
-    memcpy (buf->bytes, initval, initsize);
-  
-  buf->is_owner = TRUE;
-  
-  return TPM_SUCCESS;
-}
-
-TPM_RESULT buffer_init_convert (buffer_t * buf, tpm_size_t initsize, BYTE* initval) {
-  
-  buf->size = initsize;
-  buf->alloc_size = initsize;
-  buf->bytes = initval;
-  
-  buf->is_owner = TRUE;
-  
-  return TPM_SUCCESS;
-}
-
-TPM_RESULT buffer_init_copy (buffer_t * buf, const buffer_t * src) {
-  TPM_RESULT status = buffer_init (buf, src->size, src->bytes);
-  buf->is_owner = TRUE;
-  
-  return status;
-}
-
-
-
-// make an alias to a constant array
-TPM_RESULT buffer_init_const (buffer_t * buf, tpm_size_t size, const BYTE* val) {
-  // TODO: try to enforce the const things somehow!
-  buf->bytes = (BYTE*) val;
-  buf->size = size;
-  buf->alloc_size = 0;        // this field is now unneeded
-  
-  buf->is_owner = FALSE;
-  
-  return TPM_SUCCESS;
-}
-
-// make an alias into buf, with given offset and length
-// if len = 0, make the alias go to the end of buf
-TPM_RESULT buffer_init_alias (buffer_t * buf, const buffer_t * b,
-                              tpm_size_t offset, tpm_size_t len) {
-  if (offset + len > b->size) {
-    return TPM_NOSPACE;
-  }
-  
-  buf->bytes = b->bytes + offset;
-  buf->size = len > 0 ? len : b->size - offset;
-  
-  //VS/ buf->alloc_size = 0;
-  if (len ==0)
-    buf->alloc_size = b->alloc_size - offset;
-  else 
-    buf->alloc_size = MIN(b->alloc_size - offset, len);
-  
-        
-  buf->is_owner = FALSE;
-  
-  return TPM_SUCCESS;
-}
-
-// make an alias buffer_t into bytestream, with given length
-TPM_RESULT buffer_init_alias_convert (buffer_t * buf, tpm_size_t size, BYTE* val) {
-
-  buf->size = size;
-  buf->alloc_size = size;
-  buf->bytes = val;
-
-  buf->is_owner = FALSE;
-
-  return TPM_SUCCESS;
-}
-
- 
-
-// copy into the start of dest
-TPM_RESULT buffer_copy (buffer_t * dest, const buffer_t* src)
-{
-  TPM_RESULT status = TPM_SUCCESS;
-    
-  if (dest->alloc_size < src->size) {  
-    TPMTRYRETURN( buffer_priv_realloc (dest, src->size) );
-  }
-  
-  memcpy (dest->bytes, src->bytes, src->size);
-  dest->size = src->size;
-  
-  //VS/ dest->is_owner = TRUE;
-  
- abort_egress:
-
-  return status;
-}
-
-
-
-BOOL buffer_eq (const buffer_t * a, const buffer_t * b) {
-  return (a->size == b->size && memcmp (a->bytes, b->bytes, a->size) == 0);
-}
-
-
-void buffer_memset (buffer_t * buf, BYTE b) {
-  memset (buf->bytes, b, buf->size);
-}
-
-
-TPM_RESULT buffer_append_raw (buffer_t * buf, tpm_size_t len, const BYTE* bytes) {
-  TPM_RESULT status = TPM_SUCCESS;
-  
-  if (buf->alloc_size < buf->size + len) {
-    TPMTRYRETURN( buffer_priv_realloc (buf, buf->size + len) );
-  }
-  
-  memcpy (buf->bytes + buf->size, bytes, len);
-  
-  buf->size += len;
-  
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  
-  return status;
-}
-
-tpm_size_t buffer_len (const buffer_t* buf) {
-  return buf->size;
-}
-
-TPM_RESULT buffer_free (buffer_t * buf) {
-  if (buf && buf->is_owner && buf->bytes != NULL) {
-    free (buf->bytes);
-    buf->bytes = NULL;
-    buf->size = buf->alloc_size = 0;
-   
-  }
-  
-  return TPM_SUCCESS;
-}
-
-TPM_RESULT buffer_priv_realloc (buffer_t * buf, tpm_size_t newsize) {
-  
-  // we want to realloc to twice the size, or the new size, whichever
-  // bigger
-  
-  BYTE * tmpbuf = NULL;
-  
-  newsize = MAX (buf->alloc_size * 2, newsize);
-  
-  tmpbuf = (BYTE*) realloc (buf->bytes, newsize);
-  if (tmpbuf == NULL) 
-    return TPM_SIZE;
-  
-  
-  buf->bytes = tmpbuf;
-  buf->alloc_size = newsize;
-  
-  return TPM_SUCCESS;
-}
diff --git a/tools/vtpm_manager/util/buffer.h b/tools/vtpm_manager/util/buffer.h
deleted file mode 100644
index d8a9abc..0000000
--- a/tools/vtpm_manager/util/buffer.h
+++ /dev/null
@@ -1,95 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-
-#ifndef __VTPM_BUFFER_H__
-#define __VTPM_BUFFER_H__
-
-#include <stddef.h>             // for pointer NULL
-#include "tcg.h"
-
-typedef UINT32 tpm_size_t;
-
-// first version, probably will be expanded...
-
-#define NULL_BUF {0,0,0,0}
-
-typedef struct {
-  // private!!
-  tpm_size_t size, alloc_size;
-  BYTE * bytes;
-  
-  BOOL is_owner;              // do we own this buffer, and need to free it?
-} buffer_t;
-
-// allocate the buffer if initsize > 0, copying over initval if provided
-TPM_RESULT buffer_init (buffer_t * buf,
-                        tpm_size_t initsize,
-                        const BYTE* initval);
-
-// Create a new buffer from a BYTE *. Use buffer_free to destroy original BYTE *
-TPM_RESULT buffer_init_convert (buffer_t * buf, 
-                                tpm_size_t initsize, 
-                                BYTE* initval);
-
-// make an alias to a constant array, no copying
-TPM_RESULT buffer_init_const (buffer_t * buf, tpm_size_t size, const BYTE* val);
-
-// make an alias into buf, with given offset and length
-// if len = 0, make the alias go to the end of buf
-TPM_RESULT buffer_init_alias (buffer_t * buf, const buffer_t * b,
-                              tpm_size_t offset, tpm_size_t);
-
-// make an alias buffer into a bytestream
-TPM_RESULT buffer_init_alias_convert (buffer_t * buf, 
-                                      tpm_size_t size, BYTE* val);
-
-// "copy constructor"
-TPM_RESULT buffer_init_copy (buffer_t * buf, const buffer_t * src);
-
-
-// copy into the start of a
-TPM_RESULT buffer_copy (buffer_t * dest, const buffer_t* src);
-
-// are they equal?
-BOOL buffer_eq (const buffer_t * a, const buffer_t * b);
-
-// set the buffer to a constant byte
-void buffer_memset (buffer_t * buf, BYTE b);
-
-tpm_size_t buffer_len (const buffer_t* buf);
-
-TPM_RESULT buffer_free (buffer_t * buf);
-
-TPM_RESULT buffer_append_raw (buffer_t * buf, tpm_size_t len, const BYTE* bytes);
-
-#endif // _TOOLS_H_
diff --git a/tools/vtpm_manager/util/hashtable.c b/tools/vtpm_manager/util/hashtable.c
deleted file mode 100644
index aff0e2b..0000000
--- a/tools/vtpm_manager/util/hashtable.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * Copyright (c) 2005, Intel Corp
- * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk> 
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 
- * * Neither the name of the original author; nor the names of any contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
- * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*
- * There are duplicates of this code in:
- *  - tools/xenstore/hashtable.c
- *  - tools/blktap2/drivers/hashtable.c
- */
-
-#include "hashtable.h"
-#include "hashtable_private.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-/*
-Credit for primes table: Aaron Krowne
- http://br.endernet.org/~akrowne/
- http://planetmath.org/encyclopedia/GoodHashTablePrimes.html
-*/
-static const unsigned int primes[] = {
-53, 97, 193, 389,
-769, 1543, 3079, 6151,
-12289, 24593, 49157, 98317,
-196613, 393241, 786433, 1572869,
-3145739, 6291469, 12582917, 25165843,
-50331653, 100663319, 201326611, 402653189,
-805306457, 1610612741
-};
-const unsigned int prime_table_length = sizeof(primes)/sizeof(primes[0]);
-const float max_load_factor = 0.65;
-
-/*****************************************************************************/
-struct hashtable *
-create_hashtable(unsigned int minsize,
-                 unsigned int (*hashf) (void*),
-                 int (*eqf) (void*,void*))
-{
-    struct hashtable *h;
-    unsigned int pindex, size = primes[0];
-    /* Check requested hashtable isn't too large */
-    if (minsize > (1u << 30)) return NULL;
-    /* Enforce size as prime */
-    for (pindex=0; pindex < prime_table_length; pindex++) {
-        if (primes[pindex] > minsize) { size = primes[pindex]; break; }
-    }
-    h = (struct hashtable *)malloc(sizeof(struct hashtable));
-    if (NULL == h) return NULL; /*oom*/
-    h->table = (struct entry **)malloc(sizeof(struct entry*) * size);
-    if (NULL == h->table) { free(h); return NULL; } /*oom*/
-    memset(h->table, 0, size * sizeof(struct entry *));
-    h->tablelength  = size;
-    h->primeindex   = pindex;
-    h->entrycount   = 0;
-    h->hashfn       = hashf;
-    h->eqfn         = eqf;
-    h->loadlimit    = (unsigned int) ceil(size * max_load_factor);
-#ifdef HASHTABLE_THREADED    
-    pthread_mutex_init(&h->mutex, NULL);
-#endif
-    return h;
-}
-
-/*****************************************************************************/
-unsigned int
-hash(struct hashtable *h, void *k)
-{
-    unsigned int i = h->hashfn(k);
-    i += ~(i << 9);
-    i ^=  ((i >> 14) | (i << 18)); /* >>> */
-    i +=  (i << 4);
-    i ^=  ((i >> 10) | (i << 22)); /* >>> */
-    return i;
-}
-
-/*****************************************************************************/
-static int
-hashtable_expand(struct hashtable *h)
-{
-    /* Double the size of the table to accomodate more entries */
-    struct entry **newtable;
-    struct entry *e;
-    struct entry **pE;
-    unsigned int newsize, i, index;
-    /* Check we're not hitting max capacity */
-    if (h->primeindex == (prime_table_length - 1)) return 0;
-    newsize = primes[++(h->primeindex)];
-
-    newtable = (struct entry **)malloc(sizeof(struct entry*) * newsize);
-    if (NULL != newtable)
-    {
-        memset(newtable, 0, newsize * sizeof(struct entry *));
-        /* This algorithm is not 'stable'. ie. it reverses the list
-         * when it transfers entries between the tables */
-        for (i = 0; i < h->tablelength; i++) {
-            while (NULL != (e = h->table[i])) {
-                h->table[i] = e->next;
-                index = indexFor(newsize,e->h);
-                e->next = newtable[index];
-                newtable[index] = e;
-            }
-        }
-        free(h->table);
-        h->table = newtable;
-    }
-    /* Plan B: realloc instead */
-    else 
-    {
-        newtable = (struct entry **)
-                   realloc(h->table, newsize * sizeof(struct entry *));
-        if (NULL == newtable) { (h->primeindex)--; return 0; }
-        h->table = newtable;
-        memset(newtable[h->tablelength], 0, newsize - h->tablelength);
-        for (i = 0; i < h->tablelength; i++) {
-            for (pE = &(newtable[i]), e = *pE; e != NULL; e = *pE) {
-                index = indexFor(newsize,e->h);
-                if (index == i)
-                {
-                    pE = &(e->next);
-                }
-                else
-                {
-                    *pE = e->next;
-                    e->next = newtable[index];
-                    newtable[index] = e;
-                }
-            }
-        }
-    }
-    h->tablelength = newsize;
-    h->loadlimit   = (unsigned int) ceil(newsize * max_load_factor);
-    return -1;
-}
-
-/*****************************************************************************/
-unsigned int
-hashtable_count(struct hashtable *h)
-{
-    unsigned int count;
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_lock(&h->mutex);
-#endif    
-    count = h->entrycount;
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_unlock(&h->mutex);
-#endif
-    return count;
-}
-
-/*****************************************************************************/
-int
-hashtable_insert(struct hashtable *h, void *k, void *v)
-{
-    /* This method allows duplicate keys - but they shouldn't be used */
-    unsigned int index;
-    struct entry *e;
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_lock(&h->mutex);
-#endif   
-    if (++(h->entrycount) > h->loadlimit)
-    {
-        /* Ignore the return value. If expand fails, we should
-         * still try cramming just this value into the existing table
-         * -- we may not have memory for a larger table, but one more
-         * element may be ok. Next time we insert, we'll try expanding again.*/
-        hashtable_expand(h);
-    }
-    e = (struct entry *)malloc(sizeof(struct entry));
-    if (NULL == e) { --(h->entrycount); return 0; } /*oom*/
-    e->h = hash(h,k);
-    index = indexFor(h->tablelength,e->h);
-    e->k = k;
-    e->v = v;
-    e->next = h->table[index];
-    h->table[index] = e;
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_unlock(&h->mutex);
-#endif   
-    return -1;
-}
-
-/*****************************************************************************/
-void * /* returns value associated with key */
-hashtable_search(struct hashtable *h, void *k)
-{
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_lock(&h->mutex);
-#endif   
-    struct entry *e;
-    unsigned int hashvalue, index;
-    hashvalue = hash(h,k);
-    index = indexFor(h->tablelength,hashvalue);
-    e = h->table[index];
-    while (NULL != e)
-    {
-        /* Check hash value to short circuit heavier comparison */
-        if ((hashvalue == e->h) && (h->eqfn(k, e->k))) {
-#ifdef HASHTABLE_THREADED
-          pthread_mutex_unlock(&h->mutex);
-#endif   
-          return e->v;
-        }
-        e = e->next;
-    }
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_unlock(&h->mutex);
-#endif   
-    return NULL;
-}
-
-/*****************************************************************************/
-void * /* returns value associated with key */
-hashtable_remove(struct hashtable *h, void *k)
-{
-    /* TODO: consider compacting the table when the load factor drops enough,
-     *       or provide a 'compact' method. */
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_lock(&h->mutex);
-#endif   
-    struct entry *e;
-    struct entry **pE;
-    void *v;
-    unsigned int hashvalue, index;
-
-    hashvalue = hash(h,k);
-    index = indexFor(h->tablelength,hash(h,k));
-    pE = &(h->table[index]);
-    e = *pE;
-    while (NULL != e)
-    {
-        /* Check hash value to short circuit heavier comparison */
-        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
-        {
-            *pE = e->next;
-            h->entrycount--;
-            v = e->v;
-            freekey(e->k);
-            free(e);
-            return v;
-        }
-        pE = &(e->next);
-        e = e->next;
-    }
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_unlock(&h->mutex);
-#endif   
-    return NULL;
-}
-
-/*****************************************************************************/
-/* destroy */
-void
-hashtable_destroy(struct hashtable *h, int free_values)
-{
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_lock(&h->mutex);
-#endif   
-    unsigned int i;
-    struct entry *e, *f;
-    struct entry **table = h->table;
-    if (free_values)
-    {
-        for (i = 0; i < h->tablelength; i++)
-        {
-            e = table[i];
-            while (NULL != e)
-            { f = e; e = e->next; freekey(f->k); free(f->v); free(f); }
-        }
-    }
-    else
-    {
-        for (i = 0; i < h->tablelength; i++)
-        {
-            e = table[i];
-            while (NULL != e)
-            { f = e; e = e->next; freekey(f->k); free(f); }
-        }
-    }
-    free(h->table);
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_destroy(&h->mutex);
-#endif   
-    free(h);
-}
diff --git a/tools/vtpm_manager/util/hashtable.h b/tools/vtpm_manager/util/hashtable.h
deleted file mode 100644
index dedc60a..0000000
--- a/tools/vtpm_manager/util/hashtable.h
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright (c) 2005, Intel Corp
- * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk> 
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 
- * * Neither the name of the original author; nor the names of any contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
- * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*
- * There are duplicates of this code in:
- *  - tools/xenstore/hashtable.h
- *  - tools/blktap2/drivers/hashtable.h
- */
-
-#ifndef __HASHTABLE_CWC22_H__
-#define __HASHTABLE_CWC22_H__
-
-struct hashtable;
-
-/* Example of use:
- *
- *      struct hashtable  *h;
- *      struct some_key   *k;
- *      struct some_value *v;
- *
- *      static unsigned int         hash_from_key_fn( void *k );
- *      static int                  keys_equal_fn ( void *key1, void *key2 );
- *
- *      h = create_hashtable(16, hash_from_key_fn, keys_equal_fn);
- *      k = (struct some_key *)     malloc(sizeof(struct some_key));
- *      v = (struct some_value *)   malloc(sizeof(struct some_value));
- *
- *      (initialise k and v to suitable values)
- * 
- *      if (! hashtable_insert(h,k,v) )
- *      {     exit(-1);               }
- *
- *      if (NULL == (found = hashtable_search(h,k) ))
- *      {    printf("not found!");                  }
- *
- *      if (NULL == (found = hashtable_remove(h,k) ))
- *      {    printf("Not found\n");                 }
- *
- */
-
-/* Macros may be used to define type-safe(r) hashtable access functions, with
- * methods specialized to take known key and value types as parameters.
- * 
- * Example:
- *
- * Insert this at the start of your file:
- *
- * DEFINE_HASHTABLE_INSERT(insert_some, struct some_key, struct some_value);
- * DEFINE_HASHTABLE_SEARCH(search_some, struct some_key, struct some_value);
- * DEFINE_HASHTABLE_REMOVE(remove_some, struct some_key, struct some_value);
- *
- * This defines the functions 'insert_some', 'search_some' and 'remove_some'.
- * These operate just like hashtable_insert etc., with the same parameters,
- * but their function signatures have 'struct some_key *' rather than
- * 'void *', and hence can generate compile time errors if your program is
- * supplying incorrect data as a key (and similarly for value).
- *
- * Note that the hash and key equality functions passed to create_hashtable
- * still take 'void *' parameters instead of 'some key *'. This shouldn't be
- * a difficult issue as they're only defined and passed once, and the other
- * functions will ensure that only valid keys are supplied to them.
- *
- * The cost for this checking is increased code size and runtime overhead
- * - if performance is important, it may be worth switching back to the
- * unsafe methods once your program has been debugged with the safe methods.
- * This just requires switching to some simple alternative defines - eg:
- * #define insert_some hashtable_insert
- *
- */
-
-/*****************************************************************************
- * create_hashtable
-   
- * @name                    create_hashtable
- * @param   minsize         minimum initial size of hashtable
- * @param   hashfunction    function for hashing keys
- * @param   key_eq_fn       function for determining key equality
- * @return                  newly created hashtable or NULL on failure
- */
-
-struct hashtable *
-create_hashtable(unsigned int minsize,
-                 unsigned int (*hashfunction) (void*),
-                 int (*key_eq_fn) (void*,void*));
-
-/*****************************************************************************
- * hashtable_insert
-   
- * @name        hashtable_insert
- * @param   h   the hashtable to insert into
- * @param   k   the key - hashtable claims ownership and will free on removal
- * @param   v   the value - does not claim ownership
- * @return      non-zero for successful insertion
- *
- * This function will cause the table to expand if the insertion would take
- * the ratio of entries to table size over the maximum load factor.
- *
- * This function does not check for repeated insertions with a duplicate key.
- * The value returned when using a duplicate key is undefined -- when
- * the hashtable changes size, the order of retrieval of duplicate key
- * entries is reversed.
- * If in doubt, remove before insert.
- */
-
-int 
-hashtable_insert(struct hashtable *h, void *k, void *v);
-
-#define DEFINE_HASHTABLE_INSERT(fnname, keytype, valuetype) \
-int fnname (struct hashtable *h, keytype *k, valuetype *v) \
-{ \
-    return hashtable_insert(h,k,v); \
-}
-
-/*****************************************************************************
- * hashtable_search
-   
- * @name        hashtable_search
- * @param   h   the hashtable to search
- * @param   k   the key to search for  - does not claim ownership
- * @return      the value associated with the key, or NULL if none found
- */
-
-void *
-hashtable_search(struct hashtable *h, void *k);
-
-#define DEFINE_HASHTABLE_SEARCH(fnname, keytype, valuetype) \
-valuetype * fnname (struct hashtable *h, keytype *k) \
-{ \
-    return (valuetype *) (hashtable_search(h,k)); \
-}
-
-/*****************************************************************************
- * hashtable_remove
-   
- * @name        hashtable_remove
- * @param   h   the hashtable to remove the item from
- * @param   k   the key to search for  - does not claim ownership
- * @return      the value associated with the key, or NULL if none found
- */
-
-void * /* returns value */
-hashtable_remove(struct hashtable *h, void *k);
-
-#define DEFINE_HASHTABLE_REMOVE(fnname, keytype, valuetype) \
-valuetype * fnname (struct hashtable *h, keytype *k) \
-{ \
-    return (valuetype *) (hashtable_remove(h,k)); \
-}
-
-
-/*****************************************************************************
- * hashtable_count
-   
- * @name        hashtable_count
- * @param   h   the hashtable
- * @return      the number of items stored in the hashtable
- */
-unsigned int
-hashtable_count(struct hashtable *h);
-
-
-/*****************************************************************************
- * hashtable_destroy
-   
- * @name        hashtable_destroy
- * @param   h   the hashtable
- * @param       free_values     whether to call 'free' on the remaining values
- */
-
-void
-hashtable_destroy(struct hashtable *h, int free_values);
-
-#endif /* __HASHTABLE_CWC22_H__ */
diff --git a/tools/vtpm_manager/util/hashtable_itr.c b/tools/vtpm_manager/util/hashtable_itr.c
deleted file mode 100644
index dcf42c8..0000000
--- a/tools/vtpm_manager/util/hashtable_itr.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (c) 2005, Intel Corp
- * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk> 
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 
- * * Neither the name of the original author; nor the names of any contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
- * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*
- * There are duplicates of this code in:
- *  - tools/blktap2/drivers/hashtable_itr.c
- */
-
-#include "hashtable.h"
-#include "hashtable_private.h"
-#include "hashtable_itr.h"
-#include <stdlib.h> /* defines NULL */
-
-/*****************************************************************************/
-/* hashtable_iterator    - iterator constructor */
-
-struct hashtable_itr *
-hashtable_iterator(struct hashtable *h)
-{
-    unsigned int i, tablelength;
-    struct hashtable_itr *itr = (struct hashtable_itr *)
-        malloc(sizeof(struct hashtable_itr));
-    if (NULL == itr) return NULL;
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_lock(&h->mutex);
-#endif   
-    itr->h = h;
-    itr->e = NULL;
-    itr->parent = NULL;
-    tablelength = h->tablelength;
-    itr->index = tablelength;
-    if (0 == h->entrycount) {
-#ifdef HASHTABLE_THREADED
-      pthread_mutex_unlock(&h->mutex);
-#endif   
-      return itr;
-    }
-
-    for (i = 0; i < tablelength; i++)
-    {
-        if (NULL != h->table[i])
-        {
-            itr->e = h->table[i];
-            itr->index = i;
-            break;
-        }
-    }
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_unlock(&h->mutex);
-#endif   
-    return itr;
-}
-
-/*****************************************************************************/
-/* key      - return the key of the (key,value) pair at the current position */
-/* value    - return the value of the (key,value) pair at the current position */
-
-void *
-hashtable_iterator_key(struct hashtable_itr *i)
-{ return i->e->k; }
-
-void *
-hashtable_iterator_value(struct hashtable_itr *i)
-{ return i->e->v; }
-
-/*****************************************************************************/
-/* advance - advance the iterator to the next element
- *           returns zero if advanced to end of table */
-
-int
-hashtable_iterator_advance(struct hashtable_itr *itr)
-{
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_lock(&itr->h->mutex);
-#endif   
-    unsigned int j,tablelength;
-    struct entry **table;
-    struct entry *next;
-    int ret;
-    if (NULL == itr->e) { /* stupidity check */
-      ret = 0; 
-      goto egress;
-    }
-
-    next = itr->e->next;
-    if (NULL != next)
-    {
-        itr->parent = itr->e;
-        itr->e = next;
-        ret = -1;
-        goto egress;
-    }
-
-    tablelength = itr->h->tablelength;
-    itr->parent = NULL;
-    if (tablelength <= (j = ++(itr->index)))
-    {
-        itr->e = NULL;
-        ret = 0;
-        goto egress;
-    }
-    table = itr->h->table;
-    while (NULL == (next = table[j]))
-    {
-        if (++j >= tablelength)
-        {
-            itr->index = tablelength;
-            itr->e = NULL;
-            ret = 0;
-            goto egress;
-        }
-    }
-    itr->index = j;
-    itr->e = next;
-    ret = -1;
-
- egress:
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_unlock(&itr->h->mutex);
-#endif   
-    return ret;
-}
-
-/*****************************************************************************/
-/* remove - remove the entry at the current iterator position
- *          and advance the iterator, if there is a successive
- *          element.
- *          If you want the value, read it before you remove:
- *          beware memory leaks if you don't.
- *          Returns zero if end of iteration. */
-
-int
-hashtable_iterator_remove(struct hashtable_itr *itr)
-{
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_lock(&itr->h->mutex);
-#endif 
-    struct entry *remember_e, *remember_parent;
-    int ret;
-
-    /* Do the removal */
-    if (NULL == (itr->parent))
-    {
-        /* element is head of a chain */
-        itr->h->table[itr->index] = itr->e->next;
-    } else {
-        /* element is mid-chain */
-        itr->parent->next = itr->e->next;
-    }
-    /* itr->e is now outside the hashtable */
-    remember_e = itr->e;
-    itr->h->entrycount--;
-    freekey(remember_e->k);
-
-    /* Advance the iterator, correcting the parent */
-    remember_parent = itr->parent;
-    ret = hashtable_iterator_advance(itr);
-    if (itr->parent == remember_e) { itr->parent = remember_parent; }
-    free(remember_e);
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_unlock(&itr->h->mutex);
-#endif 
-    return ret;
-}
-
-/*****************************************************************************/
-int /* returns zero if not found */
-hashtable_iterator_search(struct hashtable_itr *itr,
-                          struct hashtable *h, void *k)
-{
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_lock(&h->mutex);
-#endif 
-    struct entry *e, *parent;
-    unsigned int hashvalue, index;
-    int ret;
-    
-    hashvalue = hash(h,k);
-    index = indexFor(h->tablelength,hashvalue);
-
-    e = h->table[index];
-    parent = NULL;
-    while (NULL != e)
-    {
-        /* Check hash value to short circuit heavier comparison */
-        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
-        {
-            itr->index = index;
-            itr->e = e;
-            itr->parent = parent;
-            itr->h = h;
-            ret= -1;
-            goto egress;
-        }
-        parent = e;
-        e = e->next;
-    }
-  ret = 0;
-    
-egress:
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_unlock(&h->mutex);
-#endif 
-    return ret;
-}
diff --git a/tools/vtpm_manager/util/hashtable_itr.h b/tools/vtpm_manager/util/hashtable_itr.h
deleted file mode 100644
index 35654e0..0000000
--- a/tools/vtpm_manager/util/hashtable_itr.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2005, Intel Corp
- * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk> 
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 
- * * Neither the name of the original author; nor the names of any contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
- * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*
- * There are duplicates of this code in:
- *  - tools/blktap2/drivers/hashtable_itr.h
- */
-
-
-#ifndef __HASHTABLE_ITR_CWC22__
-#define __HASHTABLE_ITR_CWC22__
-#include "hashtable.h"
-#include "hashtable_private.h" /* needed to enable inlining */
-
-/*****************************************************************************/
-/* This struct is only concrete here to allow the inlining of two of the
- * accessor functions. */
-struct hashtable_itr
-{
-    struct hashtable *h;
-    struct entry *e;
-    struct entry *parent;
-    unsigned int index;
-};
-
-
-/*****************************************************************************/
-/* hashtable_iterator
- */
-
-struct hashtable_itr *
-hashtable_iterator(struct hashtable *h);
-
-/*****************************************************************************/
-/* hashtable_iterator_key
- * - return the value of the (key,value) pair at the current position */
-
-void *hashtable_iterator_key(struct hashtable_itr *i);
-
-/*****************************************************************************/
-/* value - return the value of the (key,value) pair at the current position */
-
-void *hashtable_iterator_value(struct hashtable_itr *i);
-
-/*****************************************************************************/
-/* advance - advance the iterator to the next element
- *           returns zero if advanced to end of table */
-
-int
-hashtable_iterator_advance(struct hashtable_itr *itr);
-
-/*****************************************************************************/
-/* remove - remove current element and advance the iterator to the next element
- *          NB: if you need the value to free it, read it before
- *          removing. ie: beware memory leaks!
- *          returns zero if advanced to end of table */
-
-int
-hashtable_iterator_remove(struct hashtable_itr *itr);
-
-/*****************************************************************************/
-/* search - overwrite the supplied iterator, to point to the entry
- *          matching the supplied key.
-            h points to the hashtable to be searched.
- *          returns zero if not found. */
-int
-hashtable_iterator_search(struct hashtable_itr *itr,
-                          struct hashtable *h, void *k);
-
-#define DEFINE_HASHTABLE_ITERATOR_SEARCH(fnname, keytype) \
-int fnname (struct hashtable_itr *i, struct hashtable *h, keytype *k) \
-{ \
-    return (hashtable_iterator_search(i,h,k)); \
-}
-
-
-
-#endif /* __HASHTABLE_ITR_CWC22__*/
diff --git a/tools/vtpm_manager/util/hashtable_private.h b/tools/vtpm_manager/util/hashtable_private.h
deleted file mode 100644
index d87a7f9..0000000
--- a/tools/vtpm_manager/util/hashtable_private.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2005, Intel Corp
- * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk> 
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 
- * * Neither the name of the original author; nor the names of any contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
- * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*
- * There are duplicates of this code in:
- *  - tools/xenstore/hashtable_private.h
- *  - tools/blktap2/drivers/hashtable_private.h
- */
-
-#ifndef __HASHTABLE_PRIVATE_CWC22_H__
-#define __HASHTABLE_PRIVATE_CWC22_H__
-
-#include "hashtable.h"
-#ifdef HASHTABLE_THREADED
-#include <pthread.h>
-#endif
-
-/*****************************************************************************/
-struct entry
-{
-    void *k, *v;
-    unsigned int h;
-    struct entry *next;
-};
-
-struct hashtable {
-    unsigned int tablelength;
-    struct entry **table;
-    unsigned int entrycount;
-    unsigned int loadlimit;
-    unsigned int primeindex;
-    unsigned int (*hashfn) (void *k);
-    int (*eqfn) (void *k1, void *k2);
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_t mutex;
-#endif
-};
-
-/*****************************************************************************/
-unsigned int
-hash(struct hashtable *h, void *k);
-
-/*****************************************************************************/
-/* indexFor */
-static inline unsigned int
-indexFor(unsigned int tablelength, unsigned int hashvalue) {
-    return (hashvalue % tablelength);
-};
-
-/* Only works if tablelength == 2^N */
-/*static inline unsigned int
-indexFor(unsigned int tablelength, unsigned int hashvalue)
-{
-    return (hashvalue & (tablelength - 1u));
-}
-*/
-
-/*****************************************************************************/
-#define freekey(X) free(X)
-/*define freekey(X) ; */
-
-
-/*****************************************************************************/
-
-#endif /* __HASHTABLE_PRIVATE_CWC22_H__*/
diff --git a/tools/vtpm_manager/util/log.c b/tools/vtpm_manager/util/log.c
deleted file mode 100644
index 75fe91a..0000000
--- a/tools/vtpm_manager/util/log.c
+++ /dev/null
@@ -1,142 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#include "buffer.h"
-#include "tcg.h"
-
-// Helper code for the consts, eg. to produce messages for error codes.
-
-typedef struct error_code_entry_t {
-  TPM_RESULT code;
-  char * code_name;
-  char * msg;
-} error_code_entry_t;
-
-static const error_code_entry_t error_msgs [] = {    
-  { TPM_SUCCESS, "TPM_SUCCESS", "Successful completion of the operation" },
-  { TPM_AUTHFAIL, "TPM_AUTHFAIL", "Authentication failed" },
-  { TPM_BADINDEX, "TPM_BADINDEX", "The index to a PCR, DIR or other register is incorrect" },
-  { TPM_BAD_PARAMETER, "TPM_BAD_PARAMETER", "One or more parameter is bad" },
-  { TPM_AUDITFAILURE, "TPM_AUDITFAILURE", "An operation completed successfully but the auditing of that operation failed." },
-  { TPM_CLEAR_DISABLED, "TPM_CLEAR_DISABLED", "The clear disable flag is set and all clear operations now require physical access" },
-  { TPM_DEACTIVATED, "TPM_DEACTIVATED", "The TPM is deactivated" },
-  { TPM_DISABLED, "TPM_DISABLED", "The TPM is disabled" },
-  { TPM_DISABLED_CMD, "TPM_DISABLED_CMD", "The target command has been disabled" },
-  { TPM_FAIL, "TPM_FAIL", "The operation failed" },
-  { TPM_BAD_ORDINAL, "TPM_BAD_ORDINAL", "The ordinal was unknown or inconsistent" },
-  { TPM_INSTALL_DISABLED, "TPM_INSTALL_DISABLED", "The ability to install an owner is disabled" },
-  { TPM_INVALID_KEYHANDLE, "TPM_INVALID_KEYHANDLE", "The key handle presented was invalid" },
-  { TPM_KEYNOTFOUND, "TPM_KEYNOTFOUND", "The target key was not found" },
-  { TPM_INAPPROPRIATE_ENC, "TPM_INAPPROPRIATE_ENC", "Unacceptable encryption scheme" },
-  { TPM_MIGRATEFAIL, "TPM_MIGRATEFAIL", "Migration authorization failed" },
-  { TPM_INVALID_PCR_INFO, "TPM_INVALID_PCR_INFO", "PCR information could not be interpreted" },
-  { TPM_NOSPACE, "TPM_NOSPACE", "No room to load key." },
-  { TPM_NOSRK, "TPM_NOSRK", "There is no SRK set" },
-  { TPM_NOTSEALED_BLOB, "TPM_NOTSEALED_BLOB", "An encrypted blob is invalid or was not created by this TPM" },
-  { TPM_OWNER_SET, "TPM_OWNER_SET", "There is already an Owner" },
-  { TPM_RESOURCES, "TPM_RESOURCES", "The TPM has insufficient internal resources to perform the requested action." },
-  { TPM_SHORTRANDOM, "TPM_SHORTRANDOM", "A random string was too short" },
-  { TPM_SIZE, "TPM_SIZE", "The TPM does not have the space to perform the operation." },
-  { TPM_WRONGPCRVAL, "TPM_WRONGPCRVAL", "The named PCR value does not match the current PCR value." },
-  { TPM_BAD_PARAM_SIZE, "TPM_BAD_PARAM_SIZE", "The paramSize argument to the command has the incorrect value" },
-  { TPM_SHA_THREAD, "TPM_SHA_THREAD", "There is no existing SHA-1 thread." },
-  { TPM_SHA_ERROR, "TPM_SHA_ERROR", "The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error." },
-  { TPM_FAILEDSELFTEST, "TPM_FAILEDSELFTEST", "Self-test has failed and the TPM has shutdown." },
-  { TPM_AUTH2FAIL, "TPM_AUTH2FAIL", "The authorization for the second key in a 2 key function failed authorization" },
-  { TPM_BADTAG, "TPM_BADTAG", "The tag value sent to for a command is invalid" },
-  { TPM_IOERROR, "TPM_IOERROR", "An IO error occurred transmitting information to the TPM" },
-  { TPM_ENCRYPT_ERROR, "TPM_ENCRYPT_ERROR", "The encryption process had a problem." },
-  { TPM_DECRYPT_ERROR, "TPM_DECRYPT_ERROR", "The decryption process did not complete." },
-  { TPM_INVALID_AUTHHANDLE, "TPM_INVALID_AUTHHANDLE", "An invalid handle was used." },
-  { TPM_NO_ENDORSEMENT, "TPM_NO_ENDORSEMENT", "The TPM does not a EK installed" },
-  { TPM_INVALID_KEYUSAGE, "TPM_INVALID_KEYUSAGE", "The usage of a key is not allowed" },
-  { TPM_WRONG_ENTITYTYPE, "TPM_WRONG_ENTITYTYPE", "The submitted entity type is not allowed" },
-  { TPM_INVALID_POSTINIT, "TPM_INVALID_POSTINIT", "The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup" },
-  { TPM_INAPPROPRIATE_SIG, "TPM_INAPPROPRIATE_SIG", "Signed data cannot include additional DER information" },
-  { TPM_BAD_KEY_PROPERTY, "TPM_BAD_KEY_PROPERTY", "The key properties in TPM_KEY_PARMs are not supported by this TPM" },
-  
-  { TPM_BAD_MIGRATION, "TPM_BAD_MIGRATION", "The migration properties of this key are incorrect." },
-  { TPM_BAD_SCHEME, "TPM_BAD_SCHEME", "The signature or encryption scheme for this key is incorrect or not permitted in this situation." },
-  { TPM_BAD_DATASIZE, "TPM_BAD_DATASIZE", "The size of the data (or blob) parameter is bad or inconsistent with the referenced key" },
-  { TPM_BAD_MODE, "TPM_BAD_MODE", "A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob." },
-  { TPM_BAD_PRESENCE, "TPM_BAD_PRESENCE", "Either the physicalPresence or physicalPresenceLock bits have the wrong value" },
-  { TPM_BAD_VERSION, "TPM_BAD_VERSION", "The TPM cannot perform this version of the capability" },
-  { TPM_NO_WRAP_TRANSPORT, "TPM_NO_WRAP_TRANSPORT", "The TPM does not allow for wrapped transport sessions" },
-  { TPM_AUDITFAIL_UNSUCCESSFUL, "TPM_AUDITFAIL_UNSUCCESSFUL", "TPM audit construction failed and the underlying command was returning a failure code also" },
-  { TPM_AUDITFAIL_SUCCESSFUL, "TPM_AUDITFAIL_SUCCESSFUL", "TPM audit construction failed and the underlying command was returning success" },
-  { TPM_NOTRESETABLE, "TPM_NOTRESETABLE", "Attempt to reset a PCR register that does not have the resettable attribute" },
-  { TPM_NOTLOCAL, "TPM_NOTLOCAL", "Attempt to reset a PCR register that requires locality and locality modifier not part of command transport" },
-  { TPM_BAD_TYPE, "TPM_BAD_TYPE", "Make identity blob not properly typed" },
-  { TPM_INVALID_RESOURCE, "TPM_INVALID_RESOURCE", "When saving context identified resource type does not match actual resource" },
-  { TPM_NOTFIPS, "TPM_NOTFIPS", "The TPM is attempting to execute a command only available when in FIPS mode" },
-  { TPM_INVALID_FAMILY, "TPM_INVALID_FAMILY", "The command is attempting to use an invalid family ID" },
-  { TPM_NO_NV_PERMISSION, "TPM_NO_NV_PERMISSION", "The permission to manipulate the NV storage is not available" },
-  { TPM_REQUIRES_SIGN, "TPM_REQUIRES_SIGN", "The operation requires a signed command" },
-  { TPM_KEY_NOTSUPPORTED, "TPM_KEY_NOTSUPPORTED", "Wrong operation to load an NV key" },
-  { TPM_AUTH_CONFLICT, "TPM_AUTH_CONFLICT", "NV_LoadKey blob requires both owner and blob authorization" },
-  { TPM_AREA_LOCKED, "TPM_AREA_LOCKED", "The NV area is locked and not writtable" },
-  { TPM_BAD_LOCALITY, "TPM_BAD_LOCALITY", "The locality is incorrect for the attempted operation" },
-  { TPM_READ_ONLY, "TPM_READ_ONLY", "The NV area is read only and can't be written to" },
-  { TPM_PER_NOWRITE, "TPM_PER_NOWRITE", "There is no protection on the write to the NV area" },
-  { TPM_FAMILYCOUNT, "TPM_FAMILYCOUNT", "The family count value does not match" },
-  { TPM_WRITE_LOCKED, "TPM_WRITE_LOCKED", "The NV area has already been written to" },
-  { TPM_BAD_ATTRIBUTES, "TPM_BAD_ATTRIBUTES", "The NV area attributes conflict" },
-  { TPM_INVALID_STRUCTURE, "TPM_INVALID_STRUCTURE", "The structure tag and version are invalid or inconsistent" },
-  { TPM_KEY_OWNER_CONTROL, "TPM_KEY_OWNER_CONTROL", "The key is under control of the TPM Owner and can only be evicted by the TPM Owner." },
-  { TPM_BAD_COUNTER, "TPM_BAD_COUNTER", "The counter handle is incorrect" },
-  { TPM_NOT_FULLWRITE, "TPM_NOT_FULLWRITE", "The write is not a complete write of the area" },
-  { TPM_CONTEXT_GAP, "TPM_CONTEXT_GAP", "The gap between saved context counts is too large" },
-  { TPM_MAXNVWRITES, "TPM_MAXNVWRITES", "The maximum number of NV writes without an owner has been exceeded" },
-  { TPM_NOOPERATOR, "TPM_NOOPERATOR", "No operator authorization value is set" },
-  { TPM_RESOURCEMISSING, "TPM_RESOURCEMISSING", "The resource pointed to by context is not loaded" },
-  { TPM_DELEGATE_LOCK, "TPM_DELEGATE_LOCK", "The delegate administration is locked" },
-  { TPM_DELEGATE_FAMILY, "TPM_DELEGATE_FAMILY", "Attempt to manage a family other then the delegated family" },
-  { TPM_DELEGATE_ADMIN, "TPM_DELEGATE_ADMIN", "Delegation table management not enabled" },
-  { TPM_TRANSPORT_EXCLUSIVE, "TPM_TRANSPORT_EXCLUSIVE", "There was a command executed outside of an exclusive transport session" },
-};
-
-
-// helper function for the error codes:
-const char* tpm_get_error_name (TPM_RESULT code) {
-  // just do a linear scan for now
-  unsigned i;
-  for (i = 0; i < sizeof(error_msgs)/sizeof(error_msgs[0]); i++) 
-    if (code == error_msgs[i].code) 
-      return error_msgs[i].code_name;
-  
-    return("Unknown Error Code");
-}
diff --git a/tools/vtpm_manager/util/log.h b/tools/vtpm_manager/util/log.h
deleted file mode 100644
index 1f15f5b..0000000
--- a/tools/vtpm_manager/util/log.h
+++ /dev/null
@@ -1,94 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-
-#ifndef __VTPM_LOG_H__
-#define __VTPM_LOG_H__
-
-#include <stdint.h>             // for uint32_t
-#include <stddef.h>             // for pointer NULL
-
-// =========================== LOGGING ==============================
-
-// the logging module numbers
-#define VTPM_LOG_CRYPTO      1
-#define VTPM_LOG_BSG         2
-#define VTPM_LOG_TXDATA      3
-#define VTPM_LOG_TCS         4
-#define VTPM_LOG_TCS_DEEP    5
-#define VTPM_LOG_VTSP        6
-#define VTPM_LOG_VTPM        7
-#define VTPM_LOG_VTPM_DEEP   8
-#define VTPM_LOG_VTSP_DEEP   9
-
-static char *module_names[] = { "",
-                                "CRYPTO",
-                                "BSG",
-                                "TXDATA",
-                                "TCS",
-                                "TCS",
-                                "VTSP",
-                                "VTPM",
-                                "VTPM",
-                                "VTSP"
-                              };
-
-// Default to standard logging
-#ifndef LOGGING_MODULES
-#define LOGGING_MODULES (BITMASK(VTPM_LOG_VTPM))
-#endif
-
-// bit-access macros
-#define BITMASK(idx)      ( 1U << (idx) )
-#define GETBIT(num,idx)   ( ((num) & BITMASK(idx)) >> idx )
-#define SETBIT(num,idx)   (num) |= BITMASK(idx)
-#define CLEARBIT(num,idx) (num) &= ( ~ BITMASK(idx) )
-
-#define vtpmloginfo(module, fmt, args...) \
-  if (GETBIT (LOGGING_MODULES, module) == 1) {				\
-    fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); \
-  }
-
-#define vtpmloginfomore(module, fmt, args...) \
-  if (GETBIT (LOGGING_MODULES, module) == 1) {			      \
-    fprintf (stdout, fmt,##args);				      \
-  }
-                               
-#define vtpmlogerror(module, fmt, args...) \
-  fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
-                               
-//typedef UINT32 tpm_size_t;
-                        
-// helper function for the error codes:
-const char* tpm_get_error_name (TPM_RESULT code);
-
-#endif // _VTPM_LOG_H_
diff --git a/tools/vtpm_manager/util/tcg.h b/tools/vtpm_manager/util/tcg.h
deleted file mode 100644
index 5c42913..0000000
--- a/tools/vtpm_manager/util/tcg.h
+++ /dev/null
@@ -1,503 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// tcg.h
-// 
-//  This file contains all the structure and type definitions
-//
-// ==================================================================
-
-#ifndef __TCG_H__
-#define __TCG_H__
-
-// This pragma is used to disallow structure padding
-#pragma pack(push, 1)
-
-// *************************** TYPEDEFS *********************************
-typedef unsigned char BYTE;
-typedef unsigned char BOOL;
-typedef unsigned short UINT16;
-typedef unsigned int UINT32;
-typedef unsigned long long UINT64;
-
-typedef UINT32 TPM_RESULT;
-typedef UINT32 TPM_PCRINDEX;
-typedef UINT32 TPM_DIRINDEX;
-typedef UINT32 TPM_HANDLE;
-typedef TPM_HANDLE TPM_AUTHHANDLE;
-typedef TPM_HANDLE TCPA_HASHHANDLE;
-typedef TPM_HANDLE TCPA_HMACHANDLE;
-typedef TPM_HANDLE TCPA_ENCHANDLE;
-typedef TPM_HANDLE TPM_KEY_HANDLE;
-typedef TPM_HANDLE TCPA_ENTITYHANDLE;
-typedef UINT32 TPM_RESOURCE_TYPE;
-typedef UINT32 TPM_COMMAND_CODE;
-typedef UINT16 TPM_PROTOCOL_ID;
-typedef BYTE TPM_AUTH_DATA_USAGE;
-typedef UINT16 TPM_ENTITY_TYPE;
-typedef UINT32 TPM_ALGORITHM_ID;
-typedef UINT16 TPM_KEY_USAGE;
-typedef UINT16 TPM_STARTUP_TYPE;
-typedef UINT32 TPM_CAPABILITY_AREA;
-typedef UINT16 TPM_ENC_SCHEME;
-typedef UINT16 TPM_SIG_SCHEME;
-typedef UINT16 TPM_MIGRATE_SCHEME;
-typedef UINT16 TPM_PHYSICAL_PRESENCE;
-typedef UINT32 TPM_KEY_FLAGS;
-
-#define TPM_DIGEST_SIZE 20  // Don't change this
-typedef BYTE TPM_AUTHDATA[TPM_DIGEST_SIZE];
-typedef TPM_AUTHDATA TPM_SECRET;
-typedef TPM_AUTHDATA TPM_ENCAUTH;
-typedef BYTE TPM_PAYLOAD_TYPE;
-typedef UINT16 TPM_TAG;
-
-// Data Types of the TCS
-typedef UINT32 TCS_AUTHHANDLE;  // Handle addressing a authorization session
-typedef UINT32 TCS_CONTEXT_HANDLE; // Basic context handle
-typedef UINT32 TCS_KEY_HANDLE;  // Basic key handle
-
-// ************************* STRUCTURES **********************************
-
-typedef struct TPM_VERSION {
-  BYTE major;
-  BYTE minor;
-  BYTE revMajor;
-  BYTE revMinor;
-} TPM_VERSION;
- 
-static const TPM_VERSION TPM_STRUCT_VER_1_1 = { 1,1,0,0 };
-
-typedef struct TPM_DIGEST {
-  BYTE digest[TPM_DIGEST_SIZE];
-} TPM_DIGEST;
-
-typedef TPM_DIGEST TPM_PCRVALUE;
-typedef TPM_DIGEST TPM_COMPOSITE_HASH;
-typedef TPM_DIGEST TPM_DIRVALUE;
-typedef TPM_DIGEST TPM_HMAC;
-typedef TPM_DIGEST TPM_CHOSENID_HASH;
-
-typedef struct TPM_NONCE {
-  BYTE nonce[TPM_DIGEST_SIZE];
-} TPM_NONCE;
-
-typedef struct TPM_KEY_PARMS {
-  TPM_ALGORITHM_ID algorithmID;
-  TPM_ENC_SCHEME encScheme;
-  TPM_SIG_SCHEME sigScheme;
-  UINT32 parmSize;
-  BYTE* parms;
-} TPM_KEY_PARMS;
-
-typedef struct TPM_RSA_KEY_PARMS {  
-  UINT32 keyLength; 
-  UINT32 numPrimes; 
-  UINT32 exponentSize;
-  BYTE* exponent;
-} TPM_RSA_KEY_PARMS;
-
-typedef struct TPM_STORE_PUBKEY {
-  UINT32 keyLength;
-  BYTE* key;
-} TPM_STORE_PUBKEY;
-
-typedef struct TPM_PUBKEY {
-  TPM_KEY_PARMS algorithmParms;
-  TPM_STORE_PUBKEY pubKey;
-} TPM_PUBKEY;
-
-typedef struct TPM_KEY {
-  TPM_VERSION         ver;
-  TPM_KEY_USAGE       keyUsage;
-  TPM_KEY_FLAGS       keyFlags;
-  TPM_AUTH_DATA_USAGE authDataUsage;
-  TPM_KEY_PARMS       algorithmParms; 
-  UINT32              PCRInfoSize;
-  BYTE*               PCRInfo; // this should be a TPM_PCR_INFO, or NULL
-  TPM_STORE_PUBKEY    pubKey;
-  UINT32              encDataSize;
-  BYTE*               encData;
-} TPM_KEY;
-
-typedef struct TPM_PCR_SELECTION { 
-  UINT16 sizeOfSelect;        /// in bytes
-  BYTE* pcrSelect;
-} TPM_PCR_SELECTION;
-
-typedef struct TPM_PCR_COMPOSITE { 
-  TPM_PCR_SELECTION select;
-  UINT32 valueSize;
-  TPM_PCRVALUE* pcrValue;
-} TPM_PCR_COMPOSITE;
-
-
-typedef struct TPM_PCR_INFO {
-  TPM_PCR_SELECTION pcrSelection;
-  TPM_COMPOSITE_HASH digestAtRelease;
-  TPM_COMPOSITE_HASH digestAtCreation;
-} TPM_PCR_INFO;
-
-
-typedef struct TPM_BOUND_DATA {
-  TPM_VERSION ver;
-  TPM_PAYLOAD_TYPE payload;
-  BYTE* payloadData;
-} TPM_BOUND_DATA;
-
-typedef struct TPM_STORED_DATA { 
-  TPM_VERSION ver;
-  UINT32 sealInfoSize;
-  BYTE* sealInfo;
-  UINT32 encDataSize;
-  BYTE* encData;
-} TPM_STORED_DATA;
-
-typedef struct TCS_AUTH {
-  TCS_AUTHHANDLE  AuthHandle;
-  TPM_NONCE   NonceOdd;   // system 
-  TPM_NONCE   NonceEven;   // TPM 
-  BOOL   fContinueAuthSession;
-  TPM_AUTHDATA  HMAC;
-} TCS_AUTH;
-
-// structures for dealing with sizes followed by buffers in all the
-// TCG structure.
-typedef struct pack_buf_t {
-  UINT32 size;
-  BYTE * data;
-} pack_buf_t;
-
-typedef struct pack_constbuf_t {
-  UINT32 size;
-  const BYTE* data;
-} pack_constbuf_t;
-
-
-
-// **************************** CONSTANTS *********************************
-
-// BOOL values
-#define TRUE 0x01
-#define FALSE 0x00
-
-#define TCPA_MAX_BUFFER_LENGTH 0x2000
-
-//
-// TPM_COMMAND_CODE values
-#define TPM_PROTECTED_ORDINAL 0x00000000UL
-#define TPM_UNPROTECTED_ORDINAL 0x80000000UL
-#define TPM_CONNECTION_ORDINAL 0x40000000UL
-#define TPM_VENDOR_ORDINAL 0x20000000UL
-
-#define TPM_ORD_OIAP                     (10UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_OSAP                     (11UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ChangeAuth               (12UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_TakeOwnership            (13UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ChangeAuthAsymStart      (14UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ChangeAuthAsymFinish     (15UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ChangeAuthOwner          (16UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_Extend                   (20UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_PcrRead                  (21UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_Quote                    (22UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_Seal                     (23UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_Unseal                   (24UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_DirWriteAuth             (25UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_DirRead                  (26UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_UnBind                   (30UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_CreateWrapKey            (31UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_LoadKey                  (32UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_GetPubKey                (33UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_EvictKey                 (34UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_CreateMigrationBlob      (40UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ReWrapKey                (41UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ConvertMigrationBlob     (42UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_AuthorizeMigrationKey    (43UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_CreateMaintenanceArchive (44UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_LoadMaintenanceArchive   (45UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_KillMaintenanceFeature   (46UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_LoadManuMaintPub         (47UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ReadManuMaintPub         (48UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_CertifyKey               (50UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_Sign                     (60UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_GetRandom                (70UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_StirRandom               (71UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SelfTestFull             (80UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SelfTestStartup          (81UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_CertifySelfTest          (82UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ContinueSelfTest         (83UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_GetTestResult            (84UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_Reset                    (90UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_OwnerClear               (91UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_DisableOwnerClear        (92UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ForceClear               (93UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_DisableForceClear        (94UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_GetCapabilitySigned      (100UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_GetCapability            (101UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_GetCapabilityOwner       (102UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_OwnerSetDisable          (110UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_PhysicalEnable           (111UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_PhysicalDisable          (112UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SetOwnerInstall          (113UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_PhysicalSetDeactivated   (114UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SetTempDeactivated       (115UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_CreateEndorsementKeyPair (120UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_MakeIdentity             (121UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ActivateIdentity         (122UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ReadPubek                (124UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_OwnerReadPubek           (125UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_DisablePubekRead         (126UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_GetAuditEvent            (130UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_GetAuditEventSigned      (131UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_GetOrdinalAuditStatus    (140UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SetOrdinalAuditStatus    (141UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_Terminate_Handle         (150UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_Init                     (151UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SaveState                (152UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_Startup                  (153UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SetRedirection           (154UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SHA1Start                (160UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SHA1Update               (161UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SHA1Complete             (162UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SHA1CompleteExtend       (163UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_FieldUpgrade             (170UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SaveKeyContext           (180UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_LoadKeyContext           (181UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SaveAuthContext          (182UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_LoadAuthContext          (183UL + TPM_PROTECTED_ORDINAL)
-#define TSC_ORD_PhysicalPresence         (10UL + TPM_CONNECTION_ORDINAL)
-
-
-
-//
-// TPM_RESULT values
-//
-// just put in the whole table from spec 1.2
-              
-#define TPM_BASE   0x0 // The start of TPM return codes
-#define TPM_VENDOR_ERROR 0x00000400 // Mask to indicate that the error code is vendor specific for vendor specific commands
-#define TPM_NON_FATAL  0x00000800 // Mask to indicate that the error code is a non-fatal failure.
-
-#define TPM_SUCCESS   TPM_BASE // Successful completion of the operation
-#define TPM_AUTHFAIL      TPM_BASE + 1 // Authentication failed
-#define TPM_BADINDEX      TPM_BASE + 2 // The index to a PCR, DIR or other register is incorrect
-#define TPM_BAD_PARAMETER     TPM_BASE + 3 // One or more parameter is bad
-#define TPM_AUDITFAILURE     TPM_BASE + 4 // An operation completed successfully but the auditing of that operation failed.
-#define TPM_CLEAR_DISABLED     TPM_BASE + 5 // The clear disable flag is set and all clear operations now require physical access
-#define TPM_DEACTIVATED     TPM_BASE + 6 // The TPM is deactivated
-#define TPM_DISABLED      TPM_BASE + 7 // The TPM is disabled
-#define TPM_DISABLED_CMD     TPM_BASE + 8 // The target command has been disabled
-#define TPM_FAIL       TPM_BASE + 9 // The operation failed
-#define TPM_BAD_ORDINAL     TPM_BASE + 10 // The ordinal was unknown or inconsistent
-#define TPM_INSTALL_DISABLED   TPM_BASE + 11 // The ability to install an owner is disabled
-#define TPM_INVALID_KEYHANDLE  TPM_BASE + 12 // The key handle presented was invalid
-#define TPM_KEYNOTFOUND     TPM_BASE + 13 // The target key was not found
-#define TPM_INAPPROPRIATE_ENC  TPM_BASE + 14 // Unacceptable encryption scheme
-#define TPM_MIGRATEFAIL     TPM_BASE + 15 // Migration authorization failed
-#define TPM_INVALID_PCR_INFO   TPM_BASE + 16 // PCR information could not be interpreted
-#define TPM_NOSPACE      TPM_BASE + 17 // No room to load key.
-#define TPM_NOSRK       TPM_BASE + 18 // There is no SRK set
-#define TPM_NOTSEALED_BLOB     TPM_BASE + 19 // An encrypted blob is invalid or was not created by this TPM
-#define TPM_OWNER_SET      TPM_BASE + 20 // There is already an Owner
-#define TPM_RESOURCES      TPM_BASE + 21 // The TPM has insufficient internal resources to perform the requested action.
-#define TPM_SHORTRANDOM     TPM_BASE + 22 // A random string was too short
-#define TPM_SIZE       TPM_BASE + 23 // The TPM does not have the space to perform the operation.
-#define TPM_WRONGPCRVAL     TPM_BASE + 24 // The named PCR value does not match the current PCR value.
-#define TPM_BAD_PARAM_SIZE     TPM_BASE + 25 // The paramSize argument to the command has the incorrect value
-#define TPM_SHA_THREAD      TPM_BASE + 26 // There is no existing SHA-1 thread.
-#define TPM_SHA_ERROR      TPM_BASE + 27 // The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error.
-#define TPM_FAILEDSELFTEST     TPM_BASE + 28 // Self-test has failed and the TPM has shutdown.
-#define TPM_AUTH2FAIL      TPM_BASE + 29 // The authorization for the second key in a 2 key function failed authorization
-#define TPM_BADTAG       TPM_BASE + 30 // The tag value sent to for a command is invalid
-#define TPM_IOERROR      TPM_BASE + 31 // An IO error occurred transmitting information to the TPM
-#define TPM_ENCRYPT_ERROR     TPM_BASE + 32 // The encryption process had a problem.
-#define TPM_DECRYPT_ERROR     TPM_BASE + 33 // The decryption process did not complete.
-#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 // An invalid handle was used.
-#define TPM_NO_ENDORSEMENT     TPM_BASE + 35 // The TPM does not a EK installed
-#define TPM_INVALID_KEYUSAGE   TPM_BASE + 36 // The usage of a key is not allowed
-#define TPM_WRONG_ENTITYTYPE   TPM_BASE + 37 // The submitted entity type is not allowed
-#define TPM_INVALID_POSTINIT   TPM_BASE + 38 // The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup
-#define TPM_INAPPROPRIATE_SIG  TPM_BASE + 39 // Signed data cannot include additional DER information
-#define TPM_BAD_KEY_PROPERTY   TPM_BASE + 40 // The key properties in TPM_KEY_PARMs are not supported by this TPM
-
-#define TPM_BAD_MIGRATION      TPM_BASE + 41 // The migration properties of this key are incorrect.
-#define TPM_BAD_SCHEME       TPM_BASE + 42 // The signature or encryption scheme for this key is incorrect or not permitted in this situation.
-#define TPM_BAD_DATASIZE      TPM_BASE + 43 // The size of the data (or blob) parameter is bad or inconsistent with the referenced key
-#define TPM_BAD_MODE       TPM_BASE + 44 // A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob.
-#define TPM_BAD_PRESENCE      TPM_BASE + 45 // Either the physicalPresence or physicalPresenceLock bits have the wrong value
-#define TPM_BAD_VERSION      TPM_BASE + 46 // The TPM cannot perform this version of the capability
-#define TPM_NO_WRAP_TRANSPORT     TPM_BASE + 47 // The TPM does not allow for wrapped transport sessions
-#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 // TPM audit construction failed and the underlying command was returning a failure code also
-#define TPM_AUDITFAIL_SUCCESSFUL   TPM_BASE + 49 // TPM audit construction failed and the underlying command was returning success
-#define TPM_NOTRESETABLE      TPM_BASE + 50 // Attempt to reset a PCR register that does not have the resettable attribute
-#define TPM_NOTLOCAL       TPM_BASE + 51 // Attempt to reset a PCR register that requires locality and locality modifier not part of command transport
-#define TPM_BAD_TYPE       TPM_BASE + 52 // Make identity blob not properly typed
-#define TPM_INVALID_RESOURCE     TPM_BASE + 53 // When saving context identified resource type does not match actual resource
-#define TPM_NOTFIPS       TPM_BASE + 54 // The TPM is attempting to execute a command only available when in FIPS mode
-#define TPM_INVALID_FAMILY      TPM_BASE + 55 // The command is attempting to use an invalid family ID
-#define TPM_NO_NV_PERMISSION     TPM_BASE + 56 // The permission to manipulate the NV storage is not available
-#define TPM_REQUIRES_SIGN      TPM_BASE + 57 // The operation requires a signed command
-#define TPM_KEY_NOTSUPPORTED     TPM_BASE + 58 // Wrong operation to load an NV key
-#define TPM_AUTH_CONFLICT      TPM_BASE + 59 // NV_LoadKey blob requires both owner and blob authorization
-#define TPM_AREA_LOCKED      TPM_BASE + 60 // The NV area is locked and not writtable
-#define TPM_BAD_LOCALITY      TPM_BASE + 61 // The locality is incorrect for the attempted operation
-#define TPM_READ_ONLY       TPM_BASE + 62 // The NV area is read only and can't be written to
-#define TPM_PER_NOWRITE      TPM_BASE + 63 // There is no protection on the write to the NV area
-#define TPM_FAMILYCOUNT      TPM_BASE + 64 // The family count value does not match
-#define TPM_WRITE_LOCKED      TPM_BASE + 65 // The NV area has already been written to
-#define TPM_BAD_ATTRIBUTES      TPM_BASE + 66 // The NV area attributes conflict
-#define TPM_INVALID_STRUCTURE     TPM_BASE + 67 // The structure tag and version are invalid or inconsistent
-#define TPM_KEY_OWNER_CONTROL     TPM_BASE + 68 // The key is under control of the TPM Owner and can only be evicted by the TPM Owner.
-#define TPM_BAD_COUNTER      TPM_BASE + 69 // The counter handle is incorrect
-#define TPM_NOT_FULLWRITE      TPM_BASE + 70 // The write is not a complete write of the area
-#define TPM_CONTEXT_GAP      TPM_BASE + 71 // The gap between saved context counts is too large
-#define TPM_MAXNVWRITES      TPM_BASE + 72 // The maximum number of NV writes without an owner has been exceeded
-#define TPM_NOOPERATOR       TPM_BASE + 73 // No operator authorization value is set
-#define TPM_RESOURCEMISSING     TPM_BASE + 74 // The resource pointed to by context is not loaded
-#define TPM_DELEGATE_LOCK      TPM_BASE + 75 // The delegate administration is locked
-#define TPM_DELEGATE_FAMILY     TPM_BASE + 76 // Attempt to manage a family other then the delegated family
-#define TPM_DELEGATE_ADMIN      TPM_BASE + 77 // Delegation table management not enabled
-#define TPM_TRANSPORT_EXCLUSIVE    TPM_BASE + 78 // There was a command executed outside of an exclusive transport session
-
-// TPM_STARTUP_TYPE values
-#define TPM_ST_CLEAR 0x0001
-#define TPM_ST_STATE 0x0002
-#define TPM_ST_DEACTIVATED 0x003
-
-// TPM_TAG values
-#define TPM_TAG_RQU_COMMAND 0x00c1
-#define TPM_TAG_RQU_AUTH1_COMMAND 0x00c2
-#define TPM_TAG_RQU_AUTH2_COMMAND 0x00c3
-#define TPM_TAG_RSP_COMMAND 0x00c4
-#define TPM_TAG_RSP_AUTH1_COMMAND 0x00c5
-#define TPM_TAG_RSP_AUTH2_COMMAND 0x00c6
-
-// TPM_PAYLOAD_TYPE values
-#define TPM_PT_ASYM 0x01
-#define TPM_PT_BIND 0x02
-#define TPM_PT_MIGRATE 0x03
-#define TPM_PT_MAINT 0x04
-#define TPM_PT_SEAL 0x05
-
-// TPM_ENTITY_TYPE values
-#define TPM_ET_KEYHANDLE 0x0001
-#define TPM_ET_OWNER 0x0002
-#define TPM_ET_DATA 0x0003
-#define TPM_ET_SRK 0x0004
-#define TPM_ET_KEY 0x0005
-
-/// TPM_ResourceTypes
-#define TPM_RT_KEY      0x00000001
-#define TPM_RT_AUTH     0x00000002
-#define TPM_RT_TRANS    0x00000004
-#define TPM_RT_CONTEXT  0x00000005
-
-// TPM_PROTOCOL_ID values
-#define TPM_PID_OIAP 0x0001
-#define TPM_PID_OSAP 0x0002
-#define TPM_PID_ADIP 0x0003
-#define TPM_PID_ADCP 0x0004
-#define TPM_PID_OWNER 0x0005
-
-// TPM_ALGORITHM_ID values
-#define TPM_ALG_RSA 0x00000001
-#define TPM_ALG_DES 0x00000002
-#define TPM_ALG_3DES 0X00000003
-#define TPM_ALG_SHA 0x00000004
-#define TPM_ALG_HMAC 0x00000005
-#define TCPA_ALG_AES 0x00000006
-
-// TPM_ENC_SCHEME values
-#define TPM_ES_NONE 0x0001
-#define TPM_ES_RSAESPKCSv15 0x0002
-#define TPM_ES_RSAESOAEP_SHA1_MGF1 0x0003
-
-// TPM_SIG_SCHEME values
-#define TPM_SS_NONE 0x0001
-#define TPM_SS_RSASSAPKCS1v15_SHA1 0x0002
-#define TPM_SS_RSASSAPKCS1v15_DER 0x0003
-
-// TPM_KEY_USAGE values
-#define TPM_KEY_EK 0x0000 
-#define TPM_KEY_SIGNING 0x0010
-#define TPM_KEY_STORAGE 0x0011
-#define TPM_KEY_IDENTITY 0x0012
-#define TPM_KEY_AUTHCHANGE 0X0013
-#define TPM_KEY_BIND 0x0014
-#define TPM_KEY_LEGACY 0x0015
-
-// TPM_AUTH_DATA_USAGE values
-#define TPM_AUTH_NEVER 0x00
-#define TPM_AUTH_ALWAYS 0x01
-
-// Key Handle of owner and srk
-#define TPM_OWNER_KEYHANDLE 0x40000001
-#define TPM_SRK_KEYHANDLE 0x40000000
-
-// ---------------------- Functions for checking TPM_RESULTs -----------------
-
-#include <stdio.h>
-
-// FIXME: Review use of these and delete unneeded ones.
-
-// these are really badly dependent on local structure:
-// DEPENDS: local var 'status' of type TPM_RESULT
-// DEPENDS: label 'abort_egress' which cleans up and returns the status
-#define ERRORDIE(s) do { status = s; \
-                         fprintf (stderr, "*** ERRORDIE in %s at %s: %i\n", __func__, __FILE__, __LINE__); \
-                         goto abort_egress; } \
-                    while (0)
-
-// DEPENDS: local var 'status' of type TPM_RESULT
-// DEPENDS: label 'abort_egress' which cleans up and returns the status
-// Try command c. If it fails, set status to s and goto abort.
-#define TPMTRY(s,c) if (c != TPM_SUCCESS) { \
-                       status = s; \
-                       printf("ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
-                       goto abort_egress; \
-                    } else {\
-                       status = c; \
-                    }
-
-// Try command c. If it fails, print error message, set status to actual return code. Goto abort
-#define TPMTRYRETURN(c) do { status = c; \
-                             if (status != TPM_SUCCESS) { \
-                               fprintf(stderr, "ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
-                               goto abort_egress; \
-                             } \
-                        } while(0)    
-
-
-#pragma pack(pop)
-
-#endif //__TCPA_H__
diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c
index 3b89223..0ba1d55 100644
--- a/tools/xenstore/hashtable.c
+++ b/tools/xenstore/hashtable.c
@@ -3,7 +3,6 @@
 /*
  * There are duplicates of this code in:
  *  - tools/blktap2/drivers/hashtable.c
- *  - tools/vtpm_manager/util/hashtable.c
  */
 
 #include "hashtable.h"
diff --git a/tools/xenstore/hashtable.h b/tools/xenstore/hashtable.h
index 8e6bb5b..4d68223 100644
--- a/tools/xenstore/hashtable.h
+++ b/tools/xenstore/hashtable.h
@@ -3,7 +3,6 @@
 /*
  * There are duplicates of this code in:
  *  - tools/blktap2/drivers/hashtable.h
- *  - tools/vtpm_manager/util/hashtable.h
  */
 
 #ifndef __HASHTABLE_CWC22_H__
diff --git a/tools/xenstore/hashtable_private.h b/tools/xenstore/hashtable_private.h
index cabaffe..a08559d 100644
--- a/tools/xenstore/hashtable_private.h
+++ b/tools/xenstore/hashtable_private.h
@@ -3,7 +3,6 @@
 /*
  * There are duplicates of this code in:
  *  - tools/blktap2/drivers/hashtable_private.h
- *  - tools/vtpm_manager/util/hashtable_private.h
  */
 
 #ifndef __HASHTABLE_PRIVATE_CWC22_H__
diff --git a/tools/xm-test/configure.ac b/tools/xm-test/configure.ac
index ad1eb78..c142140 100644
--- a/tools/xm-test/configure.ac
+++ b/tools/xm-test/configure.ac
@@ -143,7 +143,6 @@ AC_CONFIG_FILES([
     tests/unpause/Makefile
     tests/vcpu-pin/Makefile
     tests/vcpu-disable/Makefile
-    tests/vtpm/Makefile
     tests/xapi/Makefile
     tests/enforce_dom0_cpus/Makefile
     tests/cpupool/Makefile
diff --git a/tools/xm-test/grouptest/default b/tools/xm-test/grouptest/default
index f0516b2..e04591b 100644
--- a/tools/xm-test/grouptest/default
+++ b/tools/xm-test/grouptest/default
@@ -27,5 +27,4 @@ sysrq
 unpause
 vcpu-disable
 vcpu-pin
-vtpm
 xapi
diff --git a/tools/xm-test/grouptest/medium b/tools/xm-test/grouptest/medium
index bafc988..5c3e1b1 100644
--- a/tools/xm-test/grouptest/medium
+++ b/tools/xm-test/grouptest/medium
@@ -22,4 +22,3 @@ sysrq 01_sysrq_basic_neg.test 02_sysrq_sync_pos.test
 unpause
 vcpu-disable
 vcpu-pin
-vtpm
diff --git a/tools/xm-test/grouptest/xapi b/tools/xm-test/grouptest/xapi
index 3b04921..7a08b77 100644
--- a/tools/xm-test/grouptest/xapi
+++ b/tools/xm-test/grouptest/xapi
@@ -1,2 +1 @@
 xapi
-vtpm 09_vtpm-xapi.test
diff --git a/tools/xm-test/lib/XmTestLib/XenDomain.py b/tools/xm-test/lib/XmTestLib/XenDomain.py
index ae8c550..3ba7433 100644
--- a/tools/xm-test/lib/XmTestLib/XenDomain.py
+++ b/tools/xm-test/lib/XmTestLib/XenDomain.py
@@ -59,7 +59,6 @@ class XenConfig:
         # These options need to be lists
         self.defaultOpts["disk"] = []
         self.defaultOpts["vif"]  = []
-        self.defaultOpts["vtpm"] = []
 
         self.opts = self.defaultOpts
 
diff --git a/tools/xm-test/tests/Makefile.am b/tools/xm-test/tests/Makefile.am
index 8d673ed..455f50c 100644
--- a/tools/xm-test/tests/Makefile.am
+++ b/tools/xm-test/tests/Makefile.am
@@ -25,7 +25,6 @@ SUBDIRS = 	               	\
 		unpause         \
 		vcpu-disable    \
 		vcpu-pin	\
-		vtpm            \
 		enforce_dom0_cpus	\
 		save restore migrate	\
 		cpupool
diff --git a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py b/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
deleted file mode 100644
index dfd1227..0000000
--- a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-#                verify list
-
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-
-try:
-    domain.start(noConsole=True)
-except DomainError, e:
-    if verbose:
-        print e.extra
-    vtpm_cleanup(domain.getName())
-    FAIL("Unable to create domain")
-
-
-domName = domain.getName()
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-status, output = traceCommand("xm vtpm-list %s" % domain.getId())
-eyecatcher = "/local/domain/0/backend/vtpm"
-where = output.find(eyecatcher)
-if status != 0:
-    FAIL("xm vtpm-list returned bad status, expected 0, status is %i" % status)
-elif where < 0:
-    FAIL("Fail to list virtual TPM device")
-
-domain.stop()
diff --git a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py b/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
deleted file mode 100644
index a18cbab..0000000
--- a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-#                check list of pcrs
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-
-try:
-    console = domain.start()
-except DomainError, e:
-    if verbose:
-        print e.extra
-    FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
-    console.sendInput("input")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL(str(e))
-
-try:
-    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("No result from dumping the PCRs")
-
-if re.search("No such file",run["output"]):
-    FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-domain.closeConsole()
-
-domain.stop()
-
-if not re.search("PCR-00:",run["output"]):
-    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
diff --git a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py b/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
deleted file mode 100644
index b863f27..0000000
--- a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-#                check list of pcrs; suspend and resume the domain and
-#                check list of pcrs again
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-consoleHistory = ""
-
-try:
-    console = domain.start()
-except DomainError, e:
-    if verbose:
-        print e.extra
-    FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
-    console.sendInput("input")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL(str(e))
-
-try:
-    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("No result from dumping the PCRs")
-
-if re.search("No such file",run["output"]):
-    FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-consoleHistory = console.getHistory()
-domain.closeConsole()
-
-loop = 0
-while loop < 3:
-    try:
-        status, ouptut = traceCommand("xm save %s %s.save" %
-                                      (domName, domName),
-                                      timeout=30)
-
-    except TimeoutError, e:
-        saveLog(consoleHistory)
-        FAIL(str(e))
-
-    if status != 0:
-        saveLog(consoleHistory)
-        FAIL("xm save did not succeed")
-
-    try:
-        status, ouptut = traceCommand("xm restore %s.save" %
-                                      (domName),
-                                      timeout=30)
-    except TimeoutError, e:
-        os.remove("%s.save" % domName)
-        saveLog(consoleHistory)
-        FAIL(str(e))
-
-    os.remove("%s.save" % domName)
-
-    if status != 0:
-        saveLog(consoleHistory)
-        FAIL("xm restore did not succeed")
-
-    try:
-        console = domain.getConsole()
-    except ConsoleError, e:
-        FAIL(str(e))
-
-    try:
-        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-    except ConsoleError, e:
-        saveLog(console.getHistory())
-        FAIL(str(e))
-
-    if not re.search("PCR-00:",run["output"]):
-        saveLog(console.getHistory())
-        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
-
-    loop += 1
-
-domain.closeConsole()
-
-domain.stop()
-
diff --git a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py b/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
deleted file mode 100644
index ccc8b73..0000000
--- a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-#                check list of pcrs; locally migrate the domain and
-#                check list of pcrs again
-#                This test does local live migration.
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-consoleHistory = ""
-
-try:
-    console = domain.start()
-except DomainError, e:
-    if verbose:
-        print e.extra
-    FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
-    console.sendInput("input")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL(str(e))
-
-try:
-    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("No result from dumping the PCRs")
-
-if re.search("No such file",run["output"]):
-    FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-consoleHistory = console.getHistory()
-domain.closeConsole()
-
-old_domid = domid(domName)
-
-loop = 0
-while loop < 3:
-    try:
-        status, ouptut = traceCommand("xm migrate -l %s localhost" %
-                                      domName,
-                                      timeout=90)
-    except TimeoutError, e:
-        saveLog(consoleHistory)
-        FAIL(str(e))
-
-    if status != 0:
-        saveLog(consoleHistory)
-        FAIL("xm migrate did not succeed. External device migration activated?")
-
-
-    domName = domain.getName()
-    new_domid = domid(domName)
-
-    if (old_domid == new_domid):
-        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
-             (old_domid,loop))
-
-    try:
-        console = domain.getConsole()
-    except ConsoleError, e:
-        FAIL(str(e))
-
-    try:
-        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-    except ConsoleError, e:
-        saveLog(console.getHistory())
-        FAIL("No result from dumping the PCRs")
-
-    if not re.search("PCR-00:",run["output"]):
-        saveLog(console.getHistory())
-        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
-
-    loop += 1
-
-domain.closeConsole()
-
-domain.stop()
diff --git a/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py b/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py
deleted file mode 100644
index 57b87df..0000000
--- a/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-#                check list of pcrs; locally migrate the domain and
-#                check list of pcrs again
-#                This test does local (non-live) migration.
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-consoleHistory = ""
-
-try:
-    console = domain.start()
-except DomainError, e:
-    if verbose:
-        print e.extra
-    FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
-    console.sendInput("input")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL(str(e))
-
-try:
-    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("No result from dumping the PCRs")
-
-if re.search("No such file",run["output"]):
-    FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-consoleHistory = console.getHistory()
-domain.closeConsole()
-
-old_domid = domid(domName)
-
-loop = 0
-while loop < 3:
-    try:
-        status, ouptut = traceCommand("xm migrate %s localhost" %
-                                      domName,
-                                      timeout=90)
-    except TimeoutError, e:
-        saveLog(consoleHistory)
-        FAIL(str(e))
-
-    if status != 0:
-        saveLog(consoleHistory)
-        FAIL("xm migrate did not succeed. External device migration activated?")
-
-
-    domName = domain.getName()
-    new_domid = domid(domName)
-
-    if (old_domid == new_domid):
-        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
-             (old_domid,loop))
-
-    try:
-        console = domain.getConsole()
-    except ConsoleError, e:
-        FAIL(str(e))
-
-    try:
-        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-    except ConsoleError, e:
-        saveLog(console.getHistory())
-        FAIL("No result from dumping the PCRs")
-
-    if not re.search("PCR-00:",run["output"]):
-        saveLog(console.getHistory())
-        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
-
-    loop += 1
-
-domain.closeConsole()
-
-domain.stop()
diff --git a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py b/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
deleted file mode 100644
index c70691d..0000000
--- a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-#                extend a pcr
-#                check list of pcrs; suspend and resume the domain and
-#                check list of pcrs again and validate extended pcr
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-consoleHistory = ""
-
-try:
-    console = domain.start()
-except DomainError, e:
-    if verbose:
-        print e.extra
-    FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
-    console.sendInput("input")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL(str(e))
-
-try:
-    run = console.runCmd("mknod /dev/tpm0 c 10 224")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("Error while creating /dev/tpm0")
-
-try:
-    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("Error while extending PCR 0")
-
-try:
-    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("No result from dumping the PCRs")
-
-
-if re.search("No such file",run["output"]):
-    FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-if not re.search("PCR-00:",run["output"]):
-    saveLog(console.getHistory())
-    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
-
-if not re.search("PCR-00: 1E A7 BD",run["output"]):
-    saveLog(console.getHistory())
-    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
-
-consoleHistory = console.getHistory()
-domain.closeConsole()
-
-loop = 0
-while loop < 3:
-    try:
-        status, ouptut = traceCommand("xm save %s %s.save" %
-                                      (domName, domName),
-                                      timeout=30)
-
-    except TimeoutError, e:
-        saveLog(consoleHistory)
-        FAIL(str(e))
-
-    if status != 0:
-        saveLog(consoleHistory)
-        FAIL("xm save did not succeed")
-
-    try:
-        status, ouptut = traceCommand("xm restore %s.save" %
-                                      (domName),
-                                      timeout=30)
-    except TimeoutError, e:
-        os.remove("%s.save" % domName)
-        saveLog(consoleHistory)
-        FAIL(str(e))
-
-    os.remove("%s.save" % domName)
-
-    if status != 0:
-        saveLog(consoleHistory)
-        FAIL("xm restore did not succeed")
-
-    try:
-        console = domain.getConsole()
-    except ConsoleError, e:
-        FAIL(str(e))
-
-    try:
-        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-    except ConsoleError, e:
-        saveLog(console.getHistory())
-        FAIL(str(e))
-
-    if not re.search("PCR-00:",run["output"]):
-        saveLog(console.getHistory())
-        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
-
-    if not re.search("PCR-00: 1E A7 BD",run["output"]):
-        saveLog(console.getHistory())
-        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
-
-    loop += 1
-
-domain.closeConsole()
-
-domain.stop()
-
diff --git a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py b/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
deleted file mode 100644
index 4ff3360..0000000
--- a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-#                extend a pcr
-#                check list of pcrs; locally migrate the domain and
-#                check list of pcrs again and validate extended pcr
-#                This test does local live migration.
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-consoleHistory = ""
-
-try:
-    console = domain.start()
-except DomainError, e:
-    if verbose:
-        print e.extra
-    FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
-    console.sendInput("input")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL(str(e))
-
-try:
-    run = console.runCmd("mknod /dev/tpm0 c 10 224")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("Error while creating /dev/tpm0")
-
-try:
-    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("Error while extending PCR 0")
-
-try:
-    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("No result from dumping the PCRs")
-
-
-if re.search("No such file",run["output"]):
-    FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-if not re.search("PCR-00:",run["output"]):
-    saveLog(console.getHistory())
-    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
-
-if not re.search("PCR-00: 1E A7 BD",run["output"]):
-    saveLog(console.getHistory())
-    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
-
-consoleHistory = console.getHistory()
-domain.closeConsole()
-
-old_domid = domid(domName)
-
-loop = 0
-while loop < 3:
-    try:
-        status, ouptut = traceCommand("xm migrate -l %s localhost" %
-                                      domName,
-                                      timeout=90)
-    except TimeoutError, e:
-        saveLog(consoleHistory)
-        FAIL(str(e))
-
-    if status != 0:
-        saveLog(consoleHistory)
-        FAIL("xm migrate did not succeed. External device migration activated?")
-
-
-    domName = domain.getName()
-    new_domid = domid(domName)
-
-    if (old_domid == new_domid):
-        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
-             (old_domid,loop))
-
-    try:
-        console = domain.getConsole()
-    except ConsoleError, e:
-        FAIL(str(e))
-
-    try:
-        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-    except ConsoleError, e:
-        saveLog(console.getHistory())
-        FAIL("No result from dumping the PCRs")
-
-    if not re.search("PCR-00:",run["output"]):
-        saveLog(console.getHistory())
-        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
-
-    if not re.search("PCR-00: 1E A7 BD",run["output"]):
-        saveLog(console.getHistory())
-        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
-
-    loop += 1
-
-domain.closeConsole()
-
-domain.stop()
diff --git a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py b/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
deleted file mode 100644
index 27125fc..0000000
--- a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-#                extend a pcr
-#                check list of pcrs; locally migrate the domain and
-#                check list of pcrs again and validate extended pcr
-#                This test does local (non-live) migration.
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-consoleHistory = ""
-
-try:
-    console = domain.start()
-except DomainError, e:
-    if verbose:
-        print e.extra
-    FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
-    console.sendInput("input")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL(str(e))
-
-try:
-    run = console.runCmd("mknod /dev/tpm0 c 10 224")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("Error while creating /dev/tpm0")
-
-try:
-    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("Error while extending PCR 0")
-
-try:
-    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("No result from dumping the PCRs")
-
-
-if re.search("No such file",run["output"]):
-    FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-if not re.search("PCR-00:",run["output"]):
-    saveLog(console.getHistory())
-    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
-
-if not re.search("PCR-00: 1E A7 BD",run["output"]):
-    saveLog(console.getHistory())
-    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
-
-consoleHistory = console.getHistory()
-domain.closeConsole()
-
-old_domid = domid(domName)
-
-loop = 0
-while loop < 3:
-    try:
-        status, ouptut = traceCommand("xm migrate %s localhost" %
-                                      domName,
-                                      timeout=90)
-    except TimeoutError, e:
-        saveLog(consoleHistory)
-        FAIL(str(e))
-
-    if status != 0:
-        saveLog(consoleHistory)
-        FAIL("xm migrate did not succeed. External device migration activated?")
-
-
-    domName = domain.getName()
-    new_domid = domid(domName)
-
-    if (old_domid == new_domid):
-        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
-             (old_domid,loop))
-
-    try:
-        console = domain.getConsole()
-    except ConsoleError, e:
-        FAIL(str(e))
-
-    try:
-        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-    except ConsoleError, e:
-        saveLog(console.getHistory())
-        FAIL("No result from dumping the PCRs")
-
-    if not re.search("PCR-00:",run["output"]):
-        saveLog(console.getHistory())
-        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
-
-    if not re.search("PCR-00: 1E A7 BD",run["output"]):
-        saveLog(console.getHistory())
-        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
-
-    loop += 1
-
-domain.closeConsole()
-
-domain.stop()
diff --git a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py b/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
deleted file mode 100644
index a1aa8b3..0000000
--- a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
+++ /dev/null
@@ -1,158 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Test to test the vtpm class through the Xen-API
-#
-# Tested methods:
-#  VTPM: get_uuid, get_backend, get_by_uuid, get_record
-#        create, destroy, get_VM
-#  VM: get_VTPMS
-
-from XmTestLib import xapi
-from XmTestLib.XenAPIDomain import XmTestAPIDomain
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-
-VTPM_RECORD_KEYS = [ 'backend', 'VM', 'uuid', 'other_config' ]
-
-try:
-    # XmTestAPIDomain tries to establish a connection to XenD
-    domain = XmTestAPIDomain()
-except Exception, e:
-    SKIP("Skipping test. Error: %s" % str(e))
-vm_uuid = domain.get_uuid()
-
-vtpmcfg = {}
-vtpmcfg['backend'] = DOM0_UUID
-vtpmcfg['VM'] = vm_uuid
-
-session = xapi.connect()
-
-vtpm_uuid = session.xenapi.VTPM.create(vtpmcfg)
-
-vtpm_be = session.xenapi.VTPM.get_backend(vtpm_uuid)
-if vtpm_be != vtpmcfg['backend']:
-    FAIL("vTPM's backend is in '%s', expected: '%s'" %
-         (vtpm_be, vtpmcfg['backend']))
-
-vtpm_rec = session.xenapi.VTPM.get_record(vtpm_uuid)
-
-miss_keys = []
-for k in VTPM_RECORD_KEYS:
-    if k not in vtpm_rec.keys():
-        miss_keys.append(k)
-if len(miss_keys) > 0:
-    FAIL("vTPM record is missing key(s): %s" % miss_keys)
-
-if vtpm_rec['uuid']  != vtpm_uuid:
-    FAIL("vTPM record shows vtpm uuid '%s', expected: '%s'" %
-         (vtpm_rec['uuid'], vtpm_uuid))
-if vtpm_rec['VM']  != vm_uuid:
-    FAIL("vTPM record shows VM uuid '%s', expected: '%s'" %
-         (vtpm_rec['VM'], vm_uuid))
-if vtpm_rec['backend'] != vtpmcfg['backend']:
-    FAIL("vTPM record shows VM bakcned '%s', expected: '%s'" %
-         (vtpm_rev['backend'], vtpmcfg['backend']))
-
-badkeys = []
-keys = vtpm_rec.keys()
-for k in keys:
-    if k not in VTPM_RECORD_KEYS:
-        badkeys.append(k)
-if len(badkeys) > 0:
-    FAIL("Unexpected attributes in result: %s" % badkeys)
-
-if vm_uuid != session.xenapi.VTPM.get_VM(vtpm_uuid):
-    FAIL("VM uuid from VTPM.get_VM different (%s) than expected (%s)." %
-         (vm_ref, vm_uuid))
-
-uuid = session.xenapi.VTPM.get_uuid(vtpm_uuid)
-if uuid != vtpm_uuid:
-    FAIL("vTPM from VTPM.get_uuid different (%s) than expected (%s)." %
-         (uuid, vtpm_uuid))
-
-vtpm_ref = session.xenapi.VTPM.get_by_uuid(vtpm_uuid)
-if vtpm_ref != vtpm_uuid:
-    FAIL("vTPM from VTPM.get_by_uuid different (%s) than expected (%s)." %
-         (vtpm_ref, vtpm_uuid))
-
-vm_vtpms = session.xenapi.VM.get_VTPMs(vm_uuid)
-if len(vm_vtpms) != 1:
-    FAIL("Number of vTPMs from get_VTPMs is (%d) not what was expected (%d)" %
-         (len(vm_vtpms), 1))
-if vtpm_uuid not in vm_vtpms:
-    FAIL("Other vTPM uuid (%s) returned from VM.get_VTPMs than expected (%s)" %
-         (vm_vtpms[0], vtpm_uuid))
-
-try:
-    console = domain.start()
-except DomainError, e:
-    FAIL("Unable to create domain.")
-
-try:
-    console.sendInput("input")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL(str(e))
-
-try:
-    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("1. No result from dumping the PCRs")
-
-if re.search("No such file",run["output"]):
-    FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-if not re.search("PCR-00:",run["output"]):
-    saveLog(console.getHistory())
-    FAIL("1. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
-
-try:
-    session.xenapi.VTPM.destroy(vtpm_uuid)
-    #Should never get here
-    FAIL("Could destroy vTPM while VM is running")
-except:
-    pass
-
-rc = session.xenapi.VM.suspend(vm_uuid)
-if rc:
-    FAIL("Could not suspend VM")
-
-try:
-    session.xenapi.VTPM.destroy(vtpm_uuid)
-    #May not throw an exception in 'suspend' state
-except:
-    pass
-
-rc = session.xenapi.VM.resume(vm_uuid, False)
-if rc:
-    FAIL("Could not resume VM")
-
-try:
-    console = domain.getConsole()
-except ConsoleError, e:
-    FAIL(str(e))
-
-try:
-    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("2. No result from dumping the PCRs. vTPM has been removed?")
-
-if not re.search("PCR-00:",run["output"]):
-    saveLog(console.getHistory())
-    FAIL("2. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
-
-domain.stop()
-
-try:
-    session.xenapi.VTPM.destroy(vtpm_uuid)
-except:
-    FAIL("Could NOT destroy vTPM while domain is halted.")
-
-domain.destroy()
diff --git a/tools/xm-test/tests/vtpm/Makefile.am b/tools/xm-test/tests/vtpm/Makefile.am
deleted file mode 100644
index dd67e45..0000000
--- a/tools/xm-test/tests/vtpm/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-SUBDIRS =
-
-TESTS = 01_vtpm-list_pos.test \
-        02_vtpm-cat_pcrs.test \
-        03_vtpm-susp_res.test \
-        04_vtpm-loc_migr.test \
-        05_vtpm-loc_migr.test \
-        06_vtpm-susp_res_pcrs.test \
-        07_vtpm-mig_pcrs.test \
-        08_vtpm-mig_pcrs.test \
-        09_vtpm-xapi.test
-
-XFAIL_TESTS =
-
-EXTRA_DIST = $(TESTS) $(XFAIL_TESTS) vtpm_utils.py
-TESTS_ENVIRONMENT=@TENV@
-
-%.test: %.py
-	cp $< $@
-	chmod +x $@
-
-clean-local: am_config_clean-local
-
-am_config_clean-local:
-	rm -f *test
-	rm -f *log
-	rm -f *~
diff --git a/tools/xm-test/tests/vtpm/vtpm_utils.py b/tools/xm-test/tests/vtpm/vtpm_utils.py
deleted file mode 100644
index 4e5b281..0000000
--- a/tools/xm-test/tests/vtpm/vtpm_utils.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-from XmTestLib import *
-
-if ENABLE_HVM_SUPPORT:
-    SKIP("vtpm tests not supported for HVM domains")
-
-status, output = traceCommand("COLUMNS=200 ; "
-                              "ps aux | grep vtpm_manager | grep -v grep")
-if output == "":
-    SKIP("virtual TPM manager must be started to run this test; might "
-         "need /dev/tpm0")
-
-def vtpm_cleanup(domName):
-    traceCommand("/etc/xen/scripts/vtpm-delete "
-                 "`xenstore-read /local/domain/0/backend/vtpm/%s/0/uuid`" %
-                 str(domid(domName)))
-
-def vtpm_cleanup(uuid):
-    from xen.xm import main
-    if main.serverType != main.SERVER_XEN_API:
-        traceCommand("/etc/xen/scripts/vtpm-delete %s" % uuid)
-
-def vtpm_get_uuid(domainid):
-    s, o = traceCommand("xenstore-read "
-                        "/local/domain/0/backend/vtpm/%s/0/uuid" % domainid)
-    return o
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:40:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:40:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1Yp-0006KW-H7; Thu, 01 Nov 2012 20:40:19 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TU1Uv-0005Uu-Ke
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:36:18 +0000
Received: from [193.109.254.147:12184] by server-13.bemta-14.messagelabs.com
	id F9/98-11239-04DD2905; Thu, 01 Nov 2012 20:36:16 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-12.tower-27.messagelabs.com!1351802168!8576896!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=Mail larger than max spam size
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22623 invoked from network); 1 Nov 2012 20:36:10 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-12.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 20:36:10 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148031182;
	Thu, 01 Nov 2012 16:35:56 -0400
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com, xen-devel@lists.xen.org,
	stefano.stabellini@eu.citrix.com
Date: Thu,  1 Nov 2012 16:35:47 -0400
Message-Id: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
X-Mailman-Approved-At: Thu, 01 Nov 2012 20:40:18 +0000
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Remove the old vtpm process model. It doesn't work very
well and is no longer supported.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

diff --git a/tools/Makefile b/tools/Makefile
index d8c8cc0..2ca43b9 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -18,8 +18,6 @@ SUBDIRS-$(CONFIG_XCUTILS) += xcutils
 SUBDIRS-$(CONFIG_X86) += firmware
 SUBDIRS-y += console
 SUBDIRS-y += xenmon
-SUBDIRS-$(VTPM_TOOLS) += vtpm_manager
-SUBDIRS-$(VTPM_TOOLS) += vtpm
 SUBDIRS-y += xenstat
 SUBDIRS-$(CONFIG_Linux) += $(SUBDIRS-libaio)
 SUBDIRS-$(CONFIG_Linux) += memshr 
diff --git a/tools/blktap2/drivers/hashtable.c b/tools/blktap2/drivers/hashtable.c
index 631306b..90a6b85 100644
--- a/tools/blktap2/drivers/hashtable.c
+++ b/tools/blktap2/drivers/hashtable.c
@@ -3,7 +3,6 @@
 /*
  * There are duplicates of this code in:
  *  - tools/xenstore/hashtable.c
- *  - tools/vtpm_manager/util/hashtable.c
  */
 
 #include "hashtable.h"
diff --git a/tools/blktap2/drivers/hashtable.h b/tools/blktap2/drivers/hashtable.h
index 89aa3dc..56ca053 100644
--- a/tools/blktap2/drivers/hashtable.h
+++ b/tools/blktap2/drivers/hashtable.h
@@ -3,7 +3,6 @@
 /*
  * There are duplicates of this code in:
  *  - tools/xenstore/hashtable.h
- *  - tools/vtpm_manager/util/hashtable.h
  */
 
 #ifndef __HASHTABLE_CWC22_H__
diff --git a/tools/blktap2/drivers/hashtable_itr.c b/tools/blktap2/drivers/hashtable_itr.c
index 402e06b..731917c 100644
--- a/tools/blktap2/drivers/hashtable_itr.c
+++ b/tools/blktap2/drivers/hashtable_itr.c
@@ -1,10 +1,5 @@
 /* Copyright (C) 2002, 2004 Christopher Clark  <firstname.lastname@cl.cam.ac.uk> */
 
-/*
- * There are duplicates of this code in:
- *  - tools/vtpm_manager/util/hashtable_itr.c
- */
-
 #include "hashtable.h"
 #include "hashtable_private.h"
 #include "hashtable_itr.h"
diff --git a/tools/blktap2/drivers/hashtable_itr.h b/tools/blktap2/drivers/hashtable_itr.h
index 3d80638..81da838 100644
--- a/tools/blktap2/drivers/hashtable_itr.h
+++ b/tools/blktap2/drivers/hashtable_itr.h
@@ -1,10 +1,5 @@
 /* Copyright (C) 2002, 2004 Christopher Clark <firstname.lastname@cl.cam.ac.uk> */
 
-/*
- * There are duplicates of this code in:
- *  - tools/vtpm_manager/util/hashtable_itr.h
- */
-
 #ifndef __HASHTABLE_ITR_CWC22__
 #define __HASHTABLE_ITR_CWC22__
 #include "hashtable.h"
diff --git a/tools/blktap2/drivers/hashtable_private.h b/tools/blktap2/drivers/hashtable_private.h
index 5a13a65..954ecc3 100644
--- a/tools/blktap2/drivers/hashtable_private.h
+++ b/tools/blktap2/drivers/hashtable_private.h
@@ -3,7 +3,6 @@
 /*
  * There are duplicates of this code in:
  *  - tools/xenstore/hashtable_private.h
- *  - tools/vtpm_manager/util/hashtable_private.h
  */
 
 #ifndef __HASHTABLE_PRIVATE_CWC22_H__
diff --git a/tools/configure.ac b/tools/configure.ac
index e708f01..586313d 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -40,7 +40,6 @@ m4_include([m4/fetcher.m4])
 # Enable/disable options
 AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
 AX_ARG_DEFAULT_ENABLE([monitors], [Disable xenstat and xentop monitoring tools])
-AX_ARG_DEFAULT_DISABLE([vtpm], [Enable Virtual Trusted Platform Module])
 AX_ARG_DEFAULT_DISABLE([xenapi], [Enable Xen API Bindings])
 AX_ARG_DEFAULT_ENABLE([ocamltools], [Disable Ocaml tools])
 AX_ARG_DEFAULT_DISABLE([miniterm], [Enable miniterm])
diff --git a/tools/examples/README b/tools/examples/README
index 5b0314e..2225d5c 100644
--- a/tools/examples/README
+++ b/tools/examples/README
@@ -25,13 +25,7 @@ vif-bridge          - virtual network start/stop script in bridged mode
 vif-common.sh       - sourced by vif-bridge 
 vif-nat             - xen virtual network start/stop script in NAT mode 
 vif-route           - xen virtual network start/stop script in routed mode
-vtpm                - called by xen-backend.agent to bind/unbind vTPM devices
-vtpm-common.sh      - common code for vTPM handling
-vtpm-delete         - remove an entry from the vTPM table given the
-                      domain's name
-vtpm-hotplug-common.sh - sourced by vtpm
-vtpm-migration.sh   - sourced by external-device-migrate
-xen-backend.agent   - calls block, vif-*, vtpm scripts to add, remove, hotplug
+xen-backend.agent   - calls block, vif-* scripts to add, remove, hotplug
                       devices  
 xen-backend.rules   - hotplug script rules
 xend-config.sxp     - default xend configuration file
diff --git a/tools/examples/xmexample.pv-grub b/tools/examples/xmexample.pv-grub
index 85f847c..e04e6c1 100644
--- a/tools/examples/xmexample.pv-grub
+++ b/tools/examples/xmexample.pv-grub
@@ -105,20 +105,6 @@ disk = [ 'phy:hda1,hda1,w' ]
 # configured in xend-config.sxp.
 
 #----------------------------------------------------------------------------
-# Define to which TPM instance the user domain should communicate.
-# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
-# where INSTANCE indicates the instance number of the TPM the VM
-# should be talking to and DOM provides the domain where the backend
-# is located.
-# Note that no two virtual machines should try to connect to the same
-# TPM instance. The handling of all TPM instances does require
-# some management effort in so far that VM configration files (and thus
-# a VM) should be associated with a TPM instance throughout the lifetime
-# of the VM / VM configuration file. The instance number must be
-# greater or equal to 1.
-#vtpm = [ 'instance=1,backend=0' ]
-
-#----------------------------------------------------------------------------
 # Configure the behaviour when a domain exits.  There are three 'reasons'
 # for a domain to stop: poweroff, reboot, and crash.  For each of these you
 # may specify:
diff --git a/tools/examples/xmexample1 b/tools/examples/xmexample1
index 330aaf0..c951200 100644
--- a/tools/examples/xmexample1
+++ b/tools/examples/xmexample1
@@ -101,20 +101,6 @@ disk = [ 'phy:hda1,hda1,w' ]
 # configured in xend-config.sxp.
 
 #----------------------------------------------------------------------------
-# Define to which TPM instance the user domain should communicate.
-# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
-# where INSTANCE indicates the instance number of the TPM the VM
-# should be talking to and DOM provides the domain where the backend
-# is located.
-# Note that no two virtual machines should try to connect to the same
-# TPM instance. The handling of all TPM instances does require
-# some management effort in so far that VM configration files (and thus
-# a VM) should be associated with a TPM instance throughout the lifetime
-# of the VM / VM configuration file. The instance number must be
-# greater or equal to 1.
-#vtpm = [ 'instance=1,backend=0' ]
-
-#----------------------------------------------------------------------------
 # Set the kernel command line for the new domain.
 # You only need to define the IP parameters and hostname if the domain's
 # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
diff --git a/tools/examples/xmexample2 b/tools/examples/xmexample2
index 4e5eb3d..8c5137e 100644
--- a/tools/examples/xmexample2
+++ b/tools/examples/xmexample2
@@ -137,20 +137,6 @@ disk = [ 'phy:sda%d,sda1,w' % (7+vmid),
 # configured in xend-config.sxp.
 
 #----------------------------------------------------------------------------
-# Define to which TPM instance the user domain should communicate.
-# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
-# where INSTANCE indicates the instance number of the TPM the VM
-# should be talking to and DOM provides the domain where the backend
-# is located.
-# Note that no two virtual machines should try to connect to the same
-# TPM instance. The handling of all TPM instances does require
-# some management effort in so far that VM configration files (and thus
-# a VM) should be associated with a TPM instance throughout the lifetime
-# of the VM / VM configuration file. The instance number must be
-# greater or equal to 1.
-#vtpm = ['instance=%d,backend=0' % (vmid) ]
-
-#----------------------------------------------------------------------------
 # Set the kernel command line for the new domain.
 # You only need to define the IP parameters and hostname if the domain's
 # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
diff --git a/tools/examples/xmexample3 b/tools/examples/xmexample3
index dc22ce1..ae799f9 100644
--- a/tools/examples/xmexample3
+++ b/tools/examples/xmexample3
@@ -122,20 +122,6 @@ disk = [ 'phy:hda%d,hda1,w' % (vmid)]
 # configured in xend-config.sxp.
 
 #----------------------------------------------------------------------------
-# Define to which TPM instance the user domain should communicate.
-# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
-# where INSTANCE indicates the instance number of the TPM the VM
-# should be talking to and DOM provides the domain where the backend
-# is located.
-# Note that no two virtual machines should try to connect to the same
-# TPM instance. The handling of all TPM instances does require
-# some management effort in so far that VM configration files (and thus
-# a VM) should be associated with a TPM instance throughout the lifetime
-# of the VM / VM configuration file. The instance number must be
-# greater or equal to 1.
-#vtpm = ['instance=%d,backend=0' % (vmid) ]
-
-#----------------------------------------------------------------------------
 # Set the kernel command line for the new domain.
 # You only need to define the IP parameters and hostname if the domain's
 # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 0166790..0605559 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -18,14 +18,12 @@ XEN_SCRIPTS += vif-setup
 XEN_SCRIPTS += block
 XEN_SCRIPTS += block-enbd block-nbd
 XEN_SCRIPTS += blktap
-XEN_SCRIPTS += vtpm vtpm-delete
 XEN_SCRIPTS += xen-hotplug-cleanup
 XEN_SCRIPTS += external-device-migrate
 XEN_SCRIPTS += vscsi
 XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
 XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
-XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
-XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
+XEN_SCRIPT_DATA += block-common.sh
 
 UDEV_RULES_DIR = $(CONFIG_DIR)/udev
 UDEV_RULES = xen-backend.rules xend.rules
diff --git a/tools/hotplug/Linux/vtpm b/tools/hotplug/Linux/vtpm
deleted file mode 100644
index 38a4532..0000000
--- a/tools/hotplug/Linux/vtpm
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-dir=$(dirname "$0")
-. "$dir/vtpm-hotplug-common.sh"
-
-vtpm_fatal_error=0
-
-case "$command" in
-  add)
-    vtpm_create_instance
-  ;;
-  remove)
-    vtpm_remove_instance
-  ;;
-esac
-
-if [ $vtpm_fatal_error -eq 0 ]; then
-	log debug "Successful vTPM operation '$command'."
-	success
-else
-	fatal "Error while executing vTPM operation '$command'."
-fi
diff --git a/tools/hotplug/Linux/vtpm-common.sh b/tools/hotplug/Linux/vtpm-common.sh
deleted file mode 100644
index d0d7935..0000000
--- a/tools/hotplug/Linux/vtpm-common.sh
+++ /dev/null
@@ -1,448 +0,0 @@
-#
-# Copyright (c) 2005 IBM Corporation
-# Copyright (c) 2005 XenSource Ltd.
-#
-# 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
-#
-
-dir=$(dirname "$0")
-. "$dir/logging.sh"
-. "$dir/locking.sh"
-
-VTPMDB="/var/vtpm/vtpm.db"
-
-#In the vtpm-impl file some commands should be defined:
-#      vtpm_create, vtpm_setup, vtpm_start, etc. (see below)
-if [ -r "$dir/vtpm-impl.alt" ]; then
-	. "$dir/vtpm-impl.alt"
-elif [ -r "$dir/vtpm-impl" ]; then
-	. "$dir/vtpm-impl"
-else
-	function vtpm_create () {
-		true
-	}
-	function vtpm_setup() {
-		true
-	}
-	function vtpm_start() {
-		true
-	}
-	function vtpm_suspend() {
-		true
-	}
-	function vtpm_resume() {
-		true
-	}
-	function vtpm_delete() {
-		true
-	}
-	function vtpm_migrate() {
-		echo "Error: vTPM migration accross machines not implemented."
-	}
-	function vtpm_migrate_local() {
-		echo "Error: local vTPM migration not supported"
-	}
-	function vtpm_migrate_recover() {
-		true
-	}
-fi
-
-
-#Find the instance number for the vtpm given the name of the domain
-# Parameters
-# - vmname : the name of the vm
-# Return value
-#  Returns '0' if instance number could not be found, otherwise
-#  it returns the instance number in the variable 'instance'
-function vtpmdb_find_instance () {
-	local vmname ret instance
-	vmname=$1
-	ret=0
-
-	instance=$(cat $VTPMDB |                   \
-	          awk -vvmname=$vmname             \
-	          '{                               \
-	             if ( 1 != index($1,"#")) {    \
-	               if ( $1 == vmname ) {       \
-	                 print $2;                 \
-	                 exit;                     \
-	               }                           \
-	             }                             \
-	           }')
-	if [ "$instance" != "" ]; then
-		ret=$instance
-	fi
-	echo "$ret"
-}
-
-
-# Check whether a particular instance number is still available
-# returns "0" if it is not available, "1" otherwise.
-function vtpmdb_is_free_instancenum () {
-	local instance instances avail i
-	instance=$1
-	avail=1
-	#Allowed instance number range: 1-255
-	if [ $instance -eq 0 -o $instance -gt 255 ]; then
-		avail=0
-	else
-		instances=$(cat $VTPMDB |                \
-		           awk                          \
-		           '{                            \
-		               if (1 != index($1,"#")) { \
-		                 printf("%s ",$2);       \
-		               }                         \
-		            }')
-		for i in $instances; do
-			if [ $i -eq $instance ]; then
-				avail=0
-				break
-			fi
-		done
-	fi
-	echo "$avail"
-}
-
-
-# Get an available instance number given the database
-# Returns an unused instance number
-function vtpmdb_get_free_instancenum () {
-	local ctr instances don found
-	instances=$(cat $VTPMDB |                \
-	           awk                          \
-	           '{                            \
-	               if (1 != index($1,"#")) { \
-	                 printf("%s ",$2);       \
-	               }                         \
-	            }')
-	ctr=1
-	don=0
-	while [ $don -eq 0 ]; do
-		found=0
-		for i in $instances; do
-			if [ $i -eq $ctr ]; then
-				found=1;
-				break;
-			fi
-		done
-
-		if [ $found -eq 0 ]; then
-			don=1
-			break
-		fi
-		let ctr=ctr+1
-	done
-	echo "$ctr"
-}
-
-
-# Add a domain name and instance number to the DB file
-function vtpmdb_add_instance () {
-	local res vmname inst
-	vmname=$1
-	inst=$2
-
-	if [ ! -f $VTPMDB ]; then
-		echo "#Database for VM to vTPM association" > $VTPMDB
-		echo "#1st column: domain name" >> $VTPMDB
-		echo "#2nd column: TPM instance number" >> $VTPMDB
-	fi
-	res=$(vtpmdb_validate_entry $vmname $inst)
-	if [ $res -eq 0 ]; then
-		echo "$vmname $inst" >> $VTPMDB
-	fi
-}
-
-
-#Validate whether an entry is the same as passed to this
-#function
-function vtpmdb_validate_entry () {
-	local res rc vmname inst
-	rc=0
-	vmname=$1
-	inst=$2
-
-	res=$(cat $VTPMDB |            \
-	     awk -vvmname=$vmname     \
-	          -vinst=$inst         \
-	     '{                        \
-	         if ( 1 == index($1,"#")) {\
-	         } else                \
-	         if ( $1 == vmname &&  \
-	              $2 == inst) {    \
-	            printf("1");       \
-	            exit;              \
-	         } else                \
-	         if ( $1 == vmname ||  \
-	              $2 == inst) {    \
-	            printf("2");       \
-	            exit;              \
-	         }                     \
-	     }')
-
-	if [ "$res" == "1" ]; then
-		rc=1
-	elif [ "$res" == "2" ]; then
-		rc=2
-	fi
-	echo "$rc"
-}
-
-
-#Remove an entry from the vTPM database given its domain name
-#and instance number
-function vtpmdb_remove_entry () {
-	local vmname instance VTPMDB_TMP
-	vmname=$1
-	instance=$2
-	VTPMDB_TMP="$VTPMDB".tmp
-
-	$(cat $VTPMDB |            \
-	 awk -vvmname=$vmname     \
-	 '{                        \
-	    if ( $1 != vmname ) {  \
-	      print $0;            \
-	    }                      \
-	 '} > $VTPMDB_TMP)
-	if [ -e $VTPMDB_TMP ]; then
-		mv -f $VTPMDB_TMP $VTPMDB
-		vtpm_delete $instance
-	else
-		log err "Error creating temporary file '$VTPMDB_TMP'."
-	fi
-}
-
-
-# Find the reason for the creation of this device:
-# Returns 'resume' or 'create'
-function vtpm_get_create_reason () {
-	local resume
-	resume=$(xenstore_read $XENBUS_PATH/resume)
-	if [ "$resume" == "True" ]; then
-		echo "resume"
-	else
-		echo "create"
-	fi
-}
-
-
-#Create a vTPM instance
-# If no entry in the TPM database is found, the instance is
-# created and an entry added to the database.
-function vtpm_create_instance () {
-	local res instance domname reason uuid
-	uuid=$(xenstore_read "$XENBUS_PATH"/uuid)
-	reason=$(vtpm_get_create_reason)
-
-	claim_lock vtpmdb
-
-	instance="0"
-
-	if [ "$uuid" != "" ]; then
-		instance=$(vtpmdb_find_instance $uuid)
-	fi
-	if [ "$instance" == "0" ]; then
-		domname=$(xenstore_read "$XENBUS_PATH"/domain)
-		instance=$(vtpmdb_find_instance $domname)
-	fi
-
-	if [ "$instance" == "0" -a "$reason" != "create" ]; then
-		release_lock vtpmdb
-		return
-	fi
-
-	if [ "$instance" == "0" ]; then
-		#Try to give the preferred instance to the domain
-		instance=$(xenstore_read "$XENBUS_PATH"/pref_instance)
-		if [ "$instance" != "" ]; then
-			res=$(vtpmdb_is_free_instancenum $instance)
-			if [ $res -eq 0 ]; then
-				instance=$(vtpmdb_get_free_instancenum)
-			fi
-		else
-			instance=$(vtpmdb_get_free_instancenum)
-		fi
-
-		vtpm_create $instance
-
-		if [ $vtpm_fatal_error -eq 0 ]; then
-			if [ "$uuid" != "" ]; then
-				vtpmdb_add_instance $uuid $instance
-			else
-				vtpmdb_add_instance $domname $instance
-			fi
-		fi
-	else
-		if [ "$reason" == "resume" ]; then
-			vtpm_resume $instance
-		else
-			vtpm_start $instance
-		fi
-	fi
-
-	release_lock vtpmdb
-
-	xenstore_write $XENBUS_PATH/instance $instance
-}
-
-
-#Remove an instance when a VM is terminating or suspending.
-#Since it is assumed that the VM will appear again, the
-#entry is kept in the VTPMDB file.
-function vtpm_remove_instance () {
-	local instance reason domname uuid
-	#Stop script execution quietly if path does not exist (anymore)
-	xenstore-exists "$XENBUS_PATH"/domain
-	uuid=$(xenstore_read "$XENBUS_PATH"/uuid)
-
-	claim_lock vtpmdb
-
-	instance="0"
-
-	if [ "$uuid" != "" ]; then
-		instance=$(vtpmdb_find_instance $uuid)
-	fi
-
-	if [ "$instance" == "0" ]; then
-		domname=$(xenstore_read "$XENBUS_PATH"/domain)
-		instance=$(vtpmdb_find_instance $domname)
-	fi
-
-	if [ "$instance" != "0" ]; then
-		vtpm_suspend $instance
-	fi
-
-	release_lock vtpmdb
-}
-
-
-#Remove an entry in the VTPMDB file given the domain's name
-#1st parameter: The name of the domain
-function vtpm_delete_instance () {
-	local instance
-
-	claim_lock vtpmdb
-
-	instance=$(vtpmdb_find_instance $1)
-	if [ "$instance" != "0" ]; then
-		vtpmdb_remove_entry $1 $instance
-	fi
-
-	release_lock vtpmdb
-}
-
-# Determine whether the given address is local to this machine
-# Return values:
-#  "-1" : the given machine name is invalid
-#  "0"  : this is not an address of this machine
-#  "1"  : this is an address local to this machine
-function vtpm_isLocalAddress() {
-	local addr res
-	addr=$(ping $1 -c 1 |  \
-	       awk '{ print substr($3,2,length($3)-2); exit }')
-	if [ "$addr" == "" ]; then
-		echo "-1"
-		return
-	fi
-	res=$(ifconfig | grep "inet addr" |  \
-	     awk -vaddr=$addr               \
-	     '{                              \
-	        if ( addr == substr($2, 6)) {\
-	          print "1";                 \
-	        }                            \
-	     }'                              \
-	    )
-	if [ "$res" == "" ]; then
-		echo "0"
-		return
-	fi
-	echo "1"
-}
-
-# Perform a migration step. This function differentiates between migration
-# to the local host or to a remote machine.
-# Parameters:
-# 1st: destination host to migrate to
-# 2nd: name of the domain to migrate
-# 3rd: the migration step to perform
-function vtpm_migration_step() {
-	local res=$(vtpm_isLocalAddress $1)
-	if [ "$res" == "0" ]; then
-		vtpm_migrate $1 $2 $3
-	else
-		vtpm_migrate_local
-	fi
-}
-
-# Recover from migration due to an error. This function differentiates
-# between migration to the local host or to a remote machine.
-# Parameters:
-# 1st: destination host the migration was going to
-# 2nd: name of the domain that was to be migrated
-# 3rd: the last successful migration step that was done
-function vtpm_recover() {
-	local res
-	res=$(vtpm_isLocalAddress $1)
-	if [ "$res" == "0" ]; then
-		vtpm_migrate_recover $1 $2 $3
-	fi
-}
-
-
-#Determine the domain id given a domain's name.
-#1st parameter: name of the domain
-#return value: domain id  or -1 if domain id could not be determined
-function vtpm_domid_from_name () {
-	local id name ids
-	ids=$(xenstore-list /local/domain)
-	for id in $ids; do
-		name=$(xenstore-read /local/domain/$id/name)
-		if [ "$name" == "$1" ]; then
-			echo "$id"
-			return
-		fi
-	done
-	echo "-1"
-}
-
-#Determine the virtual TPM's instance number using the domain ID.
-#1st parm: domain ID
-function vtpm_uuid_by_domid() {
-	echo $(xenstore-read /local/domain/0/backend/vtpm/$1/0/uuid)
-}
-
-
-# Determine the vTPM's UUID by the name of the VM
-function vtpm_uuid_from_vmname() {
-	local domid=$(vtpm_domid_from_name $1)
-	if [ "$domid" != "-1" ]; then
-		echo $(vtpm_uuid_by_domid $domid)
-		return
-	fi
-	echo ""
-}
-
-#Add a virtual TPM instance number and its associated domain name
-#to the VTPMDB file and activate usage of this virtual TPM instance
-#by writing the instance number into the xenstore
-#1st parm: name of virtual machine
-#2nd parm: instance of associated virtual TPM
-function vtpm_add_and_activate() {
-	local domid=$(vtpm_domid_from_name $1)
-	local vtpm_uuid=$(vtpm_uuid_from_vmname $1)
-	if [ "$vtpm_uuid" != "" -a "$domid" != "-1" ]; then
-		vtpmdb_add_instance $vtpm_uuid $2
-		xenstore-write backend/vtpm/$domid/0/instance $2
-	fi
-}
diff --git a/tools/hotplug/Linux/vtpm-delete b/tools/hotplug/Linux/vtpm-delete
deleted file mode 100644
index b75b95b..0000000
--- a/tools/hotplug/Linux/vtpm-delete
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-
-# This scripts must be called the following way:
-# vtpm-delete <vtpm uuid>
-# or
-# vtpm-delete --vmname <vm name>
-
-dir=$(dirname "$0")
-. "$dir/vtpm-common.sh"
-
-if [ "$1" == "--vmname" ]; then
-	vtpm_uuid=$(vtpm_uuid_from_vmname $2)
-	if [ "$vtpm_uuid" != "" ];then
-		vtpm_delete_instance $vtpm_uuid
-	fi
-else
-	vtpm_delete_instance $1
-fi
diff --git a/tools/hotplug/Linux/vtpm-hotplug-common.sh b/tools/hotplug/Linux/vtpm-hotplug-common.sh
deleted file mode 100644
index 9fd35e7..0000000
--- a/tools/hotplug/Linux/vtpm-hotplug-common.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Copyright (c) 2005 IBM Corporation
-# Copyright (c) 2005 XenSource Ltd.
-#
-# 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
-#
-
-dir=$(dirname "$0")
-. "$dir/xen-hotplug-common.sh"
-
-findCommand "$@"
-if [ "$command" != "online" ]  &&
-   [ "$command" != "offline" ] &&
-   [ "$command" != "add" ]     &&
-   [ "$command" != "remove" ]
-then
-	log err "Invalid command: $command"
-	exit 1
-fi
-
-
-XENBUS_PATH="${XENBUS_PATH:?}"
-
-. "$dir/vtpm-common.sh"
diff --git a/tools/hotplug/Linux/vtpm-impl b/tools/hotplug/Linux/vtpm-impl
deleted file mode 100644
index 4f9a1fd..0000000
--- a/tools/hotplug/Linux/vtpm-impl
+++ /dev/null
@@ -1,208 +0,0 @@
-#!/bin/bash
-# ===================================================================
-# 
-# Copyright (c) 2005, Intel Corp.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-#   * Redistributions of source code must retain the above copyright 
-#     notice, this list of conditions and the following disclaimer.
-#   * Redistributions in binary form must reproduce the above 
-#     copyright notice, this list of conditions and the following 
-#     disclaimer in the documentation and/or other materials provided 
-#     with the distribution.
-#   * Neither the name of Intel Corporation nor the names of its 
-#     contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-# OF THE POSSIBILITY OF SUCH DAMAGE.
-# ===================================================================
-
-#            |        SRC        |    TAG  |      CMD SIZE     |        ORD       |mtype|strt
-TPM_CMD_OPEN=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x11\\x01\\x00\\x00\\x01\\x01\\x01
-TPM_CMD_RESM=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x11\\x01\\x00\\x00\\x01\\x01\\x02
-TPM_CMD_CLOS=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x0e\\x01\\x00\\x00\\x02
-TPM_CMD_DELE=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x0e\\x01\\x00\\x00\\x03
-
-TPM_TYPE_PVM=\\x01
-TPM_TYPE_HVM=\\x02
-
-TPM_SUCCESS=00000000
-
-TX_VTPM_MANAGER=/var/vtpm/fifos/from_console.fifo
-RX_VTPM_MANAGER=/var/vtpm/fifos/to_console.fifo
-
-VTPM_MIG=/usr/bin/vtpm_migrator
-
-# -------------------- Helpers for binary streams -----------
-
-function str_to_hex32() {
- printf "%0.8x" $1
-}
-
-function hex32_to_bin() {
- local inst=$(str_to_hex32 $1);
- 
- local n1=`echo $inst | sed 's/\(..\)....../\\\\x\1/'`
- local n2=`echo $inst | sed 's/..\(..\)..../\\\\x\1/'`
- local n3=`echo $inst | sed 's/....\(..\)../\\\\x\1/'`
- local n4=`echo $inst | sed 's/......\(..\)/\\\\x\1/'`
-
- echo "$n1$n2$n3$n4"
-}
-
-function vtpm_manager_cmd() {
- local cmd=$1;
- local inst=$2;
- local inst_bin=$(hex32_to_bin $inst);
-
- claim_lock vtpm_mgr
-
- #send cmd to vtpm_manager
- printf "$cmd$inst_bin" > $TX_VTPM_MANAGER
-
- #recv response
- set +e
- local resp_hex=`dd skip=10 bs=1 count=4 if=$RX_VTPM_MANAGER 2> /dev/null | xxd -ps`
- set -e
-
- release_lock vtpm_mgr
-
- #return whether the command was successful
- if [ $resp_hex -ne $TPM_SUCCESS ]; then
-   vtpm_fatal_error=1
-   false
-  else
-   true
- fi
-}
-
-# Helper to get vm type to pass to vtpm_manager open/resume
-function vtpm_get_type() {
- local inst=$(xenstore_read $XENBUS_PATH/frontend-id)
- local vm=$(xenstore_read /local/domain/$inst/vm)
- if [ "$vm" != "" ]; then
-  local ostype=$(xenstore-read $vm/image/ostype)
-  if [ "$ostype" == "hvm" ]; then
-   echo $TPM_TYPE_HVM;
-  else
-   echo $TPM_TYPE_PVM;
-  fi
- fi
-}
-
-# ------------------ Command handlers -----------------
-
-# Create new vtpm instance & set it up for use
-function vtpm_create () {
- # Creation is handled implicitly by the manager on first setup
- # so just set it up for use
- $(vtpm_start $1)
-}
-
-# Setup vtpm instance for use.
-function vtpm_start() {
- local vmtype=$(vtpm_get_type);
- $(vtpm_manager_cmd $TPM_CMD_OPEN$vmtype $1)
-}
-
-function vtpm_resume() {
- local vmtype=$(vtpm_get_type);
- $(vtpm_manager_cmd $TPM_CMD_RESM$vmtype $1)
-}
-
-# Reset the vtpm AKA clear PCRs
-function vtpm_reset() {
- #not used by current implemenation
- true
-}
-
-# Shutdown the vtpm while the vm is down
-# This could be a suspend of shutdown
-# we cannot distinquish, so save the state
-# and decide on startup if we should keep is
-function vtpm_suspend() {
- $(vtpm_manager_cmd $TPM_CMD_CLOS $1)
-}
-
-
-function vtpm_delete() {
- local inst=$1
- if $(vtpm_manager_cmd $TPM_CMD_DELE $inst); then
-   rm -f /var/vtpm/vtpm_dm_$1.data
-   true
- else 
-   vtpm_fatal_error=1
-   false
- fi
-}
-
-# Perform a migration step. This function differentiates between migration
-# to the local host or to a remote machine.
-# Parameters:
-# 1st: destination host to migrate to
-# 2nd: name of the domain to migrate
-# 3rd: the migration step to perform
-function vtpm_migrate() {
- local instance res
-
- instance=$(vtpmdb_find_instance $2)
- if [ "$instance" == "" ]; then
-  log err "VTPM Migratoin failed. Unable to translation of domain name"
-  echo "Error: VTPM Migration failed while looking up instance number"
- fi
-
- case "$3" in
-  0)
-   #Incicate migration supported
-   echo "0" 
-  ;;
-
-  1)
-   # Get Public Key from Destination
-   # Call vtpm_manager's migration part 1
-   claim_lock vtpm_mgr
-   $VTPM_MIG $1 $2 $instance $3
-   release_lock vtpm_mgr
-  ;;
-
-  2)
-   # Call manager's migration step 2 and send result to destination
-   # If successful remove from db
-   claim_lock vtpm_mgr
-   $VTPM_MIG $1 $2 $instance $3
-   release_lock vtpm_mgr
-  ;;
-
-  3)
-   if `ps x | grep "$VTPM_MIG $1"`; then
-    log err "VTPM Migration failed to complete."
-    echo "Error: VTPM Migration failed to complete."
-   fi
-  ;;
- esac
- 
-}
-
-
-function vtpm_migrate_recover() {
- echo "Error: Recovery not supported yet" 
-}
-
-function vtpm_migrate_local() {
- echo "Error: local vTPM migration not supported"
-}
diff --git a/tools/hotplug/Linux/vtpm-migration.sh b/tools/hotplug/Linux/vtpm-migration.sh
deleted file mode 100644
index 7e38ae2..0000000
--- a/tools/hotplug/Linux/vtpm-migration.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (c) 2005 IBM Corporation
-#
-# 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
-#
-
-dir=$(dirname "$0")
-. "$dir/vtpm-common.sh"
diff --git a/tools/hotplug/Linux/xen-backend.rules b/tools/hotplug/Linux/xen-backend.rules
index c591a3f..a0d409e 100644
--- a/tools/hotplug/Linux/xen-backend.rules
+++ b/tools/hotplug/Linux/xen-backend.rules
@@ -1,6 +1,5 @@
 SUBSYSTEM=="xen-backend", KERNEL=="tap*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/blktap $env{ACTION}"
 SUBSYSTEM=="xen-backend", KERNEL=="vbd*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/block $env{ACTION}"
-SUBSYSTEM=="xen-backend", KERNEL=="vtpm*", RUN+="/etc/xen/scripts/vtpm $env{ACTION}"
 SUBSYSTEM=="xen-backend", KERNEL=="vif2-*", RUN+="/etc/xen/scripts/vif2 $env{ACTION}"
 SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="online", RUN+="/etc/xen/scripts/vif-setup online type_if=vif"
 SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="offline", RUN+="/etc/xen/scripts/vif-setup offline type_if=vif"
diff --git a/tools/vtpm/Makefile b/tools/vtpm/Makefile
deleted file mode 100644
index 7b3efa5..0000000
--- a/tools/vtpm/Makefile
+++ /dev/null
@@ -1,74 +0,0 @@
-XEN_ROOT = $(CURDIR)/../..
-
-# Base definitions and rules
-include $(XEN_ROOT)/tools/vtpm/Rules.mk
-
-# Dir name for emulator (as dom0 tpm driver)
-TPM_EMULATOR_DIR = tpm_emulator
-# Dir name for vtpm instance
-VTPM_DIR = vtpm
-ORIG_DIR = orig
-
-# Emulator tarball name
-TPM_EMULATOR_NAME = tpm_emulator-0.5.1
-TPM_EMULATOR_TARFILE = $(TPM_EMULATOR_NAME).tar.gz
-
-GMP_HEADER = /usr/include/gmp.h
-
-.PHONY: all
-all: build
-
-.PHONY: build
-build: build_sub
-
-.PHONY: install
-install: build
-	$(MAKE) -C $(VTPM_DIR) install-recursive
-
-.PHONY: clean
-clean:
-	@if [ -d $(TPM_EMULATOR_DIR) ]; \
-		then $(MAKE) -C $(TPM_EMULATOR_DIR) clean; \
-	fi
-	@if [ -d $(VTPM_DIR) ]; \
-		then $(MAKE) -C $(VTPM_DIR) clean; \
-	fi
-
-.PHONY: mrproper
-mrproper:
-	rm -f $(TPM_EMULATOR_TARFILE) tpm_emulator.patch.old vtpm.patch.old
-	rm -rf $(TPM_EMULATOR_DIR) $(VTPM_DIR) $(ORIG_DIR)
-
-# Download Swiss emulator
-$(TPM_EMULATOR_TARFILE):
-	wget http://download.berlios.de/tpm-emulator/$(TPM_EMULATOR_TARFILE)
-
-# Create vtpm dirs
-$(VTPM_DIR)/tpmd/tpmd: $(TPM_EMULATOR_TARFILE) vtpm-0.5.1.patch
-	rm -rf $(VTPM_DIR)
-	tar -xzf $(TPM_EMULATOR_TARFILE)
-	mv $(TPM_EMULATOR_NAME) $(VTPM_DIR)
-
-	set -e; cd $(VTPM_DIR); \
-	patch -p1 < ../vtpm-0.5.1.patch; \
-	patch -p1 < ../vtpm-0.5.1-LDLIBS.patch
-
-orig: $(TPM_EMULATOR_TARFILE)
-	mkdir $(ORIG_DIR);
-	set -e; cd $(ORIG_DIR); \
-	tar -xzf ../$(TPM_EMULATOR_TARFILE);
-
-updatepatches: clean orig
-	find $(VTPM_DIR) -name "*.orig" -print | xargs rm -f; 
-	mv vtpm.patch vtpm.patch.old; 
-	diff -uprN $(TPM_EMULATOR_DIR) $(VTPM_DIR) > vtpm.patch || true;
-
-.PHONY: build_sub
-build_sub: $(VTPM_DIR)/tpmd/tpmd
-	set -e; if [ -e $(GMP_HEADER) ]; then \
-		$(MAKE) -C $(VTPM_DIR) version; \
-		$(MAKE) -C $(VTPM_DIR) all-recursive; \
-	else \
-		echo "=== Unable to build VTPMs. libgmp could not be found."; \
-	fi
-
diff --git a/tools/vtpm/README b/tools/vtpm/README
deleted file mode 100644
index 2008cbd..0000000
--- a/tools/vtpm/README
+++ /dev/null
@@ -1,45 +0,0 @@
-
-Directory Structure
-===================
-tools/vtpm/tpm_emulator-0.2b.tar.gz    -> TPM Emulator downloaded at build time that will
-                                          be patched and used for our vtpms
-tools/vtpm/vtpm.patch                  -> patch applied to tpm_emulator to make vtpm
-tools/vtpm/vtpm/                       -> (created on build) tpm_emulator moved to ring 3,
-                                          listens on a pair of fifos for TPM commands,
-                                          persistent state is sent via named fifo to vtpm
-                                            manager, which encrypts it and protects it.
-tools/vtpm/tpm_emulator.patch          -> To allow for debugging and testing on non-TPM
-                                          platforms, this patches the emulator to allow
-                                          it to be inserted into the dom0 kernel
-tools/vtpm/tpm_emulator-0.2            -> (created on build) directory containing patched emulator
-
-Compile Flags
-===================
-VTPM_MULTI_VM                -> Defined (not finished): VTPMs run in their own VMs
-                                Not Defined (default): VTPMs are processes
-
-Requirements
-============
-- xen-unstable 
-- IBM frontend/backend vtpm driver patch
-- vtpm_managerd
-- GNU MP Big number library (GMP)
-
-vtpmd Flow (for vtpm_manager. vtpmd never run by default)
-============================
-- Launch the VTPM manager (vtpm_managerd) which which begins listening to the BE with one thread
-  and listens to a named fifo that is shared by the vtpms to commuincate with the manager.
-- VTPM Manager listens to TPM BE.
-- When xend launches a tpm frontend equipped VM it contacts the manager over the vtpm backend. 
-- When the manager receives the open message from the BE, it launches a vtpm
-- Xend allows the VM to continue booting. 
-- When a TPM request is issued to the front end, the front end transmits the TPM request to the backend.
-- The manager receives the TPM requests and uses a named fifo to forward the request to the vtpm.
-- The fifo listener begins listening for the reply from vtpm for the request.
-- Vtpm processes request and replies to manager over shared named fifo.
-- If needed, the vtpm may send a request to the vtpm_manager at any time to save it's secrets to disk.
-- Manager receives response from vtpm and passes it back to backend for forwarding to guest.
-
-tpm_emulator flow
-==================
-Read documentation in tpm_emulator-0.2 directory
diff --git a/tools/vtpm/Rules.mk b/tools/vtpm/Rules.mk
deleted file mode 100644
index 548cff0..0000000
--- a/tools/vtpm/Rules.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-# Base definitions and rules (XEN_ROOT must be defined in including Makefile)
-include $(XEN_ROOT)/tools/Rules.mk
-
-#
-# Tool definitions
-#
-
-# General compiler flags
-CFLAGS   = -Werror -g3
-
-# Generic project files
-HDRS	= $(wildcard *.h)
-SRCS	= $(wildcard *.c)
-OBJS	= $(patsubst %.c,%.o,$(SRCS))
-
-# Generic (non-header) dependencies
-$(SRCS): Makefile $(XEN_ROOT)/tools/Rules.mk $(XEN_ROOT)/tools/vtpm/Rules.mk
-
-$(OBJS): $(SRCS)
-
--include $(DEPS)
-
-BUILD_EMULATOR = y
-
-# Make sure these are just rules
-.PHONY : all build install clean
diff --git a/tools/vtpm/tpm_emulator.patch b/tools/vtpm/tpm_emulator.patch
deleted file mode 100644
index c34c665..0000000
--- a/tools/vtpm/tpm_emulator.patch
+++ /dev/null
@@ -1,1919 +0,0 @@
-diff -uprN orig/tpm_emulator-0.4/AUTHORS tpm_emulator/AUTHORS
---- orig/tpm_emulator-0.4/AUTHORS	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/AUTHORS	2006-07-24 14:35:35.000000000 -0700
-@@ -1,2 +1,3 @@
- Mario Strasser <mast@gmx.net>
- Heiko Stamer <stamer@gaos.org> [DAA]
-+INTEL Corp <> [Dropped to Ring3]
-diff -uprN orig/tpm_emulator-0.4/ChangeLog tpm_emulator/ChangeLog
---- orig/tpm_emulator-0.4/ChangeLog	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/ChangeLog	2006-07-24 14:35:35.000000000 -0700
-@@ -1,3 +1,6 @@
-+????-??-?? Intel Corp
-+	* Moved module out of kernel to run as a ring 3 app
-+
- 2006-06-23  Mario Strasser <mast@gmx.net>
- 	* tpm_startup.c: behaviour of ST_CLEAR and storage of
- 		persistent data adapted
-diff -uprN orig/tpm_emulator-0.4/crypto/gmp_kernel_wrapper.c tpm_emulator/crypto/gmp_kernel_wrapper.c
---- orig/tpm_emulator-0.4/crypto/gmp_kernel_wrapper.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/crypto/gmp_kernel_wrapper.c	2006-07-24 14:35:35.000000000 -0700
-@@ -1,5 +1,6 @@
- /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
-  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-+ * Copyright (C) 2005 INTEL Corp
-  *
-  * This module is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published
-@@ -24,15 +25,10 @@ int __gmp_junk;
- void __attribute__ ((regparm(0))) __gmp_assert_fail(const char *filename, 
-   int linenum, const char *expr) 
- {
--  panic(KERN_CRIT TPM_MODULE_NAME "%s:%d: GNU MP assertion failed: %s\n", 
-+  error("%s:%d: GNU MP assertion failed: %s\n", 
-     filename, linenum, expr);
- }
- 
--void __attribute__ ((regparm(0))) abort(void)
--{
--  panic(KERN_CRIT TPM_MODULE_NAME "GNU MP abort() was called\n");
--}
--
- /* overwrite GNU MP random functions (used by mpz/millerrabin.c) */ 
- 
- void __attribute__ ((regparm(0))) gmp_randinit(gmp_randstate_t rstate, 
-@@ -77,20 +73,19 @@ void __attribute__ ((regparm(0))) mpz_ur
- 
- void __attribute__ ((regparm(0))) *kernel_allocate(size_t size)
- {
--  void *ret  = (void*)kmalloc(size, GFP_KERNEL);
--  if (!ret) panic(KERN_CRIT TPM_MODULE_NAME 
--    "GMP: cannot allocate memory (size=%u)\n", size);
-+  void *ret  = (void*)malloc(size);
-+  if (!ret) error("GMP: cannot allocate memory (size=%Zu)\n", size);
-   return ret;
- }
- 
- void __attribute__ ((regparm(0))) *kernel_reallocate(void *oldptr, 
-   size_t old_size, size_t new_size)
- {
--  void *ret = (void*)kmalloc(new_size, GFP_KERNEL);
--  if (!ret) panic(KERN_CRIT TPM_MODULE_NAME "GMP: Cannot reallocate memory "
--    "(old_size=%u new_size=%u)\n", old_size, new_size);
-+  void *ret = (void*)malloc(new_size);
-+  if (!ret) error("GMP: Cannot reallocate memory "
-+    "(old_size=%Zu new_size=%Zu)\n", old_size, new_size);
-   memcpy(ret, oldptr, old_size);
--  kfree(oldptr);
-+  free(oldptr);
-   return ret;
- }
- 
-@@ -99,7 +94,7 @@ void __attribute__ ((regparm(0))) kernel
-   /* overwrite used memory */
-   if (blk_ptr != NULL) { 
-     memset(blk_ptr, 0, blk_size);
--    kfree(blk_ptr);
-+    free(blk_ptr);
-   }
- }
- 
-diff -uprN orig/tpm_emulator-0.4/crypto/rsa.c tpm_emulator/crypto/rsa.c
---- orig/tpm_emulator-0.4/crypto/rsa.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/crypto/rsa.c	2006-07-24 14:35:35.000000000 -0700
-@@ -1,5 +1,6 @@
- /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
-  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-+ * Copyright (C) 2005 INTEL Corp
-  *
-  * This module is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published
-@@ -381,7 +382,7 @@ static int encode_message(int type, uint
-       msg[0] = 0x00;
-       get_random_bytes(&msg[1], SHA1_DIGEST_LENGTH);
-       sha1_init(&ctx);
--      sha1_update(&ctx, "TCPA", 4);
-+      sha1_update(&ctx, (uint8_t *) "TCPA", 4);
-       sha1_final(&ctx, &msg[1 + SHA1_DIGEST_LENGTH]);
-       memset(&msg[1 + 2 * SHA1_DIGEST_LENGTH], 0x00, 
-         msg_len - data_len - 2 * SHA1_DIGEST_LENGTH - 2);
-@@ -429,7 +430,7 @@ static int decode_message(int type, uint
-       mask_generation(&msg[1], SHA1_DIGEST_LENGTH,
-         &msg[1 + SHA1_DIGEST_LENGTH], msg_len - SHA1_DIGEST_LENGTH - 1);
-       sha1_init(&ctx);
--      sha1_update(&ctx, "TCPA", 4);
-+      sha1_update(&ctx, (uint8_t *) "TCPA", 4);
-       sha1_final(&ctx, &msg[1]);
-       if (memcmp(&msg[1], &msg[1 + SHA1_DIGEST_LENGTH], 
-           SHA1_DIGEST_LENGTH) != 0) return -1;
-diff -uprN orig/tpm_emulator-0.4/linux_module.c tpm_emulator/linux_module.c
---- orig/tpm_emulator-0.4/linux_module.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/linux_module.c	1969-12-31 16:00:00.000000000 -0800
-@@ -1,195 +0,0 @@
--/* Software-Based Trusted Platform Module (TPM) Emulator for Linux 
-- * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-- *
-- * This module is free software; you can redistribute it and/or modify 
-- * it under the terms of the GNU General Public License as published 
-- * by the Free Software Foundation; either version 2 of the License, 
-- * or (at your option) any later version.  
-- *
-- * This module 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.
-- *
-- * $Id: linux_module.c 91 2006-03-13 13:51:41Z mast $
-- */
--
--#include <linux/module.h>
--#include <linux/kernel.h>
--#include <linux/init.h>
--#include <linux/miscdevice.h>
--#include <linux/poll.h>
--#include "linux_module.h"
--#include "tpm/tpm_emulator.h"
--
--MODULE_LICENSE("GPL");
--MODULE_AUTHOR("Mario Strasser <mast@gmx.net>");
--MODULE_DESCRIPTION("Trusted Platform Module (TPM) Emulator");
--MODULE_SUPPORTED_DEVICE(TPM_DEVICE_NAME);
--
--/* module startup parameters */
--char *startup = "save";
--module_param(startup, charp, 0444);
--MODULE_PARM_DESC(startup, " Sets the startup mode of the TPM. "
--  "Possible values are 'clear', 'save' (default) and 'deactivated.");
--char *storage_file = "/var/tpm/tpm_emulator-1.2.0.2";
--module_param(storage_file, charp, 0644);
--MODULE_PARM_DESC(storage_file, " Sets the persistent-data storage " 
--  "file of the TPM.");
--
--/* TPM lock */
--static struct semaphore tpm_mutex;
--
--/* TPM command response */
--static struct {
--  uint8_t *data;
--  uint32_t size;
--} tpm_response;
--
--/* module state */
--#define STATE_IS_OPEN 0
--static uint32_t module_state;
--static struct timespec old_time;
--
--static int tpm_open(struct inode *inode, struct file *file)
--{
--  debug("%s()", __FUNCTION__);
--  if (test_and_set_bit(STATE_IS_OPEN, (void*)&module_state)) return -EBUSY;
--  return 0;
--}
--
--static int tpm_release(struct inode *inode, struct file *file)
--{
--  debug("%s()", __FUNCTION__);
--  clear_bit(STATE_IS_OPEN, (void*)&module_state);
--  down(&tpm_mutex);
--  if (tpm_response.data != NULL) {
--    kfree(tpm_response.data);
--    tpm_response.data = NULL;
--  }
--  up(&tpm_mutex);
--  return 0;
--}
--
--static ssize_t tpm_read(struct file *file, char *buf, size_t count, loff_t *ppos)
--{
--  debug("%s(%d)", __FUNCTION__, count);
--  down(&tpm_mutex);
--  if (tpm_response.data != NULL) {
--    count = min(count, (size_t)tpm_response.size - (size_t)*ppos);
--    count -= copy_to_user(buf, &tpm_response.data[*ppos], count);
--    *ppos += count;
--    if ((size_t)tpm_response.size == (size_t)*ppos) {
--      kfree(tpm_response.data);
--      tpm_response.data = NULL;
--    }
--  } else {
--    count = 0;
--  }
--  up(&tpm_mutex);
--  return count;
--}
--
--static ssize_t tpm_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
--{
--  debug("%s(%d)", __FUNCTION__, count);
--  down(&tpm_mutex);
--  *ppos = 0;
--  if (tpm_response.data != NULL) kfree(tpm_response.data);
--  if (tpm_handle_command(buf, count, &tpm_response.data, 
--                         &tpm_response.size) != 0) { 
--    count = -EILSEQ;
--    tpm_response.data = NULL;
--  }
--  up(&tpm_mutex);
--  return count;
--}
--
--#define TPMIOC_CANCEL   _IO('T', 0x00)
--#define TPMIOC_TRANSMIT _IO('T', 0x01)
--
--static int tpm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
--{
--  debug("%s(%d, %p)", __FUNCTION__, cmd, (char*)arg);
--  if (cmd == TPMIOC_TRANSMIT) {
--    uint32_t count = ntohl(*(uint32_t*)(arg + 2));
--    down(&tpm_mutex);
--    if (tpm_response.data != NULL) kfree(tpm_response.data);
--    if (tpm_handle_command((char*)arg, count, &tpm_response.data,
--                           &tpm_response.size) == 0) {
--      tpm_response.size -= copy_to_user((char*)arg, tpm_response.data,
--                            tpm_response.size);
--      kfree(tpm_response.data);
--      tpm_response.data = NULL;
--    } else {
--      tpm_response.size = 0;
--      tpm_response.data = NULL;
--    }
--    up(&tpm_mutex);
--    return tpm_response.size;
--  }
--  return -1;
--}
--
--struct file_operations fops = {
--  .owner   = THIS_MODULE,
--  .open    = tpm_open,
--  .release = tpm_release,
--  .read    = tpm_read,
--  .write   = tpm_write,
--  .ioctl   = tpm_ioctl,
--};
--
--static struct miscdevice tpm_dev = {
--  .minor      = TPM_DEVICE_MINOR, 
--  .name       = TPM_DEVICE_NAME, 
--  .fops       = &fops,
--};
--
--int __init init_tpm_module(void)
--{
--  int res = misc_register(&tpm_dev);
--  if (res != 0) {
--    error("misc_register() failed for minor %d\n", TPM_DEVICE_MINOR);
--    return res;
--  }
--  /* initialize variables */
--  sema_init(&tpm_mutex, 1);
--  module_state = 0;
--  tpm_response.data = NULL;
--  old_time = current_kernel_time();
--  /* initialize TPM emulator */
--  if (!strcmp(startup, "clear")) {
--    tpm_emulator_init(1);
--  } else if (!strcmp(startup, "save")) {
--    tpm_emulator_init(2);
--  } else if (!strcmp(startup, "deactivated")) {
--    tpm_emulator_init(3);
--  } else {
--    error("invalid startup mode '%s'; must be 'clear', "
--      "'save' (default) or 'deactivated", startup);
--    misc_deregister(&tpm_dev);
--    return -EINVAL;
--  }
--  return 0;
--}
--
--void __exit cleanup_tpm_module(void)
--{
--  tpm_emulator_shutdown();
--  misc_deregister(&tpm_dev);
--  if (tpm_response.data != NULL) kfree(tpm_response.data);
--}
--
--module_init(init_tpm_module);
--module_exit(cleanup_tpm_module);
--
--uint64_t tpm_get_ticks(void)
--{
--  struct timespec new_time = current_kernel_time();
--  uint64_t ticks = (uint64_t)(new_time.tv_sec - old_time.tv_sec) * 1000000
--                   + (new_time.tv_nsec - old_time.tv_nsec) / 1000;
--  old_time = new_time;
--  return (ticks > 0) ? ticks : 1;
--}
--
-diff -uprN orig/tpm_emulator-0.4/linux_module.h tpm_emulator/linux_module.h
---- orig/tpm_emulator-0.4/linux_module.h	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/linux_module.h	2006-07-24 14:35:35.000000000 -0700
-@@ -1,5 +1,6 @@
- /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
-  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-+ * Copyright (C) 2005 INTEL Corp
-  *
-  * This module is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published
-@@ -17,54 +18,62 @@
- #ifndef _LINUX_MODULE_H_
- #define _LINUX_MODULE_H_
- 
--#include <linux/version.h>
--#include <linux/kernel.h>
--#include <linux/slab.h>
-+#include <malloc.h>
-+#include <stdint.h>
-+#include <stdio.h>
-+#include <string.h>
- #include <linux/types.h>
--#include <linux/string.h>
--#include <linux/random.h>
--#include <linux/time.h>
--#include <asm/byteorder.h>
- 
--/* module settings */
-+#include <endian.h>
-+#define __BYTEORDER_HAS_U64__
-+#ifdef LITTLE_ENDIAN
-+ #include <linux/byteorder/little_endian.h>
-+#else
-+ #include <linux/byteorder/big_endian.h>
-+#endif
- 
-+/* module settings */
-+#define min(A,B) ((A)<(B)?(A):(B))
-+#ifndef STR
- #define STR(s) __STR__(s)
- #define __STR__(s) #s
-+#endif
- #include "tpm_version.h"
- 
- #define TPM_DEVICE_MINOR  224
- #define TPM_DEVICE_NAME   "tpm"
- #define TPM_MODULE_NAME   "tpm_emulator"
- 
--/* debug and log output functions */
--
- #ifdef DEBUG
--#define debug(fmt, ...) printk(KERN_DEBUG "%s %s:%d: Debug: " fmt "\n", \
--                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define debug(fmt, ...) printf("TPMD: %s:%d: Debug: " fmt "\n", \
-+                        __FILE__, __LINE__, ## __VA_ARGS__)
- #else
- #define debug(fmt, ...) 
- #endif
--#define info(fmt, ...)  printk(KERN_INFO "%s %s:%d: Info: " fmt "\n", \
--                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
--#define error(fmt, ...) printk(KERN_ERR "%s %s:%d: Error: " fmt "\n", \
--                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
--#define alert(fmt, ...) printk(KERN_ALERT "%s %s:%d: Alert: " fmt "\n", \
--                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define info(fmt, ...)  printf("TPMD: %s:%d: Info: " fmt "\n", \
-+                        __FILE__, __LINE__, ## __VA_ARGS__)
-+#define error(fmt, ...) printf("TPMD: %s:%d: Error: " fmt "\n", \
-+                        __FILE__, __LINE__, ## __VA_ARGS__)
-+#define alert(fmt, ...) printf("TPMD: %s:%d: Alert: " fmt "\n", \
-+                        __FILE__, __LINE__, ## __VA_ARGS__)
- 
- /* memory allocation */
- 
- static inline void *tpm_malloc(size_t size) 
- {
--  return kmalloc(size, GFP_KERNEL);  
-+  return malloc(size);  
- }
- 
- static inline void tpm_free(const void *ptr)
- {
--  if (ptr != NULL) kfree(ptr);
-+  if (ptr != NULL) free( (void *) ptr);
- }
- 
- /* random numbers */
- 
-+//FIXME;
-+void get_random_bytes(void *buf, int nbytes);
-+
- static inline void tpm_get_random_bytes(void *buf, int nbytes)
- {
-   get_random_bytes(buf, nbytes);
-@@ -84,9 +93,9 @@ uint64_t tpm_get_ticks(void);
- #define CPU_TO_LE16(x) __cpu_to_le16(x)
- 
- #define BE64_TO_CPU(x) __be64_to_cpu(x)
--#define LE64_TO_CPU(x) __be64_to_cpu(x)
-+#define LE64_TO_CPU(x) __le64_to_cpu(x)
- #define BE32_TO_CPU(x) __be32_to_cpu(x)
--#define LE32_TO_CPU(x) __be32_to_cpu(x)
-+#define LE32_TO_CPU(x) __le32_to_cpu(x)
- #define BE16_TO_CPU(x) __be16_to_cpu(x)
- #define LE16_TO_CPU(x) __le16_to_cpu(x)
- 
-diff -uprN orig/tpm_emulator-0.4/Makefile tpm_emulator/Makefile
---- orig/tpm_emulator-0.4/Makefile	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/Makefile	2006-07-24 14:35:35.000000000 -0700
-@@ -1,24 +1,40 @@
- # Software-Based Trusted Platform Module (TPM) Emulator for Linux
- # Copyright (C) 2004 Mario Strasser <mast@gmx.net>
-+# Copyright (C) 2006 INTEL Corp.
- #
- # $Id: Makefile 115 2006-06-23 10:36:44Z mast $
- 
--# kernel settings
--KERNEL_RELEASE := $(shell uname -r)
--KERNEL_BUILD   := /lib/modules/$(KERNEL_RELEASE)/build
--MOD_SUBDIR     := misc
-+COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
- 
- # module settings
--MODULE_NAME    := tpm_emulator
-+BIN            := tpm_emulator
- VERSION_MAJOR  := 0
- VERSION_MINOR  := 4
- VERSION_BUILD  := $(shell date +"%s")
- 
--# enable/disable DEBUG messages
--EXTRA_CFLAGS   += -Wall -DDEBUG -g  
-+# Installation program and options
-+INSTALL         = install
-+INSTALL_PROG    = $(INSTALL) -m0755
-+INSTALL_DIR     = $(INSTALL) -d -m0755
-+
-+# Xen tools installation directory
-+TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin
-+
-+CC      := gcc
-+CFLAGS  += -g -Wall $(INCLUDE) -DDEBUG
-+CFLAGS  += -I. -Itpm
-+
-+# Is the simulator running in it's own vm?
-+#CFLAGS += -DVTPM_MULTI_VM
-+
-+ifeq ($(COMPILE_ARCH),x86_64)
-+LIBDIR = lib64
-+else
-+LIBDIR = lib
-+endif
- 
- # GNU MP configuration
--GMP_LIB        := /usr/lib/libgmp.a
-+GMP_LIB        := /usr/$(LIBDIR)/libgmp.a
- GMP_HEADER     := /usr/include/gmp.h
- 
- # sources and objects
-@@ -27,38 +43,32 @@ DIRS           := . crypto tpm 
- SRCS           := $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.c))
- OBJS           := $(patsubst %.c, %.o, $(SRCS))
- SRCS           += $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.h))
--DISTSRC        := ./README ./AUTHORS ./ChangeLog ./Makefile $(SRCS)
--DISTDIR        := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)
- 
--obj-m               := $(MODULE_NAME).o
--$(MODULE_NAME)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
-+obj-m               := $(BIN)
-+$(BIN)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
- 
- EXTRA_CFLAGS   += -I$(src) -I$(src)/crypto -I$(src)/tpm 
- 
- # do not print "Entering directory ..."
- MAKEFLAGS      += --no-print-directory
- 
--all:	$(src)/crypto/gmp.h $(src)/crypto/libgmp.a version
--	@$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules
-+all: $(BIN)
- 
--install:
--	@$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules_install
--	test -d /var/tpm || mkdir /var/tpm
--	test -c /dev/tpm || mknod /dev/tpm c 10 224
--	chmod 666 /dev/tpm
--	depmod -a
-+$(BIN):	$(src)/crypto/gmp.h $(src)/crypto/libgmp.a version $(SRCS) $(OBJS)
-+	$(CC) $(CFLAGS) $(OBJS) $(src)/crypto/libgmp.a -o $(BIN)
-+
-+%.o: %.c
-+	$(CC) $(CFLAGS) -c $< -o $@
-+
-+install: $(BIN)
-+	$(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)
-+	@if [ ! -d "/var/tpm" ]; then mkdir /var/tpm; fi
- 
- clean:
--	@$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) clean
--	rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a
-+	rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a $(OBJS)
- 
--dist:	$(DISTSRC)
--	rm -rf $(DISTDIR)
--	mkdir $(DISTDIR)
--	cp --parents $(DISTSRC) $(DISTDIR)/
--	rm -f $(DISTDIR)/crypto/gmp.h 
--	tar -chzf $(DISTDIR).tar.gz $(DISTDIR)
--	rm -rf $(DISTDIR)
-+mrproper: clean
-+	rm -f $(BIN) tpm_version.h
- 
- $(src)/crypto/libgmp.a:
- 	test -f $(src)/crypto/libgmp.a || ln -s $(GMP_LIB) $(src)/crypto/libgmp.a
-@@ -88,4 +98,3 @@ version:
- 	@echo "#endif /* _TPM_VERSION_H_ */" >> $(src)/tpm_version.h
- 
- .PHONY: all install clean dist gmp version
--
-diff -uprN orig/tpm_emulator-0.4/README tpm_emulator/README
---- orig/tpm_emulator-0.4/README	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/README	2006-07-24 14:35:35.000000000 -0700
-@@ -13,7 +13,8 @@ $Id: README 113 2006-06-18 12:38:13Z hst
- Copyright
- --------------------------------------------------------------------------
- Copyright (C) 2004 Mario Strasser <mast@gmx.net> and Swiss Federal 
--Institute of Technology (ETH) Zurich.
-+                   Institute of Technology (ETH) Zurich.
-+Copyright (C) 2005 INTEL Corp 
-               
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
-@@ -43,6 +44,12 @@ Example:
- GMP_LIB        := /usr/lib/libgmp.a
- GMP_HEADER     := /usr/include/gmp.h
- 
-+GNU MP Library on 64 bit Systems
-+--------------------------------------------------------------------------
-+Some 64-bit kernels have problems with importing the user-space gmp 
-+library (/usr/lib*/libgmp.a) into kernel space.  These kernels will require
-+that the gmp library be recompiled for kernel space with -mcmodel=kernel.
-+
- Installation
- --------------------------------------------------------------------------
- The compilation and installation process uses the build environment for 
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_capability.c tpm_emulator/tpm/tpm_capability.c
---- orig/tpm_emulator-0.4/tpm/tpm_capability.c	2006-06-23 19:37:07.000000000 +0900
-+++ tpm_emulator/tpm/tpm_capability.c	2007-12-28 22:50:19.000000000 +0900
-@@ -701,7 +701,10 @@ TPM_RESULT TPM_GetCapabilityOwner(TPM_VE
-   TPM_RESULT res;
-   
-   info("TPM_GetCapabilityOwner()");
--  
-+ 
-+  if (!tpmData.permanent.flags.owned) {
-+    return TPM_NOSRK;
-+  } 
-   /* Verify owner authorization */
-   res = tpm_verify_auth(auth1, tpmData.permanent.data.ownerAuth, TPM_KH_OWNER);
-   if (res != TPM_SUCCESS) return res;
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c tpm_emulator/tpm/tpm_cmd_handler.c
---- orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c	2006-06-23 19:37:07.000000000 +0900
-+++ tpm_emulator/tpm/tpm_cmd_handler.c	2007-09-12 20:23:00.000000000 +0900
-@@ -565,7 +565,7 @@ static TPM_RESULT execute_TPM_Seal(TPM_R
-   if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle)
-       || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth)
-       || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize)
--      || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)
-+      || (pcrInfoSize >0 && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo))
-       || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize)
-       || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize)
-       || len != 0) return TPM_BAD_PARAMETER;
-@@ -798,7 +798,7 @@ static TPM_RESULT execute_TPM_Sealx(TPM_
-   if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle)
-       || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth)
-       || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize)
--      || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)
-+      || (pcrInfoSize > 0 && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo))
-       || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize)
-       || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize)
-       || len != 0) return TPM_BAD_PARAMETER;
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_credentials.c tpm_emulator/tpm/tpm_credentials.c
---- orig/tpm_emulator-0.4/tpm/tpm_credentials.c	2006-06-23 19:37:07.000000000 +0900
-+++ tpm_emulator/tpm/tpm_credentials.c	2007-09-12 20:23:30.000000000 +0900
-@@ -47,20 +47,20 @@ int tpm_compute_pubkey_checksum(TPM_NONC
- 
- TPM_RESULT tpm_get_pubek(TPM_PUBKEY *pubEndorsementKey)
- {
--  UINT32 key_length;
-+  size_t key_length;
-   if (!tpmData.permanent.data.endorsementKey.size) return TPM_NO_ENDORSEMENT;
-   /* setup TPM_PUBKEY structure */
--  key_length = tpmData.permanent.data.endorsementKey.size;
--  pubEndorsementKey->pubKey.keyLength = key_length >> 3;
-+  pubEndorsementKey->pubKey.keyLength = tpmData.permanent.data.endorsementKey.size >> 3;
-   pubEndorsementKey->pubKey.key = tpm_malloc(pubEndorsementKey->pubKey.keyLength);
-   if (pubEndorsementKey->pubKey.key == NULL) return TPM_FAIL;
-   rsa_export_modulus(&tpmData.permanent.data.endorsementKey,
--    pubEndorsementKey->pubKey.key,
--    &pubEndorsementKey->pubKey.keyLength);
-+		     pubEndorsementKey->pubKey.key,
-+		     &key_length);
-+  pubEndorsementKey->pubKey.keyLength = key_length;
-   pubEndorsementKey->algorithmParms.algorithmID = TPM_ALG_RSA;
-   pubEndorsementKey->algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
-   pubEndorsementKey->algorithmParms.sigScheme = TPM_SS_NONE;
--  pubEndorsementKey->algorithmParms.parms.rsa.keyLength = key_length;
-+  pubEndorsementKey->algorithmParms.parms.rsa.keyLength = key_length << 3;
-   pubEndorsementKey->algorithmParms.parms.rsa.numPrimes = 2;
-   pubEndorsementKey->algorithmParms.parms.rsa.exponentSize = 0;
-   pubEndorsementKey->algorithmParms.parms.rsa.exponent = NULL;
-@@ -175,6 +175,7 @@ TPM_RESULT TPM_OwnerReadInternalPub(TPM_
- {
-   TPM_RESULT res;
-   TPM_KEY_DATA *srk = &tpmData.permanent.data.srk;
-+  size_t key_length;
-   info("TPM_OwnerReadInternalPub()");
-   /* verify authorization */
-   res = tpm_verify_auth(auth1, tpmData.permanent.data.ownerAuth, TPM_KH_OWNER);
-@@ -186,7 +187,8 @@ TPM_RESULT TPM_OwnerReadInternalPub(TPM_
-     publicPortion->pubKey.key = tpm_malloc(publicPortion->pubKey.keyLength);
-     if (publicPortion->pubKey.key == NULL) return TPM_FAIL;
-     rsa_export_modulus(&srk->key, publicPortion->pubKey.key, 
--      &publicPortion->pubKey.keyLength);
-+      &key_length);
-+    publicPortion->pubKey.keyLength = key_length;
-     publicPortion->algorithmParms.algorithmID = TPM_ALG_RSA;
-     publicPortion->algorithmParms.encScheme = srk->encScheme;
-     publicPortion->algorithmParms.sigScheme = srk->sigScheme;
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_crypto.c tpm_emulator/tpm/tpm_crypto.c
---- orig/tpm_emulator-0.4/tpm/tpm_crypto.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_crypto.c	2006-07-24 14:35:35.000000000 -0700
-@@ -182,7 +182,8 @@ TPM_RESULT TPM_CertifyKey(TPM_KEY_HANDLE
-   TPM_KEY_DATA *cert, *key;
-   sha1_ctx_t sha1_ctx;
-   BYTE *buf, *p;
--  UINT32 length;
-+  UINT32 length32;
-+  size_t length;
-   info("TPM_CertifyKey()");
-   /* get keys */
-   cert = tpm_get_key(certHandle);
-@@ -264,14 +265,15 @@ TPM_RESULT TPM_CertifyKey(TPM_KEY_HANDLE
-   /* compute the digest of the CERTIFY_INFO[2] structure and sign it */
-   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
-   p = buf = tpm_malloc(length);
-+  length32=(UINT32) length;
-   if (buf == NULL
--      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length, certifyInfo)) {
-+      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length32, certifyInfo)) {
-     free_TPM_KEY_PARMS(certifyInfo->algorithmParms);
-     return TPM_FAIL;
-   }
-   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
-   sha1_init(&sha1_ctx);
--  sha1_update(&sha1_ctx, buf, length);
-+  sha1_update(&sha1_ctx, buf, (size_t) length);
-   sha1_final(&sha1_ctx, buf);
-   res = tpm_sign(cert, auth1, FALSE, buf, SHA1_DIGEST_LENGTH, outData, outDataSize);
-   tpm_free(buf);
-@@ -292,7 +294,8 @@ TPM_RESULT TPM_CertifyKey2(TPM_KEY_HANDL
-   TPM_KEY_DATA *cert, *key;
-   sha1_ctx_t sha1_ctx;
-   BYTE *buf, *p;
--  UINT32 length;
-+  size_t length;
-+  UINT32 length32;
-   info("TPM_CertifyKey2()");
-   /* get keys */
-   cert = tpm_get_key(certHandle);
-@@ -362,8 +365,9 @@ TPM_RESULT TPM_CertifyKey2(TPM_KEY_HANDL
-   /* compute the digest of the CERTIFY_INFO[2] structure and sign it */
-   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
-   p = buf = tpm_malloc(length);
-+  length32 = (UINT32) length;
-   if (buf == NULL
--      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length, certifyInfo)) {
-+      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length32, certifyInfo)) {
-     free_TPM_KEY_PARMS(certifyInfo->algorithmParms);
-     return TPM_FAIL;
-   }
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_daa.c tpm_emulator/tpm/tpm_daa.c
---- orig/tpm_emulator-0.4/tpm/tpm_daa.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_daa.c	2006-07-24 14:35:35.000000000 -0700
-@@ -716,14 +716,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x00", 1);
-+      sha1_update(&sha1, (BYTE *) "\x00", 1);
-       sha1_final(&sha1, scratch);
-       sha1_init(&sha1);
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey, 
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x01", 1);
-+      sha1_update(&sha1, (BYTE *) "\x01", 1);
-       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
-       mpz_init(f), mpz_init(q);
-       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
-@@ -805,14 +805,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x00", 1);
-+      sha1_update(&sha1, (BYTE *) "\x00", 1);
-       sha1_final(&sha1, scratch);
-       sha1_init(&sha1);
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey, 
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x01", 1);
-+      sha1_update(&sha1, (BYTE *) "\x01", 1);
-       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
-       mpz_init(f), mpz_init(q);
-       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
-@@ -1489,14 +1489,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x00", 1);
-+      sha1_update(&sha1, (BYTE *) "\x00", 1);
-       sha1_final(&sha1, scratch);
-       sha1_init(&sha1);
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey, 
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x01", 1);
-+      sha1_update(&sha1, (BYTE *) "\x01", 1);
-       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
-       mpz_init(f), mpz_init(q);
-       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
-@@ -1712,14 +1712,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x00", 1);
-+      sha1_update(&sha1, (BYTE *) "\x00", 1);
-       sha1_final(&sha1, scratch);
-       sha1_init(&sha1);
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey, 
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x01", 1);
-+      sha1_update(&sha1, (BYTE *) "\x01", 1);
-       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
-       mpz_init(f), mpz_init(q);
-       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
-@@ -1793,14 +1793,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x00", 1);
-+      sha1_update(&sha1, (BYTE *) "\x00", 1);
-       sha1_final(&sha1, scratch);
-       sha1_init(&sha1);
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey, 
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x01", 1);
-+      sha1_update(&sha1, (BYTE *) "\x01", 1);
-       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
-       mpz_init(f), mpz_init(q);
-       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
-@@ -2918,14 +2918,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x00", 1);
-+      sha1_update(&sha1, (BYTE *) "\x00", 1);
-       sha1_final(&sha1, scratch);
-       sha1_init(&sha1);
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey, 
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x01", 1);
-+      sha1_update(&sha1, (BYTE *) "\x01", 1);
-       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
-       mpz_init(f), mpz_init(q);
-       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
-@@ -3143,7 +3143,7 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
-         sha1_init(&sha1);
-         sha1_update(&sha1, (BYTE*) &session->DAA_session.DAA_digest, 
-           sizeof(session->DAA_session.DAA_digest));
--        sha1_update(&sha1, "\x01", 1);
-+        sha1_update(&sha1, (BYTE *) "\x01", 1);
-         sha1_update(&sha1, inputData1, inputSize1);
-         sha1_final(&sha1, (BYTE*) &session->DAA_session.DAA_digest);
-       }
-@@ -3172,7 +3172,7 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
-         sha1_init(&sha1);
-         sha1_update(&sha1, (BYTE*) &session->DAA_session.DAA_digest, 
-           sizeof(session->DAA_session.DAA_digest));
--        sha1_update(&sha1, "\x00", 1);
-+        sha1_update(&sha1, (BYTE*) "\x00", 1);
-         rsa_export_modulus(&aikData->key, scratch, &size);
-         sha1_update(&sha1, scratch, size);
-         sha1_final(&sha1, (BYTE*) &session->DAA_session.DAA_digest);
-@@ -3229,14 +3229,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x00", 1);
-+      sha1_update(&sha1, (BYTE *) "\x00", 1);
-       sha1_final(&sha1, scratch);
-       sha1_init(&sha1);
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey, 
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x01", 1);
-+      sha1_update(&sha1, (BYTE *) "\x01", 1);
-       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
-       mpz_init(f), mpz_init(q);
-       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
-@@ -3309,14 +3309,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x00", 1);
-+      sha1_update(&sha1, (BYTE *) "\x00", 1);
-       sha1_final(&sha1, scratch);
-       sha1_init(&sha1);
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey, 
-           sizeof(session->DAA_tpmSpecific.DAA_rekey));
-       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count, 
-           sizeof(session->DAA_tpmSpecific.DAA_count));
--      sha1_update(&sha1, "\x01", 1);
-+      sha1_update(&sha1, (BYTE *) "\x01", 1);
-       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
-       mpz_init(f), mpz_init(q);
-       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_data.c tpm_emulator/tpm/tpm_data.c
---- orig/tpm_emulator-0.4/tpm/tpm_data.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_data.c	2006-07-24 14:35:35.000000000 -0700
-@@ -40,6 +40,7 @@ static inline void init_pcr_attr(int pcr
- void tpm_init_data(void)
- {
-   /* endorsement key */
-+#ifndef TPM_GENERATE_EK
-   uint8_t ek_n[] =  "\xa8\xdb\xa9\x42\xa8\xf3\xb8\x06\x85\x90\x76\x93\xad\xf7"
-     "\x74\xec\x3f\xd3\x3d\x9d\xe8\x2e\xff\x15\xed\x0e\xce\x5f\x93"
-     "\x92\xeb\xd1\x96\x2b\x72\x18\x81\x79\x12\x9d\x9c\x40\xd7\x1a"
-@@ -77,6 +78,8 @@ void tpm_init_data(void)
-     "\xd1\xc0\x8b\x5b\xa2\x2e\xa7\x15\xca\x50\x75\x10\x48\x9c\x2b"
-     "\x18\xb9\x67\x8f\x5d\x64\xc3\x28\x9f\x2f\x16\x2f\x08\xda\x47"
-     "\xec\x86\x43\x0c\x80\x99\x07\x34\x0f";
-+#endif
-+
-   int i;
-   /* reset all data to NULL, FALSE or 0 */
-   memset(&tpmData, 0, sizeof(tpmData));
-@@ -152,44 +155,43 @@ void tpm_release_data(void)
- 
- #ifdef TPM_STORE_TO_FILE
- 
--#include <linux/fs.h>
--#include <linux/unistd.h>
--#include <asm/uaccess.h>
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+#include <fcntl.h>
-+#include <unistd.h>
- 
- #define TPM_STORAGE_FILE "/var/tpm/tpm_emulator-1.2." STR(VERSION_MAJOR) "." STR(VERSION_MINOR) 
- 
- static int write_to_file(uint8_t *data, size_t data_length)
- {
-   int res;
--  struct file *fp;
--  mm_segment_t old_fs = get_fs();
--  fp = filp_open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
--  if (IS_ERR(fp)) return -1;
--  set_fs(get_ds());
--  res = fp->f_op->write(fp, data, data_length, &fp->f_pos);
--  set_fs(old_fs);
--  filp_close(fp, NULL);
-+  int fp;
-+  fp = open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
-+  res = write(fp, data, data_length);
-+  close(fp);
-   return (res == data_length) ? 0 : -1;
- }
- 
- static int read_from_file(uint8_t **data, size_t *data_length)
- {
-   int res;
--  struct file *fp;
--  mm_segment_t old_fs = get_fs();
--  fp = filp_open(TPM_STORAGE_FILE, O_RDONLY, 0);
--  if (IS_ERR(fp)) return -1;
--  *data_length = (size_t)fp->f_dentry->d_inode->i_size;
--  /* *data_length = i_size_read(fp->f_dentry->d_inode); */
-+  int fp, file_status;
-+  struct stat file_info;
-+  fp = open(TPM_STORAGE_FILE, O_RDONLY, 0);
-+  file_status = fstat(fp, &file_info);
-+  if (file_status < 0) {
-+    close(fp);
-+    return -1;
-+  } 
-+
-+  *data_length = file_info.st_size; 
-   *data = tpm_malloc(*data_length);
-   if (*data == NULL) {
--    filp_close(fp, NULL);
-+    close(fp);
-     return -1;
-   }
--  set_fs(get_ds());
--  res = fp->f_op->read(fp, *data, *data_length, &fp->f_pos);
--  set_fs(old_fs);
--  filp_close(fp, NULL);
-+  res = read(fp, *data, *data_length);
-+  close(fp);
-   if (res != *data_length) {
-     tpm_free(*data);
-     return -1;
-@@ -216,23 +218,30 @@ static int read_from_file(uint8_t **data
- int tpm_store_permanent_data(void)
- {
-   uint8_t *buf, *ptr;
--  size_t buf_length, len;
-+  UINT32 buf_length, len;
- 
-   /* marshal data */
--  buf_length = len = sizeof_TPM_STCLEAR_FLAGS(tpmData.stclear.flags)
--    + sizeof_TPM_PERMANENT_FLAGS(tpmData.permanent.flags) + 2
--    + sizeof_TPM_PERMANENT_DATA(tpmData.permanent.data);
-+  buf_length = len = 4 + sizeof_TPM_STCLEAR_FLAGS(tpmData.stclear.flags)
-+    + sizeof_TPM_PERMANENT_FLAGS(tpmData.permanent.flags) 
-+    + sizeof_TPM_STANY_FLAGS(tpmData.stany.flags) + 2
-+    + sizeof_TPM_STCLEAR_DATA(tpmData.stclear.data) 
-+    + sizeof_TPM_PERMANENT_DATA(tpmData.permanent.data)
-+    + sizeof_TPM_STANY_DATA(tpmData.stany.data);
-   buf = ptr = tpm_malloc(buf_length);
-   if (buf == NULL
-       || tpm_marshal_TPM_VERSION(&ptr, &len, &tpmData.permanent.data.version)
-       || tpm_marshal_TPM_STCLEAR_FLAGS(&ptr, &len, &tpmData.stclear.flags)
-       || tpm_marshal_TPM_PERMANENT_FLAGS(&ptr, &len, &tpmData.permanent.flags)
-+      || tpm_marshal_TPM_STANY_FLAGS(&ptr, &len, &tpmData.stany.flags)
-       || tpm_marshal_BOOL(&ptr, &len, tpmData.permanent.flags.selfTestSucceeded)
-       || tpm_marshal_BOOL(&ptr, &len, tpmData.permanent.flags.owned)
--      || tpm_marshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)) {
-+      || tpm_marshal_TPM_STCLEAR_DATA(&ptr, &len, &tpmData.stclear.data)
-+      || tpm_marshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)
-+      || tpm_marshal_TPM_STANY_DATA(&ptr, &len, &tpmData.stany.data)) {
-     tpm_free(buf);
-     return -1;
-   }
-+
-   if (write_to_file(buf, buf_length - len)) {
-     tpm_free(buf);
-     return -1; 
-@@ -244,31 +253,36 @@ int tpm_store_permanent_data(void)
- int tpm_restore_permanent_data(void)
- {
-   uint8_t *buf, *ptr;
--  size_t buf_length, len;
-+  size_t buf_length;
-+  UINT32 len;
-   TPM_VERSION ver;
- 
-   /* read data */
-   if (read_from_file(&buf, &buf_length)) return -1;
-   ptr = buf;
--  len = buf_length;
-+  len = (uint32_t) buf_length;
-   /* unmarshal data */
-   if (tpm_unmarshal_TPM_VERSION(&ptr, &len, &ver)
-       || memcmp(&ver, &tpmData.permanent.data.version, sizeof(TPM_VERSION))
-       || tpm_unmarshal_TPM_STCLEAR_FLAGS(&ptr, &len, &tpmData.stclear.flags)
-       || tpm_unmarshal_TPM_PERMANENT_FLAGS(&ptr, &len, &tpmData.permanent.flags)
-+      || tpm_unmarshal_TPM_STANY_FLAGS(&ptr, &len, &tpmData.stany.flags)
-       || tpm_unmarshal_BOOL(&ptr, &len, &tpmData.permanent.flags.selfTestSucceeded)
-       || tpm_unmarshal_BOOL(&ptr, &len, &tpmData.permanent.flags.owned)
--      || tpm_unmarshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)) {
-+      || tpm_unmarshal_TPM_STCLEAR_DATA(&ptr, &len, &tpmData.stclear.data)
-+      || tpm_unmarshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)
-+      || tpm_unmarshal_TPM_STANY_DATA(&ptr, &len, &tpmData.stany.data)) {
-     tpm_free(buf);
-     return -1;
-   }
-+
-   tpm_free(buf);
-   return 0;
- }
- 
- int tpm_erase_permanent_data(void)
- {
--  int res = write_to_file("", 0);
-+  int res = write_to_file((uint8_t *) "", 0);
-   return res;
- }
- 
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_deprecated.c tpm_emulator/tpm/tpm_deprecated.c
---- orig/tpm_emulator-0.4/tpm/tpm_deprecated.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_deprecated.c	2006-07-24 14:35:35.000000000 -0700
-@@ -1,6 +1,7 @@
- /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
-  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-  *                    Swiss Federal Institute of Technology (ETH) Zurich
-+ * Copyright (C) 2005 INTEL Corp
-  *
-  * This module is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published
-@@ -50,7 +51,7 @@ TPM_RESULT TPM_SaveKeyContext(TPM_KEY_HA
-   BYTE *ptr;
-   UINT32 len;
-   info("TPM_SaveKeyContext()");
--  res = TPM_SaveContext(keyHandle, TPM_RT_KEY, "SaveKeyContext..", 
-+  res = TPM_SaveContext(keyHandle, TPM_RT_KEY, (BYTE*)"SaveKeyContext..", 
-                         keyContextSize, &contextBlob);
-   if (res != TPM_SUCCESS) return res;
-   len = *keyContextSize;
-@@ -82,7 +83,7 @@ TPM_RESULT TPM_SaveAuthContext(TPM_AUTHH
-   BYTE *ptr;
-   UINT32 len;
-   info("TPM_SaveAuthContext()");
--  res = TPM_SaveContext(authHandle, TPM_RT_KEY, "SaveAuthContext.", 
-+  res = TPM_SaveContext(authHandle, TPM_RT_KEY, (BYTE*)"SaveAuthContext.", 
-                         authContextSize, &contextBlob);
-   if (res != TPM_SUCCESS) return res;
-   len = *authContextSize;
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_emulator.h tpm_emulator/tpm/tpm_emulator.h
---- orig/tpm_emulator-0.4/tpm/tpm_emulator.h	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_emulator.h	2006-07-24 14:35:35.000000000 -0700
-@@ -1,5 +1,6 @@
- /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
-  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-+ * Copyright (C) 2005 INTEL Corp
-  *
-  * This module is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published
-@@ -22,7 +23,8 @@
- /* TPM configuration */
- #define TPM_STORE_TO_FILE       1
- #undef  TPM_STRONG_PERSISTENCE
--#undef  TPM_GENERATE_EK
-+//#undef  TPM_GENERATE_EK
-+#define  TPM_GENERATE_EK
- #undef  TPM_GENERATE_SEED_DAA
- 
- #define TPM_MANUFACTURER 0x4554485A /* 'ETHZ' */        
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_marshalling.c tpm_emulator/tpm/tpm_marshalling.c
---- orig/tpm_emulator-0.4/tpm/tpm_marshalling.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_marshalling.c	2006-07-24 14:35:35.000000000 -0700
-@@ -1312,7 +1312,7 @@ int tpm_unmarshal_TPM_STANY_FLAGS(BYTE *
- 
- int tpm_marshal_RSA(BYTE **ptr, UINT32 *length, rsa_private_key_t *v)
- {
--  UINT32 m_len, e_len, q_len;
-+  size_t m_len, e_len, q_len;
-   if (*length < sizeof_RSA((*v))) return -1;
-   if (v->size > 0) {
-     rsa_export_modulus(v, &(*ptr)[6], &m_len);
-@@ -1460,6 +1460,66 @@ int tpm_unmarshal_TPM_PERMANENT_DATA(BYT
-   return 0;
- }
- 
-+int tpm_marshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v)
-+{
-+  if (tpm_marshal_TPM_STRUCTURE_TAG(ptr, length, v->tag)
-+    || tpm_marshal_TPM_NONCE(ptr, length, &v->contextNonceKey)
-+    || tpm_marshal_TPM_COUNT_ID(ptr, length, v->countID) ) return -1;
-+
-+  return 0;
-+}
-+
-+int tpm_unmarshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v)
-+{
-+  if (tpm_unmarshal_TPM_STRUCTURE_TAG(ptr, length, &v->tag)
-+    || tpm_unmarshal_TPM_NONCE(ptr, length, &v->contextNonceKey)
-+    || tpm_unmarshal_TPM_COUNT_ID(ptr, length, &v->countID) ) return -1;
-+
-+  return 0;
-+}
-+
-+int tpm_marshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v)
-+{
-+  UINT32 i;
-+  if (tpm_marshal_TPM_STRUCTURE_TAG(ptr, length, v->tag)
-+    || tpm_marshal_TPM_NONCE(ptr, length, &v->contextNonceSession)
-+    || tpm_marshal_TPM_DIGEST(ptr, length, &v->auditDigest)
-+    || tpm_marshal_BOOL(ptr, length, v->auditSession)
-+    || tpm_marshal_TPM_CURRENT_TICKS(ptr, length, &v->currentTicks)
-+    || tpm_marshal_UINT32(ptr, length, v->contextCount)
-+    || tpm_marshal_UINT32_ARRAY(ptr, length, v->contextList, TPM_MAX_SESSION_LIST)) return -1;
-+  for (i = 0; i < TPM_MAX_SESSIONS; i++) {
-+    if (tpm_marshal_TPM_SESSION_DATA(ptr, length, &v->sessions[i])) return -1;
-+  }
-+  for (i = 0; i < TPM_MAX_SESSIONS_DAA; i++) {
-+    if (tpm_marshal_TPM_DAA_SESSION_DATA(ptr, length, &v->sessionsDAA[i])) return -1;
-+  }
-+  if (tpm_marshal_TPM_TRANSHANDLE(ptr, length, v->transExclusive)) return -1;
-+
-+  return 0;
-+}
-+
-+int tpm_unmarshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v)
-+{
-+  UINT32 i;
-+  if (tpm_unmarshal_TPM_STRUCTURE_TAG(ptr, length, &v->tag)
-+    || tpm_unmarshal_TPM_NONCE(ptr, length, &v->contextNonceSession)
-+    || tpm_unmarshal_TPM_DIGEST(ptr, length, &v->auditDigest)
-+    || tpm_unmarshal_BOOL(ptr, length, &v->auditSession)
-+    || tpm_unmarshal_TPM_CURRENT_TICKS(ptr, length, &v->currentTicks)
-+    || tpm_unmarshal_UINT32(ptr, length, &v->contextCount)
-+    || tpm_unmarshal_UINT32_ARRAY(ptr, length, v->contextList, TPM_MAX_SESSION_LIST)) return -1;
-+  for (i = 0; i < TPM_MAX_SESSIONS; i++) {
-+    if (tpm_unmarshal_TPM_SESSION_DATA(ptr, length, &v->sessions[i])) return -1;
-+  }
-+  for (i = 0; i < TPM_MAX_SESSIONS_DAA; i++) {
-+    if (tpm_unmarshal_TPM_DAA_SESSION_DATA(ptr, length, &v->sessionsDAA[i])) return -1;
-+  }
-+  if (tpm_unmarshal_TPM_TRANSHANDLE(ptr, length, &v->transExclusive)) return -1;
-+
-+  return 0;
-+}
-+
- int tpm_marshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v)
- {
-   if (tpm_marshal_BYTE(ptr, length, v->type)
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_marshalling.h tpm_emulator/tpm/tpm_marshalling.h
---- orig/tpm_emulator-0.4/tpm/tpm_marshalling.h	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_marshalling.h	2006-07-24 14:35:35.000000000 -0700
-@@ -432,6 +432,12 @@ int tpm_unmarshal_TPM_KEY_DATA(BYTE **pt
- int tpm_marshal_TPM_PERMANENT_DATA(BYTE **ptr, UINT32 *length, TPM_PERMANENT_DATA *);
- int tpm_unmarshal_TPM_PERMANENT_DATA(BYTE **ptr, UINT32 *length, TPM_PERMANENT_DATA *);
- 
-+int tpm_marshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v);
-+int tpm_unmarshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v);
-+
-+int tpm_marshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v);
-+int tpm_unmarshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v);
-+
- int tpm_marshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v);
- int tpm_unmarshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v);
- 
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_owner.c tpm_emulator/tpm/tpm_owner.c
---- orig/tpm_emulator-0.4/tpm/tpm_owner.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_owner.c	2006-07-24 14:35:35.000000000 -0700
-@@ -108,7 +108,7 @@ TPM_RESULT TPM_TakeOwnership(TPM_PROTOCO
-   TPM_RESULT res;
-   rsa_private_key_t *ek = &tpmData.permanent.data.endorsementKey;
-   TPM_KEY_DATA *srk = &tpmData.permanent.data.srk;
--  UINT32 buf_size = ek->size >> 3;
-+  size_t buf_size = ek->size >> 3, key_length; 
-   BYTE buf[buf_size];
- 
-   info("TPM_TakeOwnership()");
-@@ -173,7 +173,8 @@ TPM_RESULT TPM_TakeOwnership(TPM_PROTOCO
-     return TPM_FAIL;
-   }
-   rsa_export_modulus(&srk->key, srkPub->pubKey.key,
--    &srkPub->pubKey.keyLength);
-+		     &key_length);
-+  srkPub->pubKey.keyLength = (UINT32) key_length;
-   /* setup tpmProof and set state to owned */
-   tpm_get_random_bytes(tpmData.permanent.data.tpmProof.nonce, 
-     sizeof(tpmData.permanent.data.tpmProof.nonce));
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_startup.c tpm_emulator/tpm/tpm_startup.c
---- orig/tpm_emulator-0.4/tpm/tpm_startup.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_startup.c	2006-07-24 14:35:35.000000000 -0700
-@@ -41,26 +41,29 @@ void TPM_Init(TPM_STARTUP_TYPE startupTy
- TPM_RESULT TPM_Startup(TPM_STARTUP_TYPE startupType)
- {
-   int i;
-+  int restore_fail;
-   info("TPM_Startup(%d)", startupType);
-   if (tpmData.stany.flags.postInitialise == FALSE) return TPM_INVALID_POSTINIT;
--  /* reset STANY_FLAGS */
--  SET_TO_ZERO(&tpmData.stany.flags);
--  tpmData.stany.flags.tag = TPM_TAG_STANY_FLAGS;
--  /* reset STANY_DATA (invalidates ALL sessions) */
--  SET_TO_ZERO(&tpmData.stany.data);
--  tpmData.stany.data.tag = TPM_TAG_STANY_DATA;
--  /* init session-context nonce */
--  SET_TO_RAND(&tpmData.stany.data.contextNonceSession);
-+
-+  /* try and restore state to get EK, SRK, etc */
-+  restore_fail = tpm_restore_permanent_data();
-+
-   /* set data and flags according to the given startup type */
-   if (startupType == TPM_ST_CLEAR) {
--    /* if available, restore permanent data */
--    tpm_restore_permanent_data();
-+    /* reset STANY_FLAGS */
-+    SET_TO_ZERO(&tpmData.stany.flags);
-+    tpmData.stany.flags.tag = TPM_TAG_STANY_FLAGS;
-+    /* reset STANY_DATA (invalidates ALL sessions) */
-+    SET_TO_ZERO(&tpmData.stany.data);
-+    tpmData.stany.data.tag = TPM_TAG_STANY_DATA;
-+    /* init session-context nonce */
-+    SET_TO_RAND(&tpmData.stany.data.contextNonceSession);
-     /* reset PCR values */
-     for (i = 0; i < TPM_NUM_PCR; i++) {
--      if (tpmData.permanent.data.pcrAttrib[i].pcrReset)
--        SET_TO_ZERO(tpmData.permanent.data.pcrValue[i].digest);
-+      if (!tpmData.permanent.data.pcrAttrib[i].pcrReset)
-+        SET_TO_ZERO(&tpmData.permanent.data.pcrValue[i].digest);
-       else
--        SET_TO_0xFF(tpmData.permanent.data.pcrValue[i].digest);
-+        SET_TO_0xFF(&tpmData.permanent.data.pcrValue[i].digest);
-     }
-     /* reset STCLEAR_FLAGS */
-     SET_TO_ZERO(&tpmData.stclear.flags);
-@@ -79,7 +82,8 @@ TPM_RESULT TPM_Startup(TPM_STARTUP_TYPE 
-     /* init key-context nonce */
-     SET_TO_RAND(&tpmData.stclear.data.contextNonceKey);
-   } else if (startupType == TPM_ST_STATE) {
--    if (tpm_restore_permanent_data()) {
-+    /* restore must have been successful for TPM_ST_STATE */
-+    if (restore_fail) {
-       error("restoring permanent data failed");
-       tpmData.permanent.data.testResult = "tpm_restore_permanent_data() failed";
-       tpmData.permanent.flags.selfTestSucceeded = FALSE;
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_storage.c tpm_emulator/tpm/tpm_storage.c
---- orig/tpm_emulator-0.4/tpm/tpm_storage.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_storage.c	2006-07-24 14:35:35.000000000 -0700
-@@ -58,6 +58,7 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
-                         BYTE *enc, UINT32 *enc_size)
- {
-   UINT32 len;
-+  size_t enc_size32 = *enc_size;
-   BYTE *buf, *ptr;
-   rsa_public_key_t pub_key;
-   int scheme;
-@@ -72,7 +73,7 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
-   if (buf == NULL
-       || tpm_marshal_TPM_SEALED_DATA(&ptr, &len, seal)
-       || rsa_encrypt(&pub_key, scheme, buf, sizeof_TPM_SEALED_DATA((*seal)),
--                     enc, enc_size)) {
-+                     enc, &enc_size32)) {
-     tpm_free(buf);
-     rsa_release_public_key(&pub_key);
-     return -1;
-@@ -85,7 +86,8 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
- int decrypt_sealed_data(TPM_KEY_DATA *key, BYTE *enc, UINT32 enc_size,
-                         TPM_SEALED_DATA *seal, BYTE **buf) 
- {
--  UINT32 len;
-+  size_t len;
-+  UINT32 len32;
-   BYTE *ptr;
-   int scheme;
-   switch (key->encScheme) {
-@@ -96,8 +98,12 @@ int decrypt_sealed_data(TPM_KEY_DATA *ke
-   len = enc_size;
-   *buf = ptr = tpm_malloc(len);
-   if (*buf == NULL
--      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len)
--      || tpm_unmarshal_TPM_SEALED_DATA(&ptr, &len, seal)) {
-+      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len) ){
-+    tpm_free(*buf);
-+    return -1;
-+  }
-+  len32 = len;
-+  if (tpm_unmarshal_TPM_SEALED_DATA(&ptr, &len32, seal)) {
-     tpm_free(*buf);
-     return -1;
-   }
-@@ -240,11 +246,12 @@ TPM_RESULT TPM_Unseal(TPM_KEY_HANDLE par
- 
- TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE keyHandle, UINT32 inDataSize,
-                       BYTE *inData, TPM_AUTH *auth1, 
--                      UINT32 *outDataSize, BYTE **outData)
-+                      UINT32 *outDataSize32, BYTE **outData)
- {
-   TPM_RESULT res;
-   TPM_KEY_DATA *key;
-   int scheme;
-+  size_t outDataSize;
-   
-   info("TPM_UnBind()");
-   /* get key */
-@@ -262,8 +269,8 @@ TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE key
-   /* the size of the input data muss be greater than zero */
-   if (inDataSize == 0) return TPM_BAD_PARAMETER;
-   /* decrypt data */
--  *outDataSize = inDataSize;
--  *outData = tpm_malloc(*outDataSize);
-+  outDataSize = inDataSize;
-+  *outData = tpm_malloc(outDataSize);
-   if (*outData == NULL) return TPM_NOSPACE;
-   switch (key->encScheme) {
-     case TPM_ES_RSAESOAEP_SHA1_MGF1: scheme = RSA_ES_OAEP_SHA1; break;
-@@ -271,20 +278,21 @@ TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE key
-     default: tpm_free(*outData); return TPM_DECRYPT_ERROR;
-   }
-   if (rsa_decrypt(&key->key, scheme, inData, inDataSize, 
--      *outData, outDataSize)) {
-+      *outData, &outDataSize)) {
-     tpm_free(*outData);
-     return TPM_DECRYPT_ERROR;
-   }
-   /* verify data if it is of type TPM_BOUND_DATA */
-   if (key->encScheme == TPM_ES_RSAESOAEP_SHA1_MGF1 
-       || key->keyUsage != TPM_KEY_LEGACY) {
--    if (*outDataSize < 5 || memcmp(*outData, "\x01\x01\00\x00\x02", 5) != 0) {
-+    if (outDataSize < 5 || memcmp(*outData, "\x01\x01\00\x00\x02", 5) != 0) {
-       tpm_free(*outData);
-       return TPM_DECRYPT_ERROR;
-     }
--    *outDataSize -= 5;
--    memmove(*outData, &(*outData)[5], *outDataSize);
-+    outDataSize -= 5;
-+    memmove(*outData, &(*outData)[5], outDataSize);
-   }
-+  *outDataSize32 = (UINT32) outDataSize;
-   return TPM_SUCCESS;
- }
- 
-@@ -334,12 +342,13 @@ int compute_pubkey_digest(TPM_PUBKEY *ke
- }
- 
- int encrypt_private_key(TPM_KEY_DATA *key, TPM_STORE_ASYMKEY *store,
--                        BYTE *enc, UINT32 *enc_size)
-+                        BYTE *enc, UINT32 *enc_size32)
- {
-   UINT32 len;
-   BYTE *buf, *ptr;
-   rsa_public_key_t pub_key;
-   int scheme;
-+  size_t enc_size;
-   switch (key->encScheme) {
-     case TPM_ES_RSAESOAEP_SHA1_MGF1: scheme = RSA_ES_OAEP_SHA1; break;
-     case TPM_ES_RSAESPKCSv15: scheme = RSA_ES_PKCSV15; break;
-@@ -351,11 +360,12 @@ int encrypt_private_key(TPM_KEY_DATA *ke
-   if (buf == NULL
-       || tpm_marshal_TPM_STORE_ASYMKEY(&ptr, &len, store)
-       || rsa_encrypt(&pub_key, scheme, buf, sizeof_TPM_STORE_ASYMKEY((*store)),
--                     enc, enc_size)) {
-+                     enc, &enc_size)) {
-     tpm_free(buf);
-     rsa_release_public_key(&pub_key);
-     return -1;
-   }
-+  *enc_size32 = (UINT32) enc_size;
-   tpm_free(buf);
-   rsa_release_public_key(&pub_key);
-   return 0;
-@@ -364,7 +374,8 @@ int encrypt_private_key(TPM_KEY_DATA *ke
- int decrypt_private_key(TPM_KEY_DATA *key, BYTE *enc, UINT32 enc_size, 
-                         TPM_STORE_ASYMKEY *store, BYTE **buf) 
- {
--  UINT32 len;
-+  UINT32 len32;
-+  size_t len;
-   BYTE *ptr;
-   int scheme;
-   switch (key->encScheme) {
-@@ -375,8 +386,12 @@ int decrypt_private_key(TPM_KEY_DATA *ke
-   len = enc_size;
-   *buf = ptr = tpm_malloc(len);
-   if (*buf == NULL
--      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len)
--      || tpm_unmarshal_TPM_STORE_ASYMKEY(&ptr, &len, store)) {
-+      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len) ) {
-+    tpm_free(*buf);
-+    return -1;
-+  }
-+  len32 = (UINT32) len;
-+  if (tpm_unmarshal_TPM_STORE_ASYMKEY(&ptr, &len32, store)) {  
-     tpm_free(*buf);
-     return -1;
-   }
-@@ -394,7 +409,7 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
-   TPM_SESSION_DATA *session;
-   TPM_STORE_ASYMKEY store;
-   rsa_private_key_t rsa;
--  UINT32 key_length;
-+  size_t key_length;
- 
-   info("TPM_CreateWrapKey()");
-   /* get parent key */
-@@ -450,11 +465,11 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
-     }
-   }
-   /* generate key and store it */
--  key_length = keyInfo->algorithmParms.parms.rsa.keyLength;
--  if (rsa_generate_key(&rsa, key_length)) return TPM_FAIL;
--  wrappedKey->pubKey.keyLength = key_length >> 3;
-+  if (rsa_generate_key(&rsa, keyInfo->algorithmParms.parms.rsa.keyLength)) 
-+    return TPM_FAIL;
-+  wrappedKey->pubKey.keyLength = keyInfo->algorithmParms.parms.rsa.keyLength >> 3;
-   wrappedKey->pubKey.key = tpm_malloc(wrappedKey->pubKey.keyLength);
--  store.privKey.keyLength = key_length >> 4;
-+  store.privKey.keyLength = keyInfo->algorithmParms.parms.rsa.keyLength >> 4;
-   store.privKey.key = tpm_malloc(store.privKey.keyLength);
-   wrappedKey->encDataSize = parent->key.size >> 3;
-   wrappedKey->encData = tpm_malloc(wrappedKey->encDataSize);
-@@ -466,9 +481,11 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
-     tpm_free(wrappedKey->encData);
-     return TPM_NOSPACE;
-   }
--  rsa_export_modulus(&rsa, wrappedKey->pubKey.key, 
--    &wrappedKey->pubKey.keyLength);
--  rsa_export_prime1(&rsa, store.privKey.key, &store.privKey.keyLength);
-+  rsa_export_modulus(&rsa, wrappedKey->pubKey.key,
-+		     &key_length);
-+  wrappedKey->pubKey.keyLength = (UINT32) key_length;
-+  rsa_export_prime1(&rsa, store.privKey.key, &key_length);
-+  store.privKey.keyLength = (UINT32) key_length;
-   rsa_release_private_key(&rsa);
-   /* compute the digest of the wrapped key (without encData) */
-   if (compute_key_digest(wrappedKey, &store.pubDataDigest)) {
-@@ -602,6 +619,7 @@ TPM_RESULT TPM_LoadKey2(TPM_KEY_HANDLE p
- 
- int tpm_setup_key_parms(TPM_KEY_DATA *key, TPM_KEY_PARMS *parms)
- {
-+  size_t key_length;
-   parms->algorithmID = TPM_ALG_RSA;
-   parms->encScheme = key->encScheme;
-   parms->sigScheme = key->sigScheme;
-@@ -611,7 +629,8 @@ int tpm_setup_key_parms(TPM_KEY_DATA *ke
-   parms->parms.rsa.exponent = tpm_malloc(parms->parms.rsa.exponentSize);
-   if (parms->parms.rsa.exponent == NULL) return -1;
-   rsa_export_exponent(&key->key, parms->parms.rsa.exponent,
--    &parms->parms.rsa.exponentSize);
-+    &key_length);
-+  parms->parms.rsa.exponentSize = (UINT32) key_length;
-   parms->parmSize = 12 + parms->parms.rsa.exponentSize;
-   return 0;
- }
-@@ -622,6 +641,7 @@ TPM_RESULT TPM_GetPubKey(TPM_KEY_HANDLE 
-   TPM_RESULT res;
-   TPM_KEY_DATA *key;
-   TPM_DIGEST digest;
-+  size_t key_length;
-   info("TPM_GetPubKey()");
-   /* get key */
-   if (keyHandle == TPM_KH_SRK
-@@ -650,8 +670,8 @@ TPM_RESULT TPM_GetPubKey(TPM_KEY_HANDLE 
-   pubKey->pubKey.keyLength = key->key.size >> 3;
-   pubKey->pubKey.key = tpm_malloc(pubKey->pubKey.keyLength);
-   if (pubKey->pubKey.key == NULL) return TPM_NOSPACE;
--  rsa_export_modulus(&key->key, pubKey->pubKey.key, 
--    &pubKey->pubKey.keyLength);
-+  rsa_export_modulus(&key->key, pubKey->pubKey.key, &key_length);
-+  pubKey->pubKey.keyLength = (UINT32) key_length;
-   if (tpm_setup_key_parms(key, &pubKey->algorithmParms) != 0) {
-     error("TPM_GetPubKey(): tpm_setup_key_parms() failed.");
-     tpm_free(pubKey->pubKey.key);
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_structures.h tpm_emulator/tpm/tpm_structures.h
---- orig/tpm_emulator-0.4/tpm/tpm_structures.h	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_structures.h	2006-07-24 14:35:35.000000000 -0700
-@@ -1958,6 +1958,7 @@ typedef struct tdTPM_DAA_ISSUER {
-   TPM_DIGEST DAA_digest_gamma;
-   BYTE DAA_generic_q[26];
- } TPM_DAA_ISSUER;
-+#define sizeof_TPM_DAA_ISSUER(s) (2 + (20 * 6) + 26 )
- 
- /*
-  * TPM_DAA_TPM ([TPM_Part2], Section 22.4)
-@@ -1973,6 +1974,7 @@ typedef struct tdTPM_DAA_TPM {
-   TPM_DIGEST DAA_rekey;
-   UINT32 DAA_count;
- } TPM_DAA_TPM;
-+#define sizeof_TPM_DAA_TPM(s) (2 + (4 * 20) + 4)
- 
- /*
-  * TPM_DAA_CONTEXT ([TPM_Part2], Section 22.5)
-@@ -1987,6 +1989,7 @@ typedef struct tdTPM_DAA_CONTEXT {
-   BYTE DAA_scratch[256];
-   BYTE DAA_stage;
- } TPM_DAA_CONTEXT;
-+#define sizeof_TPM_DAA_CONTEXT(s) (2 + (3 * 20) + 256 + 1)
- 
- /*
-  * TPM_DAA_JOINDATA ([TPM_Part2], Section 22.6)
-@@ -1998,6 +2001,7 @@ typedef struct tdTPM_DAA_JOINDATA {
-   BYTE DAA_join_u1[138];
-   TPM_DIGEST DAA_digest_n0;
- } TPM_DAA_JOINDATA;
-+#define sizeof_TPM_DAA_JOINDATA(s) (1 + 1 + 20)
- 
- /*
-  * TPM_DAA_BLOB ([TPM_Part2], Section 22.8)
-@@ -2202,6 +2206,7 @@ typedef struct tdTPM_STCLEAR_DATA {
-   //UINT32 ownerReference;
-   //BOOL disableResetLock;
- } TPM_STCLEAR_DATA;
-+#define sizeof_TPM_STCLEAR_DATA(s) (2 + 20 + 4)
- 
- /*
-  * TPM_SESSION_DATA
-@@ -2238,6 +2243,11 @@ typedef struct tdTPM_DAA_SESSION_DATA {
-   TPM_DAA_JOINDATA DAA_joinSession;
-   TPM_HANDLE handle;
- } TPM_DAA_SESSION_DATA;
-+#define sizeof_TPM_DAA_SESSION_DATA(s) ( 1 \
-+  + sizeof_TPM_DAA_ISSUER(s.DAA_issuerSettings) \
-+  + sizeof_TPM_DAA_TPM(s.DAA_tpmSpecific) \
-+  + sizeof_TPM_DAA_CONTEXT(s.DAA_session) \
-+  + sizeof_TPM_DAA_JOINDATA(s.DAA_joinSession) + 4)
- 
- /*
-  * TPM_STANY_DATA ([TPM_Part2], Section 7.6)
-@@ -2262,6 +2272,11 @@ typedef struct tdTPM_STANY_DATA {
-   TPM_DAAHANDLE currentDAA;
-   TPM_TRANSHANDLE transExclusive;
- } TPM_STANY_DATA;
-+#define sizeof_TPM_STANY_DATA(s) (2 + 20 + 20 + 1 \
-+  + sizeof_TPM_CURRENT_TICKS(s.currentTicks) \
-+  + 4 + (4 * TPM_MAX_SESSION_LIST) \
-+  + (sizeof_TPM_SESSION_DATA(s.sessions[0]) * TPM_MAX_SESSION_LIST) \
-+  + (sizeof_TPM_DAA_SESSION_DATA(s.sessionsDAA[0]) * TPM_MAX_SESSIONS_DAA) + 4)
- 
- /*
-  * TPM_DATA
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_testing.c tpm_emulator/tpm/tpm_testing.c
---- orig/tpm_emulator-0.4/tpm/tpm_testing.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_testing.c	2006-07-24 14:35:35.000000000 -0700
-@@ -1,6 +1,7 @@
- /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
-  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-  *                    Swiss Federal Institute of Technology (ETH) Zurich
-+ * Copyright (C) 2005 INTEL Corp
-  *
-  * This module is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published
-@@ -95,24 +96,24 @@ static int tpm_test_sha1(void)
-   struct {
-     uint8_t *data; uint32_t repetitions; uint8_t *digest;
-   } test_cases[] =  {{
--    "abc", 1,
--    "\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D"
-+	(uint8_t*)"abc", 1,
-+    (uint8_t*)"\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D"
-   }, {
--    "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 1,
--    "\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29\xE5\xE5\x46\x70\xF1"
-+    (uint8_t*)"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 1,
-+    (uint8_t*)"\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29\xE5\xE5\x46\x70\xF1"
-   }, {
--    "a", 1000000,
--    "\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F"
-+    (uint8_t*)"a", 1000000,
-+    (uint8_t*)"\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F"
-   }, {
--    "0123456701234567012345670123456701234567012345670123456701234567", 10,
--    "\xDE\xA3\x56\xA2\xCD\xDD\x90\xC7\xA7\xEC\xED\xC5\xEB\xB5\x63\x93\x4F\x46\x04\x52"
-+    (uint8_t*)"0123456701234567012345670123456701234567012345670123456701234567", 10,
-+    (uint8_t*)"\xDE\xA3\x56\xA2\xCD\xDD\x90\xC7\xA7\xEC\xED\xC5\xEB\xB5\x63\x93\x4F\x46\x04\x52"
-   }};
- 
-   debug("tpm_test_sha1()");
-   for (i = 0; i < sizeof(test_cases) / sizeof(test_cases[0]); i++) {
-     sha1_init(&ctx);
-     for (j = 0; j < test_cases[i].repetitions; j++)
--      sha1_update(&ctx, test_cases[i].data, strlen(test_cases[i].data));
-+      sha1_update(&ctx, test_cases[i].data, strlen((char*)test_cases[i].data));
-     sha1_final(&ctx, digest);
-     if (memcmp(digest, test_cases[i].digest, SHA1_DIGEST_LENGTH) != 0) return -1;
-   }
-@@ -128,41 +129,41 @@ static int tpm_test_hmac(void)
-   struct {
-     uint8_t *key, key_len, *data, data_len, *digest;
-   } test_cases[] = {{
--    "\x0b", 20, "Hi There", 8,
--    "\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"
-+    (uint8_t*)"\x0b", 20, (uint8_t*)"Hi There", 8,
-+    (uint8_t*)"\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"
-   }, {
--    "Jefe", 4, "what do ya want for nothing?", 28,
--    "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79"
-+    (uint8_t*)"Jefe", 4, (uint8_t*)"what do ya want for nothing?", 28,
-+    (uint8_t*)"\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79"
-   }, {
--    "\xaa", 20, "\xdd", 50,
--    "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3"
-+    (uint8_t*)"\xaa", 20, (uint8_t*)"\xdd", 50,
-+    (uint8_t*)"\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3"
-   }, {
--    "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
--    "\x15\x16\x17\x18\x19", 25, "\xcd", 50,
--    "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda"
-+    (uint8_t*)"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
-+    "\x15\x16\x17\x18\x19", 25, (uint8_t*)"\xcd", 50,
-+    (uint8_t*)"\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda"
-   }, {
--    "\x0c", 20, "Test With Truncation", 20,
--    "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04"
-+    (uint8_t*)"\x0c", 20, (uint8_t*)"Test With Truncation", 20,
-+    (uint8_t*)"\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04"
-   }, {
--    "\xaa", 80, "Test Using Larger Than Block-Size Key - Hash Key First", 54,
--    "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12"
-+    (uint8_t*)"\xaa", 80, (uint8_t*)"Test Using Larger Than Block-Size Key - Hash Key First", 54,
-+    (uint8_t*)"\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12"
-   }, {
--    "\xaa", 80,
--    "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", 73,
--    "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91"
-+    (uint8_t*)"\xaa", 80,
-+    (uint8_t*)"Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", 73,
-+    (uint8_t*)"\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91"
-   }};
- 
-   debug("tpm_test_hmac()");
-   for (i = 0; i < sizeof(test_cases) / sizeof(test_cases[0]); i++) {
--    if (strlen(test_cases[i].key) < test_cases[i].key_len) {
-+    if (strlen((char*)test_cases[i].key) < test_cases[i].key_len) {
-       uint8_t key[test_cases[i].key_len];
-       memset(key, test_cases[i].key[0], test_cases[i].key_len);
-       hmac_init(&ctx, key, test_cases[i].key_len);
-     } else {
-       hmac_init(&ctx, test_cases[i].key, test_cases[i].key_len);
-     }
--    for (j = 0; j < test_cases[i].data_len; j += strlen(test_cases[i].data)) {
--      hmac_update(&ctx, test_cases[i].data, strlen(test_cases[i].data));
-+    for (j = 0; j < test_cases[i].data_len; j += strlen((char*)test_cases[i].data)) {
-+      hmac_update(&ctx, test_cases[i].data, strlen((char*)test_cases[i].data));
-     }
-     hmac_final(&ctx, digest);
-     if (memcmp(digest, test_cases[i].digest, SHA1_DIGEST_LENGTH) != 0) return -1;
-@@ -173,9 +174,9 @@ static int tpm_test_hmac(void)
- static int tpm_test_rsa_EK(void)
- {
-   int res = 0;
--  char *data = "RSA PKCS #1 v1.5 Test-String";
-+  uint8_t *data = (uint8_t*)"RSA PKCS #1 v1.5 Test-String";
-   uint8_t buf[256];
--  size_t buf_len, data_len = strlen(data);
-+  size_t buf_len, data_len = strlen((char*)data);
-   rsa_private_key_t priv_key;
-   rsa_public_key_t pub_key;
- 
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_ticks.c tpm_emulator/tpm/tpm_ticks.c
---- orig/tpm_emulator-0.4/tpm/tpm_ticks.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_ticks.c	2006-07-24 14:35:35.000000000 -0700
-@@ -1,6 +1,7 @@
- /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
-  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-  *                    Swiss Federal Institute of Technology (ETH) Zurich
-+ * Copyright (C) 2005 INTEL Corp
-  *
-  * This module is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published
-@@ -39,9 +40,7 @@ TPM_RESULT TPM_SetTickType(TPM_TICKTYPE 
- TPM_RESULT TPM_GetTicks(TPM_CURRENT_TICKS *currentTime)
- {
-   info("TPM_GetTicks()");
--  memcpy(currentTime, &tpmData.stany.data.currentTicks, 
--    sizeof(TPM_CURRENT_TICKS));
--  return TPM_SUCCESS;
-+  return TPM_DISABLED_CMD;
- }
- 
- TPM_RESULT TPM_TickStampBlob(TPM_KEY_HANDLE keyHandle, TPM_NONCE *antiReplay,
-@@ -49,64 +48,11 @@ TPM_RESULT TPM_TickStampBlob(TPM_KEY_HAN
-                              TPM_CURRENT_TICKS *currentTicks, 
-                              UINT32 *sigSize, BYTE **sig)
- {
--  TPM_RESULT res;
--  TPM_KEY_DATA *key;
--  BYTE *info, *p;
--  UINT32 info_length, length;
-   info("TPM_TickStampBlob()");
--  /* get key */
--  key = tpm_get_key(keyHandle);
--  if (key == NULL) return TPM_INVALID_KEYHANDLE;
--  /* verify authorization */ 
--  res = tpm_verify_auth(auth1, key->usageAuth, keyHandle);
--  if (res != TPM_SUCCESS) return res;
--  if (key->keyUsage != TPM_KEY_SIGNING && key->keyUsage != TPM_KEY_LEGACY
--      && key->keyUsage != TPM_KEY_IDENTITY) return TPM_INVALID_KEYUSAGE;
--  /* get current ticks */
--  TPM_GetTicks(currentTicks);
--  /* sign data using signature scheme PKCS1_SHA1 and TPM_SIGN_INFO container */
--  *sigSize = key->key.size >> 3;
--  *sig = tpm_malloc(*sigSize);
--  if (*sig == NULL) return TPM_FAIL; 
--  /* setup TPM_SIGN_INFO structure */
--  info_length = 30 + sizeof(TPM_DIGEST) + sizeof_TPM_CURRENT_TICKS(currentTicks);
--  info = tpm_malloc(info_length);
--  if (info == NULL) {
--    tpm_free(*sig);
--    return TPM_FAIL;
--  }
--  memcpy(&info[0], "\x05\x00TSTP", 6);
--  memcpy(&info[6], antiReplay->nonce, 20);
--  *(UINT32*)&info[26] = CPU_TO_BE32(20
--                        + sizeof_TPM_CURRENT_TICKS(currentTicks));
--  memcpy(&info[30], digestToStamp->digest, sizeof(TPM_DIGEST));
--  p = &info[30 + sizeof(TPM_DIGEST)]; 
--  length = sizeof_TPM_CURRENT_TICKS(currentTicks);
--  if (tpm_marshal_TPM_CURRENT_TICKS(&p, &length, currentTicks)
--      || rsa_sign(&key->key, RSA_SSA_PKCS1_SHA1, info, info_length, *sig)) {   
--    tpm_free(*sig);
--    tpm_free(info);
--    return TPM_FAIL;
--  } 
--  return TPM_SUCCESS;
-+  return TPM_DISABLED_CMD;
- }
- 
- void tpm_update_ticks(void)
- {
--  if (tpmData.stany.data.currentTicks.tag == 0) {
--    tpmData.stany.data.currentTicks.tag = TPM_TAG_CURRENT_TICKS;
--    tpmData.stany.data.currentTicks.currentTicks += tpm_get_ticks();
--/* removed since v1.2 rev 94
--    tpmData.stany.data.currentTicks.tickType = tpmData.permanent.data.tickType;
--*/
--    tpm_get_random_bytes(tpmData.stany.data.currentTicks.tickNonce.nonce, 
--      sizeof(TPM_NONCE));
--    tpmData.stany.data.currentTicks.tickRate = 1;
--/* removed since v1.2 rev 94
--    tpmData.stany.data.currentTicks.tickSecurity = TICK_SEC_NO_CHECK;
--*/
--  } else {
--    tpmData.stany.data.currentTicks.currentTicks += tpm_get_ticks();   
--  }
- }
- 
-diff -uprN orig/tpm_emulator-0.4/tpm/tpm_transport.c tpm_emulator/tpm/tpm_transport.c
---- orig/tpm_emulator-0.4/tpm/tpm_transport.c	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm/tpm_transport.c	2006-07-24 14:35:35.000000000 -0700
-@@ -189,7 +189,7 @@ static void decrypt_wrapped_command(BYTE
-     sha1_init(&sha1);
-     sha1_update(&sha1, auth->nonceEven.nonce, sizeof(auth->nonceEven.nonce));
-     sha1_update(&sha1, auth->nonceOdd.nonce, sizeof(auth->nonceOdd.nonce));
--    sha1_update(&sha1, "in", 2);
-+    sha1_update(&sha1, (BYTE*)"in", 2);
-     sha1_update(&sha1, secret, sizeof(TPM_SECRET));
-     j = CPU_TO_BE32(i);
-     sha1_update(&sha1, (BYTE*)&j, 4);
-@@ -211,7 +211,7 @@ static void encrypt_wrapped_command(BYTE
-     sha1_init(&sha1);
-     sha1_update(&sha1, auth->nonceEven.nonce, sizeof(auth->nonceEven.nonce));
-     sha1_update(&sha1, auth->nonceOdd.nonce, sizeof(auth->nonceOdd.nonce));
--    sha1_update(&sha1, "out", 3);
-+    sha1_update(&sha1, (BYTE*)"out", 3);
-     sha1_update(&sha1, secret, sizeof(TPM_SECRET));
-     j = CPU_TO_BE32(i);
-     sha1_update(&sha1, (BYTE*)&j, 4);
-diff -uprN orig/tpm_emulator-0.4/tpmd.c tpm_emulator/tpmd.c
---- orig/tpm_emulator-0.4/tpmd.c	1969-12-31 16:00:00.000000000 -0800
-+++ tpm_emulator/tpmd.c	2006-07-24 14:35:35.000000000 -0700
-@@ -0,0 +1,156 @@
-+/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
-+ * Copyright (C) 2005 INTEL Corp
-+ *
-+ * This module is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published
-+ * by the Free Software Foundation; either version 2 of the License,
-+ * or (at your option) any later version.
-+ *
-+ * This module 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.
-+ *
-+ */
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <string.h>
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+#include <fcntl.h>
-+#include <sys/time.h>
-+
-+#include "tpm_emulator.h"
-+
-+#define TPM_RX_FNAME "/var/tpm/tpm_in.fifo"
-+#define TPM_TX_FNAME "/var/tpm/tpm_out.fifo"
-+
-+#define BUFFER_SIZE 2048
-+
-+static int devurandom=0;
-+	  
-+void get_random_bytes(void *buf, int nbytes) {
-+  
-+  if (devurandom == 0) {
-+    devurandom = open("/dev/urandom", O_RDONLY);
-+  }
-+
-+  if (read(devurandom, buf, nbytes) != nbytes) {
-+      printf("Can't get random number.\n");
-+      exit(-1);
-+  }
-+}
-+
-+uint64_t tpm_get_ticks(void)
-+{
-+  //struct timeval tv;
-+  //int gettimeofday(&tv, struct timezone *tz);
-+  return 0;
-+}
-+
-+int main(int argc, char **argv)
-+{
-+  uint8_t in[BUFFER_SIZE], *out;
-+  uint32_t out_size;
-+  int in_size, written;
-+  int i;
-+  struct stat file_info;
-+
-+  int tpm_tx_fh=-1, tpm_rx_fh=-1;
-+  if (argc < 2) {
-+    printf("Usage: tpmd clear|save|deactivated\n" );
-+	  return -1;
-+  }
-+
-+  /* initialize TPM emulator */
-+  if (!strcmp(argv[1], "clear")) {
-+    printf("Initializing tpm: %s\n", argv[1]);
-+    tpm_emulator_init(1);
-+  } else if (!strcmp(argv[1], "save")) { 
-+    printf("Initializing tpm: %s\n", argv[1]);
-+    tpm_emulator_init(2);
-+  } else if (!strcmp(argv[1], "deactivated")) {
-+    printf("Initializing tpm: %s\n", argv[1]);
-+    tpm_emulator_init(3);
-+  } else {
-+    printf("invalid startup mode '%s'; must be 'clear', "
-+      "'save' (default) or 'deactivated", argv[1]);
-+    return -1;
-+  }
-+
-+  if ( stat(TPM_RX_FNAME, &file_info) == -1) {
-+    if ( mkfifo(TPM_RX_FNAME, S_IWUSR | S_IRUSR ) ) {
-+      printf("Failed to create fifo %s.\n", TPM_RX_FNAME);
-+      return -1;
-+    }
-+  }
-+
-+  if ( stat(TPM_TX_FNAME, &file_info) == -1) {
-+    if ( mkfifo(TPM_TX_FNAME, S_IWUSR | S_IRUSR ) ) {
-+      printf("Failed to create fifo %s.\n", TPM_TX_FNAME);
-+      return -1;
-+    }
-+  }
-+
-+  while (1) {
-+abort_command:
-+    if (tpm_rx_fh < 0) {
-+      tpm_rx_fh = open(TPM_RX_FNAME, O_RDONLY);
-+    }
-+    
-+    if (tpm_rx_fh < 0) {
-+      printf("ERROR: failed to open devices to listen to guest.\n");
-+      return -1;
-+    }
-+    
-+    if (tpm_tx_fh < 0) {
-+      tpm_tx_fh = open(TPM_TX_FNAME, O_WRONLY);
-+    }
-+
-+    if (tpm_tx_fh < 0) {
-+      printf("ERROR: failed to open devices to respond to guest.\n");
-+      return -1;
-+    }
-+
-+    in_size = read(tpm_rx_fh, in, BUFFER_SIZE);
-+    if (in_size < 6) { // Magic size of minium TPM command
-+      printf("Recv[%d] to small: 0x", in_size);
-+      if (in_size <= 0) {
-+          close(tpm_rx_fh);
-+          tpm_rx_fh = -1;
-+          goto abort_command;
-+      }
-+    } else { 
-+      printf("Recv[%d]: 0x", in_size);
-+      for (i=0; i< in_size; i++) 
-+        printf("%x ", in[i]);
-+      printf("\n");
-+    }
-+
-+    
-+    if (tpm_handle_command(in, in_size, &out, &out_size) != 0) { 
-+        printf("ERROR: Handler Failed.\n");
-+    }
-+
-+    written = write(tpm_tx_fh, out, out_size);
-+
-+    if (written != out_size ) {
-+      printf("ERROR: Part of response not written %d/%d.\nAttempt: ", written, out_size);
-+    } else {
-+      printf("Sent[%Zu]: ", out_size);
-+    }
-+    for (i=0; i< out_size; i++)
-+      printf("%x ", out[i]);
-+    printf("\n");
-+    tpm_free(out);
-+
-+  } // loop
-+
-+  tpm_emulator_shutdown();
-+
-+  close(tpm_tx_fh);
-+  close(tpm_rx_fh);
-+
-+}
-Binary files orig/tpm_emulator-0.4/tpm_emulator and tpm_emulator/tpm_emulator differ
-diff -uprN orig/tpm_emulator-0.4/tpm_version.h tpm_emulator/tpm_version.h
---- orig/tpm_emulator-0.4/tpm_version.h	2006-06-23 03:37:07.000000000 -0700
-+++ tpm_emulator/tpm_version.h	2006-07-24 14:35:41.000000000 -0700
-@@ -2,5 +2,5 @@
- #define _TPM_VERSION_H_
- #define VERSION_MAJOR 0
- #define VERSION_MINOR 4
--#define VERSION_BUILD 1151058734
-+#define VERSION_BUILD 1153776940
- #endif /* _TPM_VERSION_H_ */
diff --git a/tools/vtpm/vtpm-0.5.1-LDLIBS.patch b/tools/vtpm/vtpm-0.5.1-LDLIBS.patch
deleted file mode 100644
index 95586c1..0000000
--- a/tools/vtpm/vtpm-0.5.1-LDLIBS.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naurp tpm_emulator-0.5.1/tpmd/Makefile tpm_emulator-0.5.1/tpmd/Makefile
---- tpm_emulator-0.5.1/tpmd/Makefile
-+++ tpm_emulator-0.5.1/tpmd/Makefile
-@@ -8,7 +8,7 @@ WFLAGS  := -Wall -Wno-unused -Wpointer-a
-            #WFLAGS  += -Wextra -Wcast-qual -Wmissing-prototypes -Wmissing-declarations -Wstrict-aliasing
- CFLAGS  += $(WFLAGS) -g -I.. -I. -O2 -fno-strict-aliasing
- CFLAGS  += -I../../../../tools/vtpm_manager/manager
--LDFLAGS += -lgmp
-+LDLIBS  += -lgmp
- 
- BINDIR  := /usr/bin/
- 
diff --git a/tools/vtpm/vtpm-0.5.1.patch b/tools/vtpm/vtpm-0.5.1.patch
deleted file mode 100644
index 2aeb745..0000000
--- a/tools/vtpm/vtpm-0.5.1.patch
+++ /dev/null
@@ -1,766 +0,0 @@
-diff -Naurp tpm_emulator-0.5.1/Makefile tpm5-test/Makefile
---- tpm_emulator-0.5.1/Makefile	2008-02-14 03:22:48.000000000 -0500
-+++ tpm5-test/Makefile	2009-07-15 09:45:28.000000000 -0400
-@@ -10,7 +10,7 @@ VERSION_MINOR  := 5
- VERSION_BUILD  := $(shell date +"%s")
- VERSION_SUFFIX := .1
- 
--SUBDIRS := tpmd tpmd_dev tddl
-+SUBDIRS := tpmd 
- 
- all: version all-recursive
- 
-@@ -48,12 +48,12 @@ user_install: user
- modules_install: modules
- 	@$(MAKE) -C tpmd_dev install || exit -1
- 
--DIRS    := . tpm crypto tpmd tpmd_dev tddl tpmd_dev_openbsd
-+DIRS    := . tpm crypto tpmd 
- DISTSRC := $(foreach dir, $(DIRS), $(wildcard $(dir)/*.c))
- DISTSRC += $(foreach dir, $(DIRS), $(wildcard $(dir)/*.h))
--DIRS    := . tpmd tpmd_dev tddl tpmd_dev_openbsd
-+DIRS    := . tpmd 
- DISTSRC += $(foreach dir, $(DIRS), $(dir)/Makefile)
--DISTSRC += ./README ./AUTHORS ./ChangeLog tpmd_dev/tpmd_dev.rules.in
-+DISTSRC += ./README ./AUTHORS ./ChangeLog 
- DISTDIR := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_SUFFIX)
- 
- dist: $(DISTSRC)
-diff -Naurp tpm_emulator-0.5.1/tpm/tpm_capability.c tpm5-test/tpm/tpm_capability.c
---- tpm_emulator-0.5.1/tpm/tpm_capability.c	2008-02-14 03:22:48.000000000 -0500
-+++ tpm5-test/tpm/tpm_capability.c	2009-07-16 12:04:20.000000000 -0400
-@@ -136,8 +136,19 @@ static TPM_RESULT cap_property(UINT32 su
- 
-     case TPM_CAP_PROP_TIS_TIMEOUT:
-       debug("[TPM_CAP_PROP_TIS_TIMEOUT]");
--      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT */
--      return TPM_FAIL;
-+      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT: Measure these values and determine correct ones */
-+      UINT32 len = *respSize = 16;
-+      BYTE *ptr = *resp = tpm_malloc(*respSize);
-+      if (ptr == NULL || 
-+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
-+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
-+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
-+          tpm_marshal_UINT32(&ptr, &len, 200000)) {
-+        tpm_free(*resp);
-+        return TPM_FAIL;
-+      }
-+      return TPM_SUCCESS;
-+
- 
-     case TPM_CAP_PROP_STARTUP_EFFECT:
-       debug("[TPM_CAP_PROP_STARTUP_EFFECT]");
-@@ -189,8 +200,12 @@ static TPM_RESULT cap_property(UINT32 su
- 
-     case TPM_CAP_PROP_DURATION:
-       debug("[TPM_CAP_PROP_DURATION]");
--      /* TODO: TPM_CAP_PROP_DURATION */
--      return TPM_FAIL;
-+      /* TODO: TPM_CAP_PROP_DURATION: Measure these values and return accurate ones */
-+      BYTE dur[]= {0x0,0x0,0x0,0xc,0x0,0x7,0xa1,0x20,0x0,0x1e,0x84,0x80,0x11,0xe1,0xa3,0x0}; 
-+      *respSize = 16;
-+      *resp = tpm_malloc(*respSize);
-+      memcpy(*resp,dur,16); 
-+
- 
-     case TPM_CAP_PROP_ACTIVE_COUNTER:
-       debug("[TPM_CAP_PROP_ACTIVE_COUNTER]");
-diff -Naurp tpm_emulator-0.5.1/tpmd/Makefile tpm5-test/tpmd/Makefile
---- tpm_emulator-0.5.1/tpmd/Makefile	2008-02-14 03:22:48.000000000 -0500
-+++ tpm5-test/tpmd/Makefile	2009-07-16 12:08:26.000000000 -0400
-@@ -8,9 +8,10 @@ WFLAGS  := -Wall -Wno-unused -Wpointer-a
-            -Wwrite-strings -Wsign-compare -Wno-multichar
-            #WFLAGS  += -Wextra -Wcast-qual -Wmissing-prototypes -Wmissing-declarations -Wstrict-aliasing
- CFLAGS  += $(WFLAGS) -g -I.. -I. -O2 -fno-strict-aliasing
-+CFLAGS  += -I../../../../tools/vtpm_manager/manager
- LDFLAGS += -lgmp
- 
--BINDIR  := /usr/sbin/
-+BINDIR  := /usr/bin/
- 
- TPMD    := tpmd
- DIRS    := ../tpm ../crypto
-@@ -18,6 +19,8 @@ SRCS    := $(foreach dir, $(DIRS), $(wil
- OBJS    := $(patsubst %.c, %.o, $(SRCS))
- OBJS    := $(foreach dir, $(DIRS), $(patsubst $(dir)/%.o, %.o, $(filter $(dir)/%.o, $(OBJS))))
- 
-+VTPM_BIN := vtpmd
-+
- vpath %.c $(strip $(DIRS))
- 
- all: $(TPMD)
-@@ -32,10 +35,8 @@ TPMD_GROUP ?= tss
- INSTALL    ?= install
- 
- install: $(TPMD)
--	$(INSTALL) -m 755 -o $(TPMD_USER) -g $(TPMD_GROUP) -d $(DESTDIR)/var/lib/tpm
--	$(INSTALL) -m 755 -o $(TPMD_USER) -g $(TPMD_GROUP) -d $(DESTDIR)/var/run/tpm
- 	$(INSTALL) -D -d $(DESTDIR)/$(BINDIR)
--	$(INSTALL) -m 755 $(TPMD) $(DESTDIR)/$(BINDIR)
-+	$(INSTALL) -m 755 $(TPMD) $(DESTDIR)/$(BINDIR)/$(VTPM_BIN)
- 
- .PHONY: all clean install
- 
-diff -Naurp tpm_emulator-0.5.1/tpmd/tpmd.c tpm5-test/tpmd/tpmd.c
---- tpm_emulator-0.5.1/tpmd/tpmd.c	2008-02-14 03:22:48.000000000 -0500
-+++ tpm5-test/tpmd/tpmd.c	2009-07-16 11:19:05.000000000 -0400
-@@ -32,6 +32,9 @@
- #include <grp.h>
- #include "tpm_emulator_config.h"
- #include "tpm/tpm_emulator.h"
-+#include "tpm/tpm_structures.h"
-+#include "tpm/tpm_marshalling.h"
-+#include "vtpm_manager.h"
- 
- #define TPM_DAEMON_NAME     "tpmd"
- #define TPM_CMD_BUF_SIZE    4096
-@@ -39,6 +42,24 @@
- #define TPM_RANDOM_DEVICE   "/dev/urandom"
- #undef  TPM_MKDIRS
- 
-+#ifdef VTPM_MULTI_VM
-+ #define DEV_BE "/dev/vtpm"
-+ #define DEV_FE "/dev/tpm"
-+#else
-+ #define PVM_RX_FIFO_D "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
-+ #define PVM_TX_FIFO "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
-+ #define HVM_RX_FIFO_D "/var/vtpm/socks/%d.socket"
-+
-+ #define VTPM_RX_FIFO_D "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
-+ #define VTPM_TX_FIFO "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
-+
-+ static char *vtpm_rx_name=NULL;
-+#endif
-+
-+ static int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
-+
-+#define BUFFER_SIZE 2048
-+
- static volatile int stopflag = 0;
- static int is_daemon = 0;
- static int opt_debug = 0;
-@@ -49,6 +70,8 @@ static const char *opt_storage_file = "/
- static uid_t opt_uid = 0;
- static gid_t opt_gid = 0;
- static int tpm_startup = 2;
-+static int vtpm_type = VTPM_TYPE_PVM;
-+int dmi_id = 0;
- static int rand_fh;
- 
- void tpm_log(int priority, const char *fmt, ...)
-@@ -90,56 +113,241 @@ uint64_t tpm_get_ticks(void)
- 
- int tpm_write_to_file(uint8_t *data, size_t data_length)
- {
--    int fh;
--    ssize_t res;
--    fh = open(opt_storage_file, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
--    if (fh < 0) return -1;
--    while (data_length > 0) {
--        res = write(fh, data, data_length);
--	if (res < 0) {
--	    close(fh);
--	    return -1;
--	}
--	data_length -= res; 
--	data += res;
-+  int res, out_data_size, in_header_size;
-+  BYTE *ptr, *out_data, *in_header;
-+  UINT32 result, len, in_rsp_size;
-+  UINT16 tag = VTPM_TAG_REQ;
-+	
-+  printf("Saving NVM\n");
-+  if (vtpm_tx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
-+#else
-+	vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
-+#endif
-+  }
-+
-+  if (vtpm_tx_fh < 0) {
-+		return -1;
-+  }
-+ 
-+  // Send request to VTPM Manager to encrypt data
-+#ifdef VTPM_MUTLI_VM
-+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT + data_length;
-+#else
-+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV + data_length;
-+#endif
-+  
-+  out_data = ptr = (BYTE *) malloc(len);
-+
-+  if (ptr == NULL
-+#ifndef VTPM_MUTLI_VM
-+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
-+#endif
-+	  || tpm_marshal_UINT16(&ptr, &len, tag)
-+#ifdef VTPM_MUTLI_VM
-+	  || tpm_marshal_UINT32(&ptr, &len, out_data_size)
-+#else
-+	  || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
-+#endif  
-+	  || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_SAVENVM)
-+	  || tpm_marshal_BYTE_ARRAY(&ptr, &len, data, data_length)) {
-+	free(out_data);
-+	return -1;
-+  }
-+  
-+  printf("\tSending SaveNVM Command.\n");
-+  res = write(vtpm_tx_fh, out_data, out_data_size);
-+  free(out_data);
-+  if (res != out_data_size) return -1;
-+
-+  if (vtpm_rx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+    vtpm_rx_fh = vtpm_tx_fh
-+#else
-+    if (vtpm_rx_name == NULL) {
-+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
-+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
-     }
--    close(fh);
--    return 0;
-+	vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
-+#endif
-+  }
-+
-+  if (vtpm_rx_fh < 0) {
-+		return -1;
-+  }
-+  
-+  // Read Header of response so we can get the size & status
-+#ifdef VTPM_MUTLI_VM
-+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
-+#else
-+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
-+#endif
-+  in_header = ptr = malloc(in_header_size);
-+  
-+  printf("\tReading SaveNVM header.\n");
-+  res = read(vtpm_rx_fh, in_header, in_header_size);
-+
-+  if ( (res != in_header_size)
-+#ifndef VTPM_MUTLI_VM
-+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
-+#endif
-+	   || tpm_unmarshal_UINT16(&ptr, &len, &tag)
-+	   || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
-+	   || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
-+	  free(in_header);
-+	  return -1;
-+  }
-+  free(in_header);
-+  
-+  if (result != VTPM_SUCCESS) {
-+      return -1;  
-+  }
-+
-+#ifdef VTPM_MUTLI_VM
-+  close(vtpm_tx_fh); close(vtpm_rx_fh);
-+#endif
-+	  
-+  printf("\tFinishing up SaveNVM\n");
-+  return (0);
- }
- 
- int tpm_read_from_file(uint8_t **data, size_t *data_length)
- {
--    int fh;
--    ssize_t res;
--    size_t total_length;
--    fh = open(opt_storage_file, O_RDONLY);
--    if (fh < 0) return -1;
--    total_length = lseek(fh, 0, SEEK_END);
--    lseek(fh, 0, SEEK_SET);
--    *data = tpm_malloc(total_length);
--    if (*data == NULL) {
--        close(fh);
--        return -1;
--    }
--    *data_length = 0;
--    while (total_length > 0) {
--        res = read(fh, &(*data)[*data_length], total_length);
--	if (res < 0) {
--	    close(fh);
--	    tpm_free(*data);
--	    return -1;
--	}
--        *data_length += res;
--	total_length -= res;
-+  int res, out_data_size, in_header_size;
-+  uint8_t *ptr, *out_data, *in_header;
-+  UINT16 tag = VTPM_TAG_REQ;
-+  UINT32 len, in_rsp_size, result;
-+#ifdef VTPM_MUTLI_VM
-+	int vtpm_rx_fh, vtpm_tx_fh;
-+#endif
-+	
-+  printf("Loading NVM.\n");
-+  if (vtpm_tx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
-+#else
-+	vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
-+#endif
-+  }
-+
-+  if (vtpm_tx_fh < 0) {
-+	printf("Error in read_from_file:301\n");
-+		return -1;
-+  }
-+ 
-+  // Send request to VTPM Manager to encrypt data
-+#ifdef VTPM_MUTLI_VM
-+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
-+#else
-+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
-+#endif
-+  out_data = ptr = (BYTE *) malloc(len);
-+
-+  if (ptr == NULL
-+#ifndef VTPM_MUTLI_VM
-+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
-+#endif  
-+      || tpm_marshal_UINT16(&ptr, &len, tag)
-+#ifdef VTPM_MUTLI_VM
-+      || tpm_marshal_UINT32(&ptr, &len, out_data_size)
-+#else
-+      || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
-+#endif
-+      || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_LOADNVM)) {
-+    free(out_data);
-+    printf("Error in read_from_file:325\n");
-+
-+    return -1;
-+  }
-+
-+  printf("\tSending LoadNVM command\n");
-+  res = write(vtpm_tx_fh, out_data, out_data_size);
-+  free(out_data);
-+  if (res != out_data_size) 
-+    {
-+	printf("Error in read_from_file:335\n");
-+	return -1;
-+    }
-+
-+    if (vtpm_rx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+    vtpm_rx_fh = vtpm_tx_fh;
-+#else
-+    if (vtpm_rx_name == NULL) {
-+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
-+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
-     }
--    close(fh);
--    return 0;
-+	vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
-+#endif
-+  }
-+
-+  if (vtpm_rx_fh < 0) {
-+	printf("Error in read_from_file:352\n");	
-+	return -1;
-+  }
-+  
-+  // Read Header of response so we can get the size & status
-+#ifdef VTPM_MUTLI_VM
-+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
-+#else
-+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
-+#endif
-+  in_header = ptr = malloc(in_header_size);
-+  
-+  printf("\tReading LoadNVM header\n");
-+  res = read(vtpm_rx_fh, in_header, in_header_size);
-+
-+  if ( (res != in_header_size)
-+#ifndef VTPM_MUTLI_VM
-+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
-+#endif
-+       || tpm_unmarshal_UINT16(&ptr, &len, &tag)
-+       || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
-+       || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
-+      free(in_header);
-+      printf("Error in read_from_file:375\n");     
-+      return -1;
-+  }
-+  free(in_header);
-+  
-+  if (result != VTPM_SUCCESS) {
-+    printf("Error in read_from_file:381\n");
-+    return -1;  
-+  }
-+
-+  // Read Encrypted data from VTPM Manager
-+  *data_length = in_rsp_size - VTPM_COMMAND_HEADER_SIZE_CLT;
-+  *data = (uint8_t *) malloc(*data_length);
-+
-+  printf("\tReading clear data from LoadNVM.\n");
-+  res = read(vtpm_rx_fh, *data, *data_length);
-+#ifdef VTPM_MUTLI_VM
-+  close(vtpm_rx_fh);close(vtpm_tx_fh);
-+#endif 
-+	
-+  printf("\tReturing from loading NVM\n");
-+  if (res != (int)*data_length) {
-+      free(*data);
-+      printf("Error in read_from_file:398\n");
-+      return -1;
-+  } else {
-+      return 0;
-+  }
-+
-+
-+    
- }
- 
- static void print_usage(char *name)
- {
-     printf("usage: %s [-d] [-f] [-s storage file] [-u unix socket name] "
--           "[-o user name] [-g group name] [-h] [startup mode]\n", name);
-+           "[-o user name] [-g group name] [-h]"
-+#ifdef VTPM_MULTI_VM
-+	   "clear|save|deactivated\n", name);
-+#else
-+	   "clear|save|deactivated pvm|hvm vtpmid\n", name);
-+#endif
-     printf("  d : enable debug mode\n");
-     printf("  f : forces the application to run in the foreground\n");
-     printf("  s : storage file to use (default: %s)\n", opt_storage_file);
-@@ -205,7 +413,13 @@ static void parse_options(int argc, char
-                 exit(EXIT_SUCCESS);
-         }
-     }
--    if (optind < argc) {
-+    /*Make sure we have all required options*/
-+#ifdef VTPM_MULTI_VM
-+#define EXTRA_OPTS 0
-+#else
-+#define EXTRA_OPTS 2
-+#endif
-+    if (optind < argc - EXTRA_OPTS ) {
-         debug("startup mode = '%s'", argv[optind]);
-         if (!strcmp(argv[optind], "clear")) {
-             tpm_startup = 1;
-@@ -219,6 +433,25 @@ static void parse_options(int argc, char
-             print_usage(argv[0]);
-             exit(EXIT_SUCCESS);
-         }
-+#ifndef VTPM_MULTI_VM
-+        ++optind;
-+	if(!strcmp(argv[optind], "pvm")) {
-+		vtpm_type = VTPM_TYPE_PVM;	// Get commands from vTPM Manager through fifo
-+	} else if (!strcmp(argv[optind], "hvm")) {
-+		vtpm_type = VTPM_TYPE_HVM;	// Get commands from qemu via socket
-+        } else {
-+		error("Invalid vm mode '%s'; must be 'pvm', "
-+			"or 'hvm' ", argv[optind]);
-+		print_usage(argv[0]);
-+		exit(EXIT_SUCCESS);
-+	}
-+        ++optind;
-+	dmi_id = atoi(argv[optind]);
-+#endif
-+    } else {
-+	error("Invalid number of arguments");
-+	print_usage(argv[0]);
-+	exit(EXIT_SUCCESS);
-     }
- }
- 
-@@ -348,93 +581,180 @@ static int init_socket(const char *name)
- 
- static void main_loop(void)
- {
--    int sock, fh, res;
--    int32_t in_len;
-+    int32_t in_len, written;
-     uint32_t out_len;
--    uint8_t in[TPM_CMD_BUF_SIZE], *out;
-+    uint8_t in[TPM_CMD_BUF_SIZE], *out, *addressed_out;
-+    int guest_id=-1;
-+    int i;
-+    char *vtpm_rx_file=NULL;
-+    int res;
-+
-+#ifndef VTPM_MULTI_VM
-+    int sockfd = -1;
-     struct sockaddr_un addr;
--    socklen_t addr_len;
--    fd_set rfds;
--    struct timeval tv;
-+    struct sockaddr_un client_addr;
-+    unsigned int client_length;
-+#endif
-+
-+    int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
-+
-+#ifndef VTPM_MULTI_VM
-+  if (vtpm_type == VTPM_TYPE_PVM) {
-+    vtpm_rx_file = malloc(10 + strlen(PVM_RX_FIFO_D));
-+    sprintf(vtpm_rx_file, PVM_RX_FIFO_D, (uint32_t) dmi_id);
-+  } else {
-+    vtpm_rx_file = malloc(10 + strlen(HVM_RX_FIFO_D));
-+    sprintf(vtpm_rx_file, HVM_RX_FIFO_D, (uint32_t) dmi_id);
-+
-+    if ( (sockfd = socket(PF_UNIX,SOCK_STREAM,0)) < 0) {
-+          error("Unable to create socket. errno = %d\n", errno);
-+      exit (-1);
-+    }
-+
-+    memset(&addr, 0, sizeof(addr));
-+    addr.sun_family = AF_UNIX;
-+    strcpy(addr.sun_path,vtpm_rx_file );
-+    unlink(addr.sun_path);
-+  }
-+#endif
- 
-     info("staring main loop");
--    /* open UNIX socket */
--    sock = init_socket(opt_socket_name);
--    if (sock < 0) exit(EXIT_FAILURE);
-     /* init tpm emulator */
--    debug("initializing TPM emulator: %d", tpm_startup);
-+#ifdef VTPM_MULTI_VM
-+    debug("initializing TPM emulator: state=%d", tpm_startup);
-+#else
-+    debug("initializing TPM emulator: state=%d, type=%d, id=%d", tpm_startup, vtpm_type, dmi_id);
-+#endif
-     tpm_emulator_init(tpm_startup);
-     /* start command processing */
-     while (!stopflag) {
-         /* wait for incomming connections */
-         debug("waiting for connections...");
--        FD_ZERO(&rfds);
--        FD_SET(sock, &rfds);
--        tv.tv_sec = 10;
--        tv.tv_usec = 0;
--        res = select(sock + 1, &rfds, NULL, NULL, &tv);
--        if (res < 0) {
--            error("select(sock) failed: %s", strerror(errno));
--            break;
--        } else if (res == 0) {
--            continue;
--        }
--        addr_len = sizeof(addr);
--        fh = accept(sock, (struct sockaddr*)&addr, &addr_len);
--        if (fh < 0) {
--            error("accept() failed: %s", strerror(errno));
--            continue;
--        }
-+	if (vtpm_rx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+	    vtpm_rx_fh = open(DEV_BE, O_RDWR);
-+#else
-+	    if (vtpm_type == VTPM_TYPE_PVM)
-+	    {
-+		vtpm_rx_fh = open(vtpm_rx_file, O_RDONLY);
-+	    } else {
-+		if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
-+		    error("Unable to bind(). errno = %d\n", errno);
-+		    exit (-1);
-+		}
-+
-+		if (listen(sockfd, 10) <0) {
-+		    error("Unable to listen(). errno = %d\n", errno);
-+		    exit (-1);
-+		} 
-+
-+		 memset(&client_addr, 0, sizeof(client_addr));
-+		 client_length = sizeof(client_addr);
-+
-+		 vtpm_rx_fh = vtpm_tx_fh = accept(sockfd, (struct sockaddr *)&client_addr, &client_length);
-+	    }
-+#endif
-+	}
-+	
-+	/*Error Checking*/
-+	if (vtpm_rx_fh < 0) {
-+	  error("Failed to open devices to listen to guest.\n");
-+	  exit(-1);
-+	}
-+
-         /* receive and handle commands */
-         in_len = 0;
-         do {
-             debug("waiting for commands...");
--            FD_ZERO(&rfds);
--            FD_SET(fh, &rfds);
--            tv.tv_sec = TPM_COMMAND_TIMEOUT;
--            tv.tv_usec = 0;
--            res = select(fh + 1, &rfds, NULL, NULL, &tv);
--            if (res < 0) {
--                error("select(fh) failed: %s", strerror(errno));
--                close(fh);
--                break;
--            } else if (res == 0) {
--#ifdef TPMD_DISCONNECT_IDLE_CLIENTS	    
--                info("connection closed due to inactivity");
--                close(fh);
--                break;
--#else		
--                continue;
--#endif		
--            }
--            in_len = read(fh, in, sizeof(in));
--            if (in_len > 0) {
-+
-+            in_len = read(vtpm_rx_fh, in, sizeof(in));
-+	    /*Magic size of minimum TPM command is 6*/
-+		//FIXME Magic size check may not be required anymore
-+            if (in_len < 6) {
-+		info("Recv incomplete command of %d bytes.", in_len);
-+		if (in_len <= 0) {
-+		    close(vtpm_rx_fh);
-+		    vtpm_rx_fh = -1;
-+		    continue;
-+                 }
-+	    } else {
-+		/*Debug Printouts*/
-                 debug("received %d bytes", in_len);
-+		debug_nostop("Recv[%d]: 0x", in_len);
-+		for (i=0; i< in_len; i++) 
-+		    debug_more("%x ", in[i]);
-+		debug_more("\n");
-+		/*Multiple Guest check*/
-+		if (guest_id == -1) {
-+		    guest_id = *((int32_t *) in);
-+		} else {
-+		    if (guest_id != *((int32_t *) in) ) {
-+			error("WARNING: More than one guest attached\n");
-+		    }
-+		}
-+
-+		/*Open tx handle now*/
-+		if (vtpm_tx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+		    vtpm_tx_fh = open(DEV_BE, O_RDWR);
-+		    vtpm_rx_fh = vtpm_tx_fh;
-+#else
-+		    if (vtpm_type == VTPM_TYPE_PVM) {
-+			vtpm_tx_fh = open(PVM_TX_FIFO, O_WRONLY);
-+     		    } // No need to open the other direction for HVM
-+#endif
-+		}
-+		if (vtpm_tx_fh < 0) {
-+		  error("Failed to open devices to respond to guest.\n");
-+		  exit(-1);
-+		}
-+
-+		/*Handle the TPM command now*/
-                 out = NULL;
--                res = tpm_handle_command(in, in_len, &out, &out_len);
-+                res = tpm_handle_command(in + sizeof(uint32_t), in_len - sizeof(uint32_t), &out, &out_len);
-                 if (res < 0) {
-                     error("tpm_handle_command() failed");
-                 } else {
-                     debug("sending %d bytes", out_len);
-+		    //FIXME this prepending may or may not be needed
-+		    /*Prepend the first 4 bytes of the in buffer.. why?*/
-+		    addressed_out = (uint8_t *) tpm_malloc(sizeof(uint32_t) + out_len);
-+		    *(uint32_t *) addressed_out = *(uint32_t *) in;
-+		    memcpy(addressed_out + sizeof(uint32_t), out, out_len);
-+		    out_len += sizeof(uint32_t);
-+		    /*End Prepend*/
-+
-+		    /*Perform write operation now*/
-                     while (out_len > 0) {
--                        res = write(fh, out, out_len);
-+                        res = write(vtpm_tx_fh, addressed_out, out_len);
-+
-                         if (res < 0) {
-                             error("write(%d) failed: %s", out_len, strerror(errno));
-                             break;
--                        }
-+                        } else {
-+			  debug_nostop("Sent[%Zu]: ", out_len);
-+			  for (i=0; (unsigned int)i< out_len; i++)
-+			    debug_more("%x ", addressed_out[i]);
-+			  debug_more("\n");
-+			}
-                         out_len	-= res;
-                     }
-                     tpm_free(out);
-+		    tpm_free(addressed_out);
-                 }
-             }
-         } while (in_len > 0);
--        close(fh);
-+        //close(fh);
-     }
-+    
-     /* shutdown tpm emulator */
-     tpm_emulator_shutdown();
--    /* close socket */
--    close(sock);
--    unlink(opt_socket_name);
-+    /* Close handles */
-+    close(vtpm_tx_fh);
-+#ifndef VTPM_MULTI_VM
-+    close(vtpm_rx_fh);
-+    free(vtpm_rx_file);
-+#endif
-     info("main loop stopped");
- }
- 
-@@ -450,12 +770,13 @@ int main(int argc, char **argv)
-     /* open random device */
-     init_random();
-     /* init signal handlers */
--    init_signal_handler();
-+    //init_signal_handler();
-     /* unless requested otherwiese, fork and daemonize process */
--    if (!opt_foreground) daemonize();
-+    //if (!opt_foreground) daemonize();
-     /* start main processing loop */
-     main_loop();
-     info("stopping TPM Emulator daemon");
-     closelog();
-     return 0;
- }
-+
-diff -Naurp tpm_emulator-0.5.1/tpmd/tpm_emulator_config.h tpm5-test/tpmd/tpm_emulator_config.h
---- tpm_emulator-0.5.1/tpmd/tpm_emulator_config.h	2008-02-14 03:22:48.000000000 -0500
-+++ tpm5-test/tpmd/tpm_emulator_config.h	2009-07-16 11:25:26.000000000 -0400
-@@ -29,23 +29,28 @@
- 
- /* TPM emulator configuration */
- 
--#undef  TPM_STRONG_PERSISTENCE
--#undef  TPM_GENERATE_EK
-+#define  TPM_STRONG_PERSISTENCE
-+#define  TPM_GENERATE_EK
- #undef  TPM_GENERATE_SEED_DAA
- #undef  TPM_MEMORY_ALIGNMENT_MANDATORY
- 
-+extern int dmi_id;
-+
- /* log macros */
- 
- void tpm_log(int priority, const char *fmt, ...);
- 
--#define debug(fmt, ...) tpm_log(LOG_DEBUG, "%s:%d: Debug: " fmt "\n", \
--                                __FILE__, __LINE__, ## __VA_ARGS__)
--#define info(fmt, ...)  tpm_log(LOG_INFO, "%s:%d: Info: " fmt "\n", \
--                                __FILE__, __LINE__, ## __VA_ARGS__)
--#define error(fmt, ...) tpm_log(LOG_ERR, "%s:%d: Error: " fmt "\n", \
--                                __FILE__, __LINE__, ## __VA_ARGS__)
--#define alert(fmt, ...) tpm_log(LOG_ALERT, "%s:%d: Alert: " fmt "\n", \
--                                __FILE__, __LINE__, ## __VA_ARGS__)
-+#define debug(fmt, ...) tpm_log(LOG_DEBUG, "VTPMD[%d]: %s:%d: Debug: " fmt "\n", \
-+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define info(fmt, ...)  tpm_log(LOG_INFO, "VTPMD[%d]: %s:%d: Info: " fmt "\n", \
-+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define error(fmt, ...) tpm_log(LOG_ERR, "VTPMD[%d]: %s:%d: Error: " fmt "\n", \
-+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define alert(fmt, ...) tpm_log(LOG_ALERT, "VTPMD[%d]: %s:%d: Alert: " fmt "\n", \
-+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define debug_nostop(fmt, ...) tpm_log(LOG_DEBUG, "VTPMD[%d]: %s:%d: Debug: " fmt, \
-+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define debug_more(fmt, ...) tpm_log(LOG_DEBUG, fmt, ## __VA_ARGS__)
- 
- /*  min/max macros that also do strict type-checking */
- 
diff --git a/tools/vtpm/vtpm.patch b/tools/vtpm/vtpm.patch
deleted file mode 100644
index e896b25..0000000
--- a/tools/vtpm/vtpm.patch
+++ /dev/null
@@ -1,716 +0,0 @@
-diff -uprN tpm_emulator/AUTHORS vtpm/AUTHORS
---- tpm_emulator/AUTHORS	2006-12-08 12:51:29.000000000 -0800
-+++ vtpm/AUTHORS	2006-12-13 16:38:52.000000000 -0800
-@@ -1,3 +1,3 @@
- Mario Strasser <mast@gmx.net>
- Heiko Stamer <stamer@gaos.org> [DAA]
--INTEL Corp <> [Dropped to Ring3]
-+INTEL Corp <> [VTPM Extensions]
-diff -uprN tpm_emulator/ChangeLog vtpm/ChangeLog
---- tpm_emulator/ChangeLog	2006-12-08 12:51:29.000000000 -0800
-+++ vtpm/ChangeLog	2006-12-13 16:38:52.000000000 -0800
-@@ -1,5 +1,6 @@
- ????-??-?? Intel Corp
- 	* Moved module out of kernel to run as a ring 3 app
-+	* Modified save_to_file and load_from_file to call xen VTPM manager
- 
- 2006-06-23  Mario Strasser <mast@gmx.net>
- 	* tpm_startup.c: behaviour of ST_CLEAR and storage of
-diff -uprN tpm_emulator/linux_module.h vtpm/linux_module.h
---- tpm_emulator/linux_module.h	2006-12-08 12:51:29.000000000 -0800
-+++ vtpm/linux_module.h	2007-01-09 14:49:06.000000000 -0800
-@@ -44,18 +44,26 @@
- #define TPM_DEVICE_NAME   "tpm"
- #define TPM_MODULE_NAME   "tpm_emulator"
- 
-+/* debug and log output functions */
-+extern int dmi_id; 
-+
- #ifdef DEBUG
--#define debug(fmt, ...) printf("TPMD: %s:%d: Debug: " fmt "\n", \
--                        __FILE__, __LINE__, ## __VA_ARGS__)
-+#define debug(fmt, ...) printf("TPMD[%d]: %s:%d: Debug: " fmt "\n", \
-+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define debug_nostop(fmt, ...) printf("TPMD[%d]: %s:%d: Debug: " fmt, \
-+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define debug_more(fmt, ...) printf( fmt, ## __VA_ARGS__ )
- #else
- #define debug(fmt, ...) 
-+#define debug_nostop(fmt, ...) 
-+#define debug_more(fmt, ...)
- #endif
--#define info(fmt, ...)  printf("TPMD: %s:%d: Info: " fmt "\n", \
--                        __FILE__, __LINE__, ## __VA_ARGS__)
--#define error(fmt, ...) printf("TPMD: %s:%d: Error: " fmt "\n", \
--                        __FILE__, __LINE__, ## __VA_ARGS__)
--#define alert(fmt, ...) printf("TPMD: %s:%d: Alert: " fmt "\n", \
--                        __FILE__, __LINE__, ## __VA_ARGS__)
-+#define info(fmt, ...)  printf("TPMD[%d]: %s:%d: Info: " fmt "\n", \
-+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define error(fmt, ...) printf("TPMD[%d]: %s:%d: Error: " fmt "\n", \
-+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define alert(fmt, ...) printf("TPMD[%d]: %s:%d: Alert: " fmt "\n", \
-+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
- 
- /* memory allocation */
- 
-diff -uprN tpm_emulator/Makefile vtpm/Makefile
---- tpm_emulator/Makefile	2006-12-08 12:51:29.000000000 -0800
-+++ vtpm/Makefile	2006-12-13 16:38:52.000000000 -0800
-@@ -7,7 +7,7 @@
- COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
- 
- # module settings
--BIN            := tpm_emulator
-+BIN            := vtpmd
- VERSION_MAJOR  := 0
- VERSION_MINOR  := 4
- VERSION_BUILD  := $(shell date +"%s")
-@@ -22,7 +22,7 @@ TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin
- 
- CC      := gcc
- CFLAGS  += -g -Wall $(INCLUDE) -DDEBUG
--CFLAGS  += -I. -Itpm
-+CFLAGS  += -I. -Itpm -I../../vtpm_manager/manager
- 
- # Is the simulator running in it's own vm?
- #CFLAGS += -DVTPM_MULTI_VM
-@@ -62,7 +62,6 @@ $(BIN):	$(src)/crypto/gmp.h $(src)/crypt
- 
- install: $(BIN)
- 	$(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)
--	@if [ ! -d "/var/tpm" ]; then mkdir /var/tpm; fi
- 
- clean:
- 	rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a $(OBJS)
-@@ -98,3 +97,4 @@ version:
- 	@echo "#endif /* _TPM_VERSION_H_ */" >> $(src)/tpm_version.h
- 
- .PHONY: all install clean dist gmp version
-+
-diff -uprN tpm_emulator/tpm/tpm_capability.c vtpm/tpm/tpm_capability.c
---- tpm_emulator/tpm/tpm_capability.c	2006-06-23 03:37:07.000000000 -0700
-+++ vtpm/tpm/tpm_capability.c	2007-01-10 10:00:49.000000000 -0800
-@@ -136,8 +136,18 @@ static TPM_RESULT cap_property(UINT32 su
- 
-     case TPM_CAP_PROP_TIS_TIMEOUT:
-       debug("[TPM_CAP_PROP_TIS_TIMEOUT]");
--      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT */
--      return TPM_FAIL;
-+      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT: Measure these values and determine correct ones */
-+      UINT32 len = *respSize = 16;
-+      BYTE *ptr = *resp = tpm_malloc(*respSize);
-+      if (ptr == NULL || 
-+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
-+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
-+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
-+          tpm_marshal_UINT32(&ptr, &len, 200000)) {
-+        tpm_free(*resp);
-+        return TPM_FAIL;
-+      }
-+      return TPM_SUCCESS;
- 
-     case TPM_CAP_PROP_STARTUP_EFFECT:
-       debug("[TPM_CAP_PROP_STARTUP_EFFECT]");
-@@ -190,7 +200,11 @@ static TPM_RESULT cap_property(UINT32 su
- 
-     case TPM_CAP_PROP_DURATION:
-       debug("[TPM_CAP_PROP_DURATION]");
--      /* TODO: TPM_CAP_PROP_DURATION */
-+      /* TODO: TPM_CAP_PROP_DURATION: Measure these values and return accurate ones */
-+      BYTE dur[]= {0x0,0x0,0x0,0xc,0x0,0x7,0xa1,0x20,0x0,0x1e,0x84,0x80,0x11,0xe1,0xa3,0x0}; 
-+      *respSize = 16;
-+      *resp = tpm_malloc(*respSize);
-+      memcpy(*resp,dur,16); 
-       return TPM_FAIL;
- 
-     case TPM_CAP_PROP_ACTIVE_COUNTER:
-diff -uprN tpm_emulator/tpm/tpm_cmd_handler.c vtpm/tpm/tpm_cmd_handler.c
---- tpm_emulator/tpm/tpm_cmd_handler.c	2008-02-27 16:35:41.000000000 -0500
-+++ vtpm/tpm/tpm_cmd_handler.c	2008-02-28 14:43:28.000000000 -0500
-@@ -94,12 +94,18 @@ void tpm_compute_out_param_digest(TPM_CO
-   sha1_ctx_t sha1;
-   UINT32 res = CPU_TO_BE32(rsp->result);
-   UINT32 ord = CPU_TO_BE32(ordinal);
-+  UINT32 offset = 0;
- 
-   /* compute SHA1 hash */
-   sha1_init(&sha1);
-   sha1_update(&sha1, (BYTE*)&res, 4);
-   sha1_update(&sha1, (BYTE*)&ord, 4);
--  sha1_update(&sha1, rsp->param, rsp->paramSize);
-+  if (ordinal == TPM_ORD_LoadKey2) {
-+      offset = 4;
-+  }
-+  if (rsp->paramSize - offset > 0) {
-+      sha1_update(&sha1, rsp->param + offset, rsp->paramSize - offset);
-+  }
-   sha1_final(&sha1, rsp->auth1->digest);
-   if (rsp->auth2 != NULL) memcpy(rsp->auth2->digest, 
-     rsp->auth1->digest, sizeof(rsp->auth1->digest));
-diff -uprN tpm_emulator/tpm/tpm_data.c vtpm/tpm/tpm_data.c
---- tpm_emulator/tpm/tpm_data.c	2008-02-27 16:35:41.000000000 -0500
-+++ vtpm/tpm/tpm_data.c	2008-02-27 16:35:40.000000000 -0500
-@@ -1,6 +1,7 @@
- /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
-  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-  *                    Swiss Federal Institute of Technology (ETH) Zurich
-+ * Copyright (C) 2005 INTEL Corp
-  *
-  * This module is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published
-@@ -15,10 +16,15 @@
-  * $Id: tpm_data.c 98 2006-05-07 14:16:29Z hstamer $
-  */
- 
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+#include <fcntl.h>
-+#include <unistd.h>
-+
- #include "tpm_emulator.h"
- #include "tpm_structures.h"
- #include "tpm_marshalling.h"
--#include "linux_module.h"
-+#include "vtpm_manager.h"
- 
- TPM_DATA tpmData;
- 
-@@ -158,45 +164,232 @@ void tpm_release_data(void)
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
--#include <unistd.h>
- 
--#define TPM_STORAGE_FILE "/var/tpm/tpm_emulator-1.2." STR(VERSION_MAJOR) "." STR(VERSION_MINOR) 
-+ static int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
-+
-+#ifdef VTPM_MUTLI_VM
-+ #define DEV_FE "/dev/tpm"
-+#else
-+ #define VTPM_RX_FIFO_D  "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
-+ #define VTPM_TX_FIFO  "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
-+
-+ extern int dmi_id;
-+ static char *vtpm_rx_name=NULL; 
-+#endif
- 
- static int write_to_file(uint8_t *data, size_t data_length)
- {
--  int res;
--  int fp;
--  fp = open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
--  res = write(fp, data, data_length);
--  close(fp);
--  return (res == data_length) ? 0 : -1;
-+  int res, out_data_size, in_header_size;
-+  BYTE *ptr, *out_data, *in_header;
-+  UINT32 result, len, in_rsp_size;
-+  UINT16 tag = VTPM_TAG_REQ;
-+	
-+  printf("Saving NVM\n");
-+  if (vtpm_tx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
-+#else
-+	vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
-+#endif
-+  }
-+
-+  if (vtpm_tx_fh < 0) {
-+		return -1;
-+  }
-+ 
-+  // Send request to VTPM Manager to encrypt data
-+#ifdef VTPM_MUTLI_VM
-+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT + data_length;
-+#else
-+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV + data_length;
-+#endif
-+  
-+  out_data = ptr = (BYTE *) malloc(len);
-+
-+  if (ptr == NULL
-+#ifndef VTPM_MUTLI_VM
-+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
-+#endif
-+	  || tpm_marshal_UINT16(&ptr, &len, tag)
-+#ifdef VTPM_MUTLI_VM
-+	  || tpm_marshal_UINT32(&ptr, &len, out_data_size)
-+#else
-+	  || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
-+#endif  
-+	  || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_SAVENVM)
-+	  || tpm_marshal_BYTE_ARRAY(&ptr, &len, data, data_length)) {
-+	free(out_data);
-+	return -1;
-+  }
-+  
-+  printf("\tSending SaveNVM Command.\n");
-+  res = write(vtpm_tx_fh, out_data, out_data_size);
-+  free(out_data);
-+  if (res != out_data_size) return -1;
-+
-+  if (vtpm_rx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+    vtpm_rx_fh = vtpm_tx_fh
-+#else
-+    if (vtpm_rx_name == NULL) {
-+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
-+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
-+    }
-+	vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
-+#endif
-+  }
-+
-+  if (vtpm_rx_fh < 0) {
-+		return -1;
-+  }
-+  
-+  // Read Header of response so we can get the size & status
-+#ifdef VTPM_MUTLI_VM
-+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
-+#else
-+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
-+#endif
-+  in_header = ptr = malloc(in_header_size);
-+  
-+  printf("\tReading SaveNVM header.\n");
-+  res = read(vtpm_rx_fh, in_header, in_header_size);
-+
-+  if ( (res != in_header_size)
-+#ifndef VTPM_MUTLI_VM
-+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
-+#endif
-+	   || tpm_unmarshal_UINT16(&ptr, &len, &tag)
-+	   || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
-+	   || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
-+	  free(in_header);
-+	  return -1;
-+  }
-+  free(in_header);
-+  
-+  if (result != VTPM_SUCCESS) {
-+      return -1;  
-+  }
-+
-+#ifdef VTPM_MUTLI_VM
-+  close(vtpm_tx_fh); close(vtpm_rx_fh);
-+#endif
-+	  
-+  printf("\tFinishing up SaveNVM\n");
-+  return (0);
- }
- 
- static int read_from_file(uint8_t **data, size_t *data_length)
- {
--  int res;
--  int fp, file_status;
--  struct stat file_info;
--  fp = open(TPM_STORAGE_FILE, O_RDONLY, 0);
--  file_status = fstat(fp, &file_info);
--  if (file_status < 0) {
--    close(fp);
--    return -1;
--  } 
-+  int res, out_data_size, in_header_size;
-+  uint8_t *ptr, *out_data, *in_header;
-+  UINT16 tag = VTPM_TAG_REQ;
-+  UINT32 len, in_rsp_size, result;
-+#ifdef VTPM_MUTLI_VM
-+	int vtpm_rx_fh, vtpm_tx_fh;
-+#endif
-+	
-+  printf("Loading NVM.\n");
-+  if (vtpm_tx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
-+#else
-+	vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
-+#endif
-+  }
- 
--  *data_length = file_info.st_size; 
--  *data = tpm_malloc(*data_length);
--  if (*data == NULL) {
--    close(fp);
-+  if (vtpm_tx_fh < 0) {
-+		return -1;
-+  }
-+ 
-+  // Send request to VTPM Manager to encrypt data
-+#ifdef VTPM_MUTLI_VM
-+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
-+#else
-+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
-+#endif
-+  out_data = ptr = (BYTE *) malloc(len);
-+
-+  if (ptr == NULL
-+#ifndef VTPM_MUTLI_VM
-+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
-+#endif  
-+      || tpm_marshal_UINT16(&ptr, &len, tag)
-+#ifdef VTPM_MUTLI_VM
-+      || tpm_marshal_UINT32(&ptr, &len, out_data_size)
-+#else
-+      || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
-+#endif
-+      || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_LOADNVM)) {
-+    free(out_data);
-     return -1;
-   }
--  res = read(fp, *data, *data_length);
--  close(fp);
-+
-+  printf("\tSending LoadNVM command\n");
-+  res = write(vtpm_tx_fh, out_data, out_data_size);
-+  free(out_data);
-+  if (res != out_data_size) return -1;
-+
-+    if (vtpm_rx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+    vtpm_rx_fh = vtpm_tx_fh;
-+#else
-+    if (vtpm_rx_name == NULL) {
-+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
-+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
-+    }
-+	vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
-+#endif
-+  }
-+
-+  if (vtpm_rx_fh < 0) {
-+		return -1;
-+  }
-+  
-+  // Read Header of response so we can get the size & status
-+#ifdef VTPM_MUTLI_VM
-+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
-+#else
-+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
-+#endif
-+  in_header = ptr = malloc(in_header_size);
-+  
-+  printf("\tReading LoadNVM header\n");
-+  res = read(vtpm_rx_fh, in_header, in_header_size);
-+
-+  if ( (res != in_header_size)
-+#ifndef VTPM_MUTLI_VM
-+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
-+#endif
-+       || tpm_unmarshal_UINT16(&ptr, &len, &tag)
-+       || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
-+       || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
-+      free(in_header);
-+      return -1;
-+  }
-+  free(in_header);
-+  
-+  if (result != VTPM_SUCCESS) {
-+      return -1;  
-+  }
-+
-+  // Read Encrypted data from VTPM Manager
-+  *data_length = in_rsp_size - VTPM_COMMAND_HEADER_SIZE_CLT;
-+  *data = (uint8_t *) malloc(*data_length);
-+
-+  printf("\tReading clear data from LoadNVM.\n");
-+  res = read(vtpm_rx_fh, *data, *data_length);
-+#ifdef VTPM_MUTLI_VM
-+  close(vtpm_rx_fh);close(vtpm_tx_fh);
-+#endif 
-+	
-+  printf("\tReturing from loading NVM\n");
-   if (res != *data_length) {
--    tpm_free(*data);
--    return -1;
-+      free(*data);
-+      return -1;
-+  } else {
-+      return 0;
-   }
--  return 0;
-+
- }
- 
- #else
-diff -uprN tpm_emulator/tpmd.c vtpm/tpmd.c
---- tpm_emulator/tpmd.c	2006-12-08 12:51:29.000000000 -0800
-+++ vtpm/tpmd.c	2007-01-09 14:48:56.000000000 -0800
-@@ -21,12 +21,24 @@
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <sys/time.h>
-+#include <sys/socket.h>
-+#include <sys/un.h>
-+#include <errno.h>
- 
- #include "tpm_emulator.h"
-+#include "vtpm_manager.h"
- 
--#define TPM_RX_FNAME "/var/tpm/tpm_in.fifo"
--#define TPM_TX_FNAME "/var/tpm/tpm_out.fifo"
-+#ifdef VTPM_MULTI_VM
-+ #define DEV_BE "/dev/vtpm"
-+#else
-+ #define PVM_RX_FIFO_D "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
-+ #define PVM_TX_FIFO "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
- 
-+ #define HVM_RX_FIFO_D "/var/vtpm/socks/%d.socket"
-+#endif
-+
-+ int dmi_id;
-+						
- #define BUFFER_SIZE 2048
- 
- static int devurandom=0;
-@@ -38,7 +50,7 @@ void get_random_bytes(void *buf, int nby
-   }
- 
-   if (read(devurandom, buf, nbytes) != nbytes) {
--      printf("Can't get random number.\n");
-+      error("Can't get random number.\n");
-       exit(-1);
-   }
- }
-@@ -52,105 +64,182 @@ uint64_t tpm_get_ticks(void)
- 
- int main(int argc, char **argv)
- {
--  uint8_t in[BUFFER_SIZE], *out;
-+  uint8_t type, in[BUFFER_SIZE], *out, *addressed_out;
-+  char *vtpm_rx_file=NULL;
-   uint32_t out_size;
-   int in_size, written;
--  int i;
--  struct stat file_info;
-+  int i, guest_id=-1;
- 
--  int tpm_tx_fh=-1, tpm_rx_fh=-1;
-+#ifndef VTPM_MULTI_VM
-+  int sockfd = -1;
-+  struct sockaddr_un addr;
-+  struct sockaddr_un client_addr;
-+  unsigned int client_length;
-+
-+#endif
-+ 
-+  int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
-+#ifdef VTPM_MULTI_VM
-   if (argc < 2) {
--    printf("Usage: tpmd clear|save|deactivated\n" );
-+    error("Usage: tpmd clear|save|deactivated\n" );
-+#else
-+  if (argc < 4) {
-+    error("Usage: tpmd clear|save|deactivated pvm|hvm vtpmid\n" );
-+#endif
- 	  return -1;
-   }
- 
-+#ifndef VTPM_MULTI_VM
-+  /* setup type of vm */
-+  if (!strcmp(argv[2], "pvm")) {
-+    type = VTPM_TYPE_PVM; // Get commands from vTPM Manager through fifo
-+  } else if (!strcmp(argv[2], "hvm")) {
-+    type = VTPM_TYPE_HVM; // Get commands from qemu via socket
-+  } else {
-+    error("invalid vTPM type '%s'.\n", argv[2]);
-+  }
-+
-+  dmi_id = atoi(argv[3]);
-+
-+  if (type == VTPM_TYPE_PVM) {
-+    vtpm_rx_file = malloc(10 + strlen(PVM_RX_FIFO_D));
-+    sprintf(vtpm_rx_file, PVM_RX_FIFO_D, (uint32_t) dmi_id);
-+  } else {
-+    vtpm_rx_file = malloc(10 + strlen(HVM_RX_FIFO_D));
-+    sprintf(vtpm_rx_file, HVM_RX_FIFO_D, (uint32_t) dmi_id);
-+
-+    if ( (sockfd = socket(PF_UNIX,SOCK_STREAM,0)) < 0) {
-+          error("Unable to create socket. errno = %d\n", errno);
-+      exit (-1);
-+    }
-+
-+    memset(&addr, 0, sizeof(addr));
-+    addr.sun_family = AF_UNIX;
-+    strcpy(addr.sun_path,vtpm_rx_file );
-+    unlink(addr.sun_path);
-+  }
-+#endif
-+
-+#ifdef VTPM_MULTI_VM
-+  info("Initializing tpm state: %s\n", argv[1]);
-+#else
-+  info("Initializing tpm state: %s, type: %s, id: %d\n", argv[1], argv[2], dmi_id);
-+#endif
-+
-   /* initialize TPM emulator */
-   if (!strcmp(argv[1], "clear")) {
--    printf("Initializing tpm: %s\n", argv[1]);
-     tpm_emulator_init(1);
--  } else if (!strcmp(argv[1], "save")) { 
--    printf("Initializing tpm: %s\n", argv[1]);
-+  } else if (!strcmp(argv[1], "save")) {
-     tpm_emulator_init(2);
-   } else if (!strcmp(argv[1], "deactivated")) {
--    printf("Initializing tpm: %s\n", argv[1]);
-     tpm_emulator_init(3);
-   } else {
--    printf("invalid startup mode '%s'; must be 'clear', "
-+    error("invalid startup mode '%s'; must be 'clear', "
-       "'save' (default) or 'deactivated", argv[1]);
-     return -1;
-   }
--
--  if ( stat(TPM_RX_FNAME, &file_info) == -1) {
--    if ( mkfifo(TPM_RX_FNAME, S_IWUSR | S_IRUSR ) ) {
--      printf("Failed to create fifo %s.\n", TPM_RX_FNAME);
--      return -1;
--    }
--  }
--
--  if ( stat(TPM_TX_FNAME, &file_info) == -1) {
--    if ( mkfifo(TPM_TX_FNAME, S_IWUSR | S_IRUSR ) ) {
--      printf("Failed to create fifo %s.\n", TPM_TX_FNAME);
--      return -1;
--    }
--  }
--
-+  
-   while (1) {
- abort_command:
--    if (tpm_rx_fh < 0) {
--      tpm_rx_fh = open(TPM_RX_FNAME, O_RDONLY);
-+    if (vtpm_rx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+      vtpm_rx_fh = open(DEV_BE, O_RDWR);
-+#else
-+      if (type == VTPM_TYPE_PVM) {
-+        vtpm_rx_fh = open(vtpm_rx_file, O_RDONLY);
-+      } else {
-+        if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
-+          error("Unable to bind(). errno = %d\n", errno);
-+          exit (-1);
-+        }
-+
-+        if (listen(sockfd, 10) <0) {
-+          error("Unable to listen(). errno = %d\n", errno);
-+          exit (-1);
-+        }
-+
-+        memset(&client_addr, 0, sizeof(client_addr));
-+        client_length = sizeof(client_addr);
-+
-+        vtpm_rx_fh = vtpm_tx_fh = accept(sockfd, (struct sockaddr *)&client_addr, &client_length);
-+      }
-+#endif
-     }
-     
--    if (tpm_rx_fh < 0) {
--      printf("ERROR: failed to open devices to listen to guest.\n");
-+    if (vtpm_rx_fh < 0) {
-+      error("Failed to open devices to listen to guest.\n");
-       return -1;
-     }
-     
--    if (tpm_tx_fh < 0) {
--      tpm_tx_fh = open(TPM_TX_FNAME, O_WRONLY);
--    }
--
--    if (tpm_tx_fh < 0) {
--      printf("ERROR: failed to open devices to respond to guest.\n");
--      return -1;
--    }
--
--    in_size = read(tpm_rx_fh, in, BUFFER_SIZE);
-+    in_size = read(vtpm_rx_fh, in, BUFFER_SIZE);
-     if (in_size < 6) { // Magic size of minium TPM command
--      printf("Recv[%d] to small: 0x", in_size);
-+      info("Recv incomplete command of %d bytes.", in_size);
-       if (in_size <= 0) {
--          close(tpm_rx_fh);
--          tpm_rx_fh = -1;
-+          close(vtpm_rx_fh);
-+          vtpm_rx_fh = -1;
-           goto abort_command;
-       }
-     } else { 
--      printf("Recv[%d]: 0x", in_size);
-+      debug_nostop("Recv[%d]: 0x", in_size);
-       for (i=0; i< in_size; i++) 
--        printf("%x ", in[i]);
--      printf("\n");
-+        debug_more("%x ", in[i]);
-+      debug_more("\n");
-     }
- 
--    
--    if (tpm_handle_command(in, in_size, &out, &out_size) != 0) { 
--        printf("ERROR: Handler Failed.\n");
-+    if (guest_id == -1) {
-+        guest_id = *((uint32_t *) in);
-+    } else {
-+        if (guest_id != *((uint32_t *) in) ) {
-+            error("WARNING: More than one guest attached\n");
-+        }
-+    }
-+
-+    if (vtpm_tx_fh < 0) {
-+#ifdef VTPM_MUTLI_VM
-+      vtpm_tx_fh = open(DEV_BE, O_RDWR);
-+      vtpm_rx_fh = vtpm_tx_fh;
-+#else
-+      if (type == VTPM_TYPE_PVM) {
-+        vtpm_tx_fh = open(PVM_TX_FIFO, O_WRONLY);
-+      } // No need to open the other direction for HVM
-+#endif
-+    }
-+
-+    if (vtpm_tx_fh < 0) {
-+      error("Failed to open devices to respond to guest.\n");
-+      return -1;
-+    }
-+
-+    // Handle the command, but skip the domain id header    
-+    if (tpm_handle_command(in + sizeof(uint32_t), in_size - sizeof(uint32_t), &out, &out_size) != 0) { 
-+      error("Handler Failed.\n");
-     }
- 
--    written = write(tpm_tx_fh, out, out_size);
-+    addressed_out = (uint8_t *) tpm_malloc(sizeof(uint32_t) + out_size);
-+    *(uint32_t *) addressed_out = *(uint32_t *) in;
-+    memcpy(addressed_out + sizeof(uint32_t), out, out_size);
-+
-+    written = write(vtpm_tx_fh, addressed_out, out_size + sizeof(uint32_t));
- 
--    if (written != out_size ) {
--      printf("ERROR: Part of response not written %d/%d.\nAttempt: ", written, out_size);
-+    if (written != out_size + sizeof(uint32_t)) {
-+      error("Part of response not written %d/%d.\n", written, out_size);
-     } else {
--      printf("Sent[%Zu]: ", out_size);
-+      debug_nostop("Sent[%Zu]: ", out_size + sizeof(uint32_t));
-+      for (i=0; i< out_size+ sizeof(uint32_t); i++)
-+        debug_more("%x ", addressed_out[i]);
-+      debug_more("\n");
-     }
--    for (i=0; i< out_size; i++)
--      printf("%x ", out[i]);
--    printf("\n");
-     tpm_free(out);
-+    tpm_free(addressed_out);
- 
-   } // loop
- 
-   tpm_emulator_shutdown();
- 
--  close(tpm_tx_fh);
--  close(tpm_rx_fh);
-+  close(vtpm_tx_fh);
-+#ifndef VTPM_MUTLI_VM
-+  close(vtpm_rx_fh);
-+  free (vtpm_rx_file);
-+#endif
- 
- }
diff --git a/tools/vtpm_manager/COPYING b/tools/vtpm_manager/COPYING
deleted file mode 100644
index c4b86b7..0000000
--- a/tools/vtpm_manager/COPYING
+++ /dev/null
@@ -1,32 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
diff --git a/tools/vtpm_manager/Makefile b/tools/vtpm_manager/Makefile
deleted file mode 100644
index 632f41b..0000000
--- a/tools/vtpm_manager/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-XEN_ROOT = $(CURDIR)/../..
-
-# Base definitions and rules
-include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
-
-SUBDIRS		= crypto tcs util manager migration
-OPENSSL_HEADER	= /usr/include/openssl/crypto.h
-
-.PHONY: all clean install
-all clean install: %: subdirs-%
-
-.PHONY: mrproper
-mrproper:
-	@set -e; for subdir in $(SUBDIRS); do \
-		$(MAKE) -C $$subdir $@; \
-	done
-
-
diff --git a/tools/vtpm_manager/README b/tools/vtpm_manager/README
deleted file mode 100644
index f0d1e98..0000000
--- a/tools/vtpm_manager/README
+++ /dev/null
@@ -1,94 +0,0 @@
-// ===================================================================
-//
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above
-//     copyright notice, this list of conditions and the following
-//     disclaimer in the documentation and/or other materials provided
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-
-Directory Structure
-===================
-tools/vtpm_manager/crypto    -> crypto files
-tools/vtpm_manager/TCS       -> TCS implementation
-tools/vtpm_manager/util      -> Utility Library. Include disk-io and buffers.
-tools/vtpm_manager/manager   -> VTPM Manager
-
-Compile Flags
-===================
-LOGGING_MODULES              -> How extensive logging happens
-                                see util/log.h for more info
-
-VTPM_MULTI_VM                -> Defined: VTPMs run in their own VMs
-                                Not Defined (default): VTPMs are processes
-
-# Debugging flags that may disappear without notice in the future
-
-DUMMY_BACKEND                -> vtpm_manager listens on /tmp/in.fifo and 
-                                /tmp/out.fifo rather than backend
-
-MANUAL_DM_LAUNCH             -> Must manually launch & kill VTPMs
-
-WELL_KNOWN_OWNER_AUTH        -> Rather than randomly generating the password for the owner,
-                                use a well known value. This is useful for debugging and for
-                                poor bios which do not support clearing TPM if OwnerAuth is
-                                lost. However this has no protection from malicious app
-                                issuing a TPM_OwnerClear to wipe the TPM 
-
-Requirements
-============
-- xen-unstable 
-- vtpm frontend/backend driver patch
-- OpenSSL Library
-
-Single-VM Flow
-============================
-- Launch the VTPM manager (vtpm_managerd) which which begins listening to the BE with one thread
-  and listens to a named fifo that is shared by the vtpms to commuincate with the manager.
-- VTPM Manager listens to TPM BE.
-- When xend launches a tpm frontend equipped VM it contacts the manager over the vtpm backend. 
-- When the manager receives the open message from the BE, it launches a vtpm
-- Xend allows the VM to continue booting. 
-- When a TPM request is issued to the front end, the front end transmits the TPM request to the backend.
-- The manager receives the TPM requests and uses a named fifo to forward the request to the vtpm.
-- The fifo listener begins listening for the reply from vtpm for the request.
-- Vtpm processes request and replies to manager over shared named fifo.
-- If needed, the vtpm may send a request to the vtpm_manager at any time to save it's secrets to disk.
-- Manager receives response from vtpm and passes it back to backend for forwarding to guest.
-
-NOTES:
-* SaveService SHOULD seal it's table before saving it to disk. However,
-  the current Xen infrastructure does not provide a mechanism for this to be
-  unsealed later. Specifically, the auth and wrapped key must be available ONLY
-  to the service, or it's not even worth encrypting
-
-  In the future the vtpm manager will be protected by an early boot mechanism
-  that will allow for better protection of it's data.
-
-TODO:
-- Timeout on crashed vtpms
-- create lock for shared fifo for talking to vtpms.
diff --git a/tools/vtpm_manager/Rules.mk b/tools/vtpm_manager/Rules.mk
deleted file mode 100644
index 651772b..0000000
--- a/tools/vtpm_manager/Rules.mk
+++ /dev/null
@@ -1,59 +0,0 @@
-# Base definitions and rules (XEN_ROOT must be defined in including Makefile)
-include $(XEN_ROOT)/tools/Rules.mk
-
-#
-# Tool definitions
-#
-
-# General compiler flags
-CFLAGS	= -Werror -g3
-
-# Generic project files
-HDRS	= $(wildcard *.h)
-SRCS	= $(wildcard *.c)
-OBJS	= $(patsubst %.c,%.o,$(SRCS))
-
-# Generic (non-header) dependencies
-$(SRCS): Makefile $(XEN_ROOT)/tools/Rules.mk $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
-
-$(OBJS): $(SRCS)
-
--include $(FILES)
-
-# Make sure these are just rules
-.PHONY : all build install clean
-
-#
-# Project-specific definitions
-#
-
-# Need UNIX98 spec for pthread rwlocks
-CFLAGS += -D_GNU_SOURCE
-
-# Logging Level. See utils/tools.h for usage
-CFLAGS += -DLOGGING_MODULES="(BITMASK(VTPM_LOG_TCS)|BITMASK(VTPM_LOG_VTSP)|BITMASK(VTPM_LOG_VTPM))"
-
-# Silent Mode
-#CFLAGS += -DLOGGING_MODULES=0x0
-#CFLAGS += -DLOGGING_MODULES=0xff
-
-# Use frontend/backend pairs between manager & DMs?
-#CFLAGS += -DVTPM_MULTI_VM
-
-# vtpm_manager listens on fifo's rather than backend
-#CFLAGS += -DDUMMY_BACKEND
-
-# TCS talks to fifo's rather than /dev/tpm. TPM Emulator assumed on fifos
-#CFLAGS += -DDUMMY_TPM
-
-# Do not have manager launch DMs.
-#CFLAGS += -DMANUAL_DM_LAUNCH
-
-# Fixed OwnerAuth
-#CFLAGS += -DWELL_KNOWN_OWNER_AUTH
-
-# Include
-CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/crypto
-CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/util
-CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/tcs
-CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/manager
diff --git a/tools/vtpm_manager/crypto/Makefile b/tools/vtpm_manager/crypto/Makefile
deleted file mode 100644
index 13b61c9..0000000
--- a/tools/vtpm_manager/crypto/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-XEN_ROOT = $(CURDIR)/../../..
-include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
-
-BIN		= libtcpaCrypto.a
-
-.PHONY: all
-all: build
-
-.PHONY: build
-build: $(BIN)
-
-.PHONY: install
-install: build
-
-.PHONY: clean
-clean:
-	rm -f *.a *.so *.o *.rpm $(DEP_FILES)
-
-.PHONY: mrproper
-mrproper: clean
-	rm -f *~
-
-$(BIN): $(OBJS)
-	$(AR) rcs $(BIN) $(OBJS)
diff --git a/tools/vtpm_manager/crypto/crypto.c b/tools/vtpm_manager/crypto/crypto.c
deleted file mode 100644
index 7dae655..0000000
--- a/tools/vtpm_manager/crypto/crypto.c
+++ /dev/null
@@ -1,88 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// crypto.c
-// 
-//  This file will handle all the TPM Crypto functionality
-// 
-// ==================================================================
-
-#include <string.h>
-#include <openssl/crypto.h>
-#include <openssl/err.h>
-#include <openssl/evp.h>
-#include <openssl/rand.h>
-#include "crypto.h"
-#include "log.h"
-
-/**
- * Initialize cryptography library
- * @rand: random seed
- * @size: size of @rand
- */
-void Crypto_Init(const BYTE* rand, int size) {
-	ERR_load_crypto_strings();
-  CRYPTO_malloc_init();
-  OpenSSL_add_all_algorithms();
-  SYM_CIPHER = EVP_aes_128_cbc();
-  RAND_poll();
-  if (rand == NULL)
-    return;
-
-  RAND_add(rand, size, size);
-}
-
-/**
- * Shutdown cryptography library
- */
-void Crypto_Exit() {
-  ERR_free_strings();
-  ERR_remove_state(0);
-  EVP_cleanup();
-}
-
-
-/**
- * Get random data
- * @data: (OUT) Random data
- * @size: Size of @data
- */
-void Crypto_GetRandom(void* data, int size) {
-  int result;
-  
-  result = RAND_pseudo_bytes((BYTE*) data, size);
-  
-  if (result <= 0) 
-    vtpmlogerror (VTPM_LOG_CRYPTO, "RAND_pseudo_bytes failed: %s\n",
-	     ERR_error_string (ERR_get_error(), NULL));
-}
diff --git a/tools/vtpm_manager/crypto/crypto.h b/tools/vtpm_manager/crypto/crypto.h
deleted file mode 100644
index 488d4d6..0000000
--- a/tools/vtpm_manager/crypto/crypto.h
+++ /dev/null
@@ -1,175 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// crypto.h
-// 
-//  This file defines the TPM Crypto API
-//
-// ==================================================================
-
-#ifndef __CRYPTO_H__
-#define __CRYPTO_H__
-
-#include <stddef.h>
-#include <stdint.h>
-#include <stdbool.h>
-
-#include "tcg.h"
-#include "sym_crypto.h"
-
-#define CRYPTO_MAX_SIG_SIZE (2048 / 8)
-#define CRYPTO_MAX_RSA_KEY_SIZE (4096 / 8) //in bytes
-
-#define OAEP_P "TCPA"
-#define OAEP_P_SIZE 4
-
-// Algorithms supported by crypto. Stored in CRYPTO_INFO.algorithmID
-#define CRYPTO_ALGORITH_RSA 0x01
-
-// Supported Encryption Schemes CRYPTO_INFO.encScheme
-#define CRYPTO_ES_NONE 0x0001
-#define CRYPTO_ES_RSAESPKCSv15 0x0002
-#define CRYPTO_ES_RSAESOAEP_SHA1_MGF1 0x0003
-
-// Supported Signature schemes CRYPTO_INFO.sigScheme
-#define CRYPTO_SS_NONE 0x0001
-#define CRYPTO_SS_RSASSAPKCS1v15_SHA1 0x0002
-#define CRYPTO_SS_RSASSAPKCS1v15_DER 0x0003
-
-typedef struct CRYPTO_INFO {
-  void *keyInfo;
-  UINT32 algorithmID;
-  UINT32 encScheme;
-  UINT32 sigScheme;
-} CRYPTO_INFO;
-
-
-void Crypto_Init(const BYTE* rand, int size);
-
-void Crypto_Exit();
-
-void Crypto_GetRandom(void* data, int size);
-
-void Crypto_HMAC(   const BYTE* text, 
-                    int text_len, 
-                    const BYTE* key, 
-                    int key_len,
-                    BYTE* digest);
-
-TPM_RESULT Crypto_HMAC_buf (const buffer_t * text,
-                            const buffer_t * key,
-                            BYTE * o_digest); /* presumably of 20 bytes */
-    
-void Crypto_SHA1Full(   const BYTE* text, 
-                        UINT32 size,
-                        BYTE* hash); //Complete 3part SHA1
-
-// o_hash needs to be large enough to hold the digest, ie 20 bytes
-TPM_RESULT Crypto_SHA1Full_buf (const buffer_t * buf,
-                                BYTE * o_hash);
-    
-void Crypto_SHA1Start(UINT32* maxNumBytes);
-void Crypto_SHA1Update(int numBytes, const BYTE* hashData);
-void Crypto_SHA1Complete(   int hashDataSize, 
-                            const BYTE* hashData, 
-                            BYTE* hashValue);
-
-void Crypto_RSACreateKey(   /*in*/ UINT32 keySize,
-                            /*in*/ UINT32 pubExpSize, 
-                            /*in*/ BYTE *pubExp,
-                            /*out*/ UINT32 *privExpSize, 
-                            /*out*/ BYTE *privExp,
-                            /*out*/ UINT32 *modulusSize,
-                            /*out*/ BYTE *modulus,
-                            /*out*/ CRYPTO_INFO *keys);
-                            
-void Crypto_RSABuildCryptoInfo( /*[IN]*/ UINT32 pubExpSize, 
-                                /*[IN]*/ BYTE *pubExp,
-                                /*[IN]*/ UINT32 privExpSize, 
-                                /*[IN]*/ BYTE *privExp,
-                                /*[IN]*/ UINT32 modulusSize, 
-                                /*[IN]*/ BYTE *modulus, 
-                                /*[OUT]*/ CRYPTO_INFO* cryptoInfo);
-                                
-void Crypto_RSABuildCryptoInfoPublic(   /*[IN]*/ UINT32 pubExpSize, 
-                                        /*[IN]*/ BYTE *pubExp,
-                                        /*[IN]*/ UINT32 modulusSize, 
-                                        /*[IN]*/ BYTE *modulus, 
-                                        CRYPTO_INFO* cryptoInfo);
-
-//
-// symmetric pack and unpack operations
-//
-TPM_RESULT Crypto_RSAPackCryptoInfo (const CRYPTO_INFO* cryptoInfo,
-                                     BYTE ** io_buf, UINT32 * io_buflen);
-
-TPM_RESULT Crypto_RSAUnpackCryptoInfo (CRYPTO_INFO * ci,
-                                       BYTE * in, UINT32 len,
-                                       UINT32 * o_lenread);
-
-                             
-// return 0 on success, -1 on error
-int Crypto_RSAEnc(  CRYPTO_INFO *keys,
-                    UINT32 inDataSize,
-                    BYTE *inData,
-                    /*out*/ UINT32 *outDataSize,
-                    /*out*/ BYTE *outData);
-
-// return 0 on success, -1 on error
-int Crypto_RSADec(  CRYPTO_INFO *keys,
-                    UINT32 inDataSize,
-                    BYTE *inData,
-                    /*out*/ UINT32 *outDataSize,
-                    /*out*/ BYTE *outData);
-
-// return 0 on success, -1 on error
-int Crypto_RSASign( CRYPTO_INFO *keys,
-                    UINT32 inDataSize,
-                    BYTE *inData,
-                    /*out*/ UINT32 *sigSize,
-                    /*out*/ BYTE *sig);
-
-bool Crypto_RSAVerify(  CRYPTO_INFO *keys,
-                        UINT32 inDataSize,
-                        BYTE *inData,
-                        UINT32 sigSize,
-                        BYTE *sig);
-
-//private:
-int RSA_verify_DER(int dtype, unsigned char *m, unsigned int m_len,
-                   unsigned char *sigbuf, unsigned int siglen, CRYPTO_INFO *key);
-
-int RSA_sign_DER(int type, unsigned char *m, unsigned int m_len,
-              unsigned char *sigret, unsigned int *siglen, CRYPTO_INFO *key);
-
-#endif // __CRYPTO_H__
diff --git a/tools/vtpm_manager/crypto/hash.c b/tools/vtpm_manager/crypto/hash.c
deleted file mode 100644
index c73114a..0000000
--- a/tools/vtpm_manager/crypto/hash.c
+++ /dev/null
@@ -1,153 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// hash.c
-// 
-//  This file will handle all the TPM Hash functionality
-//
-// ==================================================================
-
-#include <string.h>
-#include <openssl/crypto.h>
-#include <openssl/err.h>
-#include <openssl/evp.h>
-#include <openssl/rand.h>
-#include <openssl/hmac.h>
-#include <openssl/sha.h>
-#include <openssl/bn.h>
-#include <openssl/rsa.h>
-
-#include "tcg.h"         // for TPM_SUCCESS
-#include "crypto.h"
-
-static SHA_CTX g_shaContext;
-
-void Crypto_HMAC(   const BYTE* text, 
-                    int text_len, 
-                    const BYTE* key, 
-                    int key_len, 
-                    BYTE* digest) {
-  if (text == NULL || key == NULL || text_len == 0 || key_len == 0) 
-    return;
-  
-  HMAC(EVP_sha1(), key, key_len, text, text_len, digest, NULL);
-}
-
-TPM_RESULT Crypto_HMAC_buf (const buffer_t * text,
-			    const buffer_t * key,
-			    BYTE * o_digest) { /* presumably of 20 bytes */
-  
-  Crypto_HMAC (text->bytes, text->size, 
-	       key->bytes, key->size,
-	       o_digest);
-  
-  return TPM_SUCCESS;
-}
-
-
-/*
- * SHA1
- * (OUT) Create a SHA1 hash of text. Calls all three SHA1 steps internally
- */
-void Crypto_SHA1Full( const BYTE* text, 
-      uint32_t size, 
-      BYTE* hash) {
-
-  if (text == NULL || size == 0) 
-    return;
-  
-  // Run SHA1Start + SHAUpdate (if necessary) + SHAComplete
-  uint32_t maxBytes; // Not used for anything
-  Crypto_SHA1Start(&maxBytes);
-  
-  while (size > 64){
-    Crypto_SHA1Update(64, text); 
-    size -= 64;
-    text += 64;
-  }
-  
-  Crypto_SHA1Complete(size, text, hash);
-}
-
-// same thing using buffer_t
-TPM_RESULT Crypto_SHA1Full_buf (const buffer_t * buf,
-                                 BYTE * o_digest) {
-
-  if (buf->bytes == NULL || buf->size == 0) 
-    return TPM_BAD_PARAMETER;
-  
-  Crypto_SHA1Full (buf->bytes, buf->size, o_digest);
-  
-  return TPM_SUCCESS;
-}
-
-
-/*
- * Initialize SHA1
- * (OUT) Maximum number of bytes that can be sent to SHA1Update. 
- *   Must be a multiple of 64 bytes.
- */
-void Crypto_SHA1Start(uint32_t* maxNumBytes) {
-  int max = SHA_CBLOCK;
-  // Initialize the crypto library
-  SHA1_Init(&g_shaContext);
-  *maxNumBytes = max;
-}
-
-/*
- * Process SHA1
- * @numBytes: (IN) The number of bytes in hashData. 
- *       Must be a multiple of 64 bytes.
- * @hashData: (IN) Bytes to be hashed.
- */
-void Crypto_SHA1Update(int numBytes, const BYTE* hashData) {
-
-  if (hashData == NULL || numBytes == 0 || numBytes%64 != 0) 
-    return;
-  
-  SHA1_Update(&g_shaContext, hashData, numBytes); 
-}
-
-/*
- * Complete the SHA1 process
- * @hashDataSize: (IN) Number of bytes in hashData.
- *       Must be a multiple of 64 bytes.
- * @hashData: (IN) Final bytes to be hashed.
- * @hashValue: (OUT) The output of the SHA-1 hash.
- */
-void Crypto_SHA1Complete(int hashDataSize, 
-			 const BYTE* hashData, 
-			 BYTE* hashValue) {
-  SHA1_Update(&g_shaContext, hashData, hashDataSize);
-  SHA1_Final(hashValue, &g_shaContext);
-}
diff --git a/tools/vtpm_manager/crypto/rsa.c b/tools/vtpm_manager/crypto/rsa.c
deleted file mode 100644
index 7737dc6..0000000
--- a/tools/vtpm_manager/crypto/rsa.c
+++ /dev/null
@@ -1,434 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// rsa.c
-// 
-//  This file will handle all the TPM RSA crypto functionality
-// 
-// ==================================================================
-
-#include <string.h>
-#include <openssl/crypto.h>
-#include <openssl/evp.h>
-#include <openssl/bn.h>
-#include <openssl/rsa.h>
-#include <openssl/rand.h>
-#include <openssl/x509.h>
-
-#include <openssl/err.h>
-#include <stdio.h>
-
-#include "tcg.h"
-#include "buffer.h"
-#include "crypto.h"
-#include "log.h"
-
-void Crypto_RSACreateKey(   /*in*/ UINT32 keySize,
-                            /*in*/ UINT32 pubExpSize, 
-                            /*in*/ BYTE *pubExp,
-                            /*out*/ UINT32 *privExpSize, 
-                            /*out*/ BYTE *privExp,
-                            /*out*/ UINT32 *modulusSize,        
-                            /*out*/ BYTE *modulus,
-                            /*out*/ CRYPTO_INFO *keys) {
-  unsigned long e_value;
-  
-  if (pubExpSize == 0) // Default e = 2^16+1
-    e_value = (0x01 << 16) + 1;
-  else {
-    // This is not supported, but the following line MIGHT work
-    // under then assumption that the format is BigNum compatable
-    // Though it's not in the spec, so who knows what it is.
-    // Forcing the default.
-    //BN_bin2bn(pubExp, pubExpSize, NULL);
-    e_value = (0x01 << 16) + 1;
-  }
-
-  RSA *rsa = RSA_generate_key(keySize, e_value, NULL, NULL);
-  
-  if (keys) {
-    keys->keyInfo = rsa;
-    keys->algorithmID = CRYPTO_ALGORITH_RSA;
-  }
-  
-  if (modulus)   *modulusSize   = BN_bn2bin(rsa->n, modulus);
-  if (privExp)   *privExpSize   = BN_bn2bin(rsa->d, privExp);
-}
-
-// Create a CRYPTO_INFO struct from the BYTE * key parts. 
-// If pubExp info is NULL, use TCG default.
-// If there is a remainder while calculating the privExp, return FALSE.
-
-void Crypto_RSABuildCryptoInfo( /*[IN]*/ UINT32 pubExpSize, 
-                                /*[IN]*/ BYTE *pubExp,
-                                /*[IN]*/ UINT32 privExpSize, 
-                                /*[IN]*/ BYTE *privExp,
-                                /*[IN]*/ UINT32 modulusSize, 
-                                /*[IN]*/ BYTE *modulus, 
-                                CRYPTO_INFO* cryptoInfo) {
-  cryptoInfo->keyInfo = RSA_new();
-  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
-  
-  rsa->e = BN_new();
-  
-  if (pubExpSize == 0) { // Default e = 2^16+1
-    BN_set_bit(rsa->e, 16);
-    BN_set_bit(rsa->e, 0);
-  } else {
-    // This is not supported, but the following line MIGHT work
-    // under then assumption that the format is BigNum compatable
-    // Though it's not in the spec, so who knows what it is.
-    // Forcing the default.
-    //BN_bin2bn(pubExp, pubExpSize, NULL);
-    BN_set_bit(rsa->e, 16);
-    BN_set_bit(rsa->e, 0);
-  }
-  
-  rsa->n = BN_bin2bn(modulus, modulusSize, NULL);
-  rsa->d = BN_bin2bn(privExp, privExpSize, NULL);
-}
-
-// Create a CRYPTO_INFO struct from the BYTE * key parts. 
-// If pubExp info is NULL, use TCG default.
-// If there is a remainder while calculating the privExp, return FALSE.
-
-void Crypto_RSABuildCryptoInfoPublic(   /*[IN]*/ UINT32 pubExpSize, 
-                                        /*[IN]*/ BYTE *pubExp,
-                                        /*[IN]*/ UINT32 modulusSize, 
-                                        /*[IN]*/ BYTE *modulus, 
-                                        CRYPTO_INFO* cryptoInfo) {
-  cryptoInfo->keyInfo = RSA_new();
-  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
-  
-  rsa->e = BN_new();
-  
-  if (pubExpSize == 0) { // Default e = 2^16+1
-    BN_set_bit(rsa->e, 16);
-    BN_set_bit(rsa->e, 0);
-  } else {
-    // This is not supported, but the following line MIGHT work
-    // under then assumption that the format is BigNum compatable
-    // Though it's not in the spec, so who knows what it is.
-    // Forcing the default.
-    //BN_bin2bn(pubExp, pubExpSize, NULL);
-    BN_set_bit(rsa->e, 16);
-    BN_set_bit(rsa->e, 0);
-  }
-  
-  rsa->n = BN_bin2bn(modulus, modulusSize, NULL);
-  
-}
-
-int Crypto_RSAEnc(  CRYPTO_INFO *key,
-		    UINT32 inDataSize,
-		    BYTE *inData,
-		    /*out*/ UINT32 *outDataSize,
-		    /*out*/ BYTE *outData) {
-  RSA *rsa = (RSA *) key->keyInfo;
-  UINT32 paddedDataSize = RSA_size (rsa);
-  BYTE *paddedData = (BYTE *)malloc(sizeof(BYTE) * paddedDataSize);
-  int rc;
-    
-  if (paddedData == NULL) 
-    return -1;
-
-  *outDataSize = 0;
-  
-  switch (key->encScheme) {
-  case CRYPTO_ES_RSAESPKCSv15:
-    if (RSA_padding_add_PKCS1_type_2(paddedData, paddedDataSize, inData, inDataSize) <= 0) {
-      rc = -1; 
-      goto abort_egress;
-    }
-    break;
-  case CRYPTO_ES_RSAESOAEP_SHA1_MGF1:
-    if (RSA_padding_add_PKCS1_OAEP(paddedData,paddedDataSize,inData,inDataSize, (BYTE *) OAEP_P,OAEP_P_SIZE) <= 0 ) {
-      rc = -1; 
-      goto abort_egress;
-    }
-    break;
-  default:
-    rc = -1; 
-    goto abort_egress;
-  }
-  
-  rc = RSA_public_encrypt(paddedDataSize, paddedData, outData, rsa, RSA_NO_PADDING);
-  if (rc == -1)
-    goto abort_egress; 
-   
-  *outDataSize = rc;
-  
-  if (rc > 0) rc = 0;
-  
-  goto egress;
-  
- abort_egress:
- egress:
-  
-  if (paddedData) 
-    free (paddedData);
-  return rc;
-  
-}
-
-int Crypto_RSADec(  CRYPTO_INFO *key,
-                    UINT32 inDataSize,
-                    BYTE *inData,
-                    /*out*/ UINT32 *outDataSize,
-                    /*out*/ BYTE *outData) {
-  
-  RSA *rsa = (RSA *) key->keyInfo;
-  UINT32 paddedDataSize = RSA_size (rsa);
-  BYTE *paddedData = (BYTE *)malloc(sizeof(BYTE) * paddedDataSize);
-  int rc;
-  
-  if (paddedData == NULL)
-    goto abort_egress;
-  
-  rc = RSA_private_decrypt(inDataSize, inData, paddedData, rsa, RSA_NO_PADDING);
-  if (rc == -1) {
-    vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_private_decrypt: %s\n", ERR_error_string(ERR_get_error(), NULL));
-    goto abort_egress;
-  }
-  
-  paddedDataSize = rc;
-  
-  switch (key->encScheme) {
-  case CRYPTO_ES_RSAESPKCSv15:
-    rc = RSA_padding_check_PKCS1_type_2 (outData, paddedDataSize,
-					 paddedData + 1, paddedDataSize - 1,
-					 RSA_size(rsa));
-    if (rc == -1) {
-      vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_padding_check_PKCS1_type_2: %s\n", 
-	      ERR_error_string(ERR_get_error(), NULL));
-      goto abort_egress;
-    }
-    *outDataSize = rc;
-    break;
-  case CRYPTO_ES_RSAESOAEP_SHA1_MGF1:
-    rc = RSA_padding_check_PKCS1_OAEP(outData, paddedDataSize,
-				      paddedData + 1, paddedDataSize - 1,
-				      RSA_size(rsa),
-				      (BYTE *) OAEP_P, OAEP_P_SIZE);
-    if (rc == -1) {
-      vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_padding_check_PKCS1_OAEP: %s\n",
-	      ERR_error_string(ERR_get_error(), NULL));
-      goto abort_egress;
-    }
-    *outDataSize = rc;
-    break;
-  default:
-    *outDataSize = 0;
-  }
-  
-  free(paddedData); paddedData = NULL;
-  goto egress;
-  
- abort_egress:
-  
-  if (paddedData) 
-    free (paddedData);
-  return -1;
-  
- egress:
-  return 0;
-}
-
-// Signs either a SHA1 digest of a message or a DER encoding of a message
-// Textual messages MUST be encoded or Hashed before sending into this function
-// It will NOT SHA the message.
-int Crypto_RSASign( CRYPTO_INFO *key,
-                    UINT32 inDataSize,
-                    BYTE *inData,
-                    /*out*/ UINT32 *sigSize,
-                    /*out*/ BYTE *sig) {
-  int status;
-  unsigned int intSigSize;
-  
-  switch(key->sigScheme) {
-  case CRYPTO_SS_RSASSAPKCS1v15_SHA1: 
-    status = RSA_sign(NID_sha1, inData, inDataSize, sig, &intSigSize, (RSA *) key->keyInfo);
-    break;
-  case CRYPTO_SS_RSASSAPKCS1v15_DER:
-    //        status = Crypto_RSA_sign_DER(NID_md5_sha1, inData, inDataSize, sig, &intSigSize, key);
-    vtpmlogerror(VTPM_LOG_CRYPTO, "Crypto: Unimplemented sign type (%d)\n", key->sigScheme);
-    status = 0;
-    break;
-  default:
-    status = 0;
-  }
-  
-  if (status == 0) {
-    *sigSize = 0;
-    vtpmlogerror(VTPM_LOG_CRYPTO, "%s\n", ERR_error_string(ERR_get_error(), NULL));
-    return -1;
-  }
-  
-  *sigSize = (UINT32) intSigSize;
-  return 0;
-}
-
-bool Crypto_RSAVerify(  CRYPTO_INFO *key,
-                        UINT32 inDataSize,
-                        BYTE *inData,
-                        UINT32 sigSize,
-                        BYTE *sig) {
-  int status;
-  
-  switch(key->sigScheme){
-  case CRYPTO_SS_RSASSAPKCS1v15_SHA1: 
-    status = RSA_verify(NID_sha1, inData, inDataSize, sig, sigSize, (RSA *) key->keyInfo);
-    break;
-  case CRYPTO_SS_RSASSAPKCS1v15_DER:
-    //status = Crypto_RSA_verify_DER(NID_md5_sha1, inData, inDataSize, sig, sigSize, key);
-    vtpmlogerror(VTPM_LOG_CRYPTO, "Crypto: Unimplemented sign type (%d)\n", key->sigScheme);
-    status = 0;
-    break;
-  default:
-    status = 0;
-  }
-  
-  if (status) 
-    return(1);
-  else {
-    vtpmlogerror(VTPM_LOG_CRYPTO, "RSA verify: %s\n", ERR_error_string(ERR_get_error(), NULL));
-    return(0);
-  }
-  
-}
-
-// helper which packs everything into a BIO!
-
-// packs the parameters first, then the private key, then the public key
-// if *io_buf is NULL, allocate it here as needed. otherwise its size is in
-// *io_buflen
-TPM_RESULT Crypto_RSAPackCryptoInfo (const CRYPTO_INFO* cryptoInfo,
-                                      BYTE ** io_buf, UINT32 * io_buflen) {
-  TPM_RESULT status = TPM_SUCCESS;
-  BYTE * buf;
-  long len, outlen = *io_buflen;
-  
-  const long PARAMSLEN = 3*sizeof(UINT32);
-  
-  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
-  
-  BIO *mem = BIO_new(BIO_s_mem());
-  
-  
-  // write the openssl keys to the BIO
-  if ( i2d_RSAPrivateKey_bio (mem, rsa) == 0 ) {
-    ERR_print_errors_fp (stderr);
-    ERRORDIE (TPM_SIZE);
-  }
-  if ( i2d_RSAPublicKey_bio (mem, rsa) == 0 ) {
-    ERR_print_errors_fp (stderr);
-    ERRORDIE (TPM_SIZE);
-  }
-  
-  // get the buffer out
-  len = BIO_get_mem_data (mem, &buf);
-  
-  // see if we need to allocate a return buffer
-  if (*io_buf == NULL) {
-    *io_buf = (BYTE*) malloc (PARAMSLEN + len);
-    if (*io_buf == NULL) 
-      ERRORDIE (TPM_SIZE);
-  } else {                      // *io_buf is already allocated
-    if (outlen < len + PARAMSLEN) 
-      ERRORDIE (TPM_SIZE); // but not large enough!  
-  }
-  
-  // copy over the parameters (three UINT32's starting at algorithmID)
-  memcpy (*io_buf, &cryptoInfo->algorithmID, PARAMSLEN);
-  
-  // copy over the DER keys
-  memcpy (*io_buf + PARAMSLEN, buf, len);
-  
-  *io_buflen = len + PARAMSLEN;
-  
-  goto egress;
-  
-  
- abort_egress:
- egress:
-  
-  BIO_free (mem);
-  
-  return status;
-}
-
-
-
-// sets up ci, and returns the number of bytes read in o_lenread
-TPM_RESULT Crypto_RSAUnpackCryptoInfo (CRYPTO_INFO * ci,
-                                        BYTE * in, UINT32 len,
-                                        UINT32 * o_lenread) {
-  
-  TPM_RESULT status = TPM_SUCCESS;
-  long l;
-  BIO *mem;
-  RSA *rsa;
-  
-  // first load up the params
-  l = 3 * sizeof(UINT32);
-  memcpy (&ci->algorithmID, in, l);
-  len -= l;
-  in += l;
-  
-  // and now the openssl keys, private first
-  mem = BIO_new_mem_buf (in, len);
-  
-  if ( (rsa = d2i_RSAPrivateKey_bio (mem, NULL)) == NULL ) {
-    ERR_print_errors_fp (stderr);
-    ERRORDIE (TPM_BAD_PARAMETER);
-  }
-  // now use the same RSA object and fill in the private key
-  if ( d2i_RSAPublicKey_bio (mem, &rsa) == NULL ) {
-    ERR_print_errors_fp (stderr);
-    ERRORDIE (TPM_BAD_PARAMETER);
-  }
-  
-  ci->keyInfo = rsa;          // needs to be freed somehow later
-  
-  // FIXME: havent figured out yet how to tell how many bytes were read in the
-  // above oprations! so o_lenread is not set
-  
-  goto egress;
-  
- abort_egress:
- egress:
-  
-  BIO_free (mem);
- 
-  return status;  
-}
diff --git a/tools/vtpm_manager/crypto/sym_crypto.c b/tools/vtpm_manager/crypto/sym_crypto.c
deleted file mode 100644
index 3d86e19..0000000
--- a/tools/vtpm_manager/crypto/sym_crypto.c
+++ /dev/null
@@ -1,237 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// sym_crypto.c
-// 
-//     Symmetric crypto portion of crypto 
-// 
-// ==================================================================
-
-#include <openssl/evp.h>
-#include <openssl/rand.h>
-
-#include "tcg.h"
-#include "sym_crypto.h"
-
-typedef enum crypt_op_type_t {
-  CRYPT_ENCRYPT,
-  CRYPT_DECRYPT
-} crypt_op_type_t;
-
-TPM_RESULT ossl_symcrypto_op (symkey_t* key,
-                              const buffer_t* in,
-                              const buffer_t* iv,
-                              buffer_t * out,
-                              crypt_op_type_t optype);
-
-
-// this is initialized in Crypto_Init()
-const EVP_CIPHER * SYM_CIPHER = NULL;
-
-const BYTE ZERO_IV[EVP_MAX_IV_LENGTH] = {0};
-
-
-TPM_RESULT Crypto_symcrypto_initkey (symkey_t * key, const buffer_t* keybits) {
-  TPM_RESULT status = TPM_SUCCESS;
-  
-  EVP_CIPHER_CTX_init (&key->context);
-  
-  key->cipher = SYM_CIPHER;
-  
-  TPMTRYRETURN( buffer_init_copy (&key->key, keybits));
-    
-  goto egress;
-  
- abort_egress:
-  EVP_CIPHER_CTX_cleanup (&key->context);
-  
- egress:
-  
-  return status;
-}
-
-
-
-TPM_RESULT Crypto_symcrypto_genkey (symkey_t * key) {
-  int res;
-  TPM_RESULT status = TPM_SUCCESS;
-  
-  // hmm, EVP_CIPHER_CTX_init does not return a value
-  EVP_CIPHER_CTX_init (&key->context);
-  
-  key->cipher = SYM_CIPHER;
-  
-  TPMTRYRETURN( buffer_init (&key->key, EVP_CIPHER_key_length(key->cipher), NULL)) ;
-  
-  // and generate the key material
-  res = RAND_pseudo_bytes (key->key.bytes, key->key.size);
-  if (res < 0) 
-    ERRORDIE (TPM_SHORTRANDOM);
-  
-  
-  goto egress;
-  
- abort_egress:
-  EVP_CIPHER_CTX_cleanup (&key->context);
-  buffer_free (&key->key);
-  
- egress:
-  return status;  
-}
-
-
-TPM_RESULT Crypto_symcrypto_encrypt (symkey_t* key,
-                              const buffer_t* clear,
-                              buffer_t* o_cipher) {
-  TPM_RESULT status = TPM_SUCCESS;
-  
-  buffer_t iv, cipher_alias;
-  
-  buffer_init_const (&iv, EVP_MAX_IV_LENGTH, ZERO_IV);
-  
-  buffer_init (o_cipher,
-	       clear->size +
-	       EVP_CIPHER_iv_length(key->cipher) +
-	       EVP_CIPHER_block_size (key->cipher),
-				 0);
-  
-  // copy the IV into the front
-  buffer_copy (o_cipher, &iv);
-  
-  // make an alias into which we'll put the ciphertext
-  buffer_init_alias (&cipher_alias, o_cipher, EVP_CIPHER_iv_length(key->cipher), 0);
-  
-  TPMTRYRETURN( ossl_symcrypto_op (key, clear, &iv, &cipher_alias, CRYPT_ENCRYPT) );
-
-  // set the output size correctly
-  o_cipher->size += cipher_alias.size;
-  
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  
-  return status;
-  
-}
-
-
-
-TPM_RESULT Crypto_symcrypto_decrypt (symkey_t* key,
-                              const buffer_t* cipher,
-                              buffer_t* o_clear) {
-  TPM_RESULT status = TPM_SUCCESS;
-  
-  buffer_t iv, cipher_alias;
-  
-  // alias for the IV
-  buffer_init_alias (&iv, cipher, 0, EVP_CIPHER_iv_length(key->cipher));
-  
-  // make an alias to where the ciphertext is, after the IV
-  buffer_init_alias (&cipher_alias, cipher, EVP_CIPHER_iv_length(key->cipher), 0);
-  
-  // prepare the output buffer
-  TPMTRYRETURN( buffer_init (o_clear,
-			cipher->size
-			- EVP_CIPHER_iv_length(key->cipher)
-			+ EVP_CIPHER_block_size(key->cipher), 
-			0) );
-  
-  // and decrypt
-  TPMTRYRETURN ( ossl_symcrypto_op (key, &cipher_alias, &iv, o_clear, CRYPT_DECRYPT) );
-  
-  goto egress;
-  
- abort_egress:
-  buffer_free (o_clear);
-  
- egress:
-  
-  return status;
-}
-
-
-
-TPM_RESULT Crypto_symcrypto_freekey (symkey_t * key) {
-  buffer_memset (&key->key, 0);
-  buffer_free (&key->key);
-  
-  EVP_CIPHER_CTX_cleanup (&key->context);
-  
-  return TPM_SUCCESS;
-}
-
-
-TPM_RESULT ossl_symcrypto_op (symkey_t* key,
-                              const buffer_t* in,
-                              const buffer_t* iv,
-                              buffer_t * out,
-                              crypt_op_type_t optype) {
-  TPM_RESULT status = TPM_SUCCESS;
-  
-  int inlen, outlen;
-  tpm_size_t running;
-  
-  if ( ! EVP_CipherInit_ex (&key->context,
-			    key->cipher, NULL, key->key.bytes, iv->bytes,
-			    optype == CRYPT_ENCRYPT ? 1 : 0) ) 
-    ERRORDIE (TPM_FAIL);
-  
-  
-  
-  inlen = in->size;
-  
-  outlen  = 0;
-  running = 0;
-  
-  
-  if ( ! EVP_CipherUpdate (&key->context, out->bytes, &outlen, in->bytes, inlen) )
-    ERRORDIE (TPM_FAIL);
-
-  running += outlen;
-  
-  if ( ! EVP_CipherFinal_ex (&key->context, out->bytes + running, &outlen) )
-    ERRORDIE (TPM_FAIL);
-  
-  running += outlen;
-  
-  out->size = running;
-  
-  goto egress;
-  
- abort_egress:
- egress:
-  
-  return status;
-}
diff --git a/tools/vtpm_manager/crypto/sym_crypto.h b/tools/vtpm_manager/crypto/sym_crypto.h
deleted file mode 100644
index 7fb59a8..0000000
--- a/tools/vtpm_manager/crypto/sym_crypto.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// sym_crypto.h
-// 
-//     Symmetric Crypto 
-// 
-// ==================================================================
-
-#ifndef _SYM_CRYPTO_H
-#define _SYM_CRYPTO_H
-
-#include <openssl/evp.h>
-#include "buffer.h"
-
-typedef struct symkey_t {
-  buffer_t key;
-  
-  EVP_CIPHER_CTX context;
-  const EVP_CIPHER * cipher;
-} symkey_t;
-
-extern const EVP_CIPHER * SYM_CIPHER;
-
-TPM_RESULT Crypto_symcrypto_genkey (symkey_t * key);
-
-TPM_RESULT Crypto_symcrypto_initkey (symkey_t * key, const buffer_t* keybits);
-
-
-// these functions will allocate their output buffers
-TPM_RESULT Crypto_symcrypto_encrypt (symkey_t* key,
-                              const buffer_t* clear,
-                              buffer_t* o_cipher);
-
-TPM_RESULT Crypto_symcrypto_decrypt (symkey_t* key,
-                              const buffer_t* cipher,
-                              buffer_t* o_clear);
-
-// only free the internal parts, not the 'key' ptr
-TPM_RESULT Crypto_symcrypto_freekey (symkey_t * key);
-
-#endif /* _SYM_CRYPTO_H */
diff --git a/tools/vtpm_manager/manager/Makefile b/tools/vtpm_manager/manager/Makefile
deleted file mode 100644
index a33c18a..0000000
--- a/tools/vtpm_manager/manager/Makefile
+++ /dev/null
@@ -1,38 +0,0 @@
-XEN_ROOT = $(CURDIR)/../../..
-include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
-
-BIN		= vtpm_managerd
-
-.PHONY: all
-all: build
-
-.PHONY: build
-build: $(BIN)
-
-.PHONY: install
-install: build
-	if [ ! -d "$(DESTDIR)/var/vtpm/fifos" ]; \
-		then mkdir -p $(DESTDIR)/var/vtpm/fifos; \
-	fi
-	if [ ! -d "$(DESTDIR)/var/vtpm/socks" ]; \
-		then mkdir -p $(DESTDIR)/var/vtpm/socks; \
-	fi
-	$(INSTALL_PROG) $(BIN) $(DESTDIR)$(BINDIR)
-
-.PHONY: clean
-clean:
-	rm -f $(BIN)
-	rm -f *.a *.so *.o *.rpm $(DEP_FILES)
-
-.PHONY: mrproper
-mrproper: clean
-	rm -f *~
-
-$(BIN): $(OBJS)
-	$(CC) $(LDFLAGS) $^ $(LIBS) -o $@
-
-# libraries
-LIBS += ../tcs/libTCS.a ../util/libTCGUtils.a ../crypto/libtcpaCrypto.a
-LIBS += -lcrypto $(PTHREAD_LIBS) -lm
-CFLAGS += $(PTHREAD_CFLAGS)
-LDFLAGS += $(PTHREAD_LDFLAGS)
diff --git a/tools/vtpm_manager/manager/dmictl.c b/tools/vtpm_manager/manager/dmictl.c
deleted file mode 100644
index 5c3cf7e..0000000
--- a/tools/vtpm_manager/manager/dmictl.c
+++ /dev/null
@@ -1,266 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-//   dmictl.c
-// 
-//     Functions for creating and destroying DMIs
-//
-// ==================================================================
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-
-#include "vtpmpriv.h"
-#include "bsg.h"
-#include "buffer.h"
-#include "log.h"
-#include "hashtable.h"
-#include "hashtable_itr.h"
-#include "vtpm_ipc.h"
-
-#define TPM_EMULATOR_PATH "/usr/bin/vtpmd"
-
-// if dmi_res is non-null, then return a pointer to new object.
-// Also, this does not fill in the measurements. They should be filled by
-// design dependent code or saveNVM
-TPM_RESULT init_dmi(UINT32 dmi_id, BYTE dmi_type, VTPM_DMI_RESOURCE **dmi_res) {
-
-  TPM_RESULT status=TPM_SUCCESS;
-  VTPM_DMI_RESOURCE *new_dmi=NULL;
-  UINT32 *dmi_id_key=NULL;
-
-  if ((new_dmi = (VTPM_DMI_RESOURCE *) malloc (sizeof(VTPM_DMI_RESOURCE))) == NULL) {
-      status = TPM_RESOURCES;
-      goto abort_egress;
-  }
-  memset(new_dmi, 0, sizeof(VTPM_DMI_RESOURCE));
-  new_dmi->dmi_id = dmi_id;
-  new_dmi->dmi_type = dmi_type;
-  new_dmi->connected = FALSE;
-  new_dmi->TCSContext = 0;
-
-  new_dmi->NVMLocation = (char *) malloc(11 + strlen(DMI_NVM_FILE));
-  sprintf(new_dmi->NVMLocation, DMI_NVM_FILE, (uint32_t) new_dmi->dmi_id);
-
-  if ((dmi_id_key = (UINT32 *) malloc (sizeof(UINT32))) == NULL) {
-    status = TPM_RESOURCES;
-    goto abort_egress;
-  }
-  *dmi_id_key = new_dmi->dmi_id;
-
-  // install into map
-  if (!hashtable_insert(vtpm_globals->dmi_map, dmi_id_key, new_dmi)){
-    vtpmlogerror(VTPM_LOG_VTPM, "Failed to insert instance into table. Aborting.\n", dmi_id);
-    status = TPM_FAIL;
-    goto abort_egress;
-  }
-
-  if (dmi_res)
-    *dmi_res = new_dmi;
-
-  goto egress;
-
- abort_egress:
-  if (new_dmi) {
-    free(new_dmi->NVMLocation);
-    free(new_dmi);
-  }
-  free(dmi_id_key);
-
- egress:
-  return status;
-}
-
-TPM_RESULT close_dmi(VTPM_DMI_RESOURCE *dmi_res) {
-  if (dmi_res == NULL) 
-    return TPM_SUCCESS;
-
-  if (dmi_res->dmi_id == VTPM_CTL_DM) 
-    return(TPM_BAD_PARAMETER);
-
-  TCS_CloseContext(dmi_res->TCSContext);
-  dmi_res->connected = FALSE;
-
-  vtpm_globals->connected_dmis--;
-
-  return (VTPM_Close_DMI_Extra(dmi_res) );
-}
-	
-TPM_RESULT VTPM_Handle_New_DMI(const buffer_t *param_buf) {
-  
-  VTPM_DMI_RESOURCE *new_dmi=NULL;
-  TPM_RESULT status=TPM_FAIL;
-  BYTE dmi_type, vm_type, startup_mode;
-  UINT32 dmi_id; 
-
-  if (param_buf == NULL) { // Assume creation of Dom 0 control
-    dmi_type = VTPM_TYPE_NON_MIGRATABLE;
-    dmi_id = VTPM_CTL_DM;
-  } else if (buffer_len(param_buf) != sizeof(BYTE) * 3  + sizeof(UINT32)) {
-    vtpmloginfo(VTPM_LOG_VTPM, "New DMI command wrong length: %d.\n", buffer_len(param_buf));
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  } else {
-    vtpm_globals->connected_dmis++; // Put this here so we don't count Dom0
-    BSG_UnpackList( param_buf->bytes, 4,
-		    BSG_TYPE_BYTE, &dmi_type,
-		    BSG_TYPE_BYTE, &startup_mode,
-		    BSG_TYPE_BYTE, &vm_type,
-		    BSG_TYPE_UINT32,  &dmi_id);
-  }
-
-  if ((dmi_type != VTPM_TYPE_NON_MIGRATABLE) && (dmi_type != VTPM_TYPE_MIGRATABLE)) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Creation of VTPM with illegal type.\n");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  new_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
-  if (new_dmi == NULL) { 
-    vtpmloginfo(VTPM_LOG_VTPM, "Creating new DMI instance %d attached.\n", dmi_id );
-    // Brand New DMI. Initialize the persistent pieces
-    TPMTRYRETURN(init_dmi(dmi_id, dmi_type, &new_dmi) );  
-  } else 
-    vtpmloginfo(VTPM_LOG_VTPM, "Re-attaching DMI instance %d.\n", dmi_id);
-
-  if (new_dmi->connected) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Attempt to re-attach, currently attached instance %d. Ignoring\n", dmi_id);
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-  
-  if (new_dmi->dmi_type == VTPM_TYPE_MIGRATED) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Attempt to re-attach previously migrated instance %d without recovering first. Ignoring\n", dmi_id);
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  // Initialize the Non-persistent pieces
-  TPMTRYRETURN( TCS_OpenContext(&new_dmi->TCSContext) );
-  
-  new_dmi->connected = TRUE;  
-
-  // Design specific new DMI code. 
-  // Includes: create IPCs, Measuring DMI, and maybe launching DMI
-  TPMTRYRETURN(VTPM_New_DMI_Extra(new_dmi, vm_type, startup_mode) );
-  goto egress;
-  
- abort_egress:
-  vtpmlogerror(VTPM_LOG_VTPM, "Failed to create DMI id=%d due to status=%s. Cleaning.\n", dmi_id, tpm_get_error_name(status));
-  close_dmi(new_dmi );
-	
- egress:
-  return status;
-}
-
-TPM_RESULT VTPM_Handle_Close_DMI( const buffer_t *param_buf) {
-  
-  TPM_RESULT status=TPM_FAIL;
-  VTPM_DMI_RESOURCE *dmi_res=NULL;
-  UINT32 dmi_id;
-  
-  if ((param_buf == NULL) || (buffer_len(param_buf) != sizeof(UINT32)) ) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Closing DMI has bad size.");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-  
-  BSG_UnpackList( param_buf->bytes, 1,
-		  BSG_TYPE_UINT32, &dmi_id);
-  
-  vtpmloginfo(VTPM_LOG_VTPM, "Closing DMI %d.\n", dmi_id);
-  
-  dmi_res = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
-  if (dmi_res == NULL ) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Trying to close nonexistent DMI.\n");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-	
-  if (!dmi_res->connected) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Closing non-connected DMI.\n");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-  
-  // Close Dmi
-	TPMTRYRETURN(close_dmi( dmi_res ));
-  
-  status=TPM_SUCCESS;    
-  goto egress;
-  
- abort_egress:
- egress:
-  
-  return status;
-}
-
-TPM_RESULT VTPM_Handle_Delete_DMI( const buffer_t *param_buf) {
-  
-  TPM_RESULT status=TPM_FAIL;
-  VTPM_DMI_RESOURCE *dmi_res=NULL;
-  UINT32 dmi_id;
-    
-  if ((param_buf == NULL) || (buffer_len(param_buf) != sizeof(UINT32)) ) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Closing DMI has bad size.\n");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-  
-  BSG_UnpackList( param_buf->bytes, 1,
-		  BSG_TYPE_UINT32, &dmi_id);
-  
-  vtpmloginfo(VTPM_LOG_VTPM, "Deleting DMI %d.\n", dmi_id);    
-  
-  dmi_res = (VTPM_DMI_RESOURCE *) hashtable_remove(vtpm_globals->dmi_map, &dmi_id);
-  if (dmi_res == NULL) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Closing non-existent DMI.\n");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-  
-  //vtpm scripts delete file dmi_res->NVMLocation for us
-  
-  // Close DMI first
-  TPMTRYRETURN(close_dmi( dmi_res ));
-  free ( dmi_res );
-	
-  status=TPM_SUCCESS;    
-  goto egress;
-  
- abort_egress:
- egress:
-  
-  return status;
-}
diff --git a/tools/vtpm_manager/manager/migration.c b/tools/vtpm_manager/manager/migration.c
deleted file mode 100644
index 54da708..0000000
--- a/tools/vtpm_manager/manager/migration.c
+++ /dev/null
@@ -1,307 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-//   dmictl.c
-// 
-//     Functions for creating and destroying DMIs
-//
-// ==================================================================
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-
-#include "vtpmpriv.h"
-#include "bsg.h"
-#include "buffer.h"
-#include "log.h"
-#include "hashtable.h"
-
-TPM_RESULT VTPM_Handle_Migrate_In( const buffer_t *param_buf,
-                                   buffer_t *result_buf) {
-
-  TPM_RESULT status=TPM_FAIL;
-  VTPM_DMI_RESOURCE *mig_dmi=NULL;
-  UINT32 dmi_id;
-  buffer_t dmi_state_abuf = NULL_BUF, enc_dmi_abuf = NULL_BUF, clear_dmi_blob = NULL_BUF;
-
-  if (param_buf == NULL) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Migration Out Failed due to bad parameter.\n");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  struct pack_buf_t enc_dmi_state_pack;
-
-  BSG_UnpackList(param_buf->bytes, 2, 
-                 BSG_TYPE_UINT32, &dmi_id,
-                 BSG_TPM_SIZE32_DATA, &enc_dmi_state_pack) ;
-
-  vtpmloginfo(VTPM_LOG_VTPM, "Migrating VTPM in dmi %d.\n", dmi_id);
-
-  mig_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
-  if (mig_dmi) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Incoming VTPM claims unavailable id: %d.\n", dmi_id);
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }    
-
-  /** UnBind Blob **/
-  TPMTRYRETURN( buffer_init_alias_convert( &enc_dmi_abuf, 
-                                           enc_dmi_state_pack.size, 
-                                           enc_dmi_state_pack.data) );
-
-  TPMTRYRETURN( envelope_decrypt( &enc_dmi_abuf,
-                                   vtpm_globals->manager_tcs_handle,
-                                   vtpm_globals->storageKeyHandle,
-                                   (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
-                                   &clear_dmi_blob) );
-
-  // Create new dmi
-  TPMTRYRETURN( init_dmi(dmi_id, VTPM_TYPE_MIGRATABLE, &mig_dmi ) ); 
-
-  /** Open Blob **/
-  struct pack_buf_t dmi_state_pack;
-
-  BSG_UnpackList(clear_dmi_blob.bytes, 2, 
-                 BSG_TPM_DIGEST, &mig_dmi->DMI_measurement,
-                 BSG_TPM_SIZE32_DATA, &dmi_state_pack);
-
-  TPMTRYRETURN( buffer_init_alias_convert(&dmi_state_abuf, 
-                                          dmi_state_pack.size, 
-                                          dmi_state_pack.data) ); 
-
-  TPMTRYRETURN( VTPM_Handle_Save_NVM(mig_dmi, &dmi_state_abuf, NULL ) );
-
-  status=TPM_SUCCESS;
-  goto egress;
-
- abort_egress:
-    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Migration IN of instance %d failed because of %s.\n", dmi_id, tpm_get_error_name(status) );
-
- egress:
-  buffer_free(&clear_dmi_blob);
-  buffer_free(&dmi_state_abuf);
- 
-  return status;
-}
-
-TPM_RESULT VTPM_Handle_Migrate_Out( const buffer_t *param_buf,
-                                    buffer_t *result_buf) {
-
-  TPM_RESULT status=TPM_FAIL;
-  VTPM_DMI_RESOURCE *mig_dmi;
-  UINT32 dmi_id;
-  VTPM_MIGKEY_LIST *last_mig, *mig_key;
-  buffer_t dmi_state=NULL_BUF, clear_dmi_blob=NULL_BUF;
-
-  if (param_buf == NULL) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Migration Out Failed due to bad parameter.\n");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  struct pack_buf_t name_pack;
-
-  BSG_UnpackList( param_buf->bytes, 2,
-                  BSG_TYPE_UINT32, &dmi_id,
-                  BSG_TPM_SIZE32_DATA, &name_pack);
-
-  vtpmloginfo(VTPM_LOG_VTPM, "Migrating out dmi %d.\n", dmi_id);
-
-  mig_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
-  if (mig_dmi == NULL) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Non-existent VTPM instance (%d) in migration.\n", dmi_id );
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  if (mig_dmi->dmi_type != VTPM_TYPE_MIGRATABLE) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Bad VTPM type (%d) in migration of instance (%d).\n", mig_dmi->dmi_type, dmi_id );
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  /** Find migration key for dest **/
-  last_mig = NULL;
-  mig_key = vtpm_globals->mig_keys;
-  while (mig_key != NULL) {
-    if (mig_key->name_size == name_pack.size)
-      if (memcmp(mig_key->name, name_pack.data, name_pack.size) == 0) {
-        break;
-      }
-    
-    last_mig = mig_key;
-    mig_key = mig_key->next;
-  }
-     
-  if (!mig_key) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Unknown Migration target host.\n");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  /** Mark vtpm as migrated **/
-  mig_dmi->dmi_type = VTPM_TYPE_MIGRATED;
-
-  /** Build Blob **/
-  TPMTRYRETURN( VTPM_Handle_Load_NVM(mig_dmi, NULL, &dmi_state) );
-
-  TPMTRYRETURN( buffer_init(&clear_dmi_blob, sizeof(TPM_DIGEST) + sizeof(UINT32) + buffer_len(&dmi_state), NULL ) ); 
-
-  struct pack_constbuf_t dmi_state_pack;
-
-  dmi_state_pack.size = buffer_len(&dmi_state);
-  dmi_state_pack.data = dmi_state.bytes;
-
-  BSG_PackList(clear_dmi_blob.bytes, 2, 
-               BSG_TPM_DIGEST, &mig_dmi->DMI_measurement,
-               BSG_TPM_SIZE32_DATA, &dmi_state_pack);
-
-  /** Bind Blob **/
-  TPMTRYRETURN( envelope_encrypt( &clear_dmi_blob,
-                                  &mig_key->key,
-                                  result_buf) );
-
-  if (last_mig)
-    last_mig->next = mig_key->next;
-  else 
-    vtpm_globals->mig_keys = mig_key->next;
-  
-  free(mig_key->name);
-  free(mig_key);
-
-  status=TPM_SUCCESS;
-  goto egress;
-
- abort_egress:
-    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Migration OUT of instance %d failed because of %s. Migratoin recovery may be needed.\n", dmi_id, tpm_get_error_name(status) );
-
-    //TODO: Create and implement a policy for what happens to mig_key on failed migrations.
-
- egress:
-
-  buffer_free(&clear_dmi_blob);
-  buffer_free(&dmi_state);
-
-  return status;
-}
-
-
-TPM_RESULT VTPM_Handle_Get_Migration_key( const buffer_t *param_buf,
-                                          buffer_t *result_buf) {
-
-  TPM_RESULT status=TPM_FAIL;
-
-  vtpmloginfo(VTPM_LOG_VTPM, "Getting Migration Public Key.\n");
-
-  struct pack_buf_t pubkey_exp_pack, pubkey_mod_pack;
-  TPM_KEY mig_key;
-
-  // Unpack/return key structure
-  BSG_Unpack(BSG_TPM_KEY, vtpm_globals->storageKeyWrap.bytes , &mig_key);
-  TPM_RSA_KEY_PARMS rsaKeyParms;
-
-  BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
-               mig_key.algorithmParms.parms,
-               &rsaKeyParms);
-
-  pubkey_exp_pack.size = rsaKeyParms.exponentSize;
-  pubkey_exp_pack.data = rsaKeyParms.exponent;
-  pubkey_mod_pack.size = mig_key.pubKey.keyLength;
-  pubkey_mod_pack.data = mig_key.pubKey.key;
-
-  TPMTRYRETURN( buffer_init( result_buf, 2*sizeof(UINT32) + 
-                                         pubkey_exp_pack.size + 
-                                         pubkey_mod_pack.size, NULL ) );
-
-  BSG_PackList( result_buf->bytes, 2,
-                  BSG_TPM_SIZE32_DATA, &pubkey_exp_pack,
-                  BSG_TPM_SIZE32_DATA, &pubkey_mod_pack);
-
-
-  status=TPM_SUCCESS;
-  goto egress;
-
- abort_egress:
-    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Get Migration Key failed because of %s.\n", tpm_get_error_name(status) );
- egress:
-
-  return status;
-}
-
-TPM_RESULT VTPM_Handle_Load_Migration_key( const buffer_t *param_buf,
-                                           buffer_t *result_buf) {
-
-  TPM_RESULT status=TPM_FAIL;
-  VTPM_MIGKEY_LIST *mig_key;
-
-  vtpmloginfo(VTPM_LOG_VTPM, "Loading Migration Public Key.\n");
-
-  //FIXME: Review all uses of unpacking pack_buf_t and ensure free.
-  //FIXME: Review all declarations/initializations of buffer_t that could have a goto that skips them and then tries to free them
-
-  struct pack_buf_t name_pack, pubkey_exp_pack, pubkey_mod_pack;
-
-  //FIXME: scan list and verify name is not already in the list
-
-  BSG_UnpackList( param_buf->bytes, 3,
-                  BSG_TPM_SIZE32_DATA, &name_pack,
-                  BSG_TPM_SIZE32_DATA, &pubkey_exp_pack,
-                  BSG_TPM_SIZE32_DATA, &pubkey_mod_pack);
-
-  //TODO: Maintain a persistent list for pub_keys.
-  //TODO: Verify pub_key is trusted
-
-  mig_key = (VTPM_MIGKEY_LIST *) malloc(sizeof(VTPM_MIGKEY_LIST));
-  memset(mig_key, 0, sizeof(VTPM_MIGKEY_LIST) );
-  mig_key->name_size = name_pack.size;
-  mig_key->name = name_pack.data;
-
-  mig_key->key.encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
-  Crypto_RSABuildCryptoInfoPublic( pubkey_exp_pack.size,
-                                   pubkey_exp_pack.data,
-                                   pubkey_mod_pack.size,
-                                   pubkey_mod_pack.data,
-                                   &mig_key->key);
-
-
-  mig_key->next = vtpm_globals->mig_keys;
-  vtpm_globals->mig_keys = mig_key;
-
-  // free(name_pack.data); Do not free. data is now part of mig_key.
-  free(pubkey_exp_pack.data);
-  free(pubkey_mod_pack.data);
-
-  return TPM_SUCCESS;
-}
diff --git a/tools/vtpm_manager/manager/securestorage.c b/tools/vtpm_manager/manager/securestorage.c
deleted file mode 100644
index d5e6ffd..0000000
--- a/tools/vtpm_manager/manager/securestorage.c
+++ /dev/null
@@ -1,512 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// securestorage.c
-// 
-//  Functions regarding securely storing DMI secrets.
-//
-// ==================================================================
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-
-#include "tcg.h"
-#include "vtpm_manager.h"
-#include "vtpmpriv.h"
-#include "vtsp.h"
-#include "bsg.h"
-#include "crypto.h"
-#include "hashtable.h"
-#include "hashtable_itr.h"
-#include "buffer.h"
-#include "log.h"
-
-TPM_RESULT envelope_encrypt(const buffer_t     *inbuf,
-                            CRYPTO_INFO        *asymkey,
-                            buffer_t           *sealed_data) {
-  TPM_RESULT status = TPM_SUCCESS;
-  symkey_t    symkey;
-  buffer_t    data_cipher = NULL_BUF,
-              symkey_cipher = NULL_BUF;
-  
-  UINT32 i;
-  struct pack_constbuf_t symkey_cipher32, data_cipher32;
-  
-  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Enveloping Input[%d]: 0x", buffer_len(inbuf));
-  for (i=0; i< buffer_len(inbuf); i++)
-    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", inbuf->bytes[i]);
-  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-  
-  // Generate a sym key and encrypt state with it
-  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_symcrypto_genkey (&symkey) );
-  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_symcrypto_encrypt (&symkey, inbuf, &data_cipher) );
-  
-  // Encrypt symmetric key
-  TPMTRYRETURN( VTSP_Bind(    asymkey, 
-			      &symkey.key, 
-			      &symkey_cipher) );
-  
-  // Create output blob: symkey_size + symkey_cipher + state_cipher_size + state_cipher
-  
-  symkey_cipher32.size = buffer_len(&symkey_cipher);
-  symkey_cipher32.data = symkey_cipher.bytes;
-  
-  data_cipher32.size = buffer_len(&data_cipher);
-  data_cipher32.data = data_cipher.bytes;
-  
-  TPMTRYRETURN( buffer_init(sealed_data, 2 * sizeof(UINT32) + symkey_cipher32.size + data_cipher32.size, NULL));
-  
-  BSG_PackList(sealed_data->bytes, 2,
-	       BSG_TPM_SIZE32_DATA, &symkey_cipher32,
-	       BSG_TPM_SIZE32_DATA, &data_cipher32);
-
-  vtpmloginfo(VTPM_LOG_VTPM, "Saved %d bytes of E(symkey) + %d bytes of E(data)\n", buffer_len(&symkey_cipher), buffer_len(&data_cipher));
-
-  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Enveloping Output[%d]: 0x", buffer_len(sealed_data));
-  for (i=0; i< buffer_len(sealed_data); i++)
-    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", sealed_data->bytes[i]);
-  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-
-  goto egress;
-
- abort_egress:
-  vtpmlogerror(VTPM_LOG_VTPM, "Failed to envelope encrypt\n.");
-  
- egress:
-  
-  buffer_free ( &data_cipher);
-  buffer_free ( &symkey_cipher);
-  Crypto_symcrypto_freekey (&symkey);
-  
-  return status;
-}
-
-TPM_RESULT envelope_decrypt(const buffer_t     *cipher,
-                            TCS_CONTEXT_HANDLE TCSContext,
-			    TPM_HANDLE         keyHandle,
-			    const TPM_AUTHDATA *key_usage_auth,
-                            buffer_t           *unsealed_data) {
-
-  TPM_RESULT status = TPM_SUCCESS;
-  symkey_t    symkey;
-  buffer_t    data_cipher = NULL_BUF, 
-              symkey_clear = NULL_BUF, 
-              symkey_cipher = NULL_BUF;
-  struct pack_buf_t symkey_cipher32, data_cipher32;
-  int i;
-
-  memset(&symkey, 0, sizeof(symkey_t));
-
-  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Envelope Decrypt Input[%d]: 0x", buffer_len(cipher) );
-  for (i=0; i< buffer_len(cipher); i++)
-    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cipher->bytes[i]);
-  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-  
-  BSG_UnpackList(cipher->bytes, 2,
-		 BSG_TPM_SIZE32_DATA, &symkey_cipher32,
-		 BSG_TPM_SIZE32_DATA, &data_cipher32);
-  
-  TPMTRYRETURN( buffer_init_alias_convert (&symkey_cipher, 
-				           symkey_cipher32.size, 
-				           symkey_cipher32.data) );
-  
-  TPMTRYRETURN( buffer_init_alias_convert (&data_cipher, 
-				           data_cipher32.size, 
-				           data_cipher32.data) );
-
-  // Decrypt Symmetric Key
-  TPMTRYRETURN( VTSP_Unbind(  TCSContext,
-			      keyHandle,
-			      &symkey_cipher,
-			      key_usage_auth,
-			      &symkey_clear,
-			      &(vtpm_globals->keyAuth) ) );
-  
-  // create symmetric key using saved bits
-  Crypto_symcrypto_initkey (&symkey, &symkey_clear);
-  
-  // Decrypt State
-  TPMTRY(TPM_DECRYPT_ERROR, Crypto_symcrypto_decrypt (&symkey, &data_cipher, unsealed_data) );
-
-  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Envelope Decrypte Output[%d]: 0x", buffer_len(unsealed_data));
-  for (i=0; i< buffer_len(unsealed_data); i++)
-    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", unsealed_data->bytes[i]);
-  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-  
-  goto egress;
-  
- abort_egress:
-  vtpmlogerror(VTPM_LOG_VTPM, "Failed to envelope decrypt data\n.");
-  
- egress:
-  buffer_free ( &data_cipher);
-  buffer_free ( &symkey_clear);
-  buffer_free ( &symkey_cipher);
-  Crypto_symcrypto_freekey (&symkey);
-  
-  return status;
-}
-
-TPM_RESULT VTPM_Handle_Save_NVM(VTPM_DMI_RESOURCE *myDMI, 
-				const buffer_t *inbuf, 
-				buffer_t *outbuf) {
-  
-  TPM_RESULT status = TPM_SUCCESS;
-  int fh;
-  long bytes_written;
-  buffer_t sealed_NVM = NULL_BUF;
-  
-  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Saving %d bytes of NVM.\n", buffer_len(inbuf));
-
-  TPMTRYRETURN( envelope_encrypt(inbuf,
-                                 &vtpm_globals->storageKey,
-                                 &sealed_NVM) );
-				  
-  // Write sealed blob off disk from NVMLocation
-  // TODO: How to properly return from these. Do we care if we return failure
-  //       after writing the file? We can't get the old one back.
-  // TODO: Backup old file and try and recover that way.
-  fh = open(myDMI->NVMLocation, O_WRONLY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
-  if ( (bytes_written = write(fh, sealed_NVM.bytes, buffer_len(&sealed_NVM) ) != (long) buffer_len(&sealed_NVM))) {
-    vtpmlogerror(VTPM_LOG_VTPM, "We just overwrote a DMI_NVM and failed to finish. %ld/%ld bytes.\n", bytes_written, (long)buffer_len(&sealed_NVM));
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-  close(fh);
-  
-  Crypto_SHA1Full (sealed_NVM.bytes, buffer_len(&sealed_NVM), (BYTE *) &myDMI->NVM_measurement);   
-  
-  goto egress;
-  
- abort_egress:
-  vtpmlogerror(VTPM_LOG_VTPM, "Failed to save NVM\n.");
-  
- egress:
-  buffer_free(&sealed_NVM);
-  return status;
-}
-
-
-/* Expected Params: inbuf = null, outbuf = sealed blob size, sealed blob.*/
-TPM_RESULT VTPM_Handle_Load_NVM(VTPM_DMI_RESOURCE *myDMI, 
-				const buffer_t    *inbuf, 
-				buffer_t          *outbuf) {
-  
-  TPM_RESULT status = TPM_SUCCESS;
-
-  buffer_t sealed_NVM = NULL_BUF;
-  long fh_size;
-  int fh, stat_ret, i;
-  struct stat file_stat;
-  TPM_DIGEST sealedNVMHash;
-   
-  if (myDMI->NVMLocation == NULL) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Unable to load NVM because the file name NULL.\n");
-    status = TPM_AUTHFAIL;
-    goto abort_egress;
-  }
-  
-  //Read sealed blob off disk from NVMLocation
-  fh = open(myDMI->NVMLocation, O_RDONLY);
-  stat_ret = fstat(fh, &file_stat);
-  if (stat_ret == 0) 
-    fh_size = file_stat.st_size;
-  else {
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-  
-  TPMTRYRETURN( buffer_init( &sealed_NVM, fh_size, NULL) );
-  if (read(fh, sealed_NVM.bytes, buffer_len(&sealed_NVM)) != fh_size) {
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-  close(fh);
-  
-  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Load_NVMing[%d],\n", buffer_len(&sealed_NVM));
-  
-  Crypto_SHA1Full(sealed_NVM.bytes, buffer_len(&sealed_NVM), (BYTE *) &sealedNVMHash);    
-  
-  // Verify measurement of sealed blob.
-  if (memcmp(&sealedNVMHash, &myDMI->NVM_measurement, sizeof(TPM_DIGEST)) ) {
-    vtpmlogerror(VTPM_LOG_VTPM, "VTPM LoadNVM NVM measurement check failed.\n");
-    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Correct hash: ");
-    for (i=0; i< sizeof(TPM_DIGEST); i++)
-      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", ((BYTE*)&myDMI->NVM_measurement)[i]);
-    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-
-    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Measured hash: ");
-    for (i=0; i< sizeof(TPM_DIGEST); i++)
-      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", ((BYTE*)&sealedNVMHash)[i]);
-    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-    
-    status = TPM_AUTHFAIL;
-    goto abort_egress;
-  }
-  
-  TPMTRYRETURN( envelope_decrypt(&sealed_NVM,
-                                 myDMI->TCSContext,
-		        	 vtpm_globals->storageKeyHandle,
-			         (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
-                                 outbuf) );  
-  goto egress;
-  
- abort_egress:
-  vtpmlogerror(VTPM_LOG_VTPM, "Failed to load NVM\n.");
-  
- egress:
-  buffer_free( &sealed_NVM );
-  
-  return status;
-}
-
-
-TPM_RESULT VTPM_SaveManagerData(void) {
-  TPM_RESULT status=TPM_SUCCESS;
-  int fh, dmis=-1;
-
-  BYTE *flat_boot_key=NULL, *flat_dmis=NULL, *flat_enc=NULL;
-  buffer_t clear_flat_global=NULL_BUF, enc_flat_global=NULL_BUF;
-  UINT32 storageKeySize = buffer_len(&vtpm_globals->storageKeyWrap);
-  UINT32 bootKeySize = buffer_len(&vtpm_globals->bootKeyWrap);
-  struct pack_buf_t storage_key_pack = {storageKeySize, vtpm_globals->storageKeyWrap.bytes};
-  struct pack_buf_t boot_key_pack = {bootKeySize, vtpm_globals->bootKeyWrap.bytes};
-  BYTE vtpm_manager_gen = VTPM_MANAGER_GEN;
-
-  struct hashtable_itr *dmi_itr;
-  VTPM_DMI_RESOURCE *dmi_res;
-
-  UINT32 boot_key_size = 0, flat_dmis_size = 0;
-
-  // Initially fill these with buffer sizes for each data type. Later fill
-  // in actual size, once flattened.
-  boot_key_size =  sizeof(UINT32) +       // bootkeysize
-                   bootKeySize;           // boot key
-
-  TPMTRYRETURN(buffer_init(&clear_flat_global,sizeof(BYTE) + // manager version
-                                              3*sizeof(TPM_DIGEST) + // Auths
-                                              sizeof(UINT32) +// storagekeysize
-                                              storageKeySize, NULL) ); // storage key
-
-
-  flat_boot_key = (BYTE *) malloc( boot_key_size );
-  flat_enc = (BYTE *) malloc( sizeof(UINT32) );
-
-  boot_key_size = BSG_PackList(flat_boot_key, 1,
-                               BSG_TPM_SIZE32_DATA, &boot_key_pack);
-
-  BSG_PackList(clear_flat_global.bytes, 4,
-                BSG_TYPE_BYTE,    &vtpm_manager_gen,
-                BSG_TPM_AUTHDATA, &vtpm_globals->owner_usage_auth,
-                BSG_TPM_SECRET,   &vtpm_globals->storage_key_usage_auth,
-                BSG_TPM_SIZE32_DATA, &storage_key_pack);
-
-  TPMTRYRETURN(envelope_encrypt(&clear_flat_global,
-                                &vtpm_globals->bootKey,
-                                &enc_flat_global) );
-
-  BSG_PackConst(buffer_len(&enc_flat_global), 4, flat_enc);
-
-  // Per DMI values to be saved (if any exit)
-  if (hashtable_count(vtpm_globals->dmi_map) > 1) {
-
-    flat_dmis = (BYTE *) malloc( 
-                     (hashtable_count(vtpm_globals->dmi_map) - 1) * // num DMIS (-1 for Dom0)
-                     (sizeof(UINT32) +sizeof(BYTE) + 2*sizeof(TPM_DIGEST)) ); // Per DMI info
-
-    dmi_itr = hashtable_iterator(vtpm_globals->dmi_map);
-    do {
-      dmi_res = (VTPM_DMI_RESOURCE *) hashtable_iterator_value(dmi_itr);
-      dmis++;
-
-      // No need to save dmi0.
-      if (dmi_res->dmi_id == 0)
-        continue;
-
-
-      flat_dmis_size += BSG_PackList( flat_dmis + flat_dmis_size, 4,
-                                        BSG_TYPE_UINT32, &dmi_res->dmi_id,
-                                        BSG_TYPE_BYTE, &dmi_res->dmi_type,
-                                        BSG_TPM_DIGEST, &dmi_res->NVM_measurement,
-                                        BSG_TPM_DIGEST, &dmi_res->DMI_measurement);
-
-    } while (hashtable_iterator_advance(dmi_itr));
-  }
-
-  fh = open(STATE_FILE, O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
-  if (fh == -1) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Unable to open %s file for write.\n", STATE_FILE);
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  if ( ( write(fh, flat_boot_key, boot_key_size) != boot_key_size ) ||
-       ( write(fh, flat_enc, sizeof(UINT32)) != sizeof(UINT32) ) ||
-       ( write(fh, enc_flat_global.bytes, buffer_len(&enc_flat_global)) != buffer_len(&enc_flat_global) ) ||
-       ( write(fh, flat_dmis, flat_dmis_size) != flat_dmis_size ) ) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Failed to completely write service data.\n");
-    status = TPM_IOERROR;
-    goto abort_egress;
- }
-
-  goto egress;
-
- abort_egress:
- egress:
-
-  free(flat_boot_key);
-  free(flat_enc);
-  buffer_free(&enc_flat_global);
-  free(flat_dmis);
-  close(fh);
-
-  vtpmloginfo(VTPM_LOG_VTPM, "Saved VTPM Manager state (status = %d, dmis = %d)\n", (int) status, dmis);
-  return status;
-}
-
-TPM_RESULT VTPM_LoadManagerData(void) {
-
-  TPM_RESULT status=TPM_SUCCESS;
-  int fh, stat_ret, dmis=0;
-  long fh_size = 0, step_size;
-  BYTE *flat_table=NULL;
-  buffer_t  unsealed_data, enc_table_abuf;
-  struct pack_buf_t storage_key_pack, boot_key_pack;
-  UINT32 *dmi_id_key, enc_size;
-  BYTE vtpm_manager_gen;
-
-  VTPM_DMI_RESOURCE *dmi_res;
-  UINT32 dmi_id;
-  BYTE dmi_type;
-  struct stat file_stat;
-
-  TPM_HANDLE boot_key_handle;
-  TPM_AUTHDATA boot_usage_auth;
-  memset(&boot_usage_auth, 0, sizeof(TPM_AUTHDATA));
-
-  fh = open(STATE_FILE, O_RDONLY );
-  stat_ret = fstat(fh, &file_stat);
-  if (stat_ret == 0)
-    fh_size = file_stat.st_size;
-  else {
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  flat_table = (BYTE *) malloc(fh_size);
-
-  if ((long) read(fh, flat_table, fh_size) != fh_size ) {
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  // Read Boot Key
-  step_size = BSG_UnpackList( flat_table, 2,
-                              BSG_TPM_SIZE32_DATA, &boot_key_pack,
-                              BSG_TYPE_UINT32, &enc_size);
-
-  TPMTRYRETURN(buffer_init(&vtpm_globals->bootKeyWrap, 0, 0) );
-  TPMTRYRETURN(buffer_init_alias_convert(&enc_table_abuf, enc_size, flat_table + step_size) );
-  TPMTRYRETURN(buffer_append_raw(&vtpm_globals->bootKeyWrap, boot_key_pack.size, boot_key_pack.data) );
-
-  //Load Boot Key
-  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
-                              TPM_SRK_KEYHANDLE,
-                              &vtpm_globals->bootKeyWrap,
-                              &SRK_AUTH,
-                              &boot_key_handle,
-                              &vtpm_globals->keyAuth,
-                              &vtpm_globals->bootKey,
-                              FALSE) );
-
-  TPMTRYRETURN( envelope_decrypt(&enc_table_abuf,
-                                 vtpm_globals->manager_tcs_handle,
-                                 boot_key_handle,
-                                 (const TPM_AUTHDATA*) &boot_usage_auth,
-                                 &unsealed_data) );
-  step_size += enc_size;
-
-  if (*unsealed_data.bytes != VTPM_MANAGER_GEN) {
-      // Once there is more than one gen, this will include some compatability stuff
-      vtpmlogerror(VTPM_LOG_VTPM, "Warning: Manager Data file is gen %d, which this manager is gen %d.\n", vtpm_manager_gen, VTPM_MANAGER_GEN);
-  }
-
-  // Global Values needing to be saved
-  BSG_UnpackList( unsealed_data.bytes, 4,
-                  BSG_TYPE_BYTE,    &vtpm_manager_gen, 
-                  BSG_TPM_AUTHDATA, &vtpm_globals->owner_usage_auth,
-                  BSG_TPM_SECRET,   &vtpm_globals->storage_key_usage_auth,
-                  BSG_TPM_SIZE32_DATA, &storage_key_pack);
-
-  TPMTRYRETURN(buffer_init(&vtpm_globals->storageKeyWrap, 0, 0) );
-  TPMTRYRETURN(buffer_append_raw(&vtpm_globals->storageKeyWrap, storage_key_pack.size, storage_key_pack.data) );
-
-  // Per DMI values to be saved
-  while ( step_size < fh_size ){
-    if (fh_size - step_size < (long) (sizeof(UINT32) + sizeof(BYTE) + 2*sizeof(TPM_DIGEST))) {
-      vtpmlogerror(VTPM_LOG_VTPM, "Encountered %ld extra bytes at end of manager state.\n", fh_size-step_size);
-      step_size = fh_size;
-    } else {
-      step_size += BSG_UnpackList(flat_table + step_size, 2,
-                                 BSG_TYPE_UINT32, &dmi_id,
-                                 BSG_TYPE_BYTE, &dmi_type);
-
-      //TODO: Try and gracefully recover from problems.
-      TPMTRYRETURN(init_dmi(dmi_id, dmi_type, &dmi_res) );
-      dmis++;
-
-      step_size += BSG_UnpackList(flat_table + step_size, 2,
-                                 BSG_TPM_DIGEST, &dmi_res->NVM_measurement,
-                                 BSG_TPM_DIGEST, &dmi_res->DMI_measurement);
-    }
-
-  }
-
-  vtpmloginfo(VTPM_LOG_VTPM, "Loaded saved state (dmis = %d).\n", dmis);
-  goto egress;
-
- abort_egress:
-  vtpmlogerror(VTPM_LOG_VTPM, "Failed to load service data with error = %s\n", tpm_get_error_name(status));
- egress:
-
-  free(flat_table);
-  close(fh);
-
-  // TODO: Could be nice and evict BootKey. (Need to add EvictKey to VTSP.
-
-  return status;
-}
-
diff --git a/tools/vtpm_manager/manager/tpmpassthrough.c b/tools/vtpm_manager/manager/tpmpassthrough.c
deleted file mode 100644
index 9b1e5f8..0000000
--- a/tools/vtpm_manager/manager/tpmpassthrough.c
+++ /dev/null
@@ -1,110 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// tpmpassthrough.c
-// 
-//  Functions regarding passing DMI requests to HWTPM
-//
-// ==================================================================
-
-#include "tcg.h"
-#include "vtpm_manager.h"
-#include "vtpmpriv.h"
-#include "vtsp.h"
-#include "log.h"
-
-TPM_RESULT VTPM_Handle_TPM_Command( VTPM_DMI_RESOURCE *dmi,
-				    buffer_t *inbuf,  
-				    buffer_t *outbuf) {
-  
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_COMMAND_CODE *ord;               
-  
-  ord = (TPM_COMMAND_CODE *) (inbuf->bytes + sizeof(TPM_TAG) + sizeof(UINT32));
-  
-  switch (*ord) {
-    
-    // Forbidden for DMI use
-  case TPM_ORD_TakeOwnership:
-  case TPM_ORD_ChangeAuthOwner:
-  case TPM_ORD_DirWriteAuth:
-  case TPM_ORD_DirRead:
-  case TPM_ORD_AuthorizeMigrationKey:
-  case TPM_ORD_CreateMaintenanceArchive:
-  case TPM_ORD_LoadMaintenanceArchive:
-  case TPM_ORD_KillMaintenanceFeature:
-  case TPM_ORD_LoadManuMaintPub:
-  case TPM_ORD_ReadManuMaintPub:
-  case TPM_ORD_SelfTestFull:
-  case TPM_ORD_SelfTestStartup:
-  case TPM_ORD_CertifySelfTest:
-  case TPM_ORD_ContinueSelfTest:
-  case TPM_ORD_GetTestResult:
-  case TPM_ORD_Reset:
-  case TPM_ORD_OwnerClear:
-  case TPM_ORD_DisableOwnerClear:
-  case TPM_ORD_ForceClear:
-  case TPM_ORD_DisableForceClear:
-  case TPM_ORD_GetCapabilityOwner:
-  case TPM_ORD_OwnerSetDisable:
-  case TPM_ORD_PhysicalEnable:
-  case TPM_ORD_PhysicalDisable:
-  case TPM_ORD_SetOwnerInstall:
-  case TPM_ORD_PhysicalSetDeactivated:
-  case TPM_ORD_SetTempDeactivated:
-  case TPM_ORD_CreateEndorsementKeyPair:
-  case TPM_ORD_GetAuditEvent:
-  case TPM_ORD_GetAuditEventSigned:
-  case TPM_ORD_GetOrdinalAuditStatus:
-  case TPM_ORD_SetOrdinalAuditStatus:
-  case TPM_ORD_SetRedirection:
-  case TPM_ORD_FieldUpgrade:
-  case TSC_ORD_PhysicalPresence:
-    status = TPM_DISABLED_CMD;
-    goto abort_egress;
-    break;
-    
-  } // End ORD Switch
-  
-  // Call TCS with command
-  
-  TPMTRY(TPM_IOERROR, VTSP_RawTransmit( dmi->TCSContext,inbuf, outbuf) );
-  
-  goto egress;
-  
- abort_egress:
-  vtpmloginfo(VTPM_LOG_VTPM, "TPM Command Failed in tpmpassthrough.\n");
- egress:
-  
-  return status;
-}
diff --git a/tools/vtpm_manager/manager/vtpm_ipc.c b/tools/vtpm_manager/manager/vtpm_ipc.c
deleted file mode 100644
index 319dc83..0000000
--- a/tools/vtpm_manager/manager/vtpm_ipc.c
+++ /dev/null
@@ -1,141 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-//
-// vtpm_ipc.c Implements ipc routines using file io. This file can
-// be replaced with other ipc types.
-//
-// ===================================================================
-
-#include <sys/stat.h>
-#include "vtpm_ipc.h"
-#include "vtpmpriv.h"
-#include "log.h"
-
-int vtpm_ipc_init(vtpm_ipc_handle_t *ipc_h, char* name, int flags, BOOL create) {
-  ipc_h->name = name;
-  ipc_h->flags = flags;
-  ipc_h->fh = VTPM_IPC_CLOSED;
-
-  if (create)
-    return(vtpm_ipc_create(ipc_h));
-  else
-    return 0;
-}
-
-// Create the file that needs opening. Used only for FIFOs
-// FYI: This may cause problems in other file IO schemes. We'll see.
-int vtpm_ipc_create(vtpm_ipc_handle_t *ipc_h) {
-  int fh;
-  struct stat file_info;
-
-  if ((!ipc_h) || (!ipc_h->name))
-    return -1;
-
-  if ( stat(ipc_h->name, &file_info) == -1) {
-    if ( mkfifo(ipc_h->name, S_IWUSR | S_IRUSR ) ) {
-      vtpmlogerror(VTPM_LOG_VTPM, "Failed to create fifo %s.\n", ipc_h->name);
-      return -1;
-    }
-  }
-
-  ipc_h->fh = VTPM_IPC_CLOSED;
-
-  return 0;
-}
-
-
-// Read size bytes. If FH isn't open, open it.
-int vtpm_ipc_read(vtpm_ipc_handle_t *ipc_h, vtpm_ipc_handle_t *alt_ipc_h, BYTE *bytes, UINT32 size){
-  vtpm_ipc_handle_t *my_ipc_h;
-  int result;
-  
-  if (ipc_h) {
-    my_ipc_h = ipc_h;
-  } else {
-    my_ipc_h = alt_ipc_h;
-  }
-  
-  if (my_ipc_h->fh == VTPM_IPC_CLOSED) {   
-    my_ipc_h->fh = open(my_ipc_h->name, my_ipc_h->flags);
-  }
-
-  if ( my_ipc_h->fh == VTPM_IPC_CLOSED ) {
-    vtpmlogerror(VTPM_LOG_VTPM, "VTPM ERROR: Can't open %s for reading.\n", my_ipc_h->name);
-    return -1;
-  }
-
-  result = read(my_ipc_h->fh, bytes, size);
-  if (result < 0) {
-    my_ipc_h->fh = VTPM_IPC_CLOSED;
-  }
-
-  return (result);
-}
-
-// Write size bytes. If FH isn't open, open it.
-int vtpm_ipc_write(vtpm_ipc_handle_t *ipc_h, vtpm_ipc_handle_t *alt_ipc_h, BYTE *bytes, UINT32 size) {
-  vtpm_ipc_handle_t *my_ipc_h;
-  int result;
-
-  if (ipc_h) {
-    my_ipc_h = ipc_h;
-  } else {
-    my_ipc_h = alt_ipc_h;
-  }
-
-  if (my_ipc_h->fh == VTPM_IPC_CLOSED) {
-    my_ipc_h->fh = open(my_ipc_h->name, my_ipc_h->flags);
-  }
-
-  if ( my_ipc_h->fh == VTPM_IPC_CLOSED ) {
-    vtpmlogerror(VTPM_LOG_VTPM, "VTPM ERROR: Can't open %s for writing.\n", my_ipc_h->name);
-    return -1;
-  }
-
-  result = write(my_ipc_h->fh, bytes, size);
-  if (result < 0) {
-    my_ipc_h->fh = VTPM_IPC_CLOSED;
-  }
-
-  return (result);
-}
-
-// Mark file as closed and try and close it. Errors not reported.
-void vtpm_ipc_close(vtpm_ipc_handle_t *ipc_h) {
-
-  if (ipc_h) {
-    close(ipc_h->fh);
-    ipc_h->fh = VTPM_IPC_CLOSED;
-  }
-
-}
diff --git a/tools/vtpm_manager/manager/vtpm_ipc.h b/tools/vtpm_manager/manager/vtpm_ipc.h
deleted file mode 100644
index 529c4a2..0000000
--- a/tools/vtpm_manager/manager/vtpm_ipc.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// ===================================================================
-//
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above
-//     copyright notice, this list of conditions and the following
-//     disclaimer in the documentation and/or other materials provided
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-//
-// vtpm_ipc.h Header for interprocess communication between VTPM manager
-// and Guests or VTPMs
-//
-// ===================================================================
-
-#ifndef __VTPM_IO_H__
-#define __VTPM_IO_H__
-
-#include "tcg.h"
-
-#define VTPM_IPC_CLOSED -1
-
-// Represents an (somewhat) abstracted io handle.
-typedef struct vtpm_ipc_handle_t {
-  int fh;              // IO handle.
-  int flags;           // Flags for opening. This may need to become
-                       // a void *, but for now files use an int.
-  char *name;          // Names for debugging as well as filenames
-                       // for file-based io.
-} vtpm_ipc_handle_t;
-
-
-int vtpm_ipc_init(vtpm_ipc_handle_t *ioh, char* name, int flags, BOOL create);
-
-// Create the file that needs opening. Used only for FIFOs
-// FYI: This may cause problems in other file IO schemes. We'll see.
-int vtpm_ipc_create(vtpm_ipc_handle_t *ioh);
-
-// Read size bytes. If FH isn't open, open it.
-int vtpm_ipc_read(vtpm_ipc_handle_t *ioh, vtpm_ipc_handle_t *alt_ioh, BYTE *bytes, UINT32 size);
-
-// Write size bytes. If FH isn't open, open it.
-int vtpm_ipc_write(vtpm_ipc_handle_t *ioh, vtpm_ipc_handle_t *alt_ioh, BYTE *bytes, UINT32 size);
-
-// Mark file as closed and try and close it. Errors not reported.
-void vtpm_ipc_close(vtpm_ipc_handle_t *ioh);
-
-#endif
diff --git a/tools/vtpm_manager/manager/vtpm_lock.c b/tools/vtpm_manager/manager/vtpm_lock.c
deleted file mode 100644
index e737d60..0000000
--- a/tools/vtpm_manager/manager/vtpm_lock.c
+++ /dev/null
@@ -1,63 +0,0 @@
-// ===================================================================
-//
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above
-//     copyright notice, this list of conditions and the following
-//     disclaimer in the documentation and/or other materials provided
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-//
-// vtpm_lock.c Provided controlled sync around access to vtpm structures
-//
-// ===================================================================
-
-#include <pthread.h>
-#include "vtpm_lock.h"
-
-static pthread_rwlock_t vtpm_lock;
-
-void vtpm_lock_init() {
-
-  pthread_rwlock_init( &vtpm_lock, NULL);
-}
-
-void vtpm_lock_destroy(){
-  pthread_rwlock_destroy(&vtpm_lock);
-}
-
-void vtpm_lock_rdlock(){
-  pthread_rwlock_rdlock(&vtpm_lock);
-}
-
-void vtpm_lock_wrlock(){
-  pthread_rwlock_wrlock(&vtpm_lock);
-}
-
-void vtpm_lock_unlock(){
-  pthread_rwlock_unlock(&vtpm_lock);
-}
-
diff --git a/tools/vtpm_manager/manager/vtpm_lock.h b/tools/vtpm_manager/manager/vtpm_lock.h
deleted file mode 100644
index 53a339d..0000000
--- a/tools/vtpm_manager/manager/vtpm_lock.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// ===================================================================
-//
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above
-//     copyright notice, this list of conditions and the following
-//     disclaimer in the documentation and/or other materials provided
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-//
-// vtpm_lock.h Provided controlled sync around access to vtpm structures
-//
-// ===================================================================
-
-#ifndef __VTPM_LOCK_H__
-#define __VTPM_LOCK_H__
-
-void vtpm_lock_init();
-void vtpm_lock_destroy();
-
-void vtpm_lock_rdlock();
-void vtpm_lock_wrlock();
-void vtpm_lock_unlock();
-
-#endif
diff --git a/tools/vtpm_manager/manager/vtpm_manager.c b/tools/vtpm_manager/manager/vtpm_manager.c
deleted file mode 100644
index e089f78..0000000
--- a/tools/vtpm_manager/manager/vtpm_manager.c
+++ /dev/null
@@ -1,285 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtpm_manager.c
-// 
-//  This file will house the main logic of the VTPM Manager
-//
-// ==================================================================
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-
-#include "vtpm_manager.h"
-#include "vtpmpriv.h"
-#include "vtsp.h"
-#include "bsg.h"
-#include "hashtable.h"
-#include "hashtable_itr.h"
-
-#include "log.h"
-#include "buffer.h"
-
-VTPM_GLOBALS *vtpm_globals=NULL;
-
-// --------------------------- Well Known Auths --------------------------
-const TPM_AUTHDATA SRK_AUTH = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-                                  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-
-#ifdef WELL_KNOWN_OWNER_AUTH
-static BYTE FIXED_OWNER_AUTH[20] =  {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-                                  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-#endif
-
-
-// -------------------------- Hash table functions --------------------
-
-static unsigned int hashfunc32(void *ky) {
-  return (* (UINT32 *) ky);
-}
-
-static int equals32(void *k1, void *k2) {
-  return (*(UINT32 *) k1 == *(UINT32 *) k2);
-}
-
-// --------------------------- Functions ------------------------------
-
-TPM_RESULT VTPM_Create_Manager(){
-  
-  TPM_RESULT status = TPM_SUCCESS;
-  
-  // Generate Auth for Owner
-#ifdef WELL_KNOWN_OWNER_AUTH 
-  memcpy(vtpm_globals->owner_usage_auth, FIXED_OWNER_AUTH, sizeof(TPM_AUTHDATA));
-#else    
-  Crypto_GetRandom(vtpm_globals->owner_usage_auth, sizeof(TPM_AUTHDATA) );
-#endif
-
-  // Take Owership of TPM
-  CRYPTO_INFO ek_cryptoInfo;
-  
-  status = VTSP_ReadPubek(vtpm_globals->manager_tcs_handle, &ek_cryptoInfo);
-  
-  // If we can read PubEK then there is no owner and we should take it.
-  // We use the abilty to read the pubEK to flag that the TPM is owned.
-  // FIXME: Change to just trying to take ownership and react to the status
-  if (status == TPM_SUCCESS) { 
-    TPMTRYRETURN(VTSP_TakeOwnership(vtpm_globals->manager_tcs_handle,
-				    (const TPM_AUTHDATA*)&vtpm_globals->owner_usage_auth, 
-				    &SRK_AUTH,
-				    &ek_cryptoInfo,
-				    &vtpm_globals->keyAuth)); 
-  
-    TPMTRYRETURN(VTSP_DisablePubekRead(vtpm_globals->manager_tcs_handle,
-                                       (const TPM_AUTHDATA*)&vtpm_globals->owner_usage_auth,  
-                                       &vtpm_globals->keyAuth));     
-  } else {
-    vtpmloginfo(VTPM_LOG_VTPM, "Failed to readEK meaning TPM has an owner. Creating Keys off existing SRK.\n");
-  }
-  
-  // Generate storage key's auth
-  Crypto_GetRandom(  &vtpm_globals->storage_key_usage_auth, 
-		     sizeof(TPM_AUTHDATA) );
-  
-  TCS_AUTH osap;
-  TPM_AUTHDATA sharedsecret;
-  
-  TPMTRYRETURN( VTSP_OSAP(vtpm_globals->manager_tcs_handle,
-			  TPM_ET_KEYHANDLE,
-			  TPM_SRK_KEYHANDLE, 
-			  &SRK_AUTH,
-			  &sharedsecret, 
-			  &osap) ); 
-
-  osap.fContinueAuthSession = FALSE;
- 
- 
-  TPMTRYRETURN( VTSP_CreateWrapKey( vtpm_globals->manager_tcs_handle,
-				    TPM_KEY_BIND,
-				    (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
-				    TPM_SRK_KEYHANDLE, 
-				    (const TPM_AUTHDATA*)&sharedsecret,
-				    &vtpm_globals->storageKeyWrap,
-				    &osap) );
-  
-  // Generate boot key's auth
-  TPM_AUTHDATA bootKeyWrapAuth;
-  memset(&bootKeyWrapAuth, 0, sizeof(bootKeyWrapAuth));
-  
-  TPMTRYRETURN( VTSP_OSAP(vtpm_globals->manager_tcs_handle,
-			  TPM_ET_KEYHANDLE,
-			  TPM_SRK_KEYHANDLE, 
-			  &SRK_AUTH,
-			  &sharedsecret, 
-			  &osap) ); 
-
-  osap.fContinueAuthSession = FALSE;
- 
-  // FIXME: This key protects the global secrets on disk. It should use TPM
-  //        PCR bindings to limit its use to legit configurations.
-  //        Current binds are open, implying a Trusted VM contains this code.
-  //        If this VM is not Trusted, use measurement and PCR bindings.
-  TPMTRYRETURN( VTSP_CreateWrapKey( vtpm_globals->manager_tcs_handle,
-				    TPM_KEY_BIND,
-				    (const TPM_AUTHDATA*)&bootKeyWrapAuth,
-				    TPM_SRK_KEYHANDLE, 
-				    (const TPM_AUTHDATA*)&sharedsecret,
-				    &vtpm_globals->bootKeyWrap,
-				    &osap) );
-
-  // Populate CRYPTO_INFO vtpm_globals->bootKey. This does not load it into the TPM
-  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
-                              TPM_SRK_KEYHANDLE,
-                              &vtpm_globals->bootKeyWrap,
-                              NULL,
-                              NULL,
-                              NULL,
-                              &vtpm_globals->bootKey,
-                              TRUE ) );
-
-  TPMTRYRETURN( VTSP_SaveState(vtpm_globals->manager_tcs_handle) );
-  goto egress;
-  
- abort_egress:
-  exit(1);
-  
- egress:
-  vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager (Status = %d).\n", status);
-  return status;
-  
-}
-
-///////////////////////////////////////////////////////////////////////////////
-TPM_RESULT VTPM_Init_Manager() {
-  TPM_RESULT status = TPM_FAIL, serviceStatus;   
-  BYTE *randomsead;
-  UINT32 randomsize=256;
-
-  if ((vtpm_globals = (VTPM_GLOBALS *) malloc(sizeof(VTPM_GLOBALS))) == NULL){
-    status = TPM_FAIL;
-    goto abort_egress;
-  }
-  memset(vtpm_globals, 0, sizeof(VTPM_GLOBALS));
-
-  vtpm_globals->connected_dmis = 0;
-
-  if ((vtpm_globals->dmi_map = create_hashtable(10, hashfunc32, equals32)) == NULL){
-    status = TPM_FAIL;
-    goto abort_egress;
-  }
-  
-  // Create new TCS Object
-  vtpm_globals->manager_tcs_handle = 0;
- 
-  TPMTRYRETURN(TCS_create());
-  
-  // Create TCS Context for service
-  TPMTRYRETURN( TCS_OpenContext(&vtpm_globals->manager_tcs_handle ) );
-
-  TPMTRYRETURN( TCSP_GetRandom(vtpm_globals->manager_tcs_handle, 
-			       &randomsize, 
-			       &randomsead));
-  
-  Crypto_Init(randomsead, randomsize);
-  TPMTRYRETURN( TCS_FreeMemory (vtpm_globals->manager_tcs_handle, randomsead)); 
-	
-  // Create OIAP session for service's authorized commands
-  TPMTRYRETURN( VTSP_OIAP( vtpm_globals->manager_tcs_handle, 
-			   &vtpm_globals->keyAuth) );
-  vtpm_globals->keyAuth.fContinueAuthSession = TRUE;
-
-  vtpm_globals->mig_keys = NULL;
-
-  // If fails, create new Manager.
-  serviceStatus = VTPM_LoadManagerData();
-  if (serviceStatus == TPM_IOERROR) {
-    vtpmloginfo(VTPM_LOG_VTPM, "Failed to read manager file. Assuming first time initialization.\n");
-    TPMTRYRETURN( VTPM_Create_Manager() );    
-    TPMTRYRETURN( VTPM_SaveManagerData() );
-  } else if (serviceStatus != TPM_SUCCESS) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Failed to read existing manager file");
-    exit(1);
-  }
-
-  //Load Storage Key 
-  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
-			      TPM_SRK_KEYHANDLE,
-			      &vtpm_globals->storageKeyWrap,
-			      &SRK_AUTH,
-			      &vtpm_globals->storageKeyHandle,
-			      &vtpm_globals->keyAuth,
-			      &vtpm_globals->storageKey,
-                              FALSE ) );
-
-  // Create entry for Dom0 for control messages
-  TPMTRYRETURN( VTPM_Handle_New_DMI(NULL) );
-  
-  goto egress;
-  
- abort_egress:
- egress:
-  
-  return(status);
-}
-
-/////////////////////////////////////////////////////////////////////////////// 
-void VTPM_Stop_Manager() {
-  VTPM_DMI_RESOURCE *dmi_res;
-  struct hashtable_itr *dmi_itr;
-  
-  // Close all the TCS contexts. TCS should evict keys based on this
-  if (hashtable_count(vtpm_globals->dmi_map) > 0) {
-    dmi_itr = hashtable_iterator(vtpm_globals->dmi_map);
-    do {
-      dmi_res = (VTPM_DMI_RESOURCE *) hashtable_iterator_value(dmi_itr);
-      if (dmi_res->connected) 
-	close_dmi( dmi_res ); // Not really interested in return code
-      
-    } while (hashtable_iterator_advance(dmi_itr));
-		free (dmi_itr);
-  }
-  
-  if ( VTPM_SaveManagerData() != TPM_SUCCESS ) 
-    vtpmlogerror(VTPM_LOG_VTPM, "Unable to save manager data.\n");
-
-  TCS_CloseContext(vtpm_globals->manager_tcs_handle);
-  TCS_destroy();
-  
-  hashtable_destroy(vtpm_globals->dmi_map, 1);
-  free(vtpm_globals);
-  
-  Crypto_Exit();
-	
-  vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
-}
diff --git a/tools/vtpm_manager/manager/vtpm_manager.h b/tools/vtpm_manager/manager/vtpm_manager.h
deleted file mode 100644
index a324a8f..0000000
--- a/tools/vtpm_manager/manager/vtpm_manager.h
+++ /dev/null
@@ -1,150 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtpm_manager.h
-// 
-//  Public Interface header for VTPM Manager
-//
-// ==================================================================
-
-#ifndef __VTPM_MANAGER_H__
-#define __VTPM_MANAGER_H__
-
-#define VTPM_TAG_REQ 0x01c1
-#define VTPM_TAG_RSP 0x01c4
-#define COMMAND_BUFFER_SIZE 4096
-
-// Header sizes. Note Header MAY include the DMI
-#define VTPM_COMMAND_HEADER_SIZE_CLT ( 2 + 4 + 4)
-//                    sizeof(TPM_TAG + UINT32 + TPM_COMMAND_CODE)
-#define VTPM_COMMAND_HEADER_SIZE_SRV ( 4 + VTPM_COMMAND_HEADER_SIZE_CLT )
-//                    sizeof( UINT32 + VTPM_COMMAND_HEADER_SIZE_CLT)
-
-//************************ Command Codes ****************************
-#define VTPM_ORD_BASE       0x0000
-#define VTPM_PRIV_MASK      0x01000000 // Priviledged VTPM Command
-#define VTPM_PRIV_BASE      (VTPM_ORD_BASE | VTPM_PRIV_MASK)
-
-// Non-priviledged VTPM Commands (From DMI's)
-#define VTPM_ORD_SAVENVM      (VTPM_ORD_BASE + 1) // DMI Saves Secrets
-#define VTPM_ORD_LOADNVM      (VTPM_ORD_BASE + 2) // DMI Loads Secrets
-#define VTPM_ORD_TPMCOMMAND   (VTPM_ORD_BASE + 3) // DMI issues HW TPM Command
-#define VTPM_ORD_GET_MIG_KEY  (VTPM_ORD_BASE + 4) // Get manager's migration key
-#define VTPM_ORD_LOAD_MIG_KEY (VTPM_ORD_BASE + 5) // load dest migration key 
-
-// Priviledged VTPM Commands (From management console)
-#define VTPM_ORD_OPEN         (VTPM_PRIV_BASE + 1) // Creates/reopens DMI
-#define VTPM_ORD_CLOSE        (VTPM_PRIV_BASE + 2) // Closes a DMI
-#define VTPM_ORD_DELETE       (VTPM_PRIV_BASE + 3) // Permemently Deletes DMI
-#define VTPM_ORD_MIGRATE_IN   (VTPM_PRIV_BASE + 4) // Load migrated VTPM
-#define VTPM_ORD_MIGRATE_OUT  (VTPM_PRIV_BASE + 5) // migrate VTPM to dest 
-
-//************************ Return Codes ****************************
-#define VTPM_TYPE_PVM 1 // Paravirtualized Domain
-#define VTPM_TYPE_HVM 2 // HVM Domain
-
-//************************ Return Codes ****************************
-#define VTPM_SUCCESS               0
-#define VTPM_FAIL                  1
-#define VTPM_UNSUPPORTED           2
-#define VTPM_FORBIDDEN             3
-#define VTPM_RESTORE_CONTEXT_FAILED    4
-#define VTPM_INVALID_REQUEST       5
-
-//*********************** Parameter Values *************************
-#define VTPM_TYPE_NON_MIGRATABLE  0x00
-#define VTPM_TYPE_MIGRATABLE      0x01
-#define VTPM_TYPE_MIGRATED        0xFF // VTPM has been migrated.
-                                       // VTPM can be recovered or deleted only
-
-/******************* Command Parameter API *************************
-
-VTPM Command Format
-  dmi: 4 bytes                  // Source of message. 
-                                // WARNING: This is prepended by the channel. 
-                                // Thus it is received by VTPM Manager, 
-                                // but not sent by DMI
-  tpm tag: 2 bytes
-  command size: 4 bytes         // Size of command including header but not DMI
-  ord: 4 bytes                  // Command ordinal above
-  parameters: size - 10 bytes   // Command Parameter
-
-VTPM Response Format
-  tpm tag: 2 bytes
-  response_size: 4 bytes
-  status: 4 bytes         
-  parameters: size - 10 bytes
-
-
-VTPM_Open:
-  Input Parameters:
-    mig_type: 1 byte 
-    startup_mode: 1 byte // Cold Boot = 1, resume = 2, deactive = 3
-    domain type: 1 byte
-    instance_id: 4 bytes
-  Output Parameters:
-    None
-    
-VTPM_Close
-  Input Parameters:
-    instance_id: 4 bytes
-  Output Parameters:
-    None
-
-VTPM_Delete
-  Input Parameters:
-    instance_id: 4 bytes
-  Output Parameters:
-    None
-
-VTPM_SaveNVM
-  Input Parameters:
-    data: n bytes (Header indicates size of data)
-  Output Parameters:
-    None
-
-VTPM_LoadNVM
-  Input Parameters:
-    None
-  Output Parameters:
-    data: n bytes (Header indicates size of data)
-
-VTPM_TPMCommand
-  Input Parameters:
-    TPM Command Byte Stream: n bytes 
-  Output Parameters:
-    TPM Reponse Byte Stream: n bytes 
-
-*********************************************************************/
-
-#endif //_VTPM_MANAGER_H_
diff --git a/tools/vtpm_manager/manager/vtpm_manager_handler.c b/tools/vtpm_manager/manager/vtpm_manager_handler.c
deleted file mode 100644
index 2001074..0000000
--- a/tools/vtpm_manager/manager/vtpm_manager_handler.c
+++ /dev/null
@@ -1,488 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtpm_manager_handler.c
-// 
-//  This file will house the main logic of the VTPM Manager
-//
-// ==================================================================
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-
-#include "vtpm_manager.h"
-#include "vtpmpriv.h"
-#include "vtsp.h"
-#include "bsg.h"
-#include "hashtable.h"
-#include "hashtable_itr.h"
-#include "log.h"
-#include "buffer.h"
-
-#define vtpmhandlerloginfo(module,fmt,args...) vtpmloginfo (module, "[%s]: " fmt, thread_name, ##args );
-#define vtpmhandlerloginfomore(module,fmt,args...) vtpmloginfomore (module, fmt, ##args );
-#define vtpmhandlerlogerror(module,fmt,args...) vtpmlogerror (module, "[%s]: " fmt, thread_name, ##args );
-
-// ---------------------- Prototypes -------------------
-TPM_RESULT vtpm_manager_handle_vtpm_cmd(VTPM_DMI_RESOURCE *dmi_res,
-					TPM_COMMAND_CODE ord,
-					buffer_t *command_buf,
-					buffer_t *result_buf,
-                                        BOOL is_priv,
-                                        char *thread_name);
-
-TPM_RESULT vtpm_manager_handle_tpm_cmd(vtpm_ipc_handle_t *tx_ipc_h,
-                                       vtpm_ipc_handle_t *rx_ipc_h,
-                                       VTPM_DMI_RESOURCE *dmi_res,
-                                       BYTE *cmd_header,
-                                       buffer_t *param_buf,
-                                       buffer_t *result_buf,
-                                       char *thread_name);
-
-TPM_RESULT VTPM_Manager_Handler( vtpm_ipc_handle_t *tx_ipc_h, 
-                                 vtpm_ipc_handle_t *rx_ipc_h,
-                                 BOOL fw_tpm,   // Forward TPM cmds?
-                                 vtpm_ipc_handle_t *fw_tx_ipc_h, 
-                                 vtpm_ipc_handle_t *fw_rx_ipc_h,
-                                 BOOL is_priv,
-                                 char *thread_name) {
-  TPM_RESULT      status =  TPM_FAIL; // Should never return
-  UINT32          dmi, in_param_size, cmd_size, out_param_size, out_message_size, reply_size;
-  BYTE            *cmd_header=NULL, *in_param=NULL, *out_message=NULL, *reply;
-  buffer_t        *command_buf=NULL, *result_buf=NULL;
-  TPM_TAG         tag;
-  TPM_COMMAND_CODE ord;
-  VTPM_DMI_RESOURCE *dmi_res;
-  int  size_read, size_write, i;
-  BOOL add_header=TRUE; // This indicates to prepend a header on result_buf before sending
-  
-  cmd_header = (BYTE *) malloc(VTPM_COMMAND_HEADER_SIZE_SRV);
-  command_buf = (buffer_t *) malloc(sizeof(buffer_t));
-  result_buf = (buffer_t *) malloc(sizeof(buffer_t));
- 
-  // ------------------------ Main Loop --------------------------------
-  while(1) {
-    
-    vtpmhandlerloginfo(VTPM_LOG_VTPM, "%s waiting for messages.\n", thread_name);
-
-    // --------------------- Read Cmd from Sender ----------------
-    
-    // Read command header 
-    size_read = vtpm_ipc_read(rx_ipc_h, NULL, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
-    if (size_read > 0) {
-      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "RECV[%d]: 0x", size_read);
-      for (i=0; i<size_read; i++) 
-	vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
-    } else {
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s can't read from ipc. Errono = %d. Aborting... \n", thread_name, errno);
-      goto abort_command;
-    }
-
-    if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
-      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "\n");
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command shorter than normal header (%d bytes). Aborting...\n", size_read);
-      goto abort_command;
-    }
-    
-    // Unpack header
-    BSG_UnpackList(cmd_header, 4,
-    		   BSG_TYPE_UINT32, &dmi,
-    		   BSG_TPM_TAG, &tag,
-    		   BSG_TYPE_UINT32, &in_param_size,
-    		   BSG_TPM_COMMAND_CODE, &ord );
-    
-    // Using the header info, read the parameters of the command
-    // Note that in_param_size is in the client's context
-    cmd_size = in_param_size - VTPM_COMMAND_HEADER_SIZE_CLT;
-    if (cmd_size > 0) {
-      in_param = (BYTE *) malloc(cmd_size);
-      size_read = vtpm_ipc_read( rx_ipc_h, NULL, in_param, cmd_size);
-      if (size_read > 0) {
-	for (i=0; i<size_read; i++) 
-	  vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
-	
-      } else {
-        vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s had error reading cmd from ipc. Aborting... \n", thread_name);
-	goto abort_command;
-      }
-      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-      
-      if (size_read < (int) cmd_size) {
-	vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-	vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d). Aborting...\n", size_read, cmd_size);
-	goto abort_command;
-      }
-    } else {
-      in_param = NULL;
-      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-    }
-
-    // Init the buffers used to handle the command and the response
-    if ( (buffer_init_convert(command_buf, cmd_size, in_param) != TPM_SUCCESS) || 
-	 (buffer_init(result_buf, 0, 0) != TPM_SUCCESS) ) {
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Failed to setup buffers. Aborting...\n");
-      goto abort_command;
-    }
-    
-    // -------------- Dispatch Commands to Handlers -----------
-    if ((tag == VTPM_TAG_REQ) && (ord & VTPM_PRIV_MASK)) {
-      vtpm_lock_wrlock();
-    } else {
-      vtpm_lock_rdlock();
-    }
-
-    if ( !(dmi_res = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi)) ||
-         (!dmi_res->connected) ) {
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Attempted access to non-existent or disconnected DMI %d. Aborting...\n", dmi);
-      status = TPM_BAD_PARAMETER;
-      // We have no one to reply to, they don't exist.
-      goto abort_command;
-    }
-
-    if (tag == VTPM_TAG_REQ) { 
-    
-      status = vtpm_manager_handle_vtpm_cmd(dmi_res, ord, command_buf, result_buf, is_priv, thread_name);
-
-    } else { // This is not a VTPM Command at all.
-      if (fw_tpm) { 
-        status = vtpm_manager_handle_tpm_cmd(fw_tx_ipc_h, fw_rx_ipc_h, dmi_res, cmd_header, command_buf, result_buf, thread_name);
-
-        // This means calling the DMI failed, not that the cmd failed in the DMI
-        // Since the return will be interpretted by a TPM app, all errors are IO_ERRORs to the app
-        if (status != TPM_SUCCESS) { 
-          status = TPM_IOERROR;
-	  goto abort_with_error;
-        }
-        // Unlike all other commands, forwarded commands yield a result_buf that includes the DMI's status. This
-        // should be forwarded to the caller VM
-        add_header = FALSE;
-      } else {
-        // We are not supposed to forward TPM commands at all.
-        int i;
-        vtpmhandlerlogerror(VTPM_LOG_VTPM, "Attempt to use unsupported direct access to TPM.\n");
-        vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "Bad Command. dmi:%d, tag:%d, size:%d, ord:%d, Params: ", dmi, tag, in_param_size, ord);
-        for (i=0; i<cmd_size; i++)
-          vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
-
-        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-
-        status = TPM_FAIL;
-        goto abort_with_error;
-     }
-
-    } // end else for is VTPM Command
-
-    // ------------------- Respond to Sender ------------------
-
-    // Errors while handling responses jump here to reply with error messages
-    // NOTE: Currently there are no recoverable errors in multi-VM mode. If one
-    //       is added to the code, this ifdef should be removed.
-    //       Also note this is NOT referring to errors in commands, but rather
-    //       this is about I/O errors and such.
-#ifndef VTPM_MULTI_VM
- abort_with_error:
-#endif
-   
-    if (add_header) { 
-      // Prepend VTPM header with destination DM stamped
-      out_param_size = buffer_len(result_buf);
-      out_message_size = VTPM_COMMAND_HEADER_SIZE_CLT + out_param_size;
-      reply_size = VTPM_COMMAND_HEADER_SIZE_SRV + out_param_size;
-      out_message = (BYTE *) malloc (reply_size);
-      reply = out_message;
-    
-      BSG_PackList(out_message, 4,
-		   BSG_TYPE_UINT32, (BYTE *) &dmi,
-		   BSG_TPM_TAG, (BYTE *) &tag,
-		   BSG_TYPE_UINT32, (BYTE *) &out_message_size,
-		   BSG_TPM_RESULT, (BYTE *) &status);
-    
-      if (buffer_len(result_buf) > 0) 
-        memcpy(out_message + VTPM_COMMAND_HEADER_SIZE_SRV, result_buf->bytes, out_param_size);
-      //Note: Send message + dmi_id
-    } else {
-      reply = result_buf->bytes;
-      reply_size = buffer_len(result_buf);
-    }  
-    size_write = vtpm_ipc_write(tx_ipc_h, (dmi_res ? dmi_res->tx_vtpm_ipc_h : NULL), reply, reply_size );
-    if (size_write > 0) {
-      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT: 0x");
-      for (i=0; i < reply_size; i++) 
-	vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", reply[i]);
-      
-      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");            
-    } else {
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s had error writing to ipc. Aborting... \n", thread_name);
-      goto abort_command;
-    }
-    free(out_message); out_message=NULL;
-    
-    if (size_write < (int)reply_size) {
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s unable to write full command to ipc (%d/%d)\n", thread_name, size_write, reply_size);
-      goto abort_command;
-    }
-    
-    // On certain failures an error message cannot be sent. 
-    // This marks the beginning of cleanup in preperation for the next command.
-  abort_command:
-    //free buffers
-    bzero(cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
-    //free(in_param); // This was converted to command_buf. No need to free 
-    buffer_free(result_buf);
-    buffer_free(command_buf);
-
-    // If we have a write lock, save the manager table
-    if ((tag == VTPM_TAG_REQ) && (ord & VTPM_PRIV_MASK) &&
-        (VTPM_SaveManagerData() != TPM_SUCCESS) ) {
-       vtpmhandlerlogerror(VTPM_LOG_VTPM, "ERROR: Unable to save manager data.\n");
-    }
-
-    vtpm_lock_unlock();
-    add_header = TRUE; // Reset to the default
-  } // End while(1)
-  
-}
-
-/////////////////////////////////////////////////////////////////////////
-TPM_RESULT vtpm_manager_handle_vtpm_cmd(VTPM_DMI_RESOURCE *dmi_res, 
-					TPM_COMMAND_CODE ord,
-					buffer_t *command_buf,
-					buffer_t *result_buf,
-                                        BOOL is_priv,
-                                        char *thread_name) {
-
-  TPM_RESULT status = TPM_FAIL;
-
-  switch (ord) {                
-  case VTPM_ORD_SAVENVM:
-    status= VTPM_Handle_Save_NVM(dmi_res,
-                                 command_buf, 
-                                 result_buf);
-    break;
-
-  case VTPM_ORD_LOADNVM:
-    status= VTPM_Handle_Load_NVM(dmi_res, 
-                                 command_buf, 
-                                 result_buf);
-    break;
-
-  case VTPM_ORD_TPMCOMMAND:
-    status= VTPM_Handle_TPM_Command(dmi_res, 
-                                    command_buf, 
-                                    result_buf);
-    break;
-
-  case VTPM_ORD_GET_MIG_KEY:
-    status = VTPM_Handle_Get_Migration_key(command_buf, 
-                                           result_buf);
-    break;
-
-  case VTPM_ORD_LOAD_MIG_KEY:
-    status = VTPM_Handle_Load_Migration_key(command_buf, 
-                                           result_buf);
-    break;
-   
-  default:
-    // Privileged handlers can do maintanance
-    if (is_priv) {
-      switch (ord) {
-      case VTPM_ORD_OPEN:
-        status = VTPM_Handle_New_DMI(command_buf);
-        break;
-
-      case VTPM_ORD_CLOSE:
-        status = VTPM_Handle_Close_DMI(command_buf);
-        break;
-
-      case VTPM_ORD_DELETE:
-        status = VTPM_Handle_Delete_DMI(command_buf);
-        break;
-
-      case VTPM_ORD_MIGRATE_IN:
-        status = VTPM_Handle_Migrate_In(command_buf, result_buf);
-        break;
-
-      case VTPM_ORD_MIGRATE_OUT:
-        status = VTPM_Handle_Migrate_Out(command_buf, result_buf);
-        break;
-
-      default:
-        status = TPM_BAD_ORDINAL;
-      } // switch
-    } else { // is priv command
-
-        status = TPM_BAD_ORDINAL;
-    } // inner switch
-  } // outer switch
-
-  return(status);
-}
-      
-/////////////////////////////////////////////////////////////////////
-TPM_RESULT vtpm_manager_handle_tpm_cmd(vtpm_ipc_handle_t *tx_ipc_h,
-                                       vtpm_ipc_handle_t *rx_ipc_h,
-				       VTPM_DMI_RESOURCE *dmi_res, 
-				       BYTE *cmd_header,
-				       buffer_t *param_buf,
-				       buffer_t *result_buf,
-                                       char *thread_name) {
-
-  TPM_RESULT status = TPM_FAIL;
-  UINT32 dmi_dst;
-  TPM_COMMAND_CODE ord;
-  TPM_TAG tag_out;
-  UINT32 dmi_cmd_size, in_param_size, adj_param_size;
-  BYTE *dmi_cmd, *in_param;
-  int  size_read, size_write, i;
-
-  //// Dom0 can't talk to the BE, so this must be a broken FE/BE or badness
-  if (dmi_res->dmi_id == VTPM_CTL_DM) {
-    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Illegal use of TPM command from dom0\n");
-    status = TPM_FAIL;
-    goto abort_with_error;
-  } 
-
-  vtpmhandlerloginfo(VTPM_LOG_VTPM, "Forwarding command to DMI.\n");
-   
-  //Forward TPM CMD stamped with dmi_id to DMI for handling
-  if (buffer_len(param_buf)) {
-    dmi_cmd = (BYTE *) malloc(VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf));
-    dmi_cmd_size = VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf);
-    memcpy(dmi_cmd, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
-    memcpy(dmi_cmd + VTPM_COMMAND_HEADER_SIZE_SRV, param_buf->bytes, buffer_len(param_buf));
-    size_write = vtpm_ipc_write(tx_ipc_h, dmi_res->tx_tpm_ipc_h, dmi_cmd, dmi_cmd_size);
-
-    if (size_write > 0) {
-      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT (DMI): 0x");
-      for (i=0; i<VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf); i++) {
-        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", dmi_cmd[i]);
-      }
-      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-    } else {
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error writing to DMI. Aborting... \n");
-      status = TPM_IOERROR;
-      goto abort_with_error;
-    }
-    free(dmi_cmd);
-  } else {
-    dmi_cmd_size = VTPM_COMMAND_HEADER_SIZE_SRV;
-    size_write = vtpm_ipc_write(tx_ipc_h, dmi_res->tx_tpm_ipc_h, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV );
-    if (size_write > 0) {
-      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT (DMI): 0x");
-      for (i=0; i<VTPM_COMMAND_HEADER_SIZE_SRV; i++) 
-        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
-
-      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-    } else {
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error writing to DMI. Aborting... \n");
-      status = TPM_IOERROR;
-      goto abort_with_error;
-    }
-  }
-    
-  if (size_write != (int) dmi_cmd_size) 
-    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Could not write entire command to DMI (%d/%d)\n", size_write, dmi_cmd_size);
-
-  buffer_free(param_buf);
-  
-  // Read header for response to TPM command from DMI
-  size_read = vtpm_ipc_read( rx_ipc_h, dmi_res->rx_tpm_ipc_h, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
-  if (size_read > 0) {
-    vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "RECV (DMI): 0x");
-    for (i=0; i<size_read; i++) 
-      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
-
-  } else {
-    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error reading from DMI. Aborting... \n");
-    status = TPM_IOERROR;
-    goto abort_with_error;
-  }
-  
-  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
-    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command from DMI shorter than normal header. Aborting...\n");
-    status = TPM_IOERROR;
-    goto abort_with_error;
-  }
-
-  // Unpack response from DMI for TPM command
-  BSG_UnpackList(cmd_header, 4,
-                 BSG_TYPE_UINT32, &dmi_dst,
-                 BSG_TPM_TAG, &tag_out,
-                 BSG_TYPE_UINT32, &in_param_size,
-                 BSG_TPM_COMMAND_CODE, &status );
-  
-  // If response has parameters, read them.
-  // Note that in_param_size is in the client's context
-  adj_param_size = in_param_size - VTPM_COMMAND_HEADER_SIZE_CLT;
-  if (adj_param_size > 0) {
-    in_param = (BYTE *) malloc(adj_param_size);
-    size_read = vtpm_ipc_read(rx_ipc_h, dmi_res->rx_tpm_ipc_h, in_param, adj_param_size);
-    if (size_read > 0) {
-      for (i=0; i<size_read; i++) 
-        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
-
-    } else {
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error reading from BE. Aborting... \n");
-      goto abort_with_error;
-    }
-    vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
-   
-    if (size_read < (int)adj_param_size) {
-      vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
-      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command read(%d) from DMI is shorter than header indicates(%d). Aborting...\n", size_read, adj_param_size);
-      status = TPM_IOERROR;
-      goto abort_with_error;
-    }
-  } else {
-    in_param = NULL;
-    vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
-  }
-   
-  if ( (buffer_init(result_buf, VTPM_COMMAND_HEADER_SIZE_SRV, cmd_header) != TPM_SUCCESS) || 
-       (buffer_append_raw(result_buf, adj_param_size, in_param) != TPM_SUCCESS) ) {
-    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Failed to setup buffers. Aborting...\n");
-    status = TPM_FAIL;
-    goto abort_with_error;
-  }
- 
-  vtpmhandlerloginfo(VTPM_LOG_VTPM, "Sending DMI's response to guest.\n");
-
-  status = TPM_SUCCESS;
-
- abort_with_error:
-
-  return status;
-}
-
diff --git a/tools/vtpm_manager/manager/vtpmd.c b/tools/vtpm_manager/manager/vtpmd.c
deleted file mode 100644
index cf58ba3..0000000
--- a/tools/vtpm_manager/manager/vtpmd.c
+++ /dev/null
@@ -1,371 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtpmd.c
-// 
-//  Application
-//
-// ===================================================================
-
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <string.h>
-#include <pthread.h>
-#include "vtpm_manager.h"
-#include "vtpmpriv.h"
-#include "tcg.h"
-#include "log.h"
-#include "vtpm_ipc.h"
-
-#define TPM_EMULATOR_PATH "/usr/bin/vtpmd"
-
-#define VTPM_BE_FNAME          "/dev/vtpm"
-#define VTPM_DUMMY_TX_BE_FNAME "/var/vtpm/fifos/dummy_out.fifo"
-#define VTPM_DUMMY_RX_BE_FNAME "/var/vtpm/fifos/dummy_in.fifo"
-#define VTPM_TX_TPM_FNAME      "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
-#define VTPM_RX_TPM_FNAME      "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
-#define VTPM_TX_VTPM_FNAME     "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
-#define VTPM_RX_VTPM_FNAME     "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
-#define VTPM_TX_HP_FNAME       "/var/vtpm/fifos/to_console.fifo"
-#define VTPM_RX_HP_FNAME       "/var/vtpm/fifos/from_console.fifo"
-
-#define VTPM_TYPE_PVM_STRING "pvm"
-#define VTPM_TYPE_HVM_STRING "hvm"
-
-struct vtpm_thread_params_s {
-  vtpm_ipc_handle_t *tx_ipc_h;
-  vtpm_ipc_handle_t *rx_ipc_h;
-  BOOL fw_tpm;
-  vtpm_ipc_handle_t *fw_tx_ipc_h;
-  vtpm_ipc_handle_t *fw_rx_ipc_h;
-  BOOL is_priv;
-  char *thread_name;
-};
-
-// This is needed to all extra_close_dmi to close this to prevent a
-// broken pipe when no DMIs are left.
-static vtpm_ipc_handle_t *g_rx_tpm_ipc_h;
-
-void *vtpm_manager_thread(void *arg_void) {
-  TPM_RESULT *status = (TPM_RESULT *) malloc(sizeof(TPM_RESULT) );
-  struct vtpm_thread_params_s *arg = (struct vtpm_thread_params_s *) arg_void;
-
-  *status = VTPM_Manager_Handler(arg->tx_ipc_h, arg->rx_ipc_h,
-                                 arg->fw_tpm, arg->fw_tx_ipc_h, arg->fw_rx_ipc_h,
-                                 arg->is_priv, arg->thread_name);
-
-  return (status);
-}
-
-
-void signal_handler(int reason) {
-  if (pthread_equal(pthread_self(), vtpm_globals->master_pid)) {
-    vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager shutting down for signal %d.\n", reason);
-  } else {
-    // For old Linux Thread machines, signals are delivered to each thread. Deal with them.
-    vtpmloginfo(VTPM_LOG_VTPM, "Child shutting down\n");
-    pthread_exit(NULL);
-  }
-
-  VTPM_Stop_Manager();
-  exit(-1);
-}
-
-struct sigaction ctl_c_handler;
-
-TPM_RESULT VTPM_New_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res, BYTE vm_type, BYTE startup_mode) {
-
-  TPM_RESULT status = TPM_SUCCESS;
-  int fh;
-  char dmi_id_str[11]; // UINT32s are up to 10 digits + NULL
-  char *tx_vtpm_name, *tx_tpm_name, *vm_type_string;
-  struct stat file_info;
-
-  if (dmi_res->dmi_id == VTPM_CTL_DM) {
-    dmi_res->tx_tpm_ipc_h = NULL;
-    dmi_res->rx_tpm_ipc_h = NULL;
-    dmi_res->tx_vtpm_ipc_h = NULL;
-    dmi_res->rx_vtpm_ipc_h = NULL;
-  } else {
-    // Create a pair of fifo pipes
-    dmi_res->rx_tpm_ipc_h = NULL;
-    dmi_res->rx_vtpm_ipc_h = NULL;
-
-    if ( ((dmi_res->tx_tpm_ipc_h = (vtpm_ipc_handle_t *) malloc (sizeof(vtpm_ipc_handle_t))) == NULL ) ||
-         ((dmi_res->tx_vtpm_ipc_h =(vtpm_ipc_handle_t *) malloc (sizeof(vtpm_ipc_handle_t))) == NULL ) ||
-         ((tx_tpm_name = (char *) malloc(11 + strlen(VTPM_TX_TPM_FNAME))) == NULL ) ||
-         ((tx_vtpm_name =(char *) malloc(11 + strlen(VTPM_TX_VTPM_FNAME))) == NULL) ) {
-      status =TPM_RESOURCES;
-      goto abort_egress;
-    }
-
-    sprintf(tx_tpm_name, VTPM_TX_TPM_FNAME, (uint32_t) dmi_res->dmi_id);
-    sprintf(tx_vtpm_name, VTPM_TX_VTPM_FNAME, (uint32_t) dmi_res->dmi_id);
-
-    if ( (vtpm_ipc_init(dmi_res->tx_tpm_ipc_h, tx_tpm_name, O_WRONLY | O_NONBLOCK, TRUE) != 0) ||
-         (vtpm_ipc_init(dmi_res->tx_vtpm_ipc_h, tx_vtpm_name, O_WRONLY, TRUE) != 0) ) { //FIXME: O_NONBLOCK?
-      status = TPM_IOERROR;
-      goto abort_egress;
-    }
-
-    // Measure DMI
-    // FIXME: This will measure DMI. Until then use a fixed DMI_Measurement value
-    // Also, this mechanism is specific to 1 VM architecture.
-    /*
-    fh = open(TPM_EMULATOR_PATH, O_RDONLY);
-    stat_ret = fstat(fh, &file_stat);
-    if (stat_ret == 0)
-      dmi_size = file_stat.st_size;
-    else {
-      vtpmlogerror(VTPM_LOG_VTPM, "Could not open vtpmd!!\n");
-      status = TPM_IOERROR;
-      goto abort_egress;
-    }
-    dmi_buffer
-    */
-    memset(&dmi_res->DMI_measurement, 0xcc, sizeof(TPM_DIGEST));
-
-    if (vm_type == VTPM_TYPE_PVM)
-      vm_type_string = (BYTE *)&VTPM_TYPE_PVM_STRING;
-    else
-      vm_type_string = (BYTE *)&VTPM_TYPE_HVM_STRING;
-
-    // Launch DMI
-    sprintf(dmi_id_str, "%d", (int) dmi_res->dmi_id);
-#ifdef MANUAL_DM_LAUNCH
-    vtpmlogerror(VTPM_LOG_VTPM, "Manually start VTPM with dmi=%s now.\n", dmi_id_str);
-    dmi_res->dmi_pid = 0;
-#else
-    pid_t pid = fork();
-
-    if (pid == -1) {
-      vtpmlogerror(VTPM_LOG_VTPM, "Could not fork to launch vtpm\n");
-      status = TPM_RESOURCES;
-      goto abort_egress;
-    } else if (pid == 0) {
-      switch (startup_mode) {
-      case TPM_ST_CLEAR:
-        execl (TPM_EMULATOR_PATH, "vtpmd", "clear", vm_type_string, dmi_id_str, NULL);
-        break;
-      case TPM_ST_STATE:
-        execl (TPM_EMULATOR_PATH, "vtpmd", "save", vm_type_string, dmi_id_str, NULL);
-        break;
-      case TPM_ST_DEACTIVATED:
-        execl (TPM_EMULATOR_PATH, "vtpmd", "deactivated", vm_type_string, dmi_id_str, NULL);
-        break;
-      default:
-        status = TPM_BAD_PARAMETER;
-        goto abort_egress;
-      }
-
-      // Returning from these at all is an error.
-      vtpmlogerror(VTPM_LOG_VTPM, "Could not exec to launch vtpm\n");
-    } else {
-      dmi_res->dmi_pid = pid;
-      vtpmloginfo(VTPM_LOG_VTPM, "Launching DMI on PID = %d\n", pid);
-    }
-#endif // MANUAL_DM_LAUNCH
-
-  } // If DMI = VTPM_CTL_DM
-    status = TPM_SUCCESS;
-
-abort_egress:
-  return (status);
-}
-
-TPM_RESULT VTPM_Close_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res) {
-  TPM_RESULT status = TPM_SUCCESS;
-
-  if (vtpm_globals->connected_dmis == 0) {
-    // No more DMI's connected. Close fifo to prevent a broken pipe.
-    // This is hackish. Need to think of another way.
-    vtpm_ipc_close(g_rx_tpm_ipc_h);
-  }
-
-  
-  if (dmi_res->dmi_id != VTPM_CTL_DM) {
-    vtpm_ipc_close(dmi_res->tx_tpm_ipc_h);
-    vtpm_ipc_close(dmi_res->tx_vtpm_ipc_h);
-
-    free(dmi_res->tx_tpm_ipc_h->name);
-    free(dmi_res->tx_vtpm_ipc_h->name);
-
-#ifndef MANUAL_DM_LAUNCH
-    if (dmi_res->dmi_id != VTPM_CTL_DM) {
-      if (dmi_res->dmi_pid != 0) {
-        vtpmloginfo(VTPM_LOG_VTPM, "Killing dmi on pid %d.\n", dmi_res->dmi_pid);
-        if (kill(dmi_res->dmi_pid, SIGKILL) !=0) {
-          vtpmloginfo(VTPM_LOG_VTPM, "DMI on pid %d is already dead.\n", dmi_res->dmi_pid);
-        } else if (waitpid(dmi_res->dmi_pid, NULL, 0) != dmi_res->dmi_pid) {
-          vtpmlogerror(VTPM_LOG_VTPM, "DMI on pid %d failed to stop.\n", dmi_res->dmi_pid);
-          status = TPM_FAIL;
-        }
-      } else {
-        vtpmlogerror(VTPM_LOG_VTPM, "Could not kill dmi because it's pid was 0.\n");
-        status = TPM_FAIL;
-      }
-    }
-#endif
-
-  } //endif ! dom0
-  return status;
-}
-
-
-int main(int argc, char **argv) {
-  vtpm_ipc_handle_t *tx_be_ipc_h, *rx_be_ipc_h, rx_tpm_ipc_h, rx_vtpm_ipc_h, tx_hp_ipc_h, rx_hp_ipc_h; 
-  struct vtpm_thread_params_s be_thread_params, dmi_thread_params, hp_thread_params;
-  pthread_t be_thread, dmi_thread, hp_thread;
-
-#ifdef DUMMY_BACKEND
-  vtpm_ipc_handle_t tx_dummy_ipc_h, rx_dummy_ipc_h;
-#else
-  vtpm_ipc_handle_t real_be_ipc_h;
-#endif
-
-  vtpmloginfo(VTPM_LOG_VTPM, "Starting VTPM.\n");
- 
-  // -------------------- Initialize Manager ----------------- 
-  if (VTPM_Init_Manager() != TPM_SUCCESS) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Closing vtpmd due to error during startup.\n");
-    return -1;
-  }
-  
-  // -------------------- Setup Ctrl+C Handlers --------------
-  ctl_c_handler.sa_handler = signal_handler;
-  sigemptyset(&ctl_c_handler.sa_mask);
-  ctl_c_handler.sa_flags = 0;    
-  
-  if (sigaction(SIGINT, &ctl_c_handler, NULL) == -1) 
-    vtpmlogerror(VTPM_LOG_VTPM, "Could not install SIGINT handler. Ctl+break will not stop manager gently.\n");
-  
-  // For easier debuggin with gdb
-  if (sigaction(SIGHUP, &ctl_c_handler, NULL) == -1) 
-    vtpmlogerror(VTPM_LOG_VTPM, "Could not install SIGHUP handler. Ctl+break will not stop manager gently.\n");    
-  
-  sigset_t sig_mask;
-  sigemptyset(&sig_mask);
-  sigaddset(&sig_mask, SIGPIPE);
-  sigprocmask(SIG_BLOCK, &sig_mask, NULL);
-  
-  // ------------------- Set up file ipc structures ----------
-#ifdef DUMMY_BACKEND
-  if ( (vtpm_ipc_init(&tx_dummy_ipc_h, VTPM_DUMMY_TX_BE_FNAME, O_RDWR, TRUE) != 0) ||
-       (vtpm_ipc_init(&rx_dummy_ipc_h, VTPM_DUMMY_RX_BE_FNAME, O_RDWR, TRUE) != 0) ) {
-
-    vtpmlogerror(VTPM_LOG_VTPM, "Unable to create Dummy BE FIFOs.\n");
-    exit(-1);
-  }
-
-  tx_be_ipc_h = &tx_dummy_ipc_h;
-  rx_be_ipc_h = &rx_dummy_ipc_h;
-#else
-  vtpm_ipc_init(&real_be_ipc_h, VTPM_BE_FNAME, O_RDWR, FALSE);
-
-  tx_be_ipc_h = &real_be_ipc_h;
-  rx_be_ipc_h = &real_be_ipc_h;
-#endif
-
-  if ( (vtpm_ipc_init(&rx_tpm_ipc_h, VTPM_RX_TPM_FNAME, O_RDONLY, TRUE) != 0) ||
-       (vtpm_ipc_init(&rx_vtpm_ipc_h, VTPM_RX_VTPM_FNAME, O_RDWR, TRUE) != 0) || //FIXME: O_RDONLY?
-       (vtpm_ipc_init(&tx_hp_ipc_h,  VTPM_TX_HP_FNAME, O_RDWR, TRUE) != 0)    ||
-       (vtpm_ipc_init(&rx_hp_ipc_h,  VTPM_RX_HP_FNAME, O_RDWR, TRUE) != 0) ) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Unable to create initial FIFOs.\n");
-    exit(-1);
-  }
-
-  g_rx_tpm_ipc_h = &rx_tpm_ipc_h;
-
-  // -------------------- Set up thread params ------------- 
-
-  be_thread_params.tx_ipc_h = tx_be_ipc_h;
-  be_thread_params.rx_ipc_h = rx_be_ipc_h;
-  be_thread_params.fw_tpm = TRUE;
-  be_thread_params.fw_tx_ipc_h = NULL;
-  be_thread_params.fw_rx_ipc_h = &rx_tpm_ipc_h;
-  be_thread_params.is_priv = FALSE;
-  be_thread_params.thread_name = "Backend Listener";
-
-  dmi_thread_params.tx_ipc_h = NULL;
-  dmi_thread_params.rx_ipc_h = &rx_vtpm_ipc_h;
-  dmi_thread_params.fw_tpm = FALSE; 
-  dmi_thread_params.fw_tx_ipc_h = NULL;
-  dmi_thread_params.fw_rx_ipc_h = NULL;
-  dmi_thread_params.is_priv = FALSE; 
-  dmi_thread_params.thread_name = "VTPM Listener";
-
-  hp_thread_params.tx_ipc_h = &tx_hp_ipc_h;
-  hp_thread_params.rx_ipc_h = &rx_hp_ipc_h;
-  hp_thread_params.fw_tpm = FALSE;
-  hp_thread_params.fw_tx_ipc_h = NULL;
-  hp_thread_params.fw_rx_ipc_h = NULL;
-  hp_thread_params.is_priv = TRUE;
-  hp_thread_params.thread_name = "Hotplug Listener";
-
-  // --------------------- Launch Threads -----------------
-
-  vtpm_lock_init();
-
-  vtpm_globals->master_pid = pthread_self();
-  
-  if (pthread_create(&be_thread, NULL, vtpm_manager_thread, &be_thread_params) != 0) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch BE Thread.\n");
-    exit(-1);
-  }
-  
-  if (pthread_create(&dmi_thread, NULL, vtpm_manager_thread, &dmi_thread_params) != 0) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch DMI Thread.\n");
-    exit(-1);
-  }
-
- 
-  if (pthread_create(&hp_thread, NULL, vtpm_manager_thread, &hp_thread_params) != 0) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch HP Thread.\n");
-    exit(-1);
-  }
- 
-  //Join the other threads until exit time.
-  pthread_join(be_thread, NULL);
-  pthread_join(dmi_thread, NULL);
-  pthread_join(hp_thread, NULL);
- 
-  vtpmlogerror(VTPM_LOG_VTPM, "VTPM Manager shut down unexpectedly.\n");
- 
-  VTPM_Stop_Manager();
-  vtpm_lock_destroy();
-  return 0;
-}
diff --git a/tools/vtpm_manager/manager/vtpmpriv.h b/tools/vtpm_manager/manager/vtpmpriv.h
deleted file mode 100644
index 41e8d2d..0000000
--- a/tools/vtpm_manager/manager/vtpmpriv.h
+++ /dev/null
@@ -1,186 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtpmpriv.h
-// 
-//  Structures and functions private to the manager
-//
-// ==================================================================
-
-#ifndef __VTPMPRIV_H__
-#define __VTPMPRIV_H__
-
-#include "vtpm_manager.h"
-#include "tcg.h"
-#include "tcs.h"
-#include "buffer.h"
-#include "crypto.h"
-#include "vtpm_ipc.h"
-
-#define VTPM_MANAGER_GEN   2     // This is incremented when the manager's table
-                                 // is changed. It's used for backwards compatability
-
-#define STATE_FILE         "/var/vtpm/VTPM"
-#define DMI_NVM_FILE       "/var/vtpm/vtpm_dm_%d.data"
-#define VTPM_CTL_DM        0
-
-// ------------------------ Private Structures -----------------------
-typedef struct VTPM_DMI_RESOURCE_T {
-  // I/O info for Manager to talk to DMI's and controllers
-  vtpm_ipc_handle_t      *tx_vtpm_ipc_h;    // TX VTPM Results to DMI
-  vtpm_ipc_handle_t      *rx_vtpm_ipc_h;    // RX VTPM Commands from DMI
-  vtpm_ipc_handle_t      *tx_tpm_ipc_h;     // TX TPM Commands to DMI
-  vtpm_ipc_handle_t      *rx_tpm_ipc_h;     // RX TPM Results from DMI
- 
-#ifndef VTPM_MULTI_VM 
-  pid_t                 dmi_pid;
-#endif
-
-  // Non-persistent Information
-  bool                  connected;
-  UINT32                dmi_domain_id;
-  TCS_CONTEXT_HANDLE    TCSContext;     // TCS Handle
-  char                  *NVMLocation;   // NULL term string indicating location
-                                        // of NVM.
-  // Persistent Information about DMI
-  UINT32                dmi_id;
-  BYTE                  dmi_type;
-  TPM_DIGEST            NVM_measurement;  // Equal to the SHA1 of the blob
-  TPM_DIGEST            DMI_measurement;  // Correct measurement of the owning DMI
-} VTPM_DMI_RESOURCE;
-
-typedef struct tdVTPM_MIGKEY_LIST {
-  UINT32                name_size;
-  BYTE                  *name; // Name of destination (IP addr, domain name, etc)
-  CRYPTO_INFO           key;
-  struct tdVTPM_MIGKEY_LIST *next;
-} VTPM_MIGKEY_LIST;
-
-
-typedef struct tdVTPM_GLOBALS {
-  // Non-persistent data
-#ifndef VTPM_MULTI_VM
-  pid_t               master_pid;
-#endif
-
-  int                 connected_dmis;     // To close guest_rx when no dmis are connected
-
-  struct hashtable    *dmi_map;               // Table of all DMI's known indexed by persistent instance #
-  VTPM_MIGKEY_LIST    *mig_keys;              // Table of migration keys
-                      // Currently keys are loaded at migration time,
-                      // TODO: Make VTPM man store a keys persistently
-                      //       and update script to check if key is needed
-                      //       before fetching it.
-
-  TCS_CONTEXT_HANDLE  manager_tcs_handle;     // TCS Handle used by manager
-  TPM_HANDLE          storageKeyHandle;       // Key used by persistent store
-  CRYPTO_INFO         storageKey;             // For software encryption
-  CRYPTO_INFO         bootKey;                // For saving table
-  TCS_AUTH            keyAuth;                // OIAP session for storageKey 
-    
-  // Persistent Data
-  TPM_AUTHDATA        owner_usage_auth;       // OwnerAuth of real TPM
-  buffer_t            storageKeyWrap;         // Wrapped copy of storageKey
-  TPM_AUTHDATA        srk_usage_auth;
-  TPM_AUTHDATA        storage_key_usage_auth; 
-
-  buffer_t            bootKeyWrap;            // Wrapped copy of boot key 
-
-}VTPM_GLOBALS;
-
-// --------------------------- Global Values --------------------------
-extern VTPM_GLOBALS *vtpm_globals;   // Key info and DMI states
-extern const TPM_AUTHDATA SRK_AUTH;  // SRK Well Known Auth Value
-
-// ********************** VTPM Functions *************************
-TPM_RESULT VTPM_Init_Manager(); // Start VTPM Service
-void VTPM_Stop_Manager();  // Stop VTPM Service
-TPM_RESULT VTPM_Manager_Handler(vtpm_ipc_handle_t *tx_ipc_h,
-                                vtpm_ipc_handle_t *rx_ipc_h,
-                                BOOL fw_tpm,   // Should forward TPM cmds
-                                vtpm_ipc_handle_t *fw_tx_ipc_h,
-                                vtpm_ipc_handle_t *fw_rx_ipc_h,
-                                BOOL is_priv,
-                                char *client_name);
-
-// ********************** Command Handler Prototypes ***********************
-
-TPM_RESULT VTPM_Handle_Load_NVM(       VTPM_DMI_RESOURCE *myDMI, 
-                                        const buffer_t *inbuf, 
-                                        buffer_t *outbuf);
-
-TPM_RESULT VTPM_Handle_Save_NVM(       VTPM_DMI_RESOURCE *myDMI, 
-                                        const buffer_t *inbuf, 
-                                        buffer_t *outbuf);
-
-TPM_RESULT VTPM_Handle_TPM_Command(    VTPM_DMI_RESOURCE *dmi, 
-                                        buffer_t *inbuf, 
-                                        buffer_t *outbuf);
-
-TPM_RESULT VTPM_Handle_New_DMI(const buffer_t *param_buf);
-                                
-TPM_RESULT VTPM_Handle_Close_DMI(const buffer_t *param_buf);
-                                   
-TPM_RESULT VTPM_Handle_Delete_DMI(const buffer_t *param_buf);
-
-TPM_RESULT VTPM_Handle_Migrate_In( const buffer_t *param_buf,
-                                   buffer_t *result_buf);
-
-TPM_RESULT VTPM_Handle_Migrate_Out ( const buffer_t *param_buf,
-                                     buffer_t *result_buf);
-
-TPM_RESULT VTPM_Handle_Get_Migration_key( const buffer_t *param_buf,
-                                          buffer_t *result_buf);
-
-TPM_RESULT VTPM_SaveManagerData(void);
-TPM_RESULT VTPM_LoadManagerData(void);
-
-TPM_RESULT VTPM_New_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res, BYTE vm_type, BYTE startup_mode);
-
-TPM_RESULT VTPM_Close_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res);
-
-// Helper functions
-TPM_RESULT close_dmi(VTPM_DMI_RESOURCE *dmi_res);
-TPM_RESULT init_dmi(UINT32 dmi_id, BYTE type,  VTPM_DMI_RESOURCE **dmi_res);
-
-TPM_RESULT envelope_encrypt(const buffer_t     *inbuf,
-                             CRYPTO_INFO        *asymkey,
-                             buffer_t           *sealed_data);
-
-TPM_RESULT envelope_decrypt(const buffer_t     *cipher,
-                            TCS_CONTEXT_HANDLE TCSContext,
-                            TPM_HANDLE         keyHandle,
-                            const TPM_AUTHDATA *key_usage_auth,
-                            buffer_t           *unsealed_data);
-
-#endif // __VTPMPRIV_H__
diff --git a/tools/vtpm_manager/manager/vtsp.c b/tools/vtpm_manager/manager/vtsp.c
deleted file mode 100644
index fc8a66f..0000000
--- a/tools/vtpm_manager/manager/vtsp.c
+++ /dev/null
@@ -1,1042 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtsp.c
-// 
-//  Higher level interface to TCS for use in service.
-//
-// ==================================================================
-
-#include <string.h>
-#include "tcg.h"
-#include "tcs.h"
-#include "bsg.h"
-#include "log.h"
-#include "crypto.h"
-#include "vtsp.h"
-#include "buffer.h"
-
-#define  RSA_KEY_SIZE 0x0800
-
-/***********************************************************************************
- * GenerateAuth: Generate authorization info to be sent back to application
- *
- * Parameters: outParamDigestText  The concatenation of output parameters to be SHA1ed
- *    outParamDigestTextSize Size of inParamDigestText
- *    HMACkey     Key to be used for HMACing
- *          For OIAP use key.authUsage or PersistStore.ownerAuth
- *          For OSAP use shared secret
- *    pAuth     Authorization information from the application
- *
- * Return:  TPM_SUCCESS   Authorization data created
- *    TPM_AUTHFAIL   Invalid (NULL) HMACkey presented for OSAP
- *************************************************************************************/
-TPM_RESULT GenerateAuth( /*[IN]*/ const BYTE *inParamDigestText,
-			 /*[IN]*/ UINT32 inParamDigestTextSize,
-			 /*[IN]*/ const TPM_SECRET *HMACkey,  
-			 /*[IN,OUT]*/ TCS_AUTH *auth) {
-    
-  if (inParamDigestText == NULL || auth == NULL) 
-    return (TPM_AUTHFAIL);
-  else {
-    
-    //Generate new OddNonce
-    Crypto_GetRandom(auth->NonceOdd.nonce, sizeof(TPM_NONCE));
-    
-    // Create SHA1 inParamDigest
-    TPM_DIGEST inParamDigest;
-    Crypto_SHA1Full(inParamDigestText, inParamDigestTextSize, (BYTE *) &inParamDigest);
-    
-    // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
-    BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
-    
-    BSG_PackList(   hmacText, 4, 
-		    BSG_TPM_DIGEST, &inParamDigest,
-		    BSG_TPM_NONCE, &(auth->NonceEven),
-		    BSG_TPM_NONCE, &(auth->NonceOdd), 
-		    BSG_TYPE_BOOL, &(auth->fContinueAuthSession) );
-    
-    Crypto_HMAC((BYTE *) hmacText, sizeof(hmacText), (BYTE *) HMACkey, sizeof(TPM_DIGEST), (BYTE *) &(auth->HMAC));
-    
-    return(TPM_SUCCESS);
-    
-  }
-}
-
-/***********************************************************************************
- * VerifyAuth: Verify the authdata for a command requiring authorization
- *
- * Parameters: inParamDigestText  The concatenation of parameters to be SHA1ed
- *    inParamDigestTextSize Size of inParamDigestText
- *    authDataUsage   AuthDataUsage for the Entity being used
- *          Key->authDataUsage or TPM_AUTH_OWNER
- *    HMACkey     Key to be used for HMACing
- *          For OIAP use key.authUsage or PersistStore.ownerAuth
- *          For OSAP use NULL (It will be aquired from the Auth Session)
- *          If unknown (default), assume OIAP
- *    sessionAuth    A TCS_AUTH info for the session
- *    pAuth     Authorization information from the application
- *              hContext        If specified, on failed Auth, VerifyAuth will
- *                                      generate a new OIAP session in place of themselves
- *                                      destroyed session.
- *
- * Return:  TPM_SUCCESS   Authorization Verified
- *    TPM_AUTHFAIL   Authorization Failed
- *    TPM_FAIL    Failure during SHA1 routines
- *************************************************************************************/
-TPM_RESULT VerifyAuth( /*[IN]*/ const BYTE *outParamDigestText,
-		       /*[IN]*/ UINT32 outParamDigestTextSize,
-		       /*[IN]*/ const TPM_SECRET *HMACkey,  
-		       /*[IN,OUT]*/ TCS_AUTH *auth,
-		       /*[IN]*/  TCS_CONTEXT_HANDLE hContext) {
-  if (outParamDigestText == NULL || auth == NULL) 
-    return (TPM_AUTHFAIL);
-  
-  
-  // Create SHA1 inParamDigest
-  TPM_DIGEST outParamDigest;
-  Crypto_SHA1Full(outParamDigestText, outParamDigestTextSize, (BYTE *) &outParamDigest);
-  
-  // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
-  TPM_DIGEST hm;
-  BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
-  
-  BSG_PackList(   hmacText, 4, 
-		  BSG_TPM_DIGEST, &outParamDigest,
-		  BSG_TPM_NONCE, &(auth->NonceEven),
-		  BSG_TPM_NONCE, &(auth->NonceOdd), 
-		  BSG_TYPE_BOOL, &(auth->fContinueAuthSession) );
-  
-  Crypto_HMAC((BYTE *) hmacText, sizeof(hmacText),
-	      (BYTE *) HMACkey, sizeof(TPM_DIGEST), (BYTE *) &hm);
-    
-  // Compare correct HMAC with provided one.
-  if (memcmp (&hm, &(auth->HMAC), sizeof(TPM_DIGEST)) == 0) { // 0 indicates equality
-    if (!auth->fContinueAuthSession) 
-      vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM by fContinue=0.\n", auth->AuthHandle);
-    
-    return (TPM_SUCCESS);
-  } else {
-    // If specified, reconnect the OIAP session.
-    // NOTE: This only works for TCS's that never have a 0 context. 
-    if (hContext) {
-      vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM due to failure.\n", auth->AuthHandle);
-      VTSP_OIAP( hContext, auth);
-    }
-    return (TPM_AUTHFAIL);
-  }
-}
-
-TPM_RESULT VTSP_OIAP(const TCS_CONTEXT_HANDLE hContext,
-		     TCS_AUTH *auth) {
-  
-  vtpmloginfo(VTPM_LOG_VTSP, "OIAP.\n");
-  TPM_RESULT status = TPM_SUCCESS;                           
-  TPMTRYRETURN( TCSP_OIAP(hContext,
-			  &auth->AuthHandle,
-			  &auth->NonceEven) );
-
-  memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
-  auth->fContinueAuthSession = FALSE;
-
-  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x opened by TPM_OIAP.\n", auth->AuthHandle);
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  
-  return status;
-}
-
-TPM_RESULT VTSP_OSAP(const TCS_CONTEXT_HANDLE hContext,
-		     const TPM_ENTITY_TYPE entityType,
-		     const UINT32 entityValue,
-		     const TPM_AUTHDATA *usageAuth,
-		     TPM_SECRET *sharedSecret, 
-		     TCS_AUTH *auth) {
-  
-  vtpmloginfo(VTPM_LOG_VTSP, "OSAP.\n");
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_NONCE nonceEvenOSAP, nonceOddOSAP;
-  
-  Crypto_GetRandom((BYTE *) &nonceOddOSAP, sizeof(TPM_NONCE) ); 
-  
-  TPMTRYRETURN( TCSP_OSAP(    hContext,
-			      entityType,
-			      entityValue, 
-			      nonceOddOSAP,
-			      &auth->AuthHandle, 
-			      &auth->NonceEven, 
-			      &nonceEvenOSAP) );
-  
-  // Calculating Session Secret
-  BYTE sharedSecretText[TPM_DIGEST_SIZE * 2];
-  
-  BSG_PackList(  sharedSecretText, 2,
-		 BSG_TPM_NONCE, &nonceEvenOSAP,
-		 BSG_TPM_NONCE, &nonceOddOSAP);
-  
-  Crypto_HMAC(sharedSecretText, sizeof(sharedSecretText), (BYTE *) usageAuth, TPM_DIGEST_SIZE, (BYTE *) sharedSecret);       
-
-  memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
-  auth->fContinueAuthSession = FALSE;
-   
-  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x opened by TPM_OSAP.\n", auth->AuthHandle);
-
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  
-  return status;
-}
-
-
-TPM_RESULT VTSP_TerminateHandle(const TCS_CONTEXT_HANDLE hContext,
-                                const TCS_AUTH *auth) {
-
-  vtpmloginfo(VTPM_LOG_VTSP, "Terminate Handle.\n");
-  TPM_RESULT status = TPM_SUCCESS;
-  TPMTRYRETURN( TCSP_TerminateHandle(hContext, auth->AuthHandle) );
-
-  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM_TerminateHandle.\n", auth->AuthHandle);
-  goto egress;
-
- abort_egress:
-
- egress:
-
-  return status;
-}
-
-
-TPM_RESULT VTSP_ReadPubek(   const TCS_CONTEXT_HANDLE hContext,
-                             CRYPTO_INFO *crypto_info) {
-  
-  TPM_RESULT status;
-  TPM_NONCE antiReplay;
-  TPM_DIGEST   checksum;
-  BYTE *pubEKtext;
-  UINT32 pubEKtextsize;
-  
-  vtpmloginfo(VTPM_LOG_VTSP, "Reading Public EK.\n");
-  
-  // GenerateAuth new nonceOdd    
-  Crypto_GetRandom(&antiReplay, sizeof(TPM_NONCE) );
-  
-  
-  TPMTRYRETURN( TCSP_ReadPubek(  hContext,
-				 antiReplay,
-				 &pubEKtextsize,
-				 &pubEKtext,
-				 &checksum) );
-  
-  
-  // Extract the remaining output parameters
-  TPM_PUBKEY pubEK;
-  
-  BSG_Unpack(BSG_TPM_PUBKEY, pubEKtext, (BYTE *) &pubEK);
-  
-  // Build CryptoInfo for the bindingKey
-  TPM_RSA_KEY_PARMS rsaKeyParms;
-  
-  BSG_Unpack(BSG_TPM_RSA_KEY_PARMS, 
-	     pubEK.algorithmParms.parms, 
-	     &rsaKeyParms);
-  
-  Crypto_RSABuildCryptoInfoPublic(rsaKeyParms.exponentSize, 
-				  rsaKeyParms.exponent, 
-				  pubEK.pubKey.keyLength, 
-				  pubEK.pubKey.key, 
-				  crypto_info);
-    
-  // Destroy rsaKeyParms
-  BSG_Destroy(BSG_TPM_RSA_KEY_PARMS, &rsaKeyParms);
-
-  // Set encryption scheme
-  crypto_info->encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
-  //crypto_info->encScheme = pubEK.algorithmParms.encScheme;
-  crypto_info->algorithmID = pubEK.algorithmParms.algorithmID;
-  
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  
-  return status;
-}
-
-TPM_RESULT VTSP_TakeOwnership(   const TCS_CONTEXT_HANDLE hContext,
-                                 const TPM_AUTHDATA *ownerAuth, 
-                                 const TPM_AUTHDATA *srkAuth,
-                                 CRYPTO_INFO *ek_cryptoInfo,
-                                 TCS_AUTH *auth) {
-  
-  vtpmloginfo(VTPM_LOG_VTSP, "Taking Ownership of TPM.\n");
-  
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_COMMAND_CODE command = TPM_ORD_TakeOwnership;
-  TPM_PROTOCOL_ID proto_id = TPM_PID_OWNER;
-  BYTE *new_srk;
-  
-  BYTE *paramText;        // Digest to make Auth.
-  UINT32 paramTextSize;
-  
-  // vars for srkpubkey parameter
-  TPM_KEY srkPub;
-  TPM_KEY_PARMS srkKeyInfo = {TPM_ALG_RSA, TPM_ES_RSAESOAEP_SHA1_MGF1, TPM_SS_NONE, 12, 0};
-  BYTE srkRSAkeyInfo[12] = { 0x00, 0x00, (RSA_KEY_SIZE >> 8), 0x00,   0x00, 0x00, 0x00, 0x02,   0x00, 0x00, 0x00, 0x00};
-  srkKeyInfo.parms = (BYTE *) &srkRSAkeyInfo;
-  
-  struct pack_buf_t srkText;
-  
-  //These values are accurate for an enc(AuthData).
-  struct pack_buf_t encOwnerAuth, encSrkAuth;
-  
-  encOwnerAuth.data = (BYTE *)malloc(sizeof(BYTE) * 256);
-  encSrkAuth.data = (BYTE *)malloc(sizeof(BYTE) * 256);
-  
-  if (encOwnerAuth.data == NULL || encSrkAuth.data == NULL) {
-    vtpmloginfo(VTPM_LOG_VTSP, "Could not malloc encrypted auths.\n");
-    status = TPM_RESOURCES;
-    goto abort_egress;
-  }
-  
-  Crypto_RSAEnc(ek_cryptoInfo, sizeof(TPM_SECRET), (BYTE *) ownerAuth, &encOwnerAuth.size, encOwnerAuth.data);
-  Crypto_RSAEnc(ek_cryptoInfo, sizeof(TPM_SECRET), (BYTE *) srkAuth, &encSrkAuth.size, encSrkAuth.data);
-  
-  
-  // Build srk public key struct
-  srkPub.ver = TPM_STRUCT_VER_1_1;
-  srkPub.keyUsage = TPM_KEY_STORAGE;
-  srkPub.keyFlags = 0x00;
-  srkPub.authDataUsage = TPM_AUTH_ALWAYS;
-  memcpy(&srkPub.algorithmParms, &srkKeyInfo, sizeof(TPM_KEY_PARMS));
-  srkPub.PCRInfoSize = 0;
-  srkPub.PCRInfo = 0;
-  srkPub.pubKey.keyLength= 0;
-  srkPub.encDataSize = 0;
-  
-  srkText.data = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
-  srkText.size = BSG_Pack(BSG_TPM_KEY, (BYTE *) &srkPub, srkText.data);
-  
-  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
-  
-  paramTextSize = BSG_PackList(paramText, 5,
-			       BSG_TPM_COMMAND_CODE,&command,
-			       BSG_TPM_PROTOCOL_ID, &proto_id,
-			       BSG_TPM_SIZE32_DATA, &encOwnerAuth,
-			       BSG_TPM_SIZE32_DATA, &encSrkAuth,
-			       BSG_TPM_KEY, &srkPub);
-  
-  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize, ownerAuth, auth) );
-  
-  new_srk = srkText.data;
-  TPMTRYRETURN( TCSP_TakeOwnership ( hContext,
-				     proto_id,
-				     encOwnerAuth.size, 
-				     encOwnerAuth.data,
-				     encSrkAuth.size,
-				     encSrkAuth.data,
-				     &srkText.size,
-				     &new_srk, 
-				     auth ) );
-  
-  
-  paramTextSize = BSG_PackList(paramText, 2, 
-			       BSG_TPM_RESULT, &status,
-			       BSG_TPM_COMMAND_CODE, &command);
-  memcpy(paramText + paramTextSize, new_srk, srkText.size);
-  paramTextSize += srkText.size;
-  
-  
-  TPMTRYRETURN( VerifyAuth(  paramText, paramTextSize,
-			     ownerAuth, auth, 
-			     hContext) );
-  
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  
-  free(srkText.data);
-  free(encSrkAuth.data);
-  free(encOwnerAuth.data);
-  free(paramText);
-  
-  TCS_FreeMemory(hContext, new_srk);
-  
-  return status;
-}
-
-TPM_RESULT VTSP_DisablePubekRead( const TCS_CONTEXT_HANDLE    hContext,
-                                  const TPM_AUTHDATA          *ownerAuth, 
-                                  TCS_AUTH                    *auth) {
-  
-  vtpmloginfo(VTPM_LOG_VTSP, "Disabling Pubek Read.\n");
-  
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_COMMAND_CODE command = TPM_ORD_DisablePubekRead;
-  
-  BYTE *paramText;        // Digest to make Auth.
-  UINT32 paramTextSize;
-    
-  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
-  
-  paramTextSize = BSG_PackList(paramText, 1,
-			       BSG_TPM_COMMAND_CODE, &command);
-  
-  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
-			      ownerAuth, auth) );
-  
-  // Call TCS
-  TPMTRYRETURN( TCSP_DisablePubekRead ( hContext, // in
-                                        auth) );
-  
-  // Verify Auth
-  paramTextSize = BSG_PackList(paramText, 2,
-			       BSG_TPM_RESULT, &status,
-			       BSG_TPM_COMMAND_CODE, &command);
-  
-  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
-			    ownerAuth, auth, 
-			    hContext) );
-  goto egress;
-  
- abort_egress:
- egress:
-  free(paramText);
-  return status;
-}
-
-TPM_RESULT VTSP_CreateWrapKey(  const TCS_CONTEXT_HANDLE hContext,
-                                const TPM_KEY_USAGE      usage,
-                                const TPM_AUTHDATA       *newKeyAuth,
-                                const TCS_KEY_HANDLE     parentHandle, 
-                                const TPM_AUTHDATA       *osapSharedSecret,
-                                buffer_t                 *pubKeyBuf,
-                                TCS_AUTH                 *auth) {
-  
-  int i;
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_COMMAND_CODE command = TPM_ORD_CreateWrapKey;
-  
-  vtpmloginfo(VTPM_LOG_VTSP, "Creating new key of type %d.\n", usage);
-  
-  // vars for Calculate encUsageAuth
-  BYTE *paramText;      
-  UINT32 paramTextSize;
-  
-  // vars for Calculate encUsageAuth
-  BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
-  TPM_DIGEST XORKey1;
-  UINT32 XORbufferSize;
-  TPM_SECRET encUsageAuth, encMigrationAuth;
-  
-  // vars for Flatten newKey prototype
-  BYTE *flatKey = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
-  UINT32 flatKeySize = TCPA_MAX_BUFFER_LENGTH;                                    
-  struct pack_buf_t newKeyText;
-  
-  // Fill in newKey
-  TPM_KEY newKey;
-  
-  BYTE RSAkeyInfo[12] = { 0x00, 0x00, (RSA_KEY_SIZE >> 8), 0x00,   0x00, 0x00, 0x00, 0x02,   0x00, 0x00, 0x00, 0x00};
-  newKey.algorithmParms.algorithmID = TPM_ALG_RSA;
-  newKey.algorithmParms.parms = (BYTE *) &RSAkeyInfo;
-  newKey.algorithmParms.parmSize = 12;
-  
-  switch (usage) {
-  case TPM_KEY_SIGNING:
-    vtpmloginfo(VTPM_LOG_VTSP, "Creating Signing Key...\n");
-    newKey.keyUsage = TPM_KEY_SIGNING;
-    newKey.algorithmParms.encScheme = TPM_ES_NONE;
-    newKey.algorithmParms.sigScheme = TPM_SS_RSASSAPKCS1v15_SHA1;
-    break;
-  case TPM_KEY_STORAGE:
-    vtpmloginfo(VTPM_LOG_VTSP, "Creating Storage Key...\n");
-    newKey.keyUsage = TPM_KEY_STORAGE;
-    newKey.algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
-    newKey.algorithmParms.sigScheme = TPM_SS_NONE;
-    break;
-  case TPM_KEY_BIND:
-    vtpmloginfo(VTPM_LOG_VTSP, "Creating Binding Key...\n");
-    newKey.keyUsage = TPM_KEY_BIND;
-    newKey.algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
-    newKey.algorithmParms.sigScheme = TPM_SS_NONE;
-    break;
-  default:
-    vtpmloginfo(VTPM_LOG_VTSP, "Cannot create key. Invalid Key Type.\n");
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-  
-  
-  newKey.ver = TPM_STRUCT_VER_1_1;
-  
-  newKey.keyFlags = 0;
-  newKey.authDataUsage = TPM_AUTH_ALWAYS;
-  newKey.pubKey.keyLength= 0;
-  newKey.encDataSize = 0;
-  newKey.encData = NULL;
-  
-  // FIXME: Support PCR bindings
-  newKey.PCRInfoSize = 0;
-  newKey.PCRInfo = NULL;
-  
-  // Calculate encUsageAuth                                    
-  XORbufferSize = BSG_PackList(  XORbuffer, 2, 
-				 BSG_TPM_SECRET, osapSharedSecret,
-				 BSG_TPM_NONCE, &auth->NonceEven);
-  Crypto_SHA1Full(XORbuffer, XORbufferSize, (BYTE *) &XORKey1);
-  
-  // FIXME: No support for migratable keys.
-  for (i=0; i < TPM_DIGEST_SIZE; i++) 
-    ((BYTE *) &encUsageAuth)[i] = ((BYTE *) &XORKey1)[i] ^ ((BYTE *) newKeyAuth)[i];
-  
-  // Flatten newKey prototype
-  flatKeySize = BSG_Pack(BSG_TPM_KEY, (BYTE *) &newKey, flatKey);
-  newKeyText.data = flatKey;
-  newKeyText.size = flatKeySize;
-  
-  // Generate HMAC
-  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
-  
-  paramTextSize = BSG_PackList(paramText, 3,
-			       BSG_TPM_COMMAND_CODE, &command,
-			       BSG_TPM_AUTHDATA, &encUsageAuth,
-			       BSG_TPM_AUTHDATA, &encMigrationAuth);
-  memcpy(paramText + paramTextSize, newKeyText.data, newKeyText.size);
-  paramTextSize += newKeyText.size;
-  
-  
-  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
-			      osapSharedSecret, auth) );
-  
-  // Call TCS
-  TPMTRYRETURN( TCSP_CreateWrapKey(  hContext, 
-				     parentHandle,
-				     encUsageAuth,
-				     encMigrationAuth,
-				     &newKeyText.size,
-				     &newKeyText.data,
-				     auth) );
-  
-  // Verify Auth
-  paramTextSize = BSG_PackList(paramText, 2,
-			       BSG_TPM_RESULT, &status,
-			       BSG_TPM_COMMAND_CODE, &command);
-  memcpy(paramText + paramTextSize, newKeyText.data, newKeyText.size);
-  paramTextSize += newKeyText.size;
-  
-  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
-			    osapSharedSecret, auth, 0) );
-  
-  // Unpack/return key structure
-  TPMTRYRETURN(buffer_init(pubKeyBuf, 0, 0) );
-  TPMTRYRETURN(buffer_append_raw(pubKeyBuf, newKeyText.size, newKeyText.data) );
-  
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  
-  free(flatKey);
-  free(paramText);
-  TCS_FreeMemory(hContext, newKeyText.data);
-  
-  return status;
-}
-
-TPM_RESULT VTSP_LoadKey(const TCS_CONTEXT_HANDLE    hContext,
-                        const TCS_KEY_HANDLE        hUnwrappingKey,
-                        const buffer_t              *rgbWrappedKeyBlob,
-                        const TPM_AUTHDATA          *parentAuth,
-                        TPM_HANDLE                  *newKeyHandle,
-                        TCS_AUTH                    *auth,
-                        CRYPTO_INFO                 *cryptoinfo,
-                        const BOOL                  skipTPMLoad) { 
-  
-  
-  vtpmloginfo(VTPM_LOG_VTSP, "Loading Key %s.\n", (!skipTPMLoad ? "into TPM" : "only into memory"));
-  
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_COMMAND_CODE command = TPM_ORD_LoadKey;
-
-  BYTE *paramText=NULL;        // Digest to make Auth.
-  UINT32 paramTextSize;
-
-  // SkipTPMLoad stops key from being loaded into TPM, but still generates CRYPTO_INFO for it
-  if (! skipTPMLoad) { 
-  
-    if ((rgbWrappedKeyBlob == NULL) || (parentAuth == NULL) || 
-        (newKeyHandle==NULL) || (auth==NULL)) {
-      status = TPM_BAD_PARAMETER;
-      goto abort_egress;
-    }
-  
-    // Generate Extra TCS Parameters
-    TPM_HANDLE phKeyHMAC;
-  
-    paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
-  
-    paramTextSize = BSG_PackList(paramText, 1,
-  			         BSG_TPM_COMMAND_CODE, &command);
-  
-    memcpy(paramText + paramTextSize, rgbWrappedKeyBlob->bytes, buffer_len(rgbWrappedKeyBlob));
-    paramTextSize += buffer_len(rgbWrappedKeyBlob);
-  
-    TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
-			      parentAuth, auth) );
-  
-    // Call TCS
-    TPMTRYRETURN( TCSP_LoadKeyByBlob(  hContext,
-				       hUnwrappingKey,
-				       buffer_len(rgbWrappedKeyBlob),
-				       rgbWrappedKeyBlob->bytes,
-				       auth,
-				       newKeyHandle,
-				       &phKeyHMAC) );
-  
-    // Verify Auth
-    paramTextSize = BSG_PackList(paramText, 3,
-			         BSG_TPM_RESULT, &status,
-			         BSG_TPM_COMMAND_CODE, &command,
-			         BSG_TPM_HANDLE, newKeyHandle);
-  
-    TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
-			      parentAuth, auth, 
-			      hContext) );
-  } 
-  
-  // Build cryptoinfo structure for software crypto function. 
-  if (cryptoinfo != NULL) {
-    TPM_KEY newKey;
-    
-    // Unpack/return key structure
-    BSG_Unpack(BSG_TPM_KEY, rgbWrappedKeyBlob->bytes , &newKey);
-    TPM_RSA_KEY_PARMS rsaKeyParms;
-    
-    BSG_Unpack(BSG_TPM_RSA_KEY_PARMS, 
-	       newKey.algorithmParms.parms, 
-	       &rsaKeyParms);
-    
-    Crypto_RSABuildCryptoInfoPublic(rsaKeyParms.exponentSize, 
-				    rsaKeyParms.exponent, 
-				    newKey.pubKey.keyLength, 
-				    newKey.pubKey.key, 
-				    cryptoinfo);
-    
-    // Destroy rsaKeyParms
-    BSG_Destroy(BSG_TPM_RSA_KEY_PARMS, &rsaKeyParms);
-    
-    // Set encryption scheme
-    cryptoinfo->encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
-  }
-  
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  
-  free(paramText);
-  return status;
-}
-
-TPM_RESULT VTSP_Unbind( const TCS_CONTEXT_HANDLE    hContext,
-                        const TPM_KEY_HANDLE        key_handle,
-                        const buffer_t              *bound_data,
-                        const TPM_AUTHDATA          *usage_auth,
-                        buffer_t                    *clear_data,
-                        TCS_AUTH                    *auth) {
-  
-  vtpmloginfo(VTPM_LOG_VTSP, "Unbinding %d bytes of data.\n", buffer_len(bound_data));
-  
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_COMMAND_CODE command = TPM_ORD_UnBind;
-  
-  BYTE *paramText;        // Digest to make Auth.
-  UINT32 paramTextSize;
-  
-  // Generate Extra TCS Parameters
-  struct pack_buf_t clear_data32;
-  BYTE *clear_data_text;
-  UINT32 clear_data_size;
-  
-  struct pack_buf_t bound_data32 = {bound_data->size, bound_data->bytes};
-  
-  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
-  
-  paramTextSize = BSG_PackList(paramText, 2,
-			       BSG_TPM_COMMAND_CODE, &command,
-			       BSG_TPM_SIZE32_DATA, &bound_data32);
-  
-  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
-			      usage_auth, auth) );
-  
-  // Call TCS
-  TPMTRYRETURN( TCSP_UnBind( hContext,
-			     key_handle,
-			     buffer_len(bound_data),
-			     bound_data->bytes,
-			     auth,
-			     &clear_data_size,
-			     &clear_data_text) );
-  
-  
-  // Verify Auth
-  clear_data32.size = clear_data_size;
-  clear_data32.data = clear_data_text;
-  paramTextSize = BSG_PackList(paramText, 3,
-			       BSG_TPM_RESULT, &status,
-			       BSG_TPM_COMMAND_CODE, &command,
-			       BSG_TPM_SIZE32_DATA, &clear_data32);
-  
-  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
-			    usage_auth, auth, 
-			    hContext) );
-  
-  // Unpack/return key structure
-  TPMTRYRETURN(buffer_init(clear_data, 0, 0));
-  TPMTRYRETURN(buffer_append_raw (clear_data, clear_data_size, clear_data_text) );
-  
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  
-  free(paramText);
-  TCS_FreeMemory(hContext, clear_data_text);
-  
-  return status;
-}
-
-TPM_RESULT VTSP_Bind(   CRYPTO_INFO *cryptoInfo, 
-			const buffer_t *inData, 
-			buffer_t *outData)               
-{
-  vtpmloginfo(VTPM_LOG_VTSP, "Binding %d bytes of data.\n", buffer_len(inData));
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_BOUND_DATA boundData;
-  UINT32 i;
-  
-  // Fill boundData's accessory information
-  boundData.ver = TPM_STRUCT_VER_1_1;
-  boundData.payload = TPM_PT_BIND;
-  boundData.payloadData = inData->bytes;
-  
-  // Pack boundData before encryption
-  BYTE* flatBoundData = (BYTE *)malloc(sizeof(BYTE) * 
-				       (sizeof(TPM_VERSION) +
-					sizeof(TPM_PAYLOAD_TYPE) +
-					buffer_len(inData)));
-  if (flatBoundData == NULL) {
-    return TPM_NOSPACE;
-  }
-  UINT32 flatBoundDataSize = 0;
-  flatBoundDataSize = BSG_PackList(  flatBoundData, 2, 
-				     BSG_TPM_VERSION, &boundData.ver, 
-				     BSG_TYPE_BYTE, &boundData.payload);
-  
-  memcpy(flatBoundData+flatBoundDataSize, inData->bytes, buffer_len(inData));
-  flatBoundDataSize += buffer_len(inData);
-  
-  BYTE out_tmp[RSA_KEY_SIZE/8]; // RSAEnc does not do blocking, So this is what will come out.
-  UINT32 out_tmp_size;
-  
-  // Encrypt flatBoundData
-  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_RSAEnc( cryptoInfo, 
-                                           flatBoundDataSize, 
-                                           flatBoundData, 
-                                           &out_tmp_size, 
-                                           out_tmp) );
-  
-  if (out_tmp_size > RSA_KEY_SIZE/8) {
-    // The result of RSAEnc should be a fixed size based on key size.
-    vtpmlogerror(VTPM_LOG_VTSP, "Enc buffer just overflowed.\n");
-  }
-  
-  buffer_init(outData, 0, NULL);
-  buffer_append_raw(outData, out_tmp_size, out_tmp);
-  
-  vtpmloginfo(VTPM_LOG_TXDATA, "Bind Generated[%d] = 0x", out_tmp_size);
-  for(i = 0 ; i < out_tmp_size ; i++) {
-    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out_tmp[i]);
-  }
-  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
-
-  goto egress;
-  abort_egress: 
-  egress:
- 
-  // Free flatBoundData
-  free(flatBoundData);
-  
-  return TPM_SUCCESS;
-}
-
-TPM_RESULT VTSP_Seal(const TCS_CONTEXT_HANDLE    hContext,
-                     const TPM_KEY_HANDLE        keyHandle,
-                     const TPM_AUTHDATA          *sealDataAuth,
-                     const TPM_PCR_COMPOSITE     *pcrComp,
-                     const buffer_t              *inData,
-                     TPM_STORED_DATA             *sealedData,                                   
-                     const TPM_SECRET            *osapSharedSecret,
-                     TCS_AUTH                    *auth) {
-
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_COMMAND_CODE command = TPM_ORD_Seal;
-
-  BYTE *paramText;        // Digest to make Auth.
-  UINT32 paramTextSize;
-
-  // Generate PCR_Info Struct from Comp
-  TPM_PCR_INFO pcrInfo;
-  UINT32 pcrInfoSize, flatpcrSize;
-  BYTE flatpcr[3 +                          // PCR_Select = 3 1 byte banks
-               sizeof(UINT16) +             //              2 byte UINT16
-               sizeof(UINT32) +             // PCR_Comp   = 4 byte UINT32
-               24 * sizeof(TPM_PCRVALUE) ]; //              up to 24 PCRs
-
-  if (pcrComp != NULL) {
-      //printf("\n\tBinding to PCRs: ");
-      //for(int i = 0 ; i < pcrComp->select.sizeOfSelect ; i++)
-      //printf("%2.2x", pcrComp->select.pcrSelect[i]);
-
-      memcpy(&pcrInfo.pcrSelection, &pcrComp->select, sizeof(TPM_PCR_SELECTION));
-
-      flatpcrSize = BSG_Pack(BSG_TPM_PCR_COMPOSITE, (BYTE *) pcrComp, flatpcr);
-      Crypto_SHA1Full((BYTE *) flatpcr, flatpcrSize, (BYTE *) &(pcrInfo.digestAtRelease));
-      memset(&(pcrInfo.digestAtCreation), 0, sizeof(TPM_DIGEST));
-      pcrInfoSize = BSG_Pack(BSG_TPM_PCR_INFO, (BYTE *) &pcrInfo, flatpcr);
-  } else {
-      //printf("\n\tBinding to no PCRS.");
-      pcrInfoSize = 0;
-  }
-
-  // Calculate encUsageAuth
-  BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
-  UINT32 XORbufferSize = sizeof(XORbuffer);
-  TPM_DIGEST XORKey;
-  TPM_ENCAUTH encAuth;
-
-  BSG_PackList( XORbuffer, 2,
-                BSG_TPM_SECRET, osapSharedSecret,
-                BSG_TPM_NONCE, &auth->NonceEven );
-
-  Crypto_SHA1Full(XORbuffer, XORbufferSize, (BYTE *) &XORKey);
-
-  int i;
-  for (i=0; i < TPM_DIGEST_SIZE; i++)
-    ((BYTE *) &encAuth)[i] = ((BYTE *) &XORKey)[i] ^ ((BYTE *) sealDataAuth)[i];
-
-  // Generate Extra TCS Parameters
-  UINT32 inDataSize = buffer_len(inData);
-  struct pack_buf_t inData_pack = {inDataSize, inData->bytes};
-  struct pack_buf_t pcrInfo_pack = {pcrInfoSize, flatpcr};
-
-  UINT32 sealedDataSize;
-  BYTE *flatSealedData=NULL;
-
-  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
-
-  paramTextSize = BSG_PackList(paramText, 4,
-                               BSG_TPM_COMMAND_CODE, &command,
-                               BSG_TPM_ENCAUTH, &encAuth,
-                               BSG_TPM_SIZE32_DATA, &pcrInfo_pack,
-                               BSG_TPM_SIZE32_DATA, &inData_pack);
-
-  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
-                              osapSharedSecret, auth) );
-
-  // Call TCS
-  TPMTRYRETURN( TCSP_Seal( hContext,
-                           keyHandle,
-                           encAuth,
-                           pcrInfoSize,
-                           flatpcr,
-                           inDataSize,
-                           inData->bytes,
-                           auth,
-                           &sealedDataSize,
-                           &flatSealedData) );
-
-  // Unpack/return key structure
-  BSG_Unpack( BSG_TPM_STORED_DATA, flatSealedData, sealedData );
-
-  paramTextSize = BSG_PackList(paramText, 3,
-                               BSG_TPM_RESULT, &status,
-                               BSG_TPM_COMMAND_CODE, &command,
-                               BSG_TPM_STORED_DATA, sealedData);
-
-  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
-                            osapSharedSecret, auth,
-                            0) );
-
-
-  goto egress;
-
- abort_egress:
- egress:
-
-  if (flatSealedData)
-    TCS_FreeMemory( hContext, flatSealedData);
-
-  free(paramText);
-  return status;
-}
-
-
-TPM_RESULT VTSP_Unseal(const TCS_CONTEXT_HANDLE    hContext,
-                       const TPM_KEY_HANDLE        keyHandle,
-                       const TPM_STORED_DATA       *sealedData,
-                       const TPM_AUTHDATA          *key_usage_auth,
-                       const TPM_AUTHDATA          *data_usage_auth,
-                       buffer_t                    *outData,
-                       TCS_AUTH                    *auth,
-                       TCS_AUTH                    *dataAuth) {
-
-  TPM_RESULT status = TPM_SUCCESS;
-  TPM_COMMAND_CODE command = TPM_ORD_Unseal;
-
-  BYTE *paramText;        // Digest to make Auth.
-  UINT32 paramTextSize;
-
-  // Generate Extra TCS Parameters
-  UINT32 sealDataSize, clearDataSize;
-  BYTE *flatSealedData= (BYTE *) malloc(sizeof(TPM_VERSION) +
-                                        2 * sizeof(UINT32) +
-                                        sealedData->sealInfoSize +
-                                        sealedData->encDataSize),
-       *clearData=NULL;
-
-  sealDataSize = BSG_Pack(BSG_TPM_STORED_DATA, sealedData, flatSealedData );
-
-  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
-
-  paramTextSize = BSG_PackList(paramText, 2,
-                               BSG_TPM_COMMAND_CODE, &command,
-                               BSG_TPM_STORED_DATA, sealedData);
-
-  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
-                              key_usage_auth, auth) );
-
-  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
-                              data_usage_auth, dataAuth) );
-  // Call TCS
-  TPMTRYRETURN( TCSP_Unseal(  hContext,
-                              keyHandle,
-                              sealDataSize,
-                              flatSealedData,
-                              auth,
-                              dataAuth,
-                              &clearDataSize,
-                              &clearData) );
-
-  // Verify Auth
-  struct pack_buf_t clearData_pack = {clearDataSize, clearData};
-
-  paramTextSize = BSG_PackList(paramText, 3,
-                               BSG_TPM_RESULT, &status,
-                               BSG_TPM_COMMAND_CODE, &command,
-                               BSG_TPM_SIZE32_DATA, &clearData_pack);
-
-  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
-                            key_usage_auth, auth,
-                            hContext) );
-
-  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
-                            data_usage_auth, dataAuth,
-                            hContext) );
-
-  // Unpack/return key structure
-  TPMTRYRETURN( buffer_init(outData, clearDataSize, clearData) );
-
-  goto egress;
-
- abort_egress:
- egress:
-
-  if (flatSealedData)
-    TCS_FreeMemory( hContext, clearData);
-
-  free(paramText);
-  return status;
-}
-
-TPM_RESULT VTSP_SaveState( const TCS_CONTEXT_HANDLE    hContext) {
-
-  vtpmloginfo(VTPM_LOG_VTSP, "Calling TPM_SaveState.\n");
-
-  TPM_RESULT status = TPM_SUCCESS;
-
-  // Call TCS
-  return ( TCSP_SaveState ( hContext ) );
-
-}
-
-
-// Function Reaches into unsupported TCS command, beware.
-TPM_RESULT VTSP_RawTransmit(const TCS_CONTEXT_HANDLE    hContext,
-                            const buffer_t *inbuf,
-                            buffer_t *outbuf ) {
-  
-  vtpmloginfo(VTPM_LOG_VTSP, "Passthrough in use.\n");
-  TPM_RESULT status = TPM_SUCCESS;
-  
-  // Generate Extra TCS Parameters
-  BYTE *resultText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
-  UINT32 resultTextSize =  TCPA_MAX_BUFFER_LENGTH;
-  
-  // Call TCS                          
-  TPMTRYRETURN( TCSP_RawTransmitData(buffer_len(inbuf), inbuf->bytes, 
-				     &resultTextSize, resultText) );
-  
-  // Unpack/return key structure
-  TPMTRYRETURN(buffer_init (outbuf, resultTextSize, resultText) );                                
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  TCS_FreeMemory(hContext, resultText);
-  free(resultText);
-  return status;
-}
diff --git a/tools/vtpm_manager/manager/vtsp.h b/tools/vtpm_manager/manager/vtsp.h
deleted file mode 100644
index 2fb0440..0000000
--- a/tools/vtpm_manager/manager/vtsp.h
+++ /dev/null
@@ -1,126 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtsp.h
-// 
-//  Higher level interface to TCS.
-//
-// ==================================================================
-
-#ifndef __VTSP_H__
-#define __VTSP_H__
-
-#include "tcg.h"
-#include "tcs.h"
-
-#define KEY_BUFFER_SIZE 2048
-
-TPM_RESULT VTSP_RawTransmit(const TCS_CONTEXT_HANDLE    hContext,
-                            const buffer_t *inbuf,
-                            buffer_t *outbuf );
-
-TPM_RESULT VTSP_OIAP(  const TCS_CONTEXT_HANDLE hContext,
-                       TCS_AUTH *auth);
-                       
-TPM_RESULT VTSP_OSAP(  const TCS_CONTEXT_HANDLE hContext,
-                       const TPM_ENTITY_TYPE entityType,
-                       const UINT32 entityValue,
-                       const TPM_AUTHDATA *usageAuth,
-                       TPM_SECRET *sharedsecret, 
-                       TCS_AUTH *auth);
-
-TPM_RESULT VTSP_TerminateHandle(const TCS_CONTEXT_HANDLE hContext,
-                                const TCS_AUTH *auth);
-
-TPM_RESULT VTSP_ReadPubek(   const TCS_CONTEXT_HANDLE hContext,
-                             CRYPTO_INFO *cypto_info);
-
-TPM_RESULT VTSP_TakeOwnership(   const TCS_CONTEXT_HANDLE hContext,
-                                 const TPM_AUTHDATA *ownerAuth, 
-                                 const TPM_AUTHDATA *srkAuth,
-                                 CRYPTO_INFO *ek_cryptoInfo,
-                                 TCS_AUTH *auth);
-                               
-TPM_RESULT VTSP_DisablePubekRead( const TCS_CONTEXT_HANDLE    hContext,
-                                  const TPM_AUTHDATA *ownerAuth, 
-                                  TCS_AUTH                    *auth);
-                               
-TPM_RESULT VTSP_CreateWrapKey(  const TCS_CONTEXT_HANDLE hContext,
-                                const TPM_KEY_USAGE      usage,
-                                const TPM_AUTHDATA       *newKeyAuth,
-                                const TCS_KEY_HANDLE     parentHandle, 
-                                const TPM_AUTHDATA       *osapSharedSecret,
-                                buffer_t                 *pubKeyBuf,
-                                TCS_AUTH                 *auth);
-
-TPM_RESULT VTSP_LoadKey(const TCS_CONTEXT_HANDLE    hContext,
-                        const TCS_KEY_HANDLE        hUnwrappingKey,
-                        const buffer_t              *rgbWrappedKeyBlob,
-                        const TPM_AUTHDATA          *parentAuth,
-                        TPM_HANDLE                  *newKeyHandle,
-                        TCS_AUTH                    *pAuth,
-                        CRYPTO_INFO                 *cryptoinfo,
-                        const BOOL                  skipTPMLoad);
-
-TPM_RESULT VTSP_Unbind( const TCS_CONTEXT_HANDLE    hContext,
-                        const TPM_KEY_HANDLE        key_handle,
-                        const buffer_t              *bound_data,
-                        const TPM_AUTHDATA          *usage_auth,
-                        buffer_t                    *clear_data,
-                        TCS_AUTH                    *auth);
-                        
-TPM_RESULT VTSP_Bind(   CRYPTO_INFO *cryptoInfo,
-            const buffer_t *inData, 
-            buffer_t *outData);
-                        
-TPM_RESULT VTSP_Seal(const TCS_CONTEXT_HANDLE    hContext,
-                     const TPM_KEY_HANDLE        keyHandle,
-                     const TPM_AUTHDATA          *sealDataAuth,
-                     const TPM_PCR_COMPOSITE     *pcrComp,
-                     const buffer_t              *inData,
-                     TPM_STORED_DATA             *sealedData,                                   
-                     const TPM_SECRET            *osapSharedSecret,
-                     TCS_AUTH                    *auth);
-
-TPM_RESULT VTSP_Unseal(const TCS_CONTEXT_HANDLE    hContext,
-                       const TPM_KEY_HANDLE        keyHandle,
-                       const TPM_STORED_DATA       *sealedData,
-                       const TPM_AUTHDATA          *key_usage_auth,
-                       const TPM_AUTHDATA          *data_usage_auth,
-                       buffer_t                    *outData,
-                       TCS_AUTH                    *auth,
-                       TCS_AUTH                    *dataAuth);
-
-TPM_RESULT VTSP_SaveState( const TCS_CONTEXT_HANDLE    hContext);
-
-#endif //_VTSP_H_
diff --git a/tools/vtpm_manager/migration/Makefile b/tools/vtpm_manager/migration/Makefile
deleted file mode 100644
index e33ae95..0000000
--- a/tools/vtpm_manager/migration/Makefile
+++ /dev/null
@@ -1,42 +0,0 @@
-XEN_ROOT = $(CURDIR)/../../..
-include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
-
-VPATH = ../manager
-
-BIND		= vtpm_migratord
-BINC		= vtpm_migrator
-
-SRCSD    = vtpm_manager_if.c vtpm_migratord.c vtpm_migratord_handler.c vtpm_ipc.c
-SRCSC    = vtpm_manager_if.c vtpm_migrator_if.c vtpm_migratorc.c vtpm_ipc.c
-
-OBJSD    = $(patsubst %.c,%.o,$(SRCSD))
-OBJSC    = $(patsubst %.c,%.o,$(SRCSC))
-
-.PHONY: all
-all: build
-
-.PHONY: build
-build: $(BIND) $(BINC)
-
-.PHONY: install
-install: build
-	$(INSTALL_PROG) $(BIND) $(DESTDIR)$(BINDIR)
-	$(INSTALL_PROG) $(BINC) $(DESTDIR)$(BINDIR)
-
-.PHONY: clean
-clean:
-	rm -f $(BINC) $(BIND)
-	rm -f *.a *.so *.o *.rpm $(DEP_FILES)
-
-.PHONY: mrproper
-mrproper: clean
-	rm -f *~
-
-$(BIND): $(OBJSD)
-	$(CC) $(LDFLAGS) $^ $(LIBS) -o $@
-
-$(BINC): $(OBJSC)
-	$(CC) $(LDFLAGS) $^ $(LIBS) -o $@
-
-# libraries
-LIBS += ../util/libTCGUtils.a
diff --git a/tools/vtpm_manager/migration/vtpm_manager_if.c b/tools/vtpm_manager/migration/vtpm_manager_if.c
deleted file mode 100644
index 08986f4..0000000
--- a/tools/vtpm_manager/migration/vtpm_manager_if.c
+++ /dev/null
@@ -1,186 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtpm_manager_if.c
-// 
-//  Provides functions to call local vtpm manager interface (Hotplug)
-//
-// ==================================================================
-
-#include <stdio.h>
-#include <fcntl.h>
-#include <malloc.h>
-#include <string.h>
-
-#include "tcg.h"
-#include "buffer.h"
-#include "log.h"
-#include "vtpm_ipc.h"
-#include "bsg.h"
-#include "vtpm_migrator.h"
-#include "vtpm_manager.h"
-
-#define VTPM_TX_HP_FNAME       "/var/vtpm/fifos/from_console.fifo"
-#define VTPM_RX_HP_FNAME       "/var/vtpm/fifos/to_console.fifo"
-
-static vtpm_ipc_handle_t tx_ipc_h, rx_ipc_h;
-
-TPM_RESULT vtpm_manager_open(){
-
-  if ( (vtpm_ipc_init(&tx_ipc_h,  VTPM_TX_HP_FNAME, O_RDWR, TRUE) != 0) ||  //FIXME: wronly
-       (vtpm_ipc_init(&rx_ipc_h,  VTPM_RX_HP_FNAME, O_RDWR, TRUE) != 0) ) { //FIXME: rdonly
-    vtpmlogerror(VTPM_LOG_VTPM, "Unable to connect to vtpm_manager.\n");
-    return TPM_IOERROR;
-  } 
-
-  return TPM_SUCCESS;
-}
-
-void vtpm_manager_close() {
-
-  vtpm_ipc_close(&tx_ipc_h);
-  vtpm_ipc_close(&rx_ipc_h);
-}
-
-
-TPM_RESULT vtpm_manager_command(TPM_COMMAND_CODE ord,
-                                buffer_t *command_param_buf,
-                                TPM_RESULT *cmd_status, /* out */
-                                buffer_t *result_param_buf) {
-
-  TPM_RESULT status = TPM_FAIL;
-  int  size_read, size_write, i;
-  BYTE *adj_command, response_header[VTPM_COMMAND_HEADER_SIZE_SRV];
-  UINT32 dmi_id=0, adj_command_size, out_param_size, adj_param_size;
-  TPM_TAG tag=VTPM_TAG_REQ;
-
-  if ( (!command_param_buf) || (!result_param_buf) || (!cmd_status) ) {
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }   
-  
-  adj_command_size = VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(command_param_buf);
-  adj_command = (BYTE *) malloc( adj_command_size );
-  if (!adj_command) {
-    status = TPM_RESOURCES;
-    goto abort_egress;
-  }
-
-  out_param_size = VTPM_COMMAND_HEADER_SIZE + buffer_len(command_param_buf);
-  BSG_PackList(adj_command, 4,
-                 BSG_TYPE_UINT32, &dmi_id,
-                 BSG_TPM_TAG, &tag,
-                 BSG_TYPE_UINT32, &out_param_size,
-                 BSG_TPM_COMMAND_CODE, &ord );
-
-  memcpy(adj_command + VTPM_COMMAND_HEADER_SIZE_SRV, command_param_buf->bytes, buffer_len(command_param_buf));
-
-  size_write = vtpm_ipc_write(&tx_ipc_h, NULL, adj_command, adj_command_size);
-
-  if (size_write > 0) {
-    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT (MGR): 0x");
-    for (i=0; i< adj_command_size; i++) {
-      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", adj_command[i]);
-    }
-    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-  } else {
-    vtpmlogerror(VTPM_LOG_VTPM, "Error writing VTPM Manager console.\n");
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  if (size_write != (int) adj_command_size )
-    vtpmlogerror(VTPM_LOG_VTPM, "Could not write entire command to mgr (%d/%d)\n", size_write, adj_command_size);
-
-  // Read header for response to manager command
-  size_read = vtpm_ipc_read(&rx_ipc_h, NULL, response_header, VTPM_COMMAND_HEADER_SIZE_SRV);
-  if (size_read > 0) {
-    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV (MGR): 0x");
-    for (i=0; i<size_read; i++)
-      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", response_header[i]);
-
-  } else {
-    vtpmlogerror(VTPM_LOG_VTPM, "Error reading from vtpm manager.\n");
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Command from vtpm_manager shorter than std header.\n");
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  // Unpack response from DMI for TPM command
-  BSG_UnpackList(response_header, 4,
-                 BSG_TYPE_UINT32, &dmi_id,
-                 BSG_TPM_TAG, &tag,
-                 BSG_TYPE_UINT32, &out_param_size,
-                 BSG_TPM_COMMAND_CODE, cmd_status );
-
-  // If response has parameters, read them.
-  // Note that out_param_size is in the client's context
-  adj_param_size = out_param_size - VTPM_COMMAND_HEADER_SIZE;
-  if (adj_param_size > 0) {
-    TPMTRYRETURN( buffer_init( result_param_buf, adj_param_size, NULL) );
-    size_read = vtpm_ipc_read(&rx_ipc_h, NULL, result_param_buf->bytes, adj_param_size);
-    if (size_read > 0) {
-      for (i=0; i< size_read; i++)
-        vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_param_buf->bytes[i]);
-
-    } else {
-      vtpmlogerror(VTPM_LOG_VTPM, "Error reading from vtpm manager.\n");
-      goto abort_egress;
-    }
-    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
-
-    if (size_read < (int)adj_param_size) {
-      vtpmloginfomore(VTPM_LOG_VTPM, "\n");
-      vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
-      status = TPM_IOERROR;
-      goto abort_egress;
-    }
-  } else {
-    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
-  }
-
-  status=TPM_SUCCESS;
-  goto egress;
-
- abort_egress:
- egress:
-
-  return status;
-}
-
-
diff --git a/tools/vtpm_manager/migration/vtpm_migrator.h b/tools/vtpm_manager/migration/vtpm_migrator.h
deleted file mode 100644
index 8d52e66..0000000
--- a/tools/vtpm_manager/migration/vtpm_migrator.h
+++ /dev/null
@@ -1,104 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtpm_migrator.h
-// 
-//  Public Interface header for VTPM Migrator 
-//
-// ==================================================================
-
-#ifndef __VTPM_MIGRATOR_H__
-#define __VTPM_MIGRATOR_H__
-
-#define VTPM_MTAG_REQ 0x02c1
-#define VTPM_MTAG_RSP 0x02c4
-
-// Header sizes. 
-#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
-//               sizeof(TPM_TAG + UINT32 + TPM_COMMAND_CODE)
-
-//*********************** Connection Info **************************
-#define VTPM_MIG_PORT 48879 
-
-//************************ Command Codes ***************************
-#define VTPM_MORD_MIG_STEP1     0x00
-#define VTPM_MORD_MIG_STEP2     0x01
-#define VTPM_MORD_MIG_STEP3     0x02
-#define VTPM_MORD_MIG_STEP4     0x03
-
-//************************ Return Codes ****************************
-#define VTPM_SUCCESS               0
-#define VTPM_FAIL                  1
-
-/******************* Command Parameter API *************************
-
-VTPM Command Format
-  tpm tag: 2 bytes
-  command size: 4 bytes         // Size of command including header but not DMI
-  ord: 4 bytes                  // Command ordinal above
-  parameters: size - 10 bytes   // Command Parameter
-
-VTPM Response Format
-  tpm tag: 2 bytes
-  response_size: 4 bytes
-  status: 4 bytes         
-  parameters: size - 10 bytes
-
-
-VTPM_Mig_Phase1:
-    Unsupported: (Handled by scripts)
-    
-VTPM_Mig_Phase2
-  Input Parameters:
-    domain_name_size: 4 bytes
-    domain_name : domain_name_size bytes
-  Output Parameters:
-    pub_exp_size: 4 bytes
-    pub_exp: pub_exp_size bytes
-    pub_mod_size: 4 bytes
-    pub_mod: pub_mod_size bytes
-
-VTPM_Mig_Phase3
-  Input Parameters:
-    vtpm_state_size: 4 bytes
-    vtpm_state: vtpm_state_size bytes
-  Output Parameters:
-    none
-
-VTPM_Mig_Phase4
-    Unsupported: (Handled by scripts)
-
-
-*********************************************************************/
-
-#endif //_VTPM_MANAGER_H_
diff --git a/tools/vtpm_manager/migration/vtpm_migrator_if.c b/tools/vtpm_manager/migration/vtpm_migrator_if.c
deleted file mode 100644
index de48b2d..0000000
--- a/tools/vtpm_manager/migration/vtpm_migrator_if.c
+++ /dev/null
@@ -1,219 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// vtpm_migrator_if.c
-// 
-//  Provides functions to call open network connection & call
-//  a function on the vtpm_migratord on the destination
-//
-// ==================================================================
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <string.h>
-#include <malloc.h>
-
-#include "tcg.h"
-#include "buffer.h"
-#include "log.h"
-#include "bsg.h"
-#include "vtpm_migrator.h"
-
-static int sock_desc;
-
-
-TPM_RESULT vtpm_migratord_open(char *server_address){
-
-  TPM_RESULT status = TPM_FAIL;
-
-  /* network variables */
-  struct in_addr ip_addr;
-  struct sockaddr_in server_addr;
-  int addr_len;
-  struct hostent *dns_info=NULL;
-
-  /* set up connection to server*/
-  dns_info = gethostbyname(server_address);
-  ip_addr.s_addr = *((unsigned long *) dns_info->h_addr_list[0]);
-
-  if(ip_addr.s_addr < 0) {
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  /* set up server variable */
-  memset((char *)&server_addr, 0, sizeof(server_addr));
-  server_addr.sin_family = AF_INET;
-  server_addr.sin_port = htons(VTPM_MIG_PORT);
-  server_addr.sin_addr.s_addr = ip_addr.s_addr;
-
-  /* open socket, make connection */
-  sock_desc = socket(AF_INET, SOCK_STREAM, 0);
-
-  if (sock_desc < 0 ) {
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  if (connect(sock_desc,
-              (struct sockaddr *)&server_addr,
-              sizeof(server_addr)) < 0 ) {
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  status = TPM_SUCCESS;
-  goto egress;
-
- abort_egress:
- egress:
-
-  return status;
-}
-
-void vtpm_migratord_close() {
-  close(sock_desc);
-}
-
-
-TPM_RESULT vtpm_migratord_command(TPM_COMMAND_CODE ord,
-                                buffer_t *command_param_buf,
-                                TPM_RESULT *cmd_status, /* out */
-                                buffer_t *result_param_buf) {
-
-  TPM_RESULT status = TPM_FAIL;
-  int  size_read, size_write, i;
-  BYTE *command, response_header[VTPM_COMMAND_HEADER_SIZE];
-  UINT32 dmi_id=0, command_size, out_param_size, adj_param_size;
-  TPM_TAG tag=VTPM_MTAG_REQ;
-
-  if ( (!command_param_buf) || (!result_param_buf) || (!cmd_status) ) {
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }   
-  
-  command_size = VTPM_COMMAND_HEADER_SIZE + buffer_len(command_param_buf);
-  command = (BYTE *) malloc( command_size );
-  if (!command) {
-    status = TPM_RESOURCES;
-    goto abort_egress;
-  }
-
-  BSG_PackList(command, 3,
-                 BSG_TPM_TAG, &tag,
-                 BSG_TYPE_UINT32, &command_size,
-                 BSG_TPM_COMMAND_CODE, &ord );
-
-  memcpy(command + VTPM_COMMAND_HEADER_SIZE, command_param_buf->bytes, buffer_len(command_param_buf));
-
-  size_write = write(sock_desc, command, command_size);
-
-  if (size_write > 0) {
-    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT (MIGd): 0x");
-    for (i=0; i< command_size; i++) {
-      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", command[i]);
-    }
-    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-  } else {
-    vtpmlogerror(VTPM_LOG_VTPM, "Error writing to migration server via network.\n");
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  if (size_write != (int) command_size )
-    vtpmlogerror(VTPM_LOG_VTPM, "Could not write entire command to migration server (%d/%d)\n", size_write, command_size);
-
-  // Read header for response 
-  size_read = read(sock_desc, response_header, VTPM_COMMAND_HEADER_SIZE);
-  if (size_read > 0) {
-    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV (MIGd): 0x");
-    for (i=0; i<size_read; i++)
-      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", response_header[i]);
-
-  } else {
-    vtpmlogerror(VTPM_LOG_VTPM, "Error reading from Migration Server.\n");
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE) {
-    vtpmlogerror(VTPM_LOG_VTPM, "Command from migration server shorter than std header.\n");
-    status = TPM_IOERROR;
-    goto abort_egress;
-  }
-
-  // Unpack response from DMI for TPM command
-  BSG_UnpackList(response_header, 3,
-                 BSG_TPM_TAG, &tag,
-                 BSG_TYPE_UINT32, &out_param_size,
-                 BSG_TPM_COMMAND_CODE, cmd_status );
-
-  // If response has parameters, read them.
-  adj_param_size = out_param_size - VTPM_COMMAND_HEADER_SIZE;
-  if (adj_param_size > 0) {
-    TPMTRYRETURN( buffer_init( result_param_buf, adj_param_size, NULL) );
-    size_read = read(sock_desc, result_param_buf->bytes, adj_param_size);
-    if (size_read > 0) {
-      for (i=0; i< size_read; i++)
-        vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_param_buf->bytes[i]);
-
-    } else {
-      vtpmlogerror(VTPM_LOG_VTPM, "Error reading from migration server.\n");
-      goto abort_egress;
-    }
-    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
-
-    if (size_read < (int)adj_param_size) {
-      vtpmloginfomore(VTPM_LOG_VTPM, "\n");
-      vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
-      status = TPM_IOERROR;
-      goto abort_egress;
-    }
-  } else {
-    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
-  }
-
-  status=TPM_SUCCESS;
-  goto egress;
-
- abort_egress:
- egress:
-
-  return status;
-}
-
-
diff --git a/tools/vtpm_manager/migration/vtpm_migratorc.c b/tools/vtpm_manager/migration/vtpm_migratorc.c
deleted file mode 100644
index 18b3bdb..0000000
--- a/tools/vtpm_manager/migration/vtpm_migratorc.c
+++ /dev/null
@@ -1,211 +0,0 @@
-// ===================================================================
-//
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above
-//     copyright notice, this list of conditions and the following
-//     disclaimer in the documentation and/or other materials provided
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-
-#include <stdio.h>
-#include <string.h>
-
-#include "tcg.h"
-#include "log.h"
-#include "bsg.h"
-#include "buffer.h"
-#include "vtpm_migrator.h"
-#include "vtpm_manager.h"
-
-TPM_RESULT handle_vtpm_mig_step2(char *server_addr, 
-                                 char *name, 
-                                 UINT32 instance) {
-  TPM_RESULT status, cmd_status;
-  buffer_t out_param_buf=NULL_BUF, mig_key_buf=NULL_BUF, empty_buf=NULL_BUF;
-  UINT32 offset; 
-  struct pack_buf_t addr_data32;
-
-  //===== Get Destination's Public Migration Key ======
-  TPMTRYRETURN( vtpm_migratord_open(server_addr) );
-
-  TPMTRYRETURN( vtpm_migratord_command(VTPM_MORD_MIG_STEP2,
-                                     &out_param_buf,
-                                     &cmd_status, 
-                                     &mig_key_buf) ); 
-  vtpm_migratord_close();
-
-  TPMTRYRETURN(cmd_status);
-
-  //===== Load migration key into vtpm_manager ========
-
-  addr_data32.data = (BYTE *)server_addr;
-  addr_data32.size = strlen(server_addr) + 1; // Include the null
-
-  TPMTRYRETURN ( buffer_init ( &out_param_buf, 
-                               sizeof(UINT32) + addr_data32.size +buffer_len(&mig_key_buf),
-                               NULL ) ) ;
-
-  offset =  BSG_PackList(out_param_buf.bytes, 1,
-               BSG_TPM_SIZE32_DATA, &addr_data32);
-
-  memcpy(out_param_buf.bytes + offset , mig_key_buf.bytes, buffer_len(&mig_key_buf) );
-
-  TPMTRYRETURN ( vtpm_manager_open() );
-
-  TPMTRYRETURN ( vtpm_manager_command(VTPM_ORD_LOAD_MIG_KEY,
-                                      &out_param_buf,
-                                      &cmd_status,
-                                      &empty_buf) );
-
-  vtpm_manager_close();
-
-  TPMTRYRETURN(cmd_status);
-
-  goto egress;
-
- abort_egress:
- egress:
-
-  buffer_free(&mig_key_buf);
-  buffer_free(&out_param_buf);
-
-  return status;
-}
-
-
-TPM_RESULT handle_vtpm_mig_step3(char *server_addr, 
-                                 char *name, 
-                                 UINT32 instance) {
-  TPM_RESULT status, cmd_status;
-  buffer_t out_param_buf=NULL_BUF, state_buf=NULL_BUF, empty_buf=NULL_BUF;
-  struct pack_buf_t addr_data32, name_data32, state_data32;
-
-  //===== Get vtpm state from vtpm_manager ========
-  addr_data32.data = (BYTE *)server_addr;
-  addr_data32.size = strlen(server_addr) + 1; // Include the null
-
-  TPMTRYRETURN ( buffer_init ( &out_param_buf,
-                               (2 * sizeof(UINT32)) + addr_data32.size,
-                               NULL ) ) ;
-
-  BSG_PackList(out_param_buf.bytes, 2,
-                 BSG_TYPE_UINT32, &instance, 
-                 BSG_TPM_SIZE32_DATA, &addr_data32);
-
-  TPMTRYRETURN ( vtpm_manager_open() );
-
-  TPMTRYRETURN ( vtpm_manager_command(VTPM_ORD_MIGRATE_OUT,
-                                      &out_param_buf,
-                                      &cmd_status,
-                                      &state_buf) );
-
-  vtpm_manager_close();
-
-  TPMTRYRETURN(cmd_status);
-
-  TPMTRYRETURN( buffer_free( &out_param_buf ) );
-
-  //===== Send vtpm state to destination ======
-  name_data32.data = (BYTE *)name;
-  name_data32.size = strlen(name) + 1; // Include the null
-  state_data32.data = state_buf.bytes;
-  state_data32.size = buffer_len(&state_buf);
-
-  TPMTRYRETURN( buffer_init( &out_param_buf,
-                             2 * sizeof(UINT32) + name_data32.size + state_data32.size,
-                             NULL ) ) ;
-                             
-  BSG_PackList(out_param_buf.bytes, 2,
-                 BSG_TPM_SIZE32_DATA, &name_data32,
-                 BSG_TPM_SIZE32_DATA, &state_data32);
-
-  TPMTRYRETURN( vtpm_migratord_open(server_addr) );
-
-  TPMTRYRETURN( vtpm_migratord_command(VTPM_MORD_MIG_STEP3,
-                                     &out_param_buf,
-                                     &cmd_status, 
-                                     &empty_buf) ); 
-  vtpm_migratord_close();
-
-  TPMTRYRETURN(cmd_status);
-
-  goto egress;
-
- abort_egress:
- egress:
-
-  buffer_free( &out_param_buf);
-  buffer_free( &state_buf);
-  buffer_free( &empty_buf);
-
-  return status;
-}
-
-
-// Usage vtpm_migrator addr domain_name instance step
-
-int main(int argc, char **argv) {
-
-    /* variables for processing of command */
-    TPM_RESULT status = TPM_FAIL;
-    char *server_addr, *name;
-    UINT32 instance, step;
-
-    if (argc != 5) {
-      vtpmlogerror(VTPM_LOG_VTPM, "Usage: vtpm_migrator addr vm_name instance step\n");
-      vtpmlogerror(VTPM_LOG_VTPM, "       params given %d\n", argc);
-      status= TPM_BAD_PARAMETER;
-      goto abort_egress;
-    }
-
-    server_addr = argv[1];
-    name = argv[2];
-    instance = atoi( argv[3] );
-    step = atoi( argv[4] );    
-
-    switch (step) {
-    case VTPM_MORD_MIG_STEP2:
-      status = handle_vtpm_mig_step2(server_addr, name, instance);
-      break;
- 
-    case VTPM_MORD_MIG_STEP3:
-      status = handle_vtpm_mig_step3(server_addr, name, instance);
-      break;
-
-    default:
-      status = TPM_BAD_PARAMETER;
-      goto abort_egress;
-      break;
-    }
- 
-    goto egress;
- abort_egress:
- egress:
-
-    return status;
-}
-
diff --git a/tools/vtpm_manager/migration/vtpm_migratord.c b/tools/vtpm_manager/migration/vtpm_migratord.c
deleted file mode 100644
index ea18c8c..0000000
--- a/tools/vtpm_manager/migration/vtpm_migratord.c
+++ /dev/null
@@ -1,202 +0,0 @@
-// ===================================================================
-//
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above
-//     copyright notice, this list of conditions and the following
-//     disclaimer in the documentation and/or other materials provided
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <string.h>
-
-#include "tcg.h"
-#include "log.h"
-#include "bsg.h"
-#include "buffer.h"
-#include "vtpm_migrator.h"
-
-void build_error_msg( buffer_t *buf, TPM_RESULT status) {
-  TPM_TAG tag = VTPM_MTAG_RSP;
-  UINT32 out_param_size = VTPM_COMMAND_HEADER_SIZE;
-
-  buffer_init(buf, out_param_size, NULL);
- 
-  BSG_PackList(buf->bytes, 3,
-                 BSG_TPM_TAG, &tag,
-                 BSG_TYPE_UINT32, &out_param_size,
-                 BSG_TPM_RESULT, &status );
-}
-
-int main() {
-
-    /* network variables */
-    int sock_descr, client_sock=-1, len;
-    struct sockaddr_in addr;
-    struct sockaddr_in client_addr;
-    unsigned int client_length;
-    int bytes;
-
-    /* variables for processing of command */
-    TPM_RESULT status = TPM_FAIL;
-    BYTE cmd_header[VTPM_COMMAND_HEADER_SIZE];
-    TPM_TAG tag;
-    TPM_COMMAND_CODE ord;
-    UINT32 in_param_size, adj_param_size;
-    int i, size_read, size_write;
-    buffer_t in_param_buf=NULL_BUF, result_buf=NULL_BUF;
-
-
-    /* setup socket */
-    sock_descr = socket(AF_INET, SOCK_STREAM, 0);
-
-    memset(&addr, 0, sizeof(addr));
-    addr.sin_family = AF_INET;
-    addr.sin_addr.s_addr = htonl(INADDR_ANY);
-    addr.sin_port = htons(VTPM_MIG_PORT);
-
-    if (bind(sock_descr, (struct sockaddr *)&addr, sizeof(addr)) == -1 ) {
-        vtpmlogerror(VTPM_LOG_VTPM, "Failed to bind to port %d.\n", VTPM_MIG_PORT);
-        return 1;
-    }
-        
-    listen(sock_descr, 10);
-
-    for(;;) {
-        // ============ clear client info and wait for connection ==========
-        memset(&client_addr, 0, sizeof(client_addr));
-        client_length = sizeof(client_addr);
-
-        vtpmloginfo(VTPM_LOG_VTPM, "Waiting for incoming migrations...\n");
-        client_sock=accept(sock_descr, &client_addr, &client_length);
-        if (client_sock == -1) {
-            vtpmlogerror(VTPM_LOG_VTPM, "Incoming connectionn failed.\n");
-            goto abort_command;
-        } else {
-            vtpmloginfo(VTPM_LOG_VTPM, "Incoming connection accepted.\n");
-        }
-
-        // =================== Read incoming command ======================
-        size_read = read( client_sock, cmd_header, VTPM_COMMAND_HEADER_SIZE);
-        if (size_read > 0) {
-            vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV: 0x");
-            for (i=0; i<size_read; i++)
-                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
-
-        } else {
-            vtpmlogerror(VTPM_LOG_VTPM, "Error reading from socket.\n");
-            build_error_msg(&result_buf, TPM_IOERROR);
-            goto abort_command_with_error;
-        }
-
-        if (size_read < (int) VTPM_COMMAND_HEADER_SIZE) {
-            vtpmlogerror(VTPM_LOG_VTPM, "Command from socket shorter than std header.\n");
-            build_error_msg(&result_buf, TPM_BAD_PARAMETER);
-            goto abort_command_with_error;
-        }
-
-        // Unpack response from client
-        BSG_UnpackList(cmd_header, 3,
-                       BSG_TPM_TAG, &tag,
-                       BSG_TYPE_UINT32, &in_param_size,
-                       BSG_TPM_COMMAND_CODE, &ord );
-
-
-        // If response has parameters, read them.
-        // Note that out_param_size is in the client's context
-        adj_param_size = in_param_size - VTPM_COMMAND_HEADER_SIZE;
-        if (adj_param_size > 0) {
-            buffer_init( &in_param_buf, adj_param_size, NULL);
-            size_read = read(client_sock, in_param_buf.bytes, adj_param_size);
-            if (size_read > 0) {
-                for (i=0; i< size_read; i++)
-                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param_buf.bytes[i]);
-
-            } else {
-                vtpmlogerror(VTPM_LOG_VTPM, "Error reading from socket.\n");
-                build_error_msg(&result_buf, TPM_IOERROR);
-                goto abort_command_with_error;
-            }
-            vtpmloginfomore(VTPM_LOG_VTPM, "\n");
-
-            if (size_read < (int)adj_param_size) {
-                vtpmloginfomore(VTPM_LOG_VTPM, "\n");
-                vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
-                build_error_msg(&result_buf, TPM_BAD_PARAMETER);
-                goto abort_command_with_error;
-            }
-        } else {
-            vtpmloginfomore(VTPM_LOG_VTPM, "\n");
-        }
-
-        /* Handle Command */
-        switch (ord) {
-        case VTPM_MORD_MIG_STEP2:
-          handle_vtpm_mig_step2(&in_param_buf, &result_buf);
-          break;
- 
-        case VTPM_MORD_MIG_STEP3:
-          handle_vtpm_mig_step3(&in_param_buf, &result_buf);
-          break;
-
-        default:
-            build_error_msg(&result_buf, TPM_BAD_PARAMETER);
-            goto abort_command_with_error;
-        }
-
-  abort_command_with_error:
-        /* Write Response */
-        size_write = write(client_sock, result_buf.bytes, buffer_len(&result_buf));
-
-        if (size_write > 0) {
-            vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT: 0x");
-            for (i=0; i< buffer_len(&result_buf); i++) {
-                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_buf.bytes[i]);
-            }
-            vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
-        } else {
-            vtpmlogerror(VTPM_LOG_VTPM, "Error writing response to client.\n");
-            goto abort_command;
-        }
-
-        if (size_write != (int) buffer_len(&result_buf) )
-           vtpmlogerror(VTPM_LOG_VTPM, "Could not send entire response to client(%d/%d)\n", size_write, buffer_len(&result_buf));
-
-  abort_command:
-        close(client_sock);
-        buffer_free(&in_param_buf);
-        buffer_free(&result_buf);
-
-    } // For (;;)
-
-    return 0;
-}
-
diff --git a/tools/vtpm_manager/migration/vtpm_migratord_handler.c b/tools/vtpm_manager/migration/vtpm_migratord_handler.c
deleted file mode 100644
index 0a8a2d5..0000000
--- a/tools/vtpm_manager/migration/vtpm_migratord_handler.c
+++ /dev/null
@@ -1,177 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "tcg.h"
-#include "bsg.h"
-#include "log.h"
-#include "vtpm_migrator.h"
-#include "vtpm_manager.h"
-
-#define VTPM_SH_CMD_HDR  "bash -c \"cd /etc/xen/scripts; source /etc/xen/scripts/vtpm-common.sh;"
-#define VTPM_SH_CMD_FTR  "\""
-#define VTPM_SH_GETINST  "vtpmdb_get_free_instancenum"
-#define VTPM_SH_ADD      "vtpm_add_and_activate"
-#define VTPM_SH_RESUME   "vtpm_resume"
-
-// This must be updated to the longest command name. Currently GETINST
-#define VTPM_SH_CMD_SIZE (strlen(VTPM_SH_CMD_HDR) + strlen(VTPM_SH_CMD_FTR) + 1 + strlen(VTPM_SH_GETINST) + 2)
-
-void handle_vtpm_mig_step2(buffer_t *in_param_buf, buffer_t *result_buf)
-{
-  TPM_TAG tag = VTPM_TAG_RSP;
-  buffer_t out_param_buf= NULL_BUF, mig_key_buf=NULL_BUF; 
-  TPM_RESULT status=TPM_SUCCESS, cmd_status;
-  UINT32 out_param_size;
-  
-  if ( (!in_param_buf) || (!result_buf) ) {
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  // ================= Call manager and get mig key ===============
-  TPMTRYRETURN( vtpm_manager_open() ); 
-  TPMTRYRETURN( vtpm_manager_command(VTPM_ORD_GET_MIG_KEY,
-                                     &out_param_buf, // Empty
-                                     &cmd_status,
-                                     &mig_key_buf) );
-  
-  vtpm_manager_close();
-
-  TPMTRYRETURN(cmd_status);
-
-  // ==================== return the  mig key =====================
-  out_param_size =  VTPM_COMMAND_HEADER_SIZE + buffer_len(&mig_key_buf);
-
-  TPMTRYRETURN( buffer_init(result_buf, 
-                            out_param_size,
-                            NULL) );
-
-  BSG_PackList( result_buf->bytes, 3,
-                  BSG_TPM_TAG, &tag,
-                  BSG_TYPE_UINT32, &out_param_size,
-                  BSG_TPM_RESULT, &status);
-
-  memcpy(result_buf->bytes + VTPM_COMMAND_HEADER_SIZE, 
-         mig_key_buf.bytes, buffer_len(&mig_key_buf));
-
-  goto egress;
-
- abort_egress:
-  buffer_free(result_buf);
-  build_error_msg(result_buf, status);
-
- egress:
-  return;
-}
-
-void handle_vtpm_mig_step3(buffer_t *in_param_buf, buffer_t *result_buf)
-{
-  TPM_TAG tag = VTPM_TAG_RSP;
-  buffer_t out_param_buf= NULL_BUF, mig_key_buf=NULL_BUF, empty_buf=NULL_BUF;
-  TPM_RESULT status=TPM_SUCCESS, cmd_status;
-  UINT32 out_param_size, instance;
-  char *shell_cmd_str=NULL;
-  size_t shell_cmd_strlen;
-  FILE *shell_f=NULL;
-
-  if ( (!in_param_buf) || (!result_buf) ) {
-    status = TPM_BAD_PARAMETER;
-    goto abort_egress;
-  }
-
-  // ================= Read Parameters ===============
-  struct pack_buf_t name_data32, state_data32;
-
-  BSG_UnpackList(in_param_buf->bytes, 2,
-                 BSG_TPM_SIZE32_DATA, &name_data32,
-                 BSG_TPM_SIZE32_DATA, &state_data32);
-
-  // Before using this string, protect us from a non-null term array.
-  if (name_data32.data[name_data32.size -1] != 0x00) {
-    name_data32.data[name_data32.size -1] = 0x00;
-  }
-
-  // ====== Call hotplug-script and get an instance ======
-  shell_cmd_strlen = VTPM_SH_CMD_SIZE + name_data32.size + 10;
-  shell_cmd_str = (char *) malloc(shell_cmd_strlen); // 10 is just padding for the UINT32
-
-  snprintf(shell_cmd_str, shell_cmd_strlen,
-	VTPM_SH_CMD_HDR VTPM_SH_GETINST VTPM_SH_CMD_FTR);
-
-  shell_f = popen(shell_cmd_str, "r");
-  fscanf(shell_f, "%d", &instance);
-  pclose(shell_f);
-  
-  // ====== Call hotplug-script and add instance ======
-  snprintf(shell_cmd_str, shell_cmd_strlen,
-	VTPM_SH_CMD_HDR VTPM_SH_ADD " %s %d" VTPM_SH_CMD_FTR,
-	name_data32.data, instance);
-  system(shell_cmd_str);
-
-  // ========= Call vtpm_manager and load VTPM =======
-  TPMTRYRETURN( buffer_init( &out_param_buf, 
-                             2*sizeof(UINT32) + state_data32.size,
-                             NULL) );
-
-  BSG_PackList(out_param_buf.bytes, 2,
-                 BSG_TYPE_UINT32, &instance,
-                 BSG_TPM_SIZE32_DATA, &state_data32);
-
-  TPMTRYRETURN( vtpm_manager_open() ); 
-  TPMTRYRETURN( vtpm_manager_command(VTPM_ORD_MIGRATE_IN,
-                                     &out_param_buf,
-                                     &cmd_status,
-                                     &empty_buf) );
-
-  vtpm_manager_close();
-
-  TPMTRYRETURN(cmd_status);
-
-  // ====== Call hotplug-script and resume instance ======
-  snprintf(shell_cmd_str, shell_cmd_strlen,
-	VTPM_SH_CMD_HDR VTPM_SH_RESUME " %d" VTPM_SH_CMD_FTR, instance);
-  system(shell_cmd_str);
-
-  goto egress;
- abort_egress:
- egress:
-  free(shell_cmd_str);
-
-  // In this case no params come back, so reuse build_error_msg even for succes.
-  build_error_msg(result_buf, status);
-  return;
-}
-
diff --git a/tools/vtpm_manager/tcs/Makefile b/tools/vtpm_manager/tcs/Makefile
deleted file mode 100644
index 11af91e..0000000
--- a/tools/vtpm_manager/tcs/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-XEN_ROOT = $(CURDIR)/../../..
-include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
-
-BIN		= libTCS.a
-
-.PHONY: all
-all: build
-
-.PHONY: build
-build: $(BIN)
-
-.PHONY: install
-install: build
-
-.PHONY: clean
-clean:
-	rm -f *.a *.so *.o *.rpm $(DEP_FILES)
-
-.PHONY: mrproper
-mrproper: clean
-	rm -f *~
-
-$(BIN): $(OBJS)
-	$(AR) rcs $(BIN) $(OBJS)
diff --git a/tools/vtpm_manager/tcs/contextmgr.c b/tools/vtpm_manager/tcs/contextmgr.c
deleted file mode 100644
index cf3803c..0000000
--- a/tools/vtpm_manager/tcs/contextmgr.c
+++ /dev/null
@@ -1,224 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// contextmgr.c
-// 
-//  This file contains the context management functions for TCS.
-// 
-// ==================================================================
-
-#include <stdio.h>
-#include <string.h>
-#include <malloc.h>
-#include "tcs.h"
-#include "contextmgr.h"
-#include "log.h"
-#include "hashtable.h"
-
-BYTE* AddMemBlock(CONTEXT_HANDLE* pContextHandle, // in
-		  int    BlockSize)  { // in
-  
-  BLOCK* pCurrentBlock = NULL;
-  BLOCK* pBlock = NULL;
-                    
-  // check incoming params
-  if (pContextHandle == NULL || BlockSize == 0)
-    return NULL;
-
-  // Create New Block
-  pBlock = (BLOCK *)malloc(sizeof(BLOCK));
-  if (pBlock == NULL)
-    return (0);
-
-  pBlock->aMemory = (BYTE *)malloc(sizeof(BYTE) * BlockSize);
-  if (pBlock->aMemory == NULL)
-    return (0);
-
-  memset(pBlock->aMemory, 0, BlockSize);
-  pBlock->nBlockSize = BlockSize;
-  pBlock->pNextBlock = NULL;
-  
-  // search for the last block created where to add the 
-  // newly created block
-  if(pContextHandle->pTopBlock != NULL) {
-    pCurrentBlock = pContextHandle->pTopBlock;
-    while(pCurrentBlock->pNextBlock != NULL)
-      pCurrentBlock = pCurrentBlock->pNextBlock;
-    
-    
-    pCurrentBlock->pNextBlock= pBlock;
-  } else
-    pContextHandle->pTopBlock = pBlock;
-  
-  
-  pContextHandle->nBlockCount++;
-  
-  return pBlock->aMemory;
-}
-
-
-BOOL DeleteMemBlock(CONTEXT_HANDLE* pContextHandle, // in
-                    BYTE*   pTCPA_BYTEs) { // in
-  BLOCK* pCurrentBlock = NULL;
-  BLOCK* pParentBlock = NULL;
-  BOOL bFound = FALSE;
-  
-  if (pContextHandle == NULL) 
-    return FALSE;
-
-  
-  // Search for the Block in the context by aMemory pointer
-  pParentBlock = NULL;
-  pCurrentBlock = pContextHandle->pTopBlock;
-  
-  while(pCurrentBlock != NULL) {
-    // If aMemory block is found, delete it 
-    if(pCurrentBlock->aMemory == pTCPA_BYTEs || pTCPA_BYTEs == NULL) {
-      // if it is the top Block, remove it from the top, 
-      // otherwise remove it from the ParentBlock and stitch 
-      // the NextBlock to the ParentBlock
-      if(pParentBlock == NULL)
-	pContextHandle->pTopBlock = pContextHandle->pTopBlock->pNextBlock;
-      else
-	pParentBlock->pNextBlock = pCurrentBlock->pNextBlock;
-      
-      // delete memory Block associated with pointer pTCPA_BYTEs
-      free(pCurrentBlock->aMemory);
-      pCurrentBlock->aMemory = NULL;
-      
-      free(pCurrentBlock);
-      pCurrentBlock = pParentBlock;
-      
-      pContextHandle->nBlockCount--;
-      bFound = TRUE;
-    }
-  
-    if(pCurrentBlock != NULL) {
-      pParentBlock = pCurrentBlock;
-      pCurrentBlock = pCurrentBlock->pNextBlock;
-    }
-  }
-  
-  return bFound;
-}
-
-BOOL AddHandleToList(TCS_CONTEXT_HANDLE hContext, // in
-		     TPM_RESOURCE_TYPE type, // in
-		     TPM_HANDLE    handle)  { // in
-  HANDLE_LIST* pNewHandle = NULL;
-
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Adding Handle to list\n");
-  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
-
-  if (pContextHandle == NULL)
-    return 0;
-  
-  pNewHandle = (HANDLE_LIST *)malloc(sizeof(HANDLE_LIST));
-  
-  if (pNewHandle == NULL) 
-    return (0);
-  
-  pNewHandle->handle = handle;
-  pNewHandle->type = type;
-  pNewHandle->pNextHandle = pContextHandle->pHandleList;
-  
-  pContextHandle->pHandleList = pNewHandle;
-  
-  return 1;
-}
-
-BOOL DeleteHandleFromList(   TCS_CONTEXT_HANDLE hContext, // in		     
-                             TPM_HANDLE          handle) { // in
-    
-  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
-
-  HANDLE_LIST *pCurrentHandle = pContextHandle->pHandleList, 
-              *pLastHandle = pCurrentHandle;
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Deleting Handle from list\n");
-  
-  if (pContextHandle == NULL)
-    return 0;
-  
-  while (1) {
-    
-    if (pCurrentHandle->handle == handle) { // Found element
-      if (pCurrentHandle == pLastHandle) { // First element in list 
-	pContextHandle->pHandleList = pCurrentHandle->pNextHandle;
-	free(pCurrentHandle);
-      } else { // Ordinary element
-	pLastHandle->pNextHandle = pCurrentHandle->pNextHandle;
-	free(pCurrentHandle);
-      }
-      
-      return 1;
-      
-    } else { // Not found yet;
-      pLastHandle = pCurrentHandle;
-      pCurrentHandle = pCurrentHandle->pNextHandle;
-      if (pCurrentHandle == NULL) // Found end of list
-	return 0;
-    }
-    
-  }
-}
-
-BOOL FreeHandleList(    CONTEXT_HANDLE*     pContextHandle) { // in
-  HANDLE_LIST* pCurrentHandle;
-  BOOL returncode = TRUE;
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Freeing all handles for context\n");
-  
-  if (pContextHandle == NULL)
-    return 1;
-  
-  pCurrentHandle = pContextHandle->pHandleList;
-  while (pCurrentHandle != NULL) {
-    
-    switch (pCurrentHandle->type) {
-    case TPM_RT_KEY:
-      returncode = returncode && !TCSP_EvictKey(pContextHandle->handle, pCurrentHandle->handle);
-      break;
-    case TPM_RT_AUTH:
-      returncode = returncode && !TCSP_TerminateHandle(pContextHandle->handle, pCurrentHandle->handle);
-      break;
-    default:
-      returncode = FALSE;
-    }
-    
-    pCurrentHandle = pCurrentHandle->pNextHandle;
-    
-  }
-  
-  return 1;
-}
diff --git a/tools/vtpm_manager/tcs/contextmgr.h b/tools/vtpm_manager/tcs/contextmgr.h
deleted file mode 100644
index e3fdf0f..0000000
--- a/tools/vtpm_manager/tcs/contextmgr.h
+++ /dev/null
@@ -1,82 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// contextmgr.c
-// 
-//  This file contains the context management functions for TCS.
-// 
-// ==================================================================
-
-#ifndef __CONTEXTMGR_H__
-#define __CONTEXTMGR_H__
-
-#include "tcg.h"
-
-#define BLOCK_SIZE 300
-
-typedef struct block {
-  int nBlockSize;
-  BYTE* aMemory;
-  struct block* pNextBlock;
-} BLOCK;
-
-typedef struct handle_List {
-  TPM_HANDLE handle;
-  TPM_RESOURCE_TYPE type;
-  struct handle_List* pNextHandle;
-} HANDLE_LIST;
-
-typedef struct context_handle {
-  TCS_CONTEXT_HANDLE handle;
-  int nBlockCount;
-  BLOCK* pTopBlock;
-  HANDLE_LIST* pHandleList;
-} CONTEXT_HANDLE;
-
-BYTE* AddMemBlock(  CONTEXT_HANDLE*     pContextHandle, // in
-                    int                 BlockSize);  // in
-
-BOOL DeleteMemBlock(CONTEXT_HANDLE* pContextHandle, // in
-                    BYTE*           pTCPA_BYTEs); // in
-
-
-BOOL AddHandleToList(   TCS_CONTEXT_HANDLE hContext, // in	
-                        TPM_RESOURCE_TYPE   type, // in
-                        TPM_HANDLE          handle); // in
-
-BOOL DeleteHandleFromList(   TCS_CONTEXT_HANDLE hContext, // in	
-                             TPM_HANDLE          handle); // in
-
-BOOL FreeHandleList(    CONTEXT_HANDLE*     pContextHandle); // in
-
-#endif //_CONTEXTMGR_H_
diff --git a/tools/vtpm_manager/tcs/tcs.c b/tools/vtpm_manager/tcs/tcs.c
deleted file mode 100644
index 7c1378c..0000000
--- a/tools/vtpm_manager/tcs/tcs.c
+++ /dev/null
@@ -1,1192 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// tcs.c
-// 
-//  This file contains the functions that implement a TCS.
-// 
-// ==================================================================
-
-#include <stdio.h>
-#include <string.h>
-#include <malloc.h>
-
-#include "tcg.h"
-#include "bsg.h"
-#include "tcs.h"
-#include "contextmgr.h"
-#include "tpmddl.h"
-#include "log.h"
-#include "hashtable.h"
-#include "hashtable_itr.h"
-
-// Static Global Vars for the TCS
-static int TCS_m_nCount = 0;
-
-#define TCPA_MAX_BUFFER_LENGTH 0x2000
-
-static BYTE InBuf [TCPA_MAX_BUFFER_LENGTH];
-static BYTE OutBuf[TCPA_MAX_BUFFER_LENGTH];
-
-struct hashtable *context_ht;
-
-// -------------------------- Hash table functions --------------------
-
-static unsigned int hashfunc32(void *ky) {
-  return (* (UINT32 *) ky);
-}
-
-static int equals32(void *k1, void *k2) {
-  return (*(UINT32 *) k1 == *(UINT32 *) k2);
-}
-
-CONTEXT_HANDLE *LookupContext( TCS_CONTEXT_HANDLE  hContext) {
-  return( (CONTEXT_HANDLE *) hashtable_search(context_ht, &hContext) );
-}
-
-// ---------------------------------------------------------------------------------
-// Initialization/Uninitialization SubComponent API
-// ---------------------------------------------------------------------------------
-TPM_RESULT TCS_create() {
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TPM_RESULT result = TPM_FAIL;
-  
-  if (TCS_m_nCount == 0) {
-    vtpmloginfo(VTPM_LOG_TCS, "Constructing new TCS:\n");
-    hRes = TDDL_Open();
-
-    context_ht = create_hashtable(10, hashfunc32, equals32);
-	  
-    if ((hRes == TDDL_SUCCESS) && (context_ht != NULL)) {
-      result = TPM_SUCCESS;
-      TCS_m_nCount++;
-    } else {
-      result = TPM_IOERROR;
-      hashtable_destroy(context_ht, 1);
-    }
-  } else
-    TCS_m_nCount++;
-    
-  return(result);
-}
-
-
-void TCS_destroy()
-{
-  TCS_m_nCount--;
-  
-  if (TCS_m_nCount == 0) {
-    vtpmloginfo(VTPM_LOG_TCS, "Destructing TCS:\n");
-    TDDL_Close();
-
-    struct hashtable_itr *context_itr;
-    TCS_CONTEXT_HANDLE  *hContext;
-    
-    // Close all the TCS contexts. TCS should evict keys based on this
-    if (hashtable_count(context_ht) > 0) {
-      context_itr = hashtable_iterator(context_ht);
-      do {
-        hContext = (TCS_CONTEXT_HANDLE *) hashtable_iterator_key(context_itr);
-	if (TCS_CloseContext(*hContext) != TPM_SUCCESS) 
-	    vtpmlogerror(VTPM_LOG_TCS, "Failed to close context %d properly.\n", *hContext);
-      
-      } while (hashtable_iterator_advance(context_itr));
-      free(context_itr);
-    }
-    hashtable_destroy(context_ht, 1);
-  }
-  
-}
-
-TPM_RESULT TCS_Malloc(  TCS_CONTEXT_HANDLE  hContext, // in
-                        UINT32              MemSize, // in
-                        BYTE**              ppMemPtr) {// out
-
-  TPM_RESULT returnCode = TPM_FAIL;
-  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
-  
-  if (pContextHandle != NULL && ppMemPtr != NULL) {
-    *ppMemPtr = (BYTE *)AddMemBlock(pContextHandle, MemSize);
-    returnCode = TPM_SUCCESS;
-  }
-  
-  return returnCode;
-}
-
-TPM_RESULT TCS_FreeMemory(  TCS_CONTEXT_HANDLE  hContext, // in
-                            BYTE*               pMemory) { // in
-  TPM_RESULT returnCode = TPM_FAIL;
-  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
-  
-  if ( (pContextHandle != NULL && pMemory != NULL) &&
-       (DeleteMemBlock(pContextHandle, pMemory) == TRUE) )
-    returnCode = TPM_SUCCESS;
- 
-  
-  return returnCode;
-}
-
-TPM_RESULT TCS_OpenContext(TCS_CONTEXT_HANDLE* hContext) { // out
-  TPM_RESULT returnCode = TPM_FAIL;
-  TCS_CONTEXT_HANDLE *newContext;
-  
-  vtpmloginfo(VTPM_LOG_TCS, "Calling TCS_OpenContext:\n");
-  
-  if (hContext) {
-    CONTEXT_HANDLE* pContextHandle = (CONTEXT_HANDLE *) malloc(sizeof(CONTEXT_HANDLE));
-    if (pContextHandle == NULL) 
-      return TPM_SIZE;
-    
-    // initialize to 0
-    pContextHandle->nBlockCount = 0;
-    pContextHandle->pTopBlock = NULL;
-    pContextHandle->pHandleList = NULL;
-    
-    // Create New Block
-    AddMemBlock(pContextHandle, BLOCK_SIZE);
-    
-    newContext = (TCS_CONTEXT_HANDLE *) malloc(sizeof(TCS_CONTEXT_HANDLE));
-    *newContext = (TCS_CONTEXT_HANDLE) (((uintptr_t) pContextHandle >> 2) & 0xffffffff);
-    
-    if (hashtable_search(context_ht, &newContext) !=NULL)
-    	*newContext += 1;
-    
-    pContextHandle->handle = *newContext;
-    if (!hashtable_insert(context_ht, newContext, pContextHandle)) {
-        free(newContext);
-        free(pContextHandle);
-    	returnCode = TPM_FAIL;
-    } else {
-    	*hContext = *newContext;
-    	returnCode = TPM_SUCCESS;
-    }
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCS_CloseContext(TCS_CONTEXT_HANDLE hContext) {// in
-  //FIXME: TCS SHOULD Track failed auths and make sure
-  //we don't try and re-free them here.
-  TPM_RESULT returnCode = TPM_FAIL;
-  
-  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
-  
-  if(pContextHandle != NULL) {
-    // Print test info
-    vtpmloginfo(VTPM_LOG_TCS, "Calling TCS_CloseContext.\n");
-      
-    // free memory for all the blocks
-    DeleteMemBlock(pContextHandle, NULL );      
-    pContextHandle->pTopBlock = NULL;
-    
-    FreeHandleList(pContextHandle);
-    if (pContextHandle->pHandleList != NULL) 
-      vtpmlogerror(VTPM_LOG_TCS, "Not all handles evicted from TPM.\n");
-    
-    // Release the TPM's resources
-    if (hashtable_remove(context_ht, &hContext) == NULL) 
-      vtpmlogerror(VTPM_LOG_TCS, "Not all handles evicted from TPM.\n");
-    
-    free(pContextHandle);
-    returnCode = TPM_SUCCESS;
-  }
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Finished closing context\n");
-  return(returnCode);
-}
-
-// ------------------------------------------------------------------
-// Internal Functions
-// ------------------------------------------------------------------
-int packAuth(BYTE* dst, TCS_AUTH* auth) {
-  // CHECK: according to the command specs, the outgoing auth params are:
-  // nonceEven
-  // nonceOdd
-  // continueAuthSession
-  // auth digest for return params
-  //
-  // this is a bit different than this code...
-  
-  return BSG_PackList(dst, 4, 
-		      BSG_TYPE_UINT32, &(auth->AuthHandle), 
-		      BSG_TPM_NONCE, &(auth->NonceOdd), 
-		      BSG_TYPE_BOOL, &(auth->fContinueAuthSession), 
-		      BSG_TPM_AUTHDATA, &(auth->HMAC));
-}
-
-int unpackAuth(TCS_AUTH* auth, BYTE* src) {
-  return BSG_UnpackList(src, 3, 
-			BSG_TPM_NONCE, &(auth->NonceEven), 
-			BSG_TYPE_BOOL, &(auth->fContinueAuthSession), 
-			BSG_TPM_AUTHDATA, &(auth->HMAC));
-}
-
-// ------------------------------------------------------------------
-// Authorization Commands
-// ------------------------------------------------------------------
-
-TPM_RESULT TCSP_OIAP(TCS_CONTEXT_HANDLE hContext, // in
-		     TCS_AUTHHANDLE*  authHandle, // out 
-		     TPM_NONCE*   nonce0)  // out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_OIAP;
-  UINT32 paramSize = 0;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (authHandle == NULL || nonce0 == NULL) 
-    return TPM_BAD_PARAMETER;
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 3, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal);
-    
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) 
-      == TDDL_SUCCESS) {
-    
-    // unpack to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList( OutBuf, 3, 
-			    BSG_TPM_TAG, &tag, 
-			    BSG_TYPE_UINT32, &paramSize, 
-			    BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
-      // Extract the remaining output parameters
-      BSG_UnpackList(OutBuf+i, 2, 
-		     BSG_TYPE_UINT32, authHandle, 
-		     BSG_TPM_NONCE, nonce0);
-      
-      if (!AddHandleToList(hContext, TPM_RT_AUTH, *authHandle)) 
-        vtpmlogerror(VTPM_LOG_TCS, "New AuthHandle not recorded\n");
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "Failed with return code %s\n", tpm_get_error_name(returnCode));
-    
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCSP_OSAP(TCS_CONTEXT_HANDLE hContext,  // in
-		     TPM_ENTITY_TYPE  entityType,  // in
-		     UINT32    entityValue, // in
-		     TPM_NONCE   nonceOddOSAP, // in
-		     TCS_AUTHHANDLE*  authHandle,  // out 
-		     TPM_NONCE*   nonceEven,  // out
-		     TPM_NONCE*   nonceEvenOSAP) // out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_OSAP;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (authHandle == NULL || nonceEven == NULL || nonceEvenOSAP == NULL)
-    return TPM_BAD_PARAMETER;
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 6, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT16, &entityType, 
-			  BSG_TYPE_UINT32, &entityValue, 
-			  BSG_TPM_NONCE, &nonceOddOSAP);
-  
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) 
-            == TDDL_SUCCESS) {
-
-    // unpack to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
-      // Extract the remaining output parameters
-      BSG_UnpackList(OutBuf+i, 3, 
-		     BSG_TYPE_UINT32, authHandle, 
-		     BSG_TPM_NONCE, nonceEven, 
-		     BSG_TPM_NONCE, nonceEvenOSAP);
-      
-      if (!AddHandleToList(hContext, TPM_RT_AUTH, *authHandle)) {
-	    vtpmlogerror(VTPM_LOG_TCS, "New AuthHandle not recorded\n");
-      }
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "Failed with return code %s\n", tpm_get_error_name(returnCode));
-    
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCSP_TakeOwnership(TCS_CONTEXT_HANDLE hContext,   // in
-			      UINT16    protocolID,   // in
-			      UINT32    encOwnerAuthSize, // in 
-			      BYTE*    encOwnerAuth,  // in
-			      UINT32    encSrkAuthSize,  // in
-			      BYTE*    encSrkAuth,   // in
-			      UINT32*    SrkSize,   // in, out
-			      BYTE**    Srk,    // in, out
-			      TCS_AUTH*   ownerAuth)   // in, out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_TakeOwnership;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (encOwnerAuth == NULL || encSrkAuth == NULL || SrkSize == NULL || *Srk == NULL) 
-    return TPM_BAD_PARAMETER;
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 5, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT16, &protocolID, 
-			  BSG_TYPE_UINT32, &encOwnerAuthSize);
-  
-  memcpy(InBuf+InLength, encOwnerAuth, encOwnerAuthSize);
-  InLength += encOwnerAuthSize;
-  InLength += BSG_Pack(   BSG_TYPE_UINT32, 
-			  &encSrkAuthSize, 
-			  InBuf+InLength);
-  memcpy(InBuf+InLength, encSrkAuth, encSrkAuthSize);
-  InLength += encSrkAuthSize;
-  memcpy(InBuf+InLength, *Srk, *SrkSize);
-  InLength += *SrkSize;
-  InLength += packAuth(InBuf+InLength, ownerAuth);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, 
-	   &InLength, 
-	   InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) 
-              == TDDL_SUCCESS){
-    
-    // unpack to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList( OutBuf, 3, 
-			    BSG_TPM_TAG, &tag, 
-			    BSG_TYPE_UINT32, &paramSize, 
-			    BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
-      // Extract the remaining output parameters
-      TPM_KEY srkPub;
-      i += BSG_Unpack(BSG_TPM_KEY,  OutBuf+i,  &srkPub); 
-      unpackAuth(ownerAuth, OutBuf+i);
-      
-      // fill output params
-      BYTE tempBuf[1024];
-      *SrkSize = BSG_Pack(BSG_TPM_KEY,  &srkPub, tempBuf);
-      if (TCS_Malloc(hContext, *SrkSize, Srk) == TPM_FAIL) {
-	return(TPM_SIZE);
-      }
-      memcpy(*Srk, tempBuf, *SrkSize);
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d", paramSize);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_TakeOwnership Failed with return code %s\n", tpm_get_error_name(returnCode));
-  }
-  
-  return(returnCode);
-}
-
-
-TPM_RESULT TCSP_DisablePubekRead (  TCS_CONTEXT_HANDLE hContext, // in
-                                    TCS_AUTH*   ownerAuth) { // in, out
- 
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_DisablePubekRead;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
-    
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 3, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal);
-  
-  InLength += packAuth(InBuf+InLength, ownerAuth);
- 
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) 
-              == TDDL_SUCCESS){
-    
-    // unpack to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList( OutBuf, 3, 
-			    BSG_TPM_TAG, &tag, 
-			    BSG_TYPE_UINT32, &paramSize, 
-			    BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
-      // Extract the remaining output parameters
-      unpackAuth(ownerAuth, OutBuf+i);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_DisablePubekRead Failed with return code %s\n", tpm_get_error_name(returnCode));
-  }
-  
-  return(returnCode);
-}
-
-
-TPM_RESULT TCSP_TerminateHandle(TCS_CONTEXT_HANDLE hContext, // in
-                                TCS_AUTHHANDLE  handle)  // in
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_Terminate_Handle;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 4, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT32, &handle);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) 
-              == TDDL_SUCCESS) {
-    
-    // unpack to get the tag, paramSize, & returnCode
-    BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (!DeleteHandleFromList(hContext, handle)) 
-      vtpmlogerror(VTPM_LOG_TCS, "KeyHandle not removed from list\n");
-       
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
-      // Print debug info
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d", paramSize);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_TerminateHandle Failed with return code %s\n", tpm_get_error_name(returnCode));
-    
-  }
-  
-  return(returnCode);
-}
-
-// TPM Mandatory
-TPM_RESULT TCSP_Extend( TCS_CONTEXT_HANDLE hContext, // in
-                        TPM_PCRINDEX  pcrNum,  // in
-                        TPM_DIGEST  inDigest, // in
-                        TPM_PCRVALUE*  outDigest) // out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_Extend;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 5, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT32, &pcrNum, 
-			  BSG_TPM_DIGEST, &inDigest);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) 
-              == TDDL_SUCCESS) {
-    
-    // unpack to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND){
-      // Extract the remaining output parameters
-      BSG_Unpack(BSG_TPM_PCRVALUE, OutBuf+i, outDigest);
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Extend Failed with return code %s\n", tpm_get_error_name(returnCode));
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCSP_Seal(   TCS_CONTEXT_HANDLE hContext,  // in
-                        TCS_KEY_HANDLE  keyHandle,  // in
-                        TPM_ENCAUTH   encAuth,  // in
-                        UINT32    pcrInfoSize, // in
-                        BYTE*    PcrInfo,  // in
-                        UINT32    inDataSize,  // in
-                        BYTE*    inData,   // in
-                        TCS_AUTH*   pubAuth,  // in, out
-                        UINT32*    SealedDataSize, // out
-                        BYTE**    SealedData)  // out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_Seal;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (inData == NULL || pubAuth == NULL || SealedDataSize == NULL || SealedData == NULL)
-    return TPM_BAD_PARAMETER;
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 6, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT32, &keyHandle, 
-			  BSG_TPM_ENCAUTH, encAuth, 
-			  BSG_TYPE_UINT32, &pcrInfoSize);
-  memcpy(InBuf+InLength, PcrInfo, pcrInfoSize);
-  InLength += pcrInfoSize;
-  InLength += BSG_Pack(BSG_TYPE_UINT32, &inDataSize, InBuf+InLength);
-  memcpy(InBuf+InLength, inData, inDataSize);
-  InLength += inDataSize;
-  InLength += packAuth(InBuf+InLength, pubAuth);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-    
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) 
-              == TDDL_SUCCESS) {
-    // unpack OutBuf to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
-      // Extract the remaining output parameters
-      TPM_STORED_DATA sealedData;
-      
-      i += BSG_Unpack(BSG_TPM_STORED_DATA, OutBuf+i, &sealedData); 
-      unpackAuth(pubAuth, OutBuf+i);
-      
-      // fill SealedData
-      BYTE tempBuf[1024];
-      *SealedDataSize = BSG_Pack(BSG_TPM_STORED_DATA, &sealedData, tempBuf);
-      if (TCS_Malloc(hContext, *SealedDataSize, SealedData) == TPM_FAIL) {
-	return TPM_SIZE;
-      }
-      memcpy(*SealedData, tempBuf, *SealedDataSize);
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Seal Failed with return code %s\n", tpm_get_error_name(returnCode));
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCSP_Unseal(TCS_CONTEXT_HANDLE hContext,  // in
-		       TCS_KEY_HANDLE  parentHandle, // in
-		       UINT32    SealedDataSize, // in
-		       BYTE*    SealedData,  // in
-		       TCS_AUTH*   parentAuth,  // in, out
-		       TCS_AUTH*   dataAuth,  // in, out
-		       UINT32*   DataSize,  // out
-		       BYTE**    Data)   // out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_AUTH2_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_Unseal;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (SealedData == NULL || parentAuth == NULL || dataAuth == NULL || 
-      DataSize == NULL || Data == NULL) 
-    return TPM_BAD_PARAMETER;
-  
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 4, 
-			              BSG_TPM_TAG, &tag, 
-                          BSG_TYPE_UINT32, &paramSize, 
-                          BSG_TPM_COMMAND_CODE, &ordinal, 
-                          BSG_TYPE_UINT32, &parentHandle);
-  memcpy(InBuf+InLength, SealedData, SealedDataSize);
-  InLength += SealedDataSize;
-  InLength += packAuth(InBuf+InLength, parentAuth);
-  InLength += packAuth(InBuf+InLength, dataAuth);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-    
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
-    // unpack OutBuf to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList( OutBuf, 3, 
-                            BSG_TPM_TAG, &tag, 
-                            BSG_TYPE_UINT32, &paramSize, 
-                            BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH2_COMMAND) {
-      // Extract the remaining output parameters
-      i += BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, DataSize);
-      if (TCS_Malloc(hContext, *DataSize, Data) == TPM_FAIL) {
-        return TPM_SIZE;
-      }
-      memcpy(*Data, OutBuf+i, *DataSize);
-      i += *DataSize;
-      i += unpackAuth(parentAuth, OutBuf+i);
-      unpackAuth(dataAuth, OutBuf+i);
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Unseal Failed with return code %s\n", tpm_get_error_name(returnCode));
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCSP_UnBind(TCS_CONTEXT_HANDLE hContext,  // in
-		       TCS_KEY_HANDLE  keyHandle,  // in
-		       UINT32    inDataSize,  // in
-		       BYTE*    inData,   // in
-		       TCS_AUTH*   privAuth,  // in, out
-		       UINT32*   outDataSize, // out
-		       BYTE**    outData)  // out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_UnBind;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (inData == NULL || privAuth == NULL || outDataSize == NULL || outData == NULL)
-    return TPM_BAD_PARAMETER;
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 5, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT32, &keyHandle, 
-			  BSG_TYPE_UINT32, &inDataSize);
-  memcpy(InBuf+InLength, inData, inDataSize);
-  InLength += inDataSize;
-  InLength += packAuth(InBuf+InLength, privAuth);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "\n\tSending paramSize = %d", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
-    // unpack OutBuf to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
-      // Extract the remaining output parameters
-      i += BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, outDataSize);
-      if (TCS_Malloc(hContext, *outDataSize, outData) == TPM_FAIL)
-        return TPM_SIZE;
-    
-      memcpy(*outData, OutBuf+i, *outDataSize);
-      i += *outDataSize;
-      unpackAuth(privAuth, OutBuf+i);
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_UnBind Failed with return code %s\n", tpm_get_error_name(returnCode));
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCSP_CreateWrapKey(TCS_CONTEXT_HANDLE hContext,   // in
-			      TCS_KEY_HANDLE  hWrappingKey,  // in
-			      TPM_ENCAUTH  KeyUsageAuth,  // in
-			      TPM_ENCAUTH  KeyMigrationAuth, // in
-			      UINT32*    pcKeySize,   // in, out
-			      BYTE**    prgbKey,   // in, out
-			      TCS_AUTH*   pAuth)    // in, out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_CreateWrapKey;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (pcKeySize == NULL || *prgbKey == NULL || pAuth == NULL)
-    return TPM_BAD_PARAMETER;
-  
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 6, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT32, &hWrappingKey, 
-			  BSG_TPM_ENCAUTH, KeyUsageAuth, 
-			  BSG_TPM_ENCAUTH, KeyMigrationAuth); 
-  memcpy(InBuf+InLength, *prgbKey, *pcKeySize);
-  InLength += *pcKeySize;
-  InLength += packAuth(InBuf+InLength, pAuth);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
-    // unpack OutBuf to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_RESULT, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
-      // Extract the remaining output parameters
-      TPM_KEY wrappedKey;
-      
-      i += BSG_Unpack(BSG_TPM_KEY, OutBuf+i, &wrappedKey);
-      unpackAuth(pAuth, OutBuf+i);
-      
-      // Fill prgbKey
-      BYTE tempBuf[1024];
-      *pcKeySize = BSG_Pack(BSG_TPM_KEY, &wrappedKey, tempBuf);
-      if (TCS_Malloc(hContext, *pcKeySize, prgbKey) == TPM_FAIL) 
-        return TPM_SIZE;
-      
-      memcpy(*prgbKey, tempBuf, *pcKeySize);
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else 
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_CreateWrapKey Failed with return code %s\n", tpm_get_error_name(returnCode)); 
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCSP_LoadKeyByBlob(TCS_CONTEXT_HANDLE hContext,    // in
-			      TCS_KEY_HANDLE  hUnwrappingKey,   // in
-			      UINT32    cWrappedKeyBlobSize, // in
-			      BYTE*    rgbWrappedKeyBlob,  // in
-			      TCS_AUTH*   pAuth,     // in, out
-			      TCS_KEY_HANDLE*  phKeyTCSI,    // out
-			      TCS_KEY_HANDLE*  phKeyHMAC)    // out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_LoadKey;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (rgbWrappedKeyBlob == NULL || pAuth == NULL || phKeyTCSI == NULL || phKeyHMAC == NULL) 
-    return TPM_BAD_PARAMETER; 
-  
-  *phKeyHMAC = hUnwrappingKey; // the parent key is the one that the TPM use to make the HMAC calc
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 4, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT32, &hUnwrappingKey);
-  memcpy(InBuf+InLength, rgbWrappedKeyBlob, cWrappedKeyBlobSize);
-  InLength += cWrappedKeyBlobSize;
-  InLength += packAuth(InBuf+InLength, pAuth);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
-    // unpack OutBuf to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
-      // Extract the remaining output parameters
-      i += BSG_Unpack(BSG_TYPE_UINT32, 
-		      OutBuf+i, 
-		      phKeyTCSI);
-      unpackAuth(pAuth, OutBuf+i);
-      
-      if (!AddHandleToList(hContext, TPM_RT_KEY, *phKeyTCSI)) {
-        vtpmlogerror(VTPM_LOG_TCS, "New KeyHandle not recorded\n");
-      }
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-     } else 
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_LoadKeyByBlob Failed with return code %s\n", tpm_get_error_name(returnCode));
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCSP_EvictKey(TCS_CONTEXT_HANDLE hContext, // in
-			 TCS_KEY_HANDLE  hKey)  // in
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_EvictKey;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 4, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT32, &hKey);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
-    // unpack OutBuf to get the tag, paramSize, & returnCode
-    BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (!DeleteHandleFromList(hContext, hKey)) {
-      vtpmlogerror(VTPM_LOG_TCS, "KeyHandle not removed from list\n");
-    }	 
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else {
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_EvictKey Failed with return code %s\n", tpm_get_error_name(returnCode));
-    }
-  }
-  
-  return(returnCode);
-}
-
-TPM_RESULT TCSP_GetRandom(TCS_CONTEXT_HANDLE hContext,  // in
-			  UINT32*    bytesRequested, // in, out
-			  BYTE**    randomBytes) // out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_GetRandom;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (bytesRequested == NULL || *randomBytes == NULL){
-    return TPM_BAD_PARAMETER;
-  }
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 4, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TYPE_UINT32, bytesRequested);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
-    // unpack OutBuf to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
-      // Extract the remaining output parameters
-      BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, bytesRequested);
-      if (TCS_Malloc(hContext, *bytesRequested, randomBytes) == TPM_FAIL) {
-        return TPM_SIZE;
-      }
-      memcpy(*randomBytes, OutBuf+i+sizeof(UINT32), *bytesRequested);
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else {
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_GetRandom Failed with return code %s\n", tpm_get_error_name(returnCode));
-    }
-  }
-  
-  return(returnCode);
-}
-
-
-TPM_RESULT TCSP_ReadPubek(TCS_CONTEXT_HANDLE   hContext,               // in
-			  TPM_NONCE            antiReplay,             // in
-			  UINT32*              pubEndorsementKeySize,  // out
-			  BYTE**               pubEndorsementKey,      // out
-			  TPM_DIGEST*          checksum)               // out
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_ReadPubek;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-  
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32   OutLength = TCPA_MAX_BUFFER_LENGTH;
-  
-  // check input params
-  if (pubEndorsementKeySize == NULL || pubEndorsementKey == NULL || checksum == NULL) {
-    return TPM_BAD_PARAMETER;
-  }
-  
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 4, 
-			  BSG_TPM_TAG, &tag, 
-			  BSG_TYPE_UINT32, &paramSize, 
-			  BSG_TPM_COMMAND_CODE, &ordinal, 
-			  BSG_TPM_NONCE, &antiReplay);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-  
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-  
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
-    // unpack OutBuf to get the tag, paramSize, & returnCode
-    int i = BSG_UnpackList(OutBuf, 3, 
-			   BSG_TPM_TAG, &tag, 
-			   BSG_TYPE_UINT32, &paramSize, 
-			   BSG_TPM_COMMAND_CODE, &returnCode);
-    
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
-      // Extract the remaining output parameters
-      TPM_PUBKEY pubEK;
-      i += BSG_UnpackList(OutBuf+i, 2, 
-			  BSG_TPM_PUBKEY, &pubEK, 
-			  BSG_TPM_DIGEST, checksum);
-      
-      // fill EndorsementKey
-      BYTE tempBuf[1024];
-      *pubEndorsementKeySize = BSG_Pack(BSG_TPM_PUBKEY, &pubEK, tempBuf);
-      if (TCS_Malloc(hContext, *pubEndorsementKeySize, pubEndorsementKey) == TPM_FAIL) {
-        return TPM_SIZE;
-      }
-      memcpy(*pubEndorsementKey, tempBuf, *pubEndorsementKeySize);
-      
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else {
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_ReadPubek Failed with return code %s\n", tpm_get_error_name(returnCode));
-    }
-  }
-  
-  return(returnCode);
-}
-
-
-TPM_RESULT TCSP_SaveState(TCS_CONTEXT_HANDLE   hContext)  // in
-{
-  // setup input/output parameters block
-  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
-  UINT32 paramSize = 0;
-  TPM_COMMAND_CODE ordinal = TPM_ORD_SaveState;
-  TPM_RESULT returnCode = TPM_SUCCESS;
-
-  // setup the TPM driver input and output buffers
-  TDDL_RESULT hRes = TDDL_E_FAIL;
-  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
-  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
-
-  // Convert Byte Input parameter in the input byte stream InBuf
-  InLength = BSG_PackList(InBuf, 3,
-                          BSG_TPM_TAG, &tag,
-                          BSG_TYPE_UINT32, &paramSize,
-                          BSG_TPM_COMMAND_CODE, &ordinal);
-  // fill paramSize again as we now have the correct size
-  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
-
-  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
-
-  // call the TPM driver
-  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
-    // unpack OutBuf to get the tag, paramSize, & returnCode
-    BSG_UnpackList(OutBuf, 3,
-                           BSG_TPM_TAG, &tag,
-                           BSG_TYPE_UINT32, &paramSize,
-                           BSG_TPM_COMMAND_CODE, &returnCode);
-
-    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
-      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
-    } else {
-      vtpmlogerror(VTPM_LOG_TCS, "TCSP_SaveState Failed with return code %s\n", tpm_get_error_name(returnCode));
-    }
-  }
-
-  return(returnCode);
-}
-
-
-TPM_RESULT TCSP_RawTransmitData(   UINT32 inDataSize,  // in
-				   BYTE *inData,       // in
-				   UINT32 *outDataSize,// in/out
-				   BYTE *outData) {    // out     
-  
-  TDDL_RESULT hRes;
-  
-  vtpmloginfo(VTPM_LOG_TCS, "Calling TransmitData directly.\n");
-  //FIXME: Add Context Management
-  hRes = TDDL_TransmitData( inData, 
-			    inDataSize, 
-			    outData, 
-			    outDataSize);
-  
-  if (hRes == TDDL_SUCCESS) {
-    return TPM_SUCCESS;
-  } else {
-    vtpmlogerror(VTPM_LOG_TCS, "TCSP_RawTransmitData Failed with return code %s\n", tpm_get_error_name(TPM_IOERROR));
-    return TPM_IOERROR;
-  }
-  
-}
diff --git a/tools/vtpm_manager/tcs/tcs.h b/tools/vtpm_manager/tcs/tcs.h
deleted file mode 100644
index 83b9cd0..0000000
--- a/tools/vtpm_manager/tcs/tcs.h
+++ /dev/null
@@ -1,245 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// tcs.h
-// 
-//  This file declares the TCS API
-// 
-// ==================================================================
-
-#ifndef __TCS_H__
-#define __TCS_H__
-
-#include "tcg.h"
-#include "contextmgr.h"
-#include "buffer.h"
-
-#define HANDLE_NULL 0
-
-// ------------------------------------------------------------------
-// Exposed API
-// ------------------------------------------------------------------
-
-TPM_RESULT TCS_create();
-void TCS_destroy();
-
-TPM_RESULT TCS_OpenContext( /* OUT */ TCS_CONTEXT_HANDLE* hContext );
-
-TPM_RESULT TCS_CloseContext ( /* IN */ TCS_CONTEXT_HANDLE hContext );
-
-TPM_RESULT TCS_Malloc ( TCS_CONTEXT_HANDLE hContext, // in
-			UINT32   MemSize, // in
-			BYTE**   ppMemPtr ); //out
-
-TPM_RESULT TCS_FreeMemory ( TCS_CONTEXT_HANDLE hContext, // in
-			    BYTE*    pMemory);  // in
-
-// ------------------------------------------------------------------
-// Exposed API
-// ------------------------------------------------------------------
-
-// TPM v1.1B Command Set
-
-// Authorzation
-TPM_RESULT TCSP_OIAP( TCS_CONTEXT_HANDLE hContext, // in
-		      TCS_AUTHHANDLE*  authHandle, // out 
-		      TPM_NONCE*   nonce0  // out
-		      );
-
-TPM_RESULT TCSP_OSAP (  TCS_CONTEXT_HANDLE hContext,  // in
-			TPM_ENTITY_TYPE entityType,  // in
-			UINT32    entityValue, // in
-			TPM_NONCE   nonceOddOSAP, // in
-			TCS_AUTHHANDLE*  authHandle,  // out 
-			TPM_NONCE*   nonceEven,  // out
-			TPM_NONCE*   nonceEvenOSAP // out
-			);
-
-TPM_RESULT TCSP_TakeOwnership (  TCS_CONTEXT_HANDLE hContext,   // in
-				 UINT16    protocolID,   // in
-				 UINT32    encOwnerAuthSize, // in 
-				 BYTE*    encOwnerAuth,  // in
-				 UINT32    encSrkAuthSize,  // in
-				 BYTE*    encSrkAuth,   // in
-				 UINT32*    SrkSize,   // in, out
-				 BYTE**    Srk,    // in, out
-				 TCS_AUTH*   ownerAuth   // in, out
-				 );
-
-TPM_RESULT TCSP_DisablePubekRead (  TCS_CONTEXT_HANDLE hContext, // in
-                                    TCS_AUTH*   ownerAuth // in, out
-                                    );
-
-TPM_RESULT TCSP_TerminateHandle (  TCS_CONTEXT_HANDLE hContext, // in
-				   TCS_AUTHHANDLE  handle  // in
-				   );
-
-TPM_RESULT TCSP_FlushSpecific (  TCS_CONTEXT_HANDLE hContext, // in
-				 TCS_AUTHHANDLE  handle,  // in
-				 TPM_RESOURCE_TYPE resourceType //in 
-				 );
-
-// TPM Mandatory
-TPM_RESULT TCSP_Extend (  TCS_CONTEXT_HANDLE hContext, // in
-			  TPM_PCRINDEX  pcrNum,  // in
-			  TPM_DIGEST   inDigest, // in
-			  TPM_PCRVALUE*   outDigest // out
-			  );
-
-TPM_RESULT TCSP_PcrRead (  TCS_CONTEXT_HANDLE hContext, // in
-			   TPM_PCRINDEX  pcrNum,  // in
-			   TPM_PCRVALUE*  outDigest // out
-			   );
-
-TPM_RESULT TCSP_Quote (  TCS_CONTEXT_HANDLE hContext,  // in
-			 TCS_KEY_HANDLE  keyHandle,  // in
-			 TPM_NONCE   antiReplay,  // in
-			 UINT32*    PcrDataSize, // in, out
-			 BYTE**    PcrData,  // in, out
-			 TCS_AUTH*   privAuth,  // in, out
-			 UINT32*    sigSize,  // out
-			 BYTE**    sig    // out
-			 );
-
-TPM_RESULT TCSP_Seal (  TCS_CONTEXT_HANDLE hContext,  // in
-			TCS_KEY_HANDLE  keyHandle,  // in
-			TPM_ENCAUTH  encAuth,  // in
-			UINT32    pcrInfoSize, // in
-			BYTE*    PcrInfo,  // in
-			UINT32    inDataSize,  // in
-			BYTE*    inData,   // in
-			TCS_AUTH*   pubAuth,  // in, out
-			UINT32*    SealedDataSize, // out
-			BYTE**    SealedData  // out
-			);
-
-TPM_RESULT TCSP_Unseal (  TCS_CONTEXT_HANDLE hContext,  // in
-			  TCS_KEY_HANDLE  parentHandle, // in
-			  UINT32    SealedDataSize, // in
-			  BYTE*    SealedData,  // in
-			  TCS_AUTH*   parentAuth,  // in, out
-			  TCS_AUTH*   dataAuth,  // in, out
-			  UINT32*    DataSize,  // out
-			  BYTE**    Data   // out
-			  );
-
-TPM_RESULT TCSP_DirWriteAuth (  TCS_CONTEXT_HANDLE hContext,  // in
-				TPM_DIRINDEX  dirIndex,  // in
-				TPM_DIRVALUE  newContents, // in
-				TCS_AUTH*   ownerAuth  // in, out
-				);
-
-TPM_RESULT TCSP_DirRead (  TCS_CONTEXT_HANDLE hContext, // in
-			   TPM_DIRINDEX  dirIndex, // in
-			   TPM_DIRVALUE*  dirValue // out
-			   );
-
-TPM_RESULT TCSP_UnBind (  TCS_CONTEXT_HANDLE hContext,  // in
-			  TCS_KEY_HANDLE  keyHandle,  // in
-			  UINT32    inDataSize,  // in
-			  BYTE*    inData,   // in
-			  TCS_AUTH*   privAuth,  // in, out
-			  UINT32*    outDataSize, // out
-			  BYTE**    outData   // out
-			  );
-
-TPM_RESULT TCSP_CreateWrapKey (  TCS_CONTEXT_HANDLE hContext,   // in
-				 TCS_KEY_HANDLE  hWrappingKey,  // in
-				 TPM_ENCAUTH  KeyUsageAuth,  // in
-				 TPM_ENCAUTH  KeyMigrationAuth, // in
-				 UINT32*    pcKeySize,   // in, out
-				 BYTE**    prgbKey,   // in, out
-				 TCS_AUTH*   pAuth    // in, out
-				 );
-
-TPM_RESULT TCSP_LoadKeyByBlob (  TCS_CONTEXT_HANDLE hContext,    // in
-				 TCS_KEY_HANDLE  hUnwrappingKey,   // in
-				 UINT32    cWrappedKeyBlobSize, // in
-				 BYTE*    rgbWrappedKeyBlob,  // in
-				 TCS_AUTH*   pAuth,     // in, out
-				 TCS_KEY_HANDLE*  phKeyTCSI,    // out
-				 TCS_KEY_HANDLE*  phKeyHMAC    // out
-				 );
-
-TPM_RESULT TCSP_GetPubKey (  TCS_CONTEXT_HANDLE hContext,  // in
-			     TCS_KEY_HANDLE  hKey,   // in
-			     TCS_AUTH*   pAuth,   // in, out
-			     UINT32*    pcPubKeySize, // out
-			     BYTE**    prgbPubKey  // out
-			     ); 
-
-TPM_RESULT TCSP_EvictKey (  TCS_CONTEXT_HANDLE hContext, // in
-			    TCS_KEY_HANDLE  hKey  // in
-			    );
-
-TPM_RESULT TCSP_Sign (  TCS_CONTEXT_HANDLE hContext,  // in
-			TCS_KEY_HANDLE  keyHandle,  // in
-			UINT32    areaToSignSize, // in
-			BYTE*    areaToSign,  // in
-			TCS_AUTH*   privAuth,  // in, out
-			UINT32*    sigSize,  // out
-			BYTE**    sig    // out
-			);
-
-TPM_RESULT TCSP_GetRandom (  TCS_CONTEXT_HANDLE hContext,  // in
-			     UINT32*    bytesRequested, // in, out
-			     BYTE**    randomBytes  // out
-			     );
-
-TPM_RESULT TCSP_StirRandom (  TCS_CONTEXT_HANDLE hContext, // in
-			      UINT32    inDataSize, // in
-			      BYTE*    inData  // in
-			      );
-
-TPM_RESULT TCSP_ReadPubek (  TCS_CONTEXT_HANDLE hContext,    // in
-			     TPM_NONCE   antiReplay,    // in
-			     UINT32*    pubEndorsementKeySize, // out
-			     BYTE**    pubEndorsementKey,  // out
-			     TPM_DIGEST*  checksum    // out
-			     );
-
-
-// Non-Standard TCSP calls
-TPM_RESULT TCSP_SaveState(TCS_CONTEXT_HANDLE   hContext);  // in
-
-//Give direct access to TransmitData.
-// Key and Auth Management is done before transfering command to TDDL.
-TPM_RESULT TCSP_RawTransmitData(UINT32 inDataSize,  // in
-				BYTE *inData,       // in
-				UINT32 *outDataSize,// in/out
-				BYTE *outData);     // out
-
-///////////// Private Functions ////////////////////
-CONTEXT_HANDLE* LookupContext( TCS_CONTEXT_HANDLE hContext);
-
-#endif //TCS_H
diff --git a/tools/vtpm_manager/tcs/tpmddl.h b/tools/vtpm_manager/tcs/tpmddl.h
deleted file mode 100644
index e7e54f1..0000000
--- a/tools/vtpm_manager/tcs/tpmddl.h
+++ /dev/null
@@ -1,69 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// tpmddl.c
-// 
-//  This file defines the TDDLI API
-//
-// ==================================================================
-
-#ifndef __TPMDDL_H__
-#define __TPMDDL_H__
-
-#define TDDL_CAP_PROP_MANUFACTURER 0x0001
-
-#define TDDL_E_FAIL 1
-#define TDDL_E_SUCCESS 0
-#define TDDL_SUCCESS 0
-
-typedef unsigned int TDDL_UINT32;
-typedef TDDL_UINT32 TDDL_RESULT;
-typedef unsigned char TDDL_BYTE;
-
-TDDL_RESULT TDDL_Open();
-void TDDL_Close();
-TDDL_RESULT TDDL_TransmitData( TDDL_BYTE* in,
-			       TDDL_UINT32 insize,
-			       TDDL_BYTE* out,
-			       TDDL_UINT32* outsize);
-TDDL_RESULT TDDL_GetStatus();
-TDDL_RESULT TDDL_GetCapability( TDDL_UINT32 cap,
-				TDDL_UINT32 sub,
-				TDDL_BYTE* buffer,
-				TDDL_UINT32* size);
-TDDL_RESULT TDDL_SetCapability( TDDL_UINT32 cap,
-				TDDL_UINT32 sub,
-				TDDL_BYTE* buffer,
-				TDDL_UINT32* size);
-
-#endif // __TPMDDL_H__
diff --git a/tools/vtpm_manager/tcs/transmit.c b/tools/vtpm_manager/tcs/transmit.c
deleted file mode 100644
index 74bbdca..0000000
--- a/tools/vtpm_manager/tcs/transmit.c
+++ /dev/null
@@ -1,147 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-
-#include <unistd.h>
-#include <stdio.h>
-#include <errno.h>
-#include <fcntl.h>
-
-#include "tcg.h"
-#include "buffer.h"
-#include "log.h"
-#include "tpmddl.h"
-
-// flag to track whether TDDL has been opened
-static int g_TDDL_open = 0;
-static int g_tx_fd = -1;              // the fd to the TPM
-
-#ifndef DUMMY_TPM
- #define TPM_TX_FNAME "/dev/tpm0"
- static int *g_rx_fdp = &g_tx_fd;
-#else
- #define TPM_TX_FNAME "/var/tpm/tpm_in.fifo"
- #define TPM_RX_FNAME "/var/tpm/tpm_out.fifo"
- static int g_rx_fd = -1;
- static int *g_rx_fdp = &g_rx_fd;              // the fd to the TPM
-#endif
-
-TPM_RESULT
-TDDL_TransmitData( TDDL_BYTE* in,
-		   TDDL_UINT32 insize,
-		   TDDL_BYTE* out,
-		   TDDL_UINT32* outsize) {
-  TPM_RESULT status = TPM_SUCCESS;
-  TDDL_UINT32 i;
-  
-  vtpmloginfo(VTPM_LOG_TXDATA, "Sending buffer = 0x");
-  for(i = 0 ; i < insize ; i++) 
-    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", in[i]);
-
-  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
-  
-  ssize_t size = 0;
-  
-  // send the request
-  size = write (g_tx_fd, in, insize);
-  if (size < 0) {
-    vtpmlogerror(VTPM_LOG_TXDATA, "write() failed");
-    ERRORDIE (TPM_IOERROR);
-  }
-  else if ((TDDL_UINT32) size < insize) {
-    vtpmlogerror(VTPM_LOG_TXDATA, "Wrote %d instead of %d bytes!\n", (int) size, insize);
-    // ... ?
-  }
-
-  // read the response
-  size = read (*g_rx_fdp, out, TCPA_MAX_BUFFER_LENGTH);
-  if (size < 0) {
-    vtpmlogerror(VTPM_LOG_TXDATA, "read() failed");
-    ERRORDIE (TPM_IOERROR);
-  }
-  
-  vtpmloginfo(VTPM_LOG_TXDATA, "Receiving buffer = 0x");
-  for(i = 0 ; i < size ; i++) 
-    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out[i]);
-
-  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
-
-  *outsize = size;
-  // close connection
-  goto egress;
-  
- abort_egress:
- egress:
-  return status;
-}
-
-TPM_RESULT TDDL_Open() {
-  
-  TDDL_RESULT status = TDDL_SUCCESS;
-  
-  if (g_TDDL_open)
-    return TPM_FAIL;
-
-#ifdef DUMMY_TPM  
-  *g_rx_fdp = open (TPM_RX_FNAME, O_RDWR);
-#endif
-
-  g_tx_fd = open (TPM_TX_FNAME, O_RDWR);
-  if (g_tx_fd < 0) {
-    vtpmlogerror(VTPM_LOG_TXDATA, "TPM open failed");
-    return TPM_IOERROR;
-  }
-  
-  g_TDDL_open = 1;
-  
-  return status;
-}
-
-void TDDL_Close() {
-  if (! g_TDDL_open)
-        return;
-
-  if (g_tx_fd>= 0) {
-    if (close(g_tx_fd) < 0) 
-      vtpmlogerror(VTPM_LOG_TXDATA, "closeing tpm failed");
-    g_tx_fd = -1;
-  }
-    
-  if (*g_rx_fdp>= 0) {
-    if (close(*g_rx_fdp) < 0) 
-      vtpmlogerror(VTPM_LOG_TXDATA, "closeing tpm failed");
-    *g_rx_fdp = -1;
-  }
-
-  g_TDDL_open = 0;
-  
-}
diff --git a/tools/vtpm_manager/util/Makefile b/tools/vtpm_manager/util/Makefile
deleted file mode 100644
index 36bc38f..0000000
--- a/tools/vtpm_manager/util/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-XEN_ROOT = $(CURDIR)/../../..
-include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
-
-BIN		= libTCGUtils.a
-
-.PHONY: all
-all: build
-
-.PHONY: build
-build: $(BIN)
-
-.PHONY: install
-install: build
-
-.PHONY: clean
-clean:
-	rm -f *.a *.so *.o *.rpm $(DEP_FILES)
-
-.PHONY: mrproper
-mrproper: clean
-	rm -f *~
-
-$(BIN): $(OBJS)
-	$(AR) rcs $(BIN) $(OBJS)
diff --git a/tools/vtpm_manager/util/bsg.c b/tools/vtpm_manager/util/bsg.c
deleted file mode 100644
index fa36ce7..0000000
--- a/tools/vtpm_manager/util/bsg.c
+++ /dev/null
@@ -1,829 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// bsg.cpp
-// 
-//  This file will handle all the TPM Byte Stream functions
-// 
-// ==================================================================
-
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-#include <malloc.h>
-#include "tcg.h"
-#include "crypto.h"
-#include "bsg.h"
-#include "log.h"
-
-static int g_log_recursion_level = 0;
-
-// a largest buffer size. if we get a buf size bigger than this when unpacking,
-// will complain!
-#define BSG_MAX_BUF_SIZE (1<<18)
-
-#define bsglog(fmt, ...) do { \
-    int __i; \
-    for (__i=0; __i < g_log_recursion_level; __i++) {		     \
-      vtpmloginfomore (VTPM_LOG_BSG, "%s", "  ");			     \
-    }								       \
-    vtpmloginfomore (VTPM_LOG_BSG, fmt, __VA_ARGS__);			       \
-  } while (0)
-
-
-// FIXME:  trigger the selfcheck--need to use glibc hook to do this
-//BOOL dummy1 = BSG_static_selfcheck();
-
-
-// Interpretting Types
-// -------------------
-// 
-// Incoming Types are composed of two parts {format, info} squished into a
-// BSG_UINT32.  The first 4 bits is a format spec indicating what type of
-// data it is.  If the first 4 bits are zero the info corresponds to a value in
-// BSG_s_fmt[]. This is a structure whose composition is described in
-// BSG_s_fmt[]. If the value is non-zero, info corresponds to the size of the
-// data (in bytes) being passed in. For example a UINT32 being passed in would
-// have a format of (__FMT_CONST | 4). If both, the format and info are zero,
-// this is interpretted as the end of the structure, and the result is returned.
-
-// these flags are mutually exclusive, so I'll just make them
-// format values which indicate the semantics of the 'info' part and the source
-// data. The above description has been accordingly adjusted.
-
-// format values for determining what type of data the incoming type is
-// it's a 4 bit value, occupying the high 4 bits
-#define __FMT_CONST (1UL << 28) // Constant sized value
-#define __FMT_DATA  (2UL << 28) // Believed to be raw data NOT {size,data}
-#define __FMT_SIZE  (3UL << 28) // A size. Used in FMT_SIZE??_DATA.
-#define __FMT_HSIZE (4UL << 28) // A number of handles
-#define __FMT_PACKED (5UL << 28) // 'info' is unused; the source data consists
-                                 // of {size32, data} but we're to pack only the
-                                 // data as that is already packed, and so
-                                 // can/must be unpacked without
-                                 // explicitly reading it size
-
-#define __FMT_MASK  0x0FFFFFFFUL // this masks out the 4-bit format
-#define __FMT_MASK_SIZE(type)   ((type) & __FMT_MASK)
-#define __FMT_MASK_FORMAT(type) ((type) & (~__FMT_MASK))
-
-// constant (8/16/32-bits)
-#define FMT_U8 (__FMT_CONST | 1UL)
-#define FMT_U16 (__FMT_CONST | 2UL)
-#define FMT_U32 (__FMT_CONST | 4UL)
-
-// const with a compiler-computed size
-#define FMT_SIZEOF(type) (__FMT_CONST | sizeof(type))
-
-// other data (size bytes) 
-// Used primarily for DIGESTS -> FMT_DATA(20)
-#define FMT_DATA(size) (__FMT_DATA | ((BSG_UINT32) (size) & __FMT_MASK))
-
-// 16/32-bit size followed by N bytes of data
-#define FMT_SIZE16_DATA (__FMT_SIZE | 2UL)
-#define FMT_SIZE32_DATA (__FMT_SIZE | 4UL)
-
-// 16-bit size followed by N key handles
-#define FMT_SIZE16_HANDLES (__FMT_HSIZE | 2UL)
-
-#define DIGEST_SIZE 20 
-typedef BSG_UINT32 BSG_HANDLE;
-
-// TCPA_AUTH has 11 fields!
-#define MAX_FIELDS 11
-typedef struct BSG_Format
-{
-  BSG_Type type;
-  const char* name;
-  BSG_UINT32 fields[MAX_FIELDS + 1];
-} BSG_Format;
-
-/*
- * TCPA structure data formats
- */
-// this has to be manually kept in sync with the
-// Type enum!! the static_selfcheck() function should be used regularly!
-static BSG_Format s_fmt[] =
-{
-  {BSG_TYPE_UINT32, "BSG_TYPE_UINT32", {FMT_U32, 0}},
-  {BSG_TYPE_UINT16, "BSG_TYPE_UINT16", {FMT_U16, 0}},
-  {BSG_TYPE_BYTE, "BSG_TYPE_BYTE", {FMT_U8, 0}},
-  {BSG_TYPE_BOOL, "BSG_TYPE_BOOL", {FMT_U8, 0}},
-  {BSG_TPM_SIZE32_DATA, "BSG_TPM_SIZE32_DATA", {FMT_SIZE32_DATA, 0}},
-  {BSG_TPM_TAG, "BSG_TPM_TAG", {FMT_SIZEOF(TPM_TAG), 0}},
-  {BSG_TPM_HANDLE, "BSG_TPM_HANDLE", {FMT_SIZEOF(TPM_HANDLE), 0}},
-  {BSG_TPM_RESULT, "BSG_TPM_RESULT", {FMT_SIZEOF(TPM_RESULT), 0}},
-  {BSG_TPM_RESOURCE_TYPE, "BSG_TPM_RESOURCE_TYPE", {FMT_SIZEOF(TPM_RESOURCE_TYPE), 0}},
-  {BSG_TPM_COMMAND_CODE, "BSG_TPM_COMMAND_CODE", {FMT_U32, 0}},
-  {BSG_TPM_AUTH_DATA_USAGE, "BSG_TPM_AUTH_DATA_USAGE", {FMT_U8, 0}},
-  {BSG_TPM_ALGORITHM_ID, "BSG_TPM_ALGORITHM_ID", {FMT_U32, 0}},
-  {BSG_TPM_PROTOCOL_ID, "BSG_TPM_PROTOCOL_ID", {FMT_SIZEOF(TPM_PROTOCOL_ID), 0}},
-  {BSG_TPM_KEY_USAGE, "BSG_TPM_KEY_USAGE", {FMT_U16, 0}},
-  {BSG_TPM_ENC_SCHEME, "BSG_TPM_ENC_SCHEME", {FMT_U16, 0}},
-  {BSG_TPM_SIG_SCHEME, "BSG_TPM_SIG_SCHEME", {FMT_U16, 0}},
-  {BSG_TPM_MIGRATE_SCHEME, "BSG_TPM_MIGRATE_SCHEME", {FMT_U16, 0}},
-  {BSG_TPM_KEY_FLAGS, "BSG_TPM_KEY_FLAGS", {FMT_U32, 0}},
-    
-  {BSG_TPM_AUTHDATA, "BSG_TPM_AUTHDATA", {FMT_DATA(DIGEST_SIZE), 0}},
-  {BSG_TPM_SECRET, "BSG_TPM_SECRET", {BSG_TPM_AUTHDATA, 0}},
-  {BSG_TPM_ENCAUTH, "BSG_TPM_ENCAUTH", {BSG_TPM_AUTHDATA, 0}},
-  {BSG_TPM_PAYLOAD_TYPE, "BSG_TPM_PAYLOAD_TYPE", {FMT_SIZEOF(TPM_PAYLOAD_TYPE), 0}},
-  
-  {BSG_TPM_VERSION, "BSG_TPM_VERSION", {FMT_DATA(4), 0}}, // vers 1.2
-  {BSG_TPM_DIGEST, "BSG_TPM_DIGEST", {FMT_DATA(DIGEST_SIZE), 0}},
-  {BSG_TPM_COMPOSITE_HASH, "BSG_TPM_COMPOSITE_HASH", {BSG_TPM_DIGEST, 0}},
-  {BSG_TPM_CHOSENID_HASH, "BSG_TPM_CHOSENID_HASH", {BSG_TPM_DIGEST, 0}},
-  
-  {BSG_TPM_NONCE, "BSG_TPM_NONCE", {FMT_DATA(DIGEST_SIZE), 0}},
-  {BSG_TPM_KEY_HANDLE, "BSG_TPM_KEY_HANDLE", {FMT_SIZEOF(TPM_KEY_HANDLE), 0}},
-  {BSG_TPM_KEY_HANDLE_LIST, "BSG_TPM_KEY_HANDLE_LIST",
-   {FMT_SIZE16_HANDLES, 0}},
-  
-  {BSG_TPM_KEY_PARMS, "BSG_TPM_KEY_PARMS", {
-      BSG_TPM_ALGORITHM_ID,
-      BSG_TPM_ENC_SCHEME,
-      BSG_TPM_SIG_SCHEME,
-      FMT_SIZE32_DATA,
-      0}},
-  {BSG_TPM_RSA_KEY_PARMS, "BSG_TPM_RSA_KEY_PARMS", {
-      FMT_U32, FMT_U32, FMT_SIZE32_DATA, 0}},
-  {BSG_TPM_STORE_PUBKEY, "BSG_TPM_STORE_PUBKEY", {FMT_SIZE32_DATA, 0}},
-  {BSG_TPM_PUBKEY, "BSG_TPM_PUBKEY", {BSG_TPM_KEY_PARMS, BSG_TPM_STORE_PUBKEY, 0}},
-  {BSG_TPM_KEY, "BSG_TPM_KEY", {
-      BSG_TPM_VERSION,
-      BSG_TPM_KEY_USAGE,
-      BSG_TPM_KEY_FLAGS,
-      BSG_TPM_AUTH_DATA_USAGE,
-      BSG_TPM_KEY_PARMS,
-      FMT_SIZE32_DATA,        // the PCR_INFO
-      BSG_TPM_STORE_PUBKEY,
-      FMT_SIZE32_DATA,        // the encrypted part
-      0}},
-  
-  {BSG_TPM_MIGRATIONKEYAUTH, "BSG_TPM_MIGRATIONKEYAUTH", {
-      BSG_TPM_PUBKEY,
-      BSG_TPM_MIGRATE_SCHEME,
-      BSG_TPM_DIGEST, 0}},
-  
-  {BSG_TCPA_AUDIT_EVENT, "TCPA_AUDIT_EVENT", {
-      BSG_TPM_COMMAND_CODE,
-      BSG_TPM_RESULT, 0 }},
-  
-  {BSG_TCPA_EVENT_CERT, "TCPA_EVENT_CERT", {
-      BSG_TPM_DIGEST,
-      BSG_TPM_DIGEST,
-      FMT_DATA(2),
-      FMT_SIZE32_DATA, 0}},
-  
-  {BSG_TPM_PCR_SELECTION, "BSG_TPM_PCR_SELECTION", {FMT_SIZE16_DATA, 0} },
-  {BSG_TPM_PCR_COMPOSITE, "BSG_TPM_PCR_COMPOSITE", { BSG_TPM_PCR_SELECTION,
-						     FMT_SIZE32_DATA,
-						     0} },
-
-  {BSG_TPM_PCR_INFO, "BSG_TPM_PCR_INFO", { BSG_TPM_PCR_SELECTION,
-					   BSG_TPM_COMPOSITE_HASH, 
-					   BSG_TPM_COMPOSITE_HASH,
-					   0} },
-  
-  
-  {BSG_TPM_STORED_DATA, "BSG_TPM_STORED_DATA", {
-      BSG_TPM_VERSION,
-      FMT_SIZE32_DATA,
-      FMT_SIZE32_DATA,
-      0}},
-  {BSG_TPM_SYMMETRIC_KEY, "BSG_TPM_SYMMETRIC_KEY", {
-      BSG_TPM_ALGORITHM_ID,
-      BSG_TPM_ENC_SCHEME,
-      FMT_SIZE16_DATA,
-      0}},
-  {BSG_TPM_STORE_PRIVKEY, "BSG_TPM_STORE_PRIVKEY", {FMT_SIZE32_DATA, 0}},
-  {BSG_TPM_STORE_ASYMKEY, "BSG_TPM_STORE_ASYMKEY", {
-      BSG_TPM_PAYLOAD_TYPE,
-      BSG_TPM_SECRET,
-      BSG_TPM_SECRET,
-      BSG_TPM_DIGEST,
-      BSG_TPM_STORE_PRIVKEY,
-      0}},
-  {BSG_TPM_MIGRATE_ASYMKEY, "BSG_TPM_MIGRATE_ASYMKEY", {
-      BSG_TPM_PAYLOAD_TYPE,
-      BSG_TPM_SECRET,
-      BSG_TPM_DIGEST,
-      FMT_U32,
-      BSG_TPM_STORE_PRIVKEY,
-      0}},
-  
-  {BSG_TPM_QUOTE_INFO, "BSG_TPM_QUOTE_INFO", {
-      BSG_TPM_VERSION,
-      FMT_DATA(4),
-      BSG_TPM_COMPOSITE_HASH,
-      BSG_TPM_NONCE,
-      0}},
-  
-  {BSG_TPM_IDENTITY_CONTENTS, "BSG_TPM_IDENTITY_CONTENTS", {
-      BSG_TPM_VERSION,
-      FMT_U32,
-      BSG_TPM_CHOSENID_HASH,
-      BSG_TPM_PUBKEY,
-      0}},
-  
-  {BSG_TPM_PCRVALUE, "BSG_TPM_PCRVALUE", {FMT_DATA(DIGEST_SIZE), 0}},
-  
-  {BSG_TCPA_PCR_FLAGS, "TCPA_PCR_FLAGS", {
-      FMT_U8,
-      FMT_U8,
-      0}},
-  
-  {BSG_TCS_AUTH, "TCS_AUTH", {
-      BSG_TYPE_UINT32, 
-      BSG_TPM_NONCE, 
-      BSG_TPM_NONCE, 
-      BSG_TYPE_BOOL, 
-      BSG_TPM_AUTHDATA, 
-      0}},
-  
-  {BSG_TPM_KEY_NONSENSITIVE, "BSG_TPM_KEY_NONSENSITIVE", {
-      BSG_TPM_VERSION,
-      BSG_TPM_KEY_USAGE,
-      BSG_TPM_KEY_FLAGS,
-      BSG_TPM_AUTH_DATA_USAGE,
-      BSG_TPM_KEY_PARMS,
-      FMT_SIZE32_DATA,
-      BSG_TPM_STORE_PUBKEY,
-      0}},
-  
-  {BSG_PACKED, "BSG_PACKED", {
-      __FMT_PACKED,
-      0 }},
-  
-  {BSG_TYPE_MAX, "", {0}},
-};
-
-
-static const BSG_Format* find_format (BSG_Type t) {
-  BSG_Format * f = s_fmt;
-  
-  if (t >= BSG_TYPE_MAX) {
-    return NULL;
-  }
-  
-  // WARNING: this depends on the enum and s_fmt[] array being in sync! make
-  // sure to run the static_selfcheck() to make sure
-  f = s_fmt + (t - BSG_TYPE_FIRST);
-  
-  return f;
-}
-
-//
-// a consistency-checking routine which can be run at compile time
-// (ie. immediately after compilation)
-//
-// tasks:
-// - verify that s_fmt has one entry per Type t, and that entry is at s_fmt[t]
-//
-// conditions:
-// - need that s_fmt[0] is the first type listed in the Type enum! ie the first
-//   Type has value 0, not 1
-//
-// FIXME: should have a function be passed in here which is called if the test
-// fails. Then the caller can decide what to do: abort, notify, whatever
-// 
-BOOL BSG_static_selfcheck ()
-{
-  int i;
-
-  for (i=BSG_TYPE_FIRST; i <= BSG_TYPE_MAX; i++) {
-    if (s_fmt[i - BSG_TYPE_FIRST].type != i) {
-      bsglog ("%s\n", "BSG: static_selfcheck failed!\n");
-      bsglog ("failure at %i, allegedly %s\n",
-	      i, s_fmt[i - BSG_TYPE_FIRST].name);
-      abort();
-      return FALSE;
-    }
-  }
-  
-  bsglog ("%s\n", "BSG: static_selfcheck success!");
-  return TRUE;
-}
-
-
-/**
- * Flatten a TCPA structure into a buffer in big-endian format
- * @type: TCPA structure type
- * @src: (IN) TCPA structure (OUT) end of TCPA structure
- * @dst: (OUT) flattened data
- * Returns: Flattened size or -1 for unknown types
- */
-// make it so that it can just run through the whole process and return
-// the packed size, without packing anything. this will be done if dst is NULL.
-static int BSG_Pack_private(BSG_Type type, const BSG_BYTE** src, BSG_BYTE* dst)
-{
-  // check incoming parameters
-  if (*src == NULL)
-    return 0;
-  
-  const BSG_BYTE* s = *src;
-  BSG_BYTE* d = dst;
-  
-  BSG_UINT32 size   = __FMT_MASK_SIZE(type);
-  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
-  
-  if (format == __FMT_CONST) // We are dealing with a fixed length value eg. UINT32
-    {
-      BSG_UINT32 val = 0;
-      switch (size) {
-      case 1: val = * (BYTE*) s; break;
-      case 2: val = * (unsigned short*) s; break;
-      case 4: val = * (BSG_UINT32*) s; break;
-      }
-      if (dst)
-	BSG_PackConst(val, size, d);
-
-      s += size;
-      d += size;
-    } else if (format == __FMT_DATA) { // We are dealing with raw data. Not sure when
-    // this is used.
-    
-      if (dst) {
-        bsglog ("BSG: __FMT_DATA size %d, src %p, dst %p\n", size, s, d);
-        memcpy(d, s, size);
-      }
-
-      s += size;
-      d += size;
-  } else if (format == __FMT_SIZE || format == __FMT_HSIZE) { // It's a size, followed by that much data or handles
-    
-    BSG_UINT32 psize = 0;
-    switch (size) {
-    case 1: psize = * (BYTE*) s; break;
-    case 2: psize = * (unsigned short*) s; break;
-    case 4: psize = * (BSG_UINT32*) s; break;
-    }
-        
-    if (dst)
-      BSG_PackConst(psize, size, d);
-
-    s += size;
-    d += size;
-    
-    // now 's' points to an address, so cast it to BSG_BYTE**
-    const BSG_BYTE* pdata = * ((BSG_BYTE**) s);
-    s += sizeof(BSG_BYTE*);
-    
-    if (format == __FMT_HSIZE) {// This is a list of psize Handles
-      if (dst) {
-	BSG_HANDLE* d2 = (BSG_HANDLE*) d;
-	BSG_HANDLE* p2 = (BSG_HANDLE*) pdata;
-	BSG_UINT32 i;
-	for (i = 0; i < psize; i++) 
-	  d2[i] = BSG_UnpackConst((BSG_BYTE*)(p2 + i), 4);
-	
-      }
-      d += psize * sizeof(BSG_HANDLE);
-    } else {// If it's not psize handles, it's psize data.
-      if (psize > 0) {
-	if (dst) {
-	  bsglog ("BSG: __FMT_SIZE, size=%d, src=%p, dst=%p\n",
-		  psize, pdata, d);
-	  memcpy(d, pdata, psize);
-	}
-      }
-      d += psize;
-    }
-  } else if (format == __FMT_PACKED) {
-    // the source buffer is a pack_constbuf_t, which has a size and a
-    // pointer. just copy the buffer value, the size is not included in the
-    // output stream.
-    pack_constbuf_t * buf = (pack_constbuf_t*) s;
-    
-    if (dst) {
-      bsglog ("BSG: __FMT_PACKED, size=%d, src=%p, dst=%p\n",
-	      buf->size, buf->data, d);
-      memcpy(d, buf->data, buf->size);
-    }
-        
-    s += buf->size;
-    d += buf->size;
-  } else if (format == 0) {// No flags are set. This is a structure & it should
-                          // be looked up in the bsg_s_fmt[]
-    
-    const BSG_Format* x = find_format (type);
-    if (x == NULL) {
-      vtpmloginfo(VTPM_LOG_BSG, "BSG_Pack: cannot find type %d\n", type);
-      return -1;
-    }
-    
-    if (dst)
-      bsglog ("BSG_Pack type %s\n", x->name);
-    
-    
-    // iterate through the fields
-    const BSG_UINT32* f = x->fields;
-    for (; *f; f++) {
-      int fsize;
-      
-      g_log_recursion_level++;
-      fsize = BSG_Pack_private((BSG_Type) *f, &s, dst ? d : NULL);
-      g_log_recursion_level--;
-      
-      if (fsize <= 0)
-	return fsize;
-      
-      d += fsize;
-    }
-  } else {
-    vtpmlogerror(VTPM_LOG_BSG, "BSG_Pack(): Unknown format %d\n", format);
-    return -1;
-  }
-  
-  *src = s;
-  return (d - dst);
-}
-
-/**
- * Unflatten a TCPA structure from a buffer in big-endian format
- * @type: TCPA structure type
- * @src: flattened data
- * @dst: (IN) TCPA structure (OUT) end of TCPA structure
- * Returns: Flattened size
- * Note: Returns flattened size NOT the unpacked structure size
- */
-static int BSG_Unpack_private(BSG_Type type, const BSG_BYTE* src, BSG_BYTE** dst) {
-  // check incoming parameters
-  if (src == NULL)
-    return 0;
-  
-  
-  const BSG_BYTE* s = src;
-  BSG_BYTE* d = dst ? *dst:NULL;
-  if (dst && !d)
-    dst = NULL;
-  
-  BSG_UINT32 size = __FMT_MASK_SIZE(type);
-  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
-  
-  if (format == __FMT_CONST) {// We are dealing with a fixed length value ie. UINT32
-
-    BSG_UINT32 val = BSG_UnpackConst(s, size);
-
-    if (dst) {
-      switch (size) {
-      case 1: *(BYTE *) d = (BSG_BYTE) val; break;
-      case 2: *(unsigned short*) d = (unsigned short) val; break;
-      case 4: *(BSG_UINT32*) d = (BSG_UINT32) val; break;
-      }
-    }
-
-    s += size;
-    d += size;
-  } else if (format == __FMT_DATA) {// We are dealing with raw data. Not sure when this is used.
-    if (dst)
-      memcpy(d, s, size);
-
-    d += size;
-    s += size;
-  } else if (format == __FMT_SIZE || format == __FMT_HSIZE) {// It's a size, followed by that much data or handles
-    
-    BSG_UINT32 psize = BSG_UnpackConst(s, size);
-    
-    if (psize > BSG_MAX_BUF_SIZE) {
-      vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack runs into var-sized data bigger than %u bytes!!\n",
-	       BSG_MAX_BUF_SIZE);
-      return -1;
-    }
-    
-    if (dst) {
-      switch (size) {
-      case 1: *(BYTE *) d = (BSG_BYTE) psize; break;
-      case 2: *(unsigned short*) d = (unsigned short) psize; break;
-      case 4: *(BSG_UINT32*) d = (BSG_UINT32) psize; break;
-      }
-    }
-
-    s += size;
-    d += size;
-    
-    BSG_BYTE* pdata = NULL;
-    
-    if (psize) {
-      if (format == __FMT_HSIZE) { // This is a list of psize Handles
-	if (dst) {
-	  BSG_HANDLE* s2 = (BSG_HANDLE*) s;
-	  pdata = (BSG_BYTE *)malloc(psize * sizeof(BSG_HANDLE));
-          if (!pdata)
-            return -1;
-          
-	  BSG_HANDLE* p2 = (BSG_HANDLE*) pdata;
-	  BSG_UINT32 i;
-	  for (i = 0; i < psize; i++) {
-	    BSG_PackConst(s2[i], 4, (BSG_BYTE*)(p2 + i));
-	  }
-	}
-	s += psize * sizeof(BSG_HANDLE);
-      } else { // If it's not psize handles, it's psize data.
-	if (dst) {
-	  pdata = (BSG_BYTE *)malloc(sizeof(BSG_BYTE) * psize);
-          if (!pdata)
-            return -1;
-	  memcpy(pdata, s, psize);
-	}
-	s += psize;
-      }
-    }
-    if (dst)
-      *(void**) d = pdata;
-
-    d += sizeof(void*);
-  } else if (format == __FMT_PACKED) {
-
-    // this doesn't make sense for unpacking!
-    vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack() called with format __FMT_PACKED. "
-							   "This does not make sense\n");
-    
-    return -1;
-  } else if (format == 0) {// No flags are set. This is a structure & it should
-                          // be looked up in the bsg_s_fmt[]
-
-    const BSG_Format* x = find_format (type);
-    if (x == NULL) {
-      vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack: cannot find type %d\n", type);
-      return -1;
-    }
-    
-    const BSG_UINT32* f = x->fields;
-    for (; *f; f++) {
-      int fsize = BSG_Unpack_private((BSG_Type) *f, s, dst ? &d:NULL);
-      if (fsize <= 0)
-	return fsize;
-      s += fsize;
-    }
-  }
-
-  if (dst)
-    *dst = d;
-  return (s - src);
-}
-
-/**
- * Free memory associated with unpacked TCPA structure
- * @type: TCPA structure type
- * @src: (IN) TCPA structure (OUT) end of TCPA structure
- * Note: Destroy should be called on all structures created with Unpack
- *       to ensure that any allocated memory is freed
- */
-static void BSG_Destroy_private(BSG_Type type, BSG_BYTE** src) {
-  BSG_BYTE* s = *src;
-  
-  BSG_UINT32 size = __FMT_MASK_SIZE(type);
-  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
-  
-  if ((src == NULL) || (*src == NULL)) {
-        vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy() called with NULL src\n");
-    return;
-  }
-
-  if (format == __FMT_CONST || format == __FMT_DATA)
-    s += size;
-  else if (format == __FMT_SIZE || format == __FMT_HSIZE) {
-    s += size;
-    BSG_BYTE* ptr = *(BSG_BYTE**) s;
-    free(ptr);
-    s += sizeof(void*);
-  } else if (format == __FMT_PACKED) {
-
-    // this doesn't make sense for unpacking, hence also for Destroy()
-    vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy() called with format __FMT_PACKED. "
-							   "This does not make sense\n");
-    
-    return;
-  } else if (format == 0) {
-    const BSG_Format* x = find_format (type);
-    if (x == NULL) {
-      vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy: cannot find type %d\n", type);
-      return;
-    }
-    
-    const BSG_UINT32* f = x->fields;
-    for (; *f; f++)
-      BSG_Destroy_private((BSG_Type) *f, &s);
-  }
-
-  *src = s;
-}
-
-int BSG_Pack(BSG_Type type, const void* src, BSG_BYTE* dst)
-{
-  const BSG_BYTE* src2 = (const BSG_BYTE*) src;
-  return BSG_Pack_private(type, &src2, dst);
-}
-
-int BSG_Unpack(BSG_Type type, const BSG_BYTE* src, void* dst)
-{
-  BSG_BYTE* dst2 = (BSG_BYTE*) dst;
-  return BSG_Unpack_private(type, src, dst ? &dst2:NULL);
-}
-
-void BSG_Destroy(BSG_Type type, void* src)
-{
-  BSG_BYTE* src2 = (BSG_BYTE*) src;
-  BSG_Destroy_private(type, &src2);
-}
-    
-/**
- * Pack a 8/16/32-bit constant into a buffer in big-endian format
- * @val: constant value
- * @size: constant size in bytes (1, 2, or 4)
- * @dst: (OUT) buffer
- */
-void BSG_PackConst(BSG_UINT32 val, int size, BSG_BYTE* dst) {
-  bsglog ("BSG: PackConst on %d of size %i into address %p\n", val, size, dst);
-  
-  switch (size) {
-  case 4:
-    dst[0] = (BSG_BYTE)((val >> 24) & 0xff);
-    dst[1] = (BSG_BYTE)((val >> 16) & 0xff);
-    dst[2] = (BSG_BYTE)((val >> 8) & 0xff);
-    dst[3] = (BSG_BYTE)(val & 0xff);
-    break;
-  case 2:
-    dst[0] = (BSG_BYTE)((val >> 8) & 0xff);
-    dst[1] = (BSG_BYTE)(val & 0xff);
-    break;
-  case 1:
-    dst[0] = (BSG_BYTE)(val & 0xff);
-    break;
-  }
-}
-
-/**
- * Unpack a 8/16/32-bit constant from a buffer in big-endian format
- * @src: buffer
- * @size: constant size in bytes (1, 2, or 4)
- */
-BSG_UINT32 BSG_UnpackConst(const BSG_BYTE* src, int size) {
-  BSG_UINT32 val = 0;
-  
-  if (src == NULL) 
-    return 0;
-  
-  switch (size) {
-  case 4:
-    val = (((BSG_UINT32) src[0]) << 24
-	   | ((BSG_UINT32) src[1]) << 16
-	   | ((BSG_UINT32) src[2]) << 8
-	   | (BSG_UINT32) src[3]);
-    break;
-  case 2:
-    val = (((BSG_UINT32) src[0]) << 8 | (BSG_UINT32) src[1]);
-    break;
-  case 1:
-    val = (BSG_UINT32) src[0];
-    break;
-  }  
-  return val;
-}
-
-// Pack a list of parameters. Beware not to send values, but rather you must
-// send a pointer to your values Instead. This includes UINT32's.
-int BSG_PackList( BSG_BYTE* dst, int ParamCount, ... ) {
-  int ParamNumber;
-  BSG_Type format; 
-  BSG_BYTE* val = NULL;
-  int size=0;
-  
-  va_list paramList;
-  va_start( paramList, ParamCount );
-
-  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
-    //Strangeness with int is because gcc wanted an int rather than a enum of ints.
-    format =  (BSG_Type) va_arg( paramList, int );
-    val = va_arg( paramList, BSG_BYTE* );    
-    size += BSG_Pack(format, val, dst == NULL ? NULL : dst + size);
-  }
-  
-  va_end (paramList);
-  
-  return size;
-}
-
-// Unpack a list of parameters. 
-int BSG_UnpackList( const BSG_BYTE* src, int ParamCount, ... ) {
-  int ParamNumber = 0;
-  BSG_Type format; 
-  BSG_BYTE* val = NULL;
-  int size = 0;
-  
-  va_list paramList;
-  va_start( paramList, ParamCount );
-  
-  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
-    format = (BSG_Type) va_arg( paramList, int );
-    val  = va_arg( paramList, BSG_BYTE* );
-    
-    size += BSG_Unpack(format, src + size, val);
-  }
-  
-  va_end( paramList );   
-  
-  return size;
-}
-
-// Destroy any memory allocated by calls to unpack 
-void BSG_DestroyList(int ParamCount, ... ) {
-  int ParamNumber = 0;
-  BSG_Type argType; 
-  BSG_BYTE* paramValue = NULL;
-  
-  va_list paramList;
-  va_start( paramList, ParamCount );
-  
-  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
-    argType = (BSG_Type) va_arg( paramList, int );
-    paramValue  = va_arg( paramList, BSG_BYTE* );
-    
-    BSG_Destroy(argType, paramValue);
-  }
-  
-  va_end( paramList );   
-  
-  return;
-}
-
-
-// and a tuple version
-TPM_RESULT BSG_DestroyTuple (int numParams, pack_tuple_t params[]) {
-  int i;
-  
-  for (i = 0; i < numParams; i++)
-    BSG_Destroy (params[i].type, params[i].addr);
-
-  return TPM_SUCCESS;
-}
-
-
-//
-// wrappers of Pack and PackList which malloc the ouput buffer. to be freed
-// by the caller later
-//
-
-int BSG_PackMalloc (BSG_Type type, const void* src, BSG_BYTE** o_dst) {
-  int size = BSG_Pack (type, src, NULL);
-  BSG_BYTE * dest = (BSG_BYTE*) malloc (size);
-  if (dest == NULL)
-    return -1;
-
-  size = BSG_Pack(type, src, dest);
-  *o_dst = dest;
-  return size;
-}
-
-
-
-int BSG_PackListMalloc(BSG_BYTE** outBuffer, int ParamCount, ... ) {
-  va_list args;
-  int size;
-  
-  va_start (args, ParamCount);
-  size = BSG_PackList (NULL, ParamCount, args);
-  va_end (args);
-  
-  BSG_BYTE * dest = (BSG_BYTE*) malloc (size);
-  if (dest == NULL)
-    return -1;
-
-  va_start (args, ParamCount);
-  size = BSG_PackList (dest, ParamCount, args);
-  va_end (args);
-  
-  *outBuffer = dest;
-  return size;
-}
diff --git a/tools/vtpm_manager/util/bsg.h b/tools/vtpm_manager/util/bsg.h
deleted file mode 100644
index 0896812..0000000
--- a/tools/vtpm_manager/util/bsg.h
+++ /dev/null
@@ -1,166 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// bsg.h
-// 
-//  This file contains API's for the TPM Byte Stream functions
-//
-// ==================================================================
-
-#ifndef __BSG_H__
-#define __BSG_H__
-
-#include <stdarg.h>
-#include "buffer.h"
-
-typedef unsigned int BSG_UINT32;
-typedef unsigned char BSG_BYTE;
-
-// forward decl
-struct pack_const_tuple_t;
-
-struct pack_tuple_t;
-
-
-/**
- * Byte stream generator
- */
-// this has to be manually kept in sync with the
-// s_fmt array!!
-// but now we have a self-check function which can make sure things are well
-// (if used!) 
-typedef enum BSG_Type
-{ 
-  BSG_TYPE_FIRST = 1,
-  BSG_TYPE_UINT32 = 1, // start at 1 so that Type 0 only serves as an
-                       // unused/special value
-  BSG_TYPE_UINT16,
-  BSG_TYPE_BYTE,
-  BSG_TYPE_BOOL,
-  BSG_TPM_SIZE32_DATA,  // a 32 bit unsigned size, followed by
-                        // a pointer to that much data. can pass a
-                        // struct pack_buf_t as the param
-  BSG_TPM_TAG,
-  BSG_TPM_HANDLE,
-  BSG_TPM_RESULT,
-  BSG_TPM_RESOURCE_TYPE,
-  BSG_TPM_COMMAND_CODE,
-  BSG_TPM_AUTH_DATA_USAGE,
-  BSG_TPM_ALGORITHM_ID,
-  BSG_TPM_PROTOCOL_ID,
-  BSG_TPM_KEY_USAGE,
-  BSG_TPM_ENC_SCHEME,
-  BSG_TPM_SIG_SCHEME,
-  BSG_TPM_MIGRATE_SCHEME,
-  BSG_TPM_KEY_FLAGS,
-  BSG_TPM_AUTHDATA,
-  BSG_TPM_SECRET,
-  BSG_TPM_ENCAUTH,
-  BSG_TPM_PAYLOAD_TYPE,
-  
-  BSG_TPM_VERSION,
-  BSG_TPM_DIGEST,
-  BSG_TPM_COMPOSITE_HASH,
-  BSG_TPM_CHOSENID_HASH,
-  BSG_TPM_NONCE,
-  BSG_TPM_KEY_HANDLE,
-  BSG_TPM_KEY_HANDLE_LIST,
-  BSG_TPM_KEY_PARMS,
-  BSG_TPM_RSA_KEY_PARMS,
-  BSG_TPM_STORE_PUBKEY,
-  BSG_TPM_PUBKEY,
-  BSG_TPM_KEY,
-  
-  BSG_TPM_MIGRATIONKEYAUTH,
-  BSG_TCPA_AUDIT_EVENT,
-  BSG_TCPA_EVENT_CERT,
-  BSG_TPM_PCR_SELECTION,
-  BSG_TPM_PCR_COMPOSITE,
-  BSG_TPM_PCR_INFO,
-  BSG_TPM_STORED_DATA,
-  BSG_TPM_SYMMETRIC_KEY,
-  BSG_TPM_STORE_PRIVKEY,
-  BSG_TPM_STORE_ASYMKEY,
-  BSG_TPM_MIGRATE_ASYMKEY,
-  BSG_TPM_QUOTE_INFO,
-  BSG_TPM_IDENTITY_CONTENTS,
-  BSG_TPM_PCRVALUE,
-  BSG_TCPA_PCR_FLAGS,
-  BSG_TCS_AUTH,
-  
-  // this is the BSG_TPM_KEY struct without the encData field
-  BSG_TPM_KEY_NONSENSITIVE,
-  
-  BSG_PACKED,
-  
-  BSG_TYPE_MAX
-} BSG_Type;
-
-struct pack_const_tuple_t {
-  BSG_Type type;
-  const void * addr;
-};
-
-
-typedef struct pack_tuple_t {
-  BSG_Type type;
-  void * addr;
-} pack_tuple_t;
-
-int BSG_Pack(BSG_Type type, const void* src, BSG_BYTE* dst);
-int BSG_Unpack(BSG_Type type, const BSG_BYTE* src, void* dst);
-void BSG_Destroy(BSG_Type type, void* src);
-
-// wrappers of Pack and PackList which malloc the ouput buffer. to be freed
-// by the caller later. returns size of allocated buffer, or -1 in case
-// allocation failed
-int BSG_PackMalloc (BSG_Type type, const void* src, BSG_BYTE** o_dst);
-int BSG_PackListMalloc (BSG_BYTE** outBuffer, int ParamCount, ... );
-
-// a va_list version of PackList
-int BSG_PackList(BSG_BYTE* outBuffer, int ParamCount, ... );
-int BSG_UnpackList(const BSG_BYTE* inBuffer, int ParamCount, ... );
-void BSG_DestroyList(int ParamCount, ... );
-
-// wrapper of PackList which uses a buffer_t
-TPM_RESULT BSG_PackListBuf (buffer_t * o_buf, int ParamCount, ...);
-
-// and a tuple version
-TPM_RESULT BSG_DestroyTuple (int numParams, pack_tuple_t params[]);
-
-void BSG_PackConst(BSG_UINT32 val, int size, BSG_BYTE* dst);
-BSG_UINT32 BSG_UnpackConst(const BSG_BYTE* src, int size);
-
-BOOL BSG_static_selfcheck ();
-
-#endif
diff --git a/tools/vtpm_manager/util/buffer.c b/tools/vtpm_manager/util/buffer.c
deleted file mode 100644
index df48bc2..0000000
--- a/tools/vtpm_manager/util/buffer.c
+++ /dev/null
@@ -1,226 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-
-
-#include <stdarg.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/param.h>
-
-#include "tcg.h"
-#include "bsg.h"
-#include "buffer.h"
-
-static TPM_RESULT buffer_priv_realloc (buffer_t * buf, tpm_size_t newsize);
-
-//
-// buffer functions!
-//
-
-TPM_RESULT buffer_init (buffer_t * buf, tpm_size_t initsize, const BYTE* initval) {
-  if (initsize == 0) {
-    memset(buf, 0, sizeof(*buf));
-    return TPM_SUCCESS;
-  }
-  
-  
-  buf->bytes = (BYTE*) malloc (initsize);
-  if (buf->bytes == NULL) 
-    return TPM_RESOURCES;
-  
-  buf->size = initsize;
-  buf->alloc_size = initsize;
-  
-  if (initval)
-    memcpy (buf->bytes, initval, initsize);
-  
-  buf->is_owner = TRUE;
-  
-  return TPM_SUCCESS;
-}
-
-TPM_RESULT buffer_init_convert (buffer_t * buf, tpm_size_t initsize, BYTE* initval) {
-  
-  buf->size = initsize;
-  buf->alloc_size = initsize;
-  buf->bytes = initval;
-  
-  buf->is_owner = TRUE;
-  
-  return TPM_SUCCESS;
-}
-
-TPM_RESULT buffer_init_copy (buffer_t * buf, const buffer_t * src) {
-  TPM_RESULT status = buffer_init (buf, src->size, src->bytes);
-  buf->is_owner = TRUE;
-  
-  return status;
-}
-
-
-
-// make an alias to a constant array
-TPM_RESULT buffer_init_const (buffer_t * buf, tpm_size_t size, const BYTE* val) {
-  // TODO: try to enforce the const things somehow!
-  buf->bytes = (BYTE*) val;
-  buf->size = size;
-  buf->alloc_size = 0;        // this field is now unneeded
-  
-  buf->is_owner = FALSE;
-  
-  return TPM_SUCCESS;
-}
-
-// make an alias into buf, with given offset and length
-// if len = 0, make the alias go to the end of buf
-TPM_RESULT buffer_init_alias (buffer_t * buf, const buffer_t * b,
-                              tpm_size_t offset, tpm_size_t len) {
-  if (offset + len > b->size) {
-    return TPM_NOSPACE;
-  }
-  
-  buf->bytes = b->bytes + offset;
-  buf->size = len > 0 ? len : b->size - offset;
-  
-  //VS/ buf->alloc_size = 0;
-  if (len ==0)
-    buf->alloc_size = b->alloc_size - offset;
-  else 
-    buf->alloc_size = MIN(b->alloc_size - offset, len);
-  
-        
-  buf->is_owner = FALSE;
-  
-  return TPM_SUCCESS;
-}
-
-// make an alias buffer_t into bytestream, with given length
-TPM_RESULT buffer_init_alias_convert (buffer_t * buf, tpm_size_t size, BYTE* val) {
-
-  buf->size = size;
-  buf->alloc_size = size;
-  buf->bytes = val;
-
-  buf->is_owner = FALSE;
-
-  return TPM_SUCCESS;
-}
-
- 
-
-// copy into the start of dest
-TPM_RESULT buffer_copy (buffer_t * dest, const buffer_t* src)
-{
-  TPM_RESULT status = TPM_SUCCESS;
-    
-  if (dest->alloc_size < src->size) {  
-    TPMTRYRETURN( buffer_priv_realloc (dest, src->size) );
-  }
-  
-  memcpy (dest->bytes, src->bytes, src->size);
-  dest->size = src->size;
-  
-  //VS/ dest->is_owner = TRUE;
-  
- abort_egress:
-
-  return status;
-}
-
-
-
-BOOL buffer_eq (const buffer_t * a, const buffer_t * b) {
-  return (a->size == b->size && memcmp (a->bytes, b->bytes, a->size) == 0);
-}
-
-
-void buffer_memset (buffer_t * buf, BYTE b) {
-  memset (buf->bytes, b, buf->size);
-}
-
-
-TPM_RESULT buffer_append_raw (buffer_t * buf, tpm_size_t len, const BYTE* bytes) {
-  TPM_RESULT status = TPM_SUCCESS;
-  
-  if (buf->alloc_size < buf->size + len) {
-    TPMTRYRETURN( buffer_priv_realloc (buf, buf->size + len) );
-  }
-  
-  memcpy (buf->bytes + buf->size, bytes, len);
-  
-  buf->size += len;
-  
-  goto egress;
-  
- abort_egress:
-  
- egress:
-  
-  return status;
-}
-
-tpm_size_t buffer_len (const buffer_t* buf) {
-  return buf->size;
-}
-
-TPM_RESULT buffer_free (buffer_t * buf) {
-  if (buf && buf->is_owner && buf->bytes != NULL) {
-    free (buf->bytes);
-    buf->bytes = NULL;
-    buf->size = buf->alloc_size = 0;
-   
-  }
-  
-  return TPM_SUCCESS;
-}
-
-TPM_RESULT buffer_priv_realloc (buffer_t * buf, tpm_size_t newsize) {
-  
-  // we want to realloc to twice the size, or the new size, whichever
-  // bigger
-  
-  BYTE * tmpbuf = NULL;
-  
-  newsize = MAX (buf->alloc_size * 2, newsize);
-  
-  tmpbuf = (BYTE*) realloc (buf->bytes, newsize);
-  if (tmpbuf == NULL) 
-    return TPM_SIZE;
-  
-  
-  buf->bytes = tmpbuf;
-  buf->alloc_size = newsize;
-  
-  return TPM_SUCCESS;
-}
diff --git a/tools/vtpm_manager/util/buffer.h b/tools/vtpm_manager/util/buffer.h
deleted file mode 100644
index d8a9abc..0000000
--- a/tools/vtpm_manager/util/buffer.h
+++ /dev/null
@@ -1,95 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-
-#ifndef __VTPM_BUFFER_H__
-#define __VTPM_BUFFER_H__
-
-#include <stddef.h>             // for pointer NULL
-#include "tcg.h"
-
-typedef UINT32 tpm_size_t;
-
-// first version, probably will be expanded...
-
-#define NULL_BUF {0,0,0,0}
-
-typedef struct {
-  // private!!
-  tpm_size_t size, alloc_size;
-  BYTE * bytes;
-  
-  BOOL is_owner;              // do we own this buffer, and need to free it?
-} buffer_t;
-
-// allocate the buffer if initsize > 0, copying over initval if provided
-TPM_RESULT buffer_init (buffer_t * buf,
-                        tpm_size_t initsize,
-                        const BYTE* initval);
-
-// Create a new buffer from a BYTE *. Use buffer_free to destroy original BYTE *
-TPM_RESULT buffer_init_convert (buffer_t * buf, 
-                                tpm_size_t initsize, 
-                                BYTE* initval);
-
-// make an alias to a constant array, no copying
-TPM_RESULT buffer_init_const (buffer_t * buf, tpm_size_t size, const BYTE* val);
-
-// make an alias into buf, with given offset and length
-// if len = 0, make the alias go to the end of buf
-TPM_RESULT buffer_init_alias (buffer_t * buf, const buffer_t * b,
-                              tpm_size_t offset, tpm_size_t);
-
-// make an alias buffer into a bytestream
-TPM_RESULT buffer_init_alias_convert (buffer_t * buf, 
-                                      tpm_size_t size, BYTE* val);
-
-// "copy constructor"
-TPM_RESULT buffer_init_copy (buffer_t * buf, const buffer_t * src);
-
-
-// copy into the start of a
-TPM_RESULT buffer_copy (buffer_t * dest, const buffer_t* src);
-
-// are they equal?
-BOOL buffer_eq (const buffer_t * a, const buffer_t * b);
-
-// set the buffer to a constant byte
-void buffer_memset (buffer_t * buf, BYTE b);
-
-tpm_size_t buffer_len (const buffer_t* buf);
-
-TPM_RESULT buffer_free (buffer_t * buf);
-
-TPM_RESULT buffer_append_raw (buffer_t * buf, tpm_size_t len, const BYTE* bytes);
-
-#endif // _TOOLS_H_
diff --git a/tools/vtpm_manager/util/hashtable.c b/tools/vtpm_manager/util/hashtable.c
deleted file mode 100644
index aff0e2b..0000000
--- a/tools/vtpm_manager/util/hashtable.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * Copyright (c) 2005, Intel Corp
- * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk> 
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 
- * * Neither the name of the original author; nor the names of any contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
- * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*
- * There are duplicates of this code in:
- *  - tools/xenstore/hashtable.c
- *  - tools/blktap2/drivers/hashtable.c
- */
-
-#include "hashtable.h"
-#include "hashtable_private.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-/*
-Credit for primes table: Aaron Krowne
- http://br.endernet.org/~akrowne/
- http://planetmath.org/encyclopedia/GoodHashTablePrimes.html
-*/
-static const unsigned int primes[] = {
-53, 97, 193, 389,
-769, 1543, 3079, 6151,
-12289, 24593, 49157, 98317,
-196613, 393241, 786433, 1572869,
-3145739, 6291469, 12582917, 25165843,
-50331653, 100663319, 201326611, 402653189,
-805306457, 1610612741
-};
-const unsigned int prime_table_length = sizeof(primes)/sizeof(primes[0]);
-const float max_load_factor = 0.65;
-
-/*****************************************************************************/
-struct hashtable *
-create_hashtable(unsigned int minsize,
-                 unsigned int (*hashf) (void*),
-                 int (*eqf) (void*,void*))
-{
-    struct hashtable *h;
-    unsigned int pindex, size = primes[0];
-    /* Check requested hashtable isn't too large */
-    if (minsize > (1u << 30)) return NULL;
-    /* Enforce size as prime */
-    for (pindex=0; pindex < prime_table_length; pindex++) {
-        if (primes[pindex] > minsize) { size = primes[pindex]; break; }
-    }
-    h = (struct hashtable *)malloc(sizeof(struct hashtable));
-    if (NULL == h) return NULL; /*oom*/
-    h->table = (struct entry **)malloc(sizeof(struct entry*) * size);
-    if (NULL == h->table) { free(h); return NULL; } /*oom*/
-    memset(h->table, 0, size * sizeof(struct entry *));
-    h->tablelength  = size;
-    h->primeindex   = pindex;
-    h->entrycount   = 0;
-    h->hashfn       = hashf;
-    h->eqfn         = eqf;
-    h->loadlimit    = (unsigned int) ceil(size * max_load_factor);
-#ifdef HASHTABLE_THREADED    
-    pthread_mutex_init(&h->mutex, NULL);
-#endif
-    return h;
-}
-
-/*****************************************************************************/
-unsigned int
-hash(struct hashtable *h, void *k)
-{
-    unsigned int i = h->hashfn(k);
-    i += ~(i << 9);
-    i ^=  ((i >> 14) | (i << 18)); /* >>> */
-    i +=  (i << 4);
-    i ^=  ((i >> 10) | (i << 22)); /* >>> */
-    return i;
-}
-
-/*****************************************************************************/
-static int
-hashtable_expand(struct hashtable *h)
-{
-    /* Double the size of the table to accomodate more entries */
-    struct entry **newtable;
-    struct entry *e;
-    struct entry **pE;
-    unsigned int newsize, i, index;
-    /* Check we're not hitting max capacity */
-    if (h->primeindex == (prime_table_length - 1)) return 0;
-    newsize = primes[++(h->primeindex)];
-
-    newtable = (struct entry **)malloc(sizeof(struct entry*) * newsize);
-    if (NULL != newtable)
-    {
-        memset(newtable, 0, newsize * sizeof(struct entry *));
-        /* This algorithm is not 'stable'. ie. it reverses the list
-         * when it transfers entries between the tables */
-        for (i = 0; i < h->tablelength; i++) {
-            while (NULL != (e = h->table[i])) {
-                h->table[i] = e->next;
-                index = indexFor(newsize,e->h);
-                e->next = newtable[index];
-                newtable[index] = e;
-            }
-        }
-        free(h->table);
-        h->table = newtable;
-    }
-    /* Plan B: realloc instead */
-    else 
-    {
-        newtable = (struct entry **)
-                   realloc(h->table, newsize * sizeof(struct entry *));
-        if (NULL == newtable) { (h->primeindex)--; return 0; }
-        h->table = newtable;
-        memset(newtable[h->tablelength], 0, newsize - h->tablelength);
-        for (i = 0; i < h->tablelength; i++) {
-            for (pE = &(newtable[i]), e = *pE; e != NULL; e = *pE) {
-                index = indexFor(newsize,e->h);
-                if (index == i)
-                {
-                    pE = &(e->next);
-                }
-                else
-                {
-                    *pE = e->next;
-                    e->next = newtable[index];
-                    newtable[index] = e;
-                }
-            }
-        }
-    }
-    h->tablelength = newsize;
-    h->loadlimit   = (unsigned int) ceil(newsize * max_load_factor);
-    return -1;
-}
-
-/*****************************************************************************/
-unsigned int
-hashtable_count(struct hashtable *h)
-{
-    unsigned int count;
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_lock(&h->mutex);
-#endif    
-    count = h->entrycount;
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_unlock(&h->mutex);
-#endif
-    return count;
-}
-
-/*****************************************************************************/
-int
-hashtable_insert(struct hashtable *h, void *k, void *v)
-{
-    /* This method allows duplicate keys - but they shouldn't be used */
-    unsigned int index;
-    struct entry *e;
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_lock(&h->mutex);
-#endif   
-    if (++(h->entrycount) > h->loadlimit)
-    {
-        /* Ignore the return value. If expand fails, we should
-         * still try cramming just this value into the existing table
-         * -- we may not have memory for a larger table, but one more
-         * element may be ok. Next time we insert, we'll try expanding again.*/
-        hashtable_expand(h);
-    }
-    e = (struct entry *)malloc(sizeof(struct entry));
-    if (NULL == e) { --(h->entrycount); return 0; } /*oom*/
-    e->h = hash(h,k);
-    index = indexFor(h->tablelength,e->h);
-    e->k = k;
-    e->v = v;
-    e->next = h->table[index];
-    h->table[index] = e;
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_unlock(&h->mutex);
-#endif   
-    return -1;
-}
-
-/*****************************************************************************/
-void * /* returns value associated with key */
-hashtable_search(struct hashtable *h, void *k)
-{
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_lock(&h->mutex);
-#endif   
-    struct entry *e;
-    unsigned int hashvalue, index;
-    hashvalue = hash(h,k);
-    index = indexFor(h->tablelength,hashvalue);
-    e = h->table[index];
-    while (NULL != e)
-    {
-        /* Check hash value to short circuit heavier comparison */
-        if ((hashvalue == e->h) && (h->eqfn(k, e->k))) {
-#ifdef HASHTABLE_THREADED
-          pthread_mutex_unlock(&h->mutex);
-#endif   
-          return e->v;
-        }
-        e = e->next;
-    }
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_unlock(&h->mutex);
-#endif   
-    return NULL;
-}
-
-/*****************************************************************************/
-void * /* returns value associated with key */
-hashtable_remove(struct hashtable *h, void *k)
-{
-    /* TODO: consider compacting the table when the load factor drops enough,
-     *       or provide a 'compact' method. */
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_lock(&h->mutex);
-#endif   
-    struct entry *e;
-    struct entry **pE;
-    void *v;
-    unsigned int hashvalue, index;
-
-    hashvalue = hash(h,k);
-    index = indexFor(h->tablelength,hash(h,k));
-    pE = &(h->table[index]);
-    e = *pE;
-    while (NULL != e)
-    {
-        /* Check hash value to short circuit heavier comparison */
-        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
-        {
-            *pE = e->next;
-            h->entrycount--;
-            v = e->v;
-            freekey(e->k);
-            free(e);
-            return v;
-        }
-        pE = &(e->next);
-        e = e->next;
-    }
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_unlock(&h->mutex);
-#endif   
-    return NULL;
-}
-
-/*****************************************************************************/
-/* destroy */
-void
-hashtable_destroy(struct hashtable *h, int free_values)
-{
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_lock(&h->mutex);
-#endif   
-    unsigned int i;
-    struct entry *e, *f;
-    struct entry **table = h->table;
-    if (free_values)
-    {
-        for (i = 0; i < h->tablelength; i++)
-        {
-            e = table[i];
-            while (NULL != e)
-            { f = e; e = e->next; freekey(f->k); free(f->v); free(f); }
-        }
-    }
-    else
-    {
-        for (i = 0; i < h->tablelength; i++)
-        {
-            e = table[i];
-            while (NULL != e)
-            { f = e; e = e->next; freekey(f->k); free(f); }
-        }
-    }
-    free(h->table);
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_destroy(&h->mutex);
-#endif   
-    free(h);
-}
diff --git a/tools/vtpm_manager/util/hashtable.h b/tools/vtpm_manager/util/hashtable.h
deleted file mode 100644
index dedc60a..0000000
--- a/tools/vtpm_manager/util/hashtable.h
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright (c) 2005, Intel Corp
- * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk> 
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 
- * * Neither the name of the original author; nor the names of any contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
- * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*
- * There are duplicates of this code in:
- *  - tools/xenstore/hashtable.h
- *  - tools/blktap2/drivers/hashtable.h
- */
-
-#ifndef __HASHTABLE_CWC22_H__
-#define __HASHTABLE_CWC22_H__
-
-struct hashtable;
-
-/* Example of use:
- *
- *      struct hashtable  *h;
- *      struct some_key   *k;
- *      struct some_value *v;
- *
- *      static unsigned int         hash_from_key_fn( void *k );
- *      static int                  keys_equal_fn ( void *key1, void *key2 );
- *
- *      h = create_hashtable(16, hash_from_key_fn, keys_equal_fn);
- *      k = (struct some_key *)     malloc(sizeof(struct some_key));
- *      v = (struct some_value *)   malloc(sizeof(struct some_value));
- *
- *      (initialise k and v to suitable values)
- * 
- *      if (! hashtable_insert(h,k,v) )
- *      {     exit(-1);               }
- *
- *      if (NULL == (found = hashtable_search(h,k) ))
- *      {    printf("not found!");                  }
- *
- *      if (NULL == (found = hashtable_remove(h,k) ))
- *      {    printf("Not found\n");                 }
- *
- */
-
-/* Macros may be used to define type-safe(r) hashtable access functions, with
- * methods specialized to take known key and value types as parameters.
- * 
- * Example:
- *
- * Insert this at the start of your file:
- *
- * DEFINE_HASHTABLE_INSERT(insert_some, struct some_key, struct some_value);
- * DEFINE_HASHTABLE_SEARCH(search_some, struct some_key, struct some_value);
- * DEFINE_HASHTABLE_REMOVE(remove_some, struct some_key, struct some_value);
- *
- * This defines the functions 'insert_some', 'search_some' and 'remove_some'.
- * These operate just like hashtable_insert etc., with the same parameters,
- * but their function signatures have 'struct some_key *' rather than
- * 'void *', and hence can generate compile time errors if your program is
- * supplying incorrect data as a key (and similarly for value).
- *
- * Note that the hash and key equality functions passed to create_hashtable
- * still take 'void *' parameters instead of 'some key *'. This shouldn't be
- * a difficult issue as they're only defined and passed once, and the other
- * functions will ensure that only valid keys are supplied to them.
- *
- * The cost for this checking is increased code size and runtime overhead
- * - if performance is important, it may be worth switching back to the
- * unsafe methods once your program has been debugged with the safe methods.
- * This just requires switching to some simple alternative defines - eg:
- * #define insert_some hashtable_insert
- *
- */
-
-/*****************************************************************************
- * create_hashtable
-   
- * @name                    create_hashtable
- * @param   minsize         minimum initial size of hashtable
- * @param   hashfunction    function for hashing keys
- * @param   key_eq_fn       function for determining key equality
- * @return                  newly created hashtable or NULL on failure
- */
-
-struct hashtable *
-create_hashtable(unsigned int minsize,
-                 unsigned int (*hashfunction) (void*),
-                 int (*key_eq_fn) (void*,void*));
-
-/*****************************************************************************
- * hashtable_insert
-   
- * @name        hashtable_insert
- * @param   h   the hashtable to insert into
- * @param   k   the key - hashtable claims ownership and will free on removal
- * @param   v   the value - does not claim ownership
- * @return      non-zero for successful insertion
- *
- * This function will cause the table to expand if the insertion would take
- * the ratio of entries to table size over the maximum load factor.
- *
- * This function does not check for repeated insertions with a duplicate key.
- * The value returned when using a duplicate key is undefined -- when
- * the hashtable changes size, the order of retrieval of duplicate key
- * entries is reversed.
- * If in doubt, remove before insert.
- */
-
-int 
-hashtable_insert(struct hashtable *h, void *k, void *v);
-
-#define DEFINE_HASHTABLE_INSERT(fnname, keytype, valuetype) \
-int fnname (struct hashtable *h, keytype *k, valuetype *v) \
-{ \
-    return hashtable_insert(h,k,v); \
-}
-
-/*****************************************************************************
- * hashtable_search
-   
- * @name        hashtable_search
- * @param   h   the hashtable to search
- * @param   k   the key to search for  - does not claim ownership
- * @return      the value associated with the key, or NULL if none found
- */
-
-void *
-hashtable_search(struct hashtable *h, void *k);
-
-#define DEFINE_HASHTABLE_SEARCH(fnname, keytype, valuetype) \
-valuetype * fnname (struct hashtable *h, keytype *k) \
-{ \
-    return (valuetype *) (hashtable_search(h,k)); \
-}
-
-/*****************************************************************************
- * hashtable_remove
-   
- * @name        hashtable_remove
- * @param   h   the hashtable to remove the item from
- * @param   k   the key to search for  - does not claim ownership
- * @return      the value associated with the key, or NULL if none found
- */
-
-void * /* returns value */
-hashtable_remove(struct hashtable *h, void *k);
-
-#define DEFINE_HASHTABLE_REMOVE(fnname, keytype, valuetype) \
-valuetype * fnname (struct hashtable *h, keytype *k) \
-{ \
-    return (valuetype *) (hashtable_remove(h,k)); \
-}
-
-
-/*****************************************************************************
- * hashtable_count
-   
- * @name        hashtable_count
- * @param   h   the hashtable
- * @return      the number of items stored in the hashtable
- */
-unsigned int
-hashtable_count(struct hashtable *h);
-
-
-/*****************************************************************************
- * hashtable_destroy
-   
- * @name        hashtable_destroy
- * @param   h   the hashtable
- * @param       free_values     whether to call 'free' on the remaining values
- */
-
-void
-hashtable_destroy(struct hashtable *h, int free_values);
-
-#endif /* __HASHTABLE_CWC22_H__ */
diff --git a/tools/vtpm_manager/util/hashtable_itr.c b/tools/vtpm_manager/util/hashtable_itr.c
deleted file mode 100644
index dcf42c8..0000000
--- a/tools/vtpm_manager/util/hashtable_itr.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (c) 2005, Intel Corp
- * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk> 
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 
- * * Neither the name of the original author; nor the names of any contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
- * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*
- * There are duplicates of this code in:
- *  - tools/blktap2/drivers/hashtable_itr.c
- */
-
-#include "hashtable.h"
-#include "hashtable_private.h"
-#include "hashtable_itr.h"
-#include <stdlib.h> /* defines NULL */
-
-/*****************************************************************************/
-/* hashtable_iterator    - iterator constructor */
-
-struct hashtable_itr *
-hashtable_iterator(struct hashtable *h)
-{
-    unsigned int i, tablelength;
-    struct hashtable_itr *itr = (struct hashtable_itr *)
-        malloc(sizeof(struct hashtable_itr));
-    if (NULL == itr) return NULL;
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_lock(&h->mutex);
-#endif   
-    itr->h = h;
-    itr->e = NULL;
-    itr->parent = NULL;
-    tablelength = h->tablelength;
-    itr->index = tablelength;
-    if (0 == h->entrycount) {
-#ifdef HASHTABLE_THREADED
-      pthread_mutex_unlock(&h->mutex);
-#endif   
-      return itr;
-    }
-
-    for (i = 0; i < tablelength; i++)
-    {
-        if (NULL != h->table[i])
-        {
-            itr->e = h->table[i];
-            itr->index = i;
-            break;
-        }
-    }
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_unlock(&h->mutex);
-#endif   
-    return itr;
-}
-
-/*****************************************************************************/
-/* key      - return the key of the (key,value) pair at the current position */
-/* value    - return the value of the (key,value) pair at the current position */
-
-void *
-hashtable_iterator_key(struct hashtable_itr *i)
-{ return i->e->k; }
-
-void *
-hashtable_iterator_value(struct hashtable_itr *i)
-{ return i->e->v; }
-
-/*****************************************************************************/
-/* advance - advance the iterator to the next element
- *           returns zero if advanced to end of table */
-
-int
-hashtable_iterator_advance(struct hashtable_itr *itr)
-{
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_lock(&itr->h->mutex);
-#endif   
-    unsigned int j,tablelength;
-    struct entry **table;
-    struct entry *next;
-    int ret;
-    if (NULL == itr->e) { /* stupidity check */
-      ret = 0; 
-      goto egress;
-    }
-
-    next = itr->e->next;
-    if (NULL != next)
-    {
-        itr->parent = itr->e;
-        itr->e = next;
-        ret = -1;
-        goto egress;
-    }
-
-    tablelength = itr->h->tablelength;
-    itr->parent = NULL;
-    if (tablelength <= (j = ++(itr->index)))
-    {
-        itr->e = NULL;
-        ret = 0;
-        goto egress;
-    }
-    table = itr->h->table;
-    while (NULL == (next = table[j]))
-    {
-        if (++j >= tablelength)
-        {
-            itr->index = tablelength;
-            itr->e = NULL;
-            ret = 0;
-            goto egress;
-        }
-    }
-    itr->index = j;
-    itr->e = next;
-    ret = -1;
-
- egress:
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_unlock(&itr->h->mutex);
-#endif   
-    return ret;
-}
-
-/*****************************************************************************/
-/* remove - remove the entry at the current iterator position
- *          and advance the iterator, if there is a successive
- *          element.
- *          If you want the value, read it before you remove:
- *          beware memory leaks if you don't.
- *          Returns zero if end of iteration. */
-
-int
-hashtable_iterator_remove(struct hashtable_itr *itr)
-{
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_lock(&itr->h->mutex);
-#endif 
-    struct entry *remember_e, *remember_parent;
-    int ret;
-
-    /* Do the removal */
-    if (NULL == (itr->parent))
-    {
-        /* element is head of a chain */
-        itr->h->table[itr->index] = itr->e->next;
-    } else {
-        /* element is mid-chain */
-        itr->parent->next = itr->e->next;
-    }
-    /* itr->e is now outside the hashtable */
-    remember_e = itr->e;
-    itr->h->entrycount--;
-    freekey(remember_e->k);
-
-    /* Advance the iterator, correcting the parent */
-    remember_parent = itr->parent;
-    ret = hashtable_iterator_advance(itr);
-    if (itr->parent == remember_e) { itr->parent = remember_parent; }
-    free(remember_e);
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_unlock(&itr->h->mutex);
-#endif 
-    return ret;
-}
-
-/*****************************************************************************/
-int /* returns zero if not found */
-hashtable_iterator_search(struct hashtable_itr *itr,
-                          struct hashtable *h, void *k)
-{
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_lock(&h->mutex);
-#endif 
-    struct entry *e, *parent;
-    unsigned int hashvalue, index;
-    int ret;
-    
-    hashvalue = hash(h,k);
-    index = indexFor(h->tablelength,hashvalue);
-
-    e = h->table[index];
-    parent = NULL;
-    while (NULL != e)
-    {
-        /* Check hash value to short circuit heavier comparison */
-        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
-        {
-            itr->index = index;
-            itr->e = e;
-            itr->parent = parent;
-            itr->h = h;
-            ret= -1;
-            goto egress;
-        }
-        parent = e;
-        e = e->next;
-    }
-  ret = 0;
-    
-egress:
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_unlock(&h->mutex);
-#endif 
-    return ret;
-}
diff --git a/tools/vtpm_manager/util/hashtable_itr.h b/tools/vtpm_manager/util/hashtable_itr.h
deleted file mode 100644
index 35654e0..0000000
--- a/tools/vtpm_manager/util/hashtable_itr.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2005, Intel Corp
- * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk> 
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 
- * * Neither the name of the original author; nor the names of any contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
- * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*
- * There are duplicates of this code in:
- *  - tools/blktap2/drivers/hashtable_itr.h
- */
-
-
-#ifndef __HASHTABLE_ITR_CWC22__
-#define __HASHTABLE_ITR_CWC22__
-#include "hashtable.h"
-#include "hashtable_private.h" /* needed to enable inlining */
-
-/*****************************************************************************/
-/* This struct is only concrete here to allow the inlining of two of the
- * accessor functions. */
-struct hashtable_itr
-{
-    struct hashtable *h;
-    struct entry *e;
-    struct entry *parent;
-    unsigned int index;
-};
-
-
-/*****************************************************************************/
-/* hashtable_iterator
- */
-
-struct hashtable_itr *
-hashtable_iterator(struct hashtable *h);
-
-/*****************************************************************************/
-/* hashtable_iterator_key
- * - return the value of the (key,value) pair at the current position */
-
-void *hashtable_iterator_key(struct hashtable_itr *i);
-
-/*****************************************************************************/
-/* value - return the value of the (key,value) pair at the current position */
-
-void *hashtable_iterator_value(struct hashtable_itr *i);
-
-/*****************************************************************************/
-/* advance - advance the iterator to the next element
- *           returns zero if advanced to end of table */
-
-int
-hashtable_iterator_advance(struct hashtable_itr *itr);
-
-/*****************************************************************************/
-/* remove - remove current element and advance the iterator to the next element
- *          NB: if you need the value to free it, read it before
- *          removing. ie: beware memory leaks!
- *          returns zero if advanced to end of table */
-
-int
-hashtable_iterator_remove(struct hashtable_itr *itr);
-
-/*****************************************************************************/
-/* search - overwrite the supplied iterator, to point to the entry
- *          matching the supplied key.
-            h points to the hashtable to be searched.
- *          returns zero if not found. */
-int
-hashtable_iterator_search(struct hashtable_itr *itr,
-                          struct hashtable *h, void *k);
-
-#define DEFINE_HASHTABLE_ITERATOR_SEARCH(fnname, keytype) \
-int fnname (struct hashtable_itr *i, struct hashtable *h, keytype *k) \
-{ \
-    return (hashtable_iterator_search(i,h,k)); \
-}
-
-
-
-#endif /* __HASHTABLE_ITR_CWC22__*/
diff --git a/tools/vtpm_manager/util/hashtable_private.h b/tools/vtpm_manager/util/hashtable_private.h
deleted file mode 100644
index d87a7f9..0000000
--- a/tools/vtpm_manager/util/hashtable_private.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2005, Intel Corp
- * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk> 
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 
- * * Neither the name of the original author; nor the names of any contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
- * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*
- * There are duplicates of this code in:
- *  - tools/xenstore/hashtable_private.h
- *  - tools/blktap2/drivers/hashtable_private.h
- */
-
-#ifndef __HASHTABLE_PRIVATE_CWC22_H__
-#define __HASHTABLE_PRIVATE_CWC22_H__
-
-#include "hashtable.h"
-#ifdef HASHTABLE_THREADED
-#include <pthread.h>
-#endif
-
-/*****************************************************************************/
-struct entry
-{
-    void *k, *v;
-    unsigned int h;
-    struct entry *next;
-};
-
-struct hashtable {
-    unsigned int tablelength;
-    struct entry **table;
-    unsigned int entrycount;
-    unsigned int loadlimit;
-    unsigned int primeindex;
-    unsigned int (*hashfn) (void *k);
-    int (*eqfn) (void *k1, void *k2);
-#ifdef HASHTABLE_THREADED
-    pthread_mutex_t mutex;
-#endif
-};
-
-/*****************************************************************************/
-unsigned int
-hash(struct hashtable *h, void *k);
-
-/*****************************************************************************/
-/* indexFor */
-static inline unsigned int
-indexFor(unsigned int tablelength, unsigned int hashvalue) {
-    return (hashvalue % tablelength);
-};
-
-/* Only works if tablelength == 2^N */
-/*static inline unsigned int
-indexFor(unsigned int tablelength, unsigned int hashvalue)
-{
-    return (hashvalue & (tablelength - 1u));
-}
-*/
-
-/*****************************************************************************/
-#define freekey(X) free(X)
-/*define freekey(X) ; */
-
-
-/*****************************************************************************/
-
-#endif /* __HASHTABLE_PRIVATE_CWC22_H__*/
diff --git a/tools/vtpm_manager/util/log.c b/tools/vtpm_manager/util/log.c
deleted file mode 100644
index 75fe91a..0000000
--- a/tools/vtpm_manager/util/log.c
+++ /dev/null
@@ -1,142 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#include "buffer.h"
-#include "tcg.h"
-
-// Helper code for the consts, eg. to produce messages for error codes.
-
-typedef struct error_code_entry_t {
-  TPM_RESULT code;
-  char * code_name;
-  char * msg;
-} error_code_entry_t;
-
-static const error_code_entry_t error_msgs [] = {    
-  { TPM_SUCCESS, "TPM_SUCCESS", "Successful completion of the operation" },
-  { TPM_AUTHFAIL, "TPM_AUTHFAIL", "Authentication failed" },
-  { TPM_BADINDEX, "TPM_BADINDEX", "The index to a PCR, DIR or other register is incorrect" },
-  { TPM_BAD_PARAMETER, "TPM_BAD_PARAMETER", "One or more parameter is bad" },
-  { TPM_AUDITFAILURE, "TPM_AUDITFAILURE", "An operation completed successfully but the auditing of that operation failed." },
-  { TPM_CLEAR_DISABLED, "TPM_CLEAR_DISABLED", "The clear disable flag is set and all clear operations now require physical access" },
-  { TPM_DEACTIVATED, "TPM_DEACTIVATED", "The TPM is deactivated" },
-  { TPM_DISABLED, "TPM_DISABLED", "The TPM is disabled" },
-  { TPM_DISABLED_CMD, "TPM_DISABLED_CMD", "The target command has been disabled" },
-  { TPM_FAIL, "TPM_FAIL", "The operation failed" },
-  { TPM_BAD_ORDINAL, "TPM_BAD_ORDINAL", "The ordinal was unknown or inconsistent" },
-  { TPM_INSTALL_DISABLED, "TPM_INSTALL_DISABLED", "The ability to install an owner is disabled" },
-  { TPM_INVALID_KEYHANDLE, "TPM_INVALID_KEYHANDLE", "The key handle presented was invalid" },
-  { TPM_KEYNOTFOUND, "TPM_KEYNOTFOUND", "The target key was not found" },
-  { TPM_INAPPROPRIATE_ENC, "TPM_INAPPROPRIATE_ENC", "Unacceptable encryption scheme" },
-  { TPM_MIGRATEFAIL, "TPM_MIGRATEFAIL", "Migration authorization failed" },
-  { TPM_INVALID_PCR_INFO, "TPM_INVALID_PCR_INFO", "PCR information could not be interpreted" },
-  { TPM_NOSPACE, "TPM_NOSPACE", "No room to load key." },
-  { TPM_NOSRK, "TPM_NOSRK", "There is no SRK set" },
-  { TPM_NOTSEALED_BLOB, "TPM_NOTSEALED_BLOB", "An encrypted blob is invalid or was not created by this TPM" },
-  { TPM_OWNER_SET, "TPM_OWNER_SET", "There is already an Owner" },
-  { TPM_RESOURCES, "TPM_RESOURCES", "The TPM has insufficient internal resources to perform the requested action." },
-  { TPM_SHORTRANDOM, "TPM_SHORTRANDOM", "A random string was too short" },
-  { TPM_SIZE, "TPM_SIZE", "The TPM does not have the space to perform the operation." },
-  { TPM_WRONGPCRVAL, "TPM_WRONGPCRVAL", "The named PCR value does not match the current PCR value." },
-  { TPM_BAD_PARAM_SIZE, "TPM_BAD_PARAM_SIZE", "The paramSize argument to the command has the incorrect value" },
-  { TPM_SHA_THREAD, "TPM_SHA_THREAD", "There is no existing SHA-1 thread." },
-  { TPM_SHA_ERROR, "TPM_SHA_ERROR", "The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error." },
-  { TPM_FAILEDSELFTEST, "TPM_FAILEDSELFTEST", "Self-test has failed and the TPM has shutdown." },
-  { TPM_AUTH2FAIL, "TPM_AUTH2FAIL", "The authorization for the second key in a 2 key function failed authorization" },
-  { TPM_BADTAG, "TPM_BADTAG", "The tag value sent to for a command is invalid" },
-  { TPM_IOERROR, "TPM_IOERROR", "An IO error occurred transmitting information to the TPM" },
-  { TPM_ENCRYPT_ERROR, "TPM_ENCRYPT_ERROR", "The encryption process had a problem." },
-  { TPM_DECRYPT_ERROR, "TPM_DECRYPT_ERROR", "The decryption process did not complete." },
-  { TPM_INVALID_AUTHHANDLE, "TPM_INVALID_AUTHHANDLE", "An invalid handle was used." },
-  { TPM_NO_ENDORSEMENT, "TPM_NO_ENDORSEMENT", "The TPM does not a EK installed" },
-  { TPM_INVALID_KEYUSAGE, "TPM_INVALID_KEYUSAGE", "The usage of a key is not allowed" },
-  { TPM_WRONG_ENTITYTYPE, "TPM_WRONG_ENTITYTYPE", "The submitted entity type is not allowed" },
-  { TPM_INVALID_POSTINIT, "TPM_INVALID_POSTINIT", "The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup" },
-  { TPM_INAPPROPRIATE_SIG, "TPM_INAPPROPRIATE_SIG", "Signed data cannot include additional DER information" },
-  { TPM_BAD_KEY_PROPERTY, "TPM_BAD_KEY_PROPERTY", "The key properties in TPM_KEY_PARMs are not supported by this TPM" },
-  
-  { TPM_BAD_MIGRATION, "TPM_BAD_MIGRATION", "The migration properties of this key are incorrect." },
-  { TPM_BAD_SCHEME, "TPM_BAD_SCHEME", "The signature or encryption scheme for this key is incorrect or not permitted in this situation." },
-  { TPM_BAD_DATASIZE, "TPM_BAD_DATASIZE", "The size of the data (or blob) parameter is bad or inconsistent with the referenced key" },
-  { TPM_BAD_MODE, "TPM_BAD_MODE", "A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob." },
-  { TPM_BAD_PRESENCE, "TPM_BAD_PRESENCE", "Either the physicalPresence or physicalPresenceLock bits have the wrong value" },
-  { TPM_BAD_VERSION, "TPM_BAD_VERSION", "The TPM cannot perform this version of the capability" },
-  { TPM_NO_WRAP_TRANSPORT, "TPM_NO_WRAP_TRANSPORT", "The TPM does not allow for wrapped transport sessions" },
-  { TPM_AUDITFAIL_UNSUCCESSFUL, "TPM_AUDITFAIL_UNSUCCESSFUL", "TPM audit construction failed and the underlying command was returning a failure code also" },
-  { TPM_AUDITFAIL_SUCCESSFUL, "TPM_AUDITFAIL_SUCCESSFUL", "TPM audit construction failed and the underlying command was returning success" },
-  { TPM_NOTRESETABLE, "TPM_NOTRESETABLE", "Attempt to reset a PCR register that does not have the resettable attribute" },
-  { TPM_NOTLOCAL, "TPM_NOTLOCAL", "Attempt to reset a PCR register that requires locality and locality modifier not part of command transport" },
-  { TPM_BAD_TYPE, "TPM_BAD_TYPE", "Make identity blob not properly typed" },
-  { TPM_INVALID_RESOURCE, "TPM_INVALID_RESOURCE", "When saving context identified resource type does not match actual resource" },
-  { TPM_NOTFIPS, "TPM_NOTFIPS", "The TPM is attempting to execute a command only available when in FIPS mode" },
-  { TPM_INVALID_FAMILY, "TPM_INVALID_FAMILY", "The command is attempting to use an invalid family ID" },
-  { TPM_NO_NV_PERMISSION, "TPM_NO_NV_PERMISSION", "The permission to manipulate the NV storage is not available" },
-  { TPM_REQUIRES_SIGN, "TPM_REQUIRES_SIGN", "The operation requires a signed command" },
-  { TPM_KEY_NOTSUPPORTED, "TPM_KEY_NOTSUPPORTED", "Wrong operation to load an NV key" },
-  { TPM_AUTH_CONFLICT, "TPM_AUTH_CONFLICT", "NV_LoadKey blob requires both owner and blob authorization" },
-  { TPM_AREA_LOCKED, "TPM_AREA_LOCKED", "The NV area is locked and not writtable" },
-  { TPM_BAD_LOCALITY, "TPM_BAD_LOCALITY", "The locality is incorrect for the attempted operation" },
-  { TPM_READ_ONLY, "TPM_READ_ONLY", "The NV area is read only and can't be written to" },
-  { TPM_PER_NOWRITE, "TPM_PER_NOWRITE", "There is no protection on the write to the NV area" },
-  { TPM_FAMILYCOUNT, "TPM_FAMILYCOUNT", "The family count value does not match" },
-  { TPM_WRITE_LOCKED, "TPM_WRITE_LOCKED", "The NV area has already been written to" },
-  { TPM_BAD_ATTRIBUTES, "TPM_BAD_ATTRIBUTES", "The NV area attributes conflict" },
-  { TPM_INVALID_STRUCTURE, "TPM_INVALID_STRUCTURE", "The structure tag and version are invalid or inconsistent" },
-  { TPM_KEY_OWNER_CONTROL, "TPM_KEY_OWNER_CONTROL", "The key is under control of the TPM Owner and can only be evicted by the TPM Owner." },
-  { TPM_BAD_COUNTER, "TPM_BAD_COUNTER", "The counter handle is incorrect" },
-  { TPM_NOT_FULLWRITE, "TPM_NOT_FULLWRITE", "The write is not a complete write of the area" },
-  { TPM_CONTEXT_GAP, "TPM_CONTEXT_GAP", "The gap between saved context counts is too large" },
-  { TPM_MAXNVWRITES, "TPM_MAXNVWRITES", "The maximum number of NV writes without an owner has been exceeded" },
-  { TPM_NOOPERATOR, "TPM_NOOPERATOR", "No operator authorization value is set" },
-  { TPM_RESOURCEMISSING, "TPM_RESOURCEMISSING", "The resource pointed to by context is not loaded" },
-  { TPM_DELEGATE_LOCK, "TPM_DELEGATE_LOCK", "The delegate administration is locked" },
-  { TPM_DELEGATE_FAMILY, "TPM_DELEGATE_FAMILY", "Attempt to manage a family other then the delegated family" },
-  { TPM_DELEGATE_ADMIN, "TPM_DELEGATE_ADMIN", "Delegation table management not enabled" },
-  { TPM_TRANSPORT_EXCLUSIVE, "TPM_TRANSPORT_EXCLUSIVE", "There was a command executed outside of an exclusive transport session" },
-};
-
-
-// helper function for the error codes:
-const char* tpm_get_error_name (TPM_RESULT code) {
-  // just do a linear scan for now
-  unsigned i;
-  for (i = 0; i < sizeof(error_msgs)/sizeof(error_msgs[0]); i++) 
-    if (code == error_msgs[i].code) 
-      return error_msgs[i].code_name;
-  
-    return("Unknown Error Code");
-}
diff --git a/tools/vtpm_manager/util/log.h b/tools/vtpm_manager/util/log.h
deleted file mode 100644
index 1f15f5b..0000000
--- a/tools/vtpm_manager/util/log.h
+++ /dev/null
@@ -1,94 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-
-#ifndef __VTPM_LOG_H__
-#define __VTPM_LOG_H__
-
-#include <stdint.h>             // for uint32_t
-#include <stddef.h>             // for pointer NULL
-
-// =========================== LOGGING ==============================
-
-// the logging module numbers
-#define VTPM_LOG_CRYPTO      1
-#define VTPM_LOG_BSG         2
-#define VTPM_LOG_TXDATA      3
-#define VTPM_LOG_TCS         4
-#define VTPM_LOG_TCS_DEEP    5
-#define VTPM_LOG_VTSP        6
-#define VTPM_LOG_VTPM        7
-#define VTPM_LOG_VTPM_DEEP   8
-#define VTPM_LOG_VTSP_DEEP   9
-
-static char *module_names[] = { "",
-                                "CRYPTO",
-                                "BSG",
-                                "TXDATA",
-                                "TCS",
-                                "TCS",
-                                "VTSP",
-                                "VTPM",
-                                "VTPM",
-                                "VTSP"
-                              };
-
-// Default to standard logging
-#ifndef LOGGING_MODULES
-#define LOGGING_MODULES (BITMASK(VTPM_LOG_VTPM))
-#endif
-
-// bit-access macros
-#define BITMASK(idx)      ( 1U << (idx) )
-#define GETBIT(num,idx)   ( ((num) & BITMASK(idx)) >> idx )
-#define SETBIT(num,idx)   (num) |= BITMASK(idx)
-#define CLEARBIT(num,idx) (num) &= ( ~ BITMASK(idx) )
-
-#define vtpmloginfo(module, fmt, args...) \
-  if (GETBIT (LOGGING_MODULES, module) == 1) {				\
-    fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); \
-  }
-
-#define vtpmloginfomore(module, fmt, args...) \
-  if (GETBIT (LOGGING_MODULES, module) == 1) {			      \
-    fprintf (stdout, fmt,##args);				      \
-  }
-                               
-#define vtpmlogerror(module, fmt, args...) \
-  fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
-                               
-//typedef UINT32 tpm_size_t;
-                        
-// helper function for the error codes:
-const char* tpm_get_error_name (TPM_RESULT code);
-
-#endif // _VTPM_LOG_H_
diff --git a/tools/vtpm_manager/util/tcg.h b/tools/vtpm_manager/util/tcg.h
deleted file mode 100644
index 5c42913..0000000
--- a/tools/vtpm_manager/util/tcg.h
+++ /dev/null
@@ -1,503 +0,0 @@
-// ===================================================================
-// 
-// Copyright (c) 2005, Intel Corp.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without 
-// modification, are permitted provided that the following conditions 
-// are met:
-//
-//   * Redistributions of source code must retain the above copyright 
-//     notice, this list of conditions and the following disclaimer.
-//   * Redistributions in binary form must reproduce the above 
-//     copyright notice, this list of conditions and the following 
-//     disclaimer in the documentation and/or other materials provided 
-//     with the distribution.
-//   * Neither the name of Intel Corporation nor the names of its 
-//     contributors may be used to endorse or promote products derived
-//     from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-// OF THE POSSIBILITY OF SUCH DAMAGE.
-// ===================================================================
-// 
-// tcg.h
-// 
-//  This file contains all the structure and type definitions
-//
-// ==================================================================
-
-#ifndef __TCG_H__
-#define __TCG_H__
-
-// This pragma is used to disallow structure padding
-#pragma pack(push, 1)
-
-// *************************** TYPEDEFS *********************************
-typedef unsigned char BYTE;
-typedef unsigned char BOOL;
-typedef unsigned short UINT16;
-typedef unsigned int UINT32;
-typedef unsigned long long UINT64;
-
-typedef UINT32 TPM_RESULT;
-typedef UINT32 TPM_PCRINDEX;
-typedef UINT32 TPM_DIRINDEX;
-typedef UINT32 TPM_HANDLE;
-typedef TPM_HANDLE TPM_AUTHHANDLE;
-typedef TPM_HANDLE TCPA_HASHHANDLE;
-typedef TPM_HANDLE TCPA_HMACHANDLE;
-typedef TPM_HANDLE TCPA_ENCHANDLE;
-typedef TPM_HANDLE TPM_KEY_HANDLE;
-typedef TPM_HANDLE TCPA_ENTITYHANDLE;
-typedef UINT32 TPM_RESOURCE_TYPE;
-typedef UINT32 TPM_COMMAND_CODE;
-typedef UINT16 TPM_PROTOCOL_ID;
-typedef BYTE TPM_AUTH_DATA_USAGE;
-typedef UINT16 TPM_ENTITY_TYPE;
-typedef UINT32 TPM_ALGORITHM_ID;
-typedef UINT16 TPM_KEY_USAGE;
-typedef UINT16 TPM_STARTUP_TYPE;
-typedef UINT32 TPM_CAPABILITY_AREA;
-typedef UINT16 TPM_ENC_SCHEME;
-typedef UINT16 TPM_SIG_SCHEME;
-typedef UINT16 TPM_MIGRATE_SCHEME;
-typedef UINT16 TPM_PHYSICAL_PRESENCE;
-typedef UINT32 TPM_KEY_FLAGS;
-
-#define TPM_DIGEST_SIZE 20  // Don't change this
-typedef BYTE TPM_AUTHDATA[TPM_DIGEST_SIZE];
-typedef TPM_AUTHDATA TPM_SECRET;
-typedef TPM_AUTHDATA TPM_ENCAUTH;
-typedef BYTE TPM_PAYLOAD_TYPE;
-typedef UINT16 TPM_TAG;
-
-// Data Types of the TCS
-typedef UINT32 TCS_AUTHHANDLE;  // Handle addressing a authorization session
-typedef UINT32 TCS_CONTEXT_HANDLE; // Basic context handle
-typedef UINT32 TCS_KEY_HANDLE;  // Basic key handle
-
-// ************************* STRUCTURES **********************************
-
-typedef struct TPM_VERSION {
-  BYTE major;
-  BYTE minor;
-  BYTE revMajor;
-  BYTE revMinor;
-} TPM_VERSION;
- 
-static const TPM_VERSION TPM_STRUCT_VER_1_1 = { 1,1,0,0 };
-
-typedef struct TPM_DIGEST {
-  BYTE digest[TPM_DIGEST_SIZE];
-} TPM_DIGEST;
-
-typedef TPM_DIGEST TPM_PCRVALUE;
-typedef TPM_DIGEST TPM_COMPOSITE_HASH;
-typedef TPM_DIGEST TPM_DIRVALUE;
-typedef TPM_DIGEST TPM_HMAC;
-typedef TPM_DIGEST TPM_CHOSENID_HASH;
-
-typedef struct TPM_NONCE {
-  BYTE nonce[TPM_DIGEST_SIZE];
-} TPM_NONCE;
-
-typedef struct TPM_KEY_PARMS {
-  TPM_ALGORITHM_ID algorithmID;
-  TPM_ENC_SCHEME encScheme;
-  TPM_SIG_SCHEME sigScheme;
-  UINT32 parmSize;
-  BYTE* parms;
-} TPM_KEY_PARMS;
-
-typedef struct TPM_RSA_KEY_PARMS {  
-  UINT32 keyLength; 
-  UINT32 numPrimes; 
-  UINT32 exponentSize;
-  BYTE* exponent;
-} TPM_RSA_KEY_PARMS;
-
-typedef struct TPM_STORE_PUBKEY {
-  UINT32 keyLength;
-  BYTE* key;
-} TPM_STORE_PUBKEY;
-
-typedef struct TPM_PUBKEY {
-  TPM_KEY_PARMS algorithmParms;
-  TPM_STORE_PUBKEY pubKey;
-} TPM_PUBKEY;
-
-typedef struct TPM_KEY {
-  TPM_VERSION         ver;
-  TPM_KEY_USAGE       keyUsage;
-  TPM_KEY_FLAGS       keyFlags;
-  TPM_AUTH_DATA_USAGE authDataUsage;
-  TPM_KEY_PARMS       algorithmParms; 
-  UINT32              PCRInfoSize;
-  BYTE*               PCRInfo; // this should be a TPM_PCR_INFO, or NULL
-  TPM_STORE_PUBKEY    pubKey;
-  UINT32              encDataSize;
-  BYTE*               encData;
-} TPM_KEY;
-
-typedef struct TPM_PCR_SELECTION { 
-  UINT16 sizeOfSelect;        /// in bytes
-  BYTE* pcrSelect;
-} TPM_PCR_SELECTION;
-
-typedef struct TPM_PCR_COMPOSITE { 
-  TPM_PCR_SELECTION select;
-  UINT32 valueSize;
-  TPM_PCRVALUE* pcrValue;
-} TPM_PCR_COMPOSITE;
-
-
-typedef struct TPM_PCR_INFO {
-  TPM_PCR_SELECTION pcrSelection;
-  TPM_COMPOSITE_HASH digestAtRelease;
-  TPM_COMPOSITE_HASH digestAtCreation;
-} TPM_PCR_INFO;
-
-
-typedef struct TPM_BOUND_DATA {
-  TPM_VERSION ver;
-  TPM_PAYLOAD_TYPE payload;
-  BYTE* payloadData;
-} TPM_BOUND_DATA;
-
-typedef struct TPM_STORED_DATA { 
-  TPM_VERSION ver;
-  UINT32 sealInfoSize;
-  BYTE* sealInfo;
-  UINT32 encDataSize;
-  BYTE* encData;
-} TPM_STORED_DATA;
-
-typedef struct TCS_AUTH {
-  TCS_AUTHHANDLE  AuthHandle;
-  TPM_NONCE   NonceOdd;   // system 
-  TPM_NONCE   NonceEven;   // TPM 
-  BOOL   fContinueAuthSession;
-  TPM_AUTHDATA  HMAC;
-} TCS_AUTH;
-
-// structures for dealing with sizes followed by buffers in all the
-// TCG structure.
-typedef struct pack_buf_t {
-  UINT32 size;
-  BYTE * data;
-} pack_buf_t;
-
-typedef struct pack_constbuf_t {
-  UINT32 size;
-  const BYTE* data;
-} pack_constbuf_t;
-
-
-
-// **************************** CONSTANTS *********************************
-
-// BOOL values
-#define TRUE 0x01
-#define FALSE 0x00
-
-#define TCPA_MAX_BUFFER_LENGTH 0x2000
-
-//
-// TPM_COMMAND_CODE values
-#define TPM_PROTECTED_ORDINAL 0x00000000UL
-#define TPM_UNPROTECTED_ORDINAL 0x80000000UL
-#define TPM_CONNECTION_ORDINAL 0x40000000UL
-#define TPM_VENDOR_ORDINAL 0x20000000UL
-
-#define TPM_ORD_OIAP                     (10UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_OSAP                     (11UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ChangeAuth               (12UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_TakeOwnership            (13UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ChangeAuthAsymStart      (14UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ChangeAuthAsymFinish     (15UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ChangeAuthOwner          (16UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_Extend                   (20UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_PcrRead                  (21UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_Quote                    (22UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_Seal                     (23UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_Unseal                   (24UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_DirWriteAuth             (25UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_DirRead                  (26UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_UnBind                   (30UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_CreateWrapKey            (31UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_LoadKey                  (32UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_GetPubKey                (33UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_EvictKey                 (34UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_CreateMigrationBlob      (40UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ReWrapKey                (41UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ConvertMigrationBlob     (42UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_AuthorizeMigrationKey    (43UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_CreateMaintenanceArchive (44UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_LoadMaintenanceArchive   (45UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_KillMaintenanceFeature   (46UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_LoadManuMaintPub         (47UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ReadManuMaintPub         (48UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_CertifyKey               (50UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_Sign                     (60UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_GetRandom                (70UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_StirRandom               (71UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SelfTestFull             (80UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SelfTestStartup          (81UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_CertifySelfTest          (82UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ContinueSelfTest         (83UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_GetTestResult            (84UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_Reset                    (90UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_OwnerClear               (91UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_DisableOwnerClear        (92UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ForceClear               (93UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_DisableForceClear        (94UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_GetCapabilitySigned      (100UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_GetCapability            (101UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_GetCapabilityOwner       (102UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_OwnerSetDisable          (110UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_PhysicalEnable           (111UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_PhysicalDisable          (112UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SetOwnerInstall          (113UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_PhysicalSetDeactivated   (114UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SetTempDeactivated       (115UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_CreateEndorsementKeyPair (120UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_MakeIdentity             (121UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ActivateIdentity         (122UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_ReadPubek                (124UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_OwnerReadPubek           (125UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_DisablePubekRead         (126UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_GetAuditEvent            (130UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_GetAuditEventSigned      (131UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_GetOrdinalAuditStatus    (140UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SetOrdinalAuditStatus    (141UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_Terminate_Handle         (150UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_Init                     (151UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SaveState                (152UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_Startup                  (153UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SetRedirection           (154UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SHA1Start                (160UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SHA1Update               (161UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SHA1Complete             (162UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SHA1CompleteExtend       (163UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_FieldUpgrade             (170UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SaveKeyContext           (180UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_LoadKeyContext           (181UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_SaveAuthContext          (182UL + TPM_PROTECTED_ORDINAL)
-#define TPM_ORD_LoadAuthContext          (183UL + TPM_PROTECTED_ORDINAL)
-#define TSC_ORD_PhysicalPresence         (10UL + TPM_CONNECTION_ORDINAL)
-
-
-
-//
-// TPM_RESULT values
-//
-// just put in the whole table from spec 1.2
-              
-#define TPM_BASE   0x0 // The start of TPM return codes
-#define TPM_VENDOR_ERROR 0x00000400 // Mask to indicate that the error code is vendor specific for vendor specific commands
-#define TPM_NON_FATAL  0x00000800 // Mask to indicate that the error code is a non-fatal failure.
-
-#define TPM_SUCCESS   TPM_BASE // Successful completion of the operation
-#define TPM_AUTHFAIL      TPM_BASE + 1 // Authentication failed
-#define TPM_BADINDEX      TPM_BASE + 2 // The index to a PCR, DIR or other register is incorrect
-#define TPM_BAD_PARAMETER     TPM_BASE + 3 // One or more parameter is bad
-#define TPM_AUDITFAILURE     TPM_BASE + 4 // An operation completed successfully but the auditing of that operation failed.
-#define TPM_CLEAR_DISABLED     TPM_BASE + 5 // The clear disable flag is set and all clear operations now require physical access
-#define TPM_DEACTIVATED     TPM_BASE + 6 // The TPM is deactivated
-#define TPM_DISABLED      TPM_BASE + 7 // The TPM is disabled
-#define TPM_DISABLED_CMD     TPM_BASE + 8 // The target command has been disabled
-#define TPM_FAIL       TPM_BASE + 9 // The operation failed
-#define TPM_BAD_ORDINAL     TPM_BASE + 10 // The ordinal was unknown or inconsistent
-#define TPM_INSTALL_DISABLED   TPM_BASE + 11 // The ability to install an owner is disabled
-#define TPM_INVALID_KEYHANDLE  TPM_BASE + 12 // The key handle presented was invalid
-#define TPM_KEYNOTFOUND     TPM_BASE + 13 // The target key was not found
-#define TPM_INAPPROPRIATE_ENC  TPM_BASE + 14 // Unacceptable encryption scheme
-#define TPM_MIGRATEFAIL     TPM_BASE + 15 // Migration authorization failed
-#define TPM_INVALID_PCR_INFO   TPM_BASE + 16 // PCR information could not be interpreted
-#define TPM_NOSPACE      TPM_BASE + 17 // No room to load key.
-#define TPM_NOSRK       TPM_BASE + 18 // There is no SRK set
-#define TPM_NOTSEALED_BLOB     TPM_BASE + 19 // An encrypted blob is invalid or was not created by this TPM
-#define TPM_OWNER_SET      TPM_BASE + 20 // There is already an Owner
-#define TPM_RESOURCES      TPM_BASE + 21 // The TPM has insufficient internal resources to perform the requested action.
-#define TPM_SHORTRANDOM     TPM_BASE + 22 // A random string was too short
-#define TPM_SIZE       TPM_BASE + 23 // The TPM does not have the space to perform the operation.
-#define TPM_WRONGPCRVAL     TPM_BASE + 24 // The named PCR value does not match the current PCR value.
-#define TPM_BAD_PARAM_SIZE     TPM_BASE + 25 // The paramSize argument to the command has the incorrect value
-#define TPM_SHA_THREAD      TPM_BASE + 26 // There is no existing SHA-1 thread.
-#define TPM_SHA_ERROR      TPM_BASE + 27 // The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error.
-#define TPM_FAILEDSELFTEST     TPM_BASE + 28 // Self-test has failed and the TPM has shutdown.
-#define TPM_AUTH2FAIL      TPM_BASE + 29 // The authorization for the second key in a 2 key function failed authorization
-#define TPM_BADTAG       TPM_BASE + 30 // The tag value sent to for a command is invalid
-#define TPM_IOERROR      TPM_BASE + 31 // An IO error occurred transmitting information to the TPM
-#define TPM_ENCRYPT_ERROR     TPM_BASE + 32 // The encryption process had a problem.
-#define TPM_DECRYPT_ERROR     TPM_BASE + 33 // The decryption process did not complete.
-#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 // An invalid handle was used.
-#define TPM_NO_ENDORSEMENT     TPM_BASE + 35 // The TPM does not a EK installed
-#define TPM_INVALID_KEYUSAGE   TPM_BASE + 36 // The usage of a key is not allowed
-#define TPM_WRONG_ENTITYTYPE   TPM_BASE + 37 // The submitted entity type is not allowed
-#define TPM_INVALID_POSTINIT   TPM_BASE + 38 // The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup
-#define TPM_INAPPROPRIATE_SIG  TPM_BASE + 39 // Signed data cannot include additional DER information
-#define TPM_BAD_KEY_PROPERTY   TPM_BASE + 40 // The key properties in TPM_KEY_PARMs are not supported by this TPM
-
-#define TPM_BAD_MIGRATION      TPM_BASE + 41 // The migration properties of this key are incorrect.
-#define TPM_BAD_SCHEME       TPM_BASE + 42 // The signature or encryption scheme for this key is incorrect or not permitted in this situation.
-#define TPM_BAD_DATASIZE      TPM_BASE + 43 // The size of the data (or blob) parameter is bad or inconsistent with the referenced key
-#define TPM_BAD_MODE       TPM_BASE + 44 // A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob.
-#define TPM_BAD_PRESENCE      TPM_BASE + 45 // Either the physicalPresence or physicalPresenceLock bits have the wrong value
-#define TPM_BAD_VERSION      TPM_BASE + 46 // The TPM cannot perform this version of the capability
-#define TPM_NO_WRAP_TRANSPORT     TPM_BASE + 47 // The TPM does not allow for wrapped transport sessions
-#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 // TPM audit construction failed and the underlying command was returning a failure code also
-#define TPM_AUDITFAIL_SUCCESSFUL   TPM_BASE + 49 // TPM audit construction failed and the underlying command was returning success
-#define TPM_NOTRESETABLE      TPM_BASE + 50 // Attempt to reset a PCR register that does not have the resettable attribute
-#define TPM_NOTLOCAL       TPM_BASE + 51 // Attempt to reset a PCR register that requires locality and locality modifier not part of command transport
-#define TPM_BAD_TYPE       TPM_BASE + 52 // Make identity blob not properly typed
-#define TPM_INVALID_RESOURCE     TPM_BASE + 53 // When saving context identified resource type does not match actual resource
-#define TPM_NOTFIPS       TPM_BASE + 54 // The TPM is attempting to execute a command only available when in FIPS mode
-#define TPM_INVALID_FAMILY      TPM_BASE + 55 // The command is attempting to use an invalid family ID
-#define TPM_NO_NV_PERMISSION     TPM_BASE + 56 // The permission to manipulate the NV storage is not available
-#define TPM_REQUIRES_SIGN      TPM_BASE + 57 // The operation requires a signed command
-#define TPM_KEY_NOTSUPPORTED     TPM_BASE + 58 // Wrong operation to load an NV key
-#define TPM_AUTH_CONFLICT      TPM_BASE + 59 // NV_LoadKey blob requires both owner and blob authorization
-#define TPM_AREA_LOCKED      TPM_BASE + 60 // The NV area is locked and not writtable
-#define TPM_BAD_LOCALITY      TPM_BASE + 61 // The locality is incorrect for the attempted operation
-#define TPM_READ_ONLY       TPM_BASE + 62 // The NV area is read only and can't be written to
-#define TPM_PER_NOWRITE      TPM_BASE + 63 // There is no protection on the write to the NV area
-#define TPM_FAMILYCOUNT      TPM_BASE + 64 // The family count value does not match
-#define TPM_WRITE_LOCKED      TPM_BASE + 65 // The NV area has already been written to
-#define TPM_BAD_ATTRIBUTES      TPM_BASE + 66 // The NV area attributes conflict
-#define TPM_INVALID_STRUCTURE     TPM_BASE + 67 // The structure tag and version are invalid or inconsistent
-#define TPM_KEY_OWNER_CONTROL     TPM_BASE + 68 // The key is under control of the TPM Owner and can only be evicted by the TPM Owner.
-#define TPM_BAD_COUNTER      TPM_BASE + 69 // The counter handle is incorrect
-#define TPM_NOT_FULLWRITE      TPM_BASE + 70 // The write is not a complete write of the area
-#define TPM_CONTEXT_GAP      TPM_BASE + 71 // The gap between saved context counts is too large
-#define TPM_MAXNVWRITES      TPM_BASE + 72 // The maximum number of NV writes without an owner has been exceeded
-#define TPM_NOOPERATOR       TPM_BASE + 73 // No operator authorization value is set
-#define TPM_RESOURCEMISSING     TPM_BASE + 74 // The resource pointed to by context is not loaded
-#define TPM_DELEGATE_LOCK      TPM_BASE + 75 // The delegate administration is locked
-#define TPM_DELEGATE_FAMILY     TPM_BASE + 76 // Attempt to manage a family other then the delegated family
-#define TPM_DELEGATE_ADMIN      TPM_BASE + 77 // Delegation table management not enabled
-#define TPM_TRANSPORT_EXCLUSIVE    TPM_BASE + 78 // There was a command executed outside of an exclusive transport session
-
-// TPM_STARTUP_TYPE values
-#define TPM_ST_CLEAR 0x0001
-#define TPM_ST_STATE 0x0002
-#define TPM_ST_DEACTIVATED 0x003
-
-// TPM_TAG values
-#define TPM_TAG_RQU_COMMAND 0x00c1
-#define TPM_TAG_RQU_AUTH1_COMMAND 0x00c2
-#define TPM_TAG_RQU_AUTH2_COMMAND 0x00c3
-#define TPM_TAG_RSP_COMMAND 0x00c4
-#define TPM_TAG_RSP_AUTH1_COMMAND 0x00c5
-#define TPM_TAG_RSP_AUTH2_COMMAND 0x00c6
-
-// TPM_PAYLOAD_TYPE values
-#define TPM_PT_ASYM 0x01
-#define TPM_PT_BIND 0x02
-#define TPM_PT_MIGRATE 0x03
-#define TPM_PT_MAINT 0x04
-#define TPM_PT_SEAL 0x05
-
-// TPM_ENTITY_TYPE values
-#define TPM_ET_KEYHANDLE 0x0001
-#define TPM_ET_OWNER 0x0002
-#define TPM_ET_DATA 0x0003
-#define TPM_ET_SRK 0x0004
-#define TPM_ET_KEY 0x0005
-
-/// TPM_ResourceTypes
-#define TPM_RT_KEY      0x00000001
-#define TPM_RT_AUTH     0x00000002
-#define TPM_RT_TRANS    0x00000004
-#define TPM_RT_CONTEXT  0x00000005
-
-// TPM_PROTOCOL_ID values
-#define TPM_PID_OIAP 0x0001
-#define TPM_PID_OSAP 0x0002
-#define TPM_PID_ADIP 0x0003
-#define TPM_PID_ADCP 0x0004
-#define TPM_PID_OWNER 0x0005
-
-// TPM_ALGORITHM_ID values
-#define TPM_ALG_RSA 0x00000001
-#define TPM_ALG_DES 0x00000002
-#define TPM_ALG_3DES 0X00000003
-#define TPM_ALG_SHA 0x00000004
-#define TPM_ALG_HMAC 0x00000005
-#define TCPA_ALG_AES 0x00000006
-
-// TPM_ENC_SCHEME values
-#define TPM_ES_NONE 0x0001
-#define TPM_ES_RSAESPKCSv15 0x0002
-#define TPM_ES_RSAESOAEP_SHA1_MGF1 0x0003
-
-// TPM_SIG_SCHEME values
-#define TPM_SS_NONE 0x0001
-#define TPM_SS_RSASSAPKCS1v15_SHA1 0x0002
-#define TPM_SS_RSASSAPKCS1v15_DER 0x0003
-
-// TPM_KEY_USAGE values
-#define TPM_KEY_EK 0x0000 
-#define TPM_KEY_SIGNING 0x0010
-#define TPM_KEY_STORAGE 0x0011
-#define TPM_KEY_IDENTITY 0x0012
-#define TPM_KEY_AUTHCHANGE 0X0013
-#define TPM_KEY_BIND 0x0014
-#define TPM_KEY_LEGACY 0x0015
-
-// TPM_AUTH_DATA_USAGE values
-#define TPM_AUTH_NEVER 0x00
-#define TPM_AUTH_ALWAYS 0x01
-
-// Key Handle of owner and srk
-#define TPM_OWNER_KEYHANDLE 0x40000001
-#define TPM_SRK_KEYHANDLE 0x40000000
-
-// ---------------------- Functions for checking TPM_RESULTs -----------------
-
-#include <stdio.h>
-
-// FIXME: Review use of these and delete unneeded ones.
-
-// these are really badly dependent on local structure:
-// DEPENDS: local var 'status' of type TPM_RESULT
-// DEPENDS: label 'abort_egress' which cleans up and returns the status
-#define ERRORDIE(s) do { status = s; \
-                         fprintf (stderr, "*** ERRORDIE in %s at %s: %i\n", __func__, __FILE__, __LINE__); \
-                         goto abort_egress; } \
-                    while (0)
-
-// DEPENDS: local var 'status' of type TPM_RESULT
-// DEPENDS: label 'abort_egress' which cleans up and returns the status
-// Try command c. If it fails, set status to s and goto abort.
-#define TPMTRY(s,c) if (c != TPM_SUCCESS) { \
-                       status = s; \
-                       printf("ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
-                       goto abort_egress; \
-                    } else {\
-                       status = c; \
-                    }
-
-// Try command c. If it fails, print error message, set status to actual return code. Goto abort
-#define TPMTRYRETURN(c) do { status = c; \
-                             if (status != TPM_SUCCESS) { \
-                               fprintf(stderr, "ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
-                               goto abort_egress; \
-                             } \
-                        } while(0)    
-
-
-#pragma pack(pop)
-
-#endif //__TCPA_H__
diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c
index 3b89223..0ba1d55 100644
--- a/tools/xenstore/hashtable.c
+++ b/tools/xenstore/hashtable.c
@@ -3,7 +3,6 @@
 /*
  * There are duplicates of this code in:
  *  - tools/blktap2/drivers/hashtable.c
- *  - tools/vtpm_manager/util/hashtable.c
  */
 
 #include "hashtable.h"
diff --git a/tools/xenstore/hashtable.h b/tools/xenstore/hashtable.h
index 8e6bb5b..4d68223 100644
--- a/tools/xenstore/hashtable.h
+++ b/tools/xenstore/hashtable.h
@@ -3,7 +3,6 @@
 /*
  * There are duplicates of this code in:
  *  - tools/blktap2/drivers/hashtable.h
- *  - tools/vtpm_manager/util/hashtable.h
  */
 
 #ifndef __HASHTABLE_CWC22_H__
diff --git a/tools/xenstore/hashtable_private.h b/tools/xenstore/hashtable_private.h
index cabaffe..a08559d 100644
--- a/tools/xenstore/hashtable_private.h
+++ b/tools/xenstore/hashtable_private.h
@@ -3,7 +3,6 @@
 /*
  * There are duplicates of this code in:
  *  - tools/blktap2/drivers/hashtable_private.h
- *  - tools/vtpm_manager/util/hashtable_private.h
  */
 
 #ifndef __HASHTABLE_PRIVATE_CWC22_H__
diff --git a/tools/xm-test/configure.ac b/tools/xm-test/configure.ac
index ad1eb78..c142140 100644
--- a/tools/xm-test/configure.ac
+++ b/tools/xm-test/configure.ac
@@ -143,7 +143,6 @@ AC_CONFIG_FILES([
     tests/unpause/Makefile
     tests/vcpu-pin/Makefile
     tests/vcpu-disable/Makefile
-    tests/vtpm/Makefile
     tests/xapi/Makefile
     tests/enforce_dom0_cpus/Makefile
     tests/cpupool/Makefile
diff --git a/tools/xm-test/grouptest/default b/tools/xm-test/grouptest/default
index f0516b2..e04591b 100644
--- a/tools/xm-test/grouptest/default
+++ b/tools/xm-test/grouptest/default
@@ -27,5 +27,4 @@ sysrq
 unpause
 vcpu-disable
 vcpu-pin
-vtpm
 xapi
diff --git a/tools/xm-test/grouptest/medium b/tools/xm-test/grouptest/medium
index bafc988..5c3e1b1 100644
--- a/tools/xm-test/grouptest/medium
+++ b/tools/xm-test/grouptest/medium
@@ -22,4 +22,3 @@ sysrq 01_sysrq_basic_neg.test 02_sysrq_sync_pos.test
 unpause
 vcpu-disable
 vcpu-pin
-vtpm
diff --git a/tools/xm-test/grouptest/xapi b/tools/xm-test/grouptest/xapi
index 3b04921..7a08b77 100644
--- a/tools/xm-test/grouptest/xapi
+++ b/tools/xm-test/grouptest/xapi
@@ -1,2 +1 @@
 xapi
-vtpm 09_vtpm-xapi.test
diff --git a/tools/xm-test/lib/XmTestLib/XenDomain.py b/tools/xm-test/lib/XmTestLib/XenDomain.py
index ae8c550..3ba7433 100644
--- a/tools/xm-test/lib/XmTestLib/XenDomain.py
+++ b/tools/xm-test/lib/XmTestLib/XenDomain.py
@@ -59,7 +59,6 @@ class XenConfig:
         # These options need to be lists
         self.defaultOpts["disk"] = []
         self.defaultOpts["vif"]  = []
-        self.defaultOpts["vtpm"] = []
 
         self.opts = self.defaultOpts
 
diff --git a/tools/xm-test/tests/Makefile.am b/tools/xm-test/tests/Makefile.am
index 8d673ed..455f50c 100644
--- a/tools/xm-test/tests/Makefile.am
+++ b/tools/xm-test/tests/Makefile.am
@@ -25,7 +25,6 @@ SUBDIRS = 	               	\
 		unpause         \
 		vcpu-disable    \
 		vcpu-pin	\
-		vtpm            \
 		enforce_dom0_cpus	\
 		save restore migrate	\
 		cpupool
diff --git a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py b/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
deleted file mode 100644
index dfd1227..0000000
--- a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-#                verify list
-
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-
-try:
-    domain.start(noConsole=True)
-except DomainError, e:
-    if verbose:
-        print e.extra
-    vtpm_cleanup(domain.getName())
-    FAIL("Unable to create domain")
-
-
-domName = domain.getName()
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-status, output = traceCommand("xm vtpm-list %s" % domain.getId())
-eyecatcher = "/local/domain/0/backend/vtpm"
-where = output.find(eyecatcher)
-if status != 0:
-    FAIL("xm vtpm-list returned bad status, expected 0, status is %i" % status)
-elif where < 0:
-    FAIL("Fail to list virtual TPM device")
-
-domain.stop()
diff --git a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py b/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
deleted file mode 100644
index a18cbab..0000000
--- a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-#                check list of pcrs
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-
-try:
-    console = domain.start()
-except DomainError, e:
-    if verbose:
-        print e.extra
-    FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
-    console.sendInput("input")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL(str(e))
-
-try:
-    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("No result from dumping the PCRs")
-
-if re.search("No such file",run["output"]):
-    FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-domain.closeConsole()
-
-domain.stop()
-
-if not re.search("PCR-00:",run["output"]):
-    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
diff --git a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py b/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
deleted file mode 100644
index b863f27..0000000
--- a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-#                check list of pcrs; suspend and resume the domain and
-#                check list of pcrs again
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-consoleHistory = ""
-
-try:
-    console = domain.start()
-except DomainError, e:
-    if verbose:
-        print e.extra
-    FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
-    console.sendInput("input")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL(str(e))
-
-try:
-    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("No result from dumping the PCRs")
-
-if re.search("No such file",run["output"]):
-    FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-consoleHistory = console.getHistory()
-domain.closeConsole()
-
-loop = 0
-while loop < 3:
-    try:
-        status, ouptut = traceCommand("xm save %s %s.save" %
-                                      (domName, domName),
-                                      timeout=30)
-
-    except TimeoutError, e:
-        saveLog(consoleHistory)
-        FAIL(str(e))
-
-    if status != 0:
-        saveLog(consoleHistory)
-        FAIL("xm save did not succeed")
-
-    try:
-        status, ouptut = traceCommand("xm restore %s.save" %
-                                      (domName),
-                                      timeout=30)
-    except TimeoutError, e:
-        os.remove("%s.save" % domName)
-        saveLog(consoleHistory)
-        FAIL(str(e))
-
-    os.remove("%s.save" % domName)
-
-    if status != 0:
-        saveLog(consoleHistory)
-        FAIL("xm restore did not succeed")
-
-    try:
-        console = domain.getConsole()
-    except ConsoleError, e:
-        FAIL(str(e))
-
-    try:
-        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-    except ConsoleError, e:
-        saveLog(console.getHistory())
-        FAIL(str(e))
-
-    if not re.search("PCR-00:",run["output"]):
-        saveLog(console.getHistory())
-        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
-
-    loop += 1
-
-domain.closeConsole()
-
-domain.stop()
-
diff --git a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py b/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
deleted file mode 100644
index ccc8b73..0000000
--- a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-#                check list of pcrs; locally migrate the domain and
-#                check list of pcrs again
-#                This test does local live migration.
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-consoleHistory = ""
-
-try:
-    console = domain.start()
-except DomainError, e:
-    if verbose:
-        print e.extra
-    FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
-    console.sendInput("input")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL(str(e))
-
-try:
-    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("No result from dumping the PCRs")
-
-if re.search("No such file",run["output"]):
-    FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-consoleHistory = console.getHistory()
-domain.closeConsole()
-
-old_domid = domid(domName)
-
-loop = 0
-while loop < 3:
-    try:
-        status, ouptut = traceCommand("xm migrate -l %s localhost" %
-                                      domName,
-                                      timeout=90)
-    except TimeoutError, e:
-        saveLog(consoleHistory)
-        FAIL(str(e))
-
-    if status != 0:
-        saveLog(consoleHistory)
-        FAIL("xm migrate did not succeed. External device migration activated?")
-
-
-    domName = domain.getName()
-    new_domid = domid(domName)
-
-    if (old_domid == new_domid):
-        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
-             (old_domid,loop))
-
-    try:
-        console = domain.getConsole()
-    except ConsoleError, e:
-        FAIL(str(e))
-
-    try:
-        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-    except ConsoleError, e:
-        saveLog(console.getHistory())
-        FAIL("No result from dumping the PCRs")
-
-    if not re.search("PCR-00:",run["output"]):
-        saveLog(console.getHistory())
-        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
-
-    loop += 1
-
-domain.closeConsole()
-
-domain.stop()
diff --git a/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py b/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py
deleted file mode 100644
index 57b87df..0000000
--- a/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-#                check list of pcrs; locally migrate the domain and
-#                check list of pcrs again
-#                This test does local (non-live) migration.
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-consoleHistory = ""
-
-try:
-    console = domain.start()
-except DomainError, e:
-    if verbose:
-        print e.extra
-    FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
-    console.sendInput("input")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL(str(e))
-
-try:
-    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("No result from dumping the PCRs")
-
-if re.search("No such file",run["output"]):
-    FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-consoleHistory = console.getHistory()
-domain.closeConsole()
-
-old_domid = domid(domName)
-
-loop = 0
-while loop < 3:
-    try:
-        status, ouptut = traceCommand("xm migrate %s localhost" %
-                                      domName,
-                                      timeout=90)
-    except TimeoutError, e:
-        saveLog(consoleHistory)
-        FAIL(str(e))
-
-    if status != 0:
-        saveLog(consoleHistory)
-        FAIL("xm migrate did not succeed. External device migration activated?")
-
-
-    domName = domain.getName()
-    new_domid = domid(domName)
-
-    if (old_domid == new_domid):
-        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
-             (old_domid,loop))
-
-    try:
-        console = domain.getConsole()
-    except ConsoleError, e:
-        FAIL(str(e))
-
-    try:
-        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-    except ConsoleError, e:
-        saveLog(console.getHistory())
-        FAIL("No result from dumping the PCRs")
-
-    if not re.search("PCR-00:",run["output"]):
-        saveLog(console.getHistory())
-        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
-
-    loop += 1
-
-domain.closeConsole()
-
-domain.stop()
diff --git a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py b/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
deleted file mode 100644
index c70691d..0000000
--- a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-#                extend a pcr
-#                check list of pcrs; suspend and resume the domain and
-#                check list of pcrs again and validate extended pcr
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-consoleHistory = ""
-
-try:
-    console = domain.start()
-except DomainError, e:
-    if verbose:
-        print e.extra
-    FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
-    console.sendInput("input")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL(str(e))
-
-try:
-    run = console.runCmd("mknod /dev/tpm0 c 10 224")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("Error while creating /dev/tpm0")
-
-try:
-    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("Error while extending PCR 0")
-
-try:
-    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("No result from dumping the PCRs")
-
-
-if re.search("No such file",run["output"]):
-    FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-if not re.search("PCR-00:",run["output"]):
-    saveLog(console.getHistory())
-    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
-
-if not re.search("PCR-00: 1E A7 BD",run["output"]):
-    saveLog(console.getHistory())
-    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
-
-consoleHistory = console.getHistory()
-domain.closeConsole()
-
-loop = 0
-while loop < 3:
-    try:
-        status, ouptut = traceCommand("xm save %s %s.save" %
-                                      (domName, domName),
-                                      timeout=30)
-
-    except TimeoutError, e:
-        saveLog(consoleHistory)
-        FAIL(str(e))
-
-    if status != 0:
-        saveLog(consoleHistory)
-        FAIL("xm save did not succeed")
-
-    try:
-        status, ouptut = traceCommand("xm restore %s.save" %
-                                      (domName),
-                                      timeout=30)
-    except TimeoutError, e:
-        os.remove("%s.save" % domName)
-        saveLog(consoleHistory)
-        FAIL(str(e))
-
-    os.remove("%s.save" % domName)
-
-    if status != 0:
-        saveLog(consoleHistory)
-        FAIL("xm restore did not succeed")
-
-    try:
-        console = domain.getConsole()
-    except ConsoleError, e:
-        FAIL(str(e))
-
-    try:
-        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-    except ConsoleError, e:
-        saveLog(console.getHistory())
-        FAIL(str(e))
-
-    if not re.search("PCR-00:",run["output"]):
-        saveLog(console.getHistory())
-        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
-
-    if not re.search("PCR-00: 1E A7 BD",run["output"]):
-        saveLog(console.getHistory())
-        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
-
-    loop += 1
-
-domain.closeConsole()
-
-domain.stop()
-
diff --git a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py b/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
deleted file mode 100644
index 4ff3360..0000000
--- a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-#                extend a pcr
-#                check list of pcrs; locally migrate the domain and
-#                check list of pcrs again and validate extended pcr
-#                This test does local live migration.
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-consoleHistory = ""
-
-try:
-    console = domain.start()
-except DomainError, e:
-    if verbose:
-        print e.extra
-    FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
-    console.sendInput("input")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL(str(e))
-
-try:
-    run = console.runCmd("mknod /dev/tpm0 c 10 224")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("Error while creating /dev/tpm0")
-
-try:
-    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("Error while extending PCR 0")
-
-try:
-    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("No result from dumping the PCRs")
-
-
-if re.search("No such file",run["output"]):
-    FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-if not re.search("PCR-00:",run["output"]):
-    saveLog(console.getHistory())
-    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
-
-if not re.search("PCR-00: 1E A7 BD",run["output"]):
-    saveLog(console.getHistory())
-    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
-
-consoleHistory = console.getHistory()
-domain.closeConsole()
-
-old_domid = domid(domName)
-
-loop = 0
-while loop < 3:
-    try:
-        status, ouptut = traceCommand("xm migrate -l %s localhost" %
-                                      domName,
-                                      timeout=90)
-    except TimeoutError, e:
-        saveLog(consoleHistory)
-        FAIL(str(e))
-
-    if status != 0:
-        saveLog(consoleHistory)
-        FAIL("xm migrate did not succeed. External device migration activated?")
-
-
-    domName = domain.getName()
-    new_domid = domid(domName)
-
-    if (old_domid == new_domid):
-        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
-             (old_domid,loop))
-
-    try:
-        console = domain.getConsole()
-    except ConsoleError, e:
-        FAIL(str(e))
-
-    try:
-        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-    except ConsoleError, e:
-        saveLog(console.getHistory())
-        FAIL("No result from dumping the PCRs")
-
-    if not re.search("PCR-00:",run["output"]):
-        saveLog(console.getHistory())
-        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
-
-    if not re.search("PCR-00: 1E A7 BD",run["output"]):
-        saveLog(console.getHistory())
-        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
-
-    loop += 1
-
-domain.closeConsole()
-
-domain.stop()
diff --git a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py b/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
deleted file mode 100644
index 27125fc..0000000
--- a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-#                extend a pcr
-#                check list of pcrs; locally migrate the domain and
-#                check list of pcrs again and validate extended pcr
-#                This test does local (non-live) migration.
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-consoleHistory = ""
-
-try:
-    console = domain.start()
-except DomainError, e:
-    if verbose:
-        print e.extra
-    FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
-    console.sendInput("input")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL(str(e))
-
-try:
-    run = console.runCmd("mknod /dev/tpm0 c 10 224")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("Error while creating /dev/tpm0")
-
-try:
-    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("Error while extending PCR 0")
-
-try:
-    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("No result from dumping the PCRs")
-
-
-if re.search("No such file",run["output"]):
-    FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-if not re.search("PCR-00:",run["output"]):
-    saveLog(console.getHistory())
-    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
-
-if not re.search("PCR-00: 1E A7 BD",run["output"]):
-    saveLog(console.getHistory())
-    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
-
-consoleHistory = console.getHistory()
-domain.closeConsole()
-
-old_domid = domid(domName)
-
-loop = 0
-while loop < 3:
-    try:
-        status, ouptut = traceCommand("xm migrate %s localhost" %
-                                      domName,
-                                      timeout=90)
-    except TimeoutError, e:
-        saveLog(consoleHistory)
-        FAIL(str(e))
-
-    if status != 0:
-        saveLog(consoleHistory)
-        FAIL("xm migrate did not succeed. External device migration activated?")
-
-
-    domName = domain.getName()
-    new_domid = domid(domName)
-
-    if (old_domid == new_domid):
-        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
-             (old_domid,loop))
-
-    try:
-        console = domain.getConsole()
-    except ConsoleError, e:
-        FAIL(str(e))
-
-    try:
-        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-    except ConsoleError, e:
-        saveLog(console.getHistory())
-        FAIL("No result from dumping the PCRs")
-
-    if not re.search("PCR-00:",run["output"]):
-        saveLog(console.getHistory())
-        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
-
-    if not re.search("PCR-00: 1E A7 BD",run["output"]):
-        saveLog(console.getHistory())
-        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
-
-    loop += 1
-
-domain.closeConsole()
-
-domain.stop()
diff --git a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py b/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
deleted file mode 100644
index a1aa8b3..0000000
--- a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
+++ /dev/null
@@ -1,158 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Test to test the vtpm class through the Xen-API
-#
-# Tested methods:
-#  VTPM: get_uuid, get_backend, get_by_uuid, get_record
-#        create, destroy, get_VM
-#  VM: get_VTPMS
-
-from XmTestLib import xapi
-from XmTestLib.XenAPIDomain import XmTestAPIDomain
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-
-VTPM_RECORD_KEYS = [ 'backend', 'VM', 'uuid', 'other_config' ]
-
-try:
-    # XmTestAPIDomain tries to establish a connection to XenD
-    domain = XmTestAPIDomain()
-except Exception, e:
-    SKIP("Skipping test. Error: %s" % str(e))
-vm_uuid = domain.get_uuid()
-
-vtpmcfg = {}
-vtpmcfg['backend'] = DOM0_UUID
-vtpmcfg['VM'] = vm_uuid
-
-session = xapi.connect()
-
-vtpm_uuid = session.xenapi.VTPM.create(vtpmcfg)
-
-vtpm_be = session.xenapi.VTPM.get_backend(vtpm_uuid)
-if vtpm_be != vtpmcfg['backend']:
-    FAIL("vTPM's backend is in '%s', expected: '%s'" %
-         (vtpm_be, vtpmcfg['backend']))
-
-vtpm_rec = session.xenapi.VTPM.get_record(vtpm_uuid)
-
-miss_keys = []
-for k in VTPM_RECORD_KEYS:
-    if k not in vtpm_rec.keys():
-        miss_keys.append(k)
-if len(miss_keys) > 0:
-    FAIL("vTPM record is missing key(s): %s" % miss_keys)
-
-if vtpm_rec['uuid']  != vtpm_uuid:
-    FAIL("vTPM record shows vtpm uuid '%s', expected: '%s'" %
-         (vtpm_rec['uuid'], vtpm_uuid))
-if vtpm_rec['VM']  != vm_uuid:
-    FAIL("vTPM record shows VM uuid '%s', expected: '%s'" %
-         (vtpm_rec['VM'], vm_uuid))
-if vtpm_rec['backend'] != vtpmcfg['backend']:
-    FAIL("vTPM record shows VM bakcned '%s', expected: '%s'" %
-         (vtpm_rev['backend'], vtpmcfg['backend']))
-
-badkeys = []
-keys = vtpm_rec.keys()
-for k in keys:
-    if k not in VTPM_RECORD_KEYS:
-        badkeys.append(k)
-if len(badkeys) > 0:
-    FAIL("Unexpected attributes in result: %s" % badkeys)
-
-if vm_uuid != session.xenapi.VTPM.get_VM(vtpm_uuid):
-    FAIL("VM uuid from VTPM.get_VM different (%s) than expected (%s)." %
-         (vm_ref, vm_uuid))
-
-uuid = session.xenapi.VTPM.get_uuid(vtpm_uuid)
-if uuid != vtpm_uuid:
-    FAIL("vTPM from VTPM.get_uuid different (%s) than expected (%s)." %
-         (uuid, vtpm_uuid))
-
-vtpm_ref = session.xenapi.VTPM.get_by_uuid(vtpm_uuid)
-if vtpm_ref != vtpm_uuid:
-    FAIL("vTPM from VTPM.get_by_uuid different (%s) than expected (%s)." %
-         (vtpm_ref, vtpm_uuid))
-
-vm_vtpms = session.xenapi.VM.get_VTPMs(vm_uuid)
-if len(vm_vtpms) != 1:
-    FAIL("Number of vTPMs from get_VTPMs is (%d) not what was expected (%d)" %
-         (len(vm_vtpms), 1))
-if vtpm_uuid not in vm_vtpms:
-    FAIL("Other vTPM uuid (%s) returned from VM.get_VTPMs than expected (%s)" %
-         (vm_vtpms[0], vtpm_uuid))
-
-try:
-    console = domain.start()
-except DomainError, e:
-    FAIL("Unable to create domain.")
-
-try:
-    console.sendInput("input")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL(str(e))
-
-try:
-    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("1. No result from dumping the PCRs")
-
-if re.search("No such file",run["output"]):
-    FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-if not re.search("PCR-00:",run["output"]):
-    saveLog(console.getHistory())
-    FAIL("1. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
-
-try:
-    session.xenapi.VTPM.destroy(vtpm_uuid)
-    #Should never get here
-    FAIL("Could destroy vTPM while VM is running")
-except:
-    pass
-
-rc = session.xenapi.VM.suspend(vm_uuid)
-if rc:
-    FAIL("Could not suspend VM")
-
-try:
-    session.xenapi.VTPM.destroy(vtpm_uuid)
-    #May not throw an exception in 'suspend' state
-except:
-    pass
-
-rc = session.xenapi.VM.resume(vm_uuid, False)
-if rc:
-    FAIL("Could not resume VM")
-
-try:
-    console = domain.getConsole()
-except ConsoleError, e:
-    FAIL(str(e))
-
-try:
-    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
-    saveLog(console.getHistory())
-    FAIL("2. No result from dumping the PCRs. vTPM has been removed?")
-
-if not re.search("PCR-00:",run["output"]):
-    saveLog(console.getHistory())
-    FAIL("2. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
-
-domain.stop()
-
-try:
-    session.xenapi.VTPM.destroy(vtpm_uuid)
-except:
-    FAIL("Could NOT destroy vTPM while domain is halted.")
-
-domain.destroy()
diff --git a/tools/xm-test/tests/vtpm/Makefile.am b/tools/xm-test/tests/vtpm/Makefile.am
deleted file mode 100644
index dd67e45..0000000
--- a/tools/xm-test/tests/vtpm/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-SUBDIRS =
-
-TESTS = 01_vtpm-list_pos.test \
-        02_vtpm-cat_pcrs.test \
-        03_vtpm-susp_res.test \
-        04_vtpm-loc_migr.test \
-        05_vtpm-loc_migr.test \
-        06_vtpm-susp_res_pcrs.test \
-        07_vtpm-mig_pcrs.test \
-        08_vtpm-mig_pcrs.test \
-        09_vtpm-xapi.test
-
-XFAIL_TESTS =
-
-EXTRA_DIST = $(TESTS) $(XFAIL_TESTS) vtpm_utils.py
-TESTS_ENVIRONMENT=@TENV@
-
-%.test: %.py
-	cp $< $@
-	chmod +x $@
-
-clean-local: am_config_clean-local
-
-am_config_clean-local:
-	rm -f *test
-	rm -f *log
-	rm -f *~
diff --git a/tools/xm-test/tests/vtpm/vtpm_utils.py b/tools/xm-test/tests/vtpm/vtpm_utils.py
deleted file mode 100644
index 4e5b281..0000000
--- a/tools/xm-test/tests/vtpm/vtpm_utils.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-from XmTestLib import *
-
-if ENABLE_HVM_SUPPORT:
-    SKIP("vtpm tests not supported for HVM domains")
-
-status, output = traceCommand("COLUMNS=200 ; "
-                              "ps aux | grep vtpm_manager | grep -v grep")
-if output == "":
-    SKIP("virtual TPM manager must be started to run this test; might "
-         "need /dev/tpm0")
-
-def vtpm_cleanup(domName):
-    traceCommand("/etc/xen/scripts/vtpm-delete "
-                 "`xenstore-read /local/domain/0/backend/vtpm/%s/0/uuid`" %
-                 str(domid(domName)))
-
-def vtpm_cleanup(uuid):
-    from xen.xm import main
-    if main.serverType != main.SERVER_XEN_API:
-        traceCommand("/etc/xen/scripts/vtpm-delete %s" % uuid)
-
-def vtpm_get_uuid(domainid):
-    s, o = traceCommand("xenstore-read "
-                        "/local/domain/0/backend/vtpm/%s/0/uuid" % domainid)
-    return o
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:41:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:41:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1a6-0006Sz-Sx; Thu, 01 Nov 2012 20:41:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jbeulich@suse.com>) id 1TU1a5-0006Sa-4h
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:41:37 +0000
Received: from [85.158.137.99:46850] by server-12.bemta-3.messagelabs.com id
	1B/1B-22757-08ED2905; Thu, 01 Nov 2012 20:41:36 +0000
X-Env-Sender: jbeulich@suse.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1351802495!12235431!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21846 invoked from network); 1 Nov 2012 20:41:35 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-217.messagelabs.com with SMTP;
	1 Nov 2012 20:41:35 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 01 Nov 2012 20:41:35 +0000
Message-Id: <5092DE7E020000780008EB96@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 01 Nov 2012 20:41:34 +0000
From: "Jan Beulich" <jbeulich@suse.com>
To: <dan.magenheimer@oracle.com>,<keir@xen.org>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
In-Reply-To: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> Dan Magenheimer <dan.magenheimer@oracle.com> 11/01/12 9:34 PM >>>
>With the plan to obsolete the x86 32-bit hypervisor at 4.3,

That's not just a plan, but reality already.

>when prototyping the "claim" hypercall/subop, can I assume
>that the CONFIG_X86 code in the hypervisor and, specifically
>any separation of the concepts of xen_heap from dom_heap,
>can be ignored?

No, you shouldn't. Once adding support for memory amounts beyond 5Tb
I expect the separation to become meaningful even for x86-64.

>Or will the ARM version of the hypervisor be requiring
>a similar separation of xen_heap vs dom_heap?
>
>If the CONFIG_X86/separation code will no longer be used,
>shall I submit a patch to delete the code in page_alloc.c
>and memory.c?  Or can you (Keir or Jan) just delete it?

Please don't.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:41:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:41:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1a6-0006Sz-Sx; Thu, 01 Nov 2012 20:41:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jbeulich@suse.com>) id 1TU1a5-0006Sa-4h
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:41:37 +0000
Received: from [85.158.137.99:46850] by server-12.bemta-3.messagelabs.com id
	1B/1B-22757-08ED2905; Thu, 01 Nov 2012 20:41:36 +0000
X-Env-Sender: jbeulich@suse.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1351802495!12235431!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21846 invoked from network); 1 Nov 2012 20:41:35 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-217.messagelabs.com with SMTP;
	1 Nov 2012 20:41:35 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 01 Nov 2012 20:41:35 +0000
Message-Id: <5092DE7E020000780008EB96@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 01 Nov 2012 20:41:34 +0000
From: "Jan Beulich" <jbeulich@suse.com>
To: <dan.magenheimer@oracle.com>,<keir@xen.org>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
In-Reply-To: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> Dan Magenheimer <dan.magenheimer@oracle.com> 11/01/12 9:34 PM >>>
>With the plan to obsolete the x86 32-bit hypervisor at 4.3,

That's not just a plan, but reality already.

>when prototyping the "claim" hypercall/subop, can I assume
>that the CONFIG_X86 code in the hypervisor and, specifically
>any separation of the concepts of xen_heap from dom_heap,
>can be ignored?

No, you shouldn't. Once adding support for memory amounts beyond 5Tb
I expect the separation to become meaningful even for x86-64.

>Or will the ARM version of the hypervisor be requiring
>a similar separation of xen_heap vs dom_heap?
>
>If the CONFIG_X86/separation code will no longer be used,
>shall I submit a patch to delete the code in page_alloc.c
>and memory.c?  Or can you (Keir or Jan) just delete it?

Please don't.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:46:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:46:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1el-0006ll-Kt; Thu, 01 Nov 2012 20:46:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TU1el-0006lf-6G
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:46:27 +0000
Received: from [85.158.143.35:5557] by server-3.bemta-4.messagelabs.com id
	9A/A9-06841-2AFD2905; Thu, 01 Nov 2012 20:46:26 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1351802784!16140389!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5949 invoked from network); 1 Nov 2012 20:46:25 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 20:46:25 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TU1eg-000Hru-Hi; Thu, 01 Nov 2012 20:46:22 +0000
Date: Thu, 1 Nov 2012 20:46:22 +0000
From: Tim Deegan <tim@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <20121101204622.GA66969@ocelot.phlegethon.org>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
User-Agent: Mutt/1.4.2.1i
Cc: "Keir \(Xen.org\)" <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 13:34 -0700 on 01 Nov (1351776880), Dan Magenheimer wrote:
> With the plan to obsolete the x86 32-bit hypervisor at 4.3,
> when prototyping the "claim" hypercall/subop, can I assume
> that the CONFIG_X86 code in the hypervisor and, specifically
> any separation of the concepts of xen_heap from dom_heap,
> can be ignored?
> 
> Or will the ARM version of the hypervisor be requiring
> a similar separation of xen_heap vs dom_heap?

Yes, 32-bit ARM has this separation.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:46:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:46:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1el-0006ll-Kt; Thu, 01 Nov 2012 20:46:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TU1el-0006lf-6G
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:46:27 +0000
Received: from [85.158.143.35:5557] by server-3.bemta-4.messagelabs.com id
	9A/A9-06841-2AFD2905; Thu, 01 Nov 2012 20:46:26 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1351802784!16140389!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5949 invoked from network); 1 Nov 2012 20:46:25 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 20:46:25 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TU1eg-000Hru-Hi; Thu, 01 Nov 2012 20:46:22 +0000
Date: Thu, 1 Nov 2012 20:46:22 +0000
From: Tim Deegan <tim@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <20121101204622.GA66969@ocelot.phlegethon.org>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
User-Agent: Mutt/1.4.2.1i
Cc: "Keir \(Xen.org\)" <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 13:34 -0700 on 01 Nov (1351776880), Dan Magenheimer wrote:
> With the plan to obsolete the x86 32-bit hypervisor at 4.3,
> when prototyping the "claim" hypercall/subop, can I assume
> that the CONFIG_X86 code in the hypervisor and, specifically
> any separation of the concepts of xen_heap from dom_heap,
> can be ignored?
> 
> Or will the ARM version of the hypervisor be requiring
> a similar separation of xen_heap vs dom_heap?

Yes, 32-bit ARM has this separation.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:55:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:55:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1nN-00073K-LU; Thu, 01 Nov 2012 20:55:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TU1nM-00073F-2y
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:55:20 +0000
Received: from [85.158.139.83:26710] by server-15.bemta-5.messagelabs.com id
	D4/8F-26920-7B1E2905; Thu, 01 Nov 2012 20:55:19 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1351803317!28364096!1
X-Originating-IP: [141.146.126.227]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuMjI3ID0+IDgzOTM3MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25911 invoked from network); 1 Nov 2012 20:55:18 -0000
Received: from acsinet15.oracle.com (HELO acsinet15.oracle.com)
	(141.146.126.227)
	by server-12.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 20:55:18 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA1KtFUe024274
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 1 Nov 2012 20:55:16 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA1KtFrD023875
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 1 Nov 2012 20:55:15 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA1KtEWE014700; Thu, 1 Nov 2012 15:55:14 -0500
MIME-Version: 1.0
Message-ID: <75058642-ad3b-4df9-a24a-7dbdc5f6e8c5@default>
Date: Thu, 1 Nov 2012 13:55:10 -0700 (PDT)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <jbeulich@suse.com>, keir@xen.org
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<5092DE7E020000780008EB96@nat28.tlf.novell.com>
In-Reply-To: <5092DE7E020000780008EB96@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:jbeulich@suse.com]
> Sent: Thursday, November 01, 2012 2:42 PM
> To: Dan Magenheimer; keir@xen.org
> Cc: xen-devel@lists.xen.org
> Subject: Re: 32bit xen and "claim"

> >If the CONFIG_X86/separation code will no longer be used,
> >shall I submit a patch to delete the code in page_alloc.c
> >and memory.c?  Or can you (Keir or Jan) just delete it?
> 
> Please don't.

OK.  I'm glad I asked rather than assuming.

> >when prototyping the "claim" hypercall/subop, can I assume
> >that the CONFIG_X86 code in the hypervisor and, specifically
> >any separation of the concepts of xen_heap from dom_heap,
> >can be ignored?
> 
> No, you shouldn't. Once adding support for memory amounts beyond 5Tb
> I expect the separation to become meaningful even for x86-64.

On quick scan, I don't see anything obvious in the archives
that explains why 5Tb is the limit (rather than, say, 4Tb
or 8Tb, or some other power of two).  Could you provide a
pointer to this info or, if you agree it is non-obvious and
undocumented, say a few words of explanation?

Also, just wondering, should exceeding 5Tb be on the 4.3
features list or is >5Tb physical memory still too far away?

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:55:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:55:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1nN-00073K-LU; Thu, 01 Nov 2012 20:55:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TU1nM-00073F-2y
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:55:20 +0000
Received: from [85.158.139.83:26710] by server-15.bemta-5.messagelabs.com id
	D4/8F-26920-7B1E2905; Thu, 01 Nov 2012 20:55:19 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1351803317!28364096!1
X-Originating-IP: [141.146.126.227]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuMjI3ID0+IDgzOTM3MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25911 invoked from network); 1 Nov 2012 20:55:18 -0000
Received: from acsinet15.oracle.com (HELO acsinet15.oracle.com)
	(141.146.126.227)
	by server-12.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 20:55:18 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA1KtFUe024274
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 1 Nov 2012 20:55:16 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA1KtFrD023875
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 1 Nov 2012 20:55:15 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA1KtEWE014700; Thu, 1 Nov 2012 15:55:14 -0500
MIME-Version: 1.0
Message-ID: <75058642-ad3b-4df9-a24a-7dbdc5f6e8c5@default>
Date: Thu, 1 Nov 2012 13:55:10 -0700 (PDT)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <jbeulich@suse.com>, keir@xen.org
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<5092DE7E020000780008EB96@nat28.tlf.novell.com>
In-Reply-To: <5092DE7E020000780008EB96@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:jbeulich@suse.com]
> Sent: Thursday, November 01, 2012 2:42 PM
> To: Dan Magenheimer; keir@xen.org
> Cc: xen-devel@lists.xen.org
> Subject: Re: 32bit xen and "claim"

> >If the CONFIG_X86/separation code will no longer be used,
> >shall I submit a patch to delete the code in page_alloc.c
> >and memory.c?  Or can you (Keir or Jan) just delete it?
> 
> Please don't.

OK.  I'm glad I asked rather than assuming.

> >when prototyping the "claim" hypercall/subop, can I assume
> >that the CONFIG_X86 code in the hypervisor and, specifically
> >any separation of the concepts of xen_heap from dom_heap,
> >can be ignored?
> 
> No, you shouldn't. Once adding support for memory amounts beyond 5Tb
> I expect the separation to become meaningful even for x86-64.

On quick scan, I don't see anything obvious in the archives
that explains why 5Tb is the limit (rather than, say, 4Tb
or 8Tb, or some other power of two).  Could you provide a
pointer to this info or, if you agree it is non-obvious and
undocumented, say a few words of explanation?

Also, just wondering, should exceeding 5Tb be on the 4.3
features list or is >5Tb physical memory still too far away?

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:58:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:58:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1pv-0007CM-6s; Thu, 01 Nov 2012 20:57:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TU1pt-0007CD-Di
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:57:57 +0000
Received: from [85.158.139.211:12140] by server-14.bemta-5.messagelabs.com id
	90/51-21768-452E2905; Thu, 01 Nov 2012 20:57:56 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1351803468!18087445!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMTM5Mjc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 558 invoked from network); 1 Nov 2012 20:57:49 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 20:57:49 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA1KvkVP028446
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 1 Nov 2012 20:57:47 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA1Kvjsu013223
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 1 Nov 2012 20:57:46 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA1Kvjbx016352; Thu, 1 Nov 2012 15:57:45 -0500
MIME-Version: 1.0
Message-ID: <e47d14a7-65e2-4e0e-aec9-3cc4379aa272@default>
Date: Thu, 1 Nov 2012 13:57:41 -0700 (PDT)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Tim Deegan <tim@xen.org>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<20121101204622.GA66969@ocelot.phlegethon.org>
In-Reply-To: <20121101204622.GA66969@ocelot.phlegethon.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "Keir \(Xen.org\)" <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Tim Deegan [mailto:tim@xen.org]
> Subject: Re: [Xen-devel] 32bit xen and "claim"
> 
> At 13:34 -0700 on 01 Nov (1351776880), Dan Magenheimer wrote:
> > With the plan to obsolete the x86 32-bit hypervisor at 4.3,
> > when prototyping the "claim" hypercall/subop, can I assume
> > that the CONFIG_X86 code in the hypervisor and, specifically
> > any separation of the concepts of xen_heap from dom_heap,
> > can be ignored?
> >
> > Or will the ARM version of the hypervisor be requiring
> > a similar separation of xen_heap vs dom_heap?
> 
> Yes, 32-bit ARM has this separation.

Hmmm... looking at page_alloc.c... does ARM overload CONFIG_X86
to mean CONFIG-32-bitness then?  Seems dangerous given that
various random chunks of CONFIG_X86 may be disappearing.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 20:58:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 20:58:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1pv-0007CM-6s; Thu, 01 Nov 2012 20:57:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TU1pt-0007CD-Di
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 20:57:57 +0000
Received: from [85.158.139.211:12140] by server-14.bemta-5.messagelabs.com id
	90/51-21768-452E2905; Thu, 01 Nov 2012 20:57:56 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1351803468!18087445!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMTM5Mjc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 558 invoked from network); 1 Nov 2012 20:57:49 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 20:57:49 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA1KvkVP028446
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 1 Nov 2012 20:57:47 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA1Kvjsu013223
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 1 Nov 2012 20:57:46 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA1Kvjbx016352; Thu, 1 Nov 2012 15:57:45 -0500
MIME-Version: 1.0
Message-ID: <e47d14a7-65e2-4e0e-aec9-3cc4379aa272@default>
Date: Thu, 1 Nov 2012 13:57:41 -0700 (PDT)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Tim Deegan <tim@xen.org>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<20121101204622.GA66969@ocelot.phlegethon.org>
In-Reply-To: <20121101204622.GA66969@ocelot.phlegethon.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "Keir \(Xen.org\)" <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Tim Deegan [mailto:tim@xen.org]
> Subject: Re: [Xen-devel] 32bit xen and "claim"
> 
> At 13:34 -0700 on 01 Nov (1351776880), Dan Magenheimer wrote:
> > With the plan to obsolete the x86 32-bit hypervisor at 4.3,
> > when prototyping the "claim" hypercall/subop, can I assume
> > that the CONFIG_X86 code in the hypervisor and, specifically
> > any separation of the concepts of xen_heap from dom_heap,
> > can be ignored?
> >
> > Or will the ARM version of the hypervisor be requiring
> > a similar separation of xen_heap vs dom_heap?
> 
> Yes, 32-bit ARM has this separation.

Hmmm... looking at page_alloc.c... does ARM overload CONFIG_X86
to mean CONFIG-32-bitness then?  Seems dangerous given that
various random chunks of CONFIG_X86 may be disappearing.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 21:03:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 21:03:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1ue-0007Tf-Tf; Thu, 01 Nov 2012 21:02:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TU1ud-0007Ta-FB
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 21:02:51 +0000
Received: from [85.158.143.99:56671] by server-2.bemta-4.messagelabs.com id
	22/A2-28922-A73E2905; Thu, 01 Nov 2012 21:02:50 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-5.tower-216.messagelabs.com!1351803769!27951390!1
X-Originating-IP: [81.169.146.161]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA0Njk5Mzg=\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA0Njk5Mzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18542 invoked from network); 1 Nov 2012 21:02:49 -0000
Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.161)
	by server-5.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 21:02:49 -0000
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmztM8TOFHjS0IEKU=
X-RZG-CLASS-ID: mo00
Received: from probook.site
	(dslb-088-065-093-063.pools.arcor-ip.net [88.65.93.63])
	by smtp.strato.de (jored mo25) (RZmta 30.21 DYNA|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id 2019e3oA1KGJzY ;
	Thu, 1 Nov 2012 22:02:41 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 7248A18643; Thu,  1 Nov 2012 22:02:40 +0100 (CET)
From: Olaf Hering <olaf@aepfle.de>
To: Jeremy Fitzhardinge <jeremy@goop.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Thu,  1 Nov 2012 22:02:30 +0100
Message-Id: <1351803750-7335-1-git-send-email-olaf@aepfle.de>
X-Mailer: git-send-email 1.8.0
Cc: Olaf Hering <olaf@aepfle.de>, xen-devel@lists.xensource.com,
	linux-kernel@vger.kernel.org
Subject: [Xen-devel] [PATCH v5] xen PVonHVM: use E820_Reserved area for
	shared_info
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a respin of 00e37bdb0113a98408de42db85be002f21dbffd3
("xen PVonHVM: move shared_info to MMIO before kexec").

Currently kexec in a PVonHVM guest fails with a triple fault because the
new kernel overwrites the shared info page. The exact failure depends on
the size of the kernel image. This patch moves the pfn from RAM into an
E820 reserved memory area.

The pfn containing the shared_info is located somewhere in RAM. This will
cause trouble if the current kernel is doing a kexec boot into a new
kernel. The new kernel (and its startup code) can not know where the pfn
is, so it can not reserve the page. The hypervisor will continue to update
the pfn, and as a result memory corruption occours in the new kernel.

The toolstack marks the memory area FC000000-FFFFFFFF as reserved in the
E820 map. Within that range newer toolstacks (4.3+) will keep 1MB
starting from FE700000 as reserved for guest use. Older Xen4 toolstacks
will usually not allocate areas up to FE700000, so FE700000 is expected
to work also with older toolstacks.

In Xen3 there is no reserved area at a fixed location. If the guest is
started on such old hosts the shared_info page will be placed in RAM. As
a result kexec can not be used.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
v5:
 reword subject
 handle Xen3, continue to use extend_brk on old hosts
v4:
 rebase to 3.7-rc3
v3:
 make xen_hvm_init_shared_info static
v2:
 add __init to xen_hvm_set_shared_info

 arch/x86/xen/enlighten.c | 75 ++++++++++++++++++++++++++++++++++--------------
 arch/x86/xen/suspend.c   |  2 +-
 arch/x86/xen/xen-ops.h   |  2 +-
 3 files changed, 55 insertions(+), 24 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 586d838..a90c3bb 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1495,51 +1495,72 @@ asmlinkage void __init xen_start_kernel(void)
 #endif
 }
 
-void __ref xen_hvm_init_shared_info(void)
+#ifdef CONFIG_XEN_PVHVM
+#define HVM_SHARED_INFO_ADDR 0xFE700000UL
+static struct shared_info *xen_hvm_shared_info;
+static unsigned long xen_hvm_sip_phys;
+static int xen_major, xen_minor;
+
+static void xen_hvm_connect_shared_info(unsigned long pfn)
 {
-	int cpu;
 	struct xen_add_to_physmap xatp;
-	static struct shared_info *shared_info_page = 0;
 
-	if (!shared_info_page)
-		shared_info_page = (struct shared_info *)
-			extend_brk(PAGE_SIZE, PAGE_SIZE);
 	xatp.domid = DOMID_SELF;
 	xatp.idx = 0;
 	xatp.space = XENMAPSPACE_shared_info;
-	xatp.gpfn = __pa(shared_info_page) >> PAGE_SHIFT;
+	xatp.gpfn = pfn;
 	if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp))
 		BUG();
 
-	HYPERVISOR_shared_info = (struct shared_info *)shared_info_page;
+}
+static void __init xen_hvm_set_shared_info(struct shared_info *sip)
+{
+	int cpu;
+
+	HYPERVISOR_shared_info = sip;
 
 	/* xen_vcpu is a pointer to the vcpu_info struct in the shared_info
 	 * page, we use it in the event channel upcall and in some pvclock
 	 * related functions. We don't need the vcpu_info placement
 	 * optimizations because we don't use any pv_mmu or pv_irq op on
-	 * HVM.
-	 * When xen_hvm_init_shared_info is run at boot time only vcpu 0 is
-	 * online but xen_hvm_init_shared_info is run at resume time too and
-	 * in that case multiple vcpus might be online. */
-	for_each_online_cpu(cpu) {
+	 * HVM. */
+	for_each_online_cpu(cpu)
 		per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu];
+}
+
+/* Reconnect the shared_info pfn to a (new) mfn */
+void xen_hvm_resume_shared_info(void)
+{
+	xen_hvm_connect_shared_info(xen_hvm_sip_phys >> PAGE_SHIFT);
+}
+
+/* Xen tools prior to Xen 4 do not provide a E820_Reserved area for guest usage.
+ * On these old tools the shared info page will be placed in E820_Ram.
+ * Xen 4 provides a E820_Reserved area at 0xFC000000, and this code expects
+ * that nothing is mapped up to HVM_SHARED_INFO_ADDR.
+ * Xen 4.3+ provides an explicit 1MB area at HVM_SHARED_INFO_ADDR which is used
+ * here for the shared info page. */
+static void __init xen_hvm_init_shared_info(void)
+{
+	if (xen_major < 4) {
+		xen_hvm_shared_info = extend_brk(PAGE_SIZE, PAGE_SIZE);
+		xen_hvm_sip_phys = __pa(xen_hvm_shared_info);
+	} else {
+		xen_hvm_sip_phys = HVM_SHARED_INFO_ADDR;
+		set_fixmap(FIX_PARAVIRT_BOOTMAP, xen_hvm_sip_phys);
+		xen_hvm_shared_info =
+		(struct shared_info *)fix_to_virt(FIX_PARAVIRT_BOOTMAP);
 	}
+	xen_hvm_connect_shared_info(xen_hvm_sip_phys >> PAGE_SHIFT);
+	xen_hvm_set_shared_info(xen_hvm_shared_info);
 }
 
-#ifdef CONFIG_XEN_PVHVM
 static void __init init_hvm_pv_info(void)
 {
-	int major, minor;
 	uint32_t eax, ebx, ecx, edx, pages, msr, base;
 	u64 pfn;
 
 	base = xen_cpuid_base();
-	cpuid(base + 1, &eax, &ebx, &ecx, &edx);
-
-	major = eax >> 16;
-	minor = eax & 0xffff;
-	printk(KERN_INFO "Xen version %d.%d.\n", major, minor);
-
 	cpuid(base + 2, &pages, &msr, &ecx, &edx);
 
 	pfn = __pa(hypercall_page);
@@ -1590,12 +1611,22 @@ static void __init xen_hvm_guest_init(void)
 
 static bool __init xen_hvm_platform(void)
 {
+	uint32_t eax, ebx, ecx, edx, base;
+
 	if (xen_pv_domain())
 		return false;
 
-	if (!xen_cpuid_base())
+	base = xen_cpuid_base();
+	if (!base)
 		return false;
 
+	cpuid(base + 1, &eax, &ebx, &ecx, &edx);
+
+	xen_major = eax >> 16;
+	xen_minor = eax & 0xffff;
+
+	printk(KERN_INFO "Xen version %d.%d.\n", xen_major, xen_minor);
+
 	return true;
 }
 
diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c
index 45329c8..ae8a00c 100644
--- a/arch/x86/xen/suspend.c
+++ b/arch/x86/xen/suspend.c
@@ -30,7 +30,7 @@ void xen_arch_hvm_post_suspend(int suspend_cancelled)
 {
 #ifdef CONFIG_XEN_PVHVM
 	int cpu;
-	xen_hvm_init_shared_info();
+	xen_hvm_resume_shared_info();
 	xen_callback_vector();
 	xen_unplug_emulated_devices();
 	if (xen_feature(XENFEAT_hvm_safe_pvclock)) {
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index a95b417..d2e73d1 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -40,7 +40,7 @@ void xen_enable_syscall(void);
 void xen_vcpu_restore(void);
 
 void xen_callback_vector(void);
-void xen_hvm_init_shared_info(void);
+void xen_hvm_resume_shared_info(void);
 void xen_unplug_emulated_devices(void);
 
 void __init xen_build_dynamic_phys_to_machine(void);
-- 
1.8.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 21:03:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 21:03:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU1ue-0007Tf-Tf; Thu, 01 Nov 2012 21:02:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TU1ud-0007Ta-FB
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 21:02:51 +0000
Received: from [85.158.143.99:56671] by server-2.bemta-4.messagelabs.com id
	22/A2-28922-A73E2905; Thu, 01 Nov 2012 21:02:50 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-5.tower-216.messagelabs.com!1351803769!27951390!1
X-Originating-IP: [81.169.146.161]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA0Njk5Mzg=\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA0Njk5Mzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18542 invoked from network); 1 Nov 2012 21:02:49 -0000
Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.161)
	by server-5.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 21:02:49 -0000
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmztM8TOFHjS0IEKU=
X-RZG-CLASS-ID: mo00
Received: from probook.site
	(dslb-088-065-093-063.pools.arcor-ip.net [88.65.93.63])
	by smtp.strato.de (jored mo25) (RZmta 30.21 DYNA|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id 2019e3oA1KGJzY ;
	Thu, 1 Nov 2012 22:02:41 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 7248A18643; Thu,  1 Nov 2012 22:02:40 +0100 (CET)
From: Olaf Hering <olaf@aepfle.de>
To: Jeremy Fitzhardinge <jeremy@goop.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Thu,  1 Nov 2012 22:02:30 +0100
Message-Id: <1351803750-7335-1-git-send-email-olaf@aepfle.de>
X-Mailer: git-send-email 1.8.0
Cc: Olaf Hering <olaf@aepfle.de>, xen-devel@lists.xensource.com,
	linux-kernel@vger.kernel.org
Subject: [Xen-devel] [PATCH v5] xen PVonHVM: use E820_Reserved area for
	shared_info
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a respin of 00e37bdb0113a98408de42db85be002f21dbffd3
("xen PVonHVM: move shared_info to MMIO before kexec").

Currently kexec in a PVonHVM guest fails with a triple fault because the
new kernel overwrites the shared info page. The exact failure depends on
the size of the kernel image. This patch moves the pfn from RAM into an
E820 reserved memory area.

The pfn containing the shared_info is located somewhere in RAM. This will
cause trouble if the current kernel is doing a kexec boot into a new
kernel. The new kernel (and its startup code) can not know where the pfn
is, so it can not reserve the page. The hypervisor will continue to update
the pfn, and as a result memory corruption occours in the new kernel.

The toolstack marks the memory area FC000000-FFFFFFFF as reserved in the
E820 map. Within that range newer toolstacks (4.3+) will keep 1MB
starting from FE700000 as reserved for guest use. Older Xen4 toolstacks
will usually not allocate areas up to FE700000, so FE700000 is expected
to work also with older toolstacks.

In Xen3 there is no reserved area at a fixed location. If the guest is
started on such old hosts the shared_info page will be placed in RAM. As
a result kexec can not be used.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
v5:
 reword subject
 handle Xen3, continue to use extend_brk on old hosts
v4:
 rebase to 3.7-rc3
v3:
 make xen_hvm_init_shared_info static
v2:
 add __init to xen_hvm_set_shared_info

 arch/x86/xen/enlighten.c | 75 ++++++++++++++++++++++++++++++++++--------------
 arch/x86/xen/suspend.c   |  2 +-
 arch/x86/xen/xen-ops.h   |  2 +-
 3 files changed, 55 insertions(+), 24 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 586d838..a90c3bb 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1495,51 +1495,72 @@ asmlinkage void __init xen_start_kernel(void)
 #endif
 }
 
-void __ref xen_hvm_init_shared_info(void)
+#ifdef CONFIG_XEN_PVHVM
+#define HVM_SHARED_INFO_ADDR 0xFE700000UL
+static struct shared_info *xen_hvm_shared_info;
+static unsigned long xen_hvm_sip_phys;
+static int xen_major, xen_minor;
+
+static void xen_hvm_connect_shared_info(unsigned long pfn)
 {
-	int cpu;
 	struct xen_add_to_physmap xatp;
-	static struct shared_info *shared_info_page = 0;
 
-	if (!shared_info_page)
-		shared_info_page = (struct shared_info *)
-			extend_brk(PAGE_SIZE, PAGE_SIZE);
 	xatp.domid = DOMID_SELF;
 	xatp.idx = 0;
 	xatp.space = XENMAPSPACE_shared_info;
-	xatp.gpfn = __pa(shared_info_page) >> PAGE_SHIFT;
+	xatp.gpfn = pfn;
 	if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp))
 		BUG();
 
-	HYPERVISOR_shared_info = (struct shared_info *)shared_info_page;
+}
+static void __init xen_hvm_set_shared_info(struct shared_info *sip)
+{
+	int cpu;
+
+	HYPERVISOR_shared_info = sip;
 
 	/* xen_vcpu is a pointer to the vcpu_info struct in the shared_info
 	 * page, we use it in the event channel upcall and in some pvclock
 	 * related functions. We don't need the vcpu_info placement
 	 * optimizations because we don't use any pv_mmu or pv_irq op on
-	 * HVM.
-	 * When xen_hvm_init_shared_info is run at boot time only vcpu 0 is
-	 * online but xen_hvm_init_shared_info is run at resume time too and
-	 * in that case multiple vcpus might be online. */
-	for_each_online_cpu(cpu) {
+	 * HVM. */
+	for_each_online_cpu(cpu)
 		per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu];
+}
+
+/* Reconnect the shared_info pfn to a (new) mfn */
+void xen_hvm_resume_shared_info(void)
+{
+	xen_hvm_connect_shared_info(xen_hvm_sip_phys >> PAGE_SHIFT);
+}
+
+/* Xen tools prior to Xen 4 do not provide a E820_Reserved area for guest usage.
+ * On these old tools the shared info page will be placed in E820_Ram.
+ * Xen 4 provides a E820_Reserved area at 0xFC000000, and this code expects
+ * that nothing is mapped up to HVM_SHARED_INFO_ADDR.
+ * Xen 4.3+ provides an explicit 1MB area at HVM_SHARED_INFO_ADDR which is used
+ * here for the shared info page. */
+static void __init xen_hvm_init_shared_info(void)
+{
+	if (xen_major < 4) {
+		xen_hvm_shared_info = extend_brk(PAGE_SIZE, PAGE_SIZE);
+		xen_hvm_sip_phys = __pa(xen_hvm_shared_info);
+	} else {
+		xen_hvm_sip_phys = HVM_SHARED_INFO_ADDR;
+		set_fixmap(FIX_PARAVIRT_BOOTMAP, xen_hvm_sip_phys);
+		xen_hvm_shared_info =
+		(struct shared_info *)fix_to_virt(FIX_PARAVIRT_BOOTMAP);
 	}
+	xen_hvm_connect_shared_info(xen_hvm_sip_phys >> PAGE_SHIFT);
+	xen_hvm_set_shared_info(xen_hvm_shared_info);
 }
 
-#ifdef CONFIG_XEN_PVHVM
 static void __init init_hvm_pv_info(void)
 {
-	int major, minor;
 	uint32_t eax, ebx, ecx, edx, pages, msr, base;
 	u64 pfn;
 
 	base = xen_cpuid_base();
-	cpuid(base + 1, &eax, &ebx, &ecx, &edx);
-
-	major = eax >> 16;
-	minor = eax & 0xffff;
-	printk(KERN_INFO "Xen version %d.%d.\n", major, minor);
-
 	cpuid(base + 2, &pages, &msr, &ecx, &edx);
 
 	pfn = __pa(hypercall_page);
@@ -1590,12 +1611,22 @@ static void __init xen_hvm_guest_init(void)
 
 static bool __init xen_hvm_platform(void)
 {
+	uint32_t eax, ebx, ecx, edx, base;
+
 	if (xen_pv_domain())
 		return false;
 
-	if (!xen_cpuid_base())
+	base = xen_cpuid_base();
+	if (!base)
 		return false;
 
+	cpuid(base + 1, &eax, &ebx, &ecx, &edx);
+
+	xen_major = eax >> 16;
+	xen_minor = eax & 0xffff;
+
+	printk(KERN_INFO "Xen version %d.%d.\n", xen_major, xen_minor);
+
 	return true;
 }
 
diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c
index 45329c8..ae8a00c 100644
--- a/arch/x86/xen/suspend.c
+++ b/arch/x86/xen/suspend.c
@@ -30,7 +30,7 @@ void xen_arch_hvm_post_suspend(int suspend_cancelled)
 {
 #ifdef CONFIG_XEN_PVHVM
 	int cpu;
-	xen_hvm_init_shared_info();
+	xen_hvm_resume_shared_info();
 	xen_callback_vector();
 	xen_unplug_emulated_devices();
 	if (xen_feature(XENFEAT_hvm_safe_pvclock)) {
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index a95b417..d2e73d1 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -40,7 +40,7 @@ void xen_enable_syscall(void);
 void xen_vcpu_restore(void);
 
 void xen_callback_vector(void);
-void xen_hvm_init_shared_info(void);
+void xen_hvm_resume_shared_info(void);
 void xen_unplug_emulated_devices(void);
 
 void __init xen_build_dynamic_phys_to_machine(void);
-- 
1.8.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 21:11:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 21:11:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU22v-0007iB-TV; Thu, 01 Nov 2012 21:11:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TU22u-0007i6-PI
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 21:11:25 +0000
Received: from [85.158.143.99:28614] by server-3.bemta-4.messagelabs.com id
	C1/10-06841-C75E2905; Thu, 01 Nov 2012 21:11:24 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1351804283!22968701!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY4ODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7726 invoked from network); 1 Nov 2012 21:11:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 21:11:23 -0000
X-IronPort-AV: E=Sophos;i="4.80,695,1344211200"; d="scan'208";a="15546311"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 21:11:22 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 1 Nov 2012 21:11:22 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TU22s-0006Js-5b;
	Thu, 01 Nov 2012 21:11:22 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TU22s-0007Ej-54;
	Thu, 01 Nov 2012 21:11:22 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14302-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 1 Nov 2012 21:11:22 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14302: regressions - trouble:
	broken/fail/pass
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14302 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14302/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-i386-i386-xl             9 guest-start               fail REGR. vs. 14076
 test-i386-i386-xl-qemuu-winxpsp3  7 windows-install       fail REGR. vs. 14076
 test-i386-i386-xl-winxpsp3    7 windows-install           fail REGR. vs. 14076
 test-i386-i386-xl-win         7 windows-install           fail REGR. vs. 14076

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-sedf     11 guest-localmigrate          fail pass in 14294
 test-amd64-i386-xl-multivcpu  3 host-install(3)           broken pass in 14294
 test-i386-i386-xl-winxpsp3    3 host-install(3)  broken in 14294 pass in 14302

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore         fail REGR. vs. 14076

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  2bca7e58a3df
baseline version:
 xen                  40ccbee890e1

------------------------------------------------------------
People who touched revisions under test:
  Andres Lagar-Cavilla <andres@lagarcavilla.org>
  Bastian Blank <waldi@debian.org>
  Chuang Cao <chuang.cao@oracle.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jason McCarver <slam@parasite.cc>
  Joe Jin <joe.jin@oracle.com>
  Keir Fraser <keir@xen.org>
  Matt Wilson <msw@amazon.com>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Olaf Hering <olaf@aepfle.de>
  Roger Pau Monne <roger.pau@citrix.com>
  Sander Eikelenboom <linux@eikelenboom.it>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            fail    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 broken  
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 632 lines long.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 21:11:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 21:11:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU22v-0007iB-TV; Thu, 01 Nov 2012 21:11:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TU22u-0007i6-PI
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 21:11:25 +0000
Received: from [85.158.143.99:28614] by server-3.bemta-4.messagelabs.com id
	C1/10-06841-C75E2905; Thu, 01 Nov 2012 21:11:24 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1351804283!22968701!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY4ODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7726 invoked from network); 1 Nov 2012 21:11:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 21:11:23 -0000
X-IronPort-AV: E=Sophos;i="4.80,695,1344211200"; d="scan'208";a="15546311"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	01 Nov 2012 21:11:22 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 1 Nov 2012 21:11:22 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TU22s-0006Js-5b;
	Thu, 01 Nov 2012 21:11:22 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TU22s-0007Ej-54;
	Thu, 01 Nov 2012 21:11:22 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14302-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 1 Nov 2012 21:11:22 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14302: regressions - trouble:
	broken/fail/pass
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14302 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14302/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-i386-i386-xl             9 guest-start               fail REGR. vs. 14076
 test-i386-i386-xl-qemuu-winxpsp3  7 windows-install       fail REGR. vs. 14076
 test-i386-i386-xl-winxpsp3    7 windows-install           fail REGR. vs. 14076
 test-i386-i386-xl-win         7 windows-install           fail REGR. vs. 14076

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-sedf     11 guest-localmigrate          fail pass in 14294
 test-amd64-i386-xl-multivcpu  3 host-install(3)           broken pass in 14294
 test-i386-i386-xl-winxpsp3    3 host-install(3)  broken in 14294 pass in 14302

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore         fail REGR. vs. 14076

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  2bca7e58a3df
baseline version:
 xen                  40ccbee890e1

------------------------------------------------------------
People who touched revisions under test:
  Andres Lagar-Cavilla <andres@lagarcavilla.org>
  Bastian Blank <waldi@debian.org>
  Chuang Cao <chuang.cao@oracle.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jason McCarver <slam@parasite.cc>
  Joe Jin <joe.jin@oracle.com>
  Keir Fraser <keir@xen.org>
  Matt Wilson <msw@amazon.com>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Olaf Hering <olaf@aepfle.de>
  Roger Pau Monne <roger.pau@citrix.com>
  Sander Eikelenboom <linux@eikelenboom.it>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            fail    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 broken  
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 632 lines long.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 21:29:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 21:29:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU2KX-00089a-Tn; Thu, 01 Nov 2012 21:29:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TU2KW-00089V-JB
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 21:29:36 +0000
Received: from [85.158.139.211:2837] by server-12.bemta-5.messagelabs.com id
	B6/32-02886-FB9E2905; Thu, 01 Nov 2012 21:29:35 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1351805373!18090305!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2448 invoked from network); 1 Nov 2012 21:29:34 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 21:29:34 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 4A82F84074;
	Thu,  1 Nov 2012 22:29:33 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id VQ6M3YR8ocWL; Thu,  1 Nov 2012 22:29:33 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id 02FD884072;
	Thu,  1 Nov 2012 22:29:32 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TU2KR-0001Qt-5S; Thu, 01 Nov 2012 22:29:31 +0100
Date: Thu, 1 Nov 2012 22:29:31 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121101212931.GQ5569@type.youpi.perso.aquilenet.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	Ian.Campbell@citrix.com, xen-devel@lists.xen.org
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH VTPM 1/9] Disable -DGNT_DEBUG and
	-DGNTMAP_DEBUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Thu 01 Nov 2012 16:33:24 -0400, a =E9crit :
> Disabling the above flags in default mini-os build. They generate a
> lot of spam.

Do they?  I've never seen any, and normally they shouldn't be, so there
could be another issue.  Could you show what happens?

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 21:29:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 21:29:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU2KX-00089a-Tn; Thu, 01 Nov 2012 21:29:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TU2KW-00089V-JB
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 21:29:36 +0000
Received: from [85.158.139.211:2837] by server-12.bemta-5.messagelabs.com id
	B6/32-02886-FB9E2905; Thu, 01 Nov 2012 21:29:35 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1351805373!18090305!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2448 invoked from network); 1 Nov 2012 21:29:34 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 21:29:34 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 4A82F84074;
	Thu,  1 Nov 2012 22:29:33 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id VQ6M3YR8ocWL; Thu,  1 Nov 2012 22:29:33 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id 02FD884072;
	Thu,  1 Nov 2012 22:29:32 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TU2KR-0001Qt-5S; Thu, 01 Nov 2012 22:29:31 +0100
Date: Thu, 1 Nov 2012 22:29:31 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121101212931.GQ5569@type.youpi.perso.aquilenet.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	Ian.Campbell@citrix.com, xen-devel@lists.xen.org
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH VTPM 1/9] Disable -DGNT_DEBUG and
	-DGNTMAP_DEBUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Thu 01 Nov 2012 16:33:24 -0400, a =E9crit :
> Disabling the above flags in default mini-os build. They generate a
> lot of spam.

Do they?  I've never seen any, and normally they shouldn't be, so there
could be another issue.  Could you show what happens?

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 21:32:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 21:32:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU2NM-0008Hx-GP; Thu, 01 Nov 2012 21:32:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TU2NK-0008Hn-O3
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 21:32:30 +0000
Received: from [85.158.138.51:3824] by server-11.bemta-3.messagelabs.com id
	C4/75-19361-96AE2905; Thu, 01 Nov 2012 21:32:25 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1351805544!19447112!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31391 invoked from network); 1 Nov 2012 21:32:25 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-7.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 21:32:25 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 6B85A84074;
	Thu,  1 Nov 2012 22:32:24 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id 7AqdyGyrEdEk; Thu,  1 Nov 2012 22:32:24 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id 24B0684072;
	Thu,  1 Nov 2012 22:32:24 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TU2NC-0001Tf-PY; Thu, 01 Nov 2012 22:32:22 +0100
Date: Thu, 1 Nov 2012 22:32:22 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121101213222.GR5569@type.youpi.perso.aquilenet.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	Ian.Campbell@citrix.com, xen-devel@lists.xen.org
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1351802007-19178-2-git-send-email-matthew.fioravante@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1351802007-19178-2-git-send-email-matthew.fioravante@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH VTPM 2/9] add xenbus_read_uuid to mini-os
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Thu 01 Nov 2012 16:33:25 -0400, a =E9crit :
> Similar to xenbus_read_integer, this function reads a xenstore path
> and parses it as a uuid. See include/xenbus.h for details.
> =

> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 21:32:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 21:32:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU2NM-0008Hx-GP; Thu, 01 Nov 2012 21:32:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TU2NK-0008Hn-O3
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 21:32:30 +0000
Received: from [85.158.138.51:3824] by server-11.bemta-3.messagelabs.com id
	C4/75-19361-96AE2905; Thu, 01 Nov 2012 21:32:25 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1351805544!19447112!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31391 invoked from network); 1 Nov 2012 21:32:25 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-7.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 21:32:25 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 6B85A84074;
	Thu,  1 Nov 2012 22:32:24 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id 7AqdyGyrEdEk; Thu,  1 Nov 2012 22:32:24 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id 24B0684072;
	Thu,  1 Nov 2012 22:32:24 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TU2NC-0001Tf-PY; Thu, 01 Nov 2012 22:32:22 +0100
Date: Thu, 1 Nov 2012 22:32:22 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121101213222.GR5569@type.youpi.perso.aquilenet.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	Ian.Campbell@citrix.com, xen-devel@lists.xen.org
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1351802007-19178-2-git-send-email-matthew.fioravante@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1351802007-19178-2-git-send-email-matthew.fioravante@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH VTPM 2/9] add xenbus_read_uuid to mini-os
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Thu 01 Nov 2012 16:33:25 -0400, a =E9crit :
> Similar to xenbus_read_integer, this function reads a xenstore path
> and parses it as a uuid. See include/xenbus.h for details.
> =

> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 21:35:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 21:35:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU2Pf-0008Sq-2r; Thu, 01 Nov 2012 21:34:55 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TU2Pd-0008Sh-LW
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 21:34:53 +0000
Received: from [193.109.254.147:7828] by server-14.bemta-14.messagelabs.com id
	1D/A1-14517-CFAE2905; Thu, 01 Nov 2012 21:34:52 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1351805692!3639646!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16718 invoked from network); 1 Nov 2012 21:34:52 -0000
Received: from toccata.ens-lyon.org (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-6.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 21:34:52 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 1391184074;
	Thu,  1 Nov 2012 22:34:52 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id tURCf7VdaXpm; Thu,  1 Nov 2012 22:34:51 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id C2A5A84072;
	Thu,  1 Nov 2012 22:34:51 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TU2Pa-0001UI-CK; Thu, 01 Nov 2012 22:34:50 +0100
Date: Thu, 1 Nov 2012 22:34:50 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121101213450.GS5569@type.youpi.perso.aquilenet.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	Ian.Campbell@citrix.com, xen-devel@lists.xen.org
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1351802007-19178-4-git-send-email-matthew.fioravante@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1351802007-19178-4-git-send-email-matthew.fioravante@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH VTPM 4/9] fix bug in lseek for mini-os
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Thu 01 Nov 2012 16:33:27 -0400, a =E9crit :
> -#if defined(CONFIG_BLKFRONT) || defined(CONFIG_TPMFRONT) || defined(CONF=
IG_TPM_TIS)

...

>  #ifdef CONFIG_TPMFRNT

There seems to be a mismatch here between CONFIG_TPMFRONT and
CONFIG_TPMFRNT?

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 21:35:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 21:35:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU2Pf-0008Sq-2r; Thu, 01 Nov 2012 21:34:55 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TU2Pd-0008Sh-LW
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 21:34:53 +0000
Received: from [193.109.254.147:7828] by server-14.bemta-14.messagelabs.com id
	1D/A1-14517-CFAE2905; Thu, 01 Nov 2012 21:34:52 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1351805692!3639646!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16718 invoked from network); 1 Nov 2012 21:34:52 -0000
Received: from toccata.ens-lyon.org (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-6.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 1 Nov 2012 21:34:52 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 1391184074;
	Thu,  1 Nov 2012 22:34:52 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id tURCf7VdaXpm; Thu,  1 Nov 2012 22:34:51 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id C2A5A84072;
	Thu,  1 Nov 2012 22:34:51 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TU2Pa-0001UI-CK; Thu, 01 Nov 2012 22:34:50 +0100
Date: Thu, 1 Nov 2012 22:34:50 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121101213450.GS5569@type.youpi.perso.aquilenet.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	Ian.Campbell@citrix.com, xen-devel@lists.xen.org
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1351802007-19178-4-git-send-email-matthew.fioravante@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1351802007-19178-4-git-send-email-matthew.fioravante@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH VTPM 4/9] fix bug in lseek for mini-os
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Thu 01 Nov 2012 16:33:27 -0400, a =E9crit :
> -#if defined(CONFIG_BLKFRONT) || defined(CONFIG_TPMFRONT) || defined(CONF=
IG_TPM_TIS)

...

>  #ifdef CONFIG_TPMFRNT

There seems to be a mismatch here between CONFIG_TPMFRONT and
CONFIG_TPMFRNT?

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 21:58:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 21:58:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU2mP-0000gZ-Um; Thu, 01 Nov 2012 21:58:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TU2mO-0000gO-P1
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 21:58:25 +0000
Received: from [85.158.139.211:43585] by server-6.bemta-5.messagelabs.com id
	B6/01-19321-080F2905; Thu, 01 Nov 2012 21:58:24 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1351807101!18486400!1
X-Originating-IP: [148.87.113.117]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQ4Ljg3LjExMy4xMTcgPT4gODMyMjAy\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26932 invoked from network); 1 Nov 2012 21:58:23 -0000
Received: from rcsinet15.oracle.com (HELO rcsinet15.oracle.com)
	(148.87.113.117)
	by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 21:58:23 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA1LvvqN027502
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 1 Nov 2012 21:57:57 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA1Lvssl008978
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 1 Nov 2012 21:57:55 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA1LvrIm023096; Thu, 1 Nov 2012 16:57:53 -0500
Received: from localhost.localdomain (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 01 Nov 2012 14:57:52 -0700
Date: Thu, 1 Nov 2012 17:57:49 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Randy Dunlap <rdunlap@infradead.org>
Message-ID: <20121101215749.GB18854@localhost.localdomain>
References: <20121101163622.129b59967d2ee76e6946874a@canb.auug.org.au>
	<5092AEF7.5020609@infradead.org>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5092AEF7.5020609@infradead.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, linux-next@vger.kernel.org
Subject: Re: [Xen-devel] linux-next: Tree for Nov 1 (xen)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 01, 2012 at 10:18:47AM -0700, Randy Dunlap wrote:
> On 10/31/2012 10:36 PM, Stephen Rothwell wrote:
> 
> > Hi all,
> > 
> > New trees: rr-fixes and swiotlb
> > 
> > Changes since 20121031:
> > 
> 
> 
> arch/x86/xen/enlighten.c:109:0: warning: "xen_pvh_domain" redefined
> include/xen/xen.h:23:0: note: this is the location of the previous definition

I think this was due to a patch that mistakenly was put in the tmem.git
tree. It should not surface tomorrow.

> 
> Full randconfig file is attached.
> 
> -- 
> ~Randy

> #
> # Automatically generated file; DO NOT EDIT.
> # Linux/x86_64 3.7.0-rc3 Kernel Configuration
> #
> CONFIG_64BIT=y
> CONFIG_X86_64=y
> CONFIG_X86=y
> CONFIG_INSTRUCTION_DECODER=y
> CONFIG_OUTPUT_FORMAT="elf64-x86-64"
> CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
> CONFIG_LOCKDEP_SUPPORT=y
> CONFIG_STACKTRACE_SUPPORT=y
> CONFIG_HAVE_LATENCYTOP_SUPPORT=y
> CONFIG_MMU=y
> CONFIG_NEED_DMA_MAP_STATE=y
> CONFIG_NEED_SG_DMA_LENGTH=y
> CONFIG_GENERIC_BUG=y
> CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
> CONFIG_GENERIC_HWEIGHT=y
> CONFIG_GENERIC_GPIO=y
> CONFIG_RWSEM_XCHGADD_ALGORITHM=y
> CONFIG_GENERIC_CALIBRATE_DELAY=y
> CONFIG_ARCH_HAS_CPU_RELAX=y
> CONFIG_ARCH_HAS_DEFAULT_IDLE=y
> CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
> CONFIG_ARCH_HAS_CPU_AUTOPROBE=y
> CONFIG_HAVE_SETUP_PER_CPU_AREA=y
> CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
> CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
> CONFIG_ARCH_HIBERNATION_POSSIBLE=y
> CONFIG_ARCH_SUSPEND_POSSIBLE=y
> CONFIG_ZONE_DMA32=y
> CONFIG_AUDIT_ARCH=y
> CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
> CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
> CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11"
> CONFIG_ARCH_SUPPORTS_UPROBES=y
> CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
> CONFIG_HAVE_IRQ_WORK=y
> CONFIG_IRQ_WORK=y
> CONFIG_BUILDTIME_EXTABLE_SORT=y
> 
> #
> # General setup
> #
> CONFIG_EXPERIMENTAL=y
> CONFIG_BROKEN_ON_SMP=y
> CONFIG_INIT_ENV_ARG_LIMIT=32
> CONFIG_CROSS_COMPILE=""
> CONFIG_LOCALVERSION=""
> # CONFIG_LOCALVERSION_AUTO is not set
> CONFIG_HAVE_KERNEL_GZIP=y
> CONFIG_HAVE_KERNEL_BZIP2=y
> CONFIG_HAVE_KERNEL_LZMA=y
> CONFIG_HAVE_KERNEL_XZ=y
> CONFIG_HAVE_KERNEL_LZO=y
> # CONFIG_KERNEL_GZIP is not set
> CONFIG_KERNEL_BZIP2=y
> # CONFIG_KERNEL_LZMA is not set
> # CONFIG_KERNEL_XZ is not set
> # CONFIG_KERNEL_LZO is not set
> CONFIG_DEFAULT_HOSTNAME="(none)"
> CONFIG_SYSVIPC=y
> CONFIG_FHANDLE=y
> CONFIG_HAVE_GENERIC_HARDIRQS=y
> 
> #
> # IRQ subsystem
> #
> CONFIG_GENERIC_HARDIRQS=y
> CONFIG_GENERIC_IRQ_PROBE=y
> CONFIG_GENERIC_IRQ_SHOW=y
> CONFIG_IRQ_DOMAIN=y
> # CONFIG_IRQ_DOMAIN_DEBUG is not set
> CONFIG_IRQ_FORCED_THREADING=y
> CONFIG_SPARSE_IRQ=y
> CONFIG_CLOCKSOURCE_WATCHDOG=y
> CONFIG_ARCH_CLOCKSOURCE_DATA=y
> CONFIG_GENERIC_TIME_VSYSCALL=y
> CONFIG_GENERIC_CLOCKEVENTS=y
> CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
> CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
> CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
> CONFIG_GENERIC_CMOS_UPDATE=y
> 
> #
> # Timers subsystem
> #
> CONFIG_TICK_ONESHOT=y
> # CONFIG_NO_HZ is not set
> CONFIG_HIGH_RES_TIMERS=y
> 
> #
> # CPU/Task time and stats accounting
> #
> CONFIG_TICK_CPU_ACCOUNTING=y
> # CONFIG_IRQ_TIME_ACCOUNTING is not set
> # CONFIG_BSD_PROCESS_ACCT is not set
> 
> #
> # RCU Subsystem
> #
> CONFIG_TINY_PREEMPT_RCU=y
> CONFIG_PREEMPT_RCU=y
> # CONFIG_TREE_RCU_TRACE is not set
> CONFIG_RCU_BOOST=y
> CONFIG_RCU_BOOST_PRIO=1
> CONFIG_RCU_BOOST_DELAY=500
> CONFIG_IKCONFIG=m
> CONFIG_LOG_BUF_SHIFT=17
> CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
> CONFIG_CHECKPOINT_RESTORE=y
> CONFIG_NAMESPACES=y
> CONFIG_UTS_NS=y
> # CONFIG_IPC_NS is not set
> # CONFIG_PID_NS is not set
> # CONFIG_SCHED_AUTOGROUP is not set
> CONFIG_SYSFS_DEPRECATED=y
> # CONFIG_SYSFS_DEPRECATED_V2 is not set
> # CONFIG_RELAY is not set
> # CONFIG_BLK_DEV_INITRD is not set
> # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
> CONFIG_ANON_INODES=y
> CONFIG_EXPERT=y
> CONFIG_HAVE_UID16=y
> CONFIG_UID16=y
> CONFIG_SYSCTL_EXCEPTION_TRACE=y
> CONFIG_KALLSYMS=y
> CONFIG_KALLSYMS_ALL=y
> CONFIG_HOTPLUG=y
> # CONFIG_PRINTK is not set
> CONFIG_BUG=y
> CONFIG_ELF_CORE=y
> # CONFIG_PCSPKR_PLATFORM is not set
> CONFIG_HAVE_PCSPKR_PLATFORM=y
> CONFIG_BASE_FULL=y
> CONFIG_FUTEX=y
> # CONFIG_EPOLL is not set
> # CONFIG_SIGNALFD is not set
> # CONFIG_TIMERFD is not set
> # CONFIG_EVENTFD is not set
> # CONFIG_SHMEM is not set
> # CONFIG_AIO is not set
> # CONFIG_EMBEDDED is not set
> CONFIG_HAVE_PERF_EVENTS=y
> 
> #
> # Kernel Performance Events And Counters
> #
> CONFIG_PERF_EVENTS=y
> # CONFIG_DEBUG_PERF_USE_VMALLOC is not set
> CONFIG_VM_EVENT_COUNTERS=y
> CONFIG_SLUB_DEBUG=y
> CONFIG_COMPAT_BRK=y
> # CONFIG_SLAB is not set
> CONFIG_SLUB=y
> # CONFIG_SLOB is not set
> CONFIG_PROFILING=y
> # CONFIG_OPROFILE is not set
> CONFIG_HAVE_OPROFILE=y
> CONFIG_OPROFILE_NMI_TIMER=y
> CONFIG_KPROBES=y
> CONFIG_JUMP_LABEL=y
> CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
> CONFIG_KRETPROBES=y
> CONFIG_HAVE_IOREMAP_PROT=y
> CONFIG_HAVE_KPROBES=y
> CONFIG_HAVE_KRETPROBES=y
> CONFIG_HAVE_OPTPROBES=y
> CONFIG_HAVE_ARCH_TRACEHOOK=y
> CONFIG_HAVE_DMA_ATTRS=y
> CONFIG_GENERIC_SMP_IDLE_THREAD=y
> CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
> CONFIG_HAVE_DMA_API_DEBUG=y
> CONFIG_HAVE_HW_BREAKPOINT=y
> CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
> CONFIG_HAVE_USER_RETURN_NOTIFIER=y
> CONFIG_HAVE_PERF_EVENTS_NMI=y
> CONFIG_HAVE_PERF_REGS=y
> CONFIG_HAVE_PERF_USER_STACK_DUMP=y
> CONFIG_HAVE_ARCH_JUMP_LABEL=y
> CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
> CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
> CONFIG_HAVE_CMPXCHG_LOCAL=y
> CONFIG_HAVE_CMPXCHG_DOUBLE=y
> CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
> CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y
> CONFIG_GENERIC_KERNEL_THREAD=y
> CONFIG_GENERIC_KERNEL_EXECVE=y
> CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
> CONFIG_HAVE_RCU_USER_QS=y
> CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
> CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
> CONFIG_MODULES_USE_ELF_RELA=y
> 
> #
> # GCOV-based kernel profiling
> #
> # CONFIG_GCOV_KERNEL is not set
> # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
> CONFIG_RT_MUTEXES=y
> CONFIG_BASE_SMALL=0
> CONFIG_MODULES=y
> CONFIG_MODULE_FORCE_LOAD=y
> CONFIG_MODULE_UNLOAD=y
> # CONFIG_MODULE_FORCE_UNLOAD is not set
> CONFIG_MODVERSIONS=y
> CONFIG_MODULE_SRCVERSION_ALL=y
> CONFIG_MODULE_SIG=y
> CONFIG_MODULE_SIG_FORCE=y
> # CONFIG_MODULE_SIG_SHA1 is not set
> # CONFIG_MODULE_SIG_SHA224 is not set
> CONFIG_MODULE_SIG_SHA256=y
> # CONFIG_MODULE_SIG_SHA384 is not set
> # CONFIG_MODULE_SIG_SHA512 is not set
> # CONFIG_BLOCK is not set
> CONFIG_ASN1=y
> CONFIG_UNINLINE_SPIN_UNLOCK=y
> CONFIG_FREEZER=y
> 
> #
> # Processor type and features
> #
> # CONFIG_ZONE_DMA is not set
> # CONFIG_SMP is not set
> CONFIG_X86_MPPARSE=y
> # CONFIG_X86_EXTENDED_PLATFORM is not set
> CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
> CONFIG_SCHED_OMIT_FRAME_POINTER=y
> # CONFIG_KVMTOOL_TEST_ENABLE is not set
> CONFIG_PARAVIRT_GUEST=y
> # CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
> CONFIG_XEN=y
> # CONFIG_XEN_PRIVILEGED_GUEST is not set
> CONFIG_XEN_MAX_DOMAIN_MEMORY=500
> CONFIG_XEN_SAVE_RESTORE=y
> # CONFIG_XEN_DEBUG_FS is not set
> CONFIG_XEN_X86_PVH=y
> # CONFIG_KVM_GUEST is not set
> CONFIG_PARAVIRT=y
> CONFIG_PARAVIRT_CLOCK=y
> CONFIG_PARAVIRT_DEBUG=y
> CONFIG_NO_BOOTMEM=y
> # CONFIG_MEMTEST is not set
> # CONFIG_MK8 is not set
> # CONFIG_MPSC is not set
> # CONFIG_MCORE2 is not set
> # CONFIG_MATOM is not set
> CONFIG_GENERIC_CPU=y
> CONFIG_X86_INTERNODE_CACHE_SHIFT=6
> CONFIG_X86_CMPXCHG=y
> CONFIG_X86_L1_CACHE_SHIFT=6
> CONFIG_X86_XADD=y
> CONFIG_X86_WP_WORKS_OK=y
> CONFIG_X86_TSC=y
> CONFIG_X86_CMPXCHG64=y
> CONFIG_X86_CMOV=y
> CONFIG_X86_MINIMUM_CPU_FAMILY=64
> CONFIG_X86_DEBUGCTLMSR=y
> # CONFIG_PROCESSOR_SELECT is not set
> CONFIG_CPU_SUP_INTEL=y
> CONFIG_CPU_SUP_AMD=y
> CONFIG_CPU_SUP_CENTAUR=y
> CONFIG_HPET_TIMER=y
> # CONFIG_DMI is not set
> CONFIG_SWIOTLB=y
> CONFIG_IOMMU_HELPER=y
> CONFIG_NR_CPUS=1
> # CONFIG_PREEMPT_NONE is not set
> # CONFIG_PREEMPT_VOLUNTARY is not set
> CONFIG_PREEMPT=y
> CONFIG_PREEMPT_COUNT=y
> CONFIG_X86_LOCAL_APIC=y
> CONFIG_X86_IO_APIC=y
> # CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS is not set
> CONFIG_X86_MCE=y
> CONFIG_X86_MCE_INTEL=y
> # CONFIG_X86_MCE_AMD is not set
> CONFIG_X86_MCE_THRESHOLD=y
> CONFIG_X86_MCE_INJECT=m
> CONFIG_X86_THERMAL_VECTOR=y
> CONFIG_I8K=m
> # CONFIG_MICROCODE is not set
> CONFIG_X86_MSR=m
> CONFIG_X86_CPUID=m
> CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
> CONFIG_ARCH_DMA_ADDR_T_64BIT=y
> CONFIG_DIRECT_GBPAGES=y
> CONFIG_ARCH_SPARSEMEM_ENABLE=y
> CONFIG_ARCH_SPARSEMEM_DEFAULT=y
> CONFIG_ARCH_SELECT_MEMORY_MODEL=y
> CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
> CONFIG_SELECT_MEMORY_MODEL=y
> CONFIG_SPARSEMEM_MANUAL=y
> CONFIG_SPARSEMEM=y
> CONFIG_HAVE_MEMORY_PRESENT=y
> CONFIG_SPARSEMEM_EXTREME=y
> CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
> CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=y
> # CONFIG_SPARSEMEM_VMEMMAP is not set
> CONFIG_HAVE_MEMBLOCK=y
> CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
> CONFIG_ARCH_DISCARD_MEMBLOCK=y
> CONFIG_MEMORY_ISOLATION=y
> # CONFIG_MEMORY_HOTPLUG is not set
> CONFIG_PAGEFLAGS_EXTENDED=y
> CONFIG_SPLIT_PTLOCK_CPUS=999999
> # CONFIG_COMPACTION is not set
> CONFIG_PHYS_ADDR_T_64BIT=y
> CONFIG_ZONE_DMA_FLAG=0
> CONFIG_VIRT_TO_BUS=y
> CONFIG_MMU_NOTIFIER=y
> CONFIG_KSM=y
> CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
> CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
> CONFIG_MEMORY_FAILURE=y
> # CONFIG_TRANSPARENT_HUGEPAGE is not set
> CONFIG_CROSS_MEMORY_ATTACH=y
> CONFIG_NEED_PER_CPU_KM=y
> CONFIG_CLEANCACHE=y
> # CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
> CONFIG_X86_RESERVE_LOW=64
> CONFIG_MTRR=y
> CONFIG_MTRR_SANITIZER=y
> CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
> CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
> # CONFIG_X86_PAT is not set
> # CONFIG_ARCH_RANDOM is not set
> CONFIG_X86_SMAP=y
> # CONFIG_SECCOMP is not set
> CONFIG_CC_STACKPROTECTOR=y
> # CONFIG_HZ_100 is not set
> # CONFIG_HZ_250 is not set
> CONFIG_HZ_300=y
> # CONFIG_HZ_1000 is not set
> CONFIG_HZ=300
> CONFIG_SCHED_HRTICK=y
> # CONFIG_KEXEC is not set
> # CONFIG_CRASH_DUMP is not set
> CONFIG_PHYSICAL_START=0x1000000
> # CONFIG_RELOCATABLE is not set
> CONFIG_PHYSICAL_ALIGN=0x1000000
> # CONFIG_COMPAT_VDSO is not set
> CONFIG_CMDLINE_BOOL=y
> CONFIG_CMDLINE=""
> CONFIG_CMDLINE_OVERRIDE=y
> CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
> 
> #
> # Power management and ACPI options
> #
> CONFIG_SUSPEND=y
> CONFIG_SUSPEND_FREEZER=y
> CONFIG_HIBERNATE_CALLBACKS=y
> CONFIG_PM_SLEEP=y
> CONFIG_PM_AUTOSLEEP=y
> CONFIG_PM_WAKELOCKS=y
> CONFIG_PM_WAKELOCKS_LIMIT=100
> # CONFIG_PM_WAKELOCKS_GC is not set
> CONFIG_PM_RUNTIME=y
> CONFIG_PM=y
> # CONFIG_PM_DEBUG is not set
> # CONFIG_SFI is not set
> 
> #
> # CPU Frequency scaling
> #
> CONFIG_CPU_FREQ=y
> CONFIG_CPU_FREQ_TABLE=m
> CONFIG_CPU_FREQ_STAT=m
> # CONFIG_CPU_FREQ_STAT_DETAILS is not set
> CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
> # CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
> # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
> # CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
> # CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
> CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
> CONFIG_CPU_FREQ_GOV_POWERSAVE=m
> CONFIG_CPU_FREQ_GOV_USERSPACE=m
> CONFIG_CPU_FREQ_GOV_ONDEMAND=m
> # CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
> 
> #
> # x86 CPU frequency scaling drivers
> #
> CONFIG_X86_P4_CLOCKMOD=m
> 
> #
> # shared options
> #
> CONFIG_X86_SPEEDSTEP_LIB=m
> # CONFIG_CPU_IDLE is not set
> # CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
> 
> #
> # Memory power savings
> #
> # CONFIG_I7300_IDLE is not set
> 
> #
> # Bus options (PCI etc.)
> #
> # CONFIG_PCI is not set
> # CONFIG_ISA_DMA_API is not set
> CONFIG_PCCARD=m
> CONFIG_PCMCIA=m
> CONFIG_PCMCIA_LOAD_CIS=y
> 
> #
> # PC-card bridges
> #
> 
> #
> # Executable file formats / Emulations
> #
> CONFIG_BINFMT_ELF=y
> CONFIG_COMPAT_BINFMT_ELF=y
> CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
> CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
> # CONFIG_HAVE_AOUT is not set
> CONFIG_BINFMT_MISC=m
> CONFIG_COREDUMP=y
> CONFIG_IA32_EMULATION=y
> CONFIG_IA32_AOUT=m
> # CONFIG_X86_X32 is not set
> CONFIG_COMPAT=y
> CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
> CONFIG_SYSVIPC_COMPAT=y
> CONFIG_KEYS_COMPAT=y
> CONFIG_HAVE_TEXT_POKE_SMP=y
> CONFIG_X86_DEV_DMA_OPS=y
> # CONFIG_NET is not set
> CONFIG_HAVE_BPF_JIT=y
> 
> #
> # Device Drivers
> #
> 
> #
> # Generic Driver Options
> #
> CONFIG_UEVENT_HELPER_PATH=""
> # CONFIG_DEVTMPFS is not set
> CONFIG_STANDALONE=y
> CONFIG_PREVENT_FIRMWARE_BUILD=y
> CONFIG_FW_LOADER=m
> # CONFIG_FIRMWARE_IN_KERNEL is not set
> CONFIG_EXTRA_FIRMWARE=""
> CONFIG_DEBUG_DRIVER=y
> CONFIG_DEBUG_DEVRES=y
> CONFIG_SYS_HYPERVISOR=y
> # CONFIG_GENERIC_CPU_DEVICES is not set
> CONFIG_REGMAP=y
> CONFIG_REGMAP_SPI=y
> CONFIG_REGMAP_IRQ=y
> # CONFIG_DMA_SHARED_BUFFER is not set
> 
> #
> # Bus devices
> #
> CONFIG_OMAP_OCP2SCP=m
> # CONFIG_MTD is not set
> CONFIG_PARPORT=m
> # CONFIG_PARPORT_PC is not set
> # CONFIG_PARPORT_GSC is not set
> # CONFIG_PARPORT_AX88796 is not set
> CONFIG_PARPORT_1284=y
> CONFIG_PARPORT_NOT_PC=y
> 
> #
> # Misc devices
> #
> # CONFIG_SENSORS_LIS3LV02D is not set
> CONFIG_AD525X_DPOT=m
> # CONFIG_AD525X_DPOT_SPI is not set
> CONFIG_ENCLOSURE_SERVICES=m
> # CONFIG_TI_DAC7512 is not set
> # CONFIG_VMWARE_BALLOON is not set
> CONFIG_BMP085=y
> CONFIG_BMP085_SPI=m
> # CONFIG_C2PORT is not set
> 
> #
> # EEPROM support
> #
> CONFIG_EEPROM_AT25=m
> # CONFIG_EEPROM_93CX6 is not set
> # CONFIG_EEPROM_93XX46 is not set
> 
> #
> # Texas Instruments shared transport line discipline
> #
> # CONFIG_SENSORS_LIS3_SPI is not set
> 
> #
> # Altera FPGA firmware download module
> #
> CONFIG_HAVE_IDE=y
> 
> #
> # SCSI device support
> #
> CONFIG_SCSI_MOD=y
> # CONFIG_SCSI_DMA is not set
> # CONFIG_SCSI_NETLINK is not set
> CONFIG_MACINTOSH_DRIVERS=y
> 
> #
> # Input device support
> #
> CONFIG_INPUT=m
> # CONFIG_INPUT_FF_MEMLESS is not set
> CONFIG_INPUT_POLLDEV=m
> CONFIG_INPUT_SPARSEKMAP=m
> CONFIG_INPUT_MATRIXKMAP=m
> 
> #
> # Userland interfaces
> #
> # CONFIG_INPUT_MOUSEDEV is not set
> CONFIG_INPUT_JOYDEV=m
> CONFIG_INPUT_EVDEV=m
> # CONFIG_INPUT_EVBUG is not set
> 
> #
> # Input Device Drivers
> #
> # CONFIG_INPUT_KEYBOARD is not set
> # CONFIG_INPUT_MOUSE is not set
> # CONFIG_INPUT_JOYSTICK is not set
> # CONFIG_INPUT_TABLET is not set
> # CONFIG_INPUT_TOUCHSCREEN is not set
> CONFIG_INPUT_MISC=y
> CONFIG_INPUT_AD714X=m
> CONFIG_INPUT_AD714X_SPI=m
> CONFIG_INPUT_MC13783_PWRBUTTON=m
> # CONFIG_INPUT_GPIO_TILT_POLLED is not set
> # CONFIG_INPUT_ATI_REMOTE2 is not set
> CONFIG_INPUT_KEYSPAN_REMOTE=m
> CONFIG_INPUT_POWERMATE=m
> # CONFIG_INPUT_YEALINK is not set
> # CONFIG_INPUT_CM109 is not set
> CONFIG_INPUT_UINPUT=m
> # CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
> CONFIG_INPUT_DA9052_ONKEY=m
> # CONFIG_INPUT_PCAP is not set
> CONFIG_INPUT_ADXL34X=m
> # CONFIG_INPUT_ADXL34X_SPI is not set
> # CONFIG_INPUT_CMA3000 is not set
> # CONFIG_INPUT_XEN_KBDDEV_FRONTEND is not set
> 
> #
> # Hardware I/O ports
> #
> CONFIG_SERIO=m
> CONFIG_SERIO_I8042=m
> CONFIG_SERIO_SERPORT=m
> CONFIG_SERIO_CT82C710=m
> CONFIG_SERIO_PARKBD=m
> # CONFIG_SERIO_LIBPS2 is not set
> # CONFIG_SERIO_RAW is not set
> CONFIG_SERIO_ALTERA_PS2=m
> # CONFIG_SERIO_PS2MULT is not set
> CONFIG_SERIO_ARC_PS2=m
> # CONFIG_GAMEPORT is not set
> 
> #
> # Character devices
> #
> # CONFIG_VT is not set
> CONFIG_UNIX98_PTYS=y
> # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
> # CONFIG_LEGACY_PTYS is not set
> # CONFIG_SERIAL_NONSTANDARD is not set
> # CONFIG_TRACE_SINK is not set
> CONFIG_DEVKMEM=y
> 
> #
> # Serial drivers
> #
> CONFIG_SERIAL_8250=m
> CONFIG_FIX_EARLYCON_MEM=y
> # CONFIG_SERIAL_8250_CS is not set
> CONFIG_SERIAL_8250_NR_UARTS=4
> CONFIG_SERIAL_8250_RUNTIME_UARTS=4
> # CONFIG_SERIAL_8250_EXTENDED is not set
> 
> #
> # Non-8250 serial port support
> #
> # CONFIG_SERIAL_MAX3100 is not set
> CONFIG_SERIAL_MAX310X=y
> CONFIG_SERIAL_CORE=y
> # CONFIG_SERIAL_SCCNXP is not set
> # CONFIG_SERIAL_TIMBERDALE is not set
> # CONFIG_SERIAL_ALTERA_JTAGUART is not set
> # CONFIG_SERIAL_ALTERA_UART is not set
> # CONFIG_SERIAL_IFX6X60 is not set
> # CONFIG_SERIAL_XILINX_PS_UART is not set
> CONFIG_SERIAL_ARC=m
> CONFIG_SERIAL_ARC_NR_PORTS=1
> CONFIG_TTY_PRINTK=y
> # CONFIG_PRINTER is not set
> # CONFIG_PPDEV is not set
> CONFIG_HVC_DRIVER=y
> # CONFIG_HVC_XEN is not set
> CONFIG_VIRTIO_CONSOLE=m
> CONFIG_IPMI_HANDLER=m
> CONFIG_IPMI_PANIC_EVENT=y
> CONFIG_IPMI_PANIC_STRING=y
> # CONFIG_IPMI_DEVICE_INTERFACE is not set
> CONFIG_IPMI_SI=m
> # CONFIG_IPMI_WATCHDOG is not set
> CONFIG_IPMI_POWEROFF=m
> CONFIG_HW_RANDOM=m
> # CONFIG_HW_RANDOM_TIMERIOMEM is not set
> # CONFIG_HW_RANDOM_VIA is not set
> # CONFIG_HW_RANDOM_VIRTIO is not set
> # CONFIG_NVRAM is not set
> # CONFIG_R3964 is not set
> 
> #
> # PCMCIA character devices
> #
> CONFIG_SYNCLINK_CS=m
> CONFIG_CARDMAN_4000=m
> # CONFIG_CARDMAN_4040 is not set
> # CONFIG_MWAVE is not set
> # CONFIG_HANGCHECK_TIMER is not set
> # CONFIG_TCG_TPM is not set
> CONFIG_TELCLOCK=m
> # CONFIG_I2C is not set
> CONFIG_SPI=y
> CONFIG_SPI_DEBUG=y
> CONFIG_SPI_MASTER=y
> 
> #
> # SPI Master Controller Drivers
> #
> # CONFIG_SPI_ALTERA is not set
> CONFIG_SPI_BITBANG=m
> CONFIG_SPI_BUTTERFLY=m
> # CONFIG_SPI_GPIO is not set
> CONFIG_SPI_LM70_LLP=m
> CONFIG_SPI_OC_TINY=m
> # CONFIG_SPI_PXA2XX_PCI is not set
> # CONFIG_SPI_XILINX is not set
> CONFIG_SPI_DESIGNWARE=m
> 
> #
> # SPI Protocol Masters
> #
> # CONFIG_SPI_SPIDEV is not set
> # CONFIG_SPI_TLE62X0 is not set
> CONFIG_HSI=m
> CONFIG_HSI_BOARDINFO=y
> 
> #
> # HSI clients
> #
> CONFIG_HSI_CHAR=m
> 
> #
> # PPS support
> #
> # CONFIG_PPS is not set
> 
> #
> # PPS generators support
> #
> 
> #
> # PTP clock support
> #
> 
> #
> # Enable Device Drivers -> PPS to see the PTP clock options.
> #
> CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
> CONFIG_GPIOLIB=y
> CONFIG_DEBUG_GPIO=y
> CONFIG_GPIO_SYSFS=y
> # CONFIG_GPIO_DA9052 is not set
> 
> #
> # Memory mapped GPIO drivers:
> #
> # CONFIG_GPIO_GENERIC_PLATFORM is not set
> CONFIG_GPIO_IT8761E=m
> 
> #
> # I2C GPIO expanders:
> #
> # CONFIG_GPIO_ARIZONA is not set
> 
> #
> # PCI GPIO expanders:
> #
> 
> #
> # SPI GPIO expanders:
> #
> # CONFIG_GPIO_MAX7301 is not set
> CONFIG_GPIO_MCP23S08=m
> # CONFIG_GPIO_MC33880 is not set
> CONFIG_GPIO_74X164=m
> 
> #
> # AC97 GPIO expanders:
> #
> 
> #
> # MODULbus GPIO expanders:
> #
> # CONFIG_W1 is not set
> # CONFIG_POWER_SUPPLY is not set
> CONFIG_POWER_AVS=y
> CONFIG_HWMON=m
> CONFIG_HWMON_VID=m
> CONFIG_HWMON_DEBUG_CHIP=y
> 
> #
> # Native drivers
> #
> # CONFIG_SENSORS_AD7314 is not set
> # CONFIG_SENSORS_ADCXX is not set
> CONFIG_SENSORS_DA9052_ADC=m
> CONFIG_SENSORS_F71805F=m
> CONFIG_SENSORS_F71882FG=m
> # CONFIG_SENSORS_GPIO_FAN is not set
> CONFIG_SENSORS_CORETEMP=m
> # CONFIG_SENSORS_IBMAEM is not set
> CONFIG_SENSORS_IBMPEX=m
> # CONFIG_SENSORS_IT87 is not set
> CONFIG_SENSORS_LM70=m
> CONFIG_SENSORS_MAX1111=m
> # CONFIG_SENSORS_MAX197 is not set
> # CONFIG_SENSORS_NTC_THERMISTOR is not set
> CONFIG_SENSORS_PC87360=m
> CONFIG_SENSORS_PC87427=m
> # CONFIG_SENSORS_SHT15 is not set
> CONFIG_SENSORS_SMSC47M1=m
> # CONFIG_SENSORS_SMSC47B397 is not set
> # CONFIG_SENSORS_SCH56XX_COMMON is not set
> CONFIG_SENSORS_ADS7871=m
> # CONFIG_SENSORS_VIA_CPUTEMP is not set
> CONFIG_SENSORS_VT1211=m
> CONFIG_SENSORS_W83627HF=m
> CONFIG_SENSORS_W83627EHF=m
> CONFIG_SENSORS_APPLESMC=m
> # CONFIG_SENSORS_MC13783_ADC is not set
> CONFIG_THERMAL=m
> CONFIG_THERMAL_HWMON=y
> CONFIG_CPU_THERMAL=y
> CONFIG_FAIR_SHARE=y
> CONFIG_STEP_WISE=y
> CONFIG_USER_SPACE=y
> CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
> # CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
> # CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set
> # CONFIG_WATCHDOG is not set
> CONFIG_SSB_POSSIBLE=y
> 
> #
> # Sonics Silicon Backplane
> #
> CONFIG_SSB=m
> CONFIG_SSB_PCMCIAHOST_POSSIBLE=y
> # CONFIG_SSB_PCMCIAHOST is not set
> CONFIG_SSB_SDIOHOST_POSSIBLE=y
> # CONFIG_SSB_SDIOHOST is not set
> CONFIG_SSB_SILENT=y
> CONFIG_BCMA_POSSIBLE=y
> 
> #
> # Broadcom specific AMBA
> #
> CONFIG_BCMA=m
> # CONFIG_BCMA_DRIVER_GMAC_CMN is not set
> # CONFIG_BCMA_DEBUG is not set
> 
> #
> # Multifunction device drivers
> #
> CONFIG_MFD_CORE=y
> # CONFIG_MFD_SM501 is not set
> # CONFIG_HTC_PASIC3 is not set
> # CONFIG_MFD_TPS65912_SPI is not set
> # CONFIG_MFD_STMPE is not set
> # CONFIG_MFD_TMIO is not set
> CONFIG_PMIC_DA9052=y
> CONFIG_MFD_DA9052_SPI=y
> CONFIG_MFD_ARIZONA=y
> CONFIG_MFD_ARIZONA_SPI=m
> CONFIG_MFD_WM5102=y
> CONFIG_MFD_WM5110=y
> # CONFIG_MFD_WM831X_SPI is not set
> CONFIG_MFD_MC13783=m
> CONFIG_MFD_MC13XXX=m
> CONFIG_MFD_MC13XXX_SPI=m
> # CONFIG_ABX500_CORE is not set
> CONFIG_EZX_PCAP=y
> # CONFIG_REGULATOR is not set
> CONFIG_MEDIA_SUPPORT=m
> 
> #
> # Multimedia core support
> #
> # CONFIG_MEDIA_CAMERA_SUPPORT is not set
> # CONFIG_MEDIA_ANALOG_TV_SUPPORT is not set
> # CONFIG_MEDIA_DIGITAL_TV_SUPPORT is not set
> CONFIG_MEDIA_RADIO_SUPPORT=y
> # CONFIG_MEDIA_RC_SUPPORT is not set
> CONFIG_VIDEO_DEV=m
> CONFIG_VIDEO_V4L2=m
> # CONFIG_VIDEO_ADV_DEBUG is not set
> # CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
> 
> #
> # Media drivers
> #
> CONFIG_MEDIA_USB_SUPPORT=y
> 
> #
> # Supported MMC/SDIO adapters
> #
> CONFIG_RADIO_ADAPTERS=y
> # CONFIG_RADIO_SI470X is not set
> # CONFIG_USB_MR800 is not set
> CONFIG_USB_DSBR=m
> # CONFIG_RADIO_SHARK2 is not set
> CONFIG_USB_KEENE=m
> 
> #
> # Texas Instruments WL128x FM driver (ST based)
> #
> 
> #
> # Media ancillary drivers (tuners, sensors, i2c, frontends)
> #
> 
> #
> # Encoders, decoders, sensors and other helper chips
> #
> 
> #
> # Audio decoders, processors and mixers
> #
> 
> #
> # RDS decoders
> #
> 
> #
> # Video decoders
> #
> 
> #
> # Video and audio decoders
> #
> 
> #
> # MPEG video encoders
> #
> # CONFIG_VIDEO_CX2341X is not set
> 
> #
> # Video encoders
> #
> 
> #
> # Camera sensor devices
> #
> 
> #
> # Flash devices
> #
> 
> #
> # Video improvement chips
> #
> 
> #
> # Miscelaneous helper chips
> #
> 
> #
> # Sensors used on soc_camera driver
> #
> CONFIG_MEDIA_ATTACH=y
> 
> #
> # Customize TV tuners
> #
> 
> #
> # Customise DVB Frontends
> #
> 
> #
> # Tools to develop new frontends
> #
> CONFIG_DVB_DUMMY_FE=m
> 
> #
> # Graphics support
> #
> # CONFIG_DRM is not set
> # CONFIG_VGASTATE is not set
> # CONFIG_VIDEO_OUTPUT_CONTROL is not set
> CONFIG_FB=m
> # CONFIG_FIRMWARE_EDID is not set
> # CONFIG_FB_DDC is not set
> # CONFIG_FB_BOOT_VESA_SUPPORT is not set
> CONFIG_FB_CFB_FILLRECT=m
> CONFIG_FB_CFB_COPYAREA=m
> CONFIG_FB_CFB_IMAGEBLIT=m
> # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
> CONFIG_FB_SYS_FILLRECT=m
> CONFIG_FB_SYS_COPYAREA=m
> CONFIG_FB_SYS_IMAGEBLIT=m
> # CONFIG_FB_FOREIGN_ENDIAN is not set
> CONFIG_FB_SYS_FOPS=m
> # CONFIG_FB_WMT_GE_ROPS is not set
> CONFIG_FB_DEFERRED_IO=y
> CONFIG_FB_HECUBA=m
> # CONFIG_FB_SVGALIB is not set
> # CONFIG_FB_MACMODES is not set
> # CONFIG_FB_BACKLIGHT is not set
> CONFIG_FB_MODE_HELPERS=y
> # CONFIG_FB_TILEBLITTING is not set
> 
> #
> # Frame buffer hardware drivers
> #
> CONFIG_FB_ARC=m
> # CONFIG_FB_VGA16 is not set
> CONFIG_FB_N411=m
> CONFIG_FB_HGA=m
> CONFIG_FB_S1D13XXX=m
> CONFIG_FB_TMIO=m
> CONFIG_FB_TMIO_ACCELL=y
> CONFIG_FB_SMSCUFX=m
> # CONFIG_FB_UDL is not set
> # CONFIG_FB_VIRTUAL is not set
> # CONFIG_XEN_FBDEV_FRONTEND is not set
> CONFIG_FB_METRONOME=m
> # CONFIG_FB_BROADSHEET is not set
> CONFIG_FB_AUO_K190X=m
> CONFIG_FB_AUO_K1900=m
> CONFIG_FB_AUO_K1901=m
> CONFIG_EXYNOS_VIDEO=y
> # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
> CONFIG_LOGO=y
> CONFIG_LOGO_LINUX_MONO=y
> CONFIG_LOGO_LINUX_VGA16=y
> # CONFIG_LOGO_LINUX_CLUT224 is not set
> # CONFIG_SOUND is not set
> 
> #
> # HID support
> #
> CONFIG_HID=m
> # CONFIG_HIDRAW is not set
> # CONFIG_UHID is not set
> # CONFIG_HID_GENERIC is not set
> 
> #
> # Special HID drivers
> #
> 
> #
> # USB HID support
> #
> # CONFIG_USB_HID is not set
> CONFIG_HID_PID=y
> 
> #
> # USB HID Boot Protocol drivers
> #
> # CONFIG_USB_KBD is not set
> CONFIG_USB_MOUSE=m
> # CONFIG_USB_ARCH_HAS_OHCI is not set
> # CONFIG_USB_ARCH_HAS_EHCI is not set
> # CONFIG_USB_ARCH_HAS_XHCI is not set
> CONFIG_USB_SUPPORT=y
> CONFIG_USB_COMMON=m
> CONFIG_USB_ARCH_HAS_HCD=y
> CONFIG_USB=m
> # CONFIG_USB_DEBUG is not set
> CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
> 
> #
> # Miscellaneous USB options
> #
> # CONFIG_USB_DYNAMIC_MINORS is not set
> # CONFIG_USB_SUSPEND is not set
> CONFIG_USB_OTG_WHITELIST=y
> CONFIG_USB_OTG_BLACKLIST_HUB=y
> CONFIG_USB_DWC3=m
> CONFIG_USB_DWC3_DEBUG=y
> # CONFIG_USB_DWC3_VERBOSE is not set
> # CONFIG_USB_MON is not set
> # CONFIG_USB_WUSB_CBAF is not set
> 
> #
> # USB Host Controller Drivers
> #
> CONFIG_USB_C67X00_HCD=m
> CONFIG_USB_OXU210HP_HCD=m
> # CONFIG_USB_ISP116X_HCD is not set
> CONFIG_USB_ISP1760_HCD=m
> CONFIG_USB_ISP1362_HCD=m
> CONFIG_USB_U132_HCD=m
> # CONFIG_USB_SL811_HCD is not set
> CONFIG_USB_R8A66597_HCD=m
> # CONFIG_USB_RENESAS_USBHS_HCD is not set
> CONFIG_USB_HCD_BCMA=m
> CONFIG_USB_HCD_SSB=m
> CONFIG_USB_MUSB_HDRC=m
> # CONFIG_USB_MUSB_TUSB6010 is not set
> CONFIG_MUSB_PIO_ONLY=y
> CONFIG_USB_CHIPIDEA=m
> CONFIG_USB_CHIPIDEA_UDC=y
> # CONFIG_USB_CHIPIDEA_HOST is not set
> CONFIG_USB_CHIPIDEA_DEBUG=y
> CONFIG_USB_RENESAS_USBHS=m
> 
> #
> # USB Device Class drivers
> #
> # CONFIG_USB_ACM is not set
> CONFIG_USB_PRINTER=m
> # CONFIG_USB_WDM is not set
> # CONFIG_USB_TMC is not set
> 
> #
> # NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
> #
> 
> #
> # also be needed; see USB_STORAGE Help for more info
> #
> 
> #
> # USB Imaging devices
> #
> CONFIG_USB_MDC800=m
> 
> #
> # USB port drivers
> #
> CONFIG_USB_USS720=m
> # CONFIG_USB_SERIAL is not set
> 
> #
> # USB Miscellaneous drivers
> #
> CONFIG_USB_EMI62=m
> CONFIG_USB_EMI26=m
> # CONFIG_USB_ADUTUX is not set
> # CONFIG_USB_SEVSEG is not set
> CONFIG_USB_RIO500=m
> # CONFIG_USB_LEGOTOWER is not set
> CONFIG_USB_LCD=m
> # CONFIG_USB_LED is not set
> CONFIG_USB_CYPRESS_CY7C63=m
> # CONFIG_USB_CYTHERM is not set
> # CONFIG_USB_IDMOUSE is not set
> CONFIG_USB_FTDI_ELAN=m
> # CONFIG_USB_APPLEDISPLAY is not set
> CONFIG_USB_SISUSBVGA=m
> CONFIG_USB_LD=m
> # CONFIG_USB_TRANCEVIBRATOR is not set
> CONFIG_USB_IOWARRIOR=m
> # CONFIG_USB_TEST is not set
> CONFIG_USB_ISIGHTFW=m
> # CONFIG_USB_YUREX is not set
> CONFIG_USB_EZUSB_FX2=m
> 
> #
> # USB Physical Layer drivers
> #
> # CONFIG_OMAP_USB2 is not set
> CONFIG_USB_GADGET=m
> CONFIG_USB_GADGET_DEBUG=y
> # CONFIG_USB_GADGET_DEBUG_FS is not set
> CONFIG_USB_GADGET_VBUS_DRAW=2
> CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
> 
> #
> # USB Peripheral Controller
> #
> # CONFIG_USB_R8A66597 is not set
> CONFIG_USB_RENESAS_USBHS_UDC=m
> # CONFIG_USB_MV_UDC is not set
> CONFIG_USB_GADGET_MUSB_HDRC=m
> CONFIG_USB_M66592=m
> # CONFIG_USB_NET2272 is not set
> CONFIG_USB_DUMMY_HCD=m
> CONFIG_USB_LIBCOMPOSITE=m
> # CONFIG_USB_ZERO is not set
> # CONFIG_USB_GADGETFS is not set
> CONFIG_USB_FUNCTIONFS=m
> CONFIG_USB_FUNCTIONFS_GENERIC=y
> CONFIG_USB_G_SERIAL=m
> # CONFIG_USB_G_PRINTER is not set
> CONFIG_USB_G_HID=m
> CONFIG_USB_G_DBGP=m
> CONFIG_USB_G_DBGP_PRINTK=y
> # CONFIG_USB_G_DBGP_SERIAL is not set
> CONFIG_USB_G_WEBCAM=m
> 
> #
> # OTG and related infrastructure
> #
> CONFIG_USB_OTG_UTILS=y
> CONFIG_USB_GPIO_VBUS=m
> CONFIG_NOP_USB_XCEIV=m
> CONFIG_MMC=m
> CONFIG_MMC_DEBUG=y
> # CONFIG_MMC_UNSAFE_RESUME is not set
> CONFIG_MMC_CLKGATE=y
> 
> #
> # MMC/SD/SDIO Card Drivers
> #
> CONFIG_SDIO_UART=m
> CONFIG_MMC_TEST=m
> 
> #
> # MMC/SD/SDIO Host Controller Drivers
> #
> # CONFIG_MMC_SDHCI is not set
> CONFIG_MMC_SPI=m
> # CONFIG_MMC_VUB300 is not set
> CONFIG_MMC_USHC=m
> CONFIG_MEMSTICK=m
> CONFIG_MEMSTICK_DEBUG=y
> 
> #
> # MemoryStick drivers
> #
> # CONFIG_MEMSTICK_UNSAFE_RESUME is not set
> 
> #
> # MemoryStick Host Controller Drivers
> #
> CONFIG_NEW_LEDS=y
> CONFIG_LEDS_CLASS=m
> 
> #
> # LED drivers
> #
> CONFIG_LEDS_GPIO=m
> # CONFIG_LEDS_DA9052 is not set
> # CONFIG_LEDS_DAC124S085 is not set
> # CONFIG_LEDS_LT3593 is not set
> CONFIG_LEDS_MC13783=m
> CONFIG_LEDS_OT200=m
> CONFIG_LEDS_TRIGGERS=y
> 
> #
> # LED Triggers
> #
> CONFIG_LEDS_TRIGGER_TIMER=m
> CONFIG_LEDS_TRIGGER_ONESHOT=m
> CONFIG_LEDS_TRIGGER_HEARTBEAT=m
> # CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
> # CONFIG_LEDS_TRIGGER_CPU is not set
> # CONFIG_LEDS_TRIGGER_GPIO is not set
> CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
> 
> #
> # iptables trigger is under Netfilter config (LED target)
> #
> # CONFIG_LEDS_TRIGGER_TRANSIENT is not set
> CONFIG_ACCESSIBILITY=y
> CONFIG_EDAC=y
> 
> #
> # Reporting subsystems
> #
> # CONFIG_EDAC_LEGACY_SYSFS is not set
> CONFIG_EDAC_DEBUG=y
> CONFIG_EDAC_MM_EDAC=m
> CONFIG_RTC_LIB=y
> CONFIG_RTC_CLASS=y
> CONFIG_RTC_HCTOSYS=y
> CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
> # CONFIG_RTC_DEBUG is not set
> 
> #
> # RTC interfaces
> #
> CONFIG_RTC_INTF_SYSFS=y
> CONFIG_RTC_INTF_DEV=y
> CONFIG_RTC_INTF_DEV_UIE_EMUL=y
> CONFIG_RTC_DRV_TEST=m
> 
> #
> # SPI RTC drivers
> #
> CONFIG_RTC_DRV_M41T93=m
> # CONFIG_RTC_DRV_M41T94 is not set
> # CONFIG_RTC_DRV_DS1305 is not set
> CONFIG_RTC_DRV_DS1390=m
> CONFIG_RTC_DRV_MAX6902=m
> # CONFIG_RTC_DRV_R9701 is not set
> CONFIG_RTC_DRV_RS5C348=m
> # CONFIG_RTC_DRV_DS3234 is not set
> CONFIG_RTC_DRV_PCF2123=m
> 
> #
> # Platform RTC drivers
> #
> # CONFIG_RTC_DRV_CMOS is not set
> CONFIG_RTC_DRV_DS1286=m
> # CONFIG_RTC_DRV_DS1511 is not set
> # CONFIG_RTC_DRV_DS1553 is not set
> # CONFIG_RTC_DRV_DS1742 is not set
> # CONFIG_RTC_DRV_DA9052 is not set
> # CONFIG_RTC_DRV_STK17TA8 is not set
> # CONFIG_RTC_DRV_M48T86 is not set
> CONFIG_RTC_DRV_M48T35=m
> CONFIG_RTC_DRV_M48T59=m
> # CONFIG_RTC_DRV_MSM6242 is not set
> CONFIG_RTC_DRV_BQ4802=m
> CONFIG_RTC_DRV_RP5C01=m
> CONFIG_RTC_DRV_V3020=m
> # CONFIG_RTC_DRV_DS2404 is not set
> 
> #
> # on-CPU RTC drivers
> #
> CONFIG_RTC_DRV_PCAP=m
> CONFIG_RTC_DRV_MC13XXX=m
> # CONFIG_DMADEVICES is not set
> # CONFIG_AUXDISPLAY is not set
> # CONFIG_UIO is not set
> CONFIG_VIRTIO=m
> 
> #
> # Virtio drivers
> #
> CONFIG_VIRTIO_BALLOON=m
> # CONFIG_VIRTIO_MMIO is not set
> 
> #
> # Microsoft Hyper-V guest support
> #
> 
> #
> # Xen driver support
> #
> # CONFIG_XEN_BALLOON is not set
> # CONFIG_XEN_DEV_EVTCHN is not set
> # CONFIG_XENFS is not set
> CONFIG_XEN_SYS_HYPERVISOR=y
> CONFIG_XEN_GNTDEV=m
> CONFIG_XEN_GRANT_DEV_ALLOC=m
> CONFIG_XEN_TMEM=y
> CONFIG_XEN_PRIVCMD=m
> CONFIG_XEN_HAVE_PVMMU=y
> CONFIG_STAGING=y
> CONFIG_ECHO=m
> CONFIG_COMEDI=m
> # CONFIG_COMEDI_DEBUG is not set
> CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB=2048
> CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB=20480
> # CONFIG_COMEDI_MISC_DRIVERS is not set
> CONFIG_COMEDI_PCMCIA_DRIVERS=y
> CONFIG_COMEDI_CB_DAS16_CS=m
> CONFIG_COMEDI_DAS08_CS=m
> # CONFIG_COMEDI_NI_DAQ_700_CS is not set
> CONFIG_COMEDI_NI_DAQ_DIO24_CS=m
> # CONFIG_COMEDI_NI_MIO_CS is not set
> CONFIG_COMEDI_QUATECH_DAQP_CS=m
> CONFIG_COMEDI_USB_DRIVERS=y
> # CONFIG_COMEDI_DT9812 is not set
> CONFIG_COMEDI_USBDUX=m
> # CONFIG_COMEDI_USBDUXFAST is not set
> CONFIG_COMEDI_USBDUXSIGMA=m
> CONFIG_COMEDI_VMK80XX=m
> CONFIG_COMEDI_8255=m
> CONFIG_COMEDI_FC=m
> CONFIG_COMEDI_DAS08=m
> # CONFIG_ASUS_OLED is not set
> CONFIG_PANEL=m
> CONFIG_PANEL_PARPORT=0
> CONFIG_PANEL_PROFILE=5
> # CONFIG_PANEL_CHANGE_MESSAGE is not set
> CONFIG_TRANZPORT=m
> # CONFIG_ZSMALLOC is not set
> # CONFIG_FT1000 is not set
> 
> #
> # Speakup console speech
> #
> CONFIG_STAGING_MEDIA=y
> 
> #
> # Android
> #
> CONFIG_ANDROID=y
> CONFIG_ANDROID_BINDER_IPC=y
> # CONFIG_ANDROID_LOGGER is not set
> # CONFIG_ANDROID_TIMED_OUTPUT is not set
> # CONFIG_ANDROID_LOW_MEMORY_KILLER is not set
> CONFIG_ANDROID_INTF_ALARM_DEV=y
> # CONFIG_IPACK_BUS is not set
> # CONFIG_CED1401 is not set
> # CONFIG_DGRP is not set
> # CONFIG_X86_PLATFORM_DEVICES is not set
> 
> #
> # Hardware Spinlock drivers
> #
> CONFIG_CLKEVT_I8253=y
> CONFIG_CLKBLD_I8253=y
> CONFIG_IOMMU_SUPPORT=y
> 
> #
> # Remoteproc drivers (EXPERIMENTAL)
> #
> CONFIG_REMOTEPROC=m
> CONFIG_STE_MODEM_RPROC=m
> 
> #
> # Rpmsg drivers
> #
> # CONFIG_VIRT_DRIVERS is not set
> CONFIG_PM_DEVFREQ=y
> 
> #
> # DEVFREQ Governors
> #
> CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y
> # CONFIG_DEVFREQ_GOV_PERFORMANCE is not set
> # CONFIG_DEVFREQ_GOV_POWERSAVE is not set
> # CONFIG_DEVFREQ_GOV_USERSPACE is not set
> 
> #
> # DEVFREQ Drivers
> #
> CONFIG_EXTCON=m
> 
> #
> # Extcon Device Drivers
> #
> CONFIG_EXTCON_GPIO=m
> # CONFIG_EXTCON_ARIZONA is not set
> # CONFIG_MEMORY is not set
> # CONFIG_IIO is not set
> CONFIG_PWM=y
> 
> #
> # Firmware Drivers
> #
> CONFIG_EDD=m
> CONFIG_EDD_OFF=y
> # CONFIG_FIRMWARE_MEMMAP is not set
> CONFIG_DELL_RBU=m
> CONFIG_DCDBAS=m
> CONFIG_ISCSI_IBFT_FIND=y
> CONFIG_GOOGLE_FIRMWARE=y
> 
> #
> # Google Firmware Drivers
> #
> 
> #
> # File systems
> #
> CONFIG_DCACHE_WORD_ACCESS=y
> # CONFIG_FS_POSIX_ACL is not set
> CONFIG_EXPORTFS=y
> # CONFIG_FILE_LOCKING is not set
> CONFIG_FSNOTIFY=y
> CONFIG_DNOTIFY=y
> CONFIG_INOTIFY_USER=y
> # CONFIG_FANOTIFY is not set
> CONFIG_QUOTA=y
> # CONFIG_PRINT_QUOTA_WARNING is not set
> # CONFIG_QUOTA_DEBUG is not set
> # CONFIG_QFMT_V1 is not set
> # CONFIG_QFMT_V2 is not set
> CONFIG_QUOTACTL=y
> CONFIG_QUOTACTL_COMPAT=y
> # CONFIG_AUTOFS4_FS is not set
> CONFIG_FUSE_FS=m
> # CONFIG_CUSE is not set
> 
> #
> # Caches
> #
> # CONFIG_FSCACHE is not set
> 
> #
> # Pseudo filesystems
> #
> # CONFIG_PROC_FS is not set
> CONFIG_SYSFS=y
> # CONFIG_HUGETLBFS is not set
> # CONFIG_HUGETLB_PAGE is not set
> CONFIG_CONFIGFS_FS=m
> # CONFIG_MISC_FILESYSTEMS is not set
> CONFIG_NLS=m
> CONFIG_NLS_DEFAULT="iso8859-1"
> # CONFIG_NLS_CODEPAGE_437 is not set
> CONFIG_NLS_CODEPAGE_737=m
> # CONFIG_NLS_CODEPAGE_775 is not set
> # CONFIG_NLS_CODEPAGE_850 is not set
> CONFIG_NLS_CODEPAGE_852=m
> CONFIG_NLS_CODEPAGE_855=m
> CONFIG_NLS_CODEPAGE_857=m
> CONFIG_NLS_CODEPAGE_860=m
> # CONFIG_NLS_CODEPAGE_861 is not set
> CONFIG_NLS_CODEPAGE_862=m
> CONFIG_NLS_CODEPAGE_863=m
> # CONFIG_NLS_CODEPAGE_864 is not set
> CONFIG_NLS_CODEPAGE_865=m
> # CONFIG_NLS_CODEPAGE_866 is not set
> # CONFIG_NLS_CODEPAGE_869 is not set
> CONFIG_NLS_CODEPAGE_936=m
> # CONFIG_NLS_CODEPAGE_950 is not set
> # CONFIG_NLS_CODEPAGE_932 is not set
> CONFIG_NLS_CODEPAGE_949=m
> # CONFIG_NLS_CODEPAGE_874 is not set
> # CONFIG_NLS_ISO8859_8 is not set
> # CONFIG_NLS_CODEPAGE_1250 is not set
> CONFIG_NLS_CODEPAGE_1251=m
> CONFIG_NLS_ASCII=m
> CONFIG_NLS_ISO8859_1=m
> # CONFIG_NLS_ISO8859_2 is not set
> # CONFIG_NLS_ISO8859_3 is not set
> CONFIG_NLS_ISO8859_4=m
> # CONFIG_NLS_ISO8859_5 is not set
> # CONFIG_NLS_ISO8859_6 is not set
> # CONFIG_NLS_ISO8859_7 is not set
> CONFIG_NLS_ISO8859_9=m
> CONFIG_NLS_ISO8859_13=m
> CONFIG_NLS_ISO8859_14=m
> CONFIG_NLS_ISO8859_15=m
> CONFIG_NLS_KOI8_R=m
> # CONFIG_NLS_KOI8_U is not set
> # CONFIG_NLS_MAC_ROMAN is not set
> CONFIG_NLS_MAC_CELTIC=m
> CONFIG_NLS_MAC_CENTEURO=m
> # CONFIG_NLS_MAC_CROATIAN is not set
> # CONFIG_NLS_MAC_CYRILLIC is not set
> # CONFIG_NLS_MAC_GAELIC is not set
> CONFIG_NLS_MAC_GREEK=m
> CONFIG_NLS_MAC_ICELAND=m
> # CONFIG_NLS_MAC_INUIT is not set
> # CONFIG_NLS_MAC_ROMANIAN is not set
> # CONFIG_NLS_MAC_TURKISH is not set
> # CONFIG_NLS_UTF8 is not set
> 
> #
> # Kernel hacking
> #
> CONFIG_TRACE_IRQFLAGS_SUPPORT=y
> CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
> CONFIG_ENABLE_WARN_DEPRECATED=y
> CONFIG_ENABLE_MUST_CHECK=y
> CONFIG_FRAME_WARN=2048
> CONFIG_MAGIC_SYSRQ=y
> # CONFIG_STRIP_ASM_SYMS is not set
> CONFIG_READABLE_ASM=y
> CONFIG_UNUSED_SYMBOLS=y
> CONFIG_DEBUG_FS=y
> # CONFIG_HEADERS_CHECK is not set
> # CONFIG_DEBUG_SECTION_MISMATCH is not set
> CONFIG_DEBUG_KERNEL=y
> # CONFIG_DEBUG_SHIRQ is not set
> CONFIG_LOCKUP_DETECTOR=y
> CONFIG_HARDLOCKUP_DETECTOR=y
> CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y
> CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=1
> # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
> CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
> # CONFIG_PANIC_ON_OOPS is not set
> CONFIG_PANIC_ON_OOPS_VALUE=0
> # CONFIG_DETECT_HUNG_TASK is not set
> CONFIG_DEBUG_OBJECTS=y
> # CONFIG_DEBUG_OBJECTS_SELFTEST is not set
> CONFIG_DEBUG_OBJECTS_FREE=y
> # CONFIG_DEBUG_OBJECTS_TIMERS is not set
> # CONFIG_DEBUG_OBJECTS_WORK is not set
> # CONFIG_DEBUG_OBJECTS_RCU_HEAD is not set
> # CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER is not set
> CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
> # CONFIG_SLUB_STATS is not set
> CONFIG_HAVE_DEBUG_KMEMLEAK=y
> # CONFIG_DEBUG_KMEMLEAK is not set
> # CONFIG_DEBUG_PREEMPT is not set
> CONFIG_DEBUG_RT_MUTEXES=y
> CONFIG_DEBUG_PI_LIST=y
> CONFIG_RT_MUTEX_TESTER=y
> CONFIG_DEBUG_SPINLOCK=y
> CONFIG_DEBUG_MUTEXES=y
> CONFIG_DEBUG_LOCK_ALLOC=y
> CONFIG_PROVE_LOCKING=y
> CONFIG_PROVE_RCU=y
> # CONFIG_PROVE_RCU_REPEATEDLY is not set
> CONFIG_PROVE_RCU_DELAY=y
> CONFIG_SPARSE_RCU_POINTER=y
> CONFIG_LOCKDEP=y
> CONFIG_LOCK_STAT=y
> CONFIG_DEBUG_LOCKDEP=y
> CONFIG_TRACE_IRQFLAGS=y
> CONFIG_DEBUG_ATOMIC_SLEEP=y
> CONFIG_DEBUG_LOCKING_API_SELFTESTS=y
> CONFIG_STACKTRACE=y
> # CONFIG_DEBUG_STACK_USAGE is not set
> CONFIG_DEBUG_KOBJECT=y
> # CONFIG_DEBUG_BUGVERBOSE is not set
> # CONFIG_DEBUG_INFO is not set
> # CONFIG_DEBUG_VM is not set
> CONFIG_DEBUG_VIRTUAL=y
> CONFIG_DEBUG_WRITECOUNT=y
> # CONFIG_DEBUG_MEMORY_INIT is not set
> CONFIG_DEBUG_LIST=y
> CONFIG_TEST_LIST_SORT=y
> # CONFIG_DEBUG_SG is not set
> # CONFIG_DEBUG_NOTIFIERS is not set
> CONFIG_DEBUG_CREDENTIALS=y
> CONFIG_ARCH_WANT_FRAME_POINTERS=y
> CONFIG_FRAME_POINTER=y
> # CONFIG_RCU_TORTURE_TEST is not set
> # CONFIG_RCU_TRACE is not set
> CONFIG_KPROBES_SANITY_TEST=y
> CONFIG_BACKTRACE_SELF_TEST=m
> CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
> CONFIG_NOTIFIER_ERROR_INJECTION=m
> # CONFIG_PM_NOTIFIER_ERROR_INJECT is not set
> # CONFIG_FAULT_INJECTION is not set
> CONFIG_USER_STACKTRACE_SUPPORT=y
> CONFIG_HAVE_FUNCTION_TRACER=y
> CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
> CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
> CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
> CONFIG_HAVE_DYNAMIC_FTRACE=y
> CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
> CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
> CONFIG_HAVE_FENTRY=y
> CONFIG_HAVE_C_RECORDMCOUNT=y
> CONFIG_TRACING_SUPPORT=y
> # CONFIG_FTRACE is not set
> # CONFIG_RBTREE_TEST is not set
> # CONFIG_INTERVAL_TREE_TEST is not set
> # CONFIG_DMA_API_DEBUG is not set
> # CONFIG_ATOMIC64_SELFTEST is not set
> # CONFIG_SAMPLES is not set
> CONFIG_HAVE_ARCH_KGDB=y
> # CONFIG_KGDB is not set
> CONFIG_HAVE_ARCH_KMEMCHECK=y
> CONFIG_KMEMCHECK=y
> # CONFIG_KMEMCHECK_DISABLED_BY_DEFAULT is not set
> # CONFIG_KMEMCHECK_ENABLED_BY_DEFAULT is not set
> CONFIG_KMEMCHECK_ONESHOT_BY_DEFAULT=y
> CONFIG_KMEMCHECK_QUEUE_SIZE=64
> CONFIG_KMEMCHECK_SHADOW_COPY_SHIFT=5
> CONFIG_KMEMCHECK_PARTIAL_OK=y
> CONFIG_KMEMCHECK_BITOPS_OK=y
> # CONFIG_TEST_KSTRTOX is not set
> # CONFIG_STRICT_DEVMEM is not set
> CONFIG_X86_VERBOSE_BOOTUP=y
> CONFIG_EARLY_PRINTK=y
> CONFIG_DEBUG_STACKOVERFLOW=y
> CONFIG_X86_PTDUMP=y
> CONFIG_DEBUG_RODATA=y
> # CONFIG_DEBUG_RODATA_TEST is not set
> CONFIG_DEBUG_SET_MODULE_RONX=y
> # CONFIG_DEBUG_NX_TEST is not set
> # CONFIG_DEBUG_TLBFLUSH is not set
> CONFIG_IOMMU_STRESS=y
> CONFIG_HAVE_MMIOTRACE_SUPPORT=y
> # CONFIG_X86_DECODER_SELFTEST is not set
> CONFIG_IO_DELAY_TYPE_0X80=0
> CONFIG_IO_DELAY_TYPE_0XED=1
> CONFIG_IO_DELAY_TYPE_UDELAY=2
> CONFIG_IO_DELAY_TYPE_NONE=3
> # CONFIG_IO_DELAY_0X80 is not set
> # CONFIG_IO_DELAY_0XED is not set
> # CONFIG_IO_DELAY_UDELAY is not set
> CONFIG_IO_DELAY_NONE=y
> CONFIG_DEFAULT_IO_DELAY_TYPE=3
> # CONFIG_DEBUG_BOOT_PARAMS is not set
> CONFIG_CPA_DEBUG=y
> # CONFIG_OPTIMIZE_INLINING is not set
> # CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
> # CONFIG_DEBUG_NMI_SELFTEST is not set
> 
> #
> # Security options
> #
> CONFIG_KEYS=y
> # CONFIG_ENCRYPTED_KEYS is not set
> CONFIG_KEYS_DEBUG_PROC_KEYS=y
> CONFIG_SECURITY_DMESG_RESTRICT=y
> CONFIG_SECURITY=y
> CONFIG_SECURITYFS=y
> CONFIG_SECURITY_NETWORK=y
> CONFIG_SECURITY_PATH=y
> CONFIG_SECURITY_YAMA=y
> # CONFIG_SECURITY_YAMA_STACKED is not set
> # CONFIG_IMA is not set
> # CONFIG_EVM is not set
> CONFIG_DEFAULT_SECURITY_YAMA=y
> # CONFIG_DEFAULT_SECURITY_DAC is not set
> CONFIG_DEFAULT_SECURITY="yama"
> CONFIG_CRYPTO=y
> 
> #
> # Crypto core or helper
> #
> # CONFIG_CRYPTO_FIPS is not set
> CONFIG_CRYPTO_ALGAPI=y
> CONFIG_CRYPTO_ALGAPI2=y
> CONFIG_CRYPTO_AEAD=m
> CONFIG_CRYPTO_AEAD2=y
> CONFIG_CRYPTO_BLKCIPHER=m
> CONFIG_CRYPTO_BLKCIPHER2=y
> CONFIG_CRYPTO_HASH=y
> CONFIG_CRYPTO_HASH2=y
> CONFIG_CRYPTO_RNG=m
> CONFIG_CRYPTO_RNG2=y
> CONFIG_CRYPTO_PCOMP=m
> CONFIG_CRYPTO_PCOMP2=y
> CONFIG_CRYPTO_MANAGER=m
> CONFIG_CRYPTO_MANAGER2=y
> # CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
> CONFIG_CRYPTO_GF128MUL=m
> CONFIG_CRYPTO_NULL=m
> CONFIG_CRYPTO_WORKQUEUE=y
> CONFIG_CRYPTO_CRYPTD=m
> CONFIG_CRYPTO_AUTHENC=m
> CONFIG_CRYPTO_TEST=m
> CONFIG_CRYPTO_ABLK_HELPER_X86=m
> CONFIG_CRYPTO_GLUE_HELPER_X86=m
> 
> #
> # Authenticated Encryption with Associated Data
> #
> # CONFIG_CRYPTO_CCM is not set
> # CONFIG_CRYPTO_GCM is not set
> CONFIG_CRYPTO_SEQIV=m
> 
> #
> # Block modes
> #
> CONFIG_CRYPTO_CBC=m
> CONFIG_CRYPTO_CTR=m
> CONFIG_CRYPTO_CTS=m
> CONFIG_CRYPTO_ECB=m
> CONFIG_CRYPTO_LRW=m
> CONFIG_CRYPTO_PCBC=m
> CONFIG_CRYPTO_XTS=m
> 
> #
> # Hash modes
> #
> # CONFIG_CRYPTO_HMAC is not set
> # CONFIG_CRYPTO_XCBC is not set
> # CONFIG_CRYPTO_VMAC is not set
> 
> #
> # Digest
> #
> # CONFIG_CRYPTO_CRC32C is not set
> CONFIG_CRYPTO_CRC32C_X86_64=y
> CONFIG_CRYPTO_CRC32C_INTEL=m
> # CONFIG_CRYPTO_GHASH is not set
> # CONFIG_CRYPTO_MD4 is not set
> # CONFIG_CRYPTO_MD5 is not set
> # CONFIG_CRYPTO_MICHAEL_MIC is not set
> # CONFIG_CRYPTO_RMD128 is not set
> # CONFIG_CRYPTO_RMD160 is not set
> CONFIG_CRYPTO_RMD256=m
> CONFIG_CRYPTO_RMD320=m
> # CONFIG_CRYPTO_SHA1 is not set
> # CONFIG_CRYPTO_SHA1_SSSE3 is not set
> CONFIG_CRYPTO_SHA256=y
> # CONFIG_CRYPTO_SHA512 is not set
> # CONFIG_CRYPTO_TGR192 is not set
> CONFIG_CRYPTO_WP512=m
> CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=m
> 
> #
> # Ciphers
> #
> CONFIG_CRYPTO_AES=m
> CONFIG_CRYPTO_AES_X86_64=m
> # CONFIG_CRYPTO_AES_NI_INTEL is not set
> CONFIG_CRYPTO_ANUBIS=m
> CONFIG_CRYPTO_ARC4=m
> # CONFIG_CRYPTO_BLOWFISH is not set
> # CONFIG_CRYPTO_BLOWFISH_X86_64 is not set
> # CONFIG_CRYPTO_CAMELLIA is not set
> CONFIG_CRYPTO_CAMELLIA_X86_64=m
> CONFIG_CRYPTO_CAST5=m
> CONFIG_CRYPTO_CAST5_AVX_X86_64=m
> CONFIG_CRYPTO_CAST6=m
> CONFIG_CRYPTO_CAST6_AVX_X86_64=m
> CONFIG_CRYPTO_DES=m
> # CONFIG_CRYPTO_FCRYPT is not set
> CONFIG_CRYPTO_KHAZAD=m
> CONFIG_CRYPTO_SALSA20=m
> # CONFIG_CRYPTO_SALSA20_X86_64 is not set
> CONFIG_CRYPTO_SEED=m
> CONFIG_CRYPTO_SERPENT=m
> CONFIG_CRYPTO_SERPENT_SSE2_X86_64=m
> CONFIG_CRYPTO_SERPENT_AVX_X86_64=m
> # CONFIG_CRYPTO_TEA is not set
> CONFIG_CRYPTO_TWOFISH=m
> CONFIG_CRYPTO_TWOFISH_COMMON=m
> CONFIG_CRYPTO_TWOFISH_X86_64=m
> CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=m
> CONFIG_CRYPTO_TWOFISH_AVX_X86_64=m
> 
> #
> # Compression
> #
> CONFIG_CRYPTO_DEFLATE=m
> CONFIG_CRYPTO_ZLIB=m
> CONFIG_CRYPTO_LZO=m
> 
> #
> # Random Number Generation
> #
> CONFIG_CRYPTO_ANSI_CPRNG=m
> # CONFIG_CRYPTO_HW is not set
> CONFIG_ASYMMETRIC_KEY_TYPE=y
> CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
> CONFIG_PUBLIC_KEY_ALGO_RSA=y
> CONFIG_X509_CERTIFICATE_PARSER=y
> CONFIG_HAVE_KVM=y
> CONFIG_VIRTUALIZATION=y
> # CONFIG_BINARY_PRINTF is not set
> 
> #
> # Library routines
> #
> CONFIG_BITREVERSE=m
> CONFIG_GENERIC_STRNCPY_FROM_USER=y
> CONFIG_GENERIC_STRNLEN_USER=y
> CONFIG_GENERIC_FIND_FIRST_BIT=y
> CONFIG_GENERIC_PCI_IOMAP=y
> CONFIG_GENERIC_IOMAP=y
> CONFIG_GENERIC_IO=y
> # CONFIG_CRC_CCITT is not set
> # CONFIG_CRC16 is not set
> CONFIG_CRC_T10DIF=m
> CONFIG_CRC_ITU_T=m
> CONFIG_CRC32=m
> CONFIG_CRC32_SELFTEST=y
> # CONFIG_CRC32_SLICEBY8 is not set
> # CONFIG_CRC32_SLICEBY4 is not set
> # CONFIG_CRC32_SARWATE is not set
> CONFIG_CRC32_BIT=y
> CONFIG_CRC7=m
> # CONFIG_LIBCRC32C is not set
> # CONFIG_CRC8 is not set
> CONFIG_ZLIB_INFLATE=m
> CONFIG_ZLIB_DEFLATE=m
> CONFIG_LZO_COMPRESS=y
> CONFIG_LZO_DECOMPRESS=y
> # CONFIG_XZ_DEC is not set
> # CONFIG_XZ_DEC_BCJ is not set
> CONFIG_HAS_IOMEM=y
> CONFIG_HAS_IOPORT=y
> CONFIG_HAS_DMA=y
> CONFIG_NLATTR=y
> CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
> CONFIG_AVERAGE=y
> CONFIG_CLZ_TAB=y
> CONFIG_CORDIC=m
> # CONFIG_DDR is not set
> CONFIG_MPILIB=y
> CONFIG_OID_REGISTRY=y


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 21:58:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 21:58:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU2mP-0000gZ-Um; Thu, 01 Nov 2012 21:58:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TU2mO-0000gO-P1
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 21:58:25 +0000
Received: from [85.158.139.211:43585] by server-6.bemta-5.messagelabs.com id
	B6/01-19321-080F2905; Thu, 01 Nov 2012 21:58:24 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1351807101!18486400!1
X-Originating-IP: [148.87.113.117]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQ4Ljg3LjExMy4xMTcgPT4gODMyMjAy\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26932 invoked from network); 1 Nov 2012 21:58:23 -0000
Received: from rcsinet15.oracle.com (HELO rcsinet15.oracle.com)
	(148.87.113.117)
	by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 21:58:23 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA1LvvqN027502
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 1 Nov 2012 21:57:57 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA1Lvssl008978
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 1 Nov 2012 21:57:55 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA1LvrIm023096; Thu, 1 Nov 2012 16:57:53 -0500
Received: from localhost.localdomain (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 01 Nov 2012 14:57:52 -0700
Date: Thu, 1 Nov 2012 17:57:49 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Randy Dunlap <rdunlap@infradead.org>
Message-ID: <20121101215749.GB18854@localhost.localdomain>
References: <20121101163622.129b59967d2ee76e6946874a@canb.auug.org.au>
	<5092AEF7.5020609@infradead.org>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5092AEF7.5020609@infradead.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, linux-next@vger.kernel.org
Subject: Re: [Xen-devel] linux-next: Tree for Nov 1 (xen)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 01, 2012 at 10:18:47AM -0700, Randy Dunlap wrote:
> On 10/31/2012 10:36 PM, Stephen Rothwell wrote:
> 
> > Hi all,
> > 
> > New trees: rr-fixes and swiotlb
> > 
> > Changes since 20121031:
> > 
> 
> 
> arch/x86/xen/enlighten.c:109:0: warning: "xen_pvh_domain" redefined
> include/xen/xen.h:23:0: note: this is the location of the previous definition

I think this was due to a patch that mistakenly was put in the tmem.git
tree. It should not surface tomorrow.

> 
> Full randconfig file is attached.
> 
> -- 
> ~Randy

> #
> # Automatically generated file; DO NOT EDIT.
> # Linux/x86_64 3.7.0-rc3 Kernel Configuration
> #
> CONFIG_64BIT=y
> CONFIG_X86_64=y
> CONFIG_X86=y
> CONFIG_INSTRUCTION_DECODER=y
> CONFIG_OUTPUT_FORMAT="elf64-x86-64"
> CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
> CONFIG_LOCKDEP_SUPPORT=y
> CONFIG_STACKTRACE_SUPPORT=y
> CONFIG_HAVE_LATENCYTOP_SUPPORT=y
> CONFIG_MMU=y
> CONFIG_NEED_DMA_MAP_STATE=y
> CONFIG_NEED_SG_DMA_LENGTH=y
> CONFIG_GENERIC_BUG=y
> CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
> CONFIG_GENERIC_HWEIGHT=y
> CONFIG_GENERIC_GPIO=y
> CONFIG_RWSEM_XCHGADD_ALGORITHM=y
> CONFIG_GENERIC_CALIBRATE_DELAY=y
> CONFIG_ARCH_HAS_CPU_RELAX=y
> CONFIG_ARCH_HAS_DEFAULT_IDLE=y
> CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
> CONFIG_ARCH_HAS_CPU_AUTOPROBE=y
> CONFIG_HAVE_SETUP_PER_CPU_AREA=y
> CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
> CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
> CONFIG_ARCH_HIBERNATION_POSSIBLE=y
> CONFIG_ARCH_SUSPEND_POSSIBLE=y
> CONFIG_ZONE_DMA32=y
> CONFIG_AUDIT_ARCH=y
> CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
> CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
> CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11"
> CONFIG_ARCH_SUPPORTS_UPROBES=y
> CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
> CONFIG_HAVE_IRQ_WORK=y
> CONFIG_IRQ_WORK=y
> CONFIG_BUILDTIME_EXTABLE_SORT=y
> 
> #
> # General setup
> #
> CONFIG_EXPERIMENTAL=y
> CONFIG_BROKEN_ON_SMP=y
> CONFIG_INIT_ENV_ARG_LIMIT=32
> CONFIG_CROSS_COMPILE=""
> CONFIG_LOCALVERSION=""
> # CONFIG_LOCALVERSION_AUTO is not set
> CONFIG_HAVE_KERNEL_GZIP=y
> CONFIG_HAVE_KERNEL_BZIP2=y
> CONFIG_HAVE_KERNEL_LZMA=y
> CONFIG_HAVE_KERNEL_XZ=y
> CONFIG_HAVE_KERNEL_LZO=y
> # CONFIG_KERNEL_GZIP is not set
> CONFIG_KERNEL_BZIP2=y
> # CONFIG_KERNEL_LZMA is not set
> # CONFIG_KERNEL_XZ is not set
> # CONFIG_KERNEL_LZO is not set
> CONFIG_DEFAULT_HOSTNAME="(none)"
> CONFIG_SYSVIPC=y
> CONFIG_FHANDLE=y
> CONFIG_HAVE_GENERIC_HARDIRQS=y
> 
> #
> # IRQ subsystem
> #
> CONFIG_GENERIC_HARDIRQS=y
> CONFIG_GENERIC_IRQ_PROBE=y
> CONFIG_GENERIC_IRQ_SHOW=y
> CONFIG_IRQ_DOMAIN=y
> # CONFIG_IRQ_DOMAIN_DEBUG is not set
> CONFIG_IRQ_FORCED_THREADING=y
> CONFIG_SPARSE_IRQ=y
> CONFIG_CLOCKSOURCE_WATCHDOG=y
> CONFIG_ARCH_CLOCKSOURCE_DATA=y
> CONFIG_GENERIC_TIME_VSYSCALL=y
> CONFIG_GENERIC_CLOCKEVENTS=y
> CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
> CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
> CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
> CONFIG_GENERIC_CMOS_UPDATE=y
> 
> #
> # Timers subsystem
> #
> CONFIG_TICK_ONESHOT=y
> # CONFIG_NO_HZ is not set
> CONFIG_HIGH_RES_TIMERS=y
> 
> #
> # CPU/Task time and stats accounting
> #
> CONFIG_TICK_CPU_ACCOUNTING=y
> # CONFIG_IRQ_TIME_ACCOUNTING is not set
> # CONFIG_BSD_PROCESS_ACCT is not set
> 
> #
> # RCU Subsystem
> #
> CONFIG_TINY_PREEMPT_RCU=y
> CONFIG_PREEMPT_RCU=y
> # CONFIG_TREE_RCU_TRACE is not set
> CONFIG_RCU_BOOST=y
> CONFIG_RCU_BOOST_PRIO=1
> CONFIG_RCU_BOOST_DELAY=500
> CONFIG_IKCONFIG=m
> CONFIG_LOG_BUF_SHIFT=17
> CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
> CONFIG_CHECKPOINT_RESTORE=y
> CONFIG_NAMESPACES=y
> CONFIG_UTS_NS=y
> # CONFIG_IPC_NS is not set
> # CONFIG_PID_NS is not set
> # CONFIG_SCHED_AUTOGROUP is not set
> CONFIG_SYSFS_DEPRECATED=y
> # CONFIG_SYSFS_DEPRECATED_V2 is not set
> # CONFIG_RELAY is not set
> # CONFIG_BLK_DEV_INITRD is not set
> # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
> CONFIG_ANON_INODES=y
> CONFIG_EXPERT=y
> CONFIG_HAVE_UID16=y
> CONFIG_UID16=y
> CONFIG_SYSCTL_EXCEPTION_TRACE=y
> CONFIG_KALLSYMS=y
> CONFIG_KALLSYMS_ALL=y
> CONFIG_HOTPLUG=y
> # CONFIG_PRINTK is not set
> CONFIG_BUG=y
> CONFIG_ELF_CORE=y
> # CONFIG_PCSPKR_PLATFORM is not set
> CONFIG_HAVE_PCSPKR_PLATFORM=y
> CONFIG_BASE_FULL=y
> CONFIG_FUTEX=y
> # CONFIG_EPOLL is not set
> # CONFIG_SIGNALFD is not set
> # CONFIG_TIMERFD is not set
> # CONFIG_EVENTFD is not set
> # CONFIG_SHMEM is not set
> # CONFIG_AIO is not set
> # CONFIG_EMBEDDED is not set
> CONFIG_HAVE_PERF_EVENTS=y
> 
> #
> # Kernel Performance Events And Counters
> #
> CONFIG_PERF_EVENTS=y
> # CONFIG_DEBUG_PERF_USE_VMALLOC is not set
> CONFIG_VM_EVENT_COUNTERS=y
> CONFIG_SLUB_DEBUG=y
> CONFIG_COMPAT_BRK=y
> # CONFIG_SLAB is not set
> CONFIG_SLUB=y
> # CONFIG_SLOB is not set
> CONFIG_PROFILING=y
> # CONFIG_OPROFILE is not set
> CONFIG_HAVE_OPROFILE=y
> CONFIG_OPROFILE_NMI_TIMER=y
> CONFIG_KPROBES=y
> CONFIG_JUMP_LABEL=y
> CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
> CONFIG_KRETPROBES=y
> CONFIG_HAVE_IOREMAP_PROT=y
> CONFIG_HAVE_KPROBES=y
> CONFIG_HAVE_KRETPROBES=y
> CONFIG_HAVE_OPTPROBES=y
> CONFIG_HAVE_ARCH_TRACEHOOK=y
> CONFIG_HAVE_DMA_ATTRS=y
> CONFIG_GENERIC_SMP_IDLE_THREAD=y
> CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
> CONFIG_HAVE_DMA_API_DEBUG=y
> CONFIG_HAVE_HW_BREAKPOINT=y
> CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
> CONFIG_HAVE_USER_RETURN_NOTIFIER=y
> CONFIG_HAVE_PERF_EVENTS_NMI=y
> CONFIG_HAVE_PERF_REGS=y
> CONFIG_HAVE_PERF_USER_STACK_DUMP=y
> CONFIG_HAVE_ARCH_JUMP_LABEL=y
> CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
> CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
> CONFIG_HAVE_CMPXCHG_LOCAL=y
> CONFIG_HAVE_CMPXCHG_DOUBLE=y
> CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
> CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y
> CONFIG_GENERIC_KERNEL_THREAD=y
> CONFIG_GENERIC_KERNEL_EXECVE=y
> CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
> CONFIG_HAVE_RCU_USER_QS=y
> CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
> CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
> CONFIG_MODULES_USE_ELF_RELA=y
> 
> #
> # GCOV-based kernel profiling
> #
> # CONFIG_GCOV_KERNEL is not set
> # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
> CONFIG_RT_MUTEXES=y
> CONFIG_BASE_SMALL=0
> CONFIG_MODULES=y
> CONFIG_MODULE_FORCE_LOAD=y
> CONFIG_MODULE_UNLOAD=y
> # CONFIG_MODULE_FORCE_UNLOAD is not set
> CONFIG_MODVERSIONS=y
> CONFIG_MODULE_SRCVERSION_ALL=y
> CONFIG_MODULE_SIG=y
> CONFIG_MODULE_SIG_FORCE=y
> # CONFIG_MODULE_SIG_SHA1 is not set
> # CONFIG_MODULE_SIG_SHA224 is not set
> CONFIG_MODULE_SIG_SHA256=y
> # CONFIG_MODULE_SIG_SHA384 is not set
> # CONFIG_MODULE_SIG_SHA512 is not set
> # CONFIG_BLOCK is not set
> CONFIG_ASN1=y
> CONFIG_UNINLINE_SPIN_UNLOCK=y
> CONFIG_FREEZER=y
> 
> #
> # Processor type and features
> #
> # CONFIG_ZONE_DMA is not set
> # CONFIG_SMP is not set
> CONFIG_X86_MPPARSE=y
> # CONFIG_X86_EXTENDED_PLATFORM is not set
> CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
> CONFIG_SCHED_OMIT_FRAME_POINTER=y
> # CONFIG_KVMTOOL_TEST_ENABLE is not set
> CONFIG_PARAVIRT_GUEST=y
> # CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
> CONFIG_XEN=y
> # CONFIG_XEN_PRIVILEGED_GUEST is not set
> CONFIG_XEN_MAX_DOMAIN_MEMORY=500
> CONFIG_XEN_SAVE_RESTORE=y
> # CONFIG_XEN_DEBUG_FS is not set
> CONFIG_XEN_X86_PVH=y
> # CONFIG_KVM_GUEST is not set
> CONFIG_PARAVIRT=y
> CONFIG_PARAVIRT_CLOCK=y
> CONFIG_PARAVIRT_DEBUG=y
> CONFIG_NO_BOOTMEM=y
> # CONFIG_MEMTEST is not set
> # CONFIG_MK8 is not set
> # CONFIG_MPSC is not set
> # CONFIG_MCORE2 is not set
> # CONFIG_MATOM is not set
> CONFIG_GENERIC_CPU=y
> CONFIG_X86_INTERNODE_CACHE_SHIFT=6
> CONFIG_X86_CMPXCHG=y
> CONFIG_X86_L1_CACHE_SHIFT=6
> CONFIG_X86_XADD=y
> CONFIG_X86_WP_WORKS_OK=y
> CONFIG_X86_TSC=y
> CONFIG_X86_CMPXCHG64=y
> CONFIG_X86_CMOV=y
> CONFIG_X86_MINIMUM_CPU_FAMILY=64
> CONFIG_X86_DEBUGCTLMSR=y
> # CONFIG_PROCESSOR_SELECT is not set
> CONFIG_CPU_SUP_INTEL=y
> CONFIG_CPU_SUP_AMD=y
> CONFIG_CPU_SUP_CENTAUR=y
> CONFIG_HPET_TIMER=y
> # CONFIG_DMI is not set
> CONFIG_SWIOTLB=y
> CONFIG_IOMMU_HELPER=y
> CONFIG_NR_CPUS=1
> # CONFIG_PREEMPT_NONE is not set
> # CONFIG_PREEMPT_VOLUNTARY is not set
> CONFIG_PREEMPT=y
> CONFIG_PREEMPT_COUNT=y
> CONFIG_X86_LOCAL_APIC=y
> CONFIG_X86_IO_APIC=y
> # CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS is not set
> CONFIG_X86_MCE=y
> CONFIG_X86_MCE_INTEL=y
> # CONFIG_X86_MCE_AMD is not set
> CONFIG_X86_MCE_THRESHOLD=y
> CONFIG_X86_MCE_INJECT=m
> CONFIG_X86_THERMAL_VECTOR=y
> CONFIG_I8K=m
> # CONFIG_MICROCODE is not set
> CONFIG_X86_MSR=m
> CONFIG_X86_CPUID=m
> CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
> CONFIG_ARCH_DMA_ADDR_T_64BIT=y
> CONFIG_DIRECT_GBPAGES=y
> CONFIG_ARCH_SPARSEMEM_ENABLE=y
> CONFIG_ARCH_SPARSEMEM_DEFAULT=y
> CONFIG_ARCH_SELECT_MEMORY_MODEL=y
> CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
> CONFIG_SELECT_MEMORY_MODEL=y
> CONFIG_SPARSEMEM_MANUAL=y
> CONFIG_SPARSEMEM=y
> CONFIG_HAVE_MEMORY_PRESENT=y
> CONFIG_SPARSEMEM_EXTREME=y
> CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
> CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=y
> # CONFIG_SPARSEMEM_VMEMMAP is not set
> CONFIG_HAVE_MEMBLOCK=y
> CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
> CONFIG_ARCH_DISCARD_MEMBLOCK=y
> CONFIG_MEMORY_ISOLATION=y
> # CONFIG_MEMORY_HOTPLUG is not set
> CONFIG_PAGEFLAGS_EXTENDED=y
> CONFIG_SPLIT_PTLOCK_CPUS=999999
> # CONFIG_COMPACTION is not set
> CONFIG_PHYS_ADDR_T_64BIT=y
> CONFIG_ZONE_DMA_FLAG=0
> CONFIG_VIRT_TO_BUS=y
> CONFIG_MMU_NOTIFIER=y
> CONFIG_KSM=y
> CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
> CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
> CONFIG_MEMORY_FAILURE=y
> # CONFIG_TRANSPARENT_HUGEPAGE is not set
> CONFIG_CROSS_MEMORY_ATTACH=y
> CONFIG_NEED_PER_CPU_KM=y
> CONFIG_CLEANCACHE=y
> # CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
> CONFIG_X86_RESERVE_LOW=64
> CONFIG_MTRR=y
> CONFIG_MTRR_SANITIZER=y
> CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
> CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
> # CONFIG_X86_PAT is not set
> # CONFIG_ARCH_RANDOM is not set
> CONFIG_X86_SMAP=y
> # CONFIG_SECCOMP is not set
> CONFIG_CC_STACKPROTECTOR=y
> # CONFIG_HZ_100 is not set
> # CONFIG_HZ_250 is not set
> CONFIG_HZ_300=y
> # CONFIG_HZ_1000 is not set
> CONFIG_HZ=300
> CONFIG_SCHED_HRTICK=y
> # CONFIG_KEXEC is not set
> # CONFIG_CRASH_DUMP is not set
> CONFIG_PHYSICAL_START=0x1000000
> # CONFIG_RELOCATABLE is not set
> CONFIG_PHYSICAL_ALIGN=0x1000000
> # CONFIG_COMPAT_VDSO is not set
> CONFIG_CMDLINE_BOOL=y
> CONFIG_CMDLINE=""
> CONFIG_CMDLINE_OVERRIDE=y
> CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
> 
> #
> # Power management and ACPI options
> #
> CONFIG_SUSPEND=y
> CONFIG_SUSPEND_FREEZER=y
> CONFIG_HIBERNATE_CALLBACKS=y
> CONFIG_PM_SLEEP=y
> CONFIG_PM_AUTOSLEEP=y
> CONFIG_PM_WAKELOCKS=y
> CONFIG_PM_WAKELOCKS_LIMIT=100
> # CONFIG_PM_WAKELOCKS_GC is not set
> CONFIG_PM_RUNTIME=y
> CONFIG_PM=y
> # CONFIG_PM_DEBUG is not set
> # CONFIG_SFI is not set
> 
> #
> # CPU Frequency scaling
> #
> CONFIG_CPU_FREQ=y
> CONFIG_CPU_FREQ_TABLE=m
> CONFIG_CPU_FREQ_STAT=m
> # CONFIG_CPU_FREQ_STAT_DETAILS is not set
> CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
> # CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
> # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
> # CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
> # CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
> CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
> CONFIG_CPU_FREQ_GOV_POWERSAVE=m
> CONFIG_CPU_FREQ_GOV_USERSPACE=m
> CONFIG_CPU_FREQ_GOV_ONDEMAND=m
> # CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
> 
> #
> # x86 CPU frequency scaling drivers
> #
> CONFIG_X86_P4_CLOCKMOD=m
> 
> #
> # shared options
> #
> CONFIG_X86_SPEEDSTEP_LIB=m
> # CONFIG_CPU_IDLE is not set
> # CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
> 
> #
> # Memory power savings
> #
> # CONFIG_I7300_IDLE is not set
> 
> #
> # Bus options (PCI etc.)
> #
> # CONFIG_PCI is not set
> # CONFIG_ISA_DMA_API is not set
> CONFIG_PCCARD=m
> CONFIG_PCMCIA=m
> CONFIG_PCMCIA_LOAD_CIS=y
> 
> #
> # PC-card bridges
> #
> 
> #
> # Executable file formats / Emulations
> #
> CONFIG_BINFMT_ELF=y
> CONFIG_COMPAT_BINFMT_ELF=y
> CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
> CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
> # CONFIG_HAVE_AOUT is not set
> CONFIG_BINFMT_MISC=m
> CONFIG_COREDUMP=y
> CONFIG_IA32_EMULATION=y
> CONFIG_IA32_AOUT=m
> # CONFIG_X86_X32 is not set
> CONFIG_COMPAT=y
> CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
> CONFIG_SYSVIPC_COMPAT=y
> CONFIG_KEYS_COMPAT=y
> CONFIG_HAVE_TEXT_POKE_SMP=y
> CONFIG_X86_DEV_DMA_OPS=y
> # CONFIG_NET is not set
> CONFIG_HAVE_BPF_JIT=y
> 
> #
> # Device Drivers
> #
> 
> #
> # Generic Driver Options
> #
> CONFIG_UEVENT_HELPER_PATH=""
> # CONFIG_DEVTMPFS is not set
> CONFIG_STANDALONE=y
> CONFIG_PREVENT_FIRMWARE_BUILD=y
> CONFIG_FW_LOADER=m
> # CONFIG_FIRMWARE_IN_KERNEL is not set
> CONFIG_EXTRA_FIRMWARE=""
> CONFIG_DEBUG_DRIVER=y
> CONFIG_DEBUG_DEVRES=y
> CONFIG_SYS_HYPERVISOR=y
> # CONFIG_GENERIC_CPU_DEVICES is not set
> CONFIG_REGMAP=y
> CONFIG_REGMAP_SPI=y
> CONFIG_REGMAP_IRQ=y
> # CONFIG_DMA_SHARED_BUFFER is not set
> 
> #
> # Bus devices
> #
> CONFIG_OMAP_OCP2SCP=m
> # CONFIG_MTD is not set
> CONFIG_PARPORT=m
> # CONFIG_PARPORT_PC is not set
> # CONFIG_PARPORT_GSC is not set
> # CONFIG_PARPORT_AX88796 is not set
> CONFIG_PARPORT_1284=y
> CONFIG_PARPORT_NOT_PC=y
> 
> #
> # Misc devices
> #
> # CONFIG_SENSORS_LIS3LV02D is not set
> CONFIG_AD525X_DPOT=m
> # CONFIG_AD525X_DPOT_SPI is not set
> CONFIG_ENCLOSURE_SERVICES=m
> # CONFIG_TI_DAC7512 is not set
> # CONFIG_VMWARE_BALLOON is not set
> CONFIG_BMP085=y
> CONFIG_BMP085_SPI=m
> # CONFIG_C2PORT is not set
> 
> #
> # EEPROM support
> #
> CONFIG_EEPROM_AT25=m
> # CONFIG_EEPROM_93CX6 is not set
> # CONFIG_EEPROM_93XX46 is not set
> 
> #
> # Texas Instruments shared transport line discipline
> #
> # CONFIG_SENSORS_LIS3_SPI is not set
> 
> #
> # Altera FPGA firmware download module
> #
> CONFIG_HAVE_IDE=y
> 
> #
> # SCSI device support
> #
> CONFIG_SCSI_MOD=y
> # CONFIG_SCSI_DMA is not set
> # CONFIG_SCSI_NETLINK is not set
> CONFIG_MACINTOSH_DRIVERS=y
> 
> #
> # Input device support
> #
> CONFIG_INPUT=m
> # CONFIG_INPUT_FF_MEMLESS is not set
> CONFIG_INPUT_POLLDEV=m
> CONFIG_INPUT_SPARSEKMAP=m
> CONFIG_INPUT_MATRIXKMAP=m
> 
> #
> # Userland interfaces
> #
> # CONFIG_INPUT_MOUSEDEV is not set
> CONFIG_INPUT_JOYDEV=m
> CONFIG_INPUT_EVDEV=m
> # CONFIG_INPUT_EVBUG is not set
> 
> #
> # Input Device Drivers
> #
> # CONFIG_INPUT_KEYBOARD is not set
> # CONFIG_INPUT_MOUSE is not set
> # CONFIG_INPUT_JOYSTICK is not set
> # CONFIG_INPUT_TABLET is not set
> # CONFIG_INPUT_TOUCHSCREEN is not set
> CONFIG_INPUT_MISC=y
> CONFIG_INPUT_AD714X=m
> CONFIG_INPUT_AD714X_SPI=m
> CONFIG_INPUT_MC13783_PWRBUTTON=m
> # CONFIG_INPUT_GPIO_TILT_POLLED is not set
> # CONFIG_INPUT_ATI_REMOTE2 is not set
> CONFIG_INPUT_KEYSPAN_REMOTE=m
> CONFIG_INPUT_POWERMATE=m
> # CONFIG_INPUT_YEALINK is not set
> # CONFIG_INPUT_CM109 is not set
> CONFIG_INPUT_UINPUT=m
> # CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
> CONFIG_INPUT_DA9052_ONKEY=m
> # CONFIG_INPUT_PCAP is not set
> CONFIG_INPUT_ADXL34X=m
> # CONFIG_INPUT_ADXL34X_SPI is not set
> # CONFIG_INPUT_CMA3000 is not set
> # CONFIG_INPUT_XEN_KBDDEV_FRONTEND is not set
> 
> #
> # Hardware I/O ports
> #
> CONFIG_SERIO=m
> CONFIG_SERIO_I8042=m
> CONFIG_SERIO_SERPORT=m
> CONFIG_SERIO_CT82C710=m
> CONFIG_SERIO_PARKBD=m
> # CONFIG_SERIO_LIBPS2 is not set
> # CONFIG_SERIO_RAW is not set
> CONFIG_SERIO_ALTERA_PS2=m
> # CONFIG_SERIO_PS2MULT is not set
> CONFIG_SERIO_ARC_PS2=m
> # CONFIG_GAMEPORT is not set
> 
> #
> # Character devices
> #
> # CONFIG_VT is not set
> CONFIG_UNIX98_PTYS=y
> # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
> # CONFIG_LEGACY_PTYS is not set
> # CONFIG_SERIAL_NONSTANDARD is not set
> # CONFIG_TRACE_SINK is not set
> CONFIG_DEVKMEM=y
> 
> #
> # Serial drivers
> #
> CONFIG_SERIAL_8250=m
> CONFIG_FIX_EARLYCON_MEM=y
> # CONFIG_SERIAL_8250_CS is not set
> CONFIG_SERIAL_8250_NR_UARTS=4
> CONFIG_SERIAL_8250_RUNTIME_UARTS=4
> # CONFIG_SERIAL_8250_EXTENDED is not set
> 
> #
> # Non-8250 serial port support
> #
> # CONFIG_SERIAL_MAX3100 is not set
> CONFIG_SERIAL_MAX310X=y
> CONFIG_SERIAL_CORE=y
> # CONFIG_SERIAL_SCCNXP is not set
> # CONFIG_SERIAL_TIMBERDALE is not set
> # CONFIG_SERIAL_ALTERA_JTAGUART is not set
> # CONFIG_SERIAL_ALTERA_UART is not set
> # CONFIG_SERIAL_IFX6X60 is not set
> # CONFIG_SERIAL_XILINX_PS_UART is not set
> CONFIG_SERIAL_ARC=m
> CONFIG_SERIAL_ARC_NR_PORTS=1
> CONFIG_TTY_PRINTK=y
> # CONFIG_PRINTER is not set
> # CONFIG_PPDEV is not set
> CONFIG_HVC_DRIVER=y
> # CONFIG_HVC_XEN is not set
> CONFIG_VIRTIO_CONSOLE=m
> CONFIG_IPMI_HANDLER=m
> CONFIG_IPMI_PANIC_EVENT=y
> CONFIG_IPMI_PANIC_STRING=y
> # CONFIG_IPMI_DEVICE_INTERFACE is not set
> CONFIG_IPMI_SI=m
> # CONFIG_IPMI_WATCHDOG is not set
> CONFIG_IPMI_POWEROFF=m
> CONFIG_HW_RANDOM=m
> # CONFIG_HW_RANDOM_TIMERIOMEM is not set
> # CONFIG_HW_RANDOM_VIA is not set
> # CONFIG_HW_RANDOM_VIRTIO is not set
> # CONFIG_NVRAM is not set
> # CONFIG_R3964 is not set
> 
> #
> # PCMCIA character devices
> #
> CONFIG_SYNCLINK_CS=m
> CONFIG_CARDMAN_4000=m
> # CONFIG_CARDMAN_4040 is not set
> # CONFIG_MWAVE is not set
> # CONFIG_HANGCHECK_TIMER is not set
> # CONFIG_TCG_TPM is not set
> CONFIG_TELCLOCK=m
> # CONFIG_I2C is not set
> CONFIG_SPI=y
> CONFIG_SPI_DEBUG=y
> CONFIG_SPI_MASTER=y
> 
> #
> # SPI Master Controller Drivers
> #
> # CONFIG_SPI_ALTERA is not set
> CONFIG_SPI_BITBANG=m
> CONFIG_SPI_BUTTERFLY=m
> # CONFIG_SPI_GPIO is not set
> CONFIG_SPI_LM70_LLP=m
> CONFIG_SPI_OC_TINY=m
> # CONFIG_SPI_PXA2XX_PCI is not set
> # CONFIG_SPI_XILINX is not set
> CONFIG_SPI_DESIGNWARE=m
> 
> #
> # SPI Protocol Masters
> #
> # CONFIG_SPI_SPIDEV is not set
> # CONFIG_SPI_TLE62X0 is not set
> CONFIG_HSI=m
> CONFIG_HSI_BOARDINFO=y
> 
> #
> # HSI clients
> #
> CONFIG_HSI_CHAR=m
> 
> #
> # PPS support
> #
> # CONFIG_PPS is not set
> 
> #
> # PPS generators support
> #
> 
> #
> # PTP clock support
> #
> 
> #
> # Enable Device Drivers -> PPS to see the PTP clock options.
> #
> CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
> CONFIG_GPIOLIB=y
> CONFIG_DEBUG_GPIO=y
> CONFIG_GPIO_SYSFS=y
> # CONFIG_GPIO_DA9052 is not set
> 
> #
> # Memory mapped GPIO drivers:
> #
> # CONFIG_GPIO_GENERIC_PLATFORM is not set
> CONFIG_GPIO_IT8761E=m
> 
> #
> # I2C GPIO expanders:
> #
> # CONFIG_GPIO_ARIZONA is not set
> 
> #
> # PCI GPIO expanders:
> #
> 
> #
> # SPI GPIO expanders:
> #
> # CONFIG_GPIO_MAX7301 is not set
> CONFIG_GPIO_MCP23S08=m
> # CONFIG_GPIO_MC33880 is not set
> CONFIG_GPIO_74X164=m
> 
> #
> # AC97 GPIO expanders:
> #
> 
> #
> # MODULbus GPIO expanders:
> #
> # CONFIG_W1 is not set
> # CONFIG_POWER_SUPPLY is not set
> CONFIG_POWER_AVS=y
> CONFIG_HWMON=m
> CONFIG_HWMON_VID=m
> CONFIG_HWMON_DEBUG_CHIP=y
> 
> #
> # Native drivers
> #
> # CONFIG_SENSORS_AD7314 is not set
> # CONFIG_SENSORS_ADCXX is not set
> CONFIG_SENSORS_DA9052_ADC=m
> CONFIG_SENSORS_F71805F=m
> CONFIG_SENSORS_F71882FG=m
> # CONFIG_SENSORS_GPIO_FAN is not set
> CONFIG_SENSORS_CORETEMP=m
> # CONFIG_SENSORS_IBMAEM is not set
> CONFIG_SENSORS_IBMPEX=m
> # CONFIG_SENSORS_IT87 is not set
> CONFIG_SENSORS_LM70=m
> CONFIG_SENSORS_MAX1111=m
> # CONFIG_SENSORS_MAX197 is not set
> # CONFIG_SENSORS_NTC_THERMISTOR is not set
> CONFIG_SENSORS_PC87360=m
> CONFIG_SENSORS_PC87427=m
> # CONFIG_SENSORS_SHT15 is not set
> CONFIG_SENSORS_SMSC47M1=m
> # CONFIG_SENSORS_SMSC47B397 is not set
> # CONFIG_SENSORS_SCH56XX_COMMON is not set
> CONFIG_SENSORS_ADS7871=m
> # CONFIG_SENSORS_VIA_CPUTEMP is not set
> CONFIG_SENSORS_VT1211=m
> CONFIG_SENSORS_W83627HF=m
> CONFIG_SENSORS_W83627EHF=m
> CONFIG_SENSORS_APPLESMC=m
> # CONFIG_SENSORS_MC13783_ADC is not set
> CONFIG_THERMAL=m
> CONFIG_THERMAL_HWMON=y
> CONFIG_CPU_THERMAL=y
> CONFIG_FAIR_SHARE=y
> CONFIG_STEP_WISE=y
> CONFIG_USER_SPACE=y
> CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
> # CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
> # CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set
> # CONFIG_WATCHDOG is not set
> CONFIG_SSB_POSSIBLE=y
> 
> #
> # Sonics Silicon Backplane
> #
> CONFIG_SSB=m
> CONFIG_SSB_PCMCIAHOST_POSSIBLE=y
> # CONFIG_SSB_PCMCIAHOST is not set
> CONFIG_SSB_SDIOHOST_POSSIBLE=y
> # CONFIG_SSB_SDIOHOST is not set
> CONFIG_SSB_SILENT=y
> CONFIG_BCMA_POSSIBLE=y
> 
> #
> # Broadcom specific AMBA
> #
> CONFIG_BCMA=m
> # CONFIG_BCMA_DRIVER_GMAC_CMN is not set
> # CONFIG_BCMA_DEBUG is not set
> 
> #
> # Multifunction device drivers
> #
> CONFIG_MFD_CORE=y
> # CONFIG_MFD_SM501 is not set
> # CONFIG_HTC_PASIC3 is not set
> # CONFIG_MFD_TPS65912_SPI is not set
> # CONFIG_MFD_STMPE is not set
> # CONFIG_MFD_TMIO is not set
> CONFIG_PMIC_DA9052=y
> CONFIG_MFD_DA9052_SPI=y
> CONFIG_MFD_ARIZONA=y
> CONFIG_MFD_ARIZONA_SPI=m
> CONFIG_MFD_WM5102=y
> CONFIG_MFD_WM5110=y
> # CONFIG_MFD_WM831X_SPI is not set
> CONFIG_MFD_MC13783=m
> CONFIG_MFD_MC13XXX=m
> CONFIG_MFD_MC13XXX_SPI=m
> # CONFIG_ABX500_CORE is not set
> CONFIG_EZX_PCAP=y
> # CONFIG_REGULATOR is not set
> CONFIG_MEDIA_SUPPORT=m
> 
> #
> # Multimedia core support
> #
> # CONFIG_MEDIA_CAMERA_SUPPORT is not set
> # CONFIG_MEDIA_ANALOG_TV_SUPPORT is not set
> # CONFIG_MEDIA_DIGITAL_TV_SUPPORT is not set
> CONFIG_MEDIA_RADIO_SUPPORT=y
> # CONFIG_MEDIA_RC_SUPPORT is not set
> CONFIG_VIDEO_DEV=m
> CONFIG_VIDEO_V4L2=m
> # CONFIG_VIDEO_ADV_DEBUG is not set
> # CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
> 
> #
> # Media drivers
> #
> CONFIG_MEDIA_USB_SUPPORT=y
> 
> #
> # Supported MMC/SDIO adapters
> #
> CONFIG_RADIO_ADAPTERS=y
> # CONFIG_RADIO_SI470X is not set
> # CONFIG_USB_MR800 is not set
> CONFIG_USB_DSBR=m
> # CONFIG_RADIO_SHARK2 is not set
> CONFIG_USB_KEENE=m
> 
> #
> # Texas Instruments WL128x FM driver (ST based)
> #
> 
> #
> # Media ancillary drivers (tuners, sensors, i2c, frontends)
> #
> 
> #
> # Encoders, decoders, sensors and other helper chips
> #
> 
> #
> # Audio decoders, processors and mixers
> #
> 
> #
> # RDS decoders
> #
> 
> #
> # Video decoders
> #
> 
> #
> # Video and audio decoders
> #
> 
> #
> # MPEG video encoders
> #
> # CONFIG_VIDEO_CX2341X is not set
> 
> #
> # Video encoders
> #
> 
> #
> # Camera sensor devices
> #
> 
> #
> # Flash devices
> #
> 
> #
> # Video improvement chips
> #
> 
> #
> # Miscelaneous helper chips
> #
> 
> #
> # Sensors used on soc_camera driver
> #
> CONFIG_MEDIA_ATTACH=y
> 
> #
> # Customize TV tuners
> #
> 
> #
> # Customise DVB Frontends
> #
> 
> #
> # Tools to develop new frontends
> #
> CONFIG_DVB_DUMMY_FE=m
> 
> #
> # Graphics support
> #
> # CONFIG_DRM is not set
> # CONFIG_VGASTATE is not set
> # CONFIG_VIDEO_OUTPUT_CONTROL is not set
> CONFIG_FB=m
> # CONFIG_FIRMWARE_EDID is not set
> # CONFIG_FB_DDC is not set
> # CONFIG_FB_BOOT_VESA_SUPPORT is not set
> CONFIG_FB_CFB_FILLRECT=m
> CONFIG_FB_CFB_COPYAREA=m
> CONFIG_FB_CFB_IMAGEBLIT=m
> # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
> CONFIG_FB_SYS_FILLRECT=m
> CONFIG_FB_SYS_COPYAREA=m
> CONFIG_FB_SYS_IMAGEBLIT=m
> # CONFIG_FB_FOREIGN_ENDIAN is not set
> CONFIG_FB_SYS_FOPS=m
> # CONFIG_FB_WMT_GE_ROPS is not set
> CONFIG_FB_DEFERRED_IO=y
> CONFIG_FB_HECUBA=m
> # CONFIG_FB_SVGALIB is not set
> # CONFIG_FB_MACMODES is not set
> # CONFIG_FB_BACKLIGHT is not set
> CONFIG_FB_MODE_HELPERS=y
> # CONFIG_FB_TILEBLITTING is not set
> 
> #
> # Frame buffer hardware drivers
> #
> CONFIG_FB_ARC=m
> # CONFIG_FB_VGA16 is not set
> CONFIG_FB_N411=m
> CONFIG_FB_HGA=m
> CONFIG_FB_S1D13XXX=m
> CONFIG_FB_TMIO=m
> CONFIG_FB_TMIO_ACCELL=y
> CONFIG_FB_SMSCUFX=m
> # CONFIG_FB_UDL is not set
> # CONFIG_FB_VIRTUAL is not set
> # CONFIG_XEN_FBDEV_FRONTEND is not set
> CONFIG_FB_METRONOME=m
> # CONFIG_FB_BROADSHEET is not set
> CONFIG_FB_AUO_K190X=m
> CONFIG_FB_AUO_K1900=m
> CONFIG_FB_AUO_K1901=m
> CONFIG_EXYNOS_VIDEO=y
> # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
> CONFIG_LOGO=y
> CONFIG_LOGO_LINUX_MONO=y
> CONFIG_LOGO_LINUX_VGA16=y
> # CONFIG_LOGO_LINUX_CLUT224 is not set
> # CONFIG_SOUND is not set
> 
> #
> # HID support
> #
> CONFIG_HID=m
> # CONFIG_HIDRAW is not set
> # CONFIG_UHID is not set
> # CONFIG_HID_GENERIC is not set
> 
> #
> # Special HID drivers
> #
> 
> #
> # USB HID support
> #
> # CONFIG_USB_HID is not set
> CONFIG_HID_PID=y
> 
> #
> # USB HID Boot Protocol drivers
> #
> # CONFIG_USB_KBD is not set
> CONFIG_USB_MOUSE=m
> # CONFIG_USB_ARCH_HAS_OHCI is not set
> # CONFIG_USB_ARCH_HAS_EHCI is not set
> # CONFIG_USB_ARCH_HAS_XHCI is not set
> CONFIG_USB_SUPPORT=y
> CONFIG_USB_COMMON=m
> CONFIG_USB_ARCH_HAS_HCD=y
> CONFIG_USB=m
> # CONFIG_USB_DEBUG is not set
> CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
> 
> #
> # Miscellaneous USB options
> #
> # CONFIG_USB_DYNAMIC_MINORS is not set
> # CONFIG_USB_SUSPEND is not set
> CONFIG_USB_OTG_WHITELIST=y
> CONFIG_USB_OTG_BLACKLIST_HUB=y
> CONFIG_USB_DWC3=m
> CONFIG_USB_DWC3_DEBUG=y
> # CONFIG_USB_DWC3_VERBOSE is not set
> # CONFIG_USB_MON is not set
> # CONFIG_USB_WUSB_CBAF is not set
> 
> #
> # USB Host Controller Drivers
> #
> CONFIG_USB_C67X00_HCD=m
> CONFIG_USB_OXU210HP_HCD=m
> # CONFIG_USB_ISP116X_HCD is not set
> CONFIG_USB_ISP1760_HCD=m
> CONFIG_USB_ISP1362_HCD=m
> CONFIG_USB_U132_HCD=m
> # CONFIG_USB_SL811_HCD is not set
> CONFIG_USB_R8A66597_HCD=m
> # CONFIG_USB_RENESAS_USBHS_HCD is not set
> CONFIG_USB_HCD_BCMA=m
> CONFIG_USB_HCD_SSB=m
> CONFIG_USB_MUSB_HDRC=m
> # CONFIG_USB_MUSB_TUSB6010 is not set
> CONFIG_MUSB_PIO_ONLY=y
> CONFIG_USB_CHIPIDEA=m
> CONFIG_USB_CHIPIDEA_UDC=y
> # CONFIG_USB_CHIPIDEA_HOST is not set
> CONFIG_USB_CHIPIDEA_DEBUG=y
> CONFIG_USB_RENESAS_USBHS=m
> 
> #
> # USB Device Class drivers
> #
> # CONFIG_USB_ACM is not set
> CONFIG_USB_PRINTER=m
> # CONFIG_USB_WDM is not set
> # CONFIG_USB_TMC is not set
> 
> #
> # NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
> #
> 
> #
> # also be needed; see USB_STORAGE Help for more info
> #
> 
> #
> # USB Imaging devices
> #
> CONFIG_USB_MDC800=m
> 
> #
> # USB port drivers
> #
> CONFIG_USB_USS720=m
> # CONFIG_USB_SERIAL is not set
> 
> #
> # USB Miscellaneous drivers
> #
> CONFIG_USB_EMI62=m
> CONFIG_USB_EMI26=m
> # CONFIG_USB_ADUTUX is not set
> # CONFIG_USB_SEVSEG is not set
> CONFIG_USB_RIO500=m
> # CONFIG_USB_LEGOTOWER is not set
> CONFIG_USB_LCD=m
> # CONFIG_USB_LED is not set
> CONFIG_USB_CYPRESS_CY7C63=m
> # CONFIG_USB_CYTHERM is not set
> # CONFIG_USB_IDMOUSE is not set
> CONFIG_USB_FTDI_ELAN=m
> # CONFIG_USB_APPLEDISPLAY is not set
> CONFIG_USB_SISUSBVGA=m
> CONFIG_USB_LD=m
> # CONFIG_USB_TRANCEVIBRATOR is not set
> CONFIG_USB_IOWARRIOR=m
> # CONFIG_USB_TEST is not set
> CONFIG_USB_ISIGHTFW=m
> # CONFIG_USB_YUREX is not set
> CONFIG_USB_EZUSB_FX2=m
> 
> #
> # USB Physical Layer drivers
> #
> # CONFIG_OMAP_USB2 is not set
> CONFIG_USB_GADGET=m
> CONFIG_USB_GADGET_DEBUG=y
> # CONFIG_USB_GADGET_DEBUG_FS is not set
> CONFIG_USB_GADGET_VBUS_DRAW=2
> CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
> 
> #
> # USB Peripheral Controller
> #
> # CONFIG_USB_R8A66597 is not set
> CONFIG_USB_RENESAS_USBHS_UDC=m
> # CONFIG_USB_MV_UDC is not set
> CONFIG_USB_GADGET_MUSB_HDRC=m
> CONFIG_USB_M66592=m
> # CONFIG_USB_NET2272 is not set
> CONFIG_USB_DUMMY_HCD=m
> CONFIG_USB_LIBCOMPOSITE=m
> # CONFIG_USB_ZERO is not set
> # CONFIG_USB_GADGETFS is not set
> CONFIG_USB_FUNCTIONFS=m
> CONFIG_USB_FUNCTIONFS_GENERIC=y
> CONFIG_USB_G_SERIAL=m
> # CONFIG_USB_G_PRINTER is not set
> CONFIG_USB_G_HID=m
> CONFIG_USB_G_DBGP=m
> CONFIG_USB_G_DBGP_PRINTK=y
> # CONFIG_USB_G_DBGP_SERIAL is not set
> CONFIG_USB_G_WEBCAM=m
> 
> #
> # OTG and related infrastructure
> #
> CONFIG_USB_OTG_UTILS=y
> CONFIG_USB_GPIO_VBUS=m
> CONFIG_NOP_USB_XCEIV=m
> CONFIG_MMC=m
> CONFIG_MMC_DEBUG=y
> # CONFIG_MMC_UNSAFE_RESUME is not set
> CONFIG_MMC_CLKGATE=y
> 
> #
> # MMC/SD/SDIO Card Drivers
> #
> CONFIG_SDIO_UART=m
> CONFIG_MMC_TEST=m
> 
> #
> # MMC/SD/SDIO Host Controller Drivers
> #
> # CONFIG_MMC_SDHCI is not set
> CONFIG_MMC_SPI=m
> # CONFIG_MMC_VUB300 is not set
> CONFIG_MMC_USHC=m
> CONFIG_MEMSTICK=m
> CONFIG_MEMSTICK_DEBUG=y
> 
> #
> # MemoryStick drivers
> #
> # CONFIG_MEMSTICK_UNSAFE_RESUME is not set
> 
> #
> # MemoryStick Host Controller Drivers
> #
> CONFIG_NEW_LEDS=y
> CONFIG_LEDS_CLASS=m
> 
> #
> # LED drivers
> #
> CONFIG_LEDS_GPIO=m
> # CONFIG_LEDS_DA9052 is not set
> # CONFIG_LEDS_DAC124S085 is not set
> # CONFIG_LEDS_LT3593 is not set
> CONFIG_LEDS_MC13783=m
> CONFIG_LEDS_OT200=m
> CONFIG_LEDS_TRIGGERS=y
> 
> #
> # LED Triggers
> #
> CONFIG_LEDS_TRIGGER_TIMER=m
> CONFIG_LEDS_TRIGGER_ONESHOT=m
> CONFIG_LEDS_TRIGGER_HEARTBEAT=m
> # CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
> # CONFIG_LEDS_TRIGGER_CPU is not set
> # CONFIG_LEDS_TRIGGER_GPIO is not set
> CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
> 
> #
> # iptables trigger is under Netfilter config (LED target)
> #
> # CONFIG_LEDS_TRIGGER_TRANSIENT is not set
> CONFIG_ACCESSIBILITY=y
> CONFIG_EDAC=y
> 
> #
> # Reporting subsystems
> #
> # CONFIG_EDAC_LEGACY_SYSFS is not set
> CONFIG_EDAC_DEBUG=y
> CONFIG_EDAC_MM_EDAC=m
> CONFIG_RTC_LIB=y
> CONFIG_RTC_CLASS=y
> CONFIG_RTC_HCTOSYS=y
> CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
> # CONFIG_RTC_DEBUG is not set
> 
> #
> # RTC interfaces
> #
> CONFIG_RTC_INTF_SYSFS=y
> CONFIG_RTC_INTF_DEV=y
> CONFIG_RTC_INTF_DEV_UIE_EMUL=y
> CONFIG_RTC_DRV_TEST=m
> 
> #
> # SPI RTC drivers
> #
> CONFIG_RTC_DRV_M41T93=m
> # CONFIG_RTC_DRV_M41T94 is not set
> # CONFIG_RTC_DRV_DS1305 is not set
> CONFIG_RTC_DRV_DS1390=m
> CONFIG_RTC_DRV_MAX6902=m
> # CONFIG_RTC_DRV_R9701 is not set
> CONFIG_RTC_DRV_RS5C348=m
> # CONFIG_RTC_DRV_DS3234 is not set
> CONFIG_RTC_DRV_PCF2123=m
> 
> #
> # Platform RTC drivers
> #
> # CONFIG_RTC_DRV_CMOS is not set
> CONFIG_RTC_DRV_DS1286=m
> # CONFIG_RTC_DRV_DS1511 is not set
> # CONFIG_RTC_DRV_DS1553 is not set
> # CONFIG_RTC_DRV_DS1742 is not set
> # CONFIG_RTC_DRV_DA9052 is not set
> # CONFIG_RTC_DRV_STK17TA8 is not set
> # CONFIG_RTC_DRV_M48T86 is not set
> CONFIG_RTC_DRV_M48T35=m
> CONFIG_RTC_DRV_M48T59=m
> # CONFIG_RTC_DRV_MSM6242 is not set
> CONFIG_RTC_DRV_BQ4802=m
> CONFIG_RTC_DRV_RP5C01=m
> CONFIG_RTC_DRV_V3020=m
> # CONFIG_RTC_DRV_DS2404 is not set
> 
> #
> # on-CPU RTC drivers
> #
> CONFIG_RTC_DRV_PCAP=m
> CONFIG_RTC_DRV_MC13XXX=m
> # CONFIG_DMADEVICES is not set
> # CONFIG_AUXDISPLAY is not set
> # CONFIG_UIO is not set
> CONFIG_VIRTIO=m
> 
> #
> # Virtio drivers
> #
> CONFIG_VIRTIO_BALLOON=m
> # CONFIG_VIRTIO_MMIO is not set
> 
> #
> # Microsoft Hyper-V guest support
> #
> 
> #
> # Xen driver support
> #
> # CONFIG_XEN_BALLOON is not set
> # CONFIG_XEN_DEV_EVTCHN is not set
> # CONFIG_XENFS is not set
> CONFIG_XEN_SYS_HYPERVISOR=y
> CONFIG_XEN_GNTDEV=m
> CONFIG_XEN_GRANT_DEV_ALLOC=m
> CONFIG_XEN_TMEM=y
> CONFIG_XEN_PRIVCMD=m
> CONFIG_XEN_HAVE_PVMMU=y
> CONFIG_STAGING=y
> CONFIG_ECHO=m
> CONFIG_COMEDI=m
> # CONFIG_COMEDI_DEBUG is not set
> CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB=2048
> CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB=20480
> # CONFIG_COMEDI_MISC_DRIVERS is not set
> CONFIG_COMEDI_PCMCIA_DRIVERS=y
> CONFIG_COMEDI_CB_DAS16_CS=m
> CONFIG_COMEDI_DAS08_CS=m
> # CONFIG_COMEDI_NI_DAQ_700_CS is not set
> CONFIG_COMEDI_NI_DAQ_DIO24_CS=m
> # CONFIG_COMEDI_NI_MIO_CS is not set
> CONFIG_COMEDI_QUATECH_DAQP_CS=m
> CONFIG_COMEDI_USB_DRIVERS=y
> # CONFIG_COMEDI_DT9812 is not set
> CONFIG_COMEDI_USBDUX=m
> # CONFIG_COMEDI_USBDUXFAST is not set
> CONFIG_COMEDI_USBDUXSIGMA=m
> CONFIG_COMEDI_VMK80XX=m
> CONFIG_COMEDI_8255=m
> CONFIG_COMEDI_FC=m
> CONFIG_COMEDI_DAS08=m
> # CONFIG_ASUS_OLED is not set
> CONFIG_PANEL=m
> CONFIG_PANEL_PARPORT=0
> CONFIG_PANEL_PROFILE=5
> # CONFIG_PANEL_CHANGE_MESSAGE is not set
> CONFIG_TRANZPORT=m
> # CONFIG_ZSMALLOC is not set
> # CONFIG_FT1000 is not set
> 
> #
> # Speakup console speech
> #
> CONFIG_STAGING_MEDIA=y
> 
> #
> # Android
> #
> CONFIG_ANDROID=y
> CONFIG_ANDROID_BINDER_IPC=y
> # CONFIG_ANDROID_LOGGER is not set
> # CONFIG_ANDROID_TIMED_OUTPUT is not set
> # CONFIG_ANDROID_LOW_MEMORY_KILLER is not set
> CONFIG_ANDROID_INTF_ALARM_DEV=y
> # CONFIG_IPACK_BUS is not set
> # CONFIG_CED1401 is not set
> # CONFIG_DGRP is not set
> # CONFIG_X86_PLATFORM_DEVICES is not set
> 
> #
> # Hardware Spinlock drivers
> #
> CONFIG_CLKEVT_I8253=y
> CONFIG_CLKBLD_I8253=y
> CONFIG_IOMMU_SUPPORT=y
> 
> #
> # Remoteproc drivers (EXPERIMENTAL)
> #
> CONFIG_REMOTEPROC=m
> CONFIG_STE_MODEM_RPROC=m
> 
> #
> # Rpmsg drivers
> #
> # CONFIG_VIRT_DRIVERS is not set
> CONFIG_PM_DEVFREQ=y
> 
> #
> # DEVFREQ Governors
> #
> CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y
> # CONFIG_DEVFREQ_GOV_PERFORMANCE is not set
> # CONFIG_DEVFREQ_GOV_POWERSAVE is not set
> # CONFIG_DEVFREQ_GOV_USERSPACE is not set
> 
> #
> # DEVFREQ Drivers
> #
> CONFIG_EXTCON=m
> 
> #
> # Extcon Device Drivers
> #
> CONFIG_EXTCON_GPIO=m
> # CONFIG_EXTCON_ARIZONA is not set
> # CONFIG_MEMORY is not set
> # CONFIG_IIO is not set
> CONFIG_PWM=y
> 
> #
> # Firmware Drivers
> #
> CONFIG_EDD=m
> CONFIG_EDD_OFF=y
> # CONFIG_FIRMWARE_MEMMAP is not set
> CONFIG_DELL_RBU=m
> CONFIG_DCDBAS=m
> CONFIG_ISCSI_IBFT_FIND=y
> CONFIG_GOOGLE_FIRMWARE=y
> 
> #
> # Google Firmware Drivers
> #
> 
> #
> # File systems
> #
> CONFIG_DCACHE_WORD_ACCESS=y
> # CONFIG_FS_POSIX_ACL is not set
> CONFIG_EXPORTFS=y
> # CONFIG_FILE_LOCKING is not set
> CONFIG_FSNOTIFY=y
> CONFIG_DNOTIFY=y
> CONFIG_INOTIFY_USER=y
> # CONFIG_FANOTIFY is not set
> CONFIG_QUOTA=y
> # CONFIG_PRINT_QUOTA_WARNING is not set
> # CONFIG_QUOTA_DEBUG is not set
> # CONFIG_QFMT_V1 is not set
> # CONFIG_QFMT_V2 is not set
> CONFIG_QUOTACTL=y
> CONFIG_QUOTACTL_COMPAT=y
> # CONFIG_AUTOFS4_FS is not set
> CONFIG_FUSE_FS=m
> # CONFIG_CUSE is not set
> 
> #
> # Caches
> #
> # CONFIG_FSCACHE is not set
> 
> #
> # Pseudo filesystems
> #
> # CONFIG_PROC_FS is not set
> CONFIG_SYSFS=y
> # CONFIG_HUGETLBFS is not set
> # CONFIG_HUGETLB_PAGE is not set
> CONFIG_CONFIGFS_FS=m
> # CONFIG_MISC_FILESYSTEMS is not set
> CONFIG_NLS=m
> CONFIG_NLS_DEFAULT="iso8859-1"
> # CONFIG_NLS_CODEPAGE_437 is not set
> CONFIG_NLS_CODEPAGE_737=m
> # CONFIG_NLS_CODEPAGE_775 is not set
> # CONFIG_NLS_CODEPAGE_850 is not set
> CONFIG_NLS_CODEPAGE_852=m
> CONFIG_NLS_CODEPAGE_855=m
> CONFIG_NLS_CODEPAGE_857=m
> CONFIG_NLS_CODEPAGE_860=m
> # CONFIG_NLS_CODEPAGE_861 is not set
> CONFIG_NLS_CODEPAGE_862=m
> CONFIG_NLS_CODEPAGE_863=m
> # CONFIG_NLS_CODEPAGE_864 is not set
> CONFIG_NLS_CODEPAGE_865=m
> # CONFIG_NLS_CODEPAGE_866 is not set
> # CONFIG_NLS_CODEPAGE_869 is not set
> CONFIG_NLS_CODEPAGE_936=m
> # CONFIG_NLS_CODEPAGE_950 is not set
> # CONFIG_NLS_CODEPAGE_932 is not set
> CONFIG_NLS_CODEPAGE_949=m
> # CONFIG_NLS_CODEPAGE_874 is not set
> # CONFIG_NLS_ISO8859_8 is not set
> # CONFIG_NLS_CODEPAGE_1250 is not set
> CONFIG_NLS_CODEPAGE_1251=m
> CONFIG_NLS_ASCII=m
> CONFIG_NLS_ISO8859_1=m
> # CONFIG_NLS_ISO8859_2 is not set
> # CONFIG_NLS_ISO8859_3 is not set
> CONFIG_NLS_ISO8859_4=m
> # CONFIG_NLS_ISO8859_5 is not set
> # CONFIG_NLS_ISO8859_6 is not set
> # CONFIG_NLS_ISO8859_7 is not set
> CONFIG_NLS_ISO8859_9=m
> CONFIG_NLS_ISO8859_13=m
> CONFIG_NLS_ISO8859_14=m
> CONFIG_NLS_ISO8859_15=m
> CONFIG_NLS_KOI8_R=m
> # CONFIG_NLS_KOI8_U is not set
> # CONFIG_NLS_MAC_ROMAN is not set
> CONFIG_NLS_MAC_CELTIC=m
> CONFIG_NLS_MAC_CENTEURO=m
> # CONFIG_NLS_MAC_CROATIAN is not set
> # CONFIG_NLS_MAC_CYRILLIC is not set
> # CONFIG_NLS_MAC_GAELIC is not set
> CONFIG_NLS_MAC_GREEK=m
> CONFIG_NLS_MAC_ICELAND=m
> # CONFIG_NLS_MAC_INUIT is not set
> # CONFIG_NLS_MAC_ROMANIAN is not set
> # CONFIG_NLS_MAC_TURKISH is not set
> # CONFIG_NLS_UTF8 is not set
> 
> #
> # Kernel hacking
> #
> CONFIG_TRACE_IRQFLAGS_SUPPORT=y
> CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
> CONFIG_ENABLE_WARN_DEPRECATED=y
> CONFIG_ENABLE_MUST_CHECK=y
> CONFIG_FRAME_WARN=2048
> CONFIG_MAGIC_SYSRQ=y
> # CONFIG_STRIP_ASM_SYMS is not set
> CONFIG_READABLE_ASM=y
> CONFIG_UNUSED_SYMBOLS=y
> CONFIG_DEBUG_FS=y
> # CONFIG_HEADERS_CHECK is not set
> # CONFIG_DEBUG_SECTION_MISMATCH is not set
> CONFIG_DEBUG_KERNEL=y
> # CONFIG_DEBUG_SHIRQ is not set
> CONFIG_LOCKUP_DETECTOR=y
> CONFIG_HARDLOCKUP_DETECTOR=y
> CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y
> CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=1
> # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
> CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
> # CONFIG_PANIC_ON_OOPS is not set
> CONFIG_PANIC_ON_OOPS_VALUE=0
> # CONFIG_DETECT_HUNG_TASK is not set
> CONFIG_DEBUG_OBJECTS=y
> # CONFIG_DEBUG_OBJECTS_SELFTEST is not set
> CONFIG_DEBUG_OBJECTS_FREE=y
> # CONFIG_DEBUG_OBJECTS_TIMERS is not set
> # CONFIG_DEBUG_OBJECTS_WORK is not set
> # CONFIG_DEBUG_OBJECTS_RCU_HEAD is not set
> # CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER is not set
> CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
> # CONFIG_SLUB_STATS is not set
> CONFIG_HAVE_DEBUG_KMEMLEAK=y
> # CONFIG_DEBUG_KMEMLEAK is not set
> # CONFIG_DEBUG_PREEMPT is not set
> CONFIG_DEBUG_RT_MUTEXES=y
> CONFIG_DEBUG_PI_LIST=y
> CONFIG_RT_MUTEX_TESTER=y
> CONFIG_DEBUG_SPINLOCK=y
> CONFIG_DEBUG_MUTEXES=y
> CONFIG_DEBUG_LOCK_ALLOC=y
> CONFIG_PROVE_LOCKING=y
> CONFIG_PROVE_RCU=y
> # CONFIG_PROVE_RCU_REPEATEDLY is not set
> CONFIG_PROVE_RCU_DELAY=y
> CONFIG_SPARSE_RCU_POINTER=y
> CONFIG_LOCKDEP=y
> CONFIG_LOCK_STAT=y
> CONFIG_DEBUG_LOCKDEP=y
> CONFIG_TRACE_IRQFLAGS=y
> CONFIG_DEBUG_ATOMIC_SLEEP=y
> CONFIG_DEBUG_LOCKING_API_SELFTESTS=y
> CONFIG_STACKTRACE=y
> # CONFIG_DEBUG_STACK_USAGE is not set
> CONFIG_DEBUG_KOBJECT=y
> # CONFIG_DEBUG_BUGVERBOSE is not set
> # CONFIG_DEBUG_INFO is not set
> # CONFIG_DEBUG_VM is not set
> CONFIG_DEBUG_VIRTUAL=y
> CONFIG_DEBUG_WRITECOUNT=y
> # CONFIG_DEBUG_MEMORY_INIT is not set
> CONFIG_DEBUG_LIST=y
> CONFIG_TEST_LIST_SORT=y
> # CONFIG_DEBUG_SG is not set
> # CONFIG_DEBUG_NOTIFIERS is not set
> CONFIG_DEBUG_CREDENTIALS=y
> CONFIG_ARCH_WANT_FRAME_POINTERS=y
> CONFIG_FRAME_POINTER=y
> # CONFIG_RCU_TORTURE_TEST is not set
> # CONFIG_RCU_TRACE is not set
> CONFIG_KPROBES_SANITY_TEST=y
> CONFIG_BACKTRACE_SELF_TEST=m
> CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
> CONFIG_NOTIFIER_ERROR_INJECTION=m
> # CONFIG_PM_NOTIFIER_ERROR_INJECT is not set
> # CONFIG_FAULT_INJECTION is not set
> CONFIG_USER_STACKTRACE_SUPPORT=y
> CONFIG_HAVE_FUNCTION_TRACER=y
> CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
> CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
> CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
> CONFIG_HAVE_DYNAMIC_FTRACE=y
> CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
> CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
> CONFIG_HAVE_FENTRY=y
> CONFIG_HAVE_C_RECORDMCOUNT=y
> CONFIG_TRACING_SUPPORT=y
> # CONFIG_FTRACE is not set
> # CONFIG_RBTREE_TEST is not set
> # CONFIG_INTERVAL_TREE_TEST is not set
> # CONFIG_DMA_API_DEBUG is not set
> # CONFIG_ATOMIC64_SELFTEST is not set
> # CONFIG_SAMPLES is not set
> CONFIG_HAVE_ARCH_KGDB=y
> # CONFIG_KGDB is not set
> CONFIG_HAVE_ARCH_KMEMCHECK=y
> CONFIG_KMEMCHECK=y
> # CONFIG_KMEMCHECK_DISABLED_BY_DEFAULT is not set
> # CONFIG_KMEMCHECK_ENABLED_BY_DEFAULT is not set
> CONFIG_KMEMCHECK_ONESHOT_BY_DEFAULT=y
> CONFIG_KMEMCHECK_QUEUE_SIZE=64
> CONFIG_KMEMCHECK_SHADOW_COPY_SHIFT=5
> CONFIG_KMEMCHECK_PARTIAL_OK=y
> CONFIG_KMEMCHECK_BITOPS_OK=y
> # CONFIG_TEST_KSTRTOX is not set
> # CONFIG_STRICT_DEVMEM is not set
> CONFIG_X86_VERBOSE_BOOTUP=y
> CONFIG_EARLY_PRINTK=y
> CONFIG_DEBUG_STACKOVERFLOW=y
> CONFIG_X86_PTDUMP=y
> CONFIG_DEBUG_RODATA=y
> # CONFIG_DEBUG_RODATA_TEST is not set
> CONFIG_DEBUG_SET_MODULE_RONX=y
> # CONFIG_DEBUG_NX_TEST is not set
> # CONFIG_DEBUG_TLBFLUSH is not set
> CONFIG_IOMMU_STRESS=y
> CONFIG_HAVE_MMIOTRACE_SUPPORT=y
> # CONFIG_X86_DECODER_SELFTEST is not set
> CONFIG_IO_DELAY_TYPE_0X80=0
> CONFIG_IO_DELAY_TYPE_0XED=1
> CONFIG_IO_DELAY_TYPE_UDELAY=2
> CONFIG_IO_DELAY_TYPE_NONE=3
> # CONFIG_IO_DELAY_0X80 is not set
> # CONFIG_IO_DELAY_0XED is not set
> # CONFIG_IO_DELAY_UDELAY is not set
> CONFIG_IO_DELAY_NONE=y
> CONFIG_DEFAULT_IO_DELAY_TYPE=3
> # CONFIG_DEBUG_BOOT_PARAMS is not set
> CONFIG_CPA_DEBUG=y
> # CONFIG_OPTIMIZE_INLINING is not set
> # CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
> # CONFIG_DEBUG_NMI_SELFTEST is not set
> 
> #
> # Security options
> #
> CONFIG_KEYS=y
> # CONFIG_ENCRYPTED_KEYS is not set
> CONFIG_KEYS_DEBUG_PROC_KEYS=y
> CONFIG_SECURITY_DMESG_RESTRICT=y
> CONFIG_SECURITY=y
> CONFIG_SECURITYFS=y
> CONFIG_SECURITY_NETWORK=y
> CONFIG_SECURITY_PATH=y
> CONFIG_SECURITY_YAMA=y
> # CONFIG_SECURITY_YAMA_STACKED is not set
> # CONFIG_IMA is not set
> # CONFIG_EVM is not set
> CONFIG_DEFAULT_SECURITY_YAMA=y
> # CONFIG_DEFAULT_SECURITY_DAC is not set
> CONFIG_DEFAULT_SECURITY="yama"
> CONFIG_CRYPTO=y
> 
> #
> # Crypto core or helper
> #
> # CONFIG_CRYPTO_FIPS is not set
> CONFIG_CRYPTO_ALGAPI=y
> CONFIG_CRYPTO_ALGAPI2=y
> CONFIG_CRYPTO_AEAD=m
> CONFIG_CRYPTO_AEAD2=y
> CONFIG_CRYPTO_BLKCIPHER=m
> CONFIG_CRYPTO_BLKCIPHER2=y
> CONFIG_CRYPTO_HASH=y
> CONFIG_CRYPTO_HASH2=y
> CONFIG_CRYPTO_RNG=m
> CONFIG_CRYPTO_RNG2=y
> CONFIG_CRYPTO_PCOMP=m
> CONFIG_CRYPTO_PCOMP2=y
> CONFIG_CRYPTO_MANAGER=m
> CONFIG_CRYPTO_MANAGER2=y
> # CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
> CONFIG_CRYPTO_GF128MUL=m
> CONFIG_CRYPTO_NULL=m
> CONFIG_CRYPTO_WORKQUEUE=y
> CONFIG_CRYPTO_CRYPTD=m
> CONFIG_CRYPTO_AUTHENC=m
> CONFIG_CRYPTO_TEST=m
> CONFIG_CRYPTO_ABLK_HELPER_X86=m
> CONFIG_CRYPTO_GLUE_HELPER_X86=m
> 
> #
> # Authenticated Encryption with Associated Data
> #
> # CONFIG_CRYPTO_CCM is not set
> # CONFIG_CRYPTO_GCM is not set
> CONFIG_CRYPTO_SEQIV=m
> 
> #
> # Block modes
> #
> CONFIG_CRYPTO_CBC=m
> CONFIG_CRYPTO_CTR=m
> CONFIG_CRYPTO_CTS=m
> CONFIG_CRYPTO_ECB=m
> CONFIG_CRYPTO_LRW=m
> CONFIG_CRYPTO_PCBC=m
> CONFIG_CRYPTO_XTS=m
> 
> #
> # Hash modes
> #
> # CONFIG_CRYPTO_HMAC is not set
> # CONFIG_CRYPTO_XCBC is not set
> # CONFIG_CRYPTO_VMAC is not set
> 
> #
> # Digest
> #
> # CONFIG_CRYPTO_CRC32C is not set
> CONFIG_CRYPTO_CRC32C_X86_64=y
> CONFIG_CRYPTO_CRC32C_INTEL=m
> # CONFIG_CRYPTO_GHASH is not set
> # CONFIG_CRYPTO_MD4 is not set
> # CONFIG_CRYPTO_MD5 is not set
> # CONFIG_CRYPTO_MICHAEL_MIC is not set
> # CONFIG_CRYPTO_RMD128 is not set
> # CONFIG_CRYPTO_RMD160 is not set
> CONFIG_CRYPTO_RMD256=m
> CONFIG_CRYPTO_RMD320=m
> # CONFIG_CRYPTO_SHA1 is not set
> # CONFIG_CRYPTO_SHA1_SSSE3 is not set
> CONFIG_CRYPTO_SHA256=y
> # CONFIG_CRYPTO_SHA512 is not set
> # CONFIG_CRYPTO_TGR192 is not set
> CONFIG_CRYPTO_WP512=m
> CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=m
> 
> #
> # Ciphers
> #
> CONFIG_CRYPTO_AES=m
> CONFIG_CRYPTO_AES_X86_64=m
> # CONFIG_CRYPTO_AES_NI_INTEL is not set
> CONFIG_CRYPTO_ANUBIS=m
> CONFIG_CRYPTO_ARC4=m
> # CONFIG_CRYPTO_BLOWFISH is not set
> # CONFIG_CRYPTO_BLOWFISH_X86_64 is not set
> # CONFIG_CRYPTO_CAMELLIA is not set
> CONFIG_CRYPTO_CAMELLIA_X86_64=m
> CONFIG_CRYPTO_CAST5=m
> CONFIG_CRYPTO_CAST5_AVX_X86_64=m
> CONFIG_CRYPTO_CAST6=m
> CONFIG_CRYPTO_CAST6_AVX_X86_64=m
> CONFIG_CRYPTO_DES=m
> # CONFIG_CRYPTO_FCRYPT is not set
> CONFIG_CRYPTO_KHAZAD=m
> CONFIG_CRYPTO_SALSA20=m
> # CONFIG_CRYPTO_SALSA20_X86_64 is not set
> CONFIG_CRYPTO_SEED=m
> CONFIG_CRYPTO_SERPENT=m
> CONFIG_CRYPTO_SERPENT_SSE2_X86_64=m
> CONFIG_CRYPTO_SERPENT_AVX_X86_64=m
> # CONFIG_CRYPTO_TEA is not set
> CONFIG_CRYPTO_TWOFISH=m
> CONFIG_CRYPTO_TWOFISH_COMMON=m
> CONFIG_CRYPTO_TWOFISH_X86_64=m
> CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=m
> CONFIG_CRYPTO_TWOFISH_AVX_X86_64=m
> 
> #
> # Compression
> #
> CONFIG_CRYPTO_DEFLATE=m
> CONFIG_CRYPTO_ZLIB=m
> CONFIG_CRYPTO_LZO=m
> 
> #
> # Random Number Generation
> #
> CONFIG_CRYPTO_ANSI_CPRNG=m
> # CONFIG_CRYPTO_HW is not set
> CONFIG_ASYMMETRIC_KEY_TYPE=y
> CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
> CONFIG_PUBLIC_KEY_ALGO_RSA=y
> CONFIG_X509_CERTIFICATE_PARSER=y
> CONFIG_HAVE_KVM=y
> CONFIG_VIRTUALIZATION=y
> # CONFIG_BINARY_PRINTF is not set
> 
> #
> # Library routines
> #
> CONFIG_BITREVERSE=m
> CONFIG_GENERIC_STRNCPY_FROM_USER=y
> CONFIG_GENERIC_STRNLEN_USER=y
> CONFIG_GENERIC_FIND_FIRST_BIT=y
> CONFIG_GENERIC_PCI_IOMAP=y
> CONFIG_GENERIC_IOMAP=y
> CONFIG_GENERIC_IO=y
> # CONFIG_CRC_CCITT is not set
> # CONFIG_CRC16 is not set
> CONFIG_CRC_T10DIF=m
> CONFIG_CRC_ITU_T=m
> CONFIG_CRC32=m
> CONFIG_CRC32_SELFTEST=y
> # CONFIG_CRC32_SLICEBY8 is not set
> # CONFIG_CRC32_SLICEBY4 is not set
> # CONFIG_CRC32_SARWATE is not set
> CONFIG_CRC32_BIT=y
> CONFIG_CRC7=m
> # CONFIG_LIBCRC32C is not set
> # CONFIG_CRC8 is not set
> CONFIG_ZLIB_INFLATE=m
> CONFIG_ZLIB_DEFLATE=m
> CONFIG_LZO_COMPRESS=y
> CONFIG_LZO_DECOMPRESS=y
> # CONFIG_XZ_DEC is not set
> # CONFIG_XZ_DEC_BCJ is not set
> CONFIG_HAS_IOMEM=y
> CONFIG_HAS_IOPORT=y
> CONFIG_HAS_DMA=y
> CONFIG_NLATTR=y
> CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
> CONFIG_AVERAGE=y
> CONFIG_CLZ_TAB=y
> CONFIG_CORDIC=m
> # CONFIG_DDR is not set
> CONFIG_MPILIB=y
> CONFIG_OID_REGISTRY=y


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 22:06:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 22:06:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU2tU-00017F-2A; Thu, 01 Nov 2012 22:05:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TU2tS-000179-7I
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 22:05:42 +0000
Received: from [85.158.143.99:37921] by server-3.bemta-4.messagelabs.com id
	1E/46-06841-532F2905; Thu, 01 Nov 2012 22:05:41 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1351807539!23033040!1
X-Originating-IP: [141.146.126.227]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuMjI3ID0+IDgzOTM3MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25339 invoked from network); 1 Nov 2012 22:05:40 -0000
Received: from acsinet15.oracle.com (HELO acsinet15.oracle.com)
	(141.146.126.227)
	by server-12.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 22:05:40 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA1M5Qm3030384
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 1 Nov 2012 22:05:27 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA1M5PU6029933
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 1 Nov 2012 22:05:25 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA1M5OJc007089; Thu, 1 Nov 2012 17:05:24 -0500
Received: from localhost.localdomain (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 01 Nov 2012 15:05:23 -0700
Date: Thu, 1 Nov 2012 18:05:20 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <jbeulich@suse.com>
Message-ID: <20121101220520.GC18854@localhost.localdomain>
References: <alpine.DEB.2.00.1210312239120.31758@chino.kir.corp.google.com>
	<20121101124912.GA10743@localhost.localdomain>
	<5092D5EA020000780008EB85@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5092D5EA020000780008EB85@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: jeremy@goop.org, xen-devel@lists.xensource.com, hpa@zytor.com,
	x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com,
	rientjes@google.com, tglx@linutronix.de, torvalds@linux-foundation.org
Subject: Re: [Xen-devel] [patch] x86,
 xen: fix build dependency when USB_SUPPORT is not enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 01, 2012 at 08:04:58PM +0000, Jan Beulich wrote:
> >>> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> 11/01/12 1:49 PM >>>
> >On Wed, Oct 31, 2012 at 10:42:30PM -0700, David Rientjes wrote:
> >> CONFIG_XEN_DOM0 must depend on CONFIG_USB_SUPPORT, otherwise there is no 
> >> definition of xen_dbgp_reset_prep() and xen_dbgp_external_startup() 
> >> resulting in the following link error:
> >> 
> >> drivers/built-in.o: In function `dbgp_reset_prep':
> >> (.text+0x1e03c5): undefined reference to `xen_dbgp_reset_prep'
> >> drivers/built-in.o: In function `dbgp_external_startup':
> >> (.text+0x1e0d55): undefined reference to `xen_dbgp_external_startup'
> >
> >There is another patch that needs to be Acked and picked up by
> >Greg KH that fixes this.
> >
> >Let me poke Jan Beulich to repost it with the appropiate Acks.
> 
> It's been picked up already, but another dependency problem was found with
> it (due to not having used CONFIG_USB_SUPPORT as dependency, as I had
> first submitted).

Oh. I missed that part - so do you think that this patch should also
be used? Or do you think there is another way to fix this?

I am in transit right now so I can't prep a patch (and the laptop I've
is extremely slow to even do a test compile).
> 
> Jan
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 22:06:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 22:06:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU2tU-00017F-2A; Thu, 01 Nov 2012 22:05:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TU2tS-000179-7I
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 22:05:42 +0000
Received: from [85.158.143.99:37921] by server-3.bemta-4.messagelabs.com id
	1E/46-06841-532F2905; Thu, 01 Nov 2012 22:05:41 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1351807539!23033040!1
X-Originating-IP: [141.146.126.227]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuMjI3ID0+IDgzOTM3MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25339 invoked from network); 1 Nov 2012 22:05:40 -0000
Received: from acsinet15.oracle.com (HELO acsinet15.oracle.com)
	(141.146.126.227)
	by server-12.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 1 Nov 2012 22:05:40 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA1M5Qm3030384
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 1 Nov 2012 22:05:27 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA1M5PU6029933
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 1 Nov 2012 22:05:25 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA1M5OJc007089; Thu, 1 Nov 2012 17:05:24 -0500
Received: from localhost.localdomain (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 01 Nov 2012 15:05:23 -0700
Date: Thu, 1 Nov 2012 18:05:20 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <jbeulich@suse.com>
Message-ID: <20121101220520.GC18854@localhost.localdomain>
References: <alpine.DEB.2.00.1210312239120.31758@chino.kir.corp.google.com>
	<20121101124912.GA10743@localhost.localdomain>
	<5092D5EA020000780008EB85@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5092D5EA020000780008EB85@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: jeremy@goop.org, xen-devel@lists.xensource.com, hpa@zytor.com,
	x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com,
	rientjes@google.com, tglx@linutronix.de, torvalds@linux-foundation.org
Subject: Re: [Xen-devel] [patch] x86,
 xen: fix build dependency when USB_SUPPORT is not enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 01, 2012 at 08:04:58PM +0000, Jan Beulich wrote:
> >>> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> 11/01/12 1:49 PM >>>
> >On Wed, Oct 31, 2012 at 10:42:30PM -0700, David Rientjes wrote:
> >> CONFIG_XEN_DOM0 must depend on CONFIG_USB_SUPPORT, otherwise there is no 
> >> definition of xen_dbgp_reset_prep() and xen_dbgp_external_startup() 
> >> resulting in the following link error:
> >> 
> >> drivers/built-in.o: In function `dbgp_reset_prep':
> >> (.text+0x1e03c5): undefined reference to `xen_dbgp_reset_prep'
> >> drivers/built-in.o: In function `dbgp_external_startup':
> >> (.text+0x1e0d55): undefined reference to `xen_dbgp_external_startup'
> >
> >There is another patch that needs to be Acked and picked up by
> >Greg KH that fixes this.
> >
> >Let me poke Jan Beulich to repost it with the appropiate Acks.
> 
> It's been picked up already, but another dependency problem was found with
> it (due to not having used CONFIG_USB_SUPPORT as dependency, as I had
> first submitted).

Oh. I missed that part - so do you think that this patch should also
be used? Or do you think there is another way to fix this?

I am in transit right now so I can't prep a patch (and the laptop I've
is extremely slow to even do a test compile).
> 
> Jan
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 22:30:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 22:30:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU3HN-0001aV-6H; Thu, 01 Nov 2012 22:30:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rientjes@google.com>) id 1TU3HL-0001aI-E4
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 22:30:23 +0000
Received: from [85.158.139.211:15564] by server-9.bemta-5.messagelabs.com id
	5F/7A-29295-EF7F2905; Thu, 01 Nov 2012 22:30:22 +0000
X-Env-Sender: rientjes@google.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1351809019!18582829!1
X-Originating-IP: [209.85.160.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15453 invoked from network); 1 Nov 2012 22:30:21 -0000
Received: from mail-pb0-f43.google.com (HELO mail-pb0-f43.google.com)
	(209.85.160.43)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 22:30:21 -0000
Received: by mail-pb0-f43.google.com with SMTP id jt11so2189569pbb.30
	for <xen-devel@lists.xensource.com>;
	Thu, 01 Nov 2012 15:30:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113;
	h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id
	:references:user-agent:mime-version:content-type;
	bh=qhYR0r0It3yNiyLzq7XAx987leLqexmGOf821yh1jWo=;
	b=Ab8RtbYsJKQcc9ZPva9LXyX3LocvnhZVGh5OwY8z0tsT1G6icLCntAypR2SrHemVFj
	pYJco2KO1G7fsD9MT3h8Ra9FOEsl1JZmM2/w9Fwg46QioRVw+kJbqJvA7mY0Wt19zdqV
	UdrTl/9RK6Ms2KEN+622CEKtwhS/ZcdNQ2SMXdXgJJEjGHgud+PVajDrfDFPDLpMRc8K
	iprFmmYZuTnt4Fpacn9mGKjjUzqVzaUYaLFtQwOc3ZHyQ4xC9jdKbTXrJUK05b4pGCt0
	gIRG4z+Y3lC+BYZVZnCWW1mb24kNJPdu9xEDJ690s9LwQcDbDRl5sI0u8G+zZgY+9Hr3
	kyKg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id
	:references:user-agent:mime-version:content-type:x-gm-message-state;
	bh=qhYR0r0It3yNiyLzq7XAx987leLqexmGOf821yh1jWo=;
	b=L79TaqgkmNVG+GGDjYJIxfZqwyJZ6K2LPoRFF7+o8RoknCUaSBMWal7272w0Dlogly
	UiaTuzblx/B4l7N+rQqsFIH/orcWNgp55l6SdhnoTGFJFEcK2ci1nMakxzUuca/7BQLC
	Qm7DfpZ1VlwjOW1edxhApaUDL+vDOmH5rT3jYjgqqbkOBMJj2KX7Os3hJXUd/iOD+4Fy
	zvdFyYmvfHAC8DiUujcgq1LAkTJn1IzPm6jjcoy4eAMw1SZGhw1aAMsek9B9m+SPHrmb
	uVjIUbuSWExcHdZgcV0GytuHxhTV/tLnS+qYnMTrcNUFh5NRN7q+Z+XW3o/TGEcal4by
	/JVA==
Received: by 10.66.90.73 with SMTP id bu9mr115115399pab.71.1351809019282;
	Thu, 01 Nov 2012 15:30:19 -0700 (PDT)
Received: from [2620:0:1008:1101:be30:5bff:fed8:5e64]
	([2620:0:1008:1101:be30:5bff:fed8:5e64])
	by mx.google.com with ESMTPS id vo8sm4649016pbc.16.2012.11.01.15.30.18
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 01 Nov 2012 15:30:18 -0700 (PDT)
Date: Thu, 1 Nov 2012 15:30:17 -0700 (PDT)
From: David Rientjes <rientjes@google.com>
X-X-Sender: rientjes@chino.kir.corp.google.com
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
In-Reply-To: <20121101220520.GC18854@localhost.localdomain>
Message-ID: <alpine.DEB.2.00.1211011527541.26123@chino.kir.corp.google.com>
References: <alpine.DEB.2.00.1210312239120.31758@chino.kir.corp.google.com>
	<20121101124912.GA10743@localhost.localdomain>
	<5092D5EA020000780008EB85@nat28.tlf.novell.com>
	<20121101220520.GC18854@localhost.localdomain>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
MIME-Version: 1.0
X-Gm-Message-State: ALoCoQke22CHHX+966loqCEjFH3MlHVC7e4xfhvHNlNlK74JCdFta6CecO1TmEWO0SRDUQU+8D9LKjYZOZ2pO/sXKxPWpgKNvRw1R1RE42az30a6zkDwQOMi5rE9+TDKF5bleLQyc7inJzj38nKa8RqC+zu9/lDof3+5qvoXj6b3CdOtFzaiCDQ2OV0F2JwXaWB9FujgvMnPlurbhQEpcRAEfa8N2vqYDw==
Cc: jeremy@goop.org, xen-devel@lists.xensource.com, x86@kernel.org,
	linux-kernel@vger.kernel.org, mingo@redhat.com,
	Jan Beulich <jbeulich@suse.com>, hpa@zytor.com,
	tglx@linutronix.de, torvalds@linux-foundation.org
Subject: Re: [Xen-devel] [patch] x86,
 xen: fix build dependency when USB_SUPPORT is not enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 1 Nov 2012, Konrad Rzeszutek Wilk wrote:

> Oh. I missed that part - so do you think that this patch should also
> be used? Or do you think there is another way to fix this?
> 

Appears to be fixed by d99e65bda806 ("USB: fix build with XEN and 
EARLY_PRINTK_DBGP enabled but USB_SUPPORT disabled") as of this morning's 
tree which relies on CONFIG_USB, which effectively requires 
CONFIG_USB_SUPPORT that this patch provides, so feel free to drop mine.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 22:30:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 22:30:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU3HN-0001aV-6H; Thu, 01 Nov 2012 22:30:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rientjes@google.com>) id 1TU3HL-0001aI-E4
	for xen-devel@lists.xensource.com; Thu, 01 Nov 2012 22:30:23 +0000
Received: from [85.158.139.211:15564] by server-9.bemta-5.messagelabs.com id
	5F/7A-29295-EF7F2905; Thu, 01 Nov 2012 22:30:22 +0000
X-Env-Sender: rientjes@google.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1351809019!18582829!1
X-Originating-IP: [209.85.160.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15453 invoked from network); 1 Nov 2012 22:30:21 -0000
Received: from mail-pb0-f43.google.com (HELO mail-pb0-f43.google.com)
	(209.85.160.43)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	1 Nov 2012 22:30:21 -0000
Received: by mail-pb0-f43.google.com with SMTP id jt11so2189569pbb.30
	for <xen-devel@lists.xensource.com>;
	Thu, 01 Nov 2012 15:30:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113;
	h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id
	:references:user-agent:mime-version:content-type;
	bh=qhYR0r0It3yNiyLzq7XAx987leLqexmGOf821yh1jWo=;
	b=Ab8RtbYsJKQcc9ZPva9LXyX3LocvnhZVGh5OwY8z0tsT1G6icLCntAypR2SrHemVFj
	pYJco2KO1G7fsD9MT3h8Ra9FOEsl1JZmM2/w9Fwg46QioRVw+kJbqJvA7mY0Wt19zdqV
	UdrTl/9RK6Ms2KEN+622CEKtwhS/ZcdNQ2SMXdXgJJEjGHgud+PVajDrfDFPDLpMRc8K
	iprFmmYZuTnt4Fpacn9mGKjjUzqVzaUYaLFtQwOc3ZHyQ4xC9jdKbTXrJUK05b4pGCt0
	gIRG4z+Y3lC+BYZVZnCWW1mb24kNJPdu9xEDJ690s9LwQcDbDRl5sI0u8G+zZgY+9Hr3
	kyKg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id
	:references:user-agent:mime-version:content-type:x-gm-message-state;
	bh=qhYR0r0It3yNiyLzq7XAx987leLqexmGOf821yh1jWo=;
	b=L79TaqgkmNVG+GGDjYJIxfZqwyJZ6K2LPoRFF7+o8RoknCUaSBMWal7272w0Dlogly
	UiaTuzblx/B4l7N+rQqsFIH/orcWNgp55l6SdhnoTGFJFEcK2ci1nMakxzUuca/7BQLC
	Qm7DfpZ1VlwjOW1edxhApaUDL+vDOmH5rT3jYjgqqbkOBMJj2KX7Os3hJXUd/iOD+4Fy
	zvdFyYmvfHAC8DiUujcgq1LAkTJn1IzPm6jjcoy4eAMw1SZGhw1aAMsek9B9m+SPHrmb
	uVjIUbuSWExcHdZgcV0GytuHxhTV/tLnS+qYnMTrcNUFh5NRN7q+Z+XW3o/TGEcal4by
	/JVA==
Received: by 10.66.90.73 with SMTP id bu9mr115115399pab.71.1351809019282;
	Thu, 01 Nov 2012 15:30:19 -0700 (PDT)
Received: from [2620:0:1008:1101:be30:5bff:fed8:5e64]
	([2620:0:1008:1101:be30:5bff:fed8:5e64])
	by mx.google.com with ESMTPS id vo8sm4649016pbc.16.2012.11.01.15.30.18
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 01 Nov 2012 15:30:18 -0700 (PDT)
Date: Thu, 1 Nov 2012 15:30:17 -0700 (PDT)
From: David Rientjes <rientjes@google.com>
X-X-Sender: rientjes@chino.kir.corp.google.com
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
In-Reply-To: <20121101220520.GC18854@localhost.localdomain>
Message-ID: <alpine.DEB.2.00.1211011527541.26123@chino.kir.corp.google.com>
References: <alpine.DEB.2.00.1210312239120.31758@chino.kir.corp.google.com>
	<20121101124912.GA10743@localhost.localdomain>
	<5092D5EA020000780008EB85@nat28.tlf.novell.com>
	<20121101220520.GC18854@localhost.localdomain>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
MIME-Version: 1.0
X-Gm-Message-State: ALoCoQke22CHHX+966loqCEjFH3MlHVC7e4xfhvHNlNlK74JCdFta6CecO1TmEWO0SRDUQU+8D9LKjYZOZ2pO/sXKxPWpgKNvRw1R1RE42az30a6zkDwQOMi5rE9+TDKF5bleLQyc7inJzj38nKa8RqC+zu9/lDof3+5qvoXj6b3CdOtFzaiCDQ2OV0F2JwXaWB9FujgvMnPlurbhQEpcRAEfa8N2vqYDw==
Cc: jeremy@goop.org, xen-devel@lists.xensource.com, x86@kernel.org,
	linux-kernel@vger.kernel.org, mingo@redhat.com,
	Jan Beulich <jbeulich@suse.com>, hpa@zytor.com,
	tglx@linutronix.de, torvalds@linux-foundation.org
Subject: Re: [Xen-devel] [patch] x86,
 xen: fix build dependency when USB_SUPPORT is not enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 1 Nov 2012, Konrad Rzeszutek Wilk wrote:

> Oh. I missed that part - so do you think that this patch should also
> be used? Or do you think there is another way to fix this?
> 

Appears to be fixed by d99e65bda806 ("USB: fix build with XEN and 
EARLY_PRINTK_DBGP enabled but USB_SUPPORT disabled") as of this morning's 
tree which relies on CONFIG_USB, which effectively requires 
CONFIG_USB_SUPPORT that this patch provides, so feel free to drop mine.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 22:33:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 22:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU3KA-0001jq-Ow; Thu, 01 Nov 2012 22:33:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <osp@andrep.de>) id 1TU2U4-0000HA-8U
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 21:39:28 +0000
Received: from [85.158.139.211:6924] by server-16.bemta-5.messagelabs.com id
	F6/6F-04786-F0CE2905; Thu, 01 Nov 2012 21:39:27 +0000
X-Env-Sender: osp@andrep.de
X-Msg-Ref: server-5.tower-206.messagelabs.com!1351805953!18487074!1
X-Originating-IP: [217.160.17.100]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27982 invoked from network); 1 Nov 2012 21:39:16 -0000
Received: from s15333296.onlinehome-server.info (HELO
	s15333296.onlinehome-server.info) (217.160.17.100)
	by server-5.tower-206.messagelabs.com with SMTP;
	1 Nov 2012 21:39:16 -0000
Received: from localhost.localdomain (g227155030.adsl.alicedsl.de
	[92.227.155.30])
	by s15333296.onlinehome-server.info (Postfix) with ESMTPSA id
	96C1F84080A9; Thu,  1 Nov 2012 22:39:12 +0100 (CET)
From: Andre Przywara <osp@andrep.de>
To: Ian.Jackson@eu.citrix.com, ian.campbell@citrix.com,
	stefano.stabellini@eu.citrix.com, keir@xen.org, jbeulich@suse.com
Date: Thu,  1 Nov 2012 22:40:57 +0100
Message-Id: <1351806057-3167-1-git-send-email-osp@andrep.de>
X-Mailer: git-send-email 1.7.1
X-Mailman-Approved-At: Thu, 01 Nov 2012 22:33:18 +0000
Cc: Andre Przywara <osp@andrep.de>, boris.ostrovsky@amd.com, wei.huang2@amd.com,
	Christoph_Egger@gmx.de, xen-devel@lists.xen.org, weiwang.dd@gmail.com
Subject: [Xen-devel] [PATCH] update MAINTAINERS file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

There have been some "organizational changes" within AMD.
Update the MAINTAINERS file accordingly.
Please also feel free to use the new email addresses if there are
any inquires related to code authored by Wei Wang, Christoph Egger
or Andre Przywara.

Signed-off-by: Andre Przywara <osp@andrep.de>
Acked-by: Wei Wang <weiwang.dd@gmail.com>
Acked-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Acked-by: Wei Huang <wei.huang2@amd.com>
Acked-by: Christoph Egger <Christoph_Egger@gmx.de>
---
 MAINTAINERS | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 2d8517b..1c595f4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -78,7 +78,6 @@ Maintainers List (try to look for most precise areas first)
 ACPI & POWER MANAGEMENT
 M:	Winston Wang <winston.l.wang@intel.com>
 M:	Gang Wei <gang.wei@intel.com>
-M:	Mark Langsdorf <mark.langsdorf@amd.com>
 M:	Jan Beulich <jbeulich@suse.com>
 S:	Supported
 F:	xen/arch/x86/acpi/
@@ -86,13 +85,15 @@ F:	xen/drivers/acpi/
 F:	xen/drivers/cpufreq/
 
 AMD IOMMU
-M:	Wei Wang <wei.wang2@amd.com>
-S:	Supported
+M:	Wei Wang <weiwang.dd@gmail.com>
+M:	Wei Huang <wei.huang2@amd.com>
+S:	Maintained
 F:	xen/drivers/passthrough/amd/
 
 AMD SVM
-M:	Andre Przywara <andre.przywara@amd.com>
-M:	Christoph Egger <christoph.egger@amd.com>
+M:	Andre Przywara <osp@andrep.de>
+M:	Christoph Egger <Christoph_Egger@gmx.de>
+M:	Boris Ostrovsky <boris.ostrovsky@amd.com>
 M:	Wei Huang <wei.huang2@amd.com>
 S:	Supported
 F:	xen/arch/x86/hvm/svm/
@@ -170,7 +171,7 @@ S:	Supported
 T:	hg http://xenbits.xen.org/XCP/linux-2.6.*.pq.hg
 
 MACHINE CHECK (MCA) & RAS
-M:	Christoph Egger <christoph.egger@amd.com>
+M:	Christoph Egger <Christoph_Egger@gmx.de>
 M:	Yunhong Jiang <yunhong.jiang@intel.com>
 S:	Supported
 F:	xen/arch/x86/cpu/mcheck/
-- 
1.7.12.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 01 22:33:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Nov 2012 22:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU3KA-0001jq-Ow; Thu, 01 Nov 2012 22:33:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <osp@andrep.de>) id 1TU2U4-0000HA-8U
	for xen-devel@lists.xen.org; Thu, 01 Nov 2012 21:39:28 +0000
Received: from [85.158.139.211:6924] by server-16.bemta-5.messagelabs.com id
	F6/6F-04786-F0CE2905; Thu, 01 Nov 2012 21:39:27 +0000
X-Env-Sender: osp@andrep.de
X-Msg-Ref: server-5.tower-206.messagelabs.com!1351805953!18487074!1
X-Originating-IP: [217.160.17.100]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27982 invoked from network); 1 Nov 2012 21:39:16 -0000
Received: from s15333296.onlinehome-server.info (HELO
	s15333296.onlinehome-server.info) (217.160.17.100)
	by server-5.tower-206.messagelabs.com with SMTP;
	1 Nov 2012 21:39:16 -0000
Received: from localhost.localdomain (g227155030.adsl.alicedsl.de
	[92.227.155.30])
	by s15333296.onlinehome-server.info (Postfix) with ESMTPSA id
	96C1F84080A9; Thu,  1 Nov 2012 22:39:12 +0100 (CET)
From: Andre Przywara <osp@andrep.de>
To: Ian.Jackson@eu.citrix.com, ian.campbell@citrix.com,
	stefano.stabellini@eu.citrix.com, keir@xen.org, jbeulich@suse.com
Date: Thu,  1 Nov 2012 22:40:57 +0100
Message-Id: <1351806057-3167-1-git-send-email-osp@andrep.de>
X-Mailer: git-send-email 1.7.1
X-Mailman-Approved-At: Thu, 01 Nov 2012 22:33:18 +0000
Cc: Andre Przywara <osp@andrep.de>, boris.ostrovsky@amd.com, wei.huang2@amd.com,
	Christoph_Egger@gmx.de, xen-devel@lists.xen.org, weiwang.dd@gmail.com
Subject: [Xen-devel] [PATCH] update MAINTAINERS file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

There have been some "organizational changes" within AMD.
Update the MAINTAINERS file accordingly.
Please also feel free to use the new email addresses if there are
any inquires related to code authored by Wei Wang, Christoph Egger
or Andre Przywara.

Signed-off-by: Andre Przywara <osp@andrep.de>
Acked-by: Wei Wang <weiwang.dd@gmail.com>
Acked-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Acked-by: Wei Huang <wei.huang2@amd.com>
Acked-by: Christoph Egger <Christoph_Egger@gmx.de>
---
 MAINTAINERS | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 2d8517b..1c595f4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -78,7 +78,6 @@ Maintainers List (try to look for most precise areas first)
 ACPI & POWER MANAGEMENT
 M:	Winston Wang <winston.l.wang@intel.com>
 M:	Gang Wei <gang.wei@intel.com>
-M:	Mark Langsdorf <mark.langsdorf@amd.com>
 M:	Jan Beulich <jbeulich@suse.com>
 S:	Supported
 F:	xen/arch/x86/acpi/
@@ -86,13 +85,15 @@ F:	xen/drivers/acpi/
 F:	xen/drivers/cpufreq/
 
 AMD IOMMU
-M:	Wei Wang <wei.wang2@amd.com>
-S:	Supported
+M:	Wei Wang <weiwang.dd@gmail.com>
+M:	Wei Huang <wei.huang2@amd.com>
+S:	Maintained
 F:	xen/drivers/passthrough/amd/
 
 AMD SVM
-M:	Andre Przywara <andre.przywara@amd.com>
-M:	Christoph Egger <christoph.egger@amd.com>
+M:	Andre Przywara <osp@andrep.de>
+M:	Christoph Egger <Christoph_Egger@gmx.de>
+M:	Boris Ostrovsky <boris.ostrovsky@amd.com>
 M:	Wei Huang <wei.huang2@amd.com>
 S:	Supported
 F:	xen/arch/x86/hvm/svm/
@@ -170,7 +171,7 @@ S:	Supported
 T:	hg http://xenbits.xen.org/XCP/linux-2.6.*.pq.hg
 
 MACHINE CHECK (MCA) & RAS
-M:	Christoph Egger <christoph.egger@amd.com>
+M:	Christoph Egger <Christoph_Egger@gmx.de>
 M:	Yunhong Jiang <yunhong.jiang@intel.com>
 S:	Supported
 F:	xen/arch/x86/cpu/mcheck/
-- 
1.7.12.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 02:03:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 02:03:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU6aZ-0004ac-Pq; Fri, 02 Nov 2012 02:02:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <avs.009@gmail.com>) id 1TU6aX-0004aX-GJ
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 02:02:25 +0000
Received: from [85.158.138.51:3029] by server-16.bemta-3.messagelabs.com id
	25/5C-07461-0B923905; Fri, 02 Nov 2012 02:02:24 +0000
X-Env-Sender: avs.009@gmail.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1351821742!28315198!1
X-Originating-IP: [209.85.219.45]
X-SpamReason: No, hits=0.6 required=7.0 tests=HTML_60_70,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23988 invoked from network); 2 Nov 2012 02:02:23 -0000
Received: from mail-oa0-f45.google.com (HELO mail-oa0-f45.google.com)
	(209.85.219.45)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 02:02:23 -0000
Received: by mail-oa0-f45.google.com with SMTP id i18so3890001oag.32
	for <xen-devel@lists.xen.org>; Thu, 01 Nov 2012 19:02:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=euLS2+qA5ai/9UOYf3kvq1voWKYL0OGF8loDxPN3YNs=;
	b=GSj2Wbmk8wH8DtMQh7NfJuXGyqMpWHpyscjCV/m4By3ka+D2IXBPK7Lw7L5nvzr1jN
	4wrLck4WRVG2A71ma/e7901c6ujFNyRzRc5dM8I0TGSXl5ZHk8lDd+6i9im4WDoU0gQT
	E/76eImOmncgx5YL2YVQnVqaVqjz1zgDw/o6/Mq09Jgwj92W7E30o7TqAksTzhsVFp+m
	mpKckwza/qdJT1ulGrtxMRTNtvpD2WIOFf7HUIC+3Zj5AdYk/qKx2G3CpGNqGqWroNIY
	zeQqJBfAUtsMw2fB0XYAfaRBWtvAOlwuG7h+8lY30BINNmIEJVuNZyQoQUEHsRgT7DRi
	nEJQ==
MIME-Version: 1.0
Received: by 10.182.1.72 with SMTP id 8mr195299obk.61.1351821742297; Thu, 01
	Nov 2012 19:02:22 -0700 (PDT)
Received: by 10.60.161.233 with HTTP; Thu, 1 Nov 2012 19:02:22 -0700 (PDT)
In-Reply-To: <383bffd3-c605-449a-8ff3-35eee4e75b48@default>
References: <383bffd3-c605-449a-8ff3-35eee4e75b48@default>
Date: Fri, 2 Nov 2012 00:02:22 -0200
Message-ID: <CANchcZy4Qu54QSRTgg-uyS=u+8vRUsANKPxhg41hMdJDUBCNXw@mail.gmail.com>
From: Allan Scheid <avs.009@gmail.com>
To: Daniel Kiper <daniel.kiper@oracle.com>
Cc: xen-devel@lists.xen.org, JBeulich@suse.com, konrad.wilk@oracle.com
Subject: Re: [Xen-devel] Xen 4.2 with EFI on IBM x3650 ACPI Bug
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8408456622164461522=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============8408456622164461522==
Content-Type: multipart/alternative; boundary=f46d04462fe0bfd2b604cd7986c2

--f46d04462fe0bfd2b604cd7986c2
Content-Type: text/plain; charset=ISO-8859-1

Yes, i typed the e-mail too fast, and not read correct email from Konrad!

2012/10/23 Daniel Kiper <daniel.kiper@oracle.com>

> Hi,
>
> > Thank's Jan and Daniel, i am using now
>
> I think that you meant Konrad because I did not help a lot.
>
> [...]
>
> Daniel

*
*

2012/10/23 Daniel Kiper <daniel.kiper@oracle.com>

> Hi,
>
> > Thank's Jan and Daniel, i am using now
>
> I think that you meant Konrad because I did not help a lot.
>
> [...]
>
> Daniel

--f46d04462fe0bfd2b604cd7986c2
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Yes, i typed the e-mail too fast, and not read correct email from Konrad!<b=
r><br><div class=3D"gmail_quote">2012/10/23 Daniel Kiper=A0<span dir=3D"ltr=
">&lt;<a href=3D"mailto:daniel.kiper@oracle.com" target=3D"_blank">daniel.k=
iper@oracle.com</a>&gt;</span><br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex">Hi,<br><div class=3D"im"><br>&gt; Thank&#39;s Jan and Dani=
el, i am using now<br>
<br></div>I think that you meant Konrad because I did not help a lot.<br><b=
r>[...]<br><span class=3D"HOEnZb"><font color=3D"#888888"><br>Daniel</font>=
</span></blockquote></div><div><span style=3D"font-family:arial,sans-serif;=
font-size:13px;background-color:rgb(255,255,255)"><em><b><br>
</b></em></span></div><br><div class=3D"gmail_quote">2012/10/23 Daniel Kipe=
r <span dir=3D"ltr">&lt;<a href=3D"mailto:daniel.kiper@oracle.com" target=
=3D"_blank">daniel.kiper@oracle.com</a>&gt;</span><br><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex">
Hi,<br>
<div class=3D"im"><br>
&gt; Thank&#39;s Jan and Daniel, i am using now<br>
<br>
</div>I think that you meant Konrad because I did not help a lot.<br>
<br>
[...]<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
Daniel</font></span></blockquote></div>

--f46d04462fe0bfd2b604cd7986c2--


--===============8408456622164461522==
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.xen.org
http://lists.xen.org/xen-devel

--===============8408456622164461522==--


From xen-devel-bounces@lists.xen.org Fri Nov 02 02:03:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 02:03:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU6aZ-0004ac-Pq; Fri, 02 Nov 2012 02:02:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <avs.009@gmail.com>) id 1TU6aX-0004aX-GJ
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 02:02:25 +0000
Received: from [85.158.138.51:3029] by server-16.bemta-3.messagelabs.com id
	25/5C-07461-0B923905; Fri, 02 Nov 2012 02:02:24 +0000
X-Env-Sender: avs.009@gmail.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1351821742!28315198!1
X-Originating-IP: [209.85.219.45]
X-SpamReason: No, hits=0.6 required=7.0 tests=HTML_60_70,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23988 invoked from network); 2 Nov 2012 02:02:23 -0000
Received: from mail-oa0-f45.google.com (HELO mail-oa0-f45.google.com)
	(209.85.219.45)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 02:02:23 -0000
Received: by mail-oa0-f45.google.com with SMTP id i18so3890001oag.32
	for <xen-devel@lists.xen.org>; Thu, 01 Nov 2012 19:02:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=euLS2+qA5ai/9UOYf3kvq1voWKYL0OGF8loDxPN3YNs=;
	b=GSj2Wbmk8wH8DtMQh7NfJuXGyqMpWHpyscjCV/m4By3ka+D2IXBPK7Lw7L5nvzr1jN
	4wrLck4WRVG2A71ma/e7901c6ujFNyRzRc5dM8I0TGSXl5ZHk8lDd+6i9im4WDoU0gQT
	E/76eImOmncgx5YL2YVQnVqaVqjz1zgDw/o6/Mq09Jgwj92W7E30o7TqAksTzhsVFp+m
	mpKckwza/qdJT1ulGrtxMRTNtvpD2WIOFf7HUIC+3Zj5AdYk/qKx2G3CpGNqGqWroNIY
	zeQqJBfAUtsMw2fB0XYAfaRBWtvAOlwuG7h+8lY30BINNmIEJVuNZyQoQUEHsRgT7DRi
	nEJQ==
MIME-Version: 1.0
Received: by 10.182.1.72 with SMTP id 8mr195299obk.61.1351821742297; Thu, 01
	Nov 2012 19:02:22 -0700 (PDT)
Received: by 10.60.161.233 with HTTP; Thu, 1 Nov 2012 19:02:22 -0700 (PDT)
In-Reply-To: <383bffd3-c605-449a-8ff3-35eee4e75b48@default>
References: <383bffd3-c605-449a-8ff3-35eee4e75b48@default>
Date: Fri, 2 Nov 2012 00:02:22 -0200
Message-ID: <CANchcZy4Qu54QSRTgg-uyS=u+8vRUsANKPxhg41hMdJDUBCNXw@mail.gmail.com>
From: Allan Scheid <avs.009@gmail.com>
To: Daniel Kiper <daniel.kiper@oracle.com>
Cc: xen-devel@lists.xen.org, JBeulich@suse.com, konrad.wilk@oracle.com
Subject: Re: [Xen-devel] Xen 4.2 with EFI on IBM x3650 ACPI Bug
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8408456622164461522=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============8408456622164461522==
Content-Type: multipart/alternative; boundary=f46d04462fe0bfd2b604cd7986c2

--f46d04462fe0bfd2b604cd7986c2
Content-Type: text/plain; charset=ISO-8859-1

Yes, i typed the e-mail too fast, and not read correct email from Konrad!

2012/10/23 Daniel Kiper <daniel.kiper@oracle.com>

> Hi,
>
> > Thank's Jan and Daniel, i am using now
>
> I think that you meant Konrad because I did not help a lot.
>
> [...]
>
> Daniel

*
*

2012/10/23 Daniel Kiper <daniel.kiper@oracle.com>

> Hi,
>
> > Thank's Jan and Daniel, i am using now
>
> I think that you meant Konrad because I did not help a lot.
>
> [...]
>
> Daniel

--f46d04462fe0bfd2b604cd7986c2
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Yes, i typed the e-mail too fast, and not read correct email from Konrad!<b=
r><br><div class=3D"gmail_quote">2012/10/23 Daniel Kiper=A0<span dir=3D"ltr=
">&lt;<a href=3D"mailto:daniel.kiper@oracle.com" target=3D"_blank">daniel.k=
iper@oracle.com</a>&gt;</span><br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex">Hi,<br><div class=3D"im"><br>&gt; Thank&#39;s Jan and Dani=
el, i am using now<br>
<br></div>I think that you meant Konrad because I did not help a lot.<br><b=
r>[...]<br><span class=3D"HOEnZb"><font color=3D"#888888"><br>Daniel</font>=
</span></blockquote></div><div><span style=3D"font-family:arial,sans-serif;=
font-size:13px;background-color:rgb(255,255,255)"><em><b><br>
</b></em></span></div><br><div class=3D"gmail_quote">2012/10/23 Daniel Kipe=
r <span dir=3D"ltr">&lt;<a href=3D"mailto:daniel.kiper@oracle.com" target=
=3D"_blank">daniel.kiper@oracle.com</a>&gt;</span><br><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex">
Hi,<br>
<div class=3D"im"><br>
&gt; Thank&#39;s Jan and Daniel, i am using now<br>
<br>
</div>I think that you meant Konrad because I did not help a lot.<br>
<br>
[...]<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
Daniel</font></span></blockquote></div>

--f46d04462fe0bfd2b604cd7986c2--


--===============8408456622164461522==
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.xen.org
http://lists.xen.org/xen-devel

--===============8408456622164461522==--


From xen-devel-bounces@lists.xen.org Fri Nov 02 05:05:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 05:05:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU9R5-0000D5-Rb; Fri, 02 Nov 2012 05:04:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TU9R4-0000D0-9u
	for xen-devel@lists.xensource.com; Fri, 02 Nov 2012 05:04:50 +0000
Received: from [85.158.139.211:4883] by server-8.bemta-5.messagelabs.com id
	CA/12-06050-17453905; Fri, 02 Nov 2012 05:04:49 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1351832688!18527627!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY5MzE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24928 invoked from network); 2 Nov 2012 05:04:48 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 05:04:48 -0000
X-IronPort-AV: E=Sophos;i="4.80,696,1344211200"; d="scan'208";a="15549384"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	02 Nov 2012 05:04:47 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 2 Nov 2012 05:04:47 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TU9R1-0000Nt-9x;
	Fri, 02 Nov 2012 05:04:47 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TU9R1-00070H-8v;
	Fri, 02 Nov 2012 05:04:47 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14332-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 2 Nov 2012 05:04:47 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14332: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14332 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14332/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore         fail REGR. vs. 14076
 test-amd64-amd64-xl-sedf     11 guest-localmigrate        fail REGR. vs. 14076

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  9 guest-localmigrate         fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  651d965ee2c0
baseline version:
 xen                  40ccbee890e1

------------------------------------------------------------
People who touched revisions under test:
  Andres Lagar-Cavilla <andres@lagarcavilla.org>
  Bastian Blank <waldi@debian.org>
  Chuang Cao <chuang.cao@oracle.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jason McCarver <slam@parasite.cc>
  Joe Jin <joe.jin@oracle.com>
  Keir Fraser <keir@xen.org>
  Matt Wilson <msw@amazon.com>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Olaf Hering <olaf@aepfle.de>
  Roger Pau Monne <roger.pau@citrix.com>
  Sander Eikelenboom <linux@eikelenboom.it>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.2-testing
+ revision=651d965ee2c0
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.2-testing 651d965ee2c0
+ branch=xen-4.2-testing
+ revision=651d965ee2c0
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.2-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.2-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
++ : daily-cron.xen-4.2-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.2-testing.git
+ info_linux_tree xen-4.2-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.2-testing.hg
+ hg push -r 651d965ee2c0 ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 30 changesets with 53 changes to 45 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 05:05:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 05:05:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TU9R5-0000D5-Rb; Fri, 02 Nov 2012 05:04:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TU9R4-0000D0-9u
	for xen-devel@lists.xensource.com; Fri, 02 Nov 2012 05:04:50 +0000
Received: from [85.158.139.211:4883] by server-8.bemta-5.messagelabs.com id
	CA/12-06050-17453905; Fri, 02 Nov 2012 05:04:49 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1351832688!18527627!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY5MzE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24928 invoked from network); 2 Nov 2012 05:04:48 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 05:04:48 -0000
X-IronPort-AV: E=Sophos;i="4.80,696,1344211200"; d="scan'208";a="15549384"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	02 Nov 2012 05:04:47 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 2 Nov 2012 05:04:47 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TU9R1-0000Nt-9x;
	Fri, 02 Nov 2012 05:04:47 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TU9R1-00070H-8v;
	Fri, 02 Nov 2012 05:04:47 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14332-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 2 Nov 2012 05:04:47 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14332: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14332 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14332/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore         fail REGR. vs. 14076
 test-amd64-amd64-xl-sedf     11 guest-localmigrate        fail REGR. vs. 14076

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  9 guest-localmigrate         fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  651d965ee2c0
baseline version:
 xen                  40ccbee890e1

------------------------------------------------------------
People who touched revisions under test:
  Andres Lagar-Cavilla <andres@lagarcavilla.org>
  Bastian Blank <waldi@debian.org>
  Chuang Cao <chuang.cao@oracle.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jason McCarver <slam@parasite.cc>
  Joe Jin <joe.jin@oracle.com>
  Keir Fraser <keir@xen.org>
  Matt Wilson <msw@amazon.com>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Olaf Hering <olaf@aepfle.de>
  Roger Pau Monne <roger.pau@citrix.com>
  Sander Eikelenboom <linux@eikelenboom.it>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.2-testing
+ revision=651d965ee2c0
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.2-testing 651d965ee2c0
+ branch=xen-4.2-testing
+ revision=651d965ee2c0
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.2-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.2-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
++ : daily-cron.xen-4.2-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.2-testing.git
+ info_linux_tree xen-4.2-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.2-testing.hg
+ hg push -r 651d965ee2c0 ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 30 changesets with 53 changes to 45 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 06:23:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 06:23:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUAdt-00031D-52; Fri, 02 Nov 2012 06:22:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TUAdr-000318-MW
	for xen-devel@lists.xensource.com; Fri, 02 Nov 2012 06:22:07 +0000
Received: from [85.158.143.99:58249] by server-2.bemta-4.messagelabs.com id
	E5/56-28922-E8663905; Fri, 02 Nov 2012 06:22:06 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1351837326!27755180!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY5MzE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25843 invoked from network); 2 Nov 2012 06:22:06 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 06:22:06 -0000
X-IronPort-AV: E=Sophos;i="4.80,696,1344211200"; d="scan'208";a="15549840"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	02 Nov 2012 06:07:04 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 2 Nov 2012 06:07:03 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TUAPH-0000jP-Ku;
	Fri, 02 Nov 2012 06:07:03 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TUAPH-0007O4-Hd;
	Fri, 02 Nov 2012 06:07:03 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14337-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 2 Nov 2012 06:07:03 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14337: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14337 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14337/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14289
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14289
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14289
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14289

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  bf249cd5f2c1
baseline version:
 xen                  bf249cd5f2c1

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 06:23:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 06:23:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUAdt-00031D-52; Fri, 02 Nov 2012 06:22:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TUAdr-000318-MW
	for xen-devel@lists.xensource.com; Fri, 02 Nov 2012 06:22:07 +0000
Received: from [85.158.143.99:58249] by server-2.bemta-4.messagelabs.com id
	E5/56-28922-E8663905; Fri, 02 Nov 2012 06:22:06 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1351837326!27755180!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY5MzE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25843 invoked from network); 2 Nov 2012 06:22:06 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 06:22:06 -0000
X-IronPort-AV: E=Sophos;i="4.80,696,1344211200"; d="scan'208";a="15549840"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	02 Nov 2012 06:07:04 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 2 Nov 2012 06:07:03 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TUAPH-0000jP-Ku;
	Fri, 02 Nov 2012 06:07:03 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TUAPH-0007O4-Hd;
	Fri, 02 Nov 2012 06:07:03 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14337-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 2 Nov 2012 06:07:03 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14337: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14337 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14337/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14289
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14289
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14289
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14289

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  bf249cd5f2c1
baseline version:
 xen                  bf249cd5f2c1

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 08:19:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 08:19:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUCSc-0005ik-9c; Fri, 02 Nov 2012 08:18:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUCSZ-0005ic-MY
	for xen-devel@lists.xensource.com; Fri, 02 Nov 2012 08:18:36 +0000
Received: from [85.158.137.99:49773] by server-9.bemta-3.messagelabs.com id
	4B/E9-02388-6D183905; Fri, 02 Nov 2012 08:18:30 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1351844309!12684597!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5NjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18852 invoked from network); 2 Nov 2012 08:18:30 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-217.messagelabs.com with SMTP;
	2 Nov 2012 08:18:30 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 08:18:29 +0000
Message-Id: <5093900B02000078000A5F29@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 08:19:07 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
References: <alpine.DEB.2.00.1210312239120.31758@chino.kir.corp.google.com>
	<20121101124912.GA10743@localhost.localdomain>
	<5092D5EA020000780008EB85@nat28.tlf.novell.com>
	<20121101220520.GC18854@localhost.localdomain>
In-Reply-To: <20121101220520.GC18854@localhost.localdomain>
Mime-Version: 1.0
Content-Disposition: inline
Cc: jeremy@goop.org, xen-devel@lists.xensource.com, hpa@zytor.com,
	x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com,
	rientjes@google.com, tglx@linutronix.de, torvalds@linux-foundation.org
Subject: Re: [Xen-devel] [patch] x86,
 xen: fix build dependency when USB_SUPPORT is not enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 01.11.12 at 23:05, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> On Thu, Nov 01, 2012 at 08:04:58PM +0000, Jan Beulich wrote:
>> >>> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> 11/01/12 1:49 PM >>>
>> >On Wed, Oct 31, 2012 at 10:42:30PM -0700, David Rientjes wrote:
>> >> CONFIG_XEN_DOM0 must depend on CONFIG_USB_SUPPORT, otherwise there is no 
>> >> definition of xen_dbgp_reset_prep() and xen_dbgp_external_startup() 
>> >> resulting in the following link error:
>> >> 
>> >> drivers/built-in.o: In function `dbgp_reset_prep':
>> >> (.text+0x1e03c5): undefined reference to `xen_dbgp_reset_prep'
>> >> drivers/built-in.o: In function `dbgp_external_startup':
>> >> (.text+0x1e0d55): undefined reference to `xen_dbgp_external_startup'
>> >
>> >There is another patch that needs to be Acked and picked up by
>> >Greg KH that fixes this.
>> >
>> >Let me poke Jan Beulich to repost it with the appropiate Acks.
>> 
>> It's been picked up already, but another dependency problem was found with
>> it (due to not having used CONFIG_USB_SUPPORT as dependency, as I had
>> first submitted).
> 
> Oh. I missed that part - so do you think that this patch should also
> be used? Or do you think there is another way to fix this?
> 
> I am in transit right now so I can't prep a patch (and the laptop I've
> is extremely slow to even do a test compile).

Alan and I settled on relaxing the condition in ehci-dbgp.c to
IS_ENABLED(USB). But it's not clear to me if I should send an
incremental patch or a replacement one (neither he nor Greg
answered my respective inquiry).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 08:19:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 08:19:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUCSc-0005ik-9c; Fri, 02 Nov 2012 08:18:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUCSZ-0005ic-MY
	for xen-devel@lists.xensource.com; Fri, 02 Nov 2012 08:18:36 +0000
Received: from [85.158.137.99:49773] by server-9.bemta-3.messagelabs.com id
	4B/E9-02388-6D183905; Fri, 02 Nov 2012 08:18:30 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1351844309!12684597!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5NjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18852 invoked from network); 2 Nov 2012 08:18:30 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-217.messagelabs.com with SMTP;
	2 Nov 2012 08:18:30 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 08:18:29 +0000
Message-Id: <5093900B02000078000A5F29@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 08:19:07 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
References: <alpine.DEB.2.00.1210312239120.31758@chino.kir.corp.google.com>
	<20121101124912.GA10743@localhost.localdomain>
	<5092D5EA020000780008EB85@nat28.tlf.novell.com>
	<20121101220520.GC18854@localhost.localdomain>
In-Reply-To: <20121101220520.GC18854@localhost.localdomain>
Mime-Version: 1.0
Content-Disposition: inline
Cc: jeremy@goop.org, xen-devel@lists.xensource.com, hpa@zytor.com,
	x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com,
	rientjes@google.com, tglx@linutronix.de, torvalds@linux-foundation.org
Subject: Re: [Xen-devel] [patch] x86,
 xen: fix build dependency when USB_SUPPORT is not enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 01.11.12 at 23:05, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> On Thu, Nov 01, 2012 at 08:04:58PM +0000, Jan Beulich wrote:
>> >>> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> 11/01/12 1:49 PM >>>
>> >On Wed, Oct 31, 2012 at 10:42:30PM -0700, David Rientjes wrote:
>> >> CONFIG_XEN_DOM0 must depend on CONFIG_USB_SUPPORT, otherwise there is no 
>> >> definition of xen_dbgp_reset_prep() and xen_dbgp_external_startup() 
>> >> resulting in the following link error:
>> >> 
>> >> drivers/built-in.o: In function `dbgp_reset_prep':
>> >> (.text+0x1e03c5): undefined reference to `xen_dbgp_reset_prep'
>> >> drivers/built-in.o: In function `dbgp_external_startup':
>> >> (.text+0x1e0d55): undefined reference to `xen_dbgp_external_startup'
>> >
>> >There is another patch that needs to be Acked and picked up by
>> >Greg KH that fixes this.
>> >
>> >Let me poke Jan Beulich to repost it with the appropiate Acks.
>> 
>> It's been picked up already, but another dependency problem was found with
>> it (due to not having used CONFIG_USB_SUPPORT as dependency, as I had
>> first submitted).
> 
> Oh. I missed that part - so do you think that this patch should also
> be used? Or do you think there is another way to fix this?
> 
> I am in transit right now so I can't prep a patch (and the laptop I've
> is extremely slow to even do a test compile).

Alan and I settled on relaxing the condition in ehci-dbgp.c to
IS_ENABLED(USB). But it's not clear to me if I should send an
incremental patch or a replacement one (neither he nor Greg
answered my respective inquiry).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 08:38:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 08:38:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUClq-0006BT-4c; Fri, 02 Nov 2012 08:38:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUClp-0006BO-75
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 08:38:29 +0000
Received: from [85.158.143.99:55205] by server-3.bemta-4.messagelabs.com id
	72/69-06841-48683905; Fri, 02 Nov 2012 08:38:28 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1351845507!21944129!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5NjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25263 invoked from network); 2 Nov 2012 08:38:27 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-216.messagelabs.com with SMTP;
	2 Nov 2012 08:38:27 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 08:37:28 +0000
Message-Id: <5093947F02000078000A5F42@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 08:38:07 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <gregkh@linuxfoundation.org>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part52639C7F.2__="
Cc: Randy Dunlap <rdunlap@xenotime.net>, xen-devel <xen-devel@lists.xen.org>,
	stern@rowland.harvard.edu, linux-usb@vger.kernel.org,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH,
 v3] fix build with XEN and EARLY_PRINTK_DBGP enabled but
 USB_SUPPORT disabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part52639C7F.2__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Since there's no possible caller of dbgp_external_startup() and
dbgp_reset_prep() when !USB, there's no point in building and exporting
these functions in that case. This eliminates a build error under the
conditions listed in the subject, introduced with the merge
f1c6872e4980bc4078cfaead05f892b3d78dea64.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
(incremental patch attached, in case that one is preferred)

v3: Relax condition from USB_EHCI_HCD to just USB, to also cover the
    chipidea driver re-using code from ehci-hcd.
v2: Switch the dependency from USB_SUPPORT to USB_EHCI_HCD as requested
    by Alan (albeit I don't really agree to that change).

---
 drivers/usb/early/ehci-dbgp.c       |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

--- 3.7-rc3/drivers/usb/early/ehci-dbgp.c
+++ 3.7-rc3-ehci-dbgp-early-xen-no-usb/drivers/usb/early/ehci-dbgp.c
@@ -20,6 +20,7 @@
 #include <linux/usb/ehci_def.h>
 #include <linux/delay.h>
 #include <linux/serial_core.h>
+#include <linux/kconfig.h>
 #include <linux/kgdb.h>
 #include <linux/kthread.h>
 #include <asm/io.h>
@@ -614,12 +615,6 @@ err:
 	return -ENODEV;
 }
=20
-int dbgp_external_startup(struct usb_hcd *hcd)
-{
-	return xen_dbgp_external_startup(hcd) ?: _dbgp_external_startup();
-}
-EXPORT_SYMBOL_GPL(dbgp_external_startup);
-
 static int ehci_reset_port(int port)
 {
 	u32 portsc;
@@ -979,6 +974,7 @@ struct console early_dbgp_console =3D {
 	.index =3D	-1,
 };
=20
+#if IS_ENABLED(CONFIG_USB)
 int dbgp_reset_prep(struct usb_hcd *hcd)
 {
 	int ret =3D xen_dbgp_reset_prep(hcd);
@@ -1007,6 +1003,13 @@ int dbgp_reset_prep(struct usb_hcd *hcd)
 }
 EXPORT_SYMBOL_GPL(dbgp_reset_prep);
=20
+int dbgp_external_startup(struct usb_hcd *hcd)
+{
+	return xen_dbgp_external_startup(hcd) ?: _dbgp_external_startup();
+}
+EXPORT_SYMBOL_GPL(dbgp_external_startup);
+#endif /* USB */
+
 #ifdef CONFIG_KGDB
=20
 static char kgdbdbgp_buf[DBGP_MAX_PACKET];




--=__Part52639C7F.2__=
Content-Type: text/plain; name="linux-3.7-rc3-ehci-dbgp-early-xen-no-usb-v3-incremental.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="linux-3.7-rc3-ehci-dbgp-early-xen-no-usb-v3-incremental.patch"

fix build of EHCI debug port code when USB_CHIPIDEA but not USB_EHCI_HCD=0A=
=0ARelax condition of building the reset interface stubs in=0Adrivers/usb/e=
arly/ehci-dbgp.c from USB_EHCI_HCD to just USB, to also=0Acover the =
chipidea driver re-using code from ehci-hcd.=0A=0AReported-by: Randy =
Dunlap <rdunlap@xenotime.net>=0ASigned-off-by: Jan Beulich <jbeulich@suse.c=
om>=0ACc: Alan Stern <stern@rowland.harvard.edu>=0ACc: Stefano Stabellini =
<stefano.stabellini@eu.citrix.com>=0A=0A---=0A drivers/usb/early/ehci-dbgp.=
c       |   4 ++--=0A 1 file changed, 2 insertions(+), 2 deletions(-)=0A=0A=
--- 3.7-rc3.orig/drivers/usb/early/ehci-dbgp.c=0A+++ 3.7-rc3/drivers/usb/ea=
rly/ehci-dbgp.c=0A@@ -974,7 +974,7 @@ struct console early_dbgp_console =
=3D {=0A 	.index =3D	-1,=0A };=0A =0A-#if IS_ENABLED(CONFIG_USB_=
EHCI_HCD)=0A+#if IS_ENABLED(CONFIG_USB)=0A int dbgp_reset_prep(struct =
usb_hcd *hcd)=0A {=0A 	int ret =3D xen_dbgp_reset_prep(hcd);=0A@@ -1008,7 =
+1008,7 @@ int dbgp_external_startup(struct usb_hcd=0A 	return xen_dbgp_ext=
ernal_startup(hcd) ?: _dbgp_external_startup();=0A }=0A EXPORT_SYMBOL_GPL(d=
bgp_external_startup);=0A-#endif /* USB_EHCI_HCD */=0A+#endif /* USB */=0A =
=0A #ifdef CONFIG_KGDB=0A =0A
--=__Part52639C7F.2__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part52639C7F.2__=--


From xen-devel-bounces@lists.xen.org Fri Nov 02 08:38:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 08:38:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUClq-0006BT-4c; Fri, 02 Nov 2012 08:38:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUClp-0006BO-75
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 08:38:29 +0000
Received: from [85.158.143.99:55205] by server-3.bemta-4.messagelabs.com id
	72/69-06841-48683905; Fri, 02 Nov 2012 08:38:28 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1351845507!21944129!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5NjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25263 invoked from network); 2 Nov 2012 08:38:27 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-216.messagelabs.com with SMTP;
	2 Nov 2012 08:38:27 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 08:37:28 +0000
Message-Id: <5093947F02000078000A5F42@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 08:38:07 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <gregkh@linuxfoundation.org>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part52639C7F.2__="
Cc: Randy Dunlap <rdunlap@xenotime.net>, xen-devel <xen-devel@lists.xen.org>,
	stern@rowland.harvard.edu, linux-usb@vger.kernel.org,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH,
 v3] fix build with XEN and EARLY_PRINTK_DBGP enabled but
 USB_SUPPORT disabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part52639C7F.2__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Since there's no possible caller of dbgp_external_startup() and
dbgp_reset_prep() when !USB, there's no point in building and exporting
these functions in that case. This eliminates a build error under the
conditions listed in the subject, introduced with the merge
f1c6872e4980bc4078cfaead05f892b3d78dea64.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
(incremental patch attached, in case that one is preferred)

v3: Relax condition from USB_EHCI_HCD to just USB, to also cover the
    chipidea driver re-using code from ehci-hcd.
v2: Switch the dependency from USB_SUPPORT to USB_EHCI_HCD as requested
    by Alan (albeit I don't really agree to that change).

---
 drivers/usb/early/ehci-dbgp.c       |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

--- 3.7-rc3/drivers/usb/early/ehci-dbgp.c
+++ 3.7-rc3-ehci-dbgp-early-xen-no-usb/drivers/usb/early/ehci-dbgp.c
@@ -20,6 +20,7 @@
 #include <linux/usb/ehci_def.h>
 #include <linux/delay.h>
 #include <linux/serial_core.h>
+#include <linux/kconfig.h>
 #include <linux/kgdb.h>
 #include <linux/kthread.h>
 #include <asm/io.h>
@@ -614,12 +615,6 @@ err:
 	return -ENODEV;
 }
=20
-int dbgp_external_startup(struct usb_hcd *hcd)
-{
-	return xen_dbgp_external_startup(hcd) ?: _dbgp_external_startup();
-}
-EXPORT_SYMBOL_GPL(dbgp_external_startup);
-
 static int ehci_reset_port(int port)
 {
 	u32 portsc;
@@ -979,6 +974,7 @@ struct console early_dbgp_console =3D {
 	.index =3D	-1,
 };
=20
+#if IS_ENABLED(CONFIG_USB)
 int dbgp_reset_prep(struct usb_hcd *hcd)
 {
 	int ret =3D xen_dbgp_reset_prep(hcd);
@@ -1007,6 +1003,13 @@ int dbgp_reset_prep(struct usb_hcd *hcd)
 }
 EXPORT_SYMBOL_GPL(dbgp_reset_prep);
=20
+int dbgp_external_startup(struct usb_hcd *hcd)
+{
+	return xen_dbgp_external_startup(hcd) ?: _dbgp_external_startup();
+}
+EXPORT_SYMBOL_GPL(dbgp_external_startup);
+#endif /* USB */
+
 #ifdef CONFIG_KGDB
=20
 static char kgdbdbgp_buf[DBGP_MAX_PACKET];




--=__Part52639C7F.2__=
Content-Type: text/plain; name="linux-3.7-rc3-ehci-dbgp-early-xen-no-usb-v3-incremental.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="linux-3.7-rc3-ehci-dbgp-early-xen-no-usb-v3-incremental.patch"

fix build of EHCI debug port code when USB_CHIPIDEA but not USB_EHCI_HCD=0A=
=0ARelax condition of building the reset interface stubs in=0Adrivers/usb/e=
arly/ehci-dbgp.c from USB_EHCI_HCD to just USB, to also=0Acover the =
chipidea driver re-using code from ehci-hcd.=0A=0AReported-by: Randy =
Dunlap <rdunlap@xenotime.net>=0ASigned-off-by: Jan Beulich <jbeulich@suse.c=
om>=0ACc: Alan Stern <stern@rowland.harvard.edu>=0ACc: Stefano Stabellini =
<stefano.stabellini@eu.citrix.com>=0A=0A---=0A drivers/usb/early/ehci-dbgp.=
c       |   4 ++--=0A 1 file changed, 2 insertions(+), 2 deletions(-)=0A=0A=
--- 3.7-rc3.orig/drivers/usb/early/ehci-dbgp.c=0A+++ 3.7-rc3/drivers/usb/ea=
rly/ehci-dbgp.c=0A@@ -974,7 +974,7 @@ struct console early_dbgp_console =
=3D {=0A 	.index =3D	-1,=0A };=0A =0A-#if IS_ENABLED(CONFIG_USB_=
EHCI_HCD)=0A+#if IS_ENABLED(CONFIG_USB)=0A int dbgp_reset_prep(struct =
usb_hcd *hcd)=0A {=0A 	int ret =3D xen_dbgp_reset_prep(hcd);=0A@@ -1008,7 =
+1008,7 @@ int dbgp_external_startup(struct usb_hcd=0A 	return xen_dbgp_ext=
ernal_startup(hcd) ?: _dbgp_external_startup();=0A }=0A EXPORT_SYMBOL_GPL(d=
bgp_external_startup);=0A-#endif /* USB_EHCI_HCD */=0A+#endif /* USB */=0A =
=0A #ifdef CONFIG_KGDB=0A =0A
--=__Part52639C7F.2__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part52639C7F.2__=--


From xen-devel-bounces@lists.xen.org Fri Nov 02 08:41:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 08:41:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUCo8-0006Iv-NP; Fri, 02 Nov 2012 08:40:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUCo7-0006Hg-11
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 08:40:51 +0000
Received: from [85.158.139.83:54546] by server-12.bemta-5.messagelabs.com id
	90/4D-02886-21783905; Fri, 02 Nov 2012 08:40:50 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1351845649!23825634!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5NjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2418 invoked from network); 2 Nov 2012 08:40:49 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-182.messagelabs.com with SMTP;
	2 Nov 2012 08:40:49 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 08:40:49 +0000
Message-Id: <5093954902000078000A5F45@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 08:41:29 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<5092DE7E020000780008EB96@nat28.tlf.novell.com>
	<75058642-ad3b-4df9-a24a-7dbdc5f6e8c5@default>
In-Reply-To: <75058642-ad3b-4df9-a24a-7dbdc5f6e8c5@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 01.11.12 at 21:55, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>> >when prototyping the "claim" hypercall/subop, can I assume
>> >that the CONFIG_X86 code in the hypervisor and, specifically
>> >any separation of the concepts of xen_heap from dom_heap,
>> >can be ignored?
>> 
>> No, you shouldn't. Once adding support for memory amounts beyond 5Tb
>> I expect the separation to become meaningful even for x86-64.
> 
> On quick scan, I don't see anything obvious in the archives
> that explains why 5Tb is the limit (rather than, say, 4Tb
> or 8Tb, or some other power of two).  Could you provide a
> pointer to this info or, if you agree it is non-obvious and
> undocumented, say a few words of explanation?

xen/include/asm-x86/config.h:DIRECTMAP_* (and the comment
preceding all those #define-s).

> Also, just wondering, should exceeding 5Tb be on the 4.3
> features list or is >5Tb physical memory still too far away?

It _is_ on the feature list. So far I just had way too many other
issues to deal with, preventing me to get started with that work.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 08:41:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 08:41:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUCo8-0006Iv-NP; Fri, 02 Nov 2012 08:40:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUCo7-0006Hg-11
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 08:40:51 +0000
Received: from [85.158.139.83:54546] by server-12.bemta-5.messagelabs.com id
	90/4D-02886-21783905; Fri, 02 Nov 2012 08:40:50 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1351845649!23825634!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5NjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2418 invoked from network); 2 Nov 2012 08:40:49 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-182.messagelabs.com with SMTP;
	2 Nov 2012 08:40:49 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 08:40:49 +0000
Message-Id: <5093954902000078000A5F45@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 08:41:29 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<5092DE7E020000780008EB96@nat28.tlf.novell.com>
	<75058642-ad3b-4df9-a24a-7dbdc5f6e8c5@default>
In-Reply-To: <75058642-ad3b-4df9-a24a-7dbdc5f6e8c5@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 01.11.12 at 21:55, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>> >when prototyping the "claim" hypercall/subop, can I assume
>> >that the CONFIG_X86 code in the hypervisor and, specifically
>> >any separation of the concepts of xen_heap from dom_heap,
>> >can be ignored?
>> 
>> No, you shouldn't. Once adding support for memory amounts beyond 5Tb
>> I expect the separation to become meaningful even for x86-64.
> 
> On quick scan, I don't see anything obvious in the archives
> that explains why 5Tb is the limit (rather than, say, 4Tb
> or 8Tb, or some other power of two).  Could you provide a
> pointer to this info or, if you agree it is non-obvious and
> undocumented, say a few words of explanation?

xen/include/asm-x86/config.h:DIRECTMAP_* (and the comment
preceding all those #define-s).

> Also, just wondering, should exceeding 5Tb be on the 4.3
> features list or is >5Tb physical memory still too far away?

It _is_ on the feature list. So far I just had way too many other
issues to deal with, preventing me to get started with that work.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 09:01:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 09:01:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUD7x-0006wT-ST; Fri, 02 Nov 2012 09:01:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUD7w-0006wI-Ly
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 09:01:20 +0000
Received: from [85.158.143.99:35785] by server-1.bemta-4.messagelabs.com id
	00/71-27934-0EB83905; Fri, 02 Nov 2012 09:01:20 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1351846879!23088542!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5NjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16140 invoked from network); 2 Nov 2012 09:01:19 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-216.messagelabs.com with SMTP;
	2 Nov 2012 09:01:19 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 09:01:18 +0000
Message-Id: <50939A1502000078000A5F61@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 09:01:57 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <60d00f38-98a3-4ec2-acbd-b49dafaada56@default>
	<20121029223555.GA24388@ocelot.phlegethon.org>
	<eca242fa-20a1-42b1-943c-ca2ab1f5c4c4@default>
	<508F9DE902000078000A5565@nat28.tlf.novell.com>
	<a79693b2-ff7f-4b45-9eee-6ddb1bbcb84a@default>
	<509008A502000078000A584E@nat28.tlf.novell.com>
	<da9ef0d0-71d4-4645-a296-5c11fede8be7@default>
	<5090EBFE02000078000A59DD@nat28.tlf.novell.com>
	<83bb902d-8e49-41cf-ad1e-c07c62d6e5f8@default>
	<50915DA702000078000A5C75@nat28.tlf.novell.com>
	<5a1fef58-be52-464d-8f86-b65dffb32431@default>
In-Reply-To: <5a1fef58-be52-464d-8f86-b65dffb32431@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	"Keir\(Xen.org\)" <keir@xen.org>, IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	GeorgeDunlap <George.Dunlap@eu.citrix.com>,
	IanJackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 31.10.12 at 17:51, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> To look at it another way, the code in alloc_heap_page()
> contained within the loop:
> 
> 	for ( i = 0; i < (1 << order); i++ )
> 
> may be already unacceptable, even _after_ the patch, if
> order==26 (a fictional page size just for this illustration)
> because the heap_lock will be held for a very very long time.
> (In fact for order==20, 1GB pages, it could already be a
> problem.)

A million iterations doing just a few memory reads and writes
(not even atomic ones afaics) doesn't sound that bad. And
order-18 allocations (which is what 1Gb pages really amount
to) are the biggest ever happening (post-boot, if that matters).

You'll get much worse behavior if these large order allocations
fail, and the callers have to fall back to smaller ones.

Plus, if necessary, that loop could be broken up so that only the
initial part of it gets run with the lock held (see c/s
22135:69e8bb164683 for why the unlock was moved past the
loop). That would make for a shorter lock hold time, but for a
higher allocation latency on large oder allocations (due to worse
cache locality).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 09:01:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 09:01:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUD7x-0006wT-ST; Fri, 02 Nov 2012 09:01:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUD7w-0006wI-Ly
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 09:01:20 +0000
Received: from [85.158.143.99:35785] by server-1.bemta-4.messagelabs.com id
	00/71-27934-0EB83905; Fri, 02 Nov 2012 09:01:20 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1351846879!23088542!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5NjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16140 invoked from network); 2 Nov 2012 09:01:19 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-216.messagelabs.com with SMTP;
	2 Nov 2012 09:01:19 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 09:01:18 +0000
Message-Id: <50939A1502000078000A5F61@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 09:01:57 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <60d00f38-98a3-4ec2-acbd-b49dafaada56@default>
	<20121029223555.GA24388@ocelot.phlegethon.org>
	<eca242fa-20a1-42b1-943c-ca2ab1f5c4c4@default>
	<508F9DE902000078000A5565@nat28.tlf.novell.com>
	<a79693b2-ff7f-4b45-9eee-6ddb1bbcb84a@default>
	<509008A502000078000A584E@nat28.tlf.novell.com>
	<da9ef0d0-71d4-4645-a296-5c11fede8be7@default>
	<5090EBFE02000078000A59DD@nat28.tlf.novell.com>
	<83bb902d-8e49-41cf-ad1e-c07c62d6e5f8@default>
	<50915DA702000078000A5C75@nat28.tlf.novell.com>
	<5a1fef58-be52-464d-8f86-b65dffb32431@default>
In-Reply-To: <5a1fef58-be52-464d-8f86-b65dffb32431@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	"Keir\(Xen.org\)" <keir@xen.org>, IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	GeorgeDunlap <George.Dunlap@eu.citrix.com>,
	IanJackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 31.10.12 at 17:51, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> To look at it another way, the code in alloc_heap_page()
> contained within the loop:
> 
> 	for ( i = 0; i < (1 << order); i++ )
> 
> may be already unacceptable, even _after_ the patch, if
> order==26 (a fictional page size just for this illustration)
> because the heap_lock will be held for a very very long time.
> (In fact for order==20, 1GB pages, it could already be a
> problem.)

A million iterations doing just a few memory reads and writes
(not even atomic ones afaics) doesn't sound that bad. And
order-18 allocations (which is what 1Gb pages really amount
to) are the biggest ever happening (post-boot, if that matters).

You'll get much worse behavior if these large order allocations
fail, and the callers have to fall back to smaller ones.

Plus, if necessary, that loop could be broken up so that only the
initial part of it gets run with the lock held (see c/s
22135:69e8bb164683 for why the unlock was moved past the
loop). That would make for a shorter lock hold time, but for a
higher allocation latency on large oder allocations (due to worse
cache locality).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 09:30:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 09:30:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUDa4-0007Wf-JG; Fri, 02 Nov 2012 09:30:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TUDa2-0007WW-V6
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 09:30:23 +0000
Received: from [85.158.138.51:9633] by server-2.bemta-3.messagelabs.com id
	12/32-04744-DA293905; Fri, 02 Nov 2012 09:30:21 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1351848620!20466249!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1625 invoked from network); 2 Nov 2012 09:30:21 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 09:30:21 -0000
Received: by mail-we0-f173.google.com with SMTP id t11so1899326wey.32
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 02:30:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=OyBdE3M7tRSBSUzcDLpVQ5QGF0/r8vcFzxNhoM9BNhM=;
	b=fRjtg8mO+iR0uf9r00VZf2Dl6+yBzvxQ5d8kjxQ3PQmYGQsQIYxgjcs3XP8ty9Rbn8
	lJc0dHrfDGqC+MnRuaY/FARsj1dtSMt8xhLjtlHZEUVklaeFdqjUgs9SiQsKbx8mFvdG
	uZt1qzNwYgdXy4ea30dJgmPzHsZWccP3NaooqSUeyE2m80fnaQAynUBC3QO83U40KPsT
	qnSVKrDSDZWfb6gtfac3I2jJj89u/Kg0K8MGDUuCCzFRdMXTJ7Gw3lpbFsSogLr8lt3o
	anWew/9whNjfX9IPjIerBZEtveOtK713e1uTWpuSEdnhYZ5Bl7gHuuiPoehuL3QH0THQ
	HExQ==
Received: by 10.181.11.233 with SMTP id el9mr1027831wid.3.1351848620475;
	Fri, 02 Nov 2012 02:30:20 -0700 (PDT)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id eq2sm1752083wib.1.2012.11.02.02.30.17
	(version=SSLv3 cipher=OTHER); Fri, 02 Nov 2012 02:30:19 -0700 (PDT)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Fri, 02 Nov 2012 09:30:14 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <CCB94326.50E8F%keir@xen.org>
Thread-Topic: Proposed new "memory capacity claim" hypercall/feature
Thread-Index: Ac243KmFTd1mEfxoMUOLVRVHmQp3kA==
In-Reply-To: <50939A1502000078000A5F61@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 02/11/2012 09:01, "Jan Beulich" <JBeulich@suse.com> wrote:

> Plus, if necessary, that loop could be broken up so that only the
> initial part of it gets run with the lock held (see c/s
> 22135:69e8bb164683 for why the unlock was moved past the
> loop). That would make for a shorter lock hold time, but for a
> higher allocation latency on large oder allocations (due to worse
> cache locality).

In fact I believe only the first page needs to have its count_info set to !=
PGC_state_free, while the lock is held. That is sufficient to defeat the
buddy merging in free_heap_pages(). Similarly, we could hoist most of the
first loop in free_heap_pages() outside the lock. There's a lot of scope for
optimisation here.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 09:30:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 09:30:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUDa4-0007Wf-JG; Fri, 02 Nov 2012 09:30:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TUDa2-0007WW-V6
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 09:30:23 +0000
Received: from [85.158.138.51:9633] by server-2.bemta-3.messagelabs.com id
	12/32-04744-DA293905; Fri, 02 Nov 2012 09:30:21 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1351848620!20466249!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1625 invoked from network); 2 Nov 2012 09:30:21 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 09:30:21 -0000
Received: by mail-we0-f173.google.com with SMTP id t11so1899326wey.32
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 02:30:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=OyBdE3M7tRSBSUzcDLpVQ5QGF0/r8vcFzxNhoM9BNhM=;
	b=fRjtg8mO+iR0uf9r00VZf2Dl6+yBzvxQ5d8kjxQ3PQmYGQsQIYxgjcs3XP8ty9Rbn8
	lJc0dHrfDGqC+MnRuaY/FARsj1dtSMt8xhLjtlHZEUVklaeFdqjUgs9SiQsKbx8mFvdG
	uZt1qzNwYgdXy4ea30dJgmPzHsZWccP3NaooqSUeyE2m80fnaQAynUBC3QO83U40KPsT
	qnSVKrDSDZWfb6gtfac3I2jJj89u/Kg0K8MGDUuCCzFRdMXTJ7Gw3lpbFsSogLr8lt3o
	anWew/9whNjfX9IPjIerBZEtveOtK713e1uTWpuSEdnhYZ5Bl7gHuuiPoehuL3QH0THQ
	HExQ==
Received: by 10.181.11.233 with SMTP id el9mr1027831wid.3.1351848620475;
	Fri, 02 Nov 2012 02:30:20 -0700 (PDT)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id eq2sm1752083wib.1.2012.11.02.02.30.17
	(version=SSLv3 cipher=OTHER); Fri, 02 Nov 2012 02:30:19 -0700 (PDT)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Fri, 02 Nov 2012 09:30:14 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <CCB94326.50E8F%keir@xen.org>
Thread-Topic: Proposed new "memory capacity claim" hypercall/feature
Thread-Index: Ac243KmFTd1mEfxoMUOLVRVHmQp3kA==
In-Reply-To: <50939A1502000078000A5F61@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 02/11/2012 09:01, "Jan Beulich" <JBeulich@suse.com> wrote:

> Plus, if necessary, that loop could be broken up so that only the
> initial part of it gets run with the lock held (see c/s
> 22135:69e8bb164683 for why the unlock was moved past the
> loop). That would make for a shorter lock hold time, but for a
> higher allocation latency on large oder allocations (due to worse
> cache locality).

In fact I believe only the first page needs to have its count_info set to !=
PGC_state_free, while the lock is held. That is sufficient to defeat the
buddy merging in free_heap_pages(). Similarly, we could hoist most of the
first loop in free_heap_pages() outside the lock. There's a lot of scope for
optimisation here.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 09:31:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 09:31:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUDaj-0007gV-0X; Fri, 02 Nov 2012 09:31:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TUDag-0007gI-N4
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 09:31:03 +0000
Received: from [85.158.137.99:9058] by server-15.bemta-3.messagelabs.com id
	2A/8B-09445-1D293905; Fri, 02 Nov 2012 09:30:57 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-12.tower-217.messagelabs.com!1351848656!14311557!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18551 invoked from network); 2 Nov 2012 09:30:57 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 2 Nov 2012 09:30:57 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TUDaZ-000K9l-6R; Fri, 02 Nov 2012 09:30:55 +0000
Date: Fri, 2 Nov 2012 09:30:55 +0000
From: Tim Deegan <tim@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <20121102093055.GA77212@ocelot.phlegethon.org>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<20121101204622.GA66969@ocelot.phlegethon.org>
	<e47d14a7-65e2-4e0e-aec9-3cc4379aa272@default>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <e47d14a7-65e2-4e0e-aec9-3cc4379aa272@default>
User-Agent: Mutt/1.4.2.1i
Cc: "Keir \(Xen.org\)" <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 13:57 -0700 on 01 Nov (1351778261), Dan Magenheimer wrote:
> > From: Tim Deegan [mailto:tim@xen.org]
> > Subject: Re: [Xen-devel] 32bit xen and "claim"
> > 
> > At 13:34 -0700 on 01 Nov (1351776880), Dan Magenheimer wrote:
> > > With the plan to obsolete the x86 32-bit hypervisor at 4.3,
> > > when prototyping the "claim" hypercall/subop, can I assume
> > > that the CONFIG_X86 code in the hypervisor and, specifically
> > > any separation of the concepts of xen_heap from dom_heap,
> > > can be ignored?
> > >
> > > Or will the ARM version of the hypervisor be requiring
> > > a similar separation of xen_heap vs dom_heap?
> > 
> > Yes, 32-bit ARM has this separation.
> 
> Hmmm... looking at page_alloc.c... does ARM overload CONFIG_X86
> to mean CONFIG-32-bitness then? 

No.  CONFIG_X86 doesn't mean 32-bit, even on x86; it means i386/amd64 as
distinct from MIPS/ARM/PPC.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 09:31:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 09:31:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUDaj-0007gV-0X; Fri, 02 Nov 2012 09:31:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TUDag-0007gI-N4
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 09:31:03 +0000
Received: from [85.158.137.99:9058] by server-15.bemta-3.messagelabs.com id
	2A/8B-09445-1D293905; Fri, 02 Nov 2012 09:30:57 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-12.tower-217.messagelabs.com!1351848656!14311557!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18551 invoked from network); 2 Nov 2012 09:30:57 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 2 Nov 2012 09:30:57 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TUDaZ-000K9l-6R; Fri, 02 Nov 2012 09:30:55 +0000
Date: Fri, 2 Nov 2012 09:30:55 +0000
From: Tim Deegan <tim@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <20121102093055.GA77212@ocelot.phlegethon.org>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<20121101204622.GA66969@ocelot.phlegethon.org>
	<e47d14a7-65e2-4e0e-aec9-3cc4379aa272@default>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <e47d14a7-65e2-4e0e-aec9-3cc4379aa272@default>
User-Agent: Mutt/1.4.2.1i
Cc: "Keir \(Xen.org\)" <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 13:57 -0700 on 01 Nov (1351778261), Dan Magenheimer wrote:
> > From: Tim Deegan [mailto:tim@xen.org]
> > Subject: Re: [Xen-devel] 32bit xen and "claim"
> > 
> > At 13:34 -0700 on 01 Nov (1351776880), Dan Magenheimer wrote:
> > > With the plan to obsolete the x86 32-bit hypervisor at 4.3,
> > > when prototyping the "claim" hypercall/subop, can I assume
> > > that the CONFIG_X86 code in the hypervisor and, specifically
> > > any separation of the concepts of xen_heap from dom_heap,
> > > can be ignored?
> > >
> > > Or will the ARM version of the hypervisor be requiring
> > > a similar separation of xen_heap vs dom_heap?
> > 
> > Yes, 32-bit ARM has this separation.
> 
> Hmmm... looking at page_alloc.c... does ARM overload CONFIG_X86
> to mean CONFIG-32-bitness then? 

No.  CONFIG_X86 doesn't mean 32-bit, even on x86; it means i386/amd64 as
distinct from MIPS/ARM/PPC.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 10:38:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 10:38:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUEdM-0000j9-TY; Fri, 02 Nov 2012 10:37:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <s.munaut@whatever-company.com>) id 1TUEdK-0000j3-Pz
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 10:37:50 +0000
Received: from [85.158.137.99:18649] by server-2.bemta-3.messagelabs.com id
	4E/58-04744-972A3905; Fri, 02 Nov 2012 10:37:45 +0000
X-Env-Sender: s.munaut@whatever-company.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1351852663!17459401!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6255 invoked from network); 2 Nov 2012 10:37:45 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 10:37:45 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl15so4507674vcb.32
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 03:37:43 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type
	:x-gm-message-state;
	bh=kHSRKiEajuw0NhD9kz+wPB5ZzqwalVNqbngar1EY/UM=;
	b=R1R/l3Y689CE49wJD5b1swBSzbDbTJ55X3Iq0FPNJHUWVwDdw3Ac3sTfYxn+M+tK35
	h6gyXIOoJCgpA9y1BBaXtfvP8WsW5pVU8IdrtMvMA21IHraaBtTpYmWRZgdvxfYmQ78r
	3u3MUISEg5gzgEW8IxcP8WGozau1cc6wFLD2l1+eVDFHTKesq9X3DRAASltS0CqCYfHX
	mbbTQZOskiVHbrS4FkrjL52DFuCu75GnLdyLWp0um5IKUw7uLB47pdZSltHJrrKKfG4d
	tY/LlqJ1y3QoleRZc3rj8/kqTmau084HRpy6R2l4tG9EVbPck9Wf1C4DpmwcCAyIea4Z
	IXRg==
MIME-Version: 1.0
Received: by 10.52.77.101 with SMTP id r5mr1237684vdw.25.1351852663514; Fri,
	02 Nov 2012 03:37:43 -0700 (PDT)
Received: by 10.220.207.28 with HTTP; Fri, 2 Nov 2012 03:37:43 -0700 (PDT)
Date: Fri, 2 Nov 2012 11:37:43 +0100
Message-ID: <CAF6-1L51R5yMBNO1wQe7YWoeGoM_bFJcAb0XN0cVg6cm7+Kzaw@mail.gmail.com>
From: Sylvain Munaut <s.munaut@whatever-company.com>
To: xen-devel@lists.xen.org
X-Gm-Message-State: ALoCoQkdWNqv7yOPqTD3aEukceMwVxcyOlNmx3Td/ZWrh5qmt87RSHzThC+ILMhPuIdJkpjyImJH
Subject: [Xen-devel] Custom block script started twice for root block but
	only stopped once
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

I'm using a custom block script in my xen setup and when started, it
creates a new device node pointing to some network resources.

Now I noticed that the script is called twice for the root block, the
first time for pygrub most likely, but is only stopped once ... I
don't mind creating two devices node, but then I need to destroy both
...

Is this a known issue ?

 Cheers,

    Sylvain

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 10:38:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 10:38:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUEdM-0000j9-TY; Fri, 02 Nov 2012 10:37:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <s.munaut@whatever-company.com>) id 1TUEdK-0000j3-Pz
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 10:37:50 +0000
Received: from [85.158.137.99:18649] by server-2.bemta-3.messagelabs.com id
	4E/58-04744-972A3905; Fri, 02 Nov 2012 10:37:45 +0000
X-Env-Sender: s.munaut@whatever-company.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1351852663!17459401!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6255 invoked from network); 2 Nov 2012 10:37:45 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 10:37:45 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl15so4507674vcb.32
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 03:37:43 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type
	:x-gm-message-state;
	bh=kHSRKiEajuw0NhD9kz+wPB5ZzqwalVNqbngar1EY/UM=;
	b=R1R/l3Y689CE49wJD5b1swBSzbDbTJ55X3Iq0FPNJHUWVwDdw3Ac3sTfYxn+M+tK35
	h6gyXIOoJCgpA9y1BBaXtfvP8WsW5pVU8IdrtMvMA21IHraaBtTpYmWRZgdvxfYmQ78r
	3u3MUISEg5gzgEW8IxcP8WGozau1cc6wFLD2l1+eVDFHTKesq9X3DRAASltS0CqCYfHX
	mbbTQZOskiVHbrS4FkrjL52DFuCu75GnLdyLWp0um5IKUw7uLB47pdZSltHJrrKKfG4d
	tY/LlqJ1y3QoleRZc3rj8/kqTmau084HRpy6R2l4tG9EVbPck9Wf1C4DpmwcCAyIea4Z
	IXRg==
MIME-Version: 1.0
Received: by 10.52.77.101 with SMTP id r5mr1237684vdw.25.1351852663514; Fri,
	02 Nov 2012 03:37:43 -0700 (PDT)
Received: by 10.220.207.28 with HTTP; Fri, 2 Nov 2012 03:37:43 -0700 (PDT)
Date: Fri, 2 Nov 2012 11:37:43 +0100
Message-ID: <CAF6-1L51R5yMBNO1wQe7YWoeGoM_bFJcAb0XN0cVg6cm7+Kzaw@mail.gmail.com>
From: Sylvain Munaut <s.munaut@whatever-company.com>
To: xen-devel@lists.xen.org
X-Gm-Message-State: ALoCoQkdWNqv7yOPqTD3aEukceMwVxcyOlNmx3Td/ZWrh5qmt87RSHzThC+ILMhPuIdJkpjyImJH
Subject: [Xen-devel] Custom block script started twice for root block but
	only stopped once
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

I'm using a custom block script in my xen setup and when started, it
creates a new device node pointing to some network resources.

Now I noticed that the script is called twice for the root block, the
first time for pygrub most likely, but is only stopped once ... I
don't mind creating two devices node, but then I need to destroy both
...

Is this a known issue ?

 Cheers,

    Sylvain

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 10:51:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 10:51:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUEq9-0001J5-VM; Fri, 02 Nov 2012 10:51:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fantonifabio@tiscali.it>) id 1TUEq8-0001H6-Cb
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 10:51:04 +0000
Received: from [85.158.137.99:5536] by server-8.bemta-3.messagelabs.com id
	DB/52-07786-795A3905; Fri, 02 Nov 2012 10:51:03 +0000
X-Env-Sender: fantonifabio@tiscali.it
X-Msg-Ref: server-11.tower-217.messagelabs.com!1351853462!16575354!1
X-Originating-IP: [94.23.245.208]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27995 invoked from network); 2 Nov 2012 10:51:02 -0000
Received: from lnx3.fantu.it (HELO lnx3.fantu.it) (94.23.245.208)
	by server-11.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 2 Nov 2012 10:51:02 -0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by lnx3.fantu.it (Postfix) with ESMTP id 8ADA84014B0;
	Fri,  2 Nov 2012 11:51:02 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at lnx3.fantu.it
Received: from lnx3.fantu.it ([127.0.0.1])
	by localhost (lnx3.fantu.it [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id QJ9F8kB6B1C1; Fri,  2 Nov 2012 11:51:02 +0100 (CET)
Received: from [192.168.178.50]
	(host51-78-dynamic.2-87-r.retail.telecomitalia.it [87.2.78.51])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: prova@fantu.it)
	by lnx3.fantu.it (Postfix) with ESMTPSA id DB29840131D;
	Fri,  2 Nov 2012 11:51:01 +0100 (CET)
Message-ID: <5093A592.1050005@tiscali.it>
Date: Fri, 02 Nov 2012 11:50:58 +0100
From: Fabio Fantoni <fantonifabio@tiscali.it>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel <xen-devel@lists.xen.org>, aliguori@us.ibm.com
Subject: [Xen-devel] Build xen-unstable and qemu upstream unstable fail with
 error on xenfb.c
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: fantonifabio@tiscali.it
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3296776057195519040=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--===============3296776057195519040==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms090302020408070308050004"

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--------------ms090302020408070308050004
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: quoted-printable

I tried to compile and test xen-unstable (changeset 26124:bf249cd5f2c1)=20
with qemu unstable (commit 4ba79505f43bd0ace35c3fe42197eb02e7e0478e) but =

failed with this error:

hw/xenfb.c: In function =E2xenfb_guest_copy=E2:
hw/xenfb.c:651:5: error: implicit declaration of function =E2dpy_update=E2=
=20
[-Werror=3Dimplicit-function-declaration]
hw/xenfb.c:651:5: error: nested extern declaration of =E2dpy_update=E2=20
[-Werror=3Dnested-externs]
hw/xenfb.c: In function =E2xenfb_update=E2:
hw/xenfb.c:769:9: error: implicit declaration of function =E2dpy_resize=E2=
=20
[-Werror=3Dimplicit-function-declaration]
hw/xenfb.c:769:9: error: nested extern declaration of =E2dpy_resize=E2=20
[-Werror=3Dnested-externs]
cc1: all warnings being treated as errors
make[3]: *** [hw/xenfb.o] Error 1
make[3]: Leaving directory=20
`/mnt/vm/xen/xen-unstable.hg/tools/qemu-xen-dir-remote'
make[2]: *** [subdir-all-qemu-xen-dir] Error 2
make[2]: Leaving directory `/mnt/vm/xen/xen-unstable.hg/tools'
make[1]: *** [subdirs-install] Error 2
make[1]: Leaving directory `/mnt/vm/xen/xen-unstable.hg/tools'
make: *** [install-tools] Error 2

Build of some days ago was working , xenfb seem that need to be adapt=20
for latest vga changes on qemu upstream.


--------------ms090302020408070308050004
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: Firma crittografica S/MIME

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIINhjCC
BjQwggQcoAMCAQICASAwDQYJKoZIhvcNAQEFBQAwfTELMAkGA1UEBhMCSUwxFjAUBgNVBAoT
DVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNp
Z25pbmcxKTAnBgNVBAMTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA3
MTAyNDIxMDI1NVoXDTE3MTAyNDIxMDI1NVowgYwxCzAJBgNVBAYTAklMMRYwFAYDVQQKEw1T
dGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRhbCBDZXJ0aWZpY2F0ZSBTaWdu
aW5nMTgwNgYDVQQDEy9TdGFydENvbSBDbGFzcyAyIFByaW1hcnkgSW50ZXJtZWRpYXRlIENs
aWVudCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMsohUWcASz7GfKrpTOM
KqANy9BV7V0igWdGxA8IU77L3aTxErQ+fcxtDYZ36Z6GH0YFn7fq5RADteP0AYzrCA+EQTfi
8q1+kA3m0nwtwXG94M5sIqsvs7lRP1aycBke/s5g9hJHryZ2acScnzczjBCAo7X1v5G3yw8M
DP2m2RCye0K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/apWsI8oXAAAAAAAAA==
--------------ms090302020408070308050004--


--===============3296776057195519040==
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.xen.org
http://lists.xen.org/xen-devel

--===============3296776057195519040==--


From xen-devel-bounces@lists.xen.org Fri Nov 02 10:51:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 10:51:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUEq9-0001J5-VM; Fri, 02 Nov 2012 10:51:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fantonifabio@tiscali.it>) id 1TUEq8-0001H6-Cb
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 10:51:04 +0000
Received: from [85.158.137.99:5536] by server-8.bemta-3.messagelabs.com id
	DB/52-07786-795A3905; Fri, 02 Nov 2012 10:51:03 +0000
X-Env-Sender: fantonifabio@tiscali.it
X-Msg-Ref: server-11.tower-217.messagelabs.com!1351853462!16575354!1
X-Originating-IP: [94.23.245.208]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27995 invoked from network); 2 Nov 2012 10:51:02 -0000
Received: from lnx3.fantu.it (HELO lnx3.fantu.it) (94.23.245.208)
	by server-11.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 2 Nov 2012 10:51:02 -0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by lnx3.fantu.it (Postfix) with ESMTP id 8ADA84014B0;
	Fri,  2 Nov 2012 11:51:02 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at lnx3.fantu.it
Received: from lnx3.fantu.it ([127.0.0.1])
	by localhost (lnx3.fantu.it [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id QJ9F8kB6B1C1; Fri,  2 Nov 2012 11:51:02 +0100 (CET)
Received: from [192.168.178.50]
	(host51-78-dynamic.2-87-r.retail.telecomitalia.it [87.2.78.51])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: prova@fantu.it)
	by lnx3.fantu.it (Postfix) with ESMTPSA id DB29840131D;
	Fri,  2 Nov 2012 11:51:01 +0100 (CET)
Message-ID: <5093A592.1050005@tiscali.it>
Date: Fri, 02 Nov 2012 11:50:58 +0100
From: Fabio Fantoni <fantonifabio@tiscali.it>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel <xen-devel@lists.xen.org>, aliguori@us.ibm.com
Subject: [Xen-devel] Build xen-unstable and qemu upstream unstable fail with
 error on xenfb.c
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: fantonifabio@tiscali.it
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3296776057195519040=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--===============3296776057195519040==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms090302020408070308050004"

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--------------ms090302020408070308050004
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: quoted-printable

I tried to compile and test xen-unstable (changeset 26124:bf249cd5f2c1)=20
with qemu unstable (commit 4ba79505f43bd0ace35c3fe42197eb02e7e0478e) but =

failed with this error:

hw/xenfb.c: In function =E2xenfb_guest_copy=E2:
hw/xenfb.c:651:5: error: implicit declaration of function =E2dpy_update=E2=
=20
[-Werror=3Dimplicit-function-declaration]
hw/xenfb.c:651:5: error: nested extern declaration of =E2dpy_update=E2=20
[-Werror=3Dnested-externs]
hw/xenfb.c: In function =E2xenfb_update=E2:
hw/xenfb.c:769:9: error: implicit declaration of function =E2dpy_resize=E2=
=20
[-Werror=3Dimplicit-function-declaration]
hw/xenfb.c:769:9: error: nested extern declaration of =E2dpy_resize=E2=20
[-Werror=3Dnested-externs]
cc1: all warnings being treated as errors
make[3]: *** [hw/xenfb.o] Error 1
make[3]: Leaving directory=20
`/mnt/vm/xen/xen-unstable.hg/tools/qemu-xen-dir-remote'
make[2]: *** [subdir-all-qemu-xen-dir] Error 2
make[2]: Leaving directory `/mnt/vm/xen/xen-unstable.hg/tools'
make[1]: *** [subdirs-install] Error 2
make[1]: Leaving directory `/mnt/vm/xen/xen-unstable.hg/tools'
make: *** [install-tools] Error 2

Build of some days ago was working , xenfb seem that need to be adapt=20
for latest vga changes on qemu upstream.


--------------ms090302020408070308050004
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: Firma crittografica S/MIME

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIINhjCC
BjQwggQcoAMCAQICASAwDQYJKoZIhvcNAQEFBQAwfTELMAkGA1UEBhMCSUwxFjAUBgNVBAoT
DVN0YXJ0Q29tIEx0Z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QAgsxgZaggZMwgYwxCzAJBgNVBAYTAklMMRYwFAYD
VQQKEw1TdGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRhbCBDZXJ0aWZpY2F0
ZSBTaWduaW5nMTgwNgYDVQQDEy9TdGFydENvbSBDbGFzcyAyIFByaW1hcnkgSW50ZXJtZWRp
YXRlIENsaWVudCBDQQICHmMwDQYJKoZIhvcNAQEBBQAEggEARNDAI4Gq/+KTTC7iui30Nmvf
HYPih+1DWT6fgfFYSkcR20oo5/MGXm2q34H9Xxk+2S0H38rrRlj9Etz5slkwdivG8/jlLvjU
SPX5YXu62A/0fnhBWstyzUKHtpNnUS9H7/1aUwXTtnUh+NZgV5InNmVt2c3ryKP/vvwnTl7l
qvNHf6Q93DTxn1dQBlAHN2B630s7dKLFjpepen2J+87UTVpXQ8fOEwuzg6ceE4uxwqzwivgp
Y8l3JnJN7oyvY3cLqu7AfAXlgQImzLbZ5z9T5kiISiZd3kKW1L6vSGKDsmzTf1Dakv5OIVBj
GgpOm0q42J+66WCoQ2wb/apWsI8oXAAAAAAAAA==
--------------ms090302020408070308050004--


--===============3296776057195519040==
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.xen.org
http://lists.xen.org/xen-devel

--===============3296776057195519040==--


From xen-devel-bounces@lists.xen.org Fri Nov 02 11:21:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 11:21:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUFJ8-00023M-P6; Fri, 02 Nov 2012 11:21:02 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>) id 1TUFJ7-00023H-F0
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 11:21:02 +0000
Received: from [193.109.254.147:30520] by server-13.bemta-14.messagelabs.com
	id 8D/6C-11239-C9CA3905; Fri, 02 Nov 2012 11:21:00 +0000
X-Env-Sender: ian.campbell@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1351855259!2573050!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3138 invoked from network); 2 Nov 2012 11:21:00 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Nov 2012 11:21:00 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJ4-0007g6-K0; Fri, 02 Nov 2012 11:20:58 +0000
Received: from [192.168.1.164] (helo=hastur.hellion.org.uk)
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJ2-0005eU-Cs; Fri, 02 Nov 2012 11:20:58 +0000
MIME-Version: 1.0
Message-Id: <patchbomb.1351855134@hastur.hellion.org.uk>
User-Agent: Mercurial-patchbomb/2.2.2
Date: Fri, 02 Nov 2012 12:18:54 +0100
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
X-SA-Exim-Connect-IP: 192.168.1.164
X-SA-Exim-Mail-From: ian.campbell@citrix.com
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 0 of 5] docs: x86 PV MMU related functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The following series adds some documentation for the PV MU related
hypercalls. For the most part this is just a case of adding a suitable
prototype and marking things up so they show up in the generated docs.

I also have a draft of a wiki article on the subject which references
the information in the public headers which I hope to post soon.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 11:21:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 11:21:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUFJ8-00023M-P6; Fri, 02 Nov 2012 11:21:02 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>) id 1TUFJ7-00023H-F0
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 11:21:02 +0000
Received: from [193.109.254.147:30520] by server-13.bemta-14.messagelabs.com
	id 8D/6C-11239-C9CA3905; Fri, 02 Nov 2012 11:21:00 +0000
X-Env-Sender: ian.campbell@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1351855259!2573050!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3138 invoked from network); 2 Nov 2012 11:21:00 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Nov 2012 11:21:00 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJ4-0007g6-K0; Fri, 02 Nov 2012 11:20:58 +0000
Received: from [192.168.1.164] (helo=hastur.hellion.org.uk)
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJ2-0005eU-Cs; Fri, 02 Nov 2012 11:20:58 +0000
MIME-Version: 1.0
Message-Id: <patchbomb.1351855134@hastur.hellion.org.uk>
User-Agent: Mercurial-patchbomb/2.2.2
Date: Fri, 02 Nov 2012 12:18:54 +0100
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
X-SA-Exim-Connect-IP: 192.168.1.164
X-SA-Exim-Mail-From: ian.campbell@citrix.com
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 0 of 5] docs: x86 PV MMU related functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The following series adds some documentation for the PV MU related
hypercalls. For the most part this is just a case of adding a suitable
prototype and marking things up so they show up in the generated docs.

I also have a draft of a wiki article on the subject which references
the information in the public headers which I hope to post soon.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 11:21:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 11:21:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUFJC-00023b-5O; Fri, 02 Nov 2012 11:21:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>) id 1TUFJB-00023T-8Q
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 11:21:05 +0000
Received: from [85.158.143.99:3029] by server-3.bemta-4.messagelabs.com id
	A2/D4-06841-0ACA3905; Fri, 02 Nov 2012 11:21:04 +0000
X-Env-Sender: ian.campbell@citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1351855263!27795811!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2486 invoked from network); 2 Nov 2012 11:21:03 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-3.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Nov 2012 11:21:03 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJ9-0007gO-6Y; Fri, 02 Nov 2012 11:21:03 +0000
Received: from [192.168.1.164] (helo=hastur.hellion.org.uk)
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJ6-0005eU-Fo; Fri, 02 Nov 2012 11:21:02 +0000
MIME-Version: 1.0
X-Mercurial-Node: e6880358eba346c386b9faaa30a5489df73a06a0
Message-Id: <e6880358eba346c386b9.1351855136@hastur.hellion.org.uk>
In-Reply-To: <patchbomb.1351855134@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
User-Agent: Mercurial-patchbomb/2.2.2
Date: Fri, 02 Nov 2012 12:18:56 +0100
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
X-SA-Exim-Connect-IP: 192.168.1.164
X-SA-Exim-Mail-From: ian.campbell@citrix.com
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 2 of 5] docs: Document HYPERVISOR_mmuext_op
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1351854990 -3600
# Node ID e6880358eba346c386b9faaa30a5489df73a06a0
# Parent  e8e1191aef208fbe2f4de61aad3e4fd789333646
docs: Document HYPERVISOR_mmuext_op

Mark-up for inclusion of generated docs.

Remove some trailing whitespace.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r e8e1191aef20 -r e6880358eba3 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Fri Nov 02 12:15:56 2012 +0100
+++ b/xen/include/public/xen.h	Fri Nov 02 12:16:30 2012 +0100
@@ -319,48 +319,54 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
 
 /*
  * MMU EXTENDED OPERATIONS
- * 
- * HYPERVISOR_mmuext_op() accepts a list of mmuext_op structures.
+ *
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_mmuext_op(mmuext_op_t uops[],
+ * `                      unsigned int count,
+ * `                      unsigned int *pdone,
+ * `                      unsigned int foreigndom)
+ */
+/* HYPERVISOR_mmuext_op() accepts a list of mmuext_op structures.
  * A foreigndom (FD) can be specified (or DOMID_SELF for none).
  * Where the FD has some effect, it is described below.
- * 
+ *
  * cmd: MMUEXT_(UN)PIN_*_TABLE
  * mfn: Machine frame number to be (un)pinned as a p.t. page.
  *      The frame must belong to the FD, if one is specified.
- * 
+ *
  * cmd: MMUEXT_NEW_BASEPTR
  * mfn: Machine frame number of new page-table base to install in MMU.
- * 
+ *
  * cmd: MMUEXT_NEW_USER_BASEPTR [x86/64 only]
  * mfn: Machine frame number of new page-table base to install in MMU
  *      when in user space.
- * 
+ *
  * cmd: MMUEXT_TLB_FLUSH_LOCAL
  * No additional arguments. Flushes local TLB.
- * 
+ *
  * cmd: MMUEXT_INVLPG_LOCAL
  * linear_addr: Linear address to be flushed from the local TLB.
- * 
+ *
  * cmd: MMUEXT_TLB_FLUSH_MULTI
  * vcpumask: Pointer to bitmap of VCPUs to be flushed.
- * 
+ *
  * cmd: MMUEXT_INVLPG_MULTI
  * linear_addr: Linear address to be flushed.
  * vcpumask: Pointer to bitmap of VCPUs to be flushed.
- * 
+ *
  * cmd: MMUEXT_TLB_FLUSH_ALL
  * No additional arguments. Flushes all VCPUs' TLBs.
- * 
+ *
  * cmd: MMUEXT_INVLPG_ALL
  * linear_addr: Linear address to be flushed from all VCPUs' TLBs.
- * 
+ *
  * cmd: MMUEXT_FLUSH_CACHE
  * No additional arguments. Writes back and flushes cache contents.
  *
  * cmd: MMUEXT_FLUSH_CACHE_GLOBAL
  * No additional arguments. Writes back and flushes cache contents
  * on all CPUs in the system.
- * 
+ *
  * cmd: MMUEXT_SET_LDT
  * linear_addr: Linear address of LDT base (NB. must be page-aligned).
  * nr_ents: Number of entries in LDT.
@@ -375,6 +381,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
  * cmd: MMUEXT_[UN]MARK_SUPER
  * mfn: Machine frame number of head of superpage to be [un]marked.
  */
+/* ` enum mmuext_cmd { */
 #define MMUEXT_PIN_L1_TABLE      0
 #define MMUEXT_PIN_L2_TABLE      1
 #define MMUEXT_PIN_L3_TABLE      2
@@ -395,10 +402,11 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
 #define MMUEXT_FLUSH_CACHE_GLOBAL 18
 #define MMUEXT_MARK_SUPER       19
 #define MMUEXT_UNMARK_SUPER     20
+/* ` } */
 
 #ifndef __ASSEMBLY__
 struct mmuext_op {
-    unsigned int cmd;
+    unsigned int cmd; /* => enum mmuext_cmd */
     union {
         /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR
          * CLEAR_PAGE, COPY_PAGE, [UN]MARK_SUPER */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 11:21:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 11:21:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUFJC-00023b-5O; Fri, 02 Nov 2012 11:21:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>) id 1TUFJB-00023T-8Q
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 11:21:05 +0000
Received: from [85.158.143.99:3029] by server-3.bemta-4.messagelabs.com id
	A2/D4-06841-0ACA3905; Fri, 02 Nov 2012 11:21:04 +0000
X-Env-Sender: ian.campbell@citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1351855263!27795811!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2486 invoked from network); 2 Nov 2012 11:21:03 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-3.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Nov 2012 11:21:03 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJ9-0007gO-6Y; Fri, 02 Nov 2012 11:21:03 +0000
Received: from [192.168.1.164] (helo=hastur.hellion.org.uk)
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJ6-0005eU-Fo; Fri, 02 Nov 2012 11:21:02 +0000
MIME-Version: 1.0
X-Mercurial-Node: e6880358eba346c386b9faaa30a5489df73a06a0
Message-Id: <e6880358eba346c386b9.1351855136@hastur.hellion.org.uk>
In-Reply-To: <patchbomb.1351855134@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
User-Agent: Mercurial-patchbomb/2.2.2
Date: Fri, 02 Nov 2012 12:18:56 +0100
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
X-SA-Exim-Connect-IP: 192.168.1.164
X-SA-Exim-Mail-From: ian.campbell@citrix.com
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 2 of 5] docs: Document HYPERVISOR_mmuext_op
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1351854990 -3600
# Node ID e6880358eba346c386b9faaa30a5489df73a06a0
# Parent  e8e1191aef208fbe2f4de61aad3e4fd789333646
docs: Document HYPERVISOR_mmuext_op

Mark-up for inclusion of generated docs.

Remove some trailing whitespace.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r e8e1191aef20 -r e6880358eba3 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Fri Nov 02 12:15:56 2012 +0100
+++ b/xen/include/public/xen.h	Fri Nov 02 12:16:30 2012 +0100
@@ -319,48 +319,54 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
 
 /*
  * MMU EXTENDED OPERATIONS
- * 
- * HYPERVISOR_mmuext_op() accepts a list of mmuext_op structures.
+ *
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_mmuext_op(mmuext_op_t uops[],
+ * `                      unsigned int count,
+ * `                      unsigned int *pdone,
+ * `                      unsigned int foreigndom)
+ */
+/* HYPERVISOR_mmuext_op() accepts a list of mmuext_op structures.
  * A foreigndom (FD) can be specified (or DOMID_SELF for none).
  * Where the FD has some effect, it is described below.
- * 
+ *
  * cmd: MMUEXT_(UN)PIN_*_TABLE
  * mfn: Machine frame number to be (un)pinned as a p.t. page.
  *      The frame must belong to the FD, if one is specified.
- * 
+ *
  * cmd: MMUEXT_NEW_BASEPTR
  * mfn: Machine frame number of new page-table base to install in MMU.
- * 
+ *
  * cmd: MMUEXT_NEW_USER_BASEPTR [x86/64 only]
  * mfn: Machine frame number of new page-table base to install in MMU
  *      when in user space.
- * 
+ *
  * cmd: MMUEXT_TLB_FLUSH_LOCAL
  * No additional arguments. Flushes local TLB.
- * 
+ *
  * cmd: MMUEXT_INVLPG_LOCAL
  * linear_addr: Linear address to be flushed from the local TLB.
- * 
+ *
  * cmd: MMUEXT_TLB_FLUSH_MULTI
  * vcpumask: Pointer to bitmap of VCPUs to be flushed.
- * 
+ *
  * cmd: MMUEXT_INVLPG_MULTI
  * linear_addr: Linear address to be flushed.
  * vcpumask: Pointer to bitmap of VCPUs to be flushed.
- * 
+ *
  * cmd: MMUEXT_TLB_FLUSH_ALL
  * No additional arguments. Flushes all VCPUs' TLBs.
- * 
+ *
  * cmd: MMUEXT_INVLPG_ALL
  * linear_addr: Linear address to be flushed from all VCPUs' TLBs.
- * 
+ *
  * cmd: MMUEXT_FLUSH_CACHE
  * No additional arguments. Writes back and flushes cache contents.
  *
  * cmd: MMUEXT_FLUSH_CACHE_GLOBAL
  * No additional arguments. Writes back and flushes cache contents
  * on all CPUs in the system.
- * 
+ *
  * cmd: MMUEXT_SET_LDT
  * linear_addr: Linear address of LDT base (NB. must be page-aligned).
  * nr_ents: Number of entries in LDT.
@@ -375,6 +381,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
  * cmd: MMUEXT_[UN]MARK_SUPER
  * mfn: Machine frame number of head of superpage to be [un]marked.
  */
+/* ` enum mmuext_cmd { */
 #define MMUEXT_PIN_L1_TABLE      0
 #define MMUEXT_PIN_L2_TABLE      1
 #define MMUEXT_PIN_L3_TABLE      2
@@ -395,10 +402,11 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
 #define MMUEXT_FLUSH_CACHE_GLOBAL 18
 #define MMUEXT_MARK_SUPER       19
 #define MMUEXT_UNMARK_SUPER     20
+/* ` } */
 
 #ifndef __ASSEMBLY__
 struct mmuext_op {
-    unsigned int cmd;
+    unsigned int cmd; /* => enum mmuext_cmd */
     union {
         /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR
          * CLEAR_PAGE, COPY_PAGE, [UN]MARK_SUPER */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 11:21:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 11:21:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUFJF-00024M-Uj; Fri, 02 Nov 2012 11:21:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>) id 1TUFJE-00023q-Tx
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 11:21:09 +0000
Received: from [85.158.137.99:25490] by server-5.bemta-3.messagelabs.com id
	F2/B5-26311-E9CA3905; Fri, 02 Nov 2012 11:21:02 +0000
X-Env-Sender: ian.campbell@citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1351855260!17460263!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22708 invoked from network); 2 Nov 2012 11:21:01 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Nov 2012 11:21:01 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJ6-0007gE-R1; Fri, 02 Nov 2012 11:21:00 +0000
Received: from [192.168.1.164] (helo=hastur.hellion.org.uk)
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJ4-0005eU-8W; Fri, 02 Nov 2012 11:21:00 +0000
MIME-Version: 1.0
X-Mercurial-Node: e8e1191aef208fbe2f4de61aad3e4fd789333646
Message-Id: <e8e1191aef208fbe2f4d.1351855135@hastur.hellion.org.uk>
In-Reply-To: <patchbomb.1351855134@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
User-Agent: Mercurial-patchbomb/2.2.2
Date: Fri, 02 Nov 2012 12:18:55 +0100
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
X-SA-Exim-Connect-IP: 192.168.1.164
X-SA-Exim-Mail-From: ian.campbell@citrix.com
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 1 of 5] docs: document
 HYPERVISOR_update_va_mapping(_other_domain)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1351854956 -3600
# Node ID e8e1191aef208fbe2f4de61aad3e4fd789333646
# Parent  37a8946eeb9db8b5eafc1c75aded006ad5322af8
docs: document HYPERVISOR_update_va_mapping(_other_domain)

Mark-up for inclusion of generated docs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 37a8946eeb9d -r e8e1191aef20 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Fri Oct 26 16:09:29 2012 +0100
+++ b/xen/include/public/xen.h	Fri Nov 02 12:15:56 2012 +0100
@@ -423,9 +423,25 @@ typedef struct mmuext_op mmuext_op_t;
 DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
 #endif
 
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_update_va_mapping(unsigned long va, u64 val,
+ * `                              enum uvm_flags flags)
+ * `
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_update_va_mapping_otherdomain(unsigned long va, u64 val,
+ * `                                          enum uvm_flags flags,
+ * `                                          domid_t domid)
+ * `
+ * ` @va: The virtual address whose mapping we want to change
+ * ` @val: The new page table entry
+ * ` @flags: Control TLB flushes
+ */
+*/
 /* These are passed as 'flags' to update_va_mapping. They can be ORed. */
 /* When specifying UVMF_MULTI, also OR in a pointer to a CPU bitmap.   */
 /* UVMF_LOCAL is merely UVMF_MULTI with a NULL bitmap pointer.         */
+/* ` enum uvm_flags { */
 #define UVMF_NONE               (0UL<<0) /* No flushing at all.   */
 #define UVMF_TLB_FLUSH          (1UL<<0) /* Flush entire TLB(s).  */
 #define UVMF_INVLPG             (2UL<<0) /* Flush only one entry. */
@@ -433,6 +449,7 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
 #define UVMF_MULTI              (0UL<<2) /* Flush subset of TLBs. */
 #define UVMF_LOCAL              (0UL<<2) /* Flush local TLB.      */
 #define UVMF_ALL                (1UL<<2) /* Flush all TLBs.       */
+/* ` } */
 
 /*
  * Commands to HYPERVISOR_console_io().

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 11:21:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 11:21:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUFJF-00024M-Uj; Fri, 02 Nov 2012 11:21:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>) id 1TUFJE-00023q-Tx
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 11:21:09 +0000
Received: from [85.158.137.99:25490] by server-5.bemta-3.messagelabs.com id
	F2/B5-26311-E9CA3905; Fri, 02 Nov 2012 11:21:02 +0000
X-Env-Sender: ian.campbell@citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1351855260!17460263!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22708 invoked from network); 2 Nov 2012 11:21:01 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Nov 2012 11:21:01 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJ6-0007gE-R1; Fri, 02 Nov 2012 11:21:00 +0000
Received: from [192.168.1.164] (helo=hastur.hellion.org.uk)
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJ4-0005eU-8W; Fri, 02 Nov 2012 11:21:00 +0000
MIME-Version: 1.0
X-Mercurial-Node: e8e1191aef208fbe2f4de61aad3e4fd789333646
Message-Id: <e8e1191aef208fbe2f4d.1351855135@hastur.hellion.org.uk>
In-Reply-To: <patchbomb.1351855134@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
User-Agent: Mercurial-patchbomb/2.2.2
Date: Fri, 02 Nov 2012 12:18:55 +0100
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
X-SA-Exim-Connect-IP: 192.168.1.164
X-SA-Exim-Mail-From: ian.campbell@citrix.com
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 1 of 5] docs: document
 HYPERVISOR_update_va_mapping(_other_domain)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1351854956 -3600
# Node ID e8e1191aef208fbe2f4de61aad3e4fd789333646
# Parent  37a8946eeb9db8b5eafc1c75aded006ad5322af8
docs: document HYPERVISOR_update_va_mapping(_other_domain)

Mark-up for inclusion of generated docs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 37a8946eeb9d -r e8e1191aef20 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Fri Oct 26 16:09:29 2012 +0100
+++ b/xen/include/public/xen.h	Fri Nov 02 12:15:56 2012 +0100
@@ -423,9 +423,25 @@ typedef struct mmuext_op mmuext_op_t;
 DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
 #endif
 
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_update_va_mapping(unsigned long va, u64 val,
+ * `                              enum uvm_flags flags)
+ * `
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_update_va_mapping_otherdomain(unsigned long va, u64 val,
+ * `                                          enum uvm_flags flags,
+ * `                                          domid_t domid)
+ * `
+ * ` @va: The virtual address whose mapping we want to change
+ * ` @val: The new page table entry
+ * ` @flags: Control TLB flushes
+ */
+*/
 /* These are passed as 'flags' to update_va_mapping. They can be ORed. */
 /* When specifying UVMF_MULTI, also OR in a pointer to a CPU bitmap.   */
 /* UVMF_LOCAL is merely UVMF_MULTI with a NULL bitmap pointer.         */
+/* ` enum uvm_flags { */
 #define UVMF_NONE               (0UL<<0) /* No flushing at all.   */
 #define UVMF_TLB_FLUSH          (1UL<<0) /* Flush entire TLB(s).  */
 #define UVMF_INVLPG             (2UL<<0) /* Flush only one entry. */
@@ -433,6 +449,7 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
 #define UVMF_MULTI              (0UL<<2) /* Flush subset of TLBs. */
 #define UVMF_LOCAL              (0UL<<2) /* Flush local TLB.      */
 #define UVMF_ALL                (1UL<<2) /* Flush all TLBs.       */
+/* ` } */
 
 /*
  * Commands to HYPERVISOR_console_io().

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 11:21:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 11:21:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUFJK-00025F-Ay; Fri, 02 Nov 2012 11:21:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>) id 1TUFJI-00024u-Lv
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 11:21:12 +0000
Received: from [85.158.139.83:19675] by server-12.bemta-5.messagelabs.com id
	73/B8-02886-8ACA3905; Fri, 02 Nov 2012 11:21:12 +0000
X-Env-Sender: ian.campbell@citrix.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1351855271!23854230!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1217 invoked from network); 2 Nov 2012 11:21:11 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Nov 2012 11:21:11 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJH-0007gk-1n; Fri, 02 Nov 2012 11:21:11 +0000
Received: from [192.168.1.164] (helo=hastur.hellion.org.uk)
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJE-0005eU-Fr; Fri, 02 Nov 2012 11:21:10 +0000
MIME-Version: 1.0
X-Mercurial-Node: afb8de49d9a8f91cf1b0248842e56be8e4b48995
Message-Id: <afb8de49d9a8f91cf1b0.1351855139@hastur.hellion.org.uk>
In-Reply-To: <patchbomb.1351855134@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
User-Agent: Mercurial-patchbomb/2.2.2
Date: Fri, 02 Nov 2012 12:18:59 +0100
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
X-SA-Exim-Connect-IP: 192.168.1.164
X-SA-Exim-Mail-From: ian.campbell@citrix.com
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 5 of 5] docs: Include prototype for
	HYPERVISOR_multicall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1351855028 -3600
# Node ID afb8de49d9a8f91cf1b0248842e56be8e4b48995
# Parent  bb43f655bcc863d681fe30cea477f12333dd0cc6
docs: Include prototype for HYPERVISOR_multicall

Mark-up for inclusion of generated docs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r bb43f655bcc8 -r afb8de49d9a8 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Fri Nov 02 12:16:59 2012 +0100
+++ b/xen/include/public/xen.h	Fri Nov 02 12:17:08 2012 +0100
@@ -540,7 +540,10 @@ typedef struct mmu_update mmu_update_t;
 DEFINE_XEN_GUEST_HANDLE(mmu_update_t);
 
 /*
- * Send an array of these to HYPERVISOR_multicall().
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_multicall(multicall_entry_t call_list[],
+ * `                      unsigned int nr_calls);
+ *
  * NB. The fields are natural register size for this architecture.
  */
 struct multicall_entry {

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 11:21:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 11:21:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUFJK-00025F-Ay; Fri, 02 Nov 2012 11:21:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>) id 1TUFJI-00024u-Lv
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 11:21:12 +0000
Received: from [85.158.139.83:19675] by server-12.bemta-5.messagelabs.com id
	73/B8-02886-8ACA3905; Fri, 02 Nov 2012 11:21:12 +0000
X-Env-Sender: ian.campbell@citrix.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1351855271!23854230!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1217 invoked from network); 2 Nov 2012 11:21:11 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Nov 2012 11:21:11 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJH-0007gk-1n; Fri, 02 Nov 2012 11:21:11 +0000
Received: from [192.168.1.164] (helo=hastur.hellion.org.uk)
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJE-0005eU-Fr; Fri, 02 Nov 2012 11:21:10 +0000
MIME-Version: 1.0
X-Mercurial-Node: afb8de49d9a8f91cf1b0248842e56be8e4b48995
Message-Id: <afb8de49d9a8f91cf1b0.1351855139@hastur.hellion.org.uk>
In-Reply-To: <patchbomb.1351855134@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
User-Agent: Mercurial-patchbomb/2.2.2
Date: Fri, 02 Nov 2012 12:18:59 +0100
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
X-SA-Exim-Connect-IP: 192.168.1.164
X-SA-Exim-Mail-From: ian.campbell@citrix.com
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 5 of 5] docs: Include prototype for
	HYPERVISOR_multicall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1351855028 -3600
# Node ID afb8de49d9a8f91cf1b0248842e56be8e4b48995
# Parent  bb43f655bcc863d681fe30cea477f12333dd0cc6
docs: Include prototype for HYPERVISOR_multicall

Mark-up for inclusion of generated docs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r bb43f655bcc8 -r afb8de49d9a8 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Fri Nov 02 12:16:59 2012 +0100
+++ b/xen/include/public/xen.h	Fri Nov 02 12:17:08 2012 +0100
@@ -540,7 +540,10 @@ typedef struct mmu_update mmu_update_t;
 DEFINE_XEN_GUEST_HANDLE(mmu_update_t);
 
 /*
- * Send an array of these to HYPERVISOR_multicall().
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_multicall(multicall_entry_t call_list[],
+ * `                      unsigned int nr_calls);
+ *
  * NB. The fields are natural register size for this architecture.
  */
 struct multicall_entry {

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 11:21:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 11:21:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUFJE-00023y-IL; Fri, 02 Nov 2012 11:21:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>) id 1TUFJC-00023c-OF
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 11:21:06 +0000
Received: from [85.158.139.211:40310] by server-7.bemta-5.messagelabs.com id
	3C/D1-23096-1ACA3905; Fri, 02 Nov 2012 11:21:05 +0000
X-Env-Sender: ian.campbell@citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1351855265!17112920!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10103 invoked from network); 2 Nov 2012 11:21:05 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Nov 2012 11:21:05 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJB-0007gW-6D; Fri, 02 Nov 2012 11:21:05 +0000
Received: from [192.168.1.164] (helo=hastur.hellion.org.uk)
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJ8-0005eU-S4; Fri, 02 Nov 2012 11:21:04 +0000
MIME-Version: 1.0
X-Mercurial-Node: 433d5d988e30e66a9c1f53a9b2c027692f9de11c
Message-Id: <433d5d988e30e66a9c1f.1351855137@hastur.hellion.org.uk>
In-Reply-To: <patchbomb.1351855134@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
User-Agent: Mercurial-patchbomb/2.2.2
Date: Fri, 02 Nov 2012 12:18:57 +0100
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
X-SA-Exim-Connect-IP: 192.168.1.164
X-SA-Exim-Mail-From: ian.campbell@citrix.com
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 3 of 5] docs: Add ToC entry for start of day
	memory layout
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1351855004 -3600
# Node ID 433d5d988e30e66a9c1f53a9b2c027692f9de11c
# Parent  e6880358eba346c386b9faaa30a5489df73a06a0
docs: Add ToC entry for start of day memory layout.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r e6880358eba3 -r 433d5d988e30 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Fri Nov 02 12:16:30 2012 +0100
+++ b/xen/include/public/xen.h	Fri Nov 02 12:16:44 2012 +0100
@@ -680,7 +680,8 @@ typedef struct shared_info shared_info_t
 #endif
 
 /*
- * Start-of-day memory layout:
+ * `incontents 200 startofday Start-of-day memory layout
+ *
  *  1. The domain is started within contiguous virtual-memory region.
  *  2. The contiguous region ends on an aligned 4MB boundary.
  *  3. This the order of bootstrap elements in the initial virtual region:

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 11:21:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 11:21:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUFJE-00023y-IL; Fri, 02 Nov 2012 11:21:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>) id 1TUFJC-00023c-OF
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 11:21:06 +0000
Received: from [85.158.139.211:40310] by server-7.bemta-5.messagelabs.com id
	3C/D1-23096-1ACA3905; Fri, 02 Nov 2012 11:21:05 +0000
X-Env-Sender: ian.campbell@citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1351855265!17112920!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10103 invoked from network); 2 Nov 2012 11:21:05 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Nov 2012 11:21:05 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJB-0007gW-6D; Fri, 02 Nov 2012 11:21:05 +0000
Received: from [192.168.1.164] (helo=hastur.hellion.org.uk)
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJ8-0005eU-S4; Fri, 02 Nov 2012 11:21:04 +0000
MIME-Version: 1.0
X-Mercurial-Node: 433d5d988e30e66a9c1f53a9b2c027692f9de11c
Message-Id: <433d5d988e30e66a9c1f.1351855137@hastur.hellion.org.uk>
In-Reply-To: <patchbomb.1351855134@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
User-Agent: Mercurial-patchbomb/2.2.2
Date: Fri, 02 Nov 2012 12:18:57 +0100
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
X-SA-Exim-Connect-IP: 192.168.1.164
X-SA-Exim-Mail-From: ian.campbell@citrix.com
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 3 of 5] docs: Add ToC entry for start of day
	memory layout
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1351855004 -3600
# Node ID 433d5d988e30e66a9c1f53a9b2c027692f9de11c
# Parent  e6880358eba346c386b9faaa30a5489df73a06a0
docs: Add ToC entry for start of day memory layout.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r e6880358eba3 -r 433d5d988e30 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Fri Nov 02 12:16:30 2012 +0100
+++ b/xen/include/public/xen.h	Fri Nov 02 12:16:44 2012 +0100
@@ -680,7 +680,8 @@ typedef struct shared_info shared_info_t
 #endif
 
 /*
- * Start-of-day memory layout:
+ * `incontents 200 startofday Start-of-day memory layout
+ *
  *  1. The domain is started within contiguous virtual-memory region.
  *  2. The contiguous region ends on an aligned 4MB boundary.
  *  3. This the order of bootstrap elements in the initial virtual region:

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 11:21:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 11:21:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUFJS-000278-Oz; Fri, 02 Nov 2012 11:21:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>) id 1TUFJR-00026F-63
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 11:21:21 +0000
Received: from [85.158.143.35:55529] by server-2.bemta-4.messagelabs.com id
	E1/E2-28922-EACA3905; Fri, 02 Nov 2012 11:21:18 +0000
X-Env-Sender: ian.campbell@citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1351855268!11192668!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30495 invoked from network); 2 Nov 2012 11:21:09 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Nov 2012 11:21:09 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJE-0007gf-Qk; Fri, 02 Nov 2012 11:21:08 +0000
Received: from [192.168.1.164] (helo=hastur.hellion.org.uk)
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJA-0005eU-Rv; Fri, 02 Nov 2012 11:21:08 +0000
MIME-Version: 1.0
X-Mercurial-Node: bb43f655bcc863d681fe30cea477f12333dd0cc6
Message-Id: <bb43f655bcc863d681fe.1351855138@hastur.hellion.org.uk>
In-Reply-To: <patchbomb.1351855134@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
User-Agent: Mercurial-patchbomb/2.2.2
Date: Fri, 02 Nov 2012 12:18:58 +0100
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
X-SA-Exim-Connect-IP: 192.168.1.164
X-SA-Exim-Mail-From: ian.campbell@citrix.com
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 4 of 5] docs: Document
	HYPERVISOR_update_descriptor
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1351855019 -3600
# Node ID bb43f655bcc863d681fe30cea477f12333dd0cc6
# Parent  433d5d988e30e66a9c1f53a9b2c027692f9de11c
docs: Document HYPERVISOR_update_descriptor

Mark-up for inclusion of generated docs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 433d5d988e30 -r bb43f655bcc8 xen/include/public/arch-x86/xen.h
--- a/xen/include/public/arch-x86/xen.h	Fri Nov 02 12:16:44 2012 +0100
+++ b/xen/include/public/arch-x86/xen.h	Fri Nov 02 12:16:59 2012 +0100
@@ -71,7 +71,7 @@ typedef unsigned long xen_pfn_t;
 #endif
 
 /*
- * SEGMENT DESCRIPTOR TABLES
+ * `incontents 200 segdesc Segment Descriptor Tables
  */
 /*
  * ` enum neg_errnoval
@@ -83,11 +83,24 @@ typedef unsigned long xen_pfn_t;
  * start of the GDT because some stupid OSes export hard-coded selector values
  * in their ABI. These hard-coded values are always near the start of the GDT,
  * so Xen places itself out of the way, at the far end of the GDT.
+ *
+ * NB The LDT is set using the MMUEXT_SET_LDT op of HYPERVISOR_mmuext_op
  */
 #define FIRST_RESERVED_GDT_PAGE  14
 #define FIRST_RESERVED_GDT_BYTE  (FIRST_RESERVED_GDT_PAGE * 4096)
 #define FIRST_RESERVED_GDT_ENTRY (FIRST_RESERVED_GDT_BYTE / 8)
 
+
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_update_descriptor(u64 pa, u64 desc);
+ * `
+ * ` @pa   The machine physical address of the descriptor to
+ * `       update. Must be either a descriptor page or writable.
+ * ` @desc The descriptor value to update, in the same format as a
+ * `       native descriptor table entry.
+ */
+
 /* Maximum number of virtual CPUs in legacy multi-processor guests. */
 #define XEN_LEGACY_MAX_VCPUS 32
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 11:21:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 11:21:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUFJS-000278-Oz; Fri, 02 Nov 2012 11:21:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>) id 1TUFJR-00026F-63
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 11:21:21 +0000
Received: from [85.158.143.35:55529] by server-2.bemta-4.messagelabs.com id
	E1/E2-28922-EACA3905; Fri, 02 Nov 2012 11:21:18 +0000
X-Env-Sender: ian.campbell@citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1351855268!11192668!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30495 invoked from network); 2 Nov 2012 11:21:09 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Nov 2012 11:21:09 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJE-0007gf-Qk; Fri, 02 Nov 2012 11:21:08 +0000
Received: from [192.168.1.164] (helo=hastur.hellion.org.uk)
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ian.campbell@citrix.com>)
	id 1TUFJA-0005eU-Rv; Fri, 02 Nov 2012 11:21:08 +0000
MIME-Version: 1.0
X-Mercurial-Node: bb43f655bcc863d681fe30cea477f12333dd0cc6
Message-Id: <bb43f655bcc863d681fe.1351855138@hastur.hellion.org.uk>
In-Reply-To: <patchbomb.1351855134@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
User-Agent: Mercurial-patchbomb/2.2.2
Date: Fri, 02 Nov 2012 12:18:58 +0100
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
X-SA-Exim-Connect-IP: 192.168.1.164
X-SA-Exim-Mail-From: ian.campbell@citrix.com
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 4 of 5] docs: Document
	HYPERVISOR_update_descriptor
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1351855019 -3600
# Node ID bb43f655bcc863d681fe30cea477f12333dd0cc6
# Parent  433d5d988e30e66a9c1f53a9b2c027692f9de11c
docs: Document HYPERVISOR_update_descriptor

Mark-up for inclusion of generated docs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 433d5d988e30 -r bb43f655bcc8 xen/include/public/arch-x86/xen.h
--- a/xen/include/public/arch-x86/xen.h	Fri Nov 02 12:16:44 2012 +0100
+++ b/xen/include/public/arch-x86/xen.h	Fri Nov 02 12:16:59 2012 +0100
@@ -71,7 +71,7 @@ typedef unsigned long xen_pfn_t;
 #endif
 
 /*
- * SEGMENT DESCRIPTOR TABLES
+ * `incontents 200 segdesc Segment Descriptor Tables
  */
 /*
  * ` enum neg_errnoval
@@ -83,11 +83,24 @@ typedef unsigned long xen_pfn_t;
  * start of the GDT because some stupid OSes export hard-coded selector values
  * in their ABI. These hard-coded values are always near the start of the GDT,
  * so Xen places itself out of the way, at the far end of the GDT.
+ *
+ * NB The LDT is set using the MMUEXT_SET_LDT op of HYPERVISOR_mmuext_op
  */
 #define FIRST_RESERVED_GDT_PAGE  14
 #define FIRST_RESERVED_GDT_BYTE  (FIRST_RESERVED_GDT_PAGE * 4096)
 #define FIRST_RESERVED_GDT_ENTRY (FIRST_RESERVED_GDT_BYTE / 8)
 
+
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_update_descriptor(u64 pa, u64 desc);
+ * `
+ * ` @pa   The machine physical address of the descriptor to
+ * `       update. Must be either a descriptor page or writable.
+ * ` @desc The descriptor value to update, in the same format as a
+ * `       native descriptor table entry.
+ */
+
 /* Maximum number of virtual CPUs in legacy multi-processor guests. */
 #define XEN_LEGACY_MAX_VCPUS 32
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 11:34:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 11:34:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUFVk-00033P-8F; Fri, 02 Nov 2012 11:34:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TUFVh-00033K-Uw
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 11:34:02 +0000
Received: from [85.158.138.51:16212] by server-15.bemta-3.messagelabs.com id
	70/25-09445-9AFA3905; Fri, 02 Nov 2012 11:34:01 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1351856039!20400496!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODM2NTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7477 invoked from network); 2 Nov 2012 11:34:00 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 11:34:00 -0000
X-IronPort-AV: E=Sophos;i="4.80,699,1344211200"; d="scan'208";a="213223475"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	02 Nov 2012 11:33:58 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.318.1; Fri, 2 Nov 2012
	07:33:58 -0400
Message-ID: <5093AFA5.4000107@citrix.com>
Date: Fri, 2 Nov 2012 11:33:57 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Ian Campbell <ian.campbell@citrix.com>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
	<e8e1191aef208fbe2f4d.1351855135@hastur.hellion.org.uk>
In-Reply-To: <e8e1191aef208fbe2f4d.1351855135@hastur.hellion.org.uk>
X-Originating-IP: [10.80.2.76]
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 1 of 5] docs: document
	HYPERVISOR_update_va_mapping(_other_domain)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 02/11/12 11:18, Ian Campbell wrote:
> docs: document HYPERVISOR_update_va_mapping(_other_domain)
> 
> Mark-up for inclusion of generated docs.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 
> diff -r 37a8946eeb9d -r e8e1191aef20 xen/include/public/xen.h
> --- a/xen/include/public/xen.h	Fri Oct 26 16:09:29 2012 +0100
> +++ b/xen/include/public/xen.h	Fri Nov 02 12:15:56 2012 +0100
> @@ -423,9 +423,25 @@ typedef struct mmuext_op mmuext_op_t;
>  DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
>  #endif
>  
> +/*
> + * ` enum neg_errnoval
> + * ` HYPERVISOR_update_va_mapping(unsigned long va, u64 val,
> + * `                              enum uvm_flags flags)
> + * `
> + * ` enum neg_errnoval
> + * ` HYPERVISOR_update_va_mapping_otherdomain(unsigned long va, u64 val,
> + * `                                          enum uvm_flags flags,
> + * `                                          domid_t domid)
> + * `
> + * ` @va: The virtual address whose mapping we want to change
> + * ` @val: The new page table entry

Suggest mentioning that this PTE requires the MFN not PFN.

David

> + * ` @flags: Control TLB flushes
> + */
> +*/
>  /* These are passed as 'flags' to update_va_mapping. They can be ORed. */
>  /* When specifying UVMF_MULTI, also OR in a pointer to a CPU bitmap.   */
>  /* UVMF_LOCAL is merely UVMF_MULTI with a NULL bitmap pointer.         */
> +/* ` enum uvm_flags { */
>  #define UVMF_NONE               (0UL<<0) /* No flushing at all.   */
>  #define UVMF_TLB_FLUSH          (1UL<<0) /* Flush entire TLB(s).  */
>  #define UVMF_INVLPG             (2UL<<0) /* Flush only one entry. */
> @@ -433,6 +449,7 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
>  #define UVMF_MULTI              (0UL<<2) /* Flush subset of TLBs. */
>  #define UVMF_LOCAL              (0UL<<2) /* Flush local TLB.      */
>  #define UVMF_ALL                (1UL<<2) /* Flush all TLBs.       */
> +/* ` } */
>  
>  /*
>   * Commands to HYPERVISOR_console_io().
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 11:34:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 11:34:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUFVk-00033P-8F; Fri, 02 Nov 2012 11:34:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TUFVh-00033K-Uw
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 11:34:02 +0000
Received: from [85.158.138.51:16212] by server-15.bemta-3.messagelabs.com id
	70/25-09445-9AFA3905; Fri, 02 Nov 2012 11:34:01 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1351856039!20400496!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODM2NTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7477 invoked from network); 2 Nov 2012 11:34:00 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 11:34:00 -0000
X-IronPort-AV: E=Sophos;i="4.80,699,1344211200"; d="scan'208";a="213223475"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	02 Nov 2012 11:33:58 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.318.1; Fri, 2 Nov 2012
	07:33:58 -0400
Message-ID: <5093AFA5.4000107@citrix.com>
Date: Fri, 2 Nov 2012 11:33:57 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Ian Campbell <ian.campbell@citrix.com>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
	<e8e1191aef208fbe2f4d.1351855135@hastur.hellion.org.uk>
In-Reply-To: <e8e1191aef208fbe2f4d.1351855135@hastur.hellion.org.uk>
X-Originating-IP: [10.80.2.76]
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 1 of 5] docs: document
	HYPERVISOR_update_va_mapping(_other_domain)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 02/11/12 11:18, Ian Campbell wrote:
> docs: document HYPERVISOR_update_va_mapping(_other_domain)
> 
> Mark-up for inclusion of generated docs.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 
> diff -r 37a8946eeb9d -r e8e1191aef20 xen/include/public/xen.h
> --- a/xen/include/public/xen.h	Fri Oct 26 16:09:29 2012 +0100
> +++ b/xen/include/public/xen.h	Fri Nov 02 12:15:56 2012 +0100
> @@ -423,9 +423,25 @@ typedef struct mmuext_op mmuext_op_t;
>  DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
>  #endif
>  
> +/*
> + * ` enum neg_errnoval
> + * ` HYPERVISOR_update_va_mapping(unsigned long va, u64 val,
> + * `                              enum uvm_flags flags)
> + * `
> + * ` enum neg_errnoval
> + * ` HYPERVISOR_update_va_mapping_otherdomain(unsigned long va, u64 val,
> + * `                                          enum uvm_flags flags,
> + * `                                          domid_t domid)
> + * `
> + * ` @va: The virtual address whose mapping we want to change
> + * ` @val: The new page table entry

Suggest mentioning that this PTE requires the MFN not PFN.

David

> + * ` @flags: Control TLB flushes
> + */
> +*/
>  /* These are passed as 'flags' to update_va_mapping. They can be ORed. */
>  /* When specifying UVMF_MULTI, also OR in a pointer to a CPU bitmap.   */
>  /* UVMF_LOCAL is merely UVMF_MULTI with a NULL bitmap pointer.         */
> +/* ` enum uvm_flags { */
>  #define UVMF_NONE               (0UL<<0) /* No flushing at all.   */
>  #define UVMF_TLB_FLUSH          (1UL<<0) /* Flush entire TLB(s).  */
>  #define UVMF_INVLPG             (2UL<<0) /* Flush only one entry. */
> @@ -433,6 +449,7 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
>  #define UVMF_MULTI              (0UL<<2) /* Flush subset of TLBs. */
>  #define UVMF_LOCAL              (0UL<<2) /* Flush local TLB.      */
>  #define UVMF_ALL                (1UL<<2) /* Flush all TLBs.       */
> +/* ` } */
>  
>  /*
>   * Commands to HYPERVISOR_console_io().
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 11:37:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 11:37:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUFYj-0003A6-TX; Fri, 02 Nov 2012 11:37:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dkiper@net-space.pl>) id 1TUFYi-0003A0-Ji
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 11:37:08 +0000
Received: from [85.158.137.99:9050] by server-16.bemta-3.messagelabs.com id
	5A/9D-07461-360B3905; Fri, 02 Nov 2012 11:37:07 +0000
X-Env-Sender: dkiper@net-space.pl
X-Msg-Ref: server-12.tower-217.messagelabs.com!1351856226!14332024!1
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22701 invoked from network); 2 Nov 2012 11:37:07 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-12.tower-217.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 2 Nov 2012 11:37:07 -0000
Received: (from localhost user: 'dkiper' uid#4000 fake: STDIN
	(dkiper@router-fw.net-space.pl)) by router-fw-old.local.net-space.pl
	id S1619235Ab2KBLgv (ORCPT <rfc822;xen-devel@lists.xen.org>);
	Fri, 2 Nov 2012 12:36:51 +0100
Date: Fri, 2 Nov 2012 12:36:51 +0100
From: Daniel Kiper <dkiper@net-space.pl>
To: Jan Beulich <jbeulich@suse.com>
Message-ID: <20121102113651.GA9845@router-fw-old.local.net-space.pl>
References: <504F3355.2070201@tiscali.it>
	<504F5182020000780009A9CC@nat28.tlf.novell.com>
	<504F39F0.10701@tiscali.it>
	<504F625D020000780009AA85@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
	<5092D42A020000780008EB7B@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5092D42A020000780008EB7B@nat28.tlf.novell.com>
User-Agent: Mutt/1.3.28i
Cc: konrad.wilk@oracle.com, daniel.kiper@oracle.com, fantonifabio@tiscali.it,
	george.dunlap@citrix.com, xen-devel@lists.xen.org,
	stefano.stabellini@eu.citrix.com
Subject: Re: [Xen-devel] Start xen on UEFI system with grub
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 01, 2012 at 07:57:30PM +0000, Jan Beulich wrote:
> >>> Stefano Stabellini <stefano.stabellini@eu.citrix.com> 11/01/12 4:50 PM >>>
> >On Tue, 11 Sep 2012, Jan Beulich wrote:
> >> >>> On 11.09.12 at 15:17, Fabio Fantoni <fantonifabio@tiscali.it> wrote:
> >> > xen.efi not compile when we build xen on Wheezy and probably is not
> >> > possible boot with lvm volume, fallback options ecc...
> >>
> >> Just get a suitable tool chain installed then.
> >>
> >> > UEFI with grub2 seem the best option but with xen hypervisor seem not
> >> > load efi variable.
> >>
> >> Sure, because only xen.efi has the code to deal with such.
> >>
> >> (Btw., I assume you aren't aware that any boot manager
> >> whatsoever, other than the one coming with EFI, is sort of
> >> bogus under EFI?)
> >
> >Unfortunately it looks like more and more people are of the opinion that
> >grub2 is useful even on UEFI firmware.
> >For example, it is pretty clear that Ubuntu is still going to boot Xen
> >via grub2 no matter how the firmware looks like.
>
> Then they need to be tought how to do it properly, the more that Linux itself
> now is capable of booting without a boot loader (other than the EFI one).
>
> >What would it take to make Xen work properly with grub2 on a UEFI firmware?
>
> I can't be that difficult.
>
> >I think that we should add it as a work item for Xen 4.3.
>
> If you have someone to do that work. I'm willing to review the resulting
> changes, but I currently don't see me doing anything here (as being totally
> unimportant and - just to repeat that - conceptually wrong).

Heh... I agree with Jan but there are so many things conceptually wrong
used by millions of people and we could not change that. Let's fix
(broke?) it. I am going to work on EFI stuff in upstream kernel and
I think this task could be assigned to me too.

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 11:37:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 11:37:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUFYj-0003A6-TX; Fri, 02 Nov 2012 11:37:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dkiper@net-space.pl>) id 1TUFYi-0003A0-Ji
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 11:37:08 +0000
Received: from [85.158.137.99:9050] by server-16.bemta-3.messagelabs.com id
	5A/9D-07461-360B3905; Fri, 02 Nov 2012 11:37:07 +0000
X-Env-Sender: dkiper@net-space.pl
X-Msg-Ref: server-12.tower-217.messagelabs.com!1351856226!14332024!1
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22701 invoked from network); 2 Nov 2012 11:37:07 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-12.tower-217.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 2 Nov 2012 11:37:07 -0000
Received: (from localhost user: 'dkiper' uid#4000 fake: STDIN
	(dkiper@router-fw.net-space.pl)) by router-fw-old.local.net-space.pl
	id S1619235Ab2KBLgv (ORCPT <rfc822;xen-devel@lists.xen.org>);
	Fri, 2 Nov 2012 12:36:51 +0100
Date: Fri, 2 Nov 2012 12:36:51 +0100
From: Daniel Kiper <dkiper@net-space.pl>
To: Jan Beulich <jbeulich@suse.com>
Message-ID: <20121102113651.GA9845@router-fw-old.local.net-space.pl>
References: <504F3355.2070201@tiscali.it>
	<504F5182020000780009A9CC@nat28.tlf.novell.com>
	<504F39F0.10701@tiscali.it>
	<504F625D020000780009AA85@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
	<5092D42A020000780008EB7B@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5092D42A020000780008EB7B@nat28.tlf.novell.com>
User-Agent: Mutt/1.3.28i
Cc: konrad.wilk@oracle.com, daniel.kiper@oracle.com, fantonifabio@tiscali.it,
	george.dunlap@citrix.com, xen-devel@lists.xen.org,
	stefano.stabellini@eu.citrix.com
Subject: Re: [Xen-devel] Start xen on UEFI system with grub
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 01, 2012 at 07:57:30PM +0000, Jan Beulich wrote:
> >>> Stefano Stabellini <stefano.stabellini@eu.citrix.com> 11/01/12 4:50 PM >>>
> >On Tue, 11 Sep 2012, Jan Beulich wrote:
> >> >>> On 11.09.12 at 15:17, Fabio Fantoni <fantonifabio@tiscali.it> wrote:
> >> > xen.efi not compile when we build xen on Wheezy and probably is not
> >> > possible boot with lvm volume, fallback options ecc...
> >>
> >> Just get a suitable tool chain installed then.
> >>
> >> > UEFI with grub2 seem the best option but with xen hypervisor seem not
> >> > load efi variable.
> >>
> >> Sure, because only xen.efi has the code to deal with such.
> >>
> >> (Btw., I assume you aren't aware that any boot manager
> >> whatsoever, other than the one coming with EFI, is sort of
> >> bogus under EFI?)
> >
> >Unfortunately it looks like more and more people are of the opinion that
> >grub2 is useful even on UEFI firmware.
> >For example, it is pretty clear that Ubuntu is still going to boot Xen
> >via grub2 no matter how the firmware looks like.
>
> Then they need to be tought how to do it properly, the more that Linux itself
> now is capable of booting without a boot loader (other than the EFI one).
>
> >What would it take to make Xen work properly with grub2 on a UEFI firmware?
>
> I can't be that difficult.
>
> >I think that we should add it as a work item for Xen 4.3.
>
> If you have someone to do that work. I'm willing to review the resulting
> changes, but I currently don't see me doing anything here (as being totally
> unimportant and - just to repeat that - conceptually wrong).

Heh... I agree with Jan but there are so many things conceptually wrong
used by millions of people and we could not change that. Let's fix
(broke?) it. I am going to work on EFI stuff in upstream kernel and
I think this task could be assigned to me too.

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 13:10:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 13:10:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUH0N-0005Wb-Cx; Fri, 02 Nov 2012 13:09:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TUH0M-0005WW-Eh
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 13:09:46 +0000
Received: from [85.158.139.211:20972] by server-3.bemta-5.messagelabs.com id
	63/AE-18736-916C3905; Fri, 02 Nov 2012 13:09:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1351861779!17128478!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODM2NTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29381 invoked from network); 2 Nov 2012 13:09:40 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 13:09:40 -0000
X-IronPort-AV: E=Sophos;i="4.80,699,1344211200"; d="scan'208";a="213230762"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	02 Nov 2012 13:09:07 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 2 Nov 2012 09:09:07 -0400
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TUGzh-0007Xb-Hu;
	Fri, 02 Nov 2012 13:09:06 +0000
Message-ID: <1351861627.25014.50.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: David Vrabel <david.vrabel@citrix.com>
Date: Fri, 2 Nov 2012 13:07:07 +0000
In-Reply-To: <5093AFA5.4000107@citrix.com>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
	<e8e1191aef208fbe2f4d.1351855135@hastur.hellion.org.uk>
	<5093AFA5.4000107@citrix.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1 of 5] docs: document
 HYPERVISOR_update_va_mapping(_other_domain)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-02 at 11:33 +0000, David Vrabel wrote:
> > + * ` @va: The virtual address whose mapping we want to change
> > + * ` @val: The new page table entry
> 
> Suggest mentioning that this PTE requires the MFN not PFN.

Good idea.

8<---------------------------------------------

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1351861598 0
# Node ID 3753cf4617500ee0ac443eeba4f6a12257d77253
# Parent  37a8946eeb9db8b5eafc1c75aded006ad5322af8
docs: document HYPERVISOR_update_va_mapping(_other_domain)

Mark-up for inclusion of generated docs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 37a8946eeb9d -r 3753cf461750 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Fri Oct 26 16:09:29 2012 +0100
+++ b/xen/include/public/xen.h	Fri Nov 02 13:06:38 2012 +0000
@@ -423,9 +423,25 @@ typedef struct mmuext_op mmuext_op_t;
 DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
 #endif
 
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_update_va_mapping(unsigned long va, u64 val,
+ * `                              enum uvm_flags flags)
+ * `
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_update_va_mapping_otherdomain(unsigned long va, u64 val,
+ * `                                          enum uvm_flags flags,
+ * `                                          domid_t domid)
+ * `
+ * ` @va: The virtual address whose mapping we want to change
+ * ` @val: The new page table entry, must contain a machine address
+ * ` @flags: Control TLB flushes
+ */
+*/
 /* These are passed as 'flags' to update_va_mapping. They can be ORed. */
 /* When specifying UVMF_MULTI, also OR in a pointer to a CPU bitmap.   */
 /* UVMF_LOCAL is merely UVMF_MULTI with a NULL bitmap pointer.         */
+/* ` enum uvm_flags { */
 #define UVMF_NONE               (0UL<<0) /* No flushing at all.   */
 #define UVMF_TLB_FLUSH          (1UL<<0) /* Flush entire TLB(s).  */
 #define UVMF_INVLPG             (2UL<<0) /* Flush only one entry. */
@@ -433,6 +449,7 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
 #define UVMF_MULTI              (0UL<<2) /* Flush subset of TLBs. */
 #define UVMF_LOCAL              (0UL<<2) /* Flush local TLB.      */
 #define UVMF_ALL                (1UL<<2) /* Flush all TLBs.       */
+/* ` } */
 
 /*
  * Commands to HYPERVISOR_console_io().



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 13:10:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 13:10:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUH0N-0005Wb-Cx; Fri, 02 Nov 2012 13:09:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TUH0M-0005WW-Eh
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 13:09:46 +0000
Received: from [85.158.139.211:20972] by server-3.bemta-5.messagelabs.com id
	63/AE-18736-916C3905; Fri, 02 Nov 2012 13:09:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1351861779!17128478!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODM2NTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29381 invoked from network); 2 Nov 2012 13:09:40 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 13:09:40 -0000
X-IronPort-AV: E=Sophos;i="4.80,699,1344211200"; d="scan'208";a="213230762"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	02 Nov 2012 13:09:07 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 2 Nov 2012 09:09:07 -0400
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TUGzh-0007Xb-Hu;
	Fri, 02 Nov 2012 13:09:06 +0000
Message-ID: <1351861627.25014.50.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: David Vrabel <david.vrabel@citrix.com>
Date: Fri, 2 Nov 2012 13:07:07 +0000
In-Reply-To: <5093AFA5.4000107@citrix.com>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
	<e8e1191aef208fbe2f4d.1351855135@hastur.hellion.org.uk>
	<5093AFA5.4000107@citrix.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1 of 5] docs: document
 HYPERVISOR_update_va_mapping(_other_domain)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-02 at 11:33 +0000, David Vrabel wrote:
> > + * ` @va: The virtual address whose mapping we want to change
> > + * ` @val: The new page table entry
> 
> Suggest mentioning that this PTE requires the MFN not PFN.

Good idea.

8<---------------------------------------------

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1351861598 0
# Node ID 3753cf4617500ee0ac443eeba4f6a12257d77253
# Parent  37a8946eeb9db8b5eafc1c75aded006ad5322af8
docs: document HYPERVISOR_update_va_mapping(_other_domain)

Mark-up for inclusion of generated docs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 37a8946eeb9d -r 3753cf461750 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Fri Oct 26 16:09:29 2012 +0100
+++ b/xen/include/public/xen.h	Fri Nov 02 13:06:38 2012 +0000
@@ -423,9 +423,25 @@ typedef struct mmuext_op mmuext_op_t;
 DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
 #endif
 
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_update_va_mapping(unsigned long va, u64 val,
+ * `                              enum uvm_flags flags)
+ * `
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_update_va_mapping_otherdomain(unsigned long va, u64 val,
+ * `                                          enum uvm_flags flags,
+ * `                                          domid_t domid)
+ * `
+ * ` @va: The virtual address whose mapping we want to change
+ * ` @val: The new page table entry, must contain a machine address
+ * ` @flags: Control TLB flushes
+ */
+*/
 /* These are passed as 'flags' to update_va_mapping. They can be ORed. */
 /* When specifying UVMF_MULTI, also OR in a pointer to a CPU bitmap.   */
 /* UVMF_LOCAL is merely UVMF_MULTI with a NULL bitmap pointer.         */
+/* ` enum uvm_flags { */
 #define UVMF_NONE               (0UL<<0) /* No flushing at all.   */
 #define UVMF_TLB_FLUSH          (1UL<<0) /* Flush entire TLB(s).  */
 #define UVMF_INVLPG             (2UL<<0) /* Flush only one entry. */
@@ -433,6 +449,7 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
 #define UVMF_MULTI              (0UL<<2) /* Flush subset of TLBs. */
 #define UVMF_LOCAL              (0UL<<2) /* Flush local TLB.      */
 #define UVMF_ALL                (1UL<<2) /* Flush all TLBs.       */
+/* ` } */
 
 /*
  * Commands to HYPERVISOR_console_io().



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 13:11:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 13:11:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUH23-0005j3-0Y; Fri, 02 Nov 2012 13:11:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUH21-0005io-7Q
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 13:11:29 +0000
Received: from [85.158.139.83:23300] by server-9.bemta-5.messagelabs.com id
	11/65-29295-E76C3905; Fri, 02 Nov 2012 13:11:26 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1351861885!27785537!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20504 invoked from network); 2 Nov 2012 13:11:25 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-182.messagelabs.com with SMTP;
	2 Nov 2012 13:11:25 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 13:11:27 +0000
Message-Id: <5093D4B502000078000A606E@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 13:12:05 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartD8E916B5.0__="
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [Xen-devel] [PATCH] ACPI/cpuidle: remove unused "power" field from
 Cx state data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartD8E916B5.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

It has never been used for anything, and Linux 3.7 doesn't propagate
this information anymore.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Konrad, on the pv-ops side it may be better to pass zero rather than
leaving the field completely uninitialized.

--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -935,7 +935,6 @@ static void set_cx(
     }
=20
     cx->latency  =3D xen_cx->latency;
-    cx->power    =3D xen_cx->power;
    =20
     cx->target_residency =3D cx->latency * latency_factor;
     if ( cx->type =3D=3D ACPI_STATE_C1 || cx->type =3D=3D ACPI_STATE_C2 )
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -96,7 +96,6 @@ static const struct cpuidle_state {
 	char		name[16];
 	unsigned int	flags;
 	unsigned int	exit_latency; /* in US */
-	int		power_usage; /* in mW */
 	unsigned int	target_residency; /* in US */
 } *cpuidle_state_table;
=20
@@ -479,7 +478,6 @@ static int mwait_idle_cpu_init(struct no
 		cx->type =3D cstate;
 		cx->address =3D get_driver_data(cstate);
 		cx->entry_method =3D ACPI_CSTATE_EM_FFH;
-		cx->power =3D cpuidle_state_table[cstate].power_usage;
 		cx->latency =3D cpuidle_state_table[cstate].exit_latency;
 		cx->target_residency =3D
 			cpuidle_state_table[cstate].target_residency;
--- a/xen/include/xen/cpuidle.h
+++ b/xen/include/xen/cpuidle.h
@@ -46,7 +46,6 @@ struct acpi_processor_cx
     u32 address;
     u32 latency;
     u32 target_residency;
-    u32 power;
     u32 usage;
     u64 time;
 };




--=__PartD8E916B5.0__=
Content-Type: text/plain; name="ACPI-cpuidle-no-power-field.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="ACPI-cpuidle-no-power-field.patch"

ACPI/cpuidle: remove unused "power" field from Cx state data=0A=0AIt has =
never been used for anything, and Linux 3.7 doesn't propagate=0Athis =
information anymore.=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=
---=0AKonrad, on the pv-ops side it may be better to pass zero rather =
than=0Aleaving the field completely uninitialized.=0A=0A--- a/xen/arch/x86/=
acpi/cpu_idle.c=0A+++ b/xen/arch/x86/acpi/cpu_idle.c=0A@@ -935,7 +935,6 @@ =
static void set_cx(=0A     }=0A =0A     cx->latency  =3D xen_cx->latency;=
=0A-    cx->power    =3D xen_cx->power;=0A     =0A     cx->target_residency=
 =3D cx->latency * latency_factor;=0A     if ( cx->type =3D=3D ACPI_STATE_C=
1 || cx->type =3D=3D ACPI_STATE_C2 )=0A--- a/xen/arch/x86/cpu/mwait-idle.c=
=0A+++ b/xen/arch/x86/cpu/mwait-idle.c=0A@@ -96,7 +96,6 @@ static const =
struct cpuidle_state {=0A 	char		name[16];=0A 	unsigned =
int	flags;=0A 	unsigned int	exit_latency; /* in US */=0A-	=
int		power_usage; /* in mW */=0A 	unsigned int	target_resi=
dency; /* in US */=0A } *cpuidle_state_table;=0A =0A@@ -479,7 +478,6 @@ =
static int mwait_idle_cpu_init(struct no=0A 		cx->type =3D =
cstate;=0A 		cx->address =3D get_driver_data(cstate);=0A 		=
cx->entry_method =3D ACPI_CSTATE_EM_FFH;=0A-		cx->power =3D =
cpuidle_state_table[cstate].power_usage;=0A 		cx->latency =3D =
cpuidle_state_table[cstate].exit_latency;=0A 		cx->target_residenc=
y =3D=0A 			cpuidle_state_table[cstate].target_residenc=
y;=0A--- a/xen/include/xen/cpuidle.h=0A+++ b/xen/include/xen/cpuidle.h=0A@@=
 -46,7 +46,6 @@ struct acpi_processor_cx=0A     u32 address;=0A     u32 =
latency;=0A     u32 target_residency;=0A-    u32 power;=0A     u32 =
usage;=0A     u64 time;=0A };=0A
--=__PartD8E916B5.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.xen.org
http://lists.xen.org/xen-devel

--=__PartD8E916B5.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 02 13:11:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 13:11:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUH23-0005j3-0Y; Fri, 02 Nov 2012 13:11:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUH21-0005io-7Q
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 13:11:29 +0000
Received: from [85.158.139.83:23300] by server-9.bemta-5.messagelabs.com id
	11/65-29295-E76C3905; Fri, 02 Nov 2012 13:11:26 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1351861885!27785537!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20504 invoked from network); 2 Nov 2012 13:11:25 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-182.messagelabs.com with SMTP;
	2 Nov 2012 13:11:25 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 13:11:27 +0000
Message-Id: <5093D4B502000078000A606E@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 13:12:05 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartD8E916B5.0__="
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [Xen-devel] [PATCH] ACPI/cpuidle: remove unused "power" field from
 Cx state data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartD8E916B5.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

It has never been used for anything, and Linux 3.7 doesn't propagate
this information anymore.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Konrad, on the pv-ops side it may be better to pass zero rather than
leaving the field completely uninitialized.

--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -935,7 +935,6 @@ static void set_cx(
     }
=20
     cx->latency  =3D xen_cx->latency;
-    cx->power    =3D xen_cx->power;
    =20
     cx->target_residency =3D cx->latency * latency_factor;
     if ( cx->type =3D=3D ACPI_STATE_C1 || cx->type =3D=3D ACPI_STATE_C2 )
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -96,7 +96,6 @@ static const struct cpuidle_state {
 	char		name[16];
 	unsigned int	flags;
 	unsigned int	exit_latency; /* in US */
-	int		power_usage; /* in mW */
 	unsigned int	target_residency; /* in US */
 } *cpuidle_state_table;
=20
@@ -479,7 +478,6 @@ static int mwait_idle_cpu_init(struct no
 		cx->type =3D cstate;
 		cx->address =3D get_driver_data(cstate);
 		cx->entry_method =3D ACPI_CSTATE_EM_FFH;
-		cx->power =3D cpuidle_state_table[cstate].power_usage;
 		cx->latency =3D cpuidle_state_table[cstate].exit_latency;
 		cx->target_residency =3D
 			cpuidle_state_table[cstate].target_residency;
--- a/xen/include/xen/cpuidle.h
+++ b/xen/include/xen/cpuidle.h
@@ -46,7 +46,6 @@ struct acpi_processor_cx
     u32 address;
     u32 latency;
     u32 target_residency;
-    u32 power;
     u32 usage;
     u64 time;
 };




--=__PartD8E916B5.0__=
Content-Type: text/plain; name="ACPI-cpuidle-no-power-field.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="ACPI-cpuidle-no-power-field.patch"

ACPI/cpuidle: remove unused "power" field from Cx state data=0A=0AIt has =
never been used for anything, and Linux 3.7 doesn't propagate=0Athis =
information anymore.=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=
---=0AKonrad, on the pv-ops side it may be better to pass zero rather =
than=0Aleaving the field completely uninitialized.=0A=0A--- a/xen/arch/x86/=
acpi/cpu_idle.c=0A+++ b/xen/arch/x86/acpi/cpu_idle.c=0A@@ -935,7 +935,6 @@ =
static void set_cx(=0A     }=0A =0A     cx->latency  =3D xen_cx->latency;=
=0A-    cx->power    =3D xen_cx->power;=0A     =0A     cx->target_residency=
 =3D cx->latency * latency_factor;=0A     if ( cx->type =3D=3D ACPI_STATE_C=
1 || cx->type =3D=3D ACPI_STATE_C2 )=0A--- a/xen/arch/x86/cpu/mwait-idle.c=
=0A+++ b/xen/arch/x86/cpu/mwait-idle.c=0A@@ -96,7 +96,6 @@ static const =
struct cpuidle_state {=0A 	char		name[16];=0A 	unsigned =
int	flags;=0A 	unsigned int	exit_latency; /* in US */=0A-	=
int		power_usage; /* in mW */=0A 	unsigned int	target_resi=
dency; /* in US */=0A } *cpuidle_state_table;=0A =0A@@ -479,7 +478,6 @@ =
static int mwait_idle_cpu_init(struct no=0A 		cx->type =3D =
cstate;=0A 		cx->address =3D get_driver_data(cstate);=0A 		=
cx->entry_method =3D ACPI_CSTATE_EM_FFH;=0A-		cx->power =3D =
cpuidle_state_table[cstate].power_usage;=0A 		cx->latency =3D =
cpuidle_state_table[cstate].exit_latency;=0A 		cx->target_residenc=
y =3D=0A 			cpuidle_state_table[cstate].target_residenc=
y;=0A--- a/xen/include/xen/cpuidle.h=0A+++ b/xen/include/xen/cpuidle.h=0A@@=
 -46,7 +46,6 @@ struct acpi_processor_cx=0A     u32 address;=0A     u32 =
latency;=0A     u32 target_residency;=0A-    u32 power;=0A     u32 =
usage;=0A     u64 time;=0A };=0A
--=__PartD8E916B5.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.xen.org
http://lists.xen.org/xen-devel

--=__PartD8E916B5.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 02 13:13:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 13:13:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUH3c-0005pC-GN; Fri, 02 Nov 2012 13:13:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUH3b-0005p3-AN
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 13:13:07 +0000
Received: from [85.158.139.83:20011] by server-15.bemta-5.messagelabs.com id
	DB/85-26920-2E6C3905; Fri, 02 Nov 2012 13:13:06 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1351861985!27785834!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26058 invoked from network); 2 Nov 2012 13:13:05 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-182.messagelabs.com with SMTP;
	2 Nov 2012 13:13:05 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 13:13:08 +0000
Message-Id: <5093D51B02000078000A607C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 13:13:47 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part7746B91B.0__="
Subject: [Xen-devel] [PATCH] x86/mwait-idle: enable Ivy Bridge Xeon support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part7746B91B.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Matching a similar change in Linux 3.7-rc.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -365,6 +365,7 @@ static struct intel_idle_id {
 	ICPU(0x2a, snb),
 	ICPU(0x2d, snb),
 	ICPU(0x3a, ivb),
+	ICPU(0x3e, ivb),
 	{}
 };
=20




--=__Part7746B91B.0__=
Content-Type: text/plain; name="x86-IvyBridge-idle.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="x86-IvyBridge-idle.patch"

x86/mwait-idle: enable Ivy Bridge Xeon support=0A=0AMatching a similar =
change in Linux 3.7-rc.=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=
=0A=0A--- a/xen/arch/x86/cpu/mwait-idle.c=0A+++ b/xen/arch/x86/cpu/mwait-id=
le.c=0A@@ -365,6 +365,7 @@ static struct intel_idle_id {=0A 	ICPU(0x2a, =
snb),=0A 	ICPU(0x2d, snb),=0A 	ICPU(0x3a, ivb),=0A+	ICPU(0x3e, =
ivb),=0A 	{}=0A };=0A =0A
--=__Part7746B91B.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.xen.org
http://lists.xen.org/xen-devel

--=__Part7746B91B.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 02 13:13:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 13:13:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUH3c-0005pC-GN; Fri, 02 Nov 2012 13:13:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUH3b-0005p3-AN
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 13:13:07 +0000
Received: from [85.158.139.83:20011] by server-15.bemta-5.messagelabs.com id
	DB/85-26920-2E6C3905; Fri, 02 Nov 2012 13:13:06 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1351861985!27785834!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26058 invoked from network); 2 Nov 2012 13:13:05 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-182.messagelabs.com with SMTP;
	2 Nov 2012 13:13:05 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 13:13:08 +0000
Message-Id: <5093D51B02000078000A607C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 13:13:47 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part7746B91B.0__="
Subject: [Xen-devel] [PATCH] x86/mwait-idle: enable Ivy Bridge Xeon support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part7746B91B.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Matching a similar change in Linux 3.7-rc.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -365,6 +365,7 @@ static struct intel_idle_id {
 	ICPU(0x2a, snb),
 	ICPU(0x2d, snb),
 	ICPU(0x3a, ivb),
+	ICPU(0x3e, ivb),
 	{}
 };
=20




--=__Part7746B91B.0__=
Content-Type: text/plain; name="x86-IvyBridge-idle.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="x86-IvyBridge-idle.patch"

x86/mwait-idle: enable Ivy Bridge Xeon support=0A=0AMatching a similar =
change in Linux 3.7-rc.=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=
=0A=0A--- a/xen/arch/x86/cpu/mwait-idle.c=0A+++ b/xen/arch/x86/cpu/mwait-id=
le.c=0A@@ -365,6 +365,7 @@ static struct intel_idle_id {=0A 	ICPU(0x2a, =
snb),=0A 	ICPU(0x2d, snb),=0A 	ICPU(0x3a, ivb),=0A+	ICPU(0x3e, =
ivb),=0A 	{}=0A };=0A =0A
--=__Part7746B91B.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.xen.org
http://lists.xen.org/xen-devel

--=__Part7746B91B.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 02 13:20:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 13:20:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUHAC-00065l-D7; Fri, 02 Nov 2012 13:19:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TUHAB-00065g-CR
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 13:19:55 +0000
Received: from [85.158.139.83:18980] by server-5.bemta-5.messagelabs.com id
	DF/B6-11353-A78C3905; Fri, 02 Nov 2012 13:19:54 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-12.tower-182.messagelabs.com!1351862392!28469977!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28181 invoked from network); 2 Nov 2012 13:19:53 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-12.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 2 Nov 2012 13:19:53 -0000
Received: from ([128.244.198.90])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148072870;
	Fri, 02 Nov 2012 09:19:35 -0400
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas1.dom1.jhuapl.edu ([128.244.198.90]) with mapi; Fri, 2 Nov 2012
	09:19:35 -0400
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Fri, 2 Nov 2012 09:19:34 -0400
Thread-Topic: [PATCH VTPM 1/9] Disable -DGNT_DEBUG and -DGNTMAP_DEBUG
Thread-Index: Ac24eAahX8hXvh1QQMOaS0N/XXlNOwAhIkOw
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48A1C7BA68@aplesstripe.dom1.jhuapl.edu>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121101212931.GQ5569@type.youpi.perso.aquilenet.fr>
In-Reply-To: <20121101212931.GQ5569@type.youpi.perso.aquilenet.fr>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 1/9] Disable -DGNT_DEBUG and
	-DGNTMAP_DEBUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

It happens in my vtpm domains because the drivers often create and release =
grant references. This patch isn't completely necessary. Do we want to have=
 these debug prints in the default build?

-----Original Message-----
From: Samuel Thibault [mailto:samuel.thibault@ens-lyon.org] =

Sent: Thursday, November 01, 2012 5:30 PM
To: Fioravante, Matthew E.
Cc: Ian.Campbell@citrix.com; xen-devel@lists.xen.org
Subject: Re: [PATCH VTPM 1/9] Disable -DGNT_DEBUG and -DGNTMAP_DEBUG

Matthew Fioravante, le Thu 01 Nov 2012 16:33:24 -0400, a =E9crit :
> Disabling the above flags in default mini-os build. They generate a =

> lot of spam.

Do they?  I've never seen any, and normally they shouldn't be, so there cou=
ld be another issue.  Could you show what happens?

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 13:20:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 13:20:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUHAC-00065l-D7; Fri, 02 Nov 2012 13:19:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TUHAB-00065g-CR
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 13:19:55 +0000
Received: from [85.158.139.83:18980] by server-5.bemta-5.messagelabs.com id
	DF/B6-11353-A78C3905; Fri, 02 Nov 2012 13:19:54 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-12.tower-182.messagelabs.com!1351862392!28469977!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28181 invoked from network); 2 Nov 2012 13:19:53 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-12.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 2 Nov 2012 13:19:53 -0000
Received: from ([128.244.198.90])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148072870;
	Fri, 02 Nov 2012 09:19:35 -0400
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas1.dom1.jhuapl.edu ([128.244.198.90]) with mapi; Fri, 2 Nov 2012
	09:19:35 -0400
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Fri, 2 Nov 2012 09:19:34 -0400
Thread-Topic: [PATCH VTPM 1/9] Disable -DGNT_DEBUG and -DGNTMAP_DEBUG
Thread-Index: Ac24eAahX8hXvh1QQMOaS0N/XXlNOwAhIkOw
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48A1C7BA68@aplesstripe.dom1.jhuapl.edu>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121101212931.GQ5569@type.youpi.perso.aquilenet.fr>
In-Reply-To: <20121101212931.GQ5569@type.youpi.perso.aquilenet.fr>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 1/9] Disable -DGNT_DEBUG and
	-DGNTMAP_DEBUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

It happens in my vtpm domains because the drivers often create and release =
grant references. This patch isn't completely necessary. Do we want to have=
 these debug prints in the default build?

-----Original Message-----
From: Samuel Thibault [mailto:samuel.thibault@ens-lyon.org] =

Sent: Thursday, November 01, 2012 5:30 PM
To: Fioravante, Matthew E.
Cc: Ian.Campbell@citrix.com; xen-devel@lists.xen.org
Subject: Re: [PATCH VTPM 1/9] Disable -DGNT_DEBUG and -DGNTMAP_DEBUG

Matthew Fioravante, le Thu 01 Nov 2012 16:33:24 -0400, a =E9crit :
> Disabling the above flags in default mini-os build. They generate a =

> lot of spam.

Do they?  I've never seen any, and normally they shouldn't be, so there cou=
ld be another issue.  Could you show what happens?

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 13:23:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 13:23:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUHCu-0006Lu-48; Fri, 02 Nov 2012 13:22:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TUHCs-0006Lh-Ap
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 13:22:42 +0000
Received: from [85.158.137.99:65314] by server-5.bemta-3.messagelabs.com id
	C5/AF-26311-129C3905; Fri, 02 Nov 2012 13:22:41 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-8.tower-217.messagelabs.com!1351862559!12122839!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26091 invoked from network); 2 Nov 2012 13:22:40 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-8.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 2 Nov 2012 13:22:40 -0000
Received: from ([128.244.198.90])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148073138;
	Fri, 02 Nov 2012 09:22:24 -0400
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas1.dom1.jhuapl.edu ([128.244.198.90]) with mapi; Fri, 2 Nov 2012
	09:22:24 -0400
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Fri, 2 Nov 2012 09:22:23 -0400
Thread-Topic: [PATCH VTPM 4/9] fix bug in lseek for mini-os
Thread-Index: Ac24eL4vcRrcEd6zQouCzs5eticUnAAhD1Ug
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48A1C7BA70@aplesstripe.dom1.jhuapl.edu>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1351802007-19178-4-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121101213450.GS5569@type.youpi.perso.aquilenet.fr>
In-Reply-To: <20121101213450.GS5569@type.youpi.perso.aquilenet.fr>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 4/9] fix bug in lseek for mini-os
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Good catch. Fix will be in the next round of patches.

-----Original Message-----
From: Samuel Thibault [mailto:samuel.thibault@ens-lyon.org] =

Sent: Thursday, November 01, 2012 5:35 PM
To: Fioravante, Matthew E.
Cc: Ian.Campbell@citrix.com; xen-devel@lists.xen.org
Subject: Re: [PATCH VTPM 4/9] fix bug in lseek for mini-os

Matthew Fioravante, le Thu 01 Nov 2012 16:33:27 -0400, a =E9crit :
> -#if defined(CONFIG_BLKFRONT) || defined(CONFIG_TPMFRONT) || =

> defined(CONFIG_TPM_TIS)

...

>  #ifdef CONFIG_TPMFRNT

There seems to be a mismatch here between CONFIG_TPMFRONT and CONFIG_TPMFRN=
T?

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 13:23:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 13:23:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUHCu-0006Lu-48; Fri, 02 Nov 2012 13:22:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TUHCs-0006Lh-Ap
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 13:22:42 +0000
Received: from [85.158.137.99:65314] by server-5.bemta-3.messagelabs.com id
	C5/AF-26311-129C3905; Fri, 02 Nov 2012 13:22:41 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-8.tower-217.messagelabs.com!1351862559!12122839!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26091 invoked from network); 2 Nov 2012 13:22:40 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-8.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 2 Nov 2012 13:22:40 -0000
Received: from ([128.244.198.90])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148073138;
	Fri, 02 Nov 2012 09:22:24 -0400
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas1.dom1.jhuapl.edu ([128.244.198.90]) with mapi; Fri, 2 Nov 2012
	09:22:24 -0400
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Fri, 2 Nov 2012 09:22:23 -0400
Thread-Topic: [PATCH VTPM 4/9] fix bug in lseek for mini-os
Thread-Index: Ac24eL4vcRrcEd6zQouCzs5eticUnAAhD1Ug
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48A1C7BA70@aplesstripe.dom1.jhuapl.edu>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1351802007-19178-4-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121101213450.GS5569@type.youpi.perso.aquilenet.fr>
In-Reply-To: <20121101213450.GS5569@type.youpi.perso.aquilenet.fr>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 4/9] fix bug in lseek for mini-os
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Good catch. Fix will be in the next round of patches.

-----Original Message-----
From: Samuel Thibault [mailto:samuel.thibault@ens-lyon.org] =

Sent: Thursday, November 01, 2012 5:35 PM
To: Fioravante, Matthew E.
Cc: Ian.Campbell@citrix.com; xen-devel@lists.xen.org
Subject: Re: [PATCH VTPM 4/9] fix bug in lseek for mini-os

Matthew Fioravante, le Thu 01 Nov 2012 16:33:27 -0400, a =E9crit :
> -#if defined(CONFIG_BLKFRONT) || defined(CONFIG_TPMFRONT) || =

> defined(CONFIG_TPM_TIS)

...

>  #ifdef CONFIG_TPMFRNT

There seems to be a mismatch here between CONFIG_TPMFRONT and CONFIG_TPMFRN=
T?

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 13:30:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 13:30:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUHJx-0006am-W9; Fri, 02 Nov 2012 13:30:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <aliguori@us.ibm.com>) id 1TUHJw-0006ah-8N
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 13:30:00 +0000
Received: from [85.158.143.99:54580] by server-1.bemta-4.messagelabs.com id
	95/29-27934-7DAC3905; Fri, 02 Nov 2012 13:29:59 +0000
X-Env-Sender: aliguori@us.ibm.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1351862994!21988808!1
X-Originating-IP: [122.248.162.2]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTIyLjI0OC4xNjIuMiA9PiAyODMxNjM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25875 invoked from network); 2 Nov 2012 13:29:58 -0000
Received: from e28smtp02.in.ibm.com (HELO e28smtp02.in.ibm.com) (122.248.162.2)
	by server-10.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 2 Nov 2012 13:29:58 -0000
Received: from /spool/local
	by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use
	Only! Violators will be prosecuted
	for <xen-devel@lists.xen.org> from <aliguori@us.ibm.com>;
	Fri, 2 Nov 2012 18:59:53 +0530
Received: from d28relay01.in.ibm.com (9.184.220.58)
	by e28smtp02.in.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway:
	Authorized Use Only! Violators will be prosecuted; 
	Fri, 2 Nov 2012 18:59:51 +0530
Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66])
	by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id
	qA2DTnKi25952502
	for <xen-devel@lists.xen.org>; Fri, 2 Nov 2012 18:59:50 +0530
Received: from d28av04.in.ibm.com (loopback [127.0.0.1])
	by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id
	qA2Ixe5p010213
	for <xen-devel@lists.xen.org>; Sat, 3 Nov 2012 05:59:40 +1100
Received: from titi.na.relay.ibm.com ([9.80.60.224])
	by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id
	qA2IxZFe009980; Sat, 3 Nov 2012 05:59:37 +1100
From: Anthony Liguori <aliguori@us.ibm.com>
To: fantonifabio@tiscali.it, xen-devel <xen-devel@lists.xen.org>,
	Gerd Hoffmann <kraxel@redhat.com>
In-Reply-To: <5093A592.1050005@tiscali.it>
References: <5093A592.1050005@tiscali.it>
User-Agent: Notmuch/0.13.2+93~ged93d79 (http://notmuchmail.org) Emacs/23.3.1
	(x86_64-pc-linux-gnu)
Date: Fri, 02 Nov 2012 08:29:43 -0500
Message-ID: <87ehkcw2t4.fsf@codemonkey.ws>
MIME-Version: 1.0
x-cbid: 12110213-5816-0000-0000-0000052F0DEF
Subject: Re: [Xen-devel] Build xen-unstable and qemu upstream unstable fail
	with error on xenfb.c
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

RmFiaW8gRmFudG9uaSA8ZmFudG9uaWZhYmlvQHRpc2NhbGkuaXQ+IHdyaXRlczoKCj4gSSB0cmll
ZCB0byBjb21waWxlIGFuZCB0ZXN0IHhlbi11bnN0YWJsZSAoY2hhbmdlc2V0IDI2MTI0OmJmMjQ5
Y2Q1ZjJjMSkgCj4gd2l0aCBxZW11IHVuc3RhYmxlIChjb21taXQgNGJhNzk1MDVmNDNiZDBhY2Uz
NWMzZmU0MjE5N2ViMDJlN2UwNDc4ZSkgYnV0IAo+IGZhaWxlZCB3a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0b3J5IGAvbW50L3ZtL3hlbi94ZW4tdW5zdGFibGUu
aGcvdG9vbHMnCj4gbWFrZVsxXTogKioqIFtzdWJkaXJzLWluc3RhbGxdIEVycm9yIDIKPiBtYWtl
WzFdOiBMZWF2aW5nIGRpcmVjdG9yeSBgL21udC92bS94ZW4veGVuLXVuc3RhYmxlLmhnL3Rvb2xz
Jwo+IG1ha2U6ICoqKiBbaW5zdGFsbC10b29sc10gRXJyb3IgMgoKQ2FuIHlvdSB0YWtlIGEgbG9v
ayBhdCB0aGlzIEdlcmQ/CgpUaGFua3MuCgpBbnRob255IExpZ3VvcmkKCj4KPiBCdWlsZCBvZiBz
b21lIGRheXMgYWdvIHdhcyB3b3JraW5nICwgeGVuZmIgc2VlbSB0aGF0IG5lZWQgdG8gYmUgYWRh
cHQgCj4gZm9yIGxhdGVzdCB2Z2EgY2hhbmdlcyBvbiBxZW11IHVwc3RyZWFtLgoKCl9fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5n
IGxpc3QKWGVuLWRldmVsQGxpc3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRl
dmVsCg==

From xen-devel-bounces@lists.xen.org Fri Nov 02 13:30:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 13:30:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUHJx-0006am-W9; Fri, 02 Nov 2012 13:30:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <aliguori@us.ibm.com>) id 1TUHJw-0006ah-8N
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 13:30:00 +0000
Received: from [85.158.143.99:54580] by server-1.bemta-4.messagelabs.com id
	95/29-27934-7DAC3905; Fri, 02 Nov 2012 13:29:59 +0000
X-Env-Sender: aliguori@us.ibm.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1351862994!21988808!1
X-Originating-IP: [122.248.162.2]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTIyLjI0OC4xNjIuMiA9PiAyODMxNjM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25875 invoked from network); 2 Nov 2012 13:29:58 -0000
Received: from e28smtp02.in.ibm.com (HELO e28smtp02.in.ibm.com) (122.248.162.2)
	by server-10.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 2 Nov 2012 13:29:58 -0000
Received: from /spool/local
	by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use
	Only! Violators will be prosecuted
	for <xen-devel@lists.xen.org> from <aliguori@us.ibm.com>;
	Fri, 2 Nov 2012 18:59:53 +0530
Received: from d28relay01.in.ibm.com (9.184.220.58)
	by e28smtp02.in.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway:
	Authorized Use Only! Violators will be prosecuted; 
	Fri, 2 Nov 2012 18:59:51 +0530
Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66])
	by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id
	qA2DTnKi25952502
	for <xen-devel@lists.xen.org>; Fri, 2 Nov 2012 18:59:50 +0530
Received: from d28av04.in.ibm.com (loopback [127.0.0.1])
	by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id
	qA2Ixe5p010213
	for <xen-devel@lists.xen.org>; Sat, 3 Nov 2012 05:59:40 +1100
Received: from titi.na.relay.ibm.com ([9.80.60.224])
	by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id
	qA2IxZFe009980; Sat, 3 Nov 2012 05:59:37 +1100
From: Anthony Liguori <aliguori@us.ibm.com>
To: fantonifabio@tiscali.it, xen-devel <xen-devel@lists.xen.org>,
	Gerd Hoffmann <kraxel@redhat.com>
In-Reply-To: <5093A592.1050005@tiscali.it>
References: <5093A592.1050005@tiscali.it>
User-Agent: Notmuch/0.13.2+93~ged93d79 (http://notmuchmail.org) Emacs/23.3.1
	(x86_64-pc-linux-gnu)
Date: Fri, 02 Nov 2012 08:29:43 -0500
Message-ID: <87ehkcw2t4.fsf@codemonkey.ws>
MIME-Version: 1.0
x-cbid: 12110213-5816-0000-0000-0000052F0DEF
Subject: Re: [Xen-devel] Build xen-unstable and qemu upstream unstable fail
	with error on xenfb.c
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

RmFiaW8gRmFudG9uaSA8ZmFudG9uaWZhYmlvQHRpc2NhbGkuaXQ+IHdyaXRlczoKCj4gSSB0cmll
ZCB0byBjb21waWxlIGFuZCB0ZXN0IHhlbi11bnN0YWJsZSAoY2hhbmdlc2V0IDI2MTI0OmJmMjQ5
Y2Q1ZjJjMSkgCj4gd2l0aCBxZW11IHVuc3RhYmxlIChjb21taXQgNGJhNzk1MDVmNDNiZDBhY2Uz
NWMzZmU0MjE5N2ViMDJlN2UwNDc4ZSkgYnV0IAo+IGZhaWxlZCB3aXRoIHRoaXMgZXJy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ZtL3hlbi94ZW4tdW5zdGFibGUu
aGcvdG9vbHMnCj4gbWFrZVsxXTogKioqIFtzdWJkaXJzLWluc3RhbGxdIEVycm9yIDIKPiBtYWtl
WzFdOiBMZWF2aW5nIGRpcmVjdG9yeSBgL21udC92bS94ZW4veGVuLXVuc3RhYmxlLmhnL3Rvb2xz
Jwo+IG1ha2U6ICoqKiBbaW5zdGFsbC10b29sc10gRXJyb3IgMgoKQ2FuIHlvdSB0YWtlIGEgbG9v
ayBhdCB0aGlzIEdlcmQ/CgpUaGFua3MuCgpBbnRob255IExpZ3VvcmkKCj4KPiBCdWlsZCBvZiBz
b21lIGRheXMgYWdvIHdhcyB3b3JraW5nICwgeGVuZmIgc2VlbSB0aGF0IG5lZWQgdG8gYmUgYWRh
cHQgCj4gZm9yIGxhdGVzdCB2Z2EgY2hhbmdlcyBvbiBxZW11IHVwc3RyZWFtLgoKCl9fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5n
IGxpc3QKWGVuLWRldmVsQGxpc3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRl
dmVsCg==

From xen-devel-bounces@lists.xen.org Fri Nov 02 13:45:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 13:45:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUHYf-000727-Fd; Fri, 02 Nov 2012 13:45:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kraxel@redhat.com>) id 1TUHYe-000722-OM
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 13:45:12 +0000
Received: from [85.158.137.99:14336] by server-16.bemta-3.messagelabs.com id
	60/8E-07461-76EC3905; Fri, 02 Nov 2012 13:45:11 +0000
X-Env-Sender: kraxel@redhat.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1351863909!12679725!1
X-Originating-IP: [209.132.183.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTg2MDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30796 invoked from network); 2 Nov 2012 13:45:09 -0000
Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28)
	by server-7.tower-217.messagelabs.com with SMTP;
	2 Nov 2012 13:45:09 -0000
Received: from int-mx10.intmail.prod.int.phx2.redhat.com
	(int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qA2Dj3Cg002899
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 2 Nov 2012 09:45:07 -0400
Received: from rincewind.home.kraxel.org (ovpn-116-20.ams2.redhat.com
	[10.36.116.20])
	by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id qA2Dj11W032525; Fri, 2 Nov 2012 09:45:02 -0400
Message-ID: <5093CE5D.8070409@redhat.com>
Date: Fri, 02 Nov 2012 14:45:01 +0100
From: Gerd Hoffmann <kraxel@redhat.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.10) Gecko/20121026 Thunderbird/10.0.10
MIME-Version: 1.0
To: Anthony Liguori <aliguori@us.ibm.com>
References: <5093A592.1050005@tiscali.it> <87ehkcw2t4.fsf@codemonkey.ws>
In-Reply-To: <87ehkcw2t4.fsf@codemonkey.ws>
X-Enigmail-Version: 1.4
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
Cc: xen-devel <xen-devel@lists.xen.org>, fantonifabio@tiscali.it
Subject: Re: [Xen-devel] Build xen-unstable and qemu upstream unstable fail
 with error on xenfb.c
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

ICBIaSwKCj4+IGh3L3hlbmZiLmM6NjUxOjU6IGVycm9yOiBpbXBsaWNpdCBkZWNsYXJhdGlvbiBv
ZiBmdW5jdGlvbiDDomRweV91cGRhdGXDoiAKPj4gWy1XZXJyb3I9aW1wbGljaXQtZnVuY3Rpb24t
ZGVjbGFyYXRpb25dCj4gCj4gQ2FuIHlvdSB0YWtlIGEgbG9vayBhdCB0aGlzIEdlcmQ/CgpIYXBw
ZW5lZCBhbHJlYWR5OiBodHRwOi8vcGF0Y2h3b3JrLm96bGFicy5vcmcvcGF0Y2gvMTk2NDkyLwoK
Y2hlZXJzLAogIEdlcmQKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxpc3RzLnhlbi5vcmcKaHR0
cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Fri Nov 02 13:45:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 13:45:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUHYf-000727-Fd; Fri, 02 Nov 2012 13:45:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kraxel@redhat.com>) id 1TUHYe-000722-OM
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 13:45:12 +0000
Received: from [85.158.137.99:14336] by server-16.bemta-3.messagelabs.com id
	60/8E-07461-76EC3905; Fri, 02 Nov 2012 13:45:11 +0000
X-Env-Sender: kraxel@redhat.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1351863909!12679725!1
X-Originating-IP: [209.132.183.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTg2MDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30796 invoked from network); 2 Nov 2012 13:45:09 -0000
Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28)
	by server-7.tower-217.messagelabs.com with SMTP;
	2 Nov 2012 13:45:09 -0000
Received: from int-mx10.intmail.prod.int.phx2.redhat.com
	(int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qA2Dj3Cg002899
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 2 Nov 2012 09:45:07 -0400
Received: from rincewind.home.kraxel.org (ovpn-116-20.ams2.redhat.com
	[10.36.116.20])
	by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id qA2Dj11W032525; Fri, 2 Nov 2012 09:45:02 -0400
Message-ID: <5093CE5D.8070409@redhat.com>
Date: Fri, 02 Nov 2012 14:45:01 +0100
From: Gerd Hoffmann <kraxel@redhat.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.10) Gecko/20121026 Thunderbird/10.0.10
MIME-Version: 1.0
To: Anthony Liguori <aliguori@us.ibm.com>
References: <5093A592.1050005@tiscali.it> <87ehkcw2t4.fsf@codemonkey.ws>
In-Reply-To: <87ehkcw2t4.fsf@codemonkey.ws>
X-Enigmail-Version: 1.4
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
Cc: xen-devel <xen-devel@lists.xen.org>, fantonifabio@tiscali.it
Subject: Re: [Xen-devel] Build xen-unstable and qemu upstream unstable fail
 with error on xenfb.c
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

ICBIaSwKCj4+IGh3L3hlbmZiLmM6NjUxOjU6IGVycm9yOiBpbXBsaWNpdCBkZWNsYXJhdGlvbiBv
ZiBmdW5jdGlvbiDDomRweV91cGRhdGXDoiAKPj4gWy1XZXJyb3I9aW1wbGljaXQtZnVuY3Rpb24t
ZGVjbGFyYXRpb25dCj4gCj4gQ2FuIHlvdSB0YWtlIGEgbG9vayBhdCB0aGlzIEdlcmQ/CgpIYXBw
ZW5lZCBhbHJlYWR5OiBodHRwOi8vcGF0Y2h3b3JrLm96bGFicy5vcmcvcGF0Y2gvMTk2NDkyLwoK
Y2hlZXJzLAogIEdlcmQKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxpc3RzLnhlbi5vcmcKaHR0
cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Fri Nov 02 13:52:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 13:52:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUHfm-0007Jr-Ff; Fri, 02 Nov 2012 13:52:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TUHfl-0007Jm-5P
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 13:52:33 +0000
Received: from [85.158.137.99:20343] by server-1.bemta-3.messagelabs.com id
	E4/00-12169-A10D3905; Fri, 02 Nov 2012 13:52:26 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1351864344!14352431!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAzNDA2NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16923 invoked from network); 2 Nov 2012 13:52:26 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 2 Nov 2012 13:52:26 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA2DqDgY005576
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 2 Nov 2012 13:52:14 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA2DqCsE017645
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 2 Nov 2012 13:52:13 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA2DqCkR012772; Fri, 2 Nov 2012 08:52:12 -0500
Received: from konrad-lan.dumpdata.com (/64.222.209.26)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 02 Nov 2012 06:52:11 -0700
Date: Fri, 2 Nov 2012 09:52:09 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <jbeulich@suse.com>, daniel.kiper@oracle.com
Message-ID: <20121102135209.GB3038@konrad-lan.dumpdata.com>
References: <504F3355.2070201@tiscali.it>
	<504F5182020000780009A9CC@nat28.tlf.novell.com>
	<504F39F0.10701@tiscali.it>
	<504F625D020000780009AA85@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
	<5092D42A020000780008EB7B@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5092D42A020000780008EB7B@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: xen-devel@lists.xen.org, george.dunlap@citrix.com, fantonifabio@tiscali.it,
	stefano.stabellini@eu.citrix.com
Subject: Re: [Xen-devel] Start xen on UEFI system with grub
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 01, 2012 at 07:57:30PM +0000, Jan Beulich wrote:
> >>> Stefano Stabellini <stefano.stabellini@eu.citrix.com> 11/01/12 4:50 PM >>>
> >On Tue, 11 Sep 2012, Jan Beulich wrote:
> >> >>> On 11.09.12 at 15:17, Fabio Fantoni <fantonifabio@tiscali.it> wrote:
> >> > xen.efi not compile when we build xen on Wheezy and probably is not 
> >> > possible boot with lvm volume, fallback options ecc...
> >> 
> >> Just get a suitable tool chain installed then.
> >> 
> >> > UEFI with grub2 seem the best option but with xen hypervisor seem not 
> >> > load efi variable.
> >> 
> >> Sure, because only xen.efi has the code to deal with such.
> >> 
> >> (Btw., I assume you aren't aware that any boot manager
> >> whatsoever, other than the one coming with EFI, is sort of
> >> bogus under EFI?)
> >
> >Unfortunately it looks like more and more people are of the opinion that
> >grub2 is useful even on UEFI firmware.
> >For example, it is pretty clear that Ubuntu is still going to boot Xen
> >via grub2 no matter how the firmware looks like.
> 
> Then they need to be tought how to do it properly, the more that Linux itself
> now is capable of booting without a boot loader (other than the EFI one).
> 
> >What would it take to make Xen work properly with grub2 on a UEFI firmware?
> 
> I can't be that difficult.

I believe the only issue was the check to do the  Multiboot-E820 parsing
before the E801 parsing? Perhaps that has already been done?

> 
> >I think that we should add it as a work item for Xen 4.3.
> 
> If you have someone to do that work. I'm willing to review the resulting
> changes, but I currently don't see me doing anything here (as being totally
> unimportant and - just to repeat that - conceptually wrong).
> 
> Jan
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 13:52:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 13:52:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUHfm-0007Jr-Ff; Fri, 02 Nov 2012 13:52:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TUHfl-0007Jm-5P
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 13:52:33 +0000
Received: from [85.158.137.99:20343] by server-1.bemta-3.messagelabs.com id
	E4/00-12169-A10D3905; Fri, 02 Nov 2012 13:52:26 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1351864344!14352431!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAzNDA2NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16923 invoked from network); 2 Nov 2012 13:52:26 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 2 Nov 2012 13:52:26 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA2DqDgY005576
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 2 Nov 2012 13:52:14 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA2DqCsE017645
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 2 Nov 2012 13:52:13 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA2DqCkR012772; Fri, 2 Nov 2012 08:52:12 -0500
Received: from konrad-lan.dumpdata.com (/64.222.209.26)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 02 Nov 2012 06:52:11 -0700
Date: Fri, 2 Nov 2012 09:52:09 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <jbeulich@suse.com>, daniel.kiper@oracle.com
Message-ID: <20121102135209.GB3038@konrad-lan.dumpdata.com>
References: <504F3355.2070201@tiscali.it>
	<504F5182020000780009A9CC@nat28.tlf.novell.com>
	<504F39F0.10701@tiscali.it>
	<504F625D020000780009AA85@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
	<5092D42A020000780008EB7B@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5092D42A020000780008EB7B@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: xen-devel@lists.xen.org, george.dunlap@citrix.com, fantonifabio@tiscali.it,
	stefano.stabellini@eu.citrix.com
Subject: Re: [Xen-devel] Start xen on UEFI system with grub
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 01, 2012 at 07:57:30PM +0000, Jan Beulich wrote:
> >>> Stefano Stabellini <stefano.stabellini@eu.citrix.com> 11/01/12 4:50 PM >>>
> >On Tue, 11 Sep 2012, Jan Beulich wrote:
> >> >>> On 11.09.12 at 15:17, Fabio Fantoni <fantonifabio@tiscali.it> wrote:
> >> > xen.efi not compile when we build xen on Wheezy and probably is not 
> >> > possible boot with lvm volume, fallback options ecc...
> >> 
> >> Just get a suitable tool chain installed then.
> >> 
> >> > UEFI with grub2 seem the best option but with xen hypervisor seem not 
> >> > load efi variable.
> >> 
> >> Sure, because only xen.efi has the code to deal with such.
> >> 
> >> (Btw., I assume you aren't aware that any boot manager
> >> whatsoever, other than the one coming with EFI, is sort of
> >> bogus under EFI?)
> >
> >Unfortunately it looks like more and more people are of the opinion that
> >grub2 is useful even on UEFI firmware.
> >For example, it is pretty clear that Ubuntu is still going to boot Xen
> >via grub2 no matter how the firmware looks like.
> 
> Then they need to be tought how to do it properly, the more that Linux itself
> now is capable of booting without a boot loader (other than the EFI one).
> 
> >What would it take to make Xen work properly with grub2 on a UEFI firmware?
> 
> I can't be that difficult.

I believe the only issue was the check to do the  Multiboot-E820 parsing
before the E801 parsing? Perhaps that has already been done?

> 
> >I think that we should add it as a work item for Xen 4.3.
> 
> If you have someone to do that work. I'm willing to review the resulting
> changes, but I currently don't see me doing anything here (as being totally
> unimportant and - just to repeat that - conceptually wrong).
> 
> Jan
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 13:55:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 13:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUHiY-0007RC-6l; Fri, 02 Nov 2012 13:55:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TUHiW-0007R5-Ih
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 13:55:24 +0000
Received: from [85.158.143.99:42467] by server-2.bemta-4.messagelabs.com id
	BB/16-28922-BC0D3905; Fri, 02 Nov 2012 13:55:23 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1351864520!27818663!1
X-Originating-IP: [148.87.113.117]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQ4Ljg3LjExMy4xMTcgPT4gODMzNDAx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3905 invoked from network); 2 Nov 2012 13:55:21 -0000
Received: from rcsinet15.oracle.com (HELO rcsinet15.oracle.com)
	(148.87.113.117)
	by server-3.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 2 Nov 2012 13:55:21 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA2DtIlf018945
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 2 Nov 2012 13:55:19 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA2DtH3j026950
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 2 Nov 2012 13:55:18 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA2DtH3s014738; Fri, 2 Nov 2012 08:55:17 -0500
Received: from konrad-lan.dumpdata.com (/64.222.209.26)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 02 Nov 2012 06:55:17 -0700
Date: Fri, 2 Nov 2012 09:55:15 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121102135514.GC3038@konrad-lan.dumpdata.com>
References: <5093D4B502000078000A606E@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5093D4B502000078000A606E@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] ACPI/cpuidle: remove unused "power" field
 from Cx state data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 02, 2012 at 01:12:05PM +0000, Jan Beulich wrote:
> It has never been used for anything, and Linux 3.7 doesn't propagate
> this information anymore.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> Konrad, on the pv-ops side it may be better to pass zero rather than
> leaving the field completely uninitialized.

I think this got taken care of by:

commit c59687f8466df36633d937cc298aad465d704990
Author: Daniel Lezcano <daniel.lezcano@linaro.org>
Date:   Wed Sep 5 15:13:48 2012 +0200

    cpuidle / ACPI : remove power from acpi_processor_cx structure
    
    Remove the unused power field from struct struct acpi_processor_cx.
    
    [rjw: Modified changelog.]
    

And the the xen_processor_cx is allocated using kcalloc which resets
everything to zero - so I think we are safe there.

Thx!

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 13:55:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 13:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUHiY-0007RC-6l; Fri, 02 Nov 2012 13:55:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TUHiW-0007R5-Ih
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 13:55:24 +0000
Received: from [85.158.143.99:42467] by server-2.bemta-4.messagelabs.com id
	BB/16-28922-BC0D3905; Fri, 02 Nov 2012 13:55:23 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1351864520!27818663!1
X-Originating-IP: [148.87.113.117]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQ4Ljg3LjExMy4xMTcgPT4gODMzNDAx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3905 invoked from network); 2 Nov 2012 13:55:21 -0000
Received: from rcsinet15.oracle.com (HELO rcsinet15.oracle.com)
	(148.87.113.117)
	by server-3.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 2 Nov 2012 13:55:21 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA2DtIlf018945
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 2 Nov 2012 13:55:19 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA2DtH3j026950
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 2 Nov 2012 13:55:18 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA2DtH3s014738; Fri, 2 Nov 2012 08:55:17 -0500
Received: from konrad-lan.dumpdata.com (/64.222.209.26)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 02 Nov 2012 06:55:17 -0700
Date: Fri, 2 Nov 2012 09:55:15 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121102135514.GC3038@konrad-lan.dumpdata.com>
References: <5093D4B502000078000A606E@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5093D4B502000078000A606E@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] ACPI/cpuidle: remove unused "power" field
 from Cx state data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 02, 2012 at 01:12:05PM +0000, Jan Beulich wrote:
> It has never been used for anything, and Linux 3.7 doesn't propagate
> this information anymore.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> Konrad, on the pv-ops side it may be better to pass zero rather than
> leaving the field completely uninitialized.

I think this got taken care of by:

commit c59687f8466df36633d937cc298aad465d704990
Author: Daniel Lezcano <daniel.lezcano@linaro.org>
Date:   Wed Sep 5 15:13:48 2012 +0200

    cpuidle / ACPI : remove power from acpi_processor_cx structure
    
    Remove the unused power field from struct struct acpi_processor_cx.
    
    [rjw: Modified changelog.]
    

And the the xen_processor_cx is allocated using kcalloc which resets
everything to zero - so I think we are safe there.

Thx!

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:00:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:00:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUHnK-0007h8-1p; Fri, 02 Nov 2012 14:00:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fantonifabio@tiscali.it>) id 1TUHnI-0007h1-IF
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:00:20 +0000
Received: from [85.158.139.83:53587] by server-14.bemta-5.messagelabs.com id
	1C/F2-21768-3F1D3905; Fri, 02 Nov 2012 14:00:19 +0000
X-Env-Sender: fantonifabio@tiscali.it
X-Msg-Ref: server-5.tower-182.messagelabs.com!1351864815!28515420!1
X-Originating-IP: [94.23.245.208]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28790 invoked from network); 2 Nov 2012 14:00:15 -0000
Received: from lnx3.fantu.it (HELO lnx3.fantu.it) (94.23.245.208)
	by server-5.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 2 Nov 2012 14:00:15 -0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by lnx3.fantu.it (Postfix) with ESMTP id 40C5E4016C5;
	Fri,  2 Nov 2012 15:00:15 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at lnx3.fantu.it
Received: from lnx3.fantu.it ([127.0.0.1])
	by localhost (lnx3.fantu.it [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id zwVK4IxWPoNv; Fri,  2 Nov 2012 15:00:13 +0100 (CET)
Received: from [192.168.178.50]
	(host51-78-dynamic.2-87-r.retail.telecomitalia.it [87.2.78.51])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: prova@fantu.it)
	by lnx3.fantu.it (Postfix) with ESMTPSA id 070544016C2;
	Fri,  2 Nov 2012 15:00:12 +0100 (CET)
Message-ID: <5093D1E9.40806@tiscali.it>
Date: Fri, 02 Nov 2012 15:00:09 +0100
From: Fabio Fantoni <fantonifabio@tiscali.it>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel Kiper <dkiper@net-space.pl>
References: <504F3355.2070201@tiscali.it>
	<504F5182020000780009A9CC@nat28.tlf.novell.com>
	<504F39F0.10701@tiscali.it>
	<504F625D020000780009AA85@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
	<5092D42A020000780008EB7B@nat28.tlf.novell.com>
	<20121102113651.GA9845@router-fw-old.local.net-space.pl>
In-Reply-To: <20121102113651.GA9845@router-fw-old.local.net-space.pl>
Cc: konrad.wilk@oracle.com, daniel.kiper@oracle.com,
	stefano.stabellini@eu.citrix.com, george.dunlap@citrix.com,
	xen-devel@lists.xen.org, Jan Beulich <jbeulich@suse.com>
Subject: Re: [Xen-devel] Start xen on UEFI system with grub
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: fantonifabio@tiscali.it
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4972352783070105894=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--===============4972352783070105894==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms020904070002090202000500"

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--------------ms020904070002090202000500
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

Il 02/11/2012 12:36, Daniel Kiper ha scritto:
> On Thu, Nov 01, 2012 at 07:57:30PM +0000, Jan Beulich wrote:
>>>>> Stefano Stabellini <stefano.stabellini@eu.citrix.com> 11/01/12 4:50=
 PM >>>
>>> On Tue, 11 Sep 2012, Jan Beulich wrote:
>>>>>>> On 11.09.12 at 15:17, Fabio Fantoni <fantonifabio@tiscali.it> wro=
te:
>>>>> xen.efi not compile when we build xen on Wheezy and probably is not=

>>>>> possible boot with lvm volume, fallback options ecc...
>>>> Just get a suitable tool chain installed then.
>>>>
>>>>> UEFI with grub2 seem the best option but with xen hypervisor seem n=
ot
>>>>> load efi variable.
>>>> Sure, because only xen.efi has the code to deal with such.
>>>>
>>>> (Btw., I assume you aren't aware that any boot manager
>>>> whatsoever, other than the one coming with EFI, is sort of
>>>> bogus under EFI?)
>>> Unfortunately it looks like more and more people are of the opinion t=
hat
>>> grub2 is useful even on UEFI firmware.
>>> For example, it is pretty clear that Ubuntu is still going to boot Xe=
n
>>> via grub2 no matter how the firmware looks like.
>> Then they need to be tought how to do it properly, the more that Linux=
 itself
>> now is capable of booting without a boot loader (other than the EFI on=
e).
>>
>>> What would it take to make Xen work properly with grub2 on a UEFI fir=
mware?
>> I can't be that difficult.
>>
>>> I think that we should add it as a work item for Xen 4.3.
>> If you have someone to do that work. I'm willing to review the resulti=
ng
>> changes, but I currently don't see me doing anything here (as being to=
tally
>> unimportant and - just to repeat that - conceptually wrong).
> Heh... I agree with Jan but there are so many things conceptually wrong=

> used by millions of people and we could not change that. Let's fix
> (broke?) it. I am going to work on EFI stuff in upstream kernel and
> I think this task could be assigned to me too.
>
> Daniel
>
>
> -----
> Nessun virus nel messaggio.
> Controllato da AVG - www.avg.com
> Versione: 2012.0.2221 / Database dei virus: 2441/5368 -  Data di rilasc=
io: 01/11/2012
>
>
Thanks for getting this task. Hope to hear from you soon regard this,=20
let us know as soon as you can post patches.


--------------ms020904070002090202000500
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: Firma crittografica S/MIME

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIINhjCC
BjQwggQcoAMCAQICASAwDQYJKoZIhvcNAQEFBQAwfTELMAkGA1UEBhMCSUwxFjAUBgNVBAoT
DVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNp
Z25pbmcxKTAnBgNVBAMTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA3
MTAyNDIxMDI1NVoXDTE3MTAyNDIxMDI1NVowgYwxCzAJBgNVBAYTAklMMRYwFAYDVQQKEw1T
dGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRhbCBDZXJ0aWZpY2F0ZSBTaWdu
aW5nMTgwNgYDVQQDEy9TdGFydENvbSBDbGFzcyAyIFByaW1hcnkgSW50ZXJtZWRpYXRlIENs
aWVudCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMsohUWcASz7GfKrpTOM
KqANy9BV7V0igWdGxA8IU77L3aTxErQ+fcxtDYZ36Z6GH0YFn7fq5RADteP0AYzrCA+EQTfi
8q1+kA3m0nwtwXG94M5sIqsvs7lRP1aycBke/s5g9hJHryZ2acScnzczjBCAo7X1v5G3yw8M
DP2m2RCye0KfgZ4nODerZJVzhAlOD9YejvAXZqHksw56HzElVIoYSZ3q4+RJuPXXfIoyby+Y
2m1E+YzX5iCZXBx05gk6MKAW1vaw4/v2OOLy6FZH3XHHtOkzUreG//CsFnB9+uaYSlR65cdG
zTsmoIK8WH1ygoXhRBm98SD7Hf/r3FELNvUCAwEAAaOCAa0wggGpMA8GA1UdEwEB/wQFMAMB
Af8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS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gwgaQGCSsGAQQBgjcQBDGBljCBkzCBjDELMAkGA1UEBhMCSUwxFjAUBgNVBAoTDVN0
YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNpZ25p
bmcxODA2BgNVBAMTL1N0YXJ0Q29tIENsYXNzIDIgUHJpbWFyeSBJbnRlcm1lZGlhdGUgQ2xp
ZW50IENBAgIeYzCBpgYLKoZIhvcNAQkQAgsxgZaggZMwgYwxCzAJBgNVBAYTAklMMRYwFAYD
VQQKEw1TdGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRhbCBDZXJ0aWZpY2F0
ZSBTaWduaW5nMTgwNgYDVQQDEy9TdGFydENvbSBDbGFzcyAyIFByaW1hcnkgSW50ZXJtZWRp
YXRlIENsaWVudCBDQQICHmMwDQYJKoZIhvcNAQEBBQAEggEAEgRALE3/0LiJrcBZgRqLUl55
c47otDrFkX+jqSFeurevgosAMQJWhev8eVa6+RaPCgSYAdMivGXaESO1MCybfRFqjOVDsiIZ
V3XFTd4Gwe3i4cMbI0fUBcAt69PmCQYdnYg/qNEG7QSVvcRjNRcJ4jlgn7Dp6lhmLCK0O3cz
5fd8V7kmlI9tpcrE1WcnIutwrTYJb5gGYMOrze1fg+HS3G0xCHQPXy2imHspBd09HcoJEtRk
DycTfNaS4Pnd6ofIqain5+8htCcyqi4z8qJw/5V3miiuWK+vkXsTnLmhqi4NUBiF05c4qw0b
ly7KGTEiWJ7pvnNSoRxD2EKlg8RKoAAAAAAAAA==
--------------ms020904070002090202000500--


--===============4972352783070105894==
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.xen.org
http://lists.xen.org/xen-devel

--===============4972352783070105894==--


From xen-devel-bounces@lists.xen.org Fri Nov 02 14:00:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:00:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUHnK-0007h8-1p; Fri, 02 Nov 2012 14:00:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fantonifabio@tiscali.it>) id 1TUHnI-0007h1-IF
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:00:20 +0000
Received: from [85.158.139.83:53587] by server-14.bemta-5.messagelabs.com id
	1C/F2-21768-3F1D3905; Fri, 02 Nov 2012 14:00:19 +0000
X-Env-Sender: fantonifabio@tiscali.it
X-Msg-Ref: server-5.tower-182.messagelabs.com!1351864815!28515420!1
X-Originating-IP: [94.23.245.208]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28790 invoked from network); 2 Nov 2012 14:00:15 -0000
Received: from lnx3.fantu.it (HELO lnx3.fantu.it) (94.23.245.208)
	by server-5.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 2 Nov 2012 14:00:15 -0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by lnx3.fantu.it (Postfix) with ESMTP id 40C5E4016C5;
	Fri,  2 Nov 2012 15:00:15 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at lnx3.fantu.it
Received: from lnx3.fantu.it ([127.0.0.1])
	by localhost (lnx3.fantu.it [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id zwVK4IxWPoNv; Fri,  2 Nov 2012 15:00:13 +0100 (CET)
Received: from [192.168.178.50]
	(host51-78-dynamic.2-87-r.retail.telecomitalia.it [87.2.78.51])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: prova@fantu.it)
	by lnx3.fantu.it (Postfix) with ESMTPSA id 070544016C2;
	Fri,  2 Nov 2012 15:00:12 +0100 (CET)
Message-ID: <5093D1E9.40806@tiscali.it>
Date: Fri, 02 Nov 2012 15:00:09 +0100
From: Fabio Fantoni <fantonifabio@tiscali.it>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel Kiper <dkiper@net-space.pl>
References: <504F3355.2070201@tiscali.it>
	<504F5182020000780009A9CC@nat28.tlf.novell.com>
	<504F39F0.10701@tiscali.it>
	<504F625D020000780009AA85@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
	<5092D42A020000780008EB7B@nat28.tlf.novell.com>
	<20121102113651.GA9845@router-fw-old.local.net-space.pl>
In-Reply-To: <20121102113651.GA9845@router-fw-old.local.net-space.pl>
Cc: konrad.wilk@oracle.com, daniel.kiper@oracle.com,
	stefano.stabellini@eu.citrix.com, george.dunlap@citrix.com,
	xen-devel@lists.xen.org, Jan Beulich <jbeulich@suse.com>
Subject: Re: [Xen-devel] Start xen on UEFI system with grub
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: fantonifabio@tiscali.it
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4972352783070105894=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--===============4972352783070105894==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms020904070002090202000500"

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--------------ms020904070002090202000500
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

Il 02/11/2012 12:36, Daniel Kiper ha scritto:
> On Thu, Nov 01, 2012 at 07:57:30PM +0000, Jan Beulich wrote:
>>>>> Stefano Stabellini <stefano.stabellini@eu.citrix.com> 11/01/12 4:50=
 PM >>>
>>> On Tue, 11 Sep 2012, Jan Beulich wrote:
>>>>>>> On 11.09.12 at 15:17, Fabio Fantoni <fantonifabio@tiscali.it> wro=
te:
>>>>> xen.efi not compile when we build xen on Wheezy and probably is not=

>>>>> possible boot with lvm volume, fallback options ecc...
>>>> Just get a suitable tool chain installed then.
>>>>
>>>>> UEFI with grub2 seem the best option but with xen hypervisor seem n=
ot
>>>>> load efi variable.
>>>> Sure, because only xen.efi has the code to deal with such.
>>>>
>>>> (Btw., I assume you aren't aware that any boot manager
>>>> whatsoever, other than the one coming with EFI, is sort of
>>>> bogus under EFI?)
>>> Unfortunately it looks like more and more people are of the opinion t=
hat
>>> grub2 is useful even on UEFI firmware.
>>> For example, it is pretty clear that Ubuntu is still going to boot Xe=
n
>>> via grub2 no matter how the firmware looks like.
>> Then they need to be tought how to do it properly, the more that Linux=
 itself
>> now is capable of booting without a boot loader (other than the EFI on=
e).
>>
>>> What would it take to make Xen work properly with grub2 on a UEFI fir=
mware?
>> I can't be that difficult.
>>
>>> I think that we should add it as a work item for Xen 4.3.
>> If you have someone to do that work. I'm willing to review the resulti=
ng
>> changes, but I currently don't see me doing anything here (as being to=
tally
>> unimportant and - just to repeat that - conceptually wrong).
> Heh... I agree with Jan but there are so many things conceptually wrong=

> used by millions of people and we could not change that. Let's fix
> (broke?) it. I am going to work on EFI stuff in upstream kernel and
> I think this task could be assigned to me too.
>
> Daniel
>
>
> -----
> Nessun virus nel messaggio.
> Controllato da AVG - www.avg.com
> Versione: 2012.0.2221 / Database dei virus: 2441/5368 -  Data di rilasc=
io: 01/11/2012
>
>
Thanks for getting this task. Hope to hear from you soon regard this,=20
let us know as soon as you can post patches.


--------------ms020904070002090202000500
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: Firma crittografica S/MIME

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIINhjCC
BjQwggQcoAMCAQICASAwDQYJKoZIhvcNAQEFBQAwfTELMAkGA1UEBhMCSUwxFjAUBgNVBAoT
DVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNp
Z25pbmcxKTAnBgNVBAMTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA3
MTAyNDIxMDI1NVoXDTE3MTAyNDIxMDI1NVowgYwxCzAJBgNVBAYTAklMMRYwFAYDVQQKEw1T
dGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRhbCBDZXJ0aWZpY2F0ZSBTaWdu
aW5nMTgwNgYDVQQDEy9TdGFydENvbSBDbGFzcyAyIFByaW1hcnkgSW50ZXJtZWRpYXRlIENs
aWVudCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMsohUWcASz7GfKrpTOM
KqANy9BV7V0igWdGxA8IU77L3aTxErQ+fcxtDYZ36Z6GH0YFn7fq5RADteP0AYzrCA+EQTfi
8q1+kA3m0nwtwXG94M5sIqsvs7lRP1aycBke/s5g9hJHryZ2acScnzczjBCAo7X1v5G3yw8M
DP2m2RCye0KfgZ4nODerZJVzhAlOD9YejvAXZqHksw56HzElVIoYSZ3q4+RJuPXXfIoyby+Y
2m1E+YzX5iCZXBx05gk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HSNKGCJBB583FRq3
zF2LMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAKBggqhkiG
9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYIKoZIhvcN
AwICASgwgaQGCSsGAQQBgjcQBDGBljCBkzCBjDELMAkGA1UEBhMCSUwxFjAUBgNVBAoTDVN0
YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNpZ25p
bmcxODA2BgNVBAMTL1N0YXJ0Q29tIENsYXNzIDIgUHJpbWFyeSBJbnRlcm1lZGlhdGUgQ2xp
ZW50IENBAgIeYzCBpgYLKoZIhvcNAQkQAgsxgZaggZMwgYwxCzAJBgNVBAYTAklMMRYwFAYD
VQQKEw1TdGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRhbCBDZXJ0aWZpY2F0
ZSBTaWduaW5nMTgwNgYDVQQDEy9TdGFydENvbSBDbGFzcyAyIFByaW1hcnkgSW50ZXJtZWRp
YXRlIENsaWVudCBDQQICHmMwDQYJKoZIhvcNAQEBBQAEggEAEgRALE3/0LiJrcBZgRqLUl55
c47otDrFkX+jqSFeurevgosAMQJWhev8eVa6+RaPCgSYAdMivGXaESO1MCybfRFqjOVDsiIZ
V3XFTd4Gwe3i4cMbI0fUBcAt69PmCQYdnYg/qNEG7QSVvcRjNRcJ4jlgn7Dp6lhmLCK0O3cz
5fd8V7kmlI9tpcrE1WcnIutwrTYJb5gGYMOrze1fg+HS3G0xCHQPXy2imHspBd09HcoJEtRk
DycTfNaS4Pnd6ofIqain5+8htCcyqi4z8qJw/5V3miiuWK+vkXsTnLmhqi4NUBiF05c4qw0b
ly7KGTEiWJ7pvnNSoRxD2EKlg8RKoAAAAAAAAA==
--------------ms020904070002090202000500--


--===============4972352783070105894==
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.xen.org
http://lists.xen.org/xen-devel

--===============4972352783070105894==--


From xen-devel-bounces@lists.xen.org Fri Nov 02 14:07:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:07:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUHtg-0008BC-Lc; Fri, 02 Nov 2012 14:06:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUHtg-0008B5-88
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:06:56 +0000
Received: from [85.158.143.35:17758] by server-1.bemta-4.messagelabs.com id
	97/FA-27934-F73D3905; Fri, 02 Nov 2012 14:06:55 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1351865213!5748051!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11218 invoked from network); 2 Nov 2012 14:06:53 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-21.messagelabs.com with SMTP;
	2 Nov 2012 14:06:53 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 14:07:05 +0000
Message-Id: <5093E1B602000078000A6105@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 14:07:34 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
References: <5093D4B502000078000A606E@nat28.tlf.novell.com>
	<20121102135514.GC3038@konrad-lan.dumpdata.com>
In-Reply-To: <20121102135514.GC3038@konrad-lan.dumpdata.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] ACPI/cpuidle: remove unused "power" field
 from Cx state data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 02.11.12 at 14:55, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> On Fri, Nov 02, 2012 at 01:12:05PM +0000, Jan Beulich wrote:
>> It has never been used for anything, and Linux 3.7 doesn't propagate
>> this information anymore.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> ---
>> Konrad, on the pv-ops side it may be better to pass zero rather than
>> leaving the field completely uninitialized.
> 
> I think this got taken care of by:
> 
> commit c59687f8466df36633d937cc298aad465d704990
> Author: Daniel Lezcano <daniel.lezcano@linaro.org>
> Date:   Wed Sep 5 15:13:48 2012 +0200
> 
>     cpuidle / ACPI : remove power from acpi_processor_cx structure
>     
>     Remove the unused power field from struct struct acpi_processor_cx.
>     
>     [rjw: Modified changelog.]

That's the commit I was referring to.

> And the the xen_processor_cx is allocated using kcalloc which resets
> everything to zero - so I think we are safe there.

And that I didn't pay attention to - sorry for the noise then.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:07:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:07:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUHtg-0008BC-Lc; Fri, 02 Nov 2012 14:06:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUHtg-0008B5-88
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:06:56 +0000
Received: from [85.158.143.35:17758] by server-1.bemta-4.messagelabs.com id
	97/FA-27934-F73D3905; Fri, 02 Nov 2012 14:06:55 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1351865213!5748051!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11218 invoked from network); 2 Nov 2012 14:06:53 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-21.messagelabs.com with SMTP;
	2 Nov 2012 14:06:53 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 14:07:05 +0000
Message-Id: <5093E1B602000078000A6105@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 14:07:34 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
References: <5093D4B502000078000A606E@nat28.tlf.novell.com>
	<20121102135514.GC3038@konrad-lan.dumpdata.com>
In-Reply-To: <20121102135514.GC3038@konrad-lan.dumpdata.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] ACPI/cpuidle: remove unused "power" field
 from Cx state data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 02.11.12 at 14:55, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> On Fri, Nov 02, 2012 at 01:12:05PM +0000, Jan Beulich wrote:
>> It has never been used for anything, and Linux 3.7 doesn't propagate
>> this information anymore.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> ---
>> Konrad, on the pv-ops side it may be better to pass zero rather than
>> leaving the field completely uninitialized.
> 
> I think this got taken care of by:
> 
> commit c59687f8466df36633d937cc298aad465d704990
> Author: Daniel Lezcano <daniel.lezcano@linaro.org>
> Date:   Wed Sep 5 15:13:48 2012 +0200
> 
>     cpuidle / ACPI : remove power from acpi_processor_cx structure
>     
>     Remove the unused power field from struct struct acpi_processor_cx.
>     
>     [rjw: Modified changelog.]

That's the commit I was referring to.

> And the the xen_processor_cx is allocated using kcalloc which resets
> everything to zero - so I think we are safe there.

And that I didn't pay attention to - sorry for the noise then.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:10:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:10:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUHxM-0008OG-FO; Fri, 02 Nov 2012 14:10:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUHxK-0008O3-Ne
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:10:42 +0000
Received: from [85.158.139.211:27361] by server-16.bemta-5.messagelabs.com id
	30/D9-04786-264D3905; Fri, 02 Nov 2012 14:10:42 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1351865441!18194474!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3831 invoked from network); 2 Nov 2012 14:10:41 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-206.messagelabs.com with SMTP;
	2 Nov 2012 14:10:41 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 14:10:55 +0000
Message-Id: <5093E29A02000078000A611D@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 14:11:22 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <daniel.kiper@oracle.com>, "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
References: <504F3355.2070201@tiscali.it>
	<504F5182020000780009A9CC@nat28.tlf.novell.com>
	<504F39F0.10701@tiscali.it>
	<504F625D020000780009AA85@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
	<5092D42A020000780008EB7B@nat28.tlf.novell.com>
	<20121102135209.GB3038@konrad-lan.dumpdata.com>
In-Reply-To: <20121102135209.GB3038@konrad-lan.dumpdata.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org, george.dunlap@citrix.com, fantonifabio@tiscali.it,
	stefano.stabellini@eu.citrix.com
Subject: Re: [Xen-devel] Start xen on UEFI system with grub
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 02.11.12 at 14:52, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> On Thu, Nov 01, 2012 at 07:57:30PM +0000, Jan Beulich wrote:
>> >>> Stefano Stabellini <stefano.stabellini@eu.citrix.com> 11/01/12 4:50 PM >>>
>> >On Tue, 11 Sep 2012, Jan Beulich wrote:
>> >> >>> On 11.09.12 at 15:17, Fabio Fantoni <fantonifabio@tiscali.it> wrote:
>> >> > xen.efi not compile when we build xen on Wheezy and probably is not 
>> >> > possible boot with lvm volume, fallback options ecc...
>> >> 
>> >> Just get a suitable tool chain installed then.
>> >> 
>> >> > UEFI with grub2 seem the best option but with xen hypervisor seem not 
>> >> > load efi variable.
>> >> 
>> >> Sure, because only xen.efi has the code to deal with such.
>> >> 
>> >> (Btw., I assume you aren't aware that any boot manager
>> >> whatsoever, other than the one coming with EFI, is sort of
>> >> bogus under EFI?)
>> >
>> >Unfortunately it looks like more and more people are of the opinion that
>> >grub2 is useful even on UEFI firmware.
>> >For example, it is pretty clear that Ubuntu is still going to boot Xen
>> >via grub2 no matter how the firmware looks like.
>> 
>> Then they need to be tought how to do it properly, the more that Linux 
> itself
>> now is capable of booting without a boot loader (other than the EFI one).
>> 
>> >What would it take to make Xen work properly with grub2 on a UEFI firmware?
>> 
>> I can't be that difficult.
> 
> I believe the only issue was the check to do the  Multiboot-E820 parsing
> before the E801 parsing? Perhaps that has already been done?

That's in all 4.x trees already. But no - the other important aspect
is that without retrieving/passing on the proper EFI table pointers,
on a legacy free system Xen and Dom0 won't be able to locate the
ACPI tables.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:10:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:10:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUHxM-0008OG-FO; Fri, 02 Nov 2012 14:10:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUHxK-0008O3-Ne
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:10:42 +0000
Received: from [85.158.139.211:27361] by server-16.bemta-5.messagelabs.com id
	30/D9-04786-264D3905; Fri, 02 Nov 2012 14:10:42 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1351865441!18194474!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3831 invoked from network); 2 Nov 2012 14:10:41 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-206.messagelabs.com with SMTP;
	2 Nov 2012 14:10:41 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 14:10:55 +0000
Message-Id: <5093E29A02000078000A611D@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 14:11:22 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <daniel.kiper@oracle.com>, "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
References: <504F3355.2070201@tiscali.it>
	<504F5182020000780009A9CC@nat28.tlf.novell.com>
	<504F39F0.10701@tiscali.it>
	<504F625D020000780009AA85@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
	<5092D42A020000780008EB7B@nat28.tlf.novell.com>
	<20121102135209.GB3038@konrad-lan.dumpdata.com>
In-Reply-To: <20121102135209.GB3038@konrad-lan.dumpdata.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org, george.dunlap@citrix.com, fantonifabio@tiscali.it,
	stefano.stabellini@eu.citrix.com
Subject: Re: [Xen-devel] Start xen on UEFI system with grub
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 02.11.12 at 14:52, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> On Thu, Nov 01, 2012 at 07:57:30PM +0000, Jan Beulich wrote:
>> >>> Stefano Stabellini <stefano.stabellini@eu.citrix.com> 11/01/12 4:50 PM >>>
>> >On Tue, 11 Sep 2012, Jan Beulich wrote:
>> >> >>> On 11.09.12 at 15:17, Fabio Fantoni <fantonifabio@tiscali.it> wrote:
>> >> > xen.efi not compile when we build xen on Wheezy and probably is not 
>> >> > possible boot with lvm volume, fallback options ecc...
>> >> 
>> >> Just get a suitable tool chain installed then.
>> >> 
>> >> > UEFI with grub2 seem the best option but with xen hypervisor seem not 
>> >> > load efi variable.
>> >> 
>> >> Sure, because only xen.efi has the code to deal with such.
>> >> 
>> >> (Btw., I assume you aren't aware that any boot manager
>> >> whatsoever, other than the one coming with EFI, is sort of
>> >> bogus under EFI?)
>> >
>> >Unfortunately it looks like more and more people are of the opinion that
>> >grub2 is useful even on UEFI firmware.
>> >For example, it is pretty clear that Ubuntu is still going to boot Xen
>> >via grub2 no matter how the firmware looks like.
>> 
>> Then they need to be tought how to do it properly, the more that Linux 
> itself
>> now is capable of booting without a boot loader (other than the EFI one).
>> 
>> >What would it take to make Xen work properly with grub2 on a UEFI firmware?
>> 
>> I can't be that difficult.
> 
> I believe the only issue was the check to do the  Multiboot-E820 parsing
> before the E801 parsing? Perhaps that has already been done?

That's in all 4.x trees already. But no - the other important aspect
is that without retrieving/passing on the proper EFI table pointers,
on a legacy free system Xen and Dom0 won't be able to locate the
ACPI tables.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:15:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:15:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUI1A-0000HI-4P; Fri, 02 Nov 2012 14:14:40 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TUI18-0000HC-BS
	for xen-devel@lists.xensource.com; Fri, 02 Nov 2012 14:14:38 +0000
Received: from [85.158.138.51:63327] by server-16.bemta-3.messagelabs.com id
	AE/8E-07461-D45D3905; Fri, 02 Nov 2012 14:14:37 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1351865676!20422830!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY5ODk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27344 invoked from network); 2 Nov 2012 14:14:37 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 14:14:37 -0000
X-IronPort-AV: E=Sophos;i="4.80,699,1344211200"; d="scan'208";a="15558598"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	02 Nov 2012 14:13:40 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 2 Nov 2012 14:13:39 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TUI0B-0004zR-Nq;
	Fri, 02 Nov 2012 14:13:39 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TUI0B-0006nj-Mg;
	Fri, 02 Nov 2012 14:13:39 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14343-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 2 Nov 2012 14:13:39 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [linux-3.0 test] 14343: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14343 linux-3.0 real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14343/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-amd64                   4 xen-build                 fail REGR. vs. 14199
 build-amd64-pvops             4 kernel-build              fail REGR. vs. 14199
 build-i386                    4 xen-build                 fail REGR. vs. 14199

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a

version targeted for testing:
 linux                27d0858dbcf199838b8c50a3e94d397bf326d986
baseline version:
 linux                d9ee258b13506301b6da6450cf7a1692826b471e

------------------------------------------------------------
People who touched revisions under test:
------------------------------------------------------------

jobs:
 build-amd64                                                  fail    
 build-i386                                                   fail    
 build-amd64-pvops                                            fail    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 27d0858dbcf199838b8c50a3e94d397bf326d986
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Wed Oct 31 09:51:59 2012 -0700

    Linux 3.0.50

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:15:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:15:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUI1A-0000HI-4P; Fri, 02 Nov 2012 14:14:40 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TUI18-0000HC-BS
	for xen-devel@lists.xensource.com; Fri, 02 Nov 2012 14:14:38 +0000
Received: from [85.158.138.51:63327] by server-16.bemta-3.messagelabs.com id
	AE/8E-07461-D45D3905; Fri, 02 Nov 2012 14:14:37 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1351865676!20422830!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY5ODk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27344 invoked from network); 2 Nov 2012 14:14:37 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 14:14:37 -0000
X-IronPort-AV: E=Sophos;i="4.80,699,1344211200"; d="scan'208";a="15558598"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	02 Nov 2012 14:13:40 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 2 Nov 2012 14:13:39 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TUI0B-0004zR-Nq;
	Fri, 02 Nov 2012 14:13:39 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TUI0B-0006nj-Mg;
	Fri, 02 Nov 2012 14:13:39 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14343-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 2 Nov 2012 14:13:39 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [linux-3.0 test] 14343: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14343 linux-3.0 real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14343/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-amd64                   4 xen-build                 fail REGR. vs. 14199
 build-amd64-pvops             4 kernel-build              fail REGR. vs. 14199
 build-i386                    4 xen-build                 fail REGR. vs. 14199

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a

version targeted for testing:
 linux                27d0858dbcf199838b8c50a3e94d397bf326d986
baseline version:
 linux                d9ee258b13506301b6da6450cf7a1692826b471e

------------------------------------------------------------
People who touched revisions under test:
------------------------------------------------------------

jobs:
 build-amd64                                                  fail    
 build-i386                                                   fail    
 build-amd64-pvops                                            fail    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 27d0858dbcf199838b8c50a3e94d397bf326d986
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Wed Oct 31 09:51:59 2012 -0700

    Linux 3.0.50

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:17:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:17:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUI3t-0000Qy-SB; Fri, 02 Nov 2012 14:17:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TUI3t-0000Qs-1O
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:17:29 +0000
Received: from [85.158.139.83:62424] by server-11.bemta-5.messagelabs.com id
	A0/40-03409-8F5D3905; Fri, 02 Nov 2012 14:17:28 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1351865846!24203845!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAzNDA2NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30401 invoked from network); 2 Nov 2012 14:17:27 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-14.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 2 Nov 2012 14:17:27 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA2EHL0M023837
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 2 Nov 2012 14:17:22 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA2EHK5Z007964
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 2 Nov 2012 14:17:21 GMT
Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA2EHKeT010200; Fri, 2 Nov 2012 09:17:20 -0500
Received: from konrad-lan.dumpdata.com (/64.222.209.26)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 02 Nov 2012 07:17:20 -0700
Date: Fri, 2 Nov 2012 10:17:17 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121102141717.GE3038@konrad-lan.dumpdata.com>
References: <504F3355.2070201@tiscali.it>
	<504F5182020000780009A9CC@nat28.tlf.novell.com>
	<504F39F0.10701@tiscali.it>
	<504F625D020000780009AA85@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
	<5092D42A020000780008EB7B@nat28.tlf.novell.com>
	<20121102135209.GB3038@konrad-lan.dumpdata.com>
	<5093E29A02000078000A611D@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5093E29A02000078000A611D@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: daniel.kiper@oracle.com, xen-devel@lists.xen.org, george.dunlap@citrix.com,
	fantonifabio@tiscali.it, stefano.stabellini@eu.citrix.com
Subject: Re: [Xen-devel] Start xen on UEFI system with grub
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 02, 2012 at 02:11:22PM +0000, Jan Beulich wrote:
> >>> On 02.11.12 at 14:52, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > On Thu, Nov 01, 2012 at 07:57:30PM +0000, Jan Beulich wrote:
> >> >>> Stefano Stabellini <stefano.stabellini@eu.citrix.com> 11/01/12 4:50 PM >>>
> >> >On Tue, 11 Sep 2012, Jan Beulich wrote:
> >> >> >>> On 11.09.12 at 15:17, Fabio Fantoni <fantonifabio@tiscali.it> wrote:
> >> >> > xen.efi not compile when we build xen on Wheezy and probably is not 
> >> >> > possible boot with lvm volume, fallback options ecc...
> >> >> 
> >> >> Just get a suitable tool chain installed then.
> >> >> 
> >> >> > UEFI with grub2 seem the best option but with xen hypervisor seem not 
> >> >> > load efi variable.
> >> >> 
> >> >> Sure, because only xen.efi has the code to deal with such.
> >> >> 
> >> >> (Btw., I assume you aren't aware that any boot manager
> >> >> whatsoever, other than the one coming with EFI, is sort of
> >> >> bogus under EFI?)
> >> >
> >> >Unfortunately it looks like more and more people are of the opinion that
> >> >grub2 is useful even on UEFI firmware.
> >> >For example, it is pretty clear that Ubuntu is still going to boot Xen
> >> >via grub2 no matter how the firmware looks like.
> >> 
> >> Then they need to be tought how to do it properly, the more that Linux 
> > itself
> >> now is capable of booting without a boot loader (other than the EFI one).
> >> 
> >> >What would it take to make Xen work properly with grub2 on a UEFI firmware?
> >> 
> >> I can't be that difficult.
> > 
> > I believe the only issue was the check to do the  Multiboot-E820 parsing
> > before the E801 parsing? Perhaps that has already been done?
> 
> That's in all 4.x trees already. But no - the other important aspect
> is that without retrieving/passing on the proper EFI table pointers,
> on a legacy free system Xen and Dom0 won't be able to locate the
> ACPI tables.

Ah yes (<smacks his head - this is what this thread is about after all>).

I think the work-around could be to use the kexec introduced arguments:

"acpi_rsdp=<physical address of rsdp>"

> 
> Jan
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:17:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:17:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUI3t-0000Qy-SB; Fri, 02 Nov 2012 14:17:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TUI3t-0000Qs-1O
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:17:29 +0000
Received: from [85.158.139.83:62424] by server-11.bemta-5.messagelabs.com id
	A0/40-03409-8F5D3905; Fri, 02 Nov 2012 14:17:28 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1351865846!24203845!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAzNDA2NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30401 invoked from network); 2 Nov 2012 14:17:27 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-14.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 2 Nov 2012 14:17:27 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA2EHL0M023837
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 2 Nov 2012 14:17:22 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA2EHK5Z007964
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 2 Nov 2012 14:17:21 GMT
Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA2EHKeT010200; Fri, 2 Nov 2012 09:17:20 -0500
Received: from konrad-lan.dumpdata.com (/64.222.209.26)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 02 Nov 2012 07:17:20 -0700
Date: Fri, 2 Nov 2012 10:17:17 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121102141717.GE3038@konrad-lan.dumpdata.com>
References: <504F3355.2070201@tiscali.it>
	<504F5182020000780009A9CC@nat28.tlf.novell.com>
	<504F39F0.10701@tiscali.it>
	<504F625D020000780009AA85@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
	<5092D42A020000780008EB7B@nat28.tlf.novell.com>
	<20121102135209.GB3038@konrad-lan.dumpdata.com>
	<5093E29A02000078000A611D@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5093E29A02000078000A611D@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: daniel.kiper@oracle.com, xen-devel@lists.xen.org, george.dunlap@citrix.com,
	fantonifabio@tiscali.it, stefano.stabellini@eu.citrix.com
Subject: Re: [Xen-devel] Start xen on UEFI system with grub
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 02, 2012 at 02:11:22PM +0000, Jan Beulich wrote:
> >>> On 02.11.12 at 14:52, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > On Thu, Nov 01, 2012 at 07:57:30PM +0000, Jan Beulich wrote:
> >> >>> Stefano Stabellini <stefano.stabellini@eu.citrix.com> 11/01/12 4:50 PM >>>
> >> >On Tue, 11 Sep 2012, Jan Beulich wrote:
> >> >> >>> On 11.09.12 at 15:17, Fabio Fantoni <fantonifabio@tiscali.it> wrote:
> >> >> > xen.efi not compile when we build xen on Wheezy and probably is not 
> >> >> > possible boot with lvm volume, fallback options ecc...
> >> >> 
> >> >> Just get a suitable tool chain installed then.
> >> >> 
> >> >> > UEFI with grub2 seem the best option but with xen hypervisor seem not 
> >> >> > load efi variable.
> >> >> 
> >> >> Sure, because only xen.efi has the code to deal with such.
> >> >> 
> >> >> (Btw., I assume you aren't aware that any boot manager
> >> >> whatsoever, other than the one coming with EFI, is sort of
> >> >> bogus under EFI?)
> >> >
> >> >Unfortunately it looks like more and more people are of the opinion that
> >> >grub2 is useful even on UEFI firmware.
> >> >For example, it is pretty clear that Ubuntu is still going to boot Xen
> >> >via grub2 no matter how the firmware looks like.
> >> 
> >> Then they need to be tought how to do it properly, the more that Linux 
> > itself
> >> now is capable of booting without a boot loader (other than the EFI one).
> >> 
> >> >What would it take to make Xen work properly with grub2 on a UEFI firmware?
> >> 
> >> I can't be that difficult.
> > 
> > I believe the only issue was the check to do the  Multiboot-E820 parsing
> > before the E801 parsing? Perhaps that has already been done?
> 
> That's in all 4.x trees already. But no - the other important aspect
> is that without retrieving/passing on the proper EFI table pointers,
> on a legacy free system Xen and Dom0 won't be able to locate the
> ACPI tables.

Ah yes (<smacks his head - this is what this thread is about after all>).

I think the work-around could be to use the kexec introduced arguments:

"acpi_rsdp=<physical address of rsdp>"

> 
> Jan
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:19:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:19:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUI5K-0000YJ-Bd; Fri, 02 Nov 2012 14:18:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TUI5J-0000Y7-19
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:18:57 +0000
Received: from [85.158.137.99:41671] by server-2.bemta-3.messagelabs.com id
	12/D2-04744-F46D3905; Fri, 02 Nov 2012 14:18:55 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1351865933!16605317!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAzNDA2NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 414 invoked from network); 2 Nov 2012 14:18:55 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-11.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 2 Nov 2012 14:18:55 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA2EIqvW024756
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 2 Nov 2012 14:18:53 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA2EIqDc003855
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 2 Nov 2012 14:18:52 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA2EIqRl011387; Fri, 2 Nov 2012 09:18:52 -0500
Received: from konrad-lan.dumpdata.com (/64.222.209.26)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 02 Nov 2012 07:18:51 -0700
Date: Fri, 2 Nov 2012 10:18:45 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121102141845.GA3413@konrad-lan.dumpdata.com>
References: <5093D4B502000078000A606E@nat28.tlf.novell.com>
	<20121102135514.GC3038@konrad-lan.dumpdata.com>
	<5093E1B602000078000A6105@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5093E1B602000078000A6105@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] ACPI/cpuidle: remove unused "power" field
 from Cx state data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 02, 2012 at 02:07:34PM +0000, Jan Beulich wrote:
> >>> On 02.11.12 at 14:55, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > On Fri, Nov 02, 2012 at 01:12:05PM +0000, Jan Beulich wrote:
> >> It has never been used for anything, and Linux 3.7 doesn't propagate
> >> this information anymore.
> >> 
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >> ---
> >> Konrad, on the pv-ops side it may be better to pass zero rather than
> >> leaving the field completely uninitialized.
> > 
> > I think this got taken care of by:
> > 
> > commit c59687f8466df36633d937cc298aad465d704990
> > Author: Daniel Lezcano <daniel.lezcano@linaro.org>
> > Date:   Wed Sep 5 15:13:48 2012 +0200
> > 
> >     cpuidle / ACPI : remove power from acpi_processor_cx structure
> >     
> >     Remove the unused power field from struct struct acpi_processor_cx.
> >     
> >     [rjw: Modified changelog.]
> 
> That's the commit I was referring to.
> 
> > And the the xen_processor_cx is allocated using kcalloc which resets
> > everything to zero - so I think we are safe there.
> 
> And that I didn't pay attention to - sorry for the noise then.

Oh no problem - Thank you for keeping me in the loop!
> 
> Jan
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:19:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:19:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUI5K-0000YJ-Bd; Fri, 02 Nov 2012 14:18:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TUI5J-0000Y7-19
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:18:57 +0000
Received: from [85.158.137.99:41671] by server-2.bemta-3.messagelabs.com id
	12/D2-04744-F46D3905; Fri, 02 Nov 2012 14:18:55 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1351865933!16605317!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAzNDA2NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 414 invoked from network); 2 Nov 2012 14:18:55 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-11.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 2 Nov 2012 14:18:55 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA2EIqvW024756
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 2 Nov 2012 14:18:53 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA2EIqDc003855
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 2 Nov 2012 14:18:52 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA2EIqRl011387; Fri, 2 Nov 2012 09:18:52 -0500
Received: from konrad-lan.dumpdata.com (/64.222.209.26)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 02 Nov 2012 07:18:51 -0700
Date: Fri, 2 Nov 2012 10:18:45 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121102141845.GA3413@konrad-lan.dumpdata.com>
References: <5093D4B502000078000A606E@nat28.tlf.novell.com>
	<20121102135514.GC3038@konrad-lan.dumpdata.com>
	<5093E1B602000078000A6105@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5093E1B602000078000A6105@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] ACPI/cpuidle: remove unused "power" field
 from Cx state data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 02, 2012 at 02:07:34PM +0000, Jan Beulich wrote:
> >>> On 02.11.12 at 14:55, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > On Fri, Nov 02, 2012 at 01:12:05PM +0000, Jan Beulich wrote:
> >> It has never been used for anything, and Linux 3.7 doesn't propagate
> >> this information anymore.
> >> 
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >> ---
> >> Konrad, on the pv-ops side it may be better to pass zero rather than
> >> leaving the field completely uninitialized.
> > 
> > I think this got taken care of by:
> > 
> > commit c59687f8466df36633d937cc298aad465d704990
> > Author: Daniel Lezcano <daniel.lezcano@linaro.org>
> > Date:   Wed Sep 5 15:13:48 2012 +0200
> > 
> >     cpuidle / ACPI : remove power from acpi_processor_cx structure
> >     
> >     Remove the unused power field from struct struct acpi_processor_cx.
> >     
> >     [rjw: Modified changelog.]
> 
> That's the commit I was referring to.
> 
> > And the the xen_processor_cx is allocated using kcalloc which resets
> > everything to zero - so I think we are safe there.
> 
> And that I didn't pay attention to - sorry for the noise then.

Oh no problem - Thank you for keeping me in the loop!
> 
> Jan
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:23:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:23:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUI9K-00014p-QF; Fri, 02 Nov 2012 14:23:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fantonifabio@tiscali.it>) id 1TUI9J-00014a-3d
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:23:05 +0000
Received: from [85.158.143.99:46276] by server-3.bemta-4.messagelabs.com id
	65/4A-06841-847D3905; Fri, 02 Nov 2012 14:23:04 +0000
X-Env-Sender: fantonifabio@tiscali.it
X-Msg-Ref: server-15.tower-216.messagelabs.com!1351866180!28362626!1
X-Originating-IP: [94.23.245.208]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1991 invoked from network); 2 Nov 2012 14:23:03 -0000
Received: from lnx3.fantu.it (HELO lnx3.fantu.it) (94.23.245.208)
	by server-15.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 2 Nov 2012 14:23:03 -0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by lnx3.fantu.it (Postfix) with ESMTP id 11FAA4015FC;
	Fri,  2 Nov 2012 15:23:00 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at lnx3.fantu.it
Received: from lnx3.fantu.it ([127.0.0.1])
	by localhost (lnx3.fantu.it [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id xaymLTWzThAo; Fri,  2 Nov 2012 15:22:59 +0100 (CET)
Received: from [192.168.178.50]
	(host51-78-dynamic.2-87-r.retail.telecomitalia.it [87.2.78.51])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: prova@fantu.it)
	by lnx3.fantu.it (Postfix) with ESMTPSA id B120B40009E;
	Fri,  2 Nov 2012 15:22:58 +0100 (CET)
Message-ID: <5093D73E.2040403@tiscali.it>
Date: Fri, 02 Nov 2012 15:22:54 +0100
From: Fabio Fantoni <fantonifabio@tiscali.it>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Gerd Hoffmann <kraxel@redhat.com>
References: <5093A592.1050005@tiscali.it> <87ehkcw2t4.fsf@codemonkey.ws>
	<5093CE5D.8070409@redhat.com>
In-Reply-To: <5093CE5D.8070409@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Build xen-unstable and qemu upstream unstable fail
 with error on xenfb.c
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: fantonifabio@tiscali.it
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8354307003510196197=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--===============8354307003510196197==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms010603090706050205040308"

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--------------ms010603090706050205040308
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Il 02/11/2012 14:45, Gerd Hoffmann ha scritto:
>    Hi,
>
>>> hw/xenfb.c:651:5: error: implicit declaration of function =C3=A2dpy_u=
pdate=C3=A2
>>> [-Werror=3Dimplicit-function-declaration]
>> Can you take a look at this Gerd?
> Happened already: http://patchwork.ozlabs.org/patch/196492/
>
> cheers,
>    Gerd
>
>
> -----
> Nessun virus nel messaggio.
> Controllato da AVG - www.avg.com
> Versione: 2012.0.2221 / Database dei virus: 2441/5368 -  Data di rilasc=
io: 01/11/2012
>
>
Thanks, patch applied and build successfull.

Start testing xen-unstable with qemu upstream unstable, tried Quantal=20
pvonhvm domU with spice and qxl, qemu crashes showing this on log file:

main_channel_link: add main channel client
main_channel_handle_parsed: net test: latency 47.335000 ms, bitrate=20
752664461 bps (717.796765 Mbps)
red_dispatcher_set_cursor_peer:
inputs_connect: inputs channel client create
id 0, group 0, virt start 0, virt end ffffffffffffffff, generation 0,=20
delta 0
id 1, group 1, virt start 7f634059b000, virt end 7f6344599000,=20
generation 0, delta 7f634059b000
id 2, group 1, virt start 7f6333f04000, virt end 7f6337f04000,=20
generation 0, delta 7f6333f04000
(/usr/sbin/xl:3427): Spice-CRITICAL **: red_memslots.c:123:get_virt:=20
slot_id 194 too big, addr=3Dc2c2c2c2c2c2c2c2

Some problem also on test of some days ago, can someone solve also this=20
problem please?
If you need more information/logs tell me and I'll post it.


--------------ms010603090706050205040308
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: Firma crittografica S/MIME

MIAGCSqGSIb3DQEHAqCAMIACAQExC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EaWdpdGFsIENlcnRpZmljYXRlIFNpZ25p
bmcxODA2BgNVBAMTL1N0YXJ0Q29tIENsYXNzIDIgUHJpbWFyeSBJbnRlcm1lZGlhdGUgQ2xp
ZW50IENBAgIeYzCBpgYLKoZIhvcNAQkQAgsxgZaggZMwgYwxCzAJBgNVBAYTAklMMRYwFAYD
VQQKEw1TdGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRhbCBDZXJ0aWZpY2F0
ZSBTaWduaW5nMTgwNgYDVQQDEy9TdGFydENvbSBDbGFzcyAyIFByaW1hcnkgSW50ZXJtZWRp
YXRlIENsaWVudCBDQQICHmMwDQYJKoZIhvcNAQEBBQAEggEAN7F+XVcrpzD7hb7WCB4OOnqV
ebUrRryBCt3QvU2UJZlv3TzfkpX5pRKROK55NOQuKcdDd10m8tj8CjuLEkA/CPnvSzKA9uDo
bnkNjmHS4lIQOD+WS20G0+Ky8JuWISMOja3vG3z4R6LoNPqDlTd03G4jBCE9/oQP5W73tAwB
7H71ZXKm4tx0JlXvUhAf2PSLNocb4Nn8znY3IoudZf0WOG4WDcAi4ci1pkff/td236fweDYh
3JBG133nxpK0URPpVkZXjvOHjxQ76t28Zex515MmQ33gjJOkf3VdUKd72uptUufYNOd/vdnT
tuUeeTNBJG08eZrTzumNfjm2DeWm3wAAAAAAAA==
--------------ms010603090706050205040308--


--===============8354307003510196197==
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.xen.org
http://lists.xen.org/xen-devel

--===============8354307003510196197==--


From xen-devel-bounces@lists.xen.org Fri Nov 02 14:23:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:23:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUI9K-00014p-QF; Fri, 02 Nov 2012 14:23:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fantonifabio@tiscali.it>) id 1TUI9J-00014a-3d
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:23:05 +0000
Received: from [85.158.143.99:46276] by server-3.bemta-4.messagelabs.com id
	65/4A-06841-847D3905; Fri, 02 Nov 2012 14:23:04 +0000
X-Env-Sender: fantonifabio@tiscali.it
X-Msg-Ref: server-15.tower-216.messagelabs.com!1351866180!28362626!1
X-Originating-IP: [94.23.245.208]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1991 invoked from network); 2 Nov 2012 14:23:03 -0000
Received: from lnx3.fantu.it (HELO lnx3.fantu.it) (94.23.245.208)
	by server-15.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 2 Nov 2012 14:23:03 -0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by lnx3.fantu.it (Postfix) with ESMTP id 11FAA4015FC;
	Fri,  2 Nov 2012 15:23:00 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at lnx3.fantu.it
Received: from lnx3.fantu.it ([127.0.0.1])
	by localhost (lnx3.fantu.it [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id xaymLTWzThAo; Fri,  2 Nov 2012 15:22:59 +0100 (CET)
Received: from [192.168.178.50]
	(host51-78-dynamic.2-87-r.retail.telecomitalia.it [87.2.78.51])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: prova@fantu.it)
	by lnx3.fantu.it (Postfix) with ESMTPSA id B120B40009E;
	Fri,  2 Nov 2012 15:22:58 +0100 (CET)
Message-ID: <5093D73E.2040403@tiscali.it>
Date: Fri, 02 Nov 2012 15:22:54 +0100
From: Fabio Fantoni <fantonifabio@tiscali.it>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Gerd Hoffmann <kraxel@redhat.com>
References: <5093A592.1050005@tiscali.it> <87ehkcw2t4.fsf@codemonkey.ws>
	<5093CE5D.8070409@redhat.com>
In-Reply-To: <5093CE5D.8070409@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Build xen-unstable and qemu upstream unstable fail
 with error on xenfb.c
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: fantonifabio@tiscali.it
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8354307003510196197=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--===============8354307003510196197==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms010603090706050205040308"

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--------------ms010603090706050205040308
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Il 02/11/2012 14:45, Gerd Hoffmann ha scritto:
>    Hi,
>
>>> hw/xenfb.c:651:5: error: implicit declaration of function =C3=A2dpy_u=
pdate=C3=A2
>>> [-Werror=3Dimplicit-function-declaration]
>> Can you take a look at this Gerd?
> Happened already: http://patchwork.ozlabs.org/patch/196492/
>
> cheers,
>    Gerd
>
>
> -----
> Nessun virus nel messaggio.
> Controllato da AVG - www.avg.com
> Versione: 2012.0.2221 / Database dei virus: 2441/5368 -  Data di rilasc=
io: 01/11/2012
>
>
Thanks, patch applied and build successfull.

Start testing xen-unstable with qemu upstream unstable, tried Quantal=20
pvonhvm domU with spice and qxl, qemu crashes showing this on log file:

main_channel_link: add main channel client
main_channel_handle_parsed: net test: latency 47.335000 ms, bitrate=20
752664461 bps (717.796765 Mbps)
red_dispatcher_set_cursor_peer:
inputs_connect: inputs channel client create
id 0, group 0, virt start 0, virt end ffffffffffffffff, generation 0,=20
delta 0
id 1, group 1, virt start 7f634059b000, virt end 7f6344599000,=20
generation 0, delta 7f634059b000
id 2, group 1, virt start 7f6333f04000, virt end 7f6337f04000,=20
generation 0, delta 7f6333f04000
(/usr/sbin/xl:3427): Spice-CRITICAL **: red_memslots.c:123:get_virt:=20
slot_id 194 too big, addr=3Dc2c2c2c2c2c2c2c2

Some problem also on test of some days ago, can someone solve also this=20
problem please?
If you need more information/logs tell me and I'll post it.


--------------ms010603090706050205040308
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: Firma crittografica S/MIME

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIINhjCC
BjQwggQcoAMCAQICASAwDQYJKoZIhvcNAQEFBQAwfTELMAkGA1UEBhMCSUwxFjAUBgNVBAoT
DVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNp
Z25pbmcxKTAnBgNVBAMTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA3
MTAyNDIxMDI1NVoXDTE3MTAyNDIxMDI1NVowgYwxCzAJBgN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kgSW50ZXJtZWRp
YXRlIENsaWVudCBDQQICHmMwDQYJKoZIhvcNAQEBBQAEggEAN7F+XVcrpzD7hb7WCB4OOnqV
ebUrRryBCt3QvU2UJZlv3TzfkpX5pRKROK55NOQuKcdDd10m8tj8CjuLEkA/CPnvSzKA9uDo
bnkNjmHS4lIQOD+WS20G0+Ky8JuWISMOja3vG3z4R6LoNPqDlTd03G4jBCE9/oQP5W73tAwB
7H71ZXKm4tx0JlXvUhAf2PSLNocb4Nn8znY3IoudZf0WOG4WDcAi4ci1pkff/td236fweDYh
3JBG133nxpK0URPpVkZXjvOHjxQ76t28Zex515MmQ33gjJOkf3VdUKd72uptUufYNOd/vdnT
tuUeeTNBJG08eZrTzumNfjm2DeWm3wAAAAAAAA==
--------------ms010603090706050205040308--


--===============8354307003510196197==
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.xen.org
http://lists.xen.org/xen-devel

--===============8354307003510196197==--


From xen-devel-bounces@lists.xen.org Fri Nov 02 14:25:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:25:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUIB6-0001HZ-Fp; Fri, 02 Nov 2012 14:24:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TUIB4-0001HH-P8
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:24:54 +0000
Received: from [193.109.254.147:20115] by server-2.bemta-14.messagelabs.com id
	9D/66-20829-6B7D3905; Fri, 02 Nov 2012 14:24:54 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1351866291!9359285!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODEwMDI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2017 invoked from network); 2 Nov 2012 14:24:53 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-13.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 14:24:53 -0000
X-IronPort-AV: E=Sophos;i="4.80,699,1344211200"; d="scan'208";a="43273393"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	02 Nov 2012 14:24:51 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 2 Nov 2012 10:24:51 -0400
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TUIB0-0000Ct-Eo;
	Fri, 02 Nov 2012 14:24:50 +0000
Message-ID: <1351866172.25014.67.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Fri, 2 Nov 2012 14:22:52 +0000
In-Reply-To: <5093E29A02000078000A611D@nat28.tlf.novell.com>
References: <504F3355.2070201@tiscali.it>
	<504F5182020000780009A9CC@nat28.tlf.novell.com>	<504F39F0.10701@tiscali.it>
	<504F625D020000780009AA85@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
	<5092D42A020000780008EB7B@nat28.tlf.novell.com>
	<20121102135209.GB3038@konrad-lan.dumpdata.com>
	<5093E29A02000078000A611D@nat28.tlf.novell.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"fantonifabio@tiscali.it" <fantonifabio@tiscali.it>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	"daniel.kiper@oracle.com" <daniel.kiper@oracle.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Start xen on UEFI system with grub
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


> > I believe the only issue was the check to do the  Multiboot-E820 parsing
> > before the E801 parsing? Perhaps that has already been done?
> 
> That's in all 4.x trees already. But no - the other important aspect
> is that without retrieving/passing on the proper EFI table pointers,
> on a legacy free system Xen and Dom0 won't be able to locate the
> ACPI tables.

How does this work with native Linux? AIUI the most common way to boot
regular Linux is using grub-efi.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:25:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:25:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUIB6-0001HZ-Fp; Fri, 02 Nov 2012 14:24:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TUIB4-0001HH-P8
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:24:54 +0000
Received: from [193.109.254.147:20115] by server-2.bemta-14.messagelabs.com id
	9D/66-20829-6B7D3905; Fri, 02 Nov 2012 14:24:54 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1351866291!9359285!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODEwMDI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2017 invoked from network); 2 Nov 2012 14:24:53 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-13.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 14:24:53 -0000
X-IronPort-AV: E=Sophos;i="4.80,699,1344211200"; d="scan'208";a="43273393"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	02 Nov 2012 14:24:51 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 2 Nov 2012 10:24:51 -0400
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TUIB0-0000Ct-Eo;
	Fri, 02 Nov 2012 14:24:50 +0000
Message-ID: <1351866172.25014.67.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Fri, 2 Nov 2012 14:22:52 +0000
In-Reply-To: <5093E29A02000078000A611D@nat28.tlf.novell.com>
References: <504F3355.2070201@tiscali.it>
	<504F5182020000780009A9CC@nat28.tlf.novell.com>	<504F39F0.10701@tiscali.it>
	<504F625D020000780009AA85@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
	<5092D42A020000780008EB7B@nat28.tlf.novell.com>
	<20121102135209.GB3038@konrad-lan.dumpdata.com>
	<5093E29A02000078000A611D@nat28.tlf.novell.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"fantonifabio@tiscali.it" <fantonifabio@tiscali.it>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	"daniel.kiper@oracle.com" <daniel.kiper@oracle.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Start xen on UEFI system with grub
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


> > I believe the only issue was the check to do the  Multiboot-E820 parsing
> > before the E801 parsing? Perhaps that has already been done?
> 
> That's in all 4.x trees already. But no - the other important aspect
> is that without retrieving/passing on the proper EFI table pointers,
> on a legacy free system Xen and Dom0 won't be able to locate the
> ACPI tables.

How does this work with native Linux? AIUI the most common way to boot
regular Linux is using grub-efi.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:32:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:32:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUIIA-0001rE-HI; Fri, 02 Nov 2012 14:32:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <alan@lxorguk.ukuu.org.uk>) id 1TUII9-0001r6-GH
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:32:13 +0000
Received: from [85.158.143.99:55864] by server-1.bemta-4.messagelabs.com id
	E2/7D-27934-C69D3905; Fri, 02 Nov 2012 14:32:12 +0000
X-Env-Sender: alan@lxorguk.ukuu.org.uk
X-Msg-Ref: server-6.tower-216.messagelabs.com!1351866731!21356310!1
X-Originating-IP: [81.2.110.251]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13574 invoked from network); 2 Nov 2012 14:32:12 -0000
Received: from lxorguk.ukuu.org.uk (HELO lxorguk.ukuu.org.uk) (81.2.110.251)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 2 Nov 2012 14:32:12 -0000
Received: from pyramind.ukuu.org.uk (earthlight.etchedpixels.co.uk
	[81.2.110.250])
	by lxorguk.ukuu.org.uk (8.14.5/8.14.1) with ESMTP id qA2F3uit023517;
	Fri, 2 Nov 2012 15:04:01 GMT
Received: from pyramind.ukuu.org.uk (localhost [127.0.0.1])
	by pyramind.ukuu.org.uk (8.14.5/8.14.5) with ESMTP id qA2EbFf4026031;
	Fri, 2 Nov 2012 14:37:16 GMT
Date: Fri, 2 Nov 2012 14:37:15 +0000
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Ian Campbell <ian.campbell@citrix.com>
Message-ID: <20121102143715.2a1ee422@pyramind.ukuu.org.uk>
In-Reply-To: <1351866172.25014.67.camel@hastur.hellion.org.uk>
References: <504F3355.2070201@tiscali.it>
	<504F5182020000780009A9CC@nat28.tlf.novell.com>
	<504F39F0.10701@tiscali.it>
	<504F625D020000780009AA85@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
	<5092D42A020000780008EB7B@nat28.tlf.novell.com>
	<20121102135209.GB3038@konrad-lan.dumpdata.com>
	<5093E29A02000078000A611D@nat28.tlf.novell.com>
	<1351866172.25014.67.camel@hastur.hellion.org.uk>
X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.8; x86_64-redhat-linux-gnu)
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEWysKsSBQMIAwIZCwj///8wIhxoRDXH9QHCAAABeUlEQVQ4jaXTvW7DIBAAYCQTzz2hdq+rdg494ZmBeE5KYHZjm/d/hJ6NfzBJpp5kRb5PHJwvMPMk2L9As5Y9AmYRBL+HAyJKeOU5aHRhsAAvORQ+UEgAvgddj/lwAXndw2laEDqA4x6KEBhjYRCg9tBFCOuJFxg2OKegbWjbsRTk8PPhKPD7HcRxB7cqhgBRp9Dcqs+B8v4CQvFdqeot3Kov6hBUn0AJitrzY+sgUuiA8i0r7+B3AfqKcN6t8M6HtqQ+AOoELCikgQSbgabKaJW3kn5lBs47JSGDhhLKDUh1UMipwwinMYPTBuIBjEclSaGZUk9hDlTb5sUTYN2SFFQuPe4Gox1X0FZOufjgBiV1Vls7b+GvK3SU4wfmcGo9rPPQzgIabfj4TYQo15k3bTHX9RIw/kniir5YbtJF4jkFG+dsDK1IgE413zAthU/vR2HVMmFUPIHTvF6jWCpFaGw/A3qWgnbxpSm9MSmY5b3pM1gvNc/gQfwBsGwF0VCtxZgAAAAASUVORK5CYII=
Mime-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	"daniel.kiper@oracle.com" <daniel.kiper@oracle.com>,
	"fantonifabio@tiscali.it" <fantonifabio@tiscali.it>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] Start xen on UEFI system with grub
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2 Nov 2012 14:22:52 +0000
Ian Campbell <ian.campbell@citrix.com> wrote:

> 
> > > I believe the only issue was the check to do the  Multiboot-E820 parsing
> > > before the E801 parsing? Perhaps that has already been done?
> > 
> > That's in all 4.x trees already. But no - the other important aspect
> > is that without retrieving/passing on the proper EFI table pointers,
> > on a legacy free system Xen and Dom0 won't be able to locate the
> > ACPI tables.
> 
> How does this work with native Linux? AIUI the most common way to boot
> regular Linux is using grub-efi.

The preferred way to boot Linux on an EFI platform is to build an EFI
Linux kernel and just let EFI run it. This is supported from 3.3 onwards.
All you then need is one of the innumerable EFI boot chooses that are
springing up (rEFInd, Gummiboot etc) or use the UEFI Shell or efibootmgr

Alan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:32:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:32:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUIIA-0001rE-HI; Fri, 02 Nov 2012 14:32:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <alan@lxorguk.ukuu.org.uk>) id 1TUII9-0001r6-GH
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:32:13 +0000
Received: from [85.158.143.99:55864] by server-1.bemta-4.messagelabs.com id
	E2/7D-27934-C69D3905; Fri, 02 Nov 2012 14:32:12 +0000
X-Env-Sender: alan@lxorguk.ukuu.org.uk
X-Msg-Ref: server-6.tower-216.messagelabs.com!1351866731!21356310!1
X-Originating-IP: [81.2.110.251]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13574 invoked from network); 2 Nov 2012 14:32:12 -0000
Received: from lxorguk.ukuu.org.uk (HELO lxorguk.ukuu.org.uk) (81.2.110.251)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 2 Nov 2012 14:32:12 -0000
Received: from pyramind.ukuu.org.uk (earthlight.etchedpixels.co.uk
	[81.2.110.250])
	by lxorguk.ukuu.org.uk (8.14.5/8.14.1) with ESMTP id qA2F3uit023517;
	Fri, 2 Nov 2012 15:04:01 GMT
Received: from pyramind.ukuu.org.uk (localhost [127.0.0.1])
	by pyramind.ukuu.org.uk (8.14.5/8.14.5) with ESMTP id qA2EbFf4026031;
	Fri, 2 Nov 2012 14:37:16 GMT
Date: Fri, 2 Nov 2012 14:37:15 +0000
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Ian Campbell <ian.campbell@citrix.com>
Message-ID: <20121102143715.2a1ee422@pyramind.ukuu.org.uk>
In-Reply-To: <1351866172.25014.67.camel@hastur.hellion.org.uk>
References: <504F3355.2070201@tiscali.it>
	<504F5182020000780009A9CC@nat28.tlf.novell.com>
	<504F39F0.10701@tiscali.it>
	<504F625D020000780009AA85@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211011544190.2689@kaball.uk.xensource.com>
	<5092D42A020000780008EB7B@nat28.tlf.novell.com>
	<20121102135209.GB3038@konrad-lan.dumpdata.com>
	<5093E29A02000078000A611D@nat28.tlf.novell.com>
	<1351866172.25014.67.camel@hastur.hellion.org.uk>
X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.8; x86_64-redhat-linux-gnu)
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEWysKsSBQMIAwIZCwj///8wIhxoRDXH9QHCAAABeUlEQVQ4jaXTvW7DIBAAYCQTzz2hdq+rdg494ZmBeE5KYHZjm/d/hJ6NfzBJpp5kRb5PHJwvMPMk2L9As5Y9AmYRBL+HAyJKeOU5aHRhsAAvORQ+UEgAvgddj/lwAXndw2laEDqA4x6KEBhjYRCg9tBFCOuJFxg2OKegbWjbsRTk8PPhKPD7HcRxB7cqhgBRp9Dcqs+B8v4CQvFdqeot3Kov6hBUn0AJitrzY+sgUuiA8i0r7+B3AfqKcN6t8M6HtqQ+AOoELCikgQSbgabKaJW3kn5lBs47JSGDhhLKDUh1UMipwwinMYPTBuIBjEclSaGZUk9hDlTb5sUTYN2SFFQuPe4Gox1X0FZOufjgBiV1Vls7b+GvK3SU4wfmcGo9rPPQzgIabfj4TYQo15k3bTHX9RIw/kniir5YbtJF4jkFG+dsDK1IgE413zAthU/vR2HVMmFUPIHTvF6jWCpFaGw/A3qWgnbxpSm9MSmY5b3pM1gvNc/gQfwBsGwF0VCtxZgAAAAASUVORK5CYII=
Mime-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	"daniel.kiper@oracle.com" <daniel.kiper@oracle.com>,
	"fantonifabio@tiscali.it" <fantonifabio@tiscali.it>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] Start xen on UEFI system with grub
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2 Nov 2012 14:22:52 +0000
Ian Campbell <ian.campbell@citrix.com> wrote:

> 
> > > I believe the only issue was the check to do the  Multiboot-E820 parsing
> > > before the E801 parsing? Perhaps that has already been done?
> > 
> > That's in all 4.x trees already. But no - the other important aspect
> > is that without retrieving/passing on the proper EFI table pointers,
> > on a legacy free system Xen and Dom0 won't be able to locate the
> > ACPI tables.
> 
> How does this work with native Linux? AIUI the most common way to boot
> regular Linux is using grub-efi.

The preferred way to boot Linux on an EFI platform is to build an EFI
Linux kernel and just let EFI run it. This is supported from 3.3 onwards.
All you then need is one of the innumerable EFI boot chooses that are
springing up (rEFInd, Gummiboot etc) or use the UEFI Shell or efibootmgr

Alan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:35:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:35:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUIKr-0001zB-Ka; Fri, 02 Nov 2012 14:35:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUIKq-0001z4-2U
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:35:00 +0000
Received: from [85.158.143.35:26721] by server-2.bemta-4.messagelabs.com id
	8A/5F-28922-31AD3905; Fri, 02 Nov 2012 14:34:59 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1351866898!16125998!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5775 invoked from network); 2 Nov 2012 14:34:59 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-21.messagelabs.com with SMTP;
	2 Nov 2012 14:34:59 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 14:35:29 +0000
Message-Id: <5093E84C02000078000A619F@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 14:35:40 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: linux-kernel@vger.kernel.org, xen-devel <xen-devel@lists.xen.org>
Subject: [Xen-devel] [PATCH 0/2] xen-pciback: parsing improvements
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

1: simplify and tighten parsing of device IDs
2: reject out of range inputs

Signed-off-by: Jan Beulich <jbeulich@suse.com>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:35:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:35:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUIKr-0001zB-Ka; Fri, 02 Nov 2012 14:35:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUIKq-0001z4-2U
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:35:00 +0000
Received: from [85.158.143.35:26721] by server-2.bemta-4.messagelabs.com id
	8A/5F-28922-31AD3905; Fri, 02 Nov 2012 14:34:59 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1351866898!16125998!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5775 invoked from network); 2 Nov 2012 14:34:59 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-21.messagelabs.com with SMTP;
	2 Nov 2012 14:34:59 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 14:35:29 +0000
Message-Id: <5093E84C02000078000A619F@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 14:35:40 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: linux-kernel@vger.kernel.org, xen-devel <xen-devel@lists.xen.org>
Subject: [Xen-devel] [PATCH 0/2] xen-pciback: parsing improvements
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

1: simplify and tighten parsing of device IDs
2: reject out of range inputs

Signed-off-by: Jan Beulich <jbeulich@suse.com>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:36:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:36:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUILr-00025Y-8O; Fri, 02 Nov 2012 14:36:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUILp-000259-3T
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:36:01 +0000
Received: from [85.158.143.35:33663] by server-1.bemta-4.messagelabs.com id
	60/62-27934-E4AD3905; Fri, 02 Nov 2012 14:35:58 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1351866957!16126148!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8873 invoked from network); 2 Nov 2012 14:35:57 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-21.messagelabs.com with SMTP;
	2 Nov 2012 14:35:57 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 14:36:30 +0000
Message-Id: <5093E88602000078000A61A3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 14:36:38 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part1726D966.0__="
Cc: linux-kernel@vger.kernel.org, xen-devel <xen-devel@lists.xen.org>
Subject: [Xen-devel] [PATCH 1/2] xen-pciback: simplify and tighten parsing
 of device IDs
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part1726D966.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Now that at least one of the conformance problems of the kernel's
sscanf() was addressed (commit da99075c1d368315e1508b6143226c0d27b621e0),
we can improve the parsing done in xen-pciback both in terms of code
readability and correctness (in particular properly rejecting input
strings not well formed).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

---
 drivers/xen/xen-pciback/pci_stub.c |   83 +++++++++++++++++---------------=
-----
 1 file changed, 39 insertions(+), 44 deletions(-)

--- 3.7-rc3-xen-pciback.orig/drivers/xen/xen-pciback/pci_stub.c
+++ 3.7-rc3-xen-pciback/drivers/xen/xen-pciback/pci_stub.c
@@ -897,42 +897,35 @@ static struct pci_driver xen_pcibk_pci_d
 static inline int str_to_slot(const char *buf, int *domain, int *bus,
 			      int *slot, int *func)
 {
-	int err;
-	char wc =3D '*';
+	int parsed =3D 0;
=20
-	err =3D sscanf(buf, " %x:%x:%x.%x", domain, bus, slot, func);
-	switch (err) {
+	switch (sscanf(buf, " %x:%x:%x.%x %n", domain, bus, slot, func,
+		       &parsed)) {
 	case 3:
 		*func =3D -1;
-		err =3D sscanf(buf, " %x:%x:%x.%c", domain, bus, slot, =
&wc);
+		sscanf(buf, " %x:%x:%x.* %n", domain, bus, slot, &parsed);
 		break;
 	case 2:
 		*slot =3D *func =3D -1;
-		err =3D sscanf(buf, " %x:%x:*.%c", domain, bus, &wc);
-		if (err >=3D 2)
-			++err;
+		sscanf(buf, " %x:%x:*.* %n", domain, bus, &parsed);
 		break;
 	}
-	if (err =3D=3D 4 && wc =3D=3D '*')
+	if (parsed && !buf[parsed])
 		return 0;
-	else if (err < 0)
-		return -EINVAL;
=20
 	/* try again without domain */
 	*domain =3D 0;
-	wc =3D '*';
-	err =3D sscanf(buf, " %x:%x.%x", bus, slot, func);
-	switch (err) {
+	switch (sscanf(buf, " %x:%x.%x %n", bus, slot, func, &parsed)) {
 	case 2:
 		*func =3D -1;
-		err =3D sscanf(buf, " %x:%x.%c", bus, slot, &wc);
+		sscanf(buf, " %x:%x.* %n", bus, slot, &parsed);
 		break;
 	case 1:
 		*slot =3D *func =3D -1;
-		err =3D sscanf(buf, " %x:*.%c", bus, &wc) + 1;
+		sscanf(buf, " %x:*.* %n", bus, &parsed);
 		break;
 	}
-	if (err =3D=3D 3 && wc =3D=3D '*')
+	if (parsed && !buf[parsed])
 		return 0;
=20
 	return -EINVAL;
@@ -941,13 +934,20 @@ static inline int str_to_slot(const char
 static inline int str_to_quirk(const char *buf, int *domain, int *bus, =
int
 			       *slot, int *func, int *reg, int *size, int =
*mask)
 {
-	int err;
+	int parsed =3D 0;
+
+	sscanf(buf, " %4x:%2x:%2x.%d-%8x:%1x:%8x %n", domain, bus, slot, =
func,
+	       reg, size, mask, &parsed);
+	if (parsed && !buf[parsed])
+		return 0;
=20
-	err =3D
-	    sscanf(buf, " %04x:%02x:%02x.%d-%08x:%1x:%08x", domain, bus, =
slot,
-		   func, reg, size, mask);
-	if (err =3D=3D 7)
+	/* try again without domain */
+	*domain =3D 0;
+	sscanf(buf, " %2x:%2x.%d-%8x:%1x:%8x %n", bus, slot, func, reg, =
size,
+	       mask, &parsed);
+	if (parsed && !buf[parsed])
 		return 0;
+
 	return -EINVAL;
 }
=20
@@ -1339,8 +1339,6 @@ static int __init pcistub_init(void)
=20
 	if (pci_devs_to_hide && *pci_devs_to_hide) {
 		do {
-			char wc =3D '*';
-
 			parsed =3D 0;
=20
 			err =3D sscanf(pci_devs_to_hide + pos,
@@ -1349,51 +1347,48 @@ static int __init pcistub_init(void)
 			switch (err) {
 			case 3:
 				func =3D -1;
-				err =3D sscanf(pci_devs_to_hide + pos,
-					     " (%x:%x:%x.%c) %n",
-					     &domain, &bus, &slot, &wc,
-					     &parsed);
+				sscanf(pci_devs_to_hide + pos,
+				       " (%x:%x:%x.*) %n",
+				       &domain, &bus, &slot, &parsed);
 				break;
 			case 2:
 				slot =3D func =3D -1;
-				err =3D sscanf(pci_devs_to_hide + pos,
-					     " (%x:%x:*.%c) %n",
-					     &domain, &bus, &wc, &parsed) =
+ 1;
+				sscanf(pci_devs_to_hide + pos,
+				       " (%x:%x:*.*) %n",
+				       &domain, &bus, &parsed);
 				break;
 			}
=20
-			if (err !=3D 4 || wc !=3D '*') {
+			if (!parsed) {
 				domain =3D 0;
-				wc =3D '*';
 				err =3D sscanf(pci_devs_to_hide + pos,
 					     " (%x:%x.%x) %n",
 					     &bus, &slot, &func, &parsed);
 				switch (err) {
 				case 2:
 					func =3D -1;
-					err =3D sscanf(pci_devs_to_hide + =
pos,
-						     " (%x:%x.%c) %n",
-						     &bus, &slot, &wc,
-						     &parsed);
+					sscanf(pci_devs_to_hide + pos,
+					       " (%x:%x.*) %n",
+					       &bus, &slot, &parsed);
 					break;
 				case 1:
 					slot =3D func =3D -1;
-					err =3D sscanf(pci_devs_to_hide + =
pos,
-						     " (%x:*.%c) %n",
-						     &bus, &wc, &parsed) + =
1;
+					sscanf(pci_devs_to_hide + pos,
+					       " (%x:*.*) %n",
+					       &bus, &parsed);
 					break;
 				}
-				if (err !=3D 3 || wc !=3D '*')
-					goto parse_error;
 			}
=20
+			if (parsed <=3D 0)
+				goto parse_error;
+
 			err =3D pcistub_device_id_add(domain, bus, slot, =
func);
 			if (err)
 				goto out;
=20
-			/* if parsed<=3D0, we've reached the end of the =
string */
 			pos +=3D parsed;
-		} while (parsed > 0 && pci_devs_to_hide[pos]);
+		} while (pci_devs_to_hide[pos]);
 	}
=20
 	/* If we're the first PCI Device Driver to register, we're the



--=__Part1726D966.0__=
Content-Type: text/plain; name="linux-3.7-rc3-xen-pciback-parse.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="linux-3.7-rc3-xen-pciback-parse.patch"

xen-pciback: simplify and tighten parsing of device IDs=0A=0ANow that at =
least one of the conformance problems of the kernel's=0Asscanf() was =
addressed (commit da99075c1d368315e1508b6143226c0d27b621e0),=0Awe can =
improve the parsing done in xen-pciback both in terms of code=0Areadability=
 and correctness (in particular properly rejecting input=0Astrings not =
well formed).=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A---=
=0A drivers/xen/xen-pciback/pci_stub.c |   83 +++++++++++++++++------------=
--------=0A 1 file changed, 39 insertions(+), 44 deletions(-)=0A=0A--- =
3.7-rc3-xen-pciback.orig/drivers/xen/xen-pciback/pci_stub.c=0A+++ =
3.7-rc3-xen-pciback/drivers/xen/xen-pciback/pci_stub.c=0A@@ -897,42 =
+897,35 @@ static struct pci_driver xen_pcibk_pci_d=0A static inline int =
str_to_slot(const char *buf, int *domain, int *bus,=0A 			   =
   int *slot, int *func)=0A {=0A-	int err;=0A-	char wc =3D =
'*';=0A+	int parsed =3D 0;=0A =0A-	err =3D sscanf(buf, " =
%x:%x:%x.%x", domain, bus, slot, func);=0A-	switch (err) {=0A+	=
switch (sscanf(buf, " %x:%x:%x.%x %n", domain, bus, slot, func,=0A+		=
       &parsed)) {=0A 	case 3:=0A 		*func =3D -1;=0A-		=
err =3D sscanf(buf, " %x:%x:%x.%c", domain, bus, slot, &wc);=0A+		=
sscanf(buf, " %x:%x:%x.* %n", domain, bus, slot, &parsed);=0A 		=
break;=0A 	case 2:=0A 		*slot =3D *func =3D -1;=0A-		=
err =3D sscanf(buf, " %x:%x:*.%c", domain, bus, &wc);=0A-		if =
(err >=3D 2)=0A-			++err;=0A+		sscanf(buf,=
 " %x:%x:*.* %n", domain, bus, &parsed);=0A 		break;=0A 	=
}=0A-	if (err =3D=3D 4 && wc =3D=3D '*')=0A+	if (parsed && !buf[parsed])=
=0A 		return 0;=0A-	else if (err < 0)=0A-		return =
-EINVAL;=0A =0A 	/* try again without domain */=0A 	*domain =
=3D 0;=0A-	wc =3D '*';=0A-	err =3D sscanf(buf, " %x:%x.%x", bus, =
slot, func);=0A-	switch (err) {=0A+	switch (sscanf(buf, " =
%x:%x.%x %n", bus, slot, func, &parsed)) {=0A 	case 2:=0A 		=
*func =3D -1;=0A-		err =3D sscanf(buf, " %x:%x.%c", bus, =
slot, &wc);=0A+		sscanf(buf, " %x:%x.* %n", bus, slot, &parsed);=0A =
		break;=0A 	case 1:=0A 		*slot =3D *func =
=3D -1;=0A-		err =3D sscanf(buf, " %x:*.%c", bus, &wc) + 1;=0A+	=
	sscanf(buf, " %x:*.* %n", bus, &parsed);=0A 		break;=0A 	=
}=0A-	if (err =3D=3D 3 && wc =3D=3D '*')=0A+	if (parsed && !buf[parsed])=
=0A 		return 0;=0A =0A 	return -EINVAL;=0A@@ -941,13 =
+934,20 @@ static inline int str_to_slot(const char=0A static inline int =
str_to_quirk(const char *buf, int *domain, int *bus, int=0A 			=
       *slot, int *func, int *reg, int *size, int *mask)=0A {=0A-	=
int err;=0A+	int parsed =3D 0;=0A+=0A+	sscanf(buf, " %4x:%2x:%2x.%=
d-%8x:%1x:%8x %n", domain, bus, slot, func,=0A+	       reg, size, mask, =
&parsed);=0A+	if (parsed && !buf[parsed])=0A+		return 0;=0A =0A-	=
err =3D=0A-	    sscanf(buf, " %04x:%02x:%02x.%d-%08x:%1x:%08x", =
domain, bus, slot,=0A-		   func, reg, size, mask);=0A-	if (err =
=3D=3D 7)=0A+	/* try again without domain */=0A+	*domain =3D 0;=0A+	=
sscanf(buf, " %2x:%2x.%d-%8x:%1x:%8x %n", bus, slot, func, reg, size,=0A+	=
       mask, &parsed);=0A+	if (parsed && !buf[parsed])=0A 		=
return 0;=0A+=0A 	return -EINVAL;=0A }=0A =0A@@ -1339,8 +1339,6 @@ =
static int __init pcistub_init(void)=0A =0A 	if (pci_devs_to_hide && =
*pci_devs_to_hide) {=0A 		do {=0A-			=
char wc =3D '*';=0A-=0A 			parsed =3D 0;=0A =0A 		=
	err =3D sscanf(pci_devs_to_hide + pos,=0A@@ -1349,51 +1347,48 @@ =
static int __init pcistub_init(void)=0A 			switch =
(err) {=0A 			case 3:=0A 				=
func =3D -1;=0A-				err =3D sscanf(pci_devs_to_=
hide + pos,=0A-					     " (%x:%x:%x.%c) =
%n",=0A-					     &domain, &bus, &slot, =
&wc,=0A-					     &parsed);=0A+		=
		sscanf(pci_devs_to_hide + pos,=0A+				=
       " (%x:%x:%x.*) %n",=0A+				       &domain, =
&bus, &slot, &parsed);=0A 				break;=0A 		=
	case 2:=0A 				slot =3D func =3D -1;=0A-	=
			err =3D sscanf(pci_devs_to_hide + pos,=0A-		=
			     " (%x:%x:*.%c) %n",=0A-				=
	     &domain, &bus, &wc, &parsed) + 1;=0A+				=
sscanf(pci_devs_to_hide + pos,=0A+				       " =
(%x:%x:*.*) %n",=0A+				       &domain, &bus, =
&parsed);=0A 				break;=0A 			=
}=0A =0A-			if (err !=3D 4 || wc !=3D '*') {=0A+		=
	if (!parsed) {=0A 				domain =3D 0;=0A-	=
			wc =3D '*';=0A 				err =3D =
sscanf(pci_devs_to_hide + pos,=0A 					   =
  " (%x:%x.%x) %n",=0A 					     &bus, &slot, =
&func, &parsed);=0A 				switch (err) {=0A 		=
		case 2:=0A 					func =3D =
-1;=0A-					err =3D sscanf(pci_devs_to_hide + =
pos,=0A-						     " (%x:%x.%c) =
%n",=0A-						     &bus, &slot, =
&wc,=0A-						     &parsed);=0A+	=
				sscanf(pci_devs_to_hide + pos,=0A+		=
			       " (%x:%x.*) %n",=0A+				=
	       &bus, &slot, &parsed);=0A 					=
break;=0A 				case 1:=0A 				=
	slot =3D func =3D -1;=0A-					=
err =3D sscanf(pci_devs_to_hide + pos,=0A-					=
	     " (%x:*.%c) %n",=0A-						=
     &bus, &wc, &parsed) + 1;=0A+					=
sscanf(pci_devs_to_hide + pos,=0A+					   =
    " (%x:*.*) %n",=0A+					       &bus, =
&parsed);=0A 					break;=0A 			=
	}=0A-				if (err !=3D 3 || wc !=3D '*')=0A-	=
				goto parse_error;=0A 			=
}=0A =0A+			if (parsed <=3D 0)=0A+				=
goto parse_error;=0A+=0A 			err =3D pcistub_device_id_a=
dd(domain, bus, slot, func);=0A 			if (err)=0A 		=
		goto out;=0A =0A-			/* if parsed<=3D0, =
we've reached the end of the string */=0A 			pos +=3D =
parsed;=0A-		} while (parsed > 0 && pci_devs_to_hide[pos]);=0A+	=
	} while (pci_devs_to_hide[pos]);=0A 	}=0A =0A 	/* If =
we're the first PCI Device Driver to register, we're the=0A
--=__Part1726D966.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.xen.org
http://lists.xen.org/xen-devel

--=__Part1726D966.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 02 14:36:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:36:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUILr-00025Y-8O; Fri, 02 Nov 2012 14:36:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUILp-000259-3T
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:36:01 +0000
Received: from [85.158.143.35:33663] by server-1.bemta-4.messagelabs.com id
	60/62-27934-E4AD3905; Fri, 02 Nov 2012 14:35:58 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1351866957!16126148!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8873 invoked from network); 2 Nov 2012 14:35:57 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-21.messagelabs.com with SMTP;
	2 Nov 2012 14:35:57 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 14:36:30 +0000
Message-Id: <5093E88602000078000A61A3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 14:36:38 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part1726D966.0__="
Cc: linux-kernel@vger.kernel.org, xen-devel <xen-devel@lists.xen.org>
Subject: [Xen-devel] [PATCH 1/2] xen-pciback: simplify and tighten parsing
 of device IDs
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part1726D966.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Now that at least one of the conformance problems of the kernel's
sscanf() was addressed (commit da99075c1d368315e1508b6143226c0d27b621e0),
we can improve the parsing done in xen-pciback both in terms of code
readability and correctness (in particular properly rejecting input
strings not well formed).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

---
 drivers/xen/xen-pciback/pci_stub.c |   83 +++++++++++++++++---------------=
-----
 1 file changed, 39 insertions(+), 44 deletions(-)

--- 3.7-rc3-xen-pciback.orig/drivers/xen/xen-pciback/pci_stub.c
+++ 3.7-rc3-xen-pciback/drivers/xen/xen-pciback/pci_stub.c
@@ -897,42 +897,35 @@ static struct pci_driver xen_pcibk_pci_d
 static inline int str_to_slot(const char *buf, int *domain, int *bus,
 			      int *slot, int *func)
 {
-	int err;
-	char wc =3D '*';
+	int parsed =3D 0;
=20
-	err =3D sscanf(buf, " %x:%x:%x.%x", domain, bus, slot, func);
-	switch (err) {
+	switch (sscanf(buf, " %x:%x:%x.%x %n", domain, bus, slot, func,
+		       &parsed)) {
 	case 3:
 		*func =3D -1;
-		err =3D sscanf(buf, " %x:%x:%x.%c", domain, bus, slot, =
&wc);
+		sscanf(buf, " %x:%x:%x.* %n", domain, bus, slot, &parsed);
 		break;
 	case 2:
 		*slot =3D *func =3D -1;
-		err =3D sscanf(buf, " %x:%x:*.%c", domain, bus, &wc);
-		if (err >=3D 2)
-			++err;
+		sscanf(buf, " %x:%x:*.* %n", domain, bus, &parsed);
 		break;
 	}
-	if (err =3D=3D 4 && wc =3D=3D '*')
+	if (parsed && !buf[parsed])
 		return 0;
-	else if (err < 0)
-		return -EINVAL;
=20
 	/* try again without domain */
 	*domain =3D 0;
-	wc =3D '*';
-	err =3D sscanf(buf, " %x:%x.%x", bus, slot, func);
-	switch (err) {
+	switch (sscanf(buf, " %x:%x.%x %n", bus, slot, func, &parsed)) {
 	case 2:
 		*func =3D -1;
-		err =3D sscanf(buf, " %x:%x.%c", bus, slot, &wc);
+		sscanf(buf, " %x:%x.* %n", bus, slot, &parsed);
 		break;
 	case 1:
 		*slot =3D *func =3D -1;
-		err =3D sscanf(buf, " %x:*.%c", bus, &wc) + 1;
+		sscanf(buf, " %x:*.* %n", bus, &parsed);
 		break;
 	}
-	if (err =3D=3D 3 && wc =3D=3D '*')
+	if (parsed && !buf[parsed])
 		return 0;
=20
 	return -EINVAL;
@@ -941,13 +934,20 @@ static inline int str_to_slot(const char
 static inline int str_to_quirk(const char *buf, int *domain, int *bus, =
int
 			       *slot, int *func, int *reg, int *size, int =
*mask)
 {
-	int err;
+	int parsed =3D 0;
+
+	sscanf(buf, " %4x:%2x:%2x.%d-%8x:%1x:%8x %n", domain, bus, slot, =
func,
+	       reg, size, mask, &parsed);
+	if (parsed && !buf[parsed])
+		return 0;
=20
-	err =3D
-	    sscanf(buf, " %04x:%02x:%02x.%d-%08x:%1x:%08x", domain, bus, =
slot,
-		   func, reg, size, mask);
-	if (err =3D=3D 7)
+	/* try again without domain */
+	*domain =3D 0;
+	sscanf(buf, " %2x:%2x.%d-%8x:%1x:%8x %n", bus, slot, func, reg, =
size,
+	       mask, &parsed);
+	if (parsed && !buf[parsed])
 		return 0;
+
 	return -EINVAL;
 }
=20
@@ -1339,8 +1339,6 @@ static int __init pcistub_init(void)
=20
 	if (pci_devs_to_hide && *pci_devs_to_hide) {
 		do {
-			char wc =3D '*';
-
 			parsed =3D 0;
=20
 			err =3D sscanf(pci_devs_to_hide + pos,
@@ -1349,51 +1347,48 @@ static int __init pcistub_init(void)
 			switch (err) {
 			case 3:
 				func =3D -1;
-				err =3D sscanf(pci_devs_to_hide + pos,
-					     " (%x:%x:%x.%c) %n",
-					     &domain, &bus, &slot, &wc,
-					     &parsed);
+				sscanf(pci_devs_to_hide + pos,
+				       " (%x:%x:%x.*) %n",
+				       &domain, &bus, &slot, &parsed);
 				break;
 			case 2:
 				slot =3D func =3D -1;
-				err =3D sscanf(pci_devs_to_hide + pos,
-					     " (%x:%x:*.%c) %n",
-					     &domain, &bus, &wc, &parsed) =
+ 1;
+				sscanf(pci_devs_to_hide + pos,
+				       " (%x:%x:*.*) %n",
+				       &domain, &bus, &parsed);
 				break;
 			}
=20
-			if (err !=3D 4 || wc !=3D '*') {
+			if (!parsed) {
 				domain =3D 0;
-				wc =3D '*';
 				err =3D sscanf(pci_devs_to_hide + pos,
 					     " (%x:%x.%x) %n",
 					     &bus, &slot, &func, &parsed);
 				switch (err) {
 				case 2:
 					func =3D -1;
-					err =3D sscanf(pci_devs_to_hide + =
pos,
-						     " (%x:%x.%c) %n",
-						     &bus, &slot, &wc,
-						     &parsed);
+					sscanf(pci_devs_to_hide + pos,
+					       " (%x:%x.*) %n",
+					       &bus, &slot, &parsed);
 					break;
 				case 1:
 					slot =3D func =3D -1;
-					err =3D sscanf(pci_devs_to_hide + =
pos,
-						     " (%x:*.%c) %n",
-						     &bus, &wc, &parsed) + =
1;
+					sscanf(pci_devs_to_hide + pos,
+					       " (%x:*.*) %n",
+					       &bus, &parsed);
 					break;
 				}
-				if (err !=3D 3 || wc !=3D '*')
-					goto parse_error;
 			}
=20
+			if (parsed <=3D 0)
+				goto parse_error;
+
 			err =3D pcistub_device_id_add(domain, bus, slot, =
func);
 			if (err)
 				goto out;
=20
-			/* if parsed<=3D0, we've reached the end of the =
string */
 			pos +=3D parsed;
-		} while (parsed > 0 && pci_devs_to_hide[pos]);
+		} while (pci_devs_to_hide[pos]);
 	}
=20
 	/* If we're the first PCI Device Driver to register, we're the



--=__Part1726D966.0__=
Content-Type: text/plain; name="linux-3.7-rc3-xen-pciback-parse.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="linux-3.7-rc3-xen-pciback-parse.patch"

xen-pciback: simplify and tighten parsing of device IDs=0A=0ANow that at =
least one of the conformance problems of the kernel's=0Asscanf() was =
addressed (commit da99075c1d368315e1508b6143226c0d27b621e0),=0Awe can =
improve the parsing done in xen-pciback both in terms of code=0Areadability=
 and correctness (in particular properly rejecting input=0Astrings not =
well formed).=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A---=
=0A drivers/xen/xen-pciback/pci_stub.c |   83 +++++++++++++++++------------=
--------=0A 1 file changed, 39 insertions(+), 44 deletions(-)=0A=0A--- =
3.7-rc3-xen-pciback.orig/drivers/xen/xen-pciback/pci_stub.c=0A+++ =
3.7-rc3-xen-pciback/drivers/xen/xen-pciback/pci_stub.c=0A@@ -897,42 =
+897,35 @@ static struct pci_driver xen_pcibk_pci_d=0A static inline int =
str_to_slot(const char *buf, int *domain, int *bus,=0A 			   =
   int *slot, int *func)=0A {=0A-	int err;=0A-	char wc =3D =
'*';=0A+	int parsed =3D 0;=0A =0A-	err =3D sscanf(buf, " =
%x:%x:%x.%x", domain, bus, slot, func);=0A-	switch (err) {=0A+	=
switch (sscanf(buf, " %x:%x:%x.%x %n", domain, bus, slot, func,=0A+		=
       &parsed)) {=0A 	case 3:=0A 		*func =3D -1;=0A-		=
err =3D sscanf(buf, " %x:%x:%x.%c", domain, bus, slot, &wc);=0A+		=
sscanf(buf, " %x:%x:%x.* %n", domain, bus, slot, &parsed);=0A 		=
break;=0A 	case 2:=0A 		*slot =3D *func =3D -1;=0A-		=
err =3D sscanf(buf, " %x:%x:*.%c", domain, bus, &wc);=0A-		if =
(err >=3D 2)=0A-			++err;=0A+		sscanf(buf,=
 " %x:%x:*.* %n", domain, bus, &parsed);=0A 		break;=0A 	=
}=0A-	if (err =3D=3D 4 && wc =3D=3D '*')=0A+	if (parsed && !buf[parsed])=
=0A 		return 0;=0A-	else if (err < 0)=0A-		return =
-EINVAL;=0A =0A 	/* try again without domain */=0A 	*domain =
=3D 0;=0A-	wc =3D '*';=0A-	err =3D sscanf(buf, " %x:%x.%x", bus, =
slot, func);=0A-	switch (err) {=0A+	switch (sscanf(buf, " =
%x:%x.%x %n", bus, slot, func, &parsed)) {=0A 	case 2:=0A 		=
*func =3D -1;=0A-		err =3D sscanf(buf, " %x:%x.%c", bus, =
slot, &wc);=0A+		sscanf(buf, " %x:%x.* %n", bus, slot, &parsed);=0A =
		break;=0A 	case 1:=0A 		*slot =3D *func =
=3D -1;=0A-		err =3D sscanf(buf, " %x:*.%c", bus, &wc) + 1;=0A+	=
	sscanf(buf, " %x:*.* %n", bus, &parsed);=0A 		break;=0A 	=
}=0A-	if (err =3D=3D 3 && wc =3D=3D '*')=0A+	if (parsed && !buf[parsed])=
=0A 		return 0;=0A =0A 	return -EINVAL;=0A@@ -941,13 =
+934,20 @@ static inline int str_to_slot(const char=0A static inline int =
str_to_quirk(const char *buf, int *domain, int *bus, int=0A 			=
       *slot, int *func, int *reg, int *size, int *mask)=0A {=0A-	=
int err;=0A+	int parsed =3D 0;=0A+=0A+	sscanf(buf, " %4x:%2x:%2x.%=
d-%8x:%1x:%8x %n", domain, bus, slot, func,=0A+	       reg, size, mask, =
&parsed);=0A+	if (parsed && !buf[parsed])=0A+		return 0;=0A =0A-	=
err =3D=0A-	    sscanf(buf, " %04x:%02x:%02x.%d-%08x:%1x:%08x", =
domain, bus, slot,=0A-		   func, reg, size, mask);=0A-	if (err =
=3D=3D 7)=0A+	/* try again without domain */=0A+	*domain =3D 0;=0A+	=
sscanf(buf, " %2x:%2x.%d-%8x:%1x:%8x %n", bus, slot, func, reg, size,=0A+	=
       mask, &parsed);=0A+	if (parsed && !buf[parsed])=0A 		=
return 0;=0A+=0A 	return -EINVAL;=0A }=0A =0A@@ -1339,8 +1339,6 @@ =
static int __init pcistub_init(void)=0A =0A 	if (pci_devs_to_hide && =
*pci_devs_to_hide) {=0A 		do {=0A-			=
char wc =3D '*';=0A-=0A 			parsed =3D 0;=0A =0A 		=
	err =3D sscanf(pci_devs_to_hide + pos,=0A@@ -1349,51 +1347,48 @@ =
static int __init pcistub_init(void)=0A 			switch =
(err) {=0A 			case 3:=0A 				=
func =3D -1;=0A-				err =3D sscanf(pci_devs_to_=
hide + pos,=0A-					     " (%x:%x:%x.%c) =
%n",=0A-					     &domain, &bus, &slot, =
&wc,=0A-					     &parsed);=0A+		=
		sscanf(pci_devs_to_hide + pos,=0A+				=
       " (%x:%x:%x.*) %n",=0A+				       &domain, =
&bus, &slot, &parsed);=0A 				break;=0A 		=
	case 2:=0A 				slot =3D func =3D -1;=0A-	=
			err =3D sscanf(pci_devs_to_hide + pos,=0A-		=
			     " (%x:%x:*.%c) %n",=0A-				=
	     &domain, &bus, &wc, &parsed) + 1;=0A+				=
sscanf(pci_devs_to_hide + pos,=0A+				       " =
(%x:%x:*.*) %n",=0A+				       &domain, &bus, =
&parsed);=0A 				break;=0A 			=
}=0A =0A-			if (err !=3D 4 || wc !=3D '*') {=0A+		=
	if (!parsed) {=0A 				domain =3D 0;=0A-	=
			wc =3D '*';=0A 				err =3D =
sscanf(pci_devs_to_hide + pos,=0A 					   =
  " (%x:%x.%x) %n",=0A 					     &bus, &slot, =
&func, &parsed);=0A 				switch (err) {=0A 		=
		case 2:=0A 					func =3D =
-1;=0A-					err =3D sscanf(pci_devs_to_hide + =
pos,=0A-						     " (%x:%x.%c) =
%n",=0A-						     &bus, &slot, =
&wc,=0A-						     &parsed);=0A+	=
				sscanf(pci_devs_to_hide + pos,=0A+		=
			       " (%x:%x.*) %n",=0A+				=
	       &bus, &slot, &parsed);=0A 					=
break;=0A 				case 1:=0A 				=
	slot =3D func =3D -1;=0A-					=
err =3D sscanf(pci_devs_to_hide + pos,=0A-					=
	     " (%x:*.%c) %n",=0A-						=
     &bus, &wc, &parsed) + 1;=0A+					=
sscanf(pci_devs_to_hide + pos,=0A+					   =
    " (%x:*.*) %n",=0A+					       &bus, =
&parsed);=0A 					break;=0A 			=
	}=0A-				if (err !=3D 3 || wc !=3D '*')=0A-	=
				goto parse_error;=0A 			=
}=0A =0A+			if (parsed <=3D 0)=0A+				=
goto parse_error;=0A+=0A 			err =3D pcistub_device_id_a=
dd(domain, bus, slot, func);=0A 			if (err)=0A 		=
		goto out;=0A =0A-			/* if parsed<=3D0, =
we've reached the end of the string */=0A 			pos +=3D =
parsed;=0A-		} while (parsed > 0 && pci_devs_to_hide[pos]);=0A+	=
	} while (pci_devs_to_hide[pos]);=0A 	}=0A =0A 	/* If =
we're the first PCI Device Driver to register, we're the=0A
--=__Part1726D966.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.xen.org
http://lists.xen.org/xen-devel

--=__Part1726D966.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 02 14:36:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:36:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUIMN-00029g-Mf; Fri, 02 Nov 2012 14:36:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUIMM-00029S-UI
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:36:35 +0000
Received: from [85.158.143.35:39201] by server-3.bemta-4.messagelabs.com id
	B4/AC-06841-27AD3905; Fri, 02 Nov 2012 14:36:34 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1351866992!16126226!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10349 invoked from network); 2 Nov 2012 14:36:32 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-21.messagelabs.com with SMTP;
	2 Nov 2012 14:36:32 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 14:37:06 +0000
Message-Id: <5093E8A902000078000A61A7@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 14:37:13 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartF8C93689.0__="
Cc: linux-kernel@vger.kernel.org, xen-devel <xen-devel@lists.xen.org>
Subject: [Xen-devel] [PATCH 2/2] xen-pciback: reject out of range inputs
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartF8C93689.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

This add checks for out of range numbers (including in cases where the
folding of slot and function into a single value could yield false
matches).

It also removes the bogus field width restrictions in str_to_quirk() -
nowhere else in the driver this is being done, and hence this function
could reject input the equivalent of which would be happily accepted
in other places (in particular, "0x" prefixes causing the effective
width of the actual number to be either zero or less than what would be
required to cover the full range of valid values). Note that for the
moment this second part is cosmetic only, as the kernel's sscanf()
currently ignores the field widths, but a patch to overcome this is on
its way.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

---
 drivers/xen/xen-pciback/pci_stub.c |   39 +++++++++++++++++++++++++-------=
-----
 1 file changed, 27 insertions(+), 12 deletions(-)

--- 3.7-rc3-xen-pciback.orig/drivers/xen/xen-pciback/pci_stub.c
+++ 3.7-rc3-xen-pciback/drivers/xen/xen-pciback/pci_stub.c
@@ -142,7 +142,8 @@ static struct pcistub_device *pcistub_de
 		if (psdev->dev !=3D NULL
 		    && domain =3D=3D pci_domain_nr(psdev->dev->bus)
 		    && bus =3D=3D psdev->dev->bus->number
-		    && PCI_DEVFN(slot, func) =3D=3D psdev->dev->devfn) {
+		    && slot =3D=3D PCI_SLOT(psdev->dev->devfn)
+		    && func =3D=3D PCI_FUNC(psdev->dev->devfn)) {
 			pcistub_device_get(psdev);
 			goto out;
 		}
@@ -191,7 +192,8 @@ struct pci_dev *pcistub_get_pci_dev_by_s
 		if (psdev->dev !=3D NULL
 		    && domain =3D=3D pci_domain_nr(psdev->dev->bus)
 		    && bus =3D=3D psdev->dev->bus->number
-		    && PCI_DEVFN(slot, func) =3D=3D psdev->dev->devfn) {
+		    && slot =3D=3D PCI_SLOT(psdev->dev->devfn)
+		    && func =3D=3D PCI_FUNC(psdev->dev->devfn)) {
 			found_dev =3D pcistub_device_get_pci_dev(pdev, =
psdev);
 			break;
 		}
@@ -936,14 +938,14 @@ static inline int str_to_quirk(const cha
 {
 	int parsed =3D 0;
=20
-	sscanf(buf, " %4x:%2x:%2x.%d-%8x:%1x:%8x %n", domain, bus, slot, =
func,
+	sscanf(buf, " %x:%x:%x.%x-%x:%x:%x %n", domain, bus, slot, func,
 	       reg, size, mask, &parsed);
 	if (parsed && !buf[parsed])
 		return 0;
=20
 	/* try again without domain */
 	*domain =3D 0;
-	sscanf(buf, " %2x:%2x.%d-%8x:%1x:%8x %n", bus, slot, func, reg, =
size,
+	sscanf(buf, " %x:%x.%x-%x:%x:%x %n", bus, slot, func, reg, size,
 	       mask, &parsed);
 	if (parsed && !buf[parsed])
 		return 0;
@@ -955,7 +957,7 @@ static int pcistub_device_id_add(int dom
 {
 	struct pcistub_device_id *pci_dev_id;
 	unsigned long flags;
-	int rc =3D 0;
+	int rc =3D 0, devfn =3D PCI_DEVFN(slot, func);
=20
 	if (slot < 0) {
 		for (slot =3D 0; !rc && slot < 32; ++slot)
@@ -969,13 +971,24 @@ static int pcistub_device_id_add(int dom
 		return rc;
 	}
=20
+	if ((
+#if !defined(MODULE) /* pci_domains_supported is not being exported */ \
+    || !defined(CONFIG_PCI_DOMAINS)
+	     !pci_domains_supported ? domain :
+#endif
+	     domain < 0 || domain > 0xffff)
+	    || bus < 0 || bus > 0xff
+	    || PCI_SLOT(devfn) !=3D slot
+	    || PCI_FUNC(devfn) !=3D func)
+		return -EINVAL;
+
 	pci_dev_id =3D kmalloc(sizeof(*pci_dev_id), GFP_KERNEL);
 	if (!pci_dev_id)
 		return -ENOMEM;
=20
 	pci_dev_id->domain =3D domain;
 	pci_dev_id->bus =3D bus;
-	pci_dev_id->devfn =3D PCI_DEVFN(slot, func);
+	pci_dev_id->devfn =3D devfn;
=20
 	pr_debug(DRV_NAME ": wants to seize %04x:%02x:%02x.%d\n",
 		 domain, bus, slot, func);
@@ -1016,14 +1029,18 @@ static int pcistub_device_id_remove(int
 	return err;
 }
=20
-static int pcistub_reg_add(int domain, int bus, int slot, int func, int =
reg,
-			   int size, int mask)
+static int pcistub_reg_add(int domain, int bus, int slot, int func,
+			   unsigned int reg, unsigned int size,
+			   unsigned int mask)
 {
 	int err =3D 0;
 	struct pcistub_device *psdev;
 	struct pci_dev *dev;
 	struct config_field *field;
=20
+	if (reg > 0xfff || (size < 4 && (mask >> (size * 8))))
+		return -EINVAL;
+
 	psdev =3D pcistub_device_find(domain, bus, slot, func);
 	if (!psdev) {
 		err =3D -ENODEV;
@@ -1254,13 +1271,11 @@ static ssize_t permissive_add(struct dev
 	int err;
 	struct pcistub_device *psdev;
 	struct xen_pcibk_dev_data *dev_data;
+
 	err =3D str_to_slot(buf, &domain, &bus, &slot, &func);
 	if (err)
 		goto out;
-	if (slot < 0 || func < 0) {
-		err =3D -EINVAL;
-		goto out;
-	}
+
 	psdev =3D pcistub_device_find(domain, bus, slot, func);
 	if (!psdev) {
 		err =3D -ENODEV;



--=__PartF8C93689.0__=
Content-Type: text/plain; name="linux-3.7-rc3-xen-pciback-strict.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="linux-3.7-rc3-xen-pciback-strict.patch"

xen-pciback: reject out of range inputs=0A=0AThis add checks for out of =
range numbers (including in cases where the=0Afolding of slot and function =
into a single value could yield false=0Amatches).=0A=0AIt also removes the =
bogus field width restrictions in str_to_quirk() -=0Anowhere else in the =
driver this is being done, and hence this function=0Acould reject input =
the equivalent of which would be happily accepted=0Ain other places (in =
particular, "0x" prefixes causing the effective=0Awidth of the actual =
number to be either zero or less than what would be=0Arequired to cover =
the full range of valid values). Note that for the=0Amoment this second =
part is cosmetic only, as the kernel's sscanf()=0Acurrently ignores the =
field widths, but a patch to overcome this is on=0Aits way.=0A=0ASigned-off=
-by: Jan Beulich <jbeulich@suse.com>=0A=0A---=0A drivers/xen/xen-pciback/pc=
i_stub.c |   39 +++++++++++++++++++++++++------------=0A 1 file changed, =
27 insertions(+), 12 deletions(-)=0A=0A--- 3.7-rc3-xen-pciback.orig/drivers=
/xen/xen-pciback/pci_stub.c=0A+++ 3.7-rc3-xen-pciback/drivers/xen/xen-pciba=
ck/pci_stub.c=0A@@ -142,7 +142,8 @@ static struct pcistub_device *pcistub_d=
e=0A 		if (psdev->dev !=3D NULL=0A 		    && domain =
=3D=3D pci_domain_nr(psdev->dev->bus)=0A 		    && bus =3D=3D =
psdev->dev->bus->number=0A-		    && PCI_DEVFN(slot, func) =
=3D=3D psdev->dev->devfn) {=0A+		    && slot =3D=3D PCI_SLOT(psdev->=
dev->devfn)=0A+		    && func =3D=3D PCI_FUNC(psdev->dev->devfn)) =
{=0A 			pcistub_device_get(psdev);=0A 			=
goto out;=0A 		}=0A@@ -191,7 +192,8 @@ struct pci_dev *pcistub_get=
_pci_dev_by_s=0A 		if (psdev->dev !=3D NULL=0A 		   =
 && domain =3D=3D pci_domain_nr(psdev->dev->bus)=0A 		    && bus =
=3D=3D psdev->dev->bus->number=0A-		    && PCI_DEVFN(slot, =
func) =3D=3D psdev->dev->devfn) {=0A+		    && slot =3D=3D =
PCI_SLOT(psdev->dev->devfn)=0A+		    && func =3D=3D PCI_FUNC(psdev->=
dev->devfn)) {=0A 			found_dev =3D pcistub_device_get_pc=
i_dev(pdev, psdev);=0A 			break;=0A 		}=0A@@ =
-936,14 +938,14 @@ static inline int str_to_quirk(const cha=0A {=0A 	=
int parsed =3D 0;=0A =0A-	sscanf(buf, " %4x:%2x:%2x.%d-%8x:%1x:%8x =
%n", domain, bus, slot, func,=0A+	sscanf(buf, " %x:%x:%x.%x-%x:%x:%x =
%n", domain, bus, slot, func,=0A 	       reg, size, mask, =
&parsed);=0A 	if (parsed && !buf[parsed])=0A 		return 0;=0A =0A 	=
/* try again without domain */=0A 	*domain =3D 0;=0A-	sscanf(buf,=
 " %2x:%2x.%d-%8x:%1x:%8x %n", bus, slot, func, reg, size,=0A+	sscanf(buf,=
 " %x:%x.%x-%x:%x:%x %n", bus, slot, func, reg, size,=0A 	       =
mask, &parsed);=0A 	if (parsed && !buf[parsed])=0A 		return =
0;=0A@@ -955,7 +957,7 @@ static int pcistub_device_id_add(int dom=0A {=0A 	=
struct pcistub_device_id *pci_dev_id;=0A 	unsigned long flags;=0A-	=
int rc =3D 0;=0A+	int rc =3D 0, devfn =3D PCI_DEVFN(slot, func);=0A =
=0A 	if (slot < 0) {=0A 		for (slot =3D 0; !rc && slot < 32; =
++slot)=0A@@ -969,13 +971,24 @@ static int pcistub_device_id_add(int =
dom=0A 		return rc;=0A 	}=0A =0A+	if ((=0A+#if !defined(MODUL=
E) /* pci_domains_supported is not being exported */ \=0A+    || !defined(C=
ONFIG_PCI_DOMAINS)=0A+	     !pci_domains_supported ? domain :=0A+#endif=0A=
+	     domain < 0 || domain > 0xffff)=0A+	    || bus < 0 || bus > =
0xff=0A+	    || PCI_SLOT(devfn) !=3D slot=0A+	    || PCI_FUNC(dev=
fn) !=3D func)=0A+		return -EINVAL;=0A+=0A 	pci_dev_id =3D =
kmalloc(sizeof(*pci_dev_id), GFP_KERNEL);=0A 	if (!pci_dev_id)=0A 		=
return -ENOMEM;=0A =0A 	pci_dev_id->domain =3D domain;=0A 	pci_dev_id-=
>bus =3D bus;=0A-	pci_dev_id->devfn =3D PCI_DEVFN(slot, func);=0A+	=
pci_dev_id->devfn =3D devfn;=0A =0A 	pr_debug(DRV_NAME ": wants to =
seize %04x:%02x:%02x.%d\n",=0A 		 domain, bus, slot, func);=0A@@ =
-1016,14 +1029,18 @@ static int pcistub_device_id_remove(int=0A 	=
return err;=0A }=0A =0A-static int pcistub_reg_add(int domain, int bus, =
int slot, int func, int reg,=0A-			   int size, int =
mask)=0A+static int pcistub_reg_add(int domain, int bus, int slot, int =
func,=0A+			   unsigned int reg, unsigned int =
size,=0A+			   unsigned int mask)=0A {=0A 	int err =
=3D 0;=0A 	struct pcistub_device *psdev;=0A 	struct pci_dev =
*dev;=0A 	struct config_field *field;=0A =0A+	if (reg > 0xfff || =
(size < 4 && (mask >> (size * 8))))=0A+		return -EINVAL;=0A+=0A 	=
psdev =3D pcistub_device_find(domain, bus, slot, func);=0A 	if =
(!psdev) {=0A 		err =3D -ENODEV;=0A@@ -1254,13 +1271,11 @@ static =
ssize_t permissive_add(struct dev=0A 	int err;=0A 	struct pcistub_devi=
ce *psdev;=0A 	struct xen_pcibk_dev_data *dev_data;=0A+=0A 	err =3D =
str_to_slot(buf, &domain, &bus, &slot, &func);=0A 	if (err)=0A 		=
goto out;=0A-	if (slot < 0 || func < 0) {=0A-		err =3D -EINVAL;=0A=
-		goto out;=0A-	}=0A+=0A 	psdev =3D pcistub_device_fi=
nd(domain, bus, slot, func);=0A 	if (!psdev) {=0A 		=
err =3D -ENODEV;=0A
--=__PartF8C93689.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.xen.org
http://lists.xen.org/xen-devel

--=__PartF8C93689.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 02 14:36:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:36:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUIMN-00029g-Mf; Fri, 02 Nov 2012 14:36:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUIMM-00029S-UI
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:36:35 +0000
Received: from [85.158.143.35:39201] by server-3.bemta-4.messagelabs.com id
	B4/AC-06841-27AD3905; Fri, 02 Nov 2012 14:36:34 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1351866992!16126226!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10349 invoked from network); 2 Nov 2012 14:36:32 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-21.messagelabs.com with SMTP;
	2 Nov 2012 14:36:32 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 14:37:06 +0000
Message-Id: <5093E8A902000078000A61A7@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 14:37:13 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartF8C93689.0__="
Cc: linux-kernel@vger.kernel.org, xen-devel <xen-devel@lists.xen.org>
Subject: [Xen-devel] [PATCH 2/2] xen-pciback: reject out of range inputs
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartF8C93689.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

This add checks for out of range numbers (including in cases where the
folding of slot and function into a single value could yield false
matches).

It also removes the bogus field width restrictions in str_to_quirk() -
nowhere else in the driver this is being done, and hence this function
could reject input the equivalent of which would be happily accepted
in other places (in particular, "0x" prefixes causing the effective
width of the actual number to be either zero or less than what would be
required to cover the full range of valid values). Note that for the
moment this second part is cosmetic only, as the kernel's sscanf()
currently ignores the field widths, but a patch to overcome this is on
its way.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

---
 drivers/xen/xen-pciback/pci_stub.c |   39 +++++++++++++++++++++++++-------=
-----
 1 file changed, 27 insertions(+), 12 deletions(-)

--- 3.7-rc3-xen-pciback.orig/drivers/xen/xen-pciback/pci_stub.c
+++ 3.7-rc3-xen-pciback/drivers/xen/xen-pciback/pci_stub.c
@@ -142,7 +142,8 @@ static struct pcistub_device *pcistub_de
 		if (psdev->dev !=3D NULL
 		    && domain =3D=3D pci_domain_nr(psdev->dev->bus)
 		    && bus =3D=3D psdev->dev->bus->number
-		    && PCI_DEVFN(slot, func) =3D=3D psdev->dev->devfn) {
+		    && slot =3D=3D PCI_SLOT(psdev->dev->devfn)
+		    && func =3D=3D PCI_FUNC(psdev->dev->devfn)) {
 			pcistub_device_get(psdev);
 			goto out;
 		}
@@ -191,7 +192,8 @@ struct pci_dev *pcistub_get_pci_dev_by_s
 		if (psdev->dev !=3D NULL
 		    && domain =3D=3D pci_domain_nr(psdev->dev->bus)
 		    && bus =3D=3D psdev->dev->bus->number
-		    && PCI_DEVFN(slot, func) =3D=3D psdev->dev->devfn) {
+		    && slot =3D=3D PCI_SLOT(psdev->dev->devfn)
+		    && func =3D=3D PCI_FUNC(psdev->dev->devfn)) {
 			found_dev =3D pcistub_device_get_pci_dev(pdev, =
psdev);
 			break;
 		}
@@ -936,14 +938,14 @@ static inline int str_to_quirk(const cha
 {
 	int parsed =3D 0;
=20
-	sscanf(buf, " %4x:%2x:%2x.%d-%8x:%1x:%8x %n", domain, bus, slot, =
func,
+	sscanf(buf, " %x:%x:%x.%x-%x:%x:%x %n", domain, bus, slot, func,
 	       reg, size, mask, &parsed);
 	if (parsed && !buf[parsed])
 		return 0;
=20
 	/* try again without domain */
 	*domain =3D 0;
-	sscanf(buf, " %2x:%2x.%d-%8x:%1x:%8x %n", bus, slot, func, reg, =
size,
+	sscanf(buf, " %x:%x.%x-%x:%x:%x %n", bus, slot, func, reg, size,
 	       mask, &parsed);
 	if (parsed && !buf[parsed])
 		return 0;
@@ -955,7 +957,7 @@ static int pcistub_device_id_add(int dom
 {
 	struct pcistub_device_id *pci_dev_id;
 	unsigned long flags;
-	int rc =3D 0;
+	int rc =3D 0, devfn =3D PCI_DEVFN(slot, func);
=20
 	if (slot < 0) {
 		for (slot =3D 0; !rc && slot < 32; ++slot)
@@ -969,13 +971,24 @@ static int pcistub_device_id_add(int dom
 		return rc;
 	}
=20
+	if ((
+#if !defined(MODULE) /* pci_domains_supported is not being exported */ \
+    || !defined(CONFIG_PCI_DOMAINS)
+	     !pci_domains_supported ? domain :
+#endif
+	     domain < 0 || domain > 0xffff)
+	    || bus < 0 || bus > 0xff
+	    || PCI_SLOT(devfn) !=3D slot
+	    || PCI_FUNC(devfn) !=3D func)
+		return -EINVAL;
+
 	pci_dev_id =3D kmalloc(sizeof(*pci_dev_id), GFP_KERNEL);
 	if (!pci_dev_id)
 		return -ENOMEM;
=20
 	pci_dev_id->domain =3D domain;
 	pci_dev_id->bus =3D bus;
-	pci_dev_id->devfn =3D PCI_DEVFN(slot, func);
+	pci_dev_id->devfn =3D devfn;
=20
 	pr_debug(DRV_NAME ": wants to seize %04x:%02x:%02x.%d\n",
 		 domain, bus, slot, func);
@@ -1016,14 +1029,18 @@ static int pcistub_device_id_remove(int
 	return err;
 }
=20
-static int pcistub_reg_add(int domain, int bus, int slot, int func, int =
reg,
-			   int size, int mask)
+static int pcistub_reg_add(int domain, int bus, int slot, int func,
+			   unsigned int reg, unsigned int size,
+			   unsigned int mask)
 {
 	int err =3D 0;
 	struct pcistub_device *psdev;
 	struct pci_dev *dev;
 	struct config_field *field;
=20
+	if (reg > 0xfff || (size < 4 && (mask >> (size * 8))))
+		return -EINVAL;
+
 	psdev =3D pcistub_device_find(domain, bus, slot, func);
 	if (!psdev) {
 		err =3D -ENODEV;
@@ -1254,13 +1271,11 @@ static ssize_t permissive_add(struct dev
 	int err;
 	struct pcistub_device *psdev;
 	struct xen_pcibk_dev_data *dev_data;
+
 	err =3D str_to_slot(buf, &domain, &bus, &slot, &func);
 	if (err)
 		goto out;
-	if (slot < 0 || func < 0) {
-		err =3D -EINVAL;
-		goto out;
-	}
+
 	psdev =3D pcistub_device_find(domain, bus, slot, func);
 	if (!psdev) {
 		err =3D -ENODEV;



--=__PartF8C93689.0__=
Content-Type: text/plain; name="linux-3.7-rc3-xen-pciback-strict.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="linux-3.7-rc3-xen-pciback-strict.patch"

xen-pciback: reject out of range inputs=0A=0AThis add checks for out of =
range numbers (including in cases where the=0Afolding of slot and function =
into a single value could yield false=0Amatches).=0A=0AIt also removes the =
bogus field width restrictions in str_to_quirk() -=0Anowhere else in the =
driver this is being done, and hence this function=0Acould reject input =
the equivalent of which would be happily accepted=0Ain other places (in =
particular, "0x" prefixes causing the effective=0Awidth of the actual =
number to be either zero or less than what would be=0Arequired to cover =
the full range of valid values). Note that for the=0Amoment this second =
part is cosmetic only, as the kernel's sscanf()=0Acurrently ignores the =
field widths, but a patch to overcome this is on=0Aits way.=0A=0ASigned-off=
-by: Jan Beulich <jbeulich@suse.com>=0A=0A---=0A drivers/xen/xen-pciback/pc=
i_stub.c |   39 +++++++++++++++++++++++++------------=0A 1 file changed, =
27 insertions(+), 12 deletions(-)=0A=0A--- 3.7-rc3-xen-pciback.orig/drivers=
/xen/xen-pciback/pci_stub.c=0A+++ 3.7-rc3-xen-pciback/drivers/xen/xen-pciba=
ck/pci_stub.c=0A@@ -142,7 +142,8 @@ static struct pcistub_device *pcistub_d=
e=0A 		if (psdev->dev !=3D NULL=0A 		    && domain =
=3D=3D pci_domain_nr(psdev->dev->bus)=0A 		    && bus =3D=3D =
psdev->dev->bus->number=0A-		    && PCI_DEVFN(slot, func) =
=3D=3D psdev->dev->devfn) {=0A+		    && slot =3D=3D PCI_SLOT(psdev->=
dev->devfn)=0A+		    && func =3D=3D PCI_FUNC(psdev->dev->devfn)) =
{=0A 			pcistub_device_get(psdev);=0A 			=
goto out;=0A 		}=0A@@ -191,7 +192,8 @@ struct pci_dev *pcistub_get=
_pci_dev_by_s=0A 		if (psdev->dev !=3D NULL=0A 		   =
 && domain =3D=3D pci_domain_nr(psdev->dev->bus)=0A 		    && bus =
=3D=3D psdev->dev->bus->number=0A-		    && PCI_DEVFN(slot, =
func) =3D=3D psdev->dev->devfn) {=0A+		    && slot =3D=3D =
PCI_SLOT(psdev->dev->devfn)=0A+		    && func =3D=3D PCI_FUNC(psdev->=
dev->devfn)) {=0A 			found_dev =3D pcistub_device_get_pc=
i_dev(pdev, psdev);=0A 			break;=0A 		}=0A@@ =
-936,14 +938,14 @@ static inline int str_to_quirk(const cha=0A {=0A 	=
int parsed =3D 0;=0A =0A-	sscanf(buf, " %4x:%2x:%2x.%d-%8x:%1x:%8x =
%n", domain, bus, slot, func,=0A+	sscanf(buf, " %x:%x:%x.%x-%x:%x:%x =
%n", domain, bus, slot, func,=0A 	       reg, size, mask, =
&parsed);=0A 	if (parsed && !buf[parsed])=0A 		return 0;=0A =0A 	=
/* try again without domain */=0A 	*domain =3D 0;=0A-	sscanf(buf,=
 " %2x:%2x.%d-%8x:%1x:%8x %n", bus, slot, func, reg, size,=0A+	sscanf(buf,=
 " %x:%x.%x-%x:%x:%x %n", bus, slot, func, reg, size,=0A 	       =
mask, &parsed);=0A 	if (parsed && !buf[parsed])=0A 		return =
0;=0A@@ -955,7 +957,7 @@ static int pcistub_device_id_add(int dom=0A {=0A 	=
struct pcistub_device_id *pci_dev_id;=0A 	unsigned long flags;=0A-	=
int rc =3D 0;=0A+	int rc =3D 0, devfn =3D PCI_DEVFN(slot, func);=0A =
=0A 	if (slot < 0) {=0A 		for (slot =3D 0; !rc && slot < 32; =
++slot)=0A@@ -969,13 +971,24 @@ static int pcistub_device_id_add(int =
dom=0A 		return rc;=0A 	}=0A =0A+	if ((=0A+#if !defined(MODUL=
E) /* pci_domains_supported is not being exported */ \=0A+    || !defined(C=
ONFIG_PCI_DOMAINS)=0A+	     !pci_domains_supported ? domain :=0A+#endif=0A=
+	     domain < 0 || domain > 0xffff)=0A+	    || bus < 0 || bus > =
0xff=0A+	    || PCI_SLOT(devfn) !=3D slot=0A+	    || PCI_FUNC(dev=
fn) !=3D func)=0A+		return -EINVAL;=0A+=0A 	pci_dev_id =3D =
kmalloc(sizeof(*pci_dev_id), GFP_KERNEL);=0A 	if (!pci_dev_id)=0A 		=
return -ENOMEM;=0A =0A 	pci_dev_id->domain =3D domain;=0A 	pci_dev_id-=
>bus =3D bus;=0A-	pci_dev_id->devfn =3D PCI_DEVFN(slot, func);=0A+	=
pci_dev_id->devfn =3D devfn;=0A =0A 	pr_debug(DRV_NAME ": wants to =
seize %04x:%02x:%02x.%d\n",=0A 		 domain, bus, slot, func);=0A@@ =
-1016,14 +1029,18 @@ static int pcistub_device_id_remove(int=0A 	=
return err;=0A }=0A =0A-static int pcistub_reg_add(int domain, int bus, =
int slot, int func, int reg,=0A-			   int size, int =
mask)=0A+static int pcistub_reg_add(int domain, int bus, int slot, int =
func,=0A+			   unsigned int reg, unsigned int =
size,=0A+			   unsigned int mask)=0A {=0A 	int err =
=3D 0;=0A 	struct pcistub_device *psdev;=0A 	struct pci_dev =
*dev;=0A 	struct config_field *field;=0A =0A+	if (reg > 0xfff || =
(size < 4 && (mask >> (size * 8))))=0A+		return -EINVAL;=0A+=0A 	=
psdev =3D pcistub_device_find(domain, bus, slot, func);=0A 	if =
(!psdev) {=0A 		err =3D -ENODEV;=0A@@ -1254,13 +1271,11 @@ static =
ssize_t permissive_add(struct dev=0A 	int err;=0A 	struct pcistub_devi=
ce *psdev;=0A 	struct xen_pcibk_dev_data *dev_data;=0A+=0A 	err =3D =
str_to_slot(buf, &domain, &bus, &slot, &func);=0A 	if (err)=0A 		=
goto out;=0A-	if (slot < 0 || func < 0) {=0A-		err =3D -EINVAL;=0A=
-		goto out;=0A-	}=0A+=0A 	psdev =3D pcistub_device_fi=
nd(domain, bus, slot, func);=0A 	if (!psdev) {=0A 		=
err =3D -ENODEV;=0A
--=__PartF8C93689.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.xen.org
http://lists.xen.org/xen-devel

--=__PartF8C93689.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 02 14:50:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:50:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUIa3-0002j2-44; Fri, 02 Nov 2012 14:50:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TUIa2-0002is-6b
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:50:42 +0000
Received: from [85.158.143.99:62262] by server-1.bemta-4.messagelabs.com id
	20/64-27934-1CDD3905; Fri, 02 Nov 2012 14:50:41 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1351867840!28064051!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4791 invoked from network); 2 Nov 2012 14:50:40 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 14:50:40 -0000
Received: by mail-wi0-f173.google.com with SMTP id hm4so1130104wib.14
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 07:50:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=dVzSHeue3Bv+16lHRVDPg65OuGKzMBoOLeo9DUjS/Jc=;
	b=T8+RY20mFhCAqry7NOPJOlSBNtb2oJPYEpn8sLELFko7rHk2FxCeUMOeNgm98Z0TM4
	NNrPTu+kUlbaqtIJA0lF3r/Ir1GrehNxGVWl+12di4Q0ipUpt83ZLq7BTmqYAEWYQeCp
	6f9KavEHU3fSj6z66+f4S4H4ssxWCSv5HXvm/MUNcCFsoyHUJNBDYs2ZtvQIpvCBsG+S
	zJP4wQtnWDF64wU0JNA4/rqHr9fmUtzx2Zcd6uEz/EGFqtB4f7ZarIUr4j7p6pm2y9p/
	o5Fd+l4ghviIK2oaYTZRmQeoOCqlGsjLqfvVUeS5Hji4ulLDNVLdUJNx7ZI4f5K7V3Iq
	60sQ==
Received: by 10.180.80.100 with SMTP id q4mr2918534wix.20.1351867840186;
	Fri, 02 Nov 2012 07:50:40 -0700 (PDT)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id fp6sm2584386wib.0.2012.11.02.07.50.38
	(version=SSLv3 cipher=OTHER); Fri, 02 Nov 2012 07:50:39 -0700 (PDT)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Fri, 02 Nov 2012 14:50:35 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCB98E3B.50ED5%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] x86/mwait-idle: enable Ivy Bridge Xeon
	support
Thread-Index: Ac25CWog19FmwZx9BUCCnuwylJJSCg==
In-Reply-To: <5093D51B02000078000A607C@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] x86/mwait-idle: enable Ivy Bridge Xeon
 support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 02/11/2012 13:13, "Jan Beulich" <JBeulich@suse.com> wrote:

> Matching a similar change in Linux 3.7-rc.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/arch/x86/cpu/mwait-idle.c
> +++ b/xen/arch/x86/cpu/mwait-idle.c
> @@ -365,6 +365,7 @@ static struct intel_idle_id {
> ICPU(0x2a, snb),
> ICPU(0x2d, snb),
> ICPU(0x3a, ivb),
> + ICPU(0x3e, ivb),
> {}
>  };
>  
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:50:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:50:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUIa3-0002j2-44; Fri, 02 Nov 2012 14:50:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TUIa2-0002is-6b
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:50:42 +0000
Received: from [85.158.143.99:62262] by server-1.bemta-4.messagelabs.com id
	20/64-27934-1CDD3905; Fri, 02 Nov 2012 14:50:41 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1351867840!28064051!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4791 invoked from network); 2 Nov 2012 14:50:40 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 14:50:40 -0000
Received: by mail-wi0-f173.google.com with SMTP id hm4so1130104wib.14
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 07:50:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=dVzSHeue3Bv+16lHRVDPg65OuGKzMBoOLeo9DUjS/Jc=;
	b=T8+RY20mFhCAqry7NOPJOlSBNtb2oJPYEpn8sLELFko7rHk2FxCeUMOeNgm98Z0TM4
	NNrPTu+kUlbaqtIJA0lF3r/Ir1GrehNxGVWl+12di4Q0ipUpt83ZLq7BTmqYAEWYQeCp
	6f9KavEHU3fSj6z66+f4S4H4ssxWCSv5HXvm/MUNcCFsoyHUJNBDYs2ZtvQIpvCBsG+S
	zJP4wQtnWDF64wU0JNA4/rqHr9fmUtzx2Zcd6uEz/EGFqtB4f7ZarIUr4j7p6pm2y9p/
	o5Fd+l4ghviIK2oaYTZRmQeoOCqlGsjLqfvVUeS5Hji4ulLDNVLdUJNx7ZI4f5K7V3Iq
	60sQ==
Received: by 10.180.80.100 with SMTP id q4mr2918534wix.20.1351867840186;
	Fri, 02 Nov 2012 07:50:40 -0700 (PDT)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id fp6sm2584386wib.0.2012.11.02.07.50.38
	(version=SSLv3 cipher=OTHER); Fri, 02 Nov 2012 07:50:39 -0700 (PDT)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Fri, 02 Nov 2012 14:50:35 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCB98E3B.50ED5%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] x86/mwait-idle: enable Ivy Bridge Xeon
	support
Thread-Index: Ac25CWog19FmwZx9BUCCnuwylJJSCg==
In-Reply-To: <5093D51B02000078000A607C@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] x86/mwait-idle: enable Ivy Bridge Xeon
 support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 02/11/2012 13:13, "Jan Beulich" <JBeulich@suse.com> wrote:

> Matching a similar change in Linux 3.7-rc.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/arch/x86/cpu/mwait-idle.c
> +++ b/xen/arch/x86/cpu/mwait-idle.c
> @@ -365,6 +365,7 @@ static struct intel_idle_id {
> ICPU(0x2a, snb),
> ICPU(0x2d, snb),
> ICPU(0x3a, ivb),
> + ICPU(0x3e, ivb),
> {}
>  };
>  
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:50:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:50:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUIa3-0002j9-Fb; Fri, 02 Nov 2012 14:50:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TUIa2-0002it-Ad
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:50:42 +0000
Received: from [85.158.143.99:62261] by server-2.bemta-4.messagelabs.com id
	99/82-28922-1CDD3905; Fri, 02 Nov 2012 14:50:41 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1351867837!23079094!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 377 invoked from network); 2 Nov 2012 14:50:40 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 14:50:40 -0000
Received: by mail-wi0-f173.google.com with SMTP id hm4so1130064wib.14
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 07:50:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=WZAxIENOpzFzAVnsRCNFwXucWshl0Y71rzHDlekyE14=;
	b=1C899zk/9HgoubRv+0TPHzy9FDp87VHvR3xQjldvGjZtTuU2UaJbbqkiO4v7vABUdy
	my75/WVQgTOc6Q+BQ0CAhgFxMlccqunfZRqVwDu/N5pLVJjng63sZJd4tmt3RW+S/XWT
	4e7i8tQNtRUqGHdSQBAOmfV9pdshbLNqsiBxF3TK3KkQPJ9MgfcfqO5hZN1C9sqT174l
	EEOfPr7YU3sTdggRjrBzwqIa5HeCtK6T0Kmz1tEzSw5J8ovhzhzBwMXU1yft56yMuedR
	dyvN8QUUqWrjnD9KWe/JY7n/y16ed0tTilWPFmYjB4dkW6rkPhLWpnVqHSia8lHHaDi+
	aBLw==
Received: by 10.180.94.169 with SMTP id dd9mr1946728wib.14.1351867837045;
	Fri, 02 Nov 2012 07:50:37 -0700 (PDT)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id fp6sm2584386wib.0.2012.11.02.07.50.33
	(version=SSLv3 cipher=OTHER); Fri, 02 Nov 2012 07:50:36 -0700 (PDT)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Fri, 02 Nov 2012 14:50:23 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCB98E2F.50ED4%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] ACPI/cpuidle: remove unused "power" field
	from Cx state data
Thread-Index: Ac25CWL5wab22k7IE0GeFnEPr1FkBA==
In-Reply-To: <5093D4B502000078000A606E@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] ACPI/cpuidle: remove unused "power" field
 from Cx state data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 02/11/2012 13:12, "Jan Beulich" <JBeulich@suse.com> wrote:

> It has never been used for anything, and Linux 3.7 doesn't propagate
> this information anymore.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> ---
> Konrad, on the pv-ops side it may be better to pass zero rather than
> leaving the field completely uninitialized.
> 
> --- a/xen/arch/x86/acpi/cpu_idle.c
> +++ b/xen/arch/x86/acpi/cpu_idle.c
> @@ -935,7 +935,6 @@ static void set_cx(
>      }
>  
>      cx->latency  = xen_cx->latency;
> -    cx->power    = xen_cx->power;
>      
>      cx->target_residency = cx->latency * latency_factor;
>      if ( cx->type == ACPI_STATE_C1 || cx->type == ACPI_STATE_C2 )
> --- a/xen/arch/x86/cpu/mwait-idle.c
> +++ b/xen/arch/x86/cpu/mwait-idle.c
> @@ -96,7 +96,6 @@ static const struct cpuidle_state {
> char  name[16];
> unsigned int flags;
> unsigned int exit_latency; /* in US */
> - int  power_usage; /* in mW */
> unsigned int target_residency; /* in US */
>  } *cpuidle_state_table;
>  
> @@ -479,7 +478,6 @@ static int mwait_idle_cpu_init(struct no
> cx->type = cstate;
> cx->address = get_driver_data(cstate);
> cx->entry_method = ACPI_CSTATE_EM_FFH;
> -  cx->power = cpuidle_state_table[cstate].power_usage;
> cx->latency = cpuidle_state_table[cstate].exit_latency;
> cx->target_residency =
> cpuidle_state_table[cstate].target_residency;
> --- a/xen/include/xen/cpuidle.h
> +++ b/xen/include/xen/cpuidle.h
> @@ -46,7 +46,6 @@ struct acpi_processor_cx
>      u32 address;
>      u32 latency;
>      u32 target_residency;
> -    u32 power;
>      u32 usage;
>      u64 time;
>  };
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 14:50:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 14:50:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUIa3-0002j9-Fb; Fri, 02 Nov 2012 14:50:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TUIa2-0002it-Ad
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 14:50:42 +0000
Received: from [85.158.143.99:62261] by server-2.bemta-4.messagelabs.com id
	99/82-28922-1CDD3905; Fri, 02 Nov 2012 14:50:41 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1351867837!23079094!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 377 invoked from network); 2 Nov 2012 14:50:40 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 14:50:40 -0000
Received: by mail-wi0-f173.google.com with SMTP id hm4so1130064wib.14
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 07:50:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=WZAxIENOpzFzAVnsRCNFwXucWshl0Y71rzHDlekyE14=;
	b=1C899zk/9HgoubRv+0TPHzy9FDp87VHvR3xQjldvGjZtTuU2UaJbbqkiO4v7vABUdy
	my75/WVQgTOc6Q+BQ0CAhgFxMlccqunfZRqVwDu/N5pLVJjng63sZJd4tmt3RW+S/XWT
	4e7i8tQNtRUqGHdSQBAOmfV9pdshbLNqsiBxF3TK3KkQPJ9MgfcfqO5hZN1C9sqT174l
	EEOfPr7YU3sTdggRjrBzwqIa5HeCtK6T0Kmz1tEzSw5J8ovhzhzBwMXU1yft56yMuedR
	dyvN8QUUqWrjnD9KWe/JY7n/y16ed0tTilWPFmYjB4dkW6rkPhLWpnVqHSia8lHHaDi+
	aBLw==
Received: by 10.180.94.169 with SMTP id dd9mr1946728wib.14.1351867837045;
	Fri, 02 Nov 2012 07:50:37 -0700 (PDT)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id fp6sm2584386wib.0.2012.11.02.07.50.33
	(version=SSLv3 cipher=OTHER); Fri, 02 Nov 2012 07:50:36 -0700 (PDT)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Fri, 02 Nov 2012 14:50:23 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCB98E2F.50ED4%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] ACPI/cpuidle: remove unused "power" field
	from Cx state data
Thread-Index: Ac25CWL5wab22k7IE0GeFnEPr1FkBA==
In-Reply-To: <5093D4B502000078000A606E@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] ACPI/cpuidle: remove unused "power" field
 from Cx state data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 02/11/2012 13:12, "Jan Beulich" <JBeulich@suse.com> wrote:

> It has never been used for anything, and Linux 3.7 doesn't propagate
> this information anymore.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> ---
> Konrad, on the pv-ops side it may be better to pass zero rather than
> leaving the field completely uninitialized.
> 
> --- a/xen/arch/x86/acpi/cpu_idle.c
> +++ b/xen/arch/x86/acpi/cpu_idle.c
> @@ -935,7 +935,6 @@ static void set_cx(
>      }
>  
>      cx->latency  = xen_cx->latency;
> -    cx->power    = xen_cx->power;
>      
>      cx->target_residency = cx->latency * latency_factor;
>      if ( cx->type == ACPI_STATE_C1 || cx->type == ACPI_STATE_C2 )
> --- a/xen/arch/x86/cpu/mwait-idle.c
> +++ b/xen/arch/x86/cpu/mwait-idle.c
> @@ -96,7 +96,6 @@ static const struct cpuidle_state {
> char  name[16];
> unsigned int flags;
> unsigned int exit_latency; /* in US */
> - int  power_usage; /* in mW */
> unsigned int target_residency; /* in US */
>  } *cpuidle_state_table;
>  
> @@ -479,7 +478,6 @@ static int mwait_idle_cpu_init(struct no
> cx->type = cstate;
> cx->address = get_driver_data(cstate);
> cx->entry_method = ACPI_CSTATE_EM_FFH;
> -  cx->power = cpuidle_state_table[cstate].power_usage;
> cx->latency = cpuidle_state_table[cstate].exit_latency;
> cx->target_residency =
> cpuidle_state_table[cstate].target_residency;
> --- a/xen/include/xen/cpuidle.h
> +++ b/xen/include/xen/cpuidle.h
> @@ -46,7 +46,6 @@ struct acpi_processor_cx
>      u32 address;
>      u32 latency;
>      u32 target_residency;
> -    u32 power;
>      u32 usage;
>      u64 time;
>  };
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 15:43:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 15:43:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUJPE-0004Di-Fh; Fri, 02 Nov 2012 15:43:36 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TUJPC-0004Db-NR
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 15:43:34 +0000
Received: from [193.109.254.147:16463] by server-14.bemta-14.messagelabs.com
	id 5A/86-14517-52AE3905; Fri, 02 Nov 2012 15:43:33 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1351871012!9489164!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY5ODk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28439 invoked from network); 2 Nov 2012 15:43:33 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 15:43:33 -0000
X-IronPort-AV: E=Sophos;i="4.80,699,1344211200"; d="scan'208";a="15560858"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	02 Nov 2012 15:43:12 +0000
Received: from mac.citrite.net (10.31.3.234) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Fri, 2 Nov 2012
	15:43:12 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>
Date: Fri, 2 Nov 2012 16:43:04 +0100
Message-ID: <1351870984-22078-1-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
MIME-Version: 1.0
Cc: konrad.wilk@oracle.com, linux-kernel@vger.kernel.org,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH] xen-blk: persistent-grants fixes
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch contains fixes for persistent grants implementation v2:

 * handle == 0 is a valid handle, so initialize grants in blkback
   setting the handle to BLKBACK_INVALID_HANDLE instead of 0. Reported
   by Konrad Rzeszutek Wilk.

 * new_map is a boolean, use "true" or "false" instead of 1 and 0.
   Reported by Konrad Rzeszutek Wilk.

 * blkfront announces the persistent-grants feature as
   feature-persistent-grants, use feature-persistent instead which is
   consistent with blkback and the public Xen headers.

 * Add a consistency check in blkfront to make sure we don't try to
   access segments that have not been set.

Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
Cc: <konrad.wilk@oracle.com>
Cc: <linux-kernel@vger.kernel.org>
---
 drivers/block/xen-blkback/blkback.c |   15 +++++++++------
 drivers/block/xen-blkback/xenbus.c  |    2 +-
 drivers/block/xen-blkfront.c        |    3 ++-
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index 663d42d..a059616 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -503,7 +503,7 @@ static int xen_blkbk_map(struct blkif_request *req,
 			 * We are using persistent grants and
 			 * the grant is already mapped
 			 */
-			new_map = 0;
+			new_map = false;
 		} else if (use_persistent_gnts &&
 			   blkif->persistent_gnt_c <
 			   max_mapped_grant_pages(blkif->blk_protocol)) {
@@ -511,8 +511,8 @@ static int xen_blkbk_map(struct blkif_request *req,
 			 * We are using persistent grants, the grant is
 			 * not mapped but we have room for it
 			 */
-			new_map = 1;
-			persistent_gnt = kzalloc(
+			new_map = true;
+			persistent_gnt = kmalloc(
 				sizeof(struct persistent_gnt),
 				GFP_KERNEL);
 			if (!persistent_gnt)
@@ -523,6 +523,7 @@ static int xen_blkbk_map(struct blkif_request *req,
 				return -ENOMEM;
 			}
 			persistent_gnt->gnt = req->u.rw.seg[i].gref;
+			persistent_gnt->handle = BLKBACK_INVALID_HANDLE;
 
 			pages_to_gnt[segs_to_map] =
 				persistent_gnt->page;
@@ -547,7 +548,7 @@ static int xen_blkbk_map(struct blkif_request *req,
 				pr_alert(DRV_PFX " domain %u, device %#x is using maximum number of persistent grants\n",
 					 blkif->domid, blkif->vbd.handle);
 			}
-			new_map = 1;
+			new_map = true;
 			pages[i] = blkbk->pending_page(pending_req, i);
 			addr = vaddr(pending_req, i);
 			pages_to_gnt[segs_to_map] =
@@ -584,7 +585,8 @@ static int xen_blkbk_map(struct blkif_request *req,
 	 */
 	bitmap_zero(pending_req->unmap_seg, BLKIF_MAX_SEGMENTS_PER_REQUEST);
 	for (i = 0, j = 0; i < nseg; i++) {
-		if (!persistent_gnts[i] || !persistent_gnts[i]->handle) {
+		if (!persistent_gnts[i] ||
+		    persistent_gnts[i]->handle == BLKBACK_INVALID_HANDLE) {
 			/* This is a newly mapped grant */
 			BUG_ON(j >= segs_to_map);
 			if (unlikely(map[j].status != 0)) {
@@ -601,7 +603,8 @@ static int xen_blkbk_map(struct blkif_request *req,
 			}
 		}
 		if (persistent_gnts[i]) {
-			if (!persistent_gnts[i]->handle) {
+			if (persistent_gnts[i]->handle ==
+			    BLKBACK_INVALID_HANDLE) {
 				/*
 				 * If this is a new persistent grant
 				 * save the handler
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index b225026..a03ecbb 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -760,7 +760,7 @@ static int connect_ring(struct backend_info *be)
 		return -1;
 	}
 	err = xenbus_gather(XBT_NIL, dev->otherend,
-			    "feature-persistent-grants", "%u",
+			    "feature-persistent", "%u",
 			    &pers_grants, NULL);
 	if (err)
 		pers_grants = 0;
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 911d733..f1de806 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -852,6 +852,7 @@ static void blkif_completion(struct blk_shadow *s, struct blkfront_info *info,
 		rq_for_each_segment(bvec, s->request, iter) {
 			BUG_ON((bvec->bv_offset + bvec->bv_len) > PAGE_SIZE);
 			i = offset >> PAGE_SHIFT;
+			BUG_ON(i >= s->req.u.rw.nr_segments);
 			shared_data = kmap_atomic(
 				pfn_to_page(s->grants_used[i]->pfn));
 			bvec_data = bvec_kmap_irq(bvec, &flags);
@@ -1069,7 +1070,7 @@ again:
 		goto abort_transaction;
 	}
 	err = xenbus_printf(xbt, dev->nodename,
-			    "feature-persistent-grants", "%u", 1);
+			    "feature-persistent", "%u", 1);
 	if (err)
 		dev_warn(&dev->dev,
 			 "writing persistent grants feature to xenbus");
-- 
1.7.7.5 (Apple Git-26)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 15:43:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 15:43:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUJPE-0004Di-Fh; Fri, 02 Nov 2012 15:43:36 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TUJPC-0004Db-NR
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 15:43:34 +0000
Received: from [193.109.254.147:16463] by server-14.bemta-14.messagelabs.com
	id 5A/86-14517-52AE3905; Fri, 02 Nov 2012 15:43:33 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1351871012!9489164!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY5ODk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28439 invoked from network); 2 Nov 2012 15:43:33 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 15:43:33 -0000
X-IronPort-AV: E=Sophos;i="4.80,699,1344211200"; d="scan'208";a="15560858"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	02 Nov 2012 15:43:12 +0000
Received: from mac.citrite.net (10.31.3.234) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Fri, 2 Nov 2012
	15:43:12 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>
Date: Fri, 2 Nov 2012 16:43:04 +0100
Message-ID: <1351870984-22078-1-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
MIME-Version: 1.0
Cc: konrad.wilk@oracle.com, linux-kernel@vger.kernel.org,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH] xen-blk: persistent-grants fixes
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch contains fixes for persistent grants implementation v2:

 * handle == 0 is a valid handle, so initialize grants in blkback
   setting the handle to BLKBACK_INVALID_HANDLE instead of 0. Reported
   by Konrad Rzeszutek Wilk.

 * new_map is a boolean, use "true" or "false" instead of 1 and 0.
   Reported by Konrad Rzeszutek Wilk.

 * blkfront announces the persistent-grants feature as
   feature-persistent-grants, use feature-persistent instead which is
   consistent with blkback and the public Xen headers.

 * Add a consistency check in blkfront to make sure we don't try to
   access segments that have not been set.

Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
Cc: <konrad.wilk@oracle.com>
Cc: <linux-kernel@vger.kernel.org>
---
 drivers/block/xen-blkback/blkback.c |   15 +++++++++------
 drivers/block/xen-blkback/xenbus.c  |    2 +-
 drivers/block/xen-blkfront.c        |    3 ++-
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index 663d42d..a059616 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -503,7 +503,7 @@ static int xen_blkbk_map(struct blkif_request *req,
 			 * We are using persistent grants and
 			 * the grant is already mapped
 			 */
-			new_map = 0;
+			new_map = false;
 		} else if (use_persistent_gnts &&
 			   blkif->persistent_gnt_c <
 			   max_mapped_grant_pages(blkif->blk_protocol)) {
@@ -511,8 +511,8 @@ static int xen_blkbk_map(struct blkif_request *req,
 			 * We are using persistent grants, the grant is
 			 * not mapped but we have room for it
 			 */
-			new_map = 1;
-			persistent_gnt = kzalloc(
+			new_map = true;
+			persistent_gnt = kmalloc(
 				sizeof(struct persistent_gnt),
 				GFP_KERNEL);
 			if (!persistent_gnt)
@@ -523,6 +523,7 @@ static int xen_blkbk_map(struct blkif_request *req,
 				return -ENOMEM;
 			}
 			persistent_gnt->gnt = req->u.rw.seg[i].gref;
+			persistent_gnt->handle = BLKBACK_INVALID_HANDLE;
 
 			pages_to_gnt[segs_to_map] =
 				persistent_gnt->page;
@@ -547,7 +548,7 @@ static int xen_blkbk_map(struct blkif_request *req,
 				pr_alert(DRV_PFX " domain %u, device %#x is using maximum number of persistent grants\n",
 					 blkif->domid, blkif->vbd.handle);
 			}
-			new_map = 1;
+			new_map = true;
 			pages[i] = blkbk->pending_page(pending_req, i);
 			addr = vaddr(pending_req, i);
 			pages_to_gnt[segs_to_map] =
@@ -584,7 +585,8 @@ static int xen_blkbk_map(struct blkif_request *req,
 	 */
 	bitmap_zero(pending_req->unmap_seg, BLKIF_MAX_SEGMENTS_PER_REQUEST);
 	for (i = 0, j = 0; i < nseg; i++) {
-		if (!persistent_gnts[i] || !persistent_gnts[i]->handle) {
+		if (!persistent_gnts[i] ||
+		    persistent_gnts[i]->handle == BLKBACK_INVALID_HANDLE) {
 			/* This is a newly mapped grant */
 			BUG_ON(j >= segs_to_map);
 			if (unlikely(map[j].status != 0)) {
@@ -601,7 +603,8 @@ static int xen_blkbk_map(struct blkif_request *req,
 			}
 		}
 		if (persistent_gnts[i]) {
-			if (!persistent_gnts[i]->handle) {
+			if (persistent_gnts[i]->handle ==
+			    BLKBACK_INVALID_HANDLE) {
 				/*
 				 * If this is a new persistent grant
 				 * save the handler
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index b225026..a03ecbb 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -760,7 +760,7 @@ static int connect_ring(struct backend_info *be)
 		return -1;
 	}
 	err = xenbus_gather(XBT_NIL, dev->otherend,
-			    "feature-persistent-grants", "%u",
+			    "feature-persistent", "%u",
 			    &pers_grants, NULL);
 	if (err)
 		pers_grants = 0;
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 911d733..f1de806 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -852,6 +852,7 @@ static void blkif_completion(struct blk_shadow *s, struct blkfront_info *info,
 		rq_for_each_segment(bvec, s->request, iter) {
 			BUG_ON((bvec->bv_offset + bvec->bv_len) > PAGE_SIZE);
 			i = offset >> PAGE_SHIFT;
+			BUG_ON(i >= s->req.u.rw.nr_segments);
 			shared_data = kmap_atomic(
 				pfn_to_page(s->grants_used[i]->pfn));
 			bvec_data = bvec_kmap_irq(bvec, &flags);
@@ -1069,7 +1070,7 @@ again:
 		goto abort_transaction;
 	}
 	err = xenbus_printf(xbt, dev->nodename,
-			    "feature-persistent-grants", "%u", 1);
+			    "feature-persistent", "%u", 1);
 	if (err)
 		dev_warn(&dev->dev,
 			 "writing persistent grants feature to xenbus");
-- 
1.7.7.5 (Apple Git-26)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 16:19:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 16:19:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUJxr-0005Lv-DV; Fri, 02 Nov 2012 16:19:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUJxp-0005LP-GB
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 16:19:21 +0000
Received: from [85.158.137.99:65474] by server-3.bemta-3.messagelabs.com id
	41/C2-31566-882F3905; Fri, 02 Nov 2012 16:19:20 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1351873157!12147205!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10748 invoked from network); 2 Nov 2012 16:19:20 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-217.messagelabs.com with SMTP;
	2 Nov 2012 16:19:20 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 16:19:15 +0000
Message-Id: <509400BD02000078000A6258@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 16:19:57 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ronny Hegewald" <ronny.hegewald@online.de>
Mime-Version: 1.0
Content-Disposition: inline
Cc: wei.huang2@amd.com, weiwang.dd@gmail.com, xiantao.zhang@intel.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v3] IOMMU: keep disabled until iommu_setup()
 is called
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 24.10.12 at 17:49, Jan Beulich wrote:
> The iommu is enabled by default when xen is booting and later disabled
> in iommu_setup() when no iommu is present.
> 
> But under some circumstances iommu code can be called before
> iommu_setup() is processed. If there is no iommu available xen crashes.
> 
> This can happen for example when panic(...) is called as introduced
> with the patch "x86-64: detect processors subject to AMD erratum #121
> and refuse to boot" since xen 4.1.3, resulting in
> find_iommu_for_device() to be called in the context of
> disable_IO_APIC() / __stop_this_cpu().
> 
> This patch fixes this by keeping the iommu disabled until iommu_setup()
> is entered.
> 
> Originally-by: Ronny Hegewald <ronny.hegewald@online.de>
> 
> In order for iommu_enable to be off initially, iommu_supports_eim()
> must not depend on it anymore, nor must acpi_parse_dmar(). The former
> in turn requires that iommu_intremap gets uncoupled from iommu_enabled
> (in particular, failure during IOMMU setup should no longer result in
> iommu_intremap getting cleared by generic code; IOMMU specific code
> can still do so provided in can live with the consequences).
> 
> This could have the nice side effect of allowing to use "iommu=off"
> even when x2APIC was pre-enabled by the BIOS (in which case interrupt
> remapping is a requirement, but DMA translation [obviously] isn't), but
> that doesn't currently work (and hence x2apic_bsp_setup() forces the
> IOMMU on rather than just interrupt remapping).
> 
> For consistency with VT-d, make the AMD IOMMU code also skip all ACPI
> table parsing when neither iommu_enable nor iommu_intremap are set.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

So after having got acks from both Intel and AMD, I committed
this to -unstable, but I'm rather hesitant to backport this onto the
4.x branches (not the least because in the end this is just
cosmetic for the problem you reported - the box would not boot
in either case, just that with the patch it is more obvious why).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 16:19:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 16:19:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUJxr-0005Lv-DV; Fri, 02 Nov 2012 16:19:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUJxp-0005LP-GB
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 16:19:21 +0000
Received: from [85.158.137.99:65474] by server-3.bemta-3.messagelabs.com id
	41/C2-31566-882F3905; Fri, 02 Nov 2012 16:19:20 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1351873157!12147205!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10748 invoked from network); 2 Nov 2012 16:19:20 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-217.messagelabs.com with SMTP;
	2 Nov 2012 16:19:20 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 16:19:15 +0000
Message-Id: <509400BD02000078000A6258@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 16:19:57 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ronny Hegewald" <ronny.hegewald@online.de>
Mime-Version: 1.0
Content-Disposition: inline
Cc: wei.huang2@amd.com, weiwang.dd@gmail.com, xiantao.zhang@intel.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v3] IOMMU: keep disabled until iommu_setup()
 is called
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 24.10.12 at 17:49, Jan Beulich wrote:
> The iommu is enabled by default when xen is booting and later disabled
> in iommu_setup() when no iommu is present.
> 
> But under some circumstances iommu code can be called before
> iommu_setup() is processed. If there is no iommu available xen crashes.
> 
> This can happen for example when panic(...) is called as introduced
> with the patch "x86-64: detect processors subject to AMD erratum #121
> and refuse to boot" since xen 4.1.3, resulting in
> find_iommu_for_device() to be called in the context of
> disable_IO_APIC() / __stop_this_cpu().
> 
> This patch fixes this by keeping the iommu disabled until iommu_setup()
> is entered.
> 
> Originally-by: Ronny Hegewald <ronny.hegewald@online.de>
> 
> In order for iommu_enable to be off initially, iommu_supports_eim()
> must not depend on it anymore, nor must acpi_parse_dmar(). The former
> in turn requires that iommu_intremap gets uncoupled from iommu_enabled
> (in particular, failure during IOMMU setup should no longer result in
> iommu_intremap getting cleared by generic code; IOMMU specific code
> can still do so provided in can live with the consequences).
> 
> This could have the nice side effect of allowing to use "iommu=off"
> even when x2APIC was pre-enabled by the BIOS (in which case interrupt
> remapping is a requirement, but DMA translation [obviously] isn't), but
> that doesn't currently work (and hence x2apic_bsp_setup() forces the
> IOMMU on rather than just interrupt remapping).
> 
> For consistency with VT-d, make the AMD IOMMU code also skip all ACPI
> table parsing when neither iommu_enable nor iommu_intremap are set.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

So after having got acks from both Intel and AMD, I committed
this to -unstable, but I'm rather hesitant to backport this onto the
4.x branches (not the least because in the end this is just
cosmetic for the problem you reported - the box would not boot
in either case, just that with the patch it is more obvious why).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 16:23:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 16:23:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUK1x-0005cy-4k; Fri, 02 Nov 2012 16:23:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <gregkh@linuxfoundation.org>) id 1TUK1w-0005cs-Ev
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 16:23:36 +0000
Received: from [85.158.139.211:51033] by server-8.bemta-5.messagelabs.com id
	C7/D5-06050-783F3905; Fri, 02 Nov 2012 16:23:35 +0000
X-Env-Sender: gregkh@linuxfoundation.org
X-Msg-Ref: server-6.tower-206.messagelabs.com!1351873413!18666915!1
X-Originating-IP: [209.85.220.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1447 invoked from network); 2 Nov 2012 16:23:35 -0000
Received: from mail-pa0-f45.google.com (HELO mail-pa0-f45.google.com)
	(209.85.220.45)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 16:23:35 -0000
Received: by mail-pa0-f45.google.com with SMTP id fb10so2668281pad.32
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 09:23:33 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent
	:x-gm-message-state;
	bh=EaVC243jcuIWU8aOZsOenAPQJiL3gY8AnNxd3eSPhsk=;
	b=VUc/LajnfD/XJBLxHoaK8J2nNbyN26VQu/qk5fhp3uX+YLi/iOqzeIBb7co0VzxBp2
	AwMLjfG++yhYP0cqiNUvZ0f3iqh3YK2HBYssBdtr2o3rSvNF5lUwlin0R1ak9GDrnnna
	zFGViurUdcj8IiApoI2ZFVArf/NjBbLrbdQmr1gt2YLI+d/V1GNrS6Hrzc0aX4Bpbucm
	jdQ0/rqdArax1z0cr89FB4UY+SHEhcST5kkAFIzoQK6A8iJo5jDyEc2IcYSBRbyeXHxk
	a3I744T74cniJCHW4MIQ/maoym/+bwvkO5uLBS08Pa9C8aQZ2QcqY8S23JVlEFUmvhZJ
	Jdvw==
Received: by 10.66.80.133 with SMTP id r5mr6796577pax.24.1351873413226;
	Fri, 02 Nov 2012 09:23:33 -0700 (PDT)
Received: from localhost (c-67-168-183-230.hsd1.wa.comcast.net.
	[67.168.183.230])
	by mx.google.com with ESMTPS id wg3sm5977705pbc.28.2012.11.02.09.23.30
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 02 Nov 2012 09:23:32 -0700 (PDT)
Date: Fri, 2 Nov 2012 09:23:34 -0700
From: Greg KH <gregkh@linuxfoundation.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121102162334.GB4093@kroah.com>
References: <5093947F02000078000A5F42@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5093947F02000078000A5F42@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Gm-Message-State: ALoCoQnPAx63QVcXJzm/e7gIPTNKoxWabwLMd1I07W9qi9pZk8PerHEM1m+cn4QAHDSZuUpXz/Ua
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	linux-usb@vger.kernel.org, xen-devel <xen-devel@lists.xen.org>,
	Randy Dunlap <rdunlap@xenotime.net>, stern@rowland.harvard.edu
Subject: Re: [Xen-devel] [PATCH,
 v3] fix build with XEN and EARLY_PRINTK_DBGP enabled but
 USB_SUPPORT disabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 02, 2012 at 08:38:07AM +0000, Jan Beulich wrote:
> Since there's no possible caller of dbgp_external_startup() and

<snip>

Please just send the incremental patch, in a format that I can apply it
(hint, as an attachment like this I can't, as I would have to hand-edit
the attachment, and I might get it wrong...)

thanks,

greg k-h

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 16:23:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 16:23:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUK1x-0005cy-4k; Fri, 02 Nov 2012 16:23:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <gregkh@linuxfoundation.org>) id 1TUK1w-0005cs-Ev
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 16:23:36 +0000
Received: from [85.158.139.211:51033] by server-8.bemta-5.messagelabs.com id
	C7/D5-06050-783F3905; Fri, 02 Nov 2012 16:23:35 +0000
X-Env-Sender: gregkh@linuxfoundation.org
X-Msg-Ref: server-6.tower-206.messagelabs.com!1351873413!18666915!1
X-Originating-IP: [209.85.220.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1447 invoked from network); 2 Nov 2012 16:23:35 -0000
Received: from mail-pa0-f45.google.com (HELO mail-pa0-f45.google.com)
	(209.85.220.45)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 16:23:35 -0000
Received: by mail-pa0-f45.google.com with SMTP id fb10so2668281pad.32
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 09:23:33 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent
	:x-gm-message-state;
	bh=EaVC243jcuIWU8aOZsOenAPQJiL3gY8AnNxd3eSPhsk=;
	b=VUc/LajnfD/XJBLxHoaK8J2nNbyN26VQu/qk5fhp3uX+YLi/iOqzeIBb7co0VzxBp2
	AwMLjfG++yhYP0cqiNUvZ0f3iqh3YK2HBYssBdtr2o3rSvNF5lUwlin0R1ak9GDrnnna
	zFGViurUdcj8IiApoI2ZFVArf/NjBbLrbdQmr1gt2YLI+d/V1GNrS6Hrzc0aX4Bpbucm
	jdQ0/rqdArax1z0cr89FB4UY+SHEhcST5kkAFIzoQK6A8iJo5jDyEc2IcYSBRbyeXHxk
	a3I744T74cniJCHW4MIQ/maoym/+bwvkO5uLBS08Pa9C8aQZ2QcqY8S23JVlEFUmvhZJ
	Jdvw==
Received: by 10.66.80.133 with SMTP id r5mr6796577pax.24.1351873413226;
	Fri, 02 Nov 2012 09:23:33 -0700 (PDT)
Received: from localhost (c-67-168-183-230.hsd1.wa.comcast.net.
	[67.168.183.230])
	by mx.google.com with ESMTPS id wg3sm5977705pbc.28.2012.11.02.09.23.30
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 02 Nov 2012 09:23:32 -0700 (PDT)
Date: Fri, 2 Nov 2012 09:23:34 -0700
From: Greg KH <gregkh@linuxfoundation.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121102162334.GB4093@kroah.com>
References: <5093947F02000078000A5F42@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5093947F02000078000A5F42@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Gm-Message-State: ALoCoQnPAx63QVcXJzm/e7gIPTNKoxWabwLMd1I07W9qi9pZk8PerHEM1m+cn4QAHDSZuUpXz/Ua
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	linux-usb@vger.kernel.org, xen-devel <xen-devel@lists.xen.org>,
	Randy Dunlap <rdunlap@xenotime.net>, stern@rowland.harvard.edu
Subject: Re: [Xen-devel] [PATCH,
 v3] fix build with XEN and EARLY_PRINTK_DBGP enabled but
 USB_SUPPORT disabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 02, 2012 at 08:38:07AM +0000, Jan Beulich wrote:
> Since there's no possible caller of dbgp_external_startup() and

<snip>

Please just send the incremental patch, in a format that I can apply it
(hint, as an attachment like this I can't, as I would have to hand-edit
the attachment, and I might get it wrong...)

thanks,

greg k-h

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 16:37:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 16:37:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKFP-00064I-LD; Fri, 02 Nov 2012 16:37:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TUKFO-00064D-67
	for xen-devel@lists.xensource.com; Fri, 02 Nov 2012 16:37:30 +0000
Received: from [85.158.139.83:17704] by server-14.bemta-5.messagelabs.com id
	F5/66-21768-9C6F3905; Fri, 02 Nov 2012 16:37:29 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1351874247!28497603!1
X-Originating-IP: [209.85.212.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP,UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22626 invoked from network); 2 Nov 2012 16:37:28 -0000
Received: from mail-vb0-f43.google.com (HELO mail-vb0-f43.google.com)
	(209.85.212.43)
	by server-3.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 16:37:28 -0000
Received: by mail-vb0-f43.google.com with SMTP id fq11so4997087vbb.30
	for <xen-devel@lists.xensource.com>;
	Fri, 02 Nov 2012 09:37:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=PAkQn89GlTxElI/EixHAKjvTPXRYDDMr9Dl0c2h/XTs=;
	b=WE3XxnXLMtnFVD4wtth61FJ3Yrn18A6hSzjsoaGqfM3hJOB++mxPC3f3pIWZDo//6O
	Es5ma65verJx2bIPED6zjnjhKNYo2AWf5LLgSr0ZdYtfrlumJTFjGygeGz5gJK3b1D1n
	O2MJ++F8lpTdlT3Jp7tU/TcULnhM9ZlQh8bJcCXrB1rqePq4QNMKdiK9DXZWiP9exIOe
	IEykB+O1g1aHvn39I+PBh3kSuOu9SpiPCnokRXCgc5tLn86dwNhYppdbpIDJLLrGwVB3
	9AVRqHom9iz02nJHOLG3PGo5lhjkO88mXXyHxoYiqlSyseXgiv8AyrvMWJ1tTt1FzKTd
	zrVw==
Received: by 10.52.76.40 with SMTP id h8mr1976125vdw.123.1351874246814;
	Fri, 02 Nov 2012 09:37:26 -0700 (PDT)
Received: from konrad-lan.dumpdata.com
	(pool-64-222-209-26.port.east.myfairpoint.net. [64.222.209.26])
	by mx.google.com with ESMTPS id zx18sm5242691veb.3.2012.11.02.09.37.26
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 02 Nov 2012 09:37:26 -0700 (PDT)
Date: Fri, 2 Nov 2012 12:37:20 -0400
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121102163720.GA27213@konrad-lan.dumpdata.com>
References: <1350673381-20342-1-git-send-email-konrad.wilk@oracle.com>
	<1350984138.2237.22.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1350984138.2237.22.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH] xen/hvm: If we fail to fetch an HVM
 parameter print out which flag it is.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Oct 23, 2012 at 10:22:18AM +0100, Ian Campbell wrote:
> On Fri, 2012-10-19 at 20:03 +0100, Konrad Rzeszutek Wilk wrote:
> > Makes it easier to troubleshoot in the field.
> > 
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > ---
> >  include/xen/hvm.h |   31 +++++++++++++++++++++++++++++--
> >  1 files changed, 29 insertions(+), 2 deletions(-)
> > 
> > diff --git a/include/xen/hvm.h b/include/xen/hvm.h
> > index b193fa2..c2a4238 100644
> > --- a/include/xen/hvm.h
> > +++ b/include/xen/hvm.h
> > @@ -5,6 +5,33 @@
> >  #include <xen/interface/hvm/params.h>
> >  #include <asm/xen/hypercall.h>
> >  
> > +static const char *param_name(int op)
> > +{
> > +	static const char *const names[] = {
> 
> #define PARAM(x) [x] = STRINGIFY(x)
> would save from typos due to doubling everything up.
> 
> Or even:
> #define PARAM(x) [HVM_PARAM#_x] STRINGIFY(x)
> 
> > +		[HVM_PARAM_CALLBACK_IRQ] = "HVM_PARAM_CALLBACK_IRQ",
> > +		[HVM_PARAM_STORE_PFN] = "HVM_PARAM_STORE_PFN",
> > +		[HVM_PARAM_STORE_EVTCHN] = "HVM_PARAM_STORE_EVTCHN",
> > +		[HVM_PARAM_PAE_ENABLED] = "HVM_PARAM_PAE_ENABLED",
> > +		[HVM_PARAM_IOREQ_PFN] = "HVM_PARAM_IOREQ_PFN",
> > +		[HVM_PARAM_BUFIOREQ_PFN] = "HVM_PARAM_BUFIOREQ_PFN",
> > +		[HVM_PARAM_TIMER_MODE] = "HVM_PARAM_TIMER_MODE",
> > +		[HVM_PARAM_HPET_ENABLED] = "HVM_PARAM_HPET_ENABLED",
> > +		[HVM_PARAM_IDENT_PT] = "HVM_PARAM_IDENT_PT",
> > +		[HVM_PARAM_DM_DOMAIN] = "HVM_PARAM_DM_DOMAIN",
> > +		[HVM_PARAM_ACPI_S_STATE] = "HVM_PARAM_ACPI_S_STATE",
> > +		[HVM_PARAM_VM86_TSS] = "HVM_PARAM_VM86_TSS",
> > +		[HVM_PARAM_VPT_ALIGN] = "HVM_PARAM_VPT_ALIGN",
> > +		[HVM_PARAM_CONSOLE_PFN] = "HVM_PARAM_CONSOLE_PFN",
> > +		[HVM_PARAM_CONSOLE_EVTCHN] = "HVM_PARAM_CONSOLE_EVTCHN" };
> 
> You probably want a , and a newline before the }.
> 
> > +
> > +	if (op >= ARRAY_SIZE(names))
> > +		return "unknown";
> > +
> > +	if (!names[op])
> > +		return "reserved";
> > +
> > +	return names[op];
> > +}
> >  static inline int hvm_get_parameter(int idx, uint64_t *value)
> >  {
> >  	struct xen_hvm_param xhv;
> > @@ -14,8 +41,8 @@ static inline int hvm_get_parameter(int idx, uint64_t *value)
> >  	xhv.index = idx;
> >  	r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv);
> >  	if (r < 0) {
> > -		printk(KERN_ERR "Cannot get hvm parameter %d: %d!\n",
> > -			idx, r);
> > +		printk(KERN_ERR "Cannot get hvm parameter %s (%d): %d!\n",
> > +			param_name(idx), idx, r);
> >  		return r;
> >  	}
> >  	*value = xhv.value;

Like this?

>From 66705b0ff8808d86c12fcb3815d849a848b5409b Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Fri, 19 Oct 2012 15:01:46 -0400
Subject: [PATCH] xen/hvm: If we fail to fetch an HVM parameter print out
 which flag it is.

Makes it easier to troubleshoot in the field.

[v1: Use macro per Ian's suggestion]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 include/xen/hvm.h | 34 ++++++++++++++++++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/include/xen/hvm.h b/include/xen/hvm.h
index b193fa2..13e43e4 100644
--- a/include/xen/hvm.h
+++ b/include/xen/hvm.h
@@ -5,6 +5,36 @@
 #include <xen/interface/hvm/params.h>
 #include <asm/xen/hypercall.h>
 
+static const char *param_name(int op)
+{
+#define PARAM(x) [HVM_PARAM_##x] = #x
+	static const char *const names[] = {
+		PARAM(CALLBACK_IRQ),
+		PARAM(STORE_PFN),
+		PARAM(STORE_EVTCHN),
+		PARAM(PAE_ENABLED),
+		PARAM(IOREQ_PFN),
+		PARAM(BUFIOREQ_PFN),
+		PARAM(TIMER_MODE),
+		PARAM(HPET_ENABLED),
+		PARAM(IDENT_PT),
+		PARAM(DM_DOMAIN),
+		PARAM(ACPI_S_STATE),
+		PARAM(VM86_TSS),
+		PARAM(VPT_ALIGN),
+		PARAM(CONSOLE_PFN),
+		PARAM(CONSOLE_EVTCHN),
+	};
+#undef PARAM
+
+	if (op >= ARRAY_SIZE(names))
+		return "unknown";
+
+	if (!names[op])
+		return "reserved";
+
+	return names[op];
+}
 static inline int hvm_get_parameter(int idx, uint64_t *value)
 {
 	struct xen_hvm_param xhv;
@@ -14,8 +44,8 @@ static inline int hvm_get_parameter(int idx, uint64_t *value)
 	xhv.index = idx;
 	r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv);
 	if (r < 0) {
-		printk(KERN_ERR "Cannot get hvm parameter %d: %d!\n",
-			idx, r);
+		printk(KERN_ERR "Cannot get hvm parameter %s (%d): %d!\n",
+			param_name(idx), idx, r);
 		return r;
 	}
 	*value = xhv.value;
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 16:37:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 16:37:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKFP-00064I-LD; Fri, 02 Nov 2012 16:37:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TUKFO-00064D-67
	for xen-devel@lists.xensource.com; Fri, 02 Nov 2012 16:37:30 +0000
Received: from [85.158.139.83:17704] by server-14.bemta-5.messagelabs.com id
	F5/66-21768-9C6F3905; Fri, 02 Nov 2012 16:37:29 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1351874247!28497603!1
X-Originating-IP: [209.85.212.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP,UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22626 invoked from network); 2 Nov 2012 16:37:28 -0000
Received: from mail-vb0-f43.google.com (HELO mail-vb0-f43.google.com)
	(209.85.212.43)
	by server-3.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 16:37:28 -0000
Received: by mail-vb0-f43.google.com with SMTP id fq11so4997087vbb.30
	for <xen-devel@lists.xensource.com>;
	Fri, 02 Nov 2012 09:37:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=PAkQn89GlTxElI/EixHAKjvTPXRYDDMr9Dl0c2h/XTs=;
	b=WE3XxnXLMtnFVD4wtth61FJ3Yrn18A6hSzjsoaGqfM3hJOB++mxPC3f3pIWZDo//6O
	Es5ma65verJx2bIPED6zjnjhKNYo2AWf5LLgSr0ZdYtfrlumJTFjGygeGz5gJK3b1D1n
	O2MJ++F8lpTdlT3Jp7tU/TcULnhM9ZlQh8bJcCXrB1rqePq4QNMKdiK9DXZWiP9exIOe
	IEykB+O1g1aHvn39I+PBh3kSuOu9SpiPCnokRXCgc5tLn86dwNhYppdbpIDJLLrGwVB3
	9AVRqHom9iz02nJHOLG3PGo5lhjkO88mXXyHxoYiqlSyseXgiv8AyrvMWJ1tTt1FzKTd
	zrVw==
Received: by 10.52.76.40 with SMTP id h8mr1976125vdw.123.1351874246814;
	Fri, 02 Nov 2012 09:37:26 -0700 (PDT)
Received: from konrad-lan.dumpdata.com
	(pool-64-222-209-26.port.east.myfairpoint.net. [64.222.209.26])
	by mx.google.com with ESMTPS id zx18sm5242691veb.3.2012.11.02.09.37.26
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 02 Nov 2012 09:37:26 -0700 (PDT)
Date: Fri, 2 Nov 2012 12:37:20 -0400
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121102163720.GA27213@konrad-lan.dumpdata.com>
References: <1350673381-20342-1-git-send-email-konrad.wilk@oracle.com>
	<1350984138.2237.22.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1350984138.2237.22.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH] xen/hvm: If we fail to fetch an HVM
 parameter print out which flag it is.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Oct 23, 2012 at 10:22:18AM +0100, Ian Campbell wrote:
> On Fri, 2012-10-19 at 20:03 +0100, Konrad Rzeszutek Wilk wrote:
> > Makes it easier to troubleshoot in the field.
> > 
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > ---
> >  include/xen/hvm.h |   31 +++++++++++++++++++++++++++++--
> >  1 files changed, 29 insertions(+), 2 deletions(-)
> > 
> > diff --git a/include/xen/hvm.h b/include/xen/hvm.h
> > index b193fa2..c2a4238 100644
> > --- a/include/xen/hvm.h
> > +++ b/include/xen/hvm.h
> > @@ -5,6 +5,33 @@
> >  #include <xen/interface/hvm/params.h>
> >  #include <asm/xen/hypercall.h>
> >  
> > +static const char *param_name(int op)
> > +{
> > +	static const char *const names[] = {
> 
> #define PARAM(x) [x] = STRINGIFY(x)
> would save from typos due to doubling everything up.
> 
> Or even:
> #define PARAM(x) [HVM_PARAM#_x] STRINGIFY(x)
> 
> > +		[HVM_PARAM_CALLBACK_IRQ] = "HVM_PARAM_CALLBACK_IRQ",
> > +		[HVM_PARAM_STORE_PFN] = "HVM_PARAM_STORE_PFN",
> > +		[HVM_PARAM_STORE_EVTCHN] = "HVM_PARAM_STORE_EVTCHN",
> > +		[HVM_PARAM_PAE_ENABLED] = "HVM_PARAM_PAE_ENABLED",
> > +		[HVM_PARAM_IOREQ_PFN] = "HVM_PARAM_IOREQ_PFN",
> > +		[HVM_PARAM_BUFIOREQ_PFN] = "HVM_PARAM_BUFIOREQ_PFN",
> > +		[HVM_PARAM_TIMER_MODE] = "HVM_PARAM_TIMER_MODE",
> > +		[HVM_PARAM_HPET_ENABLED] = "HVM_PARAM_HPET_ENABLED",
> > +		[HVM_PARAM_IDENT_PT] = "HVM_PARAM_IDENT_PT",
> > +		[HVM_PARAM_DM_DOMAIN] = "HVM_PARAM_DM_DOMAIN",
> > +		[HVM_PARAM_ACPI_S_STATE] = "HVM_PARAM_ACPI_S_STATE",
> > +		[HVM_PARAM_VM86_TSS] = "HVM_PARAM_VM86_TSS",
> > +		[HVM_PARAM_VPT_ALIGN] = "HVM_PARAM_VPT_ALIGN",
> > +		[HVM_PARAM_CONSOLE_PFN] = "HVM_PARAM_CONSOLE_PFN",
> > +		[HVM_PARAM_CONSOLE_EVTCHN] = "HVM_PARAM_CONSOLE_EVTCHN" };
> 
> You probably want a , and a newline before the }.
> 
> > +
> > +	if (op >= ARRAY_SIZE(names))
> > +		return "unknown";
> > +
> > +	if (!names[op])
> > +		return "reserved";
> > +
> > +	return names[op];
> > +}
> >  static inline int hvm_get_parameter(int idx, uint64_t *value)
> >  {
> >  	struct xen_hvm_param xhv;
> > @@ -14,8 +41,8 @@ static inline int hvm_get_parameter(int idx, uint64_t *value)
> >  	xhv.index = idx;
> >  	r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv);
> >  	if (r < 0) {
> > -		printk(KERN_ERR "Cannot get hvm parameter %d: %d!\n",
> > -			idx, r);
> > +		printk(KERN_ERR "Cannot get hvm parameter %s (%d): %d!\n",
> > +			param_name(idx), idx, r);
> >  		return r;
> >  	}
> >  	*value = xhv.value;

Like this?

>From 66705b0ff8808d86c12fcb3815d849a848b5409b Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Fri, 19 Oct 2012 15:01:46 -0400
Subject: [PATCH] xen/hvm: If we fail to fetch an HVM parameter print out
 which flag it is.

Makes it easier to troubleshoot in the field.

[v1: Use macro per Ian's suggestion]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 include/xen/hvm.h | 34 ++++++++++++++++++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/include/xen/hvm.h b/include/xen/hvm.h
index b193fa2..13e43e4 100644
--- a/include/xen/hvm.h
+++ b/include/xen/hvm.h
@@ -5,6 +5,36 @@
 #include <xen/interface/hvm/params.h>
 #include <asm/xen/hypercall.h>
 
+static const char *param_name(int op)
+{
+#define PARAM(x) [HVM_PARAM_##x] = #x
+	static const char *const names[] = {
+		PARAM(CALLBACK_IRQ),
+		PARAM(STORE_PFN),
+		PARAM(STORE_EVTCHN),
+		PARAM(PAE_ENABLED),
+		PARAM(IOREQ_PFN),
+		PARAM(BUFIOREQ_PFN),
+		PARAM(TIMER_MODE),
+		PARAM(HPET_ENABLED),
+		PARAM(IDENT_PT),
+		PARAM(DM_DOMAIN),
+		PARAM(ACPI_S_STATE),
+		PARAM(VM86_TSS),
+		PARAM(VPT_ALIGN),
+		PARAM(CONSOLE_PFN),
+		PARAM(CONSOLE_EVTCHN),
+	};
+#undef PARAM
+
+	if (op >= ARRAY_SIZE(names))
+		return "unknown";
+
+	if (!names[op])
+		return "reserved";
+
+	return names[op];
+}
 static inline int hvm_get_parameter(int idx, uint64_t *value)
 {
 	struct xen_hvm_param xhv;
@@ -14,8 +44,8 @@ static inline int hvm_get_parameter(int idx, uint64_t *value)
 	xhv.index = idx;
 	r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv);
 	if (r < 0) {
-		printk(KERN_ERR "Cannot get hvm parameter %d: %d!\n",
-			idx, r);
+		printk(KERN_ERR "Cannot get hvm parameter %s (%d): %d!\n",
+			param_name(idx), idx, r);
 		return r;
 	}
 	*value = xhv.value;
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 16:44:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 16:44:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKLx-0006Ma-Ha; Fri, 02 Nov 2012 16:44:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TUKLv-0006MU-Sg
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 16:44:16 +0000
Received: from [85.158.139.83:50970] by server-4.bemta-5.messagelabs.com id
	1B/F2-15011-F58F3905; Fri, 02 Nov 2012 16:44:15 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1351874652!17234520!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5855 invoked from network); 2 Nov 2012 16:44:14 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-8.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 16:44:14 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl15so4930219vcb.32
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 09:44:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=CPWsw2tFgm96CPbFXlyrBtqir5rbmgUS16W94S9pHSA=;
	b=CnS4SuADCOIvPcGie8BaVTNfROjRTQu80IDJr6Yypcbs+t5z/SYGSyW7Gy+GZgkmrw
	7FRKc1y/syElT1H5mQ5fVqPD271CWM6iL6Oc32GAmeJnhtgjR+8/ToKpjKE2b6o1XezD
	OFbO6mpPLrKGpWGgOnmXXBo5SBPJClUuWfbq/2oUufjvW2b/+Bg9CuQ6KSirzVr6ECjH
	wta6HZouQgJNjG5o149EoA/EhfqpEW6zrRwD4bJAe3n8KM0T4TdgQTbZ16XvMMDY+pD8
	A2VpwYvR9DsIp1YB1Ygu4KPxgdUIguL1BJoYGLqSpIEWKwdy4IBkvaKbZVdT4B1E5Aen
	B+8w==
Received: by 10.220.150.82 with SMTP id x18mr2279389vcv.73.1351874652239;
	Fri, 02 Nov 2012 09:44:12 -0700 (PDT)
Received: from konrad-lan.dumpdata.com
	(pool-64-222-209-26.port.east.myfairpoint.net. [64.222.209.26])
	by mx.google.com with ESMTPS id zx18sm5249881veb.3.2012.11.02.09.44.11
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 02 Nov 2012 09:44:12 -0700 (PDT)
Date: Fri, 2 Nov 2012 12:44:09 -0400
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121102164409.GB27213@konrad-lan.dumpdata.com>
References: <1351519698-11069-1-git-send-email-konrad.wilk@oracle.com>
	<1351519698-11069-2-git-send-email-konrad.wilk@oracle.com>
	<20121030154450.GA3000@phenom.dumpdata.com>
	<5090F5AA02000078000A5A0B@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5090F5AA02000078000A5A0B@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: xen-devel <xen-devel@lists.xen.org>, linux-kernel@vger.kernel.org,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/2] xen/hypercall: fix hypercall fallback
 code for very old hypervisors
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Oct 31, 2012 at 08:55:54AM +0000, Jan Beulich wrote:
> >>> On 30.10.12 at 16:44, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > On Mon, Oct 29, 2012 at 10:08:17AM -0400, Konrad Rzeszutek Wilk wrote:
> >> From: Jan Beulich <jbeulich@suse.com>
> >> 
> >> While copying the argument structures in HYPERVISOR_event_channel_op()
> >> and HYPERVISOR_physdev_op() into the local variable is sufficiently
> >> safe even if the actual structure is smaller than the container one,
> >> copying back eventual output values the same way isn't: This may
> >> collide with on-stack variables (particularly "rc") which may change
> >> between the first and second memcpy() (i.e. the second memcpy() could
> >> discard that change).
> >> 
> >> Move the fallback code into out-of-line functions, and handle all of
> >> the operations known by this old a hypervisor individually: Some don't
> >> require copying back anything at all, and for the rest use the
> >> individual argument structures' sizes rather than the container's.
> >> 
> >> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >> [v2: Reduce #define/#undef usage in HYPERVISOR_physdev_op_compat().]
> >> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > 
> > And it looks like I get 
> > 
> > ERROR: "HYPERVISOR_event_channel_op_compat" [drivers/xen/xen-evtchn.ko] 
> > undefined!
> > 
> > when I build xen-evtchn as module. Jan did you encounter this issue on 
> > 2.6.18?
> 
> No - the event channel driver there can't be built as a module, and
> for the forward ported kernels I apparently never tried to build with
> a compat setting of 3.0.2 or less (and I didn't care that much either
> because the oldest we're actually concerned about is 3.0.4 to cover
> some of those very old EC2 systems; I'll add the export at the right
> point nevertheless).

Ok, ended up with this version which I was thinking to for v3.7-rc5:


>From 4ae4c7658a7c0501521c422d618038587c3edeca Mon Sep 17 00:00:00 2001
From: Jan Beulich <jbeulich@suse.com>
Date: Fri, 19 Oct 2012 15:25:37 -0400
Subject: [PATCH] xen/hypercall: fix hypercall fallback code for very old
 hypervisors

While copying the argument structures in HYPERVISOR_event_channel_op()
and HYPERVISOR_physdev_op() into the local variable is sufficiently
safe even if the actual structure is smaller than the container one,
copying back eventual output values the same way isn't: This may
collide with on-stack variables (particularly "rc") which may change
between the first and second memcpy() (i.e. the second memcpy() could
discard that change).

Move the fallback code into out-of-line functions, and handle all of
the operations known by this old a hypervisor individually: Some don't
require copying back anything at all, and for the rest use the
individual argument structures' sizes rather than the container's.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
[v2: Reduce #define/#undef usage in HYPERVISOR_physdev_op_compat().]
[v3: Fix compile errors when modules use said hypercalls]
[v4: Add xen_ prefix to the HYPERCALL_..]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 arch/x86/include/asm/xen/hypercall.h | 21 ++++------
 drivers/xen/Makefile                 |  2 +-
 drivers/xen/fallback.c               | 81 ++++++++++++++++++++++++++++++++++++
 3 files changed, 89 insertions(+), 15 deletions(-)
 create mode 100644 drivers/xen/fallback.c

diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h
index 59c226d..4055421 100644
--- a/arch/x86/include/asm/xen/hypercall.h
+++ b/arch/x86/include/asm/xen/hypercall.h
@@ -359,18 +359,14 @@ HYPERVISOR_update_va_mapping(unsigned long va, pte_t new_val,
 		return _hypercall4(int, update_va_mapping, va,
 				   new_val.pte, new_val.pte >> 32, flags);
 }
+extern int __must_check xen_HYPERVISOR_event_channel_op_compat(int, void *);
 
 static inline int
 HYPERVISOR_event_channel_op(int cmd, void *arg)
 {
 	int rc = _hypercall2(int, event_channel_op, cmd, arg);
-	if (unlikely(rc == -ENOSYS)) {
-		struct evtchn_op op;
-		op.cmd = cmd;
-		memcpy(&op.u, arg, sizeof(op.u));
-		rc = _hypercall1(int, event_channel_op_compat, &op);
-		memcpy(arg, &op.u, sizeof(op.u));
-	}
+	if (unlikely(rc == -ENOSYS))
+		rc = xen_HYPERVISOR_event_channel_op_compat(cmd, arg);
 	return rc;
 }
 
@@ -386,17 +382,14 @@ HYPERVISOR_console_io(int cmd, int count, char *str)
 	return _hypercall3(int, console_io, cmd, count, str);
 }
 
+extern int __must_check xen_HYPERVISOR_physdev_op_compat(int, void *);
+
 static inline int
 HYPERVISOR_physdev_op(int cmd, void *arg)
 {
 	int rc = _hypercall2(int, physdev_op, cmd, arg);
-	if (unlikely(rc == -ENOSYS)) {
-		struct physdev_op op;
-		op.cmd = cmd;
-		memcpy(&op.u, arg, sizeof(op.u));
-		rc = _hypercall1(int, physdev_op_compat, &op);
-		memcpy(arg, &op.u, sizeof(op.u));
-	}
+	if (unlikely(rc == -ENOSYS))
+		rc = xen_HYPERVISOR_physdev_op_compat(cmd, arg);
 	return rc;
 }
 
diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 0e863703..46de6cd 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -2,7 +2,7 @@ ifneq ($(CONFIG_ARM),y)
 obj-y	+= manage.o balloon.o
 obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
 endif
-obj-y	+= grant-table.o features.o events.o
+obj-y	+= grant-table.o features.o events.o fallback.o
 obj-y	+= xenbus/
 
 nostackp := $(call cc-option, -fno-stack-protector)
diff --git a/drivers/xen/fallback.c b/drivers/xen/fallback.c
new file mode 100644
index 0000000..b29ce32
--- /dev/null
+++ b/drivers/xen/fallback.c
@@ -0,0 +1,81 @@
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/bug.h>
+#include <linux/export.h>
+#include <asm/hypervisor.h>
+#include <asm/xen/hypercall.h>
+
+int xen_HYPERVISOR_event_channel_op_compat(int cmd, void *arg)
+{
+	struct evtchn_op op;
+	int rc;
+
+	op.cmd = cmd;
+	memcpy(&op.u, arg, sizeof(op.u));
+	rc = _hypercall1(int, event_channel_op_compat, &op);
+
+	switch (cmd) {
+	case EVTCHNOP_close:
+	case EVTCHNOP_send:
+	case EVTCHNOP_bind_vcpu:
+	case EVTCHNOP_unmask:
+		/* no output */
+		break;
+
+#define COPY_BACK(eop) \
+	case EVTCHNOP_##eop: \
+		memcpy(arg, &op.u.eop, sizeof(op.u.eop)); \
+		break
+
+	COPY_BACK(bind_interdomain);
+	COPY_BACK(bind_virq);
+	COPY_BACK(bind_pirq);
+	COPY_BACK(status);
+	COPY_BACK(alloc_unbound);
+	COPY_BACK(bind_ipi);
+#undef COPY_BACK
+
+	default:
+		WARN_ON(rc != -ENOSYS);
+		break;
+	}
+
+	return rc;
+}
+EXPORT_SYMBOL_GPL(xen_HYPERVISOR_event_channel_op_compat);
+
+int xen_HYPERVISOR_physdev_op_compat(int cmd, void *arg)
+{
+	struct physdev_op op;
+	int rc;
+
+	op.cmd = cmd;
+	memcpy(&op.u, arg, sizeof(op.u));
+	rc = _hypercall1(int, physdev_op_compat, &op);
+
+	switch (cmd) {
+	case PHYSDEVOP_IRQ_UNMASK_NOTIFY:
+	case PHYSDEVOP_set_iopl:
+	case PHYSDEVOP_set_iobitmap:
+	case PHYSDEVOP_apic_write:
+		/* no output */
+		break;
+
+#define COPY_BACK(pop, fld) \
+	case PHYSDEVOP_##pop: \
+		memcpy(arg, &op.u.fld, sizeof(op.u.fld)); \
+		break
+
+	COPY_BACK(irq_status_query, irq_status_query);
+	COPY_BACK(apic_read, apic_op);
+	COPY_BACK(ASSIGN_VECTOR, irq_op);
+#undef COPY_BACK
+
+	default:
+		WARN_ON(rc != -ENOSYS);
+		break;
+	}
+
+	return rc;
+}
+EXPORT_SYMBOL_GPL(xen_HYPERVISOR_physdev_op_compat);
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 16:44:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 16:44:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKLx-0006Ma-Ha; Fri, 02 Nov 2012 16:44:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TUKLv-0006MU-Sg
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 16:44:16 +0000
Received: from [85.158.139.83:50970] by server-4.bemta-5.messagelabs.com id
	1B/F2-15011-F58F3905; Fri, 02 Nov 2012 16:44:15 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1351874652!17234520!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5855 invoked from network); 2 Nov 2012 16:44:14 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-8.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 16:44:14 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl15so4930219vcb.32
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 09:44:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=CPWsw2tFgm96CPbFXlyrBtqir5rbmgUS16W94S9pHSA=;
	b=CnS4SuADCOIvPcGie8BaVTNfROjRTQu80IDJr6Yypcbs+t5z/SYGSyW7Gy+GZgkmrw
	7FRKc1y/syElT1H5mQ5fVqPD271CWM6iL6Oc32GAmeJnhtgjR+8/ToKpjKE2b6o1XezD
	OFbO6mpPLrKGpWGgOnmXXBo5SBPJClUuWfbq/2oUufjvW2b/+Bg9CuQ6KSirzVr6ECjH
	wta6HZouQgJNjG5o149EoA/EhfqpEW6zrRwD4bJAe3n8KM0T4TdgQTbZ16XvMMDY+pD8
	A2VpwYvR9DsIp1YB1Ygu4KPxgdUIguL1BJoYGLqSpIEWKwdy4IBkvaKbZVdT4B1E5Aen
	B+8w==
Received: by 10.220.150.82 with SMTP id x18mr2279389vcv.73.1351874652239;
	Fri, 02 Nov 2012 09:44:12 -0700 (PDT)
Received: from konrad-lan.dumpdata.com
	(pool-64-222-209-26.port.east.myfairpoint.net. [64.222.209.26])
	by mx.google.com with ESMTPS id zx18sm5249881veb.3.2012.11.02.09.44.11
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 02 Nov 2012 09:44:12 -0700 (PDT)
Date: Fri, 2 Nov 2012 12:44:09 -0400
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121102164409.GB27213@konrad-lan.dumpdata.com>
References: <1351519698-11069-1-git-send-email-konrad.wilk@oracle.com>
	<1351519698-11069-2-git-send-email-konrad.wilk@oracle.com>
	<20121030154450.GA3000@phenom.dumpdata.com>
	<5090F5AA02000078000A5A0B@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5090F5AA02000078000A5A0B@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: xen-devel <xen-devel@lists.xen.org>, linux-kernel@vger.kernel.org,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/2] xen/hypercall: fix hypercall fallback
 code for very old hypervisors
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Oct 31, 2012 at 08:55:54AM +0000, Jan Beulich wrote:
> >>> On 30.10.12 at 16:44, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > On Mon, Oct 29, 2012 at 10:08:17AM -0400, Konrad Rzeszutek Wilk wrote:
> >> From: Jan Beulich <jbeulich@suse.com>
> >> 
> >> While copying the argument structures in HYPERVISOR_event_channel_op()
> >> and HYPERVISOR_physdev_op() into the local variable is sufficiently
> >> safe even if the actual structure is smaller than the container one,
> >> copying back eventual output values the same way isn't: This may
> >> collide with on-stack variables (particularly "rc") which may change
> >> between the first and second memcpy() (i.e. the second memcpy() could
> >> discard that change).
> >> 
> >> Move the fallback code into out-of-line functions, and handle all of
> >> the operations known by this old a hypervisor individually: Some don't
> >> require copying back anything at all, and for the rest use the
> >> individual argument structures' sizes rather than the container's.
> >> 
> >> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >> [v2: Reduce #define/#undef usage in HYPERVISOR_physdev_op_compat().]
> >> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > 
> > And it looks like I get 
> > 
> > ERROR: "HYPERVISOR_event_channel_op_compat" [drivers/xen/xen-evtchn.ko] 
> > undefined!
> > 
> > when I build xen-evtchn as module. Jan did you encounter this issue on 
> > 2.6.18?
> 
> No - the event channel driver there can't be built as a module, and
> for the forward ported kernels I apparently never tried to build with
> a compat setting of 3.0.2 or less (and I didn't care that much either
> because the oldest we're actually concerned about is 3.0.4 to cover
> some of those very old EC2 systems; I'll add the export at the right
> point nevertheless).

Ok, ended up with this version which I was thinking to for v3.7-rc5:


>From 4ae4c7658a7c0501521c422d618038587c3edeca Mon Sep 17 00:00:00 2001
From: Jan Beulich <jbeulich@suse.com>
Date: Fri, 19 Oct 2012 15:25:37 -0400
Subject: [PATCH] xen/hypercall: fix hypercall fallback code for very old
 hypervisors

While copying the argument structures in HYPERVISOR_event_channel_op()
and HYPERVISOR_physdev_op() into the local variable is sufficiently
safe even if the actual structure is smaller than the container one,
copying back eventual output values the same way isn't: This may
collide with on-stack variables (particularly "rc") which may change
between the first and second memcpy() (i.e. the second memcpy() could
discard that change).

Move the fallback code into out-of-line functions, and handle all of
the operations known by this old a hypervisor individually: Some don't
require copying back anything at all, and for the rest use the
individual argument structures' sizes rather than the container's.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
[v2: Reduce #define/#undef usage in HYPERVISOR_physdev_op_compat().]
[v3: Fix compile errors when modules use said hypercalls]
[v4: Add xen_ prefix to the HYPERCALL_..]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 arch/x86/include/asm/xen/hypercall.h | 21 ++++------
 drivers/xen/Makefile                 |  2 +-
 drivers/xen/fallback.c               | 81 ++++++++++++++++++++++++++++++++++++
 3 files changed, 89 insertions(+), 15 deletions(-)
 create mode 100644 drivers/xen/fallback.c

diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h
index 59c226d..4055421 100644
--- a/arch/x86/include/asm/xen/hypercall.h
+++ b/arch/x86/include/asm/xen/hypercall.h
@@ -359,18 +359,14 @@ HYPERVISOR_update_va_mapping(unsigned long va, pte_t new_val,
 		return _hypercall4(int, update_va_mapping, va,
 				   new_val.pte, new_val.pte >> 32, flags);
 }
+extern int __must_check xen_HYPERVISOR_event_channel_op_compat(int, void *);
 
 static inline int
 HYPERVISOR_event_channel_op(int cmd, void *arg)
 {
 	int rc = _hypercall2(int, event_channel_op, cmd, arg);
-	if (unlikely(rc == -ENOSYS)) {
-		struct evtchn_op op;
-		op.cmd = cmd;
-		memcpy(&op.u, arg, sizeof(op.u));
-		rc = _hypercall1(int, event_channel_op_compat, &op);
-		memcpy(arg, &op.u, sizeof(op.u));
-	}
+	if (unlikely(rc == -ENOSYS))
+		rc = xen_HYPERVISOR_event_channel_op_compat(cmd, arg);
 	return rc;
 }
 
@@ -386,17 +382,14 @@ HYPERVISOR_console_io(int cmd, int count, char *str)
 	return _hypercall3(int, console_io, cmd, count, str);
 }
 
+extern int __must_check xen_HYPERVISOR_physdev_op_compat(int, void *);
+
 static inline int
 HYPERVISOR_physdev_op(int cmd, void *arg)
 {
 	int rc = _hypercall2(int, physdev_op, cmd, arg);
-	if (unlikely(rc == -ENOSYS)) {
-		struct physdev_op op;
-		op.cmd = cmd;
-		memcpy(&op.u, arg, sizeof(op.u));
-		rc = _hypercall1(int, physdev_op_compat, &op);
-		memcpy(arg, &op.u, sizeof(op.u));
-	}
+	if (unlikely(rc == -ENOSYS))
+		rc = xen_HYPERVISOR_physdev_op_compat(cmd, arg);
 	return rc;
 }
 
diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 0e863703..46de6cd 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -2,7 +2,7 @@ ifneq ($(CONFIG_ARM),y)
 obj-y	+= manage.o balloon.o
 obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
 endif
-obj-y	+= grant-table.o features.o events.o
+obj-y	+= grant-table.o features.o events.o fallback.o
 obj-y	+= xenbus/
 
 nostackp := $(call cc-option, -fno-stack-protector)
diff --git a/drivers/xen/fallback.c b/drivers/xen/fallback.c
new file mode 100644
index 0000000..b29ce32
--- /dev/null
+++ b/drivers/xen/fallback.c
@@ -0,0 +1,81 @@
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/bug.h>
+#include <linux/export.h>
+#include <asm/hypervisor.h>
+#include <asm/xen/hypercall.h>
+
+int xen_HYPERVISOR_event_channel_op_compat(int cmd, void *arg)
+{
+	struct evtchn_op op;
+	int rc;
+
+	op.cmd = cmd;
+	memcpy(&op.u, arg, sizeof(op.u));
+	rc = _hypercall1(int, event_channel_op_compat, &op);
+
+	switch (cmd) {
+	case EVTCHNOP_close:
+	case EVTCHNOP_send:
+	case EVTCHNOP_bind_vcpu:
+	case EVTCHNOP_unmask:
+		/* no output */
+		break;
+
+#define COPY_BACK(eop) \
+	case EVTCHNOP_##eop: \
+		memcpy(arg, &op.u.eop, sizeof(op.u.eop)); \
+		break
+
+	COPY_BACK(bind_interdomain);
+	COPY_BACK(bind_virq);
+	COPY_BACK(bind_pirq);
+	COPY_BACK(status);
+	COPY_BACK(alloc_unbound);
+	COPY_BACK(bind_ipi);
+#undef COPY_BACK
+
+	default:
+		WARN_ON(rc != -ENOSYS);
+		break;
+	}
+
+	return rc;
+}
+EXPORT_SYMBOL_GPL(xen_HYPERVISOR_event_channel_op_compat);
+
+int xen_HYPERVISOR_physdev_op_compat(int cmd, void *arg)
+{
+	struct physdev_op op;
+	int rc;
+
+	op.cmd = cmd;
+	memcpy(&op.u, arg, sizeof(op.u));
+	rc = _hypercall1(int, physdev_op_compat, &op);
+
+	switch (cmd) {
+	case PHYSDEVOP_IRQ_UNMASK_NOTIFY:
+	case PHYSDEVOP_set_iopl:
+	case PHYSDEVOP_set_iobitmap:
+	case PHYSDEVOP_apic_write:
+		/* no output */
+		break;
+
+#define COPY_BACK(pop, fld) \
+	case PHYSDEVOP_##pop: \
+		memcpy(arg, &op.u.fld, sizeof(op.u.fld)); \
+		break
+
+	COPY_BACK(irq_status_query, irq_status_query);
+	COPY_BACK(apic_read, apic_op);
+	COPY_BACK(ASSIGN_VECTOR, irq_op);
+#undef COPY_BACK
+
+	default:
+		WARN_ON(rc != -ENOSYS);
+		break;
+	}
+
+	return rc;
+}
+EXPORT_SYMBOL_GPL(xen_HYPERVISOR_physdev_op_compat);
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 16:50:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 16:50:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKRH-0006WL-Em; Fri, 02 Nov 2012 16:49:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TUKRF-0006WE-Jx
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 16:49:45 +0000
Received: from [85.158.143.35:35486] by server-1.bemta-4.messagelabs.com id
	45/C8-27934-8A9F3905; Fri, 02 Nov 2012 16:49:44 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1351874982!11432064!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19620 invoked from network); 2 Nov 2012 16:49:43 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-11.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 16:49:43 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so4916736vbi.32
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 09:49:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=Z6UdQuFVU6jV+gDOLJ9ziIGGV+sGlCuHhWgKXy5q0UQ=;
	b=PwwbPqpGnTGovTKIzIF2k8tC6ZT+zoZTldRG3yfaltf+kG4uB4RqbXs4C7tP7D1bJX
	WaQtw9bc8C7cMMwz1wP5UN0aNQSZ7feoFWHRbE7lhkKmuY21yzjm2OzkemDtJwBe8iN7
	D516dIjP9Q7Z38Nl12bXIlz0kbhgVPXUcaGKQ19pucqpPXtkS1iT/KWFaxr00G8vtxJ6
	FDhL/CQYPnzg9GJPgU90/0/JdWI95zji2aSC8yFzqYKzUV+K15Z11ZibJb8DwDmJ2stb
	j/ee7eylNf4yLvgVZXedSPfR84jQYNKrTr0FlB7jparGht8H+CXq90T8aLBTNZOqGnAP
	P5XQ==
Received: by 10.52.74.135 with SMTP id t7mr2097296vdv.18.1351874982236;
	Fri, 02 Nov 2012 09:49:42 -0700 (PDT)
Received: from konrad-lan.dumpdata.com
	(pool-64-222-209-26.port.east.myfairpoint.net. [64.222.209.26])
	by mx.google.com with ESMTPS id co1sm5793659vdc.10.2012.11.02.09.49.41
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 02 Nov 2012 09:49:41 -0700 (PDT)
Date: Fri, 2 Nov 2012 12:49:39 -0400
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Message-ID: <20121102164937.GC27213@konrad-lan.dumpdata.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<5089676602000078000A4928@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC82923353723C7@SHSMSX101.ccr.corp.intel.com>
	<508A89CB020000780008E6ED@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 01, 2012 at 06:34:45AM +0000, Liu, Jinsong wrote:
> Thanks! updated as attached.
> 
> Jinsong
> 
> =====================
> >From f514b97628945cfac00efb0d456f133d44754c9d Mon Sep 17 00:00:00 2001
> From: Liu, Jinsong <jinsong.liu@intel.com>
> Date: Thu, 1 Nov 2012 21:02:36 +0800
> Subject: [PATCH 1/2] Xen acpi pad implement
> 
> PAD is acpi Processor Aggregator Device which provides a control point
> that enables the platform to perform specific processor configuration
> and control that applies to all processors in the platform.
> 
> This patch is to implement Xen acpi pad logic. When running under Xen
> virt platform, native pad driver would not work. Instead Xen pad driver,
> a self-contained and very thin logic level, would take over acpi pad staff.
> When acpi pad notify OSPM, xen pad logic intercept and parse _PUR object
> and then hypercall to hyervisor for the rest work, say, core parking.

Two comments:
 - Did you look at the SuSE tree? Jan mentioned that they did some
   fixes? Did you carry them over?
 - The init function should not make hypercalls before checking if it
   in facts run under Xen.

> 
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
> ---
>  drivers/xen/Makefile             |    1 +
>  drivers/xen/xen_acpi_pad.c       |  206 ++++++++++++++++++++++++++++++++++++++
>  include/xen/interface/platform.h |   17 +++
>  3 files changed, 224 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/xen/xen_acpi_pad.c
> 
> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> index 0e86370..a2af622 100644
> --- a/drivers/xen/Makefile
> +++ b/drivers/xen/Makefile
> @@ -29,6 +29,7 @@ obj-$(CONFIG_XEN_MCE_LOG)		+= mcelog.o
>  obj-$(CONFIG_XEN_PCIDEV_BACKEND)	+= xen-pciback/
>  obj-$(CONFIG_XEN_PRIVCMD)		+= xen-privcmd.o
>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)	+= xen-acpi-processor.o
> +obj-$(CONFIG_XEN_DOM0)			+= xen_acpi_pad.o
>  xen-evtchn-y				:= evtchn.o
>  xen-gntdev-y				:= gntdev.o
>  xen-gntalloc-y				:= gntalloc.o
> diff --git a/drivers/xen/xen_acpi_pad.c b/drivers/xen/xen_acpi_pad.c
> new file mode 100644
> index 0000000..e8c26a4
> --- /dev/null
> +++ b/drivers/xen/xen_acpi_pad.c
> @@ -0,0 +1,206 @@
> +/*
> + * xen_acpi_pad.c - Xen pad interface
> + *
> + * Copyright (c) 2012, Intel Corporation.
> + *    Author: Liu, Jinsong <jinsong.liu@intel.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope it will be useful, but WITHOUT
> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
> + * more details.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/types.h>
> +#include <acpi/acpi_bus.h>
> +#include <acpi/acpi_drivers.h>
> +#include <asm/xen/hypercall.h>
> +#include <xen/interface/version.h>
> +
> +#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"acpi_pad"
> +#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
> +#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
> +
> +static DEFINE_MUTEX(xen_pad_lock);
> +
> +static int xen_pad_set_idle_cpus(int num_cpus)
> +{
> +	struct xen_platform_op op;
> +
> +	if (num_cpus < 0)
> +		return -EINVAL;
> +
> +	/* set cpu nums expected to be idled */
> +	op.cmd = XENPF_core_parking;
> +	op.u.core_parking.type = XEN_CORE_PARKING_SET;
> +	op.u.core_parking.idle_nums = num_cpus;
> +
> +	return HYPERVISOR_dom0_op(&op);
> +}
> +
> +/*
> + * Cannot get idle cpus by using hypercall once (shared with _SET)
> + * because of the characteristic of Xen continue_hypercall_on_cpu
> + */
> +static int xen_pad_get_idle_cpus(void)
> +{
> +	int ret;
> +	struct xen_platform_op op;
> +
> +	/* get cpu nums actually be idled */
> +	op.cmd = XENPF_core_parking;
> +	op.u.core_parking.type = XEN_CORE_PARKING_GET;
> +	ret = HYPERVISOR_dom0_op(&op);
> +	if (ret < 0)
> +		return ret;
> +
> +	return op.u.core_parking.idle_nums;
> +}
> +
> +/*
> + * Query firmware how many CPUs should be idle
> + * return -1 on failure
> + */
> +static int xen_acpi_pad_pur(acpi_handle handle)
> +{
> +	struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
> +	union acpi_object *package;
> +	int num = -1;
> +
> +	if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))
> +		return num;
> +
> +	if (!buffer.length || !buffer.pointer)
> +		return num;
> +
> +	package = buffer.pointer;
> +
> +	if (package->type == ACPI_TYPE_PACKAGE &&
> +		package->package.count == 2 &&
> +		package->package.elements[0].integer.value == 1) /* rev 1 */
> +
> +		num = package->package.elements[1].integer.value;
> +
> +	kfree(buffer.pointer);
> +	return num;
> +}
> +
> +/* Notify firmware how many CPUs are idle */
> +static void xen_acpi_pad_ost(acpi_handle handle, int stat,
> +	uint32_t idle_cpus)
> +{
> +	union acpi_object params[3] = {
> +		{.type = ACPI_TYPE_INTEGER,},
> +		{.type = ACPI_TYPE_INTEGER,},
> +		{.type = ACPI_TYPE_BUFFER,},
> +	};
> +	struct acpi_object_list arg_list = {3, params};
> +
> +	params[0].integer.value = ACPI_PROCESSOR_AGGREGATOR_NOTIFY;
> +	params[1].integer.value =  stat;
> +	params[2].buffer.length = 4;
> +	params[2].buffer.pointer = (void *)&idle_cpus;
> +	acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
> +}
> +
> +static void xen_acpi_pad_handle_notify(acpi_handle handle)
> +{
> +	int num_cpus;
> +
> +	num_cpus = xen_acpi_pad_pur(handle);
> +	if (num_cpus < 0)
> +		return;
> +
> +	mutex_lock(&xen_pad_lock);
> +	if (xen_pad_set_idle_cpus(num_cpus)) {
> +		mutex_unlock(&xen_pad_lock);
> +		return;
> +	}
> +
> +	num_cpus = xen_pad_get_idle_cpus();
> +	if (num_cpus < 0) {
> +		mutex_unlock(&xen_pad_lock);
> +		return;
> +	}
> +	mutex_unlock(&xen_pad_lock);
> +
> +	xen_acpi_pad_ost(handle, 0, num_cpus);
> +}
> +
> +static void xen_acpi_pad_notify(acpi_handle handle, u32 event,
> +	void *data)
> +{
> +	switch (event) {
> +	case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
> +		xen_acpi_pad_handle_notify(handle);
> +		break;
> +	default:
> +		pr_warn("Unsupported event [0x%x]\n", event);
> +		break;
> +	}
> +}
> +
> +static int xen_acpi_pad_add(struct acpi_device *device)
> +{
> +	acpi_status status;
> +
> +	strcpy(acpi_device_name(device), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
> +	strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);
> +
> +	status = acpi_install_notify_handler(device->handle,
> +		 ACPI_DEVICE_NOTIFY, xen_acpi_pad_notify, device);
> +	if (ACPI_FAILURE(status))
> +		return -ENODEV;
> +
> +	return 0;
> +}
> +
> +static int xen_acpi_pad_remove(struct acpi_device *device,
> +	int type)
> +{
> +	mutex_lock(&xen_pad_lock);
> +	xen_pad_set_idle_cpus(0);
> +	mutex_unlock(&xen_pad_lock);
> +
> +	acpi_remove_notify_handler(device->handle,
> +		ACPI_DEVICE_NOTIFY, xen_acpi_pad_notify);
> +	return 0;
> +}
> +
> +static const struct acpi_device_id pad_device_ids[] = {
> +	{"ACPI000C", 0},
> +	{"", 0},
> +};
> +
> +static struct acpi_driver xen_acpi_pad_driver = {
> +	.name = "processor_aggregator",
> +	.class = ACPI_PROCESSOR_AGGREGATOR_CLASS,
> +	.ids = pad_device_ids,
> +	.ops = {
> +		.add = xen_acpi_pad_add,
> +		.remove = xen_acpi_pad_remove,
> +	},
> +};
> +
> +static int __init xen_acpi_pad_init(void)
> +{
> +	int ret = -ENOSYS;
> +	unsigned int version = HYPERVISOR_xen_version(XENVER_version, NULL);

Heh. so if you run this on baremetal I wonder what will happen.

> +	unsigned int major = version >> 16;
> +	unsigned int minor = version & 0xffff;
> +
> +	/* Only DOM0 is responsible for Xen acpi pad */
> +	if (!xen_initial_domain())
> +		return -ENODEV;
> +

I think the check for version should happen here.

> +	/* Only Xen4.2 or later support Xen acpi pad */
> +	if (((major == 4) && (minor >= 2)) || (major > 4))
> +		ret = acpi_bus_register_driver(&xen_acpi_pad_driver);
> +
> +	return ret;
> +}
> +subsys_initcall(xen_acpi_pad_init);
> diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
> index 4755b5f..a3be54c 100644
> --- a/include/xen/interface/platform.h
> +++ b/include/xen/interface/platform.h
> @@ -324,6 +324,22 @@ struct xenpf_cpu_ol {
>  };
>  DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
>  
> +/*
> + * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd,
> + * which are already occupied at Xen hypervisor side.
> + */
> +#define XENPF_core_parking	60
> +struct xenpf_core_parking {
> +	/* IN variables */
> +#define XEN_CORE_PARKING_SET	1
> +#define XEN_CORE_PARKING_GET	2
> +	uint32_t type;
> +	/* IN variables:  set cpu nums expected to be idled */
> +	/* OUT variables: get cpu nums actually be idled */
> +	uint32_t idle_nums;
> +};
> +DEFINE_GUEST_HANDLE_STRUCT(xenpf_core_parking);
> +
>  struct xen_platform_op {
>  	uint32_t cmd;
>  	uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
> @@ -341,6 +357,7 @@ struct xen_platform_op {
>  		struct xenpf_set_processor_pminfo set_pminfo;
>  		struct xenpf_pcpuinfo          pcpu_info;
>  		struct xenpf_cpu_ol            cpu_ol;
> +		struct xenpf_core_parking      core_parking;
>  		uint8_t                        pad[128];
>  	} u;
>  };
> -- 
> 1.7.1


> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 16:50:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 16:50:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKRH-0006WL-Em; Fri, 02 Nov 2012 16:49:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TUKRF-0006WE-Jx
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 16:49:45 +0000
Received: from [85.158.143.35:35486] by server-1.bemta-4.messagelabs.com id
	45/C8-27934-8A9F3905; Fri, 02 Nov 2012 16:49:44 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1351874982!11432064!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19620 invoked from network); 2 Nov 2012 16:49:43 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-11.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 16:49:43 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so4916736vbi.32
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 09:49:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=Z6UdQuFVU6jV+gDOLJ9ziIGGV+sGlCuHhWgKXy5q0UQ=;
	b=PwwbPqpGnTGovTKIzIF2k8tC6ZT+zoZTldRG3yfaltf+kG4uB4RqbXs4C7tP7D1bJX
	WaQtw9bc8C7cMMwz1wP5UN0aNQSZ7feoFWHRbE7lhkKmuY21yzjm2OzkemDtJwBe8iN7
	D516dIjP9Q7Z38Nl12bXIlz0kbhgVPXUcaGKQ19pucqpPXtkS1iT/KWFaxr00G8vtxJ6
	FDhL/CQYPnzg9GJPgU90/0/JdWI95zji2aSC8yFzqYKzUV+K15Z11ZibJb8DwDmJ2stb
	j/ee7eylNf4yLvgVZXedSPfR84jQYNKrTr0FlB7jparGht8H+CXq90T8aLBTNZOqGnAP
	P5XQ==
Received: by 10.52.74.135 with SMTP id t7mr2097296vdv.18.1351874982236;
	Fri, 02 Nov 2012 09:49:42 -0700 (PDT)
Received: from konrad-lan.dumpdata.com
	(pool-64-222-209-26.port.east.myfairpoint.net. [64.222.209.26])
	by mx.google.com with ESMTPS id co1sm5793659vdc.10.2012.11.02.09.49.41
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 02 Nov 2012 09:49:41 -0700 (PDT)
Date: Fri, 2 Nov 2012 12:49:39 -0400
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Message-ID: <20121102164937.GC27213@konrad-lan.dumpdata.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<5089676602000078000A4928@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC82923353723C7@SHSMSX101.ccr.corp.intel.com>
	<508A89CB020000780008E6ED@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 01, 2012 at 06:34:45AM +0000, Liu, Jinsong wrote:
> Thanks! updated as attached.
> 
> Jinsong
> 
> =====================
> >From f514b97628945cfac00efb0d456f133d44754c9d Mon Sep 17 00:00:00 2001
> From: Liu, Jinsong <jinsong.liu@intel.com>
> Date: Thu, 1 Nov 2012 21:02:36 +0800
> Subject: [PATCH 1/2] Xen acpi pad implement
> 
> PAD is acpi Processor Aggregator Device which provides a control point
> that enables the platform to perform specific processor configuration
> and control that applies to all processors in the platform.
> 
> This patch is to implement Xen acpi pad logic. When running under Xen
> virt platform, native pad driver would not work. Instead Xen pad driver,
> a self-contained and very thin logic level, would take over acpi pad staff.
> When acpi pad notify OSPM, xen pad logic intercept and parse _PUR object
> and then hypercall to hyervisor for the rest work, say, core parking.

Two comments:
 - Did you look at the SuSE tree? Jan mentioned that they did some
   fixes? Did you carry them over?
 - The init function should not make hypercalls before checking if it
   in facts run under Xen.

> 
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
> ---
>  drivers/xen/Makefile             |    1 +
>  drivers/xen/xen_acpi_pad.c       |  206 ++++++++++++++++++++++++++++++++++++++
>  include/xen/interface/platform.h |   17 +++
>  3 files changed, 224 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/xen/xen_acpi_pad.c
> 
> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> index 0e86370..a2af622 100644
> --- a/drivers/xen/Makefile
> +++ b/drivers/xen/Makefile
> @@ -29,6 +29,7 @@ obj-$(CONFIG_XEN_MCE_LOG)		+= mcelog.o
>  obj-$(CONFIG_XEN_PCIDEV_BACKEND)	+= xen-pciback/
>  obj-$(CONFIG_XEN_PRIVCMD)		+= xen-privcmd.o
>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)	+= xen-acpi-processor.o
> +obj-$(CONFIG_XEN_DOM0)			+= xen_acpi_pad.o
>  xen-evtchn-y				:= evtchn.o
>  xen-gntdev-y				:= gntdev.o
>  xen-gntalloc-y				:= gntalloc.o
> diff --git a/drivers/xen/xen_acpi_pad.c b/drivers/xen/xen_acpi_pad.c
> new file mode 100644
> index 0000000..e8c26a4
> --- /dev/null
> +++ b/drivers/xen/xen_acpi_pad.c
> @@ -0,0 +1,206 @@
> +/*
> + * xen_acpi_pad.c - Xen pad interface
> + *
> + * Copyright (c) 2012, Intel Corporation.
> + *    Author: Liu, Jinsong <jinsong.liu@intel.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope it will be useful, but WITHOUT
> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
> + * more details.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/types.h>
> +#include <acpi/acpi_bus.h>
> +#include <acpi/acpi_drivers.h>
> +#include <asm/xen/hypercall.h>
> +#include <xen/interface/version.h>
> +
> +#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"acpi_pad"
> +#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
> +#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
> +
> +static DEFINE_MUTEX(xen_pad_lock);
> +
> +static int xen_pad_set_idle_cpus(int num_cpus)
> +{
> +	struct xen_platform_op op;
> +
> +	if (num_cpus < 0)
> +		return -EINVAL;
> +
> +	/* set cpu nums expected to be idled */
> +	op.cmd = XENPF_core_parking;
> +	op.u.core_parking.type = XEN_CORE_PARKING_SET;
> +	op.u.core_parking.idle_nums = num_cpus;
> +
> +	return HYPERVISOR_dom0_op(&op);
> +}
> +
> +/*
> + * Cannot get idle cpus by using hypercall once (shared with _SET)
> + * because of the characteristic of Xen continue_hypercall_on_cpu
> + */
> +static int xen_pad_get_idle_cpus(void)
> +{
> +	int ret;
> +	struct xen_platform_op op;
> +
> +	/* get cpu nums actually be idled */
> +	op.cmd = XENPF_core_parking;
> +	op.u.core_parking.type = XEN_CORE_PARKING_GET;
> +	ret = HYPERVISOR_dom0_op(&op);
> +	if (ret < 0)
> +		return ret;
> +
> +	return op.u.core_parking.idle_nums;
> +}
> +
> +/*
> + * Query firmware how many CPUs should be idle
> + * return -1 on failure
> + */
> +static int xen_acpi_pad_pur(acpi_handle handle)
> +{
> +	struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
> +	union acpi_object *package;
> +	int num = -1;
> +
> +	if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))
> +		return num;
> +
> +	if (!buffer.length || !buffer.pointer)
> +		return num;
> +
> +	package = buffer.pointer;
> +
> +	if (package->type == ACPI_TYPE_PACKAGE &&
> +		package->package.count == 2 &&
> +		package->package.elements[0].integer.value == 1) /* rev 1 */
> +
> +		num = package->package.elements[1].integer.value;
> +
> +	kfree(buffer.pointer);
> +	return num;
> +}
> +
> +/* Notify firmware how many CPUs are idle */
> +static void xen_acpi_pad_ost(acpi_handle handle, int stat,
> +	uint32_t idle_cpus)
> +{
> +	union acpi_object params[3] = {
> +		{.type = ACPI_TYPE_INTEGER,},
> +		{.type = ACPI_TYPE_INTEGER,},
> +		{.type = ACPI_TYPE_BUFFER,},
> +	};
> +	struct acpi_object_list arg_list = {3, params};
> +
> +	params[0].integer.value = ACPI_PROCESSOR_AGGREGATOR_NOTIFY;
> +	params[1].integer.value =  stat;
> +	params[2].buffer.length = 4;
> +	params[2].buffer.pointer = (void *)&idle_cpus;
> +	acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
> +}
> +
> +static void xen_acpi_pad_handle_notify(acpi_handle handle)
> +{
> +	int num_cpus;
> +
> +	num_cpus = xen_acpi_pad_pur(handle);
> +	if (num_cpus < 0)
> +		return;
> +
> +	mutex_lock(&xen_pad_lock);
> +	if (xen_pad_set_idle_cpus(num_cpus)) {
> +		mutex_unlock(&xen_pad_lock);
> +		return;
> +	}
> +
> +	num_cpus = xen_pad_get_idle_cpus();
> +	if (num_cpus < 0) {
> +		mutex_unlock(&xen_pad_lock);
> +		return;
> +	}
> +	mutex_unlock(&xen_pad_lock);
> +
> +	xen_acpi_pad_ost(handle, 0, num_cpus);
> +}
> +
> +static void xen_acpi_pad_notify(acpi_handle handle, u32 event,
> +	void *data)
> +{
> +	switch (event) {
> +	case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
> +		xen_acpi_pad_handle_notify(handle);
> +		break;
> +	default:
> +		pr_warn("Unsupported event [0x%x]\n", event);
> +		break;
> +	}
> +}
> +
> +static int xen_acpi_pad_add(struct acpi_device *device)
> +{
> +	acpi_status status;
> +
> +	strcpy(acpi_device_name(device), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
> +	strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);
> +
> +	status = acpi_install_notify_handler(device->handle,
> +		 ACPI_DEVICE_NOTIFY, xen_acpi_pad_notify, device);
> +	if (ACPI_FAILURE(status))
> +		return -ENODEV;
> +
> +	return 0;
> +}
> +
> +static int xen_acpi_pad_remove(struct acpi_device *device,
> +	int type)
> +{
> +	mutex_lock(&xen_pad_lock);
> +	xen_pad_set_idle_cpus(0);
> +	mutex_unlock(&xen_pad_lock);
> +
> +	acpi_remove_notify_handler(device->handle,
> +		ACPI_DEVICE_NOTIFY, xen_acpi_pad_notify);
> +	return 0;
> +}
> +
> +static const struct acpi_device_id pad_device_ids[] = {
> +	{"ACPI000C", 0},
> +	{"", 0},
> +};
> +
> +static struct acpi_driver xen_acpi_pad_driver = {
> +	.name = "processor_aggregator",
> +	.class = ACPI_PROCESSOR_AGGREGATOR_CLASS,
> +	.ids = pad_device_ids,
> +	.ops = {
> +		.add = xen_acpi_pad_add,
> +		.remove = xen_acpi_pad_remove,
> +	},
> +};
> +
> +static int __init xen_acpi_pad_init(void)
> +{
> +	int ret = -ENOSYS;
> +	unsigned int version = HYPERVISOR_xen_version(XENVER_version, NULL);

Heh. so if you run this on baremetal I wonder what will happen.

> +	unsigned int major = version >> 16;
> +	unsigned int minor = version & 0xffff;
> +
> +	/* Only DOM0 is responsible for Xen acpi pad */
> +	if (!xen_initial_domain())
> +		return -ENODEV;
> +

I think the check for version should happen here.

> +	/* Only Xen4.2 or later support Xen acpi pad */
> +	if (((major == 4) && (minor >= 2)) || (major > 4))
> +		ret = acpi_bus_register_driver(&xen_acpi_pad_driver);
> +
> +	return ret;
> +}
> +subsys_initcall(xen_acpi_pad_init);
> diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
> index 4755b5f..a3be54c 100644
> --- a/include/xen/interface/platform.h
> +++ b/include/xen/interface/platform.h
> @@ -324,6 +324,22 @@ struct xenpf_cpu_ol {
>  };
>  DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
>  
> +/*
> + * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd,
> + * which are already occupied at Xen hypervisor side.
> + */
> +#define XENPF_core_parking	60
> +struct xenpf_core_parking {
> +	/* IN variables */
> +#define XEN_CORE_PARKING_SET	1
> +#define XEN_CORE_PARKING_GET	2
> +	uint32_t type;
> +	/* IN variables:  set cpu nums expected to be idled */
> +	/* OUT variables: get cpu nums actually be idled */
> +	uint32_t idle_nums;
> +};
> +DEFINE_GUEST_HANDLE_STRUCT(xenpf_core_parking);
> +
>  struct xen_platform_op {
>  	uint32_t cmd;
>  	uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
> @@ -341,6 +357,7 @@ struct xen_platform_op {
>  		struct xenpf_set_processor_pminfo set_pminfo;
>  		struct xenpf_pcpuinfo          pcpu_info;
>  		struct xenpf_cpu_ol            cpu_ol;
> +		struct xenpf_core_parking      core_parking;
>  		uint8_t                        pad[128];
>  	} u;
>  };
> -- 
> 1.7.1


> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 16:54:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 16:54:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKVV-0006nm-4d; Fri, 02 Nov 2012 16:54:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUKVT-0006nf-9h
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 16:54:07 +0000
Received: from [85.158.137.99:39630] by server-16.bemta-3.messagelabs.com id
	3F/49-07461-EAAF3905; Fri, 02 Nov 2012 16:54:06 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1351875246!16624728!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9513 invoked from network); 2 Nov 2012 16:54:06 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-217.messagelabs.com with SMTP;
	2 Nov 2012 16:54:06 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 16:54:05 +0000
Message-Id: <509408E702000078000A6285@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 16:54:47 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Greg KH" <gregkh@linuxfoundation.org>
References: <5093947F02000078000A5F42@nat28.tlf.novell.com>
	<20121102162334.GB4093@kroah.com>
In-Reply-To: <20121102162334.GB4093@kroah.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, linux-usb@vger.kernel.org,
	xen-devel <xen-devel@lists.xen.org>,
	Randy Dunlap <rdunlap@xenotime.net>, stern@rowland.harvard.edu,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH,
 v3] fix build with XEN and EARLY_PRINTK_DBGP enabled but
 USB_SUPPORT disabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 02.11.12 at 17:23, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Fri, Nov 02, 2012 at 08:38:07AM +0000, Jan Beulich wrote:
>> Since there's no possible caller of dbgp_external_startup() and
> 
> <snip>
> 
> Please just send the incremental patch, in a format that I can apply it
> (hint, as an attachment like this I can't, as I would have to hand-edit
> the attachment, and I might get it wrong...)

Here you go:

fix build of EHCI debug port code when USB_CHIPIDEA but !USB_EHCI_HCD

Relax condition of building the reset interface stubs in
drivers/usb/early/ehci-dbgp.c from USB_EHCI_HCD to just USB, to also
cover the chipidea driver re-using code from ehci-hcd.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

---
 drivers/usb/early/ehci-dbgp.c       |   4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- 3.7-rc3.orig/drivers/usb/early/ehci-dbgp.c
+++ 3.7-rc3/drivers/usb/early/ehci-dbgp.c
@@ -974,7 +974,7 @@ struct console early_dbgp_console = {
 	.index =	-1,
 };
 
-#if IS_ENABLED(CONFIG_USB_EHCI_HCD)
+#if IS_ENABLED(CONFIG_USB)
 int dbgp_reset_prep(struct usb_hcd *hcd)
 {
 	int ret = xen_dbgp_reset_prep(hcd);
@@ -1008,7 +1008,7 @@ int dbgp_external_startup(struct usb_hcd
 	return xen_dbgp_external_startup(hcd) ?: _dbgp_external_startup();
 }
 EXPORT_SYMBOL_GPL(dbgp_external_startup);
-#endif /* USB_EHCI_HCD */
+#endif /* USB */
 
 #ifdef CONFIG_KGDB
 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 16:54:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 16:54:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKVV-0006nm-4d; Fri, 02 Nov 2012 16:54:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUKVT-0006nf-9h
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 16:54:07 +0000
Received: from [85.158.137.99:39630] by server-16.bemta-3.messagelabs.com id
	3F/49-07461-EAAF3905; Fri, 02 Nov 2012 16:54:06 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1351875246!16624728!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9513 invoked from network); 2 Nov 2012 16:54:06 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-217.messagelabs.com with SMTP;
	2 Nov 2012 16:54:06 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 16:54:05 +0000
Message-Id: <509408E702000078000A6285@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 16:54:47 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Greg KH" <gregkh@linuxfoundation.org>
References: <5093947F02000078000A5F42@nat28.tlf.novell.com>
	<20121102162334.GB4093@kroah.com>
In-Reply-To: <20121102162334.GB4093@kroah.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, linux-usb@vger.kernel.org,
	xen-devel <xen-devel@lists.xen.org>,
	Randy Dunlap <rdunlap@xenotime.net>, stern@rowland.harvard.edu,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH,
 v3] fix build with XEN and EARLY_PRINTK_DBGP enabled but
 USB_SUPPORT disabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 02.11.12 at 17:23, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Fri, Nov 02, 2012 at 08:38:07AM +0000, Jan Beulich wrote:
>> Since there's no possible caller of dbgp_external_startup() and
> 
> <snip>
> 
> Please just send the incremental patch, in a format that I can apply it
> (hint, as an attachment like this I can't, as I would have to hand-edit
> the attachment, and I might get it wrong...)

Here you go:

fix build of EHCI debug port code when USB_CHIPIDEA but !USB_EHCI_HCD

Relax condition of building the reset interface stubs in
drivers/usb/early/ehci-dbgp.c from USB_EHCI_HCD to just USB, to also
cover the chipidea driver re-using code from ehci-hcd.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

---
 drivers/usb/early/ehci-dbgp.c       |   4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- 3.7-rc3.orig/drivers/usb/early/ehci-dbgp.c
+++ 3.7-rc3/drivers/usb/early/ehci-dbgp.c
@@ -974,7 +974,7 @@ struct console early_dbgp_console = {
 	.index =	-1,
 };
 
-#if IS_ENABLED(CONFIG_USB_EHCI_HCD)
+#if IS_ENABLED(CONFIG_USB)
 int dbgp_reset_prep(struct usb_hcd *hcd)
 {
 	int ret = xen_dbgp_reset_prep(hcd);
@@ -1008,7 +1008,7 @@ int dbgp_external_startup(struct usb_hcd
 	return xen_dbgp_external_startup(hcd) ?: _dbgp_external_startup();
 }
 EXPORT_SYMBOL_GPL(dbgp_external_startup);
-#endif /* USB_EHCI_HCD */
+#endif /* USB */
 
 #ifdef CONFIG_KGDB
 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 16:56:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 16:56:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKXl-0006uK-LV; Fri, 02 Nov 2012 16:56:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUKXj-0006uD-QN
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 16:56:27 +0000
Received: from [85.158.137.99:50045] by server-2.bemta-3.messagelabs.com id
	15/50-04744-B3BF3905; Fri, 02 Nov 2012 16:56:27 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1351875386!14343005!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31512 invoked from network); 2 Nov 2012 16:56:26 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-217.messagelabs.com with SMTP;
	2 Nov 2012 16:56:26 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 16:56:25 +0000
Message-Id: <5094097302000078000A6288@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 16:57:07 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad@kernel.org>
References: <1351519698-11069-1-git-send-email-konrad.wilk@oracle.com>
	<1351519698-11069-2-git-send-email-konrad.wilk@oracle.com>
	<20121030154450.GA3000@phenom.dumpdata.com>
	<5090F5AA02000078000A5A0B@nat28.tlf.novell.com>
	<20121102164409.GB27213@konrad-lan.dumpdata.com>
In-Reply-To: <20121102164409.GB27213@konrad-lan.dumpdata.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	linux-kernel@vger.kernel.org, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] xen/hypercall: fix hypercall fallback
 code for very old hypervisors
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 02.11.12 at 17:44, Konrad Rzeszutek Wilk <konrad@kernel.org> wrote:
> --- a/arch/x86/include/asm/xen/hypercall.h
> +++ b/arch/x86/include/asm/xen/hypercall.h
> @@ -359,18 +359,14 @@ HYPERVISOR_update_va_mapping(unsigned long va, pte_t new_val,
>  		return _hypercall4(int, update_va_mapping, va,
>  				   new_val.pte, new_val.pte >> 32, flags);
>  }
> +extern int __must_check xen_HYPERVISOR_event_channel_op_compat(int, void *);

Why don't you drop the HYPERVISOR_ now that you added the xen_?

>...
> +EXPORT_SYMBOL_GPL(xen_HYPERVISOR_event_channel_op_compat);

While this export is necessary, ...

>...
> +EXPORT_SYMBOL_GPL(xen_HYPERVISOR_physdev_op_compat);

... I would recommend not adding this one without need.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 16:56:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 16:56:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKXl-0006uK-LV; Fri, 02 Nov 2012 16:56:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUKXj-0006uD-QN
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 16:56:27 +0000
Received: from [85.158.137.99:50045] by server-2.bemta-3.messagelabs.com id
	15/50-04744-B3BF3905; Fri, 02 Nov 2012 16:56:27 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1351875386!14343005!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31512 invoked from network); 2 Nov 2012 16:56:26 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-217.messagelabs.com with SMTP;
	2 Nov 2012 16:56:26 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 16:56:25 +0000
Message-Id: <5094097302000078000A6288@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 16:57:07 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad@kernel.org>
References: <1351519698-11069-1-git-send-email-konrad.wilk@oracle.com>
	<1351519698-11069-2-git-send-email-konrad.wilk@oracle.com>
	<20121030154450.GA3000@phenom.dumpdata.com>
	<5090F5AA02000078000A5A0B@nat28.tlf.novell.com>
	<20121102164409.GB27213@konrad-lan.dumpdata.com>
In-Reply-To: <20121102164409.GB27213@konrad-lan.dumpdata.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	linux-kernel@vger.kernel.org, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] xen/hypercall: fix hypercall fallback
 code for very old hypervisors
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 02.11.12 at 17:44, Konrad Rzeszutek Wilk <konrad@kernel.org> wrote:
> --- a/arch/x86/include/asm/xen/hypercall.h
> +++ b/arch/x86/include/asm/xen/hypercall.h
> @@ -359,18 +359,14 @@ HYPERVISOR_update_va_mapping(unsigned long va, pte_t new_val,
>  		return _hypercall4(int, update_va_mapping, va,
>  				   new_val.pte, new_val.pte >> 32, flags);
>  }
> +extern int __must_check xen_HYPERVISOR_event_channel_op_compat(int, void *);

Why don't you drop the HYPERVISOR_ now that you added the xen_?

>...
> +EXPORT_SYMBOL_GPL(xen_HYPERVISOR_event_channel_op_compat);

While this export is necessary, ...

>...
> +EXPORT_SYMBOL_GPL(xen_HYPERVISOR_physdev_op_compat);

... I would recommend not adding this one without need.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 17:02:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 17:02:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKd0-0007IX-Dl; Fri, 02 Nov 2012 17:01:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <gregkh@linuxfoundation.org>) id 1TUKcz-0007IS-Qd
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 17:01:54 +0000
Received: from [85.158.143.35:18132] by server-1.bemta-4.messagelabs.com id
	7E/64-27934-18CF3905; Fri, 02 Nov 2012 17:01:53 +0000
X-Env-Sender: gregkh@linuxfoundation.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1351875685!11940922!1
X-Originating-IP: [209.85.220.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18063 invoked from network); 2 Nov 2012 17:01:27 -0000
Received: from mail-pa0-f45.google.com (HELO mail-pa0-f45.google.com)
	(209.85.220.45)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 17:01:27 -0000
Received: by mail-pa0-f45.google.com with SMTP id fb10so2689286pad.32
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 10:01:25 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent
	:x-gm-message-state;
	bh=GrUMntppyfIslzmXaAb4GNoKn4oNz2aLTRspMPjlJeY=;
	b=HDvOA320hE2xRBpl7jvAFVZcqDpjQziLR55Av+JUtGST0aO0tXhYmF7hEfLHZLt69i
	QwnjbXI02HLNYbTsKjZ3Tyrq5dzwGLiWt0He9rEKh/ZGSKo1u17C1ytpJ3PGfwdJvbRZ
	AilpVb859xtV0ytMBCHWkDmRdU2rwLlKgIy4/PgU02oOTcjk0jhh+d0DlOZxRYJnPVIc
	T7srvdS8F0LDcSpGgbmsjQOyl1PmGRx0IbpbM2dYCdDfXVCNxl5bwq46HtFHAMk3ASAO
	Pm3nB7ezaE+HYQRqFTq3BN2bbSPyfmWUZtl7qK51KYOUUptgmQh52YnPFYTwujiVpVpl
	UdzQ==
Received: by 10.66.83.201 with SMTP id s9mr6801792pay.74.1351875684925;
	Fri, 02 Nov 2012 10:01:24 -0700 (PDT)
Received: from localhost (c-67-168-183-230.hsd1.wa.comcast.net.
	[67.168.183.230])
	by mx.google.com with ESMTPS id v2sm4274992paz.27.2012.11.02.10.01.22
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 02 Nov 2012 10:01:23 -0700 (PDT)
Date: Fri, 2 Nov 2012 10:01:26 -0700
From: Greg KH <gregkh@linuxfoundation.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121102170126.GA8413@kroah.com>
References: <5093947F02000078000A5F42@nat28.tlf.novell.com>
	<20121102162334.GB4093@kroah.com>
	<509408E702000078000A6285@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509408E702000078000A6285@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Gm-Message-State: ALoCoQkF9X+e8wzGt46XLkltisoTKAgIV7KsYfglGMwIZxXq3qld0hXqC35QeilK8xkBUYIfaIXQ
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, linux-usb@vger.kernel.org,
	xen-devel <xen-devel@lists.xen.org>,
	Randy Dunlap <rdunlap@xenotime.net>, stern@rowland.harvard.edu,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH,
 v3] fix build with XEN and EARLY_PRINTK_DBGP enabled but
 USB_SUPPORT disabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 02, 2012 at 04:54:47PM +0000, Jan Beulich wrote:
> >>> On 02.11.12 at 17:23, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Fri, Nov 02, 2012 at 08:38:07AM +0000, Jan Beulich wrote:
> >> Since there's no possible caller of dbgp_external_startup() and
> > 
> > <snip>
> > 
> > Please just send the incremental patch, in a format that I can apply it
> > (hint, as an attachment like this I can't, as I would have to hand-edit
> > the attachment, and I might get it wrong...)
> 
> Here you go:
> 
> fix build of EHCI debug port code when USB_CHIPIDEA but !USB_EHCI_HCD
> 
> Relax condition of building the reset interface stubs in
> drivers/usb/early/ehci-dbgp.c from USB_EHCI_HCD to just USB, to also
> cover the chipidea driver re-using code from ehci-hcd.

Ok, I'm going to be a pain here, but this isn't in a form I can apply
it.  I would have to edit this by hand and then run it through git,
making it a pain to apply.  Please be nice to overworked maintainers and
make it easy to apply your patches, send them in a format that they
don't have to edit _anything_.

Third times a charm?

greg k-h

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 17:02:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 17:02:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKd0-0007IX-Dl; Fri, 02 Nov 2012 17:01:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <gregkh@linuxfoundation.org>) id 1TUKcz-0007IS-Qd
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 17:01:54 +0000
Received: from [85.158.143.35:18132] by server-1.bemta-4.messagelabs.com id
	7E/64-27934-18CF3905; Fri, 02 Nov 2012 17:01:53 +0000
X-Env-Sender: gregkh@linuxfoundation.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1351875685!11940922!1
X-Originating-IP: [209.85.220.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18063 invoked from network); 2 Nov 2012 17:01:27 -0000
Received: from mail-pa0-f45.google.com (HELO mail-pa0-f45.google.com)
	(209.85.220.45)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 17:01:27 -0000
Received: by mail-pa0-f45.google.com with SMTP id fb10so2689286pad.32
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 10:01:25 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent
	:x-gm-message-state;
	bh=GrUMntppyfIslzmXaAb4GNoKn4oNz2aLTRspMPjlJeY=;
	b=HDvOA320hE2xRBpl7jvAFVZcqDpjQziLR55Av+JUtGST0aO0tXhYmF7hEfLHZLt69i
	QwnjbXI02HLNYbTsKjZ3Tyrq5dzwGLiWt0He9rEKh/ZGSKo1u17C1ytpJ3PGfwdJvbRZ
	AilpVb859xtV0ytMBCHWkDmRdU2rwLlKgIy4/PgU02oOTcjk0jhh+d0DlOZxRYJnPVIc
	T7srvdS8F0LDcSpGgbmsjQOyl1PmGRx0IbpbM2dYCdDfXVCNxl5bwq46HtFHAMk3ASAO
	Pm3nB7ezaE+HYQRqFTq3BN2bbSPyfmWUZtl7qK51KYOUUptgmQh52YnPFYTwujiVpVpl
	UdzQ==
Received: by 10.66.83.201 with SMTP id s9mr6801792pay.74.1351875684925;
	Fri, 02 Nov 2012 10:01:24 -0700 (PDT)
Received: from localhost (c-67-168-183-230.hsd1.wa.comcast.net.
	[67.168.183.230])
	by mx.google.com with ESMTPS id v2sm4274992paz.27.2012.11.02.10.01.22
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 02 Nov 2012 10:01:23 -0700 (PDT)
Date: Fri, 2 Nov 2012 10:01:26 -0700
From: Greg KH <gregkh@linuxfoundation.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121102170126.GA8413@kroah.com>
References: <5093947F02000078000A5F42@nat28.tlf.novell.com>
	<20121102162334.GB4093@kroah.com>
	<509408E702000078000A6285@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509408E702000078000A6285@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Gm-Message-State: ALoCoQkF9X+e8wzGt46XLkltisoTKAgIV7KsYfglGMwIZxXq3qld0hXqC35QeilK8xkBUYIfaIXQ
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, linux-usb@vger.kernel.org,
	xen-devel <xen-devel@lists.xen.org>,
	Randy Dunlap <rdunlap@xenotime.net>, stern@rowland.harvard.edu,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH,
 v3] fix build with XEN and EARLY_PRINTK_DBGP enabled but
 USB_SUPPORT disabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 02, 2012 at 04:54:47PM +0000, Jan Beulich wrote:
> >>> On 02.11.12 at 17:23, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Fri, Nov 02, 2012 at 08:38:07AM +0000, Jan Beulich wrote:
> >> Since there's no possible caller of dbgp_external_startup() and
> > 
> > <snip>
> > 
> > Please just send the incremental patch, in a format that I can apply it
> > (hint, as an attachment like this I can't, as I would have to hand-edit
> > the attachment, and I might get it wrong...)
> 
> Here you go:
> 
> fix build of EHCI debug port code when USB_CHIPIDEA but !USB_EHCI_HCD
> 
> Relax condition of building the reset interface stubs in
> drivers/usb/early/ehci-dbgp.c from USB_EHCI_HCD to just USB, to also
> cover the chipidea driver re-using code from ehci-hcd.

Ok, I'm going to be a pain here, but this isn't in a form I can apply
it.  I would have to edit this by hand and then run it through git,
making it a pain to apply.  Please be nice to overworked maintainers and
make it easy to apply your patches, send them in a format that they
don't have to edit _anything_.

Third times a charm?

greg k-h

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 17:06:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 17:06:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKgt-0007R8-2X; Fri, 02 Nov 2012 17:05:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.r.wilk@gmail.com>) id 1TUKgr-0007R2-6o
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 17:05:53 +0000
Received: from [85.158.137.99:62255] by server-12.bemta-3.messagelabs.com id
	DF/95-22757-07DF3905; Fri, 02 Nov 2012 17:05:52 +0000
X-Env-Sender: konrad.r.wilk@gmail.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1351875950!14344152!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29476 invoked from network); 2 Nov 2012 17:05:51 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 17:05:51 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl15so4955304vcb.32
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 10:05:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=4EY7019Jkj/abK6tOYRUBI9cV+WMxlsJRbC48Enf+1Q=;
	b=lUG5QweZpCvKoAl6mqqVMFbJwYH28B9NuSVMhsQ03FOLHLaaRRqjryIcuqOVl99lCs
	4/cg7MrgahTJ1mIiIKM5flfqqKLtuoodq1dK6Ne750hskS+tzSfzqHmetfNmNXrDGTil
	1omAe5wsGZVMFahfoxeAEfNGKBNw1LHjqv+JKJu0DVsPS5I4Z+c3K1EEezuO7oqyQ9+c
	yLwh4gzDNv+6T11yLmS3j45WKGhZFl71/J48Hqy30VBFhouXYrahgSTl73iNDVJLMx1a
	uUe+Cs/Q1lAMQBv/mWG6+dBKWg8QDzU2+a52lm4OKHBYH30tUWBxeWPtbQb9H0mKLIsB
	f6jg==
Received: by 10.220.119.196 with SMTP id a4mr2460670vcr.19.1351875950031;
	Fri, 02 Nov 2012 10:05:50 -0700 (PDT)
Received: from konrad-lan.dumpdata.com
	(pool-64-222-209-26.port.east.myfairpoint.net. [64.222.209.26])
	by mx.google.com with ESMTPS id l15sm5811203vdt.14.2012.11.02.10.05.48
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 02 Nov 2012 10:05:49 -0700 (PDT)
Date: Fri, 2 Nov 2012 13:05:46 -0400
From: Konrad Rzeszutek Wilk <konrad@darnok.org>
To: Roger Pau Monne <roger.pau@citrix.com>
Message-ID: <20121102170543.GA1853@konrad-lan.dumpdata.com>
References: <1351870984-22078-1-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1351870984-22078-1-git-send-email-roger.pau@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: konrad.wilk@oracle.com, linux-kernel@vger.kernel.org,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen-blk: persistent-grants fixes
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 02, 2012 at 04:43:04PM +0100, Roger Pau Monne wrote:
> This patch contains fixes for persistent grants implementation v2:
> 
>  * handle == 0 is a valid handle, so initialize grants in blkback
>    setting the handle to BLKBACK_INVALID_HANDLE instead of 0. Reported
>    by Konrad Rzeszutek Wilk.
> 
>  * new_map is a boolean, use "true" or "false" instead of 1 and 0.
>    Reported by Konrad Rzeszutek Wilk.
> 
>  * blkfront announces the persistent-grants feature as
>    feature-persistent-grants, use feature-persistent instead which is
>    consistent with blkback and the public Xen headers.
> 
>  * Add a consistency check in blkfront to make sure we don't try to
>    access segments that have not been set.

Looks good.. but
> 
> Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
> Cc: <konrad.wilk@oracle.com>
> Cc: <linux-kernel@vger.kernel.org>
> ---
>  drivers/block/xen-blkback/blkback.c |   15 +++++++++------
>  drivers/block/xen-blkback/xenbus.c  |    2 +-
>  drivers/block/xen-blkfront.c        |    3 ++-
>  3 files changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
> index 663d42d..a059616 100644
> --- a/drivers/block/xen-blkback/blkback.c
> +++ b/drivers/block/xen-blkback/blkback.c
> @@ -503,7 +503,7 @@ static int xen_blkbk_map(struct blkif_request *req,
>  			 * We are using persistent grants and
>  			 * the grant is already mapped
>  			 */
> -			new_map = 0;
> +			new_map = false;
>  		} else if (use_persistent_gnts &&
>  			   blkif->persistent_gnt_c <
>  			   max_mapped_grant_pages(blkif->blk_protocol)) {
> @@ -511,8 +511,8 @@ static int xen_blkbk_map(struct blkif_request *req,
>  			 * We are using persistent grants, the grant is
>  			 * not mapped but we have room for it
>  			 */
> -			new_map = 1;
> -			persistent_gnt = kzalloc(
> +			new_map = true;
> +			persistent_gnt = kmalloc(

Why do we want to use kmalloc instead of kzalloc?

>  				sizeof(struct persistent_gnt),
>  				GFP_KERNEL);
>  			if (!persistent_gnt)
> @@ -523,6 +523,7 @@ static int xen_blkbk_map(struct blkif_request *req,
>  				return -ENOMEM;
>  			}
>  			persistent_gnt->gnt = req->u.rw.seg[i].gref;
> +			persistent_gnt->handle = BLKBACK_INVALID_HANDLE;
>  
>  			pages_to_gnt[segs_to_map] =
>  				persistent_gnt->page;
> @@ -547,7 +548,7 @@ static int xen_blkbk_map(struct blkif_request *req,
>  				pr_alert(DRV_PFX " domain %u, device %#x is using maximum number of persistent grants\n",
>  					 blkif->domid, blkif->vbd.handle);
>  			}
> -			new_map = 1;
> +			new_map = true;
>  			pages[i] = blkbk->pending_page(pending_req, i);
>  			addr = vaddr(pending_req, i);
>  			pages_to_gnt[segs_to_map] =
> @@ -584,7 +585,8 @@ static int xen_blkbk_map(struct blkif_request *req,
>  	 */
>  	bitmap_zero(pending_req->unmap_seg, BLKIF_MAX_SEGMENTS_PER_REQUEST);
>  	for (i = 0, j = 0; i < nseg; i++) {
> -		if (!persistent_gnts[i] || !persistent_gnts[i]->handle) {
> +		if (!persistent_gnts[i] ||
> +		    persistent_gnts[i]->handle == BLKBACK_INVALID_HANDLE) {
>  			/* This is a newly mapped grant */
>  			BUG_ON(j >= segs_to_map);
>  			if (unlikely(map[j].status != 0)) {
> @@ -601,7 +603,8 @@ static int xen_blkbk_map(struct blkif_request *req,
>  			}
>  		}
>  		if (persistent_gnts[i]) {
> -			if (!persistent_gnts[i]->handle) {
> +			if (persistent_gnts[i]->handle ==
> +			    BLKBACK_INVALID_HANDLE) {
>  				/*
>  				 * If this is a new persistent grant
>  				 * save the handler
> diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
> index b225026..a03ecbb 100644
> --- a/drivers/block/xen-blkback/xenbus.c
> +++ b/drivers/block/xen-blkback/xenbus.c
> @@ -760,7 +760,7 @@ static int connect_ring(struct backend_info *be)
>  		return -1;
>  	}
>  	err = xenbus_gather(XBT_NIL, dev->otherend,
> -			    "feature-persistent-grants", "%u",
> +			    "feature-persistent", "%u",
>  			    &pers_grants, NULL);
>  	if (err)
>  		pers_grants = 0;
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index 911d733..f1de806 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -852,6 +852,7 @@ static void blkif_completion(struct blk_shadow *s, struct blkfront_info *info,
>  		rq_for_each_segment(bvec, s->request, iter) {
>  			BUG_ON((bvec->bv_offset + bvec->bv_len) > PAGE_SIZE);
>  			i = offset >> PAGE_SHIFT;
> +			BUG_ON(i >= s->req.u.rw.nr_segments);
>  			shared_data = kmap_atomic(
>  				pfn_to_page(s->grants_used[i]->pfn));
>  			bvec_data = bvec_kmap_irq(bvec, &flags);
> @@ -1069,7 +1070,7 @@ again:
>  		goto abort_transaction;
>  	}
>  	err = xenbus_printf(xbt, dev->nodename,
> -			    "feature-persistent-grants", "%u", 1);
> +			    "feature-persistent", "%u", 1);
>  	if (err)
>  		dev_warn(&dev->dev,
>  			 "writing persistent grants feature to xenbus");
> -- 
> 1.7.7.5 (Apple Git-26)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 17:06:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 17:06:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKgt-0007R8-2X; Fri, 02 Nov 2012 17:05:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.r.wilk@gmail.com>) id 1TUKgr-0007R2-6o
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 17:05:53 +0000
Received: from [85.158.137.99:62255] by server-12.bemta-3.messagelabs.com id
	DF/95-22757-07DF3905; Fri, 02 Nov 2012 17:05:52 +0000
X-Env-Sender: konrad.r.wilk@gmail.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1351875950!14344152!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29476 invoked from network); 2 Nov 2012 17:05:51 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 17:05:51 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl15so4955304vcb.32
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 10:05:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=4EY7019Jkj/abK6tOYRUBI9cV+WMxlsJRbC48Enf+1Q=;
	b=lUG5QweZpCvKoAl6mqqVMFbJwYH28B9NuSVMhsQ03FOLHLaaRRqjryIcuqOVl99lCs
	4/cg7MrgahTJ1mIiIKM5flfqqKLtuoodq1dK6Ne750hskS+tzSfzqHmetfNmNXrDGTil
	1omAe5wsGZVMFahfoxeAEfNGKBNw1LHjqv+JKJu0DVsPS5I4Z+c3K1EEezuO7oqyQ9+c
	yLwh4gzDNv+6T11yLmS3j45WKGhZFl71/J48Hqy30VBFhouXYrahgSTl73iNDVJLMx1a
	uUe+Cs/Q1lAMQBv/mWG6+dBKWg8QDzU2+a52lm4OKHBYH30tUWBxeWPtbQb9H0mKLIsB
	f6jg==
Received: by 10.220.119.196 with SMTP id a4mr2460670vcr.19.1351875950031;
	Fri, 02 Nov 2012 10:05:50 -0700 (PDT)
Received: from konrad-lan.dumpdata.com
	(pool-64-222-209-26.port.east.myfairpoint.net. [64.222.209.26])
	by mx.google.com with ESMTPS id l15sm5811203vdt.14.2012.11.02.10.05.48
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 02 Nov 2012 10:05:49 -0700 (PDT)
Date: Fri, 2 Nov 2012 13:05:46 -0400
From: Konrad Rzeszutek Wilk <konrad@darnok.org>
To: Roger Pau Monne <roger.pau@citrix.com>
Message-ID: <20121102170543.GA1853@konrad-lan.dumpdata.com>
References: <1351870984-22078-1-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1351870984-22078-1-git-send-email-roger.pau@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: konrad.wilk@oracle.com, linux-kernel@vger.kernel.org,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen-blk: persistent-grants fixes
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 02, 2012 at 04:43:04PM +0100, Roger Pau Monne wrote:
> This patch contains fixes for persistent grants implementation v2:
> 
>  * handle == 0 is a valid handle, so initialize grants in blkback
>    setting the handle to BLKBACK_INVALID_HANDLE instead of 0. Reported
>    by Konrad Rzeszutek Wilk.
> 
>  * new_map is a boolean, use "true" or "false" instead of 1 and 0.
>    Reported by Konrad Rzeszutek Wilk.
> 
>  * blkfront announces the persistent-grants feature as
>    feature-persistent-grants, use feature-persistent instead which is
>    consistent with blkback and the public Xen headers.
> 
>  * Add a consistency check in blkfront to make sure we don't try to
>    access segments that have not been set.

Looks good.. but
> 
> Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
> Cc: <konrad.wilk@oracle.com>
> Cc: <linux-kernel@vger.kernel.org>
> ---
>  drivers/block/xen-blkback/blkback.c |   15 +++++++++------
>  drivers/block/xen-blkback/xenbus.c  |    2 +-
>  drivers/block/xen-blkfront.c        |    3 ++-
>  3 files changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
> index 663d42d..a059616 100644
> --- a/drivers/block/xen-blkback/blkback.c
> +++ b/drivers/block/xen-blkback/blkback.c
> @@ -503,7 +503,7 @@ static int xen_blkbk_map(struct blkif_request *req,
>  			 * We are using persistent grants and
>  			 * the grant is already mapped
>  			 */
> -			new_map = 0;
> +			new_map = false;
>  		} else if (use_persistent_gnts &&
>  			   blkif->persistent_gnt_c <
>  			   max_mapped_grant_pages(blkif->blk_protocol)) {
> @@ -511,8 +511,8 @@ static int xen_blkbk_map(struct blkif_request *req,
>  			 * We are using persistent grants, the grant is
>  			 * not mapped but we have room for it
>  			 */
> -			new_map = 1;
> -			persistent_gnt = kzalloc(
> +			new_map = true;
> +			persistent_gnt = kmalloc(

Why do we want to use kmalloc instead of kzalloc?

>  				sizeof(struct persistent_gnt),
>  				GFP_KERNEL);
>  			if (!persistent_gnt)
> @@ -523,6 +523,7 @@ static int xen_blkbk_map(struct blkif_request *req,
>  				return -ENOMEM;
>  			}
>  			persistent_gnt->gnt = req->u.rw.seg[i].gref;
> +			persistent_gnt->handle = BLKBACK_INVALID_HANDLE;
>  
>  			pages_to_gnt[segs_to_map] =
>  				persistent_gnt->page;
> @@ -547,7 +548,7 @@ static int xen_blkbk_map(struct blkif_request *req,
>  				pr_alert(DRV_PFX " domain %u, device %#x is using maximum number of persistent grants\n",
>  					 blkif->domid, blkif->vbd.handle);
>  			}
> -			new_map = 1;
> +			new_map = true;
>  			pages[i] = blkbk->pending_page(pending_req, i);
>  			addr = vaddr(pending_req, i);
>  			pages_to_gnt[segs_to_map] =
> @@ -584,7 +585,8 @@ static int xen_blkbk_map(struct blkif_request *req,
>  	 */
>  	bitmap_zero(pending_req->unmap_seg, BLKIF_MAX_SEGMENTS_PER_REQUEST);
>  	for (i = 0, j = 0; i < nseg; i++) {
> -		if (!persistent_gnts[i] || !persistent_gnts[i]->handle) {
> +		if (!persistent_gnts[i] ||
> +		    persistent_gnts[i]->handle == BLKBACK_INVALID_HANDLE) {
>  			/* This is a newly mapped grant */
>  			BUG_ON(j >= segs_to_map);
>  			if (unlikely(map[j].status != 0)) {
> @@ -601,7 +603,8 @@ static int xen_blkbk_map(struct blkif_request *req,
>  			}
>  		}
>  		if (persistent_gnts[i]) {
> -			if (!persistent_gnts[i]->handle) {
> +			if (persistent_gnts[i]->handle ==
> +			    BLKBACK_INVALID_HANDLE) {
>  				/*
>  				 * If this is a new persistent grant
>  				 * save the handler
> diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
> index b225026..a03ecbb 100644
> --- a/drivers/block/xen-blkback/xenbus.c
> +++ b/drivers/block/xen-blkback/xenbus.c
> @@ -760,7 +760,7 @@ static int connect_ring(struct backend_info *be)
>  		return -1;
>  	}
>  	err = xenbus_gather(XBT_NIL, dev->otherend,
> -			    "feature-persistent-grants", "%u",
> +			    "feature-persistent", "%u",
>  			    &pers_grants, NULL);
>  	if (err)
>  		pers_grants = 0;
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index 911d733..f1de806 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -852,6 +852,7 @@ static void blkif_completion(struct blk_shadow *s, struct blkfront_info *info,
>  		rq_for_each_segment(bvec, s->request, iter) {
>  			BUG_ON((bvec->bv_offset + bvec->bv_len) > PAGE_SIZE);
>  			i = offset >> PAGE_SHIFT;
> +			BUG_ON(i >= s->req.u.rw.nr_segments);
>  			shared_data = kmap_atomic(
>  				pfn_to_page(s->grants_used[i]->pfn));
>  			bvec_data = bvec_kmap_irq(bvec, &flags);
> @@ -1069,7 +1070,7 @@ again:
>  		goto abort_transaction;
>  	}
>  	err = xenbus_printf(xbt, dev->nodename,
> -			    "feature-persistent-grants", "%u", 1);
> +			    "feature-persistent", "%u", 1);
>  	if (err)
>  		dev_warn(&dev->dev,
>  			 "writing persistent grants feature to xenbus");
> -- 
> 1.7.7.5 (Apple Git-26)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 17:07:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 17:07:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKht-0007WS-Mk; Fri, 02 Nov 2012 17:06:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUKhr-0007WE-V0
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 17:06:56 +0000
Received: from [85.158.143.99:15775] by server-1.bemta-4.messagelabs.com id
	14/F8-27934-FADF3905; Fri, 02 Nov 2012 17:06:55 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1351876013!20879331!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24385 invoked from network); 2 Nov 2012 17:06:53 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-216.messagelabs.com with SMTP;
	2 Nov 2012 17:06:53 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 17:06:53 +0000
Message-Id: <50940BE702000078000A62AD@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 17:07:35 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Greg KH" <gregkh@linuxfoundation.org>
References: <5093947F02000078000A5F42@nat28.tlf.novell.com>
	<20121102162334.GB4093@kroah.com>
	<509408E702000078000A6285@nat28.tlf.novell.com>
	<20121102170126.GA8413@kroah.com>
In-Reply-To: <20121102170126.GA8413@kroah.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, linux-usb@vger.kernel.org,
	xen-devel <xen-devel@lists.xen.org>,
	Randy Dunlap <rdunlap@xenotime.net>, stern@rowland.harvard.edu,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH,
 v3] fix build with XEN and EARLY_PRINTK_DBGP enabled but
 USB_SUPPORT disabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 02.11.12 at 18:01, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Fri, Nov 02, 2012 at 04:54:47PM +0000, Jan Beulich wrote:
>> >>> On 02.11.12 at 17:23, Greg KH <gregkh@linuxfoundation.org> wrote:
>> > On Fri, Nov 02, 2012 at 08:38:07AM +0000, Jan Beulich wrote:
>> >> Since there's no possible caller of dbgp_external_startup() and
>> > 
>> > <snip>
>> > 
>> > Please just send the incremental patch, in a format that I can apply it
>> > (hint, as an attachment like this I can't, as I would have to hand-edit
>> > the attachment, and I might get it wrong...)
>> 
>> Here you go:
>> 
>> fix build of EHCI debug port code when USB_CHIPIDEA but !USB_EHCI_HCD
>> 
>> Relax condition of building the reset interface stubs in
>> drivers/usb/early/ehci-dbgp.c from USB_EHCI_HCD to just USB, to also
>> cover the chipidea driver re-using code from ehci-hcd.
> 
> Ok, I'm going to be a pain here, but this isn't in a form I can apply
> it.  I would have to edit this by hand and then run it through git,
> making it a pain to apply.  Please be nice to overworked maintainers and
> make it easy to apply your patches, send them in a format that they
> don't have to edit _anything_.
> 
> Third times a charm?

Assuming (since you didn't mention what's wrong) all this is about
is the fact that the mail contains other text besides the patch, I'll
resend the patch alone. If that's not your issue, you'll have to
tell me what it is I did wrong.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 17:07:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 17:07:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKht-0007WS-Mk; Fri, 02 Nov 2012 17:06:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUKhr-0007WE-V0
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 17:06:56 +0000
Received: from [85.158.143.99:15775] by server-1.bemta-4.messagelabs.com id
	14/F8-27934-FADF3905; Fri, 02 Nov 2012 17:06:55 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1351876013!20879331!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24385 invoked from network); 2 Nov 2012 17:06:53 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-216.messagelabs.com with SMTP;
	2 Nov 2012 17:06:53 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 17:06:53 +0000
Message-Id: <50940BE702000078000A62AD@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 17:07:35 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Greg KH" <gregkh@linuxfoundation.org>
References: <5093947F02000078000A5F42@nat28.tlf.novell.com>
	<20121102162334.GB4093@kroah.com>
	<509408E702000078000A6285@nat28.tlf.novell.com>
	<20121102170126.GA8413@kroah.com>
In-Reply-To: <20121102170126.GA8413@kroah.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, linux-usb@vger.kernel.org,
	xen-devel <xen-devel@lists.xen.org>,
	Randy Dunlap <rdunlap@xenotime.net>, stern@rowland.harvard.edu,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH,
 v3] fix build with XEN and EARLY_PRINTK_DBGP enabled but
 USB_SUPPORT disabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 02.11.12 at 18:01, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Fri, Nov 02, 2012 at 04:54:47PM +0000, Jan Beulich wrote:
>> >>> On 02.11.12 at 17:23, Greg KH <gregkh@linuxfoundation.org> wrote:
>> > On Fri, Nov 02, 2012 at 08:38:07AM +0000, Jan Beulich wrote:
>> >> Since there's no possible caller of dbgp_external_startup() and
>> > 
>> > <snip>
>> > 
>> > Please just send the incremental patch, in a format that I can apply it
>> > (hint, as an attachment like this I can't, as I would have to hand-edit
>> > the attachment, and I might get it wrong...)
>> 
>> Here you go:
>> 
>> fix build of EHCI debug port code when USB_CHIPIDEA but !USB_EHCI_HCD
>> 
>> Relax condition of building the reset interface stubs in
>> drivers/usb/early/ehci-dbgp.c from USB_EHCI_HCD to just USB, to also
>> cover the chipidea driver re-using code from ehci-hcd.
> 
> Ok, I'm going to be a pain here, but this isn't in a form I can apply
> it.  I would have to edit this by hand and then run it through git,
> making it a pain to apply.  Please be nice to overworked maintainers and
> make it easy to apply your patches, send them in a format that they
> don't have to edit _anything_.
> 
> Third times a charm?

Assuming (since you didn't mention what's wrong) all this is about
is the fact that the mail contains other text besides the patch, I'll
resend the patch alone. If that's not your issue, you'll have to
tell me what it is I did wrong.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 17:08:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 17:08:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKjH-0007eD-6Y; Fri, 02 Nov 2012 17:08:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUKjG-0007e6-Bm
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 17:08:22 +0000
Received: from [85.158.143.99:46405] by server-2.bemta-4.messagelabs.com id
	92/8A-28922-50EF3905; Fri, 02 Nov 2012 17:08:21 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1351876100!28382418!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27936 invoked from network); 2 Nov 2012 17:08:21 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-216.messagelabs.com with SMTP;
	2 Nov 2012 17:08:21 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 17:08:19 +0000
Message-Id: <50940C3C02000078000A62B0@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 17:09:00 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <gregkh@linuxfoundation.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, linux-usb@vger.kernel.org,
	xen-devel <xen-devel@lists.xen.org>,
	Randy Dunlap <rdunlap@xenotime.net>, stern@rowland.harvard.edu,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH] fix build of EHCI debug port code when
 USB_CHIPIDEA but !USB_EHCI_HCD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Relax condition of building the reset interface stubs in
drivers/usb/early/ehci-dbgp.c from USB_EHCI_HCD to just USB, to also
cover the chipidea driver re-using code from ehci-hcd.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

---
 drivers/usb/early/ehci-dbgp.c       |   4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- 3.7-rc3.orig/drivers/usb/early/ehci-dbgp.c
+++ 3.7-rc3/drivers/usb/early/ehci-dbgp.c
@@ -974,7 +974,7 @@ struct console early_dbgp_console = {
 	.index =	-1,
 };
 
-#if IS_ENABLED(CONFIG_USB_EHCI_HCD)
+#if IS_ENABLED(CONFIG_USB)
 int dbgp_reset_prep(struct usb_hcd *hcd)
 {
 	int ret = xen_dbgp_reset_prep(hcd);
@@ -1008,7 +1008,7 @@ int dbgp_external_startup(struct usb_hcd
 	return xen_dbgp_external_startup(hcd) ?: _dbgp_external_startup();
 }
 EXPORT_SYMBOL_GPL(dbgp_external_startup);
-#endif /* USB_EHCI_HCD */
+#endif /* USB */
 
 #ifdef CONFIG_KGDB
 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 17:08:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 17:08:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKjH-0007eD-6Y; Fri, 02 Nov 2012 17:08:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TUKjG-0007e6-Bm
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 17:08:22 +0000
Received: from [85.158.143.99:46405] by server-2.bemta-4.messagelabs.com id
	92/8A-28922-50EF3905; Fri, 02 Nov 2012 17:08:21 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1351876100!28382418!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27936 invoked from network); 2 Nov 2012 17:08:21 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-216.messagelabs.com with SMTP;
	2 Nov 2012 17:08:21 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 02 Nov 2012 17:08:19 +0000
Message-Id: <50940C3C02000078000A62B0@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 02 Nov 2012 17:09:00 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <gregkh@linuxfoundation.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, linux-usb@vger.kernel.org,
	xen-devel <xen-devel@lists.xen.org>,
	Randy Dunlap <rdunlap@xenotime.net>, stern@rowland.harvard.edu,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH] fix build of EHCI debug port code when
 USB_CHIPIDEA but !USB_EHCI_HCD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Relax condition of building the reset interface stubs in
drivers/usb/early/ehci-dbgp.c from USB_EHCI_HCD to just USB, to also
cover the chipidea driver re-using code from ehci-hcd.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

---
 drivers/usb/early/ehci-dbgp.c       |   4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- 3.7-rc3.orig/drivers/usb/early/ehci-dbgp.c
+++ 3.7-rc3/drivers/usb/early/ehci-dbgp.c
@@ -974,7 +974,7 @@ struct console early_dbgp_console = {
 	.index =	-1,
 };
 
-#if IS_ENABLED(CONFIG_USB_EHCI_HCD)
+#if IS_ENABLED(CONFIG_USB)
 int dbgp_reset_prep(struct usb_hcd *hcd)
 {
 	int ret = xen_dbgp_reset_prep(hcd);
@@ -1008,7 +1008,7 @@ int dbgp_external_startup(struct usb_hcd
 	return xen_dbgp_external_startup(hcd) ?: _dbgp_external_startup();
 }
 EXPORT_SYMBOL_GPL(dbgp_external_startup);
-#endif /* USB_EHCI_HCD */
+#endif /* USB */
 
 #ifdef CONFIG_KGDB
 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 17:09:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 17:09:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKk2-0007je-Kw; Fri, 02 Nov 2012 17:09:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <gregkh@linuxfoundation.org>) id 1TUKk1-0007jQ-2G
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 17:09:09 +0000
Received: from [85.158.143.99:47907] by server-2.bemta-4.messagelabs.com id
	21/1B-28922-43EF3905; Fri, 02 Nov 2012 17:09:08 +0000
X-Env-Sender: gregkh@linuxfoundation.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1351876146!20879577!1
X-Originating-IP: [198.145.19.201]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29213 invoked from network); 2 Nov 2012 17:09:07 -0000
Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.19.201)
	by server-11.tower-216.messagelabs.com with SMTP;
	2 Nov 2012 17:09:07 -0000
Received: from mail.kernel.org (localhost [127.0.0.1])
	by mail.kernel.org (Postfix) with ESMTP id 98B462044B;
	Fri,  2 Nov 2012 17:09:05 +0000 (UTC)
Received: from localhost (c-67-168-183-230.hsd1.wa.comcast.net
	[67.168.183.230])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by mail.kernel.org (Postfix) with ESMTPSA id C3E5E20442;
	Fri,  2 Nov 2012 17:09:04 +0000 (UTC)
Date: Fri, 2 Nov 2012 10:09:09 -0700
From: Greg KH <gregkh@linuxfoundation.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121102170909.GA2633@kroah.com>
References: <5093947F02000078000A5F42@nat28.tlf.novell.com>
	<20121102162334.GB4093@kroah.com>
	<509408E702000078000A6285@nat28.tlf.novell.com>
	<20121102170126.GA8413@kroah.com>
	<50940BE702000078000A62AD@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50940BE702000078000A62AD@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,UNPARSEABLE_RELAY
	autolearn=ham version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org
X-Virus-Scanned: ClamAV using ClamSMTP
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, linux-usb@vger.kernel.org,
	xen-devel <xen-devel@lists.xen.org>,
	Randy Dunlap <rdunlap@xenotime.net>, stern@rowland.harvard.edu,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH,
 v3] fix build with XEN and EARLY_PRINTK_DBGP enabled but
 USB_SUPPORT disabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 02, 2012 at 05:07:35PM +0000, Jan Beulich wrote:
> >>> On 02.11.12 at 18:01, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Fri, Nov 02, 2012 at 04:54:47PM +0000, Jan Beulich wrote:
> >> >>> On 02.11.12 at 17:23, Greg KH <gregkh@linuxfoundation.org> wrote:
> >> > On Fri, Nov 02, 2012 at 08:38:07AM +0000, Jan Beulich wrote:
> >> >> Since there's no possible caller of dbgp_external_startup() and
> >> > 
> >> > <snip>
> >> > 
> >> > Please just send the incremental patch, in a format that I can apply it
> >> > (hint, as an attachment like this I can't, as I would have to hand-edit
> >> > the attachment, and I might get it wrong...)
> >> 
> >> Here you go:
> >> 
> >> fix build of EHCI debug port code when USB_CHIPIDEA but !USB_EHCI_HCD
> >> 
> >> Relax condition of building the reset interface stubs in
> >> drivers/usb/early/ehci-dbgp.c from USB_EHCI_HCD to just USB, to also
> >> cover the chipidea driver re-using code from ehci-hcd.
> > 
> > Ok, I'm going to be a pain here, but this isn't in a form I can apply
> > it.  I would have to edit this by hand and then run it through git,
> > making it a pain to apply.  Please be nice to overworked maintainers and
> > make it easy to apply your patches, send them in a format that they
> > don't have to edit _anything_.
> > 
> > Third times a charm?
> 
> Assuming (since you didn't mention what's wrong) all this is about
> is the fact that the mail contains other text besides the patch, I'll
> resend the patch alone. If that's not your issue, you'll have to
> tell me what it is I did wrong.

Yes, that is incorrect, along with the Subject: line.

thanks,

greg k-h

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 17:09:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 17:09:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUKk2-0007je-Kw; Fri, 02 Nov 2012 17:09:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <gregkh@linuxfoundation.org>) id 1TUKk1-0007jQ-2G
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 17:09:09 +0000
Received: from [85.158.143.99:47907] by server-2.bemta-4.messagelabs.com id
	21/1B-28922-43EF3905; Fri, 02 Nov 2012 17:09:08 +0000
X-Env-Sender: gregkh@linuxfoundation.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1351876146!20879577!1
X-Originating-IP: [198.145.19.201]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29213 invoked from network); 2 Nov 2012 17:09:07 -0000
Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.19.201)
	by server-11.tower-216.messagelabs.com with SMTP;
	2 Nov 2012 17:09:07 -0000
Received: from mail.kernel.org (localhost [127.0.0.1])
	by mail.kernel.org (Postfix) with ESMTP id 98B462044B;
	Fri,  2 Nov 2012 17:09:05 +0000 (UTC)
Received: from localhost (c-67-168-183-230.hsd1.wa.comcast.net
	[67.168.183.230])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by mail.kernel.org (Postfix) with ESMTPSA id C3E5E20442;
	Fri,  2 Nov 2012 17:09:04 +0000 (UTC)
Date: Fri, 2 Nov 2012 10:09:09 -0700
From: Greg KH <gregkh@linuxfoundation.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121102170909.GA2633@kroah.com>
References: <5093947F02000078000A5F42@nat28.tlf.novell.com>
	<20121102162334.GB4093@kroah.com>
	<509408E702000078000A6285@nat28.tlf.novell.com>
	<20121102170126.GA8413@kroah.com>
	<50940BE702000078000A62AD@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50940BE702000078000A62AD@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,UNPARSEABLE_RELAY
	autolearn=ham version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org
X-Virus-Scanned: ClamAV using ClamSMTP
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, linux-usb@vger.kernel.org,
	xen-devel <xen-devel@lists.xen.org>,
	Randy Dunlap <rdunlap@xenotime.net>, stern@rowland.harvard.edu,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH,
 v3] fix build with XEN and EARLY_PRINTK_DBGP enabled but
 USB_SUPPORT disabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 02, 2012 at 05:07:35PM +0000, Jan Beulich wrote:
> >>> On 02.11.12 at 18:01, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Fri, Nov 02, 2012 at 04:54:47PM +0000, Jan Beulich wrote:
> >> >>> On 02.11.12 at 17:23, Greg KH <gregkh@linuxfoundation.org> wrote:
> >> > On Fri, Nov 02, 2012 at 08:38:07AM +0000, Jan Beulich wrote:
> >> >> Since there's no possible caller of dbgp_external_startup() and
> >> > 
> >> > <snip>
> >> > 
> >> > Please just send the incremental patch, in a format that I can apply it
> >> > (hint, as an attachment like this I can't, as I would have to hand-edit
> >> > the attachment, and I might get it wrong...)
> >> 
> >> Here you go:
> >> 
> >> fix build of EHCI debug port code when USB_CHIPIDEA but !USB_EHCI_HCD
> >> 
> >> Relax condition of building the reset interface stubs in
> >> drivers/usb/early/ehci-dbgp.c from USB_EHCI_HCD to just USB, to also
> >> cover the chipidea driver re-using code from ehci-hcd.
> > 
> > Ok, I'm going to be a pain here, but this isn't in a form I can apply
> > it.  I would have to edit this by hand and then run it through git,
> > making it a pain to apply.  Please be nice to overworked maintainers and
> > make it easy to apply your patches, send them in a format that they
> > don't have to edit _anything_.
> > 
> > Third times a charm?
> 
> Assuming (since you didn't mention what's wrong) all this is about
> is the fact that the mail contains other text besides the patch, I'll
> resend the patch alone. If that's not your issue, you'll have to
> tell me what it is I did wrong.

Yes, that is incorrect, along with the Subject: line.

thanks,

greg k-h

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 19:56:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 19:56:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUNL3-0001QF-7E; Fri, 02 Nov 2012 19:55:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ronny.hegewald@online.de>) id 1TUNL1-0001QA-Hi
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 19:55:31 +0000
Received: from [85.158.139.211:58709] by server-13.bemta-5.messagelabs.com id
	70/15-27809-23524905; Fri, 02 Nov 2012 19:55:30 +0000
X-Env-Sender: ronny.hegewald@online.de
X-Msg-Ref: server-11.tower-206.messagelabs.com!1351886129!18686400!1
X-Originating-IP: [212.227.17.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gNzc3MTM=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gNzc3MTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9910 invoked from network); 2 Nov 2012 19:55:29 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.17.9)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 19:55:29 -0000
Received: from server2-groupware.localnet (kons-d9be1d83.pool.mediaWays.net
	[217.190.29.131])
	by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis)
	id 0M3OHE-1TCz2m0akC-00r7w7; Fri, 02 Nov 2012 20:55:28 +0100
From: Ronny Hegewald <ronny.hegewald@online.de>
To: xen-devel@lists.xen.org
Date: Fri, 2 Nov 2012 21:01:08 +0000
User-Agent: KMail/1.11.4 (Linux/3.0.3; KDE/4.2.4; i686; ; )
References: <201211010218.14872.ronny.hegewald@online.de>
	<1351756924.25014.29.camel@hastur.hellion.org.uk>
In-Reply-To: <1351756924.25014.29.camel@hastur.hellion.org.uk>
MIME-Version: 1.0
Content-Disposition: inline
Message-Id: <201211022101.08926.ronny.hegewald@online.de>
X-Provags-ID: V02:K0:V1mElcsN8pnZqK1QPWxtS/KVZQKF+71q2AfRyTEuSza
	2Vq3Qsm3XyBAywKABqFvE42eep6c2aUeUnOKhRhJJ7+pyGmEoJ
	GSXOaWwzV7V1bauAXW3/MTvLe5+s8PFMbtsWgS/pvnxmqYSXRt
	mPRKvEJmEt+n7c/NOge/TwAxThLeasETyEyOGUXySPIwQ1QNAa
	974PraWylW2uKkuTlNDO2a+T3QMz4ibN0XVEn7iovfN8/io6o8
	QEKfAPvHXAUpS0l19RuzY+rrR1XDqtKo+KNh/HQpUjIJg+Yfqf
	lvpm6SfMthSQVdSve8OxMR9UXGlNRL7UOhvRqHJylHsON6R+Jg
	wKXQ3JKGdDj1CWyvwnRLt9Fn83TLKqC0CFdklQY1kqfmZczvhg
	PJUJtYVNjehIfjx4eBY7RpCROzNfv1fMME=
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH V2] fix vfb related assertion problem when
	starting pv-domU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

When a config-file for a pv-domU has a vfb section with a vnc=0 option then a 
"xl create" for that domU crashes with the message


xl: libxl.c:252: libxl_defbool_val: Assertion `!libxl_defbool_is_default(db)' 
failed.


and the domU hangs early in the start.

This patch fixes the cause of the assertion and let the domU start normally.

This problem exists since xen 4.2.

Signed-off-by: Ronny Hegewald@online.de

--- tools/libxl/libxl.c.org	2012-11-01 01:35:52.000000000 +0000
+++ tools/libxl/libxl.c	2012-11-01 01:36:20.000000000 +0000
@@ -2949,6 +2949,8 @@ int libxl__device_vfb_setdefault(libxl__
         }
 
         libxl_defbool_setdefault(&vfb->vnc.findunused, true);
+    } else {
+        libxl_defbool_setdefault(&vfb->vnc.findunused, false);
     }
 
     libxl_defbool_setdefault(&vfb->sdl.enable, false);


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 19:56:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 19:56:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUNL3-0001QF-7E; Fri, 02 Nov 2012 19:55:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ronny.hegewald@online.de>) id 1TUNL1-0001QA-Hi
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 19:55:31 +0000
Received: from [85.158.139.211:58709] by server-13.bemta-5.messagelabs.com id
	70/15-27809-23524905; Fri, 02 Nov 2012 19:55:30 +0000
X-Env-Sender: ronny.hegewald@online.de
X-Msg-Ref: server-11.tower-206.messagelabs.com!1351886129!18686400!1
X-Originating-IP: [212.227.17.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gNzc3MTM=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gNzc3MTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9910 invoked from network); 2 Nov 2012 19:55:29 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.17.9)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 19:55:29 -0000
Received: from server2-groupware.localnet (kons-d9be1d83.pool.mediaWays.net
	[217.190.29.131])
	by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis)
	id 0M3OHE-1TCz2m0akC-00r7w7; Fri, 02 Nov 2012 20:55:28 +0100
From: Ronny Hegewald <ronny.hegewald@online.de>
To: xen-devel@lists.xen.org
Date: Fri, 2 Nov 2012 21:01:08 +0000
User-Agent: KMail/1.11.4 (Linux/3.0.3; KDE/4.2.4; i686; ; )
References: <201211010218.14872.ronny.hegewald@online.de>
	<1351756924.25014.29.camel@hastur.hellion.org.uk>
In-Reply-To: <1351756924.25014.29.camel@hastur.hellion.org.uk>
MIME-Version: 1.0
Content-Disposition: inline
Message-Id: <201211022101.08926.ronny.hegewald@online.de>
X-Provags-ID: V02:K0:V1mElcsN8pnZqK1QPWxtS/KVZQKF+71q2AfRyTEuSza
	2Vq3Qsm3XyBAywKABqFvE42eep6c2aUeUnOKhRhJJ7+pyGmEoJ
	GSXOaWwzV7V1bauAXW3/MTvLe5+s8PFMbtsWgS/pvnxmqYSXRt
	mPRKvEJmEt+n7c/NOge/TwAxThLeasETyEyOGUXySPIwQ1QNAa
	974PraWylW2uKkuTlNDO2a+T3QMz4ibN0XVEn7iovfN8/io6o8
	QEKfAPvHXAUpS0l19RuzY+rrR1XDqtKo+KNh/HQpUjIJg+Yfqf
	lvpm6SfMthSQVdSve8OxMR9UXGlNRL7UOhvRqHJylHsON6R+Jg
	wKXQ3JKGdDj1CWyvwnRLt9Fn83TLKqC0CFdklQY1kqfmZczvhg
	PJUJtYVNjehIfjx4eBY7RpCROzNfv1fMME=
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH V2] fix vfb related assertion problem when
	starting pv-domU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

When a config-file for a pv-domU has a vfb section with a vnc=0 option then a 
"xl create" for that domU crashes with the message


xl: libxl.c:252: libxl_defbool_val: Assertion `!libxl_defbool_is_default(db)' 
failed.


and the domU hangs early in the start.

This patch fixes the cause of the assertion and let the domU start normally.

This problem exists since xen 4.2.

Signed-off-by: Ronny Hegewald@online.de

--- tools/libxl/libxl.c.org	2012-11-01 01:35:52.000000000 +0000
+++ tools/libxl/libxl.c	2012-11-01 01:36:20.000000000 +0000
@@ -2949,6 +2949,8 @@ int libxl__device_vfb_setdefault(libxl__
         }
 
         libxl_defbool_setdefault(&vfb->vnc.findunused, true);
+    } else {
+        libxl_defbool_setdefault(&vfb->vnc.findunused, false);
     }
 
     libxl_defbool_setdefault(&vfb->sdl.enable, false);


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 20:11:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 20:11:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUNZV-0001f2-PX; Fri, 02 Nov 2012 20:10:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TUNZU-0001ex-EG
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 20:10:28 +0000
Received: from [85.158.139.83:32641] by server-12.bemta-5.messagelabs.com id
	85/B9-02886-3B824905; Fri, 02 Nov 2012 20:10:27 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1351887025!28517790!1
X-Originating-IP: [209.85.212.65]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1372 invoked from network); 2 Nov 2012 20:10:26 -0000
Received: from mail-vb0-f65.google.com (HELO mail-vb0-f65.google.com)
	(209.85.212.65)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 20:10:26 -0000
Received: by mail-vb0-f65.google.com with SMTP id fn1so623464vbb.8
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 13:10:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=AgtuvloRSKaWWwNZhR3U6Xl/W3oToyFIcV0Ksvt34R8=;
	b=vFvq7u+nAAo9zyyFtcR0XH9JhXD2uAyKyWEhjub40gKQdGFKupDumsaTFdc47AII8L
	CJ+Vcyl0C9dPR8DZWAPYv3cKGhoG7l9LCqV2aeuuJ/wvOCyrxYPsXnra9rEoQc0fqjLI
	1MB71MOywe1q5Ag9aXzHgPryAPjk+CnJ0Mz0Q4/rlSheMz9quaKFyVVkNMiTevmFGKKt
	vsuS0AWNNFW2eFRws8p5rPyY21nGzoSYg7xzdSgSRPYEVS6ykb9XHHxrQkRDsOekF5k/
	KdFRdbYN2hLw2yHafkGfkMw09nJx14P+Y06Esx/6wlhu/r2RguwgAyqcQ8ZU/2RPe42C
	iRGA==
Received: by 10.58.223.200 with SMTP id qw8mr3056234vec.12.1351887025009;
	Fri, 02 Nov 2012 13:10:25 -0700 (PDT)
Received: from konrad-lan.dumpdata.com
	(pool-64-222-209-26.port.east.myfairpoint.net. [64.222.209.26])
	by mx.google.com with ESMTPS id u6sm4265897vdi.20.2012.11.02.13.10.24
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 02 Nov 2012 13:10:24 -0700 (PDT)
Date: Fri, 2 Nov 2012 16:10:19 -0400
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121102201018.GA6786@konrad-lan.dumpdata.com>
References: <5093E84C02000078000A619F@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5093E84C02000078000A619F@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: xen-devel <xen-devel@lists.xen.org>, linux-kernel@vger.kernel.org,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/2] xen-pciback: parsing improvements
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 02, 2012 at 02:35:40PM +0000, Jan Beulich wrote:
> 1: simplify and tighten parsing of device IDs
> 2: reject out of range inputs

applied for v3.8.

Thanks!
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 20:11:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 20:11:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUNZV-0001f2-PX; Fri, 02 Nov 2012 20:10:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TUNZU-0001ex-EG
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 20:10:28 +0000
Received: from [85.158.139.83:32641] by server-12.bemta-5.messagelabs.com id
	85/B9-02886-3B824905; Fri, 02 Nov 2012 20:10:27 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1351887025!28517790!1
X-Originating-IP: [209.85.212.65]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1372 invoked from network); 2 Nov 2012 20:10:26 -0000
Received: from mail-vb0-f65.google.com (HELO mail-vb0-f65.google.com)
	(209.85.212.65)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 20:10:26 -0000
Received: by mail-vb0-f65.google.com with SMTP id fn1so623464vbb.8
	for <xen-devel@lists.xen.org>; Fri, 02 Nov 2012 13:10:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=AgtuvloRSKaWWwNZhR3U6Xl/W3oToyFIcV0Ksvt34R8=;
	b=vFvq7u+nAAo9zyyFtcR0XH9JhXD2uAyKyWEhjub40gKQdGFKupDumsaTFdc47AII8L
	CJ+Vcyl0C9dPR8DZWAPYv3cKGhoG7l9LCqV2aeuuJ/wvOCyrxYPsXnra9rEoQc0fqjLI
	1MB71MOywe1q5Ag9aXzHgPryAPjk+CnJ0Mz0Q4/rlSheMz9quaKFyVVkNMiTevmFGKKt
	vsuS0AWNNFW2eFRws8p5rPyY21nGzoSYg7xzdSgSRPYEVS6ykb9XHHxrQkRDsOekF5k/
	KdFRdbYN2hLw2yHafkGfkMw09nJx14P+Y06Esx/6wlhu/r2RguwgAyqcQ8ZU/2RPe42C
	iRGA==
Received: by 10.58.223.200 with SMTP id qw8mr3056234vec.12.1351887025009;
	Fri, 02 Nov 2012 13:10:25 -0700 (PDT)
Received: from konrad-lan.dumpdata.com
	(pool-64-222-209-26.port.east.myfairpoint.net. [64.222.209.26])
	by mx.google.com with ESMTPS id u6sm4265897vdi.20.2012.11.02.13.10.24
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 02 Nov 2012 13:10:24 -0700 (PDT)
Date: Fri, 2 Nov 2012 16:10:19 -0400
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121102201018.GA6786@konrad-lan.dumpdata.com>
References: <5093E84C02000078000A619F@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5093E84C02000078000A619F@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: xen-devel <xen-devel@lists.xen.org>, linux-kernel@vger.kernel.org,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/2] xen-pciback: parsing improvements
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 02, 2012 at 02:35:40PM +0000, Jan Beulich wrote:
> 1: simplify and tighten parsing of device IDs
> 2: reject out of range inputs

applied for v3.8.

Thanks!
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 20:14:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 20:14:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUNcW-0001lx-CD; Fri, 02 Nov 2012 20:13:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TUNcU-0001lp-JT
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 20:13:34 +0000
Received: from [85.158.143.99:52970] by server-1.bemta-4.messagelabs.com id
	F1/02-27934-D6924905; Fri, 02 Nov 2012 20:13:33 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1351887213!20893656!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY5ODk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31041 invoked from network); 2 Nov 2012 20:13:33 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 20:13:33 -0000
X-IronPort-AV: E=Sophos;i="4.80,701,1344211200"; d="scan'208";a="15564501"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	02 Nov 2012 20:13:33 +0000
Received: from [192.168.1.30] (10.31.3.234) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Fri, 2 Nov 2012
	20:13:32 +0000
Message-ID: <5094296B.5030406@citrix.com>
Date: Fri, 2 Nov 2012 21:13:31 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Konrad Rzeszutek Wilk <konrad@darnok.org>
References: <1351870984-22078-1-git-send-email-roger.pau@citrix.com>
	<20121102170543.GA1853@konrad-lan.dumpdata.com>
In-Reply-To: <20121102170543.GA1853@konrad-lan.dumpdata.com>
Cc: "konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen-blk: persistent-grants fixes
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 02/11/12 18:05, Konrad Rzeszutek Wilk wrote:
> On Fri, Nov 02, 2012 at 04:43:04PM +0100, Roger Pau Monne wrote:
>> This patch contains fixes for persistent grants implementation v2:
>>
>>  * handle == 0 is a valid handle, so initialize grants in blkback
>>    setting the handle to BLKBACK_INVALID_HANDLE instead of 0. Reported
>>    by Konrad Rzeszutek Wilk.
>>
>>  * new_map is a boolean, use "true" or "false" instead of 1 and 0.
>>    Reported by Konrad Rzeszutek Wilk.
>>
>>  * blkfront announces the persistent-grants feature as
>>    feature-persistent-grants, use feature-persistent instead which is
>>    consistent with blkback and the public Xen headers.
>>
>>  * Add a consistency check in blkfront to make sure we don't try to
>>    access segments that have not been set.
> 
> Looks good.. but
>>
>> Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
>> Cc: <konrad.wilk@oracle.com>
>> Cc: <linux-kernel@vger.kernel.org>
>> ---
>>  drivers/block/xen-blkback/blkback.c |   15 +++++++++------
>>  drivers/block/xen-blkback/xenbus.c  |    2 +-
>>  drivers/block/xen-blkfront.c        |    3 ++-
>>  3 files changed, 12 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
>> index 663d42d..a059616 100644
>> --- a/drivers/block/xen-blkback/blkback.c
>> +++ b/drivers/block/xen-blkback/blkback.c
>> @@ -503,7 +503,7 @@ static int xen_blkbk_map(struct blkif_request *req,
>>  			 * We are using persistent grants and
>>  			 * the grant is already mapped
>>  			 */
>> -			new_map = 0;
>> +			new_map = false;
>>  		} else if (use_persistent_gnts &&
>>  			   blkif->persistent_gnt_c <
>>  			   max_mapped_grant_pages(blkif->blk_protocol)) {
>> @@ -511,8 +511,8 @@ static int xen_blkbk_map(struct blkif_request *req,
>>  			 * We are using persistent grants, the grant is
>>  			 * not mapped but we have room for it
>>  			 */
>> -			new_map = 1;
>> -			persistent_gnt = kzalloc(
>> +			new_map = true;
>> +			persistent_gnt = kmalloc(
> 
> Why do we want to use kmalloc instead of kzalloc?

In the previous patch I relied on handle being 0 when not set (that's
why I was using kzalloc), but this was wrong (0 is a valid handle), so
now I explicitly initialize it to BLKBACK_INVALID_HANDLE. I replaced the
kzalloc with kmalloc because it should be faster, and there's no need to
zero it anymore.

> 
>>  				sizeof(struct persistent_gnt),
>>  				GFP_KERNEL);
>>  			if (!persistent_gnt)
>> @@ -523,6 +523,7 @@ static int xen_blkbk_map(struct blkif_request *req,
>>  				return -ENOMEM;
>>  			}
>>  			persistent_gnt->gnt = req->u.rw.seg[i].gref;
>> +			persistent_gnt->handle = BLKBACK_INVALID_HANDLE;
>>  
>>  			pages_to_gnt[segs_to_map] =
>>  				persistent_gnt->page;
>> @@ -547,7 +548,7 @@ static int xen_blkbk_map(struct blkif_request *req,
>>  				pr_alert(DRV_PFX " domain %u, device %#x is using maximum number of persistent grants\n",
>>  					 blkif->domid, blkif->vbd.handle);
>>  			}
>> -			new_map = 1;
>> +			new_map = true;
>>  			pages[i] = blkbk->pending_page(pending_req, i);
>>  			addr = vaddr(pending_req, i);
>>  			pages_to_gnt[segs_to_map] =
>> @@ -584,7 +585,8 @@ static int xen_blkbk_map(struct blkif_request *req,
>>  	 */
>>  	bitmap_zero(pending_req->unmap_seg, BLKIF_MAX_SEGMENTS_PER_REQUEST);
>>  	for (i = 0, j = 0; i < nseg; i++) {
>> -		if (!persistent_gnts[i] || !persistent_gnts[i]->handle) {
>> +		if (!persistent_gnts[i] ||
>> +		    persistent_gnts[i]->handle == BLKBACK_INVALID_HANDLE) {
>>  			/* This is a newly mapped grant */
>>  			BUG_ON(j >= segs_to_map);
>>  			if (unlikely(map[j].status != 0)) {
>> @@ -601,7 +603,8 @@ static int xen_blkbk_map(struct blkif_request *req,
>>  			}
>>  		}
>>  		if (persistent_gnts[i]) {
>> -			if (!persistent_gnts[i]->handle) {
>> +			if (persistent_gnts[i]->handle ==
>> +			    BLKBACK_INVALID_HANDLE) {
>>  				/*
>>  				 * If this is a new persistent grant
>>  				 * save the handler
>> diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
>> index b225026..a03ecbb 100644
>> --- a/drivers/block/xen-blkback/xenbus.c
>> +++ b/drivers/block/xen-blkback/xenbus.c
>> @@ -760,7 +760,7 @@ static int connect_ring(struct backend_info *be)
>>  		return -1;
>>  	}
>>  	err = xenbus_gather(XBT_NIL, dev->otherend,
>> -			    "feature-persistent-grants", "%u",
>> +			    "feature-persistent", "%u",
>>  			    &pers_grants, NULL);
>>  	if (err)
>>  		pers_grants = 0;
>> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
>> index 911d733..f1de806 100644
>> --- a/drivers/block/xen-blkfront.c
>> +++ b/drivers/block/xen-blkfront.c
>> @@ -852,6 +852,7 @@ static void blkif_completion(struct blk_shadow *s, struct blkfront_info *info,
>>  		rq_for_each_segment(bvec, s->request, iter) {
>>  			BUG_ON((bvec->bv_offset + bvec->bv_len) > PAGE_SIZE);
>>  			i = offset >> PAGE_SHIFT;
>> +			BUG_ON(i >= s->req.u.rw.nr_segments);
>>  			shared_data = kmap_atomic(
>>  				pfn_to_page(s->grants_used[i]->pfn));
>>  			bvec_data = bvec_kmap_irq(bvec, &flags);
>> @@ -1069,7 +1070,7 @@ again:
>>  		goto abort_transaction;
>>  	}
>>  	err = xenbus_printf(xbt, dev->nodename,
>> -			    "feature-persistent-grants", "%u", 1);
>> +			    "feature-persistent", "%u", 1);
>>  	if (err)
>>  		dev_warn(&dev->dev,
>>  			 "writing persistent grants feature to xenbus");
>> -- 
>> 1.7.7.5 (Apple Git-26)
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 20:14:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 20:14:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUNcW-0001lx-CD; Fri, 02 Nov 2012 20:13:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TUNcU-0001lp-JT
	for xen-devel@lists.xen.org; Fri, 02 Nov 2012 20:13:34 +0000
Received: from [85.158.143.99:52970] by server-1.bemta-4.messagelabs.com id
	F1/02-27934-D6924905; Fri, 02 Nov 2012 20:13:33 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1351887213!20893656!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY5ODk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31041 invoked from network); 2 Nov 2012 20:13:33 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 20:13:33 -0000
X-IronPort-AV: E=Sophos;i="4.80,701,1344211200"; d="scan'208";a="15564501"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	02 Nov 2012 20:13:33 +0000
Received: from [192.168.1.30] (10.31.3.234) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Fri, 2 Nov 2012
	20:13:32 +0000
Message-ID: <5094296B.5030406@citrix.com>
Date: Fri, 2 Nov 2012 21:13:31 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Konrad Rzeszutek Wilk <konrad@darnok.org>
References: <1351870984-22078-1-git-send-email-roger.pau@citrix.com>
	<20121102170543.GA1853@konrad-lan.dumpdata.com>
In-Reply-To: <20121102170543.GA1853@konrad-lan.dumpdata.com>
Cc: "konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen-blk: persistent-grants fixes
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 02/11/12 18:05, Konrad Rzeszutek Wilk wrote:
> On Fri, Nov 02, 2012 at 04:43:04PM +0100, Roger Pau Monne wrote:
>> This patch contains fixes for persistent grants implementation v2:
>>
>>  * handle == 0 is a valid handle, so initialize grants in blkback
>>    setting the handle to BLKBACK_INVALID_HANDLE instead of 0. Reported
>>    by Konrad Rzeszutek Wilk.
>>
>>  * new_map is a boolean, use "true" or "false" instead of 1 and 0.
>>    Reported by Konrad Rzeszutek Wilk.
>>
>>  * blkfront announces the persistent-grants feature as
>>    feature-persistent-grants, use feature-persistent instead which is
>>    consistent with blkback and the public Xen headers.
>>
>>  * Add a consistency check in blkfront to make sure we don't try to
>>    access segments that have not been set.
> 
> Looks good.. but
>>
>> Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
>> Cc: <konrad.wilk@oracle.com>
>> Cc: <linux-kernel@vger.kernel.org>
>> ---
>>  drivers/block/xen-blkback/blkback.c |   15 +++++++++------
>>  drivers/block/xen-blkback/xenbus.c  |    2 +-
>>  drivers/block/xen-blkfront.c        |    3 ++-
>>  3 files changed, 12 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
>> index 663d42d..a059616 100644
>> --- a/drivers/block/xen-blkback/blkback.c
>> +++ b/drivers/block/xen-blkback/blkback.c
>> @@ -503,7 +503,7 @@ static int xen_blkbk_map(struct blkif_request *req,
>>  			 * We are using persistent grants and
>>  			 * the grant is already mapped
>>  			 */
>> -			new_map = 0;
>> +			new_map = false;
>>  		} else if (use_persistent_gnts &&
>>  			   blkif->persistent_gnt_c <
>>  			   max_mapped_grant_pages(blkif->blk_protocol)) {
>> @@ -511,8 +511,8 @@ static int xen_blkbk_map(struct blkif_request *req,
>>  			 * We are using persistent grants, the grant is
>>  			 * not mapped but we have room for it
>>  			 */
>> -			new_map = 1;
>> -			persistent_gnt = kzalloc(
>> +			new_map = true;
>> +			persistent_gnt = kmalloc(
> 
> Why do we want to use kmalloc instead of kzalloc?

In the previous patch I relied on handle being 0 when not set (that's
why I was using kzalloc), but this was wrong (0 is a valid handle), so
now I explicitly initialize it to BLKBACK_INVALID_HANDLE. I replaced the
kzalloc with kmalloc because it should be faster, and there's no need to
zero it anymore.

> 
>>  				sizeof(struct persistent_gnt),
>>  				GFP_KERNEL);
>>  			if (!persistent_gnt)
>> @@ -523,6 +523,7 @@ static int xen_blkbk_map(struct blkif_request *req,
>>  				return -ENOMEM;
>>  			}
>>  			persistent_gnt->gnt = req->u.rw.seg[i].gref;
>> +			persistent_gnt->handle = BLKBACK_INVALID_HANDLE;
>>  
>>  			pages_to_gnt[segs_to_map] =
>>  				persistent_gnt->page;
>> @@ -547,7 +548,7 @@ static int xen_blkbk_map(struct blkif_request *req,
>>  				pr_alert(DRV_PFX " domain %u, device %#x is using maximum number of persistent grants\n",
>>  					 blkif->domid, blkif->vbd.handle);
>>  			}
>> -			new_map = 1;
>> +			new_map = true;
>>  			pages[i] = blkbk->pending_page(pending_req, i);
>>  			addr = vaddr(pending_req, i);
>>  			pages_to_gnt[segs_to_map] =
>> @@ -584,7 +585,8 @@ static int xen_blkbk_map(struct blkif_request *req,
>>  	 */
>>  	bitmap_zero(pending_req->unmap_seg, BLKIF_MAX_SEGMENTS_PER_REQUEST);
>>  	for (i = 0, j = 0; i < nseg; i++) {
>> -		if (!persistent_gnts[i] || !persistent_gnts[i]->handle) {
>> +		if (!persistent_gnts[i] ||
>> +		    persistent_gnts[i]->handle == BLKBACK_INVALID_HANDLE) {
>>  			/* This is a newly mapped grant */
>>  			BUG_ON(j >= segs_to_map);
>>  			if (unlikely(map[j].status != 0)) {
>> @@ -601,7 +603,8 @@ static int xen_blkbk_map(struct blkif_request *req,
>>  			}
>>  		}
>>  		if (persistent_gnts[i]) {
>> -			if (!persistent_gnts[i]->handle) {
>> +			if (persistent_gnts[i]->handle ==
>> +			    BLKBACK_INVALID_HANDLE) {
>>  				/*
>>  				 * If this is a new persistent grant
>>  				 * save the handler
>> diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
>> index b225026..a03ecbb 100644
>> --- a/drivers/block/xen-blkback/xenbus.c
>> +++ b/drivers/block/xen-blkback/xenbus.c
>> @@ -760,7 +760,7 @@ static int connect_ring(struct backend_info *be)
>>  		return -1;
>>  	}
>>  	err = xenbus_gather(XBT_NIL, dev->otherend,
>> -			    "feature-persistent-grants", "%u",
>> +			    "feature-persistent", "%u",
>>  			    &pers_grants, NULL);
>>  	if (err)
>>  		pers_grants = 0;
>> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
>> index 911d733..f1de806 100644
>> --- a/drivers/block/xen-blkfront.c
>> +++ b/drivers/block/xen-blkfront.c
>> @@ -852,6 +852,7 @@ static void blkif_completion(struct blk_shadow *s, struct blkfront_info *info,
>>  		rq_for_each_segment(bvec, s->request, iter) {
>>  			BUG_ON((bvec->bv_offset + bvec->bv_len) > PAGE_SIZE);
>>  			i = offset >> PAGE_SHIFT;
>> +			BUG_ON(i >= s->req.u.rw.nr_segments);
>>  			shared_data = kmap_atomic(
>>  				pfn_to_page(s->grants_used[i]->pfn));
>>  			bvec_data = bvec_kmap_irq(bvec, &flags);
>> @@ -1069,7 +1070,7 @@ again:
>>  		goto abort_transaction;
>>  	}
>>  	err = xenbus_printf(xbt, dev->nodename,
>> -			    "feature-persistent-grants", "%u", 1);
>> +			    "feature-persistent", "%u", 1);
>>  	if (err)
>>  		dev_warn(&dev->dev,
>>  			 "writing persistent grants feature to xenbus");
>> -- 
>> 1.7.7.5 (Apple Git-26)
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 21:29:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 21:29:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUOnW-0002BX-AW; Fri, 02 Nov 2012 21:29:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TUOnU-0002BS-Ln
	for xen-devel@lists.xensource.com; Fri, 02 Nov 2012 21:29:00 +0000
Received: from [85.158.137.99:48931] by server-12.bemta-3.messagelabs.com id
	BD/2F-22757-71B34905; Fri, 02 Nov 2012 21:28:55 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1351891733!16645611!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY5ODk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30341 invoked from network); 2 Nov 2012 21:28:53 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 21:28:53 -0000
X-IronPort-AV: E=Sophos;i="4.80,701,1344211200"; d="scan'208";a="15564829"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	02 Nov 2012 21:28:52 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 2 Nov 2012 21:28:51 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TUOnM-00006A-58;
	Fri, 02 Nov 2012 21:28:52 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TUOnM-0005X3-1o;
	Fri, 02 Nov 2012 21:28:52 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14346-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 2 Nov 2012 21:28:52 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14346: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14346 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14346/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-xl-winxpsp3-vcpus1 12 guest-localmigrate/x10 fail REGR. vs. 14337

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14337
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14337
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14337
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14337

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  bd78e5630a5b
baseline version:
 xen                  bf249cd5f2c1

------------------------------------------------------------
People who touched revisions under test:
  "Huang2, Wei" <Wei.Huang2@amd.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26127:bd78e5630a5b
tag:         tip
user:        Jan Beulich <jbeulich@suse.com>
date:        Fri Nov 02 17:15:30 2012 +0100
    
    IOMMU: keep disabled until iommu_setup() is called
    
    The iommu is enabled by default when xen is booting and later disabled
    in iommu_setup() when no iommu is present.
    
    But under some circumstances iommu code can be called before
    iommu_setup() is processed. If there is no iommu available xen crashes.
    
    This can happen for example when panic(...) is called as introduced
    with the patch "x86-64: detect processors subject to AMD erratum #121
    and refuse to boot" since xen 4.1.3, resulting in
    find_iommu_for_device() to be called in the context of
    disable_IO_APIC() / __stop_this_cpu().
    
    This patch fixes this by keeping the iommu disabled until iommu_setup()
    is entered.
    
    Originally-by: Ronny Hegewald <ronny.hegewald@online.de>
    
    In order for iommu_enable to be off initially, iommu_supports_eim()
    must not depend on it anymore, nor must acpi_parse_dmar(). The former
    in turn requires that iommu_intremap gets uncoupled from iommu_enabled
    (in particular, failure during IOMMU setup should no longer result in
    iommu_intremap getting cleared by generic code; IOMMU specific code
    can still do so provided in can live with the consequences).
    
    This could have the nice side effect of allowing to use "iommu=off"
    even when x2APIC was pre-enabled by the BIOS (in which case interrupt
    remapping is a requirement, but DMA translation [obviously] isn't), but
    that doesn't currently work (and hence x2apic_bsp_setup() forces the
    IOMMU on rather than just interrupt remapping).
    
    For consistency with VT-d, make the AMD IOMMU code also skip all ACPI
    table parsing when neither iommu_enable nor iommu_intremap are set.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>
    Acked-by: "Huang2, Wei" <Wei.Huang2@amd.com>
    
    
changeset:   26126:cacdc787d11f
user:        Jan Beulich <jbeulich@suse.com>
date:        Fri Nov 02 16:15:53 2012 +0100
    
    x86/mwait-idle: enable Ivy Bridge Xeon support
    
    Matching a similar change in Linux 3.7-rc.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26125:951d04441908
user:        Jan Beulich <jbeulich@suse.com>
date:        Fri Nov 02 16:14:11 2012 +0100
    
    ACPI/cpuidle: remove unused "power" field from Cx state data
    
    It has never been used for anything, and Linux 3.7 doesn't propagate
    this information anymore.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26124:bf249cd5f2c1
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Tue Oct 30 18:12:11 2012 +0000
    
    autoconf: add file missing from 26123:f6d5b3bf74a8
    
    This file was in 26123:f6d5b3bf74a8 as submitted but I failed to add it.
    
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 02 21:29:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Nov 2012 21:29:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUOnW-0002BX-AW; Fri, 02 Nov 2012 21:29:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TUOnU-0002BS-Ln
	for xen-devel@lists.xensource.com; Fri, 02 Nov 2012 21:29:00 +0000
Received: from [85.158.137.99:48931] by server-12.bemta-3.messagelabs.com id
	BD/2F-22757-71B34905; Fri, 02 Nov 2012 21:28:55 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1351891733!16645611!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTY5ODk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30341 invoked from network); 2 Nov 2012 21:28:53 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	2 Nov 2012 21:28:53 -0000
X-IronPort-AV: E=Sophos;i="4.80,701,1344211200"; d="scan'208";a="15564829"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	02 Nov 2012 21:28:52 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 2 Nov 2012 21:28:51 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TUOnM-00006A-58;
	Fri, 02 Nov 2012 21:28:52 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TUOnM-0005X3-1o;
	Fri, 02 Nov 2012 21:28:52 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14346-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 2 Nov 2012 21:28:52 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14346: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14346 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14346/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-xl-winxpsp3-vcpus1 12 guest-localmigrate/x10 fail REGR. vs. 14337

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14337
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14337
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14337
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14337

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  bd78e5630a5b
baseline version:
 xen                  bf249cd5f2c1

------------------------------------------------------------
People who touched revisions under test:
  "Huang2, Wei" <Wei.Huang2@amd.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26127:bd78e5630a5b
tag:         tip
user:        Jan Beulich <jbeulich@suse.com>
date:        Fri Nov 02 17:15:30 2012 +0100
    
    IOMMU: keep disabled until iommu_setup() is called
    
    The iommu is enabled by default when xen is booting and later disabled
    in iommu_setup() when no iommu is present.
    
    But under some circumstances iommu code can be called before
    iommu_setup() is processed. If there is no iommu available xen crashes.
    
    This can happen for example when panic(...) is called as introduced
    with the patch "x86-64: detect processors subject to AMD erratum #121
    and refuse to boot" since xen 4.1.3, resulting in
    find_iommu_for_device() to be called in the context of
    disable_IO_APIC() / __stop_this_cpu().
    
    This patch fixes this by keeping the iommu disabled until iommu_setup()
    is entered.
    
    Originally-by: Ronny Hegewald <ronny.hegewald@online.de>
    
    In order for iommu_enable to be off initially, iommu_supports_eim()
    must not depend on it anymore, nor must acpi_parse_dmar(). The former
    in turn requires that iommu_intremap gets uncoupled from iommu_enabled
    (in particular, failure during IOMMU setup should no longer result in
    iommu_intremap getting cleared by generic code; IOMMU specific code
    can still do so provided in can live with the consequences).
    
    This could have the nice side effect of allowing to use "iommu=off"
    even when x2APIC was pre-enabled by the BIOS (in which case interrupt
    remapping is a requirement, but DMA translation [obviously] isn't), but
    that doesn't currently work (and hence x2apic_bsp_setup() forces the
    IOMMU on rather than just interrupt remapping).
    
    For consistency with VT-d, make the AMD IOMMU code also skip all ACPI
    table parsing when neither iommu_enable nor iommu_intremap are set.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>
    Acked-by: "Huang2, Wei" <Wei.Huang2@amd.com>
    
    
changeset:   26126:cacdc787d11f
user:        Jan Beulich <jbeulich@suse.com>
date:        Fri Nov 02 16:15:53 2012 +0100
    
    x86/mwait-idle: enable Ivy Bridge Xeon support
    
    Matching a similar change in Linux 3.7-rc.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26125:951d04441908
user:        Jan Beulich <jbeulich@suse.com>
date:        Fri Nov 02 16:14:11 2012 +0100
    
    ACPI/cpuidle: remove unused "power" field from Cx state data
    
    It has never been used for anything, and Linux 3.7 doesn't propagate
    this information anymore.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26124:bf249cd5f2c1
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Tue Oct 30 18:12:11 2012 +0000
    
    autoconf: add file missing from 26123:f6d5b3bf74a8
    
    This file was in 26123:f6d5b3bf74a8 as submitted but I failed to add it.
    
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 03 01:33:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Nov 2012 01:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUSbV-0007De-UX; Sat, 03 Nov 2012 01:32:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TUSbU-0007DZ-23
	for xen-devel@lists.xensource.com; Sat, 03 Nov 2012 01:32:52 +0000
Received: from [85.158.137.99:4840] by server-11.bemta-3.messagelabs.com id
	B7/56-19361-34474905; Sat, 03 Nov 2012 01:32:51 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1351906369!14379140!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTcxMzU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30473 invoked from network); 3 Nov 2012 01:32:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	3 Nov 2012 01:32:50 -0000
X-IronPort-AV: E=Sophos;i="4.80,702,1344211200"; d="scan'208";a="15565724"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	03 Nov 2012 01:32:48 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sat, 3 Nov 2012 01:32:48 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TUSbQ-0001OL-AR;
	Sat, 03 Nov 2012 01:32:48 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TUSbQ-000252-3j;
	Sat, 03 Nov 2012 01:32:48 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14349-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sat, 3 Nov 2012 01:32:48 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14349: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14349 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14349/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14337
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14337
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14337
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14337

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  bd78e5630a5b
baseline version:
 xen                  bf249cd5f2c1

------------------------------------------------------------
People who touched revisions under test:
  "Huang2, Wei" <Wei.Huang2@amd.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=bd78e5630a5b
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable bd78e5630a5b
+ branch=xen-unstable
+ revision=bd78e5630a5b
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r bd78e5630a5b ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 3 changesets with 11 changes to 10 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 03 01:33:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Nov 2012 01:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUSbV-0007De-UX; Sat, 03 Nov 2012 01:32:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TUSbU-0007DZ-23
	for xen-devel@lists.xensource.com; Sat, 03 Nov 2012 01:32:52 +0000
Received: from [85.158.137.99:4840] by server-11.bemta-3.messagelabs.com id
	B7/56-19361-34474905; Sat, 03 Nov 2012 01:32:51 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1351906369!14379140!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTcxMzU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30473 invoked from network); 3 Nov 2012 01:32:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	3 Nov 2012 01:32:50 -0000
X-IronPort-AV: E=Sophos;i="4.80,702,1344211200"; d="scan'208";a="15565724"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	03 Nov 2012 01:32:48 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sat, 3 Nov 2012 01:32:48 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TUSbQ-0001OL-AR;
	Sat, 03 Nov 2012 01:32:48 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TUSbQ-000252-3j;
	Sat, 03 Nov 2012 01:32:48 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14349-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sat, 3 Nov 2012 01:32:48 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14349: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14349 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14349/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14337
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14337
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14337
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14337

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  bd78e5630a5b
baseline version:
 xen                  bf249cd5f2c1

------------------------------------------------------------
People who touched revisions under test:
  "Huang2, Wei" <Wei.Huang2@amd.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=bd78e5630a5b
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable bd78e5630a5b
+ branch=xen-unstable
+ revision=bd78e5630a5b
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r bd78e5630a5b ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 3 changesets with 11 changes to 10 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 03 01:39:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Nov 2012 01:39:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUShn-0007Rg-0t; Sat, 03 Nov 2012 01:39:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ronny.hegewald@online.de>) id 1TUShl-0007RY-EC
	for xen-devel@lists.xen.org; Sat, 03 Nov 2012 01:39:21 +0000
Received: from [193.109.254.147:44860] by server-11.bemta-14.messagelabs.com
	id 42/93-29027-8C574905; Sat, 03 Nov 2012 01:39:20 +0000
X-Env-Sender: ronny.hegewald@online.de
X-Msg-Ref: server-3.tower-27.messagelabs.com!1351906760!9532321!1
X-Originating-IP: [212.227.126.171]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xNzEgPT4gNjM3NDE=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xNzEgPT4gNjM3NDE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32092 invoked from network); 3 Nov 2012 01:39:20 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.126.171)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	3 Nov 2012 01:39:20 -0000
Received: from server2-groupware.localnet (kons-d9be1d83.pool.mediaWays.net
	[217.190.29.131])
	by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis)
	id 0Lar3w-1T6NIq0eCW-00kr5a; Sat, 03 Nov 2012 02:39:16 +0100
From: Ronny Hegewald <ronny.hegewald@online.de>
To: "Jan Beulich" <JBeulich@suse.com>
Date: Sat, 3 Nov 2012 02:44:58 +0000
User-Agent: KMail/1.11.4 (Linux/3.0.3; KDE/4.2.4; i686; ; )
References: <509400BD02000078000A6258@nat28.tlf.novell.com>
In-Reply-To: <509400BD02000078000A6258@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
Message-Id: <201211030244.58300.ronny.hegewald@online.de>
X-Provags-ID: V02:K0:SBvkB/DtaPPykQf0R5pprrxVlSF2iyb+h34EzzVzQfT
	Z60HhczCHZteyudMVzwn5411ZjeETdshiRfOBDW6dipwv0BswZ
	H7vFocGFtGj2weCQXkY6TjzjejgI9pDUrzh9YfQo59rI89k6Yw
	P5gqMIVFFd4xXG+LNsGaxi1aoX0y2c7hPEz/f4bhlOGNecb+rm
	SafWbekY1OuzcBgO81z4Z9tP/klSXw3loXqU79504tim0fgYO7
	OwDvoF26bq3XexD/eGEzXEZmCGF1IyF4OYSHCT1V6GBrDxF+iH
	bIhl0+1B0mHCXMfxFQh/vm+Bo9v+LRdmwuMPDmlaN4MBxawjNi
	5xoez7fZKn+gKr4rmy3gznRpmPqEj+2SY6RHsRLkYxhKHDNxi9
	Rpbydh4z05yiQ4G55CwYJF/CCS/US0yq14=
Cc: wei.huang2@amd.com, weiwang.dd@gmail.com, xiantao.zhang@intel.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v3] IOMMU: keep disabled until iommu_setup()
	is called
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> So after having got acks from both Intel and AMD, I committed
> this to -unstable, but I'm rather hesitant to backport this onto the
> 4.x branches (not the least because in the end this is just
> cosmetic for the problem you reported - the box would not boot
> in either case, just that with the patch it is more obvious why).

Actually the affected box can still boot xen. But you have to add the 
"allow_unsafe" option to the boot-parameters, which you are informed about as 
long the intended panic message is printed. 

Without the patch their is just the crash and the stacktrace.

But this problem seem only to hit some older AMD cpus for socket 754,939 and 
940 (as noted in CVE-2012-2934), and i didnt find any other report on the web 
about this xen crash. 

So it looks minor enough to not trouble the stable-branches with it imho too.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 03 01:39:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Nov 2012 01:39:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUShn-0007Rg-0t; Sat, 03 Nov 2012 01:39:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ronny.hegewald@online.de>) id 1TUShl-0007RY-EC
	for xen-devel@lists.xen.org; Sat, 03 Nov 2012 01:39:21 +0000
Received: from [193.109.254.147:44860] by server-11.bemta-14.messagelabs.com
	id 42/93-29027-8C574905; Sat, 03 Nov 2012 01:39:20 +0000
X-Env-Sender: ronny.hegewald@online.de
X-Msg-Ref: server-3.tower-27.messagelabs.com!1351906760!9532321!1
X-Originating-IP: [212.227.126.171]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xNzEgPT4gNjM3NDE=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xNzEgPT4gNjM3NDE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32092 invoked from network); 3 Nov 2012 01:39:20 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.126.171)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	3 Nov 2012 01:39:20 -0000
Received: from server2-groupware.localnet (kons-d9be1d83.pool.mediaWays.net
	[217.190.29.131])
	by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis)
	id 0Lar3w-1T6NIq0eCW-00kr5a; Sat, 03 Nov 2012 02:39:16 +0100
From: Ronny Hegewald <ronny.hegewald@online.de>
To: "Jan Beulich" <JBeulich@suse.com>
Date: Sat, 3 Nov 2012 02:44:58 +0000
User-Agent: KMail/1.11.4 (Linux/3.0.3; KDE/4.2.4; i686; ; )
References: <509400BD02000078000A6258@nat28.tlf.novell.com>
In-Reply-To: <509400BD02000078000A6258@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
Message-Id: <201211030244.58300.ronny.hegewald@online.de>
X-Provags-ID: V02:K0:SBvkB/DtaPPykQf0R5pprrxVlSF2iyb+h34EzzVzQfT
	Z60HhczCHZteyudMVzwn5411ZjeETdshiRfOBDW6dipwv0BswZ
	H7vFocGFtGj2weCQXkY6TjzjejgI9pDUrzh9YfQo59rI89k6Yw
	P5gqMIVFFd4xXG+LNsGaxi1aoX0y2c7hPEz/f4bhlOGNecb+rm
	SafWbekY1OuzcBgO81z4Z9tP/klSXw3loXqU79504tim0fgYO7
	OwDvoF26bq3XexD/eGEzXEZmCGF1IyF4OYSHCT1V6GBrDxF+iH
	bIhl0+1B0mHCXMfxFQh/vm+Bo9v+LRdmwuMPDmlaN4MBxawjNi
	5xoez7fZKn+gKr4rmy3gznRpmPqEj+2SY6RHsRLkYxhKHDNxi9
	Rpbydh4z05yiQ4G55CwYJF/CCS/US0yq14=
Cc: wei.huang2@amd.com, weiwang.dd@gmail.com, xiantao.zhang@intel.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v3] IOMMU: keep disabled until iommu_setup()
	is called
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> So after having got acks from both Intel and AMD, I committed
> this to -unstable, but I'm rather hesitant to backport this onto the
> 4.x branches (not the least because in the end this is just
> cosmetic for the problem you reported - the box would not boot
> in either case, just that with the patch it is more obvious why).

Actually the affected box can still boot xen. But you have to add the 
"allow_unsafe" option to the boot-parameters, which you are informed about as 
long the intended panic message is printed. 

Without the patch their is just the crash and the stacktrace.

But this problem seem only to hit some older AMD cpus for socket 754,939 and 
940 (as noted in CVE-2012-2934), and i didnt find any other report on the web 
about this xen crash. 

So it looks minor enough to not trouble the stable-branches with it imho too.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 03 01:51:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Nov 2012 01:51:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUSsZ-0007cb-6W; Sat, 03 Nov 2012 01:50:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ronny.hegewald@online.de>) id 1TUSsX-0007cW-Le
	for xen-devel@lists.xen.org; Sat, 03 Nov 2012 01:50:29 +0000
Received: from [85.158.143.99:15903] by server-3.bemta-4.messagelabs.com id
	F9/55-06841-46874905; Sat, 03 Nov 2012 01:50:28 +0000
X-Env-Sender: ronny.hegewald@online.de
X-Msg-Ref: server-10.tower-216.messagelabs.com!1351907427!22051069!1
X-Originating-IP: [212.227.126.171]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xNzEgPT4gNjM3NDE=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xNzEgPT4gNjM3NDE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28594 invoked from network); 3 Nov 2012 01:50:27 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.126.171)
	by server-10.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	3 Nov 2012 01:50:27 -0000
Received: from server2-groupware.localnet (kons-d9be1d83.pool.mediaWays.net
	[217.190.29.131])
	by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis)
	id 0MLC0j-1TUjzd0acz-000sPE; Sat, 03 Nov 2012 02:50:24 +0100
From: Ronny Hegewald <ronny.hegewald@online.de>
To: xen-devel@lists.xen.org
Date: Sat, 3 Nov 2012 02:55:37 +0000
User-Agent: KMail/1.11.4 (Linux/3.0.3; KDE/4.2.4; i686; ; )
References: <201211010218.14872.ronny.hegewald@online.de>
	<1351756924.25014.29.camel@hastur.hellion.org.uk>
	<201211022101.08926.ronny.hegewald@online.de>
In-Reply-To: <201211022101.08926.ronny.hegewald@online.de>
MIME-Version: 1.0
Content-Disposition: inline
Message-Id: <201211030255.37630.ronny.hegewald@online.de>
X-Provags-ID: V02:K0:fO/pff7CRVACYSedO3ZvGx49xB5gK+wQvbJJ5VoU9qd
	tTNZOFhHvv0DuAoFBgvUN5xVmslxcgr7RmwYeD+WIfQOzyu/Ke
	ZDsH9GhePl1V5KtI2zyXF+qdNX25HkcShVX1iRACFiYfOgiHS7
	c0x8pAQHokCQRs3d6Y0AZy/E762O6me17LhtZgGJ5KJdDi5i57
	izCEQMvVwoJ4wsiRB5nGkW8AvzDPMmX1M235+0DVsp4+cOC9PQ
	yT4Yu1KZ1rY3UfMM49iP7uJ6aOpVY95Go7ZK0rnrFR0kUwd5GP
	JTrYiHJYSJ5WW+wCYvFprDbhA7nzjUGlNp5PsNKH3QuuOWJl0G
	3iPlwKa+NaLb2BwTXJePaLNhDzN+dH3XualIHdMqvvFAhlYtZk
	g/RD3nAjUDjE+wTuC9zIYWuMoZIClZKVa8=
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH V2] fix vfb related assertion problem when
	starting pv-domU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>
> Signed-off-by: Ronny Hegewald@online.de
>

Somehow the sign off gone wrong. it was supposed to be

Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 03 01:51:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Nov 2012 01:51:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUSsZ-0007cb-6W; Sat, 03 Nov 2012 01:50:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ronny.hegewald@online.de>) id 1TUSsX-0007cW-Le
	for xen-devel@lists.xen.org; Sat, 03 Nov 2012 01:50:29 +0000
Received: from [85.158.143.99:15903] by server-3.bemta-4.messagelabs.com id
	F9/55-06841-46874905; Sat, 03 Nov 2012 01:50:28 +0000
X-Env-Sender: ronny.hegewald@online.de
X-Msg-Ref: server-10.tower-216.messagelabs.com!1351907427!22051069!1
X-Originating-IP: [212.227.126.171]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xNzEgPT4gNjM3NDE=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xNzEgPT4gNjM3NDE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28594 invoked from network); 3 Nov 2012 01:50:27 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.126.171)
	by server-10.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	3 Nov 2012 01:50:27 -0000
Received: from server2-groupware.localnet (kons-d9be1d83.pool.mediaWays.net
	[217.190.29.131])
	by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis)
	id 0MLC0j-1TUjzd0acz-000sPE; Sat, 03 Nov 2012 02:50:24 +0100
From: Ronny Hegewald <ronny.hegewald@online.de>
To: xen-devel@lists.xen.org
Date: Sat, 3 Nov 2012 02:55:37 +0000
User-Agent: KMail/1.11.4 (Linux/3.0.3; KDE/4.2.4; i686; ; )
References: <201211010218.14872.ronny.hegewald@online.de>
	<1351756924.25014.29.camel@hastur.hellion.org.uk>
	<201211022101.08926.ronny.hegewald@online.de>
In-Reply-To: <201211022101.08926.ronny.hegewald@online.de>
MIME-Version: 1.0
Content-Disposition: inline
Message-Id: <201211030255.37630.ronny.hegewald@online.de>
X-Provags-ID: V02:K0:fO/pff7CRVACYSedO3ZvGx49xB5gK+wQvbJJ5VoU9qd
	tTNZOFhHvv0DuAoFBgvUN5xVmslxcgr7RmwYeD+WIfQOzyu/Ke
	ZDsH9GhePl1V5KtI2zyXF+qdNX25HkcShVX1iRACFiYfOgiHS7
	c0x8pAQHokCQRs3d6Y0AZy/E762O6me17LhtZgGJ5KJdDi5i57
	izCEQMvVwoJ4wsiRB5nGkW8AvzDPMmX1M235+0DVsp4+cOC9PQ
	yT4Yu1KZ1rY3UfMM49iP7uJ6aOpVY95Go7ZK0rnrFR0kUwd5GP
	JTrYiHJYSJ5WW+wCYvFprDbhA7nzjUGlNp5PsNKH3QuuOWJl0G
	3iPlwKa+NaLb2BwTXJePaLNhDzN+dH3XualIHdMqvvFAhlYtZk
	g/RD3nAjUDjE+wTuC9zIYWuMoZIClZKVa8=
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH V2] fix vfb related assertion problem when
	starting pv-domU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>
> Signed-off-by: Ronny Hegewald@online.de
>

Somehow the sign off gone wrong. it was supposed to be

Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 03 05:36:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Nov 2012 05:36:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUWP0-0000WQ-6c; Sat, 03 Nov 2012 05:36:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TUWOy-0000WL-MM
	for xen-devel@lists.xensource.com; Sat, 03 Nov 2012 05:36:12 +0000
Received: from [85.158.139.83:15033] by server-8.bemta-5.messagelabs.com id
	98/2F-06050-B4DA4905; Sat, 03 Nov 2012 05:36:11 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1351920971!25854727!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTcxMzU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7907 invoked from network); 3 Nov 2012 05:36:11 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	3 Nov 2012 05:36:11 -0000
X-IronPort-AV: E=Sophos;i="4.80,704,1344211200"; d="scan'208";a="15566711"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	03 Nov 2012 05:36:10 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sat, 3 Nov 2012 05:36:09 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TUWOw-0002gM-00;
	Sat, 03 Nov 2012 05:36:10 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TUWOv-00082J-Jp;
	Sat, 03 Nov 2012 05:36:09 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14352-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sat, 3 Nov 2012 05:36:09 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14352: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14352 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14352/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14349
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14349
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14349
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14349

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  bd78e5630a5b
baseline version:
 xen                  bd78e5630a5b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 03 05:36:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Nov 2012 05:36:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUWP0-0000WQ-6c; Sat, 03 Nov 2012 05:36:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TUWOy-0000WL-MM
	for xen-devel@lists.xensource.com; Sat, 03 Nov 2012 05:36:12 +0000
Received: from [85.158.139.83:15033] by server-8.bemta-5.messagelabs.com id
	98/2F-06050-B4DA4905; Sat, 03 Nov 2012 05:36:11 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1351920971!25854727!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTcxMzU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7907 invoked from network); 3 Nov 2012 05:36:11 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	3 Nov 2012 05:36:11 -0000
X-IronPort-AV: E=Sophos;i="4.80,704,1344211200"; d="scan'208";a="15566711"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	03 Nov 2012 05:36:10 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sat, 3 Nov 2012 05:36:09 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TUWOw-0002gM-00;
	Sat, 03 Nov 2012 05:36:10 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TUWOv-00082J-Jp;
	Sat, 03 Nov 2012 05:36:09 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14352-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sat, 3 Nov 2012 05:36:09 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14352: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14352 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14352/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14349
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14349
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14349
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14349

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  bd78e5630a5b
baseline version:
 xen                  bd78e5630a5b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 03 12:17:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Nov 2012 12:17:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUceh-0002ow-Rb; Sat, 03 Nov 2012 12:16:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TUceg-0002or-BZ
	for xen-devel@lists.xen.org; Sat, 03 Nov 2012 12:16:50 +0000
Received: from [85.158.139.83:24960] by server-3.bemta-5.messagelabs.com id
	F8/62-18736-13B05905; Sat, 03 Nov 2012 12:16:49 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1351945008!28622184!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjI2OTMw\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4194 invoked from network); 3 Nov 2012 12:16:48 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-5.tower-182.messagelabs.com with SMTP;
	3 Nov 2012 12:16:48 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga101.ch.intel.com with ESMTP; 03 Nov 2012 05:16:47 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,705,1344236400"; d="scan'208";a="164103494"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by AZSMGA002.ch.intel.com with ESMTP; 03 Nov 2012 05:16:46 -0700
Received: from FMSMSX109.amr.corp.intel.com (10.19.9.28) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Sat, 3 Nov 2012 05:16:46 -0700
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	fmsmsx109.amr.corp.intel.com (10.19.9.28) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Sat, 3 Nov 2012 05:16:46 -0700
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Sat, 3 Nov 2012 20:16:44 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Jan Beulich <JBeulich@suse.com>, Konrad Rzeszutek Wilk
	<konrad.wilk@oracle.com>
Thread-Topic: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
Thread-Index: AQHNuRoMTi91BiFLfUibRvXA4zlK85fX//8g
Date: Sat, 3 Nov 2012 12:16:44 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537A2A5@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<5089676602000078000A4928@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC82923353723C7@SHSMSX101.ccr.corp.intel.com>
	<508A89CB020000780008E6ED@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
In-Reply-To: <20121102164937.GC27213@konrad-lan.dumpdata.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Konrad Rzeszutek Wilk wrote:
>>> From f514b97628945cfac00efb0d456f133d44754c9d Mon Sep 17 00:00:00
>>> 2001 
>> From: Liu, Jinsong <jinsong.liu@intel.com>
>> Date: Thu, 1 Nov 2012 21:02:36 +0800
>> Subject: [PATCH 1/2] Xen acpi pad implement
>> 
>> PAD is acpi Processor Aggregator Device which provides a control
>> point 
>> that enables the platform to perform specific processor configuration
>> and control that applies to all processors in the platform.
>> 
>> This patch is to implement Xen acpi pad logic. When running under Xen
>> virt platform, native pad driver would not work. Instead Xen pad
>> driver, 
>> a self-contained and very thin logic level, would take over acpi pad
>> staff. When acpi pad notify OSPM, xen pad logic intercept and parse
>> _PUR object 
>> and then hypercall to hyervisor for the rest work, say, core parking.
> 
> Two comments:
>  - Did you look at the SuSE tree? Jan mentioned that they did some
>    fixes? Did you carry them over?

I didn't look at Suse tree.

Jan, would you please tell me where can I pull Suse tree? have you implemented xen-acpi-pad logic at Suse dom0 and which points you have fixed?


>  - The init function should not make hypercalls before checking if it
>    in facts run under Xen.

OK.

>> +
>> +static const struct acpi_device_id pad_device_ids[] = {
>> +	{"ACPI000C", 0}, +	{"", 0},
>> +};
>> +
>> +static struct acpi_driver xen_acpi_pad_driver = {
>> +	.name = "processor_aggregator",
>> +	.class = ACPI_PROCESSOR_AGGREGATOR_CLASS,
>> +	.ids = pad_device_ids,
>> +	.ops = {
>> +		.add = xen_acpi_pad_add,
>> +		.remove = xen_acpi_pad_remove,
>> +	},
>> +};
>> +
>> +static int __init xen_acpi_pad_init(void)
>> +{
>> +	int ret = -ENOSYS;
>> +	unsigned int version = HYPERVISOR_xen_version(XENVER_version,
>> NULL); 
> 
> Heh. so if you run this on baremetal I wonder what will happen.
> 
>> +	unsigned int major = version >> 16;
>> +	unsigned int minor = version & 0xffff;
>> +
>> +	/* Only DOM0 is responsible for Xen acpi pad */
>> +	if (!xen_initial_domain())
>> +		return -ENODEV;
>> +
> 
> I think the check for version should happen here.

Got it, will update later.

Thanks,
Jinsong


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 03 12:17:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Nov 2012 12:17:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUceh-0002ow-Rb; Sat, 03 Nov 2012 12:16:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TUceg-0002or-BZ
	for xen-devel@lists.xen.org; Sat, 03 Nov 2012 12:16:50 +0000
Received: from [85.158.139.83:24960] by server-3.bemta-5.messagelabs.com id
	F8/62-18736-13B05905; Sat, 03 Nov 2012 12:16:49 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1351945008!28622184!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjI2OTMw\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4194 invoked from network); 3 Nov 2012 12:16:48 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-5.tower-182.messagelabs.com with SMTP;
	3 Nov 2012 12:16:48 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga101.ch.intel.com with ESMTP; 03 Nov 2012 05:16:47 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,705,1344236400"; d="scan'208";a="164103494"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by AZSMGA002.ch.intel.com with ESMTP; 03 Nov 2012 05:16:46 -0700
Received: from FMSMSX109.amr.corp.intel.com (10.19.9.28) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Sat, 3 Nov 2012 05:16:46 -0700
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	fmsmsx109.amr.corp.intel.com (10.19.9.28) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Sat, 3 Nov 2012 05:16:46 -0700
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Sat, 3 Nov 2012 20:16:44 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Jan Beulich <JBeulich@suse.com>, Konrad Rzeszutek Wilk
	<konrad.wilk@oracle.com>
Thread-Topic: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
Thread-Index: AQHNuRoMTi91BiFLfUibRvXA4zlK85fX//8g
Date: Sat, 3 Nov 2012 12:16:44 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537A2A5@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<5089676602000078000A4928@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC82923353723C7@SHSMSX101.ccr.corp.intel.com>
	<508A89CB020000780008E6ED@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
In-Reply-To: <20121102164937.GC27213@konrad-lan.dumpdata.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Konrad Rzeszutek Wilk wrote:
>>> From f514b97628945cfac00efb0d456f133d44754c9d Mon Sep 17 00:00:00
>>> 2001 
>> From: Liu, Jinsong <jinsong.liu@intel.com>
>> Date: Thu, 1 Nov 2012 21:02:36 +0800
>> Subject: [PATCH 1/2] Xen acpi pad implement
>> 
>> PAD is acpi Processor Aggregator Device which provides a control
>> point 
>> that enables the platform to perform specific processor configuration
>> and control that applies to all processors in the platform.
>> 
>> This patch is to implement Xen acpi pad logic. When running under Xen
>> virt platform, native pad driver would not work. Instead Xen pad
>> driver, 
>> a self-contained and very thin logic level, would take over acpi pad
>> staff. When acpi pad notify OSPM, xen pad logic intercept and parse
>> _PUR object 
>> and then hypercall to hyervisor for the rest work, say, core parking.
> 
> Two comments:
>  - Did you look at the SuSE tree? Jan mentioned that they did some
>    fixes? Did you carry them over?

I didn't look at Suse tree.

Jan, would you please tell me where can I pull Suse tree? have you implemented xen-acpi-pad logic at Suse dom0 and which points you have fixed?


>  - The init function should not make hypercalls before checking if it
>    in facts run under Xen.

OK.

>> +
>> +static const struct acpi_device_id pad_device_ids[] = {
>> +	{"ACPI000C", 0}, +	{"", 0},
>> +};
>> +
>> +static struct acpi_driver xen_acpi_pad_driver = {
>> +	.name = "processor_aggregator",
>> +	.class = ACPI_PROCESSOR_AGGREGATOR_CLASS,
>> +	.ids = pad_device_ids,
>> +	.ops = {
>> +		.add = xen_acpi_pad_add,
>> +		.remove = xen_acpi_pad_remove,
>> +	},
>> +};
>> +
>> +static int __init xen_acpi_pad_init(void)
>> +{
>> +	int ret = -ENOSYS;
>> +	unsigned int version = HYPERVISOR_xen_version(XENVER_version,
>> NULL); 
> 
> Heh. so if you run this on baremetal I wonder what will happen.
> 
>> +	unsigned int major = version >> 16;
>> +	unsigned int minor = version & 0xffff;
>> +
>> +	/* Only DOM0 is responsible for Xen acpi pad */
>> +	if (!xen_initial_domain())
>> +		return -ENODEV;
>> +
> 
> I think the check for version should happen here.

Got it, will update later.

Thanks,
Jinsong


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 03 15:25:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Nov 2012 15:25:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUfaI-0003Wb-V1; Sat, 03 Nov 2012 15:24:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TUfaH-0003WW-GR
	for xen-devel@lists.xensource.com; Sat, 03 Nov 2012 15:24:29 +0000
Received: from [85.158.139.211:61922] by server-14.bemta-5.messagelabs.com id
	B3/5D-21768-C2735905; Sat, 03 Nov 2012 15:24:28 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1351956267!18758938!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTcyMzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31194 invoked from network); 3 Nov 2012 15:24:27 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	3 Nov 2012 15:24:27 -0000
X-IronPort-AV: E=Sophos;i="4.80,705,1344211200"; d="scan'208";a="15569188"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	03 Nov 2012 15:24:26 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sat, 3 Nov 2012 15:24:26 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TUfaE-000657-ED;
	Sat, 03 Nov 2012 15:24:26 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TUfaE-0000xz-0t;
	Sat, 03 Nov 2012 15:24:26 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14354-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sat, 3 Nov 2012 15:24:26 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [linux-3.0 test] 14354: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14354 linux-3.0 real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14354/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14199
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14199
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14199
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14199

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass

version targeted for testing:
 linux                27d0858dbcf199838b8c50a3e94d397bf326d986
baseline version:
 linux                d9ee258b13506301b6da6450cf7a1692826b471e

------------------------------------------------------------
People who touched revisions under test:
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=linux-3.0
+ revision=27d0858dbcf199838b8c50a3e94d397bf326d986
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push linux-3.0 27d0858dbcf199838b8c50a3e94d397bf326d986
+ branch=linux-3.0
+ revision=27d0858dbcf199838b8c50a3e94d397bf326d986
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=linux
+ xenbranch=xen-unstable
+ '[' xlinux = xlinux ']'
+ linuxbranch=linux-3.0
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.linux-3.0
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.linux-3.0
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree linux-3.0
+ case $1 in
+ : git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
+ : linux-3.0.y
+ : linux-3.0.y
+ : git
+ : git
+ : git://xenbits.xen.org/linux-pvops.git
+ : xen@xenbits.xensource.com:git/linux-pvops.git
+ : tested/linux-3.0
+ : tested/linux-3.0
+ return 0
+ cd /export/home/osstest/repos/linux
+ git push xen@xenbits.xensource.com:git/linux-pvops.git 27d0858dbcf199838b8c50a3e94d397bf326d986:tested/linux-3.0
Counting objects: 1   
Counting objects: 255, done.
Compressing objects:   2% (1/36)   
Compressing objects:   5% (2/36)   
Compressing objects:   8% (3/36)   
Compressing objects:  11% (4/36)   
Compressing objects:  13% (5/36)   
Compressing objects:  16% (6/36)   
Compressing objects:  19% (7/36)   
Compressing objects:  22% (8/36)   
Compressing objects:  25% (9/36)   
Compressing objects:  27% (10/36)   
Compressing objects:  30% (11/36)   
Compressing objects:  33% (12/36)   
Compressing objects:  36% (13/36)   
Compressing objects:  38% (14/36)   
Compressing objects:  41% (15/36)   
Compressing objects:  44% (16/36)   
Compressing objects:  47% (17/36)   
Compressing objects:  50% (18/36)   
Compressing objects:  52% (19/36)   
Compressing objects:  55% (20/36)   
Compressing objects:  58% (21/36)   
Compressing objects:  61% (22/36)   
Compressing objects:  63% (23/36)   
Compressing objects:  66% (24/36)   
Compressing objects:  69% (25/36)   
Compressing objects:  72% (26/36)   
Compressing objects:  75% (27/36)   
Compressing objects:  77% (28/36)   
Compressing objects:  80% (29/36)   
Compressing objects:  83% (30/36)   
Compressing objects:  86% (31/36)   
Compressing objects:  88% (32/36)   
Compressing objects:  91% (33/36)   
Compressing objects:  94% (34/36)   
Compressing objects:  97% (35/36)   
Compressing objects: 100% (36/36)   
Compressing objects: 100% (36/36), done.
Writing objects:   0% (1/197)   
Writing objects:   1% (2/197)   
Writing objects:   2% (4/197)   
Writing objects:   3% (6/197)   
Writing objects:   4% (8/197)   
Writing objects:   5% (10/197)   
Writing objects:   6% (12/197)   
Writing objects:   7% (14/197)   
Writing objects:   8% (16/197)   
Writing objects:   9% (18/197)   
Writing objects:  10% (20/197)   
Writing objects:  11% (22/197)   
Writing objects:  12% (24/197)   
Writing objects:  13% (26/197)   
Writing objects:  14% (28/197)   
Writing objects:  15% (30/197)   
Writing objects:  16% (32/197)   
Writing objects:  17% (34/197)   
Writing objects:  18% (36/197)   
Writing objects:  19% (38/197)   
Writing objects:  20% (40/197)   
Writing objects:  21% (42/197)   
Writing objects:  22% (44/197)   
Writing objects:  23% (46/197)   
Writing objects:  24% (48/197)   
Writing objects:  25% (51/197)   
Writing objects:  26% (52/197)   
Writing objects:  27% (54/197)   
Writing objects:  28% (56/197)   
Writing objects:  29% (58/197)   
Writing objects:  30% (60/197)   
Writing objects:  31% (62/197)   
Writing objects:  32% (64/197)   
Writing objects:  33% (66/197)   
Writing objects:  34% (67/197)   
Writing objects:  35% (69/197)   
Writing objects:  36% (71/197)   
Writing objects:  37% (73/197)   
Writing objects:  38% (76/197)   
Writing objects:  39% (77/197)   
Writing objects:  40% (79/197)   
Writing objects:  41% (81/197)   
Writing objects:  42% (83/197)   
Writing objects:  43% (85/197)   
Writing objects:  44% (87/197)   
Writing objects:  45% (89/197)   
Writing objects:  46% (91/197)   
Writing objects:  47% (93/197)   
Writing objects:  48% (95/197)   
Writing objects:  49% (97/197)   
Writing objects:  50% (99/197)   
Writing objects:  51% (101/197)   
Writing objects:  52% (103/197)   
Writing objects:  53% (105/197)   
Writing objects:  54% (107/197)   
Writing objects:  55% (109/197)   
Writing objects:  56% (111/197)   
Writing objects:  57% (113/197)   
Writing objects:  58% (115/197)   
Writing objects:  59% (117/197)   
Writing objects:  60% (119/197)   
Writing objects:  61% (121/197)   
Writing objects:  62% (123/197)   
Writing objects:  63% (125/197)   
Writing objects:  64% (127/197)   
Writing objects:  65% (129/197)   
Writing objects:  66% (131/197)   
Writing objects:  67% (132/197)   
Writing objects:  68% (134/197)   
Writing objects:  69% (136/197)   
Writing objects:  70% (138/197)   
Writing objects:  71% (140/197)   
Writing objects:  72% (142/197)   
Writing objects:  73% (144/197)   
Writing objects:  74% (146/197)   
Writing objects:  75% (148/197)   
Writing objects:  76% (150/197)   
Writing objects:  77% (152/197)   
Writing objects:  78% (154/197)   
Writing objects:  79% (156/197)   
Writing objects:  80% (158/197)   
Writing objects:  81% (160/197)   
Writing objects:  82% (162/197)   
Writing objects:  83% (164/197)   
Writing objects:  84% (166/197)   
Writing objects:  85% (168/197)   
Writing objects:  86% (170/197)   
Writing objects:  87% (172/197)   
Writing objects:  88% (174/197)   
Writing objects:  89% (176/197)   
Writing objects:  90% (178/197)   
Writing objects:  91% (180/197)   
Writing objects:  92% (182/197)   
Writing objects:  93% (184/197)   
Writing objects:  94% (186/197)   
Writing objects:  95% (188/197)   
Writing objects:  96% (190/197)   
Writing objects:  97% (192/197)   
Writing objects:  98% (194/197)   
Writing objects:  99% (196/197)   
Writing objects: 100% (197/197)   
Writing objects: 100% (197/197), 32.90 KiB, done.
Total 197 (delta 161), reused 189 (delta 161)
To xen@xenbits.xensource.com:git/linux-pvops.git
   d9ee258..27d0858  27d0858dbcf199838b8c50a3e94d397bf326d986 -> tested/linux-3.0
+ exit 0

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 03 15:25:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Nov 2012 15:25:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUfaI-0003Wb-V1; Sat, 03 Nov 2012 15:24:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TUfaH-0003WW-GR
	for xen-devel@lists.xensource.com; Sat, 03 Nov 2012 15:24:29 +0000
Received: from [85.158.139.211:61922] by server-14.bemta-5.messagelabs.com id
	B3/5D-21768-C2735905; Sat, 03 Nov 2012 15:24:28 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1351956267!18758938!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTcyMzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31194 invoked from network); 3 Nov 2012 15:24:27 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	3 Nov 2012 15:24:27 -0000
X-IronPort-AV: E=Sophos;i="4.80,705,1344211200"; d="scan'208";a="15569188"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	03 Nov 2012 15:24:26 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sat, 3 Nov 2012 15:24:26 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TUfaE-000657-ED;
	Sat, 03 Nov 2012 15:24:26 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TUfaE-0000xz-0t;
	Sat, 03 Nov 2012 15:24:26 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14354-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sat, 3 Nov 2012 15:24:26 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [linux-3.0 test] 14354: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14354 linux-3.0 real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14354/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14199
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14199
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14199
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14199

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass

version targeted for testing:
 linux                27d0858dbcf199838b8c50a3e94d397bf326d986
baseline version:
 linux                d9ee258b13506301b6da6450cf7a1692826b471e

------------------------------------------------------------
People who touched revisions under test:
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=linux-3.0
+ revision=27d0858dbcf199838b8c50a3e94d397bf326d986
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push linux-3.0 27d0858dbcf199838b8c50a3e94d397bf326d986
+ branch=linux-3.0
+ revision=27d0858dbcf199838b8c50a3e94d397bf326d986
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=linux
+ xenbranch=xen-unstable
+ '[' xlinux = xlinux ']'
+ linuxbranch=linux-3.0
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.linux-3.0
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.linux-3.0
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree linux-3.0
+ case $1 in
+ : git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
+ : linux-3.0.y
+ : linux-3.0.y
+ : git
+ : git
+ : git://xenbits.xen.org/linux-pvops.git
+ : xen@xenbits.xensource.com:git/linux-pvops.git
+ : tested/linux-3.0
+ : tested/linux-3.0
+ return 0
+ cd /export/home/osstest/repos/linux
+ git push xen@xenbits.xensource.com:git/linux-pvops.git 27d0858dbcf199838b8c50a3e94d397bf326d986:tested/linux-3.0
Counting objects: 1   
Counting objects: 255, done.
Compressing objects:   2% (1/36)   
Compressing objects:   5% (2/36)   
Compressing objects:   8% (3/36)   
Compressing objects:  11% (4/36)   
Compressing objects:  13% (5/36)   
Compressing objects:  16% (6/36)   
Compressing objects:  19% (7/36)   
Compressing objects:  22% (8/36)   
Compressing objects:  25% (9/36)   
Compressing objects:  27% (10/36)   
Compressing objects:  30% (11/36)   
Compressing objects:  33% (12/36)   
Compressing objects:  36% (13/36)   
Compressing objects:  38% (14/36)   
Compressing objects:  41% (15/36)   
Compressing objects:  44% (16/36)   
Compressing objects:  47% (17/36)   
Compressing objects:  50% (18/36)   
Compressing objects:  52% (19/36)   
Compressing objects:  55% (20/36)   
Compressing objects:  58% (21/36)   
Compressing objects:  61% (22/36)   
Compressing objects:  63% (23/36)   
Compressing objects:  66% (24/36)   
Compressing objects:  69% (25/36)   
Compressing objects:  72% (26/36)   
Compressing objects:  75% (27/36)   
Compressing objects:  77% (28/36)   
Compressing objects:  80% (29/36)   
Compressing objects:  83% (30/36)   
Compressing objects:  86% (31/36)   
Compressing objects:  88% (32/36)   
Compressing objects:  91% (33/36)   
Compressing objects:  94% (34/36)   
Compressing objects:  97% (35/36)   
Compressing objects: 100% (36/36)   
Compressing objects: 100% (36/36), done.
Writing objects:   0% (1/197)   
Writing objects:   1% (2/197)   
Writing objects:   2% (4/197)   
Writing objects:   3% (6/197)   
Writing objects:   4% (8/197)   
Writing objects:   5% (10/197)   
Writing objects:   6% (12/197)   
Writing objects:   7% (14/197)   
Writing objects:   8% (16/197)   
Writing objects:   9% (18/197)   
Writing objects:  10% (20/197)   
Writing objects:  11% (22/197)   
Writing objects:  12% (24/197)   
Writing objects:  13% (26/197)   
Writing objects:  14% (28/197)   
Writing objects:  15% (30/197)   
Writing objects:  16% (32/197)   
Writing objects:  17% (34/197)   
Writing objects:  18% (36/197)   
Writing objects:  19% (38/197)   
Writing objects:  20% (40/197)   
Writing objects:  21% (42/197)   
Writing objects:  22% (44/197)   
Writing objects:  23% (46/197)   
Writing objects:  24% (48/197)   
Writing objects:  25% (51/197)   
Writing objects:  26% (52/197)   
Writing objects:  27% (54/197)   
Writing objects:  28% (56/197)   
Writing objects:  29% (58/197)   
Writing objects:  30% (60/197)   
Writing objects:  31% (62/197)   
Writing objects:  32% (64/197)   
Writing objects:  33% (66/197)   
Writing objects:  34% (67/197)   
Writing objects:  35% (69/197)   
Writing objects:  36% (71/197)   
Writing objects:  37% (73/197)   
Writing objects:  38% (76/197)   
Writing objects:  39% (77/197)   
Writing objects:  40% (79/197)   
Writing objects:  41% (81/197)   
Writing objects:  42% (83/197)   
Writing objects:  43% (85/197)   
Writing objects:  44% (87/197)   
Writing objects:  45% (89/197)   
Writing objects:  46% (91/197)   
Writing objects:  47% (93/197)   
Writing objects:  48% (95/197)   
Writing objects:  49% (97/197)   
Writing objects:  50% (99/197)   
Writing objects:  51% (101/197)   
Writing objects:  52% (103/197)   
Writing objects:  53% (105/197)   
Writing objects:  54% (107/197)   
Writing objects:  55% (109/197)   
Writing objects:  56% (111/197)   
Writing objects:  57% (113/197)   
Writing objects:  58% (115/197)   
Writing objects:  59% (117/197)   
Writing objects:  60% (119/197)   
Writing objects:  61% (121/197)   
Writing objects:  62% (123/197)   
Writing objects:  63% (125/197)   
Writing objects:  64% (127/197)   
Writing objects:  65% (129/197)   
Writing objects:  66% (131/197)   
Writing objects:  67% (132/197)   
Writing objects:  68% (134/197)   
Writing objects:  69% (136/197)   
Writing objects:  70% (138/197)   
Writing objects:  71% (140/197)   
Writing objects:  72% (142/197)   
Writing objects:  73% (144/197)   
Writing objects:  74% (146/197)   
Writing objects:  75% (148/197)   
Writing objects:  76% (150/197)   
Writing objects:  77% (152/197)   
Writing objects:  78% (154/197)   
Writing objects:  79% (156/197)   
Writing objects:  80% (158/197)   
Writing objects:  81% (160/197)   
Writing objects:  82% (162/197)   
Writing objects:  83% (164/197)   
Writing objects:  84% (166/197)   
Writing objects:  85% (168/197)   
Writing objects:  86% (170/197)   
Writing objects:  87% (172/197)   
Writing objects:  88% (174/197)   
Writing objects:  89% (176/197)   
Writing objects:  90% (178/197)   
Writing objects:  91% (180/197)   
Writing objects:  92% (182/197)   
Writing objects:  93% (184/197)   
Writing objects:  94% (186/197)   
Writing objects:  95% (188/197)   
Writing objects:  96% (190/197)   
Writing objects:  97% (192/197)   
Writing objects:  98% (194/197)   
Writing objects:  99% (196/197)   
Writing objects: 100% (197/197)   
Writing objects: 100% (197/197), 32.90 KiB, done.
Total 197 (delta 161), reused 189 (delta 161)
To xen@xenbits.xensource.com:git/linux-pvops.git
   d9ee258..27d0858  27d0858dbcf199838b8c50a3e94d397bf326d986 -> tested/linux-3.0
+ exit 0

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 04 05:37:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Nov 2012 05:37:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUssu-0002Z9-Nt; Sun, 04 Nov 2012 05:36:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TUsst-0002Z4-GJ
	for xen-devel@lists.xensource.com; Sun, 04 Nov 2012 05:36:35 +0000
Received: from [85.158.137.99:40834] by server-10.bemta-3.messagelabs.com id
	E0/5F-19806-2EEF5905; Sun, 04 Nov 2012 05:36:34 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1352007393!17637818!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTcyMzU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11156 invoked from network); 4 Nov 2012 05:36:33 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-16.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	4 Nov 2012 05:36:33 -0000
X-IronPort-AV: E=Sophos;i="4.80,707,1344211200"; d="scan'208";a="15571230"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	04 Nov 2012 05:36:32 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sun, 4 Nov 2012 05:36:31 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TUssq-00026F-3y;
	Sun, 04 Nov 2012 05:36:32 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TUssp-0002l7-OA;
	Sun, 04 Nov 2012 05:36:31 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14359-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sun, 4 Nov 2012 05:36:31 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14359: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14359 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14359/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-win7-amd64  7 windows-install     fail pass in 14352

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14352
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14352
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14352
 test-amd64-amd64-xl-qemuu-win7-amd64 9 guest-localmigrate fail in 14352 like 14349

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  bd78e5630a5b
baseline version:
 xen                  bd78e5630a5b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 04 05:37:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Nov 2012 05:37:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TUssu-0002Z9-Nt; Sun, 04 Nov 2012 05:36:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TUsst-0002Z4-GJ
	for xen-devel@lists.xensource.com; Sun, 04 Nov 2012 05:36:35 +0000
Received: from [85.158.137.99:40834] by server-10.bemta-3.messagelabs.com id
	E0/5F-19806-2EEF5905; Sun, 04 Nov 2012 05:36:34 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1352007393!17637818!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTcyMzU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11156 invoked from network); 4 Nov 2012 05:36:33 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-16.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	4 Nov 2012 05:36:33 -0000
X-IronPort-AV: E=Sophos;i="4.80,707,1344211200"; d="scan'208";a="15571230"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	04 Nov 2012 05:36:32 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sun, 4 Nov 2012 05:36:31 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TUssq-00026F-3y;
	Sun, 04 Nov 2012 05:36:32 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TUssp-0002l7-OA;
	Sun, 04 Nov 2012 05:36:31 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14359-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sun, 4 Nov 2012 05:36:31 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14359: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14359 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14359/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-win7-amd64  7 windows-install     fail pass in 14352

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14352
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14352
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14352
 test-amd64-amd64-xl-qemuu-win7-amd64 9 guest-localmigrate fail in 14352 like 14349

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  bd78e5630a5b
baseline version:
 xen                  bd78e5630a5b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 04 16:18:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Nov 2012 16:18:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TV2tC-0006Dc-60; Sun, 04 Nov 2012 16:17:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <weiwang.dd@gmail.com>) id 1TV2tA-0006DX-9x
	for xen-devel@lists.xen.org; Sun, 04 Nov 2012 16:17:32 +0000
Received: from [85.158.138.51:13699] by server-15.bemta-3.messagelabs.com id
	BD/B3-09445-B1596905; Sun, 04 Nov 2012 16:17:31 +0000
X-Env-Sender: weiwang.dd@gmail.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1352045849!28550078!1
X-Originating-IP: [209.85.216.52]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24862 invoked from network); 4 Nov 2012 16:17:30 -0000
Received: from mail-qa0-f52.google.com (HELO mail-qa0-f52.google.com)
	(209.85.216.52)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	4 Nov 2012 16:17:30 -0000
Received: by mail-qa0-f52.google.com with SMTP id g14so638233qab.11
	for <xen-devel@lists.xen.org>; Sun, 04 Nov 2012 08:17:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=ggWqyqUSEqFWFuaLKTYHWZ6Ko8NSXTdTy34F6xjHRNk=;
	b=uuqCvkYgZ55TmT9iKF216LArKH8PMC/mobzHUf6aaEygpDGRk/v5+R/XeEJ4pIQ28Z
	rzAzG0xACfZY2WVguPfZ7WfnWq2BIMBoiuGJNLZHFZItSY/1CnFcVjgfDFyWaXruyla7
	FicDwXRCy+aeBUb7diEyUBrQYcEnS3A7Uy63EqXaYVho1/XjpwsZcGx3nB0Vubw6ddgO
	mbLdbf0loAiKF3JO8+VZSozyfN2Ns+dBKCVrCzELhdtt7TlG8m9IAqVsMwP3aIQ5fYuq
	wgzT+QBaJl/xtIm+y3Nq2gDpWXdLzsZZkrtXZHmlq0z26kjI7/C8NMf1RoY6tIwd6onM
	zjTg==
MIME-Version: 1.0
Received: by 10.49.48.135 with SMTP id l7mr12799991qen.23.1352045849092; Sun,
	04 Nov 2012 08:17:29 -0800 (PST)
Received: by 10.49.105.101 with HTTP; Sun, 4 Nov 2012 08:17:29 -0800 (PST)
In-Reply-To: <201211030244.58300.ronny.hegewald@online.de>
References: <509400BD02000078000A6258@nat28.tlf.novell.com>
	<201211030244.58300.ronny.hegewald@online.de>
Date: Sun, 4 Nov 2012 17:17:29 +0100
Message-ID: <CAFqPUJrrJi+FSHtqS75cDbjU=tBkOeJPN2Ki17WHBhVgZJ4m-g@mail.gmail.com>
From: Wei Wang <weiwang.dd@gmail.com>
To: Ronny Hegewald <ronny.hegewald@online.de>
Cc: wei.huang2@amd.com, xiantao.zhang@intel.com,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v3] IOMMU: keep disabled until iommu_setup()
	is called
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2616562728962901098=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============2616562728962901098==
Content-Type: multipart/alternative; boundary=047d7b677abc8e229304cdadb44d

--047d7b677abc8e229304cdadb44d
Content-Type: text/plain; charset=ISO-8859-1

Acked-by: Wei Wang weiwang.dd@gmail.com
and sorry for late reply.

Thanks,
Wei
2012/11/3 Ronny Hegewald <ronny.hegewald@online.de>

> > So after having got acks from both Intel and AMD, I committed
> > this to -unstable, but I'm rather hesitant to backport this onto the
> > 4.x branches (not the least because in the end this is just
> > cosmetic for the problem you reported - the box would not boot
> > in either case, just that with the patch it is more obvious why).
>
> Actually the affected box can still boot xen. But you have to add the
> "allow_unsafe" option to the boot-parameters, which you are informed about
> as
> long the intended panic message is printed.
>
> Without the patch their is just the crash and the stacktrace.
>
> But this problem seem only to hit some older AMD cpus for socket 754,939
> and
> 940 (as noted in CVE-2012-2934), and i didnt find any other report on the
> web
> about this xen crash.
>
> So it looks minor enough to not trouble the stable-branches with it imho
> too.
>
>

--047d7b677abc8e229304cdadb44d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>Acked-by: Wei Wang <a href=3D"mailto:weiwang.dd@gmail.com">weiwang.dd@=
gmail.com</a></div><div>and sorry for late reply.</div><div>=A0</div><div>T=
hanks,<br>Wei<br></div><div class=3D"gmail_quote">2012/11/3 Ronny Hegewald =
<span dir=3D"ltr">&lt;<a href=3D"mailto:ronny.hegewald@online.de" target=3D=
"_blank">ronny.hegewald@online.de</a>&gt;</span><br>
<blockquote style=3D"margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-=
color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class=
=3D"gmail_quote"><div class=3D"im">&gt; So after having got acks from both =
Intel and AMD, I committed<br>

&gt; this to -unstable, but I&#39;m rather hesitant to backport this onto t=
he<br>
&gt; 4.x branches (not the least because in the end this is just<br>
&gt; cosmetic for the problem you reported - the box would not boot<br>
&gt; in either case, just that with the patch it is more obvious why).<br>
<br>
</div>Actually the affected box can still boot xen. But you have to add the=
<br>
&quot;allow_unsafe&quot; option to the boot-parameters, which you are infor=
med about as<br>
long the intended panic message is printed.<br>
<br>
Without the patch their is just the crash and the stacktrace.<br>
<br>
But this problem seem only to hit some older AMD cpus for socket 754,939 an=
d<br>
940 (as noted in CVE-2012-2934), and i didnt find any other report on the w=
eb<br>
about this xen crash.<br>
<br>
So it looks minor enough to not trouble the stable-branches with it imho to=
o.<br>
<br>
</blockquote></div><br>

--047d7b677abc8e229304cdadb44d--


--===============2616562728962901098==
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.xen.org
http://lists.xen.org/xen-devel

--===============2616562728962901098==--


From xen-devel-bounces@lists.xen.org Sun Nov 04 16:18:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Nov 2012 16:18:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TV2tC-0006Dc-60; Sun, 04 Nov 2012 16:17:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <weiwang.dd@gmail.com>) id 1TV2tA-0006DX-9x
	for xen-devel@lists.xen.org; Sun, 04 Nov 2012 16:17:32 +0000
Received: from [85.158.138.51:13699] by server-15.bemta-3.messagelabs.com id
	BD/B3-09445-B1596905; Sun, 04 Nov 2012 16:17:31 +0000
X-Env-Sender: weiwang.dd@gmail.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1352045849!28550078!1
X-Originating-IP: [209.85.216.52]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24862 invoked from network); 4 Nov 2012 16:17:30 -0000
Received: from mail-qa0-f52.google.com (HELO mail-qa0-f52.google.com)
	(209.85.216.52)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	4 Nov 2012 16:17:30 -0000
Received: by mail-qa0-f52.google.com with SMTP id g14so638233qab.11
	for <xen-devel@lists.xen.org>; Sun, 04 Nov 2012 08:17:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=ggWqyqUSEqFWFuaLKTYHWZ6Ko8NSXTdTy34F6xjHRNk=;
	b=uuqCvkYgZ55TmT9iKF216LArKH8PMC/mobzHUf6aaEygpDGRk/v5+R/XeEJ4pIQ28Z
	rzAzG0xACfZY2WVguPfZ7WfnWq2BIMBoiuGJNLZHFZItSY/1CnFcVjgfDFyWaXruyla7
	FicDwXRCy+aeBUb7diEyUBrQYcEnS3A7Uy63EqXaYVho1/XjpwsZcGx3nB0Vubw6ddgO
	mbLdbf0loAiKF3JO8+VZSozyfN2Ns+dBKCVrCzELhdtt7TlG8m9IAqVsMwP3aIQ5fYuq
	wgzT+QBaJl/xtIm+y3Nq2gDpWXdLzsZZkrtXZHmlq0z26kjI7/C8NMf1RoY6tIwd6onM
	zjTg==
MIME-Version: 1.0
Received: by 10.49.48.135 with SMTP id l7mr12799991qen.23.1352045849092; Sun,
	04 Nov 2012 08:17:29 -0800 (PST)
Received: by 10.49.105.101 with HTTP; Sun, 4 Nov 2012 08:17:29 -0800 (PST)
In-Reply-To: <201211030244.58300.ronny.hegewald@online.de>
References: <509400BD02000078000A6258@nat28.tlf.novell.com>
	<201211030244.58300.ronny.hegewald@online.de>
Date: Sun, 4 Nov 2012 17:17:29 +0100
Message-ID: <CAFqPUJrrJi+FSHtqS75cDbjU=tBkOeJPN2Ki17WHBhVgZJ4m-g@mail.gmail.com>
From: Wei Wang <weiwang.dd@gmail.com>
To: Ronny Hegewald <ronny.hegewald@online.de>
Cc: wei.huang2@amd.com, xiantao.zhang@intel.com,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v3] IOMMU: keep disabled until iommu_setup()
	is called
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2616562728962901098=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============2616562728962901098==
Content-Type: multipart/alternative; boundary=047d7b677abc8e229304cdadb44d

--047d7b677abc8e229304cdadb44d
Content-Type: text/plain; charset=ISO-8859-1

Acked-by: Wei Wang weiwang.dd@gmail.com
and sorry for late reply.

Thanks,
Wei
2012/11/3 Ronny Hegewald <ronny.hegewald@online.de>

> > So after having got acks from both Intel and AMD, I committed
> > this to -unstable, but I'm rather hesitant to backport this onto the
> > 4.x branches (not the least because in the end this is just
> > cosmetic for the problem you reported - the box would not boot
> > in either case, just that with the patch it is more obvious why).
>
> Actually the affected box can still boot xen. But you have to add the
> "allow_unsafe" option to the boot-parameters, which you are informed about
> as
> long the intended panic message is printed.
>
> Without the patch their is just the crash and the stacktrace.
>
> But this problem seem only to hit some older AMD cpus for socket 754,939
> and
> 940 (as noted in CVE-2012-2934), and i didnt find any other report on the
> web
> about this xen crash.
>
> So it looks minor enough to not trouble the stable-branches with it imho
> too.
>
>

--047d7b677abc8e229304cdadb44d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>Acked-by: Wei Wang <a href=3D"mailto:weiwang.dd@gmail.com">weiwang.dd@=
gmail.com</a></div><div>and sorry for late reply.</div><div>=A0</div><div>T=
hanks,<br>Wei<br></div><div class=3D"gmail_quote">2012/11/3 Ronny Hegewald =
<span dir=3D"ltr">&lt;<a href=3D"mailto:ronny.hegewald@online.de" target=3D=
"_blank">ronny.hegewald@online.de</a>&gt;</span><br>
<blockquote style=3D"margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-=
color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class=
=3D"gmail_quote"><div class=3D"im">&gt; So after having got acks from both =
Intel and AMD, I committed<br>

&gt; this to -unstable, but I&#39;m rather hesitant to backport this onto t=
he<br>
&gt; 4.x branches (not the least because in the end this is just<br>
&gt; cosmetic for the problem you reported - the box would not boot<br>
&gt; in either case, just that with the patch it is more obvious why).<br>
<br>
</div>Actually the affected box can still boot xen. But you have to add the=
<br>
&quot;allow_unsafe&quot; option to the boot-parameters, which you are infor=
med about as<br>
long the intended panic message is printed.<br>
<br>
Without the patch their is just the crash and the stacktrace.<br>
<br>
But this problem seem only to hit some older AMD cpus for socket 754,939 an=
d<br>
940 (as noted in CVE-2012-2934), and i didnt find any other report on the w=
eb<br>
about this xen crash.<br>
<br>
So it looks minor enough to not trouble the stable-branches with it imho to=
o.<br>
<br>
</blockquote></div><br>

--047d7b677abc8e229304cdadb44d--


--===============2616562728962901098==
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.xen.org
http://lists.xen.org/xen-devel

--===============2616562728962901098==--


From xen-devel-bounces@lists.xen.org Sun Nov 04 19:44:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Nov 2012 19:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TV66f-0006vx-Hv; Sun, 04 Nov 2012 19:43:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TV66d-0006vs-JS
	for xen-devel@lists.xen.org; Sun, 04 Nov 2012 19:43:39 +0000
Received: from [85.158.137.99:58761] by server-2.bemta-3.messagelabs.com id
	69/08-04744-A65C6905; Sun, 04 Nov 2012 19:43:38 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1352058216!12942996!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjAyMTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28257 invoked from network); 4 Nov 2012 19:43:37 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-5.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 4 Nov 2012 19:43:37 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA4JhGic023764
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Sun, 4 Nov 2012 19:43:17 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA4JhEwd024315
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sun, 4 Nov 2012 19:43:14 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA4JhDlI007789; Sun, 4 Nov 2012 13:43:13 -0600
MIME-Version: 1.0
Message-ID: <7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
Date: Sun, 4 Nov 2012 11:43:06 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
In-Reply-To: <CCB94326.50E8F%keir@xen.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Keir Fraser [mailto:keir@xen.org]
> Sent: Friday, November 02, 2012 3:30 AM
> To: Jan Beulich; Dan Magenheimer
> Cc: Olaf Hering; IanCampbell; George Dunlap; Ian Jackson; George Shuklin; DarioFaggioli; xen-
> devel@lists.xen.org; Konrad Rzeszutek Wilk; Kurt Hackel; Mukesh Rathor; Zhigang Wang; TimDeegan
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> 
> On 02/11/2012 09:01, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
> > Plus, if necessary, that loop could be broken up so that only the
> > initial part of it gets run with the lock held (see c/s
> > 22135:69e8bb164683 for why the unlock was moved past the
> > loop). That would make for a shorter lock hold time, but for a
> > higher allocation latency on large oder allocations (due to worse
> > cache locality).
> 
> In fact I believe only the first page needs to have its count_info set to !=
> PGC_state_free, while the lock is held. That is sufficient to defeat the
> buddy merging in free_heap_pages(). Similarly, we could hoist most of the
> first loop in free_heap_pages() outside the lock. There's a lot of scope for
> optimisation here.

(sorry for the delayed response)

Aren't we getting a little sidetracked here?  (Maybe my fault for
looking at whether this specific loop is fast enough...)

This loop handles only order=N chunks of RAM.  Speeding up this
loop and holding the heap_lock here for a shorter period only helps
the TOCTOU race if the entire domain can be allocated as a
single order-N allocation.

Domain creation is supposed to succeed as long as there is
sufficient RAM, _regardless_ of the state of memory fragmentation,
correct?

So unless the code for the _entire_ memory allocation path can
be optimized so that the heap_lock can be held across _all_ the
allocations necessary to create an arbitrary-sized domain, for
any arbitrary state of memory fragmentation, the original
problem has not been solved.

Or am I misunderstanding?

I _think_ the claim hypercall/subop should resolve this, though
admittedly I have yet to prove (and code) it.

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 04 19:44:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Nov 2012 19:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TV66f-0006vx-Hv; Sun, 04 Nov 2012 19:43:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TV66d-0006vs-JS
	for xen-devel@lists.xen.org; Sun, 04 Nov 2012 19:43:39 +0000
Received: from [85.158.137.99:58761] by server-2.bemta-3.messagelabs.com id
	69/08-04744-A65C6905; Sun, 04 Nov 2012 19:43:38 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1352058216!12942996!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjAyMTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28257 invoked from network); 4 Nov 2012 19:43:37 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-5.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 4 Nov 2012 19:43:37 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA4JhGic023764
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Sun, 4 Nov 2012 19:43:17 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA4JhEwd024315
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sun, 4 Nov 2012 19:43:14 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA4JhDlI007789; Sun, 4 Nov 2012 13:43:13 -0600
MIME-Version: 1.0
Message-ID: <7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
Date: Sun, 4 Nov 2012 11:43:06 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
In-Reply-To: <CCB94326.50E8F%keir@xen.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Keir Fraser [mailto:keir@xen.org]
> Sent: Friday, November 02, 2012 3:30 AM
> To: Jan Beulich; Dan Magenheimer
> Cc: Olaf Hering; IanCampbell; George Dunlap; Ian Jackson; George Shuklin; DarioFaggioli; xen-
> devel@lists.xen.org; Konrad Rzeszutek Wilk; Kurt Hackel; Mukesh Rathor; Zhigang Wang; TimDeegan
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> 
> On 02/11/2012 09:01, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
> > Plus, if necessary, that loop could be broken up so that only the
> > initial part of it gets run with the lock held (see c/s
> > 22135:69e8bb164683 for why the unlock was moved past the
> > loop). That would make for a shorter lock hold time, but for a
> > higher allocation latency on large oder allocations (due to worse
> > cache locality).
> 
> In fact I believe only the first page needs to have its count_info set to !=
> PGC_state_free, while the lock is held. That is sufficient to defeat the
> buddy merging in free_heap_pages(). Similarly, we could hoist most of the
> first loop in free_heap_pages() outside the lock. There's a lot of scope for
> optimisation here.

(sorry for the delayed response)

Aren't we getting a little sidetracked here?  (Maybe my fault for
looking at whether this specific loop is fast enough...)

This loop handles only order=N chunks of RAM.  Speeding up this
loop and holding the heap_lock here for a shorter period only helps
the TOCTOU race if the entire domain can be allocated as a
single order-N allocation.

Domain creation is supposed to succeed as long as there is
sufficient RAM, _regardless_ of the state of memory fragmentation,
correct?

So unless the code for the _entire_ memory allocation path can
be optimized so that the heap_lock can be held across _all_ the
allocations necessary to create an arbitrary-sized domain, for
any arbitrary state of memory fragmentation, the original
problem has not been solved.

Or am I misunderstanding?

I _think_ the claim hypercall/subop should resolve this, though
admittedly I have yet to prove (and code) it.

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 04 20:36:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Nov 2012 20:36:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TV6v9-0007ex-Mi; Sun, 04 Nov 2012 20:35:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TV6v8-0007es-GI
	for xen-devel@lists.xen.org; Sun, 04 Nov 2012 20:35:51 +0000
Received: from [85.158.137.99:38266] by server-15.bemta-3.messagelabs.com id
	60/5B-09445-B91D6905; Sun, 04 Nov 2012 20:35:39 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-10.tower-217.messagelabs.com!1352061338!17707527!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12818 invoked from network); 4 Nov 2012 20:35:38 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-10.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 4 Nov 2012 20:35:38 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TV6uq-00032B-Kt; Sun, 04 Nov 2012 20:35:32 +0000
Date: Sun, 4 Nov 2012 20:35:32 +0000
From: Tim Deegan <tim@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <20121104203532.GA11377@ocelot.phlegethon.org>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
User-Agent: Mutt/1.4.2.1i
Cc: Olaf Hering <olaf@aepfle.de>, Keir Fraser <keir@xen.org>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, xen-devel@lists.xen.org,
	DarioFaggioli <raistlin@linux.it>, Jan Beulich <JBeulich@suse.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 11:43 -0800 on 04 Nov (1352029386), Dan Magenheimer wrote:
> > From: Keir Fraser [mailto:keir@xen.org]
> > Sent: Friday, November 02, 2012 3:30 AM
> > To: Jan Beulich; Dan Magenheimer
> > Cc: Olaf Hering; IanCampbell; George Dunlap; Ian Jackson; George Shuklin; DarioFaggioli; xen-
> > devel@lists.xen.org; Konrad Rzeszutek Wilk; Kurt Hackel; Mukesh Rathor; Zhigang Wang; TimDeegan
> > Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> > 
> > On 02/11/2012 09:01, "Jan Beulich" <JBeulich@suse.com> wrote:
> > 
> > > Plus, if necessary, that loop could be broken up so that only the
> > > initial part of it gets run with the lock held (see c/s
> > > 22135:69e8bb164683 for why the unlock was moved past the
> > > loop). That would make for a shorter lock hold time, but for a
> > > higher allocation latency on large oder allocations (due to worse
> > > cache locality).
> > 
> > In fact I believe only the first page needs to have its count_info set to !=
> > PGC_state_free, while the lock is held. That is sufficient to defeat the
> > buddy merging in free_heap_pages(). Similarly, we could hoist most of the
> > first loop in free_heap_pages() outside the lock. There's a lot of scope for
> > optimisation here.
> 
> (sorry for the delayed response)
> 
> Aren't we getting a little sidetracked here?  (Maybe my fault for
> looking at whether this specific loop is fast enough...)
> 
> This loop handles only order=N chunks of RAM.  Speeding up this
> loop and holding the heap_lock here for a shorter period only helps
> the TOCTOU race if the entire domain can be allocated as a
> single order-N allocation.

I think the idea is to speed up allocation so that, even for a large VM,
you can just allocate memory instead of needing a reservation hypercall
(whose only purpose, AIUI, is to give you an immediate answer).

> So unless the code for the _entire_ memory allocation path can
> be optimized so that the heap_lock can be held across _all_ the
> allocations necessary to create an arbitrary-sized domain, for
> any arbitrary state of memory fragmentation, the original
> problem has not been solved.
> 
> Or am I misunderstanding?
> 
> I _think_ the claim hypercall/subop should resolve this, though
> admittedly I have yet to prove (and code) it.

I don't think it solves it - or rather it might solve this _particular_
instance of it but it doesn't solve the bigger problem.  If you have a
set of overcommitted hosts and you want to start a new VM, you need to:

 - (a) decide which of your hosts is the least overcommitted;
 - (b) free up enough memory on that host to build the VM; and
 - (c) build the VM.

The claim hypercall _might_ fix (c) (if it could handle allocations that
need address-width limits or contiguous pages).  But (b) and (a) have
exactly the same problem, unless there is a central arbiter of memory
allocation (or equivalent distributed system).  If you try to start 2
VMs at once,

 - (a) the toolstack will choose to start them both on the same machine,
       even if that's not optimal, or in the case where one creation is
       _bound_ to fail after some delay.
 - (b) the other VMs (and perhaps tmem) start ballooning out enough
       memory to start the new VM.  This can take even longer than
       allocating it since it depends on guest behaviour.  It can fail
       after an arbitrary delay (ditto).

If you have a toolstack with enough knowledge and control over memory
allocation to sort out stages (a) and (b) in such a way that there are
no delayed failures, (c) should be trivial.

Tim.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 04 20:36:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Nov 2012 20:36:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TV6v9-0007ex-Mi; Sun, 04 Nov 2012 20:35:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TV6v8-0007es-GI
	for xen-devel@lists.xen.org; Sun, 04 Nov 2012 20:35:51 +0000
Received: from [85.158.137.99:38266] by server-15.bemta-3.messagelabs.com id
	60/5B-09445-B91D6905; Sun, 04 Nov 2012 20:35:39 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-10.tower-217.messagelabs.com!1352061338!17707527!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12818 invoked from network); 4 Nov 2012 20:35:38 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-10.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 4 Nov 2012 20:35:38 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TV6uq-00032B-Kt; Sun, 04 Nov 2012 20:35:32 +0000
Date: Sun, 4 Nov 2012 20:35:32 +0000
From: Tim Deegan <tim@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <20121104203532.GA11377@ocelot.phlegethon.org>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
User-Agent: Mutt/1.4.2.1i
Cc: Olaf Hering <olaf@aepfle.de>, Keir Fraser <keir@xen.org>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, xen-devel@lists.xen.org,
	DarioFaggioli <raistlin@linux.it>, Jan Beulich <JBeulich@suse.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 11:43 -0800 on 04 Nov (1352029386), Dan Magenheimer wrote:
> > From: Keir Fraser [mailto:keir@xen.org]
> > Sent: Friday, November 02, 2012 3:30 AM
> > To: Jan Beulich; Dan Magenheimer
> > Cc: Olaf Hering; IanCampbell; George Dunlap; Ian Jackson; George Shuklin; DarioFaggioli; xen-
> > devel@lists.xen.org; Konrad Rzeszutek Wilk; Kurt Hackel; Mukesh Rathor; Zhigang Wang; TimDeegan
> > Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> > 
> > On 02/11/2012 09:01, "Jan Beulich" <JBeulich@suse.com> wrote:
> > 
> > > Plus, if necessary, that loop could be broken up so that only the
> > > initial part of it gets run with the lock held (see c/s
> > > 22135:69e8bb164683 for why the unlock was moved past the
> > > loop). That would make for a shorter lock hold time, but for a
> > > higher allocation latency on large oder allocations (due to worse
> > > cache locality).
> > 
> > In fact I believe only the first page needs to have its count_info set to !=
> > PGC_state_free, while the lock is held. That is sufficient to defeat the
> > buddy merging in free_heap_pages(). Similarly, we could hoist most of the
> > first loop in free_heap_pages() outside the lock. There's a lot of scope for
> > optimisation here.
> 
> (sorry for the delayed response)
> 
> Aren't we getting a little sidetracked here?  (Maybe my fault for
> looking at whether this specific loop is fast enough...)
> 
> This loop handles only order=N chunks of RAM.  Speeding up this
> loop and holding the heap_lock here for a shorter period only helps
> the TOCTOU race if the entire domain can be allocated as a
> single order-N allocation.

I think the idea is to speed up allocation so that, even for a large VM,
you can just allocate memory instead of needing a reservation hypercall
(whose only purpose, AIUI, is to give you an immediate answer).

> So unless the code for the _entire_ memory allocation path can
> be optimized so that the heap_lock can be held across _all_ the
> allocations necessary to create an arbitrary-sized domain, for
> any arbitrary state of memory fragmentation, the original
> problem has not been solved.
> 
> Or am I misunderstanding?
> 
> I _think_ the claim hypercall/subop should resolve this, though
> admittedly I have yet to prove (and code) it.

I don't think it solves it - or rather it might solve this _particular_
instance of it but it doesn't solve the bigger problem.  If you have a
set of overcommitted hosts and you want to start a new VM, you need to:

 - (a) decide which of your hosts is the least overcommitted;
 - (b) free up enough memory on that host to build the VM; and
 - (c) build the VM.

The claim hypercall _might_ fix (c) (if it could handle allocations that
need address-width limits or contiguous pages).  But (b) and (a) have
exactly the same problem, unless there is a central arbiter of memory
allocation (or equivalent distributed system).  If you try to start 2
VMs at once,

 - (a) the toolstack will choose to start them both on the same machine,
       even if that's not optimal, or in the case where one creation is
       _bound_ to fail after some delay.
 - (b) the other VMs (and perhaps tmem) start ballooning out enough
       memory to start the new VM.  This can take even longer than
       allocating it since it depends on guest behaviour.  It can fail
       after an arbitrary delay (ditto).

If you have a toolstack with enough knowledge and control over memory
allocation to sort out stages (a) and (b) in such a way that there are
no delayed failures, (c) should be trivial.

Tim.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 04 22:24:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Nov 2012 22:24:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TV8bx-00085P-4D; Sun, 04 Nov 2012 22:24:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TV8bv-00085K-53
	for xen-devel@lists.xen.org; Sun, 04 Nov 2012 22:24:07 +0000
Received: from [85.158.143.35:29248] by server-3.bemta-4.messagelabs.com id
	66/8A-06841-60BE6905; Sun, 04 Nov 2012 22:24:06 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1352067845!12132919!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTcyNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23853 invoked from network); 4 Nov 2012 22:24:05 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	4 Nov 2012 22:24:05 -0000
X-IronPort-AV: E=Sophos;i="4.80,711,1344211200"; d="scan'208";a="15574964"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	04 Nov 2012 22:24:04 +0000
Received: from Roger-2.local.net (10.31.3.234) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Sun, 4 Nov 2012
	22:24:04 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <port-xen@netbsd.org>
Date: Sun, 4 Nov 2012 23:23:50 +0100
Message-ID: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
MIME-Version: 1.0
Cc: xen-devel@lists.xen.org, Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH] xen: add persistent grants to xbd_xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch implements persistent grants for xbd_xenbus (blkfront in
Linux terminology). The effect of this change is to reduce the number
of unmap operations performed, since they cause a (costly) TLB
shootdown. This allows the I/O performance to scale better when a
large number of VMs are performing I/O.

On startup xbd_xenbus notifies the backend driver that it is using
persistent grants. If the backend driver is not capable of persistent
mapping, xbd_xenbus will still use the same grants, since it is
compatible with the previous protocol, and simplifies the code
complexity in xbd_xenbus.

Each time a request is send to the backend driver, xbd_xenbus will
check if there are free grants already mapped and will try to use one
of those. If there are not enough grants already mapped, xbd_xenbus
will request new grants, and they will be added to the list of free
grants when the transaction is finished, so they can be reused. Data
has to be copied from the request (struct buf) to the mapped grant, or
from the mapped grant to the request, depending on the operation being
performed.

To test the performance impact of this patch I've benchmarked the
number of IOPS performed simultaneously by 15 NetBSD DomU guests on a
Linux Dom0 that supports persistent grants. The backend used to
perform this tests was a ramdisk of size 1GB.

                     Sum of IOPS
Non-persistent            336718
Persistent                686010

As seen, there's a x2 increase in the total number of IOPS being
performed. As a reference, using exactly the same setup Linux DomUs
are able to achieve 1102019 IOPS, so there's still plenty of room for
improvement.

As said previously this implementation only covers for the NetBSD
front-end driver.

Cc: xen-devel@lists.xen.org
---
 sys/arch/xen/xen/xbd_xenbus.c |  174 ++++++++++++++++++++++++----------------
 1 files changed, 104 insertions(+), 70 deletions(-)

diff --git a/sys/arch/xen/xen/xbd_xenbus.c b/sys/arch/xen/xen/xbd_xenbus.c
index a9221e7..4ece0b0 100644
--- a/sys/arch/xen/xen/xbd_xenbus.c
+++ b/sys/arch/xen/xen/xbd_xenbus.c
@@ -68,6 +68,7 @@ __KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.57 2012/05/25 15:03:38 elric Exp $"
 #include <sys/systm.h>
 #include <sys/stat.h>
 #include <sys/vnode.h>
+#include <sys/malloc.h>
 
 #include <dev/dkvar.h>
 
@@ -99,12 +100,18 @@ __KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.57 2012/05/25 15:03:38 elric Exp $"
 #define XEN_BSHIFT      9               /* log2(XEN_BSIZE) */
 #define XEN_BSIZE       (1 << XEN_BSHIFT) 
 
+struct grant {
+	SLIST_ENTRY(grant) gnt_next;
+	grant_ref_t gref;
+	vaddr_t va;
+};
+
 struct xbd_req {
 	SLIST_ENTRY(xbd_req) req_next;
 	uint16_t req_id; /* ID passed to backend */
 	union {
 	    struct {
-		grant_ref_t req_gntref[BLKIF_MAX_SEGMENTS_PER_REQUEST];
+		struct grant *req_gntref[BLKIF_MAX_SEGMENTS_PER_REQUEST];
 		int req_nr_segments; /* number of segments in this request */
 		struct buf *req_bp; /* buffer associated with this request */
 		void *req_data; /* pointer to the data buffer */
@@ -152,6 +159,8 @@ struct xbd_xenbus_softc {
 	u_long sc_handle; /* from backend */
 	int sc_cache_flush; /* backend supports BLKIF_OP_FLUSH_DISKCACHE */
 	krndsource_t     sc_rnd_source;
+	SLIST_HEAD(,grant) sc_free_grants; /* list of available mapped grants */
+	int sc_persistent_grants; /* backend supports persistent grants */
 };
 
 #if 0
@@ -172,9 +181,6 @@ static int  xbdstart(struct dk_softc *, struct buf *);
 static void xbd_backend_changed(void *, XenbusState);
 static void xbd_connect(struct xbd_xenbus_softc *);
 
-static int  xbd_map_align(struct xbd_req *);
-static void xbd_unmap_align(struct xbd_req *);
-
 static void xbdminphys(struct buf *);
 
 CFATTACH_DECL3_NEW(xbd, sizeof(struct xbd_xenbus_softc),
@@ -217,6 +223,23 @@ static struct dkdriver xbddkdriver = {
 	.d_minphys = xbdminphys,
 };
 
+static void
+xbd_clear_grants(struct xbd_xenbus_softc *sc)
+{
+	struct grant *entry;
+
+	/* Unmap and clear the list of persistent grants */
+	while (!SLIST_EMPTY(&sc->sc_free_grants)) {
+		entry = SLIST_FIRST(&sc->sc_free_grants);
+		SLIST_REMOVE_HEAD(&sc->sc_free_grants, gnt_next);
+		if (__predict_false(xengnt_status(entry->gref)))
+			panic("grant still used");
+		xengnt_revoke_access(entry->gref);
+		uvm_km_kmem_free(kmem_va_arena, entry->va, PAGE_SIZE);
+		free(entry, M_DEVBUF);
+	}
+}
+
 static int
 xbd_xenbus_match(device_t parent, cfdata_t match, void *aux)
 {
@@ -285,6 +308,7 @@ xbd_xenbus_attach(device_t parent, device_t self, void *aux)
 		SLIST_INSERT_HEAD(&sc->sc_xbdreq_head, &sc->sc_reqs[i],
 		    req_next);
 	}
+	SLIST_INIT(&sc->sc_free_grants);
 
 	sc->sc_backend_status = BLKIF_STATE_DISCONNECTED;
 	sc->sc_shutdown = BLKIF_SHUTDOWN_REMOTE;
@@ -368,6 +392,8 @@ xbd_xenbus_detach(device_t dev, int flags)
 		rnd_detach_source(&sc->sc_rnd_source);
 	}
 
+	xbd_clear_grants(sc);
+
 	hypervisor_mask_event(sc->sc_evtchn);
 	event_remove_handler(sc->sc_evtchn, &xbd_handler, sc);
 	while (xengnt_status(sc->sc_ring_gntref)) {
@@ -402,6 +428,8 @@ xbd_xenbus_suspend(device_t dev, const pmf_qual_t *qual) {
 
 	splx(s);
 
+	xbd_clear_grants(sc);
+
 	xenbus_device_suspend(sc->sc_xbusd);
 	aprint_verbose_dev(dev, "removed event channel %d\n", sc->sc_evtchn);
 
@@ -475,6 +503,12 @@ again:
 		errmsg = "writing protocol";
 		goto abort_transaction;
 	}
+	error = xenbus_printf(xbt, sc->sc_xbusd->xbusd_path,
+	    "feature-persistent", "%u", 1);
+	if (error) {
+		errmsg = "writing feature-persistent";
+		goto abort_transaction;
+	}
 	error = xenbus_transaction_end(xbt, 0);
 	if (error == EAGAIN)
 		goto again;
@@ -614,7 +648,7 @@ xbd_connect(struct xbd_xenbus_softc *sc)
 {
 	int err;
 	unsigned long long sectors;
-	u_long cache_flush;
+	u_long cache_flush, feature_persistent;
 
 	err = xenbus_read_ul(NULL,
 	    sc->sc_xbusd->xbusd_path, "virtual-device", &sc->sc_handle, 10);
@@ -652,6 +686,15 @@ xbd_connect(struct xbd_xenbus_softc *sc)
 	else
 		sc->sc_cache_flush = 0;
 
+	err = xenbus_read_ul(NULL, sc->sc_xbusd->xbusd_otherend,
+	    "feature-persistent", &feature_persistent, 10);
+	if (err)
+		feature_persistent = 0;
+	if (feature_persistent > 0)
+		sc->sc_persistent_grants = 1;
+	else
+		sc->sc_persistent_grants = 0;
+
 	xenbus_switch_state(sc->sc_xbusd, NULL, XenbusStateConnected);
 }
 
@@ -662,7 +705,8 @@ xbd_handler(void *arg)
 	struct buf *bp;
 	RING_IDX resp_prod, i;
 	int more_to_do;
-	int seg;
+	int seg, nbytes, ncopy;
+	vaddr_t va;
 
 	DPRINTF(("xbd_handler(%s)\n", device_xname(sc->sc_dksc.sc_dev)));
 
@@ -684,18 +728,6 @@ again:
 			/* caller will free the req */
 			continue;
 		}
-		for (seg = xbdreq->req_nr_segments - 1; seg >= 0; seg--) {
-			if (__predict_false(
-			    xengnt_status(xbdreq->req_gntref[seg]))) {
-				aprint_verbose_dev(sc->sc_dksc.sc_dev,
-					"grant still used by backend\n");
-				sc->sc_ring.rsp_cons = i;
-				xbdreq->req_nr_segments = seg + 1;
-				goto done;
-			}
-			xengnt_revoke_access(xbdreq->req_gntref[seg]);
-			xbdreq->req_nr_segments--;
-		}
 		if (rep->operation != BLKIF_OP_READ &&
 		    rep->operation != BLKIF_OP_WRITE) {
 			aprint_error_dev(sc->sc_dksc.sc_dev,
@@ -709,10 +741,20 @@ again:
 			bp->b_resid = bp->b_bcount;
 			goto next;
 		}
-		/* b_resid was set in xbdstart */
+
+		if (rep->operation == BLKIF_OP_READ) {
+			/* Read data from the request */
+			nbytes = xbdreq->req_bp->b_bcount;
+			va = (vaddr_t)xbdreq->req_bp->b_data;
+			for (seg = 0; seg < xbdreq->req_nr_segments; seg++) {
+				ncopy = nbytes > PAGE_SIZE ? PAGE_SIZE : nbytes;
+				memcpy((void *) va, (void *) xbdreq->req_gntref[seg]->va,
+					   ncopy);
+				nbytes -= ncopy;
+				va += ncopy;
+			}
+		}
 next:
-		if (bp->b_data != xbdreq->req_data)
-			xbd_unmap_align(xbdreq);
 		disk_unbusy(&sc->sc_dksc.sc_dkdev,
 		    (bp->b_bcount - bp->b_resid),
 		    (bp->b_flags & B_READ));
@@ -720,8 +762,12 @@ next:
 		    bp->b_blkno);
 		biodone(bp);
 		SLIST_INSERT_HEAD(&sc->sc_xbdreq_head, xbdreq, req_next);
+		/* Insert the grants back into the list of available grants */
+		for (seg = 0; seg < xbdreq->req_nr_segments; seg++)
+			SLIST_INSERT_HEAD(&sc->sc_free_grants,
+			                  xbdreq->req_gntref[seg], gnt_next);
 	}
-done:
+
 	xen_rmb();
 	sc->sc_ring.rsp_cons = i;
 
@@ -944,9 +990,11 @@ xbdstart(struct dk_softc *dksc, struct buf *bp)
 	int ret = 0, runqueue = 1;
 	size_t bcount, off;
 	paddr_t ma;
-	vaddr_t va;
-	int nsects, nbytes, seg;
+	vaddr_t va = 0;
+	vaddr_t va_newmap;
+	int nsects, nbytes, seg, s, rc;
 	int notify;
+	struct grant *gnt;
 
 	DPRINTF(("xbdstart(%p): b_bcount = %ld\n", bp, (long)bp->b_bcount));
 
@@ -990,13 +1038,6 @@ xbdstart(struct dk_softc *dksc, struct buf *bp)
 	}
 
 	xbdreq->req_bp = bp;
-	xbdreq->req_data = bp->b_data;
-	if ((vaddr_t)bp->b_data & (XEN_BSIZE - 1)) {
-		if (__predict_false(xbd_map_align(xbdreq) != 0)) {
-			ret = -1;
-			goto out;
-		}
-	}
 	/* now we're sure we'll send this buf */
 	disk_busy(&dksc->sc_dkdev);
 	SLIST_REMOVE_HEAD(&sc->sc_xbdreq_head, req_next);
@@ -1006,8 +1047,6 @@ xbdstart(struct dk_softc *dksc, struct buf *bp)
 	req->sector_number = bp->b_rawblkno;
 	req->handle = sc->sc_handle;
 
-	va = (vaddr_t)xbdreq->req_data & ~PAGE_MASK;
-	off = (vaddr_t)xbdreq->req_data & PAGE_MASK;
 	if (bp->b_rawblkno + bp->b_bcount / DEV_BSIZE >= sc->sc_xbdsize) {
 		bcount = (sc->sc_xbdsize - bp->b_rawblkno) * DEV_BSIZE;
 		bp->b_resid = bp->b_bcount - bcount;
@@ -1020,8 +1059,32 @@ xbdstart(struct dk_softc *dksc, struct buf *bp)
 		bcount = XBD_MAX_XFER;
 	}
 	for (seg = 0; bcount > 0;) {
-		pmap_extract_ma(pmap_kernel(), va, &ma);
-		KASSERT((ma & (XEN_BSIZE - 1)) == 0);
+		/* Get an already mapped grant or map a new one */
+		if (!SLIST_EMPTY(&sc->sc_free_grants)) {
+			gnt = SLIST_FIRST(&sc->sc_free_grants);
+			SLIST_REMOVE_HEAD(&sc->sc_free_grants, gnt_next);
+		} else {
+			s = splvm();
+			rc = uvm_km_kmem_alloc(kmem_va_arena, PAGE_SIZE,
+			                       (VM_NOSLEEP | VM_INSTANTFIT),
+			                       (vmem_addr_t *)&va_newmap);
+			splx(s);
+			if (__predict_false(rc != 0))
+				panic("xbdstart: unable to map memory");
+			pmap_extract_ma(pmap_kernel(), va_newmap, &ma);
+			KASSERT((ma & (XEN_BSIZE - 1)) == 0);
+			gnt = malloc(sizeof(struct grant), M_DEVBUF, M_NOWAIT);
+			if (__predict_false(xengnt_grant_access(
+		        sc->sc_xbusd->xbusd_otherend_id, ma, 0,
+		        &gnt->gref)))
+				panic("xbdstart: xengnt_grant_access");
+			gnt->va = va_newmap;
+		}
+		xbdreq->req_data = (void *)gnt->va;
+		if (seg == 0) {
+			off = (vaddr_t)xbdreq->req_data & PAGE_MASK;
+			va = (vaddr_t)bp->b_data;
+		}
 		if (bcount > PAGE_SIZE - off)
 			nbytes = PAGE_SIZE - off;
 		else
@@ -1031,11 +1094,12 @@ xbdstart(struct dk_softc *dksc, struct buf *bp)
 		req->seg[seg].last_sect = (off >> XEN_BSHIFT) + nsects - 1;
 		KASSERT(req->seg[seg].first_sect <= req->seg[seg].last_sect);
 		KASSERT(req->seg[seg].last_sect < 8);
-		if (__predict_false(xengnt_grant_access(
-		    sc->sc_xbusd->xbusd_otherend_id, ma,
-		    (bp->b_flags & B_READ) == 0, &xbdreq->req_gntref[seg])))
-			panic("xbdstart: xengnt_grant_access"); /* XXX XXX !!! */
-		req->seg[seg].gref = xbdreq->req_gntref[seg];
+		if (req->operation == BLKIF_OP_WRITE)
+			/* Copy data from the buf to the request */
+			memcpy((void *)(gnt->va + off), (void *)(va + off), nbytes);
+
+		req->seg[seg].gref = gnt->gref;
+		xbdreq->req_gntref[seg] = gnt;
 		seg++;
 		KASSERT(seg <= BLKIF_MAX_SEGMENTS_PER_REQUEST);
 		va += PAGE_SIZE;
@@ -1063,33 +1127,3 @@ err:
 	biodone(bp);
 	return 0;
 }
-
-static int
-xbd_map_align(struct xbd_req *req)
-{
-	int s = splvm();
-	int rc;
-
-	rc = uvm_km_kmem_alloc(kmem_va_arena,
-	    req->req_bp->b_bcount, (VM_NOSLEEP | VM_INSTANTFIT),
-	    (vmem_addr_t *)&req->req_data);
-	splx(s);
-	if (__predict_false(rc != 0))
-		return ENOMEM;
-	if ((req->req_bp->b_flags & B_READ) == 0)
-		memcpy(req->req_data, req->req_bp->b_data,
-		    req->req_bp->b_bcount);
-	return 0;
-}
-
-static void
-xbd_unmap_align(struct xbd_req *req)
-{
-	int s;
-	if (req->req_bp->b_flags & B_READ)
-		memcpy(req->req_bp->b_data, req->req_data,
-		    req->req_bp->b_bcount);
-	s = splvm();
-	uvm_km_kmem_free(kmem_va_arena, (vaddr_t)req->req_data, req->req_bp->b_bcount);
-	splx(s);
-}
-- 
1.7.7.5 (Apple Git-26)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 04 22:24:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Nov 2012 22:24:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TV8bx-00085P-4D; Sun, 04 Nov 2012 22:24:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TV8bv-00085K-53
	for xen-devel@lists.xen.org; Sun, 04 Nov 2012 22:24:07 +0000
Received: from [85.158.143.35:29248] by server-3.bemta-4.messagelabs.com id
	66/8A-06841-60BE6905; Sun, 04 Nov 2012 22:24:06 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1352067845!12132919!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTcyNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23853 invoked from network); 4 Nov 2012 22:24:05 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	4 Nov 2012 22:24:05 -0000
X-IronPort-AV: E=Sophos;i="4.80,711,1344211200"; d="scan'208";a="15574964"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	04 Nov 2012 22:24:04 +0000
Received: from Roger-2.local.net (10.31.3.234) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Sun, 4 Nov 2012
	22:24:04 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <port-xen@netbsd.org>
Date: Sun, 4 Nov 2012 23:23:50 +0100
Message-ID: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
MIME-Version: 1.0
Cc: xen-devel@lists.xen.org, Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH] xen: add persistent grants to xbd_xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch implements persistent grants for xbd_xenbus (blkfront in
Linux terminology). The effect of this change is to reduce the number
of unmap operations performed, since they cause a (costly) TLB
shootdown. This allows the I/O performance to scale better when a
large number of VMs are performing I/O.

On startup xbd_xenbus notifies the backend driver that it is using
persistent grants. If the backend driver is not capable of persistent
mapping, xbd_xenbus will still use the same grants, since it is
compatible with the previous protocol, and simplifies the code
complexity in xbd_xenbus.

Each time a request is send to the backend driver, xbd_xenbus will
check if there are free grants already mapped and will try to use one
of those. If there are not enough grants already mapped, xbd_xenbus
will request new grants, and they will be added to the list of free
grants when the transaction is finished, so they can be reused. Data
has to be copied from the request (struct buf) to the mapped grant, or
from the mapped grant to the request, depending on the operation being
performed.

To test the performance impact of this patch I've benchmarked the
number of IOPS performed simultaneously by 15 NetBSD DomU guests on a
Linux Dom0 that supports persistent grants. The backend used to
perform this tests was a ramdisk of size 1GB.

                     Sum of IOPS
Non-persistent            336718
Persistent                686010

As seen, there's a x2 increase in the total number of IOPS being
performed. As a reference, using exactly the same setup Linux DomUs
are able to achieve 1102019 IOPS, so there's still plenty of room for
improvement.

As said previously this implementation only covers for the NetBSD
front-end driver.

Cc: xen-devel@lists.xen.org
---
 sys/arch/xen/xen/xbd_xenbus.c |  174 ++++++++++++++++++++++++----------------
 1 files changed, 104 insertions(+), 70 deletions(-)

diff --git a/sys/arch/xen/xen/xbd_xenbus.c b/sys/arch/xen/xen/xbd_xenbus.c
index a9221e7..4ece0b0 100644
--- a/sys/arch/xen/xen/xbd_xenbus.c
+++ b/sys/arch/xen/xen/xbd_xenbus.c
@@ -68,6 +68,7 @@ __KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.57 2012/05/25 15:03:38 elric Exp $"
 #include <sys/systm.h>
 #include <sys/stat.h>
 #include <sys/vnode.h>
+#include <sys/malloc.h>
 
 #include <dev/dkvar.h>
 
@@ -99,12 +100,18 @@ __KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.57 2012/05/25 15:03:38 elric Exp $"
 #define XEN_BSHIFT      9               /* log2(XEN_BSIZE) */
 #define XEN_BSIZE       (1 << XEN_BSHIFT) 
 
+struct grant {
+	SLIST_ENTRY(grant) gnt_next;
+	grant_ref_t gref;
+	vaddr_t va;
+};
+
 struct xbd_req {
 	SLIST_ENTRY(xbd_req) req_next;
 	uint16_t req_id; /* ID passed to backend */
 	union {
 	    struct {
-		grant_ref_t req_gntref[BLKIF_MAX_SEGMENTS_PER_REQUEST];
+		struct grant *req_gntref[BLKIF_MAX_SEGMENTS_PER_REQUEST];
 		int req_nr_segments; /* number of segments in this request */
 		struct buf *req_bp; /* buffer associated with this request */
 		void *req_data; /* pointer to the data buffer */
@@ -152,6 +159,8 @@ struct xbd_xenbus_softc {
 	u_long sc_handle; /* from backend */
 	int sc_cache_flush; /* backend supports BLKIF_OP_FLUSH_DISKCACHE */
 	krndsource_t     sc_rnd_source;
+	SLIST_HEAD(,grant) sc_free_grants; /* list of available mapped grants */
+	int sc_persistent_grants; /* backend supports persistent grants */
 };
 
 #if 0
@@ -172,9 +181,6 @@ static int  xbdstart(struct dk_softc *, struct buf *);
 static void xbd_backend_changed(void *, XenbusState);
 static void xbd_connect(struct xbd_xenbus_softc *);
 
-static int  xbd_map_align(struct xbd_req *);
-static void xbd_unmap_align(struct xbd_req *);
-
 static void xbdminphys(struct buf *);
 
 CFATTACH_DECL3_NEW(xbd, sizeof(struct xbd_xenbus_softc),
@@ -217,6 +223,23 @@ static struct dkdriver xbddkdriver = {
 	.d_minphys = xbdminphys,
 };
 
+static void
+xbd_clear_grants(struct xbd_xenbus_softc *sc)
+{
+	struct grant *entry;
+
+	/* Unmap and clear the list of persistent grants */
+	while (!SLIST_EMPTY(&sc->sc_free_grants)) {
+		entry = SLIST_FIRST(&sc->sc_free_grants);
+		SLIST_REMOVE_HEAD(&sc->sc_free_grants, gnt_next);
+		if (__predict_false(xengnt_status(entry->gref)))
+			panic("grant still used");
+		xengnt_revoke_access(entry->gref);
+		uvm_km_kmem_free(kmem_va_arena, entry->va, PAGE_SIZE);
+		free(entry, M_DEVBUF);
+	}
+}
+
 static int
 xbd_xenbus_match(device_t parent, cfdata_t match, void *aux)
 {
@@ -285,6 +308,7 @@ xbd_xenbus_attach(device_t parent, device_t self, void *aux)
 		SLIST_INSERT_HEAD(&sc->sc_xbdreq_head, &sc->sc_reqs[i],
 		    req_next);
 	}
+	SLIST_INIT(&sc->sc_free_grants);
 
 	sc->sc_backend_status = BLKIF_STATE_DISCONNECTED;
 	sc->sc_shutdown = BLKIF_SHUTDOWN_REMOTE;
@@ -368,6 +392,8 @@ xbd_xenbus_detach(device_t dev, int flags)
 		rnd_detach_source(&sc->sc_rnd_source);
 	}
 
+	xbd_clear_grants(sc);
+
 	hypervisor_mask_event(sc->sc_evtchn);
 	event_remove_handler(sc->sc_evtchn, &xbd_handler, sc);
 	while (xengnt_status(sc->sc_ring_gntref)) {
@@ -402,6 +428,8 @@ xbd_xenbus_suspend(device_t dev, const pmf_qual_t *qual) {
 
 	splx(s);
 
+	xbd_clear_grants(sc);
+
 	xenbus_device_suspend(sc->sc_xbusd);
 	aprint_verbose_dev(dev, "removed event channel %d\n", sc->sc_evtchn);
 
@@ -475,6 +503,12 @@ again:
 		errmsg = "writing protocol";
 		goto abort_transaction;
 	}
+	error = xenbus_printf(xbt, sc->sc_xbusd->xbusd_path,
+	    "feature-persistent", "%u", 1);
+	if (error) {
+		errmsg = "writing feature-persistent";
+		goto abort_transaction;
+	}
 	error = xenbus_transaction_end(xbt, 0);
 	if (error == EAGAIN)
 		goto again;
@@ -614,7 +648,7 @@ xbd_connect(struct xbd_xenbus_softc *sc)
 {
 	int err;
 	unsigned long long sectors;
-	u_long cache_flush;
+	u_long cache_flush, feature_persistent;
 
 	err = xenbus_read_ul(NULL,
 	    sc->sc_xbusd->xbusd_path, "virtual-device", &sc->sc_handle, 10);
@@ -652,6 +686,15 @@ xbd_connect(struct xbd_xenbus_softc *sc)
 	else
 		sc->sc_cache_flush = 0;
 
+	err = xenbus_read_ul(NULL, sc->sc_xbusd->xbusd_otherend,
+	    "feature-persistent", &feature_persistent, 10);
+	if (err)
+		feature_persistent = 0;
+	if (feature_persistent > 0)
+		sc->sc_persistent_grants = 1;
+	else
+		sc->sc_persistent_grants = 0;
+
 	xenbus_switch_state(sc->sc_xbusd, NULL, XenbusStateConnected);
 }
 
@@ -662,7 +705,8 @@ xbd_handler(void *arg)
 	struct buf *bp;
 	RING_IDX resp_prod, i;
 	int more_to_do;
-	int seg;
+	int seg, nbytes, ncopy;
+	vaddr_t va;
 
 	DPRINTF(("xbd_handler(%s)\n", device_xname(sc->sc_dksc.sc_dev)));
 
@@ -684,18 +728,6 @@ again:
 			/* caller will free the req */
 			continue;
 		}
-		for (seg = xbdreq->req_nr_segments - 1; seg >= 0; seg--) {
-			if (__predict_false(
-			    xengnt_status(xbdreq->req_gntref[seg]))) {
-				aprint_verbose_dev(sc->sc_dksc.sc_dev,
-					"grant still used by backend\n");
-				sc->sc_ring.rsp_cons = i;
-				xbdreq->req_nr_segments = seg + 1;
-				goto done;
-			}
-			xengnt_revoke_access(xbdreq->req_gntref[seg]);
-			xbdreq->req_nr_segments--;
-		}
 		if (rep->operation != BLKIF_OP_READ &&
 		    rep->operation != BLKIF_OP_WRITE) {
 			aprint_error_dev(sc->sc_dksc.sc_dev,
@@ -709,10 +741,20 @@ again:
 			bp->b_resid = bp->b_bcount;
 			goto next;
 		}
-		/* b_resid was set in xbdstart */
+
+		if (rep->operation == BLKIF_OP_READ) {
+			/* Read data from the request */
+			nbytes = xbdreq->req_bp->b_bcount;
+			va = (vaddr_t)xbdreq->req_bp->b_data;
+			for (seg = 0; seg < xbdreq->req_nr_segments; seg++) {
+				ncopy = nbytes > PAGE_SIZE ? PAGE_SIZE : nbytes;
+				memcpy((void *) va, (void *) xbdreq->req_gntref[seg]->va,
+					   ncopy);
+				nbytes -= ncopy;
+				va += ncopy;
+			}
+		}
 next:
-		if (bp->b_data != xbdreq->req_data)
-			xbd_unmap_align(xbdreq);
 		disk_unbusy(&sc->sc_dksc.sc_dkdev,
 		    (bp->b_bcount - bp->b_resid),
 		    (bp->b_flags & B_READ));
@@ -720,8 +762,12 @@ next:
 		    bp->b_blkno);
 		biodone(bp);
 		SLIST_INSERT_HEAD(&sc->sc_xbdreq_head, xbdreq, req_next);
+		/* Insert the grants back into the list of available grants */
+		for (seg = 0; seg < xbdreq->req_nr_segments; seg++)
+			SLIST_INSERT_HEAD(&sc->sc_free_grants,
+			                  xbdreq->req_gntref[seg], gnt_next);
 	}
-done:
+
 	xen_rmb();
 	sc->sc_ring.rsp_cons = i;
 
@@ -944,9 +990,11 @@ xbdstart(struct dk_softc *dksc, struct buf *bp)
 	int ret = 0, runqueue = 1;
 	size_t bcount, off;
 	paddr_t ma;
-	vaddr_t va;
-	int nsects, nbytes, seg;
+	vaddr_t va = 0;
+	vaddr_t va_newmap;
+	int nsects, nbytes, seg, s, rc;
 	int notify;
+	struct grant *gnt;
 
 	DPRINTF(("xbdstart(%p): b_bcount = %ld\n", bp, (long)bp->b_bcount));
 
@@ -990,13 +1038,6 @@ xbdstart(struct dk_softc *dksc, struct buf *bp)
 	}
 
 	xbdreq->req_bp = bp;
-	xbdreq->req_data = bp->b_data;
-	if ((vaddr_t)bp->b_data & (XEN_BSIZE - 1)) {
-		if (__predict_false(xbd_map_align(xbdreq) != 0)) {
-			ret = -1;
-			goto out;
-		}
-	}
 	/* now we're sure we'll send this buf */
 	disk_busy(&dksc->sc_dkdev);
 	SLIST_REMOVE_HEAD(&sc->sc_xbdreq_head, req_next);
@@ -1006,8 +1047,6 @@ xbdstart(struct dk_softc *dksc, struct buf *bp)
 	req->sector_number = bp->b_rawblkno;
 	req->handle = sc->sc_handle;
 
-	va = (vaddr_t)xbdreq->req_data & ~PAGE_MASK;
-	off = (vaddr_t)xbdreq->req_data & PAGE_MASK;
 	if (bp->b_rawblkno + bp->b_bcount / DEV_BSIZE >= sc->sc_xbdsize) {
 		bcount = (sc->sc_xbdsize - bp->b_rawblkno) * DEV_BSIZE;
 		bp->b_resid = bp->b_bcount - bcount;
@@ -1020,8 +1059,32 @@ xbdstart(struct dk_softc *dksc, struct buf *bp)
 		bcount = XBD_MAX_XFER;
 	}
 	for (seg = 0; bcount > 0;) {
-		pmap_extract_ma(pmap_kernel(), va, &ma);
-		KASSERT((ma & (XEN_BSIZE - 1)) == 0);
+		/* Get an already mapped grant or map a new one */
+		if (!SLIST_EMPTY(&sc->sc_free_grants)) {
+			gnt = SLIST_FIRST(&sc->sc_free_grants);
+			SLIST_REMOVE_HEAD(&sc->sc_free_grants, gnt_next);
+		} else {
+			s = splvm();
+			rc = uvm_km_kmem_alloc(kmem_va_arena, PAGE_SIZE,
+			                       (VM_NOSLEEP | VM_INSTANTFIT),
+			                       (vmem_addr_t *)&va_newmap);
+			splx(s);
+			if (__predict_false(rc != 0))
+				panic("xbdstart: unable to map memory");
+			pmap_extract_ma(pmap_kernel(), va_newmap, &ma);
+			KASSERT((ma & (XEN_BSIZE - 1)) == 0);
+			gnt = malloc(sizeof(struct grant), M_DEVBUF, M_NOWAIT);
+			if (__predict_false(xengnt_grant_access(
+		        sc->sc_xbusd->xbusd_otherend_id, ma, 0,
+		        &gnt->gref)))
+				panic("xbdstart: xengnt_grant_access");
+			gnt->va = va_newmap;
+		}
+		xbdreq->req_data = (void *)gnt->va;
+		if (seg == 0) {
+			off = (vaddr_t)xbdreq->req_data & PAGE_MASK;
+			va = (vaddr_t)bp->b_data;
+		}
 		if (bcount > PAGE_SIZE - off)
 			nbytes = PAGE_SIZE - off;
 		else
@@ -1031,11 +1094,12 @@ xbdstart(struct dk_softc *dksc, struct buf *bp)
 		req->seg[seg].last_sect = (off >> XEN_BSHIFT) + nsects - 1;
 		KASSERT(req->seg[seg].first_sect <= req->seg[seg].last_sect);
 		KASSERT(req->seg[seg].last_sect < 8);
-		if (__predict_false(xengnt_grant_access(
-		    sc->sc_xbusd->xbusd_otherend_id, ma,
-		    (bp->b_flags & B_READ) == 0, &xbdreq->req_gntref[seg])))
-			panic("xbdstart: xengnt_grant_access"); /* XXX XXX !!! */
-		req->seg[seg].gref = xbdreq->req_gntref[seg];
+		if (req->operation == BLKIF_OP_WRITE)
+			/* Copy data from the buf to the request */
+			memcpy((void *)(gnt->va + off), (void *)(va + off), nbytes);
+
+		req->seg[seg].gref = gnt->gref;
+		xbdreq->req_gntref[seg] = gnt;
 		seg++;
 		KASSERT(seg <= BLKIF_MAX_SEGMENTS_PER_REQUEST);
 		va += PAGE_SIZE;
@@ -1063,33 +1127,3 @@ err:
 	biodone(bp);
 	return 0;
 }
-
-static int
-xbd_map_align(struct xbd_req *req)
-{
-	int s = splvm();
-	int rc;
-
-	rc = uvm_km_kmem_alloc(kmem_va_arena,
-	    req->req_bp->b_bcount, (VM_NOSLEEP | VM_INSTANTFIT),
-	    (vmem_addr_t *)&req->req_data);
-	splx(s);
-	if (__predict_false(rc != 0))
-		return ENOMEM;
-	if ((req->req_bp->b_flags & B_READ) == 0)
-		memcpy(req->req_data, req->req_bp->b_data,
-		    req->req_bp->b_bcount);
-	return 0;
-}
-
-static void
-xbd_unmap_align(struct xbd_req *req)
-{
-	int s;
-	if (req->req_bp->b_flags & B_READ)
-		memcpy(req->req_bp->b_data, req->req_data,
-		    req->req_bp->b_bcount);
-	s = splvm();
-	uvm_km_kmem_free(kmem_va_arena, (vaddr_t)req->req_data, req->req_bp->b_bcount);
-	splx(s);
-}
-- 
1.7.7.5 (Apple Git-26)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 00:24:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 00:24:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVATd-0000WI-CZ; Mon, 05 Nov 2012 00:23:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TVATb-0000WD-QZ
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 00:23:40 +0000
Received: from [193.109.254.147:55058] by server-9.bemta-14.messagelabs.com id
	34/3E-30773-A0707905; Mon, 05 Nov 2012 00:23:38 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1352075017!9656726!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjA1MjI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9065 invoked from network); 5 Nov 2012 00:23:38 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-8.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 5 Nov 2012 00:23:38 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA50NH8N013404
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 5 Nov 2012 00:23:18 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA50NGfx011830
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 5 Nov 2012 00:23:17 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA50NF4j001598; Sun, 4 Nov 2012 18:23:15 -0600
MIME-Version: 1.0
Message-ID: <26f55aab-7523-4681-9a61-a5e5740d43a9@default>
Date: Sun, 4 Nov 2012 16:23:08 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Tim Deegan <tim@xen.org>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<20121104203532.GA11377@ocelot.phlegethon.org>
In-Reply-To: <20121104203532.GA11377@ocelot.phlegethon.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Olaf Hering <olaf@aepfle.de>, Keir Fraser <keir@xen.org>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, xen-devel@lists.xen.org,
	DarioFaggioli <raistlin@linux.it>, Jan Beulich <JBeulich@suse.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Tim Deegan [mailto:tim@xen.org]
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature

Hi Tim --

> At 11:43 -0800 on 04 Nov (1352029386), Dan Magenheimer wrote:
> > > From: Keir Fraser [mailto:keir@xen.org]
> > > Sent: Friday, November 02, 2012 3:30 AM
> > > To: Jan Beulich; Dan Magenheimer
> > > Cc: Olaf Hering; IanCampbell; George Dunlap; Ian Jackson; George Shuklin; DarioFaggioli; xen-
> > > devel@lists.xen.org; Konrad Rzeszutek Wilk; Kurt Hackel; Mukesh Rathor; Zhigang Wang; TimDeegan
> > > Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> > >
> > > On 02/11/2012 09:01, "Jan Beulich" <JBeulich@suse.com> wrote:
> > >
> > > > Plus, if necessary, that loop could be broken up so that only the
> > > > initial part of it gets run with the lock held (see c/s
> > > > 22135:69e8bb164683 for why the unlock was moved past the
> > > > loop). That would make for a shorter lock hold time, but for a
> > > > higher allocation latency on large oder allocations (due to worse
> > > > cache locality).
> > >
> > > In fact I believe only the first page needs to have its count_info set to !=
> > > PGC_state_free, while the lock is held. That is sufficient to defeat the
> > > buddy merging in free_heap_pages(). Similarly, we could hoist most of the
> > > first loop in free_heap_pages() outside the lock. There's a lot of scope for
> > > optimisation here.
> >
> > (sorry for the delayed response)
> >
> > Aren't we getting a little sidetracked here?  (Maybe my fault for
> > looking at whether this specific loop is fast enough...)
> >
> > This loop handles only order=N chunks of RAM.  Speeding up this
> > loop and holding the heap_lock here for a shorter period only helps
> > the TOCTOU race if the entire domain can be allocated as a
> > single order-N allocation.
> 
> I think the idea is to speed up allocation so that, even for a large VM,
> you can just allocate memory instead of needing a reservation hypercall
> (whose only purpose, AIUI, is to give you an immediate answer).

Its purpose is to give an immediate answer on whether sufficient
space is available for allocation AND (atomically) claim it so
no other call to the allocator can race and steal some or all of
it away. So unless the allocation is sped up enough (given an arbitrary
size domain and arbitrary state of memory fragmentation) so that
the heap_lock can be held for that length of time, speeding
up allocation doesn't solve the problem.
 
> > So unless the code for the _entire_ memory allocation path can
> > be optimized so that the heap_lock can be held across _all_ the
> > allocations necessary to create an arbitrary-sized domain, for
> > any arbitrary state of memory fragmentation, the original
> > problem has not been solved.
> >
> > Or am I misunderstanding?
> >
> > I _think_ the claim hypercall/subop should resolve this, though
> > admittedly I have yet to prove (and code) it.
> 
> I don't think it solves it - or rather it might solve this _particular_
> instance of it but it doesn't solve the bigger problem.  If you have a
> set of overcommitted hosts and you want to start a new VM, you need to:
> 
>  - (a) decide which of your hosts is the least overcommitted;
>  - (b) free up enough memory on that host to build the VM; and
>  - (c) build the VM.
>
> The claim hypercall _might_ fix (c) (if it could handle allocations that
> need address-width limits or contiguous pages).  But (b) and (a) have
> exactly the same problem, unless there is a central arbiter of memory
> allocation (or equivalent distributed system).  If you try to start 2
> VMs at once,
> 
>  - (a) the toolstack will choose to start them both on the same machine,
>        even if that's not optimal, or in the case where one creation is
>        _bound_ to fail after some delay.
>  - (b) the other VMs (and perhaps tmem) start ballooning out enough
>        memory to start the new VM.  This can take even longer than
>        allocating it since it depends on guest behaviour.  It can fail
>        after an arbitrary delay (ditto).
> 
> If you have a toolstack with enough knowledge and control over memory
> allocation to sort out stages (a) and (b) in such a way that there are
> no delayed failures, (c) should be trivial.

(You've used the labels (a) and (b) twice so I'm not quite sure
I understand... but in any case)

Sigh.  No, you are missing the beauty of tmem and dynamic allocation;
you are thinking from the old static paradigm where the toolstack
controls how much memory is available.  There is no central arbiter
of memory anymore than there is a central toolstack (other than the
hypervisor on a one server Xen environment) that decides exactly
when to assign vcpus to pcpus.  There is no "free up enough memory
on that host".  Tmem doesn't start ballooning out enough memory
to start the VM... the guests are responsible for doing the ballooning
and it is _already done_.  The machine either has sufficient free+freeable
memory or it does not; and it is _that_ determination that needs
to be done atomically because many threads are micro-allocating, and
possibly multiple toolstack threads are macro-allocating,
simultaneously.

Everything is handled dynamically.  And just like a CPU scheduler
built into a hypervisor that dynamically allocates vcpu->pcpus
has proven more effective than partitioning pcpus to different
domains, dynamic memory management should prove more effective
than some bossy toolstack trying to control memory statically.

I understand that you can solve "my" problem in your paradigm
without a claim hypercall and/or by speeding up allocations.
I _don't_ see that you can solve "my" problem in _my_ paradigm
without a claim hypercall... speeding up allocations doesn't
solve the TOCTOU race so allocating sufficient space for a
domain must be atomic.

Sigh.

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 00:24:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 00:24:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVATd-0000WI-CZ; Mon, 05 Nov 2012 00:23:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TVATb-0000WD-QZ
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 00:23:40 +0000
Received: from [193.109.254.147:55058] by server-9.bemta-14.messagelabs.com id
	34/3E-30773-A0707905; Mon, 05 Nov 2012 00:23:38 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1352075017!9656726!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjA1MjI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9065 invoked from network); 5 Nov 2012 00:23:38 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-8.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 5 Nov 2012 00:23:38 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA50NH8N013404
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 5 Nov 2012 00:23:18 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA50NGfx011830
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 5 Nov 2012 00:23:17 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA50NF4j001598; Sun, 4 Nov 2012 18:23:15 -0600
MIME-Version: 1.0
Message-ID: <26f55aab-7523-4681-9a61-a5e5740d43a9@default>
Date: Sun, 4 Nov 2012 16:23:08 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Tim Deegan <tim@xen.org>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<20121104203532.GA11377@ocelot.phlegethon.org>
In-Reply-To: <20121104203532.GA11377@ocelot.phlegethon.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Olaf Hering <olaf@aepfle.de>, Keir Fraser <keir@xen.org>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, xen-devel@lists.xen.org,
	DarioFaggioli <raistlin@linux.it>, Jan Beulich <JBeulich@suse.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Tim Deegan [mailto:tim@xen.org]
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature

Hi Tim --

> At 11:43 -0800 on 04 Nov (1352029386), Dan Magenheimer wrote:
> > > From: Keir Fraser [mailto:keir@xen.org]
> > > Sent: Friday, November 02, 2012 3:30 AM
> > > To: Jan Beulich; Dan Magenheimer
> > > Cc: Olaf Hering; IanCampbell; George Dunlap; Ian Jackson; George Shuklin; DarioFaggioli; xen-
> > > devel@lists.xen.org; Konrad Rzeszutek Wilk; Kurt Hackel; Mukesh Rathor; Zhigang Wang; TimDeegan
> > > Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> > >
> > > On 02/11/2012 09:01, "Jan Beulich" <JBeulich@suse.com> wrote:
> > >
> > > > Plus, if necessary, that loop could be broken up so that only the
> > > > initial part of it gets run with the lock held (see c/s
> > > > 22135:69e8bb164683 for why the unlock was moved past the
> > > > loop). That would make for a shorter lock hold time, but for a
> > > > higher allocation latency on large oder allocations (due to worse
> > > > cache locality).
> > >
> > > In fact I believe only the first page needs to have its count_info set to !=
> > > PGC_state_free, while the lock is held. That is sufficient to defeat the
> > > buddy merging in free_heap_pages(). Similarly, we could hoist most of the
> > > first loop in free_heap_pages() outside the lock. There's a lot of scope for
> > > optimisation here.
> >
> > (sorry for the delayed response)
> >
> > Aren't we getting a little sidetracked here?  (Maybe my fault for
> > looking at whether this specific loop is fast enough...)
> >
> > This loop handles only order=N chunks of RAM.  Speeding up this
> > loop and holding the heap_lock here for a shorter period only helps
> > the TOCTOU race if the entire domain can be allocated as a
> > single order-N allocation.
> 
> I think the idea is to speed up allocation so that, even for a large VM,
> you can just allocate memory instead of needing a reservation hypercall
> (whose only purpose, AIUI, is to give you an immediate answer).

Its purpose is to give an immediate answer on whether sufficient
space is available for allocation AND (atomically) claim it so
no other call to the allocator can race and steal some or all of
it away. So unless the allocation is sped up enough (given an arbitrary
size domain and arbitrary state of memory fragmentation) so that
the heap_lock can be held for that length of time, speeding
up allocation doesn't solve the problem.
 
> > So unless the code for the _entire_ memory allocation path can
> > be optimized so that the heap_lock can be held across _all_ the
> > allocations necessary to create an arbitrary-sized domain, for
> > any arbitrary state of memory fragmentation, the original
> > problem has not been solved.
> >
> > Or am I misunderstanding?
> >
> > I _think_ the claim hypercall/subop should resolve this, though
> > admittedly I have yet to prove (and code) it.
> 
> I don't think it solves it - or rather it might solve this _particular_
> instance of it but it doesn't solve the bigger problem.  If you have a
> set of overcommitted hosts and you want to start a new VM, you need to:
> 
>  - (a) decide which of your hosts is the least overcommitted;
>  - (b) free up enough memory on that host to build the VM; and
>  - (c) build the VM.
>
> The claim hypercall _might_ fix (c) (if it could handle allocations that
> need address-width limits or contiguous pages).  But (b) and (a) have
> exactly the same problem, unless there is a central arbiter of memory
> allocation (or equivalent distributed system).  If you try to start 2
> VMs at once,
> 
>  - (a) the toolstack will choose to start them both on the same machine,
>        even if that's not optimal, or in the case where one creation is
>        _bound_ to fail after some delay.
>  - (b) the other VMs (and perhaps tmem) start ballooning out enough
>        memory to start the new VM.  This can take even longer than
>        allocating it since it depends on guest behaviour.  It can fail
>        after an arbitrary delay (ditto).
> 
> If you have a toolstack with enough knowledge and control over memory
> allocation to sort out stages (a) and (b) in such a way that there are
> no delayed failures, (c) should be trivial.

(You've used the labels (a) and (b) twice so I'm not quite sure
I understand... but in any case)

Sigh.  No, you are missing the beauty of tmem and dynamic allocation;
you are thinking from the old static paradigm where the toolstack
controls how much memory is available.  There is no central arbiter
of memory anymore than there is a central toolstack (other than the
hypervisor on a one server Xen environment) that decides exactly
when to assign vcpus to pcpus.  There is no "free up enough memory
on that host".  Tmem doesn't start ballooning out enough memory
to start the VM... the guests are responsible for doing the ballooning
and it is _already done_.  The machine either has sufficient free+freeable
memory or it does not; and it is _that_ determination that needs
to be done atomically because many threads are micro-allocating, and
possibly multiple toolstack threads are macro-allocating,
simultaneously.

Everything is handled dynamically.  And just like a CPU scheduler
built into a hypervisor that dynamically allocates vcpu->pcpus
has proven more effective than partitioning pcpus to different
domains, dynamic memory management should prove more effective
than some bossy toolstack trying to control memory statically.

I understand that you can solve "my" problem in your paradigm
without a claim hypercall and/or by speeding up allocations.
I _don't_ see that you can solve "my" problem in _my_ paradigm
without a claim hypercall... speeding up allocations doesn't
solve the TOCTOU race so allocating sufficient space for a
domain must be atomic.

Sigh.

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 05:29:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 05:29:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVFF2-0006TB-M7; Mon, 05 Nov 2012 05:28:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TVFF0-0006T6-FM
	for xen-devel@lists.xensource.com; Mon, 05 Nov 2012 05:28:54 +0000
Received: from [85.158.143.99:17437] by server-3.bemta-4.messagelabs.com id
	3A/97-06841-59E47905; Mon, 05 Nov 2012 05:28:53 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1352093333!21588163!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTcyNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8279 invoked from network); 5 Nov 2012 05:28:53 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 05:28:53 -0000
X-IronPort-AV: E=Sophos;i="4.80,713,1344211200"; d="scan'208";a="15576533"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	05 Nov 2012 05:28:52 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 5 Nov 2012 05:28:51 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TVFEx-0001GA-My;
	Mon, 05 Nov 2012 05:28:51 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TVFEx-0005F9-IG;
	Mon, 05 Nov 2012 05:28:51 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14365-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 5 Nov 2012 05:28:51 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14365: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14365 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14365/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14359
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14359
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14359
 test-amd64-amd64-xl-qemuu-win7-amd64  7 windows-install        fail like 14359

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  bd78e5630a5b
baseline version:
 xen                  bd78e5630a5b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 05:29:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 05:29:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVFF2-0006TB-M7; Mon, 05 Nov 2012 05:28:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TVFF0-0006T6-FM
	for xen-devel@lists.xensource.com; Mon, 05 Nov 2012 05:28:54 +0000
Received: from [85.158.143.99:17437] by server-3.bemta-4.messagelabs.com id
	3A/97-06841-59E47905; Mon, 05 Nov 2012 05:28:53 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1352093333!21588163!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTcyNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8279 invoked from network); 5 Nov 2012 05:28:53 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 05:28:53 -0000
X-IronPort-AV: E=Sophos;i="4.80,713,1344211200"; d="scan'208";a="15576533"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	05 Nov 2012 05:28:52 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 5 Nov 2012 05:28:51 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TVFEx-0001GA-My;
	Mon, 05 Nov 2012 05:28:51 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TVFEx-0005F9-IG;
	Mon, 05 Nov 2012 05:28:51 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14365-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 5 Nov 2012 05:28:51 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14365: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14365 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14365/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14359
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14359
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14359
 test-amd64-amd64-xl-qemuu-win7-amd64  7 windows-install        fail like 14359

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  bd78e5630a5b
baseline version:
 xen                  bd78e5630a5b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 06:43:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 06:43:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVGOQ-0006nw-IB; Mon, 05 Nov 2012 06:42:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.carpenter@oracle.com>) id 1TVGOO-0006np-Js
	for xen-devel@lists.xensource.com; Mon, 05 Nov 2012 06:42:40 +0000
Received: from [85.158.137.99:4444] by server-1.bemta-3.messagelabs.com id
	DB/D5-12169-FDF57905; Mon, 05 Nov 2012 06:42:39 +0000
X-Env-Sender: dan.carpenter@oracle.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352097757!17711546!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjA1MjI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5598 invoked from network); 5 Nov 2012 06:42:39 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-14.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 5 Nov 2012 06:42:39 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA56gToU028659
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 5 Nov 2012 06:42:31 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA56gQJQ023391
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 5 Nov 2012 06:42:27 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA56gOMY015197; Mon, 5 Nov 2012 00:42:24 -0600
Received: from elgon.mountain (/41.212.103.53)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Sun, 04 Nov 2012 22:42:23 -0800
Date: Mon, 5 Nov 2012 09:42:17 +0300
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Mukesh Rathor <mukesh.rathor@oracle.com>
Message-ID: <20121105064217.GA26179@elgon.mountain>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Jeremy Fitzhardinge <jeremy@goop.org>, xen-devel@lists.xensource.com,
	kernel-janitors@vger.kernel.org, virtualization@lists.linux-foundation.org
Subject: [Xen-devel] [patch] xen/privcmd: fix condition in privcmd_close()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The parenthesis are in the wrong place so the original code is
equivalent to:

	if (!xen_feature(XENFEAT_writable_descriptor_tables)) { ...

Which obviously was not intended.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index b9d0898..6011f3b 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -495,7 +495,7 @@ static void privcmd_close(struct vm_area_struct *vma)
 	struct page **pages = vma->vm_private_data;
 	int numpgs = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
 
-	if (!xen_feature(XENFEAT_auto_translated_physmap || !numpgs || !pages))
+	if (!xen_feature(XENFEAT_auto_translated_physmap) || !numpgs || !pages)
 		return;
 
 	xen_unmap_domain_mfn_range(vma, numpgs, pages);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 06:43:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 06:43:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVGOQ-0006nw-IB; Mon, 05 Nov 2012 06:42:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.carpenter@oracle.com>) id 1TVGOO-0006np-Js
	for xen-devel@lists.xensource.com; Mon, 05 Nov 2012 06:42:40 +0000
Received: from [85.158.137.99:4444] by server-1.bemta-3.messagelabs.com id
	DB/D5-12169-FDF57905; Mon, 05 Nov 2012 06:42:39 +0000
X-Env-Sender: dan.carpenter@oracle.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352097757!17711546!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjA1MjI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5598 invoked from network); 5 Nov 2012 06:42:39 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-14.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 5 Nov 2012 06:42:39 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA56gToU028659
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 5 Nov 2012 06:42:31 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA56gQJQ023391
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 5 Nov 2012 06:42:27 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA56gOMY015197; Mon, 5 Nov 2012 00:42:24 -0600
Received: from elgon.mountain (/41.212.103.53)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Sun, 04 Nov 2012 22:42:23 -0800
Date: Mon, 5 Nov 2012 09:42:17 +0300
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Mukesh Rathor <mukesh.rathor@oracle.com>
Message-ID: <20121105064217.GA26179@elgon.mountain>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Jeremy Fitzhardinge <jeremy@goop.org>, xen-devel@lists.xensource.com,
	kernel-janitors@vger.kernel.org, virtualization@lists.linux-foundation.org
Subject: [Xen-devel] [patch] xen/privcmd: fix condition in privcmd_close()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The parenthesis are in the wrong place so the original code is
equivalent to:

	if (!xen_feature(XENFEAT_writable_descriptor_tables)) { ...

Which obviously was not intended.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index b9d0898..6011f3b 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -495,7 +495,7 @@ static void privcmd_close(struct vm_area_struct *vma)
 	struct page **pages = vma->vm_private_data;
 	int numpgs = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
 
-	if (!xen_feature(XENFEAT_auto_translated_physmap || !numpgs || !pages))
+	if (!xen_feature(XENFEAT_auto_translated_physmap) || !numpgs || !pages)
 		return;
 
 	xen_unmap_domain_mfn_range(vma, numpgs, pages);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 08:30:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 08:30:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVI3x-0008KL-QY; Mon, 05 Nov 2012 08:29:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVI3w-0008KG-UD
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 08:29:41 +0000
Received: from [85.158.143.99:2421] by server-1.bemta-4.messagelabs.com id
	C8/E2-27934-4F877905; Mon, 05 Nov 2012 08:29:40 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1352104179!17433695!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13733 invoked from network); 5 Nov 2012 08:29:39 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-216.messagelabs.com with SMTP;
	5 Nov 2012 08:29:39 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 05 Nov 2012 08:31:56 +0000
Message-Id: <509786FF02000078000A6491@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Mon, 05 Nov 2012 08:29:35 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Jinsong Liu" <jinsong.liu@intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<5089676602000078000A4928@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC82923353723C7@SHSMSX101.ccr.corp.intel.com>
	<508A89CB020000780008E6ED@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC829233537A2A5@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233537A2A5@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 03.11.12 at 13:16, "Liu, Jinsong" <jinsong.liu@intel.com> wrote:
> Konrad Rzeszutek Wilk wrote:
>>>> From f514b97628945cfac00efb0d456f133d44754c9d Mon Sep 17 00:00:00
>>>> 2001 
>>> From: Liu, Jinsong <jinsong.liu@intel.com>
>>> Date: Thu, 1 Nov 2012 21:02:36 +0800
>>> Subject: [PATCH 1/2] Xen acpi pad implement
>>> 
>>> PAD is acpi Processor Aggregator Device which provides a control
>>> point 
>>> that enables the platform to perform specific processor configuration
>>> and control that applies to all processors in the platform.
>>> 
>>> This patch is to implement Xen acpi pad logic. When running under Xen
>>> virt platform, native pad driver would not work. Instead Xen pad
>>> driver, 
>>> a self-contained and very thin logic level, would take over acpi pad
>>> staff. When acpi pad notify OSPM, xen pad logic intercept and parse
>>> _PUR object 
>>> and then hypercall to hyervisor for the rest work, say, core parking.
>> 
>> Two comments:
>>  - Did you look at the SuSE tree? Jan mentioned that they did some
>>    fixes? Did you carry them over?
> 
> I didn't look at Suse tree.
> 
> Jan, would you please tell me where can I pull Suse tree?

http://kernel.opensuse.org/git

> have you 
> implemented xen-acpi-pad logic at Suse dom0 and which points you have fixed?

Yes, we've been carrying this for quite some time. I don't recall
the specific cleanups to the code I did, so I can only refer you
to the trees above.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 08:30:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 08:30:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVI3x-0008KL-QY; Mon, 05 Nov 2012 08:29:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVI3w-0008KG-UD
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 08:29:41 +0000
Received: from [85.158.143.99:2421] by server-1.bemta-4.messagelabs.com id
	C8/E2-27934-4F877905; Mon, 05 Nov 2012 08:29:40 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1352104179!17433695!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13733 invoked from network); 5 Nov 2012 08:29:39 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-216.messagelabs.com with SMTP;
	5 Nov 2012 08:29:39 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 05 Nov 2012 08:31:56 +0000
Message-Id: <509786FF02000078000A6491@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Mon, 05 Nov 2012 08:29:35 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Jinsong Liu" <jinsong.liu@intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<5089676602000078000A4928@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC82923353723C7@SHSMSX101.ccr.corp.intel.com>
	<508A89CB020000780008E6ED@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC829233537A2A5@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233537A2A5@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 03.11.12 at 13:16, "Liu, Jinsong" <jinsong.liu@intel.com> wrote:
> Konrad Rzeszutek Wilk wrote:
>>>> From f514b97628945cfac00efb0d456f133d44754c9d Mon Sep 17 00:00:00
>>>> 2001 
>>> From: Liu, Jinsong <jinsong.liu@intel.com>
>>> Date: Thu, 1 Nov 2012 21:02:36 +0800
>>> Subject: [PATCH 1/2] Xen acpi pad implement
>>> 
>>> PAD is acpi Processor Aggregator Device which provides a control
>>> point 
>>> that enables the platform to perform specific processor configuration
>>> and control that applies to all processors in the platform.
>>> 
>>> This patch is to implement Xen acpi pad logic. When running under Xen
>>> virt platform, native pad driver would not work. Instead Xen pad
>>> driver, 
>>> a self-contained and very thin logic level, would take over acpi pad
>>> staff. When acpi pad notify OSPM, xen pad logic intercept and parse
>>> _PUR object 
>>> and then hypercall to hyervisor for the rest work, say, core parking.
>> 
>> Two comments:
>>  - Did you look at the SuSE tree? Jan mentioned that they did some
>>    fixes? Did you carry them over?
> 
> I didn't look at Suse tree.
> 
> Jan, would you please tell me where can I pull Suse tree?

http://kernel.opensuse.org/git

> have you 
> implemented xen-acpi-pad logic at Suse dom0 and which points you have fixed?

Yes, we've been carrying this for quite some time. I don't recall
the specific cleanups to the code I did, so I can only refer you
to the trees above.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 09:17:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 09:17:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVInJ-0000Ab-7t; Mon, 05 Nov 2012 09:16:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVInH-0000AW-1L
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 09:16:31 +0000
Received: from [85.158.138.51:22344] by server-2.bemta-3.messagelabs.com id
	71/29-04744-EE387905; Mon, 05 Nov 2012 09:16:30 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1352106989!20684211!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12392 invoked from network); 5 Nov 2012 09:16:29 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-174.messagelabs.com with SMTP;
	5 Nov 2012 09:16:29 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 05 Nov 2012 09:16:28 +0000
Message-Id: <509791F902000078000A64D4@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Mon, 05 Nov 2012 09:16:25 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>,
	"Keir Fraser" <keir@xen.org>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
In-Reply-To: <7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 04.11.12 at 20:43, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  From: Keir Fraser [mailto:keir@xen.org]
>> Sent: Friday, November 02, 2012 3:30 AM
>> To: Jan Beulich; Dan Magenheimer
>> Cc: Olaf Hering; IanCampbell; George Dunlap; Ian Jackson; George Shuklin; 
> DarioFaggioli; xen-
>> devel@lists.xen.org; Konrad Rzeszutek Wilk; Kurt Hackel; Mukesh Rathor; 
> Zhigang Wang; TimDeegan
>> Subject: Re: Proposed new "memory capacity claim" hypercall/feature
>> 
>> On 02/11/2012 09:01, "Jan Beulich" <JBeulich@suse.com> wrote:
>> 
>> > Plus, if necessary, that loop could be broken up so that only the
>> > initial part of it gets run with the lock held (see c/s
>> > 22135:69e8bb164683 for why the unlock was moved past the
>> > loop). That would make for a shorter lock hold time, but for a
>> > higher allocation latency on large oder allocations (due to worse
>> > cache locality).
>> 
>> In fact I believe only the first page needs to have its count_info set to !=
>> PGC_state_free, while the lock is held. That is sufficient to defeat the
>> buddy merging in free_heap_pages(). Similarly, we could hoist most of the
>> first loop in free_heap_pages() outside the lock. There's a lot of scope for
>> optimisation here.
> 
> (sorry for the delayed response)
> 
> Aren't we getting a little sidetracked here?  (Maybe my fault for
> looking at whether this specific loop is fast enough...)
> 
> This loop handles only order=N chunks of RAM.  Speeding up this
> loop and holding the heap_lock here for a shorter period only helps
> the TOCTOU race if the entire domain can be allocated as a
> single order-N allocation.
> 
> Domain creation is supposed to succeed as long as there is
> sufficient RAM, _regardless_ of the state of memory fragmentation,
> correct?
> 
> So unless the code for the _entire_ memory allocation path can
> be optimized so that the heap_lock can be held across _all_ the
> allocations necessary to create an arbitrary-sized domain, for
> any arbitrary state of memory fragmentation, the original
> problem has not been solved.
> 
> Or am I misunderstanding?

I think we got here via questioning whether suppressing certain
activities (like tmem causing the allocator visible amount of
available memory) for a brief period of time would be acceptable,
and while that indeed depends on the overall latency of memory
allocation for the domain as a whole, I would be somewhat
tolerant for it to involve a longer suspension period on a highly
fragmented system.

But of course, if this can be made work uniformly, that would be
preferred.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 09:17:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 09:17:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVInJ-0000Ab-7t; Mon, 05 Nov 2012 09:16:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVInH-0000AW-1L
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 09:16:31 +0000
Received: from [85.158.138.51:22344] by server-2.bemta-3.messagelabs.com id
	71/29-04744-EE387905; Mon, 05 Nov 2012 09:16:30 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1352106989!20684211!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12392 invoked from network); 5 Nov 2012 09:16:29 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-174.messagelabs.com with SMTP;
	5 Nov 2012 09:16:29 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 05 Nov 2012 09:16:28 +0000
Message-Id: <509791F902000078000A64D4@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Mon, 05 Nov 2012 09:16:25 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>,
	"Keir Fraser" <keir@xen.org>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
In-Reply-To: <7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 04.11.12 at 20:43, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  From: Keir Fraser [mailto:keir@xen.org]
>> Sent: Friday, November 02, 2012 3:30 AM
>> To: Jan Beulich; Dan Magenheimer
>> Cc: Olaf Hering; IanCampbell; George Dunlap; Ian Jackson; George Shuklin; 
> DarioFaggioli; xen-
>> devel@lists.xen.org; Konrad Rzeszutek Wilk; Kurt Hackel; Mukesh Rathor; 
> Zhigang Wang; TimDeegan
>> Subject: Re: Proposed new "memory capacity claim" hypercall/feature
>> 
>> On 02/11/2012 09:01, "Jan Beulich" <JBeulich@suse.com> wrote:
>> 
>> > Plus, if necessary, that loop could be broken up so that only the
>> > initial part of it gets run with the lock held (see c/s
>> > 22135:69e8bb164683 for why the unlock was moved past the
>> > loop). That would make for a shorter lock hold time, but for a
>> > higher allocation latency on large oder allocations (due to worse
>> > cache locality).
>> 
>> In fact I believe only the first page needs to have its count_info set to !=
>> PGC_state_free, while the lock is held. That is sufficient to defeat the
>> buddy merging in free_heap_pages(). Similarly, we could hoist most of the
>> first loop in free_heap_pages() outside the lock. There's a lot of scope for
>> optimisation here.
> 
> (sorry for the delayed response)
> 
> Aren't we getting a little sidetracked here?  (Maybe my fault for
> looking at whether this specific loop is fast enough...)
> 
> This loop handles only order=N chunks of RAM.  Speeding up this
> loop and holding the heap_lock here for a shorter period only helps
> the TOCTOU race if the entire domain can be allocated as a
> single order-N allocation.
> 
> Domain creation is supposed to succeed as long as there is
> sufficient RAM, _regardless_ of the state of memory fragmentation,
> correct?
> 
> So unless the code for the _entire_ memory allocation path can
> be optimized so that the heap_lock can be held across _all_ the
> allocations necessary to create an arbitrary-sized domain, for
> any arbitrary state of memory fragmentation, the original
> problem has not been solved.
> 
> Or am I misunderstanding?

I think we got here via questioning whether suppressing certain
activities (like tmem causing the allocator visible amount of
available memory) for a brief period of time would be acceptable,
and while that indeed depends on the overall latency of memory
allocation for the domain as a whole, I would be somewhat
tolerant for it to involve a longer suspension period on a highly
fragmented system.

But of course, if this can be made work uniformly, that would be
preferred.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 10:28:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 10:28:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVJuI-0000ig-W8; Mon, 05 Nov 2012 10:27:50 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TVJuH-0000iW-U3
	for xen-devel@lists.xensource.com; Mon, 05 Nov 2012 10:27:50 +0000
Received: from [193.109.254.147:16070] by server-4.bemta-14.messagelabs.com id
	CD/F4-18856-5A497905; Mon, 05 Nov 2012 10:27:49 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1352111260!9628635!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODEzNTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16334 invoked from network); 5 Nov 2012 10:27:41 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 10:27:41 -0000
X-IronPort-AV: E=Sophos;i="4.80,714,1344211200"; d="scan'208";a="43417971"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	05 Nov 2012 10:27:40 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 5 Nov 2012 05:27:39 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TVJu7-0006Lk-EA;
	Mon, 05 Nov 2012 10:27:39 +0000
Message-ID: <1352111140.25014.97.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad@kernel.org>
Date: Mon, 5 Nov 2012 11:25:40 +0100
In-Reply-To: <20121102163720.GA27213@konrad-lan.dumpdata.com>
References: <1350673381-20342-1-git-send-email-konrad.wilk@oracle.com>
	<1350984138.2237.22.camel@zakaz.uk.xensource.com>
	<20121102163720.GA27213@konrad-lan.dumpdata.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH] xen/hvm: If we fail to fetch an HVM
 parameter print out which flag it is.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-02 at 16:37 +0000, Konrad Rzeszutek Wilk wrote:
> Like this?

Yup. Although I'm not sure if it really needs to be inlined. I guess
it's not an especially performance sensitve path though.

> 
> From 66705b0ff8808d86c12fcb3815d849a848b5409b Mon Sep 17 00:00:00 2001
> From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Date: Fri, 19 Oct 2012 15:01:46 -0400
> Subject: [PATCH] xen/hvm: If we fail to fetch an HVM parameter print out
>  which flag it is.
> 
> Makes it easier to troubleshoot in the field.
> 
> [v1: Use macro per Ian's suggestion]
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> ---
>  include/xen/hvm.h | 34 ++++++++++++++++++++++++++++++++--
>  1 file changed, 32 insertions(+), 2 deletions(-)
> 
> diff --git a/include/xen/hvm.h b/include/xen/hvm.h
> index b193fa2..13e43e4 100644
> --- a/include/xen/hvm.h
> +++ b/include/xen/hvm.h
> @@ -5,6 +5,36 @@
>  #include <xen/interface/hvm/params.h>
>  #include <asm/xen/hypercall.h>
>  
> +static const char *param_name(int op)
> +{
> +#define PARAM(x) [HVM_PARAM_##x] = #x
> +	static const char *const names[] = {
> +		PARAM(CALLBACK_IRQ),
> +		PARAM(STORE_PFN),
> +		PARAM(STORE_EVTCHN),
> +		PARAM(PAE_ENABLED),
> +		PARAM(IOREQ_PFN),
> +		PARAM(BUFIOREQ_PFN),
> +		PARAM(TIMER_MODE),
> +		PARAM(HPET_ENABLED),
> +		PARAM(IDENT_PT),
> +		PARAM(DM_DOMAIN),
> +		PARAM(ACPI_S_STATE),
> +		PARAM(VM86_TSS),
> +		PARAM(VPT_ALIGN),
> +		PARAM(CONSOLE_PFN),
> +		PARAM(CONSOLE_EVTCHN),
> +	};
> +#undef PARAM
> +
> +	if (op >= ARRAY_SIZE(names))
> +		return "unknown";
> +
> +	if (!names[op])
> +		return "reserved";
> +
> +	return names[op];
> +}
>  static inline int hvm_get_parameter(int idx, uint64_t *value)
>  {
>  	struct xen_hvm_param xhv;
> @@ -14,8 +44,8 @@ static inline int hvm_get_parameter(int idx, uint64_t *value)
>  	xhv.index = idx;
>  	r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv);
>  	if (r < 0) {
> -		printk(KERN_ERR "Cannot get hvm parameter %d: %d!\n",
> -			idx, r);
> +		printk(KERN_ERR "Cannot get hvm parameter %s (%d): %d!\n",
> +			param_name(idx), idx, r);
>  		return r;
>  	}
>  	*value = xhv.value;



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 10:28:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 10:28:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVJuI-0000ig-W8; Mon, 05 Nov 2012 10:27:50 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TVJuH-0000iW-U3
	for xen-devel@lists.xensource.com; Mon, 05 Nov 2012 10:27:50 +0000
Received: from [193.109.254.147:16070] by server-4.bemta-14.messagelabs.com id
	CD/F4-18856-5A497905; Mon, 05 Nov 2012 10:27:49 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1352111260!9628635!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODEzNTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16334 invoked from network); 5 Nov 2012 10:27:41 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 10:27:41 -0000
X-IronPort-AV: E=Sophos;i="4.80,714,1344211200"; d="scan'208";a="43417971"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	05 Nov 2012 10:27:40 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 5 Nov 2012 05:27:39 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TVJu7-0006Lk-EA;
	Mon, 05 Nov 2012 10:27:39 +0000
Message-ID: <1352111140.25014.97.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad@kernel.org>
Date: Mon, 5 Nov 2012 11:25:40 +0100
In-Reply-To: <20121102163720.GA27213@konrad-lan.dumpdata.com>
References: <1350673381-20342-1-git-send-email-konrad.wilk@oracle.com>
	<1350984138.2237.22.camel@zakaz.uk.xensource.com>
	<20121102163720.GA27213@konrad-lan.dumpdata.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH] xen/hvm: If we fail to fetch an HVM
 parameter print out which flag it is.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-02 at 16:37 +0000, Konrad Rzeszutek Wilk wrote:
> Like this?

Yup. Although I'm not sure if it really needs to be inlined. I guess
it's not an especially performance sensitve path though.

> 
> From 66705b0ff8808d86c12fcb3815d849a848b5409b Mon Sep 17 00:00:00 2001
> From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Date: Fri, 19 Oct 2012 15:01:46 -0400
> Subject: [PATCH] xen/hvm: If we fail to fetch an HVM parameter print out
>  which flag it is.
> 
> Makes it easier to troubleshoot in the field.
> 
> [v1: Use macro per Ian's suggestion]
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> ---
>  include/xen/hvm.h | 34 ++++++++++++++++++++++++++++++++--
>  1 file changed, 32 insertions(+), 2 deletions(-)
> 
> diff --git a/include/xen/hvm.h b/include/xen/hvm.h
> index b193fa2..13e43e4 100644
> --- a/include/xen/hvm.h
> +++ b/include/xen/hvm.h
> @@ -5,6 +5,36 @@
>  #include <xen/interface/hvm/params.h>
>  #include <asm/xen/hypercall.h>
>  
> +static const char *param_name(int op)
> +{
> +#define PARAM(x) [HVM_PARAM_##x] = #x
> +	static const char *const names[] = {
> +		PARAM(CALLBACK_IRQ),
> +		PARAM(STORE_PFN),
> +		PARAM(STORE_EVTCHN),
> +		PARAM(PAE_ENABLED),
> +		PARAM(IOREQ_PFN),
> +		PARAM(BUFIOREQ_PFN),
> +		PARAM(TIMER_MODE),
> +		PARAM(HPET_ENABLED),
> +		PARAM(IDENT_PT),
> +		PARAM(DM_DOMAIN),
> +		PARAM(ACPI_S_STATE),
> +		PARAM(VM86_TSS),
> +		PARAM(VPT_ALIGN),
> +		PARAM(CONSOLE_PFN),
> +		PARAM(CONSOLE_EVTCHN),
> +	};
> +#undef PARAM
> +
> +	if (op >= ARRAY_SIZE(names))
> +		return "unknown";
> +
> +	if (!names[op])
> +		return "reserved";
> +
> +	return names[op];
> +}
>  static inline int hvm_get_parameter(int idx, uint64_t *value)
>  {
>  	struct xen_hvm_param xhv;
> @@ -14,8 +44,8 @@ static inline int hvm_get_parameter(int idx, uint64_t *value)
>  	xhv.index = idx;
>  	r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv);
>  	if (r < 0) {
> -		printk(KERN_ERR "Cannot get hvm parameter %d: %d!\n",
> -			idx, r);
> +		printk(KERN_ERR "Cannot get hvm parameter %s (%d): %d!\n",
> +			param_name(idx), idx, r);
>  		return r;
>  	}
>  	*value = xhv.value;



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 10:32:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 10:32:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVJyP-0001Av-G3; Mon, 05 Nov 2012 10:32:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TVJyO-0001Ak-6y
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 10:32:04 +0000
Received: from [85.158.139.211:11469] by server-15.bemta-5.messagelabs.com id
	1D/25-26920-3A597905; Mon, 05 Nov 2012 10:32:03 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1352111520!18916794!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODEzNTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27572 invoked from network); 5 Nov 2012 10:32:01 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 10:32:01 -0000
X-IronPort-AV: E=Sophos;i="4.80,714,1344211200"; d="scan'208";a="43418811"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	05 Nov 2012 10:32:00 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 5 Nov 2012 05:31:59 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TVJyJ-0006PA-Ac;
	Mon, 05 Nov 2012 10:31:59 +0000
Message-ID: <1352111399.25014.101.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Date: Mon, 5 Nov 2012 11:29:59 +0100
In-Reply-To: <26f55aab-7523-4681-9a61-a5e5740d43a9@default>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<20121104203532.GA11377@ocelot.phlegethon.org>
	<26f55aab-7523-4681-9a61-a5e5740d43a9@default>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Olaf Hering <olaf@aepfle.de>, "Keir \(Xen.org\)" <keir@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	George Shuklin <george.shuklin@gmail.com>,
	DarioFaggioli <raistlin@linux.it>, Jan
	Beulich <JBeulich@suse.com>, Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-05 at 00:23 +0000, Dan Magenheimer wrote:
> There is no "free up enough memory on that host". Tmem doesn't start
> ballooning out enough memory to start the VM... the guests are
> responsible for doing the ballooning and it is _already done_.  The
> machine either has sufficient free+freeable memory or it does not;

How does one go about deciding which host in a multi thousand host
deployment to try the claim hypercall on?

Ian


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 10:32:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 10:32:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVJyP-0001Av-G3; Mon, 05 Nov 2012 10:32:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TVJyO-0001Ak-6y
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 10:32:04 +0000
Received: from [85.158.139.211:11469] by server-15.bemta-5.messagelabs.com id
	1D/25-26920-3A597905; Mon, 05 Nov 2012 10:32:03 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1352111520!18916794!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODEzNTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27572 invoked from network); 5 Nov 2012 10:32:01 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 10:32:01 -0000
X-IronPort-AV: E=Sophos;i="4.80,714,1344211200"; d="scan'208";a="43418811"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	05 Nov 2012 10:32:00 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 5 Nov 2012 05:31:59 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TVJyJ-0006PA-Ac;
	Mon, 05 Nov 2012 10:31:59 +0000
Message-ID: <1352111399.25014.101.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Date: Mon, 5 Nov 2012 11:29:59 +0100
In-Reply-To: <26f55aab-7523-4681-9a61-a5e5740d43a9@default>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<20121104203532.GA11377@ocelot.phlegethon.org>
	<26f55aab-7523-4681-9a61-a5e5740d43a9@default>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Olaf Hering <olaf@aepfle.de>, "Keir \(Xen.org\)" <keir@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	George Shuklin <george.shuklin@gmail.com>,
	DarioFaggioli <raistlin@linux.it>, Jan
	Beulich <JBeulich@suse.com>, Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-05 at 00:23 +0000, Dan Magenheimer wrote:
> There is no "free up enough memory on that host". Tmem doesn't start
> ballooning out enough memory to start the VM... the guests are
> responsible for doing the ballooning and it is _already done_.  The
> machine either has sufficient free+freeable memory or it does not;

How does one go about deciding which host in a multi thousand host
deployment to try the claim hypercall on?

Ian


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 10:58:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 10:58:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVKNs-0001if-ON; Mon, 05 Nov 2012 10:58:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dave.martin@linaro.org>) id 1TVKNr-0001ia-HO
	for xen-devel@lists.xensource.com; Mon, 05 Nov 2012 10:58:23 +0000
Received: from [85.158.138.51:2207] by server-9.bemta-3.messagelabs.com id
	96/FF-02388-ECB97905; Mon, 05 Nov 2012 10:58:22 +0000
X-Env-Sender: dave.martin@linaro.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1352113101!28639400!1
X-Originating-IP: [209.85.217.171]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4846 invoked from network); 5 Nov 2012 10:58:22 -0000
Received: from mail-lb0-f171.google.com (HELO mail-lb0-f171.google.com)
	(209.85.217.171)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 10:58:22 -0000
Received: by mail-lb0-f171.google.com with SMTP id m4so4817788lbo.30
	for <xen-devel@lists.xensource.com>;
	Mon, 05 Nov 2012 02:58:21 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent
	:x-gm-message-state;
	bh=khRgQCVTgsE4uGPSW7rGmW1yEbunI0n3ndxeKzmcmFQ=;
	b=CnQiEAJG0iUrD3tdzc0kotjK3TEMa+bGMyCD2rTCKaE4Qt9GmQl5HXtd1T9h0fU25w
	ahUDukDzH15ctxUTEadLF3NfrfjsAAfwADIzqf3zKMyRzvp6eQaumLjHwmqdmJ2YCTGz
	dyHGGOxnrKIJwboyGabs+xiY8nD6KVdRQ3wQmYBf2SiOCRwV2rnBjzPGW0dJEHjUAh8Z
	i3t8YkmxlqUB19eN5DbOghi1KLaCrEYPTAXE22IhfgEKu1D2giU8nny48wSfMlR3bghB
	ipK6CVQLyq9C86+KC8wKptuFTqBdPdhRc8X8fJ+i1C1j0iavGckR9qWAwXDnLqOB+cvp
	gh3A==
Received: by 10.152.47.148 with SMTP id d20mr8732886lan.42.1352113101356;
	Mon, 05 Nov 2012 02:58:21 -0800 (PST)
Received: from linaro.org (fw-lnat.cambridge.arm.com. [217.140.96.63])
	by mx.google.com with ESMTPS id sx3sm5495094lab.9.2012.11.05.02.58.19
	(version=SSLv3 cipher=OTHER); Mon, 05 Nov 2012 02:58:20 -0800 (PST)
Date: Mon, 5 Nov 2012 10:58:17 +0000
From: Dave Martin <dave.martin@linaro.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121105105817.GC2005@linaro.org>
References: <alpine.DEB.2.02.1208161618550.4850@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1210241624400.2689@kaball.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1210241624400.2689@kaball.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Gm-Message-State: ALoCoQmIBhv9TCzlSUOVZOlsBkn89ICiSWZpsCVirF5QsH0PXdPJsxVzaYcL+nCvShw5urei668M
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linaro-dev@lists.linaro.org" <linaro-dev@lists.linaro.org>,
	Ian Campbell <Ian.Campbell@citrix.com>, "arnd@arndb.de" <arnd@arndb.de>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Xen-devel] [PATCH RESEND] xen/arm: use the __HVC macro
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Oct 24, 2012 at 04:26:08PM +0100, Stefano Stabellini wrote:
> Use the new __HVC macro in hypercall.S.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

This is correct usage of the __HVC() macro, so

Acked-by: Dave Martin <dave.martin@linaro.org>

> ---
>  arch/arm/xen/hypercall.S |   14 +++++---------
>  1 files changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm/xen/hypercall.S b/arch/arm/xen/hypercall.S
> index 074f5ed..71f7239 100644
> --- a/arch/arm/xen/hypercall.S
> +++ b/arch/arm/xen/hypercall.S
> @@ -48,20 +48,16 @@
>  
>  #include <linux/linkage.h>
>  #include <asm/assembler.h>
> +#include <asm/opcodes-virt.h>
>  #include <xen/interface/xen.h>
>  
>  
> -/* HVC 0xEA1 */
> -#ifdef CONFIG_THUMB2_KERNEL
> -#define xen_hvc .word 0xf7e08ea1
> -#else
> -#define xen_hvc .word 0xe140ea71
> -#endif
> +#define XEN_IMM 0xEA1
>  
>  #define HYPERCALL_SIMPLE(hypercall)		\
>  ENTRY(HYPERVISOR_##hypercall)			\
>  	mov r12, #__HYPERVISOR_##hypercall;	\
> -	xen_hvc;							\
> +	__HVC(XEN_IMM);						\
>  	mov pc, lr;							\
>  ENDPROC(HYPERVISOR_##hypercall)
>  
> @@ -76,7 +72,7 @@ ENTRY(HYPERVISOR_##hypercall)			\
>  	stmdb sp!, {r4}						\
>  	ldr r4, [sp, #4]					\
>  	mov r12, #__HYPERVISOR_##hypercall;	\
> -	xen_hvc								\
> +	__HVC(XEN_IMM);						\
>  	ldm sp!, {r4}						\
>  	mov pc, lr							\
>  ENDPROC(HYPERVISOR_##hypercall)
> @@ -100,7 +96,7 @@ ENTRY(privcmd_call)
>  	mov r2, r3
>  	ldr r3, [sp, #8]
>  	ldr r4, [sp, #4]
> -	xen_hvc
> +	__HVC(XEN_IMM)
>  	ldm sp!, {r4}
>  	mov pc, lr
>  ENDPROC(privcmd_call);
> -- 
> 1.7.2.5

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 10:58:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 10:58:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVKNs-0001if-ON; Mon, 05 Nov 2012 10:58:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dave.martin@linaro.org>) id 1TVKNr-0001ia-HO
	for xen-devel@lists.xensource.com; Mon, 05 Nov 2012 10:58:23 +0000
Received: from [85.158.138.51:2207] by server-9.bemta-3.messagelabs.com id
	96/FF-02388-ECB97905; Mon, 05 Nov 2012 10:58:22 +0000
X-Env-Sender: dave.martin@linaro.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1352113101!28639400!1
X-Originating-IP: [209.85.217.171]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4846 invoked from network); 5 Nov 2012 10:58:22 -0000
Received: from mail-lb0-f171.google.com (HELO mail-lb0-f171.google.com)
	(209.85.217.171)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 10:58:22 -0000
Received: by mail-lb0-f171.google.com with SMTP id m4so4817788lbo.30
	for <xen-devel@lists.xensource.com>;
	Mon, 05 Nov 2012 02:58:21 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent
	:x-gm-message-state;
	bh=khRgQCVTgsE4uGPSW7rGmW1yEbunI0n3ndxeKzmcmFQ=;
	b=CnQiEAJG0iUrD3tdzc0kotjK3TEMa+bGMyCD2rTCKaE4Qt9GmQl5HXtd1T9h0fU25w
	ahUDukDzH15ctxUTEadLF3NfrfjsAAfwADIzqf3zKMyRzvp6eQaumLjHwmqdmJ2YCTGz
	dyHGGOxnrKIJwboyGabs+xiY8nD6KVdRQ3wQmYBf2SiOCRwV2rnBjzPGW0dJEHjUAh8Z
	i3t8YkmxlqUB19eN5DbOghi1KLaCrEYPTAXE22IhfgEKu1D2giU8nny48wSfMlR3bghB
	ipK6CVQLyq9C86+KC8wKptuFTqBdPdhRc8X8fJ+i1C1j0iavGckR9qWAwXDnLqOB+cvp
	gh3A==
Received: by 10.152.47.148 with SMTP id d20mr8732886lan.42.1352113101356;
	Mon, 05 Nov 2012 02:58:21 -0800 (PST)
Received: from linaro.org (fw-lnat.cambridge.arm.com. [217.140.96.63])
	by mx.google.com with ESMTPS id sx3sm5495094lab.9.2012.11.05.02.58.19
	(version=SSLv3 cipher=OTHER); Mon, 05 Nov 2012 02:58:20 -0800 (PST)
Date: Mon, 5 Nov 2012 10:58:17 +0000
From: Dave Martin <dave.martin@linaro.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121105105817.GC2005@linaro.org>
References: <alpine.DEB.2.02.1208161618550.4850@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1210241624400.2689@kaball.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1210241624400.2689@kaball.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Gm-Message-State: ALoCoQmIBhv9TCzlSUOVZOlsBkn89ICiSWZpsCVirF5QsH0PXdPJsxVzaYcL+nCvShw5urei668M
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linaro-dev@lists.linaro.org" <linaro-dev@lists.linaro.org>,
	Ian Campbell <Ian.Campbell@citrix.com>, "arnd@arndb.de" <arnd@arndb.de>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Xen-devel] [PATCH RESEND] xen/arm: use the __HVC macro
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Oct 24, 2012 at 04:26:08PM +0100, Stefano Stabellini wrote:
> Use the new __HVC macro in hypercall.S.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

This is correct usage of the __HVC() macro, so

Acked-by: Dave Martin <dave.martin@linaro.org>

> ---
>  arch/arm/xen/hypercall.S |   14 +++++---------
>  1 files changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm/xen/hypercall.S b/arch/arm/xen/hypercall.S
> index 074f5ed..71f7239 100644
> --- a/arch/arm/xen/hypercall.S
> +++ b/arch/arm/xen/hypercall.S
> @@ -48,20 +48,16 @@
>  
>  #include <linux/linkage.h>
>  #include <asm/assembler.h>
> +#include <asm/opcodes-virt.h>
>  #include <xen/interface/xen.h>
>  
>  
> -/* HVC 0xEA1 */
> -#ifdef CONFIG_THUMB2_KERNEL
> -#define xen_hvc .word 0xf7e08ea1
> -#else
> -#define xen_hvc .word 0xe140ea71
> -#endif
> +#define XEN_IMM 0xEA1
>  
>  #define HYPERCALL_SIMPLE(hypercall)		\
>  ENTRY(HYPERVISOR_##hypercall)			\
>  	mov r12, #__HYPERVISOR_##hypercall;	\
> -	xen_hvc;							\
> +	__HVC(XEN_IMM);						\
>  	mov pc, lr;							\
>  ENDPROC(HYPERVISOR_##hypercall)
>  
> @@ -76,7 +72,7 @@ ENTRY(HYPERVISOR_##hypercall)			\
>  	stmdb sp!, {r4}						\
>  	ldr r4, [sp, #4]					\
>  	mov r12, #__HYPERVISOR_##hypercall;	\
> -	xen_hvc								\
> +	__HVC(XEN_IMM);						\
>  	ldm sp!, {r4}						\
>  	mov pc, lr							\
>  ENDPROC(HYPERVISOR_##hypercall)
> @@ -100,7 +96,7 @@ ENTRY(privcmd_call)
>  	mov r2, r3
>  	ldr r3, [sp, #8]
>  	ldr r4, [sp, #4]
> -	xen_hvc
> +	__HVC(XEN_IMM)
>  	ldm sp!, {r4}
>  	mov pc, lr
>  ENDPROC(privcmd_call);
> -- 
> 1.7.2.5

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 11:00:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 11:00:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVKPW-0001p7-87; Mon, 05 Nov 2012 11:00:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVKPU-0001p0-E4
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 11:00:04 +0000
Received: from [85.158.143.35:53660] by server-2.bemta-4.messagelabs.com id
	4E/30-28922-33C97905; Mon, 05 Nov 2012 11:00:03 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1352113199!6029370!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12926 invoked from network); 5 Nov 2012 10:59:59 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-21.messagelabs.com with SMTP;
	5 Nov 2012 10:59:59 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 05 Nov 2012 10:59:58 +0000
Message-Id: <5097AA3A02000078000A6528@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Mon, 05 Nov 2012 10:59:54 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Jackson" <Ian.Jackson@eu.citrix.com>,
	"Stefano Stabellini" <stefano.stabellini@eu.citrix.com>
References: <508E489502000078000A4FC6@nat28.tlf.novell.com>
	<20121030132951.GA4192@aepfle.de>
	<508FE6DD02000078000A56CF@nat28.tlf.novell.com>
	<20623.57765.463131.112836@mariner.uk.xensource.com>
In-Reply-To: <20623.57765.463131.112836@mariner.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Olaf Hering <olaf@aepfle.de>, Ian Campbell <Ian.Campbell@citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] preparing for 4.2.1 and 4.1.4
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.10.12 at 15:18, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> I did a huge pile of backports late last week which seem to have
> broken some things.  The bisector is working on it and I'm hoping it
> will report fairly shortly ...

So what about the 4.1 tree? Should we cut RC1 there without any
tools backports?

Also, for both releases - what about their qemu tree(s)? There was
a regression reported for 4.1.3 compared to 4.1.2, fixing of which
supposedly involved a revert that apparently had been done in
4.2 already.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 11:00:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 11:00:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVKPW-0001p7-87; Mon, 05 Nov 2012 11:00:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVKPU-0001p0-E4
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 11:00:04 +0000
Received: from [85.158.143.35:53660] by server-2.bemta-4.messagelabs.com id
	4E/30-28922-33C97905; Mon, 05 Nov 2012 11:00:03 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1352113199!6029370!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12926 invoked from network); 5 Nov 2012 10:59:59 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-21.messagelabs.com with SMTP;
	5 Nov 2012 10:59:59 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 05 Nov 2012 10:59:58 +0000
Message-Id: <5097AA3A02000078000A6528@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Mon, 05 Nov 2012 10:59:54 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Jackson" <Ian.Jackson@eu.citrix.com>,
	"Stefano Stabellini" <stefano.stabellini@eu.citrix.com>
References: <508E489502000078000A4FC6@nat28.tlf.novell.com>
	<20121030132951.GA4192@aepfle.de>
	<508FE6DD02000078000A56CF@nat28.tlf.novell.com>
	<20623.57765.463131.112836@mariner.uk.xensource.com>
In-Reply-To: <20623.57765.463131.112836@mariner.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Olaf Hering <olaf@aepfle.de>, Ian Campbell <Ian.Campbell@citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] preparing for 4.2.1 and 4.1.4
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.10.12 at 15:18, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> I did a huge pile of backports late last week which seem to have
> broken some things.  The bisector is working on it and I'm hoping it
> will report fairly shortly ...

So what about the 4.1 tree? Should we cut RC1 there without any
tools backports?

Also, for both releases - what about their qemu tree(s)? There was
a regression reported for 4.1.3 compared to 4.1.2, fixing of which
supposedly involved a revert that apparently had been done in
4.2 already.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 11:56:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 11:56:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVLHD-0002Bz-JB; Mon, 05 Nov 2012 11:55:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TVLHC-0002Bu-2f
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 11:55:34 +0000
Received: from [85.158.138.51:15074] by server-15.bemta-3.messagelabs.com id
	7E/30-09445-439A7905; Mon, 05 Nov 2012 11:55:32 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-2.tower-174.messagelabs.com!1352116531!28747001!1
X-Originating-IP: [81.169.146.161]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA0NzI3Mjg=\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA0NzI3Mjg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26337 invoked from network); 5 Nov 2012 11:55:32 -0000
Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.161)
	by server-2.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 5 Nov 2012 11:55:32 -0000
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmwtM48/lq2s7sGlE=
X-RZG-CLASS-ID: mo00
Received: from probook.site
	(dslb-084-057-073-078.pools.arcor-ip.net [84.57.73.78])
	by smtp.strato.de (joses mo32) (RZmta 30.22 DYNA|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id V05106oA5BcSwH ;
	Mon, 5 Nov 2012 12:55:26 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 7609B18643; Mon,  5 Nov 2012 12:55:26 +0100 (CET)
Date: Mon, 5 Nov 2012 12:55:26 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121105115526.GA18634@aepfle.de>
References: <508E489502000078000A4FC6@nat28.tlf.novell.com>
	<20121030132951.GA4192@aepfle.de>
	<508FE6DD02000078000A56CF@nat28.tlf.novell.com>
	<20623.57765.463131.112836@mariner.uk.xensource.com>
	<5097AA3A02000078000A6528@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5097AA3A02000078000A6528@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: xen-devel <xen-devel@lists.xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] preparing for 4.2.1 and 4.1.4
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 05, Jan Beulich wrote:

> >>> On 30.10.12 at 15:18, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> > I did a huge pile of backports late last week which seem to have
> > broken some things.  The bisector is working on it and I'm hoping it
> > will report fairly shortly ...
> 
> So what about the 4.1 tree? Should we cut RC1 there without any
> tools backports?

At least the locking change should be backported to 4.1 as a bugfix:

changeset:   26079:b3b03536789a
hotplug/Linux: close lockfd after lock attempt


Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 11:56:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 11:56:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVLHD-0002Bz-JB; Mon, 05 Nov 2012 11:55:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TVLHC-0002Bu-2f
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 11:55:34 +0000
Received: from [85.158.138.51:15074] by server-15.bemta-3.messagelabs.com id
	7E/30-09445-439A7905; Mon, 05 Nov 2012 11:55:32 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-2.tower-174.messagelabs.com!1352116531!28747001!1
X-Originating-IP: [81.169.146.161]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA0NzI3Mjg=\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA0NzI3Mjg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26337 invoked from network); 5 Nov 2012 11:55:32 -0000
Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.161)
	by server-2.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 5 Nov 2012 11:55:32 -0000
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmwtM48/lq2s7sGlE=
X-RZG-CLASS-ID: mo00
Received: from probook.site
	(dslb-084-057-073-078.pools.arcor-ip.net [84.57.73.78])
	by smtp.strato.de (joses mo32) (RZmta 30.22 DYNA|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id V05106oA5BcSwH ;
	Mon, 5 Nov 2012 12:55:26 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 7609B18643; Mon,  5 Nov 2012 12:55:26 +0100 (CET)
Date: Mon, 5 Nov 2012 12:55:26 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121105115526.GA18634@aepfle.de>
References: <508E489502000078000A4FC6@nat28.tlf.novell.com>
	<20121030132951.GA4192@aepfle.de>
	<508FE6DD02000078000A56CF@nat28.tlf.novell.com>
	<20623.57765.463131.112836@mariner.uk.xensource.com>
	<5097AA3A02000078000A6528@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5097AA3A02000078000A6528@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: xen-devel <xen-devel@lists.xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] preparing for 4.2.1 and 4.1.4
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 05, Jan Beulich wrote:

> >>> On 30.10.12 at 15:18, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> > I did a huge pile of backports late last week which seem to have
> > broken some things.  The bisector is working on it and I'm hoping it
> > will report fairly shortly ...
> 
> So what about the 4.1 tree? Should we cut RC1 there without any
> tools backports?

At least the locking change should be backported to 4.1 as a bugfix:

changeset:   26079:b3b03536789a
hotplug/Linux: close lockfd after lock attempt


Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 12:27:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 12:27:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVLli-0002ZW-D1; Mon, 05 Nov 2012 12:27:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TVLlh-0002ZI-7J
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 12:27:05 +0000
Received: from [85.158.138.51:46819] by server-3.bemta-3.messagelabs.com id
	F6/CC-31566-890B7905; Mon, 05 Nov 2012 12:27:04 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-14.tower-174.messagelabs.com!1352118422!22395600!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDA5MTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6741 invoked from network); 5 Nov 2012 12:27:02 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-14.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 5 Nov 2012 12:27:02 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 4AF241851;
	Mon,  5 Nov 2012 14:27:01 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 26FB72005D; Mon,  5 Nov 2012 14:27:00 +0200 (EET)
Date: Mon, 5 Nov 2012 14:26:59 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: "greg@enjellic.com" <greg@enjellic.com>
Message-ID: <20121105122659.GE8912@reaktio.net>
References: <201208281225.q7SCP1WO017490@wind.enjellic.com>
	<1346226868.4847.21.camel@dagon.hellion.org.uk>
	<20120925113510.GM8912@reaktio.net>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20120925113510.GM8912@reaktio.net>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] XEN 4.1.3 blktap2 patches.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Sep 25, 2012 at 02:35:10PM +0300, Pasi K=E4rkk=E4inen wrote:
> On Wed, Aug 29, 2012 at 08:54:28AM +0100, Ian Campbell wrote:
> > On Tue, 2012-08-28 at 13:25 +0100, Dr. Greg Wettstein wrote:
> > > Good morning, hope the day is going well for everyone.
> > > =

> > > The patches to fix the blktap2 issues which result in orphaned
> > > tapdisk2 processes and the transitory deadlock on guest shutdown
> > > didn't make it into the 4.1.3 release.  Updated patches to address
> > > these problems are available at the following location:
> > > =

> > > 	ftp://ftp.enjellic.com/pub/xen/xen-4.1.3.blktap1.patch
> > > 	ftp://ftp.enjellic.com/pub/xen/xen-4.1.3.blktap2.patch
> > > =

> > > The patches are designed to be applied in order and have been verified
> > > to work against the 4.1.3 release.
> > =

> > Please can you post these patches as emails with a changelog and a
> > signed-off-by. You should also CC Ian Jackson since he is the one who
> > does the tools backports.
> >
> =

> Hello again,
> =

> Dr. Greg: Can you please re-post the patches as emails with Signed-off-by=
 lines included,
> as suggested below in Ian's reply.. ? =

> =

> http://wiki.xen.org/wiki/Submitting_Xen_Patches
> =


Dr. Greg: RC1 for Xen 4.1.4 is being prepared atm, so hopefully you can re-=
submit =

these blktap2 bugfix patches for inclusion! =


Thanks,

-- Pasi


>  =

> > The changelog should be clear about the backport status. IIRC one of
> > these is a backport from unstable (so the changelog should say of which
> > commit and preserve the original S-o-b) and the other is a
> > reimplementation since too much has changed in unstable so there is no
> > plausible backport (and the changelog should mention this).
> > =

> > Ideally these mails would be threaded with subjects "[PATCH 1/2] ..."
> > and "[PATCH 2/2] ..." so that it is obvious that there is a sequence to
> > them. A tool such as hg email will do this for you.
> > http://wiki.xen.org/wiki/Submitting_Xen_Patches has some hints on how to
> > use it.
> > =

> > If nothing has changed since the previous posting it may be sufficient
> > to reply to that previous postings with a "ping" message and CC Ian
> > there.
> > =

> > Ian.
> > =

> =

> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 12:27:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 12:27:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVLli-0002ZW-D1; Mon, 05 Nov 2012 12:27:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TVLlh-0002ZI-7J
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 12:27:05 +0000
Received: from [85.158.138.51:46819] by server-3.bemta-3.messagelabs.com id
	F6/CC-31566-890B7905; Mon, 05 Nov 2012 12:27:04 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-14.tower-174.messagelabs.com!1352118422!22395600!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDA5MTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6741 invoked from network); 5 Nov 2012 12:27:02 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-14.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 5 Nov 2012 12:27:02 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 4AF241851;
	Mon,  5 Nov 2012 14:27:01 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 26FB72005D; Mon,  5 Nov 2012 14:27:00 +0200 (EET)
Date: Mon, 5 Nov 2012 14:26:59 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: "greg@enjellic.com" <greg@enjellic.com>
Message-ID: <20121105122659.GE8912@reaktio.net>
References: <201208281225.q7SCP1WO017490@wind.enjellic.com>
	<1346226868.4847.21.camel@dagon.hellion.org.uk>
	<20120925113510.GM8912@reaktio.net>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20120925113510.GM8912@reaktio.net>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] XEN 4.1.3 blktap2 patches.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Sep 25, 2012 at 02:35:10PM +0300, Pasi K=E4rkk=E4inen wrote:
> On Wed, Aug 29, 2012 at 08:54:28AM +0100, Ian Campbell wrote:
> > On Tue, 2012-08-28 at 13:25 +0100, Dr. Greg Wettstein wrote:
> > > Good morning, hope the day is going well for everyone.
> > > =

> > > The patches to fix the blktap2 issues which result in orphaned
> > > tapdisk2 processes and the transitory deadlock on guest shutdown
> > > didn't make it into the 4.1.3 release.  Updated patches to address
> > > these problems are available at the following location:
> > > =

> > > 	ftp://ftp.enjellic.com/pub/xen/xen-4.1.3.blktap1.patch
> > > 	ftp://ftp.enjellic.com/pub/xen/xen-4.1.3.blktap2.patch
> > > =

> > > The patches are designed to be applied in order and have been verified
> > > to work against the 4.1.3 release.
> > =

> > Please can you post these patches as emails with a changelog and a
> > signed-off-by. You should also CC Ian Jackson since he is the one who
> > does the tools backports.
> >
> =

> Hello again,
> =

> Dr. Greg: Can you please re-post the patches as emails with Signed-off-by=
 lines included,
> as suggested below in Ian's reply.. ? =

> =

> http://wiki.xen.org/wiki/Submitting_Xen_Patches
> =


Dr. Greg: RC1 for Xen 4.1.4 is being prepared atm, so hopefully you can re-=
submit =

these blktap2 bugfix patches for inclusion! =


Thanks,

-- Pasi


>  =

> > The changelog should be clear about the backport status. IIRC one of
> > these is a backport from unstable (so the changelog should say of which
> > commit and preserve the original S-o-b) and the other is a
> > reimplementation since too much has changed in unstable so there is no
> > plausible backport (and the changelog should mention this).
> > =

> > Ideally these mails would be threaded with subjects "[PATCH 1/2] ..."
> > and "[PATCH 2/2] ..." so that it is obvious that there is a sequence to
> > them. A tool such as hg email will do this for you.
> > http://wiki.xen.org/wiki/Submitting_Xen_Patches has some hints on how to
> > use it.
> > =

> > If nothing has changed since the previous posting it may be sufficient
> > to reply to that previous postings with a "ping" message and CC Ian
> > there.
> > =

> > Ian.
> > =

> =

> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 12:35:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 12:35:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVLt1-0002wh-AG; Mon, 05 Nov 2012 12:34:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TVLt0-0002wc-04
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 12:34:38 +0000
Received: from [85.158.139.83:10556] by server-1.bemta-5.messagelabs.com id
	84/14-05877-D52B7905; Mon, 05 Nov 2012 12:34:37 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-14.tower-182.messagelabs.com!1352118875!24527943!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDA5MTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26402 invoked from network); 5 Nov 2012 12:34:35 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-14.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 5 Nov 2012 12:34:35 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id C8D212BC1;
	Mon,  5 Nov 2012 14:34:34 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id A02122005D; Mon,  5 Nov 2012 14:34:34 +0200 (EET)
Date: Mon, 5 Nov 2012 14:34:34 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Keir Fraser <keir@xen.org>
Message-ID: <20121105123434.GF8912@reaktio.net>
References: <20488.9122.701811.248760@mariner.uk.xensource.com>
	<CC2DE50F.462A7%keir@xen.org>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CC2DE50F.462A7%keir@xen.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Juergen Gross <juergen.gross@ts.fujitsu.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Backport requests of cs 23420..23423 for 4.0 and 4.1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Jul 19, 2012 at 04:23:43PM +0100, Keir Fraser wrote:
> On 19/07/2012 16:11, "Ian Jackson" <Ian.Jackson@eu.citrix.com> wrote:
> 
> > Keir Fraser writes ("Re: [Xen-devel] Backport requests of cs 23420..23423 for
> > 4.0 and 4.1"):
> >> On 13/07/2012 07:08, "Juergen Gross" <juergen.gross@ts.fujitsu.com> wrote:
> >>> I would like to request to include these changesets in 4.0 and
> >>> 4.1. The backport is quite trivial, I can send patches if you are
> >>> willing to take them.
> >> 
> >> Will need an Ack from George and then patches applied by (or at least an Ack
> >> from) a tools maintainer.
> > 
> > Thanks for replying Keir, but I'm rather queasy about this.
> > 
> > These patches have not been in any released version of Xen and are
> > fairly substantial.  I would say that we should not backport anything
> > that isn't a critical bugfix which hasn't been sitting in a released
> > version of Xen for a while; and a new feature ought to be considered
> > very carefully.
> 
> They have been in use in Citrix XenServer for a while. However, this is
> still late in stable point-release cycle to drop these in. It might make
> sense to have them in 4.2.0 for a while, and then reconsider for backport
> for 4.1.4 (I think you are probably right to nack for the 4.0 branch).
> 

Hello,

Should these patches now go in to 4.1.4-rc1 ? 


-- Pasi


>  -- Keir
> 
> > Now maybe the unfortunately extended 4.2 release cycle may mean we
> > should relax this rule but I'd prefer to see a clear justification for
> > why this is important to retrofit to 4.1.
> > 
> > And the Xen 4.0 tree is in the deep freeze and I don't think we should
> > be backporting anything other than critical bugfixes for it.
> > 
> > Ian.
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 12:35:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 12:35:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVLt1-0002wh-AG; Mon, 05 Nov 2012 12:34:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TVLt0-0002wc-04
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 12:34:38 +0000
Received: from [85.158.139.83:10556] by server-1.bemta-5.messagelabs.com id
	84/14-05877-D52B7905; Mon, 05 Nov 2012 12:34:37 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-14.tower-182.messagelabs.com!1352118875!24527943!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDA5MTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26402 invoked from network); 5 Nov 2012 12:34:35 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-14.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 5 Nov 2012 12:34:35 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id C8D212BC1;
	Mon,  5 Nov 2012 14:34:34 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id A02122005D; Mon,  5 Nov 2012 14:34:34 +0200 (EET)
Date: Mon, 5 Nov 2012 14:34:34 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Keir Fraser <keir@xen.org>
Message-ID: <20121105123434.GF8912@reaktio.net>
References: <20488.9122.701811.248760@mariner.uk.xensource.com>
	<CC2DE50F.462A7%keir@xen.org>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CC2DE50F.462A7%keir@xen.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Juergen Gross <juergen.gross@ts.fujitsu.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Backport requests of cs 23420..23423 for 4.0 and 4.1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Jul 19, 2012 at 04:23:43PM +0100, Keir Fraser wrote:
> On 19/07/2012 16:11, "Ian Jackson" <Ian.Jackson@eu.citrix.com> wrote:
> 
> > Keir Fraser writes ("Re: [Xen-devel] Backport requests of cs 23420..23423 for
> > 4.0 and 4.1"):
> >> On 13/07/2012 07:08, "Juergen Gross" <juergen.gross@ts.fujitsu.com> wrote:
> >>> I would like to request to include these changesets in 4.0 and
> >>> 4.1. The backport is quite trivial, I can send patches if you are
> >>> willing to take them.
> >> 
> >> Will need an Ack from George and then patches applied by (or at least an Ack
> >> from) a tools maintainer.
> > 
> > Thanks for replying Keir, but I'm rather queasy about this.
> > 
> > These patches have not been in any released version of Xen and are
> > fairly substantial.  I would say that we should not backport anything
> > that isn't a critical bugfix which hasn't been sitting in a released
> > version of Xen for a while; and a new feature ought to be considered
> > very carefully.
> 
> They have been in use in Citrix XenServer for a while. However, this is
> still late in stable point-release cycle to drop these in. It might make
> sense to have them in 4.2.0 for a while, and then reconsider for backport
> for 4.1.4 (I think you are probably right to nack for the 4.0 branch).
> 

Hello,

Should these patches now go in to 4.1.4-rc1 ? 


-- Pasi


>  -- Keir
> 
> > Now maybe the unfortunately extended 4.2 release cycle may mean we
> > should relax this rule but I'd prefer to see a clear justification for
> > why this is important to retrofit to 4.1.
> > 
> > And the Xen 4.0 tree is in the deep freeze and I don't think we should
> > be backporting anything other than critical bugfixes for it.
> > 
> > Ian.
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 14:31:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 14:31:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVNhC-00041z-9R; Mon, 05 Nov 2012 14:30:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVNhB-00041u-Qw
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 14:30:33 +0000
Received: from [85.158.143.99:57017] by server-2.bemta-4.messagelabs.com id
	AB/49-28922-98DC7905; Mon, 05 Nov 2012 14:30:33 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1352125829!23445606!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26802 invoked from network); 5 Nov 2012 14:30:29 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-216.messagelabs.com with SMTP;
	5 Nov 2012 14:30:29 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 05 Nov 2012 14:30:28 +0000
Message-Id: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Mon, 05 Nov 2012 14:30:25 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <wei.huang2@amd.com>,<weiwang.dd@gmail.com>,
 <xiantao.zhang@intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

All,

so far it was my understanding that this option is intended to get
the DMA behavior that Dom0 observes as close as possible to how
it would be without IOMMU.

However, we're now dealing with a customer report where a
single function device is observed to initiate DMA operations
appearing to originate from function 1, which makes obvious that
the option above is not making things as transparent as I would
have expected them to be: Without IOMMU, such requests get
processed fine, while with IOMMU (due to there not being a
context entry for the bogus device) the device fails to initialize
(causing DMA faults, the presence of which I had to convince
myself of separately, as for whatever reason at least the VT-d
code doesn't issue any log message in that case).

So I'm now seeking for alternative workaround suggestions that
we could pass to that customer (less intrusive than "iommu=off").

Thanks, Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 14:31:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 14:31:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVNhC-00041z-9R; Mon, 05 Nov 2012 14:30:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVNhB-00041u-Qw
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 14:30:33 +0000
Received: from [85.158.143.99:57017] by server-2.bemta-4.messagelabs.com id
	AB/49-28922-98DC7905; Mon, 05 Nov 2012 14:30:33 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1352125829!23445606!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26802 invoked from network); 5 Nov 2012 14:30:29 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-216.messagelabs.com with SMTP;
	5 Nov 2012 14:30:29 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 05 Nov 2012 14:30:28 +0000
Message-Id: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Mon, 05 Nov 2012 14:30:25 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <wei.huang2@amd.com>,<weiwang.dd@gmail.com>,
 <xiantao.zhang@intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

All,

so far it was my understanding that this option is intended to get
the DMA behavior that Dom0 observes as close as possible to how
it would be without IOMMU.

However, we're now dealing with a customer report where a
single function device is observed to initiate DMA operations
appearing to originate from function 1, which makes obvious that
the option above is not making things as transparent as I would
have expected them to be: Without IOMMU, such requests get
processed fine, while with IOMMU (due to there not being a
context entry for the bogus device) the device fails to initialize
(causing DMA faults, the presence of which I had to convince
myself of separately, as for whatever reason at least the VT-d
code doesn't issue any log message in that case).

So I'm now seeking for alternative workaround suggestions that
we could pass to that customer (less intrusive than "iommu=off").

Thanks, Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 14:55:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 14:55:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVO4z-0004GB-Ed; Mon, 05 Nov 2012 14:55:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TVO4y-0004G6-9D
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 14:55:08 +0000
Received: from [85.158.143.35:15951] by server-1.bemta-4.messagelabs.com id
	88/9E-27934-B43D7905; Mon, 05 Nov 2012 14:55:07 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1352127294!15836378!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjEyMDE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22641 invoked from network); 5 Nov 2012 14:54:55 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-13.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 5 Nov 2012 14:54:55 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA5EsgHm031183
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 5 Nov 2012 14:54:43 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA5Ese2s017163
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 5 Nov 2012 14:54:41 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA5Esds7024148; Mon, 5 Nov 2012 08:54:39 -0600
MIME-Version: 1.0
Message-ID: <5517445d-ed2e-4592-9a2b-98fc612f1ae8@default>
Date: Mon, 5 Nov 2012 06:54:31 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Campbell <ian.campbell@citrix.com>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<20121104203532.GA11377@ocelot.phlegethon.org>
	<26f55aab-7523-4681-9a61-a5e5740d43a9@default>
	<1352111399.25014.101.camel@hastur.hellion.org.uk>
In-Reply-To: <1352111399.25014.101.camel@hastur.hellion.org.uk>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Olaf Hering <olaf@aepfle.de>, "Keir \(Xen.org\)" <keir@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>, xen-devel@lists.xen.org,
	George Shuklin <george.shuklin@gmail.com>,
	DarioFaggioli <raistlin@linux.it>, Jan Beulich <JBeulich@suse.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Ian Campbell [mailto:ian.campbell@citrix.com]
> Sent: Monday, November 05, 2012 3:30 AM
> To: Dan Magenheimer
> Cc: Tim (Xen.org); Keir (Xen.org); Jan Beulich; Olaf Hering; George Dunlap; Ian Jackson; George
> Shuklin; DarioFaggioli; xen-devel@lists.xen.org; Konrad Wilk; Kurt Hackel; Mukesh Rathor; Zhigang Wang
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> 
> On Mon, 2012-11-05 at 00:23 +0000, Dan Magenheimer wrote:
> > There is no "free up enough memory on that host". Tmem doesn't start
> > ballooning out enough memory to start the VM... the guests are
> > responsible for doing the ballooning and it is _already done_.  The
> > machine either has sufficient free+freeable memory or it does not;
> 
> How does one go about deciding which host in a multi thousand host
> deployment to try the claim hypercall on?

I don't get paid enough to solve that problem :-)

VM placement (both for new domains and migration due to
load-balancing and power-management) is dependent on a
number of factors currently involving CPU utilization,
SAN utilization, and LAN utilization, I think using
historical trends on streams of sampled statistics.  This
is very non-deterministic as all of these factors may
vary dramatically within a sampling interval.

Adding free+freeable memory to this just adds one more
such statistic.  Actually two, as it is probably best to
track free separately from freeable since a candidate
host that has enough free memory should have preference
over one with freeable memory.

Sorry if that's not very satisfying but anything beyond that
meager description is outside of my area of expertise.

Dan

P.S. I don't think I've ever said _thousands_ of physical
hosts, just hundreds (with thousands of VMs).  Honestly
I don't know the upper support bound for an Oracle VM
"server pool" (which is what we call the collection of
hundreds of physical machines)... it may be thousands.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 14:55:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 14:55:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVO4z-0004GB-Ed; Mon, 05 Nov 2012 14:55:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TVO4y-0004G6-9D
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 14:55:08 +0000
Received: from [85.158.143.35:15951] by server-1.bemta-4.messagelabs.com id
	88/9E-27934-B43D7905; Mon, 05 Nov 2012 14:55:07 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1352127294!15836378!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjEyMDE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22641 invoked from network); 5 Nov 2012 14:54:55 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-13.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 5 Nov 2012 14:54:55 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA5EsgHm031183
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 5 Nov 2012 14:54:43 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA5Ese2s017163
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 5 Nov 2012 14:54:41 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA5Esds7024148; Mon, 5 Nov 2012 08:54:39 -0600
MIME-Version: 1.0
Message-ID: <5517445d-ed2e-4592-9a2b-98fc612f1ae8@default>
Date: Mon, 5 Nov 2012 06:54:31 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Campbell <ian.campbell@citrix.com>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<20121104203532.GA11377@ocelot.phlegethon.org>
	<26f55aab-7523-4681-9a61-a5e5740d43a9@default>
	<1352111399.25014.101.camel@hastur.hellion.org.uk>
In-Reply-To: <1352111399.25014.101.camel@hastur.hellion.org.uk>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Olaf Hering <olaf@aepfle.de>, "Keir \(Xen.org\)" <keir@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>, xen-devel@lists.xen.org,
	George Shuklin <george.shuklin@gmail.com>,
	DarioFaggioli <raistlin@linux.it>, Jan Beulich <JBeulich@suse.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Ian Campbell [mailto:ian.campbell@citrix.com]
> Sent: Monday, November 05, 2012 3:30 AM
> To: Dan Magenheimer
> Cc: Tim (Xen.org); Keir (Xen.org); Jan Beulich; Olaf Hering; George Dunlap; Ian Jackson; George
> Shuklin; DarioFaggioli; xen-devel@lists.xen.org; Konrad Wilk; Kurt Hackel; Mukesh Rathor; Zhigang Wang
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> 
> On Mon, 2012-11-05 at 00:23 +0000, Dan Magenheimer wrote:
> > There is no "free up enough memory on that host". Tmem doesn't start
> > ballooning out enough memory to start the VM... the guests are
> > responsible for doing the ballooning and it is _already done_.  The
> > machine either has sufficient free+freeable memory or it does not;
> 
> How does one go about deciding which host in a multi thousand host
> deployment to try the claim hypercall on?

I don't get paid enough to solve that problem :-)

VM placement (both for new domains and migration due to
load-balancing and power-management) is dependent on a
number of factors currently involving CPU utilization,
SAN utilization, and LAN utilization, I think using
historical trends on streams of sampled statistics.  This
is very non-deterministic as all of these factors may
vary dramatically within a sampling interval.

Adding free+freeable memory to this just adds one more
such statistic.  Actually two, as it is probably best to
track free separately from freeable since a candidate
host that has enough free memory should have preference
over one with freeable memory.

Sorry if that's not very satisfying but anything beyond that
meager description is outside of my area of expertise.

Dan

P.S. I don't think I've ever said _thousands_ of physical
hosts, just hundreds (with thousands of VMs).  Honestly
I don't know the upper support bound for an Oracle VM
"server pool" (which is what we call the collection of
hundreds of physical machines)... it may be thousands.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 15:12:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 15:12:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVOLR-0004UC-32; Mon, 05 Nov 2012 15:12:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TVOLO-0004U7-P3
	for xen-devel@lists.xensource.com; Mon, 05 Nov 2012 15:12:07 +0000
Received: from [85.158.139.83:46322] by server-6.bemta-5.messagelabs.com id
	7D/BC-19321-547D7905; Mon, 05 Nov 2012 15:12:05 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352128320!21609403!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8977 invoked from network); 5 Nov 2012 15:12:02 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-11.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 5 Nov 2012 15:12:02 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148249615;
	Mon, 05 Nov 2012 10:10:29 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: key@linux.vnet.ibm.com, mail@srajiv.net, jeremy@goop.org,
	tpmdd-devel@lists.sourceforge.net, xen-devel@lists.xensource.com,
	konrad.wilk@oracle.com
Date: Mon,  5 Nov 2012 10:09:57 -0500
Message-Id: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	linux-kernel@vger.kernel.org
Subject: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch ports the xen vtpm frontend driver for linux
from the linux-2.6.18-xen.hg tree to linux-stable.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 drivers/char/tpm/Kconfig         |    9 +
 drivers/char/tpm/Makefile        |    2 +
 drivers/char/tpm/tpm.h           |   15 +
 drivers/char/tpm/tpm_vtpm.c      |  543 ++++++++++++++++++++++++++++++
 drivers/char/tpm/tpm_vtpm.h      |   55 +++
 drivers/char/tpm/tpm_xen.c       |  690 ++++++++++++++++++++++++++++++++++++++
 include/xen/interface/io/tpmif.h |   77 +++++
 7 files changed, 1391 insertions(+)
 create mode 100644 drivers/char/tpm/tpm_vtpm.c
 create mode 100644 drivers/char/tpm/tpm_vtpm.h
 create mode 100644 drivers/char/tpm/tpm_xen.c
 create mode 100644 include/xen/interface/io/tpmif.h

diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
index 915875e..08c1010 100644
--- a/drivers/char/tpm/Kconfig
+++ b/drivers/char/tpm/Kconfig
@@ -81,4 +81,13 @@ config TCG_IBMVTPM
 	  will be accessible from within Linux.  To compile this driver
 	  as a module, choose M here; the module will be called tpm_ibmvtpm.
 
+config TCG_XEN
+	tristate "XEN TPM Interface"
+	depends on TCG_TPM && XEN
+	---help---
+	  If you want to make TPM support available to a Xen user domain,
+	  say Yes and it will be accessible from within Linux.
+	  To compile this driver as a module, choose M here; the module
+	  will be called tpm_xenu.
+
 endif # TCG_TPM
diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
index 5b3fc8b..16911c5 100644
--- a/drivers/char/tpm/Makefile
+++ b/drivers/char/tpm/Makefile
@@ -17,3 +17,5 @@ obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
 obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
 obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
 obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
+obj-$(CONFIG_TCG_XEN) += tpm_xenu.o
+tpm_xenu-y = tpm_xen.o tpm_vtpm.o
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 8ef7649..2e5a47a 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -130,6 +130,9 @@ struct tpm_chip {
 
 	struct list_head list;
 	void (*release) (struct device *);
+#if CONFIG_XEN
+	void *priv;
+#endif
 };
 
 #define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor)
@@ -310,6 +313,18 @@ struct tpm_cmd_t {
 
 ssize_t	tpm_getcap(struct device *, __be32, cap_t *, const char *);
 
+#ifdef CONFIG_XEN
+static inline void *chip_get_private(const struct tpm_chip *chip)
+{
+	return chip->priv;
+}
+
+static inline void chip_set_private(struct tpm_chip *chip, void *priv)
+{
+	chip->priv = priv;
+}
+#endif
+
 extern int tpm_get_timeouts(struct tpm_chip *);
 extern void tpm_gen_interrupt(struct tpm_chip *);
 extern int tpm_do_selftest(struct tpm_chip *);
diff --git a/drivers/char/tpm/tpm_vtpm.c b/drivers/char/tpm/tpm_vtpm.c
new file mode 100644
index 0000000..7687252
--- /dev/null
+++ b/drivers/char/tpm/tpm_vtpm.c
@@ -0,0 +1,543 @@
+/*
+ * Copyright (C) 2006 IBM Corporation
+ *
+ * Authors:
+ * Stefan Berger <stefanb@us.ibm.com>
+ *
+ * Generic device driver part for device drivers in a virtualized
+ * environment.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, version 2 of the
+ * License.
+ *
+ */
+
+#include <linux/uaccess.h>
+#include <linux/list.h>
+#include <linux/device.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include "tpm.h"
+#include "tpm_vtpm.h"
+
+/* read status bits */
+enum {
+	STATUS_BUSY = 0x01,
+	STATUS_DATA_AVAIL = 0x02,
+	STATUS_READY = 0x04
+};
+
+struct transmission {
+	struct list_head next;
+
+	unsigned char *request;
+	size_t  request_len;
+	size_t  request_buflen;
+
+	unsigned char *response;
+	size_t  response_len;
+	size_t  response_buflen;
+
+	unsigned int flags;
+};
+
+enum {
+	TRANSMISSION_FLAG_WAS_QUEUED = 0x1
+};
+
+
+enum {
+	DATAEX_FLAG_QUEUED_ONLY = 0x1
+};
+
+
+/* local variables */
+
+/* local function prototypes */
+static int _vtpm_send_queued(struct tpm_chip *chip);
+
+
+/* =============================================================
+ * Some utility functions
+ * =============================================================
+ */
+static void vtpm_state_init(struct vtpm_state *vtpms)
+{
+	vtpms->current_request = NULL;
+	spin_lock_init(&vtpms->req_list_lock);
+	init_waitqueue_head(&vtpms->req_wait_queue);
+	INIT_LIST_HEAD(&vtpms->queued_requests);
+
+	vtpms->current_response = NULL;
+	spin_lock_init(&vtpms->resp_list_lock);
+	init_waitqueue_head(&vtpms->resp_wait_queue);
+
+	vtpms->disconnect_time = jiffies;
+}
+
+
+static inline struct transmission *transmission_alloc(void)
+{
+	return kzalloc(sizeof(struct transmission), GFP_ATOMIC);
+}
+
+	static unsigned char *
+transmission_set_req_buffer(struct transmission *t,
+		unsigned char *buffer, size_t len)
+{
+	if (t->request_buflen < len) {
+		kfree(t->request);
+		t->request = kmalloc(len, GFP_KERNEL);
+		if (!t->request) {
+			t->request_buflen = 0;
+			return NULL;
+		}
+		t->request_buflen = len;
+	}
+
+	memcpy(t->request, buffer, len);
+	t->request_len = len;
+
+	return t->request;
+}
+
+	static unsigned char *
+transmission_set_res_buffer(struct transmission *t,
+		const unsigned char *buffer, size_t len)
+{
+	if (t->response_buflen < len) {
+		kfree(t->response);
+		t->response = kmalloc(len, GFP_ATOMIC);
+		if (!t->response) {
+			t->response_buflen = 0;
+			return NULL;
+		}
+		t->response_buflen = len;
+	}
+
+	memcpy(t->response, buffer, len);
+	t->response_len = len;
+
+	return t->response;
+}
+
+static inline void transmission_free(struct transmission *t)
+{
+	kfree(t->request);
+	kfree(t->response);
+	kfree(t);
+}
+
+/* =============================================================
+ * Interface with the lower layer driver
+ * =============================================================
+ */
+/*
+ * Lower layer uses this function to make a response available.
+ */
+int vtpm_vd_recv(const struct tpm_chip *chip,
+		const unsigned char *buffer, size_t count,
+		void *ptr)
+{
+	unsigned long flags;
+	int ret_size = 0;
+	struct transmission *t;
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	/*
+	 * The list with requests must contain one request
+	 * only and the element there must be the one that
+	 * was passed to me from the front-end.
+	 */
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	if (vtpms->current_request != ptr) {
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		return 0;
+	}
+	t = vtpms->current_request;
+	if (t) {
+		transmission_free(t);
+		vtpms->current_request = NULL;
+	}
+
+	t = transmission_alloc();
+	if (t) {
+		if (!transmission_set_res_buffer(t, buffer, count)) {
+			transmission_free(t);
+			spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+			return -ENOMEM;
+		}
+		ret_size = count;
+		vtpms->current_response = t;
+		wake_up_interruptible(&vtpms->resp_wait_queue);
+	}
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+
+	return ret_size;
+}
+
+
+/*
+ * Lower layer indicates its status (connected/disconnected)
+ */
+void vtpm_vd_status(const struct tpm_chip *chip, u8 vd_status)
+{
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	vtpms->vd_status = vd_status;
+	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0)
+		vtpms->disconnect_time = jiffies;
+}
+
+/* =============================================================
+ * Interface with the generic TPM driver
+ * =============================================================
+ */
+static int vtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count)
+{
+	int rc = 0;
+	unsigned long flags;
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	/*
+	 * Check if the previous operation only queued the command
+	 * In this case there won't be a response, so I just
+	 * return from here and reset that flag. In any other
+	 * case I should receive a response from the back-end.
+	 */
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	if ((vtpms->flags & DATAEX_FLAG_QUEUED_ONLY) != 0) {
+		vtpms->flags &= ~DATAEX_FLAG_QUEUED_ONLY;
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		/*
+		 * The first few commands (measurements) must be
+		 * queued since it might not be possible to talk to the
+		 * TPM, yet.
+		 * Return a response of up to 30 '0's.
+		 */
+
+		count = min_t(size_t, count, 30);
+		memset(buf, 0x0, count);
+		return count;
+	}
+	/*
+	 * Check whether something is in the responselist and if
+	 * there's nothing in the list wait for something to appear.
+	 */
+
+	if (!vtpms->current_response) {
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		interruptible_sleep_on_timeout(&vtpms->resp_wait_queue,
+				1000);
+		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	}
+
+	if (vtpms->current_response) {
+		struct transmission *t = vtpms->current_response;
+		vtpms->current_response = NULL;
+		rc = min(count, t->response_len);
+		memcpy(buf, t->response, rc);
+		transmission_free(t);
+	}
+
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+	return rc;
+}
+
+static int vtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)
+{
+	int rc = 0;
+	unsigned long flags;
+	struct transmission *t = transmission_alloc();
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	if (!t)
+		return -ENOMEM;
+	/*
+	 * If there's a current request, it must be the
+	 * previous request that has timed out.
+	 */
+	spin_lock_irqsave(&vtpms->req_list_lock, flags);
+	if (vtpms->current_request != NULL) {
+		dev_warn(chip->dev, "Sending although there is a request outstanding.\n"
+				"         Previous request must have timed out.\n");
+		transmission_free(vtpms->current_request);
+		vtpms->current_request = NULL;
+	}
+	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+
+	/*
+	 * Queue the packet if the driver below is not
+	 * ready, yet, or there is any packet already
+	 * in the queue.
+	 * If the driver below is ready, unqueue all
+	 * packets first before sending our current
+	 * packet.
+	 * For each unqueued packet, except for the
+	 * last (=current) packet, call the function
+	 * tpm_xen_recv to wait for the response to come
+	 * back.
+	 */
+	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0) {
+		if (time_after(jiffies,
+					vtpms->disconnect_time + HZ * 10)) {
+			rc = -ENOENT;
+		} else {
+			goto queue_it;
+		}
+	} else {
+		/*
+		 * Send all queued packets.
+		 */
+		if (_vtpm_send_queued(chip) == 0) {
+
+			vtpms->current_request = t;
+
+			rc = vtpm_vd_send(vtpms->tpm_private,
+					buf,
+					count,
+					t);
+			/*
+			 * The generic TPM driver will call
+			 * the function to receive the response.
+			 */
+			if (rc < 0) {
+				vtpms->current_request = NULL;
+				goto queue_it;
+			}
+		} else {
+queue_it:
+			if (!transmission_set_req_buffer(t, buf, count)) {
+				transmission_free(t);
+				rc = -ENOMEM;
+				goto exit;
+			}
+			/*
+			 * An error occurred. Don't event try
+			 * to send the current request. Just
+			 * queue it.
+			 */
+			spin_lock_irqsave(&vtpms->req_list_lock, flags);
+			vtpms->flags |= DATAEX_FLAG_QUEUED_ONLY;
+			list_add_tail(&t->next, &vtpms->queued_requests);
+			spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+		}
+	}
+
+exit:
+	return rc;
+}
+
+
+/*
+ * Send all queued requests.
+ */
+static int _vtpm_send_queued(struct tpm_chip *chip)
+{
+	int rc;
+	int error = 0;
+	unsigned long flags;
+	unsigned char buffer[1];
+	struct vtpm_state *vtpms;
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	spin_lock_irqsave(&vtpms->req_list_lock, flags);
+
+	while (!list_empty(&vtpms->queued_requests)) {
+		/*
+		 * Need to dequeue them.
+		 * Read the result into a dummy buffer.
+		 */
+		struct transmission *qt = (struct transmission *)
+			vtpms->queued_requests.next;
+		list_del(&qt->next);
+		vtpms->current_request = qt;
+		spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+
+		rc = vtpm_vd_send(vtpms->tpm_private,
+				qt->request,
+				qt->request_len,
+				qt);
+
+		if (rc < 0) {
+			spin_lock_irqsave(&vtpms->req_list_lock, flags);
+			qt = vtpms->current_request;
+			if (qt != NULL) {
+				/*
+				 * requeue it at the beginning
+				 * of the list
+				 */
+				list_add(&qt->next,
+						&vtpms->queued_requests);
+			}
+			vtpms->current_request = NULL;
+			error = 1;
+			break;
+		}
+		/*
+		 * After this point qt is not valid anymore!
+		 * It is freed when the front-end is delivering
+		 * the data by calling tpm_recv
+		 */
+		/*
+		 * Receive response into provided dummy buffer
+		 */
+		rc = vtpm_recv(chip, buffer, sizeof(buffer));
+		spin_lock_irqsave(&vtpms->req_list_lock, flags);
+	}
+
+	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+
+	return error;
+}
+
+static void vtpm_cancel(struct tpm_chip *chip)
+{
+	unsigned long flags;
+	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+
+	if (!vtpms->current_response && vtpms->current_request) {
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		interruptible_sleep_on(&vtpms->resp_wait_queue);
+		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	}
+
+	if (vtpms->current_response) {
+		struct transmission *t = vtpms->current_response;
+		vtpms->current_response = NULL;
+		transmission_free(t);
+	}
+
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+}
+
+static u8 vtpm_status(struct tpm_chip *chip)
+{
+	u8 rc = 0;
+	unsigned long flags;
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	/*
+	 * Data are available if:
+	 *  - there's a current response
+	 *  - the last packet was queued only (this is fake, but necessary to
+	 *      get the generic TPM layer to call the receive function.)
+	 */
+	if (vtpms->current_response ||
+			0 != (vtpms->flags & DATAEX_FLAG_QUEUED_ONLY)) {
+		rc = STATUS_DATA_AVAIL;
+	} else if (!vtpms->current_response && !vtpms->current_request) {
+		rc = STATUS_READY;
+	}
+
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+	return rc;
+}
+
+static const struct file_operations vtpm_ops = {
+	.owner = THIS_MODULE,
+	.llseek = no_llseek,
+	.open = tpm_open,
+	.read = tpm_read,
+	.write = tpm_write,
+	.release = tpm_release,
+};
+
+static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
+static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
+static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);
+static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL);
+static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL);
+static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,
+		NULL);
+static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL);
+static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
+
+static struct attribute *vtpm_attrs[] = {
+	&dev_attr_pubek.attr,
+	&dev_attr_pcrs.attr,
+	&dev_attr_enabled.attr,
+	&dev_attr_active.attr,
+	&dev_attr_owned.attr,
+	&dev_attr_temp_deactivated.attr,
+	&dev_attr_caps.attr,
+	&dev_attr_cancel.attr,
+	NULL,
+};
+
+static struct attribute_group vtpm_attr_grp = { .attrs = vtpm_attrs };
+
+#define TPM_LONG_TIMEOUT   (10 * 60 * HZ)
+
+static struct tpm_vendor_specific tpm_vtpm = {
+	.recv = vtpm_recv,
+	.send = vtpm_send,
+	.cancel = vtpm_cancel,
+	.status = vtpm_status,
+	.req_complete_mask = STATUS_BUSY | STATUS_DATA_AVAIL,
+	.req_complete_val  = STATUS_DATA_AVAIL,
+	.req_canceled = STATUS_READY,
+	.attr_group = &vtpm_attr_grp,
+	.miscdev = {
+		.fops = &vtpm_ops,
+	},
+	.duration = {
+		TPM_LONG_TIMEOUT,
+		TPM_LONG_TIMEOUT,
+		TPM_LONG_TIMEOUT,
+	},
+};
+
+struct tpm_chip *init_vtpm(struct device *dev,
+		struct tpm_private *tp)
+{
+	long rc;
+	struct tpm_chip *chip;
+	struct vtpm_state *vtpms;
+
+	vtpms = kzalloc(sizeof(struct vtpm_state), GFP_KERNEL);
+	if (!vtpms)
+		return ERR_PTR(-ENOMEM);
+
+	vtpm_state_init(vtpms);
+	vtpms->tpm_private = tp;
+
+	chip = tpm_register_hardware(dev, &tpm_vtpm);
+	if (!chip) {
+		rc = -ENODEV;
+		goto err_free_mem;
+	}
+
+	chip_set_private(chip, vtpms);
+
+	return chip;
+
+err_free_mem:
+	kfree(vtpms);
+
+	return ERR_PTR(rc);
+}
+
+void cleanup_vtpm(struct device *dev)
+{
+	struct tpm_chip *chip = dev_get_drvdata(dev);
+	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
+	tpm_remove_hardware(dev);
+	kfree(vtpms);
+}
diff --git a/drivers/char/tpm/tpm_vtpm.h b/drivers/char/tpm/tpm_vtpm.h
new file mode 100644
index 0000000..d888fd8
--- /dev/null
+++ b/drivers/char/tpm/tpm_vtpm.h
@@ -0,0 +1,55 @@
+#ifndef TPM_VTPM_H
+#define TPM_VTPM_H
+
+struct tpm_chip;
+struct tpm_private;
+
+struct vtpm_state {
+	struct transmission *current_request;
+	spinlock_t           req_list_lock;
+	wait_queue_head_t    req_wait_queue;
+
+	struct list_head     queued_requests;
+
+	struct transmission *current_response;
+	spinlock_t           resp_list_lock;
+	wait_queue_head_t    resp_wait_queue;
+
+	u8                   vd_status;
+	u8                   flags;
+
+	unsigned long        disconnect_time;
+
+	/*
+	 * The following is a private structure of the underlying
+	 * driver. It is passed as parameter in the send function.
+	 */
+	struct tpm_private *tpm_private;
+};
+
+
+enum vdev_status {
+	TPM_VD_STATUS_DISCONNECTED = 0x0,
+	TPM_VD_STATUS_CONNECTED = 0x1
+};
+
+/* this function is called from tpm_vtpm.c */
+int vtpm_vd_send(struct tpm_private *tp,
+		const u8 *buf, size_t count, void *ptr);
+
+/* these functions are offered by tpm_vtpm.c */
+struct tpm_chip *init_vtpm(struct device *,
+		struct tpm_private *);
+void cleanup_vtpm(struct device *);
+int vtpm_vd_recv(const struct tpm_chip *chip,
+		const unsigned char *buffer, size_t count, void *ptr);
+void vtpm_vd_status(const struct tpm_chip *, u8 status);
+
+static inline struct tpm_private *tpm_private_from_dev(struct device *dev)
+{
+	struct tpm_chip *chip = dev_get_drvdata(dev);
+	struct vtpm_state *vtpms = chip_get_private(chip);
+	return vtpms->tpm_private;
+}
+
+#endif
diff --git a/drivers/char/tpm/tpm_xen.c b/drivers/char/tpm/tpm_xen.c
new file mode 100644
index 0000000..7198de3
--- /dev/null
+++ b/drivers/char/tpm/tpm_xen.c
@@ -0,0 +1,690 @@
+/*
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * Author: Stefan Berger, stefanb@us.ibm.com
+ * Grant table support: Mahadevan Gomathisankaran
+ *
+ * This code has been derived from drivers/xen/netfront/netfront.c
+ *
+ * Copyright (c) 2002-2004, K A Fraser
+ *
+ * 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.
+ */
+
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
+#include <linux/mutex.h>
+#include <linux/uaccess.h>
+#include <xen/events.h>
+#include <xen/interface/grant_table.h>
+#include <xen/interface/io/tpmif.h>
+#include <xen/grant_table.h>
+#include <xen/xenbus.h>
+#include <xen/page.h>
+#include "tpm.h"
+#include "tpm_vtpm.h"
+
+#undef DEBUG
+
+#define GRANT_INVALID_REF 0
+
+/* local structures */
+struct tpm_private {
+	struct tpm_chip *chip;
+
+	tpmif_tx_interface_t *tx;
+	atomic_t refcnt;
+	unsigned int evtchn;
+	u8 is_connected;
+	u8 is_suspended;
+
+	spinlock_t tx_lock;
+
+	struct tx_buffer *tx_buffers[TPMIF_TX_RING_SIZE];
+
+	atomic_t tx_busy;
+	void *tx_remember;
+
+	domid_t backend_id;
+	wait_queue_head_t wait_q;
+
+	struct xenbus_device *dev;
+	int ring_ref;
+};
+
+struct tx_buffer {
+	unsigned int size;	/* available space in data */
+	unsigned int len;	/* used space in data */
+	unsigned char *data;	/* pointer to a page */
+};
+
+
+/* locally visible variables */
+static grant_ref_t gref_head;
+static struct tpm_private *my_priv;
+
+/* local function prototypes */
+static irqreturn_t tpmif_int(int irq,
+		void *tpm_priv);
+static void tpmif_rx_action(unsigned long unused);
+static int tpmif_connect(struct xenbus_device *dev,
+		struct tpm_private *tp,
+		domid_t domid);
+static DECLARE_TASKLET(tpmif_rx_tasklet, tpmif_rx_action, 0);
+static int tpmif_allocate_tx_buffers(struct tpm_private *tp);
+static void tpmif_free_tx_buffers(struct tpm_private *tp);
+static void tpmif_set_connected_state(struct tpm_private *tp,
+		u8 newstate);
+static int tpm_xmit(struct tpm_private *tp,
+		const u8 *buf, size_t count, int userbuffer,
+		void *remember);
+static void destroy_tpmring(struct tpm_private *tp);
+
+	static inline int
+tx_buffer_copy(struct tx_buffer *txb, const u8 *src, int len,
+		int isuserbuffer)
+{
+	int copied = len;
+
+	if (len > txb->size)
+		copied = txb->size;
+	if (isuserbuffer) {
+		if (copy_from_user(txb->data, src, copied))
+			return -EFAULT;
+	} else {
+		memcpy(txb->data, src, copied);
+	}
+	txb->len = len;
+	return copied;
+}
+
+static inline struct tx_buffer *tx_buffer_alloc(void)
+{
+	struct tx_buffer *txb;
+
+	txb = kzalloc(sizeof(struct tx_buffer), GFP_KERNEL);
+	if (!txb)
+		return NULL;
+
+	txb->len = 0;
+	txb->size = PAGE_SIZE;
+	txb->data = (unsigned char *)__get_free_page(GFP_KERNEL);
+	if (txb->data == NULL) {
+		kfree(txb);
+		txb = NULL;
+	}
+
+	return txb;
+}
+
+
+static inline void tx_buffer_free(struct tx_buffer *txb)
+{
+	if (txb) {
+		free_page((long)txb->data);
+		kfree(txb);
+	}
+}
+
+/**************************************************************
+  Utility function for the tpm_private structure
+ **************************************************************/
+static void tpm_private_init(struct tpm_private *tp)
+{
+	spin_lock_init(&tp->tx_lock);
+	init_waitqueue_head(&tp->wait_q);
+	atomic_set(&tp->refcnt, 1);
+}
+
+static void tpm_private_put(void)
+{
+	if (!atomic_dec_and_test(&my_priv->refcnt))
+		return;
+
+	tpmif_free_tx_buffers(my_priv);
+	kfree(my_priv);
+	my_priv = NULL;
+}
+
+static struct tpm_private *tpm_private_get(void)
+{
+	int err;
+
+	if (my_priv) {
+		atomic_inc(&my_priv->refcnt);
+		return my_priv;
+	}
+
+	my_priv = kzalloc(sizeof(struct tpm_private), GFP_KERNEL);
+	if (!my_priv)
+		return NULL;
+
+	tpm_private_init(my_priv);
+	err = tpmif_allocate_tx_buffers(my_priv);
+	if (err < 0)
+		tpm_private_put();
+
+	return my_priv;
+}
+
+/**************************************************************
+
+  The interface to let the tpm plugin register its callback
+  function and send data to another partition using this module
+
+ **************************************************************/
+
+static DEFINE_MUTEX(suspend_lock);
+/*
+ * Send data via this module by calling this function
+ */
+int vtpm_vd_send(struct tpm_private *tp,
+		const u8 *buf, size_t count, void *ptr)
+{
+	int sent;
+
+	mutex_lock(&suspend_lock);
+	sent = tpm_xmit(tp, buf, count, 0, ptr);
+	mutex_unlock(&suspend_lock);
+
+	return sent;
+}
+
+/**************************************************************
+  XENBUS support code
+ **************************************************************/
+
+static int setup_tpmring(struct xenbus_device *dev,
+		struct tpm_private *tp)
+{
+	tpmif_tx_interface_t *sring;
+	int err;
+
+	tp->ring_ref = GRANT_INVALID_REF;
+
+	sring = (void *)__get_free_page(GFP_KERNEL);
+	if (!sring) {
+		xenbus_dev_fatal(dev, -ENOMEM, "allocating shared ring");
+		return -ENOMEM;
+	}
+	tp->tx = sring;
+
+	err = xenbus_grant_ring(dev, virt_to_mfn(tp->tx));
+	if (err < 0) {
+		free_page((unsigned long)sring);
+		tp->tx = NULL;
+		xenbus_dev_fatal(dev, err, "allocating grant reference");
+		goto fail;
+	}
+	tp->ring_ref = err;
+
+	err = tpmif_connect(dev, tp, dev->otherend_id);
+	if (err)
+		goto fail;
+
+	return 0;
+fail:
+	destroy_tpmring(tp);
+	return err;
+}
+
+
+static void destroy_tpmring(struct tpm_private *tp)
+{
+	tpmif_set_connected_state(tp, 0);
+
+	if (tp->ring_ref != GRANT_INVALID_REF) {
+		gnttab_end_foreign_access(tp->ring_ref,
+				0, (unsigned long)tp->tx);
+		tp->ring_ref = GRANT_INVALID_REF;
+		tp->tx = NULL;
+	}
+
+	if (tp->evtchn)
+		unbind_from_irqhandler(irq_from_evtchn(tp->evtchn), tp);
+
+	tp->evtchn = GRANT_INVALID_REF;
+}
+
+
+static int talk_to_backend(struct xenbus_device *dev,
+		struct tpm_private *tp)
+{
+	const char *message = NULL;
+	int err;
+	struct xenbus_transaction xbt;
+
+	err = setup_tpmring(dev, tp);
+	if (err) {
+		xenbus_dev_fatal(dev, err, "setting up ring");
+		goto out;
+	}
+
+again:
+	err = xenbus_transaction_start(&xbt);
+	if (err) {
+		xenbus_dev_fatal(dev, err, "starting transaction");
+		goto destroy_tpmring;
+	}
+
+	err = xenbus_printf(xbt, dev->nodename,
+			"ring-ref", "%u", tp->ring_ref);
+	if (err) {
+		message = "writing ring-ref";
+		goto abort_transaction;
+	}
+
+	err = xenbus_printf(xbt, dev->nodename, "event-channel", "%u",
+			tp->evtchn);
+	if (err) {
+		message = "writing event-channel";
+		goto abort_transaction;
+	}
+
+	err = xenbus_transaction_end(xbt, 0);
+	if (err == -EAGAIN)
+		goto again;
+	if (err) {
+		xenbus_dev_fatal(dev, err, "completing transaction");
+		goto destroy_tpmring;
+	}
+
+	xenbus_switch_state(dev, XenbusStateConnected);
+
+	return 0;
+
+abort_transaction:
+	xenbus_transaction_end(xbt, 1);
+	if (message)
+		xenbus_dev_error(dev, err, "%s", message);
+destroy_tpmring:
+	destroy_tpmring(tp);
+out:
+	return err;
+}
+
+/**
+ * Callback received when the backend's state changes.
+ */
+static void backend_changed(struct xenbus_device *dev,
+		enum xenbus_state backend_state)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+
+	switch (backend_state) {
+	case XenbusStateInitialising:
+	case XenbusStateInitWait:
+	case XenbusStateInitialised:
+	case XenbusStateReconfiguring:
+	case XenbusStateReconfigured:
+	case XenbusStateUnknown:
+		break;
+
+	case XenbusStateConnected:
+		tpmif_set_connected_state(tp, 1);
+		break;
+
+	case XenbusStateClosing:
+		tpmif_set_connected_state(tp, 0);
+		xenbus_frontend_closed(dev);
+		break;
+
+	case XenbusStateClosed:
+		tpmif_set_connected_state(tp, 0);
+		if (tp->is_suspended == 0)
+			device_unregister(&dev->dev);
+		xenbus_frontend_closed(dev);
+		break;
+	}
+}
+
+static int tpmfront_probe(struct xenbus_device *dev,
+		const struct xenbus_device_id *id)
+{
+	int err;
+	int handle;
+	struct tpm_private *tp = tpm_private_get();
+
+	if (!tp)
+		return -ENOMEM;
+
+	tp->chip = init_vtpm(&dev->dev, tp);
+	if (IS_ERR(tp->chip))
+		return PTR_ERR(tp->chip);
+
+	err = xenbus_scanf(XBT_NIL, dev->nodename,
+			"handle", "%i", &handle);
+	if (XENBUS_EXIST_ERR(err))
+		return err;
+
+	if (err < 0) {
+		xenbus_dev_fatal(dev, err, "reading virtual-device");
+		return err;
+	}
+
+	tp->dev = dev;
+
+	err = talk_to_backend(dev, tp);
+	if (err) {
+		tpm_private_put();
+		return err;
+	}
+
+	return 0;
+}
+
+
+static int __devexit tpmfront_remove(struct xenbus_device *dev)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+	destroy_tpmring(tp);
+	cleanup_vtpm(&dev->dev);
+	return 0;
+}
+
+static int tpmfront_suspend(struct xenbus_device *dev)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+	u32 ctr;
+
+	/* Take the lock, preventing any application from sending. */
+	mutex_lock(&suspend_lock);
+	tp->is_suspended = 1;
+
+	for (ctr = 0; atomic_read(&tp->tx_busy); ctr++) {
+		/* Wait for a request to be responded to. */
+		interruptible_sleep_on_timeout(&tp->wait_q, 100);
+	}
+
+	return 0;
+}
+
+static int tpmfront_suspend_finish(struct tpm_private *tp)
+{
+	tp->is_suspended = 0;
+	/* Allow applications to send again. */
+	mutex_unlock(&suspend_lock);
+	return 0;
+}
+
+static int tpmfront_resume(struct xenbus_device *dev)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+	destroy_tpmring(tp);
+	return talk_to_backend(dev, tp);
+}
+
+static int tpmif_connect(struct xenbus_device *dev,
+		struct tpm_private *tp,
+		domid_t domid)
+{
+	int err;
+
+	tp->backend_id = domid;
+	tp->evtchn = GRANT_INVALID_REF;
+
+	err = xenbus_alloc_evtchn(dev, &tp->evtchn);
+	if (err)
+		return err;
+
+	err = bind_evtchn_to_irqhandler(tp->evtchn, tpmif_int,
+			0, "tpmif", tp);
+	if (err <= 0)
+		return err;
+
+	return 0;
+}
+
+static const struct xenbus_device_id tpmfront_ids[] = {
+	{ "vtpm" },
+	{ "" }
+};
+MODULE_ALIAS("xen:vtpm");
+
+static DEFINE_XENBUS_DRIVER(tpmfront, ,
+		.probe = tpmfront_probe,
+		.remove =  __devexit_p(tpmfront_remove),
+		.resume = tpmfront_resume,
+		.otherend_changed = backend_changed,
+		.suspend = tpmfront_suspend,
+		);
+
+static int __init init_tpm_xenbus(void)
+{
+	return xenbus_register_frontend(&tpmfront_driver);
+}
+
+static int tpmif_allocate_tx_buffers(struct tpm_private *tp)
+{
+	unsigned int i;
+
+	for (i = 0; i < TPMIF_TX_RING_SIZE; i++) {
+		tp->tx_buffers[i] = tx_buffer_alloc();
+		if (!tp->tx_buffers[i]) {
+			tpmif_free_tx_buffers(tp);
+			return -ENOMEM;
+		}
+	}
+	return 0;
+}
+
+static void tpmif_free_tx_buffers(struct tpm_private *tp)
+{
+	unsigned int i;
+
+	for (i = 0; i < TPMIF_TX_RING_SIZE; i++)
+		tx_buffer_free(tp->tx_buffers[i]);
+}
+
+static void tpmif_rx_action(unsigned long priv)
+{
+	struct tpm_private *tp = (struct tpm_private *)priv;
+	int i = 0;
+	unsigned int received;
+	unsigned int offset = 0;
+	u8 *buffer;
+	tpmif_tx_request_t *tx = &tp->tx->ring[i].req;
+
+	atomic_set(&tp->tx_busy, 0);
+	wake_up_interruptible(&tp->wait_q);
+
+	received = tx->size;
+
+	buffer = kmalloc(received, GFP_ATOMIC);
+	if (!buffer)
+		return;
+
+	for (i = 0; i < TPMIF_TX_RING_SIZE && offset < received; i++) {
+		struct tx_buffer *txb = tp->tx_buffers[i];
+		tpmif_tx_request_t *tx;
+		unsigned int tocopy;
+
+		tx = &tp->tx->ring[i].req;
+		tocopy = tx->size;
+		if (tocopy > PAGE_SIZE)
+			tocopy = PAGE_SIZE;
+
+		memcpy(&buffer[offset], txb->data, tocopy);
+
+		gnttab_release_grant_reference(&gref_head, tx->ref);
+
+		offset += tocopy;
+	}
+
+	vtpm_vd_recv(tp->chip, buffer, received, tp->tx_remember);
+	kfree(buffer);
+}
+
+
+static irqreturn_t tpmif_int(int irq, void *tpm_priv)
+{
+	struct tpm_private *tp = tpm_priv;
+	unsigned long flags;
+
+	spin_lock_irqsave(&tp->tx_lock, flags);
+	tpmif_rx_tasklet.data = (unsigned long)tp;
+	tasklet_schedule(&tpmif_rx_tasklet);
+	spin_unlock_irqrestore(&tp->tx_lock, flags);
+
+	return IRQ_HANDLED;
+}
+
+
+static int tpm_xmit(struct tpm_private *tp,
+		const u8 *buf, size_t count, int isuserbuffer,
+		void *remember)
+{
+	tpmif_tx_request_t *tx;
+	TPMIF_RING_IDX i;
+	unsigned int offset = 0;
+
+	spin_lock_irq(&tp->tx_lock);
+
+	if (unlikely(atomic_read(&tp->tx_busy))) {
+		spin_unlock_irq(&tp->tx_lock);
+		return -EBUSY;
+	}
+
+	if (tp->is_connected != 1) {
+		spin_unlock_irq(&tp->tx_lock);
+		return -EIO;
+	}
+
+	for (i = 0; count > 0 && i < TPMIF_TX_RING_SIZE; i++) {
+		struct tx_buffer *txb = tp->tx_buffers[i];
+		int copied;
+
+		if (!txb) {
+			spin_unlock_irq(&tp->tx_lock);
+			return -EFAULT;
+		}
+
+		copied = tx_buffer_copy(txb, &buf[offset], count,
+				isuserbuffer);
+		if (copied < 0) {
+			/* An error occurred */
+			spin_unlock_irq(&tp->tx_lock);
+			return copied;
+		}
+		count -= copied;
+		offset += copied;
+
+		tx = &tp->tx->ring[i].req;
+		tx->addr = virt_to_machine(txb->data).maddr;
+		tx->size = txb->len;
+		tx->unused = 0;
+
+		/* Get the granttable reference for this page. */
+		tx->ref = gnttab_claim_grant_reference(&gref_head);
+		if (tx->ref == -ENOSPC) {
+			spin_unlock_irq(&tp->tx_lock);
+			return -ENOSPC;
+		}
+		gnttab_grant_foreign_access_ref(tx->ref,
+				tp->backend_id,
+				virt_to_mfn(txb->data),
+				0 /*RW*/);
+		wmb();
+	}
+
+	atomic_set(&tp->tx_busy, 1);
+	tp->tx_remember = remember;
+
+	mb();
+
+	notify_remote_via_evtchn(tp->evtchn);
+
+	spin_unlock_irq(&tp->tx_lock);
+	return offset;
+}
+
+
+static void tpmif_notify_upperlayer(struct tpm_private *tp)
+{
+	/* Notify upper layer about the state of the connection to the BE. */
+	vtpm_vd_status(tp->chip, (tp->is_connected
+				? TPM_VD_STATUS_CONNECTED
+				: TPM_VD_STATUS_DISCONNECTED));
+}
+
+
+static void tpmif_set_connected_state(struct tpm_private *tp, u8 is_connected)
+{
+	/*
+	 * Don't notify upper layer if we are in suspend mode and
+	 * should disconnect - assumption is that we will resume
+	 * The mutex keeps apps from sending.
+	 */
+	if (is_connected == 0 && tp->is_suspended == 1)
+		return;
+
+	/*
+	 * Unlock the mutex if we are connected again
+	 * after being suspended - now resuming.
+	 * This also removes the suspend state.
+	 */
+	if (is_connected == 1 && tp->is_suspended == 1)
+		tpmfront_suspend_finish(tp);
+
+	if (is_connected != tp->is_connected) {
+		tp->is_connected = is_connected;
+		tpmif_notify_upperlayer(tp);
+	}
+}
+
+
+
+/* =================================================================
+ * Initialization function.
+ * =================================================================
+ */
+
+
+static int __init tpmif_init(void)
+{
+	struct tpm_private *tp;
+
+	if (!xen_domain())
+		return -ENODEV;
+
+	tp = tpm_private_get();
+	if (!tp)
+		return -ENOMEM;
+
+	if (gnttab_alloc_grant_references(TPMIF_TX_RING_SIZE,
+				&gref_head) < 0) {
+		tpm_private_put();
+		return -EFAULT;
+	}
+
+	init_tpm_xenbus();
+	return 0;
+}
+
+
+module_init(tpmif_init);
+
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/include/xen/interface/io/tpmif.h b/include/xen/interface/io/tpmif.h
new file mode 100644
index 0000000..5342fca
--- /dev/null
+++ b/include/xen/interface/io/tpmif.h
@@ -0,0 +1,77 @@
+/******************************************************************************
+ * tpmif.h
+ *
+ * TPM I/O interface for Xen guest OSes.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (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.
+ *
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * Author: Stefan Berger, stefanb@us.ibm.com
+ * Grant table support: Mahadevan Gomathisankaran
+ *
+ * This code has been derived from tools/libxc/xen/io/netif.h
+ *
+ * Copyright (c) 2003-2004, Keir Fraser
+ */
+
+#ifndef __XEN_PUBLIC_IO_TPMIF_H__
+#define __XEN_PUBLIC_IO_TPMIF_H__
+
+#include "../grant_table.h"
+
+struct tpmif_tx_request {
+	unsigned long addr;   /* Machine address of packet.   */
+	grant_ref_t ref;      /* grant table access reference */
+	uint16_t unused;
+	uint16_t size;        /* Packet size in bytes.        */
+};
+typedef struct tpmif_tx_request tpmif_tx_request_t;
+
+/*
+ * The TPMIF_TX_RING_SIZE defines the number of pages the
+ * front-end and backend can exchange (= size of array).
+ */
+typedef uint32_t TPMIF_RING_IDX;
+
+#define TPMIF_TX_RING_SIZE 1
+
+/* This structure must fit in a memory page. */
+
+struct tpmif_ring {
+	struct tpmif_tx_request req;
+};
+typedef struct tpmif_ring tpmif_ring_t;
+
+struct tpmif_tx_interface {
+	struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
+};
+typedef struct tpmif_tx_interface tpmif_tx_interface_t;
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 15:12:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 15:12:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVOLR-0004UC-32; Mon, 05 Nov 2012 15:12:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TVOLO-0004U7-P3
	for xen-devel@lists.xensource.com; Mon, 05 Nov 2012 15:12:07 +0000
Received: from [85.158.139.83:46322] by server-6.bemta-5.messagelabs.com id
	7D/BC-19321-547D7905; Mon, 05 Nov 2012 15:12:05 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352128320!21609403!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8977 invoked from network); 5 Nov 2012 15:12:02 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-11.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 5 Nov 2012 15:12:02 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148249615;
	Mon, 05 Nov 2012 10:10:29 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: key@linux.vnet.ibm.com, mail@srajiv.net, jeremy@goop.org,
	tpmdd-devel@lists.sourceforge.net, xen-devel@lists.xensource.com,
	konrad.wilk@oracle.com
Date: Mon,  5 Nov 2012 10:09:57 -0500
Message-Id: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	linux-kernel@vger.kernel.org
Subject: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch ports the xen vtpm frontend driver for linux
from the linux-2.6.18-xen.hg tree to linux-stable.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 drivers/char/tpm/Kconfig         |    9 +
 drivers/char/tpm/Makefile        |    2 +
 drivers/char/tpm/tpm.h           |   15 +
 drivers/char/tpm/tpm_vtpm.c      |  543 ++++++++++++++++++++++++++++++
 drivers/char/tpm/tpm_vtpm.h      |   55 +++
 drivers/char/tpm/tpm_xen.c       |  690 ++++++++++++++++++++++++++++++++++++++
 include/xen/interface/io/tpmif.h |   77 +++++
 7 files changed, 1391 insertions(+)
 create mode 100644 drivers/char/tpm/tpm_vtpm.c
 create mode 100644 drivers/char/tpm/tpm_vtpm.h
 create mode 100644 drivers/char/tpm/tpm_xen.c
 create mode 100644 include/xen/interface/io/tpmif.h

diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
index 915875e..08c1010 100644
--- a/drivers/char/tpm/Kconfig
+++ b/drivers/char/tpm/Kconfig
@@ -81,4 +81,13 @@ config TCG_IBMVTPM
 	  will be accessible from within Linux.  To compile this driver
 	  as a module, choose M here; the module will be called tpm_ibmvtpm.
 
+config TCG_XEN
+	tristate "XEN TPM Interface"
+	depends on TCG_TPM && XEN
+	---help---
+	  If you want to make TPM support available to a Xen user domain,
+	  say Yes and it will be accessible from within Linux.
+	  To compile this driver as a module, choose M here; the module
+	  will be called tpm_xenu.
+
 endif # TCG_TPM
diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
index 5b3fc8b..16911c5 100644
--- a/drivers/char/tpm/Makefile
+++ b/drivers/char/tpm/Makefile
@@ -17,3 +17,5 @@ obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
 obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
 obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
 obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
+obj-$(CONFIG_TCG_XEN) += tpm_xenu.o
+tpm_xenu-y = tpm_xen.o tpm_vtpm.o
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 8ef7649..2e5a47a 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -130,6 +130,9 @@ struct tpm_chip {
 
 	struct list_head list;
 	void (*release) (struct device *);
+#if CONFIG_XEN
+	void *priv;
+#endif
 };
 
 #define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor)
@@ -310,6 +313,18 @@ struct tpm_cmd_t {
 
 ssize_t	tpm_getcap(struct device *, __be32, cap_t *, const char *);
 
+#ifdef CONFIG_XEN
+static inline void *chip_get_private(const struct tpm_chip *chip)
+{
+	return chip->priv;
+}
+
+static inline void chip_set_private(struct tpm_chip *chip, void *priv)
+{
+	chip->priv = priv;
+}
+#endif
+
 extern int tpm_get_timeouts(struct tpm_chip *);
 extern void tpm_gen_interrupt(struct tpm_chip *);
 extern int tpm_do_selftest(struct tpm_chip *);
diff --git a/drivers/char/tpm/tpm_vtpm.c b/drivers/char/tpm/tpm_vtpm.c
new file mode 100644
index 0000000..7687252
--- /dev/null
+++ b/drivers/char/tpm/tpm_vtpm.c
@@ -0,0 +1,543 @@
+/*
+ * Copyright (C) 2006 IBM Corporation
+ *
+ * Authors:
+ * Stefan Berger <stefanb@us.ibm.com>
+ *
+ * Generic device driver part for device drivers in a virtualized
+ * environment.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, version 2 of the
+ * License.
+ *
+ */
+
+#include <linux/uaccess.h>
+#include <linux/list.h>
+#include <linux/device.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include "tpm.h"
+#include "tpm_vtpm.h"
+
+/* read status bits */
+enum {
+	STATUS_BUSY = 0x01,
+	STATUS_DATA_AVAIL = 0x02,
+	STATUS_READY = 0x04
+};
+
+struct transmission {
+	struct list_head next;
+
+	unsigned char *request;
+	size_t  request_len;
+	size_t  request_buflen;
+
+	unsigned char *response;
+	size_t  response_len;
+	size_t  response_buflen;
+
+	unsigned int flags;
+};
+
+enum {
+	TRANSMISSION_FLAG_WAS_QUEUED = 0x1
+};
+
+
+enum {
+	DATAEX_FLAG_QUEUED_ONLY = 0x1
+};
+
+
+/* local variables */
+
+/* local function prototypes */
+static int _vtpm_send_queued(struct tpm_chip *chip);
+
+
+/* =============================================================
+ * Some utility functions
+ * =============================================================
+ */
+static void vtpm_state_init(struct vtpm_state *vtpms)
+{
+	vtpms->current_request = NULL;
+	spin_lock_init(&vtpms->req_list_lock);
+	init_waitqueue_head(&vtpms->req_wait_queue);
+	INIT_LIST_HEAD(&vtpms->queued_requests);
+
+	vtpms->current_response = NULL;
+	spin_lock_init(&vtpms->resp_list_lock);
+	init_waitqueue_head(&vtpms->resp_wait_queue);
+
+	vtpms->disconnect_time = jiffies;
+}
+
+
+static inline struct transmission *transmission_alloc(void)
+{
+	return kzalloc(sizeof(struct transmission), GFP_ATOMIC);
+}
+
+	static unsigned char *
+transmission_set_req_buffer(struct transmission *t,
+		unsigned char *buffer, size_t len)
+{
+	if (t->request_buflen < len) {
+		kfree(t->request);
+		t->request = kmalloc(len, GFP_KERNEL);
+		if (!t->request) {
+			t->request_buflen = 0;
+			return NULL;
+		}
+		t->request_buflen = len;
+	}
+
+	memcpy(t->request, buffer, len);
+	t->request_len = len;
+
+	return t->request;
+}
+
+	static unsigned char *
+transmission_set_res_buffer(struct transmission *t,
+		const unsigned char *buffer, size_t len)
+{
+	if (t->response_buflen < len) {
+		kfree(t->response);
+		t->response = kmalloc(len, GFP_ATOMIC);
+		if (!t->response) {
+			t->response_buflen = 0;
+			return NULL;
+		}
+		t->response_buflen = len;
+	}
+
+	memcpy(t->response, buffer, len);
+	t->response_len = len;
+
+	return t->response;
+}
+
+static inline void transmission_free(struct transmission *t)
+{
+	kfree(t->request);
+	kfree(t->response);
+	kfree(t);
+}
+
+/* =============================================================
+ * Interface with the lower layer driver
+ * =============================================================
+ */
+/*
+ * Lower layer uses this function to make a response available.
+ */
+int vtpm_vd_recv(const struct tpm_chip *chip,
+		const unsigned char *buffer, size_t count,
+		void *ptr)
+{
+	unsigned long flags;
+	int ret_size = 0;
+	struct transmission *t;
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	/*
+	 * The list with requests must contain one request
+	 * only and the element there must be the one that
+	 * was passed to me from the front-end.
+	 */
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	if (vtpms->current_request != ptr) {
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		return 0;
+	}
+	t = vtpms->current_request;
+	if (t) {
+		transmission_free(t);
+		vtpms->current_request = NULL;
+	}
+
+	t = transmission_alloc();
+	if (t) {
+		if (!transmission_set_res_buffer(t, buffer, count)) {
+			transmission_free(t);
+			spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+			return -ENOMEM;
+		}
+		ret_size = count;
+		vtpms->current_response = t;
+		wake_up_interruptible(&vtpms->resp_wait_queue);
+	}
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+
+	return ret_size;
+}
+
+
+/*
+ * Lower layer indicates its status (connected/disconnected)
+ */
+void vtpm_vd_status(const struct tpm_chip *chip, u8 vd_status)
+{
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	vtpms->vd_status = vd_status;
+	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0)
+		vtpms->disconnect_time = jiffies;
+}
+
+/* =============================================================
+ * Interface with the generic TPM driver
+ * =============================================================
+ */
+static int vtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count)
+{
+	int rc = 0;
+	unsigned long flags;
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	/*
+	 * Check if the previous operation only queued the command
+	 * In this case there won't be a response, so I just
+	 * return from here and reset that flag. In any other
+	 * case I should receive a response from the back-end.
+	 */
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	if ((vtpms->flags & DATAEX_FLAG_QUEUED_ONLY) != 0) {
+		vtpms->flags &= ~DATAEX_FLAG_QUEUED_ONLY;
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		/*
+		 * The first few commands (measurements) must be
+		 * queued since it might not be possible to talk to the
+		 * TPM, yet.
+		 * Return a response of up to 30 '0's.
+		 */
+
+		count = min_t(size_t, count, 30);
+		memset(buf, 0x0, count);
+		return count;
+	}
+	/*
+	 * Check whether something is in the responselist and if
+	 * there's nothing in the list wait for something to appear.
+	 */
+
+	if (!vtpms->current_response) {
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		interruptible_sleep_on_timeout(&vtpms->resp_wait_queue,
+				1000);
+		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	}
+
+	if (vtpms->current_response) {
+		struct transmission *t = vtpms->current_response;
+		vtpms->current_response = NULL;
+		rc = min(count, t->response_len);
+		memcpy(buf, t->response, rc);
+		transmission_free(t);
+	}
+
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+	return rc;
+}
+
+static int vtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)
+{
+	int rc = 0;
+	unsigned long flags;
+	struct transmission *t = transmission_alloc();
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	if (!t)
+		return -ENOMEM;
+	/*
+	 * If there's a current request, it must be the
+	 * previous request that has timed out.
+	 */
+	spin_lock_irqsave(&vtpms->req_list_lock, flags);
+	if (vtpms->current_request != NULL) {
+		dev_warn(chip->dev, "Sending although there is a request outstanding.\n"
+				"         Previous request must have timed out.\n");
+		transmission_free(vtpms->current_request);
+		vtpms->current_request = NULL;
+	}
+	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+
+	/*
+	 * Queue the packet if the driver below is not
+	 * ready, yet, or there is any packet already
+	 * in the queue.
+	 * If the driver below is ready, unqueue all
+	 * packets first before sending our current
+	 * packet.
+	 * For each unqueued packet, except for the
+	 * last (=current) packet, call the function
+	 * tpm_xen_recv to wait for the response to come
+	 * back.
+	 */
+	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0) {
+		if (time_after(jiffies,
+					vtpms->disconnect_time + HZ * 10)) {
+			rc = -ENOENT;
+		} else {
+			goto queue_it;
+		}
+	} else {
+		/*
+		 * Send all queued packets.
+		 */
+		if (_vtpm_send_queued(chip) == 0) {
+
+			vtpms->current_request = t;
+
+			rc = vtpm_vd_send(vtpms->tpm_private,
+					buf,
+					count,
+					t);
+			/*
+			 * The generic TPM driver will call
+			 * the function to receive the response.
+			 */
+			if (rc < 0) {
+				vtpms->current_request = NULL;
+				goto queue_it;
+			}
+		} else {
+queue_it:
+			if (!transmission_set_req_buffer(t, buf, count)) {
+				transmission_free(t);
+				rc = -ENOMEM;
+				goto exit;
+			}
+			/*
+			 * An error occurred. Don't event try
+			 * to send the current request. Just
+			 * queue it.
+			 */
+			spin_lock_irqsave(&vtpms->req_list_lock, flags);
+			vtpms->flags |= DATAEX_FLAG_QUEUED_ONLY;
+			list_add_tail(&t->next, &vtpms->queued_requests);
+			spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+		}
+	}
+
+exit:
+	return rc;
+}
+
+
+/*
+ * Send all queued requests.
+ */
+static int _vtpm_send_queued(struct tpm_chip *chip)
+{
+	int rc;
+	int error = 0;
+	unsigned long flags;
+	unsigned char buffer[1];
+	struct vtpm_state *vtpms;
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	spin_lock_irqsave(&vtpms->req_list_lock, flags);
+
+	while (!list_empty(&vtpms->queued_requests)) {
+		/*
+		 * Need to dequeue them.
+		 * Read the result into a dummy buffer.
+		 */
+		struct transmission *qt = (struct transmission *)
+			vtpms->queued_requests.next;
+		list_del(&qt->next);
+		vtpms->current_request = qt;
+		spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+
+		rc = vtpm_vd_send(vtpms->tpm_private,
+				qt->request,
+				qt->request_len,
+				qt);
+
+		if (rc < 0) {
+			spin_lock_irqsave(&vtpms->req_list_lock, flags);
+			qt = vtpms->current_request;
+			if (qt != NULL) {
+				/*
+				 * requeue it at the beginning
+				 * of the list
+				 */
+				list_add(&qt->next,
+						&vtpms->queued_requests);
+			}
+			vtpms->current_request = NULL;
+			error = 1;
+			break;
+		}
+		/*
+		 * After this point qt is not valid anymore!
+		 * It is freed when the front-end is delivering
+		 * the data by calling tpm_recv
+		 */
+		/*
+		 * Receive response into provided dummy buffer
+		 */
+		rc = vtpm_recv(chip, buffer, sizeof(buffer));
+		spin_lock_irqsave(&vtpms->req_list_lock, flags);
+	}
+
+	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+
+	return error;
+}
+
+static void vtpm_cancel(struct tpm_chip *chip)
+{
+	unsigned long flags;
+	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+
+	if (!vtpms->current_response && vtpms->current_request) {
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		interruptible_sleep_on(&vtpms->resp_wait_queue);
+		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	}
+
+	if (vtpms->current_response) {
+		struct transmission *t = vtpms->current_response;
+		vtpms->current_response = NULL;
+		transmission_free(t);
+	}
+
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+}
+
+static u8 vtpm_status(struct tpm_chip *chip)
+{
+	u8 rc = 0;
+	unsigned long flags;
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	/*
+	 * Data are available if:
+	 *  - there's a current response
+	 *  - the last packet was queued only (this is fake, but necessary to
+	 *      get the generic TPM layer to call the receive function.)
+	 */
+	if (vtpms->current_response ||
+			0 != (vtpms->flags & DATAEX_FLAG_QUEUED_ONLY)) {
+		rc = STATUS_DATA_AVAIL;
+	} else if (!vtpms->current_response && !vtpms->current_request) {
+		rc = STATUS_READY;
+	}
+
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+	return rc;
+}
+
+static const struct file_operations vtpm_ops = {
+	.owner = THIS_MODULE,
+	.llseek = no_llseek,
+	.open = tpm_open,
+	.read = tpm_read,
+	.write = tpm_write,
+	.release = tpm_release,
+};
+
+static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
+static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
+static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);
+static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL);
+static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL);
+static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,
+		NULL);
+static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL);
+static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
+
+static struct attribute *vtpm_attrs[] = {
+	&dev_attr_pubek.attr,
+	&dev_attr_pcrs.attr,
+	&dev_attr_enabled.attr,
+	&dev_attr_active.attr,
+	&dev_attr_owned.attr,
+	&dev_attr_temp_deactivated.attr,
+	&dev_attr_caps.attr,
+	&dev_attr_cancel.attr,
+	NULL,
+};
+
+static struct attribute_group vtpm_attr_grp = { .attrs = vtpm_attrs };
+
+#define TPM_LONG_TIMEOUT   (10 * 60 * HZ)
+
+static struct tpm_vendor_specific tpm_vtpm = {
+	.recv = vtpm_recv,
+	.send = vtpm_send,
+	.cancel = vtpm_cancel,
+	.status = vtpm_status,
+	.req_complete_mask = STATUS_BUSY | STATUS_DATA_AVAIL,
+	.req_complete_val  = STATUS_DATA_AVAIL,
+	.req_canceled = STATUS_READY,
+	.attr_group = &vtpm_attr_grp,
+	.miscdev = {
+		.fops = &vtpm_ops,
+	},
+	.duration = {
+		TPM_LONG_TIMEOUT,
+		TPM_LONG_TIMEOUT,
+		TPM_LONG_TIMEOUT,
+	},
+};
+
+struct tpm_chip *init_vtpm(struct device *dev,
+		struct tpm_private *tp)
+{
+	long rc;
+	struct tpm_chip *chip;
+	struct vtpm_state *vtpms;
+
+	vtpms = kzalloc(sizeof(struct vtpm_state), GFP_KERNEL);
+	if (!vtpms)
+		return ERR_PTR(-ENOMEM);
+
+	vtpm_state_init(vtpms);
+	vtpms->tpm_private = tp;
+
+	chip = tpm_register_hardware(dev, &tpm_vtpm);
+	if (!chip) {
+		rc = -ENODEV;
+		goto err_free_mem;
+	}
+
+	chip_set_private(chip, vtpms);
+
+	return chip;
+
+err_free_mem:
+	kfree(vtpms);
+
+	return ERR_PTR(rc);
+}
+
+void cleanup_vtpm(struct device *dev)
+{
+	struct tpm_chip *chip = dev_get_drvdata(dev);
+	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
+	tpm_remove_hardware(dev);
+	kfree(vtpms);
+}
diff --git a/drivers/char/tpm/tpm_vtpm.h b/drivers/char/tpm/tpm_vtpm.h
new file mode 100644
index 0000000..d888fd8
--- /dev/null
+++ b/drivers/char/tpm/tpm_vtpm.h
@@ -0,0 +1,55 @@
+#ifndef TPM_VTPM_H
+#define TPM_VTPM_H
+
+struct tpm_chip;
+struct tpm_private;
+
+struct vtpm_state {
+	struct transmission *current_request;
+	spinlock_t           req_list_lock;
+	wait_queue_head_t    req_wait_queue;
+
+	struct list_head     queued_requests;
+
+	struct transmission *current_response;
+	spinlock_t           resp_list_lock;
+	wait_queue_head_t    resp_wait_queue;
+
+	u8                   vd_status;
+	u8                   flags;
+
+	unsigned long        disconnect_time;
+
+	/*
+	 * The following is a private structure of the underlying
+	 * driver. It is passed as parameter in the send function.
+	 */
+	struct tpm_private *tpm_private;
+};
+
+
+enum vdev_status {
+	TPM_VD_STATUS_DISCONNECTED = 0x0,
+	TPM_VD_STATUS_CONNECTED = 0x1
+};
+
+/* this function is called from tpm_vtpm.c */
+int vtpm_vd_send(struct tpm_private *tp,
+		const u8 *buf, size_t count, void *ptr);
+
+/* these functions are offered by tpm_vtpm.c */
+struct tpm_chip *init_vtpm(struct device *,
+		struct tpm_private *);
+void cleanup_vtpm(struct device *);
+int vtpm_vd_recv(const struct tpm_chip *chip,
+		const unsigned char *buffer, size_t count, void *ptr);
+void vtpm_vd_status(const struct tpm_chip *, u8 status);
+
+static inline struct tpm_private *tpm_private_from_dev(struct device *dev)
+{
+	struct tpm_chip *chip = dev_get_drvdata(dev);
+	struct vtpm_state *vtpms = chip_get_private(chip);
+	return vtpms->tpm_private;
+}
+
+#endif
diff --git a/drivers/char/tpm/tpm_xen.c b/drivers/char/tpm/tpm_xen.c
new file mode 100644
index 0000000..7198de3
--- /dev/null
+++ b/drivers/char/tpm/tpm_xen.c
@@ -0,0 +1,690 @@
+/*
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * Author: Stefan Berger, stefanb@us.ibm.com
+ * Grant table support: Mahadevan Gomathisankaran
+ *
+ * This code has been derived from drivers/xen/netfront/netfront.c
+ *
+ * Copyright (c) 2002-2004, K A Fraser
+ *
+ * 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.
+ */
+
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
+#include <linux/mutex.h>
+#include <linux/uaccess.h>
+#include <xen/events.h>
+#include <xen/interface/grant_table.h>
+#include <xen/interface/io/tpmif.h>
+#include <xen/grant_table.h>
+#include <xen/xenbus.h>
+#include <xen/page.h>
+#include "tpm.h"
+#include "tpm_vtpm.h"
+
+#undef DEBUG
+
+#define GRANT_INVALID_REF 0
+
+/* local structures */
+struct tpm_private {
+	struct tpm_chip *chip;
+
+	tpmif_tx_interface_t *tx;
+	atomic_t refcnt;
+	unsigned int evtchn;
+	u8 is_connected;
+	u8 is_suspended;
+
+	spinlock_t tx_lock;
+
+	struct tx_buffer *tx_buffers[TPMIF_TX_RING_SIZE];
+
+	atomic_t tx_busy;
+	void *tx_remember;
+
+	domid_t backend_id;
+	wait_queue_head_t wait_q;
+
+	struct xenbus_device *dev;
+	int ring_ref;
+};
+
+struct tx_buffer {
+	unsigned int size;	/* available space in data */
+	unsigned int len;	/* used space in data */
+	unsigned char *data;	/* pointer to a page */
+};
+
+
+/* locally visible variables */
+static grant_ref_t gref_head;
+static struct tpm_private *my_priv;
+
+/* local function prototypes */
+static irqreturn_t tpmif_int(int irq,
+		void *tpm_priv);
+static void tpmif_rx_action(unsigned long unused);
+static int tpmif_connect(struct xenbus_device *dev,
+		struct tpm_private *tp,
+		domid_t domid);
+static DECLARE_TASKLET(tpmif_rx_tasklet, tpmif_rx_action, 0);
+static int tpmif_allocate_tx_buffers(struct tpm_private *tp);
+static void tpmif_free_tx_buffers(struct tpm_private *tp);
+static void tpmif_set_connected_state(struct tpm_private *tp,
+		u8 newstate);
+static int tpm_xmit(struct tpm_private *tp,
+		const u8 *buf, size_t count, int userbuffer,
+		void *remember);
+static void destroy_tpmring(struct tpm_private *tp);
+
+	static inline int
+tx_buffer_copy(struct tx_buffer *txb, const u8 *src, int len,
+		int isuserbuffer)
+{
+	int copied = len;
+
+	if (len > txb->size)
+		copied = txb->size;
+	if (isuserbuffer) {
+		if (copy_from_user(txb->data, src, copied))
+			return -EFAULT;
+	} else {
+		memcpy(txb->data, src, copied);
+	}
+	txb->len = len;
+	return copied;
+}
+
+static inline struct tx_buffer *tx_buffer_alloc(void)
+{
+	struct tx_buffer *txb;
+
+	txb = kzalloc(sizeof(struct tx_buffer), GFP_KERNEL);
+	if (!txb)
+		return NULL;
+
+	txb->len = 0;
+	txb->size = PAGE_SIZE;
+	txb->data = (unsigned char *)__get_free_page(GFP_KERNEL);
+	if (txb->data == NULL) {
+		kfree(txb);
+		txb = NULL;
+	}
+
+	return txb;
+}
+
+
+static inline void tx_buffer_free(struct tx_buffer *txb)
+{
+	if (txb) {
+		free_page((long)txb->data);
+		kfree(txb);
+	}
+}
+
+/**************************************************************
+  Utility function for the tpm_private structure
+ **************************************************************/
+static void tpm_private_init(struct tpm_private *tp)
+{
+	spin_lock_init(&tp->tx_lock);
+	init_waitqueue_head(&tp->wait_q);
+	atomic_set(&tp->refcnt, 1);
+}
+
+static void tpm_private_put(void)
+{
+	if (!atomic_dec_and_test(&my_priv->refcnt))
+		return;
+
+	tpmif_free_tx_buffers(my_priv);
+	kfree(my_priv);
+	my_priv = NULL;
+}
+
+static struct tpm_private *tpm_private_get(void)
+{
+	int err;
+
+	if (my_priv) {
+		atomic_inc(&my_priv->refcnt);
+		return my_priv;
+	}
+
+	my_priv = kzalloc(sizeof(struct tpm_private), GFP_KERNEL);
+	if (!my_priv)
+		return NULL;
+
+	tpm_private_init(my_priv);
+	err = tpmif_allocate_tx_buffers(my_priv);
+	if (err < 0)
+		tpm_private_put();
+
+	return my_priv;
+}
+
+/**************************************************************
+
+  The interface to let the tpm plugin register its callback
+  function and send data to another partition using this module
+
+ **************************************************************/
+
+static DEFINE_MUTEX(suspend_lock);
+/*
+ * Send data via this module by calling this function
+ */
+int vtpm_vd_send(struct tpm_private *tp,
+		const u8 *buf, size_t count, void *ptr)
+{
+	int sent;
+
+	mutex_lock(&suspend_lock);
+	sent = tpm_xmit(tp, buf, count, 0, ptr);
+	mutex_unlock(&suspend_lock);
+
+	return sent;
+}
+
+/**************************************************************
+  XENBUS support code
+ **************************************************************/
+
+static int setup_tpmring(struct xenbus_device *dev,
+		struct tpm_private *tp)
+{
+	tpmif_tx_interface_t *sring;
+	int err;
+
+	tp->ring_ref = GRANT_INVALID_REF;
+
+	sring = (void *)__get_free_page(GFP_KERNEL);
+	if (!sring) {
+		xenbus_dev_fatal(dev, -ENOMEM, "allocating shared ring");
+		return -ENOMEM;
+	}
+	tp->tx = sring;
+
+	err = xenbus_grant_ring(dev, virt_to_mfn(tp->tx));
+	if (err < 0) {
+		free_page((unsigned long)sring);
+		tp->tx = NULL;
+		xenbus_dev_fatal(dev, err, "allocating grant reference");
+		goto fail;
+	}
+	tp->ring_ref = err;
+
+	err = tpmif_connect(dev, tp, dev->otherend_id);
+	if (err)
+		goto fail;
+
+	return 0;
+fail:
+	destroy_tpmring(tp);
+	return err;
+}
+
+
+static void destroy_tpmring(struct tpm_private *tp)
+{
+	tpmif_set_connected_state(tp, 0);
+
+	if (tp->ring_ref != GRANT_INVALID_REF) {
+		gnttab_end_foreign_access(tp->ring_ref,
+				0, (unsigned long)tp->tx);
+		tp->ring_ref = GRANT_INVALID_REF;
+		tp->tx = NULL;
+	}
+
+	if (tp->evtchn)
+		unbind_from_irqhandler(irq_from_evtchn(tp->evtchn), tp);
+
+	tp->evtchn = GRANT_INVALID_REF;
+}
+
+
+static int talk_to_backend(struct xenbus_device *dev,
+		struct tpm_private *tp)
+{
+	const char *message = NULL;
+	int err;
+	struct xenbus_transaction xbt;
+
+	err = setup_tpmring(dev, tp);
+	if (err) {
+		xenbus_dev_fatal(dev, err, "setting up ring");
+		goto out;
+	}
+
+again:
+	err = xenbus_transaction_start(&xbt);
+	if (err) {
+		xenbus_dev_fatal(dev, err, "starting transaction");
+		goto destroy_tpmring;
+	}
+
+	err = xenbus_printf(xbt, dev->nodename,
+			"ring-ref", "%u", tp->ring_ref);
+	if (err) {
+		message = "writing ring-ref";
+		goto abort_transaction;
+	}
+
+	err = xenbus_printf(xbt, dev->nodename, "event-channel", "%u",
+			tp->evtchn);
+	if (err) {
+		message = "writing event-channel";
+		goto abort_transaction;
+	}
+
+	err = xenbus_transaction_end(xbt, 0);
+	if (err == -EAGAIN)
+		goto again;
+	if (err) {
+		xenbus_dev_fatal(dev, err, "completing transaction");
+		goto destroy_tpmring;
+	}
+
+	xenbus_switch_state(dev, XenbusStateConnected);
+
+	return 0;
+
+abort_transaction:
+	xenbus_transaction_end(xbt, 1);
+	if (message)
+		xenbus_dev_error(dev, err, "%s", message);
+destroy_tpmring:
+	destroy_tpmring(tp);
+out:
+	return err;
+}
+
+/**
+ * Callback received when the backend's state changes.
+ */
+static void backend_changed(struct xenbus_device *dev,
+		enum xenbus_state backend_state)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+
+	switch (backend_state) {
+	case XenbusStateInitialising:
+	case XenbusStateInitWait:
+	case XenbusStateInitialised:
+	case XenbusStateReconfiguring:
+	case XenbusStateReconfigured:
+	case XenbusStateUnknown:
+		break;
+
+	case XenbusStateConnected:
+		tpmif_set_connected_state(tp, 1);
+		break;
+
+	case XenbusStateClosing:
+		tpmif_set_connected_state(tp, 0);
+		xenbus_frontend_closed(dev);
+		break;
+
+	case XenbusStateClosed:
+		tpmif_set_connected_state(tp, 0);
+		if (tp->is_suspended == 0)
+			device_unregister(&dev->dev);
+		xenbus_frontend_closed(dev);
+		break;
+	}
+}
+
+static int tpmfront_probe(struct xenbus_device *dev,
+		const struct xenbus_device_id *id)
+{
+	int err;
+	int handle;
+	struct tpm_private *tp = tpm_private_get();
+
+	if (!tp)
+		return -ENOMEM;
+
+	tp->chip = init_vtpm(&dev->dev, tp);
+	if (IS_ERR(tp->chip))
+		return PTR_ERR(tp->chip);
+
+	err = xenbus_scanf(XBT_NIL, dev->nodename,
+			"handle", "%i", &handle);
+	if (XENBUS_EXIST_ERR(err))
+		return err;
+
+	if (err < 0) {
+		xenbus_dev_fatal(dev, err, "reading virtual-device");
+		return err;
+	}
+
+	tp->dev = dev;
+
+	err = talk_to_backend(dev, tp);
+	if (err) {
+		tpm_private_put();
+		return err;
+	}
+
+	return 0;
+}
+
+
+static int __devexit tpmfront_remove(struct xenbus_device *dev)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+	destroy_tpmring(tp);
+	cleanup_vtpm(&dev->dev);
+	return 0;
+}
+
+static int tpmfront_suspend(struct xenbus_device *dev)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+	u32 ctr;
+
+	/* Take the lock, preventing any application from sending. */
+	mutex_lock(&suspend_lock);
+	tp->is_suspended = 1;
+
+	for (ctr = 0; atomic_read(&tp->tx_busy); ctr++) {
+		/* Wait for a request to be responded to. */
+		interruptible_sleep_on_timeout(&tp->wait_q, 100);
+	}
+
+	return 0;
+}
+
+static int tpmfront_suspend_finish(struct tpm_private *tp)
+{
+	tp->is_suspended = 0;
+	/* Allow applications to send again. */
+	mutex_unlock(&suspend_lock);
+	return 0;
+}
+
+static int tpmfront_resume(struct xenbus_device *dev)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+	destroy_tpmring(tp);
+	return talk_to_backend(dev, tp);
+}
+
+static int tpmif_connect(struct xenbus_device *dev,
+		struct tpm_private *tp,
+		domid_t domid)
+{
+	int err;
+
+	tp->backend_id = domid;
+	tp->evtchn = GRANT_INVALID_REF;
+
+	err = xenbus_alloc_evtchn(dev, &tp->evtchn);
+	if (err)
+		return err;
+
+	err = bind_evtchn_to_irqhandler(tp->evtchn, tpmif_int,
+			0, "tpmif", tp);
+	if (err <= 0)
+		return err;
+
+	return 0;
+}
+
+static const struct xenbus_device_id tpmfront_ids[] = {
+	{ "vtpm" },
+	{ "" }
+};
+MODULE_ALIAS("xen:vtpm");
+
+static DEFINE_XENBUS_DRIVER(tpmfront, ,
+		.probe = tpmfront_probe,
+		.remove =  __devexit_p(tpmfront_remove),
+		.resume = tpmfront_resume,
+		.otherend_changed = backend_changed,
+		.suspend = tpmfront_suspend,
+		);
+
+static int __init init_tpm_xenbus(void)
+{
+	return xenbus_register_frontend(&tpmfront_driver);
+}
+
+static int tpmif_allocate_tx_buffers(struct tpm_private *tp)
+{
+	unsigned int i;
+
+	for (i = 0; i < TPMIF_TX_RING_SIZE; i++) {
+		tp->tx_buffers[i] = tx_buffer_alloc();
+		if (!tp->tx_buffers[i]) {
+			tpmif_free_tx_buffers(tp);
+			return -ENOMEM;
+		}
+	}
+	return 0;
+}
+
+static void tpmif_free_tx_buffers(struct tpm_private *tp)
+{
+	unsigned int i;
+
+	for (i = 0; i < TPMIF_TX_RING_SIZE; i++)
+		tx_buffer_free(tp->tx_buffers[i]);
+}
+
+static void tpmif_rx_action(unsigned long priv)
+{
+	struct tpm_private *tp = (struct tpm_private *)priv;
+	int i = 0;
+	unsigned int received;
+	unsigned int offset = 0;
+	u8 *buffer;
+	tpmif_tx_request_t *tx = &tp->tx->ring[i].req;
+
+	atomic_set(&tp->tx_busy, 0);
+	wake_up_interruptible(&tp->wait_q);
+
+	received = tx->size;
+
+	buffer = kmalloc(received, GFP_ATOMIC);
+	if (!buffer)
+		return;
+
+	for (i = 0; i < TPMIF_TX_RING_SIZE && offset < received; i++) {
+		struct tx_buffer *txb = tp->tx_buffers[i];
+		tpmif_tx_request_t *tx;
+		unsigned int tocopy;
+
+		tx = &tp->tx->ring[i].req;
+		tocopy = tx->size;
+		if (tocopy > PAGE_SIZE)
+			tocopy = PAGE_SIZE;
+
+		memcpy(&buffer[offset], txb->data, tocopy);
+
+		gnttab_release_grant_reference(&gref_head, tx->ref);
+
+		offset += tocopy;
+	}
+
+	vtpm_vd_recv(tp->chip, buffer, received, tp->tx_remember);
+	kfree(buffer);
+}
+
+
+static irqreturn_t tpmif_int(int irq, void *tpm_priv)
+{
+	struct tpm_private *tp = tpm_priv;
+	unsigned long flags;
+
+	spin_lock_irqsave(&tp->tx_lock, flags);
+	tpmif_rx_tasklet.data = (unsigned long)tp;
+	tasklet_schedule(&tpmif_rx_tasklet);
+	spin_unlock_irqrestore(&tp->tx_lock, flags);
+
+	return IRQ_HANDLED;
+}
+
+
+static int tpm_xmit(struct tpm_private *tp,
+		const u8 *buf, size_t count, int isuserbuffer,
+		void *remember)
+{
+	tpmif_tx_request_t *tx;
+	TPMIF_RING_IDX i;
+	unsigned int offset = 0;
+
+	spin_lock_irq(&tp->tx_lock);
+
+	if (unlikely(atomic_read(&tp->tx_busy))) {
+		spin_unlock_irq(&tp->tx_lock);
+		return -EBUSY;
+	}
+
+	if (tp->is_connected != 1) {
+		spin_unlock_irq(&tp->tx_lock);
+		return -EIO;
+	}
+
+	for (i = 0; count > 0 && i < TPMIF_TX_RING_SIZE; i++) {
+		struct tx_buffer *txb = tp->tx_buffers[i];
+		int copied;
+
+		if (!txb) {
+			spin_unlock_irq(&tp->tx_lock);
+			return -EFAULT;
+		}
+
+		copied = tx_buffer_copy(txb, &buf[offset], count,
+				isuserbuffer);
+		if (copied < 0) {
+			/* An error occurred */
+			spin_unlock_irq(&tp->tx_lock);
+			return copied;
+		}
+		count -= copied;
+		offset += copied;
+
+		tx = &tp->tx->ring[i].req;
+		tx->addr = virt_to_machine(txb->data).maddr;
+		tx->size = txb->len;
+		tx->unused = 0;
+
+		/* Get the granttable reference for this page. */
+		tx->ref = gnttab_claim_grant_reference(&gref_head);
+		if (tx->ref == -ENOSPC) {
+			spin_unlock_irq(&tp->tx_lock);
+			return -ENOSPC;
+		}
+		gnttab_grant_foreign_access_ref(tx->ref,
+				tp->backend_id,
+				virt_to_mfn(txb->data),
+				0 /*RW*/);
+		wmb();
+	}
+
+	atomic_set(&tp->tx_busy, 1);
+	tp->tx_remember = remember;
+
+	mb();
+
+	notify_remote_via_evtchn(tp->evtchn);
+
+	spin_unlock_irq(&tp->tx_lock);
+	return offset;
+}
+
+
+static void tpmif_notify_upperlayer(struct tpm_private *tp)
+{
+	/* Notify upper layer about the state of the connection to the BE. */
+	vtpm_vd_status(tp->chip, (tp->is_connected
+				? TPM_VD_STATUS_CONNECTED
+				: TPM_VD_STATUS_DISCONNECTED));
+}
+
+
+static void tpmif_set_connected_state(struct tpm_private *tp, u8 is_connected)
+{
+	/*
+	 * Don't notify upper layer if we are in suspend mode and
+	 * should disconnect - assumption is that we will resume
+	 * The mutex keeps apps from sending.
+	 */
+	if (is_connected == 0 && tp->is_suspended == 1)
+		return;
+
+	/*
+	 * Unlock the mutex if we are connected again
+	 * after being suspended - now resuming.
+	 * This also removes the suspend state.
+	 */
+	if (is_connected == 1 && tp->is_suspended == 1)
+		tpmfront_suspend_finish(tp);
+
+	if (is_connected != tp->is_connected) {
+		tp->is_connected = is_connected;
+		tpmif_notify_upperlayer(tp);
+	}
+}
+
+
+
+/* =================================================================
+ * Initialization function.
+ * =================================================================
+ */
+
+
+static int __init tpmif_init(void)
+{
+	struct tpm_private *tp;
+
+	if (!xen_domain())
+		return -ENODEV;
+
+	tp = tpm_private_get();
+	if (!tp)
+		return -ENOMEM;
+
+	if (gnttab_alloc_grant_references(TPMIF_TX_RING_SIZE,
+				&gref_head) < 0) {
+		tpm_private_put();
+		return -EFAULT;
+	}
+
+	init_tpm_xenbus();
+	return 0;
+}
+
+
+module_init(tpmif_init);
+
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/include/xen/interface/io/tpmif.h b/include/xen/interface/io/tpmif.h
new file mode 100644
index 0000000..5342fca
--- /dev/null
+++ b/include/xen/interface/io/tpmif.h
@@ -0,0 +1,77 @@
+/******************************************************************************
+ * tpmif.h
+ *
+ * TPM I/O interface for Xen guest OSes.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (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.
+ *
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * Author: Stefan Berger, stefanb@us.ibm.com
+ * Grant table support: Mahadevan Gomathisankaran
+ *
+ * This code has been derived from tools/libxc/xen/io/netif.h
+ *
+ * Copyright (c) 2003-2004, Keir Fraser
+ */
+
+#ifndef __XEN_PUBLIC_IO_TPMIF_H__
+#define __XEN_PUBLIC_IO_TPMIF_H__
+
+#include "../grant_table.h"
+
+struct tpmif_tx_request {
+	unsigned long addr;   /* Machine address of packet.   */
+	grant_ref_t ref;      /* grant table access reference */
+	uint16_t unused;
+	uint16_t size;        /* Packet size in bytes.        */
+};
+typedef struct tpmif_tx_request tpmif_tx_request_t;
+
+/*
+ * The TPMIF_TX_RING_SIZE defines the number of pages the
+ * front-end and backend can exchange (= size of array).
+ */
+typedef uint32_t TPMIF_RING_IDX;
+
+#define TPMIF_TX_RING_SIZE 1
+
+/* This structure must fit in a memory page. */
+
+struct tpmif_ring {
+	struct tpmif_tx_request req;
+};
+typedef struct tpmif_ring tpmif_ring_t;
+
+struct tpmif_tx_interface {
+	struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
+};
+typedef struct tpmif_tx_interface tpmif_tx_interface_t;
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 15:17:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 15:17:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVOQZ-0004dM-1Y; Mon, 05 Nov 2012 15:17:27 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TVOQY-0004dF-6o
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 15:17:26 +0000
Received: from [193.109.254.147:13040] by server-3.bemta-14.messagelabs.com id
	D9/F7-01317-588D7905; Mon, 05 Nov 2012 15:17:25 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352128643!1824020!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODEzNTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7240 invoked from network); 5 Nov 2012 15:17:24 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 15:17:24 -0000
X-IronPort-AV: E=Sophos;i="4.80,715,1344211200"; d="scan'208";a="43445437"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	05 Nov 2012 15:17:22 +0000
Received: from kaball.uk.xensource.com (10.80.2.59) by
	FTLPEX01CL02.citrite.net (10.13.107.79) with Microsoft SMTP Server id
	14.2.318.1; Mon, 5 Nov 2012 10:17:22 -0500
Date: Mon, 5 Nov 2012 15:16:40 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Konrad Rzeszutek Wilk <konrad@kernel.org>
In-Reply-To: <20121102164937.GC27213@konrad-lan.dumpdata.com>
Message-ID: <alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<5089676602000078000A4928@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC82923353723C7@SHSMSX101.ccr.corp.intel.com>
	<508A89CB020000780008E6ED@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
X-Originating-IP: [10.80.2.59]
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> > diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> > index 0e86370..a2af622 100644
> > --- a/drivers/xen/Makefile
> > +++ b/drivers/xen/Makefile
> > @@ -29,6 +29,7 @@ obj-$(CONFIG_XEN_MCE_LOG)           += mcelog.o
> >  obj-$(CONFIG_XEN_PCIDEV_BACKEND)     += xen-pciback/
> >  obj-$(CONFIG_XEN_PRIVCMD)            += xen-privcmd.o
> >  obj-$(CONFIG_XEN_ACPI_PROCESSOR)     += xen-acpi-processor.o
> > +obj-$(CONFIG_XEN_DOM0)                       += xen_acpi_pad.o
> >  xen-evtchn-y                         := evtchn.o
> >  xen-gntdev-y                         := gntdev.o
> >  xen-gntalloc-y                               := gntalloc.o

it should really depend on ACPI and maybe also X86, otherwise it is
going to break the ARM build


> > diff --git a/drivers/xen/xen_acpi_pad.c b/drivers/xen/xen_acpi_pad.c
> > new file mode 100644
> > index 0000000..e8c26a4
> > --- /dev/null
> > +++ b/drivers/xen/xen_acpi_pad.c
> > @@ -0,0 +1,206 @@
> > +/*
> > + * xen_acpi_pad.c - Xen pad interface
> > + *
> > + * Copyright (c) 2012, Intel Corporation.
> > + *    Author: Liu, Jinsong <jinsong.liu@intel.com>
> > + *
> > + * This program is free software; you can redistribute it and/or modify it
> > + * under the terms and conditions of the GNU General Public License,
> > + * version 2, as published by the Free Software Foundation.
> > + *
> > + * This program is distributed in the hope it will be useful, but WITHOUT
> > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> > + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
> > + * more details.
> > + */
> > +
> > +#include <linux/kernel.h>
> > +#include <linux/types.h>
> > +#include <acpi/acpi_bus.h>
> > +#include <acpi/acpi_drivers.h>
> > +#include <asm/xen/hypercall.h>
> > +#include <xen/interface/version.h>
> > +
> > +#define ACPI_PROCESSOR_AGGREGATOR_CLASS      "acpi_pad"
> > +#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
> > +#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
> > +
> > +static DEFINE_MUTEX(xen_pad_lock);
> > +
> > +static int xen_pad_set_idle_cpus(int num_cpus)
> > +{
> > +     struct xen_platform_op op;
> > +
> > +     if (num_cpus < 0)
> > +             return -EINVAL;
> > +
> > +     /* set cpu nums expected to be idled */
> > +     op.cmd = XENPF_core_parking;
> > +     op.u.core_parking.type = XEN_CORE_PARKING_SET;
> > +     op.u.core_parking.idle_nums = num_cpus;
> > +
> > +     return HYPERVISOR_dom0_op(&op);
> > +}
> > +
> > +/*
> > + * Cannot get idle cpus by using hypercall once (shared with _SET)
> > + * because of the characteristic of Xen continue_hypercall_on_cpu
> > + */
> > +static int xen_pad_get_idle_cpus(void)
> > +{
> > +     int ret;
> > +     struct xen_platform_op op;
> > +
> > +     /* get cpu nums actually be idled */
> > +     op.cmd = XENPF_core_parking;
> > +     op.u.core_parking.type = XEN_CORE_PARKING_GET;
> > +     ret = HYPERVISOR_dom0_op(&op);
> > +     if (ret < 0)
> > +             return ret;
> > +
> > +     return op.u.core_parking.idle_nums;
> > +}
> > +
> > +/*
> > + * Query firmware how many CPUs should be idle
> > + * return -1 on failure
> > + */
> > +static int xen_acpi_pad_pur(acpi_handle handle)
> > +{
> > +     struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
> > +     union acpi_object *package;
> > +     int num = -1;
> > +
> > +     if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))
> > +             return num;
> > +
> > +     if (!buffer.length || !buffer.pointer)
> > +             return num;
> > +
> > +     package = buffer.pointer;
> > +
> > +     if (package->type == ACPI_TYPE_PACKAGE &&
> > +             package->package.count == 2 &&
> > +             package->package.elements[0].integer.value == 1) /* rev 1 */
> > +
> > +             num = package->package.elements[1].integer.value;
> > +
> > +     kfree(buffer.pointer);
> > +     return num;
> > +}
> > +
> > +/* Notify firmware how many CPUs are idle */
> > +static void xen_acpi_pad_ost(acpi_handle handle, int stat,
> > +     uint32_t idle_cpus)
> > +{
> > +     union acpi_object params[3] = {
> > +             {.type = ACPI_TYPE_INTEGER,},
> > +             {.type = ACPI_TYPE_INTEGER,},
> > +             {.type = ACPI_TYPE_BUFFER,},
> > +     };
> > +     struct acpi_object_list arg_list = {3, params};
> > +
> > +     params[0].integer.value = ACPI_PROCESSOR_AGGREGATOR_NOTIFY;
> > +     params[1].integer.value =  stat;
> > +     params[2].buffer.length = 4;
> > +     params[2].buffer.pointer = (void *)&idle_cpus;
> > +     acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
> > +}
> > +
> > +static void xen_acpi_pad_handle_notify(acpi_handle handle)
> > +{
> > +     int num_cpus;
> > +
> > +     num_cpus = xen_acpi_pad_pur(handle);
> > +     if (num_cpus < 0)
> > +             return;
> > +
> > +     mutex_lock(&xen_pad_lock);
> > +     if (xen_pad_set_idle_cpus(num_cpus)) {
> > +             mutex_unlock(&xen_pad_lock);
> > +             return;
> > +     }
> > +
> > +     num_cpus = xen_pad_get_idle_cpus();
> > +     if (num_cpus < 0) {
> > +             mutex_unlock(&xen_pad_lock);
> > +             return;
> > +     }
> > +     mutex_unlock(&xen_pad_lock);
> > +
> > +     xen_acpi_pad_ost(handle, 0, num_cpus);
> > +}
> > +
> > +static void xen_acpi_pad_notify(acpi_handle handle, u32 event,
> > +     void *data)
> > +{
> > +     switch (event) {
> > +     case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
> > +             xen_acpi_pad_handle_notify(handle);
> > +             break;
> > +     default:
> > +             pr_warn("Unsupported event [0x%x]\n", event);
> > +             break;
> > +     }
> > +}
> > +
> > +static int xen_acpi_pad_add(struct acpi_device *device)
> > +{
> > +     acpi_status status;
> > +
> > +     strcpy(acpi_device_name(device), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
> > +     strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);
> > +
> > +     status = acpi_install_notify_handler(device->handle,
> > +              ACPI_DEVICE_NOTIFY, xen_acpi_pad_notify, device);
> > +     if (ACPI_FAILURE(status))
> > +             return -ENODEV;
> > +
> > +     return 0;
> > +}
> > +
> > +static int xen_acpi_pad_remove(struct acpi_device *device,
> > +     int type)
> > +{
> > +     mutex_lock(&xen_pad_lock);
> > +     xen_pad_set_idle_cpus(0);
> > +     mutex_unlock(&xen_pad_lock);
> > +
> > +     acpi_remove_notify_handler(device->handle,
> > +             ACPI_DEVICE_NOTIFY, xen_acpi_pad_notify);
> > +     return 0;
> > +}
> > +
> > +static const struct acpi_device_id pad_device_ids[] = {
> > +     {"ACPI000C", 0},
> > +     {"", 0},
> > +};
> > +
> > +static struct acpi_driver xen_acpi_pad_driver = {
> > +     .name = "processor_aggregator",
> > +     .class = ACPI_PROCESSOR_AGGREGATOR_CLASS,
> > +     .ids = pad_device_ids,
> > +     .ops = {
> > +             .add = xen_acpi_pad_add,
> > +             .remove = xen_acpi_pad_remove,
> > +     },
> > +};
> > +
> > +static int __init xen_acpi_pad_init(void)
> > +{
> > +     int ret = -ENOSYS;
> > +     unsigned int version = HYPERVISOR_xen_version(XENVER_version, NULL);
> 
> Heh. so if you run this on baremetal I wonder what will happen.
> 
> > +     unsigned int major = version >> 16;
> > +     unsigned int minor = version & 0xffff;
> > +
> > +     /* Only DOM0 is responsible for Xen acpi pad */
> > +     if (!xen_initial_domain())
> > +             return -ENODEV;
> > +
> 
> I think the check for version should happen here.
> 
> > +     /* Only Xen4.2 or later support Xen acpi pad */
> > +     if (((major == 4) && (minor >= 2)) || (major > 4))
> > +             ret = acpi_bus_register_driver(&xen_acpi_pad_driver);
> > +
> > +     return ret;
> > +}
> > +subsys_initcall(xen_acpi_pad_init);
> > diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
> > index 4755b5f..a3be54c 100644
> > --- a/include/xen/interface/platform.h
> > +++ b/include/xen/interface/platform.h
> > @@ -324,6 +324,22 @@ struct xenpf_cpu_ol {
> >  };
> >  DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
> >
> > +/*
> > + * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd,
> > + * which are already occupied at Xen hypervisor side.
> > + */
> > +#define XENPF_core_parking   60
> > +struct xenpf_core_parking {
> > +     /* IN variables */
> > +#define XEN_CORE_PARKING_SET 1
> > +#define XEN_CORE_PARKING_GET 2
> > +     uint32_t type;
> > +     /* IN variables:  set cpu nums expected to be idled */
> > +     /* OUT variables: get cpu nums actually be idled */
> > +     uint32_t idle_nums;
> > +};
> > +DEFINE_GUEST_HANDLE_STRUCT(xenpf_core_parking);
> > +
> >  struct xen_platform_op {
> >       uint32_t cmd;
> >       uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
> > @@ -341,6 +357,7 @@ struct xen_platform_op {
> >               struct xenpf_set_processor_pminfo set_pminfo;
> >               struct xenpf_pcpuinfo          pcpu_info;
> >               struct xenpf_cpu_ol            cpu_ol;
> > +             struct xenpf_core_parking      core_parking;
> >               uint8_t                        pad[128];
> >       } u;
> >  };
> > --
> > 1.7.1
> 
> 
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 15:17:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 15:17:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVOQZ-0004dM-1Y; Mon, 05 Nov 2012 15:17:27 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TVOQY-0004dF-6o
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 15:17:26 +0000
Received: from [193.109.254.147:13040] by server-3.bemta-14.messagelabs.com id
	D9/F7-01317-588D7905; Mon, 05 Nov 2012 15:17:25 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352128643!1824020!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODEzNTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7240 invoked from network); 5 Nov 2012 15:17:24 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 15:17:24 -0000
X-IronPort-AV: E=Sophos;i="4.80,715,1344211200"; d="scan'208";a="43445437"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	05 Nov 2012 15:17:22 +0000
Received: from kaball.uk.xensource.com (10.80.2.59) by
	FTLPEX01CL02.citrite.net (10.13.107.79) with Microsoft SMTP Server id
	14.2.318.1; Mon, 5 Nov 2012 10:17:22 -0500
Date: Mon, 5 Nov 2012 15:16:40 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Konrad Rzeszutek Wilk <konrad@kernel.org>
In-Reply-To: <20121102164937.GC27213@konrad-lan.dumpdata.com>
Message-ID: <alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<5089676602000078000A4928@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC82923353723C7@SHSMSX101.ccr.corp.intel.com>
	<508A89CB020000780008E6ED@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
X-Originating-IP: [10.80.2.59]
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> > diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> > index 0e86370..a2af622 100644
> > --- a/drivers/xen/Makefile
> > +++ b/drivers/xen/Makefile
> > @@ -29,6 +29,7 @@ obj-$(CONFIG_XEN_MCE_LOG)           += mcelog.o
> >  obj-$(CONFIG_XEN_PCIDEV_BACKEND)     += xen-pciback/
> >  obj-$(CONFIG_XEN_PRIVCMD)            += xen-privcmd.o
> >  obj-$(CONFIG_XEN_ACPI_PROCESSOR)     += xen-acpi-processor.o
> > +obj-$(CONFIG_XEN_DOM0)                       += xen_acpi_pad.o
> >  xen-evtchn-y                         := evtchn.o
> >  xen-gntdev-y                         := gntdev.o
> >  xen-gntalloc-y                               := gntalloc.o

it should really depend on ACPI and maybe also X86, otherwise it is
going to break the ARM build


> > diff --git a/drivers/xen/xen_acpi_pad.c b/drivers/xen/xen_acpi_pad.c
> > new file mode 100644
> > index 0000000..e8c26a4
> > --- /dev/null
> > +++ b/drivers/xen/xen_acpi_pad.c
> > @@ -0,0 +1,206 @@
> > +/*
> > + * xen_acpi_pad.c - Xen pad interface
> > + *
> > + * Copyright (c) 2012, Intel Corporation.
> > + *    Author: Liu, Jinsong <jinsong.liu@intel.com>
> > + *
> > + * This program is free software; you can redistribute it and/or modify it
> > + * under the terms and conditions of the GNU General Public License,
> > + * version 2, as published by the Free Software Foundation.
> > + *
> > + * This program is distributed in the hope it will be useful, but WITHOUT
> > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> > + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
> > + * more details.
> > + */
> > +
> > +#include <linux/kernel.h>
> > +#include <linux/types.h>
> > +#include <acpi/acpi_bus.h>
> > +#include <acpi/acpi_drivers.h>
> > +#include <asm/xen/hypercall.h>
> > +#include <xen/interface/version.h>
> > +
> > +#define ACPI_PROCESSOR_AGGREGATOR_CLASS      "acpi_pad"
> > +#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
> > +#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
> > +
> > +static DEFINE_MUTEX(xen_pad_lock);
> > +
> > +static int xen_pad_set_idle_cpus(int num_cpus)
> > +{
> > +     struct xen_platform_op op;
> > +
> > +     if (num_cpus < 0)
> > +             return -EINVAL;
> > +
> > +     /* set cpu nums expected to be idled */
> > +     op.cmd = XENPF_core_parking;
> > +     op.u.core_parking.type = XEN_CORE_PARKING_SET;
> > +     op.u.core_parking.idle_nums = num_cpus;
> > +
> > +     return HYPERVISOR_dom0_op(&op);
> > +}
> > +
> > +/*
> > + * Cannot get idle cpus by using hypercall once (shared with _SET)
> > + * because of the characteristic of Xen continue_hypercall_on_cpu
> > + */
> > +static int xen_pad_get_idle_cpus(void)
> > +{
> > +     int ret;
> > +     struct xen_platform_op op;
> > +
> > +     /* get cpu nums actually be idled */
> > +     op.cmd = XENPF_core_parking;
> > +     op.u.core_parking.type = XEN_CORE_PARKING_GET;
> > +     ret = HYPERVISOR_dom0_op(&op);
> > +     if (ret < 0)
> > +             return ret;
> > +
> > +     return op.u.core_parking.idle_nums;
> > +}
> > +
> > +/*
> > + * Query firmware how many CPUs should be idle
> > + * return -1 on failure
> > + */
> > +static int xen_acpi_pad_pur(acpi_handle handle)
> > +{
> > +     struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
> > +     union acpi_object *package;
> > +     int num = -1;
> > +
> > +     if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))
> > +             return num;
> > +
> > +     if (!buffer.length || !buffer.pointer)
> > +             return num;
> > +
> > +     package = buffer.pointer;
> > +
> > +     if (package->type == ACPI_TYPE_PACKAGE &&
> > +             package->package.count == 2 &&
> > +             package->package.elements[0].integer.value == 1) /* rev 1 */
> > +
> > +             num = package->package.elements[1].integer.value;
> > +
> > +     kfree(buffer.pointer);
> > +     return num;
> > +}
> > +
> > +/* Notify firmware how many CPUs are idle */
> > +static void xen_acpi_pad_ost(acpi_handle handle, int stat,
> > +     uint32_t idle_cpus)
> > +{
> > +     union acpi_object params[3] = {
> > +             {.type = ACPI_TYPE_INTEGER,},
> > +             {.type = ACPI_TYPE_INTEGER,},
> > +             {.type = ACPI_TYPE_BUFFER,},
> > +     };
> > +     struct acpi_object_list arg_list = {3, params};
> > +
> > +     params[0].integer.value = ACPI_PROCESSOR_AGGREGATOR_NOTIFY;
> > +     params[1].integer.value =  stat;
> > +     params[2].buffer.length = 4;
> > +     params[2].buffer.pointer = (void *)&idle_cpus;
> > +     acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
> > +}
> > +
> > +static void xen_acpi_pad_handle_notify(acpi_handle handle)
> > +{
> > +     int num_cpus;
> > +
> > +     num_cpus = xen_acpi_pad_pur(handle);
> > +     if (num_cpus < 0)
> > +             return;
> > +
> > +     mutex_lock(&xen_pad_lock);
> > +     if (xen_pad_set_idle_cpus(num_cpus)) {
> > +             mutex_unlock(&xen_pad_lock);
> > +             return;
> > +     }
> > +
> > +     num_cpus = xen_pad_get_idle_cpus();
> > +     if (num_cpus < 0) {
> > +             mutex_unlock(&xen_pad_lock);
> > +             return;
> > +     }
> > +     mutex_unlock(&xen_pad_lock);
> > +
> > +     xen_acpi_pad_ost(handle, 0, num_cpus);
> > +}
> > +
> > +static void xen_acpi_pad_notify(acpi_handle handle, u32 event,
> > +     void *data)
> > +{
> > +     switch (event) {
> > +     case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
> > +             xen_acpi_pad_handle_notify(handle);
> > +             break;
> > +     default:
> > +             pr_warn("Unsupported event [0x%x]\n", event);
> > +             break;
> > +     }
> > +}
> > +
> > +static int xen_acpi_pad_add(struct acpi_device *device)
> > +{
> > +     acpi_status status;
> > +
> > +     strcpy(acpi_device_name(device), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
> > +     strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);
> > +
> > +     status = acpi_install_notify_handler(device->handle,
> > +              ACPI_DEVICE_NOTIFY, xen_acpi_pad_notify, device);
> > +     if (ACPI_FAILURE(status))
> > +             return -ENODEV;
> > +
> > +     return 0;
> > +}
> > +
> > +static int xen_acpi_pad_remove(struct acpi_device *device,
> > +     int type)
> > +{
> > +     mutex_lock(&xen_pad_lock);
> > +     xen_pad_set_idle_cpus(0);
> > +     mutex_unlock(&xen_pad_lock);
> > +
> > +     acpi_remove_notify_handler(device->handle,
> > +             ACPI_DEVICE_NOTIFY, xen_acpi_pad_notify);
> > +     return 0;
> > +}
> > +
> > +static const struct acpi_device_id pad_device_ids[] = {
> > +     {"ACPI000C", 0},
> > +     {"", 0},
> > +};
> > +
> > +static struct acpi_driver xen_acpi_pad_driver = {
> > +     .name = "processor_aggregator",
> > +     .class = ACPI_PROCESSOR_AGGREGATOR_CLASS,
> > +     .ids = pad_device_ids,
> > +     .ops = {
> > +             .add = xen_acpi_pad_add,
> > +             .remove = xen_acpi_pad_remove,
> > +     },
> > +};
> > +
> > +static int __init xen_acpi_pad_init(void)
> > +{
> > +     int ret = -ENOSYS;
> > +     unsigned int version = HYPERVISOR_xen_version(XENVER_version, NULL);
> 
> Heh. so if you run this on baremetal I wonder what will happen.
> 
> > +     unsigned int major = version >> 16;
> > +     unsigned int minor = version & 0xffff;
> > +
> > +     /* Only DOM0 is responsible for Xen acpi pad */
> > +     if (!xen_initial_domain())
> > +             return -ENODEV;
> > +
> 
> I think the check for version should happen here.
> 
> > +     /* Only Xen4.2 or later support Xen acpi pad */
> > +     if (((major == 4) && (minor >= 2)) || (major > 4))
> > +             ret = acpi_bus_register_driver(&xen_acpi_pad_driver);
> > +
> > +     return ret;
> > +}
> > +subsys_initcall(xen_acpi_pad_init);
> > diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
> > index 4755b5f..a3be54c 100644
> > --- a/include/xen/interface/platform.h
> > +++ b/include/xen/interface/platform.h
> > @@ -324,6 +324,22 @@ struct xenpf_cpu_ol {
> >  };
> >  DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
> >
> > +/*
> > + * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd,
> > + * which are already occupied at Xen hypervisor side.
> > + */
> > +#define XENPF_core_parking   60
> > +struct xenpf_core_parking {
> > +     /* IN variables */
> > +#define XEN_CORE_PARKING_SET 1
> > +#define XEN_CORE_PARKING_GET 2
> > +     uint32_t type;
> > +     /* IN variables:  set cpu nums expected to be idled */
> > +     /* OUT variables: get cpu nums actually be idled */
> > +     uint32_t idle_nums;
> > +};
> > +DEFINE_GUEST_HANDLE_STRUCT(xenpf_core_parking);
> > +
> >  struct xen_platform_op {
> >       uint32_t cmd;
> >       uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
> > @@ -341,6 +357,7 @@ struct xen_platform_op {
> >               struct xenpf_set_processor_pminfo set_pminfo;
> >               struct xenpf_pcpuinfo          pcpu_info;
> >               struct xenpf_cpu_ol            cpu_ol;
> > +             struct xenpf_core_parking      core_parking;
> >               uint8_t                        pad[128];
> >       } u;
> >  };
> > --
> > 1.7.1
> 
> 
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 15:34:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 15:34:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVOfb-0004qv-If; Mon, 05 Nov 2012 15:32:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TVOfZ-0004qq-Ic
	for xen-devel@lists.xensource.com; Mon, 05 Nov 2012 15:32:57 +0000
Received: from [85.158.143.99:63285] by server-2.bemta-4.messagelabs.com id
	EA/EB-28922-82CD7905; Mon, 05 Nov 2012 15:32:56 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1352129575!28376650!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTcyNDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23025 invoked from network); 5 Nov 2012 15:32:55 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 15:32:55 -0000
X-IronPort-AV: E=Sophos;i="4.80,715,1344211200"; d="scan'208";a="15590114"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	05 Nov 2012 15:32:55 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 5 Nov 2012 15:32:54 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TVOfW-0005UX-QW;
	Mon, 05 Nov 2012 15:32:54 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TVOfW-00006M-Kw;
	Mon, 05 Nov 2012 15:32:54 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14367-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 5 Nov 2012 15:32:54 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [linux-3.0 test] 14367: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14367 linux-3.0 real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14367/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-i386-pvops              4 kernel-build              fail REGR. vs. 14354

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14354
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14354
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14354
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14354

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail never pass
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass

version targeted for testing:
 linux                ac7b56f4149a2f0e331a9b640f65aed57ed15eb4
baseline version:
 linux                27d0858dbcf199838b8c50a3e94d397bf326d986

------------------------------------------------------------
People who touched revisions under test:
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             fail    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit ac7b56f4149a2f0e331a9b640f65aed57ed15eb4
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Mon Nov 5 09:44:42 2012 +0100

    Linux 3.0.51

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 15:34:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 15:34:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVOfb-0004qv-If; Mon, 05 Nov 2012 15:32:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TVOfZ-0004qq-Ic
	for xen-devel@lists.xensource.com; Mon, 05 Nov 2012 15:32:57 +0000
Received: from [85.158.143.99:63285] by server-2.bemta-4.messagelabs.com id
	EA/EB-28922-82CD7905; Mon, 05 Nov 2012 15:32:56 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1352129575!28376650!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTcyNDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23025 invoked from network); 5 Nov 2012 15:32:55 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 15:32:55 -0000
X-IronPort-AV: E=Sophos;i="4.80,715,1344211200"; d="scan'208";a="15590114"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	05 Nov 2012 15:32:55 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 5 Nov 2012 15:32:54 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TVOfW-0005UX-QW;
	Mon, 05 Nov 2012 15:32:54 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TVOfW-00006M-Kw;
	Mon, 05 Nov 2012 15:32:54 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14367-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 5 Nov 2012 15:32:54 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [linux-3.0 test] 14367: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14367 linux-3.0 real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14367/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-i386-pvops              4 kernel-build              fail REGR. vs. 14354

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14354
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14354
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14354
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14354

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail never pass
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass

version targeted for testing:
 linux                ac7b56f4149a2f0e331a9b640f65aed57ed15eb4
baseline version:
 linux                27d0858dbcf199838b8c50a3e94d397bf326d986

------------------------------------------------------------
People who touched revisions under test:
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             fail    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit ac7b56f4149a2f0e331a9b640f65aed57ed15eb4
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Mon Nov 5 09:44:42 2012 +0100

    Linux 3.0.51

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 16:50:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 16:50:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVPrq-0005k9-UZ; Mon, 05 Nov 2012 16:49:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVPrp-0005k4-S0
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 16:49:42 +0000
Received: from [85.158.143.99:51721] by server-1.bemta-4.messagelabs.com id
	7D/46-27934-52EE7905; Mon, 05 Nov 2012 16:49:41 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352134178!28152641!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14026 invoked from network); 5 Nov 2012 16:49:38 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-216.messagelabs.com with SMTP;
	5 Nov 2012 16:49:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 05 Nov 2012 16:49:37 +0000
Message-Id: <5097FC3002000078000A66AE@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Mon, 05 Nov 2012 16:49:36 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part7140BB30.0__="
Subject: [Xen-devel] [PATCH] x86/ACPI: invalidate BGRT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part7140BB30.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Since the image pointed to may (and generally will) live in boot
services memory (which we add to the global memory pool long before
ACPI tables get looked at), we should prevent Dom0 from trying to
retrieve the image data.

The alternatives would be to
- not add boot services memory to the global pool at all, or
- defer adding boot services memory until Dom0 indicates it is safe to
  do so, or
- find and parse the BGRT table in xen/arch/x86/efi/boot.c, and avoid
  adding that specific region to the E820 table.
None of these is really attractive, and as Xen commonly prints to the
video console anyway (without trying to avoid any regions on the
screen), the invalidation would need to be done conditionally anyway.

(xen/include/acpi/actbl3.h is a verbatim copy from Linux 3.7-rc4)

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -286,6 +286,25 @@ static int __init acpi_parse_hpet(struct
 #define	acpi_parse_hpet	NULL
 #endif
=20
+static int __init acpi_invalidate_bgrt(struct acpi_table_header *table)
+{
+	struct acpi_table_bgrt *bgrt_tbl =3D
+		container_of(table, struct acpi_table_bgrt, header);
+
+	if (table->length < sizeof(*bgrt_tbl))
+		return -1;
+
+	if (!(bgrt_tbl->status & 1))
+		return 0;
+
+	printk(KERN_INFO PREFIX "BGRT: invalidating v%d image at %#"PRIx64"=
 for (%u,%u)\n",
+	       bgrt_tbl->version, bgrt_tbl->image_address,
+	       bgrt_tbl->image_offset_x, bgrt_tbl->image_offset_y);
+	bgrt_tbl->status &=3D ~1;
+
+	return 0;
+}
+
 #ifdef CONFIG_ACPI_SLEEP
 #define acpi_fadt_copy_address(dst, src, len) do {			\
 	if (fadt->header.revision >=3D FADT2_REVISION_ID)			=
\
@@ -653,5 +672,7 @@ int __init acpi_boot_init(void)
=20
 	erst_init();
=20
+	acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt);
+
 	return 0;
 }
--- a/xen/include/acpi/actbl.h
+++ b/xen/include/acpi/actbl.h
@@ -314,6 +314,7 @@ enum acpi_prefered_pm_profiles {
=20
 #include <acpi/actbl1.h>
 #include <acpi/actbl2.h>
+#include <acpi/actbl3.h>
=20
 /*
  * Sizes of the various flavors of FADT. We need to look closely
--- /dev/null
+++ b/xen/include/acpi/actbl3.h
@@ -0,0 +1,557 @@
+/*************************************************************************=
*****
+ *
+ * Name: actbl3.h - ACPI Table Definitions
+ *
+ *************************************************************************=
****/
+
+/*
+ * Copyright (C) 2000 - 2012, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a =
disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for =
further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the =
names
+ *    of any contributors may be used to endorse or promote products =
derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENT=
IAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE =
GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#ifndef __ACTBL3_H__
+#define __ACTBL3_H__
+
+/*************************************************************************=
******
+ *
+ * Additional ACPI Tables (3)
+ *
+ * These tables are not consumed directly by the ACPICA subsystem, but =
are
+ * included here to support device drivers and the AML disassembler.
+ *
+ * The tables in this file are fully defined within the ACPI specification=
.
+ *
+ *************************************************************************=
*****/
+
+/*
+ * Values for description table header signatures for tables defined in =
this
+ * file. Useful because they make it more difficult to inadvertently type =
in
+ * the wrong signature.
+ */
+#define ACPI_SIG_BGRT           "BGRT"	/* Boot Graphics Resource Table */
+#define ACPI_SIG_DRTM           "DRTM"	/* Dynamic Root of Trust for =
Measurement table */
+#define ACPI_SIG_FPDT           "FPDT"	/* Firmware Performance Data Table =
*/
+#define ACPI_SIG_GTDT           "GTDT"	/* Generic Timer Description Table =
*/
+#define ACPI_SIG_MPST           "MPST"	/* Memory Power State Table */
+#define ACPI_SIG_PCCT           "PCCT"	/* Platform Communications Channel =
Table */
+#define ACPI_SIG_PMTT           "PMTT"	/* Platform Memory Topology Table =
*/
+#define ACPI_SIG_RASF           "RASF"	/* RAS Feature table */
+
+#define ACPI_SIG_S3PT           "S3PT"	/* S3 Performance (sub)Table */
+#define ACPI_SIG_PCCS           "PCC"	/* PCC Shared Memory Region */
+
+/* Reserved table signatures */
+
+#define ACPI_SIG_CSRT           "CSRT"	/* Core System Resources Table */
+#define ACPI_SIG_MATR           "MATR"	/* Memory Address Translation =
Table */
+#define ACPI_SIG_MSDM           "MSDM"	/* Microsoft Data Management Table =
*/
+#define ACPI_SIG_WPBT           "WPBT"	/* Windows Platform Binary Table =
*/
+
+/*
+ * All tables must be byte-packed to match the ACPI specification, since
+ * the tables are provided by the system BIOS.
+ */
+#pragma pack(1)
+
+/*
+ * Note: C bitfields are not used for this reason:
+ *
+ * "Bitfields are great and easy to read, but unfortunately the C =
language
+ * does not specify the layout of bitfields in memory, which means they =
are
+ * essentially useless for dealing with packed data in on-disk formats or
+ * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
+ * this decision was a design error in C. Ritchie could have picked an =
order
+ * and stuck with it." Norman Ramsey.
+ * See http://stackoverflow.com/a/1053662/41661=20
+ */
+
+/*************************************************************************=
******
+ *
+ * BGRT - Boot Graphics Resource Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_bgrt {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u16 version;
+	u8 status;
+	u8 image_type;
+	u64 image_address;
+	u32 image_offset_x;
+	u32 image_offset_y;
+};
+
+/*************************************************************************=
******
+ *
+ * DRTM - Dynamic Root of Trust for Measurement table
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_drtm {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u64 entry_base_address;
+	u64 entry_length;
+	u32 entry_address32;
+	u64 entry_address64;
+	u64 exit_address;
+	u64 log_area_address;
+	u32 log_area_length;
+	u64 arch_dependent_address;
+	u32 flags;
+};
+
+/* 1) Validated Tables List */
+
+struct acpi_drtm_vtl_list {
+	u32 validated_table_list_count;
+};
+
+/* 2) Resources List */
+
+struct acpi_drtm_resource_list {
+	u32 resource_list_count;
+};
+
+/* 3) Platform-specific Identifiers List */
+
+struct acpi_drtm_id_list {
+	u32 id_list_count;
+};
+
+/*************************************************************************=
******
+ *
+ * FPDT - Firmware Performance Data Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_fpdt {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+};
+
+/* FPDT subtable header */
+
+struct acpi_fpdt_header {
+	u16 type;
+	u8 length;
+	u8 revision;
+};
+
+/* Values for Type field above */
+
+enum acpi_fpdt_type {
+	ACPI_FPDT_TYPE_BOOT =3D 0,
+	ACPI_FPDT_TYPE_S3PERF =3D 1,
+};
+
+/*
+ * FPDT subtables
+ */
+
+/* 0: Firmware Basic Boot Performance Record */
+
+struct acpi_fpdt_boot {
+	struct acpi_fpdt_header header;
+	u8 reserved[4];
+	u64 reset_end;
+	u64 load_start;
+	u64 startup_start;
+	u64 exit_services_entry;
+	u64 exit_services_exit;
+};
+
+/* 1: S3 Performance Table Pointer Record */
+
+struct acpi_fpdt_s3pt_ptr {
+	struct acpi_fpdt_header header;
+	u8 reserved[4];
+	u64 address;
+};
+
+/*
+ * S3PT - S3 Performance Table. This table is pointed to by the
+ * FPDT S3 Pointer Record above.
+ */
+struct acpi_table_s3pt {
+	u8 signature[4];	/* "S3PT" */
+	u32 length;
+};
+
+/*
+ * S3PT Subtables
+ */
+struct acpi_s3pt_header {
+	u16 type;
+	u8 length;
+	u8 revision;
+};
+
+/* Values for Type field above */
+
+enum acpi_s3pt_type {
+	ACPI_S3PT_TYPE_RESUME =3D 0,
+	ACPI_S3PT_TYPE_SUSPEND =3D 1,
+};
+
+struct acpi_s3pt_resume {
+	struct acpi_s3pt_header header;
+	u32 resume_count;
+	u64 full_resume;
+	u64 average_resume;
+};
+
+struct acpi_s3pt_suspend {
+	struct acpi_s3pt_header header;
+	u64 suspend_start;
+	u64 suspend_end;
+};
+
+/*************************************************************************=
******
+ *
+ * GTDT - Generic Timer Description Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_gtdt {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u64 address;
+	u32 flags;
+	u32 secure_pl1_interrupt;
+	u32 secure_pl1_flags;
+	u32 non_secure_pl1_interrupt;
+	u32 non_secure_pl1_flags;
+	u32 virtual_timer_interrupt;
+	u32 virtual_timer_flags;
+	u32 non_secure_pl2_interrupt;
+	u32 non_secure_pl2_flags;
+};
+
+/* Values for Flags field above */
+
+#define ACPI_GTDT_MAPPED_BLOCK_PRESENT      1
+
+/* Values for all "TimerFlags" fields above */
+
+#define ACPI_GTDT_INTERRUPT_MODE            1
+#define ACPI_GTDT_INTERRUPT_POLARITY        2
+
+/*************************************************************************=
******
+ *
+ * MPST - Memory Power State Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+#define ACPI_MPST_CHANNEL_INFO \
+	u16                             reserved1; \
+	u8                              channel_id; \
+	u8                              reserved2; \
+	u16                             power_node_count;
+
+/* Main table */
+
+struct acpi_table_mpst {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	 ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel */
+};
+
+/* Memory Platform Communication Channel Info */
+
+struct acpi_mpst_channel {
+	ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel */
+};
+
+/* Memory Power Node Structure */
+
+struct acpi_mpst_power_node {
+	u8 flags;
+	u8 reserved1;
+	u16 node_id;
+	u32 length;
+	u64 range_address;
+	u64 range_length;
+	u8 num_power_states;
+	u8 num_physical_components;
+	u16 reserved2;
+};
+
+/* Values for Flags field above */
+
+#define ACPI_MPST_ENABLED               1
+#define ACPI_MPST_POWER_MANAGED         2
+#define ACPI_MPST_HOT_PLUG_CAPABLE      4
+
+/* Memory Power State Structure (follows POWER_NODE above) */
+
+struct acpi_mpst_power_state {
+	u8 power_state;
+	u8 info_index;
+};
+
+/* Physical Component ID Structure (follows POWER_STATE above) */
+
+struct acpi_mpst_component {
+	u16 component_id;
+};
+
+/* Memory Power State Characteristics Structure (follows all POWER_NODEs) =
*/
+
+struct acpi_mpst_data_hdr {
+	u16 characteristics_count;
+};
+
+struct acpi_mpst_power_data {
+	u8 revision;
+	u8 flags;
+	u16 reserved1;
+	u32 average_power;
+	u32 power_saving;
+	u64 exit_latency;
+	u64 reserved2;
+};
+
+/* Values for Flags field above */
+
+#define ACPI_MPST_PRESERVE              1
+#define ACPI_MPST_AUTOENTRY             2
+#define ACPI_MPST_AUTOEXIT              4
+
+/* Shared Memory Region (not part of an ACPI table) */
+
+struct acpi_mpst_shared {
+	u32 signature;
+	u16 pcc_command;
+	u16 pcc_status;
+	u16 command_register;
+	u16 status_register;
+	u16 power_state_id;
+	u16 power_node_id;
+	u64 energy_consumed;
+	u64 average_power;
+};
+
+/*************************************************************************=
******
+ *
+ * PCCT - Platform Communications Channel Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_pcct {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u32 flags;
+	u32 latency;
+	u32 reserved;
+};
+
+/* Values for Flags field above */
+
+#define ACPI_PCCT_DOORBELL              1
+
+/*
+ * PCCT subtables
+ */
+
+/* 0: Generic Communications Subspace */
+
+struct acpi_pcct_subspace {
+	struct acpi_subtable_header header;
+	u8 reserved[6];
+	u64 base_address;
+	u64 length;
+	struct acpi_generic_address doorbell_register;
+	u64 preserve_mask;
+	u64 write_mask;
+};
+
+/*
+ * PCC memory structures (not part of the ACPI table)
+ */
+
+/* Shared Memory Region */
+
+struct acpi_pcct_shared_memory {
+	u32 signature;
+	u16 command;
+	u16 status;
+};
+
+/*************************************************************************=
******
+ *
+ * PMTT - Platform Memory Topology Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_pmtt {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u32 reserved;
+};
+
+/* Common header for PMTT subtables that follow main table */
+
+struct acpi_pmtt_header {
+	u8 type;
+	u8 reserved1;
+	u16 length;
+	u16 flags;
+	u16 reserved2;
+};
+
+/* Values for Type field above */
+
+#define ACPI_PMTT_TYPE_SOCKET           0
+#define ACPI_PMTT_TYPE_CONTROLLER       1
+#define ACPI_PMTT_TYPE_DIMM             2
+#define ACPI_PMTT_TYPE_RESERVED         3	/* 0x03-0xFF are reserved =
*/
+
+/* Values for Flags field above */
+
+#define ACPI_PMTT_TOP_LEVEL             0x0001
+#define ACPI_PMTT_PHYSICAL              0x0002
+#define ACPI_PMTT_MEMORY_TYPE           0x000C
+
+/*
+ * PMTT subtables, correspond to Type in struct acpi_pmtt_header
+ */
+
+/* 0: Socket Structure */
+
+struct acpi_pmtt_socket {
+	struct acpi_pmtt_header header;
+	u16 socket_id;
+	u16 reserved;
+};
+
+/* 1: Memory Controller subtable */
+
+struct acpi_pmtt_controller {
+	struct acpi_pmtt_header header;
+	u32 read_latency;
+	u32 write_latency;
+	u32 read_bandwidth;
+	u32 write_bandwidth;
+	u16 access_width;
+	u16 alignment;
+	u16 reserved;
+	u16 domain_count;
+};
+
+/* 1a: Proximity Domain substructure */
+
+struct acpi_pmtt_domain {
+	u32 proximity_domain;
+};
+
+/* 2: Physical Component Identifier (DIMM) */
+
+struct acpi_pmtt_physical_component {
+	struct acpi_pmtt_header header;
+	u16 component_id;
+	u16 reserved;
+	u32 memory_size;
+	u32 bios_handle;
+};
+
+/*************************************************************************=
******
+ *
+ * RASF - RAS Feature Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_rasf {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u8 channel_id[12];
+};
+
+/* RASF Platform Communication Channel Shared Memory Region */
+
+struct acpi_rasf_shared_memory {
+	u32 signature;
+	u16 command;
+	u16 status;
+	u64 requested_address;
+	u64 requested_length;
+	u64 actual_address;
+	u64 actual_length;
+	u16 flags;
+	u8 speed;
+};
+
+/* Masks for Flags and Speed fields above */
+
+#define ACPI_RASF_SCRUBBER_RUNNING      1
+#define ACPI_RASF_SPEED                 (7<<1)
+
+/* Channel Commands */
+
+enum acpi_rasf_commands {
+	ACPI_RASF_GET_RAS_CAPABILITIES =3D 1,
+	ACPI_RASF_GET_PATROL_PARAMETERS =3D 2,
+	ACPI_RASF_START_PATROL_SCRUBBER =3D 3,
+	ACPI_RASF_STOP_PATROL_SCRUBBER =3D 4
+};
+
+/* Channel Command flags */
+
+#define ACPI_RASF_GENERATE_SCI          (1<<15)
+
+/* Status values */
+
+enum acpi_rasf_status {
+	ACPI_RASF_SUCCESS =3D 0,
+	ACPI_RASF_NOT_VALID =3D 1,
+	ACPI_RASF_NOT_SUPPORTED =3D 2,
+	ACPI_RASF_BUSY =3D 3,
+	ACPI_RASF_FAILED =3D 4,
+	ACPI_RASF_ABORTED =3D 5,
+	ACPI_RASF_INVALID_DATA =3D 6
+};
+
+/* Status flags */
+
+#define ACPI_RASF_COMMAND_COMPLETE      (1)
+#define ACPI_RASF_SCI_DOORBELL          (1<<1)
+#define ACPI_RASF_ERROR                 (1<<2)
+#define ACPI_RASF_STATUS                (0x1F<<3)
+
+/* Reset to default packing */
+
+#pragma pack()
+
+#endif				/* __ACTBL3_H__ */



--=__Part7140BB30.0__=
Content-Type: text/plain; name="ACPI-BGRT-invalidate.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="ACPI-BGRT-invalidate.patch"

x86/ACPI: invalidate BGRT=0A=0ASince the image pointed to may (and =
generally will) live in boot=0Aservices memory (which we add to the global =
memory pool long before=0AACPI tables get looked at), we should prevent =
Dom0 from trying to=0Aretrieve the image data.=0A=0AThe alternatives would =
be to=0A- not add boot services memory to the global pool at all, or=0A- =
defer adding boot services memory until Dom0 indicates it is safe to=0A  =
do so, or=0A- find and parse the BGRT table in xen/arch/x86/efi/boot.c, =
and avoid=0A  adding that specific region to the E820 table.=0ANone of =
these is really attractive, and as Xen commonly prints to the=0Avideo =
console anyway (without trying to avoid any regions on the=0Ascreen), the =
invalidation would need to be done conditionally anyway.=0A=0A(xen/include/=
acpi/actbl3.h is a verbatim copy from Linux 3.7-rc4)=0A=0ASigned-off-by: =
Jan Beulich <jbeulich@suse.com>=0A=0A--- a/xen/arch/x86/acpi/boot.c=0A+++ =
b/xen/arch/x86/acpi/boot.c=0A@@ -286,6 +286,25 @@ static int __init =
acpi_parse_hpet(struct=0A #define	acpi_parse_hpet	NULL=0A #endif=0A =
=0A+static int __init acpi_invalidate_bgrt(struct acpi_table_header =
*table)=0A+{=0A+	struct acpi_table_bgrt *bgrt_tbl =3D=0A+		=
container_of(table, struct acpi_table_bgrt, header);=0A+=0A+	if =
(table->length < sizeof(*bgrt_tbl))=0A+		return -1;=0A+=0A+	if =
(!(bgrt_tbl->status & 1))=0A+		return 0;=0A+=0A+	printk(KERN=
_INFO PREFIX "BGRT: invalidating v%d image at %#"PRIx64" for (%u,%u)\n",=0A=
+	       bgrt_tbl->version, bgrt_tbl->image_address,=0A+	       =
bgrt_tbl->image_offset_x, bgrt_tbl->image_offset_y);=0A+	bgrt_tbl->s=
tatus &=3D ~1;=0A+=0A+	return 0;=0A+}=0A+=0A #ifdef CONFIG_ACPI_SLEEP=0A =
#define acpi_fadt_copy_address(dst, src, len) do {			=
\=0A 	if (fadt->header.revision >=3D FADT2_REVISION_ID)			=
\=0A@@ -653,5 +672,7 @@ int __init acpi_boot_init(void)=0A =0A 	erst_init()=
;=0A =0A+	acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt);=0A+=
=0A 	return 0;=0A }=0A--- a/xen/include/acpi/actbl.h=0A+++ b/xen/include=
/acpi/actbl.h=0A@@ -314,6 +314,7 @@ enum acpi_prefered_pm_profiles {=0A =
=0A #include <acpi/actbl1.h>=0A #include <acpi/actbl2.h>=0A+#include =
<acpi/actbl3.h>=0A =0A /*=0A  * Sizes of the various flavors of FADT. We =
need to look closely=0A--- /dev/null=0A+++ b/xen/include/acpi/actbl3.h=0A@@=
 -0,0 +1,557 @@=0A+/*******************************************************=
***********************=0A+ *=0A+ * Name: actbl3.h - ACPI Table Definitions=
=0A+ *=0A+ ****************************************************************=
*************/=0A+=0A+/*=0A+ * Copyright (C) 2000 - 2012, Intel Corp.=0A+ =
* All rights reserved.=0A+ *=0A+ * Redistribution and use in source and =
binary forms, with or without=0A+ * modification, are permitted provided =
that the following conditions=0A+ * are met:=0A+ * 1. Redistributions of =
source code must retain the above copyright=0A+ *    notice, this list of =
conditions, and the following disclaimer,=0A+ *    without modification.=0A=
+ * 2. Redistributions in binary form must reproduce at minimum a =
disclaimer=0A+ *    substantially similar to the "NO WARRANTY" disclaimer =
below=0A+ *    ("Disclaimer") and any redistribution must be conditioned =
upon=0A+ *    including a substantially similar Disclaimer requirement for =
further=0A+ *    binary redistribution.=0A+ * 3. Neither the names of the =
above-listed copyright holders nor the names=0A+ *    of any contributors =
may be used to endorse or promote products derived=0A+ *    from this =
software without specific prior written permission.=0A+ *=0A+ * Alternative=
ly, this software may be distributed under the terms of the=0A+ * GNU =
General Public License ("GPL") version 2 as published by the Free=0A+ * =
Software Foundation.=0A+ *=0A+ * NO WARRANTY=0A+ * THIS SOFTWARE IS =
PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=0A+ * "AS IS" AND ANY =
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT=0A+ * LIMITED TO, THE =
IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR=0A+ * A PARTICULAR =
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT=0A+ * HOLDERS OR =
CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL=0A+ * =
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE =
GOODS=0A+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS =
INTERRUPTION)=0A+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER =
IN CONTRACT,=0A+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR =
OTHERWISE) ARISING=0A+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN =
IF ADVISED OF THE=0A+ * POSSIBILITY OF SUCH DAMAGES.=0A+ */=0A+=0A+#ifndef =
__ACTBL3_H__=0A+#define __ACTBL3_H__=0A+=0A+/******************************=
*************************************************=0A+ *=0A+ * Additional =
ACPI Tables (3)=0A+ *=0A+ * These tables are not consumed directly by the =
ACPICA subsystem, but are=0A+ * included here to support device drivers =
and the AML disassembler.=0A+ *=0A+ * The tables in this file are fully =
defined within the ACPI specification.=0A+ *=0A+ **************************=
****************************************************/=0A+=0A+/*=0A+ * =
Values for description table header signatures for tables defined in =
this=0A+ * file. Useful because they make it more difficult to inadvertentl=
y type in=0A+ * the wrong signature.=0A+ */=0A+#define ACPI_SIG_BGRT       =
    "BGRT"	/* Boot Graphics Resource Table */=0A+#define ACPI_SIG_DRTM=
           "DRTM"	/* Dynamic Root of Trust for Measurement table =
*/=0A+#define ACPI_SIG_FPDT           "FPDT"	/* Firmware Performance =
Data Table */=0A+#define ACPI_SIG_GTDT           "GTDT"	/* Generic Timer =
Description Table */=0A+#define ACPI_SIG_MPST           "MPST"	/* Memory =
Power State Table */=0A+#define ACPI_SIG_PCCT           "PCCT"	/* =
Platform Communications Channel Table */=0A+#define ACPI_SIG_PMTT          =
 "PMTT"	/* Platform Memory Topology Table */=0A+#define ACPI_SIG_RASF      =
     "RASF"	/* RAS Feature table */=0A+=0A+#define ACPI_SIG_S3PT       =
    "S3PT"	/* S3 Performance (sub)Table */=0A+#define ACPI_SIG_PCCS   =
        "PCC"	/* PCC Shared Memory Region */=0A+=0A+/* Reserved table =
signatures */=0A+=0A+#define ACPI_SIG_CSRT           "CSRT"	/* Core =
System Resources Table */=0A+#define ACPI_SIG_MATR           "MATR"	/* =
Memory Address Translation Table */=0A+#define ACPI_SIG_MSDM           =
"MSDM"	/* Microsoft Data Management Table */=0A+#define ACPI_SIG_WPBT     =
      "WPBT"	/* Windows Platform Binary Table */=0A+=0A+/*=0A+ * All =
tables must be byte-packed to match the ACPI specification, since=0A+ * =
the tables are provided by the system BIOS.=0A+ */=0A+#pragma pack(1)=0A+=
=0A+/*=0A+ * Note: C bitfields are not used for this reason:=0A+ *=0A+ * =
"Bitfields are great and easy to read, but unfortunately the C language=0A+=
 * does not specify the layout of bitfields in memory, which means they =
are=0A+ * essentially useless for dealing with packed data in on-disk =
formats or=0A+ * binary wire protocols." (Or ACPI tables and buffers.) "If =
you ask me,=0A+ * this decision was a design error in C. Ritchie could =
have picked an order=0A+ * and stuck with it." Norman Ramsey.=0A+ * See =
http://stackoverflow.com/a/1053662/41661=0A+ */=0A+=0A+/*******************=
************************************************************=0A+ *=0A+ * =
BGRT - Boot Graphics Resource Table (ACPI 5.0)=0A+ *        Version 1=0A+ =
*=0A+ *********************************************************************=
*********/=0A+=0A+struct acpi_table_bgrt {=0A+	struct acpi_table_header =
header;	/* Common ACPI table header */=0A+	u16 version;=0A+	u8 =
status;=0A+	u8 image_type;=0A+	u64 image_address;=0A+	u32 =
image_offset_x;=0A+	u32 image_offset_y;=0A+};=0A+=0A+/*****************=
**************************************************************=0A+ *=0A+ * =
DRTM - Dynamic Root of Trust for Measurement table=0A+ *=0A+ **************=
****************************************************************/=0A+=0A+st=
ruct acpi_table_drtm {=0A+	struct acpi_table_header header;	/* =
Common ACPI table header */=0A+	u64 entry_base_address;=0A+	u64 =
entry_length;=0A+	u32 entry_address32;=0A+	u64 entry_address64=
;=0A+	u64 exit_address;=0A+	u64 log_area_address;=0A+	u32 =
log_area_length;=0A+	u64 arch_dependent_address;=0A+	u32 flags;=0A+};=0A=
+=0A+/* 1) Validated Tables List */=0A+=0A+struct acpi_drtm_vtl_list {=0A+	=
u32 validated_table_list_count;=0A+};=0A+=0A+/* 2) Resources List =
*/=0A+=0A+struct acpi_drtm_resource_list {=0A+	u32 resource_list_count;=0A=
+};=0A+=0A+/* 3) Platform-specific Identifiers List */=0A+=0A+struct =
acpi_drtm_id_list {=0A+	u32 id_list_count;=0A+};=0A+=0A+/******************=
*************************************************************=0A+ *=0A+ * =
FPDT - Firmware Performance Data Table (ACPI 5.0)=0A+ *        Version =
1=0A+ *=0A+ ***************************************************************=
***************/=0A+=0A+struct acpi_table_fpdt {=0A+	struct acpi_table_h=
eader header;	/* Common ACPI table header */=0A+};=0A+=0A+/* FPDT =
subtable header */=0A+=0A+struct acpi_fpdt_header {=0A+	u16 type;=0A+	u8 =
length;=0A+	u8 revision;=0A+};=0A+=0A+/* Values for Type field above =
*/=0A+=0A+enum acpi_fpdt_type {=0A+	ACPI_FPDT_TYPE_BOOT =3D 0,=0A+	=
ACPI_FPDT_TYPE_S3PERF =3D 1,=0A+};=0A+=0A+/*=0A+ * FPDT subtables=0A+ =
*/=0A+=0A+/* 0: Firmware Basic Boot Performance Record */=0A+=0A+struct =
acpi_fpdt_boot {=0A+	struct acpi_fpdt_header header;=0A+	u8 =
reserved[4];=0A+	u64 reset_end;=0A+	u64 load_start;=0A+	=
u64 startup_start;=0A+	u64 exit_services_entry;=0A+	u64 exit_services_e=
xit;=0A+};=0A+=0A+/* 1: S3 Performance Table Pointer Record */=0A+=0A+struc=
t acpi_fpdt_s3pt_ptr {=0A+	struct acpi_fpdt_header header;=0A+	u8 =
reserved[4];=0A+	u64 address;=0A+};=0A+=0A+/*=0A+ * S3PT - S3 =
Performance Table. This table is pointed to by the=0A+ * FPDT S3 Pointer =
Record above.=0A+ */=0A+struct acpi_table_s3pt {=0A+	u8 signature[4];	=
/* "S3PT" */=0A+	u32 length;=0A+};=0A+=0A+/*=0A+ * S3PT Subtables=0A=
+ */=0A+struct acpi_s3pt_header {=0A+	u16 type;=0A+	u8 length;=0A+	u8 =
revision;=0A+};=0A+=0A+/* Values for Type field above */=0A+=0A+enum =
acpi_s3pt_type {=0A+	ACPI_S3PT_TYPE_RESUME =3D 0,=0A+	ACPI_S3PT_T=
YPE_SUSPEND =3D 1,=0A+};=0A+=0A+struct acpi_s3pt_resume {=0A+	struct =
acpi_s3pt_header header;=0A+	u32 resume_count;=0A+	u64 full_resume;=0A=
+	u64 average_resume;=0A+};=0A+=0A+struct acpi_s3pt_suspend {=0A+	=
struct acpi_s3pt_header header;=0A+	u64 suspend_start;=0A+	u64 =
suspend_end;=0A+};=0A+=0A+/************************************************=
*******************************=0A+ *=0A+ * GTDT - Generic Timer Descriptio=
n Table (ACPI 5.0)=0A+ *        Version 1=0A+ *=0A+ ***********************=
*******************************************************/=0A+=0A+struct =
acpi_table_gtdt {=0A+	struct acpi_table_header header;	/* Common =
ACPI table header */=0A+	u64 address;=0A+	u32 flags;=0A+	=
u32 secure_pl1_interrupt;=0A+	u32 secure_pl1_flags;=0A+	u32 =
non_secure_pl1_interrupt;=0A+	u32 non_secure_pl1_flags;=0A+	u32 =
virtual_timer_interrupt;=0A+	u32 virtual_timer_flags;=0A+	u32 =
non_secure_pl2_interrupt;=0A+	u32 non_secure_pl2_flags;=0A+};=0A+=0A+/* =
Values for Flags field above */=0A+=0A+#define ACPI_GTDT_MAPPED_BLOCK_PRESE=
NT      1=0A+=0A+/* Values for all "TimerFlags" fields above */=0A+=0A+#def=
ine ACPI_GTDT_INTERRUPT_MODE            1=0A+#define ACPI_GTDT_INTERRUPT_PO=
LARITY        2=0A+=0A+/***************************************************=
****************************=0A+ *=0A+ * MPST - Memory Power State Table =
(ACPI 5.0)=0A+ *        Version 1=0A+ *=0A+ *******************************=
***********************************************/=0A+=0A+#define ACPI_MPST_C=
HANNEL_INFO \=0A+	u16                             reserved1; \=0A+	=
u8                              channel_id; \=0A+	u8                 =
             reserved2; \=0A+	u16                             power_node_=
count;=0A+=0A+/* Main table */=0A+=0A+struct acpi_table_mpst {=0A+	=
struct acpi_table_header header;	/* Common ACPI table header */=0A+	=
 ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel */=0A+};=0A+=0A+/=
* Memory Platform Communication Channel Info */=0A+=0A+struct acpi_mpst_cha=
nnel {=0A+	ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel =
*/=0A+};=0A+=0A+/* Memory Power Node Structure */=0A+=0A+struct acpi_mpst_p=
ower_node {=0A+	u8 flags;=0A+	u8 reserved1;=0A+	u16 node_id;=0A+	=
u32 length;=0A+	u64 range_address;=0A+	u64 range_length;=0A+	u8 =
num_power_states;=0A+	u8 num_physical_components;=0A+	u16 reserved2;=0A+}=
;=0A+=0A+/* Values for Flags field above */=0A+=0A+#define ACPI_MPST_ENABLE=
D               1=0A+#define ACPI_MPST_POWER_MANAGED         2=0A+#define =
ACPI_MPST_HOT_PLUG_CAPABLE      4=0A+=0A+/* Memory Power State Structure =
(follows POWER_NODE above) */=0A+=0A+struct acpi_mpst_power_state {=0A+	u8 =
power_state;=0A+	u8 info_index;=0A+};=0A+=0A+/* Physical Component =
ID Structure (follows POWER_STATE above) */=0A+=0A+struct acpi_mpst_compone=
nt {=0A+	u16 component_id;=0A+};=0A+=0A+/* Memory Power State =
Characteristics Structure (follows all POWER_NODEs) */=0A+=0A+struct =
acpi_mpst_data_hdr {=0A+	u16 characteristics_count;=0A+};=0A+=0A+str=
uct acpi_mpst_power_data {=0A+	u8 revision;=0A+	u8 flags;=0A+	=
u16 reserved1;=0A+	u32 average_power;=0A+	u32 power_saving;=0A+	=
u64 exit_latency;=0A+	u64 reserved2;=0A+};=0A+=0A+/* Values for Flags =
field above */=0A+=0A+#define ACPI_MPST_PRESERVE              1=0A+#define =
ACPI_MPST_AUTOENTRY             2=0A+#define ACPI_MPST_AUTOEXIT            =
  4=0A+=0A+/* Shared Memory Region (not part of an ACPI table) */=0A+=0A+st=
ruct acpi_mpst_shared {=0A+	u32 signature;=0A+	u16 pcc_command;=0A=
+	u16 pcc_status;=0A+	u16 command_register;=0A+	u16 =
status_register;=0A+	u16 power_state_id;=0A+	u16 power_node_id;=0A+	=
u64 energy_consumed;=0A+	u64 average_power;=0A+};=0A+=0A+/**********=
*********************************************************************=0A+ =
*=0A+ * PCCT - Platform Communications Channel Table (ACPI 5.0)=0A+ *      =
  Version 1=0A+ *=0A+ *****************************************************=
*************************/=0A+=0A+struct acpi_table_pcct {=0A+	struct =
acpi_table_header header;	/* Common ACPI table header */=0A+	=
u32 flags;=0A+	u32 latency;=0A+	u32 reserved;=0A+};=0A+=0A+/* =
Values for Flags field above */=0A+=0A+#define ACPI_PCCT_DOORBELL          =
    1=0A+=0A+/*=0A+ * PCCT subtables=0A+ */=0A+=0A+/* 0: Generic Communicat=
ions Subspace */=0A+=0A+struct acpi_pcct_subspace {=0A+	struct acpi_subtabl=
e_header header;=0A+	u8 reserved[6];=0A+	u64 base_address;=0A+	=
u64 length;=0A+	struct acpi_generic_address doorbell_register;=0A+	=
u64 preserve_mask;=0A+	u64 write_mask;=0A+};=0A+=0A+/*=0A+ * PCC memory =
structures (not part of the ACPI table)=0A+ */=0A+=0A+/* Shared Memory =
Region */=0A+=0A+struct acpi_pcct_shared_memory {=0A+	u32 signature;=0A+	=
u16 command;=0A+	u16 status;=0A+};=0A+=0A+/*************************=
******************************************************=0A+ *=0A+ * PMTT - =
Platform Memory Topology Table (ACPI 5.0)=0A+ *        Version 1=0A+ *=0A+ =
***************************************************************************=
***/=0A+=0A+struct acpi_table_pmtt {=0A+	struct acpi_table_header =
header;	/* Common ACPI table header */=0A+	u32 reserved;=0A+};=0A+=0A+=
/* Common header for PMTT subtables that follow main table */=0A+=0A+struct=
 acpi_pmtt_header {=0A+	u8 type;=0A+	u8 reserved1;=0A+	u16 =
length;=0A+	u16 flags;=0A+	u16 reserved2;=0A+};=0A+=0A+/* Values for =
Type field above */=0A+=0A+#define ACPI_PMTT_TYPE_SOCKET           =
0=0A+#define ACPI_PMTT_TYPE_CONTROLLER       1=0A+#define ACPI_PMTT_TYPE_DI=
MM             2=0A+#define ACPI_PMTT_TYPE_RESERVED         3	/* =
0x03-0xFF are reserved */=0A+=0A+/* Values for Flags field above */=0A+=0A+=
#define ACPI_PMTT_TOP_LEVEL             0x0001=0A+#define ACPI_PMTT_PHYSICA=
L              0x0002=0A+#define ACPI_PMTT_MEMORY_TYPE           0x000C=0A+=
=0A+/*=0A+ * PMTT subtables, correspond to Type in struct acpi_pmtt_header=
=0A+ */=0A+=0A+/* 0: Socket Structure */=0A+=0A+struct acpi_pmtt_socket =
{=0A+	struct acpi_pmtt_header header;=0A+	u16 socket_id;=0A+	=
u16 reserved;=0A+};=0A+=0A+/* 1: Memory Controller subtable */=0A+=0A+struc=
t acpi_pmtt_controller {=0A+	struct acpi_pmtt_header header;=0A+	=
u32 read_latency;=0A+	u32 write_latency;=0A+	u32 read_bandwidth;=0A+	=
u32 write_bandwidth;=0A+	u16 access_width;=0A+	u16 alignment;=0A+	=
u16 reserved;=0A+	u16 domain_count;=0A+};=0A+=0A+/* 1a: Proximity =
Domain substructure */=0A+=0A+struct acpi_pmtt_domain {=0A+	u32 =
proximity_domain;=0A+};=0A+=0A+/* 2: Physical Component Identifier (DIMM) =
*/=0A+=0A+struct acpi_pmtt_physical_component {=0A+	struct acpi_pmtt_he=
ader header;=0A+	u16 component_id;=0A+	u16 reserved;=0A+	=
u32 memory_size;=0A+	u32 bios_handle;=0A+};=0A+=0A+/********************=
***********************************************************=0A+ *=0A+ * =
RASF - RAS Feature Table (ACPI 5.0)=0A+ *        Version 1=0A+ *=0A+ =
***************************************************************************=
***/=0A+=0A+struct acpi_table_rasf {=0A+	struct acpi_table_header =
header;	/* Common ACPI table header */=0A+	u8 channel_id[12];=0A+};=0A=
+=0A+/* RASF Platform Communication Channel Shared Memory Region */=0A+=0A+=
struct acpi_rasf_shared_memory {=0A+	u32 signature;=0A+	u16 =
command;=0A+	u16 status;=0A+	u64 requested_address;=0A+	u64 =
requested_length;=0A+	u64 actual_address;=0A+	u64 actual_length;=0A+	=
u16 flags;=0A+	u8 speed;=0A+};=0A+=0A+/* Masks for Flags and Speed fields =
above */=0A+=0A+#define ACPI_RASF_SCRUBBER_RUNNING      1=0A+#define =
ACPI_RASF_SPEED                 (7<<1)=0A+=0A+/* Channel Commands =
*/=0A+=0A+enum acpi_rasf_commands {=0A+	ACPI_RASF_GET_RAS_CAPABILITIES =3D =
1,=0A+	ACPI_RASF_GET_PATROL_PARAMETERS =3D 2,=0A+	ACPI_RASF_START_PAT=
ROL_SCRUBBER =3D 3,=0A+	ACPI_RASF_STOP_PATROL_SCRUBBER =3D 4=0A+};=0A+=0A+/=
* Channel Command flags */=0A+=0A+#define ACPI_RASF_GENERATE_SCI          =
(1<<15)=0A+=0A+/* Status values */=0A+=0A+enum acpi_rasf_status {=0A+	=
ACPI_RASF_SUCCESS =3D 0,=0A+	ACPI_RASF_NOT_VALID =3D 1,=0A+	ACPI_RASF_N=
OT_SUPPORTED =3D 2,=0A+	ACPI_RASF_BUSY =3D 3,=0A+	ACPI_RASF_FAILED =
=3D 4,=0A+	ACPI_RASF_ABORTED =3D 5,=0A+	ACPI_RASF_INVALID_DATA =3D =
6=0A+};=0A+=0A+/* Status flags */=0A+=0A+#define ACPI_RASF_COMMAND_COMPLETE=
      (1)=0A+#define ACPI_RASF_SCI_DOORBELL          (1<<1)=0A+#define =
ACPI_RASF_ERROR                 (1<<2)=0A+#define ACPI_RASF_STATUS         =
       (0x1F<<3)=0A+=0A+/* Reset to default packing */=0A+=0A+#pragma =
pack()=0A+=0A+#endif				/* __ACTBL3_H__ */=0A
--=__Part7140BB30.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.xen.org
http://lists.xen.org/xen-devel

--=__Part7140BB30.0__=--


From xen-devel-bounces@lists.xen.org Mon Nov 05 16:50:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 16:50:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVPrq-0005k9-UZ; Mon, 05 Nov 2012 16:49:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVPrp-0005k4-S0
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 16:49:42 +0000
Received: from [85.158.143.99:51721] by server-1.bemta-4.messagelabs.com id
	7D/46-27934-52EE7905; Mon, 05 Nov 2012 16:49:41 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352134178!28152641!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14026 invoked from network); 5 Nov 2012 16:49:38 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-216.messagelabs.com with SMTP;
	5 Nov 2012 16:49:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 05 Nov 2012 16:49:37 +0000
Message-Id: <5097FC3002000078000A66AE@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Mon, 05 Nov 2012 16:49:36 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part7140BB30.0__="
Subject: [Xen-devel] [PATCH] x86/ACPI: invalidate BGRT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part7140BB30.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Since the image pointed to may (and generally will) live in boot
services memory (which we add to the global memory pool long before
ACPI tables get looked at), we should prevent Dom0 from trying to
retrieve the image data.

The alternatives would be to
- not add boot services memory to the global pool at all, or
- defer adding boot services memory until Dom0 indicates it is safe to
  do so, or
- find and parse the BGRT table in xen/arch/x86/efi/boot.c, and avoid
  adding that specific region to the E820 table.
None of these is really attractive, and as Xen commonly prints to the
video console anyway (without trying to avoid any regions on the
screen), the invalidation would need to be done conditionally anyway.

(xen/include/acpi/actbl3.h is a verbatim copy from Linux 3.7-rc4)

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -286,6 +286,25 @@ static int __init acpi_parse_hpet(struct
 #define	acpi_parse_hpet	NULL
 #endif
=20
+static int __init acpi_invalidate_bgrt(struct acpi_table_header *table)
+{
+	struct acpi_table_bgrt *bgrt_tbl =3D
+		container_of(table, struct acpi_table_bgrt, header);
+
+	if (table->length < sizeof(*bgrt_tbl))
+		return -1;
+
+	if (!(bgrt_tbl->status & 1))
+		return 0;
+
+	printk(KERN_INFO PREFIX "BGRT: invalidating v%d image at %#"PRIx64"=
 for (%u,%u)\n",
+	       bgrt_tbl->version, bgrt_tbl->image_address,
+	       bgrt_tbl->image_offset_x, bgrt_tbl->image_offset_y);
+	bgrt_tbl->status &=3D ~1;
+
+	return 0;
+}
+
 #ifdef CONFIG_ACPI_SLEEP
 #define acpi_fadt_copy_address(dst, src, len) do {			\
 	if (fadt->header.revision >=3D FADT2_REVISION_ID)			=
\
@@ -653,5 +672,7 @@ int __init acpi_boot_init(void)
=20
 	erst_init();
=20
+	acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt);
+
 	return 0;
 }
--- a/xen/include/acpi/actbl.h
+++ b/xen/include/acpi/actbl.h
@@ -314,6 +314,7 @@ enum acpi_prefered_pm_profiles {
=20
 #include <acpi/actbl1.h>
 #include <acpi/actbl2.h>
+#include <acpi/actbl3.h>
=20
 /*
  * Sizes of the various flavors of FADT. We need to look closely
--- /dev/null
+++ b/xen/include/acpi/actbl3.h
@@ -0,0 +1,557 @@
+/*************************************************************************=
*****
+ *
+ * Name: actbl3.h - ACPI Table Definitions
+ *
+ *************************************************************************=
****/
+
+/*
+ * Copyright (C) 2000 - 2012, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a =
disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for =
further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the =
names
+ *    of any contributors may be used to endorse or promote products =
derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENT=
IAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE =
GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#ifndef __ACTBL3_H__
+#define __ACTBL3_H__
+
+/*************************************************************************=
******
+ *
+ * Additional ACPI Tables (3)
+ *
+ * These tables are not consumed directly by the ACPICA subsystem, but =
are
+ * included here to support device drivers and the AML disassembler.
+ *
+ * The tables in this file are fully defined within the ACPI specification=
.
+ *
+ *************************************************************************=
*****/
+
+/*
+ * Values for description table header signatures for tables defined in =
this
+ * file. Useful because they make it more difficult to inadvertently type =
in
+ * the wrong signature.
+ */
+#define ACPI_SIG_BGRT           "BGRT"	/* Boot Graphics Resource Table */
+#define ACPI_SIG_DRTM           "DRTM"	/* Dynamic Root of Trust for =
Measurement table */
+#define ACPI_SIG_FPDT           "FPDT"	/* Firmware Performance Data Table =
*/
+#define ACPI_SIG_GTDT           "GTDT"	/* Generic Timer Description Table =
*/
+#define ACPI_SIG_MPST           "MPST"	/* Memory Power State Table */
+#define ACPI_SIG_PCCT           "PCCT"	/* Platform Communications Channel =
Table */
+#define ACPI_SIG_PMTT           "PMTT"	/* Platform Memory Topology Table =
*/
+#define ACPI_SIG_RASF           "RASF"	/* RAS Feature table */
+
+#define ACPI_SIG_S3PT           "S3PT"	/* S3 Performance (sub)Table */
+#define ACPI_SIG_PCCS           "PCC"	/* PCC Shared Memory Region */
+
+/* Reserved table signatures */
+
+#define ACPI_SIG_CSRT           "CSRT"	/* Core System Resources Table */
+#define ACPI_SIG_MATR           "MATR"	/* Memory Address Translation =
Table */
+#define ACPI_SIG_MSDM           "MSDM"	/* Microsoft Data Management Table =
*/
+#define ACPI_SIG_WPBT           "WPBT"	/* Windows Platform Binary Table =
*/
+
+/*
+ * All tables must be byte-packed to match the ACPI specification, since
+ * the tables are provided by the system BIOS.
+ */
+#pragma pack(1)
+
+/*
+ * Note: C bitfields are not used for this reason:
+ *
+ * "Bitfields are great and easy to read, but unfortunately the C =
language
+ * does not specify the layout of bitfields in memory, which means they =
are
+ * essentially useless for dealing with packed data in on-disk formats or
+ * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
+ * this decision was a design error in C. Ritchie could have picked an =
order
+ * and stuck with it." Norman Ramsey.
+ * See http://stackoverflow.com/a/1053662/41661=20
+ */
+
+/*************************************************************************=
******
+ *
+ * BGRT - Boot Graphics Resource Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_bgrt {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u16 version;
+	u8 status;
+	u8 image_type;
+	u64 image_address;
+	u32 image_offset_x;
+	u32 image_offset_y;
+};
+
+/*************************************************************************=
******
+ *
+ * DRTM - Dynamic Root of Trust for Measurement table
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_drtm {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u64 entry_base_address;
+	u64 entry_length;
+	u32 entry_address32;
+	u64 entry_address64;
+	u64 exit_address;
+	u64 log_area_address;
+	u32 log_area_length;
+	u64 arch_dependent_address;
+	u32 flags;
+};
+
+/* 1) Validated Tables List */
+
+struct acpi_drtm_vtl_list {
+	u32 validated_table_list_count;
+};
+
+/* 2) Resources List */
+
+struct acpi_drtm_resource_list {
+	u32 resource_list_count;
+};
+
+/* 3) Platform-specific Identifiers List */
+
+struct acpi_drtm_id_list {
+	u32 id_list_count;
+};
+
+/*************************************************************************=
******
+ *
+ * FPDT - Firmware Performance Data Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_fpdt {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+};
+
+/* FPDT subtable header */
+
+struct acpi_fpdt_header {
+	u16 type;
+	u8 length;
+	u8 revision;
+};
+
+/* Values for Type field above */
+
+enum acpi_fpdt_type {
+	ACPI_FPDT_TYPE_BOOT =3D 0,
+	ACPI_FPDT_TYPE_S3PERF =3D 1,
+};
+
+/*
+ * FPDT subtables
+ */
+
+/* 0: Firmware Basic Boot Performance Record */
+
+struct acpi_fpdt_boot {
+	struct acpi_fpdt_header header;
+	u8 reserved[4];
+	u64 reset_end;
+	u64 load_start;
+	u64 startup_start;
+	u64 exit_services_entry;
+	u64 exit_services_exit;
+};
+
+/* 1: S3 Performance Table Pointer Record */
+
+struct acpi_fpdt_s3pt_ptr {
+	struct acpi_fpdt_header header;
+	u8 reserved[4];
+	u64 address;
+};
+
+/*
+ * S3PT - S3 Performance Table. This table is pointed to by the
+ * FPDT S3 Pointer Record above.
+ */
+struct acpi_table_s3pt {
+	u8 signature[4];	/* "S3PT" */
+	u32 length;
+};
+
+/*
+ * S3PT Subtables
+ */
+struct acpi_s3pt_header {
+	u16 type;
+	u8 length;
+	u8 revision;
+};
+
+/* Values for Type field above */
+
+enum acpi_s3pt_type {
+	ACPI_S3PT_TYPE_RESUME =3D 0,
+	ACPI_S3PT_TYPE_SUSPEND =3D 1,
+};
+
+struct acpi_s3pt_resume {
+	struct acpi_s3pt_header header;
+	u32 resume_count;
+	u64 full_resume;
+	u64 average_resume;
+};
+
+struct acpi_s3pt_suspend {
+	struct acpi_s3pt_header header;
+	u64 suspend_start;
+	u64 suspend_end;
+};
+
+/*************************************************************************=
******
+ *
+ * GTDT - Generic Timer Description Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_gtdt {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u64 address;
+	u32 flags;
+	u32 secure_pl1_interrupt;
+	u32 secure_pl1_flags;
+	u32 non_secure_pl1_interrupt;
+	u32 non_secure_pl1_flags;
+	u32 virtual_timer_interrupt;
+	u32 virtual_timer_flags;
+	u32 non_secure_pl2_interrupt;
+	u32 non_secure_pl2_flags;
+};
+
+/* Values for Flags field above */
+
+#define ACPI_GTDT_MAPPED_BLOCK_PRESENT      1
+
+/* Values for all "TimerFlags" fields above */
+
+#define ACPI_GTDT_INTERRUPT_MODE            1
+#define ACPI_GTDT_INTERRUPT_POLARITY        2
+
+/*************************************************************************=
******
+ *
+ * MPST - Memory Power State Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+#define ACPI_MPST_CHANNEL_INFO \
+	u16                             reserved1; \
+	u8                              channel_id; \
+	u8                              reserved2; \
+	u16                             power_node_count;
+
+/* Main table */
+
+struct acpi_table_mpst {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	 ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel */
+};
+
+/* Memory Platform Communication Channel Info */
+
+struct acpi_mpst_channel {
+	ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel */
+};
+
+/* Memory Power Node Structure */
+
+struct acpi_mpst_power_node {
+	u8 flags;
+	u8 reserved1;
+	u16 node_id;
+	u32 length;
+	u64 range_address;
+	u64 range_length;
+	u8 num_power_states;
+	u8 num_physical_components;
+	u16 reserved2;
+};
+
+/* Values for Flags field above */
+
+#define ACPI_MPST_ENABLED               1
+#define ACPI_MPST_POWER_MANAGED         2
+#define ACPI_MPST_HOT_PLUG_CAPABLE      4
+
+/* Memory Power State Structure (follows POWER_NODE above) */
+
+struct acpi_mpst_power_state {
+	u8 power_state;
+	u8 info_index;
+};
+
+/* Physical Component ID Structure (follows POWER_STATE above) */
+
+struct acpi_mpst_component {
+	u16 component_id;
+};
+
+/* Memory Power State Characteristics Structure (follows all POWER_NODEs) =
*/
+
+struct acpi_mpst_data_hdr {
+	u16 characteristics_count;
+};
+
+struct acpi_mpst_power_data {
+	u8 revision;
+	u8 flags;
+	u16 reserved1;
+	u32 average_power;
+	u32 power_saving;
+	u64 exit_latency;
+	u64 reserved2;
+};
+
+/* Values for Flags field above */
+
+#define ACPI_MPST_PRESERVE              1
+#define ACPI_MPST_AUTOENTRY             2
+#define ACPI_MPST_AUTOEXIT              4
+
+/* Shared Memory Region (not part of an ACPI table) */
+
+struct acpi_mpst_shared {
+	u32 signature;
+	u16 pcc_command;
+	u16 pcc_status;
+	u16 command_register;
+	u16 status_register;
+	u16 power_state_id;
+	u16 power_node_id;
+	u64 energy_consumed;
+	u64 average_power;
+};
+
+/*************************************************************************=
******
+ *
+ * PCCT - Platform Communications Channel Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_pcct {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u32 flags;
+	u32 latency;
+	u32 reserved;
+};
+
+/* Values for Flags field above */
+
+#define ACPI_PCCT_DOORBELL              1
+
+/*
+ * PCCT subtables
+ */
+
+/* 0: Generic Communications Subspace */
+
+struct acpi_pcct_subspace {
+	struct acpi_subtable_header header;
+	u8 reserved[6];
+	u64 base_address;
+	u64 length;
+	struct acpi_generic_address doorbell_register;
+	u64 preserve_mask;
+	u64 write_mask;
+};
+
+/*
+ * PCC memory structures (not part of the ACPI table)
+ */
+
+/* Shared Memory Region */
+
+struct acpi_pcct_shared_memory {
+	u32 signature;
+	u16 command;
+	u16 status;
+};
+
+/*************************************************************************=
******
+ *
+ * PMTT - Platform Memory Topology Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_pmtt {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u32 reserved;
+};
+
+/* Common header for PMTT subtables that follow main table */
+
+struct acpi_pmtt_header {
+	u8 type;
+	u8 reserved1;
+	u16 length;
+	u16 flags;
+	u16 reserved2;
+};
+
+/* Values for Type field above */
+
+#define ACPI_PMTT_TYPE_SOCKET           0
+#define ACPI_PMTT_TYPE_CONTROLLER       1
+#define ACPI_PMTT_TYPE_DIMM             2
+#define ACPI_PMTT_TYPE_RESERVED         3	/* 0x03-0xFF are reserved =
*/
+
+/* Values for Flags field above */
+
+#define ACPI_PMTT_TOP_LEVEL             0x0001
+#define ACPI_PMTT_PHYSICAL              0x0002
+#define ACPI_PMTT_MEMORY_TYPE           0x000C
+
+/*
+ * PMTT subtables, correspond to Type in struct acpi_pmtt_header
+ */
+
+/* 0: Socket Structure */
+
+struct acpi_pmtt_socket {
+	struct acpi_pmtt_header header;
+	u16 socket_id;
+	u16 reserved;
+};
+
+/* 1: Memory Controller subtable */
+
+struct acpi_pmtt_controller {
+	struct acpi_pmtt_header header;
+	u32 read_latency;
+	u32 write_latency;
+	u32 read_bandwidth;
+	u32 write_bandwidth;
+	u16 access_width;
+	u16 alignment;
+	u16 reserved;
+	u16 domain_count;
+};
+
+/* 1a: Proximity Domain substructure */
+
+struct acpi_pmtt_domain {
+	u32 proximity_domain;
+};
+
+/* 2: Physical Component Identifier (DIMM) */
+
+struct acpi_pmtt_physical_component {
+	struct acpi_pmtt_header header;
+	u16 component_id;
+	u16 reserved;
+	u32 memory_size;
+	u32 bios_handle;
+};
+
+/*************************************************************************=
******
+ *
+ * RASF - RAS Feature Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_rasf {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u8 channel_id[12];
+};
+
+/* RASF Platform Communication Channel Shared Memory Region */
+
+struct acpi_rasf_shared_memory {
+	u32 signature;
+	u16 command;
+	u16 status;
+	u64 requested_address;
+	u64 requested_length;
+	u64 actual_address;
+	u64 actual_length;
+	u16 flags;
+	u8 speed;
+};
+
+/* Masks for Flags and Speed fields above */
+
+#define ACPI_RASF_SCRUBBER_RUNNING      1
+#define ACPI_RASF_SPEED                 (7<<1)
+
+/* Channel Commands */
+
+enum acpi_rasf_commands {
+	ACPI_RASF_GET_RAS_CAPABILITIES =3D 1,
+	ACPI_RASF_GET_PATROL_PARAMETERS =3D 2,
+	ACPI_RASF_START_PATROL_SCRUBBER =3D 3,
+	ACPI_RASF_STOP_PATROL_SCRUBBER =3D 4
+};
+
+/* Channel Command flags */
+
+#define ACPI_RASF_GENERATE_SCI          (1<<15)
+
+/* Status values */
+
+enum acpi_rasf_status {
+	ACPI_RASF_SUCCESS =3D 0,
+	ACPI_RASF_NOT_VALID =3D 1,
+	ACPI_RASF_NOT_SUPPORTED =3D 2,
+	ACPI_RASF_BUSY =3D 3,
+	ACPI_RASF_FAILED =3D 4,
+	ACPI_RASF_ABORTED =3D 5,
+	ACPI_RASF_INVALID_DATA =3D 6
+};
+
+/* Status flags */
+
+#define ACPI_RASF_COMMAND_COMPLETE      (1)
+#define ACPI_RASF_SCI_DOORBELL          (1<<1)
+#define ACPI_RASF_ERROR                 (1<<2)
+#define ACPI_RASF_STATUS                (0x1F<<3)
+
+/* Reset to default packing */
+
+#pragma pack()
+
+#endif				/* __ACTBL3_H__ */



--=__Part7140BB30.0__=
Content-Type: text/plain; name="ACPI-BGRT-invalidate.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="ACPI-BGRT-invalidate.patch"

x86/ACPI: invalidate BGRT=0A=0ASince the image pointed to may (and =
generally will) live in boot=0Aservices memory (which we add to the global =
memory pool long before=0AACPI tables get looked at), we should prevent =
Dom0 from trying to=0Aretrieve the image data.=0A=0AThe alternatives would =
be to=0A- not add boot services memory to the global pool at all, or=0A- =
defer adding boot services memory until Dom0 indicates it is safe to=0A  =
do so, or=0A- find and parse the BGRT table in xen/arch/x86/efi/boot.c, =
and avoid=0A  adding that specific region to the E820 table.=0ANone of =
these is really attractive, and as Xen commonly prints to the=0Avideo =
console anyway (without trying to avoid any regions on the=0Ascreen), the =
invalidation would need to be done conditionally anyway.=0A=0A(xen/include/=
acpi/actbl3.h is a verbatim copy from Linux 3.7-rc4)=0A=0ASigned-off-by: =
Jan Beulich <jbeulich@suse.com>=0A=0A--- a/xen/arch/x86/acpi/boot.c=0A+++ =
b/xen/arch/x86/acpi/boot.c=0A@@ -286,6 +286,25 @@ static int __init =
acpi_parse_hpet(struct=0A #define	acpi_parse_hpet	NULL=0A #endif=0A =
=0A+static int __init acpi_invalidate_bgrt(struct acpi_table_header =
*table)=0A+{=0A+	struct acpi_table_bgrt *bgrt_tbl =3D=0A+		=
container_of(table, struct acpi_table_bgrt, header);=0A+=0A+	if =
(table->length < sizeof(*bgrt_tbl))=0A+		return -1;=0A+=0A+	if =
(!(bgrt_tbl->status & 1))=0A+		return 0;=0A+=0A+	printk(KERN=
_INFO PREFIX "BGRT: invalidating v%d image at %#"PRIx64" for (%u,%u)\n",=0A=
+	       bgrt_tbl->version, bgrt_tbl->image_address,=0A+	       =
bgrt_tbl->image_offset_x, bgrt_tbl->image_offset_y);=0A+	bgrt_tbl->s=
tatus &=3D ~1;=0A+=0A+	return 0;=0A+}=0A+=0A #ifdef CONFIG_ACPI_SLEEP=0A =
#define acpi_fadt_copy_address(dst, src, len) do {			=
\=0A 	if (fadt->header.revision >=3D FADT2_REVISION_ID)			=
\=0A@@ -653,5 +672,7 @@ int __init acpi_boot_init(void)=0A =0A 	erst_init()=
;=0A =0A+	acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt);=0A+=
=0A 	return 0;=0A }=0A--- a/xen/include/acpi/actbl.h=0A+++ b/xen/include=
/acpi/actbl.h=0A@@ -314,6 +314,7 @@ enum acpi_prefered_pm_profiles {=0A =
=0A #include <acpi/actbl1.h>=0A #include <acpi/actbl2.h>=0A+#include =
<acpi/actbl3.h>=0A =0A /*=0A  * Sizes of the various flavors of FADT. We =
need to look closely=0A--- /dev/null=0A+++ b/xen/include/acpi/actbl3.h=0A@@=
 -0,0 +1,557 @@=0A+/*******************************************************=
***********************=0A+ *=0A+ * Name: actbl3.h - ACPI Table Definitions=
=0A+ *=0A+ ****************************************************************=
*************/=0A+=0A+/*=0A+ * Copyright (C) 2000 - 2012, Intel Corp.=0A+ =
* All rights reserved.=0A+ *=0A+ * Redistribution and use in source and =
binary forms, with or without=0A+ * modification, are permitted provided =
that the following conditions=0A+ * are met:=0A+ * 1. Redistributions of =
source code must retain the above copyright=0A+ *    notice, this list of =
conditions, and the following disclaimer,=0A+ *    without modification.=0A=
+ * 2. Redistributions in binary form must reproduce at minimum a =
disclaimer=0A+ *    substantially similar to the "NO WARRANTY" disclaimer =
below=0A+ *    ("Disclaimer") and any redistribution must be conditioned =
upon=0A+ *    including a substantially similar Disclaimer requirement for =
further=0A+ *    binary redistribution.=0A+ * 3. Neither the names of the =
above-listed copyright holders nor the names=0A+ *    of any contributors =
may be used to endorse or promote products derived=0A+ *    from this =
software without specific prior written permission.=0A+ *=0A+ * Alternative=
ly, this software may be distributed under the terms of the=0A+ * GNU =
General Public License ("GPL") version 2 as published by the Free=0A+ * =
Software Foundation.=0A+ *=0A+ * NO WARRANTY=0A+ * THIS SOFTWARE IS =
PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=0A+ * "AS IS" AND ANY =
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT=0A+ * LIMITED TO, THE =
IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR=0A+ * A PARTICULAR =
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT=0A+ * HOLDERS OR =
CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL=0A+ * =
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE =
GOODS=0A+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS =
INTERRUPTION)=0A+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER =
IN CONTRACT,=0A+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR =
OTHERWISE) ARISING=0A+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN =
IF ADVISED OF THE=0A+ * POSSIBILITY OF SUCH DAMAGES.=0A+ */=0A+=0A+#ifndef =
__ACTBL3_H__=0A+#define __ACTBL3_H__=0A+=0A+/******************************=
*************************************************=0A+ *=0A+ * Additional =
ACPI Tables (3)=0A+ *=0A+ * These tables are not consumed directly by the =
ACPICA subsystem, but are=0A+ * included here to support device drivers =
and the AML disassembler.=0A+ *=0A+ * The tables in this file are fully =
defined within the ACPI specification.=0A+ *=0A+ **************************=
****************************************************/=0A+=0A+/*=0A+ * =
Values for description table header signatures for tables defined in =
this=0A+ * file. Useful because they make it more difficult to inadvertentl=
y type in=0A+ * the wrong signature.=0A+ */=0A+#define ACPI_SIG_BGRT       =
    "BGRT"	/* Boot Graphics Resource Table */=0A+#define ACPI_SIG_DRTM=
           "DRTM"	/* Dynamic Root of Trust for Measurement table =
*/=0A+#define ACPI_SIG_FPDT           "FPDT"	/* Firmware Performance =
Data Table */=0A+#define ACPI_SIG_GTDT           "GTDT"	/* Generic Timer =
Description Table */=0A+#define ACPI_SIG_MPST           "MPST"	/* Memory =
Power State Table */=0A+#define ACPI_SIG_PCCT           "PCCT"	/* =
Platform Communications Channel Table */=0A+#define ACPI_SIG_PMTT          =
 "PMTT"	/* Platform Memory Topology Table */=0A+#define ACPI_SIG_RASF      =
     "RASF"	/* RAS Feature table */=0A+=0A+#define ACPI_SIG_S3PT       =
    "S3PT"	/* S3 Performance (sub)Table */=0A+#define ACPI_SIG_PCCS   =
        "PCC"	/* PCC Shared Memory Region */=0A+=0A+/* Reserved table =
signatures */=0A+=0A+#define ACPI_SIG_CSRT           "CSRT"	/* Core =
System Resources Table */=0A+#define ACPI_SIG_MATR           "MATR"	/* =
Memory Address Translation Table */=0A+#define ACPI_SIG_MSDM           =
"MSDM"	/* Microsoft Data Management Table */=0A+#define ACPI_SIG_WPBT     =
      "WPBT"	/* Windows Platform Binary Table */=0A+=0A+/*=0A+ * All =
tables must be byte-packed to match the ACPI specification, since=0A+ * =
the tables are provided by the system BIOS.=0A+ */=0A+#pragma pack(1)=0A+=
=0A+/*=0A+ * Note: C bitfields are not used for this reason:=0A+ *=0A+ * =
"Bitfields are great and easy to read, but unfortunately the C language=0A+=
 * does not specify the layout of bitfields in memory, which means they =
are=0A+ * essentially useless for dealing with packed data in on-disk =
formats or=0A+ * binary wire protocols." (Or ACPI tables and buffers.) "If =
you ask me,=0A+ * this decision was a design error in C. Ritchie could =
have picked an order=0A+ * and stuck with it." Norman Ramsey.=0A+ * See =
http://stackoverflow.com/a/1053662/41661=0A+ */=0A+=0A+/*******************=
************************************************************=0A+ *=0A+ * =
BGRT - Boot Graphics Resource Table (ACPI 5.0)=0A+ *        Version 1=0A+ =
*=0A+ *********************************************************************=
*********/=0A+=0A+struct acpi_table_bgrt {=0A+	struct acpi_table_header =
header;	/* Common ACPI table header */=0A+	u16 version;=0A+	u8 =
status;=0A+	u8 image_type;=0A+	u64 image_address;=0A+	u32 =
image_offset_x;=0A+	u32 image_offset_y;=0A+};=0A+=0A+/*****************=
**************************************************************=0A+ *=0A+ * =
DRTM - Dynamic Root of Trust for Measurement table=0A+ *=0A+ **************=
****************************************************************/=0A+=0A+st=
ruct acpi_table_drtm {=0A+	struct acpi_table_header header;	/* =
Common ACPI table header */=0A+	u64 entry_base_address;=0A+	u64 =
entry_length;=0A+	u32 entry_address32;=0A+	u64 entry_address64=
;=0A+	u64 exit_address;=0A+	u64 log_area_address;=0A+	u32 =
log_area_length;=0A+	u64 arch_dependent_address;=0A+	u32 flags;=0A+};=0A=
+=0A+/* 1) Validated Tables List */=0A+=0A+struct acpi_drtm_vtl_list {=0A+	=
u32 validated_table_list_count;=0A+};=0A+=0A+/* 2) Resources List =
*/=0A+=0A+struct acpi_drtm_resource_list {=0A+	u32 resource_list_count;=0A=
+};=0A+=0A+/* 3) Platform-specific Identifiers List */=0A+=0A+struct =
acpi_drtm_id_list {=0A+	u32 id_list_count;=0A+};=0A+=0A+/******************=
*************************************************************=0A+ *=0A+ * =
FPDT - Firmware Performance Data Table (ACPI 5.0)=0A+ *        Version =
1=0A+ *=0A+ ***************************************************************=
***************/=0A+=0A+struct acpi_table_fpdt {=0A+	struct acpi_table_h=
eader header;	/* Common ACPI table header */=0A+};=0A+=0A+/* FPDT =
subtable header */=0A+=0A+struct acpi_fpdt_header {=0A+	u16 type;=0A+	u8 =
length;=0A+	u8 revision;=0A+};=0A+=0A+/* Values for Type field above =
*/=0A+=0A+enum acpi_fpdt_type {=0A+	ACPI_FPDT_TYPE_BOOT =3D 0,=0A+	=
ACPI_FPDT_TYPE_S3PERF =3D 1,=0A+};=0A+=0A+/*=0A+ * FPDT subtables=0A+ =
*/=0A+=0A+/* 0: Firmware Basic Boot Performance Record */=0A+=0A+struct =
acpi_fpdt_boot {=0A+	struct acpi_fpdt_header header;=0A+	u8 =
reserved[4];=0A+	u64 reset_end;=0A+	u64 load_start;=0A+	=
u64 startup_start;=0A+	u64 exit_services_entry;=0A+	u64 exit_services_e=
xit;=0A+};=0A+=0A+/* 1: S3 Performance Table Pointer Record */=0A+=0A+struc=
t acpi_fpdt_s3pt_ptr {=0A+	struct acpi_fpdt_header header;=0A+	u8 =
reserved[4];=0A+	u64 address;=0A+};=0A+=0A+/*=0A+ * S3PT - S3 =
Performance Table. This table is pointed to by the=0A+ * FPDT S3 Pointer =
Record above.=0A+ */=0A+struct acpi_table_s3pt {=0A+	u8 signature[4];	=
/* "S3PT" */=0A+	u32 length;=0A+};=0A+=0A+/*=0A+ * S3PT Subtables=0A=
+ */=0A+struct acpi_s3pt_header {=0A+	u16 type;=0A+	u8 length;=0A+	u8 =
revision;=0A+};=0A+=0A+/* Values for Type field above */=0A+=0A+enum =
acpi_s3pt_type {=0A+	ACPI_S3PT_TYPE_RESUME =3D 0,=0A+	ACPI_S3PT_T=
YPE_SUSPEND =3D 1,=0A+};=0A+=0A+struct acpi_s3pt_resume {=0A+	struct =
acpi_s3pt_header header;=0A+	u32 resume_count;=0A+	u64 full_resume;=0A=
+	u64 average_resume;=0A+};=0A+=0A+struct acpi_s3pt_suspend {=0A+	=
struct acpi_s3pt_header header;=0A+	u64 suspend_start;=0A+	u64 =
suspend_end;=0A+};=0A+=0A+/************************************************=
*******************************=0A+ *=0A+ * GTDT - Generic Timer Descriptio=
n Table (ACPI 5.0)=0A+ *        Version 1=0A+ *=0A+ ***********************=
*******************************************************/=0A+=0A+struct =
acpi_table_gtdt {=0A+	struct acpi_table_header header;	/* Common =
ACPI table header */=0A+	u64 address;=0A+	u32 flags;=0A+	=
u32 secure_pl1_interrupt;=0A+	u32 secure_pl1_flags;=0A+	u32 =
non_secure_pl1_interrupt;=0A+	u32 non_secure_pl1_flags;=0A+	u32 =
virtual_timer_interrupt;=0A+	u32 virtual_timer_flags;=0A+	u32 =
non_secure_pl2_interrupt;=0A+	u32 non_secure_pl2_flags;=0A+};=0A+=0A+/* =
Values for Flags field above */=0A+=0A+#define ACPI_GTDT_MAPPED_BLOCK_PRESE=
NT      1=0A+=0A+/* Values for all "TimerFlags" fields above */=0A+=0A+#def=
ine ACPI_GTDT_INTERRUPT_MODE            1=0A+#define ACPI_GTDT_INTERRUPT_PO=
LARITY        2=0A+=0A+/***************************************************=
****************************=0A+ *=0A+ * MPST - Memory Power State Table =
(ACPI 5.0)=0A+ *        Version 1=0A+ *=0A+ *******************************=
***********************************************/=0A+=0A+#define ACPI_MPST_C=
HANNEL_INFO \=0A+	u16                             reserved1; \=0A+	=
u8                              channel_id; \=0A+	u8                 =
             reserved2; \=0A+	u16                             power_node_=
count;=0A+=0A+/* Main table */=0A+=0A+struct acpi_table_mpst {=0A+	=
struct acpi_table_header header;	/* Common ACPI table header */=0A+	=
 ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel */=0A+};=0A+=0A+/=
* Memory Platform Communication Channel Info */=0A+=0A+struct acpi_mpst_cha=
nnel {=0A+	ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel =
*/=0A+};=0A+=0A+/* Memory Power Node Structure */=0A+=0A+struct acpi_mpst_p=
ower_node {=0A+	u8 flags;=0A+	u8 reserved1;=0A+	u16 node_id;=0A+	=
u32 length;=0A+	u64 range_address;=0A+	u64 range_length;=0A+	u8 =
num_power_states;=0A+	u8 num_physical_components;=0A+	u16 reserved2;=0A+}=
;=0A+=0A+/* Values for Flags field above */=0A+=0A+#define ACPI_MPST_ENABLE=
D               1=0A+#define ACPI_MPST_POWER_MANAGED         2=0A+#define =
ACPI_MPST_HOT_PLUG_CAPABLE      4=0A+=0A+/* Memory Power State Structure =
(follows POWER_NODE above) */=0A+=0A+struct acpi_mpst_power_state {=0A+	u8 =
power_state;=0A+	u8 info_index;=0A+};=0A+=0A+/* Physical Component =
ID Structure (follows POWER_STATE above) */=0A+=0A+struct acpi_mpst_compone=
nt {=0A+	u16 component_id;=0A+};=0A+=0A+/* Memory Power State =
Characteristics Structure (follows all POWER_NODEs) */=0A+=0A+struct =
acpi_mpst_data_hdr {=0A+	u16 characteristics_count;=0A+};=0A+=0A+str=
uct acpi_mpst_power_data {=0A+	u8 revision;=0A+	u8 flags;=0A+	=
u16 reserved1;=0A+	u32 average_power;=0A+	u32 power_saving;=0A+	=
u64 exit_latency;=0A+	u64 reserved2;=0A+};=0A+=0A+/* Values for Flags =
field above */=0A+=0A+#define ACPI_MPST_PRESERVE              1=0A+#define =
ACPI_MPST_AUTOENTRY             2=0A+#define ACPI_MPST_AUTOEXIT            =
  4=0A+=0A+/* Shared Memory Region (not part of an ACPI table) */=0A+=0A+st=
ruct acpi_mpst_shared {=0A+	u32 signature;=0A+	u16 pcc_command;=0A=
+	u16 pcc_status;=0A+	u16 command_register;=0A+	u16 =
status_register;=0A+	u16 power_state_id;=0A+	u16 power_node_id;=0A+	=
u64 energy_consumed;=0A+	u64 average_power;=0A+};=0A+=0A+/**********=
*********************************************************************=0A+ =
*=0A+ * PCCT - Platform Communications Channel Table (ACPI 5.0)=0A+ *      =
  Version 1=0A+ *=0A+ *****************************************************=
*************************/=0A+=0A+struct acpi_table_pcct {=0A+	struct =
acpi_table_header header;	/* Common ACPI table header */=0A+	=
u32 flags;=0A+	u32 latency;=0A+	u32 reserved;=0A+};=0A+=0A+/* =
Values for Flags field above */=0A+=0A+#define ACPI_PCCT_DOORBELL          =
    1=0A+=0A+/*=0A+ * PCCT subtables=0A+ */=0A+=0A+/* 0: Generic Communicat=
ions Subspace */=0A+=0A+struct acpi_pcct_subspace {=0A+	struct acpi_subtabl=
e_header header;=0A+	u8 reserved[6];=0A+	u64 base_address;=0A+	=
u64 length;=0A+	struct acpi_generic_address doorbell_register;=0A+	=
u64 preserve_mask;=0A+	u64 write_mask;=0A+};=0A+=0A+/*=0A+ * PCC memory =
structures (not part of the ACPI table)=0A+ */=0A+=0A+/* Shared Memory =
Region */=0A+=0A+struct acpi_pcct_shared_memory {=0A+	u32 signature;=0A+	=
u16 command;=0A+	u16 status;=0A+};=0A+=0A+/*************************=
******************************************************=0A+ *=0A+ * PMTT - =
Platform Memory Topology Table (ACPI 5.0)=0A+ *        Version 1=0A+ *=0A+ =
***************************************************************************=
***/=0A+=0A+struct acpi_table_pmtt {=0A+	struct acpi_table_header =
header;	/* Common ACPI table header */=0A+	u32 reserved;=0A+};=0A+=0A+=
/* Common header for PMTT subtables that follow main table */=0A+=0A+struct=
 acpi_pmtt_header {=0A+	u8 type;=0A+	u8 reserved1;=0A+	u16 =
length;=0A+	u16 flags;=0A+	u16 reserved2;=0A+};=0A+=0A+/* Values for =
Type field above */=0A+=0A+#define ACPI_PMTT_TYPE_SOCKET           =
0=0A+#define ACPI_PMTT_TYPE_CONTROLLER       1=0A+#define ACPI_PMTT_TYPE_DI=
MM             2=0A+#define ACPI_PMTT_TYPE_RESERVED         3	/* =
0x03-0xFF are reserved */=0A+=0A+/* Values for Flags field above */=0A+=0A+=
#define ACPI_PMTT_TOP_LEVEL             0x0001=0A+#define ACPI_PMTT_PHYSICA=
L              0x0002=0A+#define ACPI_PMTT_MEMORY_TYPE           0x000C=0A+=
=0A+/*=0A+ * PMTT subtables, correspond to Type in struct acpi_pmtt_header=
=0A+ */=0A+=0A+/* 0: Socket Structure */=0A+=0A+struct acpi_pmtt_socket =
{=0A+	struct acpi_pmtt_header header;=0A+	u16 socket_id;=0A+	=
u16 reserved;=0A+};=0A+=0A+/* 1: Memory Controller subtable */=0A+=0A+struc=
t acpi_pmtt_controller {=0A+	struct acpi_pmtt_header header;=0A+	=
u32 read_latency;=0A+	u32 write_latency;=0A+	u32 read_bandwidth;=0A+	=
u32 write_bandwidth;=0A+	u16 access_width;=0A+	u16 alignment;=0A+	=
u16 reserved;=0A+	u16 domain_count;=0A+};=0A+=0A+/* 1a: Proximity =
Domain substructure */=0A+=0A+struct acpi_pmtt_domain {=0A+	u32 =
proximity_domain;=0A+};=0A+=0A+/* 2: Physical Component Identifier (DIMM) =
*/=0A+=0A+struct acpi_pmtt_physical_component {=0A+	struct acpi_pmtt_he=
ader header;=0A+	u16 component_id;=0A+	u16 reserved;=0A+	=
u32 memory_size;=0A+	u32 bios_handle;=0A+};=0A+=0A+/********************=
***********************************************************=0A+ *=0A+ * =
RASF - RAS Feature Table (ACPI 5.0)=0A+ *        Version 1=0A+ *=0A+ =
***************************************************************************=
***/=0A+=0A+struct acpi_table_rasf {=0A+	struct acpi_table_header =
header;	/* Common ACPI table header */=0A+	u8 channel_id[12];=0A+};=0A=
+=0A+/* RASF Platform Communication Channel Shared Memory Region */=0A+=0A+=
struct acpi_rasf_shared_memory {=0A+	u32 signature;=0A+	u16 =
command;=0A+	u16 status;=0A+	u64 requested_address;=0A+	u64 =
requested_length;=0A+	u64 actual_address;=0A+	u64 actual_length;=0A+	=
u16 flags;=0A+	u8 speed;=0A+};=0A+=0A+/* Masks for Flags and Speed fields =
above */=0A+=0A+#define ACPI_RASF_SCRUBBER_RUNNING      1=0A+#define =
ACPI_RASF_SPEED                 (7<<1)=0A+=0A+/* Channel Commands =
*/=0A+=0A+enum acpi_rasf_commands {=0A+	ACPI_RASF_GET_RAS_CAPABILITIES =3D =
1,=0A+	ACPI_RASF_GET_PATROL_PARAMETERS =3D 2,=0A+	ACPI_RASF_START_PAT=
ROL_SCRUBBER =3D 3,=0A+	ACPI_RASF_STOP_PATROL_SCRUBBER =3D 4=0A+};=0A+=0A+/=
* Channel Command flags */=0A+=0A+#define ACPI_RASF_GENERATE_SCI          =
(1<<15)=0A+=0A+/* Status values */=0A+=0A+enum acpi_rasf_status {=0A+	=
ACPI_RASF_SUCCESS =3D 0,=0A+	ACPI_RASF_NOT_VALID =3D 1,=0A+	ACPI_RASF_N=
OT_SUPPORTED =3D 2,=0A+	ACPI_RASF_BUSY =3D 3,=0A+	ACPI_RASF_FAILED =
=3D 4,=0A+	ACPI_RASF_ABORTED =3D 5,=0A+	ACPI_RASF_INVALID_DATA =3D =
6=0A+};=0A+=0A+/* Status flags */=0A+=0A+#define ACPI_RASF_COMMAND_COMPLETE=
      (1)=0A+#define ACPI_RASF_SCI_DOORBELL          (1<<1)=0A+#define =
ACPI_RASF_ERROR                 (1<<2)=0A+#define ACPI_RASF_STATUS         =
       (0x1F<<3)=0A+=0A+/* Reset to default packing */=0A+=0A+#pragma =
pack()=0A+=0A+#endif				/* __ACTBL3_H__ */=0A
--=__Part7140BB30.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.xen.org
http://lists.xen.org/xen-devel

--=__Part7140BB30.0__=--


From xen-devel-bounces@lists.xen.org Mon Nov 05 16:54:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 16:54:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVPvq-0005th-R2; Mon, 05 Nov 2012 16:53:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVPvp-0005tZ-KQ
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 16:53:49 +0000
Received: from [85.158.143.99:21087] by server-2.bemta-4.messagelabs.com id
	8E/3D-28922-C1FE7905; Mon, 05 Nov 2012 16:53:48 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352134427!25341758!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19061 invoked from network); 5 Nov 2012 16:53:47 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-216.messagelabs.com with SMTP;
	5 Nov 2012 16:53:47 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 05 Nov 2012 16:53:47 +0000
Message-Id: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Mon, 05 Nov 2012 16:53:45 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <wei.huang2@amd.com>,<weiwang.dd@gmail.com>,
 <xiantao.zhang@intel.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part49788309.4__="
Cc: Tim Deegan <tim@xen.org>, Dario Faggioli <raistlin@linux.it>,
	xen-devel <xen-devel@lists.xen.org>
Subject: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on faults
 for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part49788309.4__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Under the assumption that in these cases recurring faults aren't a
security issue and it can be expected that the drivers there are going
to try to take care of the problem.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -625,6 +625,18 @@ static void parse_event_log_entry(struct
         for ( bdf =3D 0; bdf < ivrs_bdf_entries; bdf++ )
             if ( get_dma_requestor_id(iommu->seg, bdf) =3D=3D device_id )
             {
+                const struct pci_dev *pdev;
+
+                spin_lock(&pcidevs_lock);
+                pdev =3D pci_get_pdev(iommu->seg, PCI_BUS(bdf), PCI_DEVFN2=
(bdf));
+                if ( pdev && pdev->domain !=3D dom_xen &&
+                     (!pdev->domain || !IS_PRIV(pdev->domain)) )
+                    pdev =3D NULL;
+                spin_unlock(&pcidevs_lock);
+
+                if ( pdev )
+                    continue;
+
                 cword =3D pci_conf_read16(iommu->seg, PCI_BUS(bdf),
                                         PCI_SLOT(bdf), PCI_FUNC(bdf),
                                         PCI_COMMAND);
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -916,7 +916,8 @@ static void __do_iommu_page_fault(struct
     reg =3D cap_fault_reg_offset(iommu->cap);
     while (1)
     {
-        u8 fault_reason;
+        const struct pci_dev *pdev;
+        u8 fault_reason, bus;
         u16 source_id, cword;
         u32 data;
         u64 guest_addr;
@@ -950,14 +951,27 @@ static void __do_iommu_page_fault(struct
         iommu_page_fault_do_one(iommu, type, fault_reason,
                                 source_id, guest_addr);
=20
-        /* Tell the device to stop DMAing; we can't rely on the guest to
-         * control it for us. */
-        cword =3D pci_conf_read16(iommu->intel->drhd->segment,
-                                PCI_BUS(source_id), PCI_SLOT(source_id),
-                                PCI_FUNC(source_id), PCI_COMMAND);
-        pci_conf_write16(iommu->intel->drhd->segment, PCI_BUS(source_id),
-                         PCI_SLOT(source_id), PCI_FUNC(source_id),
-                         PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
+        bus =3D PCI_BUS(source_id);
+
+        spin_lock(&pcidevs_lock);
+        pdev =3D pci_get_pdev(iommu->intel->drhd->segment, bus,
+                            PCI_DEVFN2(source_id));
+        if ( pdev && pdev->domain !=3D dom_xen &&
+             (!pdev->domain || !IS_PRIV(pdev->domain)) )
+            pdev =3D NULL;
+        spin_unlock(&pcidevs_lock);
+
+        if ( !pdev )
+        {
+            /* Tell the device to stop DMAing; we can't rely on the guest =
to
+             * control it for us. */
+            cword =3D pci_conf_read16(iommu->intel->drhd->segment, bus,
+                                    PCI_SLOT(source_id), PCI_FUNC(source_i=
d),
+                                    PCI_COMMAND);
+            pci_conf_write16(iommu->intel->drhd->segment, bus,
+                             PCI_SLOT(source_id), PCI_FUNC(source_id),
+                             PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
+        }
=20
         fault_index++;
         if ( fault_index > cap_num_fault_regs(iommu->cap) )




--=__Part49788309.4__=
Content-Type: text/plain; name="IOMMU-disable-BM-not-dom0.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="IOMMU-disable-BM-not-dom0.patch"

IOMMU: don't disable bus mastering on faults for devices used by Xen or =
Dom0=0A=0AUnder the assumption that in these cases recurring faults aren't =
a=0Asecurity issue and it can be expected that the drivers there are =
going=0Ato try to take care of the problem.=0A=0ASigned-off-by: Jan =
Beulich <jbeulich@suse.com>=0A=0A--- a/xen/drivers/passthrough/amd/iommu_in=
it.c=0A+++ b/xen/drivers/passthrough/amd/iommu_init.c=0A@@ -625,6 +625,18 =
@@ static void parse_event_log_entry(struct=0A         for ( bdf =3D 0; =
bdf < ivrs_bdf_entries; bdf++ )=0A             if ( get_dma_requestor_id(io=
mmu->seg, bdf) =3D=3D device_id )=0A             {=0A+                =
const struct pci_dev *pdev;=0A+=0A+                spin_lock(&pcidevs_lock)=
;=0A+                pdev =3D pci_get_pdev(iommu->seg, PCI_BUS(bdf), =
PCI_DEVFN2(bdf));=0A+                if ( pdev && pdev->domain !=3D =
dom_xen &&=0A+                     (!pdev->domain || !IS_PRIV(pdev->domain)=
) )=0A+                    pdev =3D NULL;=0A+                spin_unlock(&p=
cidevs_lock);=0A+=0A+                if ( pdev )=0A+                    =
continue;=0A+=0A                 cword =3D pci_conf_read16(iommu->seg, =
PCI_BUS(bdf),=0A                                         PCI_SLOT(bdf), =
PCI_FUNC(bdf),=0A                                         PCI_COMMAND);=0A-=
-- a/xen/drivers/passthrough/vtd/iommu.c=0A+++ b/xen/drivers/passthrough/vt=
d/iommu.c=0A@@ -916,7 +916,8 @@ static void __do_iommu_page_fault(struct=0A=
     reg =3D cap_fault_reg_offset(iommu->cap);=0A     while (1)=0A     =
{=0A-        u8 fault_reason;=0A+        const struct pci_dev *pdev;=0A+   =
     u8 fault_reason, bus;=0A         u16 source_id, cword;=0A         u32 =
data;=0A         u64 guest_addr;=0A@@ -950,14 +951,27 @@ static void =
__do_iommu_page_fault(struct=0A         iommu_page_fault_do_one(iommu, =
type, fault_reason,=0A                                 source_id, =
guest_addr);=0A =0A-        /* Tell the device to stop DMAing; we can't =
rely on the guest to=0A-         * control it for us. */=0A-        cword =
=3D pci_conf_read16(iommu->intel->drhd->segment,=0A-                       =
         PCI_BUS(source_id), PCI_SLOT(source_id),=0A-                      =
          PCI_FUNC(source_id), PCI_COMMAND);=0A-        pci_conf_write16(io=
mmu->intel->drhd->segment, PCI_BUS(source_id),=0A-                         =
PCI_SLOT(source_id), PCI_FUNC(source_id),=0A-                         =
PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);=0A+        bus =3D PCI_BUS(sourc=
e_id);=0A+=0A+        spin_lock(&pcidevs_lock);=0A+        pdev =3D =
pci_get_pdev(iommu->intel->drhd->segment, bus,=0A+                         =
   PCI_DEVFN2(source_id));=0A+        if ( pdev && pdev->domain !=3D =
dom_xen &&=0A+             (!pdev->domain || !IS_PRIV(pdev->domain)) )=0A+ =
           pdev =3D NULL;=0A+        spin_unlock(&pcidevs_lock);=0A+=0A+   =
     if ( !pdev )=0A+        {=0A+            /* Tell the device to stop =
DMAing; we can't rely on the guest to=0A+             * control it for us. =
*/=0A+            cword =3D pci_conf_read16(iommu->intel->drhd->segment, =
bus,=0A+                                    PCI_SLOT(source_id), PCI_FUNC(s=
ource_id),=0A+                                    PCI_COMMAND);=0A+        =
    pci_conf_write16(iommu->intel->drhd->segment, bus,=0A+                 =
            PCI_SLOT(source_id), PCI_FUNC(source_id),=0A+                  =
           PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);=0A+        }=0A =0A  =
       fault_index++;=0A         if ( fault_index > cap_num_fault_regs(iomm=
u->cap) )=0A
--=__Part49788309.4__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part49788309.4__=--


From xen-devel-bounces@lists.xen.org Mon Nov 05 16:54:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 16:54:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVPvq-0005th-R2; Mon, 05 Nov 2012 16:53:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVPvp-0005tZ-KQ
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 16:53:49 +0000
Received: from [85.158.143.99:21087] by server-2.bemta-4.messagelabs.com id
	8E/3D-28922-C1FE7905; Mon, 05 Nov 2012 16:53:48 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352134427!25341758!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19061 invoked from network); 5 Nov 2012 16:53:47 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-216.messagelabs.com with SMTP;
	5 Nov 2012 16:53:47 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 05 Nov 2012 16:53:47 +0000
Message-Id: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Mon, 05 Nov 2012 16:53:45 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <wei.huang2@amd.com>,<weiwang.dd@gmail.com>,
 <xiantao.zhang@intel.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part49788309.4__="
Cc: Tim Deegan <tim@xen.org>, Dario Faggioli <raistlin@linux.it>,
	xen-devel <xen-devel@lists.xen.org>
Subject: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on faults
 for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part49788309.4__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Under the assumption that in these cases recurring faults aren't a
security issue and it can be expected that the drivers there are going
to try to take care of the problem.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -625,6 +625,18 @@ static void parse_event_log_entry(struct
         for ( bdf =3D 0; bdf < ivrs_bdf_entries; bdf++ )
             if ( get_dma_requestor_id(iommu->seg, bdf) =3D=3D device_id )
             {
+                const struct pci_dev *pdev;
+
+                spin_lock(&pcidevs_lock);
+                pdev =3D pci_get_pdev(iommu->seg, PCI_BUS(bdf), PCI_DEVFN2=
(bdf));
+                if ( pdev && pdev->domain !=3D dom_xen &&
+                     (!pdev->domain || !IS_PRIV(pdev->domain)) )
+                    pdev =3D NULL;
+                spin_unlock(&pcidevs_lock);
+
+                if ( pdev )
+                    continue;
+
                 cword =3D pci_conf_read16(iommu->seg, PCI_BUS(bdf),
                                         PCI_SLOT(bdf), PCI_FUNC(bdf),
                                         PCI_COMMAND);
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -916,7 +916,8 @@ static void __do_iommu_page_fault(struct
     reg =3D cap_fault_reg_offset(iommu->cap);
     while (1)
     {
-        u8 fault_reason;
+        const struct pci_dev *pdev;
+        u8 fault_reason, bus;
         u16 source_id, cword;
         u32 data;
         u64 guest_addr;
@@ -950,14 +951,27 @@ static void __do_iommu_page_fault(struct
         iommu_page_fault_do_one(iommu, type, fault_reason,
                                 source_id, guest_addr);
=20
-        /* Tell the device to stop DMAing; we can't rely on the guest to
-         * control it for us. */
-        cword =3D pci_conf_read16(iommu->intel->drhd->segment,
-                                PCI_BUS(source_id), PCI_SLOT(source_id),
-                                PCI_FUNC(source_id), PCI_COMMAND);
-        pci_conf_write16(iommu->intel->drhd->segment, PCI_BUS(source_id),
-                         PCI_SLOT(source_id), PCI_FUNC(source_id),
-                         PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
+        bus =3D PCI_BUS(source_id);
+
+        spin_lock(&pcidevs_lock);
+        pdev =3D pci_get_pdev(iommu->intel->drhd->segment, bus,
+                            PCI_DEVFN2(source_id));
+        if ( pdev && pdev->domain !=3D dom_xen &&
+             (!pdev->domain || !IS_PRIV(pdev->domain)) )
+            pdev =3D NULL;
+        spin_unlock(&pcidevs_lock);
+
+        if ( !pdev )
+        {
+            /* Tell the device to stop DMAing; we can't rely on the guest =
to
+             * control it for us. */
+            cword =3D pci_conf_read16(iommu->intel->drhd->segment, bus,
+                                    PCI_SLOT(source_id), PCI_FUNC(source_i=
d),
+                                    PCI_COMMAND);
+            pci_conf_write16(iommu->intel->drhd->segment, bus,
+                             PCI_SLOT(source_id), PCI_FUNC(source_id),
+                             PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
+        }
=20
         fault_index++;
         if ( fault_index > cap_num_fault_regs(iommu->cap) )




--=__Part49788309.4__=
Content-Type: text/plain; name="IOMMU-disable-BM-not-dom0.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="IOMMU-disable-BM-not-dom0.patch"

IOMMU: don't disable bus mastering on faults for devices used by Xen or =
Dom0=0A=0AUnder the assumption that in these cases recurring faults aren't =
a=0Asecurity issue and it can be expected that the drivers there are =
going=0Ato try to take care of the problem.=0A=0ASigned-off-by: Jan =
Beulich <jbeulich@suse.com>=0A=0A--- a/xen/drivers/passthrough/amd/iommu_in=
it.c=0A+++ b/xen/drivers/passthrough/amd/iommu_init.c=0A@@ -625,6 +625,18 =
@@ static void parse_event_log_entry(struct=0A         for ( bdf =3D 0; =
bdf < ivrs_bdf_entries; bdf++ )=0A             if ( get_dma_requestor_id(io=
mmu->seg, bdf) =3D=3D device_id )=0A             {=0A+                =
const struct pci_dev *pdev;=0A+=0A+                spin_lock(&pcidevs_lock)=
;=0A+                pdev =3D pci_get_pdev(iommu->seg, PCI_BUS(bdf), =
PCI_DEVFN2(bdf));=0A+                if ( pdev && pdev->domain !=3D =
dom_xen &&=0A+                     (!pdev->domain || !IS_PRIV(pdev->domain)=
) )=0A+                    pdev =3D NULL;=0A+                spin_unlock(&p=
cidevs_lock);=0A+=0A+                if ( pdev )=0A+                    =
continue;=0A+=0A                 cword =3D pci_conf_read16(iommu->seg, =
PCI_BUS(bdf),=0A                                         PCI_SLOT(bdf), =
PCI_FUNC(bdf),=0A                                         PCI_COMMAND);=0A-=
-- a/xen/drivers/passthrough/vtd/iommu.c=0A+++ b/xen/drivers/passthrough/vt=
d/iommu.c=0A@@ -916,7 +916,8 @@ static void __do_iommu_page_fault(struct=0A=
     reg =3D cap_fault_reg_offset(iommu->cap);=0A     while (1)=0A     =
{=0A-        u8 fault_reason;=0A+        const struct pci_dev *pdev;=0A+   =
     u8 fault_reason, bus;=0A         u16 source_id, cword;=0A         u32 =
data;=0A         u64 guest_addr;=0A@@ -950,14 +951,27 @@ static void =
__do_iommu_page_fault(struct=0A         iommu_page_fault_do_one(iommu, =
type, fault_reason,=0A                                 source_id, =
guest_addr);=0A =0A-        /* Tell the device to stop DMAing; we can't =
rely on the guest to=0A-         * control it for us. */=0A-        cword =
=3D pci_conf_read16(iommu->intel->drhd->segment,=0A-                       =
         PCI_BUS(source_id), PCI_SLOT(source_id),=0A-                      =
          PCI_FUNC(source_id), PCI_COMMAND);=0A-        pci_conf_write16(io=
mmu->intel->drhd->segment, PCI_BUS(source_id),=0A-                         =
PCI_SLOT(source_id), PCI_FUNC(source_id),=0A-                         =
PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);=0A+        bus =3D PCI_BUS(sourc=
e_id);=0A+=0A+        spin_lock(&pcidevs_lock);=0A+        pdev =3D =
pci_get_pdev(iommu->intel->drhd->segment, bus,=0A+                         =
   PCI_DEVFN2(source_id));=0A+        if ( pdev && pdev->domain !=3D =
dom_xen &&=0A+             (!pdev->domain || !IS_PRIV(pdev->domain)) )=0A+ =
           pdev =3D NULL;=0A+        spin_unlock(&pcidevs_lock);=0A+=0A+   =
     if ( !pdev )=0A+        {=0A+            /* Tell the device to stop =
DMAing; we can't rely on the guest to=0A+             * control it for us. =
*/=0A+            cword =3D pci_conf_read16(iommu->intel->drhd->segment, =
bus,=0A+                                    PCI_SLOT(source_id), PCI_FUNC(s=
ource_id),=0A+                                    PCI_COMMAND);=0A+        =
    pci_conf_write16(iommu->intel->drhd->segment, bus,=0A+                 =
            PCI_SLOT(source_id), PCI_FUNC(source_id),=0A+                  =
           PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);=0A+        }=0A =0A  =
       fault_index++;=0A         if ( fault_index > cap_num_fault_regs(iomm=
u->cap) )=0A
--=__Part49788309.4__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part49788309.4__=--


From xen-devel-bounces@lists.xen.org Mon Nov 05 17:14:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 17:14:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVQFk-0006Gd-Ux; Mon, 05 Nov 2012 17:14:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TVQFj-0006GY-CZ
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 17:14:23 +0000
Received: from [85.158.139.211:53256] by server-7.bemta-5.messagelabs.com id
	D5/EA-23096-EE3F7905; Mon, 05 Nov 2012 17:14:22 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1352135660!18940010!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQwNDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29672 invoked from network); 5 Nov 2012 17:14:21 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 17:14:21 -0000
X-IronPort-AV: E=Sophos;i="4.80,715,1344211200"; d="scan'208";a="213422341"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	05 Nov 2012 17:14:20 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 5 Nov 2012 12:14:20 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[0.0.0.0])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TVQFf-0003eG-D9;
	Mon, 05 Nov 2012 17:14:19 +0000
Message-ID: <5097F3E9.1060404@eu.citrix.com>
Date: Mon, 5 Nov 2012 17:14:17 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Dan Magenheimer <dan.magenheimer@oracle.com>
References: <60d00f38-98a3-4ec2-acbd-b49dafaada56@default>
	<20121029223555.GA24388@ocelot.phlegethon.org>
	<eca242fa-20a1-42b1-943c-ca2ab1f5c4c4@default>
	<508F9DE902000078000A5565@nat28.tlf.novell.com>
	<a79693b2-ff7f-4b45-9eee-6ddb1bbcb84a@default>
In-Reply-To: <a79693b2-ff7f-4b45-9eee-6ddb1bbcb84a@default>
Cc: "Tim \(Xen.org\)" <tim@xen.org>, Olaf Hering <olaf@aepfle.de>, "Keir
	\(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	DarioFaggioli <raistlin@linux.it>, Jan Beulich <JBeulich@suse.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/10/12 15:43, Dan Magenheimer wrote:
> a) Truly free memory (each free page is on the hypervisor free list)
> b) Freeable memory ("ephmeral" memory managed by tmem)
> c) Owned memory (pages allocated by the hypervisor or for a domain)
>
> The sum of these three is always a constant: The total number of
> RAM pages in the system.  However, when tmem is active, the values
> of all _three_ of these change constantly.  So if at the start of a
> domain launch, the sum of free+freeable exceeds the intended size
> of the domain, the domain allocation/launch can start.

Why free+freeable, rather than just "free"?

>   But then
> if "owned" increases enough, there may no longer be enough memory
> and the domain launch will fail.

Again, "owned" would not increase at all if the guest weren't handing 
memory back to Xen.  Why is that necessary, or even helpful?

(And please don't start another rant about the bold new world of peace 
and love.  Give me a freaking *technical* answer.)

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 17:14:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 17:14:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVQFk-0006Gd-Ux; Mon, 05 Nov 2012 17:14:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TVQFj-0006GY-CZ
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 17:14:23 +0000
Received: from [85.158.139.211:53256] by server-7.bemta-5.messagelabs.com id
	D5/EA-23096-EE3F7905; Mon, 05 Nov 2012 17:14:22 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1352135660!18940010!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQwNDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29672 invoked from network); 5 Nov 2012 17:14:21 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 17:14:21 -0000
X-IronPort-AV: E=Sophos;i="4.80,715,1344211200"; d="scan'208";a="213422341"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	05 Nov 2012 17:14:20 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 5 Nov 2012 12:14:20 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[0.0.0.0])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TVQFf-0003eG-D9;
	Mon, 05 Nov 2012 17:14:19 +0000
Message-ID: <5097F3E9.1060404@eu.citrix.com>
Date: Mon, 5 Nov 2012 17:14:17 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Dan Magenheimer <dan.magenheimer@oracle.com>
References: <60d00f38-98a3-4ec2-acbd-b49dafaada56@default>
	<20121029223555.GA24388@ocelot.phlegethon.org>
	<eca242fa-20a1-42b1-943c-ca2ab1f5c4c4@default>
	<508F9DE902000078000A5565@nat28.tlf.novell.com>
	<a79693b2-ff7f-4b45-9eee-6ddb1bbcb84a@default>
In-Reply-To: <a79693b2-ff7f-4b45-9eee-6ddb1bbcb84a@default>
Cc: "Tim \(Xen.org\)" <tim@xen.org>, Olaf Hering <olaf@aepfle.de>, "Keir
	\(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	DarioFaggioli <raistlin@linux.it>, Jan Beulich <JBeulich@suse.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/10/12 15:43, Dan Magenheimer wrote:
> a) Truly free memory (each free page is on the hypervisor free list)
> b) Freeable memory ("ephmeral" memory managed by tmem)
> c) Owned memory (pages allocated by the hypervisor or for a domain)
>
> The sum of these three is always a constant: The total number of
> RAM pages in the system.  However, when tmem is active, the values
> of all _three_ of these change constantly.  So if at the start of a
> domain launch, the sum of free+freeable exceeds the intended size
> of the domain, the domain allocation/launch can start.

Why free+freeable, rather than just "free"?

>   But then
> if "owned" increases enough, there may no longer be enough memory
> and the domain launch will fail.

Again, "owned" would not increase at all if the guest weren't handing 
memory back to Xen.  Why is that necessary, or even helpful?

(And please don't start another rant about the bold new world of peace 
and love.  Give me a freaking *technical* answer.)

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 17:15:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 17:15:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVQGh-0006JF-DQ; Mon, 05 Nov 2012 17:15:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TVQGf-0006JA-TN
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 17:15:22 +0000
Received: from [85.158.139.83:39889] by server-5.bemta-5.messagelabs.com id
	4C/53-11353-924F7905; Mon, 05 Nov 2012 17:15:21 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1352135719!28851530!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2137 invoked from network); 5 Nov 2012 17:15:19 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 17:15:19 -0000
Received: by mail-we0-f173.google.com with SMTP id t11so3364943wey.32
	for <xen-devel@lists.xen.org>; Mon, 05 Nov 2012 09:15:19 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=YjyeWH2rRrtrZZMEI6rFoTNJ2fh6Sw/mRtrTOk4kob0=;
	b=aBkcbs3nDCNj8x6WqnkVOj7cr0BL+Eb0+sLMmUMaDkoa6AOpplCVkFaWBURJM5MweS
	D1xifWfrEUhNAtZLdLSjm/J3+EEWJPM6laBoRgQJpcL0k5ND/oN9kjHYJk0gLLTorsnA
	mKW0eyers3pV9kBzv4m3efKSjD77FvKRqX53xcGL7FGW3SEZNvirK8NJ0uviAtmwJE1E
	jRtS/yh8u7xE/AzF2Fa4oNWxRUcQXZiFyy1DU8wtO6/YQR1tgwk7quY6fxXSr0BMvHq9
	yW5f5Kf2uJFLajGvSnbiVAFbdshs554LtptnbPN/D7mwPJsQ+t7d7OFNDlK2TUadx+dD
	nHHQ==
Received: by 10.180.82.104 with SMTP id h8mr14243957wiy.19.1352135719031;
	Mon, 05 Nov 2012 09:15:19 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id r10sm9618966wiz.0.2012.11.05.09.15.10
	(version=SSLv3 cipher=OTHER); Mon, 05 Nov 2012 09:15:18 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Mon, 05 Nov 2012 17:15:05 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCBDA499.51025%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] x86/ACPI: invalidate BGRT
Thread-Index: Ac27eRkXnyDo8+eskEmM+ixAJTW45A==
In-Reply-To: <5097FC3002000078000A66AE@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] x86/ACPI: invalidate BGRT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 05/11/2012 16:49, "Jan Beulich" <JBeulich@suse.com> wrote:

> Since the image pointed to may (and generally will) live in boot
> services memory (which we add to the global memory pool long before
> ACPI tables get looked at), we should prevent Dom0 from trying to
> retrieve the image data.
> 
> The alternatives would be to
> - not add boot services memory to the global pool at all, or
> - defer adding boot services memory until Dom0 indicates it is safe to
>   do so, or
> - find and parse the BGRT table in xen/arch/x86/efi/boot.c, and avoid
>   adding that specific region to the E820 table.
> None of these is really attractive, and as Xen commonly prints to the
> video console anyway (without trying to avoid any regions on the
> screen), the invalidation would need to be done conditionally anyway.
> 
> (xen/include/acpi/actbl3.h is a verbatim copy from Linux 3.7-rc4)
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/arch/x86/acpi/boot.c
> +++ b/xen/arch/x86/acpi/boot.c
> @@ -286,6 +286,25 @@ static int __init acpi_parse_hpet(struct
>  #define acpi_parse_hpet NULL
>  #endif
>  
> +static int __init acpi_invalidate_bgrt(struct acpi_table_header *table)
> +{
> + struct acpi_table_bgrt *bgrt_tbl =
> +  container_of(table, struct acpi_table_bgrt, header);
> +
> + if (table->length < sizeof(*bgrt_tbl))
> +  return -1;
> +
> + if (!(bgrt_tbl->status & 1))
> +  return 0;
> +
> + printk(KERN_INFO PREFIX "BGRT: invalidating v%d image at %#"PRIx64" for
> (%u,%u)\n",
> +        bgrt_tbl->version, bgrt_tbl->image_address,
> +        bgrt_tbl->image_offset_x, bgrt_tbl->image_offset_y);
> + bgrt_tbl->status &= ~1;
> +
> + return 0;
> +}
> +
>  #ifdef CONFIG_ACPI_SLEEP
>  #define acpi_fadt_copy_address(dst, src, len) do {   \
> if (fadt->header.revision >= FADT2_REVISION_ID)   \
> @@ -653,5 +672,7 @@ int __init acpi_boot_init(void)
>  
> erst_init();
>  
> + acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt);
> +
> return 0;
>  }
> --- a/xen/include/acpi/actbl.h
> +++ b/xen/include/acpi/actbl.h
> @@ -314,6 +314,7 @@ enum acpi_prefered_pm_profiles {
>  
>  #include <acpi/actbl1.h>
>  #include <acpi/actbl2.h>
> +#include <acpi/actbl3.h>
>  
>  /*
>   * Sizes of the various flavors of FADT. We need to look closely
> --- /dev/null
> +++ b/xen/include/acpi/actbl3.h
> @@ -0,0 +1,557 @@
> +/****************************************************************************
> **
> + *
> + * Name: actbl3.h - ACPI Table Definitions
> + *
> + 
> *****************************************************************************/
> +
> +/*
> + * Copyright (C) 2000 - 2012, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *    notice, this list of conditions, and the following disclaimer,
> + *    without modification.
> + * 2. Redistributions in binary form must reproduce at minimum a disclaimer
> + *    substantially similar to the "NO WARRANTY" disclaimer below
> + *    ("Disclaimer") and any redistribution must be conditioned upon
> + *    including a substantially similar Disclaimer requirement for further
> + *    binary redistribution.
> + * 3. Neither the names of the above-listed copyright holders nor the names
> + *    of any contributors may be used to endorse or promote products derived
> + *    from this software without specific prior written permission.
> + *
> + * Alternatively, this software may be distributed under the terms of the
> + * GNU General Public License ("GPL") version 2 as published by the Free
> + * Software Foundation.
> + *
> + * NO WARRANTY
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
> + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
> + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
> + * POSSIBILITY OF SUCH DAMAGES.
> + */
> +
> +#ifndef __ACTBL3_H__
> +#define __ACTBL3_H__
> +
> +/****************************************************************************
> ***
> + *
> + * Additional ACPI Tables (3)
> + *
> + * These tables are not consumed directly by the ACPICA subsystem, but are
> + * included here to support device drivers and the AML disassembler.
> + *
> + * The tables in this file are fully defined within the ACPI specification.
> + *
> + 
> 
******************************************************************************>
/
> +
> +/*
> + * Values for description table header signatures for tables defined in this
> + * file. Useful because they make it more difficult to inadvertently type in
> + * the wrong signature.
> + */
> +#define ACPI_SIG_BGRT           "BGRT" /* Boot Graphics Resource Table */
> +#define ACPI_SIG_DRTM           "DRTM" /* Dynamic Root of Trust for
> Measurement table */
> +#define ACPI_SIG_FPDT           "FPDT" /* Firmware Performance Data Table */
> +#define ACPI_SIG_GTDT           "GTDT" /* Generic Timer Description Table */
> +#define ACPI_SIG_MPST           "MPST" /* Memory Power State Table */
> +#define ACPI_SIG_PCCT           "PCCT" /* Platform Communications Channel
> Table */
> +#define ACPI_SIG_PMTT           "PMTT" /* Platform Memory Topology Table */
> +#define ACPI_SIG_RASF           "RASF" /* RAS Feature table */
> +
> +#define ACPI_SIG_S3PT           "S3PT" /* S3 Performance (sub)Table */
> +#define ACPI_SIG_PCCS           "PCC" /* PCC Shared Memory Region */
> +
> +/* Reserved table signatures */
> +
> +#define ACPI_SIG_CSRT           "CSRT" /* Core System Resources Table */
> +#define ACPI_SIG_MATR           "MATR" /* Memory Address Translation Table */
> +#define ACPI_SIG_MSDM           "MSDM" /* Microsoft Data Management Table */
> +#define ACPI_SIG_WPBT           "WPBT" /* Windows Platform Binary Table */
> +
> +/*
> + * All tables must be byte-packed to match the ACPI specification, since
> + * the tables are provided by the system BIOS.
> + */
> +#pragma pack(1)
> +
> +/*
> + * Note: C bitfields are not used for this reason:
> + *
> + * "Bitfields are great and easy to read, but unfortunately the C language
> + * does not specify the layout of bitfields in memory, which means they are
> + * essentially useless for dealing with packed data in on-disk formats or
> + * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
> + * this decision was a design error in C. Ritchie could have picked an order
> + * and stuck with it." Norman Ramsey.
> + * See http://stackoverflow.com/a/1053662/41661
> + */
> +
> +/****************************************************************************
> ***
> + *
> + * BGRT - Boot Graphics Resource Table (ACPI 5.0)
> + *        Version 1
> + *
> + 
> 
******************************************************************************>
/
> +
> +struct acpi_table_bgrt {
> + struct acpi_table_header header; /* Common ACPI table header */
> + u16 version;
> + u8 status;
> + u8 image_type;
> + u64 image_address;
> + u32 image_offset_x;
> + u32 image_offset_y;
> +};
> +
> +/****************************************************************************
> ***
> + *
> + * DRTM - Dynamic Root of Trust for Measurement table
> + *
> + 
> 
******************************************************************************>
/
> +
> +struct acpi_table_drtm {
> + struct acpi_table_header header; /* Common ACPI table header */
> + u64 entry_base_address;
> + u64 entry_length;
> + u32 entry_address32;
> + u64 entry_address64;
> + u64 exit_address;
> + u64 log_area_address;
> + u32 log_area_length;
> + u64 arch_dependent_address;
> + u32 flags;
> +};
> +
> +/* 1) Validated Tables List */
> +
> +struct acpi_drtm_vtl_list {
> + u32 validated_table_list_count;
> +};
> +
> +/* 2) Resources List */
> +
> +struct acpi_drtm_resource_list {
> + u32 resource_list_count;
> +};
> +
> +/* 3) Platform-specific Identifiers List */
> +
> +struct acpi_drtm_id_list {
> + u32 id_list_count;
> +};
> +
> +/****************************************************************************
> ***
> + *
> + * FPDT - Firmware Performance Data Table (ACPI 5.0)
> + *        Version 1
> + *
> + 
> 
******************************************************************************>
/
> +
> +struct acpi_table_fpdt {
> + struct acpi_table_header header; /* Common ACPI table header */
> +};
> +
> +/* FPDT subtable header */
> +
> +struct acpi_fpdt_header {
> + u16 type;
> + u8 length;
> + u8 revision;
> +};
> +
> +/* Values for Type field above */
> +
> +enum acpi_fpdt_type {
> + ACPI_FPDT_TYPE_BOOT = 0,
> + ACPI_FPDT_TYPE_S3PERF = 1,
> +};
> +
> +/*
> + * FPDT subtables
> + */
> +
> +/* 0: Firmware Basic Boot Performance Record */
> +
> +struct acpi_fpdt_boot {
> + struct acpi_fpdt_header header;
> + u8 reserved[4];
> + u64 reset_end;
> + u64 load_start;
> + u64 startup_start;
> + u64 exit_services_entry;
> + u64 exit_services_exit;
> +};
> +
> +/* 1: S3 Performance Table Pointer Record */
> +
> +struct acpi_fpdt_s3pt_ptr {
> + struct acpi_fpdt_header header;
> + u8 reserved[4];
> + u64 address;
> +};
> +
> +/*
> + * S3PT - S3 Performance Table. This table is pointed to by the
> + * FPDT S3 Pointer Record above.
> + */
> +struct acpi_table_s3pt {
> + u8 signature[4]; /* "S3PT" */
> + u32 length;
> +};
> +
> +/*
> + * S3PT Subtables
> + */
> +struct acpi_s3pt_header {
> + u16 type;
> + u8 length;
> + u8 revision;
> +};
> +
> +/* Values for Type field above */
> +
> +enum acpi_s3pt_type {
> + ACPI_S3PT_TYPE_RESUME = 0,
> + ACPI_S3PT_TYPE_SUSPEND = 1,
> +};
> +
> +struct acpi_s3pt_resume {
> + struct acpi_s3pt_header header;
> + u32 resume_count;
> + u64 full_resume;
> + u64 average_resume;
> +};
> +
> +struct acpi_s3pt_suspend {
> + struct acpi_s3pt_header header;
> + u64 suspend_start;
> + u64 suspend_end;
> +};
> +
> +/****************************************************************************
> ***
> + *
> + * GTDT - Generic Timer Description Table (ACPI 5.0)
> + *        Version 1
> + *
> + 
> 
******************************************************************************>
/
> +
> +struct acpi_table_gtdt {
> + struct acpi_table_header header; /* Common ACPI table header */
> + u64 address;
> + u32 flags;
> + u32 secure_pl1_interrupt;
> + u32 secure_pl1_flags;
> + u32 non_secure_pl1_interrupt;
> + u32 non_secure_pl1_flags;
> + u32 virtual_timer_interrupt;
> + u32 virtual_timer_flags;
> + u32 non_secure_pl2_interrupt;
> + u32 non_secure_pl2_flags;
> +};
> +
> +/* Values for Flags field above */
> +
> +#define ACPI_GTDT_MAPPED_BLOCK_PRESENT      1
> +
> +/* Values for all "TimerFlags" fields above */
> +
> +#define ACPI_GTDT_INTERRUPT_MODE            1
> +#define ACPI_GTDT_INTERRUPT_POLARITY        2
> +
> +/****************************************************************************
> ***
> + *
> + * MPST - Memory Power State Table (ACPI 5.0)
> + *        Version 1
> + *
> + 
> 
******************************************************************************>
/
> +
> +#define ACPI_MPST_CHANNEL_INFO \
> + u16                             reserved1; \
> + u8                              channel_id; \
> + u8                              reserved2; \
> + u16                             power_node_count;
> +
> +/* Main table */
> +
> +struct acpi_table_mpst {
> + struct acpi_table_header header; /* Common ACPI table header */
> +  ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
> +};
> +
> +/* Memory Platform Communication Channel Info */
> +
> +struct acpi_mpst_channel {
> + ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
> +};
> +
> +/* Memory Power Node Structure */
> +
> +struct acpi_mpst_power_node {
> + u8 flags;
> + u8 reserved1;
> + u16 node_id;
> + u32 length;
> + u64 range_address;
> + u64 range_length;
> + u8 num_power_states;
> + u8 num_physical_components;
> + u16 reserved2;
> +};
> +
> +/* Values for Flags field above */
> +
> +#define ACPI_MPST_ENABLED               1
> +#define ACPI_MPST_POWER_MANAGED         2
> +#define ACPI_MPST_HOT_PLUG_CAPABLE      4
> +
> +/* Memory Power State Structure (follows POWER_NODE above) */
> +
> +struct acpi_mpst_power_state {
> + u8 power_state;
> + u8 info_index;
> +};
> +
> +/* Physical Component ID Structure (follows POWER_STATE above) */
> +
> +struct acpi_mpst_component {
> + u16 component_id;
> +};
> +
> +/* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
> +
> +struct acpi_mpst_data_hdr {
> + u16 characteristics_count;
> +};
> +
> +struct acpi_mpst_power_data {
> + u8 revision;
> + u8 flags;
> + u16 reserved1;
> + u32 average_power;
> + u32 power_saving;
> + u64 exit_latency;
> + u64 reserved2;
> +};
> +
> +/* Values for Flags field above */
> +
> +#define ACPI_MPST_PRESERVE              1
> +#define ACPI_MPST_AUTOENTRY             2
> +#define ACPI_MPST_AUTOEXIT              4
> +
> +/* Shared Memory Region (not part of an ACPI table) */
> +
> +struct acpi_mpst_shared {
> + u32 signature;
> + u16 pcc_command;
> + u16 pcc_status;
> + u16 command_register;
> + u16 status_register;
> + u16 power_state_id;
> + u16 power_node_id;
> + u64 energy_consumed;
> + u64 average_power;
> +};
> +
> +/****************************************************************************
> ***
> + *
> + * PCCT - Platform Communications Channel Table (ACPI 5.0)
> + *        Version 1
> + *
> + 
> 
******************************************************************************>
/
> +
> +struct acpi_table_pcct {
> + struct acpi_table_header header; /* Common ACPI table header */
> + u32 flags;
> + u32 latency;
> + u32 reserved;
> +};
> +
> +/* Values for Flags field above */
> +
> +#define ACPI_PCCT_DOORBELL              1
> +
> +/*
> + * PCCT subtables
> + */
> +
> +/* 0: Generic Communications Subspace */
> +
> +struct acpi_pcct_subspace {
> + struct acpi_subtable_header header;
> + u8 reserved[6];
> + u64 base_address;
> + u64 length;
> + struct acpi_generic_address doorbell_register;
> + u64 preserve_mask;
> + u64 write_mask;
> +};
> +
> +/*
> + * PCC memory structures (not part of the ACPI table)
> + */
> +
> +/* Shared Memory Region */
> +
> +struct acpi_pcct_shared_memory {
> + u32 signature;
> + u16 command;
> + u16 status;
> +};
> +
> +/****************************************************************************
> ***
> + *
> + * PMTT - Platform Memory Topology Table (ACPI 5.0)
> + *        Version 1
> + *
> + 
> 
******************************************************************************>
/
> +
> +struct acpi_table_pmtt {
> + struct acpi_table_header header; /* Common ACPI table header */
> + u32 reserved;
> +};
> +
> +/* Common header for PMTT subtables that follow main table */
> +
> +struct acpi_pmtt_header {
> + u8 type;
> + u8 reserved1;
> + u16 length;
> + u16 flags;
> + u16 reserved2;
> +};
> +
> +/* Values for Type field above */
> +
> +#define ACPI_PMTT_TYPE_SOCKET           0
> +#define ACPI_PMTT_TYPE_CONTROLLER       1
> +#define ACPI_PMTT_TYPE_DIMM             2
> +#define ACPI_PMTT_TYPE_RESERVED         3 /* 0x03-0xFF are reserved */
> +
> +/* Values for Flags field above */
> +
> +#define ACPI_PMTT_TOP_LEVEL             0x0001
> +#define ACPI_PMTT_PHYSICAL              0x0002
> +#define ACPI_PMTT_MEMORY_TYPE           0x000C
> +
> +/*
> + * PMTT subtables, correspond to Type in struct acpi_pmtt_header
> + */
> +
> +/* 0: Socket Structure */
> +
> +struct acpi_pmtt_socket {
> + struct acpi_pmtt_header header;
> + u16 socket_id;
> + u16 reserved;
> +};
> +
> +/* 1: Memory Controller subtable */
> +
> +struct acpi_pmtt_controller {
> + struct acpi_pmtt_header header;
> + u32 read_latency;
> + u32 write_latency;
> + u32 read_bandwidth;
> + u32 write_bandwidth;
> + u16 access_width;
> + u16 alignment;
> + u16 reserved;
> + u16 domain_count;
> +};
> +
> +/* 1a: Proximity Domain substructure */
> +
> +struct acpi_pmtt_domain {
> + u32 proximity_domain;
> +};
> +
> +/* 2: Physical Component Identifier (DIMM) */
> +
> +struct acpi_pmtt_physical_component {
> + struct acpi_pmtt_header header;
> + u16 component_id;
> + u16 reserved;
> + u32 memory_size;
> + u32 bios_handle;
> +};
> +
> +/****************************************************************************
> ***
> + *
> + * RASF - RAS Feature Table (ACPI 5.0)
> + *        Version 1
> + *
> + 
> 
******************************************************************************>
/
> +
> +struct acpi_table_rasf {
> + struct acpi_table_header header; /* Common ACPI table header */
> + u8 channel_id[12];
> +};
> +
> +/* RASF Platform Communication Channel Shared Memory Region */
> +
> +struct acpi_rasf_shared_memory {
> + u32 signature;
> + u16 command;
> + u16 status;
> + u64 requested_address;
> + u64 requested_length;
> + u64 actual_address;
> + u64 actual_length;
> + u16 flags;
> + u8 speed;
> +};
> +
> +/* Masks for Flags and Speed fields above */
> +
> +#define ACPI_RASF_SCRUBBER_RUNNING      1
> +#define ACPI_RASF_SPEED                 (7<<1)
> +
> +/* Channel Commands */
> +
> +enum acpi_rasf_commands {
> + ACPI_RASF_GET_RAS_CAPABILITIES = 1,
> + ACPI_RASF_GET_PATROL_PARAMETERS = 2,
> + ACPI_RASF_START_PATROL_SCRUBBER = 3,
> + ACPI_RASF_STOP_PATROL_SCRUBBER = 4
> +};
> +
> +/* Channel Command flags */
> +
> +#define ACPI_RASF_GENERATE_SCI          (1<<15)
> +
> +/* Status values */
> +
> +enum acpi_rasf_status {
> + ACPI_RASF_SUCCESS = 0,
> + ACPI_RASF_NOT_VALID = 1,
> + ACPI_RASF_NOT_SUPPORTED = 2,
> + ACPI_RASF_BUSY = 3,
> + ACPI_RASF_FAILED = 4,
> + ACPI_RASF_ABORTED = 5,
> + ACPI_RASF_INVALID_DATA = 6
> +};
> +
> +/* Status flags */
> +
> +#define ACPI_RASF_COMMAND_COMPLETE      (1)
> +#define ACPI_RASF_SCI_DOORBELL          (1<<1)
> +#define ACPI_RASF_ERROR                 (1<<2)
> +#define ACPI_RASF_STATUS                (0x1F<<3)
> +
> +/* Reset to default packing */
> +
> +#pragma pack()
> +
> +#endif    /* __ACTBL3_H__ */
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 17:15:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 17:15:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVQGh-0006JF-DQ; Mon, 05 Nov 2012 17:15:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TVQGf-0006JA-TN
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 17:15:22 +0000
Received: from [85.158.139.83:39889] by server-5.bemta-5.messagelabs.com id
	4C/53-11353-924F7905; Mon, 05 Nov 2012 17:15:21 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1352135719!28851530!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2137 invoked from network); 5 Nov 2012 17:15:19 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 17:15:19 -0000
Received: by mail-we0-f173.google.com with SMTP id t11so3364943wey.32
	for <xen-devel@lists.xen.org>; Mon, 05 Nov 2012 09:15:19 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=YjyeWH2rRrtrZZMEI6rFoTNJ2fh6Sw/mRtrTOk4kob0=;
	b=aBkcbs3nDCNj8x6WqnkVOj7cr0BL+Eb0+sLMmUMaDkoa6AOpplCVkFaWBURJM5MweS
	D1xifWfrEUhNAtZLdLSjm/J3+EEWJPM6laBoRgQJpcL0k5ND/oN9kjHYJk0gLLTorsnA
	mKW0eyers3pV9kBzv4m3efKSjD77FvKRqX53xcGL7FGW3SEZNvirK8NJ0uviAtmwJE1E
	jRtS/yh8u7xE/AzF2Fa4oNWxRUcQXZiFyy1DU8wtO6/YQR1tgwk7quY6fxXSr0BMvHq9
	yW5f5Kf2uJFLajGvSnbiVAFbdshs554LtptnbPN/D7mwPJsQ+t7d7OFNDlK2TUadx+dD
	nHHQ==
Received: by 10.180.82.104 with SMTP id h8mr14243957wiy.19.1352135719031;
	Mon, 05 Nov 2012 09:15:19 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id r10sm9618966wiz.0.2012.11.05.09.15.10
	(version=SSLv3 cipher=OTHER); Mon, 05 Nov 2012 09:15:18 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Mon, 05 Nov 2012 17:15:05 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCBDA499.51025%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] x86/ACPI: invalidate BGRT
Thread-Index: Ac27eRkXnyDo8+eskEmM+ixAJTW45A==
In-Reply-To: <5097FC3002000078000A66AE@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] x86/ACPI: invalidate BGRT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 05/11/2012 16:49, "Jan Beulich" <JBeulich@suse.com> wrote:

> Since the image pointed to may (and generally will) live in boot
> services memory (which we add to the global memory pool long before
> ACPI tables get looked at), we should prevent Dom0 from trying to
> retrieve the image data.
> 
> The alternatives would be to
> - not add boot services memory to the global pool at all, or
> - defer adding boot services memory until Dom0 indicates it is safe to
>   do so, or
> - find and parse the BGRT table in xen/arch/x86/efi/boot.c, and avoid
>   adding that specific region to the E820 table.
> None of these is really attractive, and as Xen commonly prints to the
> video console anyway (without trying to avoid any regions on the
> screen), the invalidation would need to be done conditionally anyway.
> 
> (xen/include/acpi/actbl3.h is a verbatim copy from Linux 3.7-rc4)
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/arch/x86/acpi/boot.c
> +++ b/xen/arch/x86/acpi/boot.c
> @@ -286,6 +286,25 @@ static int __init acpi_parse_hpet(struct
>  #define acpi_parse_hpet NULL
>  #endif
>  
> +static int __init acpi_invalidate_bgrt(struct acpi_table_header *table)
> +{
> + struct acpi_table_bgrt *bgrt_tbl =
> +  container_of(table, struct acpi_table_bgrt, header);
> +
> + if (table->length < sizeof(*bgrt_tbl))
> +  return -1;
> +
> + if (!(bgrt_tbl->status & 1))
> +  return 0;
> +
> + printk(KERN_INFO PREFIX "BGRT: invalidating v%d image at %#"PRIx64" for
> (%u,%u)\n",
> +        bgrt_tbl->version, bgrt_tbl->image_address,
> +        bgrt_tbl->image_offset_x, bgrt_tbl->image_offset_y);
> + bgrt_tbl->status &= ~1;
> +
> + return 0;
> +}
> +
>  #ifdef CONFIG_ACPI_SLEEP
>  #define acpi_fadt_copy_address(dst, src, len) do {   \
> if (fadt->header.revision >= FADT2_REVISION_ID)   \
> @@ -653,5 +672,7 @@ int __init acpi_boot_init(void)
>  
> erst_init();
>  
> + acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt);
> +
> return 0;
>  }
> --- a/xen/include/acpi/actbl.h
> +++ b/xen/include/acpi/actbl.h
> @@ -314,6 +314,7 @@ enum acpi_prefered_pm_profiles {
>  
>  #include <acpi/actbl1.h>
>  #include <acpi/actbl2.h>
> +#include <acpi/actbl3.h>
>  
>  /*
>   * Sizes of the various flavors of FADT. We need to look closely
> --- /dev/null
> +++ b/xen/include/acpi/actbl3.h
> @@ -0,0 +1,557 @@
> +/****************************************************************************
> **
> + *
> + * Name: actbl3.h - ACPI Table Definitions
> + *
> + 
> *****************************************************************************/
> +
> +/*
> + * Copyright (C) 2000 - 2012, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *    notice, this list of conditions, and the following disclaimer,
> + *    without modification.
> + * 2. Redistributions in binary form must reproduce at minimum a disclaimer
> + *    substantially similar to the "NO WARRANTY" disclaimer below
> + *    ("Disclaimer") and any redistribution must be conditioned upon
> + *    including a substantially similar Disclaimer requirement for further
> + *    binary redistribution.
> + * 3. Neither the names of the above-listed copyright holders nor the names
> + *    of any contributors may be used to endorse or promote products derived
> + *    from this software without specific prior written permission.
> + *
> + * Alternatively, this software may be distributed under the terms of the
> + * GNU General Public License ("GPL") version 2 as published by the Free
> + * Software Foundation.
> + *
> + * NO WARRANTY
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
> + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
> + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
> + * POSSIBILITY OF SUCH DAMAGES.
> + */
> +
> +#ifndef __ACTBL3_H__
> +#define __ACTBL3_H__
> +
> +/****************************************************************************
> ***
> + *
> + * Additional ACPI Tables (3)
> + *
> + * These tables are not consumed directly by the ACPICA subsystem, but are
> + * included here to support device drivers and the AML disassembler.
> + *
> + * The tables in this file are fully defined within the ACPI specification.
> + *
> + 
> 
******************************************************************************>
/
> +
> +/*
> + * Values for description table header signatures for tables defined in this
> + * file. Useful because they make it more difficult to inadvertently type in
> + * the wrong signature.
> + */
> +#define ACPI_SIG_BGRT           "BGRT" /* Boot Graphics Resource Table */
> +#define ACPI_SIG_DRTM           "DRTM" /* Dynamic Root of Trust for
> Measurement table */
> +#define ACPI_SIG_FPDT           "FPDT" /* Firmware Performance Data Table */
> +#define ACPI_SIG_GTDT           "GTDT" /* Generic Timer Description Table */
> +#define ACPI_SIG_MPST           "MPST" /* Memory Power State Table */
> +#define ACPI_SIG_PCCT           "PCCT" /* Platform Communications Channel
> Table */
> +#define ACPI_SIG_PMTT           "PMTT" /* Platform Memory Topology Table */
> +#define ACPI_SIG_RASF           "RASF" /* RAS Feature table */
> +
> +#define ACPI_SIG_S3PT           "S3PT" /* S3 Performance (sub)Table */
> +#define ACPI_SIG_PCCS           "PCC" /* PCC Shared Memory Region */
> +
> +/* Reserved table signatures */
> +
> +#define ACPI_SIG_CSRT           "CSRT" /* Core System Resources Table */
> +#define ACPI_SIG_MATR           "MATR" /* Memory Address Translation Table */
> +#define ACPI_SIG_MSDM           "MSDM" /* Microsoft Data Management Table */
> +#define ACPI_SIG_WPBT           "WPBT" /* Windows Platform Binary Table */
> +
> +/*
> + * All tables must be byte-packed to match the ACPI specification, since
> + * the tables are provided by the system BIOS.
> + */
> +#pragma pack(1)
> +
> +/*
> + * Note: C bitfields are not used for this reason:
> + *
> + * "Bitfields are great and easy to read, but unfortunately the C language
> + * does not specify the layout of bitfields in memory, which means they are
> + * essentially useless for dealing with packed data in on-disk formats or
> + * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
> + * this decision was a design error in C. Ritchie could have picked an order
> + * and stuck with it." Norman Ramsey.
> + * See http://stackoverflow.com/a/1053662/41661
> + */
> +
> +/****************************************************************************
> ***
> + *
> + * BGRT - Boot Graphics Resource Table (ACPI 5.0)
> + *        Version 1
> + *
> + 
> 
******************************************************************************>
/
> +
> +struct acpi_table_bgrt {
> + struct acpi_table_header header; /* Common ACPI table header */
> + u16 version;
> + u8 status;
> + u8 image_type;
> + u64 image_address;
> + u32 image_offset_x;
> + u32 image_offset_y;
> +};
> +
> +/****************************************************************************
> ***
> + *
> + * DRTM - Dynamic Root of Trust for Measurement table
> + *
> + 
> 
******************************************************************************>
/
> +
> +struct acpi_table_drtm {
> + struct acpi_table_header header; /* Common ACPI table header */
> + u64 entry_base_address;
> + u64 entry_length;
> + u32 entry_address32;
> + u64 entry_address64;
> + u64 exit_address;
> + u64 log_area_address;
> + u32 log_area_length;
> + u64 arch_dependent_address;
> + u32 flags;
> +};
> +
> +/* 1) Validated Tables List */
> +
> +struct acpi_drtm_vtl_list {
> + u32 validated_table_list_count;
> +};
> +
> +/* 2) Resources List */
> +
> +struct acpi_drtm_resource_list {
> + u32 resource_list_count;
> +};
> +
> +/* 3) Platform-specific Identifiers List */
> +
> +struct acpi_drtm_id_list {
> + u32 id_list_count;
> +};
> +
> +/****************************************************************************
> ***
> + *
> + * FPDT - Firmware Performance Data Table (ACPI 5.0)
> + *        Version 1
> + *
> + 
> 
******************************************************************************>
/
> +
> +struct acpi_table_fpdt {
> + struct acpi_table_header header; /* Common ACPI table header */
> +};
> +
> +/* FPDT subtable header */
> +
> +struct acpi_fpdt_header {
> + u16 type;
> + u8 length;
> + u8 revision;
> +};
> +
> +/* Values for Type field above */
> +
> +enum acpi_fpdt_type {
> + ACPI_FPDT_TYPE_BOOT = 0,
> + ACPI_FPDT_TYPE_S3PERF = 1,
> +};
> +
> +/*
> + * FPDT subtables
> + */
> +
> +/* 0: Firmware Basic Boot Performance Record */
> +
> +struct acpi_fpdt_boot {
> + struct acpi_fpdt_header header;
> + u8 reserved[4];
> + u64 reset_end;
> + u64 load_start;
> + u64 startup_start;
> + u64 exit_services_entry;
> + u64 exit_services_exit;
> +};
> +
> +/* 1: S3 Performance Table Pointer Record */
> +
> +struct acpi_fpdt_s3pt_ptr {
> + struct acpi_fpdt_header header;
> + u8 reserved[4];
> + u64 address;
> +};
> +
> +/*
> + * S3PT - S3 Performance Table. This table is pointed to by the
> + * FPDT S3 Pointer Record above.
> + */
> +struct acpi_table_s3pt {
> + u8 signature[4]; /* "S3PT" */
> + u32 length;
> +};
> +
> +/*
> + * S3PT Subtables
> + */
> +struct acpi_s3pt_header {
> + u16 type;
> + u8 length;
> + u8 revision;
> +};
> +
> +/* Values for Type field above */
> +
> +enum acpi_s3pt_type {
> + ACPI_S3PT_TYPE_RESUME = 0,
> + ACPI_S3PT_TYPE_SUSPEND = 1,
> +};
> +
> +struct acpi_s3pt_resume {
> + struct acpi_s3pt_header header;
> + u32 resume_count;
> + u64 full_resume;
> + u64 average_resume;
> +};
> +
> +struct acpi_s3pt_suspend {
> + struct acpi_s3pt_header header;
> + u64 suspend_start;
> + u64 suspend_end;
> +};
> +
> +/****************************************************************************
> ***
> + *
> + * GTDT - Generic Timer Description Table (ACPI 5.0)
> + *        Version 1
> + *
> + 
> 
******************************************************************************>
/
> +
> +struct acpi_table_gtdt {
> + struct acpi_table_header header; /* Common ACPI table header */
> + u64 address;
> + u32 flags;
> + u32 secure_pl1_interrupt;
> + u32 secure_pl1_flags;
> + u32 non_secure_pl1_interrupt;
> + u32 non_secure_pl1_flags;
> + u32 virtual_timer_interrupt;
> + u32 virtual_timer_flags;
> + u32 non_secure_pl2_interrupt;
> + u32 non_secure_pl2_flags;
> +};
> +
> +/* Values for Flags field above */
> +
> +#define ACPI_GTDT_MAPPED_BLOCK_PRESENT      1
> +
> +/* Values for all "TimerFlags" fields above */
> +
> +#define ACPI_GTDT_INTERRUPT_MODE            1
> +#define ACPI_GTDT_INTERRUPT_POLARITY        2
> +
> +/****************************************************************************
> ***
> + *
> + * MPST - Memory Power State Table (ACPI 5.0)
> + *        Version 1
> + *
> + 
> 
******************************************************************************>
/
> +
> +#define ACPI_MPST_CHANNEL_INFO \
> + u16                             reserved1; \
> + u8                              channel_id; \
> + u8                              reserved2; \
> + u16                             power_node_count;
> +
> +/* Main table */
> +
> +struct acpi_table_mpst {
> + struct acpi_table_header header; /* Common ACPI table header */
> +  ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
> +};
> +
> +/* Memory Platform Communication Channel Info */
> +
> +struct acpi_mpst_channel {
> + ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
> +};
> +
> +/* Memory Power Node Structure */
> +
> +struct acpi_mpst_power_node {
> + u8 flags;
> + u8 reserved1;
> + u16 node_id;
> + u32 length;
> + u64 range_address;
> + u64 range_length;
> + u8 num_power_states;
> + u8 num_physical_components;
> + u16 reserved2;
> +};
> +
> +/* Values for Flags field above */
> +
> +#define ACPI_MPST_ENABLED               1
> +#define ACPI_MPST_POWER_MANAGED         2
> +#define ACPI_MPST_HOT_PLUG_CAPABLE      4
> +
> +/* Memory Power State Structure (follows POWER_NODE above) */
> +
> +struct acpi_mpst_power_state {
> + u8 power_state;
> + u8 info_index;
> +};
> +
> +/* Physical Component ID Structure (follows POWER_STATE above) */
> +
> +struct acpi_mpst_component {
> + u16 component_id;
> +};
> +
> +/* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
> +
> +struct acpi_mpst_data_hdr {
> + u16 characteristics_count;
> +};
> +
> +struct acpi_mpst_power_data {
> + u8 revision;
> + u8 flags;
> + u16 reserved1;
> + u32 average_power;
> + u32 power_saving;
> + u64 exit_latency;
> + u64 reserved2;
> +};
> +
> +/* Values for Flags field above */
> +
> +#define ACPI_MPST_PRESERVE              1
> +#define ACPI_MPST_AUTOENTRY             2
> +#define ACPI_MPST_AUTOEXIT              4
> +
> +/* Shared Memory Region (not part of an ACPI table) */
> +
> +struct acpi_mpst_shared {
> + u32 signature;
> + u16 pcc_command;
> + u16 pcc_status;
> + u16 command_register;
> + u16 status_register;
> + u16 power_state_id;
> + u16 power_node_id;
> + u64 energy_consumed;
> + u64 average_power;
> +};
> +
> +/****************************************************************************
> ***
> + *
> + * PCCT - Platform Communications Channel Table (ACPI 5.0)
> + *        Version 1
> + *
> + 
> 
******************************************************************************>
/
> +
> +struct acpi_table_pcct {
> + struct acpi_table_header header; /* Common ACPI table header */
> + u32 flags;
> + u32 latency;
> + u32 reserved;
> +};
> +
> +/* Values for Flags field above */
> +
> +#define ACPI_PCCT_DOORBELL              1
> +
> +/*
> + * PCCT subtables
> + */
> +
> +/* 0: Generic Communications Subspace */
> +
> +struct acpi_pcct_subspace {
> + struct acpi_subtable_header header;
> + u8 reserved[6];
> + u64 base_address;
> + u64 length;
> + struct acpi_generic_address doorbell_register;
> + u64 preserve_mask;
> + u64 write_mask;
> +};
> +
> +/*
> + * PCC memory structures (not part of the ACPI table)
> + */
> +
> +/* Shared Memory Region */
> +
> +struct acpi_pcct_shared_memory {
> + u32 signature;
> + u16 command;
> + u16 status;
> +};
> +
> +/****************************************************************************
> ***
> + *
> + * PMTT - Platform Memory Topology Table (ACPI 5.0)
> + *        Version 1
> + *
> + 
> 
******************************************************************************>
/
> +
> +struct acpi_table_pmtt {
> + struct acpi_table_header header; /* Common ACPI table header */
> + u32 reserved;
> +};
> +
> +/* Common header for PMTT subtables that follow main table */
> +
> +struct acpi_pmtt_header {
> + u8 type;
> + u8 reserved1;
> + u16 length;
> + u16 flags;
> + u16 reserved2;
> +};
> +
> +/* Values for Type field above */
> +
> +#define ACPI_PMTT_TYPE_SOCKET           0
> +#define ACPI_PMTT_TYPE_CONTROLLER       1
> +#define ACPI_PMTT_TYPE_DIMM             2
> +#define ACPI_PMTT_TYPE_RESERVED         3 /* 0x03-0xFF are reserved */
> +
> +/* Values for Flags field above */
> +
> +#define ACPI_PMTT_TOP_LEVEL             0x0001
> +#define ACPI_PMTT_PHYSICAL              0x0002
> +#define ACPI_PMTT_MEMORY_TYPE           0x000C
> +
> +/*
> + * PMTT subtables, correspond to Type in struct acpi_pmtt_header
> + */
> +
> +/* 0: Socket Structure */
> +
> +struct acpi_pmtt_socket {
> + struct acpi_pmtt_header header;
> + u16 socket_id;
> + u16 reserved;
> +};
> +
> +/* 1: Memory Controller subtable */
> +
> +struct acpi_pmtt_controller {
> + struct acpi_pmtt_header header;
> + u32 read_latency;
> + u32 write_latency;
> + u32 read_bandwidth;
> + u32 write_bandwidth;
> + u16 access_width;
> + u16 alignment;
> + u16 reserved;
> + u16 domain_count;
> +};
> +
> +/* 1a: Proximity Domain substructure */
> +
> +struct acpi_pmtt_domain {
> + u32 proximity_domain;
> +};
> +
> +/* 2: Physical Component Identifier (DIMM) */
> +
> +struct acpi_pmtt_physical_component {
> + struct acpi_pmtt_header header;
> + u16 component_id;
> + u16 reserved;
> + u32 memory_size;
> + u32 bios_handle;
> +};
> +
> +/****************************************************************************
> ***
> + *
> + * RASF - RAS Feature Table (ACPI 5.0)
> + *        Version 1
> + *
> + 
> 
******************************************************************************>
/
> +
> +struct acpi_table_rasf {
> + struct acpi_table_header header; /* Common ACPI table header */
> + u8 channel_id[12];
> +};
> +
> +/* RASF Platform Communication Channel Shared Memory Region */
> +
> +struct acpi_rasf_shared_memory {
> + u32 signature;
> + u16 command;
> + u16 status;
> + u64 requested_address;
> + u64 requested_length;
> + u64 actual_address;
> + u64 actual_length;
> + u16 flags;
> + u8 speed;
> +};
> +
> +/* Masks for Flags and Speed fields above */
> +
> +#define ACPI_RASF_SCRUBBER_RUNNING      1
> +#define ACPI_RASF_SPEED                 (7<<1)
> +
> +/* Channel Commands */
> +
> +enum acpi_rasf_commands {
> + ACPI_RASF_GET_RAS_CAPABILITIES = 1,
> + ACPI_RASF_GET_PATROL_PARAMETERS = 2,
> + ACPI_RASF_START_PATROL_SCRUBBER = 3,
> + ACPI_RASF_STOP_PATROL_SCRUBBER = 4
> +};
> +
> +/* Channel Command flags */
> +
> +#define ACPI_RASF_GENERATE_SCI          (1<<15)
> +
> +/* Status values */
> +
> +enum acpi_rasf_status {
> + ACPI_RASF_SUCCESS = 0,
> + ACPI_RASF_NOT_VALID = 1,
> + ACPI_RASF_NOT_SUPPORTED = 2,
> + ACPI_RASF_BUSY = 3,
> + ACPI_RASF_FAILED = 4,
> + ACPI_RASF_ABORTED = 5,
> + ACPI_RASF_INVALID_DATA = 6
> +};
> +
> +/* Status flags */
> +
> +#define ACPI_RASF_COMMAND_COMPLETE      (1)
> +#define ACPI_RASF_SCI_DOORBELL          (1<<1)
> +#define ACPI_RASF_ERROR                 (1<<2)
> +#define ACPI_RASF_STATUS                (0x1F<<3)
> +
> +/* Reset to default packing */
> +
> +#pragma pack()
> +
> +#endif    /* __ACTBL3_H__ */
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 17:16:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 17:16:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVQH2-0006LY-1I; Mon, 05 Nov 2012 17:15:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TVQH0-0006LG-GI
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 17:15:42 +0000
Received: from [85.158.139.211:3077] by server-15.bemta-5.messagelabs.com id
	3A/E5-26920-D34F7905; Mon, 05 Nov 2012 17:15:41 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1352135740!17462976!1
X-Originating-IP: [74.125.82.41]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21167 invoked from network); 5 Nov 2012 17:15:40 -0000
Received: from mail-wg0-f41.google.com (HELO mail-wg0-f41.google.com)
	(74.125.82.41)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 17:15:40 -0000
Received: by mail-wg0-f41.google.com with SMTP id ds1so2191893wgb.2
	for <xen-devel@lists.xen.org>; Mon, 05 Nov 2012 09:15:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=i9y4r6ymUYMBpoTYl2SK117ESVjGbRYHj4XnL01BtMM=;
	b=F/06IIj7SuCYIiEPEiHGf1iRxkmk/kCEF3wwt3cEzzwc+BPtoEueMfHN34Ki/Ef7eD
	L/mmRH21IjNkWtq+L7aG8CVYzEYXf/4e16g4FLZPCT2RUIJuo7qsDAgfbQX3At+SLczF
	LZKf6JZGljKiajWWCRZiZDkfwCrNIpTMZcHHeZUqJftLASVcgVTUGC95Wr3PnxZNVnLC
	SwxIpEQyMcJ+QB8bsAV6v8xvQBbHIGO/k/VxjnK3MBHJuhPjBTu8ZxH5ilC8IigX0qwJ
	c7v9VgmUZuq3l+uwg/5kB8fFkD0Dop75YwO5wLrxcnYqC+iQx4Q+O09hbzFqdZZqcbXH
	Pe7Q==
Received: by 10.216.197.65 with SMTP id s43mr3411388wen.41.1352135740384;
	Mon, 05 Nov 2012 09:15:40 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id eq2sm12766660wib.1.2012.11.05.09.15.37
	(version=SSLv3 cipher=OTHER); Mon, 05 Nov 2012 09:15:39 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Mon, 05 Nov 2012 17:15:26 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>, <wei.huang2@amd.com>,
	<weiwang.dd@gmail.com>, <xiantao.zhang@intel.com>
Message-ID: <CCBDA4AE.51026%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on faults
	for devices used by Xen or Dom0
Thread-Index: Ac27eSWbkBvIdXtbDUG++tGSRulbwA==
In-Reply-To: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Dario Faggioli <raistlin@linux.it>, Tim Deegan <tim@xen.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 05/11/2012 16:53, "Jan Beulich" <JBeulich@suse.com> wrote:

> Under the assumption that in these cases recurring faults aren't a
> security issue and it can be expected that the drivers there are going
> to try to take care of the problem.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Solving an observed problem?

 -- Keir

> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -625,6 +625,18 @@ static void parse_event_log_entry(struct
>          for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ )
>              if ( get_dma_requestor_id(iommu->seg, bdf) == device_id )
>              {
> +                const struct pci_dev *pdev;
> +
> +                spin_lock(&pcidevs_lock);
> +                pdev = pci_get_pdev(iommu->seg, PCI_BUS(bdf),
> PCI_DEVFN2(bdf));
> +                if ( pdev && pdev->domain != dom_xen &&
> +                     (!pdev->domain || !IS_PRIV(pdev->domain)) )
> +                    pdev = NULL;
> +                spin_unlock(&pcidevs_lock);
> +
> +                if ( pdev )
> +                    continue;
> +
>                  cword = pci_conf_read16(iommu->seg, PCI_BUS(bdf),
>                                          PCI_SLOT(bdf), PCI_FUNC(bdf),
>                                          PCI_COMMAND);
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -916,7 +916,8 @@ static void __do_iommu_page_fault(struct
>      reg = cap_fault_reg_offset(iommu->cap);
>      while (1)
>      {
> -        u8 fault_reason;
> +        const struct pci_dev *pdev;
> +        u8 fault_reason, bus;
>          u16 source_id, cword;
>          u32 data;
>          u64 guest_addr;
> @@ -950,14 +951,27 @@ static void __do_iommu_page_fault(struct
>          iommu_page_fault_do_one(iommu, type, fault_reason,
>                                  source_id, guest_addr);
>  
> -        /* Tell the device to stop DMAing; we can't rely on the guest to
> -         * control it for us. */
> -        cword = pci_conf_read16(iommu->intel->drhd->segment,
> -                                PCI_BUS(source_id), PCI_SLOT(source_id),
> -                                PCI_FUNC(source_id), PCI_COMMAND);
> -        pci_conf_write16(iommu->intel->drhd->segment, PCI_BUS(source_id),
> -                         PCI_SLOT(source_id), PCI_FUNC(source_id),
> -                         PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
> +        bus = PCI_BUS(source_id);
> +
> +        spin_lock(&pcidevs_lock);
> +        pdev = pci_get_pdev(iommu->intel->drhd->segment, bus,
> +                            PCI_DEVFN2(source_id));
> +        if ( pdev && pdev->domain != dom_xen &&
> +             (!pdev->domain || !IS_PRIV(pdev->domain)) )
> +            pdev = NULL;
> +        spin_unlock(&pcidevs_lock);
> +
> +        if ( !pdev )
> +        {
> +            /* Tell the device to stop DMAing; we can't rely on the guest to
> +             * control it for us. */
> +            cword = pci_conf_read16(iommu->intel->drhd->segment, bus,
> +                                    PCI_SLOT(source_id), PCI_FUNC(source_id),
> +                                    PCI_COMMAND);
> +            pci_conf_write16(iommu->intel->drhd->segment, bus,
> +                             PCI_SLOT(source_id), PCI_FUNC(source_id),
> +                             PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
> +        }
>  
>          fault_index++;
>          if ( fault_index > cap_num_fault_regs(iommu->cap) )
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 17:16:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 17:16:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVQH2-0006LY-1I; Mon, 05 Nov 2012 17:15:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TVQH0-0006LG-GI
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 17:15:42 +0000
Received: from [85.158.139.211:3077] by server-15.bemta-5.messagelabs.com id
	3A/E5-26920-D34F7905; Mon, 05 Nov 2012 17:15:41 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1352135740!17462976!1
X-Originating-IP: [74.125.82.41]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21167 invoked from network); 5 Nov 2012 17:15:40 -0000
Received: from mail-wg0-f41.google.com (HELO mail-wg0-f41.google.com)
	(74.125.82.41)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 17:15:40 -0000
Received: by mail-wg0-f41.google.com with SMTP id ds1so2191893wgb.2
	for <xen-devel@lists.xen.org>; Mon, 05 Nov 2012 09:15:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=i9y4r6ymUYMBpoTYl2SK117ESVjGbRYHj4XnL01BtMM=;
	b=F/06IIj7SuCYIiEPEiHGf1iRxkmk/kCEF3wwt3cEzzwc+BPtoEueMfHN34Ki/Ef7eD
	L/mmRH21IjNkWtq+L7aG8CVYzEYXf/4e16g4FLZPCT2RUIJuo7qsDAgfbQX3At+SLczF
	LZKf6JZGljKiajWWCRZiZDkfwCrNIpTMZcHHeZUqJftLASVcgVTUGC95Wr3PnxZNVnLC
	SwxIpEQyMcJ+QB8bsAV6v8xvQBbHIGO/k/VxjnK3MBHJuhPjBTu8ZxH5ilC8IigX0qwJ
	c7v9VgmUZuq3l+uwg/5kB8fFkD0Dop75YwO5wLrxcnYqC+iQx4Q+O09hbzFqdZZqcbXH
	Pe7Q==
Received: by 10.216.197.65 with SMTP id s43mr3411388wen.41.1352135740384;
	Mon, 05 Nov 2012 09:15:40 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id eq2sm12766660wib.1.2012.11.05.09.15.37
	(version=SSLv3 cipher=OTHER); Mon, 05 Nov 2012 09:15:39 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Mon, 05 Nov 2012 17:15:26 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>, <wei.huang2@amd.com>,
	<weiwang.dd@gmail.com>, <xiantao.zhang@intel.com>
Message-ID: <CCBDA4AE.51026%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on faults
	for devices used by Xen or Dom0
Thread-Index: Ac27eSWbkBvIdXtbDUG++tGSRulbwA==
In-Reply-To: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Dario Faggioli <raistlin@linux.it>, Tim Deegan <tim@xen.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 05/11/2012 16:53, "Jan Beulich" <JBeulich@suse.com> wrote:

> Under the assumption that in these cases recurring faults aren't a
> security issue and it can be expected that the drivers there are going
> to try to take care of the problem.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Solving an observed problem?

 -- Keir

> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -625,6 +625,18 @@ static void parse_event_log_entry(struct
>          for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ )
>              if ( get_dma_requestor_id(iommu->seg, bdf) == device_id )
>              {
> +                const struct pci_dev *pdev;
> +
> +                spin_lock(&pcidevs_lock);
> +                pdev = pci_get_pdev(iommu->seg, PCI_BUS(bdf),
> PCI_DEVFN2(bdf));
> +                if ( pdev && pdev->domain != dom_xen &&
> +                     (!pdev->domain || !IS_PRIV(pdev->domain)) )
> +                    pdev = NULL;
> +                spin_unlock(&pcidevs_lock);
> +
> +                if ( pdev )
> +                    continue;
> +
>                  cword = pci_conf_read16(iommu->seg, PCI_BUS(bdf),
>                                          PCI_SLOT(bdf), PCI_FUNC(bdf),
>                                          PCI_COMMAND);
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -916,7 +916,8 @@ static void __do_iommu_page_fault(struct
>      reg = cap_fault_reg_offset(iommu->cap);
>      while (1)
>      {
> -        u8 fault_reason;
> +        const struct pci_dev *pdev;
> +        u8 fault_reason, bus;
>          u16 source_id, cword;
>          u32 data;
>          u64 guest_addr;
> @@ -950,14 +951,27 @@ static void __do_iommu_page_fault(struct
>          iommu_page_fault_do_one(iommu, type, fault_reason,
>                                  source_id, guest_addr);
>  
> -        /* Tell the device to stop DMAing; we can't rely on the guest to
> -         * control it for us. */
> -        cword = pci_conf_read16(iommu->intel->drhd->segment,
> -                                PCI_BUS(source_id), PCI_SLOT(source_id),
> -                                PCI_FUNC(source_id), PCI_COMMAND);
> -        pci_conf_write16(iommu->intel->drhd->segment, PCI_BUS(source_id),
> -                         PCI_SLOT(source_id), PCI_FUNC(source_id),
> -                         PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
> +        bus = PCI_BUS(source_id);
> +
> +        spin_lock(&pcidevs_lock);
> +        pdev = pci_get_pdev(iommu->intel->drhd->segment, bus,
> +                            PCI_DEVFN2(source_id));
> +        if ( pdev && pdev->domain != dom_xen &&
> +             (!pdev->domain || !IS_PRIV(pdev->domain)) )
> +            pdev = NULL;
> +        spin_unlock(&pcidevs_lock);
> +
> +        if ( !pdev )
> +        {
> +            /* Tell the device to stop DMAing; we can't rely on the guest to
> +             * control it for us. */
> +            cword = pci_conf_read16(iommu->intel->drhd->segment, bus,
> +                                    PCI_SLOT(source_id), PCI_FUNC(source_id),
> +                                    PCI_COMMAND);
> +            pci_conf_write16(iommu->intel->drhd->segment, bus,
> +                             PCI_SLOT(source_id), PCI_FUNC(source_id),
> +                             PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
> +        }
>  
>          fault_index++;
>          if ( fault_index > cap_num_fault_regs(iommu->cap) )
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 18:22:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 18:22:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVRJB-00076k-Lk; Mon, 05 Nov 2012 18:22:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TVRJA-00076d-76
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 18:22:00 +0000
Received: from [85.158.143.99:11644] by server-1.bemta-4.messagelabs.com id
	13/D7-27934-7C308905; Mon, 05 Nov 2012 18:21:59 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1352139717!21691257!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjEyMDE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14778 invoked from network); 5 Nov 2012 18:21:58 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 5 Nov 2012 18:21:58 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA5ILh9u030240
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 5 Nov 2012 18:21:43 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA5ILeIT018364
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 5 Nov 2012 18:21:41 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA5ILdoA002447; Mon, 5 Nov 2012 12:21:39 -0600
MIME-Version: 1.0
Message-ID: <ab378e95-ecd4-423e-95e4-e1c8b8eee88f@default>
Date: Mon, 5 Nov 2012 10:21:31 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
References: <60d00f38-98a3-4ec2-acbd-b49dafaada56@default>
	<20121029223555.GA24388@ocelot.phlegethon.org>
	<eca242fa-20a1-42b1-943c-ca2ab1f5c4c4@default>
	<508F9DE902000078000A5565@nat28.tlf.novell.com>
	<a79693b2-ff7f-4b45-9eee-6ddb1bbcb84a@default>
	<5097F3E9.1060404@eu.citrix.com>
In-Reply-To: <5097F3E9.1060404@eu.citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "Tim \(Xen.org\)" <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	"Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Jan Beulich <JBeulich@suse.com>, Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: George Dunlap [mailto:george.dunlap@eu.citrix.com]
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> 
> On 30/10/12 15:43, Dan Magenheimer wrote:
> > a) Truly free memory (each free page is on the hypervisor free list)
> > b) Freeable memory ("ephmeral" memory managed by tmem)
> > c) Owned memory (pages allocated by the hypervisor or for a domain)
> >
> > The sum of these three is always a constant: The total number of
> > RAM pages in the system.  However, when tmem is active, the values
> > of all _three_ of these change constantly.  So if at the start of a
> > domain launch, the sum of free+freeable exceeds the intended size
> > of the domain, the domain allocation/launch can start.

> (And please don't start another rant about the bold new world of peace
> and love.  Give me a freaking *technical* answer.)

<grin> /Me removes seventies-style tie-dye tshirt with peace logo
and sadly withdraws single daisy previously extended to George.

> Why free+freeable, rather than just "free"?

A free page is a page that is not used for anything at all.
It is on the hypervisor's free list.  A freeable page contains tmem
ephemeral data stored on behalf of a domain (or, if dedup'ing
is enabled, on behalf of one or more domains).  More specifically
for a tmem-enabled Linux guest, a freeable page contains a clean
page cache page that the Linux guest OS has asked the hypervisor
(via the tmem ABI) to hold if it can for as long as it can.
The specific clean page cache pages are chosen and the call is
done on the Linux side via "cleancache".

So, when tmem is working optimally, there are few or no free
pages and many many freeable pages (perhaps half of physical
RAM or more).

Freeable pages across all tmem-enabled guests are kept in a single
LRU queue.  When a request is made to the hypervisor allocator for
a free page and its free list is empty, the allocator will force
tmem to relinquish an ephemeral page (in LRU order).  Because
this is entirely up to the hypervisor and can happen at any
time, freeable pages are not counted as "owned" by a domain but
still have some value to a domain.

So, in essence, a "free" page has zero value and a "freeable"
page has a small, but non-zero value that decays over time.
So it's useful for a toolstack to know both quantities.

(And, since this thread has gone in many directions, let me
reiterate that all of this has been working in the hypervisor
since 4.0 in 2009, and cleancache in Linux since mid-2011.)
 
> >   But then
> > if "owned" increases enough, there may no longer be enough memory
> > and the domain launch will fail.
> 
> Again, "owned" would not increase at all if the guest weren't handing
> memory back to Xen.  Why is that necessary, or even helpful?

The guest _is_ handing memory back to Xen.  This is the other half
of the tmem functionality, persistent pages.

Answering your second question is going to require a little more
background.

Since nobody, not even the guest kernel, can guess the future
needs of its workload, there are two choices: (1) allocate enough
RAM so that the supply always exceeds max-demand, or (2) aggressively
reduce RAM to a reasonable guess for a target and prepare for the
probability that, sometimes, available RAM won't be enough.  Tmem does
choice #2; self-ballooning aggressively drives RAM (or "current memory"
as the hypervisor sees it) to a target level: in Linux, to Committed_AS
modified by a formula similar to the one Novell derived for a minimum
ballooning safety level.  The target level changes constantly, but the
selfballooning code samples and adjusts only periodically.  If, during
the time interval between samples, memory demand spikes, Linux
has a memory shortage and responds as it must, namely by swapping.

The frontswap code in Linux "intercepts" this swapping so that,
in most cases, it goes to a Xen tmem persistent pool instead of
to a (virtual or physical) swap disk.  Data in persistent pools,
unlike ephemeral pools, are guaranteed to be maintained by the
hypervisor until the guest invalidates it or until the guest dies.
As a result, pages allocated for persistent pools increase the count
of pages "owned" by the domain that requested the pages, until the guest
explicitly invalidates them (or dies).  The accounting also ensures
that malicious domains can't absorb memory beyond the toolset-specified
limit ("maxmem").

Note that, if compression is enabled, a domain _may_ "logically"
exceed maxmem, as long as it does not physically exceed it.

(And, again, all of this too has been in Xen since 4.0 in 2009,
and selfballooning has been in Linux since mid-2011, but frontswap
finally was accepted into Linux earlier in 2012.)

Ok, George, does that answer your questions, _technically_?  I'll
be happy to answer any others.

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 18:22:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 18:22:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVRJB-00076k-Lk; Mon, 05 Nov 2012 18:22:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TVRJA-00076d-76
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 18:22:00 +0000
Received: from [85.158.143.99:11644] by server-1.bemta-4.messagelabs.com id
	13/D7-27934-7C308905; Mon, 05 Nov 2012 18:21:59 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1352139717!21691257!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjEyMDE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14778 invoked from network); 5 Nov 2012 18:21:58 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 5 Nov 2012 18:21:58 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA5ILh9u030240
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 5 Nov 2012 18:21:43 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA5ILeIT018364
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 5 Nov 2012 18:21:41 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA5ILdoA002447; Mon, 5 Nov 2012 12:21:39 -0600
MIME-Version: 1.0
Message-ID: <ab378e95-ecd4-423e-95e4-e1c8b8eee88f@default>
Date: Mon, 5 Nov 2012 10:21:31 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
References: <60d00f38-98a3-4ec2-acbd-b49dafaada56@default>
	<20121029223555.GA24388@ocelot.phlegethon.org>
	<eca242fa-20a1-42b1-943c-ca2ab1f5c4c4@default>
	<508F9DE902000078000A5565@nat28.tlf.novell.com>
	<a79693b2-ff7f-4b45-9eee-6ddb1bbcb84a@default>
	<5097F3E9.1060404@eu.citrix.com>
In-Reply-To: <5097F3E9.1060404@eu.citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "Tim \(Xen.org\)" <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	"Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Jan Beulich <JBeulich@suse.com>, Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: George Dunlap [mailto:george.dunlap@eu.citrix.com]
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> 
> On 30/10/12 15:43, Dan Magenheimer wrote:
> > a) Truly free memory (each free page is on the hypervisor free list)
> > b) Freeable memory ("ephmeral" memory managed by tmem)
> > c) Owned memory (pages allocated by the hypervisor or for a domain)
> >
> > The sum of these three is always a constant: The total number of
> > RAM pages in the system.  However, when tmem is active, the values
> > of all _three_ of these change constantly.  So if at the start of a
> > domain launch, the sum of free+freeable exceeds the intended size
> > of the domain, the domain allocation/launch can start.

> (And please don't start another rant about the bold new world of peace
> and love.  Give me a freaking *technical* answer.)

<grin> /Me removes seventies-style tie-dye tshirt with peace logo
and sadly withdraws single daisy previously extended to George.

> Why free+freeable, rather than just "free"?

A free page is a page that is not used for anything at all.
It is on the hypervisor's free list.  A freeable page contains tmem
ephemeral data stored on behalf of a domain (or, if dedup'ing
is enabled, on behalf of one or more domains).  More specifically
for a tmem-enabled Linux guest, a freeable page contains a clean
page cache page that the Linux guest OS has asked the hypervisor
(via the tmem ABI) to hold if it can for as long as it can.
The specific clean page cache pages are chosen and the call is
done on the Linux side via "cleancache".

So, when tmem is working optimally, there are few or no free
pages and many many freeable pages (perhaps half of physical
RAM or more).

Freeable pages across all tmem-enabled guests are kept in a single
LRU queue.  When a request is made to the hypervisor allocator for
a free page and its free list is empty, the allocator will force
tmem to relinquish an ephemeral page (in LRU order).  Because
this is entirely up to the hypervisor and can happen at any
time, freeable pages are not counted as "owned" by a domain but
still have some value to a domain.

So, in essence, a "free" page has zero value and a "freeable"
page has a small, but non-zero value that decays over time.
So it's useful for a toolstack to know both quantities.

(And, since this thread has gone in many directions, let me
reiterate that all of this has been working in the hypervisor
since 4.0 in 2009, and cleancache in Linux since mid-2011.)
 
> >   But then
> > if "owned" increases enough, there may no longer be enough memory
> > and the domain launch will fail.
> 
> Again, "owned" would not increase at all if the guest weren't handing
> memory back to Xen.  Why is that necessary, or even helpful?

The guest _is_ handing memory back to Xen.  This is the other half
of the tmem functionality, persistent pages.

Answering your second question is going to require a little more
background.

Since nobody, not even the guest kernel, can guess the future
needs of its workload, there are two choices: (1) allocate enough
RAM so that the supply always exceeds max-demand, or (2) aggressively
reduce RAM to a reasonable guess for a target and prepare for the
probability that, sometimes, available RAM won't be enough.  Tmem does
choice #2; self-ballooning aggressively drives RAM (or "current memory"
as the hypervisor sees it) to a target level: in Linux, to Committed_AS
modified by a formula similar to the one Novell derived for a minimum
ballooning safety level.  The target level changes constantly, but the
selfballooning code samples and adjusts only periodically.  If, during
the time interval between samples, memory demand spikes, Linux
has a memory shortage and responds as it must, namely by swapping.

The frontswap code in Linux "intercepts" this swapping so that,
in most cases, it goes to a Xen tmem persistent pool instead of
to a (virtual or physical) swap disk.  Data in persistent pools,
unlike ephemeral pools, are guaranteed to be maintained by the
hypervisor until the guest invalidates it or until the guest dies.
As a result, pages allocated for persistent pools increase the count
of pages "owned" by the domain that requested the pages, until the guest
explicitly invalidates them (or dies).  The accounting also ensures
that malicious domains can't absorb memory beyond the toolset-specified
limit ("maxmem").

Note that, if compression is enabled, a domain _may_ "logically"
exceed maxmem, as long as it does not physically exceed it.

(And, again, all of this too has been in Xen since 4.0 in 2009,
and selfballooning has been in Linux since mid-2011, but frontswap
finally was accepted into Linux earlier in 2012.)

Ok, George, does that answer your questions, _technically_?  I'll
be happy to answer any others.

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 19:00:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 19:00:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVRuJ-0007Qm-MV; Mon, 05 Nov 2012 19:00:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TVRuH-0007Qh-Qe
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 19:00:22 +0000
Received: from [85.158.139.83:51231] by server-3.bemta-5.messagelabs.com id
	BA/6E-18736-4CC08905; Mon, 05 Nov 2012 19:00:20 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1352142017!28862985!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAzNzAyOQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9781 invoked from network); 5 Nov 2012 19:00:19 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-2.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 5 Nov 2012 19:00:19 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA5J0Fun008606
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 5 Nov 2012 19:00:16 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA5J0CV2011637
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 5 Nov 2012 19:00:13 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA5J0BCg032187; Mon, 5 Nov 2012 13:00:12 -0600
MIME-Version: 1.0
Message-ID: <0ea96cac-0b8f-43bc-99a9-d330b4ea3d76@default>
Date: Mon, 5 Nov 2012 11:00:04 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Tim Deegan <tim@xen.org>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<20121101204622.GA66969@ocelot.phlegethon.org>
	<e47d14a7-65e2-4e0e-aec9-3cc4379aa272@default>
	<20121102093055.GA77212@ocelot.phlegethon.org>
In-Reply-To: <20121102093055.GA77212@ocelot.phlegethon.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "Keir \(Xen.org\)" <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Tim Deegan [mailto:tim@xen.org]
> Sent: Friday, November 02, 2012 3:31 AM
> To: Dan Magenheimer
> Cc: Keir (Xen.org); Jan Beulich; xen-devel@lists.xen.org
> Subject: Re: [Xen-devel] 32bit xen and "claim"
> 
> At 13:57 -0700 on 01 Nov (1351778261), Dan Magenheimer wrote:
> > > From: Tim Deegan [mailto:tim@xen.org]
> > > Subject: Re: [Xen-devel] 32bit xen and "claim"
> > >
> > > At 13:34 -0700 on 01 Nov (1351776880), Dan Magenheimer wrote:
> > > > With the plan to obsolete the x86 32-bit hypervisor at 4.3,
> > > > when prototyping the "claim" hypercall/subop, can I assume
> > > > that the CONFIG_X86 code in the hypervisor and, specifically
> > > > any separation of the concepts of xen_heap from dom_heap,
> > > > can be ignored?
> > > >
> > > > Or will the ARM version of the hypervisor be requiring
> > > > a similar separation of xen_heap vs dom_heap?
> > >
> > > Yes, 32-bit ARM has this separation.
> >
> > Hmmm... looking at page_alloc.c... does ARM overload CONFIG_X86
> > to mean CONFIG-32-bitness then?
> 
> No.  CONFIG_X86 doesn't mean 32-bit, even on x86; it means i386/amd64 as
> distinct from MIPS/ARM/PPC.

Oops, sorry, I was confusing the old code in page_alloc.c that
said:

	#if !defined(__x86_64__) && !defined(__ia64__)

when I was reading the new code that says:

	#if !defined(CONFIG_X86)

(why not #ifndef?)

Sorry for the ARM-y noise. :-(

But as long as I've bothered you already... does the ARM port
already (or will it soon) support 64-bit versions of ARM?

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 19:00:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 19:00:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVRuJ-0007Qm-MV; Mon, 05 Nov 2012 19:00:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TVRuH-0007Qh-Qe
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 19:00:22 +0000
Received: from [85.158.139.83:51231] by server-3.bemta-5.messagelabs.com id
	BA/6E-18736-4CC08905; Mon, 05 Nov 2012 19:00:20 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1352142017!28862985!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAzNzAyOQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9781 invoked from network); 5 Nov 2012 19:00:19 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-2.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 5 Nov 2012 19:00:19 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA5J0Fun008606
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 5 Nov 2012 19:00:16 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA5J0CV2011637
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 5 Nov 2012 19:00:13 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA5J0BCg032187; Mon, 5 Nov 2012 13:00:12 -0600
MIME-Version: 1.0
Message-ID: <0ea96cac-0b8f-43bc-99a9-d330b4ea3d76@default>
Date: Mon, 5 Nov 2012 11:00:04 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Tim Deegan <tim@xen.org>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<20121101204622.GA66969@ocelot.phlegethon.org>
	<e47d14a7-65e2-4e0e-aec9-3cc4379aa272@default>
	<20121102093055.GA77212@ocelot.phlegethon.org>
In-Reply-To: <20121102093055.GA77212@ocelot.phlegethon.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "Keir \(Xen.org\)" <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Tim Deegan [mailto:tim@xen.org]
> Sent: Friday, November 02, 2012 3:31 AM
> To: Dan Magenheimer
> Cc: Keir (Xen.org); Jan Beulich; xen-devel@lists.xen.org
> Subject: Re: [Xen-devel] 32bit xen and "claim"
> 
> At 13:57 -0700 on 01 Nov (1351778261), Dan Magenheimer wrote:
> > > From: Tim Deegan [mailto:tim@xen.org]
> > > Subject: Re: [Xen-devel] 32bit xen and "claim"
> > >
> > > At 13:34 -0700 on 01 Nov (1351776880), Dan Magenheimer wrote:
> > > > With the plan to obsolete the x86 32-bit hypervisor at 4.3,
> > > > when prototyping the "claim" hypercall/subop, can I assume
> > > > that the CONFIG_X86 code in the hypervisor and, specifically
> > > > any separation of the concepts of xen_heap from dom_heap,
> > > > can be ignored?
> > > >
> > > > Or will the ARM version of the hypervisor be requiring
> > > > a similar separation of xen_heap vs dom_heap?
> > >
> > > Yes, 32-bit ARM has this separation.
> >
> > Hmmm... looking at page_alloc.c... does ARM overload CONFIG_X86
> > to mean CONFIG-32-bitness then?
> 
> No.  CONFIG_X86 doesn't mean 32-bit, even on x86; it means i386/amd64 as
> distinct from MIPS/ARM/PPC.

Oops, sorry, I was confusing the old code in page_alloc.c that
said:

	#if !defined(__x86_64__) && !defined(__ia64__)

when I was reading the new code that says:

	#if !defined(CONFIG_X86)

(why not #ifndef?)

Sorry for the ARM-y noise. :-(

But as long as I've bothered you already... does the ARM port
already (or will it soon) support 64-bit versions of ARM?

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 19:07:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 19:07:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVS05-0007aH-G1; Mon, 05 Nov 2012 19:06:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TVS04-0007aA-5V
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 19:06:20 +0000
Received: from [85.158.139.83:12796] by server-12.bemta-5.messagelabs.com id
	42/12-02886-B2E08905; Mon, 05 Nov 2012 19:06:19 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352142378!21643116!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29697 invoked from network); 5 Nov 2012 19:06:18 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-11.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 5 Nov 2012 19:06:18 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TVS01-0006We-DR; Mon, 05 Nov 2012 19:06:17 +0000
Date: Mon, 5 Nov 2012 19:06:17 +0000
From: Tim Deegan <tim@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <20121105190617.GA21990@ocelot.phlegethon.org>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<20121101204622.GA66969@ocelot.phlegethon.org>
	<e47d14a7-65e2-4e0e-aec9-3cc4379aa272@default>
	<20121102093055.GA77212@ocelot.phlegethon.org>
	<0ea96cac-0b8f-43bc-99a9-d330b4ea3d76@default>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <0ea96cac-0b8f-43bc-99a9-d330b4ea3d76@default>
User-Agent: Mutt/1.4.2.1i
Cc: "Keir \(Xen.org\)" <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 11:00 -0800 on 05 Nov (1352113204), Dan Magenheimer wrote:
> But as long as I've bothered you already... does the ARM port
> already (or will it soon) support 64-bit versions of ARM?

Real Soon Now, we hope.  We've been a bit distracted by having actual
hardware to test the 32-bit version on, but 64-bit support is definitely
planned.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 19:07:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 19:07:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVS05-0007aH-G1; Mon, 05 Nov 2012 19:06:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TVS04-0007aA-5V
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 19:06:20 +0000
Received: from [85.158.139.83:12796] by server-12.bemta-5.messagelabs.com id
	42/12-02886-B2E08905; Mon, 05 Nov 2012 19:06:19 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352142378!21643116!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29697 invoked from network); 5 Nov 2012 19:06:18 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-11.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 5 Nov 2012 19:06:18 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TVS01-0006We-DR; Mon, 05 Nov 2012 19:06:17 +0000
Date: Mon, 5 Nov 2012 19:06:17 +0000
From: Tim Deegan <tim@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <20121105190617.GA21990@ocelot.phlegethon.org>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<20121101204622.GA66969@ocelot.phlegethon.org>
	<e47d14a7-65e2-4e0e-aec9-3cc4379aa272@default>
	<20121102093055.GA77212@ocelot.phlegethon.org>
	<0ea96cac-0b8f-43bc-99a9-d330b4ea3d76@default>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <0ea96cac-0b8f-43bc-99a9-d330b4ea3d76@default>
User-Agent: Mutt/1.4.2.1i
Cc: "Keir \(Xen.org\)" <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 11:00 -0800 on 05 Nov (1352113204), Dan Magenheimer wrote:
> But as long as I've bothered you already... does the ARM port
> already (or will it soon) support 64-bit versions of ARM?

Real Soon Now, we hope.  We've been a bit distracted by having actual
hardware to test the 32-bit version on, but 64-bit support is definitely
planned.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 19:17:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 19:17:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVSAI-0007lO-Jr; Mon, 05 Nov 2012 19:16:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TVSAH-0007lJ-OT
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 19:16:53 +0000
Received: from [85.158.143.99:15276] by server-2.bemta-4.messagelabs.com id
	83/E8-28922-5A018905; Mon, 05 Nov 2012 19:16:53 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1352143011!21695885!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAzNzAyOQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18899 invoked from network); 5 Nov 2012 19:16:52 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 5 Nov 2012 19:16:52 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA5JGl59026921
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 5 Nov 2012 19:16:48 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA5JGkK6020617
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 5 Nov 2012 19:16:47 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA5JGjPp012389; Mon, 5 Nov 2012 13:16:45 -0600
MIME-Version: 1.0
Message-ID: <00c25fab-a110-4f4b-a596-6cdfeb5b0d26@default>
Date: Mon, 5 Nov 2012 11:16:38 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<5092DE7E020000780008EB96@nat28.tlf.novell.com>
	<75058642-ad3b-4df9-a24a-7dbdc5f6e8c5@default>
	<5093954902000078000A5F45@nat28.tlf.novell.com>
In-Reply-To: <5093954902000078000A5F45@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Subject: RE: 32bit xen and "claim"
> 
> >>> On 01.11.12 at 21:55, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> >> >when prototyping the "claim" hypercall/subop, can I assume
> >> >that the CONFIG_X86 code in the hypervisor and, specifically
> >> >any separation of the concepts of xen_heap from dom_heap,
> >> >can be ignored?
> >>
> >> No, you shouldn't. Once adding support for memory amounts beyond 5Tb
> >> I expect the separation to become meaningful even for x86-64.
> >
> > On quick scan, I don't see anything obvious in the archives
> > that explains why 5Tb is the limit (rather than, say, 4Tb
> > or 8Tb, or some other power of two).  Could you provide a
> > pointer to this info or, if you agree it is non-obvious and
> > undocumented, say a few words of explanation?
> 
> xen/include/asm-x86/config.h:DIRECTMAP_* (and the comment
> preceding all those #define-s).

Sorry if this is a silly question, but the hex value
0xffff880000000000 looks like a Linux kernel base address
so it made me wonder:

Do I understand correctly that the 5TB limit only applies
because of legacy PV guests?
 
> > Also, just wondering, should exceeding 5Tb be on the 4.3
> > features list or is >5Tb physical memory still too far away?
> 
> It _is_ on the feature list. So far I just had way too many other
> issues to deal with, preventing me to get started with that work.

Sorry, I should have looked that up first. :-}

Does it make sense to have a runtime option that unsets the
physical limit but disallows legacy PV guests?  If this
defaults to false for machines with RAM<=5TB but to true
for machines with RAM>5TB, then the feature is "done"
(AND we have put a stake in the ground to begin the
slow obsolescence of PV functionality).

Just an idea...

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 19:17:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 19:17:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVSAI-0007lO-Jr; Mon, 05 Nov 2012 19:16:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TVSAH-0007lJ-OT
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 19:16:53 +0000
Received: from [85.158.143.99:15276] by server-2.bemta-4.messagelabs.com id
	83/E8-28922-5A018905; Mon, 05 Nov 2012 19:16:53 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1352143011!21695885!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAzNzAyOQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18899 invoked from network); 5 Nov 2012 19:16:52 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 5 Nov 2012 19:16:52 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA5JGl59026921
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 5 Nov 2012 19:16:48 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA5JGkK6020617
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 5 Nov 2012 19:16:47 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA5JGjPp012389; Mon, 5 Nov 2012 13:16:45 -0600
MIME-Version: 1.0
Message-ID: <00c25fab-a110-4f4b-a596-6cdfeb5b0d26@default>
Date: Mon, 5 Nov 2012 11:16:38 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<5092DE7E020000780008EB96@nat28.tlf.novell.com>
	<75058642-ad3b-4df9-a24a-7dbdc5f6e8c5@default>
	<5093954902000078000A5F45@nat28.tlf.novell.com>
In-Reply-To: <5093954902000078000A5F45@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Subject: RE: 32bit xen and "claim"
> 
> >>> On 01.11.12 at 21:55, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> >> >when prototyping the "claim" hypercall/subop, can I assume
> >> >that the CONFIG_X86 code in the hypervisor and, specifically
> >> >any separation of the concepts of xen_heap from dom_heap,
> >> >can be ignored?
> >>
> >> No, you shouldn't. Once adding support for memory amounts beyond 5Tb
> >> I expect the separation to become meaningful even for x86-64.
> >
> > On quick scan, I don't see anything obvious in the archives
> > that explains why 5Tb is the limit (rather than, say, 4Tb
> > or 8Tb, or some other power of two).  Could you provide a
> > pointer to this info or, if you agree it is non-obvious and
> > undocumented, say a few words of explanation?
> 
> xen/include/asm-x86/config.h:DIRECTMAP_* (and the comment
> preceding all those #define-s).

Sorry if this is a silly question, but the hex value
0xffff880000000000 looks like a Linux kernel base address
so it made me wonder:

Do I understand correctly that the 5TB limit only applies
because of legacy PV guests?
 
> > Also, just wondering, should exceeding 5Tb be on the 4.3
> > features list or is >5Tb physical memory still too far away?
> 
> It _is_ on the feature list. So far I just had way too many other
> issues to deal with, preventing me to get started with that work.

Sorry, I should have looked that up first. :-}

Does it make sense to have a runtime option that unsets the
physical limit but disallows legacy PV guests?  If this
defaults to false for machines with RAM<=5TB but to true
for machines with RAM>5TB, then the feature is "done"
(AND we have put a stake in the ground to begin the
slow obsolescence of PV functionality).

Just an idea...

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 19:50:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 19:50:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVSgo-0000Gb-Ru; Mon, 05 Nov 2012 19:50:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TVSgn-0000GW-6w
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 19:50:29 +0000
Received: from [85.158.139.211:44400] by server-13.bemta-5.messagelabs.com id
	95/95-27809-48818905; Mon, 05 Nov 2012 19:50:28 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1352145027!18928397!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3029 invoked from network); 5 Nov 2012 19:50:27 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 19:50:27 -0000
Received: by mail-we0-f173.google.com with SMTP id t11so3447895wey.32
	for <xen-devel@lists.xen.org>; Mon, 05 Nov 2012 11:50:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=EuPrvUd2LkIzTa5qnyp6SwdvYzQwUx5Lb0c5ZPe1j3A=;
	b=PVVc60x2/MWdyaTp4OJJiqci6bqUb27zDfjrR6R086Xz7HwEpZCNnE3t5IJO/JEcua
	ynbTdAjW6QbA0pOwjEoPMlAzaVKSfKlVN79I2v+O0fEXkzQtbx4WKft014JzLV16pdi1
	R8teZm25Ta7GHmI/73uDoz+fd7EucBIVQ5BgD4cCjyp9Ja+pNLhGG60sCe1zkOFr0XXl
	mlSVAnm0jIEYTH62MD+Q180Wi+fSeSmMlivffCr6fMrqF7g+eJ87pHzt/KOeVbc700f0
	jO0u2OJ1j7fdCAjVTc/XJwvFasOVVAx9o57chT0GV+VymU6aRkD0ksE2CsoIv5+VJeFn
	rDqA==
Received: by 10.216.194.26 with SMTP id l26mr3402413wen.17.1352145027744;
	Mon, 05 Nov 2012 11:50:27 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id k20sm11710808wiv.11.2012.11.05.11.50.23
	(version=SSLv3 cipher=OTHER); Mon, 05 Nov 2012 11:50:27 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Mon, 05 Nov 2012 19:50:14 +0000
From: Keir Fraser <keir@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Jan Beulich <JBeulich@suse.com>
Message-ID: <CCBDC8F6.51043%keir@xen.org>
Thread-Topic: 32bit xen and "claim"
Thread-Index: Ac27jsWvyWW6G6LDq0GIksemjYIftg==
In-Reply-To: <00c25fab-a110-4f4b-a596-6cdfeb5b0d26@default>
Mime-version: 1.0
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 05/11/2012 19:16, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:

>> xen/include/asm-x86/config.h:DIRECTMAP_* (and the comment
>> preceding all those #define-s).
> 
> Sorry if this is a silly question, but the hex value
> 0xffff880000000000 looks like a Linux kernel base address
> so it made me wonder:
> 
> Do I understand correctly that the 5TB limit only applies
> because of legacy PV guests?

Yes. For HVM guests we can direct-map all physical memory, all the time. We
will only ever need ephemeral mappings on x86/64 when running PV guests.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 19:50:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 19:50:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVSgo-0000Gb-Ru; Mon, 05 Nov 2012 19:50:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TVSgn-0000GW-6w
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 19:50:29 +0000
Received: from [85.158.139.211:44400] by server-13.bemta-5.messagelabs.com id
	95/95-27809-48818905; Mon, 05 Nov 2012 19:50:28 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1352145027!18928397!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3029 invoked from network); 5 Nov 2012 19:50:27 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 19:50:27 -0000
Received: by mail-we0-f173.google.com with SMTP id t11so3447895wey.32
	for <xen-devel@lists.xen.org>; Mon, 05 Nov 2012 11:50:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=EuPrvUd2LkIzTa5qnyp6SwdvYzQwUx5Lb0c5ZPe1j3A=;
	b=PVVc60x2/MWdyaTp4OJJiqci6bqUb27zDfjrR6R086Xz7HwEpZCNnE3t5IJO/JEcua
	ynbTdAjW6QbA0pOwjEoPMlAzaVKSfKlVN79I2v+O0fEXkzQtbx4WKft014JzLV16pdi1
	R8teZm25Ta7GHmI/73uDoz+fd7EucBIVQ5BgD4cCjyp9Ja+pNLhGG60sCe1zkOFr0XXl
	mlSVAnm0jIEYTH62MD+Q180Wi+fSeSmMlivffCr6fMrqF7g+eJ87pHzt/KOeVbc700f0
	jO0u2OJ1j7fdCAjVTc/XJwvFasOVVAx9o57chT0GV+VymU6aRkD0ksE2CsoIv5+VJeFn
	rDqA==
Received: by 10.216.194.26 with SMTP id l26mr3402413wen.17.1352145027744;
	Mon, 05 Nov 2012 11:50:27 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id k20sm11710808wiv.11.2012.11.05.11.50.23
	(version=SSLv3 cipher=OTHER); Mon, 05 Nov 2012 11:50:27 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Mon, 05 Nov 2012 19:50:14 +0000
From: Keir Fraser <keir@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Jan Beulich <JBeulich@suse.com>
Message-ID: <CCBDC8F6.51043%keir@xen.org>
Thread-Topic: 32bit xen and "claim"
Thread-Index: Ac27jsWvyWW6G6LDq0GIksemjYIftg==
In-Reply-To: <00c25fab-a110-4f4b-a596-6cdfeb5b0d26@default>
Mime-version: 1.0
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 05/11/2012 19:16, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:

>> xen/include/asm-x86/config.h:DIRECTMAP_* (and the comment
>> preceding all those #define-s).
> 
> Sorry if this is a silly question, but the hex value
> 0xffff880000000000 looks like a Linux kernel base address
> so it made me wonder:
> 
> Do I understand correctly that the 5TB limit only applies
> because of legacy PV guests?

Yes. For HVM guests we can direct-map all physical memory, all the time. We
will only ever need ephemeral mappings on x86/64 when running PV guests.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 19:51:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 19:51:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVShq-0000NF-F4; Mon, 05 Nov 2012 19:51:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TVSho-0000N1-U8
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 19:51:33 +0000
Received: from [85.158.139.211:52571] by server-6.bemta-5.messagelabs.com id
	6E/F9-19321-4C818905; Mon, 05 Nov 2012 19:51:32 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1352145091!18997780!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15324 invoked from network); 5 Nov 2012 19:51:31 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 19:51:31 -0000
Received: by mail-wi0-f173.google.com with SMTP id hm4so2991188wib.14
	for <xen-devel@lists.xen.org>; Mon, 05 Nov 2012 11:51:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=JKqW4nafINkk8kWuOFtLAJdtTE8Jzjb1T6A9TaWnkoA=;
	b=t+9boMO4+E6+8uBXwFzEMuFkwkt5twF/dDnsVR2zsY9szyoLplBL0UMgsZARNxfuWS
	rVEa7qMy2SEhIUzAfTIHyfllRKm08oqNQBuxJ6+g8drv49W/MfrrISGfLj5KttBNB43V
	LbG6TV70lrwZ82fPZhvtS0akExh06KNEDquXF01nfRKngfn/JnP88XWp8llf/UJLBIB6
	87gW3eOPgfQqJrOfKU1Ld8JPwRUwEQxSr3FYlH8smp1JPVzlXhseZEKLvT5FBeUNnQPu
	y0kZnykhnQCuENi3fR4Qpp7hnE7nDhujB0IiP6mtzW86DUf9bzookhfX5UdkYX3k27BO
	3fTA==
Received: by 10.216.217.195 with SMTP id i45mr3790999wep.14.1352145091572;
	Mon, 05 Nov 2012 11:51:31 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id hv4sm3125532wib.0.2012.11.05.11.51.29
	(version=SSLv3 cipher=OTHER); Mon, 05 Nov 2012 11:51:31 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Mon, 05 Nov 2012 19:51:25 +0000
From: Keir Fraser <keir@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Tim Deegan <tim@xen.org>
Message-ID: <CCBDC93D.51044%keir@xen.org>
Thread-Topic: [Xen-devel] 32bit xen and "claim"
Thread-Index: Ac27jvABriuTPWew902kug2rj1eumQ==
In-Reply-To: <0ea96cac-0b8f-43bc-99a9-d330b4ea3d76@default>
Mime-version: 1.0
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 05/11/2012 19:00, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:

> #if !defined(CONFIG_X86)
> 
> (why not #ifndef?)

We have no coding convention to prefer one over the other. Personally I
would say they are equally readable.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 19:51:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 19:51:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVShq-0000NF-F4; Mon, 05 Nov 2012 19:51:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TVSho-0000N1-U8
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 19:51:33 +0000
Received: from [85.158.139.211:52571] by server-6.bemta-5.messagelabs.com id
	6E/F9-19321-4C818905; Mon, 05 Nov 2012 19:51:32 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1352145091!18997780!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15324 invoked from network); 5 Nov 2012 19:51:31 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 19:51:31 -0000
Received: by mail-wi0-f173.google.com with SMTP id hm4so2991188wib.14
	for <xen-devel@lists.xen.org>; Mon, 05 Nov 2012 11:51:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=JKqW4nafINkk8kWuOFtLAJdtTE8Jzjb1T6A9TaWnkoA=;
	b=t+9boMO4+E6+8uBXwFzEMuFkwkt5twF/dDnsVR2zsY9szyoLplBL0UMgsZARNxfuWS
	rVEa7qMy2SEhIUzAfTIHyfllRKm08oqNQBuxJ6+g8drv49W/MfrrISGfLj5KttBNB43V
	LbG6TV70lrwZ82fPZhvtS0akExh06KNEDquXF01nfRKngfn/JnP88XWp8llf/UJLBIB6
	87gW3eOPgfQqJrOfKU1Ld8JPwRUwEQxSr3FYlH8smp1JPVzlXhseZEKLvT5FBeUNnQPu
	y0kZnykhnQCuENi3fR4Qpp7hnE7nDhujB0IiP6mtzW86DUf9bzookhfX5UdkYX3k27BO
	3fTA==
Received: by 10.216.217.195 with SMTP id i45mr3790999wep.14.1352145091572;
	Mon, 05 Nov 2012 11:51:31 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id hv4sm3125532wib.0.2012.11.05.11.51.29
	(version=SSLv3 cipher=OTHER); Mon, 05 Nov 2012 11:51:31 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Mon, 05 Nov 2012 19:51:25 +0000
From: Keir Fraser <keir@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Tim Deegan <tim@xen.org>
Message-ID: <CCBDC93D.51044%keir@xen.org>
Thread-Topic: [Xen-devel] 32bit xen and "claim"
Thread-Index: Ac27jvABriuTPWew902kug2rj1eumQ==
In-Reply-To: <0ea96cac-0b8f-43bc-99a9-d330b4ea3d76@default>
Mime-version: 1.0
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 05/11/2012 19:00, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:

> #if !defined(CONFIG_X86)
> 
> (why not #ifndef?)

We have no coding convention to prefer one over the other. Personally I
would say they are equally readable.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 22:27:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 22:27:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVV8b-0002Rh-Da; Mon, 05 Nov 2012 22:27:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TVV8a-0002Rc-6U
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 22:27:20 +0000
Received: from [85.158.138.51:21776] by server-3.bemta-3.messagelabs.com id
	3B/C3-31566-74D38905; Mon, 05 Nov 2012 22:27:19 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1352154437!28789397!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQwNDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31819 invoked from network); 5 Nov 2012 22:27:18 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 22:27:18 -0000
X-IronPort-AV: E=Sophos;i="4.80,718,1344211200"; d="scan'208";a="213469626"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	05 Nov 2012 22:26:55 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 5 Nov 2012 17:26:54 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TVV88-0002T7-VF;
	Mon, 05 Nov 2012 22:26:54 +0000
Message-ID: <1352154288.7253.25.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Date: Mon, 5 Nov 2012 23:24:48 +0100
In-Reply-To: <5517445d-ed2e-4592-9a2b-98fc612f1ae8@default>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<20121104203532.GA11377@ocelot.phlegethon.org>
	<26f55aab-7523-4681-9a61-a5e5740d43a9@default>
	<1352111399.25014.101.camel@hastur.hellion.org.uk>
	<5517445d-ed2e-4592-9a2b-98fc612f1ae8@default>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Olaf Hering <olaf@aepfle.de>, "Keir \(Xen.org\)" <keir@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	George Shuklin <george.shuklin@gmail.com>,
	DarioFaggioli <raistlin@linux.it>, Jan
	Beulich <JBeulich@suse.com>, Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-05 at 14:54 +0000, Dan Magenheimer wrote:
> > From: Ian Campbell [mailto:ian.campbell@citrix.com]
> > Sent: Monday, November 05, 2012 3:30 AM
> > To: Dan Magenheimer
> > Cc: Tim (Xen.org); Keir (Xen.org); Jan Beulich; Olaf Hering; George Dunlap; Ian Jackson; George
> > Shuklin; DarioFaggioli; xen-devel@lists.xen.org; Konrad Wilk; Kurt Hackel; Mukesh Rathor; Zhigang Wang
> > Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> > 
> > On Mon, 2012-11-05 at 00:23 +0000, Dan Magenheimer wrote:
> > > There is no "free up enough memory on that host". Tmem doesn't start
> > > ballooning out enough memory to start the VM... the guests are
> > > responsible for doing the ballooning and it is _already done_.  The
> > > machine either has sufficient free+freeable memory or it does not;
> > 
> > How does one go about deciding which host in a multi thousand host
> > deployment to try the claim hypercall on?
> 
> I don't get paid enough to solve that problem :-)
> 
> VM placement (both for new domains and migration due to
> load-balancing and power-management) is dependent on a
> number of factors currently involving CPU utilization,
> SAN utilization, and LAN utilization, I think using
> historical trends on streams of sampled statistics.  This
> is very non-deterministic as all of these factors may
> vary dramatically within a sampling interval.
> 
> Adding free+freeable memory to this just adds one more
> such statistic.  Actually two, as it is probably best to
> track free separately from freeable since a candidate
> host that has enough free memory should have preference
> over one with freeable memory.
> 
> Sorry if that's not very satisfying but anything beyond that
> meager description is outside of my area of expertise.

I guess I don't see how your proposed claim hypercall is useful if you
can't decide which machine you should call it on, whether it's 10s, 100s
or 1000s of hosts. Surely you aren't suggesting that the toolstack try
it on all (or even a subset) of them and see which sticks?

By ignoring this part of the problem I think you are ignoring one of the
most important bits of the story, without which it is very hard to make
a useful and informed determination about the validity of the use cases
you are describing for the new call.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 22:27:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 22:27:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVV8b-0002Rh-Da; Mon, 05 Nov 2012 22:27:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TVV8a-0002Rc-6U
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 22:27:20 +0000
Received: from [85.158.138.51:21776] by server-3.bemta-3.messagelabs.com id
	3B/C3-31566-74D38905; Mon, 05 Nov 2012 22:27:19 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1352154437!28789397!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQwNDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31819 invoked from network); 5 Nov 2012 22:27:18 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	5 Nov 2012 22:27:18 -0000
X-IronPort-AV: E=Sophos;i="4.80,718,1344211200"; d="scan'208";a="213469626"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	05 Nov 2012 22:26:55 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 5 Nov 2012 17:26:54 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TVV88-0002T7-VF;
	Mon, 05 Nov 2012 22:26:54 +0000
Message-ID: <1352154288.7253.25.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Date: Mon, 5 Nov 2012 23:24:48 +0100
In-Reply-To: <5517445d-ed2e-4592-9a2b-98fc612f1ae8@default>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<20121104203532.GA11377@ocelot.phlegethon.org>
	<26f55aab-7523-4681-9a61-a5e5740d43a9@default>
	<1352111399.25014.101.camel@hastur.hellion.org.uk>
	<5517445d-ed2e-4592-9a2b-98fc612f1ae8@default>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Olaf Hering <olaf@aepfle.de>, "Keir \(Xen.org\)" <keir@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	George Shuklin <george.shuklin@gmail.com>,
	DarioFaggioli <raistlin@linux.it>, Jan
	Beulich <JBeulich@suse.com>, Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-05 at 14:54 +0000, Dan Magenheimer wrote:
> > From: Ian Campbell [mailto:ian.campbell@citrix.com]
> > Sent: Monday, November 05, 2012 3:30 AM
> > To: Dan Magenheimer
> > Cc: Tim (Xen.org); Keir (Xen.org); Jan Beulich; Olaf Hering; George Dunlap; Ian Jackson; George
> > Shuklin; DarioFaggioli; xen-devel@lists.xen.org; Konrad Wilk; Kurt Hackel; Mukesh Rathor; Zhigang Wang
> > Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> > 
> > On Mon, 2012-11-05 at 00:23 +0000, Dan Magenheimer wrote:
> > > There is no "free up enough memory on that host". Tmem doesn't start
> > > ballooning out enough memory to start the VM... the guests are
> > > responsible for doing the ballooning and it is _already done_.  The
> > > machine either has sufficient free+freeable memory or it does not;
> > 
> > How does one go about deciding which host in a multi thousand host
> > deployment to try the claim hypercall on?
> 
> I don't get paid enough to solve that problem :-)
> 
> VM placement (both for new domains and migration due to
> load-balancing and power-management) is dependent on a
> number of factors currently involving CPU utilization,
> SAN utilization, and LAN utilization, I think using
> historical trends on streams of sampled statistics.  This
> is very non-deterministic as all of these factors may
> vary dramatically within a sampling interval.
> 
> Adding free+freeable memory to this just adds one more
> such statistic.  Actually two, as it is probably best to
> track free separately from freeable since a candidate
> host that has enough free memory should have preference
> over one with freeable memory.
> 
> Sorry if that's not very satisfying but anything beyond that
> meager description is outside of my area of expertise.

I guess I don't see how your proposed claim hypercall is useful if you
can't decide which machine you should call it on, whether it's 10s, 100s
or 1000s of hosts. Surely you aren't suggesting that the toolstack try
it on all (or even a subset) of them and see which sticks?

By ignoring this part of the problem I think you are ignoring one of the
most important bits of the story, without which it is very hard to make
a useful and informed determination about the validity of the use cases
you are describing for the new call.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 22:34:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 22:34:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVVFQ-0002cJ-8Z; Mon, 05 Nov 2012 22:34:24 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TVVFO-0002cE-Bz
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 22:34:22 +0000
Received: from [193.109.254.147:34209] by server-10.bemta-14.messagelabs.com
	id 7D/3E-31741-DEE38905; Mon, 05 Nov 2012 22:34:21 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1352154858!8542919!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjM3NDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5492 invoked from network); 5 Nov 2012 22:34:20 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-16.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 5 Nov 2012 22:34:20 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA5MY5U9028082
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 5 Nov 2012 22:34:06 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA5MY3NI002422
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 5 Nov 2012 22:34:04 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA5MY2YZ019145; Mon, 5 Nov 2012 16:34:02 -0600
MIME-Version: 1.0
Message-ID: <cea9c9ab-8775-4f8c-9849-471eca5535b5@default>
Date: Mon, 5 Nov 2012 14:33:55 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Tim Deegan <tim@xen.org>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<20121104203532.GA11377@ocelot.phlegethon.org>
In-Reply-To: <20121104203532.GA11377@ocelot.phlegethon.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Olaf Hering <olaf@aepfle.de>, Keir Fraser <keir@xen.org>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, xen-devel@lists.xen.org,
	DarioFaggioli <raistlin@linux.it>, Jan Beulich <JBeulich@suse.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Tim Deegan [mailto:tim@xen.org]
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature

Oops, missed an important part of your response... I'm glad
I went back and reread it...
 
> The claim hypercall _might_ fix (c) (if it could handle allocations that
> need address-width limits or contiguous pages).

I'm still looking into this part.

It's my understanding (from Jan) that, post-dom0-launch, there are
no known memory allocation paths that _require_ order>0 allocations.
All of them attempt a larger allocation and gracefully fallback
to (eventually) order==0 allocations.  I've hacked some code
in to the allocator to confirm this, though I'm not sure how
to test the hypothesis exhaustively.

For address-width limits, I suspect we are talking mostly or
entirely about DMA in 32-bit PV domains?  And/or PCI-passthrough?
I'll look into it further, but if those are the principal cases,
I'd have no problem documenting that the claim hypercall doesn't
handle them and attempts to build such a domain might still
fail slowly.  At least unless/until someone decided to add
any necessary special corner cases to the claim hypercall.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 22:34:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 22:34:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVVFQ-0002cJ-8Z; Mon, 05 Nov 2012 22:34:24 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TVVFO-0002cE-Bz
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 22:34:22 +0000
Received: from [193.109.254.147:34209] by server-10.bemta-14.messagelabs.com
	id 7D/3E-31741-DEE38905; Mon, 05 Nov 2012 22:34:21 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1352154858!8542919!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjM3NDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5492 invoked from network); 5 Nov 2012 22:34:20 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-16.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 5 Nov 2012 22:34:20 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA5MY5U9028082
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 5 Nov 2012 22:34:06 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA5MY3NI002422
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 5 Nov 2012 22:34:04 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA5MY2YZ019145; Mon, 5 Nov 2012 16:34:02 -0600
MIME-Version: 1.0
Message-ID: <cea9c9ab-8775-4f8c-9849-471eca5535b5@default>
Date: Mon, 5 Nov 2012 14:33:55 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Tim Deegan <tim@xen.org>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<20121104203532.GA11377@ocelot.phlegethon.org>
In-Reply-To: <20121104203532.GA11377@ocelot.phlegethon.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Olaf Hering <olaf@aepfle.de>, Keir Fraser <keir@xen.org>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, xen-devel@lists.xen.org,
	DarioFaggioli <raistlin@linux.it>, Jan Beulich <JBeulich@suse.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Tim Deegan [mailto:tim@xen.org]
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature

Oops, missed an important part of your response... I'm glad
I went back and reread it...
 
> The claim hypercall _might_ fix (c) (if it could handle allocations that
> need address-width limits or contiguous pages).

I'm still looking into this part.

It's my understanding (from Jan) that, post-dom0-launch, there are
no known memory allocation paths that _require_ order>0 allocations.
All of them attempt a larger allocation and gracefully fallback
to (eventually) order==0 allocations.  I've hacked some code
in to the allocator to confirm this, though I'm not sure how
to test the hypothesis exhaustively.

For address-width limits, I suspect we are talking mostly or
entirely about DMA in 32-bit PV domains?  And/or PCI-passthrough?
I'll look into it further, but if those are the principal cases,
I'd have no problem documenting that the claim hypercall doesn't
handle them and attempts to build such a domain might still
fail slowly.  At least unless/until someone decided to add
any necessary special corner cases to the claim hypercall.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 22:59:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 22:59:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVVd2-0002qG-E6; Mon, 05 Nov 2012 22:58:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <zhigang.x.wang@oracle.com>) id 1TVVd0-0002q8-FY
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 22:58:46 +0000
Received: from [193.109.254.147:24630] by server-7.bemta-14.messagelabs.com id
	76/C8-02272-5A448905; Mon, 05 Nov 2012 22:58:45 +0000
X-Env-Sender: zhigang.x.wang@oracle.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1352156323!9028822!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAzOTA1MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12592 invoked from network); 5 Nov 2012 22:58:45 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-12.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 5 Nov 2012 22:58:45 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA5MwUA3015709
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 5 Nov 2012 22:58:32 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA5MwUE6019158
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 5 Nov 2012 22:58:30 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA5MwTbs008727; Mon, 5 Nov 2012 16:58:29 -0600
Received: from zhigang.us.oracle.com (/10.149.236.110)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Mon, 05 Nov 2012 14:58:28 -0800
Message-ID: <50984485.3010405@oracle.com>
Date: Mon, 05 Nov 2012 17:58:13 -0500
From: Zhigang Wang <zhigang.x.wang@oracle.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120827 Thunderbird/15.0
MIME-Version: 1.0
To: Ian Campbell <ian.campbell@citrix.com>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<20121104203532.GA11377@ocelot.phlegethon.org>
	<26f55aab-7523-4681-9a61-a5e5740d43a9@default>
	<1352111399.25014.101.camel@hastur.hellion.org.uk>
	<5517445d-ed2e-4592-9a2b-98fc612f1ae8@default>
	<1352154288.7253.25.camel@hastur.hellion.org.uk>
In-Reply-To: <1352154288.7253.25.camel@hastur.hellion.org.uk>
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	"Keir \(Xen.org\)" <keir@xen.org>, Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	George Shuklin <george.shuklin@gmail.com>,
	DarioFaggioli <raistlin@linux.it>, Jan Beulich <JBeulich@suse.com>,
	Kurt Hackel <kurt.hackel@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/05/2012 05:24 PM, Ian Campbell wrote:
> On Mon, 2012-11-05 at 14:54 +0000, Dan Magenheimer wrote:
>>> On Mon, 2012-11-05 at 00:23 +0000, Dan Magenheimer wrote:
>>>> There is no "free up enough memory on that host". Tmem doesn't start
>>>> ballooning out enough memory to start the VM... the guests are
>>>> responsible for doing the ballooning and it is _already done_.  The
>>>> machine either has sufficient free+freeable memory or it does not;
>>> How does one go about deciding which host in a multi thousand host
>>> deployment to try the claim hypercall on?
> I guess I don't see how your proposed claim hypercall is useful if you
> can't decide which machine you should call it on, whether it's 10s, 100s
> or 1000s of hosts. Surely you aren't suggesting that the toolstack try
> it on all (or even a subset) of them and see which sticks?
>
> By ignoring this part of the problem I think you are ignoring one of the
> most important bits of the story, without which it is very hard to make
> a useful and informed determination about the validity of the use cases
> you are describing for the new call.
Planned implement:

1. Every Server (dom0) sends memory statistics to Manager every 20 seconds
(tunable).
2. At one time, Manager selects a Server to run VM based on the snapshot of
Server memory. Selected server should have: enough free memory for the VM or
have free + freeable memory > VM memory.

Two ways to handle failures:

1. Try start_vm on the first selected Server. If failed, try the second one.

2. Try reserve memory on the first Server. If failed, try the second one. If
success, start_vm on the Server.

>From high level, Dan's proposal could help with 2). If memory allocation is fast
enough (VM start failed/success very fast), then 1) is preferred.

Thanks,

Zhigang

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 22:59:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 22:59:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVVd2-0002qG-E6; Mon, 05 Nov 2012 22:58:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <zhigang.x.wang@oracle.com>) id 1TVVd0-0002q8-FY
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 22:58:46 +0000
Received: from [193.109.254.147:24630] by server-7.bemta-14.messagelabs.com id
	76/C8-02272-5A448905; Mon, 05 Nov 2012 22:58:45 +0000
X-Env-Sender: zhigang.x.wang@oracle.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1352156323!9028822!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAzOTA1MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12592 invoked from network); 5 Nov 2012 22:58:45 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-12.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 5 Nov 2012 22:58:45 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA5MwUA3015709
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 5 Nov 2012 22:58:32 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA5MwUE6019158
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 5 Nov 2012 22:58:30 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA5MwTbs008727; Mon, 5 Nov 2012 16:58:29 -0600
Received: from zhigang.us.oracle.com (/10.149.236.110)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Mon, 05 Nov 2012 14:58:28 -0800
Message-ID: <50984485.3010405@oracle.com>
Date: Mon, 05 Nov 2012 17:58:13 -0500
From: Zhigang Wang <zhigang.x.wang@oracle.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120827 Thunderbird/15.0
MIME-Version: 1.0
To: Ian Campbell <ian.campbell@citrix.com>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<20121104203532.GA11377@ocelot.phlegethon.org>
	<26f55aab-7523-4681-9a61-a5e5740d43a9@default>
	<1352111399.25014.101.camel@hastur.hellion.org.uk>
	<5517445d-ed2e-4592-9a2b-98fc612f1ae8@default>
	<1352154288.7253.25.camel@hastur.hellion.org.uk>
In-Reply-To: <1352154288.7253.25.camel@hastur.hellion.org.uk>
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	"Keir \(Xen.org\)" <keir@xen.org>, Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	George Shuklin <george.shuklin@gmail.com>,
	DarioFaggioli <raistlin@linux.it>, Jan Beulich <JBeulich@suse.com>,
	Kurt Hackel <kurt.hackel@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/05/2012 05:24 PM, Ian Campbell wrote:
> On Mon, 2012-11-05 at 14:54 +0000, Dan Magenheimer wrote:
>>> On Mon, 2012-11-05 at 00:23 +0000, Dan Magenheimer wrote:
>>>> There is no "free up enough memory on that host". Tmem doesn't start
>>>> ballooning out enough memory to start the VM... the guests are
>>>> responsible for doing the ballooning and it is _already done_.  The
>>>> machine either has sufficient free+freeable memory or it does not;
>>> How does one go about deciding which host in a multi thousand host
>>> deployment to try the claim hypercall on?
> I guess I don't see how your proposed claim hypercall is useful if you
> can't decide which machine you should call it on, whether it's 10s, 100s
> or 1000s of hosts. Surely you aren't suggesting that the toolstack try
> it on all (or even a subset) of them and see which sticks?
>
> By ignoring this part of the problem I think you are ignoring one of the
> most important bits of the story, without which it is very hard to make
> a useful and informed determination about the validity of the use cases
> you are describing for the new call.
Planned implement:

1. Every Server (dom0) sends memory statistics to Manager every 20 seconds
(tunable).
2. At one time, Manager selects a Server to run VM based on the snapshot of
Server memory. Selected server should have: enough free memory for the VM or
have free + freeable memory > VM memory.

Two ways to handle failures:

1. Try start_vm on the first selected Server. If failed, try the second one.

2. Try reserve memory on the first Server. If failed, try the second one. If
success, start_vm on the Server.

>From high level, Dan's proposal could help with 2). If memory allocation is fast
enough (VM start failed/success very fast), then 1) is preferred.

Thanks,

Zhigang

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 22:59:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 22:59:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVVdV-0002rt-RO; Mon, 05 Nov 2012 22:59:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TVVdU-0002rd-DK
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 22:59:16 +0000
Received: from [85.158.138.51:34150] by server-5.bemta-3.messagelabs.com id
	46/5E-26311-3C448905; Mon, 05 Nov 2012 22:59:15 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1352156352!28767231!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAzNzAyOQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14330 invoked from network); 5 Nov 2012 22:59:13 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-8.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 5 Nov 2012 22:59:13 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA5Mx3FK016282
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 5 Nov 2012 22:59:03 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA5Mwx8M001703
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 5 Nov 2012 22:59:00 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA5MwxlM003505; Mon, 5 Nov 2012 16:58:59 -0600
MIME-Version: 1.0
Message-ID: <8bec0df2-cf4b-4dcf-bbb8-121357a29d52@default>
Date: Mon, 5 Nov 2012 14:58:52 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Campbell <ian.campbell@citrix.com>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<20121104203532.GA11377@ocelot.phlegethon.org>
	<26f55aab-7523-4681-9a61-a5e5740d43a9@default>
	<1352111399.25014.101.camel@hastur.hellion.org.uk>
	<5517445d-ed2e-4592-9a2b-98fc612f1ae8@default>
	<1352154288.7253.25.camel@hastur.hellion.org.uk>
In-Reply-To: <1352154288.7253.25.camel@hastur.hellion.org.uk>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Olaf Hering <olaf@aepfle.de>, "Keir \(Xen.org\)" <keir@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>, xen-devel@lists.xen.org,
	George Shuklin <george.shuklin@gmail.com>,
	DarioFaggioli <raistlin@linux.it>, Jan Beulich <JBeulich@suse.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Ian Campbell [mailto:ian.campbell@citrix.com]
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature

Hi Ian --

> On Mon, 2012-11-05 at 14:54 +0000, Dan Magenheimer wrote:
> > > From: Ian Campbell [mailto:ian.campbell@citrix.com]
> > > Sent: Monday, November 05, 2012 3:30 AM
> > > To: Dan Magenheimer
> > > Cc: Tim (Xen.org); Keir (Xen.org); Jan Beulich; Olaf Hering; George Dunlap; Ian Jackson; George
> > > Shuklin; DarioFaggioli; xen-devel@lists.xen.org; Konrad Wilk; Kurt Hackel; Mukesh Rathor; Zhigang
> Wang
> > > Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> > >
> > > On Mon, 2012-11-05 at 00:23 +0000, Dan Magenheimer wrote:
> > > > There is no "free up enough memory on that host". Tmem doesn't start
> > > > ballooning out enough memory to start the VM... the guests are
> > > > responsible for doing the ballooning and it is _already done_.  The
> > > > machine either has sufficient free+freeable memory or it does not;
> > >
> > > How does one go about deciding which host in a multi thousand host
> > > deployment to try the claim hypercall on?
> >
> > I don't get paid enough to solve that problem :-)
> >
> > VM placement (both for new domains and migration due to
> > load-balancing and power-management) is dependent on a
> > number of factors currently involving CPU utilization,
> > SAN utilization, and LAN utilization, I think using
> > historical trends on streams of sampled statistics.  This
> > is very non-deterministic as all of these factors may
> > vary dramatically within a sampling interval.
> >
> > Adding free+freeable memory to this just adds one more
> > such statistic.  Actually two, as it is probably best to
> > track free separately from freeable since a candidate
> > host that has enough free memory should have preference
> > over one with freeable memory.
> >
> > Sorry if that's not very satisfying but anything beyond that
> > meager description is outside of my area of expertise.
> 
> I guess I don't see how your proposed claim hypercall is useful if you
> can't decide which machine you should call it on, whether it's 10s, 100s
> or 1000s of hosts. Surely you aren't suggesting that the toolstack try
> it on all (or even a subset) of them and see which sticks?
> 
> By ignoring this part of the problem I think you are ignoring one of the
> most important bits of the story, without which it is very hard to make
> a useful and informed determination about the validity of the use cases
> you are describing for the new call.

I'm not ignoring it at all.  One only needs to choose a machine and
be prepared that the machine will (immediately) answer "sorry, won't fit".
It's not necessary to choose the _optimal_ fit, only a probable one.
Since failure is immediate, trying more than one machine (which should
happen only rarely) is not particularly problematic, though I completely
agree that trying _all_ of them might be.

The existing OracleVM Manager already chooses domain launch candidates
and load balancing candidates based on sampled CPU/SAN/LAN data, which
is always stale but still sufficient as a rough estimate of the best
machine to choose.

Beyond that, I'm not particularly knowledgeable about the details and,
even if I were, I'm not sure if the details are suitable for a public
forum.  But I can tell you that it has been shipping for over a year
and here's some of what's published... look for DRS and DPM.

http://www.oracle.com/us/technologies/virtualization/ovm3-whats-new-459313.pdf 

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 22:59:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 22:59:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVVdV-0002rt-RO; Mon, 05 Nov 2012 22:59:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TVVdU-0002rd-DK
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 22:59:16 +0000
Received: from [85.158.138.51:34150] by server-5.bemta-3.messagelabs.com id
	46/5E-26311-3C448905; Mon, 05 Nov 2012 22:59:15 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1352156352!28767231!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAzNzAyOQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14330 invoked from network); 5 Nov 2012 22:59:13 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-8.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 5 Nov 2012 22:59:13 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA5Mx3FK016282
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 5 Nov 2012 22:59:03 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA5Mwx8M001703
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 5 Nov 2012 22:59:00 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA5MwxlM003505; Mon, 5 Nov 2012 16:58:59 -0600
MIME-Version: 1.0
Message-ID: <8bec0df2-cf4b-4dcf-bbb8-121357a29d52@default>
Date: Mon, 5 Nov 2012 14:58:52 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Campbell <ian.campbell@citrix.com>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<20121104203532.GA11377@ocelot.phlegethon.org>
	<26f55aab-7523-4681-9a61-a5e5740d43a9@default>
	<1352111399.25014.101.camel@hastur.hellion.org.uk>
	<5517445d-ed2e-4592-9a2b-98fc612f1ae8@default>
	<1352154288.7253.25.camel@hastur.hellion.org.uk>
In-Reply-To: <1352154288.7253.25.camel@hastur.hellion.org.uk>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Olaf Hering <olaf@aepfle.de>, "Keir \(Xen.org\)" <keir@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>, xen-devel@lists.xen.org,
	George Shuklin <george.shuklin@gmail.com>,
	DarioFaggioli <raistlin@linux.it>, Jan Beulich <JBeulich@suse.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Ian Campbell [mailto:ian.campbell@citrix.com]
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature

Hi Ian --

> On Mon, 2012-11-05 at 14:54 +0000, Dan Magenheimer wrote:
> > > From: Ian Campbell [mailto:ian.campbell@citrix.com]
> > > Sent: Monday, November 05, 2012 3:30 AM
> > > To: Dan Magenheimer
> > > Cc: Tim (Xen.org); Keir (Xen.org); Jan Beulich; Olaf Hering; George Dunlap; Ian Jackson; George
> > > Shuklin; DarioFaggioli; xen-devel@lists.xen.org; Konrad Wilk; Kurt Hackel; Mukesh Rathor; Zhigang
> Wang
> > > Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> > >
> > > On Mon, 2012-11-05 at 00:23 +0000, Dan Magenheimer wrote:
> > > > There is no "free up enough memory on that host". Tmem doesn't start
> > > > ballooning out enough memory to start the VM... the guests are
> > > > responsible for doing the ballooning and it is _already done_.  The
> > > > machine either has sufficient free+freeable memory or it does not;
> > >
> > > How does one go about deciding which host in a multi thousand host
> > > deployment to try the claim hypercall on?
> >
> > I don't get paid enough to solve that problem :-)
> >
> > VM placement (both for new domains and migration due to
> > load-balancing and power-management) is dependent on a
> > number of factors currently involving CPU utilization,
> > SAN utilization, and LAN utilization, I think using
> > historical trends on streams of sampled statistics.  This
> > is very non-deterministic as all of these factors may
> > vary dramatically within a sampling interval.
> >
> > Adding free+freeable memory to this just adds one more
> > such statistic.  Actually two, as it is probably best to
> > track free separately from freeable since a candidate
> > host that has enough free memory should have preference
> > over one with freeable memory.
> >
> > Sorry if that's not very satisfying but anything beyond that
> > meager description is outside of my area of expertise.
> 
> I guess I don't see how your proposed claim hypercall is useful if you
> can't decide which machine you should call it on, whether it's 10s, 100s
> or 1000s of hosts. Surely you aren't suggesting that the toolstack try
> it on all (or even a subset) of them and see which sticks?
> 
> By ignoring this part of the problem I think you are ignoring one of the
> most important bits of the story, without which it is very hard to make
> a useful and informed determination about the validity of the use cases
> you are describing for the new call.

I'm not ignoring it at all.  One only needs to choose a machine and
be prepared that the machine will (immediately) answer "sorry, won't fit".
It's not necessary to choose the _optimal_ fit, only a probable one.
Since failure is immediate, trying more than one machine (which should
happen only rarely) is not particularly problematic, though I completely
agree that trying _all_ of them might be.

The existing OracleVM Manager already chooses domain launch candidates
and load balancing candidates based on sampled CPU/SAN/LAN data, which
is always stale but still sufficient as a rough estimate of the best
machine to choose.

Beyond that, I'm not particularly knowledgeable about the details and,
even if I were, I'm not sure if the details are suitable for a public
forum.  But I can tell you that it has been shipping for over a year
and here's some of what's published... look for DRS and DPM.

http://www.oracle.com/us/technologies/virtualization/ovm3-whats-new-459313.pdf 

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 23:35:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 23:35:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVWC1-0003YB-Ex; Mon, 05 Nov 2012 23:34:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TVWC0-0003Y6-PX
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 23:34:57 +0000
Received: from [85.158.137.99:47770] by server-3.bemta-3.messagelabs.com id
	17/13-31566-F1D48905; Mon, 05 Nov 2012 23:34:55 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-13.tower-217.messagelabs.com!1352158495!17880769!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24974 invoked from network); 5 Nov 2012 23:34:55 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-13.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 5 Nov 2012 23:34:55 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 4A30F8406D;
	Tue,  6 Nov 2012 00:34:54 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id S5cSROW1xvTR; Tue,  6 Nov 2012 00:34:54 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id F376C84067;
	Tue,  6 Nov 2012 00:34:53 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TVWBw-0004sN-Kx; Tue, 06 Nov 2012 00:34:52 +0100
Date: Tue, 6 Nov 2012 00:34:52 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
Message-ID: <20121105233452.GI16909@type.youpi.perso.aquilenet.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	"Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121101212931.GQ5569@type.youpi.perso.aquilenet.fr>
	<068F06DC4D106941B297C0C5F9F446EA48A1C7BA68@aplesstripe.dom1.jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48A1C7BA68@aplesstripe.dom1.jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 1/9] Disable -DGNT_DEBUG and
	-DGNTMAP_DEBUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Fioravante, Matthew E., le Fri 02 Nov 2012 09:19:34 -0400, a =E9crit :
> It happens in my vtpm domains because the drivers often create and releas=
e grant references. This patch isn't completely necessary. Do we want to ha=
ve these debug prints in the default build?

Well, surely -DGNT_DEBUG doesn't produce any output :) We could however
drop it, since it only adds overhead to check something that is supposed
to be already working (and which is quite well tested nowadays).

About -DGNTMAP_DEBUG, which message are you getting printed a lot? Are
you running out of references in gntmap_find_free_entry, or using
gntmap_map_grant_refs a lot?

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 05 23:35:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Nov 2012 23:35:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVWC1-0003YB-Ex; Mon, 05 Nov 2012 23:34:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TVWC0-0003Y6-PX
	for xen-devel@lists.xen.org; Mon, 05 Nov 2012 23:34:57 +0000
Received: from [85.158.137.99:47770] by server-3.bemta-3.messagelabs.com id
	17/13-31566-F1D48905; Mon, 05 Nov 2012 23:34:55 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-13.tower-217.messagelabs.com!1352158495!17880769!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24974 invoked from network); 5 Nov 2012 23:34:55 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-13.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 5 Nov 2012 23:34:55 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 4A30F8406D;
	Tue,  6 Nov 2012 00:34:54 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id S5cSROW1xvTR; Tue,  6 Nov 2012 00:34:54 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id F376C84067;
	Tue,  6 Nov 2012 00:34:53 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TVWBw-0004sN-Kx; Tue, 06 Nov 2012 00:34:52 +0100
Date: Tue, 6 Nov 2012 00:34:52 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
Message-ID: <20121105233452.GI16909@type.youpi.perso.aquilenet.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	"Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121101212931.GQ5569@type.youpi.perso.aquilenet.fr>
	<068F06DC4D106941B297C0C5F9F446EA48A1C7BA68@aplesstripe.dom1.jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48A1C7BA68@aplesstripe.dom1.jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 1/9] Disable -DGNT_DEBUG and
	-DGNTMAP_DEBUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Fioravante, Matthew E., le Fri 02 Nov 2012 09:19:34 -0400, a =E9crit :
> It happens in my vtpm domains because the drivers often create and releas=
e grant references. This patch isn't completely necessary. Do we want to ha=
ve these debug prints in the default build?

Well, surely -DGNT_DEBUG doesn't produce any output :) We could however
drop it, since it only adds overhead to check something that is supposed
to be already working (and which is quite well tested nowadays).

About -DGNTMAP_DEBUG, which message are you getting printed a lot? Are
you running out of references in gntmap_find_free_entry, or using
gntmap_map_grant_refs a lot?

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 05:49:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 05:49:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVc21-0001ny-IY; Tue, 06 Nov 2012 05:49:01 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TVc1z-0001nt-6e
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 05:48:59 +0000
Received: from [193.109.254.147:50905] by server-14.bemta-14.messagelabs.com
	id 1B/1E-14517-AC4A8905; Tue, 06 Nov 2012 05:48:58 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1352180936!9056369!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzYxNzM3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15442 invoked from network); 6 Nov 2012 05:48:57 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-12.tower-27.messagelabs.com with SMTP;
	6 Nov 2012 05:48:57 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 05 Nov 2012 21:48:22 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,721,1344236400"; d="scan'208";a="215661461"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by orsmga001.jf.intel.com with ESMTP; 05 Nov 2012 21:48:55 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Mon, 5 Nov 2012 21:48:54 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Tue, 6 Nov 2012 13:48:53 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>, Konrad Rzeszutek
	Wilk <konrad@kernel.org>
Thread-Topic: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
Thread-Index: AQHNu2iOTi91BiFLfUibRvXA4zlK85fcS22w
Date: Tue, 6 Nov 2012 05:48:52 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<5089676602000078000A4928@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC82923353723C7@SHSMSX101.ccr.corp.intel.com>
	<508A89CB020000780008E6ED@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
	<alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
In-Reply-To: <alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Stefano Stabellini wrote:
>>> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
>>> index 0e86370..a2af622 100644
>>> --- a/drivers/xen/Makefile
>>> +++ b/drivers/xen/Makefile
>>> @@ -29,6 +29,7 @@ obj-$(CONFIG_XEN_MCE_LOG)           += mcelog.o
>>>  obj-$(CONFIG_XEN_PCIDEV_BACKEND)     += xen-pciback/
>>>  obj-$(CONFIG_XEN_PRIVCMD)            += xen-privcmd.o
>>>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)     += xen-acpi-processor.o
>>> +obj-$(CONFIG_XEN_DOM0)                       += xen_acpi_pad.o
>>>  xen-evtchn-y                         := evtchn.o
>>>  xen-gntdev-y                         := gntdev.o
>>>  xen-gntalloc-y                               := gntalloc.o
> 
> it should really depend on ACPI and maybe also X86, otherwise it is
> going to break the ARM build
> 
> 

Hmm, XEN_DOM0 has already depended on ACPI and X86_LOCAL_APIC (which depends on X86_64).

Thanks,
Jinsong

>>> diff --git a/drivers/xen/xen_acpi_pad.c b/drivers/xen/xen_acpi_pad.c
>>> new file mode 100644
>>> index 0000000..e8c26a4
>>> --- /dev/null
>>> +++ b/drivers/xen/xen_acpi_pad.c
>>> @@ -0,0 +1,206 @@
>>> +/*
>>> + * xen_acpi_pad.c - Xen pad interface
>>> + *
>>> + * Copyright (c) 2012, Intel Corporation.
>>> + *    Author: Liu, Jinsong <jinsong.liu@intel.com> + *
>>> + * This program is free software; you can redistribute it and/or
>>> modify it + * under the terms and conditions of the GNU General
>>> Public License, + * version 2, as published by the Free Software
>>> Foundation. + * + * This program is distributed in the hope it will
>>> be useful, but WITHOUT + * ANY WARRANTY; without even the implied
>>> warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR
>>> PURPOSE.  See the GNU General Public License for + * more details.
>>> + */ +
>>> +#include <linux/kernel.h>
>>> +#include <linux/types.h>
>>> +#include <acpi/acpi_bus.h>
>>> +#include <acpi/acpi_drivers.h>
>>> +#include <asm/xen/hypercall.h>
>>> +#include <xen/interface/version.h>
>>> +
>>> +#define ACPI_PROCESSOR_AGGREGATOR_CLASS      "acpi_pad"
>>> +#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor
>>> Aggregator" +#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
>>> +
>>> +static DEFINE_MUTEX(xen_pad_lock);
>>> +
>>> +static int xen_pad_set_idle_cpus(int num_cpus)
>>> +{
>>> +     struct xen_platform_op op;
>>> +
>>> +     if (num_cpus < 0)
>>> +             return -EINVAL;
>>> +
>>> +     /* set cpu nums expected to be idled */
>>> +     op.cmd = XENPF_core_parking;
>>> +     op.u.core_parking.type = XEN_CORE_PARKING_SET;
>>> +     op.u.core_parking.idle_nums = num_cpus;
>>> +
>>> +     return HYPERVISOR_dom0_op(&op);
>>> +}
>>> +
>>> +/*
>>> + * Cannot get idle cpus by using hypercall once (shared with _SET)
>>> + * because of the characteristic of Xen continue_hypercall_on_cpu
>>> + */ +static int xen_pad_get_idle_cpus(void)
>>> +{
>>> +     int ret;
>>> +     struct xen_platform_op op;
>>> +
>>> +     /* get cpu nums actually be idled */
>>> +     op.cmd = XENPF_core_parking;
>>> +     op.u.core_parking.type = XEN_CORE_PARKING_GET;
>>> +     ret = HYPERVISOR_dom0_op(&op);
>>> +     if (ret < 0)
>>> +             return ret;
>>> +
>>> +     return op.u.core_parking.idle_nums;
>>> +}
>>> +
>>> +/*
>>> + * Query firmware how many CPUs should be idle
>>> + * return -1 on failure
>>> + */
>>> +static int xen_acpi_pad_pur(acpi_handle handle)
>>> +{
>>> +     struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
>>> +     union acpi_object *package;
>>> +     int num = -1;
>>> +
>>> +     if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL,
>>> &buffer))) +             return num; +
>>> +     if (!buffer.length || !buffer.pointer)
>>> +             return num;
>>> +
>>> +     package = buffer.pointer;
>>> +
>>> +     if (package->type == ACPI_TYPE_PACKAGE &&
>>> +             package->package.count == 2 &&
>>> +             package->package.elements[0].integer.value == 1) /*
>>> rev 1 */ + +             num =
>>> package->package.elements[1].integer.value; + +    
>>> kfree(buffer.pointer); +     return num;
>>> +}
>>> +
>>> +/* Notify firmware how many CPUs are idle */
>>> +static void xen_acpi_pad_ost(acpi_handle handle, int stat, +    
>>> uint32_t idle_cpus) +{
>>> +     union acpi_object params[3] = {
>>> +             {.type = ACPI_TYPE_INTEGER,},
>>> +             {.type = ACPI_TYPE_INTEGER,},
>>> +             {.type = ACPI_TYPE_BUFFER,},
>>> +     };
>>> +     struct acpi_object_list arg_list = {3, params}; +
>>> +     params[0].integer.value = ACPI_PROCESSOR_AGGREGATOR_NOTIFY;
>>> +     params[1].integer.value =  stat;
>>> +     params[2].buffer.length = 4;
>>> +     params[2].buffer.pointer = (void *)&idle_cpus;
>>> +     acpi_evaluate_object(handle, "_OST", &arg_list, NULL); +}
>>> +
>>> +static void xen_acpi_pad_handle_notify(acpi_handle handle) +{
>>> +     int num_cpus;
>>> +
>>> +     num_cpus = xen_acpi_pad_pur(handle);
>>> +     if (num_cpus < 0)
>>> +             return;
>>> +
>>> +     mutex_lock(&xen_pad_lock);
>>> +     if (xen_pad_set_idle_cpus(num_cpus)) {
>>> +             mutex_unlock(&xen_pad_lock);
>>> +             return;
>>> +     }
>>> +
>>> +     num_cpus = xen_pad_get_idle_cpus();
>>> +     if (num_cpus < 0) {
>>> +             mutex_unlock(&xen_pad_lock);
>>> +             return;
>>> +     }
>>> +     mutex_unlock(&xen_pad_lock);
>>> +
>>> +     xen_acpi_pad_ost(handle, 0, num_cpus);
>>> +}
>>> +
>>> +static void xen_acpi_pad_notify(acpi_handle handle, u32 event, +  
>>> void *data) +{
>>> +     switch (event) {
>>> +     case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
>>> +             xen_acpi_pad_handle_notify(handle);
>>> +             break;
>>> +     default:
>>> +             pr_warn("Unsupported event [0x%x]\n", event); +      
>>> break; +     }
>>> +}
>>> +
>>> +static int xen_acpi_pad_add(struct acpi_device *device) +{
>>> +     acpi_status status;
>>> +
>>> +     strcpy(acpi_device_name(device),
>>> ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME); +    
>>> strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);
>>> + +     status = acpi_install_notify_handler(device->handle, +     
>>> ACPI_DEVICE_NOTIFY, xen_acpi_pad_notify, device); +     if
>>> (ACPI_FAILURE(status)) +             return -ENODEV;
>>> +
>>> +     return 0;
>>> +}
>>> +
>>> +static int xen_acpi_pad_remove(struct acpi_device *device, +    
>>> int type) +{
>>> +     mutex_lock(&xen_pad_lock);
>>> +     xen_pad_set_idle_cpus(0);
>>> +     mutex_unlock(&xen_pad_lock);
>>> +
>>> +     acpi_remove_notify_handler(device->handle,
>>> +             ACPI_DEVICE_NOTIFY, xen_acpi_pad_notify); +    
>>> return 0; +}
>>> +
>>> +static const struct acpi_device_id pad_device_ids[] = { +    
>>> {"ACPI000C", 0}, +     {"", 0},
>>> +};
>>> +
>>> +static struct acpi_driver xen_acpi_pad_driver = {
>>> +     .name = "processor_aggregator",
>>> +     .class = ACPI_PROCESSOR_AGGREGATOR_CLASS,
>>> +     .ids = pad_device_ids,
>>> +     .ops = {
>>> +             .add = xen_acpi_pad_add,
>>> +             .remove = xen_acpi_pad_remove,
>>> +     },
>>> +};
>>> +
>>> +static int __init xen_acpi_pad_init(void)
>>> +{
>>> +     int ret = -ENOSYS;
>>> +     unsigned int version = HYPERVISOR_xen_version(XENVER_version,
>>> NULL); 
>> 
>> Heh. so if you run this on baremetal I wonder what will happen.
>> 
>>> +     unsigned int major = version >> 16;
>>> +     unsigned int minor = version & 0xffff;
>>> +
>>> +     /* Only DOM0 is responsible for Xen acpi pad */
>>> +     if (!xen_initial_domain())
>>> +             return -ENODEV;
>>> +
>> 
>> I think the check for version should happen here.
>> 
>>> +     /* Only Xen4.2 or later support Xen acpi pad */
>>> +     if (((major == 4) && (minor >= 2)) || (major > 4))
>>> +             ret = acpi_bus_register_driver(&xen_acpi_pad_driver);
>>> + +     return ret;
>>> +}
>>> +subsys_initcall(xen_acpi_pad_init);
>>> diff --git a/include/xen/interface/platform.h
>>> b/include/xen/interface/platform.h index 4755b5f..a3be54c 100644
>>> --- a/include/xen/interface/platform.h +++
>>> b/include/xen/interface/platform.h @@ -324,6 +324,22 @@ struct
>>>  xenpf_cpu_ol { };
>>>  DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
>>> 
>>> +/*
>>> + * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd,
>>> + * which are already occupied at Xen hypervisor side. + */
>>> +#define XENPF_core_parking   60
>>> +struct xenpf_core_parking {
>>> +     /* IN variables */
>>> +#define XEN_CORE_PARKING_SET 1
>>> +#define XEN_CORE_PARKING_GET 2
>>> +     uint32_t type;
>>> +     /* IN variables:  set cpu nums expected to be idled */
>>> +     /* OUT variables: get cpu nums actually be idled */ +    
>>> uint32_t idle_nums; +};
>>> +DEFINE_GUEST_HANDLE_STRUCT(xenpf_core_parking);
>>> +
>>>  struct xen_platform_op {
>>>       uint32_t cmd;
>>>       uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
>>> @@ -341,6 +357,7 @@ struct xen_platform_op {
>>>               struct xenpf_set_processor_pminfo set_pminfo;
>>>               struct xenpf_pcpuinfo          pcpu_info;
>>>               struct xenpf_cpu_ol            cpu_ol;
>>> +             struct xenpf_core_parking      core_parking;
>>>               uint8_t                        pad[128];       } u;
>>>  };
>>> --
>>> 1.7.1
>> 
>> 
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@lists.xen.org
>>> http://lists.xen.org/xen-devel
>> 
>> --
>> To unsubscribe from this list: send the line "unsubscribe
>> linux-kernel" in the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 05:49:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 05:49:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVc21-0001ny-IY; Tue, 06 Nov 2012 05:49:01 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TVc1z-0001nt-6e
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 05:48:59 +0000
Received: from [193.109.254.147:50905] by server-14.bemta-14.messagelabs.com
	id 1B/1E-14517-AC4A8905; Tue, 06 Nov 2012 05:48:58 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1352180936!9056369!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzYxNzM3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15442 invoked from network); 6 Nov 2012 05:48:57 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-12.tower-27.messagelabs.com with SMTP;
	6 Nov 2012 05:48:57 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 05 Nov 2012 21:48:22 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,721,1344236400"; d="scan'208";a="215661461"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by orsmga001.jf.intel.com with ESMTP; 05 Nov 2012 21:48:55 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Mon, 5 Nov 2012 21:48:54 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Tue, 6 Nov 2012 13:48:53 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>, Konrad Rzeszutek
	Wilk <konrad@kernel.org>
Thread-Topic: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
Thread-Index: AQHNu2iOTi91BiFLfUibRvXA4zlK85fcS22w
Date: Tue, 6 Nov 2012 05:48:52 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<5089676602000078000A4928@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC82923353723C7@SHSMSX101.ccr.corp.intel.com>
	<508A89CB020000780008E6ED@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
	<alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
In-Reply-To: <alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Stefano Stabellini wrote:
>>> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
>>> index 0e86370..a2af622 100644
>>> --- a/drivers/xen/Makefile
>>> +++ b/drivers/xen/Makefile
>>> @@ -29,6 +29,7 @@ obj-$(CONFIG_XEN_MCE_LOG)           += mcelog.o
>>>  obj-$(CONFIG_XEN_PCIDEV_BACKEND)     += xen-pciback/
>>>  obj-$(CONFIG_XEN_PRIVCMD)            += xen-privcmd.o
>>>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)     += xen-acpi-processor.o
>>> +obj-$(CONFIG_XEN_DOM0)                       += xen_acpi_pad.o
>>>  xen-evtchn-y                         := evtchn.o
>>>  xen-gntdev-y                         := gntdev.o
>>>  xen-gntalloc-y                               := gntalloc.o
> 
> it should really depend on ACPI and maybe also X86, otherwise it is
> going to break the ARM build
> 
> 

Hmm, XEN_DOM0 has already depended on ACPI and X86_LOCAL_APIC (which depends on X86_64).

Thanks,
Jinsong

>>> diff --git a/drivers/xen/xen_acpi_pad.c b/drivers/xen/xen_acpi_pad.c
>>> new file mode 100644
>>> index 0000000..e8c26a4
>>> --- /dev/null
>>> +++ b/drivers/xen/xen_acpi_pad.c
>>> @@ -0,0 +1,206 @@
>>> +/*
>>> + * xen_acpi_pad.c - Xen pad interface
>>> + *
>>> + * Copyright (c) 2012, Intel Corporation.
>>> + *    Author: Liu, Jinsong <jinsong.liu@intel.com> + *
>>> + * This program is free software; you can redistribute it and/or
>>> modify it + * under the terms and conditions of the GNU General
>>> Public License, + * version 2, as published by the Free Software
>>> Foundation. + * + * This program is distributed in the hope it will
>>> be useful, but WITHOUT + * ANY WARRANTY; without even the implied
>>> warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR
>>> PURPOSE.  See the GNU General Public License for + * more details.
>>> + */ +
>>> +#include <linux/kernel.h>
>>> +#include <linux/types.h>
>>> +#include <acpi/acpi_bus.h>
>>> +#include <acpi/acpi_drivers.h>
>>> +#include <asm/xen/hypercall.h>
>>> +#include <xen/interface/version.h>
>>> +
>>> +#define ACPI_PROCESSOR_AGGREGATOR_CLASS      "acpi_pad"
>>> +#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor
>>> Aggregator" +#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
>>> +
>>> +static DEFINE_MUTEX(xen_pad_lock);
>>> +
>>> +static int xen_pad_set_idle_cpus(int num_cpus)
>>> +{
>>> +     struct xen_platform_op op;
>>> +
>>> +     if (num_cpus < 0)
>>> +             return -EINVAL;
>>> +
>>> +     /* set cpu nums expected to be idled */
>>> +     op.cmd = XENPF_core_parking;
>>> +     op.u.core_parking.type = XEN_CORE_PARKING_SET;
>>> +     op.u.core_parking.idle_nums = num_cpus;
>>> +
>>> +     return HYPERVISOR_dom0_op(&op);
>>> +}
>>> +
>>> +/*
>>> + * Cannot get idle cpus by using hypercall once (shared with _SET)
>>> + * because of the characteristic of Xen continue_hypercall_on_cpu
>>> + */ +static int xen_pad_get_idle_cpus(void)
>>> +{
>>> +     int ret;
>>> +     struct xen_platform_op op;
>>> +
>>> +     /* get cpu nums actually be idled */
>>> +     op.cmd = XENPF_core_parking;
>>> +     op.u.core_parking.type = XEN_CORE_PARKING_GET;
>>> +     ret = HYPERVISOR_dom0_op(&op);
>>> +     if (ret < 0)
>>> +             return ret;
>>> +
>>> +     return op.u.core_parking.idle_nums;
>>> +}
>>> +
>>> +/*
>>> + * Query firmware how many CPUs should be idle
>>> + * return -1 on failure
>>> + */
>>> +static int xen_acpi_pad_pur(acpi_handle handle)
>>> +{
>>> +     struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
>>> +     union acpi_object *package;
>>> +     int num = -1;
>>> +
>>> +     if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL,
>>> &buffer))) +             return num; +
>>> +     if (!buffer.length || !buffer.pointer)
>>> +             return num;
>>> +
>>> +     package = buffer.pointer;
>>> +
>>> +     if (package->type == ACPI_TYPE_PACKAGE &&
>>> +             package->package.count == 2 &&
>>> +             package->package.elements[0].integer.value == 1) /*
>>> rev 1 */ + +             num =
>>> package->package.elements[1].integer.value; + +    
>>> kfree(buffer.pointer); +     return num;
>>> +}
>>> +
>>> +/* Notify firmware how many CPUs are idle */
>>> +static void xen_acpi_pad_ost(acpi_handle handle, int stat, +    
>>> uint32_t idle_cpus) +{
>>> +     union acpi_object params[3] = {
>>> +             {.type = ACPI_TYPE_INTEGER,},
>>> +             {.type = ACPI_TYPE_INTEGER,},
>>> +             {.type = ACPI_TYPE_BUFFER,},
>>> +     };
>>> +     struct acpi_object_list arg_list = {3, params}; +
>>> +     params[0].integer.value = ACPI_PROCESSOR_AGGREGATOR_NOTIFY;
>>> +     params[1].integer.value =  stat;
>>> +     params[2].buffer.length = 4;
>>> +     params[2].buffer.pointer = (void *)&idle_cpus;
>>> +     acpi_evaluate_object(handle, "_OST", &arg_list, NULL); +}
>>> +
>>> +static void xen_acpi_pad_handle_notify(acpi_handle handle) +{
>>> +     int num_cpus;
>>> +
>>> +     num_cpus = xen_acpi_pad_pur(handle);
>>> +     if (num_cpus < 0)
>>> +             return;
>>> +
>>> +     mutex_lock(&xen_pad_lock);
>>> +     if (xen_pad_set_idle_cpus(num_cpus)) {
>>> +             mutex_unlock(&xen_pad_lock);
>>> +             return;
>>> +     }
>>> +
>>> +     num_cpus = xen_pad_get_idle_cpus();
>>> +     if (num_cpus < 0) {
>>> +             mutex_unlock(&xen_pad_lock);
>>> +             return;
>>> +     }
>>> +     mutex_unlock(&xen_pad_lock);
>>> +
>>> +     xen_acpi_pad_ost(handle, 0, num_cpus);
>>> +}
>>> +
>>> +static void xen_acpi_pad_notify(acpi_handle handle, u32 event, +  
>>> void *data) +{
>>> +     switch (event) {
>>> +     case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
>>> +             xen_acpi_pad_handle_notify(handle);
>>> +             break;
>>> +     default:
>>> +             pr_warn("Unsupported event [0x%x]\n", event); +      
>>> break; +     }
>>> +}
>>> +
>>> +static int xen_acpi_pad_add(struct acpi_device *device) +{
>>> +     acpi_status status;
>>> +
>>> +     strcpy(acpi_device_name(device),
>>> ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME); +    
>>> strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);
>>> + +     status = acpi_install_notify_handler(device->handle, +     
>>> ACPI_DEVICE_NOTIFY, xen_acpi_pad_notify, device); +     if
>>> (ACPI_FAILURE(status)) +             return -ENODEV;
>>> +
>>> +     return 0;
>>> +}
>>> +
>>> +static int xen_acpi_pad_remove(struct acpi_device *device, +    
>>> int type) +{
>>> +     mutex_lock(&xen_pad_lock);
>>> +     xen_pad_set_idle_cpus(0);
>>> +     mutex_unlock(&xen_pad_lock);
>>> +
>>> +     acpi_remove_notify_handler(device->handle,
>>> +             ACPI_DEVICE_NOTIFY, xen_acpi_pad_notify); +    
>>> return 0; +}
>>> +
>>> +static const struct acpi_device_id pad_device_ids[] = { +    
>>> {"ACPI000C", 0}, +     {"", 0},
>>> +};
>>> +
>>> +static struct acpi_driver xen_acpi_pad_driver = {
>>> +     .name = "processor_aggregator",
>>> +     .class = ACPI_PROCESSOR_AGGREGATOR_CLASS,
>>> +     .ids = pad_device_ids,
>>> +     .ops = {
>>> +             .add = xen_acpi_pad_add,
>>> +             .remove = xen_acpi_pad_remove,
>>> +     },
>>> +};
>>> +
>>> +static int __init xen_acpi_pad_init(void)
>>> +{
>>> +     int ret = -ENOSYS;
>>> +     unsigned int version = HYPERVISOR_xen_version(XENVER_version,
>>> NULL); 
>> 
>> Heh. so if you run this on baremetal I wonder what will happen.
>> 
>>> +     unsigned int major = version >> 16;
>>> +     unsigned int minor = version & 0xffff;
>>> +
>>> +     /* Only DOM0 is responsible for Xen acpi pad */
>>> +     if (!xen_initial_domain())
>>> +             return -ENODEV;
>>> +
>> 
>> I think the check for version should happen here.
>> 
>>> +     /* Only Xen4.2 or later support Xen acpi pad */
>>> +     if (((major == 4) && (minor >= 2)) || (major > 4))
>>> +             ret = acpi_bus_register_driver(&xen_acpi_pad_driver);
>>> + +     return ret;
>>> +}
>>> +subsys_initcall(xen_acpi_pad_init);
>>> diff --git a/include/xen/interface/platform.h
>>> b/include/xen/interface/platform.h index 4755b5f..a3be54c 100644
>>> --- a/include/xen/interface/platform.h +++
>>> b/include/xen/interface/platform.h @@ -324,6 +324,22 @@ struct
>>>  xenpf_cpu_ol { };
>>>  DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
>>> 
>>> +/*
>>> + * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd,
>>> + * which are already occupied at Xen hypervisor side. + */
>>> +#define XENPF_core_parking   60
>>> +struct xenpf_core_parking {
>>> +     /* IN variables */
>>> +#define XEN_CORE_PARKING_SET 1
>>> +#define XEN_CORE_PARKING_GET 2
>>> +     uint32_t type;
>>> +     /* IN variables:  set cpu nums expected to be idled */
>>> +     /* OUT variables: get cpu nums actually be idled */ +    
>>> uint32_t idle_nums; +};
>>> +DEFINE_GUEST_HANDLE_STRUCT(xenpf_core_parking);
>>> +
>>>  struct xen_platform_op {
>>>       uint32_t cmd;
>>>       uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
>>> @@ -341,6 +357,7 @@ struct xen_platform_op {
>>>               struct xenpf_set_processor_pminfo set_pminfo;
>>>               struct xenpf_pcpuinfo          pcpu_info;
>>>               struct xenpf_cpu_ol            cpu_ol;
>>> +             struct xenpf_core_parking      core_parking;
>>>               uint8_t                        pad[128];       } u;
>>>  };
>>> --
>>> 1.7.1
>> 
>> 
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@lists.xen.org
>>> http://lists.xen.org/xen-devel
>> 
>> --
>> To unsubscribe from this list: send the line "unsubscribe
>> linux-kernel" in the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 05:59:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 05:59:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVcBV-0001y7-3x; Tue, 06 Nov 2012 05:58:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xzhang@cs.uic.edu>) id 1TVcBT-0001xz-Nk
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 05:58:48 +0000
Received: from [85.158.139.211:62358] by server-11.bemta-5.messagelabs.com id
	0A/52-03409-617A8905; Tue, 06 Nov 2012 05:58:46 +0000
X-Env-Sender: xzhang@cs.uic.edu
X-Msg-Ref: server-15.tower-206.messagelabs.com!1352181365!18958618!1
X-Originating-IP: [131.193.32.56]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31529 invoked from network); 6 Nov 2012 05:57:40 -0000
Received: from mailvm.cs.uic.edu (HELO mailvm.cs.uic.edu) (131.193.32.56)
	by server-15.tower-206.messagelabs.com with SMTP;
	6 Nov 2012 05:57:40 -0000
Received: from [131.193.36.87] (dhcp17.rites.uic.edu [131.193.36.87])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mailvm.cs.uic.edu (Postfix) with ESMTP id A29C5A25B8F;
	Mon,  5 Nov 2012 23:56:04 -0600 (CST)
Message-ID: <5098A674.5090203@cs.uic.edu>
Date: Mon, 05 Nov 2012 23:56:04 -0600
From: Xu Zhang <xzhang@cs.uic.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120911 Thunderbird/15.0.1
MIME-Version: 1.0
To: Samuel Thibault <samuel.thibault@ens-lyon.org>, 
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, gm281@cam.ac.uk
References: <50871D90.50606@gmail.com> <20121025205653.GW5925@type.chello.at>
In-Reply-To: <20121025205653.GW5925@type.chello.at>
Content-Type: multipart/mixed; boundary="------------000705040403080601030602"
Subject: Re: [Xen-devel] Nested events in 64bit mini-OS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.
--------------000705040403080601030602
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Dear all,

I haven't seen any updates on this matter, so I try to come up with a 
fix. Generally speaking, I want to mimic 32-bit mini-OS behaviour, adding:
1) a fixup table: for each byte offset in the critical region, it 
provides the number of bytes which have already been popped from the 
interrupted stack frame.
2) a fixup routine: obtain number of restored registers by quickly 
looking up the fixup table and coalesce the current stack frame with the 
just-interrupted one.
3) checks against re-entrance in hypervisor_callback

The "git diff" output is attached to this email. I only did some naive 
"tests" by running it inside gdb. I am wondering is there a test suite 
for mini-OS? A follow-up question is that given this fix, do you still 
need hypercall iret?

Thank you very much.

Regards,
Xu Zhang

On 10/25/2012 03:56 PM, Samuel Thibault wrote:
> Xu Zhang, le Tue 23 Oct 2012 17:43:28 -0500, a écrit :
>> 64-bit mini-OS seems to adopt a mixed use of both (in HYPERVISOR_IRET).
>> mini-OS doesn't have an userspace, so unless an NMI happened, it always
>> perform interrupt/exception return with machine instruction iret, without
>> checking against nested events. This is wrong to me. Am I missing something
>> here?
> I don't think you are missing anything. Cc-ing Grzegorz, who actually
> wrote the code.
>
> Samuel


--------------000705040403080601030602
Content-Type: text/x-patch;
 name="fixup.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="fixup.diff"

diff --git a/extras/mini-os/arch/x86/x86_64.S b/extras/mini-os/arch/x86/x86_64.S
index a65e5d5..b4f351c 100644
--- a/extras/mini-os/arch/x86/x86_64.S
+++ b/extras/mini-os/arch/x86/x86_64.S
@@ -42,8 +42,10 @@ hypercall_page:
 
 NMI_MASK = 0x80000000
 
+#define RBX 40
 #define RDI 112
 #define ORIG_RAX 120       /* + error_code */ 
+#define RIP 128
 #define EFLAGS 144
 
 .macro RESTORE_ALL
@@ -147,7 +149,43 @@ error_call_handler:
 
 
 ENTRY(hypervisor_callback)
-    zeroentry hypervisor_callback2
+	movq (%rsp),%rcx
+	movq 8(%rsp),%r11
+	addq $0x10,%rsp /* skip rcx and r11 */
+	pushq $0	/* push error code/oldrax */ 
+	pushq %rax	/* push real oldrax to the rdi slot */ 
+	leaq hypervisor_callback2(%rip), %rax
+
+	/* rdi slot contains rax, oldrax contains error code */
+	cld	
+	subq  $14*8,%rsp
+	movq %rsi,13*8(%rsp)
+	movq 14*8(%rsp),%rsi	/* load rax from rdi slot */
+	movq %rdx,12*8(%rsp)
+	movq %rcx,11*8(%rsp)
+	movq %rsi,10*8(%rsp)	/* store rax */ 
+	movq %r8, 9*8(%rsp)
+	movq %r9, 8*8(%rsp)
+	movq %r10,7*8(%rsp)
+	movq %r11,6*8(%rsp)
+	movq %rbx,5*8(%rsp)
+	movq %rbp,4*8(%rsp)
+	movq %r12,3*8(%rsp)
+	movq %r13,2*8(%rsp)
+	movq %r14,1*8(%rsp)
+	movq %r15,(%rsp)
+	movq %rdi, RDI(%rsp)
+
+	# check against re-entrance
+	movq RIP(%rsp),%rbx
+	cmpq $scrit,%rbx
+	jb 10f
+	cmpq $ecrit,%rbx
+	jb  critical_region_fixup
+
+10:	movq RBX(%rsp),%rbx			# restore rbx
+	movq %rsp,%rdi
+	call *%rax
 
 ENTRY(hypervisor_callback2)
         movq %rdi, %rsp 
@@ -172,17 +210,40 @@ scrit:	/**** START OF CRITICAL REGION ****/
         
 14:	XEN_LOCKED_BLOCK_EVENTS(%rsi)
 	XEN_PUT_VCPU_INFO(%rsi)
-	subq $6*8,%rsp
-	movq %rbx,5*8(%rsp) 
-	movq %rbp,4*8(%rsp) 
-	movq %r12,3*8(%rsp) 
-	movq %r13,2*8(%rsp) 
-	movq %r14,1*8(%rsp) 
-	movq %r15,(%rsp) 
-        movq %rsp,%rdi                  # set the argument again
+	pushq %rbx
+	pushq %rbp
+	pushq %r12
+	pushq %r13
+	pushq %r14
+	pushq %r15
+	movq %rsp,%rdi                  # set the argument again
 	jmp  11b
 ecrit:  /**** END OF CRITICAL REGION ****/
 
+# [How we do the fixup]. We want to merge the current stack frame with the
+# just-interrupted frame. How we do this depends on where in the critical
+# region the interrupted handler was executing, and so how many saved
+# registers are in each frame. We do this quickly using the lookup table
+# 'critical_fixup_table'. For each byte offset in the critical region, it
+# provides the number of bytes which have already been popped from the
+# interrupted stack frame. 
+critical_region_fixup:
+		addq $critical_fixup_table - scrit, %rbx
+		movzbq (%rbx),%rbx    # %rbx contains num bytes popped
+		mov  %rsp,%rsi
+		add  %rbx,%rsi        # %esi points at end of src region
+		mov  %rsp,%rdi
+		add  $0xa8,%rdi       # %edi points at end of dst region
+		mov  %rbx,%rcx
+		shr  $3,%rcx          # convert bytes into count of 64-bit entities
+		je   16f              # skip loop if nothing to copy
+15:     subq $8,%rsi          # pre-decrementing copy loop
+		subq $8,%rdi
+		movq (%rsi),%rbx
+		movq %rbx,(%rdi)
+		loop 15b
+16:     movq %rdi,%rsp        # final %rdi is top of merged stack
+		jmp  10b
 
 retint_kernel:
 retint_restore_args:
@@ -210,6 +271,42 @@ error_exit:
 	jmp retint_kernel
 
 
+critical_fixup_table:
+    .byte 0x30,0x30,0x30                      # testb  $0xff,(%rsi)
+    .byte 0x30,0x30                           # jne    14f
+    .byte 0x30,0x30,0x30,0x30                 # mov    (%rsp),%r11
+    .byte 0x30,0x30,0x30,0x30,0x30            # mov    0x8(%rsp),%r10
+    .byte 0x30,0x30,0x30,0x30,0x30            # mov    0x10(%rsp),%r9
+    .byte 0x30,0x30,0x30,0x30,0x30            # mov    0x18(%rsp),%r8
+    .byte 0x30,0x30,0x30,0x30,0x30            # mov    0x20(%rsp),%rax
+    .byte 0x30,0x30,0x30,0x30,0x30            # mov    0x28(%rsp),%rcx
+    .byte 0x30,0x30,0x30,0x30,0x30            # mov    0x30(%rsp),%rdx
+    .byte 0x30,0x30,0x30,0x30,0x30            # mov    0x38(%rsp),%rsi
+    .byte 0x30,0x30,0x30,0x30,0x30            # mov    0x40(%rsp),%rdi
+    .byte 0x30,0x30,0x30,0x30                 # add    $0x50,%rsp
+    .byte 0x80,0x80,0x80,0x80                 # testl  $NMI_MASK,2*8(%rsp)
+    .byte 0x80,0x80,0x80,0x80
+    .byte 0x80,0x80                           # jne    2f
+    .byte 0x80,0x80,0x80,0x80                 # testb  $1,(xen_features+XENFEAT_supervisor_mode_kernel)
+    .byte 0x80,0x80,0x80,0x80 
+    .byte 0x80,0x80                           # jne    1f
+    .byte 0x80,0x80,0x80,0x80,0x80            # orb    $0x3,0x8(%rsp)
+    .byte 0x80,0x80,0x80,0x80,0x80            # orb    $0x3,0x20(%rsp)
+    .byte 0x80,0x80                           # iretq  
+    .byte 0x80,0x80,0x80,0x80                 # andl   $~NMI_MASK,0x10(%rsp)
+    .byte 0x80,0x80,0x80,0x80
+    .byte 0x80,0x80                           # pushq  $0x0
+    .byte 0x78,0x78,0x78,0x78,0x78            # jmp    hypercall_page + (__HYPERVISOR_iret * 32)
+    .byte 0x30,0x30,0x30,0x30                 # movb   $0x1,0x1(%rsi)
+    .byte 0x30                                # push   %rbx
+    .byte 0x28                                # push   %rbp
+    .byte 0x20,0x20                           # push   %r12
+    .byte 0x18,0x18                           # push   %r13
+    .byte 0x10,0x10                           # push   %r14
+    .byte 0x08,0x08                           # push   %r15
+    .byte 0x00,0x00,0x00                      # mov    %rsp,%rdi
+    .byte 0x00,0x00,0x00,0x00,0x00            # jmpq   11b
+
 
 ENTRY(failsafe_callback)
         popq  %rcx

--------------000705040403080601030602
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.xen.org
http://lists.xen.org/xen-devel

--------------000705040403080601030602--


From xen-devel-bounces@lists.xen.org Tue Nov 06 05:59:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 05:59:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVcBV-0001y7-3x; Tue, 06 Nov 2012 05:58:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xzhang@cs.uic.edu>) id 1TVcBT-0001xz-Nk
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 05:58:48 +0000
Received: from [85.158.139.211:62358] by server-11.bemta-5.messagelabs.com id
	0A/52-03409-617A8905; Tue, 06 Nov 2012 05:58:46 +0000
X-Env-Sender: xzhang@cs.uic.edu
X-Msg-Ref: server-15.tower-206.messagelabs.com!1352181365!18958618!1
X-Originating-IP: [131.193.32.56]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31529 invoked from network); 6 Nov 2012 05:57:40 -0000
Received: from mailvm.cs.uic.edu (HELO mailvm.cs.uic.edu) (131.193.32.56)
	by server-15.tower-206.messagelabs.com with SMTP;
	6 Nov 2012 05:57:40 -0000
Received: from [131.193.36.87] (dhcp17.rites.uic.edu [131.193.36.87])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mailvm.cs.uic.edu (Postfix) with ESMTP id A29C5A25B8F;
	Mon,  5 Nov 2012 23:56:04 -0600 (CST)
Message-ID: <5098A674.5090203@cs.uic.edu>
Date: Mon, 05 Nov 2012 23:56:04 -0600
From: Xu Zhang <xzhang@cs.uic.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120911 Thunderbird/15.0.1
MIME-Version: 1.0
To: Samuel Thibault <samuel.thibault@ens-lyon.org>, 
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, gm281@cam.ac.uk
References: <50871D90.50606@gmail.com> <20121025205653.GW5925@type.chello.at>
In-Reply-To: <20121025205653.GW5925@type.chello.at>
Content-Type: multipart/mixed; boundary="------------000705040403080601030602"
Subject: Re: [Xen-devel] Nested events in 64bit mini-OS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.
--------------000705040403080601030602
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Dear all,

I haven't seen any updates on this matter, so I try to come up with a 
fix. Generally speaking, I want to mimic 32-bit mini-OS behaviour, adding:
1) a fixup table: for each byte offset in the critical region, it 
provides the number of bytes which have already been popped from the 
interrupted stack frame.
2) a fixup routine: obtain number of restored registers by quickly 
looking up the fixup table and coalesce the current stack frame with the 
just-interrupted one.
3) checks against re-entrance in hypervisor_callback

The "git diff" output is attached to this email. I only did some naive 
"tests" by running it inside gdb. I am wondering is there a test suite 
for mini-OS? A follow-up question is that given this fix, do you still 
need hypercall iret?

Thank you very much.

Regards,
Xu Zhang

On 10/25/2012 03:56 PM, Samuel Thibault wrote:
> Xu Zhang, le Tue 23 Oct 2012 17:43:28 -0500, a écrit :
>> 64-bit mini-OS seems to adopt a mixed use of both (in HYPERVISOR_IRET).
>> mini-OS doesn't have an userspace, so unless an NMI happened, it always
>> perform interrupt/exception return with machine instruction iret, without
>> checking against nested events. This is wrong to me. Am I missing something
>> here?
> I don't think you are missing anything. Cc-ing Grzegorz, who actually
> wrote the code.
>
> Samuel


--------------000705040403080601030602
Content-Type: text/x-patch;
 name="fixup.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="fixup.diff"

diff --git a/extras/mini-os/arch/x86/x86_64.S b/extras/mini-os/arch/x86/x86_64.S
index a65e5d5..b4f351c 100644
--- a/extras/mini-os/arch/x86/x86_64.S
+++ b/extras/mini-os/arch/x86/x86_64.S
@@ -42,8 +42,10 @@ hypercall_page:
 
 NMI_MASK = 0x80000000
 
+#define RBX 40
 #define RDI 112
 #define ORIG_RAX 120       /* + error_code */ 
+#define RIP 128
 #define EFLAGS 144
 
 .macro RESTORE_ALL
@@ -147,7 +149,43 @@ error_call_handler:
 
 
 ENTRY(hypervisor_callback)
-    zeroentry hypervisor_callback2
+	movq (%rsp),%rcx
+	movq 8(%rsp),%r11
+	addq $0x10,%rsp /* skip rcx and r11 */
+	pushq $0	/* push error code/oldrax */ 
+	pushq %rax	/* push real oldrax to the rdi slot */ 
+	leaq hypervisor_callback2(%rip), %rax
+
+	/* rdi slot contains rax, oldrax contains error code */
+	cld	
+	subq  $14*8,%rsp
+	movq %rsi,13*8(%rsp)
+	movq 14*8(%rsp),%rsi	/* load rax from rdi slot */
+	movq %rdx,12*8(%rsp)
+	movq %rcx,11*8(%rsp)
+	movq %rsi,10*8(%rsp)	/* store rax */ 
+	movq %r8, 9*8(%rsp)
+	movq %r9, 8*8(%rsp)
+	movq %r10,7*8(%rsp)
+	movq %r11,6*8(%rsp)
+	movq %rbx,5*8(%rsp)
+	movq %rbp,4*8(%rsp)
+	movq %r12,3*8(%rsp)
+	movq %r13,2*8(%rsp)
+	movq %r14,1*8(%rsp)
+	movq %r15,(%rsp)
+	movq %rdi, RDI(%rsp)
+
+	# check against re-entrance
+	movq RIP(%rsp),%rbx
+	cmpq $scrit,%rbx
+	jb 10f
+	cmpq $ecrit,%rbx
+	jb  critical_region_fixup
+
+10:	movq RBX(%rsp),%rbx			# restore rbx
+	movq %rsp,%rdi
+	call *%rax
 
 ENTRY(hypervisor_callback2)
         movq %rdi, %rsp 
@@ -172,17 +210,40 @@ scrit:	/**** START OF CRITICAL REGION ****/
         
 14:	XEN_LOCKED_BLOCK_EVENTS(%rsi)
 	XEN_PUT_VCPU_INFO(%rsi)
-	subq $6*8,%rsp
-	movq %rbx,5*8(%rsp) 
-	movq %rbp,4*8(%rsp) 
-	movq %r12,3*8(%rsp) 
-	movq %r13,2*8(%rsp) 
-	movq %r14,1*8(%rsp) 
-	movq %r15,(%rsp) 
-        movq %rsp,%rdi                  # set the argument again
+	pushq %rbx
+	pushq %rbp
+	pushq %r12
+	pushq %r13
+	pushq %r14
+	pushq %r15
+	movq %rsp,%rdi                  # set the argument again
 	jmp  11b
 ecrit:  /**** END OF CRITICAL REGION ****/
 
+# [How we do the fixup]. We want to merge the current stack frame with the
+# just-interrupted frame. How we do this depends on where in the critical
+# region the interrupted handler was executing, and so how many saved
+# registers are in each frame. We do this quickly using the lookup table
+# 'critical_fixup_table'. For each byte offset in the critical region, it
+# provides the number of bytes which have already been popped from the
+# interrupted stack frame. 
+critical_region_fixup:
+		addq $critical_fixup_table - scrit, %rbx
+		movzbq (%rbx),%rbx    # %rbx contains num bytes popped
+		mov  %rsp,%rsi
+		add  %rbx,%rsi        # %esi points at end of src region
+		mov  %rsp,%rdi
+		add  $0xa8,%rdi       # %edi points at end of dst region
+		mov  %rbx,%rcx
+		shr  $3,%rcx          # convert bytes into count of 64-bit entities
+		je   16f              # skip loop if nothing to copy
+15:     subq $8,%rsi          # pre-decrementing copy loop
+		subq $8,%rdi
+		movq (%rsi),%rbx
+		movq %rbx,(%rdi)
+		loop 15b
+16:     movq %rdi,%rsp        # final %rdi is top of merged stack
+		jmp  10b
 
 retint_kernel:
 retint_restore_args:
@@ -210,6 +271,42 @@ error_exit:
 	jmp retint_kernel
 
 
+critical_fixup_table:
+    .byte 0x30,0x30,0x30                      # testb  $0xff,(%rsi)
+    .byte 0x30,0x30                           # jne    14f
+    .byte 0x30,0x30,0x30,0x30                 # mov    (%rsp),%r11
+    .byte 0x30,0x30,0x30,0x30,0x30            # mov    0x8(%rsp),%r10
+    .byte 0x30,0x30,0x30,0x30,0x30            # mov    0x10(%rsp),%r9
+    .byte 0x30,0x30,0x30,0x30,0x30            # mov    0x18(%rsp),%r8
+    .byte 0x30,0x30,0x30,0x30,0x30            # mov    0x20(%rsp),%rax
+    .byte 0x30,0x30,0x30,0x30,0x30            # mov    0x28(%rsp),%rcx
+    .byte 0x30,0x30,0x30,0x30,0x30            # mov    0x30(%rsp),%rdx
+    .byte 0x30,0x30,0x30,0x30,0x30            # mov    0x38(%rsp),%rsi
+    .byte 0x30,0x30,0x30,0x30,0x30            # mov    0x40(%rsp),%rdi
+    .byte 0x30,0x30,0x30,0x30                 # add    $0x50,%rsp
+    .byte 0x80,0x80,0x80,0x80                 # testl  $NMI_MASK,2*8(%rsp)
+    .byte 0x80,0x80,0x80,0x80
+    .byte 0x80,0x80                           # jne    2f
+    .byte 0x80,0x80,0x80,0x80                 # testb  $1,(xen_features+XENFEAT_supervisor_mode_kernel)
+    .byte 0x80,0x80,0x80,0x80 
+    .byte 0x80,0x80                           # jne    1f
+    .byte 0x80,0x80,0x80,0x80,0x80            # orb    $0x3,0x8(%rsp)
+    .byte 0x80,0x80,0x80,0x80,0x80            # orb    $0x3,0x20(%rsp)
+    .byte 0x80,0x80                           # iretq  
+    .byte 0x80,0x80,0x80,0x80                 # andl   $~NMI_MASK,0x10(%rsp)
+    .byte 0x80,0x80,0x80,0x80
+    .byte 0x80,0x80                           # pushq  $0x0
+    .byte 0x78,0x78,0x78,0x78,0x78            # jmp    hypercall_page + (__HYPERVISOR_iret * 32)
+    .byte 0x30,0x30,0x30,0x30                 # movb   $0x1,0x1(%rsi)
+    .byte 0x30                                # push   %rbx
+    .byte 0x28                                # push   %rbp
+    .byte 0x20,0x20                           # push   %r12
+    .byte 0x18,0x18                           # push   %r13
+    .byte 0x10,0x10                           # push   %r14
+    .byte 0x08,0x08                           # push   %r15
+    .byte 0x00,0x00,0x00                      # mov    %rsp,%rdi
+    .byte 0x00,0x00,0x00,0x00,0x00            # jmpq   11b
+
 
 ENTRY(failsafe_callback)
         popq  %rcx

--------------000705040403080601030602
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.xen.org
http://lists.xen.org/xen-devel

--------------000705040403080601030602--


From xen-devel-bounces@lists.xen.org Tue Nov 06 06:16:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 06:16:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVcSO-0002E1-Nj; Tue, 06 Nov 2012 06:16:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TVcSN-0002Dw-Ax
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 06:16:15 +0000
Received: from [85.158.143.35:38640] by server-1.bemta-4.messagelabs.com id
	22/36-27934-E2BA8905; Tue, 06 Nov 2012 06:16:14 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352182571!12418189!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0MTc2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8862 invoked from network); 6 Nov 2012 06:16:12 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-12.tower-21.messagelabs.com with SMTP;
	6 Nov 2012 06:16:12 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga101.fm.intel.com with ESMTP; 05 Nov 2012 22:15:51 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,721,1344236400"; d="scan'208";a="243011197"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by fmsmga001.fm.intel.com with ESMTP; 05 Nov 2012 22:15:51 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Mon, 5 Nov 2012 22:15:50 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Tue, 6 Nov 2012 14:15:20 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>, Konrad Rzeszutek
	Wilk <konrad@kernel.org>
Thread-Topic: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
Thread-Index: AQHNu2iOTi91BiFLfUibRvXA4zlK85fcS22wgAAEj4A=
Date: Tue, 6 Nov 2012 06:15:19 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537B147@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<5089676602000078000A4928@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC82923353723C7@SHSMSX101.ccr.corp.intel.com>
	<508A89CB020000780008E6ED@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
	<alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Liu, Jinsong wrote:
> Stefano Stabellini wrote:
>>>> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
>>>> index 0e86370..a2af622 100644
>>>> --- a/drivers/xen/Makefile
>>>> +++ b/drivers/xen/Makefile
>>>> @@ -29,6 +29,7 @@ obj-$(CONFIG_XEN_MCE_LOG)           += mcelog.o
>>>>  obj-$(CONFIG_XEN_PCIDEV_BACKEND)     += xen-pciback/
>>>>  obj-$(CONFIG_XEN_PRIVCMD)            += xen-privcmd.o
>>>>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)     += xen-acpi-processor.o
>>>> +obj-$(CONFIG_XEN_DOM0)                       += xen_acpi_pad.o
>>>>  xen-evtchn-y                         := evtchn.o
>>>>  xen-gntdev-y                         := gntdev.o
>>>>  xen-gntalloc-y                               := gntalloc.o
>> 
>> it should really depend on ACPI and maybe also X86, otherwise it is
>> going to break the ARM build 
>> 
>> 
> 
> Hmm, XEN_DOM0 has already depended on ACPI and X86_LOCAL_APIC (which
> depends on X86_64). 
> 

Ah, you and Konrad are right. I ignore XEN_DOM0 varies under different arch.
(But seems it not depends on X86 since it's logically an acpi stuff?).

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 06:16:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 06:16:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVcSO-0002E1-Nj; Tue, 06 Nov 2012 06:16:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TVcSN-0002Dw-Ax
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 06:16:15 +0000
Received: from [85.158.143.35:38640] by server-1.bemta-4.messagelabs.com id
	22/36-27934-E2BA8905; Tue, 06 Nov 2012 06:16:14 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352182571!12418189!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0MTc2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8862 invoked from network); 6 Nov 2012 06:16:12 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-12.tower-21.messagelabs.com with SMTP;
	6 Nov 2012 06:16:12 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga101.fm.intel.com with ESMTP; 05 Nov 2012 22:15:51 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,721,1344236400"; d="scan'208";a="243011197"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by fmsmga001.fm.intel.com with ESMTP; 05 Nov 2012 22:15:51 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Mon, 5 Nov 2012 22:15:50 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Tue, 6 Nov 2012 14:15:20 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>, Konrad Rzeszutek
	Wilk <konrad@kernel.org>
Thread-Topic: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
Thread-Index: AQHNu2iOTi91BiFLfUibRvXA4zlK85fcS22wgAAEj4A=
Date: Tue, 6 Nov 2012 06:15:19 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537B147@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<5089676602000078000A4928@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC82923353723C7@SHSMSX101.ccr.corp.intel.com>
	<508A89CB020000780008E6ED@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
	<alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Liu, Jinsong wrote:
> Stefano Stabellini wrote:
>>>> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
>>>> index 0e86370..a2af622 100644
>>>> --- a/drivers/xen/Makefile
>>>> +++ b/drivers/xen/Makefile
>>>> @@ -29,6 +29,7 @@ obj-$(CONFIG_XEN_MCE_LOG)           += mcelog.o
>>>>  obj-$(CONFIG_XEN_PCIDEV_BACKEND)     += xen-pciback/
>>>>  obj-$(CONFIG_XEN_PRIVCMD)            += xen-privcmd.o
>>>>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)     += xen-acpi-processor.o
>>>> +obj-$(CONFIG_XEN_DOM0)                       += xen_acpi_pad.o
>>>>  xen-evtchn-y                         := evtchn.o
>>>>  xen-gntdev-y                         := gntdev.o
>>>>  xen-gntalloc-y                               := gntalloc.o
>> 
>> it should really depend on ACPI and maybe also X86, otherwise it is
>> going to break the ARM build 
>> 
>> 
> 
> Hmm, XEN_DOM0 has already depended on ACPI and X86_LOCAL_APIC (which
> depends on X86_64). 
> 

Ah, you and Konrad are right. I ignore XEN_DOM0 varies under different arch.
(But seems it not depends on X86 since it's logically an acpi stuff?).

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 06:24:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 06:24:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVcZl-0002Og-Ph; Tue, 06 Nov 2012 06:23:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TVcZj-0002Ob-UY
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 06:23:52 +0000
Received: from [85.158.138.51:27932] by server-10.bemta-3.messagelabs.com id
	A3/E1-19806-7FCA8905; Tue, 06 Nov 2012 06:23:51 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1352183030!28847022!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTcyNDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10258 invoked from network); 6 Nov 2012 06:23:50 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 06:23:50 -0000
X-IronPort-AV: E=Sophos;i="4.80,721,1344211200"; d="scan'208";a="15599787"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 06:23:49 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 6 Nov 2012 06:23:48 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TVcZh-0002Ry-8c;
	Tue, 06 Nov 2012 06:23:49 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TVcZh-0000C9-0n;
	Tue, 06 Nov 2012 06:23:49 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14368-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 6 Nov 2012 06:23:49 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14368: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14368 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14368/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14365
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14365
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14365
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14352

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  bd78e5630a5b
baseline version:
 xen                  bd78e5630a5b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 06:24:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 06:24:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVcZl-0002Og-Ph; Tue, 06 Nov 2012 06:23:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TVcZj-0002Ob-UY
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 06:23:52 +0000
Received: from [85.158.138.51:27932] by server-10.bemta-3.messagelabs.com id
	A3/E1-19806-7FCA8905; Tue, 06 Nov 2012 06:23:51 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1352183030!28847022!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTcyNDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10258 invoked from network); 6 Nov 2012 06:23:50 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 06:23:50 -0000
X-IronPort-AV: E=Sophos;i="4.80,721,1344211200"; d="scan'208";a="15599787"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 06:23:49 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 6 Nov 2012 06:23:48 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TVcZh-0002Ry-8c;
	Tue, 06 Nov 2012 06:23:49 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TVcZh-0000C9-0n;
	Tue, 06 Nov 2012 06:23:49 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14368-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 6 Nov 2012 06:23:49 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14368: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14368 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14368/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14365
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14365
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14365
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14352

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  bd78e5630a5b
baseline version:
 xen                  bd78e5630a5b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 09:00:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 09:00:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVf0N-00042J-Ko; Tue, 06 Nov 2012 08:59:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVf0L-00042E-3e
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 08:59:29 +0000
Received: from [85.158.139.83:6205] by server-11.bemta-5.messagelabs.com id
	B5/1B-03409-071D8905; Tue, 06 Nov 2012 08:59:28 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1352192367!24999687!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16089 invoked from network); 6 Nov 2012 08:59:27 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-182.messagelabs.com with SMTP;
	6 Nov 2012 08:59:27 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 06 Nov 2012 09:01:21 +0000
Message-Id: <5098DF7E02000078000A696B@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 06 Nov 2012 08:59:26 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>,"Keir Fraser" <keir@xen.org>
References: <5097FC3002000078000A66AE@nat28.tlf.novell.com>
	<CCBDA499.51025%keir@xen.org>
In-Reply-To: <CCBDA499.51025%keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Subject: Re: [Xen-devel] [PATCH] x86/ACPI: invalidate BGRT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 05.11.12 at 18:15, Keir Fraser <keir@xen.org> wrote:
> On 05/11/2012 16:49, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>> Since the image pointed to may (and generally will) live in boot
>> services memory (which we add to the global memory pool long before
>> ACPI tables get looked at), we should prevent Dom0 from trying to
>> retrieve the image data.
>> 
>> The alternatives would be to
>> - not add boot services memory to the global pool at all, or
>> - defer adding boot services memory until Dom0 indicates it is safe to
>>   do so, or
>> - find and parse the BGRT table in xen/arch/x86/efi/boot.c, and avoid
>>   adding that specific region to the E820 table.
>> None of these is really attractive, and as Xen commonly prints to the
>> video console anyway (without trying to avoid any regions on the
>> screen), the invalidation would need to be done conditionally anyway.
>> 
>> (xen/include/acpi/actbl3.h is a verbatim copy from Linux 3.7-rc4)
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Acked-by: Keir Fraser <keir@xen.org>

I'll have to hold this back until the real meaning of the valid bit
here (and eventual other spec conforming ways of invalidating)
got clarified: The Linux folks tell me that their understanding of
its meaning differs from mine.

Jan

>> --- a/xen/arch/x86/acpi/boot.c
>> +++ b/xen/arch/x86/acpi/boot.c
>> @@ -286,6 +286,25 @@ static int __init acpi_parse_hpet(struct
>>  #define acpi_parse_hpet NULL
>>  #endif
>>  
>> +static int __init acpi_invalidate_bgrt(struct acpi_table_header *table)
>> +{
>> + struct acpi_table_bgrt *bgrt_tbl =
>> +  container_of(table, struct acpi_table_bgrt, header);
>> +
>> + if (table->length < sizeof(*bgrt_tbl))
>> +  return -1;
>> +
>> + if (!(bgrt_tbl->status & 1))
>> +  return 0;
>> +
>> + printk(KERN_INFO PREFIX "BGRT: invalidating v%d image at %#"PRIx64" for
>> (%u,%u)\n",
>> +        bgrt_tbl->version, bgrt_tbl->image_address,
>> +        bgrt_tbl->image_offset_x, bgrt_tbl->image_offset_y);
>> + bgrt_tbl->status &= ~1;
>> +
>> + return 0;
>> +}
>> +
>>  #ifdef CONFIG_ACPI_SLEEP
>>  #define acpi_fadt_copy_address(dst, src, len) do {   \
>> if (fadt->header.revision >= FADT2_REVISION_ID)   \
>> @@ -653,5 +672,7 @@ int __init acpi_boot_init(void)
>>  
>> erst_init();
>>  
>> + acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt);
>> +
>> return 0;
>>  }
>> --- a/xen/include/acpi/actbl.h
>> +++ b/xen/include/acpi/actbl.h
>> @@ -314,6 +314,7 @@ enum acpi_prefered_pm_profiles {
>>  
>>  #include <acpi/actbl1.h>
>>  #include <acpi/actbl2.h>
>> +#include <acpi/actbl3.h>
>>  
>>  /*
>>   * Sizes of the various flavors of FADT. We need to look closely
>> --- /dev/null
>> +++ b/xen/include/acpi/actbl3.h
>> @@ -0,0 +1,557 @@
>> 
> +/***************************************************************************
> *
>> **
>> + *
>> + * Name: actbl3.h - ACPI Table Definitions
>> + *
>> + 
>> 
> *****************************************************************************
> /
>> +
>> +/*
>> + * Copyright (C) 2000 - 2012, Intel Corp.
>> + * All rights reserved.
>> + *
>> + * Redistribution and use in source and binary forms, with or without
>> + * modification, are permitted provided that the following conditions
>> + * are met:
>> + * 1. Redistributions of source code must retain the above copyright
>> + *    notice, this list of conditions, and the following disclaimer,
>> + *    without modification.
>> + * 2. Redistributions in binary form must reproduce at minimum a disclaimer
>> + *    substantially similar to the "NO WARRANTY" disclaimer below
>> + *    ("Disclaimer") and any redistribution must be conditioned upon
>> + *    including a substantially similar Disclaimer requirement for further
>> + *    binary redistribution.
>> + * 3. Neither the names of the above-listed copyright holders nor the names
>> + *    of any contributors may be used to endorse or promote products 
> derived
>> + *    from this software without specific prior written permission.
>> + *
>> + * Alternatively, this software may be distributed under the terms of the
>> + * GNU General Public License ("GPL") version 2 as published by the Free
>> + * Software Foundation.
>> + *
>> + * NO WARRANTY
>> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
>> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
>> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
>> + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
>> + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR 
> CONSEQUENTIAL
>> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
>> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
>> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
>> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
>> + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
>> + * POSSIBILITY OF SUCH DAMAGES.
>> + */
>> +
>> +#ifndef __ACTBL3_H__
>> +#define __ACTBL3_H__
>> +
>> 
> +/***************************************************************************
> *
>> ***
>> + *
>> + * Additional ACPI Tables (3)
>> + *
>> + * These tables are not consumed directly by the ACPICA subsystem, but are
>> + * included here to support device drivers and the AML disassembler.
>> + *
>> + * The tables in this file are fully defined within the ACPI specification.
>> + *
>> + 
>> 
> ****************************************************************************
>**>
> /
>> +
>> +/*
>> + * Values for description table header signatures for tables defined in 
> this
>> + * file. Useful because they make it more difficult to inadvertently type 
> in
>> + * the wrong signature.
>> + */
>> +#define ACPI_SIG_BGRT           "BGRT" /* Boot Graphics Resource Table */
>> +#define ACPI_SIG_DRTM           "DRTM" /* Dynamic Root of Trust for
>> Measurement table */
>> +#define ACPI_SIG_FPDT           "FPDT" /* Firmware Performance Data Table 
> */
>> +#define ACPI_SIG_GTDT           "GTDT" /* Generic Timer Description Table 
> */
>> +#define ACPI_SIG_MPST           "MPST" /* Memory Power State Table */
>> +#define ACPI_SIG_PCCT           "PCCT" /* Platform Communications Channel
>> Table */
>> +#define ACPI_SIG_PMTT           "PMTT" /* Platform Memory Topology Table */
>> +#define ACPI_SIG_RASF           "RASF" /* RAS Feature table */
>> +
>> +#define ACPI_SIG_S3PT           "S3PT" /* S3 Performance (sub)Table */
>> +#define ACPI_SIG_PCCS           "PCC" /* PCC Shared Memory Region */
>> +
>> +/* Reserved table signatures */
>> +
>> +#define ACPI_SIG_CSRT           "CSRT" /* Core System Resources Table */
>> +#define ACPI_SIG_MATR           "MATR" /* Memory Address Translation Table 
> */
>> +#define ACPI_SIG_MSDM           "MSDM" /* Microsoft Data Management Table 
> */
>> +#define ACPI_SIG_WPBT           "WPBT" /* Windows Platform Binary Table */
>> +
>> +/*
>> + * All tables must be byte-packed to match the ACPI specification, since
>> + * the tables are provided by the system BIOS.
>> + */
>> +#pragma pack(1)
>> +
>> +/*
>> + * Note: C bitfields are not used for this reason:
>> + *
>> + * "Bitfields are great and easy to read, but unfortunately the C language
>> + * does not specify the layout of bitfields in memory, which means they are
>> + * essentially useless for dealing with packed data in on-disk formats or
>> + * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
>> + * this decision was a design error in C. Ritchie could have picked an 
> order
>> + * and stuck with it." Norman Ramsey.
>> + * See http://stackoverflow.com/a/1053662/41661 
>> + */
>> +
>> 
> +/***************************************************************************
> *
>> ***
>> + *
>> + * BGRT - Boot Graphics Resource Table (ACPI 5.0)
>> + *        Version 1
>> + *
>> + 
>> 
> ****************************************************************************
>**>
> /
>> +
>> +struct acpi_table_bgrt {
>> + struct acpi_table_header header; /* Common ACPI table header */
>> + u16 version;
>> + u8 status;
>> + u8 image_type;
>> + u64 image_address;
>> + u32 image_offset_x;
>> + u32 image_offset_y;
>> +};
>> +
>> 
> +/***************************************************************************
> *
>> ***
>> + *
>> + * DRTM - Dynamic Root of Trust for Measurement table
>> + *
>> + 
>> 
> ****************************************************************************
>**>
> /
>> +
>> +struct acpi_table_drtm {
>> + struct acpi_table_header header; /* Common ACPI table header */
>> + u64 entry_base_address;
>> + u64 entry_length;
>> + u32 entry_address32;
>> + u64 entry_address64;
>> + u64 exit_address;
>> + u64 log_area_address;
>> + u32 log_area_length;
>> + u64 arch_dependent_address;
>> + u32 flags;
>> +};
>> +
>> +/* 1) Validated Tables List */
>> +
>> +struct acpi_drtm_vtl_list {
>> + u32 validated_table_list_count;
>> +};
>> +
>> +/* 2) Resources List */
>> +
>> +struct acpi_drtm_resource_list {
>> + u32 resource_list_count;
>> +};
>> +
>> +/* 3) Platform-specific Identifiers List */
>> +
>> +struct acpi_drtm_id_list {
>> + u32 id_list_count;
>> +};
>> +
>> 
> +/***************************************************************************
> *
>> ***
>> + *
>> + * FPDT - Firmware Performance Data Table (ACPI 5.0)
>> + *        Version 1
>> + *
>> + 
>> 
> ****************************************************************************
>**>
> /
>> +
>> +struct acpi_table_fpdt {
>> + struct acpi_table_header header; /* Common ACPI table header */
>> +};
>> +
>> +/* FPDT subtable header */
>> +
>> +struct acpi_fpdt_header {
>> + u16 type;
>> + u8 length;
>> + u8 revision;
>> +};
>> +
>> +/* Values for Type field above */
>> +
>> +enum acpi_fpdt_type {
>> + ACPI_FPDT_TYPE_BOOT = 0,
>> + ACPI_FPDT_TYPE_S3PERF = 1,
>> +};
>> +
>> +/*
>> + * FPDT subtables
>> + */
>> +
>> +/* 0: Firmware Basic Boot Performance Record */
>> +
>> +struct acpi_fpdt_boot {
>> + struct acpi_fpdt_header header;
>> + u8 reserved[4];
>> + u64 reset_end;
>> + u64 load_start;
>> + u64 startup_start;
>> + u64 exit_services_entry;
>> + u64 exit_services_exit;
>> +};
>> +
>> +/* 1: S3 Performance Table Pointer Record */
>> +
>> +struct acpi_fpdt_s3pt_ptr {
>> + struct acpi_fpdt_header header;
>> + u8 reserved[4];
>> + u64 address;
>> +};
>> +
>> +/*
>> + * S3PT - S3 Performance Table. This table is pointed to by the
>> + * FPDT S3 Pointer Record above.
>> + */
>> +struct acpi_table_s3pt {
>> + u8 signature[4]; /* "S3PT" */
>> + u32 length;
>> +};
>> +
>> +/*
>> + * S3PT Subtables
>> + */
>> +struct acpi_s3pt_header {
>> + u16 type;
>> + u8 length;
>> + u8 revision;
>> +};
>> +
>> +/* Values for Type field above */
>> +
>> +enum acpi_s3pt_type {
>> + ACPI_S3PT_TYPE_RESUME = 0,
>> + ACPI_S3PT_TYPE_SUSPEND = 1,
>> +};
>> +
>> +struct acpi_s3pt_resume {
>> + struct acpi_s3pt_header header;
>> + u32 resume_count;
>> + u64 full_resume;
>> + u64 average_resume;
>> +};
>> +
>> +struct acpi_s3pt_suspend {
>> + struct acpi_s3pt_header header;
>> + u64 suspend_start;
>> + u64 suspend_end;
>> +};
>> +
>> 
> +/***************************************************************************
> *
>> ***
>> + *
>> + * GTDT - Generic Timer Description Table (ACPI 5.0)
>> + *        Version 1
>> + *
>> + 
>> 
> ****************************************************************************
>**>
> /
>> +
>> +struct acpi_table_gtdt {
>> + struct acpi_table_header header; /* Common ACPI table header */
>> + u64 address;
>> + u32 flags;
>> + u32 secure_pl1_interrupt;
>> + u32 secure_pl1_flags;
>> + u32 non_secure_pl1_interrupt;
>> + u32 non_secure_pl1_flags;
>> + u32 virtual_timer_interrupt;
>> + u32 virtual_timer_flags;
>> + u32 non_secure_pl2_interrupt;
>> + u32 non_secure_pl2_flags;
>> +};
>> +
>> +/* Values for Flags field above */
>> +
>> +#define ACPI_GTDT_MAPPED_BLOCK_PRESENT      1
>> +
>> +/* Values for all "TimerFlags" fields above */
>> +
>> +#define ACPI_GTDT_INTERRUPT_MODE            1
>> +#define ACPI_GTDT_INTERRUPT_POLARITY        2
>> +
>> 
> +/***************************************************************************
> *
>> ***
>> + *
>> + * MPST - Memory Power State Table (ACPI 5.0)
>> + *        Version 1
>> + *
>> + 
>> 
> ****************************************************************************
>**>
> /
>> +
>> +#define ACPI_MPST_CHANNEL_INFO \
>> + u16                             reserved1; \
>> + u8                              channel_id; \
>> + u8                              reserved2; \
>> + u16                             power_node_count;
>> +
>> +/* Main table */
>> +
>> +struct acpi_table_mpst {
>> + struct acpi_table_header header; /* Common ACPI table header */
>> +  ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
>> +};
>> +
>> +/* Memory Platform Communication Channel Info */
>> +
>> +struct acpi_mpst_channel {
>> + ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
>> +};
>> +
>> +/* Memory Power Node Structure */
>> +
>> +struct acpi_mpst_power_node {
>> + u8 flags;
>> + u8 reserved1;
>> + u16 node_id;
>> + u32 length;
>> + u64 range_address;
>> + u64 range_length;
>> + u8 num_power_states;
>> + u8 num_physical_components;
>> + u16 reserved2;
>> +};
>> +
>> +/* Values for Flags field above */
>> +
>> +#define ACPI_MPST_ENABLED               1
>> +#define ACPI_MPST_POWER_MANAGED         2
>> +#define ACPI_MPST_HOT_PLUG_CAPABLE      4
>> +
>> +/* Memory Power State Structure (follows POWER_NODE above) */
>> +
>> +struct acpi_mpst_power_state {
>> + u8 power_state;
>> + u8 info_index;
>> +};
>> +
>> +/* Physical Component ID Structure (follows POWER_STATE above) */
>> +
>> +struct acpi_mpst_component {
>> + u16 component_id;
>> +};
>> +
>> +/* Memory Power State Characteristics Structure (follows all POWER_NODEs) 
> */
>> +
>> +struct acpi_mpst_data_hdr {
>> + u16 characteristics_count;
>> +};
>> +
>> +struct acpi_mpst_power_data {
>> + u8 revision;
>> + u8 flags;
>> + u16 reserved1;
>> + u32 average_power;
>> + u32 power_saving;
>> + u64 exit_latency;
>> + u64 reserved2;
>> +};
>> +
>> +/* Values for Flags field above */
>> +
>> +#define ACPI_MPST_PRESERVE              1
>> +#define ACPI_MPST_AUTOENTRY             2
>> +#define ACPI_MPST_AUTOEXIT              4
>> +
>> +/* Shared Memory Region (not part of an ACPI table) */
>> +
>> +struct acpi_mpst_shared {
>> + u32 signature;
>> + u16 pcc_command;
>> + u16 pcc_status;
>> + u16 command_register;
>> + u16 status_register;
>> + u16 power_state_id;
>> + u16 power_node_id;
>> + u64 energy_consumed;
>> + u64 average_power;
>> +};
>> +
>> 
> +/***************************************************************************
> *
>> ***
>> + *
>> + * PCCT - Platform Communications Channel Table (ACPI 5.0)
>> + *        Version 1
>> + *
>> + 
>> 
> ****************************************************************************
>**>
> /
>> +
>> +struct acpi_table_pcct {
>> + struct acpi_table_header header; /* Common ACPI table header */
>> + u32 flags;
>> + u32 latency;
>> + u32 reserved;
>> +};
>> +
>> +/* Values for Flags field above */
>> +
>> +#define ACPI_PCCT_DOORBELL              1
>> +
>> +/*
>> + * PCCT subtables
>> + */
>> +
>> +/* 0: Generic Communications Subspace */
>> +
>> +struct acpi_pcct_subspace {
>> + struct acpi_subtable_header header;
>> + u8 reserved[6];
>> + u64 base_address;
>> + u64 length;
>> + struct acpi_generic_address doorbell_register;
>> + u64 preserve_mask;
>> + u64 write_mask;
>> +};
>> +
>> +/*
>> + * PCC memory structures (not part of the ACPI table)
>> + */
>> +
>> +/* Shared Memory Region */
>> +
>> +struct acpi_pcct_shared_memory {
>> + u32 signature;
>> + u16 command;
>> + u16 status;
>> +};
>> +
>> 
> +/***************************************************************************
> *
>> ***
>> + *
>> + * PMTT - Platform Memory Topology Table (ACPI 5.0)
>> + *        Version 1
>> + *
>> + 
>> 
> ****************************************************************************
>**>
> /
>> +
>> +struct acpi_table_pmtt {
>> + struct acpi_table_header header; /* Common ACPI table header */
>> + u32 reserved;
>> +};
>> +
>> +/* Common header for PMTT subtables that follow main table */
>> +
>> +struct acpi_pmtt_header {
>> + u8 type;
>> + u8 reserved1;
>> + u16 length;
>> + u16 flags;
>> + u16 reserved2;
>> +};
>> +
>> +/* Values for Type field above */
>> +
>> +#define ACPI_PMTT_TYPE_SOCKET           0
>> +#define ACPI_PMTT_TYPE_CONTROLLER       1
>> +#define ACPI_PMTT_TYPE_DIMM             2
>> +#define ACPI_PMTT_TYPE_RESERVED         3 /* 0x03-0xFF are reserved */
>> +
>> +/* Values for Flags field above */
>> +
>> +#define ACPI_PMTT_TOP_LEVEL             0x0001
>> +#define ACPI_PMTT_PHYSICAL              0x0002
>> +#define ACPI_PMTT_MEMORY_TYPE           0x000C
>> +
>> +/*
>> + * PMTT subtables, correspond to Type in struct acpi_pmtt_header
>> + */
>> +
>> +/* 0: Socket Structure */
>> +
>> +struct acpi_pmtt_socket {
>> + struct acpi_pmtt_header header;
>> + u16 socket_id;
>> + u16 reserved;
>> +};
>> +
>> +/* 1: Memory Controller subtable */
>> +
>> +struct acpi_pmtt_controller {
>> + struct acpi_pmtt_header header;
>> + u32 read_latency;
>> + u32 write_latency;
>> + u32 read_bandwidth;
>> + u32 write_bandwidth;
>> + u16 access_width;
>> + u16 alignment;
>> + u16 reserved;
>> + u16 domain_count;
>> +};
>> +
>> +/* 1a: Proximity Domain substructure */
>> +
>> +struct acpi_pmtt_domain {
>> + u32 proximity_domain;
>> +};
>> +
>> +/* 2: Physical Component Identifier (DIMM) */
>> +
>> +struct acpi_pmtt_physical_component {
>> + struct acpi_pmtt_header header;
>> + u16 component_id;
>> + u16 reserved;
>> + u32 memory_size;
>> + u32 bios_handle;
>> +};
>> +
>> 
> +/***************************************************************************
> *
>> ***
>> + *
>> + * RASF - RAS Feature Table (ACPI 5.0)
>> + *        Version 1
>> + *
>> + 
>> 
> ****************************************************************************
>**>
> /
>> +
>> +struct acpi_table_rasf {
>> + struct acpi_table_header header; /* Common ACPI table header */
>> + u8 channel_id[12];
>> +};
>> +
>> +/* RASF Platform Communication Channel Shared Memory Region */
>> +
>> +struct acpi_rasf_shared_memory {
>> + u32 signature;
>> + u16 command;
>> + u16 status;
>> + u64 requested_address;
>> + u64 requested_length;
>> + u64 actual_address;
>> + u64 actual_length;
>> + u16 flags;
>> + u8 speed;
>> +};
>> +
>> +/* Masks for Flags and Speed fields above */
>> +
>> +#define ACPI_RASF_SCRUBBER_RUNNING      1
>> +#define ACPI_RASF_SPEED                 (7<<1)
>> +
>> +/* Channel Commands */
>> +
>> +enum acpi_rasf_commands {
>> + ACPI_RASF_GET_RAS_CAPABILITIES = 1,
>> + ACPI_RASF_GET_PATROL_PARAMETERS = 2,
>> + ACPI_RASF_START_PATROL_SCRUBBER = 3,
>> + ACPI_RASF_STOP_PATROL_SCRUBBER = 4
>> +};
>> +
>> +/* Channel Command flags */
>> +
>> +#define ACPI_RASF_GENERATE_SCI          (1<<15)
>> +
>> +/* Status values */
>> +
>> +enum acpi_rasf_status {
>> + ACPI_RASF_SUCCESS = 0,
>> + ACPI_RASF_NOT_VALID = 1,
>> + ACPI_RASF_NOT_SUPPORTED = 2,
>> + ACPI_RASF_BUSY = 3,
>> + ACPI_RASF_FAILED = 4,
>> + ACPI_RASF_ABORTED = 5,
>> + ACPI_RASF_INVALID_DATA = 6
>> +};
>> +
>> +/* Status flags */
>> +
>> +#define ACPI_RASF_COMMAND_COMPLETE      (1)
>> +#define ACPI_RASF_SCI_DOORBELL          (1<<1)
>> +#define ACPI_RASF_ERROR                 (1<<2)
>> +#define ACPI_RASF_STATUS                (0x1F<<3)
>> +
>> +/* Reset to default packing */
>> +
>> +#pragma pack()
>> +
>> +#endif    /* __ACTBL3_H__ */
>> 
>> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org 
>> http://lists.xen.org/xen-devel 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 09:00:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 09:00:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVf0N-00042J-Ko; Tue, 06 Nov 2012 08:59:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVf0L-00042E-3e
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 08:59:29 +0000
Received: from [85.158.139.83:6205] by server-11.bemta-5.messagelabs.com id
	B5/1B-03409-071D8905; Tue, 06 Nov 2012 08:59:28 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1352192367!24999687!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16089 invoked from network); 6 Nov 2012 08:59:27 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-182.messagelabs.com with SMTP;
	6 Nov 2012 08:59:27 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 06 Nov 2012 09:01:21 +0000
Message-Id: <5098DF7E02000078000A696B@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 06 Nov 2012 08:59:26 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>,"Keir Fraser" <keir@xen.org>
References: <5097FC3002000078000A66AE@nat28.tlf.novell.com>
	<CCBDA499.51025%keir@xen.org>
In-Reply-To: <CCBDA499.51025%keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Subject: Re: [Xen-devel] [PATCH] x86/ACPI: invalidate BGRT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 05.11.12 at 18:15, Keir Fraser <keir@xen.org> wrote:
> On 05/11/2012 16:49, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>> Since the image pointed to may (and generally will) live in boot
>> services memory (which we add to the global memory pool long before
>> ACPI tables get looked at), we should prevent Dom0 from trying to
>> retrieve the image data.
>> 
>> The alternatives would be to
>> - not add boot services memory to the global pool at all, or
>> - defer adding boot services memory until Dom0 indicates it is safe to
>>   do so, or
>> - find and parse the BGRT table in xen/arch/x86/efi/boot.c, and avoid
>>   adding that specific region to the E820 table.
>> None of these is really attractive, and as Xen commonly prints to the
>> video console anyway (without trying to avoid any regions on the
>> screen), the invalidation would need to be done conditionally anyway.
>> 
>> (xen/include/acpi/actbl3.h is a verbatim copy from Linux 3.7-rc4)
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Acked-by: Keir Fraser <keir@xen.org>

I'll have to hold this back until the real meaning of the valid bit
here (and eventual other spec conforming ways of invalidating)
got clarified: The Linux folks tell me that their understanding of
its meaning differs from mine.

Jan

>> --- a/xen/arch/x86/acpi/boot.c
>> +++ b/xen/arch/x86/acpi/boot.c
>> @@ -286,6 +286,25 @@ static int __init acpi_parse_hpet(struct
>>  #define acpi_parse_hpet NULL
>>  #endif
>>  
>> +static int __init acpi_invalidate_bgrt(struct acpi_table_header *table)
>> +{
>> + struct acpi_table_bgrt *bgrt_tbl =
>> +  container_of(table, struct acpi_table_bgrt, header);
>> +
>> + if (table->length < sizeof(*bgrt_tbl))
>> +  return -1;
>> +
>> + if (!(bgrt_tbl->status & 1))
>> +  return 0;
>> +
>> + printk(KERN_INFO PREFIX "BGRT: invalidating v%d image at %#"PRIx64" for
>> (%u,%u)\n",
>> +        bgrt_tbl->version, bgrt_tbl->image_address,
>> +        bgrt_tbl->image_offset_x, bgrt_tbl->image_offset_y);
>> + bgrt_tbl->status &= ~1;
>> +
>> + return 0;
>> +}
>> +
>>  #ifdef CONFIG_ACPI_SLEEP
>>  #define acpi_fadt_copy_address(dst, src, len) do {   \
>> if (fadt->header.revision >= FADT2_REVISION_ID)   \
>> @@ -653,5 +672,7 @@ int __init acpi_boot_init(void)
>>  
>> erst_init();
>>  
>> + acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt);
>> +
>> return 0;
>>  }
>> --- a/xen/include/acpi/actbl.h
>> +++ b/xen/include/acpi/actbl.h
>> @@ -314,6 +314,7 @@ enum acpi_prefered_pm_profiles {
>>  
>>  #include <acpi/actbl1.h>
>>  #include <acpi/actbl2.h>
>> +#include <acpi/actbl3.h>
>>  
>>  /*
>>   * Sizes of the various flavors of FADT. We need to look closely
>> --- /dev/null
>> +++ b/xen/include/acpi/actbl3.h
>> @@ -0,0 +1,557 @@
>> 
> +/***************************************************************************
> *
>> **
>> + *
>> + * Name: actbl3.h - ACPI Table Definitions
>> + *
>> + 
>> 
> *****************************************************************************
> /
>> +
>> +/*
>> + * Copyright (C) 2000 - 2012, Intel Corp.
>> + * All rights reserved.
>> + *
>> + * Redistribution and use in source and binary forms, with or without
>> + * modification, are permitted provided that the following conditions
>> + * are met:
>> + * 1. Redistributions of source code must retain the above copyright
>> + *    notice, this list of conditions, and the following disclaimer,
>> + *    without modification.
>> + * 2. Redistributions in binary form must reproduce at minimum a disclaimer
>> + *    substantially similar to the "NO WARRANTY" disclaimer below
>> + *    ("Disclaimer") and any redistribution must be conditioned upon
>> + *    including a substantially similar Disclaimer requirement for further
>> + *    binary redistribution.
>> + * 3. Neither the names of the above-listed copyright holders nor the names
>> + *    of any contributors may be used to endorse or promote products 
> derived
>> + *    from this software without specific prior written permission.
>> + *
>> + * Alternatively, this software may be distributed under the terms of the
>> + * GNU General Public License ("GPL") version 2 as published by the Free
>> + * Software Foundation.
>> + *
>> + * NO WARRANTY
>> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
>> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
>> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
>> + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
>> + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR 
> CONSEQUENTIAL
>> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
>> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
>> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
>> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
>> + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
>> + * POSSIBILITY OF SUCH DAMAGES.
>> + */
>> +
>> +#ifndef __ACTBL3_H__
>> +#define __ACTBL3_H__
>> +
>> 
> +/***************************************************************************
> *
>> ***
>> + *
>> + * Additional ACPI Tables (3)
>> + *
>> + * These tables are not consumed directly by the ACPICA subsystem, but are
>> + * included here to support device drivers and the AML disassembler.
>> + *
>> + * The tables in this file are fully defined within the ACPI specification.
>> + *
>> + 
>> 
> ****************************************************************************
>**>
> /
>> +
>> +/*
>> + * Values for description table header signatures for tables defined in 
> this
>> + * file. Useful because they make it more difficult to inadvertently type 
> in
>> + * the wrong signature.
>> + */
>> +#define ACPI_SIG_BGRT           "BGRT" /* Boot Graphics Resource Table */
>> +#define ACPI_SIG_DRTM           "DRTM" /* Dynamic Root of Trust for
>> Measurement table */
>> +#define ACPI_SIG_FPDT           "FPDT" /* Firmware Performance Data Table 
> */
>> +#define ACPI_SIG_GTDT           "GTDT" /* Generic Timer Description Table 
> */
>> +#define ACPI_SIG_MPST           "MPST" /* Memory Power State Table */
>> +#define ACPI_SIG_PCCT           "PCCT" /* Platform Communications Channel
>> Table */
>> +#define ACPI_SIG_PMTT           "PMTT" /* Platform Memory Topology Table */
>> +#define ACPI_SIG_RASF           "RASF" /* RAS Feature table */
>> +
>> +#define ACPI_SIG_S3PT           "S3PT" /* S3 Performance (sub)Table */
>> +#define ACPI_SIG_PCCS           "PCC" /* PCC Shared Memory Region */
>> +
>> +/* Reserved table signatures */
>> +
>> +#define ACPI_SIG_CSRT           "CSRT" /* Core System Resources Table */
>> +#define ACPI_SIG_MATR           "MATR" /* Memory Address Translation Table 
> */
>> +#define ACPI_SIG_MSDM           "MSDM" /* Microsoft Data Management Table 
> */
>> +#define ACPI_SIG_WPBT           "WPBT" /* Windows Platform Binary Table */
>> +
>> +/*
>> + * All tables must be byte-packed to match the ACPI specification, since
>> + * the tables are provided by the system BIOS.
>> + */
>> +#pragma pack(1)
>> +
>> +/*
>> + * Note: C bitfields are not used for this reason:
>> + *
>> + * "Bitfields are great and easy to read, but unfortunately the C language
>> + * does not specify the layout of bitfields in memory, which means they are
>> + * essentially useless for dealing with packed data in on-disk formats or
>> + * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
>> + * this decision was a design error in C. Ritchie could have picked an 
> order
>> + * and stuck with it." Norman Ramsey.
>> + * See http://stackoverflow.com/a/1053662/41661 
>> + */
>> +
>> 
> +/***************************************************************************
> *
>> ***
>> + *
>> + * BGRT - Boot Graphics Resource Table (ACPI 5.0)
>> + *        Version 1
>> + *
>> + 
>> 
> ****************************************************************************
>**>
> /
>> +
>> +struct acpi_table_bgrt {
>> + struct acpi_table_header header; /* Common ACPI table header */
>> + u16 version;
>> + u8 status;
>> + u8 image_type;
>> + u64 image_address;
>> + u32 image_offset_x;
>> + u32 image_offset_y;
>> +};
>> +
>> 
> +/***************************************************************************
> *
>> ***
>> + *
>> + * DRTM - Dynamic Root of Trust for Measurement table
>> + *
>> + 
>> 
> ****************************************************************************
>**>
> /
>> +
>> +struct acpi_table_drtm {
>> + struct acpi_table_header header; /* Common ACPI table header */
>> + u64 entry_base_address;
>> + u64 entry_length;
>> + u32 entry_address32;
>> + u64 entry_address64;
>> + u64 exit_address;
>> + u64 log_area_address;
>> + u32 log_area_length;
>> + u64 arch_dependent_address;
>> + u32 flags;
>> +};
>> +
>> +/* 1) Validated Tables List */
>> +
>> +struct acpi_drtm_vtl_list {
>> + u32 validated_table_list_count;
>> +};
>> +
>> +/* 2) Resources List */
>> +
>> +struct acpi_drtm_resource_list {
>> + u32 resource_list_count;
>> +};
>> +
>> +/* 3) Platform-specific Identifiers List */
>> +
>> +struct acpi_drtm_id_list {
>> + u32 id_list_count;
>> +};
>> +
>> 
> +/***************************************************************************
> *
>> ***
>> + *
>> + * FPDT - Firmware Performance Data Table (ACPI 5.0)
>> + *        Version 1
>> + *
>> + 
>> 
> ****************************************************************************
>**>
> /
>> +
>> +struct acpi_table_fpdt {
>> + struct acpi_table_header header; /* Common ACPI table header */
>> +};
>> +
>> +/* FPDT subtable header */
>> +
>> +struct acpi_fpdt_header {
>> + u16 type;
>> + u8 length;
>> + u8 revision;
>> +};
>> +
>> +/* Values for Type field above */
>> +
>> +enum acpi_fpdt_type {
>> + ACPI_FPDT_TYPE_BOOT = 0,
>> + ACPI_FPDT_TYPE_S3PERF = 1,
>> +};
>> +
>> +/*
>> + * FPDT subtables
>> + */
>> +
>> +/* 0: Firmware Basic Boot Performance Record */
>> +
>> +struct acpi_fpdt_boot {
>> + struct acpi_fpdt_header header;
>> + u8 reserved[4];
>> + u64 reset_end;
>> + u64 load_start;
>> + u64 startup_start;
>> + u64 exit_services_entry;
>> + u64 exit_services_exit;
>> +};
>> +
>> +/* 1: S3 Performance Table Pointer Record */
>> +
>> +struct acpi_fpdt_s3pt_ptr {
>> + struct acpi_fpdt_header header;
>> + u8 reserved[4];
>> + u64 address;
>> +};
>> +
>> +/*
>> + * S3PT - S3 Performance Table. This table is pointed to by the
>> + * FPDT S3 Pointer Record above.
>> + */
>> +struct acpi_table_s3pt {
>> + u8 signature[4]; /* "S3PT" */
>> + u32 length;
>> +};
>> +
>> +/*
>> + * S3PT Subtables
>> + */
>> +struct acpi_s3pt_header {
>> + u16 type;
>> + u8 length;
>> + u8 revision;
>> +};
>> +
>> +/* Values for Type field above */
>> +
>> +enum acpi_s3pt_type {
>> + ACPI_S3PT_TYPE_RESUME = 0,
>> + ACPI_S3PT_TYPE_SUSPEND = 1,
>> +};
>> +
>> +struct acpi_s3pt_resume {
>> + struct acpi_s3pt_header header;
>> + u32 resume_count;
>> + u64 full_resume;
>> + u64 average_resume;
>> +};
>> +
>> +struct acpi_s3pt_suspend {
>> + struct acpi_s3pt_header header;
>> + u64 suspend_start;
>> + u64 suspend_end;
>> +};
>> +
>> 
> +/***************************************************************************
> *
>> ***
>> + *
>> + * GTDT - Generic Timer Description Table (ACPI 5.0)
>> + *        Version 1
>> + *
>> + 
>> 
> ****************************************************************************
>**>
> /
>> +
>> +struct acpi_table_gtdt {
>> + struct acpi_table_header header; /* Common ACPI table header */
>> + u64 address;
>> + u32 flags;
>> + u32 secure_pl1_interrupt;
>> + u32 secure_pl1_flags;
>> + u32 non_secure_pl1_interrupt;
>> + u32 non_secure_pl1_flags;
>> + u32 virtual_timer_interrupt;
>> + u32 virtual_timer_flags;
>> + u32 non_secure_pl2_interrupt;
>> + u32 non_secure_pl2_flags;
>> +};
>> +
>> +/* Values for Flags field above */
>> +
>> +#define ACPI_GTDT_MAPPED_BLOCK_PRESENT      1
>> +
>> +/* Values for all "TimerFlags" fields above */
>> +
>> +#define ACPI_GTDT_INTERRUPT_MODE            1
>> +#define ACPI_GTDT_INTERRUPT_POLARITY        2
>> +
>> 
> +/***************************************************************************
> *
>> ***
>> + *
>> + * MPST - Memory Power State Table (ACPI 5.0)
>> + *        Version 1
>> + *
>> + 
>> 
> ****************************************************************************
>**>
> /
>> +
>> +#define ACPI_MPST_CHANNEL_INFO \
>> + u16                             reserved1; \
>> + u8                              channel_id; \
>> + u8                              reserved2; \
>> + u16                             power_node_count;
>> +
>> +/* Main table */
>> +
>> +struct acpi_table_mpst {
>> + struct acpi_table_header header; /* Common ACPI table header */
>> +  ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
>> +};
>> +
>> +/* Memory Platform Communication Channel Info */
>> +
>> +struct acpi_mpst_channel {
>> + ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
>> +};
>> +
>> +/* Memory Power Node Structure */
>> +
>> +struct acpi_mpst_power_node {
>> + u8 flags;
>> + u8 reserved1;
>> + u16 node_id;
>> + u32 length;
>> + u64 range_address;
>> + u64 range_length;
>> + u8 num_power_states;
>> + u8 num_physical_components;
>> + u16 reserved2;
>> +};
>> +
>> +/* Values for Flags field above */
>> +
>> +#define ACPI_MPST_ENABLED               1
>> +#define ACPI_MPST_POWER_MANAGED         2
>> +#define ACPI_MPST_HOT_PLUG_CAPABLE      4
>> +
>> +/* Memory Power State Structure (follows POWER_NODE above) */
>> +
>> +struct acpi_mpst_power_state {
>> + u8 power_state;
>> + u8 info_index;
>> +};
>> +
>> +/* Physical Component ID Structure (follows POWER_STATE above) */
>> +
>> +struct acpi_mpst_component {
>> + u16 component_id;
>> +};
>> +
>> +/* Memory Power State Characteristics Structure (follows all POWER_NODEs) 
> */
>> +
>> +struct acpi_mpst_data_hdr {
>> + u16 characteristics_count;
>> +};
>> +
>> +struct acpi_mpst_power_data {
>> + u8 revision;
>> + u8 flags;
>> + u16 reserved1;
>> + u32 average_power;
>> + u32 power_saving;
>> + u64 exit_latency;
>> + u64 reserved2;
>> +};
>> +
>> +/* Values for Flags field above */
>> +
>> +#define ACPI_MPST_PRESERVE              1
>> +#define ACPI_MPST_AUTOENTRY             2
>> +#define ACPI_MPST_AUTOEXIT              4
>> +
>> +/* Shared Memory Region (not part of an ACPI table) */
>> +
>> +struct acpi_mpst_shared {
>> + u32 signature;
>> + u16 pcc_command;
>> + u16 pcc_status;
>> + u16 command_register;
>> + u16 status_register;
>> + u16 power_state_id;
>> + u16 power_node_id;
>> + u64 energy_consumed;
>> + u64 average_power;
>> +};
>> +
>> 
> +/***************************************************************************
> *
>> ***
>> + *
>> + * PCCT - Platform Communications Channel Table (ACPI 5.0)
>> + *        Version 1
>> + *
>> + 
>> 
> ****************************************************************************
>**>
> /
>> +
>> +struct acpi_table_pcct {
>> + struct acpi_table_header header; /* Common ACPI table header */
>> + u32 flags;
>> + u32 latency;
>> + u32 reserved;
>> +};
>> +
>> +/* Values for Flags field above */
>> +
>> +#define ACPI_PCCT_DOORBELL              1
>> +
>> +/*
>> + * PCCT subtables
>> + */
>> +
>> +/* 0: Generic Communications Subspace */
>> +
>> +struct acpi_pcct_subspace {
>> + struct acpi_subtable_header header;
>> + u8 reserved[6];
>> + u64 base_address;
>> + u64 length;
>> + struct acpi_generic_address doorbell_register;
>> + u64 preserve_mask;
>> + u64 write_mask;
>> +};
>> +
>> +/*
>> + * PCC memory structures (not part of the ACPI table)
>> + */
>> +
>> +/* Shared Memory Region */
>> +
>> +struct acpi_pcct_shared_memory {
>> + u32 signature;
>> + u16 command;
>> + u16 status;
>> +};
>> +
>> 
> +/***************************************************************************
> *
>> ***
>> + *
>> + * PMTT - Platform Memory Topology Table (ACPI 5.0)
>> + *        Version 1
>> + *
>> + 
>> 
> ****************************************************************************
>**>
> /
>> +
>> +struct acpi_table_pmtt {
>> + struct acpi_table_header header; /* Common ACPI table header */
>> + u32 reserved;
>> +};
>> +
>> +/* Common header for PMTT subtables that follow main table */
>> +
>> +struct acpi_pmtt_header {
>> + u8 type;
>> + u8 reserved1;
>> + u16 length;
>> + u16 flags;
>> + u16 reserved2;
>> +};
>> +
>> +/* Values for Type field above */
>> +
>> +#define ACPI_PMTT_TYPE_SOCKET           0
>> +#define ACPI_PMTT_TYPE_CONTROLLER       1
>> +#define ACPI_PMTT_TYPE_DIMM             2
>> +#define ACPI_PMTT_TYPE_RESERVED         3 /* 0x03-0xFF are reserved */
>> +
>> +/* Values for Flags field above */
>> +
>> +#define ACPI_PMTT_TOP_LEVEL             0x0001
>> +#define ACPI_PMTT_PHYSICAL              0x0002
>> +#define ACPI_PMTT_MEMORY_TYPE           0x000C
>> +
>> +/*
>> + * PMTT subtables, correspond to Type in struct acpi_pmtt_header
>> + */
>> +
>> +/* 0: Socket Structure */
>> +
>> +struct acpi_pmtt_socket {
>> + struct acpi_pmtt_header header;
>> + u16 socket_id;
>> + u16 reserved;
>> +};
>> +
>> +/* 1: Memory Controller subtable */
>> +
>> +struct acpi_pmtt_controller {
>> + struct acpi_pmtt_header header;
>> + u32 read_latency;
>> + u32 write_latency;
>> + u32 read_bandwidth;
>> + u32 write_bandwidth;
>> + u16 access_width;
>> + u16 alignment;
>> + u16 reserved;
>> + u16 domain_count;
>> +};
>> +
>> +/* 1a: Proximity Domain substructure */
>> +
>> +struct acpi_pmtt_domain {
>> + u32 proximity_domain;
>> +};
>> +
>> +/* 2: Physical Component Identifier (DIMM) */
>> +
>> +struct acpi_pmtt_physical_component {
>> + struct acpi_pmtt_header header;
>> + u16 component_id;
>> + u16 reserved;
>> + u32 memory_size;
>> + u32 bios_handle;
>> +};
>> +
>> 
> +/***************************************************************************
> *
>> ***
>> + *
>> + * RASF - RAS Feature Table (ACPI 5.0)
>> + *        Version 1
>> + *
>> + 
>> 
> ****************************************************************************
>**>
> /
>> +
>> +struct acpi_table_rasf {
>> + struct acpi_table_header header; /* Common ACPI table header */
>> + u8 channel_id[12];
>> +};
>> +
>> +/* RASF Platform Communication Channel Shared Memory Region */
>> +
>> +struct acpi_rasf_shared_memory {
>> + u32 signature;
>> + u16 command;
>> + u16 status;
>> + u64 requested_address;
>> + u64 requested_length;
>> + u64 actual_address;
>> + u64 actual_length;
>> + u16 flags;
>> + u8 speed;
>> +};
>> +
>> +/* Masks for Flags and Speed fields above */
>> +
>> +#define ACPI_RASF_SCRUBBER_RUNNING      1
>> +#define ACPI_RASF_SPEED                 (7<<1)
>> +
>> +/* Channel Commands */
>> +
>> +enum acpi_rasf_commands {
>> + ACPI_RASF_GET_RAS_CAPABILITIES = 1,
>> + ACPI_RASF_GET_PATROL_PARAMETERS = 2,
>> + ACPI_RASF_START_PATROL_SCRUBBER = 3,
>> + ACPI_RASF_STOP_PATROL_SCRUBBER = 4
>> +};
>> +
>> +/* Channel Command flags */
>> +
>> +#define ACPI_RASF_GENERATE_SCI          (1<<15)
>> +
>> +/* Status values */
>> +
>> +enum acpi_rasf_status {
>> + ACPI_RASF_SUCCESS = 0,
>> + ACPI_RASF_NOT_VALID = 1,
>> + ACPI_RASF_NOT_SUPPORTED = 2,
>> + ACPI_RASF_BUSY = 3,
>> + ACPI_RASF_FAILED = 4,
>> + ACPI_RASF_ABORTED = 5,
>> + ACPI_RASF_INVALID_DATA = 6
>> +};
>> +
>> +/* Status flags */
>> +
>> +#define ACPI_RASF_COMMAND_COMPLETE      (1)
>> +#define ACPI_RASF_SCI_DOORBELL          (1<<1)
>> +#define ACPI_RASF_ERROR                 (1<<2)
>> +#define ACPI_RASF_STATUS                (0x1F<<3)
>> +
>> +/* Reset to default packing */
>> +
>> +#pragma pack()
>> +
>> +#endif    /* __ACTBL3_H__ */
>> 
>> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org 
>> http://lists.xen.org/xen-devel 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 09:09:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 09:09:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVf98-0004ES-LE; Tue, 06 Nov 2012 09:08:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVf97-0004EN-Re
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 09:08:34 +0000
Received: from [85.158.139.83:40963] by server-10.bemta-5.messagelabs.com id
	03/09-09257-093D8905; Tue, 06 Nov 2012 09:08:32 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1352192912!28675891!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12406 invoked from network); 6 Nov 2012 09:08:32 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-182.messagelabs.com with SMTP;
	6 Nov 2012 09:08:32 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 06 Nov 2012 09:10:26 +0000
Message-Id: <5098E19D02000078000A697A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 06 Nov 2012 09:08:29 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir@xen.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
In-Reply-To: <CCBDA4AE.51026%keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: wei.huang2@amd.com, Tim Deegan <tim@xen.org>,
	xen-devel <xen-devel@lists.xen.org>,
	Dario Faggioli <raistlin@linux.it>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 05.11.12 at 18:15, Keir Fraser <keir@xen.org> wrote:
> On 05/11/2012 16:53, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>> Under the assumption that in these cases recurring faults aren't a
>> security issue and it can be expected that the drivers there are going
>> to try to take care of the problem.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Solving an observed problem?

In the context of analyzing the situation described in
"iommu=dom0-passthrough behavior"
(http://lists.xen.org/archives/html/xen-devel/2012-11/msg00140.html)
I suppressed the IOMMU setup for some device in Dom0, and
was quite puzzled to find that only a single fault would occur.

The BM disabling is definitely a potential problem for devices Xen
itself is making use of, and I view it as wrong for Dom0 too (it
ought to be given a chance to recover - the failure mode of the
driver for the disabled device differs quite significantly before
and after this patch).

With the change at hand, a next step (depending on the outcome
of above inquiry to the IOMMU folks) might then be to insert an
artificial device to overcome the IOMMU faults. This obviously
should only be done for Xen or Dom0 used devices, i.e. could
build on top of the special casing here.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 09:09:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 09:09:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVf98-0004ES-LE; Tue, 06 Nov 2012 09:08:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVf97-0004EN-Re
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 09:08:34 +0000
Received: from [85.158.139.83:40963] by server-10.bemta-5.messagelabs.com id
	03/09-09257-093D8905; Tue, 06 Nov 2012 09:08:32 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1352192912!28675891!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12406 invoked from network); 6 Nov 2012 09:08:32 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-182.messagelabs.com with SMTP;
	6 Nov 2012 09:08:32 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 06 Nov 2012 09:10:26 +0000
Message-Id: <5098E19D02000078000A697A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 06 Nov 2012 09:08:29 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir@xen.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
In-Reply-To: <CCBDA4AE.51026%keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: wei.huang2@amd.com, Tim Deegan <tim@xen.org>,
	xen-devel <xen-devel@lists.xen.org>,
	Dario Faggioli <raistlin@linux.it>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 05.11.12 at 18:15, Keir Fraser <keir@xen.org> wrote:
> On 05/11/2012 16:53, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>> Under the assumption that in these cases recurring faults aren't a
>> security issue and it can be expected that the drivers there are going
>> to try to take care of the problem.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Solving an observed problem?

In the context of analyzing the situation described in
"iommu=dom0-passthrough behavior"
(http://lists.xen.org/archives/html/xen-devel/2012-11/msg00140.html)
I suppressed the IOMMU setup for some device in Dom0, and
was quite puzzled to find that only a single fault would occur.

The BM disabling is definitely a potential problem for devices Xen
itself is making use of, and I view it as wrong for Dom0 too (it
ought to be given a chance to recover - the failure mode of the
driver for the disabled device differs quite significantly before
and after this patch).

With the change at hand, a next step (depending on the outcome
of above inquiry to the IOMMU folks) might then be to insert an
artificial device to overcome the IOMMU faults. This obviously
should only be done for Xen or Dom0 used devices, i.e. could
build on top of the special casing here.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 09:44:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 09:44:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVfhg-0004Vy-Nb; Tue, 06 Nov 2012 09:44:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVfhf-0004Vt-Mf
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 09:44:15 +0000
Received: from [85.158.143.99:23693] by server-3.bemta-4.messagelabs.com id
	BA/75-06841-EEBD8905; Tue, 06 Nov 2012 09:44:14 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1352195054!28461453!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6894 invoked from network); 6 Nov 2012 09:44:14 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-216.messagelabs.com with SMTP;
	6 Nov 2012 09:44:14 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 06 Nov 2012 09:44:13 +0000
Message-Id: <5098E9FC02000078000A69A7@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 06 Nov 2012 09:44:12 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<5092DE7E020000780008EB96@nat28.tlf.novell.com>
	<75058642-ad3b-4df9-a24a-7dbdc5f6e8c5@default>
	<5093954902000078000A5F45@nat28.tlf.novell.com>
	<00c25fab-a110-4f4b-a596-6cdfeb5b0d26@default>
In-Reply-To: <00c25fab-a110-4f4b-a596-6cdfeb5b0d26@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 05.11.12 at 20:16, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> Does it make sense to have a runtime option that unsets the
> physical limit but disallows legacy PV guests?  If this
> defaults to false for machines with RAM<=5TB but to true
> for machines with RAM>5TB, then the feature is "done"
> (AND we have put a stake in the ground to begin the
> slow obsolescence of PV functionality).

That would be interesting: Mukesh's PVH code wasn't even
posted yet, i.e. you're proposing to render systems with more
than 5Tb unbootable (for the lack of a - necessarily PV - Dom0
kernel runnable in that environment).

But yes, the plan is to extend the 1:1 mapping beyond 5Tb for
non-PV guests, and going through actual mapping code only
when acting in the context of a (64-bit) PV guest (even 32-bit
PV guests can have the full 1:1 mapping).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 09:44:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 09:44:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVfhg-0004Vy-Nb; Tue, 06 Nov 2012 09:44:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVfhf-0004Vt-Mf
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 09:44:15 +0000
Received: from [85.158.143.99:23693] by server-3.bemta-4.messagelabs.com id
	BA/75-06841-EEBD8905; Tue, 06 Nov 2012 09:44:14 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1352195054!28461453!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6894 invoked from network); 6 Nov 2012 09:44:14 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-216.messagelabs.com with SMTP;
	6 Nov 2012 09:44:14 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 06 Nov 2012 09:44:13 +0000
Message-Id: <5098E9FC02000078000A69A7@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 06 Nov 2012 09:44:12 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<5092DE7E020000780008EB96@nat28.tlf.novell.com>
	<75058642-ad3b-4df9-a24a-7dbdc5f6e8c5@default>
	<5093954902000078000A5F45@nat28.tlf.novell.com>
	<00c25fab-a110-4f4b-a596-6cdfeb5b0d26@default>
In-Reply-To: <00c25fab-a110-4f4b-a596-6cdfeb5b0d26@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 05.11.12 at 20:16, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> Does it make sense to have a runtime option that unsets the
> physical limit but disallows legacy PV guests?  If this
> defaults to false for machines with RAM<=5TB but to true
> for machines with RAM>5TB, then the feature is "done"
> (AND we have put a stake in the ground to begin the
> slow obsolescence of PV functionality).

That would be interesting: Mukesh's PVH code wasn't even
posted yet, i.e. you're proposing to render systems with more
than 5Tb unbootable (for the lack of a - necessarily PV - Dom0
kernel runnable in that environment).

But yes, the plan is to extend the 1:1 mapping beyond 5Tb for
non-PV guests, and going through actual mapping code only
when acting in the context of a (64-bit) PV guest (even 32-bit
PV guests can have the full 1:1 mapping).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 09:45:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 09:45:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVfiX-0004Ye-5i; Tue, 06 Nov 2012 09:45:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TVfiV-0004YX-Qc
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 09:45:07 +0000
Received: from [85.158.137.99:53424] by server-15.bemta-3.messagelabs.com id
	6B/95-09445-E1CD8905; Tue, 06 Nov 2012 09:45:02 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-5.tower-217.messagelabs.com!1352195101!13173815!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6053 invoked from network); 6 Nov 2012 09:45:02 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-5.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 6 Nov 2012 09:45:02 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TVfiK-000C2U-TF; Tue, 06 Nov 2012 09:44:56 +0000
Date: Tue, 6 Nov 2012 09:44:56 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121106094456.GA45690@ocelot.phlegethon.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5098E19D02000078000A697A@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com,
	xen-devel <xen-devel@lists.xen.org>,
	Dario Faggioli <raistlin@linux.it>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
	faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 09:08 +0000 on 06 Nov (1352192909), Jan Beulich wrote:
> >>> On 05.11.12 at 18:15, Keir Fraser <keir@xen.org> wrote:
> > On 05/11/2012 16:53, "Jan Beulich" <JBeulich@suse.com> wrote:
> > 
> >> Under the assumption that in these cases recurring faults aren't a
> >> security issue and it can be expected that the drivers there are going
> >> to try to take care of the problem.
> >> 
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> > 
> > Solving an observed problem?
> 
> In the context of analyzing the situation described in
> "iommu=dom0-passthrough behavior"
> (http://lists.xen.org/archives/html/xen-devel/2012-11/msg00140.html)
> I suppressed the IOMMU setup for some device in Dom0, and
> was quite puzzled to find that only a single fault would occur.

I think it would be better to allow some small number of faults per
device before disabling it rather than give dom0 carte blanche.

This check is really there to stop a mad device from hosing the system
rather than to contain a malicious OS, and a properly out-of-control
device needs to be stopped or it will livelock Xen with iommu faults.
In a uniprocessor system, dom0 might never get the chance to fix it.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 09:45:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 09:45:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVfiX-0004Ye-5i; Tue, 06 Nov 2012 09:45:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TVfiV-0004YX-Qc
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 09:45:07 +0000
Received: from [85.158.137.99:53424] by server-15.bemta-3.messagelabs.com id
	6B/95-09445-E1CD8905; Tue, 06 Nov 2012 09:45:02 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-5.tower-217.messagelabs.com!1352195101!13173815!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6053 invoked from network); 6 Nov 2012 09:45:02 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-5.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 6 Nov 2012 09:45:02 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TVfiK-000C2U-TF; Tue, 06 Nov 2012 09:44:56 +0000
Date: Tue, 6 Nov 2012 09:44:56 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121106094456.GA45690@ocelot.phlegethon.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5098E19D02000078000A697A@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com,
	xen-devel <xen-devel@lists.xen.org>,
	Dario Faggioli <raistlin@linux.it>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
	faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 09:08 +0000 on 06 Nov (1352192909), Jan Beulich wrote:
> >>> On 05.11.12 at 18:15, Keir Fraser <keir@xen.org> wrote:
> > On 05/11/2012 16:53, "Jan Beulich" <JBeulich@suse.com> wrote:
> > 
> >> Under the assumption that in these cases recurring faults aren't a
> >> security issue and it can be expected that the drivers there are going
> >> to try to take care of the problem.
> >> 
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> > 
> > Solving an observed problem?
> 
> In the context of analyzing the situation described in
> "iommu=dom0-passthrough behavior"
> (http://lists.xen.org/archives/html/xen-devel/2012-11/msg00140.html)
> I suppressed the IOMMU setup for some device in Dom0, and
> was quite puzzled to find that only a single fault would occur.

I think it would be better to allow some small number of faults per
device before disabling it rather than give dom0 carte blanche.

This check is really there to stop a mad device from hosing the system
rather than to contain a malicious OS, and a properly out-of-control
device needs to be stopped or it will livelock Xen with iommu faults.
In a uniprocessor system, dom0 might never get the chance to fix it.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 10:22:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 10:22:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVgIa-00052Y-OG; Tue, 06 Nov 2012 10:22:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVgIZ-00052T-JT
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 10:22:23 +0000
Received: from [85.158.143.35:59332] by server-2.bemta-4.messagelabs.com id
	48/E4-28922-ED4E8905; Tue, 06 Nov 2012 10:22:22 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1352197151!14832689!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3935 invoked from network); 6 Nov 2012 10:19:11 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-21.messagelabs.com with SMTP;
	6 Nov 2012 10:19:11 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 06 Nov 2012 10:19:10 +0000
Message-Id: <5098F22C02000078000A69E2@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 06 Nov 2012 10:19:08 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
In-Reply-To: <20121106094456.GA45690@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com,
	xen-devel <xen-devel@lists.xen.org>,
	Dario Faggioli <raistlin@linux.it>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 06.11.12 at 10:44, Tim Deegan <tim@xen.org> wrote:
> At 09:08 +0000 on 06 Nov (1352192909), Jan Beulich wrote:
>> >>> On 05.11.12 at 18:15, Keir Fraser <keir@xen.org> wrote:
>> > On 05/11/2012 16:53, "Jan Beulich" <JBeulich@suse.com> wrote:
>> > 
>> >> Under the assumption that in these cases recurring faults aren't a
>> >> security issue and it can be expected that the drivers there are going
>> >> to try to take care of the problem.
>> >> 
>> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> > 
>> > Solving an observed problem?
>> 
>> In the context of analyzing the situation described in
>> "iommu=dom0-passthrough behavior"
>> (http://lists.xen.org/archives/html/xen-devel/2012-11/msg00140.html)
>> I suppressed the IOMMU setup for some device in Dom0, and
>> was quite puzzled to find that only a single fault would occur.
> 
> I think it would be better to allow some small number of faults per
> device before disabling it rather than give dom0 carte blanche.
> 
> This check is really there to stop a mad device from hosing the system
> rather than to contain a malicious OS, and a properly out-of-control
> device needs to be stopped or it will livelock Xen with iommu faults.
> In a uniprocessor system, dom0 might never get the chance to fix it.

If that's the main goal, then on the AMD side the code may not do
what you want it to: PPR log entries, causing interrupts too, don't
get limited/suppressed in any way, yet are obviously to some
extent under guest control.

But yes, for the purpose here limiting the fault rate in some way
(with a slightly higher limit for Dom0 than DomU-s) would indeed
be the better route.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 10:22:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 10:22:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVgIa-00052Y-OG; Tue, 06 Nov 2012 10:22:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVgIZ-00052T-JT
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 10:22:23 +0000
Received: from [85.158.143.35:59332] by server-2.bemta-4.messagelabs.com id
	48/E4-28922-ED4E8905; Tue, 06 Nov 2012 10:22:22 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1352197151!14832689!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3935 invoked from network); 6 Nov 2012 10:19:11 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-21.messagelabs.com with SMTP;
	6 Nov 2012 10:19:11 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 06 Nov 2012 10:19:10 +0000
Message-Id: <5098F22C02000078000A69E2@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 06 Nov 2012 10:19:08 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
In-Reply-To: <20121106094456.GA45690@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com,
	xen-devel <xen-devel@lists.xen.org>,
	Dario Faggioli <raistlin@linux.it>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 06.11.12 at 10:44, Tim Deegan <tim@xen.org> wrote:
> At 09:08 +0000 on 06 Nov (1352192909), Jan Beulich wrote:
>> >>> On 05.11.12 at 18:15, Keir Fraser <keir@xen.org> wrote:
>> > On 05/11/2012 16:53, "Jan Beulich" <JBeulich@suse.com> wrote:
>> > 
>> >> Under the assumption that in these cases recurring faults aren't a
>> >> security issue and it can be expected that the drivers there are going
>> >> to try to take care of the problem.
>> >> 
>> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> > 
>> > Solving an observed problem?
>> 
>> In the context of analyzing the situation described in
>> "iommu=dom0-passthrough behavior"
>> (http://lists.xen.org/archives/html/xen-devel/2012-11/msg00140.html)
>> I suppressed the IOMMU setup for some device in Dom0, and
>> was quite puzzled to find that only a single fault would occur.
> 
> I think it would be better to allow some small number of faults per
> device before disabling it rather than give dom0 carte blanche.
> 
> This check is really there to stop a mad device from hosing the system
> rather than to contain a malicious OS, and a properly out-of-control
> device needs to be stopped or it will livelock Xen with iommu faults.
> In a uniprocessor system, dom0 might never get the chance to fix it.

If that's the main goal, then on the AMD side the code may not do
what you want it to: PPR log entries, causing interrupts too, don't
get limited/suppressed in any way, yet are obviously to some
extent under guest control.

But yes, for the purpose here limiting the fault rate in some way
(with a slightly higher limit for Dom0 than DomU-s) would indeed
be the better route.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 10:30:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 10:30:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVgPr-0005Bi-KY; Tue, 06 Nov 2012 10:29:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <qiumojiong@gmail.com>) id 1TVeCz-0003Wo-V5
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 08:08:30 +0000
Received: from [85.158.137.99:22452] by server-16.bemta-3.messagelabs.com id
	57/73-07461-875C8905; Tue, 06 Nov 2012 08:08:24 +0000
X-Env-Sender: qiumojiong@gmail.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1352189301!12836005!1
X-Originating-IP: [209.85.210.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6509 invoked from network); 6 Nov 2012 08:08:23 -0000
Received: from mail-da0-f43.google.com (HELO mail-da0-f43.google.com)
	(209.85.210.43)
	by server-3.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 08:08:23 -0000
Received: by mail-da0-f43.google.com with SMTP id u36so91759dak.30
	for <xen-devel@lists.xensource.com>;
	Tue, 06 Nov 2012 00:08:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer;
	bh=RIvVhEaHh8hDwAX84wCQsrxXTxVNv9Z44jyO0dJEDTo=;
	b=YdZjE1granE8S/4olSy/X+mhqIdg37YCX2tLEO/8C3bnxGaRw1JoIjw+koYDYo0LNG
	5l/7sfNCjjfmow+9D05a9YOnWGDIy/srG1OszoD+g0endAaVCdXZ7pSwMMUobbO6k1mC
	TlHENr2Bv6zgNVaCgCEitx5bNiTvE8wtJtqIyPMO855aiWWgtOK7Z7nlgbkwSMafd7e+
	f1Gn7xKbLlimcZc3DFiZaT6zLLcDuZMwfrXu3UHsKNQn2tmzTwbxUYu48+5zEG7Nnroo
	+CvECaFEjRLxH+KcteMmRJRn4hi6ccjzafEnBRX+yHL8CaONQmI/JA4QaKRy87+pLBt5
	UcXA==
Received: by 10.68.240.36 with SMTP id vx4mr1033342pbc.90.1352189301008;
	Tue, 06 Nov 2012 00:08:21 -0800 (PST)
Received: from localhost.localdomain ([61.135.172.68])
	by mx.google.com with ESMTPS id pu4sm4886515pbb.72.2012.11.06.00.08.15
	(version=TLSv1/SSLv3 cipher=OTHER);
	Tue, 06 Nov 2012 00:08:20 -0800 (PST)
From: Mojiong Qiu <qiumojiong@gmail.com>
To: linux-kernel@vger.kernel.org
Date: Tue,  6 Nov 2012 16:08:15 +0800
Message-Id: <1352189295-7111-1-git-send-email-qiumojiong@gmail.com>
X-Mailer: git-send-email 1.7.9.5
X-Mailman-Approved-At: Tue, 06 Nov 2012 10:29:54 +0000
Cc: Jeremy Fitzhardinge <jeremy@goop.org>, xen-devel@lists.xensource.com,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Mojiong Qiu <qiumojiong@gmail.com>, Mojiong Qiu <mjqiu@tencent.com>,
	virtualization@lists.linux-foundation.org,
	"at least to 3.0.y" <stable@kernel.org>
Subject: [Xen-devel] [PATCH] xen/events: xen/events: fix RCU warning
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

exit_idle() should be called after irq_enter(), otherwise it throws:

[    2.513020] [ INFO: suspicious RCU usage. ]
[    2.513076] 3.6.5 #1 Not tainted
[    2.513128] -------------------------------
[    2.513183] include/linux/rcupdate.h:725 rcu_read_lock() used illegally while idle!
[    2.513271]
[    2.513271] other info that might help us debug this:
[    2.513271]
[    2.513388]
[    2.513388] RCU used illegally from idle CPU!
[    2.513388] rcu_scheduler_active = 1, debug_locks = 1
[    2.513511] RCU used illegally from extended quiescent state!
[    2.513572] 1 lock held by swapper/0/0:
[    2.513626]  #0:  (rcu_read_lock){......}, at: [<ffffffff810e9fe0>] __atomic_notifier_call_chain+0x0/0x140
[    2.513815]
[    2.513815] stack backtrace:
[    2.513897] Pid: 0, comm: swapper/0 Not tainted 3.6.5 #1
[    2.513954] Call Trace:
[    2.514005]  <IRQ>  [<ffffffff811259a2>] lockdep_rcu_suspicious+0xe2/0x130
[    2.514107]  [<ffffffff810ea10c>] __atomic_notifier_call_chain+0x12c/0x140
[    2.514169]  [<ffffffff810e9fe0>] ? atomic_notifier_chain_unregister+0x90/0x90
[    2.514258]  [<ffffffff811216cd>] ? trace_hardirqs_off+0xd/0x10
[    2.514318]  [<ffffffff810ea136>] atomic_notifier_call_chain+0x16/0x20
[    2.514381]  [<ffffffff810777c3>] exit_idle+0x43/0x50
[    2.514441]  [<ffffffff81568865>] xen_evtchn_do_upcall+0x25/0x50
[    2.514503]  [<ffffffff81aa690e>] xen_do_hypervisor_callback+0x1e/0x30
[    2.514562]  <EOI>  [<ffffffff810013aa>] ? hypercall_page+0x3aa/0x1000
[    2.514662]  [<ffffffff810013aa>] ? hypercall_page+0x3aa/0x1000
[    2.514722]  [<ffffffff81061540>] ? xen_safe_halt+0x10/0x20
[    2.514782]  [<ffffffff81075cfa>] ? default_idle+0xba/0x570
[    2.514841]  [<ffffffff810778af>] ? cpu_idle+0xdf/0x140
[    2.514900]  [<ffffffff81a4d881>] ? rest_init+0x135/0x144
[    2.514960]  [<ffffffff81a4d74c>] ? csum_partial_copy_generic+0x16c/0x16c
[    2.515022]  [<ffffffff82520c45>] ? start_kernel+0x3db/0x3e8
[    2.515081]  [<ffffffff8252066a>] ? repair_env_string+0x5a/0x5a
[    2.515141]  [<ffffffff82520356>] ? x86_64_start_reservations+0x131/0x135
[    2.515202]  [<ffffffff82524aca>] ? xen_start_kernel+0x465/0x46

Signed-off-by: Mojiong Qiu <mjqiu@tencent.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: xen-devel@lists.xensource.com
Cc: virtualization@lists.linux-foundation.org
Cc: linux-kernel@vger.kernel.org
Cc: stable@kernel.org (at least to 3.0.y)
---
 drivers/xen/events.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 912ac81..0be4df3 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -1395,10 +1395,10 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
 {
 	struct pt_regs *old_regs = set_irq_regs(regs);
 
+	irq_enter();
 #ifdef CONFIG_X86
 	exit_idle();
 #endif
-	irq_enter();
 
 	__xen_evtchn_do_upcall();
 
-- 
1.6.3.2


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 10:30:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 10:30:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVgPr-0005Bi-KY; Tue, 06 Nov 2012 10:29:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <qiumojiong@gmail.com>) id 1TVeCz-0003Wo-V5
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 08:08:30 +0000
Received: from [85.158.137.99:22452] by server-16.bemta-3.messagelabs.com id
	57/73-07461-875C8905; Tue, 06 Nov 2012 08:08:24 +0000
X-Env-Sender: qiumojiong@gmail.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1352189301!12836005!1
X-Originating-IP: [209.85.210.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6509 invoked from network); 6 Nov 2012 08:08:23 -0000
Received: from mail-da0-f43.google.com (HELO mail-da0-f43.google.com)
	(209.85.210.43)
	by server-3.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 08:08:23 -0000
Received: by mail-da0-f43.google.com with SMTP id u36so91759dak.30
	for <xen-devel@lists.xensource.com>;
	Tue, 06 Nov 2012 00:08:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer;
	bh=RIvVhEaHh8hDwAX84wCQsrxXTxVNv9Z44jyO0dJEDTo=;
	b=YdZjE1granE8S/4olSy/X+mhqIdg37YCX2tLEO/8C3bnxGaRw1JoIjw+koYDYo0LNG
	5l/7sfNCjjfmow+9D05a9YOnWGDIy/srG1OszoD+g0endAaVCdXZ7pSwMMUobbO6k1mC
	TlHENr2Bv6zgNVaCgCEitx5bNiTvE8wtJtqIyPMO855aiWWgtOK7Z7nlgbkwSMafd7e+
	f1Gn7xKbLlimcZc3DFiZaT6zLLcDuZMwfrXu3UHsKNQn2tmzTwbxUYu48+5zEG7Nnroo
	+CvECaFEjRLxH+KcteMmRJRn4hi6ccjzafEnBRX+yHL8CaONQmI/JA4QaKRy87+pLBt5
	UcXA==
Received: by 10.68.240.36 with SMTP id vx4mr1033342pbc.90.1352189301008;
	Tue, 06 Nov 2012 00:08:21 -0800 (PST)
Received: from localhost.localdomain ([61.135.172.68])
	by mx.google.com with ESMTPS id pu4sm4886515pbb.72.2012.11.06.00.08.15
	(version=TLSv1/SSLv3 cipher=OTHER);
	Tue, 06 Nov 2012 00:08:20 -0800 (PST)
From: Mojiong Qiu <qiumojiong@gmail.com>
To: linux-kernel@vger.kernel.org
Date: Tue,  6 Nov 2012 16:08:15 +0800
Message-Id: <1352189295-7111-1-git-send-email-qiumojiong@gmail.com>
X-Mailer: git-send-email 1.7.9.5
X-Mailman-Approved-At: Tue, 06 Nov 2012 10:29:54 +0000
Cc: Jeremy Fitzhardinge <jeremy@goop.org>, xen-devel@lists.xensource.com,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Mojiong Qiu <qiumojiong@gmail.com>, Mojiong Qiu <mjqiu@tencent.com>,
	virtualization@lists.linux-foundation.org,
	"at least to 3.0.y" <stable@kernel.org>
Subject: [Xen-devel] [PATCH] xen/events: xen/events: fix RCU warning
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

exit_idle() should be called after irq_enter(), otherwise it throws:

[    2.513020] [ INFO: suspicious RCU usage. ]
[    2.513076] 3.6.5 #1 Not tainted
[    2.513128] -------------------------------
[    2.513183] include/linux/rcupdate.h:725 rcu_read_lock() used illegally while idle!
[    2.513271]
[    2.513271] other info that might help us debug this:
[    2.513271]
[    2.513388]
[    2.513388] RCU used illegally from idle CPU!
[    2.513388] rcu_scheduler_active = 1, debug_locks = 1
[    2.513511] RCU used illegally from extended quiescent state!
[    2.513572] 1 lock held by swapper/0/0:
[    2.513626]  #0:  (rcu_read_lock){......}, at: [<ffffffff810e9fe0>] __atomic_notifier_call_chain+0x0/0x140
[    2.513815]
[    2.513815] stack backtrace:
[    2.513897] Pid: 0, comm: swapper/0 Not tainted 3.6.5 #1
[    2.513954] Call Trace:
[    2.514005]  <IRQ>  [<ffffffff811259a2>] lockdep_rcu_suspicious+0xe2/0x130
[    2.514107]  [<ffffffff810ea10c>] __atomic_notifier_call_chain+0x12c/0x140
[    2.514169]  [<ffffffff810e9fe0>] ? atomic_notifier_chain_unregister+0x90/0x90
[    2.514258]  [<ffffffff811216cd>] ? trace_hardirqs_off+0xd/0x10
[    2.514318]  [<ffffffff810ea136>] atomic_notifier_call_chain+0x16/0x20
[    2.514381]  [<ffffffff810777c3>] exit_idle+0x43/0x50
[    2.514441]  [<ffffffff81568865>] xen_evtchn_do_upcall+0x25/0x50
[    2.514503]  [<ffffffff81aa690e>] xen_do_hypervisor_callback+0x1e/0x30
[    2.514562]  <EOI>  [<ffffffff810013aa>] ? hypercall_page+0x3aa/0x1000
[    2.514662]  [<ffffffff810013aa>] ? hypercall_page+0x3aa/0x1000
[    2.514722]  [<ffffffff81061540>] ? xen_safe_halt+0x10/0x20
[    2.514782]  [<ffffffff81075cfa>] ? default_idle+0xba/0x570
[    2.514841]  [<ffffffff810778af>] ? cpu_idle+0xdf/0x140
[    2.514900]  [<ffffffff81a4d881>] ? rest_init+0x135/0x144
[    2.514960]  [<ffffffff81a4d74c>] ? csum_partial_copy_generic+0x16c/0x16c
[    2.515022]  [<ffffffff82520c45>] ? start_kernel+0x3db/0x3e8
[    2.515081]  [<ffffffff8252066a>] ? repair_env_string+0x5a/0x5a
[    2.515141]  [<ffffffff82520356>] ? x86_64_start_reservations+0x131/0x135
[    2.515202]  [<ffffffff82524aca>] ? xen_start_kernel+0x465/0x46

Signed-off-by: Mojiong Qiu <mjqiu@tencent.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: xen-devel@lists.xensource.com
Cc: virtualization@lists.linux-foundation.org
Cc: linux-kernel@vger.kernel.org
Cc: stable@kernel.org (at least to 3.0.y)
---
 drivers/xen/events.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 912ac81..0be4df3 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -1395,10 +1395,10 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
 {
 	struct pt_regs *old_regs = set_irq_regs(regs);
 
+	irq_enter();
 #ifdef CONFIG_X86
 	exit_idle();
 #endif
-	irq_enter();
 
 	__xen_evtchn_do_upcall();
 
-- 
1.6.3.2


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 10:49:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 10:49:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVgiV-0005Rn-QL; Tue, 06 Nov 2012 10:49:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVgiU-0005Ri-7p
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 10:49:10 +0000
Received: from [85.158.143.99:47523] by server-3.bemta-4.messagelabs.com id
	43/24-06841-52BE8905; Tue, 06 Nov 2012 10:49:09 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1352198949!28473598!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16325 invoked from network); 6 Nov 2012 10:49:09 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-216.messagelabs.com with SMTP;
	6 Nov 2012 10:49:09 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 06 Nov 2012 10:49:08 +0000
Message-Id: <5098F93202000078000A6A14@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 06 Nov 2012 10:49:06 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<20121104203532.GA11377@ocelot.phlegethon.org>
	<cea9c9ab-8775-4f8c-9849-471eca5535b5@default>
In-Reply-To: <cea9c9ab-8775-4f8c-9849-471eca5535b5@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Tim Deegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	Keir Fraser <keir@xen.org>, IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	ZhigangWang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 05.11.12 at 23:33, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> For address-width limits, I suspect we are talking mostly or
> entirely about DMA in 32-bit PV domains?  And/or PCI-passthrough?
> I'll look into it further, but if those are the principal cases,
> I'd have no problem documenting that the claim hypercall doesn't
> handle them and attempts to build such a domain might still
> fail slowly.  At least unless/until someone decided to add
> any necessary special corner cases to the claim hypercall.

DMA (also for 64-bit PV) is one aspect, and the fundamental
address restriction of 32-bit guests is the perhaps more
important one (for they can't access the full M2P map, and
hence can't ever be handed pages not covered by the
portion they have access to).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 10:49:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 10:49:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVgiV-0005Rn-QL; Tue, 06 Nov 2012 10:49:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVgiU-0005Ri-7p
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 10:49:10 +0000
Received: from [85.158.143.99:47523] by server-3.bemta-4.messagelabs.com id
	43/24-06841-52BE8905; Tue, 06 Nov 2012 10:49:09 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1352198949!28473598!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16325 invoked from network); 6 Nov 2012 10:49:09 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-216.messagelabs.com with SMTP;
	6 Nov 2012 10:49:09 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 06 Nov 2012 10:49:08 +0000
Message-Id: <5098F93202000078000A6A14@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 06 Nov 2012 10:49:06 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<20121104203532.GA11377@ocelot.phlegethon.org>
	<cea9c9ab-8775-4f8c-9849-471eca5535b5@default>
In-Reply-To: <cea9c9ab-8775-4f8c-9849-471eca5535b5@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Tim Deegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	Keir Fraser <keir@xen.org>, IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	ZhigangWang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 05.11.12 at 23:33, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> For address-width limits, I suspect we are talking mostly or
> entirely about DMA in 32-bit PV domains?  And/or PCI-passthrough?
> I'll look into it further, but if those are the principal cases,
> I'd have no problem documenting that the claim hypercall doesn't
> handle them and attempts to build such a domain might still
> fail slowly.  At least unless/until someone decided to add
> any necessary special corner cases to the claim hypercall.

DMA (also for 64-bit PV) is one aspect, and the fundamental
address restriction of 32-bit guests is the perhaps more
important one (for they can't access the full M2P map, and
hence can't ever be handed pages not covered by the
portion they have access to).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 12:07:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 12:07:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVhwD-0005zt-Nf; Tue, 06 Nov 2012 12:07:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dario.faggioli@citrix.com>) id 1TVhwC-0005zo-7o
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 12:07:24 +0000
Received: from [85.158.143.99:48580] by server-3.bemta-4.messagelabs.com id
	58/71-06841-A7DF8905; Tue, 06 Nov 2012 12:07:22 +0000
X-Env-Sender: dario.faggioli@citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1352203622!23539135!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTczNjc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12499 invoked from network); 6 Nov 2012 12:07:02 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 12:07:02 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344211200"; 
	d="asc'?scan'208";a="15608811"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 12:06:35 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Tue, 6 Nov 2012
	12:06:34 +0000
Message-ID: <1352203585.505.5.camel@Solace>
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Tue, 6 Nov 2012 13:06:25 +0100
In-Reply-To: <20121106094456.GA45690@ocelot.phlegethon.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com,
	xen-devel <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7679863783174260802=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============7679863783174260802==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="=-EKNA1l+QEyhzJYFv4W33"

--=-EKNA1l+QEyhzJYFv4W33
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, 2012-11-06 at 09:44 +0000, Tim Deegan wrote:
> > In the context of analyzing the situation described in
> > "iommu=3Ddom0-passthrough behavior"
> > (http://lists.xen.org/archives/html/xen-devel/2012-11/msg00140.html)
> > I suppressed the IOMMU setup for some device in Dom0, and
> > was quite puzzled to find that only a single fault would occur.
>=20
> I think it would be better to allow some small number of faults per
> device before disabling it rather than give dom0 carte blanche.
>=20
> This check is really there to stop a mad device from hosing the system
> rather than to contain a malicious OS, and a properly out-of-control
> device needs to be stopped or it will livelock Xen with iommu faults.
> In a uniprocessor system, dom0 might never get the chance to fix it.
>=20
Right. But moving the fault handling code to softirq should have already
helped solving/mitigating that, hasn't it?

When implementing and testing that, I wasn't able to reproduce any
livelock situation (although I can't exclude that to be at least partly
due to my inexperience, especially at the time, with I/O
virtualization)... Jan, have you (after killing the 'disable
bus-mastering part' of course)?

Regards,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-EKNA1l+QEyhzJYFv4W33
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCY/UEACgkQk4XaBE3IOsQ1pQCbBluNzWKjNzntGZ4CPCFLt4mR
iC4AniTNi3OIBScljLAnzZH7ymkHRJRh
=v2EJ
-----END PGP SIGNATURE-----

--=-EKNA1l+QEyhzJYFv4W33--


--===============7679863783174260802==
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.xen.org
http://lists.xen.org/xen-devel

--===============7679863783174260802==--


From xen-devel-bounces@lists.xen.org Tue Nov 06 12:07:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 12:07:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVhwD-0005zt-Nf; Tue, 06 Nov 2012 12:07:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dario.faggioli@citrix.com>) id 1TVhwC-0005zo-7o
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 12:07:24 +0000
Received: from [85.158.143.99:48580] by server-3.bemta-4.messagelabs.com id
	58/71-06841-A7DF8905; Tue, 06 Nov 2012 12:07:22 +0000
X-Env-Sender: dario.faggioli@citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1352203622!23539135!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTczNjc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12499 invoked from network); 6 Nov 2012 12:07:02 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 12:07:02 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344211200"; 
	d="asc'?scan'208";a="15608811"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 12:06:35 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Tue, 6 Nov 2012
	12:06:34 +0000
Message-ID: <1352203585.505.5.camel@Solace>
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Tue, 6 Nov 2012 13:06:25 +0100
In-Reply-To: <20121106094456.GA45690@ocelot.phlegethon.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com,
	xen-devel <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7679863783174260802=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============7679863783174260802==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="=-EKNA1l+QEyhzJYFv4W33"

--=-EKNA1l+QEyhzJYFv4W33
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, 2012-11-06 at 09:44 +0000, Tim Deegan wrote:
> > In the context of analyzing the situation described in
> > "iommu=3Ddom0-passthrough behavior"
> > (http://lists.xen.org/archives/html/xen-devel/2012-11/msg00140.html)
> > I suppressed the IOMMU setup for some device in Dom0, and
> > was quite puzzled to find that only a single fault would occur.
>=20
> I think it would be better to allow some small number of faults per
> device before disabling it rather than give dom0 carte blanche.
>=20
> This check is really there to stop a mad device from hosing the system
> rather than to contain a malicious OS, and a properly out-of-control
> device needs to be stopped or it will livelock Xen with iommu faults.
> In a uniprocessor system, dom0 might never get the chance to fix it.
>=20
Right. But moving the fault handling code to softirq should have already
helped solving/mitigating that, hasn't it?

When implementing and testing that, I wasn't able to reproduce any
livelock situation (although I can't exclude that to be at least partly
due to my inexperience, especially at the time, with I/O
virtualization)... Jan, have you (after killing the 'disable
bus-mastering part' of course)?

Regards,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-EKNA1l+QEyhzJYFv4W33
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCY/UEACgkQk4XaBE3IOsQ1pQCbBluNzWKjNzntGZ4CPCFLt4mR
iC4AniTNi3OIBScljLAnzZH7ymkHRJRh
=v2EJ
-----END PGP SIGNATURE-----

--=-EKNA1l+QEyhzJYFv4W33--


--===============7679863783174260802==
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.xen.org
http://lists.xen.org/xen-devel

--===============7679863783174260802==--


From xen-devel-bounces@lists.xen.org Tue Nov 06 12:09:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 12:09:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVhxw-00064U-7f; Tue, 06 Nov 2012 12:09:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dario.faggioli@citrix.com>) id 1TVhxu-00064N-QV
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 12:09:11 +0000
Received: from [85.158.139.83:9666] by server-7.bemta-5.messagelabs.com id
	E9/A6-23096-6EDF8905; Tue, 06 Nov 2012 12:09:10 +0000
X-Env-Sender: dario.faggioli@citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1352203729!28441876!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTczNjc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11676 invoked from network); 6 Nov 2012 12:08:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 12:08:50 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344211200"; 
	d="asc'?scan'208";a="15608858"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 12:08:49 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Tue, 6 Nov 2012
	12:08:48 +0000
Message-ID: <1352203727.505.7.camel@Solace>
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 6 Nov 2012 13:08:47 +0100
In-Reply-To: <5098F22C02000078000A69E2@nat28.tlf.novell.com>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<5098F22C02000078000A69E2@nat28.tlf.novell.com>
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com, Tim Deegan <tim@xen.org>,
	xen-devel <xen-devel@lists.xen.org>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4758811756323479261=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4758811756323479261==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="=-qjCvdL3sFjS0q5TwGI2f"

--=-qjCvdL3sFjS0q5TwGI2f
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, 2012-11-06 at 10:19 +0000, Jan Beulich wrote:
> > This check is really there to stop a mad device from hosing the system
> > rather than to contain a malicious OS, and a properly out-of-control
> > device needs to be stopped or it will livelock Xen with iommu faults.
> > In a uniprocessor system, dom0 might never get the chance to fix it.
>=20
> If that's the main goal, then on the AMD side the code may not do
> what you want it to: PPR log entries, causing interrupts too, don't
> get limited/suppressed in any way, yet are obviously to some
> extent under guest control.
>=20
IIRC, PPR are dealt with in softirq context too, aren't they?

> But yes, for the purpose here limiting the fault rate in some way
> (with a slightly higher limit for Dom0 than DomU-s) would indeed
> be the better route.
>=20
BTW, yes, independently from the above and for what it counts, I agree
with this.

Regards,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-qjCvdL3sFjS0q5TwGI2f
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEUEABECAAYFAlCY/c8ACgkQk4XaBE3IOsRRxQCfZPl9HnbbA1dM660HuWLHh5FC
33gAmMDPlzzFkl53B0Q3VOnJk6roRc0=
=b/A1
-----END PGP SIGNATURE-----

--=-qjCvdL3sFjS0q5TwGI2f--


--===============4758811756323479261==
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.xen.org
http://lists.xen.org/xen-devel

--===============4758811756323479261==--


From xen-devel-bounces@lists.xen.org Tue Nov 06 12:09:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 12:09:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVhxw-00064U-7f; Tue, 06 Nov 2012 12:09:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dario.faggioli@citrix.com>) id 1TVhxu-00064N-QV
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 12:09:11 +0000
Received: from [85.158.139.83:9666] by server-7.bemta-5.messagelabs.com id
	E9/A6-23096-6EDF8905; Tue, 06 Nov 2012 12:09:10 +0000
X-Env-Sender: dario.faggioli@citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1352203729!28441876!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTczNjc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11676 invoked from network); 6 Nov 2012 12:08:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 12:08:50 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344211200"; 
	d="asc'?scan'208";a="15608858"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 12:08:49 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Tue, 6 Nov 2012
	12:08:48 +0000
Message-ID: <1352203727.505.7.camel@Solace>
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 6 Nov 2012 13:08:47 +0100
In-Reply-To: <5098F22C02000078000A69E2@nat28.tlf.novell.com>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<5098F22C02000078000A69E2@nat28.tlf.novell.com>
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com, Tim Deegan <tim@xen.org>,
	xen-devel <xen-devel@lists.xen.org>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4758811756323479261=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4758811756323479261==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="=-qjCvdL3sFjS0q5TwGI2f"

--=-qjCvdL3sFjS0q5TwGI2f
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, 2012-11-06 at 10:19 +0000, Jan Beulich wrote:
> > This check is really there to stop a mad device from hosing the system
> > rather than to contain a malicious OS, and a properly out-of-control
> > device needs to be stopped or it will livelock Xen with iommu faults.
> > In a uniprocessor system, dom0 might never get the chance to fix it.
>=20
> If that's the main goal, then on the AMD side the code may not do
> what you want it to: PPR log entries, causing interrupts too, don't
> get limited/suppressed in any way, yet are obviously to some
> extent under guest control.
>=20
IIRC, PPR are dealt with in softirq context too, aren't they?

> But yes, for the purpose here limiting the fault rate in some way
> (with a slightly higher limit for Dom0 than DomU-s) would indeed
> be the better route.
>=20
BTW, yes, independently from the above and for what it counts, I agree
with this.

Regards,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-qjCvdL3sFjS0q5TwGI2f
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEUEABECAAYFAlCY/c8ACgkQk4XaBE3IOsRRxQCfZPl9HnbbA1dM660HuWLHh5FC
33gAmMDPlzzFkl53B0Q3VOnJk6roRc0=
=b/A1
-----END PGP SIGNATURE-----

--=-qjCvdL3sFjS0q5TwGI2f--


--===============4758811756323479261==
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.xen.org
http://lists.xen.org/xen-devel

--===============4758811756323479261==--


From xen-devel-bounces@lists.xen.org Tue Nov 06 12:39:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 12:39:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TViQV-0006LZ-Og; Tue, 06 Nov 2012 12:38:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TViQU-0006LU-AA
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 12:38:42 +0000
Received: from [85.158.139.211:61927] by server-10.bemta-5.messagelabs.com id
	24/2F-09257-1D409905; Tue, 06 Nov 2012 12:38:41 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1352205520!19133384!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23623 invoked from network); 6 Nov 2012 12:38:41 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-206.messagelabs.com with SMTP;
	6 Nov 2012 12:38:41 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 06 Nov 2012 12:38:39 +0000
Message-Id: <509912DE02000078000A6A9F@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 06 Nov 2012 12:38:38 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dario Faggioli" <dario.faggioli@citrix.com>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<5098F22C02000078000A69E2@nat28.tlf.novell.com>
	<1352203727.505.7.camel@Solace>
In-Reply-To: <1352203727.505.7.camel@Solace>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com, Tim Deegan <tim@xen.org>,
	xen-devel <xen-devel@lists.xen.org>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 06.11.12 at 13:08, Dario Faggioli <dario.faggioli@citrix.com> wrote:
> On Tue, 2012-11-06 at 10:19 +0000, Jan Beulich wrote:
>> > This check is really there to stop a mad device from hosing the system
>> > rather than to contain a malicious OS, and a properly out-of-control
>> > device needs to be stopped or it will livelock Xen with iommu faults.
>> > In a uniprocessor system, dom0 might never get the chance to fix it.
>> 
>> If that's the main goal, then on the AMD side the code may not do
>> what you want it to: PPR log entries, causing interrupts too, don't
>> get limited/suppressed in any way, yet are obviously to some
>> extent under guest control.
>> 
> IIRC, PPR are dealt with in softirq context too, aren't they?

They are, but that only means Xen stays alive. Dom0 might
still not get a chance to run if there's a flood of them.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 12:39:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 12:39:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TViQV-0006LZ-Og; Tue, 06 Nov 2012 12:38:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TViQU-0006LU-AA
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 12:38:42 +0000
Received: from [85.158.139.211:61927] by server-10.bemta-5.messagelabs.com id
	24/2F-09257-1D409905; Tue, 06 Nov 2012 12:38:41 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1352205520!19133384!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23623 invoked from network); 6 Nov 2012 12:38:41 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-206.messagelabs.com with SMTP;
	6 Nov 2012 12:38:41 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 06 Nov 2012 12:38:39 +0000
Message-Id: <509912DE02000078000A6A9F@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 06 Nov 2012 12:38:38 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dario Faggioli" <dario.faggioli@citrix.com>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<5098F22C02000078000A69E2@nat28.tlf.novell.com>
	<1352203727.505.7.camel@Solace>
In-Reply-To: <1352203727.505.7.camel@Solace>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com, Tim Deegan <tim@xen.org>,
	xen-devel <xen-devel@lists.xen.org>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 06.11.12 at 13:08, Dario Faggioli <dario.faggioli@citrix.com> wrote:
> On Tue, 2012-11-06 at 10:19 +0000, Jan Beulich wrote:
>> > This check is really there to stop a mad device from hosing the system
>> > rather than to contain a malicious OS, and a properly out-of-control
>> > device needs to be stopped or it will livelock Xen with iommu faults.
>> > In a uniprocessor system, dom0 might never get the chance to fix it.
>> 
>> If that's the main goal, then on the AMD side the code may not do
>> what you want it to: PPR log entries, causing interrupts too, don't
>> get limited/suppressed in any way, yet are obviously to some
>> extent under guest control.
>> 
> IIRC, PPR are dealt with in softirq context too, aren't they?

They are, but that only means Xen stays alive. Dom0 might
still not get a chance to run if there's a flood of them.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 12:51:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 12:51:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVice-0006Vd-0X; Tue, 06 Nov 2012 12:51:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVicc-0006VY-7b
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 12:51:14 +0000
Received: from [85.158.143.99:24476] by server-1.bemta-4.messagelabs.com id
	D9/FD-27934-1C709905; Tue, 06 Nov 2012 12:51:13 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1352206272!28493991!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19686 invoked from network); 6 Nov 2012 12:51:12 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-216.messagelabs.com with SMTP;
	6 Nov 2012 12:51:12 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 06 Nov 2012 12:51:11 +0000
Message-Id: <509915CD02000078000A6ABF@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 06 Nov 2012 12:51:09 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dario Faggioli" <dario.faggioli@citrix.com>,
 "Tim Deegan" <tim@xen.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<1352203585.505.5.camel@Solace>
In-Reply-To: <1352203585.505.5.camel@Solace>
Mime-Version: 1.0
Content-Disposition: inline
Cc: wei.huang2@amd.com, Keir Fraser <keir@xen.org>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 06.11.12 at 13:06, Dario Faggioli <dario.faggioli@citrix.com> wrote:
> On Tue, 2012-11-06 at 09:44 +0000, Tim Deegan wrote:
>> > In the context of analyzing the situation described in
>> > "iommu=dom0-passthrough behavior"
>> > (http://lists.xen.org/archives/html/xen-devel/2012-11/msg00140.html)
>> > I suppressed the IOMMU setup for some device in Dom0, and
>> > was quite puzzled to find that only a single fault would occur.
>> 
>> I think it would be better to allow some small number of faults per
>> device before disabling it rather than give dom0 carte blanche.
>> 
>> This check is really there to stop a mad device from hosing the system
>> rather than to contain a malicious OS, and a properly out-of-control
>> device needs to be stopped or it will livelock Xen with iommu faults.
>> In a uniprocessor system, dom0 might never get the chance to fix it.
>> 
> Right. But moving the fault handling code to softirq should have already
> helped solving/mitigating that, hasn't it?

It helps keeping Xen alive, but doesn't for any specific domain
(including Dom0).

> When implementing and testing that, I wasn't able to reproduce any
> livelock situation (although I can't exclude that to be at least partly
> due to my inexperience, especially at the time, with I/O
> virtualization)... Jan, have you (after killing the 'disable
> bus-mastering part' of course)?

No, I haven't - you'd have to have a device that doesn't stop I/O
after a finite amount was done (or program one that way, e.g. by
handing it a cyclic list of SG descriptors or alike). Wasn't it at your
(Citrix) end that the problem was actually observed/reported?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 12:51:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 12:51:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVice-0006Vd-0X; Tue, 06 Nov 2012 12:51:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVicc-0006VY-7b
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 12:51:14 +0000
Received: from [85.158.143.99:24476] by server-1.bemta-4.messagelabs.com id
	D9/FD-27934-1C709905; Tue, 06 Nov 2012 12:51:13 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1352206272!28493991!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19686 invoked from network); 6 Nov 2012 12:51:12 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-216.messagelabs.com with SMTP;
	6 Nov 2012 12:51:12 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 06 Nov 2012 12:51:11 +0000
Message-Id: <509915CD02000078000A6ABF@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 06 Nov 2012 12:51:09 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dario Faggioli" <dario.faggioli@citrix.com>,
 "Tim Deegan" <tim@xen.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<1352203585.505.5.camel@Solace>
In-Reply-To: <1352203585.505.5.camel@Solace>
Mime-Version: 1.0
Content-Disposition: inline
Cc: wei.huang2@amd.com, Keir Fraser <keir@xen.org>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 06.11.12 at 13:06, Dario Faggioli <dario.faggioli@citrix.com> wrote:
> On Tue, 2012-11-06 at 09:44 +0000, Tim Deegan wrote:
>> > In the context of analyzing the situation described in
>> > "iommu=dom0-passthrough behavior"
>> > (http://lists.xen.org/archives/html/xen-devel/2012-11/msg00140.html)
>> > I suppressed the IOMMU setup for some device in Dom0, and
>> > was quite puzzled to find that only a single fault would occur.
>> 
>> I think it would be better to allow some small number of faults per
>> device before disabling it rather than give dom0 carte blanche.
>> 
>> This check is really there to stop a mad device from hosing the system
>> rather than to contain a malicious OS, and a properly out-of-control
>> device needs to be stopped or it will livelock Xen with iommu faults.
>> In a uniprocessor system, dom0 might never get the chance to fix it.
>> 
> Right. But moving the fault handling code to softirq should have already
> helped solving/mitigating that, hasn't it?

It helps keeping Xen alive, but doesn't for any specific domain
(including Dom0).

> When implementing and testing that, I wasn't able to reproduce any
> livelock situation (although I can't exclude that to be at least partly
> due to my inexperience, especially at the time, with I/O
> virtualization)... Jan, have you (after killing the 'disable
> bus-mastering part' of course)?

No, I haven't - you'd have to have a device that doesn't stop I/O
after a finite amount was done (or program one that way, e.g. by
handing it a cyclic list of SG descriptors or alike). Wasn't it at your
(Citrix) end that the problem was actually observed/reported?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 13:26:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 13:26:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVjA2-0006oC-10; Tue, 06 Nov 2012 13:25:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TVjA1-0006o7-2F
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 13:25:45 +0000
Received: from [85.158.137.99:11960] by server-6.bemta-3.messagelabs.com id
	8F/60-28265-7DF09905; Tue, 06 Nov 2012 13:25:43 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1352208342!12601360!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQzNTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12961 invoked from network); 6 Nov 2012 13:25:43 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 13:25:43 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344211200"; d="scan'208";a="213558230"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 13:25:41 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 6 Nov 2012 08:25:41 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TVj9w-0006QF-P1;
	Tue, 06 Nov 2012 13:25:40 +0000
Message-ID: <1352208219.12977.4.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Date: Tue, 6 Nov 2012 14:23:39 +0100
In-Reply-To: <8bec0df2-cf4b-4dcf-bbb8-121357a29d52@default>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<20121104203532.GA11377@ocelot.phlegethon.org>
	<26f55aab-7523-4681-9a61-a5e5740d43a9@default>
	<1352111399.25014.101.camel@hastur.hellion.org.uk>
	<5517445d-ed2e-4592-9a2b-98fc612f1ae8@default>
	<1352154288.7253.25.camel@hastur.hellion.org.uk>
	<8bec0df2-cf4b-4dcf-bbb8-121357a29d52@default>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Olaf Hering <olaf@aepfle.de>, "Keir \(Xen.org\)" <keir@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	George Shuklin <george.shuklin@gmail.com>,
	DarioFaggioli <raistlin@linux.it>, Jan
	Beulich <JBeulich@suse.com>, Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-05 at 22:58 +0000, Dan Magenheimer wrote:
> It's not necessary to choose the _optimal_ fit, only a probable one. 

I think this is the key point which I was missing i.e. that it doesn't
need to be a totally accurate answer. Without that piece it seemed to me
that you must already have the more knowledgeable toolstack part which
others have mentioned.

Ian.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 13:26:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 13:26:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVjA2-0006oC-10; Tue, 06 Nov 2012 13:25:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TVjA1-0006o7-2F
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 13:25:45 +0000
Received: from [85.158.137.99:11960] by server-6.bemta-3.messagelabs.com id
	8F/60-28265-7DF09905; Tue, 06 Nov 2012 13:25:43 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1352208342!12601360!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQzNTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12961 invoked from network); 6 Nov 2012 13:25:43 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 13:25:43 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344211200"; d="scan'208";a="213558230"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 13:25:41 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 6 Nov 2012 08:25:41 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TVj9w-0006QF-P1;
	Tue, 06 Nov 2012 13:25:40 +0000
Message-ID: <1352208219.12977.4.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Date: Tue, 6 Nov 2012 14:23:39 +0100
In-Reply-To: <8bec0df2-cf4b-4dcf-bbb8-121357a29d52@default>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<20121104203532.GA11377@ocelot.phlegethon.org>
	<26f55aab-7523-4681-9a61-a5e5740d43a9@default>
	<1352111399.25014.101.camel@hastur.hellion.org.uk>
	<5517445d-ed2e-4592-9a2b-98fc612f1ae8@default>
	<1352154288.7253.25.camel@hastur.hellion.org.uk>
	<8bec0df2-cf4b-4dcf-bbb8-121357a29d52@default>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Olaf Hering <olaf@aepfle.de>, "Keir \(Xen.org\)" <keir@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	George Shuklin <george.shuklin@gmail.com>,
	DarioFaggioli <raistlin@linux.it>, Jan
	Beulich <JBeulich@suse.com>, Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-05 at 22:58 +0000, Dan Magenheimer wrote:
> It's not necessary to choose the _optimal_ fit, only a probable one. 

I think this is the key point which I was missing i.e. that it doesn't
need to be a totally accurate answer. Without that piece it seemed to me
that you must already have the more knowledgeable toolstack part which
others have mentioned.

Ian.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 13:59:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 13:59:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVjgd-00070Y-O6; Tue, 06 Nov 2012 13:59:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TVjgc-00070T-8m
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 13:59:26 +0000
Received: from [85.158.143.35:6277] by server-1.bemta-4.messagelabs.com id
	67/A4-27934-DB719905; Tue, 06 Nov 2012 13:59:25 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1352210331!15973013!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13805 invoked from network); 6 Nov 2012 13:58:51 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-13.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 6 Nov 2012 13:58:51 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TVjfu-000Cfy-Qd; Tue, 06 Nov 2012 13:58:42 +0000
Date: Tue, 6 Nov 2012 13:58:42 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121106135842.GB45690@ocelot.phlegethon.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<1352203585.505.5.camel@Solace>
	<509915CD02000078000A6ABF@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509915CD02000078000A6ABF@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Keir Fraser <keir@xen.org>, Dario Faggioli <dario.faggioli@citrix.com>,
	wei.huang2@amd.com, xen-devel <xen-devel@lists.xen.org>,
	weiwang.dd@gmail.com, xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
	faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 12:51 +0000 on 06 Nov (1352206269), Jan Beulich wrote:
> >>> On 06.11.12 at 13:06, Dario Faggioli <dario.faggioli@citrix.com> wrote:
> > On Tue, 2012-11-06 at 09:44 +0000, Tim Deegan wrote:
> >> > In the context of analyzing the situation described in
> >> > "iommu=dom0-passthrough behavior"
> >> > (http://lists.xen.org/archives/html/xen-devel/2012-11/msg00140.html)
> >> > I suppressed the IOMMU setup for some device in Dom0, and
> >> > was quite puzzled to find that only a single fault would occur.
> >> 
> >> I think it would be better to allow some small number of faults per
> >> device before disabling it rather than give dom0 carte blanche.
> >> 
> >> This check is really there to stop a mad device from hosing the system
> >> rather than to contain a malicious OS, and a properly out-of-control
> >> device needs to be stopped or it will livelock Xen with iommu faults.
> >> In a uniprocessor system, dom0 might never get the chance to fix it.
> >> 
> > Right. But moving the fault handling code to softirq should have already
> > helped solving/mitigating that, hasn't it?
> 
> It helps keeping Xen alive, but doesn't for any specific domain
> (including Dom0).

Indeed.  (Intel) IOMMU interrupts are suppressed until the softirq
handler acknowledges the error, but if the softirq handler doesn't
disable the device, it will take another IOMMU interrupt immediately.
I thought the AMD side behaved eth same but clearly not -- I'll try to
take a look at that later in the week.

> > When implementing and testing that, I wasn't able to reproduce any
> > livelock situation (although I can't exclude that to be at least partly
> > due to my inexperience, especially at the time, with I/O
> > virtualization)... Jan, have you (after killing the 'disable
> > bus-mastering part' of course)?
> 
> No, I haven't - you'd have to have a device that doesn't stop I/O
> after a finite amount was done (or program one that way, e.g. by
> handing it a cyclic list of SG descriptors or alike). Wasn't it at your
> (Citrix) end that the problem was actually observed/reported?

IIRC it was someone at Intel who reported it.  I never saw it myself.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 13:59:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 13:59:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVjgd-00070Y-O6; Tue, 06 Nov 2012 13:59:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TVjgc-00070T-8m
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 13:59:26 +0000
Received: from [85.158.143.35:6277] by server-1.bemta-4.messagelabs.com id
	67/A4-27934-DB719905; Tue, 06 Nov 2012 13:59:25 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1352210331!15973013!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13805 invoked from network); 6 Nov 2012 13:58:51 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-13.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 6 Nov 2012 13:58:51 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TVjfu-000Cfy-Qd; Tue, 06 Nov 2012 13:58:42 +0000
Date: Tue, 6 Nov 2012 13:58:42 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121106135842.GB45690@ocelot.phlegethon.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<1352203585.505.5.camel@Solace>
	<509915CD02000078000A6ABF@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509915CD02000078000A6ABF@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Keir Fraser <keir@xen.org>, Dario Faggioli <dario.faggioli@citrix.com>,
	wei.huang2@amd.com, xen-devel <xen-devel@lists.xen.org>,
	weiwang.dd@gmail.com, xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
	faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 12:51 +0000 on 06 Nov (1352206269), Jan Beulich wrote:
> >>> On 06.11.12 at 13:06, Dario Faggioli <dario.faggioli@citrix.com> wrote:
> > On Tue, 2012-11-06 at 09:44 +0000, Tim Deegan wrote:
> >> > In the context of analyzing the situation described in
> >> > "iommu=dom0-passthrough behavior"
> >> > (http://lists.xen.org/archives/html/xen-devel/2012-11/msg00140.html)
> >> > I suppressed the IOMMU setup for some device in Dom0, and
> >> > was quite puzzled to find that only a single fault would occur.
> >> 
> >> I think it would be better to allow some small number of faults per
> >> device before disabling it rather than give dom0 carte blanche.
> >> 
> >> This check is really there to stop a mad device from hosing the system
> >> rather than to contain a malicious OS, and a properly out-of-control
> >> device needs to be stopped or it will livelock Xen with iommu faults.
> >> In a uniprocessor system, dom0 might never get the chance to fix it.
> >> 
> > Right. But moving the fault handling code to softirq should have already
> > helped solving/mitigating that, hasn't it?
> 
> It helps keeping Xen alive, but doesn't for any specific domain
> (including Dom0).

Indeed.  (Intel) IOMMU interrupts are suppressed until the softirq
handler acknowledges the error, but if the softirq handler doesn't
disable the device, it will take another IOMMU interrupt immediately.
I thought the AMD side behaved eth same but clearly not -- I'll try to
take a look at that later in the week.

> > When implementing and testing that, I wasn't able to reproduce any
> > livelock situation (although I can't exclude that to be at least partly
> > due to my inexperience, especially at the time, with I/O
> > virtualization)... Jan, have you (after killing the 'disable
> > bus-mastering part' of course)?
> 
> No, I haven't - you'd have to have a device that doesn't stop I/O
> after a finite amount was done (or program one that way, e.g. by
> handing it a cyclic list of SG descriptors or alike). Wasn't it at your
> (Citrix) end that the problem was actually observed/reported?

IIRC it was someone at Intel who reported it.  I never saw it myself.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 14:18:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 14:18:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVjyf-0007Fe-GD; Tue, 06 Nov 2012 14:18:05 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVjye-0007FZ-7M
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 14:18:04 +0000
Received: from [85.158.143.99:38613] by server-1.bemta-4.messagelabs.com id
	04/54-27934-B1C19905; Tue, 06 Nov 2012 14:18:03 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352211477!28271308!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3992 invoked from network); 6 Nov 2012 14:17:57 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-216.messagelabs.com with SMTP;
	6 Nov 2012 14:17:57 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 06 Nov 2012 14:17:57 +0000
Message-Id: <50992A2302000078000A6B78@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 06 Nov 2012 14:17:55 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<1352203585.505.5.camel@Solace>
	<509915CD02000078000A6ABF@nat28.tlf.novell.com>
	<20121106135842.GB45690@ocelot.phlegethon.org>
In-Reply-To: <20121106135842.GB45690@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Dario Faggioli <dario.faggioli@citrix.com>,
	wei.huang2@amd.com, xen-devel <xen-devel@lists.xen.org>,
	weiwang.dd@gmail.com, xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 06.11.12 at 14:58, Tim Deegan <tim@xen.org> wrote:
> At 12:51 +0000 on 06 Nov (1352206269), Jan Beulich wrote:
>> >>> On 06.11.12 at 13:06, Dario Faggioli <dario.faggioli@citrix.com> wrote:
>> > On Tue, 2012-11-06 at 09:44 +0000, Tim Deegan wrote:
>> >> > In the context of analyzing the situation described in
>> >> > "iommu=dom0-passthrough behavior"
>> >> > (http://lists.xen.org/archives/html/xen-devel/2012-11/msg00140.html)
>> >> > I suppressed the IOMMU setup for some device in Dom0, and
>> >> > was quite puzzled to find that only a single fault would occur.
>> >> 
>> >> I think it would be better to allow some small number of faults per
>> >> device before disabling it rather than give dom0 carte blanche.
>> >> 
>> >> This check is really there to stop a mad device from hosing the system
>> >> rather than to contain a malicious OS, and a properly out-of-control
>> >> device needs to be stopped or it will livelock Xen with iommu faults.
>> >> In a uniprocessor system, dom0 might never get the chance to fix it.
>> >> 
>> > Right. But moving the fault handling code to softirq should have already
>> > helped solving/mitigating that, hasn't it?
>> 
>> It helps keeping Xen alive, but doesn't for any specific domain
>> (including Dom0).
> 
> Indeed.  (Intel) IOMMU interrupts are suppressed until the softirq
> handler acknowledges the error, but if the softirq handler doesn't
> disable the device, it will take another IOMMU interrupt immediately.
> I thought the AMD side behaved eth same but clearly not -- I'll try to
> take a look at that later in the week.

I don't think AMD's behaves much different, it's just that for the
PPR case nothing is being done in that regard (and it's unclear
whether or under what circumstances a high rate of these could
occur).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 14:18:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 14:18:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVjyf-0007Fe-GD; Tue, 06 Nov 2012 14:18:05 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TVjye-0007FZ-7M
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 14:18:04 +0000
Received: from [85.158.143.99:38613] by server-1.bemta-4.messagelabs.com id
	04/54-27934-B1C19905; Tue, 06 Nov 2012 14:18:03 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352211477!28271308!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3992 invoked from network); 6 Nov 2012 14:17:57 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-216.messagelabs.com with SMTP;
	6 Nov 2012 14:17:57 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 06 Nov 2012 14:17:57 +0000
Message-Id: <50992A2302000078000A6B78@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 06 Nov 2012 14:17:55 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<1352203585.505.5.camel@Solace>
	<509915CD02000078000A6ABF@nat28.tlf.novell.com>
	<20121106135842.GB45690@ocelot.phlegethon.org>
In-Reply-To: <20121106135842.GB45690@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Dario Faggioli <dario.faggioli@citrix.com>,
	wei.huang2@amd.com, xen-devel <xen-devel@lists.xen.org>,
	weiwang.dd@gmail.com, xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 06.11.12 at 14:58, Tim Deegan <tim@xen.org> wrote:
> At 12:51 +0000 on 06 Nov (1352206269), Jan Beulich wrote:
>> >>> On 06.11.12 at 13:06, Dario Faggioli <dario.faggioli@citrix.com> wrote:
>> > On Tue, 2012-11-06 at 09:44 +0000, Tim Deegan wrote:
>> >> > In the context of analyzing the situation described in
>> >> > "iommu=dom0-passthrough behavior"
>> >> > (http://lists.xen.org/archives/html/xen-devel/2012-11/msg00140.html)
>> >> > I suppressed the IOMMU setup for some device in Dom0, and
>> >> > was quite puzzled to find that only a single fault would occur.
>> >> 
>> >> I think it would be better to allow some small number of faults per
>> >> device before disabling it rather than give dom0 carte blanche.
>> >> 
>> >> This check is really there to stop a mad device from hosing the system
>> >> rather than to contain a malicious OS, and a properly out-of-control
>> >> device needs to be stopped or it will livelock Xen with iommu faults.
>> >> In a uniprocessor system, dom0 might never get the chance to fix it.
>> >> 
>> > Right. But moving the fault handling code to softirq should have already
>> > helped solving/mitigating that, hasn't it?
>> 
>> It helps keeping Xen alive, but doesn't for any specific domain
>> (including Dom0).
> 
> Indeed.  (Intel) IOMMU interrupts are suppressed until the softirq
> handler acknowledges the error, but if the softirq handler doesn't
> disable the device, it will take another IOMMU interrupt immediately.
> I thought the AMD side behaved eth same but clearly not -- I'll try to
> take a look at that later in the week.

I don't think AMD's behaves much different, it's just that for the
PPR case nothing is being done in that regard (and it's unclear
whether or under what circumstances a high rate of these could
occur).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 14:19:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 14:19:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVjzN-0007IC-Tg; Tue, 06 Nov 2012 14:18:49 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dario.faggioli@citrix.com>) id 1TVjzL-0007Hy-W9
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 14:18:48 +0000
Received: from [193.109.254.147:29396] by server-15.bemta-14.messagelabs.com
	id DE/B0-12105-74C19905; Tue, 06 Nov 2012 14:18:47 +0000
X-Env-Sender: dario.faggioli@citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1352211422!9806039!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTczNjc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14440 invoked from network); 6 Nov 2012 14:17:03 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 14:17:03 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344211200"; 
	d="asc'?scan'208";a="15613165"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 14:17:02 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Tue, 6 Nov 2012
	14:17:01 +0000
Message-ID: <1352211410.2155.7.camel@Solace>
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Tue, 6 Nov 2012 15:16:50 +0100
In-Reply-To: <20121106135842.GB45690@ocelot.phlegethon.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<1352203585.505.5.camel@Solace>
	<509915CD02000078000A6ABF@nat28.tlf.novell.com>
	<20121106135842.GB45690@ocelot.phlegethon.org>
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"wei.huang2@amd.com" <wei.huang2@amd.com>,
	xen-devel <xen-devel@lists.xen.org>, Jan Beulich <JBeulich@suse.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	"xiantao.zhang@intel.com" <xiantao.zhang@intel.com>
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5543024278306713870=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5543024278306713870==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="=-ToUauuo/eo9Qf+ripbpI"

--=-ToUauuo/eo9Qf+ripbpI
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, 2012-11-06 at 13:58 +0000, Tim Deegan wrote:
> > It helps keeping Xen alive, but doesn't for any specific domain
> > (including Dom0).
>=20
> Indeed.  (Intel) IOMMU interrupts are suppressed until the softirq
> handler acknowledges the error, but if the softirq handler doesn't
> disable the device, it will take another IOMMU interrupt immediately.
>
Right. I wasn't considering the possibility of this 'back-to-back'
variant of the thing.

> I thought the AMD side behaved eth same but clearly not -- I'll try to
> take a look at that later in the week.
>=20
I think it does, or at least, I'm quite sure when I moved the fault
handling code in softiq context, I did it so that behavior was
consistent wrt both Intel and AMD (by explicitly silencing interrupts
until within the tasklet), at least for faults.

PPR came later and I moved them within the softirq as well after asking
AMD people, without having the possibility to test that myself.

So, to recap, feel free to check. Faults should behave as you're
describing, PPR I'm not sure. :-)

Regards,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-ToUauuo/eo9Qf+ripbpI
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCZG9IACgkQk4XaBE3IOsTBagCgg35YIjm6u6e1OAFS6Q7GYB2e
3NoAnA66EpIC0C7UeFH/YD5RJsx2Ske6
=9kp6
-----END PGP SIGNATURE-----

--=-ToUauuo/eo9Qf+ripbpI--


--===============5543024278306713870==
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.xen.org
http://lists.xen.org/xen-devel

--===============5543024278306713870==--


From xen-devel-bounces@lists.xen.org Tue Nov 06 14:19:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 14:19:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVjzN-0007IC-Tg; Tue, 06 Nov 2012 14:18:49 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dario.faggioli@citrix.com>) id 1TVjzL-0007Hy-W9
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 14:18:48 +0000
Received: from [193.109.254.147:29396] by server-15.bemta-14.messagelabs.com
	id DE/B0-12105-74C19905; Tue, 06 Nov 2012 14:18:47 +0000
X-Env-Sender: dario.faggioli@citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1352211422!9806039!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTczNjc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14440 invoked from network); 6 Nov 2012 14:17:03 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 14:17:03 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344211200"; 
	d="asc'?scan'208";a="15613165"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 14:17:02 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Tue, 6 Nov 2012
	14:17:01 +0000
Message-ID: <1352211410.2155.7.camel@Solace>
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Tue, 6 Nov 2012 15:16:50 +0100
In-Reply-To: <20121106135842.GB45690@ocelot.phlegethon.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<1352203585.505.5.camel@Solace>
	<509915CD02000078000A6ABF@nat28.tlf.novell.com>
	<20121106135842.GB45690@ocelot.phlegethon.org>
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"wei.huang2@amd.com" <wei.huang2@amd.com>,
	xen-devel <xen-devel@lists.xen.org>, Jan Beulich <JBeulich@suse.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	"xiantao.zhang@intel.com" <xiantao.zhang@intel.com>
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5543024278306713870=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5543024278306713870==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="=-ToUauuo/eo9Qf+ripbpI"

--=-ToUauuo/eo9Qf+ripbpI
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, 2012-11-06 at 13:58 +0000, Tim Deegan wrote:
> > It helps keeping Xen alive, but doesn't for any specific domain
> > (including Dom0).
>=20
> Indeed.  (Intel) IOMMU interrupts are suppressed until the softirq
> handler acknowledges the error, but if the softirq handler doesn't
> disable the device, it will take another IOMMU interrupt immediately.
>
Right. I wasn't considering the possibility of this 'back-to-back'
variant of the thing.

> I thought the AMD side behaved eth same but clearly not -- I'll try to
> take a look at that later in the week.
>=20
I think it does, or at least, I'm quite sure when I moved the fault
handling code in softiq context, I did it so that behavior was
consistent wrt both Intel and AMD (by explicitly silencing interrupts
until within the tasklet), at least for faults.

PPR came later and I moved them within the softirq as well after asking
AMD people, without having the possibility to test that myself.

So, to recap, feel free to check. Faults should behave as you're
describing, PPR I'm not sure. :-)

Regards,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-ToUauuo/eo9Qf+ripbpI
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCZG9IACgkQk4XaBE3IOsTBagCgg35YIjm6u6e1OAFS6Q7GYB2e
3NoAnA66EpIC0C7UeFH/YD5RJsx2Ske6
=9kp6
-----END PGP SIGNATURE-----

--=-ToUauuo/eo9Qf+ripbpI--


--===============5543024278306713870==
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.xen.org
http://lists.xen.org/xen-devel

--===============5543024278306713870==--


From xen-devel-bounces@lists.xen.org Tue Nov 06 14:21:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 14:21:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVk1r-0007TE-P1; Tue, 06 Nov 2012 14:21:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lukas@laukamp.me>) id 1TVk1q-0007Sy-Dc
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 14:21:22 +0000
Received: from [85.158.143.35:51321] by server-3.bemta-4.messagelabs.com id
	B1/59-06841-1EC19905; Tue, 06 Nov 2012 14:21:21 +0000
X-Env-Sender: lukas@laukamp.me
X-Msg-Ref: server-3.tower-21.messagelabs.com!1352211570!14129751!1
X-Originating-IP: [5.9.218.245]
X-SpamReason: No, hits=0.2 required=7.0 tests=RCVD_ILLEGAL_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29779 invoked from network); 6 Nov 2012 14:19:30 -0000
Received: from mailer0.lippux.de (HELO mailer0.lippux.de) (5.9.218.245)
	by server-3.tower-21.messagelabs.com with SMTP;
	6 Nov 2012 14:19:30 -0000
Received: from localhost (localhost [127.0.0.1])
	by mailer0.lippux.de (Postfix) with ESMTP id 96EE62C205;
	Tue,  6 Nov 2012 15:19:28 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at mailer1.lippux.de
Received: from mailer0.lippux.de ([127.0.0.1])
	by localhost (mailer0.lippux.de [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 3bfJt3HgIMvA; Tue,  6 Nov 2012 15:19:28 +0100 (CET)
Received: from ashlynn.lippux.de (ashlynn.lippux.de [5.9.218.242])
	by mailer0.lippux.de (Postfix) with ESMTPSA id 587D72C1EF;
	Tue,  6 Nov 2012 15:19:28 +0100 (CET)
Message-ID: <50991C68.4070103@laukamp.me>
Date: Tue, 06 Nov 2012 15:19:20 +0100
From: Lukas Laukamp <lukas@laukamp.me>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-users@lists.xen.org" <xen-users@lists.xen.org>
Cc: xen-devel <xen-devel@lists.xensource.com>
Subject: [Xen-devel] [User Problem/Possible Bug] Possible PyGrub Bug
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello all,

I compiled latest Xen 4.2 stable with deb target on Debian Squeeze. Now 
PyGrub seems to be damaged. It fails with following issue:

Traceback (most recent call last):
   File "/usr/lib/xen/bin/pygrub", line 20, in <module>
     import xen.lowlevel.xc
ImportError: No module named xen.lowlevel.xc

So I don't know if this is a bug or a normal issue. I sent this mail to 
the user and devel list. How could this problem be fixed or does I need 
to wait for a patch?

Best Regards

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 14:21:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 14:21:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVk1r-0007TE-P1; Tue, 06 Nov 2012 14:21:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lukas@laukamp.me>) id 1TVk1q-0007Sy-Dc
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 14:21:22 +0000
Received: from [85.158.143.35:51321] by server-3.bemta-4.messagelabs.com id
	B1/59-06841-1EC19905; Tue, 06 Nov 2012 14:21:21 +0000
X-Env-Sender: lukas@laukamp.me
X-Msg-Ref: server-3.tower-21.messagelabs.com!1352211570!14129751!1
X-Originating-IP: [5.9.218.245]
X-SpamReason: No, hits=0.2 required=7.0 tests=RCVD_ILLEGAL_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29779 invoked from network); 6 Nov 2012 14:19:30 -0000
Received: from mailer0.lippux.de (HELO mailer0.lippux.de) (5.9.218.245)
	by server-3.tower-21.messagelabs.com with SMTP;
	6 Nov 2012 14:19:30 -0000
Received: from localhost (localhost [127.0.0.1])
	by mailer0.lippux.de (Postfix) with ESMTP id 96EE62C205;
	Tue,  6 Nov 2012 15:19:28 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at mailer1.lippux.de
Received: from mailer0.lippux.de ([127.0.0.1])
	by localhost (mailer0.lippux.de [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 3bfJt3HgIMvA; Tue,  6 Nov 2012 15:19:28 +0100 (CET)
Received: from ashlynn.lippux.de (ashlynn.lippux.de [5.9.218.242])
	by mailer0.lippux.de (Postfix) with ESMTPSA id 587D72C1EF;
	Tue,  6 Nov 2012 15:19:28 +0100 (CET)
Message-ID: <50991C68.4070103@laukamp.me>
Date: Tue, 06 Nov 2012 15:19:20 +0100
From: Lukas Laukamp <lukas@laukamp.me>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-users@lists.xen.org" <xen-users@lists.xen.org>
Cc: xen-devel <xen-devel@lists.xensource.com>
Subject: [Xen-devel] [User Problem/Possible Bug] Possible PyGrub Bug
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello all,

I compiled latest Xen 4.2 stable with deb target on Debian Squeeze. Now 
PyGrub seems to be damaged. It fails with following issue:

Traceback (most recent call last):
   File "/usr/lib/xen/bin/pygrub", line 20, in <module>
     import xen.lowlevel.xc
ImportError: No module named xen.lowlevel.xc

So I don't know if this is a bug or a normal issue. I sent this mail to 
the user and devel list. How could this problem be fixed or does I need 
to wait for a patch?

Best Regards

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 14:24:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 14:24:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVk4u-0007eO-CK; Tue, 06 Nov 2012 14:24:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dario.faggioli@citrix.com>) id 1TVk4s-0007eA-Ux
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 14:24:31 +0000
Received: from [85.158.139.211:19669] by server-11.bemta-5.messagelabs.com id
	CB/58-03409-E9D19905; Tue, 06 Nov 2012 14:24:30 +0000
X-Env-Sender: dario.faggioli@citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1352211869!19080535!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTczNjc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26954 invoked from network); 6 Nov 2012 14:24:29 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 14:24:29 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344211200"; 
	d="asc'?scan'208";a="15613540"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 14:24:29 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Tue, 6 Nov 2012
	14:24:28 +0000
Message-ID: <1352211862.2155.13.camel@Solace>
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 6 Nov 2012 15:24:22 +0100
In-Reply-To: <509915CD02000078000A6ABF@nat28.tlf.novell.com>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<1352203585.505.5.camel@Solace>
	<509915CD02000078000A6ABF@nat28.tlf.novell.com>
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com, Tim Deegan <tim@xen.org>,
	xen-devel <xen-devel@lists.xen.org>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6881749480603285661=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6881749480603285661==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="=-GrSN0qQMMqtJRlrXr+kS"

--=-GrSN0qQMMqtJRlrXr+kS
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, 2012-11-06 at 12:51 +0000, Jan Beulich wrote:
> > Right. But moving the fault handling code to softirq should have alread=
y
> > helped solving/mitigating that, hasn't it?
>=20
> It helps keeping Xen alive, but doesn't for any specific domain
> (including Dom0).
>=20
Ok. Yes, now I remember... That was the main purpose of that work.
Thanks and sorry. :-P

> > When implementing and testing that, I wasn't able to reproduce any
> > livelock situation (although I can't exclude that to be at least partly
> > due to my inexperience, especially at the time, with I/O
> > virtualization)... Jan, have you (after killing the 'disable
> > bus-mastering part' of course)?
>=20
> No, I haven't - you'd have to have a device that doesn't stop I/O
> after a finite amount was done (or program one that way, e.g. by
> handing it a cyclic list of SG descriptors or alike). Wasn't it at your
> (Citrix) end that the problem was actually observed/reported?
>=20
Yes but, as Tim said, I was never able to get in touch with the original
faulting behavior/piece of hardware. Trying to simulate that as you're
suggesting is basically what I did, but, at that time, I was using a
passed-to-a-guest device, and wasn't bypassing (for anyone) the
~BUS_MASTERING thing... That's why I asked whether you observed a
different behaviour.

Anyway, I see that we're talking about different issues and understand
(now) what you're trying to solve and why that is needed, so, again,
sorry for dragging the discussion a bit out of scope. :-)

Thanks and Regards,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-GrSN0qQMMqtJRlrXr+kS
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCZHZYACgkQk4XaBE3IOsQBUgCfUYT23GPWRULGUGoRsxMbuMNW
OGIAn2GSo5gEpmbvUAyGHa/ffMKC+2jB
=vMqn
-----END PGP SIGNATURE-----

--=-GrSN0qQMMqtJRlrXr+kS--


--===============6881749480603285661==
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.xen.org
http://lists.xen.org/xen-devel

--===============6881749480603285661==--


From xen-devel-bounces@lists.xen.org Tue Nov 06 14:24:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 14:24:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVk4u-0007eO-CK; Tue, 06 Nov 2012 14:24:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dario.faggioli@citrix.com>) id 1TVk4s-0007eA-Ux
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 14:24:31 +0000
Received: from [85.158.139.211:19669] by server-11.bemta-5.messagelabs.com id
	CB/58-03409-E9D19905; Tue, 06 Nov 2012 14:24:30 +0000
X-Env-Sender: dario.faggioli@citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1352211869!19080535!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTczNjc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26954 invoked from network); 6 Nov 2012 14:24:29 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 14:24:29 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344211200"; 
	d="asc'?scan'208";a="15613540"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 14:24:29 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Tue, 6 Nov 2012
	14:24:28 +0000
Message-ID: <1352211862.2155.13.camel@Solace>
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 6 Nov 2012 15:24:22 +0100
In-Reply-To: <509915CD02000078000A6ABF@nat28.tlf.novell.com>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<1352203585.505.5.camel@Solace>
	<509915CD02000078000A6ABF@nat28.tlf.novell.com>
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com, Tim Deegan <tim@xen.org>,
	xen-devel <xen-devel@lists.xen.org>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6881749480603285661=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6881749480603285661==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="=-GrSN0qQMMqtJRlrXr+kS"

--=-GrSN0qQMMqtJRlrXr+kS
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, 2012-11-06 at 12:51 +0000, Jan Beulich wrote:
> > Right. But moving the fault handling code to softirq should have alread=
y
> > helped solving/mitigating that, hasn't it?
>=20
> It helps keeping Xen alive, but doesn't for any specific domain
> (including Dom0).
>=20
Ok. Yes, now I remember... That was the main purpose of that work.
Thanks and sorry. :-P

> > When implementing and testing that, I wasn't able to reproduce any
> > livelock situation (although I can't exclude that to be at least partly
> > due to my inexperience, especially at the time, with I/O
> > virtualization)... Jan, have you (after killing the 'disable
> > bus-mastering part' of course)?
>=20
> No, I haven't - you'd have to have a device that doesn't stop I/O
> after a finite amount was done (or program one that way, e.g. by
> handing it a cyclic list of SG descriptors or alike). Wasn't it at your
> (Citrix) end that the problem was actually observed/reported?
>=20
Yes but, as Tim said, I was never able to get in touch with the original
faulting behavior/piece of hardware. Trying to simulate that as you're
suggesting is basically what I did, but, at that time, I was using a
passed-to-a-guest device, and wasn't bypassing (for anyone) the
~BUS_MASTERING thing... That's why I asked whether you observed a
different behaviour.

Anyway, I see that we're talking about different issues and understand
(now) what you're trying to solve and why that is needed, so, again,
sorry for dragging the discussion a bit out of scope. :-)

Thanks and Regards,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-GrSN0qQMMqtJRlrXr+kS
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCZHZYACgkQk4XaBE3IOsQBUgCfUYT23GPWRULGUGoRsxMbuMNW
OGIAn2GSo5gEpmbvUAyGHa/ffMKC+2jB
=vMqn
-----END PGP SIGNATURE-----

--=-GrSN0qQMMqtJRlrXr+kS--


--===============6881749480603285661==
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.xen.org
http://lists.xen.org/xen-devel

--===============6881749480603285661==--


From xen-devel-bounces@lists.xen.org Tue Nov 06 14:30:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 14:30:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVkA0-0007pd-4V; Tue, 06 Nov 2012 14:29:48 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dario.faggioli@citrix.com>) id 1TVk9y-0007pY-Hc
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 14:29:46 +0000
Received: from [85.158.139.211:56003] by server-9.bemta-5.messagelabs.com id
	D5/E9-29295-9DE19905; Tue, 06 Nov 2012 14:29:45 +0000
X-Env-Sender: dario.faggioli@citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1352212162!19077991!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTczNjc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17499 invoked from network); 6 Nov 2012 14:29:23 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 14:29:23 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344211200"; 
	d="asc'?scan'208";a="15613725"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 14:29:22 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Tue, 6 Nov 2012
	14:29:22 +0000
Message-ID: <1352212160.2155.18.camel@Solace>
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 6 Nov 2012 15:29:20 +0100
In-Reply-To: <50992A2302000078000A6B78@nat28.tlf.novell.com>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<1352203585.505.5.camel@Solace>
	<509915CD02000078000A6ABF@nat28.tlf.novell.com>
	<20121106135842.GB45690@ocelot.phlegethon.org>
	<50992A2302000078000A6B78@nat28.tlf.novell.com>
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir
	\(Xen.org\)" <keir@xen.org>, "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"Tim \(Xen.org\)" <tim@xen.org>, xen-devel <xen-devel@lists.xen.org>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	"xiantao.zhang@intel.com" <xiantao.zhang@intel.com>
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0864760982664723963=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0864760982664723963==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="=-kJcfQeVYWtlOdCqMcYmN"

--=-kJcfQeVYWtlOdCqMcYmN
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, 2012-11-06 at 14:17 +0000, Jan Beulich wrote:
> > Indeed.  (Intel) IOMMU interrupts are suppressed until the softirq
> > handler acknowledges the error, but if the softirq handler doesn't
> > disable the device, it will take another IOMMU interrupt immediately.
> > I thought the AMD side behaved eth same but clearly not -- I'll try to
> > take a look at that later in the week.
>=20
> I don't think AMD's behaves much different, it's just that for the
> PPR case nothing is being done in that regard (and it's unclear
> whether or under what circumstances a high rate of these could
> occur).
>=20
Indeed. I just double checked the code and yes, both faults and PPRs are
handled that way, and new interrupts are disabled until the tasklet
handles the request and re-enables them.

The difference, as Jan is saying, is there is no PPR equivalent of
disabling bus mastering that can ensure livelock safeness when it comes
to them.

Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-kJcfQeVYWtlOdCqMcYmN
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCZHsAACgkQk4XaBE3IOsQ5PwCfZbNoOfbAeFrRQKS9Z5c6xZe5
WUgAnRkSP0OfFDQZMpo7tfRoJ5KBJjBE
=GwTj
-----END PGP SIGNATURE-----

--=-kJcfQeVYWtlOdCqMcYmN--


--===============0864760982664723963==
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.xen.org
http://lists.xen.org/xen-devel

--===============0864760982664723963==--


From xen-devel-bounces@lists.xen.org Tue Nov 06 14:30:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 14:30:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVkA0-0007pd-4V; Tue, 06 Nov 2012 14:29:48 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dario.faggioli@citrix.com>) id 1TVk9y-0007pY-Hc
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 14:29:46 +0000
Received: from [85.158.139.211:56003] by server-9.bemta-5.messagelabs.com id
	D5/E9-29295-9DE19905; Tue, 06 Nov 2012 14:29:45 +0000
X-Env-Sender: dario.faggioli@citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1352212162!19077991!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTczNjc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17499 invoked from network); 6 Nov 2012 14:29:23 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 14:29:23 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344211200"; 
	d="asc'?scan'208";a="15613725"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 14:29:22 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Tue, 6 Nov 2012
	14:29:22 +0000
Message-ID: <1352212160.2155.18.camel@Solace>
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 6 Nov 2012 15:29:20 +0100
In-Reply-To: <50992A2302000078000A6B78@nat28.tlf.novell.com>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<1352203585.505.5.camel@Solace>
	<509915CD02000078000A6ABF@nat28.tlf.novell.com>
	<20121106135842.GB45690@ocelot.phlegethon.org>
	<50992A2302000078000A6B78@nat28.tlf.novell.com>
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir
	\(Xen.org\)" <keir@xen.org>, "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"Tim \(Xen.org\)" <tim@xen.org>, xen-devel <xen-devel@lists.xen.org>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	"xiantao.zhang@intel.com" <xiantao.zhang@intel.com>
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0864760982664723963=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0864760982664723963==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="=-kJcfQeVYWtlOdCqMcYmN"

--=-kJcfQeVYWtlOdCqMcYmN
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, 2012-11-06 at 14:17 +0000, Jan Beulich wrote:
> > Indeed.  (Intel) IOMMU interrupts are suppressed until the softirq
> > handler acknowledges the error, but if the softirq handler doesn't
> > disable the device, it will take another IOMMU interrupt immediately.
> > I thought the AMD side behaved eth same but clearly not -- I'll try to
> > take a look at that later in the week.
>=20
> I don't think AMD's behaves much different, it's just that for the
> PPR case nothing is being done in that regard (and it's unclear
> whether or under what circumstances a high rate of these could
> occur).
>=20
Indeed. I just double checked the code and yes, both faults and PPRs are
handled that way, and new interrupts are disabled until the tasklet
handles the request and re-enables them.

The difference, as Jan is saying, is there is no PPR equivalent of
disabling bus mastering that can ensure livelock safeness when it comes
to them.

Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-kJcfQeVYWtlOdCqMcYmN
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCZHsAACgkQk4XaBE3IOsQ5PwCfZbNoOfbAeFrRQKS9Z5c6xZe5
WUgAnRkSP0OfFDQZMpo7tfRoJ5KBJjBE
=GwTj
-----END PGP SIGNATURE-----

--=-kJcfQeVYWtlOdCqMcYmN--


--===============0864760982664723963==
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.xen.org
http://lists.xen.org/xen-devel

--===============0864760982664723963==--


From xen-devel-bounces@lists.xen.org Tue Nov 06 14:57:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 14:57:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVkam-00087R-PN; Tue, 06 Nov 2012 14:57:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TVkal-00087M-FZ
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 14:57:27 +0000
Received: from [85.158.139.83:32342] by server-10.bemta-5.messagelabs.com id
	C0/05-09257-65529905; Tue, 06 Nov 2012 14:57:26 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352213844!28325257!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODE2NzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22339 invoked from network); 6 Nov 2012 14:57:25 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 14:57:25 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344211200"; d="scan'208";a="43617205"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	06 Nov 2012 14:57:24 +0000
Received: from kaball.uk.xensource.com (10.80.2.59) by
	FTLPEX01CL03.citrite.net (10.13.107.80) with Microsoft SMTP Server id
	14.2.318.1; Tue, 6 Nov 2012 09:57:23 -0500
Date: Tue, 6 Nov 2012 14:56:40 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: "Liu, Jinsong" <jinsong.liu@intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233537B147@SHSMSX101.ccr.corp.intel.com>
Message-ID: <alpine.DEB.2.02.1211061455150.2689@kaball.uk.xensource.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<5089676602000078000A4928@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC82923353723C7@SHSMSX101.ccr.corp.intel.com>
	<508A89CB020000780008E6ED@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
	<alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537B147@SHSMSX101.ccr.corp.intel.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
X-Originating-IP: [10.80.2.59]
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad@kernel.org>, Jan Beulich <jbeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 6 Nov 2012, Liu, Jinsong wrote:
> Liu, Jinsong wrote:
> > Stefano Stabellini wrote:
> >>>> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> >>>> index 0e86370..a2af622 100644
> >>>> --- a/drivers/xen/Makefile
> >>>> +++ b/drivers/xen/Makefile
> >>>> @@ -29,6 +29,7 @@ obj-$(CONFIG_XEN_MCE_LOG)           += mcelog.o
> >>>>  obj-$(CONFIG_XEN_PCIDEV_BACKEND)     += xen-pciback/
> >>>>  obj-$(CONFIG_XEN_PRIVCMD)            += xen-privcmd.o
> >>>>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)     += xen-acpi-processor.o
> >>>> +obj-$(CONFIG_XEN_DOM0)                       += xen_acpi_pad.o
> >>>>  xen-evtchn-y                         := evtchn.o
> >>>>  xen-gntdev-y                         := gntdev.o
> >>>>  xen-gntalloc-y                               := gntalloc.o
> >> 
> >> it should really depend on ACPI and maybe also X86, otherwise it is
> >> going to break the ARM build 
> >> 
> >> 
> > 
> > Hmm, XEN_DOM0 has already depended on ACPI and X86_LOCAL_APIC (which
> > depends on X86_64). 
> > 
> 
> Ah, you and Konrad are right. I ignore XEN_DOM0 varies under different arch.
> (But seems it not depends on X86 since it's logically an acpi stuff?).
 
If it is generic ACPI code, than it can depend only on ACPI.
If it is ACPI code that contains X86 specific info, than it needs to
depend on X86 too.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 14:57:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 14:57:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVkam-00087R-PN; Tue, 06 Nov 2012 14:57:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TVkal-00087M-FZ
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 14:57:27 +0000
Received: from [85.158.139.83:32342] by server-10.bemta-5.messagelabs.com id
	C0/05-09257-65529905; Tue, 06 Nov 2012 14:57:26 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352213844!28325257!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODE2NzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22339 invoked from network); 6 Nov 2012 14:57:25 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 14:57:25 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344211200"; d="scan'208";a="43617205"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	06 Nov 2012 14:57:24 +0000
Received: from kaball.uk.xensource.com (10.80.2.59) by
	FTLPEX01CL03.citrite.net (10.13.107.80) with Microsoft SMTP Server id
	14.2.318.1; Tue, 6 Nov 2012 09:57:23 -0500
Date: Tue, 6 Nov 2012 14:56:40 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: "Liu, Jinsong" <jinsong.liu@intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233537B147@SHSMSX101.ccr.corp.intel.com>
Message-ID: <alpine.DEB.2.02.1211061455150.2689@kaball.uk.xensource.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<5089676602000078000A4928@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC82923353723C7@SHSMSX101.ccr.corp.intel.com>
	<508A89CB020000780008E6ED@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
	<alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537B147@SHSMSX101.ccr.corp.intel.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
X-Originating-IP: [10.80.2.59]
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad@kernel.org>, Jan Beulich <jbeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 6 Nov 2012, Liu, Jinsong wrote:
> Liu, Jinsong wrote:
> > Stefano Stabellini wrote:
> >>>> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> >>>> index 0e86370..a2af622 100644
> >>>> --- a/drivers/xen/Makefile
> >>>> +++ b/drivers/xen/Makefile
> >>>> @@ -29,6 +29,7 @@ obj-$(CONFIG_XEN_MCE_LOG)           += mcelog.o
> >>>>  obj-$(CONFIG_XEN_PCIDEV_BACKEND)     += xen-pciback/
> >>>>  obj-$(CONFIG_XEN_PRIVCMD)            += xen-privcmd.o
> >>>>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)     += xen-acpi-processor.o
> >>>> +obj-$(CONFIG_XEN_DOM0)                       += xen_acpi_pad.o
> >>>>  xen-evtchn-y                         := evtchn.o
> >>>>  xen-gntdev-y                         := gntdev.o
> >>>>  xen-gntalloc-y                               := gntalloc.o
> >> 
> >> it should really depend on ACPI and maybe also X86, otherwise it is
> >> going to break the ARM build 
> >> 
> >> 
> > 
> > Hmm, XEN_DOM0 has already depended on ACPI and X86_LOCAL_APIC (which
> > depends on X86_64). 
> > 
> 
> Ah, you and Konrad are right. I ignore XEN_DOM0 varies under different arch.
> (But seems it not depends on X86 since it's logically an acpi stuff?).
 
If it is generic ACPI code, than it can depend only on ACPI.
If it is ACPI code that contains X86 specific info, than it needs to
depend on X86 too.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 14:58:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 14:58:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVkba-0008Ab-Qd; Tue, 06 Nov 2012 14:58:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TVkbZ-0008AP-2e
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 14:58:17 +0000
Received: from [193.109.254.147:40442] by server-5.bemta-14.messagelabs.com id
	C5/74-10257-88529905; Tue, 06 Nov 2012 14:58:16 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1352213885!8656683!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODE2NzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18083 invoked from network); 6 Nov 2012 14:58:06 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 14:58:06 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344211200"; d="scan'208";a="43617379"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 14:58:04 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 6 Nov 2012 09:58:04 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TVkbM-0007py-2R;
	Tue, 06 Nov 2012 14:58:04 +0000
Message-ID: <1352213764.12977.8.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Lukas Laukamp <lukas@laukamp.me>
Date: Tue, 6 Nov 2012 15:56:04 +0100
In-Reply-To: <50991C68.4070103@laukamp.me>
References: <50991C68.4070103@laukamp.me>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-users@lists.xen.org" <xen-users@lists.xen.org>,
	xen-devel <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [User Problem/Possible Bug] Possible PyGrub Bug
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-06 at 14:19 +0000, Lukas Laukamp wrote:
> Hello all,
> 
> I compiled latest Xen 4.2 stable with deb target on Debian Squeeze. Now 
> PyGrub seems to be damaged. It fails with following issue:
> 
> Traceback (most recent call last):
>    File "/usr/lib/xen/bin/pygrub", line 20, in <module>
>      import xen.lowlevel.xc
> ImportError: No module named xen.lowlevel.xc
> 
> So I don't know if this is a bug or a normal issue. I sent this mail to 
> the user and devel list.

In general please don't cross post. If you are unsure then the user list
is the best starting point.

>  How could this problem be fixed or does I need 
> to wait for a patch?

This issue is described on the wiki. Please see
http://wiki.xen.org/wiki/Compiling_Xen_From_Source#Python_Prefix_and_Module_Layout

> 
> Best Regards
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 14:58:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 14:58:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVkba-0008Ab-Qd; Tue, 06 Nov 2012 14:58:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TVkbZ-0008AP-2e
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 14:58:17 +0000
Received: from [193.109.254.147:40442] by server-5.bemta-14.messagelabs.com id
	C5/74-10257-88529905; Tue, 06 Nov 2012 14:58:16 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1352213885!8656683!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODE2NzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18083 invoked from network); 6 Nov 2012 14:58:06 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 14:58:06 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344211200"; d="scan'208";a="43617379"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 14:58:04 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 6 Nov 2012 09:58:04 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TVkbM-0007py-2R;
	Tue, 06 Nov 2012 14:58:04 +0000
Message-ID: <1352213764.12977.8.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Lukas Laukamp <lukas@laukamp.me>
Date: Tue, 6 Nov 2012 15:56:04 +0100
In-Reply-To: <50991C68.4070103@laukamp.me>
References: <50991C68.4070103@laukamp.me>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-users@lists.xen.org" <xen-users@lists.xen.org>,
	xen-devel <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [User Problem/Possible Bug] Possible PyGrub Bug
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-06 at 14:19 +0000, Lukas Laukamp wrote:
> Hello all,
> 
> I compiled latest Xen 4.2 stable with deb target on Debian Squeeze. Now 
> PyGrub seems to be damaged. It fails with following issue:
> 
> Traceback (most recent call last):
>    File "/usr/lib/xen/bin/pygrub", line 20, in <module>
>      import xen.lowlevel.xc
> ImportError: No module named xen.lowlevel.xc
> 
> So I don't know if this is a bug or a normal issue. I sent this mail to 
> the user and devel list.

In general please don't cross post. If you are unsure then the user list
is the best starting point.

>  How could this problem be fixed or does I need 
> to wait for a patch?

This issue is described on the wiki. Please see
http://wiki.xen.org/wiki/Compiling_Xen_From_Source#Python_Prefix_and_Module_Layout

> 
> Best Regards
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 14:59:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 14:59:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVkcZ-0008JO-9J; Tue, 06 Nov 2012 14:59:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TVkcY-0008J5-9v
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 14:59:18 +0000
Received: from [85.158.139.211:38351] by server-14.bemta-5.messagelabs.com id
	35/13-21768-5C529905; Tue, 06 Nov 2012 14:59:17 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1352213956!15122032!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTczNjc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23090 invoked from network); 6 Nov 2012 14:59:17 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 14:59:17 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344211200"; d="scan'208";a="15614695"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 14:59:16 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 6 Nov 2012 14:59:15 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TVkcV-0006g7-LG;
	Tue, 06 Nov 2012 14:59:15 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TVkcV-0005WG-45;
	Tue, 06 Nov 2012 14:59:15 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14370-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 6 Nov 2012 14:59:15 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [linux-3.0 test] 14370: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14370 linux-3.0 real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14370/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-amd64-pvops             4 kernel-build              fail REGR. vs. 14354
 build-i386-pvops              4 kernel-build              fail REGR. vs. 14354

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a

version targeted for testing:
 linux                ac7b56f4149a2f0e331a9b640f65aed57ed15eb4
baseline version:
 linux                27d0858dbcf199838b8c50a3e94d397bf326d986

------------------------------------------------------------
People who touched revisions under test:
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-pvops                                            fail    
 build-i386-pvops                                             fail    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit ac7b56f4149a2f0e331a9b640f65aed57ed15eb4
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Mon Nov 5 09:44:42 2012 +0100

    Linux 3.0.51

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 14:59:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 14:59:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVkcZ-0008JO-9J; Tue, 06 Nov 2012 14:59:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TVkcY-0008J5-9v
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 14:59:18 +0000
Received: from [85.158.139.211:38351] by server-14.bemta-5.messagelabs.com id
	35/13-21768-5C529905; Tue, 06 Nov 2012 14:59:17 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1352213956!15122032!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTczNjc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23090 invoked from network); 6 Nov 2012 14:59:17 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 14:59:17 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344211200"; d="scan'208";a="15614695"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 14:59:16 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 6 Nov 2012 14:59:15 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TVkcV-0006g7-LG;
	Tue, 06 Nov 2012 14:59:15 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TVkcV-0005WG-45;
	Tue, 06 Nov 2012 14:59:15 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14370-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 6 Nov 2012 14:59:15 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [linux-3.0 test] 14370: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14370 linux-3.0 real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14370/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-amd64-pvops             4 kernel-build              fail REGR. vs. 14354
 build-i386-pvops              4 kernel-build              fail REGR. vs. 14354

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a

version targeted for testing:
 linux                ac7b56f4149a2f0e331a9b640f65aed57ed15eb4
baseline version:
 linux                27d0858dbcf199838b8c50a3e94d397bf326d986

------------------------------------------------------------
People who touched revisions under test:
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-pvops                                            fail    
 build-i386-pvops                                             fail    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit ac7b56f4149a2f0e331a9b640f65aed57ed15eb4
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Mon Nov 5 09:44:42 2012 +0100

    Linux 3.0.51

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 15:00:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 15:00:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVkdZ-0008U7-OK; Tue, 06 Nov 2012 15:00:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TVkdY-0008To-5y
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 15:00:20 +0000
Received: from [85.158.138.51:33750] by server-5.bemta-3.messagelabs.com id
	5F/41-26311-30629905; Tue, 06 Nov 2012 15:00:19 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-4.tower-174.messagelabs.com!1352214013!28905526!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20883 invoked from network); 6 Nov 2012 15:00:14 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-4.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 15:00:14 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.156676974;
	Tue, 06 Nov 2012 09:59:56 -0500
Message-ID: <509925EC.9020204@jhuapl.edu>
Date: Tue, 06 Nov 2012 09:59:56 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121101212931.GQ5569@type.youpi.perso.aquilenet.fr>
	<068F06DC4D106941B297C0C5F9F446EA48A1C7BA68@aplesstripe.dom1.jhuapl.edu>
	<20121105233452.GI16909@type.youpi.perso.aquilenet.fr>
In-Reply-To: <20121105233452.GI16909@type.youpi.perso.aquilenet.fr>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 1/9] Disable -DGNT_DEBUG and
	-DGNTMAP_DEBUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1775052777505301465=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============1775052777505301465==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms050507040408010507050102"

This is a cryptographically signed message in MIME format.

--------------ms050507040408010507050102
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

The tpm front/back driver maps and unmaps a grant reference everytime it =

sends a message. I'm not sure this is the most efficient design choice=20
but that's what the linux tpm driver did so I followed it. I'd like to=20
consider redesigning the driver at some point but right now I don't have =

time.

Compare the outputs of vtpmmgrdom below. Whats happening here is a vtpm=20
connects to the manager, requests some entropy from the hardware tpm,=20
loads its data and then saves its data.

Tpmback:Info Frontend 10/0 connected
INFO[VTPM]: Passthrough: TPM_GetRandom
INFO[VTPM]: Waiting for commands from vTPM's:
INFO[VTPM]: Passthrough: TPM_GetRandom
INFO[VTPM]: Waiting for commands from vTPM's:
INFO[TPM]: TPM_UnBind
INFO[VTPM]: Loaded hash and key for vtpm=20
ac0a5b9e-cbe2-4c07-b43b-1d69e46fb839
INFO[VTPM]: Waiting for commands from vTPM's:
INFO[TPM]: TPM_Bind
INFO[VTPM]: Saved hash and key for vtpm ac0a5b9e-cbe2-4c07-b43b-1d69e46fb=
839
INFO[VTPM]: Waiting for commands from vTPM's:


gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x11fd4c [13...]=
,=20
domids_stride=3D0, refs=3D0x11fd48 [2047...], writable=3D3)
gntmap_set_max_grants(map=3D0x46378, count=3D128)
Tpmback:Info Frontend 13/0 connected
gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x10de94 [13...]=
,=20
domids_stride=3D0, refs=3D0x2006008 [2046...], writable=3D1)
gntmap_set_max_grants(map=3D0x46378, count=3D128)
gntmap_munmap(map=3D0x46378, start_address=3D2007000, count=3D1)
INFO[VTPM]: Passthrough: TPM_GetRandom
gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x10dec4 [13...]=
,=20
domids_stride=3D0, refs=3D0x2006008 [2046...], writable=3D2)
gntmap_set_max_grants(map=3D0x46378, count=3D128)
gntmap_munmap(map=3D0x46378, start_address=3D2007000, count=3D1)
INFO[VTPM]: Waiting for commands from vTPM's:
gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x10de94 [13...]=
,=20
domids_stride=3D0, refs=3D0x2006008 [2046...], writable=3D1)
gntmap_set_max_grants(map=3D0x46378, count=3D128)
gntmap_munmap(map=3D0x46378, start_address=3D2007000, count=3D1)
INFO[VTPM]: Passthrough: TPM_GetRandom
gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x10dec4 [13...]=
,=20
domids_stride=3D0, refs=3D0x2006008 [2046...], writable=3D2)
gntmap_set_max_grants(map=3D0x46378, count=3D128)
gntmap_munmap(map=3D0x46378, start_address=3D2007000, count=3D1)
INFO[VTPM]: Waiting for commands from vTPM's:
gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x10de94 [13...]=
,=20
domids_stride=3D0, refs=3D0x2006008 [2045...], writable=3D1)
gntmap_set_max_grants(map=3D0x46378, count=3D128)
gntmap_munmap(map=3D0x46378, start_address=3D2007000, count=3D1)
INFO[TPM]: TPM_UnBind
INFO[VTPM]: Loaded hash and key for vtpm=20
ac0a5b9e-cbe2-4c07-b43b-1d69e46fb839
gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x10dec4 [13...]=
,=20
domids_stride=3D0, refs=3D0x2006008 [2045...], writable=3D2)
gntmap_set_max_grants(map=3D0x46378, count=3D128)
gntmap_munmap(map=3D0x46378, start_address=3D2007000, count=3D1)
INFO[VTPM]: Waiting for commands from vTPM's:
gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x10de94 [13...]=
,=20
domids_stride=3D0, refs=3D0x2006008 [2045...], writable=3D1)
gntmap_set_max_grants(map=3D0x46378, count=3D128)
gntmap_munmap(map=3D0x46378, start_address=3D2007000, count=3D1)
INFO[TPM]: TPM_Bind
INFO[VTPM]: Saved hash and key for vtpm ac0a5b9e-cbe2-4c07-b43b-1d69e46fb=
839
gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x10dec4 [13...]=
,=20
domids_stride=3D0, refs=3D0x2006008 [2045...], writable=3D2)
gntmap_set_max_grants(map=3D0x46378, count=3D128)
gntmap_munmap(map=3D0x46378, start_address=3D2007000, count=3D1)


I'm perfectly willing to accept that this is just my problem and the tpm =

driver should be fixed. But I also think it makes sense in general  to=20
leave debug defines turned off for default builds.


-----Original Message-----
From: Samuel Thibault [mailto:samuel.thibault@ens-lyon.org] Sent:=20
Monday, November 05, 2012 6:35 PM
To: Fioravante, Matthew E.
Cc: Ian.Campbell@citrix.com; xen-devel@lists.xen.org
Subject: Re: [PATCH VTPM 1/9] Disable -DGNT_DEBUG and -DGNTMAP_DEBUG

Fioravante, Matthew E., le Fri 02 Nov 2012 09:19:34 -0400, a =E9crit :
> It happens in my vtpm domains because the drivers often create and rele=
ase grant references. This patch isn't completely necessary. Do we want t=
o have these debug prints in the default build?

Well, surely -DGNT_DEBUG doesn't produce any output :) We could however=20
drop it, since it only adds overhead to check something that is supposed =

to be already working (and which is quite well tested nowadays).

About -DGNTMAP_DEBUG, which message are you getting printed a lot? Are=20
you running out of references in gntmap_find_free_entry, or using=20
gntmap_map_grant_refs a lot?

Samuel


--------------ms050507040408010507050102
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZ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hvZ9B0EABAww
ChsEVjcuMQMCBLAwDQYJKoZIhvcNAQEFBQADgYEAJO9HQh4YNChVLzuZqK5ARJARD8JoujGZ
fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEwNjE0NTk1NlowIwYJKoZIhvcNAQkEMRYEFMKCTAJNJJ196h6e
vjvCL74CQp7SMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAbdat4fx18DiIFCjTPjWBfj8FyRgncuGsd
QOf6HHL/LfekEKzUiGYz2rvlX8XaQcnw6QphPoZcSkAa0EAkHniClakqrdOs1i6CICIkF4lG
fQXz0c/23n0DwjX55iybCTNGE+dqM0Eam/J22a+hv3Wd6GOcfFe5Cf51P7jrIIHNngAAAAAA
AA==
--------------ms050507040408010507050102--


--===============1775052777505301465==
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.xen.org
http://lists.xen.org/xen-devel

--===============1775052777505301465==--


From xen-devel-bounces@lists.xen.org Tue Nov 06 15:00:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 15:00:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVkdZ-0008U7-OK; Tue, 06 Nov 2012 15:00:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TVkdY-0008To-5y
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 15:00:20 +0000
Received: from [85.158.138.51:33750] by server-5.bemta-3.messagelabs.com id
	5F/41-26311-30629905; Tue, 06 Nov 2012 15:00:19 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-4.tower-174.messagelabs.com!1352214013!28905526!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20883 invoked from network); 6 Nov 2012 15:00:14 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-4.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 15:00:14 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.156676974;
	Tue, 06 Nov 2012 09:59:56 -0500
Message-ID: <509925EC.9020204@jhuapl.edu>
Date: Tue, 06 Nov 2012 09:59:56 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121101212931.GQ5569@type.youpi.perso.aquilenet.fr>
	<068F06DC4D106941B297C0C5F9F446EA48A1C7BA68@aplesstripe.dom1.jhuapl.edu>
	<20121105233452.GI16909@type.youpi.perso.aquilenet.fr>
In-Reply-To: <20121105233452.GI16909@type.youpi.perso.aquilenet.fr>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 1/9] Disable -DGNT_DEBUG and
	-DGNTMAP_DEBUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1775052777505301465=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============1775052777505301465==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms050507040408010507050102"

This is a cryptographically signed message in MIME format.

--------------ms050507040408010507050102
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

The tpm front/back driver maps and unmaps a grant reference everytime it =

sends a message. I'm not sure this is the most efficient design choice=20
but that's what the linux tpm driver did so I followed it. I'd like to=20
consider redesigning the driver at some point but right now I don't have =

time.

Compare the outputs of vtpmmgrdom below. Whats happening here is a vtpm=20
connects to the manager, requests some entropy from the hardware tpm,=20
loads its data and then saves its data.

Tpmback:Info Frontend 10/0 connected
INFO[VTPM]: Passthrough: TPM_GetRandom
INFO[VTPM]: Waiting for commands from vTPM's:
INFO[VTPM]: Passthrough: TPM_GetRandom
INFO[VTPM]: Waiting for commands from vTPM's:
INFO[TPM]: TPM_UnBind
INFO[VTPM]: Loaded hash and key for vtpm=20
ac0a5b9e-cbe2-4c07-b43b-1d69e46fb839
INFO[VTPM]: Waiting for commands from vTPM's:
INFO[TPM]: TPM_Bind
INFO[VTPM]: Saved hash and key for vtpm ac0a5b9e-cbe2-4c07-b43b-1d69e46fb=
839
INFO[VTPM]: Waiting for commands from vTPM's:


gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x11fd4c [13...]=
,=20
domids_stride=3D0, refs=3D0x11fd48 [2047...], writable=3D3)
gntmap_set_max_grants(map=3D0x46378, count=3D128)
Tpmback:Info Frontend 13/0 connected
gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x10de94 [13...]=
,=20
domids_stride=3D0, refs=3D0x2006008 [2046...], writable=3D1)
gntmap_set_max_grants(map=3D0x46378, count=3D128)
gntmap_munmap(map=3D0x46378, start_address=3D2007000, count=3D1)
INFO[VTPM]: Passthrough: TPM_GetRandom
gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x10dec4 [13...]=
,=20
domids_stride=3D0, refs=3D0x2006008 [2046...], writable=3D2)
gntmap_set_max_grants(map=3D0x46378, count=3D128)
gntmap_munmap(map=3D0x46378, start_address=3D2007000, count=3D1)
INFO[VTPM]: Waiting for commands from vTPM's:
gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x10de94 [13...]=
,=20
domids_stride=3D0, refs=3D0x2006008 [2046...], writable=3D1)
gntmap_set_max_grants(map=3D0x46378, count=3D128)
gntmap_munmap(map=3D0x46378, start_address=3D2007000, count=3D1)
INFO[VTPM]: Passthrough: TPM_GetRandom
gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x10dec4 [13...]=
,=20
domids_stride=3D0, refs=3D0x2006008 [2046...], writable=3D2)
gntmap_set_max_grants(map=3D0x46378, count=3D128)
gntmap_munmap(map=3D0x46378, start_address=3D2007000, count=3D1)
INFO[VTPM]: Waiting for commands from vTPM's:
gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x10de94 [13...]=
,=20
domids_stride=3D0, refs=3D0x2006008 [2045...], writable=3D1)
gntmap_set_max_grants(map=3D0x46378, count=3D128)
gntmap_munmap(map=3D0x46378, start_address=3D2007000, count=3D1)
INFO[TPM]: TPM_UnBind
INFO[VTPM]: Loaded hash and key for vtpm=20
ac0a5b9e-cbe2-4c07-b43b-1d69e46fb839
gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x10dec4 [13...]=
,=20
domids_stride=3D0, refs=3D0x2006008 [2045...], writable=3D2)
gntmap_set_max_grants(map=3D0x46378, count=3D128)
gntmap_munmap(map=3D0x46378, start_address=3D2007000, count=3D1)
INFO[VTPM]: Waiting for commands from vTPM's:
gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x10de94 [13...]=
,=20
domids_stride=3D0, refs=3D0x2006008 [2045...], writable=3D1)
gntmap_set_max_grants(map=3D0x46378, count=3D128)
gntmap_munmap(map=3D0x46378, start_address=3D2007000, count=3D1)
INFO[TPM]: TPM_Bind
INFO[VTPM]: Saved hash and key for vtpm ac0a5b9e-cbe2-4c07-b43b-1d69e46fb=
839
gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x10dec4 [13...]=
,=20
domids_stride=3D0, refs=3D0x2006008 [2045...], writable=3D2)
gntmap_set_max_grants(map=3D0x46378, count=3D128)
gntmap_munmap(map=3D0x46378, start_address=3D2007000, count=3D1)


I'm perfectly willing to accept that this is just my problem and the tpm =

driver should be fixed. But I also think it makes sense in general  to=20
leave debug defines turned off for default builds.


-----Original Message-----
From: Samuel Thibault [mailto:samuel.thibault@ens-lyon.org] Sent:=20
Monday, November 05, 2012 6:35 PM
To: Fioravante, Matthew E.
Cc: Ian.Campbell@citrix.com; xen-devel@lists.xen.org
Subject: Re: [PATCH VTPM 1/9] Disable -DGNT_DEBUG and -DGNTMAP_DEBUG

Fioravante, Matthew E., le Fri 02 Nov 2012 09:19:34 -0400, a =E9crit :
> It happens in my vtpm domains because the drivers often create and rele=
ase grant references. This patch isn't completely necessary. Do we want t=
o have these debug prints in the default build?

Well, surely -DGNT_DEBUG doesn't produce any output :) We could however=20
drop it, since it only adds overhead to check something that is supposed =

to be already working (and which is quite well tested nowadays).

About -DGNTMAP_DEBUG, which message are you getting printed a lot? Are=20
you running out of references in gntmap_find_free_entry, or using=20
gntmap_map_grant_refs a lot?

Samuel


--------------ms050507040408010507050102
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlC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AUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAbdat4fx18DiIFCjTPjWBfj8FyRgncuGsd
QOf6HHL/LfekEKzUiGYz2rvlX8XaQcnw6QphPoZcSkAa0EAkHniClakqrdOs1i6CICIkF4lG
fQXz0c/23n0DwjX55iybCTNGE+dqM0Eam/J22a+hv3Wd6GOcfFe5Cf51P7jrIIHNngAAAAAA
AA==
--------------ms050507040408010507050102--


--===============1775052777505301465==
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.xen.org
http://lists.xen.org/xen-devel

--===============1775052777505301465==--


From xen-devel-bounces@lists.xen.org Tue Nov 06 15:13:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 15:13:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVkq8-0000ac-7l; Tue, 06 Nov 2012 15:13:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TVkq6-0000aU-2J
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 15:13:18 +0000
Received: from [85.158.139.211:60955] by server-10.bemta-5.messagelabs.com id
	D4/C3-09257-D0929905; Tue, 06 Nov 2012 15:13:17 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-14.tower-206.messagelabs.com!1352214796!19059252!1
X-Originating-IP: [192.134.164.105]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5617 invoked from network); 6 Nov 2012 15:13:16 -0000
Received: from mail4-relais-sop.national.inria.fr (HELO
	mail4-relais-sop.national.inria.fr) (192.134.164.105)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 15:13:16 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344204000"; d="scan'208";a="161569459"
Received: from unknown (HELO type.ipv6) ([193.50.110.135])
	by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	06 Nov 2012 16:13:16 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TVkq4-0005fg-0q; Tue, 06 Nov 2012 16:13:16 +0100
Date: Tue, 6 Nov 2012 16:13:16 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121106151315.GK5802@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	Ian.Campbell@citrix.com, xen-devel@lists.xen.org
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH VTPM 1/9] Disable -DGNT_DEBUG and
	-DGNTMAP_DEBUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Thu 01 Nov 2012 16:33:24 -0400, a =E9crit :
> Disabling the above flags in default mini-os build. They generate a
> lot of spam.
> =

> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 15:13:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 15:13:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVkq8-0000ac-7l; Tue, 06 Nov 2012 15:13:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TVkq6-0000aU-2J
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 15:13:18 +0000
Received: from [85.158.139.211:60955] by server-10.bemta-5.messagelabs.com id
	D4/C3-09257-D0929905; Tue, 06 Nov 2012 15:13:17 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-14.tower-206.messagelabs.com!1352214796!19059252!1
X-Originating-IP: [192.134.164.105]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5617 invoked from network); 6 Nov 2012 15:13:16 -0000
Received: from mail4-relais-sop.national.inria.fr (HELO
	mail4-relais-sop.national.inria.fr) (192.134.164.105)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 15:13:16 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344204000"; d="scan'208";a="161569459"
Received: from unknown (HELO type.ipv6) ([193.50.110.135])
	by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	06 Nov 2012 16:13:16 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TVkq4-0005fg-0q; Tue, 06 Nov 2012 16:13:16 +0100
Date: Tue, 6 Nov 2012 16:13:16 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121106151315.GK5802@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	Ian.Campbell@citrix.com, xen-devel@lists.xen.org
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH VTPM 1/9] Disable -DGNT_DEBUG and
	-DGNTMAP_DEBUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Thu 01 Nov 2012 16:33:24 -0400, a =E9crit :
> Disabling the above flags in default mini-os build. They generate a
> lot of spam.
> =

> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 15:14:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 15:14:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVkqa-0000d2-QV; Tue, 06 Nov 2012 15:13:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TVkqZ-0000cp-AO
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 15:13:47 +0000
Received: from [193.109.254.147:20311] by server-1.bemta-14.messagelabs.com id
	DF/4E-25314-A2929905; Tue, 06 Nov 2012 15:13:46 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1352214825!9823284!1
X-Originating-IP: [192.134.164.82]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28194 invoked from network); 6 Nov 2012 15:13:45 -0000
Received: from mail1-relais-roc.national.inria.fr (HELO
	mail1-relais-roc.national.inria.fr) (192.134.164.82)
	by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 15:13:45 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344204000"; d="scan'208";a="180380167"
Received: from unknown (HELO type.ipv6) ([193.50.110.135])
	by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	06 Nov 2012 16:13:45 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TVkqX-0005gd-0S; Tue, 06 Nov 2012 16:13:45 +0100
Date: Tue, 6 Nov 2012 16:13:45 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121106151344.GL5802@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121101212931.GQ5569@type.youpi.perso.aquilenet.fr>
	<068F06DC4D106941B297C0C5F9F446EA48A1C7BA68@aplesstripe.dom1.jhuapl.edu>
	<20121105233452.GI16909@type.youpi.perso.aquilenet.fr>
	<509925EC.9020204@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509925EC.9020204@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 1/9] Disable -DGNT_DEBUG and
	-DGNTMAP_DEBUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Tue 06 Nov 2012 09:59:56 -0500, a =E9crit :
> gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x11fd4c [13...],
> domids_stride=3D0, refs=3D0x11fd48 [2047...], writable=3D3)
> gntmap_set_max_grants(map=3D0x46378, count=3D128)

Ok, let's get rid of them by default, then.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 15:14:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 15:14:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVkqa-0000d2-QV; Tue, 06 Nov 2012 15:13:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TVkqZ-0000cp-AO
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 15:13:47 +0000
Received: from [193.109.254.147:20311] by server-1.bemta-14.messagelabs.com id
	DF/4E-25314-A2929905; Tue, 06 Nov 2012 15:13:46 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1352214825!9823284!1
X-Originating-IP: [192.134.164.82]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28194 invoked from network); 6 Nov 2012 15:13:45 -0000
Received: from mail1-relais-roc.national.inria.fr (HELO
	mail1-relais-roc.national.inria.fr) (192.134.164.82)
	by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 15:13:45 -0000
X-IronPort-AV: E=Sophos;i="4.80,722,1344204000"; d="scan'208";a="180380167"
Received: from unknown (HELO type.ipv6) ([193.50.110.135])
	by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	06 Nov 2012 16:13:45 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TVkqX-0005gd-0S; Tue, 06 Nov 2012 16:13:45 +0100
Date: Tue, 6 Nov 2012 16:13:45 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121106151344.GL5802@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121101212931.GQ5569@type.youpi.perso.aquilenet.fr>
	<068F06DC4D106941B297C0C5F9F446EA48A1C7BA68@aplesstripe.dom1.jhuapl.edu>
	<20121105233452.GI16909@type.youpi.perso.aquilenet.fr>
	<509925EC.9020204@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509925EC.9020204@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 1/9] Disable -DGNT_DEBUG and
	-DGNTMAP_DEBUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Tue 06 Nov 2012 09:59:56 -0500, a =E9crit :
> gntmap_map_grant_refs(map=3D0x46378, count=3D1, domids=3D0x11fd4c [13...],
> domids_stride=3D0, refs=3D0x11fd48 [2047...], writable=3D3)
> gntmap_set_max_grants(map=3D0x46378, count=3D128)

Ok, let's get rid of them by default, then.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 15:43:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 15:43:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVlIl-00018y-MU; Tue, 06 Nov 2012 15:42:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TVlIj-00018t-La
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 15:42:54 +0000
Received: from [85.158.137.99:9034] by server-15.bemta-3.messagelabs.com id
	8D/01-09445-CFF29905; Tue, 06 Nov 2012 15:42:52 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352216570!17868201!1
X-Originating-IP: [209.85.212.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31916 invoked from network); 6 Nov 2012 15:42:51 -0000
Received: from mail-vb0-f43.google.com (HELO mail-vb0-f43.google.com)
	(209.85.212.43)
	by server-14.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 15:42:51 -0000
Received: by mail-vb0-f43.google.com with SMTP id fq11so657593vbb.30
	for <xen-devel@lists.xensource.com>;
	Tue, 06 Nov 2012 07:42:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=3Mwt18hOQZbZcCLlJVQIdMoO6nnbB8vmEMZn/3g2skQ=;
	b=LplQQQPSFX/Mpbsmhhgqhwj5k7Jx35Jm6zpp1rfTZNuKc3+5Cq0QZPoEX5YFb1H9MQ
	8X8D+uvKIXfvSX8UFY0sGGRpvC3j1xJMbXgf6VYncygXcAXqH+YKABDttRv0UkEXuq1w
	CDVByoqaBcsyGvqEATMCeOMSRZsXDr5B3zreyjp451q5YWy9OhHMkXtvUzmHBxxRLIcD
	osR3EtLAExWzOsvxrZL5Ll5pOhL/hEc81rS4TAvTMWRlA3lvR/uKEgNwtl5y902OkKR3
	1xGofE010scgmiB0ZIS4eh9DzJIGOqBD/Iz70Rv97nhjo34RgGkgJkj73vCcPEA5n6C/
	grjg==
MIME-Version: 1.0
Received: by 10.220.152.11 with SMTP id e11mr1189476vcw.61.1352216570022; Tue,
	06 Nov 2012 07:42:50 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Tue, 6 Nov 2012 07:42:49 -0800 (PST)
In-Reply-To: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
References: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
Date: Tue, 6 Nov 2012 15:42:49 +0000
X-Google-Sender-Auth: htMbIvCqsl5i1vlflAknDBcl0Ek
Message-ID: <CAFLBxZYy8mqvfNH4Hp9x=o0jqZ4r9hnCS_qLR0O8+rkY2AAdTA@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Liu Jinsong <jinsong.liu@intel.com>
Cc: xen-devel@lists.xensource.com, ian.jackson@eu.citrix.com, jbeulich@suse.com
Subject: Re: [Xen-devel] [PATCH] Handle broken page with regard to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 2, 2012 at 3:25 AM, Liu Jinsong <jinsong.liu@intel.com> wrote:
> Generally, there are 2 cases:
> 1. broken page occurs before migration
> 2. broken page occurs during migration
>
> At the sender
>   for case 1, the broken page would be mapped but not copied to target
>   (otherwise it may trigger more serious error, say, SRAR error).
>   While its pfn_type and pfn number would be transferred to target
>   so that target take appropriate action.
>
>   for case 2, mce handler marks the broken page to dirty bitmap, so that
>   at copypages stage of migration, its pfn_type and pfn number would be
>   transferred to target and then take appropriate action.
>
> At the target
>   it would set p2m as p2m_ram_broken for broken page, so that if guest
>   access the broken page again, it would kill itself as expected.
>
> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

Looks good to me -- thanks, Jinsong!

Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

>
> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain.c
> --- a/tools/libxc/xc_domain.c   Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xc_domain.c   Fri Nov 02 11:08:37 2012 +0800
> @@ -283,6 +283,22 @@
>      return ret;
>  }
>
> +/* set broken page p2m */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn)
> +{
> +    int ret;
> +    DECLARE_DOMCTL;
> +
> +    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
> +    domctl.domain = (domid_t)domid;
> +    domctl.u.set_broken_page_p2m.pfn = pfn;
> +    ret = do_domctl(xch, &domctl);
> +
> +    return ret ? -1 : 0;
> +}
> +
>  /* get info from hvm guest for save */
>  int xc_domain_hvm_getcontext(xc_interface *xch,
>                               uint32_t domid,
> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain_restore.c
> --- a/tools/libxc/xc_domain_restore.c   Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xc_domain_restore.c   Fri Nov 02 11:08:37 2012 +0800
> @@ -962,9 +962,15 @@
>
>      countpages = count;
>      for (i = oldcount; i < buf->nr_pages; ++i)
> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
> +    {
> +        unsigned long pagetype;
> +
> +        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
> +        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
> +             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
> +             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>              --countpages;
> +    }
>
>      if (!countpages)
>          return count;
> @@ -1200,6 +1206,17 @@
>              /* a bogus/unmapped/allocate-only page: skip it */
>              continue;
>
> +        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
> +        {
> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
> +            {
> +                ERROR("Set p2m for broken page failed, "
> +                      "dom=%d, pfn=%lx\n", dom, pfn);
> +                goto err_mapped;
> +            }
> +            continue;
> +        }
> +
>          if (pfn_err[i])
>          {
>              ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain_save.c
> --- a/tools/libxc/xc_domain_save.c      Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xc_domain_save.c      Fri Nov 02 11:08:37 2012 +0800
> @@ -1277,6 +1277,13 @@
>                  if ( !hvm )
>                      gmfn = pfn_to_mfn(gmfn);
>
> +                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                {
> +                    pfn_type[j] |= pfn_batch[j];
> +                    ++run;
> +                    continue;
> +                }
> +
>                  if ( pfn_err[j] )
>                  {
>                      if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
> @@ -1371,8 +1378,12 @@
>                      }
>                  }
>
> -                /* skip pages that aren't present or are alloc-only */
> +                /*
> +                 * skip pages that aren't present,
> +                 * or are broken, or are alloc-only
> +                 */
>                  if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
> +                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
>                      || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>                      continue;
>
> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xenctrl.h
> --- a/tools/libxc/xenctrl.h     Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xenctrl.h     Fri Nov 02 11:08:37 2012 +0800
> @@ -575,6 +575,17 @@
>                            xc_domaininfo_t *info);
>
>  /**
> + * This function set p2m for broken page
> + * &parm xch a handle to an open hypervisor interface
> + * @parm domid the domain id which broken page belong to
> + * @parm pfn the pfn number of the broken page
> + * @return 0 on success, -1 on failure
> + */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn);
> +
> +/**
>   * This function returns information about the context of a hvm domain
>   * @parm xch a handle to an open hypervisor interface
>   * @parm domid the domain to get information from
> diff -r d675797494bd -r 730dd3f22a12 xen/arch/x86/cpu/mcheck/mcaction.c
> --- a/xen/arch/x86/cpu/mcheck/mcaction.c        Fri Nov 02 11:08:37 2012 +0800
> +++ b/xen/arch/x86/cpu/mcheck/mcaction.c        Fri Nov 02 11:08:37 2012 +0800
> @@ -1,5 +1,6 @@
>  #include <xen/types.h>
>  #include <xen/sched.h>
> +#include <asm/p2m.h>
>  #include "mcaction.h"
>  #include "vmce.h"
>  #include "mce.h"
> @@ -91,6 +92,24 @@
>                      goto vmce_failed;
>                  }
>
> +                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram &&
> +                     paging_mode_log_dirty(d) )
> +                {
> +                    /*
> +                     * vMCE occur during migration
> +                     *
> +                     *   At sender, it marks broken page to dirty bitmap,
> +                     *   so that at copypages stage of migration, brokan
> +                     *   page's pfn_type and pfn number would be transferred
> +                     *   to target and then take appropriate action.
> +                     *
> +                     *   At target, it would set p2m as p2m_ram_broken for
> +                     *   broken page, so that if guest access the broken page
> +                     *   again, it would kill itself as expected.
> +                     */
> +                    paging_mark_dirty(d, mfn);
> +                }
> +
>                  if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
>                  {
>                      printk("Unmap broken memory %lx for DOM%d failed\n",
> diff -r d675797494bd -r 730dd3f22a12 xen/arch/x86/domctl.c
> --- a/xen/arch/x86/domctl.c     Fri Nov 02 11:08:37 2012 +0800
> +++ b/xen/arch/x86/domctl.c     Fri Nov 02 11:08:37 2012 +0800
> @@ -209,12 +209,18 @@
>                  for ( j = 0; j < k; j++ )
>                  {
>                      unsigned long type = 0;
> +                    p2m_type_t t;
>
> -                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
> +                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
>
>                      if ( unlikely(!page) ||
>                           unlikely(is_xen_heap_page(page)) )
> -                        type = XEN_DOMCTL_PFINFO_XTAB;
> +                    {
> +                        if ( p2m_is_broken(t) )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
> +                        else
> +                            type = XEN_DOMCTL_PFINFO_XTAB;
> +                    }
>                      else
>                      {
>                          switch( page->u.inuse.type_info & PGT_type_mask )
> @@ -235,6 +241,9 @@
>
>                          if ( page->u.inuse.type_info & PGT_pinned )
>                              type |= XEN_DOMCTL_PFINFO_LPINTAB;
> +
> +                        if ( page->count_info & PGC_broken )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
>                      }
>
>                      if ( page )
> @@ -1568,6 +1577,29 @@
>      }
>      break;
>
> +    case XEN_DOMCTL_set_broken_page_p2m:
> +    {
> +        struct domain *d;
> +
> +        d = rcu_lock_domain_by_id(domctl->domain);
> +        if ( d != NULL )
> +        {
> +            p2m_type_t pt;
> +            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
> +            mfn_t mfn = get_gfn_query(d, pfn, &pt);
> +
> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
> +                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
> +                ret = -EINVAL;
> +
> +            put_gfn(d, pfn);
> +            rcu_unlock_domain(d);
> +        }
> +        else
> +            ret = -ESRCH;
> +    }
> +    break;
> +
>      default:
>          ret = iommu_do_domctl(domctl, u_domctl);
>          break;
> diff -r d675797494bd -r 730dd3f22a12 xen/include/public/domctl.h
> --- a/xen/include/public/domctl.h       Fri Nov 02 11:08:37 2012 +0800
> +++ b/xen/include/public/domctl.h       Fri Nov 02 11:08:37 2012 +0800
> @@ -136,6 +136,7 @@
>  #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
>  #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
>  #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
> +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
>  #define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
>  #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
>
> @@ -835,6 +836,12 @@
>  typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
>  DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
>
> +struct xen_domctl_set_broken_page_p2m {
> +    uint64_aligned_t pfn;
> +};
> +typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
> +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
> +
>  struct xen_domctl {
>      uint32_t cmd;
>  #define XEN_DOMCTL_createdomain                   1
> @@ -900,6 +907,7 @@
>  #define XEN_DOMCTL_set_access_required           64
>  #define XEN_DOMCTL_audit_p2m                     65
>  #define XEN_DOMCTL_set_virq_handler              66
> +#define XEN_DOMCTL_set_broken_page_p2m           67
>  #define XEN_DOMCTL_gdbsx_guestmemio            1000
>  #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>  #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
> @@ -955,6 +963,7 @@
>          struct xen_domctl_audit_p2m         audit_p2m;
>          struct xen_domctl_set_virq_handler  set_virq_handler;
>          struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>          struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>          struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>          uint8_t                             pad[128];
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 15:43:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 15:43:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVlIl-00018y-MU; Tue, 06 Nov 2012 15:42:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TVlIj-00018t-La
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 15:42:54 +0000
Received: from [85.158.137.99:9034] by server-15.bemta-3.messagelabs.com id
	8D/01-09445-CFF29905; Tue, 06 Nov 2012 15:42:52 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352216570!17868201!1
X-Originating-IP: [209.85.212.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31916 invoked from network); 6 Nov 2012 15:42:51 -0000
Received: from mail-vb0-f43.google.com (HELO mail-vb0-f43.google.com)
	(209.85.212.43)
	by server-14.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 15:42:51 -0000
Received: by mail-vb0-f43.google.com with SMTP id fq11so657593vbb.30
	for <xen-devel@lists.xensource.com>;
	Tue, 06 Nov 2012 07:42:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=3Mwt18hOQZbZcCLlJVQIdMoO6nnbB8vmEMZn/3g2skQ=;
	b=LplQQQPSFX/Mpbsmhhgqhwj5k7Jx35Jm6zpp1rfTZNuKc3+5Cq0QZPoEX5YFb1H9MQ
	8X8D+uvKIXfvSX8UFY0sGGRpvC3j1xJMbXgf6VYncygXcAXqH+YKABDttRv0UkEXuq1w
	CDVByoqaBcsyGvqEATMCeOMSRZsXDr5B3zreyjp451q5YWy9OhHMkXtvUzmHBxxRLIcD
	osR3EtLAExWzOsvxrZL5Ll5pOhL/hEc81rS4TAvTMWRlA3lvR/uKEgNwtl5y902OkKR3
	1xGofE010scgmiB0ZIS4eh9DzJIGOqBD/Iz70Rv97nhjo34RgGkgJkj73vCcPEA5n6C/
	grjg==
MIME-Version: 1.0
Received: by 10.220.152.11 with SMTP id e11mr1189476vcw.61.1352216570022; Tue,
	06 Nov 2012 07:42:50 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Tue, 6 Nov 2012 07:42:49 -0800 (PST)
In-Reply-To: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
References: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
Date: Tue, 6 Nov 2012 15:42:49 +0000
X-Google-Sender-Auth: htMbIvCqsl5i1vlflAknDBcl0Ek
Message-ID: <CAFLBxZYy8mqvfNH4Hp9x=o0jqZ4r9hnCS_qLR0O8+rkY2AAdTA@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Liu Jinsong <jinsong.liu@intel.com>
Cc: xen-devel@lists.xensource.com, ian.jackson@eu.citrix.com, jbeulich@suse.com
Subject: Re: [Xen-devel] [PATCH] Handle broken page with regard to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 2, 2012 at 3:25 AM, Liu Jinsong <jinsong.liu@intel.com> wrote:
> Generally, there are 2 cases:
> 1. broken page occurs before migration
> 2. broken page occurs during migration
>
> At the sender
>   for case 1, the broken page would be mapped but not copied to target
>   (otherwise it may trigger more serious error, say, SRAR error).
>   While its pfn_type and pfn number would be transferred to target
>   so that target take appropriate action.
>
>   for case 2, mce handler marks the broken page to dirty bitmap, so that
>   at copypages stage of migration, its pfn_type and pfn number would be
>   transferred to target and then take appropriate action.
>
> At the target
>   it would set p2m as p2m_ram_broken for broken page, so that if guest
>   access the broken page again, it would kill itself as expected.
>
> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

Looks good to me -- thanks, Jinsong!

Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

>
> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain.c
> --- a/tools/libxc/xc_domain.c   Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xc_domain.c   Fri Nov 02 11:08:37 2012 +0800
> @@ -283,6 +283,22 @@
>      return ret;
>  }
>
> +/* set broken page p2m */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn)
> +{
> +    int ret;
> +    DECLARE_DOMCTL;
> +
> +    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
> +    domctl.domain = (domid_t)domid;
> +    domctl.u.set_broken_page_p2m.pfn = pfn;
> +    ret = do_domctl(xch, &domctl);
> +
> +    return ret ? -1 : 0;
> +}
> +
>  /* get info from hvm guest for save */
>  int xc_domain_hvm_getcontext(xc_interface *xch,
>                               uint32_t domid,
> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain_restore.c
> --- a/tools/libxc/xc_domain_restore.c   Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xc_domain_restore.c   Fri Nov 02 11:08:37 2012 +0800
> @@ -962,9 +962,15 @@
>
>      countpages = count;
>      for (i = oldcount; i < buf->nr_pages; ++i)
> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
> +    {
> +        unsigned long pagetype;
> +
> +        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
> +        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
> +             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
> +             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>              --countpages;
> +    }
>
>      if (!countpages)
>          return count;
> @@ -1200,6 +1206,17 @@
>              /* a bogus/unmapped/allocate-only page: skip it */
>              continue;
>
> +        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
> +        {
> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
> +            {
> +                ERROR("Set p2m for broken page failed, "
> +                      "dom=%d, pfn=%lx\n", dom, pfn);
> +                goto err_mapped;
> +            }
> +            continue;
> +        }
> +
>          if (pfn_err[i])
>          {
>              ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain_save.c
> --- a/tools/libxc/xc_domain_save.c      Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xc_domain_save.c      Fri Nov 02 11:08:37 2012 +0800
> @@ -1277,6 +1277,13 @@
>                  if ( !hvm )
>                      gmfn = pfn_to_mfn(gmfn);
>
> +                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                {
> +                    pfn_type[j] |= pfn_batch[j];
> +                    ++run;
> +                    continue;
> +                }
> +
>                  if ( pfn_err[j] )
>                  {
>                      if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
> @@ -1371,8 +1378,12 @@
>                      }
>                  }
>
> -                /* skip pages that aren't present or are alloc-only */
> +                /*
> +                 * skip pages that aren't present,
> +                 * or are broken, or are alloc-only
> +                 */
>                  if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
> +                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
>                      || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>                      continue;
>
> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xenctrl.h
> --- a/tools/libxc/xenctrl.h     Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xenctrl.h     Fri Nov 02 11:08:37 2012 +0800
> @@ -575,6 +575,17 @@
>                            xc_domaininfo_t *info);
>
>  /**
> + * This function set p2m for broken page
> + * &parm xch a handle to an open hypervisor interface
> + * @parm domid the domain id which broken page belong to
> + * @parm pfn the pfn number of the broken page
> + * @return 0 on success, -1 on failure
> + */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn);
> +
> +/**
>   * This function returns information about the context of a hvm domain
>   * @parm xch a handle to an open hypervisor interface
>   * @parm domid the domain to get information from
> diff -r d675797494bd -r 730dd3f22a12 xen/arch/x86/cpu/mcheck/mcaction.c
> --- a/xen/arch/x86/cpu/mcheck/mcaction.c        Fri Nov 02 11:08:37 2012 +0800
> +++ b/xen/arch/x86/cpu/mcheck/mcaction.c        Fri Nov 02 11:08:37 2012 +0800
> @@ -1,5 +1,6 @@
>  #include <xen/types.h>
>  #include <xen/sched.h>
> +#include <asm/p2m.h>
>  #include "mcaction.h"
>  #include "vmce.h"
>  #include "mce.h"
> @@ -91,6 +92,24 @@
>                      goto vmce_failed;
>                  }
>
> +                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram &&
> +                     paging_mode_log_dirty(d) )
> +                {
> +                    /*
> +                     * vMCE occur during migration
> +                     *
> +                     *   At sender, it marks broken page to dirty bitmap,
> +                     *   so that at copypages stage of migration, brokan
> +                     *   page's pfn_type and pfn number would be transferred
> +                     *   to target and then take appropriate action.
> +                     *
> +                     *   At target, it would set p2m as p2m_ram_broken for
> +                     *   broken page, so that if guest access the broken page
> +                     *   again, it would kill itself as expected.
> +                     */
> +                    paging_mark_dirty(d, mfn);
> +                }
> +
>                  if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
>                  {
>                      printk("Unmap broken memory %lx for DOM%d failed\n",
> diff -r d675797494bd -r 730dd3f22a12 xen/arch/x86/domctl.c
> --- a/xen/arch/x86/domctl.c     Fri Nov 02 11:08:37 2012 +0800
> +++ b/xen/arch/x86/domctl.c     Fri Nov 02 11:08:37 2012 +0800
> @@ -209,12 +209,18 @@
>                  for ( j = 0; j < k; j++ )
>                  {
>                      unsigned long type = 0;
> +                    p2m_type_t t;
>
> -                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
> +                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
>
>                      if ( unlikely(!page) ||
>                           unlikely(is_xen_heap_page(page)) )
> -                        type = XEN_DOMCTL_PFINFO_XTAB;
> +                    {
> +                        if ( p2m_is_broken(t) )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
> +                        else
> +                            type = XEN_DOMCTL_PFINFO_XTAB;
> +                    }
>                      else
>                      {
>                          switch( page->u.inuse.type_info & PGT_type_mask )
> @@ -235,6 +241,9 @@
>
>                          if ( page->u.inuse.type_info & PGT_pinned )
>                              type |= XEN_DOMCTL_PFINFO_LPINTAB;
> +
> +                        if ( page->count_info & PGC_broken )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
>                      }
>
>                      if ( page )
> @@ -1568,6 +1577,29 @@
>      }
>      break;
>
> +    case XEN_DOMCTL_set_broken_page_p2m:
> +    {
> +        struct domain *d;
> +
> +        d = rcu_lock_domain_by_id(domctl->domain);
> +        if ( d != NULL )
> +        {
> +            p2m_type_t pt;
> +            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
> +            mfn_t mfn = get_gfn_query(d, pfn, &pt);
> +
> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
> +                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
> +                ret = -EINVAL;
> +
> +            put_gfn(d, pfn);
> +            rcu_unlock_domain(d);
> +        }
> +        else
> +            ret = -ESRCH;
> +    }
> +    break;
> +
>      default:
>          ret = iommu_do_domctl(domctl, u_domctl);
>          break;
> diff -r d675797494bd -r 730dd3f22a12 xen/include/public/domctl.h
> --- a/xen/include/public/domctl.h       Fri Nov 02 11:08:37 2012 +0800
> +++ b/xen/include/public/domctl.h       Fri Nov 02 11:08:37 2012 +0800
> @@ -136,6 +136,7 @@
>  #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
>  #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
>  #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
> +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
>  #define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
>  #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
>
> @@ -835,6 +836,12 @@
>  typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
>  DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
>
> +struct xen_domctl_set_broken_page_p2m {
> +    uint64_aligned_t pfn;
> +};
> +typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
> +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
> +
>  struct xen_domctl {
>      uint32_t cmd;
>  #define XEN_DOMCTL_createdomain                   1
> @@ -900,6 +907,7 @@
>  #define XEN_DOMCTL_set_access_required           64
>  #define XEN_DOMCTL_audit_p2m                     65
>  #define XEN_DOMCTL_set_virq_handler              66
> +#define XEN_DOMCTL_set_broken_page_p2m           67
>  #define XEN_DOMCTL_gdbsx_guestmemio            1000
>  #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>  #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
> @@ -955,6 +963,7 @@
>          struct xen_domctl_audit_p2m         audit_p2m;
>          struct xen_domctl_set_virq_handler  set_virq_handler;
>          struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>          struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>          struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>          uint8_t                             pad[128];
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 16:24:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 16:24:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVlwa-00026i-SQ; Tue, 06 Nov 2012 16:24:04 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TVlwZ-00026d-V3
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 16:24:04 +0000
Received: from [193.109.254.147:47982] by server-9.bemta-14.messagelabs.com id
	F1/FC-30773-3A939905; Tue, 06 Nov 2012 16:24:03 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352219042!7238606!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzYyMDU0\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13645 invoked from network); 6 Nov 2012 16:24:02 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-5.tower-27.messagelabs.com with SMTP;
	6 Nov 2012 16:24:02 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga102.jf.intel.com with ESMTP; 06 Nov 2012 08:23:28 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,722,1344236400"; d="scan'208";a="238028653"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by orsmga002.jf.intel.com with ESMTP; 06 Nov 2012 08:24:00 -0800
Received: from fmsmsx152.amr.corp.intel.com (10.19.17.221) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 6 Nov 2012 08:24:00 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	fmsmsx152.amr.corp.intel.com (10.19.17.221) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 6 Nov 2012 08:24:00 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Wed, 7 Nov 2012 00:23:58 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
Thread-Index: AQHNvC7tTi91BiFLfUibRvXA4zlK85fc+8/g
Date: Tue, 6 Nov 2012 16:23:57 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537B479@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<5089676602000078000A4928@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC82923353723C7@SHSMSX101.ccr.corp.intel.com>
	<508A89CB020000780008E6ED@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
	<alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537B147@SHSMSX101.ccr.corp.intel.com>
	<alpine.DEB.2.02.1211061455150.2689@kaball.uk.xensource.com>
In-Reply-To: <alpine.DEB.2.02.1211061455150.2689@kaball.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Stefano Stabellini wrote:
> On Tue, 6 Nov 2012, Liu, Jinsong wrote:
>> Liu, Jinsong wrote:
>>> Stefano Stabellini wrote:
>>>>>> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
>>>>>> index 0e86370..a2af622 100644
>>>>>> --- a/drivers/xen/Makefile
>>>>>> +++ b/drivers/xen/Makefile
>>>>>> @@ -29,6 +29,7 @@ obj-$(CONFIG_XEN_MCE_LOG)           += mcelog.o
>>>>>>  obj-$(CONFIG_XEN_PCIDEV_BACKEND)     += xen-pciback/
>>>>>>  obj-$(CONFIG_XEN_PRIVCMD)            += xen-privcmd.o
>>>>>>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)     += xen-acpi-processor.o
>>>>>> +obj-$(CONFIG_XEN_DOM0)                       += xen_acpi_pad.o
>>>>>>  xen-evtchn-y                         := evtchn.o
>>>>>>  xen-gntdev-y                         := gntdev.o
>>>>>>  xen-gntalloc-y                               := gntalloc.o
>>>> 
>>>> it should really depend on ACPI and maybe also X86, otherwise it
>>>> is going to break the ARM build 
>>>> 
>>>> 
>>> 
>>> Hmm, XEN_DOM0 has already depended on ACPI and X86_LOCAL_APIC
>>> (which depends on X86_64). 
>>> 
>> 
>> Ah, you and Konrad are right. I ignore XEN_DOM0 varies under
>> different arch. (But seems it not depends on X86 since it's
>> logically an acpi stuff?). 
> 
> If it is generic ACPI code, than it can depend only on ACPI.
> If it is ACPI code that contains X86 specific info, than it needs to
> depend on X86 too.

No x86 specific so let's depend on ACPI.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 16:24:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 16:24:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVlwa-00026i-SQ; Tue, 06 Nov 2012 16:24:04 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TVlwZ-00026d-V3
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 16:24:04 +0000
Received: from [193.109.254.147:47982] by server-9.bemta-14.messagelabs.com id
	F1/FC-30773-3A939905; Tue, 06 Nov 2012 16:24:03 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352219042!7238606!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzYyMDU0\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13645 invoked from network); 6 Nov 2012 16:24:02 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-5.tower-27.messagelabs.com with SMTP;
	6 Nov 2012 16:24:02 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga102.jf.intel.com with ESMTP; 06 Nov 2012 08:23:28 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,722,1344236400"; d="scan'208";a="238028653"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by orsmga002.jf.intel.com with ESMTP; 06 Nov 2012 08:24:00 -0800
Received: from fmsmsx152.amr.corp.intel.com (10.19.17.221) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 6 Nov 2012 08:24:00 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	fmsmsx152.amr.corp.intel.com (10.19.17.221) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 6 Nov 2012 08:24:00 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Wed, 7 Nov 2012 00:23:58 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
Thread-Index: AQHNvC7tTi91BiFLfUibRvXA4zlK85fc+8/g
Date: Tue, 6 Nov 2012 16:23:57 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537B479@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<5089676602000078000A4928@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC82923353723C7@SHSMSX101.ccr.corp.intel.com>
	<508A89CB020000780008E6ED@nat28.tlf.novell.com>
	<DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
	<alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537B147@SHSMSX101.ccr.corp.intel.com>
	<alpine.DEB.2.02.1211061455150.2689@kaball.uk.xensource.com>
In-Reply-To: <alpine.DEB.2.02.1211061455150.2689@kaball.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Stefano Stabellini wrote:
> On Tue, 6 Nov 2012, Liu, Jinsong wrote:
>> Liu, Jinsong wrote:
>>> Stefano Stabellini wrote:
>>>>>> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
>>>>>> index 0e86370..a2af622 100644
>>>>>> --- a/drivers/xen/Makefile
>>>>>> +++ b/drivers/xen/Makefile
>>>>>> @@ -29,6 +29,7 @@ obj-$(CONFIG_XEN_MCE_LOG)           += mcelog.o
>>>>>>  obj-$(CONFIG_XEN_PCIDEV_BACKEND)     += xen-pciback/
>>>>>>  obj-$(CONFIG_XEN_PRIVCMD)            += xen-privcmd.o
>>>>>>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)     += xen-acpi-processor.o
>>>>>> +obj-$(CONFIG_XEN_DOM0)                       += xen_acpi_pad.o
>>>>>>  xen-evtchn-y                         := evtchn.o
>>>>>>  xen-gntdev-y                         := gntdev.o
>>>>>>  xen-gntalloc-y                               := gntalloc.o
>>>> 
>>>> it should really depend on ACPI and maybe also X86, otherwise it
>>>> is going to break the ARM build 
>>>> 
>>>> 
>>> 
>>> Hmm, XEN_DOM0 has already depended on ACPI and X86_LOCAL_APIC
>>> (which depends on X86_64). 
>>> 
>> 
>> Ah, you and Konrad are right. I ignore XEN_DOM0 varies under
>> different arch. (But seems it not depends on X86 since it's
>> logically an acpi stuff?). 
> 
> If it is generic ACPI code, than it can depend only on ACPI.
> If it is ACPI code that contains X86 specific info, than it needs to
> depend on X86 too.

No x86 specific so let's depend on ACPI.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 16:26:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 16:26:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVlyu-0002Cz-EQ; Tue, 06 Nov 2012 16:26:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TVlyt-0002Cr-9M
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 16:26:27 +0000
Received: from [85.158.139.83:11177] by server-9.bemta-5.messagelabs.com id
	31/BF-29295-23A39905; Tue, 06 Nov 2012 16:26:26 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1352219183!28764054!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzE5MDM3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13330 invoked from network); 6 Nov 2012 16:26:24 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-15.tower-182.messagelabs.com with SMTP;
	6 Nov 2012 16:26:24 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga101.jf.intel.com with ESMTP; 06 Nov 2012 08:26:22 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,722,1344236400"; d="scan'208";a="238029792"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by orsmga002.jf.intel.com with ESMTP; 06 Nov 2012 08:26:16 -0800
Received: from fmsmsx101.amr.corp.intel.com (10.19.9.52) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 6 Nov 2012 08:26:16 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX101.amr.corp.intel.com (10.19.9.52) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 6 Nov 2012 08:26:16 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Wed, 7 Nov 2012 00:26:14 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH] Handle broken page with regard to migration
Thread-Index: AQHNvDVowo0CS0uWQ02/ywhb/M0oqpfc/eBg
Date: Tue, 6 Nov 2012 16:26:13 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537B491@SHSMSX101.ccr.corp.intel.com>
References: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
	<CAFLBxZYy8mqvfNH4Hp9x=o0jqZ4r9hnCS_qLR0O8+rkY2AAdTA@mail.gmail.com>
In-Reply-To: <CAFLBxZYy8mqvfNH4Hp9x=o0jqZ4r9hnCS_qLR0O8+rkY2AAdTA@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"ian.jackson@eu.citrix.com" <ian.jackson@eu.citrix.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] Handle broken page with regard to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> On Fri, Nov 2, 2012 at 3:25 AM, Liu Jinsong <jinsong.liu@intel.com>
> wrote: 
>> Generally, there are 2 cases:
>> 1. broken page occurs before migration
>> 2. broken page occurs during migration
>> 
>> At the sender
>>   for case 1, the broken page would be mapped but not copied to
>>   target (otherwise it may trigger more serious error, say, SRAR
>>   error). While its pfn_type and pfn number would be transferred to
>>   target so that target take appropriate action.
>> 
>>   for case 2, mce handler marks the broken page to dirty bitmap, so
>>   that at copypages stage of migration, its pfn_type and pfn number
>>   would be transferred to target and then take appropriate action.
>> 
>> At the target
>>   it would set p2m as p2m_ram_broken for broken page, so that if
>>   guest access the broken page again, it would kill itself as
>> expected. 
>> 
>> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
>> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
> 
> Looks good to me -- thanks, Jinsong!
> 
> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
> 

Thanks George, for your review and great suggestion :-)

>> 
>> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain.c
>> --- a/tools/libxc/xc_domain.c   Fri Nov 02 11:08:37 2012 +0800
>> +++ b/tools/libxc/xc_domain.c   Fri Nov 02 11:08:37 2012 +0800 @@
>>      -283,6 +283,22 @@ return ret;
>>  }
>> 
>> +/* set broken page p2m */
>> +int xc_set_broken_page_p2m(xc_interface *xch,
>> +                           uint32_t domid,
>> +                           unsigned long pfn)
>> +{
>> +    int ret;
>> +    DECLARE_DOMCTL;
>> +
>> +    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
>> +    domctl.domain = (domid_t)domid;
>> +    domctl.u.set_broken_page_p2m.pfn = pfn;
>> +    ret = do_domctl(xch, &domctl);
>> +
>> +    return ret ? -1 : 0;
>> +}
>> +
>>  /* get info from hvm guest for save */
>>  int xc_domain_hvm_getcontext(xc_interface *xch,
>>                               uint32_t domid,
>> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain_restore.c
>> --- a/tools/libxc/xc_domain_restore.c   Fri Nov 02 11:08:37 2012
>> +0800 +++ b/tools/libxc/xc_domain_restore.c   Fri Nov 02 11:08:37
>> 2012 +0800 @@ -962,9 +962,15 @@ 
>> 
>>      countpages = count;
>>      for (i = oldcount; i < buf->nr_pages; ++i)
>> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
>> XEN_DOMCTL_PFINFO_XTAB 
>> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
>> XEN_DOMCTL_PFINFO_XALLOC) +    { +        unsigned long pagetype;
>> +
>> +        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
>> +        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
>> +             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
>> +             pagetype == XEN_DOMCTL_PFINFO_XALLOC )             
>> --countpages; +    }
>> 
>>      if (!countpages)
>>          return count;
>> @@ -1200,6 +1206,17 @@
>>              /* a bogus/unmapped/allocate-only page: skip it */     
>> continue; 
>> 
>> +        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN ) +        {
>> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) ) +         
>> { +                ERROR("Set p2m for broken page failed, "
>> +                      "dom=%d, pfn=%lx\n", dom, pfn);
>> +                goto err_mapped;
>> +            }
>> +            continue;
>> +        }
>> +
>>          if (pfn_err[i])
>>          {
>>              ERROR("unexpected PFN mapping failure pfn %lx map_mfn
>> %lx p2m_mfn %lx", 
>> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain_save.c
>> --- a/tools/libxc/xc_domain_save.c      Fri Nov 02 11:08:37 2012
>> +0800 +++ b/tools/libxc/xc_domain_save.c      Fri Nov 02 11:08:37
>>                  2012 +0800 @@ -1277,6 +1277,13 @@ if ( !hvm )
>>                      gmfn = pfn_to_mfn(gmfn);
>> 
>> +                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN ) +   
>> { +                    pfn_type[j] |= pfn_batch[j];
>> +                    ++run;
>> +                    continue;
>> +                }
>> +
>>                  if ( pfn_err[j] )
>>                  {
>>                      if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB ) @@
>>                      -1371,8 +1378,12 @@ }
>>                  }
>> 
>> -                /* skip pages that aren't present or are alloc-only
>> */ +                /* +                 * skip pages that aren't
>> present, +                 * or are broken, or are alloc-only +     
>>                  */ if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
>> +                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
>>                      || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>>                      continue;
>> 
>> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xenctrl.h
>> --- a/tools/libxc/xenctrl.h     Fri Nov 02 11:08:37 2012 +0800
>> +++ b/tools/libxc/xenctrl.h     Fri Nov 02 11:08:37 2012 +0800 @@
>>                            -575,6 +575,17 @@ xc_domaininfo_t *info);
>> 
>>  /**
>> + * This function set p2m for broken page
>> + * &parm xch a handle to an open hypervisor interface
>> + * @parm domid the domain id which broken page belong to
>> + * @parm pfn the pfn number of the broken page
>> + * @return 0 on success, -1 on failure
>> + */
>> +int xc_set_broken_page_p2m(xc_interface *xch,
>> +                           uint32_t domid,
>> +                           unsigned long pfn);
>> +
>> +/**
>>   * This function returns information about the context of a hvm
>> domain 
>>   * @parm xch a handle to an open hypervisor interface
>>   * @parm domid the domain to get information from
>> diff -r d675797494bd -r 730dd3f22a12
>> xen/arch/x86/cpu/mcheck/mcaction.c ---
>> a/xen/arch/x86/cpu/mcheck/mcaction.c        Fri Nov 02 11:08:37 2012
>>  +0800 +++ b/xen/arch/x86/cpu/mcheck/mcaction.c        Fri Nov 02
>>  11:08:37 2012 +0800 @@ -1,5 +1,6 @@ #include <xen/types.h> #include
>> <xen/sched.h> +#include <asm/p2m.h>
>>  #include "mcaction.h"
>>  #include "vmce.h"
>>  #include "mce.h"
>> @@ -91,6 +92,24 @@
>>                      goto vmce_failed;
>>                  }
>> 
>> +                if ( is_hvm_domain(d) &&
>> !d->arch.hvm_domain.dirty_vram && +                    
>> paging_mode_log_dirty(d) ) +                {
>> +                    /*
>> +                     * vMCE occur during migration +               
>> * +                     *   At sender, it marks broken page to dirty
>> bitmap, +                     *   so that at copypages stage of
>> migration, brokan +                     *   page's pfn_type and pfn
>> number would be transferred +                     *   to target and
>> then take appropriate action. +                     * +             
>> *   At target, it would set p2m as p2m_ram_broken for +             
>> *   broken page, so that if guest access the broken page +          
>> *   again, it would kill itself as expected. +                    
>> */ +                    paging_mark_dirty(d, mfn); +                }
>> +
>>                  if ( unmmap_broken_page(d, _mfn(mfn), gfn) )       
>>                      { printk("Unmap broken memory %lx for DOM%d
>> failed\n", 
>> diff -r d675797494bd -r 730dd3f22a12 xen/arch/x86/domctl.c
>> --- a/xen/arch/x86/domctl.c     Fri Nov 02 11:08:37 2012 +0800
>> +++ b/xen/arch/x86/domctl.c     Fri Nov 02 11:08:37 2012 +0800 @@
>>                  -209,12 +209,18 @@ for ( j = 0; j < k; j++ )
>>                  {
>>                      unsigned long type = 0;
>> +                    p2m_type_t t;
>> 
>> -                    page = get_page_from_gfn(d, arr[j], NULL,
>> P2M_ALLOC); +                    page = get_page_from_gfn(d, arr[j],
>> &t, P2M_ALLOC); 
>> 
>>                      if ( unlikely(!page) ||
>>                           unlikely(is_xen_heap_page(page)) )
>> -                        type = XEN_DOMCTL_PFINFO_XTAB; +           
>> { +                        if ( p2m_is_broken(t) )
>> +                            type = XEN_DOMCTL_PFINFO_BROKEN; +     
>> else +                            type = XEN_DOMCTL_PFINFO_XTAB; +  
>>                      } else
>>                      {
>>                          switch( page->u.inuse.type_info &
>> PGT_type_mask ) @@ -235,6 +241,9 @@ 
>> 
>>                          if ( page->u.inuse.type_info & PGT_pinned )
>>                              type |= XEN_DOMCTL_PFINFO_LPINTAB; +
>> +                        if ( page->count_info & PGC_broken )
>> +                            type = XEN_DOMCTL_PFINFO_BROKEN;       
>> } 
>> 
>>                      if ( page )
>> @@ -1568,6 +1577,29 @@
>>      }
>>      break;
>> 
>> +    case XEN_DOMCTL_set_broken_page_p2m:
>> +    {
>> +        struct domain *d;
>> +
>> +        d = rcu_lock_domain_by_id(domctl->domain); +        if ( d
>> != NULL ) +        {
>> +            p2m_type_t pt;
>> +            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
>> +            mfn_t mfn = get_gfn_query(d, pfn, &pt); +
>> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt)
>> || +                         (p2m_change_type(d, pfn, pt,
>> p2m_ram_broken) != pt)) ) +                ret = -EINVAL;
>> +
>> +            put_gfn(d, pfn);
>> +            rcu_unlock_domain(d);
>> +        }
>> +        else
>> +            ret = -ESRCH;
>> +    }
>> +    break;
>> +
>>      default:
>>          ret = iommu_do_domctl(domctl, u_domctl);
>>          break;
>> diff -r d675797494bd -r 730dd3f22a12 xen/include/public/domctl.h
>> --- a/xen/include/public/domctl.h       Fri Nov 02 11:08:37 2012
>> +0800 +++ b/xen/include/public/domctl.h       Fri Nov 02 11:08:37
>>  2012 +0800 @@ -136,6 +136,7 @@ #define XEN_DOMCTL_PFINFO_LPINTAB
>>  (0x1U<<31) #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid
>>  page */ #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /*
>> allocate-only page */ +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28)
>>  /* broken page */ #define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
>>  #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
>> 
>> @@ -835,6 +836,12 @@
>>  typedef struct xen_domctl_set_access_required
>>  xen_domctl_set_access_required_t;
>> DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t); 
>> 
>> +struct xen_domctl_set_broken_page_p2m {
>> +    uint64_aligned_t pfn;
>> +};
>> +typedef struct xen_domctl_set_broken_page_p2m
>> xen_domctl_set_broken_page_p2m_t;
>>  +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t); +
>>      struct xen_domctl { uint32_t cmd;
>>  #define XEN_DOMCTL_createdomain                   1 @@ -900,6
>>  +907,7 @@ #define XEN_DOMCTL_set_access_required           64
>>  #define XEN_DOMCTL_audit_p2m                     65
>>  #define XEN_DOMCTL_set_virq_handler              66
>> +#define XEN_DOMCTL_set_broken_page_p2m           67
>>  #define XEN_DOMCTL_gdbsx_guestmemio            1000
>>  #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>>  #define XEN_DOMCTL_gdbsx_unpausevcpu           1002 @@ -955,6
>>          +963,7 @@ struct xen_domctl_audit_p2m         audit_p2m;
>>          struct xen_domctl_set_virq_handler  set_virq_handler;
>>          struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
>> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>>          struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>>          struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>>          uint8_t                             pad[128];
>> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 16:26:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 16:26:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVlyu-0002Cz-EQ; Tue, 06 Nov 2012 16:26:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TVlyt-0002Cr-9M
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 16:26:27 +0000
Received: from [85.158.139.83:11177] by server-9.bemta-5.messagelabs.com id
	31/BF-29295-23A39905; Tue, 06 Nov 2012 16:26:26 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1352219183!28764054!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzE5MDM3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13330 invoked from network); 6 Nov 2012 16:26:24 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-15.tower-182.messagelabs.com with SMTP;
	6 Nov 2012 16:26:24 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga101.jf.intel.com with ESMTP; 06 Nov 2012 08:26:22 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,722,1344236400"; d="scan'208";a="238029792"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by orsmga002.jf.intel.com with ESMTP; 06 Nov 2012 08:26:16 -0800
Received: from fmsmsx101.amr.corp.intel.com (10.19.9.52) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 6 Nov 2012 08:26:16 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX101.amr.corp.intel.com (10.19.9.52) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 6 Nov 2012 08:26:16 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Wed, 7 Nov 2012 00:26:14 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH] Handle broken page with regard to migration
Thread-Index: AQHNvDVowo0CS0uWQ02/ywhb/M0oqpfc/eBg
Date: Tue, 6 Nov 2012 16:26:13 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537B491@SHSMSX101.ccr.corp.intel.com>
References: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
	<CAFLBxZYy8mqvfNH4Hp9x=o0jqZ4r9hnCS_qLR0O8+rkY2AAdTA@mail.gmail.com>
In-Reply-To: <CAFLBxZYy8mqvfNH4Hp9x=o0jqZ4r9hnCS_qLR0O8+rkY2AAdTA@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"ian.jackson@eu.citrix.com" <ian.jackson@eu.citrix.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] Handle broken page with regard to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> On Fri, Nov 2, 2012 at 3:25 AM, Liu Jinsong <jinsong.liu@intel.com>
> wrote: 
>> Generally, there are 2 cases:
>> 1. broken page occurs before migration
>> 2. broken page occurs during migration
>> 
>> At the sender
>>   for case 1, the broken page would be mapped but not copied to
>>   target (otherwise it may trigger more serious error, say, SRAR
>>   error). While its pfn_type and pfn number would be transferred to
>>   target so that target take appropriate action.
>> 
>>   for case 2, mce handler marks the broken page to dirty bitmap, so
>>   that at copypages stage of migration, its pfn_type and pfn number
>>   would be transferred to target and then take appropriate action.
>> 
>> At the target
>>   it would set p2m as p2m_ram_broken for broken page, so that if
>>   guest access the broken page again, it would kill itself as
>> expected. 
>> 
>> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
>> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
> 
> Looks good to me -- thanks, Jinsong!
> 
> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
> 

Thanks George, for your review and great suggestion :-)

>> 
>> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain.c
>> --- a/tools/libxc/xc_domain.c   Fri Nov 02 11:08:37 2012 +0800
>> +++ b/tools/libxc/xc_domain.c   Fri Nov 02 11:08:37 2012 +0800 @@
>>      -283,6 +283,22 @@ return ret;
>>  }
>> 
>> +/* set broken page p2m */
>> +int xc_set_broken_page_p2m(xc_interface *xch,
>> +                           uint32_t domid,
>> +                           unsigned long pfn)
>> +{
>> +    int ret;
>> +    DECLARE_DOMCTL;
>> +
>> +    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
>> +    domctl.domain = (domid_t)domid;
>> +    domctl.u.set_broken_page_p2m.pfn = pfn;
>> +    ret = do_domctl(xch, &domctl);
>> +
>> +    return ret ? -1 : 0;
>> +}
>> +
>>  /* get info from hvm guest for save */
>>  int xc_domain_hvm_getcontext(xc_interface *xch,
>>                               uint32_t domid,
>> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain_restore.c
>> --- a/tools/libxc/xc_domain_restore.c   Fri Nov 02 11:08:37 2012
>> +0800 +++ b/tools/libxc/xc_domain_restore.c   Fri Nov 02 11:08:37
>> 2012 +0800 @@ -962,9 +962,15 @@ 
>> 
>>      countpages = count;
>>      for (i = oldcount; i < buf->nr_pages; ++i)
>> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
>> XEN_DOMCTL_PFINFO_XTAB 
>> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
>> XEN_DOMCTL_PFINFO_XALLOC) +    { +        unsigned long pagetype;
>> +
>> +        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
>> +        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
>> +             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
>> +             pagetype == XEN_DOMCTL_PFINFO_XALLOC )             
>> --countpages; +    }
>> 
>>      if (!countpages)
>>          return count;
>> @@ -1200,6 +1206,17 @@
>>              /* a bogus/unmapped/allocate-only page: skip it */     
>> continue; 
>> 
>> +        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN ) +        {
>> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) ) +         
>> { +                ERROR("Set p2m for broken page failed, "
>> +                      "dom=%d, pfn=%lx\n", dom, pfn);
>> +                goto err_mapped;
>> +            }
>> +            continue;
>> +        }
>> +
>>          if (pfn_err[i])
>>          {
>>              ERROR("unexpected PFN mapping failure pfn %lx map_mfn
>> %lx p2m_mfn %lx", 
>> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain_save.c
>> --- a/tools/libxc/xc_domain_save.c      Fri Nov 02 11:08:37 2012
>> +0800 +++ b/tools/libxc/xc_domain_save.c      Fri Nov 02 11:08:37
>>                  2012 +0800 @@ -1277,6 +1277,13 @@ if ( !hvm )
>>                      gmfn = pfn_to_mfn(gmfn);
>> 
>> +                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN ) +   
>> { +                    pfn_type[j] |= pfn_batch[j];
>> +                    ++run;
>> +                    continue;
>> +                }
>> +
>>                  if ( pfn_err[j] )
>>                  {
>>                      if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB ) @@
>>                      -1371,8 +1378,12 @@ }
>>                  }
>> 
>> -                /* skip pages that aren't present or are alloc-only
>> */ +                /* +                 * skip pages that aren't
>> present, +                 * or are broken, or are alloc-only +     
>>                  */ if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
>> +                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
>>                      || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>>                      continue;
>> 
>> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xenctrl.h
>> --- a/tools/libxc/xenctrl.h     Fri Nov 02 11:08:37 2012 +0800
>> +++ b/tools/libxc/xenctrl.h     Fri Nov 02 11:08:37 2012 +0800 @@
>>                            -575,6 +575,17 @@ xc_domaininfo_t *info);
>> 
>>  /**
>> + * This function set p2m for broken page
>> + * &parm xch a handle to an open hypervisor interface
>> + * @parm domid the domain id which broken page belong to
>> + * @parm pfn the pfn number of the broken page
>> + * @return 0 on success, -1 on failure
>> + */
>> +int xc_set_broken_page_p2m(xc_interface *xch,
>> +                           uint32_t domid,
>> +                           unsigned long pfn);
>> +
>> +/**
>>   * This function returns information about the context of a hvm
>> domain 
>>   * @parm xch a handle to an open hypervisor interface
>>   * @parm domid the domain to get information from
>> diff -r d675797494bd -r 730dd3f22a12
>> xen/arch/x86/cpu/mcheck/mcaction.c ---
>> a/xen/arch/x86/cpu/mcheck/mcaction.c        Fri Nov 02 11:08:37 2012
>>  +0800 +++ b/xen/arch/x86/cpu/mcheck/mcaction.c        Fri Nov 02
>>  11:08:37 2012 +0800 @@ -1,5 +1,6 @@ #include <xen/types.h> #include
>> <xen/sched.h> +#include <asm/p2m.h>
>>  #include "mcaction.h"
>>  #include "vmce.h"
>>  #include "mce.h"
>> @@ -91,6 +92,24 @@
>>                      goto vmce_failed;
>>                  }
>> 
>> +                if ( is_hvm_domain(d) &&
>> !d->arch.hvm_domain.dirty_vram && +                    
>> paging_mode_log_dirty(d) ) +                {
>> +                    /*
>> +                     * vMCE occur during migration +               
>> * +                     *   At sender, it marks broken page to dirty
>> bitmap, +                     *   so that at copypages stage of
>> migration, brokan +                     *   page's pfn_type and pfn
>> number would be transferred +                     *   to target and
>> then take appropriate action. +                     * +             
>> *   At target, it would set p2m as p2m_ram_broken for +             
>> *   broken page, so that if guest access the broken page +          
>> *   again, it would kill itself as expected. +                    
>> */ +                    paging_mark_dirty(d, mfn); +                }
>> +
>>                  if ( unmmap_broken_page(d, _mfn(mfn), gfn) )       
>>                      { printk("Unmap broken memory %lx for DOM%d
>> failed\n", 
>> diff -r d675797494bd -r 730dd3f22a12 xen/arch/x86/domctl.c
>> --- a/xen/arch/x86/domctl.c     Fri Nov 02 11:08:37 2012 +0800
>> +++ b/xen/arch/x86/domctl.c     Fri Nov 02 11:08:37 2012 +0800 @@
>>                  -209,12 +209,18 @@ for ( j = 0; j < k; j++ )
>>                  {
>>                      unsigned long type = 0;
>> +                    p2m_type_t t;
>> 
>> -                    page = get_page_from_gfn(d, arr[j], NULL,
>> P2M_ALLOC); +                    page = get_page_from_gfn(d, arr[j],
>> &t, P2M_ALLOC); 
>> 
>>                      if ( unlikely(!page) ||
>>                           unlikely(is_xen_heap_page(page)) )
>> -                        type = XEN_DOMCTL_PFINFO_XTAB; +           
>> { +                        if ( p2m_is_broken(t) )
>> +                            type = XEN_DOMCTL_PFINFO_BROKEN; +     
>> else +                            type = XEN_DOMCTL_PFINFO_XTAB; +  
>>                      } else
>>                      {
>>                          switch( page->u.inuse.type_info &
>> PGT_type_mask ) @@ -235,6 +241,9 @@ 
>> 
>>                          if ( page->u.inuse.type_info & PGT_pinned )
>>                              type |= XEN_DOMCTL_PFINFO_LPINTAB; +
>> +                        if ( page->count_info & PGC_broken )
>> +                            type = XEN_DOMCTL_PFINFO_BROKEN;       
>> } 
>> 
>>                      if ( page )
>> @@ -1568,6 +1577,29 @@
>>      }
>>      break;
>> 
>> +    case XEN_DOMCTL_set_broken_page_p2m:
>> +    {
>> +        struct domain *d;
>> +
>> +        d = rcu_lock_domain_by_id(domctl->domain); +        if ( d
>> != NULL ) +        {
>> +            p2m_type_t pt;
>> +            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
>> +            mfn_t mfn = get_gfn_query(d, pfn, &pt); +
>> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt)
>> || +                         (p2m_change_type(d, pfn, pt,
>> p2m_ram_broken) != pt)) ) +                ret = -EINVAL;
>> +
>> +            put_gfn(d, pfn);
>> +            rcu_unlock_domain(d);
>> +        }
>> +        else
>> +            ret = -ESRCH;
>> +    }
>> +    break;
>> +
>>      default:
>>          ret = iommu_do_domctl(domctl, u_domctl);
>>          break;
>> diff -r d675797494bd -r 730dd3f22a12 xen/include/public/domctl.h
>> --- a/xen/include/public/domctl.h       Fri Nov 02 11:08:37 2012
>> +0800 +++ b/xen/include/public/domctl.h       Fri Nov 02 11:08:37
>>  2012 +0800 @@ -136,6 +136,7 @@ #define XEN_DOMCTL_PFINFO_LPINTAB
>>  (0x1U<<31) #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid
>>  page */ #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /*
>> allocate-only page */ +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28)
>>  /* broken page */ #define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
>>  #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
>> 
>> @@ -835,6 +836,12 @@
>>  typedef struct xen_domctl_set_access_required
>>  xen_domctl_set_access_required_t;
>> DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t); 
>> 
>> +struct xen_domctl_set_broken_page_p2m {
>> +    uint64_aligned_t pfn;
>> +};
>> +typedef struct xen_domctl_set_broken_page_p2m
>> xen_domctl_set_broken_page_p2m_t;
>>  +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t); +
>>      struct xen_domctl { uint32_t cmd;
>>  #define XEN_DOMCTL_createdomain                   1 @@ -900,6
>>  +907,7 @@ #define XEN_DOMCTL_set_access_required           64
>>  #define XEN_DOMCTL_audit_p2m                     65
>>  #define XEN_DOMCTL_set_virq_handler              66
>> +#define XEN_DOMCTL_set_broken_page_p2m           67
>>  #define XEN_DOMCTL_gdbsx_guestmemio            1000
>>  #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>>  #define XEN_DOMCTL_gdbsx_unpausevcpu           1002 @@ -955,6
>>          +963,7 @@ struct xen_domctl_audit_p2m         audit_p2m;
>>          struct xen_domctl_set_virq_handler  set_virq_handler;
>>          struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
>> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>>          struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>>          struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>>          uint8_t                             pad[128];
>> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 16:32:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 16:32:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVm4R-0002QY-F0; Tue, 06 Nov 2012 16:32:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TVm4P-0002QS-S0
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 16:32:10 +0000
Received: from [85.158.137.99:31076] by server-4.bemta-3.messagelabs.com id
	00/79-30023-88B39905; Tue, 06 Nov 2012 16:32:08 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1352219526!12926131!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjY2OTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7938 invoked from network); 6 Nov 2012 16:32:08 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-3.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 16:32:08 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6GUV8W013901
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 16:30:32 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6GUS8w025583
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 16:30:29 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6GUQbH023806; Tue, 6 Nov 2012 10:30:26 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 06 Nov 2012 08:30:26 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 0935D4042D; Tue,  6 Nov 2012 11:17:43 -0500 (EST)
Date: Tue, 6 Nov 2012 11:17:42 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Mojiong Qiu <qiumojiong@gmail.com>
Message-ID: <20121106161742.GJ9966@phenom.dumpdata.com>
References: <1352189295-7111-1-git-send-email-qiumojiong@gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352189295-7111-1-git-send-email-qiumojiong@gmail.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Jeremy Fitzhardinge <jeremy@goop.org>, xen-devel@lists.xensource.com,
	Mojiong Qiu <mjqiu@tencent.com>, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	"at least to 3.0.y" <stable@kernel.org>
Subject: Re: [Xen-devel] [PATCH] xen/events: xen/events: fix RCU warning
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 06, 2012 at 04:08:15PM +0800, Mojiong Qiu wrote:
> exit_idle() should be called after irq_enter(), otherwise it throws:

That seems odd - wouldn't "smp_x86_platform_ipi"
also need the same treatment [edit: I was looking at 3.0 kernel code] ?

Ah, this is caused by

commit 98ad1cc14a5c4fd658f9d72c6ba5c86dfd3ce0d5
Author: Frederic Weisbecker <fweisbec@gmail.com>
Date:   Fri Oct 7 18:22:09 2011 +0200

    x86: Call idle notifier after irq_enter()
    

and it missed the xen-case

which means that any kernel v3.3 and newer need this, but earlier do
not.

Thx. Will put in 3.7 tree.

> 
> [    2.513020] [ INFO: suspicious RCU usage. ]
> [    2.513076] 3.6.5 #1 Not tainted
> [    2.513128] -------------------------------
> [    2.513183] include/linux/rcupdate.h:725 rcu_read_lock() used illegally while idle!
> [    2.513271]
> [    2.513271] other info that might help us debug this:
> [    2.513271]
> [    2.513388]
> [    2.513388] RCU used illegally from idle CPU!
> [    2.513388] rcu_scheduler_active = 1, debug_locks = 1
> [    2.513511] RCU used illegally from extended quiescent state!
> [    2.513572] 1 lock held by swapper/0/0:
> [    2.513626]  #0:  (rcu_read_lock){......}, at: [<ffffffff810e9fe0>] __atomic_notifier_call_chain+0x0/0x140
> [    2.513815]
> [    2.513815] stack backtrace:
> [    2.513897] Pid: 0, comm: swapper/0 Not tainted 3.6.5 #1
> [    2.513954] Call Trace:
> [    2.514005]  <IRQ>  [<ffffffff811259a2>] lockdep_rcu_suspicious+0xe2/0x130
> [    2.514107]  [<ffffffff810ea10c>] __atomic_notifier_call_chain+0x12c/0x140
> [    2.514169]  [<ffffffff810e9fe0>] ? atomic_notifier_chain_unregister+0x90/0x90
> [    2.514258]  [<ffffffff811216cd>] ? trace_hardirqs_off+0xd/0x10
> [    2.514318]  [<ffffffff810ea136>] atomic_notifier_call_chain+0x16/0x20
> [    2.514381]  [<ffffffff810777c3>] exit_idle+0x43/0x50
> [    2.514441]  [<ffffffff81568865>] xen_evtchn_do_upcall+0x25/0x50
> [    2.514503]  [<ffffffff81aa690e>] xen_do_hypervisor_callback+0x1e/0x30
> [    2.514562]  <EOI>  [<ffffffff810013aa>] ? hypercall_page+0x3aa/0x1000
> [    2.514662]  [<ffffffff810013aa>] ? hypercall_page+0x3aa/0x1000
> [    2.514722]  [<ffffffff81061540>] ? xen_safe_halt+0x10/0x20
> [    2.514782]  [<ffffffff81075cfa>] ? default_idle+0xba/0x570
> [    2.514841]  [<ffffffff810778af>] ? cpu_idle+0xdf/0x140
> [    2.514900]  [<ffffffff81a4d881>] ? rest_init+0x135/0x144
> [    2.514960]  [<ffffffff81a4d74c>] ? csum_partial_copy_generic+0x16c/0x16c
> [    2.515022]  [<ffffffff82520c45>] ? start_kernel+0x3db/0x3e8
> [    2.515081]  [<ffffffff8252066a>] ? repair_env_string+0x5a/0x5a
> [    2.515141]  [<ffffffff82520356>] ? x86_64_start_reservations+0x131/0x135
> [    2.515202]  [<ffffffff82524aca>] ? xen_start_kernel+0x465/0x46
> 
> Signed-off-by: Mojiong Qiu <mjqiu@tencent.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
> Cc: xen-devel@lists.xensource.com
> Cc: virtualization@lists.linux-foundation.org
> Cc: linux-kernel@vger.kernel.org
> Cc: stable@kernel.org (at least to 3.0.y)
             ^^^- vger.kernel.org

You mean 3.3.x

> ---
>  drivers/xen/events.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
> index 912ac81..0be4df3 100644
> --- a/drivers/xen/events.c
> +++ b/drivers/xen/events.c
> @@ -1395,10 +1395,10 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
>  {
>  	struct pt_regs *old_regs = set_irq_regs(regs);
>  
> +	irq_enter();
>  #ifdef CONFIG_X86
>  	exit_idle();
>  #endif
> -	irq_enter();
>  
>  	__xen_evtchn_do_upcall();
>  
> -- 
> 1.6.3.2

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 16:32:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 16:32:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVm4R-0002QY-F0; Tue, 06 Nov 2012 16:32:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TVm4P-0002QS-S0
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 16:32:10 +0000
Received: from [85.158.137.99:31076] by server-4.bemta-3.messagelabs.com id
	00/79-30023-88B39905; Tue, 06 Nov 2012 16:32:08 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1352219526!12926131!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjY2OTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7938 invoked from network); 6 Nov 2012 16:32:08 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-3.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 16:32:08 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6GUV8W013901
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 16:30:32 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6GUS8w025583
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 16:30:29 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6GUQbH023806; Tue, 6 Nov 2012 10:30:26 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 06 Nov 2012 08:30:26 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 0935D4042D; Tue,  6 Nov 2012 11:17:43 -0500 (EST)
Date: Tue, 6 Nov 2012 11:17:42 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Mojiong Qiu <qiumojiong@gmail.com>
Message-ID: <20121106161742.GJ9966@phenom.dumpdata.com>
References: <1352189295-7111-1-git-send-email-qiumojiong@gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352189295-7111-1-git-send-email-qiumojiong@gmail.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Jeremy Fitzhardinge <jeremy@goop.org>, xen-devel@lists.xensource.com,
	Mojiong Qiu <mjqiu@tencent.com>, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	"at least to 3.0.y" <stable@kernel.org>
Subject: Re: [Xen-devel] [PATCH] xen/events: xen/events: fix RCU warning
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 06, 2012 at 04:08:15PM +0800, Mojiong Qiu wrote:
> exit_idle() should be called after irq_enter(), otherwise it throws:

That seems odd - wouldn't "smp_x86_platform_ipi"
also need the same treatment [edit: I was looking at 3.0 kernel code] ?

Ah, this is caused by

commit 98ad1cc14a5c4fd658f9d72c6ba5c86dfd3ce0d5
Author: Frederic Weisbecker <fweisbec@gmail.com>
Date:   Fri Oct 7 18:22:09 2011 +0200

    x86: Call idle notifier after irq_enter()
    

and it missed the xen-case

which means that any kernel v3.3 and newer need this, but earlier do
not.

Thx. Will put in 3.7 tree.

> 
> [    2.513020] [ INFO: suspicious RCU usage. ]
> [    2.513076] 3.6.5 #1 Not tainted
> [    2.513128] -------------------------------
> [    2.513183] include/linux/rcupdate.h:725 rcu_read_lock() used illegally while idle!
> [    2.513271]
> [    2.513271] other info that might help us debug this:
> [    2.513271]
> [    2.513388]
> [    2.513388] RCU used illegally from idle CPU!
> [    2.513388] rcu_scheduler_active = 1, debug_locks = 1
> [    2.513511] RCU used illegally from extended quiescent state!
> [    2.513572] 1 lock held by swapper/0/0:
> [    2.513626]  #0:  (rcu_read_lock){......}, at: [<ffffffff810e9fe0>] __atomic_notifier_call_chain+0x0/0x140
> [    2.513815]
> [    2.513815] stack backtrace:
> [    2.513897] Pid: 0, comm: swapper/0 Not tainted 3.6.5 #1
> [    2.513954] Call Trace:
> [    2.514005]  <IRQ>  [<ffffffff811259a2>] lockdep_rcu_suspicious+0xe2/0x130
> [    2.514107]  [<ffffffff810ea10c>] __atomic_notifier_call_chain+0x12c/0x140
> [    2.514169]  [<ffffffff810e9fe0>] ? atomic_notifier_chain_unregister+0x90/0x90
> [    2.514258]  [<ffffffff811216cd>] ? trace_hardirqs_off+0xd/0x10
> [    2.514318]  [<ffffffff810ea136>] atomic_notifier_call_chain+0x16/0x20
> [    2.514381]  [<ffffffff810777c3>] exit_idle+0x43/0x50
> [    2.514441]  [<ffffffff81568865>] xen_evtchn_do_upcall+0x25/0x50
> [    2.514503]  [<ffffffff81aa690e>] xen_do_hypervisor_callback+0x1e/0x30
> [    2.514562]  <EOI>  [<ffffffff810013aa>] ? hypercall_page+0x3aa/0x1000
> [    2.514662]  [<ffffffff810013aa>] ? hypercall_page+0x3aa/0x1000
> [    2.514722]  [<ffffffff81061540>] ? xen_safe_halt+0x10/0x20
> [    2.514782]  [<ffffffff81075cfa>] ? default_idle+0xba/0x570
> [    2.514841]  [<ffffffff810778af>] ? cpu_idle+0xdf/0x140
> [    2.514900]  [<ffffffff81a4d881>] ? rest_init+0x135/0x144
> [    2.514960]  [<ffffffff81a4d74c>] ? csum_partial_copy_generic+0x16c/0x16c
> [    2.515022]  [<ffffffff82520c45>] ? start_kernel+0x3db/0x3e8
> [    2.515081]  [<ffffffff8252066a>] ? repair_env_string+0x5a/0x5a
> [    2.515141]  [<ffffffff82520356>] ? x86_64_start_reservations+0x131/0x135
> [    2.515202]  [<ffffffff82524aca>] ? xen_start_kernel+0x465/0x46
> 
> Signed-off-by: Mojiong Qiu <mjqiu@tencent.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
> Cc: xen-devel@lists.xensource.com
> Cc: virtualization@lists.linux-foundation.org
> Cc: linux-kernel@vger.kernel.org
> Cc: stable@kernel.org (at least to 3.0.y)
             ^^^- vger.kernel.org

You mean 3.3.x

> ---
>  drivers/xen/events.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
> index 912ac81..0be4df3 100644
> --- a/drivers/xen/events.c
> +++ b/drivers/xen/events.c
> @@ -1395,10 +1395,10 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
>  {
>  	struct pt_regs *old_regs = set_irq_regs(regs);
>  
> +	irq_enter();
>  #ifdef CONFIG_X86
>  	exit_idle();
>  #endif
> -	irq_enter();
>  
>  	__xen_evtchn_do_upcall();
>  
> -- 
> 1.6.3.2

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 16:46:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 16:46:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVmHd-0002q3-LB; Tue, 06 Nov 2012 16:45:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lukas@laukamp.me>) id 1TVmHb-0002pr-Vv
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 16:45:48 +0000
Received: from [85.158.137.99:29567] by server-5.bemta-3.messagelabs.com id
	36/4A-26311-ABE39905; Tue, 06 Nov 2012 16:45:46 +0000
X-Env-Sender: lukas@laukamp.me
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352220345!17877770!1
X-Originating-IP: [5.9.218.245]
X-SpamReason: No, hits=0.2 required=7.0 tests=RCVD_ILLEGAL_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18793 invoked from network); 6 Nov 2012 16:45:45 -0000
Received: from mailer0.lippux.de (HELO mailer0.lippux.de) (5.9.218.245)
	by server-14.tower-217.messagelabs.com with SMTP;
	6 Nov 2012 16:45:45 -0000
Received: from localhost (localhost [127.0.0.1])
	by mailer0.lippux.de (Postfix) with ESMTP id 7C1B02C205;
	Tue,  6 Nov 2012 17:45:43 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at mailer1.lippux.de
Received: from mailer0.lippux.de ([127.0.0.1])
	by localhost (mailer0.lippux.de [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id tn5SWoBDanWJ; Tue,  6 Nov 2012 17:45:42 +0100 (CET)
Received: from [192.168.25.10] (ashlynn.lippux.de [5.9.218.242])
	by mailer0.lippux.de (Postfix) with ESMTPSA id 47F242C1EF;
	Tue,  6 Nov 2012 17:45:41 +0100 (CET)
Message-ID: <50993EAE.5040301@laukamp.me>
Date: Tue, 06 Nov 2012 17:45:34 +0100
From: Lukas Laukamp <lukas@laukamp.me>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <ian.campbell@citrix.com>
References: <50991C68.4070103@laukamp.me>
	<1352213764.12977.8.camel@hastur.hellion.org.uk>
In-Reply-To: <1352213764.12977.8.camel@hastur.hellion.org.uk>
Cc: "xen-users@lists.xen.org" <xen-users@lists.xen.org>,
	xen-devel <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [User Problem/Possible Bug] Possible PyGrub Bug
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Am 06.11.2012 15:56, schrieb Ian Campbell:
> On Tue, 2012-11-06 at 14:19 +0000, Lukas Laukamp wrote:
>> Hello all,
>>
>> I compiled latest Xen 4.2 stable with deb target on Debian Squeeze. Now
>> PyGrub seems to be damaged. It fails with following issue:
>>
>> Traceback (most recent call last):
>>     File "/usr/lib/xen/bin/pygrub", line 20, in <module>
>>       import xen.lowlevel.xc
>> ImportError: No module named xen.lowlevel.xc
>>
>> So I don't know if this is a bug or a normal issue. I sent this mail to
>> the user and devel list.
> In general please don't cross post. If you are unsure then the user list
> is the best starting point.
>
>>   How could this problem be fixed or does I need
>> to wait for a patch?
> This issue is described on the wiki. Please see
> http://wiki.xen.org/wiki/Compiling_Xen_From_Source#Python_Prefix_and_Module_Layout
>
>> Best Regards
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
Hello all,

I recompiled and build the deb package with that option. Now everything 
is fine. So thanks for the fast reply and sorry for my mistake.

Best Regards

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 16:46:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 16:46:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVmHd-0002q3-LB; Tue, 06 Nov 2012 16:45:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lukas@laukamp.me>) id 1TVmHb-0002pr-Vv
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 16:45:48 +0000
Received: from [85.158.137.99:29567] by server-5.bemta-3.messagelabs.com id
	36/4A-26311-ABE39905; Tue, 06 Nov 2012 16:45:46 +0000
X-Env-Sender: lukas@laukamp.me
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352220345!17877770!1
X-Originating-IP: [5.9.218.245]
X-SpamReason: No, hits=0.2 required=7.0 tests=RCVD_ILLEGAL_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18793 invoked from network); 6 Nov 2012 16:45:45 -0000
Received: from mailer0.lippux.de (HELO mailer0.lippux.de) (5.9.218.245)
	by server-14.tower-217.messagelabs.com with SMTP;
	6 Nov 2012 16:45:45 -0000
Received: from localhost (localhost [127.0.0.1])
	by mailer0.lippux.de (Postfix) with ESMTP id 7C1B02C205;
	Tue,  6 Nov 2012 17:45:43 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at mailer1.lippux.de
Received: from mailer0.lippux.de ([127.0.0.1])
	by localhost (mailer0.lippux.de [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id tn5SWoBDanWJ; Tue,  6 Nov 2012 17:45:42 +0100 (CET)
Received: from [192.168.25.10] (ashlynn.lippux.de [5.9.218.242])
	by mailer0.lippux.de (Postfix) with ESMTPSA id 47F242C1EF;
	Tue,  6 Nov 2012 17:45:41 +0100 (CET)
Message-ID: <50993EAE.5040301@laukamp.me>
Date: Tue, 06 Nov 2012 17:45:34 +0100
From: Lukas Laukamp <lukas@laukamp.me>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <ian.campbell@citrix.com>
References: <50991C68.4070103@laukamp.me>
	<1352213764.12977.8.camel@hastur.hellion.org.uk>
In-Reply-To: <1352213764.12977.8.camel@hastur.hellion.org.uk>
Cc: "xen-users@lists.xen.org" <xen-users@lists.xen.org>,
	xen-devel <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [User Problem/Possible Bug] Possible PyGrub Bug
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Am 06.11.2012 15:56, schrieb Ian Campbell:
> On Tue, 2012-11-06 at 14:19 +0000, Lukas Laukamp wrote:
>> Hello all,
>>
>> I compiled latest Xen 4.2 stable with deb target on Debian Squeeze. Now
>> PyGrub seems to be damaged. It fails with following issue:
>>
>> Traceback (most recent call last):
>>     File "/usr/lib/xen/bin/pygrub", line 20, in <module>
>>       import xen.lowlevel.xc
>> ImportError: No module named xen.lowlevel.xc
>>
>> So I don't know if this is a bug or a normal issue. I sent this mail to
>> the user and devel list.
> In general please don't cross post. If you are unsure then the user list
> is the best starting point.
>
>>   How could this problem be fixed or does I need
>> to wait for a patch?
> This issue is described on the wiki. Please see
> http://wiki.xen.org/wiki/Compiling_Xen_From_Source#Python_Prefix_and_Module_Layout
>
>> Best Regards
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
Hello all,

I recompiled and build the deb package with that option. Now everything 
is fine. So thanks for the fast reply and sorry for my mistake.

Best Regards

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 16:56:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 16:56:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVmRU-00038Z-TU; Tue, 06 Nov 2012 16:56:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TVmRT-00038U-RZ
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 16:56:00 +0000
Received: from [85.158.139.211:34641] by server-11.bemta-5.messagelabs.com id
	6E/C0-03409-F1149905; Tue, 06 Nov 2012 16:55:59 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1352220957!18685794!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0MTM4Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3224 invoked from network); 6 Nov 2012 16:55:58 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 16:55:58 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6Gtmn4006531
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 16:55:49 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6Gtl1N013856
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 16:55:48 GMT
Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6GtkLX005505; Tue, 6 Nov 2012 10:55:47 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 06 Nov 2012 08:55:46 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id C13D04042D; Tue,  6 Nov 2012 11:43:03 -0500 (EST)
Date: Tue, 6 Nov 2012 11:43:03 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Message-ID: <20121106164303.GO9966@phenom.dumpdata.com>
References: <DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
	<alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537B147@SHSMSX101.ccr.corp.intel.com>
	<alpine.DEB.2.02.1211061455150.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B479@SHSMSX101.ccr.corp.intel.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233537B479@SHSMSX101.ccr.corp.intel.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 06, 2012 at 04:23:57PM +0000, Liu, Jinsong wrote:
> Stefano Stabellini wrote:
> > On Tue, 6 Nov 2012, Liu, Jinsong wrote:
> >> Liu, Jinsong wrote:
> >>> Stefano Stabellini wrote:
> >>>>>> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> >>>>>> index 0e86370..a2af622 100644
> >>>>>> --- a/drivers/xen/Makefile
> >>>>>> +++ b/drivers/xen/Makefile
> >>>>>> @@ -29,6 +29,7 @@ obj-$(CONFIG_XEN_MCE_LOG)           += mcelog.o
> >>>>>>  obj-$(CONFIG_XEN_PCIDEV_BACKEND)     += xen-pciback/
> >>>>>>  obj-$(CONFIG_XEN_PRIVCMD)            += xen-privcmd.o
> >>>>>>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)     += xen-acpi-processor.o
> >>>>>> +obj-$(CONFIG_XEN_DOM0)                       += xen_acpi_pad.o
> >>>>>>  xen-evtchn-y                         := evtchn.o
> >>>>>>  xen-gntdev-y                         := gntdev.o
> >>>>>>  xen-gntalloc-y                               := gntalloc.o
> >>>> 
> >>>> it should really depend on ACPI and maybe also X86, otherwise it
> >>>> is going to break the ARM build 
> >>>> 
> >>>> 
> >>> 
> >>> Hmm, XEN_DOM0 has already depended on ACPI and X86_LOCAL_APIC
> >>> (which depends on X86_64). 
> >>> 
> >> 
> >> Ah, you and Konrad are right. I ignore XEN_DOM0 varies under
> >> different arch. (But seems it not depends on X86 since it's
> >> logically an acpi stuff?). 
> > 
> > If it is generic ACPI code, than it can depend only on ACPI.
> > If it is ACPI code that contains X86 specific info, than it needs to
> > depend on X86 too.
> 
> No x86 specific so let's depend on ACPI.

Huh? This feature is x86 specific isn't it? I mean it is in the ACPI spec, but
only x86 does it right?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 16:56:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 16:56:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVmRU-00038Z-TU; Tue, 06 Nov 2012 16:56:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TVmRT-00038U-RZ
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 16:56:00 +0000
Received: from [85.158.139.211:34641] by server-11.bemta-5.messagelabs.com id
	6E/C0-03409-F1149905; Tue, 06 Nov 2012 16:55:59 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1352220957!18685794!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0MTM4Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3224 invoked from network); 6 Nov 2012 16:55:58 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 16:55:58 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6Gtmn4006531
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 16:55:49 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6Gtl1N013856
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 16:55:48 GMT
Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6GtkLX005505; Tue, 6 Nov 2012 10:55:47 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 06 Nov 2012 08:55:46 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id C13D04042D; Tue,  6 Nov 2012 11:43:03 -0500 (EST)
Date: Tue, 6 Nov 2012 11:43:03 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Message-ID: <20121106164303.GO9966@phenom.dumpdata.com>
References: <DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
	<alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537B147@SHSMSX101.ccr.corp.intel.com>
	<alpine.DEB.2.02.1211061455150.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B479@SHSMSX101.ccr.corp.intel.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233537B479@SHSMSX101.ccr.corp.intel.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 06, 2012 at 04:23:57PM +0000, Liu, Jinsong wrote:
> Stefano Stabellini wrote:
> > On Tue, 6 Nov 2012, Liu, Jinsong wrote:
> >> Liu, Jinsong wrote:
> >>> Stefano Stabellini wrote:
> >>>>>> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> >>>>>> index 0e86370..a2af622 100644
> >>>>>> --- a/drivers/xen/Makefile
> >>>>>> +++ b/drivers/xen/Makefile
> >>>>>> @@ -29,6 +29,7 @@ obj-$(CONFIG_XEN_MCE_LOG)           += mcelog.o
> >>>>>>  obj-$(CONFIG_XEN_PCIDEV_BACKEND)     += xen-pciback/
> >>>>>>  obj-$(CONFIG_XEN_PRIVCMD)            += xen-privcmd.o
> >>>>>>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)     += xen-acpi-processor.o
> >>>>>> +obj-$(CONFIG_XEN_DOM0)                       += xen_acpi_pad.o
> >>>>>>  xen-evtchn-y                         := evtchn.o
> >>>>>>  xen-gntdev-y                         := gntdev.o
> >>>>>>  xen-gntalloc-y                               := gntalloc.o
> >>>> 
> >>>> it should really depend on ACPI and maybe also X86, otherwise it
> >>>> is going to break the ARM build 
> >>>> 
> >>>> 
> >>> 
> >>> Hmm, XEN_DOM0 has already depended on ACPI and X86_LOCAL_APIC
> >>> (which depends on X86_64). 
> >>> 
> >> 
> >> Ah, you and Konrad are right. I ignore XEN_DOM0 varies under
> >> different arch. (But seems it not depends on X86 since it's
> >> logically an acpi stuff?). 
> > 
> > If it is generic ACPI code, than it can depend only on ACPI.
> > If it is ACPI code that contains X86 specific info, than it needs to
> > depend on X86 too.
> 
> No x86 specific so let's depend on ACPI.

Huh? This feature is x86 specific isn't it? I mean it is in the ACPI spec, but
only x86 does it right?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 17:58:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 17:58:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVnPf-0004on-Hz; Tue, 06 Nov 2012 17:58:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux+xen-devel=lists.xensource.com@arm.linux.org.uk>)
	id 1TVnPe-0004of-B1
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 17:58:10 +0000
Received: from [85.158.138.51:40840] by server-2.bemta-3.messagelabs.com id
	7F/87-04744-1BF49905; Tue, 06 Nov 2012 17:58:09 +0000
X-Env-Sender: linux+xen-devel=lists.xensource.com@arm.linux.org.uk
X-Msg-Ref: server-10.tower-174.messagelabs.com!1352224687!24914953!1
X-Originating-IP: [78.32.30.218]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25540 invoked from network); 6 Nov 2012 17:58:08 -0000
Received: from caramon.arm.linux.org.uk (HELO caramon.arm.linux.org.uk)
	(78.32.30.218)
	by server-10.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 6 Nov 2012 17:58:08 -0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=arm.linux.org.uk; s=caramon; 
	h=Sender:Content-Type:MIME-Version:Message-ID:Subject:Cc:To:From:Date;
	bh=z4VDZOloZSwj7JTf1QJlUs7iFVBwOBa73KrdHjjP2lI=; 
	b=c7RbasFWKFzEsDJs7zgUhTnev7E03HcUxgtE6IdpibeWsitqnqhzSLMX9+cllwjqHbIdnEAxHV/ACHVgWwdDYZJe6zjFalpm6NfjzmZDteY2z7b1i3bsbaCwFBMjGwdlbkSXeE1P1+wW7LMH+xz9TyZzSnIB05AZ+MGPMfAIV9g=;
Received: from n2100.arm.linux.org.uk
	([2002:4e20:1eda:1:214:fdff:fe10:4f86]:36046)
	by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.76) (envelope-from <linux@arm.linux.org.uk>)
	id 1TVnPK-0003zB-Kt; Tue, 06 Nov 2012 17:57:50 +0000
Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76)
	(envelope-from <linux@n2100.arm.linux.org.uk>)
	id 1TVnPJ-0007kX-GC; Tue, 06 Nov 2012 17:57:49 +0000
Date: Tue, 6 Nov 2012 17:57:49 +0000
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	xen-devel@lists.xensource.com
Message-ID: <20121106175749.GO28327@n2100.arm.linux.org.uk>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.19 (2009-01-05)
Cc: arm@kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [Xen-devel] BUG: ARM build failures due to Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

My build system is giving me the following errors against an OMAP4
randconfig build against the latest Linus' kernel plus arm-soc:

ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
make[2]: *** [__modpost] Error 1
make[2]: Target `_modpost' not remade because of errors.
make[1]: *** [modules] Error 2
make: *** [sub-make] Error 2
make: Target `uImage' not remade because of errors.
make: Target `modules' not remade because of errors.

Full build results and configuration are here:

http://www.arm.linux.org.uk/developer/build/result.php?type=build&idx=2627
http://www.arm.linux.org.uk/developer/build/file.php?type=config&idx=2627

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 17:58:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 17:58:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVnPf-0004on-Hz; Tue, 06 Nov 2012 17:58:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux+xen-devel=lists.xensource.com@arm.linux.org.uk>)
	id 1TVnPe-0004of-B1
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 17:58:10 +0000
Received: from [85.158.138.51:40840] by server-2.bemta-3.messagelabs.com id
	7F/87-04744-1BF49905; Tue, 06 Nov 2012 17:58:09 +0000
X-Env-Sender: linux+xen-devel=lists.xensource.com@arm.linux.org.uk
X-Msg-Ref: server-10.tower-174.messagelabs.com!1352224687!24914953!1
X-Originating-IP: [78.32.30.218]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25540 invoked from network); 6 Nov 2012 17:58:08 -0000
Received: from caramon.arm.linux.org.uk (HELO caramon.arm.linux.org.uk)
	(78.32.30.218)
	by server-10.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 6 Nov 2012 17:58:08 -0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=arm.linux.org.uk; s=caramon; 
	h=Sender:Content-Type:MIME-Version:Message-ID:Subject:Cc:To:From:Date;
	bh=z4VDZOloZSwj7JTf1QJlUs7iFVBwOBa73KrdHjjP2lI=; 
	b=c7RbasFWKFzEsDJs7zgUhTnev7E03HcUxgtE6IdpibeWsitqnqhzSLMX9+cllwjqHbIdnEAxHV/ACHVgWwdDYZJe6zjFalpm6NfjzmZDteY2z7b1i3bsbaCwFBMjGwdlbkSXeE1P1+wW7LMH+xz9TyZzSnIB05AZ+MGPMfAIV9g=;
Received: from n2100.arm.linux.org.uk
	([2002:4e20:1eda:1:214:fdff:fe10:4f86]:36046)
	by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.76) (envelope-from <linux@arm.linux.org.uk>)
	id 1TVnPK-0003zB-Kt; Tue, 06 Nov 2012 17:57:50 +0000
Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76)
	(envelope-from <linux@n2100.arm.linux.org.uk>)
	id 1TVnPJ-0007kX-GC; Tue, 06 Nov 2012 17:57:49 +0000
Date: Tue, 6 Nov 2012 17:57:49 +0000
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	xen-devel@lists.xensource.com
Message-ID: <20121106175749.GO28327@n2100.arm.linux.org.uk>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.19 (2009-01-05)
Cc: arm@kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [Xen-devel] BUG: ARM build failures due to Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

My build system is giving me the following errors against an OMAP4
randconfig build against the latest Linus' kernel plus arm-soc:

ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
make[2]: *** [__modpost] Error 1
make[2]: Target `_modpost' not remade because of errors.
make[1]: *** [modules] Error 2
make: *** [sub-make] Error 2
make: Target `uImage' not remade because of errors.
make: Target `modules' not remade because of errors.

Full build results and configuration are here:

http://www.arm.linux.org.uk/developer/build/result.php?type=build&idx=2627
http://www.arm.linux.org.uk/developer/build/file.php?type=config&idx=2627

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 18:41:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 18:41:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVo5K-0005Co-9e; Tue, 06 Nov 2012 18:41:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <shuahkhan@gmail.com>) id 1TVnss-00059u-I0
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 18:28:22 +0000
Received: from [85.158.139.83:40667] by server-15.bemta-5.messagelabs.com id
	34/60-26920-5C659905; Tue, 06 Nov 2012 18:28:21 +0000
X-Env-Sender: shuahkhan@gmail.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1352226498!24775229!1
X-Originating-IP: [209.85.160.43]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26574 invoked from network); 6 Nov 2012 18:28:20 -0000
Received: from mail-pb0-f43.google.com (HELO mail-pb0-f43.google.com)
	(209.85.160.43)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 18:28:20 -0000
Received: by mail-pb0-f43.google.com with SMTP id jt11so649007pbb.30
	for <xen-devel@lists.xensource.com>;
	Tue, 06 Nov 2012 10:28:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=tnkNvYqJe3tEgVltCiab7M7blJ+adbV+yHBoLAP5uU4=;
	b=ZVAd8+EkcaHb2MHV/O98c/NHch0qujRyxnpfVw3BSLWAXatrBFk5n68xySvUDjp46s
	OaKluPmOcqbkPGuARkFhl4pVlEBQ/+f3mVrK/TcurxcPSsLluyEMeb93jcU/DXzcpIRh
	9DRRICoE81OrcVRTe4+4E9pP72ZuMsGr8glm5CZ9oKkrCupP7lwPv6k/iFeR2fyDxbu0
	zW684iYYit2RY9EASdu98TFGxeEbTBeXUY7Kd6JW9x4Xks/J63d6PGSxGhDEuTuJqQMT
	EOj+FVPkXfUSK5ZzK207qDrbsZnPkK6sztKkiOdJ07UvVWFuAa0P2bZgxMNpLrhn96BL
	rPIg==
MIME-Version: 1.0
Received: by 10.68.195.9 with SMTP id ia9mr5901027pbc.74.1352226498399; Tue,
	06 Nov 2012 10:28:18 -0800 (PST)
Received: by 10.68.73.69 with HTTP; Tue, 6 Nov 2012 10:28:18 -0800 (PST)
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
Date: Tue, 6 Nov 2012 11:28:18 -0700
Message-ID: <CAKocOONye3HDcuxOyOLqD=Z=EkESzQb0FNanbUJeyLJJVCDWdw@mail.gmail.com>
From: Shuah Khan <shuahkhan@gmail.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
X-Mailman-Approved-At: Tue, 06 Nov 2012 18:41:13 +0000
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Oct 25, 2012 at 6:19 AM, Liu, Jinsong <jinsong.liu@intel.com> wrote:
> From f233ad06cf924116693d7d38be9ae9d8c11f8a9b Mon Sep 17 00:00:00 2001
> From: Liu, Jinsong <jinsong.liu@intel.com>
> Date: Fri, 26 Oct 2012 02:32:48 +0800
> Subject: [PATCH 1/2] Xen acpi pad implement
>
> PAD is acpi Processor Aggregator Device which provides a control point
> that enables the platform to perform specific processor configuration
> and control that applies to all processors in the platform.
>
> This patch is to implement Xen acpi pad logic. When running under Xen
> virt platform, native pad driver would not work. Instead Xen pad driver,
> a self-contained and very thin logic level, would take over acpi pad staff.

"logic" instead of staff (guessing this is supposed to stuff)

> When acpi pad notify OSPM, xen pad logic intercept and parse _PUR object
> and then hypercall to hyervisor for the rest work, say, core parking.
hypervisor
rest of the work? - could you add more details on what is handled by
this think PAD driver and what would be left to the host pad driver.
>
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
> ---
>  drivers/xen/Makefile             |    1 +
>  drivers/xen/xen_acpi_pad.c       |  173 ++++++++++++++++++++++++++++++++++++++
>  include/xen/interface/platform.h |   17 ++++
>  3 files changed, 191 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/xen/xen_acpi_pad.c
>
> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> index 0e86370..a2af622 100644
> --- a/drivers/xen/Makefile
> +++ b/drivers/xen/Makefile
> @@ -29,6 +29,7 @@ obj-$(CONFIG_XEN_MCE_LOG)             += mcelog.o
>  obj-$(CONFIG_XEN_PCIDEV_BACKEND)       += xen-pciback/
>  obj-$(CONFIG_XEN_PRIVCMD)              += xen-privcmd.o
>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)       += xen-acpi-processor.o
> +obj-$(CONFIG_XEN_DOM0)                 += xen_acpi_pad.o
>  xen-evtchn-y                           := evtchn.o
>  xen-gntdev-y                           := gntdev.o
>  xen-gntalloc-y                         := gntalloc.o
> diff --git a/drivers/xen/xen_acpi_pad.c b/drivers/xen/xen_acpi_pad.c
> new file mode 100644
> index 0000000..e7b7dca
> --- /dev/null
> +++ b/drivers/xen/xen_acpi_pad.c
> @@ -0,0 +1,173 @@
> +/*
> + * xen_acpi_pad.c - Xen pad interface
> + *
> + * Copyright (c) 2012, Intel Corporation.
> + *    Author: Liu, Jinsong <jinsong.liu@intel.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope it will be useful, but WITHOUT
> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
> + * more details.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/types.h>
> +#include <acpi/acpi_bus.h>
> +#include <acpi/acpi_drivers.h>
> +#include <asm/xen/hypercall.h>
> +
> +#if defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR) || \
> +               defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR_MODULE)
> +
> +#define ACPI_PROCESSOR_AGGREGATOR_CLASS        "acpi_pad"
> +#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
> +#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
> +
> +static int xen_acpi_pad_idle_cpus(int *num_cpus)
> +{
> +       int ret;
> +
> +       struct xen_platform_op op = {
> +               .cmd = XENPF_core_parking,
> +               .interface_version = XENPF_INTERFACE_VERSION,
> +       };
> +
> +       /* set cpu nums expected to be idled */
> +       op.u.core_parking.type = XEN_CORE_PARKING_SET;
> +       op.u.core_parking.idle_nums = (uint32_t)*num_cpus;
> +       ret = HYPERVISOR_dom0_op(&op);
> +       if (ret)
> +               return ret;
> +
> +       /*
> +        * get cpu nums actually be idled
> +        * cannot get it by using hypercall once (shared with _SET)
> +        * because of the characteristic of Xen continue_hypercall_on_cpu
> +        */
> +       op.u.core_parking.type = XEN_CORE_PARKING_GET;
> +       ret = HYPERVISOR_dom0_op(&op);
> +       if (ret)
> +               return ret;
> +
> +       *num_cpus = op.u.core_parking.idle_nums;
> +       return 0;
> +}
> +
> +/*
> + * Query firmware how many CPUs should be idle
> + * return -1 on failure
> + */
> +static int xen_acpi_pad_pur(acpi_handle handle)
> +{
> +       struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
> +       union acpi_object *package;
> +       int num = -1;
> +
> +       if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))
> +               return num;
> +
> +       if (!buffer.length || !buffer.pointer)
> +               return num;
> +
> +       package = buffer.pointer;
> +
> +       if (package->type == ACPI_TYPE_PACKAGE &&
> +               package->package.count == 2 &&
> +               package->package.elements[0].integer.value == 1) /* rev 1 */
> +
> +               num = package->package.elements[1].integer.value;
> +
> +       kfree(buffer.pointer);
> +       return num;
> +}
> +
> +/* Notify firmware how many CPUs are idle */
> +static void xen_acpi_pad_ost(acpi_handle handle, int stat,
> +       uint32_t idle_cpus)
> +{
> +       union acpi_object params[3] = {
> +               {.type = ACPI_TYPE_INTEGER,},
> +               {.type = ACPI_TYPE_INTEGER,},
> +               {.type = ACPI_TYPE_BUFFER,},
> +       };
> +       struct acpi_object_list arg_list = {3, params};
> +
> +       params[0].integer.value = ACPI_PROCESSOR_AGGREGATOR_NOTIFY;
> +       params[1].integer.value =  stat;
> +       params[2].buffer.length = 4;
> +       params[2].buffer.pointer = (void *)&idle_cpus;
> +       acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
> +}
> +
> +static void xen_acpi_pad_handle_notify(acpi_handle handle)
> +{
> +       int ret, num_cpus;
> +
> +       num_cpus = xen_acpi_pad_pur(handle);
> +       if (num_cpus < 0)
> +               return;
> +
> +       ret = xen_acpi_pad_idle_cpus(&num_cpus);
> +       if (ret)
> +               return;
> +
> +       xen_acpi_pad_ost(handle, 0, num_cpus);
> +}
> +
> +static void xen_acpi_pad_notify(acpi_handle handle, u32 event,
> +       void *data)
> +{
> +       switch (event) {
> +       case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
> +               xen_acpi_pad_handle_notify(handle);
> +               break;
> +       default:
> +               pr_warn("Unsupported event [0x%x]\n", event);
> +               break;
> +       }
> +}
> +
> +static int xen_acpi_pad_add(struct acpi_device *device)
> +{
> +       acpi_status status;
> +
> +       strcpy(acpi_device_name(device), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
> +       strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);
> +
> +       status = acpi_install_notify_handler(device->handle,
> +                ACPI_DEVICE_NOTIFY, xen_acpi_pad_notify, device);
> +       if (ACPI_FAILURE(status))
> +               return -ENODEV;
> +
> +       return 0;
> +}
> +
> +static const struct acpi_device_id pad_device_ids[] = {
> +       {"ACPI000C", 0},
> +       {"", 0},
> +};
> +
> +static struct acpi_driver xen_acpi_pad_driver = {
> +       .name = "processor_aggregator",
> +       .class = ACPI_PROCESSOR_AGGREGATOR_CLASS,
> +       .ids = pad_device_ids,
> +       .ops = {
> +               .add = xen_acpi_pad_add,
> +       },
> +};
> +
> +static int __init xen_acpi_pad_init(void)
> +{
> +       /* Only DOM0 is responsible for Xen acpi pad */
> +       if (xen_initial_domain())
> +               return acpi_bus_register_driver(&xen_acpi_pad_driver);
> +
> +       return -ENODEV;
> +}
> +subsys_initcall(xen_acpi_pad_init);
> +
> +#endif
> diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
> index 4755b5f..0f44376 100644
> --- a/include/xen/interface/platform.h
> +++ b/include/xen/interface/platform.h
> @@ -324,6 +324,22 @@ struct xenpf_cpu_ol {
>  };
>  DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
>
> +/*
> + * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd,
> + * which already occupied at Xen hypervisor side.
> + */
> +#define XENPF_core_parking     60
> +struct xenpf_core_parking {
> +       /* IN variables */
> +#define XEN_CORE_PARKING_SET   1
> +#define XEN_CORE_PARKING_GET   2
> +       uint32_t type;
> +       /* IN variables:  set cpu nums expected to be idled */
> +       /* OUT variables: get cpu nums actually be idled */
> +       uint32_t idle_nums;
> +};
> +DEFINE_GUEST_HANDLE_STRUCT(xenpf_core_parking);
> +
>  struct xen_platform_op {
>         uint32_t cmd;
>         uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
> @@ -341,6 +357,7 @@ struct xen_platform_op {
>                 struct xenpf_set_processor_pminfo set_pminfo;
>                 struct xenpf_pcpuinfo          pcpu_info;
>                 struct xenpf_cpu_ol            cpu_ol;
> +               struct xenpf_core_parking      core_parking;
>                 uint8_t                        pad[128];
>         } u;
>  };
> --
> 1.7.1

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 18:41:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 18:41:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVo5K-0005Co-9e; Tue, 06 Nov 2012 18:41:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <shuahkhan@gmail.com>) id 1TVnss-00059u-I0
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 18:28:22 +0000
Received: from [85.158.139.83:40667] by server-15.bemta-5.messagelabs.com id
	34/60-26920-5C659905; Tue, 06 Nov 2012 18:28:21 +0000
X-Env-Sender: shuahkhan@gmail.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1352226498!24775229!1
X-Originating-IP: [209.85.160.43]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26574 invoked from network); 6 Nov 2012 18:28:20 -0000
Received: from mail-pb0-f43.google.com (HELO mail-pb0-f43.google.com)
	(209.85.160.43)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 18:28:20 -0000
Received: by mail-pb0-f43.google.com with SMTP id jt11so649007pbb.30
	for <xen-devel@lists.xensource.com>;
	Tue, 06 Nov 2012 10:28:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=tnkNvYqJe3tEgVltCiab7M7blJ+adbV+yHBoLAP5uU4=;
	b=ZVAd8+EkcaHb2MHV/O98c/NHch0qujRyxnpfVw3BSLWAXatrBFk5n68xySvUDjp46s
	OaKluPmOcqbkPGuARkFhl4pVlEBQ/+f3mVrK/TcurxcPSsLluyEMeb93jcU/DXzcpIRh
	9DRRICoE81OrcVRTe4+4E9pP72ZuMsGr8glm5CZ9oKkrCupP7lwPv6k/iFeR2fyDxbu0
	zW684iYYit2RY9EASdu98TFGxeEbTBeXUY7Kd6JW9x4Xks/J63d6PGSxGhDEuTuJqQMT
	EOj+FVPkXfUSK5ZzK207qDrbsZnPkK6sztKkiOdJ07UvVWFuAa0P2bZgxMNpLrhn96BL
	rPIg==
MIME-Version: 1.0
Received: by 10.68.195.9 with SMTP id ia9mr5901027pbc.74.1352226498399; Tue,
	06 Nov 2012 10:28:18 -0800 (PST)
Received: by 10.68.73.69 with HTTP; Tue, 6 Nov 2012 10:28:18 -0800 (PST)
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
Date: Tue, 6 Nov 2012 11:28:18 -0700
Message-ID: <CAKocOONye3HDcuxOyOLqD=Z=EkESzQb0FNanbUJeyLJJVCDWdw@mail.gmail.com>
From: Shuah Khan <shuahkhan@gmail.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
X-Mailman-Approved-At: Tue, 06 Nov 2012 18:41:13 +0000
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Oct 25, 2012 at 6:19 AM, Liu, Jinsong <jinsong.liu@intel.com> wrote:
> From f233ad06cf924116693d7d38be9ae9d8c11f8a9b Mon Sep 17 00:00:00 2001
> From: Liu, Jinsong <jinsong.liu@intel.com>
> Date: Fri, 26 Oct 2012 02:32:48 +0800
> Subject: [PATCH 1/2] Xen acpi pad implement
>
> PAD is acpi Processor Aggregator Device which provides a control point
> that enables the platform to perform specific processor configuration
> and control that applies to all processors in the platform.
>
> This patch is to implement Xen acpi pad logic. When running under Xen
> virt platform, native pad driver would not work. Instead Xen pad driver,
> a self-contained and very thin logic level, would take over acpi pad staff.

"logic" instead of staff (guessing this is supposed to stuff)

> When acpi pad notify OSPM, xen pad logic intercept and parse _PUR object
> and then hypercall to hyervisor for the rest work, say, core parking.
hypervisor
rest of the work? - could you add more details on what is handled by
this think PAD driver and what would be left to the host pad driver.
>
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
> ---
>  drivers/xen/Makefile             |    1 +
>  drivers/xen/xen_acpi_pad.c       |  173 ++++++++++++++++++++++++++++++++++++++
>  include/xen/interface/platform.h |   17 ++++
>  3 files changed, 191 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/xen/xen_acpi_pad.c
>
> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> index 0e86370..a2af622 100644
> --- a/drivers/xen/Makefile
> +++ b/drivers/xen/Makefile
> @@ -29,6 +29,7 @@ obj-$(CONFIG_XEN_MCE_LOG)             += mcelog.o
>  obj-$(CONFIG_XEN_PCIDEV_BACKEND)       += xen-pciback/
>  obj-$(CONFIG_XEN_PRIVCMD)              += xen-privcmd.o
>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)       += xen-acpi-processor.o
> +obj-$(CONFIG_XEN_DOM0)                 += xen_acpi_pad.o
>  xen-evtchn-y                           := evtchn.o
>  xen-gntdev-y                           := gntdev.o
>  xen-gntalloc-y                         := gntalloc.o
> diff --git a/drivers/xen/xen_acpi_pad.c b/drivers/xen/xen_acpi_pad.c
> new file mode 100644
> index 0000000..e7b7dca
> --- /dev/null
> +++ b/drivers/xen/xen_acpi_pad.c
> @@ -0,0 +1,173 @@
> +/*
> + * xen_acpi_pad.c - Xen pad interface
> + *
> + * Copyright (c) 2012, Intel Corporation.
> + *    Author: Liu, Jinsong <jinsong.liu@intel.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope it will be useful, but WITHOUT
> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
> + * more details.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/types.h>
> +#include <acpi/acpi_bus.h>
> +#include <acpi/acpi_drivers.h>
> +#include <asm/xen/hypercall.h>
> +
> +#if defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR) || \
> +               defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR_MODULE)
> +
> +#define ACPI_PROCESSOR_AGGREGATOR_CLASS        "acpi_pad"
> +#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
> +#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
> +
> +static int xen_acpi_pad_idle_cpus(int *num_cpus)
> +{
> +       int ret;
> +
> +       struct xen_platform_op op = {
> +               .cmd = XENPF_core_parking,
> +               .interface_version = XENPF_INTERFACE_VERSION,
> +       };
> +
> +       /* set cpu nums expected to be idled */
> +       op.u.core_parking.type = XEN_CORE_PARKING_SET;
> +       op.u.core_parking.idle_nums = (uint32_t)*num_cpus;
> +       ret = HYPERVISOR_dom0_op(&op);
> +       if (ret)
> +               return ret;
> +
> +       /*
> +        * get cpu nums actually be idled
> +        * cannot get it by using hypercall once (shared with _SET)
> +        * because of the characteristic of Xen continue_hypercall_on_cpu
> +        */
> +       op.u.core_parking.type = XEN_CORE_PARKING_GET;
> +       ret = HYPERVISOR_dom0_op(&op);
> +       if (ret)
> +               return ret;
> +
> +       *num_cpus = op.u.core_parking.idle_nums;
> +       return 0;
> +}
> +
> +/*
> + * Query firmware how many CPUs should be idle
> + * return -1 on failure
> + */
> +static int xen_acpi_pad_pur(acpi_handle handle)
> +{
> +       struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
> +       union acpi_object *package;
> +       int num = -1;
> +
> +       if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))
> +               return num;
> +
> +       if (!buffer.length || !buffer.pointer)
> +               return num;
> +
> +       package = buffer.pointer;
> +
> +       if (package->type == ACPI_TYPE_PACKAGE &&
> +               package->package.count == 2 &&
> +               package->package.elements[0].integer.value == 1) /* rev 1 */
> +
> +               num = package->package.elements[1].integer.value;
> +
> +       kfree(buffer.pointer);
> +       return num;
> +}
> +
> +/* Notify firmware how many CPUs are idle */
> +static void xen_acpi_pad_ost(acpi_handle handle, int stat,
> +       uint32_t idle_cpus)
> +{
> +       union acpi_object params[3] = {
> +               {.type = ACPI_TYPE_INTEGER,},
> +               {.type = ACPI_TYPE_INTEGER,},
> +               {.type = ACPI_TYPE_BUFFER,},
> +       };
> +       struct acpi_object_list arg_list = {3, params};
> +
> +       params[0].integer.value = ACPI_PROCESSOR_AGGREGATOR_NOTIFY;
> +       params[1].integer.value =  stat;
> +       params[2].buffer.length = 4;
> +       params[2].buffer.pointer = (void *)&idle_cpus;
> +       acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
> +}
> +
> +static void xen_acpi_pad_handle_notify(acpi_handle handle)
> +{
> +       int ret, num_cpus;
> +
> +       num_cpus = xen_acpi_pad_pur(handle);
> +       if (num_cpus < 0)
> +               return;
> +
> +       ret = xen_acpi_pad_idle_cpus(&num_cpus);
> +       if (ret)
> +               return;
> +
> +       xen_acpi_pad_ost(handle, 0, num_cpus);
> +}
> +
> +static void xen_acpi_pad_notify(acpi_handle handle, u32 event,
> +       void *data)
> +{
> +       switch (event) {
> +       case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
> +               xen_acpi_pad_handle_notify(handle);
> +               break;
> +       default:
> +               pr_warn("Unsupported event [0x%x]\n", event);
> +               break;
> +       }
> +}
> +
> +static int xen_acpi_pad_add(struct acpi_device *device)
> +{
> +       acpi_status status;
> +
> +       strcpy(acpi_device_name(device), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
> +       strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);
> +
> +       status = acpi_install_notify_handler(device->handle,
> +                ACPI_DEVICE_NOTIFY, xen_acpi_pad_notify, device);
> +       if (ACPI_FAILURE(status))
> +               return -ENODEV;
> +
> +       return 0;
> +}
> +
> +static const struct acpi_device_id pad_device_ids[] = {
> +       {"ACPI000C", 0},
> +       {"", 0},
> +};
> +
> +static struct acpi_driver xen_acpi_pad_driver = {
> +       .name = "processor_aggregator",
> +       .class = ACPI_PROCESSOR_AGGREGATOR_CLASS,
> +       .ids = pad_device_ids,
> +       .ops = {
> +               .add = xen_acpi_pad_add,
> +       },
> +};
> +
> +static int __init xen_acpi_pad_init(void)
> +{
> +       /* Only DOM0 is responsible for Xen acpi pad */
> +       if (xen_initial_domain())
> +               return acpi_bus_register_driver(&xen_acpi_pad_driver);
> +
> +       return -ENODEV;
> +}
> +subsys_initcall(xen_acpi_pad_init);
> +
> +#endif
> diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
> index 4755b5f..0f44376 100644
> --- a/include/xen/interface/platform.h
> +++ b/include/xen/interface/platform.h
> @@ -324,6 +324,22 @@ struct xenpf_cpu_ol {
>  };
>  DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
>
> +/*
> + * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd,
> + * which already occupied at Xen hypervisor side.
> + */
> +#define XENPF_core_parking     60
> +struct xenpf_core_parking {
> +       /* IN variables */
> +#define XEN_CORE_PARKING_SET   1
> +#define XEN_CORE_PARKING_GET   2
> +       uint32_t type;
> +       /* IN variables:  set cpu nums expected to be idled */
> +       /* OUT variables: get cpu nums actually be idled */
> +       uint32_t idle_nums;
> +};
> +DEFINE_GUEST_HANDLE_STRUCT(xenpf_core_parking);
> +
>  struct xen_platform_op {
>         uint32_t cmd;
>         uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
> @@ -341,6 +357,7 @@ struct xen_platform_op {
>                 struct xenpf_set_processor_pminfo set_pminfo;
>                 struct xenpf_pcpuinfo          pcpu_info;
>                 struct xenpf_cpu_ol            cpu_ol;
> +               struct xenpf_core_parking      core_parking;
>                 uint8_t                        pad[128];
>         } u;
>  };
> --
> 1.7.1

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 19:53:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 19:53:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVpCW-0005ZQ-8F; Tue, 06 Nov 2012 19:52:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TVpCT-0005ZL-SO
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 19:52:42 +0000
Received: from [85.158.137.99:13772] by server-7.bemta-3.messagelabs.com id
	8F/1C-01713-48A69905; Tue, 06 Nov 2012 19:52:36 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1352231553!14850071!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjY2OTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14666 invoked from network); 6 Nov 2012 19:52:35 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 19:52:35 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6JqCX5024514
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 19:52:13 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6Jq7rW004771
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 19:52:08 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6Jq5Dl011821; Tue, 6 Nov 2012 13:52:05 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 06 Nov 2012 11:52:04 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id E0D3E4042D; Tue,  6 Nov 2012 14:39:21 -0500 (EST)
Date: Tue, 6 Nov 2012 14:39:21 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121106193921.GC28473@phenom.dumpdata.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: jeremy@goop.org, xen-devel@lists.xensource.com,
	linux-kernel@vger.kernel.org, mail@srajiv.net,
	tpmdd-devel@lists.sourceforge.net, key@linux.vnet.ibm.com
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
	driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 05, 2012 at 10:09:57AM -0500, Matthew Fioravante wrote:
> This patch ports the xen vtpm frontend driver for linux
> from the linux-2.6.18-xen.hg tree to linux-stable.

So how does on test it ? Set it up? Use it? Is there some documentation
about it - if so it should be in the patch description.

I did a very very cursory look at it, see some of the comments.

> 
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> ---
>  drivers/char/tpm/Kconfig         |    9 +
>  drivers/char/tpm/Makefile        |    2 +
>  drivers/char/tpm/tpm.h           |   15 +
>  drivers/char/tpm/tpm_vtpm.c      |  543 ++++++++++++++++++++++++++++++
>  drivers/char/tpm/tpm_vtpm.h      |   55 +++
>  drivers/char/tpm/tpm_xen.c       |  690 ++++++++++++++++++++++++++++++++++++++
>  include/xen/interface/io/tpmif.h |   77 +++++
>  7 files changed, 1391 insertions(+)
>  create mode 100644 drivers/char/tpm/tpm_vtpm.c
>  create mode 100644 drivers/char/tpm/tpm_vtpm.h
>  create mode 100644 drivers/char/tpm/tpm_xen.c
>  create mode 100644 include/xen/interface/io/tpmif.h
> 
> diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
> index 915875e..08c1010 100644
> --- a/drivers/char/tpm/Kconfig
> +++ b/drivers/char/tpm/Kconfig
> @@ -81,4 +81,13 @@ config TCG_IBMVTPM
>  	  will be accessible from within Linux.  To compile this driver
>  	  as a module, choose M here; the module will be called tpm_ibmvtpm.
>  
> +config TCG_XEN
> +	tristate "XEN TPM Interface"
> +	depends on TCG_TPM && XEN
> +	---help---
> +	  If you want to make TPM support available to a Xen user domain,
> +	  say Yes and it will be accessible from within Linux.
> +	  To compile this driver as a module, choose M here; the module
> +	  will be called tpm_xenu.
> +
>  endif # TCG_TPM
> diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
> index 5b3fc8b..16911c5 100644
> --- a/drivers/char/tpm/Makefile
> +++ b/drivers/char/tpm/Makefile
> @@ -17,3 +17,5 @@ obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
>  obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
>  obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
>  obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
> +obj-$(CONFIG_TCG_XEN) += tpm_xenu.o
> +tpm_xenu-y = tpm_xen.o tpm_vtpm.o
> diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
> index 8ef7649..2e5a47a 100644
> --- a/drivers/char/tpm/tpm.h
> +++ b/drivers/char/tpm/tpm.h
> @@ -130,6 +130,9 @@ struct tpm_chip {
>  
>  	struct list_head list;
>  	void (*release) (struct device *);
> +#if CONFIG_XEN
> +	void *priv;
> +#endif
>  };
>  
>  #define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor)
> @@ -310,6 +313,18 @@ struct tpm_cmd_t {
>  
>  ssize_t	tpm_getcap(struct device *, __be32, cap_t *, const char *);
>  
> +#ifdef CONFIG_XEN
> +static inline void *chip_get_private(const struct tpm_chip *chip)
> +{
> +	return chip->priv;
> +}
> +
> +static inline void chip_set_private(struct tpm_chip *chip, void *priv)
> +{
> +	chip->priv = priv;
> +}
> +#endif
> +
>  extern int tpm_get_timeouts(struct tpm_chip *);
>  extern void tpm_gen_interrupt(struct tpm_chip *);
>  extern int tpm_do_selftest(struct tpm_chip *);
> diff --git a/drivers/char/tpm/tpm_vtpm.c b/drivers/char/tpm/tpm_vtpm.c
> new file mode 100644
> index 0000000..7687252
> --- /dev/null
> +++ b/drivers/char/tpm/tpm_vtpm.c
> @@ -0,0 +1,543 @@
> +/*
> + * Copyright (C) 2006 IBM Corporation
> + *
> + * Authors:
> + * Stefan Berger <stefanb@us.ibm.com>
> + *
> + * Generic device driver part for device drivers in a virtualized
> + * environment.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation, version 2 of the
> + * License.
> + *
> + */
> +
> +#include <linux/uaccess.h>
> +#include <linux/list.h>
> +#include <linux/device.h>
> +#include <linux/interrupt.h>
> +#include <linux/platform_device.h>
> +#include <linux/slab.h>
> +#include "tpm.h"
> +#include "tpm_vtpm.h"
> +
> +/* read status bits */
> +enum {
> +	STATUS_BUSY = 0x01,
> +	STATUS_DATA_AVAIL = 0x02,
> +	STATUS_READY = 0x04
> +};
> +
> +struct transmission {
> +	struct list_head next;
> +
> +	unsigned char *request;
> +	size_t  request_len;
> +	size_t  request_buflen;
> +
> +	unsigned char *response;
> +	size_t  response_len;
> +	size_t  response_buflen;
> +
> +	unsigned int flags;
> +};
> +
> +enum {
> +	TRANSMISSION_FLAG_WAS_QUEUED = 0x1
> +};
> +
> +
> +enum {
> +	DATAEX_FLAG_QUEUED_ONLY = 0x1
> +};
> +
> +
> +/* local variables */
> +
> +/* local function prototypes */
> +static int _vtpm_send_queued(struct tpm_chip *chip);
> +
> +
> +/* =============================================================
> + * Some utility functions
> + * =============================================================
> + */
> +static void vtpm_state_init(struct vtpm_state *vtpms)
> +{
> +	vtpms->current_request = NULL;
> +	spin_lock_init(&vtpms->req_list_lock);
> +	init_waitqueue_head(&vtpms->req_wait_queue);
> +	INIT_LIST_HEAD(&vtpms->queued_requests);
> +
> +	vtpms->current_response = NULL;
> +	spin_lock_init(&vtpms->resp_list_lock);
> +	init_waitqueue_head(&vtpms->resp_wait_queue);
> +
> +	vtpms->disconnect_time = jiffies;
> +}
> +
> +
> +static inline struct transmission *transmission_alloc(void)
> +{
> +	return kzalloc(sizeof(struct transmission), GFP_ATOMIC);
> +}
> +
> +	static unsigned char *


That is very weird tabbing? Did you run this patch through
scripts/checkpatch.pl ?

> +transmission_set_req_buffer(struct transmission *t,
> +		unsigned char *buffer, size_t len)
> +{
> +	if (t->request_buflen < len) {
> +		kfree(t->request);
> +		t->request = kmalloc(len, GFP_KERNEL);
> +		if (!t->request) {
> +			t->request_buflen = 0;
> +			return NULL;
> +		}
> +		t->request_buflen = len;
> +	}
> +
> +	memcpy(t->request, buffer, len);
> +	t->request_len = len;
> +
> +	return t->request;
> +}
> +
> +	static unsigned char *
> +transmission_set_res_buffer(struct transmission *t,
> +		const unsigned char *buffer, size_t len)
> +{
> +	if (t->response_buflen < len) {
> +		kfree(t->response);
> +		t->response = kmalloc(len, GFP_ATOMIC);
> +		if (!t->response) {
> +			t->response_buflen = 0;
> +			return NULL;
> +		}
> +		t->response_buflen = len;
> +	}
> +
> +	memcpy(t->response, buffer, len);
> +	t->response_len = len;
> +
> +	return t->response;
> +}
> +
> +static inline void transmission_free(struct transmission *t)
> +{
> +	kfree(t->request);
> +	kfree(t->response);
> +	kfree(t);
> +}
> +
> +/* =============================================================
> + * Interface with the lower layer driver
> + * =============================================================
> + */
> +/*
> + * Lower layer uses this function to make a response available.
> + */
> +int vtpm_vd_recv(const struct tpm_chip *chip,
> +		const unsigned char *buffer, size_t count,
> +		void *ptr)
> +{
> +	unsigned long flags;
> +	int ret_size = 0;
> +	struct transmission *t;
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	/*
> +	 * The list with requests must contain one request
> +	 * only and the element there must be the one that
> +	 * was passed to me from the front-end.
> +	 */
> +	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	if (vtpms->current_request != ptr) {
> +		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +		return 0;
> +	}
> +	t = vtpms->current_request;
> +	if (t) {
> +		transmission_free(t);
> +		vtpms->current_request = NULL;
> +	}
> +
> +	t = transmission_alloc();
> +	if (t) {
> +		if (!transmission_set_res_buffer(t, buffer, count)) {
> +			transmission_free(t);
> +			spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +			return -ENOMEM;
> +		}
> +		ret_size = count;
> +		vtpms->current_response = t;
> +		wake_up_interruptible(&vtpms->resp_wait_queue);
> +	}
> +	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +
> +	return ret_size;
> +}
> +
> +
> +/*
> + * Lower layer indicates its status (connected/disconnected)
> + */
> +void vtpm_vd_status(const struct tpm_chip *chip, u8 vd_status)
> +{
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	vtpms->vd_status = vd_status;
> +	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0)
> +		vtpms->disconnect_time = jiffies;
> +}
> +
> +/* =============================================================
> + * Interface with the generic TPM driver
> + * =============================================================
> + */
> +static int vtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count)
> +{
> +	int rc = 0;
> +	unsigned long flags;
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	/*
> +	 * Check if the previous operation only queued the command
> +	 * In this case there won't be a response, so I just
> +	 * return from here and reset that flag. In any other
> +	 * case I should receive a response from the back-end.
> +	 */
> +	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	if ((vtpms->flags & DATAEX_FLAG_QUEUED_ONLY) != 0) {
> +		vtpms->flags &= ~DATAEX_FLAG_QUEUED_ONLY;
> +		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +		/*
> +		 * The first few commands (measurements) must be
> +		 * queued since it might not be possible to talk to the
> +		 * TPM, yet.
> +		 * Return a response of up to 30 '0's.
> +		 */
> +
> +		count = min_t(size_t, count, 30);
> +		memset(buf, 0x0, count);
> +		return count;
> +	}
> +	/*
> +	 * Check whether something is in the responselist and if
> +	 * there's nothing in the list wait for something to appear.
> +	 */
> +
> +	if (!vtpms->current_response) {
> +		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +		interruptible_sleep_on_timeout(&vtpms->resp_wait_queue,
> +				1000);
> +		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	}
> +
> +	if (vtpms->current_response) {
> +		struct transmission *t = vtpms->current_response;
> +		vtpms->current_response = NULL;
> +		rc = min(count, t->response_len);
> +		memcpy(buf, t->response, rc);
> +		transmission_free(t);
> +	}
> +
> +	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +	return rc;
> +}
> +
> +static int vtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)
> +{
> +	int rc = 0;
> +	unsigned long flags;
> +	struct transmission *t = transmission_alloc();
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	if (!t)
> +		return -ENOMEM;
> +	/*
> +	 * If there's a current request, it must be the
> +	 * previous request that has timed out.
> +	 */
> +	spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +	if (vtpms->current_request != NULL) {
> +		dev_warn(chip->dev, "Sending although there is a request outstanding.\n"
> +				"         Previous request must have timed out.\n");
> +		transmission_free(vtpms->current_request);
> +		vtpms->current_request = NULL;
> +	}
> +	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
> +
> +	/*
> +	 * Queue the packet if the driver below is not
> +	 * ready, yet, or there is any packet already
> +	 * in the queue.
> +	 * If the driver below is ready, unqueue all
> +	 * packets first before sending our current
> +	 * packet.
> +	 * For each unqueued packet, except for the
> +	 * last (=current) packet, call the function
> +	 * tpm_xen_recv to wait for the response to come
> +	 * back.
> +	 */
> +	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0) {
> +		if (time_after(jiffies,
> +					vtpms->disconnect_time + HZ * 10)) {
> +			rc = -ENOENT;
> +		} else {
> +			goto queue_it;
> +		}
> +	} else {
> +		/*
> +		 * Send all queued packets.
> +		 */
> +		if (_vtpm_send_queued(chip) == 0) {
> +
> +			vtpms->current_request = t;
> +
> +			rc = vtpm_vd_send(vtpms->tpm_private,
> +					buf,
> +					count,
> +					t);
> +			/*
> +			 * The generic TPM driver will call
> +			 * the function to receive the response.
> +			 */
> +			if (rc < 0) {
> +				vtpms->current_request = NULL;
> +				goto queue_it;
> +			}
> +		} else {
> +queue_it:
> +			if (!transmission_set_req_buffer(t, buf, count)) {
> +				transmission_free(t);
> +				rc = -ENOMEM;
> +				goto exit;
> +			}
> +			/*
> +			 * An error occurred. Don't event try
> +			 * to send the current request. Just
> +			 * queue it.
> +			 */
> +			spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +			vtpms->flags |= DATAEX_FLAG_QUEUED_ONLY;
> +			list_add_tail(&t->next, &vtpms->queued_requests);
> +			spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
> +		}
> +	}
> +
> +exit:
> +	return rc;
> +}
> +
> +
> +/*
> + * Send all queued requests.
> + */
> +static int _vtpm_send_queued(struct tpm_chip *chip)
> +{
> +	int rc;
> +	int error = 0;
> +	unsigned long flags;
> +	unsigned char buffer[1];
> +	struct vtpm_state *vtpms;
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +
> +	while (!list_empty(&vtpms->queued_requests)) {
> +		/*
> +		 * Need to dequeue them.
> +		 * Read the result into a dummy buffer.
> +		 */
> +		struct transmission *qt = (struct transmission *)
> +			vtpms->queued_requests.next;
> +		list_del(&qt->next);
> +		vtpms->current_request = qt;
> +		spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
> +
> +		rc = vtpm_vd_send(vtpms->tpm_private,
> +				qt->request,
> +				qt->request_len,
> +				qt);
> +
> +		if (rc < 0) {
> +			spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +			qt = vtpms->current_request;
> +			if (qt != NULL) {
> +				/*
> +				 * requeue it at the beginning
> +				 * of the list
> +				 */
> +				list_add(&qt->next,
> +						&vtpms->queued_requests);
> +			}
> +			vtpms->current_request = NULL;
> +			error = 1;
> +			break;
> +		}
> +		/*
> +		 * After this point qt is not valid anymore!
> +		 * It is freed when the front-end is delivering
> +		 * the data by calling tpm_recv
> +		 */
> +		/*
> +		 * Receive response into provided dummy buffer
> +		 */
> +		rc = vtpm_recv(chip, buffer, sizeof(buffer));
> +		spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +	}
> +
> +	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
> +
> +	return error;
> +}
> +
> +static void vtpm_cancel(struct tpm_chip *chip)
> +{
> +	unsigned long flags;
> +	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +
> +	if (!vtpms->current_response && vtpms->current_request) {
> +		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +		interruptible_sleep_on(&vtpms->resp_wait_queue);
> +		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	}
> +
> +	if (vtpms->current_response) {
> +		struct transmission *t = vtpms->current_response;
> +		vtpms->current_response = NULL;
> +		transmission_free(t);
> +	}
> +
> +	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +}
> +
> +static u8 vtpm_status(struct tpm_chip *chip)
> +{
> +	u8 rc = 0;
> +	unsigned long flags;
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	/*
> +	 * Data are available if:
> +	 *  - there's a current response
> +	 *  - the last packet was queued only (this is fake, but necessary to
> +	 *      get the generic TPM layer to call the receive function.)
> +	 */
> +	if (vtpms->current_response ||
> +			0 != (vtpms->flags & DATAEX_FLAG_QUEUED_ONLY)) {
> +		rc = STATUS_DATA_AVAIL;
> +	} else if (!vtpms->current_response && !vtpms->current_request) {
> +		rc = STATUS_READY;
> +	}
> +
> +	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +	return rc;
> +}
> +
> +static const struct file_operations vtpm_ops = {
> +	.owner = THIS_MODULE,
> +	.llseek = no_llseek,
> +	.open = tpm_open,
> +	.read = tpm_read,
> +	.write = tpm_write,
> +	.release = tpm_release,
> +};
> +
> +static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
> +static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
> +static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);
> +static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL);
> +static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL);
> +static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,
> +		NULL);
> +static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL);
> +static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
> +
> +static struct attribute *vtpm_attrs[] = {
> +	&dev_attr_pubek.attr,
> +	&dev_attr_pcrs.attr,
> +	&dev_attr_enabled.attr,
> +	&dev_attr_active.attr,
> +	&dev_attr_owned.attr,
> +	&dev_attr_temp_deactivated.attr,
> +	&dev_attr_caps.attr,
> +	&dev_attr_cancel.attr,
> +	NULL,

So are these going to show up in SysFS? If so, there should also be
a corresponding file in Documentation/.../sysfs/something.

> +};
> +
> +static struct attribute_group vtpm_attr_grp = { .attrs = vtpm_attrs };
> +
> +#define TPM_LONG_TIMEOUT   (10 * 60 * HZ)
> +
> +static struct tpm_vendor_specific tpm_vtpm = {
> +	.recv = vtpm_recv,
> +	.send = vtpm_send,
> +	.cancel = vtpm_cancel,
> +	.status = vtpm_status,
> +	.req_complete_mask = STATUS_BUSY | STATUS_DATA_AVAIL,
> +	.req_complete_val  = STATUS_DATA_AVAIL,
> +	.req_canceled = STATUS_READY,
> +	.attr_group = &vtpm_attr_grp,
> +	.miscdev = {
> +		.fops = &vtpm_ops,
> +	},
> +	.duration = {
> +		TPM_LONG_TIMEOUT,
> +		TPM_LONG_TIMEOUT,
> +		TPM_LONG_TIMEOUT,
> +	},
> +};
> +
> +struct tpm_chip *init_vtpm(struct device *dev,
> +		struct tpm_private *tp)
> +{
> +	long rc;
> +	struct tpm_chip *chip;
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = kzalloc(sizeof(struct vtpm_state), GFP_KERNEL);
> +	if (!vtpms)
> +		return ERR_PTR(-ENOMEM);
> +
> +	vtpm_state_init(vtpms);
> +	vtpms->tpm_private = tp;
> +
> +	chip = tpm_register_hardware(dev, &tpm_vtpm);
> +	if (!chip) {
> +		rc = -ENODEV;
> +		goto err_free_mem;
> +	}
> +
> +	chip_set_private(chip, vtpms);
> +
> +	return chip;
> +
> +err_free_mem:
> +	kfree(vtpms);
> +
> +	return ERR_PTR(rc);
> +}
> +
> +void cleanup_vtpm(struct device *dev)
> +{
> +	struct tpm_chip *chip = dev_get_drvdata(dev);
> +	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
> +	tpm_remove_hardware(dev);
> +	kfree(vtpms);
> +}
> diff --git a/drivers/char/tpm/tpm_vtpm.h b/drivers/char/tpm/tpm_vtpm.h
> new file mode 100644
> index 0000000..d888fd8
> --- /dev/null
> +++ b/drivers/char/tpm/tpm_vtpm.h
> @@ -0,0 +1,55 @@
> +#ifndef TPM_VTPM_H
> +#define TPM_VTPM_H
> +
> +struct tpm_chip;
> +struct tpm_private;
> +
> +struct vtpm_state {
> +	struct transmission *current_request;
> +	spinlock_t           req_list_lock;
> +	wait_queue_head_t    req_wait_queue;
> +
> +	struct list_head     queued_requests;
> +
> +	struct transmission *current_response;
> +	spinlock_t           resp_list_lock;
> +	wait_queue_head_t    resp_wait_queue;
> +
> +	u8                   vd_status;
> +	u8                   flags;
> +
> +	unsigned long        disconnect_time;
> +
> +	/*
> +	 * The following is a private structure of the underlying
> +	 * driver. It is passed as parameter in the send function.
> +	 */
> +	struct tpm_private *tpm_private;
> +};
> +
> +
> +enum vdev_status {
> +	TPM_VD_STATUS_DISCONNECTED = 0x0,
> +	TPM_VD_STATUS_CONNECTED = 0x1
> +};
> +
> +/* this function is called from tpm_vtpm.c */
> +int vtpm_vd_send(struct tpm_private *tp,
> +		const u8 *buf, size_t count, void *ptr);
> +
> +/* these functions are offered by tpm_vtpm.c */
> +struct tpm_chip *init_vtpm(struct device *,
> +		struct tpm_private *);
> +void cleanup_vtpm(struct device *);
> +int vtpm_vd_recv(const struct tpm_chip *chip,
> +		const unsigned char *buffer, size_t count, void *ptr);
> +void vtpm_vd_status(const struct tpm_chip *, u8 status);
> +
> +static inline struct tpm_private *tpm_private_from_dev(struct device *dev)
> +{
> +	struct tpm_chip *chip = dev_get_drvdata(dev);
> +	struct vtpm_state *vtpms = chip_get_private(chip);
> +	return vtpms->tpm_private;
> +}
> +
> +#endif
> diff --git a/drivers/char/tpm/tpm_xen.c b/drivers/char/tpm/tpm_xen.c
> new file mode 100644
> index 0000000..7198de3
> --- /dev/null
> +++ b/drivers/char/tpm/tpm_xen.c
> @@ -0,0 +1,690 @@
> +/*
> + * Copyright (c) 2005, IBM Corporation
> + *
> + * Author: Stefan Berger, stefanb@us.ibm.com
> + * Grant table support: Mahadevan Gomathisankaran
> + *
> + * This code has been derived from drivers/xen/netfront/netfront.c
> + *
> + * Copyright (c) 2002-2004, K A Fraser
> + *
> + * 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.
> + */
> +
> +#include <linux/errno.h>
> +#include <linux/err.h>
> +#include <linux/interrupt.h>
> +#include <linux/mutex.h>
> +#include <linux/uaccess.h>
> +#include <xen/events.h>
> +#include <xen/interface/grant_table.h>
> +#include <xen/interface/io/tpmif.h>
> +#include <xen/grant_table.h>
> +#include <xen/xenbus.h>
> +#include <xen/page.h>
> +#include "tpm.h"
> +#include "tpm_vtpm.h"
> +
> +#undef DEBUG
> +
> +#define GRANT_INVALID_REF 0

Interesting. The 0 grant value is actually a valid one. I think you
want (-1ULL).

> +
> +/* local structures */
> +struct tpm_private {
> +	struct tpm_chip *chip;
> +
> +	tpmif_tx_interface_t *tx;
> +	atomic_t refcnt;
> +	unsigned int evtchn;
> +	u8 is_connected;
> +	u8 is_suspended;
> +
> +	spinlock_t tx_lock;
> +
> +	struct tx_buffer *tx_buffers[TPMIF_TX_RING_SIZE];
> +
> +	atomic_t tx_busy;
> +	void *tx_remember;
> +
> +	domid_t backend_id;
> +	wait_queue_head_t wait_q;
> +
> +	struct xenbus_device *dev;
> +	int ring_ref;
> +};
> +
> +struct tx_buffer {
> +	unsigned int size;	/* available space in data */
> +	unsigned int len;	/* used space in data */
> +	unsigned char *data;	/* pointer to a page */
> +};
> +
> +
> +/* locally visible variables */
> +static grant_ref_t gref_head;
> +static struct tpm_private *my_priv;
> +
> +/* local function prototypes */
> +static irqreturn_t tpmif_int(int irq,
> +		void *tpm_priv);
> +static void tpmif_rx_action(unsigned long unused);
> +static int tpmif_connect(struct xenbus_device *dev,
> +		struct tpm_private *tp,
> +		domid_t domid);
> +static DECLARE_TASKLET(tpmif_rx_tasklet, tpmif_rx_action, 0);
> +static int tpmif_allocate_tx_buffers(struct tpm_private *tp);
> +static void tpmif_free_tx_buffers(struct tpm_private *tp);
> +static void tpmif_set_connected_state(struct tpm_private *tp,
> +		u8 newstate);
> +static int tpm_xmit(struct tpm_private *tp,
> +		const u8 *buf, size_t count, int userbuffer,
> +		void *remember);
> +static void destroy_tpmring(struct tpm_private *tp);
> +
> +	static inline int
> +tx_buffer_copy(struct tx_buffer *txb, const u8 *src, int len,
> +		int isuserbuffer)
> +{
> +	int copied = len;
> +
> +	if (len > txb->size)
> +		copied = txb->size;
> +	if (isuserbuffer) {
> +		if (copy_from_user(txb->data, src, copied))
> +			return -EFAULT;
> +	} else {
> +		memcpy(txb->data, src, copied);
> +	}
> +	txb->len = len;
> +	return copied;
> +}
> +
> +static inline struct tx_buffer *tx_buffer_alloc(void)
> +{
> +	struct tx_buffer *txb;
> +
> +	txb = kzalloc(sizeof(struct tx_buffer), GFP_KERNEL);
> +	if (!txb)
> +		return NULL;
> +
> +	txb->len = 0;
> +	txb->size = PAGE_SIZE;
> +	txb->data = (unsigned char *)__get_free_page(GFP_KERNEL);
> +	if (txb->data == NULL) {
> +		kfree(txb);
> +		txb = NULL;
> +	}
> +
> +	return txb;
> +}
> +
> +
> +static inline void tx_buffer_free(struct tx_buffer *txb)
> +{
> +	if (txb) {
> +		free_page((long)txb->data);
> +		kfree(txb);
> +	}
> +}
> +
> +/**************************************************************
> +  Utility function for the tpm_private structure
> + **************************************************************/
> +static void tpm_private_init(struct tpm_private *tp)
> +{
> +	spin_lock_init(&tp->tx_lock);
> +	init_waitqueue_head(&tp->wait_q);
> +	atomic_set(&tp->refcnt, 1);
> +}
> +
> +static void tpm_private_put(void)
> +{
> +	if (!atomic_dec_and_test(&my_priv->refcnt))
> +		return;
> +
> +	tpmif_free_tx_buffers(my_priv);
> +	kfree(my_priv);
> +	my_priv = NULL;
> +}
> +
> +static struct tpm_private *tpm_private_get(void)
> +{
> +	int err;
> +
> +	if (my_priv) {
> +		atomic_inc(&my_priv->refcnt);
> +		return my_priv;
> +	}
> +
> +	my_priv = kzalloc(sizeof(struct tpm_private), GFP_KERNEL);
> +	if (!my_priv)
> +		return NULL;
> +
> +	tpm_private_init(my_priv);
> +	err = tpmif_allocate_tx_buffers(my_priv);
> +	if (err < 0)
> +		tpm_private_put();
> +
> +	return my_priv;
> +}
> +
> +/**************************************************************
> +
> +  The interface to let the tpm plugin register its callback
> +  function and send data to another partition using this module
> +
> + **************************************************************/
> +
> +static DEFINE_MUTEX(suspend_lock);
> +/*
> + * Send data via this module by calling this function
> + */
> +int vtpm_vd_send(struct tpm_private *tp,
> +		const u8 *buf, size_t count, void *ptr)
> +{
> +	int sent;
> +
> +	mutex_lock(&suspend_lock);
> +	sent = tpm_xmit(tp, buf, count, 0, ptr);
> +	mutex_unlock(&suspend_lock);
> +
> +	return sent;
> +}
> +
> +/**************************************************************
> +  XENBUS support code
> + **************************************************************/
> +
> +static int setup_tpmring(struct xenbus_device *dev,
> +		struct tpm_private *tp)
> +{
> +	tpmif_tx_interface_t *sring;
> +	int err;
> +
> +	tp->ring_ref = GRANT_INVALID_REF;
> +
> +	sring = (void *)__get_free_page(GFP_KERNEL);
> +	if (!sring) {
> +		xenbus_dev_fatal(dev, -ENOMEM, "allocating shared ring");
> +		return -ENOMEM;
> +	}
> +	tp->tx = sring;
> +
> +	err = xenbus_grant_ring(dev, virt_to_mfn(tp->tx));
> +	if (err < 0) {
> +		free_page((unsigned long)sring);
> +		tp->tx = NULL;
> +		xenbus_dev_fatal(dev, err, "allocating grant reference");
> +		goto fail;
> +	}
> +	tp->ring_ref = err;
> +
> +	err = tpmif_connect(dev, tp, dev->otherend_id);
> +	if (err)
> +		goto fail;
> +
> +	return 0;
> +fail:
> +	destroy_tpmring(tp);
> +	return err;
> +}
> +
> +
> +static void destroy_tpmring(struct tpm_private *tp)
> +{
> +	tpmif_set_connected_state(tp, 0);
> +
> +	if (tp->ring_ref != GRANT_INVALID_REF) {
> +		gnttab_end_foreign_access(tp->ring_ref,
> +				0, (unsigned long)tp->tx);
> +		tp->ring_ref = GRANT_INVALID_REF;
> +		tp->tx = NULL;
> +	}
> +
> +	if (tp->evtchn)
> +		unbind_from_irqhandler(irq_from_evtchn(tp->evtchn), tp);
> +
> +	tp->evtchn = GRANT_INVALID_REF;
> +}
> +
> +
> +static int talk_to_backend(struct xenbus_device *dev,
> +		struct tpm_private *tp)
> +{
> +	const char *message = NULL;
> +	int err;
> +	struct xenbus_transaction xbt;
> +
> +	err = setup_tpmring(dev, tp);
> +	if (err) {
> +		xenbus_dev_fatal(dev, err, "setting up ring");
> +		goto out;
> +	}
> +
> +again:
> +	err = xenbus_transaction_start(&xbt);
> +	if (err) {
> +		xenbus_dev_fatal(dev, err, "starting transaction");
> +		goto destroy_tpmring;
> +	}
> +
> +	err = xenbus_printf(xbt, dev->nodename,
> +			"ring-ref", "%u", tp->ring_ref);
> +	if (err) {
> +		message = "writing ring-ref";
> +		goto abort_transaction;
> +	}
> +
> +	err = xenbus_printf(xbt, dev->nodename, "event-channel", "%u",
> +			tp->evtchn);
> +	if (err) {
> +		message = "writing event-channel";
> +		goto abort_transaction;
> +	}
> +
> +	err = xenbus_transaction_end(xbt, 0);
> +	if (err == -EAGAIN)
> +		goto again;
> +	if (err) {
> +		xenbus_dev_fatal(dev, err, "completing transaction");
> +		goto destroy_tpmring;
> +	}
> +
> +	xenbus_switch_state(dev, XenbusStateConnected);
> +
> +	return 0;
> +
> +abort_transaction:
> +	xenbus_transaction_end(xbt, 1);
> +	if (message)
> +		xenbus_dev_error(dev, err, "%s", message);
> +destroy_tpmring:
> +	destroy_tpmring(tp);
> +out:
> +	return err;
> +}
> +
> +/**
> + * Callback received when the backend's state changes.
> + */
> +static void backend_changed(struct xenbus_device *dev,
> +		enum xenbus_state backend_state)
> +{
> +	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
> +
> +	switch (backend_state) {
> +	case XenbusStateInitialising:
> +	case XenbusStateInitWait:
> +	case XenbusStateInitialised:
> +	case XenbusStateReconfiguring:
> +	case XenbusStateReconfigured:
> +	case XenbusStateUnknown:
> +		break;
> +
> +	case XenbusStateConnected:
> +		tpmif_set_connected_state(tp, 1);
> +		break;
> +
> +	case XenbusStateClosing:
> +		tpmif_set_connected_state(tp, 0);
> +		xenbus_frontend_closed(dev);
> +		break;
> +
> +	case XenbusStateClosed:
> +		tpmif_set_connected_state(tp, 0);
> +		if (tp->is_suspended == 0)
> +			device_unregister(&dev->dev);
> +		xenbus_frontend_closed(dev);
> +		break;
> +	}
> +}
> +
> +static int tpmfront_probe(struct xenbus_device *dev,
> +		const struct xenbus_device_id *id)
> +{
> +	int err;
> +	int handle;
> +	struct tpm_private *tp = tpm_private_get();
> +
> +	if (!tp)
> +		return -ENOMEM;
> +
> +	tp->chip = init_vtpm(&dev->dev, tp);
> +	if (IS_ERR(tp->chip))
> +		return PTR_ERR(tp->chip);
> +
> +	err = xenbus_scanf(XBT_NIL, dev->nodename,
> +			"handle", "%i", &handle);
> +	if (XENBUS_EXIST_ERR(err))
> +		return err;
> +
> +	if (err < 0) {
> +		xenbus_dev_fatal(dev, err, "reading virtual-device");
> +		return err;
> +	}
> +
> +	tp->dev = dev;
> +
> +	err = talk_to_backend(dev, tp);
> +	if (err) {
> +		tpm_private_put();
> +		return err;
> +	}
> +
> +	return 0;
> +}
> +
> +
> +static int __devexit tpmfront_remove(struct xenbus_device *dev)
> +{
> +	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
> +	destroy_tpmring(tp);
> +	cleanup_vtpm(&dev->dev);
> +	return 0;
> +}
> +
> +static int tpmfront_suspend(struct xenbus_device *dev)
> +{
> +	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
> +	u32 ctr;
> +
> +	/* Take the lock, preventing any application from sending. */
> +	mutex_lock(&suspend_lock);
> +	tp->is_suspended = 1;
> +
> +	for (ctr = 0; atomic_read(&tp->tx_busy); ctr++) {
> +		/* Wait for a request to be responded to. */
> +		interruptible_sleep_on_timeout(&tp->wait_q, 100);
> +	}
> +
> +	return 0;
> +}
> +
> +static int tpmfront_suspend_finish(struct tpm_private *tp)
> +{
> +	tp->is_suspended = 0;
> +	/* Allow applications to send again. */
> +	mutex_unlock(&suspend_lock);
> +	return 0;
> +}
> +
> +static int tpmfront_resume(struct xenbus_device *dev)
> +{
> +	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
> +	destroy_tpmring(tp);
> +	return talk_to_backend(dev, tp);
> +}
> +
> +static int tpmif_connect(struct xenbus_device *dev,
> +		struct tpm_private *tp,
> +		domid_t domid)
> +{
> +	int err;
> +
> +	tp->backend_id = domid;
> +	tp->evtchn = GRANT_INVALID_REF;
> +
> +	err = xenbus_alloc_evtchn(dev, &tp->evtchn);
> +	if (err)
> +		return err;
> +
> +	err = bind_evtchn_to_irqhandler(tp->evtchn, tpmif_int,
> +			0, "tpmif", tp);
> +	if (err <= 0)
> +		return err;
> +
> +	return 0;
> +}
> +
> +static const struct xenbus_device_id tpmfront_ids[] = {
> +	{ "vtpm" },
> +	{ "" }
> +};
> +MODULE_ALIAS("xen:vtpm");
> +
> +static DEFINE_XENBUS_DRIVER(tpmfront, ,
> +		.probe = tpmfront_probe,
> +		.remove =  __devexit_p(tpmfront_remove),
> +		.resume = tpmfront_resume,
> +		.otherend_changed = backend_changed,
> +		.suspend = tpmfront_suspend,
> +		);
> +
> +static int __init init_tpm_xenbus(void)
> +{
> +	return xenbus_register_frontend(&tpmfront_driver);
> +}
> +
> +static int tpmif_allocate_tx_buffers(struct tpm_private *tp)
> +{
> +	unsigned int i;
> +
> +	for (i = 0; i < TPMIF_TX_RING_SIZE; i++) {
> +		tp->tx_buffers[i] = tx_buffer_alloc();
> +		if (!tp->tx_buffers[i]) {
> +			tpmif_free_tx_buffers(tp);
> +			return -ENOMEM;
> +		}
> +	}
> +	return 0;
> +}
> +
> +static void tpmif_free_tx_buffers(struct tpm_private *tp)
> +{
> +	unsigned int i;
> +
> +	for (i = 0; i < TPMIF_TX_RING_SIZE; i++)
> +		tx_buffer_free(tp->tx_buffers[i]);
> +}
> +
> +static void tpmif_rx_action(unsigned long priv)
> +{
> +	struct tpm_private *tp = (struct tpm_private *)priv;
> +	int i = 0;
> +	unsigned int received;
> +	unsigned int offset = 0;
> +	u8 *buffer;
> +	tpmif_tx_request_t *tx = &tp->tx->ring[i].req;
> +
> +	atomic_set(&tp->tx_busy, 0);
> +	wake_up_interruptible(&tp->wait_q);
> +
> +	received = tx->size;
> +
> +	buffer = kmalloc(received, GFP_ATOMIC);
> +	if (!buffer)
> +		return;
> +
> +	for (i = 0; i < TPMIF_TX_RING_SIZE && offset < received; i++) {
> +		struct tx_buffer *txb = tp->tx_buffers[i];
> +		tpmif_tx_request_t *tx;
> +		unsigned int tocopy;
> +
> +		tx = &tp->tx->ring[i].req;
> +		tocopy = tx->size;
> +		if (tocopy > PAGE_SIZE)
> +			tocopy = PAGE_SIZE;
> +
> +		memcpy(&buffer[offset], txb->data, tocopy);
> +
> +		gnttab_release_grant_reference(&gref_head, tx->ref);
> +
> +		offset += tocopy;
> +	}
> +
> +	vtpm_vd_recv(tp->chip, buffer, received, tp->tx_remember);
> +	kfree(buffer);
> +}
> +
> +
> +static irqreturn_t tpmif_int(int irq, void *tpm_priv)
> +{
> +	struct tpm_private *tp = tpm_priv;
> +	unsigned long flags;
> +
> +	spin_lock_irqsave(&tp->tx_lock, flags);
> +	tpmif_rx_tasklet.data = (unsigned long)tp;
> +	tasklet_schedule(&tpmif_rx_tasklet);
> +	spin_unlock_irqrestore(&tp->tx_lock, flags);
> +
> +	return IRQ_HANDLED;
> +}
> +
> +
> +static int tpm_xmit(struct tpm_private *tp,
> +		const u8 *buf, size_t count, int isuserbuffer,
> +		void *remember)
> +{
> +	tpmif_tx_request_t *tx;
> +	TPMIF_RING_IDX i;
> +	unsigned int offset = 0;
> +
> +	spin_lock_irq(&tp->tx_lock);
> +
> +	if (unlikely(atomic_read(&tp->tx_busy))) {
> +		spin_unlock_irq(&tp->tx_lock);
> +		return -EBUSY;
> +	}
> +
> +	if (tp->is_connected != 1) {
> +		spin_unlock_irq(&tp->tx_lock);
> +		return -EIO;
> +	}
> +
> +	for (i = 0; count > 0 && i < TPMIF_TX_RING_SIZE; i++) {
> +		struct tx_buffer *txb = tp->tx_buffers[i];
> +		int copied;
> +
> +		if (!txb) {
> +			spin_unlock_irq(&tp->tx_lock);
> +			return -EFAULT;
> +		}
> +
> +		copied = tx_buffer_copy(txb, &buf[offset], count,
> +				isuserbuffer);
> +		if (copied < 0) {
> +			/* An error occurred */
> +			spin_unlock_irq(&tp->tx_lock);
> +			return copied;
> +		}
> +		count -= copied;
> +		offset += copied;
> +
> +		tx = &tp->tx->ring[i].req;
> +		tx->addr = virt_to_machine(txb->data).maddr;
> +		tx->size = txb->len;
> +		tx->unused = 0;
> +
> +		/* Get the granttable reference for this page. */
> +		tx->ref = gnttab_claim_grant_reference(&gref_head);
> +		if (tx->ref == -ENOSPC) {
> +			spin_unlock_irq(&tp->tx_lock);
> +			return -ENOSPC;
> +		}
> +		gnttab_grant_foreign_access_ref(tx->ref,
> +				tp->backend_id,
> +				virt_to_mfn(txb->data),
> +				0 /*RW*/);
> +		wmb();
> +	}
> +
> +	atomic_set(&tp->tx_busy, 1);
> +	tp->tx_remember = remember;
> +
> +	mb();
> +
> +	notify_remote_via_evtchn(tp->evtchn);
> +
> +	spin_unlock_irq(&tp->tx_lock);
> +	return offset;
> +}
> +
> +
> +static void tpmif_notify_upperlayer(struct tpm_private *tp)
> +{
> +	/* Notify upper layer about the state of the connection to the BE. */
> +	vtpm_vd_status(tp->chip, (tp->is_connected
> +				? TPM_VD_STATUS_CONNECTED
> +				: TPM_VD_STATUS_DISCONNECTED));
> +}
> +
> +
> +static void tpmif_set_connected_state(struct tpm_private *tp, u8 is_connected)
> +{
> +	/*
> +	 * Don't notify upper layer if we are in suspend mode and
> +	 * should disconnect - assumption is that we will resume
> +	 * The mutex keeps apps from sending.
> +	 */
> +	if (is_connected == 0 && tp->is_suspended == 1)
> +		return;
> +
> +	/*
> +	 * Unlock the mutex if we are connected again
> +	 * after being suspended - now resuming.
> +	 * This also removes the suspend state.
> +	 */
> +	if (is_connected == 1 && tp->is_suspended == 1)
> +		tpmfront_suspend_finish(tp);
> +
> +	if (is_connected != tp->is_connected) {
> +		tp->is_connected = is_connected;
> +		tpmif_notify_upperlayer(tp);
> +	}
> +}
> +
> +
> +
> +/* =================================================================
> + * Initialization function.
> + * =================================================================
> + */
> +
> +
> +static int __init tpmif_init(void)
> +{
> +	struct tpm_private *tp;
> +
> +	if (!xen_domain())
> +		return -ENODEV;
> +
> +	tp = tpm_private_get();
> +	if (!tp)
> +		return -ENOMEM;
> +
> +	if (gnttab_alloc_grant_references(TPMIF_TX_RING_SIZE,
> +				&gref_head) < 0) {
> +		tpm_private_put();
> +		return -EFAULT;
> +	}
> +
> +	init_tpm_xenbus();
> +	return 0;
> +}
> +
> +
> +module_init(tpmif_init);

no module_exit?

> +
> +MODULE_LICENSE("Dual BSD/GPL");
> diff --git a/include/xen/interface/io/tpmif.h b/include/xen/interface/io/tpmif.h
> new file mode 100644
> index 0000000..5342fca
> --- /dev/null
> +++ b/include/xen/interface/io/tpmif.h
> @@ -0,0 +1,77 @@
> +/******************************************************************************
> + * tpmif.h
> + *
> + * TPM I/O interface for Xen guest OSes.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a copy
> + * of this software and associated documentation files (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.
> + *
> + * Copyright (c) 2005, IBM Corporation
> + *
> + * Author: Stefan Berger, stefanb@us.ibm.com
> + * Grant table support: Mahadevan Gomathisankaran
> + *
> + * This code has been derived from tools/libxc/xen/io/netif.h
> + *
> + * Copyright (c) 2003-2004, Keir Fraser
> + */
> +
> +#ifndef __XEN_PUBLIC_IO_TPMIF_H__
> +#define __XEN_PUBLIC_IO_TPMIF_H__
> +
> +#include "../grant_table.h"
> +
> +struct tpmif_tx_request {
> +	unsigned long addr;   /* Machine address of packet.   */
> +	grant_ref_t ref;      /* grant table access reference */
> +	uint16_t unused;
> +	uint16_t size;        /* Packet size in bytes.        */
> +};
> +typedef struct tpmif_tx_request tpmif_tx_request_t;
> +
> +/*
> + * The TPMIF_TX_RING_SIZE defines the number of pages the
> + * front-end and backend can exchange (= size of array).
> + */
> +typedef uint32_t TPMIF_RING_IDX;
> +
> +#define TPMIF_TX_RING_SIZE 1
> +
> +/* This structure must fit in a memory page. */
> +
> +struct tpmif_ring {
> +	struct tpmif_tx_request req;
> +};
> +typedef struct tpmif_ring tpmif_ring_t;
> +
> +struct tpmif_tx_interface {
> +	struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
> +};
> +typedef struct tpmif_tx_interface tpmif_tx_interface_t;
> +
> +#endif
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-set-style: "BSD"
> + * c-basic-offset: 4
> + * tab-width: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> -- 
> 1.7.10.4

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 19:53:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 19:53:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVpCW-0005ZQ-8F; Tue, 06 Nov 2012 19:52:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TVpCT-0005ZL-SO
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 19:52:42 +0000
Received: from [85.158.137.99:13772] by server-7.bemta-3.messagelabs.com id
	8F/1C-01713-48A69905; Tue, 06 Nov 2012 19:52:36 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1352231553!14850071!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjY2OTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14666 invoked from network); 6 Nov 2012 19:52:35 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 19:52:35 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6JqCX5024514
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 19:52:13 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6Jq7rW004771
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 19:52:08 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6Jq5Dl011821; Tue, 6 Nov 2012 13:52:05 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 06 Nov 2012 11:52:04 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id E0D3E4042D; Tue,  6 Nov 2012 14:39:21 -0500 (EST)
Date: Tue, 6 Nov 2012 14:39:21 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121106193921.GC28473@phenom.dumpdata.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: jeremy@goop.org, xen-devel@lists.xensource.com,
	linux-kernel@vger.kernel.org, mail@srajiv.net,
	tpmdd-devel@lists.sourceforge.net, key@linux.vnet.ibm.com
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
	driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 05, 2012 at 10:09:57AM -0500, Matthew Fioravante wrote:
> This patch ports the xen vtpm frontend driver for linux
> from the linux-2.6.18-xen.hg tree to linux-stable.

So how does on test it ? Set it up? Use it? Is there some documentation
about it - if so it should be in the patch description.

I did a very very cursory look at it, see some of the comments.

> 
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> ---
>  drivers/char/tpm/Kconfig         |    9 +
>  drivers/char/tpm/Makefile        |    2 +
>  drivers/char/tpm/tpm.h           |   15 +
>  drivers/char/tpm/tpm_vtpm.c      |  543 ++++++++++++++++++++++++++++++
>  drivers/char/tpm/tpm_vtpm.h      |   55 +++
>  drivers/char/tpm/tpm_xen.c       |  690 ++++++++++++++++++++++++++++++++++++++
>  include/xen/interface/io/tpmif.h |   77 +++++
>  7 files changed, 1391 insertions(+)
>  create mode 100644 drivers/char/tpm/tpm_vtpm.c
>  create mode 100644 drivers/char/tpm/tpm_vtpm.h
>  create mode 100644 drivers/char/tpm/tpm_xen.c
>  create mode 100644 include/xen/interface/io/tpmif.h
> 
> diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
> index 915875e..08c1010 100644
> --- a/drivers/char/tpm/Kconfig
> +++ b/drivers/char/tpm/Kconfig
> @@ -81,4 +81,13 @@ config TCG_IBMVTPM
>  	  will be accessible from within Linux.  To compile this driver
>  	  as a module, choose M here; the module will be called tpm_ibmvtpm.
>  
> +config TCG_XEN
> +	tristate "XEN TPM Interface"
> +	depends on TCG_TPM && XEN
> +	---help---
> +	  If you want to make TPM support available to a Xen user domain,
> +	  say Yes and it will be accessible from within Linux.
> +	  To compile this driver as a module, choose M here; the module
> +	  will be called tpm_xenu.
> +
>  endif # TCG_TPM
> diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
> index 5b3fc8b..16911c5 100644
> --- a/drivers/char/tpm/Makefile
> +++ b/drivers/char/tpm/Makefile
> @@ -17,3 +17,5 @@ obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
>  obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
>  obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
>  obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
> +obj-$(CONFIG_TCG_XEN) += tpm_xenu.o
> +tpm_xenu-y = tpm_xen.o tpm_vtpm.o
> diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
> index 8ef7649..2e5a47a 100644
> --- a/drivers/char/tpm/tpm.h
> +++ b/drivers/char/tpm/tpm.h
> @@ -130,6 +130,9 @@ struct tpm_chip {
>  
>  	struct list_head list;
>  	void (*release) (struct device *);
> +#if CONFIG_XEN
> +	void *priv;
> +#endif
>  };
>  
>  #define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor)
> @@ -310,6 +313,18 @@ struct tpm_cmd_t {
>  
>  ssize_t	tpm_getcap(struct device *, __be32, cap_t *, const char *);
>  
> +#ifdef CONFIG_XEN
> +static inline void *chip_get_private(const struct tpm_chip *chip)
> +{
> +	return chip->priv;
> +}
> +
> +static inline void chip_set_private(struct tpm_chip *chip, void *priv)
> +{
> +	chip->priv = priv;
> +}
> +#endif
> +
>  extern int tpm_get_timeouts(struct tpm_chip *);
>  extern void tpm_gen_interrupt(struct tpm_chip *);
>  extern int tpm_do_selftest(struct tpm_chip *);
> diff --git a/drivers/char/tpm/tpm_vtpm.c b/drivers/char/tpm/tpm_vtpm.c
> new file mode 100644
> index 0000000..7687252
> --- /dev/null
> +++ b/drivers/char/tpm/tpm_vtpm.c
> @@ -0,0 +1,543 @@
> +/*
> + * Copyright (C) 2006 IBM Corporation
> + *
> + * Authors:
> + * Stefan Berger <stefanb@us.ibm.com>
> + *
> + * Generic device driver part for device drivers in a virtualized
> + * environment.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation, version 2 of the
> + * License.
> + *
> + */
> +
> +#include <linux/uaccess.h>
> +#include <linux/list.h>
> +#include <linux/device.h>
> +#include <linux/interrupt.h>
> +#include <linux/platform_device.h>
> +#include <linux/slab.h>
> +#include "tpm.h"
> +#include "tpm_vtpm.h"
> +
> +/* read status bits */
> +enum {
> +	STATUS_BUSY = 0x01,
> +	STATUS_DATA_AVAIL = 0x02,
> +	STATUS_READY = 0x04
> +};
> +
> +struct transmission {
> +	struct list_head next;
> +
> +	unsigned char *request;
> +	size_t  request_len;
> +	size_t  request_buflen;
> +
> +	unsigned char *response;
> +	size_t  response_len;
> +	size_t  response_buflen;
> +
> +	unsigned int flags;
> +};
> +
> +enum {
> +	TRANSMISSION_FLAG_WAS_QUEUED = 0x1
> +};
> +
> +
> +enum {
> +	DATAEX_FLAG_QUEUED_ONLY = 0x1
> +};
> +
> +
> +/* local variables */
> +
> +/* local function prototypes */
> +static int _vtpm_send_queued(struct tpm_chip *chip);
> +
> +
> +/* =============================================================
> + * Some utility functions
> + * =============================================================
> + */
> +static void vtpm_state_init(struct vtpm_state *vtpms)
> +{
> +	vtpms->current_request = NULL;
> +	spin_lock_init(&vtpms->req_list_lock);
> +	init_waitqueue_head(&vtpms->req_wait_queue);
> +	INIT_LIST_HEAD(&vtpms->queued_requests);
> +
> +	vtpms->current_response = NULL;
> +	spin_lock_init(&vtpms->resp_list_lock);
> +	init_waitqueue_head(&vtpms->resp_wait_queue);
> +
> +	vtpms->disconnect_time = jiffies;
> +}
> +
> +
> +static inline struct transmission *transmission_alloc(void)
> +{
> +	return kzalloc(sizeof(struct transmission), GFP_ATOMIC);
> +}
> +
> +	static unsigned char *


That is very weird tabbing? Did you run this patch through
scripts/checkpatch.pl ?

> +transmission_set_req_buffer(struct transmission *t,
> +		unsigned char *buffer, size_t len)
> +{
> +	if (t->request_buflen < len) {
> +		kfree(t->request);
> +		t->request = kmalloc(len, GFP_KERNEL);
> +		if (!t->request) {
> +			t->request_buflen = 0;
> +			return NULL;
> +		}
> +		t->request_buflen = len;
> +	}
> +
> +	memcpy(t->request, buffer, len);
> +	t->request_len = len;
> +
> +	return t->request;
> +}
> +
> +	static unsigned char *
> +transmission_set_res_buffer(struct transmission *t,
> +		const unsigned char *buffer, size_t len)
> +{
> +	if (t->response_buflen < len) {
> +		kfree(t->response);
> +		t->response = kmalloc(len, GFP_ATOMIC);
> +		if (!t->response) {
> +			t->response_buflen = 0;
> +			return NULL;
> +		}
> +		t->response_buflen = len;
> +	}
> +
> +	memcpy(t->response, buffer, len);
> +	t->response_len = len;
> +
> +	return t->response;
> +}
> +
> +static inline void transmission_free(struct transmission *t)
> +{
> +	kfree(t->request);
> +	kfree(t->response);
> +	kfree(t);
> +}
> +
> +/* =============================================================
> + * Interface with the lower layer driver
> + * =============================================================
> + */
> +/*
> + * Lower layer uses this function to make a response available.
> + */
> +int vtpm_vd_recv(const struct tpm_chip *chip,
> +		const unsigned char *buffer, size_t count,
> +		void *ptr)
> +{
> +	unsigned long flags;
> +	int ret_size = 0;
> +	struct transmission *t;
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	/*
> +	 * The list with requests must contain one request
> +	 * only and the element there must be the one that
> +	 * was passed to me from the front-end.
> +	 */
> +	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	if (vtpms->current_request != ptr) {
> +		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +		return 0;
> +	}
> +	t = vtpms->current_request;
> +	if (t) {
> +		transmission_free(t);
> +		vtpms->current_request = NULL;
> +	}
> +
> +	t = transmission_alloc();
> +	if (t) {
> +		if (!transmission_set_res_buffer(t, buffer, count)) {
> +			transmission_free(t);
> +			spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +			return -ENOMEM;
> +		}
> +		ret_size = count;
> +		vtpms->current_response = t;
> +		wake_up_interruptible(&vtpms->resp_wait_queue);
> +	}
> +	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +
> +	return ret_size;
> +}
> +
> +
> +/*
> + * Lower layer indicates its status (connected/disconnected)
> + */
> +void vtpm_vd_status(const struct tpm_chip *chip, u8 vd_status)
> +{
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	vtpms->vd_status = vd_status;
> +	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0)
> +		vtpms->disconnect_time = jiffies;
> +}
> +
> +/* =============================================================
> + * Interface with the generic TPM driver
> + * =============================================================
> + */
> +static int vtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count)
> +{
> +	int rc = 0;
> +	unsigned long flags;
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	/*
> +	 * Check if the previous operation only queued the command
> +	 * In this case there won't be a response, so I just
> +	 * return from here and reset that flag. In any other
> +	 * case I should receive a response from the back-end.
> +	 */
> +	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	if ((vtpms->flags & DATAEX_FLAG_QUEUED_ONLY) != 0) {
> +		vtpms->flags &= ~DATAEX_FLAG_QUEUED_ONLY;
> +		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +		/*
> +		 * The first few commands (measurements) must be
> +		 * queued since it might not be possible to talk to the
> +		 * TPM, yet.
> +		 * Return a response of up to 30 '0's.
> +		 */
> +
> +		count = min_t(size_t, count, 30);
> +		memset(buf, 0x0, count);
> +		return count;
> +	}
> +	/*
> +	 * Check whether something is in the responselist and if
> +	 * there's nothing in the list wait for something to appear.
> +	 */
> +
> +	if (!vtpms->current_response) {
> +		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +		interruptible_sleep_on_timeout(&vtpms->resp_wait_queue,
> +				1000);
> +		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	}
> +
> +	if (vtpms->current_response) {
> +		struct transmission *t = vtpms->current_response;
> +		vtpms->current_response = NULL;
> +		rc = min(count, t->response_len);
> +		memcpy(buf, t->response, rc);
> +		transmission_free(t);
> +	}
> +
> +	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +	return rc;
> +}
> +
> +static int vtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)
> +{
> +	int rc = 0;
> +	unsigned long flags;
> +	struct transmission *t = transmission_alloc();
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	if (!t)
> +		return -ENOMEM;
> +	/*
> +	 * If there's a current request, it must be the
> +	 * previous request that has timed out.
> +	 */
> +	spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +	if (vtpms->current_request != NULL) {
> +		dev_warn(chip->dev, "Sending although there is a request outstanding.\n"
> +				"         Previous request must have timed out.\n");
> +		transmission_free(vtpms->current_request);
> +		vtpms->current_request = NULL;
> +	}
> +	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
> +
> +	/*
> +	 * Queue the packet if the driver below is not
> +	 * ready, yet, or there is any packet already
> +	 * in the queue.
> +	 * If the driver below is ready, unqueue all
> +	 * packets first before sending our current
> +	 * packet.
> +	 * For each unqueued packet, except for the
> +	 * last (=current) packet, call the function
> +	 * tpm_xen_recv to wait for the response to come
> +	 * back.
> +	 */
> +	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0) {
> +		if (time_after(jiffies,
> +					vtpms->disconnect_time + HZ * 10)) {
> +			rc = -ENOENT;
> +		} else {
> +			goto queue_it;
> +		}
> +	} else {
> +		/*
> +		 * Send all queued packets.
> +		 */
> +		if (_vtpm_send_queued(chip) == 0) {
> +
> +			vtpms->current_request = t;
> +
> +			rc = vtpm_vd_send(vtpms->tpm_private,
> +					buf,
> +					count,
> +					t);
> +			/*
> +			 * The generic TPM driver will call
> +			 * the function to receive the response.
> +			 */
> +			if (rc < 0) {
> +				vtpms->current_request = NULL;
> +				goto queue_it;
> +			}
> +		} else {
> +queue_it:
> +			if (!transmission_set_req_buffer(t, buf, count)) {
> +				transmission_free(t);
> +				rc = -ENOMEM;
> +				goto exit;
> +			}
> +			/*
> +			 * An error occurred. Don't event try
> +			 * to send the current request. Just
> +			 * queue it.
> +			 */
> +			spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +			vtpms->flags |= DATAEX_FLAG_QUEUED_ONLY;
> +			list_add_tail(&t->next, &vtpms->queued_requests);
> +			spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
> +		}
> +	}
> +
> +exit:
> +	return rc;
> +}
> +
> +
> +/*
> + * Send all queued requests.
> + */
> +static int _vtpm_send_queued(struct tpm_chip *chip)
> +{
> +	int rc;
> +	int error = 0;
> +	unsigned long flags;
> +	unsigned char buffer[1];
> +	struct vtpm_state *vtpms;
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +
> +	while (!list_empty(&vtpms->queued_requests)) {
> +		/*
> +		 * Need to dequeue them.
> +		 * Read the result into a dummy buffer.
> +		 */
> +		struct transmission *qt = (struct transmission *)
> +			vtpms->queued_requests.next;
> +		list_del(&qt->next);
> +		vtpms->current_request = qt;
> +		spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
> +
> +		rc = vtpm_vd_send(vtpms->tpm_private,
> +				qt->request,
> +				qt->request_len,
> +				qt);
> +
> +		if (rc < 0) {
> +			spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +			qt = vtpms->current_request;
> +			if (qt != NULL) {
> +				/*
> +				 * requeue it at the beginning
> +				 * of the list
> +				 */
> +				list_add(&qt->next,
> +						&vtpms->queued_requests);
> +			}
> +			vtpms->current_request = NULL;
> +			error = 1;
> +			break;
> +		}
> +		/*
> +		 * After this point qt is not valid anymore!
> +		 * It is freed when the front-end is delivering
> +		 * the data by calling tpm_recv
> +		 */
> +		/*
> +		 * Receive response into provided dummy buffer
> +		 */
> +		rc = vtpm_recv(chip, buffer, sizeof(buffer));
> +		spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +	}
> +
> +	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
> +
> +	return error;
> +}
> +
> +static void vtpm_cancel(struct tpm_chip *chip)
> +{
> +	unsigned long flags;
> +	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +
> +	if (!vtpms->current_response && vtpms->current_request) {
> +		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +		interruptible_sleep_on(&vtpms->resp_wait_queue);
> +		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	}
> +
> +	if (vtpms->current_response) {
> +		struct transmission *t = vtpms->current_response;
> +		vtpms->current_response = NULL;
> +		transmission_free(t);
> +	}
> +
> +	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +}
> +
> +static u8 vtpm_status(struct tpm_chip *chip)
> +{
> +	u8 rc = 0;
> +	unsigned long flags;
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	/*
> +	 * Data are available if:
> +	 *  - there's a current response
> +	 *  - the last packet was queued only (this is fake, but necessary to
> +	 *      get the generic TPM layer to call the receive function.)
> +	 */
> +	if (vtpms->current_response ||
> +			0 != (vtpms->flags & DATAEX_FLAG_QUEUED_ONLY)) {
> +		rc = STATUS_DATA_AVAIL;
> +	} else if (!vtpms->current_response && !vtpms->current_request) {
> +		rc = STATUS_READY;
> +	}
> +
> +	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +	return rc;
> +}
> +
> +static const struct file_operations vtpm_ops = {
> +	.owner = THIS_MODULE,
> +	.llseek = no_llseek,
> +	.open = tpm_open,
> +	.read = tpm_read,
> +	.write = tpm_write,
> +	.release = tpm_release,
> +};
> +
> +static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
> +static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
> +static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);
> +static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL);
> +static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL);
> +static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,
> +		NULL);
> +static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL);
> +static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
> +
> +static struct attribute *vtpm_attrs[] = {
> +	&dev_attr_pubek.attr,
> +	&dev_attr_pcrs.attr,
> +	&dev_attr_enabled.attr,
> +	&dev_attr_active.attr,
> +	&dev_attr_owned.attr,
> +	&dev_attr_temp_deactivated.attr,
> +	&dev_attr_caps.attr,
> +	&dev_attr_cancel.attr,
> +	NULL,

So are these going to show up in SysFS? If so, there should also be
a corresponding file in Documentation/.../sysfs/something.

> +};
> +
> +static struct attribute_group vtpm_attr_grp = { .attrs = vtpm_attrs };
> +
> +#define TPM_LONG_TIMEOUT   (10 * 60 * HZ)
> +
> +static struct tpm_vendor_specific tpm_vtpm = {
> +	.recv = vtpm_recv,
> +	.send = vtpm_send,
> +	.cancel = vtpm_cancel,
> +	.status = vtpm_status,
> +	.req_complete_mask = STATUS_BUSY | STATUS_DATA_AVAIL,
> +	.req_complete_val  = STATUS_DATA_AVAIL,
> +	.req_canceled = STATUS_READY,
> +	.attr_group = &vtpm_attr_grp,
> +	.miscdev = {
> +		.fops = &vtpm_ops,
> +	},
> +	.duration = {
> +		TPM_LONG_TIMEOUT,
> +		TPM_LONG_TIMEOUT,
> +		TPM_LONG_TIMEOUT,
> +	},
> +};
> +
> +struct tpm_chip *init_vtpm(struct device *dev,
> +		struct tpm_private *tp)
> +{
> +	long rc;
> +	struct tpm_chip *chip;
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = kzalloc(sizeof(struct vtpm_state), GFP_KERNEL);
> +	if (!vtpms)
> +		return ERR_PTR(-ENOMEM);
> +
> +	vtpm_state_init(vtpms);
> +	vtpms->tpm_private = tp;
> +
> +	chip = tpm_register_hardware(dev, &tpm_vtpm);
> +	if (!chip) {
> +		rc = -ENODEV;
> +		goto err_free_mem;
> +	}
> +
> +	chip_set_private(chip, vtpms);
> +
> +	return chip;
> +
> +err_free_mem:
> +	kfree(vtpms);
> +
> +	return ERR_PTR(rc);
> +}
> +
> +void cleanup_vtpm(struct device *dev)
> +{
> +	struct tpm_chip *chip = dev_get_drvdata(dev);
> +	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
> +	tpm_remove_hardware(dev);
> +	kfree(vtpms);
> +}
> diff --git a/drivers/char/tpm/tpm_vtpm.h b/drivers/char/tpm/tpm_vtpm.h
> new file mode 100644
> index 0000000..d888fd8
> --- /dev/null
> +++ b/drivers/char/tpm/tpm_vtpm.h
> @@ -0,0 +1,55 @@
> +#ifndef TPM_VTPM_H
> +#define TPM_VTPM_H
> +
> +struct tpm_chip;
> +struct tpm_private;
> +
> +struct vtpm_state {
> +	struct transmission *current_request;
> +	spinlock_t           req_list_lock;
> +	wait_queue_head_t    req_wait_queue;
> +
> +	struct list_head     queued_requests;
> +
> +	struct transmission *current_response;
> +	spinlock_t           resp_list_lock;
> +	wait_queue_head_t    resp_wait_queue;
> +
> +	u8                   vd_status;
> +	u8                   flags;
> +
> +	unsigned long        disconnect_time;
> +
> +	/*
> +	 * The following is a private structure of the underlying
> +	 * driver. It is passed as parameter in the send function.
> +	 */
> +	struct tpm_private *tpm_private;
> +};
> +
> +
> +enum vdev_status {
> +	TPM_VD_STATUS_DISCONNECTED = 0x0,
> +	TPM_VD_STATUS_CONNECTED = 0x1
> +};
> +
> +/* this function is called from tpm_vtpm.c */
> +int vtpm_vd_send(struct tpm_private *tp,
> +		const u8 *buf, size_t count, void *ptr);
> +
> +/* these functions are offered by tpm_vtpm.c */
> +struct tpm_chip *init_vtpm(struct device *,
> +		struct tpm_private *);
> +void cleanup_vtpm(struct device *);
> +int vtpm_vd_recv(const struct tpm_chip *chip,
> +		const unsigned char *buffer, size_t count, void *ptr);
> +void vtpm_vd_status(const struct tpm_chip *, u8 status);
> +
> +static inline struct tpm_private *tpm_private_from_dev(struct device *dev)
> +{
> +	struct tpm_chip *chip = dev_get_drvdata(dev);
> +	struct vtpm_state *vtpms = chip_get_private(chip);
> +	return vtpms->tpm_private;
> +}
> +
> +#endif
> diff --git a/drivers/char/tpm/tpm_xen.c b/drivers/char/tpm/tpm_xen.c
> new file mode 100644
> index 0000000..7198de3
> --- /dev/null
> +++ b/drivers/char/tpm/tpm_xen.c
> @@ -0,0 +1,690 @@
> +/*
> + * Copyright (c) 2005, IBM Corporation
> + *
> + * Author: Stefan Berger, stefanb@us.ibm.com
> + * Grant table support: Mahadevan Gomathisankaran
> + *
> + * This code has been derived from drivers/xen/netfront/netfront.c
> + *
> + * Copyright (c) 2002-2004, K A Fraser
> + *
> + * 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.
> + */
> +
> +#include <linux/errno.h>
> +#include <linux/err.h>
> +#include <linux/interrupt.h>
> +#include <linux/mutex.h>
> +#include <linux/uaccess.h>
> +#include <xen/events.h>
> +#include <xen/interface/grant_table.h>
> +#include <xen/interface/io/tpmif.h>
> +#include <xen/grant_table.h>
> +#include <xen/xenbus.h>
> +#include <xen/page.h>
> +#include "tpm.h"
> +#include "tpm_vtpm.h"
> +
> +#undef DEBUG
> +
> +#define GRANT_INVALID_REF 0

Interesting. The 0 grant value is actually a valid one. I think you
want (-1ULL).

> +
> +/* local structures */
> +struct tpm_private {
> +	struct tpm_chip *chip;
> +
> +	tpmif_tx_interface_t *tx;
> +	atomic_t refcnt;
> +	unsigned int evtchn;
> +	u8 is_connected;
> +	u8 is_suspended;
> +
> +	spinlock_t tx_lock;
> +
> +	struct tx_buffer *tx_buffers[TPMIF_TX_RING_SIZE];
> +
> +	atomic_t tx_busy;
> +	void *tx_remember;
> +
> +	domid_t backend_id;
> +	wait_queue_head_t wait_q;
> +
> +	struct xenbus_device *dev;
> +	int ring_ref;
> +};
> +
> +struct tx_buffer {
> +	unsigned int size;	/* available space in data */
> +	unsigned int len;	/* used space in data */
> +	unsigned char *data;	/* pointer to a page */
> +};
> +
> +
> +/* locally visible variables */
> +static grant_ref_t gref_head;
> +static struct tpm_private *my_priv;
> +
> +/* local function prototypes */
> +static irqreturn_t tpmif_int(int irq,
> +		void *tpm_priv);
> +static void tpmif_rx_action(unsigned long unused);
> +static int tpmif_connect(struct xenbus_device *dev,
> +		struct tpm_private *tp,
> +		domid_t domid);
> +static DECLARE_TASKLET(tpmif_rx_tasklet, tpmif_rx_action, 0);
> +static int tpmif_allocate_tx_buffers(struct tpm_private *tp);
> +static void tpmif_free_tx_buffers(struct tpm_private *tp);
> +static void tpmif_set_connected_state(struct tpm_private *tp,
> +		u8 newstate);
> +static int tpm_xmit(struct tpm_private *tp,
> +		const u8 *buf, size_t count, int userbuffer,
> +		void *remember);
> +static void destroy_tpmring(struct tpm_private *tp);
> +
> +	static inline int
> +tx_buffer_copy(struct tx_buffer *txb, const u8 *src, int len,
> +		int isuserbuffer)
> +{
> +	int copied = len;
> +
> +	if (len > txb->size)
> +		copied = txb->size;
> +	if (isuserbuffer) {
> +		if (copy_from_user(txb->data, src, copied))
> +			return -EFAULT;
> +	} else {
> +		memcpy(txb->data, src, copied);
> +	}
> +	txb->len = len;
> +	return copied;
> +}
> +
> +static inline struct tx_buffer *tx_buffer_alloc(void)
> +{
> +	struct tx_buffer *txb;
> +
> +	txb = kzalloc(sizeof(struct tx_buffer), GFP_KERNEL);
> +	if (!txb)
> +		return NULL;
> +
> +	txb->len = 0;
> +	txb->size = PAGE_SIZE;
> +	txb->data = (unsigned char *)__get_free_page(GFP_KERNEL);
> +	if (txb->data == NULL) {
> +		kfree(txb);
> +		txb = NULL;
> +	}
> +
> +	return txb;
> +}
> +
> +
> +static inline void tx_buffer_free(struct tx_buffer *txb)
> +{
> +	if (txb) {
> +		free_page((long)txb->data);
> +		kfree(txb);
> +	}
> +}
> +
> +/**************************************************************
> +  Utility function for the tpm_private structure
> + **************************************************************/
> +static void tpm_private_init(struct tpm_private *tp)
> +{
> +	spin_lock_init(&tp->tx_lock);
> +	init_waitqueue_head(&tp->wait_q);
> +	atomic_set(&tp->refcnt, 1);
> +}
> +
> +static void tpm_private_put(void)
> +{
> +	if (!atomic_dec_and_test(&my_priv->refcnt))
> +		return;
> +
> +	tpmif_free_tx_buffers(my_priv);
> +	kfree(my_priv);
> +	my_priv = NULL;
> +}
> +
> +static struct tpm_private *tpm_private_get(void)
> +{
> +	int err;
> +
> +	if (my_priv) {
> +		atomic_inc(&my_priv->refcnt);
> +		return my_priv;
> +	}
> +
> +	my_priv = kzalloc(sizeof(struct tpm_private), GFP_KERNEL);
> +	if (!my_priv)
> +		return NULL;
> +
> +	tpm_private_init(my_priv);
> +	err = tpmif_allocate_tx_buffers(my_priv);
> +	if (err < 0)
> +		tpm_private_put();
> +
> +	return my_priv;
> +}
> +
> +/**************************************************************
> +
> +  The interface to let the tpm plugin register its callback
> +  function and send data to another partition using this module
> +
> + **************************************************************/
> +
> +static DEFINE_MUTEX(suspend_lock);
> +/*
> + * Send data via this module by calling this function
> + */
> +int vtpm_vd_send(struct tpm_private *tp,
> +		const u8 *buf, size_t count, void *ptr)
> +{
> +	int sent;
> +
> +	mutex_lock(&suspend_lock);
> +	sent = tpm_xmit(tp, buf, count, 0, ptr);
> +	mutex_unlock(&suspend_lock);
> +
> +	return sent;
> +}
> +
> +/**************************************************************
> +  XENBUS support code
> + **************************************************************/
> +
> +static int setup_tpmring(struct xenbus_device *dev,
> +		struct tpm_private *tp)
> +{
> +	tpmif_tx_interface_t *sring;
> +	int err;
> +
> +	tp->ring_ref = GRANT_INVALID_REF;
> +
> +	sring = (void *)__get_free_page(GFP_KERNEL);
> +	if (!sring) {
> +		xenbus_dev_fatal(dev, -ENOMEM, "allocating shared ring");
> +		return -ENOMEM;
> +	}
> +	tp->tx = sring;
> +
> +	err = xenbus_grant_ring(dev, virt_to_mfn(tp->tx));
> +	if (err < 0) {
> +		free_page((unsigned long)sring);
> +		tp->tx = NULL;
> +		xenbus_dev_fatal(dev, err, "allocating grant reference");
> +		goto fail;
> +	}
> +	tp->ring_ref = err;
> +
> +	err = tpmif_connect(dev, tp, dev->otherend_id);
> +	if (err)
> +		goto fail;
> +
> +	return 0;
> +fail:
> +	destroy_tpmring(tp);
> +	return err;
> +}
> +
> +
> +static void destroy_tpmring(struct tpm_private *tp)
> +{
> +	tpmif_set_connected_state(tp, 0);
> +
> +	if (tp->ring_ref != GRANT_INVALID_REF) {
> +		gnttab_end_foreign_access(tp->ring_ref,
> +				0, (unsigned long)tp->tx);
> +		tp->ring_ref = GRANT_INVALID_REF;
> +		tp->tx = NULL;
> +	}
> +
> +	if (tp->evtchn)
> +		unbind_from_irqhandler(irq_from_evtchn(tp->evtchn), tp);
> +
> +	tp->evtchn = GRANT_INVALID_REF;
> +}
> +
> +
> +static int talk_to_backend(struct xenbus_device *dev,
> +		struct tpm_private *tp)
> +{
> +	const char *message = NULL;
> +	int err;
> +	struct xenbus_transaction xbt;
> +
> +	err = setup_tpmring(dev, tp);
> +	if (err) {
> +		xenbus_dev_fatal(dev, err, "setting up ring");
> +		goto out;
> +	}
> +
> +again:
> +	err = xenbus_transaction_start(&xbt);
> +	if (err) {
> +		xenbus_dev_fatal(dev, err, "starting transaction");
> +		goto destroy_tpmring;
> +	}
> +
> +	err = xenbus_printf(xbt, dev->nodename,
> +			"ring-ref", "%u", tp->ring_ref);
> +	if (err) {
> +		message = "writing ring-ref";
> +		goto abort_transaction;
> +	}
> +
> +	err = xenbus_printf(xbt, dev->nodename, "event-channel", "%u",
> +			tp->evtchn);
> +	if (err) {
> +		message = "writing event-channel";
> +		goto abort_transaction;
> +	}
> +
> +	err = xenbus_transaction_end(xbt, 0);
> +	if (err == -EAGAIN)
> +		goto again;
> +	if (err) {
> +		xenbus_dev_fatal(dev, err, "completing transaction");
> +		goto destroy_tpmring;
> +	}
> +
> +	xenbus_switch_state(dev, XenbusStateConnected);
> +
> +	return 0;
> +
> +abort_transaction:
> +	xenbus_transaction_end(xbt, 1);
> +	if (message)
> +		xenbus_dev_error(dev, err, "%s", message);
> +destroy_tpmring:
> +	destroy_tpmring(tp);
> +out:
> +	return err;
> +}
> +
> +/**
> + * Callback received when the backend's state changes.
> + */
> +static void backend_changed(struct xenbus_device *dev,
> +		enum xenbus_state backend_state)
> +{
> +	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
> +
> +	switch (backend_state) {
> +	case XenbusStateInitialising:
> +	case XenbusStateInitWait:
> +	case XenbusStateInitialised:
> +	case XenbusStateReconfiguring:
> +	case XenbusStateReconfigured:
> +	case XenbusStateUnknown:
> +		break;
> +
> +	case XenbusStateConnected:
> +		tpmif_set_connected_state(tp, 1);
> +		break;
> +
> +	case XenbusStateClosing:
> +		tpmif_set_connected_state(tp, 0);
> +		xenbus_frontend_closed(dev);
> +		break;
> +
> +	case XenbusStateClosed:
> +		tpmif_set_connected_state(tp, 0);
> +		if (tp->is_suspended == 0)
> +			device_unregister(&dev->dev);
> +		xenbus_frontend_closed(dev);
> +		break;
> +	}
> +}
> +
> +static int tpmfront_probe(struct xenbus_device *dev,
> +		const struct xenbus_device_id *id)
> +{
> +	int err;
> +	int handle;
> +	struct tpm_private *tp = tpm_private_get();
> +
> +	if (!tp)
> +		return -ENOMEM;
> +
> +	tp->chip = init_vtpm(&dev->dev, tp);
> +	if (IS_ERR(tp->chip))
> +		return PTR_ERR(tp->chip);
> +
> +	err = xenbus_scanf(XBT_NIL, dev->nodename,
> +			"handle", "%i", &handle);
> +	if (XENBUS_EXIST_ERR(err))
> +		return err;
> +
> +	if (err < 0) {
> +		xenbus_dev_fatal(dev, err, "reading virtual-device");
> +		return err;
> +	}
> +
> +	tp->dev = dev;
> +
> +	err = talk_to_backend(dev, tp);
> +	if (err) {
> +		tpm_private_put();
> +		return err;
> +	}
> +
> +	return 0;
> +}
> +
> +
> +static int __devexit tpmfront_remove(struct xenbus_device *dev)
> +{
> +	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
> +	destroy_tpmring(tp);
> +	cleanup_vtpm(&dev->dev);
> +	return 0;
> +}
> +
> +static int tpmfront_suspend(struct xenbus_device *dev)
> +{
> +	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
> +	u32 ctr;
> +
> +	/* Take the lock, preventing any application from sending. */
> +	mutex_lock(&suspend_lock);
> +	tp->is_suspended = 1;
> +
> +	for (ctr = 0; atomic_read(&tp->tx_busy); ctr++) {
> +		/* Wait for a request to be responded to. */
> +		interruptible_sleep_on_timeout(&tp->wait_q, 100);
> +	}
> +
> +	return 0;
> +}
> +
> +static int tpmfront_suspend_finish(struct tpm_private *tp)
> +{
> +	tp->is_suspended = 0;
> +	/* Allow applications to send again. */
> +	mutex_unlock(&suspend_lock);
> +	return 0;
> +}
> +
> +static int tpmfront_resume(struct xenbus_device *dev)
> +{
> +	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
> +	destroy_tpmring(tp);
> +	return talk_to_backend(dev, tp);
> +}
> +
> +static int tpmif_connect(struct xenbus_device *dev,
> +		struct tpm_private *tp,
> +		domid_t domid)
> +{
> +	int err;
> +
> +	tp->backend_id = domid;
> +	tp->evtchn = GRANT_INVALID_REF;
> +
> +	err = xenbus_alloc_evtchn(dev, &tp->evtchn);
> +	if (err)
> +		return err;
> +
> +	err = bind_evtchn_to_irqhandler(tp->evtchn, tpmif_int,
> +			0, "tpmif", tp);
> +	if (err <= 0)
> +		return err;
> +
> +	return 0;
> +}
> +
> +static const struct xenbus_device_id tpmfront_ids[] = {
> +	{ "vtpm" },
> +	{ "" }
> +};
> +MODULE_ALIAS("xen:vtpm");
> +
> +static DEFINE_XENBUS_DRIVER(tpmfront, ,
> +		.probe = tpmfront_probe,
> +		.remove =  __devexit_p(tpmfront_remove),
> +		.resume = tpmfront_resume,
> +		.otherend_changed = backend_changed,
> +		.suspend = tpmfront_suspend,
> +		);
> +
> +static int __init init_tpm_xenbus(void)
> +{
> +	return xenbus_register_frontend(&tpmfront_driver);
> +}
> +
> +static int tpmif_allocate_tx_buffers(struct tpm_private *tp)
> +{
> +	unsigned int i;
> +
> +	for (i = 0; i < TPMIF_TX_RING_SIZE; i++) {
> +		tp->tx_buffers[i] = tx_buffer_alloc();
> +		if (!tp->tx_buffers[i]) {
> +			tpmif_free_tx_buffers(tp);
> +			return -ENOMEM;
> +		}
> +	}
> +	return 0;
> +}
> +
> +static void tpmif_free_tx_buffers(struct tpm_private *tp)
> +{
> +	unsigned int i;
> +
> +	for (i = 0; i < TPMIF_TX_RING_SIZE; i++)
> +		tx_buffer_free(tp->tx_buffers[i]);
> +}
> +
> +static void tpmif_rx_action(unsigned long priv)
> +{
> +	struct tpm_private *tp = (struct tpm_private *)priv;
> +	int i = 0;
> +	unsigned int received;
> +	unsigned int offset = 0;
> +	u8 *buffer;
> +	tpmif_tx_request_t *tx = &tp->tx->ring[i].req;
> +
> +	atomic_set(&tp->tx_busy, 0);
> +	wake_up_interruptible(&tp->wait_q);
> +
> +	received = tx->size;
> +
> +	buffer = kmalloc(received, GFP_ATOMIC);
> +	if (!buffer)
> +		return;
> +
> +	for (i = 0; i < TPMIF_TX_RING_SIZE && offset < received; i++) {
> +		struct tx_buffer *txb = tp->tx_buffers[i];
> +		tpmif_tx_request_t *tx;
> +		unsigned int tocopy;
> +
> +		tx = &tp->tx->ring[i].req;
> +		tocopy = tx->size;
> +		if (tocopy > PAGE_SIZE)
> +			tocopy = PAGE_SIZE;
> +
> +		memcpy(&buffer[offset], txb->data, tocopy);
> +
> +		gnttab_release_grant_reference(&gref_head, tx->ref);
> +
> +		offset += tocopy;
> +	}
> +
> +	vtpm_vd_recv(tp->chip, buffer, received, tp->tx_remember);
> +	kfree(buffer);
> +}
> +
> +
> +static irqreturn_t tpmif_int(int irq, void *tpm_priv)
> +{
> +	struct tpm_private *tp = tpm_priv;
> +	unsigned long flags;
> +
> +	spin_lock_irqsave(&tp->tx_lock, flags);
> +	tpmif_rx_tasklet.data = (unsigned long)tp;
> +	tasklet_schedule(&tpmif_rx_tasklet);
> +	spin_unlock_irqrestore(&tp->tx_lock, flags);
> +
> +	return IRQ_HANDLED;
> +}
> +
> +
> +static int tpm_xmit(struct tpm_private *tp,
> +		const u8 *buf, size_t count, int isuserbuffer,
> +		void *remember)
> +{
> +	tpmif_tx_request_t *tx;
> +	TPMIF_RING_IDX i;
> +	unsigned int offset = 0;
> +
> +	spin_lock_irq(&tp->tx_lock);
> +
> +	if (unlikely(atomic_read(&tp->tx_busy))) {
> +		spin_unlock_irq(&tp->tx_lock);
> +		return -EBUSY;
> +	}
> +
> +	if (tp->is_connected != 1) {
> +		spin_unlock_irq(&tp->tx_lock);
> +		return -EIO;
> +	}
> +
> +	for (i = 0; count > 0 && i < TPMIF_TX_RING_SIZE; i++) {
> +		struct tx_buffer *txb = tp->tx_buffers[i];
> +		int copied;
> +
> +		if (!txb) {
> +			spin_unlock_irq(&tp->tx_lock);
> +			return -EFAULT;
> +		}
> +
> +		copied = tx_buffer_copy(txb, &buf[offset], count,
> +				isuserbuffer);
> +		if (copied < 0) {
> +			/* An error occurred */
> +			spin_unlock_irq(&tp->tx_lock);
> +			return copied;
> +		}
> +		count -= copied;
> +		offset += copied;
> +
> +		tx = &tp->tx->ring[i].req;
> +		tx->addr = virt_to_machine(txb->data).maddr;
> +		tx->size = txb->len;
> +		tx->unused = 0;
> +
> +		/* Get the granttable reference for this page. */
> +		tx->ref = gnttab_claim_grant_reference(&gref_head);
> +		if (tx->ref == -ENOSPC) {
> +			spin_unlock_irq(&tp->tx_lock);
> +			return -ENOSPC;
> +		}
> +		gnttab_grant_foreign_access_ref(tx->ref,
> +				tp->backend_id,
> +				virt_to_mfn(txb->data),
> +				0 /*RW*/);
> +		wmb();
> +	}
> +
> +	atomic_set(&tp->tx_busy, 1);
> +	tp->tx_remember = remember;
> +
> +	mb();
> +
> +	notify_remote_via_evtchn(tp->evtchn);
> +
> +	spin_unlock_irq(&tp->tx_lock);
> +	return offset;
> +}
> +
> +
> +static void tpmif_notify_upperlayer(struct tpm_private *tp)
> +{
> +	/* Notify upper layer about the state of the connection to the BE. */
> +	vtpm_vd_status(tp->chip, (tp->is_connected
> +				? TPM_VD_STATUS_CONNECTED
> +				: TPM_VD_STATUS_DISCONNECTED));
> +}
> +
> +
> +static void tpmif_set_connected_state(struct tpm_private *tp, u8 is_connected)
> +{
> +	/*
> +	 * Don't notify upper layer if we are in suspend mode and
> +	 * should disconnect - assumption is that we will resume
> +	 * The mutex keeps apps from sending.
> +	 */
> +	if (is_connected == 0 && tp->is_suspended == 1)
> +		return;
> +
> +	/*
> +	 * Unlock the mutex if we are connected again
> +	 * after being suspended - now resuming.
> +	 * This also removes the suspend state.
> +	 */
> +	if (is_connected == 1 && tp->is_suspended == 1)
> +		tpmfront_suspend_finish(tp);
> +
> +	if (is_connected != tp->is_connected) {
> +		tp->is_connected = is_connected;
> +		tpmif_notify_upperlayer(tp);
> +	}
> +}
> +
> +
> +
> +/* =================================================================
> + * Initialization function.
> + * =================================================================
> + */
> +
> +
> +static int __init tpmif_init(void)
> +{
> +	struct tpm_private *tp;
> +
> +	if (!xen_domain())
> +		return -ENODEV;
> +
> +	tp = tpm_private_get();
> +	if (!tp)
> +		return -ENOMEM;
> +
> +	if (gnttab_alloc_grant_references(TPMIF_TX_RING_SIZE,
> +				&gref_head) < 0) {
> +		tpm_private_put();
> +		return -EFAULT;
> +	}
> +
> +	init_tpm_xenbus();
> +	return 0;
> +}
> +
> +
> +module_init(tpmif_init);

no module_exit?

> +
> +MODULE_LICENSE("Dual BSD/GPL");
> diff --git a/include/xen/interface/io/tpmif.h b/include/xen/interface/io/tpmif.h
> new file mode 100644
> index 0000000..5342fca
> --- /dev/null
> +++ b/include/xen/interface/io/tpmif.h
> @@ -0,0 +1,77 @@
> +/******************************************************************************
> + * tpmif.h
> + *
> + * TPM I/O interface for Xen guest OSes.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a copy
> + * of this software and associated documentation files (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.
> + *
> + * Copyright (c) 2005, IBM Corporation
> + *
> + * Author: Stefan Berger, stefanb@us.ibm.com
> + * Grant table support: Mahadevan Gomathisankaran
> + *
> + * This code has been derived from tools/libxc/xen/io/netif.h
> + *
> + * Copyright (c) 2003-2004, Keir Fraser
> + */
> +
> +#ifndef __XEN_PUBLIC_IO_TPMIF_H__
> +#define __XEN_PUBLIC_IO_TPMIF_H__
> +
> +#include "../grant_table.h"
> +
> +struct tpmif_tx_request {
> +	unsigned long addr;   /* Machine address of packet.   */
> +	grant_ref_t ref;      /* grant table access reference */
> +	uint16_t unused;
> +	uint16_t size;        /* Packet size in bytes.        */
> +};
> +typedef struct tpmif_tx_request tpmif_tx_request_t;
> +
> +/*
> + * The TPMIF_TX_RING_SIZE defines the number of pages the
> + * front-end and backend can exchange (= size of array).
> + */
> +typedef uint32_t TPMIF_RING_IDX;
> +
> +#define TPMIF_TX_RING_SIZE 1
> +
> +/* This structure must fit in a memory page. */
> +
> +struct tpmif_ring {
> +	struct tpmif_tx_request req;
> +};
> +typedef struct tpmif_ring tpmif_ring_t;
> +
> +struct tpmif_tx_interface {
> +	struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
> +};
> +typedef struct tpmif_tx_interface tpmif_tx_interface_t;
> +
> +#endif
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-set-style: "BSD"
> + * c-basic-offset: 4
> + * tab-width: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> -- 
> 1.7.10.4

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 20:14:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 20:14:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVpWi-0005px-B8; Tue, 06 Nov 2012 20:13:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TVpWh-0005ps-3q
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 20:13:35 +0000
Received: from [85.158.143.35:10228] by server-3.bemta-4.messagelabs.com id
	D4/EE-06841-E6F69905; Tue, 06 Nov 2012 20:13:34 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1352232808!11706774!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjY2OTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6143 invoked from network); 6 Nov 2012 20:13:30 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-10.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 20:13:30 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6KDCvc014804
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 20:13:13 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6KDBTx015763
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 20:13:12 GMT
Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6KDBoq031926; Tue, 6 Nov 2012 14:13:11 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 06 Nov 2012 12:13:11 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id C5FAC4042D; Tue,  6 Nov 2012 15:00:28 -0500 (EST)
Date: Tue, 6 Nov 2012 15:00:28 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: xen-devel@lists.xensource.com, roger.pau@citrix.com
Message-ID: <20121106200028.GA29457@phenom.dumpdata.com>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Subject: [Xen-devel] git pull for Jens for 3.8 (xen-blkback related,
	feature-persistent).
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hey Roger,

I tested the feature-persistent patches and they rolled out succesfully out
of the test system. This is a bootup test with 32/64 dom0, 32/64 PV/PVHVM domU, with
new and old OS-es.

I am thinking to send a git pull on Friday to Jens so that they will be part of
Linux v3.8.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 20:14:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 20:14:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVpWi-0005px-B8; Tue, 06 Nov 2012 20:13:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TVpWh-0005ps-3q
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 20:13:35 +0000
Received: from [85.158.143.35:10228] by server-3.bemta-4.messagelabs.com id
	D4/EE-06841-E6F69905; Tue, 06 Nov 2012 20:13:34 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1352232808!11706774!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjY2OTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6143 invoked from network); 6 Nov 2012 20:13:30 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-10.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 20:13:30 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6KDCvc014804
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 20:13:13 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6KDBTx015763
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 20:13:12 GMT
Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6KDBoq031926; Tue, 6 Nov 2012 14:13:11 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 06 Nov 2012 12:13:11 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id C5FAC4042D; Tue,  6 Nov 2012 15:00:28 -0500 (EST)
Date: Tue, 6 Nov 2012 15:00:28 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: xen-devel@lists.xensource.com, roger.pau@citrix.com
Message-ID: <20121106200028.GA29457@phenom.dumpdata.com>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Subject: [Xen-devel] git pull for Jens for 3.8 (xen-blkback related,
	feature-persistent).
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hey Roger,

I tested the feature-persistent patches and they rolled out succesfully out
of the test system. This is a bootup test with 32/64 dom0, 32/64 PV/PVHVM domU, with
new and old OS-es.

I am thinking to send a git pull on Friday to Jens so that they will be part of
Linux v3.8.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 20:28:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 20:28:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVpl0-0005zq-PO; Tue, 06 Nov 2012 20:28:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TVpkz-0005zl-8m
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 20:28:21 +0000
Received: from [193.109.254.147:48098] by server-9.bemta-14.messagelabs.com id
	06/4F-30773-4E279905; Tue, 06 Nov 2012 20:28:20 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-10.tower-27.messagelabs.com!1352233699!3695439!1
X-Originating-IP: [81.169.146.176]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NiA9PiAyNTY3MQ==\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NiA9PiAyNTY3MQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4687 invoked from network); 6 Nov 2012 20:28:20 -0000
Received: from mo-p04-ob.rzone.de (HELO mo-p04-ob.rzone.de) (81.169.146.176)
	by server-10.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 20:28:20 -0000
X-RZG-CLASS-ID: mo04
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmxtMZ80VwmRNV7qE=
Received: from probook.site (ip-80-226-24-4.vodafone-net.de [80.226.24.4])
	by smtp.strato.de (josoe mo11) (RZmta 30.22 SBL|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id 002fb9oA6KHuvU
	for <xen-devel@lists.xen.org>; Tue, 6 Nov 2012 21:28:19 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 8574A189BB; Tue,  6 Nov 2012 21:28:16 +0100 (CET)
Date: Tue, 6 Nov 2012 21:28:16 +0100
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xen.org
Message-ID: <20121106202816.GA29655@aepfle.de>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Subject: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


We got a customer report about long-lasting and then failing live
migration of busy guests.

The guest has 64G memory, is busy with its set of applications and as a
result there will be always dirty pages to transfer. While some of this
can be solved with faster network connection, the underlying issue is
that tools/libxc/xc_domain_save.c:xc_domain_save will suspend a domain
after a given number of iterations to transfer the remaining dirty
pages. From what I understand this pausing of the guest (I dont know how
long it is actually paused) is causing issues within the guest, the
applications start to fail (again, no details).

Their suggestion is to add some knob to the overall live migration
process to avoid the suspend. If the guest could not be transfered with
the parameters passed to xc_domain_save(), abort the migration and let
it running on the old host.


My questions are:
Was such issue ever seen elsewhere?
Should 'xm migrate --live' and 'xl migrate' get something like a
--no-suspend option?


Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 20:28:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 20:28:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVpl0-0005zq-PO; Tue, 06 Nov 2012 20:28:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TVpkz-0005zl-8m
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 20:28:21 +0000
Received: from [193.109.254.147:48098] by server-9.bemta-14.messagelabs.com id
	06/4F-30773-4E279905; Tue, 06 Nov 2012 20:28:20 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-10.tower-27.messagelabs.com!1352233699!3695439!1
X-Originating-IP: [81.169.146.176]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NiA9PiAyNTY3MQ==\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NiA9PiAyNTY3MQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4687 invoked from network); 6 Nov 2012 20:28:20 -0000
Received: from mo-p04-ob.rzone.de (HELO mo-p04-ob.rzone.de) (81.169.146.176)
	by server-10.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 20:28:20 -0000
X-RZG-CLASS-ID: mo04
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmxtMZ80VwmRNV7qE=
Received: from probook.site (ip-80-226-24-4.vodafone-net.de [80.226.24.4])
	by smtp.strato.de (josoe mo11) (RZmta 30.22 SBL|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id 002fb9oA6KHuvU
	for <xen-devel@lists.xen.org>; Tue, 6 Nov 2012 21:28:19 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 8574A189BB; Tue,  6 Nov 2012 21:28:16 +0100 (CET)
Date: Tue, 6 Nov 2012 21:28:16 +0100
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xen.org
Message-ID: <20121106202816.GA29655@aepfle.de>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Subject: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


We got a customer report about long-lasting and then failing live
migration of busy guests.

The guest has 64G memory, is busy with its set of applications and as a
result there will be always dirty pages to transfer. While some of this
can be solved with faster network connection, the underlying issue is
that tools/libxc/xc_domain_save.c:xc_domain_save will suspend a domain
after a given number of iterations to transfer the remaining dirty
pages. From what I understand this pausing of the guest (I dont know how
long it is actually paused) is causing issues within the guest, the
applications start to fail (again, no details).

Their suggestion is to add some knob to the overall live migration
process to avoid the suspend. If the guest could not be transfered with
the parameters passed to xc_domain_save(), abort the migration and let
it running on the old host.


My questions are:
Was such issue ever seen elsewhere?
Should 'xm migrate --live' and 'xl migrate' get something like a
--no-suspend option?


Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 20:41:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 20:41:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVpxH-0006A3-2o; Tue, 06 Nov 2012 20:41:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TVpxF-00069x-4J
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 20:41:01 +0000
Received: from [85.158.137.99:48918] by server-6.bemta-3.messagelabs.com id
	09/35-28265-CD579905; Tue, 06 Nov 2012 20:41:00 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1352234457!12952810!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0MTM4Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 689 invoked from network); 6 Nov 2012 20:40:59 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-3.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 20:40:59 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6Ketee009677
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 20:40:56 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6Ket6h000328
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 20:40:55 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6KescZ015014; Tue, 6 Nov 2012 14:40:54 -0600
MIME-Version: 1.0
Message-ID: <dca4f543-0031-4b2c-ba38-9d4876306881@default>
Date: Tue, 6 Nov 2012 12:40:54 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<5092DE7E020000780008EB96@nat28.tlf.novell.com>
	<75058642-ad3b-4df9-a24a-7dbdc5f6e8c5@default>
	<5093954902000078000A5F45@nat28.tlf.novell.com>
	<00c25fab-a110-4f4b-a596-6cdfeb5b0d26@default>
	<5098E9FC02000078000A69A7@nat28.tlf.novell.com>
In-Reply-To: <5098E9FC02000078000A69A7@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Tuesday, November 06, 2012 2:44 AM
> To: Dan Magenheimer
> Cc: xen-devel@lists.xen.org; keir@xen.org
> Subject: RE: 32bit xen and "claim"
> 
> >>> On 05.11.12 at 20:16, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> > Does it make sense to have a runtime option that unsets the
> > physical limit but disallows legacy PV guests?  If this
> > defaults to false for machines with RAM<=5TB but to true
> > for machines with RAM>5TB, then the feature is "done"
> > (AND we have put a stake in the ground to begin the
> > slow obsolescence of PV functionality).
> 
> That would be interesting: Mukesh's PVH code wasn't even
> posted yet, i.e. you're proposing to render systems with more
> than 5Tb unbootable (for the lack of a - necessarily PV - Dom0
> kernel runnable in that environment).

Good point.  BUT... couldn't a PV dom0 started with dom0_mem=X
(where X is smaller than 5GB) still work?
 
> But yes, the plan is to extend the 1:1 mapping beyond 5Tb for
> non-PV guests, and going through actual mapping code only
> when acting in the context of a (64-bit) PV guest (even 32-bit
> PV guests can have the full 1:1 mapping).

That makes sense.  I guess I am just worried that this will
require enough surgery that there will be a long bug tail.
And, since 5TB machines will be quite rare for the next
year or so, deprecating PV domains on those machines earlier
than on smaller machines might have a much smaller impact
on the Xen community.

But this is all just a suggestion... I will stop now and
leave it in your capable hands.

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 20:41:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 20:41:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVpxH-0006A3-2o; Tue, 06 Nov 2012 20:41:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TVpxF-00069x-4J
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 20:41:01 +0000
Received: from [85.158.137.99:48918] by server-6.bemta-3.messagelabs.com id
	09/35-28265-CD579905; Tue, 06 Nov 2012 20:41:00 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1352234457!12952810!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0MTM4Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 689 invoked from network); 6 Nov 2012 20:40:59 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-3.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 20:40:59 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6Ketee009677
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 20:40:56 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6Ket6h000328
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 20:40:55 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6KescZ015014; Tue, 6 Nov 2012 14:40:54 -0600
MIME-Version: 1.0
Message-ID: <dca4f543-0031-4b2c-ba38-9d4876306881@default>
Date: Tue, 6 Nov 2012 12:40:54 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<5092DE7E020000780008EB96@nat28.tlf.novell.com>
	<75058642-ad3b-4df9-a24a-7dbdc5f6e8c5@default>
	<5093954902000078000A5F45@nat28.tlf.novell.com>
	<00c25fab-a110-4f4b-a596-6cdfeb5b0d26@default>
	<5098E9FC02000078000A69A7@nat28.tlf.novell.com>
In-Reply-To: <5098E9FC02000078000A69A7@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Tuesday, November 06, 2012 2:44 AM
> To: Dan Magenheimer
> Cc: xen-devel@lists.xen.org; keir@xen.org
> Subject: RE: 32bit xen and "claim"
> 
> >>> On 05.11.12 at 20:16, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> > Does it make sense to have a runtime option that unsets the
> > physical limit but disallows legacy PV guests?  If this
> > defaults to false for machines with RAM<=5TB but to true
> > for machines with RAM>5TB, then the feature is "done"
> > (AND we have put a stake in the ground to begin the
> > slow obsolescence of PV functionality).
> 
> That would be interesting: Mukesh's PVH code wasn't even
> posted yet, i.e. you're proposing to render systems with more
> than 5Tb unbootable (for the lack of a - necessarily PV - Dom0
> kernel runnable in that environment).

Good point.  BUT... couldn't a PV dom0 started with dom0_mem=X
(where X is smaller than 5GB) still work?
 
> But yes, the plan is to extend the 1:1 mapping beyond 5Tb for
> non-PV guests, and going through actual mapping code only
> when acting in the context of a (64-bit) PV guest (even 32-bit
> PV guests can have the full 1:1 mapping).

That makes sense.  I guess I am just worried that this will
require enough surgery that there will be a long bug tail.
And, since 5TB machines will be quite rare for the next
year or so, deprecating PV domains on those machines earlier
than on smaller machines might have a much smaller impact
on the Xen community.

But this is all just a suggestion... I will stop now and
leave it in your capable hands.

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 20:46:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 20:46:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVq2D-0006Hx-Ql; Tue, 06 Nov 2012 20:46:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TVq2C-0006Hn-Lz
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 20:46:08 +0000
Received: from [85.158.143.99:8991] by server-1.bemta-4.messagelabs.com id
	05/B1-27934-F0779905; Tue, 06 Nov 2012 20:46:07 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1352234766!23635410!1
X-Originating-IP: [209.85.212.169]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17870 invoked from network); 6 Nov 2012 20:46:07 -0000
Received: from mail-wi0-f169.google.com (HELO mail-wi0-f169.google.com)
	(209.85.212.169)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 20:46:07 -0000
Received: by mail-wi0-f169.google.com with SMTP id hq4so4195564wib.2
	for <xen-devel@lists.xen.org>; Tue, 06 Nov 2012 12:46:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=6bij7HM2hRkaJNGzcJBCUYy22VaCNFJ8Ohg1eVOf9uw=;
	b=x/aZvlKrFT49AG62LZ/zQmRuU9NhEyoZ13ltcZYa0EkEd5CaVr7f2OOEVLoylJLyvB
	ToQI/0BT7MUgPVpgSR7VJtA0iJ6wanqLuPeJo8GvzszkGprE4BfS9uzd5EbczmjHyOEh
	Y9zcqC9NHYW7Swbi9irRI2k+G1II5FfwxkO9ss7LZj2PbdPVb1dLyflyz4B1RqynZix8
	etc8LBlk5adOZLKEXF+WKz+67uZW0faKFkth38gkwnaPA8N/Ldl0sxm3Z+fPg4I14f2n
	0dKZGqTBBs2JD9VhXB22kV1rul9df/+wHHnbv3vjcSKTodU/jBvaZZeW2K1z7dOoYE0R
	OuEA==
Received: by 10.216.216.220 with SMTP id g70mr992502wep.83.1352234766723;
	Tue, 06 Nov 2012 12:46:06 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id f1sm406675wiy.2.2012.11.06.12.46.04
	(version=SSLv3 cipher=OTHER); Tue, 06 Nov 2012 12:46:05 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Tue, 06 Nov 2012 20:45:57 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Olaf Hering <olaf@aepfle.de>,
	<xen-devel@lists.xen.org>
Message-ID: <CCBF2785.442DA%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] reliable live migration of large and busy guests
Thread-Index: Ac28X7iuJoEeR0oq00CwgKZ5PLR1MQ==
In-Reply-To: <20121106202816.GA29655@aepfle.de>
Mime-version: 1.0
Subject: Re: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 06/11/2012 20:28, "Olaf Hering" <olaf@aepfle.de> wrote:

> We got a customer report about long-lasting and then failing live
> migration of busy guests.
> 
> The guest has 64G memory, is busy with its set of applications and as a
> result there will be always dirty pages to transfer. While some of this
> can be solved with faster network connection, the underlying issue is
> that tools/libxc/xc_domain_save.c:xc_domain_save will suspend a domain
> after a given number of iterations to transfer the remaining dirty
> pages. From what I understand this pausing of the guest (I dont know how
> long it is actually paused) is causing issues within the guest, the
> applications start to fail (again, no details).
> 
> Their suggestion is to add some knob to the overall live migration
> process to avoid the suspend. If the guest could not be transfered with
> the parameters passed to xc_domain_save(), abort the migration and let
> it running on the old host.
> 
> 
> My questions are:
> Was such issue ever seen elsewhere?

It's known that if you have a workload that is dirtying lots of pages
quickly, the final stop-and-copy phase will necessarily be large. A VM that
is busy dirtying lots of pages can dirty pages much quicker than they can be
transferred over the LAN.

> Should 'xm migrate --live' and 'xl migrate' get something like a
> --no-suspend option?

Well, it is not really possible to avoid the suspend altogether, there is
always going to be some minimal 'dirty working set'. But could provide
parameters to require the dirty working set to be smaller than X pages
within Y rounds of dirty page copying.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 20:46:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 20:46:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVq2D-0006Hx-Ql; Tue, 06 Nov 2012 20:46:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TVq2C-0006Hn-Lz
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 20:46:08 +0000
Received: from [85.158.143.99:8991] by server-1.bemta-4.messagelabs.com id
	05/B1-27934-F0779905; Tue, 06 Nov 2012 20:46:07 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1352234766!23635410!1
X-Originating-IP: [209.85.212.169]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17870 invoked from network); 6 Nov 2012 20:46:07 -0000
Received: from mail-wi0-f169.google.com (HELO mail-wi0-f169.google.com)
	(209.85.212.169)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 20:46:07 -0000
Received: by mail-wi0-f169.google.com with SMTP id hq4so4195564wib.2
	for <xen-devel@lists.xen.org>; Tue, 06 Nov 2012 12:46:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=6bij7HM2hRkaJNGzcJBCUYy22VaCNFJ8Ohg1eVOf9uw=;
	b=x/aZvlKrFT49AG62LZ/zQmRuU9NhEyoZ13ltcZYa0EkEd5CaVr7f2OOEVLoylJLyvB
	ToQI/0BT7MUgPVpgSR7VJtA0iJ6wanqLuPeJo8GvzszkGprE4BfS9uzd5EbczmjHyOEh
	Y9zcqC9NHYW7Swbi9irRI2k+G1II5FfwxkO9ss7LZj2PbdPVb1dLyflyz4B1RqynZix8
	etc8LBlk5adOZLKEXF+WKz+67uZW0faKFkth38gkwnaPA8N/Ldl0sxm3Z+fPg4I14f2n
	0dKZGqTBBs2JD9VhXB22kV1rul9df/+wHHnbv3vjcSKTodU/jBvaZZeW2K1z7dOoYE0R
	OuEA==
Received: by 10.216.216.220 with SMTP id g70mr992502wep.83.1352234766723;
	Tue, 06 Nov 2012 12:46:06 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id f1sm406675wiy.2.2012.11.06.12.46.04
	(version=SSLv3 cipher=OTHER); Tue, 06 Nov 2012 12:46:05 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Tue, 06 Nov 2012 20:45:57 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Olaf Hering <olaf@aepfle.de>,
	<xen-devel@lists.xen.org>
Message-ID: <CCBF2785.442DA%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] reliable live migration of large and busy guests
Thread-Index: Ac28X7iuJoEeR0oq00CwgKZ5PLR1MQ==
In-Reply-To: <20121106202816.GA29655@aepfle.de>
Mime-version: 1.0
Subject: Re: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 06/11/2012 20:28, "Olaf Hering" <olaf@aepfle.de> wrote:

> We got a customer report about long-lasting and then failing live
> migration of busy guests.
> 
> The guest has 64G memory, is busy with its set of applications and as a
> result there will be always dirty pages to transfer. While some of this
> can be solved with faster network connection, the underlying issue is
> that tools/libxc/xc_domain_save.c:xc_domain_save will suspend a domain
> after a given number of iterations to transfer the remaining dirty
> pages. From what I understand this pausing of the guest (I dont know how
> long it is actually paused) is causing issues within the guest, the
> applications start to fail (again, no details).
> 
> Their suggestion is to add some knob to the overall live migration
> process to avoid the suspend. If the guest could not be transfered with
> the parameters passed to xc_domain_save(), abort the migration and let
> it running on the old host.
> 
> 
> My questions are:
> Was such issue ever seen elsewhere?

It's known that if you have a workload that is dirtying lots of pages
quickly, the final stop-and-copy phase will necessarily be large. A VM that
is busy dirtying lots of pages can dirty pages much quicker than they can be
transferred over the LAN.

> Should 'xm migrate --live' and 'xl migrate' get something like a
> --no-suspend option?

Well, it is not really possible to avoid the suspend altogether, there is
always going to be some minimal 'dirty working set'. But could provide
parameters to require the dirty working set to be smaller than X pages
within Y rounds of dirty page copying.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 21:18:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 21:18:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVqWq-0006YJ-FT; Tue, 06 Nov 2012 21:17:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <execooler@gmail.com>) id 1TVqWp-0006YC-09
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 21:17:47 +0000
Received: from [193.109.254.147:61376] by server-16.bemta-14.messagelabs.com
	id 25/37-09215-A7E79905; Tue, 06 Nov 2012 21:17:46 +0000
X-Env-Sender: execooler@gmail.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1352236664!9851980!1
X-Originating-IP: [209.85.219.43]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_20_30,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22913 invoked from network); 6 Nov 2012 21:17:45 -0000
Received: from mail-oa0-f43.google.com (HELO mail-oa0-f43.google.com)
	(209.85.219.43)
	by server-13.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 21:17:45 -0000
Received: by mail-oa0-f43.google.com with SMTP id k1so1250901oag.30
	for <xen-devel@lists.xensource.com>;
	Tue, 06 Nov 2012 13:17:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=DDP5lft5ArXtJjLMfBCdGg5+7/8rEqmmSYuKNbw5rzQ=;
	b=hN0bHLZaWJ6z6YVjnCXHr3YWWQyBeNqaGcLwoGy4oGVsZ11Hz2SoK+7oiL04iUJ9LM
	E4fby12rnRthHx+rFU8LZfKytM8gBLeLdf5vZzdkwx3oQD/dB13hqUIDDyilXFPbOjYz
	PkU6niw2+BDoMvU7ngAnxWkR/Xx06i5ILvsfOlHX0inG4Zo6wNgzkMr6cJHkCVtpcwY5
	a0EqpfjmwkDJbu0W9Mlh2gjFT7Wg8cVSfyZCrhyXfsC4lGx4iIjWRtcPUXIv5K5+paKe
	6HHykgcSMMeezmE74fud/nKfGrsRPdTgQEu9UC4j7J+MeeWYaui1i6QQDGPUeZlc075w
	mlqA==
MIME-Version: 1.0
Received: by 10.60.14.200 with SMTP id r8mr2065513oec.45.1352236663795; Tue,
	06 Nov 2012 13:17:43 -0800 (PST)
Received: by 10.76.21.135 with HTTP; Tue, 6 Nov 2012 13:17:43 -0800 (PST)
Date: Wed, 7 Nov 2012 01:17:43 +0400
Message-ID: <CALBCzHewi+odtYTtn_oKE6UCAX-D_quFQr+b0RRMC8uqY=FH_Q@mail.gmail.com>
From: eXeC001er <execooler@gmail.com>
To: Xen-devel <xen-devel@lists.xensource.com>
Subject: [Xen-devel] Communication interface between Dom0 and DomU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0433666895913037025=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0433666895913037025==
Content-Type: multipart/alternative; boundary=e89a8fb201caff6f8604cdda21d4

--e89a8fb201caff6f8604cdda21d4
Content-Type: text/plain; charset=UTF-8

Hello.

Is it available a communication interface between Dom0 and DomU to get some
parameteres about DomU without connection via ssh?
For example i need to get information about IP addresses that are allocated
in DomU.
I found following mail-thread:

http://xen.1045712.n5.nabble.com/How-to-get-domU-IP-address-td2510278.html


Keir Fraser said about xenstore, but as i understand to use xenstore need
DomU should be started as PV-DomU or not ?

I see that XenServer has xentool, that allow to control DomU and get
information about it, but cannot find any info about the communication
interface, that is used by the tools.

Thanks.

--e89a8fb201caff6f8604cdda21d4
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hello.<div><br></div><div>Is it available a communication interface between=
 Dom0 and DomU to get some parameteres about DomU without connection via ss=
h?</div><div>For example i need to get information about IP addresses that =
are allocated in DomU.</div>
<div>I found following mail-thread:</div><div><br></div><div><a href=3D"htt=
p://xen.1045712.n5.nabble.com/How-to-get-domU-IP-address-td2510278.html">ht=
tp://xen.1045712.n5.nabble.com/How-to-get-domU-IP-address-td2510278.html</a=
></div>
<div><br></div><div><br></div><div>Keir Fraser said about xenstore, but as =
i understand to use xenstore need DomU should be started as PV-DomU or not =
?</div><div><br></div><div>I see that XenServer has xentool, that allow to =
control DomU and get information about it, but cannot find any info about t=
he communication interface, that is used by the tools.</div>
<div><br></div><div>Thanks.</div>

--e89a8fb201caff6f8604cdda21d4--


--===============0433666895913037025==
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.xen.org
http://lists.xen.org/xen-devel

--===============0433666895913037025==--


From xen-devel-bounces@lists.xen.org Tue Nov 06 21:18:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 21:18:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVqWq-0006YJ-FT; Tue, 06 Nov 2012 21:17:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <execooler@gmail.com>) id 1TVqWp-0006YC-09
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 21:17:47 +0000
Received: from [193.109.254.147:61376] by server-16.bemta-14.messagelabs.com
	id 25/37-09215-A7E79905; Tue, 06 Nov 2012 21:17:46 +0000
X-Env-Sender: execooler@gmail.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1352236664!9851980!1
X-Originating-IP: [209.85.219.43]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_20_30,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22913 invoked from network); 6 Nov 2012 21:17:45 -0000
Received: from mail-oa0-f43.google.com (HELO mail-oa0-f43.google.com)
	(209.85.219.43)
	by server-13.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 21:17:45 -0000
Received: by mail-oa0-f43.google.com with SMTP id k1so1250901oag.30
	for <xen-devel@lists.xensource.com>;
	Tue, 06 Nov 2012 13:17:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=DDP5lft5ArXtJjLMfBCdGg5+7/8rEqmmSYuKNbw5rzQ=;
	b=hN0bHLZaWJ6z6YVjnCXHr3YWWQyBeNqaGcLwoGy4oGVsZ11Hz2SoK+7oiL04iUJ9LM
	E4fby12rnRthHx+rFU8LZfKytM8gBLeLdf5vZzdkwx3oQD/dB13hqUIDDyilXFPbOjYz
	PkU6niw2+BDoMvU7ngAnxWkR/Xx06i5ILvsfOlHX0inG4Zo6wNgzkMr6cJHkCVtpcwY5
	a0EqpfjmwkDJbu0W9Mlh2gjFT7Wg8cVSfyZCrhyXfsC4lGx4iIjWRtcPUXIv5K5+paKe
	6HHykgcSMMeezmE74fud/nKfGrsRPdTgQEu9UC4j7J+MeeWYaui1i6QQDGPUeZlc075w
	mlqA==
MIME-Version: 1.0
Received: by 10.60.14.200 with SMTP id r8mr2065513oec.45.1352236663795; Tue,
	06 Nov 2012 13:17:43 -0800 (PST)
Received: by 10.76.21.135 with HTTP; Tue, 6 Nov 2012 13:17:43 -0800 (PST)
Date: Wed, 7 Nov 2012 01:17:43 +0400
Message-ID: <CALBCzHewi+odtYTtn_oKE6UCAX-D_quFQr+b0RRMC8uqY=FH_Q@mail.gmail.com>
From: eXeC001er <execooler@gmail.com>
To: Xen-devel <xen-devel@lists.xensource.com>
Subject: [Xen-devel] Communication interface between Dom0 and DomU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0433666895913037025=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0433666895913037025==
Content-Type: multipart/alternative; boundary=e89a8fb201caff6f8604cdda21d4

--e89a8fb201caff6f8604cdda21d4
Content-Type: text/plain; charset=UTF-8

Hello.

Is it available a communication interface between Dom0 and DomU to get some
parameteres about DomU without connection via ssh?
For example i need to get information about IP addresses that are allocated
in DomU.
I found following mail-thread:

http://xen.1045712.n5.nabble.com/How-to-get-domU-IP-address-td2510278.html


Keir Fraser said about xenstore, but as i understand to use xenstore need
DomU should be started as PV-DomU or not ?

I see that XenServer has xentool, that allow to control DomU and get
information about it, but cannot find any info about the communication
interface, that is used by the tools.

Thanks.

--e89a8fb201caff6f8604cdda21d4
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hello.<div><br></div><div>Is it available a communication interface between=
 Dom0 and DomU to get some parameteres about DomU without connection via ss=
h?</div><div>For example i need to get information about IP addresses that =
are allocated in DomU.</div>
<div>I found following mail-thread:</div><div><br></div><div><a href=3D"htt=
p://xen.1045712.n5.nabble.com/How-to-get-domU-IP-address-td2510278.html">ht=
tp://xen.1045712.n5.nabble.com/How-to-get-domU-IP-address-td2510278.html</a=
></div>
<div><br></div><div><br></div><div>Keir Fraser said about xenstore, but as =
i understand to use xenstore need DomU should be started as PV-DomU or not =
?</div><div><br></div><div>I see that XenServer has xentool, that allow to =
control DomU and get information about it, but cannot find any info about t=
he communication interface, that is used by the tools.</div>
<div><br></div><div>Thanks.</div>

--e89a8fb201caff6f8604cdda21d4--


--===============0433666895913037025==
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.xen.org
http://lists.xen.org/xen-devel

--===============0433666895913037025==--


From xen-devel-bounces@lists.xen.org Tue Nov 06 21:32:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 21:32:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVqkx-0006iD-UD; Tue, 06 Nov 2012 21:32:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TVqkw-0006i8-N5
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 21:32:22 +0000
Received: from [85.158.138.51:56373] by server-13.bemta-3.messagelabs.com id
	3B/CD-24887-1E189905; Tue, 06 Nov 2012 21:32:17 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1352237535!20944990!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0MTM4Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20017 invoked from network); 6 Nov 2012 21:32:17 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-6.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 21:32:17 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6LVtQK031064
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 21:31:57 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6LVsGR024347
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 21:31:54 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6LVqjr023487; Tue, 6 Nov 2012 15:31:52 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 06 Nov 2012 13:31:52 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id C7C164042D; Tue,  6 Nov 2012 16:19:09 -0500 (EST)
Date: Tue, 6 Nov 2012 16:19:09 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: xen-devel@lists.xensource.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121106211909.GA32682@phenom.dumpdata.com>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Ian Campbell <Ian.Campbell@eu.citrix.com>
Subject: [Xen-devel] ARM build with v3.7-rc3 with CONFIG_XEN_GNTDEV=m
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hey Stefano,

I setup a cross ARM build system so that the generic changes won't cause build issues
on ARM (and actually caught a bug with fallback.o being enabled there - I've a fix
for that).

But more interestingly the build system I do also makes a variations of config entries.
So there is the allmodules, allyes, allyes, but all Xen drivers are modules, etc.

I found out that with:
CONFIG_XEN_GNTDEV=m
I get this

ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!

If I make it CONFIG_XEN_GNTDEV=y the issue disappears. Any thoughts?

(FYI, if you want to do this on v3.7-rc4 please apply this patch to your tree)


commit e1a982642262820d68779c06de64f8857a040f5a
Author: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date:   Tue Nov 6 15:49:27 2012 -0500

    xen/generic: Disable fallback build on ARM.
    
    As there is no need for it (the fallback code is for older
    hypervisors and they won't run under ARM), and also b/c
    we get:
    
    drivers/xen/fallback.c: In function 'xen_event_channel_op_compat':
    drivers/xen/fallback.c:10:19: error: storage size of 'op' isn't known
    drivers/xen/fallback.c:15:2: error: implicit declaration of function '_hypercall1' [-Werror=implicit-function-declaration]
    drivers/xen/fallback.c:15:19: error: expected expression before 'int'
    drivers/xen/fallback.c:18:7: error: 'EVTCHNOP_close' undeclared (first use in this function)
    drivers/xen/fallback.c:18:7: note: each undeclared identifier is reported only once for each function it appears in
    .. and more
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 46de6cd..273d2b9 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -1,8 +1,8 @@
 ifneq ($(CONFIG_ARM),y)
-obj-y	+= manage.o balloon.o
+obj-y	+= manage.o balloon.o fallback.o
 obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
 endif
-obj-y	+= grant-table.o features.o events.o fallback.o
+obj-y	+= grant-table.o features.o events.o
 obj-y	+= xenbus/
 
 nostackp := $(call cc-option, -fno-stack-protector)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 21:32:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 21:32:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVqkx-0006iD-UD; Tue, 06 Nov 2012 21:32:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TVqkw-0006i8-N5
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 21:32:22 +0000
Received: from [85.158.138.51:56373] by server-13.bemta-3.messagelabs.com id
	3B/CD-24887-1E189905; Tue, 06 Nov 2012 21:32:17 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1352237535!20944990!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0MTM4Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20017 invoked from network); 6 Nov 2012 21:32:17 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-6.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 21:32:17 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6LVtQK031064
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 21:31:57 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6LVsGR024347
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 21:31:54 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6LVqjr023487; Tue, 6 Nov 2012 15:31:52 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 06 Nov 2012 13:31:52 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id C7C164042D; Tue,  6 Nov 2012 16:19:09 -0500 (EST)
Date: Tue, 6 Nov 2012 16:19:09 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: xen-devel@lists.xensource.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121106211909.GA32682@phenom.dumpdata.com>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Ian Campbell <Ian.Campbell@eu.citrix.com>
Subject: [Xen-devel] ARM build with v3.7-rc3 with CONFIG_XEN_GNTDEV=m
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hey Stefano,

I setup a cross ARM build system so that the generic changes won't cause build issues
on ARM (and actually caught a bug with fallback.o being enabled there - I've a fix
for that).

But more interestingly the build system I do also makes a variations of config entries.
So there is the allmodules, allyes, allyes, but all Xen drivers are modules, etc.

I found out that with:
CONFIG_XEN_GNTDEV=m
I get this

ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!

If I make it CONFIG_XEN_GNTDEV=y the issue disappears. Any thoughts?

(FYI, if you want to do this on v3.7-rc4 please apply this patch to your tree)


commit e1a982642262820d68779c06de64f8857a040f5a
Author: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date:   Tue Nov 6 15:49:27 2012 -0500

    xen/generic: Disable fallback build on ARM.
    
    As there is no need for it (the fallback code is for older
    hypervisors and they won't run under ARM), and also b/c
    we get:
    
    drivers/xen/fallback.c: In function 'xen_event_channel_op_compat':
    drivers/xen/fallback.c:10:19: error: storage size of 'op' isn't known
    drivers/xen/fallback.c:15:2: error: implicit declaration of function '_hypercall1' [-Werror=implicit-function-declaration]
    drivers/xen/fallback.c:15:19: error: expected expression before 'int'
    drivers/xen/fallback.c:18:7: error: 'EVTCHNOP_close' undeclared (first use in this function)
    drivers/xen/fallback.c:18:7: note: each undeclared identifier is reported only once for each function it appears in
    .. and more
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 46de6cd..273d2b9 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -1,8 +1,8 @@
 ifneq ($(CONFIG_ARM),y)
-obj-y	+= manage.o balloon.o
+obj-y	+= manage.o balloon.o fallback.o
 obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
 endif
-obj-y	+= grant-table.o features.o events.o fallback.o
+obj-y	+= grant-table.o features.o events.o
 obj-y	+= xenbus/
 
 nostackp := $(call cc-option, -fno-stack-protector)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 21:39:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 21:39:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVqrc-0006rY-TB; Tue, 06 Nov 2012 21:39:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TVqrb-0006rT-Lm
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 21:39:15 +0000
Received: from [85.158.139.211:53646] by server-15.bemta-5.messagelabs.com id
	D7/19-26920-28389905; Tue, 06 Nov 2012 21:39:14 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1352237954!19103509!1
X-Originating-IP: [74.125.82.171]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25508 invoked from network); 6 Nov 2012 21:39:14 -0000
Received: from mail-we0-f171.google.com (HELO mail-we0-f171.google.com)
	(74.125.82.171)
	by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 21:39:14 -0000
Received: by mail-we0-f171.google.com with SMTP id s43so529295wey.30
	for <xen-devel@lists.xensource.com>;
	Tue, 06 Nov 2012 13:39:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=iQTyLM8Lqk6ygBBqVpFz2RFtzSglSYJHKi4lz45amzg=;
	b=XUGdwbP/wRfTzKhbkaAvusI7PwOGuS4Wq2L3kHiXWcIAZyt7HwmhPgp+XPjxsTDlXU
	5WFLGFVsgnao/LZA63+Ye+PM84K/52517mfd8KisSlgd1tHwuEED9LCKfY29f0DKbeRx
	0ZvhAYNIDVgMr0H/AQc+OkSqnhP9D4Tl9oRE1yguVWtPR/GZdT5MSHqyPCW0AFntT6fQ
	i7L3PYM+CBR3oMpXXcMZKV+qU0z8Xdm91DGhyTutxR19bqvkz2ij4pemuNeA0J+qb/hz
	snmSeBaV8VTJ53EZ+iwxFl55NVE9j7iW2bIlhxR7bRtemtGis3fzzfCO+nMiAye0Y9Hs
	nJZQ==
Received: by 10.216.206.152 with SMTP id l24mr1067364weo.66.1352237953941;
	Tue, 06 Nov 2012 13:39:13 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id k20sm555789wiv.11.2012.11.06.13.39.12
	(version=SSLv3 cipher=OTHER); Tue, 06 Nov 2012 13:39:13 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Tue, 06 Nov 2012 21:39:07 +0000
From: Keir Fraser <keir@xen.org>
To: eXeC001er <execooler@gmail.com>, Xen-devel <xen-devel@lists.xensource.com>
Message-ID: <CCBF33FB.5115A%keir@xen.org>
Thread-Topic: [Xen-devel] Communication interface between Dom0 and DomU
Thread-Index: Ac28ZyYSWvIVqLASNk2S6XroAnapvg==
In-Reply-To: <CALBCzHewi+odtYTtn_oKE6UCAX-D_quFQr+b0RRMC8uqY=FH_Q@mail.gmail.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] Communication interface between Dom0 and DomU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 06/11/2012 21:17, "eXeC001er" <execooler@gmail.com> wrote:

> Hello.
> 
> Is it available a communication interface between Dom0 and DomU to get some
> parameteres about DomU without connection via ssh?
> For example i need to get information about IP addresses that are allocated in
> DomU.
> I found following mail-thread:
> 
> http://xen.1045712.n5.nabble.com/How-to-get-domU-IP-address-td2510278.html
> 
> 
> Keir Fraser said about xenstore, but as i understand to use xenstore need DomU
> should be started as PV-DomU or not ?

I believe that an HVM Linux guest with PV drivers should also be able to use
the xenstore command-line tools. I'm not 100% sure on that though.

> I see that XenServer has xentool, that allow to control DomU and get
> information about it, but cannot find any info about the communication
> interface, that is used by the tools.
> 
> Thanks.
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 21:39:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 21:39:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVqrc-0006rY-TB; Tue, 06 Nov 2012 21:39:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TVqrb-0006rT-Lm
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 21:39:15 +0000
Received: from [85.158.139.211:53646] by server-15.bemta-5.messagelabs.com id
	D7/19-26920-28389905; Tue, 06 Nov 2012 21:39:14 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1352237954!19103509!1
X-Originating-IP: [74.125.82.171]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25508 invoked from network); 6 Nov 2012 21:39:14 -0000
Received: from mail-we0-f171.google.com (HELO mail-we0-f171.google.com)
	(74.125.82.171)
	by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 21:39:14 -0000
Received: by mail-we0-f171.google.com with SMTP id s43so529295wey.30
	for <xen-devel@lists.xensource.com>;
	Tue, 06 Nov 2012 13:39:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=iQTyLM8Lqk6ygBBqVpFz2RFtzSglSYJHKi4lz45amzg=;
	b=XUGdwbP/wRfTzKhbkaAvusI7PwOGuS4Wq2L3kHiXWcIAZyt7HwmhPgp+XPjxsTDlXU
	5WFLGFVsgnao/LZA63+Ye+PM84K/52517mfd8KisSlgd1tHwuEED9LCKfY29f0DKbeRx
	0ZvhAYNIDVgMr0H/AQc+OkSqnhP9D4Tl9oRE1yguVWtPR/GZdT5MSHqyPCW0AFntT6fQ
	i7L3PYM+CBR3oMpXXcMZKV+qU0z8Xdm91DGhyTutxR19bqvkz2ij4pemuNeA0J+qb/hz
	snmSeBaV8VTJ53EZ+iwxFl55NVE9j7iW2bIlhxR7bRtemtGis3fzzfCO+nMiAye0Y9Hs
	nJZQ==
Received: by 10.216.206.152 with SMTP id l24mr1067364weo.66.1352237953941;
	Tue, 06 Nov 2012 13:39:13 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id k20sm555789wiv.11.2012.11.06.13.39.12
	(version=SSLv3 cipher=OTHER); Tue, 06 Nov 2012 13:39:13 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Tue, 06 Nov 2012 21:39:07 +0000
From: Keir Fraser <keir@xen.org>
To: eXeC001er <execooler@gmail.com>, Xen-devel <xen-devel@lists.xensource.com>
Message-ID: <CCBF33FB.5115A%keir@xen.org>
Thread-Topic: [Xen-devel] Communication interface between Dom0 and DomU
Thread-Index: Ac28ZyYSWvIVqLASNk2S6XroAnapvg==
In-Reply-To: <CALBCzHewi+odtYTtn_oKE6UCAX-D_quFQr+b0RRMC8uqY=FH_Q@mail.gmail.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] Communication interface between Dom0 and DomU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 06/11/2012 21:17, "eXeC001er" <execooler@gmail.com> wrote:

> Hello.
> 
> Is it available a communication interface between Dom0 and DomU to get some
> parameteres about DomU without connection via ssh?
> For example i need to get information about IP addresses that are allocated in
> DomU.
> I found following mail-thread:
> 
> http://xen.1045712.n5.nabble.com/How-to-get-domU-IP-address-td2510278.html
> 
> 
> Keir Fraser said about xenstore, but as i understand to use xenstore need DomU
> should be started as PV-DomU or not ?

I believe that an HVM Linux guest with PV drivers should also be able to use
the xenstore command-line tools. I'm not 100% sure on that though.

> I see that XenServer has xentool, that allow to control DomU and get
> information about it, but cannot find any info about the communication
> interface, that is used by the tools.
> 
> Thanks.
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 21:42:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 21:42:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVquK-0006xn-J9; Tue, 06 Nov 2012 21:42:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TVquJ-0006xi-2y
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 21:42:03 +0000
Received: from [85.158.143.35:8528] by server-2.bemta-4.messagelabs.com id
	7C/AE-28922-A2489905; Tue, 06 Nov 2012 21:42:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1352238120!16026375!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQzNTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2348 invoked from network); 6 Nov 2012 21:42:01 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 21:42:01 -0000
X-IronPort-AV: E=Sophos;i="4.80,723,1344211200"; d="scan'208";a="213645957"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 21:42:00 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 6 Nov 2012 16:42:00 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TVquF-0004z8-55;
	Tue, 06 Nov 2012 21:41:59 +0000
Message-ID: <1352237999.12977.13.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Tue, 6 Nov 2012 22:39:59 +0100
In-Reply-To: <20121106211909.GA32682@phenom.dumpdata.com>
References: <20121106211909.GA32682@phenom.dumpdata.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] ARM build with v3.7-rc3 with CONFIG_XEN_GNTDEV=m
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-06 at 21:19 +0000, Konrad Rzeszutek Wilk wrote:
> Hey Stefano,
> 
> I setup a cross ARM build system so that the generic changes won't cause build issues
> on ARM (and actually caught a bug with fallback.o being enabled there - I've a fix
> for that).
> 
> But more interestingly the build system I do also makes a variations of config entries.
> So there is the allmodules, allyes, allyes, but all Xen drivers are modules, etc.
> 
> I found out that with:
> CONFIG_XEN_GNTDEV=m
> I get this
> 
> ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
> 
> If I make it CONFIG_XEN_GNTDEV=y the issue disappears. Any thoughts?

I wonder if this is to do with missing EXPORT_SYMBOL for the various
things in hypercall.S ? Quite possibly this is the same thing as Russell
King just reported r.e. privmcd?

> 
> (FYI, if you want to do this on v3.7-rc4 please apply this patch to your tree)
> 
> 
> commit e1a982642262820d68779c06de64f8857a040f5a
> Author: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Date:   Tue Nov 6 15:49:27 2012 -0500
> 
>     xen/generic: Disable fallback build on ARM.
>     
>     As there is no need for it (the fallback code is for older
>     hypervisors and they won't run under ARM), and also b/c
>     we get:
>     
>     drivers/xen/fallback.c: In function 'xen_event_channel_op_compat':
>     drivers/xen/fallback.c:10:19: error: storage size of 'op' isn't known
>     drivers/xen/fallback.c:15:2: error: implicit declaration of function '_hypercall1' [-Werror=implicit-function-declaration]
>     drivers/xen/fallback.c:15:19: error: expected expression before 'int'
>     drivers/xen/fallback.c:18:7: error: 'EVTCHNOP_close' undeclared (first use in this function)
>     drivers/xen/fallback.c:18:7: note: each undeclared identifier is reported only once for each function it appears in
>     .. and more
>     
>     Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> 
> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> index 46de6cd..273d2b9 100644
> --- a/drivers/xen/Makefile
> +++ b/drivers/xen/Makefile
> @@ -1,8 +1,8 @@
>  ifneq ($(CONFIG_ARM),y)
> -obj-y	+= manage.o balloon.o
> +obj-y	+= manage.o balloon.o fallback.o
>  obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
>  endif
> -obj-y	+= grant-table.o features.o events.o fallback.o
> +obj-y	+= grant-table.o features.o events.o
>  obj-y	+= xenbus/
>  
>  nostackp := $(call cc-option, -fno-stack-protector)



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 21:42:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 21:42:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVquK-0006xn-J9; Tue, 06 Nov 2012 21:42:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TVquJ-0006xi-2y
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 21:42:03 +0000
Received: from [85.158.143.35:8528] by server-2.bemta-4.messagelabs.com id
	7C/AE-28922-A2489905; Tue, 06 Nov 2012 21:42:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1352238120!16026375!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQzNTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2348 invoked from network); 6 Nov 2012 21:42:01 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 21:42:01 -0000
X-IronPort-AV: E=Sophos;i="4.80,723,1344211200"; d="scan'208";a="213645957"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 21:42:00 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 6 Nov 2012 16:42:00 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TVquF-0004z8-55;
	Tue, 06 Nov 2012 21:41:59 +0000
Message-ID: <1352237999.12977.13.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Tue, 6 Nov 2012 22:39:59 +0100
In-Reply-To: <20121106211909.GA32682@phenom.dumpdata.com>
References: <20121106211909.GA32682@phenom.dumpdata.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] ARM build with v3.7-rc3 with CONFIG_XEN_GNTDEV=m
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-06 at 21:19 +0000, Konrad Rzeszutek Wilk wrote:
> Hey Stefano,
> 
> I setup a cross ARM build system so that the generic changes won't cause build issues
> on ARM (and actually caught a bug with fallback.o being enabled there - I've a fix
> for that).
> 
> But more interestingly the build system I do also makes a variations of config entries.
> So there is the allmodules, allyes, allyes, but all Xen drivers are modules, etc.
> 
> I found out that with:
> CONFIG_XEN_GNTDEV=m
> I get this
> 
> ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
> 
> If I make it CONFIG_XEN_GNTDEV=y the issue disappears. Any thoughts?

I wonder if this is to do with missing EXPORT_SYMBOL for the various
things in hypercall.S ? Quite possibly this is the same thing as Russell
King just reported r.e. privmcd?

> 
> (FYI, if you want to do this on v3.7-rc4 please apply this patch to your tree)
> 
> 
> commit e1a982642262820d68779c06de64f8857a040f5a
> Author: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Date:   Tue Nov 6 15:49:27 2012 -0500
> 
>     xen/generic: Disable fallback build on ARM.
>     
>     As there is no need for it (the fallback code is for older
>     hypervisors and they won't run under ARM), and also b/c
>     we get:
>     
>     drivers/xen/fallback.c: In function 'xen_event_channel_op_compat':
>     drivers/xen/fallback.c:10:19: error: storage size of 'op' isn't known
>     drivers/xen/fallback.c:15:2: error: implicit declaration of function '_hypercall1' [-Werror=implicit-function-declaration]
>     drivers/xen/fallback.c:15:19: error: expected expression before 'int'
>     drivers/xen/fallback.c:18:7: error: 'EVTCHNOP_close' undeclared (first use in this function)
>     drivers/xen/fallback.c:18:7: note: each undeclared identifier is reported only once for each function it appears in
>     .. and more
>     
>     Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> 
> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> index 46de6cd..273d2b9 100644
> --- a/drivers/xen/Makefile
> +++ b/drivers/xen/Makefile
> @@ -1,8 +1,8 @@
>  ifneq ($(CONFIG_ARM),y)
> -obj-y	+= manage.o balloon.o
> +obj-y	+= manage.o balloon.o fallback.o
>  obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
>  endif
> -obj-y	+= grant-table.o features.o events.o fallback.o
> +obj-y	+= grant-table.o features.o events.o
>  obj-y	+= xenbus/
>  
>  nostackp := $(call cc-option, -fno-stack-protector)



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 21:55:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 21:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVr6u-0007Cp-3S; Tue, 06 Nov 2012 21:55:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TVr6s-0007Ck-Ti
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 21:55:03 +0000
Received: from [85.158.139.83:52669] by server-9.bemta-5.messagelabs.com id
	19/10-29295-63789905; Tue, 06 Nov 2012 21:55:02 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1352238900!29070178!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0MTM4Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8085 invoked from network); 6 Nov 2012 21:55:01 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-3.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 21:55:01 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6LsmXZ022072
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 21:54:49 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6LsmrL014861
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 21:54:48 GMT
Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6Lslo9009501; Tue, 6 Nov 2012 15:54:47 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 06 Nov 2012 13:54:47 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 02BFC4042D; Tue,  6 Nov 2012 16:42:04 -0500 (EST)
Date: Tue, 6 Nov 2012 16:42:04 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <ian.campbell@citrix.com>
Message-ID: <20121106214204.GA787@phenom.dumpdata.com>
References: <20121106211909.GA32682@phenom.dumpdata.com>
	<1352237999.12977.13.camel@hastur.hellion.org.uk>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352237999.12977.13.camel@hastur.hellion.org.uk>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] ARM build with v3.7-rc3 with CONFIG_XEN_GNTDEV=m
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 06, 2012 at 10:39:59PM +0100, Ian Campbell wrote:
> On Tue, 2012-11-06 at 21:19 +0000, Konrad Rzeszutek Wilk wrote:
> > Hey Stefano,
> > 
> > I setup a cross ARM build system so that the generic changes won't cause build issues
> > on ARM (and actually caught a bug with fallback.o being enabled there - I've a fix
> > for that).
> > 
> > But more interestingly the build system I do also makes a variations of config entries.
> > So there is the allmodules, allyes, allyes, but all Xen drivers are modules, etc.
> > 
> > I found out that with:
> > CONFIG_XEN_GNTDEV=m
> > I get this
> > 
> > ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
> > 
> > If I make it CONFIG_XEN_GNTDEV=y the issue disappears. Any thoughts?
> 
> I wonder if this is to do with missing EXPORT_SYMBOL for the various
> things in hypercall.S ? Quite possibly this is the same thing as Russell
> King just reported r.e. privmcd?

I think so, I was unable to find the code for HYPERVISOR_event_channel_op
until I did a grep for 'hypercall' and found the hypercall.S file :-(

Will add an EXPORT_SYMBOL_GPL for said issue and see if that fixes it.



> 
> > 
> > (FYI, if you want to do this on v3.7-rc4 please apply this patch to your tree)
> > 
> > 
> > commit e1a982642262820d68779c06de64f8857a040f5a
> > Author: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > Date:   Tue Nov 6 15:49:27 2012 -0500
> > 
> >     xen/generic: Disable fallback build on ARM.
> >     
> >     As there is no need for it (the fallback code is for older
> >     hypervisors and they won't run under ARM), and also b/c
> >     we get:
> >     
> >     drivers/xen/fallback.c: In function 'xen_event_channel_op_compat':
> >     drivers/xen/fallback.c:10:19: error: storage size of 'op' isn't known
> >     drivers/xen/fallback.c:15:2: error: implicit declaration of function '_hypercall1' [-Werror=implicit-function-declaration]
> >     drivers/xen/fallback.c:15:19: error: expected expression before 'int'
> >     drivers/xen/fallback.c:18:7: error: 'EVTCHNOP_close' undeclared (first use in this function)
> >     drivers/xen/fallback.c:18:7: note: each undeclared identifier is reported only once for each function it appears in
> >     .. and more
> >     
> >     Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > 
> > diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> > index 46de6cd..273d2b9 100644
> > --- a/drivers/xen/Makefile
> > +++ b/drivers/xen/Makefile
> > @@ -1,8 +1,8 @@
> >  ifneq ($(CONFIG_ARM),y)
> > -obj-y	+= manage.o balloon.o
> > +obj-y	+= manage.o balloon.o fallback.o
> >  obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
> >  endif
> > -obj-y	+= grant-table.o features.o events.o fallback.o
> > +obj-y	+= grant-table.o features.o events.o
> >  obj-y	+= xenbus/
> >  
> >  nostackp := $(call cc-option, -fno-stack-protector)
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 21:55:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 21:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVr6u-0007Cp-3S; Tue, 06 Nov 2012 21:55:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TVr6s-0007Ck-Ti
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 21:55:03 +0000
Received: from [85.158.139.83:52669] by server-9.bemta-5.messagelabs.com id
	19/10-29295-63789905; Tue, 06 Nov 2012 21:55:02 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1352238900!29070178!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0MTM4Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8085 invoked from network); 6 Nov 2012 21:55:01 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-3.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 21:55:01 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6LsmXZ022072
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 21:54:49 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6LsmrL014861
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 21:54:48 GMT
Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6Lslo9009501; Tue, 6 Nov 2012 15:54:47 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 06 Nov 2012 13:54:47 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 02BFC4042D; Tue,  6 Nov 2012 16:42:04 -0500 (EST)
Date: Tue, 6 Nov 2012 16:42:04 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <ian.campbell@citrix.com>
Message-ID: <20121106214204.GA787@phenom.dumpdata.com>
References: <20121106211909.GA32682@phenom.dumpdata.com>
	<1352237999.12977.13.camel@hastur.hellion.org.uk>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352237999.12977.13.camel@hastur.hellion.org.uk>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] ARM build with v3.7-rc3 with CONFIG_XEN_GNTDEV=m
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 06, 2012 at 10:39:59PM +0100, Ian Campbell wrote:
> On Tue, 2012-11-06 at 21:19 +0000, Konrad Rzeszutek Wilk wrote:
> > Hey Stefano,
> > 
> > I setup a cross ARM build system so that the generic changes won't cause build issues
> > on ARM (and actually caught a bug with fallback.o being enabled there - I've a fix
> > for that).
> > 
> > But more interestingly the build system I do also makes a variations of config entries.
> > So there is the allmodules, allyes, allyes, but all Xen drivers are modules, etc.
> > 
> > I found out that with:
> > CONFIG_XEN_GNTDEV=m
> > I get this
> > 
> > ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
> > 
> > If I make it CONFIG_XEN_GNTDEV=y the issue disappears. Any thoughts?
> 
> I wonder if this is to do with missing EXPORT_SYMBOL for the various
> things in hypercall.S ? Quite possibly this is the same thing as Russell
> King just reported r.e. privmcd?

I think so, I was unable to find the code for HYPERVISOR_event_channel_op
until I did a grep for 'hypercall' and found the hypercall.S file :-(

Will add an EXPORT_SYMBOL_GPL for said issue and see if that fixes it.



> 
> > 
> > (FYI, if you want to do this on v3.7-rc4 please apply this patch to your tree)
> > 
> > 
> > commit e1a982642262820d68779c06de64f8857a040f5a
> > Author: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > Date:   Tue Nov 6 15:49:27 2012 -0500
> > 
> >     xen/generic: Disable fallback build on ARM.
> >     
> >     As there is no need for it (the fallback code is for older
> >     hypervisors and they won't run under ARM), and also b/c
> >     we get:
> >     
> >     drivers/xen/fallback.c: In function 'xen_event_channel_op_compat':
> >     drivers/xen/fallback.c:10:19: error: storage size of 'op' isn't known
> >     drivers/xen/fallback.c:15:2: error: implicit declaration of function '_hypercall1' [-Werror=implicit-function-declaration]
> >     drivers/xen/fallback.c:15:19: error: expected expression before 'int'
> >     drivers/xen/fallback.c:18:7: error: 'EVTCHNOP_close' undeclared (first use in this function)
> >     drivers/xen/fallback.c:18:7: note: each undeclared identifier is reported only once for each function it appears in
> >     .. and more
> >     
> >     Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > 
> > diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> > index 46de6cd..273d2b9 100644
> > --- a/drivers/xen/Makefile
> > +++ b/drivers/xen/Makefile
> > @@ -1,8 +1,8 @@
> >  ifneq ($(CONFIG_ARM),y)
> > -obj-y	+= manage.o balloon.o
> > +obj-y	+= manage.o balloon.o fallback.o
> >  obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
> >  endif
> > -obj-y	+= grant-table.o features.o events.o fallback.o
> > +obj-y	+= grant-table.o features.o events.o
> >  obj-y	+= xenbus/
> >  
> >  nostackp := $(call cc-option, -fno-stack-protector)
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 22:18:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 22:18:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVrTJ-0007Qk-4P; Tue, 06 Nov 2012 22:18:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TVrTH-0007Qf-Gh
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 22:18:11 +0000
Received: from [85.158.138.51:26123] by server-16.bemta-3.messagelabs.com id
	82/86-07461-2AC89905; Tue, 06 Nov 2012 22:18:10 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352240289!20886224!1
X-Originating-IP: [81.169.146.177]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NyA9PiAyNjI1Mg==\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NyA9PiAyNjI1Mg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20102 invoked from network); 6 Nov 2012 22:18:10 -0000
Received: from mo-p04-ob.rzone.de (HELO mo-p04-ob.rzone.de) (81.169.146.177)
	by server-3.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 22:18:10 -0000
X-RZG-CLASS-ID: mo04
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmxtMZ80VwmRNV7qE=
Received: from probook.site (ip-80-226-24-4.vodafone-net.de [80.226.24.4])
	by smtp.strato.de (josoe mo4) (RZmta 30.22 SBL|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id h02dfboA6LbTOU ;
	Tue, 6 Nov 2012 23:18:09 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id C06FF189BB; Tue,  6 Nov 2012 23:18:06 +0100 (CET)
Date: Tue, 6 Nov 2012 23:18:06 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Keir Fraser <keir.xen@gmail.com>
Message-ID: <20121106221806.GA1813@aepfle.de>
References: <20121106202816.GA29655@aepfle.de>
	<CCBF2785.442DA%keir.xen@gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CCBF2785.442DA%keir.xen@gmail.com>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 06, Keir Fraser wrote:

> It's known that if you have a workload that is dirtying lots of pages
> quickly, the final stop-and-copy phase will necessarily be large. A VM that
> is busy dirtying lots of pages can dirty pages much quicker than they can be
> transferred over the LAN.

In my opinion such migration should be done at application level.

> > Should 'xm migrate --live' and 'xl migrate' get something like a
> > --no-suspend option?
> 
> Well, it is not really possible to avoid the suspend altogether, there is
> always going to be some minimal 'dirty working set'. But could provide
> parameters to require the dirty working set to be smaller than X pages
> within Y rounds of dirty page copying.

Should such knobs be exposed to the tools like x[lm] migrate --knob1 val --knob2 val?

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 22:18:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 22:18:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVrTJ-0007Qk-4P; Tue, 06 Nov 2012 22:18:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TVrTH-0007Qf-Gh
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 22:18:11 +0000
Received: from [85.158.138.51:26123] by server-16.bemta-3.messagelabs.com id
	82/86-07461-2AC89905; Tue, 06 Nov 2012 22:18:10 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352240289!20886224!1
X-Originating-IP: [81.169.146.177]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NyA9PiAyNjI1Mg==\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NyA9PiAyNjI1Mg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20102 invoked from network); 6 Nov 2012 22:18:10 -0000
Received: from mo-p04-ob.rzone.de (HELO mo-p04-ob.rzone.de) (81.169.146.177)
	by server-3.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 22:18:10 -0000
X-RZG-CLASS-ID: mo04
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmxtMZ80VwmRNV7qE=
Received: from probook.site (ip-80-226-24-4.vodafone-net.de [80.226.24.4])
	by smtp.strato.de (josoe mo4) (RZmta 30.22 SBL|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id h02dfboA6LbTOU ;
	Tue, 6 Nov 2012 23:18:09 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id C06FF189BB; Tue,  6 Nov 2012 23:18:06 +0100 (CET)
Date: Tue, 6 Nov 2012 23:18:06 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Keir Fraser <keir.xen@gmail.com>
Message-ID: <20121106221806.GA1813@aepfle.de>
References: <20121106202816.GA29655@aepfle.de>
	<CCBF2785.442DA%keir.xen@gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CCBF2785.442DA%keir.xen@gmail.com>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 06, Keir Fraser wrote:

> It's known that if you have a workload that is dirtying lots of pages
> quickly, the final stop-and-copy phase will necessarily be large. A VM that
> is busy dirtying lots of pages can dirty pages much quicker than they can be
> transferred over the LAN.

In my opinion such migration should be done at application level.

> > Should 'xm migrate --live' and 'xl migrate' get something like a
> > --no-suspend option?
> 
> Well, it is not really possible to avoid the suspend altogether, there is
> always going to be some minimal 'dirty working set'. But could provide
> parameters to require the dirty working set to be smaller than X pages
> within Y rounds of dirty page copying.

Should such knobs be exposed to the tools like x[lm] migrate --knob1 val --knob2 val?

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 22:26:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 22:26:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVrai-0007aC-1E; Tue, 06 Nov 2012 22:25:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TVrah-0007a2-1C
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 22:25:51 +0000
Received: from [85.158.143.99:30364] by server-1.bemta-4.messagelabs.com id
	78/5E-27934-E6E89905; Tue, 06 Nov 2012 22:25:50 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1352240748!28920829!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0MTM4Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7744 invoked from network); 6 Nov 2012 22:25:49 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 22:25:49 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6MPkfB021480
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 22:25:47 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6MPkTB010349
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 22:25:46 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6MPk2m028203; Tue, 6 Nov 2012 16:25:46 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 06 Nov 2012 14:25:46 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 5707440068; Tue,  6 Nov 2012 17:13:03 -0500 (EST)
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com
Date: Tue,  6 Nov 2012 17:13:01 -0500
Message-Id: <1352239982-17389-2-git-send-email-konrad.wilk@oracle.com>
X-Mailer: git-send-email 1.7.7.6
In-Reply-To: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
References: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [Xen-devel] [PATCH 1/2] xen/generic: Disable fallback build on ARM.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

As there is no need for it (the fallback code is for older
hypervisors and they won't run under ARM), and also b/c
we get:

drivers/xen/fallback.c: In function 'xen_event_channel_op_compat':
drivers/xen/fallback.c:10:19: error: storage size of 'op' isn't known
drivers/xen/fallback.c:15:2: error: implicit declaration of function '_hypercall1' [-Werror=implicit-function-declaration]
drivers/xen/fallback.c:15:19: error: expected expression before 'int'
drivers/xen/fallback.c:18:7: error: 'EVTCHNOP_close' undeclared (first use in this function)
drivers/xen/fallback.c:18:7: note: each undeclared identifier is reported only once for each function it appears in
.. and more

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 drivers/xen/Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 46de6cd..273d2b9 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -1,8 +1,8 @@
 ifneq ($(CONFIG_ARM),y)
-obj-y	+= manage.o balloon.o
+obj-y	+= manage.o balloon.o fallback.o
 obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
 endif
-obj-y	+= grant-table.o features.o events.o fallback.o
+obj-y	+= grant-table.o features.o events.o
 obj-y	+= xenbus/
 
 nostackp := $(call cc-option, -fno-stack-protector)
-- 
1.7.7.6


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 22:26:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 22:26:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVrai-0007aC-1E; Tue, 06 Nov 2012 22:25:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TVrah-0007a2-1C
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 22:25:51 +0000
Received: from [85.158.143.99:30364] by server-1.bemta-4.messagelabs.com id
	78/5E-27934-E6E89905; Tue, 06 Nov 2012 22:25:50 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1352240748!28920829!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0MTM4Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7744 invoked from network); 6 Nov 2012 22:25:49 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 6 Nov 2012 22:25:49 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6MPkfB021480
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 22:25:47 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6MPkTB010349
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 22:25:46 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6MPk2m028203; Tue, 6 Nov 2012 16:25:46 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 06 Nov 2012 14:25:46 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 5707440068; Tue,  6 Nov 2012 17:13:03 -0500 (EST)
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com
Date: Tue,  6 Nov 2012 17:13:01 -0500
Message-Id: <1352239982-17389-2-git-send-email-konrad.wilk@oracle.com>
X-Mailer: git-send-email 1.7.7.6
In-Reply-To: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
References: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [Xen-devel] [PATCH 1/2] xen/generic: Disable fallback build on ARM.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

As there is no need for it (the fallback code is for older
hypervisors and they won't run under ARM), and also b/c
we get:

drivers/xen/fallback.c: In function 'xen_event_channel_op_compat':
drivers/xen/fallback.c:10:19: error: storage size of 'op' isn't known
drivers/xen/fallback.c:15:2: error: implicit declaration of function '_hypercall1' [-Werror=implicit-function-declaration]
drivers/xen/fallback.c:15:19: error: expected expression before 'int'
drivers/xen/fallback.c:18:7: error: 'EVTCHNOP_close' undeclared (first use in this function)
drivers/xen/fallback.c:18:7: note: each undeclared identifier is reported only once for each function it appears in
.. and more

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 drivers/xen/Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 46de6cd..273d2b9 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -1,8 +1,8 @@
 ifneq ($(CONFIG_ARM),y)
-obj-y	+= manage.o balloon.o
+obj-y	+= manage.o balloon.o fallback.o
 obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
 endif
-obj-y	+= grant-table.o features.o events.o fallback.o
+obj-y	+= grant-table.o features.o events.o
 obj-y	+= xenbus/
 
 nostackp := $(call cc-option, -fno-stack-protector)
-- 
1.7.7.6


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 22:26:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 22:26:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVrai-0007aK-Ch; Tue, 06 Nov 2012 22:25:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TVrah-0007a3-8z
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 22:25:51 +0000
Received: from [85.158.137.99:14700] by server-3.bemta-3.messagelabs.com id
	F9/B4-31566-E6E89905; Tue, 06 Nov 2012 22:25:50 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1352240748!18024026!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0MTM4Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17001 invoked from network); 6 Nov 2012 22:25:49 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-16.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 6 Nov 2012 22:25:49 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6MPl65021483
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 22:25:47 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6MPk65017343
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 22:25:46 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6MPkQc028202; Tue, 6 Nov 2012 16:25:46 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 06 Nov 2012 14:25:45 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 4F28A40157; Tue,  6 Nov 2012 17:13:03 -0500 (EST)
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com
Date: Tue,  6 Nov 2012 17:13:00 -0500
Message-Id: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
X-Mailer: git-send-email 1.7.7.6
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Subject: [Xen-devel] [PATCH] Fix various compile errors/warnings on ARM with
	CONFIG_XEN_*=m
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Two patches that I was thinking for v3.7 to fix compile issues.

 [PATCH 1/2] xen/generic: Disable fallback build on ARM.

This one, requires Stefano's Ack:

 [PATCH 2/2] xen/arm: Fix compile errors when drivers are compiled as

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 22:26:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 22:26:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVrai-0007aK-Ch; Tue, 06 Nov 2012 22:25:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TVrah-0007a3-8z
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 22:25:51 +0000
Received: from [85.158.137.99:14700] by server-3.bemta-3.messagelabs.com id
	F9/B4-31566-E6E89905; Tue, 06 Nov 2012 22:25:50 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1352240748!18024026!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0MTM4Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17001 invoked from network); 6 Nov 2012 22:25:49 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-16.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 6 Nov 2012 22:25:49 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6MPl65021483
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 22:25:47 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6MPk65017343
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 22:25:46 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6MPkQc028202; Tue, 6 Nov 2012 16:25:46 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 06 Nov 2012 14:25:45 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 4F28A40157; Tue,  6 Nov 2012 17:13:03 -0500 (EST)
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com
Date: Tue,  6 Nov 2012 17:13:00 -0500
Message-Id: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
X-Mailer: git-send-email 1.7.7.6
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Subject: [Xen-devel] [PATCH] Fix various compile errors/warnings on ARM with
	CONFIG_XEN_*=m
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Two patches that I was thinking for v3.7 to fix compile issues.

 [PATCH 1/2] xen/generic: Disable fallback build on ARM.

This one, requires Stefano's Ack:

 [PATCH 2/2] xen/arm: Fix compile errors when drivers are compiled as

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 22:26:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 22:26:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVrak-0007ab-P8; Tue, 06 Nov 2012 22:25:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TVrai-0007aE-JP
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 22:25:52 +0000
Received: from [85.158.138.51:63404] by server-2.bemta-3.messagelabs.com id
	76/11-04744-F6E89905; Tue, 06 Nov 2012 22:25:51 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1352240748!24935517!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0MTM4Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14890 invoked from network); 6 Nov 2012 22:25:49 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-10.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 6 Nov 2012 22:25:49 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6MPlxk021482
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 22:25:47 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6MPkE3027919
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 22:25:47 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6MPkfG023101; Tue, 6 Nov 2012 16:25:46 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 06 Nov 2012 14:25:46 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 5E7D3401A4; Tue,  6 Nov 2012 17:13:03 -0500 (EST)
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com
Date: Tue,  6 Nov 2012 17:13:02 -0500
Message-Id: <1352239982-17389-3-git-send-email-konrad.wilk@oracle.com>
X-Mailer: git-send-email 1.7.7.6
In-Reply-To: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
References: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [Xen-devel] [PATCH 2/2] xen/arm: Fix compile errors when drivers
	are compiled as modules.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

We end up with:

ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
ERROR: "HYPERVISOR_grant_table_op" [drivers/net/xen-netback/xen-netback.ko] undefined!

and this patch exports said function (which is implemented in hypercall.S).

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 arch/arm/xen/enlighten.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index 59bcb96..96d969d 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -166,3 +166,8 @@ void free_xenballooned_pages(int nr_pages, struct page **pages)
 	*pages = NULL;
 }
 EXPORT_SYMBOL_GPL(free_xenballooned_pages);
+
+/* In the hypervisor.S file. */
+EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
+EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
+EXPORT_SYMBOL_GPL(privcmd_call);
-- 
1.7.7.6


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 22:26:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 22:26:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVrak-0007ab-P8; Tue, 06 Nov 2012 22:25:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TVrai-0007aE-JP
	for xen-devel@lists.xensource.com; Tue, 06 Nov 2012 22:25:52 +0000
Received: from [85.158.138.51:63404] by server-2.bemta-3.messagelabs.com id
	76/11-04744-F6E89905; Tue, 06 Nov 2012 22:25:51 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1352240748!24935517!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0MTM4Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14890 invoked from network); 6 Nov 2012 22:25:49 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-10.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 6 Nov 2012 22:25:49 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6MPlxk021482
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 22:25:47 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6MPkE3027919
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 22:25:47 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6MPkfG023101; Tue, 6 Nov 2012 16:25:46 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 06 Nov 2012 14:25:46 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 5E7D3401A4; Tue,  6 Nov 2012 17:13:03 -0500 (EST)
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com
Date: Tue,  6 Nov 2012 17:13:02 -0500
Message-Id: <1352239982-17389-3-git-send-email-konrad.wilk@oracle.com>
X-Mailer: git-send-email 1.7.7.6
In-Reply-To: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
References: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [Xen-devel] [PATCH 2/2] xen/arm: Fix compile errors when drivers
	are compiled as modules.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

We end up with:

ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
ERROR: "HYPERVISOR_grant_table_op" [drivers/net/xen-netback/xen-netback.ko] undefined!

and this patch exports said function (which is implemented in hypercall.S).

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 arch/arm/xen/enlighten.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index 59bcb96..96d969d 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -166,3 +166,8 @@ void free_xenballooned_pages(int nr_pages, struct page **pages)
 	*pages = NULL;
 }
 EXPORT_SYMBOL_GPL(free_xenballooned_pages);
+
+/* In the hypervisor.S file. */
+EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
+EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
+EXPORT_SYMBOL_GPL(privcmd_call);
-- 
1.7.7.6


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 23:19:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 23:19:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVsQX-0008AD-4I; Tue, 06 Nov 2012 23:19:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TVsQV-0008A8-RG
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 23:19:24 +0000
Received: from [85.158.139.83:59997] by server-4.bemta-5.messagelabs.com id
	1D/18-15011-AFA99905; Tue, 06 Nov 2012 23:19:22 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1352243961!29075276!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQzNTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26191 invoked from network); 6 Nov 2012 23:19:22 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 23:19:22 -0000
X-IronPort-AV: E=Sophos;i="4.80,724,1344211200"; d="scan'208";a="213658850"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 23:18:39 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 6 Nov 2012 18:18:40 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TVsPn-0006Gp-7g	for
	xen-devel@lists.xen.org; Tue, 06 Nov 2012 23:18:39 +0000
Message-ID: <50999ACF.4040106@citrix.com>
Date: Tue, 6 Nov 2012 23:18:39 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel@lists.xen.org
References: <20121106202816.GA29655@aepfle.de>
	<CCBF2785.442DA%keir.xen@gmail.com>
	<20121106221806.GA1813@aepfle.de>
In-Reply-To: <20121106221806.GA1813@aepfle.de>
X-Enigmail-Version: 1.4.5
Subject: Re: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 06/11/12 22:18, Olaf Hering wrote:
> On Tue, Nov 06, Keir Fraser wrote:
>
>> It's known that if you have a workload that is dirtying lots of pages
>> quickly, the final stop-and-copy phase will necessarily be large. A VM that
>> is busy dirtying lots of pages can dirty pages much quicker than they can be
>> transferred over the LAN.
> In my opinion such migration should be done at application level.
>
>>> Should 'xm migrate --live' and 'xl migrate' get something like a
>>> --no-suspend option?
>> Well, it is not really possible to avoid the suspend altogether, there is
>> always going to be some minimal 'dirty working set'. But could provide
>> parameters to require the dirty working set to be smaller than X pages
>> within Y rounds of dirty page copying.
> Should such knobs be exposed to the tools like x[lm] migrate --knob1 val --knob2 val?
>
> Olaf

We (Citrix) are currently looking at some fairly serious performance
issues with migration with both classic and pvops dom0 kernels (Patches
to follow in due course)

While that will make the situation better, it wont solve the problem you
have described.

As far as I understand (so please correct me if I am wrong), migration
works by transmitting pages until the rate of dirty pages per round
approaches constant, at which point the domain gets paused, all
remaining dirty pages are transmitted.  (With the proviso that currently
there are a maximum number of rounds until an automatic pausing - this
is automatically problematic with increasing guest sizes.)  Having these
knobs tweakable by the admin/toolstack seems like a very sensible idea.

The application problem you described could possibly be something
crashing because of a sufficiently large jump in time?

As potential food for thought:

Is there wisdom in having a new kind of live migrate which, when pausing
the VM on the source host, resumes the VM on the destination host.  Xen
would have to track not-yet-sent pages and pause the guest on pagefault,
and request the required page as a matter of priority.

The advantages of this approach would be that a timing sensitive
workloads would be paused for far less time.  Even if it was frequently
being paused for pagefaults, the time to get a single page over the LAN
would be far quicker than the entire dirty set, at which point on
resume, the interrupt paths would fire again; The timing paths would
quickly become fully populated.  Further to that, a busy workload in the
guest dirtying a page which has already been sent will not result in any
further network traffic.

The disadvantages would be that Xen would need 2 way communication with
the toolstack to prioritise which page is needed to resolve a pagefault,
and presumably the toolstack->toolstack protocol would be more
complicated.  In addition, it would be much harder to "roll back" the
migrate; Once you resume the guest on the destination host, you are
committed to completing the migrate.

I presume there are other issues I have overlooked, but this idea has
literally just occurred to me upon reading this thread so far.  Comments?

~Andrew

>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 23:19:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 23:19:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVsQX-0008AD-4I; Tue, 06 Nov 2012 23:19:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TVsQV-0008A8-RG
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 23:19:24 +0000
Received: from [85.158.139.83:59997] by server-4.bemta-5.messagelabs.com id
	1D/18-15011-AFA99905; Tue, 06 Nov 2012 23:19:22 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1352243961!29075276!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQzNTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26191 invoked from network); 6 Nov 2012 23:19:22 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	6 Nov 2012 23:19:22 -0000
X-IronPort-AV: E=Sophos;i="4.80,724,1344211200"; d="scan'208";a="213658850"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	06 Nov 2012 23:18:39 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 6 Nov 2012 18:18:40 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TVsPn-0006Gp-7g	for
	xen-devel@lists.xen.org; Tue, 06 Nov 2012 23:18:39 +0000
Message-ID: <50999ACF.4040106@citrix.com>
Date: Tue, 6 Nov 2012 23:18:39 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel@lists.xen.org
References: <20121106202816.GA29655@aepfle.de>
	<CCBF2785.442DA%keir.xen@gmail.com>
	<20121106221806.GA1813@aepfle.de>
In-Reply-To: <20121106221806.GA1813@aepfle.de>
X-Enigmail-Version: 1.4.5
Subject: Re: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 06/11/12 22:18, Olaf Hering wrote:
> On Tue, Nov 06, Keir Fraser wrote:
>
>> It's known that if you have a workload that is dirtying lots of pages
>> quickly, the final stop-and-copy phase will necessarily be large. A VM that
>> is busy dirtying lots of pages can dirty pages much quicker than they can be
>> transferred over the LAN.
> In my opinion such migration should be done at application level.
>
>>> Should 'xm migrate --live' and 'xl migrate' get something like a
>>> --no-suspend option?
>> Well, it is not really possible to avoid the suspend altogether, there is
>> always going to be some minimal 'dirty working set'. But could provide
>> parameters to require the dirty working set to be smaller than X pages
>> within Y rounds of dirty page copying.
> Should such knobs be exposed to the tools like x[lm] migrate --knob1 val --knob2 val?
>
> Olaf

We (Citrix) are currently looking at some fairly serious performance
issues with migration with both classic and pvops dom0 kernels (Patches
to follow in due course)

While that will make the situation better, it wont solve the problem you
have described.

As far as I understand (so please correct me if I am wrong), migration
works by transmitting pages until the rate of dirty pages per round
approaches constant, at which point the domain gets paused, all
remaining dirty pages are transmitted.  (With the proviso that currently
there are a maximum number of rounds until an automatic pausing - this
is automatically problematic with increasing guest sizes.)  Having these
knobs tweakable by the admin/toolstack seems like a very sensible idea.

The application problem you described could possibly be something
crashing because of a sufficiently large jump in time?

As potential food for thought:

Is there wisdom in having a new kind of live migrate which, when pausing
the VM on the source host, resumes the VM on the destination host.  Xen
would have to track not-yet-sent pages and pause the guest on pagefault,
and request the required page as a matter of priority.

The advantages of this approach would be that a timing sensitive
workloads would be paused for far less time.  Even if it was frequently
being paused for pagefaults, the time to get a single page over the LAN
would be far quicker than the entire dirty set, at which point on
resume, the interrupt paths would fire again; The timing paths would
quickly become fully populated.  Further to that, a busy workload in the
guest dirtying a page which has already been sent will not result in any
further network traffic.

The disadvantages would be that Xen would need 2 way communication with
the toolstack to prioritise which page is needed to resolve a pagefault,
and presumably the toolstack->toolstack protocol would be more
complicated.  In addition, it would be much harder to "roll back" the
migrate; Once you resume the guest on the destination host, you are
committed to completing the migrate.

I presume there are other issues I have overlooked, but this idea has
literally just occurred to me upon reading this thread so far.  Comments?

~Andrew

>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 23:42:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 23:42:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVsmR-0008LO-7w; Tue, 06 Nov 2012 23:42:03 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TVsmP-0008LJ-RO
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 23:42:02 +0000
Received: from [85.158.139.83:64380] by server-14.bemta-5.messagelabs.com id
	B1/D1-21768-840A9905; Tue, 06 Nov 2012 23:42:00 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1352245319!29359219!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjkxMTg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26995 invoked from network); 6 Nov 2012 23:42:00 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-10.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 6 Nov 2012 23:42:00 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6NfsT2021009
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 23:41:55 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6Nfsuq026487
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 23:41:54 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6NfrU4012021; Tue, 6 Nov 2012 17:41:54 -0600
MIME-Version: 1.0
Message-ID: <721bf725-662f-41cb-a1a3-7c908e05c188@default>
Date: Tue, 6 Nov 2012 15:41:53 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xen.org
References: <20121106202816.GA29655@aepfle.de>
	<CCBF2785.442DA%keir.xen@gmail.com> <20121106221806.GA1813@aepfle.de>
	<50999ACF.4040106@citrix.com>
In-Reply-To: <50999ACF.4040106@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Subject: Re: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Andrew Cooper [mailto:andrew.cooper3@citrix.com]
> Sent: Tuesday, November 06, 2012 4:19 PM
> To: xen-devel@lists.xen.org
> Subject: Re: [Xen-devel] reliable live migration of large and busy guests
> 
> As potential food for thought:
> 
> Is there wisdom in having a new kind of live migrate which, when pausing
> the VM on the source host, resumes the VM on the destination host.  Xen
> would have to track not-yet-sent pages and pause the guest on pagefault,
> and request the required page as a matter of priority.
> 
> The advantages of this approach would be that a timing sensitive
> workloads would be paused for far less time.  Even if it was frequently
> being paused for pagefaults, the time to get a single page over the LAN
> would be far quicker than the entire dirty set, at which point on
> resume, the interrupt paths would fire again; The timing paths would
> quickly become fully populated.  Further to that, a busy workload in the
> guest dirtying a page which has already been sent will not result in any
> further network traffic.

Something like this?

http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.184.2368 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 06 23:42:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Nov 2012 23:42:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVsmR-0008LO-7w; Tue, 06 Nov 2012 23:42:03 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TVsmP-0008LJ-RO
	for xen-devel@lists.xen.org; Tue, 06 Nov 2012 23:42:02 +0000
Received: from [85.158.139.83:64380] by server-14.bemta-5.messagelabs.com id
	B1/D1-21768-840A9905; Tue, 06 Nov 2012 23:42:00 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1352245319!29359219!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjkxMTg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26995 invoked from network); 6 Nov 2012 23:42:00 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-10.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 6 Nov 2012 23:42:00 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA6NfsT2021009
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 6 Nov 2012 23:41:55 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA6Nfsuq026487
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 6 Nov 2012 23:41:54 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA6NfrU4012021; Tue, 6 Nov 2012 17:41:54 -0600
MIME-Version: 1.0
Message-ID: <721bf725-662f-41cb-a1a3-7c908e05c188@default>
Date: Tue, 6 Nov 2012 15:41:53 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xen.org
References: <20121106202816.GA29655@aepfle.de>
	<CCBF2785.442DA%keir.xen@gmail.com> <20121106221806.GA1813@aepfle.de>
	<50999ACF.4040106@citrix.com>
In-Reply-To: <50999ACF.4040106@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Subject: Re: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Andrew Cooper [mailto:andrew.cooper3@citrix.com]
> Sent: Tuesday, November 06, 2012 4:19 PM
> To: xen-devel@lists.xen.org
> Subject: Re: [Xen-devel] reliable live migration of large and busy guests
> 
> As potential food for thought:
> 
> Is there wisdom in having a new kind of live migrate which, when pausing
> the VM on the source host, resumes the VM on the destination host.  Xen
> would have to track not-yet-sent pages and pause the guest on pagefault,
> and request the required page as a matter of priority.
> 
> The advantages of this approach would be that a timing sensitive
> workloads would be paused for far less time.  Even if it was frequently
> being paused for pagefaults, the time to get a single page over the LAN
> would be far quicker than the entire dirty set, at which point on
> resume, the interrupt paths would fire again; The timing paths would
> quickly become fully populated.  Further to that, a busy workload in the
> guest dirtying a page which has already been sent will not result in any
> further network traffic.

Something like this?

http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.184.2368 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 02:07:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 02:07:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVv2w-0004vy-Dj; Wed, 07 Nov 2012 02:07:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg@wind.enjellic.com>) id 1TVv2u-0004vt-Ak
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 02:07:12 +0000
Received: from [193.109.254.147:56766] by server-4.bemta-14.messagelabs.com id
	59/A5-18856-F42C9905; Wed, 07 Nov 2012 02:07:11 +0000
X-Env-Sender: greg@wind.enjellic.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1352254029!9967161!1
X-Originating-IP: [76.10.64.91]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29247 invoked from network); 7 Nov 2012 02:07:09 -0000
Received: from wind.enjellic.com (HELO wind.enjellic.com) (76.10.64.91)
	by server-8.tower-27.messagelabs.com with SMTP;
	7 Nov 2012 02:07:09 -0000
Received: from wind.enjellic.com (localhost [127.0.0.1])
	by wind.enjellic.com (8.14.3/8.14.3) with ESMTP id qA7261oS028590;
	Tue, 6 Nov 2012 20:06:01 -0600
Received: (from greg@localhost)
	by wind.enjellic.com (8.14.3/8.14.3/Submit) id qA7261Bp028589;
	Tue, 6 Nov 2012 20:06:01 -0600
Date: Tue, 6 Nov 2012 20:06:01 -0600
From: "Dr. Greg Wettstein" <greg@wind.enjellic.com>
Message-Id: <201211070206.qA7261Bp028589@wind.enjellic.com>
X-Mailer: Mail User's Shell (7.2.6-ESD1.0 03/31/2012)
To: xen-devel@lists.xen.org
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.3
	(wind.enjellic.com [0.0.0.0]);
	Tue, 06 Nov 2012 20:06:01 -0600 (CST)
Cc: ian.jackson@eu.citrix.com, keir@xen.org
Subject: [Xen-devel] [PATCH 1/2] 4.1.2 blktap2 cleanup fixes.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: greg@enjellic.com
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

---------------------------------------------------------------------------
Backport of the following patch from development:

# User Ian Campbell <[hidden email]>
# Date 1309968705 -3600
# Node ID e4781aedf817c5ab36f6f3077e44c43c566a2812
# Parent 700d0f03d50aa6619d313c1ff6aea7fd429d28a7
libxl: attempt to cleanup tapdisk processes on disk backend destroy.

This patch properly terminates the tapdisk2 process(es) started
to service a virtual block device.

Signed-off-by: Greg Wettstein <greg@enjellic.com>

diff -r 700d0f03d50a tools/blktap2/control/tap-ctl-list.c
--- a/tools/blktap2/control/tap-ctl-list.c	Mon Oct 29 09:04:48 2012 +0100
+++ b/tools/blktap2/control/tap-ctl-list.c	Tue Nov 06 19:52:48 2012 -0600
@@ -506,17 +506,15 @@ out:
 }
 
 int
-tap_ctl_find_minor(const char *type, const char *path)
+tap_ctl_find(const char *type, const char *path, tap_list_t *tap)
 {
 	tap_list_t **list, **_entry;
-	int minor, err;
+	int ret = -ENOENT, err;
 
 	err = tap_ctl_list(&list);
 	if (err)
 		return err;
 
-	minor = -1;
-
 	for (_entry = list; *_entry != NULL; ++_entry) {
 		tap_list_t *entry  = *_entry;
 
@@ -526,11 +524,13 @@ tap_ctl_find_minor(const char *type, con
 		if (path && (!entry->path || strcmp(entry->path, path)))
 			continue;
 
-		minor = entry->minor;
+		*tap = *entry;
+		tap->type = tap->path = NULL;
+		ret = 0;
 		break;
 	}
 
 	tap_ctl_free_list(list);
 
-	return minor >= 0 ? minor : -ENOENT;
+	return ret;
 }
diff -r 700d0f03d50a tools/blktap2/control/tap-ctl.h
--- a/tools/blktap2/control/tap-ctl.h	Mon Oct 29 09:04:48 2012 +0100
+++ b/tools/blktap2/control/tap-ctl.h	Tue Nov 06 19:52:48 2012 -0600
@@ -76,7 +76,7 @@ int tap_ctl_get_driver_id(const char *ha
 
 int tap_ctl_list(tap_list_t ***list);
 void tap_ctl_free_list(tap_list_t **list);
-int tap_ctl_find_minor(const char *type, const char *path);
+int tap_ctl_find(const char *type, const char *path, tap_list_t *tap);
 
 int tap_ctl_allocate(int *minor, char **devname);
 int tap_ctl_free(const int minor);
diff -r 700d0f03d50a tools/libxl/libxl_blktap2.c
--- a/tools/libxl/libxl_blktap2.c	Mon Oct 29 09:04:48 2012 +0100
+++ b/tools/libxl/libxl_blktap2.c	Tue Nov 06 19:52:48 2012 -0600
@@ -18,6 +18,8 @@
 
 #include "tap-ctl.h"
 
+#include <string.h>
+
 int libxl__blktap_enabled(libxl__gc *gc)
 {
     const char *msg;
@@ -30,12 +32,13 @@ const char *libxl__blktap_devpath(libxl_
 {
     const char *type;
     char *params, *devname = NULL;
-    int minor, err;
+    tap_list_t tap;
+    int err;
 
     type = libxl__device_disk_string_of_format(format);
-    minor = tap_ctl_find_minor(type, disk);
-    if (minor >= 0) {
-        devname = libxl__sprintf(gc, "/dev/xen/blktap-2/tapdev%d", minor);
+    err = tap_ctl_find(type, disk, &tap);
+    if (err == 0) {
+        devname = libxl__sprintf(gc, "/dev/xen/blktap-2/tapdev%d", tap.minor);
         if (devname)
             return devname;
     }
@@ -49,3 +52,28 @@ const char *libxl__blktap_devpath(libxl_
 
     return NULL;
 }
+
+
+void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path)
+{
+    char *path, *params, *type, *disk;
+    int err;
+    tap_list_t tap;
+
+    path = libxl__sprintf(gc, "%s/tapdisk-params", be_path);
+    if (!path) return;
+
+    params = libxl__xs_read(gc, XBT_NULL, path);
+    if (!params) return;
+
+    type = params;
+    disk = strchr(params, ':');
+    if (!disk) return;
+
+    *disk++ = '\0';
+
+    err = tap_ctl_find(type, disk, &tap);
+    if (err < 0) return;
+
+    tap_ctl_destroy(tap.id, tap.minor);
+}
diff -r 700d0f03d50a tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c	Mon Oct 29 09:04:48 2012 +0100
+++ b/tools/libxl/libxl_device.c	Tue Nov 06 19:52:48 2012 -0600
@@ -250,6 +250,7 @@ int libxl__device_destroy(libxl_ctx *ctx
     if (!state)
         goto out;
     if (atoi(state) != 4) {
+        libxl__device_destroy_tapdisk(&gc, be_path);
         xs_rm(ctx->xsh, XBT_NULL, be_path);
         goto out;
     }
@@ -368,6 +369,7 @@ int libxl__devices_destroy(libxl_ctx *ct
             }
         }
     }
+    libxl__device_destroy_tapdisk(&gc, be_path);
 out:
     libxl__free_all(&gc);
     return 0;
diff -r 700d0f03d50a tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Mon Oct 29 09:04:48 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Tue Nov 06 19:52:48 2012 -0600
@@ -314,6 +314,12 @@ _hidden const char *libxl__blktap_devpat
                                  const char *disk,
                                  libxl_disk_format format);
 
+/* libxl__device_destroy_tapdisk:
+ *   Destroys any tapdisk process associated with the backend represented
+ *   by be_path.
+ */
+_hidden void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path);
+
 _hidden char *libxl__uuid2string(libxl__gc *gc, const libxl_uuid uuid);
 
 struct libxl__xen_console_reader {
diff -r 700d0f03d50a tools/libxl/libxl_noblktap2.c
--- a/tools/libxl/libxl_noblktap2.c	Mon Oct 29 09:04:48 2012 +0100
+++ b/tools/libxl/libxl_noblktap2.c	Tue Nov 06 19:52:48 2012 -0600
@@ -27,3 +27,7 @@ const char *libxl__blktap_devpath(libxl_
 {
     return NULL;
 }
+
+void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path)
+{
+}
---------------------------------------------------------------------------

As always,
Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
4206 N. 19th Ave.           Specializing in information infra-structure
Fargo, ND  58102            development.
PH: 701-281-1686
FAX: 701-281-3949           EMAIL: greg@enjellic.com
------------------------------------------------------------------------------
"Man, despite his artistic pretensions, his sophistication and many
 accomplishments, owes the fact of his existence to a six-inch layer of
 topsoil and the fact that it rains."
                                -- Anonymous writer on perspective.
                                   GAUSSIAN quote.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 02:07:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 02:07:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVv2w-0004vy-Dj; Wed, 07 Nov 2012 02:07:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg@wind.enjellic.com>) id 1TVv2u-0004vt-Ak
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 02:07:12 +0000
Received: from [193.109.254.147:56766] by server-4.bemta-14.messagelabs.com id
	59/A5-18856-F42C9905; Wed, 07 Nov 2012 02:07:11 +0000
X-Env-Sender: greg@wind.enjellic.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1352254029!9967161!1
X-Originating-IP: [76.10.64.91]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29247 invoked from network); 7 Nov 2012 02:07:09 -0000
Received: from wind.enjellic.com (HELO wind.enjellic.com) (76.10.64.91)
	by server-8.tower-27.messagelabs.com with SMTP;
	7 Nov 2012 02:07:09 -0000
Received: from wind.enjellic.com (localhost [127.0.0.1])
	by wind.enjellic.com (8.14.3/8.14.3) with ESMTP id qA7261oS028590;
	Tue, 6 Nov 2012 20:06:01 -0600
Received: (from greg@localhost)
	by wind.enjellic.com (8.14.3/8.14.3/Submit) id qA7261Bp028589;
	Tue, 6 Nov 2012 20:06:01 -0600
Date: Tue, 6 Nov 2012 20:06:01 -0600
From: "Dr. Greg Wettstein" <greg@wind.enjellic.com>
Message-Id: <201211070206.qA7261Bp028589@wind.enjellic.com>
X-Mailer: Mail User's Shell (7.2.6-ESD1.0 03/31/2012)
To: xen-devel@lists.xen.org
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.3
	(wind.enjellic.com [0.0.0.0]);
	Tue, 06 Nov 2012 20:06:01 -0600 (CST)
Cc: ian.jackson@eu.citrix.com, keir@xen.org
Subject: [Xen-devel] [PATCH 1/2] 4.1.2 blktap2 cleanup fixes.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: greg@enjellic.com
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

---------------------------------------------------------------------------
Backport of the following patch from development:

# User Ian Campbell <[hidden email]>
# Date 1309968705 -3600
# Node ID e4781aedf817c5ab36f6f3077e44c43c566a2812
# Parent 700d0f03d50aa6619d313c1ff6aea7fd429d28a7
libxl: attempt to cleanup tapdisk processes on disk backend destroy.

This patch properly terminates the tapdisk2 process(es) started
to service a virtual block device.

Signed-off-by: Greg Wettstein <greg@enjellic.com>

diff -r 700d0f03d50a tools/blktap2/control/tap-ctl-list.c
--- a/tools/blktap2/control/tap-ctl-list.c	Mon Oct 29 09:04:48 2012 +0100
+++ b/tools/blktap2/control/tap-ctl-list.c	Tue Nov 06 19:52:48 2012 -0600
@@ -506,17 +506,15 @@ out:
 }
 
 int
-tap_ctl_find_minor(const char *type, const char *path)
+tap_ctl_find(const char *type, const char *path, tap_list_t *tap)
 {
 	tap_list_t **list, **_entry;
-	int minor, err;
+	int ret = -ENOENT, err;
 
 	err = tap_ctl_list(&list);
 	if (err)
 		return err;
 
-	minor = -1;
-
 	for (_entry = list; *_entry != NULL; ++_entry) {
 		tap_list_t *entry  = *_entry;
 
@@ -526,11 +524,13 @@ tap_ctl_find_minor(const char *type, con
 		if (path && (!entry->path || strcmp(entry->path, path)))
 			continue;
 
-		minor = entry->minor;
+		*tap = *entry;
+		tap->type = tap->path = NULL;
+		ret = 0;
 		break;
 	}
 
 	tap_ctl_free_list(list);
 
-	return minor >= 0 ? minor : -ENOENT;
+	return ret;
 }
diff -r 700d0f03d50a tools/blktap2/control/tap-ctl.h
--- a/tools/blktap2/control/tap-ctl.h	Mon Oct 29 09:04:48 2012 +0100
+++ b/tools/blktap2/control/tap-ctl.h	Tue Nov 06 19:52:48 2012 -0600
@@ -76,7 +76,7 @@ int tap_ctl_get_driver_id(const char *ha
 
 int tap_ctl_list(tap_list_t ***list);
 void tap_ctl_free_list(tap_list_t **list);
-int tap_ctl_find_minor(const char *type, const char *path);
+int tap_ctl_find(const char *type, const char *path, tap_list_t *tap);
 
 int tap_ctl_allocate(int *minor, char **devname);
 int tap_ctl_free(const int minor);
diff -r 700d0f03d50a tools/libxl/libxl_blktap2.c
--- a/tools/libxl/libxl_blktap2.c	Mon Oct 29 09:04:48 2012 +0100
+++ b/tools/libxl/libxl_blktap2.c	Tue Nov 06 19:52:48 2012 -0600
@@ -18,6 +18,8 @@
 
 #include "tap-ctl.h"
 
+#include <string.h>
+
 int libxl__blktap_enabled(libxl__gc *gc)
 {
     const char *msg;
@@ -30,12 +32,13 @@ const char *libxl__blktap_devpath(libxl_
 {
     const char *type;
     char *params, *devname = NULL;
-    int minor, err;
+    tap_list_t tap;
+    int err;
 
     type = libxl__device_disk_string_of_format(format);
-    minor = tap_ctl_find_minor(type, disk);
-    if (minor >= 0) {
-        devname = libxl__sprintf(gc, "/dev/xen/blktap-2/tapdev%d", minor);
+    err = tap_ctl_find(type, disk, &tap);
+    if (err == 0) {
+        devname = libxl__sprintf(gc, "/dev/xen/blktap-2/tapdev%d", tap.minor);
         if (devname)
             return devname;
     }
@@ -49,3 +52,28 @@ const char *libxl__blktap_devpath(libxl_
 
     return NULL;
 }
+
+
+void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path)
+{
+    char *path, *params, *type, *disk;
+    int err;
+    tap_list_t tap;
+
+    path = libxl__sprintf(gc, "%s/tapdisk-params", be_path);
+    if (!path) return;
+
+    params = libxl__xs_read(gc, XBT_NULL, path);
+    if (!params) return;
+
+    type = params;
+    disk = strchr(params, ':');
+    if (!disk) return;
+
+    *disk++ = '\0';
+
+    err = tap_ctl_find(type, disk, &tap);
+    if (err < 0) return;
+
+    tap_ctl_destroy(tap.id, tap.minor);
+}
diff -r 700d0f03d50a tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c	Mon Oct 29 09:04:48 2012 +0100
+++ b/tools/libxl/libxl_device.c	Tue Nov 06 19:52:48 2012 -0600
@@ -250,6 +250,7 @@ int libxl__device_destroy(libxl_ctx *ctx
     if (!state)
         goto out;
     if (atoi(state) != 4) {
+        libxl__device_destroy_tapdisk(&gc, be_path);
         xs_rm(ctx->xsh, XBT_NULL, be_path);
         goto out;
     }
@@ -368,6 +369,7 @@ int libxl__devices_destroy(libxl_ctx *ct
             }
         }
     }
+    libxl__device_destroy_tapdisk(&gc, be_path);
 out:
     libxl__free_all(&gc);
     return 0;
diff -r 700d0f03d50a tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Mon Oct 29 09:04:48 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Tue Nov 06 19:52:48 2012 -0600
@@ -314,6 +314,12 @@ _hidden const char *libxl__blktap_devpat
                                  const char *disk,
                                  libxl_disk_format format);
 
+/* libxl__device_destroy_tapdisk:
+ *   Destroys any tapdisk process associated with the backend represented
+ *   by be_path.
+ */
+_hidden void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path);
+
 _hidden char *libxl__uuid2string(libxl__gc *gc, const libxl_uuid uuid);
 
 struct libxl__xen_console_reader {
diff -r 700d0f03d50a tools/libxl/libxl_noblktap2.c
--- a/tools/libxl/libxl_noblktap2.c	Mon Oct 29 09:04:48 2012 +0100
+++ b/tools/libxl/libxl_noblktap2.c	Tue Nov 06 19:52:48 2012 -0600
@@ -27,3 +27,7 @@ const char *libxl__blktap_devpath(libxl_
 {
     return NULL;
 }
+
+void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path)
+{
+}
---------------------------------------------------------------------------

As always,
Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
4206 N. 19th Ave.           Specializing in information infra-structure
Fargo, ND  58102            development.
PH: 701-281-1686
FAX: 701-281-3949           EMAIL: greg@enjellic.com
------------------------------------------------------------------------------
"Man, despite his artistic pretensions, his sophistication and many
 accomplishments, owes the fact of his existence to a six-inch layer of
 topsoil and the fact that it rains."
                                -- Anonymous writer on perspective.
                                   GAUSSIAN quote.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 02:08:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 02:08:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVv3p-0004y1-UD; Wed, 07 Nov 2012 02:08:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg@wind.enjellic.com>) id 1TVv3o-0004xv-Qi
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 02:08:09 +0000
Received: from [85.158.139.211:36640] by server-10.bemta-5.messagelabs.com id
	F6/CB-09257-782C9905; Wed, 07 Nov 2012 02:08:07 +0000
X-Env-Sender: greg@wind.enjellic.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1352254086!19159513!1
X-Originating-IP: [76.10.64.91]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28799 invoked from network); 7 Nov 2012 02:08:06 -0000
Received: from wind.enjellic.com (HELO wind.enjellic.com) (76.10.64.91)
	by server-3.tower-206.messagelabs.com with SMTP;
	7 Nov 2012 02:08:06 -0000
Received: from wind.enjellic.com (localhost [127.0.0.1])
	by wind.enjellic.com (8.14.3/8.14.3) with ESMTP id qA727wVC028602;
	Tue, 6 Nov 2012 20:07:58 -0600
Received: (from greg@localhost)
	by wind.enjellic.com (8.14.3/8.14.3/Submit) id qA727wF1028601;
	Tue, 6 Nov 2012 20:07:58 -0600
Date: Tue, 6 Nov 2012 20:07:58 -0600
From: "Dr. Greg Wettstein" <greg@wind.enjellic.com>
Message-Id: <201211070207.qA727wF1028601@wind.enjellic.com>
X-Mailer: Mail User's Shell (7.2.6-ESD1.0 03/31/2012)
To: xen-devel@lists.xen.org
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.3
	(wind.enjellic.com [0.0.0.0]);
	Tue, 06 Nov 2012 20:07:58 -0600 (CST)
Cc: ian.jackson@eu.citrix.com, keir@xen.org
Subject: [Xen-devel] [PATCH 2/2] 4.1.2 blktap2 cleanup fixes.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: greg@enjellic.com
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

---------------------------------------------------------------------------
The following patch when applied on top of:

libxl: attempt to cleanup tapdisk processes on disk backend destroy.

Establishes correct cleanup behavior for blktap devices.  This patch
implements the release of the backend device before calling for
the destruction of the userspace component of the blktap device.

Without this patch the kernel xen-blkback driver deadlocks with
the blktap2 user control plane until the IPC channel is terminated by the
timeout on the select() call.  This results in a noticeable delay
in the termination of the guest and causes the blktap minor
number which had been allocated to be orphaned.

Signed-off-by: Greg Wettstein <greg@enjellic.com>

diff -r b184698e0893 tools/libxl/libxl_blktap2.c
--- a/tools/libxl/libxl_blktap2.c	Tue Nov 06 19:53:48 2012 -0600
+++ b/tools/libxl/libxl_blktap2.c	Tue Nov 06 19:54:23 2012 -0600
@@ -59,6 +59,7 @@ void libxl__device_destroy_tapdisk(libxl
     char *path, *params, *type, *disk;
     int err;
     tap_list_t tap;
+    libxl_ctx *ctx = libxl__gc_owner(gc);
 
     path = libxl__sprintf(gc, "%s/tapdisk-params", be_path);
     if (!path) return;
@@ -75,5 +76,11 @@ void libxl__device_destroy_tapdisk(libxl
     err = tap_ctl_find(type, disk, &tap);
     if (err < 0) return;
 
+    /*
+     * Remove the instance of the backend device to avoid a deadlock with the
+     * removal of the tap device.
+     */
+    xs_rm(ctx->xsh, XBT_NULL, be_path);
+
     tap_ctl_destroy(tap.id, tap.minor);
 }
diff -r b184698e0893 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c	Tue Nov 06 19:53:48 2012 -0600
+++ b/tools/libxl/libxl_device.c	Tue Nov 06 19:54:23 2012 -0600
@@ -250,8 +250,7 @@ int libxl__device_destroy(libxl_ctx *ctx
     if (!state)
         goto out;
     if (atoi(state) != 4) {
-        libxl__device_destroy_tapdisk(&gc, be_path);
-        xs_rm(ctx->xsh, XBT_NULL, be_path);
+	libxl__device_destroy_tapdisk(&gc, be_path);
         goto out;
     }
 
---------------------------------------------------------------------------

As always,
Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
4206 N. 19th Ave.           Specializing in information infra-structure
Fargo, ND  58102            development.
PH: 701-281-1686
FAX: 701-281-3949           EMAIL: greg@enjellic.com
------------------------------------------------------------------------------
"Fungus doesn't take a vacation."
                                -- Rob Pike

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 02:08:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 02:08:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVv3p-0004y1-UD; Wed, 07 Nov 2012 02:08:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg@wind.enjellic.com>) id 1TVv3o-0004xv-Qi
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 02:08:09 +0000
Received: from [85.158.139.211:36640] by server-10.bemta-5.messagelabs.com id
	F6/CB-09257-782C9905; Wed, 07 Nov 2012 02:08:07 +0000
X-Env-Sender: greg@wind.enjellic.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1352254086!19159513!1
X-Originating-IP: [76.10.64.91]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28799 invoked from network); 7 Nov 2012 02:08:06 -0000
Received: from wind.enjellic.com (HELO wind.enjellic.com) (76.10.64.91)
	by server-3.tower-206.messagelabs.com with SMTP;
	7 Nov 2012 02:08:06 -0000
Received: from wind.enjellic.com (localhost [127.0.0.1])
	by wind.enjellic.com (8.14.3/8.14.3) with ESMTP id qA727wVC028602;
	Tue, 6 Nov 2012 20:07:58 -0600
Received: (from greg@localhost)
	by wind.enjellic.com (8.14.3/8.14.3/Submit) id qA727wF1028601;
	Tue, 6 Nov 2012 20:07:58 -0600
Date: Tue, 6 Nov 2012 20:07:58 -0600
From: "Dr. Greg Wettstein" <greg@wind.enjellic.com>
Message-Id: <201211070207.qA727wF1028601@wind.enjellic.com>
X-Mailer: Mail User's Shell (7.2.6-ESD1.0 03/31/2012)
To: xen-devel@lists.xen.org
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.3
	(wind.enjellic.com [0.0.0.0]);
	Tue, 06 Nov 2012 20:07:58 -0600 (CST)
Cc: ian.jackson@eu.citrix.com, keir@xen.org
Subject: [Xen-devel] [PATCH 2/2] 4.1.2 blktap2 cleanup fixes.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: greg@enjellic.com
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

---------------------------------------------------------------------------
The following patch when applied on top of:

libxl: attempt to cleanup tapdisk processes on disk backend destroy.

Establishes correct cleanup behavior for blktap devices.  This patch
implements the release of the backend device before calling for
the destruction of the userspace component of the blktap device.

Without this patch the kernel xen-blkback driver deadlocks with
the blktap2 user control plane until the IPC channel is terminated by the
timeout on the select() call.  This results in a noticeable delay
in the termination of the guest and causes the blktap minor
number which had been allocated to be orphaned.

Signed-off-by: Greg Wettstein <greg@enjellic.com>

diff -r b184698e0893 tools/libxl/libxl_blktap2.c
--- a/tools/libxl/libxl_blktap2.c	Tue Nov 06 19:53:48 2012 -0600
+++ b/tools/libxl/libxl_blktap2.c	Tue Nov 06 19:54:23 2012 -0600
@@ -59,6 +59,7 @@ void libxl__device_destroy_tapdisk(libxl
     char *path, *params, *type, *disk;
     int err;
     tap_list_t tap;
+    libxl_ctx *ctx = libxl__gc_owner(gc);
 
     path = libxl__sprintf(gc, "%s/tapdisk-params", be_path);
     if (!path) return;
@@ -75,5 +76,11 @@ void libxl__device_destroy_tapdisk(libxl
     err = tap_ctl_find(type, disk, &tap);
     if (err < 0) return;
 
+    /*
+     * Remove the instance of the backend device to avoid a deadlock with the
+     * removal of the tap device.
+     */
+    xs_rm(ctx->xsh, XBT_NULL, be_path);
+
     tap_ctl_destroy(tap.id, tap.minor);
 }
diff -r b184698e0893 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c	Tue Nov 06 19:53:48 2012 -0600
+++ b/tools/libxl/libxl_device.c	Tue Nov 06 19:54:23 2012 -0600
@@ -250,8 +250,7 @@ int libxl__device_destroy(libxl_ctx *ctx
     if (!state)
         goto out;
     if (atoi(state) != 4) {
-        libxl__device_destroy_tapdisk(&gc, be_path);
-        xs_rm(ctx->xsh, XBT_NULL, be_path);
+	libxl__device_destroy_tapdisk(&gc, be_path);
         goto out;
     }
 
---------------------------------------------------------------------------

As always,
Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
4206 N. 19th Ave.           Specializing in information infra-structure
Fargo, ND  58102            development.
PH: 701-281-1686
FAX: 701-281-3949           EMAIL: greg@enjellic.com
------------------------------------------------------------------------------
"Fungus doesn't take a vacation."
                                -- Rob Pike

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 02:18:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 02:18:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVvDO-0005Di-5U; Wed, 07 Nov 2012 02:18:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg@wind.enjellic.com>) id 1TVvDM-0005Dd-Dc
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 02:18:00 +0000
Received: from [85.158.138.51:30029] by server-16.bemta-3.messagelabs.com id
	0F/3A-07461-7D4C9905; Wed, 07 Nov 2012 02:17:59 +0000
X-Env-Sender: greg@wind.enjellic.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1352254678!9273004!1
X-Originating-IP: [76.10.64.91]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17050 invoked from network); 7 Nov 2012 02:17:58 -0000
Received: from wind.enjellic.com (HELO wind.enjellic.com) (76.10.64.91)
	by server-13.tower-174.messagelabs.com with SMTP;
	7 Nov 2012 02:17:58 -0000
Received: from wind.enjellic.com (localhost [127.0.0.1])
	by wind.enjellic.com (8.14.3/8.14.3) with ESMTP id qA72HpYZ028648;
	Tue, 6 Nov 2012 20:17:51 -0600
Received: (from greg@localhost)
	by wind.enjellic.com (8.14.3/8.14.3/Submit) id qA72HoqS028647;
	Tue, 6 Nov 2012 20:17:50 -0600
Date: Tue, 6 Nov 2012 20:17:50 -0600
From: "Dr. Greg Wettstein" <greg@wind.enjellic.com>
Message-Id: <201211070217.qA72HoqS028647@wind.enjellic.com>
In-Reply-To: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
	"Re: [Xen-devel] XEN 4.1.3 blktap2 patches." (Nov  5,  2:26pm)
X-Mailer: Mail User's Shell (7.2.6-ESD1.0 03/31/2012)
To: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.3
	(wind.enjellic.com [0.0.0.0]);
	Tue, 06 Nov 2012 20:17:51 -0600 (CST)
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] XEN 4.1.3 blktap2 patches.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: greg@enjellic.com
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Nov 5,  2:26pm, Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= wrote:
} Subject: Re: [Xen-devel] XEN 4.1.3 blktap2 patches.

Hi Pasi, hope this note finds your week going well.

> Dr. Greg: RC1 for Xen 4.1.4 is being prepared atm, so hopefully you
> can re-submit these blktap2 bugfix patches for inclusion!

Yes, my apologies for being more then a bit tardy on this.  I have
been consumed with getting 4.2 validated in our development
environment.

I just sent a pair of patches to the list which I refreshed against
the top of the xen-4.1.testing Mercurial repository which contain the
blktap2 patches.  With both applied 4.1.x shows correct behavior with
respect to blktap2 cleanup and termination.

> Thanks,
> 
> -- Pasi

Let me know if anything else is required.

Once again my apologies for being tardy about getting these
re-forwarded.

Best wishes for a successful release and a productive remainder of the
week.

Greg

}-- End of excerpt from Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?=

As always,
Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
4206 N. 19th Ave.           Specializing in information infra-structure
Fargo, ND  58102            development.
PH: 701-281-1686
FAX: 701-281-3949           EMAIL: greg@enjellic.com
------------------------------------------------------------------------------
"Meeting:
        An assembly of people coming together to decide what person or
        department not represented in the room must solve a problem."
                                -- Unknown
\~t

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 02:18:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 02:18:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVvDO-0005Di-5U; Wed, 07 Nov 2012 02:18:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg@wind.enjellic.com>) id 1TVvDM-0005Dd-Dc
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 02:18:00 +0000
Received: from [85.158.138.51:30029] by server-16.bemta-3.messagelabs.com id
	0F/3A-07461-7D4C9905; Wed, 07 Nov 2012 02:17:59 +0000
X-Env-Sender: greg@wind.enjellic.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1352254678!9273004!1
X-Originating-IP: [76.10.64.91]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17050 invoked from network); 7 Nov 2012 02:17:58 -0000
Received: from wind.enjellic.com (HELO wind.enjellic.com) (76.10.64.91)
	by server-13.tower-174.messagelabs.com with SMTP;
	7 Nov 2012 02:17:58 -0000
Received: from wind.enjellic.com (localhost [127.0.0.1])
	by wind.enjellic.com (8.14.3/8.14.3) with ESMTP id qA72HpYZ028648;
	Tue, 6 Nov 2012 20:17:51 -0600
Received: (from greg@localhost)
	by wind.enjellic.com (8.14.3/8.14.3/Submit) id qA72HoqS028647;
	Tue, 6 Nov 2012 20:17:50 -0600
Date: Tue, 6 Nov 2012 20:17:50 -0600
From: "Dr. Greg Wettstein" <greg@wind.enjellic.com>
Message-Id: <201211070217.qA72HoqS028647@wind.enjellic.com>
In-Reply-To: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
	"Re: [Xen-devel] XEN 4.1.3 blktap2 patches." (Nov  5,  2:26pm)
X-Mailer: Mail User's Shell (7.2.6-ESD1.0 03/31/2012)
To: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.3
	(wind.enjellic.com [0.0.0.0]);
	Tue, 06 Nov 2012 20:17:51 -0600 (CST)
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] XEN 4.1.3 blktap2 patches.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: greg@enjellic.com
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Nov 5,  2:26pm, Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= wrote:
} Subject: Re: [Xen-devel] XEN 4.1.3 blktap2 patches.

Hi Pasi, hope this note finds your week going well.

> Dr. Greg: RC1 for Xen 4.1.4 is being prepared atm, so hopefully you
> can re-submit these blktap2 bugfix patches for inclusion!

Yes, my apologies for being more then a bit tardy on this.  I have
been consumed with getting 4.2 validated in our development
environment.

I just sent a pair of patches to the list which I refreshed against
the top of the xen-4.1.testing Mercurial repository which contain the
blktap2 patches.  With both applied 4.1.x shows correct behavior with
respect to blktap2 cleanup and termination.

> Thanks,
> 
> -- Pasi

Let me know if anything else is required.

Once again my apologies for being tardy about getting these
re-forwarded.

Best wishes for a successful release and a productive remainder of the
week.

Greg

}-- End of excerpt from Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?=

As always,
Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
4206 N. 19th Ave.           Specializing in information infra-structure
Fargo, ND  58102            development.
PH: 701-281-1686
FAX: 701-281-3949           EMAIL: greg@enjellic.com
------------------------------------------------------------------------------
"Meeting:
        An assembly of people coming together to decide what person or
        department not represented in the room must solve a problem."
                                -- Unknown
\~t

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 03:43:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 03:43:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVwXc-0005ZD-6u; Wed, 07 Nov 2012 03:43:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <vip2442@gmail.com>) id 1TVwXa-0005Z8-Lf
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 03:42:58 +0000
Received: from [85.158.143.99:18468] by server-2.bemta-4.messagelabs.com id
	0B/EC-28922-2C8D9905; Wed, 07 Nov 2012 03:42:58 +0000
X-Env-Sender: vip2442@gmail.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1352259776!22514250!1
X-Originating-IP: [209.85.214.171]
X-SpamReason: No, hits=0.9 required=7.0 tests=HTML_40_50,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11124 invoked from network); 7 Nov 2012 03:42:57 -0000
Received: from mail-ob0-f171.google.com (HELO mail-ob0-f171.google.com)
	(209.85.214.171)
	by server-10.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 03:42:57 -0000
Received: by mail-ob0-f171.google.com with SMTP id 16so1573717obc.30
	for <xen-devel@lists.xensource.com>;
	Tue, 06 Nov 2012 19:42:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=PrkI7XORczE+CHxQugjVna31pQolxVQ1xtCIcR+IEVE=;
	b=di+mkg0OTkdViH8jr+53oQMwz3gJoJp0KEFeZ4veYvs1mbe76L3frQX1xjgv99Vh0y
	/DkhmedCB/vWq0AFcZR+wqw6OM8XoAdP5lO5d84Bm0B2IhSb7sEjlrWCm6wXJxpqyoAR
	NFYGuHBgUXgXrCJMcGDLWNQ1TQobgF6n0xHdwd7k5tS5l3cruk3+59YarBmGetFbRDlw
	Hli8DsW+u8Qd/mmlAtKrpFDn5NE0YOCC4xvV7tMQcBnLUXVGDDdk1BnJxMk0OpuSbZJV
	YtogKC61KUF0A+AHIMxdnpEV/7kAtCkrdLUvycsW3fUvA2PKJNyqTk9xaAXG0X4v+MTx
	dPLQ==
MIME-Version: 1.0
Received: by 10.60.169.234 with SMTP id ah10mr905455oec.12.1352259775985; Tue,
	06 Nov 2012 19:42:55 -0800 (PST)
Received: by 10.76.86.164 with HTTP; Tue, 6 Nov 2012 19:42:55 -0800 (PST)
Date: Tue, 6 Nov 2012 19:42:55 -0800
Message-ID: <CAPm+FyXz2sQ1phvR2TxkmUcWZq99B8pAn1BcqOLh1ESCZ7Jf2A@mail.gmail.com>
From: "Muneer A. Alshowkan" <vip2442@gmail.com>
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] What do I need to write and compile code for xen
	hypercalls ?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4697995513818285935=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4697995513818285935==
Content-Type: multipart/alternative; boundary=bcaec54d4d8e9778de04cddf838e

--bcaec54d4d8e9778de04cddf838e
Content-Type: text/plain; charset=ISO-8859-1

I want to write a code that list any hypercall happen from Domain U. I have
xen 4.1 installed on Ubuntu 12.04. What are the extra tools I need to write
that code and compile it?


Thanks.

--bcaec54d4d8e9778de04cddf838e
Content-Type: text/html; charset=ISO-8859-1

<div><br></div><div><p class="MsoNormal"><span style="font-family:Arial,sans-serif">I
want to write a code that list any hypercall happen from Domain U. I have xen
4.1 installed on Ubuntu 12.04. What are the extra tools I need to
write that code and compile it?</span></p></div><div><br></div><div><br></div><div>Thanks.</div>

--bcaec54d4d8e9778de04cddf838e--


--===============4697995513818285935==
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.xen.org
http://lists.xen.org/xen-devel

--===============4697995513818285935==--


From xen-devel-bounces@lists.xen.org Wed Nov 07 03:43:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 03:43:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVwXc-0005ZD-6u; Wed, 07 Nov 2012 03:43:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <vip2442@gmail.com>) id 1TVwXa-0005Z8-Lf
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 03:42:58 +0000
Received: from [85.158.143.99:18468] by server-2.bemta-4.messagelabs.com id
	0B/EC-28922-2C8D9905; Wed, 07 Nov 2012 03:42:58 +0000
X-Env-Sender: vip2442@gmail.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1352259776!22514250!1
X-Originating-IP: [209.85.214.171]
X-SpamReason: No, hits=0.9 required=7.0 tests=HTML_40_50,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11124 invoked from network); 7 Nov 2012 03:42:57 -0000
Received: from mail-ob0-f171.google.com (HELO mail-ob0-f171.google.com)
	(209.85.214.171)
	by server-10.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 03:42:57 -0000
Received: by mail-ob0-f171.google.com with SMTP id 16so1573717obc.30
	for <xen-devel@lists.xensource.com>;
	Tue, 06 Nov 2012 19:42:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=PrkI7XORczE+CHxQugjVna31pQolxVQ1xtCIcR+IEVE=;
	b=di+mkg0OTkdViH8jr+53oQMwz3gJoJp0KEFeZ4veYvs1mbe76L3frQX1xjgv99Vh0y
	/DkhmedCB/vWq0AFcZR+wqw6OM8XoAdP5lO5d84Bm0B2IhSb7sEjlrWCm6wXJxpqyoAR
	NFYGuHBgUXgXrCJMcGDLWNQ1TQobgF6n0xHdwd7k5tS5l3cruk3+59YarBmGetFbRDlw
	Hli8DsW+u8Qd/mmlAtKrpFDn5NE0YOCC4xvV7tMQcBnLUXVGDDdk1BnJxMk0OpuSbZJV
	YtogKC61KUF0A+AHIMxdnpEV/7kAtCkrdLUvycsW3fUvA2PKJNyqTk9xaAXG0X4v+MTx
	dPLQ==
MIME-Version: 1.0
Received: by 10.60.169.234 with SMTP id ah10mr905455oec.12.1352259775985; Tue,
	06 Nov 2012 19:42:55 -0800 (PST)
Received: by 10.76.86.164 with HTTP; Tue, 6 Nov 2012 19:42:55 -0800 (PST)
Date: Tue, 6 Nov 2012 19:42:55 -0800
Message-ID: <CAPm+FyXz2sQ1phvR2TxkmUcWZq99B8pAn1BcqOLh1ESCZ7Jf2A@mail.gmail.com>
From: "Muneer A. Alshowkan" <vip2442@gmail.com>
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] What do I need to write and compile code for xen
	hypercalls ?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4697995513818285935=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4697995513818285935==
Content-Type: multipart/alternative; boundary=bcaec54d4d8e9778de04cddf838e

--bcaec54d4d8e9778de04cddf838e
Content-Type: text/plain; charset=ISO-8859-1

I want to write a code that list any hypercall happen from Domain U. I have
xen 4.1 installed on Ubuntu 12.04. What are the extra tools I need to write
that code and compile it?


Thanks.

--bcaec54d4d8e9778de04cddf838e
Content-Type: text/html; charset=ISO-8859-1

<div><br></div><div><p class="MsoNormal"><span style="font-family:Arial,sans-serif">I
want to write a code that list any hypercall happen from Domain U. I have xen
4.1 installed on Ubuntu 12.04. What are the extra tools I need to
write that code and compile it?</span></p></div><div><br></div><div><br></div><div>Thanks.</div>

--bcaec54d4d8e9778de04cddf838e--


--===============4697995513818285935==
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.xen.org
http://lists.xen.org/xen-devel

--===============4697995513818285935==--


From xen-devel-bounces@lists.xen.org Wed Nov 07 05:31:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 05:31:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVyEX-0006FA-RX; Wed, 07 Nov 2012 05:31:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TVyEW-0006F5-W4
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 05:31:25 +0000
Received: from [85.158.139.211:57470] by server-6.bemta-5.messagelabs.com id
	08/46-19321-C22F9905; Wed, 07 Nov 2012 05:31:24 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1352266283!15194658!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTc1Nzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23008 invoked from network); 7 Nov 2012 05:31:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 05:31:23 -0000
X-IronPort-AV: E=Sophos;i="4.80,726,1344211200"; d="scan'208";a="15628646"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 05:31:21 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 7 Nov 2012 05:31:21 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TVyET-0003Zq-BH;
	Wed, 07 Nov 2012 05:31:21 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TVyET-0005HO-2x;
	Wed, 07 Nov 2012 05:31:21 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14371-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 7 Nov 2012 05:31:21 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14371: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14371 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14371/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14368
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14368
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14368
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14368

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  bd78e5630a5b
baseline version:
 xen                  bd78e5630a5b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 05:31:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 05:31:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVyEX-0006FA-RX; Wed, 07 Nov 2012 05:31:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TVyEW-0006F5-W4
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 05:31:25 +0000
Received: from [85.158.139.211:57470] by server-6.bemta-5.messagelabs.com id
	08/46-19321-C22F9905; Wed, 07 Nov 2012 05:31:24 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1352266283!15194658!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTc1Nzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23008 invoked from network); 7 Nov 2012 05:31:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 05:31:23 -0000
X-IronPort-AV: E=Sophos;i="4.80,726,1344211200"; d="scan'208";a="15628646"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 05:31:21 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 7 Nov 2012 05:31:21 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TVyET-0003Zq-BH;
	Wed, 07 Nov 2012 05:31:21 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TVyET-0005HO-2x;
	Wed, 07 Nov 2012 05:31:21 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14371-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 7 Nov 2012 05:31:21 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14371: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14371 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14371/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14368
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14368
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14368
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14368

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  bd78e5630a5b
baseline version:
 xen                  bd78e5630a5b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 07:22:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 07:22:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVzxa-0006uP-GV; Wed, 07 Nov 2012 07:22:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TVzxY-0006uK-EW
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 07:22:00 +0000
Received: from [85.158.143.99:59823] by server-2.bemta-4.messagelabs.com id
	15/E2-28922-71C0A905; Wed, 07 Nov 2012 07:21:59 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1352272918!21402661!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQ1NjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10464 invoked from network); 7 Nov 2012 07:21:59 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-11.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 07:21:59 -0000
X-IronPort-AV: E=Sophos;i="4.80,727,1344211200"; d="scan'208";a="213699955"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 07:21:57 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 7 Nov 2012 02:21:57 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TVzxU-0004ms-9N;
	Wed, 07 Nov 2012 07:21:57 +0000
Message-ID: <1352272794.12977.17.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Wed, 7 Nov 2012 08:19:54 +0100
In-Reply-To: <1352239982-17389-2-git-send-email-konrad.wilk@oracle.com>
References: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
	<1352239982-17389-2-git-send-email-konrad.wilk@oracle.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH 1/2] xen/generic: Disable fallback build on
 ARM.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-06 at 22:13 +0000, Konrad Rzeszutek Wilk wrote:
> As there is no need for it (the fallback code is for older
> hypervisors and they won't run under ARM), 

I think more specifically they won't run on anything other than x86.

[...]
> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> index 46de6cd..273d2b9 100644
> --- a/drivers/xen/Makefile
> +++ b/drivers/xen/Makefile
> @@ -1,8 +1,8 @@
>  ifneq ($(CONFIG_ARM),y)
> -obj-y	+= manage.o balloon.o
> +obj-y	+= manage.o balloon.o fallback.o
>  obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
>  endif

I think :
  obj-$(CONFIG_X86) += fallback.o
would better reflect what is going on here.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 07:22:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 07:22:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVzxa-0006uP-GV; Wed, 07 Nov 2012 07:22:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TVzxY-0006uK-EW
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 07:22:00 +0000
Received: from [85.158.143.99:59823] by server-2.bemta-4.messagelabs.com id
	15/E2-28922-71C0A905; Wed, 07 Nov 2012 07:21:59 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1352272918!21402661!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQ1NjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10464 invoked from network); 7 Nov 2012 07:21:59 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-11.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 07:21:59 -0000
X-IronPort-AV: E=Sophos;i="4.80,727,1344211200"; d="scan'208";a="213699955"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 07:21:57 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 7 Nov 2012 02:21:57 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TVzxU-0004ms-9N;
	Wed, 07 Nov 2012 07:21:57 +0000
Message-ID: <1352272794.12977.17.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Wed, 7 Nov 2012 08:19:54 +0100
In-Reply-To: <1352239982-17389-2-git-send-email-konrad.wilk@oracle.com>
References: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
	<1352239982-17389-2-git-send-email-konrad.wilk@oracle.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH 1/2] xen/generic: Disable fallback build on
 ARM.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-06 at 22:13 +0000, Konrad Rzeszutek Wilk wrote:
> As there is no need for it (the fallback code is for older
> hypervisors and they won't run under ARM), 

I think more specifically they won't run on anything other than x86.

[...]
> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> index 46de6cd..273d2b9 100644
> --- a/drivers/xen/Makefile
> +++ b/drivers/xen/Makefile
> @@ -1,8 +1,8 @@
>  ifneq ($(CONFIG_ARM),y)
> -obj-y	+= manage.o balloon.o
> +obj-y	+= manage.o balloon.o fallback.o
>  obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
>  endif

I think :
  obj-$(CONFIG_X86) += fallback.o
would better reflect what is going on here.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 07:24:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 07:24:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVzzJ-0006zP-50; Wed, 07 Nov 2012 07:23:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TVzzI-0006zE-8Y
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 07:23:48 +0000
Received: from [85.158.143.99:43792] by server-3.bemta-4.messagelabs.com id
	15/72-06841-38C0A905; Wed, 07 Nov 2012 07:23:47 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1352273025!17723407!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODE4NjM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8144 invoked from network); 7 Nov 2012 07:23:46 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 07:23:46 -0000
X-IronPort-AV: E=Sophos;i="4.80,727,1344211200"; d="scan'208";a="43746809"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 07:23:24 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 7 Nov 2012 02:23:24 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TVzyt-0004oR-J3;
	Wed, 07 Nov 2012 07:23:24 +0000
Message-ID: <1352272882.12977.19.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Wed, 7 Nov 2012 08:21:22 +0100
In-Reply-To: <1352239982-17389-3-git-send-email-konrad.wilk@oracle.com>
References: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
	<1352239982-17389-3-git-send-email-konrad.wilk@oracle.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH 2/2] xen/arm: Fix compile errors when
 drivers are compiled as modules.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CCing Russell since I believe this is the fix for the "BUG: ARM build
failures due to Xen" failure he reported yesterday,

On Tue, 2012-11-06 at 22:13 +0000, Konrad Rzeszutek Wilk wrote:
> We end up with:
> 
> ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
> ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> ERROR: "HYPERVISOR_grant_table_op" [drivers/net/xen-netback/xen-netback.ko] undefined!
> 
> and this patch exports said function (which is implemented in hypercall.S).
> 
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> ---
>  arch/arm/xen/enlighten.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> index 59bcb96..96d969d 100644
> --- a/arch/arm/xen/enlighten.c
> +++ b/arch/arm/xen/enlighten.c
> @@ -166,3 +166,8 @@ void free_xenballooned_pages(int nr_pages, struct page **pages)
>  	*pages = NULL;
>  }
>  EXPORT_SYMBOL_GPL(free_xenballooned_pages);
> +
> +/* In the hypervisor.S file. */
> +EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
> +EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
> +EXPORT_SYMBOL_GPL(privcmd_call);



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 07:24:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 07:24:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TVzzJ-0006zP-50; Wed, 07 Nov 2012 07:23:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TVzzI-0006zE-8Y
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 07:23:48 +0000
Received: from [85.158.143.99:43792] by server-3.bemta-4.messagelabs.com id
	15/72-06841-38C0A905; Wed, 07 Nov 2012 07:23:47 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1352273025!17723407!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODE4NjM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8144 invoked from network); 7 Nov 2012 07:23:46 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 07:23:46 -0000
X-IronPort-AV: E=Sophos;i="4.80,727,1344211200"; d="scan'208";a="43746809"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 07:23:24 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 7 Nov 2012 02:23:24 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TVzyt-0004oR-J3;
	Wed, 07 Nov 2012 07:23:24 +0000
Message-ID: <1352272882.12977.19.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Wed, 7 Nov 2012 08:21:22 +0100
In-Reply-To: <1352239982-17389-3-git-send-email-konrad.wilk@oracle.com>
References: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
	<1352239982-17389-3-git-send-email-konrad.wilk@oracle.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH 2/2] xen/arm: Fix compile errors when
 drivers are compiled as modules.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CCing Russell since I believe this is the fix for the "BUG: ARM build
failures due to Xen" failure he reported yesterday,

On Tue, 2012-11-06 at 22:13 +0000, Konrad Rzeszutek Wilk wrote:
> We end up with:
> 
> ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
> ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> ERROR: "HYPERVISOR_grant_table_op" [drivers/net/xen-netback/xen-netback.ko] undefined!
> 
> and this patch exports said function (which is implemented in hypercall.S).
> 
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> ---
>  arch/arm/xen/enlighten.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> index 59bcb96..96d969d 100644
> --- a/arch/arm/xen/enlighten.c
> +++ b/arch/arm/xen/enlighten.c
> @@ -166,3 +166,8 @@ void free_xenballooned_pages(int nr_pages, struct page **pages)
>  	*pages = NULL;
>  }
>  EXPORT_SYMBOL_GPL(free_xenballooned_pages);
> +
> +/* In the hypervisor.S file. */
> +EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
> +EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
> +EXPORT_SYMBOL_GPL(privcmd_call);



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 07:25:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 07:25:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW00D-00073R-Jb; Wed, 07 Nov 2012 07:24:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TW00C-00073G-48
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 07:24:44 +0000
Received: from [193.109.254.147:4343] by server-3.bemta-14.messagelabs.com id
	26/C5-01317-BBC0A905; Wed, 07 Nov 2012 07:24:43 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1352273070!9978960!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQ1NjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10978 invoked from network); 7 Nov 2012 07:24:33 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 07:24:33 -0000
X-IronPort-AV: E=Sophos;i="4.80,727,1344211200"; d="scan'208";a="213700076"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 07:24:30 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 7 Nov 2012 02:24:29 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TVzzx-0004pH-26;
	Wed, 07 Nov 2012 07:24:29 +0000
Message-ID: <1352272948.12977.20.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: "greg@enjellic.com" <greg@enjellic.com>
Date: Wed, 7 Nov 2012 08:22:28 +0100
In-Reply-To: <201211070206.qA7261Bp028589@wind.enjellic.com>
References: <201211070206.qA7261Bp028589@wind.enjellic.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] 4.1.2 blktap2 cleanup fixes.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-07 at 02:06 +0000, Dr. Greg Wettstein wrote:
> ---------------------------------------------------------------------------
> Backport of the following patch from development:
> 
> # User Ian Campbell <[hidden email]>
> # Date 1309968705 -3600
> # Node ID e4781aedf817c5ab36f6f3077e44c43c566a2812
> # Parent 700d0f03d50aa6619d313c1ff6aea7fd429d28a7
> libxl: attempt to cleanup tapdisk processes on disk backend destroy.
> 
> This patch properly terminates the tapdisk2 process(es) started
> to service a virtual block device.
> 
> Signed-off-by: Greg Wettstein <greg@enjellic.com>

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

> 
> diff -r 700d0f03d50a tools/blktap2/control/tap-ctl-list.c
> --- a/tools/blktap2/control/tap-ctl-list.c	Mon Oct 29 09:04:48 2012 +0100
> +++ b/tools/blktap2/control/tap-ctl-list.c	Tue Nov 06 19:52:48 2012 -0600
> @@ -506,17 +506,15 @@ out:
>  }
>  
>  int
> -tap_ctl_find_minor(const char *type, const char *path)
> +tap_ctl_find(const char *type, const char *path, tap_list_t *tap)
>  {
>  	tap_list_t **list, **_entry;
> -	int minor, err;
> +	int ret = -ENOENT, err;
>  
>  	err = tap_ctl_list(&list);
>  	if (err)
>  		return err;
>  
> -	minor = -1;
> -
>  	for (_entry = list; *_entry != NULL; ++_entry) {
>  		tap_list_t *entry  = *_entry;
>  
> @@ -526,11 +524,13 @@ tap_ctl_find_minor(const char *type, con
>  		if (path && (!entry->path || strcmp(entry->path, path)))
>  			continue;
>  
> -		minor = entry->minor;
> +		*tap = *entry;
> +		tap->type = tap->path = NULL;
> +		ret = 0;
>  		break;
>  	}
>  
>  	tap_ctl_free_list(list);
>  
> -	return minor >= 0 ? minor : -ENOENT;
> +	return ret;
>  }
> diff -r 700d0f03d50a tools/blktap2/control/tap-ctl.h
> --- a/tools/blktap2/control/tap-ctl.h	Mon Oct 29 09:04:48 2012 +0100
> +++ b/tools/blktap2/control/tap-ctl.h	Tue Nov 06 19:52:48 2012 -0600
> @@ -76,7 +76,7 @@ int tap_ctl_get_driver_id(const char *ha
>  
>  int tap_ctl_list(tap_list_t ***list);
>  void tap_ctl_free_list(tap_list_t **list);
> -int tap_ctl_find_minor(const char *type, const char *path);
> +int tap_ctl_find(const char *type, const char *path, tap_list_t *tap);
>  
>  int tap_ctl_allocate(int *minor, char **devname);
>  int tap_ctl_free(const int minor);
> diff -r 700d0f03d50a tools/libxl/libxl_blktap2.c
> --- a/tools/libxl/libxl_blktap2.c	Mon Oct 29 09:04:48 2012 +0100
> +++ b/tools/libxl/libxl_blktap2.c	Tue Nov 06 19:52:48 2012 -0600
> @@ -18,6 +18,8 @@
>  
>  #include "tap-ctl.h"
>  
> +#include <string.h>
> +
>  int libxl__blktap_enabled(libxl__gc *gc)
>  {
>      const char *msg;
> @@ -30,12 +32,13 @@ const char *libxl__blktap_devpath(libxl_
>  {
>      const char *type;
>      char *params, *devname = NULL;
> -    int minor, err;
> +    tap_list_t tap;
> +    int err;
>  
>      type = libxl__device_disk_string_of_format(format);
> -    minor = tap_ctl_find_minor(type, disk);
> -    if (minor >= 0) {
> -        devname = libxl__sprintf(gc, "/dev/xen/blktap-2/tapdev%d", minor);
> +    err = tap_ctl_find(type, disk, &tap);
> +    if (err == 0) {
> +        devname = libxl__sprintf(gc, "/dev/xen/blktap-2/tapdev%d", tap.minor);
>          if (devname)
>              return devname;
>      }
> @@ -49,3 +52,28 @@ const char *libxl__blktap_devpath(libxl_
>  
>      return NULL;
>  }
> +
> +
> +void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path)
> +{
> +    char *path, *params, *type, *disk;
> +    int err;
> +    tap_list_t tap;
> +
> +    path = libxl__sprintf(gc, "%s/tapdisk-params", be_path);
> +    if (!path) return;
> +
> +    params = libxl__xs_read(gc, XBT_NULL, path);
> +    if (!params) return;
> +
> +    type = params;
> +    disk = strchr(params, ':');
> +    if (!disk) return;
> +
> +    *disk++ = '\0';
> +
> +    err = tap_ctl_find(type, disk, &tap);
> +    if (err < 0) return;
> +
> +    tap_ctl_destroy(tap.id, tap.minor);
> +}
> diff -r 700d0f03d50a tools/libxl/libxl_device.c
> --- a/tools/libxl/libxl_device.c	Mon Oct 29 09:04:48 2012 +0100
> +++ b/tools/libxl/libxl_device.c	Tue Nov 06 19:52:48 2012 -0600
> @@ -250,6 +250,7 @@ int libxl__device_destroy(libxl_ctx *ctx
>      if (!state)
>          goto out;
>      if (atoi(state) != 4) {
> +        libxl__device_destroy_tapdisk(&gc, be_path);
>          xs_rm(ctx->xsh, XBT_NULL, be_path);
>          goto out;
>      }
> @@ -368,6 +369,7 @@ int libxl__devices_destroy(libxl_ctx *ct
>              }
>          }
>      }
> +    libxl__device_destroy_tapdisk(&gc, be_path);
>  out:
>      libxl__free_all(&gc);
>      return 0;
> diff -r 700d0f03d50a tools/libxl/libxl_internal.h
> --- a/tools/libxl/libxl_internal.h	Mon Oct 29 09:04:48 2012 +0100
> +++ b/tools/libxl/libxl_internal.h	Tue Nov 06 19:52:48 2012 -0600
> @@ -314,6 +314,12 @@ _hidden const char *libxl__blktap_devpat
>                                   const char *disk,
>                                   libxl_disk_format format);
>  
> +/* libxl__device_destroy_tapdisk:
> + *   Destroys any tapdisk process associated with the backend represented
> + *   by be_path.
> + */
> +_hidden void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path);
> +
>  _hidden char *libxl__uuid2string(libxl__gc *gc, const libxl_uuid uuid);
>  
>  struct libxl__xen_console_reader {
> diff -r 700d0f03d50a tools/libxl/libxl_noblktap2.c
> --- a/tools/libxl/libxl_noblktap2.c	Mon Oct 29 09:04:48 2012 +0100
> +++ b/tools/libxl/libxl_noblktap2.c	Tue Nov 06 19:52:48 2012 -0600
> @@ -27,3 +27,7 @@ const char *libxl__blktap_devpath(libxl_
>  {
>      return NULL;
>  }
> +
> +void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path)
> +{
> +}
> ---------------------------------------------------------------------------
> 
> As always,
> Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
> 4206 N. 19th Ave.           Specializing in information infra-structure
> Fargo, ND  58102            development.
> PH: 701-281-1686
> FAX: 701-281-3949           EMAIL: greg@enjellic.com
> ------------------------------------------------------------------------------
> "Man, despite his artistic pretensions, his sophistication and many
>  accomplishments, owes the fact of his existence to a six-inch layer of
>  topsoil and the fact that it rains."
>                                 -- Anonymous writer on perspective.
>                                    GAUSSIAN quote.
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 07:25:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 07:25:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW00D-00073R-Jb; Wed, 07 Nov 2012 07:24:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TW00C-00073G-48
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 07:24:44 +0000
Received: from [193.109.254.147:4343] by server-3.bemta-14.messagelabs.com id
	26/C5-01317-BBC0A905; Wed, 07 Nov 2012 07:24:43 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1352273070!9978960!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQ1NjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10978 invoked from network); 7 Nov 2012 07:24:33 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 07:24:33 -0000
X-IronPort-AV: E=Sophos;i="4.80,727,1344211200"; d="scan'208";a="213700076"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 07:24:30 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 7 Nov 2012 02:24:29 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TVzzx-0004pH-26;
	Wed, 07 Nov 2012 07:24:29 +0000
Message-ID: <1352272948.12977.20.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: "greg@enjellic.com" <greg@enjellic.com>
Date: Wed, 7 Nov 2012 08:22:28 +0100
In-Reply-To: <201211070206.qA7261Bp028589@wind.enjellic.com>
References: <201211070206.qA7261Bp028589@wind.enjellic.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] 4.1.2 blktap2 cleanup fixes.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-07 at 02:06 +0000, Dr. Greg Wettstein wrote:
> ---------------------------------------------------------------------------
> Backport of the following patch from development:
> 
> # User Ian Campbell <[hidden email]>
> # Date 1309968705 -3600
> # Node ID e4781aedf817c5ab36f6f3077e44c43c566a2812
> # Parent 700d0f03d50aa6619d313c1ff6aea7fd429d28a7
> libxl: attempt to cleanup tapdisk processes on disk backend destroy.
> 
> This patch properly terminates the tapdisk2 process(es) started
> to service a virtual block device.
> 
> Signed-off-by: Greg Wettstein <greg@enjellic.com>

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

> 
> diff -r 700d0f03d50a tools/blktap2/control/tap-ctl-list.c
> --- a/tools/blktap2/control/tap-ctl-list.c	Mon Oct 29 09:04:48 2012 +0100
> +++ b/tools/blktap2/control/tap-ctl-list.c	Tue Nov 06 19:52:48 2012 -0600
> @@ -506,17 +506,15 @@ out:
>  }
>  
>  int
> -tap_ctl_find_minor(const char *type, const char *path)
> +tap_ctl_find(const char *type, const char *path, tap_list_t *tap)
>  {
>  	tap_list_t **list, **_entry;
> -	int minor, err;
> +	int ret = -ENOENT, err;
>  
>  	err = tap_ctl_list(&list);
>  	if (err)
>  		return err;
>  
> -	minor = -1;
> -
>  	for (_entry = list; *_entry != NULL; ++_entry) {
>  		tap_list_t *entry  = *_entry;
>  
> @@ -526,11 +524,13 @@ tap_ctl_find_minor(const char *type, con
>  		if (path && (!entry->path || strcmp(entry->path, path)))
>  			continue;
>  
> -		minor = entry->minor;
> +		*tap = *entry;
> +		tap->type = tap->path = NULL;
> +		ret = 0;
>  		break;
>  	}
>  
>  	tap_ctl_free_list(list);
>  
> -	return minor >= 0 ? minor : -ENOENT;
> +	return ret;
>  }
> diff -r 700d0f03d50a tools/blktap2/control/tap-ctl.h
> --- a/tools/blktap2/control/tap-ctl.h	Mon Oct 29 09:04:48 2012 +0100
> +++ b/tools/blktap2/control/tap-ctl.h	Tue Nov 06 19:52:48 2012 -0600
> @@ -76,7 +76,7 @@ int tap_ctl_get_driver_id(const char *ha
>  
>  int tap_ctl_list(tap_list_t ***list);
>  void tap_ctl_free_list(tap_list_t **list);
> -int tap_ctl_find_minor(const char *type, const char *path);
> +int tap_ctl_find(const char *type, const char *path, tap_list_t *tap);
>  
>  int tap_ctl_allocate(int *minor, char **devname);
>  int tap_ctl_free(const int minor);
> diff -r 700d0f03d50a tools/libxl/libxl_blktap2.c
> --- a/tools/libxl/libxl_blktap2.c	Mon Oct 29 09:04:48 2012 +0100
> +++ b/tools/libxl/libxl_blktap2.c	Tue Nov 06 19:52:48 2012 -0600
> @@ -18,6 +18,8 @@
>  
>  #include "tap-ctl.h"
>  
> +#include <string.h>
> +
>  int libxl__blktap_enabled(libxl__gc *gc)
>  {
>      const char *msg;
> @@ -30,12 +32,13 @@ const char *libxl__blktap_devpath(libxl_
>  {
>      const char *type;
>      char *params, *devname = NULL;
> -    int minor, err;
> +    tap_list_t tap;
> +    int err;
>  
>      type = libxl__device_disk_string_of_format(format);
> -    minor = tap_ctl_find_minor(type, disk);
> -    if (minor >= 0) {
> -        devname = libxl__sprintf(gc, "/dev/xen/blktap-2/tapdev%d", minor);
> +    err = tap_ctl_find(type, disk, &tap);
> +    if (err == 0) {
> +        devname = libxl__sprintf(gc, "/dev/xen/blktap-2/tapdev%d", tap.minor);
>          if (devname)
>              return devname;
>      }
> @@ -49,3 +52,28 @@ const char *libxl__blktap_devpath(libxl_
>  
>      return NULL;
>  }
> +
> +
> +void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path)
> +{
> +    char *path, *params, *type, *disk;
> +    int err;
> +    tap_list_t tap;
> +
> +    path = libxl__sprintf(gc, "%s/tapdisk-params", be_path);
> +    if (!path) return;
> +
> +    params = libxl__xs_read(gc, XBT_NULL, path);
> +    if (!params) return;
> +
> +    type = params;
> +    disk = strchr(params, ':');
> +    if (!disk) return;
> +
> +    *disk++ = '\0';
> +
> +    err = tap_ctl_find(type, disk, &tap);
> +    if (err < 0) return;
> +
> +    tap_ctl_destroy(tap.id, tap.minor);
> +}
> diff -r 700d0f03d50a tools/libxl/libxl_device.c
> --- a/tools/libxl/libxl_device.c	Mon Oct 29 09:04:48 2012 +0100
> +++ b/tools/libxl/libxl_device.c	Tue Nov 06 19:52:48 2012 -0600
> @@ -250,6 +250,7 @@ int libxl__device_destroy(libxl_ctx *ctx
>      if (!state)
>          goto out;
>      if (atoi(state) != 4) {
> +        libxl__device_destroy_tapdisk(&gc, be_path);
>          xs_rm(ctx->xsh, XBT_NULL, be_path);
>          goto out;
>      }
> @@ -368,6 +369,7 @@ int libxl__devices_destroy(libxl_ctx *ct
>              }
>          }
>      }
> +    libxl__device_destroy_tapdisk(&gc, be_path);
>  out:
>      libxl__free_all(&gc);
>      return 0;
> diff -r 700d0f03d50a tools/libxl/libxl_internal.h
> --- a/tools/libxl/libxl_internal.h	Mon Oct 29 09:04:48 2012 +0100
> +++ b/tools/libxl/libxl_internal.h	Tue Nov 06 19:52:48 2012 -0600
> @@ -314,6 +314,12 @@ _hidden const char *libxl__blktap_devpat
>                                   const char *disk,
>                                   libxl_disk_format format);
>  
> +/* libxl__device_destroy_tapdisk:
> + *   Destroys any tapdisk process associated with the backend represented
> + *   by be_path.
> + */
> +_hidden void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path);
> +
>  _hidden char *libxl__uuid2string(libxl__gc *gc, const libxl_uuid uuid);
>  
>  struct libxl__xen_console_reader {
> diff -r 700d0f03d50a tools/libxl/libxl_noblktap2.c
> --- a/tools/libxl/libxl_noblktap2.c	Mon Oct 29 09:04:48 2012 +0100
> +++ b/tools/libxl/libxl_noblktap2.c	Tue Nov 06 19:52:48 2012 -0600
> @@ -27,3 +27,7 @@ const char *libxl__blktap_devpath(libxl_
>  {
>      return NULL;
>  }
> +
> +void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path)
> +{
> +}
> ---------------------------------------------------------------------------
> 
> As always,
> Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
> 4206 N. 19th Ave.           Specializing in information infra-structure
> Fargo, ND  58102            development.
> PH: 701-281-1686
> FAX: 701-281-3949           EMAIL: greg@enjellic.com
> ------------------------------------------------------------------------------
> "Man, despite his artistic pretensions, his sophistication and many
>  accomplishments, owes the fact of his existence to a six-inch layer of
>  topsoil and the fact that it rains."
>                                 -- Anonymous writer on perspective.
>                                    GAUSSIAN quote.
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 07:26:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 07:26:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW019-00078K-1a; Wed, 07 Nov 2012 07:25:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TW017-000783-B9
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 07:25:41 +0000
Received: from [85.158.138.51:22310] by server-12.bemta-3.messagelabs.com id
	73/6E-22757-4FC0A905; Wed, 07 Nov 2012 07:25:40 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1352273138!28963810!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODE4NjM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7709 invoked from network); 7 Nov 2012 07:25:39 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 07:25:39 -0000
X-IronPort-AV: E=Sophos;i="4.80,727,1344211200"; d="scan'208";a="43746962"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 07:25:38 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 7 Nov 2012 02:25:37 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TW013-0004px-Bt;
	Wed, 07 Nov 2012 07:25:37 +0000
Message-ID: <1352273016.12977.21.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: "greg@enjellic.com" <greg@enjellic.com>
Date: Wed, 7 Nov 2012 08:23:36 +0100
In-Reply-To: <201211070207.qA727wF1028601@wind.enjellic.com>
References: <201211070207.qA727wF1028601@wind.enjellic.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] 4.1.2 blktap2 cleanup fixes.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-07 at 02:07 +0000, Dr. Greg Wettstein wrote:
> ---------------------------------------------------------------------------
> The following patch when applied on top of:
> 
> libxl: attempt to cleanup tapdisk processes on disk backend destroy.
> 
> Establishes correct cleanup behavior for blktap devices.  This patch
> implements the release of the backend device before calling for
> the destruction of the userspace component of the blktap device.
> 
> Without this patch the kernel xen-blkback driver deadlocks with
> the blktap2 user control plane until the IPC channel is terminated by the
> timeout on the select() call.  This results in a noticeable delay
> in the termination of the guest and causes the blktap minor
> number which had been allocated to be orphaned.
> 
> Signed-off-by: Greg Wettstein <greg@enjellic.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> diff -r b184698e0893 tools/libxl/libxl_blktap2.c
> --- a/tools/libxl/libxl_blktap2.c	Tue Nov 06 19:53:48 2012 -0600
> +++ b/tools/libxl/libxl_blktap2.c	Tue Nov 06 19:54:23 2012 -0600
> @@ -59,6 +59,7 @@ void libxl__device_destroy_tapdisk(libxl
>      char *path, *params, *type, *disk;
>      int err;
>      tap_list_t tap;
> +    libxl_ctx *ctx = libxl__gc_owner(gc);
>  
>      path = libxl__sprintf(gc, "%s/tapdisk-params", be_path);
>      if (!path) return;
> @@ -75,5 +76,11 @@ void libxl__device_destroy_tapdisk(libxl
>      err = tap_ctl_find(type, disk, &tap);
>      if (err < 0) return;
>  
> +    /*
> +     * Remove the instance of the backend device to avoid a deadlock with the
> +     * removal of the tap device.
> +     */
> +    xs_rm(ctx->xsh, XBT_NULL, be_path);
> +
>      tap_ctl_destroy(tap.id, tap.minor);
>  }
> diff -r b184698e0893 tools/libxl/libxl_device.c
> --- a/tools/libxl/libxl_device.c	Tue Nov 06 19:53:48 2012 -0600
> +++ b/tools/libxl/libxl_device.c	Tue Nov 06 19:54:23 2012 -0600
> @@ -250,8 +250,7 @@ int libxl__device_destroy(libxl_ctx *ctx
>      if (!state)
>          goto out;
>      if (atoi(state) != 4) {
> -        libxl__device_destroy_tapdisk(&gc, be_path);
> -        xs_rm(ctx->xsh, XBT_NULL, be_path);
> +	libxl__device_destroy_tapdisk(&gc, be_path);
>          goto out;
>      }
>  
> ---------------------------------------------------------------------------
> 
> As always,
> Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
> 4206 N. 19th Ave.           Specializing in information infra-structure
> Fargo, ND  58102            development.
> PH: 701-281-1686
> FAX: 701-281-3949           EMAIL: greg@enjellic.com
> ------------------------------------------------------------------------------
> "Fungus doesn't take a vacation."
>                                 -- Rob Pike
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 07:26:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 07:26:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW019-00078K-1a; Wed, 07 Nov 2012 07:25:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TW017-000783-B9
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 07:25:41 +0000
Received: from [85.158.138.51:22310] by server-12.bemta-3.messagelabs.com id
	73/6E-22757-4FC0A905; Wed, 07 Nov 2012 07:25:40 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1352273138!28963810!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODE4NjM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7709 invoked from network); 7 Nov 2012 07:25:39 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 07:25:39 -0000
X-IronPort-AV: E=Sophos;i="4.80,727,1344211200"; d="scan'208";a="43746962"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 07:25:38 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 7 Nov 2012 02:25:37 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TW013-0004px-Bt;
	Wed, 07 Nov 2012 07:25:37 +0000
Message-ID: <1352273016.12977.21.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: "greg@enjellic.com" <greg@enjellic.com>
Date: Wed, 7 Nov 2012 08:23:36 +0100
In-Reply-To: <201211070207.qA727wF1028601@wind.enjellic.com>
References: <201211070207.qA727wF1028601@wind.enjellic.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] 4.1.2 blktap2 cleanup fixes.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-07 at 02:07 +0000, Dr. Greg Wettstein wrote:
> ---------------------------------------------------------------------------
> The following patch when applied on top of:
> 
> libxl: attempt to cleanup tapdisk processes on disk backend destroy.
> 
> Establishes correct cleanup behavior for blktap devices.  This patch
> implements the release of the backend device before calling for
> the destruction of the userspace component of the blktap device.
> 
> Without this patch the kernel xen-blkback driver deadlocks with
> the blktap2 user control plane until the IPC channel is terminated by the
> timeout on the select() call.  This results in a noticeable delay
> in the termination of the guest and causes the blktap minor
> number which had been allocated to be orphaned.
> 
> Signed-off-by: Greg Wettstein <greg@enjellic.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> diff -r b184698e0893 tools/libxl/libxl_blktap2.c
> --- a/tools/libxl/libxl_blktap2.c	Tue Nov 06 19:53:48 2012 -0600
> +++ b/tools/libxl/libxl_blktap2.c	Tue Nov 06 19:54:23 2012 -0600
> @@ -59,6 +59,7 @@ void libxl__device_destroy_tapdisk(libxl
>      char *path, *params, *type, *disk;
>      int err;
>      tap_list_t tap;
> +    libxl_ctx *ctx = libxl__gc_owner(gc);
>  
>      path = libxl__sprintf(gc, "%s/tapdisk-params", be_path);
>      if (!path) return;
> @@ -75,5 +76,11 @@ void libxl__device_destroy_tapdisk(libxl
>      err = tap_ctl_find(type, disk, &tap);
>      if (err < 0) return;
>  
> +    /*
> +     * Remove the instance of the backend device to avoid a deadlock with the
> +     * removal of the tap device.
> +     */
> +    xs_rm(ctx->xsh, XBT_NULL, be_path);
> +
>      tap_ctl_destroy(tap.id, tap.minor);
>  }
> diff -r b184698e0893 tools/libxl/libxl_device.c
> --- a/tools/libxl/libxl_device.c	Tue Nov 06 19:53:48 2012 -0600
> +++ b/tools/libxl/libxl_device.c	Tue Nov 06 19:54:23 2012 -0600
> @@ -250,8 +250,7 @@ int libxl__device_destroy(libxl_ctx *ctx
>      if (!state)
>          goto out;
>      if (atoi(state) != 4) {
> -        libxl__device_destroy_tapdisk(&gc, be_path);
> -        xs_rm(ctx->xsh, XBT_NULL, be_path);
> +	libxl__device_destroy_tapdisk(&gc, be_path);
>          goto out;
>      }
>  
> ---------------------------------------------------------------------------
> 
> As always,
> Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
> 4206 N. 19th Ave.           Specializing in information infra-structure
> Fargo, ND  58102            development.
> PH: 701-281-1686
> FAX: 701-281-3949           EMAIL: greg@enjellic.com
> ------------------------------------------------------------------------------
> "Fungus doesn't take a vacation."
>                                 -- Rob Pike
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 07:28:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 07:28:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW03S-0007Mt-JI; Wed, 07 Nov 2012 07:28:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TW03R-0007Mh-2N
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 07:28:05 +0000
Received: from [85.158.137.99:54362] by server-13.bemta-3.messagelabs.com id
	34/EF-24887-48D0A905; Wed, 07 Nov 2012 07:28:04 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352273282!17946767!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODE4NjM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29774 invoked from network); 7 Nov 2012 07:28:03 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 07:28:03 -0000
X-IronPort-AV: E=Sophos;i="4.80,727,1344211200"; d="scan'208";a="43747072"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 07:28:01 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 7 Nov 2012 02:28:01 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TW03M-0004s6-OF;
	Wed, 07 Nov 2012 07:28:01 +0000
Message-ID: <1352273160.12977.23.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: "Muneer A. Alshowkan" <vip2442@gmail.com>
Date: Wed, 7 Nov 2012 08:26:00 +0100
In-Reply-To: <CAPm+FyXz2sQ1phvR2TxkmUcWZq99B8pAn1BcqOLh1ESCZ7Jf2A@mail.gmail.com>
References: <CAPm+FyXz2sQ1phvR2TxkmUcWZq99B8pAn1BcqOLh1ESCZ7Jf2A@mail.gmail.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] What do I need to write and compile code for xen
 hypercalls ?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-07 at 03:42 +0000, Muneer A. Alshowkan wrote:

> I want to write a code that list any hypercall happen from Domain U. I
> have xen 4.1 installed on Ubuntu 12.04. What are the extra tools I
> need to write that code and compile it?

I'm afraid this questions is far to broad for anyone to be able to give
a useful answer. 

I'd recommend that you start by reading
http://wiki.xen.org/wiki/Asking_Xen_Devel_Questions and speaking to your
advisor.

Ian.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 07:28:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 07:28:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW03S-0007Mt-JI; Wed, 07 Nov 2012 07:28:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TW03R-0007Mh-2N
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 07:28:05 +0000
Received: from [85.158.137.99:54362] by server-13.bemta-3.messagelabs.com id
	34/EF-24887-48D0A905; Wed, 07 Nov 2012 07:28:04 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352273282!17946767!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODE4NjM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29774 invoked from network); 7 Nov 2012 07:28:03 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 07:28:03 -0000
X-IronPort-AV: E=Sophos;i="4.80,727,1344211200"; d="scan'208";a="43747072"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 07:28:01 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 7 Nov 2012 02:28:01 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TW03M-0004s6-OF;
	Wed, 07 Nov 2012 07:28:01 +0000
Message-ID: <1352273160.12977.23.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: "Muneer A. Alshowkan" <vip2442@gmail.com>
Date: Wed, 7 Nov 2012 08:26:00 +0100
In-Reply-To: <CAPm+FyXz2sQ1phvR2TxkmUcWZq99B8pAn1BcqOLh1ESCZ7Jf2A@mail.gmail.com>
References: <CAPm+FyXz2sQ1phvR2TxkmUcWZq99B8pAn1BcqOLh1ESCZ7Jf2A@mail.gmail.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] What do I need to write and compile code for xen
 hypercalls ?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-07 at 03:42 +0000, Muneer A. Alshowkan wrote:

> I want to write a code that list any hypercall happen from Domain U. I
> have xen 4.1 installed on Ubuntu 12.04. What are the extra tools I
> need to write that code and compile it?

I'm afraid this questions is far to broad for anyone to be able to give
a useful answer. 

I'd recommend that you start by reading
http://wiki.xen.org/wiki/Asking_Xen_Devel_Questions and speaking to your
advisor.

Ian.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 07:32:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 07:32:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW07X-0007ct-8w; Wed, 07 Nov 2012 07:32:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TW07W-0007ck-3L
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 07:32:18 +0000
Received: from [85.158.139.211:63130] by server-13.bemta-5.messagelabs.com id
	4A/AD-27809-18E0A905; Wed, 07 Nov 2012 07:32:17 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1352273535!19206643!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQ1NjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8377 invoked from network); 7 Nov 2012 07:32:16 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 07:32:16 -0000
X-IronPort-AV: E=Sophos;i="4.80,727,1344211200"; d="scan'208";a="213700382"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 07:32:15 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 7 Nov 2012 02:32:14 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TW07S-0004w3-6Z;
	Wed, 07 Nov 2012 07:32:14 +0000
Message-ID: <1352273413.12977.27.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Liu Jinsong <jinsong.liu@intel.com>
Date: Wed, 7 Nov 2012 08:30:13 +0100
In-Reply-To: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
References: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] Handle broken page with regard to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


> At the target
>   it would set p2m as p2m_ram_broken for broken page, so that if guest
>   access the broken page again, it would kill itself as expected.

Can you add a few words here about why this is preferable to just
ignoring the issue and populating a regular page non-broken page on the
target? I think I know why but it would be useful to be explicit in the
changelog.

I also spotted a typo:
> +                     * vMCE occur during migration
> +                     *
> +                     *   At sender, it marks broken page to dirty bitmap,
> +                     *   so that at copypages stage of migration, brokan

                                                                     broken

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 07:32:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 07:32:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW07X-0007ct-8w; Wed, 07 Nov 2012 07:32:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TW07W-0007ck-3L
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 07:32:18 +0000
Received: from [85.158.139.211:63130] by server-13.bemta-5.messagelabs.com id
	4A/AD-27809-18E0A905; Wed, 07 Nov 2012 07:32:17 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1352273535!19206643!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQ1NjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8377 invoked from network); 7 Nov 2012 07:32:16 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 07:32:16 -0000
X-IronPort-AV: E=Sophos;i="4.80,727,1344211200"; d="scan'208";a="213700382"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 07:32:15 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 7 Nov 2012 02:32:14 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TW07S-0004w3-6Z;
	Wed, 07 Nov 2012 07:32:14 +0000
Message-ID: <1352273413.12977.27.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Liu Jinsong <jinsong.liu@intel.com>
Date: Wed, 7 Nov 2012 08:30:13 +0100
In-Reply-To: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
References: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] Handle broken page with regard to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


> At the target
>   it would set p2m as p2m_ram_broken for broken page, so that if guest
>   access the broken page again, it would kill itself as expected.

Can you add a few words here about why this is preferable to just
ignoring the issue and populating a regular page non-broken page on the
target? I think I know why but it would be useful to be explicit in the
changelog.

I also spotted a typo:
> +                     * vMCE occur during migration
> +                     *
> +                     *   At sender, it marks broken page to dirty bitmap,
> +                     *   so that at copypages stage of migration, brokan

                                                                     broken

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 08:26:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 08:26:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW0xQ-0008Ky-9D; Wed, 07 Nov 2012 08:25:56 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TW0xO-0008Kt-Ir
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 08:25:54 +0000
Received: from [85.158.137.99:28048] by server-14.bemta-3.messagelabs.com id
	96/FE-12788-11B1A905; Wed, 07 Nov 2012 08:25:53 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1352276753!13264489!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQyMjg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21183 invoked from network); 7 Nov 2012 08:25:53 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-217.messagelabs.com with SMTP;
	7 Nov 2012 08:25:53 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 07 Nov 2012 08:25:56 +0000
Message-Id: <509A291F02000078000A6E9A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 07 Nov 2012 08:25:51 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<5092DE7E020000780008EB96@nat28.tlf.novell.com>
	<75058642-ad3b-4df9-a24a-7dbdc5f6e8c5@default>
	<5093954902000078000A5F45@nat28.tlf.novell.com>
	<00c25fab-a110-4f4b-a596-6cdfeb5b0d26@default>
	<5098E9FC02000078000A69A7@nat28.tlf.novell.com>
	<dca4f543-0031-4b2c-ba38-9d4876306881@default>
In-Reply-To: <dca4f543-0031-4b2c-ba38-9d4876306881@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 06.11.12 at 21:40, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  From: Jan Beulich [mailto:JBeulich@suse.com]
>> Sent: Tuesday, November 06, 2012 2:44 AM
>> To: Dan Magenheimer
>> Cc: xen-devel@lists.xen.org; keir@xen.org 
>> Subject: RE: 32bit xen and "claim"
>> 
>> >>> On 05.11.12 at 20:16, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>> > Does it make sense to have a runtime option that unsets the
>> > physical limit but disallows legacy PV guests?  If this
>> > defaults to false for machines with RAM<=5TB but to true
>> > for machines with RAM>5TB, then the feature is "done"
>> > (AND we have put a stake in the ground to begin the
>> > slow obsolescence of PV functionality).
>> 
>> That would be interesting: Mukesh's PVH code wasn't even
>> posted yet, i.e. you're proposing to render systems with more
>> than 5Tb unbootable (for the lack of a - necessarily PV - Dom0
>> kernel runnable in that environment).
> 
> Good point.  BUT... couldn't a PV dom0 started with dom0_mem=X
> (where X is smaller than 5GB) still work?

No - Xen would still need to be able to access all memory when in
the context of such a Dom0 (even address restricting that Dom0
just like we do for 32-bit PV guests wouldn't help, as e.g. granted
pages from DomU-s may need accessing in Xen in the context of
Dom0).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 08:26:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 08:26:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW0xQ-0008Ky-9D; Wed, 07 Nov 2012 08:25:56 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TW0xO-0008Kt-Ir
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 08:25:54 +0000
Received: from [85.158.137.99:28048] by server-14.bemta-3.messagelabs.com id
	96/FE-12788-11B1A905; Wed, 07 Nov 2012 08:25:53 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1352276753!13264489!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQyMjg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21183 invoked from network); 7 Nov 2012 08:25:53 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-217.messagelabs.com with SMTP;
	7 Nov 2012 08:25:53 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 07 Nov 2012 08:25:56 +0000
Message-Id: <509A291F02000078000A6E9A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 07 Nov 2012 08:25:51 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <620abc58-07b9-4102-b883-0bfcd8e78471@default>
	<5092DE7E020000780008EB96@nat28.tlf.novell.com>
	<75058642-ad3b-4df9-a24a-7dbdc5f6e8c5@default>
	<5093954902000078000A5F45@nat28.tlf.novell.com>
	<00c25fab-a110-4f4b-a596-6cdfeb5b0d26@default>
	<5098E9FC02000078000A69A7@nat28.tlf.novell.com>
	<dca4f543-0031-4b2c-ba38-9d4876306881@default>
In-Reply-To: <dca4f543-0031-4b2c-ba38-9d4876306881@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] 32bit xen and "claim"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 06.11.12 at 21:40, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  From: Jan Beulich [mailto:JBeulich@suse.com]
>> Sent: Tuesday, November 06, 2012 2:44 AM
>> To: Dan Magenheimer
>> Cc: xen-devel@lists.xen.org; keir@xen.org 
>> Subject: RE: 32bit xen and "claim"
>> 
>> >>> On 05.11.12 at 20:16, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>> > Does it make sense to have a runtime option that unsets the
>> > physical limit but disallows legacy PV guests?  If this
>> > defaults to false for machines with RAM<=5TB but to true
>> > for machines with RAM>5TB, then the feature is "done"
>> > (AND we have put a stake in the ground to begin the
>> > slow obsolescence of PV functionality).
>> 
>> That would be interesting: Mukesh's PVH code wasn't even
>> posted yet, i.e. you're proposing to render systems with more
>> than 5Tb unbootable (for the lack of a - necessarily PV - Dom0
>> kernel runnable in that environment).
> 
> Good point.  BUT... couldn't a PV dom0 started with dom0_mem=X
> (where X is smaller than 5GB) still work?

No - Xen would still need to be able to access all memory when in
the context of such a Dom0 (even address restricting that Dom0
just like we do for 32-bit PV guests wouldn't help, as e.g. granted
pages from DomU-s may need accessing in Xen in the context of
Dom0).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 08:39:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 08:39:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW19s-0008Ua-Mr; Wed, 07 Nov 2012 08:38:48 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TW19r-0008UV-W7
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 08:38:48 +0000
Received: from [85.158.139.83:45839] by server-1.bemta-5.messagelabs.com id
	D6/B8-05877-71E1A905; Wed, 07 Nov 2012 08:38:47 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1352277526!26420888!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQyMjg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22121 invoked from network); 7 Nov 2012 08:38:46 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-182.messagelabs.com with SMTP;
	7 Nov 2012 08:38:46 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 07 Nov 2012 08:38:51 +0000
Message-Id: <509A2C2402000078000A6EB9@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 07 Nov 2012 08:38:44 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <ian.campbell@citrix.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
References: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
	<1352239982-17389-2-git-send-email-konrad.wilk@oracle.com>
	<1352272794.12977.17.camel@hastur.hellion.org.uk>
In-Reply-To: <1352272794.12977.17.camel@hastur.hellion.org.uk>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH 1/2] xen/generic: Disable fallback build on
 ARM.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 07.11.12 at 08:19, Ian Campbell <ian.campbell@citrix.com> wrote:
> On Tue, 2012-11-06 at 22:13 +0000, Konrad Rzeszutek Wilk wrote:
>> As there is no need for it (the fallback code is for older
>> hypervisors and they won't run under ARM), 
> 
> I think more specifically they won't run on anything other than x86.
> 
> [...]
>> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
>> index 46de6cd..273d2b9 100644
>> --- a/drivers/xen/Makefile
>> +++ b/drivers/xen/Makefile
>> @@ -1,8 +1,8 @@
>>  ifneq ($(CONFIG_ARM),y)
>> -obj-y	+= manage.o balloon.o
>> +obj-y	+= manage.o balloon.o fallback.o
>>  obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
>>  endif
> 
> I think :
>   obj-$(CONFIG_X86) += fallback.o
> would better reflect what is going on here.

Yes please.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 08:39:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 08:39:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW19s-0008Ua-Mr; Wed, 07 Nov 2012 08:38:48 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TW19r-0008UV-W7
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 08:38:48 +0000
Received: from [85.158.139.83:45839] by server-1.bemta-5.messagelabs.com id
	D6/B8-05877-71E1A905; Wed, 07 Nov 2012 08:38:47 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1352277526!26420888!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQyMjg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22121 invoked from network); 7 Nov 2012 08:38:46 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-182.messagelabs.com with SMTP;
	7 Nov 2012 08:38:46 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 07 Nov 2012 08:38:51 +0000
Message-Id: <509A2C2402000078000A6EB9@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 07 Nov 2012 08:38:44 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <ian.campbell@citrix.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
References: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
	<1352239982-17389-2-git-send-email-konrad.wilk@oracle.com>
	<1352272794.12977.17.camel@hastur.hellion.org.uk>
In-Reply-To: <1352272794.12977.17.camel@hastur.hellion.org.uk>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH 1/2] xen/generic: Disable fallback build on
 ARM.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 07.11.12 at 08:19, Ian Campbell <ian.campbell@citrix.com> wrote:
> On Tue, 2012-11-06 at 22:13 +0000, Konrad Rzeszutek Wilk wrote:
>> As there is no need for it (the fallback code is for older
>> hypervisors and they won't run under ARM), 
> 
> I think more specifically they won't run on anything other than x86.
> 
> [...]
>> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
>> index 46de6cd..273d2b9 100644
>> --- a/drivers/xen/Makefile
>> +++ b/drivers/xen/Makefile
>> @@ -1,8 +1,8 @@
>>  ifneq ($(CONFIG_ARM),y)
>> -obj-y	+= manage.o balloon.o
>> +obj-y	+= manage.o balloon.o fallback.o
>>  obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
>>  endif
> 
> I think :
>   obj-$(CONFIG_X86) += fallback.o
> would better reflect what is going on here.

Yes please.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 08:45:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 08:45:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW1G1-0000E1-An; Wed, 07 Nov 2012 08:45:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TW1G0-0000Dw-Fg
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 08:45:08 +0000
Received: from [85.158.139.211:48266] by server-7.bemta-5.messagelabs.com id
	CF/12-23096-39F1A905; Wed, 07 Nov 2012 08:45:07 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-3.tower-206.messagelabs.com!1352277906!19192350!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDI4MTA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23887 invoked from network); 7 Nov 2012 08:45:07 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-3.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 7 Nov 2012 08:45:07 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id C31482622;
	Wed,  7 Nov 2012 10:45:05 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 7097D2005D; Wed,  7 Nov 2012 10:45:05 +0200 (EET)
Date: Wed, 7 Nov 2012 10:45:05 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: greg@enjellic.com
Message-ID: <20121107084505.GH8912@reaktio.net>
References: <pasik@iki.fi>
 <201211070217.qA72HoqS028647@wind.enjellic.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <201211070217.qA72HoqS028647@wind.enjellic.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] XEN 4.1.3 blktap2 patches.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 06, 2012 at 08:17:50PM -0600, Dr. Greg Wettstein wrote:
> On Nov 5,  2:26pm, Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= wrote:
> } Subject: Re: [Xen-devel] XEN 4.1.3 blktap2 patches.
> 
> Hi Pasi, hope this note finds your week going well.
> 
> > Dr. Greg: RC1 for Xen 4.1.4 is being prepared atm, so hopefully you
> > can re-submit these blktap2 bugfix patches for inclusion!
> 
> Yes, my apologies for being more then a bit tardy on this.  I have
> been consumed with getting 4.2 validated in our development
> environment.
> 
> I just sent a pair of patches to the list which I refreshed against
> the top of the xen-4.1.testing Mercurial repository which contain the
> blktap2 patches.  With both applied 4.1.x shows correct behavior with
> respect to blktap2 cleanup and termination.
>

Great, thanks a lot! I'm sure the maintainers will comment on the new patches. 

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 08:45:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 08:45:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW1G1-0000E1-An; Wed, 07 Nov 2012 08:45:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TW1G0-0000Dw-Fg
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 08:45:08 +0000
Received: from [85.158.139.211:48266] by server-7.bemta-5.messagelabs.com id
	CF/12-23096-39F1A905; Wed, 07 Nov 2012 08:45:07 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-3.tower-206.messagelabs.com!1352277906!19192350!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDI4MTA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23887 invoked from network); 7 Nov 2012 08:45:07 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-3.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 7 Nov 2012 08:45:07 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id C31482622;
	Wed,  7 Nov 2012 10:45:05 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 7097D2005D; Wed,  7 Nov 2012 10:45:05 +0200 (EET)
Date: Wed, 7 Nov 2012 10:45:05 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: greg@enjellic.com
Message-ID: <20121107084505.GH8912@reaktio.net>
References: <pasik@iki.fi>
 <201211070217.qA72HoqS028647@wind.enjellic.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <201211070217.qA72HoqS028647@wind.enjellic.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] XEN 4.1.3 blktap2 patches.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 06, 2012 at 08:17:50PM -0600, Dr. Greg Wettstein wrote:
> On Nov 5,  2:26pm, Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= wrote:
> } Subject: Re: [Xen-devel] XEN 4.1.3 blktap2 patches.
> 
> Hi Pasi, hope this note finds your week going well.
> 
> > Dr. Greg: RC1 for Xen 4.1.4 is being prepared atm, so hopefully you
> > can re-submit these blktap2 bugfix patches for inclusion!
> 
> Yes, my apologies for being more then a bit tardy on this.  I have
> been consumed with getting 4.2 validated in our development
> environment.
> 
> I just sent a pair of patches to the list which I refreshed against
> the top of the xen-4.1.testing Mercurial repository which contain the
> blktap2 patches.  With both applied 4.1.x shows correct behavior with
> respect to blktap2 cleanup and termination.
>

Great, thanks a lot! I'm sure the maintainers will comment on the new patches. 

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 09:44:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 09:44:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW2B7-0000XH-8r; Wed, 07 Nov 2012 09:44:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <qiumojiong@gmail.com>) id 1TW0bW-0008Hw-NF
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 08:03:18 +0000
Received: from [85.158.138.51:36222] by server-8.bemta-3.messagelabs.com id
	BA/E7-07786-5C51A905; Wed, 07 Nov 2012 08:03:17 +0000
X-Env-Sender: qiumojiong@gmail.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1352275395!20124933!1
X-Originating-IP: [209.85.210.171]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14484 invoked from network); 7 Nov 2012 08:03:17 -0000
Received: from mail-ia0-f171.google.com (HELO mail-ia0-f171.google.com)
	(209.85.210.171)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 08:03:17 -0000
Received: by mail-ia0-f171.google.com with SMTP id u21so1178952ial.30
	for <xen-devel@lists.xensource.com>;
	Wed, 07 Nov 2012 00:03:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=igg1Bhvdtj4dLP0f9ouXaNPdtsSQNpyl/JlMSmMqKpM=;
	b=YtDB0FIch70Rydtq9iD5YUccR5Iv/y/fiqBYxq0rbLE9dd73b4p549FbWfXnLv2jd3
	/+WvGlpE1j54Bog3Vl9LLR0kpnbgy5YuyDcmcZAehHTlY1p+DpsSYXRFL2dwCA2/gsfq
	HlsgN4YsQkEyXSqKjuxbQG9Rc6/lE5wIn3koUdb3KCuQ+2gRlK1I78fcFoWbVLtENd5m
	KsFPyi9q6kMO1lGf+lvGNQwZO9r44NTB9QZkvnu4l9oqeVCmXt39LIeb+mnKuVLN1hRd
	T9qG1hKPhJzOJqSKfSuNSVYOwPQIQ7vx7AeZI8f22UYt4GUOeO2oCvcprJacMoFc60sD
	O1TA==
MIME-Version: 1.0
Received: by 10.50.46.129 with SMTP id v1mr1238298igm.42.1352275395261; Wed,
	07 Nov 2012 00:03:15 -0800 (PST)
Received: by 10.231.165.202 with HTTP; Wed, 7 Nov 2012 00:03:15 -0800 (PST)
In-Reply-To: <20121106161742.GJ9966@phenom.dumpdata.com>
References: <1352189295-7111-1-git-send-email-qiumojiong@gmail.com>
	<20121106161742.GJ9966@phenom.dumpdata.com>
Date: Wed, 7 Nov 2012 16:03:15 +0800
Message-ID: <CA+jHL8DfzCpw7mXwrhO6W9KJEj9TVXgRi2NnmQbPMcbBFKzpeA@mail.gmail.com>
From: =?UTF-8?B?6YKx5qih54Kv?= <qiumojiong@gmail.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
X-Mailman-Approved-At: Wed, 07 Nov 2012 09:44:08 +0000
Cc: Jeremy Fitzhardinge <jeremy@goop.org>, xen-devel@lists.xensource.com,
	Mojiong Qiu <mjqiu@tencent.com>, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	"at least to 3.0.y" <stable@kernel.org>
Subject: Re: [Xen-devel] [PATCH] xen/events: xen/events: fix RCU warning
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Thanks Konrad.  You are right, commit 98ad1cc14 missed the xen case.
And before merging, please modify the title a bit. one redundant
"xen/events" there.
"xen/events: xen/events: fix RCU warning"  -> "xen/events: fix RCU warning"

>> Cc: stable@kernel.org (at least to 3.0.y)
>              ^^^- vger.kernel.org
>
> You mean 3.3.x

This is my mistake. 3.0.y is OK. please ignore it.


On Wed, Nov 7, 2012 at 12:17 AM, Konrad Rzeszutek Wilk
<konrad.wilk@oracle.com> wrote:
> On Tue, Nov 06, 2012 at 04:08:15PM +0800, Mojiong Qiu wrote:
>> exit_idle() should be called after irq_enter(), otherwise it throws:
>
> That seems odd - wouldn't "smp_x86_platform_ipi"
> also need the same treatment [edit: I was looking at 3.0 kernel code] ?
>
> Ah, this is caused by
>
> commit 98ad1cc14a5c4fd658f9d72c6ba5c86dfd3ce0d5
> Author: Frederic Weisbecker <fweisbec@gmail.com>
> Date:   Fri Oct 7 18:22:09 2011 +0200
>
>     x86: Call idle notifier after irq_enter()
>
>
> and it missed the xen-case
>
> which means that any kernel v3.3 and newer need this, but earlier do
> not.
>
> Thx. Will put in 3.7 tree.
>
>>
>> [    2.513020] [ INFO: suspicious RCU usage. ]
>> [    2.513076] 3.6.5 #1 Not tainted
>> [    2.513128] -------------------------------
>> [    2.513183] include/linux/rcupdate.h:725 rcu_read_lock() used illegally while idle!
>> [    2.513271]
>> [    2.513271] other info that might help us debug this:
>> [    2.513271]
>> [    2.513388]
>> [    2.513388] RCU used illegally from idle CPU!
>> [    2.513388] rcu_scheduler_active = 1, debug_locks = 1
>> [    2.513511] RCU used illegally from extended quiescent state!
>> [    2.513572] 1 lock held by swapper/0/0:
>> [    2.513626]  #0:  (rcu_read_lock){......}, at: [<ffffffff810e9fe0>] __atomic_notifier_call_chain+0x0/0x140
>> [    2.513815]
>> [    2.513815] stack backtrace:
>> [    2.513897] Pid: 0, comm: swapper/0 Not tainted 3.6.5 #1
>> [    2.513954] Call Trace:
>> [    2.514005]  <IRQ>  [<ffffffff811259a2>] lockdep_rcu_suspicious+0xe2/0x130
>> [    2.514107]  [<ffffffff810ea10c>] __atomic_notifier_call_chain+0x12c/0x140
>> [    2.514169]  [<ffffffff810e9fe0>] ? atomic_notifier_chain_unregister+0x90/0x90
>> [    2.514258]  [<ffffffff811216cd>] ? trace_hardirqs_off+0xd/0x10
>> [    2.514318]  [<ffffffff810ea136>] atomic_notifier_call_chain+0x16/0x20
>> [    2.514381]  [<ffffffff810777c3>] exit_idle+0x43/0x50
>> [    2.514441]  [<ffffffff81568865>] xen_evtchn_do_upcall+0x25/0x50
>> [    2.514503]  [<ffffffff81aa690e>] xen_do_hypervisor_callback+0x1e/0x30
>> [    2.514562]  <EOI>  [<ffffffff810013aa>] ? hypercall_page+0x3aa/0x1000
>> [    2.514662]  [<ffffffff810013aa>] ? hypercall_page+0x3aa/0x1000
>> [    2.514722]  [<ffffffff81061540>] ? xen_safe_halt+0x10/0x20
>> [    2.514782]  [<ffffffff81075cfa>] ? default_idle+0xba/0x570
>> [    2.514841]  [<ffffffff810778af>] ? cpu_idle+0xdf/0x140
>> [    2.514900]  [<ffffffff81a4d881>] ? rest_init+0x135/0x144
>> [    2.514960]  [<ffffffff81a4d74c>] ? csum_partial_copy_generic+0x16c/0x16c
>> [    2.515022]  [<ffffffff82520c45>] ? start_kernel+0x3db/0x3e8
>> [    2.515081]  [<ffffffff8252066a>] ? repair_env_string+0x5a/0x5a
>> [    2.515141]  [<ffffffff82520356>] ? x86_64_start_reservations+0x131/0x135
>> [    2.515202]  [<ffffffff82524aca>] ? xen_start_kernel+0x465/0x46
>>
>> Signed-off-by: Mojiong Qiu <mjqiu@tencent.com>
>> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
>> Cc: xen-devel@lists.xensource.com
>> Cc: virtualization@lists.linux-foundation.org
>> Cc: linux-kernel@vger.kernel.org
>> Cc: stable@kernel.org (at least to 3.0.y)
>              ^^^- vger.kernel.org
>
> You mean 3.3.x
>
>> ---
>>  drivers/xen/events.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
>> index 912ac81..0be4df3 100644
>> --- a/drivers/xen/events.c
>> +++ b/drivers/xen/events.c
>> @@ -1395,10 +1395,10 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
>>  {
>>       struct pt_regs *old_regs = set_irq_regs(regs);
>>
>> +     irq_enter();
>>  #ifdef CONFIG_X86
>>       exit_idle();
>>  #endif
>> -     irq_enter();
>>
>>       __xen_evtchn_do_upcall();
>>
>> --
>> 1.6.3.2

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 09:44:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 09:44:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW2B7-0000XH-8r; Wed, 07 Nov 2012 09:44:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <qiumojiong@gmail.com>) id 1TW0bW-0008Hw-NF
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 08:03:18 +0000
Received: from [85.158.138.51:36222] by server-8.bemta-3.messagelabs.com id
	BA/E7-07786-5C51A905; Wed, 07 Nov 2012 08:03:17 +0000
X-Env-Sender: qiumojiong@gmail.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1352275395!20124933!1
X-Originating-IP: [209.85.210.171]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14484 invoked from network); 7 Nov 2012 08:03:17 -0000
Received: from mail-ia0-f171.google.com (HELO mail-ia0-f171.google.com)
	(209.85.210.171)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 08:03:17 -0000
Received: by mail-ia0-f171.google.com with SMTP id u21so1178952ial.30
	for <xen-devel@lists.xensource.com>;
	Wed, 07 Nov 2012 00:03:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=igg1Bhvdtj4dLP0f9ouXaNPdtsSQNpyl/JlMSmMqKpM=;
	b=YtDB0FIch70Rydtq9iD5YUccR5Iv/y/fiqBYxq0rbLE9dd73b4p549FbWfXnLv2jd3
	/+WvGlpE1j54Bog3Vl9LLR0kpnbgy5YuyDcmcZAehHTlY1p+DpsSYXRFL2dwCA2/gsfq
	HlsgN4YsQkEyXSqKjuxbQG9Rc6/lE5wIn3koUdb3KCuQ+2gRlK1I78fcFoWbVLtENd5m
	KsFPyi9q6kMO1lGf+lvGNQwZO9r44NTB9QZkvnu4l9oqeVCmXt39LIeb+mnKuVLN1hRd
	T9qG1hKPhJzOJqSKfSuNSVYOwPQIQ7vx7AeZI8f22UYt4GUOeO2oCvcprJacMoFc60sD
	O1TA==
MIME-Version: 1.0
Received: by 10.50.46.129 with SMTP id v1mr1238298igm.42.1352275395261; Wed,
	07 Nov 2012 00:03:15 -0800 (PST)
Received: by 10.231.165.202 with HTTP; Wed, 7 Nov 2012 00:03:15 -0800 (PST)
In-Reply-To: <20121106161742.GJ9966@phenom.dumpdata.com>
References: <1352189295-7111-1-git-send-email-qiumojiong@gmail.com>
	<20121106161742.GJ9966@phenom.dumpdata.com>
Date: Wed, 7 Nov 2012 16:03:15 +0800
Message-ID: <CA+jHL8DfzCpw7mXwrhO6W9KJEj9TVXgRi2NnmQbPMcbBFKzpeA@mail.gmail.com>
From: =?UTF-8?B?6YKx5qih54Kv?= <qiumojiong@gmail.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
X-Mailman-Approved-At: Wed, 07 Nov 2012 09:44:08 +0000
Cc: Jeremy Fitzhardinge <jeremy@goop.org>, xen-devel@lists.xensource.com,
	Mojiong Qiu <mjqiu@tencent.com>, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	"at least to 3.0.y" <stable@kernel.org>
Subject: Re: [Xen-devel] [PATCH] xen/events: xen/events: fix RCU warning
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Thanks Konrad.  You are right, commit 98ad1cc14 missed the xen case.
And before merging, please modify the title a bit. one redundant
"xen/events" there.
"xen/events: xen/events: fix RCU warning"  -> "xen/events: fix RCU warning"

>> Cc: stable@kernel.org (at least to 3.0.y)
>              ^^^- vger.kernel.org
>
> You mean 3.3.x

This is my mistake. 3.0.y is OK. please ignore it.


On Wed, Nov 7, 2012 at 12:17 AM, Konrad Rzeszutek Wilk
<konrad.wilk@oracle.com> wrote:
> On Tue, Nov 06, 2012 at 04:08:15PM +0800, Mojiong Qiu wrote:
>> exit_idle() should be called after irq_enter(), otherwise it throws:
>
> That seems odd - wouldn't "smp_x86_platform_ipi"
> also need the same treatment [edit: I was looking at 3.0 kernel code] ?
>
> Ah, this is caused by
>
> commit 98ad1cc14a5c4fd658f9d72c6ba5c86dfd3ce0d5
> Author: Frederic Weisbecker <fweisbec@gmail.com>
> Date:   Fri Oct 7 18:22:09 2011 +0200
>
>     x86: Call idle notifier after irq_enter()
>
>
> and it missed the xen-case
>
> which means that any kernel v3.3 and newer need this, but earlier do
> not.
>
> Thx. Will put in 3.7 tree.
>
>>
>> [    2.513020] [ INFO: suspicious RCU usage. ]
>> [    2.513076] 3.6.5 #1 Not tainted
>> [    2.513128] -------------------------------
>> [    2.513183] include/linux/rcupdate.h:725 rcu_read_lock() used illegally while idle!
>> [    2.513271]
>> [    2.513271] other info that might help us debug this:
>> [    2.513271]
>> [    2.513388]
>> [    2.513388] RCU used illegally from idle CPU!
>> [    2.513388] rcu_scheduler_active = 1, debug_locks = 1
>> [    2.513511] RCU used illegally from extended quiescent state!
>> [    2.513572] 1 lock held by swapper/0/0:
>> [    2.513626]  #0:  (rcu_read_lock){......}, at: [<ffffffff810e9fe0>] __atomic_notifier_call_chain+0x0/0x140
>> [    2.513815]
>> [    2.513815] stack backtrace:
>> [    2.513897] Pid: 0, comm: swapper/0 Not tainted 3.6.5 #1
>> [    2.513954] Call Trace:
>> [    2.514005]  <IRQ>  [<ffffffff811259a2>] lockdep_rcu_suspicious+0xe2/0x130
>> [    2.514107]  [<ffffffff810ea10c>] __atomic_notifier_call_chain+0x12c/0x140
>> [    2.514169]  [<ffffffff810e9fe0>] ? atomic_notifier_chain_unregister+0x90/0x90
>> [    2.514258]  [<ffffffff811216cd>] ? trace_hardirqs_off+0xd/0x10
>> [    2.514318]  [<ffffffff810ea136>] atomic_notifier_call_chain+0x16/0x20
>> [    2.514381]  [<ffffffff810777c3>] exit_idle+0x43/0x50
>> [    2.514441]  [<ffffffff81568865>] xen_evtchn_do_upcall+0x25/0x50
>> [    2.514503]  [<ffffffff81aa690e>] xen_do_hypervisor_callback+0x1e/0x30
>> [    2.514562]  <EOI>  [<ffffffff810013aa>] ? hypercall_page+0x3aa/0x1000
>> [    2.514662]  [<ffffffff810013aa>] ? hypercall_page+0x3aa/0x1000
>> [    2.514722]  [<ffffffff81061540>] ? xen_safe_halt+0x10/0x20
>> [    2.514782]  [<ffffffff81075cfa>] ? default_idle+0xba/0x570
>> [    2.514841]  [<ffffffff810778af>] ? cpu_idle+0xdf/0x140
>> [    2.514900]  [<ffffffff81a4d881>] ? rest_init+0x135/0x144
>> [    2.514960]  [<ffffffff81a4d74c>] ? csum_partial_copy_generic+0x16c/0x16c
>> [    2.515022]  [<ffffffff82520c45>] ? start_kernel+0x3db/0x3e8
>> [    2.515081]  [<ffffffff8252066a>] ? repair_env_string+0x5a/0x5a
>> [    2.515141]  [<ffffffff82520356>] ? x86_64_start_reservations+0x131/0x135
>> [    2.515202]  [<ffffffff82524aca>] ? xen_start_kernel+0x465/0x46
>>
>> Signed-off-by: Mojiong Qiu <mjqiu@tencent.com>
>> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
>> Cc: xen-devel@lists.xensource.com
>> Cc: virtualization@lists.linux-foundation.org
>> Cc: linux-kernel@vger.kernel.org
>> Cc: stable@kernel.org (at least to 3.0.y)
>              ^^^- vger.kernel.org
>
> You mean 3.3.x
>
>> ---
>>  drivers/xen/events.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
>> index 912ac81..0be4df3 100644
>> --- a/drivers/xen/events.c
>> +++ b/drivers/xen/events.c
>> @@ -1395,10 +1395,10 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
>>  {
>>       struct pt_regs *old_regs = set_irq_regs(regs);
>>
>> +     irq_enter();
>>  #ifdef CONFIG_X86
>>       exit_idle();
>>  #endif
>> -     irq_enter();
>>
>>       __xen_evtchn_do_upcall();
>>
>> --
>> 1.6.3.2

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 10:11:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 10:11:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW2bC-0000n4-LK; Wed, 07 Nov 2012 10:11:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Philippe.Simonet@swisscom.com>) id 1TW2bA-0000mz-Sj
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 10:11:05 +0000
Received: from [85.158.143.35:45441] by server-2.bemta-4.messagelabs.com id
	6D/32-28922-8B33A905; Wed, 07 Nov 2012 10:11:04 +0000
X-Env-Sender: Philippe.Simonet@swisscom.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352283057!12606639!1
X-Originating-IP: [193.222.81.110]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkzLjIyMi44MS4xMTAgPT4gMTAxODMx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32149 invoked from network); 7 Nov 2012 10:10:58 -0000
Received: from outmail110.swisscom.com (HELO mail.swisscom.com)
	(193.222.81.110)
	by server-12.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 7 Nov 2012 10:10:58 -0000
Received: by mail.swisscom.com; Wed, 7 Nov 2012 11:10:32 +0100
From: <Philippe.Simonet@swisscom.com>
To: <ijc@hellion.org.uk>, <xen-devel@lists.xen.org>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
	50 minutes" bug.
Thread-Index: Ac280B6CWUiPuRIkTkmJRMKB8zdEqQ==
Date: Wed, 7 Nov 2012 10:10:32 +0000
Message-ID: <FF93AF260AC2BB499A119CC65B092CF731516BBA@sg000713.corproot.net>
Accept-Language: en-US, de-CH
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.65.122.57]
MIME-Version: 1.0
Cc: 599161@bugs.debian.org, mrsanna1@gmail.com
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi Ian

i compiled  a patched hypervisor for Mauro, it is running since many days and the overflow occured, 
without clock jumps

> (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
> tsc_stamp=e3839fcb0273

(below is the complete xm dmesg output)

did that help you ? do you need more info ? 

thanks and regards

Philippe


> -----Original Message-----
> From: Mauro [mailto:mrsanna1@gmail.com]
> Sent: Wednesday, November 07, 2012 10:12 AM
> To: Simonet Philippe, ITS-OUS-OP-IFM-NW-IPE
> Subject: Re: [Xen-devel] [Xen-users] Re: Xen 4 TSC problems
> 
> Hello, no news until now there aren't clock jumps.
> Here is xm dmesg:
> 
> xm dmesg
> (XEN) Xen version 4.0.1 (Debian 4.0.1-5.4) (ultrotter@debian.org) (gcc
> version 4.4.5 (Debian 4.4.5-8) ) Mon Oct 29 14:42:12 CET 2012
> (XEN) Bootloader: GRUB 1.98+20100804-14+squeeze1
> (XEN) Command line: placeholder dom0_mem=3072M loglvl=warning
> guest_loglvl=warning
> (XEN) Video information:
> (XEN)  VGA is text mode 80x25, font 8x16
> (XEN)  VBE/DDC methods: V2; EDID transfer time: 2 seconds
> (XEN) Disc information:
> (XEN)  Found 2 MBR signatures
> (XEN)  Found 2 EDD information structures
> (XEN) Xen-e820 RAM map:
> (XEN)  0000000000000000 - 000000000009f400 (usable)
> (XEN)  000000000009f400 - 00000000000a0000 (reserved)
> (XEN)  00000000000f0000 - 0000000000100000 (reserved)
> (XEN)  0000000000100000 - 00000000cfd43000 (usable)
> (XEN)  00000000cfd43000 - 00000000cfd4c000 (ACPI data)
> (XEN)  00000000cfd4c000 - 00000000cfd4d000 (usable)
> (XEN)  00000000cfd4d000 - 00000000d0000000 (reserved)
> (XEN)  00000000e0000000 - 00000000f0000000 (reserved)
> (XEN)  00000000fec00000 - 00000000fed00000 (reserved)
> (XEN)  00000000fee00000 - 00000000fee10000 (reserved)
> (XEN)  00000000ffc00000 - 0000000100000000 (reserved)
> (XEN)  0000000100000000 - 000000102ffff000 (usable)
> (XEN) ACPI: RSDP 000F4F20, 0024 (r2 HP    )
> (XEN) ACPI: XSDT CFD43900, 007C (r1 HP     ProLiant        2         162E)
> (XEN) ACPI: FACP CFD439C0, 00F4 (r3 HP     ProLiant        2         162E)
> (XEN) ACPI: DSDT CFD43AC0, 30C9 (r1 HP         DSDT        1 INTL 20030228)
> (XEN) ACPI: FACS CFD43100, 0040
> (XEN) ACPI: SPCR CFD43140, 0050 (r1 HP     SPCRRBSU        1         162E)
> (XEN) ACPI: MCFG CFD431C0, 003C (r1 HP     ProLiant        1             0)
> (XEN) ACPI: HPET CFD43200, 0038 (r1 HP     ProLiant        2         162E)
> (XEN) ACPI: FFFF CFD43240, 0064 (r2 HP     P61             2         162E)
> (XEN) ACPI: SPMI CFD432C0, 0040 (r5 HP     ProLiant        1         162E)
> (XEN) ACPI: ERST CFD43300, 01D0 (r1 HP     ProLiant        1         162E)
> (XEN) ACPI: APIC CFD43500, 0176 (r1 HP     ProLiant        2             0)
> (XEN) ACPI: FFFF CFD43680, 0176 (r1 HP     ProLiant        1         162E)
> (XEN) ACPI: BERT CFD43800, 0030 (r1 HP     ProLiant        1         162E)
> (XEN) ACPI: HEST CFD43840, 00BC (r1 HP     ProLiant        1         162E)
> (XEN) System RAM: 65532MB (67105672kB)
> (XEN) Domain heap initialised
> (XEN) Processor #0 6:15 APIC version 20
> (XEN) Processor #8 6:15 APIC version 20
> (XEN) Processor #16 6:15 APIC version 20
> (XEN) Processor #24 6:15 APIC version 20
> (XEN) Processor #1 6:15 APIC version 20
> (XEN) Processor #9 6:15 APIC version 20
> (XEN) Processor #17 6:15 APIC version 20
> (XEN) Processor #25 6:15 APIC version 20
> (XEN) Processor #2 6:15 APIC version 20
> (XEN) Processor #10 6:15 APIC version 20
> (XEN) Processor #18 6:15 APIC version 20
> (XEN) Processor #26 6:15 APIC version 20
> (XEN) Processor #3 6:15 APIC version 20
> (XEN) Processor #11 6:15 APIC version 20
> (XEN) Processor #19 6:15 APIC version 20
> (XEN) Processor #27 6:15 APIC version 20
> (XEN) IOAPIC[0]: apic_id 1, version 32, address 0xfec00000, GSI 0-23
> (XEN) IOAPIC[1]: apic_id 2, version 32, address 0xfec80000, GSI 24-47
> (XEN) IOAPIC[2]: apic_id 3, version 32, address 0xfec81000, GSI 48-71
> (XEN) IOAPIC[3]: apic_id 4, version 32, address 0xfec81800, GSI 72-95
> (XEN) Enabling APIC mode:  Phys.  Using 4 I/O APICs
> (XEN) Using scheduler: SMP Credit Scheduler (credit)
> (XEN) Detected 2400.128 MHz processor.
> (XEN) Initing memory sharing.
> (XEN) VMX: Supported advanced features:
> (XEN)  - APIC MMIO access virtualisation
> (XEN)  - APIC TPR shadow
> (XEN)  - Virtual NMI
> (XEN)  - MSR direct-access bitmap
> (XEN) HVM: ASIDs disabled.
> (XEN) HVM: VMX enabled
> (XEN) I/O virtualisation disabled
> (XEN) Total of 16 processors activated.
> (XEN) ENABLING IO-APIC IRQs
> (XEN)  -> Using new ACK method
> (XEN) checking TSC synchronization across 16 CPUs:
> (XEN) CPU#14 had 3 usecs TSC skew, fixed it up.
> (XEN) Platform timer is 14.318MHz HPET
> (XEN) Allocated console ring of 32 KiB.
> (XEN) Brought up 16 CPUs
> (XEN) *** LOADING DOMAIN 0 ***
> (XEN)  Xen  kernel: 64-bit, lsb, compat32
> (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x1708000
> (XEN) PHYSICAL MEMORY ARRANGEMENT:
> (XEN)  Dom0 alloc.:   000000083c000000->0000000840000000 (770048 pages
> to be allocated)
> (XEN) VIRTUAL MEMORY ARRANGEMENT:
> (XEN)  Loaded kernel: ffffffff81000000->ffffffff81708000
> (XEN)  Init. ramdisk: ffffffff81708000->ffffffff81efb000
> (XEN)  Phys-Mach map: ffffffff81efb000->ffffffff824fb000
> (XEN)  Start info:    ffffffff824fb000->ffffffff824fb4b4
> (XEN)  Page tables:   ffffffff824fc000->ffffffff82513000
> (XEN)  Boot stack:    ffffffff82513000->ffffffff82514000
> (XEN)  TOTAL:         ffffffff80000000->ffffffff82800000
> (XEN)  ENTRY ADDRESS: ffffffff81531200
> (XEN) Dom0 has maximum 16 VCPUs
> (XEN) Scrubbing Free RAM:
> .....................................................................................................................
> .....................................................................................................................
> .....................................................................................................................
> .....................................................................................................................
> .....................................................................................................................
> ................................done.
> (XEN) Xen trace buffers: disabled
> (XEN) Std. Loglevel: Errors and warnings
> (XEN) Guest Loglevel: Errors and warnings
> (XEN) Xen is relinquishing VGA console.
> (XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to
> Xen)
> (XEN) Freed 176kB init memory.
> (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
> tsc_stamp=e3839fcb0273
> 
> 





> -----Original Message-----
> From: xen-devel-bounces@lists.xen.org [mailto:xen-devel-
> bounces@lists.xen.org] On Behalf Of Ian Campbell
> Sent: Friday, October 26, 2012 3:00 PM
> To: xen-devel@lists.xen.org
> Cc: 599161@bugs.debian.org
> Subject: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
> minutes" bug.
> 
> Hi all,
> 
> I've BCC'd a number of people who have reported seeing this bug at various
> times in the past.
> 
> If you can still repro I'd appreciate it if you could give the patch in
> http://marc.info/?l=xen-devel&m=135049062216685&w=2 (also attached) a
> go and report back success/failure and the output of the debugging
> messages produced.
> 
> Thanks,
> Ian.
> 
> --
> Ian Campbell
> Current Noise: Death - Evil Dead
> 
> Executive ability is prominent in your make-up.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 10:11:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 10:11:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW2bC-0000n4-LK; Wed, 07 Nov 2012 10:11:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Philippe.Simonet@swisscom.com>) id 1TW2bA-0000mz-Sj
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 10:11:05 +0000
Received: from [85.158.143.35:45441] by server-2.bemta-4.messagelabs.com id
	6D/32-28922-8B33A905; Wed, 07 Nov 2012 10:11:04 +0000
X-Env-Sender: Philippe.Simonet@swisscom.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352283057!12606639!1
X-Originating-IP: [193.222.81.110]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkzLjIyMi44MS4xMTAgPT4gMTAxODMx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32149 invoked from network); 7 Nov 2012 10:10:58 -0000
Received: from outmail110.swisscom.com (HELO mail.swisscom.com)
	(193.222.81.110)
	by server-12.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 7 Nov 2012 10:10:58 -0000
Received: by mail.swisscom.com; Wed, 7 Nov 2012 11:10:32 +0100
From: <Philippe.Simonet@swisscom.com>
To: <ijc@hellion.org.uk>, <xen-devel@lists.xen.org>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
	50 minutes" bug.
Thread-Index: Ac280B6CWUiPuRIkTkmJRMKB8zdEqQ==
Date: Wed, 7 Nov 2012 10:10:32 +0000
Message-ID: <FF93AF260AC2BB499A119CC65B092CF731516BBA@sg000713.corproot.net>
Accept-Language: en-US, de-CH
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.65.122.57]
MIME-Version: 1.0
Cc: 599161@bugs.debian.org, mrsanna1@gmail.com
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi Ian

i compiled  a patched hypervisor for Mauro, it is running since many days and the overflow occured, 
without clock jumps

> (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
> tsc_stamp=e3839fcb0273

(below is the complete xm dmesg output)

did that help you ? do you need more info ? 

thanks and regards

Philippe


> -----Original Message-----
> From: Mauro [mailto:mrsanna1@gmail.com]
> Sent: Wednesday, November 07, 2012 10:12 AM
> To: Simonet Philippe, ITS-OUS-OP-IFM-NW-IPE
> Subject: Re: [Xen-devel] [Xen-users] Re: Xen 4 TSC problems
> 
> Hello, no news until now there aren't clock jumps.
> Here is xm dmesg:
> 
> xm dmesg
> (XEN) Xen version 4.0.1 (Debian 4.0.1-5.4) (ultrotter@debian.org) (gcc
> version 4.4.5 (Debian 4.4.5-8) ) Mon Oct 29 14:42:12 CET 2012
> (XEN) Bootloader: GRUB 1.98+20100804-14+squeeze1
> (XEN) Command line: placeholder dom0_mem=3072M loglvl=warning
> guest_loglvl=warning
> (XEN) Video information:
> (XEN)  VGA is text mode 80x25, font 8x16
> (XEN)  VBE/DDC methods: V2; EDID transfer time: 2 seconds
> (XEN) Disc information:
> (XEN)  Found 2 MBR signatures
> (XEN)  Found 2 EDD information structures
> (XEN) Xen-e820 RAM map:
> (XEN)  0000000000000000 - 000000000009f400 (usable)
> (XEN)  000000000009f400 - 00000000000a0000 (reserved)
> (XEN)  00000000000f0000 - 0000000000100000 (reserved)
> (XEN)  0000000000100000 - 00000000cfd43000 (usable)
> (XEN)  00000000cfd43000 - 00000000cfd4c000 (ACPI data)
> (XEN)  00000000cfd4c000 - 00000000cfd4d000 (usable)
> (XEN)  00000000cfd4d000 - 00000000d0000000 (reserved)
> (XEN)  00000000e0000000 - 00000000f0000000 (reserved)
> (XEN)  00000000fec00000 - 00000000fed00000 (reserved)
> (XEN)  00000000fee00000 - 00000000fee10000 (reserved)
> (XEN)  00000000ffc00000 - 0000000100000000 (reserved)
> (XEN)  0000000100000000 - 000000102ffff000 (usable)
> (XEN) ACPI: RSDP 000F4F20, 0024 (r2 HP    )
> (XEN) ACPI: XSDT CFD43900, 007C (r1 HP     ProLiant        2         162E)
> (XEN) ACPI: FACP CFD439C0, 00F4 (r3 HP     ProLiant        2         162E)
> (XEN) ACPI: DSDT CFD43AC0, 30C9 (r1 HP         DSDT        1 INTL 20030228)
> (XEN) ACPI: FACS CFD43100, 0040
> (XEN) ACPI: SPCR CFD43140, 0050 (r1 HP     SPCRRBSU        1         162E)
> (XEN) ACPI: MCFG CFD431C0, 003C (r1 HP     ProLiant        1             0)
> (XEN) ACPI: HPET CFD43200, 0038 (r1 HP     ProLiant        2         162E)
> (XEN) ACPI: FFFF CFD43240, 0064 (r2 HP     P61             2         162E)
> (XEN) ACPI: SPMI CFD432C0, 0040 (r5 HP     ProLiant        1         162E)
> (XEN) ACPI: ERST CFD43300, 01D0 (r1 HP     ProLiant        1         162E)
> (XEN) ACPI: APIC CFD43500, 0176 (r1 HP     ProLiant        2             0)
> (XEN) ACPI: FFFF CFD43680, 0176 (r1 HP     ProLiant        1         162E)
> (XEN) ACPI: BERT CFD43800, 0030 (r1 HP     ProLiant        1         162E)
> (XEN) ACPI: HEST CFD43840, 00BC (r1 HP     ProLiant        1         162E)
> (XEN) System RAM: 65532MB (67105672kB)
> (XEN) Domain heap initialised
> (XEN) Processor #0 6:15 APIC version 20
> (XEN) Processor #8 6:15 APIC version 20
> (XEN) Processor #16 6:15 APIC version 20
> (XEN) Processor #24 6:15 APIC version 20
> (XEN) Processor #1 6:15 APIC version 20
> (XEN) Processor #9 6:15 APIC version 20
> (XEN) Processor #17 6:15 APIC version 20
> (XEN) Processor #25 6:15 APIC version 20
> (XEN) Processor #2 6:15 APIC version 20
> (XEN) Processor #10 6:15 APIC version 20
> (XEN) Processor #18 6:15 APIC version 20
> (XEN) Processor #26 6:15 APIC version 20
> (XEN) Processor #3 6:15 APIC version 20
> (XEN) Processor #11 6:15 APIC version 20
> (XEN) Processor #19 6:15 APIC version 20
> (XEN) Processor #27 6:15 APIC version 20
> (XEN) IOAPIC[0]: apic_id 1, version 32, address 0xfec00000, GSI 0-23
> (XEN) IOAPIC[1]: apic_id 2, version 32, address 0xfec80000, GSI 24-47
> (XEN) IOAPIC[2]: apic_id 3, version 32, address 0xfec81000, GSI 48-71
> (XEN) IOAPIC[3]: apic_id 4, version 32, address 0xfec81800, GSI 72-95
> (XEN) Enabling APIC mode:  Phys.  Using 4 I/O APICs
> (XEN) Using scheduler: SMP Credit Scheduler (credit)
> (XEN) Detected 2400.128 MHz processor.
> (XEN) Initing memory sharing.
> (XEN) VMX: Supported advanced features:
> (XEN)  - APIC MMIO access virtualisation
> (XEN)  - APIC TPR shadow
> (XEN)  - Virtual NMI
> (XEN)  - MSR direct-access bitmap
> (XEN) HVM: ASIDs disabled.
> (XEN) HVM: VMX enabled
> (XEN) I/O virtualisation disabled
> (XEN) Total of 16 processors activated.
> (XEN) ENABLING IO-APIC IRQs
> (XEN)  -> Using new ACK method
> (XEN) checking TSC synchronization across 16 CPUs:
> (XEN) CPU#14 had 3 usecs TSC skew, fixed it up.
> (XEN) Platform timer is 14.318MHz HPET
> (XEN) Allocated console ring of 32 KiB.
> (XEN) Brought up 16 CPUs
> (XEN) *** LOADING DOMAIN 0 ***
> (XEN)  Xen  kernel: 64-bit, lsb, compat32
> (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x1708000
> (XEN) PHYSICAL MEMORY ARRANGEMENT:
> (XEN)  Dom0 alloc.:   000000083c000000->0000000840000000 (770048 pages
> to be allocated)
> (XEN) VIRTUAL MEMORY ARRANGEMENT:
> (XEN)  Loaded kernel: ffffffff81000000->ffffffff81708000
> (XEN)  Init. ramdisk: ffffffff81708000->ffffffff81efb000
> (XEN)  Phys-Mach map: ffffffff81efb000->ffffffff824fb000
> (XEN)  Start info:    ffffffff824fb000->ffffffff824fb4b4
> (XEN)  Page tables:   ffffffff824fc000->ffffffff82513000
> (XEN)  Boot stack:    ffffffff82513000->ffffffff82514000
> (XEN)  TOTAL:         ffffffff80000000->ffffffff82800000
> (XEN)  ENTRY ADDRESS: ffffffff81531200
> (XEN) Dom0 has maximum 16 VCPUs
> (XEN) Scrubbing Free RAM:
> .....................................................................................................................
> .....................................................................................................................
> .....................................................................................................................
> .....................................................................................................................
> .....................................................................................................................
> ................................done.
> (XEN) Xen trace buffers: disabled
> (XEN) Std. Loglevel: Errors and warnings
> (XEN) Guest Loglevel: Errors and warnings
> (XEN) Xen is relinquishing VGA console.
> (XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to
> Xen)
> (XEN) Freed 176kB init memory.
> (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
> tsc_stamp=e3839fcb0273
> 
> 





> -----Original Message-----
> From: xen-devel-bounces@lists.xen.org [mailto:xen-devel-
> bounces@lists.xen.org] On Behalf Of Ian Campbell
> Sent: Friday, October 26, 2012 3:00 PM
> To: xen-devel@lists.xen.org
> Cc: 599161@bugs.debian.org
> Subject: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
> minutes" bug.
> 
> Hi all,
> 
> I've BCC'd a number of people who have reported seeing this bug at various
> times in the past.
> 
> If you can still repro I'd appreciate it if you could give the patch in
> http://marc.info/?l=xen-devel&m=135049062216685&w=2 (also attached) a
> go and report back success/failure and the output of the debugging
> messages produced.
> 
> Thanks,
> Ian.
> 
> --
> Ian Campbell
> Current Noise: Death - Evil Dead
> 
> Executive ability is prominent in your make-up.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 10:27:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 10:27:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW2qH-0000xV-5g; Wed, 07 Nov 2012 10:26:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TW2qF-0000xQ-M8
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 10:26:39 +0000
Received: from [85.158.139.83:38646] by server-10.bemta-5.messagelabs.com id
	32/1F-09257-E573A905; Wed, 07 Nov 2012 10:26:38 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1352283994!28604258!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQ3MzM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14548 invoked from network); 7 Nov 2012 10:26:37 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 10:26:37 -0000
X-IronPort-AV: E=Sophos;i="4.80,728,1344211200"; d="scan'208";a="213710349"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	07 Nov 2012 10:26:34 +0000
Received: from kaball.uk.xensource.com (10.80.2.59) by
	FTLPEX01CL03.citrite.net (10.13.107.80) with Microsoft SMTP Server id
	14.2.318.1; Wed, 7 Nov 2012 05:26:33 -0500
Date: Wed, 7 Nov 2012 10:25:49 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
In-Reply-To: <1352239982-17389-3-git-send-email-konrad.wilk@oracle.com>
Message-ID: <alpine.DEB.2.02.1211070959150.2689@kaball.uk.xensource.com>
References: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
	<1352239982-17389-3-git-send-email-konrad.wilk@oracle.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
X-Originating-IP: [10.80.2.59]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH 2/2] xen/arm: Fix compile errors when
 drivers are compiled as modules.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 6 Nov 2012, Konrad Rzeszutek Wilk wrote:
> We end up with:
> 
> ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
> ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> ERROR: "HYPERVISOR_grant_table_op" [drivers/net/xen-netback/xen-netback.ko] undefined!
> 
> and this patch exports said function (which is implemented in hypercall.S).
> 
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Thank you very much for going out of your way to fix this issue (I am
currently at LinuxCon).


>  arch/arm/xen/enlighten.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> index 59bcb96..96d969d 100644
> --- a/arch/arm/xen/enlighten.c
> +++ b/arch/arm/xen/enlighten.c
> @@ -166,3 +166,8 @@ void free_xenballooned_pages(int nr_pages, struct page **pages)
>  	*pages = NULL;
>  }
>  EXPORT_SYMBOL_GPL(free_xenballooned_pages);
> +
> +/* In the hypervisor.S file. */
> +EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
> +EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
> +EXPORT_SYMBOL_GPL(privcmd_call);
 
I think the patch is OK and I tested it: it fixes the issue reported
by Russell.
However I am wondering, does it actually make sense only to export 3
hypercalls among the set implemented in hypercall.S?
Maybe it does make sense only to export a subset, but I wouldn't
necessarly do the differentiation here, I would just export all the
hypercalls implemented in hypercalls.S.
In fact if we separate the hypercalls in two sets, I would like to
see a similar differentiation on x86 too.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 10:27:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 10:27:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW2qH-0000xV-5g; Wed, 07 Nov 2012 10:26:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TW2qF-0000xQ-M8
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 10:26:39 +0000
Received: from [85.158.139.83:38646] by server-10.bemta-5.messagelabs.com id
	32/1F-09257-E573A905; Wed, 07 Nov 2012 10:26:38 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1352283994!28604258!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQ3MzM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14548 invoked from network); 7 Nov 2012 10:26:37 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 10:26:37 -0000
X-IronPort-AV: E=Sophos;i="4.80,728,1344211200"; d="scan'208";a="213710349"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	07 Nov 2012 10:26:34 +0000
Received: from kaball.uk.xensource.com (10.80.2.59) by
	FTLPEX01CL03.citrite.net (10.13.107.80) with Microsoft SMTP Server id
	14.2.318.1; Wed, 7 Nov 2012 05:26:33 -0500
Date: Wed, 7 Nov 2012 10:25:49 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
In-Reply-To: <1352239982-17389-3-git-send-email-konrad.wilk@oracle.com>
Message-ID: <alpine.DEB.2.02.1211070959150.2689@kaball.uk.xensource.com>
References: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
	<1352239982-17389-3-git-send-email-konrad.wilk@oracle.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
X-Originating-IP: [10.80.2.59]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH 2/2] xen/arm: Fix compile errors when
 drivers are compiled as modules.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 6 Nov 2012, Konrad Rzeszutek Wilk wrote:
> We end up with:
> 
> ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
> ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> ERROR: "HYPERVISOR_grant_table_op" [drivers/net/xen-netback/xen-netback.ko] undefined!
> 
> and this patch exports said function (which is implemented in hypercall.S).
> 
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Thank you very much for going out of your way to fix this issue (I am
currently at LinuxCon).


>  arch/arm/xen/enlighten.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> index 59bcb96..96d969d 100644
> --- a/arch/arm/xen/enlighten.c
> +++ b/arch/arm/xen/enlighten.c
> @@ -166,3 +166,8 @@ void free_xenballooned_pages(int nr_pages, struct page **pages)
>  	*pages = NULL;
>  }
>  EXPORT_SYMBOL_GPL(free_xenballooned_pages);
> +
> +/* In the hypervisor.S file. */
> +EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
> +EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
> +EXPORT_SYMBOL_GPL(privcmd_call);
 
I think the patch is OK and I tested it: it fixes the issue reported
by Russell.
However I am wondering, does it actually make sense only to export 3
hypercalls among the set implemented in hypercall.S?
Maybe it does make sense only to export a subset, but I wouldn't
necessarly do the differentiation here, I would just export all the
hypercalls implemented in hypercalls.S.
In fact if we separate the hypercalls in two sets, I would like to
see a similar differentiation on x86 too.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 11:00:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 11:00:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW3MI-0001F6-6v; Wed, 07 Nov 2012 10:59:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TW3MG-0001F1-Al
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 10:59:44 +0000
Received: from [85.158.139.83:18638] by server-12.bemta-5.messagelabs.com id
	CE/E5-02886-F1F3A905; Wed, 07 Nov 2012 10:59:43 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1352285981!26450280!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQ3MzM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28750 invoked from network); 7 Nov 2012 10:59:42 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 10:59:42 -0000
X-IronPort-AV: E=Sophos;i="4.80,728,1344211200"; d="scan'208";a="213712671"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 10:59:41 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 7 Nov 2012 05:59:41 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TW3MB-0007iJ-To;
	Wed, 07 Nov 2012 10:59:40 +0000
Message-ID: <1352285859.12977.45.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Wed, 7 Nov 2012 11:57:39 +0100
In-Reply-To: <alpine.DEB.2.02.1211070959150.2689@kaball.uk.xensource.com>
References: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
	<1352239982-17389-3-git-send-email-konrad.wilk@oracle.com>
	<alpine.DEB.2.02.1211070959150.2689@kaball.uk.xensource.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 2/2] xen/arm: Fix compile errors when
 drivers are compiled as modules.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-07 at 10:25 +0000, Stefano Stabellini wrote:
> On Tue, 6 Nov 2012, Konrad Rzeszutek Wilk wrote:
> > We end up with:
> > 
> > ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
> > ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> > ERROR: "HYPERVISOR_grant_table_op" [drivers/net/xen-netback/xen-netback.ko] undefined!
> > 
> > and this patch exports said function (which is implemented in hypercall.S).
> > 
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> 
> Thank you very much for going out of your way to fix this issue (I am
> currently at LinuxCon).
> 
> 
> >  arch/arm/xen/enlighten.c |    5 +++++
> >  1 files changed, 5 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> > index 59bcb96..96d969d 100644
> > --- a/arch/arm/xen/enlighten.c
> > +++ b/arch/arm/xen/enlighten.c
> > @@ -166,3 +166,8 @@ void free_xenballooned_pages(int nr_pages, struct page **pages)
> >  	*pages = NULL;
> >  }
> >  EXPORT_SYMBOL_GPL(free_xenballooned_pages);
> > +
> > +/* In the hypervisor.S file. */
> > +EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
> > +EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
> > +EXPORT_SYMBOL_GPL(privcmd_call);
>  
> I think the patch is OK and I tested it: it fixes the issue reported
> by Russell.
> However I am wondering, does it actually make sense only to export 3
> hypercalls among the set implemented in hypercall.S?
> Maybe it does make sense only to export a subset, but I wouldn't
> necessarly do the differentiation here, I would just export all the
> hypercalls implemented in hypercalls.S.
> In fact if we separate the hypercalls in two sets, I would like to
> see a similar differentiation on x86 too.

On x86 these functions are static inline (all of them, I think) so
exporting them is not necessary or possible.

I don't think you can export from a .S, otherwise the obvious answer
would be to integrate it with the macro in hypercall.S.

Possibly mad idea: auto-generate hypercall.[Sc] (.S=stubs & .c=exports)
from include/xen/interface/xen.h:HYPERVISOR_* ?

(Aside: the whitespace in hypercall.S is a bit fubarred, wrt the line
wrapping in the macros)

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 11:00:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 11:00:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW3MI-0001F6-6v; Wed, 07 Nov 2012 10:59:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TW3MG-0001F1-Al
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 10:59:44 +0000
Received: from [85.158.139.83:18638] by server-12.bemta-5.messagelabs.com id
	CE/E5-02886-F1F3A905; Wed, 07 Nov 2012 10:59:43 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1352285981!26450280!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQ3MzM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28750 invoked from network); 7 Nov 2012 10:59:42 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 10:59:42 -0000
X-IronPort-AV: E=Sophos;i="4.80,728,1344211200"; d="scan'208";a="213712671"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 10:59:41 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 7 Nov 2012 05:59:41 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TW3MB-0007iJ-To;
	Wed, 07 Nov 2012 10:59:40 +0000
Message-ID: <1352285859.12977.45.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Wed, 7 Nov 2012 11:57:39 +0100
In-Reply-To: <alpine.DEB.2.02.1211070959150.2689@kaball.uk.xensource.com>
References: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
	<1352239982-17389-3-git-send-email-konrad.wilk@oracle.com>
	<alpine.DEB.2.02.1211070959150.2689@kaball.uk.xensource.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 2/2] xen/arm: Fix compile errors when
 drivers are compiled as modules.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-07 at 10:25 +0000, Stefano Stabellini wrote:
> On Tue, 6 Nov 2012, Konrad Rzeszutek Wilk wrote:
> > We end up with:
> > 
> > ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
> > ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> > ERROR: "HYPERVISOR_grant_table_op" [drivers/net/xen-netback/xen-netback.ko] undefined!
> > 
> > and this patch exports said function (which is implemented in hypercall.S).
> > 
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> 
> Thank you very much for going out of your way to fix this issue (I am
> currently at LinuxCon).
> 
> 
> >  arch/arm/xen/enlighten.c |    5 +++++
> >  1 files changed, 5 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> > index 59bcb96..96d969d 100644
> > --- a/arch/arm/xen/enlighten.c
> > +++ b/arch/arm/xen/enlighten.c
> > @@ -166,3 +166,8 @@ void free_xenballooned_pages(int nr_pages, struct page **pages)
> >  	*pages = NULL;
> >  }
> >  EXPORT_SYMBOL_GPL(free_xenballooned_pages);
> > +
> > +/* In the hypervisor.S file. */
> > +EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
> > +EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
> > +EXPORT_SYMBOL_GPL(privcmd_call);
>  
> I think the patch is OK and I tested it: it fixes the issue reported
> by Russell.
> However I am wondering, does it actually make sense only to export 3
> hypercalls among the set implemented in hypercall.S?
> Maybe it does make sense only to export a subset, but I wouldn't
> necessarly do the differentiation here, I would just export all the
> hypercalls implemented in hypercalls.S.
> In fact if we separate the hypercalls in two sets, I would like to
> see a similar differentiation on x86 too.

On x86 these functions are static inline (all of them, I think) so
exporting them is not necessary or possible.

I don't think you can export from a .S, otherwise the obvious answer
would be to integrate it with the macro in hypercall.S.

Possibly mad idea: auto-generate hypercall.[Sc] (.S=stubs & .c=exports)
from include/xen/interface/xen.h:HYPERVISOR_* ?

(Aside: the whitespace in hypercall.S is a bit fubarred, wrt the line
wrapping in the macros)

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 12:59:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 12:59:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW5DA-0001zy-N9; Wed, 07 Nov 2012 12:58:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TW5D8-0001zt-CM
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 12:58:26 +0000
Received: from [85.158.138.51:47811] by server-4.bemta-3.messagelabs.com id
	A2/24-30023-1FA5A905; Wed, 07 Nov 2012 12:58:25 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1352293102!21131538!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI3Mjk4Mw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22481 invoked from network); 7 Nov 2012 12:58:23 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-12.tower-174.messagelabs.com with SMTP;
	7 Nov 2012 12:58:23 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 07 Nov 2012 04:58:22 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,730,1344236400"; 
	d="scan'208,223";a="243622347"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by fmsmga001.fm.intel.com with ESMTP; 07 Nov 2012 04:58:21 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 04:58:21 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Wed, 7 Nov 2012 20:58:20 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thread-Topic: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
Thread-Index: AQHNvD3JTi91BiFLfUibRvXA4zlK85feVKOg
Date: Wed, 7 Nov 2012 12:58:19 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537B99E@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
	<alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537B147@SHSMSX101.ccr.corp.intel.com>
	<alpine.DEB.2.02.1211061455150.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B479@SHSMSX101.ccr.corp.intel.com>
	<20121106164303.GO9966@phenom.dumpdata.com>
In-Reply-To: <20121106164303.GO9966@phenom.dumpdata.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_002_DE8DF0795D48FD4CA783C40EC829233537B99ESHSMSX101ccrcorpi_"
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_DE8DF0795D48FD4CA783C40EC829233537B99ESHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

>>>=20
>>> If it is generic ACPI code, than it can depend only on ACPI.
>>> If it is ACPI code that contains X86 specific info, than it needs to
>>> depend on X86 too.
>>=20
>> No x86 specific so let's depend on ACPI.
>=20
> Huh? This feature is x86 specific isn't it? I mean it is in the ACPI
> spec, but only x86 does it right?

OK, updated w/ ACPI & X86 dependency, and per other comments.

Thanks,
Jinsong

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

>From d5f462cc8029863955a574f1541bece72aafb986 Mon Sep 17 00:00:00 2001
From: Liu, Jinsong <jinsong.liu@intel.com>
Date: Thu, 8 Nov 2012 04:29:07 +0800
Subject: [PATCH 1/2] Xen acpi pad implement

PAD is acpi Processor Aggregator Device which provides a control point
that enables the platform to perform specific processor configuration
and control that applies to all processors in the platform.

This patch is to implement Xen acpi pad logic. When running under Xen
virt platform, native pad driver would not work. Instead Xen pad driver,
a self-contained and thin logic level, would take over acpi pad logic.

When acpi pad notify OSPM, xen pad logic intercept and parse _PUR object
to get the expected idle cpu number, and then hypercall to hypervisor.
Xen hypervisor would then do the rest work, say, core parking, to idle
specific number of cpus on its own policy.

Signed-off-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
---
 drivers/xen/Makefile             |    3 +-
 drivers/xen/xen-acpi-pad.c       |  186 ++++++++++++++++++++++++++++++++++=
++++
 include/xen/interface/platform.h |   17 ++++
 include/xen/interface/version.h  |   15 +++
 4 files changed, 220 insertions(+), 1 deletions(-)
 create mode 100644 drivers/xen/xen-acpi-pad.c

diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 0e86370..3c39717 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -10,7 +10,8 @@ CFLAGS_features.o			:=3D $(nostackp)
=20
 dom0-$(CONFIG_PCI) +=3D pci.o
 dom0-$(CONFIG_USB_SUPPORT) +=3D dbgp.o
-dom0-$(CONFIG_ACPI) +=3D acpi.o
+dom0-$(CONFIG_ACPI) +=3D acpi.o $(xen-pad-y)
+xen-pad-$(CONFIG_X86) +=3D xen-acpi-pad.o
 dom0-$(CONFIG_X86) +=3D pcpu.o
 obj-$(CONFIG_XEN_DOM0)			+=3D $(dom0-y)
 obj-$(CONFIG_BLOCK)			+=3D biomerge.o
diff --git a/drivers/xen/xen-acpi-pad.c b/drivers/xen/xen-acpi-pad.c
new file mode 100644
index 0000000..f02d3ff
--- /dev/null
+++ b/drivers/xen/xen-acpi-pad.c
@@ -0,0 +1,186 @@
+/*
+ * xen-acpi-pad.c - Xen pad interface
+ *
+ * Copyright (c) 2012, Intel Corporation.
+ *    Author: Liu, Jinsong <jinsong.liu@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License f=
or
+ * 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.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <acpi/acpi_bus.h>
+#include <acpi/acpi_drivers.h>
+#include <asm/xen/hypercall.h>
+#include <xen/interface/version.h>
+
+#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"acpi_pad"
+#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
+#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
+
+static DEFINE_MUTEX(xen_cpu_lock);
+
+static int xen_acpi_pad_idle_cpus(unsigned int idle_nums)
+{
+	struct xen_platform_op op;
+
+	op.cmd =3D XENPF_core_parking;
+	op.u.core_parking.type =3D XEN_CORE_PARKING_SET;
+	op.u.core_parking.idle_nums =3D idle_nums;
+
+	return HYPERVISOR_dom0_op(&op);
+}
+
+static int xen_acpi_pad_idle_cpus_num(void)
+{
+	struct xen_platform_op op;
+
+	op.cmd =3D XENPF_core_parking;
+	op.u.core_parking.type =3D XEN_CORE_PARKING_GET;
+
+	return HYPERVISOR_dom0_op(&op)
+	       ?: op.u.core_parking.idle_nums;
+}
+
+/*
+ * Query firmware how many CPUs should be idle
+ * return -1 on failure
+ */
+static int acpi_pad_pur(acpi_handle handle)
+{
+	struct acpi_buffer buffer =3D {ACPI_ALLOCATE_BUFFER, NULL};
+	union acpi_object *package;
+	int num =3D -1;
+
+	if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))
+		return num;
+
+	if (!buffer.length || !buffer.pointer)
+		return num;
+
+	package =3D buffer.pointer;
+
+	if (package->type =3D=3D ACPI_TYPE_PACKAGE &&
+		package->package.count =3D=3D 2 &&
+		package->package.elements[0].integer.value =3D=3D 1) /* rev 1 */
+
+		num =3D package->package.elements[1].integer.value;
+
+	kfree(buffer.pointer);
+	return num;
+}
+
+/* Notify firmware how many CPUs are idle */
+static void acpi_pad_ost(acpi_handle handle, int stat,
+	uint32_t idle_nums)
+{
+	union acpi_object params[3] =3D {
+		{.type =3D ACPI_TYPE_INTEGER,},
+		{.type =3D ACPI_TYPE_INTEGER,},
+		{.type =3D ACPI_TYPE_BUFFER,},
+	};
+	struct acpi_object_list arg_list =3D {3, params};
+
+	params[0].integer.value =3D ACPI_PROCESSOR_AGGREGATOR_NOTIFY;
+	params[1].integer.value =3D  stat;
+	params[2].buffer.length =3D 4;
+	params[2].buffer.pointer =3D (void *)&idle_nums;
+	acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
+}
+
+static void acpi_pad_handle_notify(acpi_handle handle)
+{
+	int idle_nums;
+
+	mutex_lock(&xen_cpu_lock);
+	idle_nums =3D acpi_pad_pur(handle);
+	if (idle_nums < 0) {
+		mutex_unlock(&xen_cpu_lock);
+		return;
+	}
+
+	idle_nums =3D xen_acpi_pad_idle_cpus(idle_nums)
+		    ?: xen_acpi_pad_idle_cpus_num();
+	if (idle_nums >=3D 0)
+		acpi_pad_ost(handle, 0, idle_nums);
+	mutex_unlock(&xen_cpu_lock);
+}
+
+static void acpi_pad_notify(acpi_handle handle, u32 event,
+	void *data)
+{
+	switch (event) {
+	case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
+		acpi_pad_handle_notify(handle);
+		break;
+	default:
+		pr_warn("Unsupported event [0x%x]\n", event);
+		break;
+	}
+}
+
+static int acpi_pad_add(struct acpi_device *device)
+{
+	acpi_status status;
+
+	strcpy(acpi_device_name(device), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
+	strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);
+
+	status =3D acpi_install_notify_handler(device->handle,
+		ACPI_DEVICE_NOTIFY, acpi_pad_notify, device);
+	if (ACPI_FAILURE(status))
+		return -ENODEV;
+
+	return 0;
+}
+
+static int acpi_pad_remove(struct acpi_device *device,
+	int type)
+{
+	mutex_lock(&xen_cpu_lock);
+	xen_acpi_pad_idle_cpus(0);
+	mutex_unlock(&xen_cpu_lock);
+
+	acpi_remove_notify_handler(device->handle,
+		ACPI_DEVICE_NOTIFY, acpi_pad_notify);
+	return 0;
+}
+
+static const struct acpi_device_id pad_device_ids[] =3D {
+	{"ACPI000C", 0},
+	{"", 0},
+};
+
+static struct acpi_driver acpi_pad_driver =3D {
+	.name =3D "processor_aggregator",
+	.class =3D ACPI_PROCESSOR_AGGREGATOR_CLASS,
+	.ids =3D pad_device_ids,
+	.ops =3D {
+		.add =3D acpi_pad_add,
+		.remove =3D acpi_pad_remove,
+	},
+};
+
+static int __init xen_acpi_pad_init(void)
+{
+	/* Only DOM0 and Xen4.2 or later support Xen acpi pad */
+	if (!xen_initial_domain() ||
+		!xen_running_on_version_or_later(4, 2))
+		return -ENODEV;
+
+	return acpi_bus_register_driver(&acpi_pad_driver);
+}
+subsys_initcall(xen_acpi_pad_init);
+
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platf=
orm.h
index 4755b5f..5e36932 100644
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
@@ -324,6 +324,22 @@ struct xenpf_cpu_ol {
 };
 DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
=20
+/*
+ * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd,
+ * which are already occupied at Xen hypervisor side.
+ */
+#define XENPF_core_parking     60
+struct xenpf_core_parking {
+	/* IN variables */
+#define XEN_CORE_PARKING_SET   1
+#define XEN_CORE_PARKING_GET   2
+	uint32_t type;
+	/* IN variables:  set cpu nums expected to be idled */
+	/* OUT variables: get cpu nums actually be idled */
+	uint32_t idle_nums;
+};
+DEFINE_GUEST_HANDLE_STRUCT(xenpf_core_parking);
+
 struct xen_platform_op {
 	uint32_t cmd;
 	uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -341,6 +357,7 @@ struct xen_platform_op {
 		struct xenpf_set_processor_pminfo set_pminfo;
 		struct xenpf_pcpuinfo          pcpu_info;
 		struct xenpf_cpu_ol            cpu_ol;
+		struct xenpf_core_parking      core_parking;
 		uint8_t                        pad[128];
 	} u;
 };
diff --git a/include/xen/interface/version.h b/include/xen/interface/versio=
n.h
index 7ff6498..96d8d3d 100644
--- a/include/xen/interface/version.h
+++ b/include/xen/interface/version.h
@@ -63,4 +63,19 @@ struct xen_feature_info {
 /* arg =3D=3D xen_domain_handle_t. */
 #define XENVER_guest_handle 8
=20
+/* Check if running on Xen version (major, minor) or later */
+static inline bool
+xen_running_on_version_or_later(unsigned int major, unsigned int minor)
+{
+	unsigned int version;
+
+	if (!xen_domain())
+		return false;
+
+	version =3D HYPERVISOR_xen_version(XENVER_version, NULL);
+	if ((((version >> 16) =3D=3D major) && ((version & 0xffff) >=3D minor)) |=
|
+		((version >> 16) > major))
+		return true;
+	return false;
+}
 #endif /* __XEN_PUBLIC_VERSION_H__ */
--=20
1.7.1

--_002_DE8DF0795D48FD4CA783C40EC829233537B99ESHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
	name="0001-Xen-acpi-pad-implement.patch"
Content-Description: 0001-Xen-acpi-pad-implement.patch
Content-Disposition: attachment;
	filename="0001-Xen-acpi-pad-implement.patch"; size=8743;
	creation-date="Wed, 07 Nov 2012 12:49:11 GMT";
	modification-date="Wed, 07 Nov 2012 20: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DE8DF0795D48FD4CA783C40EC829233537B99ESHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_002_DE8DF0795D48FD4CA783C40EC829233537B99ESHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Wed Nov 07 12:59:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 12:59:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW5DA-0001zy-N9; Wed, 07 Nov 2012 12:58:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TW5D8-0001zt-CM
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 12:58:26 +0000
Received: from [85.158.138.51:47811] by server-4.bemta-3.messagelabs.com id
	A2/24-30023-1FA5A905; Wed, 07 Nov 2012 12:58:25 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1352293102!21131538!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI3Mjk4Mw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22481 invoked from network); 7 Nov 2012 12:58:23 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-12.tower-174.messagelabs.com with SMTP;
	7 Nov 2012 12:58:23 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 07 Nov 2012 04:58:22 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,730,1344236400"; 
	d="scan'208,223";a="243622347"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by fmsmga001.fm.intel.com with ESMTP; 07 Nov 2012 04:58:21 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 04:58:21 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Wed, 7 Nov 2012 20:58:20 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thread-Topic: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
Thread-Index: AQHNvD3JTi91BiFLfUibRvXA4zlK85feVKOg
Date: Wed, 7 Nov 2012 12:58:19 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537B99E@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC8292335372883@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537292E@SHSMSX101.ccr.corp.intel.com>
	<20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
	<alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537B147@SHSMSX101.ccr.corp.intel.com>
	<alpine.DEB.2.02.1211061455150.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B479@SHSMSX101.ccr.corp.intel.com>
	<20121106164303.GO9966@phenom.dumpdata.com>
In-Reply-To: <20121106164303.GO9966@phenom.dumpdata.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_002_DE8DF0795D48FD4CA783C40EC829233537B99ESHSMSX101ccrcorpi_"
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_DE8DF0795D48FD4CA783C40EC829233537B99ESHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

>>>=20
>>> If it is generic ACPI code, than it can depend only on ACPI.
>>> If it is ACPI code that contains X86 specific info, than it needs to
>>> depend on X86 too.
>>=20
>> No x86 specific so let's depend on ACPI.
>=20
> Huh? This feature is x86 specific isn't it? I mean it is in the ACPI
> spec, but only x86 does it right?

OK, updated w/ ACPI & X86 dependency, and per other comments.

Thanks,
Jinsong

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

>From d5f462cc8029863955a574f1541bece72aafb986 Mon Sep 17 00:00:00 2001
From: Liu, Jinsong <jinsong.liu@intel.com>
Date: Thu, 8 Nov 2012 04:29:07 +0800
Subject: [PATCH 1/2] Xen acpi pad implement

PAD is acpi Processor Aggregator Device which provides a control point
that enables the platform to perform specific processor configuration
and control that applies to all processors in the platform.

This patch is to implement Xen acpi pad logic. When running under Xen
virt platform, native pad driver would not work. Instead Xen pad driver,
a self-contained and thin logic level, would take over acpi pad logic.

When acpi pad notify OSPM, xen pad logic intercept and parse _PUR object
to get the expected idle cpu number, and then hypercall to hypervisor.
Xen hypervisor would then do the rest work, say, core parking, to idle
specific number of cpus on its own policy.

Signed-off-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
---
 drivers/xen/Makefile             |    3 +-
 drivers/xen/xen-acpi-pad.c       |  186 ++++++++++++++++++++++++++++++++++=
++++
 include/xen/interface/platform.h |   17 ++++
 include/xen/interface/version.h  |   15 +++
 4 files changed, 220 insertions(+), 1 deletions(-)
 create mode 100644 drivers/xen/xen-acpi-pad.c

diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 0e86370..3c39717 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -10,7 +10,8 @@ CFLAGS_features.o			:=3D $(nostackp)
=20
 dom0-$(CONFIG_PCI) +=3D pci.o
 dom0-$(CONFIG_USB_SUPPORT) +=3D dbgp.o
-dom0-$(CONFIG_ACPI) +=3D acpi.o
+dom0-$(CONFIG_ACPI) +=3D acpi.o $(xen-pad-y)
+xen-pad-$(CONFIG_X86) +=3D xen-acpi-pad.o
 dom0-$(CONFIG_X86) +=3D pcpu.o
 obj-$(CONFIG_XEN_DOM0)			+=3D $(dom0-y)
 obj-$(CONFIG_BLOCK)			+=3D biomerge.o
diff --git a/drivers/xen/xen-acpi-pad.c b/drivers/xen/xen-acpi-pad.c
new file mode 100644
index 0000000..f02d3ff
--- /dev/null
+++ b/drivers/xen/xen-acpi-pad.c
@@ -0,0 +1,186 @@
+/*
+ * xen-acpi-pad.c - Xen pad interface
+ *
+ * Copyright (c) 2012, Intel Corporation.
+ *    Author: Liu, Jinsong <jinsong.liu@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License f=
or
+ * 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.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <acpi/acpi_bus.h>
+#include <acpi/acpi_drivers.h>
+#include <asm/xen/hypercall.h>
+#include <xen/interface/version.h>
+
+#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"acpi_pad"
+#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
+#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
+
+static DEFINE_MUTEX(xen_cpu_lock);
+
+static int xen_acpi_pad_idle_cpus(unsigned int idle_nums)
+{
+	struct xen_platform_op op;
+
+	op.cmd =3D XENPF_core_parking;
+	op.u.core_parking.type =3D XEN_CORE_PARKING_SET;
+	op.u.core_parking.idle_nums =3D idle_nums;
+
+	return HYPERVISOR_dom0_op(&op);
+}
+
+static int xen_acpi_pad_idle_cpus_num(void)
+{
+	struct xen_platform_op op;
+
+	op.cmd =3D XENPF_core_parking;
+	op.u.core_parking.type =3D XEN_CORE_PARKING_GET;
+
+	return HYPERVISOR_dom0_op(&op)
+	       ?: op.u.core_parking.idle_nums;
+}
+
+/*
+ * Query firmware how many CPUs should be idle
+ * return -1 on failure
+ */
+static int acpi_pad_pur(acpi_handle handle)
+{
+	struct acpi_buffer buffer =3D {ACPI_ALLOCATE_BUFFER, NULL};
+	union acpi_object *package;
+	int num =3D -1;
+
+	if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))
+		return num;
+
+	if (!buffer.length || !buffer.pointer)
+		return num;
+
+	package =3D buffer.pointer;
+
+	if (package->type =3D=3D ACPI_TYPE_PACKAGE &&
+		package->package.count =3D=3D 2 &&
+		package->package.elements[0].integer.value =3D=3D 1) /* rev 1 */
+
+		num =3D package->package.elements[1].integer.value;
+
+	kfree(buffer.pointer);
+	return num;
+}
+
+/* Notify firmware how many CPUs are idle */
+static void acpi_pad_ost(acpi_handle handle, int stat,
+	uint32_t idle_nums)
+{
+	union acpi_object params[3] =3D {
+		{.type =3D ACPI_TYPE_INTEGER,},
+		{.type =3D ACPI_TYPE_INTEGER,},
+		{.type =3D ACPI_TYPE_BUFFER,},
+	};
+	struct acpi_object_list arg_list =3D {3, params};
+
+	params[0].integer.value =3D ACPI_PROCESSOR_AGGREGATOR_NOTIFY;
+	params[1].integer.value =3D  stat;
+	params[2].buffer.length =3D 4;
+	params[2].buffer.pointer =3D (void *)&idle_nums;
+	acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
+}
+
+static void acpi_pad_handle_notify(acpi_handle handle)
+{
+	int idle_nums;
+
+	mutex_lock(&xen_cpu_lock);
+	idle_nums =3D acpi_pad_pur(handle);
+	if (idle_nums < 0) {
+		mutex_unlock(&xen_cpu_lock);
+		return;
+	}
+
+	idle_nums =3D xen_acpi_pad_idle_cpus(idle_nums)
+		    ?: xen_acpi_pad_idle_cpus_num();
+	if (idle_nums >=3D 0)
+		acpi_pad_ost(handle, 0, idle_nums);
+	mutex_unlock(&xen_cpu_lock);
+}
+
+static void acpi_pad_notify(acpi_handle handle, u32 event,
+	void *data)
+{
+	switch (event) {
+	case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
+		acpi_pad_handle_notify(handle);
+		break;
+	default:
+		pr_warn("Unsupported event [0x%x]\n", event);
+		break;
+	}
+}
+
+static int acpi_pad_add(struct acpi_device *device)
+{
+	acpi_status status;
+
+	strcpy(acpi_device_name(device), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
+	strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);
+
+	status =3D acpi_install_notify_handler(device->handle,
+		ACPI_DEVICE_NOTIFY, acpi_pad_notify, device);
+	if (ACPI_FAILURE(status))
+		return -ENODEV;
+
+	return 0;
+}
+
+static int acpi_pad_remove(struct acpi_device *device,
+	int type)
+{
+	mutex_lock(&xen_cpu_lock);
+	xen_acpi_pad_idle_cpus(0);
+	mutex_unlock(&xen_cpu_lock);
+
+	acpi_remove_notify_handler(device->handle,
+		ACPI_DEVICE_NOTIFY, acpi_pad_notify);
+	return 0;
+}
+
+static const struct acpi_device_id pad_device_ids[] =3D {
+	{"ACPI000C", 0},
+	{"", 0},
+};
+
+static struct acpi_driver acpi_pad_driver =3D {
+	.name =3D "processor_aggregator",
+	.class =3D ACPI_PROCESSOR_AGGREGATOR_CLASS,
+	.ids =3D pad_device_ids,
+	.ops =3D {
+		.add =3D acpi_pad_add,
+		.remove =3D acpi_pad_remove,
+	},
+};
+
+static int __init xen_acpi_pad_init(void)
+{
+	/* Only DOM0 and Xen4.2 or later support Xen acpi pad */
+	if (!xen_initial_domain() ||
+		!xen_running_on_version_or_later(4, 2))
+		return -ENODEV;
+
+	return acpi_bus_register_driver(&acpi_pad_driver);
+}
+subsys_initcall(xen_acpi_pad_init);
+
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platf=
orm.h
index 4755b5f..5e36932 100644
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
@@ -324,6 +324,22 @@ struct xenpf_cpu_ol {
 };
 DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
=20
+/*
+ * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd,
+ * which are already occupied at Xen hypervisor side.
+ */
+#define XENPF_core_parking     60
+struct xenpf_core_parking {
+	/* IN variables */
+#define XEN_CORE_PARKING_SET   1
+#define XEN_CORE_PARKING_GET   2
+	uint32_t type;
+	/* IN variables:  set cpu nums expected to be idled */
+	/* OUT variables: get cpu nums actually be idled */
+	uint32_t idle_nums;
+};
+DEFINE_GUEST_HANDLE_STRUCT(xenpf_core_parking);
+
 struct xen_platform_op {
 	uint32_t cmd;
 	uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -341,6 +357,7 @@ struct xen_platform_op {
 		struct xenpf_set_processor_pminfo set_pminfo;
 		struct xenpf_pcpuinfo          pcpu_info;
 		struct xenpf_cpu_ol            cpu_ol;
+		struct xenpf_core_parking      core_parking;
 		uint8_t                        pad[128];
 	} u;
 };
diff --git a/include/xen/interface/version.h b/include/xen/interface/versio=
n.h
index 7ff6498..96d8d3d 100644
--- a/include/xen/interface/version.h
+++ b/include/xen/interface/version.h
@@ -63,4 +63,19 @@ struct xen_feature_info {
 /* arg =3D=3D xen_domain_handle_t. */
 #define XENVER_guest_handle 8
=20
+/* Check if running on Xen version (major, minor) or later */
+static inline bool
+xen_running_on_version_or_later(unsigned int major, unsigned int minor)
+{
+	unsigned int version;
+
+	if (!xen_domain())
+		return false;
+
+	version =3D HYPERVISOR_xen_version(XENVER_version, NULL);
+	if ((((version >> 16) =3D=3D major) && ((version & 0xffff) >=3D minor)) |=
|
+		((version >> 16) > major))
+		return true;
+	return false;
+}
 #endif /* __XEN_PUBLIC_VERSION_H__ */
--=20
1.7.1

--_002_DE8DF0795D48FD4CA783C40EC829233537B99ESHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
	name="0001-Xen-acpi-pad-implement.patch"
Content-Description: 0001-Xen-acpi-pad-implement.patch
Content-Disposition: attachment;
	filename="0001-Xen-acpi-pad-implement.patch"; size=8743;
	creation-date="Wed, 07 Nov 2012 12:49:11 GMT";
	modification-date="Wed, 07 Nov 2012 20:32:34 GMT"
Content-Transfer-Enco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233537B99ESHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_002_DE8DF0795D48FD4CA783C40EC829233537B99ESHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Wed Nov 07 13:02:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 13:02:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW5Gr-0002Cd-Hv; Wed, 07 Nov 2012 13:02:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TW5Gq-0002CX-J3
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 13:02:16 +0000
Received: from [85.158.139.83:60586] by server-12.bemta-5.messagelabs.com id
	4E/44-02886-7DB5A905; Wed, 07 Nov 2012 13:02:15 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1352293333!28635698!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjI4MjQ5\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2647 invoked from network); 7 Nov 2012 13:02:14 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-13.tower-182.messagelabs.com with SMTP;
	7 Nov 2012 13:02:14 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga101.ch.intel.com with ESMTP; 07 Nov 2012 05:02:13 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,730,1344236400"; 
	d="scan'208,223";a="165488182"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by AZSMGA002.ch.intel.com with ESMTP; 07 Nov 2012 05:02:12 -0800
Received: from fmsmsx119.amr.corp.intel.com (10.18.22.143) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 05:02:12 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	fmsmsx119.amr.corp.intel.com (10.18.22.143) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 05:02:12 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Wed, 7 Nov 2012 21:02:06 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Thread-Topic: [PATCH 2/2] Revert pad config check in xen_check_mwait
Thread-Index: Ac2yq1FN1e+6ZP87QOCrcigNApJpmAKPGhiQ
Date: Wed, 7 Nov 2012 13:02:05 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537B9B8@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC8292335371593@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC8292335371593@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_002_DE8DF0795D48FD4CA783C40EC829233537B9B8SHSMSX101ccrcorpi_"
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 2/2] Revert pad config check in
	xen_check_mwait
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_DE8DF0795D48FD4CA783C40EC829233537B9B8SHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Add xen version check for xen_check_mwait.

Thanks,
Jinsong

=3D=3D=3D=3D=3D=3D=3D=3D=3D

>From b8288c4b8bce46468e5abbb95fae4c9c748bafaa Mon Sep 17 00:00:00 2001
From: Liu, Jinsong <jinsong.liu@intel.com>
Date: Thu, 8 Nov 2012 04:31:11 +0800
Subject: [PATCH 2/2] Revert pad config check in xen_check_mwait

With Xen acpi pad logic added into kernel, we can now revert xen mwait rela=
ted
patch df88b2d96e36d9a9e325bfcd12eb45671cbbc937. The reason is, when running=
 under
newer Xen platform, Xen pad driver would be early loaded, so native pad dri=
ver
would fail to be loaded, and hence no mwait/monitor #UD risk again.

Another point is, only Xen4.2 or later support Xen acpi pad, so we won't ex=
pose
mwait cpuid capability when running under older Xen platform.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 arch/x86/xen/enlighten.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 586d838..548296f 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -287,8 +287,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *b=
x,
=20
 static bool __init xen_check_mwait(void)
 {
-#if defined(CONFIG_ACPI) && !defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR) && =
\
-	!defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR_MODULE)
+#ifdef CONFIG_ACPI
 	struct xen_platform_op op =3D {
 		.cmd			=3D XENPF_set_processor_pminfo,
 		.u.set_pminfo.id	=3D -1,
@@ -309,6 +308,13 @@ static bool __init xen_check_mwait(void)
 	if (!xen_initial_domain())
 		return false;
=20
+	/*
+	 * When running under platform earlier than Xen4.2, do not expose
+	 * mwait, to avoid the risk of loading native acpi pad driver
+	 */
+	if (!xen_running_on_version_or_later(4, 2))
+		return false;
+
 	ax =3D 1;
 	cx =3D 0;
=20
--=20
1.7.1

--_002_DE8DF0795D48FD4CA783C40EC829233537B9B8SHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
	name="0002-Revert-pad-config-check-in-xen_check_mwait.patch"
Content-Description: 0002-Revert-pad-config-check-in-xen_check_mwait.patch
Content-Disposition: attachment;
	filename="0002-Revert-pad-config-check-in-xen_check_mwait.patch"; size=1699;
	creation-date="Wed, 07 Nov 2012 12:49:11 GMT";
	modification-date="Wed, 07 Nov 2012 20:32:34 GMT"
Content-Transfer-Encoding: base64

RnJvbSBiODI4OGM0YjhiY2U0NjQ2OGU1YWJiYjk1ZmFlNGM5Yzc0OGJhZmFhIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBMaXUsIEppbnNvbmcgPGppbnNvbmcubGl1QGludGVsLmNvbT4K
RGF0ZTogVGh1LCA4IE5vdiAyMDEyIDA0OjMxOjExICswODAwClN1YmplY3Q6IFtQQVRDSCAyLzJd
IFJldmVydCBwYWQgY29uZmlnIGNoZWNrIGluIHhlbl9jaGVja19td2FpdAoKV2l0aCBYZW4gYWNw
aSBwYWQgbG9naWMgYWRkZWQgaW50byBrZXJu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qYngsCiAKIHN0YXRpYyBib29sIF9faW5pdCB4ZW5fY2hl
Y2tfbXdhaXQodm9pZCkKIHsKLSNpZiBkZWZpbmVkKENPTkZJR19BQ1BJKSAmJiAhZGVmaW5lZChD
T05GSUdfQUNQSV9QUk9DRVNTT1JfQUdHUkVHQVRPUikgJiYgXAotCSFkZWZpbmVkKENPTkZJR19B
Q1BJX1BST0NFU1NPUl9BR0dSRUdBVE9SX01PRFVMRSkKKyNpZmRlZiBDT05GSUdfQUNQSQogCXN0
cnVjdCB4ZW5fcGxhdGZvcm1fb3Agb3AgPSB7CiAJCS5jbWQJCQk9IFhFTlBGX3NldF9wcm9jZXNz
b3JfcG1pbmZvLAogCQkudS5zZXRfcG1pbmZvLmlkCT0gLTEsCkBAIC0zMDksNiArMzA4LDEzIEBA
IHN0YXRpYyBib29sIF9faW5pdCB4ZW5fY2hlY2tfbXdhaXQodm9pZCkKIAlpZiAoIXhlbl9pbml0
aWFsX2RvbWFpbigpKQogCQlyZXR1cm4gZmFsc2U7CiAKKwkvKgorCSAqIFdoZW4gcnVubmluZyB1
bmRlciBwbGF0Zm9ybSBlYXJsaWVyIHRoYW4gWGVuNC4yLCBkbyBub3QgZXhwb3NlCisJICogbXdh
aXQsIHRvIGF2b2lkIHRoZSByaXNrIG9mIGxvYWRpbmcgbmF0aXZlIGFjcGkgcGFkIGRyaXZlcgor
CSAqLworCWlmICgheGVuX3J1bm5pbmdfb25fdmVyc2lvbl9vcl9sYXRlcig0LCAyKSkKKwkJcmV0
dXJuIGZhbHNlOworCiAJYXggPSAxOwogCWN4ID0gMDsKIAotLSAKMS43LjEKCg==

--_002_DE8DF0795D48FD4CA783C40EC829233537B9B8SHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_002_DE8DF0795D48FD4CA783C40EC829233537B9B8SHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Wed Nov 07 13:02:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 13:02:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW5Gr-0002Cd-Hv; Wed, 07 Nov 2012 13:02:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TW5Gq-0002CX-J3
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 13:02:16 +0000
Received: from [85.158.139.83:60586] by server-12.bemta-5.messagelabs.com id
	4E/44-02886-7DB5A905; Wed, 07 Nov 2012 13:02:15 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1352293333!28635698!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjI4MjQ5\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2647 invoked from network); 7 Nov 2012 13:02:14 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-13.tower-182.messagelabs.com with SMTP;
	7 Nov 2012 13:02:14 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga101.ch.intel.com with ESMTP; 07 Nov 2012 05:02:13 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,730,1344236400"; 
	d="scan'208,223";a="165488182"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by AZSMGA002.ch.intel.com with ESMTP; 07 Nov 2012 05:02:12 -0800
Received: from fmsmsx119.amr.corp.intel.com (10.18.22.143) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 05:02:12 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	fmsmsx119.amr.corp.intel.com (10.18.22.143) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 05:02:12 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Wed, 7 Nov 2012 21:02:06 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Thread-Topic: [PATCH 2/2] Revert pad config check in xen_check_mwait
Thread-Index: Ac2yq1FN1e+6ZP87QOCrcigNApJpmAKPGhiQ
Date: Wed, 7 Nov 2012 13:02:05 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537B9B8@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC8292335371593@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC8292335371593@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_002_DE8DF0795D48FD4CA783C40EC829233537B9B8SHSMSX101ccrcorpi_"
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 2/2] Revert pad config check in
	xen_check_mwait
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_DE8DF0795D48FD4CA783C40EC829233537B9B8SHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Add xen version check for xen_check_mwait.

Thanks,
Jinsong

=3D=3D=3D=3D=3D=3D=3D=3D=3D

>From b8288c4b8bce46468e5abbb95fae4c9c748bafaa Mon Sep 17 00:00:00 2001
From: Liu, Jinsong <jinsong.liu@intel.com>
Date: Thu, 8 Nov 2012 04:31:11 +0800
Subject: [PATCH 2/2] Revert pad config check in xen_check_mwait

With Xen acpi pad logic added into kernel, we can now revert xen mwait rela=
ted
patch df88b2d96e36d9a9e325bfcd12eb45671cbbc937. The reason is, when running=
 under
newer Xen platform, Xen pad driver would be early loaded, so native pad dri=
ver
would fail to be loaded, and hence no mwait/monitor #UD risk again.

Another point is, only Xen4.2 or later support Xen acpi pad, so we won't ex=
pose
mwait cpuid capability when running under older Xen platform.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 arch/x86/xen/enlighten.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 586d838..548296f 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -287,8 +287,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *b=
x,
=20
 static bool __init xen_check_mwait(void)
 {
-#if defined(CONFIG_ACPI) && !defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR) && =
\
-	!defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR_MODULE)
+#ifdef CONFIG_ACPI
 	struct xen_platform_op op =3D {
 		.cmd			=3D XENPF_set_processor_pminfo,
 		.u.set_pminfo.id	=3D -1,
@@ -309,6 +308,13 @@ static bool __init xen_check_mwait(void)
 	if (!xen_initial_domain())
 		return false;
=20
+	/*
+	 * When running under platform earlier than Xen4.2, do not expose
+	 * mwait, to avoid the risk of loading native acpi pad driver
+	 */
+	if (!xen_running_on_version_or_later(4, 2))
+		return false;
+
 	ax =3D 1;
 	cx =3D 0;
=20
--=20
1.7.1

--_002_DE8DF0795D48FD4CA783C40EC829233537B9B8SHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
	name="0002-Revert-pad-config-check-in-xen_check_mwait.patch"
Content-Description: 0002-Revert-pad-config-check-in-xen_check_mwait.patch
Content-Disposition: attachment;
	filename="0002-Revert-pad-config-check-in-xen_check_mwait.patch"; size=1699;
	creation-date="Wed, 07 Nov 2012 12:49:11 GMT";
	modification-date="Wed, 07 Nov 2012 20:32:34 GMT"
Content-Transfer-Encoding: base64

RnJvbSBiODI4OGM0YjhiY2U0NjQ2OGU1YWJiYjk1ZmFlNGM5Yzc0OGJhZmFhIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBMaXUsIEppbnNvbmcgPGppbnNvbmcubGl1QGludGVsLmNvbT4K
RGF0ZTogVGh1LCA4IE5vdiAyMDEyIDA0OjMxOjExICswODAwClN1YmplY3Q6IFtQQVRDSCAyLzJd
IFJldmVydCBwYWQgY29uZmlnIGNoZWNrIGluIHhlbl9jaGVja19td2FpdAoKV2l0aCBYZW4gYWNw
aSBwYWQgbG9naWMgYWRkZWQgaW50byBrZXJuZWwsIHdlIGNhbiBub3cgcmV2ZXJ0IHhlbiBtd2Fp
dCByZWxhdGVkCnBhdGNoIGRmODhiMmQ5NmUzNmQ5YTllMzI1YmZjZDEyZWI0NTY3MWNiYmM5Mzcu
IFRoZSByZWFzb24gaXMsIHdoZW4gcnVubmluZyB1bmRlcg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YgXAotCSFkZWZpbmVkKENPTkZJR19B
Q1BJX1BST0NFU1NPUl9BR0dSRUdBVE9SX01PRFVMRSkKKyNpZmRlZiBDT05GSUdfQUNQSQogCXN0
cnVjdCB4ZW5fcGxhdGZvcm1fb3Agb3AgPSB7CiAJCS5jbWQJCQk9IFhFTlBGX3NldF9wcm9jZXNz
b3JfcG1pbmZvLAogCQkudS5zZXRfcG1pbmZvLmlkCT0gLTEsCkBAIC0zMDksNiArMzA4LDEzIEBA
IHN0YXRpYyBib29sIF9faW5pdCB4ZW5fY2hlY2tfbXdhaXQodm9pZCkKIAlpZiAoIXhlbl9pbml0
aWFsX2RvbWFpbigpKQogCQlyZXR1cm4gZmFsc2U7CiAKKwkvKgorCSAqIFdoZW4gcnVubmluZyB1
bmRlciBwbGF0Zm9ybSBlYXJsaWVyIHRoYW4gWGVuNC4yLCBkbyBub3QgZXhwb3NlCisJICogbXdh
aXQsIHRvIGF2b2lkIHRoZSByaXNrIG9mIGxvYWRpbmcgbmF0aXZlIGFjcGkgcGFkIGRyaXZlcgor
CSAqLworCWlmICgheGVuX3J1bm5pbmdfb25fdmVyc2lvbl9vcl9sYXRlcig0LCAyKSkKKwkJcmV0
dXJuIGZhbHNlOworCiAJYXggPSAxOwogCWN4ID0gMDsKIAotLSAKMS43LjEKCg==

--_002_DE8DF0795D48FD4CA783C40EC829233537B9B8SHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_002_DE8DF0795D48FD4CA783C40EC829233537B9B8SHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Wed Nov 07 13:03:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 13:03:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW5Hi-0002Gq-5H; Wed, 07 Nov 2012 13:03:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TW5Hg-0002Ge-TL
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 13:03:09 +0000
Received: from [85.158.143.35:6103] by server-3.bemta-4.messagelabs.com id
	08/F8-06841-C0C5A905; Wed, 07 Nov 2012 13:03:08 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1352293326!13927577!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODIwMzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10286 invoked from network); 7 Nov 2012 13:02:08 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 13:02:08 -0000
X-IronPort-AV: E=Sophos;i="4.80,730,1344211200"; d="scan'208";a="43771073"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	07 Nov 2012 13:02:06 +0000
Received: from kaball.uk.xensource.com (10.80.2.59) by
	FTLPEX01CL03.citrite.net (10.13.107.80) with Microsoft SMTP Server id
	14.2.318.1; Wed, 7 Nov 2012 08:02:05 -0500
Date: Wed, 7 Nov 2012 13:01:21 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <ian.campbell@citrix.com>
In-Reply-To: <1352285859.12977.45.camel@hastur.hellion.org.uk>
Message-ID: <alpine.DEB.2.02.1211071256190.2689@kaball.uk.xensource.com>
References: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
	<1352239982-17389-3-git-send-email-konrad.wilk@oracle.com>
	<alpine.DEB.2.02.1211070959150.2689@kaball.uk.xensource.com>
	<1352285859.12977.45.camel@hastur.hellion.org.uk>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
X-Originating-IP: [10.80.2.59]
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 2/2] xen/arm: Fix compile errors when
 drivers are compiled as modules.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 7 Nov 2012, Ian Campbell wrote:
> On Wed, 2012-11-07 at 10:25 +0000, Stefano Stabellini wrote:
> > On Tue, 6 Nov 2012, Konrad Rzeszutek Wilk wrote:
> > > We end up with:
> > > 
> > > ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
> > > ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> > > ERROR: "HYPERVISOR_grant_table_op" [drivers/net/xen-netback/xen-netback.ko] undefined!
> > > 
> > > and this patch exports said function (which is implemented in hypercall.S).
> > > 
> > > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > 
> > Thank you very much for going out of your way to fix this issue (I am
> > currently at LinuxCon).
> > 
> > 
> > >  arch/arm/xen/enlighten.c |    5 +++++
> > >  1 files changed, 5 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> > > index 59bcb96..96d969d 100644
> > > --- a/arch/arm/xen/enlighten.c
> > > +++ b/arch/arm/xen/enlighten.c
> > > @@ -166,3 +166,8 @@ void free_xenballooned_pages(int nr_pages, struct page **pages)
> > >  	*pages = NULL;
> > >  }
> > >  EXPORT_SYMBOL_GPL(free_xenballooned_pages);
> > > +
> > > +/* In the hypervisor.S file. */
> > > +EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
> > > +EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
> > > +EXPORT_SYMBOL_GPL(privcmd_call);
> >  
> > I think the patch is OK and I tested it: it fixes the issue reported
> > by Russell.
> > However I am wondering, does it actually make sense only to export 3
> > hypercalls among the set implemented in hypercall.S?
> > Maybe it does make sense only to export a subset, but I wouldn't
> > necessarly do the differentiation here, I would just export all the
> > hypercalls implemented in hypercalls.S.
> > In fact if we separate the hypercalls in two sets, I would like to
> > see a similar differentiation on x86 too.
> 
> On x86 these functions are static inline (all of them, I think) so
> exporting them is not necessary or possible.

What I meant is that on x86 we could move some of the hypercalls out of
hypercall.h.
That would be similar to the split that this patch is introducing.


> I don't think you can export from a .S, otherwise the obvious answer
> would be to integrate it with the macro in hypercall.S.

yeah..


> Possibly mad idea: auto-generate hypercall.[Sc] (.S=stubs & .c=exports)
> from include/xen/interface/xen.h:HYPERVISOR_* ?
> 
> (Aside: the whitespace in hypercall.S is a bit fubarred, wrt the line
> wrapping in the macros)
 
I would leave this idea aside for the moment :)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 13:03:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 13:03:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW5Hi-0002Gq-5H; Wed, 07 Nov 2012 13:03:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TW5Hg-0002Ge-TL
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 13:03:09 +0000
Received: from [85.158.143.35:6103] by server-3.bemta-4.messagelabs.com id
	08/F8-06841-C0C5A905; Wed, 07 Nov 2012 13:03:08 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1352293326!13927577!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODIwMzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10286 invoked from network); 7 Nov 2012 13:02:08 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 13:02:08 -0000
X-IronPort-AV: E=Sophos;i="4.80,730,1344211200"; d="scan'208";a="43771073"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	07 Nov 2012 13:02:06 +0000
Received: from kaball.uk.xensource.com (10.80.2.59) by
	FTLPEX01CL03.citrite.net (10.13.107.80) with Microsoft SMTP Server id
	14.2.318.1; Wed, 7 Nov 2012 08:02:05 -0500
Date: Wed, 7 Nov 2012 13:01:21 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <ian.campbell@citrix.com>
In-Reply-To: <1352285859.12977.45.camel@hastur.hellion.org.uk>
Message-ID: <alpine.DEB.2.02.1211071256190.2689@kaball.uk.xensource.com>
References: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
	<1352239982-17389-3-git-send-email-konrad.wilk@oracle.com>
	<alpine.DEB.2.02.1211070959150.2689@kaball.uk.xensource.com>
	<1352285859.12977.45.camel@hastur.hellion.org.uk>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
X-Originating-IP: [10.80.2.59]
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 2/2] xen/arm: Fix compile errors when
 drivers are compiled as modules.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 7 Nov 2012, Ian Campbell wrote:
> On Wed, 2012-11-07 at 10:25 +0000, Stefano Stabellini wrote:
> > On Tue, 6 Nov 2012, Konrad Rzeszutek Wilk wrote:
> > > We end up with:
> > > 
> > > ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
> > > ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> > > ERROR: "HYPERVISOR_grant_table_op" [drivers/net/xen-netback/xen-netback.ko] undefined!
> > > 
> > > and this patch exports said function (which is implemented in hypercall.S).
> > > 
> > > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > 
> > Thank you very much for going out of your way to fix this issue (I am
> > currently at LinuxCon).
> > 
> > 
> > >  arch/arm/xen/enlighten.c |    5 +++++
> > >  1 files changed, 5 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> > > index 59bcb96..96d969d 100644
> > > --- a/arch/arm/xen/enlighten.c
> > > +++ b/arch/arm/xen/enlighten.c
> > > @@ -166,3 +166,8 @@ void free_xenballooned_pages(int nr_pages, struct page **pages)
> > >  	*pages = NULL;
> > >  }
> > >  EXPORT_SYMBOL_GPL(free_xenballooned_pages);
> > > +
> > > +/* In the hypervisor.S file. */
> > > +EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
> > > +EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
> > > +EXPORT_SYMBOL_GPL(privcmd_call);
> >  
> > I think the patch is OK and I tested it: it fixes the issue reported
> > by Russell.
> > However I am wondering, does it actually make sense only to export 3
> > hypercalls among the set implemented in hypercall.S?
> > Maybe it does make sense only to export a subset, but I wouldn't
> > necessarly do the differentiation here, I would just export all the
> > hypercalls implemented in hypercalls.S.
> > In fact if we separate the hypercalls in two sets, I would like to
> > see a similar differentiation on x86 too.
> 
> On x86 these functions are static inline (all of them, I think) so
> exporting them is not necessary or possible.

What I meant is that on x86 we could move some of the hypercalls out of
hypercall.h.
That would be similar to the split that this patch is introducing.


> I don't think you can export from a .S, otherwise the obvious answer
> would be to integrate it with the macro in hypercall.S.

yeah..


> Possibly mad idea: auto-generate hypercall.[Sc] (.S=stubs & .c=exports)
> from include/xen/interface/xen.h:HYPERVISOR_* ?
> 
> (Aside: the whitespace in hypercall.S is a bit fubarred, wrt the line
> wrapping in the macros)
 
I would leave this idea aside for the moment :)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 13:07:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 13:07:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW5LK-0002VV-Q2; Wed, 07 Nov 2012 13:06:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TW5LI-0002VO-TU
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 13:06:53 +0000
Received: from [85.158.139.211:22391] by server-11.bemta-5.messagelabs.com id
	C3/CB-03409-CEC5A905; Wed, 07 Nov 2012 13:06:52 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1352293610!19196651!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzYyNjkz\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10669 invoked from network); 7 Nov 2012 13:06:51 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-14.tower-206.messagelabs.com with SMTP;
	7 Nov 2012 13:06:51 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 07 Nov 2012 05:06:16 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,730,1344236400"; d="scan'208";a="216294149"
Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37])
	by orsmga001.jf.intel.com with ESMTP; 07 Nov 2012 05:06:49 -0800
Received: from fmsmsx102.amr.corp.intel.com (10.19.9.53) by
	FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 05:06:49 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX102.amr.corp.intel.com (10.19.9.53) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 05:06:49 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Wed, 7 Nov 2012 21:06:47 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Shuah Khan <shuahkhan@gmail.com>
Thread-Topic: [PATCH 1/2] Xen acpi pad implement
Thread-Index: AQHNvEyBXY6qKU083U+UjDldvhm0q5feV85A
Date: Wed, 7 Nov 2012 13:06:46 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537B9E9@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<CAKocOONye3HDcuxOyOLqD=Z=EkESzQb0FNanbUJeyLJJVCDWdw@mail.gmail.com>
In-Reply-To: <CAKocOONye3HDcuxOyOLqD=Z=EkESzQb0FNanbUJeyLJJVCDWdw@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Shuah Khan wrote:
> On Thu, Oct 25, 2012 at 6:19 AM, Liu, Jinsong <jinsong.liu@intel.com>
> wrote: 
>> From f233ad06cf924116693d7d38be9ae9d8c11f8a9b Mon Sep 17 00:00:00
>> 2001 
>> From: Liu, Jinsong <jinsong.liu@intel.com>
>> Date: Fri, 26 Oct 2012 02:32:48 +0800
>> Subject: [PATCH 1/2] Xen acpi pad implement
>> 
>> PAD is acpi Processor Aggregator Device which provides a control
>> point 
>> that enables the platform to perform specific processor configuration
>> and control that applies to all processors in the platform.
>> 
>> This patch is to implement Xen acpi pad logic. When running under Xen
>> virt platform, native pad driver would not work. Instead Xen pad
>> driver, 
>> a self-contained and very thin logic level, would take over acpi pad
>> staff. 
> 
> "logic" instead of staff (guessing this is supposed to stuff)
> 

Yes.

>> When acpi pad notify OSPM, xen pad logic intercept and parse _PUR
>> object 
>> and then hypercall to hyervisor for the rest work, say, core parking.
> hypervisor
> rest of the work? - could you add more details on what is handled by
> this think PAD driver and what would be left to the host pad driver.

OK, add at updated patch.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 13:07:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 13:07:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW5LK-0002VV-Q2; Wed, 07 Nov 2012 13:06:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TW5LI-0002VO-TU
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 13:06:53 +0000
Received: from [85.158.139.211:22391] by server-11.bemta-5.messagelabs.com id
	C3/CB-03409-CEC5A905; Wed, 07 Nov 2012 13:06:52 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1352293610!19196651!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzYyNjkz\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10669 invoked from network); 7 Nov 2012 13:06:51 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-14.tower-206.messagelabs.com with SMTP;
	7 Nov 2012 13:06:51 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 07 Nov 2012 05:06:16 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,730,1344236400"; d="scan'208";a="216294149"
Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37])
	by orsmga001.jf.intel.com with ESMTP; 07 Nov 2012 05:06:49 -0800
Received: from fmsmsx102.amr.corp.intel.com (10.19.9.53) by
	FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 05:06:49 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX102.amr.corp.intel.com (10.19.9.53) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 05:06:49 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Wed, 7 Nov 2012 21:06:47 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Shuah Khan <shuahkhan@gmail.com>
Thread-Topic: [PATCH 1/2] Xen acpi pad implement
Thread-Index: AQHNvEyBXY6qKU083U+UjDldvhm0q5feV85A
Date: Wed, 7 Nov 2012 13:06:46 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537B9E9@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC829233537157F@SHSMSX101.ccr.corp.intel.com>
	<CAKocOONye3HDcuxOyOLqD=Z=EkESzQb0FNanbUJeyLJJVCDWdw@mail.gmail.com>
In-Reply-To: <CAKocOONye3HDcuxOyOLqD=Z=EkESzQb0FNanbUJeyLJJVCDWdw@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Shuah Khan wrote:
> On Thu, Oct 25, 2012 at 6:19 AM, Liu, Jinsong <jinsong.liu@intel.com>
> wrote: 
>> From f233ad06cf924116693d7d38be9ae9d8c11f8a9b Mon Sep 17 00:00:00
>> 2001 
>> From: Liu, Jinsong <jinsong.liu@intel.com>
>> Date: Fri, 26 Oct 2012 02:32:48 +0800
>> Subject: [PATCH 1/2] Xen acpi pad implement
>> 
>> PAD is acpi Processor Aggregator Device which provides a control
>> point 
>> that enables the platform to perform specific processor configuration
>> and control that applies to all processors in the platform.
>> 
>> This patch is to implement Xen acpi pad logic. When running under Xen
>> virt platform, native pad driver would not work. Instead Xen pad
>> driver, 
>> a self-contained and very thin logic level, would take over acpi pad
>> staff. 
> 
> "logic" instead of staff (guessing this is supposed to stuff)
> 

Yes.

>> When acpi pad notify OSPM, xen pad logic intercept and parse _PUR
>> object 
>> and then hypercall to hyervisor for the rest work, say, core parking.
> hypervisor
> rest of the work? - could you add more details on what is handled by
> this think PAD driver and what would be left to the host pad driver.

OK, add at updated patch.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 13:25:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 13:25:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW5cY-0002nX-MO; Wed, 07 Nov 2012 13:24:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>) id 1TW5cX-0002nS-LN
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 13:24:41 +0000
Received: from [85.158.139.83:40579] by server-11.bemta-5.messagelabs.com id
	28/B5-03409-8116A905; Wed, 07 Nov 2012 13:24:40 +0000
X-Env-Sender: ijc@hellion.org.uk
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352294679!28488269!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD,
	ML_RADAR_SPEW_LINKS_22,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5401 invoked from network); 7 Nov 2012 13:24:39 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Nov 2012 13:24:39 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1TW5cV-0005QI-2P; Wed, 07 Nov 2012 13:24:39 +0000
Received: from yog-sothoth.hellion.org.uk ([192.168.1.1] helo=[127.0.0.1])
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1TW5cN-0005jt-Is; Wed, 07 Nov 2012 13:24:38 +0000
Message-ID: <1352294551.12977.61.camel@hastur.hellion.org.uk>
From: Ian Campbell <ijc@hellion.org.uk>
To: Philippe.Simonet@swisscom.com
Date: Wed, 07 Nov 2012 14:22:31 +0100
In-Reply-To: <FF93AF260AC2BB499A119CC65B092CF731516BBA@sg000713.corproot.net>
References: <FF93AF260AC2BB499A119CC65B092CF731516BBA@sg000713.corproot.net>
X-Mailer: Evolution 3.4.3-1 
Mime-Version: 1.0
X-SA-Exim-Connect-IP: 192.168.1.1
X-SA-Exim-Mail-From: ijc@hellion.org.uk
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: 599161@bugs.debian.org, Keir Fraser <keir@xen.org>, mrsanna1@gmail.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-07 at 10:10 +0000, Philippe.Simonet@swisscom.com wrote:
> Hi Ian

Thanks for doing this test.

> i compiled  a patched hypervisor for Mauro, it is running since many
> days and the overflow occured, without clock jumps

So just to be clear you saw this logging occur *without* the 50 minute
jump in time? That's good!

> > (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
> > now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
> > plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
> > tsc_stamp=e3839fcb0273
> 
> (below is the complete xm dmesg output)
> 
> did that help you ? do you need more info ? 

I'll leave this to Keir (who wrote the debugging patch) to answer but it
looks to me like it should be useful!

Thanks again.

Ian.

> thanks and regards
> 
> Philippe
> 
> 
> > -----Original Message-----
> > From: Mauro [mailto:mrsanna1@gmail.com]
> > Sent: Wednesday, November 07, 2012 10:12 AM
> > To: Simonet Philippe, ITS-OUS-OP-IFM-NW-IPE
> > Subject: Re: [Xen-devel] [Xen-users] Re: Xen 4 TSC problems
> > 
> > Hello, no news until now there aren't clock jumps.
> > Here is xm dmesg:
> > 
> > xm dmesg
> > (XEN) Xen version 4.0.1 (Debian 4.0.1-5.4) (ultrotter@debian.org) (gcc
> > version 4.4.5 (Debian 4.4.5-8) ) Mon Oct 29 14:42:12 CET 2012
> > (XEN) Bootloader: GRUB 1.98+20100804-14+squeeze1
> > (XEN) Command line: placeholder dom0_mem=3072M loglvl=warning
> > guest_loglvl=warning
> > (XEN) Video information:
> > (XEN)  VGA is text mode 80x25, font 8x16
> > (XEN)  VBE/DDC methods: V2; EDID transfer time: 2 seconds
> > (XEN) Disc information:
> > (XEN)  Found 2 MBR signatures
> > (XEN)  Found 2 EDD information structures
> > (XEN) Xen-e820 RAM map:
> > (XEN)  0000000000000000 - 000000000009f400 (usable)
> > (XEN)  000000000009f400 - 00000000000a0000 (reserved)
> > (XEN)  00000000000f0000 - 0000000000100000 (reserved)
> > (XEN)  0000000000100000 - 00000000cfd43000 (usable)
> > (XEN)  00000000cfd43000 - 00000000cfd4c000 (ACPI data)
> > (XEN)  00000000cfd4c000 - 00000000cfd4d000 (usable)
> > (XEN)  00000000cfd4d000 - 00000000d0000000 (reserved)
> > (XEN)  00000000e0000000 - 00000000f0000000 (reserved)
> > (XEN)  00000000fec00000 - 00000000fed00000 (reserved)
> > (XEN)  00000000fee00000 - 00000000fee10000 (reserved)
> > (XEN)  00000000ffc00000 - 0000000100000000 (reserved)
> > (XEN)  0000000100000000 - 000000102ffff000 (usable)
> > (XEN) ACPI: RSDP 000F4F20, 0024 (r2 HP    )
> > (XEN) ACPI: XSDT CFD43900, 007C (r1 HP     ProLiant        2         162E)
> > (XEN) ACPI: FACP CFD439C0, 00F4 (r3 HP     ProLiant        2         162E)
> > (XEN) ACPI: DSDT CFD43AC0, 30C9 (r1 HP         DSDT        1 INTL 20030228)
> > (XEN) ACPI: FACS CFD43100, 0040
> > (XEN) ACPI: SPCR CFD43140, 0050 (r1 HP     SPCRRBSU        1         162E)
> > (XEN) ACPI: MCFG CFD431C0, 003C (r1 HP     ProLiant        1             0)
> > (XEN) ACPI: HPET CFD43200, 0038 (r1 HP     ProLiant        2         162E)
> > (XEN) ACPI: FFFF CFD43240, 0064 (r2 HP     P61             2         162E)
> > (XEN) ACPI: SPMI CFD432C0, 0040 (r5 HP     ProLiant        1         162E)
> > (XEN) ACPI: ERST CFD43300, 01D0 (r1 HP     ProLiant        1         162E)
> > (XEN) ACPI: APIC CFD43500, 0176 (r1 HP     ProLiant        2             0)
> > (XEN) ACPI: FFFF CFD43680, 0176 (r1 HP     ProLiant        1         162E)
> > (XEN) ACPI: BERT CFD43800, 0030 (r1 HP     ProLiant        1         162E)
> > (XEN) ACPI: HEST CFD43840, 00BC (r1 HP     ProLiant        1         162E)
> > (XEN) System RAM: 65532MB (67105672kB)
> > (XEN) Domain heap initialised
> > (XEN) Processor #0 6:15 APIC version 20
> > (XEN) Processor #8 6:15 APIC version 20
> > (XEN) Processor #16 6:15 APIC version 20
> > (XEN) Processor #24 6:15 APIC version 20
> > (XEN) Processor #1 6:15 APIC version 20
> > (XEN) Processor #9 6:15 APIC version 20
> > (XEN) Processor #17 6:15 APIC version 20
> > (XEN) Processor #25 6:15 APIC version 20
> > (XEN) Processor #2 6:15 APIC version 20
> > (XEN) Processor #10 6:15 APIC version 20
> > (XEN) Processor #18 6:15 APIC version 20
> > (XEN) Processor #26 6:15 APIC version 20
> > (XEN) Processor #3 6:15 APIC version 20
> > (XEN) Processor #11 6:15 APIC version 20
> > (XEN) Processor #19 6:15 APIC version 20
> > (XEN) Processor #27 6:15 APIC version 20
> > (XEN) IOAPIC[0]: apic_id 1, version 32, address 0xfec00000, GSI 0-23
> > (XEN) IOAPIC[1]: apic_id 2, version 32, address 0xfec80000, GSI 24-47
> > (XEN) IOAPIC[2]: apic_id 3, version 32, address 0xfec81000, GSI 48-71
> > (XEN) IOAPIC[3]: apic_id 4, version 32, address 0xfec81800, GSI 72-95
> > (XEN) Enabling APIC mode:  Phys.  Using 4 I/O APICs
> > (XEN) Using scheduler: SMP Credit Scheduler (credit)
> > (XEN) Detected 2400.128 MHz processor.
> > (XEN) Initing memory sharing.
> > (XEN) VMX: Supported advanced features:
> > (XEN)  - APIC MMIO access virtualisation
> > (XEN)  - APIC TPR shadow
> > (XEN)  - Virtual NMI
> > (XEN)  - MSR direct-access bitmap
> > (XEN) HVM: ASIDs disabled.
> > (XEN) HVM: VMX enabled
> > (XEN) I/O virtualisation disabled
> > (XEN) Total of 16 processors activated.
> > (XEN) ENABLING IO-APIC IRQs
> > (XEN)  -> Using new ACK method
> > (XEN) checking TSC synchronization across 16 CPUs:
> > (XEN) CPU#14 had 3 usecs TSC skew, fixed it up.
> > (XEN) Platform timer is 14.318MHz HPET
> > (XEN) Allocated console ring of 32 KiB.
> > (XEN) Brought up 16 CPUs
> > (XEN) *** LOADING DOMAIN 0 ***
> > (XEN)  Xen  kernel: 64-bit, lsb, compat32
> > (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x1708000
> > (XEN) PHYSICAL MEMORY ARRANGEMENT:
> > (XEN)  Dom0 alloc.:   000000083c000000->0000000840000000 (770048 pages
> > to be allocated)
> > (XEN) VIRTUAL MEMORY ARRANGEMENT:
> > (XEN)  Loaded kernel: ffffffff81000000->ffffffff81708000
> > (XEN)  Init. ramdisk: ffffffff81708000->ffffffff81efb000
> > (XEN)  Phys-Mach map: ffffffff81efb000->ffffffff824fb000
> > (XEN)  Start info:    ffffffff824fb000->ffffffff824fb4b4
> > (XEN)  Page tables:   ffffffff824fc000->ffffffff82513000
> > (XEN)  Boot stack:    ffffffff82513000->ffffffff82514000
> > (XEN)  TOTAL:         ffffffff80000000->ffffffff82800000
> > (XEN)  ENTRY ADDRESS: ffffffff81531200
> > (XEN) Dom0 has maximum 16 VCPUs
> > (XEN) Scrubbing Free RAM:
> > .....................................................................................................................
> > .....................................................................................................................
> > .....................................................................................................................
> > .....................................................................................................................
> > .....................................................................................................................
> > ................................done.
> > (XEN) Xen trace buffers: disabled
> > (XEN) Std. Loglevel: Errors and warnings
> > (XEN) Guest Loglevel: Errors and warnings
> > (XEN) Xen is relinquishing VGA console.
> > (XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to
> > Xen)
> > (XEN) Freed 176kB init memory.
> > (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
> > now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
> > plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
> > tsc_stamp=e3839fcb0273
> > 
> > 
> 
> 
> 
> 
> 
> > -----Original Message-----
> > From: xen-devel-bounces@lists.xen.org [mailto:xen-devel-
> > bounces@lists.xen.org] On Behalf Of Ian Campbell
> > Sent: Friday, October 26, 2012 3:00 PM
> > To: xen-devel@lists.xen.org
> > Cc: 599161@bugs.debian.org
> > Subject: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
> > minutes" bug.
> > 
> > Hi all,
> > 
> > I've BCC'd a number of people who have reported seeing this bug at various
> > times in the past.
> > 
> > If you can still repro I'd appreciate it if you could give the patch in
> > http://marc.info/?l=xen-devel&m=135049062216685&w=2 (also attached) a
> > go and report back success/failure and the output of the debugging
> > messages produced.
> > 
> > Thanks,
> > Ian.
> > 
> > --
> > Ian Campbell
> > Current Noise: Death - Evil Dead
> > 
> > Executive ability is prominent in your make-up.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 13:25:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 13:25:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW5cY-0002nX-MO; Wed, 07 Nov 2012 13:24:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>) id 1TW5cX-0002nS-LN
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 13:24:41 +0000
Received: from [85.158.139.83:40579] by server-11.bemta-5.messagelabs.com id
	28/B5-03409-8116A905; Wed, 07 Nov 2012 13:24:40 +0000
X-Env-Sender: ijc@hellion.org.uk
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352294679!28488269!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD,
	ML_RADAR_SPEW_LINKS_22,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5401 invoked from network); 7 Nov 2012 13:24:39 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Nov 2012 13:24:39 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1TW5cV-0005QI-2P; Wed, 07 Nov 2012 13:24:39 +0000
Received: from yog-sothoth.hellion.org.uk ([192.168.1.1] helo=[127.0.0.1])
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1TW5cN-0005jt-Is; Wed, 07 Nov 2012 13:24:38 +0000
Message-ID: <1352294551.12977.61.camel@hastur.hellion.org.uk>
From: Ian Campbell <ijc@hellion.org.uk>
To: Philippe.Simonet@swisscom.com
Date: Wed, 07 Nov 2012 14:22:31 +0100
In-Reply-To: <FF93AF260AC2BB499A119CC65B092CF731516BBA@sg000713.corproot.net>
References: <FF93AF260AC2BB499A119CC65B092CF731516BBA@sg000713.corproot.net>
X-Mailer: Evolution 3.4.3-1 
Mime-Version: 1.0
X-SA-Exim-Connect-IP: 192.168.1.1
X-SA-Exim-Mail-From: ijc@hellion.org.uk
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: 599161@bugs.debian.org, Keir Fraser <keir@xen.org>, mrsanna1@gmail.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-07 at 10:10 +0000, Philippe.Simonet@swisscom.com wrote:
> Hi Ian

Thanks for doing this test.

> i compiled  a patched hypervisor for Mauro, it is running since many
> days and the overflow occured, without clock jumps

So just to be clear you saw this logging occur *without* the 50 minute
jump in time? That's good!

> > (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
> > now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
> > plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
> > tsc_stamp=e3839fcb0273
> 
> (below is the complete xm dmesg output)
> 
> did that help you ? do you need more info ? 

I'll leave this to Keir (who wrote the debugging patch) to answer but it
looks to me like it should be useful!

Thanks again.

Ian.

> thanks and regards
> 
> Philippe
> 
> 
> > -----Original Message-----
> > From: Mauro [mailto:mrsanna1@gmail.com]
> > Sent: Wednesday, November 07, 2012 10:12 AM
> > To: Simonet Philippe, ITS-OUS-OP-IFM-NW-IPE
> > Subject: Re: [Xen-devel] [Xen-users] Re: Xen 4 TSC problems
> > 
> > Hello, no news until now there aren't clock jumps.
> > Here is xm dmesg:
> > 
> > xm dmesg
> > (XEN) Xen version 4.0.1 (Debian 4.0.1-5.4) (ultrotter@debian.org) (gcc
> > version 4.4.5 (Debian 4.4.5-8) ) Mon Oct 29 14:42:12 CET 2012
> > (XEN) Bootloader: GRUB 1.98+20100804-14+squeeze1
> > (XEN) Command line: placeholder dom0_mem=3072M loglvl=warning
> > guest_loglvl=warning
> > (XEN) Video information:
> > (XEN)  VGA is text mode 80x25, font 8x16
> > (XEN)  VBE/DDC methods: V2; EDID transfer time: 2 seconds
> > (XEN) Disc information:
> > (XEN)  Found 2 MBR signatures
> > (XEN)  Found 2 EDD information structures
> > (XEN) Xen-e820 RAM map:
> > (XEN)  0000000000000000 - 000000000009f400 (usable)
> > (XEN)  000000000009f400 - 00000000000a0000 (reserved)
> > (XEN)  00000000000f0000 - 0000000000100000 (reserved)
> > (XEN)  0000000000100000 - 00000000cfd43000 (usable)
> > (XEN)  00000000cfd43000 - 00000000cfd4c000 (ACPI data)
> > (XEN)  00000000cfd4c000 - 00000000cfd4d000 (usable)
> > (XEN)  00000000cfd4d000 - 00000000d0000000 (reserved)
> > (XEN)  00000000e0000000 - 00000000f0000000 (reserved)
> > (XEN)  00000000fec00000 - 00000000fed00000 (reserved)
> > (XEN)  00000000fee00000 - 00000000fee10000 (reserved)
> > (XEN)  00000000ffc00000 - 0000000100000000 (reserved)
> > (XEN)  0000000100000000 - 000000102ffff000 (usable)
> > (XEN) ACPI: RSDP 000F4F20, 0024 (r2 HP    )
> > (XEN) ACPI: XSDT CFD43900, 007C (r1 HP     ProLiant        2         162E)
> > (XEN) ACPI: FACP CFD439C0, 00F4 (r3 HP     ProLiant        2         162E)
> > (XEN) ACPI: DSDT CFD43AC0, 30C9 (r1 HP         DSDT        1 INTL 20030228)
> > (XEN) ACPI: FACS CFD43100, 0040
> > (XEN) ACPI: SPCR CFD43140, 0050 (r1 HP     SPCRRBSU        1         162E)
> > (XEN) ACPI: MCFG CFD431C0, 003C (r1 HP     ProLiant        1             0)
> > (XEN) ACPI: HPET CFD43200, 0038 (r1 HP     ProLiant        2         162E)
> > (XEN) ACPI: FFFF CFD43240, 0064 (r2 HP     P61             2         162E)
> > (XEN) ACPI: SPMI CFD432C0, 0040 (r5 HP     ProLiant        1         162E)
> > (XEN) ACPI: ERST CFD43300, 01D0 (r1 HP     ProLiant        1         162E)
> > (XEN) ACPI: APIC CFD43500, 0176 (r1 HP     ProLiant        2             0)
> > (XEN) ACPI: FFFF CFD43680, 0176 (r1 HP     ProLiant        1         162E)
> > (XEN) ACPI: BERT CFD43800, 0030 (r1 HP     ProLiant        1         162E)
> > (XEN) ACPI: HEST CFD43840, 00BC (r1 HP     ProLiant        1         162E)
> > (XEN) System RAM: 65532MB (67105672kB)
> > (XEN) Domain heap initialised
> > (XEN) Processor #0 6:15 APIC version 20
> > (XEN) Processor #8 6:15 APIC version 20
> > (XEN) Processor #16 6:15 APIC version 20
> > (XEN) Processor #24 6:15 APIC version 20
> > (XEN) Processor #1 6:15 APIC version 20
> > (XEN) Processor #9 6:15 APIC version 20
> > (XEN) Processor #17 6:15 APIC version 20
> > (XEN) Processor #25 6:15 APIC version 20
> > (XEN) Processor #2 6:15 APIC version 20
> > (XEN) Processor #10 6:15 APIC version 20
> > (XEN) Processor #18 6:15 APIC version 20
> > (XEN) Processor #26 6:15 APIC version 20
> > (XEN) Processor #3 6:15 APIC version 20
> > (XEN) Processor #11 6:15 APIC version 20
> > (XEN) Processor #19 6:15 APIC version 20
> > (XEN) Processor #27 6:15 APIC version 20
> > (XEN) IOAPIC[0]: apic_id 1, version 32, address 0xfec00000, GSI 0-23
> > (XEN) IOAPIC[1]: apic_id 2, version 32, address 0xfec80000, GSI 24-47
> > (XEN) IOAPIC[2]: apic_id 3, version 32, address 0xfec81000, GSI 48-71
> > (XEN) IOAPIC[3]: apic_id 4, version 32, address 0xfec81800, GSI 72-95
> > (XEN) Enabling APIC mode:  Phys.  Using 4 I/O APICs
> > (XEN) Using scheduler: SMP Credit Scheduler (credit)
> > (XEN) Detected 2400.128 MHz processor.
> > (XEN) Initing memory sharing.
> > (XEN) VMX: Supported advanced features:
> > (XEN)  - APIC MMIO access virtualisation
> > (XEN)  - APIC TPR shadow
> > (XEN)  - Virtual NMI
> > (XEN)  - MSR direct-access bitmap
> > (XEN) HVM: ASIDs disabled.
> > (XEN) HVM: VMX enabled
> > (XEN) I/O virtualisation disabled
> > (XEN) Total of 16 processors activated.
> > (XEN) ENABLING IO-APIC IRQs
> > (XEN)  -> Using new ACK method
> > (XEN) checking TSC synchronization across 16 CPUs:
> > (XEN) CPU#14 had 3 usecs TSC skew, fixed it up.
> > (XEN) Platform timer is 14.318MHz HPET
> > (XEN) Allocated console ring of 32 KiB.
> > (XEN) Brought up 16 CPUs
> > (XEN) *** LOADING DOMAIN 0 ***
> > (XEN)  Xen  kernel: 64-bit, lsb, compat32
> > (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x1708000
> > (XEN) PHYSICAL MEMORY ARRANGEMENT:
> > (XEN)  Dom0 alloc.:   000000083c000000->0000000840000000 (770048 pages
> > to be allocated)
> > (XEN) VIRTUAL MEMORY ARRANGEMENT:
> > (XEN)  Loaded kernel: ffffffff81000000->ffffffff81708000
> > (XEN)  Init. ramdisk: ffffffff81708000->ffffffff81efb000
> > (XEN)  Phys-Mach map: ffffffff81efb000->ffffffff824fb000
> > (XEN)  Start info:    ffffffff824fb000->ffffffff824fb4b4
> > (XEN)  Page tables:   ffffffff824fc000->ffffffff82513000
> > (XEN)  Boot stack:    ffffffff82513000->ffffffff82514000
> > (XEN)  TOTAL:         ffffffff80000000->ffffffff82800000
> > (XEN)  ENTRY ADDRESS: ffffffff81531200
> > (XEN) Dom0 has maximum 16 VCPUs
> > (XEN) Scrubbing Free RAM:
> > .....................................................................................................................
> > .....................................................................................................................
> > .....................................................................................................................
> > .....................................................................................................................
> > .....................................................................................................................
> > ................................done.
> > (XEN) Xen trace buffers: disabled
> > (XEN) Std. Loglevel: Errors and warnings
> > (XEN) Guest Loglevel: Errors and warnings
> > (XEN) Xen is relinquishing VGA console.
> > (XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to
> > Xen)
> > (XEN) Freed 176kB init memory.
> > (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
> > now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
> > plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
> > tsc_stamp=e3839fcb0273
> > 
> > 
> 
> 
> 
> 
> 
> > -----Original Message-----
> > From: xen-devel-bounces@lists.xen.org [mailto:xen-devel-
> > bounces@lists.xen.org] On Behalf Of Ian Campbell
> > Sent: Friday, October 26, 2012 3:00 PM
> > To: xen-devel@lists.xen.org
> > Cc: 599161@bugs.debian.org
> > Subject: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
> > minutes" bug.
> > 
> > Hi all,
> > 
> > I've BCC'd a number of people who have reported seeing this bug at various
> > times in the past.
> > 
> > If you can still repro I'd appreciate it if you could give the patch in
> > http://marc.info/?l=xen-devel&m=135049062216685&w=2 (also attached) a
> > go and report back success/failure and the output of the debugging
> > messages produced.
> > 
> > Thanks,
> > Ian.
> > 
> > --
> > Ian Campbell
> > Current Noise: Death - Evil Dead
> > 
> > Executive ability is prominent in your make-up.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 13:45:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 13:45:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW5wC-0002yv-Hf; Wed, 07 Nov 2012 13:45:00 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TW5wA-0002yq-K4
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 13:44:58 +0000
Received: from [193.109.254.147:49438] by server-6.bemta-14.messagelabs.com id
	47/68-08829-9D56A905; Wed, 07 Nov 2012 13:44:57 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1352295895!8800336!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQ3MzM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9741 invoked from network); 7 Nov 2012 13:44:57 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 13:44:57 -0000
X-IronPort-AV: E=Sophos;i="4.80,730,1344211200"; d="scan'208";a="213727938"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 13:44:55 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 7 Nov 2012 08:44:55 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TW5w6-0001Zs-Lh;
	Wed, 07 Nov 2012 13:44:54 +0000
Message-ID: <509A65D6.6050505@citrix.com>
Date: Wed, 7 Nov 2012 13:44:54 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Dan Magenheimer <dan.magenheimer@oracle.com>
References: <20121106202816.GA29655@aepfle.de>
	<CCBF2785.442DA%keir.xen@gmail.com>
	<20121106221806.GA1813@aepfle.de> <50999ACF.4040106@citrix.com>
	<721bf725-662f-41cb-a1a3-7c908e05c188@default>
In-Reply-To: <721bf725-662f-41cb-a1a3-7c908e05c188@default>
X-Enigmail-Version: 1.4.5
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 06/11/12 23:41, Dan Magenheimer wrote:
>> From: Andrew Cooper [mailto:andrew.cooper3@citrix.com]
>> Sent: Tuesday, November 06, 2012 4:19 PM
>> To: xen-devel@lists.xen.org
>> Subject: Re: [Xen-devel] reliable live migration of large and busy guests
>>
>> As potential food for thought:
>>
>> Is there wisdom in having a new kind of live migrate which, when pausing
>> the VM on the source host, resumes the VM on the destination host.  Xen
>> would have to track not-yet-sent pages and pause the guest on pagefault,
>> and request the required page as a matter of priority.
>>
>> The advantages of this approach would be that a timing sensitive
>> workloads would be paused for far less time.  Even if it was frequently
>> being paused for pagefaults, the time to get a single page over the LAN
>> would be far quicker than the entire dirty set, at which point on
>> resume, the interrupt paths would fire again; The timing paths would
>> quickly become fully populated.  Further to that, a busy workload in the
>> guest dirtying a page which has already been sent will not result in any
>> further network traffic.
> Something like this?
>
> http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.184.2368 

Oh wow - something quite like that.  Thankyou very much.  I will read
the paper in full when I get a free moment, but the abstract looks very
interesting.

>From an idealistic point of view, it might be quite nice to have several
live migrate mechanisms, so the user can choose whether they value
minimum downtime, minimum network utilisation, or maximum safety.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 13:45:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 13:45:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW5wC-0002yv-Hf; Wed, 07 Nov 2012 13:45:00 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TW5wA-0002yq-K4
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 13:44:58 +0000
Received: from [193.109.254.147:49438] by server-6.bemta-14.messagelabs.com id
	47/68-08829-9D56A905; Wed, 07 Nov 2012 13:44:57 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1352295895!8800336!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQ3MzM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9741 invoked from network); 7 Nov 2012 13:44:57 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 13:44:57 -0000
X-IronPort-AV: E=Sophos;i="4.80,730,1344211200"; d="scan'208";a="213727938"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 13:44:55 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 7 Nov 2012 08:44:55 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TW5w6-0001Zs-Lh;
	Wed, 07 Nov 2012 13:44:54 +0000
Message-ID: <509A65D6.6050505@citrix.com>
Date: Wed, 7 Nov 2012 13:44:54 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Dan Magenheimer <dan.magenheimer@oracle.com>
References: <20121106202816.GA29655@aepfle.de>
	<CCBF2785.442DA%keir.xen@gmail.com>
	<20121106221806.GA1813@aepfle.de> <50999ACF.4040106@citrix.com>
	<721bf725-662f-41cb-a1a3-7c908e05c188@default>
In-Reply-To: <721bf725-662f-41cb-a1a3-7c908e05c188@default>
X-Enigmail-Version: 1.4.5
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 06/11/12 23:41, Dan Magenheimer wrote:
>> From: Andrew Cooper [mailto:andrew.cooper3@citrix.com]
>> Sent: Tuesday, November 06, 2012 4:19 PM
>> To: xen-devel@lists.xen.org
>> Subject: Re: [Xen-devel] reliable live migration of large and busy guests
>>
>> As potential food for thought:
>>
>> Is there wisdom in having a new kind of live migrate which, when pausing
>> the VM on the source host, resumes the VM on the destination host.  Xen
>> would have to track not-yet-sent pages and pause the guest on pagefault,
>> and request the required page as a matter of priority.
>>
>> The advantages of this approach would be that a timing sensitive
>> workloads would be paused for far less time.  Even if it was frequently
>> being paused for pagefaults, the time to get a single page over the LAN
>> would be far quicker than the entire dirty set, at which point on
>> resume, the interrupt paths would fire again; The timing paths would
>> quickly become fully populated.  Further to that, a busy workload in the
>> guest dirtying a page which has already been sent will not result in any
>> further network traffic.
> Something like this?
>
> http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.184.2368 

Oh wow - something quite like that.  Thankyou very much.  I will read
the paper in full when I get a free moment, but the abstract looks very
interesting.

>From an idealistic point of view, it might be quite nice to have several
live migrate mechanisms, so the user can choose whether they value
minimum downtime, minimum network utilisation, or maximum safety.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 14:06:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 14:06:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW6Gz-0003JA-KY; Wed, 07 Nov 2012 14:06:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TW6Gy-0003J5-Fs
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 14:06:28 +0000
Received: from [85.158.138.51:38864] by server-14.bemta-3.messagelabs.com id
	1A/F3-12788-3EA6A905; Wed, 07 Nov 2012 14:06:27 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-15.tower-174.messagelabs.com!1352297184!27175980!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27816 invoked from network); 7 Nov 2012 14:06:26 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-15.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 7 Nov 2012 14:06:26 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.156766539;
	Wed, 07 Nov 2012 09:05:26 -0500
Message-ID: <509A6AA6.2000208@jhuapl.edu>
Date: Wed, 07 Nov 2012 09:05:26 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121106193921.GC28473@phenom.dumpdata.com>
In-Reply-To: <20121106193921.GC28473@phenom.dumpdata.com>
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	"key@linux.vnet.ibm.com" <key@linux.vnet.ibm.com>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
	driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1318582037495756032=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============1318582037495756032==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms090304070505020605000709"

This is a cryptographically signed message in MIME format.

--------------ms090304070505020605000709
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/06/2012 02:39 PM, Konrad Rzeszutek Wilk wrote:
> On Mon, Nov 05, 2012 at 10:09:57AM -0500, Matthew Fioravante wrote:
>> This patch ports the xen vtpm frontend driver for linux
>> from the linux-2.6.18-xen.hg tree to linux-stable.
> So how does on test it ? Set it up? Use it? Is there some documentation=

> about it - if so it should be in the patch description.
Thats actually a question I had. To use this driver now you have to use=20
my vtpm mini-os domains which are currently being evaluated in the=20
xen-devel mailing list. Once they are accepted I will submit a=20
documentation update to the Xen tree.

Whats the best practice for documentation in this case? All in xen? Some =

linux/some xen? If the latter, how much goes in linux and where?
>
> I did a very very cursory look at it, see some of the comments.
>
>>
>> +
>> +
>> +static inline struct transmission *transmission_alloc(void)
>> +{
>> +     return kzalloc(sizeof(struct transmission), GFP_ATOMIC);
>> +}
>> +
>> +     static unsigned char *
>
> That is very weird tabbing? Did you run this patch through
> scripts/checkpatch.pl ?
Wow thats ugly. I ran the check script and it looks like it didn't pick=20
this up. For some reason my editor wants to autoindent like that.
Fixed.
>
>> +
>> +static const struct file_operations vtpm_ops =3D {
>> +     .owner =3D THIS_MODULE,
>> +     .llseek =3D no_llseek,
>> +     .open =3D tpm_open,
>> +     .read =3D tpm_read,
>> +     .write =3D tpm_write,
>> +     .release =3D tpm_release,
>> +};
>> +
>> +static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
>> +static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
>> +static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);
>> +static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL);
>> +static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL);
>> +static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivat=
ed,
>> +             NULL);
>> +static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL);
>> +static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel)=
;
>> +
>> +static struct attribute *vtpm_attrs[] =3D {
>> +     &dev_attr_pubek.attr,
>> +     &dev_attr_pcrs.attr,
>> +     &dev_attr_enabled.attr,
>> +     &dev_attr_active.attr,
>> +     &dev_attr_owned.attr,
>> +     &dev_attr_temp_deactivated.attr,
>> +     &dev_attr_caps.attr,
>> +     &dev_attr_cancel.attr,
>> +     NULL,
> So are these going to show up in SysFS? If so, there should also be
> a corresponding file in Documentation/.../sysfs/something.
These are similar to the entries made by the other tpm drivers. I don't=20
see any documentation about those either. TPM maintainers, any guidance=20
there?
>
>> +#include "tpm.h"
>> +#include "tpm_vtpm.h"
>> +
>> +#undef DEBUG
>> +
>> +#define GRANT_INVALID_REF 0
> Interesting. The 0 grant value is actually a valid one. I think you
> want (-1ULL).
Is it?
drivers/block/xen-blkfront.c and
drivers/net/xen-netfront.c

do the exact same thing
>> +
>> +     init_tpm_xenbus();
>> +     return 0;
>> +}
>> +
>> +
>> +module_init(tpmif_init);
> no module_exit?
Will fix



--------------ms090304070505020605000709
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLz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EVjcuMQMCBLAwDQYJKoZIhvcNAQEFBQADgYEAJO9HQh4YNChVLzuZqK5ARJARD8JoujGZ
fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEwNzE0MDUyNlowIwYJKoZIhvcNAQkEMRYEFHdMkvadKJyn6YMR
x0DY9ptWYUDMMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYBNC0Nqasgx9YOHcyVfJpp3/MvXowpiPeXf
hVU22sUXmVAv0NLbdXWcjnrPyg/jgK2SyoPhTanMCEswHJ+0zNWnaF2mt0PM79pVu3iW8bxW
ETHXLDbhHYn4VTYlP5g5ogMhhpFXqGwWSpbuNAoH6C5ITckRbv9Tew+v2PCrMIQ7QAAAAAAA
AA==
--------------ms090304070505020605000709--


--===============1318582037495756032==
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.xen.org
http://lists.xen.org/xen-devel

--===============1318582037495756032==--


From xen-devel-bounces@lists.xen.org Wed Nov 07 14:06:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 14:06:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW6Gz-0003JA-KY; Wed, 07 Nov 2012 14:06:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TW6Gy-0003J5-Fs
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 14:06:28 +0000
Received: from [85.158.138.51:38864] by server-14.bemta-3.messagelabs.com id
	1A/F3-12788-3EA6A905; Wed, 07 Nov 2012 14:06:27 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-15.tower-174.messagelabs.com!1352297184!27175980!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27816 invoked from network); 7 Nov 2012 14:06:26 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-15.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 7 Nov 2012 14:06:26 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.156766539;
	Wed, 07 Nov 2012 09:05:26 -0500
Message-ID: <509A6AA6.2000208@jhuapl.edu>
Date: Wed, 07 Nov 2012 09:05:26 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121106193921.GC28473@phenom.dumpdata.com>
In-Reply-To: <20121106193921.GC28473@phenom.dumpdata.com>
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	"key@linux.vnet.ibm.com" <key@linux.vnet.ibm.com>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
	driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1318582037495756032=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============1318582037495756032==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms090304070505020605000709"

This is a cryptographically signed message in MIME format.

--------------ms090304070505020605000709
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/06/2012 02:39 PM, Konrad Rzeszutek Wilk wrote:
> On Mon, Nov 05, 2012 at 10:09:57AM -0500, Matthew Fioravante wrote:
>> This patch ports the xen vtpm frontend driver for linux
>> from the linux-2.6.18-xen.hg tree to linux-stable.
> So how does on test it ? Set it up? Use it? Is there some documentation=

> about it - if so it should be in the patch description.
Thats actually a question I had. To use this driver now you have to use=20
my vtpm mini-os domains which are currently being evaluated in the=20
xen-devel mailing list. Once they are accepted I will submit a=20
documentation update to the Xen tree.

Whats the best practice for documentation in this case? All in xen? Some =

linux/some xen? If the latter, how much goes in linux and where?
>
> I did a very very cursory look at it, see some of the comments.
>
>>
>> +
>> +
>> +static inline struct transmission *transmission_alloc(void)
>> +{
>> +     return kzalloc(sizeof(struct transmission), GFP_ATOMIC);
>> +}
>> +
>> +     static unsigned char *
>
> That is very weird tabbing? Did you run this patch through
> scripts/checkpatch.pl ?
Wow thats ugly. I ran the check script and it looks like it didn't pick=20
this up. For some reason my editor wants to autoindent like that.
Fixed.
>
>> +
>> +static const struct file_operations vtpm_ops =3D {
>> +     .owner =3D THIS_MODULE,
>> +     .llseek =3D no_llseek,
>> +     .open =3D tpm_open,
>> +     .read =3D tpm_read,
>> +     .write =3D tpm_write,
>> +     .release =3D tpm_release,
>> +};
>> +
>> +static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
>> +static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
>> +static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);
>> +static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL);
>> +static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL);
>> +static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivat=
ed,
>> +             NULL);
>> +static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL);
>> +static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel)=
;
>> +
>> +static struct attribute *vtpm_attrs[] =3D {
>> +     &dev_attr_pubek.attr,
>> +     &dev_attr_pcrs.attr,
>> +     &dev_attr_enabled.attr,
>> +     &dev_attr_active.attr,
>> +     &dev_attr_owned.attr,
>> +     &dev_attr_temp_deactivated.attr,
>> +     &dev_attr_caps.attr,
>> +     &dev_attr_cancel.attr,
>> +     NULL,
> So are these going to show up in SysFS? If so, there should also be
> a corresponding file in Documentation/.../sysfs/something.
These are similar to the entries made by the other tpm drivers. I don't=20
see any documentation about those either. TPM maintainers, any guidance=20
there?
>
>> +#include "tpm.h"
>> +#include "tpm_vtpm.h"
>> +
>> +#undef DEBUG
>> +
>> +#define GRANT_INVALID_REF 0
> Interesting. The 0 grant value is actually a valid one. I think you
> want (-1ULL).
Is it?
drivers/block/xen-blkfront.c and
drivers/net/xen-netfront.c

do the exact same thing
>> +
>> +     init_tpm_xenbus();
>> +     return 0;
>> +}
>> +
>> +
>> +module_init(tpmif_init);
> no module_exit?
Will fix



--------------ms090304070505020605000709
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwN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kiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYBNC0Nqasgx9YOHcyVfJpp3/MvXowpiPeXf
hVU22sUXmVAv0NLbdXWcjnrPyg/jgK2SyoPhTanMCEswHJ+0zNWnaF2mt0PM79pVu3iW8bxW
ETHXLDbhHYn4VTYlP5g5ogMhhpFXqGwWSpbuNAoH6C5ITckRbv9Tew+v2PCrMIQ7QAAAAAAA
AA==
--------------ms090304070505020605000709--


--===============1318582037495756032==
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.xen.org
http://lists.xen.org/xen-devel

--===============1318582037495756032==--


From xen-devel-bounces@lists.xen.org Wed Nov 07 14:14:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 14:14:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW6Oo-0003Uu-P4; Wed, 07 Nov 2012 14:14:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TW6On-0003Up-GQ
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 14:14:33 +0000
Received: from [193.109.254.147:36224] by server-1.bemta-14.messagelabs.com id
	D0/05-25314-8CC6A905; Wed, 07 Nov 2012 14:14:32 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-13.tower-27.messagelabs.com!1352297585!9948324!1
X-Originating-IP: [81.169.146.178]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3OCA9PiAyNTE2Mw==\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3OCA9PiAyNTE2Mw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19168 invoked from network); 7 Nov 2012 14:13:06 -0000
Received: from mo-p04-ob.rzone.de (HELO mo-p04-ob.rzone.de) (81.169.146.178)
	by server-13.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 7 Nov 2012 14:13:06 -0000
X-RZG-CLASS-ID: mo04
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmxtMZ80VwmRNV67U=
Received: from probook.site (ip-80-226-24-1.vodafone-net.de [80.226.24.1])
	by smtp.strato.de (joses mo48) (RZmta 31.1 SBL|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id R0100eoA7D23HT ;
	Wed, 7 Nov 2012 15:13:04 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 7BCDB189BB; Wed,  7 Nov 2012 15:13:02 +0100 (CET)
Date: Wed, 7 Nov 2012 15:13:02 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121107141302.GA24950@aepfle.de>
References: <20121106202816.GA29655@aepfle.de>
	<CCBF2785.442DA%keir.xen@gmail.com>
	<20121106221806.GA1813@aepfle.de> <50999ACF.4040106@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50999ACF.4040106@citrix.com>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 06, Andrew Cooper wrote:

> Is there wisdom in having a new kind of live migrate which, when pausing
> the VM on the source host, resumes the VM on the destination host.  Xen
> would have to track not-yet-sent pages and pause the guest on pagefault,
> and request the required page as a matter of priority.

On the receiving side all missing pages could be handled as "paged"
(just nominating a missing pfn should be enough). A pager can then
request them from the sender host.

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 14:14:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 14:14:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW6Oo-0003Uu-P4; Wed, 07 Nov 2012 14:14:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TW6On-0003Up-GQ
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 14:14:33 +0000
Received: from [193.109.254.147:36224] by server-1.bemta-14.messagelabs.com id
	D0/05-25314-8CC6A905; Wed, 07 Nov 2012 14:14:32 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-13.tower-27.messagelabs.com!1352297585!9948324!1
X-Originating-IP: [81.169.146.178]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3OCA9PiAyNTE2Mw==\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3OCA9PiAyNTE2Mw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19168 invoked from network); 7 Nov 2012 14:13:06 -0000
Received: from mo-p04-ob.rzone.de (HELO mo-p04-ob.rzone.de) (81.169.146.178)
	by server-13.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 7 Nov 2012 14:13:06 -0000
X-RZG-CLASS-ID: mo04
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmxtMZ80VwmRNV67U=
Received: from probook.site (ip-80-226-24-1.vodafone-net.de [80.226.24.1])
	by smtp.strato.de (joses mo48) (RZmta 31.1 SBL|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id R0100eoA7D23HT ;
	Wed, 7 Nov 2012 15:13:04 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 7BCDB189BB; Wed,  7 Nov 2012 15:13:02 +0100 (CET)
Date: Wed, 7 Nov 2012 15:13:02 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121107141302.GA24950@aepfle.de>
References: <20121106202816.GA29655@aepfle.de>
	<CCBF2785.442DA%keir.xen@gmail.com>
	<20121106221806.GA1813@aepfle.de> <50999ACF.4040106@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50999ACF.4040106@citrix.com>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 06, Andrew Cooper wrote:

> Is there wisdom in having a new kind of live migrate which, when pausing
> the VM on the source host, resumes the VM on the destination host.  Xen
> would have to track not-yet-sent pages and pause the guest on pagefault,
> and request the required page as a matter of priority.

On the receiving side all missing pages could be handled as "paged"
(just nominating a missing pfn should be enough). A pager can then
request them from the sender host.

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 14:25:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 14:25:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW6Z9-0003l2-2E; Wed, 07 Nov 2012 14:25:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TW6Z6-0003ku-Nv
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 14:25:13 +0000
Received: from [85.158.138.51:64404] by server-9.bemta-3.messagelabs.com id
	C0/86-02388-74F6A905; Wed, 07 Nov 2012 14:25:11 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1352298309!21053628!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzE5NjA5\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5094 invoked from network); 7 Nov 2012 14:25:10 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-6.tower-174.messagelabs.com with SMTP;
	7 Nov 2012 14:25:10 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga101.jf.intel.com with ESMTP; 07 Nov 2012 06:25:09 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,730,1344236400"; d="scan'208";a="238543678"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by orsmga002.jf.intel.com with ESMTP; 07 Nov 2012 06:25:07 -0800
Received: from fmsmsx153.amr.corp.intel.com (10.19.17.7) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 06:25:07 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX153.amr.corp.intel.com (10.19.17.7) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 06:25:06 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Wed, 7 Nov 2012 22:25:05 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Campbell <ian.campbell@citrix.com>
Thread-Topic: [Xen-devel] [PATCH] Handle broken page with regard to migration
Thread-Index: AQHNvLm5wo0CS0uWQ02/ywhb/M0oqpfebPDw
Date: Wed, 7 Nov 2012 14:25:04 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537BA4E@SHSMSX101.ccr.corp.intel.com>
References: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
	<1352273413.12977.27.camel@hastur.hellion.org.uk>
In-Reply-To: <1352273413.12977.27.camel@hastur.hellion.org.uk>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_002_DE8DF0795D48FD4CA783C40EC829233537BA4ESHSMSX101ccrcorpi_"
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] Handle broken page with regard to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_DE8DF0795D48FD4CA783C40EC829233537BA4ESHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Ian Campbell wrote:
>> At the target
>>   it would set p2m as p2m_ram_broken for broken page, so that if
>>   guest access the broken page again, it would kill itself as
>> expected.=20
>=20
> Can you add a few words here about why this is preferable to just
> ignoring the issue and populating a regular page non-broken page on
> the target? I think I know why but it would be useful to be explicit
> in the changelog.
>=20
> I also spotted a typo:
>> +                     * vMCE occur during migration +              =20
>> * +                     *   At sender, it marks broken page to dirty
>> bitmap, +                     *   so that at copypages stage of
>> migration, brokan=20
>=20
>                                                                    =20
> broken=20
>=20
> Ian.

OK, add some comments and correct typo.

Thanks,
Jinsong

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Handle broken page with regard to migration

Generally, there are 2 cases:
1. broken page occurs before migration
2. broken page occurs during migration

At the sender
  For case 1, the broken page would be mapped but not copied to target
  (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number would be transferred to target
  so that target take appropriate action.

  For case 2, mce handler marks the broken page to dirty bitmap, so that
  at copypages stage of migration, its pfn_type and pfn number would be
  transferred to target and then take appropriate action.

At the target
  When migration target would populate pages for guest. As for the case
  of broken page wrt migration, we prefer keep the corresponding page,
  for the sake of seamless migration.

  At target it would set p2m as p2m_ram_broken for broken page. Guest MCE
  may have good chance to handle its broken page, while if guest access
  the broken page again it would kill itself as expected.

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

diff -r d675797494bd tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/tools/libxc/xc_domain.c	Thu Nov 08 05:07:20 2012 +0800
@@ -283,6 +283,22 @@
     return ret;
 }
=20
+/* set broken page p2m */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn)
+{
+    int ret;
+    DECLARE_DOMCTL;
+
+    domctl.cmd =3D XEN_DOMCTL_set_broken_page_p2m;
+    domctl.domain =3D (domid_t)domid;
+    domctl.u.set_broken_page_p2m.pfn =3D pfn;
+    ret =3D do_domctl(xch, &domctl);
+
+    return ret ? -1 : 0;
+}
+
 /* get info from hvm guest for save */
 int xc_domain_hvm_getcontext(xc_interface *xch,
                              uint32_t domid,
diff -r d675797494bd tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/tools/libxc/xc_domain_restore.c	Thu Nov 08 05:07:20 2012 +0800
@@ -962,9 +962,15 @@
=20
     countpages =3D count;
     for (i =3D oldcount; i < buf->nr_pages; ++i)
-        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) =3D=3D XEN_D=
OMCTL_PFINFO_XTAB
-            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) =3D=3D XEN=
_DOMCTL_PFINFO_XALLOC)
+    {
+        unsigned long pagetype;
+
+        pagetype =3D buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
+        if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTAB ||
+             pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN ||
+             pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )
             --countpages;
+    }
=20
     if (!countpages)
         return count;
@@ -1200,6 +1206,17 @@
             /* a bogus/unmapped/allocate-only page: skip it */
             continue;
=20
+        if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN )
+        {
+            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
+            {
+                ERROR("Set p2m for broken page failed, "
+                      "dom=3D%d, pfn=3D%lx\n", dom, pfn);
+                goto err_mapped;
+            }
+            continue;
+        }
+
         if (pfn_err[i])
         {
             ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_=
mfn %lx",
diff -r d675797494bd tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/tools/libxc/xc_domain_save.c	Thu Nov 08 05:07:20 2012 +0800
@@ -1277,6 +1277,13 @@
                 if ( !hvm )
                     gmfn =3D pfn_to_mfn(gmfn);
=20
+                if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_BROKEN )
+                {
+                    pfn_type[j] |=3D pfn_batch[j];
+                    ++run;
+                    continue;
+                }
+
                 if ( pfn_err[j] )
                 {
                     if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_XTAB )
@@ -1371,8 +1378,12 @@
                     }
                 }
=20
-                /* skip pages that aren't present or are alloc-only */
+                /*
+                 * skip pages that aren't present,
+                 * or are broken, or are alloc-only
+                 */
                 if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTAB
+                    || pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN
                     || pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )
                     continue;
=20
diff -r d675797494bd tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Fri Nov 02 11:08:37 2012 +0800
+++ b/tools/libxc/xenctrl.h	Thu Nov 08 05:07:20 2012 +0800
@@ -575,6 +575,17 @@
                           xc_domaininfo_t *info);
=20
 /**
+ * This function set p2m for broken page
+ * &parm xch a handle to an open hypervisor interface
+ * @parm domid the domain id which broken page belong to
+ * @parm pfn the pfn number of the broken page
+ * @return 0 on success, -1 on failure
+ */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn);
+
+/**
  * This function returns information about the context of a hvm domain
  * @parm xch a handle to an open hypervisor interface
  * @parm domid the domain to get information from
diff -r d675797494bd xen/arch/x86/cpu/mcheck/mcaction.c
--- a/xen/arch/x86/cpu/mcheck/mcaction.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Thu Nov 08 05:07:20 2012 +0800
@@ -1,5 +1,6 @@
 #include <xen/types.h>
 #include <xen/sched.h>
+#include <asm/p2m.h>
 #include "mcaction.h"
 #include "vmce.h"
 #include "mce.h"
@@ -91,6 +92,24 @@
                     goto vmce_failed;
                 }
=20
+                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram &&
+                     paging_mode_log_dirty(d) )
+                {
+                    /*
+                     * vMCE occur during migration
+                     *
+                     *   At sender, it marks broken page to dirty bitmap,
+                     *   so that at copypages stage of migration, broken
+                     *   page's pfn_type and pfn number would be transferr=
ed
+                     *   to target and then take appropriate action.
+                     *
+                     *   At target, it would set p2m as p2m_ram_broken for
+                     *   broken page, so that if guest access the broken p=
age
+                     *   again, it would kill itself as expected.
+                     */
+                    paging_mark_dirty(d, mfn);
+                }
+
                 if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
                 {
                     printk("Unmap broken memory %lx for DOM%d failed\n",
diff -r d675797494bd xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/xen/arch/x86/domctl.c	Thu Nov 08 05:07:20 2012 +0800
@@ -209,12 +209,18 @@
                 for ( j =3D 0; j < k; j++ )
                 {
                     unsigned long type =3D 0;
+                    p2m_type_t t;
=20
-                    page =3D get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC)=
;
+                    page =3D get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
=20
                     if ( unlikely(!page) ||
                          unlikely(is_xen_heap_page(page)) )
-                        type =3D XEN_DOMCTL_PFINFO_XTAB;
+                    {
+                        if ( p2m_is_broken(t) )
+                            type =3D XEN_DOMCTL_PFINFO_BROKEN;
+                        else
+                            type =3D XEN_DOMCTL_PFINFO_XTAB;
+                    }
                     else
                     {
                         switch( page->u.inuse.type_info & PGT_type_mask )
@@ -235,6 +241,9 @@
=20
                         if ( page->u.inuse.type_info & PGT_pinned )
                             type |=3D XEN_DOMCTL_PFINFO_LPINTAB;
+
+                        if ( page->count_info & PGC_broken )
+                            type =3D XEN_DOMCTL_PFINFO_BROKEN;
                     }
=20
                     if ( page )
@@ -1568,6 +1577,29 @@
     }
     break;
=20
+    case XEN_DOMCTL_set_broken_page_p2m:
+    {
+        struct domain *d;
+       =20
+        d =3D rcu_lock_domain_by_id(domctl->domain);
+        if ( d !=3D NULL )
+        {
+            p2m_type_t pt;
+            unsigned long pfn =3D domctl->u.set_broken_page_p2m.pfn;
+            mfn_t mfn =3D get_gfn_query(d, pfn, &pt);
+
+            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
+                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) !=3D=
 pt)) )
+                ret =3D -EINVAL;
+
+            put_gfn(d, pfn);
+            rcu_unlock_domain(d);
+        }
+        else
+            ret =3D -ESRCH;
+    }
+    break;
+
     default:
         ret =3D iommu_do_domctl(domctl, u_domctl);
         break;
diff -r d675797494bd xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Fri Nov 02 11:08:37 2012 +0800
+++ b/xen/include/public/domctl.h	Thu Nov 08 05:07:20 2012 +0800
@@ -136,6 +136,7 @@
 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
 #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
 #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
+#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
 #define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
=20
@@ -835,6 +836,12 @@
 typedef struct xen_domctl_set_access_required xen_domctl_set_access_requir=
ed_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
=20
+struct xen_domctl_set_broken_page_p2m {
+    uint64_aligned_t pfn;
+};
+typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p=
2m_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -900,6 +907,7 @@
 #define XEN_DOMCTL_set_access_required           64
 #define XEN_DOMCTL_audit_p2m                     65
 #define XEN_DOMCTL_set_virq_handler              66
+#define XEN_DOMCTL_set_broken_page_p2m           67
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -955,6 +963,7 @@
         struct xen_domctl_audit_p2m         audit_p2m;
         struct xen_domctl_set_virq_handler  set_virq_handler;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
+        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
         uint8_t                             pad[128];=

--_002_DE8DF0795D48FD4CA783C40EC829233537BA4ESHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
	name="handle_broken_page_wrt_migration.patch"
Content-Description: handle_broken_page_wrt_migration.patch
Content-Disposition: attachment;
	filename="handle_broken_page_wrt_migration.patch"; size=10643;
	creation-date="Wed, 07 Nov 2012 14:20:54 GMT";
	modification-date="Wed, 07 Nov 2012 22:09:14 GMT"
Content-Transfer-Encoding: base64

SGFuZGxlIGJyb2tlbiBwYWdlIHdpdGggcmVnYXJkIHRvIG1pZ3JhdGlvbgoKR2VuZXJhbGx5LCB0
aGVyZSBhcmUgMiBjYXNlczoKMS4gYnJva2VuIHBhZ2Ugb2NjdXJzIGJlZm9yZSBtaWdyYXRpb24K
Mi4gYnJva2VuIHBhZ2Ugb2NjdXJzIGR1cmluZyBtaWdyYXRpb24KCkF0IHRoZSBzZW5kZXIKICBG
b3IgY2FzZSAxLCB0aGUgYnJva2VuIHBhZ2Ugd291bGQgYmUgbWFwcGVkIGJ1dCBub3QgY29waWVk
IHRvIHRhcmdldAogIChvdGhlcndpc2UgaXQgbWF5IHRyaWdnZXIgbW9yZSBzZXJpb3VzIGVycm9y
LCBzYXksIFNSQVIgZXJyb3IpLgogIFdoaWxlIGl0cyBwZm5fdHlwZSBhbmQgcGZuIG51bWJlciB3
b3VsZCBiZSB0cmFuc2ZlcnJlZCB0byB0YXJnZXQKICBzbyB0aGF0IHRhcmdldCB0YWtlIGFwcHJv
cHJpYXRlIGFjdGlvbi4KCiAgRm9yIGNhc2UgMiwgbWNlIGhhbmRsZXIgbWFya3MgdGhlIGJyb2tl
biBwYWdlIHRvIGRpcnR5IGJpdG1hcCwgc28gdGhhdAogIGF0IGNvcHlwYWdlcyBzd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KKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg
ICAgICBFUlJPUigiU2V0IHAybSBmb3IgYnJva2VuIHBhZ2UgZmFpbGVkLCAiCisgICAgICAgICAg
ICAgICAgICAgICAgImRvbT0lZCwgcGZuPSVseFxuIiwgZG9tLCBwZm4pOworICAgICAgICAgICAg
ICAgIGdvdG8gZXJyX21hcHBlZDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNvbnRpbnVl
OworICAgICAgICB9CisKICAgICAgICAgaWYgKHBmbl9lcnJbaV0pCiAgICAgICAgIHsKICAgICAg
ICAgICAgIEVSUk9SKCJ1bmV4cGVjdGVkIFBGTiBtYXBwaW5nIGZhaWx1cmUgcGZuICVseCBtYXBf
bWZuICVseCBwMm1fbWZuICVseCIsCmRpZmYgLXIgZDY3NTc5NzQ5NGJkIHRvb2xzL2xpYnhjL3hj
X2RvbWFpbl9zYXZlLmMKLS0tIGEvdG9vbHMvbGlieGMveGNfZG9tYWluX3NhdmUuYwlGcmkgTm92
IDAyIDExOjA4OjM3IDIwMTIgKzA4MDAKKysrIGIvdG9vbHMvbGlieGMveGNfZG9tYWluX3NhdmUu
YwlUaHUgTm92IDA4IDA1OjA3OjIwIDIwMTIgKzA4MDAKQEAgLTEyNzcsNiArMTI3NywxMyBAQAog
ICAgICAgICAgICAgICAgIGlmICggIWh2bSApCiAgICAgICAgICAgICAgICAgICAgIGdtZm4gPSBw
Zm5fdG9fbWZuKGdtZm4pOwogCisgICAgICAgICAgICAgICAgaWYgKCBwZm5fdHlwZVtqXSA9PSBY
RU5fRE9NQ1RMX1BGSU5GT19CUk9LRU4gKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg
ICAgICAgICAgcGZuX3R5cGVbal0gfD0gcGZuX2JhdGNoW2pdOworICAgICAgICAgICAgICAgICAg
ICArK3J1bjsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAg
fQorCiAgICAgICAgICAgICAgICAgaWYgKCBwZm5fZXJyW2pdICkKICAgICAgICAgICAgICAgICB7
CiAgICAgICAgICAgICAgICAgICAgIGlmICggcGZuX3R5cGVbal0gPT0gWEVOX0RPTUNUTF9QRklO
Rk9fWFRBQiApCkBAIC0xMzcxLDggKzEzNzgsMTIgQEAKICAgICAgICAgICAgICAgICAgICAgfQog
ICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIC8qIHNraXAgcGFnZXMgdGhhdCBh
cmVuJ3QgcHJlc2VudCBvciBhcmUgYWxsb2Mtb25seSAqLworICAgICAgICAgICAgICAgIC8qCisg
ICAgICAgICAgICAgICAgICogc2tpcCBwYWdlcyB0aGF0IGFyZW4ndCBwcmVzZW50LAorICAgICAg
ICAgICAgICAgICAqIG9yIGFyZSBicm9rZW4sIG9yIGFyZSBhbGxvYy1vbmx5CisgICAgICAgICAg
ICAgICAgICovCiAgICAgICAgICAgICAgICAgaWYgKCBwYWdldHlwZSA9PSBYRU5fRE9NQ1RMX1BG
SU5GT19YVEFCCisgICAgICAgICAgICAgICAgICAgIHx8IHBhZ2V0eXBlID09IFhFTl9ET01DVExf
UEZJTkZPX0JST0tFTgogICAgICAgICAgICAgICAgICAgICB8fCBwYWdldHlwZSA9PSBYRU5fRE9N
Q1RMX1BGSU5GT19YQUxMT0MgKQogICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKIApkaWZm
IC1yIGQ2NzU3OTc0OTRiZCB0b29scy9saWJ4Yy94ZW5jdHJsLmgKLS0tIGEvdG9vbHMvbGlieGMv
eGVuY3RybC5oCUZyaSBOb3YgMDIgMTE6MDg6MzcgMjAxMiArMDgwMAorKysgYi90b29scy9saWJ4
Yy94ZW5jdHJsLmgJVGh1IE5vdiAwOCAwNTowNzoyMCAyMDEyICswODAwCkBAIC01NzUsNiArNTc1
LDE3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgIHhjX2RvbWFpbmluZm9fdCAqaW5mbyk7
CiAKIC8qKgorICogVGhpcyBmdW5jdGlv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eGVuL3NjaGVkLmg+CisjaW5jbHVkZSA8
YXNtL3AybS5oPgogI2luY2x1ZGUgIm1jYWN0aW9uLmgiCiAjaW5jbHVkZSAidm1jZS5oIgogI2lu
Y2x1ZGUgIm1jZS5oIgpAQCAtOTEsNiArOTIsMjQgQEAKICAgICAgICAgICAgICAgICAgICAgZ290
byB2bWNlX2ZhaWxlZDsKICAgICAgICAgICAgICAgICB9CiAKKyAgICAgICAgICAgICAgICBpZiAo
IGlzX2h2bV9kb21haW4oZCkgJiYgIWQtPmFyY2guaHZtX2RvbWFpbi5kaXJ0eV92cmFtICYmCisg
ICAgICAgICAgICAgICAgICAgICBwYWdpbmdfbW9kZV9sb2dfZGlydHkoZCkgKQorICAgICAgICAg
ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICog
dk1DRSBvY2N1ciBkdXJpbmcgbWlncmF0aW9uCisgICAgICAgICAgICAgICAgICAgICAqCisgICAg
ICAgICAgICAgICAgICAgICAqICAgQXQgc2VuZGVyLCBpdCBtYXJrcyBicm9rZW4gcGFnZSB0byBk
aXJ0eSBiaXRtYXAsCisgICAgICAgICAgICAgICAgICAgICAqICAgc28gdGhhdCBhdCBjb3B5cGFn
ZXMgc3RhZ2Ugb2YgbWlncmF0aW9uLCBicm9rZW4KKyAgICAgICAgICAgICAgICAgICAgICogICBw
YWdlJ3MgcGZuX3R5cGUgYW5kIHBmbiBudW1iZXIgd291bGQgYmUgdHJhbnNmZXJyZWQKKyAgICAg
ICAgICAgICAgICAgICAgICogICB0byB0YXJnZXQgYW5kIHRoZW4gdGFrZSBhcHByb3ByaWF0ZSBh
Y3Rpb24uCisgICAgICAgICAgICAgICAgICAgICAqCisgICAgICAgICAgICAgICAgICAgICAqICAg
QXQgdGFyZ2V0LCBpdCB3b3VsZCBzZXQgcDJtIGFzIHAybV9yYW1fYnJva2VuIGZvcgorICAgICAg
ICAgICAgICAgICAgICAgKiAgIGJyb2tlbiBwYWdlLCBzbyB0aGF0IGlmIGd1ZXN0IGFjY2VzcyB0
aGUgYnJva2VuIHBhZ2UKKyAgICAgICAgICAgICAgICAgICAgICogICBhZ2FpbiwgaXQgd291bGQg
a2lsbCBpdHNlbGYgYXMgZXhwZWN0ZWQuCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAg
ICAgICAgICAgICAgICBwYWdpbmdfbWFya19kaXJ0eShkLCBtZm4pOworICAgICAgICAgICAgICAg
IH0KKwogICAgICAgICAgICAgICAgIGlmICggdW5tbWFwX2Jyb2tlbl9wYWdlKGQsIF9tZm4obWZu
KSwgZ2ZuKSApCiAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICBwcmludGso
IlVubWFwIGJyb2tlbiBtZW1vcnkgJWx4IGZvciBET00lZCBmYWlsZWRcbiIsCmRpZmYgLXIgZDY3
NTc5NzQ5NGJkIHhlbi9hcmNoL3g4Ni9kb21jdGwuYwotLS0gYS94ZW4vYXJjaC94ODYvZG9tY3Rs
LmMJRnJpIE5vdiAwMiAxMTowODozNyAyMDEyICswODAwCisrKyBiL3hlbi9hcmNoL3g4Ni9kb21j
dGwuYwlUaHUgTm92IDA4IDA1OjA3OjIwIDIwMTIgKzA4MDAKQEAgLTIwOSwxMiArMjA5LDE4IEBA
CiAgICAgICAgICAgICAgICAgZm9yICggaiA9IDA7IGogPCBrOyBqKysgKQogICAgICAgICAgICAg
ICAgIHsKICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB0eXBlID0gMDsKKyAgICAg
ICAgICAgICAgICAgICAgcDJtX3R5cGVfdCB0OwogCi0gICAgICAgICAgICAgICAgICAgIHBhZ2Ug
PSBnZXRfcGFnZV9mcm9tX2dmbihkLCBhcnJbal0sIE5VTEwsIFAyTV9BTExPQyk7CisgICAgICAg
ICAgICAgICAgICAgIHBhZ2UgPSBnZXRfcGFnZV9mcm9tX2dmbihkLCBhcnJbal0sICZ0LCBQMk1f
QUxMT0MpOwogCiAgICAgICAgICAgICAgICAgICAgIGlmICggdW5saWtlbHkoIXBhZ2UpIHx8CiAg
ICAgICAgICAgICAgICAgICAgICAgICAgdW5saWtlbHkoaXNfeGVuX2hlYXBfcGFnZShwYWdlKSkg
KQotICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9IFhFTl9ET01DVExfUEZJTkZPX1hUQUI7
CisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICggcDJt
X2lzX2Jyb2tlbih0KSApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9IFhFTl9E
T01DVExfUEZJTkZPX0JST0tFTjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg
ICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gWEVOX0RPTUNUTF9QRklORk9fWFRBQjsKKyAg
ICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAg
ICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCggcGFnZS0+dS5pbnVz
ZS50eXBlX2luZm8gJiBQR1RfdHlwZV9tYXNrICkKQEAgLTIzNSw2ICsyNDEsOSBAQAogCiAgICAg
ICAgICAgICAgICAgICAgICAgICBpZiAoIHBhZ2UtPnUuaW51c2UudHlwZV9pbmZvICYgUEdUX3Bp
bm5lZCApCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSB8PSBYRU5fRE9NQ1RMX1BG
SU5GT19MUElOVEFCOworCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIHBhZ2UtPmNvdW50
X2luZm8gJiBQR0NfYnJva2VuICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0g
WEVOX0RPTUNUTF9QRklORk9fQlJPS0VOOwogICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAg
ICAgICAgICAgICAgICAgaWYgKCBwYWdlICkKQEAgLTE1NjgsNiArMTU3NywyOSBAQAogICAgIH0K
ICAgICBicmVhazsKIAorICAgIGNhc2UgWEVOX0RPTUNUTF9zZXRfYnJva2VuX3BhZ2VfcDJtOgor
ICAgIHsKKyAgICAgICAgc3RydWN0IGRvbWFpbiAqZDsKKyAgICAgICAgCisgICAgICAgIGQgPSBy
Y3VfbG9ja19kb21haW5fYnlfaWQoZG9tY3RsLT5kb21haW4pOworICAgICAgICBpZiAoIGQgIT0g
TlVMTCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHAybV90eXBlX3QgcHQ7CisgICAgICAgICAg
ICB1bnNpZ25lZCBsb25nIHBmbiA9IGRvbWN0bC0+dS5zZXRfYnJva2VuX3BhZ2VfcDJtLnBmbjsK
KyAgICAgICAgICAgIG1mbl90IG1mbiA9IGdldF9nZm5fcXVlcnkoZCwgcGZuLCAmcHQpOworCisg
ICAgICAgICAgICBpZiAoIHVubGlrZWx5KCFtZm5fdmFsaWQobWZuX3gobWZuKSkgfHwgIXAybV9p
c19yYW0ocHQpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgKHAybV9jaGFuZ2VfdHlwZShk
LCBwZm4sIHB0LCBwMm1fcmFtX2Jyb2tlbikgIT0gcHQpKSApCisgICAgICAgICAgICAgICAgcmV0
ID0gLUVJTlZBTDsKKworICAgICAgICAgICAgcHV0X2dmbihkLCBwZm4pOworICAgICAgICAgICAg
cmN1X3VubG9ja19kb21haW4oZCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAg
ICAgcmV0ID0gLUVTUkNIOworICAgIH0KKyAgICBicmVhazsKKwogICAgIGRlZmF1bHQ6CiAgICAg
ICAgIHJldCA9IGlvbW11X2RvX2RvbWN0bChkb21jdGwsIHVfZG9tY3RsKTsKICAgICAgICAgYnJl
YWs7CmRpZmYgLXIgZDY3NTc5NzQ5NGJkIHhlbi9pbmNsdWRlL3B1YmxpYy9kb21jdGwuaAotLS0g
YS94ZW4vaW5jbHVkZS9wdWJsaWMvZG9tY3RsLmgJ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ICAgICAgICAgc3RydWN0IHhlbl9kb21jdGxfZ2Ri
c3hfcGF1c2V1bnBfdmNwdSBnZGJzeF9wYXVzZXVucF92Y3B1OwogICAgICAgICBzdHJ1Y3QgeGVu
X2RvbWN0bF9nZGJzeF9kb21zdGF0dXMgICBnZGJzeF9kb21zdGF0dXM7CiAgICAgICAgIHVpbnQ4
X3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZFsxMjhdOwo=

--_002_DE8DF0795D48FD4CA783C40EC829233537BA4ESHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_002_DE8DF0795D48FD4CA783C40EC829233537BA4ESHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Wed Nov 07 14:25:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 14:25:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW6Z9-0003l2-2E; Wed, 07 Nov 2012 14:25:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TW6Z6-0003ku-Nv
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 14:25:13 +0000
Received: from [85.158.138.51:64404] by server-9.bemta-3.messagelabs.com id
	C0/86-02388-74F6A905; Wed, 07 Nov 2012 14:25:11 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1352298309!21053628!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzE5NjA5\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5094 invoked from network); 7 Nov 2012 14:25:10 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-6.tower-174.messagelabs.com with SMTP;
	7 Nov 2012 14:25:10 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga101.jf.intel.com with ESMTP; 07 Nov 2012 06:25:09 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,730,1344236400"; d="scan'208";a="238543678"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by orsmga002.jf.intel.com with ESMTP; 07 Nov 2012 06:25:07 -0800
Received: from fmsmsx153.amr.corp.intel.com (10.19.17.7) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 06:25:07 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX153.amr.corp.intel.com (10.19.17.7) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 06:25:06 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Wed, 7 Nov 2012 22:25:05 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Campbell <ian.campbell@citrix.com>
Thread-Topic: [Xen-devel] [PATCH] Handle broken page with regard to migration
Thread-Index: AQHNvLm5wo0CS0uWQ02/ywhb/M0oqpfebPDw
Date: Wed, 7 Nov 2012 14:25:04 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537BA4E@SHSMSX101.ccr.corp.intel.com>
References: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
	<1352273413.12977.27.camel@hastur.hellion.org.uk>
In-Reply-To: <1352273413.12977.27.camel@hastur.hellion.org.uk>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_002_DE8DF0795D48FD4CA783C40EC829233537BA4ESHSMSX101ccrcorpi_"
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] Handle broken page with regard to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_DE8DF0795D48FD4CA783C40EC829233537BA4ESHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Ian Campbell wrote:
>> At the target
>>   it would set p2m as p2m_ram_broken for broken page, so that if
>>   guest access the broken page again, it would kill itself as
>> expected.=20
>=20
> Can you add a few words here about why this is preferable to just
> ignoring the issue and populating a regular page non-broken page on
> the target? I think I know why but it would be useful to be explicit
> in the changelog.
>=20
> I also spotted a typo:
>> +                     * vMCE occur during migration +              =20
>> * +                     *   At sender, it marks broken page to dirty
>> bitmap, +                     *   so that at copypages stage of
>> migration, brokan=20
>=20
>                                                                    =20
> broken=20
>=20
> Ian.

OK, add some comments and correct typo.

Thanks,
Jinsong

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Handle broken page with regard to migration

Generally, there are 2 cases:
1. broken page occurs before migration
2. broken page occurs during migration

At the sender
  For case 1, the broken page would be mapped but not copied to target
  (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number would be transferred to target
  so that target take appropriate action.

  For case 2, mce handler marks the broken page to dirty bitmap, so that
  at copypages stage of migration, its pfn_type and pfn number would be
  transferred to target and then take appropriate action.

At the target
  When migration target would populate pages for guest. As for the case
  of broken page wrt migration, we prefer keep the corresponding page,
  for the sake of seamless migration.

  At target it would set p2m as p2m_ram_broken for broken page. Guest MCE
  may have good chance to handle its broken page, while if guest access
  the broken page again it would kill itself as expected.

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

diff -r d675797494bd tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/tools/libxc/xc_domain.c	Thu Nov 08 05:07:20 2012 +0800
@@ -283,6 +283,22 @@
     return ret;
 }
=20
+/* set broken page p2m */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn)
+{
+    int ret;
+    DECLARE_DOMCTL;
+
+    domctl.cmd =3D XEN_DOMCTL_set_broken_page_p2m;
+    domctl.domain =3D (domid_t)domid;
+    domctl.u.set_broken_page_p2m.pfn =3D pfn;
+    ret =3D do_domctl(xch, &domctl);
+
+    return ret ? -1 : 0;
+}
+
 /* get info from hvm guest for save */
 int xc_domain_hvm_getcontext(xc_interface *xch,
                              uint32_t domid,
diff -r d675797494bd tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/tools/libxc/xc_domain_restore.c	Thu Nov 08 05:07:20 2012 +0800
@@ -962,9 +962,15 @@
=20
     countpages =3D count;
     for (i =3D oldcount; i < buf->nr_pages; ++i)
-        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) =3D=3D XEN_D=
OMCTL_PFINFO_XTAB
-            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) =3D=3D XEN=
_DOMCTL_PFINFO_XALLOC)
+    {
+        unsigned long pagetype;
+
+        pagetype =3D buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
+        if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTAB ||
+             pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN ||
+             pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )
             --countpages;
+    }
=20
     if (!countpages)
         return count;
@@ -1200,6 +1206,17 @@
             /* a bogus/unmapped/allocate-only page: skip it */
             continue;
=20
+        if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN )
+        {
+            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
+            {
+                ERROR("Set p2m for broken page failed, "
+                      "dom=3D%d, pfn=3D%lx\n", dom, pfn);
+                goto err_mapped;
+            }
+            continue;
+        }
+
         if (pfn_err[i])
         {
             ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_=
mfn %lx",
diff -r d675797494bd tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/tools/libxc/xc_domain_save.c	Thu Nov 08 05:07:20 2012 +0800
@@ -1277,6 +1277,13 @@
                 if ( !hvm )
                     gmfn =3D pfn_to_mfn(gmfn);
=20
+                if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_BROKEN )
+                {
+                    pfn_type[j] |=3D pfn_batch[j];
+                    ++run;
+                    continue;
+                }
+
                 if ( pfn_err[j] )
                 {
                     if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_XTAB )
@@ -1371,8 +1378,12 @@
                     }
                 }
=20
-                /* skip pages that aren't present or are alloc-only */
+                /*
+                 * skip pages that aren't present,
+                 * or are broken, or are alloc-only
+                 */
                 if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTAB
+                    || pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN
                     || pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )
                     continue;
=20
diff -r d675797494bd tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Fri Nov 02 11:08:37 2012 +0800
+++ b/tools/libxc/xenctrl.h	Thu Nov 08 05:07:20 2012 +0800
@@ -575,6 +575,17 @@
                           xc_domaininfo_t *info);
=20
 /**
+ * This function set p2m for broken page
+ * &parm xch a handle to an open hypervisor interface
+ * @parm domid the domain id which broken page belong to
+ * @parm pfn the pfn number of the broken page
+ * @return 0 on success, -1 on failure
+ */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn);
+
+/**
  * This function returns information about the context of a hvm domain
  * @parm xch a handle to an open hypervisor interface
  * @parm domid the domain to get information from
diff -r d675797494bd xen/arch/x86/cpu/mcheck/mcaction.c
--- a/xen/arch/x86/cpu/mcheck/mcaction.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Thu Nov 08 05:07:20 2012 +0800
@@ -1,5 +1,6 @@
 #include <xen/types.h>
 #include <xen/sched.h>
+#include <asm/p2m.h>
 #include "mcaction.h"
 #include "vmce.h"
 #include "mce.h"
@@ -91,6 +92,24 @@
                     goto vmce_failed;
                 }
=20
+                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram &&
+                     paging_mode_log_dirty(d) )
+                {
+                    /*
+                     * vMCE occur during migration
+                     *
+                     *   At sender, it marks broken page to dirty bitmap,
+                     *   so that at copypages stage of migration, broken
+                     *   page's pfn_type and pfn number would be transferr=
ed
+                     *   to target and then take appropriate action.
+                     *
+                     *   At target, it would set p2m as p2m_ram_broken for
+                     *   broken page, so that if guest access the broken p=
age
+                     *   again, it would kill itself as expected.
+                     */
+                    paging_mark_dirty(d, mfn);
+                }
+
                 if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
                 {
                     printk("Unmap broken memory %lx for DOM%d failed\n",
diff -r d675797494bd xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Fri Nov 02 11:08:37 2012 +0800
+++ b/xen/arch/x86/domctl.c	Thu Nov 08 05:07:20 2012 +0800
@@ -209,12 +209,18 @@
                 for ( j =3D 0; j < k; j++ )
                 {
                     unsigned long type =3D 0;
+                    p2m_type_t t;
=20
-                    page =3D get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC)=
;
+                    page =3D get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
=20
                     if ( unlikely(!page) ||
                          unlikely(is_xen_heap_page(page)) )
-                        type =3D XEN_DOMCTL_PFINFO_XTAB;
+                    {
+                        if ( p2m_is_broken(t) )
+                            type =3D XEN_DOMCTL_PFINFO_BROKEN;
+                        else
+                            type =3D XEN_DOMCTL_PFINFO_XTAB;
+                    }
                     else
                     {
                         switch( page->u.inuse.type_info & PGT_type_mask )
@@ -235,6 +241,9 @@
=20
                         if ( page->u.inuse.type_info & PGT_pinned )
                             type |=3D XEN_DOMCTL_PFINFO_LPINTAB;
+
+                        if ( page->count_info & PGC_broken )
+                            type =3D XEN_DOMCTL_PFINFO_BROKEN;
                     }
=20
                     if ( page )
@@ -1568,6 +1577,29 @@
     }
     break;
=20
+    case XEN_DOMCTL_set_broken_page_p2m:
+    {
+        struct domain *d;
+       =20
+        d =3D rcu_lock_domain_by_id(domctl->domain);
+        if ( d !=3D NULL )
+        {
+            p2m_type_t pt;
+            unsigned long pfn =3D domctl->u.set_broken_page_p2m.pfn;
+            mfn_t mfn =3D get_gfn_query(d, pfn, &pt);
+
+            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
+                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) !=3D=
 pt)) )
+                ret =3D -EINVAL;
+
+            put_gfn(d, pfn);
+            rcu_unlock_domain(d);
+        }
+        else
+            ret =3D -ESRCH;
+    }
+    break;
+
     default:
         ret =3D iommu_do_domctl(domctl, u_domctl);
         break;
diff -r d675797494bd xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Fri Nov 02 11:08:37 2012 +0800
+++ b/xen/include/public/domctl.h	Thu Nov 08 05:07:20 2012 +0800
@@ -136,6 +136,7 @@
 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
 #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
 #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
+#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
 #define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
=20
@@ -835,6 +836,12 @@
 typedef struct xen_domctl_set_access_required xen_domctl_set_access_requir=
ed_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
=20
+struct xen_domctl_set_broken_page_p2m {
+    uint64_aligned_t pfn;
+};
+typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p=
2m_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -900,6 +907,7 @@
 #define XEN_DOMCTL_set_access_required           64
 #define XEN_DOMCTL_audit_p2m                     65
 #define XEN_DOMCTL_set_virq_handler              66
+#define XEN_DOMCTL_set_broken_page_p2m           67
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -955,6 +963,7 @@
         struct xen_domctl_audit_p2m         audit_p2m;
         struct xen_domctl_set_virq_handler  set_virq_handler;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
+        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
         uint8_t                             pad[128];=

--_002_DE8DF0795D48FD4CA783C40EC829233537BA4ESHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
	name="handle_broken_page_wrt_migration.patch"
Content-Description: handle_broken_page_wrt_migration.patch
Content-Disposition: attachment;
	filename="handle_broken_page_wrt_migration.patch"; size=10643;
	creation-date="Wed, 07 Nov 2012 14:20:54 GMT";
	modification-date="Wed, 07 Nov 2012 22:09:14 GMT"
Content-Transfer-Encoding: base64

SGFuZGxlIGJyb2tlbiBwYWdlIHdpdGggcmVnYXJkIHRvIG1pZ3JhdGlvbgoKR2VuZXJhbGx5LCB0
aGVyZSBhcmUgMiBjYXNlczoKMS4gYnJva2VuIHBhZ2Ugb2NjdXJzIGJlZm9yZSBtaWdyYXRpb24K
Mi4gYnJva2VuIHBhZ2Ugb2NjdXJzIGR1cmluZyBtaWdyYXRpb24KCkF0IHRoZSBzZW5kZXIKICBG
b3IgY2FzZSAxLCB0aGUgYnJva2VuIHBhZ2Ugd291bGQgYmUgbWFwcGVkIGJ1dCBub3QgY29waWVk
IHRvIHRhcmdldAogIChvdGhlcndpc2UgaXQgbWF5IHRyaWdnZXIgbW9yZSBzZXJpb3VzIGVycm9y
LCBzYXksIFNSQVIgZXJyb3IpLgogIFdoaWxlIGl0cyBwZm5fdHlwZSBhbmQgcGZuIG51bWJlciB3
b3VsZCBiZSB0cmFuc2ZlcnJlZCB0byB0YXJnZXQKICBzbyB0aGF0IHRhcmdldCB0YWtlIGFwcHJv
cHJpYXRlIGFjdGlvbi4KCiAgRm9yIGNhc2UgMiwgbWNlIGhhbmRsZXIgbWFya3MgdGhlIGJyb2tl
biBwYWdlIHRvIGRpcnR5IGJpdG1hcCwgc28gdGhhdAogIGF0IGNvcHlwYWdlcyBzdGFnZSBvZiBt
aWdyYXRpb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gICAgICAgICAg
ICAgICBFUlJPUigiU2V0IHAybSBmb3IgYnJva2VuIHBhZ2UgZmFpbGVkLCAiCisgICAgICAgICAg
ICAgICAgICAgICAgImRvbT0lZCwgcGZuPSVseFxuIiwgZG9tLCBwZm4pOworICAgICAgICAgICAg
ICAgIGdvdG8gZXJyX21hcHBlZDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNvbnRpbnVl
OworICAgICAgICB9CisKICAgICAgICAgaWYgKHBmbl9lcnJbaV0pCiAgICAgICAgIHsKICAgICAg
ICAgICAgIEVSUk9SKCJ1bmV4cGVjdGVkIFBGTiBtYXBwaW5nIGZhaWx1cmUgcGZuICVseCBtYXBf
bWZuICVseCBwMm1fbWZuICVseCIsCmRpZmYgLXIgZDY3NTc5NzQ5NGJkIHRvb2xzL2xpYnhjL3hj
X2RvbWFpbl9zYXZlLmMKLS0tIGEvdG9vbHMvbGlieGMveGNfZG9tYWluX3NhdmUuYwlGcmkgTm92
IDAyIDExOjA4OjM3IDIwMTIgKzA4MDAKKysrIGIvdG9vbHMvbGlieGMveGNfZG9tYWluX3NhdmUu
YwlUaHUgTm92IDA4IDA1OjA3OjIwIDIwMTIgKzA4MDAKQEAgLTEyNzcsNiArMTI3NywxMyBAQAog
ICAgICAgICAgICAgICAgIGlmICggIWh2bSApCiAgICAgICAgICAgICAgICAgICAgIGdtZm4gPSBw
Zm5fdG9fbWZuKGdtZm4pOwogCisgICAgICAgICAgICAgICAgaWYgKCBwZm5fdHlwZVtqXSA9PSBY
RU5fRE9NQ1RMX1BGSU5GT19CUk9LRU4gKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg
ICAgICAgICAgcGZuX3R5cGVbal0gfD0gcGZuX2JhdGNoW2pdOworICAgICAgICAgICAgICAgICAg
ICArK3J1bjsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAg
fQorCiAgICAgICAgICAgICAgICAgaWYgKCBwZm5fZXJyW2pdICkKICAgICAgICAgICAgICAgICB7
CiAgICAgICAgICAgICAgICAgICAgIGlmICggcGZuX3R5cGVbal0gPT0gWEVOX0RPTUNUTF9QRklO
Rk9fWFRBQiApCkBAIC0xMzcxLDggKzEzNzgsMTIgQEAKICAgICAgICAgICAgICAgICAgICAgfQog
ICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIC8qIHNraXAgcGFnZXMgdGhhdCBh
cmVuJ3QgcHJlc2VudCBvciBhcmUgYWxsb2Mtb25seSAqLworICAgICAgICAgICAgICAgIC8qCisg
ICAgICAgICAgICAgICAgICogc2tpcCBwYWdlcyB0aGF0IGFyZW4ndCBwcmVzZW50LAorICAgICAg
ICAgICAgICAgICAqIG9yIGFyZSBicm9rZW4sIG9yIGFyZSBhbGxvYy1vbmx5CisgICAgICAgICAg
ICAgICAgICovCiAgICAgICAgICAgICAgICAgaWYgKCBwYWdldHlwZSA9PSBYRU5fRE9NQ1RMX1BG
SU5GT19YVEFCCisgICAgICAgICAgICAgICAgICAgIHx8IHBhZ2V0eXBlID09IFhFTl9ET01DVExf
UEZJTkZPX0JST0tFTgogICAgICAgICAgICAgICAgICAgICB8fCBwYWdldHlwZSA9PSBYRU5fRE9N
Q1RMX1BGSU5GT19YQUxMT0MgKQogICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKIApkaWZm
IC1yIGQ2NzU3OTc0OTRiZCB0b29scy9saWJ4Yy94ZW5jdHJsLmgKLS0tIGEvdG9vbHMvbGlieGMv
eGVuY3RybC5oCUZyaSBOb3YgMDIgMTE6MDg6MzcgMjAxMiArMDgwMAorKysgYi90b29scy9saWJ4
Yy94ZW5jdHJsLmgJVGh1IE5vdiAwOCAwNTowNzoyMCAyMDEyICswODAwCkBAIC01NzUsNiArNTc1
LDE3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgIHhjX2RvbWFpbmluZm9fdCAqaW5mbyk7
CiAKIC8qKgorICogVGhpcyBmdW5jdGlvbiBzZXQgcDJtIGZvciBicm9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5jbHVkZSA8
YXNtL3AybS5oPgogI2luY2x1ZGUgIm1jYWN0aW9uLmgiCiAjaW5jbHVkZSAidm1jZS5oIgogI2lu
Y2x1ZGUgIm1jZS5oIgpAQCAtOTEsNiArOTIsMjQgQEAKICAgICAgICAgICAgICAgICAgICAgZ290
byB2bWNlX2ZhaWxlZDsKICAgICAgICAgICAgICAgICB9CiAKKyAgICAgICAgICAgICAgICBpZiAo
IGlzX2h2bV9kb21haW4oZCkgJiYgIWQtPmFyY2guaHZtX2RvbWFpbi5kaXJ0eV92cmFtICYmCisg
ICAgICAgICAgICAgICAgICAgICBwYWdpbmdfbW9kZV9sb2dfZGlydHkoZCkgKQorICAgICAgICAg
ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICog
dk1DRSBvY2N1ciBkdXJpbmcgbWlncmF0aW9uCisgICAgICAgICAgICAgICAgICAgICAqCisgICAg
ICAgICAgICAgICAgICAgICAqICAgQXQgc2VuZGVyLCBpdCBtYXJrcyBicm9rZW4gcGFnZSB0byBk
aXJ0eSBiaXRtYXAsCisgICAgICAgICAgICAgICAgICAgICAqICAgc28gdGhhdCBhdCBjb3B5cGFn
ZXMgc3RhZ2Ugb2YgbWlncmF0aW9uLCBicm9rZW4KKyAgICAgICAgICAgICAgICAgICAgICogICBw
YWdlJ3MgcGZuX3R5cGUgYW5kIHBmbiBudW1iZXIgd291bGQgYmUgdHJhbnNmZXJyZWQKKyAgICAg
ICAgICAgICAgICAgICAgICogICB0byB0YXJnZXQgYW5kIHRoZW4gdGFrZSBhcHByb3ByaWF0ZSBh
Y3Rpb24uCisgICAgICAgICAgICAgICAgICAgICAqCisgICAgICAgICAgICAgICAgICAgICAqICAg
QXQgdGFyZ2V0LCBpdCB3b3VsZCBzZXQgcDJtIGFzIHAybV9yYW1fYnJva2VuIGZvcgorICAgICAg
ICAgICAgICAgICAgICAgKiAgIGJyb2tlbiBwYWdlLCBzbyB0aGF0IGlmIGd1ZXN0IGFjY2VzcyB0
aGUgYnJva2VuIHBhZ2UKKyAgICAgICAgICAgICAgICAgICAgICogICBhZ2FpbiwgaXQgd291bGQg
a2lsbCBpdHNlbGYgYXMgZXhwZWN0ZWQuCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAg
ICAgICAgICAgICAgICBwYWdpbmdfbWFya19kaXJ0eShkLCBtZm4pOworICAgICAgICAgICAgICAg
IH0KKwogICAgICAgICAgICAgICAgIGlmICggdW5tbWFwX2Jyb2tlbl9wYWdlKGQsIF9tZm4obWZu
KSwgZ2ZuKSApCiAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICBwcmludGso
IlVubWFwIGJyb2tlbiBtZW1vcnkgJWx4IGZvciBET00lZCBmYWlsZWRcbiIsCmRpZmYgLXIgZDY3
NTc5NzQ5NGJkIHhlbi9hcmNoL3g4Ni9kb21jdGwuYwotLS0gYS94ZW4vYXJjaC94ODYvZG9tY3Rs
LmMJRnJpIE5vdiAwMiAxMTowODozNyAyMDEyICswODAwCisrKyBiL3hlbi9hcmNoL3g4Ni9kb21j
dGwuYwlUaHUgTm92IDA4IDA1OjA3OjIwIDIwMTIgKzA4MDAKQEAgLTIwOSwxMiArMjA5LDE4IEBA
CiAgICAgICAgICAgICAgICAgZm9yICggaiA9IDA7IGogPCBrOyBqKysgKQogICAgICAgICAgICAg
ICAgIHsKICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB0eXBlID0gMDsKKyAgICAg
ICAgICAgICAgICAgICAgcDJtX3R5cGVfdCB0OwogCi0gICAgICAgICAgICAgICAgICAgIHBhZ2Ug
PSBnZXRfcGFnZV9mcm9tX2dmbihkLCBhcnJbal0sIE5VTEwsIFAyTV9BTExPQyk7CisgICAgICAg
ICAgICAgICAgICAgIHBhZ2UgPSBnZXRfcGFnZV9mcm9tX2dmbihkLCBhcnJbal0sICZ0LCBQMk1f
QUxMT0MpOwogCiAgICAgICAgICAgICAgICAgICAgIGlmICggdW5saWtlbHkoIXBhZ2UpIHx8CiAg
ICAgICAgICAgICAgICAgICAgICAgICAgdW5saWtlbHkoaXNfeGVuX2hlYXBfcGFnZShwYWdlKSkg
KQotICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9IFhFTl9ET01DVExfUEZJTkZPX1hUQUI7
CisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICggcDJt
X2lzX2Jyb2tlbih0KSApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9IFhFTl9E
T01DVExfUEZJTkZPX0JST0tFTjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg
ICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gWEVOX0RPTUNUTF9QRklORk9fWFRBQjsKKyAg
ICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAg
ICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCggcGFnZS0+dS5pbnVz
ZS50eXBlX2luZm8gJiBQR1RfdHlwZV9tYXNrICkKQEAgLTIzNSw2ICsyNDEsOSBAQAogCiAgICAg
ICAgICAgICAgICAgICAgICAgICBpZiAoIHBhZ2UtPnUuaW51c2UudHlwZV9pbmZvICYgUEdUX3Bp
bm5lZCApCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSB8PSBYRU5fRE9NQ1RMX1BG
SU5GT19MUElOVEFCOworCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIHBhZ2UtPmNvdW50
X2luZm8gJiBQR0NfYnJva2VuICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0g
WEVOX0RPTUNUTF9QRklORk9fQlJPS0VOOwogICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAg
ICAgICAgICAgICAgICAgaWYgKCBwYWdlICkKQEAgLTE1NjgsNiArMTU3NywyOSBAQAogICAgIH0K
ICAgICBicmVhazsKIAorICAgIGNhc2UgWEVOX0RPTUNUTF9zZXRfYnJva2VuX3BhZ2VfcDJtOgor
ICAgIHsKKyAgICAgICAgc3RydWN0IGRvbWFpbiAqZDsKKyAgICAgICAgCisgICAgICAgIGQgPSBy
Y3VfbG9ja19kb21haW5fYnlfaWQoZG9tY3RsLT5kb21haW4pOworICAgICAgICBpZiAoIGQgIT0g
TlVMTCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHAybV90eXBlX3QgcHQ7CisgICAgICAgICAg
ICB1bnNpZ25lZCBsb25nIHBmbiA9IGRvbWN0bC0+dS5zZXRfYnJva2VuX3BhZ2VfcDJtLnBmbjsK
KyAgICAgICAgICAgIG1mbl90IG1mbiA9IGdldF9nZm5fcXVlcnkoZCwgcGZuLCAmcHQpOworCisg
ICAgICAgICAgICBpZiAoIHVubGlrZWx5KCFtZm5fdmFsaWQobWZuX3gobWZuKSkgfHwgIXAybV9p
c19yYW0ocHQpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgKHAybV9jaGFuZ2VfdHlwZShk
LCBwZm4sIHB0LCBwMm1fcmFtX2Jyb2tlbikgIT0gcHQpKSApCisgICAgICAgICAgICAgICAgcmV0
ID0gLUVJTlZBTDsKKworICAgICAgICAgICAgcHV0X2dmbihkLCBwZm4pOworICAgICAgICAgICAg
cmN1X3VubG9ja19kb21haW4oZCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAg
ICAgcmV0ID0gLUVTUkNIOworICAgIH0KKyAgICBicmVhazsKKwogICAgIGRlZmF1bHQ6CiAgICAg
ICAgIHJldCA9IGlvbW11X2RvX2RvbWN0bChkb21jdGwsIHVfZG9tY3RsKTsKICAgICAgICAgYnJl
YWs7CmRpZmYgLXIgZDY3NTc5NzQ5NGJkIHhlbi9pbmNsdWRlL3B1YmxpYy9kb21jdGwuaAotLS0g
YS94ZW4vaW5jbHVkZS9wdWJsaWMvZG9tY3RsLmgJRnJpIE5vdiAwMiAxMTowODoz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l9kb21jdGxfZ2Ri
c3hfcGF1c2V1bnBfdmNwdSBnZGJzeF9wYXVzZXVucF92Y3B1OwogICAgICAgICBzdHJ1Y3QgeGVu
X2RvbWN0bF9nZGJzeF9kb21zdGF0dXMgICBnZGJzeF9kb21zdGF0dXM7CiAgICAgICAgIHVpbnQ4
X3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZFsxMjhdOwo=

--_002_DE8DF0795D48FD4CA783C40EC829233537BA4ESHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_002_DE8DF0795D48FD4CA783C40EC829233537BA4ESHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Wed Nov 07 14:58:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 14:58:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW75N-00041R-6J; Wed, 07 Nov 2012 14:58:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <key@linux.vnet.ibm.com>) id 1TW6uV-0003z2-O5
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 14:47:20 +0000
Received: from [193.109.254.147:14107] by server-4.bemta-14.messagelabs.com id
	28/F9-18856-7747A905; Wed, 07 Nov 2012 14:47:19 +0000
X-Env-Sender: key@linux.vnet.ibm.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352299631!3210001!1
X-Originating-IP: [32.97.182.139]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMzIuOTcuMTgyLjEzOSA9PiA2NzgxMDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17069 invoked from network); 7 Nov 2012 14:47:12 -0000
Received: from e9.ny.us.ibm.com (HELO e9.ny.us.ibm.com) (32.97.182.139)
	by server-11.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 7 Nov 2012 14:47:12 -0000
Received: from /spool/local
	by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only!
	Violators will be prosecuted
	for <xen-devel@lists.xensource.com> from <key@linux.vnet.ibm.com>;
	Wed, 7 Nov 2012 09:47:10 -0500
Received: from d01dlp01.pok.ibm.com (9.56.250.166)
	by e9.ny.us.ibm.com (192.168.1.109) with IBM ESMTP SMTP Gateway:
	Authorized Use Only! Violators will be prosecuted; 
	Wed, 7 Nov 2012 09:47:08 -0500
Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233])
	by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 2D30238C8042
	for <xen-devel@lists.xensource.com>;
	Wed,  7 Nov 2012 09:47:07 -0500 (EST)
Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64])
	by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id
	qA7El6Tv283140
	for <xen-devel@lists.xensource.com>; Wed, 7 Nov 2012 09:47:06 -0500
Received: from d01av04.pok.ibm.com (loopback [127.0.0.1])
	by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id
	qA7El2GM008767
	for <xen-devel@lists.xensource.com>; Wed, 7 Nov 2012 09:47:06 -0500
Received: from key-ThinkPad-W510 (ennui.austin.ibm.com [9.53.105.11])
	by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id
	qA7El1qo008493; Wed, 7 Nov 2012 09:47:01 -0500
Received: from ennui.austin.ibm.com (localhost [127.0.0.1])
	by key-ThinkPad-W510 (Postfix) with ESMTP id 195662C0A93;
	Wed,  7 Nov 2012 08:46:28 -0600 (CST)
Received: (from key@localhost)
	by ennui.austin.ibm.com (8.14.5/8.14.5/Submit) id qA7EkQVx003546;
	Wed, 7 Nov 2012 08:46:26 -0600
Date: Wed, 7 Nov 2012 08:46:26 -0600
From: Kent Yoder <key@linux.vnet.ibm.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121107144625.GA14628@ennui.austin.ibm.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Content-Scanned: Fidelis XPS MAILER
x-cbid: 12110714-7182-0000-0000-0000031E24EB
X-Mailman-Approved-At: Wed, 07 Nov 2012 14:58:32 +0000
Cc: jeremy@goop.org, xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	linux-kernel@vger.kernel.org, mail@srajiv.net,
	tpmdd-devel@lists.sourceforge.net
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
	driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi Matthew,

On Mon, Nov 05, 2012 at 10:09:57AM -0500, Matthew Fioravante wrote:
> This patch ports the xen vtpm frontend driver for linux
> from the linux-2.6.18-xen.hg tree to linux-stable.
> 
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> ---
>  drivers/char/tpm/Kconfig         |    9 +
>  drivers/char/tpm/Makefile        |    2 +
>  drivers/char/tpm/tpm.h           |   15 +
>  drivers/char/tpm/tpm_vtpm.c      |  543 ++++++++++++++++++++++++++++++
>  drivers/char/tpm/tpm_vtpm.h      |   55 +++
>  drivers/char/tpm/tpm_xen.c       |  690 ++++++++++++++++++++++++++++++++++++++
>  include/xen/interface/io/tpmif.h |   77 +++++
>  7 files changed, 1391 insertions(+)
>  create mode 100644 drivers/char/tpm/tpm_vtpm.c
>  create mode 100644 drivers/char/tpm/tpm_vtpm.h
>  create mode 100644 drivers/char/tpm/tpm_xen.c
>  create mode 100644 include/xen/interface/io/tpmif.h
> 
> diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
> index 915875e..08c1010 100644
> --- a/drivers/char/tpm/Kconfig
> +++ b/drivers/char/tpm/Kconfig
> @@ -81,4 +81,13 @@ config TCG_IBMVTPM
>  	  will be accessible from within Linux.  To compile this driver
>  	  as a module, choose M here; the module will be called tpm_ibmvtpm.
> 
> +config TCG_XEN
> +	tristate "XEN TPM Interface"
> +	depends on TCG_TPM && XEN
> +	---help---
> +	  If you want to make TPM support available to a Xen user domain,
> +	  say Yes and it will be accessible from within Linux.
> +	  To compile this driver as a module, choose M here; the module
> +	  will be called tpm_xenu.
> +
>  endif # TCG_TPM
> diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
> index 5b3fc8b..16911c5 100644
> --- a/drivers/char/tpm/Makefile
> +++ b/drivers/char/tpm/Makefile
> @@ -17,3 +17,5 @@ obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
>  obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
>  obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
>  obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
> +obj-$(CONFIG_TCG_XEN) += tpm_xenu.o
> +tpm_xenu-y = tpm_xen.o tpm_vtpm.o

 Let's match the naming convention of the other drivers if we can, so this
would be something like tpm_xenvtpm.c. tpm_vtpm is too generic...

> diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
> index 8ef7649..2e5a47a 100644
> --- a/drivers/char/tpm/tpm.h
> +++ b/drivers/char/tpm/tpm.h
> @@ -130,6 +130,9 @@ struct tpm_chip {
> 
>  	struct list_head list;
>  	void (*release) (struct device *);
> +#if CONFIG_XEN
> +	void *priv;
> +#endif

 Can you use the chip->vendor.data pointer here instead? tpm_ibmvtpm is
already using that as a priv pointer. I should probably change that name
to make it more obvious what that's used for.

>  };
> 
>  #define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor)
> @@ -310,6 +313,18 @@ struct tpm_cmd_t {
> 
>  ssize_t	tpm_getcap(struct device *, __be32, cap_t *, const char *);
> 
> +#ifdef CONFIG_XEN
> +static inline void *chip_get_private(const struct tpm_chip *chip)
> +{
> +	return chip->priv;
> +}
> +
> +static inline void chip_set_private(struct tpm_chip *chip, void *priv)
> +{
> +	chip->priv = priv;
> +}
> +#endif

 Can you put these in tpm_vtpm.c please?  One less #define. :-)

[cut]
> +#ifndef __XEN_PUBLIC_IO_TPMIF_H__
> +#define __XEN_PUBLIC_IO_TPMIF_H__
> +
> +#include "../grant_table.h"
> +
> +struct tpmif_tx_request {
> +	unsigned long addr;   /* Machine address of packet.   */
> +	grant_ref_t ref;      /* grant table access reference */
> +	uint16_t unused;
> +	uint16_t size;        /* Packet size in bytes.        */
> +};
> +typedef struct tpmif_tx_request tpmif_tx_request_t;

  checkpatch warned on this new typedef - please run through checkpatch
and fix up that stuff.

> +
> +/*
> + * The TPMIF_TX_RING_SIZE defines the number of pages the
> + * front-end and backend can exchange (= size of array).
> + */
> +typedef uint32_t TPMIF_RING_IDX;
> +
> +#define TPMIF_TX_RING_SIZE 1
> +
> +/* This structure must fit in a memory page. */
> +
> +struct tpmif_ring {
> +	struct tpmif_tx_request req;
> +};
> +typedef struct tpmif_ring tpmif_ring_t;
> +
> +struct tpmif_tx_interface {
> +	struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
> +};
> +typedef struct tpmif_tx_interface tpmif_tx_interface_t;
> +
> +#endif
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-set-style: "BSD"
> + * c-basic-offset: 4
> + * tab-width: 4
> + * indent-tabs-mode: nil
> + * End:
> + */

  Please take this comment out, see Documentation/CodingStyle.

Thanks,
Kent

> -- 
> 1.7.10.4
> 
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 14:58:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 14:58:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW75N-00041R-6J; Wed, 07 Nov 2012 14:58:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <key@linux.vnet.ibm.com>) id 1TW6uV-0003z2-O5
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 14:47:20 +0000
Received: from [193.109.254.147:14107] by server-4.bemta-14.messagelabs.com id
	28/F9-18856-7747A905; Wed, 07 Nov 2012 14:47:19 +0000
X-Env-Sender: key@linux.vnet.ibm.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352299631!3210001!1
X-Originating-IP: [32.97.182.139]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMzIuOTcuMTgyLjEzOSA9PiA2NzgxMDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17069 invoked from network); 7 Nov 2012 14:47:12 -0000
Received: from e9.ny.us.ibm.com (HELO e9.ny.us.ibm.com) (32.97.182.139)
	by server-11.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 7 Nov 2012 14:47:12 -0000
Received: from /spool/local
	by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only!
	Violators will be prosecuted
	for <xen-devel@lists.xensource.com> from <key@linux.vnet.ibm.com>;
	Wed, 7 Nov 2012 09:47:10 -0500
Received: from d01dlp01.pok.ibm.com (9.56.250.166)
	by e9.ny.us.ibm.com (192.168.1.109) with IBM ESMTP SMTP Gateway:
	Authorized Use Only! Violators will be prosecuted; 
	Wed, 7 Nov 2012 09:47:08 -0500
Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233])
	by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 2D30238C8042
	for <xen-devel@lists.xensource.com>;
	Wed,  7 Nov 2012 09:47:07 -0500 (EST)
Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64])
	by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id
	qA7El6Tv283140
	for <xen-devel@lists.xensource.com>; Wed, 7 Nov 2012 09:47:06 -0500
Received: from d01av04.pok.ibm.com (loopback [127.0.0.1])
	by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id
	qA7El2GM008767
	for <xen-devel@lists.xensource.com>; Wed, 7 Nov 2012 09:47:06 -0500
Received: from key-ThinkPad-W510 (ennui.austin.ibm.com [9.53.105.11])
	by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id
	qA7El1qo008493; Wed, 7 Nov 2012 09:47:01 -0500
Received: from ennui.austin.ibm.com (localhost [127.0.0.1])
	by key-ThinkPad-W510 (Postfix) with ESMTP id 195662C0A93;
	Wed,  7 Nov 2012 08:46:28 -0600 (CST)
Received: (from key@localhost)
	by ennui.austin.ibm.com (8.14.5/8.14.5/Submit) id qA7EkQVx003546;
	Wed, 7 Nov 2012 08:46:26 -0600
Date: Wed, 7 Nov 2012 08:46:26 -0600
From: Kent Yoder <key@linux.vnet.ibm.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121107144625.GA14628@ennui.austin.ibm.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Content-Scanned: Fidelis XPS MAILER
x-cbid: 12110714-7182-0000-0000-0000031E24EB
X-Mailman-Approved-At: Wed, 07 Nov 2012 14:58:32 +0000
Cc: jeremy@goop.org, xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	linux-kernel@vger.kernel.org, mail@srajiv.net,
	tpmdd-devel@lists.sourceforge.net
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
	driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi Matthew,

On Mon, Nov 05, 2012 at 10:09:57AM -0500, Matthew Fioravante wrote:
> This patch ports the xen vtpm frontend driver for linux
> from the linux-2.6.18-xen.hg tree to linux-stable.
> 
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> ---
>  drivers/char/tpm/Kconfig         |    9 +
>  drivers/char/tpm/Makefile        |    2 +
>  drivers/char/tpm/tpm.h           |   15 +
>  drivers/char/tpm/tpm_vtpm.c      |  543 ++++++++++++++++++++++++++++++
>  drivers/char/tpm/tpm_vtpm.h      |   55 +++
>  drivers/char/tpm/tpm_xen.c       |  690 ++++++++++++++++++++++++++++++++++++++
>  include/xen/interface/io/tpmif.h |   77 +++++
>  7 files changed, 1391 insertions(+)
>  create mode 100644 drivers/char/tpm/tpm_vtpm.c
>  create mode 100644 drivers/char/tpm/tpm_vtpm.h
>  create mode 100644 drivers/char/tpm/tpm_xen.c
>  create mode 100644 include/xen/interface/io/tpmif.h
> 
> diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
> index 915875e..08c1010 100644
> --- a/drivers/char/tpm/Kconfig
> +++ b/drivers/char/tpm/Kconfig
> @@ -81,4 +81,13 @@ config TCG_IBMVTPM
>  	  will be accessible from within Linux.  To compile this driver
>  	  as a module, choose M here; the module will be called tpm_ibmvtpm.
> 
> +config TCG_XEN
> +	tristate "XEN TPM Interface"
> +	depends on TCG_TPM && XEN
> +	---help---
> +	  If you want to make TPM support available to a Xen user domain,
> +	  say Yes and it will be accessible from within Linux.
> +	  To compile this driver as a module, choose M here; the module
> +	  will be called tpm_xenu.
> +
>  endif # TCG_TPM
> diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
> index 5b3fc8b..16911c5 100644
> --- a/drivers/char/tpm/Makefile
> +++ b/drivers/char/tpm/Makefile
> @@ -17,3 +17,5 @@ obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
>  obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
>  obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
>  obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
> +obj-$(CONFIG_TCG_XEN) += tpm_xenu.o
> +tpm_xenu-y = tpm_xen.o tpm_vtpm.o

 Let's match the naming convention of the other drivers if we can, so this
would be something like tpm_xenvtpm.c. tpm_vtpm is too generic...

> diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
> index 8ef7649..2e5a47a 100644
> --- a/drivers/char/tpm/tpm.h
> +++ b/drivers/char/tpm/tpm.h
> @@ -130,6 +130,9 @@ struct tpm_chip {
> 
>  	struct list_head list;
>  	void (*release) (struct device *);
> +#if CONFIG_XEN
> +	void *priv;
> +#endif

 Can you use the chip->vendor.data pointer here instead? tpm_ibmvtpm is
already using that as a priv pointer. I should probably change that name
to make it more obvious what that's used for.

>  };
> 
>  #define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor)
> @@ -310,6 +313,18 @@ struct tpm_cmd_t {
> 
>  ssize_t	tpm_getcap(struct device *, __be32, cap_t *, const char *);
> 
> +#ifdef CONFIG_XEN
> +static inline void *chip_get_private(const struct tpm_chip *chip)
> +{
> +	return chip->priv;
> +}
> +
> +static inline void chip_set_private(struct tpm_chip *chip, void *priv)
> +{
> +	chip->priv = priv;
> +}
> +#endif

 Can you put these in tpm_vtpm.c please?  One less #define. :-)

[cut]
> +#ifndef __XEN_PUBLIC_IO_TPMIF_H__
> +#define __XEN_PUBLIC_IO_TPMIF_H__
> +
> +#include "../grant_table.h"
> +
> +struct tpmif_tx_request {
> +	unsigned long addr;   /* Machine address of packet.   */
> +	grant_ref_t ref;      /* grant table access reference */
> +	uint16_t unused;
> +	uint16_t size;        /* Packet size in bytes.        */
> +};
> +typedef struct tpmif_tx_request tpmif_tx_request_t;

  checkpatch warned on this new typedef - please run through checkpatch
and fix up that stuff.

> +
> +/*
> + * The TPMIF_TX_RING_SIZE defines the number of pages the
> + * front-end and backend can exchange (= size of array).
> + */
> +typedef uint32_t TPMIF_RING_IDX;
> +
> +#define TPMIF_TX_RING_SIZE 1
> +
> +/* This structure must fit in a memory page. */
> +
> +struct tpmif_ring {
> +	struct tpmif_tx_request req;
> +};
> +typedef struct tpmif_ring tpmif_ring_t;
> +
> +struct tpmif_tx_interface {
> +	struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
> +};
> +typedef struct tpmif_tx_interface tpmif_tx_interface_t;
> +
> +#endif
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-set-style: "BSD"
> + * c-basic-offset: 4
> + * tab-width: 4
> + * indent-tabs-mode: nil
> + * End:
> + */

  Please take this comment out, see Documentation/CodingStyle.

Thanks,
Kent

> -- 
> 1.7.10.4
> 
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 14:58:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 14:58:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW75N-00041Y-Hw; Wed, 07 Nov 2012 14:58:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <key@linux.vnet.ibm.com>) id 1TW6wT-0003zY-Pv
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 14:49:22 +0000
Received: from [85.158.137.99:19689] by server-13.bemta-3.messagelabs.com id
	D9/06-24887-CE47A905; Wed, 07 Nov 2012 14:49:16 +0000
X-Env-Sender: key@linux.vnet.ibm.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1352299755!13392571!1
X-Originating-IP: [32.97.182.139]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMzIuOTcuMTgyLjEzOSA9PiA2NzgxMDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12156 invoked from network); 7 Nov 2012 14:49:16 -0000
Received: from e9.ny.us.ibm.com (HELO e9.ny.us.ibm.com) (32.97.182.139)
	by server-5.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 7 Nov 2012 14:49:16 -0000
Received: from /spool/local
	by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only!
	Violators will be prosecuted
	for <xen-devel@lists.xensource.com> from <key@linux.vnet.ibm.com>;
	Wed, 7 Nov 2012 09:49:14 -0500
Received: from d01dlp02.pok.ibm.com (9.56.250.167)
	by e9.ny.us.ibm.com (192.168.1.109) with IBM ESMTP SMTP Gateway:
	Authorized Use Only! Violators will be prosecuted; 
	Wed, 7 Nov 2012 09:49:12 -0500
Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235])
	by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 130ED6E805C
	for <xen-devel@lists.xensource.com>;
	Wed,  7 Nov 2012 09:49:10 -0500 (EST)
Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169])
	by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id
	qA7En8OR273432
	for <xen-devel@lists.xensource.com>; Wed, 7 Nov 2012 09:49:08 -0500
Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1])
	by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP
	id qA7En5Rc022464
	for <xen-devel@lists.xensource.com>; Wed, 7 Nov 2012 07:49:06 -0700
Received: from key-ThinkPad-W510 (ennui.austin.ibm.com [9.53.105.11])
	by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id
	qA7En5PB022448; Wed, 7 Nov 2012 07:49:05 -0700
Received: from ennui.austin.ibm.com (localhost [127.0.0.1])
	by key-ThinkPad-W510 (Postfix) with ESMTP id AE3BE2C0A93;
	Wed,  7 Nov 2012 08:48:32 -0600 (CST)
Received: (from key@localhost)
	by ennui.austin.ibm.com (8.14.5/8.14.5/Submit) id qA7EmVvo003797;
	Wed, 7 Nov 2012 08:48:31 -0600
Date: Wed, 7 Nov 2012 08:48:31 -0600
From: Kent Yoder <key@linux.vnet.ibm.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121107144831.GB14628@ennui.austin.ibm.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121106193921.GC28473@phenom.dumpdata.com>
	<509A6AA6.2000208@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509A6AA6.2000208@jhuapl.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Content-Scanned: Fidelis XPS MAILER
x-cbid: 12110714-7182-0000-0000-0000031E2B4C
X-Mailman-Approved-At: Wed, 07 Nov 2012 14:58:32 +0000
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
	driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> >>+static struct attribute *vtpm_attrs[] = {
> >>+     &dev_attr_pubek.attr,
> >>+     &dev_attr_pcrs.attr,
> >>+     &dev_attr_enabled.attr,
> >>+     &dev_attr_active.attr,
> >>+     &dev_attr_owned.attr,
> >>+     &dev_attr_temp_deactivated.attr,
> >>+     &dev_attr_caps.attr,
> >>+     &dev_attr_cancel.attr,
> >>+     NULL,
> >So are these going to show up in SysFS? If so, there should also be
> >a corresponding file in Documentation/.../sysfs/something.
> These are similar to the entries made by the other tpm drivers. I
> don't see any documentation about those either. TPM maintainers, any
> guidance there?

  Yep, those show up in sysfs. I'll put docs on my todo list.

Kent

> >
> >>+#include "tpm.h"
> >>+#include "tpm_vtpm.h"
> >>+
> >>+#undef DEBUG
> >>+
> >>+#define GRANT_INVALID_REF 0
> >Interesting. The 0 grant value is actually a valid one. I think you
> >want (-1ULL).
> Is it?
> drivers/block/xen-blkfront.c and
> drivers/net/xen-netfront.c
> 
> do the exact same thing
> >>+
> >>+     init_tpm_xenbus();
> >>+     return 0;
> >>+}
> >>+
> >>+
> >>+module_init(tpmif_init);
> >no module_exit?
> Will fix
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 14:58:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 14:58:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW75N-00041Y-Hw; Wed, 07 Nov 2012 14:58:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <key@linux.vnet.ibm.com>) id 1TW6wT-0003zY-Pv
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 14:49:22 +0000
Received: from [85.158.137.99:19689] by server-13.bemta-3.messagelabs.com id
	D9/06-24887-CE47A905; Wed, 07 Nov 2012 14:49:16 +0000
X-Env-Sender: key@linux.vnet.ibm.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1352299755!13392571!1
X-Originating-IP: [32.97.182.139]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMzIuOTcuMTgyLjEzOSA9PiA2NzgxMDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12156 invoked from network); 7 Nov 2012 14:49:16 -0000
Received: from e9.ny.us.ibm.com (HELO e9.ny.us.ibm.com) (32.97.182.139)
	by server-5.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 7 Nov 2012 14:49:16 -0000
Received: from /spool/local
	by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only!
	Violators will be prosecuted
	for <xen-devel@lists.xensource.com> from <key@linux.vnet.ibm.com>;
	Wed, 7 Nov 2012 09:49:14 -0500
Received: from d01dlp02.pok.ibm.com (9.56.250.167)
	by e9.ny.us.ibm.com (192.168.1.109) with IBM ESMTP SMTP Gateway:
	Authorized Use Only! Violators will be prosecuted; 
	Wed, 7 Nov 2012 09:49:12 -0500
Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235])
	by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 130ED6E805C
	for <xen-devel@lists.xensource.com>;
	Wed,  7 Nov 2012 09:49:10 -0500 (EST)
Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169])
	by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id
	qA7En8OR273432
	for <xen-devel@lists.xensource.com>; Wed, 7 Nov 2012 09:49:08 -0500
Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1])
	by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP
	id qA7En5Rc022464
	for <xen-devel@lists.xensource.com>; Wed, 7 Nov 2012 07:49:06 -0700
Received: from key-ThinkPad-W510 (ennui.austin.ibm.com [9.53.105.11])
	by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id
	qA7En5PB022448; Wed, 7 Nov 2012 07:49:05 -0700
Received: from ennui.austin.ibm.com (localhost [127.0.0.1])
	by key-ThinkPad-W510 (Postfix) with ESMTP id AE3BE2C0A93;
	Wed,  7 Nov 2012 08:48:32 -0600 (CST)
Received: (from key@localhost)
	by ennui.austin.ibm.com (8.14.5/8.14.5/Submit) id qA7EmVvo003797;
	Wed, 7 Nov 2012 08:48:31 -0600
Date: Wed, 7 Nov 2012 08:48:31 -0600
From: Kent Yoder <key@linux.vnet.ibm.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121107144831.GB14628@ennui.austin.ibm.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121106193921.GC28473@phenom.dumpdata.com>
	<509A6AA6.2000208@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509A6AA6.2000208@jhuapl.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Content-Scanned: Fidelis XPS MAILER
x-cbid: 12110714-7182-0000-0000-0000031E2B4C
X-Mailman-Approved-At: Wed, 07 Nov 2012 14:58:32 +0000
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
	driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> >>+static struct attribute *vtpm_attrs[] = {
> >>+     &dev_attr_pubek.attr,
> >>+     &dev_attr_pcrs.attr,
> >>+     &dev_attr_enabled.attr,
> >>+     &dev_attr_active.attr,
> >>+     &dev_attr_owned.attr,
> >>+     &dev_attr_temp_deactivated.attr,
> >>+     &dev_attr_caps.attr,
> >>+     &dev_attr_cancel.attr,
> >>+     NULL,
> >So are these going to show up in SysFS? If so, there should also be
> >a corresponding file in Documentation/.../sysfs/something.
> These are similar to the entries made by the other tpm drivers. I
> don't see any documentation about those either. TPM maintainers, any
> guidance there?

  Yep, those show up in sysfs. I'll put docs on my todo list.

Kent

> >
> >>+#include "tpm.h"
> >>+#include "tpm_vtpm.h"
> >>+
> >>+#undef DEBUG
> >>+
> >>+#define GRANT_INVALID_REF 0
> >Interesting. The 0 grant value is actually a valid one. I think you
> >want (-1ULL).
> Is it?
> drivers/block/xen-blkfront.c and
> drivers/net/xen-netfront.c
> 
> do the exact same thing
> >>+
> >>+     init_tpm_xenbus();
> >>+     return 0;
> >>+}
> >>+
> >>+
> >>+module_init(tpmif_init);
> >no module_exit?
> Will fix
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 15:12:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 15:12:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW7IG-0004RU-70; Wed, 07 Nov 2012 15:11:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TW7IF-0004RN-5k
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 15:11:51 +0000
Received: from [85.158.143.35:27931] by server-1.bemta-4.messagelabs.com id
	7C/91-27934-63A7A905; Wed, 07 Nov 2012 15:11:50 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1352301039!16850827!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0NTI3Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15893 invoked from network); 7 Nov 2012 15:10:41 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 7 Nov 2012 15:10:41 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA7FAZin009079
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 7 Nov 2012 15:10:37 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA7FAZjZ015528
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 7 Nov 2012 15:10:35 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA7FAZLJ009389; Wed, 7 Nov 2012 09:10:35 -0600
MIME-Version: 1.0
Message-ID: <73e55d7f-737f-4690-8b69-0252e0b749dd@default>
Date: Wed, 7 Nov 2012 07:10:33 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
References: <20121106202816.GA29655@aepfle.de>
	<CCBF2785.442DA%keir.xen@gmail.com> <20121106221806.GA1813@aepfle.de>
	<50999ACF.4040106@citrix.com>
	<721bf725-662f-41cb-a1a3-7c908e05c188@default>
	<509A65D6.6050505@citrix.com>
In-Reply-To: <509A65D6.6050505@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Andrew Cooper [mailto:andrew.cooper3@citrix.com]
> Subject: Re: [Xen-devel] reliable live migration of large and busy guests
> 
> On 06/11/12 23:41, Dan Magenheimer wrote:
> >> From: Andrew Cooper [mailto:andrew.cooper3@citrix.com]
> >> Sent: Tuesday, November 06, 2012 4:19 PM
> >> To: xen-devel@lists.xen.org
> >> Subject: Re: [Xen-devel] reliable live migration of large and busy guests
> >>
> >> As potential food for thought:
> >>
> >> Is there wisdom in having a new kind of live migrate which, when pausing
> >> the VM on the source host, resumes the VM on the destination host.  Xen
> >> would have to track not-yet-sent pages and pause the guest on pagefault,
> >> and request the required page as a matter of priority.
> >>
> >> The advantages of this approach would be that a timing sensitive
> >> workloads would be paused for far less time.  Even if it was frequently
> >> being paused for pagefaults, the time to get a single page over the LAN
> >> would be far quicker than the entire dirty set, at which point on
> >> resume, the interrupt paths would fire again; The timing paths would
> >> quickly become fully populated.  Further to that, a busy workload in the
> >> guest dirtying a page which has already been sent will not result in any
> >> further network traffic.
> > Something like this?
> >
> > http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.184.2368
> 
> Oh wow - something quite like that.  Thankyou very much.  I will read
> the paper in full when I get a free moment, but the abstract looks very
> interesting.

Hi Andrew --

FYI, selfballooning is now built into the Linux kernel (since about
summer of 2011, so may not be in many distros yet).  It is currently
tied to tmem (transcendent memory), which is not turned on by
default but if you start developing something like post-copy migration,
let me know.  AFAIK, there is no way to do selfballooning in
Windows (not even in userspace I think, since IIRC, unlike Linux
sysfs, there is no way to adjust the balloon size outside the
kernel... but I know nothing about Windows ;-)
 
> From an idealistic point of view, it might be quite nice to have several
> live migrate mechanisms, so the user can choose whether they value
> minimum downtime, minimum network utilisation, or maximum safety.

Agreed.  IIRC, when post-copy was suggested for Xen years ago,
Ian Pratt was against it, though I don't recall why, so Michael
Hines work was never pursued (outside of academia).  Probably
worth asking IanP before investing too much time into it.

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 15:12:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 15:12:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW7IG-0004RU-70; Wed, 07 Nov 2012 15:11:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TW7IF-0004RN-5k
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 15:11:51 +0000
Received: from [85.158.143.35:27931] by server-1.bemta-4.messagelabs.com id
	7C/91-27934-63A7A905; Wed, 07 Nov 2012 15:11:50 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1352301039!16850827!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0NTI3Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15893 invoked from network); 7 Nov 2012 15:10:41 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 7 Nov 2012 15:10:41 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA7FAZin009079
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 7 Nov 2012 15:10:37 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA7FAZjZ015528
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 7 Nov 2012 15:10:35 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA7FAZLJ009389; Wed, 7 Nov 2012 09:10:35 -0600
MIME-Version: 1.0
Message-ID: <73e55d7f-737f-4690-8b69-0252e0b749dd@default>
Date: Wed, 7 Nov 2012 07:10:33 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
References: <20121106202816.GA29655@aepfle.de>
	<CCBF2785.442DA%keir.xen@gmail.com> <20121106221806.GA1813@aepfle.de>
	<50999ACF.4040106@citrix.com>
	<721bf725-662f-41cb-a1a3-7c908e05c188@default>
	<509A65D6.6050505@citrix.com>
In-Reply-To: <509A65D6.6050505@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Andrew Cooper [mailto:andrew.cooper3@citrix.com]
> Subject: Re: [Xen-devel] reliable live migration of large and busy guests
> 
> On 06/11/12 23:41, Dan Magenheimer wrote:
> >> From: Andrew Cooper [mailto:andrew.cooper3@citrix.com]
> >> Sent: Tuesday, November 06, 2012 4:19 PM
> >> To: xen-devel@lists.xen.org
> >> Subject: Re: [Xen-devel] reliable live migration of large and busy guests
> >>
> >> As potential food for thought:
> >>
> >> Is there wisdom in having a new kind of live migrate which, when pausing
> >> the VM on the source host, resumes the VM on the destination host.  Xen
> >> would have to track not-yet-sent pages and pause the guest on pagefault,
> >> and request the required page as a matter of priority.
> >>
> >> The advantages of this approach would be that a timing sensitive
> >> workloads would be paused for far less time.  Even if it was frequently
> >> being paused for pagefaults, the time to get a single page over the LAN
> >> would be far quicker than the entire dirty set, at which point on
> >> resume, the interrupt paths would fire again; The timing paths would
> >> quickly become fully populated.  Further to that, a busy workload in the
> >> guest dirtying a page which has already been sent will not result in any
> >> further network traffic.
> > Something like this?
> >
> > http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.184.2368
> 
> Oh wow - something quite like that.  Thankyou very much.  I will read
> the paper in full when I get a free moment, but the abstract looks very
> interesting.

Hi Andrew --

FYI, selfballooning is now built into the Linux kernel (since about
summer of 2011, so may not be in many distros yet).  It is currently
tied to tmem (transcendent memory), which is not turned on by
default but if you start developing something like post-copy migration,
let me know.  AFAIK, there is no way to do selfballooning in
Windows (not even in userspace I think, since IIRC, unlike Linux
sysfs, there is no way to adjust the balloon size outside the
kernel... but I know nothing about Windows ;-)
 
> From an idealistic point of view, it might be quite nice to have several
> live migrate mechanisms, so the user can choose whether they value
> minimum downtime, minimum network utilisation, or maximum safety.

Agreed.  IIRC, when post-copy was suggested for Xen years ago,
Ian Pratt was against it, though I don't recall why, so Michael
Hines work was never pursued (outside of academia).  Probably
worth asking IanP before investing too much time into it.

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 16:00:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 16:00:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW82m-0004lE-4M; Wed, 07 Nov 2012 15:59:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TW82k-0004l9-K7
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 15:59:54 +0000
Received: from [193.109.254.147:51453] by server-12.bemta-14.messagelabs.com
	id 27/5A-00510-9758A905; Wed, 07 Nov 2012 15:59:53 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1352303991!9294420!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0NTI3Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30583 invoked from network); 7 Nov 2012 15:59:53 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-12.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 7 Nov 2012 15:59:53 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA7Fxm1b009019
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 7 Nov 2012 15:59:49 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA7FxlbH011959
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 7 Nov 2012 15:59:48 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA7Fxllq008740; Wed, 7 Nov 2012 09:59:47 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 07 Nov 2012 07:59:46 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 8170C40157; Wed,  7 Nov 2012 10:47:01 -0500 (EST)
Date: Wed, 7 Nov 2012 10:47:01 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121107154701.GA18615@phenom.dumpdata.com>
References: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
	<1352239982-17389-2-git-send-email-konrad.wilk@oracle.com>
	<1352272794.12977.17.camel@hastur.hellion.org.uk>
	<509A2C2402000078000A6EB9@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509A2C2402000078000A6EB9@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH 1/2] xen/generic: Disable fallback build on
 ARM.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 07, 2012 at 08:38:44AM +0000, Jan Beulich wrote:
> >>> On 07.11.12 at 08:19, Ian Campbell <ian.campbell@citrix.com> wrote:
> > On Tue, 2012-11-06 at 22:13 +0000, Konrad Rzeszutek Wilk wrote:
> >> As there is no need for it (the fallback code is for older
> >> hypervisors and they won't run under ARM), 
> > 
> > I think more specifically they won't run on anything other than x86.
> > 
> > [...]
> >> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> >> index 46de6cd..273d2b9 100644
> >> --- a/drivers/xen/Makefile
> >> +++ b/drivers/xen/Makefile
> >> @@ -1,8 +1,8 @@
> >>  ifneq ($(CONFIG_ARM),y)
> >> -obj-y	+= manage.o balloon.o
> >> +obj-y	+= manage.o balloon.o fallback.o
> >>  obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
> >>  endif
> > 
> > I think :
> >   obj-$(CONFIG_X86) += fallback.o
> > would better reflect what is going on here.
> 
> Yes please.


>From 6bf926ddd44ddc67edbeb28d4069f207f2c6e07e Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Tue, 6 Nov 2012 15:49:27 -0500
Subject: [PATCH 1/2] xen/generic: Disable fallback build on ARM.

As there is no need for it (the fallback code is for older
hypervisors and they only run under x86), and also b/c
we get:

drivers/xen/fallback.c: In function 'xen_event_channel_op_compat':
drivers/xen/fallback.c:10:19: error: storage size of 'op' isn't known
drivers/xen/fallback.c:15:2: error: implicit declaration of function '_hypercall1' [-Werror=implicit-function-declaration]
drivers/xen/fallback.c:15:19: error: expected expression before 'int'
drivers/xen/fallback.c:18:7: error: 'EVTCHNOP_close' undeclared (first use in this function)
drivers/xen/fallback.c:18:7: note: each undeclared identifier is reported only once for each function it appears in
.. and more

[v1: Moved the enablement to be covered by CONFIG_X86 per Ian's suggestion]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 drivers/xen/Makefile |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 46de6cd..7435470 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -2,7 +2,8 @@ ifneq ($(CONFIG_ARM),y)
 obj-y	+= manage.o balloon.o
 obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
 endif
-obj-y	+= grant-table.o features.o events.o fallback.o
+obj-$(CONFIG_X86)			+= fallback.o
+obj-y	+= grant-table.o features.o events.o
 obj-y	+= xenbus/
 
 nostackp := $(call cc-option, -fno-stack-protector)
-- 
1.7.7.6


> 
> Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 16:00:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 16:00:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW82m-0004lE-4M; Wed, 07 Nov 2012 15:59:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TW82k-0004l9-K7
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 15:59:54 +0000
Received: from [193.109.254.147:51453] by server-12.bemta-14.messagelabs.com
	id 27/5A-00510-9758A905; Wed, 07 Nov 2012 15:59:53 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1352303991!9294420!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0NTI3Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30583 invoked from network); 7 Nov 2012 15:59:53 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-12.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 7 Nov 2012 15:59:53 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA7Fxm1b009019
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 7 Nov 2012 15:59:49 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA7FxlbH011959
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 7 Nov 2012 15:59:48 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA7Fxllq008740; Wed, 7 Nov 2012 09:59:47 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 07 Nov 2012 07:59:46 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 8170C40157; Wed,  7 Nov 2012 10:47:01 -0500 (EST)
Date: Wed, 7 Nov 2012 10:47:01 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121107154701.GA18615@phenom.dumpdata.com>
References: <1352239982-17389-1-git-send-email-konrad.wilk@oracle.com>
	<1352239982-17389-2-git-send-email-konrad.wilk@oracle.com>
	<1352272794.12977.17.camel@hastur.hellion.org.uk>
	<509A2C2402000078000A6EB9@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509A2C2402000078000A6EB9@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH 1/2] xen/generic: Disable fallback build on
 ARM.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 07, 2012 at 08:38:44AM +0000, Jan Beulich wrote:
> >>> On 07.11.12 at 08:19, Ian Campbell <ian.campbell@citrix.com> wrote:
> > On Tue, 2012-11-06 at 22:13 +0000, Konrad Rzeszutek Wilk wrote:
> >> As there is no need for it (the fallback code is for older
> >> hypervisors and they won't run under ARM), 
> > 
> > I think more specifically they won't run on anything other than x86.
> > 
> > [...]
> >> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> >> index 46de6cd..273d2b9 100644
> >> --- a/drivers/xen/Makefile
> >> +++ b/drivers/xen/Makefile
> >> @@ -1,8 +1,8 @@
> >>  ifneq ($(CONFIG_ARM),y)
> >> -obj-y	+= manage.o balloon.o
> >> +obj-y	+= manage.o balloon.o fallback.o
> >>  obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
> >>  endif
> > 
> > I think :
> >   obj-$(CONFIG_X86) += fallback.o
> > would better reflect what is going on here.
> 
> Yes please.


>From 6bf926ddd44ddc67edbeb28d4069f207f2c6e07e Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Tue, 6 Nov 2012 15:49:27 -0500
Subject: [PATCH 1/2] xen/generic: Disable fallback build on ARM.

As there is no need for it (the fallback code is for older
hypervisors and they only run under x86), and also b/c
we get:

drivers/xen/fallback.c: In function 'xen_event_channel_op_compat':
drivers/xen/fallback.c:10:19: error: storage size of 'op' isn't known
drivers/xen/fallback.c:15:2: error: implicit declaration of function '_hypercall1' [-Werror=implicit-function-declaration]
drivers/xen/fallback.c:15:19: error: expected expression before 'int'
drivers/xen/fallback.c:18:7: error: 'EVTCHNOP_close' undeclared (first use in this function)
drivers/xen/fallback.c:18:7: note: each undeclared identifier is reported only once for each function it appears in
.. and more

[v1: Moved the enablement to be covered by CONFIG_X86 per Ian's suggestion]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 drivers/xen/Makefile |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 46de6cd..7435470 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -2,7 +2,8 @@ ifneq ($(CONFIG_ARM),y)
 obj-y	+= manage.o balloon.o
 obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
 endif
-obj-y	+= grant-table.o features.o events.o fallback.o
+obj-$(CONFIG_X86)			+= fallback.o
+obj-y	+= grant-table.o features.o events.o
 obj-y	+= xenbus/
 
 nostackp := $(call cc-option, -fno-stack-protector)
-- 
1.7.7.6


> 
> Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 16:06:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 16:06:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW88c-0005JX-Ty; Wed, 07 Nov 2012 16:05:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TW88b-0005JR-0I
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 16:05:57 +0000
Received: from [85.158.138.51:46031] by server-10.bemta-3.messagelabs.com id
	6F/A9-19806-4E68A905; Wed, 07 Nov 2012 16:05:56 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1352304354!29165329!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11642 invoked from network); 7 Nov 2012 16:05:54 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-174.messagelabs.com with SMTP;
	7 Nov 2012 16:05:54 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 07 Nov 2012 16:05:54 +0000
Message-Id: <509A94F002000078000A702A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 07 Nov 2012 16:05:52 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
In-Reply-To: <20121106094456.GA45690@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartD4E513F0.4__="
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com, Tim Deegan <tim@xen.org>,
	Dario Faggioli <raistlin@linux.it>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: [Xen-devel] [PATCH,
 v2] IOMMU: don't immediately disable bus mastering on faults
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartD4E513F0.4__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Instead, give the owning domain at least a small opportunity of fixing
things up, and allow for rare faults to not bring down the device at
all. The amount of faults tolerated within a given time period (all
numbers are made up with no specific rationale) is higher for Dom0 than
for DomU-s.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -566,7 +566,7 @@ static hw_irq_controller iommu_maskable_
=20
 static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
 {
-    u16 domain_id, device_id, bdf, cword, flags;
+    u16 domain_id, device_id, bdf, flags;
     u32 code;
     u64 *addr;
     int count =3D 0;
@@ -620,18 +620,10 @@ static void parse_event_log_entry(struct
                "fault address =3D %#"PRIx64", flags =3D %#x\n",
                event_str[code-1], domain_id, device_id, *addr, flags);
=20
-        /* Tell the device to stop DMAing; we can't rely on the guest to
-         * control it for us. */
         for ( bdf =3D 0; bdf < ivrs_bdf_entries; bdf++ )
             if ( get_dma_requestor_id(iommu->seg, bdf) =3D=3D device_id )
-            {
-                cword =3D pci_conf_read16(iommu->seg, PCI_BUS(bdf),
-                                        PCI_SLOT(bdf), PCI_FUNC(bdf),
-                                        PCI_COMMAND);
-                pci_conf_write16(iommu->seg, PCI_BUS(bdf), PCI_SLOT(bdf),
-                                 PCI_FUNC(bdf), PCI_COMMAND,=20
-                                 cword & ~PCI_COMMAND_MASTER);
-            }
+                pci_check_disable_device(iommu->seg, PCI_BUS(bdf),
+                                         PCI_DEVFN2(bdf));
     }
     else
     {
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -215,6 +215,7 @@ static int device_assigned(u16 seg, u8 b
 static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
 {
     struct hvm_iommu *hd =3D domain_hvm_iommu(d);
+    struct pci_dev *pdev;
     int rc =3D 0;
=20
     if ( !iommu_enabled || !hd->platform_ops )
@@ -228,6 +229,13 @@ static int assign_device(struct domain *
         return -EXDEV;
=20
     spin_lock(&pcidevs_lock);
+    pdev =3D pci_get_pdev(seg, bus, devfn);
+    if ( pdev )
+    {
+        pdev->fault.threshold =3D PT_FAULT_THRESHOLD_UNPRIV;
+        pdev->fault.count     =3D 0;
+    }
+
     if ( (rc =3D hd->platform_ops->assign_device(d, seg, bus, devfn)) )
         goto done;
=20
@@ -239,6 +247,8 @@ static int assign_device(struct domain *
         goto done;
     }
 done:
+    if ( pdev && pdev->domain !=3D d )
+        pdev->fault.threshold =3D PT_FAULT_THRESHOLD_PRIV;
     spin_unlock(&pcidevs_lock);
     return rc;
 }
@@ -379,6 +389,9 @@ int deassign_device(struct domain *d, u1
         return ret;
     }
=20
+    pdev->fault.threshold =3D PT_FAULT_THRESHOLD_PRIV;
+    pdev->fault.count     =3D 0;
+
     if ( !has_arch_pdevs(d) && need_iommu(d) )
     {
         d->need_iommu =3D 0;
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -137,6 +137,7 @@ static struct pci_dev *alloc_pdev(struct
     *((u8*) &pdev->bus) =3D bus;
     *((u8*) &pdev->devfn) =3D devfn;
     pdev->domain =3D NULL;
+    pdev->fault.threshold =3D PT_FAULT_THRESHOLD_PRIV;
     INIT_LIST_HEAD(&pdev->msi_list);
     list_add(&pdev->alldevs_list, &pseg->alldevs_list);
     spin_lock_init(&pdev->msix_table_lock);
@@ -672,6 +673,36 @@ int __init pci_device_detect(u16 seg, u8
     return 1;
 }
=20
+void pci_check_disable_device(u16 seg, u8 bus, u8 devfn)
+{
+    struct pci_dev *pdev;
+    s_time_t now =3D NOW();
+    u16 cword;
+
+    spin_lock(&pcidevs_lock);
+    pdev =3D pci_get_pdev(seg, bus, devfn);
+    if ( pdev )
+    {
+        if ( now < pdev->fault.time ||
+             now - pdev->fault.time > MILLISECS(10) )
+            pdev->fault.count >>=3D 1;
+        pdev->fault.time =3D now;
+        if ( ++pdev->fault.count < pdev->fault.threshold )
+            pdev =3D NULL;
+    }
+    spin_unlock(&pcidevs_lock);
+
+    if ( !pdev )
+        return;
+
+    /* Tell the device to stop DMAing; we can't rely on the guest to
+     * control it for us. */
+    cword =3D pci_conf_read16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
+                            PCI_COMMAND);
+    pci_conf_write16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
+                     PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
+}
+
 /*
  * scan pci devices to add all existed PCI devices to alldevs_list,
  * and setup pci hierarchy in array bus2bridge.
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -917,7 +917,7 @@ static void __do_iommu_page_fault(struct
     while (1)
     {
         u8 fault_reason;
-        u16 source_id, cword;
+        u16 source_id;
         u32 data;
         u64 guest_addr;
         int type;
@@ -950,14 +950,8 @@ static void __do_iommu_page_fault(struct
         iommu_page_fault_do_one(iommu, type, fault_reason,
                                 source_id, guest_addr);
=20
-        /* Tell the device to stop DMAing; we can't rely on the guest to
-         * control it for us. */
-        cword =3D pci_conf_read16(iommu->intel->drhd->segment,
-                                PCI_BUS(source_id), PCI_SLOT(source_id),
-                                PCI_FUNC(source_id), PCI_COMMAND);
-        pci_conf_write16(iommu->intel->drhd->segment, PCI_BUS(source_id),
-                         PCI_SLOT(source_id), PCI_FUNC(source_id),
-                         PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
+        pci_check_disable_device(iommu->intel->drhd->segment,
+                                 PCI_BUS(source_id), PCI_DEVFN2(source_id)=
);
=20
         fault_index++;
         if ( fault_index > cap_num_fault_regs(iommu->cap) )
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -64,6 +64,13 @@ struct pci_dev {
     const u8 devfn;
     struct pci_dev_info info;
     struct arch_pci_dev arch;
+    struct {
+        s_time_t time;
+        unsigned int threshold;
+#define PT_FAULT_THRESHOLD_PRIV  10
+#define PT_FAULT_THRESHOLD_UNPRIV 3
+        unsigned int count;
+    } fault;
     u64 vf_rlen[6];
 };
=20
@@ -107,6 +114,7 @@ int pci_hide_device(int bus, int devfn);
 struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);
 struct pci_dev *pci_get_pdev_by_domain(
     struct domain *, int seg, int bus, int devfn);
+void pci_check_disable_device(u16 seg, u8 bus, u8 devfn);
=20
 uint8_t pci_conf_read8(
     unsigned int seg, unsigned int bus, unsigned int dev, unsigned int =
func,



--=__PartD4E513F0.4__=
Content-Type: text/plain; name="IOMMU-defer-BM-disable.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="IOMMU-defer-BM-disable.patch"

IOMMU: don't immediately disable bus mastering on faults=0A=0AInstead, =
give the owning domain at least a small opportunity of fixing=0Athings up, =
and allow for rare faults to not bring down the device at=0Aall. The =
amount of faults tolerated within a given time period (all=0Anumbers are =
made up with no specific rationale) is higher for Dom0 than=0Afor =
DomU-s.=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- =
a/xen/drivers/passthrough/amd/iommu_init.c=0A+++ b/xen/drivers/passthrough/=
amd/iommu_init.c=0A@@ -566,7 +566,7 @@ static hw_irq_controller iommu_maska=
ble_=0A =0A static void parse_event_log_entry(struct amd_iommu *iommu, u32 =
entry[])=0A {=0A-    u16 domain_id, device_id, bdf, cword, flags;=0A+    =
u16 domain_id, device_id, bdf, flags;=0A     u32 code;=0A     u64 =
*addr;=0A     int count =3D 0;=0A@@ -620,18 +620,10 @@ static void =
parse_event_log_entry(struct=0A                "fault address =3D =
%#"PRIx64", flags =3D %#x\n",=0A                event_str[code-1], =
domain_id, device_id, *addr, flags);=0A =0A-        /* Tell the device to =
stop DMAing; we can't rely on the guest to=0A-         * control it for =
us. */=0A         for ( bdf =3D 0; bdf < ivrs_bdf_entries; bdf++ )=0A      =
       if ( get_dma_requestor_id(iommu->seg, bdf) =3D=3D device_id )=0A-   =
         {=0A-                cword =3D pci_conf_read16(iommu->seg, =
PCI_BUS(bdf),=0A-                                        PCI_SLOT(bdf), =
PCI_FUNC(bdf),=0A-                                        PCI_COMMAND);=0A-=
                pci_conf_write16(iommu->seg, PCI_BUS(bdf), PCI_SLOT(bdf),=
=0A-                                 PCI_FUNC(bdf), PCI_COMMAND, =0A-      =
                           cword & ~PCI_COMMAND_MASTER);=0A-            =
}=0A+                pci_check_disable_device(iommu->seg, PCI_BUS(bdf),=0A+=
                                         PCI_DEVFN2(bdf));=0A     }=0A     =
else=0A     {=0A--- a/xen/drivers/passthrough/iommu.c=0A+++ b/xen/drivers/p=
assthrough/iommu.c=0A@@ -215,6 +215,7 @@ static int device_assigned(u16 =
seg, u8 b=0A static int assign_device(struct domain *d, u16 seg, u8 bus, =
u8 devfn)=0A {=0A     struct hvm_iommu *hd =3D domain_hvm_iommu(d);=0A+    =
struct pci_dev *pdev;=0A     int rc =3D 0;=0A =0A     if ( !iommu_enabled =
|| !hd->platform_ops )=0A@@ -228,6 +229,13 @@ static int assign_device(stru=
ct domain *=0A         return -EXDEV;=0A =0A     spin_lock(&pcidevs_lock);=
=0A+    pdev =3D pci_get_pdev(seg, bus, devfn);=0A+    if ( pdev )=0A+    =
{=0A+        pdev->fault.threshold =3D PT_FAULT_THRESHOLD_UNPRIV;=0A+      =
  pdev->fault.count     =3D 0;=0A+    }=0A+=0A     if ( (rc =3D hd->platfor=
m_ops->assign_device(d, seg, bus, devfn)) )=0A         goto done;=0A =0A@@ =
-239,6 +247,8 @@ static int assign_device(struct domain *=0A         goto =
done;=0A     }=0A done:=0A+    if ( pdev && pdev->domain !=3D d )=0A+      =
  pdev->fault.threshold =3D PT_FAULT_THRESHOLD_PRIV;=0A     spin_unlock(&pc=
idevs_lock);=0A     return rc;=0A }=0A@@ -379,6 +389,9 @@ int deassign_devi=
ce(struct domain *d, u1=0A         return ret;=0A     }=0A =0A+    =
pdev->fault.threshold =3D PT_FAULT_THRESHOLD_PRIV;=0A+    pdev->fault.count=
     =3D 0;=0A+=0A     if ( !has_arch_pdevs(d) && need_iommu(d) )=0A     =
{=0A         d->need_iommu =3D 0;=0A--- a/xen/drivers/passthrough/pci.c=0A+=
++ b/xen/drivers/passthrough/pci.c=0A@@ -137,6 +137,7 @@ static struct =
pci_dev *alloc_pdev(struct=0A     *((u8*) &pdev->bus) =3D bus;=0A     =
*((u8*) &pdev->devfn) =3D devfn;=0A     pdev->domain =3D NULL;=0A+    =
pdev->fault.threshold =3D PT_FAULT_THRESHOLD_PRIV;=0A     INIT_LIST_HEAD(&p=
dev->msi_list);=0A     list_add(&pdev->alldevs_list, &pseg->alldevs_list);=
=0A     spin_lock_init(&pdev->msix_table_lock);=0A@@ -672,6 +673,36 @@ int =
__init pci_device_detect(u16 seg, u8=0A     return 1;=0A }=0A =0A+void =
pci_check_disable_device(u16 seg, u8 bus, u8 devfn)=0A+{=0A+    struct =
pci_dev *pdev;=0A+    s_time_t now =3D NOW();=0A+    u16 cword;=0A+=0A+    =
spin_lock(&pcidevs_lock);=0A+    pdev =3D pci_get_pdev(seg, bus, devfn);=0A=
+    if ( pdev )=0A+    {=0A+        if ( now < pdev->fault.time ||=0A+    =
         now - pdev->fault.time > MILLISECS(10) )=0A+            pdev->faul=
t.count >>=3D 1;=0A+        pdev->fault.time =3D now;=0A+        if ( =
++pdev->fault.count < pdev->fault.threshold )=0A+            pdev =3D =
NULL;=0A+    }=0A+    spin_unlock(&pcidevs_lock);=0A+=0A+    if ( !pdev =
)=0A+        return;=0A+=0A+    /* Tell the device to stop DMAing; we =
can't rely on the guest to=0A+     * control it for us. */=0A+    cword =
=3D pci_conf_read16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),=0A+        =
                    PCI_COMMAND);=0A+    pci_conf_write16(seg, bus, =
PCI_SLOT(devfn), PCI_FUNC(devfn),=0A+                     PCI_COMMAND, =
cword & ~PCI_COMMAND_MASTER);=0A+}=0A+=0A /*=0A  * scan pci devices to add =
all existed PCI devices to alldevs_list,=0A  * and setup pci hierarchy in =
array bus2bridge.=0A--- a/xen/drivers/passthrough/vtd/iommu.c=0A+++ =
b/xen/drivers/passthrough/vtd/iommu.c=0A@@ -917,7 +917,7 @@ static void =
__do_iommu_page_fault(struct=0A     while (1)=0A     {=0A         u8 =
fault_reason;=0A-        u16 source_id, cword;=0A+        u16 source_id;=0A=
         u32 data;=0A         u64 guest_addr;=0A         int type;=0A@@ =
-950,14 +950,8 @@ static void __do_iommu_page_fault(struct=0A         =
iommu_page_fault_do_one(iommu, type, fault_reason,=0A                      =
           source_id, guest_addr);=0A =0A-        /* Tell the device to =
stop DMAing; we can't rely on the guest to=0A-         * control it for =
us. */=0A-        cword =3D pci_conf_read16(iommu->intel->drhd->segment,=0A=
-                                PCI_BUS(source_id), PCI_SLOT(source_id),=
=0A-                                PCI_FUNC(source_id), PCI_COMMAND);=0A- =
       pci_conf_write16(iommu->intel->drhd->segment, PCI_BUS(source_id),=0A=
-                         PCI_SLOT(source_id), PCI_FUNC(source_id),=0A-    =
                     PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);=0A+        =
pci_check_disable_device(iommu->intel->drhd->segment,=0A+                  =
               PCI_BUS(source_id), PCI_DEVFN2(source_id));=0A =0A         =
fault_index++;=0A         if ( fault_index > cap_num_fault_regs(iommu->cap)=
 )=0A--- a/xen/include/xen/pci.h=0A+++ b/xen/include/xen/pci.h=0A@@ -64,6 =
+64,13 @@ struct pci_dev {=0A     const u8 devfn;=0A     struct pci_dev_inf=
o info;=0A     struct arch_pci_dev arch;=0A+    struct {=0A+        =
s_time_t time;=0A+        unsigned int threshold;=0A+#define PT_FAULT_THRES=
HOLD_PRIV  10=0A+#define PT_FAULT_THRESHOLD_UNPRIV 3=0A+        unsigned =
int count;=0A+    } fault;=0A     u64 vf_rlen[6];=0A };=0A =0A@@ -107,6 =
+114,7 @@ int pci_hide_device(int bus, int devfn);=0A struct pci_dev =
*pci_get_pdev(int seg, int bus, int devfn);=0A struct pci_dev *pci_get_pdev=
_by_domain(=0A     struct domain *, int seg, int bus, int devfn);=0A+void =
pci_check_disable_device(u16 seg, u8 bus, u8 devfn);=0A =0A uint8_t =
pci_conf_read8(=0A     unsigned int seg, unsigned int bus, unsigned int =
dev, unsigned int func,=0A
--=__PartD4E513F0.4__=
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.xen.org
http://lists.xen.org/xen-devel

--=__PartD4E513F0.4__=--


From xen-devel-bounces@lists.xen.org Wed Nov 07 16:06:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 16:06:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW88c-0005JX-Ty; Wed, 07 Nov 2012 16:05:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TW88b-0005JR-0I
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 16:05:57 +0000
Received: from [85.158.138.51:46031] by server-10.bemta-3.messagelabs.com id
	6F/A9-19806-4E68A905; Wed, 07 Nov 2012 16:05:56 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1352304354!29165329!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11642 invoked from network); 7 Nov 2012 16:05:54 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-174.messagelabs.com with SMTP;
	7 Nov 2012 16:05:54 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 07 Nov 2012 16:05:54 +0000
Message-Id: <509A94F002000078000A702A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 07 Nov 2012 16:05:52 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
In-Reply-To: <20121106094456.GA45690@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartD4E513F0.4__="
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com, Tim Deegan <tim@xen.org>,
	Dario Faggioli <raistlin@linux.it>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: [Xen-devel] [PATCH,
 v2] IOMMU: don't immediately disable bus mastering on faults
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartD4E513F0.4__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Instead, give the owning domain at least a small opportunity of fixing
things up, and allow for rare faults to not bring down the device at
all. The amount of faults tolerated within a given time period (all
numbers are made up with no specific rationale) is higher for Dom0 than
for DomU-s.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -566,7 +566,7 @@ static hw_irq_controller iommu_maskable_
=20
 static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
 {
-    u16 domain_id, device_id, bdf, cword, flags;
+    u16 domain_id, device_id, bdf, flags;
     u32 code;
     u64 *addr;
     int count =3D 0;
@@ -620,18 +620,10 @@ static void parse_event_log_entry(struct
                "fault address =3D %#"PRIx64", flags =3D %#x\n",
                event_str[code-1], domain_id, device_id, *addr, flags);
=20
-        /* Tell the device to stop DMAing; we can't rely on the guest to
-         * control it for us. */
         for ( bdf =3D 0; bdf < ivrs_bdf_entries; bdf++ )
             if ( get_dma_requestor_id(iommu->seg, bdf) =3D=3D device_id )
-            {
-                cword =3D pci_conf_read16(iommu->seg, PCI_BUS(bdf),
-                                        PCI_SLOT(bdf), PCI_FUNC(bdf),
-                                        PCI_COMMAND);
-                pci_conf_write16(iommu->seg, PCI_BUS(bdf), PCI_SLOT(bdf),
-                                 PCI_FUNC(bdf), PCI_COMMAND,=20
-                                 cword & ~PCI_COMMAND_MASTER);
-            }
+                pci_check_disable_device(iommu->seg, PCI_BUS(bdf),
+                                         PCI_DEVFN2(bdf));
     }
     else
     {
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -215,6 +215,7 @@ static int device_assigned(u16 seg, u8 b
 static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
 {
     struct hvm_iommu *hd =3D domain_hvm_iommu(d);
+    struct pci_dev *pdev;
     int rc =3D 0;
=20
     if ( !iommu_enabled || !hd->platform_ops )
@@ -228,6 +229,13 @@ static int assign_device(struct domain *
         return -EXDEV;
=20
     spin_lock(&pcidevs_lock);
+    pdev =3D pci_get_pdev(seg, bus, devfn);
+    if ( pdev )
+    {
+        pdev->fault.threshold =3D PT_FAULT_THRESHOLD_UNPRIV;
+        pdev->fault.count     =3D 0;
+    }
+
     if ( (rc =3D hd->platform_ops->assign_device(d, seg, bus, devfn)) )
         goto done;
=20
@@ -239,6 +247,8 @@ static int assign_device(struct domain *
         goto done;
     }
 done:
+    if ( pdev && pdev->domain !=3D d )
+        pdev->fault.threshold =3D PT_FAULT_THRESHOLD_PRIV;
     spin_unlock(&pcidevs_lock);
     return rc;
 }
@@ -379,6 +389,9 @@ int deassign_device(struct domain *d, u1
         return ret;
     }
=20
+    pdev->fault.threshold =3D PT_FAULT_THRESHOLD_PRIV;
+    pdev->fault.count     =3D 0;
+
     if ( !has_arch_pdevs(d) && need_iommu(d) )
     {
         d->need_iommu =3D 0;
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -137,6 +137,7 @@ static struct pci_dev *alloc_pdev(struct
     *((u8*) &pdev->bus) =3D bus;
     *((u8*) &pdev->devfn) =3D devfn;
     pdev->domain =3D NULL;
+    pdev->fault.threshold =3D PT_FAULT_THRESHOLD_PRIV;
     INIT_LIST_HEAD(&pdev->msi_list);
     list_add(&pdev->alldevs_list, &pseg->alldevs_list);
     spin_lock_init(&pdev->msix_table_lock);
@@ -672,6 +673,36 @@ int __init pci_device_detect(u16 seg, u8
     return 1;
 }
=20
+void pci_check_disable_device(u16 seg, u8 bus, u8 devfn)
+{
+    struct pci_dev *pdev;
+    s_time_t now =3D NOW();
+    u16 cword;
+
+    spin_lock(&pcidevs_lock);
+    pdev =3D pci_get_pdev(seg, bus, devfn);
+    if ( pdev )
+    {
+        if ( now < pdev->fault.time ||
+             now - pdev->fault.time > MILLISECS(10) )
+            pdev->fault.count >>=3D 1;
+        pdev->fault.time =3D now;
+        if ( ++pdev->fault.count < pdev->fault.threshold )
+            pdev =3D NULL;
+    }
+    spin_unlock(&pcidevs_lock);
+
+    if ( !pdev )
+        return;
+
+    /* Tell the device to stop DMAing; we can't rely on the guest to
+     * control it for us. */
+    cword =3D pci_conf_read16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
+                            PCI_COMMAND);
+    pci_conf_write16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
+                     PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
+}
+
 /*
  * scan pci devices to add all existed PCI devices to alldevs_list,
  * and setup pci hierarchy in array bus2bridge.
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -917,7 +917,7 @@ static void __do_iommu_page_fault(struct
     while (1)
     {
         u8 fault_reason;
-        u16 source_id, cword;
+        u16 source_id;
         u32 data;
         u64 guest_addr;
         int type;
@@ -950,14 +950,8 @@ static void __do_iommu_page_fault(struct
         iommu_page_fault_do_one(iommu, type, fault_reason,
                                 source_id, guest_addr);
=20
-        /* Tell the device to stop DMAing; we can't rely on the guest to
-         * control it for us. */
-        cword =3D pci_conf_read16(iommu->intel->drhd->segment,
-                                PCI_BUS(source_id), PCI_SLOT(source_id),
-                                PCI_FUNC(source_id), PCI_COMMAND);
-        pci_conf_write16(iommu->intel->drhd->segment, PCI_BUS(source_id),
-                         PCI_SLOT(source_id), PCI_FUNC(source_id),
-                         PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
+        pci_check_disable_device(iommu->intel->drhd->segment,
+                                 PCI_BUS(source_id), PCI_DEVFN2(source_id)=
);
=20
         fault_index++;
         if ( fault_index > cap_num_fault_regs(iommu->cap) )
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -64,6 +64,13 @@ struct pci_dev {
     const u8 devfn;
     struct pci_dev_info info;
     struct arch_pci_dev arch;
+    struct {
+        s_time_t time;
+        unsigned int threshold;
+#define PT_FAULT_THRESHOLD_PRIV  10
+#define PT_FAULT_THRESHOLD_UNPRIV 3
+        unsigned int count;
+    } fault;
     u64 vf_rlen[6];
 };
=20
@@ -107,6 +114,7 @@ int pci_hide_device(int bus, int devfn);
 struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);
 struct pci_dev *pci_get_pdev_by_domain(
     struct domain *, int seg, int bus, int devfn);
+void pci_check_disable_device(u16 seg, u8 bus, u8 devfn);
=20
 uint8_t pci_conf_read8(
     unsigned int seg, unsigned int bus, unsigned int dev, unsigned int =
func,



--=__PartD4E513F0.4__=
Content-Type: text/plain; name="IOMMU-defer-BM-disable.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="IOMMU-defer-BM-disable.patch"

IOMMU: don't immediately disable bus mastering on faults=0A=0AInstead, =
give the owning domain at least a small opportunity of fixing=0Athings up, =
and allow for rare faults to not bring down the device at=0Aall. The =
amount of faults tolerated within a given time period (all=0Anumbers are =
made up with no specific rationale) is higher for Dom0 than=0Afor =
DomU-s.=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- =
a/xen/drivers/passthrough/amd/iommu_init.c=0A+++ b/xen/drivers/passthrough/=
amd/iommu_init.c=0A@@ -566,7 +566,7 @@ static hw_irq_controller iommu_maska=
ble_=0A =0A static void parse_event_log_entry(struct amd_iommu *iommu, u32 =
entry[])=0A {=0A-    u16 domain_id, device_id, bdf, cword, flags;=0A+    =
u16 domain_id, device_id, bdf, flags;=0A     u32 code;=0A     u64 =
*addr;=0A     int count =3D 0;=0A@@ -620,18 +620,10 @@ static void =
parse_event_log_entry(struct=0A                "fault address =3D =
%#"PRIx64", flags =3D %#x\n",=0A                event_str[code-1], =
domain_id, device_id, *addr, flags);=0A =0A-        /* Tell the device to =
stop DMAing; we can't rely on the guest to=0A-         * control it for =
us. */=0A         for ( bdf =3D 0; bdf < ivrs_bdf_entries; bdf++ )=0A      =
       if ( get_dma_requestor_id(iommu->seg, bdf) =3D=3D device_id )=0A-   =
         {=0A-                cword =3D pci_conf_read16(iommu->seg, =
PCI_BUS(bdf),=0A-                                        PCI_SLOT(bdf), =
PCI_FUNC(bdf),=0A-                                        PCI_COMMAND);=0A-=
                pci_conf_write16(iommu->seg, PCI_BUS(bdf), PCI_SLOT(bdf),=
=0A-                                 PCI_FUNC(bdf), PCI_COMMAND, =0A-      =
                           cword & ~PCI_COMMAND_MASTER);=0A-            =
}=0A+                pci_check_disable_device(iommu->seg, PCI_BUS(bdf),=0A+=
                                         PCI_DEVFN2(bdf));=0A     }=0A     =
else=0A     {=0A--- a/xen/drivers/passthrough/iommu.c=0A+++ b/xen/drivers/p=
assthrough/iommu.c=0A@@ -215,6 +215,7 @@ static int device_assigned(u16 =
seg, u8 b=0A static int assign_device(struct domain *d, u16 seg, u8 bus, =
u8 devfn)=0A {=0A     struct hvm_iommu *hd =3D domain_hvm_iommu(d);=0A+    =
struct pci_dev *pdev;=0A     int rc =3D 0;=0A =0A     if ( !iommu_enabled =
|| !hd->platform_ops )=0A@@ -228,6 +229,13 @@ static int assign_device(stru=
ct domain *=0A         return -EXDEV;=0A =0A     spin_lock(&pcidevs_lock);=
=0A+    pdev =3D pci_get_pdev(seg, bus, devfn);=0A+    if ( pdev )=0A+    =
{=0A+        pdev->fault.threshold =3D PT_FAULT_THRESHOLD_UNPRIV;=0A+      =
  pdev->fault.count     =3D 0;=0A+    }=0A+=0A     if ( (rc =3D hd->platfor=
m_ops->assign_device(d, seg, bus, devfn)) )=0A         goto done;=0A =0A@@ =
-239,6 +247,8 @@ static int assign_device(struct domain *=0A         goto =
done;=0A     }=0A done:=0A+    if ( pdev && pdev->domain !=3D d )=0A+      =
  pdev->fault.threshold =3D PT_FAULT_THRESHOLD_PRIV;=0A     spin_unlock(&pc=
idevs_lock);=0A     return rc;=0A }=0A@@ -379,6 +389,9 @@ int deassign_devi=
ce(struct domain *d, u1=0A         return ret;=0A     }=0A =0A+    =
pdev->fault.threshold =3D PT_FAULT_THRESHOLD_PRIV;=0A+    pdev->fault.count=
     =3D 0;=0A+=0A     if ( !has_arch_pdevs(d) && need_iommu(d) )=0A     =
{=0A         d->need_iommu =3D 0;=0A--- a/xen/drivers/passthrough/pci.c=0A+=
++ b/xen/drivers/passthrough/pci.c=0A@@ -137,6 +137,7 @@ static struct =
pci_dev *alloc_pdev(struct=0A     *((u8*) &pdev->bus) =3D bus;=0A     =
*((u8*) &pdev->devfn) =3D devfn;=0A     pdev->domain =3D NULL;=0A+    =
pdev->fault.threshold =3D PT_FAULT_THRESHOLD_PRIV;=0A     INIT_LIST_HEAD(&p=
dev->msi_list);=0A     list_add(&pdev->alldevs_list, &pseg->alldevs_list);=
=0A     spin_lock_init(&pdev->msix_table_lock);=0A@@ -672,6 +673,36 @@ int =
__init pci_device_detect(u16 seg, u8=0A     return 1;=0A }=0A =0A+void =
pci_check_disable_device(u16 seg, u8 bus, u8 devfn)=0A+{=0A+    struct =
pci_dev *pdev;=0A+    s_time_t now =3D NOW();=0A+    u16 cword;=0A+=0A+    =
spin_lock(&pcidevs_lock);=0A+    pdev =3D pci_get_pdev(seg, bus, devfn);=0A=
+    if ( pdev )=0A+    {=0A+        if ( now < pdev->fault.time ||=0A+    =
         now - pdev->fault.time > MILLISECS(10) )=0A+            pdev->faul=
t.count >>=3D 1;=0A+        pdev->fault.time =3D now;=0A+        if ( =
++pdev->fault.count < pdev->fault.threshold )=0A+            pdev =3D =
NULL;=0A+    }=0A+    spin_unlock(&pcidevs_lock);=0A+=0A+    if ( !pdev =
)=0A+        return;=0A+=0A+    /* Tell the device to stop DMAing; we =
can't rely on the guest to=0A+     * control it for us. */=0A+    cword =
=3D pci_conf_read16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),=0A+        =
                    PCI_COMMAND);=0A+    pci_conf_write16(seg, bus, =
PCI_SLOT(devfn), PCI_FUNC(devfn),=0A+                     PCI_COMMAND, =
cword & ~PCI_COMMAND_MASTER);=0A+}=0A+=0A /*=0A  * scan pci devices to add =
all existed PCI devices to alldevs_list,=0A  * and setup pci hierarchy in =
array bus2bridge.=0A--- a/xen/drivers/passthrough/vtd/iommu.c=0A+++ =
b/xen/drivers/passthrough/vtd/iommu.c=0A@@ -917,7 +917,7 @@ static void =
__do_iommu_page_fault(struct=0A     while (1)=0A     {=0A         u8 =
fault_reason;=0A-        u16 source_id, cword;=0A+        u16 source_id;=0A=
         u32 data;=0A         u64 guest_addr;=0A         int type;=0A@@ =
-950,14 +950,8 @@ static void __do_iommu_page_fault(struct=0A         =
iommu_page_fault_do_one(iommu, type, fault_reason,=0A                      =
           source_id, guest_addr);=0A =0A-        /* Tell the device to =
stop DMAing; we can't rely on the guest to=0A-         * control it for =
us. */=0A-        cword =3D pci_conf_read16(iommu->intel->drhd->segment,=0A=
-                                PCI_BUS(source_id), PCI_SLOT(source_id),=
=0A-                                PCI_FUNC(source_id), PCI_COMMAND);=0A- =
       pci_conf_write16(iommu->intel->drhd->segment, PCI_BUS(source_id),=0A=
-                         PCI_SLOT(source_id), PCI_FUNC(source_id),=0A-    =
                     PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);=0A+        =
pci_check_disable_device(iommu->intel->drhd->segment,=0A+                  =
               PCI_BUS(source_id), PCI_DEVFN2(source_id));=0A =0A         =
fault_index++;=0A         if ( fault_index > cap_num_fault_regs(iommu->cap)=
 )=0A--- a/xen/include/xen/pci.h=0A+++ b/xen/include/xen/pci.h=0A@@ -64,6 =
+64,13 @@ struct pci_dev {=0A     const u8 devfn;=0A     struct pci_dev_inf=
o info;=0A     struct arch_pci_dev arch;=0A+    struct {=0A+        =
s_time_t time;=0A+        unsigned int threshold;=0A+#define PT_FAULT_THRES=
HOLD_PRIV  10=0A+#define PT_FAULT_THRESHOLD_UNPRIV 3=0A+        unsigned =
int count;=0A+    } fault;=0A     u64 vf_rlen[6];=0A };=0A =0A@@ -107,6 =
+114,7 @@ int pci_hide_device(int bus, int devfn);=0A struct pci_dev =
*pci_get_pdev(int seg, int bus, int devfn);=0A struct pci_dev *pci_get_pdev=
_by_domain(=0A     struct domain *, int seg, int bus, int devfn);=0A+void =
pci_check_disable_device(u16 seg, u8 bus, u8 devfn);=0A =0A uint8_t =
pci_conf_read8(=0A     unsigned int seg, unsigned int bus, unsigned int =
dev, unsigned int func,=0A
--=__PartD4E513F0.4__=
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.xen.org
http://lists.xen.org/xen-devel

--=__PartD4E513F0.4__=--


From xen-devel-bounces@lists.xen.org Wed Nov 07 16:08:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 16:08:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW8B5-0005RH-KX; Wed, 07 Nov 2012 16:08:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TW8B4-0005RC-Ro
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 16:08:31 +0000
Received: from [85.158.143.99:7172] by server-2.bemta-4.messagelabs.com id
	BB/5D-28922-E778A905; Wed, 07 Nov 2012 16:08:30 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1352304509!23703723!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23545 invoked from network); 7 Nov 2012 16:08:29 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-216.messagelabs.com with SMTP;
	7 Nov 2012 16:08:29 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 07 Nov 2012 16:08:29 +0000
Message-Id: <509A958E02000078000A7039@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 07 Nov 2012 16:08:30 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part4B7A8C6E.0__="
Subject: [Xen-devel] [PATCH] x86/emul: only emulate possibly operand sizes
	for POPA
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part4B7A8C6E.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

This opcode neither support 1-byte operands, nor does it support 8-byte
ones (since the opcode is undefined in 64-bit mode). Simplify the code
accordingly.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1996,13 +1996,10 @@ x86_emulate(
             if ( (rc =3D read_ulong(x86_seg_ss, sp_post_inc(op_bytes),
                                   &dst.val, op_bytes, ctxt, ops)) !=3D 0 =
)
                 goto done;
-            switch ( op_bytes )
-            {
-            case 1: *(uint8_t  *)regs[i] =3D (uint8_t)dst.val; break;
-            case 2: *(uint16_t *)regs[i] =3D (uint16_t)dst.val; break;
-            case 4: *regs[i] =3D (uint32_t)dst.val; break; /* 64b: =
zero-ext */
-            case 8: *regs[i] =3D dst.val; break;
-            }
+            if ( op_bytes !=3D 2 )
+                *regs[i] =3D (uint32_t)dst.val; /* 64b: zero-ext */
+            else
+                *(uint16_t *)regs[i] =3D (uint16_t)dst.val;
         }
         break;
     }




--=__Part4B7A8C6E.0__=
Content-Type: text/plain; name="x86-emul-popa-sizes.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="x86-emul-popa-sizes.patch"

x86/emul: only emulate possibly operand sizes for POPA=0A=0AThis opcode =
neither support 1-byte operands, nor does it support 8-byte=0Aones (since =
the opcode is undefined in 64-bit mode). Simplify the code=0Aaccordingly.=
=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- a/xen/arch/x8=
6/x86_emulate/x86_emulate.c=0A+++ b/xen/arch/x86/x86_emulate/x86_emulate.c=
=0A@@ -1996,13 +1996,10 @@ x86_emulate(=0A             if ( (rc =3D =
read_ulong(x86_seg_ss, sp_post_inc(op_bytes),=0A                           =
        &dst.val, op_bytes, ctxt, ops)) !=3D 0 )=0A                 goto =
done;=0A-            switch ( op_bytes )=0A-            {=0A-            =
case 1: *(uint8_t  *)regs[i] =3D (uint8_t)dst.val; break;=0A-            =
case 2: *(uint16_t *)regs[i] =3D (uint16_t)dst.val; break;=0A-            =
case 4: *regs[i] =3D (uint32_t)dst.val; break; /* 64b: zero-ext */=0A-     =
       case 8: *regs[i] =3D dst.val; break;=0A-            }=0A+           =
 if ( op_bytes !=3D 2 )=0A+                *regs[i] =3D (uint32_t)dst.val; =
/* 64b: zero-ext */=0A+            else=0A+                *(uint16_t =
*)regs[i] =3D (uint16_t)dst.val;=0A         }=0A         break;=0A     }=0A
--=__Part4B7A8C6E.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.xen.org
http://lists.xen.org/xen-devel

--=__Part4B7A8C6E.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 07 16:08:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 16:08:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW8B5-0005RH-KX; Wed, 07 Nov 2012 16:08:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TW8B4-0005RC-Ro
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 16:08:31 +0000
Received: from [85.158.143.99:7172] by server-2.bemta-4.messagelabs.com id
	BB/5D-28922-E778A905; Wed, 07 Nov 2012 16:08:30 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1352304509!23703723!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23545 invoked from network); 7 Nov 2012 16:08:29 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-216.messagelabs.com with SMTP;
	7 Nov 2012 16:08:29 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 07 Nov 2012 16:08:29 +0000
Message-Id: <509A958E02000078000A7039@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 07 Nov 2012 16:08:30 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part4B7A8C6E.0__="
Subject: [Xen-devel] [PATCH] x86/emul: only emulate possibly operand sizes
	for POPA
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part4B7A8C6E.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

This opcode neither support 1-byte operands, nor does it support 8-byte
ones (since the opcode is undefined in 64-bit mode). Simplify the code
accordingly.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1996,13 +1996,10 @@ x86_emulate(
             if ( (rc =3D read_ulong(x86_seg_ss, sp_post_inc(op_bytes),
                                   &dst.val, op_bytes, ctxt, ops)) !=3D 0 =
)
                 goto done;
-            switch ( op_bytes )
-            {
-            case 1: *(uint8_t  *)regs[i] =3D (uint8_t)dst.val; break;
-            case 2: *(uint16_t *)regs[i] =3D (uint16_t)dst.val; break;
-            case 4: *regs[i] =3D (uint32_t)dst.val; break; /* 64b: =
zero-ext */
-            case 8: *regs[i] =3D dst.val; break;
-            }
+            if ( op_bytes !=3D 2 )
+                *regs[i] =3D (uint32_t)dst.val; /* 64b: zero-ext */
+            else
+                *(uint16_t *)regs[i] =3D (uint16_t)dst.val;
         }
         break;
     }




--=__Part4B7A8C6E.0__=
Content-Type: text/plain; name="x86-emul-popa-sizes.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="x86-emul-popa-sizes.patch"

x86/emul: only emulate possibly operand sizes for POPA=0A=0AThis opcode =
neither support 1-byte operands, nor does it support 8-byte=0Aones (since =
the opcode is undefined in 64-bit mode). Simplify the code=0Aaccordingly.=
=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- a/xen/arch/x8=
6/x86_emulate/x86_emulate.c=0A+++ b/xen/arch/x86/x86_emulate/x86_emulate.c=
=0A@@ -1996,13 +1996,10 @@ x86_emulate(=0A             if ( (rc =3D =
read_ulong(x86_seg_ss, sp_post_inc(op_bytes),=0A                           =
        &dst.val, op_bytes, ctxt, ops)) !=3D 0 )=0A                 goto =
done;=0A-            switch ( op_bytes )=0A-            {=0A-            =
case 1: *(uint8_t  *)regs[i] =3D (uint8_t)dst.val; break;=0A-            =
case 2: *(uint16_t *)regs[i] =3D (uint16_t)dst.val; break;=0A-            =
case 4: *regs[i] =3D (uint32_t)dst.val; break; /* 64b: zero-ext */=0A-     =
       case 8: *regs[i] =3D dst.val; break;=0A-            }=0A+           =
 if ( op_bytes !=3D 2 )=0A+                *regs[i] =3D (uint32_t)dst.val; =
/* 64b: zero-ext */=0A+            else=0A+                *(uint16_t =
*)regs[i] =3D (uint16_t)dst.val;=0A         }=0A         break;=0A     }=0A
--=__Part4B7A8C6E.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.xen.org
http://lists.xen.org/xen-devel

--=__Part4B7A8C6E.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 07 16:14:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 16:14:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW8GU-0005eO-DI; Wed, 07 Nov 2012 16:14:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TW8GT-0005eF-4v
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 16:14:05 +0000
Received: from [85.158.138.51:40548] by server-12.bemta-3.messagelabs.com id
	6D/CF-22757-CC88A905; Wed, 07 Nov 2012 16:14:04 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352304842!21010432!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTc3Mjk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8269 invoked from network); 7 Nov 2012 16:14:03 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 16:14:03 -0000
X-IronPort-AV: E=Sophos;i="4.80,730,1344211200"; d="scan'208";a="15645532"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 16:13:57 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 7 Nov 2012 16:13:56 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TW8GK-0007PV-Ue;
	Wed, 07 Nov 2012 16:13:56 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TW8GK-0008Gm-JY;
	Wed, 07 Nov 2012 16:13:56 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14372-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 7 Nov 2012 16:13:56 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [linux-3.0 test] 14372: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14372 linux-3.0 real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14372/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14354
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14354
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14354
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14354

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass

version targeted for testing:
 linux                ac7b56f4149a2f0e331a9b640f65aed57ed15eb4
baseline version:
 linux                27d0858dbcf199838b8c50a3e94d397bf326d986

------------------------------------------------------------
People who touched revisions under test:
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=linux-3.0
+ revision=ac7b56f4149a2f0e331a9b640f65aed57ed15eb4
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push linux-3.0 ac7b56f4149a2f0e331a9b640f65aed57ed15eb4
+ branch=linux-3.0
+ revision=ac7b56f4149a2f0e331a9b640f65aed57ed15eb4
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=linux
+ xenbranch=xen-unstable
+ '[' xlinux = xlinux ']'
+ linuxbranch=linux-3.0
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.linux-3.0
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.linux-3.0
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree linux-3.0
+ case $1 in
+ : git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
+ : linux-3.0.y
+ : linux-3.0.y
+ : git
+ : git
+ : git://xenbits.xen.org/linux-pvops.git
+ : xen@xenbits.xensource.com:git/linux-pvops.git
+ : tested/linux-3.0
+ : tested/linux-3.0
+ return 0
+ cd /export/home/osstest/repos/linux
+ git push xen@xenbits.xensource.com:git/linux-pvops.git ac7b56f4149a2f0e331a9b640f65aed57ed15eb4:tested/linux-3.0
Counting objects: 1   
Counting objects: 45   
Counting objects: 57, done.
Compressing objects:   9% (1/11)   
Compressing objects:  18% (2/11)   
Compressing objects:  27% (3/11)   
Compressing objects:  36% (4/11)   
Compressing objects:  45% (5/11)   
Compressing objects:  54% (6/11)   
Compressing objects:  63% (7/11)   
Compressing objects:  72% (8/11)   
Compressing objects:  81% (9/11)   
Compressing objects:  90% (10/11)   
Compressing objects: 100% (11/11)   
Compressing objects: 100% (11/11), done.
Writing objects:   2% (1/35)   
Writing objects:   5% (2/35)   
Writing objects:   8% (3/35)   
Writing objects:  11% (4/35)   
Writing objects:  14% (5/35)   
Writing objects:  17% (6/35)   
Writing objects:  20% (7/35)   
Writing objects:  22% (8/35)   
Writing objects:  25% (9/35)   
Writing objects:  28% (10/35)   
Writing objects:  31% (11/35)   
Writing objects:  34% (12/35)   
Writing objects:  37% (13/35)   
Writing objects:  40% (14/35)   
Writing objects:  42% (15/35)   
Writing objects:  45% (16/35)   
Writing objects:  48% (17/35)   
Writing objects:  51% (18/35)   
Writing objects:  57% (20/35)   
Writing objects:  60% (21/35)   
Writing objects:  62% (22/35)   
Writing objects:  65% (23/35)   
Writing objects:  68% (24/35)   
Writing objects:  71% (25/35)   
Writing objects:  74% (26/35)   
Writing objects:  77% (27/35)   
Writing objects:  80% (28/35)   
Writing objects:  82% (29/35)   
Writing objects:  85% (30/35)   
Writing objects:  88% (31/35)   
Writing objects:  91% (32/35)   
Writing objects:  94% (33/35)   
Writing objects:  97% (34/35)   
Writing objects: 100% (35/35)   
Writing objects: 100% (35/35), 5.83 KiB, done.
Total 35 (delta 28), reused 28 (delta 23)
To xen@xenbits.xensource.com:git/linux-pvops.git
   27d0858..ac7b56f  ac7b56f4149a2f0e331a9b640f65aed57ed15eb4 -> tested/linux-3.0
+ exit 0

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 16:14:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 16:14:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW8GU-0005eO-DI; Wed, 07 Nov 2012 16:14:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TW8GT-0005eF-4v
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 16:14:05 +0000
Received: from [85.158.138.51:40548] by server-12.bemta-3.messagelabs.com id
	6D/CF-22757-CC88A905; Wed, 07 Nov 2012 16:14:04 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352304842!21010432!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTc3Mjk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8269 invoked from network); 7 Nov 2012 16:14:03 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 16:14:03 -0000
X-IronPort-AV: E=Sophos;i="4.80,730,1344211200"; d="scan'208";a="15645532"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 16:13:57 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 7 Nov 2012 16:13:56 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TW8GK-0007PV-Ue;
	Wed, 07 Nov 2012 16:13:56 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TW8GK-0008Gm-JY;
	Wed, 07 Nov 2012 16:13:56 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14372-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 7 Nov 2012 16:13:56 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [linux-3.0 test] 14372: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14372 linux-3.0 real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14372/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14354
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14354
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14354
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14354

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass

version targeted for testing:
 linux                ac7b56f4149a2f0e331a9b640f65aed57ed15eb4
baseline version:
 linux                27d0858dbcf199838b8c50a3e94d397bf326d986

------------------------------------------------------------
People who touched revisions under test:
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=linux-3.0
+ revision=ac7b56f4149a2f0e331a9b640f65aed57ed15eb4
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push linux-3.0 ac7b56f4149a2f0e331a9b640f65aed57ed15eb4
+ branch=linux-3.0
+ revision=ac7b56f4149a2f0e331a9b640f65aed57ed15eb4
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=linux
+ xenbranch=xen-unstable
+ '[' xlinux = xlinux ']'
+ linuxbranch=linux-3.0
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.linux-3.0
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.linux-3.0
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree linux-3.0
+ case $1 in
+ : git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
+ : linux-3.0.y
+ : linux-3.0.y
+ : git
+ : git
+ : git://xenbits.xen.org/linux-pvops.git
+ : xen@xenbits.xensource.com:git/linux-pvops.git
+ : tested/linux-3.0
+ : tested/linux-3.0
+ return 0
+ cd /export/home/osstest/repos/linux
+ git push xen@xenbits.xensource.com:git/linux-pvops.git ac7b56f4149a2f0e331a9b640f65aed57ed15eb4:tested/linux-3.0
Counting objects: 1   
Counting objects: 45   
Counting objects: 57, done.
Compressing objects:   9% (1/11)   
Compressing objects:  18% (2/11)   
Compressing objects:  27% (3/11)   
Compressing objects:  36% (4/11)   
Compressing objects:  45% (5/11)   
Compressing objects:  54% (6/11)   
Compressing objects:  63% (7/11)   
Compressing objects:  72% (8/11)   
Compressing objects:  81% (9/11)   
Compressing objects:  90% (10/11)   
Compressing objects: 100% (11/11)   
Compressing objects: 100% (11/11), done.
Writing objects:   2% (1/35)   
Writing objects:   5% (2/35)   
Writing objects:   8% (3/35)   
Writing objects:  11% (4/35)   
Writing objects:  14% (5/35)   
Writing objects:  17% (6/35)   
Writing objects:  20% (7/35)   
Writing objects:  22% (8/35)   
Writing objects:  25% (9/35)   
Writing objects:  28% (10/35)   
Writing objects:  31% (11/35)   
Writing objects:  34% (12/35)   
Writing objects:  37% (13/35)   
Writing objects:  40% (14/35)   
Writing objects:  42% (15/35)   
Writing objects:  45% (16/35)   
Writing objects:  48% (17/35)   
Writing objects:  51% (18/35)   
Writing objects:  57% (20/35)   
Writing objects:  60% (21/35)   
Writing objects:  62% (22/35)   
Writing objects:  65% (23/35)   
Writing objects:  68% (24/35)   
Writing objects:  71% (25/35)   
Writing objects:  74% (26/35)   
Writing objects:  77% (27/35)   
Writing objects:  80% (28/35)   
Writing objects:  82% (29/35)   
Writing objects:  85% (30/35)   
Writing objects:  88% (31/35)   
Writing objects:  91% (32/35)   
Writing objects:  94% (33/35)   
Writing objects:  97% (34/35)   
Writing objects: 100% (35/35)   
Writing objects: 100% (35/35), 5.83 KiB, done.
Total 35 (delta 28), reused 28 (delta 23)
To xen@xenbits.xensource.com:git/linux-pvops.git
   27d0858..ac7b56f  ac7b56f4149a2f0e331a9b640f65aed57ed15eb4 -> tested/linux-3.0
+ exit 0

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 16:16:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 16:16:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW8IV-0005jR-Tv; Wed, 07 Nov 2012 16:16:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TW8IT-0005jL-KX
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 16:16:09 +0000
Received: from [85.158.139.211:56487] by server-7.bemta-5.messagelabs.com id
	36/F0-23096-8498A905; Wed, 07 Nov 2012 16:16:08 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1352304966!15288862!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0NTI3Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18372 invoked from network); 7 Nov 2012 16:16:07 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-13.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 7 Nov 2012 16:16:07 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA7GFmos001268
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 7 Nov 2012 16:15:49 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA7GFlAe016910
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 7 Nov 2012 16:15:47 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA7GFkM0032547; Wed, 7 Nov 2012 10:15:46 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 07 Nov 2012 08:15:46 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 64FA440157; Wed,  7 Nov 2012 11:03:01 -0500 (EST)
Date: Wed, 7 Nov 2012 11:03:01 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Message-ID: <20121107160301.GF18615@phenom.dumpdata.com>
References: <20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
	<alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537B147@SHSMSX101.ccr.corp.intel.com>
	<alpine.DEB.2.02.1211061455150.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B479@SHSMSX101.ccr.corp.intel.com>
	<20121106164303.GO9966@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC829233537B99E@SHSMSX101.ccr.corp.intel.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233537B99E@SHSMSX101.ccr.corp.intel.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 07, 2012 at 12:58:19PM +0000, Liu, Jinsong wrote:
> >>> 
> >>> If it is generic ACPI code, than it can depend only on ACPI.
> >>> If it is ACPI code that contains X86 specific info, than it needs to
> >>> depend on X86 too.
> >> 
> >> No x86 specific so let's depend on ACPI.
> > 
> > Huh? This feature is x86 specific isn't it? I mean it is in the ACPI
> > spec, but only x86 does it right?
> 
> OK, updated w/ ACPI & X86 dependency, and per other comments.

Ok. Could you send all the patchset in one go. I am bit lost of which
one to review as none of them seem to have the version information
[vX: Did this yyy]

right above your name or in the title:
[PATCH vX 1/2]: yyyy

anyhow, some comments below.

> 
> Thanks,
> Jinsong
> 
> =================
> 
> >From d5f462cc8029863955a574f1541bece72aafb986 Mon Sep 17 00:00:00 2001
> From: Liu, Jinsong <jinsong.liu@intel.com>
> Date: Thu, 8 Nov 2012 04:29:07 +0800
> Subject: [PATCH 1/2] Xen acpi pad implement

The title should be: xen/acpi: ACPI PAD driver

> 
> PAD is acpi Processor Aggregator Device which provides a control point
> that enables the platform to perform specific processor configuration
> and control that applies to all processors in the platform.
> 
> This patch is to implement Xen acpi pad logic. When running under Xen
> virt platform, native pad driver would not work. Instead Xen pad driver,
> a self-contained and thin logic level, would take over acpi pad logic.
> 
> When acpi pad notify OSPM, xen pad logic intercept and parse _PUR object
> to get the expected idle cpu number, and then hypercall to hypervisor.
> Xen hypervisor would then do the rest work, say, core parking, to idle
> specific number of cpus on its own policy.
> 
> Signed-off-by: Jan Beulich <JBeulich@suse.com>
> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
> ---
>  drivers/xen/Makefile             |    3 +-
>  drivers/xen/xen-acpi-pad.c       |  186 ++++++++++++++++++++++++++++++++++++++
>  include/xen/interface/platform.h |   17 ++++
>  include/xen/interface/version.h  |   15 +++
>  4 files changed, 220 insertions(+), 1 deletions(-)
>  create mode 100644 drivers/xen/xen-acpi-pad.c
> 
> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> index 0e86370..3c39717 100644
> --- a/drivers/xen/Makefile
> +++ b/drivers/xen/Makefile
> @@ -10,7 +10,8 @@ CFLAGS_features.o			:= $(nostackp)
>  
>  dom0-$(CONFIG_PCI) += pci.o
>  dom0-$(CONFIG_USB_SUPPORT) += dbgp.o
> -dom0-$(CONFIG_ACPI) += acpi.o
> +dom0-$(CONFIG_ACPI) += acpi.o $(xen-pad-y)
> +xen-pad-$(CONFIG_X86) += xen-acpi-pad.o
>  dom0-$(CONFIG_X86) += pcpu.o
>  obj-$(CONFIG_XEN_DOM0)			+= $(dom0-y)
>  obj-$(CONFIG_BLOCK)			+= biomerge.o
> diff --git a/drivers/xen/xen-acpi-pad.c b/drivers/xen/xen-acpi-pad.c
> new file mode 100644
> index 0000000..f02d3ff
> --- /dev/null
> +++ b/drivers/xen/xen-acpi-pad.c
> @@ -0,0 +1,186 @@
> +/*
> + * xen-acpi-pad.c - Xen pad interface
> + *
> + * Copyright (c) 2012, Intel Corporation.
> + *    Author: Liu, Jinsong <jinsong.liu@intel.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope it will be useful, but WITHOUT
> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
> + * more details.
> + *
> + * You should have received a copy of the GNU General Public License along with
> + * this program; if not, write to the Free Software Foundation, Inc.,
> + * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.

No address pls.

> + *
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/types.h>
> +#include <acpi/acpi_bus.h>
> +#include <acpi/acpi_drivers.h>
> +#include <asm/xen/hypercall.h>
> +#include <xen/interface/version.h>
> +
> +#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"acpi_pad"
> +#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
> +#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
> +
> +static DEFINE_MUTEX(xen_cpu_lock);
> +
> +static int xen_acpi_pad_idle_cpus(unsigned int idle_nums)
> +{
> +	struct xen_platform_op op;
> +
> +	op.cmd = XENPF_core_parking;
> +	op.u.core_parking.type = XEN_CORE_PARKING_SET;
> +	op.u.core_parking.idle_nums = idle_nums;
> +
> +	return HYPERVISOR_dom0_op(&op);
> +}
> +
> +static int xen_acpi_pad_idle_cpus_num(void)
> +{
> +	struct xen_platform_op op;
> +
> +	op.cmd = XENPF_core_parking;
> +	op.u.core_parking.type = XEN_CORE_PARKING_GET;
> +
> +	return HYPERVISOR_dom0_op(&op)
> +	       ?: op.u.core_parking.idle_nums;
> +}
> +
> +/*
> + * Query firmware how many CPUs should be idle
> + * return -1 on failure
> + */
> +static int acpi_pad_pur(acpi_handle handle)
> +{
> +	struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
> +	union acpi_object *package;
> +	int num = -1;
> +
> +	if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))
> +		return num;
> +
> +	if (!buffer.length || !buffer.pointer)
> +		return num;
> +
> +	package = buffer.pointer;
> +
> +	if (package->type == ACPI_TYPE_PACKAGE &&
> +		package->package.count == 2 &&
> +		package->package.elements[0].integer.value == 1) /* rev 1 */
> +
> +		num = package->package.elements[1].integer.value;
> +
> +	kfree(buffer.pointer);
> +	return num;
> +}
> +
> +/* Notify firmware how many CPUs are idle */
> +static void acpi_pad_ost(acpi_handle handle, int stat,
> +	uint32_t idle_nums)
> +{
> +	union acpi_object params[3] = {
> +		{.type = ACPI_TYPE_INTEGER,},
> +		{.type = ACPI_TYPE_INTEGER,},
> +		{.type = ACPI_TYPE_BUFFER,},
> +	};
> +	struct acpi_object_list arg_list = {3, params};
> +
> +	params[0].integer.value = ACPI_PROCESSOR_AGGREGATOR_NOTIFY;
> +	params[1].integer.value =  stat;
> +	params[2].buffer.length = 4;
> +	params[2].buffer.pointer = (void *)&idle_nums;
> +	acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
> +}
> +
> +static void acpi_pad_handle_notify(acpi_handle handle)
> +{
> +	int idle_nums;
> +
> +	mutex_lock(&xen_cpu_lock);
> +	idle_nums = acpi_pad_pur(handle);
> +	if (idle_nums < 0) {
> +		mutex_unlock(&xen_cpu_lock);
> +		return;
> +	}
> +
> +	idle_nums = xen_acpi_pad_idle_cpus(idle_nums)
> +		    ?: xen_acpi_pad_idle_cpus_num();
> +	if (idle_nums >= 0)
> +		acpi_pad_ost(handle, 0, idle_nums);
> +	mutex_unlock(&xen_cpu_lock);
> +}
> +
> +static void acpi_pad_notify(acpi_handle handle, u32 event,
> +	void *data)
> +{
> +	switch (event) {
> +	case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
> +		acpi_pad_handle_notify(handle);
> +		break;
> +	default:
> +		pr_warn("Unsupported event [0x%x]\n", event);
> +		break;
> +	}
> +}
> +
> +static int acpi_pad_add(struct acpi_device *device)
> +{
> +	acpi_status status;
> +
> +	strcpy(acpi_device_name(device), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
> +	strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);
> +
> +	status = acpi_install_notify_handler(device->handle,
> +		ACPI_DEVICE_NOTIFY, acpi_pad_notify, device);
> +	if (ACPI_FAILURE(status))
> +		return -ENODEV;
> +
> +	return 0;
> +}
> +
> +static int acpi_pad_remove(struct acpi_device *device,
> +	int type)
> +{
> +	mutex_lock(&xen_cpu_lock);
> +	xen_acpi_pad_idle_cpus(0);
> +	mutex_unlock(&xen_cpu_lock);
> +
> +	acpi_remove_notify_handler(device->handle,
> +		ACPI_DEVICE_NOTIFY, acpi_pad_notify);
> +	return 0;
> +}
> +
> +static const struct acpi_device_id pad_device_ids[] = {
> +	{"ACPI000C", 0},
> +	{"", 0},
> +};
> +
> +static struct acpi_driver acpi_pad_driver = {
> +	.name = "processor_aggregator",
> +	.class = ACPI_PROCESSOR_AGGREGATOR_CLASS,
> +	.ids = pad_device_ids,
> +	.ops = {
> +		.add = acpi_pad_add,
> +		.remove = acpi_pad_remove,
> +	},
> +};
> +
> +static int __init xen_acpi_pad_init(void)
> +{
> +	/* Only DOM0 and Xen4.2 or later support Xen acpi pad */
> +	if (!xen_initial_domain() ||
> +		!xen_running_on_version_or_later(4, 2))
> +		return -ENODEV;

Please restructure this. Just make it

	if (!xen_initial_domain())
		return -ENODEV;

	if (!xen_running..)
		return -ENODEV;

I know the compiler will end up with code that looks exactly
the same but it is easier to read than the '!' and '||' logic.

> +
> +	return acpi_bus_register_driver(&acpi_pad_driver);
> +}
> +subsys_initcall(xen_acpi_pad_init);
> +
> diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
> index 4755b5f..5e36932 100644
> --- a/include/xen/interface/platform.h
> +++ b/include/xen/interface/platform.h
> @@ -324,6 +324,22 @@ struct xenpf_cpu_ol {
>  };
>  DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
>  
> +/*
> + * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd,
> + * which are already occupied at Xen hypervisor side.
> + */
> +#define XENPF_core_parking     60
> +struct xenpf_core_parking {
> +	/* IN variables */
> +#define XEN_CORE_PARKING_SET   1
> +#define XEN_CORE_PARKING_GET   2
> +	uint32_t type;
> +	/* IN variables:  set cpu nums expected to be idled */
> +	/* OUT variables: get cpu nums actually be idled */
> +	uint32_t idle_nums;
> +};
> +DEFINE_GUEST_HANDLE_STRUCT(xenpf_core_parking);
> +
>  struct xen_platform_op {
>  	uint32_t cmd;
>  	uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
> @@ -341,6 +357,7 @@ struct xen_platform_op {
>  		struct xenpf_set_processor_pminfo set_pminfo;
>  		struct xenpf_pcpuinfo          pcpu_info;
>  		struct xenpf_cpu_ol            cpu_ol;
> +		struct xenpf_core_parking      core_parking;
>  		uint8_t                        pad[128];
>  	} u;
>  };
> diff --git a/include/xen/interface/version.h b/include/xen/interface/version.h
> index 7ff6498..96d8d3d 100644
> --- a/include/xen/interface/version.h
> +++ b/include/xen/interface/version.h
> @@ -63,4 +63,19 @@ struct xen_feature_info {
>  /* arg == xen_domain_handle_t. */
>  #define XENVER_guest_handle 8
>  
> +/* Check if running on Xen version (major, minor) or later */
> +static inline bool
> +xen_running_on_version_or_later(unsigned int major, unsigned int minor)
> +{
> +	unsigned int version;
> +
> +	if (!xen_domain())
> +		return false;
> +
> +	version = HYPERVISOR_xen_version(XENVER_version, NULL);
> +	if ((((version >> 16) == major) && ((version & 0xffff) >= minor)) ||
> +		((version >> 16) > major))
> +		return true;
> +	return false;
> +}
>  #endif /* __XEN_PUBLIC_VERSION_H__ */
> -- 
> 1.7.1



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 16:16:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 16:16:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW8IV-0005jR-Tv; Wed, 07 Nov 2012 16:16:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TW8IT-0005jL-KX
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 16:16:09 +0000
Received: from [85.158.139.211:56487] by server-7.bemta-5.messagelabs.com id
	36/F0-23096-8498A905; Wed, 07 Nov 2012 16:16:08 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1352304966!15288862!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0NTI3Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18372 invoked from network); 7 Nov 2012 16:16:07 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-13.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 7 Nov 2012 16:16:07 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA7GFmos001268
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 7 Nov 2012 16:15:49 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA7GFlAe016910
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 7 Nov 2012 16:15:47 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA7GFkM0032547; Wed, 7 Nov 2012 10:15:46 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 07 Nov 2012 08:15:46 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 64FA440157; Wed,  7 Nov 2012 11:03:01 -0500 (EST)
Date: Wed, 7 Nov 2012 11:03:01 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Message-ID: <20121107160301.GF18615@phenom.dumpdata.com>
References: <20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
	<alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537B147@SHSMSX101.ccr.corp.intel.com>
	<alpine.DEB.2.02.1211061455150.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B479@SHSMSX101.ccr.corp.intel.com>
	<20121106164303.GO9966@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC829233537B99E@SHSMSX101.ccr.corp.intel.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233537B99E@SHSMSX101.ccr.corp.intel.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 07, 2012 at 12:58:19PM +0000, Liu, Jinsong wrote:
> >>> 
> >>> If it is generic ACPI code, than it can depend only on ACPI.
> >>> If it is ACPI code that contains X86 specific info, than it needs to
> >>> depend on X86 too.
> >> 
> >> No x86 specific so let's depend on ACPI.
> > 
> > Huh? This feature is x86 specific isn't it? I mean it is in the ACPI
> > spec, but only x86 does it right?
> 
> OK, updated w/ ACPI & X86 dependency, and per other comments.

Ok. Could you send all the patchset in one go. I am bit lost of which
one to review as none of them seem to have the version information
[vX: Did this yyy]

right above your name or in the title:
[PATCH vX 1/2]: yyyy

anyhow, some comments below.

> 
> Thanks,
> Jinsong
> 
> =================
> 
> >From d5f462cc8029863955a574f1541bece72aafb986 Mon Sep 17 00:00:00 2001
> From: Liu, Jinsong <jinsong.liu@intel.com>
> Date: Thu, 8 Nov 2012 04:29:07 +0800
> Subject: [PATCH 1/2] Xen acpi pad implement

The title should be: xen/acpi: ACPI PAD driver

> 
> PAD is acpi Processor Aggregator Device which provides a control point
> that enables the platform to perform specific processor configuration
> and control that applies to all processors in the platform.
> 
> This patch is to implement Xen acpi pad logic. When running under Xen
> virt platform, native pad driver would not work. Instead Xen pad driver,
> a self-contained and thin logic level, would take over acpi pad logic.
> 
> When acpi pad notify OSPM, xen pad logic intercept and parse _PUR object
> to get the expected idle cpu number, and then hypercall to hypervisor.
> Xen hypervisor would then do the rest work, say, core parking, to idle
> specific number of cpus on its own policy.
> 
> Signed-off-by: Jan Beulich <JBeulich@suse.com>
> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
> ---
>  drivers/xen/Makefile             |    3 +-
>  drivers/xen/xen-acpi-pad.c       |  186 ++++++++++++++++++++++++++++++++++++++
>  include/xen/interface/platform.h |   17 ++++
>  include/xen/interface/version.h  |   15 +++
>  4 files changed, 220 insertions(+), 1 deletions(-)
>  create mode 100644 drivers/xen/xen-acpi-pad.c
> 
> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> index 0e86370..3c39717 100644
> --- a/drivers/xen/Makefile
> +++ b/drivers/xen/Makefile
> @@ -10,7 +10,8 @@ CFLAGS_features.o			:= $(nostackp)
>  
>  dom0-$(CONFIG_PCI) += pci.o
>  dom0-$(CONFIG_USB_SUPPORT) += dbgp.o
> -dom0-$(CONFIG_ACPI) += acpi.o
> +dom0-$(CONFIG_ACPI) += acpi.o $(xen-pad-y)
> +xen-pad-$(CONFIG_X86) += xen-acpi-pad.o
>  dom0-$(CONFIG_X86) += pcpu.o
>  obj-$(CONFIG_XEN_DOM0)			+= $(dom0-y)
>  obj-$(CONFIG_BLOCK)			+= biomerge.o
> diff --git a/drivers/xen/xen-acpi-pad.c b/drivers/xen/xen-acpi-pad.c
> new file mode 100644
> index 0000000..f02d3ff
> --- /dev/null
> +++ b/drivers/xen/xen-acpi-pad.c
> @@ -0,0 +1,186 @@
> +/*
> + * xen-acpi-pad.c - Xen pad interface
> + *
> + * Copyright (c) 2012, Intel Corporation.
> + *    Author: Liu, Jinsong <jinsong.liu@intel.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope it will be useful, but WITHOUT
> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
> + * more details.
> + *
> + * You should have received a copy of the GNU General Public License along with
> + * this program; if not, write to the Free Software Foundation, Inc.,
> + * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.

No address pls.

> + *
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/types.h>
> +#include <acpi/acpi_bus.h>
> +#include <acpi/acpi_drivers.h>
> +#include <asm/xen/hypercall.h>
> +#include <xen/interface/version.h>
> +
> +#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"acpi_pad"
> +#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
> +#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
> +
> +static DEFINE_MUTEX(xen_cpu_lock);
> +
> +static int xen_acpi_pad_idle_cpus(unsigned int idle_nums)
> +{
> +	struct xen_platform_op op;
> +
> +	op.cmd = XENPF_core_parking;
> +	op.u.core_parking.type = XEN_CORE_PARKING_SET;
> +	op.u.core_parking.idle_nums = idle_nums;
> +
> +	return HYPERVISOR_dom0_op(&op);
> +}
> +
> +static int xen_acpi_pad_idle_cpus_num(void)
> +{
> +	struct xen_platform_op op;
> +
> +	op.cmd = XENPF_core_parking;
> +	op.u.core_parking.type = XEN_CORE_PARKING_GET;
> +
> +	return HYPERVISOR_dom0_op(&op)
> +	       ?: op.u.core_parking.idle_nums;
> +}
> +
> +/*
> + * Query firmware how many CPUs should be idle
> + * return -1 on failure
> + */
> +static int acpi_pad_pur(acpi_handle handle)
> +{
> +	struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
> +	union acpi_object *package;
> +	int num = -1;
> +
> +	if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))
> +		return num;
> +
> +	if (!buffer.length || !buffer.pointer)
> +		return num;
> +
> +	package = buffer.pointer;
> +
> +	if (package->type == ACPI_TYPE_PACKAGE &&
> +		package->package.count == 2 &&
> +		package->package.elements[0].integer.value == 1) /* rev 1 */
> +
> +		num = package->package.elements[1].integer.value;
> +
> +	kfree(buffer.pointer);
> +	return num;
> +}
> +
> +/* Notify firmware how many CPUs are idle */
> +static void acpi_pad_ost(acpi_handle handle, int stat,
> +	uint32_t idle_nums)
> +{
> +	union acpi_object params[3] = {
> +		{.type = ACPI_TYPE_INTEGER,},
> +		{.type = ACPI_TYPE_INTEGER,},
> +		{.type = ACPI_TYPE_BUFFER,},
> +	};
> +	struct acpi_object_list arg_list = {3, params};
> +
> +	params[0].integer.value = ACPI_PROCESSOR_AGGREGATOR_NOTIFY;
> +	params[1].integer.value =  stat;
> +	params[2].buffer.length = 4;
> +	params[2].buffer.pointer = (void *)&idle_nums;
> +	acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
> +}
> +
> +static void acpi_pad_handle_notify(acpi_handle handle)
> +{
> +	int idle_nums;
> +
> +	mutex_lock(&xen_cpu_lock);
> +	idle_nums = acpi_pad_pur(handle);
> +	if (idle_nums < 0) {
> +		mutex_unlock(&xen_cpu_lock);
> +		return;
> +	}
> +
> +	idle_nums = xen_acpi_pad_idle_cpus(idle_nums)
> +		    ?: xen_acpi_pad_idle_cpus_num();
> +	if (idle_nums >= 0)
> +		acpi_pad_ost(handle, 0, idle_nums);
> +	mutex_unlock(&xen_cpu_lock);
> +}
> +
> +static void acpi_pad_notify(acpi_handle handle, u32 event,
> +	void *data)
> +{
> +	switch (event) {
> +	case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
> +		acpi_pad_handle_notify(handle);
> +		break;
> +	default:
> +		pr_warn("Unsupported event [0x%x]\n", event);
> +		break;
> +	}
> +}
> +
> +static int acpi_pad_add(struct acpi_device *device)
> +{
> +	acpi_status status;
> +
> +	strcpy(acpi_device_name(device), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
> +	strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);
> +
> +	status = acpi_install_notify_handler(device->handle,
> +		ACPI_DEVICE_NOTIFY, acpi_pad_notify, device);
> +	if (ACPI_FAILURE(status))
> +		return -ENODEV;
> +
> +	return 0;
> +}
> +
> +static int acpi_pad_remove(struct acpi_device *device,
> +	int type)
> +{
> +	mutex_lock(&xen_cpu_lock);
> +	xen_acpi_pad_idle_cpus(0);
> +	mutex_unlock(&xen_cpu_lock);
> +
> +	acpi_remove_notify_handler(device->handle,
> +		ACPI_DEVICE_NOTIFY, acpi_pad_notify);
> +	return 0;
> +}
> +
> +static const struct acpi_device_id pad_device_ids[] = {
> +	{"ACPI000C", 0},
> +	{"", 0},
> +};
> +
> +static struct acpi_driver acpi_pad_driver = {
> +	.name = "processor_aggregator",
> +	.class = ACPI_PROCESSOR_AGGREGATOR_CLASS,
> +	.ids = pad_device_ids,
> +	.ops = {
> +		.add = acpi_pad_add,
> +		.remove = acpi_pad_remove,
> +	},
> +};
> +
> +static int __init xen_acpi_pad_init(void)
> +{
> +	/* Only DOM0 and Xen4.2 or later support Xen acpi pad */
> +	if (!xen_initial_domain() ||
> +		!xen_running_on_version_or_later(4, 2))
> +		return -ENODEV;

Please restructure this. Just make it

	if (!xen_initial_domain())
		return -ENODEV;

	if (!xen_running..)
		return -ENODEV;

I know the compiler will end up with code that looks exactly
the same but it is easier to read than the '!' and '||' logic.

> +
> +	return acpi_bus_register_driver(&acpi_pad_driver);
> +}
> +subsys_initcall(xen_acpi_pad_init);
> +
> diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
> index 4755b5f..5e36932 100644
> --- a/include/xen/interface/platform.h
> +++ b/include/xen/interface/platform.h
> @@ -324,6 +324,22 @@ struct xenpf_cpu_ol {
>  };
>  DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
>  
> +/*
> + * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd,
> + * which are already occupied at Xen hypervisor side.
> + */
> +#define XENPF_core_parking     60
> +struct xenpf_core_parking {
> +	/* IN variables */
> +#define XEN_CORE_PARKING_SET   1
> +#define XEN_CORE_PARKING_GET   2
> +	uint32_t type;
> +	/* IN variables:  set cpu nums expected to be idled */
> +	/* OUT variables: get cpu nums actually be idled */
> +	uint32_t idle_nums;
> +};
> +DEFINE_GUEST_HANDLE_STRUCT(xenpf_core_parking);
> +
>  struct xen_platform_op {
>  	uint32_t cmd;
>  	uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
> @@ -341,6 +357,7 @@ struct xen_platform_op {
>  		struct xenpf_set_processor_pminfo set_pminfo;
>  		struct xenpf_pcpuinfo          pcpu_info;
>  		struct xenpf_cpu_ol            cpu_ol;
> +		struct xenpf_core_parking      core_parking;
>  		uint8_t                        pad[128];
>  	} u;
>  };
> diff --git a/include/xen/interface/version.h b/include/xen/interface/version.h
> index 7ff6498..96d8d3d 100644
> --- a/include/xen/interface/version.h
> +++ b/include/xen/interface/version.h
> @@ -63,4 +63,19 @@ struct xen_feature_info {
>  /* arg == xen_domain_handle_t. */
>  #define XENVER_guest_handle 8
>  
> +/* Check if running on Xen version (major, minor) or later */
> +static inline bool
> +xen_running_on_version_or_later(unsigned int major, unsigned int minor)
> +{
> +	unsigned int version;
> +
> +	if (!xen_domain())
> +		return false;
> +
> +	version = HYPERVISOR_xen_version(XENVER_version, NULL);
> +	if ((((version >> 16) == major) && ((version & 0xffff) >= minor)) ||
> +		((version >> 16) > major))
> +		return true;
> +	return false;
> +}
>  #endif /* __XEN_PUBLIC_VERSION_H__ */
> -- 
> 1.7.1



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 16:21:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 16:21:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW8NY-0005wO-Lr; Wed, 07 Nov 2012 16:21:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TW8NX-0005wG-Dh
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 16:21:23 +0000
Received: from [85.158.138.51:39627] by server-9.bemta-3.messagelabs.com id
	6D/22-02388-D7A8A905; Wed, 07 Nov 2012 16:21:17 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1352305271!27198623!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMzE4MjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14482 invoked from network); 7 Nov 2012 16:21:16 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-15.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 7 Nov 2012 16:21:16 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA7GJoTI010655
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 7 Nov 2012 16:19:52 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA7GJlUU006142
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 7 Nov 2012 16:19:48 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA7GJjtq026569; Wed, 7 Nov 2012 10:19:45 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 07 Nov 2012 08:19:45 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 2C63A4019F; Wed,  7 Nov 2012 11:07:00 -0500 (EST)
Date: Wed, 7 Nov 2012 11:07:00 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121107160659.GH18615@phenom.dumpdata.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121106193921.GC28473@phenom.dumpdata.com>
	<509A6AA6.2000208@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509A6AA6.2000208@jhuapl.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	"key@linux.vnet.ibm.com" <key@linux.vnet.ibm.com>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
	driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 07, 2012 at 09:05:26AM -0500, Matthew Fioravante wrote:
> On 11/06/2012 02:39 PM, Konrad Rzeszutek Wilk wrote:
> >On Mon, Nov 05, 2012 at 10:09:57AM -0500, Matthew Fioravante wrote:
> >>This patch ports the xen vtpm frontend driver for linux
> >>from the linux-2.6.18-xen.hg tree to linux-stable.
> >So how does on test it ? Set it up? Use it? Is there some documentation
> >about it - if so it should be in the patch description.
> Thats actually a question I had. To use this driver now you have to
> use my vtpm mini-os domains which are currently being evaluated in
> the xen-devel mailing list. Once they are accepted I will submit a
> documentation update to the Xen tree.
> 
> Whats the best practice for documentation in this case? All in xen?
> Some linux/some xen? If the latter, how much goes in linux and
> where?

As much as possible. I would say stick both of them in Xen and in Linux.
And you can designate one of them as primary (say the Xen one) and
say in the Linux:

"For up-to-date information, please refer to XXYYZZ"

> >
> >I did a very very cursory look at it, see some of the comments.
> >
> >>
> >>+
> >>+
> >>+static inline struct transmission *transmission_alloc(void)
> >>+{
> >>+     return kzalloc(sizeof(struct transmission), GFP_ATOMIC);
> >>+}
> >>+
> >>+     static unsigned char *
> >
> >That is very weird tabbing? Did you run this patch through
> >scripts/checkpatch.pl ?
> Wow thats ugly. I ran the check script and it looks like it didn't
> pick this up. For some reason my editor wants to autoindent like
> that.
> Fixed.
> >
> >>+
> >>+static const struct file_operations vtpm_ops = {
> >>+     .owner = THIS_MODULE,
> >>+     .llseek = no_llseek,
> >>+     .open = tpm_open,
> >>+     .read = tpm_read,
> >>+     .write = tpm_write,
> >>+     .release = tpm_release,
> >>+};
> >>+
> >>+static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
> >>+static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
> >>+static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);
> >>+static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL);
> >>+static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL);
> >>+static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,
> >>+             NULL);
> >>+static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL);
> >>+static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
> >>+
> >>+static struct attribute *vtpm_attrs[] = {
> >>+     &dev_attr_pubek.attr,
> >>+     &dev_attr_pcrs.attr,
> >>+     &dev_attr_enabled.attr,
> >>+     &dev_attr_active.attr,
> >>+     &dev_attr_owned.attr,
> >>+     &dev_attr_temp_deactivated.attr,
> >>+     &dev_attr_caps.attr,
> >>+     &dev_attr_cancel.attr,
> >>+     NULL,
> >So are these going to show up in SysFS? If so, there should also be
> >a corresponding file in Documentation/.../sysfs/something.
> These are similar to the entries made by the other tpm drivers. I
> don't see any documentation about those either. TPM maintainers, any
> guidance there?
> >
> >>+#include "tpm.h"
> >>+#include "tpm_vtpm.h"
> >>+
> >>+#undef DEBUG
> >>+
> >>+#define GRANT_INVALID_REF 0
> >Interesting. The 0 grant value is actually a valid one. I think you
> >want (-1ULL).
> Is it?
> drivers/block/xen-blkfront.c and
> drivers/net/xen-netfront.c
> 
> do the exact same thing

You are right. Just leave it as that then.

> >>+
> >>+     init_tpm_xenbus();
> >>+     return 0;
> >>+}
> >>+
> >>+
> >>+module_init(tpmif_init);
> >no module_exit?
> Will fix
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 16:21:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 16:21:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW8NY-0005wO-Lr; Wed, 07 Nov 2012 16:21:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TW8NX-0005wG-Dh
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 16:21:23 +0000
Received: from [85.158.138.51:39627] by server-9.bemta-3.messagelabs.com id
	6D/22-02388-D7A8A905; Wed, 07 Nov 2012 16:21:17 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1352305271!27198623!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMzE4MjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14482 invoked from network); 7 Nov 2012 16:21:16 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-15.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 7 Nov 2012 16:21:16 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA7GJoTI010655
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 7 Nov 2012 16:19:52 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA7GJlUU006142
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 7 Nov 2012 16:19:48 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA7GJjtq026569; Wed, 7 Nov 2012 10:19:45 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 07 Nov 2012 08:19:45 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 2C63A4019F; Wed,  7 Nov 2012 11:07:00 -0500 (EST)
Date: Wed, 7 Nov 2012 11:07:00 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121107160659.GH18615@phenom.dumpdata.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121106193921.GC28473@phenom.dumpdata.com>
	<509A6AA6.2000208@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509A6AA6.2000208@jhuapl.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	"key@linux.vnet.ibm.com" <key@linux.vnet.ibm.com>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
	driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 07, 2012 at 09:05:26AM -0500, Matthew Fioravante wrote:
> On 11/06/2012 02:39 PM, Konrad Rzeszutek Wilk wrote:
> >On Mon, Nov 05, 2012 at 10:09:57AM -0500, Matthew Fioravante wrote:
> >>This patch ports the xen vtpm frontend driver for linux
> >>from the linux-2.6.18-xen.hg tree to linux-stable.
> >So how does on test it ? Set it up? Use it? Is there some documentation
> >about it - if so it should be in the patch description.
> Thats actually a question I had. To use this driver now you have to
> use my vtpm mini-os domains which are currently being evaluated in
> the xen-devel mailing list. Once they are accepted I will submit a
> documentation update to the Xen tree.
> 
> Whats the best practice for documentation in this case? All in xen?
> Some linux/some xen? If the latter, how much goes in linux and
> where?

As much as possible. I would say stick both of them in Xen and in Linux.
And you can designate one of them as primary (say the Xen one) and
say in the Linux:

"For up-to-date information, please refer to XXYYZZ"

> >
> >I did a very very cursory look at it, see some of the comments.
> >
> >>
> >>+
> >>+
> >>+static inline struct transmission *transmission_alloc(void)
> >>+{
> >>+     return kzalloc(sizeof(struct transmission), GFP_ATOMIC);
> >>+}
> >>+
> >>+     static unsigned char *
> >
> >That is very weird tabbing? Did you run this patch through
> >scripts/checkpatch.pl ?
> Wow thats ugly. I ran the check script and it looks like it didn't
> pick this up. For some reason my editor wants to autoindent like
> that.
> Fixed.
> >
> >>+
> >>+static const struct file_operations vtpm_ops = {
> >>+     .owner = THIS_MODULE,
> >>+     .llseek = no_llseek,
> >>+     .open = tpm_open,
> >>+     .read = tpm_read,
> >>+     .write = tpm_write,
> >>+     .release = tpm_release,
> >>+};
> >>+
> >>+static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
> >>+static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
> >>+static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);
> >>+static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL);
> >>+static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL);
> >>+static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,
> >>+             NULL);
> >>+static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL);
> >>+static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
> >>+
> >>+static struct attribute *vtpm_attrs[] = {
> >>+     &dev_attr_pubek.attr,
> >>+     &dev_attr_pcrs.attr,
> >>+     &dev_attr_enabled.attr,
> >>+     &dev_attr_active.attr,
> >>+     &dev_attr_owned.attr,
> >>+     &dev_attr_temp_deactivated.attr,
> >>+     &dev_attr_caps.attr,
> >>+     &dev_attr_cancel.attr,
> >>+     NULL,
> >So are these going to show up in SysFS? If so, there should also be
> >a corresponding file in Documentation/.../sysfs/something.
> These are similar to the entries made by the other tpm drivers. I
> don't see any documentation about those either. TPM maintainers, any
> guidance there?
> >
> >>+#include "tpm.h"
> >>+#include "tpm_vtpm.h"
> >>+
> >>+#undef DEBUG
> >>+
> >>+#define GRANT_INVALID_REF 0
> >Interesting. The 0 grant value is actually a valid one. I think you
> >want (-1ULL).
> Is it?
> drivers/block/xen-blkfront.c and
> drivers/net/xen-netfront.c
> 
> do the exact same thing

You are right. Just leave it as that then.

> >>+
> >>+     init_tpm_xenbus();
> >>+     return 0;
> >>+}
> >>+
> >>+
> >>+module_init(tpmif_init);
> >no module_exit?
> Will fix
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 16:22:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 16:22:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW8Og-00063N-FI; Wed, 07 Nov 2012 16:22:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ben.guthro@gmail.com>) id 1TW8Oe-000635-DI
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 16:22:32 +0000
Received: from [85.158.137.99:22495] by server-11.bemta-3.messagelabs.com id
	38/29-19361-7CA8A905; Wed, 07 Nov 2012 16:22:31 +0000
X-Env-Sender: ben.guthro@gmail.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1352305348!18174717!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_10_20,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10043 invoked from network); 7 Nov 2012 16:22:30 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 16:22:30 -0000
Received: by mail-ie0-f173.google.com with SMTP id 17so3160640iea.32
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 08:22:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type;
	bh=YQK07g2BSlmBi0YQdF4jrSd8sesp1MX44prse8KHIIk=;
	b=sWEN1ZJvvYdNOCIbxiKVVSroQwah9B3N+EqarNaAuZPk59ciFjCuj4zzPCszI4V+rG
	C/OfkvXzWEWdx2XhtDMMZBipAL0rz3WxLZLFJ8YmrXescBAd5qordU8g98hooAsXjBQb
	fTDS/iQpGYg0AkNLxAhPRELWZRduIeBuK/6GfQ8S36bN9uyP1uniXR4+WfC3gpPVbX+9
	tzO8jE53edGnhdQkHWHSkh8LXZe9dJT4ecFtsRNMACasXR5UtUvTcVowHqCQ66mOrt0i
	m9ij21U/KlirTrOxHkoTspCk78sZoG4bH6KzF9uq+2YdQFWfNj78OaPXMqqNPqxqn6Sm
	bHYw==
MIME-Version: 1.0
Received: by 10.50.40.225 with SMTP id a1mr17090604igl.7.1352305347943; Wed,
	07 Nov 2012 08:22:27 -0800 (PST)
Received: by 10.231.10.130 with HTTP; Wed, 7 Nov 2012 08:22:27 -0800 (PST)
Date: Wed, 7 Nov 2012 11:22:27 -0500
X-Google-Sender-Auth: pJU4RgwU9pc0oBwq2DoEYGSOxm0
Message-ID: <CAOvdn6UWbfwP0ysxJJOq0-AwXqee044F0NUzswQwGu4Hbv7iVg@mail.gmail.com>
From: Ben Guthro <ben@guthro.net>
To: xen-devel <xen-devel@lists.xen.org>, intel-gfx@lists.freedesktop.org
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [Xen-devel] S3 causing IRQ delivery mismatch - i915 hotplug storm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7311888765167059898=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============7311888765167059898==
Content-Type: multipart/alternative; boundary=14dae9340cb7e45e4404cdea1fc5

--14dae9340cb7e45e4404cdea1fc5
Content-Type: text/plain; charset=ISO-8859-1

I'm trying to debug an issue on an older lapop (Toshiba Satellite A505) -
that has an i3 processor (M330) - and intel graphics.
This is running under Xen-unstable, and a 3.7-rc4 pvops kernel - but can
also be reproduced using kernels as old as 3.2.23 - and hypervisors as old
as 4.0.4

(I have cross posted here, because I am not yet sure if this is a Xen,
pvops, or i915 issue - and would appreciate opinions in sorting it out.)

The symptoms of the problem exhibit themselves by a lagging mouse in X11
after resume, when using the trackpad.

After digging in a bit, the problem seems a bit more insidious - the i915
kworker responsible for hotplug detection (i915_hotplug_work_func) seems to
be getting triggered for every PS2 IRQ - every trackpad mouse movement, and
keypress triggers tracing (with drm.debug=0x06) like the following:

Nov 6 21:41:58 rusting kernel: [ 263.924454] [drm:i915_hotplug_work_func],
running encoder hotplug functions
Nov 6 21:41:58 rusting kernel: [ 263.924468]
[drm:intel_ironlake_crt_detect_hotplug], ironlake hotplug adpa=0xf40018,
result 0
Nov 6 21:41:58 rusting kernel: [ 263.924472] [drm:intel_crt_detect], CRT
not detected via hotplug
Nov 6 21:41:58 rusting kernel: [ 263.924475] [drm:output_poll_execute],
[CONNECTOR:11:VGA-1] status updated from 2 to 2
Nov 6 21:41:58 rusting kernel: [ 263.926771] [drm:drm_do_probe_ddc_edid],
drm: skipping non-existent adapter i915 gmbus dpc
Nov 6 21:41:58 rusting kernel: [ 263.926775] [drm:output_poll_execute],
[CONNECTOR:14:HDMI-A-1] status updated from 2 to 2
Nov 6 21:41:58 rusting kernel: [ 263.927291] [drm:intel_dp_aux_ch],
dp_aux_ch timeout status 0x5145003e
Nov 6 21:41:58 rusting kernel: [ 263.944207] [drm:intel_dp_aux_ch],
dp_aux_ch timeout status 0x5145003e
Nov 6 21:41:58 rusting kernel: [ 263.964201] [drm:intel_dp_aux_ch],
dp_aux_ch timeout status 0x5145003e
Nov 6 21:41:58 rusting kernel: [ 263.983694] [drm:intel_dp_detect], DPCD:
0000000000000000
Nov 6 21:41:58 rusting kernel: [ 263.983704] [drm:output_poll_execute],
[CONNECTOR:17:DP-1] status updated from 2 to 2

Additionally, this same trace stack is printed out at a regular 10s
interval, after resume - where prior to resuming from S3 it is printed out
once at boot time.

This kworker consumes a significant portion of the cpu, and essentially
grinds Xorg to a halt, until the probing can catch up with the user moving
the cursor.


There seems to be a mismatch for these IRQ delivery - or at least exhibits
the behavior similar to such a problem.


Does anyone have any thoughts as to where in the software stack I should
start to dig in?
Any opinions on which component likely contains the issue is appreciated.


/btg

--14dae9340cb7e45e4404cdea1fc5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I&#39;m trying to debug an issue on an older lapop (Toshiba Satellite A505)=
 - that has an i3 processor (M330) - and intel graphics.<div>This is runnin=
g under Xen-unstable, and a 3.7-rc4 pvops kernel - but can also be reproduc=
ed using kernels as old as 3.2.23 - and hypervisors as old as 4.0.4</div>
<div><br></div><div>(I have cross posted here, because I am not yet sure if=
 this is a Xen, pvops, or i915 issue - and would appreciate opinions in sor=
ting it out.)<br><div><br></div><div>The symptoms of the problem exhibit th=
emselves by a lagging mouse in X11 after resume, when using the trackpad.</=
div>
<div><br></div><div>After digging in a bit, the problem seems a bit more in=
sidious - the i915 kworker responsible for hotplug detection (i915_hotplug_=
work_func) seems to be getting triggered for every PS2 IRQ - every trackpad=
 mouse movement, and keypress triggers tracing (with drm.debug=3D0x06) like=
 the following:</div>
</div><div><br></div><div><div>Nov 6 21:41:58=A0rusting=A0kernel: [ 263.924=
454] [drm:i915_hotplug_work_func], running encoder hotplug functions=A0</di=
v><div>Nov 6 21:41:58=A0rusting=A0kernel: [ 263.924468] [drm:intel_ironlake=
_crt_detect_hotplug], ironlake hotplug adpa=3D0xf40018, result 0=A0</div>
<div>Nov 6 21:41:58=A0rusting=A0kernel: [ 263.924472] [drm:intel_crt_detect=
], CRT not detected via hotplug=A0</div><div>Nov 6 21:41:58=A0rusting=A0ker=
nel: [ 263.924475] [drm:output_poll_execute], [CONNECTOR:11:VGA-1] status u=
pdated from 2 to 2=A0</div>
<div>Nov 6 21:41:58=A0rusting=A0kernel: [ 263.926771] [drm:drm_do_probe_ddc=
_edid], drm: skipping non-existent adapter i915 gmbus dpc=A0</div><div>Nov =
6 21:41:58=A0rusting=A0kernel: [ 263.926775] [drm:output_poll_execute], [CO=
NNECTOR:14:HDMI-A-1] status updated from 2 to 2=A0</div>
<div>Nov 6 21:41:58=A0rusting=A0kernel: [ 263.927291] [drm:intel_dp_aux_ch]=
, dp_aux_ch timeout status 0x5145003e=A0</div><div>Nov 6 21:41:58=A0rusting=
=A0kernel: [ 263.944207] [drm:intel_dp_aux_ch], dp_aux_ch timeout status 0x=
5145003e=A0</div>
<div>Nov 6 21:41:58=A0rusting=A0kernel: [ 263.964201] [drm:intel_dp_aux_ch]=
, dp_aux_ch timeout status 0x5145003e=A0</div><div>Nov 6 21:41:58=A0rusting=
=A0kernel: [ 263.983694] [drm:intel_dp_detect], DPCD: 0000000000000000=A0</=
div><div>
Nov 6 21:41:58=A0rusting=A0kernel: [ 263.983704] [drm:output_poll_execute],=
 [CONNECTOR:17:DP-1] status updated from 2 to 2</div></div><div><br></div><=
div>Additionally, this same trace stack is printed out at a regular 10s int=
erval, after resume - where prior to resuming from S3 it is printed out onc=
e at boot time.</div>
<div><br></div><div>This kworker consumes a significant portion of the cpu,=
 and essentially grinds Xorg to a halt, until the probing can catch up with=
 the user moving the cursor.</div><div><br></div><div><br></div><div>There =
seems to be a mismatch for these IRQ delivery - or at least exhibits the be=
havior similar to such a problem.</div>
<div><br></div><div><br></div><div>Does anyone have any thoughts as to wher=
e in the software stack I should start to dig in?</div><div>Any opinions on=
 which component likely contains the issue is appreciated.</div><div><br>
</div><div><br></div><div>/btg</div><div><br></div>

--14dae9340cb7e45e4404cdea1fc5--


--===============7311888765167059898==
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.xen.org
http://lists.xen.org/xen-devel

--===============7311888765167059898==--


From xen-devel-bounces@lists.xen.org Wed Nov 07 16:22:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 16:22:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW8Og-00063N-FI; Wed, 07 Nov 2012 16:22:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ben.guthro@gmail.com>) id 1TW8Oe-000635-DI
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 16:22:32 +0000
Received: from [85.158.137.99:22495] by server-11.bemta-3.messagelabs.com id
	38/29-19361-7CA8A905; Wed, 07 Nov 2012 16:22:31 +0000
X-Env-Sender: ben.guthro@gmail.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1352305348!18174717!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_10_20,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10043 invoked from network); 7 Nov 2012 16:22:30 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 16:22:30 -0000
Received: by mail-ie0-f173.google.com with SMTP id 17so3160640iea.32
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 08:22:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type;
	bh=YQK07g2BSlmBi0YQdF4jrSd8sesp1MX44prse8KHIIk=;
	b=sWEN1ZJvvYdNOCIbxiKVVSroQwah9B3N+EqarNaAuZPk59ciFjCuj4zzPCszI4V+rG
	C/OfkvXzWEWdx2XhtDMMZBipAL0rz3WxLZLFJ8YmrXescBAd5qordU8g98hooAsXjBQb
	fTDS/iQpGYg0AkNLxAhPRELWZRduIeBuK/6GfQ8S36bN9uyP1uniXR4+WfC3gpPVbX+9
	tzO8jE53edGnhdQkHWHSkh8LXZe9dJT4ecFtsRNMACasXR5UtUvTcVowHqCQ66mOrt0i
	m9ij21U/KlirTrOxHkoTspCk78sZoG4bH6KzF9uq+2YdQFWfNj78OaPXMqqNPqxqn6Sm
	bHYw==
MIME-Version: 1.0
Received: by 10.50.40.225 with SMTP id a1mr17090604igl.7.1352305347943; Wed,
	07 Nov 2012 08:22:27 -0800 (PST)
Received: by 10.231.10.130 with HTTP; Wed, 7 Nov 2012 08:22:27 -0800 (PST)
Date: Wed, 7 Nov 2012 11:22:27 -0500
X-Google-Sender-Auth: pJU4RgwU9pc0oBwq2DoEYGSOxm0
Message-ID: <CAOvdn6UWbfwP0ysxJJOq0-AwXqee044F0NUzswQwGu4Hbv7iVg@mail.gmail.com>
From: Ben Guthro <ben@guthro.net>
To: xen-devel <xen-devel@lists.xen.org>, intel-gfx@lists.freedesktop.org
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [Xen-devel] S3 causing IRQ delivery mismatch - i915 hotplug storm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7311888765167059898=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============7311888765167059898==
Content-Type: multipart/alternative; boundary=14dae9340cb7e45e4404cdea1fc5

--14dae9340cb7e45e4404cdea1fc5
Content-Type: text/plain; charset=ISO-8859-1

I'm trying to debug an issue on an older lapop (Toshiba Satellite A505) -
that has an i3 processor (M330) - and intel graphics.
This is running under Xen-unstable, and a 3.7-rc4 pvops kernel - but can
also be reproduced using kernels as old as 3.2.23 - and hypervisors as old
as 4.0.4

(I have cross posted here, because I am not yet sure if this is a Xen,
pvops, or i915 issue - and would appreciate opinions in sorting it out.)

The symptoms of the problem exhibit themselves by a lagging mouse in X11
after resume, when using the trackpad.

After digging in a bit, the problem seems a bit more insidious - the i915
kworker responsible for hotplug detection (i915_hotplug_work_func) seems to
be getting triggered for every PS2 IRQ - every trackpad mouse movement, and
keypress triggers tracing (with drm.debug=0x06) like the following:

Nov 6 21:41:58 rusting kernel: [ 263.924454] [drm:i915_hotplug_work_func],
running encoder hotplug functions
Nov 6 21:41:58 rusting kernel: [ 263.924468]
[drm:intel_ironlake_crt_detect_hotplug], ironlake hotplug adpa=0xf40018,
result 0
Nov 6 21:41:58 rusting kernel: [ 263.924472] [drm:intel_crt_detect], CRT
not detected via hotplug
Nov 6 21:41:58 rusting kernel: [ 263.924475] [drm:output_poll_execute],
[CONNECTOR:11:VGA-1] status updated from 2 to 2
Nov 6 21:41:58 rusting kernel: [ 263.926771] [drm:drm_do_probe_ddc_edid],
drm: skipping non-existent adapter i915 gmbus dpc
Nov 6 21:41:58 rusting kernel: [ 263.926775] [drm:output_poll_execute],
[CONNECTOR:14:HDMI-A-1] status updated from 2 to 2
Nov 6 21:41:58 rusting kernel: [ 263.927291] [drm:intel_dp_aux_ch],
dp_aux_ch timeout status 0x5145003e
Nov 6 21:41:58 rusting kernel: [ 263.944207] [drm:intel_dp_aux_ch],
dp_aux_ch timeout status 0x5145003e
Nov 6 21:41:58 rusting kernel: [ 263.964201] [drm:intel_dp_aux_ch],
dp_aux_ch timeout status 0x5145003e
Nov 6 21:41:58 rusting kernel: [ 263.983694] [drm:intel_dp_detect], DPCD:
0000000000000000
Nov 6 21:41:58 rusting kernel: [ 263.983704] [drm:output_poll_execute],
[CONNECTOR:17:DP-1] status updated from 2 to 2

Additionally, this same trace stack is printed out at a regular 10s
interval, after resume - where prior to resuming from S3 it is printed out
once at boot time.

This kworker consumes a significant portion of the cpu, and essentially
grinds Xorg to a halt, until the probing can catch up with the user moving
the cursor.


There seems to be a mismatch for these IRQ delivery - or at least exhibits
the behavior similar to such a problem.


Does anyone have any thoughts as to where in the software stack I should
start to dig in?
Any opinions on which component likely contains the issue is appreciated.


/btg

--14dae9340cb7e45e4404cdea1fc5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I&#39;m trying to debug an issue on an older lapop (Toshiba Satellite A505)=
 - that has an i3 processor (M330) - and intel graphics.<div>This is runnin=
g under Xen-unstable, and a 3.7-rc4 pvops kernel - but can also be reproduc=
ed using kernels as old as 3.2.23 - and hypervisors as old as 4.0.4</div>
<div><br></div><div>(I have cross posted here, because I am not yet sure if=
 this is a Xen, pvops, or i915 issue - and would appreciate opinions in sor=
ting it out.)<br><div><br></div><div>The symptoms of the problem exhibit th=
emselves by a lagging mouse in X11 after resume, when using the trackpad.</=
div>
<div><br></div><div>After digging in a bit, the problem seems a bit more in=
sidious - the i915 kworker responsible for hotplug detection (i915_hotplug_=
work_func) seems to be getting triggered for every PS2 IRQ - every trackpad=
 mouse movement, and keypress triggers tracing (with drm.debug=3D0x06) like=
 the following:</div>
</div><div><br></div><div><div>Nov 6 21:41:58=A0rusting=A0kernel: [ 263.924=
454] [drm:i915_hotplug_work_func], running encoder hotplug functions=A0</di=
v><div>Nov 6 21:41:58=A0rusting=A0kernel: [ 263.924468] [drm:intel_ironlake=
_crt_detect_hotplug], ironlake hotplug adpa=3D0xf40018, result 0=A0</div>
<div>Nov 6 21:41:58=A0rusting=A0kernel: [ 263.924472] [drm:intel_crt_detect=
], CRT not detected via hotplug=A0</div><div>Nov 6 21:41:58=A0rusting=A0ker=
nel: [ 263.924475] [drm:output_poll_execute], [CONNECTOR:11:VGA-1] status u=
pdated from 2 to 2=A0</div>
<div>Nov 6 21:41:58=A0rusting=A0kernel: [ 263.926771] [drm:drm_do_probe_ddc=
_edid], drm: skipping non-existent adapter i915 gmbus dpc=A0</div><div>Nov =
6 21:41:58=A0rusting=A0kernel: [ 263.926775] [drm:output_poll_execute], [CO=
NNECTOR:14:HDMI-A-1] status updated from 2 to 2=A0</div>
<div>Nov 6 21:41:58=A0rusting=A0kernel: [ 263.927291] [drm:intel_dp_aux_ch]=
, dp_aux_ch timeout status 0x5145003e=A0</div><div>Nov 6 21:41:58=A0rusting=
=A0kernel: [ 263.944207] [drm:intel_dp_aux_ch], dp_aux_ch timeout status 0x=
5145003e=A0</div>
<div>Nov 6 21:41:58=A0rusting=A0kernel: [ 263.964201] [drm:intel_dp_aux_ch]=
, dp_aux_ch timeout status 0x5145003e=A0</div><div>Nov 6 21:41:58=A0rusting=
=A0kernel: [ 263.983694] [drm:intel_dp_detect], DPCD: 0000000000000000=A0</=
div><div>
Nov 6 21:41:58=A0rusting=A0kernel: [ 263.983704] [drm:output_poll_execute],=
 [CONNECTOR:17:DP-1] status updated from 2 to 2</div></div><div><br></div><=
div>Additionally, this same trace stack is printed out at a regular 10s int=
erval, after resume - where prior to resuming from S3 it is printed out onc=
e at boot time.</div>
<div><br></div><div>This kworker consumes a significant portion of the cpu,=
 and essentially grinds Xorg to a halt, until the probing can catch up with=
 the user moving the cursor.</div><div><br></div><div><br></div><div>There =
seems to be a mismatch for these IRQ delivery - or at least exhibits the be=
havior similar to such a problem.</div>
<div><br></div><div><br></div><div>Does anyone have any thoughts as to wher=
e in the software stack I should start to dig in?</div><div>Any opinions on=
 which component likely contains the issue is appreciated.</div><div><br>
</div><div><br></div><div>/btg</div><div><br></div>

--14dae9340cb7e45e4404cdea1fc5--


--===============7311888765167059898==
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.xen.org
http://lists.xen.org/xen-devel

--===============7311888765167059898==--


From xen-devel-bounces@lists.xen.org Wed Nov 07 16:40:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 16:40:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW8fJ-0006Nx-3W; Wed, 07 Nov 2012 16:39:45 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TW8fG-0006Ns-Gq
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 16:39:42 +0000
Received: from [85.158.143.99:28776] by server-3.bemta-4.messagelabs.com id
	09/8F-06841-DCE8A905; Wed, 07 Nov 2012 16:39:41 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352306380!25642286!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10032 invoked from network); 7 Nov 2012 16:39:40 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-216.messagelabs.com with SMTP;
	7 Nov 2012 16:39:40 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 07 Nov 2012 16:39:39 +0000
Message-Id: <509A9CDA02000078000A706A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 07 Nov 2012 16:39:38 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartF6C731DA.0__="
Subject: [Xen-devel] [PATCH v2] x86/ACPI: invalidate BGRT if necessary
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartF6C731DA.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Since the image pointed to may live in boot services memory (which we
add to the global memory pool long before ACPI tables get looked at),
we should prevent Dom0 from trying to retrieve the image data in that
case.

The alternatives would be to
- not add boot services memory to the global pool at all, or
- defer adding boot services memory until Dom0 indicates it is safe to
  do so, or
- find and parse the BGRT table in xen/arch/x86/efi/boot.c, and avoid
  adding that specific region to the E820 table.
None of these are really attractive, and as Xen commonly prints to the
video console anyway (without trying to avoid any regions on the
screen), the invalidation would need to be done conditionally anyway.

(xen/include/acpi/actbl3.h is a verbatim copy from Linux 3.7-rc4)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: Only invalidate if the image lives in RAM, and do the invalidation
    by clearing both the valid bit and the image address.

--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -28,6 +28,7 @@
 #include <xen/init.h>
 #include <xen/acpi.h>
 #include <xen/irq.h>
+#include <xen/mm.h>
 #include <xen/dmi.h>
 #include <asm/fixmap.h>
 #include <asm/page.h>
@@ -286,6 +287,27 @@ static int __init acpi_parse_hpet(struct
 #define	acpi_parse_hpet	NULL
 #endif
=20
+static int __init acpi_invalidate_bgrt(struct acpi_table_header *table)
+{
+	struct acpi_table_bgrt *bgrt_tbl =3D
+		container_of(table, struct acpi_table_bgrt, header);
+
+	if (table->length < sizeof(*bgrt_tbl))
+		return -1;
+
+	if (bgrt_tbl->version =3D=3D 1 && bgrt_tbl->image_address
+	    && !page_is_ram_type(PFN_DOWN(bgrt_tbl->image_address),
+				 RAM_TYPE_CONVENTIONAL))
+		return 0;
+
+	printk(KERN_INFO PREFIX "BGRT: invalidating v%d image at %#"PRIx64"=
\n",
+	       bgrt_tbl->version, bgrt_tbl->image_address);
+	bgrt_tbl->image_address =3D 0;
+	bgrt_tbl->status &=3D ~1;
+
+	return 0;
+}
+
 #ifdef CONFIG_ACPI_SLEEP
 #define acpi_fadt_copy_address(dst, src, len) do {			\
 	if (fadt->header.revision >=3D FADT2_REVISION_ID)			=
\
@@ -653,5 +675,7 @@ int __init acpi_boot_init(void)
=20
 	erst_init();
=20
+	acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt);
+
 	return 0;
 }
--- a/xen/include/acpi/actbl.h
+++ b/xen/include/acpi/actbl.h
@@ -314,6 +314,7 @@ enum acpi_prefered_pm_profiles {
=20
 #include <acpi/actbl1.h>
 #include <acpi/actbl2.h>
+#include <acpi/actbl3.h>
=20
 /*
  * Sizes of the various flavors of FADT. We need to look closely
--- /dev/null
+++ b/xen/include/acpi/actbl3.h
@@ -0,0 +1,557 @@
+/*************************************************************************=
*****
+ *
+ * Name: actbl3.h - ACPI Table Definitions
+ *
+ *************************************************************************=
****/
+
+/*
+ * Copyright (C) 2000 - 2012, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a =
disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for =
further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the =
names
+ *    of any contributors may be used to endorse or promote products =
derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENT=
IAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE =
GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#ifndef __ACTBL3_H__
+#define __ACTBL3_H__
+
+/*************************************************************************=
******
+ *
+ * Additional ACPI Tables (3)
+ *
+ * These tables are not consumed directly by the ACPICA subsystem, but =
are
+ * included here to support device drivers and the AML disassembler.
+ *
+ * The tables in this file are fully defined within the ACPI specification=
.
+ *
+ *************************************************************************=
*****/
+
+/*
+ * Values for description table header signatures for tables defined in =
this
+ * file. Useful because they make it more difficult to inadvertently type =
in
+ * the wrong signature.
+ */
+#define ACPI_SIG_BGRT           "BGRT"	/* Boot Graphics Resource Table */
+#define ACPI_SIG_DRTM           "DRTM"	/* Dynamic Root of Trust for =
Measurement table */
+#define ACPI_SIG_FPDT           "FPDT"	/* Firmware Performance Data Table =
*/
+#define ACPI_SIG_GTDT           "GTDT"	/* Generic Timer Description Table =
*/
+#define ACPI_SIG_MPST           "MPST"	/* Memory Power State Table */
+#define ACPI_SIG_PCCT           "PCCT"	/* Platform Communications Channel =
Table */
+#define ACPI_SIG_PMTT           "PMTT"	/* Platform Memory Topology Table =
*/
+#define ACPI_SIG_RASF           "RASF"	/* RAS Feature table */
+
+#define ACPI_SIG_S3PT           "S3PT"	/* S3 Performance (sub)Table */
+#define ACPI_SIG_PCCS           "PCC"	/* PCC Shared Memory Region */
+
+/* Reserved table signatures */
+
+#define ACPI_SIG_CSRT           "CSRT"	/* Core System Resources Table */
+#define ACPI_SIG_MATR           "MATR"	/* Memory Address Translation =
Table */
+#define ACPI_SIG_MSDM           "MSDM"	/* Microsoft Data Management Table =
*/
+#define ACPI_SIG_WPBT           "WPBT"	/* Windows Platform Binary Table =
*/
+
+/*
+ * All tables must be byte-packed to match the ACPI specification, since
+ * the tables are provided by the system BIOS.
+ */
+#pragma pack(1)
+
+/*
+ * Note: C bitfields are not used for this reason:
+ *
+ * "Bitfields are great and easy to read, but unfortunately the C =
language
+ * does not specify the layout of bitfields in memory, which means they =
are
+ * essentially useless for dealing with packed data in on-disk formats or
+ * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
+ * this decision was a design error in C. Ritchie could have picked an =
order
+ * and stuck with it." Norman Ramsey.
+ * See http://stackoverflow.com/a/1053662/41661=20
+ */
+
+/*************************************************************************=
******
+ *
+ * BGRT - Boot Graphics Resource Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_bgrt {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u16 version;
+	u8 status;
+	u8 image_type;
+	u64 image_address;
+	u32 image_offset_x;
+	u32 image_offset_y;
+};
+
+/*************************************************************************=
******
+ *
+ * DRTM - Dynamic Root of Trust for Measurement table
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_drtm {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u64 entry_base_address;
+	u64 entry_length;
+	u32 entry_address32;
+	u64 entry_address64;
+	u64 exit_address;
+	u64 log_area_address;
+	u32 log_area_length;
+	u64 arch_dependent_address;
+	u32 flags;
+};
+
+/* 1) Validated Tables List */
+
+struct acpi_drtm_vtl_list {
+	u32 validated_table_list_count;
+};
+
+/* 2) Resources List */
+
+struct acpi_drtm_resource_list {
+	u32 resource_list_count;
+};
+
+/* 3) Platform-specific Identifiers List */
+
+struct acpi_drtm_id_list {
+	u32 id_list_count;
+};
+
+/*************************************************************************=
******
+ *
+ * FPDT - Firmware Performance Data Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_fpdt {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+};
+
+/* FPDT subtable header */
+
+struct acpi_fpdt_header {
+	u16 type;
+	u8 length;
+	u8 revision;
+};
+
+/* Values for Type field above */
+
+enum acpi_fpdt_type {
+	ACPI_FPDT_TYPE_BOOT =3D 0,
+	ACPI_FPDT_TYPE_S3PERF =3D 1,
+};
+
+/*
+ * FPDT subtables
+ */
+
+/* 0: Firmware Basic Boot Performance Record */
+
+struct acpi_fpdt_boot {
+	struct acpi_fpdt_header header;
+	u8 reserved[4];
+	u64 reset_end;
+	u64 load_start;
+	u64 startup_start;
+	u64 exit_services_entry;
+	u64 exit_services_exit;
+};
+
+/* 1: S3 Performance Table Pointer Record */
+
+struct acpi_fpdt_s3pt_ptr {
+	struct acpi_fpdt_header header;
+	u8 reserved[4];
+	u64 address;
+};
+
+/*
+ * S3PT - S3 Performance Table. This table is pointed to by the
+ * FPDT S3 Pointer Record above.
+ */
+struct acpi_table_s3pt {
+	u8 signature[4];	/* "S3PT" */
+	u32 length;
+};
+
+/*
+ * S3PT Subtables
+ */
+struct acpi_s3pt_header {
+	u16 type;
+	u8 length;
+	u8 revision;
+};
+
+/* Values for Type field above */
+
+enum acpi_s3pt_type {
+	ACPI_S3PT_TYPE_RESUME =3D 0,
+	ACPI_S3PT_TYPE_SUSPEND =3D 1,
+};
+
+struct acpi_s3pt_resume {
+	struct acpi_s3pt_header header;
+	u32 resume_count;
+	u64 full_resume;
+	u64 average_resume;
+};
+
+struct acpi_s3pt_suspend {
+	struct acpi_s3pt_header header;
+	u64 suspend_start;
+	u64 suspend_end;
+};
+
+/*************************************************************************=
******
+ *
+ * GTDT - Generic Timer Description Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_gtdt {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u64 address;
+	u32 flags;
+	u32 secure_pl1_interrupt;
+	u32 secure_pl1_flags;
+	u32 non_secure_pl1_interrupt;
+	u32 non_secure_pl1_flags;
+	u32 virtual_timer_interrupt;
+	u32 virtual_timer_flags;
+	u32 non_secure_pl2_interrupt;
+	u32 non_secure_pl2_flags;
+};
+
+/* Values for Flags field above */
+
+#define ACPI_GTDT_MAPPED_BLOCK_PRESENT      1
+
+/* Values for all "TimerFlags" fields above */
+
+#define ACPI_GTDT_INTERRUPT_MODE            1
+#define ACPI_GTDT_INTERRUPT_POLARITY        2
+
+/*************************************************************************=
******
+ *
+ * MPST - Memory Power State Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+#define ACPI_MPST_CHANNEL_INFO \
+	u16                             reserved1; \
+	u8                              channel_id; \
+	u8                              reserved2; \
+	u16                             power_node_count;
+
+/* Main table */
+
+struct acpi_table_mpst {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	 ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel */
+};
+
+/* Memory Platform Communication Channel Info */
+
+struct acpi_mpst_channel {
+	ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel */
+};
+
+/* Memory Power Node Structure */
+
+struct acpi_mpst_power_node {
+	u8 flags;
+	u8 reserved1;
+	u16 node_id;
+	u32 length;
+	u64 range_address;
+	u64 range_length;
+	u8 num_power_states;
+	u8 num_physical_components;
+	u16 reserved2;
+};
+
+/* Values for Flags field above */
+
+#define ACPI_MPST_ENABLED               1
+#define ACPI_MPST_POWER_MANAGED         2
+#define ACPI_MPST_HOT_PLUG_CAPABLE      4
+
+/* Memory Power State Structure (follows POWER_NODE above) */
+
+struct acpi_mpst_power_state {
+	u8 power_state;
+	u8 info_index;
+};
+
+/* Physical Component ID Structure (follows POWER_STATE above) */
+
+struct acpi_mpst_component {
+	u16 component_id;
+};
+
+/* Memory Power State Characteristics Structure (follows all POWER_NODEs) =
*/
+
+struct acpi_mpst_data_hdr {
+	u16 characteristics_count;
+};
+
+struct acpi_mpst_power_data {
+	u8 revision;
+	u8 flags;
+	u16 reserved1;
+	u32 average_power;
+	u32 power_saving;
+	u64 exit_latency;
+	u64 reserved2;
+};
+
+/* Values for Flags field above */
+
+#define ACPI_MPST_PRESERVE              1
+#define ACPI_MPST_AUTOENTRY             2
+#define ACPI_MPST_AUTOEXIT              4
+
+/* Shared Memory Region (not part of an ACPI table) */
+
+struct acpi_mpst_shared {
+	u32 signature;
+	u16 pcc_command;
+	u16 pcc_status;
+	u16 command_register;
+	u16 status_register;
+	u16 power_state_id;
+	u16 power_node_id;
+	u64 energy_consumed;
+	u64 average_power;
+};
+
+/*************************************************************************=
******
+ *
+ * PCCT - Platform Communications Channel Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_pcct {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u32 flags;
+	u32 latency;
+	u32 reserved;
+};
+
+/* Values for Flags field above */
+
+#define ACPI_PCCT_DOORBELL              1
+
+/*
+ * PCCT subtables
+ */
+
+/* 0: Generic Communications Subspace */
+
+struct acpi_pcct_subspace {
+	struct acpi_subtable_header header;
+	u8 reserved[6];
+	u64 base_address;
+	u64 length;
+	struct acpi_generic_address doorbell_register;
+	u64 preserve_mask;
+	u64 write_mask;
+};
+
+/*
+ * PCC memory structures (not part of the ACPI table)
+ */
+
+/* Shared Memory Region */
+
+struct acpi_pcct_shared_memory {
+	u32 signature;
+	u16 command;
+	u16 status;
+};
+
+/*************************************************************************=
******
+ *
+ * PMTT - Platform Memory Topology Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_pmtt {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u32 reserved;
+};
+
+/* Common header for PMTT subtables that follow main table */
+
+struct acpi_pmtt_header {
+	u8 type;
+	u8 reserved1;
+	u16 length;
+	u16 flags;
+	u16 reserved2;
+};
+
+/* Values for Type field above */
+
+#define ACPI_PMTT_TYPE_SOCKET           0
+#define ACPI_PMTT_TYPE_CONTROLLER       1
+#define ACPI_PMTT_TYPE_DIMM             2
+#define ACPI_PMTT_TYPE_RESERVED         3	/* 0x03-0xFF are reserved =
*/
+
+/* Values for Flags field above */
+
+#define ACPI_PMTT_TOP_LEVEL             0x0001
+#define ACPI_PMTT_PHYSICAL              0x0002
+#define ACPI_PMTT_MEMORY_TYPE           0x000C
+
+/*
+ * PMTT subtables, correspond to Type in struct acpi_pmtt_header
+ */
+
+/* 0: Socket Structure */
+
+struct acpi_pmtt_socket {
+	struct acpi_pmtt_header header;
+	u16 socket_id;
+	u16 reserved;
+};
+
+/* 1: Memory Controller subtable */
+
+struct acpi_pmtt_controller {
+	struct acpi_pmtt_header header;
+	u32 read_latency;
+	u32 write_latency;
+	u32 read_bandwidth;
+	u32 write_bandwidth;
+	u16 access_width;
+	u16 alignment;
+	u16 reserved;
+	u16 domain_count;
+};
+
+/* 1a: Proximity Domain substructure */
+
+struct acpi_pmtt_domain {
+	u32 proximity_domain;
+};
+
+/* 2: Physical Component Identifier (DIMM) */
+
+struct acpi_pmtt_physical_component {
+	struct acpi_pmtt_header header;
+	u16 component_id;
+	u16 reserved;
+	u32 memory_size;
+	u32 bios_handle;
+};
+
+/*************************************************************************=
******
+ *
+ * RASF - RAS Feature Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_rasf {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u8 channel_id[12];
+};
+
+/* RASF Platform Communication Channel Shared Memory Region */
+
+struct acpi_rasf_shared_memory {
+	u32 signature;
+	u16 command;
+	u16 status;
+	u64 requested_address;
+	u64 requested_length;
+	u64 actual_address;
+	u64 actual_length;
+	u16 flags;
+	u8 speed;
+};
+
+/* Masks for Flags and Speed fields above */
+
+#define ACPI_RASF_SCRUBBER_RUNNING      1
+#define ACPI_RASF_SPEED                 (7<<1)
+
+/* Channel Commands */
+
+enum acpi_rasf_commands {
+	ACPI_RASF_GET_RAS_CAPABILITIES =3D 1,
+	ACPI_RASF_GET_PATROL_PARAMETERS =3D 2,
+	ACPI_RASF_START_PATROL_SCRUBBER =3D 3,
+	ACPI_RASF_STOP_PATROL_SCRUBBER =3D 4
+};
+
+/* Channel Command flags */
+
+#define ACPI_RASF_GENERATE_SCI          (1<<15)
+
+/* Status values */
+
+enum acpi_rasf_status {
+	ACPI_RASF_SUCCESS =3D 0,
+	ACPI_RASF_NOT_VALID =3D 1,
+	ACPI_RASF_NOT_SUPPORTED =3D 2,
+	ACPI_RASF_BUSY =3D 3,
+	ACPI_RASF_FAILED =3D 4,
+	ACPI_RASF_ABORTED =3D 5,
+	ACPI_RASF_INVALID_DATA =3D 6
+};
+
+/* Status flags */
+
+#define ACPI_RASF_COMMAND_COMPLETE      (1)
+#define ACPI_RASF_SCI_DOORBELL          (1<<1)
+#define ACPI_RASF_ERROR                 (1<<2)
+#define ACPI_RASF_STATUS                (0x1F<<3)
+
+/* Reset to default packing */
+
+#pragma pack()
+
+#endif				/* __ACTBL3_H__ */



--=__PartF6C731DA.0__=
Content-Type: text/plain; name="ACPI-BGRT-invalidate.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="ACPI-BGRT-invalidate.patch"

x86/ACPI: invalidate BGRT if necessary=0A=0ASince the image pointed to may =
live in boot services memory (which we=0Aadd to the global memory pool =
long before ACPI tables get looked at),=0Awe should prevent Dom0 from =
trying to retrieve the image data in that=0Acase.=0A=0AThe alternatives =
would be to=0A- not add boot services memory to the global pool at all, =
or=0A- defer adding boot services memory until Dom0 indicates it is safe =
to=0A  do so, or=0A- find and parse the BGRT table in xen/arch/x86/efi/boot=
.c, and avoid=0A  adding that specific region to the E820 table.=0ANone of =
these are really attractive, and as Xen commonly prints to the=0Avideo =
console anyway (without trying to avoid any regions on the=0Ascreen), the =
invalidation would need to be done conditionally anyway.=0A=0A(xen/include/=
acpi/actbl3.h is a verbatim copy from Linux 3.7-rc4)=0A=0ASigned-off-by: =
Jan Beulich <jbeulich@suse.com>=0A---=0Av2: Only invalidate if the image =
lives in RAM, and do the invalidation=0A    by clearing both the valid bit =
and the image address.=0A=0A--- a/xen/arch/x86/acpi/boot.c=0A+++ b/xen/arch=
/x86/acpi/boot.c=0A@@ -28,6 +28,7 @@=0A #include <xen/init.h>=0A #include =
<xen/acpi.h>=0A #include <xen/irq.h>=0A+#include <xen/mm.h>=0A #include =
<xen/dmi.h>=0A #include <asm/fixmap.h>=0A #include <asm/page.h>=0A@@ =
-286,6 +287,27 @@ static int __init acpi_parse_hpet(struct=0A #define	=
acpi_parse_hpet	NULL=0A #endif=0A =0A+static int __init acpi_invalidate_bgr=
t(struct acpi_table_header *table)=0A+{=0A+	struct acpi_table_bgrt =
*bgrt_tbl =3D=0A+		container_of(table, struct acpi_table_bgrt,=
 header);=0A+=0A+	if (table->length < sizeof(*bgrt_tbl))=0A+		=
return -1;=0A+=0A+	if (bgrt_tbl->version =3D=3D 1 && bgrt_tbl->image_a=
ddress=0A+	    && !page_is_ram_type(PFN_DOWN(bgrt_tbl->image_address),=
=0A+				 RAM_TYPE_CONVENTIONAL))=0A+		=
return 0;=0A+=0A+	printk(KERN_INFO PREFIX "BGRT: invalidating v%d =
image at %#"PRIx64"\n",=0A+	       bgrt_tbl->version, bgrt_tbl->image_a=
ddress);=0A+	bgrt_tbl->image_address =3D 0;=0A+	bgrt_tbl->status =
&=3D ~1;=0A+=0A+	return 0;=0A+}=0A+=0A #ifdef CONFIG_ACPI_SLEEP=0A =
#define acpi_fadt_copy_address(dst, src, len) do {			=
\=0A 	if (fadt->header.revision >=3D FADT2_REVISION_ID)			=
\=0A@@ -653,5 +675,7 @@ int __init acpi_boot_init(void)=0A =0A 	erst_init()=
;=0A =0A+	acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt);=0A+=
=0A 	return 0;=0A }=0A--- a/xen/include/acpi/actbl.h=0A+++ b/xen/include=
/acpi/actbl.h=0A@@ -314,6 +314,7 @@ enum acpi_prefered_pm_profiles {=0A =
=0A #include <acpi/actbl1.h>=0A #include <acpi/actbl2.h>=0A+#include =
<acpi/actbl3.h>=0A =0A /*=0A  * Sizes of the various flavors of FADT. We =
need to look closely=0A--- /dev/null=0A+++ b/xen/include/acpi/actbl3.h=0A@@=
 -0,0 +1,557 @@=0A+/*******************************************************=
***********************=0A+ *=0A+ * Name: actbl3.h - ACPI Table Definitions=
=0A+ *=0A+ ****************************************************************=
*************/=0A+=0A+/*=0A+ * Copyright (C) 2000 - 2012, Intel Corp.=0A+ =
* All rights reserved.=0A+ *=0A+ * Redistribution and use in source and =
binary forms, with or without=0A+ * modification, are permitted provided =
that the following conditions=0A+ * are met:=0A+ * 1. Redistributions of =
source code must retain the above copyright=0A+ *    notice, this list of =
conditions, and the following disclaimer,=0A+ *    without modification.=0A=
+ * 2. Redistributions in binary form must reproduce at minimum a =
disclaimer=0A+ *    substantially similar to the "NO WARRANTY" disclaimer =
below=0A+ *    ("Disclaimer") and any redistribution must be conditioned =
upon=0A+ *    including a substantially similar Disclaimer requirement for =
further=0A+ *    binary redistribution.=0A+ * 3. Neither the names of the =
above-listed copyright holders nor the names=0A+ *    of any contributors =
may be used to endorse or promote products derived=0A+ *    from this =
software without specific prior written permission.=0A+ *=0A+ * Alternative=
ly, this software may be distributed under the terms of the=0A+ * GNU =
General Public License ("GPL") version 2 as published by the Free=0A+ * =
Software Foundation.=0A+ *=0A+ * NO WARRANTY=0A+ * THIS SOFTWARE IS =
PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=0A+ * "AS IS" AND ANY =
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT=0A+ * LIMITED TO, THE =
IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR=0A+ * A PARTICULAR =
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT=0A+ * HOLDERS OR =
CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL=0A+ * =
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE =
GOODS=0A+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS =
INTERRUPTION)=0A+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER =
IN CONTRACT,=0A+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR =
OTHERWISE) ARISING=0A+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN =
IF ADVISED OF THE=0A+ * POSSIBILITY OF SUCH DAMAGES.=0A+ */=0A+=0A+#ifndef =
__ACTBL3_H__=0A+#define __ACTBL3_H__=0A+=0A+/******************************=
*************************************************=0A+ *=0A+ * Additional =
ACPI Tables (3)=0A+ *=0A+ * These tables are not consumed directly by the =
ACPICA subsystem, but are=0A+ * included here to support device drivers =
and the AML disassembler.=0A+ *=0A+ * The tables in this file are fully =
defined within the ACPI specification.=0A+ *=0A+ **************************=
****************************************************/=0A+=0A+/*=0A+ * =
Values for description table header signatures for tables defined in =
this=0A+ * file. Useful because they make it more difficult to inadvertentl=
y type in=0A+ * the wrong signature.=0A+ */=0A+#define ACPI_SIG_BGRT       =
    "BGRT"	/* Boot Graphics Resource Table */=0A+#define ACPI_SIG_DRTM=
           "DRTM"	/* Dynamic Root of Trust for Measurement table =
*/=0A+#define ACPI_SIG_FPDT           "FPDT"	/* Firmware Performance =
Data Table */=0A+#define ACPI_SIG_GTDT           "GTDT"	/* Generic Timer =
Description Table */=0A+#define ACPI_SIG_MPST           "MPST"	/* Memory =
Power State Table */=0A+#define ACPI_SIG_PCCT           "PCCT"	/* =
Platform Communications Channel Table */=0A+#define ACPI_SIG_PMTT          =
 "PMTT"	/* Platform Memory Topology Table */=0A+#define ACPI_SIG_RASF      =
     "RASF"	/* RAS Feature table */=0A+=0A+#define ACPI_SIG_S3PT       =
    "S3PT"	/* S3 Performance (sub)Table */=0A+#define ACPI_SIG_PCCS   =
        "PCC"	/* PCC Shared Memory Region */=0A+=0A+/* Reserved table =
signatures */=0A+=0A+#define ACPI_SIG_CSRT           "CSRT"	/* Core =
System Resources Table */=0A+#define ACPI_SIG_MATR           "MATR"	/* =
Memory Address Translation Table */=0A+#define ACPI_SIG_MSDM           =
"MSDM"	/* Microsoft Data Management Table */=0A+#define ACPI_SIG_WPBT     =
      "WPBT"	/* Windows Platform Binary Table */=0A+=0A+/*=0A+ * All =
tables must be byte-packed to match the ACPI specification, since=0A+ * =
the tables are provided by the system BIOS.=0A+ */=0A+#pragma pack(1)=0A+=
=0A+/*=0A+ * Note: C bitfields are not used for this reason:=0A+ *=0A+ * =
"Bitfields are great and easy to read, but unfortunately the C language=0A+=
 * does not specify the layout of bitfields in memory, which means they =
are=0A+ * essentially useless for dealing with packed data in on-disk =
formats or=0A+ * binary wire protocols." (Or ACPI tables and buffers.) "If =
you ask me,=0A+ * this decision was a design error in C. Ritchie could =
have picked an order=0A+ * and stuck with it." Norman Ramsey.=0A+ * See =
http://stackoverflow.com/a/1053662/41661=0A+ */=0A+=0A+/*******************=
************************************************************=0A+ *=0A+ * =
BGRT - Boot Graphics Resource Table (ACPI 5.0)=0A+ *        Version 1=0A+ =
*=0A+ *********************************************************************=
*********/=0A+=0A+struct acpi_table_bgrt {=0A+	struct acpi_table_header =
header;	/* Common ACPI table header */=0A+	u16 version;=0A+	u8 =
status;=0A+	u8 image_type;=0A+	u64 image_address;=0A+	u32 =
image_offset_x;=0A+	u32 image_offset_y;=0A+};=0A+=0A+/*****************=
**************************************************************=0A+ *=0A+ * =
DRTM - Dynamic Root of Trust for Measurement table=0A+ *=0A+ **************=
****************************************************************/=0A+=0A+st=
ruct acpi_table_drtm {=0A+	struct acpi_table_header header;	/* =
Common ACPI table header */=0A+	u64 entry_base_address;=0A+	u64 =
entry_length;=0A+	u32 entry_address32;=0A+	u64 entry_address64=
;=0A+	u64 exit_address;=0A+	u64 log_area_address;=0A+	u32 =
log_area_length;=0A+	u64 arch_dependent_address;=0A+	u32 flags;=0A+};=0A=
+=0A+/* 1) Validated Tables List */=0A+=0A+struct acpi_drtm_vtl_list {=0A+	=
u32 validated_table_list_count;=0A+};=0A+=0A+/* 2) Resources List =
*/=0A+=0A+struct acpi_drtm_resource_list {=0A+	u32 resource_list_count;=0A=
+};=0A+=0A+/* 3) Platform-specific Identifiers List */=0A+=0A+struct =
acpi_drtm_id_list {=0A+	u32 id_list_count;=0A+};=0A+=0A+/******************=
*************************************************************=0A+ *=0A+ * =
FPDT - Firmware Performance Data Table (ACPI 5.0)=0A+ *        Version =
1=0A+ *=0A+ ***************************************************************=
***************/=0A+=0A+struct acpi_table_fpdt {=0A+	struct acpi_table_h=
eader header;	/* Common ACPI table header */=0A+};=0A+=0A+/* FPDT =
subtable header */=0A+=0A+struct acpi_fpdt_header {=0A+	u16 type;=0A+	u8 =
length;=0A+	u8 revision;=0A+};=0A+=0A+/* Values for Type field above =
*/=0A+=0A+enum acpi_fpdt_type {=0A+	ACPI_FPDT_TYPE_BOOT =3D 0,=0A+	=
ACPI_FPDT_TYPE_S3PERF =3D 1,=0A+};=0A+=0A+/*=0A+ * FPDT subtables=0A+ =
*/=0A+=0A+/* 0: Firmware Basic Boot Performance Record */=0A+=0A+struct =
acpi_fpdt_boot {=0A+	struct acpi_fpdt_header header;=0A+	u8 =
reserved[4];=0A+	u64 reset_end;=0A+	u64 load_start;=0A+	=
u64 startup_start;=0A+	u64 exit_services_entry;=0A+	u64 exit_services_e=
xit;=0A+};=0A+=0A+/* 1: S3 Performance Table Pointer Record */=0A+=0A+struc=
t acpi_fpdt_s3pt_ptr {=0A+	struct acpi_fpdt_header header;=0A+	u8 =
reserved[4];=0A+	u64 address;=0A+};=0A+=0A+/*=0A+ * S3PT - S3 =
Performance Table. This table is pointed to by the=0A+ * FPDT S3 Pointer =
Record above.=0A+ */=0A+struct acpi_table_s3pt {=0A+	u8 signature[4];	=
/* "S3PT" */=0A+	u32 length;=0A+};=0A+=0A+/*=0A+ * S3PT Subtables=0A=
+ */=0A+struct acpi_s3pt_header {=0A+	u16 type;=0A+	u8 length;=0A+	u8 =
revision;=0A+};=0A+=0A+/* Values for Type field above */=0A+=0A+enum =
acpi_s3pt_type {=0A+	ACPI_S3PT_TYPE_RESUME =3D 0,=0A+	ACPI_S3PT_T=
YPE_SUSPEND =3D 1,=0A+};=0A+=0A+struct acpi_s3pt_resume {=0A+	struct =
acpi_s3pt_header header;=0A+	u32 resume_count;=0A+	u64 full_resume;=0A=
+	u64 average_resume;=0A+};=0A+=0A+struct acpi_s3pt_suspend {=0A+	=
struct acpi_s3pt_header header;=0A+	u64 suspend_start;=0A+	u64 =
suspend_end;=0A+};=0A+=0A+/************************************************=
*******************************=0A+ *=0A+ * GTDT - Generic Timer Descriptio=
n Table (ACPI 5.0)=0A+ *        Version 1=0A+ *=0A+ ***********************=
*******************************************************/=0A+=0A+struct =
acpi_table_gtdt {=0A+	struct acpi_table_header header;	/* Common =
ACPI table header */=0A+	u64 address;=0A+	u32 flags;=0A+	=
u32 secure_pl1_interrupt;=0A+	u32 secure_pl1_flags;=0A+	u32 =
non_secure_pl1_interrupt;=0A+	u32 non_secure_pl1_flags;=0A+	u32 =
virtual_timer_interrupt;=0A+	u32 virtual_timer_flags;=0A+	u32 =
non_secure_pl2_interrupt;=0A+	u32 non_secure_pl2_flags;=0A+};=0A+=0A+/* =
Values for Flags field above */=0A+=0A+#define ACPI_GTDT_MAPPED_BLOCK_PRESE=
NT      1=0A+=0A+/* Values for all "TimerFlags" fields above */=0A+=0A+#def=
ine ACPI_GTDT_INTERRUPT_MODE            1=0A+#define ACPI_GTDT_INTERRUPT_PO=
LARITY        2=0A+=0A+/***************************************************=
****************************=0A+ *=0A+ * MPST - Memory Power State Table =
(ACPI 5.0)=0A+ *        Version 1=0A+ *=0A+ *******************************=
***********************************************/=0A+=0A+#define ACPI_MPST_C=
HANNEL_INFO \=0A+	u16                             reserved1; \=0A+	=
u8                              channel_id; \=0A+	u8                 =
             reserved2; \=0A+	u16                             power_node_=
count;=0A+=0A+/* Main table */=0A+=0A+struct acpi_table_mpst {=0A+	=
struct acpi_table_header header;	/* Common ACPI table header */=0A+	=
 ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel */=0A+};=0A+=0A+/=
* Memory Platform Communication Channel Info */=0A+=0A+struct acpi_mpst_cha=
nnel {=0A+	ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel =
*/=0A+};=0A+=0A+/* Memory Power Node Structure */=0A+=0A+struct acpi_mpst_p=
ower_node {=0A+	u8 flags;=0A+	u8 reserved1;=0A+	u16 node_id;=0A+	=
u32 length;=0A+	u64 range_address;=0A+	u64 range_length;=0A+	u8 =
num_power_states;=0A+	u8 num_physical_components;=0A+	u16 reserved2;=0A+}=
;=0A+=0A+/* Values for Flags field above */=0A+=0A+#define ACPI_MPST_ENABLE=
D               1=0A+#define ACPI_MPST_POWER_MANAGED         2=0A+#define =
ACPI_MPST_HOT_PLUG_CAPABLE      4=0A+=0A+/* Memory Power State Structure =
(follows POWER_NODE above) */=0A+=0A+struct acpi_mpst_power_state {=0A+	u8 =
power_state;=0A+	u8 info_index;=0A+};=0A+=0A+/* Physical Component =
ID Structure (follows POWER_STATE above) */=0A+=0A+struct acpi_mpst_compone=
nt {=0A+	u16 component_id;=0A+};=0A+=0A+/* Memory Power State =
Characteristics Structure (follows all POWER_NODEs) */=0A+=0A+struct =
acpi_mpst_data_hdr {=0A+	u16 characteristics_count;=0A+};=0A+=0A+str=
uct acpi_mpst_power_data {=0A+	u8 revision;=0A+	u8 flags;=0A+	=
u16 reserved1;=0A+	u32 average_power;=0A+	u32 power_saving;=0A+	=
u64 exit_latency;=0A+	u64 reserved2;=0A+};=0A+=0A+/* Values for Flags =
field above */=0A+=0A+#define ACPI_MPST_PRESERVE              1=0A+#define =
ACPI_MPST_AUTOENTRY             2=0A+#define ACPI_MPST_AUTOEXIT            =
  4=0A+=0A+/* Shared Memory Region (not part of an ACPI table) */=0A+=0A+st=
ruct acpi_mpst_shared {=0A+	u32 signature;=0A+	u16 pcc_command;=0A=
+	u16 pcc_status;=0A+	u16 command_register;=0A+	u16 =
status_register;=0A+	u16 power_state_id;=0A+	u16 power_node_id;=0A+	=
u64 energy_consumed;=0A+	u64 average_power;=0A+};=0A+=0A+/**********=
*********************************************************************=0A+ =
*=0A+ * PCCT - Platform Communications Channel Table (ACPI 5.0)=0A+ *      =
  Version 1=0A+ *=0A+ *****************************************************=
*************************/=0A+=0A+struct acpi_table_pcct {=0A+	struct =
acpi_table_header header;	/* Common ACPI table header */=0A+	=
u32 flags;=0A+	u32 latency;=0A+	u32 reserved;=0A+};=0A+=0A+/* =
Values for Flags field above */=0A+=0A+#define ACPI_PCCT_DOORBELL          =
    1=0A+=0A+/*=0A+ * PCCT subtables=0A+ */=0A+=0A+/* 0: Generic Communicat=
ions Subspace */=0A+=0A+struct acpi_pcct_subspace {=0A+	struct acpi_subtabl=
e_header header;=0A+	u8 reserved[6];=0A+	u64 base_address;=0A+	=
u64 length;=0A+	struct acpi_generic_address doorbell_register;=0A+	=
u64 preserve_mask;=0A+	u64 write_mask;=0A+};=0A+=0A+/*=0A+ * PCC memory =
structures (not part of the ACPI table)=0A+ */=0A+=0A+/* Shared Memory =
Region */=0A+=0A+struct acpi_pcct_shared_memory {=0A+	u32 signature;=0A+	=
u16 command;=0A+	u16 status;=0A+};=0A+=0A+/*************************=
******************************************************=0A+ *=0A+ * PMTT - =
Platform Memory Topology Table (ACPI 5.0)=0A+ *        Version 1=0A+ *=0A+ =
***************************************************************************=
***/=0A+=0A+struct acpi_table_pmtt {=0A+	struct acpi_table_header =
header;	/* Common ACPI table header */=0A+	u32 reserved;=0A+};=0A+=0A+=
/* Common header for PMTT subtables that follow main table */=0A+=0A+struct=
 acpi_pmtt_header {=0A+	u8 type;=0A+	u8 reserved1;=0A+	u16 =
length;=0A+	u16 flags;=0A+	u16 reserved2;=0A+};=0A+=0A+/* Values for =
Type field above */=0A+=0A+#define ACPI_PMTT_TYPE_SOCKET           =
0=0A+#define ACPI_PMTT_TYPE_CONTROLLER       1=0A+#define ACPI_PMTT_TYPE_DI=
MM             2=0A+#define ACPI_PMTT_TYPE_RESERVED         3	/* =
0x03-0xFF are reserved */=0A+=0A+/* Values for Flags field above */=0A+=0A+=
#define ACPI_PMTT_TOP_LEVEL             0x0001=0A+#define ACPI_PMTT_PHYSICA=
L              0x0002=0A+#define ACPI_PMTT_MEMORY_TYPE           0x000C=0A+=
=0A+/*=0A+ * PMTT subtables, correspond to Type in struct acpi_pmtt_header=
=0A+ */=0A+=0A+/* 0: Socket Structure */=0A+=0A+struct acpi_pmtt_socket =
{=0A+	struct acpi_pmtt_header header;=0A+	u16 socket_id;=0A+	=
u16 reserved;=0A+};=0A+=0A+/* 1: Memory Controller subtable */=0A+=0A+struc=
t acpi_pmtt_controller {=0A+	struct acpi_pmtt_header header;=0A+	=
u32 read_latency;=0A+	u32 write_latency;=0A+	u32 read_bandwidth;=0A+	=
u32 write_bandwidth;=0A+	u16 access_width;=0A+	u16 alignment;=0A+	=
u16 reserved;=0A+	u16 domain_count;=0A+};=0A+=0A+/* 1a: Proximity =
Domain substructure */=0A+=0A+struct acpi_pmtt_domain {=0A+	u32 =
proximity_domain;=0A+};=0A+=0A+/* 2: Physical Component Identifier (DIMM) =
*/=0A+=0A+struct acpi_pmtt_physical_component {=0A+	struct acpi_pmtt_he=
ader header;=0A+	u16 component_id;=0A+	u16 reserved;=0A+	=
u32 memory_size;=0A+	u32 bios_handle;=0A+};=0A+=0A+/********************=
***********************************************************=0A+ *=0A+ * =
RASF - RAS Feature Table (ACPI 5.0)=0A+ *        Version 1=0A+ *=0A+ =
***************************************************************************=
***/=0A+=0A+struct acpi_table_rasf {=0A+	struct acpi_table_header =
header;	/* Common ACPI table header */=0A+	u8 channel_id[12];=0A+};=0A=
+=0A+/* RASF Platform Communication Channel Shared Memory Region */=0A+=0A+=
struct acpi_rasf_shared_memory {=0A+	u32 signature;=0A+	u16 =
command;=0A+	u16 status;=0A+	u64 requested_address;=0A+	u64 =
requested_length;=0A+	u64 actual_address;=0A+	u64 actual_length;=0A+	=
u16 flags;=0A+	u8 speed;=0A+};=0A+=0A+/* Masks for Flags and Speed fields =
above */=0A+=0A+#define ACPI_RASF_SCRUBBER_RUNNING      1=0A+#define =
ACPI_RASF_SPEED                 (7<<1)=0A+=0A+/* Channel Commands =
*/=0A+=0A+enum acpi_rasf_commands {=0A+	ACPI_RASF_GET_RAS_CAPABILITIES =3D =
1,=0A+	ACPI_RASF_GET_PATROL_PARAMETERS =3D 2,=0A+	ACPI_RASF_START_PAT=
ROL_SCRUBBER =3D 3,=0A+	ACPI_RASF_STOP_PATROL_SCRUBBER =3D 4=0A+};=0A+=0A+/=
* Channel Command flags */=0A+=0A+#define ACPI_RASF_GENERATE_SCI          =
(1<<15)=0A+=0A+/* Status values */=0A+=0A+enum acpi_rasf_status {=0A+	=
ACPI_RASF_SUCCESS =3D 0,=0A+	ACPI_RASF_NOT_VALID =3D 1,=0A+	ACPI_RASF_N=
OT_SUPPORTED =3D 2,=0A+	ACPI_RASF_BUSY =3D 3,=0A+	ACPI_RASF_FAILED =
=3D 4,=0A+	ACPI_RASF_ABORTED =3D 5,=0A+	ACPI_RASF_INVALID_DATA =3D =
6=0A+};=0A+=0A+/* Status flags */=0A+=0A+#define ACPI_RASF_COMMAND_COMPLETE=
      (1)=0A+#define ACPI_RASF_SCI_DOORBELL          (1<<1)=0A+#define =
ACPI_RASF_ERROR                 (1<<2)=0A+#define ACPI_RASF_STATUS         =
       (0x1F<<3)=0A+=0A+/* Reset to default packing */=0A+=0A+#pragma =
pack()=0A+=0A+#endif				/* __ACTBL3_H__ */=0A
--=__PartF6C731DA.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.xen.org
http://lists.xen.org/xen-devel

--=__PartF6C731DA.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 07 16:40:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 16:40:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW8fJ-0006Nx-3W; Wed, 07 Nov 2012 16:39:45 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TW8fG-0006Ns-Gq
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 16:39:42 +0000
Received: from [85.158.143.99:28776] by server-3.bemta-4.messagelabs.com id
	09/8F-06841-DCE8A905; Wed, 07 Nov 2012 16:39:41 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352306380!25642286!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10032 invoked from network); 7 Nov 2012 16:39:40 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-216.messagelabs.com with SMTP;
	7 Nov 2012 16:39:40 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 07 Nov 2012 16:39:39 +0000
Message-Id: <509A9CDA02000078000A706A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 07 Nov 2012 16:39:38 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartF6C731DA.0__="
Subject: [Xen-devel] [PATCH v2] x86/ACPI: invalidate BGRT if necessary
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartF6C731DA.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Since the image pointed to may live in boot services memory (which we
add to the global memory pool long before ACPI tables get looked at),
we should prevent Dom0 from trying to retrieve the image data in that
case.

The alternatives would be to
- not add boot services memory to the global pool at all, or
- defer adding boot services memory until Dom0 indicates it is safe to
  do so, or
- find and parse the BGRT table in xen/arch/x86/efi/boot.c, and avoid
  adding that specific region to the E820 table.
None of these are really attractive, and as Xen commonly prints to the
video console anyway (without trying to avoid any regions on the
screen), the invalidation would need to be done conditionally anyway.

(xen/include/acpi/actbl3.h is a verbatim copy from Linux 3.7-rc4)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: Only invalidate if the image lives in RAM, and do the invalidation
    by clearing both the valid bit and the image address.

--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -28,6 +28,7 @@
 #include <xen/init.h>
 #include <xen/acpi.h>
 #include <xen/irq.h>
+#include <xen/mm.h>
 #include <xen/dmi.h>
 #include <asm/fixmap.h>
 #include <asm/page.h>
@@ -286,6 +287,27 @@ static int __init acpi_parse_hpet(struct
 #define	acpi_parse_hpet	NULL
 #endif
=20
+static int __init acpi_invalidate_bgrt(struct acpi_table_header *table)
+{
+	struct acpi_table_bgrt *bgrt_tbl =3D
+		container_of(table, struct acpi_table_bgrt, header);
+
+	if (table->length < sizeof(*bgrt_tbl))
+		return -1;
+
+	if (bgrt_tbl->version =3D=3D 1 && bgrt_tbl->image_address
+	    && !page_is_ram_type(PFN_DOWN(bgrt_tbl->image_address),
+				 RAM_TYPE_CONVENTIONAL))
+		return 0;
+
+	printk(KERN_INFO PREFIX "BGRT: invalidating v%d image at %#"PRIx64"=
\n",
+	       bgrt_tbl->version, bgrt_tbl->image_address);
+	bgrt_tbl->image_address =3D 0;
+	bgrt_tbl->status &=3D ~1;
+
+	return 0;
+}
+
 #ifdef CONFIG_ACPI_SLEEP
 #define acpi_fadt_copy_address(dst, src, len) do {			\
 	if (fadt->header.revision >=3D FADT2_REVISION_ID)			=
\
@@ -653,5 +675,7 @@ int __init acpi_boot_init(void)
=20
 	erst_init();
=20
+	acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt);
+
 	return 0;
 }
--- a/xen/include/acpi/actbl.h
+++ b/xen/include/acpi/actbl.h
@@ -314,6 +314,7 @@ enum acpi_prefered_pm_profiles {
=20
 #include <acpi/actbl1.h>
 #include <acpi/actbl2.h>
+#include <acpi/actbl3.h>
=20
 /*
  * Sizes of the various flavors of FADT. We need to look closely
--- /dev/null
+++ b/xen/include/acpi/actbl3.h
@@ -0,0 +1,557 @@
+/*************************************************************************=
*****
+ *
+ * Name: actbl3.h - ACPI Table Definitions
+ *
+ *************************************************************************=
****/
+
+/*
+ * Copyright (C) 2000 - 2012, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a =
disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for =
further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the =
names
+ *    of any contributors may be used to endorse or promote products =
derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENT=
IAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE =
GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#ifndef __ACTBL3_H__
+#define __ACTBL3_H__
+
+/*************************************************************************=
******
+ *
+ * Additional ACPI Tables (3)
+ *
+ * These tables are not consumed directly by the ACPICA subsystem, but =
are
+ * included here to support device drivers and the AML disassembler.
+ *
+ * The tables in this file are fully defined within the ACPI specification=
.
+ *
+ *************************************************************************=
*****/
+
+/*
+ * Values for description table header signatures for tables defined in =
this
+ * file. Useful because they make it more difficult to inadvertently type =
in
+ * the wrong signature.
+ */
+#define ACPI_SIG_BGRT           "BGRT"	/* Boot Graphics Resource Table */
+#define ACPI_SIG_DRTM           "DRTM"	/* Dynamic Root of Trust for =
Measurement table */
+#define ACPI_SIG_FPDT           "FPDT"	/* Firmware Performance Data Table =
*/
+#define ACPI_SIG_GTDT           "GTDT"	/* Generic Timer Description Table =
*/
+#define ACPI_SIG_MPST           "MPST"	/* Memory Power State Table */
+#define ACPI_SIG_PCCT           "PCCT"	/* Platform Communications Channel =
Table */
+#define ACPI_SIG_PMTT           "PMTT"	/* Platform Memory Topology Table =
*/
+#define ACPI_SIG_RASF           "RASF"	/* RAS Feature table */
+
+#define ACPI_SIG_S3PT           "S3PT"	/* S3 Performance (sub)Table */
+#define ACPI_SIG_PCCS           "PCC"	/* PCC Shared Memory Region */
+
+/* Reserved table signatures */
+
+#define ACPI_SIG_CSRT           "CSRT"	/* Core System Resources Table */
+#define ACPI_SIG_MATR           "MATR"	/* Memory Address Translation =
Table */
+#define ACPI_SIG_MSDM           "MSDM"	/* Microsoft Data Management Table =
*/
+#define ACPI_SIG_WPBT           "WPBT"	/* Windows Platform Binary Table =
*/
+
+/*
+ * All tables must be byte-packed to match the ACPI specification, since
+ * the tables are provided by the system BIOS.
+ */
+#pragma pack(1)
+
+/*
+ * Note: C bitfields are not used for this reason:
+ *
+ * "Bitfields are great and easy to read, but unfortunately the C =
language
+ * does not specify the layout of bitfields in memory, which means they =
are
+ * essentially useless for dealing with packed data in on-disk formats or
+ * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
+ * this decision was a design error in C. Ritchie could have picked an =
order
+ * and stuck with it." Norman Ramsey.
+ * See http://stackoverflow.com/a/1053662/41661=20
+ */
+
+/*************************************************************************=
******
+ *
+ * BGRT - Boot Graphics Resource Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_bgrt {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u16 version;
+	u8 status;
+	u8 image_type;
+	u64 image_address;
+	u32 image_offset_x;
+	u32 image_offset_y;
+};
+
+/*************************************************************************=
******
+ *
+ * DRTM - Dynamic Root of Trust for Measurement table
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_drtm {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u64 entry_base_address;
+	u64 entry_length;
+	u32 entry_address32;
+	u64 entry_address64;
+	u64 exit_address;
+	u64 log_area_address;
+	u32 log_area_length;
+	u64 arch_dependent_address;
+	u32 flags;
+};
+
+/* 1) Validated Tables List */
+
+struct acpi_drtm_vtl_list {
+	u32 validated_table_list_count;
+};
+
+/* 2) Resources List */
+
+struct acpi_drtm_resource_list {
+	u32 resource_list_count;
+};
+
+/* 3) Platform-specific Identifiers List */
+
+struct acpi_drtm_id_list {
+	u32 id_list_count;
+};
+
+/*************************************************************************=
******
+ *
+ * FPDT - Firmware Performance Data Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_fpdt {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+};
+
+/* FPDT subtable header */
+
+struct acpi_fpdt_header {
+	u16 type;
+	u8 length;
+	u8 revision;
+};
+
+/* Values for Type field above */
+
+enum acpi_fpdt_type {
+	ACPI_FPDT_TYPE_BOOT =3D 0,
+	ACPI_FPDT_TYPE_S3PERF =3D 1,
+};
+
+/*
+ * FPDT subtables
+ */
+
+/* 0: Firmware Basic Boot Performance Record */
+
+struct acpi_fpdt_boot {
+	struct acpi_fpdt_header header;
+	u8 reserved[4];
+	u64 reset_end;
+	u64 load_start;
+	u64 startup_start;
+	u64 exit_services_entry;
+	u64 exit_services_exit;
+};
+
+/* 1: S3 Performance Table Pointer Record */
+
+struct acpi_fpdt_s3pt_ptr {
+	struct acpi_fpdt_header header;
+	u8 reserved[4];
+	u64 address;
+};
+
+/*
+ * S3PT - S3 Performance Table. This table is pointed to by the
+ * FPDT S3 Pointer Record above.
+ */
+struct acpi_table_s3pt {
+	u8 signature[4];	/* "S3PT" */
+	u32 length;
+};
+
+/*
+ * S3PT Subtables
+ */
+struct acpi_s3pt_header {
+	u16 type;
+	u8 length;
+	u8 revision;
+};
+
+/* Values for Type field above */
+
+enum acpi_s3pt_type {
+	ACPI_S3PT_TYPE_RESUME =3D 0,
+	ACPI_S3PT_TYPE_SUSPEND =3D 1,
+};
+
+struct acpi_s3pt_resume {
+	struct acpi_s3pt_header header;
+	u32 resume_count;
+	u64 full_resume;
+	u64 average_resume;
+};
+
+struct acpi_s3pt_suspend {
+	struct acpi_s3pt_header header;
+	u64 suspend_start;
+	u64 suspend_end;
+};
+
+/*************************************************************************=
******
+ *
+ * GTDT - Generic Timer Description Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_gtdt {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u64 address;
+	u32 flags;
+	u32 secure_pl1_interrupt;
+	u32 secure_pl1_flags;
+	u32 non_secure_pl1_interrupt;
+	u32 non_secure_pl1_flags;
+	u32 virtual_timer_interrupt;
+	u32 virtual_timer_flags;
+	u32 non_secure_pl2_interrupt;
+	u32 non_secure_pl2_flags;
+};
+
+/* Values for Flags field above */
+
+#define ACPI_GTDT_MAPPED_BLOCK_PRESENT      1
+
+/* Values for all "TimerFlags" fields above */
+
+#define ACPI_GTDT_INTERRUPT_MODE            1
+#define ACPI_GTDT_INTERRUPT_POLARITY        2
+
+/*************************************************************************=
******
+ *
+ * MPST - Memory Power State Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+#define ACPI_MPST_CHANNEL_INFO \
+	u16                             reserved1; \
+	u8                              channel_id; \
+	u8                              reserved2; \
+	u16                             power_node_count;
+
+/* Main table */
+
+struct acpi_table_mpst {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	 ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel */
+};
+
+/* Memory Platform Communication Channel Info */
+
+struct acpi_mpst_channel {
+	ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel */
+};
+
+/* Memory Power Node Structure */
+
+struct acpi_mpst_power_node {
+	u8 flags;
+	u8 reserved1;
+	u16 node_id;
+	u32 length;
+	u64 range_address;
+	u64 range_length;
+	u8 num_power_states;
+	u8 num_physical_components;
+	u16 reserved2;
+};
+
+/* Values for Flags field above */
+
+#define ACPI_MPST_ENABLED               1
+#define ACPI_MPST_POWER_MANAGED         2
+#define ACPI_MPST_HOT_PLUG_CAPABLE      4
+
+/* Memory Power State Structure (follows POWER_NODE above) */
+
+struct acpi_mpst_power_state {
+	u8 power_state;
+	u8 info_index;
+};
+
+/* Physical Component ID Structure (follows POWER_STATE above) */
+
+struct acpi_mpst_component {
+	u16 component_id;
+};
+
+/* Memory Power State Characteristics Structure (follows all POWER_NODEs) =
*/
+
+struct acpi_mpst_data_hdr {
+	u16 characteristics_count;
+};
+
+struct acpi_mpst_power_data {
+	u8 revision;
+	u8 flags;
+	u16 reserved1;
+	u32 average_power;
+	u32 power_saving;
+	u64 exit_latency;
+	u64 reserved2;
+};
+
+/* Values for Flags field above */
+
+#define ACPI_MPST_PRESERVE              1
+#define ACPI_MPST_AUTOENTRY             2
+#define ACPI_MPST_AUTOEXIT              4
+
+/* Shared Memory Region (not part of an ACPI table) */
+
+struct acpi_mpst_shared {
+	u32 signature;
+	u16 pcc_command;
+	u16 pcc_status;
+	u16 command_register;
+	u16 status_register;
+	u16 power_state_id;
+	u16 power_node_id;
+	u64 energy_consumed;
+	u64 average_power;
+};
+
+/*************************************************************************=
******
+ *
+ * PCCT - Platform Communications Channel Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_pcct {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u32 flags;
+	u32 latency;
+	u32 reserved;
+};
+
+/* Values for Flags field above */
+
+#define ACPI_PCCT_DOORBELL              1
+
+/*
+ * PCCT subtables
+ */
+
+/* 0: Generic Communications Subspace */
+
+struct acpi_pcct_subspace {
+	struct acpi_subtable_header header;
+	u8 reserved[6];
+	u64 base_address;
+	u64 length;
+	struct acpi_generic_address doorbell_register;
+	u64 preserve_mask;
+	u64 write_mask;
+};
+
+/*
+ * PCC memory structures (not part of the ACPI table)
+ */
+
+/* Shared Memory Region */
+
+struct acpi_pcct_shared_memory {
+	u32 signature;
+	u16 command;
+	u16 status;
+};
+
+/*************************************************************************=
******
+ *
+ * PMTT - Platform Memory Topology Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_pmtt {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u32 reserved;
+};
+
+/* Common header for PMTT subtables that follow main table */
+
+struct acpi_pmtt_header {
+	u8 type;
+	u8 reserved1;
+	u16 length;
+	u16 flags;
+	u16 reserved2;
+};
+
+/* Values for Type field above */
+
+#define ACPI_PMTT_TYPE_SOCKET           0
+#define ACPI_PMTT_TYPE_CONTROLLER       1
+#define ACPI_PMTT_TYPE_DIMM             2
+#define ACPI_PMTT_TYPE_RESERVED         3	/* 0x03-0xFF are reserved =
*/
+
+/* Values for Flags field above */
+
+#define ACPI_PMTT_TOP_LEVEL             0x0001
+#define ACPI_PMTT_PHYSICAL              0x0002
+#define ACPI_PMTT_MEMORY_TYPE           0x000C
+
+/*
+ * PMTT subtables, correspond to Type in struct acpi_pmtt_header
+ */
+
+/* 0: Socket Structure */
+
+struct acpi_pmtt_socket {
+	struct acpi_pmtt_header header;
+	u16 socket_id;
+	u16 reserved;
+};
+
+/* 1: Memory Controller subtable */
+
+struct acpi_pmtt_controller {
+	struct acpi_pmtt_header header;
+	u32 read_latency;
+	u32 write_latency;
+	u32 read_bandwidth;
+	u32 write_bandwidth;
+	u16 access_width;
+	u16 alignment;
+	u16 reserved;
+	u16 domain_count;
+};
+
+/* 1a: Proximity Domain substructure */
+
+struct acpi_pmtt_domain {
+	u32 proximity_domain;
+};
+
+/* 2: Physical Component Identifier (DIMM) */
+
+struct acpi_pmtt_physical_component {
+	struct acpi_pmtt_header header;
+	u16 component_id;
+	u16 reserved;
+	u32 memory_size;
+	u32 bios_handle;
+};
+
+/*************************************************************************=
******
+ *
+ * RASF - RAS Feature Table (ACPI 5.0)
+ *        Version 1
+ *
+ *************************************************************************=
*****/
+
+struct acpi_table_rasf {
+	struct acpi_table_header header;	/* Common ACPI table =
header */
+	u8 channel_id[12];
+};
+
+/* RASF Platform Communication Channel Shared Memory Region */
+
+struct acpi_rasf_shared_memory {
+	u32 signature;
+	u16 command;
+	u16 status;
+	u64 requested_address;
+	u64 requested_length;
+	u64 actual_address;
+	u64 actual_length;
+	u16 flags;
+	u8 speed;
+};
+
+/* Masks for Flags and Speed fields above */
+
+#define ACPI_RASF_SCRUBBER_RUNNING      1
+#define ACPI_RASF_SPEED                 (7<<1)
+
+/* Channel Commands */
+
+enum acpi_rasf_commands {
+	ACPI_RASF_GET_RAS_CAPABILITIES =3D 1,
+	ACPI_RASF_GET_PATROL_PARAMETERS =3D 2,
+	ACPI_RASF_START_PATROL_SCRUBBER =3D 3,
+	ACPI_RASF_STOP_PATROL_SCRUBBER =3D 4
+};
+
+/* Channel Command flags */
+
+#define ACPI_RASF_GENERATE_SCI          (1<<15)
+
+/* Status values */
+
+enum acpi_rasf_status {
+	ACPI_RASF_SUCCESS =3D 0,
+	ACPI_RASF_NOT_VALID =3D 1,
+	ACPI_RASF_NOT_SUPPORTED =3D 2,
+	ACPI_RASF_BUSY =3D 3,
+	ACPI_RASF_FAILED =3D 4,
+	ACPI_RASF_ABORTED =3D 5,
+	ACPI_RASF_INVALID_DATA =3D 6
+};
+
+/* Status flags */
+
+#define ACPI_RASF_COMMAND_COMPLETE      (1)
+#define ACPI_RASF_SCI_DOORBELL          (1<<1)
+#define ACPI_RASF_ERROR                 (1<<2)
+#define ACPI_RASF_STATUS                (0x1F<<3)
+
+/* Reset to default packing */
+
+#pragma pack()
+
+#endif				/* __ACTBL3_H__ */



--=__PartF6C731DA.0__=
Content-Type: text/plain; name="ACPI-BGRT-invalidate.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="ACPI-BGRT-invalidate.patch"

x86/ACPI: invalidate BGRT if necessary=0A=0ASince the image pointed to may =
live in boot services memory (which we=0Aadd to the global memory pool =
long before ACPI tables get looked at),=0Awe should prevent Dom0 from =
trying to retrieve the image data in that=0Acase.=0A=0AThe alternatives =
would be to=0A- not add boot services memory to the global pool at all, =
or=0A- defer adding boot services memory until Dom0 indicates it is safe =
to=0A  do so, or=0A- find and parse the BGRT table in xen/arch/x86/efi/boot=
.c, and avoid=0A  adding that specific region to the E820 table.=0ANone of =
these are really attractive, and as Xen commonly prints to the=0Avideo =
console anyway (without trying to avoid any regions on the=0Ascreen), the =
invalidation would need to be done conditionally anyway.=0A=0A(xen/include/=
acpi/actbl3.h is a verbatim copy from Linux 3.7-rc4)=0A=0ASigned-off-by: =
Jan Beulich <jbeulich@suse.com>=0A---=0Av2: Only invalidate if the image =
lives in RAM, and do the invalidation=0A    by clearing both the valid bit =
and the image address.=0A=0A--- a/xen/arch/x86/acpi/boot.c=0A+++ b/xen/arch=
/x86/acpi/boot.c=0A@@ -28,6 +28,7 @@=0A #include <xen/init.h>=0A #include =
<xen/acpi.h>=0A #include <xen/irq.h>=0A+#include <xen/mm.h>=0A #include =
<xen/dmi.h>=0A #include <asm/fixmap.h>=0A #include <asm/page.h>=0A@@ =
-286,6 +287,27 @@ static int __init acpi_parse_hpet(struct=0A #define	=
acpi_parse_hpet	NULL=0A #endif=0A =0A+static int __init acpi_invalidate_bgr=
t(struct acpi_table_header *table)=0A+{=0A+	struct acpi_table_bgrt =
*bgrt_tbl =3D=0A+		container_of(table, struct acpi_table_bgrt,=
 header);=0A+=0A+	if (table->length < sizeof(*bgrt_tbl))=0A+		=
return -1;=0A+=0A+	if (bgrt_tbl->version =3D=3D 1 && bgrt_tbl->image_a=
ddress=0A+	    && !page_is_ram_type(PFN_DOWN(bgrt_tbl->image_address),=
=0A+				 RAM_TYPE_CONVENTIONAL))=0A+		=
return 0;=0A+=0A+	printk(KERN_INFO PREFIX "BGRT: invalidating v%d =
image at %#"PRIx64"\n",=0A+	       bgrt_tbl->version, bgrt_tbl->image_a=
ddress);=0A+	bgrt_tbl->image_address =3D 0;=0A+	bgrt_tbl->status =
&=3D ~1;=0A+=0A+	return 0;=0A+}=0A+=0A #ifdef CONFIG_ACPI_SLEEP=0A =
#define acpi_fadt_copy_address(dst, src, len) do {			=
\=0A 	if (fadt->header.revision >=3D FADT2_REVISION_ID)			=
\=0A@@ -653,5 +675,7 @@ int __init acpi_boot_init(void)=0A =0A 	erst_init()=
;=0A =0A+	acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt);=0A+=
=0A 	return 0;=0A }=0A--- a/xen/include/acpi/actbl.h=0A+++ b/xen/include=
/acpi/actbl.h=0A@@ -314,6 +314,7 @@ enum acpi_prefered_pm_profiles {=0A =
=0A #include <acpi/actbl1.h>=0A #include <acpi/actbl2.h>=0A+#include =
<acpi/actbl3.h>=0A =0A /*=0A  * Sizes of the various flavors of FADT. We =
need to look closely=0A--- /dev/null=0A+++ b/xen/include/acpi/actbl3.h=0A@@=
 -0,0 +1,557 @@=0A+/*******************************************************=
***********************=0A+ *=0A+ * Name: actbl3.h - ACPI Table Definitions=
=0A+ *=0A+ ****************************************************************=
*************/=0A+=0A+/*=0A+ * Copyright (C) 2000 - 2012, Intel Corp.=0A+ =
* All rights reserved.=0A+ *=0A+ * Redistribution and use in source and =
binary forms, with or without=0A+ * modification, are permitted provided =
that the following conditions=0A+ * are met:=0A+ * 1. Redistributions of =
source code must retain the above copyright=0A+ *    notice, this list of =
conditions, and the following disclaimer,=0A+ *    without modification.=0A=
+ * 2. Redistributions in binary form must reproduce at minimum a =
disclaimer=0A+ *    substantially similar to the "NO WARRANTY" disclaimer =
below=0A+ *    ("Disclaimer") and any redistribution must be conditioned =
upon=0A+ *    including a substantially similar Disclaimer requirement for =
further=0A+ *    binary redistribution.=0A+ * 3. Neither the names of the =
above-listed copyright holders nor the names=0A+ *    of any contributors =
may be used to endorse or promote products derived=0A+ *    from this =
software without specific prior written permission.=0A+ *=0A+ * Alternative=
ly, this software may be distributed under the terms of the=0A+ * GNU =
General Public License ("GPL") version 2 as published by the Free=0A+ * =
Software Foundation.=0A+ *=0A+ * NO WARRANTY=0A+ * THIS SOFTWARE IS =
PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=0A+ * "AS IS" AND ANY =
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT=0A+ * LIMITED TO, THE =
IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR=0A+ * A PARTICULAR =
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT=0A+ * HOLDERS OR =
CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL=0A+ * =
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE =
GOODS=0A+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS =
INTERRUPTION)=0A+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER =
IN CONTRACT,=0A+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR =
OTHERWISE) ARISING=0A+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN =
IF ADVISED OF THE=0A+ * POSSIBILITY OF SUCH DAMAGES.=0A+ */=0A+=0A+#ifndef =
__ACTBL3_H__=0A+#define __ACTBL3_H__=0A+=0A+/******************************=
*************************************************=0A+ *=0A+ * Additional =
ACPI Tables (3)=0A+ *=0A+ * These tables are not consumed directly by the =
ACPICA subsystem, but are=0A+ * included here to support device drivers =
and the AML disassembler.=0A+ *=0A+ * The tables in this file are fully =
defined within the ACPI specification.=0A+ *=0A+ **************************=
****************************************************/=0A+=0A+/*=0A+ * =
Values for description table header signatures for tables defined in =
this=0A+ * file. Useful because they make it more difficult to inadvertentl=
y type in=0A+ * the wrong signature.=0A+ */=0A+#define ACPI_SIG_BGRT       =
    "BGRT"	/* Boot Graphics Resource Table */=0A+#define ACPI_SIG_DRTM=
           "DRTM"	/* Dynamic Root of Trust for Measurement table =
*/=0A+#define ACPI_SIG_FPDT           "FPDT"	/* Firmware Performance =
Data Table */=0A+#define ACPI_SIG_GTDT           "GTDT"	/* Generic Timer =
Description Table */=0A+#define ACPI_SIG_MPST           "MPST"	/* Memory =
Power State Table */=0A+#define ACPI_SIG_PCCT           "PCCT"	/* =
Platform Communications Channel Table */=0A+#define ACPI_SIG_PMTT          =
 "PMTT"	/* Platform Memory Topology Table */=0A+#define ACPI_SIG_RASF      =
     "RASF"	/* RAS Feature table */=0A+=0A+#define ACPI_SIG_S3PT       =
    "S3PT"	/* S3 Performance (sub)Table */=0A+#define ACPI_SIG_PCCS   =
        "PCC"	/* PCC Shared Memory Region */=0A+=0A+/* Reserved table =
signatures */=0A+=0A+#define ACPI_SIG_CSRT           "CSRT"	/* Core =
System Resources Table */=0A+#define ACPI_SIG_MATR           "MATR"	/* =
Memory Address Translation Table */=0A+#define ACPI_SIG_MSDM           =
"MSDM"	/* Microsoft Data Management Table */=0A+#define ACPI_SIG_WPBT     =
      "WPBT"	/* Windows Platform Binary Table */=0A+=0A+/*=0A+ * All =
tables must be byte-packed to match the ACPI specification, since=0A+ * =
the tables are provided by the system BIOS.=0A+ */=0A+#pragma pack(1)=0A+=
=0A+/*=0A+ * Note: C bitfields are not used for this reason:=0A+ *=0A+ * =
"Bitfields are great and easy to read, but unfortunately the C language=0A+=
 * does not specify the layout of bitfields in memory, which means they =
are=0A+ * essentially useless for dealing with packed data in on-disk =
formats or=0A+ * binary wire protocols." (Or ACPI tables and buffers.) "If =
you ask me,=0A+ * this decision was a design error in C. Ritchie could =
have picked an order=0A+ * and stuck with it." Norman Ramsey.=0A+ * See =
http://stackoverflow.com/a/1053662/41661=0A+ */=0A+=0A+/*******************=
************************************************************=0A+ *=0A+ * =
BGRT - Boot Graphics Resource Table (ACPI 5.0)=0A+ *        Version 1=0A+ =
*=0A+ *********************************************************************=
*********/=0A+=0A+struct acpi_table_bgrt {=0A+	struct acpi_table_header =
header;	/* Common ACPI table header */=0A+	u16 version;=0A+	u8 =
status;=0A+	u8 image_type;=0A+	u64 image_address;=0A+	u32 =
image_offset_x;=0A+	u32 image_offset_y;=0A+};=0A+=0A+/*****************=
**************************************************************=0A+ *=0A+ * =
DRTM - Dynamic Root of Trust for Measurement table=0A+ *=0A+ **************=
****************************************************************/=0A+=0A+st=
ruct acpi_table_drtm {=0A+	struct acpi_table_header header;	/* =
Common ACPI table header */=0A+	u64 entry_base_address;=0A+	u64 =
entry_length;=0A+	u32 entry_address32;=0A+	u64 entry_address64=
;=0A+	u64 exit_address;=0A+	u64 log_area_address;=0A+	u32 =
log_area_length;=0A+	u64 arch_dependent_address;=0A+	u32 flags;=0A+};=0A=
+=0A+/* 1) Validated Tables List */=0A+=0A+struct acpi_drtm_vtl_list {=0A+	=
u32 validated_table_list_count;=0A+};=0A+=0A+/* 2) Resources List =
*/=0A+=0A+struct acpi_drtm_resource_list {=0A+	u32 resource_list_count;=0A=
+};=0A+=0A+/* 3) Platform-specific Identifiers List */=0A+=0A+struct =
acpi_drtm_id_list {=0A+	u32 id_list_count;=0A+};=0A+=0A+/******************=
*************************************************************=0A+ *=0A+ * =
FPDT - Firmware Performance Data Table (ACPI 5.0)=0A+ *        Version =
1=0A+ *=0A+ ***************************************************************=
***************/=0A+=0A+struct acpi_table_fpdt {=0A+	struct acpi_table_h=
eader header;	/* Common ACPI table header */=0A+};=0A+=0A+/* FPDT =
subtable header */=0A+=0A+struct acpi_fpdt_header {=0A+	u16 type;=0A+	u8 =
length;=0A+	u8 revision;=0A+};=0A+=0A+/* Values for Type field above =
*/=0A+=0A+enum acpi_fpdt_type {=0A+	ACPI_FPDT_TYPE_BOOT =3D 0,=0A+	=
ACPI_FPDT_TYPE_S3PERF =3D 1,=0A+};=0A+=0A+/*=0A+ * FPDT subtables=0A+ =
*/=0A+=0A+/* 0: Firmware Basic Boot Performance Record */=0A+=0A+struct =
acpi_fpdt_boot {=0A+	struct acpi_fpdt_header header;=0A+	u8 =
reserved[4];=0A+	u64 reset_end;=0A+	u64 load_start;=0A+	=
u64 startup_start;=0A+	u64 exit_services_entry;=0A+	u64 exit_services_e=
xit;=0A+};=0A+=0A+/* 1: S3 Performance Table Pointer Record */=0A+=0A+struc=
t acpi_fpdt_s3pt_ptr {=0A+	struct acpi_fpdt_header header;=0A+	u8 =
reserved[4];=0A+	u64 address;=0A+};=0A+=0A+/*=0A+ * S3PT - S3 =
Performance Table. This table is pointed to by the=0A+ * FPDT S3 Pointer =
Record above.=0A+ */=0A+struct acpi_table_s3pt {=0A+	u8 signature[4];	=
/* "S3PT" */=0A+	u32 length;=0A+};=0A+=0A+/*=0A+ * S3PT Subtables=0A=
+ */=0A+struct acpi_s3pt_header {=0A+	u16 type;=0A+	u8 length;=0A+	u8 =
revision;=0A+};=0A+=0A+/* Values for Type field above */=0A+=0A+enum =
acpi_s3pt_type {=0A+	ACPI_S3PT_TYPE_RESUME =3D 0,=0A+	ACPI_S3PT_T=
YPE_SUSPEND =3D 1,=0A+};=0A+=0A+struct acpi_s3pt_resume {=0A+	struct =
acpi_s3pt_header header;=0A+	u32 resume_count;=0A+	u64 full_resume;=0A=
+	u64 average_resume;=0A+};=0A+=0A+struct acpi_s3pt_suspend {=0A+	=
struct acpi_s3pt_header header;=0A+	u64 suspend_start;=0A+	u64 =
suspend_end;=0A+};=0A+=0A+/************************************************=
*******************************=0A+ *=0A+ * GTDT - Generic Timer Descriptio=
n Table (ACPI 5.0)=0A+ *        Version 1=0A+ *=0A+ ***********************=
*******************************************************/=0A+=0A+struct =
acpi_table_gtdt {=0A+	struct acpi_table_header header;	/* Common =
ACPI table header */=0A+	u64 address;=0A+	u32 flags;=0A+	=
u32 secure_pl1_interrupt;=0A+	u32 secure_pl1_flags;=0A+	u32 =
non_secure_pl1_interrupt;=0A+	u32 non_secure_pl1_flags;=0A+	u32 =
virtual_timer_interrupt;=0A+	u32 virtual_timer_flags;=0A+	u32 =
non_secure_pl2_interrupt;=0A+	u32 non_secure_pl2_flags;=0A+};=0A+=0A+/* =
Values for Flags field above */=0A+=0A+#define ACPI_GTDT_MAPPED_BLOCK_PRESE=
NT      1=0A+=0A+/* Values for all "TimerFlags" fields above */=0A+=0A+#def=
ine ACPI_GTDT_INTERRUPT_MODE            1=0A+#define ACPI_GTDT_INTERRUPT_PO=
LARITY        2=0A+=0A+/***************************************************=
****************************=0A+ *=0A+ * MPST - Memory Power State Table =
(ACPI 5.0)=0A+ *        Version 1=0A+ *=0A+ *******************************=
***********************************************/=0A+=0A+#define ACPI_MPST_C=
HANNEL_INFO \=0A+	u16                             reserved1; \=0A+	=
u8                              channel_id; \=0A+	u8                 =
             reserved2; \=0A+	u16                             power_node_=
count;=0A+=0A+/* Main table */=0A+=0A+struct acpi_table_mpst {=0A+	=
struct acpi_table_header header;	/* Common ACPI table header */=0A+	=
 ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel */=0A+};=0A+=0A+/=
* Memory Platform Communication Channel Info */=0A+=0A+struct acpi_mpst_cha=
nnel {=0A+	ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel =
*/=0A+};=0A+=0A+/* Memory Power Node Structure */=0A+=0A+struct acpi_mpst_p=
ower_node {=0A+	u8 flags;=0A+	u8 reserved1;=0A+	u16 node_id;=0A+	=
u32 length;=0A+	u64 range_address;=0A+	u64 range_length;=0A+	u8 =
num_power_states;=0A+	u8 num_physical_components;=0A+	u16 reserved2;=0A+}=
;=0A+=0A+/* Values for Flags field above */=0A+=0A+#define ACPI_MPST_ENABLE=
D               1=0A+#define ACPI_MPST_POWER_MANAGED         2=0A+#define =
ACPI_MPST_HOT_PLUG_CAPABLE      4=0A+=0A+/* Memory Power State Structure =
(follows POWER_NODE above) */=0A+=0A+struct acpi_mpst_power_state {=0A+	u8 =
power_state;=0A+	u8 info_index;=0A+};=0A+=0A+/* Physical Component =
ID Structure (follows POWER_STATE above) */=0A+=0A+struct acpi_mpst_compone=
nt {=0A+	u16 component_id;=0A+};=0A+=0A+/* Memory Power State =
Characteristics Structure (follows all POWER_NODEs) */=0A+=0A+struct =
acpi_mpst_data_hdr {=0A+	u16 characteristics_count;=0A+};=0A+=0A+str=
uct acpi_mpst_power_data {=0A+	u8 revision;=0A+	u8 flags;=0A+	=
u16 reserved1;=0A+	u32 average_power;=0A+	u32 power_saving;=0A+	=
u64 exit_latency;=0A+	u64 reserved2;=0A+};=0A+=0A+/* Values for Flags =
field above */=0A+=0A+#define ACPI_MPST_PRESERVE              1=0A+#define =
ACPI_MPST_AUTOENTRY             2=0A+#define ACPI_MPST_AUTOEXIT            =
  4=0A+=0A+/* Shared Memory Region (not part of an ACPI table) */=0A+=0A+st=
ruct acpi_mpst_shared {=0A+	u32 signature;=0A+	u16 pcc_command;=0A=
+	u16 pcc_status;=0A+	u16 command_register;=0A+	u16 =
status_register;=0A+	u16 power_state_id;=0A+	u16 power_node_id;=0A+	=
u64 energy_consumed;=0A+	u64 average_power;=0A+};=0A+=0A+/**********=
*********************************************************************=0A+ =
*=0A+ * PCCT - Platform Communications Channel Table (ACPI 5.0)=0A+ *      =
  Version 1=0A+ *=0A+ *****************************************************=
*************************/=0A+=0A+struct acpi_table_pcct {=0A+	struct =
acpi_table_header header;	/* Common ACPI table header */=0A+	=
u32 flags;=0A+	u32 latency;=0A+	u32 reserved;=0A+};=0A+=0A+/* =
Values for Flags field above */=0A+=0A+#define ACPI_PCCT_DOORBELL          =
    1=0A+=0A+/*=0A+ * PCCT subtables=0A+ */=0A+=0A+/* 0: Generic Communicat=
ions Subspace */=0A+=0A+struct acpi_pcct_subspace {=0A+	struct acpi_subtabl=
e_header header;=0A+	u8 reserved[6];=0A+	u64 base_address;=0A+	=
u64 length;=0A+	struct acpi_generic_address doorbell_register;=0A+	=
u64 preserve_mask;=0A+	u64 write_mask;=0A+};=0A+=0A+/*=0A+ * PCC memory =
structures (not part of the ACPI table)=0A+ */=0A+=0A+/* Shared Memory =
Region */=0A+=0A+struct acpi_pcct_shared_memory {=0A+	u32 signature;=0A+	=
u16 command;=0A+	u16 status;=0A+};=0A+=0A+/*************************=
******************************************************=0A+ *=0A+ * PMTT - =
Platform Memory Topology Table (ACPI 5.0)=0A+ *        Version 1=0A+ *=0A+ =
***************************************************************************=
***/=0A+=0A+struct acpi_table_pmtt {=0A+	struct acpi_table_header =
header;	/* Common ACPI table header */=0A+	u32 reserved;=0A+};=0A+=0A+=
/* Common header for PMTT subtables that follow main table */=0A+=0A+struct=
 acpi_pmtt_header {=0A+	u8 type;=0A+	u8 reserved1;=0A+	u16 =
length;=0A+	u16 flags;=0A+	u16 reserved2;=0A+};=0A+=0A+/* Values for =
Type field above */=0A+=0A+#define ACPI_PMTT_TYPE_SOCKET           =
0=0A+#define ACPI_PMTT_TYPE_CONTROLLER       1=0A+#define ACPI_PMTT_TYPE_DI=
MM             2=0A+#define ACPI_PMTT_TYPE_RESERVED         3	/* =
0x03-0xFF are reserved */=0A+=0A+/* Values for Flags field above */=0A+=0A+=
#define ACPI_PMTT_TOP_LEVEL             0x0001=0A+#define ACPI_PMTT_PHYSICA=
L              0x0002=0A+#define ACPI_PMTT_MEMORY_TYPE           0x000C=0A+=
=0A+/*=0A+ * PMTT subtables, correspond to Type in struct acpi_pmtt_header=
=0A+ */=0A+=0A+/* 0: Socket Structure */=0A+=0A+struct acpi_pmtt_socket =
{=0A+	struct acpi_pmtt_header header;=0A+	u16 socket_id;=0A+	=
u16 reserved;=0A+};=0A+=0A+/* 1: Memory Controller subtable */=0A+=0A+struc=
t acpi_pmtt_controller {=0A+	struct acpi_pmtt_header header;=0A+	=
u32 read_latency;=0A+	u32 write_latency;=0A+	u32 read_bandwidth;=0A+	=
u32 write_bandwidth;=0A+	u16 access_width;=0A+	u16 alignment;=0A+	=
u16 reserved;=0A+	u16 domain_count;=0A+};=0A+=0A+/* 1a: Proximity =
Domain substructure */=0A+=0A+struct acpi_pmtt_domain {=0A+	u32 =
proximity_domain;=0A+};=0A+=0A+/* 2: Physical Component Identifier (DIMM) =
*/=0A+=0A+struct acpi_pmtt_physical_component {=0A+	struct acpi_pmtt_he=
ader header;=0A+	u16 component_id;=0A+	u16 reserved;=0A+	=
u32 memory_size;=0A+	u32 bios_handle;=0A+};=0A+=0A+/********************=
***********************************************************=0A+ *=0A+ * =
RASF - RAS Feature Table (ACPI 5.0)=0A+ *        Version 1=0A+ *=0A+ =
***************************************************************************=
***/=0A+=0A+struct acpi_table_rasf {=0A+	struct acpi_table_header =
header;	/* Common ACPI table header */=0A+	u8 channel_id[12];=0A+};=0A=
+=0A+/* RASF Platform Communication Channel Shared Memory Region */=0A+=0A+=
struct acpi_rasf_shared_memory {=0A+	u32 signature;=0A+	u16 =
command;=0A+	u16 status;=0A+	u64 requested_address;=0A+	u64 =
requested_length;=0A+	u64 actual_address;=0A+	u64 actual_length;=0A+	=
u16 flags;=0A+	u8 speed;=0A+};=0A+=0A+/* Masks for Flags and Speed fields =
above */=0A+=0A+#define ACPI_RASF_SCRUBBER_RUNNING      1=0A+#define =
ACPI_RASF_SPEED                 (7<<1)=0A+=0A+/* Channel Commands =
*/=0A+=0A+enum acpi_rasf_commands {=0A+	ACPI_RASF_GET_RAS_CAPABILITIES =3D =
1,=0A+	ACPI_RASF_GET_PATROL_PARAMETERS =3D 2,=0A+	ACPI_RASF_START_PAT=
ROL_SCRUBBER =3D 3,=0A+	ACPI_RASF_STOP_PATROL_SCRUBBER =3D 4=0A+};=0A+=0A+/=
* Channel Command flags */=0A+=0A+#define ACPI_RASF_GENERATE_SCI          =
(1<<15)=0A+=0A+/* Status values */=0A+=0A+enum acpi_rasf_status {=0A+	=
ACPI_RASF_SUCCESS =3D 0,=0A+	ACPI_RASF_NOT_VALID =3D 1,=0A+	ACPI_RASF_N=
OT_SUPPORTED =3D 2,=0A+	ACPI_RASF_BUSY =3D 3,=0A+	ACPI_RASF_FAILED =
=3D 4,=0A+	ACPI_RASF_ABORTED =3D 5,=0A+	ACPI_RASF_INVALID_DATA =3D =
6=0A+};=0A+=0A+/* Status flags */=0A+=0A+#define ACPI_RASF_COMMAND_COMPLETE=
      (1)=0A+#define ACPI_RASF_SCI_DOORBELL          (1<<1)=0A+#define =
ACPI_RASF_ERROR                 (1<<2)=0A+#define ACPI_RASF_STATUS         =
       (0x1F<<3)=0A+=0A+/* Reset to default packing */=0A+=0A+#pragma =
pack()=0A+=0A+#endif				/* __ACTBL3_H__ */=0A
--=__PartF6C731DA.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.xen.org
http://lists.xen.org/xen-devel

--=__PartF6C731DA.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 07 16:53:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 16:53:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW8s7-0006bn-MT; Wed, 07 Nov 2012 16:52:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TW8s6-0006bi-LO
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 16:52:58 +0000
Received: from [85.158.137.99:55510] by server-6.bemta-3.messagelabs.com id
	D2/DD-28265-8E19A905; Wed, 07 Nov 2012 16:52:56 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1352307175!17278506!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzE5NjA5\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22372 invoked from network); 7 Nov 2012 16:52:56 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-11.tower-217.messagelabs.com with SMTP;
	7 Nov 2012 16:52:56 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga101.jf.intel.com with ESMTP; 07 Nov 2012 08:52:54 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,730,1344236400"; d="scan'208";a="216385186"
Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37])
	by orsmga001.jf.intel.com with ESMTP; 07 Nov 2012 08:52:52 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 08:52:52 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Thu, 8 Nov 2012 00:52:50 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thread-Topic: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
Thread-Index: AQHNvQFcTi91BiFLfUibRvXA4zlK85felYuw
Date: Wed, 7 Nov 2012 16:52:50 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537BB2F@SHSMSX101.ccr.corp.intel.com>
References: <20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
	<alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537B147@SHSMSX101.ccr.corp.intel.com>
	<alpine.DEB.2.02.1211061455150.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B479@SHSMSX101.ccr.corp.intel.com>
	<20121106164303.GO9966@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC829233537B99E@SHSMSX101.ccr.corp.intel.com>
	<20121107160301.GF18615@phenom.dumpdata.com>
In-Reply-To: <20121107160301.GF18615@phenom.dumpdata.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Konrad Rzeszutek Wilk wrote:
> On Wed, Nov 07, 2012 at 12:58:19PM +0000, Liu, Jinsong wrote:
>>>>> 
>>>>> If it is generic ACPI code, than it can depend only on ACPI.
>>>>> If it is ACPI code that contains X86 specific info, than it needs
>>>>> to depend on X86 too.
>>>> 
>>>> No x86 specific so let's depend on ACPI.
>>> 
>>> Huh? This feature is x86 specific isn't it? I mean it is in the ACPI
>>> spec, but only x86 does it right?
>> 
>> OK, updated w/ ACPI & X86 dependency, and per other comments.
> 
> Ok. Could you send all the patchset in one go. I am bit lost of which
> one to review as none of them seem to have the version information
> [vX: Did this yyy]

Not quite clear your meaning, do you mean not reply old email and start a new thread with title like
[PATCH vX 1/2]: xen/acpi: ACPI PAD driver
[PATCH vX 2/2]: ...
?

> 
> right above your name or in the title:
> [PATCH vX 1/2]: yyyy
> 
> anyhow, some comments below.
> 

OK.

Thanks,
Jinsong

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 16:53:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 16:53:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW8s7-0006bn-MT; Wed, 07 Nov 2012 16:52:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TW8s6-0006bi-LO
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 16:52:58 +0000
Received: from [85.158.137.99:55510] by server-6.bemta-3.messagelabs.com id
	D2/DD-28265-8E19A905; Wed, 07 Nov 2012 16:52:56 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1352307175!17278506!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzE5NjA5\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22372 invoked from network); 7 Nov 2012 16:52:56 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-11.tower-217.messagelabs.com with SMTP;
	7 Nov 2012 16:52:56 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga101.jf.intel.com with ESMTP; 07 Nov 2012 08:52:54 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,730,1344236400"; d="scan'208";a="216385186"
Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37])
	by orsmga001.jf.intel.com with ESMTP; 07 Nov 2012 08:52:52 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 08:52:52 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Thu, 8 Nov 2012 00:52:50 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thread-Topic: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
Thread-Index: AQHNvQFcTi91BiFLfUibRvXA4zlK85felYuw
Date: Wed, 7 Nov 2012 16:52:50 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537BB2F@SHSMSX101.ccr.corp.intel.com>
References: <20121026201409.GF2708@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC8292335377346@SHSMSX101.ccr.corp.intel.com>
	<20121102164937.GC27213@konrad-lan.dumpdata.com>
	<alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537B147@SHSMSX101.ccr.corp.intel.com>
	<alpine.DEB.2.02.1211061455150.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B479@SHSMSX101.ccr.corp.intel.com>
	<20121106164303.GO9966@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC829233537B99E@SHSMSX101.ccr.corp.intel.com>
	<20121107160301.GF18615@phenom.dumpdata.com>
In-Reply-To: <20121107160301.GF18615@phenom.dumpdata.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Konrad Rzeszutek Wilk wrote:
> On Wed, Nov 07, 2012 at 12:58:19PM +0000, Liu, Jinsong wrote:
>>>>> 
>>>>> If it is generic ACPI code, than it can depend only on ACPI.
>>>>> If it is ACPI code that contains X86 specific info, than it needs
>>>>> to depend on X86 too.
>>>> 
>>>> No x86 specific so let's depend on ACPI.
>>> 
>>> Huh? This feature is x86 specific isn't it? I mean it is in the ACPI
>>> spec, but only x86 does it right?
>> 
>> OK, updated w/ ACPI & X86 dependency, and per other comments.
> 
> Ok. Could you send all the patchset in one go. I am bit lost of which
> one to review as none of them seem to have the version information
> [vX: Did this yyy]

Not quite clear your meaning, do you mean not reply old email and start a new thread with title like
[PATCH vX 1/2]: xen/acpi: ACPI PAD driver
[PATCH vX 2/2]: ...
?

> 
> right above your name or in the title:
> [PATCH vX 1/2]: yyyy
> 
> anyhow, some comments below.
> 

OK.

Thanks,
Jinsong

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 17:03:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 17:03:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW91Z-0006qQ-SN; Wed, 07 Nov 2012 17:02:45 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TW91Y-0006qL-Am
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 17:02:44 +0000
Received: from [85.158.138.51:31415] by server-11.bemta-3.messagelabs.com id
	A3/0E-19361-3349A905; Wed, 07 Nov 2012 17:02:43 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1352307761!9388328!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQ3MzM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26324 invoked from network); 7 Nov 2012 17:02:42 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 17:02:42 -0000
X-IronPort-AV: E=Sophos;i="4.80,730,1344211200"; d="scan'208";a="213764264"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 17:02:41 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 7 Nov 2012 12:02:41 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TW91U-0004bk-9r;
	Wed, 07 Nov 2012 17:02:40 +0000
MIME-Version: 1.0
X-Mercurial-Node: 71eeac989efca6a590051edc3dd132df1bd55f7b
Message-ID: <71eeac989efca6a59005.1352307432@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 7 Nov 2012 16:57:12 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH] xenalyze: Make eip_list output more useful
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1352307402 0
# Node ID 71eeac989efca6a590051edc3dd132df1bd55f7b
# Parent  2080678babbfd5234536af913a768a7f18cca690
xenalyze: Make eip_list output more useful

1. Count the total number of samples
2. If the samples don't have associated cycle data, print the percentage
of samples of the total
3. Use 12 characters, so 64-bit addresses are aligned properly.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/xenalyze.c b/xenalyze.c
--- a/xenalyze.c
+++ b/xenalyze.c
@@ -2962,6 +2962,7 @@ void update_eip(struct eip_list_struct *
 void dump_eip(struct eip_list_struct *head) {
     struct eip_list_struct *p;
     int i;
+    int total = 0;
 
     struct eip_list_struct **qsort_array;
     int N=0;
@@ -2984,7 +2985,10 @@ void dump_eip(struct eip_list_struct *he
     }
 
     for(p=head; p; p=p->next)
+    {
+        total += p->summary.count;
         N++;
+    }
 
     if(!N)
         return;
@@ -3003,11 +3007,25 @@ void dump_eip(struct eip_list_struct *he
         N=opt.summary_eip_limit;
 #endif
 
+    printf("   Total samples: %d\n", total);
+    
     for(i=0; i<N; i++) {
         p = qsort_array[i];
-        PRINT_SUMMARY(p->summary, "   %8llx%-45s: ",
-                      p->eip,
-                      find_symbol(p->eip));
+        if ( p->summary.cycles )
+            PRINT_SUMMARY(p->summary, "   %12llx%-45s: ",
+                          p->eip,
+                          find_symbol(p->eip));
+        else
+        {
+            printf("   %12llx%-45s: ",
+                          p->eip,
+                          find_symbol(p->eip));
+            printf(" %7d %5.2lf%%\n",
+                   p->summary.count,
+                   ((double)p->summary.count*100)/total);
+        }
+
+            
         if(eip_list_type[p->type].dump) {
             eip_list_type[p->type].dump(p);
         }

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 17:03:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 17:03:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW91Z-0006qQ-SN; Wed, 07 Nov 2012 17:02:45 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TW91Y-0006qL-Am
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 17:02:44 +0000
Received: from [85.158.138.51:31415] by server-11.bemta-3.messagelabs.com id
	A3/0E-19361-3349A905; Wed, 07 Nov 2012 17:02:43 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1352307761!9388328!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQ3MzM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26324 invoked from network); 7 Nov 2012 17:02:42 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 17:02:42 -0000
X-IronPort-AV: E=Sophos;i="4.80,730,1344211200"; d="scan'208";a="213764264"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 17:02:41 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 7 Nov 2012 12:02:41 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TW91U-0004bk-9r;
	Wed, 07 Nov 2012 17:02:40 +0000
MIME-Version: 1.0
X-Mercurial-Node: 71eeac989efca6a590051edc3dd132df1bd55f7b
Message-ID: <71eeac989efca6a59005.1352307432@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 7 Nov 2012 16:57:12 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH] xenalyze: Make eip_list output more useful
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1352307402 0
# Node ID 71eeac989efca6a590051edc3dd132df1bd55f7b
# Parent  2080678babbfd5234536af913a768a7f18cca690
xenalyze: Make eip_list output more useful

1. Count the total number of samples
2. If the samples don't have associated cycle data, print the percentage
of samples of the total
3. Use 12 characters, so 64-bit addresses are aligned properly.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/xenalyze.c b/xenalyze.c
--- a/xenalyze.c
+++ b/xenalyze.c
@@ -2962,6 +2962,7 @@ void update_eip(struct eip_list_struct *
 void dump_eip(struct eip_list_struct *head) {
     struct eip_list_struct *p;
     int i;
+    int total = 0;
 
     struct eip_list_struct **qsort_array;
     int N=0;
@@ -2984,7 +2985,10 @@ void dump_eip(struct eip_list_struct *he
     }
 
     for(p=head; p; p=p->next)
+    {
+        total += p->summary.count;
         N++;
+    }
 
     if(!N)
         return;
@@ -3003,11 +3007,25 @@ void dump_eip(struct eip_list_struct *he
         N=opt.summary_eip_limit;
 #endif
 
+    printf("   Total samples: %d\n", total);
+    
     for(i=0; i<N; i++) {
         p = qsort_array[i];
-        PRINT_SUMMARY(p->summary, "   %8llx%-45s: ",
-                      p->eip,
-                      find_symbol(p->eip));
+        if ( p->summary.cycles )
+            PRINT_SUMMARY(p->summary, "   %12llx%-45s: ",
+                          p->eip,
+                          find_symbol(p->eip));
+        else
+        {
+            printf("   %12llx%-45s: ",
+                          p->eip,
+                          find_symbol(p->eip));
+            printf(" %7d %5.2lf%%\n",
+                   p->summary.count,
+                   ((double)p->summary.count*100)/total);
+        }
+
+            
         if(eip_list_type[p->type].dump) {
             eip_list_type[p->type].dump(p);
         }

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 17:07:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 17:07:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW967-0006yF-Ic; Wed, 07 Nov 2012 17:07:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TW965-0006yA-Tk
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 17:07:26 +0000
Received: from [85.158.139.83:62608] by server-1.bemta-5.messagelabs.com id
	B6/CF-05877-C459A905; Wed, 07 Nov 2012 17:07:24 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352308044!28529338!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7393 invoked from network); 7 Nov 2012 17:07:24 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-182.messagelabs.com with SMTP;
	7 Nov 2012 17:07:24 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 07 Nov 2012 17:07:23 +0000
Message-Id: <509AA35B02000078000A7092@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 07 Nov 2012 17:07:23 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <Philippe.Simonet@swisscom.com>,"Keir Fraser" <keir@xen.org>
References: <FF93AF260AC2BB499A119CC65B092CF731516BBA@sg000713.corproot.net>
In-Reply-To: <FF93AF260AC2BB499A119CC65B092CF731516BBA@sg000713.corproot.net>
Mime-Version: 1.0
Content-Disposition: inline
Cc: 599161@bugs.debian.org, xen-devel@lists.xen.org, mrsanna1@gmail.com,
	Ian Campbell <ijc@hellion.org.uk>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 07.11.12 at 11:10, <Philippe.Simonet@swisscom.com> wrote:
> i compiled  a patched hypervisor for Mauro, it is running since many days 
> and the overflow occured, 
> without clock jumps
> 
>> (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
>> tsc_stamp=e3839fcb0273

i.e. we have (in order of time)

 plt_wrap=5ece12d09306
      now=5ece12d16292
  plt_now=5ece12d34128

which is exactly the inverse order of how things should be (now not
necessarily being in the middle). Nor should plt_now and plt_wrap be
that close together. So far I have no idea how this can be explained.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 17:07:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 17:07:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW967-0006yF-Ic; Wed, 07 Nov 2012 17:07:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TW965-0006yA-Tk
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 17:07:26 +0000
Received: from [85.158.139.83:62608] by server-1.bemta-5.messagelabs.com id
	B6/CF-05877-C459A905; Wed, 07 Nov 2012 17:07:24 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352308044!28529338!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxODI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7393 invoked from network); 7 Nov 2012 17:07:24 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-182.messagelabs.com with SMTP;
	7 Nov 2012 17:07:24 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 07 Nov 2012 17:07:23 +0000
Message-Id: <509AA35B02000078000A7092@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 07 Nov 2012 17:07:23 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <Philippe.Simonet@swisscom.com>,"Keir Fraser" <keir@xen.org>
References: <FF93AF260AC2BB499A119CC65B092CF731516BBA@sg000713.corproot.net>
In-Reply-To: <FF93AF260AC2BB499A119CC65B092CF731516BBA@sg000713.corproot.net>
Mime-Version: 1.0
Content-Disposition: inline
Cc: 599161@bugs.debian.org, xen-devel@lists.xen.org, mrsanna1@gmail.com,
	Ian Campbell <ijc@hellion.org.uk>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 07.11.12 at 11:10, <Philippe.Simonet@swisscom.com> wrote:
> i compiled  a patched hypervisor for Mauro, it is running since many days 
> and the overflow occured, 
> without clock jumps
> 
>> (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
>> tsc_stamp=e3839fcb0273

i.e. we have (in order of time)

 plt_wrap=5ece12d09306
      now=5ece12d16292
  plt_now=5ece12d34128

which is exactly the inverse order of how things should be (now not
necessarily being in the middle). Nor should plt_now and plt_wrap be
that close together. So far I have no idea how this can be explained.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 17:11:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 17:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW99X-000772-6E; Wed, 07 Nov 2012 17:10:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TW99V-00076x-QN
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 17:10:58 +0000
Received: from [85.158.138.51:17961] by server-14.bemta-3.messagelabs.com id
	EF/6B-12788-0269A905; Wed, 07 Nov 2012 17:10:56 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1352308256!20217765!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2006 invoked from network); 7 Nov 2012 17:10:56 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 17:10:56 -0000
Received: by mail-wi0-f173.google.com with SMTP id cb5so1429831wib.14
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 09:10:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=TZtqZFJQNA0iTLciQzg1whMDHu+neOqvbM00cVB03Hs=;
	b=p8RsIRdavUPbR7otqvEZW5T4DRG/ZsvAWO+6tgfUbWzGMYRpD/stkx48ZXrKyu6B6p
	54/mBan5qKOGn/w+zlPgYDAUAzZLf6zN6UxgQtf3jMd9JGugQwGsPMV6T0ZFIPAn9fw8
	cN+Bhx92pblowGzzjCKN9Tc9x7uCH88PQ3mr/nQjbTE5v9wHZmZAYFbTtZ2e/XBTREJM
	loDlM1xkU94PaMaQxfzyfVlnLD3ItFahDBZ2Aad63FBkljtHWeyeAip42MVS2nCLAhgW
	nCnIAzM2X0ceNZSADiKYl7XvjK9OmnChda1W3gGR1EdbSMBSw2vh2A+ONDTGo+05j2Cv
	PTsw==
Received: by 10.180.100.101 with SMTP id ex5mr26080338wib.16.1352308256082;
	Wed, 07 Nov 2012 09:10:56 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id ey2sm4388898wib.9.2012.11.07.09.10.46
	(version=SSLv3 cipher=OTHER); Wed, 07 Nov 2012 09:10:55 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 07 Nov 2012 17:10:37 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCC0468D.51958%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] x86/emul: only emulate possibly operand
	sizes for POPA
Thread-Index: Ac29Cs4t6m1er+1jFkW1p63knl/Vqg==
In-Reply-To: <509A958E02000078000A7039@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] x86/emul: only emulate possibly operand
 sizes for POPA
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 07/11/2012 16:08, "Jan Beulich" <JBeulich@suse.com> wrote:

> This opcode neither support 1-byte operands, nor does it support 8-byte
> ones (since the opcode is undefined in 64-bit mode). Simplify the code
> accordingly.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
> @@ -1996,13 +1996,10 @@ x86_emulate(
>              if ( (rc = read_ulong(x86_seg_ss, sp_post_inc(op_bytes),
>                                    &dst.val, op_bytes, ctxt, ops)) != 0 )
>                  goto done;
> -            switch ( op_bytes )
> -            {
> -            case 1: *(uint8_t  *)regs[i] = (uint8_t)dst.val; break;
> -            case 2: *(uint16_t *)regs[i] = (uint16_t)dst.val; break;
> -            case 4: *regs[i] = (uint32_t)dst.val; break; /* 64b: zero-ext */
> -            case 8: *regs[i] = dst.val; break;
> -            }
> +            if ( op_bytes != 2 )
> +                *regs[i] = (uint32_t)dst.val; /* 64b: zero-ext */
> +            else
> +                *(uint16_t *)regs[i] = (uint16_t)dst.val;

Would prefer:
 if ( op_bytes == 2 )
     *(uint16_t *)regs[i] = (uint16_t)dst.val;
 else
     *regs[i] = dst.val;

Handles the exceptional case immediately after its predicate. And the cast
from uint32_t, and 64b-related comment, are pointless and in fact misleading
in the default case, since as you say the instruction is invalid in 64-bit
mode.

Apart from that:
Acked-by: Keir Fraser <keir@xen.org>

 -- Keir

>          }
>          break;
>      }
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 17:11:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 17:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW99X-000772-6E; Wed, 07 Nov 2012 17:10:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TW99V-00076x-QN
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 17:10:58 +0000
Received: from [85.158.138.51:17961] by server-14.bemta-3.messagelabs.com id
	EF/6B-12788-0269A905; Wed, 07 Nov 2012 17:10:56 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1352308256!20217765!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2006 invoked from network); 7 Nov 2012 17:10:56 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 17:10:56 -0000
Received: by mail-wi0-f173.google.com with SMTP id cb5so1429831wib.14
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 09:10:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=TZtqZFJQNA0iTLciQzg1whMDHu+neOqvbM00cVB03Hs=;
	b=p8RsIRdavUPbR7otqvEZW5T4DRG/ZsvAWO+6tgfUbWzGMYRpD/stkx48ZXrKyu6B6p
	54/mBan5qKOGn/w+zlPgYDAUAzZLf6zN6UxgQtf3jMd9JGugQwGsPMV6T0ZFIPAn9fw8
	cN+Bhx92pblowGzzjCKN9Tc9x7uCH88PQ3mr/nQjbTE5v9wHZmZAYFbTtZ2e/XBTREJM
	loDlM1xkU94PaMaQxfzyfVlnLD3ItFahDBZ2Aad63FBkljtHWeyeAip42MVS2nCLAhgW
	nCnIAzM2X0ceNZSADiKYl7XvjK9OmnChda1W3gGR1EdbSMBSw2vh2A+ONDTGo+05j2Cv
	PTsw==
Received: by 10.180.100.101 with SMTP id ex5mr26080338wib.16.1352308256082;
	Wed, 07 Nov 2012 09:10:56 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id ey2sm4388898wib.9.2012.11.07.09.10.46
	(version=SSLv3 cipher=OTHER); Wed, 07 Nov 2012 09:10:55 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 07 Nov 2012 17:10:37 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCC0468D.51958%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] x86/emul: only emulate possibly operand
	sizes for POPA
Thread-Index: Ac29Cs4t6m1er+1jFkW1p63knl/Vqg==
In-Reply-To: <509A958E02000078000A7039@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] x86/emul: only emulate possibly operand
 sizes for POPA
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 07/11/2012 16:08, "Jan Beulich" <JBeulich@suse.com> wrote:

> This opcode neither support 1-byte operands, nor does it support 8-byte
> ones (since the opcode is undefined in 64-bit mode). Simplify the code
> accordingly.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
> @@ -1996,13 +1996,10 @@ x86_emulate(
>              if ( (rc = read_ulong(x86_seg_ss, sp_post_inc(op_bytes),
>                                    &dst.val, op_bytes, ctxt, ops)) != 0 )
>                  goto done;
> -            switch ( op_bytes )
> -            {
> -            case 1: *(uint8_t  *)regs[i] = (uint8_t)dst.val; break;
> -            case 2: *(uint16_t *)regs[i] = (uint16_t)dst.val; break;
> -            case 4: *regs[i] = (uint32_t)dst.val; break; /* 64b: zero-ext */
> -            case 8: *regs[i] = dst.val; break;
> -            }
> +            if ( op_bytes != 2 )
> +                *regs[i] = (uint32_t)dst.val; /* 64b: zero-ext */
> +            else
> +                *(uint16_t *)regs[i] = (uint16_t)dst.val;

Would prefer:
 if ( op_bytes == 2 )
     *(uint16_t *)regs[i] = (uint16_t)dst.val;
 else
     *regs[i] = dst.val;

Handles the exceptional case immediately after its predicate. And the cast
from uint32_t, and 64b-related comment, are pointless and in fact misleading
in the default case, since as you say the instruction is invalid in 64-bit
mode.

Apart from that:
Acked-by: Keir Fraser <keir@xen.org>

 -- Keir

>          }
>          break;
>      }
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 17:41:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 17:41:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW9cH-0007Vj-0U; Wed, 07 Nov 2012 17:40:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TW9cE-0007Ve-Uw
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 17:40:39 +0000
Received: from [193.109.254.147:54802] by server-9.bemta-14.messagelabs.com id
	17/4F-30773-61D9A905; Wed, 07 Nov 2012 17:40:38 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352310036!7403570!1
X-Originating-IP: [209.85.212.179]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3863 invoked from network); 7 Nov 2012 17:40:37 -0000
Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com)
	(209.85.212.179)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 17:40:37 -0000
Received: by mail-wi0-f179.google.com with SMTP id hm6so261638wib.14
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 09:40:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=UI5jfsVhK+goZ+Ms7PxzpGI8nZjrmYsxGng4mWz4B8I=;
	b=krAwbnativD+yTdmVQVIW8u61tKpzZLU0mlCT4DJMBo/rUGcI2cpTUE1pun0ImUI0b
	DMQkIsB4hKav7oDcSZg1EbgV7wwDUfp/v1tzsJ4qTNOumq4OC6dbS5s/0tEKp5xsVJlu
	w67H+LnbNNZ/PQI6+Qbdh5IXKz0kihS/JTz40ADKYtfZeq1ioheusZXa6nJkXOvLYaEN
	+HeRusf2kmVb7z36Fhd0h4T4/t8DLkFg3NWIGYXnBcI7G2BlU0JxyYmln1jr+x9vbBWG
	KvOl5SMJ6hGJlygNHJaPEcjtQ75eXV3VJfhBVrtCPvP9Er4LIoaef+aomr/9tQEEyfgE
	oROg==
Received: by 10.180.19.71 with SMTP id c7mr26197082wie.2.1352310036646;
	Wed, 07 Nov 2012 09:40:36 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id f1sm4010652wiy.2.2012.11.07.09.40.34
	(version=SSLv3 cipher=OTHER); Wed, 07 Nov 2012 09:40:35 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 07 Nov 2012 17:40:30 +0000
From: Keir Fraser <keir@xen.org>
To: Ian Campbell <ijc@hellion.org.uk>,
	<Philippe.Simonet@swisscom.com>
Message-ID: <CCC04D8E.51A0E%keir@xen.org>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
	minutes" bug.
Thread-Index: Ac29DvrjqeBG3H6QAUStnBaJP3k+kw==
In-Reply-To: <1352294551.12977.61.camel@hastur.hellion.org.uk>
Mime-version: 1.0
Cc: 599161@bugs.debian.org, mrsanna1@gmail.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 07/11/2012 13:22, "Ian Campbell" <ijc@hellion.org.uk> wrote:

>>> (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
>>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
>>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
>>> tsc_stamp=e3839fcb0273
>> 
>> (below is the complete xm dmesg output)
>> 
>> did that help you ? do you need more info ?
> 
> I'll leave this to Keir (who wrote the debugging patch) to answer but it
> looks to me like it should be useful!

I'm scratching my head. plt_wrap is earlier than plt_now, which should be
impossible. plt_stamp64 oddly has low 32 bits identical to new_stamp. That
seems very very improbable!

I wonder whether the overflow handling should just be removed, or made
conditional on a command-line parameter, or on the 32-bit platform counter
being at least somewhat likely to overflow before a softirq occurs -- it
seems lots of systems are using 14MHz HPET, and that gives us a couple of
minutes for the plt_overflow softirq to do its work before overflow occurs.
I think we would notice that outage in other ways. :)

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 17:41:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 17:41:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TW9cH-0007Vj-0U; Wed, 07 Nov 2012 17:40:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TW9cE-0007Ve-Uw
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 17:40:39 +0000
Received: from [193.109.254.147:54802] by server-9.bemta-14.messagelabs.com id
	17/4F-30773-61D9A905; Wed, 07 Nov 2012 17:40:38 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352310036!7403570!1
X-Originating-IP: [209.85.212.179]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3863 invoked from network); 7 Nov 2012 17:40:37 -0000
Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com)
	(209.85.212.179)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 17:40:37 -0000
Received: by mail-wi0-f179.google.com with SMTP id hm6so261638wib.14
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 09:40:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=UI5jfsVhK+goZ+Ms7PxzpGI8nZjrmYsxGng4mWz4B8I=;
	b=krAwbnativD+yTdmVQVIW8u61tKpzZLU0mlCT4DJMBo/rUGcI2cpTUE1pun0ImUI0b
	DMQkIsB4hKav7oDcSZg1EbgV7wwDUfp/v1tzsJ4qTNOumq4OC6dbS5s/0tEKp5xsVJlu
	w67H+LnbNNZ/PQI6+Qbdh5IXKz0kihS/JTz40ADKYtfZeq1ioheusZXa6nJkXOvLYaEN
	+HeRusf2kmVb7z36Fhd0h4T4/t8DLkFg3NWIGYXnBcI7G2BlU0JxyYmln1jr+x9vbBWG
	KvOl5SMJ6hGJlygNHJaPEcjtQ75eXV3VJfhBVrtCPvP9Er4LIoaef+aomr/9tQEEyfgE
	oROg==
Received: by 10.180.19.71 with SMTP id c7mr26197082wie.2.1352310036646;
	Wed, 07 Nov 2012 09:40:36 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id f1sm4010652wiy.2.2012.11.07.09.40.34
	(version=SSLv3 cipher=OTHER); Wed, 07 Nov 2012 09:40:35 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 07 Nov 2012 17:40:30 +0000
From: Keir Fraser <keir@xen.org>
To: Ian Campbell <ijc@hellion.org.uk>,
	<Philippe.Simonet@swisscom.com>
Message-ID: <CCC04D8E.51A0E%keir@xen.org>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
	minutes" bug.
Thread-Index: Ac29DvrjqeBG3H6QAUStnBaJP3k+kw==
In-Reply-To: <1352294551.12977.61.camel@hastur.hellion.org.uk>
Mime-version: 1.0
Cc: 599161@bugs.debian.org, mrsanna1@gmail.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 07/11/2012 13:22, "Ian Campbell" <ijc@hellion.org.uk> wrote:

>>> (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
>>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
>>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
>>> tsc_stamp=e3839fcb0273
>> 
>> (below is the complete xm dmesg output)
>> 
>> did that help you ? do you need more info ?
> 
> I'll leave this to Keir (who wrote the debugging patch) to answer but it
> looks to me like it should be useful!

I'm scratching my head. plt_wrap is earlier than plt_now, which should be
impossible. plt_stamp64 oddly has low 32 bits identical to new_stamp. That
seems very very improbable!

I wonder whether the overflow handling should just be removed, or made
conditional on a command-line parameter, or on the 32-bit platform counter
being at least somewhat likely to overflow before a softirq occurs -- it
seems lots of systems are using 14MHz HPET, and that gives us a couple of
minutes for the plt_overflow softirq to do its work before overflow occurs.
I think we would notice that outage in other ways. :)

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 18:16:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 18:16:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWAA5-0007sZ-U8; Wed, 07 Nov 2012 18:15:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TWAA3-0007sU-Pr
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 18:15:36 +0000
Received: from [85.158.139.83:54930] by server-10.bemta-5.messagelabs.com id
	75/66-09257-645AA905; Wed, 07 Nov 2012 18:15:34 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-5.tower-182.messagelabs.com!1352312132!29267880!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7439 invoked from network); 7 Nov 2012 18:15:33 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-5.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 7 Nov 2012 18:15:33 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.156793615;
	Wed, 07 Nov 2012 13:14:25 -0500
Message-ID: <509AA501.1090701@jhuapl.edu>
Date: Wed, 07 Nov 2012 13:14:25 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Kent Yoder <key@linux.vnet.ibm.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121107144625.GA14628@ennui.austin.ibm.com>
In-Reply-To: <20121107144625.GA14628@ennui.austin.ibm.com>
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
	driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2891601273189910868=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============2891601273189910868==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms080608050803030603010205"

This is a cryptographically signed message in MIME format.

--------------ms080608050803030603010205
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/07/2012 09:46 AM, Kent Yoder wrote:
> Hi Matthew,
>
> On Mon, Nov 05, 2012 at 10:09:57AM -0500, Matthew Fioravante wrote:
>> This patch ports the xen vtpm frontend driver for linux
>> from the linux-2.6.18-xen.hg tree to linux-stable.
>>
>> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>> ---
>>   drivers/char/tpm/Kconfig         |    9 +
>>   drivers/char/tpm/Makefile        |    2 +
>>   drivers/char/tpm/tpm.h           |   15 +
>>   drivers/char/tpm/tpm_vtpm.c      |  543 ++++++++++++++++++++++++++++=
++
>>   drivers/char/tpm/tpm_vtpm.h      |   55 +++
>>   drivers/char/tpm/tpm_xen.c       |  690 ++++++++++++++++++++++++++++=
++++++++++
>>   include/xen/interface/io/tpmif.h |   77 +++++
>>   7 files changed, 1391 insertions(+)
>>   create mode 100644 drivers/char/tpm/tpm_vtpm.c
>>   create mode 100644 drivers/char/tpm/tpm_vtpm.h
>>   create mode 100644 drivers/char/tpm/tpm_xen.c
>>   create mode 100644 include/xen/interface/io/tpmif.h
>>
>> diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
>> index 915875e..08c1010 100644
>> --- a/drivers/char/tpm/Kconfig
>> +++ b/drivers/char/tpm/Kconfig
>> @@ -81,4 +81,13 @@ config TCG_IBMVTPM
>>   	  will be accessible from within Linux.  To compile this driver
>>   	  as a module, choose M here; the module will be called tpm_ibmvtpm=
=2E
>>
>> +config TCG_XEN
>> +	tristate "XEN TPM Interface"
>> +	depends on TCG_TPM && XEN
>> +	---help---
>> +	  If you want to make TPM support available to a Xen user domain,
>> +	  say Yes and it will be accessible from within Linux.
>> +	  To compile this driver as a module, choose M here; the module
>> +	  will be called tpm_xenu.
>> +
>>   endif # TCG_TPM
>> diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
>> index 5b3fc8b..16911c5 100644
>> --- a/drivers/char/tpm/Makefile
>> +++ b/drivers/char/tpm/Makefile
>> @@ -17,3 +17,5 @@ obj-$(CONFIG_TCG_NSC) +=3D tpm_nsc.o
>>   obj-$(CONFIG_TCG_ATMEL) +=3D tpm_atmel.o
>>   obj-$(CONFIG_TCG_INFINEON) +=3D tpm_infineon.o
>>   obj-$(CONFIG_TCG_IBMVTPM) +=3D tpm_ibmvtpm.o
>> +obj-$(CONFIG_TCG_XEN) +=3D tpm_xenu.o
>> +tpm_xenu-y =3D tpm_xen.o tpm_vtpm.o
>   Let's match the naming convention of the other drivers if we can, so =
this
> would be something like tpm_xenvtpm.c. tpm_vtpm is too generic...
Makes sense, fixed.
>
>> diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
>> index 8ef7649..2e5a47a 100644
>> --- a/drivers/char/tpm/tpm.h
>> +++ b/drivers/char/tpm/tpm.h
>> @@ -130,6 +130,9 @@ struct tpm_chip {
>>
>>   	struct list_head list;
>>   	void (*release) (struct device *);
>> +#if CONFIG_XEN
>> +	void *priv;
>> +#endif
>   Can you use the chip->vendor.data pointer here instead? tpm_ibmvtpm i=
s
> already using that as a priv pointer. I should probably change that nam=
e
> to make it more obvious what that's used for.
That makes more sense. I'm guessing your data pointer didn't exist=20
during the 2.6.18 kernel which is why they added their own priv pointer.
>
>>   };
>>
>>   #define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor)
>> @@ -310,6 +313,18 @@ struct tpm_cmd_t {
>>
>>   ssize_t	tpm_getcap(struct device *, __be32, cap_t *, const char *);
>>
>> +#ifdef CONFIG_XEN
>> +static inline void *chip_get_private(const struct tpm_chip *chip)
>> +{
>> +	return chip->priv;
>> +}
>> +
>> +static inline void chip_set_private(struct tpm_chip *chip, void *priv=
)
>> +{
>> +	chip->priv =3D priv;
>> +}
>> +#endif
>   Can you put these in tpm_vtpm.c please?  One less #define. :-)
Agreed, I'd rather not have to modify your shared tpm.h interface at all.=

>
> [cut]
>> +#ifndef __XEN_PUBLIC_IO_TPMIF_H__
>> +#define __XEN_PUBLIC_IO_TPMIF_H__
>> +
>> +#include "../grant_table.h"
>> +
>> +struct tpmif_tx_request {
>> +	unsigned long addr;   /* Machine address of packet.   */
>> +	grant_ref_t ref;      /* grant table access reference */
>> +	uint16_t unused;
>> +	uint16_t size;        /* Packet size in bytes.        */
>> +};
>> +typedef struct tpmif_tx_request tpmif_tx_request_t;
>    checkpatch warned on this new typedef - please run through checkpatc=
h
> and fix up that stuff.
tpmif.h has a couple of typedefs which do trigger checkpatch warnings.=20
However it looks like the paradigm for xen is to have these=20
interface/io/<dev>if.h files and all of them have typedefs. I think in=20
this case the typedef should probably stay.

Konrad your thoughts here?
>
>> +
>> +/*
>> + * The TPMIF_TX_RING_SIZE defines the number of pages the
>> + * front-end and backend can exchange (=3D size of array).
>> + */
>> +typedef uint32_t TPMIF_RING_IDX;
>> +
>> +#define TPMIF_TX_RING_SIZE 1
>> +
>> +/* This structure must fit in a memory page. */
>> +
>> +struct tpmif_ring {
>> +	struct tpmif_tx_request req;
>> +};
>> +typedef struct tpmif_ring tpmif_ring_t;
>> +
>> +struct tpmif_tx_interface {
>> +	struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
>> +};
>> +typedef struct tpmif_tx_interface tpmif_tx_interface_t;
>> +
>> +#endif
>> +
>> +/*
>> + * Local variables:
>> + * mode: C
>> + * c-set-style: "BSD"
>> + * c-basic-offset: 4
>> + * tab-width: 4
>> + * indent-tabs-mode: nil
>> + * End:
>> + */
>    Please take this comment out, see Documentation/CodingStyle.
Fixed
>
> Thanks,
> Kent
>
>> --=20
>> 1.7.10.4
>>
>>



--------------ms080608050803030603010205
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlCwMBAQEBBAoWCGZpb3JhbWUxMBsGDSsGAQQBsyUL
AwEBAQIEChIIM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QAEgYCV7QCgPV0a6wjPTkin2QRV0fkmRegK/e7z
bG7NkhPNHIZy8Ev6rCNqrX3/Xamy2lJ2pssnjMa1+XPf9am1R9YdvDDbvp2Vkzd+rnosQirI
w0lt1L3M1ZMsGQElentQKt9VDlXpBYy+bljrqxZmVlBMa/atysXrJBKJAjtlQbsd+wAAAAAA
AA==
--------------ms080608050803030603010205--


--===============2891601273189910868==
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.xen.org
http://lists.xen.org/xen-devel

--===============2891601273189910868==--


From xen-devel-bounces@lists.xen.org Wed Nov 07 18:16:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 18:16:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWAA5-0007sZ-U8; Wed, 07 Nov 2012 18:15:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TWAA3-0007sU-Pr
	for xen-devel@lists.xensource.com; Wed, 07 Nov 2012 18:15:36 +0000
Received: from [85.158.139.83:54930] by server-10.bemta-5.messagelabs.com id
	75/66-09257-645AA905; Wed, 07 Nov 2012 18:15:34 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-5.tower-182.messagelabs.com!1352312132!29267880!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7439 invoked from network); 7 Nov 2012 18:15:33 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-5.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 7 Nov 2012 18:15:33 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.156793615;
	Wed, 07 Nov 2012 13:14:25 -0500
Message-ID: <509AA501.1090701@jhuapl.edu>
Date: Wed, 07 Nov 2012 13:14:25 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Kent Yoder <key@linux.vnet.ibm.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121107144625.GA14628@ennui.austin.ibm.com>
In-Reply-To: <20121107144625.GA14628@ennui.austin.ibm.com>
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
	driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2891601273189910868=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============2891601273189910868==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms080608050803030603010205"

This is a cryptographically signed message in MIME format.

--------------ms080608050803030603010205
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/07/2012 09:46 AM, Kent Yoder wrote:
> Hi Matthew,
>
> On Mon, Nov 05, 2012 at 10:09:57AM -0500, Matthew Fioravante wrote:
>> This patch ports the xen vtpm frontend driver for linux
>> from the linux-2.6.18-xen.hg tree to linux-stable.
>>
>> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>> ---
>>   drivers/char/tpm/Kconfig         |    9 +
>>   drivers/char/tpm/Makefile        |    2 +
>>   drivers/char/tpm/tpm.h           |   15 +
>>   drivers/char/tpm/tpm_vtpm.c      |  543 ++++++++++++++++++++++++++++=
++
>>   drivers/char/tpm/tpm_vtpm.h      |   55 +++
>>   drivers/char/tpm/tpm_xen.c       |  690 ++++++++++++++++++++++++++++=
++++++++++
>>   include/xen/interface/io/tpmif.h |   77 +++++
>>   7 files changed, 1391 insertions(+)
>>   create mode 100644 drivers/char/tpm/tpm_vtpm.c
>>   create mode 100644 drivers/char/tpm/tpm_vtpm.h
>>   create mode 100644 drivers/char/tpm/tpm_xen.c
>>   create mode 100644 include/xen/interface/io/tpmif.h
>>
>> diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
>> index 915875e..08c1010 100644
>> --- a/drivers/char/tpm/Kconfig
>> +++ b/drivers/char/tpm/Kconfig
>> @@ -81,4 +81,13 @@ config TCG_IBMVTPM
>>   	  will be accessible from within Linux.  To compile this driver
>>   	  as a module, choose M here; the module will be called tpm_ibmvtpm=
=2E
>>
>> +config TCG_XEN
>> +	tristate "XEN TPM Interface"
>> +	depends on TCG_TPM && XEN
>> +	---help---
>> +	  If you want to make TPM support available to a Xen user domain,
>> +	  say Yes and it will be accessible from within Linux.
>> +	  To compile this driver as a module, choose M here; the module
>> +	  will be called tpm_xenu.
>> +
>>   endif # TCG_TPM
>> diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
>> index 5b3fc8b..16911c5 100644
>> --- a/drivers/char/tpm/Makefile
>> +++ b/drivers/char/tpm/Makefile
>> @@ -17,3 +17,5 @@ obj-$(CONFIG_TCG_NSC) +=3D tpm_nsc.o
>>   obj-$(CONFIG_TCG_ATMEL) +=3D tpm_atmel.o
>>   obj-$(CONFIG_TCG_INFINEON) +=3D tpm_infineon.o
>>   obj-$(CONFIG_TCG_IBMVTPM) +=3D tpm_ibmvtpm.o
>> +obj-$(CONFIG_TCG_XEN) +=3D tpm_xenu.o
>> +tpm_xenu-y =3D tpm_xen.o tpm_vtpm.o
>   Let's match the naming convention of the other drivers if we can, so =
this
> would be something like tpm_xenvtpm.c. tpm_vtpm is too generic...
Makes sense, fixed.
>
>> diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
>> index 8ef7649..2e5a47a 100644
>> --- a/drivers/char/tpm/tpm.h
>> +++ b/drivers/char/tpm/tpm.h
>> @@ -130,6 +130,9 @@ struct tpm_chip {
>>
>>   	struct list_head list;
>>   	void (*release) (struct device *);
>> +#if CONFIG_XEN
>> +	void *priv;
>> +#endif
>   Can you use the chip->vendor.data pointer here instead? tpm_ibmvtpm i=
s
> already using that as a priv pointer. I should probably change that nam=
e
> to make it more obvious what that's used for.
That makes more sense. I'm guessing your data pointer didn't exist=20
during the 2.6.18 kernel which is why they added their own priv pointer.
>
>>   };
>>
>>   #define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor)
>> @@ -310,6 +313,18 @@ struct tpm_cmd_t {
>>
>>   ssize_t	tpm_getcap(struct device *, __be32, cap_t *, const char *);
>>
>> +#ifdef CONFIG_XEN
>> +static inline void *chip_get_private(const struct tpm_chip *chip)
>> +{
>> +	return chip->priv;
>> +}
>> +
>> +static inline void chip_set_private(struct tpm_chip *chip, void *priv=
)
>> +{
>> +	chip->priv =3D priv;
>> +}
>> +#endif
>   Can you put these in tpm_vtpm.c please?  One less #define. :-)
Agreed, I'd rather not have to modify your shared tpm.h interface at all.=

>
> [cut]
>> +#ifndef __XEN_PUBLIC_IO_TPMIF_H__
>> +#define __XEN_PUBLIC_IO_TPMIF_H__
>> +
>> +#include "../grant_table.h"
>> +
>> +struct tpmif_tx_request {
>> +	unsigned long addr;   /* Machine address of packet.   */
>> +	grant_ref_t ref;      /* grant table access reference */
>> +	uint16_t unused;
>> +	uint16_t size;        /* Packet size in bytes.        */
>> +};
>> +typedef struct tpmif_tx_request tpmif_tx_request_t;
>    checkpatch warned on this new typedef - please run through checkpatc=
h
> and fix up that stuff.
tpmif.h has a couple of typedefs which do trigger checkpatch warnings.=20
However it looks like the paradigm for xen is to have these=20
interface/io/<dev>if.h files and all of them have typedefs. I think in=20
this case the typedef should probably stay.

Konrad your thoughts here?
>
>> +
>> +/*
>> + * The TPMIF_TX_RING_SIZE defines the number of pages the
>> + * front-end and backend can exchange (=3D size of array).
>> + */
>> +typedef uint32_t TPMIF_RING_IDX;
>> +
>> +#define TPMIF_TX_RING_SIZE 1
>> +
>> +/* This structure must fit in a memory page. */
>> +
>> +struct tpmif_ring {
>> +	struct tpmif_tx_request req;
>> +};
>> +typedef struct tpmif_ring tpmif_ring_t;
>> +
>> +struct tpmif_tx_interface {
>> +	struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
>> +};
>> +typedef struct tpmif_tx_interface tpmif_tx_interface_t;
>> +
>> +#endif
>> +
>> +/*
>> + * Local variables:
>> + * mode: C
>> + * c-set-style: "BSD"
>> + * c-basic-offset: 4
>> + * tab-width: 4
>> + * indent-tabs-mode: nil
>> + * End:
>> + */
>    Please take this comment out, see Documentation/CodingStyle.
Fixed
>
> Thanks,
> Kent
>
>> --=20
>> 1.7.10.4
>>
>>



--------------ms080608050803030603010205
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlCwMBAQEBBAoWCGZpb3JhbWUxMBsGDSsGAQQBsyUL
AwEBAQIEChIIMDAxMDQyNjEwWAYJYIZIAYb6ax4BBEsMSVRoZSBwcml2YXRlIGtleSBjb3Jy
ZXNwb25kaW5nIHRvIHRoaXMgY2VydGlmaWNhdGUgbWF5IGhhdmUgYmVlbiBleHBvcnRlZC4w
KAYDVR0RBCEwH4EdTWF0dGhldy5GaW9yYXZhbnRlQGpodWFwbC5lZHUwUgYDVR0fBEswSTBH
oEWgQ6RBMD8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJU0RD
QTEOMAwGA1UEAxMFQ1JMNTYwHwYDVR0jBBgwFoAUCDUpmxH52EU2CyWmF2EJMB1yqeswHQYD
VR0OBBYEFO6LYxg6r9wHZ+zdQtBHn1dZ/YTNMAkGA1UdEwQCMAAwGQYJKoZIhvZ9B0EABAww
ChsEVjcuMQMCBLAwDQYJKoZIhvcNAQEFBQADgYEAJO9HQh4YNChVLzuZqK5ARJARD8JoujGZ
fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEwNzE4MTQyNVowIwYJKoZIhvcNAQkEMRYEFBwk6zhe4ThjAtby
xJcPImgIpUAuMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYCV7QCgPV0a6wjPTkin2QRV0fkmRegK/e7z
bG7NkhPNHIZy8Ev6rCNqrX3/Xamy2lJ2pssnjMa1+XPf9am1R9YdvDDbvp2Vkzd+rnosQirI
w0lt1L3M1ZMsGQElentQKt9VDlXpBYy+bljrqxZmVlBMa/atysXrJBKJAjtlQbsd+wAAAAAA
AA==
--------------ms080608050803030603010205--


--===============2891601273189910868==
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.xen.org
http://lists.xen.org/xen-devel

--===============2891601273189910868==--


From xen-devel-bounces@lists.xen.org Wed Nov 07 19:43:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 19:43:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWBWm-00004y-4Q; Wed, 07 Nov 2012 19:43:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ben.guthro@gmail.com>) id 1TWBWj-00004t-VM
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 19:43:06 +0000
Received: from [85.158.137.99:8226] by server-3.bemta-3.messagelabs.com id
	B7/9E-31566-9C9BA905; Wed, 07 Nov 2012 19:43:05 +0000
X-Env-Sender: ben.guthro@gmail.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352317383!18058905!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25296 invoked from network); 7 Nov 2012 19:43:04 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-14.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 19:43:04 -0000
Received: by mail-wg0-f51.google.com with SMTP id ed3so906270wgb.32
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 11:43:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=0NZjMx+SboPVcJdhM4Ub2mskmCSeTpBK4lJpxMVc12c=;
	b=Ti6FK0ml3JKWQbSt8YRUCiLkTo8rVuqSAvFIVC6QacY3iyoPSloBypfeXJ7qZ9fr2P
	5gHf/rRLY3H/Sg+/quW5Y5WD0TRY3vC2K2DNkn5m2N/wJUNkBR4R+T07Ubh5NI8wdqBy
	hivzBiJFjEBJnFVOsCExeCANLOeqiWBToLpWZKZoO31DE7dkx54k1B7sNN9py5ffc1TJ
	sx4ZSRPXlSYEkc+81Gpt7tcDQHLllJ4iiKZNiZDa3fhDEH8JFvSEAeGmdnZukGmqImI/
	wuKcxISEZgE/6hsME6mQjk5kKETZd7cFw6Tw3til7GquPNMGWleDeFQIZA4TaCEtpmiy
	zYJw==
MIME-Version: 1.0
Received: by 10.180.86.69 with SMTP id n5mr9516129wiz.0.1352317383530; Wed, 07
	Nov 2012 11:43:03 -0800 (PST)
Received: by 10.216.97.199 with HTTP; Wed, 7 Nov 2012 11:43:03 -0800 (PST)
In-Reply-To: <CAOvdn6UWbfwP0ysxJJOq0-AwXqee044F0NUzswQwGu4Hbv7iVg@mail.gmail.com>
References: <CAOvdn6UWbfwP0ysxJJOq0-AwXqee044F0NUzswQwGu4Hbv7iVg@mail.gmail.com>
Date: Wed, 7 Nov 2012 14:43:03 -0500
X-Google-Sender-Auth: bptl82YvALEl_m9_b7LurCBYm1A
Message-ID: <CAOvdn6UV_6uyuFsLCMsRTZEL-uummiHvKhzo=8zTY_xMxoXuUA@mail.gmail.com>
From: Ben Guthro <ben@guthro.net>
To: xen-devel <xen-devel@lists.xen.org>, intel-gfx@lists.freedesktop.org
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] S3 causing IRQ delivery mismatch - i915 hotplug
	storm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1727707612959540151=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============1727707612959540151==
Content-Type: multipart/alternative; boundary=f46d04428d2244da0d04cdeced64

--f46d04428d2244da0d04cdeced64
Content-Type: text/plain; charset=ISO-8859-1

On Wed, Nov 7, 2012 at 11:22 AM, Ben Guthro <ben@guthro.net> wrote:

> I'm trying to debug an issue on an older lapop (Toshiba Satellite A505) -
> that has an i3 processor (M330) - and intel graphics.
> This is running under Xen-unstable, and a 3.7-rc4 pvops kernel - but can
> also be reproduced using kernels as old as 3.2.23 - and hypervisors as old
> as 4.0.4
>
> (I have cross posted here, because I am not yet sure if this is a Xen,
> pvops, or i915 issue - and would appreciate opinions in sorting it out.)
>
>
This appears to be unrelated to Xen / pvops, at the moment, after some
additional debugging, and appears to be an issue with the i915 driver with
older hardware.
I'll remove xen-devel, and Konrad from future replies to this thread.



>
> Additionally, this same trace stack is printed out at a regular 10s
> interval, after resume - where prior to resuming from S3 it is printed out
> once at boot time.
>
>
10*HZ seems to be the normal hotplug interval, when an interrupt doesn't
fire


>
> There seems to be a mismatch for these IRQ delivery - or at least exhibits
> the behavior similar to such a problem.
>
>
I was mistaken here. The i8042 IRQ would just start up the IRQ handling -
but the i915 driver always thinks it has pending work, and schedules it.
It seems that the hotplug mask is not getting cleared in pch_iir (in
i915_irq.c)

Manually clearing this bit with
pch_iir = pch_iir ^ hotplug_mask;
in the ironlake_irq_handler() function

seems to resolve the issue - making it so I don't get the flurry of hotplug
work bogging down the system.
...but is this disabling hotplug detection entirely?

--f46d04428d2244da0d04cdeced64
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">On Wed, Nov 7, 2012 at 11:22 AM, Ben Gut=
hro <span dir=3D"ltr">&lt;<a href=3D"mailto:ben@guthro.net" target=3D"_blan=
k">ben@guthro.net</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote=
" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I&#39;m trying to debug an issue on an older lapop (Toshiba Satellite A505)=
 - that has an i3 processor (M330) - and intel graphics.<div>This is runnin=
g under Xen-unstable, and a 3.7-rc4 pvops kernel - but can also be reproduc=
ed using kernels as old as 3.2.23 - and hypervisors as old as 4.0.4</div>

<div><br></div><div>(I have cross posted here, because I am not yet sure if=
 this is a Xen, pvops, or i915 issue - and would appreciate opinions in sor=
ting it out.)<br><div><br></div></div></blockquote><div><br></div><div>
This appears to be unrelated to Xen / pvops, at the moment, after some addi=
tional debugging, and appears to be an issue with the i915 driver with olde=
r hardware.</div><div>I&#39;ll remove xen-devel, and Konrad from future rep=
lies to this thread.</div>
<div><br></div><div>=A0</div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br></div>=
<div>Additionally, this same trace stack is printed out at a regular 10s in=
terval, after resume - where prior to resuming from S3 it is printed out on=
ce at boot time.</div>

<div><br></div></blockquote><div><br></div><div>10*HZ seems to be the norma=
l hotplug interval, when an interrupt doesn&#39;t fire</div><div>=A0</div><=
blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px=
 #ccc solid;padding-left:1ex">
<div></div><div><br></div><div>There seems to be a mismatch for these IRQ d=
elivery - or at least exhibits the behavior similar to such a problem.</div=
>
<div><br></div></blockquote><div><br></div><div>I was mistaken here. The i8=
042 IRQ would just start up the IRQ handling - but the i915 driver always t=
hinks it has pending work, and schedules it.</div><div>It seems that the ho=
tplug mask is not getting cleared in pch_iir (in i915_irq.c)</div>
<div><br></div><div>Manually clearing this bit with</div><div>pch_iir =3D p=
ch_iir ^ hotplug_mask;</div><div>in the=A0ironlake_irq_handler() function</=
div><div><br></div><div>seems to resolve the issue - making it so I don&#39=
;t get the flurry of hotplug work bogging down the system.</div>
<div>...but is this disabling hotplug detection entirely?</div><div><br></d=
iv><div><br></div></div>

--f46d04428d2244da0d04cdeced64--


--===============1727707612959540151==
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.xen.org
http://lists.xen.org/xen-devel

--===============1727707612959540151==--


From xen-devel-bounces@lists.xen.org Wed Nov 07 19:43:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 19:43:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWBWm-00004y-4Q; Wed, 07 Nov 2012 19:43:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ben.guthro@gmail.com>) id 1TWBWj-00004t-VM
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 19:43:06 +0000
Received: from [85.158.137.99:8226] by server-3.bemta-3.messagelabs.com id
	B7/9E-31566-9C9BA905; Wed, 07 Nov 2012 19:43:05 +0000
X-Env-Sender: ben.guthro@gmail.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352317383!18058905!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25296 invoked from network); 7 Nov 2012 19:43:04 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-14.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 19:43:04 -0000
Received: by mail-wg0-f51.google.com with SMTP id ed3so906270wgb.32
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 11:43:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=0NZjMx+SboPVcJdhM4Ub2mskmCSeTpBK4lJpxMVc12c=;
	b=Ti6FK0ml3JKWQbSt8YRUCiLkTo8rVuqSAvFIVC6QacY3iyoPSloBypfeXJ7qZ9fr2P
	5gHf/rRLY3H/Sg+/quW5Y5WD0TRY3vC2K2DNkn5m2N/wJUNkBR4R+T07Ubh5NI8wdqBy
	hivzBiJFjEBJnFVOsCExeCANLOeqiWBToLpWZKZoO31DE7dkx54k1B7sNN9py5ffc1TJ
	sx4ZSRPXlSYEkc+81Gpt7tcDQHLllJ4iiKZNiZDa3fhDEH8JFvSEAeGmdnZukGmqImI/
	wuKcxISEZgE/6hsME6mQjk5kKETZd7cFw6Tw3til7GquPNMGWleDeFQIZA4TaCEtpmiy
	zYJw==
MIME-Version: 1.0
Received: by 10.180.86.69 with SMTP id n5mr9516129wiz.0.1352317383530; Wed, 07
	Nov 2012 11:43:03 -0800 (PST)
Received: by 10.216.97.199 with HTTP; Wed, 7 Nov 2012 11:43:03 -0800 (PST)
In-Reply-To: <CAOvdn6UWbfwP0ysxJJOq0-AwXqee044F0NUzswQwGu4Hbv7iVg@mail.gmail.com>
References: <CAOvdn6UWbfwP0ysxJJOq0-AwXqee044F0NUzswQwGu4Hbv7iVg@mail.gmail.com>
Date: Wed, 7 Nov 2012 14:43:03 -0500
X-Google-Sender-Auth: bptl82YvALEl_m9_b7LurCBYm1A
Message-ID: <CAOvdn6UV_6uyuFsLCMsRTZEL-uummiHvKhzo=8zTY_xMxoXuUA@mail.gmail.com>
From: Ben Guthro <ben@guthro.net>
To: xen-devel <xen-devel@lists.xen.org>, intel-gfx@lists.freedesktop.org
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] S3 causing IRQ delivery mismatch - i915 hotplug
	storm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1727707612959540151=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============1727707612959540151==
Content-Type: multipart/alternative; boundary=f46d04428d2244da0d04cdeced64

--f46d04428d2244da0d04cdeced64
Content-Type: text/plain; charset=ISO-8859-1

On Wed, Nov 7, 2012 at 11:22 AM, Ben Guthro <ben@guthro.net> wrote:

> I'm trying to debug an issue on an older lapop (Toshiba Satellite A505) -
> that has an i3 processor (M330) - and intel graphics.
> This is running under Xen-unstable, and a 3.7-rc4 pvops kernel - but can
> also be reproduced using kernels as old as 3.2.23 - and hypervisors as old
> as 4.0.4
>
> (I have cross posted here, because I am not yet sure if this is a Xen,
> pvops, or i915 issue - and would appreciate opinions in sorting it out.)
>
>
This appears to be unrelated to Xen / pvops, at the moment, after some
additional debugging, and appears to be an issue with the i915 driver with
older hardware.
I'll remove xen-devel, and Konrad from future replies to this thread.



>
> Additionally, this same trace stack is printed out at a regular 10s
> interval, after resume - where prior to resuming from S3 it is printed out
> once at boot time.
>
>
10*HZ seems to be the normal hotplug interval, when an interrupt doesn't
fire


>
> There seems to be a mismatch for these IRQ delivery - or at least exhibits
> the behavior similar to such a problem.
>
>
I was mistaken here. The i8042 IRQ would just start up the IRQ handling -
but the i915 driver always thinks it has pending work, and schedules it.
It seems that the hotplug mask is not getting cleared in pch_iir (in
i915_irq.c)

Manually clearing this bit with
pch_iir = pch_iir ^ hotplug_mask;
in the ironlake_irq_handler() function

seems to resolve the issue - making it so I don't get the flurry of hotplug
work bogging down the system.
...but is this disabling hotplug detection entirely?

--f46d04428d2244da0d04cdeced64
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">On Wed, Nov 7, 2012 at 11:22 AM, Ben Gut=
hro <span dir=3D"ltr">&lt;<a href=3D"mailto:ben@guthro.net" target=3D"_blan=
k">ben@guthro.net</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote=
" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I&#39;m trying to debug an issue on an older lapop (Toshiba Satellite A505)=
 - that has an i3 processor (M330) - and intel graphics.<div>This is runnin=
g under Xen-unstable, and a 3.7-rc4 pvops kernel - but can also be reproduc=
ed using kernels as old as 3.2.23 - and hypervisors as old as 4.0.4</div>

<div><br></div><div>(I have cross posted here, because I am not yet sure if=
 this is a Xen, pvops, or i915 issue - and would appreciate opinions in sor=
ting it out.)<br><div><br></div></div></blockquote><div><br></div><div>
This appears to be unrelated to Xen / pvops, at the moment, after some addi=
tional debugging, and appears to be an issue with the i915 driver with olde=
r hardware.</div><div>I&#39;ll remove xen-devel, and Konrad from future rep=
lies to this thread.</div>
<div><br></div><div>=A0</div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br></div>=
<div>Additionally, this same trace stack is printed out at a regular 10s in=
terval, after resume - where prior to resuming from S3 it is printed out on=
ce at boot time.</div>

<div><br></div></blockquote><div><br></div><div>10*HZ seems to be the norma=
l hotplug interval, when an interrupt doesn&#39;t fire</div><div>=A0</div><=
blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px=
 #ccc solid;padding-left:1ex">
<div></div><div><br></div><div>There seems to be a mismatch for these IRQ d=
elivery - or at least exhibits the behavior similar to such a problem.</div=
>
<div><br></div></blockquote><div><br></div><div>I was mistaken here. The i8=
042 IRQ would just start up the IRQ handling - but the i915 driver always t=
hinks it has pending work, and schedules it.</div><div>It seems that the ho=
tplug mask is not getting cleared in pch_iir (in i915_irq.c)</div>
<div><br></div><div>Manually clearing this bit with</div><div>pch_iir =3D p=
ch_iir ^ hotplug_mask;</div><div>in the=A0ironlake_irq_handler() function</=
div><div><br></div><div>seems to resolve the issue - making it so I don&#39=
;t get the flurry of hotplug work bogging down the system.</div>
<div>...but is this disabling hotplug detection entirely?</div><div><br></d=
iv><div><br></div></div>

--f46d04428d2244da0d04cdeced64--


--===============1727707612959540151==
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.xen.org
http://lists.xen.org/xen-devel

--===============1727707612959540151==--


From xen-devel-bounces@lists.xen.org Wed Nov 07 20:37:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 20:37:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWCMu-0000VV-9n; Wed, 07 Nov 2012 20:37:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <robert.phillips@citrix.com>) id 1TWCMs-0000VD-KL
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 20:36:59 +0000
Received: from [85.158.139.83:61379] by server-15.bemta-5.messagelabs.com id
	98/04-26920-966CA905; Wed, 07 Nov 2012 20:36:57 +0000
X-Env-Sender: robert.phillips@citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1352320602!29243370!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODIwMzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16827 invoked from network); 7 Nov 2012 20:36:55 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 20:36:55 -0000
X-SBRS: -2.2
X-MesageID: 43849546
X-Ironport-Server: ftlpip01.citrite.net
X-Remote-IP: 75.150.106.249
X-Policy: $Relay
X-IronPort-AV: E=Sophos;i="4.80,732,1344211200"; d="scan'208";a="43849546"
Received: from 75-150-106-249-newengland.hfc.comcastbusiness.net (HELO
	paine.oldroadcomputing.net) ([75.150.106.249])
	by SMTP.CITRIX.COM with ESMTP; 07 Nov 2012 20:36:28 +0000
From: Robert Phillips <robert.phillips@citrix.com>
To: xen-devel@lists.xen.org
Date: Wed,  7 Nov 2012 15:36:08 -0500
Message-Id: <1352320568-653-1-git-send-email-robert.phillips@citrix.com>
X-Mailer: git-send-email 1.7.9.5
Cc: Robert Phillips <robert.phillips@citrix.com>
Subject: [Xen-devel] [PATCH] Provide support for multiple frame buffers in
	Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Support is provided for both shadow and hardware assisted paging (HAP) modes.
This code bookkeeps the set of video frame buffers (vram),
detects when the guest has modified any of those buffers and, upon request,
returns a bitmap of the modified pages.
This lets other software components re-paint the portions of the monitor (or monitors) that have changed.
Each monitor has a frame buffer of some size at some position in guest physical memory.
The set of frame buffers being tracked can change over time as monitors are plugged and unplugged.
(Version 2 of this patch.)

Signed-Off-By: Robert Phillips <robert.phillips@citrix.com>
---
 tools/libxc/xenctrl.h            |   17 +-
 xen/arch/x86/hvm/Makefile        |    2 +-
 xen/arch/x86/hvm/hvm.c           |    4 +-
 xen/arch/x86/mm/Makefile         |    1 +
 xen/arch/x86/mm/dirty_vram.c     |  951 ++++++++++++++++++++++++++++++++++++++
 xen/arch/x86/mm/hap/hap.c        |  140 +-----
 xen/arch/x86/mm/paging.c         |  236 ++++------
 xen/arch/x86/mm/shadow/common.c  |  335 ++++++++------
 xen/arch/x86/mm/shadow/multi.c   |  174 ++++---
 xen/arch/x86/mm/shadow/multi.h   |    7 +-
 xen/arch/x86/mm/shadow/types.h   |    1 +
 xen/include/asm-x86/dirty_vram.h |  196 ++++++++
 xen/include/asm-x86/hap.h        |    4 -
 xen/include/asm-x86/hvm/domain.h |    2 +-
 xen/include/asm-x86/paging.h     |   22 +-
 xen/include/asm-x86/shadow.h     |    6 -
 16 files changed, 1535 insertions(+), 563 deletions(-)
 create mode 100644 xen/arch/x86/mm/dirty_vram.c
 create mode 100644 xen/include/asm-x86/dirty_vram.h

diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..693d7fe 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -1552,15 +1552,20 @@ int xc_hvm_inject_msi(
     xc_interface *xch, domid_t dom, uint64_t addr, uint32_t data);
 
 /*
- * Track dirty bit changes in the VRAM area
+ * Track dirty bit changes in a VRAM region defined by
+ * [ first_pfn : first_pfn + nr - 1 ]
  *
  * All of this is done atomically:
- * - get the dirty bitmap since the last call
- * - set up dirty tracking area for period up to the next call
- * - clear the dirty tracking area.
+ * - gets the dirty bitmap since the last call, all zeroes for
+ *   the first call with some new region
+ * - sets up a dirty tracking region for period up to the next call
+ * - clears the specified dirty tracking region.
  *
- * Returns -ENODATA and does not fill bitmap if the area has changed since the
- * last call.
+ * Creating a new region causes any existing regions that it overlaps
+ * to be discarded.
+ *
+ * Specifying nr == 0 causes all regions to be discarded and
+ * disables dirty bit tracking.
  */
 int xc_hvm_track_dirty_vram(
     xc_interface *xch, domid_t dom,
diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile
index eea5555..e374aac 100644
--- a/xen/arch/x86/hvm/Makefile
+++ b/xen/arch/x86/hvm/Makefile
@@ -22,4 +22,4 @@ obj-y += vlapic.o
 obj-y += vmsi.o
 obj-y += vpic.o
 obj-y += vpt.o
-obj-y += vpmu.o
\ No newline at end of file
+obj-y += vpmu.o
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 34da2f5..b12e3b6 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -57,6 +57,7 @@
 #include <asm/hvm/cacheattr.h>
 #include <asm/hvm/trace.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/dirty_vram.h>
 #include <asm/mtrr.h>
 #include <asm/apic.h>
 #include <public/sched.h>
@@ -1433,8 +1434,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
          */
         if ( access_w )
         {
-            paging_mark_dirty(v->domain, mfn_x(mfn));
-            p2m_change_type(v->domain, gfn, p2m_ram_logdirty, p2m_ram_rw);
+            paging_mark_dirty_hap(v->domain, gfn, mfn_x(mfn));
         }
         rc = 1;
         goto out_put_gfn;
diff --git a/xen/arch/x86/mm/Makefile b/xen/arch/x86/mm/Makefile
index 73dcdf4..becd0c9 100644
--- a/xen/arch/x86/mm/Makefile
+++ b/xen/arch/x86/mm/Makefile
@@ -5,6 +5,7 @@ obj-y += paging.o
 obj-y += p2m.o p2m-pt.o p2m-ept.o p2m-pod.o
 obj-y += guest_walk_2.o
 obj-y += guest_walk_3.o
+obj-y += dirty_vram.o
 obj-$(x86_64) += guest_walk_4.o
 obj-$(x86_64) += mem_event.o
 obj-$(x86_64) += mem_paging.o
diff --git a/xen/arch/x86/mm/dirty_vram.c b/xen/arch/x86/mm/dirty_vram.c
new file mode 100644
index 0000000..72bcf4e
--- /dev/null
+++ b/xen/arch/x86/mm/dirty_vram.c
@@ -0,0 +1,951 @@
+/*
+ * arch/x86/mm/dirty_vram.c: Bookkeep/query dirty VRAM pages
+ * with support for multiple frame buffers.
+ *
+ * Copyright (c) 2012, Citrix Systems, Inc. (Robert Phillips)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+
+#include <xen/types.h>
+#include <xen/sched.h>
+#include <xen/guest_access.h>
+#include <asm/shadow.h>
+#include <asm/dirty_vram.h>
+#include "mm-locks.h"
+
+#define DEBUG_stop_tracking_all_vram          1
+#define DEBUG_allocating_dirty_vram_range     1
+#define DEBUG_high_water_mark_for_vram_ranges 1
+#define DEBUG_freeing_dirty_vram_range        1
+#define DEBUG_allocate_paddr_links_page       0
+#define DEBUG_update_vram_mapping             0
+
+/* Allocates domain's dirty_vram structure */
+dv_dirty_vram_t *
+dirty_vram_alloc(struct domain *d)
+{
+    dv_dirty_vram_t *dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    dirty_vram = d->arch.hvm_domain.dirty_vram = xzalloc(dv_dirty_vram_t);
+    if ( dirty_vram )
+    {
+        INIT_LIST_HEAD(&dirty_vram->range_head);
+        INIT_LIST_HEAD(&dirty_vram->ext_head);
+    }
+    return dirty_vram;
+}
+
+/*
+ * Returns domain's dirty_vram structure,
+ * allocating it if necessary
+ */
+dv_dirty_vram_t *
+dirty_vram_find_or_alloc(struct domain *d)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( !dirty_vram )
+        dirty_vram = dirty_vram_alloc(d);
+    return dirty_vram;
+}
+
+
+/* Free domain's dirty_vram structure */
+void dirty_vram_free(struct domain *d)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        struct list_head *curr, *next;
+        /* Free all the ranges */
+        list_for_each_safe(curr, next, &dirty_vram->range_head)
+        {
+            dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+#if DEBUG_stop_tracking_all_vram
+            gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] stop tracking all vram\n",
+                     range->begin_pfn, range->end_pfn);
+#endif
+            xfree(range->pl_tab);
+            xfree(range);
+        }
+        /* Free all the extension pages */
+        list_for_each_safe(curr, next, &dirty_vram->ext_head)
+        {
+            struct dv_paddr_link_ext *ext =
+                container_of(
+                    curr, struct dv_paddr_link_ext, ext_link);
+            struct page_info *pg = __virt_to_page(ext);
+            d->arch.paging.free_page(d, pg);
+        }
+
+        xfree(dirty_vram);
+        d->arch.hvm_domain.dirty_vram = NULL;
+    }
+}
+
+/* Returns dirty vram range containing gfn, NULL if none */
+struct dv_range *
+dirty_vram_range_find_gfn(struct domain *d,
+                          unsigned long gfn)
+{
+    struct dv_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        struct list_head *curr;
+        list_for_each(curr, &dirty_vram->range_head)
+        {
+            dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+            if ( gfn >= range->begin_pfn &&
+                 gfn <  range->end_pfn )
+                return range;
+        }
+    }
+    return NULL;
+}
+
+/*
+ * Returns pointer to dirty vram range matching [begin_pfn .. end_pfn ),
+ * NULL if none.
+ */
+dv_range_t *
+dirty_vram_range_find(struct domain *d,
+                      unsigned long begin_pfn,
+                      unsigned long nr)
+{
+    unsigned long end_pfn = begin_pfn + nr;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        struct list_head *curr;
+        list_for_each(curr, &dirty_vram->range_head)
+        {
+            dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+            if ( begin_pfn == range->begin_pfn &&
+                 end_pfn   == range->end_pfn )
+                return range;
+        }
+    }
+    return NULL;
+}
+
+/* Allocate specified dirty_vram range */
+static dv_range_t *
+_dirty_vram_range_alloc(struct domain *d,
+                        unsigned long begin_pfn,
+                        unsigned long nr)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_range_t *range = NULL;
+    unsigned long end_pfn = begin_pfn + nr;
+    dv_paddr_link_t *pl_tab = NULL;
+    int i;
+
+    ASSERT( paging_locked_by_me(d) );
+    ASSERT( dirty_vram != NULL );
+
+#if DEBUG_allocating_dirty_vram_range
+    gdprintk(XENLOG_DEBUG,
+             "[%05lx:%05lx] Allocating dirty vram range hap:%d\n",
+             begin_pfn, end_pfn,
+             d->arch.hvm_domain.hap_enabled);
+#endif
+
+    range = xzalloc(dv_range_t);
+    if ( range == NULL )
+        goto err_out;
+
+    INIT_LIST_HEAD(&range->range_link);
+
+    range->begin_pfn = begin_pfn;
+    range->end_pfn = end_pfn;
+
+    if ( !hap_enabled(d) )
+    {
+        if ( (pl_tab = xzalloc_array(dv_paddr_link_t, nr)) == NULL )
+            goto err_out;
+
+        for ( i = 0; i != nr; i++ )
+        {
+            pl_tab[i].sl1ma = INVALID_PADDR;
+        }
+    }
+
+    range->pl_tab = pl_tab;
+    range->mappings_hwm = 1;
+
+    list_add(&range->range_link, &dirty_vram->range_head);
+    if ( ++dirty_vram->nr_ranges > dirty_vram->ranges_hwm )
+    {
+        dirty_vram->ranges_hwm = dirty_vram->nr_ranges;
+#if DEBUG_high_water_mark_for_vram_ranges
+        gdprintk(XENLOG_DEBUG,
+                 "High water mark for number of vram ranges is now:%d\n",
+                 dirty_vram->ranges_hwm);
+#endif
+    }
+    return range;
+
+ err_out:
+    xfree(pl_tab);
+    xfree(range);
+    return NULL;
+}
+
+
+/* Frees specified dirty_vram range */
+void dirty_vram_range_free(struct domain *d,
+                           dv_range_t *range)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        int i, nr = range->end_pfn - range->begin_pfn;
+
+#if DEBUG_freeing_dirty_vram_range
+        gdprintk(XENLOG_DEBUG,
+                 "[%05lx:%05lx] Freeing dirty vram range\n",
+                 range->begin_pfn, range->end_pfn);
+#endif
+
+        if ( range->pl_tab )
+        {
+            for ( i = 0; i != nr; i++ )
+            {
+                dv_paddr_link_t *plx;
+                plx = range->pl_tab[i].pl_next;
+                /* Does current FB page have multiple mappings? */
+                if ( plx ) /* yes */
+                {
+                    /* Find the last element in singly-linked list */
+                    while ( plx->pl_next != NULL )
+                        plx = plx->pl_next;
+                    
+                    /* Prepend whole list to the free list */
+                    plx->pl_next = dirty_vram->pl_free;
+                    dirty_vram->pl_free = range->pl_tab[i].pl_next;
+                }
+            }
+            xfree(range->pl_tab);
+            range->pl_tab = NULL;
+        }
+
+        /* Remove range from the linked list, free it, and adjust count*/
+        list_del(&range->range_link);
+        xfree(range);
+        dirty_vram->nr_ranges--;
+    }
+}
+
+/*
+ * dirty_vram_range_alloc()
+ * This function ensures that the new range does not overlap any existing
+ * ranges -- deleting them if necessary -- and then calls
+ * _dirty_vram_range_alloc to actually allocate the new range.
+ */
+dv_range_t *
+dirty_vram_range_alloc(struct domain *d,
+                        unsigned long begin_pfn,
+                        unsigned long nr)
+{
+    unsigned long end_pfn = begin_pfn + nr;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_range_t *range;
+    struct list_head *curr, *next;
+
+    ASSERT( paging_locked_by_me(d) );
+    ASSERT( dirty_vram != NULL );
+
+    /*
+     * Ranges cannot overlap so
+     * free any range that overlaps [ begin_pfn .. end_pfn )
+     */
+    list_for_each_safe(curr, next, &dirty_vram->range_head)
+    {
+        dv_range_t *rng = list_entry(curr, dv_range_t, range_link);
+        if ( ( ( rng->begin_pfn <= begin_pfn ) &&
+               ( begin_pfn <  rng->end_pfn   )
+                 ) ||
+             ( ( begin_pfn <= rng->begin_pfn ) &&
+               ( rng->begin_pfn < end_pfn    )
+                 ) )
+        {
+            /* Different tracking, tear the previous down. */
+            dirty_vram_range_free(d, rng);
+        }
+    }
+
+    range = _dirty_vram_range_alloc(d, begin_pfn, nr);
+    if ( !range )
+        goto out;
+
+ out:
+    return range;
+}
+
+/*
+ * dirty_vram_range_find_or_alloc()
+ * Find the range for [begin_pfn:begin_pfn+nr).
+ * If it doesn't exists, create it.
+ */
+dv_range_t *
+dirty_vram_range_find_or_alloc(struct domain *d,
+                                unsigned long begin_pfn,
+                                unsigned long nr)
+{
+    dv_range_t *range;
+    ASSERT( paging_locked_by_me(d) );
+    range = dirty_vram_range_find(d, begin_pfn, nr);
+    if ( !range )
+        range = dirty_vram_range_alloc(d, begin_pfn, nr);
+    
+    return range;
+}
+
+
+
+/* Allocate a dv_paddr_link struct */
+static dv_paddr_link_t *
+alloc_paddr_link(struct domain *d)
+{
+    dv_paddr_link_t * pl = NULL;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+
+    ASSERT( paging_locked_by_me(d) );
+    BUILD_BUG_ON(sizeof(dv_paddr_link_ext_t) > PAGE_SIZE);
+    /* Is the list of free pl's empty? */
+    if ( dirty_vram->pl_free == NULL ) /* yes */
+    {
+        /*
+         * Allocate another page of pl's.
+         * Link them all together and point the free list head at them
+         */
+        int i;
+        struct page_info *pg = d->arch.paging.alloc_page(d);
+        dv_paddr_link_ext_t *ext = __page_to_virt(pg);
+        if ( ext == NULL )
+            goto out;
+
+#if DEBUG_allocate_paddr_links_page
+        gdprintk(XENLOG_DEBUG, "Allocated another page of paddr_links\n");
+#endif
+        list_add(&ext->ext_link, &dirty_vram->ext_head);
+
+        /* initialize and link together the new pl entries */
+        for ( i = 0; i != ARRAY_SIZE(ext->entries); i++ )
+        {
+            ext->entries[i].sl1ma = INVALID_PADDR;
+            ext->entries[i].pl_next = &ext->entries[i+1];
+        }
+        ext->entries[ARRAY_SIZE(ext->entries) - 1].pl_next = NULL;
+        dirty_vram->pl_free = &ext->entries[0];
+    }
+    pl = dirty_vram->pl_free;
+    dirty_vram->pl_free = pl->pl_next;
+
+    pl->sl1ma = INVALID_PADDR;
+    pl->pl_next = NULL;
+ out:
+    return pl;
+}
+
+
+/*
+ * Free a paddr_link struct.
+ *
+ * The caller has walked the singly-linked list of elements
+ * that have, as their head, an element in a pl_tab cell.
+ * The list walks has reached the element to be freed.
+ * (Each element is a dv_paddr_link_t struct.)
+ *
+ * @pl points to the element to be freed.
+ * @ppl points to its predecessor element's next member.
+ *
+ * After linking the precessor to the element's successor,
+ * we can free @pl by prepending it to the list of free
+ * elements.
+ *
+ * As a boundary case (which happens to be the common case),
+ * @pl points to a cell in the pl_tab rather than to some
+ * extension element danging from that cell.
+ * We recognize this case because @ppl is NULL.
+ * In that case we promote the first extension element by
+ * copying it into the pl_tab cell and free it.
+ */
+
+dv_paddr_link_t *
+free_paddr_link(struct domain *d,
+                dv_paddr_link_t **ppl,
+                dv_paddr_link_t *pl)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_paddr_link_t *npl; /* next pl */
+
+    ASSERT( paging_locked_by_me(d) );
+    /* extension mapping? */
+    if ( ppl ) /* yes. free it */
+    {
+        ASSERT(pl == (*ppl));
+        (*ppl) = npl = pl->pl_next;
+    }
+    else  /* main table */
+    {
+        /*
+         * move 2nd mapping to main table.
+         * and free 2nd mapping
+         */
+        dv_paddr_link_t * spl;
+        spl = pl->pl_next;
+        if ( spl == NULL )
+        {
+            pl->sl1ma = INVALID_PADDR;
+            return pl;
+        }
+        pl->sl1ma = spl->sl1ma;
+        pl->pl_next = spl->pl_next;
+        npl = pl; /* reprocess main table entry again */
+        pl = spl;
+    }
+    pl->sl1ma = INVALID_PADDR;
+    pl->pl_next = dirty_vram->pl_free;
+    dirty_vram->pl_free = pl;
+    return npl;
+}
+
+
+/*
+ * dirty_vram_range_update()
+ *
+ * This is called whenever a level 1 page table entry is modified.
+ * If the L1PTE is being cleared, the function removes any paddr_links
+ * that refer to it.
+ * If the L1PTE is being set to a frame buffer page, a paddr_link is
+ * created for that page's entry in pl_tab.
+ * Returns 1 iff entry found and set or cleared.
+ */
+int dirty_vram_range_update(struct domain *d,
+                            unsigned long gfn,
+                            paddr_t sl1ma,
+                            int set)
+{
+    int effective = 0;
+    dv_range_t *range;
+    unsigned long i;
+    dv_paddr_link_t *pl;
+    dv_paddr_link_t **ppl;
+    int len = 0;
+
+    ASSERT(paging_locked_by_me(d));
+    range = dirty_vram_range_find_gfn(d, gfn);
+    if ( !range )
+        return effective;
+
+    
+    i = gfn - range->begin_pfn;
+    pl = &range->pl_tab[ i ];
+    ppl = NULL;
+
+    /*
+     * find matching entry (pl), if any, and its predecessor
+     * in linked list (ppl)
+     */
+    while ( pl != NULL )
+    {
+        if ( pl->sl1ma == sl1ma || pl->sl1ma == INVALID_PADDR )
+            break;
+            
+        ppl = &pl->pl_next;
+        pl = *ppl;
+        len++;
+    }
+
+    if ( set )
+    {
+        /* Did we find sl1ma in either the main table or the linked list? */
+        if ( pl == NULL ) /* no, so we'll need to alloc a link */
+        {
+            ASSERT(ppl != NULL);
+            /*
+             * Have we reached the limit of mappings we're willing
+             * to bookkeep?
+             */
+            if (len > DV_ADDR_LINK_LIST_LIMIT) /* yes */
+                /*
+                 * The side effect of failing to record this mapping
+                 * is that we will not detect any changes to the frame
+                 * buffer made through the mapping so
+                 * areas of a monitor may not get refreshed.
+                 * In practice this should never happen.
+                 */
+                goto out;
+
+            /* alloc link and append it to list */
+            (*ppl) = pl = alloc_paddr_link(d);
+            if ( pl == NULL )
+                goto out;
+        }
+        if ( pl->sl1ma != sl1ma )
+        {
+            ASSERT(pl->sl1ma == INVALID_PADDR);
+            pl->sl1ma = sl1ma;
+            range->nr_mappings++;
+        }
+        effective = 1;
+        if ( len > range->mappings_hwm )
+        {
+            range->mappings_hwm = len;
+#if DEBUG_update_vram_mapping
+            gdprintk(XENLOG_DEBUG,
+                     "[%lx] set      sl1ma:%lx hwm:%d mappings:%d freepages:%d\n",
+                     gfn, sl1ma,
+                     range->mappings_hwm,
+                     range->nr_mappings,
+                     d->arch.paging.shadow.free_pages);
+#endif
+        }
+    }
+    else /* clear */
+    {
+        if ( pl && pl->sl1ma == sl1ma )
+        {
+#if DEBUG_update_vram_mapping
+            gdprintk(XENLOG_DEBUG,
+                     "[%lx] clear    sl1ma:%lx mappings:%d\n",
+                     gfn, sl1ma,
+                     range->nr_mappings - 1);
+#endif
+            free_paddr_link(d, ppl, pl);
+            if ( --range->nr_mappings == 0 )
+            {
+                dirty_vram_range_free(d, range);
+            }
+            effective = 1;
+        }
+    }
+ out:
+    return effective;
+}
+
+
+/*
+ * shadow_scan_dirty_flags()
+ * This produces a dirty bitmap for the range by examining every
+ * L1PTE referenced by some dv_paddr_link in the range's pl_tab table.
+ * It tests and clears each such L1PTE's dirty flag.
+ */
+static int shadow_scan_dirty_flags(struct domain *d,
+                                   dv_range_t *range,
+                                   uint8_t *dirty_bitmap)
+{
+    int flush_tlb = 0;
+    unsigned long i;
+    unsigned long nr = range->end_pfn - range->begin_pfn;
+
+    ASSERT( paging_locked_by_me(d) );
+    /* Iterate over VRAM to track dirty bits. */
+    for ( i = 0; i < nr; i++ )
+    {
+        int dirty = 0, len = 1;
+        dv_paddr_link_t *pl;
+        for ( pl = &range->pl_tab[i]; pl; pl = pl->pl_next, len++ )
+        {
+            l1_pgentry_t *sl1e;
+            paddr_t sl1ma = pl->sl1ma;
+            if (sl1ma == INVALID_PADDR) /* FB page is unmapped */
+                continue;
+            sl1e = maddr_to_virt(sl1ma);
+            if ( l1e_get_flags(*sl1e) & _PAGE_DIRTY )
+            {
+                dirty = 1;
+                /* Clear dirty so we can detect if page gets re-dirtied.
+                 * Note: this is atomic, so we may clear a
+                 * _PAGE_ACCESSED set by another processor.
+                 */
+                l1e_remove_flags(*sl1e, _PAGE_DIRTY);
+                flush_tlb = 1;
+            }
+        } /* for */
+        
+        if ( dirty )
+            dirty_bitmap[i >> 3] |= (1 << (i & 7));
+
+    }
+
+    return flush_tlb;
+}
+
+
+/*
+ * shadow_track_dirty_vram()
+ * This is the API called by the guest to determine which pages in the range
+ * from [begin_pfn:begin_pfn+nr) have been dirtied since the last call.
+ * It creates the domain's dv_dirty_vram on demand.
+ * It creates ranges on demand when some [begin_pfn:nr) is first encountered.
+ * To collect the dirty bitmask it calls shadow_scan_dirty_flags().
+ * It copies the dirty bitmask into guest storage.
+ */
+int shadow_track_dirty_vram(struct domain *d,
+                            unsigned long begin_pfn,
+                            unsigned long nr,
+                            XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
+{
+    int rc = 0;
+    unsigned long end_pfn = begin_pfn + nr;
+    int flush_tlb = 0;
+    dv_range_t *range;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+
+    /*
+     * This range test is tricky.
+     *
+     * The range [begin_pfn..end_pfn) is an open interval, so end_pfn is a pfn
+     * beyond the end of the range.
+     *
+     * p2m->max_mapped_pfn is a valid PFN so p2m->max_mapped_pfn + 1 is an
+     * invalid PFN.
+     *
+     * If end_pfn is beyond *that* then the range is invalid.
+     */
+    if ( end_pfn < begin_pfn
+         || begin_pfn > p2m->max_mapped_pfn
+         || end_pfn > p2m->max_mapped_pfn + 1 )
+        return -EINVAL;
+
+    paging_lock(d);
+
+    if (!nr)
+    {
+        dirty_vram_free(d);
+        goto out;
+    }
+
+    if ( guest_handle_is_null(guest_dirty_bitmap) )
+        goto out;
+
+    if ( !dirty_vram_find_or_alloc(d) )
+    {
+        rc = -ENOMEM;
+        goto out;
+    }
+
+    range = dirty_vram_range_find(d, begin_pfn, nr);
+    if ( !range )
+    {
+        range = dirty_vram_range_alloc(d, begin_pfn, nr);
+        if ( range )
+            sh_find_all_vram_mappings(d->vcpu[0], range);
+    }
+    if ( range )
+    {
+        int size = (nr + BITS_PER_LONG - 1) / BITS_PER_LONG;
+        unsigned long dirty_bitmap[size];
+
+        memset(dirty_bitmap, 0x00, size * BYTES_PER_LONG);
+
+	flush_tlb |= shadow_scan_dirty_flags(d, range, (uint8_t*)dirty_bitmap);
+
+        rc = -EFAULT;
+        if ( copy_to_guest(guest_dirty_bitmap,
+                           (uint8_t*)dirty_bitmap,
+                           size * BYTES_PER_LONG) == 0 )
+            rc = 0;
+    }
+    
+    if ( flush_tlb )
+        flush_tlb_mask(d->domain_dirty_cpumask);
+
+out:
+    paging_unlock(d);
+    return rc;
+}
+
+
+/************************************************/
+/*          HAP VRAM TRACKING SUPPORT           */
+/************************************************/
+
+/*
+ * hap_enable_vram_tracking()
+ * For all ranges, mark all vram pages in range as logdirty read-only.
+ */
+static int hap_enable_vram_tracking(struct domain *d)
+{
+    int rc = 0;
+    dv_dirty_vram_t *dirty_vram;
+    struct list_head *curr;
+
+    /* turn on PG_log_dirty bit in paging mode */
+    paging_lock(d);
+    d->arch.paging.mode |= PG_log_dirty;
+    paging_unlock(d);
+
+    p2m_lock(p2m_get_hostp2m(d));
+    paging_lock(d);
+
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+
+    /*
+     * dirty_vram != NULL iff we're tracking dirty vram.
+     * If we start tracking dirty pages for all memory then
+     * the dirty_vram structure is freed.
+     */
+    if ( !dirty_vram )
+    {
+        rc = -EINVAL;
+        goto out;
+    }
+
+    /* set l1e entries of P2M table to be read-only. */
+    list_for_each(curr, &dirty_vram->range_head)
+    {
+	dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+	gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] enable  vram tracking\n",
+		 range->begin_pfn, range->end_pfn);
+	p2m_change_type_range(d, range->begin_pfn, range->end_pfn,
+			      p2m_ram_rw, p2m_ram_logdirty);
+    }
+
+    flush_tlb_mask(d->domain_dirty_cpumask);
+ out:
+    paging_unlock(d);
+    p2m_unlock(p2m_get_hostp2m(d));
+    if ( rc )
+    {
+        paging_lock(d);
+        d->arch.paging.mode &= ~PG_log_dirty;
+        paging_unlock(d);
+    }
+    return rc;
+}
+
+/*
+ * hap_disable_vram_tracking()
+ * For all ranges, mark all vram pages in range as logdirty read-write.
+ */
+static int hap_disable_vram_tracking(struct domain *d)
+{
+    int rc = 0;
+    dv_dirty_vram_t *dirty_vram;
+    struct list_head *curr;
+
+    paging_lock(d);
+    d->arch.paging.mode &= ~PG_log_dirty;
+    paging_unlock(d);
+
+    p2m_lock(p2m_get_hostp2m(d));
+    paging_lock(d);
+
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+    if ( !dirty_vram )
+    {
+        rc = -EINVAL;
+        goto out;
+    }
+
+    /* set l1e entries of P2M table with normal mode */
+    list_for_each(curr, &dirty_vram->range_head)
+    {
+	dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+	gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] disable vram tracking\n",
+		 range->begin_pfn, range->end_pfn);
+	p2m_change_type_range(d, range->begin_pfn, range->end_pfn,
+			      p2m_ram_logdirty, p2m_ram_rw);
+    }
+    flush_tlb_mask(d->domain_dirty_cpumask);
+ out:
+    paging_unlock(d);
+    p2m_unlock(p2m_get_hostp2m(d));
+    if ( rc )
+    {
+        paging_lock(d);
+        d->arch.paging.mode |= PG_log_dirty;
+        paging_unlock(d);
+    }
+    return rc;
+}
+
+/*
+ * hap_clean_vram_tracking_range()
+ * For all the pages in the range specified by [begin_pfn,nr),
+ * note in the dirty bitmap any page that has been marked as read-write,
+ * which signifies that the page has been dirtied, and reset the page
+ * to ram_logdirty.
+ */
+void hap_clean_vram_tracking_range(struct domain *d,
+                                   unsigned long begin_pfn,
+                                   unsigned long nr,
+                                   uint8_t *dirty_bitmap)
+{
+    int i;
+    unsigned long pfn;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_range_t *range;
+
+    ASSERT(p2m_locked_by_me(p2m_get_hostp2m(d)));
+    ASSERT(paging_locked_by_me(d));
+
+    if ( !dirty_vram )
+    {
+        gdprintk(XENLOG_DEBUG,
+                 "Should only be called while tracking dirty vram.\n");
+        return;
+    }
+
+    range = dirty_vram_range_find(d, begin_pfn, nr);
+    if ( !range )
+        return;
+
+    /* set l1e entries of P2M table to be read-only. */
+    /*
+     * On first write, it page faults, its entry is changed to read-write,
+     * its bit in the dirty bitmap is set, and on retry the write succeeds.
+     */
+    for ( i = 0, pfn = range->begin_pfn; pfn < range->end_pfn; i++, pfn++ )
+    {
+        p2m_type_t pt;
+        pt = p2m_change_type(d, pfn, p2m_ram_rw, p2m_ram_logdirty);
+        if ( pt == p2m_ram_rw )
+            dirty_bitmap[i >> 3] |= (1 << (i & 7));
+    }
+    flush_tlb_mask(d->domain_dirty_cpumask);
+}
+
+static void hap_vram_tracking_init(struct domain *d)
+{
+    paging_log_dirty_init(d, hap_enable_vram_tracking,
+                          hap_disable_vram_tracking,
+                          NULL);
+}
+
+/*
+ * hap_track_dirty_vram()
+ * Create the domain's dv_dirty_vram struct on demand.
+ * Create a dirty vram range on demand when some [begin_pfn:begin_pfn+nr] is
+ * first encountered.
+ * Collect the guest_dirty bitmask, a bit mask of the dirty vram pages, by
+ * calling paging_log_dirty_range().
+ */
+int hap_track_dirty_vram(struct domain *d,
+                         unsigned long begin_pfn,
+                         unsigned long nr,
+                         XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
+{
+    long rc = 0;
+    dv_dirty_vram_t *dirty_vram;
+
+    paging_lock(d);
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+    if ( nr )
+    {
+        dv_range_t *range = NULL;
+        int size = ( nr + BITS_PER_LONG - 1 ) & ~( BITS_PER_LONG - 1 );
+        uint8_t dirty_bitmap[size];
+
+        /* Already tracking dirty vram? */
+        if ( paging_mode_log_dirty(d) && dirty_vram ) /* yes */
+        {
+            /* Handle the addition of another range */
+            range = dirty_vram_range_find(d, begin_pfn, nr);
+            if ( !range )
+            {
+                rc = -ENOMEM;
+                if ( !(range = dirty_vram_range_alloc(d, begin_pfn, nr)) )
+                    goto param_fail;
+            }
+        }
+        /* Just starting to track dirty vram? */
+        else if ( !paging_mode_log_dirty(d) && !dirty_vram ) /* yes */
+        {
+            rc = -ENOMEM;
+            if ( !(dirty_vram = dirty_vram_alloc(d)) )
+                goto param_fail;
+
+            if ( !(range = dirty_vram_range_find_or_alloc(d, begin_pfn, nr)) )
+                goto param_fail;
+
+            /* Initialize callbacks for vram tracking */
+            hap_vram_tracking_init(d);
+
+            /* Enable HAP vram tracking */
+            paging_unlock(d);
+            rc = paging_log_dirty_enable(d);
+            paging_lock(d);
+            
+            if ( rc != 0 )
+                goto param_fail;
+        }
+        else
+        {
+            /* Test for invalid combination */
+            if ( !paging_mode_log_dirty(d) && dirty_vram )
+                rc = -EINVAL;
+            else /* logging dirty of all memory, not tracking dirty vram */
+                rc = -ENODATA;
+            goto param_fail;
+        }
+
+        paging_unlock(d);
+        memset(dirty_bitmap, 0x00, size);
+	paging_log_dirty_range(d, begin_pfn, nr, dirty_bitmap);
+        rc = -EFAULT;
+        if ( copy_to_guest(guest_dirty_bitmap,
+                           dirty_bitmap,
+                           size) == 0 )
+        {
+            rc = 0;
+        }
+    }
+    else
+    {
+        /*
+         * If zero pages specified while already tracking dirty vram
+         * then stop tracking
+         */
+        if ( paging_mode_log_dirty(d) && dirty_vram )
+        {
+            /* Disable HAP vram tracking */
+            paging_unlock(d);
+            rc = paging_log_dirty_disable(d);
+            paging_lock(d);
+            
+            dirty_vram_free(d);
+        }
+        else /* benign no-op */
+        {
+            rc = 0;
+        }
+        paging_unlock(d);
+    }
+
+    return rc;
+
+param_fail:
+    dirty_vram_free(d);
+    paging_unlock(d);
+    return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index fd99cde..09cdba2 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -41,6 +41,7 @@
 #include <asm/domain.h>
 #include <xen/numa.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/dirty_vram.h>
 
 #include "private.h"
 
@@ -53,139 +54,6 @@
 #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
 
 /************************************************/
-/*          HAP VRAM TRACKING SUPPORT           */
-/************************************************/
-
-static int hap_enable_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return -EINVAL;
-
-    /* turn on PG_log_dirty bit in paging mode */
-    paging_lock(d);
-    d->arch.paging.mode |= PG_log_dirty;
-    paging_unlock(d);
-
-    /* set l1e entries of P2M table to be read-only. */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_rw, p2m_ram_logdirty);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-    return 0;
-}
-
-static int hap_disable_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return -EINVAL;
-
-    paging_lock(d);
-    d->arch.paging.mode &= ~PG_log_dirty;
-    paging_unlock(d);
-
-    /* set l1e entries of P2M table with normal mode */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_logdirty, p2m_ram_rw);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-    return 0;
-}
-
-static void hap_clean_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return;
-
-    /* set l1e entries of P2M table to be read-only. */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_rw, p2m_ram_logdirty);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-}
-
-static void hap_vram_tracking_init(struct domain *d)
-{
-    paging_log_dirty_init(d, hap_enable_vram_tracking,
-                          hap_disable_vram_tracking,
-                          hap_clean_vram_tracking);
-}
-
-int hap_track_dirty_vram(struct domain *d,
-                         unsigned long begin_pfn,
-                         unsigned long nr,
-                         XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
-{
-    long rc = 0;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( nr )
-    {
-        if ( paging_mode_log_dirty(d) && dirty_vram )
-        {
-            if ( begin_pfn != dirty_vram->begin_pfn ||
-                 begin_pfn + nr != dirty_vram->end_pfn )
-            {
-                paging_log_dirty_disable(d);
-                dirty_vram->begin_pfn = begin_pfn;
-                dirty_vram->end_pfn = begin_pfn + nr;
-                rc = paging_log_dirty_enable(d);
-                if (rc != 0)
-                    goto param_fail;
-            }
-        }
-        else if ( !paging_mode_log_dirty(d) && !dirty_vram )
-        {
-            rc = -ENOMEM;
-            if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL )
-                goto param_fail;
-
-            dirty_vram->begin_pfn = begin_pfn;
-            dirty_vram->end_pfn = begin_pfn + nr;
-            d->arch.hvm_domain.dirty_vram = dirty_vram;
-            hap_vram_tracking_init(d);
-            rc = paging_log_dirty_enable(d);
-            if (rc != 0)
-                goto param_fail;
-        }
-        else
-        {
-            if ( !paging_mode_log_dirty(d) && dirty_vram )
-                rc = -EINVAL;
-            else
-                rc = -ENODATA;
-            goto param_fail;
-        }
-        /* get the bitmap */
-        rc = paging_log_dirty_range(d, begin_pfn, nr, dirty_bitmap);
-    }
-    else
-    {
-        if ( paging_mode_log_dirty(d) && dirty_vram ) {
-            rc = paging_log_dirty_disable(d);
-            xfree(dirty_vram);
-            dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-        } else
-            rc = 0;
-    }
-
-    return rc;
-
-param_fail:
-    if ( dirty_vram )
-    {
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-    }
-    return rc;
-}
-
-/************************************************/
 /*            HAP LOG DIRTY SUPPORT             */
 /************************************************/
 
@@ -223,14 +91,12 @@ static void hap_clean_dirty_bitmap(struct domain *d)
 
 void hap_logdirty_init(struct domain *d)
 {
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    struct dv_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
     if ( paging_mode_log_dirty(d) && dirty_vram )
     {
         paging_log_dirty_disable(d);
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
+        dirty_vram_free(d);
     }
-
     /* Reinitialize logdirty mechanism */
     paging_log_dirty_init(d, hap_enable_log_dirty,
                           hap_disable_log_dirty,
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index ea44e39..5e76609 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -27,6 +27,7 @@
 #include <asm/p2m.h>
 #include <asm/hap.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/dirty_vram.h>
 #include <xen/numa.h>
 #include <xsm/xsm.h>
 
@@ -278,6 +279,46 @@ out:
 }
 
 
+/* paging_mark_dirty_hap()
+ * Make a hap page writeable and mark it as dirty.
+ * This done atomically under the p2m and paging locks to avoid leaving
+ * a window where the page might be modified without being counted as dirty.
+ */
+void paging_mark_dirty_hap(struct domain *d,
+                           unsigned long pfn,
+                           unsigned long guest_mfn)
+{
+    mfn_t gmfn;
+    p2m_type_t pt;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    
+    if ( !paging_mode_log_dirty(d) )
+        return;
+
+    gmfn = _mfn(guest_mfn);
+
+    ASSERT( mfn_valid(gmfn) &&
+            page_get_owner(mfn_to_page(gmfn)) == d );
+
+    p2m_lock(p2m);
+    pt = p2m_change_type(d, pfn, p2m_ram_logdirty, p2m_ram_rw);
+    paging_lock(d);
+    if ( pt == p2m_ram_logdirty )
+    {
+        dv_range_t *range;
+        PAGING_DEBUG(LOGDIRTY,
+                     "marked mfn %" PRI_mfn " (pfn=%lx), dom %d\n",
+                     mfn_x(gmfn), pfn, d->domain_id);
+        d->arch.paging.log_dirty.dirty_count++;
+        range = dirty_vram_range_find_gfn(d, pfn);
+        if ( range )
+            range->dirty_count++;
+    }
+    paging_mark_dirty(d, guest_mfn); 
+    paging_unlock(d);
+    p2m_unlock(p2m);
+}
+
 /* Is this guest page dirty? */
 int paging_mfn_is_dirty(struct domain *d, mfn_t gmfn)
 {
@@ -333,8 +374,11 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
     mfn_t *l4, *l3, *l2;
     unsigned long *l1;
     int i4, i3, i2;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
 
     domain_pause(d);
+    /* Locking hierarchy requires p2m lock to be taken first */
+    p2m_lock(p2m);
     paging_lock(d);
 
     clean = (sc->op == XEN_DOMCTL_SHADOW_OP_CLEAN);
@@ -345,6 +389,14 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
                  d->arch.paging.log_dirty.fault_count,
                  d->arch.paging.log_dirty.dirty_count);
 
+    if ( hap_enabled(d) && d->arch.hvm_domain.dirty_vram )
+    {
+        /* If we're cleaning/peeking all guest memory, we should not be tracking
+         * dirty vram. */
+        rv = -EINVAL;
+        goto out;
+    }
+
     sc->stats.fault_count = d->arch.paging.log_dirty.fault_count;
     sc->stats.dirty_count = d->arch.paging.log_dirty.dirty_count;
 
@@ -424,170 +476,64 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
 
     if ( clean )
     {
-        /* We need to further call clean_dirty_bitmap() functions of specific
-         * paging modes (shadow or hap).  Safe because the domain is paused. */
-        d->arch.paging.log_dirty.clean_dirty_bitmap(d);
+        /* Is null if tracking dirty vram */
+        if ( d->arch.paging.log_dirty.clean_dirty_bitmap )
+        {
+            /*
+             * We need to call clean_dirty_bitmap() functions of specific
+             * paging modes (shadow or hap).
+             * Safe because the domain is paused.
+             */
+            d->arch.paging.log_dirty.clean_dirty_bitmap(d);
+        }
     }
     domain_unpause(d);
     return rv;
 
  out:
     paging_unlock(d);
+    p2m_unlock(p2m);
     domain_unpause(d);
     return rv;
 }
 
-int paging_log_dirty_range(struct domain *d,
-                            unsigned long begin_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
+void paging_log_dirty_range(struct domain *d,
+                           unsigned long begin_pfn,
+                           unsigned long nr,
+                           uint8_t *dirty_bitmap)
 {
-    int rv = 0;
-    unsigned long pages = 0;
-    mfn_t *l4, *l3, *l2;
-    unsigned long *l1;
-    int b1, b2, b3, b4;
-    int i2, i3, i4;
-
-    d->arch.paging.log_dirty.clean_dirty_bitmap(d);
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    dv_range_t *range;
+    unsigned int range_dirty_count = 0;
+    
+    p2m_lock(p2m);
     paging_lock(d);
 
-    PAGING_DEBUG(LOGDIRTY, "log-dirty-range: dom %u faults=%u dirty=%u\n",
-                 d->domain_id,
-                 d->arch.paging.log_dirty.fault_count,
-                 d->arch.paging.log_dirty.dirty_count);
-
-    if ( unlikely(d->arch.paging.log_dirty.failed_allocs) ) {
-        printk("%s: %d failed page allocs while logging dirty pages\n",
-               __FUNCTION__, d->arch.paging.log_dirty.failed_allocs);
-        rv = -ENOMEM;
-        goto out;
-    }
-
-    if ( !d->arch.paging.log_dirty.fault_count &&
-         !d->arch.paging.log_dirty.dirty_count ) {
-        unsigned int size = BITS_TO_LONGS(nr);
-
-        if ( clear_guest(dirty_bitmap, size * BYTES_PER_LONG) != 0 )
-            rv = -EFAULT;
-        goto out;
-    }
-    d->arch.paging.log_dirty.fault_count = 0;
-    d->arch.paging.log_dirty.dirty_count = 0;
-
-    b1 = L1_LOGDIRTY_IDX(begin_pfn);
-    b2 = L2_LOGDIRTY_IDX(begin_pfn);
-    b3 = L3_LOGDIRTY_IDX(begin_pfn);
-    b4 = L4_LOGDIRTY_IDX(begin_pfn);
-    l4 = paging_map_log_dirty_bitmap(d);
-
-    for ( i4 = b4;
-          (pages < nr) && (i4 < LOGDIRTY_NODE_ENTRIES);
-          i4++ )
+    /* Only called when tracking dirty vram in HAP mode */
+    ASSERT(hap_enabled(d) && d->arch.hvm_domain.dirty_vram);
+    
+    range = dirty_vram_range_find_gfn(d, begin_pfn);
+    if ( range )
     {
-        l3 = (l4 && mfn_valid(l4[i4])) ? map_domain_page(mfn_x(l4[i4])) : NULL;
-        for ( i3 = b3;
-              (pages < nr) && (i3 < LOGDIRTY_NODE_ENTRIES);
-              i3++ )
-        {
-            l2 = ((l3 && mfn_valid(l3[i3])) ?
-                  map_domain_page(mfn_x(l3[i3])) : NULL);
-            for ( i2 = b2;
-                  (pages < nr) && (i2 < LOGDIRTY_NODE_ENTRIES);
-                  i2++ )
-            {
-                unsigned int bytes = PAGE_SIZE;
-                uint8_t *s;
-                l1 = ((l2 && mfn_valid(l2[i2])) ?
-                      map_domain_page(mfn_x(l2[i2])) : NULL);
-
-                s = ((uint8_t*)l1) + (b1 >> 3);
-                bytes -= b1 >> 3;
-
-                if ( likely(((nr - pages + 7) >> 3) < bytes) )
-                    bytes = (unsigned int)((nr - pages + 7) >> 3);
-
-                if ( !l1 )
-                {
-                    if ( clear_guest_offset(dirty_bitmap, pages >> 3,
-                                            bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-                /* begin_pfn is not 32K aligned, hence we have to bit
-                 * shift the bitmap */
-                else if ( b1 & 0x7 )
-                {
-                    int i, j;
-                    uint32_t *l = (uint32_t*) s;
-                    int bits = b1 & 0x7;
-                    int bitmask = (1 << bits) - 1;
-                    int size = (bytes + BYTES_PER_LONG - 1) / BYTES_PER_LONG;
-                    unsigned long bitmap[size];
-                    static unsigned long printed = 0;
-
-                    if ( printed != begin_pfn )
-                    {
-                        dprintk(XENLOG_DEBUG, "%s: begin_pfn %lx is not 32K aligned!\n",
-                                __FUNCTION__, begin_pfn);
-                        printed = begin_pfn;
-                    }
-
-                    for ( i = 0; i < size - 1; i++, l++ ) {
-                        bitmap[i] = ((*l) >> bits) |
-                            (((*((uint8_t*)(l + 1))) & bitmask) << (sizeof(*l) * 8 - bits));
-                    }
-                    s = (uint8_t*) l;
-                    size = BYTES_PER_LONG - ((b1 >> 3) & 0x3);
-                    bitmap[i] = 0;
-                    for ( j = 0; j < size; j++, s++ )
-                        bitmap[i] |= (*s) << (j * 8);
-                    bitmap[i] = (bitmap[i] >> bits) | (bitmask << (size * 8 - bits));
-                    if ( copy_to_guest_offset(dirty_bitmap, (pages >> 3),
-                                (uint8_t*) bitmap, bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-                else
-                {
-                    if ( copy_to_guest_offset(dirty_bitmap, pages >> 3,
-                                              s, bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-
-                pages += bytes << 3;
-                if ( l1 )
-                {
-                    clear_page(l1);
-                    unmap_domain_page(l1);
-                }
-                b1 = b1 & 0x7;
-            }
-            b2 = 0;
-            if ( l2 )
-                unmap_domain_page(l2);
-        }
-        b3 = 0;
-        if ( l3 )
-            unmap_domain_page(l3);
+        range_dirty_count = range->dirty_count;
+        range->dirty_count = 0;
     }
-    if ( l4 )
-        unmap_domain_page(l4);
-
-    paging_unlock(d);
+    
+    if ( !range_dirty_count)
+        goto out;
 
-    return rv;
+    PAGING_DEBUG(LOGDIRTY,
+                 "log-dirty-range: dom %u [%05lx:%05lx] range_dirty=%u\n",
+                 d->domain_id,
+                 begin_pfn,
+                 range->end_pfn,
+                 range_dirty_count);
 
+    hap_clean_vram_tracking_range(d, begin_pfn, nr, dirty_bitmap);
  out:
     paging_unlock(d);
-    return rv;
+    p2m_unlock(p2m);
+    return;
 }
 
 /* Note that this function takes three function pointers. Callers must supply
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index ce79131..4e40f43 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -36,6 +36,7 @@
 #include <asm/current.h>
 #include <asm/flushtlb.h>
 #include <asm/shadow.h>
+#include <asm/dirty_vram.h>
 #include <xen/numa.h>
 #include "private.h"
 
@@ -3121,12 +3122,7 @@ void shadow_teardown(struct domain *d)
      * calls now that we've torn down the bitmap */
     d->arch.paging.mode &= ~PG_log_dirty;
 
-    if (d->arch.hvm_domain.dirty_vram) {
-        xfree(d->arch.hvm_domain.dirty_vram->sl1ma);
-        xfree(d->arch.hvm_domain.dirty_vram->dirty_bitmap);
-        xfree(d->arch.hvm_domain.dirty_vram);
-        d->arch.hvm_domain.dirty_vram = NULL;
-    }
+    dirty_vram_free(d);
 
     paging_unlock(d);
 
@@ -3463,179 +3459,212 @@ void shadow_clean_dirty_bitmap(struct domain *d)
 
 
 /**************************************************************************/
-/* VRAM dirty tracking support */
-int shadow_track_dirty_vram(struct domain *d,
-                            unsigned long begin_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
-{
-    int rc;
-    unsigned long end_pfn = begin_pfn + nr;
-    unsigned long dirty_size = (nr + 7) / 8;
-    int flush_tlb = 0;
-    unsigned long i;
-    p2m_type_t t;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-    struct p2m_domain *p2m = p2m_get_hostp2m(d);
-
-    if (end_pfn < begin_pfn
-            || begin_pfn > p2m->max_mapped_pfn
-            || end_pfn >= p2m->max_mapped_pfn)
-        return -EINVAL;
-
-    /* We perform p2m lookups, so lock the p2m upfront to avoid deadlock */
-    p2m_lock(p2m_get_hostp2m(d));
-    paging_lock(d);
+/* Support functions for shadow-based dirty VRAM code */
 
-    if ( dirty_vram && (!nr ||
-             ( begin_pfn != dirty_vram->begin_pfn
-            || end_pfn   != dirty_vram->end_pfn )) )
-    {
-        /* Different tracking, tear the previous down. */
-        gdprintk(XENLOG_INFO, "stopping tracking VRAM %lx - %lx\n", dirty_vram->begin_pfn, dirty_vram->end_pfn);
-        xfree(dirty_vram->sl1ma);
-        xfree(dirty_vram->dirty_bitmap);
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-    }
+#define DEBUG_unshadow_sl1ma                  0          
+#define DEBUG_unshadow_sl1ma_detail           0
+#define DEBUG_count_initial_mappings          1
 
-    if ( !nr )
+/* smfn is no longer a shadow page.  Remove it from any
+ * dirty vram range mapping. */
+void
+dirty_vram_delete_shadow(struct vcpu *v,
+                         unsigned long gfn,
+                         unsigned int shadow_type, 
+                         mfn_t smfn)
+{
+    static unsigned int l1_shadow_mask = 
+          1 << SH_type_l1_32_shadow
+        | 1 << SH_type_fl1_32_shadow
+        | 1 << SH_type_l1_pae_shadow
+        | 1 << SH_type_fl1_pae_shadow
+        | 1 << SH_type_l1_64_shadow
+        | 1 << SH_type_fl1_64_shadow
+        ;
+    struct domain *d = v->domain;
+    dv_dirty_vram_t *dirty_vram;
+    struct list_head *curr, *next;
+    
+    ASSERT(paging_locked_by_me(d));
+    /* Ignore all but level 1 shadows */
+    
+    if ( (l1_shadow_mask & (1 << shadow_type)) == 0 )
     {
-        rc = 0;
         goto out;
     }
 
-    /* This should happen seldomly (Video mode change),
-     * no need to be careful. */
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
     if ( !dirty_vram )
     {
-        /* Throw away all the shadows rather than walking through them 
-         * up to nr times getting rid of mappings of each pfn */
-        shadow_blow_tables(d);
-
-        gdprintk(XENLOG_INFO, "tracking VRAM %lx - %lx\n", begin_pfn, end_pfn);
-
-        rc = -ENOMEM;
-        if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL )
-            goto out;
-        dirty_vram->begin_pfn = begin_pfn;
-        dirty_vram->end_pfn = end_pfn;
-        d->arch.hvm_domain.dirty_vram = dirty_vram;
-
-        if ( (dirty_vram->sl1ma = xmalloc_array(paddr_t, nr)) == NULL )
-            goto out_dirty_vram;
-        memset(dirty_vram->sl1ma, ~0, sizeof(paddr_t) * nr);
-
-        if ( (dirty_vram->dirty_bitmap = xzalloc_array(uint8_t, dirty_size)) == NULL )
-            goto out_sl1ma;
-
-        dirty_vram->last_dirty = NOW();
-
-        /* Tell the caller that this time we could not track dirty bits. */
-        rc = -ENODATA;
-    }
-    else if (dirty_vram->last_dirty == -1)
-    {
-        /* still completely clean, just copy our empty bitmap */
-        rc = -EFAULT;
-        if ( copy_to_guest(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size) == 0 )
-            rc = 0;
+        goto out;
     }
-    else
+        
+    list_for_each_safe(curr, next, &dirty_vram->range_head)
     {
-        /* Iterate over VRAM to track dirty bits. */
-        for ( i = 0; i < nr; i++ ) {
-            mfn_t mfn = get_gfn_query_unlocked(d, begin_pfn + i, &t);
-            struct page_info *page;
-            int dirty = 0;
-            paddr_t sl1ma = dirty_vram->sl1ma[i];
-
-            if (mfn_x(mfn) == INVALID_MFN)
-            {
-                dirty = 1;
-            }
-            else
+        dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+        unsigned long i;
+        int max_mappings = 1, mappings = 0;
+        int unshadowed = 0;
+        for ( i = 0; i != range->end_pfn - range->begin_pfn; i++ )
+        {
+            dv_paddr_link_t *pl = &range->pl_tab[ i ];
+            dv_paddr_link_t **ppl = NULL;
+            mappings = 0;
+            
+            while ( pl != NULL )
             {
-                page = mfn_to_page(mfn);
-                switch (page->u.inuse.type_info & PGT_count_mask)
-                {
-                case 0:
-                    /* No guest reference, nothing to track. */
-                    break;
-                case 1:
-                    /* One guest reference. */
-                    if ( sl1ma == INVALID_PADDR )
-                    {
-                        /* We don't know which sl1e points to this, too bad. */
-                        dirty = 1;
-                        /* TODO: Heuristics for finding the single mapping of
-                         * this gmfn */
-                        flush_tlb |= sh_remove_all_mappings(d->vcpu[0], mfn);
-                    }
-                    else
-                    {
-                        /* Hopefully the most common case: only one mapping,
-                         * whose dirty bit we can use. */
-                        l1_pgentry_t *sl1e = maddr_to_virt(sl1ma);
-
-                        if ( l1e_get_flags(*sl1e) & _PAGE_DIRTY )
-                        {
-                            dirty = 1;
-                            /* Note: this is atomic, so we may clear a
-                             * _PAGE_ACCESSED set by another processor. */
-                            l1e_remove_flags(*sl1e, _PAGE_DIRTY);
-                            flush_tlb = 1;
-                        }
-                    }
-                    break;
-                default:
-                    /* More than one guest reference,
-                     * we don't afford tracking that. */
-                    dirty = 1;
+                paddr_t sl1ma = pl->sl1ma;
+                unsigned long sl1mn;
+                
+                if ( sl1ma == INVALID_PADDR )
                     break;
+                
+                sl1mn = sl1ma >> PAGE_SHIFT;
+                if ( sl1mn == mfn_x(smfn) ) {
+#if DEBUG_unshadow_sl1ma_detail
+                    gdprintk(XENLOG_DEBUG,
+                             "[%lx] gfn[%lx] unshadow sl1ma:%lx\n",
+                             mfn_x(smfn),
+                             range->begin_pfn + i,
+                             sl1ma);
+#endif
+                    unshadowed++;
+                    pl = free_paddr_link(d, ppl, pl);
+                    --range->nr_mappings;
+                }
+                else
+                {
+                    ppl = &pl->pl_next;
+                    pl = *ppl;
+                    mappings++;
                 }
             }
-
-            if ( dirty )
+        }
+        if ( mappings > max_mappings )
+            max_mappings = mappings;
+        
+        if ( unshadowed ) {
+#if DEBUG_unshadow_sl1ma
+            gdprintk(XENLOG_DEBUG,
+                     "[%lx] gfn[%05lx:%05lx] unshadowed:%d mappings:0x%x max_mappings:%d\n",
+                     mfn_x(smfn),
+                     range->begin_pfn, range->end_pfn,
+                     unshadowed, range->nr_mappings, max_mappings);
+#endif
+            if ( range->nr_mappings == 0 )
             {
-                dirty_vram->dirty_bitmap[i / 8] |= 1 << (i % 8);
-                dirty_vram->last_dirty = NOW();
+                dirty_vram_range_free(d, range);                    
             }
         }
+    }
+ out:
+    return;
+}
+
+
+typedef int (*hash_pfn_callback_t)(struct vcpu *v,
+                                   mfn_t smfn,
+                                   unsigned long begin_pfn,
+                                   unsigned long end_pfn,
+                                   int *removed);
+
+static int hash_pfn_foreach(struct vcpu *v, 
+                            unsigned int callback_mask, 
+                            hash_pfn_callback_t callbacks[], 
+                            unsigned long begin_pfn,
+                            unsigned long end_pfn)
+/* Walk the hash table looking at the types of the entries and 
+ * calling the appropriate callback function for each entry. 
+ * The mask determines which shadow types we call back for, and the array
+ * of callbacks tells us which function to call.
+ * Any callback may return non-zero to let us skip the rest of the scan. 
+ *
+ * WARNING: Callbacks MUST NOT add or remove hash entries unless they 
+ * then return non-zero to terminate the scan. */
+{
+    int i, done = 0, removed = 0;
+    struct domain *d = v->domain;
+    struct page_info *x;
+
+    /* Say we're here, to stop hash-lookups reordering the chains */
+    ASSERT(paging_locked_by_me(d));
+    ASSERT(d->arch.paging.shadow.hash_walking == 0);
+    d->arch.paging.shadow.hash_walking = 1;
 
-        rc = -EFAULT;
-        if ( copy_to_guest(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size) == 0 ) {
-            memset(dirty_vram->dirty_bitmap, 0, dirty_size);
-            if (dirty_vram->last_dirty + SECONDS(2) < NOW())
+    for ( i = 0; i < SHADOW_HASH_BUCKETS; i++ ) 
+    {
+        /* WARNING: This is not safe against changes to the hash table.
+         * The callback *must* return non-zero if it has inserted or
+         * deleted anything from the hash (lookups are OK, though). */
+        for ( x = d->arch.paging.shadow.hash_table[i]; x; x = next_shadow(x) )
+        {
+            if ( callback_mask & (1 << x->u.sh.type) )
             {
-                /* was clean for more than two seconds, try to disable guest
-                 * write access */
-                for ( i = begin_pfn; i < end_pfn; i++ ) {
-                    mfn_t mfn = get_gfn_query_unlocked(d, i, &t);
-                    if (mfn_x(mfn) != INVALID_MFN)
-                        flush_tlb |= sh_remove_write_access(d->vcpu[0], mfn, 1, 0);
-                }
-                dirty_vram->last_dirty = -1;
+                ASSERT(x->u.sh.type <= 15);
+                ASSERT(callbacks[x->u.sh.type] != NULL);
+                done = callbacks[x->u.sh.type](v, page_to_mfn(x), 
+                                               begin_pfn, end_pfn,
+                                               &removed);
+                if ( done ) break;
             }
-            rc = 0;
         }
+        if ( done ) break; 
     }
-    if ( flush_tlb )
-        flush_tlb_mask(d->domain_dirty_cpumask);
-    goto out;
+    d->arch.paging.shadow.hash_walking = 0;
+    return removed;
+}
 
-out_sl1ma:
-    xfree(dirty_vram->sl1ma);
-out_dirty_vram:
-    xfree(dirty_vram);
-    dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
+void sh_find_all_vram_mappings(struct vcpu *v,
+                               dv_range_t *range)
+{
+    /* Dispatch table for getting per-type functions */
+    static hash_pfn_callback_t callbacks[SH_type_unused] = {
+        NULL, /* none    */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 2), /* l1_32   */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 2), /* fl1_32  */
+        NULL, /* l2_32   */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 3), /* l1_pae  */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 3), /* fl1_pae */
+        NULL, /* l2_pae  */
+        NULL, /* l2h_pae */
+#if CONFIG_PAGING_LEVELS >= 4
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 4), /* l1_64   */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 4), /* fl1_64  */
+#else
+        NULL, /* l1_64   */
+        NULL, /* fl1_64  */
+#endif
+        NULL, /* l2_64   */
+        NULL, /* l2h_64  */
+        NULL, /* l3_64   */
+        NULL, /* l4_64   */
+        NULL, /* p2m     */
+        NULL  /* unused  */
+    };
 
-out:
-    paging_unlock(d);
-    p2m_unlock(p2m_get_hostp2m(d));
-    return rc;
+    static unsigned int callback_mask = 
+          1 << SH_type_l1_32_shadow
+        | 1 << SH_type_fl1_32_shadow
+        | 1 << SH_type_l1_pae_shadow
+        | 1 << SH_type_fl1_pae_shadow
+        | 1 << SH_type_l1_64_shadow
+        | 1 << SH_type_fl1_64_shadow
+        ;
+
+    perfc_incr(shadow_mappings);
+
+    hash_pfn_foreach(v, callback_mask, callbacks,
+                     range->begin_pfn,
+                     range->end_pfn);
+
+#if DEBUG_count_initial_mappings
+    gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] count of initial mappings:%d\n",
+             range->begin_pfn, range->end_pfn,
+             range->nr_mappings);
+#endif
 }
 
+
 /**************************************************************************/
 /* Shadow-control XEN_DOMCTL dispatcher */
 
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index b0e6d72..9c00574 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -35,6 +35,7 @@
 #include <asm/flushtlb.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/cacheattr.h>
+#include <asm/dirty_vram.h>
 #include <asm/mtrr.h>
 #include <asm/guest_pt.h>
 #include <public/sched.h>
@@ -149,6 +150,10 @@ delete_fl1_shadow_status(struct vcpu *v, gfn_t gfn, mfn_t smfn)
     SHADOW_PRINTK("gfn=%"SH_PRI_gfn", type=%08x, smfn=%05lx\n",
                    gfn_x(gfn), SH_type_fl1_shadow, mfn_x(smfn));
     ASSERT(mfn_to_page(smfn)->u.sh.head);
+
+    /* Removing any dv_paddr_links to the erstwhile shadow page */
+    dirty_vram_delete_shadow(v, gfn_x(gfn), SH_type_fl1_shadow, smfn);
+    
     shadow_hash_delete(v, gfn_x(gfn), SH_type_fl1_shadow, smfn);
 }
 
@@ -160,6 +165,10 @@ delete_shadow_status(struct vcpu *v, mfn_t gmfn, u32 shadow_type, mfn_t smfn)
                    v->domain->domain_id, v->vcpu_id,
                    mfn_x(gmfn), shadow_type, mfn_x(smfn));
     ASSERT(mfn_to_page(smfn)->u.sh.head);
+    
+    /* Removing any dv_paddr_links to the erstwhile shadow page */
+    dirty_vram_delete_shadow(v, mfn_x(gmfn), shadow_type, smfn);
+    
     shadow_hash_delete(v, mfn_x(gmfn), shadow_type, smfn);
     /* 32-on-64 PV guests don't own their l4 pages; see set_shadow_status */
     if ( !is_pv_32on64_vcpu(v) || shadow_type != SH_type_l4_64_shadow )
@@ -516,7 +525,6 @@ _sh_propagate(struct vcpu *v,
     guest_l1e_t guest_entry = { guest_intpte };
     shadow_l1e_t *sp = shadow_entry_ptr;
     struct domain *d = v->domain;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
     gfn_t target_gfn = guest_l1e_get_gfn(guest_entry);
     u32 pass_thru_flags;
     u32 gflags, sflags;
@@ -663,17 +671,6 @@ _sh_propagate(struct vcpu *v,
         }
     }
 
-    if ( unlikely((level == 1) && dirty_vram
-            && dirty_vram->last_dirty == -1
-            && gfn_x(target_gfn) >= dirty_vram->begin_pfn
-            && gfn_x(target_gfn) < dirty_vram->end_pfn) )
-    {
-        if ( ft & FETCH_TYPE_WRITE )
-            dirty_vram->last_dirty = NOW();
-        else
-            sflags &= ~_PAGE_RW;
-    }
-
     /* Read-only memory */
     if ( p2m_is_readonly(p2mt) ||
          (p2mt == p2m_mmio_direct &&
@@ -1072,101 +1069,60 @@ static int shadow_set_l2e(struct vcpu *v,
     return flags;
 }
 
-static inline void shadow_vram_get_l1e(shadow_l1e_t new_sl1e,
+/* shadow_vram_fix_l1e()
+ *
+ * Tests L1PTEs as they are modified, looking for when they start to
+ * (or cease to) point to frame buffer pages.  If the old and new gfns differ,
+ * calls dirty_vram_range_update() to updates the dirty_vram structures.
+ */
+static inline void shadow_vram_fix_l1e(shadow_l1e_t old_sl1e,
+                                       shadow_l1e_t new_sl1e,
                                        shadow_l1e_t *sl1e,
                                        mfn_t sl1mfn,
                                        struct domain *d)
 { 
-    mfn_t mfn = shadow_l1e_get_mfn(new_sl1e);
-    int flags = shadow_l1e_get_flags(new_sl1e);
-    unsigned long gfn;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    mfn_t new_mfn, old_mfn;
+    unsigned long new_gfn = INVALID_M2P_ENTRY, old_gfn = INVALID_M2P_ENTRY;
+    paddr_t sl1ma;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
 
-    if ( !dirty_vram         /* tracking disabled? */
-         || !(flags & _PAGE_RW) /* read-only mapping? */
-         || !mfn_valid(mfn) )   /* mfn can be invalid in mmio_direct */
+    if ( !dirty_vram )
         return;
 
-    gfn = mfn_to_gfn(d, mfn);
-    /* Page sharing not supported on shadow PTs */
-    BUG_ON(SHARED_M2P(gfn));
+    sl1ma = pfn_to_paddr(mfn_x(sl1mfn)) | ((unsigned long)sl1e & ~PAGE_MASK);
 
-    if ( (gfn >= dirty_vram->begin_pfn) && (gfn < dirty_vram->end_pfn) )
+    old_mfn = shadow_l1e_get_mfn(old_sl1e);
+
+    if ( !sh_l1e_is_magic(old_sl1e) &&
+         (l1e_get_flags(old_sl1e) & _PAGE_PRESENT) &&
+         mfn_valid(old_mfn))
     {
-        unsigned long i = gfn - dirty_vram->begin_pfn;
-        struct page_info *page = mfn_to_page(mfn);
-        
-        if ( (page->u.inuse.type_info & PGT_count_mask) == 1 )
-            /* Initial guest reference, record it */
-            dirty_vram->sl1ma[i] = pfn_to_paddr(mfn_x(sl1mfn))
-                | ((unsigned long)sl1e & ~PAGE_MASK);
+        old_gfn = mfn_to_gfn(d, old_mfn);
     }
-}
-
-static inline void shadow_vram_put_l1e(shadow_l1e_t old_sl1e,
-                                       shadow_l1e_t *sl1e,
-                                       mfn_t sl1mfn,
-                                       struct domain *d)
-{
-    mfn_t mfn = shadow_l1e_get_mfn(old_sl1e);
-    int flags = shadow_l1e_get_flags(old_sl1e);
-    unsigned long gfn;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram         /* tracking disabled? */
-         || !(flags & _PAGE_RW) /* read-only mapping? */
-         || !mfn_valid(mfn) )   /* mfn can be invalid in mmio_direct */
-        return;
-
-    gfn = mfn_to_gfn(d, mfn);
-    /* Page sharing not supported on shadow PTs */
-    BUG_ON(SHARED_M2P(gfn));
-
-    if ( (gfn >= dirty_vram->begin_pfn) && (gfn < dirty_vram->end_pfn) )
+    
+    new_mfn = shadow_l1e_get_mfn(new_sl1e);
+    if ( !sh_l1e_is_magic(new_sl1e) &&
+         (l1e_get_flags(new_sl1e) & _PAGE_PRESENT) &&
+         mfn_valid(new_mfn))
     {
-        unsigned long i = gfn - dirty_vram->begin_pfn;
-        struct page_info *page = mfn_to_page(mfn);
-        int dirty = 0;
-        paddr_t sl1ma = pfn_to_paddr(mfn_x(sl1mfn))
-            | ((unsigned long)sl1e & ~PAGE_MASK);
+        new_gfn = mfn_to_gfn(d, new_mfn);
+    }
 
-        if ( (page->u.inuse.type_info & PGT_count_mask) == 1 )
-        {
-            /* Last reference */
-            if ( dirty_vram->sl1ma[i] == INVALID_PADDR ) {
-                /* We didn't know it was that one, let's say it is dirty */
-                dirty = 1;
-            }
-            else
-            {
-                ASSERT(dirty_vram->sl1ma[i] == sl1ma);
-                dirty_vram->sl1ma[i] = INVALID_PADDR;
-                if ( flags & _PAGE_DIRTY )
-                    dirty = 1;
-            }
-        }
-        else
+    if ( old_gfn == new_gfn ) return;
+
+    if ( VALID_M2P(old_gfn) )
+        if ( dirty_vram_range_update(d, old_gfn, sl1ma, 0/*clear*/) )
         {
-            /* We had more than one reference, just consider the page dirty. */
-            dirty = 1;
-            /* Check that it's not the one we recorded. */
-            if ( dirty_vram->sl1ma[i] == sl1ma )
-            {
-                /* Too bad, we remembered the wrong one... */
-                dirty_vram->sl1ma[i] = INVALID_PADDR;
-            }
-            else
-            {
-                /* Ok, our recorded sl1e is still pointing to this page, let's
-                 * just hope it will remain. */
-            }
+            SHADOW_PRINTK("gfn %lx (mfn %lx) cleared vram pte\n",
+                          old_gfn, mfn_x(old_mfn));
         }
-        if ( dirty )
+
+    if ( VALID_M2P(new_gfn) )
+        if ( dirty_vram_range_update(d, new_gfn, sl1ma, 1/*set*/) )
         {
-            dirty_vram->dirty_bitmap[i / 8] |= 1 << (i % 8);
-            dirty_vram->last_dirty = NOW();
+            SHADOW_PRINTK("gfn %lx (mfn %lx) set vram pte\n",
+                          new_gfn, mfn_x(new_mfn));
         }
-    }
 }
 
 static int shadow_set_l1e(struct vcpu *v, 
@@ -1211,12 +1167,13 @@ static int shadow_set_l1e(struct vcpu *v,
                 shadow_l1e_remove_flags(new_sl1e, _PAGE_RW);
                 /* fall through */
             case 0:
-                shadow_vram_get_l1e(new_sl1e, sl1e, sl1mfn, d);
                 break;
             }
         }
     } 
 
+    shadow_vram_fix_l1e(old_sl1e, new_sl1e, sl1e, sl1mfn, d);
+
     /* Write the new entry */
     shadow_write_entries(sl1e, &new_sl1e, 1, sl1mfn);
     flags |= SHADOW_SET_CHANGED;
@@ -1231,7 +1188,6 @@ static int shadow_set_l1e(struct vcpu *v,
          * trigger a flush later. */
         if ( shadow_mode_refcounts(d) ) 
         {
-            shadow_vram_put_l1e(old_sl1e, sl1e, sl1mfn, d);
             shadow_put_page_from_l1e(old_sl1e, d);
             TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_SHADOW_L1_PUT_REF);
         } 
@@ -2018,7 +1974,6 @@ void sh_destroy_l1_shadow(struct vcpu *v, mfn_t smfn)
         SHADOW_FOREACH_L1E(sl1mfn, sl1e, 0, 0, {
             if ( (shadow_l1e_get_flags(*sl1e) & _PAGE_PRESENT)
                  && !sh_l1e_is_magic(*sl1e) ) {
-                shadow_vram_put_l1e(*sl1e, sl1e, sl1mfn, d);
                 shadow_put_page_from_l1e(*sl1e, d);
             }
         });
@@ -4336,6 +4291,37 @@ int sh_rm_mappings_from_l1(struct vcpu *v, mfn_t sl1mfn, mfn_t target_mfn)
     return done;
 }
 
+
+int sh_find_vram_mappings_in_l1(struct vcpu *v,
+                                mfn_t sl1mfn,
+                                unsigned long begin_pfn,
+                                unsigned long end_pfn,
+                                int *removed)
+/* Find all VRAM mappings in this shadow l1 table */
+{
+    struct domain *d = v->domain;
+    shadow_l1e_t *sl1e;
+    int done = 0;
+
+    /* only returns _PAGE_PRESENT entries */
+    SHADOW_FOREACH_L1E(sl1mfn, sl1e, 0, done, 
+    {
+        unsigned long gfn;
+        mfn_t gmfn = shadow_l1e_get_mfn(*sl1e);
+        if ( !mfn_valid(gmfn) )
+            continue;
+        gfn = mfn_to_gfn(d, gmfn);
+        if ( VALID_M2P(gfn) && (begin_pfn <= gfn) && (gfn < end_pfn) ) 
+        {
+            paddr_t sl1ma =
+                pfn_to_paddr(mfn_x(sl1mfn)) |
+                ( (unsigned long)sl1e & ~PAGE_MASK );
+            dirty_vram_range_update(v->domain, gfn, sl1ma, 1/*set*/);
+        }
+    });
+    return 0;
+}
+
 /**************************************************************************/
 /* Functions to excise all pointers to shadows from higher-level shadows. */
 
diff --git a/xen/arch/x86/mm/shadow/multi.h b/xen/arch/x86/mm/shadow/multi.h
index 835121e..436a4ac 100644
--- a/xen/arch/x86/mm/shadow/multi.h
+++ b/xen/arch/x86/mm/shadow/multi.h
@@ -66,7 +66,12 @@ SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, GUEST_LEVELS)
 extern int
 SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, GUEST_LEVELS)
     (struct vcpu *v, mfn_t sl1mfn, mfn_t target_mfn);
-
+extern int
+SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, GUEST_LEVELS)
+     (struct vcpu *v, mfn_t sl1mfn, 
+      unsigned long begin_pfn,
+      unsigned long end_pfn,
+      int *removed);
 extern void
 SHADOW_INTERNAL_NAME(sh_clear_shadow_entry, GUEST_LEVELS)
     (struct vcpu *v, void *ep, mfn_t smfn);
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index 43ce1db..5b0f9f7 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -229,6 +229,7 @@ static inline shadow_l4e_t shadow_l4e_from_mfn(mfn_t mfn, u32 flags)
 #define sh_update_cr3              INTERNAL_NAME(sh_update_cr3)
 #define sh_rm_write_access_from_l1 INTERNAL_NAME(sh_rm_write_access_from_l1)
 #define sh_rm_mappings_from_l1     INTERNAL_NAME(sh_rm_mappings_from_l1)
+#define sh_find_vram_mappings_in_l1 INTERNAL_NAME(sh_find_vram_mappings_in_l1)
 #define sh_remove_l1_shadow        INTERNAL_NAME(sh_remove_l1_shadow)
 #define sh_remove_l2_shadow        INTERNAL_NAME(sh_remove_l2_shadow)
 #define sh_remove_l3_shadow        INTERNAL_NAME(sh_remove_l3_shadow)
diff --git a/xen/include/asm-x86/dirty_vram.h b/xen/include/asm-x86/dirty_vram.h
new file mode 100644
index 0000000..7f3ccf9
--- /dev/null
+++ b/xen/include/asm-x86/dirty_vram.h
@@ -0,0 +1,196 @@
+/******************************************************************************
+ * include/asm-x86/dirty_vram.h
+ *
+ * Interface for tracking dirty VRAM pages
+ *
+ * Copyright (c) 2012 Citrix Systems, Inc. (Robert Phillips)
+ * Parts of this code are Copyright (c) 2006 by XenSource Inc.
+ * Parts of this code are Copyright (c) 2006 by Michael A Fetterman
+ * Parts based on earlier work by Michael A Fetterman, Ian Pratt et al.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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
+ */
+
+#ifndef _DIRTY_VRAM_H
+#define _DIRTY_VRAM_H
+
+/*
+ * In shadow mode we need to bookkeep all the L1 page table entries that
+ * map a frame buffer page.  Struct dv_paddr_link does this
+ * by recording the address of a L1 page table entry for some frame buffer page.
+ * Also has a link to additional pl entries if the frame buffer page
+ * has multiple mappings.
+ * In practice very few pages have multiple mappings.
+ * But to rule out some pathological situation, we limit the number of
+ * mappings we're willing to bookkeep.
+ */
+
+#define DV_ADDR_LINK_LIST_LIMIT 20
+
+typedef struct dv_paddr_link {
+    paddr_t sl1ma;
+    struct dv_paddr_link *pl_next;
+} dv_paddr_link_t;
+
+/*
+ * This defines an extension page of pl entries for FB pages with multiple
+ * mappings. All such pages (of a domain) are linked together.
+ */
+typedef struct dv_paddr_link_ext {
+    struct list_head ext_link;
+    dv_paddr_link_t entries[ ( PAGE_SIZE - sizeof( struct list_head ) ) /
+                             sizeof( dv_paddr_link_t ) ];
+} dv_paddr_link_ext_t;
+
+/*
+ * This defines a single frame buffer range.  It bookkeeps all the level 1 PTEs
+ * that map guest pages within that range.
+ * All such ranges (of a domain) are linked together.
+ */
+typedef struct dv_range {
+    struct list_head range_link; /* the several ranges form a linked list */
+    unsigned long begin_pfn;
+    unsigned long end_pfn;
+    dv_paddr_link_t *pl_tab; /* table has 1 pl entry per pfn in range */
+    int nr_mappings;  /* total number of mappings in this range */
+    int mappings_hwm; /* high water mark of max mapping count */
+    unsigned int dirty_count;
+} dv_range_t;
+
+/*
+ * This contains all the data structures required by a domain to
+ * bookkeep the dirty pages within its frame buffers.
+ */
+typedef struct dv_dirty_vram {
+    struct list_head range_head; /* head of the linked list of ranges */
+    struct list_head ext_head; /* head of list of extension pages */
+    dv_paddr_link_t *pl_free; /* free list of pl's within extension pages */
+    int nr_ranges; /* bookkeeps number of ranges */
+    int ranges_hwm; /* high water mark of max number of ranges */
+} dv_dirty_vram_t;
+
+/* Allocates domain's dirty_vram structure */
+dv_dirty_vram_t *
+dirty_vram_alloc(struct domain *d);
+
+/*
+ * Returns domain's dirty_vram structure,
+ * allocating it if necessary
+ */
+dv_dirty_vram_t *
+dirty_vram_find_or_alloc(struct domain *d);
+
+/* Frees domain's dirty_vram structure */
+void dirty_vram_free(struct domain *d);
+
+/* Returns dirty vram range containing gfn, NULL if none */
+struct dv_range *
+dirty_vram_range_find_gfn(struct domain *d,
+                          unsigned long gfn);
+
+/*
+ * Returns dirty vram range matching [ begin_pfn .. begin_pfn+nr ),
+ * NULL if none
+ */
+dv_range_t *
+dirty_vram_range_find(struct domain *d,
+                      unsigned long begin_pfn,
+                      unsigned long nr);
+
+/*
+ * Allocate dirty vram range containing [ begin_pfn .. begin_pfn+nr ),
+ * freeing any existing range that overlaps the new range.
+ */
+dv_range_t *
+dirty_vram_range_alloc(struct domain *d,
+                       unsigned long begin_pfn,
+                       unsigned long nr);
+
+/*
+ * Returns dirty vram range matching [ begin_pfn .. begin_pfn+nr ),
+ * creating a range if none already exists and
+ * freeing any existing range that overlaps the new range.
+ */
+dv_range_t *
+dirty_vram_range_find_or_alloc(struct domain *d,
+                               unsigned long begin_pfn,
+                               unsigned long nr);
+
+void dirty_vram_range_free(struct domain *d,
+                           dv_range_t *range);
+
+/* Bookkeep PTE address of a frame buffer page */
+int dirty_vram_range_update(struct domain *d,
+                            unsigned long gfn,
+                            paddr_t sl1ma,
+                            int set);
+
+/*
+ * smfn is no longer a shadow page.  Remove it from any
+ * dirty vram range mapping.
+ */
+void
+dirty_vram_delete_shadow(struct vcpu *v,
+                         unsigned long gfn,
+                         unsigned int shadow_type,
+                         mfn_t smfn);
+
+
+/*
+ * Scan all the L1 tables looking for VRAM mappings.
+ * Record them in the domain's dv_dirty_vram structure
+ */
+void sh_find_all_vram_mappings(struct vcpu *v,
+                               dv_range_t *range);
+
+/*
+ * Free a paddr_link struct, given address of its
+ * predecessor in singly-linked list
+ */
+dv_paddr_link_t *
+free_paddr_link(struct domain *d,
+                dv_paddr_link_t **ppl,
+                dv_paddr_link_t *pl);
+
+
+/* Enable VRAM dirty tracking. */
+int
+shadow_track_dirty_vram(struct domain *d,
+			unsigned long first_pfn,
+			unsigned long nr,
+			XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+
+int
+hap_track_dirty_vram(struct domain *d,
+		     unsigned long begin_pfn,
+		     unsigned long nr,
+		     XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+
+void
+hap_clean_vram_tracking_range(struct domain *d,
+			      unsigned long begin_pfn,
+			      unsigned long nr,
+			      uint8_t *dirty_bitmap);
+
+#endif /* _DIRTY_VRAM_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-x86/hap.h b/xen/include/asm-x86/hap.h
index 916a35b..3e3a1f5 100644
--- a/xen/include/asm-x86/hap.h
+++ b/xen/include/asm-x86/hap.h
@@ -57,10 +57,6 @@ void  hap_final_teardown(struct domain *d);
 void  hap_teardown(struct domain *d);
 void  hap_vcpu_init(struct vcpu *v);
 void  hap_logdirty_init(struct domain *d);
-int   hap_track_dirty_vram(struct domain *d,
-                           unsigned long begin_pfn,
-                           unsigned long nr,
-                           XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
 
 extern const struct paging_mode *hap_paging_get_mode(struct vcpu *);
 
diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h
index 27b3de5..6146542 100644
--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -74,7 +74,7 @@ struct hvm_domain {
     struct list_head       pinned_cacheattr_ranges;
 
     /* VRAM dirty support. */
-    struct sh_dirty_vram *dirty_vram;
+    struct dv_dirty_vram * dirty_vram;
 
     /* If one of vcpus of this domain is in no_fill_mode or
      * mtrr/pat between vcpus is not the same, set is_in_uc_mode
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 9a40f2c..f804104 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -137,10 +137,10 @@ struct paging_mode {
 void paging_free_log_dirty_bitmap(struct domain *d);
 
 /* get the dirty bitmap for a specific range of pfns */
-int paging_log_dirty_range(struct domain *d,
-                           unsigned long begin_pfn,
-                           unsigned long nr,
-                           XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+void paging_log_dirty_range(struct domain *d,
+                            unsigned long begin_pfn,
+                            unsigned long nr,
+                            uint8_t *dirty_bitmap);
 
 /* enable log dirty */
 int paging_log_dirty_enable(struct domain *d);
@@ -161,6 +161,11 @@ void paging_mark_dirty(struct domain *d, unsigned long guest_mfn);
  * This is called from inside paging code, with the paging lock held. */
 int paging_mfn_is_dirty(struct domain *d, mfn_t gmfn);
 
+/* mark a page as dirty, from hap page fault handler */
+void paging_mark_dirty_hap(struct domain *d,
+                           unsigned long pfn,
+                           unsigned long guest_mfn);
+
 /*
  * Log-dirty radix tree indexing:
  *   All tree nodes are PAGE_SIZE bytes, mapped on-demand.
@@ -183,15 +188,6 @@ int paging_mfn_is_dirty(struct domain *d, mfn_t gmfn);
 #define L4_LOGDIRTY_IDX(pfn) 0
 #endif
 
-/* VRAM dirty tracking support */
-struct sh_dirty_vram {
-    unsigned long begin_pfn;
-    unsigned long end_pfn;
-    paddr_t *sl1ma;
-    uint8_t *dirty_bitmap;
-    s_time_t last_dirty;
-};
-
 /*****************************************************************************
  * Entry points into the paging-assistance code */
 
diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
index 2eb6efc..940d7fd 100644
--- a/xen/include/asm-x86/shadow.h
+++ b/xen/include/asm-x86/shadow.h
@@ -62,12 +62,6 @@ void shadow_vcpu_init(struct vcpu *v);
 /* Enable an arbitrary shadow mode.  Call once at domain creation. */
 int shadow_enable(struct domain *d, u32 mode);
 
-/* Enable VRAM dirty bit tracking. */
-int shadow_track_dirty_vram(struct domain *d,
-                            unsigned long first_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
-
 /* Handler for shadow control ops: operations from user-space to enable
  * and disable ephemeral shadow modes (test mode and log-dirty mode) and
  * manipulate the log-dirty bitmap. */
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 20:37:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 20:37:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWCMu-0000VV-9n; Wed, 07 Nov 2012 20:37:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <robert.phillips@citrix.com>) id 1TWCMs-0000VD-KL
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 20:36:59 +0000
Received: from [85.158.139.83:61379] by server-15.bemta-5.messagelabs.com id
	98/04-26920-966CA905; Wed, 07 Nov 2012 20:36:57 +0000
X-Env-Sender: robert.phillips@citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1352320602!29243370!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODIwMzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16827 invoked from network); 7 Nov 2012 20:36:55 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 20:36:55 -0000
X-SBRS: -2.2
X-MesageID: 43849546
X-Ironport-Server: ftlpip01.citrite.net
X-Remote-IP: 75.150.106.249
X-Policy: $Relay
X-IronPort-AV: E=Sophos;i="4.80,732,1344211200"; d="scan'208";a="43849546"
Received: from 75-150-106-249-newengland.hfc.comcastbusiness.net (HELO
	paine.oldroadcomputing.net) ([75.150.106.249])
	by SMTP.CITRIX.COM with ESMTP; 07 Nov 2012 20:36:28 +0000
From: Robert Phillips <robert.phillips@citrix.com>
To: xen-devel@lists.xen.org
Date: Wed,  7 Nov 2012 15:36:08 -0500
Message-Id: <1352320568-653-1-git-send-email-robert.phillips@citrix.com>
X-Mailer: git-send-email 1.7.9.5
Cc: Robert Phillips <robert.phillips@citrix.com>
Subject: [Xen-devel] [PATCH] Provide support for multiple frame buffers in
	Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Support is provided for both shadow and hardware assisted paging (HAP) modes.
This code bookkeeps the set of video frame buffers (vram),
detects when the guest has modified any of those buffers and, upon request,
returns a bitmap of the modified pages.
This lets other software components re-paint the portions of the monitor (or monitors) that have changed.
Each monitor has a frame buffer of some size at some position in guest physical memory.
The set of frame buffers being tracked can change over time as monitors are plugged and unplugged.
(Version 2 of this patch.)

Signed-Off-By: Robert Phillips <robert.phillips@citrix.com>
---
 tools/libxc/xenctrl.h            |   17 +-
 xen/arch/x86/hvm/Makefile        |    2 +-
 xen/arch/x86/hvm/hvm.c           |    4 +-
 xen/arch/x86/mm/Makefile         |    1 +
 xen/arch/x86/mm/dirty_vram.c     |  951 ++++++++++++++++++++++++++++++++++++++
 xen/arch/x86/mm/hap/hap.c        |  140 +-----
 xen/arch/x86/mm/paging.c         |  236 ++++------
 xen/arch/x86/mm/shadow/common.c  |  335 ++++++++------
 xen/arch/x86/mm/shadow/multi.c   |  174 ++++---
 xen/arch/x86/mm/shadow/multi.h   |    7 +-
 xen/arch/x86/mm/shadow/types.h   |    1 +
 xen/include/asm-x86/dirty_vram.h |  196 ++++++++
 xen/include/asm-x86/hap.h        |    4 -
 xen/include/asm-x86/hvm/domain.h |    2 +-
 xen/include/asm-x86/paging.h     |   22 +-
 xen/include/asm-x86/shadow.h     |    6 -
 16 files changed, 1535 insertions(+), 563 deletions(-)
 create mode 100644 xen/arch/x86/mm/dirty_vram.c
 create mode 100644 xen/include/asm-x86/dirty_vram.h

diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..693d7fe 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -1552,15 +1552,20 @@ int xc_hvm_inject_msi(
     xc_interface *xch, domid_t dom, uint64_t addr, uint32_t data);
 
 /*
- * Track dirty bit changes in the VRAM area
+ * Track dirty bit changes in a VRAM region defined by
+ * [ first_pfn : first_pfn + nr - 1 ]
  *
  * All of this is done atomically:
- * - get the dirty bitmap since the last call
- * - set up dirty tracking area for period up to the next call
- * - clear the dirty tracking area.
+ * - gets the dirty bitmap since the last call, all zeroes for
+ *   the first call with some new region
+ * - sets up a dirty tracking region for period up to the next call
+ * - clears the specified dirty tracking region.
  *
- * Returns -ENODATA and does not fill bitmap if the area has changed since the
- * last call.
+ * Creating a new region causes any existing regions that it overlaps
+ * to be discarded.
+ *
+ * Specifying nr == 0 causes all regions to be discarded and
+ * disables dirty bit tracking.
  */
 int xc_hvm_track_dirty_vram(
     xc_interface *xch, domid_t dom,
diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile
index eea5555..e374aac 100644
--- a/xen/arch/x86/hvm/Makefile
+++ b/xen/arch/x86/hvm/Makefile
@@ -22,4 +22,4 @@ obj-y += vlapic.o
 obj-y += vmsi.o
 obj-y += vpic.o
 obj-y += vpt.o
-obj-y += vpmu.o
\ No newline at end of file
+obj-y += vpmu.o
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 34da2f5..b12e3b6 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -57,6 +57,7 @@
 #include <asm/hvm/cacheattr.h>
 #include <asm/hvm/trace.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/dirty_vram.h>
 #include <asm/mtrr.h>
 #include <asm/apic.h>
 #include <public/sched.h>
@@ -1433,8 +1434,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
          */
         if ( access_w )
         {
-            paging_mark_dirty(v->domain, mfn_x(mfn));
-            p2m_change_type(v->domain, gfn, p2m_ram_logdirty, p2m_ram_rw);
+            paging_mark_dirty_hap(v->domain, gfn, mfn_x(mfn));
         }
         rc = 1;
         goto out_put_gfn;
diff --git a/xen/arch/x86/mm/Makefile b/xen/arch/x86/mm/Makefile
index 73dcdf4..becd0c9 100644
--- a/xen/arch/x86/mm/Makefile
+++ b/xen/arch/x86/mm/Makefile
@@ -5,6 +5,7 @@ obj-y += paging.o
 obj-y += p2m.o p2m-pt.o p2m-ept.o p2m-pod.o
 obj-y += guest_walk_2.o
 obj-y += guest_walk_3.o
+obj-y += dirty_vram.o
 obj-$(x86_64) += guest_walk_4.o
 obj-$(x86_64) += mem_event.o
 obj-$(x86_64) += mem_paging.o
diff --git a/xen/arch/x86/mm/dirty_vram.c b/xen/arch/x86/mm/dirty_vram.c
new file mode 100644
index 0000000..72bcf4e
--- /dev/null
+++ b/xen/arch/x86/mm/dirty_vram.c
@@ -0,0 +1,951 @@
+/*
+ * arch/x86/mm/dirty_vram.c: Bookkeep/query dirty VRAM pages
+ * with support for multiple frame buffers.
+ *
+ * Copyright (c) 2012, Citrix Systems, Inc. (Robert Phillips)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+
+#include <xen/types.h>
+#include <xen/sched.h>
+#include <xen/guest_access.h>
+#include <asm/shadow.h>
+#include <asm/dirty_vram.h>
+#include "mm-locks.h"
+
+#define DEBUG_stop_tracking_all_vram          1
+#define DEBUG_allocating_dirty_vram_range     1
+#define DEBUG_high_water_mark_for_vram_ranges 1
+#define DEBUG_freeing_dirty_vram_range        1
+#define DEBUG_allocate_paddr_links_page       0
+#define DEBUG_update_vram_mapping             0
+
+/* Allocates domain's dirty_vram structure */
+dv_dirty_vram_t *
+dirty_vram_alloc(struct domain *d)
+{
+    dv_dirty_vram_t *dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    dirty_vram = d->arch.hvm_domain.dirty_vram = xzalloc(dv_dirty_vram_t);
+    if ( dirty_vram )
+    {
+        INIT_LIST_HEAD(&dirty_vram->range_head);
+        INIT_LIST_HEAD(&dirty_vram->ext_head);
+    }
+    return dirty_vram;
+}
+
+/*
+ * Returns domain's dirty_vram structure,
+ * allocating it if necessary
+ */
+dv_dirty_vram_t *
+dirty_vram_find_or_alloc(struct domain *d)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( !dirty_vram )
+        dirty_vram = dirty_vram_alloc(d);
+    return dirty_vram;
+}
+
+
+/* Free domain's dirty_vram structure */
+void dirty_vram_free(struct domain *d)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        struct list_head *curr, *next;
+        /* Free all the ranges */
+        list_for_each_safe(curr, next, &dirty_vram->range_head)
+        {
+            dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+#if DEBUG_stop_tracking_all_vram
+            gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] stop tracking all vram\n",
+                     range->begin_pfn, range->end_pfn);
+#endif
+            xfree(range->pl_tab);
+            xfree(range);
+        }
+        /* Free all the extension pages */
+        list_for_each_safe(curr, next, &dirty_vram->ext_head)
+        {
+            struct dv_paddr_link_ext *ext =
+                container_of(
+                    curr, struct dv_paddr_link_ext, ext_link);
+            struct page_info *pg = __virt_to_page(ext);
+            d->arch.paging.free_page(d, pg);
+        }
+
+        xfree(dirty_vram);
+        d->arch.hvm_domain.dirty_vram = NULL;
+    }
+}
+
+/* Returns dirty vram range containing gfn, NULL if none */
+struct dv_range *
+dirty_vram_range_find_gfn(struct domain *d,
+                          unsigned long gfn)
+{
+    struct dv_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        struct list_head *curr;
+        list_for_each(curr, &dirty_vram->range_head)
+        {
+            dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+            if ( gfn >= range->begin_pfn &&
+                 gfn <  range->end_pfn )
+                return range;
+        }
+    }
+    return NULL;
+}
+
+/*
+ * Returns pointer to dirty vram range matching [begin_pfn .. end_pfn ),
+ * NULL if none.
+ */
+dv_range_t *
+dirty_vram_range_find(struct domain *d,
+                      unsigned long begin_pfn,
+                      unsigned long nr)
+{
+    unsigned long end_pfn = begin_pfn + nr;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        struct list_head *curr;
+        list_for_each(curr, &dirty_vram->range_head)
+        {
+            dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+            if ( begin_pfn == range->begin_pfn &&
+                 end_pfn   == range->end_pfn )
+                return range;
+        }
+    }
+    return NULL;
+}
+
+/* Allocate specified dirty_vram range */
+static dv_range_t *
+_dirty_vram_range_alloc(struct domain *d,
+                        unsigned long begin_pfn,
+                        unsigned long nr)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_range_t *range = NULL;
+    unsigned long end_pfn = begin_pfn + nr;
+    dv_paddr_link_t *pl_tab = NULL;
+    int i;
+
+    ASSERT( paging_locked_by_me(d) );
+    ASSERT( dirty_vram != NULL );
+
+#if DEBUG_allocating_dirty_vram_range
+    gdprintk(XENLOG_DEBUG,
+             "[%05lx:%05lx] Allocating dirty vram range hap:%d\n",
+             begin_pfn, end_pfn,
+             d->arch.hvm_domain.hap_enabled);
+#endif
+
+    range = xzalloc(dv_range_t);
+    if ( range == NULL )
+        goto err_out;
+
+    INIT_LIST_HEAD(&range->range_link);
+
+    range->begin_pfn = begin_pfn;
+    range->end_pfn = end_pfn;
+
+    if ( !hap_enabled(d) )
+    {
+        if ( (pl_tab = xzalloc_array(dv_paddr_link_t, nr)) == NULL )
+            goto err_out;
+
+        for ( i = 0; i != nr; i++ )
+        {
+            pl_tab[i].sl1ma = INVALID_PADDR;
+        }
+    }
+
+    range->pl_tab = pl_tab;
+    range->mappings_hwm = 1;
+
+    list_add(&range->range_link, &dirty_vram->range_head);
+    if ( ++dirty_vram->nr_ranges > dirty_vram->ranges_hwm )
+    {
+        dirty_vram->ranges_hwm = dirty_vram->nr_ranges;
+#if DEBUG_high_water_mark_for_vram_ranges
+        gdprintk(XENLOG_DEBUG,
+                 "High water mark for number of vram ranges is now:%d\n",
+                 dirty_vram->ranges_hwm);
+#endif
+    }
+    return range;
+
+ err_out:
+    xfree(pl_tab);
+    xfree(range);
+    return NULL;
+}
+
+
+/* Frees specified dirty_vram range */
+void dirty_vram_range_free(struct domain *d,
+                           dv_range_t *range)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        int i, nr = range->end_pfn - range->begin_pfn;
+
+#if DEBUG_freeing_dirty_vram_range
+        gdprintk(XENLOG_DEBUG,
+                 "[%05lx:%05lx] Freeing dirty vram range\n",
+                 range->begin_pfn, range->end_pfn);
+#endif
+
+        if ( range->pl_tab )
+        {
+            for ( i = 0; i != nr; i++ )
+            {
+                dv_paddr_link_t *plx;
+                plx = range->pl_tab[i].pl_next;
+                /* Does current FB page have multiple mappings? */
+                if ( plx ) /* yes */
+                {
+                    /* Find the last element in singly-linked list */
+                    while ( plx->pl_next != NULL )
+                        plx = plx->pl_next;
+                    
+                    /* Prepend whole list to the free list */
+                    plx->pl_next = dirty_vram->pl_free;
+                    dirty_vram->pl_free = range->pl_tab[i].pl_next;
+                }
+            }
+            xfree(range->pl_tab);
+            range->pl_tab = NULL;
+        }
+
+        /* Remove range from the linked list, free it, and adjust count*/
+        list_del(&range->range_link);
+        xfree(range);
+        dirty_vram->nr_ranges--;
+    }
+}
+
+/*
+ * dirty_vram_range_alloc()
+ * This function ensures that the new range does not overlap any existing
+ * ranges -- deleting them if necessary -- and then calls
+ * _dirty_vram_range_alloc to actually allocate the new range.
+ */
+dv_range_t *
+dirty_vram_range_alloc(struct domain *d,
+                        unsigned long begin_pfn,
+                        unsigned long nr)
+{
+    unsigned long end_pfn = begin_pfn + nr;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_range_t *range;
+    struct list_head *curr, *next;
+
+    ASSERT( paging_locked_by_me(d) );
+    ASSERT( dirty_vram != NULL );
+
+    /*
+     * Ranges cannot overlap so
+     * free any range that overlaps [ begin_pfn .. end_pfn )
+     */
+    list_for_each_safe(curr, next, &dirty_vram->range_head)
+    {
+        dv_range_t *rng = list_entry(curr, dv_range_t, range_link);
+        if ( ( ( rng->begin_pfn <= begin_pfn ) &&
+               ( begin_pfn <  rng->end_pfn   )
+                 ) ||
+             ( ( begin_pfn <= rng->begin_pfn ) &&
+               ( rng->begin_pfn < end_pfn    )
+                 ) )
+        {
+            /* Different tracking, tear the previous down. */
+            dirty_vram_range_free(d, rng);
+        }
+    }
+
+    range = _dirty_vram_range_alloc(d, begin_pfn, nr);
+    if ( !range )
+        goto out;
+
+ out:
+    return range;
+}
+
+/*
+ * dirty_vram_range_find_or_alloc()
+ * Find the range for [begin_pfn:begin_pfn+nr).
+ * If it doesn't exists, create it.
+ */
+dv_range_t *
+dirty_vram_range_find_or_alloc(struct domain *d,
+                                unsigned long begin_pfn,
+                                unsigned long nr)
+{
+    dv_range_t *range;
+    ASSERT( paging_locked_by_me(d) );
+    range = dirty_vram_range_find(d, begin_pfn, nr);
+    if ( !range )
+        range = dirty_vram_range_alloc(d, begin_pfn, nr);
+    
+    return range;
+}
+
+
+
+/* Allocate a dv_paddr_link struct */
+static dv_paddr_link_t *
+alloc_paddr_link(struct domain *d)
+{
+    dv_paddr_link_t * pl = NULL;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+
+    ASSERT( paging_locked_by_me(d) );
+    BUILD_BUG_ON(sizeof(dv_paddr_link_ext_t) > PAGE_SIZE);
+    /* Is the list of free pl's empty? */
+    if ( dirty_vram->pl_free == NULL ) /* yes */
+    {
+        /*
+         * Allocate another page of pl's.
+         * Link them all together and point the free list head at them
+         */
+        int i;
+        struct page_info *pg = d->arch.paging.alloc_page(d);
+        dv_paddr_link_ext_t *ext = __page_to_virt(pg);
+        if ( ext == NULL )
+            goto out;
+
+#if DEBUG_allocate_paddr_links_page
+        gdprintk(XENLOG_DEBUG, "Allocated another page of paddr_links\n");
+#endif
+        list_add(&ext->ext_link, &dirty_vram->ext_head);
+
+        /* initialize and link together the new pl entries */
+        for ( i = 0; i != ARRAY_SIZE(ext->entries); i++ )
+        {
+            ext->entries[i].sl1ma = INVALID_PADDR;
+            ext->entries[i].pl_next = &ext->entries[i+1];
+        }
+        ext->entries[ARRAY_SIZE(ext->entries) - 1].pl_next = NULL;
+        dirty_vram->pl_free = &ext->entries[0];
+    }
+    pl = dirty_vram->pl_free;
+    dirty_vram->pl_free = pl->pl_next;
+
+    pl->sl1ma = INVALID_PADDR;
+    pl->pl_next = NULL;
+ out:
+    return pl;
+}
+
+
+/*
+ * Free a paddr_link struct.
+ *
+ * The caller has walked the singly-linked list of elements
+ * that have, as their head, an element in a pl_tab cell.
+ * The list walks has reached the element to be freed.
+ * (Each element is a dv_paddr_link_t struct.)
+ *
+ * @pl points to the element to be freed.
+ * @ppl points to its predecessor element's next member.
+ *
+ * After linking the precessor to the element's successor,
+ * we can free @pl by prepending it to the list of free
+ * elements.
+ *
+ * As a boundary case (which happens to be the common case),
+ * @pl points to a cell in the pl_tab rather than to some
+ * extension element danging from that cell.
+ * We recognize this case because @ppl is NULL.
+ * In that case we promote the first extension element by
+ * copying it into the pl_tab cell and free it.
+ */
+
+dv_paddr_link_t *
+free_paddr_link(struct domain *d,
+                dv_paddr_link_t **ppl,
+                dv_paddr_link_t *pl)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_paddr_link_t *npl; /* next pl */
+
+    ASSERT( paging_locked_by_me(d) );
+    /* extension mapping? */
+    if ( ppl ) /* yes. free it */
+    {
+        ASSERT(pl == (*ppl));
+        (*ppl) = npl = pl->pl_next;
+    }
+    else  /* main table */
+    {
+        /*
+         * move 2nd mapping to main table.
+         * and free 2nd mapping
+         */
+        dv_paddr_link_t * spl;
+        spl = pl->pl_next;
+        if ( spl == NULL )
+        {
+            pl->sl1ma = INVALID_PADDR;
+            return pl;
+        }
+        pl->sl1ma = spl->sl1ma;
+        pl->pl_next = spl->pl_next;
+        npl = pl; /* reprocess main table entry again */
+        pl = spl;
+    }
+    pl->sl1ma = INVALID_PADDR;
+    pl->pl_next = dirty_vram->pl_free;
+    dirty_vram->pl_free = pl;
+    return npl;
+}
+
+
+/*
+ * dirty_vram_range_update()
+ *
+ * This is called whenever a level 1 page table entry is modified.
+ * If the L1PTE is being cleared, the function removes any paddr_links
+ * that refer to it.
+ * If the L1PTE is being set to a frame buffer page, a paddr_link is
+ * created for that page's entry in pl_tab.
+ * Returns 1 iff entry found and set or cleared.
+ */
+int dirty_vram_range_update(struct domain *d,
+                            unsigned long gfn,
+                            paddr_t sl1ma,
+                            int set)
+{
+    int effective = 0;
+    dv_range_t *range;
+    unsigned long i;
+    dv_paddr_link_t *pl;
+    dv_paddr_link_t **ppl;
+    int len = 0;
+
+    ASSERT(paging_locked_by_me(d));
+    range = dirty_vram_range_find_gfn(d, gfn);
+    if ( !range )
+        return effective;
+
+    
+    i = gfn - range->begin_pfn;
+    pl = &range->pl_tab[ i ];
+    ppl = NULL;
+
+    /*
+     * find matching entry (pl), if any, and its predecessor
+     * in linked list (ppl)
+     */
+    while ( pl != NULL )
+    {
+        if ( pl->sl1ma == sl1ma || pl->sl1ma == INVALID_PADDR )
+            break;
+            
+        ppl = &pl->pl_next;
+        pl = *ppl;
+        len++;
+    }
+
+    if ( set )
+    {
+        /* Did we find sl1ma in either the main table or the linked list? */
+        if ( pl == NULL ) /* no, so we'll need to alloc a link */
+        {
+            ASSERT(ppl != NULL);
+            /*
+             * Have we reached the limit of mappings we're willing
+             * to bookkeep?
+             */
+            if (len > DV_ADDR_LINK_LIST_LIMIT) /* yes */
+                /*
+                 * The side effect of failing to record this mapping
+                 * is that we will not detect any changes to the frame
+                 * buffer made through the mapping so
+                 * areas of a monitor may not get refreshed.
+                 * In practice this should never happen.
+                 */
+                goto out;
+
+            /* alloc link and append it to list */
+            (*ppl) = pl = alloc_paddr_link(d);
+            if ( pl == NULL )
+                goto out;
+        }
+        if ( pl->sl1ma != sl1ma )
+        {
+            ASSERT(pl->sl1ma == INVALID_PADDR);
+            pl->sl1ma = sl1ma;
+            range->nr_mappings++;
+        }
+        effective = 1;
+        if ( len > range->mappings_hwm )
+        {
+            range->mappings_hwm = len;
+#if DEBUG_update_vram_mapping
+            gdprintk(XENLOG_DEBUG,
+                     "[%lx] set      sl1ma:%lx hwm:%d mappings:%d freepages:%d\n",
+                     gfn, sl1ma,
+                     range->mappings_hwm,
+                     range->nr_mappings,
+                     d->arch.paging.shadow.free_pages);
+#endif
+        }
+    }
+    else /* clear */
+    {
+        if ( pl && pl->sl1ma == sl1ma )
+        {
+#if DEBUG_update_vram_mapping
+            gdprintk(XENLOG_DEBUG,
+                     "[%lx] clear    sl1ma:%lx mappings:%d\n",
+                     gfn, sl1ma,
+                     range->nr_mappings - 1);
+#endif
+            free_paddr_link(d, ppl, pl);
+            if ( --range->nr_mappings == 0 )
+            {
+                dirty_vram_range_free(d, range);
+            }
+            effective = 1;
+        }
+    }
+ out:
+    return effective;
+}
+
+
+/*
+ * shadow_scan_dirty_flags()
+ * This produces a dirty bitmap for the range by examining every
+ * L1PTE referenced by some dv_paddr_link in the range's pl_tab table.
+ * It tests and clears each such L1PTE's dirty flag.
+ */
+static int shadow_scan_dirty_flags(struct domain *d,
+                                   dv_range_t *range,
+                                   uint8_t *dirty_bitmap)
+{
+    int flush_tlb = 0;
+    unsigned long i;
+    unsigned long nr = range->end_pfn - range->begin_pfn;
+
+    ASSERT( paging_locked_by_me(d) );
+    /* Iterate over VRAM to track dirty bits. */
+    for ( i = 0; i < nr; i++ )
+    {
+        int dirty = 0, len = 1;
+        dv_paddr_link_t *pl;
+        for ( pl = &range->pl_tab[i]; pl; pl = pl->pl_next, len++ )
+        {
+            l1_pgentry_t *sl1e;
+            paddr_t sl1ma = pl->sl1ma;
+            if (sl1ma == INVALID_PADDR) /* FB page is unmapped */
+                continue;
+            sl1e = maddr_to_virt(sl1ma);
+            if ( l1e_get_flags(*sl1e) & _PAGE_DIRTY )
+            {
+                dirty = 1;
+                /* Clear dirty so we can detect if page gets re-dirtied.
+                 * Note: this is atomic, so we may clear a
+                 * _PAGE_ACCESSED set by another processor.
+                 */
+                l1e_remove_flags(*sl1e, _PAGE_DIRTY);
+                flush_tlb = 1;
+            }
+        } /* for */
+        
+        if ( dirty )
+            dirty_bitmap[i >> 3] |= (1 << (i & 7));
+
+    }
+
+    return flush_tlb;
+}
+
+
+/*
+ * shadow_track_dirty_vram()
+ * This is the API called by the guest to determine which pages in the range
+ * from [begin_pfn:begin_pfn+nr) have been dirtied since the last call.
+ * It creates the domain's dv_dirty_vram on demand.
+ * It creates ranges on demand when some [begin_pfn:nr) is first encountered.
+ * To collect the dirty bitmask it calls shadow_scan_dirty_flags().
+ * It copies the dirty bitmask into guest storage.
+ */
+int shadow_track_dirty_vram(struct domain *d,
+                            unsigned long begin_pfn,
+                            unsigned long nr,
+                            XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
+{
+    int rc = 0;
+    unsigned long end_pfn = begin_pfn + nr;
+    int flush_tlb = 0;
+    dv_range_t *range;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+
+    /*
+     * This range test is tricky.
+     *
+     * The range [begin_pfn..end_pfn) is an open interval, so end_pfn is a pfn
+     * beyond the end of the range.
+     *
+     * p2m->max_mapped_pfn is a valid PFN so p2m->max_mapped_pfn + 1 is an
+     * invalid PFN.
+     *
+     * If end_pfn is beyond *that* then the range is invalid.
+     */
+    if ( end_pfn < begin_pfn
+         || begin_pfn > p2m->max_mapped_pfn
+         || end_pfn > p2m->max_mapped_pfn + 1 )
+        return -EINVAL;
+
+    paging_lock(d);
+
+    if (!nr)
+    {
+        dirty_vram_free(d);
+        goto out;
+    }
+
+    if ( guest_handle_is_null(guest_dirty_bitmap) )
+        goto out;
+
+    if ( !dirty_vram_find_or_alloc(d) )
+    {
+        rc = -ENOMEM;
+        goto out;
+    }
+
+    range = dirty_vram_range_find(d, begin_pfn, nr);
+    if ( !range )
+    {
+        range = dirty_vram_range_alloc(d, begin_pfn, nr);
+        if ( range )
+            sh_find_all_vram_mappings(d->vcpu[0], range);
+    }
+    if ( range )
+    {
+        int size = (nr + BITS_PER_LONG - 1) / BITS_PER_LONG;
+        unsigned long dirty_bitmap[size];
+
+        memset(dirty_bitmap, 0x00, size * BYTES_PER_LONG);
+
+	flush_tlb |= shadow_scan_dirty_flags(d, range, (uint8_t*)dirty_bitmap);
+
+        rc = -EFAULT;
+        if ( copy_to_guest(guest_dirty_bitmap,
+                           (uint8_t*)dirty_bitmap,
+                           size * BYTES_PER_LONG) == 0 )
+            rc = 0;
+    }
+    
+    if ( flush_tlb )
+        flush_tlb_mask(d->domain_dirty_cpumask);
+
+out:
+    paging_unlock(d);
+    return rc;
+}
+
+
+/************************************************/
+/*          HAP VRAM TRACKING SUPPORT           */
+/************************************************/
+
+/*
+ * hap_enable_vram_tracking()
+ * For all ranges, mark all vram pages in range as logdirty read-only.
+ */
+static int hap_enable_vram_tracking(struct domain *d)
+{
+    int rc = 0;
+    dv_dirty_vram_t *dirty_vram;
+    struct list_head *curr;
+
+    /* turn on PG_log_dirty bit in paging mode */
+    paging_lock(d);
+    d->arch.paging.mode |= PG_log_dirty;
+    paging_unlock(d);
+
+    p2m_lock(p2m_get_hostp2m(d));
+    paging_lock(d);
+
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+
+    /*
+     * dirty_vram != NULL iff we're tracking dirty vram.
+     * If we start tracking dirty pages for all memory then
+     * the dirty_vram structure is freed.
+     */
+    if ( !dirty_vram )
+    {
+        rc = -EINVAL;
+        goto out;
+    }
+
+    /* set l1e entries of P2M table to be read-only. */
+    list_for_each(curr, &dirty_vram->range_head)
+    {
+	dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+	gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] enable  vram tracking\n",
+		 range->begin_pfn, range->end_pfn);
+	p2m_change_type_range(d, range->begin_pfn, range->end_pfn,
+			      p2m_ram_rw, p2m_ram_logdirty);
+    }
+
+    flush_tlb_mask(d->domain_dirty_cpumask);
+ out:
+    paging_unlock(d);
+    p2m_unlock(p2m_get_hostp2m(d));
+    if ( rc )
+    {
+        paging_lock(d);
+        d->arch.paging.mode &= ~PG_log_dirty;
+        paging_unlock(d);
+    }
+    return rc;
+}
+
+/*
+ * hap_disable_vram_tracking()
+ * For all ranges, mark all vram pages in range as logdirty read-write.
+ */
+static int hap_disable_vram_tracking(struct domain *d)
+{
+    int rc = 0;
+    dv_dirty_vram_t *dirty_vram;
+    struct list_head *curr;
+
+    paging_lock(d);
+    d->arch.paging.mode &= ~PG_log_dirty;
+    paging_unlock(d);
+
+    p2m_lock(p2m_get_hostp2m(d));
+    paging_lock(d);
+
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+    if ( !dirty_vram )
+    {
+        rc = -EINVAL;
+        goto out;
+    }
+
+    /* set l1e entries of P2M table with normal mode */
+    list_for_each(curr, &dirty_vram->range_head)
+    {
+	dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+	gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] disable vram tracking\n",
+		 range->begin_pfn, range->end_pfn);
+	p2m_change_type_range(d, range->begin_pfn, range->end_pfn,
+			      p2m_ram_logdirty, p2m_ram_rw);
+    }
+    flush_tlb_mask(d->domain_dirty_cpumask);
+ out:
+    paging_unlock(d);
+    p2m_unlock(p2m_get_hostp2m(d));
+    if ( rc )
+    {
+        paging_lock(d);
+        d->arch.paging.mode |= PG_log_dirty;
+        paging_unlock(d);
+    }
+    return rc;
+}
+
+/*
+ * hap_clean_vram_tracking_range()
+ * For all the pages in the range specified by [begin_pfn,nr),
+ * note in the dirty bitmap any page that has been marked as read-write,
+ * which signifies that the page has been dirtied, and reset the page
+ * to ram_logdirty.
+ */
+void hap_clean_vram_tracking_range(struct domain *d,
+                                   unsigned long begin_pfn,
+                                   unsigned long nr,
+                                   uint8_t *dirty_bitmap)
+{
+    int i;
+    unsigned long pfn;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_range_t *range;
+
+    ASSERT(p2m_locked_by_me(p2m_get_hostp2m(d)));
+    ASSERT(paging_locked_by_me(d));
+
+    if ( !dirty_vram )
+    {
+        gdprintk(XENLOG_DEBUG,
+                 "Should only be called while tracking dirty vram.\n");
+        return;
+    }
+
+    range = dirty_vram_range_find(d, begin_pfn, nr);
+    if ( !range )
+        return;
+
+    /* set l1e entries of P2M table to be read-only. */
+    /*
+     * On first write, it page faults, its entry is changed to read-write,
+     * its bit in the dirty bitmap is set, and on retry the write succeeds.
+     */
+    for ( i = 0, pfn = range->begin_pfn; pfn < range->end_pfn; i++, pfn++ )
+    {
+        p2m_type_t pt;
+        pt = p2m_change_type(d, pfn, p2m_ram_rw, p2m_ram_logdirty);
+        if ( pt == p2m_ram_rw )
+            dirty_bitmap[i >> 3] |= (1 << (i & 7));
+    }
+    flush_tlb_mask(d->domain_dirty_cpumask);
+}
+
+static void hap_vram_tracking_init(struct domain *d)
+{
+    paging_log_dirty_init(d, hap_enable_vram_tracking,
+                          hap_disable_vram_tracking,
+                          NULL);
+}
+
+/*
+ * hap_track_dirty_vram()
+ * Create the domain's dv_dirty_vram struct on demand.
+ * Create a dirty vram range on demand when some [begin_pfn:begin_pfn+nr] is
+ * first encountered.
+ * Collect the guest_dirty bitmask, a bit mask of the dirty vram pages, by
+ * calling paging_log_dirty_range().
+ */
+int hap_track_dirty_vram(struct domain *d,
+                         unsigned long begin_pfn,
+                         unsigned long nr,
+                         XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
+{
+    long rc = 0;
+    dv_dirty_vram_t *dirty_vram;
+
+    paging_lock(d);
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+    if ( nr )
+    {
+        dv_range_t *range = NULL;
+        int size = ( nr + BITS_PER_LONG - 1 ) & ~( BITS_PER_LONG - 1 );
+        uint8_t dirty_bitmap[size];
+
+        /* Already tracking dirty vram? */
+        if ( paging_mode_log_dirty(d) && dirty_vram ) /* yes */
+        {
+            /* Handle the addition of another range */
+            range = dirty_vram_range_find(d, begin_pfn, nr);
+            if ( !range )
+            {
+                rc = -ENOMEM;
+                if ( !(range = dirty_vram_range_alloc(d, begin_pfn, nr)) )
+                    goto param_fail;
+            }
+        }
+        /* Just starting to track dirty vram? */
+        else if ( !paging_mode_log_dirty(d) && !dirty_vram ) /* yes */
+        {
+            rc = -ENOMEM;
+            if ( !(dirty_vram = dirty_vram_alloc(d)) )
+                goto param_fail;
+
+            if ( !(range = dirty_vram_range_find_or_alloc(d, begin_pfn, nr)) )
+                goto param_fail;
+
+            /* Initialize callbacks for vram tracking */
+            hap_vram_tracking_init(d);
+
+            /* Enable HAP vram tracking */
+            paging_unlock(d);
+            rc = paging_log_dirty_enable(d);
+            paging_lock(d);
+            
+            if ( rc != 0 )
+                goto param_fail;
+        }
+        else
+        {
+            /* Test for invalid combination */
+            if ( !paging_mode_log_dirty(d) && dirty_vram )
+                rc = -EINVAL;
+            else /* logging dirty of all memory, not tracking dirty vram */
+                rc = -ENODATA;
+            goto param_fail;
+        }
+
+        paging_unlock(d);
+        memset(dirty_bitmap, 0x00, size);
+	paging_log_dirty_range(d, begin_pfn, nr, dirty_bitmap);
+        rc = -EFAULT;
+        if ( copy_to_guest(guest_dirty_bitmap,
+                           dirty_bitmap,
+                           size) == 0 )
+        {
+            rc = 0;
+        }
+    }
+    else
+    {
+        /*
+         * If zero pages specified while already tracking dirty vram
+         * then stop tracking
+         */
+        if ( paging_mode_log_dirty(d) && dirty_vram )
+        {
+            /* Disable HAP vram tracking */
+            paging_unlock(d);
+            rc = paging_log_dirty_disable(d);
+            paging_lock(d);
+            
+            dirty_vram_free(d);
+        }
+        else /* benign no-op */
+        {
+            rc = 0;
+        }
+        paging_unlock(d);
+    }
+
+    return rc;
+
+param_fail:
+    dirty_vram_free(d);
+    paging_unlock(d);
+    return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index fd99cde..09cdba2 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -41,6 +41,7 @@
 #include <asm/domain.h>
 #include <xen/numa.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/dirty_vram.h>
 
 #include "private.h"
 
@@ -53,139 +54,6 @@
 #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
 
 /************************************************/
-/*          HAP VRAM TRACKING SUPPORT           */
-/************************************************/
-
-static int hap_enable_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return -EINVAL;
-
-    /* turn on PG_log_dirty bit in paging mode */
-    paging_lock(d);
-    d->arch.paging.mode |= PG_log_dirty;
-    paging_unlock(d);
-
-    /* set l1e entries of P2M table to be read-only. */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_rw, p2m_ram_logdirty);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-    return 0;
-}
-
-static int hap_disable_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return -EINVAL;
-
-    paging_lock(d);
-    d->arch.paging.mode &= ~PG_log_dirty;
-    paging_unlock(d);
-
-    /* set l1e entries of P2M table with normal mode */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_logdirty, p2m_ram_rw);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-    return 0;
-}
-
-static void hap_clean_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return;
-
-    /* set l1e entries of P2M table to be read-only. */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_rw, p2m_ram_logdirty);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-}
-
-static void hap_vram_tracking_init(struct domain *d)
-{
-    paging_log_dirty_init(d, hap_enable_vram_tracking,
-                          hap_disable_vram_tracking,
-                          hap_clean_vram_tracking);
-}
-
-int hap_track_dirty_vram(struct domain *d,
-                         unsigned long begin_pfn,
-                         unsigned long nr,
-                         XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
-{
-    long rc = 0;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( nr )
-    {
-        if ( paging_mode_log_dirty(d) && dirty_vram )
-        {
-            if ( begin_pfn != dirty_vram->begin_pfn ||
-                 begin_pfn + nr != dirty_vram->end_pfn )
-            {
-                paging_log_dirty_disable(d);
-                dirty_vram->begin_pfn = begin_pfn;
-                dirty_vram->end_pfn = begin_pfn + nr;
-                rc = paging_log_dirty_enable(d);
-                if (rc != 0)
-                    goto param_fail;
-            }
-        }
-        else if ( !paging_mode_log_dirty(d) && !dirty_vram )
-        {
-            rc = -ENOMEM;
-            if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL )
-                goto param_fail;
-
-            dirty_vram->begin_pfn = begin_pfn;
-            dirty_vram->end_pfn = begin_pfn + nr;
-            d->arch.hvm_domain.dirty_vram = dirty_vram;
-            hap_vram_tracking_init(d);
-            rc = paging_log_dirty_enable(d);
-            if (rc != 0)
-                goto param_fail;
-        }
-        else
-        {
-            if ( !paging_mode_log_dirty(d) && dirty_vram )
-                rc = -EINVAL;
-            else
-                rc = -ENODATA;
-            goto param_fail;
-        }
-        /* get the bitmap */
-        rc = paging_log_dirty_range(d, begin_pfn, nr, dirty_bitmap);
-    }
-    else
-    {
-        if ( paging_mode_log_dirty(d) && dirty_vram ) {
-            rc = paging_log_dirty_disable(d);
-            xfree(dirty_vram);
-            dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-        } else
-            rc = 0;
-    }
-
-    return rc;
-
-param_fail:
-    if ( dirty_vram )
-    {
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-    }
-    return rc;
-}
-
-/************************************************/
 /*            HAP LOG DIRTY SUPPORT             */
 /************************************************/
 
@@ -223,14 +91,12 @@ static void hap_clean_dirty_bitmap(struct domain *d)
 
 void hap_logdirty_init(struct domain *d)
 {
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    struct dv_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
     if ( paging_mode_log_dirty(d) && dirty_vram )
     {
         paging_log_dirty_disable(d);
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
+        dirty_vram_free(d);
     }
-
     /* Reinitialize logdirty mechanism */
     paging_log_dirty_init(d, hap_enable_log_dirty,
                           hap_disable_log_dirty,
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index ea44e39..5e76609 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -27,6 +27,7 @@
 #include <asm/p2m.h>
 #include <asm/hap.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/dirty_vram.h>
 #include <xen/numa.h>
 #include <xsm/xsm.h>
 
@@ -278,6 +279,46 @@ out:
 }
 
 
+/* paging_mark_dirty_hap()
+ * Make a hap page writeable and mark it as dirty.
+ * This done atomically under the p2m and paging locks to avoid leaving
+ * a window where the page might be modified without being counted as dirty.
+ */
+void paging_mark_dirty_hap(struct domain *d,
+                           unsigned long pfn,
+                           unsigned long guest_mfn)
+{
+    mfn_t gmfn;
+    p2m_type_t pt;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    
+    if ( !paging_mode_log_dirty(d) )
+        return;
+
+    gmfn = _mfn(guest_mfn);
+
+    ASSERT( mfn_valid(gmfn) &&
+            page_get_owner(mfn_to_page(gmfn)) == d );
+
+    p2m_lock(p2m);
+    pt = p2m_change_type(d, pfn, p2m_ram_logdirty, p2m_ram_rw);
+    paging_lock(d);
+    if ( pt == p2m_ram_logdirty )
+    {
+        dv_range_t *range;
+        PAGING_DEBUG(LOGDIRTY,
+                     "marked mfn %" PRI_mfn " (pfn=%lx), dom %d\n",
+                     mfn_x(gmfn), pfn, d->domain_id);
+        d->arch.paging.log_dirty.dirty_count++;
+        range = dirty_vram_range_find_gfn(d, pfn);
+        if ( range )
+            range->dirty_count++;
+    }
+    paging_mark_dirty(d, guest_mfn); 
+    paging_unlock(d);
+    p2m_unlock(p2m);
+}
+
 /* Is this guest page dirty? */
 int paging_mfn_is_dirty(struct domain *d, mfn_t gmfn)
 {
@@ -333,8 +374,11 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
     mfn_t *l4, *l3, *l2;
     unsigned long *l1;
     int i4, i3, i2;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
 
     domain_pause(d);
+    /* Locking hierarchy requires p2m lock to be taken first */
+    p2m_lock(p2m);
     paging_lock(d);
 
     clean = (sc->op == XEN_DOMCTL_SHADOW_OP_CLEAN);
@@ -345,6 +389,14 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
                  d->arch.paging.log_dirty.fault_count,
                  d->arch.paging.log_dirty.dirty_count);
 
+    if ( hap_enabled(d) && d->arch.hvm_domain.dirty_vram )
+    {
+        /* If we're cleaning/peeking all guest memory, we should not be tracking
+         * dirty vram. */
+        rv = -EINVAL;
+        goto out;
+    }
+
     sc->stats.fault_count = d->arch.paging.log_dirty.fault_count;
     sc->stats.dirty_count = d->arch.paging.log_dirty.dirty_count;
 
@@ -424,170 +476,64 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
 
     if ( clean )
     {
-        /* We need to further call clean_dirty_bitmap() functions of specific
-         * paging modes (shadow or hap).  Safe because the domain is paused. */
-        d->arch.paging.log_dirty.clean_dirty_bitmap(d);
+        /* Is null if tracking dirty vram */
+        if ( d->arch.paging.log_dirty.clean_dirty_bitmap )
+        {
+            /*
+             * We need to call clean_dirty_bitmap() functions of specific
+             * paging modes (shadow or hap).
+             * Safe because the domain is paused.
+             */
+            d->arch.paging.log_dirty.clean_dirty_bitmap(d);
+        }
     }
     domain_unpause(d);
     return rv;
 
  out:
     paging_unlock(d);
+    p2m_unlock(p2m);
     domain_unpause(d);
     return rv;
 }
 
-int paging_log_dirty_range(struct domain *d,
-                            unsigned long begin_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
+void paging_log_dirty_range(struct domain *d,
+                           unsigned long begin_pfn,
+                           unsigned long nr,
+                           uint8_t *dirty_bitmap)
 {
-    int rv = 0;
-    unsigned long pages = 0;
-    mfn_t *l4, *l3, *l2;
-    unsigned long *l1;
-    int b1, b2, b3, b4;
-    int i2, i3, i4;
-
-    d->arch.paging.log_dirty.clean_dirty_bitmap(d);
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    dv_range_t *range;
+    unsigned int range_dirty_count = 0;
+    
+    p2m_lock(p2m);
     paging_lock(d);
 
-    PAGING_DEBUG(LOGDIRTY, "log-dirty-range: dom %u faults=%u dirty=%u\n",
-                 d->domain_id,
-                 d->arch.paging.log_dirty.fault_count,
-                 d->arch.paging.log_dirty.dirty_count);
-
-    if ( unlikely(d->arch.paging.log_dirty.failed_allocs) ) {
-        printk("%s: %d failed page allocs while logging dirty pages\n",
-               __FUNCTION__, d->arch.paging.log_dirty.failed_allocs);
-        rv = -ENOMEM;
-        goto out;
-    }
-
-    if ( !d->arch.paging.log_dirty.fault_count &&
-         !d->arch.paging.log_dirty.dirty_count ) {
-        unsigned int size = BITS_TO_LONGS(nr);
-
-        if ( clear_guest(dirty_bitmap, size * BYTES_PER_LONG) != 0 )
-            rv = -EFAULT;
-        goto out;
-    }
-    d->arch.paging.log_dirty.fault_count = 0;
-    d->arch.paging.log_dirty.dirty_count = 0;
-
-    b1 = L1_LOGDIRTY_IDX(begin_pfn);
-    b2 = L2_LOGDIRTY_IDX(begin_pfn);
-    b3 = L3_LOGDIRTY_IDX(begin_pfn);
-    b4 = L4_LOGDIRTY_IDX(begin_pfn);
-    l4 = paging_map_log_dirty_bitmap(d);
-
-    for ( i4 = b4;
-          (pages < nr) && (i4 < LOGDIRTY_NODE_ENTRIES);
-          i4++ )
+    /* Only called when tracking dirty vram in HAP mode */
+    ASSERT(hap_enabled(d) && d->arch.hvm_domain.dirty_vram);
+    
+    range = dirty_vram_range_find_gfn(d, begin_pfn);
+    if ( range )
     {
-        l3 = (l4 && mfn_valid(l4[i4])) ? map_domain_page(mfn_x(l4[i4])) : NULL;
-        for ( i3 = b3;
-              (pages < nr) && (i3 < LOGDIRTY_NODE_ENTRIES);
-              i3++ )
-        {
-            l2 = ((l3 && mfn_valid(l3[i3])) ?
-                  map_domain_page(mfn_x(l3[i3])) : NULL);
-            for ( i2 = b2;
-                  (pages < nr) && (i2 < LOGDIRTY_NODE_ENTRIES);
-                  i2++ )
-            {
-                unsigned int bytes = PAGE_SIZE;
-                uint8_t *s;
-                l1 = ((l2 && mfn_valid(l2[i2])) ?
-                      map_domain_page(mfn_x(l2[i2])) : NULL);
-
-                s = ((uint8_t*)l1) + (b1 >> 3);
-                bytes -= b1 >> 3;
-
-                if ( likely(((nr - pages + 7) >> 3) < bytes) )
-                    bytes = (unsigned int)((nr - pages + 7) >> 3);
-
-                if ( !l1 )
-                {
-                    if ( clear_guest_offset(dirty_bitmap, pages >> 3,
-                                            bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-                /* begin_pfn is not 32K aligned, hence we have to bit
-                 * shift the bitmap */
-                else if ( b1 & 0x7 )
-                {
-                    int i, j;
-                    uint32_t *l = (uint32_t*) s;
-                    int bits = b1 & 0x7;
-                    int bitmask = (1 << bits) - 1;
-                    int size = (bytes + BYTES_PER_LONG - 1) / BYTES_PER_LONG;
-                    unsigned long bitmap[size];
-                    static unsigned long printed = 0;
-
-                    if ( printed != begin_pfn )
-                    {
-                        dprintk(XENLOG_DEBUG, "%s: begin_pfn %lx is not 32K aligned!\n",
-                                __FUNCTION__, begin_pfn);
-                        printed = begin_pfn;
-                    }
-
-                    for ( i = 0; i < size - 1; i++, l++ ) {
-                        bitmap[i] = ((*l) >> bits) |
-                            (((*((uint8_t*)(l + 1))) & bitmask) << (sizeof(*l) * 8 - bits));
-                    }
-                    s = (uint8_t*) l;
-                    size = BYTES_PER_LONG - ((b1 >> 3) & 0x3);
-                    bitmap[i] = 0;
-                    for ( j = 0; j < size; j++, s++ )
-                        bitmap[i] |= (*s) << (j * 8);
-                    bitmap[i] = (bitmap[i] >> bits) | (bitmask << (size * 8 - bits));
-                    if ( copy_to_guest_offset(dirty_bitmap, (pages >> 3),
-                                (uint8_t*) bitmap, bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-                else
-                {
-                    if ( copy_to_guest_offset(dirty_bitmap, pages >> 3,
-                                              s, bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-
-                pages += bytes << 3;
-                if ( l1 )
-                {
-                    clear_page(l1);
-                    unmap_domain_page(l1);
-                }
-                b1 = b1 & 0x7;
-            }
-            b2 = 0;
-            if ( l2 )
-                unmap_domain_page(l2);
-        }
-        b3 = 0;
-        if ( l3 )
-            unmap_domain_page(l3);
+        range_dirty_count = range->dirty_count;
+        range->dirty_count = 0;
     }
-    if ( l4 )
-        unmap_domain_page(l4);
-
-    paging_unlock(d);
+    
+    if ( !range_dirty_count)
+        goto out;
 
-    return rv;
+    PAGING_DEBUG(LOGDIRTY,
+                 "log-dirty-range: dom %u [%05lx:%05lx] range_dirty=%u\n",
+                 d->domain_id,
+                 begin_pfn,
+                 range->end_pfn,
+                 range_dirty_count);
 
+    hap_clean_vram_tracking_range(d, begin_pfn, nr, dirty_bitmap);
  out:
     paging_unlock(d);
-    return rv;
+    p2m_unlock(p2m);
+    return;
 }
 
 /* Note that this function takes three function pointers. Callers must supply
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index ce79131..4e40f43 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -36,6 +36,7 @@
 #include <asm/current.h>
 #include <asm/flushtlb.h>
 #include <asm/shadow.h>
+#include <asm/dirty_vram.h>
 #include <xen/numa.h>
 #include "private.h"
 
@@ -3121,12 +3122,7 @@ void shadow_teardown(struct domain *d)
      * calls now that we've torn down the bitmap */
     d->arch.paging.mode &= ~PG_log_dirty;
 
-    if (d->arch.hvm_domain.dirty_vram) {
-        xfree(d->arch.hvm_domain.dirty_vram->sl1ma);
-        xfree(d->arch.hvm_domain.dirty_vram->dirty_bitmap);
-        xfree(d->arch.hvm_domain.dirty_vram);
-        d->arch.hvm_domain.dirty_vram = NULL;
-    }
+    dirty_vram_free(d);
 
     paging_unlock(d);
 
@@ -3463,179 +3459,212 @@ void shadow_clean_dirty_bitmap(struct domain *d)
 
 
 /**************************************************************************/
-/* VRAM dirty tracking support */
-int shadow_track_dirty_vram(struct domain *d,
-                            unsigned long begin_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
-{
-    int rc;
-    unsigned long end_pfn = begin_pfn + nr;
-    unsigned long dirty_size = (nr + 7) / 8;
-    int flush_tlb = 0;
-    unsigned long i;
-    p2m_type_t t;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-    struct p2m_domain *p2m = p2m_get_hostp2m(d);
-
-    if (end_pfn < begin_pfn
-            || begin_pfn > p2m->max_mapped_pfn
-            || end_pfn >= p2m->max_mapped_pfn)
-        return -EINVAL;
-
-    /* We perform p2m lookups, so lock the p2m upfront to avoid deadlock */
-    p2m_lock(p2m_get_hostp2m(d));
-    paging_lock(d);
+/* Support functions for shadow-based dirty VRAM code */
 
-    if ( dirty_vram && (!nr ||
-             ( begin_pfn != dirty_vram->begin_pfn
-            || end_pfn   != dirty_vram->end_pfn )) )
-    {
-        /* Different tracking, tear the previous down. */
-        gdprintk(XENLOG_INFO, "stopping tracking VRAM %lx - %lx\n", dirty_vram->begin_pfn, dirty_vram->end_pfn);
-        xfree(dirty_vram->sl1ma);
-        xfree(dirty_vram->dirty_bitmap);
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-    }
+#define DEBUG_unshadow_sl1ma                  0          
+#define DEBUG_unshadow_sl1ma_detail           0
+#define DEBUG_count_initial_mappings          1
 
-    if ( !nr )
+/* smfn is no longer a shadow page.  Remove it from any
+ * dirty vram range mapping. */
+void
+dirty_vram_delete_shadow(struct vcpu *v,
+                         unsigned long gfn,
+                         unsigned int shadow_type, 
+                         mfn_t smfn)
+{
+    static unsigned int l1_shadow_mask = 
+          1 << SH_type_l1_32_shadow
+        | 1 << SH_type_fl1_32_shadow
+        | 1 << SH_type_l1_pae_shadow
+        | 1 << SH_type_fl1_pae_shadow
+        | 1 << SH_type_l1_64_shadow
+        | 1 << SH_type_fl1_64_shadow
+        ;
+    struct domain *d = v->domain;
+    dv_dirty_vram_t *dirty_vram;
+    struct list_head *curr, *next;
+    
+    ASSERT(paging_locked_by_me(d));
+    /* Ignore all but level 1 shadows */
+    
+    if ( (l1_shadow_mask & (1 << shadow_type)) == 0 )
     {
-        rc = 0;
         goto out;
     }
 
-    /* This should happen seldomly (Video mode change),
-     * no need to be careful. */
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
     if ( !dirty_vram )
     {
-        /* Throw away all the shadows rather than walking through them 
-         * up to nr times getting rid of mappings of each pfn */
-        shadow_blow_tables(d);
-
-        gdprintk(XENLOG_INFO, "tracking VRAM %lx - %lx\n", begin_pfn, end_pfn);
-
-        rc = -ENOMEM;
-        if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL )
-            goto out;
-        dirty_vram->begin_pfn = begin_pfn;
-        dirty_vram->end_pfn = end_pfn;
-        d->arch.hvm_domain.dirty_vram = dirty_vram;
-
-        if ( (dirty_vram->sl1ma = xmalloc_array(paddr_t, nr)) == NULL )
-            goto out_dirty_vram;
-        memset(dirty_vram->sl1ma, ~0, sizeof(paddr_t) * nr);
-
-        if ( (dirty_vram->dirty_bitmap = xzalloc_array(uint8_t, dirty_size)) == NULL )
-            goto out_sl1ma;
-
-        dirty_vram->last_dirty = NOW();
-
-        /* Tell the caller that this time we could not track dirty bits. */
-        rc = -ENODATA;
-    }
-    else if (dirty_vram->last_dirty == -1)
-    {
-        /* still completely clean, just copy our empty bitmap */
-        rc = -EFAULT;
-        if ( copy_to_guest(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size) == 0 )
-            rc = 0;
+        goto out;
     }
-    else
+        
+    list_for_each_safe(curr, next, &dirty_vram->range_head)
     {
-        /* Iterate over VRAM to track dirty bits. */
-        for ( i = 0; i < nr; i++ ) {
-            mfn_t mfn = get_gfn_query_unlocked(d, begin_pfn + i, &t);
-            struct page_info *page;
-            int dirty = 0;
-            paddr_t sl1ma = dirty_vram->sl1ma[i];
-
-            if (mfn_x(mfn) == INVALID_MFN)
-            {
-                dirty = 1;
-            }
-            else
+        dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+        unsigned long i;
+        int max_mappings = 1, mappings = 0;
+        int unshadowed = 0;
+        for ( i = 0; i != range->end_pfn - range->begin_pfn; i++ )
+        {
+            dv_paddr_link_t *pl = &range->pl_tab[ i ];
+            dv_paddr_link_t **ppl = NULL;
+            mappings = 0;
+            
+            while ( pl != NULL )
             {
-                page = mfn_to_page(mfn);
-                switch (page->u.inuse.type_info & PGT_count_mask)
-                {
-                case 0:
-                    /* No guest reference, nothing to track. */
-                    break;
-                case 1:
-                    /* One guest reference. */
-                    if ( sl1ma == INVALID_PADDR )
-                    {
-                        /* We don't know which sl1e points to this, too bad. */
-                        dirty = 1;
-                        /* TODO: Heuristics for finding the single mapping of
-                         * this gmfn */
-                        flush_tlb |= sh_remove_all_mappings(d->vcpu[0], mfn);
-                    }
-                    else
-                    {
-                        /* Hopefully the most common case: only one mapping,
-                         * whose dirty bit we can use. */
-                        l1_pgentry_t *sl1e = maddr_to_virt(sl1ma);
-
-                        if ( l1e_get_flags(*sl1e) & _PAGE_DIRTY )
-                        {
-                            dirty = 1;
-                            /* Note: this is atomic, so we may clear a
-                             * _PAGE_ACCESSED set by another processor. */
-                            l1e_remove_flags(*sl1e, _PAGE_DIRTY);
-                            flush_tlb = 1;
-                        }
-                    }
-                    break;
-                default:
-                    /* More than one guest reference,
-                     * we don't afford tracking that. */
-                    dirty = 1;
+                paddr_t sl1ma = pl->sl1ma;
+                unsigned long sl1mn;
+                
+                if ( sl1ma == INVALID_PADDR )
                     break;
+                
+                sl1mn = sl1ma >> PAGE_SHIFT;
+                if ( sl1mn == mfn_x(smfn) ) {
+#if DEBUG_unshadow_sl1ma_detail
+                    gdprintk(XENLOG_DEBUG,
+                             "[%lx] gfn[%lx] unshadow sl1ma:%lx\n",
+                             mfn_x(smfn),
+                             range->begin_pfn + i,
+                             sl1ma);
+#endif
+                    unshadowed++;
+                    pl = free_paddr_link(d, ppl, pl);
+                    --range->nr_mappings;
+                }
+                else
+                {
+                    ppl = &pl->pl_next;
+                    pl = *ppl;
+                    mappings++;
                 }
             }
-
-            if ( dirty )
+        }
+        if ( mappings > max_mappings )
+            max_mappings = mappings;
+        
+        if ( unshadowed ) {
+#if DEBUG_unshadow_sl1ma
+            gdprintk(XENLOG_DEBUG,
+                     "[%lx] gfn[%05lx:%05lx] unshadowed:%d mappings:0x%x max_mappings:%d\n",
+                     mfn_x(smfn),
+                     range->begin_pfn, range->end_pfn,
+                     unshadowed, range->nr_mappings, max_mappings);
+#endif
+            if ( range->nr_mappings == 0 )
             {
-                dirty_vram->dirty_bitmap[i / 8] |= 1 << (i % 8);
-                dirty_vram->last_dirty = NOW();
+                dirty_vram_range_free(d, range);                    
             }
         }
+    }
+ out:
+    return;
+}
+
+
+typedef int (*hash_pfn_callback_t)(struct vcpu *v,
+                                   mfn_t smfn,
+                                   unsigned long begin_pfn,
+                                   unsigned long end_pfn,
+                                   int *removed);
+
+static int hash_pfn_foreach(struct vcpu *v, 
+                            unsigned int callback_mask, 
+                            hash_pfn_callback_t callbacks[], 
+                            unsigned long begin_pfn,
+                            unsigned long end_pfn)
+/* Walk the hash table looking at the types of the entries and 
+ * calling the appropriate callback function for each entry. 
+ * The mask determines which shadow types we call back for, and the array
+ * of callbacks tells us which function to call.
+ * Any callback may return non-zero to let us skip the rest of the scan. 
+ *
+ * WARNING: Callbacks MUST NOT add or remove hash entries unless they 
+ * then return non-zero to terminate the scan. */
+{
+    int i, done = 0, removed = 0;
+    struct domain *d = v->domain;
+    struct page_info *x;
+
+    /* Say we're here, to stop hash-lookups reordering the chains */
+    ASSERT(paging_locked_by_me(d));
+    ASSERT(d->arch.paging.shadow.hash_walking == 0);
+    d->arch.paging.shadow.hash_walking = 1;
 
-        rc = -EFAULT;
-        if ( copy_to_guest(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size) == 0 ) {
-            memset(dirty_vram->dirty_bitmap, 0, dirty_size);
-            if (dirty_vram->last_dirty + SECONDS(2) < NOW())
+    for ( i = 0; i < SHADOW_HASH_BUCKETS; i++ ) 
+    {
+        /* WARNING: This is not safe against changes to the hash table.
+         * The callback *must* return non-zero if it has inserted or
+         * deleted anything from the hash (lookups are OK, though). */
+        for ( x = d->arch.paging.shadow.hash_table[i]; x; x = next_shadow(x) )
+        {
+            if ( callback_mask & (1 << x->u.sh.type) )
             {
-                /* was clean for more than two seconds, try to disable guest
-                 * write access */
-                for ( i = begin_pfn; i < end_pfn; i++ ) {
-                    mfn_t mfn = get_gfn_query_unlocked(d, i, &t);
-                    if (mfn_x(mfn) != INVALID_MFN)
-                        flush_tlb |= sh_remove_write_access(d->vcpu[0], mfn, 1, 0);
-                }
-                dirty_vram->last_dirty = -1;
+                ASSERT(x->u.sh.type <= 15);
+                ASSERT(callbacks[x->u.sh.type] != NULL);
+                done = callbacks[x->u.sh.type](v, page_to_mfn(x), 
+                                               begin_pfn, end_pfn,
+                                               &removed);
+                if ( done ) break;
             }
-            rc = 0;
         }
+        if ( done ) break; 
     }
-    if ( flush_tlb )
-        flush_tlb_mask(d->domain_dirty_cpumask);
-    goto out;
+    d->arch.paging.shadow.hash_walking = 0;
+    return removed;
+}
 
-out_sl1ma:
-    xfree(dirty_vram->sl1ma);
-out_dirty_vram:
-    xfree(dirty_vram);
-    dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
+void sh_find_all_vram_mappings(struct vcpu *v,
+                               dv_range_t *range)
+{
+    /* Dispatch table for getting per-type functions */
+    static hash_pfn_callback_t callbacks[SH_type_unused] = {
+        NULL, /* none    */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 2), /* l1_32   */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 2), /* fl1_32  */
+        NULL, /* l2_32   */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 3), /* l1_pae  */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 3), /* fl1_pae */
+        NULL, /* l2_pae  */
+        NULL, /* l2h_pae */
+#if CONFIG_PAGING_LEVELS >= 4
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 4), /* l1_64   */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 4), /* fl1_64  */
+#else
+        NULL, /* l1_64   */
+        NULL, /* fl1_64  */
+#endif
+        NULL, /* l2_64   */
+        NULL, /* l2h_64  */
+        NULL, /* l3_64   */
+        NULL, /* l4_64   */
+        NULL, /* p2m     */
+        NULL  /* unused  */
+    };
 
-out:
-    paging_unlock(d);
-    p2m_unlock(p2m_get_hostp2m(d));
-    return rc;
+    static unsigned int callback_mask = 
+          1 << SH_type_l1_32_shadow
+        | 1 << SH_type_fl1_32_shadow
+        | 1 << SH_type_l1_pae_shadow
+        | 1 << SH_type_fl1_pae_shadow
+        | 1 << SH_type_l1_64_shadow
+        | 1 << SH_type_fl1_64_shadow
+        ;
+
+    perfc_incr(shadow_mappings);
+
+    hash_pfn_foreach(v, callback_mask, callbacks,
+                     range->begin_pfn,
+                     range->end_pfn);
+
+#if DEBUG_count_initial_mappings
+    gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] count of initial mappings:%d\n",
+             range->begin_pfn, range->end_pfn,
+             range->nr_mappings);
+#endif
 }
 
+
 /**************************************************************************/
 /* Shadow-control XEN_DOMCTL dispatcher */
 
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index b0e6d72..9c00574 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -35,6 +35,7 @@
 #include <asm/flushtlb.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/cacheattr.h>
+#include <asm/dirty_vram.h>
 #include <asm/mtrr.h>
 #include <asm/guest_pt.h>
 #include <public/sched.h>
@@ -149,6 +150,10 @@ delete_fl1_shadow_status(struct vcpu *v, gfn_t gfn, mfn_t smfn)
     SHADOW_PRINTK("gfn=%"SH_PRI_gfn", type=%08x, smfn=%05lx\n",
                    gfn_x(gfn), SH_type_fl1_shadow, mfn_x(smfn));
     ASSERT(mfn_to_page(smfn)->u.sh.head);
+
+    /* Removing any dv_paddr_links to the erstwhile shadow page */
+    dirty_vram_delete_shadow(v, gfn_x(gfn), SH_type_fl1_shadow, smfn);
+    
     shadow_hash_delete(v, gfn_x(gfn), SH_type_fl1_shadow, smfn);
 }
 
@@ -160,6 +165,10 @@ delete_shadow_status(struct vcpu *v, mfn_t gmfn, u32 shadow_type, mfn_t smfn)
                    v->domain->domain_id, v->vcpu_id,
                    mfn_x(gmfn), shadow_type, mfn_x(smfn));
     ASSERT(mfn_to_page(smfn)->u.sh.head);
+    
+    /* Removing any dv_paddr_links to the erstwhile shadow page */
+    dirty_vram_delete_shadow(v, mfn_x(gmfn), shadow_type, smfn);
+    
     shadow_hash_delete(v, mfn_x(gmfn), shadow_type, smfn);
     /* 32-on-64 PV guests don't own their l4 pages; see set_shadow_status */
     if ( !is_pv_32on64_vcpu(v) || shadow_type != SH_type_l4_64_shadow )
@@ -516,7 +525,6 @@ _sh_propagate(struct vcpu *v,
     guest_l1e_t guest_entry = { guest_intpte };
     shadow_l1e_t *sp = shadow_entry_ptr;
     struct domain *d = v->domain;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
     gfn_t target_gfn = guest_l1e_get_gfn(guest_entry);
     u32 pass_thru_flags;
     u32 gflags, sflags;
@@ -663,17 +671,6 @@ _sh_propagate(struct vcpu *v,
         }
     }
 
-    if ( unlikely((level == 1) && dirty_vram
-            && dirty_vram->last_dirty == -1
-            && gfn_x(target_gfn) >= dirty_vram->begin_pfn
-            && gfn_x(target_gfn) < dirty_vram->end_pfn) )
-    {
-        if ( ft & FETCH_TYPE_WRITE )
-            dirty_vram->last_dirty = NOW();
-        else
-            sflags &= ~_PAGE_RW;
-    }
-
     /* Read-only memory */
     if ( p2m_is_readonly(p2mt) ||
          (p2mt == p2m_mmio_direct &&
@@ -1072,101 +1069,60 @@ static int shadow_set_l2e(struct vcpu *v,
     return flags;
 }
 
-static inline void shadow_vram_get_l1e(shadow_l1e_t new_sl1e,
+/* shadow_vram_fix_l1e()
+ *
+ * Tests L1PTEs as they are modified, looking for when they start to
+ * (or cease to) point to frame buffer pages.  If the old and new gfns differ,
+ * calls dirty_vram_range_update() to updates the dirty_vram structures.
+ */
+static inline void shadow_vram_fix_l1e(shadow_l1e_t old_sl1e,
+                                       shadow_l1e_t new_sl1e,
                                        shadow_l1e_t *sl1e,
                                        mfn_t sl1mfn,
                                        struct domain *d)
 { 
-    mfn_t mfn = shadow_l1e_get_mfn(new_sl1e);
-    int flags = shadow_l1e_get_flags(new_sl1e);
-    unsigned long gfn;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    mfn_t new_mfn, old_mfn;
+    unsigned long new_gfn = INVALID_M2P_ENTRY, old_gfn = INVALID_M2P_ENTRY;
+    paddr_t sl1ma;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
 
-    if ( !dirty_vram         /* tracking disabled? */
-         || !(flags & _PAGE_RW) /* read-only mapping? */
-         || !mfn_valid(mfn) )   /* mfn can be invalid in mmio_direct */
+    if ( !dirty_vram )
         return;
 
-    gfn = mfn_to_gfn(d, mfn);
-    /* Page sharing not supported on shadow PTs */
-    BUG_ON(SHARED_M2P(gfn));
+    sl1ma = pfn_to_paddr(mfn_x(sl1mfn)) | ((unsigned long)sl1e & ~PAGE_MASK);
 
-    if ( (gfn >= dirty_vram->begin_pfn) && (gfn < dirty_vram->end_pfn) )
+    old_mfn = shadow_l1e_get_mfn(old_sl1e);
+
+    if ( !sh_l1e_is_magic(old_sl1e) &&
+         (l1e_get_flags(old_sl1e) & _PAGE_PRESENT) &&
+         mfn_valid(old_mfn))
     {
-        unsigned long i = gfn - dirty_vram->begin_pfn;
-        struct page_info *page = mfn_to_page(mfn);
-        
-        if ( (page->u.inuse.type_info & PGT_count_mask) == 1 )
-            /* Initial guest reference, record it */
-            dirty_vram->sl1ma[i] = pfn_to_paddr(mfn_x(sl1mfn))
-                | ((unsigned long)sl1e & ~PAGE_MASK);
+        old_gfn = mfn_to_gfn(d, old_mfn);
     }
-}
-
-static inline void shadow_vram_put_l1e(shadow_l1e_t old_sl1e,
-                                       shadow_l1e_t *sl1e,
-                                       mfn_t sl1mfn,
-                                       struct domain *d)
-{
-    mfn_t mfn = shadow_l1e_get_mfn(old_sl1e);
-    int flags = shadow_l1e_get_flags(old_sl1e);
-    unsigned long gfn;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram         /* tracking disabled? */
-         || !(flags & _PAGE_RW) /* read-only mapping? */
-         || !mfn_valid(mfn) )   /* mfn can be invalid in mmio_direct */
-        return;
-
-    gfn = mfn_to_gfn(d, mfn);
-    /* Page sharing not supported on shadow PTs */
-    BUG_ON(SHARED_M2P(gfn));
-
-    if ( (gfn >= dirty_vram->begin_pfn) && (gfn < dirty_vram->end_pfn) )
+    
+    new_mfn = shadow_l1e_get_mfn(new_sl1e);
+    if ( !sh_l1e_is_magic(new_sl1e) &&
+         (l1e_get_flags(new_sl1e) & _PAGE_PRESENT) &&
+         mfn_valid(new_mfn))
     {
-        unsigned long i = gfn - dirty_vram->begin_pfn;
-        struct page_info *page = mfn_to_page(mfn);
-        int dirty = 0;
-        paddr_t sl1ma = pfn_to_paddr(mfn_x(sl1mfn))
-            | ((unsigned long)sl1e & ~PAGE_MASK);
+        new_gfn = mfn_to_gfn(d, new_mfn);
+    }
 
-        if ( (page->u.inuse.type_info & PGT_count_mask) == 1 )
-        {
-            /* Last reference */
-            if ( dirty_vram->sl1ma[i] == INVALID_PADDR ) {
-                /* We didn't know it was that one, let's say it is dirty */
-                dirty = 1;
-            }
-            else
-            {
-                ASSERT(dirty_vram->sl1ma[i] == sl1ma);
-                dirty_vram->sl1ma[i] = INVALID_PADDR;
-                if ( flags & _PAGE_DIRTY )
-                    dirty = 1;
-            }
-        }
-        else
+    if ( old_gfn == new_gfn ) return;
+
+    if ( VALID_M2P(old_gfn) )
+        if ( dirty_vram_range_update(d, old_gfn, sl1ma, 0/*clear*/) )
         {
-            /* We had more than one reference, just consider the page dirty. */
-            dirty = 1;
-            /* Check that it's not the one we recorded. */
-            if ( dirty_vram->sl1ma[i] == sl1ma )
-            {
-                /* Too bad, we remembered the wrong one... */
-                dirty_vram->sl1ma[i] = INVALID_PADDR;
-            }
-            else
-            {
-                /* Ok, our recorded sl1e is still pointing to this page, let's
-                 * just hope it will remain. */
-            }
+            SHADOW_PRINTK("gfn %lx (mfn %lx) cleared vram pte\n",
+                          old_gfn, mfn_x(old_mfn));
         }
-        if ( dirty )
+
+    if ( VALID_M2P(new_gfn) )
+        if ( dirty_vram_range_update(d, new_gfn, sl1ma, 1/*set*/) )
         {
-            dirty_vram->dirty_bitmap[i / 8] |= 1 << (i % 8);
-            dirty_vram->last_dirty = NOW();
+            SHADOW_PRINTK("gfn %lx (mfn %lx) set vram pte\n",
+                          new_gfn, mfn_x(new_mfn));
         }
-    }
 }
 
 static int shadow_set_l1e(struct vcpu *v, 
@@ -1211,12 +1167,13 @@ static int shadow_set_l1e(struct vcpu *v,
                 shadow_l1e_remove_flags(new_sl1e, _PAGE_RW);
                 /* fall through */
             case 0:
-                shadow_vram_get_l1e(new_sl1e, sl1e, sl1mfn, d);
                 break;
             }
         }
     } 
 
+    shadow_vram_fix_l1e(old_sl1e, new_sl1e, sl1e, sl1mfn, d);
+
     /* Write the new entry */
     shadow_write_entries(sl1e, &new_sl1e, 1, sl1mfn);
     flags |= SHADOW_SET_CHANGED;
@@ -1231,7 +1188,6 @@ static int shadow_set_l1e(struct vcpu *v,
          * trigger a flush later. */
         if ( shadow_mode_refcounts(d) ) 
         {
-            shadow_vram_put_l1e(old_sl1e, sl1e, sl1mfn, d);
             shadow_put_page_from_l1e(old_sl1e, d);
             TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_SHADOW_L1_PUT_REF);
         } 
@@ -2018,7 +1974,6 @@ void sh_destroy_l1_shadow(struct vcpu *v, mfn_t smfn)
         SHADOW_FOREACH_L1E(sl1mfn, sl1e, 0, 0, {
             if ( (shadow_l1e_get_flags(*sl1e) & _PAGE_PRESENT)
                  && !sh_l1e_is_magic(*sl1e) ) {
-                shadow_vram_put_l1e(*sl1e, sl1e, sl1mfn, d);
                 shadow_put_page_from_l1e(*sl1e, d);
             }
         });
@@ -4336,6 +4291,37 @@ int sh_rm_mappings_from_l1(struct vcpu *v, mfn_t sl1mfn, mfn_t target_mfn)
     return done;
 }
 
+
+int sh_find_vram_mappings_in_l1(struct vcpu *v,
+                                mfn_t sl1mfn,
+                                unsigned long begin_pfn,
+                                unsigned long end_pfn,
+                                int *removed)
+/* Find all VRAM mappings in this shadow l1 table */
+{
+    struct domain *d = v->domain;
+    shadow_l1e_t *sl1e;
+    int done = 0;
+
+    /* only returns _PAGE_PRESENT entries */
+    SHADOW_FOREACH_L1E(sl1mfn, sl1e, 0, done, 
+    {
+        unsigned long gfn;
+        mfn_t gmfn = shadow_l1e_get_mfn(*sl1e);
+        if ( !mfn_valid(gmfn) )
+            continue;
+        gfn = mfn_to_gfn(d, gmfn);
+        if ( VALID_M2P(gfn) && (begin_pfn <= gfn) && (gfn < end_pfn) ) 
+        {
+            paddr_t sl1ma =
+                pfn_to_paddr(mfn_x(sl1mfn)) |
+                ( (unsigned long)sl1e & ~PAGE_MASK );
+            dirty_vram_range_update(v->domain, gfn, sl1ma, 1/*set*/);
+        }
+    });
+    return 0;
+}
+
 /**************************************************************************/
 /* Functions to excise all pointers to shadows from higher-level shadows. */
 
diff --git a/xen/arch/x86/mm/shadow/multi.h b/xen/arch/x86/mm/shadow/multi.h
index 835121e..436a4ac 100644
--- a/xen/arch/x86/mm/shadow/multi.h
+++ b/xen/arch/x86/mm/shadow/multi.h
@@ -66,7 +66,12 @@ SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, GUEST_LEVELS)
 extern int
 SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, GUEST_LEVELS)
     (struct vcpu *v, mfn_t sl1mfn, mfn_t target_mfn);
-
+extern int
+SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, GUEST_LEVELS)
+     (struct vcpu *v, mfn_t sl1mfn, 
+      unsigned long begin_pfn,
+      unsigned long end_pfn,
+      int *removed);
 extern void
 SHADOW_INTERNAL_NAME(sh_clear_shadow_entry, GUEST_LEVELS)
     (struct vcpu *v, void *ep, mfn_t smfn);
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index 43ce1db..5b0f9f7 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -229,6 +229,7 @@ static inline shadow_l4e_t shadow_l4e_from_mfn(mfn_t mfn, u32 flags)
 #define sh_update_cr3              INTERNAL_NAME(sh_update_cr3)
 #define sh_rm_write_access_from_l1 INTERNAL_NAME(sh_rm_write_access_from_l1)
 #define sh_rm_mappings_from_l1     INTERNAL_NAME(sh_rm_mappings_from_l1)
+#define sh_find_vram_mappings_in_l1 INTERNAL_NAME(sh_find_vram_mappings_in_l1)
 #define sh_remove_l1_shadow        INTERNAL_NAME(sh_remove_l1_shadow)
 #define sh_remove_l2_shadow        INTERNAL_NAME(sh_remove_l2_shadow)
 #define sh_remove_l3_shadow        INTERNAL_NAME(sh_remove_l3_shadow)
diff --git a/xen/include/asm-x86/dirty_vram.h b/xen/include/asm-x86/dirty_vram.h
new file mode 100644
index 0000000..7f3ccf9
--- /dev/null
+++ b/xen/include/asm-x86/dirty_vram.h
@@ -0,0 +1,196 @@
+/******************************************************************************
+ * include/asm-x86/dirty_vram.h
+ *
+ * Interface for tracking dirty VRAM pages
+ *
+ * Copyright (c) 2012 Citrix Systems, Inc. (Robert Phillips)
+ * Parts of this code are Copyright (c) 2006 by XenSource Inc.
+ * Parts of this code are Copyright (c) 2006 by Michael A Fetterman
+ * Parts based on earlier work by Michael A Fetterman, Ian Pratt et al.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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
+ */
+
+#ifndef _DIRTY_VRAM_H
+#define _DIRTY_VRAM_H
+
+/*
+ * In shadow mode we need to bookkeep all the L1 page table entries that
+ * map a frame buffer page.  Struct dv_paddr_link does this
+ * by recording the address of a L1 page table entry for some frame buffer page.
+ * Also has a link to additional pl entries if the frame buffer page
+ * has multiple mappings.
+ * In practice very few pages have multiple mappings.
+ * But to rule out some pathological situation, we limit the number of
+ * mappings we're willing to bookkeep.
+ */
+
+#define DV_ADDR_LINK_LIST_LIMIT 20
+
+typedef struct dv_paddr_link {
+    paddr_t sl1ma;
+    struct dv_paddr_link *pl_next;
+} dv_paddr_link_t;
+
+/*
+ * This defines an extension page of pl entries for FB pages with multiple
+ * mappings. All such pages (of a domain) are linked together.
+ */
+typedef struct dv_paddr_link_ext {
+    struct list_head ext_link;
+    dv_paddr_link_t entries[ ( PAGE_SIZE - sizeof( struct list_head ) ) /
+                             sizeof( dv_paddr_link_t ) ];
+} dv_paddr_link_ext_t;
+
+/*
+ * This defines a single frame buffer range.  It bookkeeps all the level 1 PTEs
+ * that map guest pages within that range.
+ * All such ranges (of a domain) are linked together.
+ */
+typedef struct dv_range {
+    struct list_head range_link; /* the several ranges form a linked list */
+    unsigned long begin_pfn;
+    unsigned long end_pfn;
+    dv_paddr_link_t *pl_tab; /* table has 1 pl entry per pfn in range */
+    int nr_mappings;  /* total number of mappings in this range */
+    int mappings_hwm; /* high water mark of max mapping count */
+    unsigned int dirty_count;
+} dv_range_t;
+
+/*
+ * This contains all the data structures required by a domain to
+ * bookkeep the dirty pages within its frame buffers.
+ */
+typedef struct dv_dirty_vram {
+    struct list_head range_head; /* head of the linked list of ranges */
+    struct list_head ext_head; /* head of list of extension pages */
+    dv_paddr_link_t *pl_free; /* free list of pl's within extension pages */
+    int nr_ranges; /* bookkeeps number of ranges */
+    int ranges_hwm; /* high water mark of max number of ranges */
+} dv_dirty_vram_t;
+
+/* Allocates domain's dirty_vram structure */
+dv_dirty_vram_t *
+dirty_vram_alloc(struct domain *d);
+
+/*
+ * Returns domain's dirty_vram structure,
+ * allocating it if necessary
+ */
+dv_dirty_vram_t *
+dirty_vram_find_or_alloc(struct domain *d);
+
+/* Frees domain's dirty_vram structure */
+void dirty_vram_free(struct domain *d);
+
+/* Returns dirty vram range containing gfn, NULL if none */
+struct dv_range *
+dirty_vram_range_find_gfn(struct domain *d,
+                          unsigned long gfn);
+
+/*
+ * Returns dirty vram range matching [ begin_pfn .. begin_pfn+nr ),
+ * NULL if none
+ */
+dv_range_t *
+dirty_vram_range_find(struct domain *d,
+                      unsigned long begin_pfn,
+                      unsigned long nr);
+
+/*
+ * Allocate dirty vram range containing [ begin_pfn .. begin_pfn+nr ),
+ * freeing any existing range that overlaps the new range.
+ */
+dv_range_t *
+dirty_vram_range_alloc(struct domain *d,
+                       unsigned long begin_pfn,
+                       unsigned long nr);
+
+/*
+ * Returns dirty vram range matching [ begin_pfn .. begin_pfn+nr ),
+ * creating a range if none already exists and
+ * freeing any existing range that overlaps the new range.
+ */
+dv_range_t *
+dirty_vram_range_find_or_alloc(struct domain *d,
+                               unsigned long begin_pfn,
+                               unsigned long nr);
+
+void dirty_vram_range_free(struct domain *d,
+                           dv_range_t *range);
+
+/* Bookkeep PTE address of a frame buffer page */
+int dirty_vram_range_update(struct domain *d,
+                            unsigned long gfn,
+                            paddr_t sl1ma,
+                            int set);
+
+/*
+ * smfn is no longer a shadow page.  Remove it from any
+ * dirty vram range mapping.
+ */
+void
+dirty_vram_delete_shadow(struct vcpu *v,
+                         unsigned long gfn,
+                         unsigned int shadow_type,
+                         mfn_t smfn);
+
+
+/*
+ * Scan all the L1 tables looking for VRAM mappings.
+ * Record them in the domain's dv_dirty_vram structure
+ */
+void sh_find_all_vram_mappings(struct vcpu *v,
+                               dv_range_t *range);
+
+/*
+ * Free a paddr_link struct, given address of its
+ * predecessor in singly-linked list
+ */
+dv_paddr_link_t *
+free_paddr_link(struct domain *d,
+                dv_paddr_link_t **ppl,
+                dv_paddr_link_t *pl);
+
+
+/* Enable VRAM dirty tracking. */
+int
+shadow_track_dirty_vram(struct domain *d,
+			unsigned long first_pfn,
+			unsigned long nr,
+			XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+
+int
+hap_track_dirty_vram(struct domain *d,
+		     unsigned long begin_pfn,
+		     unsigned long nr,
+		     XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+
+void
+hap_clean_vram_tracking_range(struct domain *d,
+			      unsigned long begin_pfn,
+			      unsigned long nr,
+			      uint8_t *dirty_bitmap);
+
+#endif /* _DIRTY_VRAM_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-x86/hap.h b/xen/include/asm-x86/hap.h
index 916a35b..3e3a1f5 100644
--- a/xen/include/asm-x86/hap.h
+++ b/xen/include/asm-x86/hap.h
@@ -57,10 +57,6 @@ void  hap_final_teardown(struct domain *d);
 void  hap_teardown(struct domain *d);
 void  hap_vcpu_init(struct vcpu *v);
 void  hap_logdirty_init(struct domain *d);
-int   hap_track_dirty_vram(struct domain *d,
-                           unsigned long begin_pfn,
-                           unsigned long nr,
-                           XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
 
 extern const struct paging_mode *hap_paging_get_mode(struct vcpu *);
 
diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h
index 27b3de5..6146542 100644
--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -74,7 +74,7 @@ struct hvm_domain {
     struct list_head       pinned_cacheattr_ranges;
 
     /* VRAM dirty support. */
-    struct sh_dirty_vram *dirty_vram;
+    struct dv_dirty_vram * dirty_vram;
 
     /* If one of vcpus of this domain is in no_fill_mode or
      * mtrr/pat between vcpus is not the same, set is_in_uc_mode
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 9a40f2c..f804104 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -137,10 +137,10 @@ struct paging_mode {
 void paging_free_log_dirty_bitmap(struct domain *d);
 
 /* get the dirty bitmap for a specific range of pfns */
-int paging_log_dirty_range(struct domain *d,
-                           unsigned long begin_pfn,
-                           unsigned long nr,
-                           XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+void paging_log_dirty_range(struct domain *d,
+                            unsigned long begin_pfn,
+                            unsigned long nr,
+                            uint8_t *dirty_bitmap);
 
 /* enable log dirty */
 int paging_log_dirty_enable(struct domain *d);
@@ -161,6 +161,11 @@ void paging_mark_dirty(struct domain *d, unsigned long guest_mfn);
  * This is called from inside paging code, with the paging lock held. */
 int paging_mfn_is_dirty(struct domain *d, mfn_t gmfn);
 
+/* mark a page as dirty, from hap page fault handler */
+void paging_mark_dirty_hap(struct domain *d,
+                           unsigned long pfn,
+                           unsigned long guest_mfn);
+
 /*
  * Log-dirty radix tree indexing:
  *   All tree nodes are PAGE_SIZE bytes, mapped on-demand.
@@ -183,15 +188,6 @@ int paging_mfn_is_dirty(struct domain *d, mfn_t gmfn);
 #define L4_LOGDIRTY_IDX(pfn) 0
 #endif
 
-/* VRAM dirty tracking support */
-struct sh_dirty_vram {
-    unsigned long begin_pfn;
-    unsigned long end_pfn;
-    paddr_t *sl1ma;
-    uint8_t *dirty_bitmap;
-    s_time_t last_dirty;
-};
-
 /*****************************************************************************
  * Entry points into the paging-assistance code */
 
diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
index 2eb6efc..940d7fd 100644
--- a/xen/include/asm-x86/shadow.h
+++ b/xen/include/asm-x86/shadow.h
@@ -62,12 +62,6 @@ void shadow_vcpu_init(struct vcpu *v);
 /* Enable an arbitrary shadow mode.  Call once at domain creation. */
 int shadow_enable(struct domain *d, u32 mode);
 
-/* Enable VRAM dirty bit tracking. */
-int shadow_track_dirty_vram(struct domain *d,
-                            unsigned long first_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
-
 /* Handler for shadow control ops: operations from user-space to enable
  * and disable ephemeral shadow modes (test mode and log-dirty mode) and
  * manipulate the log-dirty bitmap. */
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 20:37:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 20:37:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWCMq-0000V3-Ny; Wed, 07 Nov 2012 20:36:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <robert.phillips@citrix.com>) id 1TWCMp-0000Uy-CN
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 20:36:55 +0000
Received: from [85.158.139.83:39359] by server-13.bemta-5.messagelabs.com id
	86/6D-27809-666CA905; Wed, 07 Nov 2012 20:36:54 +0000
X-Env-Sender: robert.phillips@citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1352320602!29243370!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODIwMzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16396 invoked from network); 7 Nov 2012 20:36:53 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 20:36:53 -0000
X-IronPort-AV: E=Sophos;i="4.80,732,1344211200"; d="scan'208";a="43849505"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 20:36:20 +0000
Received: from FTLPMAILBOX02.citrite.net ([10.13.98.209]) by
	FTLPMAILMX02.citrite.net ([10.13.107.66]) with mapi;
	Wed, 7 Nov 2012 15:36:19 -0500
From: Robert Phillips <robert.phillips@citrix.com>
To: "Tim (Xen.org)" <tim@xen.org>
Date: Wed, 7 Nov 2012 15:36:17 -0500
Thread-Topic: [Xen-devel] [PATCH] Provide support for multiple frame buffers
	in Xen.
Thread-Index: Ac24PKA5ayC8XObNQZ+VpcHo9Jvt8AEuwCHA
Message-ID: <048EAD622912254A9DEA24C1734613C18C876560B1@FTLPMAILBOX02.citrite.net>
References: <1350411302-5470-1-git-send-email-robert.phillips@citrix.com>
	<20121101142434.GC61948@ocelot.phlegethon.org>
In-Reply-To: <20121101142434.GC61948@ocelot.phlegethon.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
 in Xen.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi Tim,

Thank you for your in-depth review.
Concurrent with this email I will submit a revised patch (version 2) containing the changes I mention below.

-- rsp

> -----Original Message-----
> From: Tim Deegan [mailto:tim@xen.org]
> Sent: Thursday, November 01, 2012 10:25 AM
> To: Robert Phillips
> Cc: xen-devel@lists.xen.org; Robert Phillips
> Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
> in Xen.
>
> Hi,
>
> At 14:15 -0400 on 16 Oct (1350396902), Robert Phillips wrote:
> > From: Robert Phillips <robert.phillips@virtualcomputer.com>
> >
> > Support is provided for both shadow and hardware assisted paging (HAP)
> modes.
> > This code bookkeeps the set of video frame buffers (vram),
> > detects when the guest has modified any of those buffers and, upon
> request,
> > returns a bitmap of the modified pages.
> >
> > This lets other software components re-paint the portions of the monitor
> (or monitors) that have changed.
> > Each monitor has a frame buffer of some size at some position in guest
> physical memory.
> > The set of frame buffers being tracked can change over time as monitors
> are plugged and unplugged.
>
> Having read through this in detail, it's looking very plausible. :)
> A few style nits:

[ Done

>  - please use the Xen spacings around 'if ( foo )' and 'for ( x; y; z )';
>  - there's a bit of trailing whitespace in the new file, and a few
>    places where indentation seems to have gone a bit wrong;
>  - please make sure the whole thing is linewrapped to <80 characters; and
>  - there's no need for braces around single-line blocks.

] Done

>
> More substantive comments:
>  - I think the dirty_vram.c and dirty_vram.h files belong under mm/
>    rather than under hvm/.  The ``#include "../mm/mm-locks.h"'' is
>    an indicator that this is really MM code.

I have moved dirty_vram.c under mm/
I have moved dirty_vram.h under include/asm-x86 .  In that location it is available to modules like hvm.c

>  - Please use xzalloc() rather than xmalloc() + memset(0).  It avoids
>    the sizes of alloc and memset getting out of sync.

Done

>  - The i386 build is dead, so you can drop some #ifdef __i386__ sections.

Done

>  - There really ought to be some limit on how many PTEs you're willing
>    to track.  Otherwise a large guest can consume lots and lots of Xen's
>    memory by making lots of PTEs that point to framebuffers.  That
>    might also lead to performance problems, e.g. in the unshadow
>    function that walks over all those liked lists.

Done but see note below in the comment starting "This needs to signal some sort of error".

>    Also, I think that the memory for the paddr_links ought to come from
>    the shadow pool (i.e. using domain->arch.paging.alloc_page())
>    rather than soaking up otherwise free memory.

Done

>
> A few other detailed comments below...
>
> > +/* Free a paddr_link struct, given address of its predecessor in linked list
> */
> > +dv_paddr_link_t *
> > +free_paddr_link(struct domain *d,
> > +                dv_paddr_link_t **ppl,
> > +                dv_paddr_link_t *pl)
> > +{
> > +    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
> > +    dv_paddr_link_t *npl; /* next pl */
> > +
> > +    ASSERT( paging_locked_by_me(d) );
> > +    /* extension mapping? */
> > +    if (ppl) /* yes. free it */
> > +    {
> > +        pl = (*ppl);
>
> This assignment seems like it should always be a noop.  Would it be
> correct to replace it with ASSERT(pl == *ppl)?

Yes,  Done.

>
> > +        (*ppl) = npl = pl->pl_next;
> > +    }
> > +    else  /* main table */
> > +    {
> > +        /* move 2nd mapping to main table.
> > +         * and free 2nd mapping */
> > +        dv_paddr_link_t * spl;
> > +        spl = pl->pl_next;
> > +        if (spl == NULL)
> > +        {
> > +            pl->sl1ma = INVALID_PADDR;
> > +            return pl;
> > +        }
> > +        pl->sl1ma = spl->sl1ma;
> > +        pl->pl_next = spl->pl_next;
> > +        npl = pl; /* reprocess main table entry again */
> > +        pl = spl;
>
> OK, that took a lot of staring at to be sure it's right. :)

I added some comments.  Reading code shouldn't be so taxing.

> I'd be
> inclined to just put all paddr_links in the linked list (and have an
> array of pointers rather than an array of paddr_link_ts).  Is it worth
> having the extra complexity here, and at the callers, to avoid a single
> memory read?

Almost all frame buffer pages have a single mapping so the algorithm's common case is met by constructing pl_tab as an array of paddr_links.
That is, the table's paddr_links will rarely point to a chain of extension paddr_links.
The code encapsulates the complexity in a single function.  Sorry it required so much staring.
Even if all paddr_links were stored in a linked list, the caller would have to walk that linked list, so would be just as complex.

>
> > +    }
> > +    pl->sl1ma = INVALID_PADDR;
> > +    pl->pl_next = dirty_vram->pl_free;
> > +    dirty_vram->pl_free = pl;
> > +    return npl;
> > +}
> > +
> > +
> > +/* dirty_vram_range_update()
> > + * This is called whenever a level 1 page table entry is modified.
> > + * If the L1PTE is being cleared, the function removes any paddr_links
> > + * that refer to it.
> > + * If the L1PTE is being set to a frame buffer page, a paddr_link is
> > + * created for that page's entry in pl_tab.
> > + * Returns 1 iff entry found and set or cleared.
> > + */
> > +int dirty_vram_range_update(struct domain *d,
> > +                            unsigned long gfn,
> > +                            paddr_t sl1ma,
> > +                            int set)
> > +{
> > +    int effective = 0;
> > +    dv_range_t *range;
> > +
> > +    ASSERT(paging_locked_by_me(d));
> > +    range = dirty_vram_range_find_gfn(d, gfn);
> > +    if ( range )
> > +    {
>
> I think this would be more readable as 'if ( !range ) return 0' here
> rather than indenting most of the function.

Done.

>
> > +        unsigned long i = gfn - range->begin_pfn;
> > +        dv_paddr_link_t *pl = &range->pl_tab[ i ];
> > +        dv_paddr_link_t **ppl = NULL;
> > +        int len = 0;
> > +
> > +        /* find matching entry (pl), if any, and its predecessor
> > +         * in linked list (ppl) */
> > +        while (pl != NULL)
> > +        {
> > +            if (pl->sl1ma == sl1ma || pl->sl1ma == INVALID_PADDR )
> > +                break;
> > +            ppl = &pl->pl_next;
> > +            pl = *ppl;
> > +            len++;
> > +        }
> > +
> > +        if (set)
> > +        {
> > +            /* Did we find sl1ma in either the main table or the linked list? */
> > +            if (pl == NULL) /* no, so we'll need to alloc a link */
> > +            {
> > +                ASSERT(ppl != NULL);
> > +                /* alloc link and append it to list */
> > +                (*ppl) = pl = alloc_paddr_link(d);
> > +                if (pl == NULL)
> > +                    goto out;
>
> This needs to signal some sort of error.  Otherwise, if we can't add
> this sl1e to the list we'll just silently fail to track it.

I don't know what sort of error we can signal.
The immediate symptom would be that areas of the monitor would not be refreshed.
But, since we're running out of memory, that might be the least of the quests's woes.

The updated patch actually makes the symptom more likely (though still very unlikely) by
putting an arbitrary bound on the length of paddr_link chains.
It handles a rogue process, one that has an arbitrarily large number of mappings for
frame buffer pages, by simply not recording the excessive mappings.
If that results in unrefreshed blocks on the monitor, so be it.

>
> > +            }
> > +            if ( pl->sl1ma != sl1ma )
> > +            {
>
> ASSERT(pl->sl1ma == INVALID_PADDR) ?

Yes, Done.

>
> > +                pl->sl1ma = sl1ma;
> > +                range->nr_mappings++;
> > +            }
> > +            effective = 1;
> > +            if (len > range->mappings_hwm)
> > +            {
> > +                range->mappings_hwm = len;
> > +#if DEBUG_update_vram_mapping
> > +                gdprintk(XENLOG_DEBUG,
> > +                         "[%lx] set      sl1ma:%lx hwm:%d mappings:%d
> freepages:%d\n",
> > +                         gfn, sl1ma,
> > +                         range->mappings_hwm,
> > +                         range->nr_mappings,
> > +                         d->arch.paging.shadow.free_pages);
> > +#endif
> > +            }
> > +        }
> > +        else /* clear */
> > +        {
> > +            if (pl && pl->sl1ma == sl1ma )
> > +            {
> > +#if DEBUG_update_vram_mapping
> > +                gdprintk(XENLOG_DEBUG,
> > +                         "[%lx] clear    sl1ma:%lx mappings:%d\n",
> > +                         gfn, sl1ma,
> > +                         range->nr_mappings-1);
> > +#endif
> > +                free_paddr_link(d, ppl, pl);
> > +                if ( --range->nr_mappings == 0 )
> > +                {
> > +                    dirty_vram_range_free(d, range);
>
> What's this for?  If the guest unmaps the framebuffer and remaps it (or
> if the shadow PTs of the mappings are temporarily discarded) this will
> stop us from tracking the new mappings until the toolstack asks for the
> bitmap (and then it will be expensive to go and find the mappings).
>

I don't see this happening.  If the guest unmaps the framebuffer, the shadow
code lazily recovers the shadow pages, so tracking will continue until it decides a page
is no longer a shadow page.  That is when this code is invoked.

It tears down the mappings to that page and if some range ends up with no mappings then the range is useless.
Vram ranges are generated willy-nilly as needed.   This is the only mechanism for cleaning them up.

> > +                }
> > +                effective = 1;
> > +            }
> > +        }
> > +    }
> > + out:
> > +    return effective;
> > +}
>
> > +/* shadow_track_dirty_vram()
> > + * This is the API called by the guest to determine which pages in the
> range
> > + * from [begin_pfn:begin_pfn+nr) have been dirtied since the last call.
> > + * It creates the domain's dv_dirty_vram on demand.
> > + * It creates ranges on demand when some [begin_pfn:nr) is first
> encountered.
> > + * To collect the dirty bitmask it calls shadow_scan_dirty_flags().
> > + * It copies the dirty bitmask into guest storage.
> > + */
> > +int shadow_track_dirty_vram(struct domain *d,
> > +                            unsigned long begin_pfn,
> > +                            unsigned long nr,
> > +                            XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
> > +{
> > +    int rc = 0;
> > +    unsigned long end_pfn = begin_pfn + nr;
> > +    int flush_tlb = 0;
> > +    dv_range_t *range;
> > +    struct p2m_domain *p2m = p2m_get_hostp2m(d);
> > +
> > +    if (end_pfn < begin_pfn
> > +            || begin_pfn > p2m->max_mapped_pfn
> > +            || end_pfn >= p2m->max_mapped_pfn)
>
> I know you just copied this from the old definition but the limits seem
> wrong here -- I think it should be:
>
>     if ( end_pfn < begin_pfn || end_pfn > p2m->max_mapped_pfn + 1 )

You're right.  Done.  And commented because it's pretty obscure.

>
>
> > +/* hap_clean_vram_tracking_range()
> > + * For all the pages in the range specified by [begin_pfn,nr),
> > + * note in the dirty bitmap any page that has been marked as read-write,
> > + * which signifies that the page has been dirtied, and reset the page
> > + * to ram_logdirty.
> > + */
> > +void hap_clean_vram_tracking_range(struct domain *d,
> > +                                   unsigned long begin_pfn,
> > +                                   unsigned long nr,
> > +                                   uint8_t *dirty_bitmap)
> > +{
> > +    int i;
> > +    unsigned long pfn;
> > +    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
> > +    dv_range_t *range;
> > +
> > +    ASSERT(p2m_locked_by_me(p2m_get_hostp2m(d)));
> > +    ASSERT(paging_locked_by_me(d));
> > +
> > +    if ( !dirty_vram )
> > +    {
> > +        gdprintk(XENLOG_DEBUG, "Should only be called while tracking dirty
> vram.\n");
> > +        return;
> > +    }
> > +
> > +    range = dirty_vram_range_find(d, begin_pfn, nr);
> > +    if (!range)
> > +        return;
>
> Oughtn't we to return all 1s in the bitmap here?  If the range isn't
> currently being tracked we should conservatively assume it's all dirty,
> right?

The callers will should ensure that the range exists.  This is just a conservative test.

Anyway, it begs the question of whether a new range should be considered all
dirty or all clean.  Intuitively "all dirty" seems the right answer but in practice
it works fine as written since the guest is busy updating the
whole frame buffer.

>
> > +
> > +    /* set l1e entries of P2M table to be read-only. */
> > +    /* On first write, it page faults, its entry is changed to read-write,
> > +     * its bit in the dirty bitmap is set, and on retry the write succeeds. */
> > +    for (i = 0, pfn = range->begin_pfn; pfn < range->end_pfn; i++, pfn++)
> > +    {
> > +        p2m_type_t pt;
> > +        pt = p2m_change_type(d, pfn, p2m_ram_rw, p2m_ram_logdirty);
> > +        if (pt == p2m_ram_rw)
> > +            dirty_bitmap[i >> 3] |= (1 << (i & 7));
> > +    }
> > +    flush_tlb_mask(d->domain_dirty_cpumask);
> > +}
> > +
> > +static void hap_vram_tracking_init(struct domain *d)
> > +{
> > +    paging_log_dirty_init(d, hap_enable_vram_tracking,
> > +                          hap_disable_vram_tracking,
> > +                          NULL);
> > +}
> > +
> > +/* hap_track_dirty_vram()
> > + * Create the domain's dv_dirty_vram struct on demand.
> > + * Create a dirty vram range on demand when some
> [begin_pfn:begin_pfn+nr] is first encountered.
> > + * Collect the guest_dirty bitmask, a bit mask of the dirties vram pages, by
> > + * calling paging_log_dirty_range().
> > + */
> > +int hap_track_dirty_vram(struct domain *d,
> > +                         unsigned long begin_pfn,
> > +                         unsigned long nr,
> > +                         XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
> > +{
> > +    long rc = 0;
> > +    dv_dirty_vram_t *dirty_vram;
> > +    int restart_log_dirty = 0;
> > +
> > +    paging_lock(d);
> > +    dirty_vram = d->arch.hvm_domain.dirty_vram;
> > +    if ( nr )
> > +    {
> > +        dv_range_t *range = NULL;
> > +        int size = (nr + BITS_PER_LONG - 1) / BITS_PER_LONG;
> > +        unsigned long dirty_bitmap[size];
>
> All the users of this array cast to (uint8_t *) -- just declare it as
> uint8_t * instead?

Yes, done.  The original code seemed overly fond of using LONGs ...

>
> > +
> > +        /* Already tracking dirty vram? */
> > +        if ( paging_mode_log_dirty(d) && dirty_vram ) /* yes */
> > +        {
> > +            /* Handle the addition of another range */
> > +            range = dirty_vram_range_find(d, begin_pfn, nr);
> > +            if ( !range )
> > +            {
> > +                rc = -ENOMEM;
> > +                if ( !(range = dirty_vram_range_alloc(d, begin_pfn, nr)) )
> > +                    goto param_fail;
> > +                restart_log_dirty = 1;
> > +            }
> > +        }
> > +        /* Just starting to track dirty vram? */
> > +        else if ( !paging_mode_log_dirty(d) && !dirty_vram ) /* yes */
> > +        {
> > +            rc = -ENOMEM;
> > +            if ( !(dirty_vram = dirty_vram_alloc(d)) )
> > +                goto param_fail;
> > +
> > +            if ( !(range = dirty_vram_range_find_or_alloc(d, begin_pfn, nr)) )
> > +                goto param_fail;
> > +
> > +            restart_log_dirty = 1;
> > +            /* Initialize callbacks for vram tracking */
> > +            hap_vram_tracking_init(d);
> > +        }
> > +        else
> > +        {
> > +            /* Test for invalid combination */
> > +            if ( !paging_mode_log_dirty(d) && dirty_vram )
> > +                rc = -EINVAL;
> > +            else /* logging dirty of all memory, not tracking dirty vram */
> > +                rc = -ENODATA;
> > +            goto param_fail;
> > +        }
> > +
> > +        if (restart_log_dirty)
> > +        {
> > +            /* disable then enable log dirty */
>
> Why disable and re-enable?  The call to paging_log_dirty_range() below
> will reset the p2m entries of the range you care about, so I think all
> you need to do is enable it in the 'just starting' case above.

Done.

>
> And, since you know you're in HAP mode, not in log-dirty mode, and
> already have the paging lock, you can just set
> d->arch.paging.mode |= PG_log_dirty there rather than jumping through
> the paging_log_dirty_enable() path and messing with locks.

No, paging_log_dirty_enable() goes through several layers of functions and
ends up calling hap_enable_vram_tracking(), which does quite a bit of stuff.

>
> > +            paging_unlock(d);
> > +            if (paging_mode_log_dirty(d))
> > +                paging_log_dirty_disable(d);
> > +
> > +            rc = paging_log_dirty_enable(d);
> > +            paging_lock(d);
> > +            if (rc != 0)
> > +                goto param_fail;
> > +        }
> > +
> > +        paging_unlock(d);
> > +        memset(dirty_bitmap, 0x00, size * BYTES_PER_LONG);
> > +   paging_log_dirty_range(d, begin_pfn, nr, (uint8_t*)dirty_bitmap);
> > +        rc = -EFAULT;
> > +        if ( copy_to_guest(guest_dirty_bitmap,
> > +                           (uint8_t*)dirty_bitmap,
> > +                           size * BYTES_PER_LONG) == 0 )
> > +        {
> > +            rc = 0;
> > +        }
> > +    }
> > +    else
> > +    {
> > +        /* If zero pages specified while already tracking dirty vram
> > +         * then stop tracking */
> > +        if ( paging_mode_log_dirty(d) && dirty_vram ) {
> > +            paging_unlock(d);
> > +            rc = paging_log_dirty_disable(d);
> > +            paging_lock(d);
> > +            dirty_vram_free(d);
>
> This is different from the shadow case -- there, IIUC, you just ignore
> requests where nr == 0; here, you tear down all vram tracking.
> Can you choose one of those, and document it in the public header?

Done.  I changed the shadow code to tear down if nr == 0.
(The HAP code seemed to expect that behavior and the shadow code didn't
seem to care.)
And updated the public header.

>
> > +        } else /* benign no-op */
> > +        {
> > +            rc = 0;
> > +        }
> > +        paging_unlock(d);
> > +    }
> > +
> > +    return rc;
>
>
> > +/* paging_mark_dirty_hap()
> > + * Make a hap page writeable and mark it as dirty.
> > + * This done atomically under the p2m and paging locks to avoid leaving
> > + * a window where the page might be modified without being marked as
> dirty.
> > + */
>
> I'm perplexed by this -- AFAICT it's either not necessary (because all
> log-dirty read/clean ops are done with the domain paused) or not sufficient
> (because although the bitmap and the PTE are updated under the p2m lock,
> the actual dirtying of the page happens at some other time).  Can you
> spell out for me exactly what this is protecting against?

The comment over-stated the problem so I've toned it down
from "without being marked" to "without being counted".

paging_mark_dirty_hap() is in the page fault path and has two steps:

(1) It calls p2m_change_type() to re-mark some pfn as writeable (i.e. p2m_ram_rw),
which is a no-op if the pfn is already writeable.
This must be done under the p2m_lock.

(2) If the pfn was previously read-only (i.e. p2m_ram_logdirty) then it bumps two
dirty counts.  And it marks the page as dirty.
This must be done under the paging lock.

As an invariant, the dirty counts should be precisely the number of pages
made writeable.

With this patch, step (2) is also done under the p2m_lock.  This avoids having
a window between steps (1) and (2), in which hap_track_dirty_vram() might
get in and would break the invariant by clearing the range's dirty count.

It may be that this invariant is not particularly useful, that things will just work out.
But I do wonder if, without it, we'll have situations where the dirty counts will indicate
dirty pages when there are none, or no dirty pages when there are some.

>
> > +typedef int (*hash_pfn_callback_t)(struct vcpu *v,
> > +                                   mfn_t smfn,
> > +                                   unsigned long begin_pfn,
> > +                                   unsigned long end_pfn,
> > +                                   int *removed);
> > +
> > +static int hash_pfn_foreach(struct vcpu *v,
> > +                            unsigned int callback_mask,
> > +                            hash_pfn_callback_t callbacks[],
> > +                            unsigned long begin_pfn,
> > +                            unsigned long end_pfn)
> > +/* Walk the hash table looking at the types of the entries and
> > + * calling the appropriate callback function for each entry.
> > + * The mask determines which shadow types we call back for, and the
> array
> > + * of callbacks tells us which function to call.
> > + * Any callback may return non-zero to let us skip the rest of the scan.
> > + *
> > + * WARNING: Callbacks MUST NOT add or remove hash entries unless
> they
> > + * then return non-zero to terminate the scan. */
>
> This code duplication is a bit much.  I think you should recast the
> existing hash_foreach() function to take a pointer as its fourth
> argument instead of an MFN, and then make the existing callers just cast
> their MFN argument as a pointer.   The you can use the same function,
> passing a pointer to a struct { begin, end, removed }.
>
> Please make the changes to hash_foreach() in a separate patch from the
> dirty_vram stuff.

Yes, I'd be happy to submit a patch as you suggest after we're done with this one.

>
> > @@ -1211,12 +1164,14 @@ static int shadow_set_l1e(struct vcpu *v,
> >                  shadow_l1e_remove_flags(new_sl1e, _PAGE_RW);
> >                  /* fall through */
> >              case 0:
> > -                shadow_vram_get_l1e(new_sl1e, sl1e, sl1mfn, d);
> > +                shadow_vram_fix_l1e(old_sl1e, new_sl1e, sl1e, sl1mfn, d);
> >                  break;
> >              }
> >          }
> >      }
> >
> > +    shadow_vram_fix_l1e(old_sl1e, new_sl1e, sl1e, sl1mfn, d);
>
> Why is this being called twice here?

Stupidity.  I've eliminated the first of the two.

>
> Cheers,
>
> Tim.

Thanks again.
-- rsp

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 20:37:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 20:37:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWCMq-0000V3-Ny; Wed, 07 Nov 2012 20:36:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <robert.phillips@citrix.com>) id 1TWCMp-0000Uy-CN
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 20:36:55 +0000
Received: from [85.158.139.83:39359] by server-13.bemta-5.messagelabs.com id
	86/6D-27809-666CA905; Wed, 07 Nov 2012 20:36:54 +0000
X-Env-Sender: robert.phillips@citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1352320602!29243370!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODIwMzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16396 invoked from network); 7 Nov 2012 20:36:53 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 20:36:53 -0000
X-IronPort-AV: E=Sophos;i="4.80,732,1344211200"; d="scan'208";a="43849505"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	07 Nov 2012 20:36:20 +0000
Received: from FTLPMAILBOX02.citrite.net ([10.13.98.209]) by
	FTLPMAILMX02.citrite.net ([10.13.107.66]) with mapi;
	Wed, 7 Nov 2012 15:36:19 -0500
From: Robert Phillips <robert.phillips@citrix.com>
To: "Tim (Xen.org)" <tim@xen.org>
Date: Wed, 7 Nov 2012 15:36:17 -0500
Thread-Topic: [Xen-devel] [PATCH] Provide support for multiple frame buffers
	in Xen.
Thread-Index: Ac24PKA5ayC8XObNQZ+VpcHo9Jvt8AEuwCHA
Message-ID: <048EAD622912254A9DEA24C1734613C18C876560B1@FTLPMAILBOX02.citrite.net>
References: <1350411302-5470-1-git-send-email-robert.phillips@citrix.com>
	<20121101142434.GC61948@ocelot.phlegethon.org>
In-Reply-To: <20121101142434.GC61948@ocelot.phlegethon.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
 in Xen.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi Tim,

Thank you for your in-depth review.
Concurrent with this email I will submit a revised patch (version 2) containing the changes I mention below.

-- rsp

> -----Original Message-----
> From: Tim Deegan [mailto:tim@xen.org]
> Sent: Thursday, November 01, 2012 10:25 AM
> To: Robert Phillips
> Cc: xen-devel@lists.xen.org; Robert Phillips
> Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
> in Xen.
>
> Hi,
>
> At 14:15 -0400 on 16 Oct (1350396902), Robert Phillips wrote:
> > From: Robert Phillips <robert.phillips@virtualcomputer.com>
> >
> > Support is provided for both shadow and hardware assisted paging (HAP)
> modes.
> > This code bookkeeps the set of video frame buffers (vram),
> > detects when the guest has modified any of those buffers and, upon
> request,
> > returns a bitmap of the modified pages.
> >
> > This lets other software components re-paint the portions of the monitor
> (or monitors) that have changed.
> > Each monitor has a frame buffer of some size at some position in guest
> physical memory.
> > The set of frame buffers being tracked can change over time as monitors
> are plugged and unplugged.
>
> Having read through this in detail, it's looking very plausible. :)
> A few style nits:

[ Done

>  - please use the Xen spacings around 'if ( foo )' and 'for ( x; y; z )';
>  - there's a bit of trailing whitespace in the new file, and a few
>    places where indentation seems to have gone a bit wrong;
>  - please make sure the whole thing is linewrapped to <80 characters; and
>  - there's no need for braces around single-line blocks.

] Done

>
> More substantive comments:
>  - I think the dirty_vram.c and dirty_vram.h files belong under mm/
>    rather than under hvm/.  The ``#include "../mm/mm-locks.h"'' is
>    an indicator that this is really MM code.

I have moved dirty_vram.c under mm/
I have moved dirty_vram.h under include/asm-x86 .  In that location it is available to modules like hvm.c

>  - Please use xzalloc() rather than xmalloc() + memset(0).  It avoids
>    the sizes of alloc and memset getting out of sync.

Done

>  - The i386 build is dead, so you can drop some #ifdef __i386__ sections.

Done

>  - There really ought to be some limit on how many PTEs you're willing
>    to track.  Otherwise a large guest can consume lots and lots of Xen's
>    memory by making lots of PTEs that point to framebuffers.  That
>    might also lead to performance problems, e.g. in the unshadow
>    function that walks over all those liked lists.

Done but see note below in the comment starting "This needs to signal some sort of error".

>    Also, I think that the memory for the paddr_links ought to come from
>    the shadow pool (i.e. using domain->arch.paging.alloc_page())
>    rather than soaking up otherwise free memory.

Done

>
> A few other detailed comments below...
>
> > +/* Free a paddr_link struct, given address of its predecessor in linked list
> */
> > +dv_paddr_link_t *
> > +free_paddr_link(struct domain *d,
> > +                dv_paddr_link_t **ppl,
> > +                dv_paddr_link_t *pl)
> > +{
> > +    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
> > +    dv_paddr_link_t *npl; /* next pl */
> > +
> > +    ASSERT( paging_locked_by_me(d) );
> > +    /* extension mapping? */
> > +    if (ppl) /* yes. free it */
> > +    {
> > +        pl = (*ppl);
>
> This assignment seems like it should always be a noop.  Would it be
> correct to replace it with ASSERT(pl == *ppl)?

Yes,  Done.

>
> > +        (*ppl) = npl = pl->pl_next;
> > +    }
> > +    else  /* main table */
> > +    {
> > +        /* move 2nd mapping to main table.
> > +         * and free 2nd mapping */
> > +        dv_paddr_link_t * spl;
> > +        spl = pl->pl_next;
> > +        if (spl == NULL)
> > +        {
> > +            pl->sl1ma = INVALID_PADDR;
> > +            return pl;
> > +        }
> > +        pl->sl1ma = spl->sl1ma;
> > +        pl->pl_next = spl->pl_next;
> > +        npl = pl; /* reprocess main table entry again */
> > +        pl = spl;
>
> OK, that took a lot of staring at to be sure it's right. :)

I added some comments.  Reading code shouldn't be so taxing.

> I'd be
> inclined to just put all paddr_links in the linked list (and have an
> array of pointers rather than an array of paddr_link_ts).  Is it worth
> having the extra complexity here, and at the callers, to avoid a single
> memory read?

Almost all frame buffer pages have a single mapping so the algorithm's common case is met by constructing pl_tab as an array of paddr_links.
That is, the table's paddr_links will rarely point to a chain of extension paddr_links.
The code encapsulates the complexity in a single function.  Sorry it required so much staring.
Even if all paddr_links were stored in a linked list, the caller would have to walk that linked list, so would be just as complex.

>
> > +    }
> > +    pl->sl1ma = INVALID_PADDR;
> > +    pl->pl_next = dirty_vram->pl_free;
> > +    dirty_vram->pl_free = pl;
> > +    return npl;
> > +}
> > +
> > +
> > +/* dirty_vram_range_update()
> > + * This is called whenever a level 1 page table entry is modified.
> > + * If the L1PTE is being cleared, the function removes any paddr_links
> > + * that refer to it.
> > + * If the L1PTE is being set to a frame buffer page, a paddr_link is
> > + * created for that page's entry in pl_tab.
> > + * Returns 1 iff entry found and set or cleared.
> > + */
> > +int dirty_vram_range_update(struct domain *d,
> > +                            unsigned long gfn,
> > +                            paddr_t sl1ma,
> > +                            int set)
> > +{
> > +    int effective = 0;
> > +    dv_range_t *range;
> > +
> > +    ASSERT(paging_locked_by_me(d));
> > +    range = dirty_vram_range_find_gfn(d, gfn);
> > +    if ( range )
> > +    {
>
> I think this would be more readable as 'if ( !range ) return 0' here
> rather than indenting most of the function.

Done.

>
> > +        unsigned long i = gfn - range->begin_pfn;
> > +        dv_paddr_link_t *pl = &range->pl_tab[ i ];
> > +        dv_paddr_link_t **ppl = NULL;
> > +        int len = 0;
> > +
> > +        /* find matching entry (pl), if any, and its predecessor
> > +         * in linked list (ppl) */
> > +        while (pl != NULL)
> > +        {
> > +            if (pl->sl1ma == sl1ma || pl->sl1ma == INVALID_PADDR )
> > +                break;
> > +            ppl = &pl->pl_next;
> > +            pl = *ppl;
> > +            len++;
> > +        }
> > +
> > +        if (set)
> > +        {
> > +            /* Did we find sl1ma in either the main table or the linked list? */
> > +            if (pl == NULL) /* no, so we'll need to alloc a link */
> > +            {
> > +                ASSERT(ppl != NULL);
> > +                /* alloc link and append it to list */
> > +                (*ppl) = pl = alloc_paddr_link(d);
> > +                if (pl == NULL)
> > +                    goto out;
>
> This needs to signal some sort of error.  Otherwise, if we can't add
> this sl1e to the list we'll just silently fail to track it.

I don't know what sort of error we can signal.
The immediate symptom would be that areas of the monitor would not be refreshed.
But, since we're running out of memory, that might be the least of the quests's woes.

The updated patch actually makes the symptom more likely (though still very unlikely) by
putting an arbitrary bound on the length of paddr_link chains.
It handles a rogue process, one that has an arbitrarily large number of mappings for
frame buffer pages, by simply not recording the excessive mappings.
If that results in unrefreshed blocks on the monitor, so be it.

>
> > +            }
> > +            if ( pl->sl1ma != sl1ma )
> > +            {
>
> ASSERT(pl->sl1ma == INVALID_PADDR) ?

Yes, Done.

>
> > +                pl->sl1ma = sl1ma;
> > +                range->nr_mappings++;
> > +            }
> > +            effective = 1;
> > +            if (len > range->mappings_hwm)
> > +            {
> > +                range->mappings_hwm = len;
> > +#if DEBUG_update_vram_mapping
> > +                gdprintk(XENLOG_DEBUG,
> > +                         "[%lx] set      sl1ma:%lx hwm:%d mappings:%d
> freepages:%d\n",
> > +                         gfn, sl1ma,
> > +                         range->mappings_hwm,
> > +                         range->nr_mappings,
> > +                         d->arch.paging.shadow.free_pages);
> > +#endif
> > +            }
> > +        }
> > +        else /* clear */
> > +        {
> > +            if (pl && pl->sl1ma == sl1ma )
> > +            {
> > +#if DEBUG_update_vram_mapping
> > +                gdprintk(XENLOG_DEBUG,
> > +                         "[%lx] clear    sl1ma:%lx mappings:%d\n",
> > +                         gfn, sl1ma,
> > +                         range->nr_mappings-1);
> > +#endif
> > +                free_paddr_link(d, ppl, pl);
> > +                if ( --range->nr_mappings == 0 )
> > +                {
> > +                    dirty_vram_range_free(d, range);
>
> What's this for?  If the guest unmaps the framebuffer and remaps it (or
> if the shadow PTs of the mappings are temporarily discarded) this will
> stop us from tracking the new mappings until the toolstack asks for the
> bitmap (and then it will be expensive to go and find the mappings).
>

I don't see this happening.  If the guest unmaps the framebuffer, the shadow
code lazily recovers the shadow pages, so tracking will continue until it decides a page
is no longer a shadow page.  That is when this code is invoked.

It tears down the mappings to that page and if some range ends up with no mappings then the range is useless.
Vram ranges are generated willy-nilly as needed.   This is the only mechanism for cleaning them up.

> > +                }
> > +                effective = 1;
> > +            }
> > +        }
> > +    }
> > + out:
> > +    return effective;
> > +}
>
> > +/* shadow_track_dirty_vram()
> > + * This is the API called by the guest to determine which pages in the
> range
> > + * from [begin_pfn:begin_pfn+nr) have been dirtied since the last call.
> > + * It creates the domain's dv_dirty_vram on demand.
> > + * It creates ranges on demand when some [begin_pfn:nr) is first
> encountered.
> > + * To collect the dirty bitmask it calls shadow_scan_dirty_flags().
> > + * It copies the dirty bitmask into guest storage.
> > + */
> > +int shadow_track_dirty_vram(struct domain *d,
> > +                            unsigned long begin_pfn,
> > +                            unsigned long nr,
> > +                            XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
> > +{
> > +    int rc = 0;
> > +    unsigned long end_pfn = begin_pfn + nr;
> > +    int flush_tlb = 0;
> > +    dv_range_t *range;
> > +    struct p2m_domain *p2m = p2m_get_hostp2m(d);
> > +
> > +    if (end_pfn < begin_pfn
> > +            || begin_pfn > p2m->max_mapped_pfn
> > +            || end_pfn >= p2m->max_mapped_pfn)
>
> I know you just copied this from the old definition but the limits seem
> wrong here -- I think it should be:
>
>     if ( end_pfn < begin_pfn || end_pfn > p2m->max_mapped_pfn + 1 )

You're right.  Done.  And commented because it's pretty obscure.

>
>
> > +/* hap_clean_vram_tracking_range()
> > + * For all the pages in the range specified by [begin_pfn,nr),
> > + * note in the dirty bitmap any page that has been marked as read-write,
> > + * which signifies that the page has been dirtied, and reset the page
> > + * to ram_logdirty.
> > + */
> > +void hap_clean_vram_tracking_range(struct domain *d,
> > +                                   unsigned long begin_pfn,
> > +                                   unsigned long nr,
> > +                                   uint8_t *dirty_bitmap)
> > +{
> > +    int i;
> > +    unsigned long pfn;
> > +    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
> > +    dv_range_t *range;
> > +
> > +    ASSERT(p2m_locked_by_me(p2m_get_hostp2m(d)));
> > +    ASSERT(paging_locked_by_me(d));
> > +
> > +    if ( !dirty_vram )
> > +    {
> > +        gdprintk(XENLOG_DEBUG, "Should only be called while tracking dirty
> vram.\n");
> > +        return;
> > +    }
> > +
> > +    range = dirty_vram_range_find(d, begin_pfn, nr);
> > +    if (!range)
> > +        return;
>
> Oughtn't we to return all 1s in the bitmap here?  If the range isn't
> currently being tracked we should conservatively assume it's all dirty,
> right?

The callers will should ensure that the range exists.  This is just a conservative test.

Anyway, it begs the question of whether a new range should be considered all
dirty or all clean.  Intuitively "all dirty" seems the right answer but in practice
it works fine as written since the guest is busy updating the
whole frame buffer.

>
> > +
> > +    /* set l1e entries of P2M table to be read-only. */
> > +    /* On first write, it page faults, its entry is changed to read-write,
> > +     * its bit in the dirty bitmap is set, and on retry the write succeeds. */
> > +    for (i = 0, pfn = range->begin_pfn; pfn < range->end_pfn; i++, pfn++)
> > +    {
> > +        p2m_type_t pt;
> > +        pt = p2m_change_type(d, pfn, p2m_ram_rw, p2m_ram_logdirty);
> > +        if (pt == p2m_ram_rw)
> > +            dirty_bitmap[i >> 3] |= (1 << (i & 7));
> > +    }
> > +    flush_tlb_mask(d->domain_dirty_cpumask);
> > +}
> > +
> > +static void hap_vram_tracking_init(struct domain *d)
> > +{
> > +    paging_log_dirty_init(d, hap_enable_vram_tracking,
> > +                          hap_disable_vram_tracking,
> > +                          NULL);
> > +}
> > +
> > +/* hap_track_dirty_vram()
> > + * Create the domain's dv_dirty_vram struct on demand.
> > + * Create a dirty vram range on demand when some
> [begin_pfn:begin_pfn+nr] is first encountered.
> > + * Collect the guest_dirty bitmask, a bit mask of the dirties vram pages, by
> > + * calling paging_log_dirty_range().
> > + */
> > +int hap_track_dirty_vram(struct domain *d,
> > +                         unsigned long begin_pfn,
> > +                         unsigned long nr,
> > +                         XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
> > +{
> > +    long rc = 0;
> > +    dv_dirty_vram_t *dirty_vram;
> > +    int restart_log_dirty = 0;
> > +
> > +    paging_lock(d);
> > +    dirty_vram = d->arch.hvm_domain.dirty_vram;
> > +    if ( nr )
> > +    {
> > +        dv_range_t *range = NULL;
> > +        int size = (nr + BITS_PER_LONG - 1) / BITS_PER_LONG;
> > +        unsigned long dirty_bitmap[size];
>
> All the users of this array cast to (uint8_t *) -- just declare it as
> uint8_t * instead?

Yes, done.  The original code seemed overly fond of using LONGs ...

>
> > +
> > +        /* Already tracking dirty vram? */
> > +        if ( paging_mode_log_dirty(d) && dirty_vram ) /* yes */
> > +        {
> > +            /* Handle the addition of another range */
> > +            range = dirty_vram_range_find(d, begin_pfn, nr);
> > +            if ( !range )
> > +            {
> > +                rc = -ENOMEM;
> > +                if ( !(range = dirty_vram_range_alloc(d, begin_pfn, nr)) )
> > +                    goto param_fail;
> > +                restart_log_dirty = 1;
> > +            }
> > +        }
> > +        /* Just starting to track dirty vram? */
> > +        else if ( !paging_mode_log_dirty(d) && !dirty_vram ) /* yes */
> > +        {
> > +            rc = -ENOMEM;
> > +            if ( !(dirty_vram = dirty_vram_alloc(d)) )
> > +                goto param_fail;
> > +
> > +            if ( !(range = dirty_vram_range_find_or_alloc(d, begin_pfn, nr)) )
> > +                goto param_fail;
> > +
> > +            restart_log_dirty = 1;
> > +            /* Initialize callbacks for vram tracking */
> > +            hap_vram_tracking_init(d);
> > +        }
> > +        else
> > +        {
> > +            /* Test for invalid combination */
> > +            if ( !paging_mode_log_dirty(d) && dirty_vram )
> > +                rc = -EINVAL;
> > +            else /* logging dirty of all memory, not tracking dirty vram */
> > +                rc = -ENODATA;
> > +            goto param_fail;
> > +        }
> > +
> > +        if (restart_log_dirty)
> > +        {
> > +            /* disable then enable log dirty */
>
> Why disable and re-enable?  The call to paging_log_dirty_range() below
> will reset the p2m entries of the range you care about, so I think all
> you need to do is enable it in the 'just starting' case above.

Done.

>
> And, since you know you're in HAP mode, not in log-dirty mode, and
> already have the paging lock, you can just set
> d->arch.paging.mode |= PG_log_dirty there rather than jumping through
> the paging_log_dirty_enable() path and messing with locks.

No, paging_log_dirty_enable() goes through several layers of functions and
ends up calling hap_enable_vram_tracking(), which does quite a bit of stuff.

>
> > +            paging_unlock(d);
> > +            if (paging_mode_log_dirty(d))
> > +                paging_log_dirty_disable(d);
> > +
> > +            rc = paging_log_dirty_enable(d);
> > +            paging_lock(d);
> > +            if (rc != 0)
> > +                goto param_fail;
> > +        }
> > +
> > +        paging_unlock(d);
> > +        memset(dirty_bitmap, 0x00, size * BYTES_PER_LONG);
> > +   paging_log_dirty_range(d, begin_pfn, nr, (uint8_t*)dirty_bitmap);
> > +        rc = -EFAULT;
> > +        if ( copy_to_guest(guest_dirty_bitmap,
> > +                           (uint8_t*)dirty_bitmap,
> > +                           size * BYTES_PER_LONG) == 0 )
> > +        {
> > +            rc = 0;
> > +        }
> > +    }
> > +    else
> > +    {
> > +        /* If zero pages specified while already tracking dirty vram
> > +         * then stop tracking */
> > +        if ( paging_mode_log_dirty(d) && dirty_vram ) {
> > +            paging_unlock(d);
> > +            rc = paging_log_dirty_disable(d);
> > +            paging_lock(d);
> > +            dirty_vram_free(d);
>
> This is different from the shadow case -- there, IIUC, you just ignore
> requests where nr == 0; here, you tear down all vram tracking.
> Can you choose one of those, and document it in the public header?

Done.  I changed the shadow code to tear down if nr == 0.
(The HAP code seemed to expect that behavior and the shadow code didn't
seem to care.)
And updated the public header.

>
> > +        } else /* benign no-op */
> > +        {
> > +            rc = 0;
> > +        }
> > +        paging_unlock(d);
> > +    }
> > +
> > +    return rc;
>
>
> > +/* paging_mark_dirty_hap()
> > + * Make a hap page writeable and mark it as dirty.
> > + * This done atomically under the p2m and paging locks to avoid leaving
> > + * a window where the page might be modified without being marked as
> dirty.
> > + */
>
> I'm perplexed by this -- AFAICT it's either not necessary (because all
> log-dirty read/clean ops are done with the domain paused) or not sufficient
> (because although the bitmap and the PTE are updated under the p2m lock,
> the actual dirtying of the page happens at some other time).  Can you
> spell out for me exactly what this is protecting against?

The comment over-stated the problem so I've toned it down
from "without being marked" to "without being counted".

paging_mark_dirty_hap() is in the page fault path and has two steps:

(1) It calls p2m_change_type() to re-mark some pfn as writeable (i.e. p2m_ram_rw),
which is a no-op if the pfn is already writeable.
This must be done under the p2m_lock.

(2) If the pfn was previously read-only (i.e. p2m_ram_logdirty) then it bumps two
dirty counts.  And it marks the page as dirty.
This must be done under the paging lock.

As an invariant, the dirty counts should be precisely the number of pages
made writeable.

With this patch, step (2) is also done under the p2m_lock.  This avoids having
a window between steps (1) and (2), in which hap_track_dirty_vram() might
get in and would break the invariant by clearing the range's dirty count.

It may be that this invariant is not particularly useful, that things will just work out.
But I do wonder if, without it, we'll have situations where the dirty counts will indicate
dirty pages when there are none, or no dirty pages when there are some.

>
> > +typedef int (*hash_pfn_callback_t)(struct vcpu *v,
> > +                                   mfn_t smfn,
> > +                                   unsigned long begin_pfn,
> > +                                   unsigned long end_pfn,
> > +                                   int *removed);
> > +
> > +static int hash_pfn_foreach(struct vcpu *v,
> > +                            unsigned int callback_mask,
> > +                            hash_pfn_callback_t callbacks[],
> > +                            unsigned long begin_pfn,
> > +                            unsigned long end_pfn)
> > +/* Walk the hash table looking at the types of the entries and
> > + * calling the appropriate callback function for each entry.
> > + * The mask determines which shadow types we call back for, and the
> array
> > + * of callbacks tells us which function to call.
> > + * Any callback may return non-zero to let us skip the rest of the scan.
> > + *
> > + * WARNING: Callbacks MUST NOT add or remove hash entries unless
> they
> > + * then return non-zero to terminate the scan. */
>
> This code duplication is a bit much.  I think you should recast the
> existing hash_foreach() function to take a pointer as its fourth
> argument instead of an MFN, and then make the existing callers just cast
> their MFN argument as a pointer.   The you can use the same function,
> passing a pointer to a struct { begin, end, removed }.
>
> Please make the changes to hash_foreach() in a separate patch from the
> dirty_vram stuff.

Yes, I'd be happy to submit a patch as you suggest after we're done with this one.

>
> > @@ -1211,12 +1164,14 @@ static int shadow_set_l1e(struct vcpu *v,
> >                  shadow_l1e_remove_flags(new_sl1e, _PAGE_RW);
> >                  /* fall through */
> >              case 0:
> > -                shadow_vram_get_l1e(new_sl1e, sl1e, sl1mfn, d);
> > +                shadow_vram_fix_l1e(old_sl1e, new_sl1e, sl1e, sl1mfn, d);
> >                  break;
> >              }
> >          }
> >      }
> >
> > +    shadow_vram_fix_l1e(old_sl1e, new_sl1e, sl1e, sl1mfn, d);
>
> Why is this being called twice here?

Stupidity.  I've eliminated the first of the two.

>
> Cheers,
>
> Tim.

Thanks again.
-- rsp

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 20:54:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 20:54:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWCdv-0000tr-Bm; Wed, 07 Nov 2012 20:54:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1TWCdt-0000tm-TG
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 20:54:34 +0000
Received: from [85.158.143.99:64803] by server-1.bemta-4.messagelabs.com id
	AB/03-27934-98ACA905; Wed, 07 Nov 2012 20:54:33 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-4.tower-216.messagelabs.com!1352321657!23766159!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31103 invoked from network); 7 Nov 2012 20:54:22 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 20:54:22 -0000
Received: by mail-ie0-f173.google.com with SMTP id 17so3696835iea.32
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 12:54:17 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=from:content-type:content-transfer-encoding:subject:message-id:date
	:to:mime-version:x-mailer:x-gm-message-state;
	bh=VhoPIxArh3rHTeiGGJuddyYE4dP8L5DN8vRThZScFJc=;
	b=OIG3i6eSYhnqL31pvSrJj29gKuFnWgPgP21PZJoC+t2NhhO2r6z3Fh6U3eLjNX8q6c
	1bmlXULHp2YCmzmXMUuQFyMAwj0bYPnN9yiRm4A45EJdGm3kUVqSL4WRtWqWFDKAJavC
	bvOV9TDoZbapxiU48Cn6nSpuCre6+1FjE7xgtOKHgPPhj6/ABkRDX3mXEd5TK++Gqy0Q
	JnlxXwyLVKj1h4ruQ3GQ1wu9HRadPlIs+EIok5h96uJifwaQzJ0WLhqTKjtX84DhBlQY
	gqc+DI0u9RTR6qlSn0AvYVNMO542NdKyeXM1JIDVLgDJlYiFwS1VGfG99d4TZYbX0r0u
	GsBw==
Received: by 10.50.219.129 with SMTP id po1mr17694418igc.35.1352321656922;
	Wed, 07 Nov 2012 12:54:16 -0800 (PST)
Received: from [192.168.4.87] ([206.223.182.18])
	by mx.google.com with ESMTPS id o9sm2774086igd.7.2012.11.07.12.54.15
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 07 Nov 2012 12:54:16 -0800 (PST)
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
Message-Id: <521A2B7F-054A-4CFC-9631-615CC7444595@gridcentric.ca>
Date: Wed, 7 Nov 2012 15:54:22 -0500
To: Tim Deegan <tim@xen.org>, "Keir (Xen.org)" <keir@xen.org>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQk9W6ApSFSZqRvWxH6REIaXdQF2af9tCbCHkW/7TkY5d6s4Np+hI97RZm1ZEbbF/U5uwreS
Subject: [Xen-devel] Wait Queues
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi all,
we currently have a problem in the (x86) mm layer. Callers may request the p2m to perform a translation of a gfn to an mfn. Such translation may need to wait for a third party to service it. This happens when:

- a page needs to be paged in
- a CoW breaking of a shared page fails due to lack of memory

Note that paging in may also fail due to lack of memory. In both ENOMEM cases, all the plumbing for a toolstack to be notified and take some corrective action to release some memory and retry is in place. We also have plumbing for pagers in place.

Ideally we want the internals to be self-contained, so that callers need not be concerned with any of this. A request for a p2m translation may or may not sleep, but on exit from the p2m the caller either has an mfn with a page ref, or an error code due to some other condition.

Wait queue support in (x86) Xen prevents sleeping on a wait queue if any locks are held, including RCU read-side locks (i.e. BUG_ON(!in_atomic()).

For this reason, we have not yet implemented sleeping on the p2m. Callers may get errors telling them to retry. A lot of (imho) ugly code is peppered around the hypervisor to deal with the consequences of this. More fundamentally, in some cases there is no possible elegant handling, and guests are crashed (for example, if a page table page is paged out and the hypervisor needs to translate a guest virtual address to a gfn). This limits the applicability of memory paging and sharing.

One way to solve this would be to ensure no code path liable to sleep in a wait queue is holding any locks at wait queue sleep time. I believe this is doomed. Not just because this is a herculean task. It also makes writing hypervisor code *very* difficult. Anyone trying to throw a p2m translation into a code path needs to think of all possible upstream call sequences. Not even RCU read locks are allowed.

I'd like to propose an approach that ensures that as long some properties are met, arbitrary wait queue sleep is allowed. Here are the properties:
1. Third parties servicing a wait queue sleep are indeed third parties. In other words, dom0 does not do paging.
2. Vcpus of a wait queue servicing domain may never go to sleep on a wait queue during a foreign map.
3. A guest vcpu may go to sleep on a wait queue holding any kinds of locks as long as it does not hold the p2m lock.
4. "Kick" routines in the hypervisor by which service domains effectively wake up a vcpu may only take the p2m lock to do a fix up of the p2m.
5. Wait queues can be awakened on a special domain destroy condition.

Property 1. is hopefully self-evident, and although not enforced in the code it is reasonably simple to do so.

Property 2. is also self-evident and enforced in the code today.

Property 3. simplifies reasoning about p2m translations and wait queue sleeping. Provides a clean model for reasoning about what might or might not happen. It will require us to restructure some code paths (i.e. XENMEM_add_to_physmap) that require multiple p2m translations in a single critical region to perform all translations up front.

Property 4. is already enforced in the code as is right now.

Property 5. needs adding some logic to the top of domain destruction: set a flag, wake up all vcpus in wait queues. Extra logic on the wait queue side will exit the wait if the destroy flag is set, with an error. Most if not all callers can deal right now with a p2m translation error (other than paging), and unwind and release all their locks.

I confess my understanding of RCU is not 100% there and I am not sure what will happen to force_quiescent_state. I also understand there is a impedance mismatch wrt to "saving" and "restoring" the physical CPU preempt count.

Thanks,
Andres
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 20:54:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 20:54:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWCdv-0000tr-Bm; Wed, 07 Nov 2012 20:54:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1TWCdt-0000tm-TG
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 20:54:34 +0000
Received: from [85.158.143.99:64803] by server-1.bemta-4.messagelabs.com id
	AB/03-27934-98ACA905; Wed, 07 Nov 2012 20:54:33 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-4.tower-216.messagelabs.com!1352321657!23766159!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31103 invoked from network); 7 Nov 2012 20:54:22 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 20:54:22 -0000
Received: by mail-ie0-f173.google.com with SMTP id 17so3696835iea.32
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 12:54:17 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=from:content-type:content-transfer-encoding:subject:message-id:date
	:to:mime-version:x-mailer:x-gm-message-state;
	bh=VhoPIxArh3rHTeiGGJuddyYE4dP8L5DN8vRThZScFJc=;
	b=OIG3i6eSYhnqL31pvSrJj29gKuFnWgPgP21PZJoC+t2NhhO2r6z3Fh6U3eLjNX8q6c
	1bmlXULHp2YCmzmXMUuQFyMAwj0bYPnN9yiRm4A45EJdGm3kUVqSL4WRtWqWFDKAJavC
	bvOV9TDoZbapxiU48Cn6nSpuCre6+1FjE7xgtOKHgPPhj6/ABkRDX3mXEd5TK++Gqy0Q
	JnlxXwyLVKj1h4ruQ3GQ1wu9HRadPlIs+EIok5h96uJifwaQzJ0WLhqTKjtX84DhBlQY
	gqc+DI0u9RTR6qlSn0AvYVNMO542NdKyeXM1JIDVLgDJlYiFwS1VGfG99d4TZYbX0r0u
	GsBw==
Received: by 10.50.219.129 with SMTP id po1mr17694418igc.35.1352321656922;
	Wed, 07 Nov 2012 12:54:16 -0800 (PST)
Received: from [192.168.4.87] ([206.223.182.18])
	by mx.google.com with ESMTPS id o9sm2774086igd.7.2012.11.07.12.54.15
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 07 Nov 2012 12:54:16 -0800 (PST)
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
Message-Id: <521A2B7F-054A-4CFC-9631-615CC7444595@gridcentric.ca>
Date: Wed, 7 Nov 2012 15:54:22 -0500
To: Tim Deegan <tim@xen.org>, "Keir (Xen.org)" <keir@xen.org>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQk9W6ApSFSZqRvWxH6REIaXdQF2af9tCbCHkW/7TkY5d6s4Np+hI97RZm1ZEbbF/U5uwreS
Subject: [Xen-devel] Wait Queues
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi all,
we currently have a problem in the (x86) mm layer. Callers may request the p2m to perform a translation of a gfn to an mfn. Such translation may need to wait for a third party to service it. This happens when:

- a page needs to be paged in
- a CoW breaking of a shared page fails due to lack of memory

Note that paging in may also fail due to lack of memory. In both ENOMEM cases, all the plumbing for a toolstack to be notified and take some corrective action to release some memory and retry is in place. We also have plumbing for pagers in place.

Ideally we want the internals to be self-contained, so that callers need not be concerned with any of this. A request for a p2m translation may or may not sleep, but on exit from the p2m the caller either has an mfn with a page ref, or an error code due to some other condition.

Wait queue support in (x86) Xen prevents sleeping on a wait queue if any locks are held, including RCU read-side locks (i.e. BUG_ON(!in_atomic()).

For this reason, we have not yet implemented sleeping on the p2m. Callers may get errors telling them to retry. A lot of (imho) ugly code is peppered around the hypervisor to deal with the consequences of this. More fundamentally, in some cases there is no possible elegant handling, and guests are crashed (for example, if a page table page is paged out and the hypervisor needs to translate a guest virtual address to a gfn). This limits the applicability of memory paging and sharing.

One way to solve this would be to ensure no code path liable to sleep in a wait queue is holding any locks at wait queue sleep time. I believe this is doomed. Not just because this is a herculean task. It also makes writing hypervisor code *very* difficult. Anyone trying to throw a p2m translation into a code path needs to think of all possible upstream call sequences. Not even RCU read locks are allowed.

I'd like to propose an approach that ensures that as long some properties are met, arbitrary wait queue sleep is allowed. Here are the properties:
1. Third parties servicing a wait queue sleep are indeed third parties. In other words, dom0 does not do paging.
2. Vcpus of a wait queue servicing domain may never go to sleep on a wait queue during a foreign map.
3. A guest vcpu may go to sleep on a wait queue holding any kinds of locks as long as it does not hold the p2m lock.
4. "Kick" routines in the hypervisor by which service domains effectively wake up a vcpu may only take the p2m lock to do a fix up of the p2m.
5. Wait queues can be awakened on a special domain destroy condition.

Property 1. is hopefully self-evident, and although not enforced in the code it is reasonably simple to do so.

Property 2. is also self-evident and enforced in the code today.

Property 3. simplifies reasoning about p2m translations and wait queue sleeping. Provides a clean model for reasoning about what might or might not happen. It will require us to restructure some code paths (i.e. XENMEM_add_to_physmap) that require multiple p2m translations in a single critical region to perform all translations up front.

Property 4. is already enforced in the code as is right now.

Property 5. needs adding some logic to the top of domain destruction: set a flag, wake up all vcpus in wait queues. Extra logic on the wait queue side will exit the wait if the destroy flag is set, with an error. Most if not all callers can deal right now with a p2m translation error (other than paging), and unwind and release all their locks.

I confess my understanding of RCU is not 100% there and I am not sure what will happen to force_quiescent_state. I also understand there is a impedance mismatch wrt to "saving" and "restoring" the physical CPU preempt count.

Thanks,
Andres
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 22:18:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 22:18:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWDwb-0001jP-Rc; Wed, 07 Nov 2012 22:17:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TWDwa-0001jK-9e
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 22:17:56 +0000
Received: from [85.158.143.35:15809] by server-3.bemta-4.messagelabs.com id
	BE/2C-06841-31EDA905; Wed, 07 Nov 2012 22:17:55 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1352326670!14966792!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0NzE2Mw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1973 invoked from network); 7 Nov 2012 22:17:52 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 7 Nov 2012 22:17:52 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA7MHaWh004402
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 7 Nov 2012 22:17:37 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA7MHYZo021772
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 7 Nov 2012 22:17:35 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA7MHYpf025941; Wed, 7 Nov 2012 16:17:34 -0600
MIME-Version: 1.0
Message-ID: <7563be37-62f1-472e-9aec-1d0c55fa7c29@default>
Date: Wed, 7 Nov 2012 14:17:32 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<509791F902000078000A64D4@nat28.tlf.novell.com>
In-Reply-To: <509791F902000078000A64D4@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Subject: RE: Proposed new "memory capacity claim" hypercall/feature
> 
> > Aren't we getting a little sidetracked here?  (Maybe my fault for
> > looking at whether this specific loop is fast enough...)
> >
> > This loop handles only order=N chunks of RAM.  Speeding up this
> > loop and holding the heap_lock here for a shorter period only helps
> > the TOCTOU race if the entire domain can be allocated as a
> > single order-N allocation.
> >
> > Domain creation is supposed to succeed as long as there is
> > sufficient RAM, _regardless_ of the state of memory fragmentation,
> > correct?
> >
> > So unless the code for the _entire_ memory allocation path can
> > be optimized so that the heap_lock can be held across _all_ the
> > allocations necessary to create an arbitrary-sized domain, for
> > any arbitrary state of memory fragmentation, the original
> > problem has not been solved.
> >
> > Or am I misunderstanding?
> 
> I think we got here via questioning whether suppressing certain
> activities (like tmem causing the allocator visible amount of
> available memory) for a brief period of time would be acceptable,
> and while that indeed depends on the overall latency of memory
> allocation for the domain as a whole, I would be somewhat
> tolerant for it to involve a longer suspension period on a highly
> fragmented system.
> 
> But of course, if this can be made work uniformly, that would be
> preferred.

Hi Jan and Keir --

OK, here's a status update.  Sorry for the delay but it took awhile
for me to refamiliarize myself with the code paths.

It appears that the attempt to use 2MB and 1GB pages is done in
the toolstack, and if the hypervisor rejects it, toolstack tries
smaller pages.  Thus, if physical memory is highly fragmented
(few or no order>=9 allocations available), this will result
in one hypercall per 4k page so a 256GB domain would require
64 million hypercalls.  And, since AFAICT, there is no sane
way to hold the heap_lock across even two hypercalls, speeding
up the in-hypervisor allocation path, by itself, will not solve
the TOCTOU race.

One option to avoid the 64M hypercalls is to change the Xen ABI to
add a new memory hypercall/subop to populate_physmap an arbitrary
amount of physical RAM, and have Xen (optionally) try order==18, then
order==9, then order==0.  I suspect that, even with the overhead
of hypercalls removed, the steps required to allocate 64 million pages
(including, for example, removing a page from a xen list
and adding it to the domain's page list) will consume enough time
that holding the heap_lock and/or suppressing micro-allocations for
the entire macro-allocation on a fragmented system will still be
unacceptable (e.g. at least tens of seconds).  However, I am
speculating, and I think I can measure it if you (Jan or Keir)
feel a measurement is necessary to fully convince you.

I think this brings us back to the proposed "claim" hypercall/subop.
Unless there are further objections or suggestions for different
approaches, I'll commence prototyping it, OK?

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 22:18:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 22:18:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWDwb-0001jP-Rc; Wed, 07 Nov 2012 22:17:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TWDwa-0001jK-9e
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 22:17:56 +0000
Received: from [85.158.143.35:15809] by server-3.bemta-4.messagelabs.com id
	BE/2C-06841-31EDA905; Wed, 07 Nov 2012 22:17:55 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1352326670!14966792!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0NzE2Mw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1973 invoked from network); 7 Nov 2012 22:17:52 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 7 Nov 2012 22:17:52 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA7MHaWh004402
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 7 Nov 2012 22:17:37 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA7MHYZo021772
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 7 Nov 2012 22:17:35 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA7MHYpf025941; Wed, 7 Nov 2012 16:17:34 -0600
MIME-Version: 1.0
Message-ID: <7563be37-62f1-472e-9aec-1d0c55fa7c29@default>
Date: Wed, 7 Nov 2012 14:17:32 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<509791F902000078000A64D4@nat28.tlf.novell.com>
In-Reply-To: <509791F902000078000A64D4@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Subject: RE: Proposed new "memory capacity claim" hypercall/feature
> 
> > Aren't we getting a little sidetracked here?  (Maybe my fault for
> > looking at whether this specific loop is fast enough...)
> >
> > This loop handles only order=N chunks of RAM.  Speeding up this
> > loop and holding the heap_lock here for a shorter period only helps
> > the TOCTOU race if the entire domain can be allocated as a
> > single order-N allocation.
> >
> > Domain creation is supposed to succeed as long as there is
> > sufficient RAM, _regardless_ of the state of memory fragmentation,
> > correct?
> >
> > So unless the code for the _entire_ memory allocation path can
> > be optimized so that the heap_lock can be held across _all_ the
> > allocations necessary to create an arbitrary-sized domain, for
> > any arbitrary state of memory fragmentation, the original
> > problem has not been solved.
> >
> > Or am I misunderstanding?
> 
> I think we got here via questioning whether suppressing certain
> activities (like tmem causing the allocator visible amount of
> available memory) for a brief period of time would be acceptable,
> and while that indeed depends on the overall latency of memory
> allocation for the domain as a whole, I would be somewhat
> tolerant for it to involve a longer suspension period on a highly
> fragmented system.
> 
> But of course, if this can be made work uniformly, that would be
> preferred.

Hi Jan and Keir --

OK, here's a status update.  Sorry for the delay but it took awhile
for me to refamiliarize myself with the code paths.

It appears that the attempt to use 2MB and 1GB pages is done in
the toolstack, and if the hypervisor rejects it, toolstack tries
smaller pages.  Thus, if physical memory is highly fragmented
(few or no order>=9 allocations available), this will result
in one hypercall per 4k page so a 256GB domain would require
64 million hypercalls.  And, since AFAICT, there is no sane
way to hold the heap_lock across even two hypercalls, speeding
up the in-hypervisor allocation path, by itself, will not solve
the TOCTOU race.

One option to avoid the 64M hypercalls is to change the Xen ABI to
add a new memory hypercall/subop to populate_physmap an arbitrary
amount of physical RAM, and have Xen (optionally) try order==18, then
order==9, then order==0.  I suspect that, even with the overhead
of hypercalls removed, the steps required to allocate 64 million pages
(including, for example, removing a page from a xen list
and adding it to the domain's page list) will consume enough time
that holding the heap_lock and/or suppressing micro-allocations for
the entire macro-allocation on a fragmented system will still be
unacceptable (e.g. at least tens of seconds).  However, I am
speculating, and I think I can measure it if you (Jan or Keir)
feel a measurement is necessary to fully convince you.

I think this brings us back to the proposed "claim" hypercall/subop.
Unless there are further objections or suggestions for different
approaches, I'll commence prototyping it, OK?

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 22:55:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 22:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWEWF-0001zh-Sm; Wed, 07 Nov 2012 22:54:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bmeyres@gmail.com>) id 1TWCZD-0000rj-QA
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 20:49:43 +0000
Received: from [85.158.143.35:3297] by server-1.bemta-4.messagelabs.com id
	BC/E0-27934-769CA905; Wed, 07 Nov 2012 20:49:43 +0000
X-Env-Sender: bmeyres@gmail.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1352321382!14234367!1
X-Originating-IP: [209.85.212.179]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_10_20,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30646 invoked from network); 7 Nov 2012 20:49:42 -0000
Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com)
	(209.85.212.179)
	by server-8.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 20:49:42 -0000
Received: by mail-wi0-f179.google.com with SMTP id hm6so402654wib.14
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 12:49:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=Q0RmtUIHwT23uerz7RFVg7ai8mtsxYfPME+FAIbYPag=;
	b=JdmpMJfTuzrkwsZOe9Rn9vJI+nUUApdgVXw/UAskbGBQ1s0juSrziQ7nKdB6b1bUzu
	HcUfT1CuMTW0lMrSKAnpWNNh5dn4yZTL511/PdgbqM26WtNQoDcGR/A6Bp2mcTUE8q+b
	mU2JpDvoy1E36Hxj8Vp8m5QBv1B1+wAVdln2kd1/Kl9ih5txJgsqZXqAUpzrQdjvAMY9
	63gMeEyxOaXWxuCJcYJNbVXNk1yRQjsZstOfpalQNd1sjgTnV+1JdXEaip6km37BwB6n
	MUhMcsTs+Ymtk9pmKmMKDpHEfG0PsPws3UPWRtm710nDqOrqfRodgsmqzkXfKHcC14Bd
	deOQ==
MIME-Version: 1.0
Received: by 10.216.209.40 with SMTP id r40mr2456270weo.144.1352321382326;
	Wed, 07 Nov 2012 12:49:42 -0800 (PST)
Received: by 10.216.106.130 with HTTP; Wed, 7 Nov 2012 12:49:42 -0800 (PST)
Date: Wed, 7 Nov 2012 20:49:42 +0000
Message-ID: <CACuBF8+ZW1ckpMRuouTy+=SMBOfM_GA6-NiODCgXTCZ9GpXvww@mail.gmail.com>
From: Ben Eyres <bmeyres@gmail.com>
To: xen-devel@lists.xen.org
X-Mailman-Approved-At: Wed, 07 Nov 2012 22:54:47 +0000
Subject: [Xen-devel] Virtual Networking
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0467306419086526176=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0467306419086526176==
Content-Type: multipart/alternative; boundary=0016e6d9a1189d9fe804cdeddb61

--0016e6d9a1189d9fe804cdeddb61
Content-Type: text/plain; charset=ISO-8859-1

Hello,

This is probably quite a vague and simple question but here goes...Can
anyone tell me where in the Xen-4.2.0 source files i can find source code
for the virtual switching (Vif/Pif')? This is the first time i have worked
with the Xen source code so struggling to work my way around the system.

Thanks very much!!
Ben

--0016e6d9a1189d9fe804cdeddb61
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>Hello,</div><div><br></div>This is probably quite a vague and simple q=
uestion but here goes...Can anyone tell me where in the Xen-4.2.0 source fi=
les i can find source code for the virtual switching (Vif/Pif&#39;)? This i=
s the first time i have worked with the Xen source code so struggling to wo=
rk my way around the system.<div>
<br></div><div>Thanks very much!!</div><div>Ben</div>

--0016e6d9a1189d9fe804cdeddb61--


--===============0467306419086526176==
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.xen.org
http://lists.xen.org/xen-devel

--===============0467306419086526176==--


From xen-devel-bounces@lists.xen.org Wed Nov 07 22:55:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 22:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWEWF-0001zh-Sm; Wed, 07 Nov 2012 22:54:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bmeyres@gmail.com>) id 1TWCZD-0000rj-QA
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 20:49:43 +0000
Received: from [85.158.143.35:3297] by server-1.bemta-4.messagelabs.com id
	BC/E0-27934-769CA905; Wed, 07 Nov 2012 20:49:43 +0000
X-Env-Sender: bmeyres@gmail.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1352321382!14234367!1
X-Originating-IP: [209.85.212.179]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_10_20,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30646 invoked from network); 7 Nov 2012 20:49:42 -0000
Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com)
	(209.85.212.179)
	by server-8.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 20:49:42 -0000
Received: by mail-wi0-f179.google.com with SMTP id hm6so402654wib.14
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 12:49:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=Q0RmtUIHwT23uerz7RFVg7ai8mtsxYfPME+FAIbYPag=;
	b=JdmpMJfTuzrkwsZOe9Rn9vJI+nUUApdgVXw/UAskbGBQ1s0juSrziQ7nKdB6b1bUzu
	HcUfT1CuMTW0lMrSKAnpWNNh5dn4yZTL511/PdgbqM26WtNQoDcGR/A6Bp2mcTUE8q+b
	mU2JpDvoy1E36Hxj8Vp8m5QBv1B1+wAVdln2kd1/Kl9ih5txJgsqZXqAUpzrQdjvAMY9
	63gMeEyxOaXWxuCJcYJNbVXNk1yRQjsZstOfpalQNd1sjgTnV+1JdXEaip6km37BwB6n
	MUhMcsTs+Ymtk9pmKmMKDpHEfG0PsPws3UPWRtm710nDqOrqfRodgsmqzkXfKHcC14Bd
	deOQ==
MIME-Version: 1.0
Received: by 10.216.209.40 with SMTP id r40mr2456270weo.144.1352321382326;
	Wed, 07 Nov 2012 12:49:42 -0800 (PST)
Received: by 10.216.106.130 with HTTP; Wed, 7 Nov 2012 12:49:42 -0800 (PST)
Date: Wed, 7 Nov 2012 20:49:42 +0000
Message-ID: <CACuBF8+ZW1ckpMRuouTy+=SMBOfM_GA6-NiODCgXTCZ9GpXvww@mail.gmail.com>
From: Ben Eyres <bmeyres@gmail.com>
To: xen-devel@lists.xen.org
X-Mailman-Approved-At: Wed, 07 Nov 2012 22:54:47 +0000
Subject: [Xen-devel] Virtual Networking
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0467306419086526176=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0467306419086526176==
Content-Type: multipart/alternative; boundary=0016e6d9a1189d9fe804cdeddb61

--0016e6d9a1189d9fe804cdeddb61
Content-Type: text/plain; charset=ISO-8859-1

Hello,

This is probably quite a vague and simple question but here goes...Can
anyone tell me where in the Xen-4.2.0 source files i can find source code
for the virtual switching (Vif/Pif')? This is the first time i have worked
with the Xen source code so struggling to work my way around the system.

Thanks very much!!
Ben

--0016e6d9a1189d9fe804cdeddb61
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>Hello,</div><div><br></div>This is probably quite a vague and simple q=
uestion but here goes...Can anyone tell me where in the Xen-4.2.0 source fi=
les i can find source code for the virtual switching (Vif/Pif&#39;)? This i=
s the first time i have worked with the Xen source code so struggling to wo=
rk my way around the system.<div>
<br></div><div>Thanks very much!!</div><div>Ben</div>

--0016e6d9a1189d9fe804cdeddb61--


--===============0467306419086526176==
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.xen.org
http://lists.xen.org/xen-devel

--===============0467306419086526176==--


From xen-devel-bounces@lists.xen.org Wed Nov 07 23:33:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 23:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWF7V-0002Lb-As; Wed, 07 Nov 2012 23:33:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <joseph.glanville@orionvm.com.au>) id 1TWF7T-0002LW-KI
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 23:33:15 +0000
Received: from [85.158.143.35:5942] by server-1.bemta-4.messagelabs.com id
	79/62-27934-ABFEA905; Wed, 07 Nov 2012 23:33:14 +0000
X-Env-Sender: joseph.glanville@orionvm.com.au
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352331192!12700870!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3178 invoked from network); 7 Nov 2012 23:33:13 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 23:33:13 -0000
Received: by mail-ie0-f173.google.com with SMTP id 17so3950699iea.32
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 15:33:10 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:x-originating-ip:in-reply-to:references:date
	:message-id:subject:from:to:cc:content-type:x-gm-message-state;
	bh=4WR14jUDB+HWDU7Nf2zUVkdMfhPVVJwrAYYhAkVjXoI=;
	b=S9sjaStb6XGscni+nv4SmKF1I6d1YRTACHipAo6pUDXIomMJ0ado7+Q8TrE4HZjFel
	gYyKeYx3pyAISZy0ZHMhYWaaQe47sGLRYBklXGuqZ93D7+TOJUzGlAF5KdXmfnQg+0ja
	EFzdj0yWfy/nK2nekXU/BkdNj6DSWl0rY9JfKo0I9i98DQk7lA1lriyz8bWe2ow3PX1/
	T3pFw05clD7q4xKOMOiJqvKRiyxOT4lAhgsS18rUcUTUBd20Ea+SRX7zbkL2WvIk7C1c
	TqYTcJjwVmO9n7AU1xzEMnMhmrhgwJDIiNtCYomj/xVNIa0y0NReZ6No0dSqy3ibOdi2
	KCBw==
MIME-Version: 1.0
Received: by 10.50.168.10 with SMTP id zs10mr3779480igb.31.1352331190573; Wed,
	07 Nov 2012 15:33:10 -0800 (PST)
Received: by 10.50.20.165 with HTTP; Wed, 7 Nov 2012 15:33:10 -0800 (PST)
X-Originating-IP: [121.44.2.128]
In-Reply-To: <CACuBF8+ZW1ckpMRuouTy+=SMBOfM_GA6-NiODCgXTCZ9GpXvww@mail.gmail.com>
References: <CACuBF8+ZW1ckpMRuouTy+=SMBOfM_GA6-NiODCgXTCZ9GpXvww@mail.gmail.com>
Date: Thu, 8 Nov 2012 10:33:10 +1100
Message-ID: <CAOzFzEgq_pnyeV6=FT4bWAvuyAA4VT5fxdD3HtcjgkWyRgai2Q@mail.gmail.com>
From: Joseph Glanville <joseph.glanville@orionvm.com.au>
To: Ben Eyres <bmeyres@gmail.com>
X-Gm-Message-State: ALoCoQmFoVpeawOtyrgtKD0tsgBO3jKH3VujCCRKw8gvu6bTrR0CcYUW47Ex16TRVA3WfUAjpEai
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Virtual Networking
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 8 November 2012 07:49, Ben Eyres <bmeyres@gmail.com> wrote:
> Hello,
>
> This is probably quite a vague and simple question but here goes...Can
> anyone tell me where in the Xen-4.2.0 source files i can find source code
> for the virtual switching (Vif/Pif')? This is the first time i have worked
> with the Xen source code so struggling to work my way around the system.

The virtual switching is not done by Xen but rather by the Linux
bridge module or Open vSwitch etc.
If you are interested in how virtual adapters are created and packets
transfered from domU to domO I suggest looking at the Linux source
tree in drivers/net/ for netback/netfront.

>
> Thanks very much!!
> Ben
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>



-- 
CTO | Orion Virtualisation Solutions | www.orionvm.com.au
Phone: 1300 56 99 52 | Mobile: 0428 754 846

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 07 23:33:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Nov 2012 23:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWF7V-0002Lb-As; Wed, 07 Nov 2012 23:33:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <joseph.glanville@orionvm.com.au>) id 1TWF7T-0002LW-KI
	for xen-devel@lists.xen.org; Wed, 07 Nov 2012 23:33:15 +0000
Received: from [85.158.143.35:5942] by server-1.bemta-4.messagelabs.com id
	79/62-27934-ABFEA905; Wed, 07 Nov 2012 23:33:14 +0000
X-Env-Sender: joseph.glanville@orionvm.com.au
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352331192!12700870!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3178 invoked from network); 7 Nov 2012 23:33:13 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	7 Nov 2012 23:33:13 -0000
Received: by mail-ie0-f173.google.com with SMTP id 17so3950699iea.32
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 15:33:10 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:x-originating-ip:in-reply-to:references:date
	:message-id:subject:from:to:cc:content-type:x-gm-message-state;
	bh=4WR14jUDB+HWDU7Nf2zUVkdMfhPVVJwrAYYhAkVjXoI=;
	b=S9sjaStb6XGscni+nv4SmKF1I6d1YRTACHipAo6pUDXIomMJ0ado7+Q8TrE4HZjFel
	gYyKeYx3pyAISZy0ZHMhYWaaQe47sGLRYBklXGuqZ93D7+TOJUzGlAF5KdXmfnQg+0ja
	EFzdj0yWfy/nK2nekXU/BkdNj6DSWl0rY9JfKo0I9i98DQk7lA1lriyz8bWe2ow3PX1/
	T3pFw05clD7q4xKOMOiJqvKRiyxOT4lAhgsS18rUcUTUBd20Ea+SRX7zbkL2WvIk7C1c
	TqYTcJjwVmO9n7AU1xzEMnMhmrhgwJDIiNtCYomj/xVNIa0y0NReZ6No0dSqy3ibOdi2
	KCBw==
MIME-Version: 1.0
Received: by 10.50.168.10 with SMTP id zs10mr3779480igb.31.1352331190573; Wed,
	07 Nov 2012 15:33:10 -0800 (PST)
Received: by 10.50.20.165 with HTTP; Wed, 7 Nov 2012 15:33:10 -0800 (PST)
X-Originating-IP: [121.44.2.128]
In-Reply-To: <CACuBF8+ZW1ckpMRuouTy+=SMBOfM_GA6-NiODCgXTCZ9GpXvww@mail.gmail.com>
References: <CACuBF8+ZW1ckpMRuouTy+=SMBOfM_GA6-NiODCgXTCZ9GpXvww@mail.gmail.com>
Date: Thu, 8 Nov 2012 10:33:10 +1100
Message-ID: <CAOzFzEgq_pnyeV6=FT4bWAvuyAA4VT5fxdD3HtcjgkWyRgai2Q@mail.gmail.com>
From: Joseph Glanville <joseph.glanville@orionvm.com.au>
To: Ben Eyres <bmeyres@gmail.com>
X-Gm-Message-State: ALoCoQmFoVpeawOtyrgtKD0tsgBO3jKH3VujCCRKw8gvu6bTrR0CcYUW47Ex16TRVA3WfUAjpEai
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Virtual Networking
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 8 November 2012 07:49, Ben Eyres <bmeyres@gmail.com> wrote:
> Hello,
>
> This is probably quite a vague and simple question but here goes...Can
> anyone tell me where in the Xen-4.2.0 source files i can find source code
> for the virtual switching (Vif/Pif')? This is the first time i have worked
> with the Xen source code so struggling to work my way around the system.

The virtual switching is not done by Xen but rather by the Linux
bridge module or Open vSwitch etc.
If you are interested in how virtual adapters are created and packets
transfered from domU to domO I suggest looking at the Linux source
tree in drivers/net/ for netback/netfront.

>
> Thanks very much!!
> Ben
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>



-- 
CTO | Orion Virtualisation Solutions | www.orionvm.com.au
Phone: 1300 56 99 52 | Mobile: 0428 754 846

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 01:22:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 01:22:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWGof-0006vr-Ka; Thu, 08 Nov 2012 01:21:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TWGod-0006vm-QS
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 01:21:56 +0000
Received: from [85.158.137.99:25814] by server-5.bemta-3.messagelabs.com id
	0A/C9-26311-E290B905; Thu, 08 Nov 2012 01:21:50 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1352337708!18195291!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0NzE2Mw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1668 invoked from network); 8 Nov 2012 01:21:49 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-16.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 01:21:49 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA81LOCd030236
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 8 Nov 2012 01:21:25 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA81LNjv004998
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 8 Nov 2012 01:21:24 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA81LNWK003666; Wed, 7 Nov 2012 19:21:23 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 07 Nov 2012 17:21:23 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id E4E664019F; Wed,  7 Nov 2012 20:08:36 -0500 (EST)
Date: Wed, 7 Nov 2012 20:08:36 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Message-ID: <20121108010836.GB21302@phenom.dumpdata.com>
References: <20121102164937.GC27213@konrad-lan.dumpdata.com>
	<alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537B147@SHSMSX101.ccr.corp.intel.com>
	<alpine.DEB.2.02.1211061455150.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B479@SHSMSX101.ccr.corp.intel.com>
	<20121106164303.GO9966@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC829233537B99E@SHSMSX101.ccr.corp.intel.com>
	<20121107160301.GF18615@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC829233537BB2F@SHSMSX101.ccr.corp.intel.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233537BB2F@SHSMSX101.ccr.corp.intel.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 07, 2012 at 04:52:50PM +0000, Liu, Jinsong wrote:
> Konrad Rzeszutek Wilk wrote:
> > On Wed, Nov 07, 2012 at 12:58:19PM +0000, Liu, Jinsong wrote:
> >>>>> 
> >>>>> If it is generic ACPI code, than it can depend only on ACPI.
> >>>>> If it is ACPI code that contains X86 specific info, than it needs
> >>>>> to depend on X86 too.
> >>>> 
> >>>> No x86 specific so let's depend on ACPI.
> >>> 
> >>> Huh? This feature is x86 specific isn't it? I mean it is in the ACPI
> >>> spec, but only x86 does it right?
> >> 
> >> OK, updated w/ ACPI & X86 dependency, and per other comments.
> > 
> > Ok. Could you send all the patchset in one go. I am bit lost of which
> > one to review as none of them seem to have the version information
> > [vX: Did this yyy]
> 
> Not quite clear your meaning, do you mean not reply old email and start a new thread with title like
> [PATCH vX 1/2]: xen/acpi: ACPI PAD driver
> [PATCH vX 2/2]: ...

Have you ever used git-send email? If you repost them all it comes out threaded
and it makes it easy to apply the whole patchset in one go.

> ?
> 
> > 
> > right above your name or in the title:
> > [PATCH vX 1/2]: yyyy
> > 
> > anyhow, some comments below.
> > 
> 
> OK.
> 
> Thanks,
> Jinsong

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 01:22:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 01:22:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWGof-0006vr-Ka; Thu, 08 Nov 2012 01:21:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TWGod-0006vm-QS
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 01:21:56 +0000
Received: from [85.158.137.99:25814] by server-5.bemta-3.messagelabs.com id
	0A/C9-26311-E290B905; Thu, 08 Nov 2012 01:21:50 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1352337708!18195291!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0NzE2Mw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1668 invoked from network); 8 Nov 2012 01:21:49 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-16.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 01:21:49 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA81LOCd030236
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 8 Nov 2012 01:21:25 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA81LNjv004998
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 8 Nov 2012 01:21:24 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA81LNWK003666; Wed, 7 Nov 2012 19:21:23 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 07 Nov 2012 17:21:23 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id E4E664019F; Wed,  7 Nov 2012 20:08:36 -0500 (EST)
Date: Wed, 7 Nov 2012 20:08:36 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Message-ID: <20121108010836.GB21302@phenom.dumpdata.com>
References: <20121102164937.GC27213@konrad-lan.dumpdata.com>
	<alpine.DEB.2.02.1211051512260.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B10C@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233537B147@SHSMSX101.ccr.corp.intel.com>
	<alpine.DEB.2.02.1211061455150.2689@kaball.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233537B479@SHSMSX101.ccr.corp.intel.com>
	<20121106164303.GO9966@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC829233537B99E@SHSMSX101.ccr.corp.intel.com>
	<20121107160301.GF18615@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC829233537BB2F@SHSMSX101.ccr.corp.intel.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233537BB2F@SHSMSX101.ccr.corp.intel.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/2] Xen acpi pad implement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 07, 2012 at 04:52:50PM +0000, Liu, Jinsong wrote:
> Konrad Rzeszutek Wilk wrote:
> > On Wed, Nov 07, 2012 at 12:58:19PM +0000, Liu, Jinsong wrote:
> >>>>> 
> >>>>> If it is generic ACPI code, than it can depend only on ACPI.
> >>>>> If it is ACPI code that contains X86 specific info, than it needs
> >>>>> to depend on X86 too.
> >>>> 
> >>>> No x86 specific so let's depend on ACPI.
> >>> 
> >>> Huh? This feature is x86 specific isn't it? I mean it is in the ACPI
> >>> spec, but only x86 does it right?
> >> 
> >> OK, updated w/ ACPI & X86 dependency, and per other comments.
> > 
> > Ok. Could you send all the patchset in one go. I am bit lost of which
> > one to review as none of them seem to have the version information
> > [vX: Did this yyy]
> 
> Not quite clear your meaning, do you mean not reply old email and start a new thread with title like
> [PATCH vX 1/2]: xen/acpi: ACPI PAD driver
> [PATCH vX 2/2]: ...

Have you ever used git-send email? If you repost them all it comes out threaded
and it makes it easy to apply the whole patchset in one go.

> ?
> 
> > 
> > right above your name or in the title:
> > [PATCH vX 1/2]: yyyy
> > 
> > anyhow, some comments below.
> > 
> 
> OK.
> 
> Thanks,
> Jinsong

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 01:23:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 01:23:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWGpy-0006zS-3m; Thu, 08 Nov 2012 01:23:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TWGpw-0006zK-Vi
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 01:23:17 +0000
Received: from [85.158.139.211:57657] by server-12.bemta-5.messagelabs.com id
	D1/7F-02886-4890B905; Thu, 08 Nov 2012 01:23:16 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1352337793!19254806!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0NzE2Mw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 921 invoked from network); 8 Nov 2012 01:23:15 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-15.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 01:23:15 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA81MvrQ031243
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 8 Nov 2012 01:22:58 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA81MtjN025116
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 8 Nov 2012 01:22:56 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA81MrSS025719; Wed, 7 Nov 2012 19:22:53 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 07 Nov 2012 17:22:53 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id AC6FF4019F; Wed,  7 Nov 2012 20:10:06 -0500 (EST)
Date: Wed, 7 Nov 2012 20:10:06 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121108011006.GC21302@phenom.dumpdata.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121107144625.GA14628@ennui.austin.ibm.com>
	<509AA501.1090701@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509AA501.1090701@jhuapl.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	Kent Yoder <key@linux.vnet.ibm.com>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
	driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 07, 2012 at 01:14:25PM -0500, Matthew Fioravante wrote:
> On 11/07/2012 09:46 AM, Kent Yoder wrote:
> >Hi Matthew,
> >
> >On Mon, Nov 05, 2012 at 10:09:57AM -0500, Matthew Fioravante wrote:
> >>This patch ports the xen vtpm frontend driver for linux
> >>from the linux-2.6.18-xen.hg tree to linux-stable.
> >>
> >>Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> >>---
> >>  drivers/char/tpm/Kconfig         |    9 +
> >>  drivers/char/tpm/Makefile        |    2 +
> >>  drivers/char/tpm/tpm.h           |   15 +
> >>  drivers/char/tpm/tpm_vtpm.c      |  543 ++++++++++++++++++++++++++++++
> >>  drivers/char/tpm/tpm_vtpm.h      |   55 +++
> >>  drivers/char/tpm/tpm_xen.c       |  690 ++++++++++++++++++++++++++++++++++++++
> >>  include/xen/interface/io/tpmif.h |   77 +++++
> >>  7 files changed, 1391 insertions(+)
> >>  create mode 100644 drivers/char/tpm/tpm_vtpm.c
> >>  create mode 100644 drivers/char/tpm/tpm_vtpm.h
> >>  create mode 100644 drivers/char/tpm/tpm_xen.c
> >>  create mode 100644 include/xen/interface/io/tpmif.h
> >>
> >>diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
> >>index 915875e..08c1010 100644
> >>--- a/drivers/char/tpm/Kconfig
> >>+++ b/drivers/char/tpm/Kconfig
> >>@@ -81,4 +81,13 @@ config TCG_IBMVTPM
> >>  	  will be accessible from within Linux.  To compile this driver
> >>  	  as a module, choose M here; the module will be called tpm_ibmvtpm.
> >>
> >>+config TCG_XEN
> >>+	tristate "XEN TPM Interface"
> >>+	depends on TCG_TPM && XEN
> >>+	---help---
> >>+	  If you want to make TPM support available to a Xen user domain,
> >>+	  say Yes and it will be accessible from within Linux.
> >>+	  To compile this driver as a module, choose M here; the module
> >>+	  will be called tpm_xenu.
> >>+
> >>  endif # TCG_TPM
> >>diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
> >>index 5b3fc8b..16911c5 100644
> >>--- a/drivers/char/tpm/Makefile
> >>+++ b/drivers/char/tpm/Makefile
> >>@@ -17,3 +17,5 @@ obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
> >>  obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
> >>  obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
> >>  obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
> >>+obj-$(CONFIG_TCG_XEN) += tpm_xenu.o
> >>+tpm_xenu-y = tpm_xen.o tpm_vtpm.o
> >  Let's match the naming convention of the other drivers if we can, so this
> >would be something like tpm_xenvtpm.c. tpm_vtpm is too generic...
> Makes sense, fixed.
> >
> >>diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
> >>index 8ef7649..2e5a47a 100644
> >>--- a/drivers/char/tpm/tpm.h
> >>+++ b/drivers/char/tpm/tpm.h
> >>@@ -130,6 +130,9 @@ struct tpm_chip {
> >>
> >>  	struct list_head list;
> >>  	void (*release) (struct device *);
> >>+#if CONFIG_XEN
> >>+	void *priv;
> >>+#endif
> >  Can you use the chip->vendor.data pointer here instead? tpm_ibmvtpm is
> >already using that as a priv pointer. I should probably change that name
> >to make it more obvious what that's used for.
> That makes more sense. I'm guessing your data pointer didn't exist
> during the 2.6.18 kernel which is why they added their own priv
> pointer.
> >
> >>  };
> >>
> >>  #define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor)
> >>@@ -310,6 +313,18 @@ struct tpm_cmd_t {
> >>
> >>  ssize_t	tpm_getcap(struct device *, __be32, cap_t *, const char *);
> >>
> >>+#ifdef CONFIG_XEN
> >>+static inline void *chip_get_private(const struct tpm_chip *chip)
> >>+{
> >>+	return chip->priv;
> >>+}
> >>+
> >>+static inline void chip_set_private(struct tpm_chip *chip, void *priv)
> >>+{
> >>+	chip->priv = priv;
> >>+}
> >>+#endif
> >  Can you put these in tpm_vtpm.c please?  One less #define. :-)
> Agreed, I'd rather not have to modify your shared tpm.h interface at all.
> >
> >[cut]
> >>+#ifndef __XEN_PUBLIC_IO_TPMIF_H__
> >>+#define __XEN_PUBLIC_IO_TPMIF_H__
> >>+
> >>+#include "../grant_table.h"
> >>+
> >>+struct tpmif_tx_request {
> >>+	unsigned long addr;   /* Machine address of packet.   */
> >>+	grant_ref_t ref;      /* grant table access reference */
> >>+	uint16_t unused;
> >>+	uint16_t size;        /* Packet size in bytes.        */
> >>+};
> >>+typedef struct tpmif_tx_request tpmif_tx_request_t;
> >   checkpatch warned on this new typedef - please run through checkpatch
> >and fix up that stuff.
> tpmif.h has a couple of typedefs which do trigger checkpatch
> warnings. However it looks like the paradigm for xen is to have
> these interface/io/<dev>if.h files and all of them have typedefs. I
> think in this case the typedef should probably stay.
> 
> Konrad your thoughts here?

Rip them out plea

> >
> >>+
> >>+/*
> >>+ * The TPMIF_TX_RING_SIZE defines the number of pages the
> >>+ * front-end and backend can exchange (= size of array).
> >>+ */
> >>+typedef uint32_t TPMIF_RING_IDX;
> >>+
> >>+#define TPMIF_TX_RING_SIZE 1
> >>+
> >>+/* This structure must fit in a memory page. */
> >>+
> >>+struct tpmif_ring {
> >>+	struct tpmif_tx_request req;
> >>+};
> >>+typedef struct tpmif_ring tpmif_ring_t;
> >>+
> >>+struct tpmif_tx_interface {
> >>+	struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
> >>+};
> >>+typedef struct tpmif_tx_interface tpmif_tx_interface_t;
> >>+
> >>+#endif
> >>+
> >>+/*
> >>+ * Local variables:
> >>+ * mode: C
> >>+ * c-set-style: "BSD"
> >>+ * c-basic-offset: 4
> >>+ * tab-width: 4
> >>+ * indent-tabs-mode: nil
> >>+ * End:
> >>+ */
> >   Please take this comment out, see Documentation/CodingStyle.
> Fixed
> >
> >Thanks,
> >Kent
> >
> >>-- 
> >>1.7.10.4
> >>
> >>
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 01:23:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 01:23:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWGpy-0006zS-3m; Thu, 08 Nov 2012 01:23:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TWGpw-0006zK-Vi
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 01:23:17 +0000
Received: from [85.158.139.211:57657] by server-12.bemta-5.messagelabs.com id
	D1/7F-02886-4890B905; Thu, 08 Nov 2012 01:23:16 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1352337793!19254806!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0NzE2Mw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 921 invoked from network); 8 Nov 2012 01:23:15 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-15.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 01:23:15 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA81MvrQ031243
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 8 Nov 2012 01:22:58 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA81MtjN025116
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 8 Nov 2012 01:22:56 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA81MrSS025719; Wed, 7 Nov 2012 19:22:53 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 07 Nov 2012 17:22:53 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id AC6FF4019F; Wed,  7 Nov 2012 20:10:06 -0500 (EST)
Date: Wed, 7 Nov 2012 20:10:06 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121108011006.GC21302@phenom.dumpdata.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121107144625.GA14628@ennui.austin.ibm.com>
	<509AA501.1090701@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509AA501.1090701@jhuapl.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	Kent Yoder <key@linux.vnet.ibm.com>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
	driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 07, 2012 at 01:14:25PM -0500, Matthew Fioravante wrote:
> On 11/07/2012 09:46 AM, Kent Yoder wrote:
> >Hi Matthew,
> >
> >On Mon, Nov 05, 2012 at 10:09:57AM -0500, Matthew Fioravante wrote:
> >>This patch ports the xen vtpm frontend driver for linux
> >>from the linux-2.6.18-xen.hg tree to linux-stable.
> >>
> >>Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> >>---
> >>  drivers/char/tpm/Kconfig         |    9 +
> >>  drivers/char/tpm/Makefile        |    2 +
> >>  drivers/char/tpm/tpm.h           |   15 +
> >>  drivers/char/tpm/tpm_vtpm.c      |  543 ++++++++++++++++++++++++++++++
> >>  drivers/char/tpm/tpm_vtpm.h      |   55 +++
> >>  drivers/char/tpm/tpm_xen.c       |  690 ++++++++++++++++++++++++++++++++++++++
> >>  include/xen/interface/io/tpmif.h |   77 +++++
> >>  7 files changed, 1391 insertions(+)
> >>  create mode 100644 drivers/char/tpm/tpm_vtpm.c
> >>  create mode 100644 drivers/char/tpm/tpm_vtpm.h
> >>  create mode 100644 drivers/char/tpm/tpm_xen.c
> >>  create mode 100644 include/xen/interface/io/tpmif.h
> >>
> >>diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
> >>index 915875e..08c1010 100644
> >>--- a/drivers/char/tpm/Kconfig
> >>+++ b/drivers/char/tpm/Kconfig
> >>@@ -81,4 +81,13 @@ config TCG_IBMVTPM
> >>  	  will be accessible from within Linux.  To compile this driver
> >>  	  as a module, choose M here; the module will be called tpm_ibmvtpm.
> >>
> >>+config TCG_XEN
> >>+	tristate "XEN TPM Interface"
> >>+	depends on TCG_TPM && XEN
> >>+	---help---
> >>+	  If you want to make TPM support available to a Xen user domain,
> >>+	  say Yes and it will be accessible from within Linux.
> >>+	  To compile this driver as a module, choose M here; the module
> >>+	  will be called tpm_xenu.
> >>+
> >>  endif # TCG_TPM
> >>diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
> >>index 5b3fc8b..16911c5 100644
> >>--- a/drivers/char/tpm/Makefile
> >>+++ b/drivers/char/tpm/Makefile
> >>@@ -17,3 +17,5 @@ obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
> >>  obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
> >>  obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
> >>  obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
> >>+obj-$(CONFIG_TCG_XEN) += tpm_xenu.o
> >>+tpm_xenu-y = tpm_xen.o tpm_vtpm.o
> >  Let's match the naming convention of the other drivers if we can, so this
> >would be something like tpm_xenvtpm.c. tpm_vtpm is too generic...
> Makes sense, fixed.
> >
> >>diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
> >>index 8ef7649..2e5a47a 100644
> >>--- a/drivers/char/tpm/tpm.h
> >>+++ b/drivers/char/tpm/tpm.h
> >>@@ -130,6 +130,9 @@ struct tpm_chip {
> >>
> >>  	struct list_head list;
> >>  	void (*release) (struct device *);
> >>+#if CONFIG_XEN
> >>+	void *priv;
> >>+#endif
> >  Can you use the chip->vendor.data pointer here instead? tpm_ibmvtpm is
> >already using that as a priv pointer. I should probably change that name
> >to make it more obvious what that's used for.
> That makes more sense. I'm guessing your data pointer didn't exist
> during the 2.6.18 kernel which is why they added their own priv
> pointer.
> >
> >>  };
> >>
> >>  #define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor)
> >>@@ -310,6 +313,18 @@ struct tpm_cmd_t {
> >>
> >>  ssize_t	tpm_getcap(struct device *, __be32, cap_t *, const char *);
> >>
> >>+#ifdef CONFIG_XEN
> >>+static inline void *chip_get_private(const struct tpm_chip *chip)
> >>+{
> >>+	return chip->priv;
> >>+}
> >>+
> >>+static inline void chip_set_private(struct tpm_chip *chip, void *priv)
> >>+{
> >>+	chip->priv = priv;
> >>+}
> >>+#endif
> >  Can you put these in tpm_vtpm.c please?  One less #define. :-)
> Agreed, I'd rather not have to modify your shared tpm.h interface at all.
> >
> >[cut]
> >>+#ifndef __XEN_PUBLIC_IO_TPMIF_H__
> >>+#define __XEN_PUBLIC_IO_TPMIF_H__
> >>+
> >>+#include "../grant_table.h"
> >>+
> >>+struct tpmif_tx_request {
> >>+	unsigned long addr;   /* Machine address of packet.   */
> >>+	grant_ref_t ref;      /* grant table access reference */
> >>+	uint16_t unused;
> >>+	uint16_t size;        /* Packet size in bytes.        */
> >>+};
> >>+typedef struct tpmif_tx_request tpmif_tx_request_t;
> >   checkpatch warned on this new typedef - please run through checkpatch
> >and fix up that stuff.
> tpmif.h has a couple of typedefs which do trigger checkpatch
> warnings. However it looks like the paradigm for xen is to have
> these interface/io/<dev>if.h files and all of them have typedefs. I
> think in this case the typedef should probably stay.
> 
> Konrad your thoughts here?

Rip them out plea

> >
> >>+
> >>+/*
> >>+ * The TPMIF_TX_RING_SIZE defines the number of pages the
> >>+ * front-end and backend can exchange (= size of array).
> >>+ */
> >>+typedef uint32_t TPMIF_RING_IDX;
> >>+
> >>+#define TPMIF_TX_RING_SIZE 1
> >>+
> >>+/* This structure must fit in a memory page. */
> >>+
> >>+struct tpmif_ring {
> >>+	struct tpmif_tx_request req;
> >>+};
> >>+typedef struct tpmif_ring tpmif_ring_t;
> >>+
> >>+struct tpmif_tx_interface {
> >>+	struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
> >>+};
> >>+typedef struct tpmif_tx_interface tpmif_tx_interface_t;
> >>+
> >>+#endif
> >>+
> >>+/*
> >>+ * Local variables:
> >>+ * mode: C
> >>+ * c-set-style: "BSD"
> >>+ * c-basic-offset: 4
> >>+ * tab-width: 4
> >>+ * indent-tabs-mode: nil
> >>+ * End:
> >>+ */
> >   Please take this comment out, see Documentation/CodingStyle.
> Fixed
> >
> >Thanks,
> >Kent
> >
> >>-- 
> >>1.7.10.4
> >>
> >>
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 03:23:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 03:23:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWIhe-0007z9-Ta; Thu, 08 Nov 2012 03:22:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1TWIhd-0007z4-4C
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 03:22:49 +0000
Received: from [85.158.139.83:47214] by server-13.bemta-5.messagelabs.com id
	31/1B-27809-8852B905; Thu, 08 Nov 2012 03:22:48 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-3.tower-182.messagelabs.com!1352344965!29271185!1
X-Originating-IP: [209.85.210.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25549 invoked from network); 8 Nov 2012 03:22:47 -0000
Received: from mail-ia0-f173.google.com (HELO mail-ia0-f173.google.com)
	(209.85.210.173)
	by server-3.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 03:22:47 -0000
Received: by mail-ia0-f173.google.com with SMTP id m10so1946631iam.32
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 19:22:45 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date
	:content-transfer-encoding:message-id:references:to:x-mailer
	:x-gm-message-state;
	bh=2FRcr7ShBuwdj1aoiqH/zclE1VC1zCp+Bul6VsnkKOs=;
	b=pndh3K1OTikWw1fUzRQewJbjSXC3hN8U16N1sG7DKy6QKwaimgsysKgx0/d9tH7mH2
	V8Kue72zvueOqF+DbhDNq1rRD5SGL7mdOsN0IvqlaqIHiR8k7IkJd0seZ2PFJ1yzfDk8
	jf9G04G/yRlTAwEQcERASEm+Dy0Bkuhy3OaOCHxYV3slPkNvhD8vfoTKjsxoUjHttVNm
	VrwKc4s4pegHEB+pU0wuUk+7tRtwiRHZ3SClbAGhq20D6JIq31gQvtPHJLUTdj+j6KSm
	JE0EACoeO0qQzI581wgKk5UgZfTEGUubOLR4wGwhgPIR2RJTRR8iTXjZ0UJ82fpFJG6W
	JZWQ==
Received: by 10.50.237.6 with SMTP id uy6mr4226944igc.31.1352344965163;
	Wed, 07 Nov 2012 19:22:45 -0800 (PST)
Received: from [192.168.1.101] (206-248-157-158.dsl.teksavvy.com.
	[206.248.157.158])
	by mx.google.com with ESMTPS id kp4sm3789056igc.1.2012.11.07.19.22.43
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 07 Nov 2012 19:22:44 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
In-Reply-To: <521A2B7F-054A-4CFC-9631-615CC7444595@gridcentric.ca>
Date: Wed, 7 Nov 2012 22:22:51 -0500
Message-Id: <25D45C62-FB0E-4345-A5A1-9A37F219477B@gridcentric.ca>
References: <521A2B7F-054A-4CFC-9631-615CC7444595@gridcentric.ca>
To: Tim Deegan <tim@xen.org>, "Keir (Xen.org)" <keir@xen.org>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQmyecRSUPRp+DjKx4LEWUHGqV7lLj9qyJr118+VgbHZbNjTZcWNQFtZDfD7Y97q69CAfFjl
Subject: Re: [Xen-devel] Wait Queues
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="windows-1252"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Nov 7, 2012, at 3:54 PM, Andres Lagar-Cavilla <andres@gridcentric.ca> wr=
ote:

> Hi all,
> we currently have a problem in the (x86) mm layer. Callers may request th=
e p2m to perform a translation of a gfn to an mfn. Such translation may nee=
d to wait for a third party to service it. This happens when:
> =

> - a page needs to be paged in
> - a CoW breaking of a shared page fails due to lack of memory
> =

> Note that paging in may also fail due to lack of memory. In both ENOMEM c=
ases, all the plumbing for a toolstack to be notified and take some correct=
ive action to release some memory and retry is in place. We also have plumb=
ing for pagers in place.
> =

> Ideally we want the internals to be self-contained, so that callers need =
not be concerned with any of this. A request for a p2m translation may or m=
ay not sleep, but on exit from the p2m the caller either has an mfn with a =
page ref, or an error code due to some other condition.
> =

> Wait queue support in (x86) Xen prevents sleeping on a wait queue if any =
locks are held, including RCU read-side locks (i.e. BUG_ON(!in_atomic()).
> =

> For this reason, we have not yet implemented sleeping on the p2m. Callers=
 may get errors telling them to retry. A lot of (imho) ugly code is peppere=
d around the hypervisor to deal with the consequences of this. More fundame=
ntally, in some cases there is no possible elegant handling, and guests are=
 crashed (for example, if a page table page is paged out and the hypervisor=
 needs to translate a guest virtual address to a gfn). This limits the appl=
icability of memory paging and sharing.
> =

> One way to solve this would be to ensure no code path liable to sleep in =
a wait queue is holding any locks at wait queue sleep time. I believe this =
is doomed. Not just because this is a herculean task. It also makes writing=
 hypervisor code *very* difficult. Anyone trying to throw a p2m translation=
 into a code path needs to think of all possible upstream call sequences. N=
ot even RCU read locks are allowed.
> =

> I'd like to propose an approach that ensures that as long some properties=
 are met, arbitrary wait queue sleep is allowed. Here are the properties:
> 1. Third parties servicing a wait queue sleep are indeed third parties. I=
n other words, dom0 does not do paging.
> 2. Vcpus of a wait queue servicing domain may never go to sleep on a wait=
 queue during a foreign map.
> 3. A guest vcpu may go to sleep on a wait queue holding any kinds of lock=
s as long as it does not hold the p2m lock.

N.B: I understand (now) this may cause any other vcpu contending on a lock =
held by the wait queue sleeper to not yield to the scheduler and pin its ph=
ysical cpu.

What I am struggling with is coming up with a solution that doesn't turn hy=
pervisor mm hacking into a locking minefield.

Linux fixes this with many kinds of sleeping synchronization primitives. A =
task can, for example, hold the mmap semaphore and sleep on a wait queue. I=
s this the only way out of this mess? Not if wait queues force the vcpu to =
wake up on the same phys cpu it was using at the time of sleeping=85.

Andres

> 4. "Kick" routines in the hypervisor by which service domains effectively=
 wake up a vcpu may only take the p2m lock to do a fix up of the p2m.
> 5. Wait queues can be awakened on a special domain destroy condition.
> =

> Property 1. is hopefully self-evident, and although not enforced in the c=
ode it is reasonably simple to do so.
> =

> Property 2. is also self-evident and enforced in the code today.
> =

> Property 3. simplifies reasoning about p2m translations and wait queue sl=
eeping. Provides a clean model for reasoning about what might or might not =
happen. It will require us to restructure some code paths (i.e. XENMEM_add_=
to_physmap) that require multiple p2m translations in a single critical reg=
ion to perform all translations up front.
> =

> Property 4. is already enforced in the code as is right now.
> =

> Property 5. needs adding some logic to the top of domain destruction: set=
 a flag, wake up all vcpus in wait queues. Extra logic on the wait queue si=
de will exit the wait if the destroy flag is set, with an error. Most if no=
t all callers can deal right now with a p2m translation error (other than p=
aging), and unwind and release all their locks.
> =

> I confess my understanding of RCU is not 100% there and I am not sure wha=
t will happen to force_quiescent_state. I also understand there is a impeda=
nce mismatch wrt to "saving" and "restoring" the physical CPU preempt count.
> =

> Thanks,
> Andres


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 03:23:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 03:23:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWIhe-0007z9-Ta; Thu, 08 Nov 2012 03:22:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1TWIhd-0007z4-4C
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 03:22:49 +0000
Received: from [85.158.139.83:47214] by server-13.bemta-5.messagelabs.com id
	31/1B-27809-8852B905; Thu, 08 Nov 2012 03:22:48 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-3.tower-182.messagelabs.com!1352344965!29271185!1
X-Originating-IP: [209.85.210.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25549 invoked from network); 8 Nov 2012 03:22:47 -0000
Received: from mail-ia0-f173.google.com (HELO mail-ia0-f173.google.com)
	(209.85.210.173)
	by server-3.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 03:22:47 -0000
Received: by mail-ia0-f173.google.com with SMTP id m10so1946631iam.32
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 19:22:45 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date
	:content-transfer-encoding:message-id:references:to:x-mailer
	:x-gm-message-state;
	bh=2FRcr7ShBuwdj1aoiqH/zclE1VC1zCp+Bul6VsnkKOs=;
	b=pndh3K1OTikWw1fUzRQewJbjSXC3hN8U16N1sG7DKy6QKwaimgsysKgx0/d9tH7mH2
	V8Kue72zvueOqF+DbhDNq1rRD5SGL7mdOsN0IvqlaqIHiR8k7IkJd0seZ2PFJ1yzfDk8
	jf9G04G/yRlTAwEQcERASEm+Dy0Bkuhy3OaOCHxYV3slPkNvhD8vfoTKjsxoUjHttVNm
	VrwKc4s4pegHEB+pU0wuUk+7tRtwiRHZ3SClbAGhq20D6JIq31gQvtPHJLUTdj+j6KSm
	JE0EACoeO0qQzI581wgKk5UgZfTEGUubOLR4wGwhgPIR2RJTRR8iTXjZ0UJ82fpFJG6W
	JZWQ==
Received: by 10.50.237.6 with SMTP id uy6mr4226944igc.31.1352344965163;
	Wed, 07 Nov 2012 19:22:45 -0800 (PST)
Received: from [192.168.1.101] (206-248-157-158.dsl.teksavvy.com.
	[206.248.157.158])
	by mx.google.com with ESMTPS id kp4sm3789056igc.1.2012.11.07.19.22.43
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 07 Nov 2012 19:22:44 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
In-Reply-To: <521A2B7F-054A-4CFC-9631-615CC7444595@gridcentric.ca>
Date: Wed, 7 Nov 2012 22:22:51 -0500
Message-Id: <25D45C62-FB0E-4345-A5A1-9A37F219477B@gridcentric.ca>
References: <521A2B7F-054A-4CFC-9631-615CC7444595@gridcentric.ca>
To: Tim Deegan <tim@xen.org>, "Keir (Xen.org)" <keir@xen.org>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQmyecRSUPRp+DjKx4LEWUHGqV7lLj9qyJr118+VgbHZbNjTZcWNQFtZDfD7Y97q69CAfFjl
Subject: Re: [Xen-devel] Wait Queues
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="windows-1252"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Nov 7, 2012, at 3:54 PM, Andres Lagar-Cavilla <andres@gridcentric.ca> wr=
ote:

> Hi all,
> we currently have a problem in the (x86) mm layer. Callers may request th=
e p2m to perform a translation of a gfn to an mfn. Such translation may nee=
d to wait for a third party to service it. This happens when:
> =

> - a page needs to be paged in
> - a CoW breaking of a shared page fails due to lack of memory
> =

> Note that paging in may also fail due to lack of memory. In both ENOMEM c=
ases, all the plumbing for a toolstack to be notified and take some correct=
ive action to release some memory and retry is in place. We also have plumb=
ing for pagers in place.
> =

> Ideally we want the internals to be self-contained, so that callers need =
not be concerned with any of this. A request for a p2m translation may or m=
ay not sleep, but on exit from the p2m the caller either has an mfn with a =
page ref, or an error code due to some other condition.
> =

> Wait queue support in (x86) Xen prevents sleeping on a wait queue if any =
locks are held, including RCU read-side locks (i.e. BUG_ON(!in_atomic()).
> =

> For this reason, we have not yet implemented sleeping on the p2m. Callers=
 may get errors telling them to retry. A lot of (imho) ugly code is peppere=
d around the hypervisor to deal with the consequences of this. More fundame=
ntally, in some cases there is no possible elegant handling, and guests are=
 crashed (for example, if a page table page is paged out and the hypervisor=
 needs to translate a guest virtual address to a gfn). This limits the appl=
icability of memory paging and sharing.
> =

> One way to solve this would be to ensure no code path liable to sleep in =
a wait queue is holding any locks at wait queue sleep time. I believe this =
is doomed. Not just because this is a herculean task. It also makes writing=
 hypervisor code *very* difficult. Anyone trying to throw a p2m translation=
 into a code path needs to think of all possible upstream call sequences. N=
ot even RCU read locks are allowed.
> =

> I'd like to propose an approach that ensures that as long some properties=
 are met, arbitrary wait queue sleep is allowed. Here are the properties:
> 1. Third parties servicing a wait queue sleep are indeed third parties. I=
n other words, dom0 does not do paging.
> 2. Vcpus of a wait queue servicing domain may never go to sleep on a wait=
 queue during a foreign map.
> 3. A guest vcpu may go to sleep on a wait queue holding any kinds of lock=
s as long as it does not hold the p2m lock.

N.B: I understand (now) this may cause any other vcpu contending on a lock =
held by the wait queue sleeper to not yield to the scheduler and pin its ph=
ysical cpu.

What I am struggling with is coming up with a solution that doesn't turn hy=
pervisor mm hacking into a locking minefield.

Linux fixes this with many kinds of sleeping synchronization primitives. A =
task can, for example, hold the mmap semaphore and sleep on a wait queue. I=
s this the only way out of this mess? Not if wait queues force the vcpu to =
wake up on the same phys cpu it was using at the time of sleeping=85.

Andres

> 4. "Kick" routines in the hypervisor by which service domains effectively=
 wake up a vcpu may only take the p2m lock to do a fix up of the p2m.
> 5. Wait queues can be awakened on a special domain destroy condition.
> =

> Property 1. is hopefully self-evident, and although not enforced in the c=
ode it is reasonably simple to do so.
> =

> Property 2. is also self-evident and enforced in the code today.
> =

> Property 3. simplifies reasoning about p2m translations and wait queue sl=
eeping. Provides a clean model for reasoning about what might or might not =
happen. It will require us to restructure some code paths (i.e. XENMEM_add_=
to_physmap) that require multiple p2m translations in a single critical reg=
ion to perform all translations up front.
> =

> Property 4. is already enforced in the code as is right now.
> =

> Property 5. needs adding some logic to the top of domain destruction: set=
 a flag, wake up all vcpus in wait queues. Extra logic on the wait queue si=
de will exit the wait if the destroy flag is set, with an error. Most if no=
t all callers can deal right now with a p2m translation error (other than p=
aging), and unwind and release all their locks.
> =

> I confess my understanding of RCU is not 100% there and I am not sure wha=
t will happen to force_quiescent_state. I also understand there is a impeda=
nce mismatch wrt to "saving" and "restoring" the physical CPU preempt count.
> =

> Thanks,
> Andres


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 05:29:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 05:29:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWKfz-0000BM-Rx; Thu, 08 Nov 2012 05:29:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TWKfx-0000BH-UR
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 05:29:14 +0000
Received: from [85.158.138.51:61041] by server-4.bemta-3.messagelabs.com id
	DB/9A-30023-6234B905; Thu, 08 Nov 2012 05:29:10 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1352352549!22810933!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTc4Mzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31117 invoked from network); 8 Nov 2012 05:29:09 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 05:29:09 -0000
X-IronPort-AV: E=Sophos;i="4.80,736,1344211200"; d="scan'208";a="15658759"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	08 Nov 2012 05:28:57 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 8 Nov 2012 05:28:56 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TWKfh-0003OW-6B;
	Thu, 08 Nov 2012 05:28:57 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TWKfh-00089e-27;
	Thu, 08 Nov 2012 05:28:57 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14373-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 8 Nov 2012 05:28:57 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14373: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14373 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14373/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-win7-amd64 12 guest-localmigrate/x10    fail pass in 14371

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14371
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14371
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14371
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14371

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop          fail in 14371 never pass

version targeted for testing:
 xen                  bd78e5630a5b
baseline version:
 xen                  bd78e5630a5b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 05:29:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 05:29:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWKfz-0000BM-Rx; Thu, 08 Nov 2012 05:29:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TWKfx-0000BH-UR
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 05:29:14 +0000
Received: from [85.158.138.51:61041] by server-4.bemta-3.messagelabs.com id
	DB/9A-30023-6234B905; Thu, 08 Nov 2012 05:29:10 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1352352549!22810933!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTc4Mzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31117 invoked from network); 8 Nov 2012 05:29:09 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 05:29:09 -0000
X-IronPort-AV: E=Sophos;i="4.80,736,1344211200"; d="scan'208";a="15658759"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	08 Nov 2012 05:28:57 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 8 Nov 2012 05:28:56 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TWKfh-0003OW-6B;
	Thu, 08 Nov 2012 05:28:57 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TWKfh-00089e-27;
	Thu, 08 Nov 2012 05:28:57 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14373-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 8 Nov 2012 05:28:57 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14373: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14373 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14373/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-win7-amd64 12 guest-localmigrate/x10    fail pass in 14371

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14371
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14371
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14371
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14371

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop          fail in 14371 never pass

version targeted for testing:
 xen                  bd78e5630a5b
baseline version:
 xen                  bd78e5630a5b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 05:41:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 05:41:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWKrh-0000LU-3h; Thu, 08 Nov 2012 05:41:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TWKrf-0000LP-Bv
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 05:41:19 +0000
Received: from [85.158.137.99:13376] by server-4.bemta-3.messagelabs.com id
	F7/01-30023-EF54B905; Thu, 08 Nov 2012 05:41:18 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1352353276!15053166!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzYyOTk3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12560 invoked from network); 8 Nov 2012 05:41:16 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-9.tower-217.messagelabs.com with SMTP;
	8 Nov 2012 05:41:16 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga102.jf.intel.com with ESMTP; 07 Nov 2012 21:40:41 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,736,1344236400"; 
	d="scan'208,223";a="238866839"
Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35])
	by orsmga002.jf.intel.com with ESMTP; 07 Nov 2012 21:41:14 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 21:41:14 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Thu, 8 Nov 2012 13:41:13 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thread-Topic: [PATCH v2 1/2] Xen/acpi: ACPI PAD driver
Thread-Index: Ac29c6k/ou550tv2Qn224u0n9s+KjA==
Date: Thu, 8 Nov 2012 05:41:13 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537BF47@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_002_DE8DF0795D48FD4CA783C40EC829233537BF47SHSMSX101ccrcorpi_"
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH v2 1/2] Xen/acpi: ACPI PAD driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_DE8DF0795D48FD4CA783C40EC829233537BF47SHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

PAD is acpi Processor Aggregator Device which provides a control point
that enables the platform to perform specific processor configuration
and control that applies to all processors in the platform.

This patch is to implement Xen acpi pad logic. When running under Xen
virt platform, native pad driver would not work. Instead Xen pad driver,
a self-contained and thin logic level, would take over acpi pad logic.

When acpi pad notify OSPM, xen pad logic intercept and parse _PUR object
to get the expected idle cpu number, and then hypercall to hypervisor.
Xen hypervisor would then do the rest work, say, core parking, to idle
specific number of cpus on its own policy.

Signed-off-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
---
 drivers/xen/Makefile             |    3 +-
 drivers/xen/xen-acpi-pad.c       |  181 ++++++++++++++++++++++++++++++++++=
++++
 include/xen/interface/platform.h |   17 ++++
 include/xen/interface/version.h  |   15 +++
 4 files changed, 215 insertions(+), 1 deletions(-)
 create mode 100644 drivers/xen/xen-acpi-pad.c

diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 0e86370..3c39717 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -10,7 +10,8 @@ CFLAGS_features.o			:=3D $(nostackp)
=20
 dom0-$(CONFIG_PCI) +=3D pci.o
 dom0-$(CONFIG_USB_SUPPORT) +=3D dbgp.o
-dom0-$(CONFIG_ACPI) +=3D acpi.o
+dom0-$(CONFIG_ACPI) +=3D acpi.o $(xen-pad-y)
+xen-pad-$(CONFIG_X86) +=3D xen-acpi-pad.o
 dom0-$(CONFIG_X86) +=3D pcpu.o
 obj-$(CONFIG_XEN_DOM0)			+=3D $(dom0-y)
 obj-$(CONFIG_BLOCK)			+=3D biomerge.o
diff --git a/drivers/xen/xen-acpi-pad.c b/drivers/xen/xen-acpi-pad.c
new file mode 100644
index 0000000..f23ecf3
--- /dev/null
+++ b/drivers/xen/xen-acpi-pad.c
@@ -0,0 +1,181 @@
+/*
+ * xen-acpi-pad.c - Xen pad interface
+ *
+ * Copyright (c) 2012, Intel Corporation.
+ *    Author: Liu, Jinsong <jinsong.liu@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License f=
or
+ * more details.
+ */
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <acpi/acpi_bus.h>
+#include <acpi/acpi_drivers.h>
+#include <asm/xen/hypercall.h>
+#include <xen/interface/version.h>
+
+#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"acpi_pad"
+#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
+#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
+static DEFINE_MUTEX(xen_cpu_lock);
+
+static int xen_acpi_pad_idle_cpus(unsigned int idle_nums)
+{
+	struct xen_platform_op op;
+
+	op.cmd =3D XENPF_core_parking;
+	op.u.core_parking.type =3D XEN_CORE_PARKING_SET;
+	op.u.core_parking.idle_nums =3D idle_nums;
+
+	return HYPERVISOR_dom0_op(&op);
+}
+
+static int xen_acpi_pad_idle_cpus_num(void)
+{
+	struct xen_platform_op op;
+
+	op.cmd =3D XENPF_core_parking;
+	op.u.core_parking.type =3D XEN_CORE_PARKING_GET;
+
+	return HYPERVISOR_dom0_op(&op)
+	       ?: op.u.core_parking.idle_nums;
+}
+
+/*
+ * Query firmware how many CPUs should be idle
+ * return -1 on failure
+ */
+static int acpi_pad_pur(acpi_handle handle)
+{
+	struct acpi_buffer buffer =3D {ACPI_ALLOCATE_BUFFER, NULL};
+	union acpi_object *package;
+	int num =3D -1;
+
+	if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))
+		return num;
+
+	if (!buffer.length || !buffer.pointer)
+		return num;
+
+	package =3D buffer.pointer;
+
+	if (package->type =3D=3D ACPI_TYPE_PACKAGE &&
+		package->package.count =3D=3D 2 &&
+		package->package.elements[0].integer.value =3D=3D 1) /* rev 1 */
+		num =3D package->package.elements[1].integer.value;
+
+	kfree(buffer.pointer);
+	return num;
+}
+
+/* Notify firmware how many CPUs are idle */
+static void acpi_pad_ost(acpi_handle handle, int stat,
+	uint32_t idle_nums)
+{
+	union acpi_object params[3] =3D {
+		{.type =3D ACPI_TYPE_INTEGER,},
+		{.type =3D ACPI_TYPE_INTEGER,},
+		{.type =3D ACPI_TYPE_BUFFER,},
+	};
+	struct acpi_object_list arg_list =3D {3, params};
+
+	params[0].integer.value =3D ACPI_PROCESSOR_AGGREGATOR_NOTIFY;
+	params[1].integer.value =3D  stat;
+	params[2].buffer.length =3D 4;
+	params[2].buffer.pointer =3D (void *)&idle_nums;
+	acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
+}
+
+static void acpi_pad_handle_notify(acpi_handle handle)
+{
+	int idle_nums;
+
+	mutex_lock(&xen_cpu_lock);
+	idle_nums =3D acpi_pad_pur(handle);
+	if (idle_nums < 0) {
+		mutex_unlock(&xen_cpu_lock);
+		return;
+	}
+
+	idle_nums =3D xen_acpi_pad_idle_cpus(idle_nums)
+		    ?: xen_acpi_pad_idle_cpus_num();
+	if (idle_nums >=3D 0)
+		acpi_pad_ost(handle, 0, idle_nums);
+	mutex_unlock(&xen_cpu_lock);
+}
+
+static void acpi_pad_notify(acpi_handle handle, u32 event,
+	void *data)
+{
+	switch (event) {
+	case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
+		acpi_pad_handle_notify(handle);
+		break;
+	default:
+		pr_warn("Unsupported event [0x%x]\n", event);
+		break;
+	}
+}
+
+static int acpi_pad_add(struct acpi_device *device)
+{
+	acpi_status status;
+
+	strcpy(acpi_device_name(device), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
+	strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);
+
+	status =3D acpi_install_notify_handler(device->handle,
+		ACPI_DEVICE_NOTIFY, acpi_pad_notify, device);
+	if (ACPI_FAILURE(status))
+		return -ENODEV;
+
+	return 0;
+}
+
+static int acpi_pad_remove(struct acpi_device *device,
+	int type)
+{
+	mutex_lock(&xen_cpu_lock);
+	xen_acpi_pad_idle_cpus(0);
+	mutex_unlock(&xen_cpu_lock);
+
+	acpi_remove_notify_handler(device->handle,
+		ACPI_DEVICE_NOTIFY, acpi_pad_notify);
+	return 0;
+}
+
+static const struct acpi_device_id pad_device_ids[] =3D {
+	{"ACPI000C", 0},
+	{"", 0},
+};
+
+static struct acpi_driver acpi_pad_driver =3D {
+	.name =3D "processor_aggregator",
+	.class =3D ACPI_PROCESSOR_AGGREGATOR_CLASS,
+	.ids =3D pad_device_ids,
+	.ops =3D {
+		.add =3D acpi_pad_add,
+		.remove =3D acpi_pad_remove,
+	},
+};
+
+static int __init xen_acpi_pad_init(void)
+{
+	/* Only DOM0 is responsible for Xen acpi pad */
+	if (!xen_initial_domain())
+		return -ENODEV;
+
+	/* Only Xen4.2 or later support Xen acpi pad */
+	if (!xen_running_on_version_or_later(4, 2))
+		return -ENODEV;
+
+	return acpi_bus_register_driver(&acpi_pad_driver);
+}
+subsys_initcall(xen_acpi_pad_init);
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platf=
orm.h
index 4755b5f..5e36932 100644
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
@@ -324,6 +324,22 @@ struct xenpf_cpu_ol {
 };
 DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
=20
+/*
+ * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd,
+ * which are already occupied at Xen hypervisor side.
+ */
+#define XENPF_core_parking     60
+struct xenpf_core_parking {
+	/* IN variables */
+#define XEN_CORE_PARKING_SET   1
+#define XEN_CORE_PARKING_GET   2
+	uint32_t type;
+	/* IN variables:  set cpu nums expected to be idled */
+	/* OUT variables: get cpu nums actually be idled */
+	uint32_t idle_nums;
+};
+DEFINE_GUEST_HANDLE_STRUCT(xenpf_core_parking);
+
 struct xen_platform_op {
 	uint32_t cmd;
 	uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -341,6 +357,7 @@ struct xen_platform_op {
 		struct xenpf_set_processor_pminfo set_pminfo;
 		struct xenpf_pcpuinfo          pcpu_info;
 		struct xenpf_cpu_ol            cpu_ol;
+		struct xenpf_core_parking      core_parking;
 		uint8_t                        pad[128];
 	} u;
 };
diff --git a/include/xen/interface/version.h b/include/xen/interface/versio=
n.h
index 7ff6498..96d8d3d 100644
--- a/include/xen/interface/version.h
+++ b/include/xen/interface/version.h
@@ -63,4 +63,19 @@ struct xen_feature_info {
 /* arg =3D=3D xen_domain_handle_t. */
 #define XENVER_guest_handle 8
=20
+/* Check if running on Xen version (major, minor) or later */
+static inline bool
+xen_running_on_version_or_later(unsigned int major, unsigned int minor)
+{
+	unsigned int version;
+
+	if (!xen_domain())
+		return false;
+
+	version =3D HYPERVISOR_xen_version(XENVER_version, NULL);
+	if ((((version >> 16) =3D=3D major) && ((version & 0xffff) >=3D minor)) |=
|
+		((version >> 16) > major))
+		return true;
+	return false;
+}
 #endif /* __XEN_PUBLIC_VERSION_H__ */
--=20
1.7.1

--_002_DE8DF0795D48FD4CA783C40EC829233537BF47SHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
	name="0001-Xen-acpi-ACPI-PAD-driver.patch"
Content-Description: 0001-Xen-acpi-ACPI-PAD-driver.patch
Content-Disposition: attachment;
	filename="0001-Xen-acpi-ACPI-PAD-driver.patch"; size=8582;
	creation-date="Wed, 07 Nov 2012 17:23:53 GMT";
	modification-date="Thu, 08 Nov 2012 01:12:02 GMT"
Content-Transfer-Encoding: base64

RnJvbSA3NzZiOGYzMTg1OGY5OTIwZTA3MTJhMjIzMmZjNWZiZDg1MDE4NzVjIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBMaXUsIEppbnNvbmcgPGppbnNvbmcubGl1QGludGVsLmNvbT4K
RGF0ZTogVGh1LCA4IE5vdiAyMDEyIDA5OjA2OjIyICswODAwClN1YmplY3Q6IFtQQVRDSCAxLzJd
IFhlbi9hY3BpOiBBQ1BJIFBBRCBkcml2ZXIKClBBRCBpcyBhY3BpIFByb2Nlc3NvciBBZ2dyZWdh
dG9yIERldmljZSB3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B1bnNpZ25lZCBpbnQgbWlu
b3IpCit7CisJdW5zaWduZWQgaW50IHZlcnNpb247CisKKwlpZiAoIXhlbl9kb21haW4oKSkKKwkJ
cmV0dXJuIGZhbHNlOworCisJdmVyc2lvbiA9IEhZUEVSVklTT1JfeGVuX3ZlcnNpb24oWEVOVkVS
X3ZlcnNpb24sIE5VTEwpOworCWlmICgoKCh2ZXJzaW9uID4+IDE2KSA9PSBtYWpvcikgJiYgKCh2
ZXJzaW9uICYgMHhmZmZmKSA+PSBtaW5vcikpIHx8CisJCSgodmVyc2lvbiA+PiAxNikgPiBtYWpv
cikpCisJCXJldHVybiB0cnVlOworCXJldHVybiBmYWxzZTsKK30KICNlbmRpZiAvKiBfX1hFTl9Q
VUJMSUNfVkVSU0lPTl9IX18gKi8KLS0gCjEuNy4xCgo=

--_002_DE8DF0795D48FD4CA783C40EC829233537BF47SHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_002_DE8DF0795D48FD4CA783C40EC829233537BF47SHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Thu Nov 08 05:41:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 05:41:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWKrh-0000LU-3h; Thu, 08 Nov 2012 05:41:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TWKrf-0000LP-Bv
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 05:41:19 +0000
Received: from [85.158.137.99:13376] by server-4.bemta-3.messagelabs.com id
	F7/01-30023-EF54B905; Thu, 08 Nov 2012 05:41:18 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1352353276!15053166!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzYyOTk3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12560 invoked from network); 8 Nov 2012 05:41:16 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-9.tower-217.messagelabs.com with SMTP;
	8 Nov 2012 05:41:16 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga102.jf.intel.com with ESMTP; 07 Nov 2012 21:40:41 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,736,1344236400"; 
	d="scan'208,223";a="238866839"
Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35])
	by orsmga002.jf.intel.com with ESMTP; 07 Nov 2012 21:41:14 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 21:41:14 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Thu, 8 Nov 2012 13:41:13 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thread-Topic: [PATCH v2 1/2] Xen/acpi: ACPI PAD driver
Thread-Index: Ac29c6k/ou550tv2Qn224u0n9s+KjA==
Date: Thu, 8 Nov 2012 05:41:13 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537BF47@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_002_DE8DF0795D48FD4CA783C40EC829233537BF47SHSMSX101ccrcorpi_"
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH v2 1/2] Xen/acpi: ACPI PAD driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_DE8DF0795D48FD4CA783C40EC829233537BF47SHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

PAD is acpi Processor Aggregator Device which provides a control point
that enables the platform to perform specific processor configuration
and control that applies to all processors in the platform.

This patch is to implement Xen acpi pad logic. When running under Xen
virt platform, native pad driver would not work. Instead Xen pad driver,
a self-contained and thin logic level, would take over acpi pad logic.

When acpi pad notify OSPM, xen pad logic intercept and parse _PUR object
to get the expected idle cpu number, and then hypercall to hypervisor.
Xen hypervisor would then do the rest work, say, core parking, to idle
specific number of cpus on its own policy.

Signed-off-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
---
 drivers/xen/Makefile             |    3 +-
 drivers/xen/xen-acpi-pad.c       |  181 ++++++++++++++++++++++++++++++++++=
++++
 include/xen/interface/platform.h |   17 ++++
 include/xen/interface/version.h  |   15 +++
 4 files changed, 215 insertions(+), 1 deletions(-)
 create mode 100644 drivers/xen/xen-acpi-pad.c

diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 0e86370..3c39717 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -10,7 +10,8 @@ CFLAGS_features.o			:=3D $(nostackp)
=20
 dom0-$(CONFIG_PCI) +=3D pci.o
 dom0-$(CONFIG_USB_SUPPORT) +=3D dbgp.o
-dom0-$(CONFIG_ACPI) +=3D acpi.o
+dom0-$(CONFIG_ACPI) +=3D acpi.o $(xen-pad-y)
+xen-pad-$(CONFIG_X86) +=3D xen-acpi-pad.o
 dom0-$(CONFIG_X86) +=3D pcpu.o
 obj-$(CONFIG_XEN_DOM0)			+=3D $(dom0-y)
 obj-$(CONFIG_BLOCK)			+=3D biomerge.o
diff --git a/drivers/xen/xen-acpi-pad.c b/drivers/xen/xen-acpi-pad.c
new file mode 100644
index 0000000..f23ecf3
--- /dev/null
+++ b/drivers/xen/xen-acpi-pad.c
@@ -0,0 +1,181 @@
+/*
+ * xen-acpi-pad.c - Xen pad interface
+ *
+ * Copyright (c) 2012, Intel Corporation.
+ *    Author: Liu, Jinsong <jinsong.liu@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License f=
or
+ * more details.
+ */
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <acpi/acpi_bus.h>
+#include <acpi/acpi_drivers.h>
+#include <asm/xen/hypercall.h>
+#include <xen/interface/version.h>
+
+#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"acpi_pad"
+#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
+#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
+static DEFINE_MUTEX(xen_cpu_lock);
+
+static int xen_acpi_pad_idle_cpus(unsigned int idle_nums)
+{
+	struct xen_platform_op op;
+
+	op.cmd =3D XENPF_core_parking;
+	op.u.core_parking.type =3D XEN_CORE_PARKING_SET;
+	op.u.core_parking.idle_nums =3D idle_nums;
+
+	return HYPERVISOR_dom0_op(&op);
+}
+
+static int xen_acpi_pad_idle_cpus_num(void)
+{
+	struct xen_platform_op op;
+
+	op.cmd =3D XENPF_core_parking;
+	op.u.core_parking.type =3D XEN_CORE_PARKING_GET;
+
+	return HYPERVISOR_dom0_op(&op)
+	       ?: op.u.core_parking.idle_nums;
+}
+
+/*
+ * Query firmware how many CPUs should be idle
+ * return -1 on failure
+ */
+static int acpi_pad_pur(acpi_handle handle)
+{
+	struct acpi_buffer buffer =3D {ACPI_ALLOCATE_BUFFER, NULL};
+	union acpi_object *package;
+	int num =3D -1;
+
+	if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))
+		return num;
+
+	if (!buffer.length || !buffer.pointer)
+		return num;
+
+	package =3D buffer.pointer;
+
+	if (package->type =3D=3D ACPI_TYPE_PACKAGE &&
+		package->package.count =3D=3D 2 &&
+		package->package.elements[0].integer.value =3D=3D 1) /* rev 1 */
+		num =3D package->package.elements[1].integer.value;
+
+	kfree(buffer.pointer);
+	return num;
+}
+
+/* Notify firmware how many CPUs are idle */
+static void acpi_pad_ost(acpi_handle handle, int stat,
+	uint32_t idle_nums)
+{
+	union acpi_object params[3] =3D {
+		{.type =3D ACPI_TYPE_INTEGER,},
+		{.type =3D ACPI_TYPE_INTEGER,},
+		{.type =3D ACPI_TYPE_BUFFER,},
+	};
+	struct acpi_object_list arg_list =3D {3, params};
+
+	params[0].integer.value =3D ACPI_PROCESSOR_AGGREGATOR_NOTIFY;
+	params[1].integer.value =3D  stat;
+	params[2].buffer.length =3D 4;
+	params[2].buffer.pointer =3D (void *)&idle_nums;
+	acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
+}
+
+static void acpi_pad_handle_notify(acpi_handle handle)
+{
+	int idle_nums;
+
+	mutex_lock(&xen_cpu_lock);
+	idle_nums =3D acpi_pad_pur(handle);
+	if (idle_nums < 0) {
+		mutex_unlock(&xen_cpu_lock);
+		return;
+	}
+
+	idle_nums =3D xen_acpi_pad_idle_cpus(idle_nums)
+		    ?: xen_acpi_pad_idle_cpus_num();
+	if (idle_nums >=3D 0)
+		acpi_pad_ost(handle, 0, idle_nums);
+	mutex_unlock(&xen_cpu_lock);
+}
+
+static void acpi_pad_notify(acpi_handle handle, u32 event,
+	void *data)
+{
+	switch (event) {
+	case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
+		acpi_pad_handle_notify(handle);
+		break;
+	default:
+		pr_warn("Unsupported event [0x%x]\n", event);
+		break;
+	}
+}
+
+static int acpi_pad_add(struct acpi_device *device)
+{
+	acpi_status status;
+
+	strcpy(acpi_device_name(device), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
+	strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);
+
+	status =3D acpi_install_notify_handler(device->handle,
+		ACPI_DEVICE_NOTIFY, acpi_pad_notify, device);
+	if (ACPI_FAILURE(status))
+		return -ENODEV;
+
+	return 0;
+}
+
+static int acpi_pad_remove(struct acpi_device *device,
+	int type)
+{
+	mutex_lock(&xen_cpu_lock);
+	xen_acpi_pad_idle_cpus(0);
+	mutex_unlock(&xen_cpu_lock);
+
+	acpi_remove_notify_handler(device->handle,
+		ACPI_DEVICE_NOTIFY, acpi_pad_notify);
+	return 0;
+}
+
+static const struct acpi_device_id pad_device_ids[] =3D {
+	{"ACPI000C", 0},
+	{"", 0},
+};
+
+static struct acpi_driver acpi_pad_driver =3D {
+	.name =3D "processor_aggregator",
+	.class =3D ACPI_PROCESSOR_AGGREGATOR_CLASS,
+	.ids =3D pad_device_ids,
+	.ops =3D {
+		.add =3D acpi_pad_add,
+		.remove =3D acpi_pad_remove,
+	},
+};
+
+static int __init xen_acpi_pad_init(void)
+{
+	/* Only DOM0 is responsible for Xen acpi pad */
+	if (!xen_initial_domain())
+		return -ENODEV;
+
+	/* Only Xen4.2 or later support Xen acpi pad */
+	if (!xen_running_on_version_or_later(4, 2))
+		return -ENODEV;
+
+	return acpi_bus_register_driver(&acpi_pad_driver);
+}
+subsys_initcall(xen_acpi_pad_init);
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platf=
orm.h
index 4755b5f..5e36932 100644
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
@@ -324,6 +324,22 @@ struct xenpf_cpu_ol {
 };
 DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
=20
+/*
+ * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd,
+ * which are already occupied at Xen hypervisor side.
+ */
+#define XENPF_core_parking     60
+struct xenpf_core_parking {
+	/* IN variables */
+#define XEN_CORE_PARKING_SET   1
+#define XEN_CORE_PARKING_GET   2
+	uint32_t type;
+	/* IN variables:  set cpu nums expected to be idled */
+	/* OUT variables: get cpu nums actually be idled */
+	uint32_t idle_nums;
+};
+DEFINE_GUEST_HANDLE_STRUCT(xenpf_core_parking);
+
 struct xen_platform_op {
 	uint32_t cmd;
 	uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -341,6 +357,7 @@ struct xen_platform_op {
 		struct xenpf_set_processor_pminfo set_pminfo;
 		struct xenpf_pcpuinfo          pcpu_info;
 		struct xenpf_cpu_ol            cpu_ol;
+		struct xenpf_core_parking      core_parking;
 		uint8_t                        pad[128];
 	} u;
 };
diff --git a/include/xen/interface/version.h b/include/xen/interface/versio=
n.h
index 7ff6498..96d8d3d 100644
--- a/include/xen/interface/version.h
+++ b/include/xen/interface/version.h
@@ -63,4 +63,19 @@ struct xen_feature_info {
 /* arg =3D=3D xen_domain_handle_t. */
 #define XENVER_guest_handle 8
=20
+/* Check if running on Xen version (major, minor) or later */
+static inline bool
+xen_running_on_version_or_later(unsigned int major, unsigned int minor)
+{
+	unsigned int version;
+
+	if (!xen_domain())
+		return false;
+
+	version =3D HYPERVISOR_xen_version(XENVER_version, NULL);
+	if ((((version >> 16) =3D=3D major) && ((version & 0xffff) >=3D minor)) |=
|
+		((version >> 16) > major))
+		return true;
+	return false;
+}
 #endif /* __XEN_PUBLIC_VERSION_H__ */
--=20
1.7.1

--_002_DE8DF0795D48FD4CA783C40EC829233537BF47SHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
	name="0001-Xen-acpi-ACPI-PAD-driver.patch"
Content-Description: 0001-Xen-acpi-ACPI-PAD-driver.patch
Content-Disposition: attachment;
	filename="0001-Xen-acpi-ACPI-PAD-driver.patch"; size=8582;
	creation-date="Wed, 07 Nov 2012 17:23:53 GMT";
	modification-date="Thu, 08 Nov 2012 01:12:02 GMT"
Content-Transfer-Encoding: base64

RnJvbSA3NzZiOGYzMTg1OGY5OTIwZTA3MTJhMjIzMmZjNWZiZDg1MDE4NzVjIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBMaXUsIEppbnNvbmcgPGppbnNvbmcubGl1QGludGVsLmNvbT4K
RGF0ZTogVGh1LCA4IE5vdiAyMDEyIDA5OjA2OjIyICswODAwClN1YmplY3Q6IFtQQVRDSCAxLzJd
IFhlbi9hY3BpOiBBQ1BJIFBBRCBkcml2ZXIKClBBRCBpcyBhY3BpIFByb2Nlc3NvciBBZ2dyZWdh
dG9yIERldmljZSB3aGljaCBwcm92aWRlcyBhIGNvbnRyb2wgcG9pbnQKdGhhdCBlbmFibGVzIHRo
ZSBwbGF0Zm9ybSB0byBwZXJmb3JtIHNwZWNpZmljIHByb2Nlc3NvciBjb25maWd1cmF0aW9uCmFu
ZCBjb250cm9sIHRoYXQgYXBwbGllcyB0byBhbGwgcHJvY2Vzc29ycyBpbiB0aGUgcGxhdGZv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JzaW9uID4+IDE2KSA9PSBtYWpvcikgJiYgKCh2
ZXJzaW9uICYgMHhmZmZmKSA+PSBtaW5vcikpIHx8CisJCSgodmVyc2lvbiA+PiAxNikgPiBtYWpv
cikpCisJCXJldHVybiB0cnVlOworCXJldHVybiBmYWxzZTsKK30KICNlbmRpZiAvKiBfX1hFTl9Q
VUJMSUNfVkVSU0lPTl9IX18gKi8KLS0gCjEuNy4xCgo=

--_002_DE8DF0795D48FD4CA783C40EC829233537BF47SHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_002_DE8DF0795D48FD4CA783C40EC829233537BF47SHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Thu Nov 08 05:44:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 05:44:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWKuo-0000TH-Rc; Thu, 08 Nov 2012 05:44:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TWKun-0000T8-Oi
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 05:44:33 +0000
Received: from [85.158.143.35:37857] by server-1.bemta-4.messagelabs.com id
	8D/A4-27934-1C64B905; Thu, 08 Nov 2012 05:44:33 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1352353471!5729140!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzYyOTk3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10323 invoked from network); 8 Nov 2012 05:44:32 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-5.tower-21.messagelabs.com with SMTP;
	8 Nov 2012 05:44:32 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 07 Nov 2012 21:43:56 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,736,1344236400"; 
	d="scan'208,223";a="216653655"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by orsmga001.jf.intel.com with ESMTP; 07 Nov 2012 21:44:30 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 21:44:29 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Thu, 8 Nov 2012 13:44:28 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thread-Topic: [PATCH v2 2/2] Xen/acpi: revert pad config check in
	xen_check_mwait
Thread-Index: Ac29dB4WcWRk6UxxSqmLuVimXOjUhQ==
Date: Thu, 8 Nov 2012 05:44:28 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537BF64@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_002_DE8DF0795D48FD4CA783C40EC829233537BF64SHSMSX101ccrcorpi_"
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH v2 2/2] Xen/acpi: revert pad config check in
	xen_check_mwait
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_DE8DF0795D48FD4CA783C40EC829233537BF64SHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

With Xen acpi pad logic added into kernel, we can now revert xen mwait rela=
ted
patch df88b2d96e36d9a9e325bfcd12eb45671cbbc937. The reason is, when running=
 under
newer Xen platform, Xen pad driver would be early loaded, so native pad dri=
ver
would fail to be loaded, and hence no mwait/monitor #UD risk again.

Another point is, only Xen4.2 or later support Xen acpi pad, so we won't ex=
pose
mwait cpuid capability when running under older Xen platform.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 arch/x86/xen/enlighten.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 586d838..548296f 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -287,8 +287,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *b=
x,
=20
 static bool __init xen_check_mwait(void)
 {
-#if defined(CONFIG_ACPI) && !defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR) && =
\
-	!defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR_MODULE)
+#ifdef CONFIG_ACPI
 	struct xen_platform_op op =3D {
 		.cmd			=3D XENPF_set_processor_pminfo,
 		.u.set_pminfo.id	=3D -1,
@@ -309,6 +308,13 @@ static bool __init xen_check_mwait(void)
 	if (!xen_initial_domain())
 		return false;
=20
+	/*
+	 * When running under platform earlier than Xen4.2, do not expose
+	 * mwait, to avoid the risk of loading native acpi pad driver
+	 */
+	if (!xen_running_on_version_or_later(4, 2))
+		return false;
+
 	ax =3D 1;
 	cx =3D 0;
=20
--=20
1.7.1

--_002_DE8DF0795D48FD4CA783C40EC829233537BF64SHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
	name="0002-Xen-acpi-revert-pad-config-check-in-xen_check_mwait.patch"
Content-Description: 0002-Xen-acpi-revert-pad-config-check-in-xen_check_mwait.patch
Content-Disposition: attachment;
	filename="0002-Xen-acpi-revert-pad-config-check-in-xen_check_mwait.patch";
	size=1709; creation-date="Wed, 07 Nov 2012 17:23:53 GMT";
	modification-date="Thu, 08 Nov 2012 01:12:02 GMT"
Content-Transfer-Encoding: base64

RnJvbSBlODA0ZDU0N2JmZjBmN2NlMTA4ZTJiYjk1ODNmNjU3NzBkYzk3NDRiIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBMaXUsIEppbnNvbmcgPGppbnNvbmcubGl1QGludGVsLmNvbT4K
RGF0ZTogVGh1LCA4IE5vdiAyMDEyIDA5OjA5OjE5ICswODAwClN1YmplY3Q6IFtQQVRDSCAyLzJd
IFhlbi9hY3BpOiByZXZlcnQgcGFkIGNvbmZpZyBjaGVjayBpbiB4ZW5fY2hlY2tfbXdhaXQKCldp
dGggWGVuIGFjcGkgcGFkIGxvZ2ljIGFkZGVkIGludG8ga2VybmVsLCB3ZSBjYW4gbm93IHJldmVy
dCB4ZW4gbXdhaXQgcmVsYXRlZApwYXRjaCBkZjg4YjJkOTZlMzZkOWE5ZTMyNWJmY2QxM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pCiB7Ci0jaWYgZGVmaW5lZChDT05GSUdfQUNQSSkgJiYg
IWRlZmluZWQoQ09ORklHX0FDUElfUFJPQ0VTU09SX0FHR1JFR0FUT1IpICYmIFwKLQkhZGVmaW5l
ZChDT05GSUdfQUNQSV9QUk9DRVNTT1JfQUdHUkVHQVRPUl9NT0RVTEUpCisjaWZkZWYgQ09ORklH
X0FDUEkKIAlzdHJ1Y3QgeGVuX3BsYXRmb3JtX29wIG9wID0gewogCQkuY21kCQkJPSBYRU5QRl9z
ZXRfcHJvY2Vzc29yX3BtaW5mbywKIAkJLnUuc2V0X3BtaW5mby5pZAk9IC0xLApAQCAtMzA5LDYg
KzMwOCwxMyBAQCBzdGF0aWMgYm9vbCBfX2luaXQgeGVuX2NoZWNrX213YWl0KHZvaWQpCiAJaWYg
KCF4ZW5faW5pdGlhbF9kb21haW4oKSkKIAkJcmV0dXJuIGZhbHNlOwogCisJLyoKKwkgKiBXaGVu
IHJ1bm5pbmcgdW5kZXIgcGxhdGZvcm0gZWFybGllciB0aGFuIFhlbjQuMiwgZG8gbm90IGV4cG9z
ZQorCSAqIG13YWl0LCB0byBhdm9pZCB0aGUgcmlzayBvZiBsb2FkaW5nIG5hdGl2ZSBhY3BpIHBh
ZCBkcml2ZXIKKwkgKi8KKwlpZiAoIXhlbl9ydW5uaW5nX29uX3ZlcnNpb25fb3JfbGF0ZXIoNCwg
MikpCisJCXJldHVybiBmYWxzZTsKKwogCWF4ID0gMTsKIAljeCA9IDA7CiAKLS0gCjEuNy4xCgo=

--_002_DE8DF0795D48FD4CA783C40EC829233537BF64SHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_002_DE8DF0795D48FD4CA783C40EC829233537BF64SHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Thu Nov 08 05:44:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 05:44:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWKuo-0000TH-Rc; Thu, 08 Nov 2012 05:44:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TWKun-0000T8-Oi
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 05:44:33 +0000
Received: from [85.158.143.35:37857] by server-1.bemta-4.messagelabs.com id
	8D/A4-27934-1C64B905; Thu, 08 Nov 2012 05:44:33 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1352353471!5729140!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzYyOTk3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10323 invoked from network); 8 Nov 2012 05:44:32 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-5.tower-21.messagelabs.com with SMTP;
	8 Nov 2012 05:44:32 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 07 Nov 2012 21:43:56 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,736,1344236400"; 
	d="scan'208,223";a="216653655"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by orsmga001.jf.intel.com with ESMTP; 07 Nov 2012 21:44:30 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 7 Nov 2012 21:44:29 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Thu, 8 Nov 2012 13:44:28 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thread-Topic: [PATCH v2 2/2] Xen/acpi: revert pad config check in
	xen_check_mwait
Thread-Index: Ac29dB4WcWRk6UxxSqmLuVimXOjUhQ==
Date: Thu, 8 Nov 2012 05:44:28 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233537BF64@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_002_DE8DF0795D48FD4CA783C40EC829233537BF64SHSMSX101ccrcorpi_"
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH v2 2/2] Xen/acpi: revert pad config check in
	xen_check_mwait
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_DE8DF0795D48FD4CA783C40EC829233537BF64SHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

With Xen acpi pad logic added into kernel, we can now revert xen mwait rela=
ted
patch df88b2d96e36d9a9e325bfcd12eb45671cbbc937. The reason is, when running=
 under
newer Xen platform, Xen pad driver would be early loaded, so native pad dri=
ver
would fail to be loaded, and hence no mwait/monitor #UD risk again.

Another point is, only Xen4.2 or later support Xen acpi pad, so we won't ex=
pose
mwait cpuid capability when running under older Xen platform.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 arch/x86/xen/enlighten.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 586d838..548296f 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -287,8 +287,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *b=
x,
=20
 static bool __init xen_check_mwait(void)
 {
-#if defined(CONFIG_ACPI) && !defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR) && =
\
-	!defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR_MODULE)
+#ifdef CONFIG_ACPI
 	struct xen_platform_op op =3D {
 		.cmd			=3D XENPF_set_processor_pminfo,
 		.u.set_pminfo.id	=3D -1,
@@ -309,6 +308,13 @@ static bool __init xen_check_mwait(void)
 	if (!xen_initial_domain())
 		return false;
=20
+	/*
+	 * When running under platform earlier than Xen4.2, do not expose
+	 * mwait, to avoid the risk of loading native acpi pad driver
+	 */
+	if (!xen_running_on_version_or_later(4, 2))
+		return false;
+
 	ax =3D 1;
 	cx =3D 0;
=20
--=20
1.7.1

--_002_DE8DF0795D48FD4CA783C40EC829233537BF64SHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
	name="0002-Xen-acpi-revert-pad-config-check-in-xen_check_mwait.patch"
Content-Description: 0002-Xen-acpi-revert-pad-config-check-in-xen_check_mwait.patch
Content-Disposition: attachment;
	filename="0002-Xen-acpi-revert-pad-config-check-in-xen_check_mwait.patch";
	size=1709; creation-date="Wed, 07 Nov 2012 17:23:53 GMT";
	modification-date="Thu, 08 Nov 2012 01:12:02 GMT"
Content-Transfer-Encoding: base64

RnJvbSBlODA0ZDU0N2JmZjBmN2NlMTA4ZTJiYjk1ODNmNjU3NzBkYzk3NDRiIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBMaXUsIEppbnNvbmcgPGppbnNvbmcubGl1QGludGVsLmNvbT4K
RGF0ZTogVGh1LCA4IE5vdiAyMDEyIDA5OjA5OjE5ICswODAwClN1YmplY3Q6IFtQQVRDSCAyLzJd
IFhlbi9hY3BpOiByZXZlcnQgcGFkIGNvbmZpZyBjaGVjayBpbiB4ZW5fY2hlY2tfbXdhaXQKCldp
dGggWGVuIGFjcGkgcGFkIGxvZ2ljIGFkZGVkIGludG8ga2VybmVsLCB3ZSBjYW4gbm93IHJldmVy
dCB4ZW4gbXdhaXQgcmVsYXRlZApwYXRjaCBkZjg4YjJkOTZlMzZkOWE5ZTMyNWJmY2QxMmViNDU2
NzFjYmJjOTM3LiBUaGUgcmVhc29uIGlzLCB3aGVuIHJ1bm5pbmcgdW5kZXIKbmV3ZXIgWGVuIHBs
YXRmb3JtLCBYZW4gcGFkIGRyaXZlciB3b3VsZCBiZSBlYXJseSBsb2FkZWQsIHNvIG5hdGl2ZSBw
YWQgZHJpdmVyCndvdWxkIGZhaWwgdG8gYmUgbG9hZGVkLCBhbmQgaGVuY2Ugbm8gbXdhaXQvbW9u
aXRvciAjVUQgcmlzayBhZ2Fpbi4KCkFub3RoZXIgcG9pbnQgaXMsIG9ubHkgWGVuNC4yIG9yIGxh
dGVyIHN1cHBvcnQgWGVuIGFjcGkgcGFkLCBzbyB3ZSB3b24ndCBleHBvc2UKbXdhaXQgY3B1aWQg
Y2FwYWJpbGl0eSB3aGVuIHJ1bm5pbmcgdW5kZXIgb2xkZXIgWGVuIHBsYXRmb3JtLgoK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hbHNlOwogCisJLyoKKwkgKiBXaGVu
IHJ1bm5pbmcgdW5kZXIgcGxhdGZvcm0gZWFybGllciB0aGFuIFhlbjQuMiwgZG8gbm90IGV4cG9z
ZQorCSAqIG13YWl0LCB0byBhdm9pZCB0aGUgcmlzayBvZiBsb2FkaW5nIG5hdGl2ZSBhY3BpIHBh
ZCBkcml2ZXIKKwkgKi8KKwlpZiAoIXhlbl9ydW5uaW5nX29uX3ZlcnNpb25fb3JfbGF0ZXIoNCwg
MikpCisJCXJldHVybiBmYWxzZTsKKwogCWF4ID0gMTsKIAljeCA9IDA7CiAKLS0gCjEuNy4xCgo=

--_002_DE8DF0795D48FD4CA783C40EC829233537BF64SHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_002_DE8DF0795D48FD4CA783C40EC829233537BF64SHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Thu Nov 08 07:35:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 07:35:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWMdi-00017f-Nt; Thu, 08 Nov 2012 07:35:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWMdg-00017a-Dm
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 07:35:00 +0000
Received: from [85.158.143.99:14261] by server-3.bemta-4.messagelabs.com id
	A3/A5-06841-3A06B905; Thu, 08 Nov 2012 07:34:59 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352360099!28515188!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30950 invoked from network); 8 Nov 2012 07:34:59 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-216.messagelabs.com with SMTP;
	8 Nov 2012 07:34:59 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 07:34:58 +0000
Message-Id: <509B6EB002000078000A71CB@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 07:34:56 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir@xen.org>
References: <509A958E02000078000A7039@nat28.tlf.novell.com>
	<CCC0468D.51958%keir@xen.org>
In-Reply-To: <CCC0468D.51958%keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/emul: only emulate possibly operand
 sizes for POPA
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 07.11.12 at 18:10, Keir Fraser <keir@xen.org> wrote:
> On 07/11/2012 16:08, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>> This opcode neither support 1-byte operands, nor does it support 8-byte
>> ones (since the opcode is undefined in 64-bit mode). Simplify the code
>> accordingly.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> 
>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>> @@ -1996,13 +1996,10 @@ x86_emulate(
>>              if ( (rc = read_ulong(x86_seg_ss, sp_post_inc(op_bytes),
>>                                    &dst.val, op_bytes, ctxt, ops)) != 0 )
>>                  goto done;
>> -            switch ( op_bytes )
>> -            {
>> -            case 1: *(uint8_t  *)regs[i] = (uint8_t)dst.val; break;
>> -            case 2: *(uint16_t *)regs[i] = (uint16_t)dst.val; break;
>> -            case 4: *regs[i] = (uint32_t)dst.val; break; /* 64b: zero-ext */
>> -            case 8: *regs[i] = dst.val; break;
>> -            }
>> +            if ( op_bytes != 2 )
>> +                *regs[i] = (uint32_t)dst.val; /* 64b: zero-ext */
>> +            else
>> +                *(uint16_t *)regs[i] = (uint16_t)dst.val;
> 
> Would prefer:
>  if ( op_bytes == 2 )
>      *(uint16_t *)regs[i] = (uint16_t)dst.val;
>  else
>      *regs[i] = dst.val;
> 
> Handles the exceptional case immediately after its predicate.

I had it that way first, but compilers tend to prefer (in terms of
static branch prediction) the if() body over the else one. Doesn't
matter that much here of course, but I'm generally trying to
follow such guidelines even in non performance critical paths so
that in case code gets cloned elsewhere it doesn't require extra
reviewing or adjustment.

> And the cast
> from uint32_t, and 64b-related comment, are pointless and in fact misleading
> in the default case, since as you say the instruction is invalid in 64-bit
> mode.

And I considered that aspect too: Even if invalid in 64-bit mode, it
is valid in compatibility mode, and in that case the zero-extension
makes sense (as does the comment).

Jan

> Apart from that:
> Acked-by: Keir Fraser <keir@xen.org>
> 
>  -- Keir
> 
>>          }
>>          break;
>>      }
>> 
>> 
>> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org 
>> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 07:35:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 07:35:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWMdi-00017f-Nt; Thu, 08 Nov 2012 07:35:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWMdg-00017a-Dm
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 07:35:00 +0000
Received: from [85.158.143.99:14261] by server-3.bemta-4.messagelabs.com id
	A3/A5-06841-3A06B905; Thu, 08 Nov 2012 07:34:59 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352360099!28515188!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30950 invoked from network); 8 Nov 2012 07:34:59 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-216.messagelabs.com with SMTP;
	8 Nov 2012 07:34:59 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 07:34:58 +0000
Message-Id: <509B6EB002000078000A71CB@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 07:34:56 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir@xen.org>
References: <509A958E02000078000A7039@nat28.tlf.novell.com>
	<CCC0468D.51958%keir@xen.org>
In-Reply-To: <CCC0468D.51958%keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/emul: only emulate possibly operand
 sizes for POPA
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 07.11.12 at 18:10, Keir Fraser <keir@xen.org> wrote:
> On 07/11/2012 16:08, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>> This opcode neither support 1-byte operands, nor does it support 8-byte
>> ones (since the opcode is undefined in 64-bit mode). Simplify the code
>> accordingly.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> 
>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>> @@ -1996,13 +1996,10 @@ x86_emulate(
>>              if ( (rc = read_ulong(x86_seg_ss, sp_post_inc(op_bytes),
>>                                    &dst.val, op_bytes, ctxt, ops)) != 0 )
>>                  goto done;
>> -            switch ( op_bytes )
>> -            {
>> -            case 1: *(uint8_t  *)regs[i] = (uint8_t)dst.val; break;
>> -            case 2: *(uint16_t *)regs[i] = (uint16_t)dst.val; break;
>> -            case 4: *regs[i] = (uint32_t)dst.val; break; /* 64b: zero-ext */
>> -            case 8: *regs[i] = dst.val; break;
>> -            }
>> +            if ( op_bytes != 2 )
>> +                *regs[i] = (uint32_t)dst.val; /* 64b: zero-ext */
>> +            else
>> +                *(uint16_t *)regs[i] = (uint16_t)dst.val;
> 
> Would prefer:
>  if ( op_bytes == 2 )
>      *(uint16_t *)regs[i] = (uint16_t)dst.val;
>  else
>      *regs[i] = dst.val;
> 
> Handles the exceptional case immediately after its predicate.

I had it that way first, but compilers tend to prefer (in terms of
static branch prediction) the if() body over the else one. Doesn't
matter that much here of course, but I'm generally trying to
follow such guidelines even in non performance critical paths so
that in case code gets cloned elsewhere it doesn't require extra
reviewing or adjustment.

> And the cast
> from uint32_t, and 64b-related comment, are pointless and in fact misleading
> in the default case, since as you say the instruction is invalid in 64-bit
> mode.

And I considered that aspect too: Even if invalid in 64-bit mode, it
is valid in compatibility mode, and in that case the zero-extension
makes sense (as does the comment).

Jan

> Apart from that:
> Acked-by: Keir Fraser <keir@xen.org>
> 
>  -- Keir
> 
>>          }
>>          break;
>>      }
>> 
>> 
>> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org 
>> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 07:38:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 07:38:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWMgC-0001Ck-9U; Thu, 08 Nov 2012 07:37:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWMgA-0001Cf-TT
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 07:37:35 +0000
Received: from [85.158.137.99:44051] by server-11.bemta-3.messagelabs.com id
	1B/5A-19361-E316B905; Thu, 08 Nov 2012 07:37:34 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1352360253!15089800!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16473 invoked from network); 8 Nov 2012 07:37:33 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 07:37:33 -0000
Received: by mail-wi0-f173.google.com with SMTP id cb5so1891566wib.14
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 23:37:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=dkEYtIGXkZja80+225f6HTVoWLULU4NqUAACnpeWEkI=;
	b=05IGUNGocwQb/M88cIEsmheXiS2eVJh+Iu04wLcjpMxf/SEYJzM5x2wG2Qx+z2gB1g
	IX6lDuzXJYzZUtZHYtJ7X/3Gkbnz4LVBjIfwzx+/pAR4oV+7o1WdwaAV9MwVgZOQ4KA8
	4fF1kufHAbNa06WGbXZ2XOYophq8R07JNQ2TM7bNFpvnQdVO4S5L2PQx2z5forFyE6G5
	/t8QA8uhJulCX3N2tqCq0LsORMvm+TMR36xiipHjGb/DfAQX7fkDjcGDN5nlao0VpLDM
	myrvb9EVd4aoeDNjZz1mpts5Siio7qiz4oXcxOqBNLQLTG9YN5a4W9Gx8qhAkV0A7TpA
	lNzA==
Received: by 10.180.84.41 with SMTP id v9mr11569010wiy.8.1352360226735;
	Wed, 07 Nov 2012 23:37:06 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id en20sm7014237wid.4.2012.11.07.23.36.58
	(version=SSLv3 cipher=OTHER); Wed, 07 Nov 2012 23:37:06 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 07:36:57 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Jan Beulich <JBeulich@suse.com>
Message-ID: <CCC11199.443CE%keir.xen@gmail.com>
Thread-Topic: Proposed new "memory capacity claim" hypercall/feature
Thread-Index: Ac29g9SrP69REaOlQ0SR3bcqFiIGyA==
In-Reply-To: <7563be37-62f1-472e-9aec-1d0c55fa7c29@default>
Mime-version: 1.0
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 07/11/2012 22:17, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:

> I think this brings us back to the proposed "claim" hypercall/subop.
> Unless there are further objections or suggestions for different
> approaches, I'll commence prototyping it, OK?

Yes, in fact I thought you'd started already!

 K.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 07:38:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 07:38:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWMgC-0001Ck-9U; Thu, 08 Nov 2012 07:37:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWMgA-0001Cf-TT
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 07:37:35 +0000
Received: from [85.158.137.99:44051] by server-11.bemta-3.messagelabs.com id
	1B/5A-19361-E316B905; Thu, 08 Nov 2012 07:37:34 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1352360253!15089800!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16473 invoked from network); 8 Nov 2012 07:37:33 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 07:37:33 -0000
Received: by mail-wi0-f173.google.com with SMTP id cb5so1891566wib.14
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 23:37:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=dkEYtIGXkZja80+225f6HTVoWLULU4NqUAACnpeWEkI=;
	b=05IGUNGocwQb/M88cIEsmheXiS2eVJh+Iu04wLcjpMxf/SEYJzM5x2wG2Qx+z2gB1g
	IX6lDuzXJYzZUtZHYtJ7X/3Gkbnz4LVBjIfwzx+/pAR4oV+7o1WdwaAV9MwVgZOQ4KA8
	4fF1kufHAbNa06WGbXZ2XOYophq8R07JNQ2TM7bNFpvnQdVO4S5L2PQx2z5forFyE6G5
	/t8QA8uhJulCX3N2tqCq0LsORMvm+TMR36xiipHjGb/DfAQX7fkDjcGDN5nlao0VpLDM
	myrvb9EVd4aoeDNjZz1mpts5Siio7qiz4oXcxOqBNLQLTG9YN5a4W9Gx8qhAkV0A7TpA
	lNzA==
Received: by 10.180.84.41 with SMTP id v9mr11569010wiy.8.1352360226735;
	Wed, 07 Nov 2012 23:37:06 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id en20sm7014237wid.4.2012.11.07.23.36.58
	(version=SSLv3 cipher=OTHER); Wed, 07 Nov 2012 23:37:06 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 07:36:57 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Jan Beulich <JBeulich@suse.com>
Message-ID: <CCC11199.443CE%keir.xen@gmail.com>
Thread-Topic: Proposed new "memory capacity claim" hypercall/feature
Thread-Index: Ac29g9SrP69REaOlQ0SR3bcqFiIGyA==
In-Reply-To: <7563be37-62f1-472e-9aec-1d0c55fa7c29@default>
Mime-version: 1.0
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 07/11/2012 22:17, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:

> I think this brings us back to the proposed "claim" hypercall/subop.
> Unless there are further objections or suggestions for different
> approaches, I'll commence prototyping it, OK?

Yes, in fact I thought you'd started already!

 K.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 07:43:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 07:43:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWMl7-0001Ok-0y; Thu, 08 Nov 2012 07:42:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWMl5-0001Ob-Ch
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 07:42:39 +0000
Received: from [85.158.138.51:45223] by server-14.bemta-3.messagelabs.com id
	05/DD-12788-E626B905; Thu, 08 Nov 2012 07:42:38 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1352360557!29153547!1
X-Originating-IP: [209.85.212.179]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2328 invoked from network); 8 Nov 2012 07:42:38 -0000
Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com)
	(209.85.212.179)
	by server-9.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 07:42:38 -0000
Received: by mail-wi0-f179.google.com with SMTP id hm6so692759wib.14
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 23:42:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=SFR0O6a5UBzZzOncaD7u/kbu8ZAIEyJfGEbkR3UdHjg=;
	b=w2T0umpTOJMTfo3zhlIM38u5+vMmPywss0ORhf6STEOWZcLk6Q3dOxxhe9GWoFHFq6
	ZqmDrh/gLyBosvg8aIVy9sBbAgyhyIc2ckZJ/TRgQ57Se8iS+ex5vMOalqjlz4N7lqF5
	ohEUSe4xINcthB9RcBQY5GpufdRTBDXtPEMgQA11+ZePgNImI/drGjLIPx+l91CZBQrG
	uFwbQ7arh+NYZHqRSQDSpNPPFi6IWOBbRFt4QclVkuDVKvfGbL08Ekdu+kLSkdBoyCpb
	cF86kRfQk0umtDn3mrahyDVZtTjI71dhmOy+FU8HR+zCeVe4C+4cl81m1JVmdFz0Wn8C
	svog==
Received: by 10.216.199.10 with SMTP id w10mr2954063wen.198.1352360557668;
	Wed, 07 Nov 2012 23:42:37 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id w8sm6176643wiv.8.2012.11.07.23.42.36
	(version=SSLv3 cipher=OTHER); Wed, 07 Nov 2012 23:42:37 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 07:42:35 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Andres Lagar-Cavilla <andreslc@gridcentric.ca>, Tim Deegan <tim@xen.org>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Message-ID: <CCC112EB.443D1%keir.xen@gmail.com>
Thread-Topic: Wait Queues
Thread-Index: Ac29hJ4imi/5WZj6yUCLAsgySkLPxg==
In-Reply-To: <25D45C62-FB0E-4345-A5A1-9A37F219477B@gridcentric.ca>
Mime-version: 1.0
Subject: Re: [Xen-devel] Wait Queues
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 03:22, "Andres Lagar-Cavilla" <andreslc@gridcentric.ca> wrote:

>> I'd like to propose an approach that ensures that as long some propertie=
s are
>> met, arbitrary wait queue sleep is allowed. Here are the properties:
>> 1. Third parties servicing a wait queue sleep are indeed third parties. =
In
>> other words, dom0 does not do paging.
>> 2. Vcpus of a wait queue servicing domain may never go to sleep on a wait
>> queue during a foreign map.
>> 3. A guest vcpu may go to sleep on a wait queue holding any kinds of loc=
ks as
>> long as it does not hold the p2m lock.
> =

> N.B: I understand (now) this may cause any other vcpu contending on a lock
> held by the wait queue sleeper to not yield to the scheduler and pin its
> physical cpu.
> =

> What I am struggling with is coming up with a solution that doesn't turn
> hypervisor mm hacking into a locking minefield.
> =

> Linux fixes this with many kinds of sleeping synchronization primitives. A
> task can, for example, hold the mmap semaphore and sleep on a wait queue.=
 Is
> this the only way out of this mess? Not if wait queues force the vcpu to =
wake
> up on the same phys cpu it was using at the time of sleeping=8A.

Well, the forcing to wake up on same phys cpu it slept on is going to be
fixed. But it's not clear to me how that current restriction makes the
problem harder? What if you were running on a single-phys-cpu system?

As you have realised, the fact that all locks in Xen are spinlocks makes the
potential for deadlock very obvious. Someone else gets scheduled and takes
out the phys cpu by spinning on a lock that someone else is holding while
they are descheduled.

Linux-style sleeping mutexes might help. We could add those. They don't help
as readily as in the Linux case however! In some ways they push the deadlock
up one level of abstraction, to the virt cpu (vcpu). Consider single-vcpu
dom0 running a pager -- even if you are careful that the pager itself does
not acquire any locks that one of its clients may hold-while-sleeping, if
*anything* running in dom0 can acquire such a lock, you have an obvious
deadlock, as that will take out the dom0 vcpu and leave it blocked forever
waiting for a lock that is held while its holder waits for service from the
dom0 vcpu....

I don't think there is an easy solution here!

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 07:43:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 07:43:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWMl7-0001Ok-0y; Thu, 08 Nov 2012 07:42:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWMl5-0001Ob-Ch
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 07:42:39 +0000
Received: from [85.158.138.51:45223] by server-14.bemta-3.messagelabs.com id
	05/DD-12788-E626B905; Thu, 08 Nov 2012 07:42:38 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1352360557!29153547!1
X-Originating-IP: [209.85.212.179]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2328 invoked from network); 8 Nov 2012 07:42:38 -0000
Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com)
	(209.85.212.179)
	by server-9.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 07:42:38 -0000
Received: by mail-wi0-f179.google.com with SMTP id hm6so692759wib.14
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 23:42:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=SFR0O6a5UBzZzOncaD7u/kbu8ZAIEyJfGEbkR3UdHjg=;
	b=w2T0umpTOJMTfo3zhlIM38u5+vMmPywss0ORhf6STEOWZcLk6Q3dOxxhe9GWoFHFq6
	ZqmDrh/gLyBosvg8aIVy9sBbAgyhyIc2ckZJ/TRgQ57Se8iS+ex5vMOalqjlz4N7lqF5
	ohEUSe4xINcthB9RcBQY5GpufdRTBDXtPEMgQA11+ZePgNImI/drGjLIPx+l91CZBQrG
	uFwbQ7arh+NYZHqRSQDSpNPPFi6IWOBbRFt4QclVkuDVKvfGbL08Ekdu+kLSkdBoyCpb
	cF86kRfQk0umtDn3mrahyDVZtTjI71dhmOy+FU8HR+zCeVe4C+4cl81m1JVmdFz0Wn8C
	svog==
Received: by 10.216.199.10 with SMTP id w10mr2954063wen.198.1352360557668;
	Wed, 07 Nov 2012 23:42:37 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id w8sm6176643wiv.8.2012.11.07.23.42.36
	(version=SSLv3 cipher=OTHER); Wed, 07 Nov 2012 23:42:37 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 07:42:35 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Andres Lagar-Cavilla <andreslc@gridcentric.ca>, Tim Deegan <tim@xen.org>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Message-ID: <CCC112EB.443D1%keir.xen@gmail.com>
Thread-Topic: Wait Queues
Thread-Index: Ac29hJ4imi/5WZj6yUCLAsgySkLPxg==
In-Reply-To: <25D45C62-FB0E-4345-A5A1-9A37F219477B@gridcentric.ca>
Mime-version: 1.0
Subject: Re: [Xen-devel] Wait Queues
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 03:22, "Andres Lagar-Cavilla" <andreslc@gridcentric.ca> wrote:

>> I'd like to propose an approach that ensures that as long some propertie=
s are
>> met, arbitrary wait queue sleep is allowed. Here are the properties:
>> 1. Third parties servicing a wait queue sleep are indeed third parties. =
In
>> other words, dom0 does not do paging.
>> 2. Vcpus of a wait queue servicing domain may never go to sleep on a wait
>> queue during a foreign map.
>> 3. A guest vcpu may go to sleep on a wait queue holding any kinds of loc=
ks as
>> long as it does not hold the p2m lock.
> =

> N.B: I understand (now) this may cause any other vcpu contending on a lock
> held by the wait queue sleeper to not yield to the scheduler and pin its
> physical cpu.
> =

> What I am struggling with is coming up with a solution that doesn't turn
> hypervisor mm hacking into a locking minefield.
> =

> Linux fixes this with many kinds of sleeping synchronization primitives. A
> task can, for example, hold the mmap semaphore and sleep on a wait queue.=
 Is
> this the only way out of this mess? Not if wait queues force the vcpu to =
wake
> up on the same phys cpu it was using at the time of sleeping=8A.

Well, the forcing to wake up on same phys cpu it slept on is going to be
fixed. But it's not clear to me how that current restriction makes the
problem harder? What if you were running on a single-phys-cpu system?

As you have realised, the fact that all locks in Xen are spinlocks makes the
potential for deadlock very obvious. Someone else gets scheduled and takes
out the phys cpu by spinning on a lock that someone else is holding while
they are descheduled.

Linux-style sleeping mutexes might help. We could add those. They don't help
as readily as in the Linux case however! In some ways they push the deadlock
up one level of abstraction, to the virt cpu (vcpu). Consider single-vcpu
dom0 running a pager -- even if you are careful that the pager itself does
not acquire any locks that one of its clients may hold-while-sleeping, if
*anything* running in dom0 can acquire such a lock, you have an obvious
deadlock, as that will take out the dom0 vcpu and leave it blocked forever
waiting for a lock that is held while its holder waits for service from the
dom0 vcpu....

I don't think there is an easy solution here!

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 07:48:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 07:48:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWMqk-0001Xl-QC; Thu, 08 Nov 2012 07:48:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWMqj-0001Xf-6u
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 07:48:29 +0000
Received: from [85.158.143.99:28877] by server-1.bemta-4.messagelabs.com id
	2D/09-27934-CC36B905; Thu, 08 Nov 2012 07:48:28 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1352360907!18140530!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20021 invoked from network); 8 Nov 2012 07:48:27 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-8.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 07:48:27 -0000
Received: by mail-we0-f173.google.com with SMTP id t11so1322036wey.32
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 23:48:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=CiRFaG1bw3n11a05J0vIqYUevjm4eM2lapgdc970lBo=;
	b=j9q2BH+nxZNLxTxHd/wdo+sT+TyXF0hu3VQ9P/CLJuS2fIGibZnRc8RGBxf1KRyYt2
	o3K5qT1DaaTb82kjuonvwPk7ORSQ9+lIiHdOpntXrTcw4PuhMUpKFg+WnWau7HW9MEh8
	9djegs9XqJJYy9NSPAIT4cHNN2h/mXkJdqbO16MItcovqrVGH/gQpNH5lvOkXsQ3gh9A
	qIG6+CvfgQyvW2G/kQam/a1rp3oj6rNVYz5MVDS+o7F6Gb9rYdIHF1zMBi7t0YPf10BW
	66yfsm4jAoCkyty6Y7KeKQr73N9l45GQNLfpGI3eR3LFryQTckKV3ZZrqxUjD7JtRXWg
	Rp5w==
Received: by 10.180.82.162 with SMTP id j2mr11613216wiy.14.1352360907435;
	Wed, 07 Nov 2012 23:48:27 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id r10sm7066551wiz.0.2012.11.07.23.48.26
	(version=SSLv3 cipher=OTHER); Wed, 07 Nov 2012 23:48:26 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 07:48:23 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <CCC11447.443E2%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [PATCH] x86/emul: only emulate possibly operand
	sizes for POPA
Thread-Index: Ac29hW2O/l9HTu14qkKyDgnFBX+aiQ==
In-Reply-To: <509B6EB002000078000A71CB@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/emul: only emulate possibly operand
 sizes for POPA
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 07:34, "Jan Beulich" <JBeulich@suse.com> wrote:

>> Would prefer:
>>  if ( op_bytes == 2 )
>>      *(uint16_t *)regs[i] = (uint16_t)dst.val;
>>  else
>>      *regs[i] = dst.val;
>> 
>> Handles the exceptional case immediately after its predicate.
> 
> I had it that way first, but compilers tend to prefer (in terms of
> static branch prediction) the if() body over the else one. Doesn't
> matter that much here of course, but I'm generally trying to
> follow such guidelines even in non performance critical paths so
> that in case code gets cloned elsewhere it doesn't require extra
> reviewing or adjustment.

Should follow such guidelines where the optimisation matters. I think
shaping code to follow such guidelines all the time, is misguided. I'd
rather have the fractionally more readable version than the
possibly-fractionally faster version.

>> And the cast
>> from uint32_t, and 64b-related comment, are pointless and in fact misleading
>> in the default case, since as you say the instruction is invalid in 64-bit
>> mode.
> 
> And I considered that aspect too: Even if invalid in 64-bit mode, it
> is valid in compatibility mode, and in that case the zero-extension
> makes sense (as does the comment).

I did wonder. The top halves of 64b registers are not used in compatibility
mode. Are their contents at all guaranteed to be
maintained/updated/preserved in any meaningful way across transitions into
and out of compatibility mode? I wasn't aware they were, and in that case
the cast and comment are indeed pointless.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 07:48:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 07:48:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWMqk-0001Xl-QC; Thu, 08 Nov 2012 07:48:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWMqj-0001Xf-6u
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 07:48:29 +0000
Received: from [85.158.143.99:28877] by server-1.bemta-4.messagelabs.com id
	2D/09-27934-CC36B905; Thu, 08 Nov 2012 07:48:28 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1352360907!18140530!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20021 invoked from network); 8 Nov 2012 07:48:27 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-8.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 07:48:27 -0000
Received: by mail-we0-f173.google.com with SMTP id t11so1322036wey.32
	for <xen-devel@lists.xen.org>; Wed, 07 Nov 2012 23:48:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=CiRFaG1bw3n11a05J0vIqYUevjm4eM2lapgdc970lBo=;
	b=j9q2BH+nxZNLxTxHd/wdo+sT+TyXF0hu3VQ9P/CLJuS2fIGibZnRc8RGBxf1KRyYt2
	o3K5qT1DaaTb82kjuonvwPk7ORSQ9+lIiHdOpntXrTcw4PuhMUpKFg+WnWau7HW9MEh8
	9djegs9XqJJYy9NSPAIT4cHNN2h/mXkJdqbO16MItcovqrVGH/gQpNH5lvOkXsQ3gh9A
	qIG6+CvfgQyvW2G/kQam/a1rp3oj6rNVYz5MVDS+o7F6Gb9rYdIHF1zMBi7t0YPf10BW
	66yfsm4jAoCkyty6Y7KeKQr73N9l45GQNLfpGI3eR3LFryQTckKV3ZZrqxUjD7JtRXWg
	Rp5w==
Received: by 10.180.82.162 with SMTP id j2mr11613216wiy.14.1352360907435;
	Wed, 07 Nov 2012 23:48:27 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id r10sm7066551wiz.0.2012.11.07.23.48.26
	(version=SSLv3 cipher=OTHER); Wed, 07 Nov 2012 23:48:26 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 07:48:23 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <CCC11447.443E2%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [PATCH] x86/emul: only emulate possibly operand
	sizes for POPA
Thread-Index: Ac29hW2O/l9HTu14qkKyDgnFBX+aiQ==
In-Reply-To: <509B6EB002000078000A71CB@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/emul: only emulate possibly operand
 sizes for POPA
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 07:34, "Jan Beulich" <JBeulich@suse.com> wrote:

>> Would prefer:
>>  if ( op_bytes == 2 )
>>      *(uint16_t *)regs[i] = (uint16_t)dst.val;
>>  else
>>      *regs[i] = dst.val;
>> 
>> Handles the exceptional case immediately after its predicate.
> 
> I had it that way first, but compilers tend to prefer (in terms of
> static branch prediction) the if() body over the else one. Doesn't
> matter that much here of course, but I'm generally trying to
> follow such guidelines even in non performance critical paths so
> that in case code gets cloned elsewhere it doesn't require extra
> reviewing or adjustment.

Should follow such guidelines where the optimisation matters. I think
shaping code to follow such guidelines all the time, is misguided. I'd
rather have the fractionally more readable version than the
possibly-fractionally faster version.

>> And the cast
>> from uint32_t, and 64b-related comment, are pointless and in fact misleading
>> in the default case, since as you say the instruction is invalid in 64-bit
>> mode.
> 
> And I considered that aspect too: Even if invalid in 64-bit mode, it
> is valid in compatibility mode, and in that case the zero-extension
> makes sense (as does the comment).

I did wonder. The top halves of 64b registers are not used in compatibility
mode. Are their contents at all guaranteed to be
maintained/updated/preserved in any meaningful way across transitions into
and out of compatibility mode? I wasn't aware they were, and in that case
the cast and comment are indeed pointless.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 07:52:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 07:52:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWMuM-0001fq-EN; Thu, 08 Nov 2012 07:52:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TWMuK-0001fi-Oq
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 07:52:12 +0000
Received: from [85.158.143.99:32491] by server-3.bemta-4.messagelabs.com id
	9D/D4-06841-CA46B905; Thu, 08 Nov 2012 07:52:12 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1352361129!18286710!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODIxNDI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3891 invoked from network); 8 Nov 2012 07:52:10 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 07:52:10 -0000
X-IronPort-AV: E=Sophos;i="4.80,736,1344211200"; d="scan'208";a="43903695"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	08 Nov 2012 07:51:59 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 8 Nov 2012 02:51:59 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TWMu6-0000T6-Pv;
	Thu, 08 Nov 2012 07:51:58 +0000
Message-ID: <1352360998.12977.81.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Joseph Glanville <joseph.glanville@orionvm.com.au>
Date: Thu, 8 Nov 2012 08:49:58 +0100
In-Reply-To: <CAOzFzEgq_pnyeV6=FT4bWAvuyAA4VT5fxdD3HtcjgkWyRgai2Q@mail.gmail.com>
References: <CACuBF8+ZW1ckpMRuouTy+=SMBOfM_GA6-NiODCgXTCZ9GpXvww@mail.gmail.com>
	<CAOzFzEgq_pnyeV6=FT4bWAvuyAA4VT5fxdD3HtcjgkWyRgai2Q@mail.gmail.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ben Eyres <bmeyres@gmail.com>
Subject: Re: [Xen-devel] Virtual Networking
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-07 at 23:33 +0000, Joseph Glanville wrote:
> On 8 November 2012 07:49, Ben Eyres <bmeyres@gmail.com> wrote:
> > This is probably quite a vague and simple question but here goes...Can
> > anyone tell me where in the Xen-4.2.0 source files i can find source code
> > for the virtual switching (Vif/Pif')? This is the first time i have worked
> > with the Xen source code so struggling to work my way around the system.
> 
> The virtual switching is not done by Xen but rather by the Linux
> bridge module or Open vSwitch etc.
> If you are interested in how virtual adapters are created and packets
> transfered from domU to domO I suggest looking at the Linux source
> tree in drivers/net/ for netback/netfront.

Also http://wiki.xen.org/wiki/Xen_Networking should provide a useful
guide to how the various bits work together.

The use of the Vif/Pif terminology makes me wonder if you are using
xapi/XCP -- in which case you may find the xen-api@ list is more likely
to have people who can point you to the code which manages those in the
xapi toolstack.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 07:52:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 07:52:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWMuM-0001fq-EN; Thu, 08 Nov 2012 07:52:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TWMuK-0001fi-Oq
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 07:52:12 +0000
Received: from [85.158.143.99:32491] by server-3.bemta-4.messagelabs.com id
	9D/D4-06841-CA46B905; Thu, 08 Nov 2012 07:52:12 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1352361129!18286710!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODIxNDI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3891 invoked from network); 8 Nov 2012 07:52:10 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 07:52:10 -0000
X-IronPort-AV: E=Sophos;i="4.80,736,1344211200"; d="scan'208";a="43903695"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	08 Nov 2012 07:51:59 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 8 Nov 2012 02:51:59 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TWMu6-0000T6-Pv;
	Thu, 08 Nov 2012 07:51:58 +0000
Message-ID: <1352360998.12977.81.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Joseph Glanville <joseph.glanville@orionvm.com.au>
Date: Thu, 8 Nov 2012 08:49:58 +0100
In-Reply-To: <CAOzFzEgq_pnyeV6=FT4bWAvuyAA4VT5fxdD3HtcjgkWyRgai2Q@mail.gmail.com>
References: <CACuBF8+ZW1ckpMRuouTy+=SMBOfM_GA6-NiODCgXTCZ9GpXvww@mail.gmail.com>
	<CAOzFzEgq_pnyeV6=FT4bWAvuyAA4VT5fxdD3HtcjgkWyRgai2Q@mail.gmail.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ben Eyres <bmeyres@gmail.com>
Subject: Re: [Xen-devel] Virtual Networking
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-07 at 23:33 +0000, Joseph Glanville wrote:
> On 8 November 2012 07:49, Ben Eyres <bmeyres@gmail.com> wrote:
> > This is probably quite a vague and simple question but here goes...Can
> > anyone tell me where in the Xen-4.2.0 source files i can find source code
> > for the virtual switching (Vif/Pif')? This is the first time i have worked
> > with the Xen source code so struggling to work my way around the system.
> 
> The virtual switching is not done by Xen but rather by the Linux
> bridge module or Open vSwitch etc.
> If you are interested in how virtual adapters are created and packets
> transfered from domU to domO I suggest looking at the Linux source
> tree in drivers/net/ for netback/netfront.

Also http://wiki.xen.org/wiki/Xen_Networking should provide a useful
guide to how the various bits work together.

The use of the Vif/Pif terminology makes me wonder if you are using
xapi/XCP -- in which case you may find the xen-api@ list is more likely
to have people who can point you to the code which manages those in the
xapi toolstack.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 08:00:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 08:00:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWN2Z-0002Id-2P; Thu, 08 Nov 2012 08:00:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWN2W-0002IY-Ts
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 08:00:41 +0000
Received: from [85.158.137.99:40822] by server-1.bemta-3.messagelabs.com id
	C0/DD-12169-8A66B905; Thu, 08 Nov 2012 08:00:40 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1352361638!18121142!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21096 invoked from network); 8 Nov 2012 08:00:38 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-217.messagelabs.com with SMTP;
	8 Nov 2012 08:00:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 08:00:37 +0000
Message-Id: <509B74B402000078000A7206@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 08:00:36 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<509791F902000078000A64D4@nat28.tlf.novell.com>
	<7563be37-62f1-472e-9aec-1d0c55fa7c29@default>
In-Reply-To: <7563be37-62f1-472e-9aec-1d0c55fa7c29@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	Keir Fraser <keir@xen.org>, IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 07.11.12 at 23:17, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> It appears that the attempt to use 2MB and 1GB pages is done in
> the toolstack, and if the hypervisor rejects it, toolstack tries
> smaller pages.  Thus, if physical memory is highly fragmented
> (few or no order>=9 allocations available), this will result
> in one hypercall per 4k page so a 256GB domain would require
> 64 million hypercalls.  And, since AFAICT, there is no sane
> way to hold the heap_lock across even two hypercalls, speeding
> up the in-hypervisor allocation path, by itself, will not solve
> the TOCTOU race.

No, even in the absence of large pages, the tool stack will do 8M
allocations, just without requesting them to be contiguous.
Whether 8M is a suitable value is another aspect; that value may
predate hypercall preemption, and I don't immediately see why
the tool stack shouldn't be able to request larger chunks (up to
the whole amount at once).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 08:00:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 08:00:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWN2Z-0002Id-2P; Thu, 08 Nov 2012 08:00:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWN2W-0002IY-Ts
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 08:00:41 +0000
Received: from [85.158.137.99:40822] by server-1.bemta-3.messagelabs.com id
	C0/DD-12169-8A66B905; Thu, 08 Nov 2012 08:00:40 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1352361638!18121142!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21096 invoked from network); 8 Nov 2012 08:00:38 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-217.messagelabs.com with SMTP;
	8 Nov 2012 08:00:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 08:00:37 +0000
Message-Id: <509B74B402000078000A7206@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 08:00:36 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<509791F902000078000A64D4@nat28.tlf.novell.com>
	<7563be37-62f1-472e-9aec-1d0c55fa7c29@default>
In-Reply-To: <7563be37-62f1-472e-9aec-1d0c55fa7c29@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	Keir Fraser <keir@xen.org>, IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 07.11.12 at 23:17, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> It appears that the attempt to use 2MB and 1GB pages is done in
> the toolstack, and if the hypervisor rejects it, toolstack tries
> smaller pages.  Thus, if physical memory is highly fragmented
> (few or no order>=9 allocations available), this will result
> in one hypercall per 4k page so a 256GB domain would require
> 64 million hypercalls.  And, since AFAICT, there is no sane
> way to hold the heap_lock across even two hypercalls, speeding
> up the in-hypervisor allocation path, by itself, will not solve
> the TOCTOU race.

No, even in the absence of large pages, the tool stack will do 8M
allocations, just without requesting them to be contiguous.
Whether 8M is a suitable value is another aspect; that value may
predate hypercall preemption, and I don't immediately see why
the tool stack shouldn't be able to request larger chunks (up to
the whole amount at once).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 08:17:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 08:17:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWNIv-0002VT-Qp; Thu, 08 Nov 2012 08:17:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWNIu-0002VO-6x
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 08:17:36 +0000
Received: from [85.158.138.51:2119] by server-10.bemta-3.messagelabs.com id
	9B/F1-19806-F9A6B905; Thu, 08 Nov 2012 08:17:35 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1352362654!27274490!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19701 invoked from network); 8 Nov 2012 08:17:34 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-174.messagelabs.com with SMTP;
	8 Nov 2012 08:17:34 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 08:17:33 +0000
Message-Id: <509B78AC02000078000A723C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 08:17:32 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Matthew Fioravante" <matthew.fioravante@jhuapl.edu>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121107144625.GA14628@ennui.austin.ibm.com>
	<509AA501.1090701@jhuapl.edu>
In-Reply-To: <509AA501.1090701@jhuapl.edu>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	Kent Yoder <key@linux.vnet.ibm.com>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
 driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 07.11.12 at 19:14, Matthew Fioravante <matthew.fioravante@jhuapl.edu> wrote:
> On 11/07/2012 09:46 AM, Kent Yoder wrote:
>>> --- a/drivers/char/tpm/tpm.h
>>> +++ b/drivers/char/tpm/tpm.h
>>> @@ -130,6 +130,9 @@ struct tpm_chip {
>>>
>>>   	struct list_head list;
>>>   	void (*release) (struct device *);
>>> +#if CONFIG_XEN
>>> +	void *priv;
>>> +#endif
>>   Can you use the chip->vendor.data pointer here instead? tpm_ibmvtpm is
>> already using that as a priv pointer. I should probably change that name
>> to make it more obvious what that's used for.
> That makes more sense. I'm guessing your data pointer didn't exist 
> during the 2.6.18 kernel which is why they added their own priv pointer.

It got introduced with 3.7-rc.

>>> @@ -310,6 +313,18 @@ struct tpm_cmd_t {
>>>
>>>   ssize_t	tpm_getcap(struct device *, __be32, cap_t *, const char *);
>>>
>>> +#ifdef CONFIG_XEN
>>> +static inline void *chip_get_private(const struct tpm_chip *chip)
>>> +{
>>> +	return chip->priv;
>>> +}
>>> +
>>> +static inline void chip_set_private(struct tpm_chip *chip, void *priv)
>>> +{
>>> +	chip->priv = priv;
>>> +}
>>> +#endif
>>   Can you put these in tpm_vtpm.c please?  One less #define. :-)
> Agreed, I'd rather not have to modify your shared tpm.h interface at all.

Either such accessors should be defined here, for everyone to
use (and tpm_ibmvtpm.c get changed accordingly), or the Xen
code should access the field without wrappers too (for consistency).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 08:17:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 08:17:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWNIv-0002VT-Qp; Thu, 08 Nov 2012 08:17:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWNIu-0002VO-6x
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 08:17:36 +0000
Received: from [85.158.138.51:2119] by server-10.bemta-3.messagelabs.com id
	9B/F1-19806-F9A6B905; Thu, 08 Nov 2012 08:17:35 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1352362654!27274490!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19701 invoked from network); 8 Nov 2012 08:17:34 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-174.messagelabs.com with SMTP;
	8 Nov 2012 08:17:34 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 08:17:33 +0000
Message-Id: <509B78AC02000078000A723C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 08:17:32 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Matthew Fioravante" <matthew.fioravante@jhuapl.edu>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121107144625.GA14628@ennui.austin.ibm.com>
	<509AA501.1090701@jhuapl.edu>
In-Reply-To: <509AA501.1090701@jhuapl.edu>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	Kent Yoder <key@linux.vnet.ibm.com>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
 driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 07.11.12 at 19:14, Matthew Fioravante <matthew.fioravante@jhuapl.edu> wrote:
> On 11/07/2012 09:46 AM, Kent Yoder wrote:
>>> --- a/drivers/char/tpm/tpm.h
>>> +++ b/drivers/char/tpm/tpm.h
>>> @@ -130,6 +130,9 @@ struct tpm_chip {
>>>
>>>   	struct list_head list;
>>>   	void (*release) (struct device *);
>>> +#if CONFIG_XEN
>>> +	void *priv;
>>> +#endif
>>   Can you use the chip->vendor.data pointer here instead? tpm_ibmvtpm is
>> already using that as a priv pointer. I should probably change that name
>> to make it more obvious what that's used for.
> That makes more sense. I'm guessing your data pointer didn't exist 
> during the 2.6.18 kernel which is why they added their own priv pointer.

It got introduced with 3.7-rc.

>>> @@ -310,6 +313,18 @@ struct tpm_cmd_t {
>>>
>>>   ssize_t	tpm_getcap(struct device *, __be32, cap_t *, const char *);
>>>
>>> +#ifdef CONFIG_XEN
>>> +static inline void *chip_get_private(const struct tpm_chip *chip)
>>> +{
>>> +	return chip->priv;
>>> +}
>>> +
>>> +static inline void chip_set_private(struct tpm_chip *chip, void *priv)
>>> +{
>>> +	chip->priv = priv;
>>> +}
>>> +#endif
>>   Can you put these in tpm_vtpm.c please?  One less #define. :-)
> Agreed, I'd rather not have to modify your shared tpm.h interface at all.

Either such accessors should be defined here, for everyone to
use (and tpm_ibmvtpm.c get changed accordingly), or the Xen
code should access the field without wrappers too (for consistency).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 08:18:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 08:18:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWNJs-0002YD-9D; Thu, 08 Nov 2012 08:18:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWNJq-0002Y2-Mz
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 08:18:35 +0000
Received: from [85.158.138.51:5727] by server-3.bemta-3.messagelabs.com id
	61/1E-31566-9DA6B905; Thu, 08 Nov 2012 08:18:33 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1352362713!29178920!1
X-Originating-IP: [209.85.212.169]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19652 invoked from network); 8 Nov 2012 08:18:33 -0000
Received: from mail-wi0-f169.google.com (HELO mail-wi0-f169.google.com)
	(209.85.212.169)
	by server-11.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 08:18:33 -0000
Received: by mail-wi0-f169.google.com with SMTP id hq4so5462523wib.2
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 00:18:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=YAhkxcVxdb0yCsDxp/5PoO1a1bB8yftZuQ3zO4G8TNo=;
	b=v9Qk1ieHChXxxwzOEQanfw1gNEG4iAsAr2p2UMbyo3NzqGAeMdZBBWsHUnekA0ANuS
	EBEGnSr9bL0KTPNAVTvlzsYqrP0czlRZ5eOQX6s9QrhNhFZTfsgBQytJ1ZknBCH5m8XJ
	kaHufMlyQoeCWgywSJ40JBakxNHLDzzNb++TT4ykSOOVt5Rk8T7ObWdXi9bk00Fphj/W
	QLcpz7bMTTNpwJ7oOjqY7IAJAeZzvyPioxJDvw4h14k9daYcVaOXvrVfVdTOj2v6J9gl
	3eCmutMqPCuiu1H1MwaCcHpOarJ7OCNPxOVKZ8Nj9DCmp3F+3tSC++8qigIh8y/xvNzr
	xZ7A==
Received: by 10.180.84.34 with SMTP id v2mr11696561wiy.20.1352362712931;
	Thu, 08 Nov 2012 00:18:32 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id fn7sm6292975wib.9.2012.11.08.00.18.30
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 00:18:32 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 08:18:29 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <CCC11B55.4443A%keir.xen@gmail.com>
Thread-Topic: Proposed new "memory capacity claim" hypercall/feature
Thread-Index: Ac29iaIE5Z8jxEKZGUy+V3xoaL/D1w==
In-Reply-To: <509B74B402000078000A7206@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	Keir Fraser <keir@xen.org>, IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 08:00, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 07.11.12 at 23:17, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>> It appears that the attempt to use 2MB and 1GB pages is done in
>> the toolstack, and if the hypervisor rejects it, toolstack tries
>> smaller pages.  Thus, if physical memory is highly fragmented
>> (few or no order>=9 allocations available), this will result
>> in one hypercall per 4k page so a 256GB domain would require
>> 64 million hypercalls.  And, since AFAICT, there is no sane
>> way to hold the heap_lock across even two hypercalls, speeding
>> up the in-hypervisor allocation path, by itself, will not solve
>> the TOCTOU race.
> 
> No, even in the absence of large pages, the tool stack will do 8M
> allocations, just without requesting them to be contiguous.
> Whether 8M is a suitable value is another aspect; that value may
> predate hypercall preemption, and I don't immediately see why
> the tool stack shouldn't be able to request larger chunks (up to
> the whole amount at once).

It is probably to allow other dom0 processing (including softirqs) to
preempt the toolstack task, in the case that the kernel was not built with
involuntary preemption enabled (having it disabled is the common case I
believe?). 8M batches may provide enough returns to user space to allow
other work to get a look-in.



> Jan
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 08:18:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 08:18:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWNJs-0002YD-9D; Thu, 08 Nov 2012 08:18:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWNJq-0002Y2-Mz
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 08:18:35 +0000
Received: from [85.158.138.51:5727] by server-3.bemta-3.messagelabs.com id
	61/1E-31566-9DA6B905; Thu, 08 Nov 2012 08:18:33 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1352362713!29178920!1
X-Originating-IP: [209.85.212.169]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19652 invoked from network); 8 Nov 2012 08:18:33 -0000
Received: from mail-wi0-f169.google.com (HELO mail-wi0-f169.google.com)
	(209.85.212.169)
	by server-11.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 08:18:33 -0000
Received: by mail-wi0-f169.google.com with SMTP id hq4so5462523wib.2
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 00:18:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=YAhkxcVxdb0yCsDxp/5PoO1a1bB8yftZuQ3zO4G8TNo=;
	b=v9Qk1ieHChXxxwzOEQanfw1gNEG4iAsAr2p2UMbyo3NzqGAeMdZBBWsHUnekA0ANuS
	EBEGnSr9bL0KTPNAVTvlzsYqrP0czlRZ5eOQX6s9QrhNhFZTfsgBQytJ1ZknBCH5m8XJ
	kaHufMlyQoeCWgywSJ40JBakxNHLDzzNb++TT4ykSOOVt5Rk8T7ObWdXi9bk00Fphj/W
	QLcpz7bMTTNpwJ7oOjqY7IAJAeZzvyPioxJDvw4h14k9daYcVaOXvrVfVdTOj2v6J9gl
	3eCmutMqPCuiu1H1MwaCcHpOarJ7OCNPxOVKZ8Nj9DCmp3F+3tSC++8qigIh8y/xvNzr
	xZ7A==
Received: by 10.180.84.34 with SMTP id v2mr11696561wiy.20.1352362712931;
	Thu, 08 Nov 2012 00:18:32 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id fn7sm6292975wib.9.2012.11.08.00.18.30
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 00:18:32 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 08:18:29 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <CCC11B55.4443A%keir.xen@gmail.com>
Thread-Topic: Proposed new "memory capacity claim" hypercall/feature
Thread-Index: Ac29iaIE5Z8jxEKZGUy+V3xoaL/D1w==
In-Reply-To: <509B74B402000078000A7206@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	Keir Fraser <keir@xen.org>, IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 08:00, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 07.11.12 at 23:17, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>> It appears that the attempt to use 2MB and 1GB pages is done in
>> the toolstack, and if the hypervisor rejects it, toolstack tries
>> smaller pages.  Thus, if physical memory is highly fragmented
>> (few or no order>=9 allocations available), this will result
>> in one hypercall per 4k page so a 256GB domain would require
>> 64 million hypercalls.  And, since AFAICT, there is no sane
>> way to hold the heap_lock across even two hypercalls, speeding
>> up the in-hypervisor allocation path, by itself, will not solve
>> the TOCTOU race.
> 
> No, even in the absence of large pages, the tool stack will do 8M
> allocations, just without requesting them to be contiguous.
> Whether 8M is a suitable value is another aspect; that value may
> predate hypercall preemption, and I don't immediately see why
> the tool stack shouldn't be able to request larger chunks (up to
> the whole amount at once).

It is probably to allow other dom0 processing (including softirqs) to
preempt the toolstack task, in the case that the kernel was not built with
involuntary preemption enabled (having it disabled is the common case I
believe?). 8M batches may provide enough returns to user space to allow
other work to get a look-in.



> Jan
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 08:28:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 08:28:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWNTG-0002oA-BP; Thu, 08 Nov 2012 08:28:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TWNTE-0002o5-BW
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 08:28:16 +0000
Received: from [193.109.254.147:16174] by server-11.bemta-14.messagelabs.com
	id 47/1A-29027-F1D6B905; Thu, 08 Nov 2012 08:28:15 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1352363293!10147670!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODIxNDI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3524 invoked from network); 8 Nov 2012 08:28:14 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 08:28:14 -0000
X-IronPort-AV: E=Sophos;i="4.80,736,1344211200"; d="scan'208";a="43906727"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	08 Nov 2012 08:28:13 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 8 Nov 2012 03:28:13 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TWNTA-0000xn-ET;
	Thu, 08 Nov 2012 08:28:12 +0000
Message-ID: <1352363172.12977.87.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Sylvain Munaut <s.munaut@whatever-company.com>, Roger Pau Monne
	<roger.pau@citrix.com>
Date: Thu, 8 Nov 2012 09:26:12 +0100
In-Reply-To: <CAF6-1L51R5yMBNO1wQe7YWoeGoM_bFJcAb0XN0cVg6cm7+Kzaw@mail.gmail.com>
References: <CAF6-1L51R5yMBNO1wQe7YWoeGoM_bFJcAb0XN0cVg6cm7+Kzaw@mail.gmail.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Custom block script started twice for root block
 but only stopped once
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-02 at 10:37 +0000, Sylvain Munaut wrote:
> Hi,
> 
> I'm using a custom block script in my xen setup and when started, it
> creates a new device node pointing to some network resources.
> 
> Now I noticed that the script is called twice for the root block, the
> first time for pygrub most likely, but is only stopped once ... I
> don't mind creating two devices node, but then I need to destroy both
> ...
> 
> Is this a known issue ?

Not one I've heard. Running "xl -vvv create" might provide some logs
which give an idea what is going on, likewise the logging
in /var/log/xen/...

Roger -- any ideas?

Ian.

> 
>  Cheers,
> 
>     Sylvain
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 08:28:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 08:28:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWNTG-0002oA-BP; Thu, 08 Nov 2012 08:28:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TWNTE-0002o5-BW
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 08:28:16 +0000
Received: from [193.109.254.147:16174] by server-11.bemta-14.messagelabs.com
	id 47/1A-29027-F1D6B905; Thu, 08 Nov 2012 08:28:15 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1352363293!10147670!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODIxNDI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3524 invoked from network); 8 Nov 2012 08:28:14 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 08:28:14 -0000
X-IronPort-AV: E=Sophos;i="4.80,736,1344211200"; d="scan'208";a="43906727"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	08 Nov 2012 08:28:13 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 8 Nov 2012 03:28:13 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TWNTA-0000xn-ET;
	Thu, 08 Nov 2012 08:28:12 +0000
Message-ID: <1352363172.12977.87.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Sylvain Munaut <s.munaut@whatever-company.com>, Roger Pau Monne
	<roger.pau@citrix.com>
Date: Thu, 8 Nov 2012 09:26:12 +0100
In-Reply-To: <CAF6-1L51R5yMBNO1wQe7YWoeGoM_bFJcAb0XN0cVg6cm7+Kzaw@mail.gmail.com>
References: <CAF6-1L51R5yMBNO1wQe7YWoeGoM_bFJcAb0XN0cVg6cm7+Kzaw@mail.gmail.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Custom block script started twice for root block
 but only stopped once
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-02 at 10:37 +0000, Sylvain Munaut wrote:
> Hi,
> 
> I'm using a custom block script in my xen setup and when started, it
> creates a new device node pointing to some network resources.
> 
> Now I noticed that the script is called twice for the root block, the
> first time for pygrub most likely, but is only stopped once ... I
> don't mind creating two devices node, but then I need to destroy both
> ...
> 
> Is this a known issue ?

Not one I've heard. Running "xl -vvv create" might provide some logs
which give an idea what is going on, likewise the logging
in /var/log/xen/...

Roger -- any ideas?

Ian.

> 
>  Cheers,
> 
>     Sylvain
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 08:34:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 08:34:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWNZB-0002y9-9A; Thu, 08 Nov 2012 08:34:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWNZA-0002y4-8l
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 08:34:24 +0000
Received: from [85.158.139.83:38401] by server-13.bemta-5.messagelabs.com id
	BF/20-27809-F8E6B905; Thu, 08 Nov 2012 08:34:23 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1352363662!29338470!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31883 invoked from network); 8 Nov 2012 08:34:22 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-182.messagelabs.com with SMTP;
	8 Nov 2012 08:34:22 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 08:34:21 +0000
Message-Id: <509B7C9C02000078000A725F@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 08:34:20 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir.xen@gmail.com>
References: <509B6EB002000078000A71CB@nat28.tlf.novell.com>
	<CCC11447.443E2%keir.xen@gmail.com>
In-Reply-To: <CCC11447.443E2%keir.xen@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/emul: only emulate possibly operand
 sizes for POPA
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 08.11.12 at 08:48, Keir Fraser <keir.xen@gmail.com> wrote:
> On 08/11/2012 07:34, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>>> Would prefer:
>>>  if ( op_bytes == 2 )
>>>      *(uint16_t *)regs[i] = (uint16_t)dst.val;
>>>  else
>>>      *regs[i] = dst.val;
>>> 
>>> Handles the exceptional case immediately after its predicate.
>> 
>> I had it that way first, but compilers tend to prefer (in terms of
>> static branch prediction) the if() body over the else one. Doesn't
>> matter that much here of course, but I'm generally trying to
>> follow such guidelines even in non performance critical paths so
>> that in case code gets cloned elsewhere it doesn't require extra
>> reviewing or adjustment.
> 
> Should follow such guidelines where the optimisation matters. I think
> shaping code to follow such guidelines all the time, is misguided. I'd
> rather have the fractionally more readable version than the
> possibly-fractionally faster version.

Okay, will adjust accordingly then.

>>> And the cast
>>> from uint32_t, and 64b-related comment, are pointless and in fact misleading
>>> in the default case, since as you say the instruction is invalid in 64-bit
>>> mode.
>> 
>> And I considered that aspect too: Even if invalid in 64-bit mode, it
>> is valid in compatibility mode, and in that case the zero-extension
>> makes sense (as does the comment).
> 
> I did wonder. The top halves of 64b registers are not used in compatibility
> mode. Are their contents at all guaranteed to be
> maintained/updated/preserved in any meaningful way across transitions into
> and out of compatibility mode? I wasn't aware they were, and in that case
> the cast and comment are indeed pointless.

There's no architectural guarantee, but that's how CPUs work.
The important aspect (from an information leak perspective) is
that upper halves don't get zeroed explicitly when switching
between compatibility and 64-bit modes.

Now we can of course utilize that read_ulong() already does the
zero extension (but if it didn't, we would leak stack contents here,
so it may still be worth a comment), to the net effect of

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1996,13 +1996,11 @@ x86_emulate(
             if ( (rc = read_ulong(x86_seg_ss, sp_post_inc(op_bytes),
                                   &dst.val, op_bytes, ctxt, ops)) != 0 )
                 goto done;
-            switch ( op_bytes )
-            {
-            case 1: *(uint8_t  *)regs[i] = (uint8_t)dst.val; break;
-            case 2: *(uint16_t *)regs[i] = (uint16_t)dst.val; break;
-            case 4: *regs[i] = (uint32_t)dst.val; break; /* 64b: zero-ext */
-            case 8: *regs[i] = dst.val; break;
-            }
+            if ( op_bytes == 2 )
+                *(uint16_t *)regs[i] = (uint16_t)dst.val;
+            else
+                /* No need for zero-extension - read_ulong() already did so. */
+                *regs[i] = dst.val;
         }
         break;
     }


Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 08:34:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 08:34:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWNZB-0002y9-9A; Thu, 08 Nov 2012 08:34:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWNZA-0002y4-8l
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 08:34:24 +0000
Received: from [85.158.139.83:38401] by server-13.bemta-5.messagelabs.com id
	BF/20-27809-F8E6B905; Thu, 08 Nov 2012 08:34:23 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1352363662!29338470!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31883 invoked from network); 8 Nov 2012 08:34:22 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-182.messagelabs.com with SMTP;
	8 Nov 2012 08:34:22 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 08:34:21 +0000
Message-Id: <509B7C9C02000078000A725F@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 08:34:20 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir.xen@gmail.com>
References: <509B6EB002000078000A71CB@nat28.tlf.novell.com>
	<CCC11447.443E2%keir.xen@gmail.com>
In-Reply-To: <CCC11447.443E2%keir.xen@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/emul: only emulate possibly operand
 sizes for POPA
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 08.11.12 at 08:48, Keir Fraser <keir.xen@gmail.com> wrote:
> On 08/11/2012 07:34, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>>> Would prefer:
>>>  if ( op_bytes == 2 )
>>>      *(uint16_t *)regs[i] = (uint16_t)dst.val;
>>>  else
>>>      *regs[i] = dst.val;
>>> 
>>> Handles the exceptional case immediately after its predicate.
>> 
>> I had it that way first, but compilers tend to prefer (in terms of
>> static branch prediction) the if() body over the else one. Doesn't
>> matter that much here of course, but I'm generally trying to
>> follow such guidelines even in non performance critical paths so
>> that in case code gets cloned elsewhere it doesn't require extra
>> reviewing or adjustment.
> 
> Should follow such guidelines where the optimisation matters. I think
> shaping code to follow such guidelines all the time, is misguided. I'd
> rather have the fractionally more readable version than the
> possibly-fractionally faster version.

Okay, will adjust accordingly then.

>>> And the cast
>>> from uint32_t, and 64b-related comment, are pointless and in fact misleading
>>> in the default case, since as you say the instruction is invalid in 64-bit
>>> mode.
>> 
>> And I considered that aspect too: Even if invalid in 64-bit mode, it
>> is valid in compatibility mode, and in that case the zero-extension
>> makes sense (as does the comment).
> 
> I did wonder. The top halves of 64b registers are not used in compatibility
> mode. Are their contents at all guaranteed to be
> maintained/updated/preserved in any meaningful way across transitions into
> and out of compatibility mode? I wasn't aware they were, and in that case
> the cast and comment are indeed pointless.

There's no architectural guarantee, but that's how CPUs work.
The important aspect (from an information leak perspective) is
that upper halves don't get zeroed explicitly when switching
between compatibility and 64-bit modes.

Now we can of course utilize that read_ulong() already does the
zero extension (but if it didn't, we would leak stack contents here,
so it may still be worth a comment), to the net effect of

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1996,13 +1996,11 @@ x86_emulate(
             if ( (rc = read_ulong(x86_seg_ss, sp_post_inc(op_bytes),
                                   &dst.val, op_bytes, ctxt, ops)) != 0 )
                 goto done;
-            switch ( op_bytes )
-            {
-            case 1: *(uint8_t  *)regs[i] = (uint8_t)dst.val; break;
-            case 2: *(uint16_t *)regs[i] = (uint16_t)dst.val; break;
-            case 4: *regs[i] = (uint32_t)dst.val; break; /* 64b: zero-ext */
-            case 8: *regs[i] = dst.val; break;
-            }
+            if ( op_bytes == 2 )
+                *(uint16_t *)regs[i] = (uint16_t)dst.val;
+            else
+                /* No need for zero-extension - read_ulong() already did so. */
+                *regs[i] = dst.val;
         }
         break;
     }


Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 08:43:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 08:43:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWNhf-00038J-AA; Thu, 08 Nov 2012 08:43:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jajcus@jajcus.net>) id 1TWNhd-00038B-Js
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 08:43:09 +0000
Received: from [85.158.137.99:60172] by server-5.bemta-3.messagelabs.com id
	C1/04-26311-C907B905; Thu, 08 Nov 2012 08:43:08 +0000
X-Env-Sender: jajcus@jajcus.net
X-Msg-Ref: server-8.tower-217.messagelabs.com!1352364186!11768074!1
X-Originating-IP: [84.205.176.49]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2438 invoked from network); 8 Nov 2012 08:43:07 -0000
Received: from tropek.jajcus.net (HELO tropek.jajcus.net) (84.205.176.49)
	by server-8.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 8 Nov 2012 08:43:07 -0000
Received: from localhost (jajo.ipv6.eggsoft.pl [IPv6:2001:6a0:117::1])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by tropek.jajcus.net (Postfix) with ESMTPSA id 58FB25002
	for <xen-devel@lists.xen.org>; Thu,  8 Nov 2012 09:43:05 +0100 (CET)
Date: Thu, 8 Nov 2012 09:42:58 +0100
From: Jacek Konieczny <jajcus@jajcus.net>
To: xen-devel@lists.xen.org
Message-ID: <20121108084258.GA5544@jajo.eggsoft>
Mail-Followup-To: xen-devel@lists.xen.org
References: <CANchcZy0qiahQ86wGzW3YjfvkF1mW_KKNxkfruM0N+_ELzow4A@mail.gmail.com>
	<507C075302000078000A1593@nat28.tlf.novell.com>
	<CANchcZxqXDrsXEAnatWca+YWzoqB5b0nDWzfMk+6aj_SfPFBsw@mail.gmail.com>
	<CANchcZzCNbqPMF3rDpOy_irh+jGR+hHy61W78VtGeHzxFFS5KA@mail.gmail.com>
	<5081271C02000078000A2844@nat28.tlf.novell.com>
	<20121019173307.GT26830@phenom.dumpdata.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121019173307.GT26830@phenom.dumpdata.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Subject: Re: [Xen-devel] Xen 4.2 with EFI on IBM x3650 ACPI Bug
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

SGVsbG8sCgpJIGFtIGRpZ2dpbmcgdXAgdGhlIG9sZCB0aHJlYWQgIGp1c3QgdG8gc2hvdyBhIHdv
cmthcm91bmQgZm9yIHRoZQpJQk0geFNlcmllcyBBQ1BJIHByb2JsZW0gdW5kZXIgRUZJ4oCmCgpP
biBGcmksIE9jdCAxOSwgMjAxMiBhdCAwMTozMzowN1BNIC0wNDAwLCBLb25yYWQgUnplc3p1dGVr
IFdpbGsgd3JvdGU6Cj4gT24gRnJpLCBPY3QgMTksIDIwMTIgYXQgMDk6MTA6MzZBTSArMDEwMCwg
SmFuIEJldWxpY2ggd3JvdGU6Cj4gPiA+Pj4gT24gMTkuMTAuMTIgYXQgMDE6NDMsIEFsbGFuIFNj
aGVpZCA8YXZzLjAwOUBnbWFpbC5jb20+IHdyb3RlOgo+ID4gPiBCYWQgbmV3cywgaSBhbSBzZWVp
bmcgdGhlIGxvZyBvd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WxpbmUKb3B0aW9uIHVzZWQgbGF0ZXIpCgoyLiBCb290IHhlbiBuYXRp
dmVseSB2aWEgRUZJIOKAkyB1c2UgeGVuLmVmaSBub3QgR1JVQiBtdWx0aWJvb3QgKEdSVUIKRUZJ
IGNoYWlubG9hZGVyIHdpbGwgYmUgb2sgdG9vKQoKMy4gTm90ZSB0aGUgUlNEUCBhZGRyZXNzIGZv
dW5kIGJ5IFhlbjoKCiMgeGwgZG1lc2cgfCBncmVwIFJTRFAKKFhFTikgQUNQSTogUlNEUCA3RjdG
RTAxNCwgMDAyNCAocjIgSUJNICAgKQoKNC4gQWRkIHRoaXMgdG8gdGhlIGRvbTAga2VybmVsIGNv
bW1hbmQtbGluZSAoaW4gdGhlIHhlbi5jZmcgZmlsZSB1c2VkIGJ5Cnhlbi5lZmkpOgoKICAgYWNw
aV9yc2RwPTB4N0Y3RkUwMTQKClRoZSBMaW51eCBrZXJuZWwgd2lsbCBmaW5kIHRoZSBBQ1BJIFJT
RFAgYW5kIHdpbGwgYmUgYWJsZSB0byBpbml0aWFsaXplCklSUXMgYW5kIFNNUCBwcm9wZXJseS4g
IFRoaXMgc3RpbGwgd29uJ3QgYmUgYSBwcm9wZXIgRUZJIGludGVyZmFjZSwgc28KdGhlICdlZml2
YXJzJyBtb2R1bGUgYW5kICdlZmlib290bWdyJyB1dGlsaXR5IHdvbid0IHdvcmssIGJ1dCB0aGlz
IGlzCm5vdCBhcyBjcml0aWNhbCBhcyBBQ1BJLgoKR3JlZXRzLAogICAgICAgIEphY2VrCgpfX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwgbWFp
bGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hl
bi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Thu Nov 08 08:43:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 08:43:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWNhf-00038J-AA; Thu, 08 Nov 2012 08:43:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jajcus@jajcus.net>) id 1TWNhd-00038B-Js
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 08:43:09 +0000
Received: from [85.158.137.99:60172] by server-5.bemta-3.messagelabs.com id
	C1/04-26311-C907B905; Thu, 08 Nov 2012 08:43:08 +0000
X-Env-Sender: jajcus@jajcus.net
X-Msg-Ref: server-8.tower-217.messagelabs.com!1352364186!11768074!1
X-Originating-IP: [84.205.176.49]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2438 invoked from network); 8 Nov 2012 08:43:07 -0000
Received: from tropek.jajcus.net (HELO tropek.jajcus.net) (84.205.176.49)
	by server-8.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 8 Nov 2012 08:43:07 -0000
Received: from localhost (jajo.ipv6.eggsoft.pl [IPv6:2001:6a0:117::1])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by tropek.jajcus.net (Postfix) with ESMTPSA id 58FB25002
	for <xen-devel@lists.xen.org>; Thu,  8 Nov 2012 09:43:05 +0100 (CET)
Date: Thu, 8 Nov 2012 09:42:58 +0100
From: Jacek Konieczny <jajcus@jajcus.net>
To: xen-devel@lists.xen.org
Message-ID: <20121108084258.GA5544@jajo.eggsoft>
Mail-Followup-To: xen-devel@lists.xen.org
References: <CANchcZy0qiahQ86wGzW3YjfvkF1mW_KKNxkfruM0N+_ELzow4A@mail.gmail.com>
	<507C075302000078000A1593@nat28.tlf.novell.com>
	<CANchcZxqXDrsXEAnatWca+YWzoqB5b0nDWzfMk+6aj_SfPFBsw@mail.gmail.com>
	<CANchcZzCNbqPMF3rDpOy_irh+jGR+hHy61W78VtGeHzxFFS5KA@mail.gmail.com>
	<5081271C02000078000A2844@nat28.tlf.novell.com>
	<20121019173307.GT26830@phenom.dumpdata.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121019173307.GT26830@phenom.dumpdata.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Subject: Re: [Xen-devel] Xen 4.2 with EFI on IBM x3650 ACPI Bug
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

SGVsbG8sCgpJIGFtIGRpZ2dpbmcgdXAgdGhlIG9sZCB0aHJlYWQgIGp1c3QgdG8gc2hvdyBhIHdv
cmthcm91bmQgZm9yIHRoZQpJQk0geFNlcmllcyBBQ1BJIHByb2JsZW0gdW5kZXIgRUZJ4oCmCgpP
biBGcmksIE9jdCAxOSwgMjAxMiBhdCAwMTozMzowN1BNIC0wNDAwLCBLb25yYWQgUnplc3p1dGVr
IFdpbGsgd3JvdGU6Cj4gT24gRnJpLCBPY3QgMTksIDIwMTIgYXQgMDk6MTA6MzZBTSArMDEwMCwg
SmFuIEJldWxpY2ggd3JvdGU6Cj4gPiA+Pj4gT24gMTkuMT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3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hl
bi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Thu Nov 08 08:48:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 08:48:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWNmf-0003NG-LW; Thu, 08 Nov 2012 08:48:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TWNme-0003N8-K7
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 08:48:20 +0000
Received: from [85.158.137.99:53611] by server-10.bemta-3.messagelabs.com id
	30/71-19806-3D17B905; Thu, 08 Nov 2012 08:48:19 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1352364498!15074107!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQ4NDk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5399 invoked from network); 8 Nov 2012 08:48:19 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 08:48:19 -0000
X-IronPort-AV: E=Sophos;i="4.80,736,1344211200"; d="scan'208";a="213851270"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	08 Nov 2012 08:48:17 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 8 Nov 2012 03:48:17 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TWNmb-0001EJ-1l;
	Thu, 08 Nov 2012 08:48:17 +0000
Message-ID: <1352364376.12977.93.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Thu, 8 Nov 2012 09:46:16 +0100
In-Reply-To: <20121108011006.GC21302@phenom.dumpdata.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121107144625.GA14628@ennui.austin.ibm.com>	<509AA501.1090701@jhuapl.edu>
	<20121108011006.GC21302@phenom.dumpdata.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	Kent Yoder <key@linux.vnet.ibm.com>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
 driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> > >>+typedef struct tpmif_tx_request tpmif_tx_request_t;
> > >   checkpatch warned on this new typedef - please run through checkpatch
> > >and fix up that stuff.
> > tpmif.h has a couple of typedefs which do trigger checkpatch
> > warnings. However it looks like the paradigm for xen is to have
> > these interface/io/<dev>if.h files and all of them have typedefs. I
> > think in this case the typedef should probably stay.
> > 
> > Konrad your thoughts here?
> 
> Rip them out plea

This is somewhere that Linux coding style and Xen coding style differ,
so the typedefs should be removed from the Linux copy of these
interfaces to match the Linux coding style, but they should stay in the
Xen side canonical copy though.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 08:48:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 08:48:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWNmf-0003NG-LW; Thu, 08 Nov 2012 08:48:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TWNme-0003N8-K7
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 08:48:20 +0000
Received: from [85.158.137.99:53611] by server-10.bemta-3.messagelabs.com id
	30/71-19806-3D17B905; Thu, 08 Nov 2012 08:48:19 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1352364498!15074107!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODQ4NDk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5399 invoked from network); 8 Nov 2012 08:48:19 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 08:48:19 -0000
X-IronPort-AV: E=Sophos;i="4.80,736,1344211200"; d="scan'208";a="213851270"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	08 Nov 2012 08:48:17 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 8 Nov 2012 03:48:17 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TWNmb-0001EJ-1l;
	Thu, 08 Nov 2012 08:48:17 +0000
Message-ID: <1352364376.12977.93.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Thu, 8 Nov 2012 09:46:16 +0100
In-Reply-To: <20121108011006.GC21302@phenom.dumpdata.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121107144625.GA14628@ennui.austin.ibm.com>	<509AA501.1090701@jhuapl.edu>
	<20121108011006.GC21302@phenom.dumpdata.com>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	Kent Yoder <key@linux.vnet.ibm.com>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
 driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> > >>+typedef struct tpmif_tx_request tpmif_tx_request_t;
> > >   checkpatch warned on this new typedef - please run through checkpatch
> > >and fix up that stuff.
> > tpmif.h has a couple of typedefs which do trigger checkpatch
> > warnings. However it looks like the paradigm for xen is to have
> > these interface/io/<dev>if.h files and all of them have typedefs. I
> > think in this case the typedef should probably stay.
> > 
> > Konrad your thoughts here?
> 
> Rip them out plea

This is somewhere that Linux coding style and Xen coding style differ,
so the typedefs should be removed from the Linux copy of these
interfaces to match the Linux coding style, but they should stay in the
Xen side canonical copy though.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 08:54:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 08:54:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWNsM-0003fG-Fh; Thu, 08 Nov 2012 08:54:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWNsK-0003fB-Eh
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 08:54:12 +0000
Received: from [85.158.139.211:42049] by server-8.bemta-5.messagelabs.com id
	3F/95-06050-3337B905; Thu, 08 Nov 2012 08:54:11 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1352364850!18913036!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7235 invoked from network); 8 Nov 2012 08:54:10 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-206.messagelabs.com with SMTP;
	8 Nov 2012 08:54:10 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 08:54:06 +0000
Message-Id: <509B813B02000078000A7279@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 08:54:03 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir.xen@gmail.com>
References: <509B74B402000078000A7206@nat28.tlf.novell.com>
	<CCC11B55.4443A%keir.xen@gmail.com>
In-Reply-To: <CCC11B55.4443A%keir.xen@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	Keir Fraser <keir@xen.org>, IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 08.11.12 at 09:18, Keir Fraser <keir.xen@gmail.com> wrote:
> On 08/11/2012 08:00, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>>>>> On 07.11.12 at 23:17, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>> It appears that the attempt to use 2MB and 1GB pages is done in
>>> the toolstack, and if the hypervisor rejects it, toolstack tries
>>> smaller pages.  Thus, if physical memory is highly fragmented
>>> (few or no order>=9 allocations available), this will result
>>> in one hypercall per 4k page so a 256GB domain would require
>>> 64 million hypercalls.  And, since AFAICT, there is no sane
>>> way to hold the heap_lock across even two hypercalls, speeding
>>> up the in-hypervisor allocation path, by itself, will not solve
>>> the TOCTOU race.
>> 
>> No, even in the absence of large pages, the tool stack will do 8M
>> allocations, just without requesting them to be contiguous.
>> Whether 8M is a suitable value is another aspect; that value may
>> predate hypercall preemption, and I don't immediately see why
>> the tool stack shouldn't be able to request larger chunks (up to
>> the whole amount at once).
> 
> It is probably to allow other dom0 processing (including softirqs) to
> preempt the toolstack task, in the case that the kernel was not built with
> involuntary preemption enabled (having it disabled is the common case I
> believe?). 8M batches may provide enough returns to user space to allow
> other work to get a look-in.

That may have mattered when ioctl-s were run with the big kernel
lock held, but even 2.6.18 didn't do that anymore (using the
.unlocked_ioctl field of struct file_operations), which means
that even softirqs will get serviced in Dom0 since the preempted
hypercall gets restarted via exiting to the guest (i.e. events get
delivered). Scheduling is what indeed wouldn't happen, but if
allocation latency can be brought down, 8M might turn out pretty
small a chunk size.

If we do care about Dom0-s running even older kernels (assuming
there ever was a privcmd implementation that didn't use the
unlocked path), or if we have to assume non-Linux Dom0-s might
have issues here, making the tool stack behavior kernel kind/
version dependent without strong need of course wouldn't sound
very attractive.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 08:54:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 08:54:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWNsM-0003fG-Fh; Thu, 08 Nov 2012 08:54:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWNsK-0003fB-Eh
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 08:54:12 +0000
Received: from [85.158.139.211:42049] by server-8.bemta-5.messagelabs.com id
	3F/95-06050-3337B905; Thu, 08 Nov 2012 08:54:11 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1352364850!18913036!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7235 invoked from network); 8 Nov 2012 08:54:10 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-206.messagelabs.com with SMTP;
	8 Nov 2012 08:54:10 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 08:54:06 +0000
Message-Id: <509B813B02000078000A7279@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 08:54:03 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir.xen@gmail.com>
References: <509B74B402000078000A7206@nat28.tlf.novell.com>
	<CCC11B55.4443A%keir.xen@gmail.com>
In-Reply-To: <CCC11B55.4443A%keir.xen@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	Keir Fraser <keir@xen.org>, IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 08.11.12 at 09:18, Keir Fraser <keir.xen@gmail.com> wrote:
> On 08/11/2012 08:00, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>>>>> On 07.11.12 at 23:17, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>> It appears that the attempt to use 2MB and 1GB pages is done in
>>> the toolstack, and if the hypervisor rejects it, toolstack tries
>>> smaller pages.  Thus, if physical memory is highly fragmented
>>> (few or no order>=9 allocations available), this will result
>>> in one hypercall per 4k page so a 256GB domain would require
>>> 64 million hypercalls.  And, since AFAICT, there is no sane
>>> way to hold the heap_lock across even two hypercalls, speeding
>>> up the in-hypervisor allocation path, by itself, will not solve
>>> the TOCTOU race.
>> 
>> No, even in the absence of large pages, the tool stack will do 8M
>> allocations, just without requesting them to be contiguous.
>> Whether 8M is a suitable value is another aspect; that value may
>> predate hypercall preemption, and I don't immediately see why
>> the tool stack shouldn't be able to request larger chunks (up to
>> the whole amount at once).
> 
> It is probably to allow other dom0 processing (including softirqs) to
> preempt the toolstack task, in the case that the kernel was not built with
> involuntary preemption enabled (having it disabled is the common case I
> believe?). 8M batches may provide enough returns to user space to allow
> other work to get a look-in.

That may have mattered when ioctl-s were run with the big kernel
lock held, but even 2.6.18 didn't do that anymore (using the
.unlocked_ioctl field of struct file_operations), which means
that even softirqs will get serviced in Dom0 since the preempted
hypercall gets restarted via exiting to the guest (i.e. events get
delivered). Scheduling is what indeed wouldn't happen, but if
allocation latency can be brought down, 8M might turn out pretty
small a chunk size.

If we do care about Dom0-s running even older kernels (assuming
there ever was a privcmd implementation that didn't use the
unlocked path), or if we have to assume non-Linux Dom0-s might
have issues here, making the tool stack behavior kernel kind/
version dependent without strong need of course wouldn't sound
very attractive.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 09:08:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 09:08:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWO6L-0003zh-60; Thu, 08 Nov 2012 09:08:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWO6K-0003zc-BU
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 09:08:40 +0000
Received: from [85.158.143.99:6814] by server-1.bemta-4.messagelabs.com id
	6A/FF-27934-7967B905; Thu, 08 Nov 2012 09:08:39 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1352365718!17889549!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28975 invoked from network); 8 Nov 2012 09:08:39 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 09:08:39 -0000
Received: by mail-we0-f173.google.com with SMTP id t11so1357285wey.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 01:08:38 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=CYwpUvgqprF8meFDXm4aQGjDGZIGeXxnSAOcSfo052U=;
	b=kY0bJG9Re2C1OmiGMel/8/PeP3vyrOWmRYYexGcPQQrwCmf6Pf0WiC31a4QDM7y/ZZ
	tB0BtGRH592f/P3Yz8nJOZotkf1cGGMlJ4xczqdMtSUTNvc1ytdngzxvO09ySaz3VOzT
	GU7faga7IXwimdXJvkgx96j8wBr+GRN7gVZGQK5qo3p4+yfy+b2YyJknfTx2FOld9JmL
	ickxH/yqGxv+pazTF4gBGFSpIlVt5bjFQrAtx46PqGBP59w/5sLMuNmJN78zEYcJnvko
	6g42cLwF3HBoPX5eQjw6VddfNf/wPuN27hHnFJgi8H3krdTBDLZmd0mctGSLKuGXs30d
	vSLg==
Received: by 10.181.11.233 with SMTP id el9mr11992841wid.3.1352365718654;
	Thu, 08 Nov 2012 01:08:38 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id hf10sm6971789wib.0.2012.11.08.01.08.37
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 01:08:38 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 09:08:34 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <CCC12712.51B0A%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] x86/emul: only emulate possibly operand
	sizes for POPA
Thread-Index: Ac29kKEjZirPQ1mIOEuOmgIBKueZCA==
In-Reply-To: <509B7C9C02000078000A725F@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/emul: only emulate possibly operand
 sizes for POPA
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 08:34, "Jan Beulich" <JBeulich@suse.com> wrote:

>> I did wonder. The top halves of 64b registers are not used in compatibility
>> mode. Are their contents at all guaranteed to be
>> maintained/updated/preserved in any meaningful way across transitions into
>> and out of compatibility mode? I wasn't aware they were, and in that case
>> the cast and comment are indeed pointless.
> 
> There's no architectural guarantee, but that's how CPUs work.
> The important aspect (from an information leak perspective) is
> that upper halves don't get zeroed explicitly when switching
> between compatibility and 64-bit modes.
> 
> Now we can of course utilize that read_ulong() already does the
> zero extension (but if it didn't, we would leak stack contents here,
> so it may still be worth a comment), to the net effect of

The concern over information leak is fair. Just leave the code line as-is
then with the explicit cast and end-of-line comment.

 K.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 09:08:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 09:08:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWO6L-0003zh-60; Thu, 08 Nov 2012 09:08:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWO6K-0003zc-BU
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 09:08:40 +0000
Received: from [85.158.143.99:6814] by server-1.bemta-4.messagelabs.com id
	6A/FF-27934-7967B905; Thu, 08 Nov 2012 09:08:39 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1352365718!17889549!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28975 invoked from network); 8 Nov 2012 09:08:39 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 09:08:39 -0000
Received: by mail-we0-f173.google.com with SMTP id t11so1357285wey.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 01:08:38 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=CYwpUvgqprF8meFDXm4aQGjDGZIGeXxnSAOcSfo052U=;
	b=kY0bJG9Re2C1OmiGMel/8/PeP3vyrOWmRYYexGcPQQrwCmf6Pf0WiC31a4QDM7y/ZZ
	tB0BtGRH592f/P3Yz8nJOZotkf1cGGMlJ4xczqdMtSUTNvc1ytdngzxvO09ySaz3VOzT
	GU7faga7IXwimdXJvkgx96j8wBr+GRN7gVZGQK5qo3p4+yfy+b2YyJknfTx2FOld9JmL
	ickxH/yqGxv+pazTF4gBGFSpIlVt5bjFQrAtx46PqGBP59w/5sLMuNmJN78zEYcJnvko
	6g42cLwF3HBoPX5eQjw6VddfNf/wPuN27hHnFJgi8H3krdTBDLZmd0mctGSLKuGXs30d
	vSLg==
Received: by 10.181.11.233 with SMTP id el9mr11992841wid.3.1352365718654;
	Thu, 08 Nov 2012 01:08:38 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id hf10sm6971789wib.0.2012.11.08.01.08.37
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 01:08:38 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 09:08:34 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <CCC12712.51B0A%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] x86/emul: only emulate possibly operand
	sizes for POPA
Thread-Index: Ac29kKEjZirPQ1mIOEuOmgIBKueZCA==
In-Reply-To: <509B7C9C02000078000A725F@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/emul: only emulate possibly operand
 sizes for POPA
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 08:34, "Jan Beulich" <JBeulich@suse.com> wrote:

>> I did wonder. The top halves of 64b registers are not used in compatibility
>> mode. Are their contents at all guaranteed to be
>> maintained/updated/preserved in any meaningful way across transitions into
>> and out of compatibility mode? I wasn't aware they were, and in that case
>> the cast and comment are indeed pointless.
> 
> There's no architectural guarantee, but that's how CPUs work.
> The important aspect (from an information leak perspective) is
> that upper halves don't get zeroed explicitly when switching
> between compatibility and 64-bit modes.
> 
> Now we can of course utilize that read_ulong() already does the
> zero extension (but if it didn't, we would leak stack contents here,
> so it may still be worth a comment), to the net effect of

The concern over information leak is fair. Just leave the code line as-is
then with the explicit cast and end-of-line comment.

 K.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 09:12:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 09:12:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWOAC-00048E-RB; Thu, 08 Nov 2012 09:12:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWOAB-000488-Ec
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 09:12:39 +0000
Received: from [85.158.139.83:45654] by server-14.bemta-5.messagelabs.com id
	D7/52-21768-6877B905; Thu, 08 Nov 2012 09:12:38 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1352365957!29035686!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1557 invoked from network); 8 Nov 2012 09:12:37 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 09:12:37 -0000
Received: by mail-ee0-f45.google.com with SMTP id b47so1696272eek.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 01:12:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=U3i+FGNcZksjN7/BZkn3KYZ8e//dFwK3WHsQgqeWXCQ=;
	b=H2m5Qm0EJkXp3kwrvS+xQm2qWGSfTJ3ErcAKUpJn+RBjfw7qhlkvLZT7WA+8BW9Vay
	ydqqDmLN6nmWIOWZrRNEV0zxSsrREGXxktZZWlX2oTW1dvSct/AhNBBW4dx2HgUl/KLW
	TvPO9SYI1bJvooyAcuygSxZsp/IfAmX0IHkBOWM6beILu7CwZZK31mULq1yGJYMALgyw
	sHm6NeLoOWAQQM6jRuY1KkKlVRIFYf4sGOo8hJbOvecyuCTEc3K1tN8DzbYz2RkxiswS
	8uICvGaDTXYiaJxCCqqVY0J6B+rtjlFWtBAmnR+nhhg6AF4oNMcIsA8Bme7Qrk6HnBEL
	kUTg==
Received: by 10.14.221.194 with SMTP id r42mr25461452eep.25.1352365957724;
	Thu, 08 Nov 2012 01:12:37 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id 42sm69222310eee.0.2012.11.08.01.12.34
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 01:12:37 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 09:12:30 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <CCC127FE.51B0C%keir@xen.org>
Thread-Topic: Proposed new "memory capacity claim" hypercall/feature
Thread-Index: Ac29kS3OaojRhIaOx0SFTPFp5cd21w==
In-Reply-To: <509B813B02000078000A7279@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 08:54, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 08.11.12 at 09:18, Keir Fraser <keir.xen@gmail.com> wrote:
>> On 08/11/2012 08:00, "Jan Beulich" <JBeulich@suse.com> wrote:
>> 
>>>>>> On 07.11.12 at 23:17, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>>> It appears that the attempt to use 2MB and 1GB pages is done in
>>>> the toolstack, and if the hypervisor rejects it, toolstack tries
>>>> smaller pages.  Thus, if physical memory is highly fragmented
>>>> (few or no order>=9 allocations available), this will result
>>>> in one hypercall per 4k page so a 256GB domain would require
>>>> 64 million hypercalls.  And, since AFAICT, there is no sane
>>>> way to hold the heap_lock across even two hypercalls, speeding
>>>> up the in-hypervisor allocation path, by itself, will not solve
>>>> the TOCTOU race.
>>> 
>>> No, even in the absence of large pages, the tool stack will do 8M
>>> allocations, just without requesting them to be contiguous.
>>> Whether 8M is a suitable value is another aspect; that value may
>>> predate hypercall preemption, and I don't immediately see why
>>> the tool stack shouldn't be able to request larger chunks (up to
>>> the whole amount at once).
>> 
>> It is probably to allow other dom0 processing (including softirqs) to
>> preempt the toolstack task, in the case that the kernel was not built with
>> involuntary preemption enabled (having it disabled is the common case I
>> believe?). 8M batches may provide enough returns to user space to allow
>> other work to get a look-in.
> 
> That may have mattered when ioctl-s were run with the big kernel
> lock held, but even 2.6.18 didn't do that anymore (using the
> .unlocked_ioctl field of struct file_operations), which means
> that even softirqs will get serviced in Dom0 since the preempted
> hypercall gets restarted via exiting to the guest (i.e. events get
> delivered). Scheduling is what indeed wouldn't happen, but if
> allocation latency can be brought down, 8M might turn out pretty
> small a chunk size.

Ah, then I am out of date on how Linux services softirqs and preemption? Can
softirqs/preemption occur any time, even in kernel mode, so long as no locks
are held?

I thought softirq-type work only happened during event servicing, only if
the event servicing had interrupted user context (ie, would not happen if
started from within kernel mode). So the restart of the hypercall trap
instruction would be an opportunity to service hardirqs, but not softirqs or
scheduler...

 -- Keir

> If we do care about Dom0-s running even older kernels (assuming
> there ever was a privcmd implementation that didn't use the
> unlocked path), or if we have to assume non-Linux Dom0-s might
> have issues here, making the tool stack behavior kernel kind/
> version dependent without strong need of course wouldn't sound
> very attractive.
> 
> Jan
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 09:12:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 09:12:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWOAC-00048E-RB; Thu, 08 Nov 2012 09:12:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWOAB-000488-Ec
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 09:12:39 +0000
Received: from [85.158.139.83:45654] by server-14.bemta-5.messagelabs.com id
	D7/52-21768-6877B905; Thu, 08 Nov 2012 09:12:38 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1352365957!29035686!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1557 invoked from network); 8 Nov 2012 09:12:37 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 09:12:37 -0000
Received: by mail-ee0-f45.google.com with SMTP id b47so1696272eek.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 01:12:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=U3i+FGNcZksjN7/BZkn3KYZ8e//dFwK3WHsQgqeWXCQ=;
	b=H2m5Qm0EJkXp3kwrvS+xQm2qWGSfTJ3ErcAKUpJn+RBjfw7qhlkvLZT7WA+8BW9Vay
	ydqqDmLN6nmWIOWZrRNEV0zxSsrREGXxktZZWlX2oTW1dvSct/AhNBBW4dx2HgUl/KLW
	TvPO9SYI1bJvooyAcuygSxZsp/IfAmX0IHkBOWM6beILu7CwZZK31mULq1yGJYMALgyw
	sHm6NeLoOWAQQM6jRuY1KkKlVRIFYf4sGOo8hJbOvecyuCTEc3K1tN8DzbYz2RkxiswS
	8uICvGaDTXYiaJxCCqqVY0J6B+rtjlFWtBAmnR+nhhg6AF4oNMcIsA8Bme7Qrk6HnBEL
	kUTg==
Received: by 10.14.221.194 with SMTP id r42mr25461452eep.25.1352365957724;
	Thu, 08 Nov 2012 01:12:37 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id 42sm69222310eee.0.2012.11.08.01.12.34
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 01:12:37 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 09:12:30 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <CCC127FE.51B0C%keir@xen.org>
Thread-Topic: Proposed new "memory capacity claim" hypercall/feature
Thread-Index: Ac29kS3OaojRhIaOx0SFTPFp5cd21w==
In-Reply-To: <509B813B02000078000A7279@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 08:54, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 08.11.12 at 09:18, Keir Fraser <keir.xen@gmail.com> wrote:
>> On 08/11/2012 08:00, "Jan Beulich" <JBeulich@suse.com> wrote:
>> 
>>>>>> On 07.11.12 at 23:17, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>>> It appears that the attempt to use 2MB and 1GB pages is done in
>>>> the toolstack, and if the hypervisor rejects it, toolstack tries
>>>> smaller pages.  Thus, if physical memory is highly fragmented
>>>> (few or no order>=9 allocations available), this will result
>>>> in one hypercall per 4k page so a 256GB domain would require
>>>> 64 million hypercalls.  And, since AFAICT, there is no sane
>>>> way to hold the heap_lock across even two hypercalls, speeding
>>>> up the in-hypervisor allocation path, by itself, will not solve
>>>> the TOCTOU race.
>>> 
>>> No, even in the absence of large pages, the tool stack will do 8M
>>> allocations, just without requesting them to be contiguous.
>>> Whether 8M is a suitable value is another aspect; that value may
>>> predate hypercall preemption, and I don't immediately see why
>>> the tool stack shouldn't be able to request larger chunks (up to
>>> the whole amount at once).
>> 
>> It is probably to allow other dom0 processing (including softirqs) to
>> preempt the toolstack task, in the case that the kernel was not built with
>> involuntary preemption enabled (having it disabled is the common case I
>> believe?). 8M batches may provide enough returns to user space to allow
>> other work to get a look-in.
> 
> That may have mattered when ioctl-s were run with the big kernel
> lock held, but even 2.6.18 didn't do that anymore (using the
> .unlocked_ioctl field of struct file_operations), which means
> that even softirqs will get serviced in Dom0 since the preempted
> hypercall gets restarted via exiting to the guest (i.e. events get
> delivered). Scheduling is what indeed wouldn't happen, but if
> allocation latency can be brought down, 8M might turn out pretty
> small a chunk size.

Ah, then I am out of date on how Linux services softirqs and preemption? Can
softirqs/preemption occur any time, even in kernel mode, so long as no locks
are held?

I thought softirq-type work only happened during event servicing, only if
the event servicing had interrupted user context (ie, would not happen if
started from within kernel mode). So the restart of the hypercall trap
instruction would be an opportunity to service hardirqs, but not softirqs or
scheduler...

 -- Keir

> If we do care about Dom0-s running even older kernels (assuming
> there ever was a privcmd implementation that didn't use the
> unlocked path), or if we have to assume non-Linux Dom0-s might
> have issues here, making the tool stack behavior kernel kind/
> version dependent without strong need of course wouldn't sound
> very attractive.
> 
> Jan
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 09:40:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 09:40:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWOao-0004Mm-5s; Thu, 08 Nov 2012 09:40:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWOam-0004Mh-6m
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 09:40:08 +0000
Received: from [85.158.143.35:6478] by server-1.bemta-4.messagelabs.com id
	53/23-27934-7FD7B905; Thu, 08 Nov 2012 09:40:07 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1352367594!16835318!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30757 invoked from network); 8 Nov 2012 09:39:54 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-21.messagelabs.com with SMTP;
	8 Nov 2012 09:39:54 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 09:39:53 +0000
Message-Id: <509B8BF802000078000A72A3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 09:39:52 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <Philippe.Simonet@swisscom.com>,"Keir Fraser" <keir@xen.org>
References: <1352294551.12977.61.camel@hastur.hellion.org.uk>
	<CCC04D8E.51A0E%keir@xen.org>
In-Reply-To: <CCC04D8E.51A0E%keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: 599161@bugs.debian.org, xen-devel@lists.xen.org, mrsanna1@gmail.com,
	Ian Campbell <ijc@hellion.org.uk>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 07.11.12 at 18:40, Keir Fraser <keir@xen.org> wrote:
> On 07/11/2012 13:22, "Ian Campbell" <ijc@hellion.org.uk> wrote:
> 
>>>> (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
>>>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
>>>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
>>>> tsc_stamp=e3839fcb0273
>>> 
>>> (below is the complete xm dmesg output)
>>> 
>>> did that help you ? do you need more info ?
>> 
>> I'll leave this to Keir (who wrote the debugging patch) to answer but it
>> looks to me like it should be useful!
> 
> I'm scratching my head. plt_wrap is earlier than plt_now, which should be
> impossible. plt_stamp64 oddly has low 32 bits identical to new_stamp. That
> seems very very improbable!

Is it? My understanding was that plt_stamp64 is just a software
extension to the more narrow HW counter, and hence the low
plt_mask bits would always be expected to be identical.

The plt_wrap < plt_now thing of course is entirely unexplainable
to me too: Considering that plt_scale doesn't change at all post-
boot, apart from memory corruption I could only see an memory
access ordering problem to be the reason (platform_timer_stamp
and/or stime_platform_stamp changing despite platform_timer_lock
being held. So maybe taking a snapshot of all three static values
involved in the calculation in __read_platform_stime() between
acquiring the lock and the first call to __read_platform_stime(),
and printing them together with the "live" values in a second
printk() after the one your original patch added could rule that
out.

But the box doesn't even seem to be NUMA (of course it also
doesn't help that the log level was kept restricted - hint, hint,
Philippe), not does there appear to be any S3 cycle or pCPU
bring-up/-down in between...

Philippe, could you clarify again what CPU model(s) this is being
observed on (the long times between individual steps forward
with this problem perhaps warrant repeating the basics each
time, as it's otherwise quite cumbersome to always look up old
pieces of information).

> I wonder whether the overflow handling should just be removed, or made
> conditional on a command-line parameter, or on the 32-bit platform counter
> being at least somewhat likely to overflow before a softirq occurs -- it
> seems lots of systems are using 14MHz HPET, and that gives us a couple of
> minutes for the plt_overflow softirq to do its work before overflow occurs.
> I think we would notice that outage in other ways. :)

Iirc we added this for a good reason - to cover the, however
unlikely, event of Xen running for very long without preemption.
Presumably most of the cases got fixed meanwhile, and indeed
a wraparound time on the order of minutes should make this
superfluous, but as the case here shows that code did spot a
severe anomaly (whatever that may turn out to be).

Also recall that there are HPET implementations around that tick
at a much higher frequency than 14MHz.

So unless we finally reach the understanding that the code is
flawed, I would rather want to keep it.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 09:40:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 09:40:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWOao-0004Mm-5s; Thu, 08 Nov 2012 09:40:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWOam-0004Mh-6m
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 09:40:08 +0000
Received: from [85.158.143.35:6478] by server-1.bemta-4.messagelabs.com id
	53/23-27934-7FD7B905; Thu, 08 Nov 2012 09:40:07 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1352367594!16835318!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30757 invoked from network); 8 Nov 2012 09:39:54 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-21.messagelabs.com with SMTP;
	8 Nov 2012 09:39:54 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 09:39:53 +0000
Message-Id: <509B8BF802000078000A72A3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 09:39:52 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <Philippe.Simonet@swisscom.com>,"Keir Fraser" <keir@xen.org>
References: <1352294551.12977.61.camel@hastur.hellion.org.uk>
	<CCC04D8E.51A0E%keir@xen.org>
In-Reply-To: <CCC04D8E.51A0E%keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: 599161@bugs.debian.org, xen-devel@lists.xen.org, mrsanna1@gmail.com,
	Ian Campbell <ijc@hellion.org.uk>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 07.11.12 at 18:40, Keir Fraser <keir@xen.org> wrote:
> On 07/11/2012 13:22, "Ian Campbell" <ijc@hellion.org.uk> wrote:
> 
>>>> (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
>>>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
>>>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
>>>> tsc_stamp=e3839fcb0273
>>> 
>>> (below is the complete xm dmesg output)
>>> 
>>> did that help you ? do you need more info ?
>> 
>> I'll leave this to Keir (who wrote the debugging patch) to answer but it
>> looks to me like it should be useful!
> 
> I'm scratching my head. plt_wrap is earlier than plt_now, which should be
> impossible. plt_stamp64 oddly has low 32 bits identical to new_stamp. That
> seems very very improbable!

Is it? My understanding was that plt_stamp64 is just a software
extension to the more narrow HW counter, and hence the low
plt_mask bits would always be expected to be identical.

The plt_wrap < plt_now thing of course is entirely unexplainable
to me too: Considering that plt_scale doesn't change at all post-
boot, apart from memory corruption I could only see an memory
access ordering problem to be the reason (platform_timer_stamp
and/or stime_platform_stamp changing despite platform_timer_lock
being held. So maybe taking a snapshot of all three static values
involved in the calculation in __read_platform_stime() between
acquiring the lock and the first call to __read_platform_stime(),
and printing them together with the "live" values in a second
printk() after the one your original patch added could rule that
out.

But the box doesn't even seem to be NUMA (of course it also
doesn't help that the log level was kept restricted - hint, hint,
Philippe), not does there appear to be any S3 cycle or pCPU
bring-up/-down in between...

Philippe, could you clarify again what CPU model(s) this is being
observed on (the long times between individual steps forward
with this problem perhaps warrant repeating the basics each
time, as it's otherwise quite cumbersome to always look up old
pieces of information).

> I wonder whether the overflow handling should just be removed, or made
> conditional on a command-line parameter, or on the 32-bit platform counter
> being at least somewhat likely to overflow before a softirq occurs -- it
> seems lots of systems are using 14MHz HPET, and that gives us a couple of
> minutes for the plt_overflow softirq to do its work before overflow occurs.
> I think we would notice that outage in other ways. :)

Iirc we added this for a good reason - to cover the, however
unlikely, event of Xen running for very long without preemption.
Presumably most of the cases got fixed meanwhile, and indeed
a wraparound time on the order of minutes should make this
superfluous, but as the case here shows that code did spot a
severe anomaly (whatever that may turn out to be).

Also recall that there are HPET implementations around that tick
at a much higher frequency than 14MHz.

So unless we finally reach the understanding that the code is
flawed, I would rather want to keep it.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 10:12:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 10:12:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWP5I-0004i9-0h; Thu, 08 Nov 2012 10:11:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TWP5G-0004i4-VH
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 10:11:39 +0000
Received: from [85.158.139.83:17731] by server-12.bemta-5.messagelabs.com id
	24/3B-02886-9558B905; Thu, 08 Nov 2012 10:11:37 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1352369497!29319334!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTc5Mjg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31487 invoked from network); 8 Nov 2012 10:11:37 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 10:11:37 -0000
X-IronPort-AV: E=Sophos;i="4.80,737,1344211200"; d="scan'208";a="15664090"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	08 Nov 2012 10:11:33 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 8 Nov 2012 10:11:33 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TWP5B-00053s-Df; Thu, 08 Nov 2012 10:11:33 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TWP5B-00007M-7y;
	Thu, 08 Nov 2012 10:11:33 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20635.34133.118531.778138@mariner.uk.xensource.com>
Date: Thu, 8 Nov 2012 10:11:33 +0000
To: Keir Fraser <keir.xen@gmail.com>
In-Reply-To: <CCC11199.443CE%keir.xen@gmail.com>
References: <7563be37-62f1-472e-9aec-1d0c55fa7c29@default>
	<CCC11199.443CE%keir.xen@gmail.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: "Tim
	\(Xen.org\)" <tim@xen.org>, Dan Magenheimer <dan.magenheimer@oracle.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	George Shuklin <george.shuklin@gmail.com>, Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	DarioFaggioli <raistlin@linux.it>, Jan Beulich <JBeulich@suse.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Keir Fraser writes ("Re: Proposed new "memory capacity claim" hypercall/feature"):
> On 07/11/2012 22:17, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:
> > I think this brings us back to the proposed "claim" hypercall/subop.
> > Unless there are further objections or suggestions for different
> > approaches, I'll commence prototyping it, OK?
> 
> Yes, in fact I thought you'd started already!

Sorry to play bad cop here but I am still far from convinced that a
new hypercall is necessary or desirable.

A lot of words have been written but the concrete, detailed, technical
argument remains to be made IMO.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 10:12:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 10:12:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWP5I-0004i9-0h; Thu, 08 Nov 2012 10:11:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TWP5G-0004i4-VH
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 10:11:39 +0000
Received: from [85.158.139.83:17731] by server-12.bemta-5.messagelabs.com id
	24/3B-02886-9558B905; Thu, 08 Nov 2012 10:11:37 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1352369497!29319334!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTc5Mjg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31487 invoked from network); 8 Nov 2012 10:11:37 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 10:11:37 -0000
X-IronPort-AV: E=Sophos;i="4.80,737,1344211200"; d="scan'208";a="15664090"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	08 Nov 2012 10:11:33 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 8 Nov 2012 10:11:33 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TWP5B-00053s-Df; Thu, 08 Nov 2012 10:11:33 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TWP5B-00007M-7y;
	Thu, 08 Nov 2012 10:11:33 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20635.34133.118531.778138@mariner.uk.xensource.com>
Date: Thu, 8 Nov 2012 10:11:33 +0000
To: Keir Fraser <keir.xen@gmail.com>
In-Reply-To: <CCC11199.443CE%keir.xen@gmail.com>
References: <7563be37-62f1-472e-9aec-1d0c55fa7c29@default>
	<CCC11199.443CE%keir.xen@gmail.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: "Tim
	\(Xen.org\)" <tim@xen.org>, Dan Magenheimer <dan.magenheimer@oracle.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	George Shuklin <george.shuklin@gmail.com>, Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	DarioFaggioli <raistlin@linux.it>, Jan Beulich <JBeulich@suse.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Keir Fraser writes ("Re: Proposed new "memory capacity claim" hypercall/feature"):
> On 07/11/2012 22:17, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:
> > I think this brings us back to the proposed "claim" hypercall/subop.
> > Unless there are further objections or suggestions for different
> > approaches, I'll commence prototyping it, OK?
> 
> Yes, in fact I thought you'd started already!

Sorry to play bad cop here but I am still far from convinced that a
new hypercall is necessary or desirable.

A lot of words have been written but the concrete, detailed, technical
argument remains to be made IMO.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 10:39:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 10:39:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWPVK-0004uC-Fc; Thu, 08 Nov 2012 10:38:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWPVJ-0004u7-78
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 10:38:33 +0000
Received: from [85.158.143.99:11122] by server-1.bemta-4.messagelabs.com id
	19/CB-27934-8AB8B905; Thu, 08 Nov 2012 10:38:32 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1352371108!18313483!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8548 invoked from network); 8 Nov 2012 10:38:30 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-14.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 10:38:30 -0000
Received: by mail-ee0-f45.google.com with SMTP id b47so1748669eek.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 02:38:25 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=Sz+JxiBExWoCe2GqOs2Hh8iPCNVo+h9Ki2R/EkPn0gs=;
	b=zb6iCTQiGA2seiPVKpVzues07AeryDR7Inato7wonomVKrqtkRR68J2mxi/Uhs4h+z
	psIWfkfmbrJhoI5q4LqxiMbrENr2cE33DfT2buoL8I4/gqvAPqXFhdmmA0zGUwpuNa11
	WtGI61MIlmevfc8eq/0Y17EsvQ4RnM1dZw0H+Aj9P8YF9FrAvuzl7NFYYhX4nQkZU4Dw
	70XW7MvJJQlK0W+et11vVtRnDrXC3c0JE3Cr13HoqHoIBbJSfPTiG8KJ+ZKaBuLEXu7e
	J9Y25VsIdPuBPaBjlE2wxG52rMzbIQk+pF7qaMbMsVLjYNGb2Cmxd8GksOMh6yioTrO2
	gBrw==
Received: by 10.14.178.195 with SMTP id f43mr26107050eem.44.1352371105718;
	Thu, 08 Nov 2012 02:38:25 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id g5sm69597470eem.4.2012.11.08.02.38.23
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 02:38:25 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 10:38:20 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	<Philippe.Simonet@swisscom.com>
Message-ID: <CCC13C1C.51B65%keir@xen.org>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
	minutes" bug.
Thread-Index: Ac29nStxcTMLLQIYPEKZ2yhC5XkHjg==
In-Reply-To: <509B8BF802000078000A72A3@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: 599161@bugs.debian.org, xen-devel@lists.xen.org, mrsanna1@gmail.com,
	Ian Campbell <ijc@hellion.org.uk>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 09:39, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>>> (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
>>>>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
>>>>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
>>>>> tsc_stamp=e3839fcb0273
>>>> 
>>>> (below is the complete xm dmesg output)
>>>> 
>>>> did that help you ? do you need more info ?
>>> 
>>> I'll leave this to Keir (who wrote the debugging patch) to answer but it
>>> looks to me like it should be useful!
>> 
>> I'm scratching my head. plt_wrap is earlier than plt_now, which should be
>> impossible. plt_stamp64 oddly has low 32 bits identical to new_stamp. That
>> seems very very improbable!
> 
> Is it? My understanding was that plt_stamp64 is just a software
> extension to the more narrow HW counter, and hence the low
> plt_mask bits would always be expected to be identical.

No, plt_stamp is simply the HW counter time at which plt_stamp64 was last
brought up to date. Hence plt_stamp64 is updated as:
 plt_stamp64 += (new_stamp - old_stamp) & plt_mask;

Hence why seeing plt_stamp64&plt_mask == new_stamp is very unexpected!

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 10:39:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 10:39:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWPVK-0004uC-Fc; Thu, 08 Nov 2012 10:38:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWPVJ-0004u7-78
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 10:38:33 +0000
Received: from [85.158.143.99:11122] by server-1.bemta-4.messagelabs.com id
	19/CB-27934-8AB8B905; Thu, 08 Nov 2012 10:38:32 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1352371108!18313483!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8548 invoked from network); 8 Nov 2012 10:38:30 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-14.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 10:38:30 -0000
Received: by mail-ee0-f45.google.com with SMTP id b47so1748669eek.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 02:38:25 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=Sz+JxiBExWoCe2GqOs2Hh8iPCNVo+h9Ki2R/EkPn0gs=;
	b=zb6iCTQiGA2seiPVKpVzues07AeryDR7Inato7wonomVKrqtkRR68J2mxi/Uhs4h+z
	psIWfkfmbrJhoI5q4LqxiMbrENr2cE33DfT2buoL8I4/gqvAPqXFhdmmA0zGUwpuNa11
	WtGI61MIlmevfc8eq/0Y17EsvQ4RnM1dZw0H+Aj9P8YF9FrAvuzl7NFYYhX4nQkZU4Dw
	70XW7MvJJQlK0W+et11vVtRnDrXC3c0JE3Cr13HoqHoIBbJSfPTiG8KJ+ZKaBuLEXu7e
	J9Y25VsIdPuBPaBjlE2wxG52rMzbIQk+pF7qaMbMsVLjYNGb2Cmxd8GksOMh6yioTrO2
	gBrw==
Received: by 10.14.178.195 with SMTP id f43mr26107050eem.44.1352371105718;
	Thu, 08 Nov 2012 02:38:25 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id g5sm69597470eem.4.2012.11.08.02.38.23
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 02:38:25 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 10:38:20 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	<Philippe.Simonet@swisscom.com>
Message-ID: <CCC13C1C.51B65%keir@xen.org>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
	minutes" bug.
Thread-Index: Ac29nStxcTMLLQIYPEKZ2yhC5XkHjg==
In-Reply-To: <509B8BF802000078000A72A3@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: 599161@bugs.debian.org, xen-devel@lists.xen.org, mrsanna1@gmail.com,
	Ian Campbell <ijc@hellion.org.uk>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 09:39, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>>> (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
>>>>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
>>>>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
>>>>> tsc_stamp=e3839fcb0273
>>>> 
>>>> (below is the complete xm dmesg output)
>>>> 
>>>> did that help you ? do you need more info ?
>>> 
>>> I'll leave this to Keir (who wrote the debugging patch) to answer but it
>>> looks to me like it should be useful!
>> 
>> I'm scratching my head. plt_wrap is earlier than plt_now, which should be
>> impossible. plt_stamp64 oddly has low 32 bits identical to new_stamp. That
>> seems very very improbable!
> 
> Is it? My understanding was that plt_stamp64 is just a software
> extension to the more narrow HW counter, and hence the low
> plt_mask bits would always be expected to be identical.

No, plt_stamp is simply the HW counter time at which plt_stamp64 was last
brought up to date. Hence plt_stamp64 is updated as:
 plt_stamp64 += (new_stamp - old_stamp) & plt_mask;

Hence why seeing plt_stamp64&plt_mask == new_stamp is very unexpected!

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 10:50:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 10:50:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWPgk-000547-Mf; Thu, 08 Nov 2012 10:50:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWPgi-000542-OG
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 10:50:20 +0000
Received: from [193.109.254.147:32658] by server-10.bemta-14.messagelabs.com
	id A1/B3-31741-C6E8B905; Thu, 08 Nov 2012 10:50:20 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352371818!3317757!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16970 invoked from network); 8 Nov 2012 10:50:19 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 10:50:19 -0000
Received: by mail-wi0-f173.google.com with SMTP id cb5so2013313wib.14
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 02:50:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=+0a9RdB+MA4meGrPOSTtwSwhLKXuXETi1ncF8nnDFiY=;
	b=QSaFuflyswWjF7kJSya2hZGojsR4JXFg3Xoh5fcT3axZPSMDR0OCHw6kujDqeyw+EP
	x1vemrWXy0a6P9Dy6s9RJkPUCNCfsUoPM8ERVS63iPJ0rw75qyhBqZw5ZgUvwxq75NX6
	B+SRGF/UWRfeagtQQVTwRkGH8KB1A2dw5VL+NPe+9T2TCpX7i8Y0ylANPuKeve0WrcXD
	1AwUebO1YRsccEvn9w/DtrwDIDuK5sLULprX28vG+eUnrG6Hrxiy/HuuN9GxsirqAXp0
	IjcDimx9eMD5bp/QgAoptMjl9OuYng8DgHMVGD2MVTkUAbJJCZ9x46V0Xln9n2tu2xuk
	+NHw==
Received: by 10.216.150.197 with SMTP id z47mr3009947wej.221.1352371818360;
	Thu, 08 Nov 2012 02:50:18 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id fg6sm6813675wib.3.2012.11.08.02.50.11
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 02:50:17 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 10:50:03 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <CCC13EDB.51B6E%keir@xen.org>
Thread-Topic: Proposed new "memory capacity claim" hypercall/feature
Thread-Index: Ac29ns529FV2PwxXckCa5cHvwPQcsw==
In-Reply-To: <509B8DC102000078000A72BA@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 09:47, "Jan Beulich" <JBeulich@suse.com> wrote:

>> Ah, then I am out of date on how Linux services softirqs and preemption? Can
>> softirqs/preemption occur any time, even in kernel mode, so long as no locks
>> are held?
>> 
>> I thought softirq-type work only happened during event servicing, only if
>> the event servicing had interrupted user context (ie, would not happen if
>> started from within kernel mode). So the restart of the hypercall trap
>> instruction would be an opportunity to service hardirqs, but not softirqs or
>> scheduler...
> 
> No, irq_exit() can invoke softirqs, provided this isn't a nested IRQ
> (soft as well as hard) or softirqs weren't disabled in the interrupted
> context.

Ah, okay. In fact maybe that's always been the case and I have misremembered
this detail, since condition for softirq entry in Xen has always been more
strict than this.

> The only thing that indeed is - on non-preemptible kernels - done
> only on exit to user mode is the eventual entering of the scheduler.

That alone may still be an argument for restricting the batch size from the
toolstack?

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 10:50:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 10:50:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWPgk-000547-Mf; Thu, 08 Nov 2012 10:50:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWPgi-000542-OG
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 10:50:20 +0000
Received: from [193.109.254.147:32658] by server-10.bemta-14.messagelabs.com
	id A1/B3-31741-C6E8B905; Thu, 08 Nov 2012 10:50:20 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352371818!3317757!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16970 invoked from network); 8 Nov 2012 10:50:19 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 10:50:19 -0000
Received: by mail-wi0-f173.google.com with SMTP id cb5so2013313wib.14
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 02:50:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=+0a9RdB+MA4meGrPOSTtwSwhLKXuXETi1ncF8nnDFiY=;
	b=QSaFuflyswWjF7kJSya2hZGojsR4JXFg3Xoh5fcT3axZPSMDR0OCHw6kujDqeyw+EP
	x1vemrWXy0a6P9Dy6s9RJkPUCNCfsUoPM8ERVS63iPJ0rw75qyhBqZw5ZgUvwxq75NX6
	B+SRGF/UWRfeagtQQVTwRkGH8KB1A2dw5VL+NPe+9T2TCpX7i8Y0ylANPuKeve0WrcXD
	1AwUebO1YRsccEvn9w/DtrwDIDuK5sLULprX28vG+eUnrG6Hrxiy/HuuN9GxsirqAXp0
	IjcDimx9eMD5bp/QgAoptMjl9OuYng8DgHMVGD2MVTkUAbJJCZ9x46V0Xln9n2tu2xuk
	+NHw==
Received: by 10.216.150.197 with SMTP id z47mr3009947wej.221.1352371818360;
	Thu, 08 Nov 2012 02:50:18 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id fg6sm6813675wib.3.2012.11.08.02.50.11
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 02:50:17 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 10:50:03 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <CCC13EDB.51B6E%keir@xen.org>
Thread-Topic: Proposed new "memory capacity claim" hypercall/feature
Thread-Index: Ac29ns529FV2PwxXckCa5cHvwPQcsw==
In-Reply-To: <509B8DC102000078000A72BA@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 09:47, "Jan Beulich" <JBeulich@suse.com> wrote:

>> Ah, then I am out of date on how Linux services softirqs and preemption? Can
>> softirqs/preemption occur any time, even in kernel mode, so long as no locks
>> are held?
>> 
>> I thought softirq-type work only happened during event servicing, only if
>> the event servicing had interrupted user context (ie, would not happen if
>> started from within kernel mode). So the restart of the hypercall trap
>> instruction would be an opportunity to service hardirqs, but not softirqs or
>> scheduler...
> 
> No, irq_exit() can invoke softirqs, provided this isn't a nested IRQ
> (soft as well as hard) or softirqs weren't disabled in the interrupted
> context.

Ah, okay. In fact maybe that's always been the case and I have misremembered
this detail, since condition for softirq entry in Xen has always been more
strict than this.

> The only thing that indeed is - on non-preemptible kernels - done
> only on exit to user mode is the eventual entering of the scheduler.

That alone may still be an argument for restricting the batch size from the
toolstack?

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 10:58:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 10:58:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWPny-0005DQ-JO; Thu, 08 Nov 2012 10:57:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWPnx-0005DL-14
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 10:57:49 +0000
Received: from [85.158.137.99:25775] by server-15.bemta-3.messagelabs.com id
	AD/F9-09445-C209B905; Thu, 08 Nov 2012 10:57:48 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1352372265!18276980!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16679 invoked from network); 8 Nov 2012 10:57:46 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 10:57:46 -0000
Received: by mail-we0-f173.google.com with SMTP id t11so1409544wey.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 02:57:45 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=QpW/n7y2eqGM9yW4XesiSLBAXx+f6Do7b4M3uFUI56U=;
	b=DgFNUKyOAtggGi53wv5TGHjdSjHPab5vj0ZtDjHWdh1zEHdnmL2GoIM+k39ZDSpqNo
	QxVlJS61F1toDeT7rt4U4BPEAzWuQKjDJQxDe/1nmW4m4pif9W8xxHMKSFjf95mAyZ3Q
	7Yg2b7fnXpitVj9zIcMXCb6lL/mLr9L5orcHMrTjZ/uFS/cT5qCA03OksEo8QqwlxL08
	VuX7gR7d1VASFST4qxow5uzJ2RzRUHIEzu3/0BbWNnrBZ09GVEWyNC67m8Rugp+/3KA5
	Nt73iIgwD/mHWg09Lm4wpSydgJCpEscSTbPKziaC9/y0kWalubpnPG3pxf1a8XZXIada
	4rvA==
Received: by 10.180.99.5 with SMTP id em5mr9571456wib.8.1352372265718;
	Thu, 08 Nov 2012 02:57:45 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id ei1sm7744936wid.7.2012.11.08.02.57.41
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 02:57:45 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 10:57:33 +0000
From: Keir Fraser <keir@xen.org>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Message-ID: <CCC1409D.51B70%keir@xen.org>
Thread-Topic: Proposed new "memory capacity claim" hypercall/feature
Thread-Index: Ac29n9qvnNzXg08EC0eB8s+zP+/R0g==
In-Reply-To: <20635.34133.118531.778138@mariner.uk.xensource.com>
Mime-version: 1.0
Cc: "Tim \(Xen.org\)" <tim@xen.org>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	George Shuklin <george.shuklin@gmail.com>, Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	DarioFaggioli <raistlin@linux.it>, Jan Beulich <JBeulich@suse.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 10:11, "Ian Jackson" <Ian.Jackson@eu.citrix.com> wrote:

> Keir Fraser writes ("Re: Proposed new "memory capacity claim"
> hypercall/feature"):
>> On 07/11/2012 22:17, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:
>>> I think this brings us back to the proposed "claim" hypercall/subop.
>>> Unless there are further objections or suggestions for different
>>> approaches, I'll commence prototyping it, OK?
>> 
>> Yes, in fact I thought you'd started already!
> 
> Sorry to play bad cop here but I am still far from convinced that a
> new hypercall is necessary or desirable.
> 
> A lot of words have been written but the concrete, detailed, technical
> argument remains to be made IMO.

I agree but prototyping != acceptance, and at least it gives something
concrete to hang the discussion on. Otherwise this longwinded thread is
going nowhere.

> Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 10:58:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 10:58:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWPny-0005DQ-JO; Thu, 08 Nov 2012 10:57:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWPnx-0005DL-14
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 10:57:49 +0000
Received: from [85.158.137.99:25775] by server-15.bemta-3.messagelabs.com id
	AD/F9-09445-C209B905; Thu, 08 Nov 2012 10:57:48 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1352372265!18276980!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16679 invoked from network); 8 Nov 2012 10:57:46 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 10:57:46 -0000
Received: by mail-we0-f173.google.com with SMTP id t11so1409544wey.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 02:57:45 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=QpW/n7y2eqGM9yW4XesiSLBAXx+f6Do7b4M3uFUI56U=;
	b=DgFNUKyOAtggGi53wv5TGHjdSjHPab5vj0ZtDjHWdh1zEHdnmL2GoIM+k39ZDSpqNo
	QxVlJS61F1toDeT7rt4U4BPEAzWuQKjDJQxDe/1nmW4m4pif9W8xxHMKSFjf95mAyZ3Q
	7Yg2b7fnXpitVj9zIcMXCb6lL/mLr9L5orcHMrTjZ/uFS/cT5qCA03OksEo8QqwlxL08
	VuX7gR7d1VASFST4qxow5uzJ2RzRUHIEzu3/0BbWNnrBZ09GVEWyNC67m8Rugp+/3KA5
	Nt73iIgwD/mHWg09Lm4wpSydgJCpEscSTbPKziaC9/y0kWalubpnPG3pxf1a8XZXIada
	4rvA==
Received: by 10.180.99.5 with SMTP id em5mr9571456wib.8.1352372265718;
	Thu, 08 Nov 2012 02:57:45 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id ei1sm7744936wid.7.2012.11.08.02.57.41
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 02:57:45 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 10:57:33 +0000
From: Keir Fraser <keir@xen.org>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Message-ID: <CCC1409D.51B70%keir@xen.org>
Thread-Topic: Proposed new "memory capacity claim" hypercall/feature
Thread-Index: Ac29n9qvnNzXg08EC0eB8s+zP+/R0g==
In-Reply-To: <20635.34133.118531.778138@mariner.uk.xensource.com>
Mime-version: 1.0
Cc: "Tim \(Xen.org\)" <tim@xen.org>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	George Shuklin <george.shuklin@gmail.com>, Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	DarioFaggioli <raistlin@linux.it>, Jan Beulich <JBeulich@suse.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 10:11, "Ian Jackson" <Ian.Jackson@eu.citrix.com> wrote:

> Keir Fraser writes ("Re: Proposed new "memory capacity claim"
> hypercall/feature"):
>> On 07/11/2012 22:17, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:
>>> I think this brings us back to the proposed "claim" hypercall/subop.
>>> Unless there are further objections or suggestions for different
>>> approaches, I'll commence prototyping it, OK?
>> 
>> Yes, in fact I thought you'd started already!
> 
> Sorry to play bad cop here but I am still far from convinced that a
> new hypercall is necessary or desirable.
> 
> A lot of words have been written but the concrete, detailed, technical
> argument remains to be made IMO.

I agree but prototyping != acceptance, and at least it gives something
concrete to hang the discussion on. Otherwise this longwinded thread is
going nowhere.

> Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 11:02:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 11:02:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWPrq-0005OY-EU; Thu, 08 Nov 2012 11:01:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TWPro-0005OR-DN
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 11:01:48 +0000
Received: from [85.158.143.35:34435] by server-1.bemta-4.messagelabs.com id
	06/33-27934-B119B905; Thu, 08 Nov 2012 11:01:47 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1352372302!11715237!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_20_30,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4804 invoked from network); 8 Nov 2012 10:58:22 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 10:58:22 -0000
Received: by mail-we0-f173.google.com with SMTP id t11so1409816wey.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 02:58:22 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=CNY/vKe1E9pjhllh/Om954i///qsq+ZIQthBSSYS0/0=;
	b=C6okH6aOgm4wi492xZKDySjNF2adP9d778eO6pleWFG4vAKiAMuSzufLKxWz8daNMU
	SdL3c5tUIC8/NGxCeq+M/+f+IDXxmGkfWetF6utdoCwN7UPlHMhDxZ1X2VzeRWpHJoGb
	28xjAsJDaMNy/RZaWyutyyGcMGDNIkuPthQjMD6jwDa1+CTIzZinGxUX/nEEhdJNKEmO
	Pme71BojZXBBWpsY38nbzN2c6wSba4K33CqHdH1NuBU7rkwVO3aZFvt5VmUr7OR2C0BQ
	ICkvlyO/1D5IxjJPRDXvrmSW3zDw6lvaUWAWiOAp+Z2/BwcK7bGeJ3RQ2HLadi2gmhLT
	YjXQ==
MIME-Version: 1.0
Received: by 10.216.228.201 with SMTP id f51mr3046583weq.26.1352372302088;
	Thu, 08 Nov 2012 02:58:22 -0800 (PST)
Received: by 10.227.200.1 with HTTP; Thu, 8 Nov 2012 02:58:22 -0800 (PST)
In-Reply-To: <73e55d7f-737f-4690-8b69-0252e0b749dd@default>
References: <20121106202816.GA29655@aepfle.de>
	<CCBF2785.442DA%keir.xen@gmail.com>
	<20121106221806.GA1813@aepfle.de> <50999ACF.4040106@citrix.com>
	<721bf725-662f-41cb-a1a3-7c908e05c188@default>
	<509A65D6.6050505@citrix.com>
	<73e55d7f-737f-4690-8b69-0252e0b749dd@default>
Date: Thu, 8 Nov 2012 10:58:22 +0000
X-Google-Sender-Auth: EcvHVYa9BPnpfgga7HX7y-EOQE0
Message-ID: <CAFLBxZYBo4Bmx1eZZ523rcz7EkoduY=JM+4q8eJwCEp6JtcO4Q@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6528999157642038205=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6528999157642038205==
Content-Type: multipart/alternative; boundary=0016e6d64463ab8a3204cdf9b6b5

--0016e6d64463ab8a3204cdf9b6b5
Content-Type: text/plain; charset=ISO-8859-1

On Wed, Nov 7, 2012 at 3:10 PM, Dan Magenheimer
<dan.magenheimer@oracle.com>wrote:

> > From an idealistic point of view, it might be quite nice to have several
> > live migrate mechanisms, so the user can choose whether they value
> > minimum downtime, minimum network utilisation, or maximum safety.
>
> Agreed.  IIRC, when post-copy was suggested for Xen years ago,
> Ian Pratt was against it, though I don't recall why, so Michael
> Hines work was never pursued (outside of academia).  Probably
> worth asking IanP before investing too much time into it.
>


Was he against a hybrid approach, where you "push" things first, and then
"pull" things later?  Or just against a pure "pull" approach?  I'm pretty
sure a pure "pull" approach would result in lower performance during the
migration.

Just tossing another idea out there: What about throttling the VM if it's
dirtying too many pages?  You can use the "cap" feature of the credit1
scheduler to reduce the amount of cpu time a given VM gets, even if there
is free cpu time available.  You could play around with doing N iterations,
and then cranking down the cap on each iteration after that; then the
application wouldn't have a several-second pause, it would just be "running
slowly" for some period of time.

Overall doing a hybrid "send dirty pages for a while, then move and pull
the rest in" seems like the best approach in the long-run, but it's fairly
complicated.  A throttling approach is probably less optimal but simpler to
get working as a temporary measure.

 -George

--0016e6d64463ab8a3204cdf9b6b5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Wed, Nov 7, 2012 at 3:10 PM, Dan Magenheimer <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:dan.magenheimer@oracle.com" target=3D"_blank">dan.magenheimer@=
oracle.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=
=3D"gmail_quote">

<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex">&gt; From an idealistic p=
oint of view, it might be quite nice to have several<br><div>
&gt; live migrate mechanisms, so the user can choose whether they value<br>
&gt; minimum downtime, minimum network utilisation, or maximum safety.<br>
<br>
</div>Agreed. =A0IIRC, when post-copy was suggested for Xen years ago,<br>
Ian Pratt was against it, though I don&#39;t recall why, so Michael<br>
Hines work was never pursued (outside of academia). =A0Probably<br>
worth asking IanP before investing too much time into it.<br></blockquote><=
br></div><br>Was he against a hybrid approach, where you &quot;push&quot; t=
hings first, and then &quot;pull&quot; things later?=A0 Or just against a p=
ure &quot;pull&quot; approach?=A0 I&#39;m pretty sure a pure &quot;pull&quo=
t; approach would result in lower performance during the migration.<br>

<br>Just tossing another idea out there: What about throttling the VM if it=
&#39;s dirtying too many pages?=A0 You can use the &quot;cap&quot; feature =
of the credit1 scheduler to reduce the amount of cpu time a given VM gets, =
even if there is free cpu time available.=A0 You could play around with doi=
ng N iterations, and then cranking down the cap on each iteration after tha=
t; then the application wouldn&#39;t have a several-second pause, it would =
just be &quot;running slowly&quot; for some period of time.<br>

<br>Overall doing a hybrid &quot;send dirty pages for a while, then move an=
d pull the rest in&quot; seems like the best approach in the long-run, but =
it&#39;s fairly complicated.=A0 A throttling approach is probably less opti=
mal but simpler to get working as a temporary measure.<br>

<br>=A0-George<br></div>

--0016e6d64463ab8a3204cdf9b6b5--


--===============6528999157642038205==
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.xen.org
http://lists.xen.org/xen-devel

--===============6528999157642038205==--


From xen-devel-bounces@lists.xen.org Thu Nov 08 11:02:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 11:02:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWPrq-0005OY-EU; Thu, 08 Nov 2012 11:01:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TWPro-0005OR-DN
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 11:01:48 +0000
Received: from [85.158.143.35:34435] by server-1.bemta-4.messagelabs.com id
	06/33-27934-B119B905; Thu, 08 Nov 2012 11:01:47 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1352372302!11715237!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_20_30,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4804 invoked from network); 8 Nov 2012 10:58:22 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 10:58:22 -0000
Received: by mail-we0-f173.google.com with SMTP id t11so1409816wey.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 02:58:22 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=CNY/vKe1E9pjhllh/Om954i///qsq+ZIQthBSSYS0/0=;
	b=C6okH6aOgm4wi492xZKDySjNF2adP9d778eO6pleWFG4vAKiAMuSzufLKxWz8daNMU
	SdL3c5tUIC8/NGxCeq+M/+f+IDXxmGkfWetF6utdoCwN7UPlHMhDxZ1X2VzeRWpHJoGb
	28xjAsJDaMNy/RZaWyutyyGcMGDNIkuPthQjMD6jwDa1+CTIzZinGxUX/nEEhdJNKEmO
	Pme71BojZXBBWpsY38nbzN2c6wSba4K33CqHdH1NuBU7rkwVO3aZFvt5VmUr7OR2C0BQ
	ICkvlyO/1D5IxjJPRDXvrmSW3zDw6lvaUWAWiOAp+Z2/BwcK7bGeJ3RQ2HLadi2gmhLT
	YjXQ==
MIME-Version: 1.0
Received: by 10.216.228.201 with SMTP id f51mr3046583weq.26.1352372302088;
	Thu, 08 Nov 2012 02:58:22 -0800 (PST)
Received: by 10.227.200.1 with HTTP; Thu, 8 Nov 2012 02:58:22 -0800 (PST)
In-Reply-To: <73e55d7f-737f-4690-8b69-0252e0b749dd@default>
References: <20121106202816.GA29655@aepfle.de>
	<CCBF2785.442DA%keir.xen@gmail.com>
	<20121106221806.GA1813@aepfle.de> <50999ACF.4040106@citrix.com>
	<721bf725-662f-41cb-a1a3-7c908e05c188@default>
	<509A65D6.6050505@citrix.com>
	<73e55d7f-737f-4690-8b69-0252e0b749dd@default>
Date: Thu, 8 Nov 2012 10:58:22 +0000
X-Google-Sender-Auth: EcvHVYa9BPnpfgga7HX7y-EOQE0
Message-ID: <CAFLBxZYBo4Bmx1eZZ523rcz7EkoduY=JM+4q8eJwCEp6JtcO4Q@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6528999157642038205=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6528999157642038205==
Content-Type: multipart/alternative; boundary=0016e6d64463ab8a3204cdf9b6b5

--0016e6d64463ab8a3204cdf9b6b5
Content-Type: text/plain; charset=ISO-8859-1

On Wed, Nov 7, 2012 at 3:10 PM, Dan Magenheimer
<dan.magenheimer@oracle.com>wrote:

> > From an idealistic point of view, it might be quite nice to have several
> > live migrate mechanisms, so the user can choose whether they value
> > minimum downtime, minimum network utilisation, or maximum safety.
>
> Agreed.  IIRC, when post-copy was suggested for Xen years ago,
> Ian Pratt was against it, though I don't recall why, so Michael
> Hines work was never pursued (outside of academia).  Probably
> worth asking IanP before investing too much time into it.
>


Was he against a hybrid approach, where you "push" things first, and then
"pull" things later?  Or just against a pure "pull" approach?  I'm pretty
sure a pure "pull" approach would result in lower performance during the
migration.

Just tossing another idea out there: What about throttling the VM if it's
dirtying too many pages?  You can use the "cap" feature of the credit1
scheduler to reduce the amount of cpu time a given VM gets, even if there
is free cpu time available.  You could play around with doing N iterations,
and then cranking down the cap on each iteration after that; then the
application wouldn't have a several-second pause, it would just be "running
slowly" for some period of time.

Overall doing a hybrid "send dirty pages for a while, then move and pull
the rest in" seems like the best approach in the long-run, but it's fairly
complicated.  A throttling approach is probably less optimal but simpler to
get working as a temporary measure.

 -George

--0016e6d64463ab8a3204cdf9b6b5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Wed, Nov 7, 2012 at 3:10 PM, Dan Magenheimer <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:dan.magenheimer@oracle.com" target=3D"_blank">dan.magenheimer@=
oracle.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=
=3D"gmail_quote">

<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex">&gt; From an idealistic p=
oint of view, it might be quite nice to have several<br><div>
&gt; live migrate mechanisms, so the user can choose whether they value<br>
&gt; minimum downtime, minimum network utilisation, or maximum safety.<br>
<br>
</div>Agreed. =A0IIRC, when post-copy was suggested for Xen years ago,<br>
Ian Pratt was against it, though I don&#39;t recall why, so Michael<br>
Hines work was never pursued (outside of academia). =A0Probably<br>
worth asking IanP before investing too much time into it.<br></blockquote><=
br></div><br>Was he against a hybrid approach, where you &quot;push&quot; t=
hings first, and then &quot;pull&quot; things later?=A0 Or just against a p=
ure &quot;pull&quot; approach?=A0 I&#39;m pretty sure a pure &quot;pull&quo=
t; approach would result in lower performance during the migration.<br>

<br>Just tossing another idea out there: What about throttling the VM if it=
&#39;s dirtying too many pages?=A0 You can use the &quot;cap&quot; feature =
of the credit1 scheduler to reduce the amount of cpu time a given VM gets, =
even if there is free cpu time available.=A0 You could play around with doi=
ng N iterations, and then cranking down the cap on each iteration after tha=
t; then the application wouldn&#39;t have a several-second pause, it would =
just be &quot;running slowly&quot; for some period of time.<br>

<br>Overall doing a hybrid &quot;send dirty pages for a while, then move an=
d pull the rest in&quot; seems like the best approach in the long-run, but =
it&#39;s fairly complicated.=A0 A throttling approach is probably less opti=
mal but simpler to get working as a temporary measure.<br>

<br>=A0-George<br></div>

--0016e6d64463ab8a3204cdf9b6b5--


--===============6528999157642038205==
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.xen.org
http://lists.xen.org/xen-devel

--===============6528999157642038205==--


From xen-devel-bounces@lists.xen.org Thu Nov 08 11:46:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 11:46:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWQYJ-0005jY-Cy; Thu, 08 Nov 2012 11:45:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>) id 1TWQYI-0005jT-8f
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 11:45:42 +0000
Received: from [85.158.143.99:14667] by server-1.bemta-4.messagelabs.com id
	39/F5-27934-56B9B905; Thu, 08 Nov 2012 11:45:41 +0000
X-Env-Sender: ijc@hellion.org.uk
X-Msg-Ref: server-11.tower-216.messagelabs.com!1352375139!21601697!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19874 invoked from network); 8 Nov 2012 11:45:40 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-11.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Nov 2012 11:45:40 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1TWQYF-00050C-9S; Thu, 08 Nov 2012 11:45:39 +0000
Received: from yog-sothoth.hellion.org.uk ([192.168.1.1] helo=[127.0.0.1])
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1TWQY8-0005Wq-IA; Thu, 08 Nov 2012 11:45:38 +0000
Message-ID: <1352375011.12977.95.camel@hastur.hellion.org.uk>
From: Ian Campbell <ijc@hellion.org.uk>
To: Keir Fraser <keir@xen.org>
Date: Thu, 08 Nov 2012 12:43:31 +0100
In-Reply-To: <CCC04D8E.51A0E%keir@xen.org>
References: <CCC04D8E.51A0E%keir@xen.org>
X-Mailer: Evolution 3.4.3-1 
Mime-Version: 1.0
X-SA-Exim-Connect-IP: 192.168.1.1
X-SA-Exim-Mail-From: ijc@hellion.org.uk
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: "Philippe.Simonet@swisscom.com" <Philippe.Simonet@swisscom.com>,
	"599161@bugs.debian.org" <599161@bugs.debian.org>,
	"mrsanna1@gmail.com" <mrsanna1@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-07 at 17:40 +0000, Keir Fraser wrote:
> On 07/11/2012 13:22, "Ian Campbell" <ijc@hellion.org.uk> wrote:
> 
> >>> (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
> >>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
> >>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
> >>> tsc_stamp=e3839fcb0273
> >> 
> >> (below is the complete xm dmesg output)
> >> 
> >> did that help you ? do you need more info ?
> > 
> > I'll leave this to Keir (who wrote the debugging patch) to answer but it
> > looks to me like it should be useful!
> 
> I'm scratching my head. plt_wrap is earlier than plt_now, which should be
> impossible.

impossible due to guarantees made by the h/w or by construction in Xen.
There appears to be a certain amount of hardware-specificness to the
issue -- so I'm wondering if maybe there are some platforms whose tsc is
not as monotonically increasing as it needs to be...

>  plt_stamp64 oddly has low 32 bits identical to new_stamp. That
> seems very very improbable!

Does this code run on all cpus or just one? Is it always the same one?

> I wonder whether the overflow handling should just be removed, or made
> conditional on a command-line parameter, or on the 32-bit platform counter
> being at least somewhat likely to overflow before a softirq occurs -- it
> seems lots of systems are using 14MHz HPET, and that gives us a couple of
> minutes for the plt_overflow softirq to do its work before overflow occurs.
> I think we would notice that outage in other ways. :)
> 
>  -- Keir
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 11:46:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 11:46:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWQYJ-0005jY-Cy; Thu, 08 Nov 2012 11:45:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>) id 1TWQYI-0005jT-8f
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 11:45:42 +0000
Received: from [85.158.143.99:14667] by server-1.bemta-4.messagelabs.com id
	39/F5-27934-56B9B905; Thu, 08 Nov 2012 11:45:41 +0000
X-Env-Sender: ijc@hellion.org.uk
X-Msg-Ref: server-11.tower-216.messagelabs.com!1352375139!21601697!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19874 invoked from network); 8 Nov 2012 11:45:40 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-11.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Nov 2012 11:45:40 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1TWQYF-00050C-9S; Thu, 08 Nov 2012 11:45:39 +0000
Received: from yog-sothoth.hellion.org.uk ([192.168.1.1] helo=[127.0.0.1])
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1TWQY8-0005Wq-IA; Thu, 08 Nov 2012 11:45:38 +0000
Message-ID: <1352375011.12977.95.camel@hastur.hellion.org.uk>
From: Ian Campbell <ijc@hellion.org.uk>
To: Keir Fraser <keir@xen.org>
Date: Thu, 08 Nov 2012 12:43:31 +0100
In-Reply-To: <CCC04D8E.51A0E%keir@xen.org>
References: <CCC04D8E.51A0E%keir@xen.org>
X-Mailer: Evolution 3.4.3-1 
Mime-Version: 1.0
X-SA-Exim-Connect-IP: 192.168.1.1
X-SA-Exim-Mail-From: ijc@hellion.org.uk
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: "Philippe.Simonet@swisscom.com" <Philippe.Simonet@swisscom.com>,
	"599161@bugs.debian.org" <599161@bugs.debian.org>,
	"mrsanna1@gmail.com" <mrsanna1@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-07 at 17:40 +0000, Keir Fraser wrote:
> On 07/11/2012 13:22, "Ian Campbell" <ijc@hellion.org.uk> wrote:
> 
> >>> (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
> >>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
> >>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
> >>> tsc_stamp=e3839fcb0273
> >> 
> >> (below is the complete xm dmesg output)
> >> 
> >> did that help you ? do you need more info ?
> > 
> > I'll leave this to Keir (who wrote the debugging patch) to answer but it
> > looks to me like it should be useful!
> 
> I'm scratching my head. plt_wrap is earlier than plt_now, which should be
> impossible.

impossible due to guarantees made by the h/w or by construction in Xen.
There appears to be a certain amount of hardware-specificness to the
issue -- so I'm wondering if maybe there are some platforms whose tsc is
not as monotonically increasing as it needs to be...

>  plt_stamp64 oddly has low 32 bits identical to new_stamp. That
> seems very very improbable!

Does this code run on all cpus or just one? Is it always the same one?

> I wonder whether the overflow handling should just be removed, or made
> conditional on a command-line parameter, or on the 32-bit platform counter
> being at least somewhat likely to overflow before a softirq occurs -- it
> seems lots of systems are using 14MHz HPET, and that gives us a couple of
> minutes for the plt_overflow softirq to do its work before overflow occurs.
> I think we would notice that outage in other ways. :)
> 
>  -- Keir
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 11:50:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 11:50:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWQcQ-0005qk-AG; Thu, 08 Nov 2012 11:49:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWQcO-0005qa-Da
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 11:49:56 +0000
Received: from [85.158.143.35:13746] by server-2.bemta-4.messagelabs.com id
	A3/E2-28922-36C9B905; Thu, 08 Nov 2012 11:49:55 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1352375297!16965789!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8849 invoked from network); 8 Nov 2012 11:48:18 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-21.messagelabs.com with SMTP;
	8 Nov 2012 11:48:18 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 09:47:30 +0000
Message-Id: <509B8DC102000078000A72BA@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 09:47:29 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir@xen.org>
References: <509B813B02000078000A7279@nat28.tlf.novell.com>
	<CCC127FE.51B0C%keir@xen.org>
In-Reply-To: <CCC127FE.51B0C%keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 08.11.12 at 10:12, Keir Fraser <keir@xen.org> wrote:
> On 08/11/2012 08:54, "Jan Beulich" <JBeulich@suse.com> wrote:
>> That may have mattered when ioctl-s were run with the big kernel
>> lock held, but even 2.6.18 didn't do that anymore (using the
>> .unlocked_ioctl field of struct file_operations), which means
>> that even softirqs will get serviced in Dom0 since the preempted
>> hypercall gets restarted via exiting to the guest (i.e. events get
>> delivered). Scheduling is what indeed wouldn't happen, but if
>> allocation latency can be brought down, 8M might turn out pretty
>> small a chunk size.
> 
> Ah, then I am out of date on how Linux services softirqs and preemption? Can
> softirqs/preemption occur any time, even in kernel mode, so long as no locks
> are held?
> 
> I thought softirq-type work only happened during event servicing, only if
> the event servicing had interrupted user context (ie, would not happen if
> started from within kernel mode). So the restart of the hypercall trap
> instruction would be an opportunity to service hardirqs, but not softirqs or
> scheduler...

No, irq_exit() can invoke softirqs, provided this isn't a nested IRQ
(soft as well as hard) or softirqs weren't disabled in the interrupted
context.

The only thing that indeed is - on non-preemptible kernels - done
only on exit to user mode is the eventual entering of the scheduler.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 11:50:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 11:50:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWQcQ-0005qk-AG; Thu, 08 Nov 2012 11:49:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWQcO-0005qa-Da
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 11:49:56 +0000
Received: from [85.158.143.35:13746] by server-2.bemta-4.messagelabs.com id
	A3/E2-28922-36C9B905; Thu, 08 Nov 2012 11:49:55 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1352375297!16965789!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8849 invoked from network); 8 Nov 2012 11:48:18 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-21.messagelabs.com with SMTP;
	8 Nov 2012 11:48:18 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 09:47:30 +0000
Message-Id: <509B8DC102000078000A72BA@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 09:47:29 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir@xen.org>
References: <509B813B02000078000A7279@nat28.tlf.novell.com>
	<CCC127FE.51B0C%keir@xen.org>
In-Reply-To: <CCC127FE.51B0C%keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 08.11.12 at 10:12, Keir Fraser <keir@xen.org> wrote:
> On 08/11/2012 08:54, "Jan Beulich" <JBeulich@suse.com> wrote:
>> That may have mattered when ioctl-s were run with the big kernel
>> lock held, but even 2.6.18 didn't do that anymore (using the
>> .unlocked_ioctl field of struct file_operations), which means
>> that even softirqs will get serviced in Dom0 since the preempted
>> hypercall gets restarted via exiting to the guest (i.e. events get
>> delivered). Scheduling is what indeed wouldn't happen, but if
>> allocation latency can be brought down, 8M might turn out pretty
>> small a chunk size.
> 
> Ah, then I am out of date on how Linux services softirqs and preemption? Can
> softirqs/preemption occur any time, even in kernel mode, so long as no locks
> are held?
> 
> I thought softirq-type work only happened during event servicing, only if
> the event servicing had interrupted user context (ie, would not happen if
> started from within kernel mode). So the restart of the hypercall trap
> instruction would be an opportunity to service hardirqs, but not softirqs or
> scheduler...

No, irq_exit() can invoke softirqs, provided this isn't a nested IRQ
(soft as well as hard) or softirqs weren't disabled in the interrupted
context.

The only thing that indeed is - on non-preemptible kernels - done
only on exit to user mode is the eventual entering of the scheduler.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 12:43:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 12:43:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWRRo-0006JC-FZ; Thu, 08 Nov 2012 12:43:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TWRRm-0006J7-Vw
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 12:43:03 +0000
Received: from [85.158.143.35:21611] by server-2.bemta-4.messagelabs.com id
	F2/D7-28922-6D8AB905; Thu, 08 Nov 2012 12:43:02 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1352378579!16974279!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4007 invoked from network); 8 Nov 2012 12:43:00 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 12:43:00 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TWRRa-000KUa-Bq; Thu, 08 Nov 2012 12:42:50 +0000
Date: Thu, 8 Nov 2012 12:42:50 +0000
From: Tim Deegan <tim@xen.org>
To: Dario Faggioli <dario.faggioli@citrix.com>
Message-ID: <20121108124250.GE76638@ocelot.phlegethon.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<1352203585.505.5.camel@Solace>
	<509915CD02000078000A6ABF@nat28.tlf.novell.com>
	<20121106135842.GB45690@ocelot.phlegethon.org>
	<50992A2302000078000A6B78@nat28.tlf.novell.com>
	<1352212160.2155.18.camel@Solace>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352212160.2155.18.camel@Solace>
User-Agent: Mutt/1.4.2.1i
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"wei.huang2@amd.com" <wei.huang2@amd.com>,
	xen-devel <xen-devel@lists.xen.org>, Jan Beulich <JBeulich@suse.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	"xiantao.zhang@intel.com" <xiantao.zhang@intel.com>
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
	faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 15:29 +0100 on 06 Nov (1352215760), Dario Faggioli wrote:
> On Tue, 2012-11-06 at 14:17 +0000, Jan Beulich wrote:
> > > Indeed.  (Intel) IOMMU interrupts are suppressed until the softirq
> > > handler acknowledges the error, but if the softirq handler doesn't
> > > disable the device, it will take another IOMMU interrupt immediately.
> > > I thought the AMD side behaved eth same but clearly not -- I'll try to
> > > take a look at that later in the week.
> > 
> > I don't think AMD's behaves much different, it's just that for the
> > PPR case nothing is being done in that regard (and it's unclear
> > whether or under what circumstances a high rate of these could
> > occur).
> > 
> Indeed. I just double checked the code and yes, both faults and PPRs are
> handled that way, and new interrupts are disabled until the tasklet
> handles the request and re-enables them.
> 
> The difference, as Jan is saying, is there is no PPR equivalent of
> disabling bus mastering that can ensure livelock safeness when it comes
> to them.

Right, I see.  We could always disable the card entirely. 

Tim.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 12:43:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 12:43:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWRRo-0006JC-FZ; Thu, 08 Nov 2012 12:43:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TWRRm-0006J7-Vw
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 12:43:03 +0000
Received: from [85.158.143.35:21611] by server-2.bemta-4.messagelabs.com id
	F2/D7-28922-6D8AB905; Thu, 08 Nov 2012 12:43:02 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1352378579!16974279!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4007 invoked from network); 8 Nov 2012 12:43:00 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 12:43:00 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TWRRa-000KUa-Bq; Thu, 08 Nov 2012 12:42:50 +0000
Date: Thu, 8 Nov 2012 12:42:50 +0000
From: Tim Deegan <tim@xen.org>
To: Dario Faggioli <dario.faggioli@citrix.com>
Message-ID: <20121108124250.GE76638@ocelot.phlegethon.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<1352203585.505.5.camel@Solace>
	<509915CD02000078000A6ABF@nat28.tlf.novell.com>
	<20121106135842.GB45690@ocelot.phlegethon.org>
	<50992A2302000078000A6B78@nat28.tlf.novell.com>
	<1352212160.2155.18.camel@Solace>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352212160.2155.18.camel@Solace>
User-Agent: Mutt/1.4.2.1i
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"wei.huang2@amd.com" <wei.huang2@amd.com>,
	xen-devel <xen-devel@lists.xen.org>, Jan Beulich <JBeulich@suse.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	"xiantao.zhang@intel.com" <xiantao.zhang@intel.com>
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
	faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 15:29 +0100 on 06 Nov (1352215760), Dario Faggioli wrote:
> On Tue, 2012-11-06 at 14:17 +0000, Jan Beulich wrote:
> > > Indeed.  (Intel) IOMMU interrupts are suppressed until the softirq
> > > handler acknowledges the error, but if the softirq handler doesn't
> > > disable the device, it will take another IOMMU interrupt immediately.
> > > I thought the AMD side behaved eth same but clearly not -- I'll try to
> > > take a look at that later in the week.
> > 
> > I don't think AMD's behaves much different, it's just that for the
> > PPR case nothing is being done in that regard (and it's unclear
> > whether or under what circumstances a high rate of these could
> > occur).
> > 
> Indeed. I just double checked the code and yes, both faults and PPRs are
> handled that way, and new interrupts are disabled until the tasklet
> handles the request and re-enables them.
> 
> The difference, as Jan is saying, is there is no PPR equivalent of
> disabling bus mastering that can ensure livelock safeness when it comes
> to them.

Right, I see.  We could always disable the card entirely. 

Tim.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 12:47:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 12:47:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWRVJ-0006Wl-RB; Thu, 08 Nov 2012 12:46:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TWRVH-0006WS-Kb
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 12:46:40 +0000
Received: from [85.158.137.99:58305] by server-7.bemta-3.messagelabs.com id
	A2/4C-01713-EA9AB905; Thu, 08 Nov 2012 12:46:38 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1352378797!13473080!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31634 invoked from network); 8 Nov 2012 12:46:37 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-7.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 12:46:37 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TWRVB-000KVa-NN; Thu, 08 Nov 2012 12:46:33 +0000
Date: Thu, 8 Nov 2012 12:46:33 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121108124633.GF76638@ocelot.phlegethon.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<509A94F002000078000A702A@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509A94F002000078000A702A@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com,
	xen-devel <xen-devel@lists.xen.org>,
	Dario Faggioli <raistlin@linux.it>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH,
	v2] IOMMU: don't immediately disable bus mastering on faults
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:05 +0000 on 07 Nov (1352304352), Jan Beulich wrote:
> Instead, give the owning domain at least a small opportunity of fixing
> things up, and allow for rare faults to not bring down the device at
> all. The amount of faults tolerated within a given time period (all
> numbers are made up with no specific rationale) is higher for Dom0 than
> for DomU-s.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Looks good to me, though I don't think dom0 should have any special
treatment here.  I'd be inclined to set the threshold to 10 for
everyone. 

Tim.

> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -566,7 +566,7 @@ static hw_irq_controller iommu_maskable_
>  
>  static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
>  {
> -    u16 domain_id, device_id, bdf, cword, flags;
> +    u16 domain_id, device_id, bdf, flags;
>      u32 code;
>      u64 *addr;
>      int count = 0;
> @@ -620,18 +620,10 @@ static void parse_event_log_entry(struct
>                 "fault address = %#"PRIx64", flags = %#x\n",
>                 event_str[code-1], domain_id, device_id, *addr, flags);
>  
> -        /* Tell the device to stop DMAing; we can't rely on the guest to
> -         * control it for us. */
>          for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ )
>              if ( get_dma_requestor_id(iommu->seg, bdf) == device_id )
> -            {
> -                cword = pci_conf_read16(iommu->seg, PCI_BUS(bdf),
> -                                        PCI_SLOT(bdf), PCI_FUNC(bdf),
> -                                        PCI_COMMAND);
> -                pci_conf_write16(iommu->seg, PCI_BUS(bdf), PCI_SLOT(bdf),
> -                                 PCI_FUNC(bdf), PCI_COMMAND, 
> -                                 cword & ~PCI_COMMAND_MASTER);
> -            }
> +                pci_check_disable_device(iommu->seg, PCI_BUS(bdf),
> +                                         PCI_DEVFN2(bdf));
>      }
>      else
>      {
> --- a/xen/drivers/passthrough/iommu.c
> +++ b/xen/drivers/passthrough/iommu.c
> @@ -215,6 +215,7 @@ static int device_assigned(u16 seg, u8 b
>  static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
>  {
>      struct hvm_iommu *hd = domain_hvm_iommu(d);
> +    struct pci_dev *pdev;
>      int rc = 0;
>  
>      if ( !iommu_enabled || !hd->platform_ops )
> @@ -228,6 +229,13 @@ static int assign_device(struct domain *
>          return -EXDEV;
>  
>      spin_lock(&pcidevs_lock);
> +    pdev = pci_get_pdev(seg, bus, devfn);
> +    if ( pdev )
> +    {
> +        pdev->fault.threshold = PT_FAULT_THRESHOLD_UNPRIV;
> +        pdev->fault.count     = 0;
> +    }
> +
>      if ( (rc = hd->platform_ops->assign_device(d, seg, bus, devfn)) )
>          goto done;
>  
> @@ -239,6 +247,8 @@ static int assign_device(struct domain *
>          goto done;
>      }
>  done:
> +    if ( pdev && pdev->domain != d )
> +        pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>      spin_unlock(&pcidevs_lock);
>      return rc;
>  }
> @@ -379,6 +389,9 @@ int deassign_device(struct domain *d, u1
>          return ret;
>      }
>  
> +    pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
> +    pdev->fault.count     = 0;
> +
>      if ( !has_arch_pdevs(d) && need_iommu(d) )
>      {
>          d->need_iommu = 0;
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -137,6 +137,7 @@ static struct pci_dev *alloc_pdev(struct
>      *((u8*) &pdev->bus) = bus;
>      *((u8*) &pdev->devfn) = devfn;
>      pdev->domain = NULL;
> +    pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>      INIT_LIST_HEAD(&pdev->msi_list);
>      list_add(&pdev->alldevs_list, &pseg->alldevs_list);
>      spin_lock_init(&pdev->msix_table_lock);
> @@ -672,6 +673,36 @@ int __init pci_device_detect(u16 seg, u8
>      return 1;
>  }
>  
> +void pci_check_disable_device(u16 seg, u8 bus, u8 devfn)
> +{
> +    struct pci_dev *pdev;
> +    s_time_t now = NOW();
> +    u16 cword;
> +
> +    spin_lock(&pcidevs_lock);
> +    pdev = pci_get_pdev(seg, bus, devfn);
> +    if ( pdev )
> +    {
> +        if ( now < pdev->fault.time ||
> +             now - pdev->fault.time > MILLISECS(10) )
> +            pdev->fault.count >>= 1;
> +        pdev->fault.time = now;
> +        if ( ++pdev->fault.count < pdev->fault.threshold )
> +            pdev = NULL;
> +    }
> +    spin_unlock(&pcidevs_lock);
> +
> +    if ( !pdev )
> +        return;
> +
> +    /* Tell the device to stop DMAing; we can't rely on the guest to
> +     * control it for us. */
> +    cword = pci_conf_read16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
> +                            PCI_COMMAND);
> +    pci_conf_write16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
> +                     PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
> +}
> +
>  /*
>   * scan pci devices to add all existed PCI devices to alldevs_list,
>   * and setup pci hierarchy in array bus2bridge.
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -917,7 +917,7 @@ static void __do_iommu_page_fault(struct
>      while (1)
>      {
>          u8 fault_reason;
> -        u16 source_id, cword;
> +        u16 source_id;
>          u32 data;
>          u64 guest_addr;
>          int type;
> @@ -950,14 +950,8 @@ static void __do_iommu_page_fault(struct
>          iommu_page_fault_do_one(iommu, type, fault_reason,
>                                  source_id, guest_addr);
>  
> -        /* Tell the device to stop DMAing; we can't rely on the guest to
> -         * control it for us. */
> -        cword = pci_conf_read16(iommu->intel->drhd->segment,
> -                                PCI_BUS(source_id), PCI_SLOT(source_id),
> -                                PCI_FUNC(source_id), PCI_COMMAND);
> -        pci_conf_write16(iommu->intel->drhd->segment, PCI_BUS(source_id),
> -                         PCI_SLOT(source_id), PCI_FUNC(source_id),
> -                         PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
> +        pci_check_disable_device(iommu->intel->drhd->segment,
> +                                 PCI_BUS(source_id), PCI_DEVFN2(source_id));
>  
>          fault_index++;
>          if ( fault_index > cap_num_fault_regs(iommu->cap) )
> --- a/xen/include/xen/pci.h
> +++ b/xen/include/xen/pci.h
> @@ -64,6 +64,13 @@ struct pci_dev {
>      const u8 devfn;
>      struct pci_dev_info info;
>      struct arch_pci_dev arch;
> +    struct {
> +        s_time_t time;
> +        unsigned int threshold;
> +#define PT_FAULT_THRESHOLD_PRIV  10
> +#define PT_FAULT_THRESHOLD_UNPRIV 3
> +        unsigned int count;
> +    } fault;
>      u64 vf_rlen[6];
>  };
>  
> @@ -107,6 +114,7 @@ int pci_hide_device(int bus, int devfn);
>  struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);
>  struct pci_dev *pci_get_pdev_by_domain(
>      struct domain *, int seg, int bus, int devfn);
> +void pci_check_disable_device(u16 seg, u8 bus, u8 devfn);
>  
>  uint8_t pci_conf_read8(
>      unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
> 
> 

> IOMMU: don't immediately disable bus mastering on faults
> 
> Instead, give the owning domain at least a small opportunity of fixing
> things up, and allow for rare faults to not bring down the device at
> all. The amount of faults tolerated within a given time period (all
> numbers are made up with no specific rationale) is higher for Dom0 than
> for DomU-s.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -566,7 +566,7 @@ static hw_irq_controller iommu_maskable_
>  
>  static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
>  {
> -    u16 domain_id, device_id, bdf, cword, flags;
> +    u16 domain_id, device_id, bdf, flags;
>      u32 code;
>      u64 *addr;
>      int count = 0;
> @@ -620,18 +620,10 @@ static void parse_event_log_entry(struct
>                 "fault address = %#"PRIx64", flags = %#x\n",
>                 event_str[code-1], domain_id, device_id, *addr, flags);
>  
> -        /* Tell the device to stop DMAing; we can't rely on the guest to
> -         * control it for us. */
>          for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ )
>              if ( get_dma_requestor_id(iommu->seg, bdf) == device_id )
> -            {
> -                cword = pci_conf_read16(iommu->seg, PCI_BUS(bdf),
> -                                        PCI_SLOT(bdf), PCI_FUNC(bdf),
> -                                        PCI_COMMAND);
> -                pci_conf_write16(iommu->seg, PCI_BUS(bdf), PCI_SLOT(bdf),
> -                                 PCI_FUNC(bdf), PCI_COMMAND, 
> -                                 cword & ~PCI_COMMAND_MASTER);
> -            }
> +                pci_check_disable_device(iommu->seg, PCI_BUS(bdf),
> +                                         PCI_DEVFN2(bdf));
>      }
>      else
>      {
> --- a/xen/drivers/passthrough/iommu.c
> +++ b/xen/drivers/passthrough/iommu.c
> @@ -215,6 +215,7 @@ static int device_assigned(u16 seg, u8 b
>  static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
>  {
>      struct hvm_iommu *hd = domain_hvm_iommu(d);
> +    struct pci_dev *pdev;
>      int rc = 0;
>  
>      if ( !iommu_enabled || !hd->platform_ops )
> @@ -228,6 +229,13 @@ static int assign_device(struct domain *
>          return -EXDEV;
>  
>      spin_lock(&pcidevs_lock);
> +    pdev = pci_get_pdev(seg, bus, devfn);
> +    if ( pdev )
> +    {
> +        pdev->fault.threshold = PT_FAULT_THRESHOLD_UNPRIV;
> +        pdev->fault.count     = 0;
> +    }
> +
>      if ( (rc = hd->platform_ops->assign_device(d, seg, bus, devfn)) )
>          goto done;
>  
> @@ -239,6 +247,8 @@ static int assign_device(struct domain *
>          goto done;
>      }
>  done:
> +    if ( pdev && pdev->domain != d )
> +        pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>      spin_unlock(&pcidevs_lock);
>      return rc;
>  }
> @@ -379,6 +389,9 @@ int deassign_device(struct domain *d, u1
>          return ret;
>      }
>  
> +    pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
> +    pdev->fault.count     = 0;
> +
>      if ( !has_arch_pdevs(d) && need_iommu(d) )
>      {
>          d->need_iommu = 0;
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -137,6 +137,7 @@ static struct pci_dev *alloc_pdev(struct
>      *((u8*) &pdev->bus) = bus;
>      *((u8*) &pdev->devfn) = devfn;
>      pdev->domain = NULL;
> +    pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>      INIT_LIST_HEAD(&pdev->msi_list);
>      list_add(&pdev->alldevs_list, &pseg->alldevs_list);
>      spin_lock_init(&pdev->msix_table_lock);
> @@ -672,6 +673,36 @@ int __init pci_device_detect(u16 seg, u8
>      return 1;
>  }
>  
> +void pci_check_disable_device(u16 seg, u8 bus, u8 devfn)
> +{
> +    struct pci_dev *pdev;
> +    s_time_t now = NOW();
> +    u16 cword;
> +
> +    spin_lock(&pcidevs_lock);
> +    pdev = pci_get_pdev(seg, bus, devfn);
> +    if ( pdev )
> +    {
> +        if ( now < pdev->fault.time ||
> +             now - pdev->fault.time > MILLISECS(10) )
> +            pdev->fault.count >>= 1;
> +        pdev->fault.time = now;
> +        if ( ++pdev->fault.count < pdev->fault.threshold )
> +            pdev = NULL;
> +    }
> +    spin_unlock(&pcidevs_lock);
> +
> +    if ( !pdev )
> +        return;
> +
> +    /* Tell the device to stop DMAing; we can't rely on the guest to
> +     * control it for us. */
> +    cword = pci_conf_read16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
> +                            PCI_COMMAND);
> +    pci_conf_write16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
> +                     PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
> +}
> +
>  /*
>   * scan pci devices to add all existed PCI devices to alldevs_list,
>   * and setup pci hierarchy in array bus2bridge.
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -917,7 +917,7 @@ static void __do_iommu_page_fault(struct
>      while (1)
>      {
>          u8 fault_reason;
> -        u16 source_id, cword;
> +        u16 source_id;
>          u32 data;
>          u64 guest_addr;
>          int type;
> @@ -950,14 +950,8 @@ static void __do_iommu_page_fault(struct
>          iommu_page_fault_do_one(iommu, type, fault_reason,
>                                  source_id, guest_addr);
>  
> -        /* Tell the device to stop DMAing; we can't rely on the guest to
> -         * control it for us. */
> -        cword = pci_conf_read16(iommu->intel->drhd->segment,
> -                                PCI_BUS(source_id), PCI_SLOT(source_id),
> -                                PCI_FUNC(source_id), PCI_COMMAND);
> -        pci_conf_write16(iommu->intel->drhd->segment, PCI_BUS(source_id),
> -                         PCI_SLOT(source_id), PCI_FUNC(source_id),
> -                         PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
> +        pci_check_disable_device(iommu->intel->drhd->segment,
> +                                 PCI_BUS(source_id), PCI_DEVFN2(source_id));
>  
>          fault_index++;
>          if ( fault_index > cap_num_fault_regs(iommu->cap) )
> --- a/xen/include/xen/pci.h
> +++ b/xen/include/xen/pci.h
> @@ -64,6 +64,13 @@ struct pci_dev {
>      const u8 devfn;
>      struct pci_dev_info info;
>      struct arch_pci_dev arch;
> +    struct {
> +        s_time_t time;
> +        unsigned int threshold;
> +#define PT_FAULT_THRESHOLD_PRIV  10
> +#define PT_FAULT_THRESHOLD_UNPRIV 3
> +        unsigned int count;
> +    } fault;
>      u64 vf_rlen[6];
>  };
>  
> @@ -107,6 +114,7 @@ int pci_hide_device(int bus, int devfn);
>  struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);
>  struct pci_dev *pci_get_pdev_by_domain(
>      struct domain *, int seg, int bus, int devfn);
> +void pci_check_disable_device(u16 seg, u8 bus, u8 devfn);
>  
>  uint8_t pci_conf_read8(
>      unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 12:47:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 12:47:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWRVJ-0006Wl-RB; Thu, 08 Nov 2012 12:46:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TWRVH-0006WS-Kb
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 12:46:40 +0000
Received: from [85.158.137.99:58305] by server-7.bemta-3.messagelabs.com id
	A2/4C-01713-EA9AB905; Thu, 08 Nov 2012 12:46:38 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1352378797!13473080!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31634 invoked from network); 8 Nov 2012 12:46:37 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-7.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 12:46:37 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TWRVB-000KVa-NN; Thu, 08 Nov 2012 12:46:33 +0000
Date: Thu, 8 Nov 2012 12:46:33 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121108124633.GF76638@ocelot.phlegethon.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<509A94F002000078000A702A@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509A94F002000078000A702A@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com,
	xen-devel <xen-devel@lists.xen.org>,
	Dario Faggioli <raistlin@linux.it>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH,
	v2] IOMMU: don't immediately disable bus mastering on faults
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:05 +0000 on 07 Nov (1352304352), Jan Beulich wrote:
> Instead, give the owning domain at least a small opportunity of fixing
> things up, and allow for rare faults to not bring down the device at
> all. The amount of faults tolerated within a given time period (all
> numbers are made up with no specific rationale) is higher for Dom0 than
> for DomU-s.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Looks good to me, though I don't think dom0 should have any special
treatment here.  I'd be inclined to set the threshold to 10 for
everyone. 

Tim.

> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -566,7 +566,7 @@ static hw_irq_controller iommu_maskable_
>  
>  static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
>  {
> -    u16 domain_id, device_id, bdf, cword, flags;
> +    u16 domain_id, device_id, bdf, flags;
>      u32 code;
>      u64 *addr;
>      int count = 0;
> @@ -620,18 +620,10 @@ static void parse_event_log_entry(struct
>                 "fault address = %#"PRIx64", flags = %#x\n",
>                 event_str[code-1], domain_id, device_id, *addr, flags);
>  
> -        /* Tell the device to stop DMAing; we can't rely on the guest to
> -         * control it for us. */
>          for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ )
>              if ( get_dma_requestor_id(iommu->seg, bdf) == device_id )
> -            {
> -                cword = pci_conf_read16(iommu->seg, PCI_BUS(bdf),
> -                                        PCI_SLOT(bdf), PCI_FUNC(bdf),
> -                                        PCI_COMMAND);
> -                pci_conf_write16(iommu->seg, PCI_BUS(bdf), PCI_SLOT(bdf),
> -                                 PCI_FUNC(bdf), PCI_COMMAND, 
> -                                 cword & ~PCI_COMMAND_MASTER);
> -            }
> +                pci_check_disable_device(iommu->seg, PCI_BUS(bdf),
> +                                         PCI_DEVFN2(bdf));
>      }
>      else
>      {
> --- a/xen/drivers/passthrough/iommu.c
> +++ b/xen/drivers/passthrough/iommu.c
> @@ -215,6 +215,7 @@ static int device_assigned(u16 seg, u8 b
>  static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
>  {
>      struct hvm_iommu *hd = domain_hvm_iommu(d);
> +    struct pci_dev *pdev;
>      int rc = 0;
>  
>      if ( !iommu_enabled || !hd->platform_ops )
> @@ -228,6 +229,13 @@ static int assign_device(struct domain *
>          return -EXDEV;
>  
>      spin_lock(&pcidevs_lock);
> +    pdev = pci_get_pdev(seg, bus, devfn);
> +    if ( pdev )
> +    {
> +        pdev->fault.threshold = PT_FAULT_THRESHOLD_UNPRIV;
> +        pdev->fault.count     = 0;
> +    }
> +
>      if ( (rc = hd->platform_ops->assign_device(d, seg, bus, devfn)) )
>          goto done;
>  
> @@ -239,6 +247,8 @@ static int assign_device(struct domain *
>          goto done;
>      }
>  done:
> +    if ( pdev && pdev->domain != d )
> +        pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>      spin_unlock(&pcidevs_lock);
>      return rc;
>  }
> @@ -379,6 +389,9 @@ int deassign_device(struct domain *d, u1
>          return ret;
>      }
>  
> +    pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
> +    pdev->fault.count     = 0;
> +
>      if ( !has_arch_pdevs(d) && need_iommu(d) )
>      {
>          d->need_iommu = 0;
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -137,6 +137,7 @@ static struct pci_dev *alloc_pdev(struct
>      *((u8*) &pdev->bus) = bus;
>      *((u8*) &pdev->devfn) = devfn;
>      pdev->domain = NULL;
> +    pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>      INIT_LIST_HEAD(&pdev->msi_list);
>      list_add(&pdev->alldevs_list, &pseg->alldevs_list);
>      spin_lock_init(&pdev->msix_table_lock);
> @@ -672,6 +673,36 @@ int __init pci_device_detect(u16 seg, u8
>      return 1;
>  }
>  
> +void pci_check_disable_device(u16 seg, u8 bus, u8 devfn)
> +{
> +    struct pci_dev *pdev;
> +    s_time_t now = NOW();
> +    u16 cword;
> +
> +    spin_lock(&pcidevs_lock);
> +    pdev = pci_get_pdev(seg, bus, devfn);
> +    if ( pdev )
> +    {
> +        if ( now < pdev->fault.time ||
> +             now - pdev->fault.time > MILLISECS(10) )
> +            pdev->fault.count >>= 1;
> +        pdev->fault.time = now;
> +        if ( ++pdev->fault.count < pdev->fault.threshold )
> +            pdev = NULL;
> +    }
> +    spin_unlock(&pcidevs_lock);
> +
> +    if ( !pdev )
> +        return;
> +
> +    /* Tell the device to stop DMAing; we can't rely on the guest to
> +     * control it for us. */
> +    cword = pci_conf_read16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
> +                            PCI_COMMAND);
> +    pci_conf_write16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
> +                     PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
> +}
> +
>  /*
>   * scan pci devices to add all existed PCI devices to alldevs_list,
>   * and setup pci hierarchy in array bus2bridge.
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -917,7 +917,7 @@ static void __do_iommu_page_fault(struct
>      while (1)
>      {
>          u8 fault_reason;
> -        u16 source_id, cword;
> +        u16 source_id;
>          u32 data;
>          u64 guest_addr;
>          int type;
> @@ -950,14 +950,8 @@ static void __do_iommu_page_fault(struct
>          iommu_page_fault_do_one(iommu, type, fault_reason,
>                                  source_id, guest_addr);
>  
> -        /* Tell the device to stop DMAing; we can't rely on the guest to
> -         * control it for us. */
> -        cword = pci_conf_read16(iommu->intel->drhd->segment,
> -                                PCI_BUS(source_id), PCI_SLOT(source_id),
> -                                PCI_FUNC(source_id), PCI_COMMAND);
> -        pci_conf_write16(iommu->intel->drhd->segment, PCI_BUS(source_id),
> -                         PCI_SLOT(source_id), PCI_FUNC(source_id),
> -                         PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
> +        pci_check_disable_device(iommu->intel->drhd->segment,
> +                                 PCI_BUS(source_id), PCI_DEVFN2(source_id));
>  
>          fault_index++;
>          if ( fault_index > cap_num_fault_regs(iommu->cap) )
> --- a/xen/include/xen/pci.h
> +++ b/xen/include/xen/pci.h
> @@ -64,6 +64,13 @@ struct pci_dev {
>      const u8 devfn;
>      struct pci_dev_info info;
>      struct arch_pci_dev arch;
> +    struct {
> +        s_time_t time;
> +        unsigned int threshold;
> +#define PT_FAULT_THRESHOLD_PRIV  10
> +#define PT_FAULT_THRESHOLD_UNPRIV 3
> +        unsigned int count;
> +    } fault;
>      u64 vf_rlen[6];
>  };
>  
> @@ -107,6 +114,7 @@ int pci_hide_device(int bus, int devfn);
>  struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);
>  struct pci_dev *pci_get_pdev_by_domain(
>      struct domain *, int seg, int bus, int devfn);
> +void pci_check_disable_device(u16 seg, u8 bus, u8 devfn);
>  
>  uint8_t pci_conf_read8(
>      unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
> 
> 

> IOMMU: don't immediately disable bus mastering on faults
> 
> Instead, give the owning domain at least a small opportunity of fixing
> things up, and allow for rare faults to not bring down the device at
> all. The amount of faults tolerated within a given time period (all
> numbers are made up with no specific rationale) is higher for Dom0 than
> for DomU-s.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -566,7 +566,7 @@ static hw_irq_controller iommu_maskable_
>  
>  static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
>  {
> -    u16 domain_id, device_id, bdf, cword, flags;
> +    u16 domain_id, device_id, bdf, flags;
>      u32 code;
>      u64 *addr;
>      int count = 0;
> @@ -620,18 +620,10 @@ static void parse_event_log_entry(struct
>                 "fault address = %#"PRIx64", flags = %#x\n",
>                 event_str[code-1], domain_id, device_id, *addr, flags);
>  
> -        /* Tell the device to stop DMAing; we can't rely on the guest to
> -         * control it for us. */
>          for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ )
>              if ( get_dma_requestor_id(iommu->seg, bdf) == device_id )
> -            {
> -                cword = pci_conf_read16(iommu->seg, PCI_BUS(bdf),
> -                                        PCI_SLOT(bdf), PCI_FUNC(bdf),
> -                                        PCI_COMMAND);
> -                pci_conf_write16(iommu->seg, PCI_BUS(bdf), PCI_SLOT(bdf),
> -                                 PCI_FUNC(bdf), PCI_COMMAND, 
> -                                 cword & ~PCI_COMMAND_MASTER);
> -            }
> +                pci_check_disable_device(iommu->seg, PCI_BUS(bdf),
> +                                         PCI_DEVFN2(bdf));
>      }
>      else
>      {
> --- a/xen/drivers/passthrough/iommu.c
> +++ b/xen/drivers/passthrough/iommu.c
> @@ -215,6 +215,7 @@ static int device_assigned(u16 seg, u8 b
>  static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
>  {
>      struct hvm_iommu *hd = domain_hvm_iommu(d);
> +    struct pci_dev *pdev;
>      int rc = 0;
>  
>      if ( !iommu_enabled || !hd->platform_ops )
> @@ -228,6 +229,13 @@ static int assign_device(struct domain *
>          return -EXDEV;
>  
>      spin_lock(&pcidevs_lock);
> +    pdev = pci_get_pdev(seg, bus, devfn);
> +    if ( pdev )
> +    {
> +        pdev->fault.threshold = PT_FAULT_THRESHOLD_UNPRIV;
> +        pdev->fault.count     = 0;
> +    }
> +
>      if ( (rc = hd->platform_ops->assign_device(d, seg, bus, devfn)) )
>          goto done;
>  
> @@ -239,6 +247,8 @@ static int assign_device(struct domain *
>          goto done;
>      }
>  done:
> +    if ( pdev && pdev->domain != d )
> +        pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>      spin_unlock(&pcidevs_lock);
>      return rc;
>  }
> @@ -379,6 +389,9 @@ int deassign_device(struct domain *d, u1
>          return ret;
>      }
>  
> +    pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
> +    pdev->fault.count     = 0;
> +
>      if ( !has_arch_pdevs(d) && need_iommu(d) )
>      {
>          d->need_iommu = 0;
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -137,6 +137,7 @@ static struct pci_dev *alloc_pdev(struct
>      *((u8*) &pdev->bus) = bus;
>      *((u8*) &pdev->devfn) = devfn;
>      pdev->domain = NULL;
> +    pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>      INIT_LIST_HEAD(&pdev->msi_list);
>      list_add(&pdev->alldevs_list, &pseg->alldevs_list);
>      spin_lock_init(&pdev->msix_table_lock);
> @@ -672,6 +673,36 @@ int __init pci_device_detect(u16 seg, u8
>      return 1;
>  }
>  
> +void pci_check_disable_device(u16 seg, u8 bus, u8 devfn)
> +{
> +    struct pci_dev *pdev;
> +    s_time_t now = NOW();
> +    u16 cword;
> +
> +    spin_lock(&pcidevs_lock);
> +    pdev = pci_get_pdev(seg, bus, devfn);
> +    if ( pdev )
> +    {
> +        if ( now < pdev->fault.time ||
> +             now - pdev->fault.time > MILLISECS(10) )
> +            pdev->fault.count >>= 1;
> +        pdev->fault.time = now;
> +        if ( ++pdev->fault.count < pdev->fault.threshold )
> +            pdev = NULL;
> +    }
> +    spin_unlock(&pcidevs_lock);
> +
> +    if ( !pdev )
> +        return;
> +
> +    /* Tell the device to stop DMAing; we can't rely on the guest to
> +     * control it for us. */
> +    cword = pci_conf_read16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
> +                            PCI_COMMAND);
> +    pci_conf_write16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
> +                     PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
> +}
> +
>  /*
>   * scan pci devices to add all existed PCI devices to alldevs_list,
>   * and setup pci hierarchy in array bus2bridge.
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -917,7 +917,7 @@ static void __do_iommu_page_fault(struct
>      while (1)
>      {
>          u8 fault_reason;
> -        u16 source_id, cword;
> +        u16 source_id;
>          u32 data;
>          u64 guest_addr;
>          int type;
> @@ -950,14 +950,8 @@ static void __do_iommu_page_fault(struct
>          iommu_page_fault_do_one(iommu, type, fault_reason,
>                                  source_id, guest_addr);
>  
> -        /* Tell the device to stop DMAing; we can't rely on the guest to
> -         * control it for us. */
> -        cword = pci_conf_read16(iommu->intel->drhd->segment,
> -                                PCI_BUS(source_id), PCI_SLOT(source_id),
> -                                PCI_FUNC(source_id), PCI_COMMAND);
> -        pci_conf_write16(iommu->intel->drhd->segment, PCI_BUS(source_id),
> -                         PCI_SLOT(source_id), PCI_FUNC(source_id),
> -                         PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
> +        pci_check_disable_device(iommu->intel->drhd->segment,
> +                                 PCI_BUS(source_id), PCI_DEVFN2(source_id));
>  
>          fault_index++;
>          if ( fault_index > cap_num_fault_regs(iommu->cap) )
> --- a/xen/include/xen/pci.h
> +++ b/xen/include/xen/pci.h
> @@ -64,6 +64,13 @@ struct pci_dev {
>      const u8 devfn;
>      struct pci_dev_info info;
>      struct arch_pci_dev arch;
> +    struct {
> +        s_time_t time;
> +        unsigned int threshold;
> +#define PT_FAULT_THRESHOLD_PRIV  10
> +#define PT_FAULT_THRESHOLD_UNPRIV 3
> +        unsigned int count;
> +    } fault;
>      u64 vf_rlen[6];
>  };
>  
> @@ -107,6 +114,7 @@ int pci_hide_device(int bus, int devfn);
>  struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);
>  struct pci_dev *pci_get_pdev_by_domain(
>      struct domain *, int seg, int bus, int devfn);
> +void pci_check_disable_device(u16 seg, u8 bus, u8 devfn);
>  
>  uint8_t pci_conf_read8(
>      unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 12:54:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 12:54:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWRd1-0006u5-QI; Thu, 08 Nov 2012 12:54:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWRd0-0006u0-Hj
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 12:54:38 +0000
Received: from [85.158.137.99:40326] by server-16.bemta-3.messagelabs.com id
	D3/FE-07461-D8BAB905; Thu, 08 Nov 2012 12:54:37 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1352379263!18284693!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25838 invoked from network); 8 Nov 2012 12:54:23 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 12:54:23 -0000
Received: by mail-wg0-f51.google.com with SMTP id ed3so1248565wgb.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 04:54:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=9d6prnmHFr8DR6XfxlkIYrjEienDESGvECV+9FE8tJ8=;
	b=ouxYOlC40gtl5/T1FVaVXUnO0kLzcU2o1Ang2yW24da28Yb6zUN3zz12dV6PU3YNPW
	vVLd0so8WZMmUpuEJdEI/MRqCXU1J1Qx95tHcei+i0P0toNuB+xTKNLeiA7jTS/vttOf
	qD2MHCXy1chUDMeoEgvOJaylBUOe8t+w4OCvSNFMsuiVxTb28RGtdxKVmSdgVeVK99h0
	YrFy2kkW3ZYwHHAe8pdNDuOnq9+W9j1gyquGtzwglsRmu4TlkgBFY60bDaZq/zLcn8O3
	HTS2Cd8Kx/A/AWDEkKvMz10DZbGy2OSI6i90KIhCwcvXz51LPydCfFu6Sc9Y2spbD4dH
	bOBw==
Received: by 10.216.139.137 with SMTP id c9mr3210106wej.54.1352379262952;
	Thu, 08 Nov 2012 04:54:22 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id s12sm1217579wik.11.2012.11.08.04.54.20
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 04:54:22 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 12:54:17 +0000
From: Keir Fraser <keir@xen.org>
To: Ian Campbell <ijc@hellion.org.uk>
Message-ID: <CCC15BF9.51B87%keir@xen.org>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
	minutes" bug.
Thread-Index: Ac29sCllxNbWGQNZx0KyqMxwy0qRWg==
In-Reply-To: <1352375011.12977.95.camel@hastur.hellion.org.uk>
Mime-version: 1.0
Cc: "Philippe.Simonet@swisscom.com" <Philippe.Simonet@swisscom.com>,
	"599161@bugs.debian.org" <599161@bugs.debian.org>,
	"mrsanna1@gmail.com" <mrsanna1@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 11:43, "Ian Campbell" <ijc@hellion.org.uk> wrote:

>>> I'll leave this to Keir (who wrote the debugging patch) to answer but it
>>> looks to me like it should be useful!
>> 
>> I'm scratching my head. plt_wrap is earlier than plt_now, which should be
>> impossible.
> 
> impossible due to guarantees made by the h/w or by construction in Xen.

That's a question, right? By construction in Xen.

> There appears to be a certain amount of hardware-specificness to the
> issue -- so I'm wondering if maybe there are some platforms whose tsc is
> not as monotonically increasing as it needs to be...

plt_* timestamps are not derived from TSC at all.

>>  plt_stamp64 oddly has low 32 bits identical to new_stamp. That
>> seems very very improbable!
> 
> Does this code run on all cpus or just one? Is it always the same one?

Always cpu0.

 -- Keir
 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 12:54:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 12:54:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWRd1-0006u5-QI; Thu, 08 Nov 2012 12:54:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWRd0-0006u0-Hj
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 12:54:38 +0000
Received: from [85.158.137.99:40326] by server-16.bemta-3.messagelabs.com id
	D3/FE-07461-D8BAB905; Thu, 08 Nov 2012 12:54:37 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1352379263!18284693!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25838 invoked from network); 8 Nov 2012 12:54:23 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 12:54:23 -0000
Received: by mail-wg0-f51.google.com with SMTP id ed3so1248565wgb.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 04:54:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=9d6prnmHFr8DR6XfxlkIYrjEienDESGvECV+9FE8tJ8=;
	b=ouxYOlC40gtl5/T1FVaVXUnO0kLzcU2o1Ang2yW24da28Yb6zUN3zz12dV6PU3YNPW
	vVLd0so8WZMmUpuEJdEI/MRqCXU1J1Qx95tHcei+i0P0toNuB+xTKNLeiA7jTS/vttOf
	qD2MHCXy1chUDMeoEgvOJaylBUOe8t+w4OCvSNFMsuiVxTb28RGtdxKVmSdgVeVK99h0
	YrFy2kkW3ZYwHHAe8pdNDuOnq9+W9j1gyquGtzwglsRmu4TlkgBFY60bDaZq/zLcn8O3
	HTS2Cd8Kx/A/AWDEkKvMz10DZbGy2OSI6i90KIhCwcvXz51LPydCfFu6Sc9Y2spbD4dH
	bOBw==
Received: by 10.216.139.137 with SMTP id c9mr3210106wej.54.1352379262952;
	Thu, 08 Nov 2012 04:54:22 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id s12sm1217579wik.11.2012.11.08.04.54.20
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 04:54:22 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 12:54:17 +0000
From: Keir Fraser <keir@xen.org>
To: Ian Campbell <ijc@hellion.org.uk>
Message-ID: <CCC15BF9.51B87%keir@xen.org>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
	minutes" bug.
Thread-Index: Ac29sCllxNbWGQNZx0KyqMxwy0qRWg==
In-Reply-To: <1352375011.12977.95.camel@hastur.hellion.org.uk>
Mime-version: 1.0
Cc: "Philippe.Simonet@swisscom.com" <Philippe.Simonet@swisscom.com>,
	"599161@bugs.debian.org" <599161@bugs.debian.org>,
	"mrsanna1@gmail.com" <mrsanna1@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 11:43, "Ian Campbell" <ijc@hellion.org.uk> wrote:

>>> I'll leave this to Keir (who wrote the debugging patch) to answer but it
>>> looks to me like it should be useful!
>> 
>> I'm scratching my head. plt_wrap is earlier than plt_now, which should be
>> impossible.
> 
> impossible due to guarantees made by the h/w or by construction in Xen.

That's a question, right? By construction in Xen.

> There appears to be a certain amount of hardware-specificness to the
> issue -- so I'm wondering if maybe there are some platforms whose tsc is
> not as monotonically increasing as it needs to be...

plt_* timestamps are not derived from TSC at all.

>>  plt_stamp64 oddly has low 32 bits identical to new_stamp. That
>> seems very very improbable!
> 
> Does this code run on all cpus or just one? Is it always the same one?

Always cpu0.

 -- Keir
 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 13:25:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 13:25:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWS6p-0007Kq-E1; Thu, 08 Nov 2012 13:25:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TWS6n-0007Kl-UF
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 13:25:26 +0000
Received: from [85.158.139.211:53244] by server-4.bemta-5.messagelabs.com id
	6A/A6-15011-5C2BB905; Thu, 08 Nov 2012 13:25:25 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-10.tower-206.messagelabs.com!1352381123!19375982!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10089 invoked from network); 8 Nov 2012 13:25:24 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-10.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 13:25:24 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TWS6k-000Kc7-3X; Thu, 08 Nov 2012 13:25:22 +0000
Date: Thu, 8 Nov 2012 13:25:22 +0000
From: Tim Deegan <tim@xen.org>
To: Robert Phillips <robert.phillips@citrix.com>
Message-ID: <20121108132522.GG76638@ocelot.phlegethon.org>
References: <1350411302-5470-1-git-send-email-robert.phillips@citrix.com>
	<20121101142434.GC61948@ocelot.phlegethon.org>
	<048EAD622912254A9DEA24C1734613C18C876560B1@FTLPMAILBOX02.citrite.net>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <048EAD622912254A9DEA24C1734613C18C876560B1@FTLPMAILBOX02.citrite.net>
User-Agent: Mutt/1.4.2.1i
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
	in Xen.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi, 

Thanks for the update patch.

At 15:36 -0500 on 07 Nov (1352302577), Robert Phillips wrote:
> > More substantive comments:
> >  - I think the dirty_vram.c and dirty_vram.h files belong under mm/
> >    rather than under hvm/.  The ``#include "../mm/mm-locks.h"'' is
> >    an indicator that this is really MM code.
> 
> I have moved dirty_vram.c under mm/
> I have moved dirty_vram.h under include/asm-x86 .  In that location it
> is available to modules like hvm.c

Sure, that seems sgood. 

> > I'd be
> > inclined to just put all paddr_links in the linked list (and have an
> > array of pointers rather than an array of paddr_link_ts).  Is it worth
> > having the extra complexity here, and at the callers, to avoid a single
> > memory read?
> 
> Almost all frame buffer pages have a single mapping so the algorithm's
> common case is met by constructing pl_tab as an array of paddr_links.
> That is, the table's paddr_links will rarely point to a chain of
> extension paddr_links.  The code encapsulates the complexity in a
> single function.  Sorry it required so much staring.  Even if all
> paddr_links were stored in a linked list, the caller would have to
> walk that linked list, so would be just as complex.

OK.

> > > +        if (set)
> > > +        {
> > > +            /* Did we find sl1ma in either the main table or the linked list? */
> > > +            if (pl == NULL) /* no, so we'll need to alloc a link */
> > > +            {
> > > +                ASSERT(ppl != NULL);
> > > +                /* alloc link and append it to list */
> > > +                (*ppl) = pl = alloc_paddr_link(d);
> > > +                if (pl == NULL)
> > > +                    goto out;
> >
> > This needs to signal some sort of error.  Otherwise, if we can't add
> > this sl1e to the list we'll just silently fail to track it.
> 
> I don't know what sort of error we can signal.
> 
> The immediate symptom would be that areas of the monitor would not be
> refreshed.  But, since we're running out of memory, that might be the
> least of the quests's woes.  The updated patch actually makes the
> symptom more likely (though still very unlikely) by putting an
> arbitrary bound on the length of paddr_link chains.  It handles a
> rogue process, one that has an arbitrarily large number of mappings
> for frame buffer pages, by simply not recording the excessive
> mappings.  If that results in unrefreshed blocks on the monitor, so be
> it.

I think the correct behaviour would be to report these pages as dirty.
That way anything that relies on seeing all changes will behave
correctly, though less efficiently.

> > > +#endif
> > > +                free_paddr_link(d, ppl, pl);
> > > +                if ( --range->nr_mappings == 0 )
> > > +                {
> > > +                    dirty_vram_range_free(d, range);
> >
> > What's this for?  If the guest unmaps the framebuffer and remaps it (or
> > if the shadow PTs of the mappings are temporarily discarded) this will
> > stop us from tracking the new mappings until the toolstack asks for the
> > bitmap (and then it will be expensive to go and find the mappings).
> >
> 
> I don't see this happening.  If the guest unmaps the framebuffer, the
> shadow code lazily recovers the shadow pages, so tracking will
> continue until it decides a page is no longer a shadow page.  That is
> when this code is invoked.

If the guest unmaps the buffer by clearing the PTEs then when the PTE
changes are propagated into the shadows this will cause nr_mappings to
fall to zero here.  If we _don't_ free the range, then when the FB is
mapped again we'll spot the new PTEs as they're shadowed and DTRT.  If we
_do_ free the range we end up walking all shadows looking for the
mappings.

> It tears down the mappings to that page and if some range ends up
> with no mappings then the range is useless.  Vram ranges are generated
> willy-nilly as needed.  This is the only mechanism for cleaning them up.

Shouldn't there be some way for the tools to indicate that they're done
with a range?  I guess they can tear down the whole lot and then start
again with whatever ranges are still in use. 

> > Oughtn't we to return all 1s in the bitmap here?  If the range isn't
> > currently being tracked we should conservatively assume it's all dirty,
> > right?
> 
> The callers will should ensure that the range exists.  This is just a
> conservative test.

OK.

> Anyway, it begs the question of whether a new range should be
> considered all dirty or all clean.  Intuitively "all dirty" seems the
> right answer but in practice it works fine as written since the guest
> is busy updating the whole frame buffer.

What if the guest's not writing to the framebuffer at the moment, or
only to a part of it?  Shouldn't the tools see the existing content?

> > And, since you know you're in HAP mode, not in log-dirty mode, and
> > already have the paging lock, you can just set
> > d->arch.paging.mode |= PG_log_dirty there rather than jumping through
> > the paging_log_dirty_enable() path and messing with locks.
> 
> No, paging_log_dirty_enable() goes through several layers of functions and
> ends up calling hap_enable_vram_tracking(), which does quite a bit of stuff.

OK.

> > > +/* paging_mark_dirty_hap()
> > > + * Make a hap page writeable and mark it as dirty.
> > > + * This done atomically under the p2m and paging locks to avoid leaving
> > > + * a window where the page might be modified without being marked as
> > dirty.
> > > + */
> >
> > I'm perplexed by this -- AFAICT it's either not necessary (because all
> > log-dirty read/clean ops are done with the domain paused) or not sufficient
> > (because although the bitmap and the PTE are updated under the p2m lock,
> > the actual dirtying of the page happens at some other time).  Can you
> > spell out for me exactly what this is protecting against?
> 
> The comment over-stated the problem so I've toned it down
> from "without being marked" to "without being counted".
> 
> paging_mark_dirty_hap() is in the page fault path and has two steps:
> 
> (1) It calls p2m_change_type() to re-mark some pfn as writeable
>     (i.e. p2m_ram_rw), which is a no-op if the pfn is already writeable.
>     This must be done under the p2m_lock.
> 
> (2) If the pfn was previously read-only (i.e. p2m_ram_logdirty) then
>     it bumps two dirty counts.  And it marks the page as dirty.  This must
>     be done under the paging lock.
> 
> As an invariant, the dirty counts should be precisely the number of pages
> made writeable.

That invariant is already doomed -- any other agent (including the guest
itself) can change the p2m mappings for one of the pfns, or mark the pfn
dirty, without going through the NPF fault handler.  AFAICS the counts
could just as well be implemented as flags, to say 'something in this
range was dirtied'; the only interesting case is when they're 0.

> It may be that this invariant is not particularly useful, that things
> will just work out.  But I do wonder if, without it, we'll have
> situations where the dirty counts will indicate dirty pages when there
> are none, or no dirty pages when there are some.

The second of those cases would be the bad one; I think that can be
avoided by just switching the order of paging_mark_dirty() and
p2m_change_type() in hvm_hap_nested_page_fault(), and maybe putting a
wmb() between them. 

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 13:25:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 13:25:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWS6p-0007Kq-E1; Thu, 08 Nov 2012 13:25:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TWS6n-0007Kl-UF
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 13:25:26 +0000
Received: from [85.158.139.211:53244] by server-4.bemta-5.messagelabs.com id
	6A/A6-15011-5C2BB905; Thu, 08 Nov 2012 13:25:25 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-10.tower-206.messagelabs.com!1352381123!19375982!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10089 invoked from network); 8 Nov 2012 13:25:24 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-10.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 13:25:24 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TWS6k-000Kc7-3X; Thu, 08 Nov 2012 13:25:22 +0000
Date: Thu, 8 Nov 2012 13:25:22 +0000
From: Tim Deegan <tim@xen.org>
To: Robert Phillips <robert.phillips@citrix.com>
Message-ID: <20121108132522.GG76638@ocelot.phlegethon.org>
References: <1350411302-5470-1-git-send-email-robert.phillips@citrix.com>
	<20121101142434.GC61948@ocelot.phlegethon.org>
	<048EAD622912254A9DEA24C1734613C18C876560B1@FTLPMAILBOX02.citrite.net>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <048EAD622912254A9DEA24C1734613C18C876560B1@FTLPMAILBOX02.citrite.net>
User-Agent: Mutt/1.4.2.1i
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
	in Xen.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi, 

Thanks for the update patch.

At 15:36 -0500 on 07 Nov (1352302577), Robert Phillips wrote:
> > More substantive comments:
> >  - I think the dirty_vram.c and dirty_vram.h files belong under mm/
> >    rather than under hvm/.  The ``#include "../mm/mm-locks.h"'' is
> >    an indicator that this is really MM code.
> 
> I have moved dirty_vram.c under mm/
> I have moved dirty_vram.h under include/asm-x86 .  In that location it
> is available to modules like hvm.c

Sure, that seems sgood. 

> > I'd be
> > inclined to just put all paddr_links in the linked list (and have an
> > array of pointers rather than an array of paddr_link_ts).  Is it worth
> > having the extra complexity here, and at the callers, to avoid a single
> > memory read?
> 
> Almost all frame buffer pages have a single mapping so the algorithm's
> common case is met by constructing pl_tab as an array of paddr_links.
> That is, the table's paddr_links will rarely point to a chain of
> extension paddr_links.  The code encapsulates the complexity in a
> single function.  Sorry it required so much staring.  Even if all
> paddr_links were stored in a linked list, the caller would have to
> walk that linked list, so would be just as complex.

OK.

> > > +        if (set)
> > > +        {
> > > +            /* Did we find sl1ma in either the main table or the linked list? */
> > > +            if (pl == NULL) /* no, so we'll need to alloc a link */
> > > +            {
> > > +                ASSERT(ppl != NULL);
> > > +                /* alloc link and append it to list */
> > > +                (*ppl) = pl = alloc_paddr_link(d);
> > > +                if (pl == NULL)
> > > +                    goto out;
> >
> > This needs to signal some sort of error.  Otherwise, if we can't add
> > this sl1e to the list we'll just silently fail to track it.
> 
> I don't know what sort of error we can signal.
> 
> The immediate symptom would be that areas of the monitor would not be
> refreshed.  But, since we're running out of memory, that might be the
> least of the quests's woes.  The updated patch actually makes the
> symptom more likely (though still very unlikely) by putting an
> arbitrary bound on the length of paddr_link chains.  It handles a
> rogue process, one that has an arbitrarily large number of mappings
> for frame buffer pages, by simply not recording the excessive
> mappings.  If that results in unrefreshed blocks on the monitor, so be
> it.

I think the correct behaviour would be to report these pages as dirty.
That way anything that relies on seeing all changes will behave
correctly, though less efficiently.

> > > +#endif
> > > +                free_paddr_link(d, ppl, pl);
> > > +                if ( --range->nr_mappings == 0 )
> > > +                {
> > > +                    dirty_vram_range_free(d, range);
> >
> > What's this for?  If the guest unmaps the framebuffer and remaps it (or
> > if the shadow PTs of the mappings are temporarily discarded) this will
> > stop us from tracking the new mappings until the toolstack asks for the
> > bitmap (and then it will be expensive to go and find the mappings).
> >
> 
> I don't see this happening.  If the guest unmaps the framebuffer, the
> shadow code lazily recovers the shadow pages, so tracking will
> continue until it decides a page is no longer a shadow page.  That is
> when this code is invoked.

If the guest unmaps the buffer by clearing the PTEs then when the PTE
changes are propagated into the shadows this will cause nr_mappings to
fall to zero here.  If we _don't_ free the range, then when the FB is
mapped again we'll spot the new PTEs as they're shadowed and DTRT.  If we
_do_ free the range we end up walking all shadows looking for the
mappings.

> It tears down the mappings to that page and if some range ends up
> with no mappings then the range is useless.  Vram ranges are generated
> willy-nilly as needed.  This is the only mechanism for cleaning them up.

Shouldn't there be some way for the tools to indicate that they're done
with a range?  I guess they can tear down the whole lot and then start
again with whatever ranges are still in use. 

> > Oughtn't we to return all 1s in the bitmap here?  If the range isn't
> > currently being tracked we should conservatively assume it's all dirty,
> > right?
> 
> The callers will should ensure that the range exists.  This is just a
> conservative test.

OK.

> Anyway, it begs the question of whether a new range should be
> considered all dirty or all clean.  Intuitively "all dirty" seems the
> right answer but in practice it works fine as written since the guest
> is busy updating the whole frame buffer.

What if the guest's not writing to the framebuffer at the moment, or
only to a part of it?  Shouldn't the tools see the existing content?

> > And, since you know you're in HAP mode, not in log-dirty mode, and
> > already have the paging lock, you can just set
> > d->arch.paging.mode |= PG_log_dirty there rather than jumping through
> > the paging_log_dirty_enable() path and messing with locks.
> 
> No, paging_log_dirty_enable() goes through several layers of functions and
> ends up calling hap_enable_vram_tracking(), which does quite a bit of stuff.

OK.

> > > +/* paging_mark_dirty_hap()
> > > + * Make a hap page writeable and mark it as dirty.
> > > + * This done atomically under the p2m and paging locks to avoid leaving
> > > + * a window where the page might be modified without being marked as
> > dirty.
> > > + */
> >
> > I'm perplexed by this -- AFAICT it's either not necessary (because all
> > log-dirty read/clean ops are done with the domain paused) or not sufficient
> > (because although the bitmap and the PTE are updated under the p2m lock,
> > the actual dirtying of the page happens at some other time).  Can you
> > spell out for me exactly what this is protecting against?
> 
> The comment over-stated the problem so I've toned it down
> from "without being marked" to "without being counted".
> 
> paging_mark_dirty_hap() is in the page fault path and has two steps:
> 
> (1) It calls p2m_change_type() to re-mark some pfn as writeable
>     (i.e. p2m_ram_rw), which is a no-op if the pfn is already writeable.
>     This must be done under the p2m_lock.
> 
> (2) If the pfn was previously read-only (i.e. p2m_ram_logdirty) then
>     it bumps two dirty counts.  And it marks the page as dirty.  This must
>     be done under the paging lock.
> 
> As an invariant, the dirty counts should be precisely the number of pages
> made writeable.

That invariant is already doomed -- any other agent (including the guest
itself) can change the p2m mappings for one of the pfns, or mark the pfn
dirty, without going through the NPF fault handler.  AFAICS the counts
could just as well be implemented as flags, to say 'something in this
range was dirtied'; the only interesting case is when they're 0.

> It may be that this invariant is not particularly useful, that things
> will just work out.  But I do wonder if, without it, we'll have
> situations where the dirty counts will indicate dirty pages when there
> are none, or no dirty pages when there are some.

The second of those cases would be the bad one; I think that can be
avoided by just switching the order of paging_mark_dirty() and
p2m_change_type() in hvm_hap_nested_page_fault(), and maybe putting a
wmb() between them. 

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 13:32:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 13:32:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWSDN-0007VY-F1; Thu, 08 Nov 2012 13:32:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TWSDL-0007VS-FY
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 13:32:11 +0000
Received: from [85.158.138.51:4278] by server-11.bemta-3.messagelabs.com id
	32/7C-19361-A54BB905; Thu, 08 Nov 2012 13:32:10 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1352381527!21201783!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMzY2NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5507 invoked from network); 8 Nov 2012 13:32:09 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 8 Nov 2012 13:32:09 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA8DVpUu030168
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 8 Nov 2012 13:31:52 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA8DVpQq025328
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 8 Nov 2012 13:31:51 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA8DVmBf021421; Thu, 8 Nov 2012 07:31:48 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 08 Nov 2012 05:31:48 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id E41154037A; Thu,  8 Nov 2012 08:31:45 -0500 (EST)
Date: Thu, 8 Nov 2012 08:31:45 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <ian.campbell@citrix.com>
Message-ID: <20121108133145.GC3081@phenom.dumpdata.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121107144625.GA14628@ennui.austin.ibm.com>
	<509AA501.1090701@jhuapl.edu>
	<20121108011006.GC21302@phenom.dumpdata.com>
	<1352364376.12977.93.camel@hastur.hellion.org.uk>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352364376.12977.93.camel@hastur.hellion.org.uk>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	Kent Yoder <key@linux.vnet.ibm.com>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
 driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 08, 2012 at 09:46:16AM +0100, Ian Campbell wrote:
> > > >>+typedef struct tpmif_tx_request tpmif_tx_request_t;
> > > >   checkpatch warned on this new typedef - please run through checkpatch
> > > >and fix up that stuff.
> > > tpmif.h has a couple of typedefs which do trigger checkpatch
> > > warnings. However it looks like the paradigm for xen is to have
> > > these interface/io/<dev>if.h files and all of them have typedefs. I
> > > think in this case the typedef should probably stay.
> > > 
> > > Konrad your thoughts here?
> > 
> > Rip them out plea
> 
> This is somewhere that Linux coding style and Xen coding style differ,
> so the typedefs should be removed from the Linux copy of these
> interfaces to match the Linux coding style, but they should stay in the
> Xen side canonical copy though.

Yes. Sorry for not making that clear.
> 
> Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 13:32:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 13:32:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWSDN-0007VY-F1; Thu, 08 Nov 2012 13:32:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TWSDL-0007VS-FY
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 13:32:11 +0000
Received: from [85.158.138.51:4278] by server-11.bemta-3.messagelabs.com id
	32/7C-19361-A54BB905; Thu, 08 Nov 2012 13:32:10 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1352381527!21201783!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMzY2NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5507 invoked from network); 8 Nov 2012 13:32:09 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 8 Nov 2012 13:32:09 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA8DVpUu030168
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 8 Nov 2012 13:31:52 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA8DVpQq025328
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 8 Nov 2012 13:31:51 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA8DVmBf021421; Thu, 8 Nov 2012 07:31:48 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 08 Nov 2012 05:31:48 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id E41154037A; Thu,  8 Nov 2012 08:31:45 -0500 (EST)
Date: Thu, 8 Nov 2012 08:31:45 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <ian.campbell@citrix.com>
Message-ID: <20121108133145.GC3081@phenom.dumpdata.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121107144625.GA14628@ennui.austin.ibm.com>
	<509AA501.1090701@jhuapl.edu>
	<20121108011006.GC21302@phenom.dumpdata.com>
	<1352364376.12977.93.camel@hastur.hellion.org.uk>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352364376.12977.93.camel@hastur.hellion.org.uk>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	Kent Yoder <key@linux.vnet.ibm.com>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
 driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 08, 2012 at 09:46:16AM +0100, Ian Campbell wrote:
> > > >>+typedef struct tpmif_tx_request tpmif_tx_request_t;
> > > >   checkpatch warned on this new typedef - please run through checkpatch
> > > >and fix up that stuff.
> > > tpmif.h has a couple of typedefs which do trigger checkpatch
> > > warnings. However it looks like the paradigm for xen is to have
> > > these interface/io/<dev>if.h files and all of them have typedefs. I
> > > think in this case the typedef should probably stay.
> > > 
> > > Konrad your thoughts here?
> > 
> > Rip them out plea
> 
> This is somewhere that Linux coding style and Xen coding style differ,
> so the typedefs should be removed from the Linux copy of these
> interfaces to match the Linux coding style, but they should stay in the
> Xen side canonical copy though.

Yes. Sorry for not making that clear.
> 
> Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 13:46:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 13:46:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWSQy-0007gC-SP; Thu, 08 Nov 2012 13:46:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWSQw-0007g7-Q5
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 13:46:15 +0000
Received: from [85.158.139.83:13954] by server-11.bemta-5.messagelabs.com id
	F4/97-03409-6A7BB905; Thu, 08 Nov 2012 13:46:14 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1352382372!29641358!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7433 invoked from network); 8 Nov 2012 13:46:12 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-182.messagelabs.com with SMTP;
	8 Nov 2012 13:46:12 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 13:46:12 +0000
Message-Id: <509BC5B402000078000A7396@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 13:46:12 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<509A94F002000078000A702A@nat28.tlf.novell.com>
	<20121108124633.GF76638@ocelot.phlegethon.org>
In-Reply-To: <20121108124633.GF76638@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com,
	xen-devel <xen-devel@lists.xen.org>,
	Dario Faggioli <raistlin@linux.it>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH,
 v2] IOMMU: don't immediately disable bus mastering on faults
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 08.11.12 at 13:46, Tim Deegan <tim@xen.org> wrote:
> At 16:05 +0000 on 07 Nov (1352304352), Jan Beulich wrote:
>> Instead, give the owning domain at least a small opportunity of fixing
>> things up, and allow for rare faults to not bring down the device at
>> all. The amount of faults tolerated within a given time period (all
>> numbers are made up with no specific rationale) is higher for Dom0 than
>> for DomU-s.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Looks good to me, though I don't think dom0 should have any special
> treatment here.  I'd be inclined to set the threshold to 10 for
> everyone. 

No problem. I'll wait for the IOMMU folks to give some feedback,
and either re-submit (if further changes are requested), or commit
with their acks (and the change as you suggest, if they're in
agreement).

Of course, if they disagree we'll have to get to a common position
anyway first.

If no other changes are requested, do I take the above as an
"ack-with-that-change"?

Jan

>> --- a/xen/drivers/passthrough/amd/iommu_init.c
>> +++ b/xen/drivers/passthrough/amd/iommu_init.c
>> @@ -566,7 +566,7 @@ static hw_irq_controller iommu_maskable_
>>  
>>  static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
>>  {
>> -    u16 domain_id, device_id, bdf, cword, flags;
>> +    u16 domain_id, device_id, bdf, flags;
>>      u32 code;
>>      u64 *addr;
>>      int count = 0;
>> @@ -620,18 +620,10 @@ static void parse_event_log_entry(struct
>>                 "fault address = %#"PRIx64", flags = %#x\n",
>>                 event_str[code-1], domain_id, device_id, *addr, flags);
>>  
>> -        /* Tell the device to stop DMAing; we can't rely on the guest to
>> -         * control it for us. */
>>          for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ )
>>              if ( get_dma_requestor_id(iommu->seg, bdf) == device_id )
>> -            {
>> -                cword = pci_conf_read16(iommu->seg, PCI_BUS(bdf),
>> -                                        PCI_SLOT(bdf), PCI_FUNC(bdf),
>> -                                        PCI_COMMAND);
>> -                pci_conf_write16(iommu->seg, PCI_BUS(bdf), PCI_SLOT(bdf),
>> -                                 PCI_FUNC(bdf), PCI_COMMAND, 
>> -                                 cword & ~PCI_COMMAND_MASTER);
>> -            }
>> +                pci_check_disable_device(iommu->seg, PCI_BUS(bdf),
>> +                                         PCI_DEVFN2(bdf));
>>      }
>>      else
>>      {
>> --- a/xen/drivers/passthrough/iommu.c
>> +++ b/xen/drivers/passthrough/iommu.c
>> @@ -215,6 +215,7 @@ static int device_assigned(u16 seg, u8 b
>>  static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
>>  {
>>      struct hvm_iommu *hd = domain_hvm_iommu(d);
>> +    struct pci_dev *pdev;
>>      int rc = 0;
>>  
>>      if ( !iommu_enabled || !hd->platform_ops )
>> @@ -228,6 +229,13 @@ static int assign_device(struct domain *
>>          return -EXDEV;
>>  
>>      spin_lock(&pcidevs_lock);
>> +    pdev = pci_get_pdev(seg, bus, devfn);
>> +    if ( pdev )
>> +    {
>> +        pdev->fault.threshold = PT_FAULT_THRESHOLD_UNPRIV;
>> +        pdev->fault.count     = 0;
>> +    }
>> +
>>      if ( (rc = hd->platform_ops->assign_device(d, seg, bus, devfn)) )
>>          goto done;
>>  
>> @@ -239,6 +247,8 @@ static int assign_device(struct domain *
>>          goto done;
>>      }
>>  done:
>> +    if ( pdev && pdev->domain != d )
>> +        pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>>      spin_unlock(&pcidevs_lock);
>>      return rc;
>>  }
>> @@ -379,6 +389,9 @@ int deassign_device(struct domain *d, u1
>>          return ret;
>>      }
>>  
>> +    pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>> +    pdev->fault.count     = 0;
>> +
>>      if ( !has_arch_pdevs(d) && need_iommu(d) )
>>      {
>>          d->need_iommu = 0;
>> --- a/xen/drivers/passthrough/pci.c
>> +++ b/xen/drivers/passthrough/pci.c
>> @@ -137,6 +137,7 @@ static struct pci_dev *alloc_pdev(struct
>>      *((u8*) &pdev->bus) = bus;
>>      *((u8*) &pdev->devfn) = devfn;
>>      pdev->domain = NULL;
>> +    pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>>      INIT_LIST_HEAD(&pdev->msi_list);
>>      list_add(&pdev->alldevs_list, &pseg->alldevs_list);
>>      spin_lock_init(&pdev->msix_table_lock);
>> @@ -672,6 +673,36 @@ int __init pci_device_detect(u16 seg, u8
>>      return 1;
>>  }
>>  
>> +void pci_check_disable_device(u16 seg, u8 bus, u8 devfn)
>> +{
>> +    struct pci_dev *pdev;
>> +    s_time_t now = NOW();
>> +    u16 cword;
>> +
>> +    spin_lock(&pcidevs_lock);
>> +    pdev = pci_get_pdev(seg, bus, devfn);
>> +    if ( pdev )
>> +    {
>> +        if ( now < pdev->fault.time ||
>> +             now - pdev->fault.time > MILLISECS(10) )
>> +            pdev->fault.count >>= 1;
>> +        pdev->fault.time = now;
>> +        if ( ++pdev->fault.count < pdev->fault.threshold )
>> +            pdev = NULL;
>> +    }
>> +    spin_unlock(&pcidevs_lock);
>> +
>> +    if ( !pdev )
>> +        return;
>> +
>> +    /* Tell the device to stop DMAing; we can't rely on the guest to
>> +     * control it for us. */
>> +    cword = pci_conf_read16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
>> +                            PCI_COMMAND);
>> +    pci_conf_write16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
>> +                     PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
>> +}
>> +
>>  /*
>>   * scan pci devices to add all existed PCI devices to alldevs_list,
>>   * and setup pci hierarchy in array bus2bridge.
>> --- a/xen/drivers/passthrough/vtd/iommu.c
>> +++ b/xen/drivers/passthrough/vtd/iommu.c
>> @@ -917,7 +917,7 @@ static void __do_iommu_page_fault(struct
>>      while (1)
>>      {
>>          u8 fault_reason;
>> -        u16 source_id, cword;
>> +        u16 source_id;
>>          u32 data;
>>          u64 guest_addr;
>>          int type;
>> @@ -950,14 +950,8 @@ static void __do_iommu_page_fault(struct
>>          iommu_page_fault_do_one(iommu, type, fault_reason,
>>                                  source_id, guest_addr);
>>  
>> -        /* Tell the device to stop DMAing; we can't rely on the guest to
>> -         * control it for us. */
>> -        cword = pci_conf_read16(iommu->intel->drhd->segment,
>> -                                PCI_BUS(source_id), PCI_SLOT(source_id),
>> -                                PCI_FUNC(source_id), PCI_COMMAND);
>> -        pci_conf_write16(iommu->intel->drhd->segment, PCI_BUS(source_id),
>> -                         PCI_SLOT(source_id), PCI_FUNC(source_id),
>> -                         PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
>> +        pci_check_disable_device(iommu->intel->drhd->segment,
>> +                                 PCI_BUS(source_id), 
> PCI_DEVFN2(source_id));
>>  
>>          fault_index++;
>>          if ( fault_index > cap_num_fault_regs(iommu->cap) )
>> --- a/xen/include/xen/pci.h
>> +++ b/xen/include/xen/pci.h
>> @@ -64,6 +64,13 @@ struct pci_dev {
>>      const u8 devfn;
>>      struct pci_dev_info info;
>>      struct arch_pci_dev arch;
>> +    struct {
>> +        s_time_t time;
>> +        unsigned int threshold;
>> +#define PT_FAULT_THRESHOLD_PRIV  10
>> +#define PT_FAULT_THRESHOLD_UNPRIV 3
>> +        unsigned int count;
>> +    } fault;
>>      u64 vf_rlen[6];
>>  };
>>  
>> @@ -107,6 +114,7 @@ int pci_hide_device(int bus, int devfn);
>>  struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);
>>  struct pci_dev *pci_get_pdev_by_domain(
>>      struct domain *, int seg, int bus, int devfn);
>> +void pci_check_disable_device(u16 seg, u8 bus, u8 devfn);
>>  
>>  uint8_t pci_conf_read8(
>>      unsigned int seg, unsigned int bus, unsigned int dev, unsigned int 
> func,
>> 
>> 
> 
>> IOMMU: don't immediately disable bus mastering on faults
>> 
>> Instead, give the owning domain at least a small opportunity of fixing
>> things up, and allow for rare faults to not bring down the device at
>> all. The amount of faults tolerated within a given time period (all
>> numbers are made up with no specific rationale) is higher for Dom0 than
>> for DomU-s.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> 
>> --- a/xen/drivers/passthrough/amd/iommu_init.c
>> +++ b/xen/drivers/passthrough/amd/iommu_init.c
>> @@ -566,7 +566,7 @@ static hw_irq_controller iommu_maskable_
>>  
>>  static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
>>  {
>> -    u16 domain_id, device_id, bdf, cword, flags;
>> +    u16 domain_id, device_id, bdf, flags;
>>      u32 code;
>>      u64 *addr;
>>      int count = 0;
>> @@ -620,18 +620,10 @@ static void parse_event_log_entry(struct
>>                 "fault address = %#"PRIx64", flags = %#x\n",
>>                 event_str[code-1], domain_id, device_id, *addr, flags);
>>  
>> -        /* Tell the device to stop DMAing; we can't rely on the guest to
>> -         * control it for us. */
>>          for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ )
>>              if ( get_dma_requestor_id(iommu->seg, bdf) == device_id )
>> -            {
>> -                cword = pci_conf_read16(iommu->seg, PCI_BUS(bdf),
>> -                                        PCI_SLOT(bdf), PCI_FUNC(bdf),
>> -                                        PCI_COMMAND);
>> -                pci_conf_write16(iommu->seg, PCI_BUS(bdf), PCI_SLOT(bdf),
>> -                                 PCI_FUNC(bdf), PCI_COMMAND, 
>> -                                 cword & ~PCI_COMMAND_MASTER);
>> -            }
>> +                pci_check_disable_device(iommu->seg, PCI_BUS(bdf),
>> +                                         PCI_DEVFN2(bdf));
>>      }
>>      else
>>      {
>> --- a/xen/drivers/passthrough/iommu.c
>> +++ b/xen/drivers/passthrough/iommu.c
>> @@ -215,6 +215,7 @@ static int device_assigned(u16 seg, u8 b
>>  static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
>>  {
>>      struct hvm_iommu *hd = domain_hvm_iommu(d);
>> +    struct pci_dev *pdev;
>>      int rc = 0;
>>  
>>      if ( !iommu_enabled || !hd->platform_ops )
>> @@ -228,6 +229,13 @@ static int assign_device(struct domain *
>>          return -EXDEV;
>>  
>>      spin_lock(&pcidevs_lock);
>> +    pdev = pci_get_pdev(seg, bus, devfn);
>> +    if ( pdev )
>> +    {
>> +        pdev->fault.threshold = PT_FAULT_THRESHOLD_UNPRIV;
>> +        pdev->fault.count     = 0;
>> +    }
>> +
>>      if ( (rc = hd->platform_ops->assign_device(d, seg, bus, devfn)) )
>>          goto done;
>>  
>> @@ -239,6 +247,8 @@ static int assign_device(struct domain *
>>          goto done;
>>      }
>>  done:
>> +    if ( pdev && pdev->domain != d )
>> +        pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>>      spin_unlock(&pcidevs_lock);
>>      return rc;
>>  }
>> @@ -379,6 +389,9 @@ int deassign_device(struct domain *d, u1
>>          return ret;
>>      }
>>  
>> +    pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>> +    pdev->fault.count     = 0;
>> +
>>      if ( !has_arch_pdevs(d) && need_iommu(d) )
>>      {
>>          d->need_iommu = 0;
>> --- a/xen/drivers/passthrough/pci.c
>> +++ b/xen/drivers/passthrough/pci.c
>> @@ -137,6 +137,7 @@ static struct pci_dev *alloc_pdev(struct
>>      *((u8*) &pdev->bus) = bus;
>>      *((u8*) &pdev->devfn) = devfn;
>>      pdev->domain = NULL;
>> +    pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>>      INIT_LIST_HEAD(&pdev->msi_list);
>>      list_add(&pdev->alldevs_list, &pseg->alldevs_list);
>>      spin_lock_init(&pdev->msix_table_lock);
>> @@ -672,6 +673,36 @@ int __init pci_device_detect(u16 seg, u8
>>      return 1;
>>  }
>>  
>> +void pci_check_disable_device(u16 seg, u8 bus, u8 devfn)
>> +{
>> +    struct pci_dev *pdev;
>> +    s_time_t now = NOW();
>> +    u16 cword;
>> +
>> +    spin_lock(&pcidevs_lock);
>> +    pdev = pci_get_pdev(seg, bus, devfn);
>> +    if ( pdev )
>> +    {
>> +        if ( now < pdev->fault.time ||
>> +             now - pdev->fault.time > MILLISECS(10) )
>> +            pdev->fault.count >>= 1;
>> +        pdev->fault.time = now;
>> +        if ( ++pdev->fault.count < pdev->fault.threshold )
>> +            pdev = NULL;
>> +    }
>> +    spin_unlock(&pcidevs_lock);
>> +
>> +    if ( !pdev )
>> +        return;
>> +
>> +    /* Tell the device to stop DMAing; we can't rely on the guest to
>> +     * control it for us. */
>> +    cword = pci_conf_read16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
>> +                            PCI_COMMAND);
>> +    pci_conf_write16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
>> +                     PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
>> +}
>> +
>>  /*
>>   * scan pci devices to add all existed PCI devices to alldevs_list,
>>   * and setup pci hierarchy in array bus2bridge.
>> --- a/xen/drivers/passthrough/vtd/iommu.c
>> +++ b/xen/drivers/passthrough/vtd/iommu.c
>> @@ -917,7 +917,7 @@ static void __do_iommu_page_fault(struct
>>      while (1)
>>      {
>>          u8 fault_reason;
>> -        u16 source_id, cword;
>> +        u16 source_id;
>>          u32 data;
>>          u64 guest_addr;
>>          int type;
>> @@ -950,14 +950,8 @@ static void __do_iommu_page_fault(struct
>>          iommu_page_fault_do_one(iommu, type, fault_reason,
>>                                  source_id, guest_addr);
>>  
>> -        /* Tell the device to stop DMAing; we can't rely on the guest to
>> -         * control it for us. */
>> -        cword = pci_conf_read16(iommu->intel->drhd->segment,
>> -                                PCI_BUS(source_id), PCI_SLOT(source_id),
>> -                                PCI_FUNC(source_id), PCI_COMMAND);
>> -        pci_conf_write16(iommu->intel->drhd->segment, PCI_BUS(source_id),
>> -                         PCI_SLOT(source_id), PCI_FUNC(source_id),
>> -                         PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
>> +        pci_check_disable_device(iommu->intel->drhd->segment,
>> +                                 PCI_BUS(source_id), 
> PCI_DEVFN2(source_id));
>>  
>>          fault_index++;
>>          if ( fault_index > cap_num_fault_regs(iommu->cap) )
>> --- a/xen/include/xen/pci.h
>> +++ b/xen/include/xen/pci.h
>> @@ -64,6 +64,13 @@ struct pci_dev {
>>      const u8 devfn;
>>      struct pci_dev_info info;
>>      struct arch_pci_dev arch;
>> +    struct {
>> +        s_time_t time;
>> +        unsigned int threshold;
>> +#define PT_FAULT_THRESHOLD_PRIV  10
>> +#define PT_FAULT_THRESHOLD_UNPRIV 3
>> +        unsigned int count;
>> +    } fault;
>>      u64 vf_rlen[6];
>>  };
>>  
>> @@ -107,6 +114,7 @@ int pci_hide_device(int bus, int devfn);
>>  struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);
>>  struct pci_dev *pci_get_pdev_by_domain(
>>      struct domain *, int seg, int bus, int devfn);
>> +void pci_check_disable_device(u16 seg, u8 bus, u8 devfn);
>>  
>>  uint8_t pci_conf_read8(
>>      unsigned int seg, unsigned int bus, unsigned int dev, unsigned int 
> func,



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 13:46:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 13:46:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWSQy-0007gC-SP; Thu, 08 Nov 2012 13:46:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWSQw-0007g7-Q5
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 13:46:15 +0000
Received: from [85.158.139.83:13954] by server-11.bemta-5.messagelabs.com id
	F4/97-03409-6A7BB905; Thu, 08 Nov 2012 13:46:14 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1352382372!29641358!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7433 invoked from network); 8 Nov 2012 13:46:12 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-182.messagelabs.com with SMTP;
	8 Nov 2012 13:46:12 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 13:46:12 +0000
Message-Id: <509BC5B402000078000A7396@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 13:46:12 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<509A94F002000078000A702A@nat28.tlf.novell.com>
	<20121108124633.GF76638@ocelot.phlegethon.org>
In-Reply-To: <20121108124633.GF76638@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com,
	xen-devel <xen-devel@lists.xen.org>,
	Dario Faggioli <raistlin@linux.it>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH,
 v2] IOMMU: don't immediately disable bus mastering on faults
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 08.11.12 at 13:46, Tim Deegan <tim@xen.org> wrote:
> At 16:05 +0000 on 07 Nov (1352304352), Jan Beulich wrote:
>> Instead, give the owning domain at least a small opportunity of fixing
>> things up, and allow for rare faults to not bring down the device at
>> all. The amount of faults tolerated within a given time period (all
>> numbers are made up with no specific rationale) is higher for Dom0 than
>> for DomU-s.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Looks good to me, though I don't think dom0 should have any special
> treatment here.  I'd be inclined to set the threshold to 10 for
> everyone. 

No problem. I'll wait for the IOMMU folks to give some feedback,
and either re-submit (if further changes are requested), or commit
with their acks (and the change as you suggest, if they're in
agreement).

Of course, if they disagree we'll have to get to a common position
anyway first.

If no other changes are requested, do I take the above as an
"ack-with-that-change"?

Jan

>> --- a/xen/drivers/passthrough/amd/iommu_init.c
>> +++ b/xen/drivers/passthrough/amd/iommu_init.c
>> @@ -566,7 +566,7 @@ static hw_irq_controller iommu_maskable_
>>  
>>  static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
>>  {
>> -    u16 domain_id, device_id, bdf, cword, flags;
>> +    u16 domain_id, device_id, bdf, flags;
>>      u32 code;
>>      u64 *addr;
>>      int count = 0;
>> @@ -620,18 +620,10 @@ static void parse_event_log_entry(struct
>>                 "fault address = %#"PRIx64", flags = %#x\n",
>>                 event_str[code-1], domain_id, device_id, *addr, flags);
>>  
>> -        /* Tell the device to stop DMAing; we can't rely on the guest to
>> -         * control it for us. */
>>          for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ )
>>              if ( get_dma_requestor_id(iommu->seg, bdf) == device_id )
>> -            {
>> -                cword = pci_conf_read16(iommu->seg, PCI_BUS(bdf),
>> -                                        PCI_SLOT(bdf), PCI_FUNC(bdf),
>> -                                        PCI_COMMAND);
>> -                pci_conf_write16(iommu->seg, PCI_BUS(bdf), PCI_SLOT(bdf),
>> -                                 PCI_FUNC(bdf), PCI_COMMAND, 
>> -                                 cword & ~PCI_COMMAND_MASTER);
>> -            }
>> +                pci_check_disable_device(iommu->seg, PCI_BUS(bdf),
>> +                                         PCI_DEVFN2(bdf));
>>      }
>>      else
>>      {
>> --- a/xen/drivers/passthrough/iommu.c
>> +++ b/xen/drivers/passthrough/iommu.c
>> @@ -215,6 +215,7 @@ static int device_assigned(u16 seg, u8 b
>>  static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
>>  {
>>      struct hvm_iommu *hd = domain_hvm_iommu(d);
>> +    struct pci_dev *pdev;
>>      int rc = 0;
>>  
>>      if ( !iommu_enabled || !hd->platform_ops )
>> @@ -228,6 +229,13 @@ static int assign_device(struct domain *
>>          return -EXDEV;
>>  
>>      spin_lock(&pcidevs_lock);
>> +    pdev = pci_get_pdev(seg, bus, devfn);
>> +    if ( pdev )
>> +    {
>> +        pdev->fault.threshold = PT_FAULT_THRESHOLD_UNPRIV;
>> +        pdev->fault.count     = 0;
>> +    }
>> +
>>      if ( (rc = hd->platform_ops->assign_device(d, seg, bus, devfn)) )
>>          goto done;
>>  
>> @@ -239,6 +247,8 @@ static int assign_device(struct domain *
>>          goto done;
>>      }
>>  done:
>> +    if ( pdev && pdev->domain != d )
>> +        pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>>      spin_unlock(&pcidevs_lock);
>>      return rc;
>>  }
>> @@ -379,6 +389,9 @@ int deassign_device(struct domain *d, u1
>>          return ret;
>>      }
>>  
>> +    pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>> +    pdev->fault.count     = 0;
>> +
>>      if ( !has_arch_pdevs(d) && need_iommu(d) )
>>      {
>>          d->need_iommu = 0;
>> --- a/xen/drivers/passthrough/pci.c
>> +++ b/xen/drivers/passthrough/pci.c
>> @@ -137,6 +137,7 @@ static struct pci_dev *alloc_pdev(struct
>>      *((u8*) &pdev->bus) = bus;
>>      *((u8*) &pdev->devfn) = devfn;
>>      pdev->domain = NULL;
>> +    pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>>      INIT_LIST_HEAD(&pdev->msi_list);
>>      list_add(&pdev->alldevs_list, &pseg->alldevs_list);
>>      spin_lock_init(&pdev->msix_table_lock);
>> @@ -672,6 +673,36 @@ int __init pci_device_detect(u16 seg, u8
>>      return 1;
>>  }
>>  
>> +void pci_check_disable_device(u16 seg, u8 bus, u8 devfn)
>> +{
>> +    struct pci_dev *pdev;
>> +    s_time_t now = NOW();
>> +    u16 cword;
>> +
>> +    spin_lock(&pcidevs_lock);
>> +    pdev = pci_get_pdev(seg, bus, devfn);
>> +    if ( pdev )
>> +    {
>> +        if ( now < pdev->fault.time ||
>> +             now - pdev->fault.time > MILLISECS(10) )
>> +            pdev->fault.count >>= 1;
>> +        pdev->fault.time = now;
>> +        if ( ++pdev->fault.count < pdev->fault.threshold )
>> +            pdev = NULL;
>> +    }
>> +    spin_unlock(&pcidevs_lock);
>> +
>> +    if ( !pdev )
>> +        return;
>> +
>> +    /* Tell the device to stop DMAing; we can't rely on the guest to
>> +     * control it for us. */
>> +    cword = pci_conf_read16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
>> +                            PCI_COMMAND);
>> +    pci_conf_write16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
>> +                     PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
>> +}
>> +
>>  /*
>>   * scan pci devices to add all existed PCI devices to alldevs_list,
>>   * and setup pci hierarchy in array bus2bridge.
>> --- a/xen/drivers/passthrough/vtd/iommu.c
>> +++ b/xen/drivers/passthrough/vtd/iommu.c
>> @@ -917,7 +917,7 @@ static void __do_iommu_page_fault(struct
>>      while (1)
>>      {
>>          u8 fault_reason;
>> -        u16 source_id, cword;
>> +        u16 source_id;
>>          u32 data;
>>          u64 guest_addr;
>>          int type;
>> @@ -950,14 +950,8 @@ static void __do_iommu_page_fault(struct
>>          iommu_page_fault_do_one(iommu, type, fault_reason,
>>                                  source_id, guest_addr);
>>  
>> -        /* Tell the device to stop DMAing; we can't rely on the guest to
>> -         * control it for us. */
>> -        cword = pci_conf_read16(iommu->intel->drhd->segment,
>> -                                PCI_BUS(source_id), PCI_SLOT(source_id),
>> -                                PCI_FUNC(source_id), PCI_COMMAND);
>> -        pci_conf_write16(iommu->intel->drhd->segment, PCI_BUS(source_id),
>> -                         PCI_SLOT(source_id), PCI_FUNC(source_id),
>> -                         PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
>> +        pci_check_disable_device(iommu->intel->drhd->segment,
>> +                                 PCI_BUS(source_id), 
> PCI_DEVFN2(source_id));
>>  
>>          fault_index++;
>>          if ( fault_index > cap_num_fault_regs(iommu->cap) )
>> --- a/xen/include/xen/pci.h
>> +++ b/xen/include/xen/pci.h
>> @@ -64,6 +64,13 @@ struct pci_dev {
>>      const u8 devfn;
>>      struct pci_dev_info info;
>>      struct arch_pci_dev arch;
>> +    struct {
>> +        s_time_t time;
>> +        unsigned int threshold;
>> +#define PT_FAULT_THRESHOLD_PRIV  10
>> +#define PT_FAULT_THRESHOLD_UNPRIV 3
>> +        unsigned int count;
>> +    } fault;
>>      u64 vf_rlen[6];
>>  };
>>  
>> @@ -107,6 +114,7 @@ int pci_hide_device(int bus, int devfn);
>>  struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);
>>  struct pci_dev *pci_get_pdev_by_domain(
>>      struct domain *, int seg, int bus, int devfn);
>> +void pci_check_disable_device(u16 seg, u8 bus, u8 devfn);
>>  
>>  uint8_t pci_conf_read8(
>>      unsigned int seg, unsigned int bus, unsigned int dev, unsigned int 
> func,
>> 
>> 
> 
>> IOMMU: don't immediately disable bus mastering on faults
>> 
>> Instead, give the owning domain at least a small opportunity of fixing
>> things up, and allow for rare faults to not bring down the device at
>> all. The amount of faults tolerated within a given time period (all
>> numbers are made up with no specific rationale) is higher for Dom0 than
>> for DomU-s.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> 
>> --- a/xen/drivers/passthrough/amd/iommu_init.c
>> +++ b/xen/drivers/passthrough/amd/iommu_init.c
>> @@ -566,7 +566,7 @@ static hw_irq_controller iommu_maskable_
>>  
>>  static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
>>  {
>> -    u16 domain_id, device_id, bdf, cword, flags;
>> +    u16 domain_id, device_id, bdf, flags;
>>      u32 code;
>>      u64 *addr;
>>      int count = 0;
>> @@ -620,18 +620,10 @@ static void parse_event_log_entry(struct
>>                 "fault address = %#"PRIx64", flags = %#x\n",
>>                 event_str[code-1], domain_id, device_id, *addr, flags);
>>  
>> -        /* Tell the device to stop DMAing; we can't rely on the guest to
>> -         * control it for us. */
>>          for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ )
>>              if ( get_dma_requestor_id(iommu->seg, bdf) == device_id )
>> -            {
>> -                cword = pci_conf_read16(iommu->seg, PCI_BUS(bdf),
>> -                                        PCI_SLOT(bdf), PCI_FUNC(bdf),
>> -                                        PCI_COMMAND);
>> -                pci_conf_write16(iommu->seg, PCI_BUS(bdf), PCI_SLOT(bdf),
>> -                                 PCI_FUNC(bdf), PCI_COMMAND, 
>> -                                 cword & ~PCI_COMMAND_MASTER);
>> -            }
>> +                pci_check_disable_device(iommu->seg, PCI_BUS(bdf),
>> +                                         PCI_DEVFN2(bdf));
>>      }
>>      else
>>      {
>> --- a/xen/drivers/passthrough/iommu.c
>> +++ b/xen/drivers/passthrough/iommu.c
>> @@ -215,6 +215,7 @@ static int device_assigned(u16 seg, u8 b
>>  static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
>>  {
>>      struct hvm_iommu *hd = domain_hvm_iommu(d);
>> +    struct pci_dev *pdev;
>>      int rc = 0;
>>  
>>      if ( !iommu_enabled || !hd->platform_ops )
>> @@ -228,6 +229,13 @@ static int assign_device(struct domain *
>>          return -EXDEV;
>>  
>>      spin_lock(&pcidevs_lock);
>> +    pdev = pci_get_pdev(seg, bus, devfn);
>> +    if ( pdev )
>> +    {
>> +        pdev->fault.threshold = PT_FAULT_THRESHOLD_UNPRIV;
>> +        pdev->fault.count     = 0;
>> +    }
>> +
>>      if ( (rc = hd->platform_ops->assign_device(d, seg, bus, devfn)) )
>>          goto done;
>>  
>> @@ -239,6 +247,8 @@ static int assign_device(struct domain *
>>          goto done;
>>      }
>>  done:
>> +    if ( pdev && pdev->domain != d )
>> +        pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>>      spin_unlock(&pcidevs_lock);
>>      return rc;
>>  }
>> @@ -379,6 +389,9 @@ int deassign_device(struct domain *d, u1
>>          return ret;
>>      }
>>  
>> +    pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>> +    pdev->fault.count     = 0;
>> +
>>      if ( !has_arch_pdevs(d) && need_iommu(d) )
>>      {
>>          d->need_iommu = 0;
>> --- a/xen/drivers/passthrough/pci.c
>> +++ b/xen/drivers/passthrough/pci.c
>> @@ -137,6 +137,7 @@ static struct pci_dev *alloc_pdev(struct
>>      *((u8*) &pdev->bus) = bus;
>>      *((u8*) &pdev->devfn) = devfn;
>>      pdev->domain = NULL;
>> +    pdev->fault.threshold = PT_FAULT_THRESHOLD_PRIV;
>>      INIT_LIST_HEAD(&pdev->msi_list);
>>      list_add(&pdev->alldevs_list, &pseg->alldevs_list);
>>      spin_lock_init(&pdev->msix_table_lock);
>> @@ -672,6 +673,36 @@ int __init pci_device_detect(u16 seg, u8
>>      return 1;
>>  }
>>  
>> +void pci_check_disable_device(u16 seg, u8 bus, u8 devfn)
>> +{
>> +    struct pci_dev *pdev;
>> +    s_time_t now = NOW();
>> +    u16 cword;
>> +
>> +    spin_lock(&pcidevs_lock);
>> +    pdev = pci_get_pdev(seg, bus, devfn);
>> +    if ( pdev )
>> +    {
>> +        if ( now < pdev->fault.time ||
>> +             now - pdev->fault.time > MILLISECS(10) )
>> +            pdev->fault.count >>= 1;
>> +        pdev->fault.time = now;
>> +        if ( ++pdev->fault.count < pdev->fault.threshold )
>> +            pdev = NULL;
>> +    }
>> +    spin_unlock(&pcidevs_lock);
>> +
>> +    if ( !pdev )
>> +        return;
>> +
>> +    /* Tell the device to stop DMAing; we can't rely on the guest to
>> +     * control it for us. */
>> +    cword = pci_conf_read16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
>> +                            PCI_COMMAND);
>> +    pci_conf_write16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
>> +                     PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
>> +}
>> +
>>  /*
>>   * scan pci devices to add all existed PCI devices to alldevs_list,
>>   * and setup pci hierarchy in array bus2bridge.
>> --- a/xen/drivers/passthrough/vtd/iommu.c
>> +++ b/xen/drivers/passthrough/vtd/iommu.c
>> @@ -917,7 +917,7 @@ static void __do_iommu_page_fault(struct
>>      while (1)
>>      {
>>          u8 fault_reason;
>> -        u16 source_id, cword;
>> +        u16 source_id;
>>          u32 data;
>>          u64 guest_addr;
>>          int type;
>> @@ -950,14 +950,8 @@ static void __do_iommu_page_fault(struct
>>          iommu_page_fault_do_one(iommu, type, fault_reason,
>>                                  source_id, guest_addr);
>>  
>> -        /* Tell the device to stop DMAing; we can't rely on the guest to
>> -         * control it for us. */
>> -        cword = pci_conf_read16(iommu->intel->drhd->segment,
>> -                                PCI_BUS(source_id), PCI_SLOT(source_id),
>> -                                PCI_FUNC(source_id), PCI_COMMAND);
>> -        pci_conf_write16(iommu->intel->drhd->segment, PCI_BUS(source_id),
>> -                         PCI_SLOT(source_id), PCI_FUNC(source_id),
>> -                         PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
>> +        pci_check_disable_device(iommu->intel->drhd->segment,
>> +                                 PCI_BUS(source_id), 
> PCI_DEVFN2(source_id));
>>  
>>          fault_index++;
>>          if ( fault_index > cap_num_fault_regs(iommu->cap) )
>> --- a/xen/include/xen/pci.h
>> +++ b/xen/include/xen/pci.h
>> @@ -64,6 +64,13 @@ struct pci_dev {
>>      const u8 devfn;
>>      struct pci_dev_info info;
>>      struct arch_pci_dev arch;
>> +    struct {
>> +        s_time_t time;
>> +        unsigned int threshold;
>> +#define PT_FAULT_THRESHOLD_PRIV  10
>> +#define PT_FAULT_THRESHOLD_UNPRIV 3
>> +        unsigned int count;
>> +    } fault;
>>      u64 vf_rlen[6];
>>  };
>>  
>> @@ -107,6 +114,7 @@ int pci_hide_device(int bus, int devfn);
>>  struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);
>>  struct pci_dev *pci_get_pdev_by_domain(
>>      struct domain *, int seg, int bus, int devfn);
>> +void pci_check_disable_device(u16 seg, u8 bus, u8 devfn);
>>  
>>  uint8_t pci_conf_read8(
>>      unsigned int seg, unsigned int bus, unsigned int dev, unsigned int 
> func,



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 13:48:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 13:48:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWSSX-0007kF-Bi; Thu, 08 Nov 2012 13:47:53 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Philippe.Simonet@swisscom.com>) id 1TWSSW-0007k9-N7
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 13:47:52 +0000
Received: from [85.158.139.83:36348] by server-16.bemta-5.messagelabs.com id
	73/45-04786-708BB905; Thu, 08 Nov 2012 13:47:51 +0000
X-Env-Sender: Philippe.Simonet@swisscom.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1352382471!29641660!1
X-Originating-IP: [193.222.81.100]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkzLjIyMi44MS4xMDAgPT4gOTk5OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14964 invoked from network); 8 Nov 2012 13:47:51 -0000
Received: from outmail100.swisscom.com (HELO mail.swisscom.com)
	(193.222.81.100)
	by server-10.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 13:47:51 -0000
Received: by mail.swisscom.com; Thu, 8 Nov 2012 14:47:27 +0100
From: <Philippe.Simonet@swisscom.com>
To: <mrsanna1@gmail.com>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
	50 minutes" bug.
Thread-Index: Ac280B6CWUiPuRIkTkmJRMKB8zdEqQAEnBqAAAkCjQAAIYFoAAAKGgkA
Date: Thu, 8 Nov 2012 13:47:26 +0000
Message-ID: <FF93AF260AC2BB499A119CC65B092CF73151843F@sg000713.corproot.net>
References: <1352294551.12977.61.camel@hastur.hellion.org.uk>
	<CCC04D8E.51A0E%keir@xen.org>
	<509B8BF802000078000A72A3@nat28.tlf.novell.com>
In-Reply-To: <509B8BF802000078000A72A3@nat28.tlf.novell.com>
Accept-Language: en-US, de-CH
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.65.122.57]
MIME-Version: 1.0
Cc: keir@xen.org, 599161@bugs.debian.org, xen-devel@lists.xen.org,
	JBeulich@suse.com, ijc@hellion.org.uk
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi Mauro, 

that's a question for you : 

> Philippe, could you clarify again what CPU model(s) this is being observed on
> (the long times between individual steps forward with this problem perhaps
> warrant repeating the basics each time, as it's otherwise quite cumbersome
> to always look up old pieces of information).

can you provide this information ? 
	cat /proc/cpuinfo 	
	cat /proc/meminfo
	hardware information (manufacturer, model, urls, ...)

Thanks, Philippe


> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Thursday, November 08, 2012 10:40 AM
> To: Simonet Philippe, ITS-OUS-OP-IFM-NW-IPE; Keir Fraser
> Cc: 599161@bugs.debian.org; mrsanna1@gmail.com; Ian Campbell; xen-
> devel@lists.xen.org
> Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
> minutes" bug.
> 
> >>> On 07.11.12 at 18:40, Keir Fraser <keir@xen.org> wrote:
> > On 07/11/2012 13:22, "Ian Campbell" <ijc@hellion.org.uk> wrote:
> >
> >>>> (XEN) XXX plt_overflow: plt_now=5ece12d34128
> plt_wrap=5ece12d09306
> >>>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
> >>>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
> >>>> tsc_stamp=e3839fcb0273
> >>>
> >>> (below is the complete xm dmesg output)
> >>>
> >>> did that help you ? do you need more info ?
> >>
> >> I'll leave this to Keir (who wrote the debugging patch) to answer but
> >> it looks to me like it should be useful!
> >
> > I'm scratching my head. plt_wrap is earlier than plt_now, which should
> > be impossible. plt_stamp64 oddly has low 32 bits identical to
> > new_stamp. That seems very very improbable!
> 
> Is it? My understanding was that plt_stamp64 is just a software extension to
> the more narrow HW counter, and hence the low plt_mask bits would always
> be expected to be identical.
> 
> The plt_wrap < plt_now thing of course is entirely unexplainable to me too:
> Considering that plt_scale doesn't change at all post- boot, apart from
> memory corruption I could only see an memory access ordering problem to
> be the reason (platform_timer_stamp and/or stime_platform_stamp
> changing despite platform_timer_lock being held. So maybe taking a
> snapshot of all three static values involved in the calculation in
> __read_platform_stime() between acquiring the lock and the first call to
> __read_platform_stime(), and printing them together with the "live" values
> in a second
> printk() after the one your original patch added could rule that out.
> 
> But the box doesn't even seem to be NUMA (of course it also doesn't help
> that the log level was kept restricted - hint, hint, Philippe), not does there
> appear to be any S3 cycle or pCPU bring-up/-down in between...
> 
> Philippe, could you clarify again what CPU model(s) this is being observed on
> (the long times between individual steps forward with this problem perhaps
> warrant repeating the basics each time, as it's otherwise quite cumbersome
> to always look up old pieces of information).
> 
> > I wonder whether the overflow handling should just be removed, or made
> > conditional on a command-line parameter, or on the 32-bit platform
> > counter being at least somewhat likely to overflow before a softirq
> > occurs -- it seems lots of systems are using 14MHz HPET, and that
> > gives us a couple of minutes for the plt_overflow softirq to do its work
> before overflow occurs.
> > I think we would notice that outage in other ways. :)
> 
> Iirc we added this for a good reason - to cover the, however unlikely, event
> of Xen running for very long without preemption.
> Presumably most of the cases got fixed meanwhile, and indeed a
> wraparound time on the order of minutes should make this superfluous, but
> as the case here shows that code did spot a severe anomaly (whatever that
> may turn out to be).
> 
> Also recall that there are HPET implementations around that tick at a much
> higher frequency than 14MHz.
> 
> So unless we finally reach the understanding that the code is flawed, I would
> rather want to keep it.
> 
> Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 13:48:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 13:48:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWSSX-0007kF-Bi; Thu, 08 Nov 2012 13:47:53 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Philippe.Simonet@swisscom.com>) id 1TWSSW-0007k9-N7
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 13:47:52 +0000
Received: from [85.158.139.83:36348] by server-16.bemta-5.messagelabs.com id
	73/45-04786-708BB905; Thu, 08 Nov 2012 13:47:51 +0000
X-Env-Sender: Philippe.Simonet@swisscom.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1352382471!29641660!1
X-Originating-IP: [193.222.81.100]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkzLjIyMi44MS4xMDAgPT4gOTk5OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14964 invoked from network); 8 Nov 2012 13:47:51 -0000
Received: from outmail100.swisscom.com (HELO mail.swisscom.com)
	(193.222.81.100)
	by server-10.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 13:47:51 -0000
Received: by mail.swisscom.com; Thu, 8 Nov 2012 14:47:27 +0100
From: <Philippe.Simonet@swisscom.com>
To: <mrsanna1@gmail.com>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
	50 minutes" bug.
Thread-Index: Ac280B6CWUiPuRIkTkmJRMKB8zdEqQAEnBqAAAkCjQAAIYFoAAAKGgkA
Date: Thu, 8 Nov 2012 13:47:26 +0000
Message-ID: <FF93AF260AC2BB499A119CC65B092CF73151843F@sg000713.corproot.net>
References: <1352294551.12977.61.camel@hastur.hellion.org.uk>
	<CCC04D8E.51A0E%keir@xen.org>
	<509B8BF802000078000A72A3@nat28.tlf.novell.com>
In-Reply-To: <509B8BF802000078000A72A3@nat28.tlf.novell.com>
Accept-Language: en-US, de-CH
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.65.122.57]
MIME-Version: 1.0
Cc: keir@xen.org, 599161@bugs.debian.org, xen-devel@lists.xen.org,
	JBeulich@suse.com, ijc@hellion.org.uk
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi Mauro, 

that's a question for you : 

> Philippe, could you clarify again what CPU model(s) this is being observed on
> (the long times between individual steps forward with this problem perhaps
> warrant repeating the basics each time, as it's otherwise quite cumbersome
> to always look up old pieces of information).

can you provide this information ? 
	cat /proc/cpuinfo 	
	cat /proc/meminfo
	hardware information (manufacturer, model, urls, ...)

Thanks, Philippe


> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Thursday, November 08, 2012 10:40 AM
> To: Simonet Philippe, ITS-OUS-OP-IFM-NW-IPE; Keir Fraser
> Cc: 599161@bugs.debian.org; mrsanna1@gmail.com; Ian Campbell; xen-
> devel@lists.xen.org
> Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
> minutes" bug.
> 
> >>> On 07.11.12 at 18:40, Keir Fraser <keir@xen.org> wrote:
> > On 07/11/2012 13:22, "Ian Campbell" <ijc@hellion.org.uk> wrote:
> >
> >>>> (XEN) XXX plt_overflow: plt_now=5ece12d34128
> plt_wrap=5ece12d09306
> >>>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
> >>>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
> >>>> tsc_stamp=e3839fcb0273
> >>>
> >>> (below is the complete xm dmesg output)
> >>>
> >>> did that help you ? do you need more info ?
> >>
> >> I'll leave this to Keir (who wrote the debugging patch) to answer but
> >> it looks to me like it should be useful!
> >
> > I'm scratching my head. plt_wrap is earlier than plt_now, which should
> > be impossible. plt_stamp64 oddly has low 32 bits identical to
> > new_stamp. That seems very very improbable!
> 
> Is it? My understanding was that plt_stamp64 is just a software extension to
> the more narrow HW counter, and hence the low plt_mask bits would always
> be expected to be identical.
> 
> The plt_wrap < plt_now thing of course is entirely unexplainable to me too:
> Considering that plt_scale doesn't change at all post- boot, apart from
> memory corruption I could only see an memory access ordering problem to
> be the reason (platform_timer_stamp and/or stime_platform_stamp
> changing despite platform_timer_lock being held. So maybe taking a
> snapshot of all three static values involved in the calculation in
> __read_platform_stime() between acquiring the lock and the first call to
> __read_platform_stime(), and printing them together with the "live" values
> in a second
> printk() after the one your original patch added could rule that out.
> 
> But the box doesn't even seem to be NUMA (of course it also doesn't help
> that the log level was kept restricted - hint, hint, Philippe), not does there
> appear to be any S3 cycle or pCPU bring-up/-down in between...
> 
> Philippe, could you clarify again what CPU model(s) this is being observed on
> (the long times between individual steps forward with this problem perhaps
> warrant repeating the basics each time, as it's otherwise quite cumbersome
> to always look up old pieces of information).
> 
> > I wonder whether the overflow handling should just be removed, or made
> > conditional on a command-line parameter, or on the 32-bit platform
> > counter being at least somewhat likely to overflow before a softirq
> > occurs -- it seems lots of systems are using 14MHz HPET, and that
> > gives us a couple of minutes for the plt_overflow softirq to do its work
> before overflow occurs.
> > I think we would notice that outage in other ways. :)
> 
> Iirc we added this for a good reason - to cover the, however unlikely, event
> of Xen running for very long without preemption.
> Presumably most of the cases got fixed meanwhile, and indeed a
> wraparound time on the order of minutes should make this superfluous, but
> as the case here shows that code did spot a severe anomaly (whatever that
> may turn out to be).
> 
> Also recall that there are HPET implementations around that tick at a much
> higher frequency than 14MHz.
> 
> So unless we finally reach the understanding that the code is flawed, I would
> rather want to keep it.
> 
> Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 13:49:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 13:49:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWSTc-0007pd-Pu; Thu, 08 Nov 2012 13:49:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWSTb-0007pS-O7
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 13:48:59 +0000
Received: from [85.158.138.51:28835] by server-10.bemta-3.messagelabs.com id
	5C/78-19806-648BB905; Thu, 08 Nov 2012 13:48:54 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1352382533!29228141!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30167 invoked from network); 8 Nov 2012 13:48:53 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-174.messagelabs.com with SMTP;
	8 Nov 2012 13:48:53 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 13:48:53 +0000
Message-Id: <509BC65402000078000A73A4@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 13:48:52 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir@xen.org>
References: <509B8DC102000078000A72BA@nat28.tlf.novell.com>
	<CCC13EDB.51B6E%keir@xen.org>
In-Reply-To: <CCC13EDB.51B6E%keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 08.11.12 at 11:50, Keir Fraser <keir@xen.org> wrote:
> On 08/11/2012 09:47, "Jan Beulich" <JBeulich@suse.com> wrote:
>> The only thing that indeed is - on non-preemptible kernels - done
>> only on exit to user mode is the eventual entering of the scheduler.
> 
> That alone may still be an argument for restricting the batch size from the
> toolstack?

Yes, this clearly prohibits unlimited batches. But not being able to
schedule should be less restrictive than not being able to run
softirqs, so I'd still put under question whether the limit shouldn't
be bumped.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 13:49:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 13:49:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWSTc-0007pd-Pu; Thu, 08 Nov 2012 13:49:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWSTb-0007pS-O7
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 13:48:59 +0000
Received: from [85.158.138.51:28835] by server-10.bemta-3.messagelabs.com id
	5C/78-19806-648BB905; Thu, 08 Nov 2012 13:48:54 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1352382533!29228141!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30167 invoked from network); 8 Nov 2012 13:48:53 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-174.messagelabs.com with SMTP;
	8 Nov 2012 13:48:53 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 13:48:53 +0000
Message-Id: <509BC65402000078000A73A4@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 13:48:52 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir@xen.org>
References: <509B8DC102000078000A72BA@nat28.tlf.novell.com>
	<CCC13EDB.51B6E%keir@xen.org>
In-Reply-To: <CCC13EDB.51B6E%keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 08.11.12 at 11:50, Keir Fraser <keir@xen.org> wrote:
> On 08/11/2012 09:47, "Jan Beulich" <JBeulich@suse.com> wrote:
>> The only thing that indeed is - on non-preemptible kernels - done
>> only on exit to user mode is the eventual entering of the scheduler.
> 
> That alone may still be an argument for restricting the batch size from the
> toolstack?

Yes, this clearly prohibits unlimited batches. But not being able to
schedule should be less restrictive than not being able to run
softirqs, so I'd still put under question whether the limit shouldn't
be bumped.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 13:53:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 13:53:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWSXy-00087t-MO; Thu, 08 Nov 2012 13:53:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWSXx-00087n-0e
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 13:53:29 +0000
Received: from [193.109.254.147:27553] by server-1.bemta-14.messagelabs.com id
	21/D7-25314-859BB905; Thu, 08 Nov 2012 13:53:28 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1352382807!3251118!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15159 invoked from network); 8 Nov 2012 13:53:27 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-27.messagelabs.com with SMTP;
	8 Nov 2012 13:53:27 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 13:53:26 +0000
Message-Id: <509BC76602000078000A73C7@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 13:53:26 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir@xen.org>
References: <509B8BF802000078000A72A3@nat28.tlf.novell.com>
	<CCC13C1C.51B65%keir@xen.org>
In-Reply-To: <CCC13C1C.51B65%keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Philippe.Simonet@swisscom.com, 599161@bugs.debian.org,
	xen-devel@lists.xen.org, mrsanna1@gmail.com,
	Ian Campbell <ijc@hellion.org.uk>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 08.11.12 at 11:38, Keir Fraser <keir@xen.org> wrote:
> On 08/11/2012 09:39, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>>>>>> (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
>>>>>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
>>>>>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
>>>>>> tsc_stamp=e3839fcb0273
>>>>> 
>>>>> (below is the complete xm dmesg output)
>>>>> 
>>>>> did that help you ? do you need more info ?
>>>> 
>>>> I'll leave this to Keir (who wrote the debugging patch) to answer but it
>>>> looks to me like it should be useful!
>>> 
>>> I'm scratching my head. plt_wrap is earlier than plt_now, which should be
>>> impossible. plt_stamp64 oddly has low 32 bits identical to new_stamp. That
>>> seems very very improbable!
>> 
>> Is it? My understanding was that plt_stamp64 is just a software
>> extension to the more narrow HW counter, and hence the low
>> plt_mask bits would always be expected to be identical.
> 
> No, plt_stamp is simply the HW counter time at which plt_stamp64 was last
> brought up to date. Hence plt_stamp64 is updated as:
>  plt_stamp64 += (new_stamp - old_stamp) & plt_mask;

I concur: Given that what old_stamp is here was new_stamp for
the last update, we should simply have

stamp64 = s0 + (s1 - s0) + (s2 - s1) + ...

(of course with the mask applied on each addend), which (for the
low bits) is the same as just new_stamp.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 13:53:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 13:53:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWSXy-00087t-MO; Thu, 08 Nov 2012 13:53:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWSXx-00087n-0e
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 13:53:29 +0000
Received: from [193.109.254.147:27553] by server-1.bemta-14.messagelabs.com id
	21/D7-25314-859BB905; Thu, 08 Nov 2012 13:53:28 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1352382807!3251118!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15159 invoked from network); 8 Nov 2012 13:53:27 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-27.messagelabs.com with SMTP;
	8 Nov 2012 13:53:27 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 13:53:26 +0000
Message-Id: <509BC76602000078000A73C7@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 13:53:26 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir@xen.org>
References: <509B8BF802000078000A72A3@nat28.tlf.novell.com>
	<CCC13C1C.51B65%keir@xen.org>
In-Reply-To: <CCC13C1C.51B65%keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Philippe.Simonet@swisscom.com, 599161@bugs.debian.org,
	xen-devel@lists.xen.org, mrsanna1@gmail.com,
	Ian Campbell <ijc@hellion.org.uk>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 08.11.12 at 11:38, Keir Fraser <keir@xen.org> wrote:
> On 08/11/2012 09:39, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>>>>>> (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
>>>>>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
>>>>>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
>>>>>> tsc_stamp=e3839fcb0273
>>>>> 
>>>>> (below is the complete xm dmesg output)
>>>>> 
>>>>> did that help you ? do you need more info ?
>>>> 
>>>> I'll leave this to Keir (who wrote the debugging patch) to answer but it
>>>> looks to me like it should be useful!
>>> 
>>> I'm scratching my head. plt_wrap is earlier than plt_now, which should be
>>> impossible. plt_stamp64 oddly has low 32 bits identical to new_stamp. That
>>> seems very very improbable!
>> 
>> Is it? My understanding was that plt_stamp64 is just a software
>> extension to the more narrow HW counter, and hence the low
>> plt_mask bits would always be expected to be identical.
> 
> No, plt_stamp is simply the HW counter time at which plt_stamp64 was last
> brought up to date. Hence plt_stamp64 is updated as:
>  plt_stamp64 += (new_stamp - old_stamp) & plt_mask;

I concur: Given that what old_stamp is here was new_stamp for
the last update, we should simply have

stamp64 = s0 + (s1 - s0) + (s2 - s1) + ...

(of course with the mask applied on each addend), which (for the
low bits) is the same as just new_stamp.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 14:05:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 14:05:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWSj9-0008Mo-SE; Thu, 08 Nov 2012 14:05:03 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWSj9-0008Mj-1G
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 14:05:03 +0000
Received: from [85.158.139.211:16815] by server-9.bemta-5.messagelabs.com id
	38/4D-29295-E0CBB905; Thu, 08 Nov 2012 14:05:02 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1352383501!19352403!1
X-Originating-IP: [74.125.82.41]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9406 invoked from network); 8 Nov 2012 14:05:01 -0000
Received: from mail-wg0-f41.google.com (HELO mail-wg0-f41.google.com)
	(74.125.82.41)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 14:05:01 -0000
Received: by mail-wg0-f41.google.com with SMTP id ds1so3901709wgb.2
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 06:05:01 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=zK0Kf+iHbT+UnN2E9BFQzqHfYHyI9pR4G1wAaDlWqLE=;
	b=WwWmubzSAtQhUb7cBlO8zav7bqBzJr/xI6jQR/9l3ua54+M3uquIkfdncQpfg1Mmvu
	L930tCo9aovVaxtawuiNIs7ruXEiGsILYs5wo4cjisRx3pv/PUjtvTKjo5VJwOPezR7r
	fgTbCxQ0E7vvh1iZHl1taMvt9FwU/HrYodWgaZf2Tc+eY2CnvQUalj1p/NZtrjH4pOyi
	1Evck3yqyDYumY1m+mfM1mQ2j8hpk/VPe80xxMXGLGyJu2g1OO6Vo0uzF4n+1XAKQf4x
	wSq7UPi4oLczI6QjoaLyw7HFSeY4eVmgBRKNKXpbyudGUZZ7diSz2Qq8DoVCVOpUEkN6
	dflw==
Received: by 10.180.94.169 with SMTP id dd9mr29799265wib.14.1352383501116;
	Thu, 08 Nov 2012 06:05:01 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id hv4sm7496330wib.0.2012.11.08.06.04.59
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 06:05:00 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 14:04:52 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <CCC16C84.51B96%keir@xen.org>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
	minutes" bug.
Thread-Index: Ac29ugWmob2jFIUQk0yctPCf+qhDzQ==
In-Reply-To: <509BC76602000078000A73C7@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Philippe.Simonet@swisscom.com, 599161@bugs.debian.org,
	xen-devel@lists.xen.org, mrsanna1@gmail.com,
	Ian Campbell <ijc@hellion.org.uk>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 13:53, "Jan Beulich" <JBeulich@suse.com> wrote:

>>> Is it? My understanding was that plt_stamp64 is just a software
>>> extension to the more narrow HW counter, and hence the low
>>> plt_mask bits would always be expected to be identical.
>> 
>> No, plt_stamp is simply the HW counter time at which plt_stamp64 was last
>> brought up to date. Hence plt_stamp64 is updated as:
>>  plt_stamp64 += (new_stamp - old_stamp) & plt_mask;
> 
> I concur

Well, no, you don't really. You're about to point out the flaw in my
reasoning...

> : Given that what old_stamp is here was new_stamp for
> the last update, we should simply have
> 
> stamp64 = s0 + (s1 - s0) + (s2 - s1) + ...
> 
> (of course with the mask applied on each addend), which (for the
> low bits) is the same as just new_stamp.

Very good point. Silly me. Then the observed value of plt_stamp64 makes
perfect sense.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 14:05:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 14:05:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWSj9-0008Mo-SE; Thu, 08 Nov 2012 14:05:03 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWSj9-0008Mj-1G
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 14:05:03 +0000
Received: from [85.158.139.211:16815] by server-9.bemta-5.messagelabs.com id
	38/4D-29295-E0CBB905; Thu, 08 Nov 2012 14:05:02 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1352383501!19352403!1
X-Originating-IP: [74.125.82.41]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9406 invoked from network); 8 Nov 2012 14:05:01 -0000
Received: from mail-wg0-f41.google.com (HELO mail-wg0-f41.google.com)
	(74.125.82.41)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 14:05:01 -0000
Received: by mail-wg0-f41.google.com with SMTP id ds1so3901709wgb.2
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 06:05:01 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=zK0Kf+iHbT+UnN2E9BFQzqHfYHyI9pR4G1wAaDlWqLE=;
	b=WwWmubzSAtQhUb7cBlO8zav7bqBzJr/xI6jQR/9l3ua54+M3uquIkfdncQpfg1Mmvu
	L930tCo9aovVaxtawuiNIs7ruXEiGsILYs5wo4cjisRx3pv/PUjtvTKjo5VJwOPezR7r
	fgTbCxQ0E7vvh1iZHl1taMvt9FwU/HrYodWgaZf2Tc+eY2CnvQUalj1p/NZtrjH4pOyi
	1Evck3yqyDYumY1m+mfM1mQ2j8hpk/VPe80xxMXGLGyJu2g1OO6Vo0uzF4n+1XAKQf4x
	wSq7UPi4oLczI6QjoaLyw7HFSeY4eVmgBRKNKXpbyudGUZZ7diSz2Qq8DoVCVOpUEkN6
	dflw==
Received: by 10.180.94.169 with SMTP id dd9mr29799265wib.14.1352383501116;
	Thu, 08 Nov 2012 06:05:01 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id hv4sm7496330wib.0.2012.11.08.06.04.59
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 06:05:00 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 14:04:52 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <CCC16C84.51B96%keir@xen.org>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
	minutes" bug.
Thread-Index: Ac29ugWmob2jFIUQk0yctPCf+qhDzQ==
In-Reply-To: <509BC76602000078000A73C7@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Philippe.Simonet@swisscom.com, 599161@bugs.debian.org,
	xen-devel@lists.xen.org, mrsanna1@gmail.com,
	Ian Campbell <ijc@hellion.org.uk>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 13:53, "Jan Beulich" <JBeulich@suse.com> wrote:

>>> Is it? My understanding was that plt_stamp64 is just a software
>>> extension to the more narrow HW counter, and hence the low
>>> plt_mask bits would always be expected to be identical.
>> 
>> No, plt_stamp is simply the HW counter time at which plt_stamp64 was last
>> brought up to date. Hence plt_stamp64 is updated as:
>>  plt_stamp64 += (new_stamp - old_stamp) & plt_mask;
> 
> I concur

Well, no, you don't really. You're about to point out the flaw in my
reasoning...

> : Given that what old_stamp is here was new_stamp for
> the last update, we should simply have
> 
> stamp64 = s0 + (s1 - s0) + (s2 - s1) + ...
> 
> (of course with the mask applied on each addend), which (for the
> low bits) is the same as just new_stamp.

Very good point. Silly me. Then the observed value of plt_stamp64 makes
perfect sense.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 14:20:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 14:20:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWSyA-0000Aa-2k; Thu, 08 Nov 2012 14:20:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWSy8-0000AQ-BT
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 14:20:32 +0000
Received: from [85.158.143.99:32280] by server-3.bemta-4.messagelabs.com id
	9B/F0-06841-FAFBB905; Thu, 08 Nov 2012 14:20:31 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352384430!28583181!1
X-Originating-IP: [209.85.212.179]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5928 invoked from network); 8 Nov 2012 14:20:30 -0000
Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com)
	(209.85.212.179)
	by server-3.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 14:20:30 -0000
Received: by mail-wi0-f179.google.com with SMTP id hm6so964845wib.14
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 06:20:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=3u5WtJh4ciLB70YlAZWI0wRreH7uVHkBda3/nZcLpa4=;
	b=NV5V8o6tcFrkkFHrWlBZhf7jmt3neeaj4MUOdpc/9+VNj5v6eXKkiU/CsShqytLlq9
	umM2JyA5ZvNXKdDNMMC5mJWF6lormyrvpGCvNgUzanbkbvwkMQdL8tNRxhkJuGlGIbB1
	z6Miukq1yzE0tq15u1hPpyLFnb19hiKeQYhlbjIF5VqJjpXkD/ybaWhXBegQk8H+ldjV
	CeWJwdslt8OMYPTcb9u9btgAvnkMKdY6HYUsR2Mh21TVtQ1BTh9R11ZcvMjJJnLe4pDT
	SLzxNBUqJ3zc2N179ZY/UjLUHLDGI28kQ9PMooG2OMcAZhmR9h3UEjiurnrVPupQME/0
	ey/w==
Received: by 10.180.101.165 with SMTP id fh5mr13610412wib.7.1352384429839;
	Thu, 08 Nov 2012 06:20:29 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id fg6sm7538939wib.3.2012.11.08.06.20.26
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 06:20:29 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 14:20:14 +0000
From: Keir Fraser <keir@xen.org>
To: Ian Campbell <ijc@hellion.org.uk>,
	<Philippe.Simonet@swisscom.com>
Message-ID: <CCC1701E.51BA0%keir@xen.org>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
	minutes" bug.
Thread-Index: Ac29DvrjqeBG3H6QAUStnBaJP3k+kwArTBTs
In-Reply-To: <CCC04D8E.51A0E%keir@xen.org>
Mime-version: 1.0
Cc: 599161@bugs.debian.org, mrsanna1@gmail.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 07/11/2012 17:40, "Keir Fraser" <keir@xen.org> wrote:

> On 07/11/2012 13:22, "Ian Campbell" <ijc@hellion.org.uk> wrote:
> 
>>>> (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
>>>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
>>>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
>>>> tsc_stamp=e3839fcb0273
>>> 
>>> (below is the complete xm dmesg output)
>>> 
>>> did that help you ? do you need more info ?
>> 
>> I'll leave this to Keir (who wrote the debugging patch) to answer but it
>> looks to me like it should be useful!
> 
> I'm scratching my head. plt_wrap is earlier than plt_now, which should be
> impossible. plt_stamp64 oddly has low 32 bits identical to new_stamp. That
> seems very very improbable!

Jan has pointed out that the value of plt_stamp64 makes perfect sense, and
will in fact always have low 32 bits identical to new_stamp. At least that
is explained.

So, the question is then why plt_now (== __read_platform_stime(15b800366a5))
is greater than plt_wrap (== __read_platform_stime(15c800366a5)). Perhaps
the scale_delta() logic is failing for some reason, but we do use it a lot
elsewhere!

 -- Keir

> I wonder whether the overflow handling should just be removed, or made
> conditional on a command-line parameter, or on the 32-bit platform counter
> being at least somewhat likely to overflow before a softirq occurs -- it
> seems lots of systems are using 14MHz HPET, and that gives us a couple of
> minutes for the plt_overflow softirq to do its work before overflow occurs.
> I think we would notice that outage in other ways. :)
> 
>  -- Keir
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 14:20:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 14:20:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWSyA-0000Aa-2k; Thu, 08 Nov 2012 14:20:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWSy8-0000AQ-BT
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 14:20:32 +0000
Received: from [85.158.143.99:32280] by server-3.bemta-4.messagelabs.com id
	9B/F0-06841-FAFBB905; Thu, 08 Nov 2012 14:20:31 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352384430!28583181!1
X-Originating-IP: [209.85.212.179]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5928 invoked from network); 8 Nov 2012 14:20:30 -0000
Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com)
	(209.85.212.179)
	by server-3.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 14:20:30 -0000
Received: by mail-wi0-f179.google.com with SMTP id hm6so964845wib.14
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 06:20:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=3u5WtJh4ciLB70YlAZWI0wRreH7uVHkBda3/nZcLpa4=;
	b=NV5V8o6tcFrkkFHrWlBZhf7jmt3neeaj4MUOdpc/9+VNj5v6eXKkiU/CsShqytLlq9
	umM2JyA5ZvNXKdDNMMC5mJWF6lormyrvpGCvNgUzanbkbvwkMQdL8tNRxhkJuGlGIbB1
	z6Miukq1yzE0tq15u1hPpyLFnb19hiKeQYhlbjIF5VqJjpXkD/ybaWhXBegQk8H+ldjV
	CeWJwdslt8OMYPTcb9u9btgAvnkMKdY6HYUsR2Mh21TVtQ1BTh9R11ZcvMjJJnLe4pDT
	SLzxNBUqJ3zc2N179ZY/UjLUHLDGI28kQ9PMooG2OMcAZhmR9h3UEjiurnrVPupQME/0
	ey/w==
Received: by 10.180.101.165 with SMTP id fh5mr13610412wib.7.1352384429839;
	Thu, 08 Nov 2012 06:20:29 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id fg6sm7538939wib.3.2012.11.08.06.20.26
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 06:20:29 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 14:20:14 +0000
From: Keir Fraser <keir@xen.org>
To: Ian Campbell <ijc@hellion.org.uk>,
	<Philippe.Simonet@swisscom.com>
Message-ID: <CCC1701E.51BA0%keir@xen.org>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
	minutes" bug.
Thread-Index: Ac29DvrjqeBG3H6QAUStnBaJP3k+kwArTBTs
In-Reply-To: <CCC04D8E.51A0E%keir@xen.org>
Mime-version: 1.0
Cc: 599161@bugs.debian.org, mrsanna1@gmail.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 07/11/2012 17:40, "Keir Fraser" <keir@xen.org> wrote:

> On 07/11/2012 13:22, "Ian Campbell" <ijc@hellion.org.uk> wrote:
> 
>>>> (XEN) XXX plt_overflow: plt_now=5ece12d34128 plt_wrap=5ece12d09306
>>>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
>>>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
>>>> tsc_stamp=e3839fcb0273
>>> 
>>> (below is the complete xm dmesg output)
>>> 
>>> did that help you ? do you need more info ?
>> 
>> I'll leave this to Keir (who wrote the debugging patch) to answer but it
>> looks to me like it should be useful!
> 
> I'm scratching my head. plt_wrap is earlier than plt_now, which should be
> impossible. plt_stamp64 oddly has low 32 bits identical to new_stamp. That
> seems very very improbable!

Jan has pointed out that the value of plt_stamp64 makes perfect sense, and
will in fact always have low 32 bits identical to new_stamp. At least that
is explained.

So, the question is then why plt_now (== __read_platform_stime(15b800366a5))
is greater than plt_wrap (== __read_platform_stime(15c800366a5)). Perhaps
the scale_delta() logic is failing for some reason, but we do use it a lot
elsewhere!

 -- Keir

> I wonder whether the overflow handling should just be removed, or made
> conditional on a command-line parameter, or on the 32-bit platform counter
> being at least somewhat likely to overflow before a softirq occurs -- it
> seems lots of systems are using 14MHz HPET, and that gives us a couple of
> minutes for the plt_overflow softirq to do its work before overflow occurs.
> I think we would notice that outage in other ways. :)
> 
>  -- Keir
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 14:23:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 14:23:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWT0g-0000Gv-Ko; Thu, 08 Nov 2012 14:23:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TWT0f-0000Gq-Nw
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 14:23:09 +0000
Received: from [85.158.139.83:10147] by server-11.bemta-5.messagelabs.com id
	9B/79-03409-D40CB905; Thu, 08 Nov 2012 14:23:09 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1352384588!29100032!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26502 invoked from network); 8 Nov 2012 14:23:08 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-15.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 14:23:08 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TWT0W-000Kqi-QZ; Thu, 08 Nov 2012 14:23:00 +0000
Date: Thu, 8 Nov 2012 14:23:00 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121108142300.GH76638@ocelot.phlegethon.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<509A94F002000078000A702A@nat28.tlf.novell.com>
	<20121108124633.GF76638@ocelot.phlegethon.org>
	<509BC5B402000078000A7396@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509BC5B402000078000A7396@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com,
	xen-devel <xen-devel@lists.xen.org>,
	Dario Faggioli <raistlin@linux.it>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH,
	v2] IOMMU: don't immediately disable bus mastering on faults
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 13:46 +0000 on 08 Nov (1352382372), Jan Beulich wrote:
> >>> On 08.11.12 at 13:46, Tim Deegan <tim@xen.org> wrote:
> > At 16:05 +0000 on 07 Nov (1352304352), Jan Beulich wrote:
> >> Instead, give the owning domain at least a small opportunity of fixing
> >> things up, and allow for rare faults to not bring down the device at
> >> all. The amount of faults tolerated within a given time period (all
> >> numbers are made up with no specific rationale) is higher for Dom0 than
> >> for DomU-s.
> >> 
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> > 
> > Looks good to me, though I don't think dom0 should have any special
> > treatment here.  I'd be inclined to set the threshold to 10 for
> > everyone. 
> 
> No problem. I'll wait for the IOMMU folks to give some feedback,
> and either re-submit (if further changes are requested), or commit
> with their acks (and the change as you suggest, if they're in
> agreement).
> 
> Of course, if they disagree we'll have to get to a common position
> anyway first.
> 
> If no other changes are requested, do I take the above as an
> "ack-with-that-change"?

Yes, please do.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 14:23:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 14:23:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWT0g-0000Gv-Ko; Thu, 08 Nov 2012 14:23:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TWT0f-0000Gq-Nw
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 14:23:09 +0000
Received: from [85.158.139.83:10147] by server-11.bemta-5.messagelabs.com id
	9B/79-03409-D40CB905; Thu, 08 Nov 2012 14:23:09 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1352384588!29100032!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26502 invoked from network); 8 Nov 2012 14:23:08 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-15.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 14:23:08 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TWT0W-000Kqi-QZ; Thu, 08 Nov 2012 14:23:00 +0000
Date: Thu, 8 Nov 2012 14:23:00 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121108142300.GH76638@ocelot.phlegethon.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<509A94F002000078000A702A@nat28.tlf.novell.com>
	<20121108124633.GF76638@ocelot.phlegethon.org>
	<509BC5B402000078000A7396@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509BC5B402000078000A7396@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com,
	xen-devel <xen-devel@lists.xen.org>,
	Dario Faggioli <raistlin@linux.it>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH,
	v2] IOMMU: don't immediately disable bus mastering on faults
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 13:46 +0000 on 08 Nov (1352382372), Jan Beulich wrote:
> >>> On 08.11.12 at 13:46, Tim Deegan <tim@xen.org> wrote:
> > At 16:05 +0000 on 07 Nov (1352304352), Jan Beulich wrote:
> >> Instead, give the owning domain at least a small opportunity of fixing
> >> things up, and allow for rare faults to not bring down the device at
> >> all. The amount of faults tolerated within a given time period (all
> >> numbers are made up with no specific rationale) is higher for Dom0 than
> >> for DomU-s.
> >> 
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> > 
> > Looks good to me, though I don't think dom0 should have any special
> > treatment here.  I'd be inclined to set the threshold to 10 for
> > everyone. 
> 
> No problem. I'll wait for the IOMMU folks to give some feedback,
> and either re-submit (if further changes are requested), or commit
> with their acks (and the change as you suggest, if they're in
> agreement).
> 
> Of course, if they disagree we'll have to get to a common position
> anyway first.
> 
> If no other changes are requested, do I take the above as an
> "ack-with-that-change"?

Yes, please do.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 14:31:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 14:31:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWT87-0000U8-Hy; Thu, 08 Nov 2012 14:30:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>) id 1TWT86-0000U2-9J
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 14:30:50 +0000
Received: from [85.158.138.51:60243] by server-3.bemta-3.messagelabs.com id
	99/DD-31566-912CB905; Thu, 08 Nov 2012 14:30:49 +0000
X-Env-Sender: ijc@hellion.org.uk
X-Msg-Ref: server-15.tower-174.messagelabs.com!1352385048!27334990!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24998 invoked from network); 8 Nov 2012 14:30:48 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Nov 2012 14:30:48 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1TWT84-0006pn-1h; Thu, 08 Nov 2012 14:30:48 +0000
Received: from yog-sothoth.hellion.org.uk ([192.168.1.1] helo=[127.0.0.1])
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1TWT80-00065M-S0; Thu, 08 Nov 2012 14:30:47 +0000
Message-ID: <1352384924.12977.103.camel@hastur.hellion.org.uk>
From: Ian Campbell <ijc@hellion.org.uk>
To: Keir Fraser <keir@xen.org>
Date: Thu, 08 Nov 2012 15:28:44 +0100
In-Reply-To: <CCC15BF9.51B87%keir@xen.org>
References: <CCC15BF9.51B87%keir@xen.org>
X-Mailer: Evolution 3.4.3-1 
Mime-Version: 1.0
X-SA-Exim-Connect-IP: 192.168.1.1
X-SA-Exim-Mail-From: ijc@hellion.org.uk
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: "Philippe.Simonet@swisscom.com" <Philippe.Simonet@swisscom.com>,
	"599161@bugs.debian.org" <599161@bugs.debian.org>,
	"mrsanna1@gmail.com" <mrsanna1@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-08 at 12:54 +0000, Keir Fraser wrote:
> On 08/11/2012 11:43, "Ian Campbell" <ijc@hellion.org.uk> wrote:
> 
> >>> I'll leave this to Keir (who wrote the debugging patch) to answer but it
> >>> looks to me like it should be useful!
> >> 
> >> I'm scratching my head. plt_wrap is earlier than plt_now, which should be
> >> impossible.
> > 
> > impossible due to guarantees made by the h/w or by construction in Xen.
> 
> That's a question, right? 

Yes, sorry.

> By construction in Xen.
> 
> > There appears to be a certain amount of hardware-specificness to the
> > issue -- so I'm wondering if maybe there are some platforms whose tsc is
> > not as monotonically increasing as it needs to be...
> 
> plt_* timestamps are not derived from TSC at all.

I see, rather it is derived from the platform_timesource which could be
HPET, pmtimer, pit etc but in this case (according to the provided xm
dmesg) appears to be a 14MHz HPET.

So I guess s/tsc/HPET/ in my original thought...

> >>  plt_stamp64 oddly has low 32 bits identical to new_stamp. That
> >> seems very very improbable!
> > 
> > Does this code run on all cpus or just one? Is it always the same one?
> 
> Always cpu0.

So it's not cross cpu drift then.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 14:31:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 14:31:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWT87-0000U8-Hy; Thu, 08 Nov 2012 14:30:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>) id 1TWT86-0000U2-9J
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 14:30:50 +0000
Received: from [85.158.138.51:60243] by server-3.bemta-3.messagelabs.com id
	99/DD-31566-912CB905; Thu, 08 Nov 2012 14:30:49 +0000
X-Env-Sender: ijc@hellion.org.uk
X-Msg-Ref: server-15.tower-174.messagelabs.com!1352385048!27334990!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24998 invoked from network); 8 Nov 2012 14:30:48 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Nov 2012 14:30:48 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1TWT84-0006pn-1h; Thu, 08 Nov 2012 14:30:48 +0000
Received: from yog-sothoth.hellion.org.uk ([192.168.1.1] helo=[127.0.0.1])
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1TWT80-00065M-S0; Thu, 08 Nov 2012 14:30:47 +0000
Message-ID: <1352384924.12977.103.camel@hastur.hellion.org.uk>
From: Ian Campbell <ijc@hellion.org.uk>
To: Keir Fraser <keir@xen.org>
Date: Thu, 08 Nov 2012 15:28:44 +0100
In-Reply-To: <CCC15BF9.51B87%keir@xen.org>
References: <CCC15BF9.51B87%keir@xen.org>
X-Mailer: Evolution 3.4.3-1 
Mime-Version: 1.0
X-SA-Exim-Connect-IP: 192.168.1.1
X-SA-Exim-Mail-From: ijc@hellion.org.uk
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: "Philippe.Simonet@swisscom.com" <Philippe.Simonet@swisscom.com>,
	"599161@bugs.debian.org" <599161@bugs.debian.org>,
	"mrsanna1@gmail.com" <mrsanna1@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-08 at 12:54 +0000, Keir Fraser wrote:
> On 08/11/2012 11:43, "Ian Campbell" <ijc@hellion.org.uk> wrote:
> 
> >>> I'll leave this to Keir (who wrote the debugging patch) to answer but it
> >>> looks to me like it should be useful!
> >> 
> >> I'm scratching my head. plt_wrap is earlier than plt_now, which should be
> >> impossible.
> > 
> > impossible due to guarantees made by the h/w or by construction in Xen.
> 
> That's a question, right? 

Yes, sorry.

> By construction in Xen.
> 
> > There appears to be a certain amount of hardware-specificness to the
> > issue -- so I'm wondering if maybe there are some platforms whose tsc is
> > not as monotonically increasing as it needs to be...
> 
> plt_* timestamps are not derived from TSC at all.

I see, rather it is derived from the platform_timesource which could be
HPET, pmtimer, pit etc but in this case (according to the provided xm
dmesg) appears to be a 14MHz HPET.

So I guess s/tsc/HPET/ in my original thought...

> >>  plt_stamp64 oddly has low 32 bits identical to new_stamp. That
> >> seems very very improbable!
> > 
> > Does this code run on all cpus or just one? Is it always the same one?
> 
> Always cpu0.

So it's not cross cpu drift then.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 14:34:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 14:34:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWTAv-0000aW-4Q; Thu, 08 Nov 2012 14:33:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>) id 1TWTAt-0000aO-GI
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 14:33:43 +0000
Received: from [193.109.254.147:36552] by server-16.bemta-14.messagelabs.com
	id B8/48-09215-6C2CB905; Thu, 08 Nov 2012 14:33:42 +0000
X-Env-Sender: ijc@hellion.org.uk
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352385098!2265369!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32135 invoked from network); 8 Nov 2012 14:31:39 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Nov 2012 14:31:39 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1TWT8p-0006py-DF; Thu, 08 Nov 2012 14:31:35 +0000
Received: from yog-sothoth.hellion.org.uk ([192.168.1.1] helo=[127.0.0.1])
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1TWT8j-00065Q-8E; Thu, 08 Nov 2012 14:31:34 +0000
Message-ID: <1352384968.12977.104.camel@hastur.hellion.org.uk>
From: Ian Campbell <ijc@hellion.org.uk>
To: Philippe.Simonet@swisscom.com
Date: Thu, 08 Nov 2012 15:29:28 +0100
In-Reply-To: <FF93AF260AC2BB499A119CC65B092CF73151843F@sg000713.corproot.net>
References: <1352294551.12977.61.camel@hastur.hellion.org.uk>
	<CCC04D8E.51A0E%keir@xen.org>
	<509B8BF802000078000A72A3@nat28.tlf.novell.com>
	<FF93AF260AC2BB499A119CC65B092CF73151843F@sg000713.corproot.net>
X-Mailer: Evolution 3.4.3-1 
Mime-Version: 1.0
X-SA-Exim-Connect-IP: 192.168.1.1
X-SA-Exim-Mail-From: ijc@hellion.org.uk
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: 599161@bugs.debian.org, keir@xen.org, JBeulich@suse.com, mrsanna1@gmail.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-08 at 13:47 +0000, Philippe.Simonet@swisscom.com wrote:
> Hi Mauro, 
> 
> that's a question for you : 

I think Jan was asking for information relating to the system you saw
this on -- or are you working on the same systems as Mauro?

Of course additional information from Mauro would be useful too in order
to help spotting any patterns.

> > Philippe, could you clarify again what CPU model(s) this is being observed on
> > (the long times between individual steps forward with this problem perhaps
> > warrant repeating the basics each time, as it's otherwise quite cumbersome
> > to always look up old pieces of information).
> 
> can you provide this information ? 
> 	cat /proc/cpuinfo 	
> 	cat /proc/meminfo
> 	hardware information (manufacturer, model, urls, ...)
> 
> Thanks, Philippe
> 
> 
> > -----Original Message-----
> > From: Jan Beulich [mailto:JBeulich@suse.com]
> > Sent: Thursday, November 08, 2012 10:40 AM
> > To: Simonet Philippe, ITS-OUS-OP-IFM-NW-IPE; Keir Fraser
> > Cc: 599161@bugs.debian.org; mrsanna1@gmail.com; Ian Campbell; xen-
> > devel@lists.xen.org
> > Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
> > minutes" bug.
> > 
> > >>> On 07.11.12 at 18:40, Keir Fraser <keir@xen.org> wrote:
> > > On 07/11/2012 13:22, "Ian Campbell" <ijc@hellion.org.uk> wrote:
> > >
> > >>>> (XEN) XXX plt_overflow: plt_now=5ece12d34128
> > plt_wrap=5ece12d09306
> > >>>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
> > >>>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
> > >>>> tsc_stamp=e3839fcb0273
> > >>>
> > >>> (below is the complete xm dmesg output)
> > >>>
> > >>> did that help you ? do you need more info ?
> > >>
> > >> I'll leave this to Keir (who wrote the debugging patch) to answer but
> > >> it looks to me like it should be useful!
> > >
> > > I'm scratching my head. plt_wrap is earlier than plt_now, which should
> > > be impossible. plt_stamp64 oddly has low 32 bits identical to
> > > new_stamp. That seems very very improbable!
> > 
> > Is it? My understanding was that plt_stamp64 is just a software extension to
> > the more narrow HW counter, and hence the low plt_mask bits would always
> > be expected to be identical.
> > 
> > The plt_wrap < plt_now thing of course is entirely unexplainable to me too:
> > Considering that plt_scale doesn't change at all post- boot, apart from
> > memory corruption I could only see an memory access ordering problem to
> > be the reason (platform_timer_stamp and/or stime_platform_stamp
> > changing despite platform_timer_lock being held. So maybe taking a
> > snapshot of all three static values involved in the calculation in
> > __read_platform_stime() between acquiring the lock and the first call to
> > __read_platform_stime(), and printing them together with the "live" values
> > in a second
> > printk() after the one your original patch added could rule that out.
> > 
> > But the box doesn't even seem to be NUMA (of course it also doesn't help
> > that the log level was kept restricted - hint, hint, Philippe), not does there
> > appear to be any S3 cycle or pCPU bring-up/-down in between...
> > 
> > Philippe, could you clarify again what CPU model(s) this is being observed on
> > (the long times between individual steps forward with this problem perhaps
> > warrant repeating the basics each time, as it's otherwise quite cumbersome
> > to always look up old pieces of information).
> > 
> > > I wonder whether the overflow handling should just be removed, or made
> > > conditional on a command-line parameter, or on the 32-bit platform
> > > counter being at least somewhat likely to overflow before a softirq
> > > occurs -- it seems lots of systems are using 14MHz HPET, and that
> > > gives us a couple of minutes for the plt_overflow softirq to do its work
> > before overflow occurs.
> > > I think we would notice that outage in other ways. :)
> > 
> > Iirc we added this for a good reason - to cover the, however unlikely, event
> > of Xen running for very long without preemption.
> > Presumably most of the cases got fixed meanwhile, and indeed a
> > wraparound time on the order of minutes should make this superfluous, but
> > as the case here shows that code did spot a severe anomaly (whatever that
> > may turn out to be).
> > 
> > Also recall that there are HPET implementations around that tick at a much
> > higher frequency than 14MHz.
> > 
> > So unless we finally reach the understanding that the code is flawed, I would
> > rather want to keep it.
> > 
> > Jan
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 14:34:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 14:34:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWTAv-0000aW-4Q; Thu, 08 Nov 2012 14:33:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>) id 1TWTAt-0000aO-GI
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 14:33:43 +0000
Received: from [193.109.254.147:36552] by server-16.bemta-14.messagelabs.com
	id B8/48-09215-6C2CB905; Thu, 08 Nov 2012 14:33:42 +0000
X-Env-Sender: ijc@hellion.org.uk
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352385098!2265369!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32135 invoked from network); 8 Nov 2012 14:31:39 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Nov 2012 14:31:39 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1TWT8p-0006py-DF; Thu, 08 Nov 2012 14:31:35 +0000
Received: from yog-sothoth.hellion.org.uk ([192.168.1.1] helo=[127.0.0.1])
	by hopkins.hellion.org.uk with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1TWT8j-00065Q-8E; Thu, 08 Nov 2012 14:31:34 +0000
Message-ID: <1352384968.12977.104.camel@hastur.hellion.org.uk>
From: Ian Campbell <ijc@hellion.org.uk>
To: Philippe.Simonet@swisscom.com
Date: Thu, 08 Nov 2012 15:29:28 +0100
In-Reply-To: <FF93AF260AC2BB499A119CC65B092CF73151843F@sg000713.corproot.net>
References: <1352294551.12977.61.camel@hastur.hellion.org.uk>
	<CCC04D8E.51A0E%keir@xen.org>
	<509B8BF802000078000A72A3@nat28.tlf.novell.com>
	<FF93AF260AC2BB499A119CC65B092CF73151843F@sg000713.corproot.net>
X-Mailer: Evolution 3.4.3-1 
Mime-Version: 1.0
X-SA-Exim-Connect-IP: 192.168.1.1
X-SA-Exim-Mail-From: ijc@hellion.org.uk
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: 599161@bugs.debian.org, keir@xen.org, JBeulich@suse.com, mrsanna1@gmail.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-08 at 13:47 +0000, Philippe.Simonet@swisscom.com wrote:
> Hi Mauro, 
> 
> that's a question for you : 

I think Jan was asking for information relating to the system you saw
this on -- or are you working on the same systems as Mauro?

Of course additional information from Mauro would be useful too in order
to help spotting any patterns.

> > Philippe, could you clarify again what CPU model(s) this is being observed on
> > (the long times between individual steps forward with this problem perhaps
> > warrant repeating the basics each time, as it's otherwise quite cumbersome
> > to always look up old pieces of information).
> 
> can you provide this information ? 
> 	cat /proc/cpuinfo 	
> 	cat /proc/meminfo
> 	hardware information (manufacturer, model, urls, ...)
> 
> Thanks, Philippe
> 
> 
> > -----Original Message-----
> > From: Jan Beulich [mailto:JBeulich@suse.com]
> > Sent: Thursday, November 08, 2012 10:40 AM
> > To: Simonet Philippe, ITS-OUS-OP-IFM-NW-IPE; Keir Fraser
> > Cc: 599161@bugs.debian.org; mrsanna1@gmail.com; Ian Campbell; xen-
> > devel@lists.xen.org
> > Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
> > minutes" bug.
> > 
> > >>> On 07.11.12 at 18:40, Keir Fraser <keir@xen.org> wrote:
> > > On 07/11/2012 13:22, "Ian Campbell" <ijc@hellion.org.uk> wrote:
> > >
> > >>>> (XEN) XXX plt_overflow: plt_now=5ece12d34128
> > plt_wrap=5ece12d09306
> > >>>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
> > >>>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
> > >>>> tsc_stamp=e3839fcb0273
> > >>>
> > >>> (below is the complete xm dmesg output)
> > >>>
> > >>> did that help you ? do you need more info ?
> > >>
> > >> I'll leave this to Keir (who wrote the debugging patch) to answer but
> > >> it looks to me like it should be useful!
> > >
> > > I'm scratching my head. plt_wrap is earlier than plt_now, which should
> > > be impossible. plt_stamp64 oddly has low 32 bits identical to
> > > new_stamp. That seems very very improbable!
> > 
> > Is it? My understanding was that plt_stamp64 is just a software extension to
> > the more narrow HW counter, and hence the low plt_mask bits would always
> > be expected to be identical.
> > 
> > The plt_wrap < plt_now thing of course is entirely unexplainable to me too:
> > Considering that plt_scale doesn't change at all post- boot, apart from
> > memory corruption I could only see an memory access ordering problem to
> > be the reason (platform_timer_stamp and/or stime_platform_stamp
> > changing despite platform_timer_lock being held. So maybe taking a
> > snapshot of all three static values involved in the calculation in
> > __read_platform_stime() between acquiring the lock and the first call to
> > __read_platform_stime(), and printing them together with the "live" values
> > in a second
> > printk() after the one your original patch added could rule that out.
> > 
> > But the box doesn't even seem to be NUMA (of course it also doesn't help
> > that the log level was kept restricted - hint, hint, Philippe), not does there
> > appear to be any S3 cycle or pCPU bring-up/-down in between...
> > 
> > Philippe, could you clarify again what CPU model(s) this is being observed on
> > (the long times between individual steps forward with this problem perhaps
> > warrant repeating the basics each time, as it's otherwise quite cumbersome
> > to always look up old pieces of information).
> > 
> > > I wonder whether the overflow handling should just be removed, or made
> > > conditional on a command-line parameter, or on the 32-bit platform
> > > counter being at least somewhat likely to overflow before a softirq
> > > occurs -- it seems lots of systems are using 14MHz HPET, and that
> > > gives us a couple of minutes for the plt_overflow softirq to do its work
> > before overflow occurs.
> > > I think we would notice that outage in other ways. :)
> > 
> > Iirc we added this for a good reason - to cover the, however unlikely, event
> > of Xen running for very long without preemption.
> > Presumably most of the cases got fixed meanwhile, and indeed a
> > wraparound time on the order of minutes should make this superfluous, but
> > as the case here shows that code did spot a severe anomaly (whatever that
> > may turn out to be).
> > 
> > Also recall that there are HPET implementations around that tick at a much
> > higher frequency than 14MHz.
> > 
> > So unless we finally reach the understanding that the code is flawed, I would
> > rather want to keep it.
> > 
> > Jan
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 14:35:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 14:35:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWTC1-0000fr-IL; Thu, 08 Nov 2012 14:34:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWTC0-0000fj-QL
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 14:34:53 +0000
Received: from [85.158.143.35:15973] by server-2.bemta-4.messagelabs.com id
	B3/9B-28922-C03CB905; Thu, 08 Nov 2012 14:34:52 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1352385291!6363312!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7814 invoked from network); 8 Nov 2012 14:34:51 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-2.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 14:34:51 -0000
Received: by mail-ea0-f173.google.com with SMTP id a1so1300917eaa.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 06:34:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=CVzApulxQtM16B27mZTQsiA0Q0i00u/XYjMBuW2ztOU=;
	b=mhj+mX47xG9W2t6XNk3zsmpid9edu2FIZxqMO+Lz4DAiQyipxiI+/qOCbOlMseouxm
	Bq9h+NBifBzoxBSSNNDcDrCIoQtiIYqRcpFlXalT14byasjxZ+5L8zmdqEH6aqPOGH4o
	gaFuzgP37jnTN7r4Ybka4QiPRNFCtoQRiMokiSbYN6qjjPfiSFz0x7HkAvNKlGwSCepl
	nBoGmF/joIutW7O5Gjg9cGPF0vWlpNPn7KRpET23q3f5kjOBvvSjfIKyTHmsq5yAVke8
	S8Yan56rU4GUhNIr4h9YVGTGeIny/+CfoutiQp6SDfHahArMPhV+rdj1Gmb4Tcybqno8
	bh0g==
Received: by 10.14.172.195 with SMTP id t43mr28126643eel.17.1352385291373;
	Thu, 08 Nov 2012 06:34:51 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id o47sm70643207eem.11.2012.11.08.06.34.49
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 06:34:50 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 14:34:46 +0000
From: Keir Fraser <keir@xen.org>
To: Ian Campbell <ijc@hellion.org.uk>
Message-ID: <CCC17386.51BA6%keir@xen.org>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
	minutes" bug.
Thread-Index: Ac29vjL1l22/R/nQSEedLeGaK4Z9HA==
In-Reply-To: <1352384924.12977.103.camel@hastur.hellion.org.uk>
Mime-version: 1.0
Cc: "Philippe.Simonet@swisscom.com" <Philippe.Simonet@swisscom.com>,
	"599161@bugs.debian.org" <599161@bugs.debian.org>,
	"mrsanna1@gmail.com" <mrsanna1@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 14:28, "Ian Campbell" <ijc@hellion.org.uk> wrote:

>>> There appears to be a certain amount of hardware-specificness to the
>>> issue -- so I'm wondering if maybe there are some platforms whose tsc is
>>> not as monotonically increasing as it needs to be...
>> 
>> plt_* timestamps are not derived from TSC at all.
> 
> I see, rather it is derived from the platform_timesource which could be
> HPET, pmtimer, pit etc but in this case (according to the provided xm
> dmesg) appears to be a 14MHz HPET.
> 
> So I guess s/tsc/HPET/ in my original thought...

In fact plt_now and plt_wrap are both derived from the same value of
plt_stamp64. One is derived from it directly, and the other from
plt_stamp64+plt_mask+1 (== plt_stamp64+(1<<32)).

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 14:35:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 14:35:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWTC1-0000fr-IL; Thu, 08 Nov 2012 14:34:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWTC0-0000fj-QL
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 14:34:53 +0000
Received: from [85.158.143.35:15973] by server-2.bemta-4.messagelabs.com id
	B3/9B-28922-C03CB905; Thu, 08 Nov 2012 14:34:52 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1352385291!6363312!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7814 invoked from network); 8 Nov 2012 14:34:51 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-2.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 14:34:51 -0000
Received: by mail-ea0-f173.google.com with SMTP id a1so1300917eaa.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 06:34:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=CVzApulxQtM16B27mZTQsiA0Q0i00u/XYjMBuW2ztOU=;
	b=mhj+mX47xG9W2t6XNk3zsmpid9edu2FIZxqMO+Lz4DAiQyipxiI+/qOCbOlMseouxm
	Bq9h+NBifBzoxBSSNNDcDrCIoQtiIYqRcpFlXalT14byasjxZ+5L8zmdqEH6aqPOGH4o
	gaFuzgP37jnTN7r4Ybka4QiPRNFCtoQRiMokiSbYN6qjjPfiSFz0x7HkAvNKlGwSCepl
	nBoGmF/joIutW7O5Gjg9cGPF0vWlpNPn7KRpET23q3f5kjOBvvSjfIKyTHmsq5yAVke8
	S8Yan56rU4GUhNIr4h9YVGTGeIny/+CfoutiQp6SDfHahArMPhV+rdj1Gmb4Tcybqno8
	bh0g==
Received: by 10.14.172.195 with SMTP id t43mr28126643eel.17.1352385291373;
	Thu, 08 Nov 2012 06:34:51 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id o47sm70643207eem.11.2012.11.08.06.34.49
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 06:34:50 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 14:34:46 +0000
From: Keir Fraser <keir@xen.org>
To: Ian Campbell <ijc@hellion.org.uk>
Message-ID: <CCC17386.51BA6%keir@xen.org>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
	minutes" bug.
Thread-Index: Ac29vjL1l22/R/nQSEedLeGaK4Z9HA==
In-Reply-To: <1352384924.12977.103.camel@hastur.hellion.org.uk>
Mime-version: 1.0
Cc: "Philippe.Simonet@swisscom.com" <Philippe.Simonet@swisscom.com>,
	"599161@bugs.debian.org" <599161@bugs.debian.org>,
	"mrsanna1@gmail.com" <mrsanna1@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 14:28, "Ian Campbell" <ijc@hellion.org.uk> wrote:

>>> There appears to be a certain amount of hardware-specificness to the
>>> issue -- so I'm wondering if maybe there are some platforms whose tsc is
>>> not as monotonically increasing as it needs to be...
>> 
>> plt_* timestamps are not derived from TSC at all.
> 
> I see, rather it is derived from the platform_timesource which could be
> HPET, pmtimer, pit etc but in this case (according to the provided xm
> dmesg) appears to be a 14MHz HPET.
> 
> So I guess s/tsc/HPET/ in my original thought...

In fact plt_now and plt_wrap are both derived from the same value of
plt_stamp64. One is derived from it directly, and the other from
plt_stamp64+plt_mask+1 (== plt_stamp64+(1<<32)).

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 14:59:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 14:59:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWTZy-0000zk-UU; Thu, 08 Nov 2012 14:59:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWTZx-0000zf-Ly
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 14:59:37 +0000
Received: from [85.158.139.83:40742] by server-16.bemta-5.messagelabs.com id
	39/96-04786-8D8CB905; Thu, 08 Nov 2012 14:59:36 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1352386776!26676255!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2048 invoked from network); 8 Nov 2012 14:59:36 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-182.messagelabs.com with SMTP;
	8 Nov 2012 14:59:36 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 14:59:35 +0000
Message-Id: <509BD6E702000078000A742E@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 14:59:35 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Subject: [Xen-devel] [PATCH 0/2] x86: x2apic improvements
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

1: make cpu_2_logical_apicid private to x2apic code
2: x2apic: properly implement cluster mode

Signed-off-by: Jan Beulich <jbeulich@suse.com>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 14:59:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 14:59:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWTZy-0000zk-UU; Thu, 08 Nov 2012 14:59:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWTZx-0000zf-Ly
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 14:59:37 +0000
Received: from [85.158.139.83:40742] by server-16.bemta-5.messagelabs.com id
	39/96-04786-8D8CB905; Thu, 08 Nov 2012 14:59:36 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1352386776!26676255!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2048 invoked from network); 8 Nov 2012 14:59:36 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-182.messagelabs.com with SMTP;
	8 Nov 2012 14:59:36 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 14:59:35 +0000
Message-Id: <509BD6E702000078000A742E@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 14:59:35 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Subject: [Xen-devel] [PATCH 0/2] x86: x2apic improvements
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

1: make cpu_2_logical_apicid private to x2apic code
2: x2apic: properly implement cluster mode

Signed-off-by: Jan Beulich <jbeulich@suse.com>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:02:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:02:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWTcy-000185-HC; Thu, 08 Nov 2012 15:02:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWTcw-00017y-EB
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 15:02:42 +0000
Received: from [85.158.137.99:16079] by server-13.bemta-3.messagelabs.com id
	4D/7B-24887-199CB905; Thu, 08 Nov 2012 15:02:41 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1352386960!11834786!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17366 invoked from network); 8 Nov 2012 15:02:40 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-217.messagelabs.com with SMTP;
	8 Nov 2012 15:02:40 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 15:02:40 +0000
Message-Id: <509BD7A002000078000A743C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 15:02:40 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <509BD6E702000078000A742E@nat28.tlf.novell.com>
In-Reply-To: <509BD6E702000078000A742E@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartEADB2C80.0__="
Subject: [Xen-devel] [PATCH 1/2] x86: make cpu_2_logical_apicid private to
 x2apic code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartEADB2C80.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

... as it in fact is only being used there. While moving it, also make
it a per-CPU variable rather than a NR_CPUS-sized array.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1024,7 +1024,6 @@ __next:
     if (boot_cpu_physical_apicid =3D=3D -1U)
         boot_cpu_physical_apicid =3D get_apic_id();
     x86_cpu_to_apicid[0] =3D get_apic_id();
-    cpu_2_logical_apicid[0] =3D get_logical_apic_id();
=20
     init_ioapic_mappings();
 }
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -32,14 +32,15 @@
 static bool_t __initdata x2apic_phys; /* By default we use logical =
cluster mode. */
 boolean_param("x2apic_phys", x2apic_phys);
=20
+static DEFINE_PER_CPU_READ_MOSTLY(u32, cpu_2_logical_apicid);
+
 static void init_apic_ldr_x2apic_phys(void)
 {
 }
=20
 static void init_apic_ldr_x2apic_cluster(void)
 {
-    int cpu =3D smp_processor_id();
-    cpu_2_logical_apicid[cpu] =3D apic_read(APIC_LDR);
+    this_cpu(cpu_2_logical_apicid) =3D apic_read(APIC_LDR);
 }
=20
 static void __init clustered_apic_check_x2apic(void)
@@ -48,7 +49,7 @@ static void __init clustered_apic_check_
=20
 static unsigned int cpu_mask_to_apicid_x2apic_cluster(const cpumask_t =
*cpumask)
 {
-    return cpu_2_logical_apicid[cpumask_first(cpumask)];
+    return per_cpu(cpu_2_logical_apicid, cpumask_first(cpumask));
 }
=20
 static void __send_IPI_mask_x2apic(
@@ -77,7 +78,7 @@ static void __send_IPI_mask_x2apic(
         if ( !cpu_online(cpu) || (cpu =3D=3D smp_processor_id()) )
             continue;
         msr_content =3D (dest_mode =3D=3D APIC_DEST_PHYSICAL)
-            ? cpu_physical_id(cpu) : cpu_2_logical_apicid[cpu];
+            ? cpu_physical_id(cpu) : per_cpu(cpu_2_logical_apicid, cpu);
         msr_content =3D (msr_content << 32) | APIC_DM_FIXED | dest_mode | =
vector;
         apic_wrmsr(APIC_ICR, msr_content);
     }
--- a/xen/arch/x86/smp.c
+++ b/xen/arch/x86/smp.c
@@ -28,11 +28,6 @@ int hard_smp_processor_id(void)
     return get_apic_id();
 }
=20
-int logical_smp_processor_id(void)
-{
-    return get_logical_apic_id();
-}
-
 /*
  * send_IPI_mask(cpumask, vector): sends @vector IPI to CPUs in @cpumask,
  * excluding the local CPU. @cpumask may be empty.
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -64,8 +64,6 @@ struct cpuinfo_x86 cpu_data[NR_CPUS];
 u32 x86_cpu_to_apicid[NR_CPUS] __read_mostly =3D
 	{ [0 ... NR_CPUS-1] =3D BAD_APICID };
=20
-static void map_cpu_to_logical_apicid(void);
-
 static int cpu_error;
 static enum cpu_state {
     CPU_STATE_DYING,    /* slave -> master: I am dying */
@@ -202,7 +200,6 @@ static void smp_callin(void)
     Dprintk("CALLIN, before setup_local_APIC().\n");
     x2apic_ap_setup();
     setup_local_APIC();
-    map_cpu_to_logical_apicid();
=20
     /* Save our processor parameters. */
     smp_store_cpu_info(cpu);
@@ -401,22 +398,6 @@ extern struct {
     unsigned short ss;
 } stack_start;
=20
-u32 cpu_2_logical_apicid[NR_CPUS] __read_mostly =3D
-    { [0 ... NR_CPUS-1] =3D BAD_APICID };
-
-static void map_cpu_to_logical_apicid(void)
-{
-    int cpu =3D smp_processor_id();
-    int apicid =3D logical_smp_processor_id();
-
-    cpu_2_logical_apicid[cpu] =3D apicid;
-}
-
-static void unmap_cpu_to_logical_apicid(int cpu)
-{
-    cpu_2_logical_apicid[cpu] =3D BAD_APICID;
-}
-
 static int wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip)
 {
     unsigned long send_status =3D 0, accept_status =3D 0;
@@ -646,7 +627,6 @@ static int do_boot_cpu(int apicid, int c
 void cpu_exit_clear(unsigned int cpu)
 {
     cpu_uninit(cpu);
-    unmap_cpu_to_logical_apicid(cpu);
     set_cpu_state(CPU_STATE_DEAD);
 }
=20
@@ -775,7 +755,6 @@ void __init smp_prepare_cpus(unsigned in
         if (APIC_init_uniprocessor())
             printk(KERN_NOTICE "Local APIC not detected."
                    " Using dummy APIC emulation.\n");
-        map_cpu_to_logical_apicid();
         return;
     }
=20
@@ -804,7 +783,6 @@ void __init smp_prepare_cpus(unsigned in
=20
     connect_bsp_APIC();
     setup_local_APIC();
-    map_cpu_to_logical_apicid();
=20
     smpboot_setup_io_apic();
=20
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -158,12 +158,6 @@ static __inline u32 get_apic_id(void) /*
     return x2apic_enabled ? id : GET_xAPIC_ID(id);
 }
=20
-static __inline u32 get_logical_apic_id(void)
-{
-    u32 logical_id =3D apic_read(APIC_LDR);
-    return x2apic_enabled ? logical_id : GET_xAPIC_LOGICAL_ID(logical_id);=

-}
-
 void apic_wait_icr_idle(void);
=20
 int get_physical_broadcast(void);
--- a/xen/include/asm-x86/smp.h
+++ b/xen/include/asm-x86/smp.h
@@ -37,7 +37,6 @@ extern void zap_low_mappings(void);
=20
 #define MAX_APICID 256
 extern u32 x86_cpu_to_apicid[];
-extern u32 cpu_2_logical_apicid[];
=20
 #define cpu_physical_id(cpu)	x86_cpu_to_apicid[cpu]
=20
@@ -54,7 +53,6 @@ int cpu_add(uint32_t apic_id, uint32_t a
 #define raw_smp_processor_id() (get_processor_id())
=20
 int hard_smp_processor_id(void);
-int logical_smp_processor_id(void);
=20
 void __stop_this_cpu(void);
=20



--=__PartEADB2C80.0__=
Content-Type: text/plain; name="x86-cpu2lapicid.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="x86-cpu2lapicid.patch"

x86: make cpu_2_logical_apicid private to x2apic code=0A=0A... as it in =
fact is only being used there. While moving it, also make=0Ait a per-CPU =
variable rather than a NR_CPUS-sized array.=0A=0ASigned-off-by: Jan =
Beulich <jbeulich@suse.com>=0A=0A--- a/xen/arch/x86/apic.c=0A+++ b/xen/arch=
/x86/apic.c=0A@@ -1024,7 +1024,6 @@ __next:=0A     if (boot_cpu_physical_ap=
icid =3D=3D -1U)=0A         boot_cpu_physical_apicid =3D get_apic_id();=0A =
    x86_cpu_to_apicid[0] =3D get_apic_id();=0A-    cpu_2_logical_apicid[0] =
=3D get_logical_apic_id();=0A =0A     init_ioapic_mappings();=0A }=0A--- =
a/xen/arch/x86/genapic/x2apic.c=0A+++ b/xen/arch/x86/genapic/x2apic.c=0A@@ =
-32,14 +32,15 @@=0A static bool_t __initdata x2apic_phys; /* By default we =
use logical cluster mode. */=0A boolean_param("x2apic_phys", x2apic_phys);=
=0A =0A+static DEFINE_PER_CPU_READ_MOSTLY(u32, cpu_2_logical_apicid);=0A+=
=0A static void init_apic_ldr_x2apic_phys(void)=0A {=0A }=0A =0A static =
void init_apic_ldr_x2apic_cluster(void)=0A {=0A-    int cpu =3D smp_process=
or_id();=0A-    cpu_2_logical_apicid[cpu] =3D apic_read(APIC_LDR);=0A+    =
this_cpu(cpu_2_logical_apicid) =3D apic_read(APIC_LDR);=0A }=0A =0A static =
void __init clustered_apic_check_x2apic(void)=0A@@ -48,7 +49,7 @@ static =
void __init clustered_apic_check_=0A =0A static unsigned int cpu_mask_to_ap=
icid_x2apic_cluster(const cpumask_t *cpumask)=0A {=0A-    return cpu_2_logi=
cal_apicid[cpumask_first(cpumask)];=0A+    return per_cpu(cpu_2_logical_api=
cid, cpumask_first(cpumask));=0A }=0A =0A static void __send_IPI_mask_x2api=
c(=0A@@ -77,7 +78,7 @@ static void __send_IPI_mask_x2apic(=0A         if ( =
!cpu_online(cpu) || (cpu =3D=3D smp_processor_id()) )=0A             =
continue;=0A         msr_content =3D (dest_mode =3D=3D APIC_DEST_PHYSICAL)=
=0A-            ? cpu_physical_id(cpu) : cpu_2_logical_apicid[cpu];=0A+    =
        ? cpu_physical_id(cpu) : per_cpu(cpu_2_logical_apicid, cpu);=0A    =
     msr_content =3D (msr_content << 32) | APIC_DM_FIXED | dest_mode | =
vector;=0A         apic_wrmsr(APIC_ICR, msr_content);=0A     }=0A--- =
a/xen/arch/x86/smp.c=0A+++ b/xen/arch/x86/smp.c=0A@@ -28,11 +28,6 @@ int =
hard_smp_processor_id(void)=0A     return get_apic_id();=0A }=0A =0A-int =
logical_smp_processor_id(void)=0A-{=0A-    return get_logical_apic_id();=0A=
-}=0A-=0A /*=0A  * send_IPI_mask(cpumask, vector): sends @vector IPI to =
CPUs in @cpumask,=0A  * excluding the local CPU. @cpumask may be empty.=0A-=
-- a/xen/arch/x86/smpboot.c=0A+++ b/xen/arch/x86/smpboot.c=0A@@ -64,8 =
+64,6 @@ struct cpuinfo_x86 cpu_data[NR_CPUS];=0A u32 x86_cpu_to_apicid[NR_=
CPUS] __read_mostly =3D=0A 	{ [0 ... NR_CPUS-1] =3D BAD_APICID };=0A =
=0A-static void map_cpu_to_logical_apicid(void);=0A-=0A static int =
cpu_error;=0A static enum cpu_state {=0A     CPU_STATE_DYING,    /* slave =
-> master: I am dying */=0A@@ -202,7 +200,6 @@ static void smp_callin(void)=
=0A     Dprintk("CALLIN, before setup_local_APIC().\n");=0A     x2apic_ap_s=
etup();=0A     setup_local_APIC();=0A-    map_cpu_to_logical_apicid();=0A =
=0A     /* Save our processor parameters. */=0A     smp_store_cpu_info(cpu)=
;=0A@@ -401,22 +398,6 @@ extern struct {=0A     unsigned short ss;=0A } =
stack_start;=0A =0A-u32 cpu_2_logical_apicid[NR_CPUS] __read_mostly =
=3D=0A-    { [0 ... NR_CPUS-1] =3D BAD_APICID };=0A-=0A-static void =
map_cpu_to_logical_apicid(void)=0A-{=0A-    int cpu =3D smp_processor_id();=
=0A-    int apicid =3D logical_smp_processor_id();=0A-=0A-    cpu_2_logical=
_apicid[cpu] =3D apicid;=0A-}=0A-=0A-static void unmap_cpu_to_logical_apici=
d(int cpu)=0A-{=0A-    cpu_2_logical_apicid[cpu] =3D BAD_APICID;=0A-}=0A-=
=0A static int wakeup_secondary_cpu(int phys_apicid, unsigned long =
start_eip)=0A {=0A     unsigned long send_status =3D 0, accept_status =3D =
0;=0A@@ -646,7 +627,6 @@ static int do_boot_cpu(int apicid, int c=0A void =
cpu_exit_clear(unsigned int cpu)=0A {=0A     cpu_uninit(cpu);=0A-    =
unmap_cpu_to_logical_apicid(cpu);=0A     set_cpu_state(CPU_STATE_DEAD);=0A =
}=0A =0A@@ -775,7 +755,6 @@ void __init smp_prepare_cpus(unsigned in=0A    =
     if (APIC_init_uniprocessor())=0A             printk(KERN_NOTICE =
"Local APIC not detected."=0A                    " Using dummy APIC =
emulation.\n");=0A-        map_cpu_to_logical_apicid();=0A         =
return;=0A     }=0A =0A@@ -804,7 +783,6 @@ void __init smp_prepare_cpus(uns=
igned in=0A =0A     connect_bsp_APIC();=0A     setup_local_APIC();=0A-    =
map_cpu_to_logical_apicid();=0A =0A     smpboot_setup_io_apic();=0A =0A--- =
a/xen/include/asm-x86/apic.h=0A+++ b/xen/include/asm-x86/apic.h=0A@@ =
-158,12 +158,6 @@ static __inline u32 get_apic_id(void) /*=0A     return =
x2apic_enabled ? id : GET_xAPIC_ID(id);=0A }=0A =0A-static __inline u32 =
get_logical_apic_id(void)=0A-{=0A-    u32 logical_id =3D apic_read(APIC_LDR=
);=0A-    return x2apic_enabled ? logical_id : GET_xAPIC_LOGICAL_ID(logical=
_id);=0A-}=0A-=0A void apic_wait_icr_idle(void);=0A =0A int get_physical_br=
oadcast(void);=0A--- a/xen/include/asm-x86/smp.h=0A+++ b/xen/include/asm-x8=
6/smp.h=0A@@ -37,7 +37,6 @@ extern void zap_low_mappings(void);=0A =0A =
#define MAX_APICID 256=0A extern u32 x86_cpu_to_apicid[];=0A-extern u32 =
cpu_2_logical_apicid[];=0A =0A #define cpu_physical_id(cpu)	x86_cpu_to_=
apicid[cpu]=0A =0A@@ -54,7 +53,6 @@ int cpu_add(uint32_t apic_id, uint32_t =
a=0A #define raw_smp_processor_id() (get_processor_id())=0A =0A int =
hard_smp_processor_id(void);=0A-int logical_smp_processor_id(void);=0A =0A =
void __stop_this_cpu(void);=0A =0A
--=__PartEADB2C80.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.xen.org
http://lists.xen.org/xen-devel

--=__PartEADB2C80.0__=--


From xen-devel-bounces@lists.xen.org Thu Nov 08 15:02:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:02:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWTcy-000185-HC; Thu, 08 Nov 2012 15:02:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWTcw-00017y-EB
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 15:02:42 +0000
Received: from [85.158.137.99:16079] by server-13.bemta-3.messagelabs.com id
	4D/7B-24887-199CB905; Thu, 08 Nov 2012 15:02:41 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1352386960!11834786!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17366 invoked from network); 8 Nov 2012 15:02:40 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-217.messagelabs.com with SMTP;
	8 Nov 2012 15:02:40 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 15:02:40 +0000
Message-Id: <509BD7A002000078000A743C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 15:02:40 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <509BD6E702000078000A742E@nat28.tlf.novell.com>
In-Reply-To: <509BD6E702000078000A742E@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartEADB2C80.0__="
Subject: [Xen-devel] [PATCH 1/2] x86: make cpu_2_logical_apicid private to
 x2apic code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartEADB2C80.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

... as it in fact is only being used there. While moving it, also make
it a per-CPU variable rather than a NR_CPUS-sized array.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1024,7 +1024,6 @@ __next:
     if (boot_cpu_physical_apicid =3D=3D -1U)
         boot_cpu_physical_apicid =3D get_apic_id();
     x86_cpu_to_apicid[0] =3D get_apic_id();
-    cpu_2_logical_apicid[0] =3D get_logical_apic_id();
=20
     init_ioapic_mappings();
 }
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -32,14 +32,15 @@
 static bool_t __initdata x2apic_phys; /* By default we use logical =
cluster mode. */
 boolean_param("x2apic_phys", x2apic_phys);
=20
+static DEFINE_PER_CPU_READ_MOSTLY(u32, cpu_2_logical_apicid);
+
 static void init_apic_ldr_x2apic_phys(void)
 {
 }
=20
 static void init_apic_ldr_x2apic_cluster(void)
 {
-    int cpu =3D smp_processor_id();
-    cpu_2_logical_apicid[cpu] =3D apic_read(APIC_LDR);
+    this_cpu(cpu_2_logical_apicid) =3D apic_read(APIC_LDR);
 }
=20
 static void __init clustered_apic_check_x2apic(void)
@@ -48,7 +49,7 @@ static void __init clustered_apic_check_
=20
 static unsigned int cpu_mask_to_apicid_x2apic_cluster(const cpumask_t =
*cpumask)
 {
-    return cpu_2_logical_apicid[cpumask_first(cpumask)];
+    return per_cpu(cpu_2_logical_apicid, cpumask_first(cpumask));
 }
=20
 static void __send_IPI_mask_x2apic(
@@ -77,7 +78,7 @@ static void __send_IPI_mask_x2apic(
         if ( !cpu_online(cpu) || (cpu =3D=3D smp_processor_id()) )
             continue;
         msr_content =3D (dest_mode =3D=3D APIC_DEST_PHYSICAL)
-            ? cpu_physical_id(cpu) : cpu_2_logical_apicid[cpu];
+            ? cpu_physical_id(cpu) : per_cpu(cpu_2_logical_apicid, cpu);
         msr_content =3D (msr_content << 32) | APIC_DM_FIXED | dest_mode | =
vector;
         apic_wrmsr(APIC_ICR, msr_content);
     }
--- a/xen/arch/x86/smp.c
+++ b/xen/arch/x86/smp.c
@@ -28,11 +28,6 @@ int hard_smp_processor_id(void)
     return get_apic_id();
 }
=20
-int logical_smp_processor_id(void)
-{
-    return get_logical_apic_id();
-}
-
 /*
  * send_IPI_mask(cpumask, vector): sends @vector IPI to CPUs in @cpumask,
  * excluding the local CPU. @cpumask may be empty.
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -64,8 +64,6 @@ struct cpuinfo_x86 cpu_data[NR_CPUS];
 u32 x86_cpu_to_apicid[NR_CPUS] __read_mostly =3D
 	{ [0 ... NR_CPUS-1] =3D BAD_APICID };
=20
-static void map_cpu_to_logical_apicid(void);
-
 static int cpu_error;
 static enum cpu_state {
     CPU_STATE_DYING,    /* slave -> master: I am dying */
@@ -202,7 +200,6 @@ static void smp_callin(void)
     Dprintk("CALLIN, before setup_local_APIC().\n");
     x2apic_ap_setup();
     setup_local_APIC();
-    map_cpu_to_logical_apicid();
=20
     /* Save our processor parameters. */
     smp_store_cpu_info(cpu);
@@ -401,22 +398,6 @@ extern struct {
     unsigned short ss;
 } stack_start;
=20
-u32 cpu_2_logical_apicid[NR_CPUS] __read_mostly =3D
-    { [0 ... NR_CPUS-1] =3D BAD_APICID };
-
-static void map_cpu_to_logical_apicid(void)
-{
-    int cpu =3D smp_processor_id();
-    int apicid =3D logical_smp_processor_id();
-
-    cpu_2_logical_apicid[cpu] =3D apicid;
-}
-
-static void unmap_cpu_to_logical_apicid(int cpu)
-{
-    cpu_2_logical_apicid[cpu] =3D BAD_APICID;
-}
-
 static int wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip)
 {
     unsigned long send_status =3D 0, accept_status =3D 0;
@@ -646,7 +627,6 @@ static int do_boot_cpu(int apicid, int c
 void cpu_exit_clear(unsigned int cpu)
 {
     cpu_uninit(cpu);
-    unmap_cpu_to_logical_apicid(cpu);
     set_cpu_state(CPU_STATE_DEAD);
 }
=20
@@ -775,7 +755,6 @@ void __init smp_prepare_cpus(unsigned in
         if (APIC_init_uniprocessor())
             printk(KERN_NOTICE "Local APIC not detected."
                    " Using dummy APIC emulation.\n");
-        map_cpu_to_logical_apicid();
         return;
     }
=20
@@ -804,7 +783,6 @@ void __init smp_prepare_cpus(unsigned in
=20
     connect_bsp_APIC();
     setup_local_APIC();
-    map_cpu_to_logical_apicid();
=20
     smpboot_setup_io_apic();
=20
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -158,12 +158,6 @@ static __inline u32 get_apic_id(void) /*
     return x2apic_enabled ? id : GET_xAPIC_ID(id);
 }
=20
-static __inline u32 get_logical_apic_id(void)
-{
-    u32 logical_id =3D apic_read(APIC_LDR);
-    return x2apic_enabled ? logical_id : GET_xAPIC_LOGICAL_ID(logical_id);=

-}
-
 void apic_wait_icr_idle(void);
=20
 int get_physical_broadcast(void);
--- a/xen/include/asm-x86/smp.h
+++ b/xen/include/asm-x86/smp.h
@@ -37,7 +37,6 @@ extern void zap_low_mappings(void);
=20
 #define MAX_APICID 256
 extern u32 x86_cpu_to_apicid[];
-extern u32 cpu_2_logical_apicid[];
=20
 #define cpu_physical_id(cpu)	x86_cpu_to_apicid[cpu]
=20
@@ -54,7 +53,6 @@ int cpu_add(uint32_t apic_id, uint32_t a
 #define raw_smp_processor_id() (get_processor_id())
=20
 int hard_smp_processor_id(void);
-int logical_smp_processor_id(void);
=20
 void __stop_this_cpu(void);
=20



--=__PartEADB2C80.0__=
Content-Type: text/plain; name="x86-cpu2lapicid.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="x86-cpu2lapicid.patch"

x86: make cpu_2_logical_apicid private to x2apic code=0A=0A... as it in =
fact is only being used there. While moving it, also make=0Ait a per-CPU =
variable rather than a NR_CPUS-sized array.=0A=0ASigned-off-by: Jan =
Beulich <jbeulich@suse.com>=0A=0A--- a/xen/arch/x86/apic.c=0A+++ b/xen/arch=
/x86/apic.c=0A@@ -1024,7 +1024,6 @@ __next:=0A     if (boot_cpu_physical_ap=
icid =3D=3D -1U)=0A         boot_cpu_physical_apicid =3D get_apic_id();=0A =
    x86_cpu_to_apicid[0] =3D get_apic_id();=0A-    cpu_2_logical_apicid[0] =
=3D get_logical_apic_id();=0A =0A     init_ioapic_mappings();=0A }=0A--- =
a/xen/arch/x86/genapic/x2apic.c=0A+++ b/xen/arch/x86/genapic/x2apic.c=0A@@ =
-32,14 +32,15 @@=0A static bool_t __initdata x2apic_phys; /* By default we =
use logical cluster mode. */=0A boolean_param("x2apic_phys", x2apic_phys);=
=0A =0A+static DEFINE_PER_CPU_READ_MOSTLY(u32, cpu_2_logical_apicid);=0A+=
=0A static void init_apic_ldr_x2apic_phys(void)=0A {=0A }=0A =0A static =
void init_apic_ldr_x2apic_cluster(void)=0A {=0A-    int cpu =3D smp_process=
or_id();=0A-    cpu_2_logical_apicid[cpu] =3D apic_read(APIC_LDR);=0A+    =
this_cpu(cpu_2_logical_apicid) =3D apic_read(APIC_LDR);=0A }=0A =0A static =
void __init clustered_apic_check_x2apic(void)=0A@@ -48,7 +49,7 @@ static =
void __init clustered_apic_check_=0A =0A static unsigned int cpu_mask_to_ap=
icid_x2apic_cluster(const cpumask_t *cpumask)=0A {=0A-    return cpu_2_logi=
cal_apicid[cpumask_first(cpumask)];=0A+    return per_cpu(cpu_2_logical_api=
cid, cpumask_first(cpumask));=0A }=0A =0A static void __send_IPI_mask_x2api=
c(=0A@@ -77,7 +78,7 @@ static void __send_IPI_mask_x2apic(=0A         if ( =
!cpu_online(cpu) || (cpu =3D=3D smp_processor_id()) )=0A             =
continue;=0A         msr_content =3D (dest_mode =3D=3D APIC_DEST_PHYSICAL)=
=0A-            ? cpu_physical_id(cpu) : cpu_2_logical_apicid[cpu];=0A+    =
        ? cpu_physical_id(cpu) : per_cpu(cpu_2_logical_apicid, cpu);=0A    =
     msr_content =3D (msr_content << 32) | APIC_DM_FIXED | dest_mode | =
vector;=0A         apic_wrmsr(APIC_ICR, msr_content);=0A     }=0A--- =
a/xen/arch/x86/smp.c=0A+++ b/xen/arch/x86/smp.c=0A@@ -28,11 +28,6 @@ int =
hard_smp_processor_id(void)=0A     return get_apic_id();=0A }=0A =0A-int =
logical_smp_processor_id(void)=0A-{=0A-    return get_logical_apic_id();=0A=
-}=0A-=0A /*=0A  * send_IPI_mask(cpumask, vector): sends @vector IPI to =
CPUs in @cpumask,=0A  * excluding the local CPU. @cpumask may be empty.=0A-=
-- a/xen/arch/x86/smpboot.c=0A+++ b/xen/arch/x86/smpboot.c=0A@@ -64,8 =
+64,6 @@ struct cpuinfo_x86 cpu_data[NR_CPUS];=0A u32 x86_cpu_to_apicid[NR_=
CPUS] __read_mostly =3D=0A 	{ [0 ... NR_CPUS-1] =3D BAD_APICID };=0A =
=0A-static void map_cpu_to_logical_apicid(void);=0A-=0A static int =
cpu_error;=0A static enum cpu_state {=0A     CPU_STATE_DYING,    /* slave =
-> master: I am dying */=0A@@ -202,7 +200,6 @@ static void smp_callin(void)=
=0A     Dprintk("CALLIN, before setup_local_APIC().\n");=0A     x2apic_ap_s=
etup();=0A     setup_local_APIC();=0A-    map_cpu_to_logical_apicid();=0A =
=0A     /* Save our processor parameters. */=0A     smp_store_cpu_info(cpu)=
;=0A@@ -401,22 +398,6 @@ extern struct {=0A     unsigned short ss;=0A } =
stack_start;=0A =0A-u32 cpu_2_logical_apicid[NR_CPUS] __read_mostly =
=3D=0A-    { [0 ... NR_CPUS-1] =3D BAD_APICID };=0A-=0A-static void =
map_cpu_to_logical_apicid(void)=0A-{=0A-    int cpu =3D smp_processor_id();=
=0A-    int apicid =3D logical_smp_processor_id();=0A-=0A-    cpu_2_logical=
_apicid[cpu] =3D apicid;=0A-}=0A-=0A-static void unmap_cpu_to_logical_apici=
d(int cpu)=0A-{=0A-    cpu_2_logical_apicid[cpu] =3D BAD_APICID;=0A-}=0A-=
=0A static int wakeup_secondary_cpu(int phys_apicid, unsigned long =
start_eip)=0A {=0A     unsigned long send_status =3D 0, accept_status =3D =
0;=0A@@ -646,7 +627,6 @@ static int do_boot_cpu(int apicid, int c=0A void =
cpu_exit_clear(unsigned int cpu)=0A {=0A     cpu_uninit(cpu);=0A-    =
unmap_cpu_to_logical_apicid(cpu);=0A     set_cpu_state(CPU_STATE_DEAD);=0A =
}=0A =0A@@ -775,7 +755,6 @@ void __init smp_prepare_cpus(unsigned in=0A    =
     if (APIC_init_uniprocessor())=0A             printk(KERN_NOTICE =
"Local APIC not detected."=0A                    " Using dummy APIC =
emulation.\n");=0A-        map_cpu_to_logical_apicid();=0A         =
return;=0A     }=0A =0A@@ -804,7 +783,6 @@ void __init smp_prepare_cpus(uns=
igned in=0A =0A     connect_bsp_APIC();=0A     setup_local_APIC();=0A-    =
map_cpu_to_logical_apicid();=0A =0A     smpboot_setup_io_apic();=0A =0A--- =
a/xen/include/asm-x86/apic.h=0A+++ b/xen/include/asm-x86/apic.h=0A@@ =
-158,12 +158,6 @@ static __inline u32 get_apic_id(void) /*=0A     return =
x2apic_enabled ? id : GET_xAPIC_ID(id);=0A }=0A =0A-static __inline u32 =
get_logical_apic_id(void)=0A-{=0A-    u32 logical_id =3D apic_read(APIC_LDR=
);=0A-    return x2apic_enabled ? logical_id : GET_xAPIC_LOGICAL_ID(logical=
_id);=0A-}=0A-=0A void apic_wait_icr_idle(void);=0A =0A int get_physical_br=
oadcast(void);=0A--- a/xen/include/asm-x86/smp.h=0A+++ b/xen/include/asm-x8=
6/smp.h=0A@@ -37,7 +37,6 @@ extern void zap_low_mappings(void);=0A =0A =
#define MAX_APICID 256=0A extern u32 x86_cpu_to_apicid[];=0A-extern u32 =
cpu_2_logical_apicid[];=0A =0A #define cpu_physical_id(cpu)	x86_cpu_to_=
apicid[cpu]=0A =0A@@ -54,7 +53,6 @@ int cpu_add(uint32_t apic_id, uint32_t =
a=0A #define raw_smp_processor_id() (get_processor_id())=0A =0A int =
hard_smp_processor_id(void);=0A-int logical_smp_processor_id(void);=0A =0A =
void __stop_this_cpu(void);=0A =0A
--=__PartEADB2C80.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.xen.org
http://lists.xen.org/xen-devel

--=__PartEADB2C80.0__=--


From xen-devel-bounces@lists.xen.org Thu Nov 08 15:03:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:03:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWTdl-0001Bl-0V; Thu, 08 Nov 2012 15:03:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWTdk-0001BX-0L
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 15:03:32 +0000
Received: from [85.158.137.99:31040] by server-6.bemta-3.messagelabs.com id
	08/1A-28265-3C9CB905; Thu, 08 Nov 2012 15:03:31 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352387009!18185160!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1010 invoked from network); 8 Nov 2012 15:03:29 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-217.messagelabs.com with SMTP;
	8 Nov 2012 15:03:29 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 15:03:29 +0000
Message-Id: <509BD7D102000078000A7440@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 15:03:29 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <509BD6E702000078000A742E@nat28.tlf.novell.com>
In-Reply-To: <509BD6E702000078000A742E@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartBB8A7DD1.0__="
Subject: [Xen-devel] [PATCH 2/2] x86/x2apic: properly implement cluster mode
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartBB8A7DD1.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

So far, cluster mode was just an alternative implementation of
physical mode: Allowing only single CPU interrupt targets, and sending
IPIs to each target CPU separately. Take advantage of what cluster
mode really can do in that regard.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -19,6 +19,7 @@
=20
 #include <xen/config.h>
 #include <xen/init.h>
+#include <xen/cpu.h>
 #include <xen/cpumask.h>
 #include <asm/apicdef.h>
 #include <asm/genapic.h>
@@ -33,6 +34,14 @@ static bool_t __initdata x2apic_phys; /*
 boolean_param("x2apic_phys", x2apic_phys);
=20
 static DEFINE_PER_CPU_READ_MOSTLY(u32, cpu_2_logical_apicid);
+static DEFINE_PER_CPU_READ_MOSTLY(cpumask_t *, cluster_cpus);
+static cpumask_t *cluster_cpus_spare;
+static DEFINE_PER_CPU(cpumask_var_t, scratch_mask);
+
+static inline u32 x2apic_cluster(unsigned int cpu)
+{
+    return per_cpu(cpu_2_logical_apicid, cpu) >> 16;
+}
=20
 static void init_apic_ldr_x2apic_phys(void)
 {
@@ -40,20 +49,53 @@ static void init_apic_ldr_x2apic_phys(vo
=20
 static void init_apic_ldr_x2apic_cluster(void)
 {
-    this_cpu(cpu_2_logical_apicid) =3D apic_read(APIC_LDR);
+    unsigned int cpu, this_cpu =3D smp_processor_id();
+
+    per_cpu(cpu_2_logical_apicid, this_cpu) =3D apic_read(APIC_LDR);
+
+    if ( per_cpu(cluster_cpus, this_cpu) )
+    {
+        ASSERT(cpumask_test_cpu(this_cpu, per_cpu(cluster_cpus, this_cpu))=
);
+        return;
+    }
+
+    per_cpu(cluster_cpus, this_cpu) =3D cluster_cpus_spare;
+    for_each_online_cpu ( cpu )
+    {
+        if (this_cpu =3D=3D cpu || x2apic_cluster(this_cpu) !=3D =
x2apic_cluster(cpu))
+            continue;
+        per_cpu(cluster_cpus, this_cpu) =3D per_cpu(cluster_cpus, cpu);
+        break;
+    }
+    if ( per_cpu(cluster_cpus, this_cpu) =3D=3D cluster_cpus_spare )
+        cluster_cpus_spare =3D NULL;
+
+    cpumask_set_cpu(this_cpu, per_cpu(cluster_cpus, this_cpu));
 }
=20
 static void __init clustered_apic_check_x2apic(void)
 {
 }
=20
+static const cpumask_t *vector_allocation_cpumask_x2apic_cluster(int cpu)
+{
+    return per_cpu(cluster_cpus, cpu);
+}
+
 static unsigned int cpu_mask_to_apicid_x2apic_cluster(const cpumask_t =
*cpumask)
 {
-    return per_cpu(cpu_2_logical_apicid, cpumask_first(cpumask));
+    unsigned int cpu =3D cpumask_first(cpumask);
+    unsigned int dest =3D per_cpu(cpu_2_logical_apicid, cpu);
+    const cpumask_t *cluster_cpus =3D per_cpu(cluster_cpus, cpu);
+
+    for_each_cpu ( cpu, cluster_cpus )
+        if ( cpumask_test_cpu(cpu, cpumask) )
+            dest |=3D per_cpu(cpu_2_logical_apicid, cpu);
+
+    return dest;
 }
=20
-static void __send_IPI_mask_x2apic(
-    const cpumask_t *cpumask, int vector, unsigned int dest_mode)
+static void send_IPI_mask_x2apic_phys(const cpumask_t *cpumask, int =
vector)
 {
     unsigned int cpu;
     unsigned long flags;
@@ -77,23 +119,48 @@ static void __send_IPI_mask_x2apic(
     {
         if ( !cpu_online(cpu) || (cpu =3D=3D smp_processor_id()) )
             continue;
-        msr_content =3D (dest_mode =3D=3D APIC_DEST_PHYSICAL)
-            ? cpu_physical_id(cpu) : per_cpu(cpu_2_logical_apicid, cpu);
-        msr_content =3D (msr_content << 32) | APIC_DM_FIXED | dest_mode | =
vector;
+        msr_content =3D cpu_physical_id(cpu);
+        msr_content =3D (msr_content << 32) | APIC_DM_FIXED |
+                      APIC_DEST_PHYSICAL | vector;
         apic_wrmsr(APIC_ICR, msr_content);
     }
=20
     local_irq_restore(flags);
 }
=20
-static void send_IPI_mask_x2apic_phys(const cpumask_t *cpumask, int =
vector)
-{
-    __send_IPI_mask_x2apic(cpumask, vector, APIC_DEST_PHYSICAL);
-}
-
 static void send_IPI_mask_x2apic_cluster(const cpumask_t *cpumask, int =
vector)
 {
-    __send_IPI_mask_x2apic(cpumask, vector, APIC_DEST_LOGICAL);
+    unsigned int cpu =3D smp_processor_id();
+    cpumask_t *ipimask =3D per_cpu(scratch_mask, cpu);
+    const cpumask_t *cluster_cpus;
+    unsigned long flags;
+
+    mb(); /* See above for an explanation. */
+
+    local_irq_save(flags);
+
+    cpumask_andnot(ipimask, &cpu_online_map, cpumask_of(cpu));
+
+    for ( cpumask_and(ipimask, cpumask, ipimask); !cpumask_empty(ipimask);=

+          cpumask_andnot(ipimask, ipimask, cluster_cpus) )
+    {
+        uint64_t msr_content =3D 0;
+
+        cluster_cpus =3D per_cpu(cluster_cpus, cpumask_first(ipimask));
+        for_each_cpu ( cpu, cluster_cpus )
+        {
+            if ( !cpumask_test_cpu(cpu, ipimask) )
+                continue;
+            msr_content |=3D per_cpu(cpu_2_logical_apicid, cpu);
+        }
+
+        BUG_ON(!msr_content);
+        msr_content =3D (msr_content << 32) | APIC_DM_FIXED |
+                      APIC_DEST_LOGICAL | vector;
+        apic_wrmsr(APIC_ICR, msr_content);
+    }
+
+    local_irq_restore(flags);
 }
=20
 static const struct genapic apic_x2apic_phys =3D {
@@ -116,15 +183,60 @@ static const struct genapic apic_x2apic_
     .init_apic_ldr =3D init_apic_ldr_x2apic_cluster,
     .clustered_apic_check =3D clustered_apic_check_x2apic,
     .target_cpus =3D target_cpus_all,
-    .vector_allocation_cpumask =3D vector_allocation_cpumask_phys,
+    .vector_allocation_cpumask =3D vector_allocation_cpumask_x2apic_cluste=
r,
     .cpu_mask_to_apicid =3D cpu_mask_to_apicid_x2apic_cluster,
     .send_IPI_mask =3D send_IPI_mask_x2apic_cluster,
     .send_IPI_self =3D send_IPI_self_x2apic
 };
=20
+static int update_clusterinfo(
+    struct notifier_block *nfb, unsigned long action, void *hcpu)
+{
+    unsigned int cpu =3D (unsigned long)hcpu;
+    int err =3D 0;
+
+    switch (action) {
+    case CPU_UP_PREPARE:
+        per_cpu(cpu_2_logical_apicid, cpu) =3D BAD_APICID;
+        if ( !cluster_cpus_spare )
+            cluster_cpus_spare =3D xzalloc(cpumask_t);
+        if ( !cluster_cpus_spare ||
+             !alloc_cpumask_var(&per_cpu(scratch_mask, cpu)) )
+            err =3D -ENOMEM;
+        break;
+    case CPU_UP_CANCELED:
+    case CPU_DEAD:
+        if ( per_cpu(cluster_cpus, cpu) )
+        {
+            cpumask_clear_cpu(cpu, per_cpu(cluster_cpus, cpu));
+            if ( cpumask_empty(per_cpu(cluster_cpus, cpu)) )
+                xfree(per_cpu(cluster_cpus, cpu));
+        }
+        free_cpumask_var(per_cpu(scratch_mask, cpu));
+        break;
+    }
+
+    return !err ? NOTIFY_DONE : notifier_from_errno(err);
+}
+
+static struct notifier_block x2apic_cpu_nfb =3D {
+   .notifier_call =3D update_clusterinfo
+};
+
 const struct genapic *__init apic_x2apic_probe(void)
 {
-    return x2apic_phys ? &apic_x2apic_phys : &apic_x2apic_cluster;
+    if ( x2apic_phys )
+        return &apic_x2apic_phys;
+
+    if ( !this_cpu(cluster_cpus) )
+    {
+        update_clusterinfo(NULL, CPU_UP_PREPARE,
+                           (void *)(long)smp_processor_id());
+        init_apic_ldr_x2apic_cluster();
+        register_cpu_notifier(&x2apic_cpu_nfb);
+    }
+
+    return &apic_x2apic_cluster;
 }
=20
 void __init check_x2apic_preenabled(void)



--=__PartBB8A7DD1.0__=
Content-Type: text/plain; name="x86-x2apic-cluster.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="x86-x2apic-cluster.patch"

x86/x2apic: properly implement cluster mode=0A=0ASo far, cluster mode was =
just an alternative implementation of=0Aphysical mode: Allowing only =
single CPU interrupt targets, and sending=0AIPIs to each target CPU =
separately. Take advantage of what cluster=0Amode really can do in that =
regard.=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- =
a/xen/arch/x86/genapic/x2apic.c=0A+++ b/xen/arch/x86/genapic/x2apic.c=0A@@ =
-19,6 +19,7 @@=0A =0A #include <xen/config.h>=0A #include <xen/init.h>=0A+#=
include <xen/cpu.h>=0A #include <xen/cpumask.h>=0A #include <asm/apicdef.h>=
=0A #include <asm/genapic.h>=0A@@ -33,6 +34,14 @@ static bool_t __initdata =
x2apic_phys; /*=0A boolean_param("x2apic_phys", x2apic_phys);=0A =0A =
static DEFINE_PER_CPU_READ_MOSTLY(u32, cpu_2_logical_apicid);=0A+static =
DEFINE_PER_CPU_READ_MOSTLY(cpumask_t *, cluster_cpus);=0A+static cpumask_t =
*cluster_cpus_spare;=0A+static DEFINE_PER_CPU(cpumask_var_t, scratch_mask);=
=0A+=0A+static inline u32 x2apic_cluster(unsigned int cpu)=0A+{=0A+    =
return per_cpu(cpu_2_logical_apicid, cpu) >> 16;=0A+}=0A =0A static void =
init_apic_ldr_x2apic_phys(void)=0A {=0A@@ -40,20 +49,53 @@ static void =
init_apic_ldr_x2apic_phys(vo=0A =0A static void init_apic_ldr_x2apic_cluste=
r(void)=0A {=0A-    this_cpu(cpu_2_logical_apicid) =3D apic_read(APIC_LDR);=
=0A+    unsigned int cpu, this_cpu =3D smp_processor_id();=0A+=0A+    =
per_cpu(cpu_2_logical_apicid, this_cpu) =3D apic_read(APIC_LDR);=0A+=0A+   =
 if ( per_cpu(cluster_cpus, this_cpu) )=0A+    {=0A+        ASSERT(cpumask_=
test_cpu(this_cpu, per_cpu(cluster_cpus, this_cpu)));=0A+        return;=0A=
+    }=0A+=0A+    per_cpu(cluster_cpus, this_cpu) =3D cluster_cpus_spare;=
=0A+    for_each_online_cpu ( cpu )=0A+    {=0A+        if (this_cpu =
=3D=3D cpu || x2apic_cluster(this_cpu) !=3D x2apic_cluster(cpu))=0A+       =
     continue;=0A+        per_cpu(cluster_cpus, this_cpu) =3D per_cpu(clust=
er_cpus, cpu);=0A+        break;=0A+    }=0A+    if ( per_cpu(cluster_cpus,=
 this_cpu) =3D=3D cluster_cpus_spare )=0A+        cluster_cpus_spare =3D =
NULL;=0A+=0A+    cpumask_set_cpu(this_cpu, per_cpu(cluster_cpus, this_cpu))=
;=0A }=0A =0A static void __init clustered_apic_check_x2apic(void)=0A {=0A =
}=0A =0A+static const cpumask_t *vector_allocation_cpumask_x2apic_cluster(i=
nt cpu)=0A+{=0A+    return per_cpu(cluster_cpus, cpu);=0A+}=0A+=0A static =
unsigned int cpu_mask_to_apicid_x2apic_cluster(const cpumask_t *cpumask)=0A=
 {=0A-    return per_cpu(cpu_2_logical_apicid, cpumask_first(cpumask));=0A+=
    unsigned int cpu =3D cpumask_first(cpumask);=0A+    unsigned int dest =
=3D per_cpu(cpu_2_logical_apicid, cpu);=0A+    const cpumask_t *cluster_cpu=
s =3D per_cpu(cluster_cpus, cpu);=0A+=0A+    for_each_cpu ( cpu, cluster_cp=
us )=0A+        if ( cpumask_test_cpu(cpu, cpumask) )=0A+            dest =
|=3D per_cpu(cpu_2_logical_apicid, cpu);=0A+=0A+    return dest;=0A }=0A =
=0A-static void __send_IPI_mask_x2apic(=0A-    const cpumask_t *cpumask, =
int vector, unsigned int dest_mode)=0A+static void send_IPI_mask_x2apic_phy=
s(const cpumask_t *cpumask, int vector)=0A {=0A     unsigned int cpu;=0A   =
  unsigned long flags;=0A@@ -77,23 +119,48 @@ static void __send_IPI_mask_x=
2apic(=0A     {=0A         if ( !cpu_online(cpu) || (cpu =3D=3D smp_process=
or_id()) )=0A             continue;=0A-        msr_content =3D (dest_mode =
=3D=3D APIC_DEST_PHYSICAL)=0A-            ? cpu_physical_id(cpu) : =
per_cpu(cpu_2_logical_apicid, cpu);=0A-        msr_content =3D (msr_content=
 << 32) | APIC_DM_FIXED | dest_mode | vector;=0A+        msr_content =3D =
cpu_physical_id(cpu);=0A+        msr_content =3D (msr_content << 32) | =
APIC_DM_FIXED |=0A+                      APIC_DEST_PHYSICAL | vector;=0A   =
      apic_wrmsr(APIC_ICR, msr_content);=0A     }=0A =0A     local_irq_rest=
ore(flags);=0A }=0A =0A-static void send_IPI_mask_x2apic_phys(const =
cpumask_t *cpumask, int vector)=0A-{=0A-    __send_IPI_mask_x2apic(cpumask,=
 vector, APIC_DEST_PHYSICAL);=0A-}=0A-=0A static void send_IPI_mask_x2apic_=
cluster(const cpumask_t *cpumask, int vector)=0A {=0A-    __send_IPI_mask_x=
2apic(cpumask, vector, APIC_DEST_LOGICAL);=0A+    unsigned int cpu =3D =
smp_processor_id();=0A+    cpumask_t *ipimask =3D per_cpu(scratch_mask, =
cpu);=0A+    const cpumask_t *cluster_cpus;=0A+    unsigned long flags;=0A+=
=0A+    mb(); /* See above for an explanation. */=0A+=0A+    local_irq_save=
(flags);=0A+=0A+    cpumask_andnot(ipimask, &cpu_online_map, cpumask_of(cpu=
));=0A+=0A+    for ( cpumask_and(ipimask, cpumask, ipimask); !cpumask_empty=
(ipimask);=0A+          cpumask_andnot(ipimask, ipimask, cluster_cpus) =
)=0A+    {=0A+        uint64_t msr_content =3D 0;=0A+=0A+        cluster_cp=
us =3D per_cpu(cluster_cpus, cpumask_first(ipimask));=0A+        for_each_c=
pu ( cpu, cluster_cpus )=0A+        {=0A+            if ( !cpumask_test_cpu=
(cpu, ipimask) )=0A+                continue;=0A+            msr_content =
|=3D per_cpu(cpu_2_logical_apicid, cpu);=0A+        }=0A+=0A+        =
BUG_ON(!msr_content);=0A+        msr_content =3D (msr_content << 32) | =
APIC_DM_FIXED |=0A+                      APIC_DEST_LOGICAL | vector;=0A+   =
     apic_wrmsr(APIC_ICR, msr_content);=0A+    }=0A+=0A+    local_irq_resto=
re(flags);=0A }=0A =0A static const struct genapic apic_x2apic_phys =3D =
{=0A@@ -116,15 +183,60 @@ static const struct genapic apic_x2apic_=0A     =
.init_apic_ldr =3D init_apic_ldr_x2apic_cluster,=0A     .clustered_apic_che=
ck =3D clustered_apic_check_x2apic,=0A     .target_cpus =3D target_cpus_all=
,=0A-    .vector_allocation_cpumask =3D vector_allocation_cpumask_phys,=0A+=
    .vector_allocation_cpumask =3D vector_allocation_cpumask_x2apic_cluster=
,=0A     .cpu_mask_to_apicid =3D cpu_mask_to_apicid_x2apic_cluster,=0A     =
.send_IPI_mask =3D send_IPI_mask_x2apic_cluster,=0A     .send_IPI_self =3D =
send_IPI_self_x2apic=0A };=0A =0A+static int update_clusterinfo(=0A+    =
struct notifier_block *nfb, unsigned long action, void *hcpu)=0A+{=0A+    =
unsigned int cpu =3D (unsigned long)hcpu;=0A+    int err =3D 0;=0A+=0A+    =
switch (action) {=0A+    case CPU_UP_PREPARE:=0A+        per_cpu(cpu_2_logi=
cal_apicid, cpu) =3D BAD_APICID;=0A+        if ( !cluster_cpus_spare )=0A+ =
           cluster_cpus_spare =3D xzalloc(cpumask_t);=0A+        if ( =
!cluster_cpus_spare ||=0A+             !alloc_cpumask_var(&per_cpu(scratch_=
mask, cpu)) )=0A+            err =3D -ENOMEM;=0A+        break;=0A+    =
case CPU_UP_CANCELED:=0A+    case CPU_DEAD:=0A+        if ( per_cpu(cluster=
_cpus, cpu) )=0A+        {=0A+            cpumask_clear_cpu(cpu, per_cpu(cl=
uster_cpus, cpu));=0A+            if ( cpumask_empty(per_cpu(cluster_cpus, =
cpu)) )=0A+                xfree(per_cpu(cluster_cpus, cpu));=0A+        =
}=0A+        free_cpumask_var(per_cpu(scratch_mask, cpu));=0A+        =
break;=0A+    }=0A+=0A+    return !err ? NOTIFY_DONE : notifier_from_errno(=
err);=0A+}=0A+=0A+static struct notifier_block x2apic_cpu_nfb =3D {=0A+   =
.notifier_call =3D update_clusterinfo=0A+};=0A+=0A const struct genapic =
*__init apic_x2apic_probe(void)=0A {=0A-    return x2apic_phys ? &apic_x2ap=
ic_phys : &apic_x2apic_cluster;=0A+    if ( x2apic_phys )=0A+        =
return &apic_x2apic_phys;=0A+=0A+    if ( !this_cpu(cluster_cpus) )=0A+    =
{=0A+        update_clusterinfo(NULL, CPU_UP_PREPARE,=0A+                  =
         (void *)(long)smp_processor_id());=0A+        init_apic_ldr_x2apic=
_cluster();=0A+        register_cpu_notifier(&x2apic_cpu_nfb);=0A+    =
}=0A+=0A+    return &apic_x2apic_cluster;=0A }=0A =0A void __init =
check_x2apic_preenabled(void)=0A
--=__PartBB8A7DD1.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.xen.org
http://lists.xen.org/xen-devel

--=__PartBB8A7DD1.0__=--


From xen-devel-bounces@lists.xen.org Thu Nov 08 15:03:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:03:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWTdl-0001Bl-0V; Thu, 08 Nov 2012 15:03:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWTdk-0001BX-0L
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 15:03:32 +0000
Received: from [85.158.137.99:31040] by server-6.bemta-3.messagelabs.com id
	08/1A-28265-3C9CB905; Thu, 08 Nov 2012 15:03:31 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352387009!18185160!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1010 invoked from network); 8 Nov 2012 15:03:29 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-217.messagelabs.com with SMTP;
	8 Nov 2012 15:03:29 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 15:03:29 +0000
Message-Id: <509BD7D102000078000A7440@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 15:03:29 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <509BD6E702000078000A742E@nat28.tlf.novell.com>
In-Reply-To: <509BD6E702000078000A742E@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartBB8A7DD1.0__="
Subject: [Xen-devel] [PATCH 2/2] x86/x2apic: properly implement cluster mode
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartBB8A7DD1.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

So far, cluster mode was just an alternative implementation of
physical mode: Allowing only single CPU interrupt targets, and sending
IPIs to each target CPU separately. Take advantage of what cluster
mode really can do in that regard.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -19,6 +19,7 @@
=20
 #include <xen/config.h>
 #include <xen/init.h>
+#include <xen/cpu.h>
 #include <xen/cpumask.h>
 #include <asm/apicdef.h>
 #include <asm/genapic.h>
@@ -33,6 +34,14 @@ static bool_t __initdata x2apic_phys; /*
 boolean_param("x2apic_phys", x2apic_phys);
=20
 static DEFINE_PER_CPU_READ_MOSTLY(u32, cpu_2_logical_apicid);
+static DEFINE_PER_CPU_READ_MOSTLY(cpumask_t *, cluster_cpus);
+static cpumask_t *cluster_cpus_spare;
+static DEFINE_PER_CPU(cpumask_var_t, scratch_mask);
+
+static inline u32 x2apic_cluster(unsigned int cpu)
+{
+    return per_cpu(cpu_2_logical_apicid, cpu) >> 16;
+}
=20
 static void init_apic_ldr_x2apic_phys(void)
 {
@@ -40,20 +49,53 @@ static void init_apic_ldr_x2apic_phys(vo
=20
 static void init_apic_ldr_x2apic_cluster(void)
 {
-    this_cpu(cpu_2_logical_apicid) =3D apic_read(APIC_LDR);
+    unsigned int cpu, this_cpu =3D smp_processor_id();
+
+    per_cpu(cpu_2_logical_apicid, this_cpu) =3D apic_read(APIC_LDR);
+
+    if ( per_cpu(cluster_cpus, this_cpu) )
+    {
+        ASSERT(cpumask_test_cpu(this_cpu, per_cpu(cluster_cpus, this_cpu))=
);
+        return;
+    }
+
+    per_cpu(cluster_cpus, this_cpu) =3D cluster_cpus_spare;
+    for_each_online_cpu ( cpu )
+    {
+        if (this_cpu =3D=3D cpu || x2apic_cluster(this_cpu) !=3D =
x2apic_cluster(cpu))
+            continue;
+        per_cpu(cluster_cpus, this_cpu) =3D per_cpu(cluster_cpus, cpu);
+        break;
+    }
+    if ( per_cpu(cluster_cpus, this_cpu) =3D=3D cluster_cpus_spare )
+        cluster_cpus_spare =3D NULL;
+
+    cpumask_set_cpu(this_cpu, per_cpu(cluster_cpus, this_cpu));
 }
=20
 static void __init clustered_apic_check_x2apic(void)
 {
 }
=20
+static const cpumask_t *vector_allocation_cpumask_x2apic_cluster(int cpu)
+{
+    return per_cpu(cluster_cpus, cpu);
+}
+
 static unsigned int cpu_mask_to_apicid_x2apic_cluster(const cpumask_t =
*cpumask)
 {
-    return per_cpu(cpu_2_logical_apicid, cpumask_first(cpumask));
+    unsigned int cpu =3D cpumask_first(cpumask);
+    unsigned int dest =3D per_cpu(cpu_2_logical_apicid, cpu);
+    const cpumask_t *cluster_cpus =3D per_cpu(cluster_cpus, cpu);
+
+    for_each_cpu ( cpu, cluster_cpus )
+        if ( cpumask_test_cpu(cpu, cpumask) )
+            dest |=3D per_cpu(cpu_2_logical_apicid, cpu);
+
+    return dest;
 }
=20
-static void __send_IPI_mask_x2apic(
-    const cpumask_t *cpumask, int vector, unsigned int dest_mode)
+static void send_IPI_mask_x2apic_phys(const cpumask_t *cpumask, int =
vector)
 {
     unsigned int cpu;
     unsigned long flags;
@@ -77,23 +119,48 @@ static void __send_IPI_mask_x2apic(
     {
         if ( !cpu_online(cpu) || (cpu =3D=3D smp_processor_id()) )
             continue;
-        msr_content =3D (dest_mode =3D=3D APIC_DEST_PHYSICAL)
-            ? cpu_physical_id(cpu) : per_cpu(cpu_2_logical_apicid, cpu);
-        msr_content =3D (msr_content << 32) | APIC_DM_FIXED | dest_mode | =
vector;
+        msr_content =3D cpu_physical_id(cpu);
+        msr_content =3D (msr_content << 32) | APIC_DM_FIXED |
+                      APIC_DEST_PHYSICAL | vector;
         apic_wrmsr(APIC_ICR, msr_content);
     }
=20
     local_irq_restore(flags);
 }
=20
-static void send_IPI_mask_x2apic_phys(const cpumask_t *cpumask, int =
vector)
-{
-    __send_IPI_mask_x2apic(cpumask, vector, APIC_DEST_PHYSICAL);
-}
-
 static void send_IPI_mask_x2apic_cluster(const cpumask_t *cpumask, int =
vector)
 {
-    __send_IPI_mask_x2apic(cpumask, vector, APIC_DEST_LOGICAL);
+    unsigned int cpu =3D smp_processor_id();
+    cpumask_t *ipimask =3D per_cpu(scratch_mask, cpu);
+    const cpumask_t *cluster_cpus;
+    unsigned long flags;
+
+    mb(); /* See above for an explanation. */
+
+    local_irq_save(flags);
+
+    cpumask_andnot(ipimask, &cpu_online_map, cpumask_of(cpu));
+
+    for ( cpumask_and(ipimask, cpumask, ipimask); !cpumask_empty(ipimask);=

+          cpumask_andnot(ipimask, ipimask, cluster_cpus) )
+    {
+        uint64_t msr_content =3D 0;
+
+        cluster_cpus =3D per_cpu(cluster_cpus, cpumask_first(ipimask));
+        for_each_cpu ( cpu, cluster_cpus )
+        {
+            if ( !cpumask_test_cpu(cpu, ipimask) )
+                continue;
+            msr_content |=3D per_cpu(cpu_2_logical_apicid, cpu);
+        }
+
+        BUG_ON(!msr_content);
+        msr_content =3D (msr_content << 32) | APIC_DM_FIXED |
+                      APIC_DEST_LOGICAL | vector;
+        apic_wrmsr(APIC_ICR, msr_content);
+    }
+
+    local_irq_restore(flags);
 }
=20
 static const struct genapic apic_x2apic_phys =3D {
@@ -116,15 +183,60 @@ static const struct genapic apic_x2apic_
     .init_apic_ldr =3D init_apic_ldr_x2apic_cluster,
     .clustered_apic_check =3D clustered_apic_check_x2apic,
     .target_cpus =3D target_cpus_all,
-    .vector_allocation_cpumask =3D vector_allocation_cpumask_phys,
+    .vector_allocation_cpumask =3D vector_allocation_cpumask_x2apic_cluste=
r,
     .cpu_mask_to_apicid =3D cpu_mask_to_apicid_x2apic_cluster,
     .send_IPI_mask =3D send_IPI_mask_x2apic_cluster,
     .send_IPI_self =3D send_IPI_self_x2apic
 };
=20
+static int update_clusterinfo(
+    struct notifier_block *nfb, unsigned long action, void *hcpu)
+{
+    unsigned int cpu =3D (unsigned long)hcpu;
+    int err =3D 0;
+
+    switch (action) {
+    case CPU_UP_PREPARE:
+        per_cpu(cpu_2_logical_apicid, cpu) =3D BAD_APICID;
+        if ( !cluster_cpus_spare )
+            cluster_cpus_spare =3D xzalloc(cpumask_t);
+        if ( !cluster_cpus_spare ||
+             !alloc_cpumask_var(&per_cpu(scratch_mask, cpu)) )
+            err =3D -ENOMEM;
+        break;
+    case CPU_UP_CANCELED:
+    case CPU_DEAD:
+        if ( per_cpu(cluster_cpus, cpu) )
+        {
+            cpumask_clear_cpu(cpu, per_cpu(cluster_cpus, cpu));
+            if ( cpumask_empty(per_cpu(cluster_cpus, cpu)) )
+                xfree(per_cpu(cluster_cpus, cpu));
+        }
+        free_cpumask_var(per_cpu(scratch_mask, cpu));
+        break;
+    }
+
+    return !err ? NOTIFY_DONE : notifier_from_errno(err);
+}
+
+static struct notifier_block x2apic_cpu_nfb =3D {
+   .notifier_call =3D update_clusterinfo
+};
+
 const struct genapic *__init apic_x2apic_probe(void)
 {
-    return x2apic_phys ? &apic_x2apic_phys : &apic_x2apic_cluster;
+    if ( x2apic_phys )
+        return &apic_x2apic_phys;
+
+    if ( !this_cpu(cluster_cpus) )
+    {
+        update_clusterinfo(NULL, CPU_UP_PREPARE,
+                           (void *)(long)smp_processor_id());
+        init_apic_ldr_x2apic_cluster();
+        register_cpu_notifier(&x2apic_cpu_nfb);
+    }
+
+    return &apic_x2apic_cluster;
 }
=20
 void __init check_x2apic_preenabled(void)



--=__PartBB8A7DD1.0__=
Content-Type: text/plain; name="x86-x2apic-cluster.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="x86-x2apic-cluster.patch"

x86/x2apic: properly implement cluster mode=0A=0ASo far, cluster mode was =
just an alternative implementation of=0Aphysical mode: Allowing only =
single CPU interrupt targets, and sending=0AIPIs to each target CPU =
separately. Take advantage of what cluster=0Amode really can do in that =
regard.=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- =
a/xen/arch/x86/genapic/x2apic.c=0A+++ b/xen/arch/x86/genapic/x2apic.c=0A@@ =
-19,6 +19,7 @@=0A =0A #include <xen/config.h>=0A #include <xen/init.h>=0A+#=
include <xen/cpu.h>=0A #include <xen/cpumask.h>=0A #include <asm/apicdef.h>=
=0A #include <asm/genapic.h>=0A@@ -33,6 +34,14 @@ static bool_t __initdata =
x2apic_phys; /*=0A boolean_param("x2apic_phys", x2apic_phys);=0A =0A =
static DEFINE_PER_CPU_READ_MOSTLY(u32, cpu_2_logical_apicid);=0A+static =
DEFINE_PER_CPU_READ_MOSTLY(cpumask_t *, cluster_cpus);=0A+static cpumask_t =
*cluster_cpus_spare;=0A+static DEFINE_PER_CPU(cpumask_var_t, scratch_mask);=
=0A+=0A+static inline u32 x2apic_cluster(unsigned int cpu)=0A+{=0A+    =
return per_cpu(cpu_2_logical_apicid, cpu) >> 16;=0A+}=0A =0A static void =
init_apic_ldr_x2apic_phys(void)=0A {=0A@@ -40,20 +49,53 @@ static void =
init_apic_ldr_x2apic_phys(vo=0A =0A static void init_apic_ldr_x2apic_cluste=
r(void)=0A {=0A-    this_cpu(cpu_2_logical_apicid) =3D apic_read(APIC_LDR);=
=0A+    unsigned int cpu, this_cpu =3D smp_processor_id();=0A+=0A+    =
per_cpu(cpu_2_logical_apicid, this_cpu) =3D apic_read(APIC_LDR);=0A+=0A+   =
 if ( per_cpu(cluster_cpus, this_cpu) )=0A+    {=0A+        ASSERT(cpumask_=
test_cpu(this_cpu, per_cpu(cluster_cpus, this_cpu)));=0A+        return;=0A=
+    }=0A+=0A+    per_cpu(cluster_cpus, this_cpu) =3D cluster_cpus_spare;=
=0A+    for_each_online_cpu ( cpu )=0A+    {=0A+        if (this_cpu =
=3D=3D cpu || x2apic_cluster(this_cpu) !=3D x2apic_cluster(cpu))=0A+       =
     continue;=0A+        per_cpu(cluster_cpus, this_cpu) =3D per_cpu(clust=
er_cpus, cpu);=0A+        break;=0A+    }=0A+    if ( per_cpu(cluster_cpus,=
 this_cpu) =3D=3D cluster_cpus_spare )=0A+        cluster_cpus_spare =3D =
NULL;=0A+=0A+    cpumask_set_cpu(this_cpu, per_cpu(cluster_cpus, this_cpu))=
;=0A }=0A =0A static void __init clustered_apic_check_x2apic(void)=0A {=0A =
}=0A =0A+static const cpumask_t *vector_allocation_cpumask_x2apic_cluster(i=
nt cpu)=0A+{=0A+    return per_cpu(cluster_cpus, cpu);=0A+}=0A+=0A static =
unsigned int cpu_mask_to_apicid_x2apic_cluster(const cpumask_t *cpumask)=0A=
 {=0A-    return per_cpu(cpu_2_logical_apicid, cpumask_first(cpumask));=0A+=
    unsigned int cpu =3D cpumask_first(cpumask);=0A+    unsigned int dest =
=3D per_cpu(cpu_2_logical_apicid, cpu);=0A+    const cpumask_t *cluster_cpu=
s =3D per_cpu(cluster_cpus, cpu);=0A+=0A+    for_each_cpu ( cpu, cluster_cp=
us )=0A+        if ( cpumask_test_cpu(cpu, cpumask) )=0A+            dest =
|=3D per_cpu(cpu_2_logical_apicid, cpu);=0A+=0A+    return dest;=0A }=0A =
=0A-static void __send_IPI_mask_x2apic(=0A-    const cpumask_t *cpumask, =
int vector, unsigned int dest_mode)=0A+static void send_IPI_mask_x2apic_phy=
s(const cpumask_t *cpumask, int vector)=0A {=0A     unsigned int cpu;=0A   =
  unsigned long flags;=0A@@ -77,23 +119,48 @@ static void __send_IPI_mask_x=
2apic(=0A     {=0A         if ( !cpu_online(cpu) || (cpu =3D=3D smp_process=
or_id()) )=0A             continue;=0A-        msr_content =3D (dest_mode =
=3D=3D APIC_DEST_PHYSICAL)=0A-            ? cpu_physical_id(cpu) : =
per_cpu(cpu_2_logical_apicid, cpu);=0A-        msr_content =3D (msr_content=
 << 32) | APIC_DM_FIXED | dest_mode | vector;=0A+        msr_content =3D =
cpu_physical_id(cpu);=0A+        msr_content =3D (msr_content << 32) | =
APIC_DM_FIXED |=0A+                      APIC_DEST_PHYSICAL | vector;=0A   =
      apic_wrmsr(APIC_ICR, msr_content);=0A     }=0A =0A     local_irq_rest=
ore(flags);=0A }=0A =0A-static void send_IPI_mask_x2apic_phys(const =
cpumask_t *cpumask, int vector)=0A-{=0A-    __send_IPI_mask_x2apic(cpumask,=
 vector, APIC_DEST_PHYSICAL);=0A-}=0A-=0A static void send_IPI_mask_x2apic_=
cluster(const cpumask_t *cpumask, int vector)=0A {=0A-    __send_IPI_mask_x=
2apic(cpumask, vector, APIC_DEST_LOGICAL);=0A+    unsigned int cpu =3D =
smp_processor_id();=0A+    cpumask_t *ipimask =3D per_cpu(scratch_mask, =
cpu);=0A+    const cpumask_t *cluster_cpus;=0A+    unsigned long flags;=0A+=
=0A+    mb(); /* See above for an explanation. */=0A+=0A+    local_irq_save=
(flags);=0A+=0A+    cpumask_andnot(ipimask, &cpu_online_map, cpumask_of(cpu=
));=0A+=0A+    for ( cpumask_and(ipimask, cpumask, ipimask); !cpumask_empty=
(ipimask);=0A+          cpumask_andnot(ipimask, ipimask, cluster_cpus) =
)=0A+    {=0A+        uint64_t msr_content =3D 0;=0A+=0A+        cluster_cp=
us =3D per_cpu(cluster_cpus, cpumask_first(ipimask));=0A+        for_each_c=
pu ( cpu, cluster_cpus )=0A+        {=0A+            if ( !cpumask_test_cpu=
(cpu, ipimask) )=0A+                continue;=0A+            msr_content =
|=3D per_cpu(cpu_2_logical_apicid, cpu);=0A+        }=0A+=0A+        =
BUG_ON(!msr_content);=0A+        msr_content =3D (msr_content << 32) | =
APIC_DM_FIXED |=0A+                      APIC_DEST_LOGICAL | vector;=0A+   =
     apic_wrmsr(APIC_ICR, msr_content);=0A+    }=0A+=0A+    local_irq_resto=
re(flags);=0A }=0A =0A static const struct genapic apic_x2apic_phys =3D =
{=0A@@ -116,15 +183,60 @@ static const struct genapic apic_x2apic_=0A     =
.init_apic_ldr =3D init_apic_ldr_x2apic_cluster,=0A     .clustered_apic_che=
ck =3D clustered_apic_check_x2apic,=0A     .target_cpus =3D target_cpus_all=
,=0A-    .vector_allocation_cpumask =3D vector_allocation_cpumask_phys,=0A+=
    .vector_allocation_cpumask =3D vector_allocation_cpumask_x2apic_cluster=
,=0A     .cpu_mask_to_apicid =3D cpu_mask_to_apicid_x2apic_cluster,=0A     =
.send_IPI_mask =3D send_IPI_mask_x2apic_cluster,=0A     .send_IPI_self =3D =
send_IPI_self_x2apic=0A };=0A =0A+static int update_clusterinfo(=0A+    =
struct notifier_block *nfb, unsigned long action, void *hcpu)=0A+{=0A+    =
unsigned int cpu =3D (unsigned long)hcpu;=0A+    int err =3D 0;=0A+=0A+    =
switch (action) {=0A+    case CPU_UP_PREPARE:=0A+        per_cpu(cpu_2_logi=
cal_apicid, cpu) =3D BAD_APICID;=0A+        if ( !cluster_cpus_spare )=0A+ =
           cluster_cpus_spare =3D xzalloc(cpumask_t);=0A+        if ( =
!cluster_cpus_spare ||=0A+             !alloc_cpumask_var(&per_cpu(scratch_=
mask, cpu)) )=0A+            err =3D -ENOMEM;=0A+        break;=0A+    =
case CPU_UP_CANCELED:=0A+    case CPU_DEAD:=0A+        if ( per_cpu(cluster=
_cpus, cpu) )=0A+        {=0A+            cpumask_clear_cpu(cpu, per_cpu(cl=
uster_cpus, cpu));=0A+            if ( cpumask_empty(per_cpu(cluster_cpus, =
cpu)) )=0A+                xfree(per_cpu(cluster_cpus, cpu));=0A+        =
}=0A+        free_cpumask_var(per_cpu(scratch_mask, cpu));=0A+        =
break;=0A+    }=0A+=0A+    return !err ? NOTIFY_DONE : notifier_from_errno(=
err);=0A+}=0A+=0A+static struct notifier_block x2apic_cpu_nfb =3D {=0A+   =
.notifier_call =3D update_clusterinfo=0A+};=0A+=0A const struct genapic =
*__init apic_x2apic_probe(void)=0A {=0A-    return x2apic_phys ? &apic_x2ap=
ic_phys : &apic_x2apic_cluster;=0A+    if ( x2apic_phys )=0A+        =
return &apic_x2apic_phys;=0A+=0A+    if ( !this_cpu(cluster_cpus) )=0A+    =
{=0A+        update_clusterinfo(NULL, CPU_UP_PREPARE,=0A+                  =
         (void *)(long)smp_processor_id());=0A+        init_apic_ldr_x2apic=
_cluster();=0A+        register_cpu_notifier(&x2apic_cpu_nfb);=0A+    =
}=0A+=0A+    return &apic_x2apic_cluster;=0A }=0A =0A void __init =
check_x2apic_preenabled(void)=0A
--=__PartBB8A7DD1.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.xen.org
http://lists.xen.org/xen-devel

--=__PartBB8A7DD1.0__=--


From xen-devel-bounces@lists.xen.org Thu Nov 08 15:18:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:18:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWTrk-0001W4-Kz; Thu, 08 Nov 2012 15:18:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWTrj-0001Vz-2Y
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 15:17:59 +0000
Received: from [85.158.139.83:20752] by server-14.bemta-5.messagelabs.com id
	1B/1B-21768-62DCB905; Thu, 08 Nov 2012 15:17:58 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1352387877!24787396!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20382 invoked from network); 8 Nov 2012 15:17:57 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-6.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 15:17:57 -0000
Received: by mail-ee0-f45.google.com with SMTP id b47so1946516eek.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 07:17:57 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=/KUmASIQJWeijtV0H1Pn4m1h3+KNZc7k01iLXxoICMs=;
	b=jWfm6tOBv23PbloG4P4oU6tF2UQkcHTAQNqt8+iy1isp6OSHIdQS+W7YlFANZl5MlO
	5b9itCO8f5Gp6ygu1yHbrOnNDlwv5McCk5xJau2bvWFqQJMrIxmsOxn+R+eDhvRr6aRE
	dbZ7iMTHVCKU4/HoMHZx/+XuR5Y/W3QXz7HFGlgqrtay65mTmuwEMCUscunj1GHXJyVF
	cALTV2edmW7bhbmxs79565N0TiWzQ80Dksvp9YhKW9TbVjpaf5uEs+zqDrmau2hey8ci
	75lj4EjI9idzirBljekVELjqNvgaVbmtbU+8V+xKznDfI2tkq3oavrFRbpyC6VkpT6mT
	dCBA==
Received: by 10.14.214.2 with SMTP id b2mr28363057eep.32.1352387877145;
	Thu, 08 Nov 2012 07:17:57 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id t7sm70843191eel.14.2012.11.08.07.17.55
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 07:17:56 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 15:17:45 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCC17D99.51BB1%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH 2/2] x86/x2apic: properly implement cluster
	mode
Thread-Index: Ac29xDQp3gwAiOemPEStfcA1GgAuHQ==
In-Reply-To: <509BD7D102000078000A7440@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH 2/2] x86/x2apic: properly implement cluster
 mode
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 15:03, "Jan Beulich" <JBeulich@suse.com> wrote:

> So far, cluster mode was just an alternative implementation of
> physical mode: Allowing only single CPU interrupt targets, and sending
> IPIs to each target CPU separately. Take advantage of what cluster
> mode really can do in that regard.

What does it allow? Multicast within certain constraints? I know it's not
part of our coding style, but some comments would be nice. ;)

 -- Keir

> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/arch/x86/genapic/x2apic.c
> +++ b/xen/arch/x86/genapic/x2apic.c
> @@ -19,6 +19,7 @@
>  
>  #include <xen/config.h>
>  #include <xen/init.h>
> +#include <xen/cpu.h>
>  #include <xen/cpumask.h>
>  #include <asm/apicdef.h>
>  #include <asm/genapic.h>
> @@ -33,6 +34,14 @@ static bool_t __initdata x2apic_phys; /*
>  boolean_param("x2apic_phys", x2apic_phys);
>  
>  static DEFINE_PER_CPU_READ_MOSTLY(u32, cpu_2_logical_apicid);
> +static DEFINE_PER_CPU_READ_MOSTLY(cpumask_t *, cluster_cpus);
> +static cpumask_t *cluster_cpus_spare;
> +static DEFINE_PER_CPU(cpumask_var_t, scratch_mask);
> +
> +static inline u32 x2apic_cluster(unsigned int cpu)
> +{
> +    return per_cpu(cpu_2_logical_apicid, cpu) >> 16;
> +}
>  
>  static void init_apic_ldr_x2apic_phys(void)
>  {
> @@ -40,20 +49,53 @@ static void init_apic_ldr_x2apic_phys(vo
>  
>  static void init_apic_ldr_x2apic_cluster(void)
>  {
> -    this_cpu(cpu_2_logical_apicid) = apic_read(APIC_LDR);
> +    unsigned int cpu, this_cpu = smp_processor_id();
> +
> +    per_cpu(cpu_2_logical_apicid, this_cpu) = apic_read(APIC_LDR);
> +
> +    if ( per_cpu(cluster_cpus, this_cpu) )
> +    {
> +        ASSERT(cpumask_test_cpu(this_cpu, per_cpu(cluster_cpus, this_cpu)));
> +        return;
> +    }
> +
> +    per_cpu(cluster_cpus, this_cpu) = cluster_cpus_spare;
> +    for_each_online_cpu ( cpu )
> +    {
> +        if (this_cpu == cpu || x2apic_cluster(this_cpu) !=
> x2apic_cluster(cpu))
> +            continue;
> +        per_cpu(cluster_cpus, this_cpu) = per_cpu(cluster_cpus, cpu);
> +        break;
> +    }
> +    if ( per_cpu(cluster_cpus, this_cpu) == cluster_cpus_spare )
> +        cluster_cpus_spare = NULL;
> +
> +    cpumask_set_cpu(this_cpu, per_cpu(cluster_cpus, this_cpu));
>  }
>  
>  static void __init clustered_apic_check_x2apic(void)
>  {
>  }
>  
> +static const cpumask_t *vector_allocation_cpumask_x2apic_cluster(int cpu)
> +{
> +    return per_cpu(cluster_cpus, cpu);
> +}
> +
>  static unsigned int cpu_mask_to_apicid_x2apic_cluster(const cpumask_t
> *cpumask)
>  {
> -    return per_cpu(cpu_2_logical_apicid, cpumask_first(cpumask));
> +    unsigned int cpu = cpumask_first(cpumask);
> +    unsigned int dest = per_cpu(cpu_2_logical_apicid, cpu);
> +    const cpumask_t *cluster_cpus = per_cpu(cluster_cpus, cpu);
> +
> +    for_each_cpu ( cpu, cluster_cpus )
> +        if ( cpumask_test_cpu(cpu, cpumask) )
> +            dest |= per_cpu(cpu_2_logical_apicid, cpu);
> +
> +    return dest;
>  }
>  
> -static void __send_IPI_mask_x2apic(
> -    const cpumask_t *cpumask, int vector, unsigned int dest_mode)
> +static void send_IPI_mask_x2apic_phys(const cpumask_t *cpumask, int vector)
>  {
>      unsigned int cpu;
>      unsigned long flags;
> @@ -77,23 +119,48 @@ static void __send_IPI_mask_x2apic(
>      {
>          if ( !cpu_online(cpu) || (cpu == smp_processor_id()) )
>              continue;
> -        msr_content = (dest_mode == APIC_DEST_PHYSICAL)
> -            ? cpu_physical_id(cpu) : per_cpu(cpu_2_logical_apicid, cpu);
> -        msr_content = (msr_content << 32) | APIC_DM_FIXED | dest_mode |
> vector;
> +        msr_content = cpu_physical_id(cpu);
> +        msr_content = (msr_content << 32) | APIC_DM_FIXED |
> +                      APIC_DEST_PHYSICAL | vector;
>          apic_wrmsr(APIC_ICR, msr_content);
>      }
>  
>      local_irq_restore(flags);
>  }
>  
> -static void send_IPI_mask_x2apic_phys(const cpumask_t *cpumask, int vector)
> -{
> -    __send_IPI_mask_x2apic(cpumask, vector, APIC_DEST_PHYSICAL);
> -}
> -
>  static void send_IPI_mask_x2apic_cluster(const cpumask_t *cpumask, int
> vector)
>  {
> -    __send_IPI_mask_x2apic(cpumask, vector, APIC_DEST_LOGICAL);
> +    unsigned int cpu = smp_processor_id();
> +    cpumask_t *ipimask = per_cpu(scratch_mask, cpu);
> +    const cpumask_t *cluster_cpus;
> +    unsigned long flags;
> +
> +    mb(); /* See above for an explanation. */
> +
> +    local_irq_save(flags);
> +
> +    cpumask_andnot(ipimask, &cpu_online_map, cpumask_of(cpu));
> +
> +    for ( cpumask_and(ipimask, cpumask, ipimask); !cpumask_empty(ipimask);
> +          cpumask_andnot(ipimask, ipimask, cluster_cpus) )
> +    {
> +        uint64_t msr_content = 0;
> +
> +        cluster_cpus = per_cpu(cluster_cpus, cpumask_first(ipimask));
> +        for_each_cpu ( cpu, cluster_cpus )
> +        {
> +            if ( !cpumask_test_cpu(cpu, ipimask) )
> +                continue;
> +            msr_content |= per_cpu(cpu_2_logical_apicid, cpu);
> +        }
> +
> +        BUG_ON(!msr_content);
> +        msr_content = (msr_content << 32) | APIC_DM_FIXED |
> +                      APIC_DEST_LOGICAL | vector;
> +        apic_wrmsr(APIC_ICR, msr_content);
> +    }
> +
> +    local_irq_restore(flags);
>  }
>  
>  static const struct genapic apic_x2apic_phys = {
> @@ -116,15 +183,60 @@ static const struct genapic apic_x2apic_
>      .init_apic_ldr = init_apic_ldr_x2apic_cluster,
>      .clustered_apic_check = clustered_apic_check_x2apic,
>      .target_cpus = target_cpus_all,
> -    .vector_allocation_cpumask = vector_allocation_cpumask_phys,
> +    .vector_allocation_cpumask = vector_allocation_cpumask_x2apic_cluster,
>      .cpu_mask_to_apicid = cpu_mask_to_apicid_x2apic_cluster,
>      .send_IPI_mask = send_IPI_mask_x2apic_cluster,
>      .send_IPI_self = send_IPI_self_x2apic
>  };
>  
> +static int update_clusterinfo(
> +    struct notifier_block *nfb, unsigned long action, void *hcpu)
> +{
> +    unsigned int cpu = (unsigned long)hcpu;
> +    int err = 0;
> +
> +    switch (action) {
> +    case CPU_UP_PREPARE:
> +        per_cpu(cpu_2_logical_apicid, cpu) = BAD_APICID;
> +        if ( !cluster_cpus_spare )
> +            cluster_cpus_spare = xzalloc(cpumask_t);
> +        if ( !cluster_cpus_spare ||
> +             !alloc_cpumask_var(&per_cpu(scratch_mask, cpu)) )
> +            err = -ENOMEM;
> +        break;
> +    case CPU_UP_CANCELED:
> +    case CPU_DEAD:
> +        if ( per_cpu(cluster_cpus, cpu) )
> +        {
> +            cpumask_clear_cpu(cpu, per_cpu(cluster_cpus, cpu));
> +            if ( cpumask_empty(per_cpu(cluster_cpus, cpu)) )
> +                xfree(per_cpu(cluster_cpus, cpu));
> +        }
> +        free_cpumask_var(per_cpu(scratch_mask, cpu));
> +        break;
> +    }
> +
> +    return !err ? NOTIFY_DONE : notifier_from_errno(err);
> +}
> +
> +static struct notifier_block x2apic_cpu_nfb = {
> +   .notifier_call = update_clusterinfo
> +};
> +
>  const struct genapic *__init apic_x2apic_probe(void)
>  {
> -    return x2apic_phys ? &apic_x2apic_phys : &apic_x2apic_cluster;
> +    if ( x2apic_phys )
> +        return &apic_x2apic_phys;
> +
> +    if ( !this_cpu(cluster_cpus) )
> +    {
> +        update_clusterinfo(NULL, CPU_UP_PREPARE,
> +                           (void *)(long)smp_processor_id());
> +        init_apic_ldr_x2apic_cluster();
> +        register_cpu_notifier(&x2apic_cpu_nfb);
> +    }
> +
> +    return &apic_x2apic_cluster;
>  }
>  
>  void __init check_x2apic_preenabled(void)
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:18:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:18:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWTrk-0001W4-Kz; Thu, 08 Nov 2012 15:18:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWTrj-0001Vz-2Y
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 15:17:59 +0000
Received: from [85.158.139.83:20752] by server-14.bemta-5.messagelabs.com id
	1B/1B-21768-62DCB905; Thu, 08 Nov 2012 15:17:58 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1352387877!24787396!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20382 invoked from network); 8 Nov 2012 15:17:57 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-6.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 15:17:57 -0000
Received: by mail-ee0-f45.google.com with SMTP id b47so1946516eek.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 07:17:57 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=/KUmASIQJWeijtV0H1Pn4m1h3+KNZc7k01iLXxoICMs=;
	b=jWfm6tOBv23PbloG4P4oU6tF2UQkcHTAQNqt8+iy1isp6OSHIdQS+W7YlFANZl5MlO
	5b9itCO8f5Gp6ygu1yHbrOnNDlwv5McCk5xJau2bvWFqQJMrIxmsOxn+R+eDhvRr6aRE
	dbZ7iMTHVCKU4/HoMHZx/+XuR5Y/W3QXz7HFGlgqrtay65mTmuwEMCUscunj1GHXJyVF
	cALTV2edmW7bhbmxs79565N0TiWzQ80Dksvp9YhKW9TbVjpaf5uEs+zqDrmau2hey8ci
	75lj4EjI9idzirBljekVELjqNvgaVbmtbU+8V+xKznDfI2tkq3oavrFRbpyC6VkpT6mT
	dCBA==
Received: by 10.14.214.2 with SMTP id b2mr28363057eep.32.1352387877145;
	Thu, 08 Nov 2012 07:17:57 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id t7sm70843191eel.14.2012.11.08.07.17.55
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 07:17:56 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 15:17:45 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCC17D99.51BB1%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH 2/2] x86/x2apic: properly implement cluster
	mode
Thread-Index: Ac29xDQp3gwAiOemPEStfcA1GgAuHQ==
In-Reply-To: <509BD7D102000078000A7440@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH 2/2] x86/x2apic: properly implement cluster
 mode
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 15:03, "Jan Beulich" <JBeulich@suse.com> wrote:

> So far, cluster mode was just an alternative implementation of
> physical mode: Allowing only single CPU interrupt targets, and sending
> IPIs to each target CPU separately. Take advantage of what cluster
> mode really can do in that regard.

What does it allow? Multicast within certain constraints? I know it's not
part of our coding style, but some comments would be nice. ;)

 -- Keir

> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/arch/x86/genapic/x2apic.c
> +++ b/xen/arch/x86/genapic/x2apic.c
> @@ -19,6 +19,7 @@
>  
>  #include <xen/config.h>
>  #include <xen/init.h>
> +#include <xen/cpu.h>
>  #include <xen/cpumask.h>
>  #include <asm/apicdef.h>
>  #include <asm/genapic.h>
> @@ -33,6 +34,14 @@ static bool_t __initdata x2apic_phys; /*
>  boolean_param("x2apic_phys", x2apic_phys);
>  
>  static DEFINE_PER_CPU_READ_MOSTLY(u32, cpu_2_logical_apicid);
> +static DEFINE_PER_CPU_READ_MOSTLY(cpumask_t *, cluster_cpus);
> +static cpumask_t *cluster_cpus_spare;
> +static DEFINE_PER_CPU(cpumask_var_t, scratch_mask);
> +
> +static inline u32 x2apic_cluster(unsigned int cpu)
> +{
> +    return per_cpu(cpu_2_logical_apicid, cpu) >> 16;
> +}
>  
>  static void init_apic_ldr_x2apic_phys(void)
>  {
> @@ -40,20 +49,53 @@ static void init_apic_ldr_x2apic_phys(vo
>  
>  static void init_apic_ldr_x2apic_cluster(void)
>  {
> -    this_cpu(cpu_2_logical_apicid) = apic_read(APIC_LDR);
> +    unsigned int cpu, this_cpu = smp_processor_id();
> +
> +    per_cpu(cpu_2_logical_apicid, this_cpu) = apic_read(APIC_LDR);
> +
> +    if ( per_cpu(cluster_cpus, this_cpu) )
> +    {
> +        ASSERT(cpumask_test_cpu(this_cpu, per_cpu(cluster_cpus, this_cpu)));
> +        return;
> +    }
> +
> +    per_cpu(cluster_cpus, this_cpu) = cluster_cpus_spare;
> +    for_each_online_cpu ( cpu )
> +    {
> +        if (this_cpu == cpu || x2apic_cluster(this_cpu) !=
> x2apic_cluster(cpu))
> +            continue;
> +        per_cpu(cluster_cpus, this_cpu) = per_cpu(cluster_cpus, cpu);
> +        break;
> +    }
> +    if ( per_cpu(cluster_cpus, this_cpu) == cluster_cpus_spare )
> +        cluster_cpus_spare = NULL;
> +
> +    cpumask_set_cpu(this_cpu, per_cpu(cluster_cpus, this_cpu));
>  }
>  
>  static void __init clustered_apic_check_x2apic(void)
>  {
>  }
>  
> +static const cpumask_t *vector_allocation_cpumask_x2apic_cluster(int cpu)
> +{
> +    return per_cpu(cluster_cpus, cpu);
> +}
> +
>  static unsigned int cpu_mask_to_apicid_x2apic_cluster(const cpumask_t
> *cpumask)
>  {
> -    return per_cpu(cpu_2_logical_apicid, cpumask_first(cpumask));
> +    unsigned int cpu = cpumask_first(cpumask);
> +    unsigned int dest = per_cpu(cpu_2_logical_apicid, cpu);
> +    const cpumask_t *cluster_cpus = per_cpu(cluster_cpus, cpu);
> +
> +    for_each_cpu ( cpu, cluster_cpus )
> +        if ( cpumask_test_cpu(cpu, cpumask) )
> +            dest |= per_cpu(cpu_2_logical_apicid, cpu);
> +
> +    return dest;
>  }
>  
> -static void __send_IPI_mask_x2apic(
> -    const cpumask_t *cpumask, int vector, unsigned int dest_mode)
> +static void send_IPI_mask_x2apic_phys(const cpumask_t *cpumask, int vector)
>  {
>      unsigned int cpu;
>      unsigned long flags;
> @@ -77,23 +119,48 @@ static void __send_IPI_mask_x2apic(
>      {
>          if ( !cpu_online(cpu) || (cpu == smp_processor_id()) )
>              continue;
> -        msr_content = (dest_mode == APIC_DEST_PHYSICAL)
> -            ? cpu_physical_id(cpu) : per_cpu(cpu_2_logical_apicid, cpu);
> -        msr_content = (msr_content << 32) | APIC_DM_FIXED | dest_mode |
> vector;
> +        msr_content = cpu_physical_id(cpu);
> +        msr_content = (msr_content << 32) | APIC_DM_FIXED |
> +                      APIC_DEST_PHYSICAL | vector;
>          apic_wrmsr(APIC_ICR, msr_content);
>      }
>  
>      local_irq_restore(flags);
>  }
>  
> -static void send_IPI_mask_x2apic_phys(const cpumask_t *cpumask, int vector)
> -{
> -    __send_IPI_mask_x2apic(cpumask, vector, APIC_DEST_PHYSICAL);
> -}
> -
>  static void send_IPI_mask_x2apic_cluster(const cpumask_t *cpumask, int
> vector)
>  {
> -    __send_IPI_mask_x2apic(cpumask, vector, APIC_DEST_LOGICAL);
> +    unsigned int cpu = smp_processor_id();
> +    cpumask_t *ipimask = per_cpu(scratch_mask, cpu);
> +    const cpumask_t *cluster_cpus;
> +    unsigned long flags;
> +
> +    mb(); /* See above for an explanation. */
> +
> +    local_irq_save(flags);
> +
> +    cpumask_andnot(ipimask, &cpu_online_map, cpumask_of(cpu));
> +
> +    for ( cpumask_and(ipimask, cpumask, ipimask); !cpumask_empty(ipimask);
> +          cpumask_andnot(ipimask, ipimask, cluster_cpus) )
> +    {
> +        uint64_t msr_content = 0;
> +
> +        cluster_cpus = per_cpu(cluster_cpus, cpumask_first(ipimask));
> +        for_each_cpu ( cpu, cluster_cpus )
> +        {
> +            if ( !cpumask_test_cpu(cpu, ipimask) )
> +                continue;
> +            msr_content |= per_cpu(cpu_2_logical_apicid, cpu);
> +        }
> +
> +        BUG_ON(!msr_content);
> +        msr_content = (msr_content << 32) | APIC_DM_FIXED |
> +                      APIC_DEST_LOGICAL | vector;
> +        apic_wrmsr(APIC_ICR, msr_content);
> +    }
> +
> +    local_irq_restore(flags);
>  }
>  
>  static const struct genapic apic_x2apic_phys = {
> @@ -116,15 +183,60 @@ static const struct genapic apic_x2apic_
>      .init_apic_ldr = init_apic_ldr_x2apic_cluster,
>      .clustered_apic_check = clustered_apic_check_x2apic,
>      .target_cpus = target_cpus_all,
> -    .vector_allocation_cpumask = vector_allocation_cpumask_phys,
> +    .vector_allocation_cpumask = vector_allocation_cpumask_x2apic_cluster,
>      .cpu_mask_to_apicid = cpu_mask_to_apicid_x2apic_cluster,
>      .send_IPI_mask = send_IPI_mask_x2apic_cluster,
>      .send_IPI_self = send_IPI_self_x2apic
>  };
>  
> +static int update_clusterinfo(
> +    struct notifier_block *nfb, unsigned long action, void *hcpu)
> +{
> +    unsigned int cpu = (unsigned long)hcpu;
> +    int err = 0;
> +
> +    switch (action) {
> +    case CPU_UP_PREPARE:
> +        per_cpu(cpu_2_logical_apicid, cpu) = BAD_APICID;
> +        if ( !cluster_cpus_spare )
> +            cluster_cpus_spare = xzalloc(cpumask_t);
> +        if ( !cluster_cpus_spare ||
> +             !alloc_cpumask_var(&per_cpu(scratch_mask, cpu)) )
> +            err = -ENOMEM;
> +        break;
> +    case CPU_UP_CANCELED:
> +    case CPU_DEAD:
> +        if ( per_cpu(cluster_cpus, cpu) )
> +        {
> +            cpumask_clear_cpu(cpu, per_cpu(cluster_cpus, cpu));
> +            if ( cpumask_empty(per_cpu(cluster_cpus, cpu)) )
> +                xfree(per_cpu(cluster_cpus, cpu));
> +        }
> +        free_cpumask_var(per_cpu(scratch_mask, cpu));
> +        break;
> +    }
> +
> +    return !err ? NOTIFY_DONE : notifier_from_errno(err);
> +}
> +
> +static struct notifier_block x2apic_cpu_nfb = {
> +   .notifier_call = update_clusterinfo
> +};
> +
>  const struct genapic *__init apic_x2apic_probe(void)
>  {
> -    return x2apic_phys ? &apic_x2apic_phys : &apic_x2apic_cluster;
> +    if ( x2apic_phys )
> +        return &apic_x2apic_phys;
> +
> +    if ( !this_cpu(cluster_cpus) )
> +    {
> +        update_clusterinfo(NULL, CPU_UP_PREPARE,
> +                           (void *)(long)smp_processor_id());
> +        init_apic_ldr_x2apic_cluster();
> +        register_cpu_notifier(&x2apic_cpu_nfb);
> +    }
> +
> +    return &apic_x2apic_cluster;
>  }
>  
>  void __init check_x2apic_preenabled(void)
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:18:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:18:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWTs4-0001Wj-1W; Thu, 08 Nov 2012 15:18:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWTs1-0001WY-VX
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 15:18:18 +0000
Received: from [85.158.139.83:26305] by server-4.bemta-5.messagelabs.com id
	5B/76-15011-93DCB905; Thu, 08 Nov 2012 15:18:17 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1352387896!28836877!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3814 invoked from network); 8 Nov 2012 15:18:16 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-13.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 15:18:16 -0000
Received: by mail-wg0-f51.google.com with SMTP id ed3so1314298wgb.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 07:18:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=jXJjpciHAyVG1oy4oFZ8I4OW41PST/WHMTZ2cT1Btks=;
	b=D6vPsuKhty69O2FnylwWRSL66hF4okguqLB+UV0HEYYMgFaqI9555nVCyKSiOPw+7Q
	/Fp47QXLpQef/Zh7y70l02DZowbYY8UyXFLXKO8+admlWTuJBnpYlzznn4QmAjMRNzG6
	g1D2qoMqBa9z3abML0rkkFFKPj1K5Z/FuLltWT2Kzv4kEAewuFgR8Fk2HFUzBOEp492n
	KfulfvtrrXygMWQqH+iS1GgbHMPEjaZN0olK17gT0a6jpjVOETS0QdhwnhzuqC8xiTn3
	HXT+V/yPPfZTpUsaveV4hb/sbzcaFjHHoDnPZXa+1LZavVFkYF9cUdMDvmojxC13G79N
	4ykQ==
Received: by 10.216.205.145 with SMTP id j17mr3276060weo.95.1352387896261;
	Thu, 08 Nov 2012 07:18:16 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id ea9sm8729628wib.11.2012.11.08.07.18.14
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 07:18:15 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 15:18:10 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCC17DB2.51BB2%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH 0/2] x86: x2apic improvements
Thread-Index: Ac29xEMQrxUGbrIsPkCpY5HMWPW3iQ==
In-Reply-To: <509BD6E702000078000A742E@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH 0/2] x86: x2apic improvements
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 14:59, "Jan Beulich" <JBeulich@suse.com> wrote:

> 1: make cpu_2_logical_apicid private to x2apic code
> 2: x2apic: properly implement cluster mode
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Had a minor comment on patch 2, but apart from that...

Acked-by: Keir Fraser <keir@xen.org>

> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:18:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:18:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWTs4-0001Wj-1W; Thu, 08 Nov 2012 15:18:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWTs1-0001WY-VX
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 15:18:18 +0000
Received: from [85.158.139.83:26305] by server-4.bemta-5.messagelabs.com id
	5B/76-15011-93DCB905; Thu, 08 Nov 2012 15:18:17 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1352387896!28836877!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3814 invoked from network); 8 Nov 2012 15:18:16 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-13.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 15:18:16 -0000
Received: by mail-wg0-f51.google.com with SMTP id ed3so1314298wgb.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 07:18:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=jXJjpciHAyVG1oy4oFZ8I4OW41PST/WHMTZ2cT1Btks=;
	b=D6vPsuKhty69O2FnylwWRSL66hF4okguqLB+UV0HEYYMgFaqI9555nVCyKSiOPw+7Q
	/Fp47QXLpQef/Zh7y70l02DZowbYY8UyXFLXKO8+admlWTuJBnpYlzznn4QmAjMRNzG6
	g1D2qoMqBa9z3abML0rkkFFKPj1K5Z/FuLltWT2Kzv4kEAewuFgR8Fk2HFUzBOEp492n
	KfulfvtrrXygMWQqH+iS1GgbHMPEjaZN0olK17gT0a6jpjVOETS0QdhwnhzuqC8xiTn3
	HXT+V/yPPfZTpUsaveV4hb/sbzcaFjHHoDnPZXa+1LZavVFkYF9cUdMDvmojxC13G79N
	4ykQ==
Received: by 10.216.205.145 with SMTP id j17mr3276060weo.95.1352387896261;
	Thu, 08 Nov 2012 07:18:16 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id ea9sm8729628wib.11.2012.11.08.07.18.14
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 07:18:15 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 15:18:10 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCC17DB2.51BB2%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH 0/2] x86: x2apic improvements
Thread-Index: Ac29xEMQrxUGbrIsPkCpY5HMWPW3iQ==
In-Reply-To: <509BD6E702000078000A742E@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH 0/2] x86: x2apic improvements
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 14:59, "Jan Beulich" <JBeulich@suse.com> wrote:

> 1: make cpu_2_logical_apicid private to x2apic code
> 2: x2apic: properly implement cluster mode
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Had a minor comment on patch 2, but apart from that...

Acked-by: Keir Fraser <keir@xen.org>

> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:22:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:22:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWTvR-0001kB-MT; Thu, 08 Nov 2012 15:21:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mrsanna1@gmail.com>) id 1TWTvQ-0001k4-0X
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 15:21:48 +0000
Received: from [85.158.143.99:32001] by server-1.bemta-4.messagelabs.com id
	03/01-27934-B0ECB905; Thu, 08 Nov 2012 15:21:47 +0000
X-Env-Sender: mrsanna1@gmail.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1352388104!23887831!1
X-Originating-IP: [209.85.214.173]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14291 invoked from network); 8 Nov 2012 15:21:45 -0000
Received: from mail-ob0-f173.google.com (HELO mail-ob0-f173.google.com)
	(209.85.214.173)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 15:21:45 -0000
Received: by mail-ob0-f173.google.com with SMTP id wc18so3434705obb.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 07:21:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=IyiMrhOcBa31S8PGEaWKKnB+wZws5YrpOQg4avT17Dc=;
	b=XAVF+6rCtAGQD+fVye4ZHkklmqwwV8olvPgMJyRIJqtg2Azer3jNo7gD+KsI4PCblf
	BP1Ws4r9uHs6vJZI6W+wEc6m33wnQoBNyAlt4GYDlgIdQBsgtP5bFVtcrkmU29u2pSJu
	oeOm/chUxe8Fc6EaY9X781tWOu3ymXCk+HVxVmnp0yRRZjdPoL9TZQ8CR0x6bKTHonrz
	S692Vq24NGg9ozWFcilZ2pvyKTPmKGF/uP846kw2xIaUb5EefsU2u5CvjtLJM6OkZkfH
	ioUGrNJHcsRKeYBMFuUVoCj9WZkIfCNhzmzGQqWDViykSdT1loJ7PJcDBvuQ6UyCkoQJ
	ZwPQ==
MIME-Version: 1.0
Received: by 10.60.11.105 with SMTP id p9mr5314941oeb.128.1352388103952; Thu,
	08 Nov 2012 07:21:43 -0800 (PST)
Received: by 10.76.87.161 with HTTP; Thu, 8 Nov 2012 07:21:43 -0800 (PST)
In-Reply-To: <FF93AF260AC2BB499A119CC65B092CF73151843F@sg000713.corproot.net>
References: <1352294551.12977.61.camel@hastur.hellion.org.uk>
	<CCC04D8E.51A0E%keir@xen.org>
	<509B8BF802000078000A72A3@nat28.tlf.novell.com>
	<FF93AF260AC2BB499A119CC65B092CF73151843F@sg000713.corproot.net>
Date: Thu, 8 Nov 2012 16:21:43 +0100
Message-ID: <CAE17a0Wm=VLWxnFBQWScAKwOzjK4tDQ9UKkp2oT4QsNOh4GuFw@mail.gmail.com>
From: Mauro <mrsanna1@gmail.com>
To: Philippe.Simonet@swisscom.com
Cc: keir@xen.org, 599161@bugs.debian.org, xen-devel@lists.xen.org,
	JBeulich@suse.com, ijc@hellion.org.uk
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 8 November 2012 14:47,  <Philippe.Simonet@swisscom.com> wrote:
> Hi Mauro,
>
> that's a question for you :
>
>> Philippe, could you clarify again what CPU model(s) this is being observed on
>> (the long times between individual steps forward with this problem perhaps
>> warrant repeating the basics each time, as it's otherwise quite cumbersome
>> to always look up old pieces of information).
>
> can you provide this information ?
>         cat /proc/cpuinfo
>         cat /proc/meminfo
>         hardware information (manufacturer, model, urls, ...)
>

cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 4
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 5
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 6
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 7
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 8
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 9
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 10
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 11
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 12
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 13
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 14
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 15
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:


cat /proc/meminfo
MemTotal:        3127132 kB
MemFree:         2697364 kB
Buffers:           65816 kB
Cached:            62188 kB
SwapCached:            0 kB
Active:           117156 kB
Inactive:          46840 kB
Active(anon):      28668 kB
Inactive(anon):    16360 kB
Active(file):      88488 kB
Inactive(file):    30480 kB
Unevictable:       18944 kB
Mlocked:           18944 kB
SwapTotal:        974840 kB
SwapFree:         974840 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         54936 kB
Mapped:            14124 kB
Shmem:               508 kB
Slab:              66072 kB
SReclaimable:      19732 kB
SUnreclaim:        46340 kB
KernelStack:        4016 kB
PageTables:         4216 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     2538404 kB
Committed_AS:     202468 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      289904 kB
VmallocChunk:   34359384628 kB
HardwareCorrupted:     0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:     3145728 kB
DirectMap2M:           0 kB


note that 3G is the mem reserved to dom0, the total amount of mem in
the machine is 64G.


The machine is a HP Proliant DL 580 G5,
http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c01154573&lang=en&cc=us&taskId=&prodSeriesId=3454575&prodTypeId=15351

Thanks to all for the work.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:22:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:22:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWTvR-0001kB-MT; Thu, 08 Nov 2012 15:21:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mrsanna1@gmail.com>) id 1TWTvQ-0001k4-0X
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 15:21:48 +0000
Received: from [85.158.143.99:32001] by server-1.bemta-4.messagelabs.com id
	03/01-27934-B0ECB905; Thu, 08 Nov 2012 15:21:47 +0000
X-Env-Sender: mrsanna1@gmail.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1352388104!23887831!1
X-Originating-IP: [209.85.214.173]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14291 invoked from network); 8 Nov 2012 15:21:45 -0000
Received: from mail-ob0-f173.google.com (HELO mail-ob0-f173.google.com)
	(209.85.214.173)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 15:21:45 -0000
Received: by mail-ob0-f173.google.com with SMTP id wc18so3434705obb.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 07:21:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=IyiMrhOcBa31S8PGEaWKKnB+wZws5YrpOQg4avT17Dc=;
	b=XAVF+6rCtAGQD+fVye4ZHkklmqwwV8olvPgMJyRIJqtg2Azer3jNo7gD+KsI4PCblf
	BP1Ws4r9uHs6vJZI6W+wEc6m33wnQoBNyAlt4GYDlgIdQBsgtP5bFVtcrkmU29u2pSJu
	oeOm/chUxe8Fc6EaY9X781tWOu3ymXCk+HVxVmnp0yRRZjdPoL9TZQ8CR0x6bKTHonrz
	S692Vq24NGg9ozWFcilZ2pvyKTPmKGF/uP846kw2xIaUb5EefsU2u5CvjtLJM6OkZkfH
	ioUGrNJHcsRKeYBMFuUVoCj9WZkIfCNhzmzGQqWDViykSdT1loJ7PJcDBvuQ6UyCkoQJ
	ZwPQ==
MIME-Version: 1.0
Received: by 10.60.11.105 with SMTP id p9mr5314941oeb.128.1352388103952; Thu,
	08 Nov 2012 07:21:43 -0800 (PST)
Received: by 10.76.87.161 with HTTP; Thu, 8 Nov 2012 07:21:43 -0800 (PST)
In-Reply-To: <FF93AF260AC2BB499A119CC65B092CF73151843F@sg000713.corproot.net>
References: <1352294551.12977.61.camel@hastur.hellion.org.uk>
	<CCC04D8E.51A0E%keir@xen.org>
	<509B8BF802000078000A72A3@nat28.tlf.novell.com>
	<FF93AF260AC2BB499A119CC65B092CF73151843F@sg000713.corproot.net>
Date: Thu, 8 Nov 2012 16:21:43 +0100
Message-ID: <CAE17a0Wm=VLWxnFBQWScAKwOzjK4tDQ9UKkp2oT4QsNOh4GuFw@mail.gmail.com>
From: Mauro <mrsanna1@gmail.com>
To: Philippe.Simonet@swisscom.com
Cc: keir@xen.org, 599161@bugs.debian.org, xen-devel@lists.xen.org,
	JBeulich@suse.com, ijc@hellion.org.uk
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 8 November 2012 14:47,  <Philippe.Simonet@swisscom.com> wrote:
> Hi Mauro,
>
> that's a question for you :
>
>> Philippe, could you clarify again what CPU model(s) this is being observed on
>> (the long times between individual steps forward with this problem perhaps
>> warrant repeating the basics each time, as it's otherwise quite cumbersome
>> to always look up old pieces of information).
>
> can you provide this information ?
>         cat /proc/cpuinfo
>         cat /proc/meminfo
>         hardware information (manufacturer, model, urls, ...)
>

cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 4
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 5
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 6
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 7
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 8
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 9
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 10
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 11
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 12
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 13
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 14
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 15
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           E7330  @ 2.40GHz
stepping        : 11
cpu MHz         : 2400.128
cache size      : 3072 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov
pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc
rep_good aperfmperf pni est ssse3 cx16 hypervisor lahf_lm
bogomips        : 4800.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:


cat /proc/meminfo
MemTotal:        3127132 kB
MemFree:         2697364 kB
Buffers:           65816 kB
Cached:            62188 kB
SwapCached:            0 kB
Active:           117156 kB
Inactive:          46840 kB
Active(anon):      28668 kB
Inactive(anon):    16360 kB
Active(file):      88488 kB
Inactive(file):    30480 kB
Unevictable:       18944 kB
Mlocked:           18944 kB
SwapTotal:        974840 kB
SwapFree:         974840 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         54936 kB
Mapped:            14124 kB
Shmem:               508 kB
Slab:              66072 kB
SReclaimable:      19732 kB
SUnreclaim:        46340 kB
KernelStack:        4016 kB
PageTables:         4216 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     2538404 kB
Committed_AS:     202468 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      289904 kB
VmallocChunk:   34359384628 kB
HardwareCorrupted:     0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:     3145728 kB
DirectMap2M:           0 kB


note that 3G is the mem reserved to dom0, the total amount of mem in
the machine is 64G.


The machine is a HP Proliant DL 580 G5,
http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c01154573&lang=en&cc=us&taskId=&prodSeriesId=3454575&prodTypeId=15351

Thanks to all for the work.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:29:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:29:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWU2I-0001wv-JE; Thu, 08 Nov 2012 15:28:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <arnd@arndb.de>) id 1TWU2H-0001wo-CL
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 15:28:53 +0000
Received: from [85.158.138.51:37088] by server-14.bemta-3.messagelabs.com id
	9B/42-12788-4BFCB905; Thu, 08 Nov 2012 15:28:52 +0000
X-Env-Sender: arnd@arndb.de
X-Msg-Ref: server-14.tower-174.messagelabs.com!1352388531!22898906!1
X-Originating-IP: [212.227.17.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gNzMwNjk=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gNzMwNjk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20429 invoked from network); 8 Nov 2012 15:28:51 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.17.9)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 15:28:51 -0000
Received: from klappe2.localnet (deibp9eh1--blueice3n2.emea.ibm.com
	[195.212.29.180])
	by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis)
	id 0LiIi3-1T0lqD2pGN-00nOKS; Thu, 08 Nov 2012 16:28:34 +0100
From: Arnd Bergmann <arnd@arndb.de>
To: "Russell King - ARM Linux" <linux@arm.linux.org.uk>
Date: Thu, 8 Nov 2012 15:28:31 +0000
User-Agent: KMail/1.12.2 (Linux/3.5.0; KDE/4.3.2; x86_64; ; )
References: <20121106175749.GO28327@n2100.arm.linux.org.uk>
In-Reply-To: <20121106175749.GO28327@n2100.arm.linux.org.uk>
MIME-Version: 1.0
Message-Id: <201211081528.31968.arnd@arndb.de>
X-Provags-ID: V02:K0:fiS0mU5rhlBIrn+Ac7bOXpUdgrPIN7P/yWGBQEUTE7d
	nHUBJ6vJv+hPzbLHg7e0oiMS4lqxvWX1m2bmH8ntAKrrV94So4
	o/T5w7wHptore0KSFrS+YbqBzzTP78PG6fLtcmg6QOTwGpI/GH
	G8h8WLWb/JORtObkFZ5cPSh1uDJc33R9jiH7emGuNK9y0RAKcQ
	hVAGYIL2fKUxPF00cD+8bNWa0rjk+w+zM49kKtD9pRXro67yyi
	Hm+rfeTj3KrusUBf3ymUPxRnaObEOz7bv2X0JRiTOHgOuxgvj7
	EVEwzQHVQm84a0evPv1V3agwWa83fkKFX71/+wENSCia8Cf7M8
	cTt4CA4d1uDyuGe/D6as=
Cc: xen-devel@lists.xensource.com, arm@kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] BUG: ARM build failures due to Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tuesday 06 November 2012, Russell King - ARM Linux wrote:
> My build system is giving me the following errors against an OMAP4
> randconfig build against the latest Linus' kernel plus arm-soc:
> 
> ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> make[2]: *** [__modpost] Error 1
> make[2]: Target `_modpost' not remade because of errors.
> make[1]: *** [modules] Error 2
> make: *** [sub-make] Error 2
> make: Target `uImage' not remade because of errors.
> make: Target `modules' not remade because of errors.
> 
> Full build results and configuration are here:
> 
> http://www.arm.linux.org.uk/developer/build/result.php?type=build&idx=2627
> http://www.arm.linux.org.uk/developer/build/file.php?type=config&idx=2627
> 

I can reproduce the same thing with mainline v3.7-rc4.
8<------
xen/arm: export privcmd_call

privcmd_call may get called from a module, so it has to be exported.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index 59bcb96..ff5e300 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -17,6 +17,9 @@
 #include <linux/of_irq.h>
 #include <linux/of_address.h>
 
+/* from hypercall.S */
+EXPORT_SYMBOL_GPL(privcmd_call);
+
 struct start_info _xen_start_info;
 struct start_info *xen_start_info = &_xen_start_info;
 EXPORT_SYMBOL_GPL(xen_start_info);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:29:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:29:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWU2I-0001wv-JE; Thu, 08 Nov 2012 15:28:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <arnd@arndb.de>) id 1TWU2H-0001wo-CL
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 15:28:53 +0000
Received: from [85.158.138.51:37088] by server-14.bemta-3.messagelabs.com id
	9B/42-12788-4BFCB905; Thu, 08 Nov 2012 15:28:52 +0000
X-Env-Sender: arnd@arndb.de
X-Msg-Ref: server-14.tower-174.messagelabs.com!1352388531!22898906!1
X-Originating-IP: [212.227.17.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gNzMwNjk=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gNzMwNjk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20429 invoked from network); 8 Nov 2012 15:28:51 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.17.9)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 15:28:51 -0000
Received: from klappe2.localnet (deibp9eh1--blueice3n2.emea.ibm.com
	[195.212.29.180])
	by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis)
	id 0LiIi3-1T0lqD2pGN-00nOKS; Thu, 08 Nov 2012 16:28:34 +0100
From: Arnd Bergmann <arnd@arndb.de>
To: "Russell King - ARM Linux" <linux@arm.linux.org.uk>
Date: Thu, 8 Nov 2012 15:28:31 +0000
User-Agent: KMail/1.12.2 (Linux/3.5.0; KDE/4.3.2; x86_64; ; )
References: <20121106175749.GO28327@n2100.arm.linux.org.uk>
In-Reply-To: <20121106175749.GO28327@n2100.arm.linux.org.uk>
MIME-Version: 1.0
Message-Id: <201211081528.31968.arnd@arndb.de>
X-Provags-ID: V02:K0:fiS0mU5rhlBIrn+Ac7bOXpUdgrPIN7P/yWGBQEUTE7d
	nHUBJ6vJv+hPzbLHg7e0oiMS4lqxvWX1m2bmH8ntAKrrV94So4
	o/T5w7wHptore0KSFrS+YbqBzzTP78PG6fLtcmg6QOTwGpI/GH
	G8h8WLWb/JORtObkFZ5cPSh1uDJc33R9jiH7emGuNK9y0RAKcQ
	hVAGYIL2fKUxPF00cD+8bNWa0rjk+w+zM49kKtD9pRXro67yyi
	Hm+rfeTj3KrusUBf3ymUPxRnaObEOz7bv2X0JRiTOHgOuxgvj7
	EVEwzQHVQm84a0evPv1V3agwWa83fkKFX71/+wENSCia8Cf7M8
	cTt4CA4d1uDyuGe/D6as=
Cc: xen-devel@lists.xensource.com, arm@kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] BUG: ARM build failures due to Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tuesday 06 November 2012, Russell King - ARM Linux wrote:
> My build system is giving me the following errors against an OMAP4
> randconfig build against the latest Linus' kernel plus arm-soc:
> 
> ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> make[2]: *** [__modpost] Error 1
> make[2]: Target `_modpost' not remade because of errors.
> make[1]: *** [modules] Error 2
> make: *** [sub-make] Error 2
> make: Target `uImage' not remade because of errors.
> make: Target `modules' not remade because of errors.
> 
> Full build results and configuration are here:
> 
> http://www.arm.linux.org.uk/developer/build/result.php?type=build&idx=2627
> http://www.arm.linux.org.uk/developer/build/file.php?type=config&idx=2627
> 

I can reproduce the same thing with mainline v3.7-rc4.
8<------
xen/arm: export privcmd_call

privcmd_call may get called from a module, so it has to be exported.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index 59bcb96..ff5e300 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -17,6 +17,9 @@
 #include <linux/of_irq.h>
 #include <linux/of_address.h>
 
+/* from hypercall.S */
+EXPORT_SYMBOL_GPL(privcmd_call);
+
 struct start_info _xen_start_info;
 struct start_info *xen_start_info = &_xen_start_info;
 EXPORT_SYMBOL_GPL(xen_start_info);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:32:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:32:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWU5p-00026b-C9; Thu, 08 Nov 2012 15:32:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <key@linux.vnet.ibm.com>) id 1TWU5n-00026P-9N
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 15:32:31 +0000
Received: from [85.158.137.99:39430] by server-13.bemta-3.messagelabs.com id
	C2/7C-24887-E80DB905; Thu, 08 Nov 2012 15:32:30 +0000
X-Env-Sender: key@linux.vnet.ibm.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1352388747!18199177!1
X-Originating-IP: [32.97.182.143]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMzIuOTcuMTgyLjE0MyA9PiA1MzczNDU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12714 invoked from network); 8 Nov 2012 15:32:29 -0000
Received: from e3.ny.us.ibm.com (HELO e3.ny.us.ibm.com) (32.97.182.143)
	by server-2.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 8 Nov 2012 15:32:29 -0000
Received: from /spool/local
	by e3.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only!
	Violators will be prosecuted
	for <xen-devel@lists.xensource.com> from <key@linux.vnet.ibm.com>;
	Thu, 8 Nov 2012 10:31:26 -0500
Received: from d01dlp02.pok.ibm.com (9.56.250.167)
	by e3.ny.us.ibm.com (192.168.1.103) with IBM ESMTP SMTP Gateway:
	Authorized Use Only! Violators will be prosecuted; 
	Thu, 8 Nov 2012 10:30:18 -0500
Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235])
	by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 2E6D06E80BA
	for <xen-devel@lists.xensource.com>;
	Thu,  8 Nov 2012 10:29:56 -0500 (EST)
Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64])
	by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id
	qA8FTtdg297072
	for <xen-devel@lists.xensource.com>; Thu, 8 Nov 2012 10:29:55 -0500
Received: from d01av04.pok.ibm.com (loopback [127.0.0.1])
	by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id
	qA8FT9BD021032
	for <xen-devel@lists.xensource.com>; Thu, 8 Nov 2012 10:29:09 -0500
Received: from key-ThinkPad-W510 (ennui.austin.ibm.com [9.53.105.11])
	by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id
	qA8FT97u020948; Thu, 8 Nov 2012 10:29:09 -0500
Received: from ennui.austin.ibm.com (localhost [127.0.0.1])
	by key-ThinkPad-W510 (Postfix) with ESMTP id 1DC2A2C0A95;
	Thu,  8 Nov 2012 09:28:37 -0600 (CST)
Received: (from key@localhost)
	by ennui.austin.ibm.com (8.14.5/8.14.5/Submit) id qA8FSZav029145;
	Thu, 8 Nov 2012 09:28:35 -0600
Date: Thu, 8 Nov 2012 09:28:35 -0600
From: Kent Yoder <key@linux.vnet.ibm.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121108152835.GA28612@ennui.austin.ibm.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121107144625.GA14628@ennui.austin.ibm.com>
	<509AA501.1090701@jhuapl.edu>
	<509B78AC02000078000A723C@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509B78AC02000078000A723C@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Content-Scanned: Fidelis XPS MAILER
x-cbid: 12110815-8974-0000-0000-000010D6E622
X-IBM-ISS-SpamDetectors: 
X-IBM-ISS-DetailInfo: BY=3.00000295; HX=3.00000198; KW=3.00000007;
	PH=3.00000001; SC=3.00000008; SDB=6.00189551; UDB=6.00042921;
	UTC=2012-11-08 15:31:23
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
 driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 08, 2012 at 08:17:32AM +0000, Jan Beulich wrote:
> >>> On 07.11.12 at 19:14, Matthew Fioravante <matthew.fioravante@jhuapl.edu> wrote:
> > On 11/07/2012 09:46 AM, Kent Yoder wrote:
> >>> --- a/drivers/char/tpm/tpm.h
> >>> +++ b/drivers/char/tpm/tpm.h
> >>> @@ -130,6 +130,9 @@ struct tpm_chip {
> >>>
> >>>   	struct list_head list;
> >>>   	void (*release) (struct device *);
> >>> +#if CONFIG_XEN
> >>> +	void *priv;
> >>> +#endif
> >>   Can you use the chip->vendor.data pointer here instead? tpm_ibmvtpm is
> >> already using that as a priv pointer. I should probably change that name
> >> to make it more obvious what that's used for.
> > That makes more sense. I'm guessing your data pointer didn't exist 
> > during the 2.6.18 kernel which is why they added their own priv pointer.
> 
> It got introduced with 3.7-rc.
> 
> >>> @@ -310,6 +313,18 @@ struct tpm_cmd_t {
> >>>
> >>>   ssize_t	tpm_getcap(struct device *, __be32, cap_t *, const char *);
> >>>
> >>> +#ifdef CONFIG_XEN
> >>> +static inline void *chip_get_private(const struct tpm_chip *chip)
> >>> +{
> >>> +	return chip->priv;
> >>> +}
> >>> +
> >>> +static inline void chip_set_private(struct tpm_chip *chip, void *priv)
> >>> +{
> >>> +	chip->priv = priv;
> >>> +}
> >>> +#endif
> >>   Can you put these in tpm_vtpm.c please?  One less #define. :-)
> > Agreed, I'd rather not have to modify your shared tpm.h interface at all.
> 
> Either such accessors should be defined here, for everyone to
> use (and tpm_ibmvtpm.c get changed accordingly), or the Xen
> code should access the field without wrappers too (for consistency).

  Agreed. I'll update tpm_ibmvtpm.

Kent

> 
> Jan
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:32:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:32:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWU5p-00026b-C9; Thu, 08 Nov 2012 15:32:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <key@linux.vnet.ibm.com>) id 1TWU5n-00026P-9N
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 15:32:31 +0000
Received: from [85.158.137.99:39430] by server-13.bemta-3.messagelabs.com id
	C2/7C-24887-E80DB905; Thu, 08 Nov 2012 15:32:30 +0000
X-Env-Sender: key@linux.vnet.ibm.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1352388747!18199177!1
X-Originating-IP: [32.97.182.143]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMzIuOTcuMTgyLjE0MyA9PiA1MzczNDU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12714 invoked from network); 8 Nov 2012 15:32:29 -0000
Received: from e3.ny.us.ibm.com (HELO e3.ny.us.ibm.com) (32.97.182.143)
	by server-2.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 8 Nov 2012 15:32:29 -0000
Received: from /spool/local
	by e3.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only!
	Violators will be prosecuted
	for <xen-devel@lists.xensource.com> from <key@linux.vnet.ibm.com>;
	Thu, 8 Nov 2012 10:31:26 -0500
Received: from d01dlp02.pok.ibm.com (9.56.250.167)
	by e3.ny.us.ibm.com (192.168.1.103) with IBM ESMTP SMTP Gateway:
	Authorized Use Only! Violators will be prosecuted; 
	Thu, 8 Nov 2012 10:30:18 -0500
Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235])
	by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 2E6D06E80BA
	for <xen-devel@lists.xensource.com>;
	Thu,  8 Nov 2012 10:29:56 -0500 (EST)
Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64])
	by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id
	qA8FTtdg297072
	for <xen-devel@lists.xensource.com>; Thu, 8 Nov 2012 10:29:55 -0500
Received: from d01av04.pok.ibm.com (loopback [127.0.0.1])
	by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id
	qA8FT9BD021032
	for <xen-devel@lists.xensource.com>; Thu, 8 Nov 2012 10:29:09 -0500
Received: from key-ThinkPad-W510 (ennui.austin.ibm.com [9.53.105.11])
	by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id
	qA8FT97u020948; Thu, 8 Nov 2012 10:29:09 -0500
Received: from ennui.austin.ibm.com (localhost [127.0.0.1])
	by key-ThinkPad-W510 (Postfix) with ESMTP id 1DC2A2C0A95;
	Thu,  8 Nov 2012 09:28:37 -0600 (CST)
Received: (from key@localhost)
	by ennui.austin.ibm.com (8.14.5/8.14.5/Submit) id qA8FSZav029145;
	Thu, 8 Nov 2012 09:28:35 -0600
Date: Thu, 8 Nov 2012 09:28:35 -0600
From: Kent Yoder <key@linux.vnet.ibm.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121108152835.GA28612@ennui.austin.ibm.com>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121107144625.GA14628@ennui.austin.ibm.com>
	<509AA501.1090701@jhuapl.edu>
	<509B78AC02000078000A723C@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509B78AC02000078000A723C@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Content-Scanned: Fidelis XPS MAILER
x-cbid: 12110815-8974-0000-0000-000010D6E622
X-IBM-ISS-SpamDetectors: 
X-IBM-ISS-DetailInfo: BY=3.00000295; HX=3.00000198; KW=3.00000007;
	PH=3.00000001; SC=3.00000008; SDB=6.00189551; UDB=6.00042921;
	UTC=2012-11-08 15:31:23
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
 driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 08, 2012 at 08:17:32AM +0000, Jan Beulich wrote:
> >>> On 07.11.12 at 19:14, Matthew Fioravante <matthew.fioravante@jhuapl.edu> wrote:
> > On 11/07/2012 09:46 AM, Kent Yoder wrote:
> >>> --- a/drivers/char/tpm/tpm.h
> >>> +++ b/drivers/char/tpm/tpm.h
> >>> @@ -130,6 +130,9 @@ struct tpm_chip {
> >>>
> >>>   	struct list_head list;
> >>>   	void (*release) (struct device *);
> >>> +#if CONFIG_XEN
> >>> +	void *priv;
> >>> +#endif
> >>   Can you use the chip->vendor.data pointer here instead? tpm_ibmvtpm is
> >> already using that as a priv pointer. I should probably change that name
> >> to make it more obvious what that's used for.
> > That makes more sense. I'm guessing your data pointer didn't exist 
> > during the 2.6.18 kernel which is why they added their own priv pointer.
> 
> It got introduced with 3.7-rc.
> 
> >>> @@ -310,6 +313,18 @@ struct tpm_cmd_t {
> >>>
> >>>   ssize_t	tpm_getcap(struct device *, __be32, cap_t *, const char *);
> >>>
> >>> +#ifdef CONFIG_XEN
> >>> +static inline void *chip_get_private(const struct tpm_chip *chip)
> >>> +{
> >>> +	return chip->priv;
> >>> +}
> >>> +
> >>> +static inline void chip_set_private(struct tpm_chip *chip, void *priv)
> >>> +{
> >>> +	chip->priv = priv;
> >>> +}
> >>> +#endif
> >>   Can you put these in tpm_vtpm.c please?  One less #define. :-)
> > Agreed, I'd rather not have to modify your shared tpm.h interface at all.
> 
> Either such accessors should be defined here, for everyone to
> use (and tpm_ibmvtpm.c get changed accordingly), or the Xen
> code should access the field without wrappers too (for consistency).

  Agreed. I'll update tpm_ibmvtpm.

Kent

> 
> Jan
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:37:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:37:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWUAq-0002Gw-49; Thu, 08 Nov 2012 15:37:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TWUAp-0002Gr-2V
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 15:37:43 +0000
Received: from [85.158.143.99:16690] by server-2.bemta-4.messagelabs.com id
	5F/E0-28922-6C1DB905; Thu, 08 Nov 2012 15:37:42 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-9.tower-216.messagelabs.com!1352389060!29192249!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16960 invoked from network); 8 Nov 2012 15:37:41 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-9.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 8 Nov 2012 15:37:41 -0000
Received: from ([128.244.198.90])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148501650;
	Thu, 08 Nov 2012 10:36:09 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas1.dom1.jhuapl.edu ([128.244.198.90]) with mapi; Thu, 8 Nov 2012
	10:36:09 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Kent Yoder <key@linux.vnet.ibm.com>, Jan Beulich <JBeulich@suse.com>
Date: Thu, 8 Nov 2012 10:36:08 -0500
Thread-Topic: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
	driver
Thread-Index: Ac29xlmdArK70cUQRNaO8Lj2jl7+6AAAFq6g
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48A229E6FD@aplesstripe.dom1.jhuapl.edu>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121107144625.GA14628@ennui.austin.ibm.com>	<509AA501.1090701@jhuapl.edu>
	<509B78AC02000078000A723C@nat28.tlf.novell.com>
	<20121108152835.GA28612@ennui.austin.ibm.com>
In-Reply-To: <20121108152835.GA28612@ennui.austin.ibm.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
 driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



-----Original Message-----
From: xen-devel-bounces@lists.xen.org [mailto:xen-devel-bounces@lists.xen.org] On Behalf Of Kent Yoder
Sent: Thursday, November 08, 2012 10:29 AM
To: Jan Beulich
Cc: Fioravante, Matthew E.; jeremy@goop.org; xen-devel@lists.xensource.com; konrad.wilk@oracle.com; linux-kernel@vger.kernel.org; mail@srajiv.net; tpmdd-devel@lists.sourceforge.net
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend driver

On Thu, Nov 08, 2012 at 08:17:32AM +0000, Jan Beulich wrote:
> >>> On 07.11.12 at 19:14, Matthew Fioravante <matthew.fioravante@jhuapl.edu> wrote:
> > On 11/07/2012 09:46 AM, Kent Yoder wrote:
> >>> --- a/drivers/char/tpm/tpm.h
> >>> +++ b/drivers/char/tpm/tpm.h
> >>> @@ -130,6 +130,9 @@ struct tpm_chip {
> >>>
> >>>   	struct list_head list;
> >>>   	void (*release) (struct device *);
> >>> +#if CONFIG_XEN
> >>> +	void *priv;
> >>> +#endif
> >>   Can you use the chip->vendor.data pointer here instead? 
> >> tpm_ibmvtpm is already using that as a priv pointer. I should 
> >> probably change that name to make it more obvious what that's used for.
> > That makes more sense. I'm guessing your data pointer didn't exist 
> > during the 2.6.18 kernel which is why they added their own priv pointer.
> 
> It got introduced with 3.7-rc.
> 
> >>> @@ -310,6 +313,18 @@ struct tpm_cmd_t {
> >>>
> >>>   ssize_t	tpm_getcap(struct device *, __be32, cap_t *, const char *);
> >>>
> >>> +#ifdef CONFIG_XEN
> >>> +static inline void *chip_get_private(const struct tpm_chip *chip) 
> >>> +{
> >>> +	return chip->priv;
> >>> +}
> >>> +
> >>> +static inline void chip_set_private(struct tpm_chip *chip, void 
> >>> +*priv) {
> >>> +	chip->priv = priv;
> >>> +}
> >>> +#endif
> >>   Can you put these in tpm_vtpm.c please?  One less #define. :-)
> > Agreed, I'd rather not have to modify your shared tpm.h interface at all.
> 
> Either such accessors should be defined here, for everyone to use (and 
> tpm_ibmvtpm.c get changed accordingly), or the Xen code should access 
> the field without wrappers too (for consistency).

  Agreed. I'll update tpm_ibmvtpm.

Kent

So what is the consensus, you're going to use accessors in ibmvtpm? I was just about to remove them from my side.

> 
> Jan
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:37:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:37:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWUAq-0002Gw-49; Thu, 08 Nov 2012 15:37:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TWUAp-0002Gr-2V
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 15:37:43 +0000
Received: from [85.158.143.99:16690] by server-2.bemta-4.messagelabs.com id
	5F/E0-28922-6C1DB905; Thu, 08 Nov 2012 15:37:42 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-9.tower-216.messagelabs.com!1352389060!29192249!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16960 invoked from network); 8 Nov 2012 15:37:41 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-9.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 8 Nov 2012 15:37:41 -0000
Received: from ([128.244.198.90])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148501650;
	Thu, 08 Nov 2012 10:36:09 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas1.dom1.jhuapl.edu ([128.244.198.90]) with mapi; Thu, 8 Nov 2012
	10:36:09 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Kent Yoder <key@linux.vnet.ibm.com>, Jan Beulich <JBeulich@suse.com>
Date: Thu, 8 Nov 2012 10:36:08 -0500
Thread-Topic: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
	driver
Thread-Index: Ac29xlmdArK70cUQRNaO8Lj2jl7+6AAAFq6g
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48A229E6FD@aplesstripe.dom1.jhuapl.edu>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121107144625.GA14628@ennui.austin.ibm.com>	<509AA501.1090701@jhuapl.edu>
	<509B78AC02000078000A723C@nat28.tlf.novell.com>
	<20121108152835.GA28612@ennui.austin.ibm.com>
In-Reply-To: <20121108152835.GA28612@ennui.austin.ibm.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
 driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



-----Original Message-----
From: xen-devel-bounces@lists.xen.org [mailto:xen-devel-bounces@lists.xen.org] On Behalf Of Kent Yoder
Sent: Thursday, November 08, 2012 10:29 AM
To: Jan Beulich
Cc: Fioravante, Matthew E.; jeremy@goop.org; xen-devel@lists.xensource.com; konrad.wilk@oracle.com; linux-kernel@vger.kernel.org; mail@srajiv.net; tpmdd-devel@lists.sourceforge.net
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend driver

On Thu, Nov 08, 2012 at 08:17:32AM +0000, Jan Beulich wrote:
> >>> On 07.11.12 at 19:14, Matthew Fioravante <matthew.fioravante@jhuapl.edu> wrote:
> > On 11/07/2012 09:46 AM, Kent Yoder wrote:
> >>> --- a/drivers/char/tpm/tpm.h
> >>> +++ b/drivers/char/tpm/tpm.h
> >>> @@ -130,6 +130,9 @@ struct tpm_chip {
> >>>
> >>>   	struct list_head list;
> >>>   	void (*release) (struct device *);
> >>> +#if CONFIG_XEN
> >>> +	void *priv;
> >>> +#endif
> >>   Can you use the chip->vendor.data pointer here instead? 
> >> tpm_ibmvtpm is already using that as a priv pointer. I should 
> >> probably change that name to make it more obvious what that's used for.
> > That makes more sense. I'm guessing your data pointer didn't exist 
> > during the 2.6.18 kernel which is why they added their own priv pointer.
> 
> It got introduced with 3.7-rc.
> 
> >>> @@ -310,6 +313,18 @@ struct tpm_cmd_t {
> >>>
> >>>   ssize_t	tpm_getcap(struct device *, __be32, cap_t *, const char *);
> >>>
> >>> +#ifdef CONFIG_XEN
> >>> +static inline void *chip_get_private(const struct tpm_chip *chip) 
> >>> +{
> >>> +	return chip->priv;
> >>> +}
> >>> +
> >>> +static inline void chip_set_private(struct tpm_chip *chip, void 
> >>> +*priv) {
> >>> +	chip->priv = priv;
> >>> +}
> >>> +#endif
> >>   Can you put these in tpm_vtpm.c please?  One less #define. :-)
> > Agreed, I'd rather not have to modify your shared tpm.h interface at all.
> 
> Either such accessors should be defined here, for everyone to use (and 
> tpm_ibmvtpm.c get changed accordingly), or the Xen code should access 
> the field without wrappers too (for consistency).

  Agreed. I'll update tpm_ibmvtpm.

Kent

So what is the consensus, you're going to use accessors in ibmvtpm? I was just about to remove them from my side.

> 
> Jan
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:38:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:38:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWUBV-0002Jq-Ha; Thu, 08 Nov 2012 15:38:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWUBT-0002Jf-T8
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 15:38:24 +0000
Received: from [85.158.138.51:33688] by server-5.bemta-3.messagelabs.com id
	3A/62-26311-FE1DB905; Thu, 08 Nov 2012 15:38:23 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352389102!21163328!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14101 invoked from network); 8 Nov 2012 15:38:22 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-174.messagelabs.com with SMTP;
	8 Nov 2012 15:38:22 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 15:38:21 +0000
Message-Id: <509BDFFC02000078000A7499@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 15:38:20 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir@xen.org>
References: <509BD7D102000078000A7440@nat28.tlf.novell.com>
	<CCC17D99.51BB1%keir@xen.org>
In-Reply-To: <CCC17D99.51BB1%keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] x86/x2apic: properly implement cluster
 mode
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 08.11.12 at 16:17, Keir Fraser <keir@xen.org> wrote:
> On 08/11/2012 15:03, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>> So far, cluster mode was just an alternative implementation of
>> physical mode: Allowing only single CPU interrupt targets, and sending
>> IPIs to each target CPU separately. Take advantage of what cluster
>> mode really can do in that regard.
> 
> What does it allow? Multicast within certain constraints?

For IPIs, yes. For interrupts, this gets things merely in line with
cluster mode APIC, specifying more than one destination with
lowest priority delivery. Without actively using the TPR, that
should only affect nested interrupts (which previously would
have got deferred until the outer one finished if their vector
was a lower priority one than the one in service, whereas now
they could get serviced by another CPU within the cluster).

I also should have pointed out that this has a potential drawback
- it might increase the pressure on vector allocation, since
they're now being shared more heavily (within clusters). But if
someone runs into problems with that, they ought to simply
switch to physical mode (which previously really had no practical
use at all).

> I know it's not
> part of our coding style, but some comments would be nice. ;)

Hard to tell what specifically you would want to see commented,
given that this really just extends the originally rather simplistic
implementation.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:38:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:38:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWUBV-0002Jq-Ha; Thu, 08 Nov 2012 15:38:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWUBT-0002Jf-T8
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 15:38:24 +0000
Received: from [85.158.138.51:33688] by server-5.bemta-3.messagelabs.com id
	3A/62-26311-FE1DB905; Thu, 08 Nov 2012 15:38:23 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352389102!21163328!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14101 invoked from network); 8 Nov 2012 15:38:22 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-174.messagelabs.com with SMTP;
	8 Nov 2012 15:38:22 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 08 Nov 2012 15:38:21 +0000
Message-Id: <509BDFFC02000078000A7499@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 08 Nov 2012 15:38:20 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir@xen.org>
References: <509BD7D102000078000A7440@nat28.tlf.novell.com>
	<CCC17D99.51BB1%keir@xen.org>
In-Reply-To: <CCC17D99.51BB1%keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] x86/x2apic: properly implement cluster
 mode
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 08.11.12 at 16:17, Keir Fraser <keir@xen.org> wrote:
> On 08/11/2012 15:03, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>> So far, cluster mode was just an alternative implementation of
>> physical mode: Allowing only single CPU interrupt targets, and sending
>> IPIs to each target CPU separately. Take advantage of what cluster
>> mode really can do in that regard.
> 
> What does it allow? Multicast within certain constraints?

For IPIs, yes. For interrupts, this gets things merely in line with
cluster mode APIC, specifying more than one destination with
lowest priority delivery. Without actively using the TPR, that
should only affect nested interrupts (which previously would
have got deferred until the outer one finished if their vector
was a lower priority one than the one in service, whereas now
they could get serviced by another CPU within the cluster).

I also should have pointed out that this has a potential drawback
- it might increase the pressure on vector allocation, since
they're now being shared more heavily (within clusters). But if
someone runs into problems with that, they ought to simply
switch to physical mode (which previously really had no practical
use at all).

> I know it's not
> part of our coding style, but some comments would be nice. ;)

Hard to tell what specifically you would want to see commented,
given that this really just extends the originally rather simplistic
implementation.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:39:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:39:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWUCL-0002Ph-Vr; Thu, 08 Nov 2012 15:39:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1TWUCK-0002PQ-Ea
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 15:39:16 +0000
Received: from [85.158.139.211:47587] by server-8.bemta-5.messagelabs.com id
	CD/3B-06050-322DB905; Thu, 08 Nov 2012 15:39:15 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-11.tower-206.messagelabs.com!1352389153!19430373!1
X-Originating-IP: [209.85.210.173]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14499 invoked from network); 8 Nov 2012 15:39:14 -0000
Received: from mail-ia0-f173.google.com (HELO mail-ia0-f173.google.com)
	(209.85.210.173)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 15:39:14 -0000
Received: by mail-ia0-f173.google.com with SMTP id m10so2423069iam.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 07:39:13 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer
	:x-gm-message-state;
	bh=Yp2BniOXxNH6dtKKqb1uimKwbCOv3IIJ+o2esGaNbvs=;
	b=FeUXtS2z1ULon4lmWqNpVEaY0Sg1ZximsGpqgF/TKr1YDmSCsKvBErYZ8k2YJLRzfS
	VoVn7VFEI1/os/11O19j7w+QTka09OLbkIAIO8vwfGk35I5Q/Fn/MCA071qZ3M/0gyBW
	3VnrYIliVzJ/qodrodVSoGfq+/A/Tq/GdvwDzupX8E7T4kK1xRW2oPIcxMIi05qlGD5a
	eAIE1vVVgnXPkUklEIYu9bknnEX5WM5pWeP9P3MYzYwo7DMuKKgmI//uYmiXLtmrAlWV
	mxJ6yHvj1cBWqCigtTo6E1TbyYil//9mXGH6r3RLqySGn77+bVz0SM1tudZWC+AydNJF
	KHnQ==
Received: by 10.50.1.200 with SMTP id 8mr20702130igo.36.1352389153197;
	Thu, 08 Nov 2012 07:39:13 -0800 (PST)
Received: from [192.168.180.142] ([216.223.139.58])
	by mx.google.com with ESMTPS id uj11sm4613934igb.15.2012.11.08.07.39.12
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 08 Nov 2012 07:39:12 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
In-Reply-To: <CCC112EB.443D1%keir.xen@gmail.com>
Date: Thu, 8 Nov 2012 10:39:23 -0500
Message-Id: <E9393B26-2796-47ED-8AC9-228CABEE86A2@gridcentric.ca>
References: <CCC112EB.443D1%keir.xen@gmail.com>
To: Keir Fraser <keir.xen@gmail.com>
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQlTKsWyb7PvUxAsSuBamSCTWtCVtF+ftovELlO3QPTVdM3PJKiPy1LeMiX400GWm5/LXZFS
Cc: Andres Lagar-Cavilla <andreslc@gridcentric.ca>, Tim Deegan <tim@xen.org>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Wait Queues
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="windows-1252"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Nov 8, 2012, at 2:42 AM, Keir Fraser <keir.xen@gmail.com> wrote:

> On 08/11/2012 03:22, "Andres Lagar-Cavilla" <andreslc@gridcentric.ca> wro=
te:
> =

>>> I'd like to propose an approach that ensures that as long some properti=
es are
>>> met, arbitrary wait queue sleep is allowed. Here are the properties:
>>> 1. Third parties servicing a wait queue sleep are indeed third parties.=
 In
>>> other words, dom0 does not do paging.
>>> 2. Vcpus of a wait queue servicing domain may never go to sleep on a wa=
it
>>> queue during a foreign map.
>>> 3. A guest vcpu may go to sleep on a wait queue holding any kinds of lo=
cks as
>>> long as it does not hold the p2m lock.
>> =

>> N.B: I understand (now) this may cause any other vcpu contending on a lo=
ck
>> held by the wait queue sleeper to not yield to the scheduler and pin its
>> physical cpu.
>> =

>> What I am struggling with is coming up with a solution that doesn't turn
>> hypervisor mm hacking into a locking minefield.
>> =

>> Linux fixes this with many kinds of sleeping synchronization primitives.=
 A
>> task can, for example, hold the mmap semaphore and sleep on a wait queue=
. Is
>> this the only way out of this mess? Not if wait queues force the vcpu to=
 wake
>> up on the same phys cpu it was using at the time of sleeping=8A.
> =

> Well, the forcing to wake up on same phys cpu it slept on is going to be
> fixed. But it's not clear to me how that current restriction makes the
> problem harder? What if you were running on a single-phys-cpu system?
It's not a hard blocker. It's giving up efficiency otherwise. It's a "nice =
to have" precondition.

> =

> As you have realised, the fact that all locks in Xen are spinlocks makes =
the
> potential for deadlock very obvious. Someone else gets scheduled and takes
> out the phys cpu by spinning on a lock that someone else is holding while
> they are descheduled.
> =

> Linux-style sleeping mutexes might help. We could add those. They don't h=
elp
> as readily as in the Linux case however! In some ways they push the deadl=
ock
> up one level of abstraction, to the virt cpu (vcpu). Consider single-vcpu
> dom0 running a pager -- even if you are careful that the pager itself does
> not acquire any locks that one of its clients may hold-while-sleeping, if
> *anything* running in dom0 can acquire such a lock, you have an obvious
> deadlock, as that will take out the dom0 vcpu and leave it blocked forever
> waiting for a lock that is held while its holder waits for service from t=
he
> dom0 vcpu=85.
Uhmm. But it seems there is _some_ method to the madness. Luckily mm locks =
are all taken after the p2m lock (and enforced that way). dom0 can grab ...=
 the big domain lock? the grant table lock?

Perhaps we can categorize locks between reflexive or foreign (not that we h=
ave abundant space in the spin lock struct to stash more flags) and perform=
 some sort of enforcement like what goes on in the mm layer. Xen insults vi=
a BUG_ON's are a strong conditioning tool for developers. It is certainly s=
impler to tease out the locks that might deadlock dom0 than all possible lo=
cks, including RCU read-locks.

What I mean:

BUG_ON(current->domain !=3D d && lock_is_reflexive)
An example of a reflexive lock is the per page sharing lock.

BUG_ON(prepare_to_wait && current->domain->holds_foreign_lock)
An example of a transitive lock is the gran table lock.

A third category would entail global locks like the domain list, which are =
identical to a foreign lock wrt to this analysis.

Another benefit of this is that only reflexive locks need to be made sleep-=
capable, not everything under the sun. I.e. the possibility of livelock is =
corralled to apply only to vcpus of the same domain, and then it's avoided =
by making those lock holders re-schedulable.

Andres

> =

> I don't think there is an easy solution here!
> =

> -- Keir
> =

> =



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:39:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:39:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWUCL-0002Ph-Vr; Thu, 08 Nov 2012 15:39:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1TWUCK-0002PQ-Ea
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 15:39:16 +0000
Received: from [85.158.139.211:47587] by server-8.bemta-5.messagelabs.com id
	CD/3B-06050-322DB905; Thu, 08 Nov 2012 15:39:15 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-11.tower-206.messagelabs.com!1352389153!19430373!1
X-Originating-IP: [209.85.210.173]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14499 invoked from network); 8 Nov 2012 15:39:14 -0000
Received: from mail-ia0-f173.google.com (HELO mail-ia0-f173.google.com)
	(209.85.210.173)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 15:39:14 -0000
Received: by mail-ia0-f173.google.com with SMTP id m10so2423069iam.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 07:39:13 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer
	:x-gm-message-state;
	bh=Yp2BniOXxNH6dtKKqb1uimKwbCOv3IIJ+o2esGaNbvs=;
	b=FeUXtS2z1ULon4lmWqNpVEaY0Sg1ZximsGpqgF/TKr1YDmSCsKvBErYZ8k2YJLRzfS
	VoVn7VFEI1/os/11O19j7w+QTka09OLbkIAIO8vwfGk35I5Q/Fn/MCA071qZ3M/0gyBW
	3VnrYIliVzJ/qodrodVSoGfq+/A/Tq/GdvwDzupX8E7T4kK1xRW2oPIcxMIi05qlGD5a
	eAIE1vVVgnXPkUklEIYu9bknnEX5WM5pWeP9P3MYzYwo7DMuKKgmI//uYmiXLtmrAlWV
	mxJ6yHvj1cBWqCigtTo6E1TbyYil//9mXGH6r3RLqySGn77+bVz0SM1tudZWC+AydNJF
	KHnQ==
Received: by 10.50.1.200 with SMTP id 8mr20702130igo.36.1352389153197;
	Thu, 08 Nov 2012 07:39:13 -0800 (PST)
Received: from [192.168.180.142] ([216.223.139.58])
	by mx.google.com with ESMTPS id uj11sm4613934igb.15.2012.11.08.07.39.12
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 08 Nov 2012 07:39:12 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
In-Reply-To: <CCC112EB.443D1%keir.xen@gmail.com>
Date: Thu, 8 Nov 2012 10:39:23 -0500
Message-Id: <E9393B26-2796-47ED-8AC9-228CABEE86A2@gridcentric.ca>
References: <CCC112EB.443D1%keir.xen@gmail.com>
To: Keir Fraser <keir.xen@gmail.com>
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQlTKsWyb7PvUxAsSuBamSCTWtCVtF+ftovELlO3QPTVdM3PJKiPy1LeMiX400GWm5/LXZFS
Cc: Andres Lagar-Cavilla <andreslc@gridcentric.ca>, Tim Deegan <tim@xen.org>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Wait Queues
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="windows-1252"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Nov 8, 2012, at 2:42 AM, Keir Fraser <keir.xen@gmail.com> wrote:

> On 08/11/2012 03:22, "Andres Lagar-Cavilla" <andreslc@gridcentric.ca> wro=
te:
> =

>>> I'd like to propose an approach that ensures that as long some properti=
es are
>>> met, arbitrary wait queue sleep is allowed. Here are the properties:
>>> 1. Third parties servicing a wait queue sleep are indeed third parties.=
 In
>>> other words, dom0 does not do paging.
>>> 2. Vcpus of a wait queue servicing domain may never go to sleep on a wa=
it
>>> queue during a foreign map.
>>> 3. A guest vcpu may go to sleep on a wait queue holding any kinds of lo=
cks as
>>> long as it does not hold the p2m lock.
>> =

>> N.B: I understand (now) this may cause any other vcpu contending on a lo=
ck
>> held by the wait queue sleeper to not yield to the scheduler and pin its
>> physical cpu.
>> =

>> What I am struggling with is coming up with a solution that doesn't turn
>> hypervisor mm hacking into a locking minefield.
>> =

>> Linux fixes this with many kinds of sleeping synchronization primitives.=
 A
>> task can, for example, hold the mmap semaphore and sleep on a wait queue=
. Is
>> this the only way out of this mess? Not if wait queues force the vcpu to=
 wake
>> up on the same phys cpu it was using at the time of sleeping=8A.
> =

> Well, the forcing to wake up on same phys cpu it slept on is going to be
> fixed. But it's not clear to me how that current restriction makes the
> problem harder? What if you were running on a single-phys-cpu system?
It's not a hard blocker. It's giving up efficiency otherwise. It's a "nice =
to have" precondition.

> =

> As you have realised, the fact that all locks in Xen are spinlocks makes =
the
> potential for deadlock very obvious. Someone else gets scheduled and takes
> out the phys cpu by spinning on a lock that someone else is holding while
> they are descheduled.
> =

> Linux-style sleeping mutexes might help. We could add those. They don't h=
elp
> as readily as in the Linux case however! In some ways they push the deadl=
ock
> up one level of abstraction, to the virt cpu (vcpu). Consider single-vcpu
> dom0 running a pager -- even if you are careful that the pager itself does
> not acquire any locks that one of its clients may hold-while-sleeping, if
> *anything* running in dom0 can acquire such a lock, you have an obvious
> deadlock, as that will take out the dom0 vcpu and leave it blocked forever
> waiting for a lock that is held while its holder waits for service from t=
he
> dom0 vcpu=85.
Uhmm. But it seems there is _some_ method to the madness. Luckily mm locks =
are all taken after the p2m lock (and enforced that way). dom0 can grab ...=
 the big domain lock? the grant table lock?

Perhaps we can categorize locks between reflexive or foreign (not that we h=
ave abundant space in the spin lock struct to stash more flags) and perform=
 some sort of enforcement like what goes on in the mm layer. Xen insults vi=
a BUG_ON's are a strong conditioning tool for developers. It is certainly s=
impler to tease out the locks that might deadlock dom0 than all possible lo=
cks, including RCU read-locks.

What I mean:

BUG_ON(current->domain !=3D d && lock_is_reflexive)
An example of a reflexive lock is the per page sharing lock.

BUG_ON(prepare_to_wait && current->domain->holds_foreign_lock)
An example of a transitive lock is the gran table lock.

A third category would entail global locks like the domain list, which are =
identical to a foreign lock wrt to this analysis.

Another benefit of this is that only reflexive locks need to be made sleep-=
capable, not everything under the sun. I.e. the possibility of livelock is =
corralled to apply only to vcpus of the same domain, and then it's avoided =
by making those lock holders re-schedulable.

Andres

> =

> I don't think there is an easy solution here!
> =

> -- Keir
> =

> =



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:42:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:42:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWUEo-0002cr-Hz; Thu, 08 Nov 2012 15:41:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TWUEn-0002ci-HT
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 15:41:49 +0000
Received: from [85.158.143.35:30547] by server-3.bemta-4.messagelabs.com id
	AA/0D-06841-CB2DB905; Thu, 08 Nov 2012 15:41:48 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-3.tower-21.messagelabs.com!1352389305!14452162!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17605 invoked from network); 8 Nov 2012 15:41:47 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-3.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 8 Nov 2012 15:41:47 -0000
Received: from ([128.244.198.90])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.156869695;
	Thu, 08 Nov 2012 10:40:35 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas1.dom1.jhuapl.edu ([128.244.198.90]) with mapi; Thu, 8 Nov 2012
	10:40:35 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Thu, 8 Nov 2012 10:40:34 -0500
Thread-Topic: [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend driver
Thread-Index: Ac29A74MlKXxsP0MQBeRIfuPxfA7IAAw1yJg
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48A229E705@aplesstripe.dom1.jhuapl.edu>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121106193921.GC28473@phenom.dumpdata.com>
	<509A6AA6.2000208@jhuapl.edu>
	<20121107160659.GH18615@phenom.dumpdata.com>
In-Reply-To: <20121107160659.GH18615@phenom.dumpdata.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	"key@linux.vnet.ibm.com" <key@linux.vnet.ibm.com>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
	driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



-----Original Message-----
From: Konrad Rzeszutek Wilk [mailto:konrad.wilk@oracle.com] 
Sent: Wednesday, November 07, 2012 11:07 AM
To: Fioravante, Matthew E.
Cc: key@linux.vnet.ibm.com; mail@srajiv.net; jeremy@goop.org; tpmdd-devel@lists.sourceforge.net; xen-devel@lists.xensource.com; linux-kernel@vger.kernel.org
Subject: Re: [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend driver

On Wed, Nov 07, 2012 at 09:05:26AM -0500, Matthew Fioravante wrote:
> On 11/06/2012 02:39 PM, Konrad Rzeszutek Wilk wrote:
> >On Mon, Nov 05, 2012 at 10:09:57AM -0500, Matthew Fioravante wrote:
> >>This patch ports the xen vtpm frontend driver for linux from the 
> >>linux-2.6.18-xen.hg tree to linux-stable.
> >So how does on test it ? Set it up? Use it? Is there some 
> >documentation about it - if so it should be in the patch description.
> Thats actually a question I had. To use this driver now you have to 
> use my vtpm mini-os domains which are currently being evaluated in the 
> xen-devel mailing list. Once they are accepted I will submit a 
> documentation update to the Xen tree.
> 
> Whats the best practice for documentation in this case? All in xen?
> Some linux/some xen? If the latter, how much goes in linux and where?

As much as possible. I would say stick both of them in Xen and in Linux.
And you can designate one of them as primary (say the Xen one) and say in the Linux:

"For up-to-date information, please refer to XXYYZZ"

I grepped through the linux source code and didn't see any documentation for the other xen drivers. I could put a "please refer to XXX in xen" line in the Kconfig or as a comment in the source code or both. Am I missing something or is there some standard way the xen devs handle this documentation issue for linux drivers?

> >
> >I did a very very cursory look at it, see some of the comments.
> >
> >>
> >>+
> >>+
> >>+static inline struct transmission *transmission_alloc(void) {
> >>+     return kzalloc(sizeof(struct transmission), GFP_ATOMIC); }
> >>+
> >>+     static unsigned char *
> >
> >That is very weird tabbing? Did you run this patch through 
> >scripts/checkpatch.pl ?
> Wow thats ugly. I ran the check script and it looks like it didn't 
> pick this up. For some reason my editor wants to autoindent like that.
> Fixed.
> >
> >>+
> >>+static const struct file_operations vtpm_ops = {
> >>+     .owner = THIS_MODULE,
> >>+     .llseek = no_llseek,
> >>+     .open = tpm_open,
> >>+     .read = tpm_read,
> >>+     .write = tpm_write,
> >>+     .release = tpm_release,
> >>+};
> >>+
> >>+static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL); static 
> >>+DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL); static 
> >>+DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL); static 
> >>+DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL); static 
> >>+DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL); static 
> >>+DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,
> >>+             NULL);
> >>+static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL); static 
> >>+DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
> >>+
> >>+static struct attribute *vtpm_attrs[] = {
> >>+     &dev_attr_pubek.attr,
> >>+     &dev_attr_pcrs.attr,
> >>+     &dev_attr_enabled.attr,
> >>+     &dev_attr_active.attr,
> >>+     &dev_attr_owned.attr,
> >>+     &dev_attr_temp_deactivated.attr,
> >>+     &dev_attr_caps.attr,
> >>+     &dev_attr_cancel.attr,
> >>+     NULL,
> >So are these going to show up in SysFS? If so, there should also be a 
> >corresponding file in Documentation/.../sysfs/something.
> These are similar to the entries made by the other tpm drivers. I 
> don't see any documentation about those either. TPM maintainers, any 
> guidance there?
> >
> >>+#include "tpm.h"
> >>+#include "tpm_vtpm.h"
> >>+
> >>+#undef DEBUG
> >>+
> >>+#define GRANT_INVALID_REF 0
> >Interesting. The 0 grant value is actually a valid one. I think you 
> >want (-1ULL).
> Is it?
> drivers/block/xen-blkfront.c and
> drivers/net/xen-netfront.c
> 
> do the exact same thing

You are right. Just leave it as that then.

> >>+
> >>+     init_tpm_xenbus();
> >>+     return 0;
> >>+}
> >>+
> >>+
> >>+module_init(tpmif_init);
> >no module_exit?
> Will fix
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:42:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:42:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWUEo-0002cr-Hz; Thu, 08 Nov 2012 15:41:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TWUEn-0002ci-HT
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 15:41:49 +0000
Received: from [85.158.143.35:30547] by server-3.bemta-4.messagelabs.com id
	AA/0D-06841-CB2DB905; Thu, 08 Nov 2012 15:41:48 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-3.tower-21.messagelabs.com!1352389305!14452162!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17605 invoked from network); 8 Nov 2012 15:41:47 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-3.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 8 Nov 2012 15:41:47 -0000
Received: from ([128.244.198.90])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.156869695;
	Thu, 08 Nov 2012 10:40:35 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas1.dom1.jhuapl.edu ([128.244.198.90]) with mapi; Thu, 8 Nov 2012
	10:40:35 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Thu, 8 Nov 2012 10:40:34 -0500
Thread-Topic: [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend driver
Thread-Index: Ac29A74MlKXxsP0MQBeRIfuPxfA7IAAw1yJg
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48A229E705@aplesstripe.dom1.jhuapl.edu>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121106193921.GC28473@phenom.dumpdata.com>
	<509A6AA6.2000208@jhuapl.edu>
	<20121107160659.GH18615@phenom.dumpdata.com>
In-Reply-To: <20121107160659.GH18615@phenom.dumpdata.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	"key@linux.vnet.ibm.com" <key@linux.vnet.ibm.com>
Subject: Re: [Xen-devel] [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend
	driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



-----Original Message-----
From: Konrad Rzeszutek Wilk [mailto:konrad.wilk@oracle.com] 
Sent: Wednesday, November 07, 2012 11:07 AM
To: Fioravante, Matthew E.
Cc: key@linux.vnet.ibm.com; mail@srajiv.net; jeremy@goop.org; tpmdd-devel@lists.sourceforge.net; xen-devel@lists.xensource.com; linux-kernel@vger.kernel.org
Subject: Re: [PATCH] add tpm_xenu.ko: Xen Virtual TPM frontend driver

On Wed, Nov 07, 2012 at 09:05:26AM -0500, Matthew Fioravante wrote:
> On 11/06/2012 02:39 PM, Konrad Rzeszutek Wilk wrote:
> >On Mon, Nov 05, 2012 at 10:09:57AM -0500, Matthew Fioravante wrote:
> >>This patch ports the xen vtpm frontend driver for linux from the 
> >>linux-2.6.18-xen.hg tree to linux-stable.
> >So how does on test it ? Set it up? Use it? Is there some 
> >documentation about it - if so it should be in the patch description.
> Thats actually a question I had. To use this driver now you have to 
> use my vtpm mini-os domains which are currently being evaluated in the 
> xen-devel mailing list. Once they are accepted I will submit a 
> documentation update to the Xen tree.
> 
> Whats the best practice for documentation in this case? All in xen?
> Some linux/some xen? If the latter, how much goes in linux and where?

As much as possible. I would say stick both of them in Xen and in Linux.
And you can designate one of them as primary (say the Xen one) and say in the Linux:

"For up-to-date information, please refer to XXYYZZ"

I grepped through the linux source code and didn't see any documentation for the other xen drivers. I could put a "please refer to XXX in xen" line in the Kconfig or as a comment in the source code or both. Am I missing something or is there some standard way the xen devs handle this documentation issue for linux drivers?

> >
> >I did a very very cursory look at it, see some of the comments.
> >
> >>
> >>+
> >>+
> >>+static inline struct transmission *transmission_alloc(void) {
> >>+     return kzalloc(sizeof(struct transmission), GFP_ATOMIC); }
> >>+
> >>+     static unsigned char *
> >
> >That is very weird tabbing? Did you run this patch through 
> >scripts/checkpatch.pl ?
> Wow thats ugly. I ran the check script and it looks like it didn't 
> pick this up. For some reason my editor wants to autoindent like that.
> Fixed.
> >
> >>+
> >>+static const struct file_operations vtpm_ops = {
> >>+     .owner = THIS_MODULE,
> >>+     .llseek = no_llseek,
> >>+     .open = tpm_open,
> >>+     .read = tpm_read,
> >>+     .write = tpm_write,
> >>+     .release = tpm_release,
> >>+};
> >>+
> >>+static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL); static 
> >>+DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL); static 
> >>+DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL); static 
> >>+DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL); static 
> >>+DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL); static 
> >>+DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,
> >>+             NULL);
> >>+static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL); static 
> >>+DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
> >>+
> >>+static struct attribute *vtpm_attrs[] = {
> >>+     &dev_attr_pubek.attr,
> >>+     &dev_attr_pcrs.attr,
> >>+     &dev_attr_enabled.attr,
> >>+     &dev_attr_active.attr,
> >>+     &dev_attr_owned.attr,
> >>+     &dev_attr_temp_deactivated.attr,
> >>+     &dev_attr_caps.attr,
> >>+     &dev_attr_cancel.attr,
> >>+     NULL,
> >So are these going to show up in SysFS? If so, there should also be a 
> >corresponding file in Documentation/.../sysfs/something.
> These are similar to the entries made by the other tpm drivers. I 
> don't see any documentation about those either. TPM maintainers, any 
> guidance there?
> >
> >>+#include "tpm.h"
> >>+#include "tpm_vtpm.h"
> >>+
> >>+#undef DEBUG
> >>+
> >>+#define GRANT_INVALID_REF 0
> >Interesting. The 0 grant value is actually a valid one. I think you 
> >want (-1ULL).
> Is it?
> drivers/block/xen-blkfront.c and
> drivers/net/xen-netfront.c
> 
> do the exact same thing

You are right. Just leave it as that then.

> >>+
> >>+     init_tpm_xenbus();
> >>+     return 0;
> >>+}
> >>+
> >>+
> >>+module_init(tpmif_init);
> >no module_exit?
> Will fix
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:43:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:43:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWUG0-0002kB-0n; Thu, 08 Nov 2012 15:43:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TWUFz-0002k3-0U
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 15:43:03 +0000
Received: from [85.158.143.35:36829] by server-3.bemta-4.messagelabs.com id
	78/8F-06841-603DB905; Thu, 08 Nov 2012 15:43:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1352389368!16299417!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODIzMDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5032 invoked from network); 8 Nov 2012 15:42:49 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-13.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 15:42:49 -0000
X-IronPort-AV: E=Sophos;i="4.80,738,1344211200"; d="scan'208";a="43951664"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	08 Nov 2012 15:42:47 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 8 Nov 2012 10:42:47 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TWUFi-0007AM-HZ;
	Thu, 08 Nov 2012 15:42:46 +0000
Message-ID: <1352389245.12977.106.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 8 Nov 2012 16:40:45 +0100
In-Reply-To: <201211081528.31968.arnd@arndb.de>
References: <20121106175749.GO28327@n2100.arm.linux.org.uk>
	<201211081528.31968.arnd@arndb.de>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"arm@kernel.org" <arm@kernel.org>, "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Xen-devel] BUG: ARM build failures due to Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-08 at 15:28 +0000, Arnd Bergmann wrote:
> On Tuesday 06 November 2012, Russell King - ARM Linux wrote:
> > My build system is giving me the following errors against an OMAP4
> > randconfig build against the latest Linus' kernel plus arm-soc:
> > 
> > ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> > make[2]: *** [__modpost] Error 1
> > make[2]: Target `_modpost' not remade because of errors.
> > make[1]: *** [modules] Error 2
> > make: *** [sub-make] Error 2
> > make: Target `uImage' not remade because of errors.
> > make: Target `modules' not remade because of errors.
> > 
> > Full build results and configuration are here:
> > 
> > http://www.arm.linux.org.uk/developer/build/result.php?type=build&idx=2627
> > http://www.arm.linux.org.uk/developer/build/file.php?type=config&idx=2627
> > 
> 
> I can reproduce the same thing with mainline v3.7-rc4.
> 8<------
> xen/arm: export privcmd_call

Thanks, Konrad posted a fix for this on Tuesday which covers a few other
cases too: http://marc.info/?l=linux-kernel&m=135224075902642&w=2 I
added Russell to my response but forgot to add l-a-k@ too, sorry.

Is one of you going to pick it up and send to mainline?

Ian.

> privcmd_call may get called from a module, so it has to be exported.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> index 59bcb96..ff5e300 100644
> --- a/arch/arm/xen/enlighten.c
> +++ b/arch/arm/xen/enlighten.c
> @@ -17,6 +17,9 @@
>  #include <linux/of_irq.h>
>  #include <linux/of_address.h>
>  
> +/* from hypercall.S */
> +EXPORT_SYMBOL_GPL(privcmd_call);
> +
>  struct start_info _xen_start_info;
>  struct start_info *xen_start_info = &_xen_start_info;
>  EXPORT_SYMBOL_GPL(xen_start_info);
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:43:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:43:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWUG0-0002kB-0n; Thu, 08 Nov 2012 15:43:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TWUFz-0002k3-0U
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 15:43:03 +0000
Received: from [85.158.143.35:36829] by server-3.bemta-4.messagelabs.com id
	78/8F-06841-603DB905; Thu, 08 Nov 2012 15:43:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1352389368!16299417!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODIzMDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5032 invoked from network); 8 Nov 2012 15:42:49 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-13.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 15:42:49 -0000
X-IronPort-AV: E=Sophos;i="4.80,738,1344211200"; d="scan'208";a="43951664"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	08 Nov 2012 15:42:47 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 8 Nov 2012 10:42:47 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[127.0.0.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TWUFi-0007AM-HZ;
	Thu, 08 Nov 2012 15:42:46 +0000
Message-ID: <1352389245.12977.106.camel@hastur.hellion.org.uk>
From: Ian Campbell <ian.campbell@citrix.com>
To: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 8 Nov 2012 16:40:45 +0100
In-Reply-To: <201211081528.31968.arnd@arndb.de>
References: <20121106175749.GO28327@n2100.arm.linux.org.uk>
	<201211081528.31968.arnd@arndb.de>
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"arm@kernel.org" <arm@kernel.org>, "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Xen-devel] BUG: ARM build failures due to Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-08 at 15:28 +0000, Arnd Bergmann wrote:
> On Tuesday 06 November 2012, Russell King - ARM Linux wrote:
> > My build system is giving me the following errors against an OMAP4
> > randconfig build against the latest Linus' kernel plus arm-soc:
> > 
> > ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> > make[2]: *** [__modpost] Error 1
> > make[2]: Target `_modpost' not remade because of errors.
> > make[1]: *** [modules] Error 2
> > make: *** [sub-make] Error 2
> > make: Target `uImage' not remade because of errors.
> > make: Target `modules' not remade because of errors.
> > 
> > Full build results and configuration are here:
> > 
> > http://www.arm.linux.org.uk/developer/build/result.php?type=build&idx=2627
> > http://www.arm.linux.org.uk/developer/build/file.php?type=config&idx=2627
> > 
> 
> I can reproduce the same thing with mainline v3.7-rc4.
> 8<------
> xen/arm: export privcmd_call

Thanks, Konrad posted a fix for this on Tuesday which covers a few other
cases too: http://marc.info/?l=linux-kernel&m=135224075902642&w=2 I
added Russell to my response but forgot to add l-a-k@ too, sorry.

Is one of you going to pick it up and send to mainline?

Ian.

> privcmd_call may get called from a module, so it has to be exported.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> index 59bcb96..ff5e300 100644
> --- a/arch/arm/xen/enlighten.c
> +++ b/arch/arm/xen/enlighten.c
> @@ -17,6 +17,9 @@
>  #include <linux/of_irq.h>
>  #include <linux/of_address.h>
>  
> +/* from hypercall.S */
> +EXPORT_SYMBOL_GPL(privcmd_call);
> +
>  struct start_info _xen_start_info;
>  struct start_info *xen_start_info = &_xen_start_info;
>  EXPORT_SYMBOL_GPL(xen_start_info);
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:48:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:48:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWUKl-00030l-Tr; Thu, 08 Nov 2012 15:47:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TWUKj-00030d-Ut
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 15:47:58 +0000
Received: from [85.158.139.83:62325] by server-1.bemta-5.messagelabs.com id
	82/33-05877-D24DB905; Thu, 08 Nov 2012 15:47:57 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-10.tower-182.messagelabs.com!1352389675!29664696!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=HTML_MESSAGE, UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32093 invoked from network); 8 Nov 2012 15:47:56 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-10.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 15:47:56 -0000
Received: from ([128.244.198.91])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.156870633;
	Thu, 08 Nov 2012 10:47:39 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas2.dom1.jhuapl.edu ([128.244.198.91]) with mapi; Thu, 8 Nov 2012
	10:47:39 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Date: Thu, 8 Nov 2012 10:47:38 -0500
Thread-Topic: Documenting vtpm
Thread-Index: Ac29x3WiQ7d+R5IeTaOaAhaLY1tJtQ==
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48A229E710@aplesstripe.dom1.jhuapl.edu>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: [Xen-devel] Documenting vtpm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0835153168193810554=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0835153168193810554==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_068F06DC4D106941B297C0C5F9F446EA48A229E710aplesstripedo_"

--_000_068F06DC4D106941B297C0C5F9F446EA48A229E710aplesstripedo_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

I'd like to write some documentation for vtpm as a whole but wanted to ask =
what your preference is on where it gets located and how its formatted.

Right now the old vtpm uses docs/misc/vtpm.txt. I can just update this file=
 or do something else.

Here are my current suggestions:
READMEs in stubdom/vtpm and stubdom/vtpmmgr explaining their command line a=
rguments and specifics.
docs/misc/vtpm.txt explaining how to use the entire system.

Another idea is to just forget the README files and put everything in docs/=
misc/vtpm.txt

It would also be helpful to have example config files. I see a lot of xm re=
lated stuff in tools/examples/. Is that directory deprecated? I could put e=
xample vtpm and vtpmmgr configs there or in the stubdom directories.


--_000_068F06DC4D106941B297C0C5F9F446EA48A229E710aplesstripedo_
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-micr=
osoft-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"Micros=
oft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	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-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></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=3DEN-US link=3Dblue vli=
nk=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal>I&#8217;d like t=
o write some documentation for vtpm as a whole but wanted to ask what your =
preference is on where it gets located and how its formatted.<o:p></o:p></p=
><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>Right now t=
he old vtpm uses docs/misc/vtpm.txt. I can just update this file or do some=
thing else. <o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p cla=
ss=3DMsoNormal>Here are my current suggestions:<o:p></o:p></p><p class=3DMs=
oNormal>READMEs in stubdom/vtpm and stubdom/vtpmmgr explaining their comman=
d line arguments and specifics.<o:p></o:p></p><p class=3DMsoNormal>docs/mis=
c/vtpm.txt explaining how to use the entire system.<o:p></o:p></p><p class=
=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>Another idea is to j=
ust forget the README files and put everything in docs/misc/vtpm.txt<o:p></=
o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>It w=
ould also be helpful to have example config files. I see a lot of xm relate=
d stuff in tools/examples/. Is that directory deprecated? I could put examp=
le vtpm and vtpmmgr configs there or in the stubdom directories.<o:p></o:p>=
</p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p></div></body></html>=

--_000_068F06DC4D106941B297C0C5F9F446EA48A229E710aplesstripedo_--


--===============0835153168193810554==
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.xen.org
http://lists.xen.org/xen-devel

--===============0835153168193810554==--


From xen-devel-bounces@lists.xen.org Thu Nov 08 15:48:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:48:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWUKl-00030l-Tr; Thu, 08 Nov 2012 15:47:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TWUKj-00030d-Ut
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 15:47:58 +0000
Received: from [85.158.139.83:62325] by server-1.bemta-5.messagelabs.com id
	82/33-05877-D24DB905; Thu, 08 Nov 2012 15:47:57 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-10.tower-182.messagelabs.com!1352389675!29664696!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=HTML_MESSAGE, UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32093 invoked from network); 8 Nov 2012 15:47:56 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-10.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 15:47:56 -0000
Received: from ([128.244.198.91])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.156870633;
	Thu, 08 Nov 2012 10:47:39 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas2.dom1.jhuapl.edu ([128.244.198.91]) with mapi; Thu, 8 Nov 2012
	10:47:39 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Date: Thu, 8 Nov 2012 10:47:38 -0500
Thread-Topic: Documenting vtpm
Thread-Index: Ac29x3WiQ7d+R5IeTaOaAhaLY1tJtQ==
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48A229E710@aplesstripe.dom1.jhuapl.edu>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: [Xen-devel] Documenting vtpm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0835153168193810554=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0835153168193810554==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_068F06DC4D106941B297C0C5F9F446EA48A229E710aplesstripedo_"

--_000_068F06DC4D106941B297C0C5F9F446EA48A229E710aplesstripedo_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

I'd like to write some documentation for vtpm as a whole but wanted to ask =
what your preference is on where it gets located and how its formatted.

Right now the old vtpm uses docs/misc/vtpm.txt. I can just update this file=
 or do something else.

Here are my current suggestions:
READMEs in stubdom/vtpm and stubdom/vtpmmgr explaining their command line a=
rguments and specifics.
docs/misc/vtpm.txt explaining how to use the entire system.

Another idea is to just forget the README files and put everything in docs/=
misc/vtpm.txt

It would also be helpful to have example config files. I see a lot of xm re=
lated stuff in tools/examples/. Is that directory deprecated? I could put e=
xample vtpm and vtpmmgr configs there or in the stubdom directories.


--_000_068F06DC4D106941B297C0C5F9F446EA48A229E710aplesstripedo_
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-micr=
osoft-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"Micros=
oft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	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-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></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=3DEN-US link=3Dblue vli=
nk=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal>I&#8217;d like t=
o write some documentation for vtpm as a whole but wanted to ask what your =
preference is on where it gets located and how its formatted.<o:p></o:p></p=
><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>Right now t=
he old vtpm uses docs/misc/vtpm.txt. I can just update this file or do some=
thing else. <o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p cla=
ss=3DMsoNormal>Here are my current suggestions:<o:p></o:p></p><p class=3DMs=
oNormal>READMEs in stubdom/vtpm and stubdom/vtpmmgr explaining their comman=
d line arguments and specifics.<o:p></o:p></p><p class=3DMsoNormal>docs/mis=
c/vtpm.txt explaining how to use the entire system.<o:p></o:p></p><p class=
=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>Another idea is to j=
ust forget the README files and put everything in docs/misc/vtpm.txt<o:p></=
o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>It w=
ould also be helpful to have example config files. I see a lot of xm relate=
d stuff in tools/examples/. Is that directory deprecated? I could put examp=
le vtpm and vtpmmgr configs there or in the stubdom directories.<o:p></o:p>=
</p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p></div></body></html>=

--_000_068F06DC4D106941B297C0C5F9F446EA48A229E710aplesstripedo_--


--===============0835153168193810554==
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.xen.org
http://lists.xen.org/xen-devel

--===============0835153168193810554==--


From xen-devel-bounces@lists.xen.org Thu Nov 08 15:49:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:49:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWUMD-00035d-DW; Thu, 08 Nov 2012 15:49:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TWUMC-00035V-C9
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 15:49:28 +0000
Received: from [85.158.139.83:14591] by server-14.bemta-5.messagelabs.com id
	13/1C-21768-784DB905; Thu, 08 Nov 2012 15:49:27 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1352389764!25443734!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODIzMDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23613 invoked from network); 8 Nov 2012 15:49:26 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 15:49:26 -0000
X-IronPort-AV: E=Sophos;i="4.80,738,1344211200"; d="scan'208";a="43952908"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	08 Nov 2012 15:49:24 +0000
Received: from kaball.uk.xensource.com (10.80.2.59) by
	FTLPEX01CL03.citrite.net (10.13.107.80) with Microsoft SMTP Server id
	14.2.318.1; Thu, 8 Nov 2012 10:49:23 -0500
Date: Thu, 8 Nov 2012 15:48:36 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <ian.campbell@citrix.com>
In-Reply-To: <1352389245.12977.106.camel@hastur.hellion.org.uk>
Message-ID: <alpine.DEB.2.02.1211081544510.2689@kaball.uk.xensource.com>
References: <20121106175749.GO28327@n2100.arm.linux.org.uk>
	<201211081528.31968.arnd@arndb.de>
	<1352389245.12977.106.camel@hastur.hellion.org.uk>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
X-Originating-IP: [10.80.2.59]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Arnd Bergmann <arnd@arndb.de>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"arm@kernel.org" <arm@kernel.org>, "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Xen-devel] BUG: ARM build failures due to Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 8 Nov 2012, Ian Campbell wrote:
> On Thu, 2012-11-08 at 15:28 +0000, Arnd Bergmann wrote:
> > On Tuesday 06 November 2012, Russell King - ARM Linux wrote:
> > > My build system is giving me the following errors against an OMAP4
> > > randconfig build against the latest Linus' kernel plus arm-soc:
> > > 
> > > ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> > > make[2]: *** [__modpost] Error 1
> > > make[2]: Target `_modpost' not remade because of errors.
> > > make[1]: *** [modules] Error 2
> > > make: *** [sub-make] Error 2
> > > make: Target `uImage' not remade because of errors.
> > > make: Target `modules' not remade because of errors.
> > > 
> > > Full build results and configuration are here:
> > > 
> > > http://www.arm.linux.org.uk/developer/build/result.php?type=build&idx=2627
> > > http://www.arm.linux.org.uk/developer/build/file.php?type=config&idx=2627
> > > 
> > 
> > I can reproduce the same thing with mainline v3.7-rc4.
> > 8<------
> > xen/arm: export privcmd_call
> 
> Thanks, Konrad posted a fix for this on Tuesday which covers a few other
> cases too: http://marc.info/?l=linux-kernel&m=135224075902642&w=2 I
> added Russell to my response but forgot to add l-a-k@ too, sorry.

Konrad, do you have time to respin a patch that exports all the 9
hypercalls?

If not (maybe Konrad is away like me), then I am OK for Konrad's
current patch to be applied as it is.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:49:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:49:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWUMD-00035d-DW; Thu, 08 Nov 2012 15:49:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TWUMC-00035V-C9
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 15:49:28 +0000
Received: from [85.158.139.83:14591] by server-14.bemta-5.messagelabs.com id
	13/1C-21768-784DB905; Thu, 08 Nov 2012 15:49:27 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1352389764!25443734!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODIzMDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23613 invoked from network); 8 Nov 2012 15:49:26 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 15:49:26 -0000
X-IronPort-AV: E=Sophos;i="4.80,738,1344211200"; d="scan'208";a="43952908"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	08 Nov 2012 15:49:24 +0000
Received: from kaball.uk.xensource.com (10.80.2.59) by
	FTLPEX01CL03.citrite.net (10.13.107.80) with Microsoft SMTP Server id
	14.2.318.1; Thu, 8 Nov 2012 10:49:23 -0500
Date: Thu, 8 Nov 2012 15:48:36 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <ian.campbell@citrix.com>
In-Reply-To: <1352389245.12977.106.camel@hastur.hellion.org.uk>
Message-ID: <alpine.DEB.2.02.1211081544510.2689@kaball.uk.xensource.com>
References: <20121106175749.GO28327@n2100.arm.linux.org.uk>
	<201211081528.31968.arnd@arndb.de>
	<1352389245.12977.106.camel@hastur.hellion.org.uk>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
X-Originating-IP: [10.80.2.59]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Arnd Bergmann <arnd@arndb.de>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"arm@kernel.org" <arm@kernel.org>, "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Xen-devel] BUG: ARM build failures due to Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 8 Nov 2012, Ian Campbell wrote:
> On Thu, 2012-11-08 at 15:28 +0000, Arnd Bergmann wrote:
> > On Tuesday 06 November 2012, Russell King - ARM Linux wrote:
> > > My build system is giving me the following errors against an OMAP4
> > > randconfig build against the latest Linus' kernel plus arm-soc:
> > > 
> > > ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> > > make[2]: *** [__modpost] Error 1
> > > make[2]: Target `_modpost' not remade because of errors.
> > > make[1]: *** [modules] Error 2
> > > make: *** [sub-make] Error 2
> > > make: Target `uImage' not remade because of errors.
> > > make: Target `modules' not remade because of errors.
> > > 
> > > Full build results and configuration are here:
> > > 
> > > http://www.arm.linux.org.uk/developer/build/result.php?type=build&idx=2627
> > > http://www.arm.linux.org.uk/developer/build/file.php?type=config&idx=2627
> > > 
> > 
> > I can reproduce the same thing with mainline v3.7-rc4.
> > 8<------
> > xen/arm: export privcmd_call
> 
> Thanks, Konrad posted a fix for this on Tuesday which covers a few other
> cases too: http://marc.info/?l=linux-kernel&m=135224075902642&w=2 I
> added Russell to my response but forgot to add l-a-k@ too, sorry.

Konrad, do you have time to respin a patch that exports all the 9
hypercalls?

If not (maybe Konrad is away like me), then I am OK for Konrad's
current patch to be applied as it is.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:59:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:59:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWUW9-0003LE-Lj; Thu, 08 Nov 2012 15:59:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TWUW8-0003L9-MO
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 15:59:44 +0000
Received: from [85.158.139.83:27681] by server-14.bemta-5.messagelabs.com id
	BB/B5-21768-FE6DB905; Thu, 08 Nov 2012 15:59:43 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1352390382!29389900!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODUwMTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25194 invoked from network); 8 Nov 2012 15:59:43 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 15:59:43 -0000
X-IronPort-AV: E=Sophos;i="4.80,738,1344211200"; d="scan'208";a="213895629"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	08 Nov 2012 15:59:41 +0000
Received: from kaball.uk.xensource.com (10.80.2.59) by
	FTLPEX01CL01.citrite.net (10.13.107.78) with Microsoft SMTP Server id
	14.2.318.1; Thu, 8 Nov 2012 10:59:41 -0500
Date: Thu, 8 Nov 2012 15:58:55 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
In-Reply-To: <alpine.DEB.2.02.1211081544510.2689@kaball.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211081554220.2689@kaball.uk.xensource.com>
References: <20121106175749.GO28327@n2100.arm.linux.org.uk>
	<201211081528.31968.arnd@arndb.de>
	<1352389245.12977.106.camel@hastur.hellion.org.uk>
	<alpine.DEB.2.02.1211081544510.2689@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
X-Originating-IP: [10.80.2.59]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Ian Campbell <Ian.Campbell@citrix.com>, Arnd Bergmann <arnd@arndb.de>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"arm@kernel.org" <arm@kernel.org>, "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Xen-devel] BUG: ARM build failures due to Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 8 Nov 2012, Stefano Stabellini wrote:
> On Thu, 8 Nov 2012, Ian Campbell wrote:
> > On Thu, 2012-11-08 at 15:28 +0000, Arnd Bergmann wrote:
> > > On Tuesday 06 November 2012, Russell King - ARM Linux wrote:
> > > > My build system is giving me the following errors against an OMAP4
> > > > randconfig build against the latest Linus' kernel plus arm-soc:
> > > > 
> > > > ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> > > > make[2]: *** [__modpost] Error 1
> > > > make[2]: Target `_modpost' not remade because of errors.
> > > > make[1]: *** [modules] Error 2
> > > > make: *** [sub-make] Error 2
> > > > make: Target `uImage' not remade because of errors.
> > > > make: Target `modules' not remade because of errors.
> > > > 
> > > > Full build results and configuration are here:
> > > > 
> > > > http://www.arm.linux.org.uk/developer/build/result.php?type=build&idx=2627
> > > > http://www.arm.linux.org.uk/developer/build/file.php?type=config&idx=2627
> > > > 
> > > 
> > > I can reproduce the same thing with mainline v3.7-rc4.
> > > 8<------
> > > xen/arm: export privcmd_call
> > 
> > Thanks, Konrad posted a fix for this on Tuesday which covers a few other
> > cases too: http://marc.info/?l=linux-kernel&m=135224075902642&w=2 I
> > added Russell to my response but forgot to add l-a-k@ too, sorry.
> 
> Konrad, do you have time to respin a patch that exports all the 9
> hypercalls?
 
This is the patch that I had in mind:

---


From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

xen/arm: Fix compile errors when drivers are compiled as modules.

We end up with:

ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
ERROR: "HYPERVISOR_grant_table_op" [drivers/net/xen-netback/xen-netback.ko] undefined!

and this patch exports said function (which is implemented in hypercall.S).

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index 59bcb96..f576092 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -166,3 +166,14 @@ void free_xenballooned_pages(int nr_pages, struct page **pages)
 	*pages = NULL;
 }
 EXPORT_SYMBOL_GPL(free_xenballooned_pages);
+
+/* In the hypervisor.S file. */
+EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
+EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
+EXPORT_SYMBOL_GPL(HYPERVISOR_xen_version);
+EXPORT_SYMBOL_GPL(HYPERVISOR_console_io);
+EXPORT_SYMBOL_GPL(HYPERVISOR_sched_op);
+EXPORT_SYMBOL_GPL(HYPERVISOR_hvm_op);
+EXPORT_SYMBOL_GPL(HYPERVISOR_memory_op);
+EXPORT_SYMBOL_GPL(HYPERVISOR_physdev_op);
+EXPORT_SYMBOL_GPL(privcmd_call);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 15:59:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 15:59:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWUW9-0003LE-Lj; Thu, 08 Nov 2012 15:59:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TWUW8-0003L9-MO
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 15:59:44 +0000
Received: from [85.158.139.83:27681] by server-14.bemta-5.messagelabs.com id
	BB/B5-21768-FE6DB905; Thu, 08 Nov 2012 15:59:43 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1352390382!29389900!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODUwMTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25194 invoked from network); 8 Nov 2012 15:59:43 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 15:59:43 -0000
X-IronPort-AV: E=Sophos;i="4.80,738,1344211200"; d="scan'208";a="213895629"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	08 Nov 2012 15:59:41 +0000
Received: from kaball.uk.xensource.com (10.80.2.59) by
	FTLPEX01CL01.citrite.net (10.13.107.78) with Microsoft SMTP Server id
	14.2.318.1; Thu, 8 Nov 2012 10:59:41 -0500
Date: Thu, 8 Nov 2012 15:58:55 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
In-Reply-To: <alpine.DEB.2.02.1211081544510.2689@kaball.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211081554220.2689@kaball.uk.xensource.com>
References: <20121106175749.GO28327@n2100.arm.linux.org.uk>
	<201211081528.31968.arnd@arndb.de>
	<1352389245.12977.106.camel@hastur.hellion.org.uk>
	<alpine.DEB.2.02.1211081544510.2689@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
X-Originating-IP: [10.80.2.59]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Ian Campbell <Ian.Campbell@citrix.com>, Arnd Bergmann <arnd@arndb.de>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"arm@kernel.org" <arm@kernel.org>, "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Xen-devel] BUG: ARM build failures due to Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 8 Nov 2012, Stefano Stabellini wrote:
> On Thu, 8 Nov 2012, Ian Campbell wrote:
> > On Thu, 2012-11-08 at 15:28 +0000, Arnd Bergmann wrote:
> > > On Tuesday 06 November 2012, Russell King - ARM Linux wrote:
> > > > My build system is giving me the following errors against an OMAP4
> > > > randconfig build against the latest Linus' kernel plus arm-soc:
> > > > 
> > > > ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> > > > make[2]: *** [__modpost] Error 1
> > > > make[2]: Target `_modpost' not remade because of errors.
> > > > make[1]: *** [modules] Error 2
> > > > make: *** [sub-make] Error 2
> > > > make: Target `uImage' not remade because of errors.
> > > > make: Target `modules' not remade because of errors.
> > > > 
> > > > Full build results and configuration are here:
> > > > 
> > > > http://www.arm.linux.org.uk/developer/build/result.php?type=build&idx=2627
> > > > http://www.arm.linux.org.uk/developer/build/file.php?type=config&idx=2627
> > > > 
> > > 
> > > I can reproduce the same thing with mainline v3.7-rc4.
> > > 8<------
> > > xen/arm: export privcmd_call
> > 
> > Thanks, Konrad posted a fix for this on Tuesday which covers a few other
> > cases too: http://marc.info/?l=linux-kernel&m=135224075902642&w=2 I
> > added Russell to my response but forgot to add l-a-k@ too, sorry.
> 
> Konrad, do you have time to respin a patch that exports all the 9
> hypercalls?
 
This is the patch that I had in mind:

---


From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

xen/arm: Fix compile errors when drivers are compiled as modules.

We end up with:

ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
ERROR: "HYPERVISOR_grant_table_op" [drivers/net/xen-netback/xen-netback.ko] undefined!

and this patch exports said function (which is implemented in hypercall.S).

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index 59bcb96..f576092 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -166,3 +166,14 @@ void free_xenballooned_pages(int nr_pages, struct page **pages)
 	*pages = NULL;
 }
 EXPORT_SYMBOL_GPL(free_xenballooned_pages);
+
+/* In the hypervisor.S file. */
+EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
+EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
+EXPORT_SYMBOL_GPL(HYPERVISOR_xen_version);
+EXPORT_SYMBOL_GPL(HYPERVISOR_console_io);
+EXPORT_SYMBOL_GPL(HYPERVISOR_sched_op);
+EXPORT_SYMBOL_GPL(HYPERVISOR_hvm_op);
+EXPORT_SYMBOL_GPL(HYPERVISOR_memory_op);
+EXPORT_SYMBOL_GPL(HYPERVISOR_physdev_op);
+EXPORT_SYMBOL_GPL(privcmd_call);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 16:37:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 16:37:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWV6d-00046f-UA; Thu, 08 Nov 2012 16:37:27 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TWV6c-00046X-G9
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 16:37:26 +0000
Received: from [193.109.254.147:39811] by server-8.bemta-14.messagelabs.com id
	B8/F4-05026-5CFDB905; Thu, 08 Nov 2012 16:37:25 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352392642!3374022!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTc5Mjg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10829 invoked from network); 8 Nov 2012 16:37:23 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 16:37:23 -0000
X-IronPort-AV: E=Sophos;i="4.80,738,1344211200"; d="scan'208";a="15676463"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	08 Nov 2012 16:37:21 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 8 Nov 2012 16:37:21 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TWV4E-0007de-QL;
	Thu, 08 Nov 2012 16:34:58 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TWV4E-0004c3-KH;
	Thu, 08 Nov 2012 16:34:58 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14374-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 8 Nov 2012 16:34:58 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14374: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14374 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14374/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14373
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14373
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14373
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14373

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  92163b114076
baseline version:
 xen                  bd78e5630a5b

------------------------------------------------------------
People who touched revisions under test:
  "Huang2, Wei" <Wei.Huang2@amd.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=92163b114076
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 92163b114076
+ branch=xen-unstable
+ revision=92163b114076
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 92163b114076 ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 4 changes to 4 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 16:37:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 16:37:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWV6d-00046f-UA; Thu, 08 Nov 2012 16:37:27 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TWV6c-00046X-G9
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 16:37:26 +0000
Received: from [193.109.254.147:39811] by server-8.bemta-14.messagelabs.com id
	B8/F4-05026-5CFDB905; Thu, 08 Nov 2012 16:37:25 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352392642!3374022!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTc5Mjg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10829 invoked from network); 8 Nov 2012 16:37:23 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 16:37:23 -0000
X-IronPort-AV: E=Sophos;i="4.80,738,1344211200"; d="scan'208";a="15676463"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	08 Nov 2012 16:37:21 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 8 Nov 2012 16:37:21 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TWV4E-0007de-QL;
	Thu, 08 Nov 2012 16:34:58 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TWV4E-0004c3-KH;
	Thu, 08 Nov 2012 16:34:58 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14374-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 8 Nov 2012 16:34:58 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14374: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14374 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14374/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14373
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14373
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14373
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14373

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  92163b114076
baseline version:
 xen                  bd78e5630a5b

------------------------------------------------------------
People who touched revisions under test:
  "Huang2, Wei" <Wei.Huang2@amd.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=92163b114076
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 92163b114076
+ branch=xen-unstable
+ revision=92163b114076
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 92163b114076 ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 4 changes to 4 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 16:46:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 16:46:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWVF5-0004J6-0W; Thu, 08 Nov 2012 16:46:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TWVF2-0004J1-Ro
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 16:46:09 +0000
Received: from [85.158.137.99:17746] by server-13.bemta-3.messagelabs.com id
	AF/9B-24887-0D1EB905; Thu, 08 Nov 2012 16:46:08 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-12.tower-217.messagelabs.com!1352393167!15181233!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20242 invoked from network); 8 Nov 2012 16:46:07 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 16:46:07 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TWVEt-000Lax-V8; Thu, 08 Nov 2012 16:45:59 +0000
Date: Thu, 8 Nov 2012 16:45:59 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121108164559.GK76638@ocelot.phlegethon.org>
References: <1352294551.12977.61.camel@hastur.hellion.org.uk>
	<CCC04D8E.51A0E%keir@xen.org>
	<509B8BF802000078000A72A3@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509B8BF802000078000A72A3@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Philippe.Simonet@swisscom.com, Keir Fraser <keir@xen.org>,
	mrsanna1@gmail.com, xen-devel@lists.xen.org,
	599161@bugs.debian.org, Ian Campbell <ijc@hellion.org.uk>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
	50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 09:39 +0000 on 08 Nov (1352367592), Jan Beulich wrote:
> The plt_wrap < plt_now thing of course is entirely unexplainable
> to me too: Considering that plt_scale doesn't change at all post-
> boot, apart from memory corruption I could only see an memory
> access ordering problem to be the reason (platform_timer_stamp
> and/or stime_platform_stamp changing despite platform_timer_lock
> being held. So maybe taking a snapshot of all three static values
> involved in the calculation in __read_platform_stime() between
> acquiring the lock and the first call to __read_platform_stime(),
> and printing them together with the "live" values in a second
> printk() after the one your original patch added could rule that
> out.
>  
> But the box doesn't even seem to be NUMA (of course it also
> doesn't help that the log level was kept restricted - hint, hint,
> Philippe), not does there appear to be any S3 cycle or pCPU
> bring-up/-down in between...

S3 looks like it might be a culprit, since resume_platform_timer()
clobbers plt_stamp64 without taking the platform_timer_lock.  But both
the S3 resume code and the plt_overflow timer should only ever run on
CPU 0, so even that should be safe (unless continue_hypercall_on_cpu()
is broken...)

Definitely having loglvl=all would have helped here, to eliminate S3
from our enquiries.

> > I wonder whether the overflow handling should just be removed, or made
> > conditional on a command-line parameter, or on the 32-bit platform counter
> > being at least somewhat likely to overflow before a softirq occurs -- it
> > seems lots of systems are using 14MHz HPET, and that gives us a couple of
> > minutes for the plt_overflow softirq to do its work before overflow occurs.
> > I think we would notice that outage in other ways. :)
> 
> Iirc we added this for a good reason - to cover the, however
> unlikely, event of Xen running for very long without preemption.
> Presumably most of the cases got fixed meanwhile, and indeed
> a wraparound time on the order of minutes should make this
> superfluous, but as the case here shows that code did spot a
> severe anomaly (whatever that may turn out to be).

ISTR when this code went in we were dealing with a timer that had a
period of about 4 seconds (ACPI PMTIMER?).  It might well be OTT for the
HPET, but if there's something weird going on I'd like to track it down
while we have some sort of a handle on it.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 16:46:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 16:46:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWVF5-0004J6-0W; Thu, 08 Nov 2012 16:46:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TWVF2-0004J1-Ro
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 16:46:09 +0000
Received: from [85.158.137.99:17746] by server-13.bemta-3.messagelabs.com id
	AF/9B-24887-0D1EB905; Thu, 08 Nov 2012 16:46:08 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-12.tower-217.messagelabs.com!1352393167!15181233!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20242 invoked from network); 8 Nov 2012 16:46:07 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 16:46:07 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TWVEt-000Lax-V8; Thu, 08 Nov 2012 16:45:59 +0000
Date: Thu, 8 Nov 2012 16:45:59 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121108164559.GK76638@ocelot.phlegethon.org>
References: <1352294551.12977.61.camel@hastur.hellion.org.uk>
	<CCC04D8E.51A0E%keir@xen.org>
	<509B8BF802000078000A72A3@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <509B8BF802000078000A72A3@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Philippe.Simonet@swisscom.com, Keir Fraser <keir@xen.org>,
	mrsanna1@gmail.com, xen-devel@lists.xen.org,
	599161@bugs.debian.org, Ian Campbell <ijc@hellion.org.uk>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
	50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 09:39 +0000 on 08 Nov (1352367592), Jan Beulich wrote:
> The plt_wrap < plt_now thing of course is entirely unexplainable
> to me too: Considering that plt_scale doesn't change at all post-
> boot, apart from memory corruption I could only see an memory
> access ordering problem to be the reason (platform_timer_stamp
> and/or stime_platform_stamp changing despite platform_timer_lock
> being held. So maybe taking a snapshot of all three static values
> involved in the calculation in __read_platform_stime() between
> acquiring the lock and the first call to __read_platform_stime(),
> and printing them together with the "live" values in a second
> printk() after the one your original patch added could rule that
> out.
>  
> But the box doesn't even seem to be NUMA (of course it also
> doesn't help that the log level was kept restricted - hint, hint,
> Philippe), not does there appear to be any S3 cycle or pCPU
> bring-up/-down in between...

S3 looks like it might be a culprit, since resume_platform_timer()
clobbers plt_stamp64 without taking the platform_timer_lock.  But both
the S3 resume code and the plt_overflow timer should only ever run on
CPU 0, so even that should be safe (unless continue_hypercall_on_cpu()
is broken...)

Definitely having loglvl=all would have helped here, to eliminate S3
from our enquiries.

> > I wonder whether the overflow handling should just be removed, or made
> > conditional on a command-line parameter, or on the 32-bit platform counter
> > being at least somewhat likely to overflow before a softirq occurs -- it
> > seems lots of systems are using 14MHz HPET, and that gives us a couple of
> > minutes for the plt_overflow softirq to do its work before overflow occurs.
> > I think we would notice that outage in other ways. :)
> 
> Iirc we added this for a good reason - to cover the, however
> unlikely, event of Xen running for very long without preemption.
> Presumably most of the cases got fixed meanwhile, and indeed
> a wraparound time on the order of minutes should make this
> superfluous, but as the case here shows that code did spot a
> severe anomaly (whatever that may turn out to be).

ISTR when this code went in we were dealing with a timer that had a
period of about 4 seconds (ACPI PMTIMER?).  It might well be OTT for the
HPET, but if there's something weird going on I'd like to track it down
while we have some sort of a handle on it.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 16:48:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 16:48:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWVHC-0004Po-M7; Thu, 08 Nov 2012 16:48:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWVHB-0004Pi-P7
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 16:48:21 +0000
Received: from [85.158.143.35:58308] by server-1.bemta-4.messagelabs.com id
	84/40-27934-552EB905; Thu, 08 Nov 2012 16:48:21 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1352393299!11767195!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13188 invoked from network); 8 Nov 2012 16:48:20 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 16:48:20 -0000
Received: by mail-ee0-f45.google.com with SMTP id b47so2017501eek.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 08:48:19 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=ows6BPYPRXK5skyhDzuUTtG202/W5cpTUH/YSpswJ4M=;
	b=aqaoYJNC6pc/TrXvkkaPUS/iDtGMMEisyavzL4tRRxNH/9BDeEkPGQEGwqrSW5hlWW
	aFPRyUCj1pErLVe5cuhvKQk6Wwbb1JqmUtJ3D2A/+SQUnQj7y37CRubWyVzIzsLDXUaZ
	z7ZjQfd75hhHacT9e0E+T5L/XXnpoFoova7u9yNqbjWYEAaerMOp4p3mCxCNILxqPAxt
	8Ocgg+h3ZUWRqE/Ol2sUk70krW7BuXHHHJ/cpXCdHOTEysd+Yf2ImYxTg5L0n/dBS7Q7
	WLvlSFEG+iwU6CRrPArVYNEqGq5/fw9PAwVSN2IFrXWdIHZEUa/BE87nP2D9cucG0Fm/
	K88Q==
Received: by 10.14.194.72 with SMTP id l48mr29406521een.9.1352393299593;
	Thu, 08 Nov 2012 08:48:19 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id b44sm71245438eep.12.2012.11.08.08.48.17
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 08:48:18 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 16:48:13 +0000
From: Keir Fraser <keir@xen.org>
To: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
Message-ID: <CCC192CD.51BDD%keir@xen.org>
Thread-Topic: Wait Queues
Thread-Index: Ac290NeAq7isoAwBt0WGqsAc/EiPZQ==
In-Reply-To: <E9393B26-2796-47ED-8AC9-228CABEE86A2@gridcentric.ca>
Mime-version: 1.0
Cc: Tim Deegan <tim@xen.org>, Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Wait Queues
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 15:39, "Andres Lagar-Cavilla" <andreslc@gridcentric.ca> wrote:

>> dom0 vcpu=8A.
> Uhmm. But it seems there is _some_ method to the madness. Luckily mm lock=
s are
> all taken after the p2m lock (and enforced that way). dom0 can grab ... t=
he
> big domain lock? the grant table lock?
> =

> Perhaps we can categorize locks between reflexive or foreign (not that we=
 have
> abundant space in the spin lock struct to stash more flags) and perform s=
ome
> sort of enforcement like what goes on in the mm layer. Xen insults via
> BUG_ON's are a strong conditioning tool for developers. It is certainly
> simpler to tease out the locks that might deadlock dom0 than all possible
> locks, including RCU read-locks.
> =

> What I mean:
> =

> BUG_ON(current->domain !=3D d && lock_is_reflexive)
> An example of a reflexive lock is the per page sharing lock.
> =

> BUG_ON(prepare_to_wait && current->domain->holds_foreign_lock)
> An example of a transitive lock is the gran table lock.
> =

> A third category would entail global locks like the domain list, which are
> identical to a foreign lock wrt to this analysis.
> =

> Another benefit of this is that only reflexive locks need to be made
> sleep-capable, not everything under the sun. I.e. the possibility of live=
lock
> is corralled to apply only to vcpus of the same domain, and then it's avo=
ided
> by making those lock holders re-schedulable.

This sounds possible. RCU read locks will often count as global locks by the
way, as they are most often used as an alternative to taking a global
spinlock or multi-reader lock. So sleeping in RCU critical regions is
generally not going to be a good idea. Perhaps it will turn out that such
regions don't get in your way too often.

> Andres



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 16:48:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 16:48:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWVHC-0004Po-M7; Thu, 08 Nov 2012 16:48:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWVHB-0004Pi-P7
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 16:48:21 +0000
Received: from [85.158.143.35:58308] by server-1.bemta-4.messagelabs.com id
	84/40-27934-552EB905; Thu, 08 Nov 2012 16:48:21 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1352393299!11767195!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13188 invoked from network); 8 Nov 2012 16:48:20 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 16:48:20 -0000
Received: by mail-ee0-f45.google.com with SMTP id b47so2017501eek.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 08:48:19 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=ows6BPYPRXK5skyhDzuUTtG202/W5cpTUH/YSpswJ4M=;
	b=aqaoYJNC6pc/TrXvkkaPUS/iDtGMMEisyavzL4tRRxNH/9BDeEkPGQEGwqrSW5hlWW
	aFPRyUCj1pErLVe5cuhvKQk6Wwbb1JqmUtJ3D2A/+SQUnQj7y37CRubWyVzIzsLDXUaZ
	z7ZjQfd75hhHacT9e0E+T5L/XXnpoFoova7u9yNqbjWYEAaerMOp4p3mCxCNILxqPAxt
	8Ocgg+h3ZUWRqE/Ol2sUk70krW7BuXHHHJ/cpXCdHOTEysd+Yf2ImYxTg5L0n/dBS7Q7
	WLvlSFEG+iwU6CRrPArVYNEqGq5/fw9PAwVSN2IFrXWdIHZEUa/BE87nP2D9cucG0Fm/
	K88Q==
Received: by 10.14.194.72 with SMTP id l48mr29406521een.9.1352393299593;
	Thu, 08 Nov 2012 08:48:19 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id b44sm71245438eep.12.2012.11.08.08.48.17
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 08:48:18 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 16:48:13 +0000
From: Keir Fraser <keir@xen.org>
To: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
Message-ID: <CCC192CD.51BDD%keir@xen.org>
Thread-Topic: Wait Queues
Thread-Index: Ac290NeAq7isoAwBt0WGqsAc/EiPZQ==
In-Reply-To: <E9393B26-2796-47ED-8AC9-228CABEE86A2@gridcentric.ca>
Mime-version: 1.0
Cc: Tim Deegan <tim@xen.org>, Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Wait Queues
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 15:39, "Andres Lagar-Cavilla" <andreslc@gridcentric.ca> wrote:

>> dom0 vcpu=8A.
> Uhmm. But it seems there is _some_ method to the madness. Luckily mm lock=
s are
> all taken after the p2m lock (and enforced that way). dom0 can grab ... t=
he
> big domain lock? the grant table lock?
> =

> Perhaps we can categorize locks between reflexive or foreign (not that we=
 have
> abundant space in the spin lock struct to stash more flags) and perform s=
ome
> sort of enforcement like what goes on in the mm layer. Xen insults via
> BUG_ON's are a strong conditioning tool for developers. It is certainly
> simpler to tease out the locks that might deadlock dom0 than all possible
> locks, including RCU read-locks.
> =

> What I mean:
> =

> BUG_ON(current->domain !=3D d && lock_is_reflexive)
> An example of a reflexive lock is the per page sharing lock.
> =

> BUG_ON(prepare_to_wait && current->domain->holds_foreign_lock)
> An example of a transitive lock is the gran table lock.
> =

> A third category would entail global locks like the domain list, which are
> identical to a foreign lock wrt to this analysis.
> =

> Another benefit of this is that only reflexive locks need to be made
> sleep-capable, not everything under the sun. I.e. the possibility of live=
lock
> is corralled to apply only to vcpus of the same domain, and then it's avo=
ided
> by making those lock holders re-schedulable.

This sounds possible. RCU read locks will often count as global locks by the
way, as they are most often used as an alternative to taking a global
spinlock or multi-reader lock. So sleeping in RCU critical regions is
generally not going to be a good idea. Perhaps it will turn out that such
regions don't get in your way too often.

> Andres



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 16:52:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 16:52:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWVKs-0004c4-B8; Thu, 08 Nov 2012 16:52:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWVKq-0004bv-8n
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 16:52:08 +0000
Received: from [85.158.139.83:2335] by server-11.bemta-5.messagelabs.com id
	87/DB-03409-733EB905; Thu, 08 Nov 2012 16:52:07 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1352393526!29676213!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16038 invoked from network); 8 Nov 2012 16:52:06 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-10.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 16:52:06 -0000
Received: by mail-wi0-f173.google.com with SMTP id cb5so2310895wib.14
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 08:52:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=DuB1Q76adv6CWCS8gID2uqsbN8OdprZ7kp3sRTLjdEE=;
	b=DmHelnTTeN6fdljT7lGDkeOuk18XwMpJbpe1EeiscT1YodhES8ZvBNaIxp3dm9pB2h
	L9mL6y00XaRzpUYWGnKF4WvnkeqMtRiP+VPJF2Pbhy1kjifL+gKomGvrYcnnzw4YbjSM
	bnoLaMlUKnXuhFCwWJBgIk7OZOO9BBZBgbiOu9gDR+o50M9PjsyGWj9wVdCWbh8bz1N/
	sU+IjhaMW723EKj1hUpZ3B8GsUe3X1zJ5MHmTO0014DoqqZ12XeEKCP+QFx9vx2byZAZ
	sUqRnmjMIJ/PDSnaHwECTTOBCWar17ODTO/WsKRXnbfyR0nfScX4XL6lz4U+h9/QDeqk
	Q9Tw==
Received: by 10.181.11.233 with SMTP id el9mr14484089wid.3.1352393526626;
	Thu, 08 Nov 2012 08:52:06 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id gk9sm7845232wib.4.2012.11.08.08.52.05
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 08:52:06 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 16:52:00 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <CCC193B0.51BE7%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH 2/2] x86/x2apic: properly implement cluster
	mode
Thread-Index: Ac290V7Od5EmuJeaTEKGw1qhthRb6g==
In-Reply-To: <509BDFFC02000078000A7499@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] x86/x2apic: properly implement cluster
 mode
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 15:38, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 08.11.12 at 16:17, Keir Fraser <keir@xen.org> wrote:
>> On 08/11/2012 15:03, "Jan Beulich" <JBeulich@suse.com> wrote:
>> 
>>> So far, cluster mode was just an alternative implementation of
>>> physical mode: Allowing only single CPU interrupt targets, and sending
>>> IPIs to each target CPU separately. Take advantage of what cluster
>>> mode really can do in that regard.
>> 
>> What does it allow? Multicast within certain constraints?
> 
> For IPIs, yes. For interrupts, this gets things merely in line with
> cluster mode APIC, specifying more than one destination with
> lowest priority delivery. Without actively using the TPR, that
> should only affect nested interrupts (which previously would
> have got deferred until the outer one finished if their vector
> was a lower priority one than the one in service, whereas now
> they could get serviced by another CPU within the cluster).
>
> I also should have pointed out that this has a potential drawback
> - it might increase the pressure on vector allocation, since
> they're now being shared more heavily (within clusters). But if
> someone runs into problems with that, they ought to simply
> switch to physical mode (which previously really had no practical
> use at all).
> 
>> I know it's not
>> part of our coding style, but some comments would be nice. ;)
> 
> Hard to tell what specifically you would want to see commented,
> given that this really just extends the originally rather simplistic
> implementation.

Okay, yes, it doesn't look so complicated re-reading it again. I'm fine with
it as it is.

 -- Keir

> Jan
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 16:52:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 16:52:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWVKs-0004c4-B8; Thu, 08 Nov 2012 16:52:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWVKq-0004bv-8n
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 16:52:08 +0000
Received: from [85.158.139.83:2335] by server-11.bemta-5.messagelabs.com id
	87/DB-03409-733EB905; Thu, 08 Nov 2012 16:52:07 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1352393526!29676213!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16038 invoked from network); 8 Nov 2012 16:52:06 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-10.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 16:52:06 -0000
Received: by mail-wi0-f173.google.com with SMTP id cb5so2310895wib.14
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 08:52:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=DuB1Q76adv6CWCS8gID2uqsbN8OdprZ7kp3sRTLjdEE=;
	b=DmHelnTTeN6fdljT7lGDkeOuk18XwMpJbpe1EeiscT1YodhES8ZvBNaIxp3dm9pB2h
	L9mL6y00XaRzpUYWGnKF4WvnkeqMtRiP+VPJF2Pbhy1kjifL+gKomGvrYcnnzw4YbjSM
	bnoLaMlUKnXuhFCwWJBgIk7OZOO9BBZBgbiOu9gDR+o50M9PjsyGWj9wVdCWbh8bz1N/
	sU+IjhaMW723EKj1hUpZ3B8GsUe3X1zJ5MHmTO0014DoqqZ12XeEKCP+QFx9vx2byZAZ
	sUqRnmjMIJ/PDSnaHwECTTOBCWar17ODTO/WsKRXnbfyR0nfScX4XL6lz4U+h9/QDeqk
	Q9Tw==
Received: by 10.181.11.233 with SMTP id el9mr14484089wid.3.1352393526626;
	Thu, 08 Nov 2012 08:52:06 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id gk9sm7845232wib.4.2012.11.08.08.52.05
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 08:52:06 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 16:52:00 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <CCC193B0.51BE7%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH 2/2] x86/x2apic: properly implement cluster
	mode
Thread-Index: Ac290V7Od5EmuJeaTEKGw1qhthRb6g==
In-Reply-To: <509BDFFC02000078000A7499@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] x86/x2apic: properly implement cluster
 mode
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 15:38, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 08.11.12 at 16:17, Keir Fraser <keir@xen.org> wrote:
>> On 08/11/2012 15:03, "Jan Beulich" <JBeulich@suse.com> wrote:
>> 
>>> So far, cluster mode was just an alternative implementation of
>>> physical mode: Allowing only single CPU interrupt targets, and sending
>>> IPIs to each target CPU separately. Take advantage of what cluster
>>> mode really can do in that regard.
>> 
>> What does it allow? Multicast within certain constraints?
> 
> For IPIs, yes. For interrupts, this gets things merely in line with
> cluster mode APIC, specifying more than one destination with
> lowest priority delivery. Without actively using the TPR, that
> should only affect nested interrupts (which previously would
> have got deferred until the outer one finished if their vector
> was a lower priority one than the one in service, whereas now
> they could get serviced by another CPU within the cluster).
>
> I also should have pointed out that this has a potential drawback
> - it might increase the pressure on vector allocation, since
> they're now being shared more heavily (within clusters). But if
> someone runs into problems with that, they ought to simply
> switch to physical mode (which previously really had no practical
> use at all).
> 
>> I know it's not
>> part of our coding style, but some comments would be nice. ;)
> 
> Hard to tell what specifically you would want to see commented,
> given that this really just extends the originally rather simplistic
> implementation.

Okay, yes, it doesn't look so complicated re-reading it again. I'm fine with
it as it is.

 -- Keir

> Jan
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 16:53:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 16:53:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWVMK-0004hz-Qy; Thu, 08 Nov 2012 16:53:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWVMJ-0004hp-Cb
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 16:53:39 +0000
Received: from [85.158.143.99:11181] by server-2.bemta-4.messagelabs.com id
	E9/5E-28922-293EB905; Thu, 08 Nov 2012 16:53:38 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1352393617!23863472!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2639 invoked from network); 8 Nov 2012 16:53:38 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 16:53:38 -0000
Received: by mail-ee0-f45.google.com with SMTP id b47so2021502eek.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 08:53:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=hHXLDEC0HG7pKLCZiUfLfatos+xcBrR84vZytFL+sFo=;
	b=lVC1btvsZzyrjriK4eXxlhVu+QZ7LhVA2eCI8k8SFiGDYvImjOKo+UXc0unfvxRMTy
	LeTDI0FM9n5e7cYkKeIXeFp4uKyz4PAiTBwT+1JSI9CWLqdtWLRAz62tFdtl7xaG7T5p
	VSJ8eMLfkx6b8kSx2dumKLx1Gs2rAJtq+/clopyC7YkeD1gqbPwQLo5JtFplRUxsIC4H
	BvPM/rrUILC4VcwK+cuhEmZBHlTANBGcoMhNEIouAgoqDsot6Es6dRfLfWWQwiaWJcsP
	6wbntoJwaZbE7ftSSOt+olwr7h2YSYFmDBoepRpe1mdjYCWUILavliiSPnA8KNXCdRIx
	9Gnw==
Received: by 10.14.219.2 with SMTP id l2mr29586547eep.3.1352393617858;
	Thu, 08 Nov 2012 08:53:37 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id z43sm71300663een.16.2012.11.08.08.53.35
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 08:53:37 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 16:53:29 +0000
From: Keir Fraser <keir@xen.org>
To: Tim Deegan <tim@xen.org>,
	Jan Beulich <JBeulich@suse.com>
Message-ID: <CCC19409.51BE9%keir@xen.org>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
	minutes" bug.
Thread-Index: Ac290ZPaz6yRridHVUypoEk2TUkfPQ==
In-Reply-To: <20121108164559.GK76638@ocelot.phlegethon.org>
Mime-version: 1.0
Cc: Ian Campbell <ijc@hellion.org.uk>, Philippe.Simonet@swisscom.com,
	599161@bugs.debian.org, mrsanna1@gmail.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 16:45, "Tim Deegan" <tim@xen.org> wrote:

>>> I wonder whether the overflow handling should just be removed, or made
>>> conditional on a command-line parameter, or on the 32-bit platform counter
>>> being at least somewhat likely to overflow before a softirq occurs -- it
>>> seems lots of systems are using 14MHz HPET, and that gives us a couple of
>>> minutes for the plt_overflow softirq to do its work before overflow occurs.
>>> I think we would notice that outage in other ways. :)
>> 
>> Iirc we added this for a good reason - to cover the, however
>> unlikely, event of Xen running for very long without preemption.
>> Presumably most of the cases got fixed meanwhile, and indeed
>> a wraparound time on the order of minutes should make this
>> superfluous, but as the case here shows that code did spot a
>> severe anomaly (whatever that may turn out to be).
> 
> ISTR when this code went in we were dealing with a timer that had a
> period of about 4 seconds (ACPI PMTIMER?).  It might well be OTT for the
> HPET, but if there's something weird going on I'd like to track it down
> while we have some sort of a handle on it.

It must have been the PMTIMER. It's the only counter narrower than 32 bits
(legacy PIT we simulate as a 32-bit counter behind the scenes).

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 16:53:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 16:53:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWVMK-0004hz-Qy; Thu, 08 Nov 2012 16:53:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWVMJ-0004hp-Cb
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 16:53:39 +0000
Received: from [85.158.143.99:11181] by server-2.bemta-4.messagelabs.com id
	E9/5E-28922-293EB905; Thu, 08 Nov 2012 16:53:38 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1352393617!23863472!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2639 invoked from network); 8 Nov 2012 16:53:38 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 16:53:38 -0000
Received: by mail-ee0-f45.google.com with SMTP id b47so2021502eek.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 08:53:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=hHXLDEC0HG7pKLCZiUfLfatos+xcBrR84vZytFL+sFo=;
	b=lVC1btvsZzyrjriK4eXxlhVu+QZ7LhVA2eCI8k8SFiGDYvImjOKo+UXc0unfvxRMTy
	LeTDI0FM9n5e7cYkKeIXeFp4uKyz4PAiTBwT+1JSI9CWLqdtWLRAz62tFdtl7xaG7T5p
	VSJ8eMLfkx6b8kSx2dumKLx1Gs2rAJtq+/clopyC7YkeD1gqbPwQLo5JtFplRUxsIC4H
	BvPM/rrUILC4VcwK+cuhEmZBHlTANBGcoMhNEIouAgoqDsot6Es6dRfLfWWQwiaWJcsP
	6wbntoJwaZbE7ftSSOt+olwr7h2YSYFmDBoepRpe1mdjYCWUILavliiSPnA8KNXCdRIx
	9Gnw==
Received: by 10.14.219.2 with SMTP id l2mr29586547eep.3.1352393617858;
	Thu, 08 Nov 2012 08:53:37 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id z43sm71300663een.16.2012.11.08.08.53.35
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 08:53:37 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 16:53:29 +0000
From: Keir Fraser <keir@xen.org>
To: Tim Deegan <tim@xen.org>,
	Jan Beulich <JBeulich@suse.com>
Message-ID: <CCC19409.51BE9%keir@xen.org>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
	minutes" bug.
Thread-Index: Ac290ZPaz6yRridHVUypoEk2TUkfPQ==
In-Reply-To: <20121108164559.GK76638@ocelot.phlegethon.org>
Mime-version: 1.0
Cc: Ian Campbell <ijc@hellion.org.uk>, Philippe.Simonet@swisscom.com,
	599161@bugs.debian.org, mrsanna1@gmail.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 16:45, "Tim Deegan" <tim@xen.org> wrote:

>>> I wonder whether the overflow handling should just be removed, or made
>>> conditional on a command-line parameter, or on the 32-bit platform counter
>>> being at least somewhat likely to overflow before a softirq occurs -- it
>>> seems lots of systems are using 14MHz HPET, and that gives us a couple of
>>> minutes for the plt_overflow softirq to do its work before overflow occurs.
>>> I think we would notice that outage in other ways. :)
>> 
>> Iirc we added this for a good reason - to cover the, however
>> unlikely, event of Xen running for very long without preemption.
>> Presumably most of the cases got fixed meanwhile, and indeed
>> a wraparound time on the order of minutes should make this
>> superfluous, but as the case here shows that code did spot a
>> severe anomaly (whatever that may turn out to be).
> 
> ISTR when this code went in we were dealing with a timer that had a
> period of about 4 seconds (ACPI PMTIMER?).  It might well be OTT for the
> HPET, but if there's something weird going on I'd like to track it down
> while we have some sort of a handle on it.

It must have been the PMTIMER. It's the only counter narrower than 32 bits
(legacy PIT we simulate as a 32-bit counter behind the scenes).

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 18:08:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 18:08:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWWWE-0005e3-Eq; Thu, 08 Nov 2012 18:07:58 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dario.faggioli@citrix.com>) id 1TWWWC-0005dy-9F
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 18:07:56 +0000
Received: from [193.109.254.147:25554] by server-13.bemta-14.messagelabs.com
	id FF/64-11239-BF4FB905; Thu, 08 Nov 2012 18:07:55 +0000
X-Env-Sender: dario.faggioli@citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1352398074!3406262!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTc5Mjg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6038 invoked from network); 8 Nov 2012 18:07:54 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-10.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 18:07:54 -0000
X-IronPort-AV: E=Sophos;i="4.80,739,1344211200"; 
	d="asc'?scan'208";a="15679966"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	08 Nov 2012 18:07:54 +0000
Received: from [IPv6:::1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Thu, 8 Nov 2012
	18:07:53 +0000
Message-ID: <1352398064.2774.2.camel@Abyss>
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Thu, 8 Nov 2012 19:07:44 +0100
In-Reply-To: <509A94F002000078000A702A@nat28.tlf.novell.com>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<509A94F002000078000A702A@nat28.tlf.novell.com>
X-Mailer: Evolution 3.2.3 (3.2.3-3.fc16) 
MIME-Version: 1.0
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com, Tim Deegan <tim@xen.org>,
	xen-devel <xen-devel@lists.xen.org>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH,
 v2] IOMMU: don't immediately disable bus mastering on faults
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7804927638820429400=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============7804927638820429400==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="=-dZa8fWBeDh+BdeSZH1gv"

--=-dZa8fWBeDh+BdeSZH1gv
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, 2012-11-07 at 16:05 +0000, Jan Beulich wrote:=20
> Instead, give the owning domain at least a small opportunity of fixing
> things up, and allow for rare faults to not bring down the device at
> all. The amount of faults tolerated within a given time period (all
> numbers are made up with no specific rationale) is higher for Dom0 than
> for DomU-s.
>=20
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>=20
(For what it's worth)

Acked-by: Dario Faggioli <dario.faggioli@citrix.com>

I don't really have a strong opinion about Dom0 and Xen needing special
treatment or not, so the above applies to whatever solution you decide
to go for. :-)

Thanks and Regards,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)



--=-dZa8fWBeDh+BdeSZH1gv
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCb9PAACgkQk4XaBE3IOsTLSACcDJDPIGGWZ2NJ38p9FXuUppiX
bLEAnjMDeWEP7cISAsFxTc1L8oJdFuZV
=TGud
-----END PGP SIGNATURE-----

--=-dZa8fWBeDh+BdeSZH1gv--


--===============7804927638820429400==
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.xen.org
http://lists.xen.org/xen-devel

--===============7804927638820429400==--


From xen-devel-bounces@lists.xen.org Thu Nov 08 18:08:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 18:08:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWWWE-0005e3-Eq; Thu, 08 Nov 2012 18:07:58 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dario.faggioli@citrix.com>) id 1TWWWC-0005dy-9F
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 18:07:56 +0000
Received: from [193.109.254.147:25554] by server-13.bemta-14.messagelabs.com
	id FF/64-11239-BF4FB905; Thu, 08 Nov 2012 18:07:55 +0000
X-Env-Sender: dario.faggioli@citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1352398074!3406262!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTc5Mjg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6038 invoked from network); 8 Nov 2012 18:07:54 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-10.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 18:07:54 -0000
X-IronPort-AV: E=Sophos;i="4.80,739,1344211200"; 
	d="asc'?scan'208";a="15679966"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	08 Nov 2012 18:07:54 +0000
Received: from [IPv6:::1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Thu, 8 Nov 2012
	18:07:53 +0000
Message-ID: <1352398064.2774.2.camel@Abyss>
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Thu, 8 Nov 2012 19:07:44 +0100
In-Reply-To: <509A94F002000078000A702A@nat28.tlf.novell.com>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCBDA4AE.51026%keir@xen.org>
	<5098E19D02000078000A697A@nat28.tlf.novell.com>
	<20121106094456.GA45690@ocelot.phlegethon.org>
	<509A94F002000078000A702A@nat28.tlf.novell.com>
X-Mailer: Evolution 3.2.3 (3.2.3-3.fc16) 
MIME-Version: 1.0
Cc: Keir Fraser <keir@xen.org>, wei.huang2@amd.com, Tim Deegan <tim@xen.org>,
	xen-devel <xen-devel@lists.xen.org>, weiwang.dd@gmail.com,
	xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH,
 v2] IOMMU: don't immediately disable bus mastering on faults
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7804927638820429400=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============7804927638820429400==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="=-dZa8fWBeDh+BdeSZH1gv"

--=-dZa8fWBeDh+BdeSZH1gv
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, 2012-11-07 at 16:05 +0000, Jan Beulich wrote:=20
> Instead, give the owning domain at least a small opportunity of fixing
> things up, and allow for rare faults to not bring down the device at
> all. The amount of faults tolerated within a given time period (all
> numbers are made up with no specific rationale) is higher for Dom0 than
> for DomU-s.
>=20
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>=20
(For what it's worth)

Acked-by: Dario Faggioli <dario.faggioli@citrix.com>

I don't really have a strong opinion about Dom0 and Xen needing special
treatment or not, so the above applies to whatever solution you decide
to go for. :-)

Thanks and Regards,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)



--=-dZa8fWBeDh+BdeSZH1gv
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCb9PAACgkQk4XaBE3IOsTLSACcDJDPIGGWZ2NJ38p9FXuUppiX
bLEAnjMDeWEP7cISAsFxTc1L8oJdFuZV
=TGud
-----END PGP SIGNATURE-----

--=-dZa8fWBeDh+BdeSZH1gv--


--===============7804927638820429400==
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.xen.org
http://lists.xen.org/xen-devel

--===============7804927638820429400==--


From xen-devel-bounces@lists.xen.org Thu Nov 08 18:39:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 18:39:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWX08-0006Jb-Gd; Thu, 08 Nov 2012 18:38:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TWX07-0006JS-IW
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 18:38:51 +0000
Received: from [85.158.139.83:51504] by server-4.bemta-5.messagelabs.com id
	29/D5-15011-A3CFB905; Thu, 08 Nov 2012 18:38:50 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1352399928!25136154!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMzY2NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 730 invoked from network); 8 Nov 2012 18:38:50 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-14.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 18:38:50 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA8IcUh7019576
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 8 Nov 2012 18:38:31 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA8IcQao028894
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 8 Nov 2012 18:38:27 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA8IcPB8024013; Thu, 8 Nov 2012 12:38:25 -0600
MIME-Version: 1.0
Message-ID: <092d8bc5-1643-40e0-a893-3e7ad78fe672@default>
Date: Thu, 8 Nov 2012 10:38:22 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<509791F902000078000A64D4@nat28.tlf.novell.com>
	<7563be37-62f1-472e-9aec-1d0c55fa7c29@default>
	<509B74B402000078000A7206@nat28.tlf.novell.com>
In-Reply-To: <509B74B402000078000A7206@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	Keir Fraser <keir@xen.org>, IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Subject: RE: Proposed new "memory capacity claim" hypercall/feature
> 
> >>> On 07.11.12 at 23:17, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> > It appears that the attempt to use 2MB and 1GB pages is done in
> > the toolstack, and if the hypervisor rejects it, toolstack tries
> > smaller pages.  Thus, if physical memory is highly fragmented
> > (few or no order>=9 allocations available), this will result
> > in one hypercall per 4k page so a 256GB domain would require
> > 64 million hypercalls.  And, since AFAICT, there is no sane
> > way to hold the heap_lock across even two hypercalls, speeding
> > up the in-hypervisor allocation path, by itself, will not solve
> > the TOCTOU race.
> 
> No, even in the absence of large pages, the tool stack will do 8M
> allocations, just without requesting them to be contiguous.

Rats, you are right (as usual).  My debug code was poorly
placed and missed this important point.

So ignore the huge-number-of-hypercalls point and I think we
return to:  What is an upper time bound for holding the heap_lock
and, for an arbitrary-sized domain in an arbitrarily-fragmented
system, can the page allocation code be made fast enough to
fit within that bound?

I am in agreement that if the page allocation code can be
fast enough so that the heap_lock can be held, this is a better
solution than "claim".  I am just skeptical that, in
the presence of those two "arbitraries", it is possible.

So I will proceed with more measurements before prototyping
the "claim" stuff.

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 18:39:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 18:39:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWX08-0006Jb-Gd; Thu, 08 Nov 2012 18:38:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TWX07-0006JS-IW
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 18:38:51 +0000
Received: from [85.158.139.83:51504] by server-4.bemta-5.messagelabs.com id
	29/D5-15011-A3CFB905; Thu, 08 Nov 2012 18:38:50 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1352399928!25136154!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMzY2NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 730 invoked from network); 8 Nov 2012 18:38:50 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-14.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 18:38:50 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA8IcUh7019576
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 8 Nov 2012 18:38:31 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA8IcQao028894
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 8 Nov 2012 18:38:27 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA8IcPB8024013; Thu, 8 Nov 2012 12:38:25 -0600
MIME-Version: 1.0
Message-ID: <092d8bc5-1643-40e0-a893-3e7ad78fe672@default>
Date: Thu, 8 Nov 2012 10:38:22 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <50939A1502000078000A5F61@nat28.tlf.novell.com>
	<CCB94326.50E8F%keir@xen.org>
	<7481128d-3f65-4cc3-ad96-1d4e9cd25094@default>
	<509791F902000078000A64D4@nat28.tlf.novell.com>
	<7563be37-62f1-472e-9aec-1d0c55fa7c29@default>
	<509B74B402000078000A7206@nat28.tlf.novell.com>
In-Reply-To: <509B74B402000078000A7206@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	Keir Fraser <keir@xen.org>, IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Subject: RE: Proposed new "memory capacity claim" hypercall/feature
> 
> >>> On 07.11.12 at 23:17, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> > It appears that the attempt to use 2MB and 1GB pages is done in
> > the toolstack, and if the hypervisor rejects it, toolstack tries
> > smaller pages.  Thus, if physical memory is highly fragmented
> > (few or no order>=9 allocations available), this will result
> > in one hypercall per 4k page so a 256GB domain would require
> > 64 million hypercalls.  And, since AFAICT, there is no sane
> > way to hold the heap_lock across even two hypercalls, speeding
> > up the in-hypervisor allocation path, by itself, will not solve
> > the TOCTOU race.
> 
> No, even in the absence of large pages, the tool stack will do 8M
> allocations, just without requesting them to be contiguous.

Rats, you are right (as usual).  My debug code was poorly
placed and missed this important point.

So ignore the huge-number-of-hypercalls point and I think we
return to:  What is an upper time bound for holding the heap_lock
and, for an arbitrary-sized domain in an arbitrarily-fragmented
system, can the page allocation code be made fast enough to
fit within that bound?

I am in agreement that if the page allocation code can be
fast enough so that the heap_lock can be held, this is a better
solution than "claim".  I am just skeptical that, in
the presence of those two "arbitraries", it is possible.

So I will proceed with more measurements before prototyping
the "claim" stuff.

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 18:55:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 18:55:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWXGA-0006jC-5x; Thu, 08 Nov 2012 18:55:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TWXG9-0006j7-2t
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 18:55:25 +0000
Received: from [193.109.254.147:42477] by server-7.bemta-14.messagelabs.com id
	1C/8E-02272-C100C905; Thu, 08 Nov 2012 18:55:24 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352400920!2298430!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0OTE5OQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19526 invoked from network); 8 Nov 2012 18:55:22 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-15.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 8 Nov 2012 18:55:22 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA8Isab4017800
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 8 Nov 2012 18:54:37 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA8IsYGf007235
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 8 Nov 2012 18:54:34 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA8IsXBk000397; Thu, 8 Nov 2012 12:54:33 -0600
Received: from [100.255.247.59] (/208.54.36.154)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 08 Nov 2012 10:54:32 -0800
Date: Thu, 08 Nov 2012 13:54:29 -0500
Message-ID: <45w72guvowhjpvkrxs7vomxj.1352400869190@email.android.com>
From: konrad <konrad.wilk@oracle.com>
To: Ian Campbell <ian.campbell@citrix.com>
MIME-Version: 1.0
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "xen-devel@lists.xensource.com	" <xen-devel@lists.xensource.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Arnd Bergmann <arnd@arndb.de>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>, arm@kernel.org,
	"linux-arm-kernel@lists.infradead.org	"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Xen-devel] BUG: ARM build failures due to Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Sorry about top posting - on the phone. I will send to Linus tomorrow.

Ian Campbell <ian.campbell@citrix.com> wrote:

>On Thu, 2012-11-08 at 15:28 +0000, Arnd Bergmann wrote:
>> On Tuesday 06 November 2012, Russell King - ARM Linux wrote:
>> > My build system is giving me the following errors against an OMAP4
>> > randconfig build against the latest Linus' kernel plus arm-soc:
>> > 
>> > ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
>> > make[2]: *** [__modpost] Error 1
>> > make[2]: Target `_modpost' not remade because of errors.
>> > make[1]: *** [modules] Error 2
>> > make: *** [sub-make] Error 2
>> > make: Target `uImage' not remade because of errors.
>> > make: Target `modules' not remade because of errors.
>> > 
>> > Full build results and configuration are here:
>> > 
>> > http://www.arm.linux.org.uk/developer/build/result.php?type=build&idx=2627
>> > http://www.arm.linux.org.uk/developer/build/file.php?type=config&idx=2627
>> > 
>> 
>> I can reproduce the same thing with mainline v3.7-rc4.
>> 8<------
>> xen/arm: export privcmd_call
>
>Thanks, Konrad posted a fix for this on Tuesday which covers a few other
>cases too: http://marc.info/?l=linux-kernel&m=135224075902642&w=2 I
>added Russell to my response but forgot to add l-a-k@ too, sorry.
>
>Is one of you going to pick it up and send to mainline?
>
>Ian.
>
>> privcmd_call may get called from a module, so it has to be exported.
>> 
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> 
>> diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
>> index 59bcb96..ff5e300 100644
>> --- a/arch/arm/xen/enlighten.c
>> +++ b/arch/arm/xen/enlighten.c
>> @@ -17,6 +17,9 @@
>>  #include <linux/of_irq.h>
>>  #include <linux/of_address.h>
>>  
>> +/* from hypercall.S */
>> +EXPORT_SYMBOL_GPL(privcmd_call);
>> +
>>  struct start_info _xen_start_info;
>>  struct start_info *xen_start_info = &_xen_start_info;
>>  EXPORT_SYMBOL_GPL(xen_start_info);
>> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 18:55:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 18:55:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWXGA-0006jC-5x; Thu, 08 Nov 2012 18:55:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TWXG9-0006j7-2t
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 18:55:25 +0000
Received: from [193.109.254.147:42477] by server-7.bemta-14.messagelabs.com id
	1C/8E-02272-C100C905; Thu, 08 Nov 2012 18:55:24 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352400920!2298430!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA0OTE5OQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19526 invoked from network); 8 Nov 2012 18:55:22 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-15.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 8 Nov 2012 18:55:22 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA8Isab4017800
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 8 Nov 2012 18:54:37 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA8IsYGf007235
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 8 Nov 2012 18:54:34 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA8IsXBk000397; Thu, 8 Nov 2012 12:54:33 -0600
Received: from [100.255.247.59] (/208.54.36.154)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 08 Nov 2012 10:54:32 -0800
Date: Thu, 08 Nov 2012 13:54:29 -0500
Message-ID: <45w72guvowhjpvkrxs7vomxj.1352400869190@email.android.com>
From: konrad <konrad.wilk@oracle.com>
To: Ian Campbell <ian.campbell@citrix.com>
MIME-Version: 1.0
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "xen-devel@lists.xensource.com	" <xen-devel@lists.xensource.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Arnd Bergmann <arnd@arndb.de>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>, arm@kernel.org,
	"linux-arm-kernel@lists.infradead.org	"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Xen-devel] BUG: ARM build failures due to Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Sorry about top posting - on the phone. I will send to Linus tomorrow.

Ian Campbell <ian.campbell@citrix.com> wrote:

>On Thu, 2012-11-08 at 15:28 +0000, Arnd Bergmann wrote:
>> On Tuesday 06 November 2012, Russell King - ARM Linux wrote:
>> > My build system is giving me the following errors against an OMAP4
>> > randconfig build against the latest Linus' kernel plus arm-soc:
>> > 
>> > ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
>> > make[2]: *** [__modpost] Error 1
>> > make[2]: Target `_modpost' not remade because of errors.
>> > make[1]: *** [modules] Error 2
>> > make: *** [sub-make] Error 2
>> > make: Target `uImage' not remade because of errors.
>> > make: Target `modules' not remade because of errors.
>> > 
>> > Full build results and configuration are here:
>> > 
>> > http://www.arm.linux.org.uk/developer/build/result.php?type=build&idx=2627
>> > http://www.arm.linux.org.uk/developer/build/file.php?type=config&idx=2627
>> > 
>> 
>> I can reproduce the same thing with mainline v3.7-rc4.
>> 8<------
>> xen/arm: export privcmd_call
>
>Thanks, Konrad posted a fix for this on Tuesday which covers a few other
>cases too: http://marc.info/?l=linux-kernel&m=135224075902642&w=2 I
>added Russell to my response but forgot to add l-a-k@ too, sorry.
>
>Is one of you going to pick it up and send to mainline?
>
>Ian.
>
>> privcmd_call may get called from a module, so it has to be exported.
>> 
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> 
>> diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
>> index 59bcb96..ff5e300 100644
>> --- a/arch/arm/xen/enlighten.c
>> +++ b/arch/arm/xen/enlighten.c
>> @@ -17,6 +17,9 @@
>>  #include <linux/of_irq.h>
>>  #include <linux/of_address.h>
>>  
>> +/* from hypercall.S */
>> +EXPORT_SYMBOL_GPL(privcmd_call);
>> +
>>  struct start_info _xen_start_info;
>>  struct start_info *xen_start_info = &_xen_start_info;
>>  EXPORT_SYMBOL_GPL(xen_start_info);
>> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 19:17:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 19:17:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWXax-00071Z-BE; Thu, 08 Nov 2012 19:16:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TWXav-00071R-Kf
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 19:16:53 +0000
Received: from [85.158.139.211:54114] by server-14.bemta-5.messagelabs.com id
	84/3A-21768-4250C905; Thu, 08 Nov 2012 19:16:52 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1352402210!19433465!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMzY2NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32639 invoked from network); 8 Nov 2012 19:16:52 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-3.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 8 Nov 2012 19:16:52 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA8JGeBQ026877
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 8 Nov 2012 19:16:41 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA8JGdtI029015
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 8 Nov 2012 19:16:39 GMT
Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA8JGbfn019900; Thu, 8 Nov 2012 13:16:38 -0600
MIME-Version: 1.0
Message-ID: <563639fd-fc13-49cd-88cf-431244534c2f@default>
Date: Thu, 8 Nov 2012 11:16:34 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>
References: <509B8DC102000078000A72BA@nat28.tlf.novell.com>
	<CCC13EDB.51B6E%keir@xen.org>
	<509BC65402000078000A73A4@nat28.tlf.novell.com>
In-Reply-To: <509BC65402000078000A73A4@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Thursday, November 08, 2012 6:49 AM
> To: Keir Fraser
> Cc: Olaf Hering; IanCampbell; George Dunlap; Ian Jackson; George Shuklin; DarioFaggioli; xen-
> devel@lists.xen.org; Dan Magenheimer; Konrad Rzeszutek Wilk; Kurt Hackel; Mukesh Rathor; Zhigang Wang;
> TimDeegan
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> 
> >>> On 08.11.12 at 11:50, Keir Fraser <keir@xen.org> wrote:
> > On 08/11/2012 09:47, "Jan Beulich" <JBeulich@suse.com> wrote:
> >> The only thing that indeed is - on non-preemptible kernels - done
> >> only on exit to user mode is the eventual entering of the scheduler.
> >
> > That alone may still be an argument for restricting the batch size from the
> > toolstack?
> 
> Yes, this clearly prohibits unlimited batches. But not being able to
> schedule should be less restrictive than not being able to run
> softirqs, so I'd still put under question whether the limit shouldn't
> be bumped.

Wait, please define unlimited.

I think we are in agreement from previous discussion that, to solve
the TOCTOU race, the heap_lock must be held for the entire allocation
for a domain creation.  True?

So unless the limit is "bumped" to handle the largest supported
physical memory size for a domain AND the allocation code in
the hypervisor is rewritten to hold the heap_lock while allocating
the entire extent, bumping the limit doesn't help the TOCTOU race,
correct?

Further, holding the heap_lock not only stops scheduling of
this pcpu, but also blocks other domains/pcpus from doing
any micro-allocations at all.  True?

Sorry if I am restating the obvious, but I am red-faced about
the huge-number-of-hypercalls mistake, so want to ensure if
I am understanding.

Dan

P.S. For PV domains, doesn't the toolstack already use a batch of up
to 2^20 pages?  (Or maybe I am misunderstanding/misreading the code
in arch_setup_meminit() in xc_dom_x86.c?)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 19:17:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 19:17:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWXax-00071Z-BE; Thu, 08 Nov 2012 19:16:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TWXav-00071R-Kf
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 19:16:53 +0000
Received: from [85.158.139.211:54114] by server-14.bemta-5.messagelabs.com id
	84/3A-21768-4250C905; Thu, 08 Nov 2012 19:16:52 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1352402210!19433465!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMzY2NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32639 invoked from network); 8 Nov 2012 19:16:52 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-3.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 8 Nov 2012 19:16:52 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA8JGeBQ026877
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 8 Nov 2012 19:16:41 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA8JGdtI029015
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 8 Nov 2012 19:16:39 GMT
Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA8JGbfn019900; Thu, 8 Nov 2012 13:16:38 -0600
MIME-Version: 1.0
Message-ID: <563639fd-fc13-49cd-88cf-431244534c2f@default>
Date: Thu, 8 Nov 2012 11:16:34 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>
References: <509B8DC102000078000A72BA@nat28.tlf.novell.com>
	<CCC13EDB.51B6E%keir@xen.org>
	<509BC65402000078000A73A4@nat28.tlf.novell.com>
In-Reply-To: <509BC65402000078000A73A4@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Thursday, November 08, 2012 6:49 AM
> To: Keir Fraser
> Cc: Olaf Hering; IanCampbell; George Dunlap; Ian Jackson; George Shuklin; DarioFaggioli; xen-
> devel@lists.xen.org; Dan Magenheimer; Konrad Rzeszutek Wilk; Kurt Hackel; Mukesh Rathor; Zhigang Wang;
> TimDeegan
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> 
> >>> On 08.11.12 at 11:50, Keir Fraser <keir@xen.org> wrote:
> > On 08/11/2012 09:47, "Jan Beulich" <JBeulich@suse.com> wrote:
> >> The only thing that indeed is - on non-preemptible kernels - done
> >> only on exit to user mode is the eventual entering of the scheduler.
> >
> > That alone may still be an argument for restricting the batch size from the
> > toolstack?
> 
> Yes, this clearly prohibits unlimited batches. But not being able to
> schedule should be less restrictive than not being able to run
> softirqs, so I'd still put under question whether the limit shouldn't
> be bumped.

Wait, please define unlimited.

I think we are in agreement from previous discussion that, to solve
the TOCTOU race, the heap_lock must be held for the entire allocation
for a domain creation.  True?

So unless the limit is "bumped" to handle the largest supported
physical memory size for a domain AND the allocation code in
the hypervisor is rewritten to hold the heap_lock while allocating
the entire extent, bumping the limit doesn't help the TOCTOU race,
correct?

Further, holding the heap_lock not only stops scheduling of
this pcpu, but also blocks other domains/pcpus from doing
any micro-allocations at all.  True?

Sorry if I am restating the obvious, but I am red-faced about
the huge-number-of-hypercalls mistake, so want to ensure if
I am understanding.

Dan

P.S. For PV domains, doesn't the toolstack already use a batch of up
to 2^20 pages?  (Or maybe I am misunderstanding/misreading the code
in arch_setup_meminit() in xc_dom_x86.c?)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 20:45:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 20:45:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWYyf-0007wp-4f; Thu, 08 Nov 2012 20:45:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lists.xen@nuclearfallout.net>) id 1TWYyc-0007wk-W8
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 20:45:27 +0000
Received: from [85.158.137.99:16103] by server-9.bemta-3.messagelabs.com id
	5B/E3-02388-6E91C905; Thu, 08 Nov 2012 20:45:26 +0000
X-Env-Sender: lists.xen@nuclearfallout.net
X-Msg-Ref: server-12.tower-217.messagelabs.com!1352407524!15205380!1
X-Originating-IP: [208.146.45.251]
X-SpamReason: No, hits=0.0 required=7.0 tests=received_headers: No 
	Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7834 invoked from network); 8 Nov 2012 20:45:24 -0000
Received: from mail.nuclearfallout.net (HELO mail.nuclearfallout.net)
	(208.146.45.251) by server-12.tower-217.messagelabs.com with SMTP;
	8 Nov 2012 20:45:24 -0000
Message-ID: <509C19DE.6010108@nuclearfallout.net>
Date: Thu, 08 Nov 2012 12:45:18 -0800
From: John Weekes <lists.xen@nuclearfallout.net>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121010 Thunderbird/16.0.1
MIME-Version: 1.0
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [Xen-devel] Bugs in xl that affect stubdom+tapdisk2, and others
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I'm having these problems when using "xl" in the latest c/s of 4.2 
(25912:651d965ee2c0):

- It's not allowing multiple domains to use the same images, at least 
under tapdisk2. If I start one domain using an image (a read-only CD-ROM 
image, for instance), then start another, I can see in "tap-ctl list" 
that only one of the domains actually receives the proper access. The 
other either never gets it, or it is disconnected after it's created -- 
I can't readily tell which.

- When I use "xl destroy" on a domain that also has an associated 
stubdom, "xl" tries to destroy the tapdisk2 entries for both the domain 
and its stubdomain, resulting in errors like these:

# xl destroy testvds4
libxl: error: libxl_blktap2.c:73:libxl__device_destroy_tapdisk: Unable 
to find type aio disk /servers/isos/DummyCD.iso: No such file or directory
libxl: error: libxl_blktap2.c:73:libxl__device_destroy_tapdisk: Unable 
to find type aio disk /servers/customers/testvds4.img: No such file or 
directory
libxl: error: libxl_blktap2.c:73:libxl__device_destroy_tapdisk: Unable 
to find type aio disk /servers/isos/DummyCD-2.iso: No such file or directory
libxl: error: libxl.c:1466:devices_destroy_cb: libxl__devices_destroy 
failed for 19
libxl: error: libxl.c:1466:devices_destroy_cb: libxl__devices_destroy 
failed for 18

If I'm reading the source correctly, it seems as though the various 
destruction functions aren't passing down the domid and ultimately 
libxl__device_destroy_tapdisk is calling tap_ctl_find, which just 
globally matches based on the type and name of the image, causing the 
errors on destroy. I was trying to find a quick fix, but it looks like 
any proper one will require querying xenstore for the tapdisk entries 
specific to the domain, and I'm not immediately able to make that 
change, so I've personally just switched back to using "xm" for the time 
being. (I don't know if this relates to the first bug re: multiple 
domains using the same image files).

Another, much more minor, bug in "xl" that I've found is that "xl 
uptime" will not run without an argument; it is supposed to just show 
all uptimes in this circumstance. This is an easy one-liner fix of 
modifying line:

tools/libxl/xl_cmdimpl.c:5749:    while ((opt = def_getopt(argc, argv, 
"s", "uptime", 1)) != -1) {

into this:

tools/libxl/xl_cmdimpl.c:5749:    while ((opt = def_getopt(argc, argv, 
"s", "uptime", 0)) != -1) {

Also, a couple of small typos in "xl" --

libxl.c:556:        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting 
domain info list");
libxl.c:575:        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting 
domain info list");
libxl.c:678:        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting 
domain info list");
libxl.c:1393:        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "non-existant 
domain %d", domid);

Also, running "xl sched-credit" always gives me an error, even though it 
seems to work. Maybe it should be silent if cpu pools aren't defined? 
Maybe it's supposed to be creating a second cpupool for the second CPU 
in this system, and isn't?

# xl sched-credit
libxl: error: libxl.c:596:cpupool_info: failed to get info for cpupool1
: No such file or directory
Cpupool Pool-0: tslice=5ms ratelimit=500us
Name                                ID Weight  Cap
Domain-0                             0  65535    0

As an additional note about 4.2 -- this isn't an "xl" issue, but rather 
a build problem -- even though I use "./configure --libdir=/usr/lib64", 
the build is still creating a "dist/install/usr/lib" directory, and 
because of this, running ./install.sh nukes my system's "/usr/lib" -> 
"/usr/lib64" softlink (which in turn causes all sorts of other problems 
until it's corrected). Files that are being put in that tree:

xen-4.2-testing.hg # find dist/install/usr/lib
dist/install/usr/lib
dist/install/usr/lib/xen
dist/install/usr/lib/xen/boot
dist/install/usr/lib/xen/boot/xenstore-stubdom.gz
dist/install/usr/lib/xen/boot/ioemu-stubdom.gz
dist/install/usr/lib/xen/boot/pv-grub-x86_64.gz
dist/install/usr/lib/xen/boot/hvmloader
dist/install/usr/lib/xen/boot/pv-grub-x86_32.gz
dist/install/usr/lib/xen/bin
dist/install/usr/lib/xen/bin/stubdom-dm
dist/install/usr/lib/xen/bin/qemu-io
dist/install/usr/lib/xen/bin/qemu-nbd
dist/install/usr/lib/xen/bin/qemu-img
dist/install/usr/lib/xen/bin/xenpaging
dist/install/usr/lib/xen/bin/qemu-dm
dist/install/usr/lib/xen/bin/qemu-system-i386
dist/install/usr/lib/xen/bin/qemu-ga
dist/install/usr/lib/xen/bin/stubdompath.sh

-John

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 20:45:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 20:45:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWYyf-0007wp-4f; Thu, 08 Nov 2012 20:45:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lists.xen@nuclearfallout.net>) id 1TWYyc-0007wk-W8
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 20:45:27 +0000
Received: from [85.158.137.99:16103] by server-9.bemta-3.messagelabs.com id
	5B/E3-02388-6E91C905; Thu, 08 Nov 2012 20:45:26 +0000
X-Env-Sender: lists.xen@nuclearfallout.net
X-Msg-Ref: server-12.tower-217.messagelabs.com!1352407524!15205380!1
X-Originating-IP: [208.146.45.251]
X-SpamReason: No, hits=0.0 required=7.0 tests=received_headers: No 
	Received headers
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7834 invoked from network); 8 Nov 2012 20:45:24 -0000
Received: from mail.nuclearfallout.net (HELO mail.nuclearfallout.net)
	(208.146.45.251) by server-12.tower-217.messagelabs.com with SMTP;
	8 Nov 2012 20:45:24 -0000
Message-ID: <509C19DE.6010108@nuclearfallout.net>
Date: Thu, 08 Nov 2012 12:45:18 -0800
From: John Weekes <lists.xen@nuclearfallout.net>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121010 Thunderbird/16.0.1
MIME-Version: 1.0
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [Xen-devel] Bugs in xl that affect stubdom+tapdisk2, and others
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I'm having these problems when using "xl" in the latest c/s of 4.2 
(25912:651d965ee2c0):

- It's not allowing multiple domains to use the same images, at least 
under tapdisk2. If I start one domain using an image (a read-only CD-ROM 
image, for instance), then start another, I can see in "tap-ctl list" 
that only one of the domains actually receives the proper access. The 
other either never gets it, or it is disconnected after it's created -- 
I can't readily tell which.

- When I use "xl destroy" on a domain that also has an associated 
stubdom, "xl" tries to destroy the tapdisk2 entries for both the domain 
and its stubdomain, resulting in errors like these:

# xl destroy testvds4
libxl: error: libxl_blktap2.c:73:libxl__device_destroy_tapdisk: Unable 
to find type aio disk /servers/isos/DummyCD.iso: No such file or directory
libxl: error: libxl_blktap2.c:73:libxl__device_destroy_tapdisk: Unable 
to find type aio disk /servers/customers/testvds4.img: No such file or 
directory
libxl: error: libxl_blktap2.c:73:libxl__device_destroy_tapdisk: Unable 
to find type aio disk /servers/isos/DummyCD-2.iso: No such file or directory
libxl: error: libxl.c:1466:devices_destroy_cb: libxl__devices_destroy 
failed for 19
libxl: error: libxl.c:1466:devices_destroy_cb: libxl__devices_destroy 
failed for 18

If I'm reading the source correctly, it seems as though the various 
destruction functions aren't passing down the domid and ultimately 
libxl__device_destroy_tapdisk is calling tap_ctl_find, which just 
globally matches based on the type and name of the image, causing the 
errors on destroy. I was trying to find a quick fix, but it looks like 
any proper one will require querying xenstore for the tapdisk entries 
specific to the domain, and I'm not immediately able to make that 
change, so I've personally just switched back to using "xm" for the time 
being. (I don't know if this relates to the first bug re: multiple 
domains using the same image files).

Another, much more minor, bug in "xl" that I've found is that "xl 
uptime" will not run without an argument; it is supposed to just show 
all uptimes in this circumstance. This is an easy one-liner fix of 
modifying line:

tools/libxl/xl_cmdimpl.c:5749:    while ((opt = def_getopt(argc, argv, 
"s", "uptime", 1)) != -1) {

into this:

tools/libxl/xl_cmdimpl.c:5749:    while ((opt = def_getopt(argc, argv, 
"s", "uptime", 0)) != -1) {

Also, a couple of small typos in "xl" --

libxl.c:556:        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting 
domain info list");
libxl.c:575:        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting 
domain info list");
libxl.c:678:        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting 
domain info list");
libxl.c:1393:        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "non-existant 
domain %d", domid);

Also, running "xl sched-credit" always gives me an error, even though it 
seems to work. Maybe it should be silent if cpu pools aren't defined? 
Maybe it's supposed to be creating a second cpupool for the second CPU 
in this system, and isn't?

# xl sched-credit
libxl: error: libxl.c:596:cpupool_info: failed to get info for cpupool1
: No such file or directory
Cpupool Pool-0: tslice=5ms ratelimit=500us
Name                                ID Weight  Cap
Domain-0                             0  65535    0

As an additional note about 4.2 -- this isn't an "xl" issue, but rather 
a build problem -- even though I use "./configure --libdir=/usr/lib64", 
the build is still creating a "dist/install/usr/lib" directory, and 
because of this, running ./install.sh nukes my system's "/usr/lib" -> 
"/usr/lib64" softlink (which in turn causes all sorts of other problems 
until it's corrected). Files that are being put in that tree:

xen-4.2-testing.hg # find dist/install/usr/lib
dist/install/usr/lib
dist/install/usr/lib/xen
dist/install/usr/lib/xen/boot
dist/install/usr/lib/xen/boot/xenstore-stubdom.gz
dist/install/usr/lib/xen/boot/ioemu-stubdom.gz
dist/install/usr/lib/xen/boot/pv-grub-x86_64.gz
dist/install/usr/lib/xen/boot/hvmloader
dist/install/usr/lib/xen/boot/pv-grub-x86_32.gz
dist/install/usr/lib/xen/bin
dist/install/usr/lib/xen/bin/stubdom-dm
dist/install/usr/lib/xen/bin/qemu-io
dist/install/usr/lib/xen/bin/qemu-nbd
dist/install/usr/lib/xen/bin/qemu-img
dist/install/usr/lib/xen/bin/xenpaging
dist/install/usr/lib/xen/bin/qemu-dm
dist/install/usr/lib/xen/bin/qemu-system-i386
dist/install/usr/lib/xen/bin/qemu-ga
dist/install/usr/lib/xen/bin/stubdompath.sh

-John

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 21:42:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 21:42:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWZrl-0008LB-Tj; Thu, 08 Nov 2012 21:42:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TWZrk-0008L6-J9
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 21:42:24 +0000
Received: from [85.158.137.99:42345] by server-9.bemta-3.messagelabs.com id
	42/38-02388-F372C905; Thu, 08 Nov 2012 21:42:23 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1352410942!13282940!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTc5OTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2489 invoked from network); 8 Nov 2012 21:42:23 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 21:42:23 -0000
X-IronPort-AV: E=Sophos;i="4.80,740,1344211200"; d="scan'208";a="15683833"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	08 Nov 2012 21:42:22 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 8 Nov 2012 21:42:21 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TWZrh-0000zC-VG;
	Thu, 08 Nov 2012 21:42:21 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TWZrh-0008O2-PA;
	Thu, 08 Nov 2012 21:42:21 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14375-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 8 Nov 2012 21:42:21 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14375: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14375 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14375/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14374
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14374
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14374
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14374

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  62885b3c34c8
baseline version:
 xen                  92163b114076

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=62885b3c34c8
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 62885b3c34c8
+ branch=xen-unstable
+ revision=62885b3c34c8
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 62885b3c34c8 ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 7 changes to 6 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 21:42:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 21:42:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWZrl-0008LB-Tj; Thu, 08 Nov 2012 21:42:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TWZrk-0008L6-J9
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 21:42:24 +0000
Received: from [85.158.137.99:42345] by server-9.bemta-3.messagelabs.com id
	42/38-02388-F372C905; Thu, 08 Nov 2012 21:42:23 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1352410942!13282940!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTc5OTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2489 invoked from network); 8 Nov 2012 21:42:23 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 21:42:23 -0000
X-IronPort-AV: E=Sophos;i="4.80,740,1344211200"; d="scan'208";a="15683833"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	08 Nov 2012 21:42:22 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 8 Nov 2012 21:42:21 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TWZrh-0000zC-VG;
	Thu, 08 Nov 2012 21:42:21 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TWZrh-0008O2-PA;
	Thu, 08 Nov 2012 21:42:21 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14375-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 8 Nov 2012 21:42:21 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14375: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14375 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14375/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14374
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14374
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14374
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14374

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  62885b3c34c8
baseline version:
 xen                  92163b114076

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=62885b3c34c8
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 62885b3c34c8
+ branch=xen-unstable
+ revision=62885b3c34c8
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 62885b3c34c8 ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 7 changes to 6 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 21:46:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 21:46:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWZup-0008Um-NK; Thu, 08 Nov 2012 21:45:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TWZun-0008Ug-Tu
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 21:45:34 +0000
Received: from [85.158.137.99:44864] by server-1.bemta-3.messagelabs.com id
	45/EC-12169-DF72C905; Thu, 08 Nov 2012 21:45:33 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352411130!18229929!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1MDg4Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21326 invoked from network); 8 Nov 2012 21:45:32 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-14.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 21:45:32 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA8LjABw009125
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 8 Nov 2012 21:45:10 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA8Lj8jS004166
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 8 Nov 2012 21:45:09 GMT
Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA8Lj7hF027467; Thu, 8 Nov 2012 15:45:07 -0600
MIME-Version: 1.0
Message-ID: <88261052-b3f5-46f5-bd0e-b650d827062e@default>
Date: Thu, 8 Nov 2012 13:45:05 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>, Keir Fraser <keir.xen@gmail.com>
References: <7563be37-62f1-472e-9aec-1d0c55fa7c29@default>
	<CCC11199.443CE%keir.xen@gmail.com>
	<20635.34133.118531.778138@mariner.uk.xensource.com>
In-Reply-To: <20635.34133.118531.778138@mariner.uk.xensource.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "Tim \(Xen.org\)" <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Ian Jackson [mailto:Ian.Jackson@eu.citrix.com]
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> 
> Keir Fraser writes ("Re: Proposed new "memory capacity claim" hypercall/feature"):
> > On 07/11/2012 22:17, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:
> > > I think this brings us back to the proposed "claim" hypercall/subop.
> > > Unless there are further objections or suggestions for different
> > > approaches, I'll commence prototyping it, OK?
> >
> > Yes, in fact I thought you'd started already!
> 
> Sorry to play bad cop here but I am still far from convinced that a
> new hypercall is necessary or desirable.
> 
> A lot of words have been written but the concrete, detailed, technical
> argument remains to be made IMO.

Hi Ian --

I agree, a _lot_ of words have been written and this discussion
has had a lot of side conversations so has gone back and forth into
a lot of weed patches.

I agree it would be worthwhile to restate the problem clearly,
along with some of the proposed solutions/pros/cons.  When I
have a chance I will do that, but prototyping may either clarify
some things or bring out some new unforeseen issues, so I think
I will do some more coding first (and this may take a week or two
due to some other constraints).

But to ensure that any summary/restatement touches on your
concerns, could you be more specific as to about what you are
unconvinced?

I.e. I still think the toolstack can manage all memory
allocation; or, holding the heap_lock for a longer period
should solve the problem; or I don't understand what the
original problem is that you are trying to solve, etc.

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 21:46:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 21:46:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWZup-0008Um-NK; Thu, 08 Nov 2012 21:45:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TWZun-0008Ug-Tu
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 21:45:34 +0000
Received: from [85.158.137.99:44864] by server-1.bemta-3.messagelabs.com id
	45/EC-12169-DF72C905; Thu, 08 Nov 2012 21:45:33 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352411130!18229929!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1MDg4Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21326 invoked from network); 8 Nov 2012 21:45:32 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-14.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 8 Nov 2012 21:45:32 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA8LjABw009125
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 8 Nov 2012 21:45:10 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA8Lj8jS004166
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 8 Nov 2012 21:45:09 GMT
Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA8Lj7hF027467; Thu, 8 Nov 2012 15:45:07 -0600
MIME-Version: 1.0
Message-ID: <88261052-b3f5-46f5-bd0e-b650d827062e@default>
Date: Thu, 8 Nov 2012 13:45:05 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>, Keir Fraser <keir.xen@gmail.com>
References: <7563be37-62f1-472e-9aec-1d0c55fa7c29@default>
	<CCC11199.443CE%keir.xen@gmail.com>
	<20635.34133.118531.778138@mariner.uk.xensource.com>
In-Reply-To: <20635.34133.118531.778138@mariner.uk.xensource.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "Tim \(Xen.org\)" <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Ian Jackson [mailto:Ian.Jackson@eu.citrix.com]
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> 
> Keir Fraser writes ("Re: Proposed new "memory capacity claim" hypercall/feature"):
> > On 07/11/2012 22:17, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:
> > > I think this brings us back to the proposed "claim" hypercall/subop.
> > > Unless there are further objections or suggestions for different
> > > approaches, I'll commence prototyping it, OK?
> >
> > Yes, in fact I thought you'd started already!
> 
> Sorry to play bad cop here but I am still far from convinced that a
> new hypercall is necessary or desirable.
> 
> A lot of words have been written but the concrete, detailed, technical
> argument remains to be made IMO.

Hi Ian --

I agree, a _lot_ of words have been written and this discussion
has had a lot of side conversations so has gone back and forth into
a lot of weed patches.

I agree it would be worthwhile to restate the problem clearly,
along with some of the proposed solutions/pros/cons.  When I
have a chance I will do that, but prototyping may either clarify
some things or bring out some new unforeseen issues, so I think
I will do some more coding first (and this may take a week or two
due to some other constraints).

But to ensure that any summary/restatement touches on your
concerns, could you be more specific as to about what you are
unconvinced?

I.e. I still think the toolstack can manage all memory
allocation; or, holding the heap_lock for a longer period
should solve the problem; or I don't understand what the
original problem is that you are trying to solve, etc.

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 22:16:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 22:16:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWaOM-0000NT-EY; Thu, 08 Nov 2012 22:16:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <shpedoikal@gmail.com>) id 1TWaEs-0000Kr-GQ
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 22:06:18 +0000
Received: from [85.158.143.35:61653] by server-1.bemta-4.messagelabs.com id
	5B/1E-27934-9DC2C905; Thu, 08 Nov 2012 22:06:17 +0000
X-Env-Sender: shpedoikal@gmail.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1352412375!16337914!1
X-Originating-IP: [209.85.223.171]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9774 invoked from network); 8 Nov 2012 22:06:16 -0000
Received: from mail-ie0-f171.google.com (HELO mail-ie0-f171.google.com)
	(209.85.223.171)
	by server-13.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 22:06:16 -0000
Received: by mail-ie0-f171.google.com with SMTP id s9so6326179iec.30
	for <xen-devel@lists.xensource.com>;
	Thu, 08 Nov 2012 14:06:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=Hg9d7JvXbXdAweNP+oJDjx99wOa2MHTx1dhvQ+7C2wE=;
	b=g0ApgnOnQy1zXGiADTIvXF9LaRjh/Wm90lMtMLVwArJ6nwt4OYgiVrK9VJ8meZ2VGl
	JXKm+kmiorNnrQkPL8sAADQvF8xTAugZIkWoxEsQO3SUt3RfvkcGGnZa6Cghidz6H5xw
	3RbqC+2uGOpdHBdZQxHL7/iSR3bLB21TFIrtPycSS2MMc2Gn4FL4wvSKo7qdddRY8Let
	tEeV5IyqUGAVCNjGLUEPnmhk/CN1S90c+hY7oivnkPZvRq+ehlOt+qxTh+b6ASIGsBQB
	sengQm925AGWIpvQF75T0/sf6skCJ5gIh+jLGxJ+vM1ayDBMPVxu8wrrPR7USXrB/Qk7
	FQXQ==
MIME-Version: 1.0
Received: by 10.50.77.230 with SMTP id v6mr21471923igw.11.1352412374910; Thu,
	08 Nov 2012 14:06:14 -0800 (PST)
Received: by 10.50.95.233 with HTTP; Thu, 8 Nov 2012 14:06:14 -0800 (PST)
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48A229E6FD@aplesstripe.dom1.jhuapl.edu>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121107144625.GA14628@ennui.austin.ibm.com>
	<509AA501.1090701@jhuapl.edu>
	<509B78AC02000078000A723C@nat28.tlf.novell.com>
	<20121108152835.GA28612@ennui.austin.ibm.com>
	<068F06DC4D106941B297C0C5F9F446EA48A229E6FD@aplesstripe.dom1.jhuapl.edu>
Date: Thu, 8 Nov 2012 16:06:14 -0600
Message-ID: <CAM0nabEZw1t64mZgcB7SGRUMyKt3P41UpZZQxGuJYdYr=Fn+=g@mail.gmail.com>
From: Kent Yoder <shpedoikal@gmail.com>
To: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
X-Mailman-Approved-At: Thu, 08 Nov 2012 22:16:05 +0000
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	Jan Beulich <JBeulich@suse.com>, Kent Yoder <key@linux.vnet.ibm.com>
Subject: Re: [Xen-devel] [tpmdd-devel] [PATCH] add tpm_xenu.ko: Xen Virtual
 TPM frontend driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 8, 2012 at 9:36 AM, Fioravante, Matthew E.
<Matthew.Fioravante@jhuapl.edu> wrote:
>> >>> On 07.11.12 at 19:14, Matthew Fioravante <matthew.fioravante@jhuapl.edu> wrote:
>> > On 11/07/2012 09:46 AM, Kent Yoder wrote:
>> >>> --- a/drivers/char/tpm/tpm.h
>> >>> +++ b/drivers/char/tpm/tpm.h
>> >>> @@ -130,6 +130,9 @@ struct tpm_chip {
>> >>>
>> >>>           struct list_head list;
>> >>>           void (*release) (struct device *);
>> >>> +#if CONFIG_XEN
>> >>> + void *priv;
>> >>> +#endif
>> >>   Can you use the chip->vendor.data pointer here instead?
>> >> tpm_ibmvtpm is already using that as a priv pointer. I should
>> >> probably change that name to make it more obvious what that's used for.
>> > That makes more sense. I'm guessing your data pointer didn't exist
>> > during the 2.6.18 kernel which is why they added their own priv pointer.
>>
>> It got introduced with 3.7-rc.
>>
>> >>> @@ -310,6 +313,18 @@ struct tpm_cmd_t {
>> >>>
>> >>>   ssize_t tpm_getcap(struct device *, __be32, cap_t *, const char *);
>> >>>
>> >>> +#ifdef CONFIG_XEN
>> >>> +static inline void *chip_get_private(const struct tpm_chip *chip)
>> >>> +{
>> >>> + return chip->priv;
>> >>> +}
>> >>> +
>> >>> +static inline void chip_set_private(struct tpm_chip *chip, void
>> >>> +*priv) {
>> >>> + chip->priv = priv;
>> >>> +}
>> >>> +#endif
>> >>   Can you put these in tpm_vtpm.c please?  One less #define. :-)
>> > Agreed, I'd rather not have to modify your shared tpm.h interface at all.
>>
>> Either such accessors should be defined here, for everyone to use (and
>> tpm_ibmvtpm.c get changed accordingly), or the Xen code should access
>> the field without wrappers too (for consistency).
>
>   Agreed. I'll update tpm_ibmvtpm.
>
> Kent
>
> So what is the consensus, you're going to use accessors in ibmvtpm? I was just about to remove them from my side.

  Yeah I'll use your accessor.  Just modify it to use
chip->vendor.data and I'll add suport to tpm_ibmvtpm after I integrate
your patch.

Thanks!
Kent

>>
>> Jan
>>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_nov
> _______________________________________________
> tpmdd-devel mailing list
> tpmdd-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tpmdd-devel



-- 
IBM LTC Security

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 22:16:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 22:16:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWaOM-0000NT-EY; Thu, 08 Nov 2012 22:16:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <shpedoikal@gmail.com>) id 1TWaEs-0000Kr-GQ
	for xen-devel@lists.xensource.com; Thu, 08 Nov 2012 22:06:18 +0000
Received: from [85.158.143.35:61653] by server-1.bemta-4.messagelabs.com id
	5B/1E-27934-9DC2C905; Thu, 08 Nov 2012 22:06:17 +0000
X-Env-Sender: shpedoikal@gmail.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1352412375!16337914!1
X-Originating-IP: [209.85.223.171]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9774 invoked from network); 8 Nov 2012 22:06:16 -0000
Received: from mail-ie0-f171.google.com (HELO mail-ie0-f171.google.com)
	(209.85.223.171)
	by server-13.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 22:06:16 -0000
Received: by mail-ie0-f171.google.com with SMTP id s9so6326179iec.30
	for <xen-devel@lists.xensource.com>;
	Thu, 08 Nov 2012 14:06:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=Hg9d7JvXbXdAweNP+oJDjx99wOa2MHTx1dhvQ+7C2wE=;
	b=g0ApgnOnQy1zXGiADTIvXF9LaRjh/Wm90lMtMLVwArJ6nwt4OYgiVrK9VJ8meZ2VGl
	JXKm+kmiorNnrQkPL8sAADQvF8xTAugZIkWoxEsQO3SUt3RfvkcGGnZa6Cghidz6H5xw
	3RbqC+2uGOpdHBdZQxHL7/iSR3bLB21TFIrtPycSS2MMc2Gn4FL4wvSKo7qdddRY8Let
	tEeV5IyqUGAVCNjGLUEPnmhk/CN1S90c+hY7oivnkPZvRq+ehlOt+qxTh+b6ASIGsBQB
	sengQm925AGWIpvQF75T0/sf6skCJ5gIh+jLGxJ+vM1ayDBMPVxu8wrrPR7USXrB/Qk7
	FQXQ==
MIME-Version: 1.0
Received: by 10.50.77.230 with SMTP id v6mr21471923igw.11.1352412374910; Thu,
	08 Nov 2012 14:06:14 -0800 (PST)
Received: by 10.50.95.233 with HTTP; Thu, 8 Nov 2012 14:06:14 -0800 (PST)
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48A229E6FD@aplesstripe.dom1.jhuapl.edu>
References: <1352128197-1539-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121107144625.GA14628@ennui.austin.ibm.com>
	<509AA501.1090701@jhuapl.edu>
	<509B78AC02000078000A723C@nat28.tlf.novell.com>
	<20121108152835.GA28612@ennui.austin.ibm.com>
	<068F06DC4D106941B297C0C5F9F446EA48A229E6FD@aplesstripe.dom1.jhuapl.edu>
Date: Thu, 8 Nov 2012 16:06:14 -0600
Message-ID: <CAM0nabEZw1t64mZgcB7SGRUMyKt3P41UpZZQxGuJYdYr=Fn+=g@mail.gmail.com>
From: Kent Yoder <shpedoikal@gmail.com>
To: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
X-Mailman-Approved-At: Thu, 08 Nov 2012 22:16:05 +0000
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	Jan Beulich <JBeulich@suse.com>, Kent Yoder <key@linux.vnet.ibm.com>
Subject: Re: [Xen-devel] [tpmdd-devel] [PATCH] add tpm_xenu.ko: Xen Virtual
 TPM frontend driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 8, 2012 at 9:36 AM, Fioravante, Matthew E.
<Matthew.Fioravante@jhuapl.edu> wrote:
>> >>> On 07.11.12 at 19:14, Matthew Fioravante <matthew.fioravante@jhuapl.edu> wrote:
>> > On 11/07/2012 09:46 AM, Kent Yoder wrote:
>> >>> --- a/drivers/char/tpm/tpm.h
>> >>> +++ b/drivers/char/tpm/tpm.h
>> >>> @@ -130,6 +130,9 @@ struct tpm_chip {
>> >>>
>> >>>           struct list_head list;
>> >>>           void (*release) (struct device *);
>> >>> +#if CONFIG_XEN
>> >>> + void *priv;
>> >>> +#endif
>> >>   Can you use the chip->vendor.data pointer here instead?
>> >> tpm_ibmvtpm is already using that as a priv pointer. I should
>> >> probably change that name to make it more obvious what that's used for.
>> > That makes more sense. I'm guessing your data pointer didn't exist
>> > during the 2.6.18 kernel which is why they added their own priv pointer.
>>
>> It got introduced with 3.7-rc.
>>
>> >>> @@ -310,6 +313,18 @@ struct tpm_cmd_t {
>> >>>
>> >>>   ssize_t tpm_getcap(struct device *, __be32, cap_t *, const char *);
>> >>>
>> >>> +#ifdef CONFIG_XEN
>> >>> +static inline void *chip_get_private(const struct tpm_chip *chip)
>> >>> +{
>> >>> + return chip->priv;
>> >>> +}
>> >>> +
>> >>> +static inline void chip_set_private(struct tpm_chip *chip, void
>> >>> +*priv) {
>> >>> + chip->priv = priv;
>> >>> +}
>> >>> +#endif
>> >>   Can you put these in tpm_vtpm.c please?  One less #define. :-)
>> > Agreed, I'd rather not have to modify your shared tpm.h interface at all.
>>
>> Either such accessors should be defined here, for everyone to use (and
>> tpm_ibmvtpm.c get changed accordingly), or the Xen code should access
>> the field without wrappers too (for consistency).
>
>   Agreed. I'll update tpm_ibmvtpm.
>
> Kent
>
> So what is the consensus, you're going to use accessors in ibmvtpm? I was just about to remove them from my side.

  Yeah I'll use your accessor.  Just modify it to use
chip->vendor.data and I'll add suport to tpm_ibmvtpm after I integrate
your patch.

Thanks!
Kent

>>
>> Jan
>>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_nov
> _______________________________________________
> tpmdd-devel mailing list
> tpmdd-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tpmdd-devel



-- 
IBM LTC Security

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 22:33:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 22:33:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWaeR-0000a9-5j; Thu, 08 Nov 2012 22:32:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWaeP-0000a4-5O
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 22:32:41 +0000
Received: from [85.158.139.83:39290] by server-14.bemta-5.messagelabs.com id
	5F/E1-21768-8033C905; Thu, 08 Nov 2012 22:32:40 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1352413959!29433821!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30389 invoked from network); 8 Nov 2012 22:32:39 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-3.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 22:32:39 -0000
Received: by mail-wi0-f173.google.com with SMTP id cb5so5375wib.14
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 14:32:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=MG9k9OFMJ28jAdYt8zoPW407h+uI8jg9pmdkNlZ48Wc=;
	b=UhkI91gR8ieDWlrBMZOalZlZGcRLsOdip3Hh2uyL0iPlHnwk57J94b30gXKbYHGGhX
	srU/h6LlQl3lpoDz3THH8d+qfwbQ/aljkHO6FkIN4JKF7evnIGWr8bZbjBH+3PKKbJ9j
	ul9eoZzPGNADWj51czet0qCzKJTsz0kvCbV83dxnKbBdk5Zx5qlJtQB9znyRZ7Z31b2N
	FuQWEZIF0YFrNQEV47KVrHbCOX8z4pRaZXnMHNZc99fZjOhkIvr8NNfcaa/V2tC/kLNt
	lfqXHTwf8iCbvjXQ6oqzoGfq/KuxDJ8p4v7kvSwzLnMuQRHmoX8sorYvP0w0iyZLrDBa
	UORQ==
Received: by 10.216.141.152 with SMTP id g24mr4089692wej.113.1352413959446;
	Thu, 08 Nov 2012 14:32:39 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id i6sm381344wix.5.2012.11.08.14.32.35
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 14:32:38 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 22:32:32 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Jan Beulich <JBeulich@suse.com>
Message-ID: <CCC1E380.444D7%keir.xen@gmail.com>
Thread-Topic: Proposed new "memory capacity claim" hypercall/feature
Thread-Index: Ac2+APE6Tnwz7kQmHEuxdT0N2TPJvw==
In-Reply-To: <563639fd-fc13-49cd-88cf-431244534c2f@default>
Mime-version: 1.0
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 19:16, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:

>> Yes, this clearly prohibits unlimited batches. But not being able to
>> schedule should be less restrictive than not being able to run
>> softirqs, so I'd still put under question whether the limit shouldn't
>> be bumped.
> 
> Wait, please define unlimited.
> 
> I think we are in agreement from previous discussion that, to solve
> the TOCTOU race, the heap_lock must be held for the entire allocation
> for a domain creation.  True?

It's pretty obvious that this isn't going to be possible in the general
case. E.g., a 40G domain being created out of 4k pages (eg. Because memory
is fragmented) is going to be at least 40G/4k == 10M heap operations. Say
each takes 10ns, which would be quick, we're talking 100ms of cpu work.
Holding a lock that long can't be recommended really.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 08 22:33:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Nov 2012 22:33:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWaeR-0000a9-5j; Thu, 08 Nov 2012 22:32:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TWaeP-0000a4-5O
	for xen-devel@lists.xen.org; Thu, 08 Nov 2012 22:32:41 +0000
Received: from [85.158.139.83:39290] by server-14.bemta-5.messagelabs.com id
	5F/E1-21768-8033C905; Thu, 08 Nov 2012 22:32:40 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1352413959!29433821!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30389 invoked from network); 8 Nov 2012 22:32:39 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-3.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	8 Nov 2012 22:32:39 -0000
Received: by mail-wi0-f173.google.com with SMTP id cb5so5375wib.14
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 14:32:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=MG9k9OFMJ28jAdYt8zoPW407h+uI8jg9pmdkNlZ48Wc=;
	b=UhkI91gR8ieDWlrBMZOalZlZGcRLsOdip3Hh2uyL0iPlHnwk57J94b30gXKbYHGGhX
	srU/h6LlQl3lpoDz3THH8d+qfwbQ/aljkHO6FkIN4JKF7evnIGWr8bZbjBH+3PKKbJ9j
	ul9eoZzPGNADWj51czet0qCzKJTsz0kvCbV83dxnKbBdk5Zx5qlJtQB9znyRZ7Z31b2N
	FuQWEZIF0YFrNQEV47KVrHbCOX8z4pRaZXnMHNZc99fZjOhkIvr8NNfcaa/V2tC/kLNt
	lfqXHTwf8iCbvjXQ6oqzoGfq/KuxDJ8p4v7kvSwzLnMuQRHmoX8sorYvP0w0iyZLrDBa
	UORQ==
Received: by 10.216.141.152 with SMTP id g24mr4089692wej.113.1352413959446;
	Thu, 08 Nov 2012 14:32:39 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id i6sm381344wix.5.2012.11.08.14.32.35
	(version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 14:32:38 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 08 Nov 2012 22:32:32 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Jan Beulich <JBeulich@suse.com>
Message-ID: <CCC1E380.444D7%keir.xen@gmail.com>
Thread-Topic: Proposed new "memory capacity claim" hypercall/feature
Thread-Index: Ac2+APE6Tnwz7kQmHEuxdT0N2TPJvw==
In-Reply-To: <563639fd-fc13-49cd-88cf-431244534c2f@default>
Mime-version: 1.0
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/2012 19:16, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:

>> Yes, this clearly prohibits unlimited batches. But not being able to
>> schedule should be less restrictive than not being able to run
>> softirqs, so I'd still put under question whether the limit shouldn't
>> be bumped.
> 
> Wait, please define unlimited.
> 
> I think we are in agreement from previous discussion that, to solve
> the TOCTOU race, the heap_lock must be held for the entire allocation
> for a domain creation.  True?

It's pretty obvious that this isn't going to be possible in the general
case. E.g., a 40G domain being created out of 4k pages (eg. Because memory
is fragmented) is going to be at least 40G/4k == 10M heap operations. Say
each takes 10ns, which would be quick, we're talking 100ms of cpu work.
Holding a lock that long can't be recommended really.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 01:00:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 01:00:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWcwy-0001uB-UW; Fri, 09 Nov 2012 01:00:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TWcwx-0001u6-A4
	for Xen-devel@lists.xensource.com; Fri, 09 Nov 2012 00:59:59 +0000
Received: from [85.158.143.35:63963] by server-1.bemta-4.messagelabs.com id
	E9/20-27934-E855C905; Fri, 09 Nov 2012 00:59:58 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1352422796!14167204!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMzg3NDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4492 invoked from network); 9 Nov 2012 00:59:57 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-15.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 9 Nov 2012 00:59:57 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA90xtAI023380
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <Xen-devel@lists.xensource.com>; Fri, 9 Nov 2012 00:59:56 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA90xsiV026538
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <Xen-devel@lists.xensource.com>; Fri, 9 Nov 2012 00:59:55 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA90xsGR032074
	for <Xen-devel@lists.xensource.com>; Thu, 8 Nov 2012 18:59:54 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 08 Nov 2012 16:59:54 -0800
Date: Thu, 8 Nov 2012 16:59:53 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Message-ID: <20121108165953.1d3e27cd@mantra.us.oracle.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Subject: [Xen-devel] PVH update...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Just wanted go give quick PVH update. I refreshed my xen tree, mine was
few months old. Lot of changes, so did the merge manually. Still it
doesn't work, so debugging right now. Will send alpha patch as soon as
I've something working. jfyi...

thanks,
mukesh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 01:00:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 01:00:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWcwy-0001uB-UW; Fri, 09 Nov 2012 01:00:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TWcwx-0001u6-A4
	for Xen-devel@lists.xensource.com; Fri, 09 Nov 2012 00:59:59 +0000
Received: from [85.158.143.35:63963] by server-1.bemta-4.messagelabs.com id
	E9/20-27934-E855C905; Fri, 09 Nov 2012 00:59:58 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1352422796!14167204!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMzg3NDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4492 invoked from network); 9 Nov 2012 00:59:57 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-15.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 9 Nov 2012 00:59:57 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA90xtAI023380
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <Xen-devel@lists.xensource.com>; Fri, 9 Nov 2012 00:59:56 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA90xsiV026538
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <Xen-devel@lists.xensource.com>; Fri, 9 Nov 2012 00:59:55 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA90xsGR032074
	for <Xen-devel@lists.xensource.com>; Thu, 8 Nov 2012 18:59:54 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 08 Nov 2012 16:59:54 -0800
Date: Thu, 8 Nov 2012 16:59:53 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Message-ID: <20121108165953.1d3e27cd@mantra.us.oracle.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Subject: [Xen-devel] PVH update...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Just wanted go give quick PVH update. I refreshed my xen tree, mine was
few months old. Lot of changes, so did the merge manually. Still it
doesn't work, so debugging right now. Will send alpha patch as soon as
I've something working. jfyi...

thanks,
mukesh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 04:03:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 04:03:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWfo3-0006pH-7B; Fri, 09 Nov 2012 04:02:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <blistovmhz@gmail.com>) id 1TWfo1-0006pC-6p
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 04:02:57 +0000
Received: from [85.158.143.99:53573] by server-2.bemta-4.messagelabs.com id
	9A/40-28922-0708C905; Fri, 09 Nov 2012 04:02:56 +0000
X-Env-Sender: blistovmhz@gmail.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352433772!25852532!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=1.7 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_20_30, HTML_MESSAGE, ML_RADAR_SPEW_LINKS_14, RCVD_BY_IP,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9880 invoked from network); 9 Nov 2012 04:02:53 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 04:02:53 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl15so4215898vcb.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 20:02:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=+HXEMaYIlS5rxaR1GT6PbHjB3RUuH3ACqdJHRtVL1bg=;
	b=k1qSIhPDxOpT2Vd+U/5KOq+yjolgX8DnEHL2EGKxPBDYQUbYa+wJHvs+d14sLAhNRl
	8XkXOGlDn9QoKeCo34w6UG3bnUCpZvGOBJxWmrTdF7I92ZTXI0YEbzxz6lt+z60WW5P2
	fOHWGhe2OIoLO2Mah6onljHBd8MotK9U9m+7Nw/1Y6BHoDkG8HBLzMRegFag8U1Z+U6+
	BrR8ARWqvua0lVHyGjDB29rDDU42I2Gy4Z1F3x/Arc2DFZKZOrTRJGYpZsexdj+wcgcZ
	h4DJ8BYzPAZwJ2nrvTJQEDcUg+1nOqziobhP6nOZ29o3btv6vgkbVk6ccqVOxE+PBNJ6
	SIGw==
MIME-Version: 1.0
Received: by 10.52.70.48 with SMTP id j16mr8136138vdu.1.1352433771657; Thu, 08
	Nov 2012 20:02:51 -0800 (PST)
Received: by 10.220.37.8 with HTTP; Thu, 8 Nov 2012 20:02:51 -0800 (PST)
Date: Thu, 8 Nov 2012 20:02:51 -0800
Message-ID: <CAN3GA=T8Ztupou=XU4a6MeMWJN5yJgN=0fmDUp0BvXFRPEfLYw@mail.gmail.com>
From: feral <blistovmhz@gmail.com>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
	IO_PAGE_FAULT:
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5534640562881894256=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5534640562881894256==
Content-Type: multipart/alternative; boundary=20cf307f39968aba5704ce08063d

--20cf307f39968aba5704ce08063d
Content-Type: text/plain; charset=ISO-8859-1

Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable.  Tested against all three.

VGA passthrough previously working with 4.1 is no longer working with >4.2.

Setup - Working:
Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos), libvirt-bin,
xend
Asus Radeon HD 7870 DirectCU.
Works perfect.  Benches on par with bare metal.

Setup - Broken:
Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (from GIT), xl
toolstack.
Asus Radeon HD 7870 DirectCU.
Some times the guest boots correctly but display is never enabled.
 Sometimes BSOD, doesn't seem to be any rhyme or reason?

No errors in logs.   Found the following in 'xl dmesg':
(XEN) AMD-Vi: IO_PAGE_FAULT: domain = 2, device id = 0x600, fault address =
0x1ac800000, flags = 0



Full 'xl dmesg' output:

 __  __            _  _    _____                    _        _     _
 \ \/ /___ _ __   | || |  |___ /    _   _ _ __  ___| |_ __ _| |__ | | ___
  \  // _ \ '_ \  | || |_   |_ \ __| | | | '_ \/ __| __/ _` | '_ \| |/ _ \
  /  \  __/ | | | |__   _| ___) |__| |_| | | | \__ \ || (_| | |_) | |  __/
 /_/\_\___|_| |_|    |_|(_)____/    \__,_|_| |_|___/\__\__,_|_.__/|_|\___|

(XEN) Xen version 4.3-unstable (root@) (gcc (Ubuntu/Linaro 4.6.3-1ubuntu5)
4.6.3) Wed Nov  7 21:13:35 PST 2012
(XEN) Latest ChangeSet: unavailable
(XEN) Bootloader: GRUB 1.99-21ubuntu3.4
(XEN) Command line: xen-pciback=passthrough
xen-pciback.hide=(06:00.0)(06.00.1)
(XEN) Video information:
(XEN)  VGA is text mode 80x25, font 8x16
(XEN)  VBE/DDC methods: V2; EDID transfer time: 1 seconds
(XEN) Disc information:
(XEN)  Found 6 MBR signatures
(XEN)  Found 6 EDD information structures
(XEN) Xen-e820 RAM map:
(XEN)  0000000000000000 - 000000000009e800 (usable)
(XEN)  000000000009e800 - 00000000000a0000 (reserved)
(XEN)  00000000000e0000 - 0000000000100000 (reserved)
(XEN)  0000000000100000 - 00000000bab4f000 (usable)
(XEN)  00000000bab4f000 - 00000000baf83000 (reserved)
(XEN)  00000000baf83000 - 00000000baf93000 (ACPI data)
(XEN)  00000000baf93000 - 00000000bbcfa000 (ACPI NVS)
(XEN)  00000000bbcfa000 - 00000000bca4f000 (reserved)
(XEN)  00000000bca4f000 - 00000000bca50000 (usable)
(XEN)  00000000bca50000 - 00000000bcc56000 (ACPI NVS)
(XEN)  00000000bcc56000 - 00000000bd083000 (usable)
(XEN)  00000000bd083000 - 00000000bd7f4000 (reserved)
(XEN)  00000000bd7f4000 - 00000000bd800000 (usable)
(XEN)  00000000f8000000 - 00000000fc000000 (reserved)
(XEN)  00000000fec00000 - 00000000fec01000 (reserved)
(XEN)  00000000fec10000 - 00000000fec11000 (reserved)
(XEN)  00000000fec20000 - 00000000fec21000 (reserved)
(XEN)  00000000fed00000 - 00000000fed01000 (reserved)
(XEN)  00000000fed61000 - 00000000fed71000 (reserved)
(XEN)  00000000fed80000 - 00000000fed90000 (reserved)
(XEN)  00000000fef00000 - 0000000100000000 (reserved)
(XEN)  0000000100001000 - 000000043f000000 (usable)
(XEN) ACPI: RSDP 000F0490, 0024 (r2 ALASKA)
(XEN) ACPI: XSDT BAF89070, 005C (r1 ALASKA    A M I  1072009 AMI     10013)
(XEN) ACPI: FACP BAF90BF8, 010C (r5 ALASKA    A M I  1072009 AMI     10013)
(XEN) ACPI Warning (tbfadt-0232): FADT (revision 5) is longer than ACPI 2.0
version, truncating length 0x10C to 0xF4 [20070126]
(XEN) ACPI Warning (tbfadt-0444): Optional field "Pm2ControlBlock" has zero
address or length: 0000000000000000/1 [20070126]
(XEN) ACPI: DSDT BAF89168, 7A8A (r2 ALASKA    A M I        0 INTL 20051117)
(XEN) ACPI: FACS BBCF4F80, 0040
(XEN) ACPI: APIC BAF90D08, 009E (r3 ALASKA    A M I  1072009 AMI     10013)
(XEN) ACPI: FPDT BAF90DA8, 0044 (r1 ALASKA    A M I  1072009 AMI     10013)
(XEN) ACPI: MCFG BAF90DF0, 003C (r1 ALASKA    A M I  1072009 MSFT    10013)
(XEN) ACPI: HPET BAF90E30, 0038 (r1 ALASKA    A M I  1072009 AMI         5)
(XEN) ACPI: SSDT BAF90FC0, 1714 (r1 AMD    POWERNOW        1 AMD         1)
(XEN) ACPI: IVRS BAF90EC0, 0100 (r1  AMD     RD890S   202031 AMD         0)
(XEN) System RAM: 16287MB (16678040kB)
(XEN) No NUMA configuration found
(XEN) Faking a node at 0000000000000000-000000043f000000
(XEN) Domain heap initialised
(XEN) DMI 2.7 present.
(XEN) Using APIC driver default
(XEN) ACPI: PM-Timer IO Port: 0x808
(XEN) ACPI: ACPI SLEEP INFO: pm1x_cnt[804,0], pm1x_evt[800,0]
(XEN) ACPI: 32/64X FACS address mismatch in FADT -
bbcf4f80/0000000000000000, using 32
(XEN) ACPI:                  wakeup_vec[bbcf4f8c], vec_size[20]
(XEN) ACPI: Local APIC address 0xfee00000
(XEN) ACPI: LAPIC (acpi_id[0x01] lapic_id[0x10] enabled)
(XEN) Processor #16 5:1 APIC version 16
(XEN) ACPI: LAPIC (acpi_id[0x02] lapic_id[0x11] enabled)
(XEN) Processor #17 5:1 APIC version 16
(XEN) ACPI: LAPIC (acpi_id[0x03] lapic_id[0x12] enabled)
(XEN) Processor #18 5:1 APIC version 16
(XEN) ACPI: LAPIC (acpi_id[0x04] lapic_id[0x13] enabled)
(XEN) Processor #19 5:1 APIC version 16
(XEN) ACPI: LAPIC (acpi_id[0x05] lapic_id[0x14] enabled)
(XEN) Processor #20 5:1 APIC version 16
(XEN) ACPI: LAPIC (acpi_id[0x06] lapic_id[0x15] enabled)
(XEN) Processor #21 5:1 APIC version 16
(XEN) ACPI: LAPIC (acpi_id[0x07] lapic_id[0x16] enabled)
(XEN) Processor #22 5:1 APIC version 16
(XEN) ACPI: LAPIC (acpi_id[0x08] lapic_id[0x17] enabled)
(XEN) Processor #23 5:1 APIC version 16
(XEN) ACPI: LAPIC_NMI (acpi_id[0xff] high edge lint[0x1])
(XEN) ACPI: IOAPIC (id[0x09] address[0xfec00000] gsi_base[0])
(XEN) IOAPIC[0]: apic_id 9, version 33, address 0xfec00000, GSI 0-23
(XEN) ACPI: IOAPIC (id[0x0a] address[0xfec20000] gsi_base[24])
(XEN) IOAPIC[1]: apic_id 10, version 33, address 0xfec20000, GSI 24-55
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)
(XEN) ACPI: IRQ0 used by override.
(XEN) ACPI: IRQ2 used by override.
(XEN) ACPI: IRQ9 used by override.
(XEN) Enabling APIC mode:  Flat.  Using 2 I/O APICs
(XEN) ACPI: HPET id: 0x43538210 base: 0xfed00000
(XEN) Table is not found!
(XEN) Using ACPI (MADT) for SMP configuration information
(XEN) SMP: Allowing 8 CPUs (0 hotplug CPUs)
(XEN) IRQ limits: 56 GSI, 1496 MSI/MSI-X
(XEN) Using scheduler: SMP Credit Scheduler (credit)
(XEN) Detected 3913.302 MHz processor.
(XEN) Initing memory sharing.
(XEN) xstate_init: using cntxt_size: 0x3c0 and states: 0x4000000000000007
(XEN) AMD Fam15h machine check reporting enabled
(XEN) PCI: MCFG configuration 0: base e0000000 segment 0000 buses 00 - ff
(XEN) PCI: Not using MCFG for segment 0000 bus 00-ff
(XEN) AMD-Vi: IOMMU 0 Enabled.
(XEN) AMD-Vi: Enabling global vector map
(XEN) I/O virtualisation enabled
(XEN)  - Dom0 mode: Relaxed
(XEN) ENABLING IO-APIC IRQs
(XEN)  -> Using new ACK method
(XEN) ..TIMER: vector=0xF0 apic1=0 pin1=2 apic2=-1 pin2=-1
(XEN) Platform timer is 14.318MHz HPET
(XEN) Allocated console ring of 64 KiB.
(XEN) HVM: ASIDs enabled.
(XEN) SVM: Supported advanced features:
(XEN)  - Nested Page Tables (NPT)
(XEN)  - Last Branch Record (LBR) Virtualisation
(XEN)  - Next-RIP Saved on #VMEXIT
(XEN)  - VMCB Clean Bits
(XEN)  - DecodeAssists
(XEN)  - Pause-Intercept Filter
(XEN)  - TSC Rate MSR
(XEN) HVM: SVM enabled
(XEN) HVM: Hardware Assisted Paging (HAP) detected
(XEN) HVM: HAP page sizes: 4kB, 2MB, 1GB
(XEN) microcode: collect_cpu_info: patch_id=0x6000629
(XEN) microcode: collect_cpu_info: patch_id=0x6000629
(XEN) microcode: collect_cpu_info: patch_id=0x6000629
(XEN) microcode: collect_cpu_info: patch_id=0x6000629
(XEN) microcode: collect_cpu_info: patch_id=0x6000629
(XEN) microcode: collect_cpu_info: patch_id=0x6000629
(XEN) microcode: collect_cpu_info: patch_id=0x6000629
(XEN) Brought up 8 CPUs
(XEN) ACPI sleep modes: S3
(XEN) MCA: Use hw thresholding to adjust polling frequency
(XEN) mcheck_poll: Machine check polling timer started.
(XEN) mtrr: your CPUs had inconsistent fixed MTRR settings
(XEN) mtrr: probably your BIOS does not setup all CPUs.
(XEN) mtrr: corrected configuration.
(XEN) *** LOADING DOMAIN 0 ***
(XEN) elf_parse_binary: phdr: paddr=0x1000000 memsz=0xad4000
(XEN) elf_parse_binary: phdr: paddr=0x1c00000 memsz=0xe50e0
(XEN) elf_parse_binary: phdr: paddr=0x1ce6000 memsz=0x144c0
(XEN) elf_parse_binary: phdr: paddr=0x1cfb000 memsz=0x365000
(XEN) elf_parse_binary: memory: 0x1000000 -> 0x2060000
(XEN) elf_xen_parse_note: GUEST_OS = "linux"
(XEN) elf_xen_parse_note: GUEST_VERSION = "2.6"
(XEN) elf_xen_parse_note: XEN_VERSION = "xen-3.0"
(XEN) elf_xen_parse_note: VIRT_BASE = 0xffffffff80000000
(XEN) elf_xen_parse_note: ENTRY = 0xffffffff81cfb200
(XEN) elf_xen_parse_note: HYPERCALL_PAGE = 0xffffffff81001000
(XEN) elf_xen_parse_note: FEATURES =
"!writable_page_tables|pae_pgdir_above_4gb"
(XEN) elf_xen_parse_note: PAE_MODE = "yes"
(XEN) elf_xen_parse_note: LOADER = "generic"
(XEN) elf_xen_parse_note: unknown xen elf note (0xd)
(XEN) elf_xen_parse_note: SUSPEND_CANCEL = 0x1
(XEN) elf_xen_parse_note: HV_START_LOW = 0xffff800000000000
(XEN) elf_xen_parse_note: PADDR_OFFSET = 0x0
(XEN) elf_xen_addr_calc_check: addresses:
(XEN)     virt_base        = 0xffffffff80000000
(XEN)     elf_paddr_offset = 0x0
(XEN)     virt_offset      = 0xffffffff80000000
(XEN)     virt_kstart      = 0xffffffff81000000
(XEN)     virt_kend        = 0xffffffff82060000
(XEN)     virt_entry       = 0xffffffff81cfb200
(XEN)     p2m_base         = 0xffffffffffffffff
(XEN)  Xen  kernel: 64-bit, lsb, compat32
(XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x2060000
(XEN) PHYSICAL MEMORY ARRANGEMENT:
(XEN)  Dom0 alloc.:   0000000420000000->0000000428000000 (4038356 pages to
be allocated)
(XEN)  Init. ramdisk: 000000043c7e4000->000000043efff600
(XEN) VIRTUAL MEMORY ARRANGEMENT:
(XEN)  Loaded kernel: ffffffff81000000->ffffffff82060000
(XEN)  Init. ramdisk: ffffffff82060000->ffffffff8487b600
(XEN)  Phys-Mach map: ffffffff8487c000->ffffffff8679f780
(XEN)  Start info:    ffffffff867a0000->ffffffff867a04b4
(XEN)  Page tables:   ffffffff867a1000->ffffffff867da000
(XEN)  Boot stack:    ffffffff867da000->ffffffff867db000
(XEN)  TOTAL:         ffffffff80000000->ffffffff86c00000
(XEN)  ENTRY ADDRESS: ffffffff81cfb200
(XEN) Dom0 has maximum 8 VCPUs
(XEN) elf_load_binary: phdr 0 at 0xffffffff81000000 -> 0xffffffff81ad4000
(XEN) elf_load_binary: phdr 1 at 0xffffffff81c00000 -> 0xffffffff81ce50e0
(XEN) elf_load_binary: phdr 2 at 0xffffffff81ce6000 -> 0xffffffff81cfa4c0
(XEN) elf_load_binary: phdr 3 at 0xffffffff81cfb000 -> 0xffffffff81dd4000
(XEN) Scrubbing Free RAM: .done.
(XEN) Initial low memory virq threshold set at 0x4000 pages.
(XEN) Std. Loglevel: All
(XEN) Guest Loglevel: All
(XEN) Xen is relinquishing VGA console.
(XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input
to Xen)
(XEN) Freed 244kB init memory.
(XEN) traps.c:2486:d0 Domain attempted WRMSR 00000000c0010201 from
0x0000000000000000 to 0x000000000000abcd.
(XEN) PCI add device 0000:00:00.0
(XEN) PCI add device 0000:00:00.2
(XEN) PCI add device 0000:00:02.0
(XEN) PCI add device 0000:00:04.0
(XEN) PCI add device 0000:00:05.0
(XEN) PCI add device 0000:00:09.0
(XEN) PCI add device 0000:00:0a.0
(XEN) PCI add device 0000:00:0b.0
(XEN) PCI add device 0000:00:0d.0
(XEN) PCI add device 0000:00:11.0
(XEN) PCI add device 0000:00:12.0
(XEN) PCI add device 0000:00:12.2
(XEN) PCI add device 0000:00:13.0
(XEN) PCI add device 0000:00:13.2
(XEN) PCI add device 0000:00:14.0
(XEN) PCI add device 0000:00:14.2
(XEN) PCI add device 0000:00:14.3
(XEN) PCI add device 0000:00:14.4
(XEN) PCI add device 0000:00:14.5
(XEN) PCI add device 0000:00:15.0
(XEN) PCI add device 0000:00:15.1
(XEN) PCI add device 0000:00:15.2
(XEN) PCI add device 0000:00:15.3
(XEN) PCI add device 0000:00:16.0
(XEN) PCI add device 0000:00:16.2
(XEN) PCI add device 0000:00:18.0
(XEN) PCI add device 0000:00:18.1
(XEN) PCI add device 0000:00:18.2
(XEN) PCI add device 0000:00:18.3
(XEN) PCI add device 0000:00:18.4
(XEN) PCI add device 0000:00:18.5
(XEN) PCI add device 0000:01:00.0
(XEN) PCI add device 0000:01:00.1
(XEN) PCI add device 0000:02:00.0
(XEN) PCI add device 0000:03:00.0
(XEN) PCI add device 0000:04:00.0
(XEN) PCI add device 0000:06:00.0
(XEN) PCI add device 0000:06:00.1
(XEN) PCI add device 0000:0a:00.0
(XEN) PCI add device 0000:0b:00.0
(XEN) PCI add device 0000:0c:00.0
(XEN) memory.c:131:d0 Could not allocate order=18 extent: id=1 memflags=0
(0 of 1)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (3
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (1
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (0
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (0
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (0
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (0
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (0
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (0
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (0
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (0
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (0
of 4)
(XEN) memory.c:131:d0 Could not allocate order=0 extent: id=1 memflags=0
(582 of 2048)
(XEN) memory.c:131:d0 Could not allocate order=18 extent: id=2 memflags=0
(0 of 1)
(XEN) HVM2: HVM Loader
(XEN) HVM2: Detected Xen v4.3-unstable
(XEN) HVM2: Xenbus rings @0xfeffc000, event channel 8
(XEN) HVM2: System requested ROMBIOS
(XEN) HVM2: CPU speed is 3913 MHz
(XEN) irq.c:270: Dom2 PCI link 0 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:270: Dom2 PCI link 1 changed 0 -> 10
(XEN) HVM2: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:270: Dom2 PCI link 2 changed 0 -> 11
(XEN) HVM2: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:270: Dom2 PCI link 3 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 3 routed to IRQ5
(XEN) HVM2: pci dev 01:3 INTA->IRQ10
(XEN) HVM2: pci dev 03:0 INTA->IRQ5
(XEN) HVM2: pci dev 04:0 INTA->IRQ5
(XEN) HVM2: pci dev 05:0 INTA->IRQ10
(XEN) HVM2: pci dev 06:0 INTB->IRQ5
(XEN) HVM2: pci dev 05:0 bar 10 size lx: 10000000
(XEN) memory_map:add: dom2 gfn=e0000 mfn=c0000 nr=10000
(XEN) HVM2: pci dev 02:0 bar 10 size lx: 02000000
(XEN) HVM2: pci dev 03:0 bar 14 size lx: 01000000
(XEN) memory_map:add: dom2 gfn=f3000 mfn=fe300 nr=40
(XEN) HVM2: pci dev 05:0 bar 18 size lx: 00040000
(XEN) HVM2: pci dev 05:0 bar 30 size lx: 00020000
(XEN) HVM2: pci dev 06:0 bar 10 size lx: 00004000
(XEN) memory_map:add: dom2 gfn=f3060 mfn=fe360 nr=4
(XEN) HVM2: pci dev 02:0 bar 14 size lx: 00001000
(XEN) HVM2: pci dev 03:0 bar 10 size lx: 00000100
(XEN) HVM2: pci dev 04:0 bar 10 size lx: 00000100
(XEN) HVM2: pci dev 04:0 bar 14 size lx: 00000100
(XEN) HVM2: pci dev 05:0 bar 20 size lx: 00000100
(XEN) ioport_map:add: dom2 gport=c200 mport=b000 nr=100
(XEN) HVM2: pci dev 01:1 bar 20 size lx: 00000010
(XEN) HVM2: Multiprocessor initialisation:
(XEN) HVM2:  - CPU0 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2:  - CPU1 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2:  - CPU2 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2:  - CPU3 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2:  - CPU4 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2:  - CPU5 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2: Testing HVM environment:
(XEN) HVM2:  - REP INSB across page boundaries ... passed
(XEN) HVM2:  - GS base MSRs and SWAPGS ... passed
(XEN) HVM2: Passed 2 of 2 tests
(XEN) HVM2: Writing SMBIOS tables ...
(XEN) HVM2: Loading ROMBIOS ...
(XEN) HVM2: 12636 bytes of ROMBIOS high-memory extensions:
(XEN) HVM2:   Relocating to 0xfc001000-0xfc00415c ... done
(XEN) HVM2: Creating MP tables ...
(XEN) HVM2: Loading Cirrus VGABIOS ...
(XEN) HVM2: Loading PCI Option ROM ...
(XEN) HVM2:  - Manufacturer: http://ipxe.org
(XEN) HVM2:  - Product name: iPXE
(XEN) HVM2: Option ROMs:
(XEN) HVM2:  c0000-c8fff: VGA BIOS
(XEN) HVM2:  c9000-d8fff: Etherboot ROM
(XEN) HVM2: Loading ACPI ...
(XEN) HVM2: vm86 TSS at fc010280
(XEN) HVM2: BIOS map:
(XEN) HVM2:  f0000-fffff: Main BIOS
(XEN) HVM2: E820 table:
(XEN) HVM2:  [00]: 00000000:00000000 - 00000000:0009e000: RAM
(XEN) HVM2:  [01]: 00000000:0009e000 - 00000000:000a0000: RESERVED
(XEN) HVM2:  HOLE: 00000000:000a0000 - 00000000:000e0000
(XEN) HVM2:  [02]: 00000000:000e0000 - 00000000:00100000: RESERVED
(XEN) HVM2:  [03]: 00000000:00100000 - 00000000:e0000000: RAM
(XEN) HVM2:  HOLE: 00000000:e0000000 - 00000000:fc000000
(XEN) HVM2:  [04]: 00000000:fc000000 - 00000001:00000000: RESERVED
(XEN) HVM2:  [05]: 00000001:00000000 - 00000002:19800000: RAM
(XEN) HVM2: Invoking ROMBIOS ...
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) stdvga.c:147:d2 entering stdvga and caching modes
(XEN) HVM2: VGABios $Id: vgabios.c,v 1.67 2008/01/27 09:44:12 vruppert Exp $
(XEN) HVM2: Bochs BIOS - build: 06/23/99
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) HVM2: Options: apmbios pcibios eltorito PMM
(XEN) HVM2:
(XEN) HVM2: ata0-0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63
(XEN) HVM2: ata0 master: QEMU HARDDISK ATA-7 Hard-Disk ( 115 GBytes)
(XEN) HVM2: IDE time out
(XEN) HVM2:
(XEN) HVM2:
(XEN) HVM2:
(XEN) HVM2: Press F12 for boot menu.
(XEN) HVM2:
(XEN) HVM2: Booting from Hard Disk...
(XEN) HVM2: Booting from 0000:7c00
(XEN) stdvga.c:151:d2 leaving stdvga
(XEN) irq.c:270: Dom2 PCI link 0 changed 5 -> 0
(XEN) irq.c:270: Dom2 PCI link 1 changed 10 -> 0
(XEN) irq.c:270: Dom2 PCI link 2 changed 11 -> 0
(XEN) irq.c:270: Dom2 PCI link 3 changed 5 -> 0
(XEN) memory_map:remove: dom2 gfn=e0000 mfn=c0000 nr=10000
(XEN) memory_map:remove: dom2 gfn=f3000 mfn=fe300 nr=40
(XEN) ioport_map:remove: dom2 gport=c200 mport=b000 nr=100
(XEN) memory_map:add: dom2 gfn=e0000 mfn=c0000 nr=10000
(XEN) memory_map:add: dom2 gfn=f3000 mfn=fe300 nr=40
(XEN) ioport_map:add: dom2 gport=c200 mport=b000 nr=100
(XEN) memory_map:remove: dom2 gfn=f3060 mfn=fe360 nr=4
(XEN) memory_map:add: dom2 gfn=f3060 mfn=fe360 nr=4
(XEN) grant_table.c:1266:d2 Expanding dom (2) grant table from (4) to (32)
frames.
(XEN) irq.c:375: Dom2 callback via changed to GSI 28
(XEN) memory_map:remove: dom2 gfn=e0000 mfn=c0000 nr=10000
(XEN) memory_map:remove: dom2 gfn=f3000 mfn=fe300 nr=40
(XEN) ioport_map:remove: dom2 gport=c200 mport=b000 nr=100
(XEN) memory_map:add: dom2 gfn=e0000 mfn=c0000 nr=10000
(XEN) memory_map:add: dom2 gfn=f3000 mfn=fe300 nr=40
(XEN) ioport_map:add: dom2 gport=c200 mport=b000 nr=100
(XEN) memory_map:remove: dom2 gfn=f3060 mfn=fe360 nr=4
(XEN) memory_map:add: dom2 gfn=f3060 mfn=fe360 nr=4
(XEN) AMD-Vi: IO_PAGE_FAULT: domain = 2, device id = 0x600, fault address =
0x1ac800000, flags = 0



I've noticed this has already flown around the mailing list but I've only
recently subscribed and haven't seen a reply on previous posts about this
issue.  I apologise if I'm posting this erroneously.
-- 
_____
Fact:
1. Ninjas are mammals.
2. Ninjas fight ALL the time.
3. The purpose of the ninja is to flip out and kill people.

--20cf307f39968aba5704ce08063d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable. =A0Tested against all three.=
<div><br></div><div>VGA passthrough previously working with 4.1 is no longe=
r working with &gt;4.2.</div><div><br></div><div>Setup - Working:</div><div=
>
Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos), libvirt-bin, =
xend</div><div>Asus Radeon HD 7870 DirectCU.</div><div>Works perfect. =A0Be=
nches on par with bare metal.</div><div><br></div><div>Setup - Broken:</div=
>
<div>Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (from GIT), =
xl toolstack.</div><div><div>Asus Radeon HD 7870 DirectCU.</div></div><div>=
Some times the guest boots correctly but display is never enabled. =A0Somet=
imes BSOD, doesn&#39;t seem to be any rhyme or reason?</div>
<div><br></div><div>No errors in logs. =A0 Found the following in &#39;xl d=
mesg&#39;:</div><div>(XEN) AMD-Vi: IO_PAGE_FAULT: domain =3D 2, device id =
=3D 0x600, fault address =3D 0x1ac800000, flags =3D 0<br></div><div><div></=
div></div>
<div><div><br></div><div><br></div><div><br></div><div>Full &#39;xl dmesg&#=
39; output:</div><div><br></div><div>=A0__ =A0__ =A0 =A0 =A0 =A0 =A0 =A0_ =
=A0_ =A0 =A0_____ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0_ =A0 =A0 =A0 =A0_=
 =A0 =A0 _ =A0 =A0 =A0</div><div>=A0\ \/ /___ _ __ =A0 | || | =A0|___ / =A0=
 =A0_ =A0 _ _ __ =A0___| |_ __ _| |__ | | ___=A0</div>
<div>=A0 \ =A0// _ \ &#39;_ \ =A0| || |_ =A0 |_ \ __| | | | &#39;_ \/ __| _=
_/ _` | &#39;_ \| |/ _ \</div><div>=A0 / =A0\ =A0__/ | | | |__ =A0 _| ___) =
|__| |_| | | | \__ \ || (_| | |_) | | =A0__/</div><div>=A0/_/\_\___|_| |_| =
=A0 =A0|_|(_)____/ =A0 =A0\__,_|_| |_|___/\__\__,_|_.__/|_|\___|</div>
<div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0=A0</div><div>(XEN) Xen version 4.3-unstable (root@) (gcc (Ubuntu/Linar=
o 4.6.3-1ubuntu5) 4.6.3) Wed Nov =A07 21:13:35 PST 2012</div><div>(XEN) Lat=
est ChangeSet: unavailable</div>
<div>(XEN) Bootloader: GRUB 1.99-21ubuntu3.4</div><div>(XEN) Command line: =
xen-pciback=3Dpassthrough xen-pciback.hide=3D(06:00.0)(06.00.1)</div><div>(=
XEN) Video information:</div><div>(XEN) =A0VGA is text mode 80x25, font 8x1=
6</div>
<div>(XEN) =A0VBE/DDC methods: V2; EDID transfer time: 1 seconds</div><div>=
(XEN) Disc information:</div><div>(XEN) =A0Found 6 MBR signatures</div><div=
>(XEN) =A0Found 6 EDD information structures</div><div>(XEN) Xen-e820 RAM m=
ap:</div>
<div>(XEN) =A00000000000000000 - 000000000009e800 (usable)</div><div>(XEN) =
=A0000000000009e800 - 00000000000a0000 (reserved)</div><div>(XEN) =A0000000=
00000e0000 - 0000000000100000 (reserved)</div><div>(XEN) =A0000000000010000=
0 - 00000000bab4f000 (usable)</div>
<div>(XEN) =A000000000bab4f000 - 00000000baf83000 (reserved)</div><div>(XEN=
) =A000000000baf83000 - 00000000baf93000 (ACPI data)</div><div>(XEN) =A0000=
00000baf93000 - 00000000bbcfa000 (ACPI NVS)</div><div>(XEN) =A000000000bbcf=
a000 - 00000000bca4f000 (reserved)</div>
<div>(XEN) =A000000000bca4f000 - 00000000bca50000 (usable)</div><div>(XEN) =
=A000000000bca50000 - 00000000bcc56000 (ACPI NVS)</div><div>(XEN) =A0000000=
00bcc56000 - 00000000bd083000 (usable)</div><div>(XEN) =A000000000bd083000 =
- 00000000bd7f4000 (reserved)</div>
<div>(XEN) =A000000000bd7f4000 - 00000000bd800000 (usable)</div><div>(XEN) =
=A000000000f8000000 - 00000000fc000000 (reserved)</div><div>(XEN) =A0000000=
00fec00000 - 00000000fec01000 (reserved)</div><div>(XEN) =A000000000fec1000=
0 - 00000000fec11000 (reserved)</div>
<div>(XEN) =A000000000fec20000 - 00000000fec21000 (reserved)</div><div>(XEN=
) =A000000000fed00000 - 00000000fed01000 (reserved)</div><div>(XEN) =A00000=
0000fed61000 - 00000000fed71000 (reserved)</div><div>(XEN) =A000000000fed80=
000 - 00000000fed90000 (reserved)</div>
<div>(XEN) =A000000000fef00000 - 0000000100000000 (reserved)</div><div>(XEN=
) =A00000000100001000 - 000000043f000000 (usable)</div><div>(XEN) ACPI: RSD=
P 000F0490, 0024 (r2 ALASKA)</div><div>(XEN) ACPI: XSDT BAF89070, 005C (r1 =
ALASKA =A0 =A0A M I =A01072009 AMI =A0 =A0 10013)</div>
<div>(XEN) ACPI: FACP BAF90BF8, 010C (r5 ALASKA =A0 =A0A M I =A01072009 AMI=
 =A0 =A0 10013)</div><div>(XEN) ACPI Warning (tbfadt-0232): FADT (revision =
5) is longer than ACPI 2.0 version, truncating length 0x10C to 0xF4 [200701=
26]</div>
<div>(XEN) ACPI Warning (tbfadt-0444): Optional field &quot;Pm2ControlBlock=
&quot; has zero address or length: 0000000000000000/1 [20070126]</div><div>=
(XEN) ACPI: DSDT BAF89168, 7A8A (r2 ALASKA =A0 =A0A M I =A0 =A0 =A0 =A00 IN=
TL 20051117)</div>
<div>(XEN) ACPI: FACS BBCF4F80, 0040</div><div>(XEN) ACPI: APIC BAF90D08, 0=
09E (r3 ALASKA =A0 =A0A M I =A01072009 AMI =A0 =A0 10013)</div><div>(XEN) A=
CPI: FPDT BAF90DA8, 0044 (r1 ALASKA =A0 =A0A M I =A01072009 AMI =A0 =A0 100=
13)</div><div>(XEN) ACPI: MCFG BAF90DF0, 003C (r1 ALASKA =A0 =A0A M I =A010=
72009 MSFT =A0 =A010013)</div>
<div>(XEN) ACPI: HPET BAF90E30, 0038 (r1 ALASKA =A0 =A0A M I =A01072009 AMI=
 =A0 =A0 =A0 =A0 5)</div><div>(XEN) ACPI: SSDT BAF90FC0, 1714 (r1 AMD =A0 =
=A0POWERNOW =A0 =A0 =A0 =A01 AMD =A0 =A0 =A0 =A0 1)</div><div>(XEN) ACPI: I=
VRS BAF90EC0, 0100 (r1 =A0AMD =A0 =A0 RD890S =A0 202031 AMD =A0 =A0 =A0 =A0=
 0)</div>
<div>(XEN) System RAM: 16287MB (16678040kB)</div><div>(XEN) No NUMA configu=
ration found</div><div>(XEN) Faking a node at 0000000000000000-000000043f00=
0000</div><div>(XEN) Domain heap initialised</div><div>(XEN) DMI 2.7 presen=
t.</div>
<div>(XEN) Using APIC driver default</div><div>(XEN) ACPI: PM-Timer IO Port=
: 0x808</div><div>(XEN) ACPI: ACPI SLEEP INFO: pm1x_cnt[804,0], pm1x_evt[80=
0,0]</div><div>(XEN) ACPI: 32/64X FACS address mismatch in FADT - bbcf4f80/=
0000000000000000, using 32</div>
<div>(XEN) ACPI: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0wakeup_vec[bbcf4f8c], v=
ec_size[20]</div><div>(XEN) ACPI: Local APIC address 0xfee00000</div><div>(=
XEN) ACPI: LAPIC (acpi_id[0x01] lapic_id[0x10] enabled)</div><div>(XEN) Pro=
cessor #16 5:1 APIC version 16</div>
<div>(XEN) ACPI: LAPIC (acpi_id[0x02] lapic_id[0x11] enabled)</div><div>(XE=
N) Processor #17 5:1 APIC version 16</div><div>(XEN) ACPI: LAPIC (acpi_id[0=
x03] lapic_id[0x12] enabled)</div><div>(XEN) Processor #18 5:1 APIC version=
 16</div>
<div>(XEN) ACPI: LAPIC (acpi_id[0x04] lapic_id[0x13] enabled)</div><div>(XE=
N) Processor #19 5:1 APIC version 16</div><div>(XEN) ACPI: LAPIC (acpi_id[0=
x05] lapic_id[0x14] enabled)</div><div>(XEN) Processor #20 5:1 APIC version=
 16</div>
<div>(XEN) ACPI: LAPIC (acpi_id[0x06] lapic_id[0x15] enabled)</div><div>(XE=
N) Processor #21 5:1 APIC version 16</div><div>(XEN) ACPI: LAPIC (acpi_id[0=
x07] lapic_id[0x16] enabled)</div><div>(XEN) Processor #22 5:1 APIC version=
 16</div>
<div>(XEN) ACPI: LAPIC (acpi_id[0x08] lapic_id[0x17] enabled)</div><div>(XE=
N) Processor #23 5:1 APIC version 16</div><div>(XEN) ACPI: LAPIC_NMI (acpi_=
id[0xff] high edge lint[0x1])</div><div>(XEN) ACPI: IOAPIC (id[0x09] addres=
s[0xfec00000] gsi_base[0])</div>
<div>(XEN) IOAPIC[0]: apic_id 9, version 33, address 0xfec00000, GSI 0-23</=
div><div>(XEN) ACPI: IOAPIC (id[0x0a] address[0xfec20000] gsi_base[24])</di=
v><div>(XEN) IOAPIC[1]: apic_id 10, version 33, address 0xfec20000, GSI 24-=
55</div>
<div>(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)</div><d=
iv>(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)</div><d=
iv>(XEN) ACPI: IRQ0 used by override.</div><div>(XEN) ACPI: IRQ2 used by ov=
erride.</div>
<div>(XEN) ACPI: IRQ9 used by override.</div><div>(XEN) Enabling APIC mode:=
 =A0Flat. =A0Using 2 I/O APICs</div><div>(XEN) ACPI: HPET id: 0x43538210 ba=
se: 0xfed00000</div><div>(XEN) Table is not found!</div><div>(XEN) Using AC=
PI (MADT) for SMP configuration information</div>
<div>(XEN) SMP: Allowing 8 CPUs (0 hotplug CPUs)</div><div>(XEN) IRQ limits=
: 56 GSI, 1496 MSI/MSI-X</div><div>(XEN) Using scheduler: SMP Credit Schedu=
ler (credit)</div><div>(XEN) Detected 3913.302 MHz processor.</div><div>
(XEN) Initing memory sharing.</div><div>(XEN) xstate_init: using cntxt_size=
: 0x3c0 and states: 0x4000000000000007</div><div>(XEN) AMD Fam15h machine c=
heck reporting enabled</div><div>(XEN) PCI: MCFG configuration 0: base e000=
0000 segment 0000 buses 00 - ff</div>
<div>(XEN) PCI: Not using MCFG for segment 0000 bus 00-ff</div><div>(XEN) A=
MD-Vi: IOMMU 0 Enabled.</div><div>(XEN) AMD-Vi: Enabling global vector map<=
/div><div>(XEN) I/O virtualisation enabled</div><div>(XEN) =A0- Dom0 mode: =
Relaxed</div>
<div>(XEN) ENABLING IO-APIC IRQs</div><div>(XEN) =A0-&gt; Using new ACK met=
hod</div><div>(XEN) ..TIMER: vector=3D0xF0 apic1=3D0 pin1=3D2 apic2=3D-1 pi=
n2=3D-1</div><div>(XEN) Platform timer is 14.318MHz HPET</div><div>(XEN) Al=
located console ring of 64 KiB.</div>
<div>(XEN) HVM: ASIDs enabled.</div><div>(XEN) SVM: Supported advanced feat=
ures:</div><div>(XEN) =A0- Nested Page Tables (NPT)</div><div>(XEN) =A0- La=
st Branch Record (LBR) Virtualisation</div><div>(XEN) =A0- Next-RIP Saved o=
n #VMEXIT</div>
<div>(XEN) =A0- VMCB Clean Bits</div><div>(XEN) =A0- DecodeAssists</div><di=
v>(XEN) =A0- Pause-Intercept Filter</div><div>(XEN) =A0- TSC Rate MSR</div>=
<div>(XEN) HVM: SVM enabled</div><div>(XEN) HVM: Hardware Assisted Paging (=
HAP) detected</div>
<div>(XEN) HVM: HAP page sizes: 4kB, 2MB, 1GB</div><div>(XEN) microcode: co=
llect_cpu_info: patch_id=3D0x6000629</div><div>(XEN) microcode: collect_cpu=
_info: patch_id=3D0x6000629</div><div>(XEN) microcode: collect_cpu_info: pa=
tch_id=3D0x6000629</div>
<div>(XEN) microcode: collect_cpu_info: patch_id=3D0x6000629</div><div>(XEN=
) microcode: collect_cpu_info: patch_id=3D0x6000629</div><div>(XEN) microco=
de: collect_cpu_info: patch_id=3D0x6000629</div><div>(XEN) microcode: colle=
ct_cpu_info: patch_id=3D0x6000629</div>
<div>(XEN) Brought up 8 CPUs</div><div>(XEN) ACPI sleep modes: S3</div><div=
>(XEN) MCA: Use hw thresholding to adjust polling frequency</div><div>(XEN)=
 mcheck_poll: Machine check polling timer started.</div><div>(XEN) mtrr: yo=
ur CPUs had inconsistent fixed MTRR settings</div>
<div>(XEN) mtrr: probably your BIOS does not setup all CPUs.</div><div>(XEN=
) mtrr: corrected configuration.</div><div>(XEN) *** LOADING DOMAIN 0 ***</=
div><div>(XEN) elf_parse_binary: phdr: paddr=3D0x1000000 memsz=3D0xad4000</=
div>
<div>(XEN) elf_parse_binary: phdr: paddr=3D0x1c00000 memsz=3D0xe50e0</div><=
div>(XEN) elf_parse_binary: phdr: paddr=3D0x1ce6000 memsz=3D0x144c0</div><d=
iv>(XEN) elf_parse_binary: phdr: paddr=3D0x1cfb000 memsz=3D0x365000</div><d=
iv>(XEN) elf_parse_binary: memory: 0x1000000 -&gt; 0x2060000</div>
<div>(XEN) elf_xen_parse_note: GUEST_OS =3D &quot;linux&quot;</div><div>(XE=
N) elf_xen_parse_note: GUEST_VERSION =3D &quot;2.6&quot;</div><div>(XEN) el=
f_xen_parse_note: XEN_VERSION =3D &quot;xen-3.0&quot;</div><div>(XEN) elf_x=
en_parse_note: VIRT_BASE =3D 0xffffffff80000000</div>
<div>(XEN) elf_xen_parse_note: ENTRY =3D 0xffffffff81cfb200</div><div>(XEN)=
 elf_xen_parse_note: HYPERCALL_PAGE =3D 0xffffffff81001000</div><div>(XEN) =
elf_xen_parse_note: FEATURES =3D &quot;!writable_page_tables|pae_pgdir_abov=
e_4gb&quot;</div>
<div>(XEN) elf_xen_parse_note: PAE_MODE =3D &quot;yes&quot;</div><div>(XEN)=
 elf_xen_parse_note: LOADER =3D &quot;generic&quot;</div><div>(XEN) elf_xen=
_parse_note: unknown xen elf note (0xd)</div><div>(XEN) elf_xen_parse_note:=
 SUSPEND_CANCEL =3D 0x1</div>
<div>(XEN) elf_xen_parse_note: HV_START_LOW =3D 0xffff800000000000</div><di=
v>(XEN) elf_xen_parse_note: PADDR_OFFSET =3D 0x0</div><div>(XEN) elf_xen_ad=
dr_calc_check: addresses:</div><div>(XEN) =A0 =A0 virt_base =A0 =A0 =A0 =A0=
=3D 0xffffffff80000000</div>
<div>(XEN) =A0 =A0 elf_paddr_offset =3D 0x0</div><div>(XEN) =A0 =A0 virt_of=
fset =A0 =A0 =A0=3D 0xffffffff80000000</div><div>(XEN) =A0 =A0 virt_kstart =
=A0 =A0 =A0=3D 0xffffffff81000000</div><div>(XEN) =A0 =A0 virt_kend =A0 =A0=
 =A0 =A0=3D 0xffffffff82060000</div><div>
(XEN) =A0 =A0 virt_entry =A0 =A0 =A0 =3D 0xffffffff81cfb200</div><div>(XEN)=
 =A0 =A0 p2m_base =A0 =A0 =A0 =A0 =3D 0xffffffffffffffff</div><div>(XEN) =
=A0Xen =A0kernel: 64-bit, lsb, compat32</div><div>(XEN) =A0Dom0 kernel: 64-=
bit, PAE, lsb, paddr 0x1000000 -&gt; 0x2060000</div>
<div>(XEN) PHYSICAL MEMORY ARRANGEMENT:</div><div>(XEN) =A0Dom0 alloc.: =A0=
 0000000420000000-&gt;0000000428000000 (4038356 pages to be allocated)</div=
><div>(XEN) =A0Init. ramdisk: 000000043c7e4000-&gt;000000043efff600</div><d=
iv>
(XEN) VIRTUAL MEMORY ARRANGEMENT:</div><div>(XEN) =A0Loaded kernel: fffffff=
f81000000-&gt;ffffffff82060000</div><div>(XEN) =A0Init. ramdisk: ffffffff82=
060000-&gt;ffffffff8487b600</div><div>(XEN) =A0Phys-Mach map: ffffffff8487c=
000-&gt;ffffffff8679f780</div>
<div>(XEN) =A0Start info: =A0 =A0ffffffff867a0000-&gt;ffffffff867a04b4</div=
><div>(XEN) =A0Page tables: =A0 ffffffff867a1000-&gt;ffffffff867da000</div>=
<div>(XEN) =A0Boot stack: =A0 =A0ffffffff867da000-&gt;ffffffff867db000</div=
><div>(XEN) =A0TOTAL: =A0 =A0 =A0 =A0 ffffffff80000000-&gt;ffffffff86c00000=
</div>
<div>(XEN) =A0ENTRY ADDRESS: ffffffff81cfb200</div><div>(XEN) Dom0 has maxi=
mum 8 VCPUs</div><div>(XEN) elf_load_binary: phdr 0 at 0xffffffff81000000 -=
&gt; 0xffffffff81ad4000</div><div>(XEN) elf_load_binary: phdr 1 at 0xffffff=
ff81c00000 -&gt; 0xffffffff81ce50e0</div>
<div>(XEN) elf_load_binary: phdr 2 at 0xffffffff81ce6000 -&gt; 0xffffffff81=
cfa4c0</div><div>(XEN) elf_load_binary: phdr 3 at 0xffffffff81cfb000 -&gt; =
0xffffffff81dd4000</div><div>(XEN) Scrubbing Free RAM: .done.</div><div>
(XEN) Initial low memory virq threshold set at 0x4000 pages.</div><div>(XEN=
) Std. Loglevel: All</div><div>(XEN) Guest Loglevel: All</div><div>(XEN) Xe=
n is relinquishing VGA console.</div><div>(XEN) *** Serial input -&gt; DOM0=
 (type &#39;CTRL-a&#39; three times to switch input to Xen)</div>
<div>(XEN) Freed 244kB init memory.</div><div>(XEN) traps.c:2486:d0 Domain =
attempted WRMSR 00000000c0010201 from 0x0000000000000000 to 0x000000000000a=
bcd.</div><div>(XEN) PCI add device 0000:00:00.0</div><div>(XEN) PCI add de=
vice 0000:00:00.2</div>
<div>(XEN) PCI add device 0000:00:02.0</div><div>(XEN) PCI add device 0000:=
00:04.0</div><div>(XEN) PCI add device 0000:00:05.0</div><div>(XEN) PCI add=
 device 0000:00:09.0</div><div>(XEN) PCI add device 0000:00:0a.0</div><div>
(XEN) PCI add device 0000:00:0b.0</div><div>(XEN) PCI add device 0000:00:0d=
.0</div><div>(XEN) PCI add device 0000:00:11.0</div><div>(XEN) PCI add devi=
ce 0000:00:12.0</div><div>(XEN) PCI add device 0000:00:12.2</div><div>(XEN)=
 PCI add device 0000:00:13.0</div>
<div>(XEN) PCI add device 0000:00:13.2</div><div>(XEN) PCI add device 0000:=
00:14.0</div><div>(XEN) PCI add device 0000:00:14.2</div><div>(XEN) PCI add=
 device 0000:00:14.3</div><div>(XEN) PCI add device 0000:00:14.4</div><div>
(XEN) PCI add device 0000:00:14.5</div><div>(XEN) PCI add device 0000:00:15=
.0</div><div>(XEN) PCI add device 0000:00:15.1</div><div>(XEN) PCI add devi=
ce 0000:00:15.2</div><div>(XEN) PCI add device 0000:00:15.3</div><div>(XEN)=
 PCI add device 0000:00:16.0</div>
<div>(XEN) PCI add device 0000:00:16.2</div><div>(XEN) PCI add device 0000:=
00:18.0</div><div>(XEN) PCI add device 0000:00:18.1</div><div>(XEN) PCI add=
 device 0000:00:18.2</div><div>(XEN) PCI add device 0000:00:18.3</div><div>
(XEN) PCI add device 0000:00:18.4</div><div>(XEN) PCI add device 0000:00:18=
.5</div><div>(XEN) PCI add device 0000:01:00.0</div><div>(XEN) PCI add devi=
ce 0000:01:00.1</div><div>(XEN) PCI add device 0000:02:00.0</div><div>(XEN)=
 PCI add device 0000:03:00.0</div>
<div>(XEN) PCI add device 0000:04:00.0</div><div>(XEN) PCI add device 0000:=
06:00.0</div><div>(XEN) PCI add device 0000:06:00.1</div><div>(XEN) PCI add=
 device 0000:0a:00.0</div><div>(XEN) PCI add device 0000:0b:00.0</div><div>
(XEN) PCI add device 0000:0c:00.0</div><div>(XEN) memory.c:131:d0 Could not=
 allocate order=3D18 extent: id=3D1 memflags=3D0 (0 of 1)</div><div>(XEN) m=
emory.c:131:d0 Could not allocate order=3D9 extent: id=3D1 memflags=3D0 (3 =
of 4)</div>
<div>(XEN) memory.c:131:d0 Could not allocate order=3D9 extent: id=3D1 memf=
lags=3D0 (1 of 4)</div><div>(XEN) memory.c:131:d0 Could not allocate order=
=3D9 extent: id=3D1 memflags=3D0 (0 of 4)</div><div>(XEN) memory.c:131:d0 C=
ould not allocate order=3D9 extent: id=3D1 memflags=3D0 (0 of 4)</div>
<div>(XEN) memory.c:131:d0 Could not allocate order=3D9 extent: id=3D1 memf=
lags=3D0 (0 of 4)</div><div>(XEN) memory.c:131:d0 Could not allocate order=
=3D9 extent: id=3D1 memflags=3D0 (0 of 4)</div><div>(XEN) memory.c:131:d0 C=
ould not allocate order=3D9 extent: id=3D1 memflags=3D0 (0 of 4)</div>
<div>(XEN) memory.c:131:d0 Could not allocate order=3D9 extent: id=3D1 memf=
lags=3D0 (0 of 4)</div><div>(XEN) memory.c:131:d0 Could not allocate order=
=3D9 extent: id=3D1 memflags=3D0 (0 of 4)</div><div>(XEN) memory.c:131:d0 C=
ould not allocate order=3D9 extent: id=3D1 memflags=3D0 (0 of 4)</div>
<div>(XEN) memory.c:131:d0 Could not allocate order=3D9 extent: id=3D1 memf=
lags=3D0 (0 of 4)</div><div>(XEN) memory.c:131:d0 Could not allocate order=
=3D0 extent: id=3D1 memflags=3D0 (582 of 2048)</div><div>(XEN) memory.c:131=
:d0 Could not allocate order=3D18 extent: id=3D2 memflags=3D0 (0 of 1)</div=
>
<div>(XEN) HVM2: HVM Loader</div><div>(XEN) HVM2: Detected Xen v4.3-unstabl=
e</div><div>(XEN) HVM2: Xenbus rings @0xfeffc000, event channel 8</div><div=
>(XEN) HVM2: System requested ROMBIOS</div><div>(XEN) HVM2: CPU speed is 39=
13 MHz</div>
<div>(XEN) irq.c:270: Dom2 PCI link 0 changed 0 -&gt; 5</div><div>(XEN) HVM=
2: PCI-ISA link 0 routed to IRQ5</div><div>(XEN) irq.c:270: Dom2 PCI link 1=
 changed 0 -&gt; 10</div><div>(XEN) HVM2: PCI-ISA link 1 routed to IRQ10</d=
iv>
<div>(XEN) irq.c:270: Dom2 PCI link 2 changed 0 -&gt; 11</div><div>(XEN) HV=
M2: PCI-ISA link 2 routed to IRQ11</div><div>(XEN) irq.c:270: Dom2 PCI link=
 3 changed 0 -&gt; 5</div><div>(XEN) HVM2: PCI-ISA link 3 routed to IRQ5</d=
iv>
<div>(XEN) HVM2: pci dev 01:3 INTA-&gt;IRQ10</div><div>(XEN) HVM2: pci dev =
03:0 INTA-&gt;IRQ5</div><div>(XEN) HVM2: pci dev 04:0 INTA-&gt;IRQ5</div><d=
iv>(XEN) HVM2: pci dev 05:0 INTA-&gt;IRQ10</div><div>(XEN) HVM2: pci dev 06=
:0 INTB-&gt;IRQ5</div>
<div>(XEN) HVM2: pci dev 05:0 bar 10 size lx: 10000000</div><div>(XEN) memo=
ry_map:add: dom2 gfn=3De0000 mfn=3Dc0000 nr=3D10000</div><div>(XEN) HVM2: p=
ci dev 02:0 bar 10 size lx: 02000000</div><div>(XEN) HVM2: pci dev 03:0 bar=
 14 size lx: 01000000</div>
<div>(XEN) memory_map:add: dom2 gfn=3Df3000 mfn=3Dfe300 nr=3D40</div><div>(=
XEN) HVM2: pci dev 05:0 bar 18 size lx: 00040000</div><div>(XEN) HVM2: pci =
dev 05:0 bar 30 size lx: 00020000</div><div>(XEN) HVM2: pci dev 06:0 bar 10=
 size lx: 00004000</div>
<div>(XEN) memory_map:add: dom2 gfn=3Df3060 mfn=3Dfe360 nr=3D4</div><div>(X=
EN) HVM2: pci dev 02:0 bar 14 size lx: 00001000</div><div>(XEN) HVM2: pci d=
ev 03:0 bar 10 size lx: 00000100</div><div>(XEN) HVM2: pci dev 04:0 bar 10 =
size lx: 00000100</div>
<div>(XEN) HVM2: pci dev 04:0 bar 14 size lx: 00000100</div><div>(XEN) HVM2=
: pci dev 05:0 bar 20 size lx: 00000100</div><div>(XEN) ioport_map:add: dom=
2 gport=3Dc200 mport=3Db000 nr=3D100</div><div>(XEN) HVM2: pci dev 01:1 bar=
 20 size lx: 00000010</div>
<div>(XEN) HVM2: Multiprocessor initialisation:</div><div>(XEN) HVM2: =A0- =
CPU0 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3/8] ... done.</div><di=
v>(XEN) HVM2: =A0- CPU1 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3/8]=
 ... done.</div>
<div>(XEN) HVM2: =A0- CPU2 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3=
/8] ... done.</div><div>(XEN) HVM2: =A0- CPU3 ... 48-bit phys ... fixed MTR=
Rs ... var MTRRs [3/8] ... done.</div><div>(XEN) HVM2: =A0- CPU4 ... 48-bit=
 phys ... fixed MTRRs ... var MTRRs [3/8] ... done.</div>
<div>(XEN) HVM2: =A0- CPU5 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3=
/8] ... done.</div><div>(XEN) HVM2: Testing HVM environment:</div><div>(XEN=
) HVM2: =A0- REP INSB across page boundaries ... passed</div><div>(XEN) HVM=
2: =A0- GS base MSRs and SWAPGS ... passed</div>
<div>(XEN) HVM2: Passed 2 of 2 tests</div><div>(XEN) HVM2: Writing SMBIOS t=
ables ...</div><div>(XEN) HVM2: Loading ROMBIOS ...</div><div>(XEN) HVM2: 1=
2636 bytes of ROMBIOS high-memory extensions:</div><div>(XEN) HVM2: =A0 Rel=
ocating to 0xfc001000-0xfc00415c ... done</div>
<div>(XEN) HVM2: Creating MP tables ...</div><div>(XEN) HVM2: Loading Cirru=
s VGABIOS ...</div><div>(XEN) HVM2: Loading PCI Option ROM ...</div><div>(X=
EN) HVM2: =A0- Manufacturer: <a href=3D"http://ipxe.org">http://ipxe.org</a=
></div>
<div>(XEN) HVM2: =A0- Product name: iPXE</div><div>(XEN) HVM2: Option ROMs:=
</div><div>(XEN) HVM2: =A0c0000-c8fff: VGA BIOS</div><div>(XEN) HVM2: =A0c9=
000-d8fff: Etherboot ROM</div><div>(XEN) HVM2: Loading ACPI ...</div><div>(=
XEN) HVM2: vm86 TSS at fc010280</div>
<div>(XEN) HVM2: BIOS map:</div><div>(XEN) HVM2: =A0f0000-fffff: Main BIOS<=
/div><div>(XEN) HVM2: E820 table:</div><div>(XEN) HVM2: =A0[00]: 00000000:0=
0000000 - 00000000:0009e000: RAM</div><div>(XEN) HVM2: =A0[01]: 00000000:00=
09e000 - 00000000:000a0000: RESERVED</div>
<div>(XEN) HVM2: =A0HOLE: 00000000:000a0000 - 00000000:000e0000</div><div>(=
XEN) HVM2: =A0[02]: 00000000:000e0000 - 00000000:00100000: RESERVED</div><d=
iv>(XEN) HVM2: =A0[03]: 00000000:00100000 - 00000000:e0000000: RAM</div><di=
v>
(XEN) HVM2: =A0HOLE: 00000000:e0000000 - 00000000:fc000000</div><div>(XEN) =
HVM2: =A0[04]: 00000000:fc000000 - 00000001:00000000: RESERVED</div><div>(X=
EN) HVM2: =A0[05]: 00000001:00000000 - 00000002:19800000: RAM</div><div>(XE=
N) HVM2: Invoking ROMBIOS ...</div>
<div>(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $</div><div>=
(XEN) stdvga.c:147:d2 entering stdvga and caching modes</div><div>(XEN) HVM=
2: VGABios $Id: vgabios.c,v 1.67 2008/01/27 09:44:12 vruppert Exp $</div>
<div>(XEN) HVM2: Bochs BIOS - build: 06/23/99</div><div>(XEN) HVM2: $Revisi=
on: 1.221 $ $Date: 2008/12/07 17:32:29 $</div><div>(XEN) HVM2: Options: apm=
bios pcibios eltorito PMM=A0</div><div>(XEN) HVM2:=A0</div><div>(XEN) HVM2:=
 ata0-0: PCHS=3D16383/16/63 translation=3Dlba LCHS=3D1024/255/63</div>
<div>(XEN) HVM2: ata0 master: QEMU HARDDISK ATA-7 Hard-Disk ( 115 GBytes)</=
div><div>(XEN) HVM2: IDE time out</div><div>(XEN) HVM2:=A0</div><div>(XEN) =
HVM2:=A0</div><div>(XEN) HVM2:=A0</div><div>(XEN) HVM2: Press F12 for boot =
menu.</div>
<div>(XEN) HVM2:=A0</div><div>(XEN) HVM2: Booting from Hard Disk...</div><d=
iv>(XEN) HVM2: Booting from 0000:7c00</div><div>(XEN) stdvga.c:151:d2 leavi=
ng stdvga</div><div>(XEN) irq.c:270: Dom2 PCI link 0 changed 5 -&gt; 0</div=
>
<div>(XEN) irq.c:270: Dom2 PCI link 1 changed 10 -&gt; 0</div><div>(XEN) ir=
q.c:270: Dom2 PCI link 2 changed 11 -&gt; 0</div><div>(XEN) irq.c:270: Dom2=
 PCI link 3 changed 5 -&gt; 0</div><div>(XEN) memory_map:remove: dom2 gfn=
=3De0000 mfn=3Dc0000 nr=3D10000</div>
<div>(XEN) memory_map:remove: dom2 gfn=3Df3000 mfn=3Dfe300 nr=3D40</div><di=
v>(XEN) ioport_map:remove: dom2 gport=3Dc200 mport=3Db000 nr=3D100</div><di=
v>(XEN) memory_map:add: dom2 gfn=3De0000 mfn=3Dc0000 nr=3D10000</div><div>(=
XEN) memory_map:add: dom2 gfn=3Df3000 mfn=3Dfe300 nr=3D40</div>
<div>(XEN) ioport_map:add: dom2 gport=3Dc200 mport=3Db000 nr=3D100</div><di=
v>(XEN) memory_map:remove: dom2 gfn=3Df3060 mfn=3Dfe360 nr=3D4</div><div>(X=
EN) memory_map:add: dom2 gfn=3Df3060 mfn=3Dfe360 nr=3D4</div><div>(XEN) gra=
nt_table.c:1266:d2 Expanding dom (2) grant table from (4) to (32) frames.</=
div>
<div>(XEN) irq.c:375: Dom2 callback via changed to GSI 28</div><div>(XEN) m=
emory_map:remove: dom2 gfn=3De0000 mfn=3Dc0000 nr=3D10000</div><div>(XEN) m=
emory_map:remove: dom2 gfn=3Df3000 mfn=3Dfe300 nr=3D40</div><div>(XEN) iopo=
rt_map:remove: dom2 gport=3Dc200 mport=3Db000 nr=3D100</div>
<div>(XEN) memory_map:add: dom2 gfn=3De0000 mfn=3Dc0000 nr=3D10000</div><di=
v>(XEN) memory_map:add: dom2 gfn=3Df3000 mfn=3Dfe300 nr=3D40</div><div>(XEN=
) ioport_map:add: dom2 gport=3Dc200 mport=3Db000 nr=3D100</div><div>(XEN) m=
emory_map:remove: dom2 gfn=3Df3060 mfn=3Dfe360 nr=3D4</div>
<div>(XEN) memory_map:add: dom2 gfn=3Df3060 mfn=3Dfe360 nr=3D4</div><div>(X=
EN) AMD-Vi: IO_PAGE_FAULT: domain =3D 2, device id =3D 0x600, fault address=
 =3D 0x1ac800000, flags =3D 0</div><div><div><br></div><div><br></div><div>=
<br></div>
<div>I&#39;ve noticed this has already flown around the mailing list but I&=
#39;ve only recently subscribed and haven&#39;t seen a reply on previous po=
sts about this issue. =A0I apologise if I&#39;m posting this erroneously.</=
div>
-- <br>_____<br>Fact:<br>1. Ninjas are mammals.<br>2. Ninjas fight ALL the =
time.<br>3. The purpose of the ninja is to flip out and kill people.<br>
</div></div>

--20cf307f39968aba5704ce08063d--


--===============5534640562881894256==
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.xen.org
http://lists.xen.org/xen-devel

--===============5534640562881894256==--


From xen-devel-bounces@lists.xen.org Fri Nov 09 04:03:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 04:03:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWfo3-0006pH-7B; Fri, 09 Nov 2012 04:02:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <blistovmhz@gmail.com>) id 1TWfo1-0006pC-6p
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 04:02:57 +0000
Received: from [85.158.143.99:53573] by server-2.bemta-4.messagelabs.com id
	9A/40-28922-0708C905; Fri, 09 Nov 2012 04:02:56 +0000
X-Env-Sender: blistovmhz@gmail.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352433772!25852532!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=1.7 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_20_30, HTML_MESSAGE, ML_RADAR_SPEW_LINKS_14, RCVD_BY_IP,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9880 invoked from network); 9 Nov 2012 04:02:53 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 04:02:53 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl15so4215898vcb.32
	for <xen-devel@lists.xen.org>; Thu, 08 Nov 2012 20:02:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=+HXEMaYIlS5rxaR1GT6PbHjB3RUuH3ACqdJHRtVL1bg=;
	b=k1qSIhPDxOpT2Vd+U/5KOq+yjolgX8DnEHL2EGKxPBDYQUbYa+wJHvs+d14sLAhNRl
	8XkXOGlDn9QoKeCo34w6UG3bnUCpZvGOBJxWmrTdF7I92ZTXI0YEbzxz6lt+z60WW5P2
	fOHWGhe2OIoLO2Mah6onljHBd8MotK9U9m+7Nw/1Y6BHoDkG8HBLzMRegFag8U1Z+U6+
	BrR8ARWqvua0lVHyGjDB29rDDU42I2Gy4Z1F3x/Arc2DFZKZOrTRJGYpZsexdj+wcgcZ
	h4DJ8BYzPAZwJ2nrvTJQEDcUg+1nOqziobhP6nOZ29o3btv6vgkbVk6ccqVOxE+PBNJ6
	SIGw==
MIME-Version: 1.0
Received: by 10.52.70.48 with SMTP id j16mr8136138vdu.1.1352433771657; Thu, 08
	Nov 2012 20:02:51 -0800 (PST)
Received: by 10.220.37.8 with HTTP; Thu, 8 Nov 2012 20:02:51 -0800 (PST)
Date: Thu, 8 Nov 2012 20:02:51 -0800
Message-ID: <CAN3GA=T8Ztupou=XU4a6MeMWJN5yJgN=0fmDUp0BvXFRPEfLYw@mail.gmail.com>
From: feral <blistovmhz@gmail.com>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
	IO_PAGE_FAULT:
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5534640562881894256=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5534640562881894256==
Content-Type: multipart/alternative; boundary=20cf307f39968aba5704ce08063d

--20cf307f39968aba5704ce08063d
Content-Type: text/plain; charset=ISO-8859-1

Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable.  Tested against all three.

VGA passthrough previously working with 4.1 is no longer working with >4.2.

Setup - Working:
Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos), libvirt-bin,
xend
Asus Radeon HD 7870 DirectCU.
Works perfect.  Benches on par with bare metal.

Setup - Broken:
Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (from GIT), xl
toolstack.
Asus Radeon HD 7870 DirectCU.
Some times the guest boots correctly but display is never enabled.
 Sometimes BSOD, doesn't seem to be any rhyme or reason?

No errors in logs.   Found the following in 'xl dmesg':
(XEN) AMD-Vi: IO_PAGE_FAULT: domain = 2, device id = 0x600, fault address =
0x1ac800000, flags = 0



Full 'xl dmesg' output:

 __  __            _  _    _____                    _        _     _
 \ \/ /___ _ __   | || |  |___ /    _   _ _ __  ___| |_ __ _| |__ | | ___
  \  // _ \ '_ \  | || |_   |_ \ __| | | | '_ \/ __| __/ _` | '_ \| |/ _ \
  /  \  __/ | | | |__   _| ___) |__| |_| | | | \__ \ || (_| | |_) | |  __/
 /_/\_\___|_| |_|    |_|(_)____/    \__,_|_| |_|___/\__\__,_|_.__/|_|\___|

(XEN) Xen version 4.3-unstable (root@) (gcc (Ubuntu/Linaro 4.6.3-1ubuntu5)
4.6.3) Wed Nov  7 21:13:35 PST 2012
(XEN) Latest ChangeSet: unavailable
(XEN) Bootloader: GRUB 1.99-21ubuntu3.4
(XEN) Command line: xen-pciback=passthrough
xen-pciback.hide=(06:00.0)(06.00.1)
(XEN) Video information:
(XEN)  VGA is text mode 80x25, font 8x16
(XEN)  VBE/DDC methods: V2; EDID transfer time: 1 seconds
(XEN) Disc information:
(XEN)  Found 6 MBR signatures
(XEN)  Found 6 EDD information structures
(XEN) Xen-e820 RAM map:
(XEN)  0000000000000000 - 000000000009e800 (usable)
(XEN)  000000000009e800 - 00000000000a0000 (reserved)
(XEN)  00000000000e0000 - 0000000000100000 (reserved)
(XEN)  0000000000100000 - 00000000bab4f000 (usable)
(XEN)  00000000bab4f000 - 00000000baf83000 (reserved)
(XEN)  00000000baf83000 - 00000000baf93000 (ACPI data)
(XEN)  00000000baf93000 - 00000000bbcfa000 (ACPI NVS)
(XEN)  00000000bbcfa000 - 00000000bca4f000 (reserved)
(XEN)  00000000bca4f000 - 00000000bca50000 (usable)
(XEN)  00000000bca50000 - 00000000bcc56000 (ACPI NVS)
(XEN)  00000000bcc56000 - 00000000bd083000 (usable)
(XEN)  00000000bd083000 - 00000000bd7f4000 (reserved)
(XEN)  00000000bd7f4000 - 00000000bd800000 (usable)
(XEN)  00000000f8000000 - 00000000fc000000 (reserved)
(XEN)  00000000fec00000 - 00000000fec01000 (reserved)
(XEN)  00000000fec10000 - 00000000fec11000 (reserved)
(XEN)  00000000fec20000 - 00000000fec21000 (reserved)
(XEN)  00000000fed00000 - 00000000fed01000 (reserved)
(XEN)  00000000fed61000 - 00000000fed71000 (reserved)
(XEN)  00000000fed80000 - 00000000fed90000 (reserved)
(XEN)  00000000fef00000 - 0000000100000000 (reserved)
(XEN)  0000000100001000 - 000000043f000000 (usable)
(XEN) ACPI: RSDP 000F0490, 0024 (r2 ALASKA)
(XEN) ACPI: XSDT BAF89070, 005C (r1 ALASKA    A M I  1072009 AMI     10013)
(XEN) ACPI: FACP BAF90BF8, 010C (r5 ALASKA    A M I  1072009 AMI     10013)
(XEN) ACPI Warning (tbfadt-0232): FADT (revision 5) is longer than ACPI 2.0
version, truncating length 0x10C to 0xF4 [20070126]
(XEN) ACPI Warning (tbfadt-0444): Optional field "Pm2ControlBlock" has zero
address or length: 0000000000000000/1 [20070126]
(XEN) ACPI: DSDT BAF89168, 7A8A (r2 ALASKA    A M I        0 INTL 20051117)
(XEN) ACPI: FACS BBCF4F80, 0040
(XEN) ACPI: APIC BAF90D08, 009E (r3 ALASKA    A M I  1072009 AMI     10013)
(XEN) ACPI: FPDT BAF90DA8, 0044 (r1 ALASKA    A M I  1072009 AMI     10013)
(XEN) ACPI: MCFG BAF90DF0, 003C (r1 ALASKA    A M I  1072009 MSFT    10013)
(XEN) ACPI: HPET BAF90E30, 0038 (r1 ALASKA    A M I  1072009 AMI         5)
(XEN) ACPI: SSDT BAF90FC0, 1714 (r1 AMD    POWERNOW        1 AMD         1)
(XEN) ACPI: IVRS BAF90EC0, 0100 (r1  AMD     RD890S   202031 AMD         0)
(XEN) System RAM: 16287MB (16678040kB)
(XEN) No NUMA configuration found
(XEN) Faking a node at 0000000000000000-000000043f000000
(XEN) Domain heap initialised
(XEN) DMI 2.7 present.
(XEN) Using APIC driver default
(XEN) ACPI: PM-Timer IO Port: 0x808
(XEN) ACPI: ACPI SLEEP INFO: pm1x_cnt[804,0], pm1x_evt[800,0]
(XEN) ACPI: 32/64X FACS address mismatch in FADT -
bbcf4f80/0000000000000000, using 32
(XEN) ACPI:                  wakeup_vec[bbcf4f8c], vec_size[20]
(XEN) ACPI: Local APIC address 0xfee00000
(XEN) ACPI: LAPIC (acpi_id[0x01] lapic_id[0x10] enabled)
(XEN) Processor #16 5:1 APIC version 16
(XEN) ACPI: LAPIC (acpi_id[0x02] lapic_id[0x11] enabled)
(XEN) Processor #17 5:1 APIC version 16
(XEN) ACPI: LAPIC (acpi_id[0x03] lapic_id[0x12] enabled)
(XEN) Processor #18 5:1 APIC version 16
(XEN) ACPI: LAPIC (acpi_id[0x04] lapic_id[0x13] enabled)
(XEN) Processor #19 5:1 APIC version 16
(XEN) ACPI: LAPIC (acpi_id[0x05] lapic_id[0x14] enabled)
(XEN) Processor #20 5:1 APIC version 16
(XEN) ACPI: LAPIC (acpi_id[0x06] lapic_id[0x15] enabled)
(XEN) Processor #21 5:1 APIC version 16
(XEN) ACPI: LAPIC (acpi_id[0x07] lapic_id[0x16] enabled)
(XEN) Processor #22 5:1 APIC version 16
(XEN) ACPI: LAPIC (acpi_id[0x08] lapic_id[0x17] enabled)
(XEN) Processor #23 5:1 APIC version 16
(XEN) ACPI: LAPIC_NMI (acpi_id[0xff] high edge lint[0x1])
(XEN) ACPI: IOAPIC (id[0x09] address[0xfec00000] gsi_base[0])
(XEN) IOAPIC[0]: apic_id 9, version 33, address 0xfec00000, GSI 0-23
(XEN) ACPI: IOAPIC (id[0x0a] address[0xfec20000] gsi_base[24])
(XEN) IOAPIC[1]: apic_id 10, version 33, address 0xfec20000, GSI 24-55
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)
(XEN) ACPI: IRQ0 used by override.
(XEN) ACPI: IRQ2 used by override.
(XEN) ACPI: IRQ9 used by override.
(XEN) Enabling APIC mode:  Flat.  Using 2 I/O APICs
(XEN) ACPI: HPET id: 0x43538210 base: 0xfed00000
(XEN) Table is not found!
(XEN) Using ACPI (MADT) for SMP configuration information
(XEN) SMP: Allowing 8 CPUs (0 hotplug CPUs)
(XEN) IRQ limits: 56 GSI, 1496 MSI/MSI-X
(XEN) Using scheduler: SMP Credit Scheduler (credit)
(XEN) Detected 3913.302 MHz processor.
(XEN) Initing memory sharing.
(XEN) xstate_init: using cntxt_size: 0x3c0 and states: 0x4000000000000007
(XEN) AMD Fam15h machine check reporting enabled
(XEN) PCI: MCFG configuration 0: base e0000000 segment 0000 buses 00 - ff
(XEN) PCI: Not using MCFG for segment 0000 bus 00-ff
(XEN) AMD-Vi: IOMMU 0 Enabled.
(XEN) AMD-Vi: Enabling global vector map
(XEN) I/O virtualisation enabled
(XEN)  - Dom0 mode: Relaxed
(XEN) ENABLING IO-APIC IRQs
(XEN)  -> Using new ACK method
(XEN) ..TIMER: vector=0xF0 apic1=0 pin1=2 apic2=-1 pin2=-1
(XEN) Platform timer is 14.318MHz HPET
(XEN) Allocated console ring of 64 KiB.
(XEN) HVM: ASIDs enabled.
(XEN) SVM: Supported advanced features:
(XEN)  - Nested Page Tables (NPT)
(XEN)  - Last Branch Record (LBR) Virtualisation
(XEN)  - Next-RIP Saved on #VMEXIT
(XEN)  - VMCB Clean Bits
(XEN)  - DecodeAssists
(XEN)  - Pause-Intercept Filter
(XEN)  - TSC Rate MSR
(XEN) HVM: SVM enabled
(XEN) HVM: Hardware Assisted Paging (HAP) detected
(XEN) HVM: HAP page sizes: 4kB, 2MB, 1GB
(XEN) microcode: collect_cpu_info: patch_id=0x6000629
(XEN) microcode: collect_cpu_info: patch_id=0x6000629
(XEN) microcode: collect_cpu_info: patch_id=0x6000629
(XEN) microcode: collect_cpu_info: patch_id=0x6000629
(XEN) microcode: collect_cpu_info: patch_id=0x6000629
(XEN) microcode: collect_cpu_info: patch_id=0x6000629
(XEN) microcode: collect_cpu_info: patch_id=0x6000629
(XEN) Brought up 8 CPUs
(XEN) ACPI sleep modes: S3
(XEN) MCA: Use hw thresholding to adjust polling frequency
(XEN) mcheck_poll: Machine check polling timer started.
(XEN) mtrr: your CPUs had inconsistent fixed MTRR settings
(XEN) mtrr: probably your BIOS does not setup all CPUs.
(XEN) mtrr: corrected configuration.
(XEN) *** LOADING DOMAIN 0 ***
(XEN) elf_parse_binary: phdr: paddr=0x1000000 memsz=0xad4000
(XEN) elf_parse_binary: phdr: paddr=0x1c00000 memsz=0xe50e0
(XEN) elf_parse_binary: phdr: paddr=0x1ce6000 memsz=0x144c0
(XEN) elf_parse_binary: phdr: paddr=0x1cfb000 memsz=0x365000
(XEN) elf_parse_binary: memory: 0x1000000 -> 0x2060000
(XEN) elf_xen_parse_note: GUEST_OS = "linux"
(XEN) elf_xen_parse_note: GUEST_VERSION = "2.6"
(XEN) elf_xen_parse_note: XEN_VERSION = "xen-3.0"
(XEN) elf_xen_parse_note: VIRT_BASE = 0xffffffff80000000
(XEN) elf_xen_parse_note: ENTRY = 0xffffffff81cfb200
(XEN) elf_xen_parse_note: HYPERCALL_PAGE = 0xffffffff81001000
(XEN) elf_xen_parse_note: FEATURES =
"!writable_page_tables|pae_pgdir_above_4gb"
(XEN) elf_xen_parse_note: PAE_MODE = "yes"
(XEN) elf_xen_parse_note: LOADER = "generic"
(XEN) elf_xen_parse_note: unknown xen elf note (0xd)
(XEN) elf_xen_parse_note: SUSPEND_CANCEL = 0x1
(XEN) elf_xen_parse_note: HV_START_LOW = 0xffff800000000000
(XEN) elf_xen_parse_note: PADDR_OFFSET = 0x0
(XEN) elf_xen_addr_calc_check: addresses:
(XEN)     virt_base        = 0xffffffff80000000
(XEN)     elf_paddr_offset = 0x0
(XEN)     virt_offset      = 0xffffffff80000000
(XEN)     virt_kstart      = 0xffffffff81000000
(XEN)     virt_kend        = 0xffffffff82060000
(XEN)     virt_entry       = 0xffffffff81cfb200
(XEN)     p2m_base         = 0xffffffffffffffff
(XEN)  Xen  kernel: 64-bit, lsb, compat32
(XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x2060000
(XEN) PHYSICAL MEMORY ARRANGEMENT:
(XEN)  Dom0 alloc.:   0000000420000000->0000000428000000 (4038356 pages to
be allocated)
(XEN)  Init. ramdisk: 000000043c7e4000->000000043efff600
(XEN) VIRTUAL MEMORY ARRANGEMENT:
(XEN)  Loaded kernel: ffffffff81000000->ffffffff82060000
(XEN)  Init. ramdisk: ffffffff82060000->ffffffff8487b600
(XEN)  Phys-Mach map: ffffffff8487c000->ffffffff8679f780
(XEN)  Start info:    ffffffff867a0000->ffffffff867a04b4
(XEN)  Page tables:   ffffffff867a1000->ffffffff867da000
(XEN)  Boot stack:    ffffffff867da000->ffffffff867db000
(XEN)  TOTAL:         ffffffff80000000->ffffffff86c00000
(XEN)  ENTRY ADDRESS: ffffffff81cfb200
(XEN) Dom0 has maximum 8 VCPUs
(XEN) elf_load_binary: phdr 0 at 0xffffffff81000000 -> 0xffffffff81ad4000
(XEN) elf_load_binary: phdr 1 at 0xffffffff81c00000 -> 0xffffffff81ce50e0
(XEN) elf_load_binary: phdr 2 at 0xffffffff81ce6000 -> 0xffffffff81cfa4c0
(XEN) elf_load_binary: phdr 3 at 0xffffffff81cfb000 -> 0xffffffff81dd4000
(XEN) Scrubbing Free RAM: .done.
(XEN) Initial low memory virq threshold set at 0x4000 pages.
(XEN) Std. Loglevel: All
(XEN) Guest Loglevel: All
(XEN) Xen is relinquishing VGA console.
(XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input
to Xen)
(XEN) Freed 244kB init memory.
(XEN) traps.c:2486:d0 Domain attempted WRMSR 00000000c0010201 from
0x0000000000000000 to 0x000000000000abcd.
(XEN) PCI add device 0000:00:00.0
(XEN) PCI add device 0000:00:00.2
(XEN) PCI add device 0000:00:02.0
(XEN) PCI add device 0000:00:04.0
(XEN) PCI add device 0000:00:05.0
(XEN) PCI add device 0000:00:09.0
(XEN) PCI add device 0000:00:0a.0
(XEN) PCI add device 0000:00:0b.0
(XEN) PCI add device 0000:00:0d.0
(XEN) PCI add device 0000:00:11.0
(XEN) PCI add device 0000:00:12.0
(XEN) PCI add device 0000:00:12.2
(XEN) PCI add device 0000:00:13.0
(XEN) PCI add device 0000:00:13.2
(XEN) PCI add device 0000:00:14.0
(XEN) PCI add device 0000:00:14.2
(XEN) PCI add device 0000:00:14.3
(XEN) PCI add device 0000:00:14.4
(XEN) PCI add device 0000:00:14.5
(XEN) PCI add device 0000:00:15.0
(XEN) PCI add device 0000:00:15.1
(XEN) PCI add device 0000:00:15.2
(XEN) PCI add device 0000:00:15.3
(XEN) PCI add device 0000:00:16.0
(XEN) PCI add device 0000:00:16.2
(XEN) PCI add device 0000:00:18.0
(XEN) PCI add device 0000:00:18.1
(XEN) PCI add device 0000:00:18.2
(XEN) PCI add device 0000:00:18.3
(XEN) PCI add device 0000:00:18.4
(XEN) PCI add device 0000:00:18.5
(XEN) PCI add device 0000:01:00.0
(XEN) PCI add device 0000:01:00.1
(XEN) PCI add device 0000:02:00.0
(XEN) PCI add device 0000:03:00.0
(XEN) PCI add device 0000:04:00.0
(XEN) PCI add device 0000:06:00.0
(XEN) PCI add device 0000:06:00.1
(XEN) PCI add device 0000:0a:00.0
(XEN) PCI add device 0000:0b:00.0
(XEN) PCI add device 0000:0c:00.0
(XEN) memory.c:131:d0 Could not allocate order=18 extent: id=1 memflags=0
(0 of 1)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (3
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (1
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (0
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (0
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (0
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (0
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (0
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (0
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (0
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (0
of 4)
(XEN) memory.c:131:d0 Could not allocate order=9 extent: id=1 memflags=0 (0
of 4)
(XEN) memory.c:131:d0 Could not allocate order=0 extent: id=1 memflags=0
(582 of 2048)
(XEN) memory.c:131:d0 Could not allocate order=18 extent: id=2 memflags=0
(0 of 1)
(XEN) HVM2: HVM Loader
(XEN) HVM2: Detected Xen v4.3-unstable
(XEN) HVM2: Xenbus rings @0xfeffc000, event channel 8
(XEN) HVM2: System requested ROMBIOS
(XEN) HVM2: CPU speed is 3913 MHz
(XEN) irq.c:270: Dom2 PCI link 0 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:270: Dom2 PCI link 1 changed 0 -> 10
(XEN) HVM2: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:270: Dom2 PCI link 2 changed 0 -> 11
(XEN) HVM2: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:270: Dom2 PCI link 3 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 3 routed to IRQ5
(XEN) HVM2: pci dev 01:3 INTA->IRQ10
(XEN) HVM2: pci dev 03:0 INTA->IRQ5
(XEN) HVM2: pci dev 04:0 INTA->IRQ5
(XEN) HVM2: pci dev 05:0 INTA->IRQ10
(XEN) HVM2: pci dev 06:0 INTB->IRQ5
(XEN) HVM2: pci dev 05:0 bar 10 size lx: 10000000
(XEN) memory_map:add: dom2 gfn=e0000 mfn=c0000 nr=10000
(XEN) HVM2: pci dev 02:0 bar 10 size lx: 02000000
(XEN) HVM2: pci dev 03:0 bar 14 size lx: 01000000
(XEN) memory_map:add: dom2 gfn=f3000 mfn=fe300 nr=40
(XEN) HVM2: pci dev 05:0 bar 18 size lx: 00040000
(XEN) HVM2: pci dev 05:0 bar 30 size lx: 00020000
(XEN) HVM2: pci dev 06:0 bar 10 size lx: 00004000
(XEN) memory_map:add: dom2 gfn=f3060 mfn=fe360 nr=4
(XEN) HVM2: pci dev 02:0 bar 14 size lx: 00001000
(XEN) HVM2: pci dev 03:0 bar 10 size lx: 00000100
(XEN) HVM2: pci dev 04:0 bar 10 size lx: 00000100
(XEN) HVM2: pci dev 04:0 bar 14 size lx: 00000100
(XEN) HVM2: pci dev 05:0 bar 20 size lx: 00000100
(XEN) ioport_map:add: dom2 gport=c200 mport=b000 nr=100
(XEN) HVM2: pci dev 01:1 bar 20 size lx: 00000010
(XEN) HVM2: Multiprocessor initialisation:
(XEN) HVM2:  - CPU0 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2:  - CPU1 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2:  - CPU2 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2:  - CPU3 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2:  - CPU4 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2:  - CPU5 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2: Testing HVM environment:
(XEN) HVM2:  - REP INSB across page boundaries ... passed
(XEN) HVM2:  - GS base MSRs and SWAPGS ... passed
(XEN) HVM2: Passed 2 of 2 tests
(XEN) HVM2: Writing SMBIOS tables ...
(XEN) HVM2: Loading ROMBIOS ...
(XEN) HVM2: 12636 bytes of ROMBIOS high-memory extensions:
(XEN) HVM2:   Relocating to 0xfc001000-0xfc00415c ... done
(XEN) HVM2: Creating MP tables ...
(XEN) HVM2: Loading Cirrus VGABIOS ...
(XEN) HVM2: Loading PCI Option ROM ...
(XEN) HVM2:  - Manufacturer: http://ipxe.org
(XEN) HVM2:  - Product name: iPXE
(XEN) HVM2: Option ROMs:
(XEN) HVM2:  c0000-c8fff: VGA BIOS
(XEN) HVM2:  c9000-d8fff: Etherboot ROM
(XEN) HVM2: Loading ACPI ...
(XEN) HVM2: vm86 TSS at fc010280
(XEN) HVM2: BIOS map:
(XEN) HVM2:  f0000-fffff: Main BIOS
(XEN) HVM2: E820 table:
(XEN) HVM2:  [00]: 00000000:00000000 - 00000000:0009e000: RAM
(XEN) HVM2:  [01]: 00000000:0009e000 - 00000000:000a0000: RESERVED
(XEN) HVM2:  HOLE: 00000000:000a0000 - 00000000:000e0000
(XEN) HVM2:  [02]: 00000000:000e0000 - 00000000:00100000: RESERVED
(XEN) HVM2:  [03]: 00000000:00100000 - 00000000:e0000000: RAM
(XEN) HVM2:  HOLE: 00000000:e0000000 - 00000000:fc000000
(XEN) HVM2:  [04]: 00000000:fc000000 - 00000001:00000000: RESERVED
(XEN) HVM2:  [05]: 00000001:00000000 - 00000002:19800000: RAM
(XEN) HVM2: Invoking ROMBIOS ...
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) stdvga.c:147:d2 entering stdvga and caching modes
(XEN) HVM2: VGABios $Id: vgabios.c,v 1.67 2008/01/27 09:44:12 vruppert Exp $
(XEN) HVM2: Bochs BIOS - build: 06/23/99
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) HVM2: Options: apmbios pcibios eltorito PMM
(XEN) HVM2:
(XEN) HVM2: ata0-0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63
(XEN) HVM2: ata0 master: QEMU HARDDISK ATA-7 Hard-Disk ( 115 GBytes)
(XEN) HVM2: IDE time out
(XEN) HVM2:
(XEN) HVM2:
(XEN) HVM2:
(XEN) HVM2: Press F12 for boot menu.
(XEN) HVM2:
(XEN) HVM2: Booting from Hard Disk...
(XEN) HVM2: Booting from 0000:7c00
(XEN) stdvga.c:151:d2 leaving stdvga
(XEN) irq.c:270: Dom2 PCI link 0 changed 5 -> 0
(XEN) irq.c:270: Dom2 PCI link 1 changed 10 -> 0
(XEN) irq.c:270: Dom2 PCI link 2 changed 11 -> 0
(XEN) irq.c:270: Dom2 PCI link 3 changed 5 -> 0
(XEN) memory_map:remove: dom2 gfn=e0000 mfn=c0000 nr=10000
(XEN) memory_map:remove: dom2 gfn=f3000 mfn=fe300 nr=40
(XEN) ioport_map:remove: dom2 gport=c200 mport=b000 nr=100
(XEN) memory_map:add: dom2 gfn=e0000 mfn=c0000 nr=10000
(XEN) memory_map:add: dom2 gfn=f3000 mfn=fe300 nr=40
(XEN) ioport_map:add: dom2 gport=c200 mport=b000 nr=100
(XEN) memory_map:remove: dom2 gfn=f3060 mfn=fe360 nr=4
(XEN) memory_map:add: dom2 gfn=f3060 mfn=fe360 nr=4
(XEN) grant_table.c:1266:d2 Expanding dom (2) grant table from (4) to (32)
frames.
(XEN) irq.c:375: Dom2 callback via changed to GSI 28
(XEN) memory_map:remove: dom2 gfn=e0000 mfn=c0000 nr=10000
(XEN) memory_map:remove: dom2 gfn=f3000 mfn=fe300 nr=40
(XEN) ioport_map:remove: dom2 gport=c200 mport=b000 nr=100
(XEN) memory_map:add: dom2 gfn=e0000 mfn=c0000 nr=10000
(XEN) memory_map:add: dom2 gfn=f3000 mfn=fe300 nr=40
(XEN) ioport_map:add: dom2 gport=c200 mport=b000 nr=100
(XEN) memory_map:remove: dom2 gfn=f3060 mfn=fe360 nr=4
(XEN) memory_map:add: dom2 gfn=f3060 mfn=fe360 nr=4
(XEN) AMD-Vi: IO_PAGE_FAULT: domain = 2, device id = 0x600, fault address =
0x1ac800000, flags = 0



I've noticed this has already flown around the mailing list but I've only
recently subscribed and haven't seen a reply on previous posts about this
issue.  I apologise if I'm posting this erroneously.
-- 
_____
Fact:
1. Ninjas are mammals.
2. Ninjas fight ALL the time.
3. The purpose of the ninja is to flip out and kill people.

--20cf307f39968aba5704ce08063d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable. =A0Tested against all three.=
<div><br></div><div>VGA passthrough previously working with 4.1 is no longe=
r working with &gt;4.2.</div><div><br></div><div>Setup - Working:</div><div=
>
Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos), libvirt-bin, =
xend</div><div>Asus Radeon HD 7870 DirectCU.</div><div>Works perfect. =A0Be=
nches on par with bare metal.</div><div><br></div><div>Setup - Broken:</div=
>
<div>Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (from GIT), =
xl toolstack.</div><div><div>Asus Radeon HD 7870 DirectCU.</div></div><div>=
Some times the guest boots correctly but display is never enabled. =A0Somet=
imes BSOD, doesn&#39;t seem to be any rhyme or reason?</div>
<div><br></div><div>No errors in logs. =A0 Found the following in &#39;xl d=
mesg&#39;:</div><div>(XEN) AMD-Vi: IO_PAGE_FAULT: domain =3D 2, device id =
=3D 0x600, fault address =3D 0x1ac800000, flags =3D 0<br></div><div><div></=
div></div>
<div><div><br></div><div><br></div><div><br></div><div>Full &#39;xl dmesg&#=
39; output:</div><div><br></div><div>=A0__ =A0__ =A0 =A0 =A0 =A0 =A0 =A0_ =
=A0_ =A0 =A0_____ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0_ =A0 =A0 =A0 =A0_=
 =A0 =A0 _ =A0 =A0 =A0</div><div>=A0\ \/ /___ _ __ =A0 | || | =A0|___ / =A0=
 =A0_ =A0 _ _ __ =A0___| |_ __ _| |__ | | ___=A0</div>
<div>=A0 \ =A0// _ \ &#39;_ \ =A0| || |_ =A0 |_ \ __| | | | &#39;_ \/ __| _=
_/ _` | &#39;_ \| |/ _ \</div><div>=A0 / =A0\ =A0__/ | | | |__ =A0 _| ___) =
|__| |_| | | | \__ \ || (_| | |_) | | =A0__/</div><div>=A0/_/\_\___|_| |_| =
=A0 =A0|_|(_)____/ =A0 =A0\__,_|_| |_|___/\__\__,_|_.__/|_|\___|</div>
<div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0=A0</div><div>(XEN) Xen version 4.3-unstable (root@) (gcc (Ubuntu/Linar=
o 4.6.3-1ubuntu5) 4.6.3) Wed Nov =A07 21:13:35 PST 2012</div><div>(XEN) Lat=
est ChangeSet: unavailable</div>
<div>(XEN) Bootloader: GRUB 1.99-21ubuntu3.4</div><div>(XEN) Command line: =
xen-pciback=3Dpassthrough xen-pciback.hide=3D(06:00.0)(06.00.1)</div><div>(=
XEN) Video information:</div><div>(XEN) =A0VGA is text mode 80x25, font 8x1=
6</div>
<div>(XEN) =A0VBE/DDC methods: V2; EDID transfer time: 1 seconds</div><div>=
(XEN) Disc information:</div><div>(XEN) =A0Found 6 MBR signatures</div><div=
>(XEN) =A0Found 6 EDD information structures</div><div>(XEN) Xen-e820 RAM m=
ap:</div>
<div>(XEN) =A00000000000000000 - 000000000009e800 (usable)</div><div>(XEN) =
=A0000000000009e800 - 00000000000a0000 (reserved)</div><div>(XEN) =A0000000=
00000e0000 - 0000000000100000 (reserved)</div><div>(XEN) =A0000000000010000=
0 - 00000000bab4f000 (usable)</div>
<div>(XEN) =A000000000bab4f000 - 00000000baf83000 (reserved)</div><div>(XEN=
) =A000000000baf83000 - 00000000baf93000 (ACPI data)</div><div>(XEN) =A0000=
00000baf93000 - 00000000bbcfa000 (ACPI NVS)</div><div>(XEN) =A000000000bbcf=
a000 - 00000000bca4f000 (reserved)</div>
<div>(XEN) =A000000000bca4f000 - 00000000bca50000 (usable)</div><div>(XEN) =
=A000000000bca50000 - 00000000bcc56000 (ACPI NVS)</div><div>(XEN) =A0000000=
00bcc56000 - 00000000bd083000 (usable)</div><div>(XEN) =A000000000bd083000 =
- 00000000bd7f4000 (reserved)</div>
<div>(XEN) =A000000000bd7f4000 - 00000000bd800000 (usable)</div><div>(XEN) =
=A000000000f8000000 - 00000000fc000000 (reserved)</div><div>(XEN) =A0000000=
00fec00000 - 00000000fec01000 (reserved)</div><div>(XEN) =A000000000fec1000=
0 - 00000000fec11000 (reserved)</div>
<div>(XEN) =A000000000fec20000 - 00000000fec21000 (reserved)</div><div>(XEN=
) =A000000000fed00000 - 00000000fed01000 (reserved)</div><div>(XEN) =A00000=
0000fed61000 - 00000000fed71000 (reserved)</div><div>(XEN) =A000000000fed80=
000 - 00000000fed90000 (reserved)</div>
<div>(XEN) =A000000000fef00000 - 0000000100000000 (reserved)</div><div>(XEN=
) =A00000000100001000 - 000000043f000000 (usable)</div><div>(XEN) ACPI: RSD=
P 000F0490, 0024 (r2 ALASKA)</div><div>(XEN) ACPI: XSDT BAF89070, 005C (r1 =
ALASKA =A0 =A0A M I =A01072009 AMI =A0 =A0 10013)</div>
<div>(XEN) ACPI: FACP BAF90BF8, 010C (r5 ALASKA =A0 =A0A M I =A01072009 AMI=
 =A0 =A0 10013)</div><div>(XEN) ACPI Warning (tbfadt-0232): FADT (revision =
5) is longer than ACPI 2.0 version, truncating length 0x10C to 0xF4 [200701=
26]</div>
<div>(XEN) ACPI Warning (tbfadt-0444): Optional field &quot;Pm2ControlBlock=
&quot; has zero address or length: 0000000000000000/1 [20070126]</div><div>=
(XEN) ACPI: DSDT BAF89168, 7A8A (r2 ALASKA =A0 =A0A M I =A0 =A0 =A0 =A00 IN=
TL 20051117)</div>
<div>(XEN) ACPI: FACS BBCF4F80, 0040</div><div>(XEN) ACPI: APIC BAF90D08, 0=
09E (r3 ALASKA =A0 =A0A M I =A01072009 AMI =A0 =A0 10013)</div><div>(XEN) A=
CPI: FPDT BAF90DA8, 0044 (r1 ALASKA =A0 =A0A M I =A01072009 AMI =A0 =A0 100=
13)</div><div>(XEN) ACPI: MCFG BAF90DF0, 003C (r1 ALASKA =A0 =A0A M I =A010=
72009 MSFT =A0 =A010013)</div>
<div>(XEN) ACPI: HPET BAF90E30, 0038 (r1 ALASKA =A0 =A0A M I =A01072009 AMI=
 =A0 =A0 =A0 =A0 5)</div><div>(XEN) ACPI: SSDT BAF90FC0, 1714 (r1 AMD =A0 =
=A0POWERNOW =A0 =A0 =A0 =A01 AMD =A0 =A0 =A0 =A0 1)</div><div>(XEN) ACPI: I=
VRS BAF90EC0, 0100 (r1 =A0AMD =A0 =A0 RD890S =A0 202031 AMD =A0 =A0 =A0 =A0=
 0)</div>
<div>(XEN) System RAM: 16287MB (16678040kB)</div><div>(XEN) No NUMA configu=
ration found</div><div>(XEN) Faking a node at 0000000000000000-000000043f00=
0000</div><div>(XEN) Domain heap initialised</div><div>(XEN) DMI 2.7 presen=
t.</div>
<div>(XEN) Using APIC driver default</div><div>(XEN) ACPI: PM-Timer IO Port=
: 0x808</div><div>(XEN) ACPI: ACPI SLEEP INFO: pm1x_cnt[804,0], pm1x_evt[80=
0,0]</div><div>(XEN) ACPI: 32/64X FACS address mismatch in FADT - bbcf4f80/=
0000000000000000, using 32</div>
<div>(XEN) ACPI: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0wakeup_vec[bbcf4f8c], v=
ec_size[20]</div><div>(XEN) ACPI: Local APIC address 0xfee00000</div><div>(=
XEN) ACPI: LAPIC (acpi_id[0x01] lapic_id[0x10] enabled)</div><div>(XEN) Pro=
cessor #16 5:1 APIC version 16</div>
<div>(XEN) ACPI: LAPIC (acpi_id[0x02] lapic_id[0x11] enabled)</div><div>(XE=
N) Processor #17 5:1 APIC version 16</div><div>(XEN) ACPI: LAPIC (acpi_id[0=
x03] lapic_id[0x12] enabled)</div><div>(XEN) Processor #18 5:1 APIC version=
 16</div>
<div>(XEN) ACPI: LAPIC (acpi_id[0x04] lapic_id[0x13] enabled)</div><div>(XE=
N) Processor #19 5:1 APIC version 16</div><div>(XEN) ACPI: LAPIC (acpi_id[0=
x05] lapic_id[0x14] enabled)</div><div>(XEN) Processor #20 5:1 APIC version=
 16</div>
<div>(XEN) ACPI: LAPIC (acpi_id[0x06] lapic_id[0x15] enabled)</div><div>(XE=
N) Processor #21 5:1 APIC version 16</div><div>(XEN) ACPI: LAPIC (acpi_id[0=
x07] lapic_id[0x16] enabled)</div><div>(XEN) Processor #22 5:1 APIC version=
 16</div>
<div>(XEN) ACPI: LAPIC (acpi_id[0x08] lapic_id[0x17] enabled)</div><div>(XE=
N) Processor #23 5:1 APIC version 16</div><div>(XEN) ACPI: LAPIC_NMI (acpi_=
id[0xff] high edge lint[0x1])</div><div>(XEN) ACPI: IOAPIC (id[0x09] addres=
s[0xfec00000] gsi_base[0])</div>
<div>(XEN) IOAPIC[0]: apic_id 9, version 33, address 0xfec00000, GSI 0-23</=
div><div>(XEN) ACPI: IOAPIC (id[0x0a] address[0xfec20000] gsi_base[24])</di=
v><div>(XEN) IOAPIC[1]: apic_id 10, version 33, address 0xfec20000, GSI 24-=
55</div>
<div>(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)</div><d=
iv>(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)</div><d=
iv>(XEN) ACPI: IRQ0 used by override.</div><div>(XEN) ACPI: IRQ2 used by ov=
erride.</div>
<div>(XEN) ACPI: IRQ9 used by override.</div><div>(XEN) Enabling APIC mode:=
 =A0Flat. =A0Using 2 I/O APICs</div><div>(XEN) ACPI: HPET id: 0x43538210 ba=
se: 0xfed00000</div><div>(XEN) Table is not found!</div><div>(XEN) Using AC=
PI (MADT) for SMP configuration information</div>
<div>(XEN) SMP: Allowing 8 CPUs (0 hotplug CPUs)</div><div>(XEN) IRQ limits=
: 56 GSI, 1496 MSI/MSI-X</div><div>(XEN) Using scheduler: SMP Credit Schedu=
ler (credit)</div><div>(XEN) Detected 3913.302 MHz processor.</div><div>
(XEN) Initing memory sharing.</div><div>(XEN) xstate_init: using cntxt_size=
: 0x3c0 and states: 0x4000000000000007</div><div>(XEN) AMD Fam15h machine c=
heck reporting enabled</div><div>(XEN) PCI: MCFG configuration 0: base e000=
0000 segment 0000 buses 00 - ff</div>
<div>(XEN) PCI: Not using MCFG for segment 0000 bus 00-ff</div><div>(XEN) A=
MD-Vi: IOMMU 0 Enabled.</div><div>(XEN) AMD-Vi: Enabling global vector map<=
/div><div>(XEN) I/O virtualisation enabled</div><div>(XEN) =A0- Dom0 mode: =
Relaxed</div>
<div>(XEN) ENABLING IO-APIC IRQs</div><div>(XEN) =A0-&gt; Using new ACK met=
hod</div><div>(XEN) ..TIMER: vector=3D0xF0 apic1=3D0 pin1=3D2 apic2=3D-1 pi=
n2=3D-1</div><div>(XEN) Platform timer is 14.318MHz HPET</div><div>(XEN) Al=
located console ring of 64 KiB.</div>
<div>(XEN) HVM: ASIDs enabled.</div><div>(XEN) SVM: Supported advanced feat=
ures:</div><div>(XEN) =A0- Nested Page Tables (NPT)</div><div>(XEN) =A0- La=
st Branch Record (LBR) Virtualisation</div><div>(XEN) =A0- Next-RIP Saved o=
n #VMEXIT</div>
<div>(XEN) =A0- VMCB Clean Bits</div><div>(XEN) =A0- DecodeAssists</div><di=
v>(XEN) =A0- Pause-Intercept Filter</div><div>(XEN) =A0- TSC Rate MSR</div>=
<div>(XEN) HVM: SVM enabled</div><div>(XEN) HVM: Hardware Assisted Paging (=
HAP) detected</div>
<div>(XEN) HVM: HAP page sizes: 4kB, 2MB, 1GB</div><div>(XEN) microcode: co=
llect_cpu_info: patch_id=3D0x6000629</div><div>(XEN) microcode: collect_cpu=
_info: patch_id=3D0x6000629</div><div>(XEN) microcode: collect_cpu_info: pa=
tch_id=3D0x6000629</div>
<div>(XEN) microcode: collect_cpu_info: patch_id=3D0x6000629</div><div>(XEN=
) microcode: collect_cpu_info: patch_id=3D0x6000629</div><div>(XEN) microco=
de: collect_cpu_info: patch_id=3D0x6000629</div><div>(XEN) microcode: colle=
ct_cpu_info: patch_id=3D0x6000629</div>
<div>(XEN) Brought up 8 CPUs</div><div>(XEN) ACPI sleep modes: S3</div><div=
>(XEN) MCA: Use hw thresholding to adjust polling frequency</div><div>(XEN)=
 mcheck_poll: Machine check polling timer started.</div><div>(XEN) mtrr: yo=
ur CPUs had inconsistent fixed MTRR settings</div>
<div>(XEN) mtrr: probably your BIOS does not setup all CPUs.</div><div>(XEN=
) mtrr: corrected configuration.</div><div>(XEN) *** LOADING DOMAIN 0 ***</=
div><div>(XEN) elf_parse_binary: phdr: paddr=3D0x1000000 memsz=3D0xad4000</=
div>
<div>(XEN) elf_parse_binary: phdr: paddr=3D0x1c00000 memsz=3D0xe50e0</div><=
div>(XEN) elf_parse_binary: phdr: paddr=3D0x1ce6000 memsz=3D0x144c0</div><d=
iv>(XEN) elf_parse_binary: phdr: paddr=3D0x1cfb000 memsz=3D0x365000</div><d=
iv>(XEN) elf_parse_binary: memory: 0x1000000 -&gt; 0x2060000</div>
<div>(XEN) elf_xen_parse_note: GUEST_OS =3D &quot;linux&quot;</div><div>(XE=
N) elf_xen_parse_note: GUEST_VERSION =3D &quot;2.6&quot;</div><div>(XEN) el=
f_xen_parse_note: XEN_VERSION =3D &quot;xen-3.0&quot;</div><div>(XEN) elf_x=
en_parse_note: VIRT_BASE =3D 0xffffffff80000000</div>
<div>(XEN) elf_xen_parse_note: ENTRY =3D 0xffffffff81cfb200</div><div>(XEN)=
 elf_xen_parse_note: HYPERCALL_PAGE =3D 0xffffffff81001000</div><div>(XEN) =
elf_xen_parse_note: FEATURES =3D &quot;!writable_page_tables|pae_pgdir_abov=
e_4gb&quot;</div>
<div>(XEN) elf_xen_parse_note: PAE_MODE =3D &quot;yes&quot;</div><div>(XEN)=
 elf_xen_parse_note: LOADER =3D &quot;generic&quot;</div><div>(XEN) elf_xen=
_parse_note: unknown xen elf note (0xd)</div><div>(XEN) elf_xen_parse_note:=
 SUSPEND_CANCEL =3D 0x1</div>
<div>(XEN) elf_xen_parse_note: HV_START_LOW =3D 0xffff800000000000</div><di=
v>(XEN) elf_xen_parse_note: PADDR_OFFSET =3D 0x0</div><div>(XEN) elf_xen_ad=
dr_calc_check: addresses:</div><div>(XEN) =A0 =A0 virt_base =A0 =A0 =A0 =A0=
=3D 0xffffffff80000000</div>
<div>(XEN) =A0 =A0 elf_paddr_offset =3D 0x0</div><div>(XEN) =A0 =A0 virt_of=
fset =A0 =A0 =A0=3D 0xffffffff80000000</div><div>(XEN) =A0 =A0 virt_kstart =
=A0 =A0 =A0=3D 0xffffffff81000000</div><div>(XEN) =A0 =A0 virt_kend =A0 =A0=
 =A0 =A0=3D 0xffffffff82060000</div><div>
(XEN) =A0 =A0 virt_entry =A0 =A0 =A0 =3D 0xffffffff81cfb200</div><div>(XEN)=
 =A0 =A0 p2m_base =A0 =A0 =A0 =A0 =3D 0xffffffffffffffff</div><div>(XEN) =
=A0Xen =A0kernel: 64-bit, lsb, compat32</div><div>(XEN) =A0Dom0 kernel: 64-=
bit, PAE, lsb, paddr 0x1000000 -&gt; 0x2060000</div>
<div>(XEN) PHYSICAL MEMORY ARRANGEMENT:</div><div>(XEN) =A0Dom0 alloc.: =A0=
 0000000420000000-&gt;0000000428000000 (4038356 pages to be allocated)</div=
><div>(XEN) =A0Init. ramdisk: 000000043c7e4000-&gt;000000043efff600</div><d=
iv>
(XEN) VIRTUAL MEMORY ARRANGEMENT:</div><div>(XEN) =A0Loaded kernel: fffffff=
f81000000-&gt;ffffffff82060000</div><div>(XEN) =A0Init. ramdisk: ffffffff82=
060000-&gt;ffffffff8487b600</div><div>(XEN) =A0Phys-Mach map: ffffffff8487c=
000-&gt;ffffffff8679f780</div>
<div>(XEN) =A0Start info: =A0 =A0ffffffff867a0000-&gt;ffffffff867a04b4</div=
><div>(XEN) =A0Page tables: =A0 ffffffff867a1000-&gt;ffffffff867da000</div>=
<div>(XEN) =A0Boot stack: =A0 =A0ffffffff867da000-&gt;ffffffff867db000</div=
><div>(XEN) =A0TOTAL: =A0 =A0 =A0 =A0 ffffffff80000000-&gt;ffffffff86c00000=
</div>
<div>(XEN) =A0ENTRY ADDRESS: ffffffff81cfb200</div><div>(XEN) Dom0 has maxi=
mum 8 VCPUs</div><div>(XEN) elf_load_binary: phdr 0 at 0xffffffff81000000 -=
&gt; 0xffffffff81ad4000</div><div>(XEN) elf_load_binary: phdr 1 at 0xffffff=
ff81c00000 -&gt; 0xffffffff81ce50e0</div>
<div>(XEN) elf_load_binary: phdr 2 at 0xffffffff81ce6000 -&gt; 0xffffffff81=
cfa4c0</div><div>(XEN) elf_load_binary: phdr 3 at 0xffffffff81cfb000 -&gt; =
0xffffffff81dd4000</div><div>(XEN) Scrubbing Free RAM: .done.</div><div>
(XEN) Initial low memory virq threshold set at 0x4000 pages.</div><div>(XEN=
) Std. Loglevel: All</div><div>(XEN) Guest Loglevel: All</div><div>(XEN) Xe=
n is relinquishing VGA console.</div><div>(XEN) *** Serial input -&gt; DOM0=
 (type &#39;CTRL-a&#39; three times to switch input to Xen)</div>
<div>(XEN) Freed 244kB init memory.</div><div>(XEN) traps.c:2486:d0 Domain =
attempted WRMSR 00000000c0010201 from 0x0000000000000000 to 0x000000000000a=
bcd.</div><div>(XEN) PCI add device 0000:00:00.0</div><div>(XEN) PCI add de=
vice 0000:00:00.2</div>
<div>(XEN) PCI add device 0000:00:02.0</div><div>(XEN) PCI add device 0000:=
00:04.0</div><div>(XEN) PCI add device 0000:00:05.0</div><div>(XEN) PCI add=
 device 0000:00:09.0</div><div>(XEN) PCI add device 0000:00:0a.0</div><div>
(XEN) PCI add device 0000:00:0b.0</div><div>(XEN) PCI add device 0000:00:0d=
.0</div><div>(XEN) PCI add device 0000:00:11.0</div><div>(XEN) PCI add devi=
ce 0000:00:12.0</div><div>(XEN) PCI add device 0000:00:12.2</div><div>(XEN)=
 PCI add device 0000:00:13.0</div>
<div>(XEN) PCI add device 0000:00:13.2</div><div>(XEN) PCI add device 0000:=
00:14.0</div><div>(XEN) PCI add device 0000:00:14.2</div><div>(XEN) PCI add=
 device 0000:00:14.3</div><div>(XEN) PCI add device 0000:00:14.4</div><div>
(XEN) PCI add device 0000:00:14.5</div><div>(XEN) PCI add device 0000:00:15=
.0</div><div>(XEN) PCI add device 0000:00:15.1</div><div>(XEN) PCI add devi=
ce 0000:00:15.2</div><div>(XEN) PCI add device 0000:00:15.3</div><div>(XEN)=
 PCI add device 0000:00:16.0</div>
<div>(XEN) PCI add device 0000:00:16.2</div><div>(XEN) PCI add device 0000:=
00:18.0</div><div>(XEN) PCI add device 0000:00:18.1</div><div>(XEN) PCI add=
 device 0000:00:18.2</div><div>(XEN) PCI add device 0000:00:18.3</div><div>
(XEN) PCI add device 0000:00:18.4</div><div>(XEN) PCI add device 0000:00:18=
.5</div><div>(XEN) PCI add device 0000:01:00.0</div><div>(XEN) PCI add devi=
ce 0000:01:00.1</div><div>(XEN) PCI add device 0000:02:00.0</div><div>(XEN)=
 PCI add device 0000:03:00.0</div>
<div>(XEN) PCI add device 0000:04:00.0</div><div>(XEN) PCI add device 0000:=
06:00.0</div><div>(XEN) PCI add device 0000:06:00.1</div><div>(XEN) PCI add=
 device 0000:0a:00.0</div><div>(XEN) PCI add device 0000:0b:00.0</div><div>
(XEN) PCI add device 0000:0c:00.0</div><div>(XEN) memory.c:131:d0 Could not=
 allocate order=3D18 extent: id=3D1 memflags=3D0 (0 of 1)</div><div>(XEN) m=
emory.c:131:d0 Could not allocate order=3D9 extent: id=3D1 memflags=3D0 (3 =
of 4)</div>
<div>(XEN) memory.c:131:d0 Could not allocate order=3D9 extent: id=3D1 memf=
lags=3D0 (1 of 4)</div><div>(XEN) memory.c:131:d0 Could not allocate order=
=3D9 extent: id=3D1 memflags=3D0 (0 of 4)</div><div>(XEN) memory.c:131:d0 C=
ould not allocate order=3D9 extent: id=3D1 memflags=3D0 (0 of 4)</div>
<div>(XEN) memory.c:131:d0 Could not allocate order=3D9 extent: id=3D1 memf=
lags=3D0 (0 of 4)</div><div>(XEN) memory.c:131:d0 Could not allocate order=
=3D9 extent: id=3D1 memflags=3D0 (0 of 4)</div><div>(XEN) memory.c:131:d0 C=
ould not allocate order=3D9 extent: id=3D1 memflags=3D0 (0 of 4)</div>
<div>(XEN) memory.c:131:d0 Could not allocate order=3D9 extent: id=3D1 memf=
lags=3D0 (0 of 4)</div><div>(XEN) memory.c:131:d0 Could not allocate order=
=3D9 extent: id=3D1 memflags=3D0 (0 of 4)</div><div>(XEN) memory.c:131:d0 C=
ould not allocate order=3D9 extent: id=3D1 memflags=3D0 (0 of 4)</div>
<div>(XEN) memory.c:131:d0 Could not allocate order=3D9 extent: id=3D1 memf=
lags=3D0 (0 of 4)</div><div>(XEN) memory.c:131:d0 Could not allocate order=
=3D0 extent: id=3D1 memflags=3D0 (582 of 2048)</div><div>(XEN) memory.c:131=
:d0 Could not allocate order=3D18 extent: id=3D2 memflags=3D0 (0 of 1)</div=
>
<div>(XEN) HVM2: HVM Loader</div><div>(XEN) HVM2: Detected Xen v4.3-unstabl=
e</div><div>(XEN) HVM2: Xenbus rings @0xfeffc000, event channel 8</div><div=
>(XEN) HVM2: System requested ROMBIOS</div><div>(XEN) HVM2: CPU speed is 39=
13 MHz</div>
<div>(XEN) irq.c:270: Dom2 PCI link 0 changed 0 -&gt; 5</div><div>(XEN) HVM=
2: PCI-ISA link 0 routed to IRQ5</div><div>(XEN) irq.c:270: Dom2 PCI link 1=
 changed 0 -&gt; 10</div><div>(XEN) HVM2: PCI-ISA link 1 routed to IRQ10</d=
iv>
<div>(XEN) irq.c:270: Dom2 PCI link 2 changed 0 -&gt; 11</div><div>(XEN) HV=
M2: PCI-ISA link 2 routed to IRQ11</div><div>(XEN) irq.c:270: Dom2 PCI link=
 3 changed 0 -&gt; 5</div><div>(XEN) HVM2: PCI-ISA link 3 routed to IRQ5</d=
iv>
<div>(XEN) HVM2: pci dev 01:3 INTA-&gt;IRQ10</div><div>(XEN) HVM2: pci dev =
03:0 INTA-&gt;IRQ5</div><div>(XEN) HVM2: pci dev 04:0 INTA-&gt;IRQ5</div><d=
iv>(XEN) HVM2: pci dev 05:0 INTA-&gt;IRQ10</div><div>(XEN) HVM2: pci dev 06=
:0 INTB-&gt;IRQ5</div>
<div>(XEN) HVM2: pci dev 05:0 bar 10 size lx: 10000000</div><div>(XEN) memo=
ry_map:add: dom2 gfn=3De0000 mfn=3Dc0000 nr=3D10000</div><div>(XEN) HVM2: p=
ci dev 02:0 bar 10 size lx: 02000000</div><div>(XEN) HVM2: pci dev 03:0 bar=
 14 size lx: 01000000</div>
<div>(XEN) memory_map:add: dom2 gfn=3Df3000 mfn=3Dfe300 nr=3D40</div><div>(=
XEN) HVM2: pci dev 05:0 bar 18 size lx: 00040000</div><div>(XEN) HVM2: pci =
dev 05:0 bar 30 size lx: 00020000</div><div>(XEN) HVM2: pci dev 06:0 bar 10=
 size lx: 00004000</div>
<div>(XEN) memory_map:add: dom2 gfn=3Df3060 mfn=3Dfe360 nr=3D4</div><div>(X=
EN) HVM2: pci dev 02:0 bar 14 size lx: 00001000</div><div>(XEN) HVM2: pci d=
ev 03:0 bar 10 size lx: 00000100</div><div>(XEN) HVM2: pci dev 04:0 bar 10 =
size lx: 00000100</div>
<div>(XEN) HVM2: pci dev 04:0 bar 14 size lx: 00000100</div><div>(XEN) HVM2=
: pci dev 05:0 bar 20 size lx: 00000100</div><div>(XEN) ioport_map:add: dom=
2 gport=3Dc200 mport=3Db000 nr=3D100</div><div>(XEN) HVM2: pci dev 01:1 bar=
 20 size lx: 00000010</div>
<div>(XEN) HVM2: Multiprocessor initialisation:</div><div>(XEN) HVM2: =A0- =
CPU0 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3/8] ... done.</div><di=
v>(XEN) HVM2: =A0- CPU1 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3/8]=
 ... done.</div>
<div>(XEN) HVM2: =A0- CPU2 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3=
/8] ... done.</div><div>(XEN) HVM2: =A0- CPU3 ... 48-bit phys ... fixed MTR=
Rs ... var MTRRs [3/8] ... done.</div><div>(XEN) HVM2: =A0- CPU4 ... 48-bit=
 phys ... fixed MTRRs ... var MTRRs [3/8] ... done.</div>
<div>(XEN) HVM2: =A0- CPU5 ... 48-bit phys ... fixed MTRRs ... var MTRRs [3=
/8] ... done.</div><div>(XEN) HVM2: Testing HVM environment:</div><div>(XEN=
) HVM2: =A0- REP INSB across page boundaries ... passed</div><div>(XEN) HVM=
2: =A0- GS base MSRs and SWAPGS ... passed</div>
<div>(XEN) HVM2: Passed 2 of 2 tests</div><div>(XEN) HVM2: Writing SMBIOS t=
ables ...</div><div>(XEN) HVM2: Loading ROMBIOS ...</div><div>(XEN) HVM2: 1=
2636 bytes of ROMBIOS high-memory extensions:</div><div>(XEN) HVM2: =A0 Rel=
ocating to 0xfc001000-0xfc00415c ... done</div>
<div>(XEN) HVM2: Creating MP tables ...</div><div>(XEN) HVM2: Loading Cirru=
s VGABIOS ...</div><div>(XEN) HVM2: Loading PCI Option ROM ...</div><div>(X=
EN) HVM2: =A0- Manufacturer: <a href=3D"http://ipxe.org">http://ipxe.org</a=
></div>
<div>(XEN) HVM2: =A0- Product name: iPXE</div><div>(XEN) HVM2: Option ROMs:=
</div><div>(XEN) HVM2: =A0c0000-c8fff: VGA BIOS</div><div>(XEN) HVM2: =A0c9=
000-d8fff: Etherboot ROM</div><div>(XEN) HVM2: Loading ACPI ...</div><div>(=
XEN) HVM2: vm86 TSS at fc010280</div>
<div>(XEN) HVM2: BIOS map:</div><div>(XEN) HVM2: =A0f0000-fffff: Main BIOS<=
/div><div>(XEN) HVM2: E820 table:</div><div>(XEN) HVM2: =A0[00]: 00000000:0=
0000000 - 00000000:0009e000: RAM</div><div>(XEN) HVM2: =A0[01]: 00000000:00=
09e000 - 00000000:000a0000: RESERVED</div>
<div>(XEN) HVM2: =A0HOLE: 00000000:000a0000 - 00000000:000e0000</div><div>(=
XEN) HVM2: =A0[02]: 00000000:000e0000 - 00000000:00100000: RESERVED</div><d=
iv>(XEN) HVM2: =A0[03]: 00000000:00100000 - 00000000:e0000000: RAM</div><di=
v>
(XEN) HVM2: =A0HOLE: 00000000:e0000000 - 00000000:fc000000</div><div>(XEN) =
HVM2: =A0[04]: 00000000:fc000000 - 00000001:00000000: RESERVED</div><div>(X=
EN) HVM2: =A0[05]: 00000001:00000000 - 00000002:19800000: RAM</div><div>(XE=
N) HVM2: Invoking ROMBIOS ...</div>
<div>(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $</div><div>=
(XEN) stdvga.c:147:d2 entering stdvga and caching modes</div><div>(XEN) HVM=
2: VGABios $Id: vgabios.c,v 1.67 2008/01/27 09:44:12 vruppert Exp $</div>
<div>(XEN) HVM2: Bochs BIOS - build: 06/23/99</div><div>(XEN) HVM2: $Revisi=
on: 1.221 $ $Date: 2008/12/07 17:32:29 $</div><div>(XEN) HVM2: Options: apm=
bios pcibios eltorito PMM=A0</div><div>(XEN) HVM2:=A0</div><div>(XEN) HVM2:=
 ata0-0: PCHS=3D16383/16/63 translation=3Dlba LCHS=3D1024/255/63</div>
<div>(XEN) HVM2: ata0 master: QEMU HARDDISK ATA-7 Hard-Disk ( 115 GBytes)</=
div><div>(XEN) HVM2: IDE time out</div><div>(XEN) HVM2:=A0</div><div>(XEN) =
HVM2:=A0</div><div>(XEN) HVM2:=A0</div><div>(XEN) HVM2: Press F12 for boot =
menu.</div>
<div>(XEN) HVM2:=A0</div><div>(XEN) HVM2: Booting from Hard Disk...</div><d=
iv>(XEN) HVM2: Booting from 0000:7c00</div><div>(XEN) stdvga.c:151:d2 leavi=
ng stdvga</div><div>(XEN) irq.c:270: Dom2 PCI link 0 changed 5 -&gt; 0</div=
>
<div>(XEN) irq.c:270: Dom2 PCI link 1 changed 10 -&gt; 0</div><div>(XEN) ir=
q.c:270: Dom2 PCI link 2 changed 11 -&gt; 0</div><div>(XEN) irq.c:270: Dom2=
 PCI link 3 changed 5 -&gt; 0</div><div>(XEN) memory_map:remove: dom2 gfn=
=3De0000 mfn=3Dc0000 nr=3D10000</div>
<div>(XEN) memory_map:remove: dom2 gfn=3Df3000 mfn=3Dfe300 nr=3D40</div><di=
v>(XEN) ioport_map:remove: dom2 gport=3Dc200 mport=3Db000 nr=3D100</div><di=
v>(XEN) memory_map:add: dom2 gfn=3De0000 mfn=3Dc0000 nr=3D10000</div><div>(=
XEN) memory_map:add: dom2 gfn=3Df3000 mfn=3Dfe300 nr=3D40</div>
<div>(XEN) ioport_map:add: dom2 gport=3Dc200 mport=3Db000 nr=3D100</div><di=
v>(XEN) memory_map:remove: dom2 gfn=3Df3060 mfn=3Dfe360 nr=3D4</div><div>(X=
EN) memory_map:add: dom2 gfn=3Df3060 mfn=3Dfe360 nr=3D4</div><div>(XEN) gra=
nt_table.c:1266:d2 Expanding dom (2) grant table from (4) to (32) frames.</=
div>
<div>(XEN) irq.c:375: Dom2 callback via changed to GSI 28</div><div>(XEN) m=
emory_map:remove: dom2 gfn=3De0000 mfn=3Dc0000 nr=3D10000</div><div>(XEN) m=
emory_map:remove: dom2 gfn=3Df3000 mfn=3Dfe300 nr=3D40</div><div>(XEN) iopo=
rt_map:remove: dom2 gport=3Dc200 mport=3Db000 nr=3D100</div>
<div>(XEN) memory_map:add: dom2 gfn=3De0000 mfn=3Dc0000 nr=3D10000</div><di=
v>(XEN) memory_map:add: dom2 gfn=3Df3000 mfn=3Dfe300 nr=3D40</div><div>(XEN=
) ioport_map:add: dom2 gport=3Dc200 mport=3Db000 nr=3D100</div><div>(XEN) m=
emory_map:remove: dom2 gfn=3Df3060 mfn=3Dfe360 nr=3D4</div>
<div>(XEN) memory_map:add: dom2 gfn=3Df3060 mfn=3Dfe360 nr=3D4</div><div>(X=
EN) AMD-Vi: IO_PAGE_FAULT: domain =3D 2, device id =3D 0x600, fault address=
 =3D 0x1ac800000, flags =3D 0</div><div><div><br></div><div><br></div><div>=
<br></div>
<div>I&#39;ve noticed this has already flown around the mailing list but I&=
#39;ve only recently subscribed and haven&#39;t seen a reply on previous po=
sts about this issue. =A0I apologise if I&#39;m posting this erroneously.</=
div>
-- <br>_____<br>Fact:<br>1. Ninjas are mammals.<br>2. Ninjas fight ALL the =
time.<br>3. The purpose of the ninja is to flip out and kill people.<br>
</div></div>

--20cf307f39968aba5704ce08063d--


--===============5534640562881894256==
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.xen.org
http://lists.xen.org/xen-devel

--===============5534640562881894256==--


From xen-devel-bounces@lists.xen.org Fri Nov 09 05:45:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 05:45:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWhOk-0007Th-Bp; Fri, 09 Nov 2012 05:44:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TWhOj-0007Tc-B0
	for xen-devel@lists.xensource.com; Fri, 09 Nov 2012 05:44:57 +0000
Received: from [85.158.138.51:10427] by server-10.bemta-3.messagelabs.com id
	36/6D-19806-8589C905; Fri, 09 Nov 2012 05:44:56 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1352439895!29268521!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTc5OTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10643 invoked from network); 9 Nov 2012 05:44:56 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 05:44:56 -0000
X-IronPort-AV: E=Sophos;i="4.80,743,1344211200"; d="scan'208";a="15687677"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	09 Nov 2012 05:44:31 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 9 Nov 2012 05:44:30 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TWhOJ-0003Y9-7U;
	Fri, 09 Nov 2012 05:44:31 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TWhOI-000692-Ow;
	Fri, 09 Nov 2012 05:44:30 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14376-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 9 Nov 2012 05:44:30 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14376: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14376 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14376/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-xl-winxpsp3-vcpus1 12 guest-localmigrate/x10 fail pass in 14375

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14375
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14375
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14375
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14375

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop      fail in 14375 never pass

version targeted for testing:
 xen                  62885b3c34c8
baseline version:
 xen                  62885b3c34c8

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 05:45:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 05:45:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWhOk-0007Th-Bp; Fri, 09 Nov 2012 05:44:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TWhOj-0007Tc-B0
	for xen-devel@lists.xensource.com; Fri, 09 Nov 2012 05:44:57 +0000
Received: from [85.158.138.51:10427] by server-10.bemta-3.messagelabs.com id
	36/6D-19806-8589C905; Fri, 09 Nov 2012 05:44:56 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1352439895!29268521!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTc5OTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10643 invoked from network); 9 Nov 2012 05:44:56 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 05:44:56 -0000
X-IronPort-AV: E=Sophos;i="4.80,743,1344211200"; d="scan'208";a="15687677"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	09 Nov 2012 05:44:31 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 9 Nov 2012 05:44:30 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TWhOJ-0003Y9-7U;
	Fri, 09 Nov 2012 05:44:31 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TWhOI-000692-Ow;
	Fri, 09 Nov 2012 05:44:30 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14376-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 9 Nov 2012 05:44:30 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14376: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14376 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14376/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-xl-winxpsp3-vcpus1 12 guest-localmigrate/x10 fail pass in 14375

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14375
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14375
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14375
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14375

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop      fail in 14375 never pass

version targeted for testing:
 xen                  62885b3c34c8
baseline version:
 xen                  62885b3c34c8

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 07:52:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 07:52:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWjND-0000P1-A9; Fri, 09 Nov 2012 07:51:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kouya@jp.fujitsu.com>) id 1TWjNB-0000Ow-GN
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 07:51:29 +0000
Received: from [85.158.143.99:19247] by server-2.bemta-4.messagelabs.com id
	70/99-28922-006BC905; Fri, 09 Nov 2012 07:51:28 +0000
X-Env-Sender: kouya@jp.fujitsu.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1352447486!18035929!1
X-Originating-IP: [192.51.44.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjUxLjQ0LjM2ID0+IDM3MDE1\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4022 invoked from network); 9 Nov 2012 07:51:28 -0000
Received: from fgwmail6.fujitsu.co.jp (HELO fgwmail6.fujitsu.co.jp)
	(192.51.44.36)
	by server-16.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 9 Nov 2012 07:51:28 -0000
Received: from m1.gw.fujitsu.co.jp (unknown [10.0.50.71])
	by fgwmail6.fujitsu.co.jp (Postfix) with ESMTP id 80D2B3EE0B5
	for <xen-devel@lists.xen.org>; Fri,  9 Nov 2012 16:51:24 +0900 (JST)
Received: from smail (m1 [127.0.0.1])
	by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 6704D45DE63
	for <xen-devel@lists.xen.org>; Fri,  9 Nov 2012 16:51:24 +0900 (JST)
Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91])
	by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 5115045DE61
	for <xen-devel@lists.xen.org>; Fri,  9 Nov 2012 16:51:24 +0900 (JST)
Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1])
	by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 4249B1DB804E
	for <xen-devel@lists.xen.org>; Fri,  9 Nov 2012 16:51:24 +0900 (JST)
Received: from g01jpexchyt30.g01.fujitsu.local
	(g01jpexchyt30.g01.fujitsu.local [10.128.193.113])
	by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id EBFEF1DB8043
	for <xen-devel@lists.xen.org>; Fri,  9 Nov 2012 16:51:23 +0900 (JST)
Received: from [10.33.110.234] (10.33.110.234) by
	g01jpexchyt30.g01.fujitsu.local (10.128.193.113) with Microsoft SMTP
	Server (TLS) id 14.2.309.2; Fri, 9 Nov 2012 16:51:18 +0900
Message-ID: <509CB5FB.7020404@jp.fujitsu.com>
Date: Fri, 9 Nov 2012 16:51:23 +0900
From: Kouya Shimura <kouya@jp.fujitsu.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
Content-Type: multipart/mixed; boundary="------------090302050800080606010606"
X-Originating-IP: [10.33.110.234]
Subject: [Xen-devel] [PATCH] libxl: fix reboot failure of migrated domain
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--------------090302050800080606010606
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
Content-Transfer-Encoding: 7bit

The same problem was once fixed by c/s 23878:59c7213b5949
but c/s 25344:0f3b1e13d6af broke it.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>


--------------090302050800080606010606
Content-Type: text/x-patch; name="fix_reboot.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="fix_reboot.patch"

diff -r 62885b3c34c8 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Nov 08 17:58:19 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Fri Nov 09 16:11:04 2012 +0900
@@ -1927,7 +1927,7 @@ start:
          * On subsequent reboot etc we should create the domain, not
          * restore/migrate-receive it again.
          */
-        restore_file = NULL;
+        restoring = 0;
     }else{
         ret = libxl_domain_create_new(ctx, &d_config, &domid,
                                       0, autoconnect_console_how);

--------------090302050800080606010606
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.xen.org
http://lists.xen.org/xen-devel

--------------090302050800080606010606--


From xen-devel-bounces@lists.xen.org Fri Nov 09 07:52:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 07:52:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWjND-0000P1-A9; Fri, 09 Nov 2012 07:51:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kouya@jp.fujitsu.com>) id 1TWjNB-0000Ow-GN
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 07:51:29 +0000
Received: from [85.158.143.99:19247] by server-2.bemta-4.messagelabs.com id
	70/99-28922-006BC905; Fri, 09 Nov 2012 07:51:28 +0000
X-Env-Sender: kouya@jp.fujitsu.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1352447486!18035929!1
X-Originating-IP: [192.51.44.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjUxLjQ0LjM2ID0+IDM3MDE1\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4022 invoked from network); 9 Nov 2012 07:51:28 -0000
Received: from fgwmail6.fujitsu.co.jp (HELO fgwmail6.fujitsu.co.jp)
	(192.51.44.36)
	by server-16.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 9 Nov 2012 07:51:28 -0000
Received: from m1.gw.fujitsu.co.jp (unknown [10.0.50.71])
	by fgwmail6.fujitsu.co.jp (Postfix) with ESMTP id 80D2B3EE0B5
	for <xen-devel@lists.xen.org>; Fri,  9 Nov 2012 16:51:24 +0900 (JST)
Received: from smail (m1 [127.0.0.1])
	by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 6704D45DE63
	for <xen-devel@lists.xen.org>; Fri,  9 Nov 2012 16:51:24 +0900 (JST)
Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91])
	by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 5115045DE61
	for <xen-devel@lists.xen.org>; Fri,  9 Nov 2012 16:51:24 +0900 (JST)
Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1])
	by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 4249B1DB804E
	for <xen-devel@lists.xen.org>; Fri,  9 Nov 2012 16:51:24 +0900 (JST)
Received: from g01jpexchyt30.g01.fujitsu.local
	(g01jpexchyt30.g01.fujitsu.local [10.128.193.113])
	by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id EBFEF1DB8043
	for <xen-devel@lists.xen.org>; Fri,  9 Nov 2012 16:51:23 +0900 (JST)
Received: from [10.33.110.234] (10.33.110.234) by
	g01jpexchyt30.g01.fujitsu.local (10.128.193.113) with Microsoft SMTP
	Server (TLS) id 14.2.309.2; Fri, 9 Nov 2012 16:51:18 +0900
Message-ID: <509CB5FB.7020404@jp.fujitsu.com>
Date: Fri, 9 Nov 2012 16:51:23 +0900
From: Kouya Shimura <kouya@jp.fujitsu.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
Content-Type: multipart/mixed; boundary="------------090302050800080606010606"
X-Originating-IP: [10.33.110.234]
Subject: [Xen-devel] [PATCH] libxl: fix reboot failure of migrated domain
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--------------090302050800080606010606
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
Content-Transfer-Encoding: 7bit

The same problem was once fixed by c/s 23878:59c7213b5949
but c/s 25344:0f3b1e13d6af broke it.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>


--------------090302050800080606010606
Content-Type: text/x-patch; name="fix_reboot.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="fix_reboot.patch"

diff -r 62885b3c34c8 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Nov 08 17:58:19 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Fri Nov 09 16:11:04 2012 +0900
@@ -1927,7 +1927,7 @@ start:
          * On subsequent reboot etc we should create the domain, not
          * restore/migrate-receive it again.
          */
-        restore_file = NULL;
+        restoring = 0;
     }else{
         ret = libxl_domain_create_new(ctx, &d_config, &domid,
                                       0, autoconnect_console_how);

--------------090302050800080606010606
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.xen.org
http://lists.xen.org/xen-devel

--------------090302050800080606010606--


From xen-devel-bounces@lists.xen.org Fri Nov 09 09:04:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 09:04:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWkVE-0001oY-5g; Fri, 09 Nov 2012 09:03:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWkVD-0001oQ-4H
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 09:03:51 +0000
Received: from [85.158.137.99:31906] by server-13.bemta-3.messagelabs.com id
	85/F5-24887-6F6CC905; Fri, 09 Nov 2012 09:03:50 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1352451826!13336957!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18275 invoked from network); 9 Nov 2012 09:03:47 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-217.messagelabs.com with SMTP;
	9 Nov 2012 09:03:47 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 09 Nov 2012 09:03:45 +0000
Message-Id: <509CD50302000078000A76E4@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 09 Nov 2012 09:03:47 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
References: <1350037688.14806.93.camel@zakaz.uk.xensource.com>
In-Reply-To: <1350037688.14806.93.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something issue in
 3.7-rc1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 12.10.12 at 12:28, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> The following patch causes fairly large packet loss when transmitting
> from dom0 to the physical network, at least with my tg3 hardware, but I
> assume it can impact anything which uses this interface.
> 
> I suspect that the issue is that the compound pages allocated in this
> way are not backed by contiguous mfns and so things fall apart when the
> driver tries to do DMA.

Has this seen any sort of resolution yet? Despite having forced
NETDEV_FRAG_PAGE_MAX_ORDER to zero for Xen (following
your suggested patch, Ian), and with a different NIC (e1000e
driven) I'm seeing similar packet loss/corruption on transmits,
and only if running a debug hypervisor (in a non-debug one,
MFNs are largely contiguous, so this issue should be observable
there only very rarely).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 09:04:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 09:04:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWkVE-0001oY-5g; Fri, 09 Nov 2012 09:03:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWkVD-0001oQ-4H
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 09:03:51 +0000
Received: from [85.158.137.99:31906] by server-13.bemta-3.messagelabs.com id
	85/F5-24887-6F6CC905; Fri, 09 Nov 2012 09:03:50 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1352451826!13336957!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18275 invoked from network); 9 Nov 2012 09:03:47 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-217.messagelabs.com with SMTP;
	9 Nov 2012 09:03:47 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 09 Nov 2012 09:03:45 +0000
Message-Id: <509CD50302000078000A76E4@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 09 Nov 2012 09:03:47 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
References: <1350037688.14806.93.camel@zakaz.uk.xensource.com>
In-Reply-To: <1350037688.14806.93.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something issue in
 3.7-rc1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 12.10.12 at 12:28, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> The following patch causes fairly large packet loss when transmitting
> from dom0 to the physical network, at least with my tg3 hardware, but I
> assume it can impact anything which uses this interface.
> 
> I suspect that the issue is that the compound pages allocated in this
> way are not backed by contiguous mfns and so things fall apart when the
> driver tries to do DMA.

Has this seen any sort of resolution yet? Despite having forced
NETDEV_FRAG_PAGE_MAX_ORDER to zero for Xen (following
your suggested patch, Ian), and with a different NIC (e1000e
driven) I'm seeing similar packet loss/corruption on transmits,
and only if running a debug hypervisor (in a non-debug one,
MFNs are largely contiguous, so this issue should be observable
there only very rarely).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 09:08:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 09:08:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWkZA-00022v-2o; Fri, 09 Nov 2012 09:07:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Philippe.Simonet@swisscom.com>) id 1TWkZ8-00022X-CB
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 09:07:54 +0000
Received: from [193.109.254.147:38730] by server-6.bemta-14.messagelabs.com id
	54/66-02788-9E7CC905; Fri, 09 Nov 2012 09:07:53 +0000
X-Env-Sender: Philippe.Simonet@swisscom.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352451984!2360886!1
X-Originating-IP: [193.222.81.110]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkzLjIyMi44MS4xMTAgPT4gMTAyMjEz\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9099 invoked from network); 9 Nov 2012 09:06:25 -0000
Received: from outmail110.swisscom.com (HELO mail.swisscom.com)
	(193.222.81.110)
	by server-15.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 9 Nov 2012 09:06:25 -0000
Received: by mail.swisscom.com; Fri, 9 Nov 2012 10:05:59 +0100
From: <Philippe.Simonet@swisscom.com>
To: <ijc@hellion.org.uk>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
	50 minutes" bug.
Thread-Index: Ac280B6CWUiPuRIkTkmJRMKB8zdEqQAEnBqAAAkCjQAAIYFoAAAKGgkAAAADMQAAKDdR8A==
Date: Fri, 9 Nov 2012 09:05:58 +0000
Message-ID: <FF93AF260AC2BB499A119CC65B092CF73151901D@sg000713.corproot.net>
References: <1352294551.12977.61.camel@hastur.hellion.org.uk>
	<CCC04D8E.51A0E%keir@xen.org>
	<509B8BF802000078000A72A3@nat28.tlf.novell.com>
	<FF93AF260AC2BB499A119CC65B092CF73151843F@sg000713.corproot.net>
	<1352384968.12977.104.camel@hastur.hellion.org.uk>
In-Reply-To: <1352384968.12977.104.camel@hastur.hellion.org.uk>
Accept-Language: en-US, de-CH
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.65.122.57]
MIME-Version: 1.0
Cc: 599161@bugs.debian.org, keir@xen.org, JBeulich@suse.com, mrsanna1@gmail.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


> -----Original Message-----
> From: Ian Campbell [mailto:ijc@hellion.org.uk]
> Sent: Thursday, November 08, 2012 3:29 PM
> To: Simonet Philippe, ITS-OUS-OP-IFM-NW-IPE
> Cc: mrsanna1@gmail.com; 599161@bugs.debian.org; xen-
> devel@lists.xen.org; keir@xen.org; JBeulich@suse.com
> Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50 minutes" bug.
> 
> 
> I think Jan was asking for information relating to the system you saw this on -
> - or are you working on the same systems as Mauro?

oops, excuse me, here is a description : I have the problem on 4 systems, all with same hardware.
the problem occured  on each system, 1 time each 2 month in average. since January 2012, I decided to reboot them all monthly, 
and the clock jump occurred only once in February ...

SYSTEM : 		HP ProLiant DL385 G7, with 2 * AMD Processor 6174 (12 cores) = 24 cores, 16 GB MEMORY
XEN    			 (XEN) Xen version 4.0.1 (Debian 4.0.1-5.4) (ultrotter@debian.org) (gcc version 4.4.5 (Debian 4.4.5-8) ) Sat Sep  8 19:15:46 UTC 2012
DOM0			Linux 2.6.32-5-xen-amd64 #1 SMP Sun Sep 23 13:49:30 UTC 2012 x86_64 GNU/Linux
CPU 			
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 16
model           : 9
model name      : AMD Opteron(tm) Processor 6174
stepping        : 1
cpu MHz         : 3791872.477
cache size      : 512 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic mtrr mca cmov pat clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow constant_tsc rep_good nonstop_tsc extd_apicid amd_dcm pni cx16 popcnt hypervisor lahf_lm cmp_legacy extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch nodeid_msr
bogomips        : 4400.17
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

> 
> Of course additional information from Mauro would be useful too in order to
> help spotting any patterns.
> 
> > > Philippe, could you clarify again what CPU model(s) this is being
> > > observed on (the long times between individual steps forward with
> > > this problem perhaps warrant repeating the basics each time, as it's
> > > otherwise quite cumbersome to always look up old pieces of
> information).
> >
> > can you provide this information ?
> > 	cat /proc/cpuinfo
> > 	cat /proc/meminfo
> > 	hardware information (manufacturer, model, urls, ...)
> >
> > Thanks, Philippe
> >
> >
> > > -----Original Message-----
> > > From: Jan Beulich [mailto:JBeulich@suse.com]
> > > Sent: Thursday, November 08, 2012 10:40 AM
> > > To: Simonet Philippe, ITS-OUS-OP-IFM-NW-IPE; Keir Fraser
> > > Cc: 599161@bugs.debian.org; mrsanna1@gmail.com; Ian Campbell; xen-
> > > devel@lists.xen.org
> > > Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock
> > > shifts by 50 minutes" bug.
> > >
> > > >>> On 07.11.12 at 18:40, Keir Fraser <keir@xen.org> wrote:
> > > > On 07/11/2012 13:22, "Ian Campbell" <ijc@hellion.org.uk> wrote:
> > > >
> > > >>>> (XEN) XXX plt_overflow: plt_now=5ece12d34128
> > > plt_wrap=5ece12d09306
> > > >>>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
> > > >>>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
> > > >>>> tsc_stamp=e3839fcb0273
> > > >>>
> > > >>> (below is the complete xm dmesg output)
> > > >>>
> > > >>> did that help you ? do you need more info ?
> > > >>
> > > >> I'll leave this to Keir (who wrote the debugging patch) to answer
> > > >> but it looks to me like it should be useful!
> > > >
> > > > I'm scratching my head. plt_wrap is earlier than plt_now, which
> > > > should be impossible. plt_stamp64 oddly has low 32 bits identical
> > > > to new_stamp. That seems very very improbable!
> > >
> > > Is it? My understanding was that plt_stamp64 is just a software
> > > extension to the more narrow HW counter, and hence the low plt_mask
> > > bits would always be expected to be identical.
> > >
> > > The plt_wrap < plt_now thing of course is entirely unexplainable to me
> too:
> > > Considering that plt_scale doesn't change at all post- boot, apart
> > > from memory corruption I could only see an memory access ordering
> > > problem to be the reason (platform_timer_stamp and/or
> > > stime_platform_stamp changing despite platform_timer_lock being
> > > held. So maybe taking a snapshot of all three static values involved
> > > in the calculation in
> > > __read_platform_stime() between acquiring the lock and the first
> > > call to __read_platform_stime(), and printing them together with the
> > > "live" values in a second
> > > printk() after the one your original patch added could rule that out.
> > >
> > > But the box doesn't even seem to be NUMA (of course it also doesn't
> > > help that the log level was kept restricted - hint, hint, Philippe),
> > > not does there appear to be any S3 cycle or pCPU bring-up/-down in
> between...
> > >
> > > Philippe, could you clarify again what CPU model(s) this is being
> > > observed on (the long times between individual steps forward with
> > > this problem perhaps warrant repeating the basics each time, as it's
> > > otherwise quite cumbersome to always look up old pieces of
> information).
> > >
> > > > I wonder whether the overflow handling should just be removed, or
> > > > made conditional on a command-line parameter, or on the 32-bit
> > > > platform counter being at least somewhat likely to overflow before
> > > > a softirq occurs -- it seems lots of systems are using 14MHz HPET,
> > > > and that gives us a couple of minutes for the plt_overflow softirq
> > > > to do its work
> > > before overflow occurs.
> > > > I think we would notice that outage in other ways. :)
> > >
> > > Iirc we added this for a good reason - to cover the, however
> > > unlikely, event of Xen running for very long without preemption.
> > > Presumably most of the cases got fixed meanwhile, and indeed a
> > > wraparound time on the order of minutes should make this
> > > superfluous, but as the case here shows that code did spot a severe
> > > anomaly (whatever that may turn out to be).
> > >
> > > Also recall that there are HPET implementations around that tick at
> > > a much higher frequency than 14MHz.
> > >
> > > So unless we finally reach the understanding that the code is
> > > flawed, I would rather want to keep it.
> > >
> > > Jan
> >
> >
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 09:08:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 09:08:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWkZA-00022v-2o; Fri, 09 Nov 2012 09:07:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Philippe.Simonet@swisscom.com>) id 1TWkZ8-00022X-CB
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 09:07:54 +0000
Received: from [193.109.254.147:38730] by server-6.bemta-14.messagelabs.com id
	54/66-02788-9E7CC905; Fri, 09 Nov 2012 09:07:53 +0000
X-Env-Sender: Philippe.Simonet@swisscom.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352451984!2360886!1
X-Originating-IP: [193.222.81.110]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkzLjIyMi44MS4xMTAgPT4gMTAyMjEz\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9099 invoked from network); 9 Nov 2012 09:06:25 -0000
Received: from outmail110.swisscom.com (HELO mail.swisscom.com)
	(193.222.81.110)
	by server-15.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 9 Nov 2012 09:06:25 -0000
Received: by mail.swisscom.com; Fri, 9 Nov 2012 10:05:59 +0100
From: <Philippe.Simonet@swisscom.com>
To: <ijc@hellion.org.uk>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
	50 minutes" bug.
Thread-Index: Ac280B6CWUiPuRIkTkmJRMKB8zdEqQAEnBqAAAkCjQAAIYFoAAAKGgkAAAADMQAAKDdR8A==
Date: Fri, 9 Nov 2012 09:05:58 +0000
Message-ID: <FF93AF260AC2BB499A119CC65B092CF73151901D@sg000713.corproot.net>
References: <1352294551.12977.61.camel@hastur.hellion.org.uk>
	<CCC04D8E.51A0E%keir@xen.org>
	<509B8BF802000078000A72A3@nat28.tlf.novell.com>
	<FF93AF260AC2BB499A119CC65B092CF73151843F@sg000713.corproot.net>
	<1352384968.12977.104.camel@hastur.hellion.org.uk>
In-Reply-To: <1352384968.12977.104.camel@hastur.hellion.org.uk>
Accept-Language: en-US, de-CH
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.65.122.57]
MIME-Version: 1.0
Cc: 599161@bugs.debian.org, keir@xen.org, JBeulich@suse.com, mrsanna1@gmail.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


> -----Original Message-----
> From: Ian Campbell [mailto:ijc@hellion.org.uk]
> Sent: Thursday, November 08, 2012 3:29 PM
> To: Simonet Philippe, ITS-OUS-OP-IFM-NW-IPE
> Cc: mrsanna1@gmail.com; 599161@bugs.debian.org; xen-
> devel@lists.xen.org; keir@xen.org; JBeulich@suse.com
> Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50 minutes" bug.
> 
> 
> I think Jan was asking for information relating to the system you saw this on -
> - or are you working on the same systems as Mauro?

oops, excuse me, here is a description : I have the problem on 4 systems, all with same hardware.
the problem occured  on each system, 1 time each 2 month in average. since January 2012, I decided to reboot them all monthly, 
and the clock jump occurred only once in February ...

SYSTEM : 		HP ProLiant DL385 G7, with 2 * AMD Processor 6174 (12 cores) = 24 cores, 16 GB MEMORY
XEN    			 (XEN) Xen version 4.0.1 (Debian 4.0.1-5.4) (ultrotter@debian.org) (gcc version 4.4.5 (Debian 4.4.5-8) ) Sat Sep  8 19:15:46 UTC 2012
DOM0			Linux 2.6.32-5-xen-amd64 #1 SMP Sun Sep 23 13:49:30 UTC 2012 x86_64 GNU/Linux
CPU 			
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 16
model           : 9
model name      : AMD Opteron(tm) Processor 6174
stepping        : 1
cpu MHz         : 3791872.477
cache size      : 512 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic mtrr mca cmov pat clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow constant_tsc rep_good nonstop_tsc extd_apicid amd_dcm pni cx16 popcnt hypervisor lahf_lm cmp_legacy extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch nodeid_msr
bogomips        : 4400.17
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

> 
> Of course additional information from Mauro would be useful too in order to
> help spotting any patterns.
> 
> > > Philippe, could you clarify again what CPU model(s) this is being
> > > observed on (the long times between individual steps forward with
> > > this problem perhaps warrant repeating the basics each time, as it's
> > > otherwise quite cumbersome to always look up old pieces of
> information).
> >
> > can you provide this information ?
> > 	cat /proc/cpuinfo
> > 	cat /proc/meminfo
> > 	hardware information (manufacturer, model, urls, ...)
> >
> > Thanks, Philippe
> >
> >
> > > -----Original Message-----
> > > From: Jan Beulich [mailto:JBeulich@suse.com]
> > > Sent: Thursday, November 08, 2012 10:40 AM
> > > To: Simonet Philippe, ITS-OUS-OP-IFM-NW-IPE; Keir Fraser
> > > Cc: 599161@bugs.debian.org; mrsanna1@gmail.com; Ian Campbell; xen-
> > > devel@lists.xen.org
> > > Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock
> > > shifts by 50 minutes" bug.
> > >
> > > >>> On 07.11.12 at 18:40, Keir Fraser <keir@xen.org> wrote:
> > > > On 07/11/2012 13:22, "Ian Campbell" <ijc@hellion.org.uk> wrote:
> > > >
> > > >>>> (XEN) XXX plt_overflow: plt_now=5ece12d34128
> > > plt_wrap=5ece12d09306
> > > >>>> now=5ece12d16292 old_stamp=35c7c new_stamp=800366a5
> > > >>>> plt_stamp64=15b800366a5 plt_mask=ffffffff tsc=e3839fd23854
> > > >>>> tsc_stamp=e3839fcb0273
> > > >>>
> > > >>> (below is the complete xm dmesg output)
> > > >>>
> > > >>> did that help you ? do you need more info ?
> > > >>
> > > >> I'll leave this to Keir (who wrote the debugging patch) to answer
> > > >> but it looks to me like it should be useful!
> > > >
> > > > I'm scratching my head. plt_wrap is earlier than plt_now, which
> > > > should be impossible. plt_stamp64 oddly has low 32 bits identical
> > > > to new_stamp. That seems very very improbable!
> > >
> > > Is it? My understanding was that plt_stamp64 is just a software
> > > extension to the more narrow HW counter, and hence the low plt_mask
> > > bits would always be expected to be identical.
> > >
> > > The plt_wrap < plt_now thing of course is entirely unexplainable to me
> too:
> > > Considering that plt_scale doesn't change at all post- boot, apart
> > > from memory corruption I could only see an memory access ordering
> > > problem to be the reason (platform_timer_stamp and/or
> > > stime_platform_stamp changing despite platform_timer_lock being
> > > held. So maybe taking a snapshot of all three static values involved
> > > in the calculation in
> > > __read_platform_stime() between acquiring the lock and the first
> > > call to __read_platform_stime(), and printing them together with the
> > > "live" values in a second
> > > printk() after the one your original patch added could rule that out.
> > >
> > > But the box doesn't even seem to be NUMA (of course it also doesn't
> > > help that the log level was kept restricted - hint, hint, Philippe),
> > > not does there appear to be any S3 cycle or pCPU bring-up/-down in
> between...
> > >
> > > Philippe, could you clarify again what CPU model(s) this is being
> > > observed on (the long times between individual steps forward with
> > > this problem perhaps warrant repeating the basics each time, as it's
> > > otherwise quite cumbersome to always look up old pieces of
> information).
> > >
> > > > I wonder whether the overflow handling should just be removed, or
> > > > made conditional on a command-line parameter, or on the 32-bit
> > > > platform counter being at least somewhat likely to overflow before
> > > > a softirq occurs -- it seems lots of systems are using 14MHz HPET,
> > > > and that gives us a couple of minutes for the plt_overflow softirq
> > > > to do its work
> > > before overflow occurs.
> > > > I think we would notice that outage in other ways. :)
> > >
> > > Iirc we added this for a good reason - to cover the, however
> > > unlikely, event of Xen running for very long without preemption.
> > > Presumably most of the cases got fixed meanwhile, and indeed a
> > > wraparound time on the order of minutes should make this
> > > superfluous, but as the case here shows that code did spot a severe
> > > anomaly (whatever that may turn out to be).
> > >
> > > Also recall that there are HPET implementations around that tick at
> > > a much higher frequency than 14MHz.
> > >
> > > So unless we finally reach the understanding that the code is
> > > flawed, I would rather want to keep it.
> > >
> > > Jan
> >
> >
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 09:13:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 09:13:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWkeD-0002mL-7t; Fri, 09 Nov 2012 09:13:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWkeB-0002lz-P3
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 09:13:07 +0000
Received: from [85.158.138.51:13485] by server-1.bemta-3.messagelabs.com id
	F6/0E-12169-E19CC905; Fri, 09 Nov 2012 09:13:02 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352452381!21253984!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5MzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15900 invoked from network); 9 Nov 2012 09:13:01 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-174.messagelabs.com with SMTP;
	9 Nov 2012 09:13:01 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 09 Nov 2012 08:47:58 +0000
Message-Id: <509CD14D02000078000A76C7@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 09 Nov 2012 08:47:57 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <509B8DC102000078000A72BA@nat28.tlf.novell.com>
	<CCC13EDB.51B6E%keir@xen.org>
	<509BC65402000078000A73A4@nat28.tlf.novell.com>
	<563639fd-fc13-49cd-88cf-431244534c2f@default>
In-Reply-To: <563639fd-fc13-49cd-88cf-431244534c2f@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	Keir Fraser <keir@xen.org>, IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 08.11.12 at 20:16, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  From: Jan Beulich [mailto:JBeulich@suse.com]
>> >>> On 08.11.12 at 11:50, Keir Fraser <keir@xen.org> wrote:
>> > On 08/11/2012 09:47, "Jan Beulich" <JBeulich@suse.com> wrote:
>> >> The only thing that indeed is - on non-preemptible kernels - done
>> >> only on exit to user mode is the eventual entering of the scheduler.
>> >
>> > That alone may still be an argument for restricting the batch size from the
>> > toolstack?
>> 
>> Yes, this clearly prohibits unlimited batches. But not being able to
>> schedule should be less restrictive than not being able to run
>> softirqs, so I'd still put under question whether the limit shouldn't
>> be bumped.
> 
> Wait, please define unlimited.

Unlimited as in unlimited.

> I think we are in agreement from previous discussion that, to solve
> the TOCTOU race, the heap_lock must be held for the entire allocation
> for a domain creation.  True?

That's only one way (and as Keir already responded, not one
that we should actually pursue).

The point about being fast enough was rather made to allow
a decision towards the feasibility of intermediately disabling
tmem (or at least allocations originating from it) in particular
(I'm not worried about micro-allocations - the tool stack has to
provide some slack in its calculations for this anyway).

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 09:13:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 09:13:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWkeD-0002mL-7t; Fri, 09 Nov 2012 09:13:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWkeB-0002lz-P3
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 09:13:07 +0000
Received: from [85.158.138.51:13485] by server-1.bemta-3.messagelabs.com id
	F6/0E-12169-E19CC905; Fri, 09 Nov 2012 09:13:02 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352452381!21253984!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5MzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15900 invoked from network); 9 Nov 2012 09:13:01 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-174.messagelabs.com with SMTP;
	9 Nov 2012 09:13:01 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 09 Nov 2012 08:47:58 +0000
Message-Id: <509CD14D02000078000A76C7@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 09 Nov 2012 08:47:57 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <509B8DC102000078000A72BA@nat28.tlf.novell.com>
	<CCC13EDB.51B6E%keir@xen.org>
	<509BC65402000078000A73A4@nat28.tlf.novell.com>
	<563639fd-fc13-49cd-88cf-431244534c2f@default>
In-Reply-To: <563639fd-fc13-49cd-88cf-431244534c2f@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: TimDeegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	Keir Fraser <keir@xen.org>, IanCampbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Shuklin <george.shuklin@gmail.com>,
	xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 08.11.12 at 20:16, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  From: Jan Beulich [mailto:JBeulich@suse.com]
>> >>> On 08.11.12 at 11:50, Keir Fraser <keir@xen.org> wrote:
>> > On 08/11/2012 09:47, "Jan Beulich" <JBeulich@suse.com> wrote:
>> >> The only thing that indeed is - on non-preemptible kernels - done
>> >> only on exit to user mode is the eventual entering of the scheduler.
>> >
>> > That alone may still be an argument for restricting the batch size from the
>> > toolstack?
>> 
>> Yes, this clearly prohibits unlimited batches. But not being able to
>> schedule should be less restrictive than not being able to run
>> softirqs, so I'd still put under question whether the limit shouldn't
>> be bumped.
> 
> Wait, please define unlimited.

Unlimited as in unlimited.

> I think we are in agreement from previous discussion that, to solve
> the TOCTOU race, the heap_lock must be held for the entire allocation
> for a domain creation.  True?

That's only one way (and as Keir already responded, not one
that we should actually pursue).

The point about being fast enough was rather made to allow
a decision towards the feasibility of intermediately disabling
tmem (or at least allocations originating from it) in particular
(I'm not worried about micro-allocations - the tool stack has to
provide some slack in its calculations for this anyway).

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 09:17:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 09:17:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWkiC-0003HF-U8; Fri, 09 Nov 2012 09:17:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TWkiB-0003H1-1D
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 09:17:15 +0000
Received: from [85.158.139.211:30971] by server-14.bemta-5.messagelabs.com id
	14/34-21768-A1ACC905; Fri, 09 Nov 2012 09:17:14 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1352452633!19496526!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwNzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23788 invoked from network); 9 Nov 2012 09:17:13 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 09:17:13 -0000
X-IronPort-AV: E=Sophos;i="4.80,744,1344211200"; d="scan'208";a="15690467"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	09 Nov 2012 09:16:14 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Fri, 9 Nov 2012
	09:16:13 +0000
Message-ID: <1352452573.21048.35.camel@dagon.hellion.org.uk>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Fri, 9 Nov 2012 09:16:13 +0000
In-Reply-To: <509CD50302000078000A76E4@nat28.tlf.novell.com>
References: <1350037688.14806.93.camel@zakaz.uk.xensource.com>
	<509CD50302000078000A76E4@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something issue in
 3.7-rc1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-09 at 09:03 +0000, Jan Beulich wrote:
> >>> On 12.10.12 at 12:28, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > The following patch causes fairly large packet loss when transmitting
> > from dom0 to the physical network, at least with my tg3 hardware, but I
> > assume it can impact anything which uses this interface.
> > 
> > I suspect that the issue is that the compound pages allocated in this
> > way are not backed by contiguous mfns and so things fall apart when the
> > driver tries to do DMA.
> 
> Has this seen any sort of resolution yet? Despite having forced
> NETDEV_FRAG_PAGE_MAX_ORDER to zero for Xen (following
> your suggested patch, Ian), and with a different NIC (e1000e
> driven) I'm seeing similar packet loss/corruption on transmits,
> and only if running a debug hypervisor (in a non-debug one,
> MFNs are largely contiguous, so this issue should be observable
> there only very rarely).

I think Konrad is still looking into the underlying swiotlb issue.

If you want to go with the workaround then there is another order>0 to
frob in net/core/sock.c
#define SKB_FRAG_PAGE_ORDER	get_order(32768)
which might help.

Dave Miller unequivocally rejected this approach so I haven't been
pursuing it any further. Perhaps once the swiotlb fix is made it will be
possible to make an argument for it based on actual performance numbers.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 09:17:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 09:17:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWkiC-0003HF-U8; Fri, 09 Nov 2012 09:17:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TWkiB-0003H1-1D
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 09:17:15 +0000
Received: from [85.158.139.211:30971] by server-14.bemta-5.messagelabs.com id
	14/34-21768-A1ACC905; Fri, 09 Nov 2012 09:17:14 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1352452633!19496526!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwNzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23788 invoked from network); 9 Nov 2012 09:17:13 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 09:17:13 -0000
X-IronPort-AV: E=Sophos;i="4.80,744,1344211200"; d="scan'208";a="15690467"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	09 Nov 2012 09:16:14 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Fri, 9 Nov 2012
	09:16:13 +0000
Message-ID: <1352452573.21048.35.camel@dagon.hellion.org.uk>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Fri, 9 Nov 2012 09:16:13 +0000
In-Reply-To: <509CD50302000078000A76E4@nat28.tlf.novell.com>
References: <1350037688.14806.93.camel@zakaz.uk.xensource.com>
	<509CD50302000078000A76E4@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something issue in
 3.7-rc1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-09 at 09:03 +0000, Jan Beulich wrote:
> >>> On 12.10.12 at 12:28, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > The following patch causes fairly large packet loss when transmitting
> > from dom0 to the physical network, at least with my tg3 hardware, but I
> > assume it can impact anything which uses this interface.
> > 
> > I suspect that the issue is that the compound pages allocated in this
> > way are not backed by contiguous mfns and so things fall apart when the
> > driver tries to do DMA.
> 
> Has this seen any sort of resolution yet? Despite having forced
> NETDEV_FRAG_PAGE_MAX_ORDER to zero for Xen (following
> your suggested patch, Ian), and with a different NIC (e1000e
> driven) I'm seeing similar packet loss/corruption on transmits,
> and only if running a debug hypervisor (in a non-debug one,
> MFNs are largely contiguous, so this issue should be observable
> there only very rarely).

I think Konrad is still looking into the underlying swiotlb issue.

If you want to go with the workaround then there is another order>0 to
frob in net/core/sock.c
#define SKB_FRAG_PAGE_ORDER	get_order(32768)
which might help.

Dave Miller unequivocally rejected this approach so I haven't been
pursuing it any further. Perhaps once the swiotlb fix is made it will be
possible to make an argument for it based on actual performance numbers.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 09:41:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 09:41:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWl5D-0004jb-7L; Fri, 09 Nov 2012 09:41:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWl5B-0004jP-33
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 09:41:01 +0000
Received: from [85.158.137.99:43529] by server-4.bemta-3.messagelabs.com id
	3B/71-30023-BAFCC905; Fri, 09 Nov 2012 09:40:59 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1352454058!15247167!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5MzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18403 invoked from network); 9 Nov 2012 09:40:58 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-217.messagelabs.com with SMTP;
	9 Nov 2012 09:40:58 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 09 Nov 2012 09:40:58 +0000
Message-Id: <509CDDBA02000078000A772C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 09 Nov 2012 09:40:58 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <1350037688.14806.93.camel@zakaz.uk.xensource.com>
	<509CD50302000078000A76E4@nat28.tlf.novell.com>
	<1352452573.21048.35.camel@dagon.hellion.org.uk>
In-Reply-To: <1352452573.21048.35.camel@dagon.hellion.org.uk>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something issue in
 3.7-rc1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 09.11.12 at 10:16, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Fri, 2012-11-09 at 09:03 +0000, Jan Beulich wrote:
>> >>> On 12.10.12 at 12:28, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> > The following patch causes fairly large packet loss when transmitting
>> > from dom0 to the physical network, at least with my tg3 hardware, but I
>> > assume it can impact anything which uses this interface.
>> > 
>> > I suspect that the issue is that the compound pages allocated in this
>> > way are not backed by contiguous mfns and so things fall apart when the
>> > driver tries to do DMA.
>> 
>> Has this seen any sort of resolution yet? Despite having forced
>> NETDEV_FRAG_PAGE_MAX_ORDER to zero for Xen (following
>> your suggested patch, Ian), and with a different NIC (e1000e
>> driven) I'm seeing similar packet loss/corruption on transmits,
>> and only if running a debug hypervisor (in a non-debug one,
>> MFNs are largely contiguous, so this issue should be observable
>> there only very rarely).
> 
> I think Konrad is still looking into the underlying swiotlb issue.
> 
> If you want to go with the workaround then there is another order>0 to
> frob in net/core/sock.c
> #define SKB_FRAG_PAGE_ORDER	get_order(32768)
> which might help.

Thanks, that indeed helped. And gives me food for thought as
well, since this should - if anything at all - be a performance
improvement, not a something affecting correctness.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 09:41:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 09:41:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWl5D-0004jb-7L; Fri, 09 Nov 2012 09:41:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWl5B-0004jP-33
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 09:41:01 +0000
Received: from [85.158.137.99:43529] by server-4.bemta-3.messagelabs.com id
	3B/71-30023-BAFCC905; Fri, 09 Nov 2012 09:40:59 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1352454058!15247167!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5MzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18403 invoked from network); 9 Nov 2012 09:40:58 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-217.messagelabs.com with SMTP;
	9 Nov 2012 09:40:58 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 09 Nov 2012 09:40:58 +0000
Message-Id: <509CDDBA02000078000A772C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 09 Nov 2012 09:40:58 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <1350037688.14806.93.camel@zakaz.uk.xensource.com>
	<509CD50302000078000A76E4@nat28.tlf.novell.com>
	<1352452573.21048.35.camel@dagon.hellion.org.uk>
In-Reply-To: <1352452573.21048.35.camel@dagon.hellion.org.uk>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something issue in
 3.7-rc1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 09.11.12 at 10:16, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Fri, 2012-11-09 at 09:03 +0000, Jan Beulich wrote:
>> >>> On 12.10.12 at 12:28, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> > The following patch causes fairly large packet loss when transmitting
>> > from dom0 to the physical network, at least with my tg3 hardware, but I
>> > assume it can impact anything which uses this interface.
>> > 
>> > I suspect that the issue is that the compound pages allocated in this
>> > way are not backed by contiguous mfns and so things fall apart when the
>> > driver tries to do DMA.
>> 
>> Has this seen any sort of resolution yet? Despite having forced
>> NETDEV_FRAG_PAGE_MAX_ORDER to zero for Xen (following
>> your suggested patch, Ian), and with a different NIC (e1000e
>> driven) I'm seeing similar packet loss/corruption on transmits,
>> and only if running a debug hypervisor (in a non-debug one,
>> MFNs are largely contiguous, so this issue should be observable
>> there only very rarely).
> 
> I think Konrad is still looking into the underlying swiotlb issue.
> 
> If you want to go with the workaround then there is another order>0 to
> frob in net/core/sock.c
> #define SKB_FRAG_PAGE_ORDER	get_order(32768)
> which might help.

Thanks, that indeed helped. And gives me food for thought as
well, since this should - if anything at all - be a performance
improvement, not a something affecting correctness.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 09:47:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 09:47:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWlBV-0005Dc-Mi; Fri, 09 Nov 2012 09:47:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWlBU-0005DV-5O
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 09:47:32 +0000
Received: from [85.158.137.99:11705] by server-13.bemta-3.messagelabs.com id
	18/E8-24887-331DC905; Fri, 09 Nov 2012 09:47:31 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1352454450!18300482!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5MzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17511 invoked from network); 9 Nov 2012 09:47:31 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-217.messagelabs.com with SMTP;
	9 Nov 2012 09:47:31 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 09 Nov 2012 09:47:30 +0000
Message-Id: <509CDF4302000078000A7741@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 09 Nov 2012 09:47:31 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <Philippe.Simonet@swisscom.com>
References: <1352294551.12977.61.camel@hastur.hellion.org.uk>
	<CCC04D8E.51A0E%keir@xen.org>
	<509B8BF802000078000A72A3@nat28.tlf.novell.com>
	<FF93AF260AC2BB499A119CC65B092CF73151843F@sg000713.corproot.net>
	<1352384968.12977.104.camel@hastur.hellion.org.uk>
	<FF93AF260AC2BB499A119CC65B092CF73151901D@sg000713.corproot.net>
In-Reply-To: <FF93AF260AC2BB499A119CC65B092CF73151901D@sg000713.corproot.net>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, 599161@bugs.debian.org, xen-devel@lists.xen.org,
	mrsanna1@gmail.com, ijc@hellion.org.uk
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 09.11.12 at 10:05, <Philippe.Simonet@swisscom.com> wrote:
> oops, excuse me, here is a description : I have the problem on 4 systems, 
> all with same hardware.
> the problem occured  on each system, 1 time each 2 month in average. since 
> January 2012, I decided to reboot them all monthly, 
> and the clock jump occurred only once in February ...
> 
> SYSTEM : 		HP ProLiant DL385 G7, with 2 * AMD Processor 6174 (12 cores) = 24 
> cores, 16 GB MEMORY
> XEN    			 (XEN) Xen version 4.0.1 (Debian 4.0.1-5.4) (ultrotter@debian.org) 
> (gcc version 4.4.5 (Debian 4.4.5-8) ) Sat Sep  8 19:15:46 UTC 2012
> DOM0			Linux 2.6.32-5-xen-amd64 #1 SMP Sun Sep 23 13:49:30 UTC 2012 x86_64 
> GNU/Linux
> CPU 			
> processor       : 0
> vendor_id       : AuthenticAMD
> cpu family      : 16
> model           : 9
> model name      : AMD Opteron(tm) Processor 6174

Huh - so we have the problem on even different vendor CPUs (as
Mauro's are Intel ones). But I take it that you haven't see an event
yet with the debugging patch?

Plus, what's puzzling me a little too - before the occurrence of the
event on Mauro's system, I was under the impression that this
requires quite a bit of uptime. Yet the event he observed occurred
early on the second day after boot afaict.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 09:47:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 09:47:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWlBV-0005Dc-Mi; Fri, 09 Nov 2012 09:47:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWlBU-0005DV-5O
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 09:47:32 +0000
Received: from [85.158.137.99:11705] by server-13.bemta-3.messagelabs.com id
	18/E8-24887-331DC905; Fri, 09 Nov 2012 09:47:31 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1352454450!18300482!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5MzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17511 invoked from network); 9 Nov 2012 09:47:31 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-217.messagelabs.com with SMTP;
	9 Nov 2012 09:47:31 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 09 Nov 2012 09:47:30 +0000
Message-Id: <509CDF4302000078000A7741@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 09 Nov 2012 09:47:31 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <Philippe.Simonet@swisscom.com>
References: <1352294551.12977.61.camel@hastur.hellion.org.uk>
	<CCC04D8E.51A0E%keir@xen.org>
	<509B8BF802000078000A72A3@nat28.tlf.novell.com>
	<FF93AF260AC2BB499A119CC65B092CF73151843F@sg000713.corproot.net>
	<1352384968.12977.104.camel@hastur.hellion.org.uk>
	<FF93AF260AC2BB499A119CC65B092CF73151901D@sg000713.corproot.net>
In-Reply-To: <FF93AF260AC2BB499A119CC65B092CF73151901D@sg000713.corproot.net>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, 599161@bugs.debian.org, xen-devel@lists.xen.org,
	mrsanna1@gmail.com, ijc@hellion.org.uk
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 09.11.12 at 10:05, <Philippe.Simonet@swisscom.com> wrote:
> oops, excuse me, here is a description : I have the problem on 4 systems, 
> all with same hardware.
> the problem occured  on each system, 1 time each 2 month in average. since 
> January 2012, I decided to reboot them all monthly, 
> and the clock jump occurred only once in February ...
> 
> SYSTEM : 		HP ProLiant DL385 G7, with 2 * AMD Processor 6174 (12 cores) = 24 
> cores, 16 GB MEMORY
> XEN    			 (XEN) Xen version 4.0.1 (Debian 4.0.1-5.4) (ultrotter@debian.org) 
> (gcc version 4.4.5 (Debian 4.4.5-8) ) Sat Sep  8 19:15:46 UTC 2012
> DOM0			Linux 2.6.32-5-xen-amd64 #1 SMP Sun Sep 23 13:49:30 UTC 2012 x86_64 
> GNU/Linux
> CPU 			
> processor       : 0
> vendor_id       : AuthenticAMD
> cpu family      : 16
> model           : 9
> model name      : AMD Opteron(tm) Processor 6174

Huh - so we have the problem on even different vendor CPUs (as
Mauro's are Intel ones). But I take it that you haven't see an event
yet with the debugging patch?

Plus, what's puzzling me a little too - before the occurrence of the
event on Mauro's system, I was under the impression that this
requires quite a bit of uptime. Yet the event he observed occurred
early on the second day after boot afaict.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 09:54:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 09:54:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWlHr-0005eU-AT; Fri, 09 Nov 2012 09:54:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mrsanna1@gmail.com>) id 1TWlHp-0005eD-Vu
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 09:54:06 +0000
Received: from [85.158.139.211:34673] by server-14.bemta-5.messagelabs.com id
	F5/B9-21768-DB2DC905; Fri, 09 Nov 2012 09:54:05 +0000
X-Env-Sender: mrsanna1@gmail.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1352454840!15529465!1
X-Originating-IP: [209.85.214.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12536 invoked from network); 9 Nov 2012 09:54:02 -0000
Received: from mail-ob0-f173.google.com (HELO mail-ob0-f173.google.com)
	(209.85.214.173)
	by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 09:54:02 -0000
Received: by mail-ob0-f173.google.com with SMTP id wc18so4466726obb.32
	for <xen-devel@lists.xen.org>; Fri, 09 Nov 2012 01:54:00 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=eWk/dCWS4u/NJKns9g//V85YWFG2NXAOeMKfIoofJaU=;
	b=YYBqZFiuXXrX2UXnGkZ/DsXTMR59VJp2YHrbCb4dz+/j3kCudmcoyQLWb4uBNLx9WB
	Ne4ri1zPgrESx5fnwLasKzVP4jXYr000sRxH4gDGWTZqgsjMd2yOdnooB0lo64OIj6Qj
	/54vqL1guTweyDdRkLCvG239S0ysPjE8KUA8en7GGSY5GUWGzfDU+ilplJ2skWoYVVpJ
	hmJoo7/HnArfgXq2v+VM77enxGx14BkQ93fZJuUTidZKt/8iIPwKWuyfoxH0Ey5RgiXD
	d/dcD4T7A/HfLm9DsdWsu/XpRLd/Yor/9PuQFqOgWpPe1p2DQ1qschlvDUKWclpWD7NF
	SPRw==
MIME-Version: 1.0
Received: by 10.182.52.105 with SMTP id s9mr8129346obo.25.1352454840210; Fri,
	09 Nov 2012 01:54:00 -0800 (PST)
Received: by 10.76.87.161 with HTTP; Fri, 9 Nov 2012 01:54:00 -0800 (PST)
In-Reply-To: <509CDF4302000078000A7741@nat28.tlf.novell.com>
References: <1352294551.12977.61.camel@hastur.hellion.org.uk>
	<CCC04D8E.51A0E%keir@xen.org>
	<509B8BF802000078000A72A3@nat28.tlf.novell.com>
	<FF93AF260AC2BB499A119CC65B092CF73151843F@sg000713.corproot.net>
	<1352384968.12977.104.camel@hastur.hellion.org.uk>
	<FF93AF260AC2BB499A119CC65B092CF73151901D@sg000713.corproot.net>
	<509CDF4302000078000A7741@nat28.tlf.novell.com>
Date: Fri, 9 Nov 2012 10:54:00 +0100
Message-ID: <CAE17a0Wm9uVLrVYkrrj6aHQu3-C51bKrhJRWVgbqAOnW3=jYUg@mail.gmail.com>
From: Mauro <mrsanna1@gmail.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: keir@xen.org, Philippe.Simonet@swisscom.com, 599161@bugs.debian.org,
	xen-devel@lists.xen.org, ijc@hellion.org.uk
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 9 November 2012 10:47, Jan Beulich <JBeulich@suse.com> wrote:
>>>> On 09.11.12 at 10:05, <Philippe.Simonet@swisscom.com> wrote:
>> oops, excuse me, here is a description : I have the problem on 4 systems,
>> all with same hardware.
>> the problem occured  on each system, 1 time each 2 month in average. since
>> January 2012, I decided to reboot them all monthly,
>> and the clock jump occurred only once in February ...
>>
>> SYSTEM :              HP ProLiant DL385 G7, with 2 * AMD Processor 6174 (12 cores) = 24
>> cores, 16 GB MEMORY
>> XEN                            (XEN) Xen version 4.0.1 (Debian 4.0.1-5.4) (ultrotter@debian.org)
>> (gcc version 4.4.5 (Debian 4.4.5-8) ) Sat Sep  8 19:15:46 UTC 2012
>> DOM0                  Linux 2.6.32-5-xen-amd64 #1 SMP Sun Sep 23 13:49:30 UTC 2012 x86_64
>> GNU/Linux
>> CPU
>> processor       : 0
>> vendor_id       : AuthenticAMD
>> cpu family      : 16
>> model           : 9
>> model name      : AMD Opteron(tm) Processor 6174
>
> Huh - so we have the problem on even different vendor CPUs (as
> Mauro's are Intel ones). But I take it that you haven't see an event
> yet with the debugging patch?
>
> Plus, what's puzzling me a little too - before the occurrence of the
> event on Mauro's system, I was under the impression that this
> requires quite a bit of uptime. Yet the event he observed occurred
> early on the second day after boot afaict.

Before the patch clock jumps on my systems occurred about once or twice at week.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 09:54:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 09:54:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWlHr-0005eU-AT; Fri, 09 Nov 2012 09:54:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mrsanna1@gmail.com>) id 1TWlHp-0005eD-Vu
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 09:54:06 +0000
Received: from [85.158.139.211:34673] by server-14.bemta-5.messagelabs.com id
	F5/B9-21768-DB2DC905; Fri, 09 Nov 2012 09:54:05 +0000
X-Env-Sender: mrsanna1@gmail.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1352454840!15529465!1
X-Originating-IP: [209.85.214.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12536 invoked from network); 9 Nov 2012 09:54:02 -0000
Received: from mail-ob0-f173.google.com (HELO mail-ob0-f173.google.com)
	(209.85.214.173)
	by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 09:54:02 -0000
Received: by mail-ob0-f173.google.com with SMTP id wc18so4466726obb.32
	for <xen-devel@lists.xen.org>; Fri, 09 Nov 2012 01:54:00 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=eWk/dCWS4u/NJKns9g//V85YWFG2NXAOeMKfIoofJaU=;
	b=YYBqZFiuXXrX2UXnGkZ/DsXTMR59VJp2YHrbCb4dz+/j3kCudmcoyQLWb4uBNLx9WB
	Ne4ri1zPgrESx5fnwLasKzVP4jXYr000sRxH4gDGWTZqgsjMd2yOdnooB0lo64OIj6Qj
	/54vqL1guTweyDdRkLCvG239S0ysPjE8KUA8en7GGSY5GUWGzfDU+ilplJ2skWoYVVpJ
	hmJoo7/HnArfgXq2v+VM77enxGx14BkQ93fZJuUTidZKt/8iIPwKWuyfoxH0Ey5RgiXD
	d/dcD4T7A/HfLm9DsdWsu/XpRLd/Yor/9PuQFqOgWpPe1p2DQ1qschlvDUKWclpWD7NF
	SPRw==
MIME-Version: 1.0
Received: by 10.182.52.105 with SMTP id s9mr8129346obo.25.1352454840210; Fri,
	09 Nov 2012 01:54:00 -0800 (PST)
Received: by 10.76.87.161 with HTTP; Fri, 9 Nov 2012 01:54:00 -0800 (PST)
In-Reply-To: <509CDF4302000078000A7741@nat28.tlf.novell.com>
References: <1352294551.12977.61.camel@hastur.hellion.org.uk>
	<CCC04D8E.51A0E%keir@xen.org>
	<509B8BF802000078000A72A3@nat28.tlf.novell.com>
	<FF93AF260AC2BB499A119CC65B092CF73151843F@sg000713.corproot.net>
	<1352384968.12977.104.camel@hastur.hellion.org.uk>
	<FF93AF260AC2BB499A119CC65B092CF73151901D@sg000713.corproot.net>
	<509CDF4302000078000A7741@nat28.tlf.novell.com>
Date: Fri, 9 Nov 2012 10:54:00 +0100
Message-ID: <CAE17a0Wm9uVLrVYkrrj6aHQu3-C51bKrhJRWVgbqAOnW3=jYUg@mail.gmail.com>
From: Mauro <mrsanna1@gmail.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: keir@xen.org, Philippe.Simonet@swisscom.com, 599161@bugs.debian.org,
	xen-devel@lists.xen.org, ijc@hellion.org.uk
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 9 November 2012 10:47, Jan Beulich <JBeulich@suse.com> wrote:
>>>> On 09.11.12 at 10:05, <Philippe.Simonet@swisscom.com> wrote:
>> oops, excuse me, here is a description : I have the problem on 4 systems,
>> all with same hardware.
>> the problem occured  on each system, 1 time each 2 month in average. since
>> January 2012, I decided to reboot them all monthly,
>> and the clock jump occurred only once in February ...
>>
>> SYSTEM :              HP ProLiant DL385 G7, with 2 * AMD Processor 6174 (12 cores) = 24
>> cores, 16 GB MEMORY
>> XEN                            (XEN) Xen version 4.0.1 (Debian 4.0.1-5.4) (ultrotter@debian.org)
>> (gcc version 4.4.5 (Debian 4.4.5-8) ) Sat Sep  8 19:15:46 UTC 2012
>> DOM0                  Linux 2.6.32-5-xen-amd64 #1 SMP Sun Sep 23 13:49:30 UTC 2012 x86_64
>> GNU/Linux
>> CPU
>> processor       : 0
>> vendor_id       : AuthenticAMD
>> cpu family      : 16
>> model           : 9
>> model name      : AMD Opteron(tm) Processor 6174
>
> Huh - so we have the problem on even different vendor CPUs (as
> Mauro's are Intel ones). But I take it that you haven't see an event
> yet with the debugging patch?
>
> Plus, what's puzzling me a little too - before the occurrence of the
> event on Mauro's system, I was under the impression that this
> requires quite a bit of uptime. Yet the event he observed occurred
> early on the second day after boot afaict.

Before the patch clock jumps on my systems occurred about once or twice at week.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 10:36:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 10:36:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWlwl-000097-Tu; Fri, 09 Nov 2012 10:36:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWlwj-00008x-Rw
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 10:36:22 +0000
Received: from [85.158.139.211:62238] by server-10.bemta-5.messagelabs.com id
	A2/11-09257-5ACDC905; Fri, 09 Nov 2012 10:36:21 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1352457380!19492075!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5MzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5214 invoked from network); 9 Nov 2012 10:36:20 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-206.messagelabs.com with SMTP;
	9 Nov 2012 10:36:20 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 09 Nov 2012 10:36:20 +0000
Message-Id: <509CEAB402000078000A7772@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 09 Nov 2012 10:36:20 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
References: <1350037688.14806.93.camel@zakaz.uk.xensource.com>
	<509CD50302000078000A76E4@nat28.tlf.novell.com>
	<1352452573.21048.35.camel@dagon.hellion.org.uk>
	<509CDDBA02000078000A772C@nat28.tlf.novell.com>
In-Reply-To: <509CDDBA02000078000A772C@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Ian Campbell <Ian.Campbell@citrix.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something issue in
 3.7-rc1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 09.11.12 at 10:40, "Jan Beulich" <JBeulich@suse.com> wrote:
>>>> On 09.11.12 at 10:16, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> On Fri, 2012-11-09 at 09:03 +0000, Jan Beulich wrote:
>>> >>> On 12.10.12 at 12:28, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>>> > The following patch causes fairly large packet loss when transmitting
>>> > from dom0 to the physical network, at least with my tg3 hardware, but I
>>> > assume it can impact anything which uses this interface.
>>> > 
>>> > I suspect that the issue is that the compound pages allocated in this
>>> > way are not backed by contiguous mfns and so things fall apart when the
>>> > driver tries to do DMA.
>>> 
>>> Has this seen any sort of resolution yet? Despite having forced
>>> NETDEV_FRAG_PAGE_MAX_ORDER to zero for Xen (following
>>> your suggested patch, Ian), and with a different NIC (e1000e
>>> driven) I'm seeing similar packet loss/corruption on transmits,
>>> and only if running a debug hypervisor (in a non-debug one,
>>> MFNs are largely contiguous, so this issue should be observable
>>> there only very rarely).
>> 
>> I think Konrad is still looking into the underlying swiotlb issue.
>> 
>> If you want to go with the workaround then there is another order>0 to
>> frob in net/core/sock.c
>> #define SKB_FRAG_PAGE_ORDER	get_order(32768)
>> which might help.
> 
> Thanks, that indeed helped. And gives me food for thought as
> well, since this should - if anything at all - be a performance
> improvement, not a something affecting correctness.

Okay, one problem in the pv-ops case seems pretty obvious:
dma_capable() does (potentially cross-page) arithmetic on a
dma_addr_t value, ignoring dis-contiguity altogether. Specifically
its first use in swiotlb_map_page() and its only use in
swiotlb_map_sg_attrs() are problematic.

In the forward ported kernels, those two checks are however
accompanied by range_needs_mapping() (aka
range_straddles_page_boundary()) checks, which ought to
take care of this. There is brokenness there with the invocations
of gnttab_dma_map_page(), but only if the initial offset is at
least PAGE_SIZE - will have to check whether that occurs.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 10:36:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 10:36:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWlwl-000097-Tu; Fri, 09 Nov 2012 10:36:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWlwj-00008x-Rw
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 10:36:22 +0000
Received: from [85.158.139.211:62238] by server-10.bemta-5.messagelabs.com id
	A2/11-09257-5ACDC905; Fri, 09 Nov 2012 10:36:21 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1352457380!19492075!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5MzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5214 invoked from network); 9 Nov 2012 10:36:20 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-206.messagelabs.com with SMTP;
	9 Nov 2012 10:36:20 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 09 Nov 2012 10:36:20 +0000
Message-Id: <509CEAB402000078000A7772@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 09 Nov 2012 10:36:20 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
References: <1350037688.14806.93.camel@zakaz.uk.xensource.com>
	<509CD50302000078000A76E4@nat28.tlf.novell.com>
	<1352452573.21048.35.camel@dagon.hellion.org.uk>
	<509CDDBA02000078000A772C@nat28.tlf.novell.com>
In-Reply-To: <509CDDBA02000078000A772C@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Ian Campbell <Ian.Campbell@citrix.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something issue in
 3.7-rc1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 09.11.12 at 10:40, "Jan Beulich" <JBeulich@suse.com> wrote:
>>>> On 09.11.12 at 10:16, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> On Fri, 2012-11-09 at 09:03 +0000, Jan Beulich wrote:
>>> >>> On 12.10.12 at 12:28, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>>> > The following patch causes fairly large packet loss when transmitting
>>> > from dom0 to the physical network, at least with my tg3 hardware, but I
>>> > assume it can impact anything which uses this interface.
>>> > 
>>> > I suspect that the issue is that the compound pages allocated in this
>>> > way are not backed by contiguous mfns and so things fall apart when the
>>> > driver tries to do DMA.
>>> 
>>> Has this seen any sort of resolution yet? Despite having forced
>>> NETDEV_FRAG_PAGE_MAX_ORDER to zero for Xen (following
>>> your suggested patch, Ian), and with a different NIC (e1000e
>>> driven) I'm seeing similar packet loss/corruption on transmits,
>>> and only if running a debug hypervisor (in a non-debug one,
>>> MFNs are largely contiguous, so this issue should be observable
>>> there only very rarely).
>> 
>> I think Konrad is still looking into the underlying swiotlb issue.
>> 
>> If you want to go with the workaround then there is another order>0 to
>> frob in net/core/sock.c
>> #define SKB_FRAG_PAGE_ORDER	get_order(32768)
>> which might help.
> 
> Thanks, that indeed helped. And gives me food for thought as
> well, since this should - if anything at all - be a performance
> improvement, not a something affecting correctness.

Okay, one problem in the pv-ops case seems pretty obvious:
dma_capable() does (potentially cross-page) arithmetic on a
dma_addr_t value, ignoring dis-contiguity altogether. Specifically
its first use in swiotlb_map_page() and its only use in
swiotlb_map_sg_attrs() are problematic.

In the forward ported kernels, those two checks are however
accompanied by range_needs_mapping() (aka
range_straddles_page_boundary()) checks, which ought to
take care of this. There is brokenness there with the invocations
of gnttab_dma_map_page(), but only if the initial offset is at
least PAGE_SIZE - will have to check whether that occurs.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 11:44:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 11:44:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWmzz-0002PX-3l; Fri, 09 Nov 2012 11:43:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWmzx-0002PP-AO
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 11:43:45 +0000
Received: from [85.158.138.51:19358] by server-7.bemta-3.messagelabs.com id
	68/37-01713-07CEC905; Fri, 09 Nov 2012 11:43:44 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352461419!21278908!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5MzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14423 invoked from network); 9 Nov 2012 11:43:39 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-174.messagelabs.com with SMTP;
	9 Nov 2012 11:43:39 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 09 Nov 2012 11:43:38 +0000
Message-Id: <509CFA7B02000078000A778C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 09 Nov 2012 11:43:39 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
References: <1350037688.14806.93.camel@zakaz.uk.xensource.com>
	<509CD50302000078000A76E4@nat28.tlf.novell.com>
	<1352452573.21048.35.camel@dagon.hellion.org.uk>
	<509CDDBA02000078000A772C@nat28.tlf.novell.com>
	<509CEAB402000078000A7772@nat28.tlf.novell.com>
In-Reply-To: <509CEAB402000078000A7772@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something issue in
 3.7-rc1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 09.11.12 at 11:36, "Jan Beulich" <JBeulich@suse.com> wrote:
> In the forward ported kernels, those two checks are however
> accompanied by range_needs_mapping() (aka
> range_straddles_page_boundary()) checks, which ought to
> take care of this. There is brokenness there with the invocations
> of gnttab_dma_map_page(), but only if the initial offset is at
> least PAGE_SIZE - will have to check whether that occurs.

And indeed, fixing this also makes the problem go away when
the allocation order doesn't get forced to zero. So presumably
there's also only that one problem I had pointed out in pv-ops.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 11:44:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 11:44:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWmzz-0002PX-3l; Fri, 09 Nov 2012 11:43:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWmzx-0002PP-AO
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 11:43:45 +0000
Received: from [85.158.138.51:19358] by server-7.bemta-3.messagelabs.com id
	68/37-01713-07CEC905; Fri, 09 Nov 2012 11:43:44 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352461419!21278908!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5MzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14423 invoked from network); 9 Nov 2012 11:43:39 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-174.messagelabs.com with SMTP;
	9 Nov 2012 11:43:39 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 09 Nov 2012 11:43:38 +0000
Message-Id: <509CFA7B02000078000A778C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 09 Nov 2012 11:43:39 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
References: <1350037688.14806.93.camel@zakaz.uk.xensource.com>
	<509CD50302000078000A76E4@nat28.tlf.novell.com>
	<1352452573.21048.35.camel@dagon.hellion.org.uk>
	<509CDDBA02000078000A772C@nat28.tlf.novell.com>
	<509CEAB402000078000A7772@nat28.tlf.novell.com>
In-Reply-To: <509CEAB402000078000A7772@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something issue in
 3.7-rc1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 09.11.12 at 11:36, "Jan Beulich" <JBeulich@suse.com> wrote:
> In the forward ported kernels, those two checks are however
> accompanied by range_needs_mapping() (aka
> range_straddles_page_boundary()) checks, which ought to
> take care of this. There is brokenness there with the invocations
> of gnttab_dma_map_page(), but only if the initial offset is at
> least PAGE_SIZE - will have to check whether that occurs.

And indeed, fixing this also makes the problem go away when
the allocation order doesn't get forced to zero. So presumably
there's also only that one problem I had pointed out in pv-ops.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 12:14:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 12:14:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWnT5-0003jF-6d; Fri, 09 Nov 2012 12:13:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <arnd@arndb.de>) id 1TWnT3-0003jA-JO
	for xen-devel@lists.xensource.com; Fri, 09 Nov 2012 12:13:49 +0000
Received: from [85.158.138.51:63597] by server-9.bemta-3.messagelabs.com id
	31/BA-02388-C73FC905; Fri, 09 Nov 2012 12:13:48 +0000
X-Env-Sender: arnd@arndb.de
X-Msg-Ref: server-9.tower-174.messagelabs.com!1352463228!29354865!1
X-Originating-IP: [212.227.17.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjEyLjIyNy4xNy4xMCA9PiA3NjQ1MQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13414 invoked from network); 9 Nov 2012 12:13:48 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.17.10)
	by server-9.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 12:13:48 -0000
Received: from klappe2.localnet (deibp9eh1--blueice3n2.emea.ibm.com
	[195.212.29.180])
	by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis)
	id 0MAidD-1TeByY3PWV-00Bmtm; Fri, 09 Nov 2012 13:13:33 +0100
From: Arnd Bergmann <arnd@arndb.de>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 8 Nov 2012 17:45:06 +0000
User-Agent: KMail/1.12.2 (Linux/3.5.0; KDE/4.3.2; x86_64; ; )
References: <20121106175749.GO28327@n2100.arm.linux.org.uk>
	<alpine.DEB.2.02.1211081544510.2689@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1211081554220.2689@kaball.uk.xensource.com>
In-Reply-To: <alpine.DEB.2.02.1211081554220.2689@kaball.uk.xensource.com>
MIME-Version: 1.0
Message-Id: <201211081745.06518.arnd@arndb.de>
X-Provags-ID: V02:K0:0ANu/2yDWfdGbxt+Zu0ph/t+O8fCyFxcCNH4NXC18Im
	GYgFKEKVgKvx+3QuLBo4Qh9Bn5WosP5LToOL13hly2O5uA+c6I
	C44IPuVv+npn/6I+rxMT6Z7z4LnpQ/iXDZC1hC7ZfVUY8/za/M
	7ZZ8YgwHOTH/rLS1+xXJefceuImJbIEPwQEIWFXjdPYwWzzGvg
	lwhn8N+fDJKqfac2McZC/ojjcfTUvodZwjb9cXnuhy87xoyufy
	NX+96OyB0KxcWsKpB81Uijvl8N0OnBv/5ZuuAZxaCBlrd7km8u
	noHWm55UpHSnuLFx8eGpM2ATLiv/BrwZSDnu/cg2Y56cKqrgKk
	UrfiQ9m0QAAeW7z/otY4=
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"arm@kernel.org" <arm@kernel.org>, "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Xen-devel] BUG: ARM build failures due to Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thursday 08 November 2012, Stefano Stabellini wrote:
> From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> 
> xen/arm: Fix compile errors when drivers are compiled as modules.
> 
> We end up with:
> 
> ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
> ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> ERROR: "HYPERVISOR_grant_table_op" [drivers/net/xen-netback/xen-netback.ko] undefined!
> 
> and this patch exports said function (which is implemented in hypercall.S).
> 
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 

Acked-by: Arnd Bergmann <arnd@arndb.de>

I guess it's best to merge that through the Xen tree.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 12:14:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 12:14:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWnT5-0003jF-6d; Fri, 09 Nov 2012 12:13:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <arnd@arndb.de>) id 1TWnT3-0003jA-JO
	for xen-devel@lists.xensource.com; Fri, 09 Nov 2012 12:13:49 +0000
Received: from [85.158.138.51:63597] by server-9.bemta-3.messagelabs.com id
	31/BA-02388-C73FC905; Fri, 09 Nov 2012 12:13:48 +0000
X-Env-Sender: arnd@arndb.de
X-Msg-Ref: server-9.tower-174.messagelabs.com!1352463228!29354865!1
X-Originating-IP: [212.227.17.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjEyLjIyNy4xNy4xMCA9PiA3NjQ1MQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13414 invoked from network); 9 Nov 2012 12:13:48 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.17.10)
	by server-9.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 12:13:48 -0000
Received: from klappe2.localnet (deibp9eh1--blueice3n2.emea.ibm.com
	[195.212.29.180])
	by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis)
	id 0MAidD-1TeByY3PWV-00Bmtm; Fri, 09 Nov 2012 13:13:33 +0100
From: Arnd Bergmann <arnd@arndb.de>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 8 Nov 2012 17:45:06 +0000
User-Agent: KMail/1.12.2 (Linux/3.5.0; KDE/4.3.2; x86_64; ; )
References: <20121106175749.GO28327@n2100.arm.linux.org.uk>
	<alpine.DEB.2.02.1211081544510.2689@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1211081554220.2689@kaball.uk.xensource.com>
In-Reply-To: <alpine.DEB.2.02.1211081554220.2689@kaball.uk.xensource.com>
MIME-Version: 1.0
Message-Id: <201211081745.06518.arnd@arndb.de>
X-Provags-ID: V02:K0:0ANu/2yDWfdGbxt+Zu0ph/t+O8fCyFxcCNH4NXC18Im
	GYgFKEKVgKvx+3QuLBo4Qh9Bn5WosP5LToOL13hly2O5uA+c6I
	C44IPuVv+npn/6I+rxMT6Z7z4LnpQ/iXDZC1hC7ZfVUY8/za/M
	7ZZ8YgwHOTH/rLS1+xXJefceuImJbIEPwQEIWFXjdPYwWzzGvg
	lwhn8N+fDJKqfac2McZC/ojjcfTUvodZwjb9cXnuhy87xoyufy
	NX+96OyB0KxcWsKpB81Uijvl8N0OnBv/5ZuuAZxaCBlrd7km8u
	noHWm55UpHSnuLFx8eGpM2ATLiv/BrwZSDnu/cg2Y56cKqrgKk
	UrfiQ9m0QAAeW7z/otY4=
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"arm@kernel.org" <arm@kernel.org>, "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Xen-devel] BUG: ARM build failures due to Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thursday 08 November 2012, Stefano Stabellini wrote:
> From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> 
> xen/arm: Fix compile errors when drivers are compiled as modules.
> 
> We end up with:
> 
> ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
> ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> ERROR: "HYPERVISOR_grant_table_op" [drivers/net/xen-netback/xen-netback.ko] undefined!
> 
> and this patch exports said function (which is implemented in hypercall.S).
> 
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 

Acked-by: Arnd Bergmann <arnd@arndb.de>

I guess it's best to merge that through the Xen tree.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 12:53:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 12:53:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWo50-0004XM-8P; Fri, 09 Nov 2012 12:53:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TWo4y-0004XF-S1
	for xen-devel@lists.xensource.com; Fri, 09 Nov 2012 12:53:01 +0000
Received: from [85.158.139.83:36328] by server-13.bemta-5.messagelabs.com id
	AF/77-27809-CACFC905; Fri, 09 Nov 2012 12:53:00 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352465577!22308602!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNDExMjM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28686 invoked from network); 9 Nov 2012 12:52:59 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-11.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 9 Nov 2012 12:52:59 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA9Cocjb010830
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 9 Nov 2012 12:50:39 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA9Cobra003397
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 9 Nov 2012 12:50:38 GMT
Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA9CoafA023623; Fri, 9 Nov 2012 06:50:37 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 09 Nov 2012 04:50:36 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id CB1444037A; Fri,  9 Nov 2012 07:50:33 -0500 (EST)
Date: Fri, 9 Nov 2012 07:50:33 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Arnd Bergmann <arnd@arndb.de>
Message-ID: <20121109125033.GA30634@phenom.dumpdata.com>
References: <20121106175749.GO28327@n2100.arm.linux.org.uk>
	<alpine.DEB.2.02.1211081544510.2689@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1211081554220.2689@kaball.uk.xensource.com>
	<201211081745.06518.arnd@arndb.de>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <201211081745.06518.arnd@arndb.de>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	"arm@kernel.org" <arm@kernel.org>, "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Xen-devel] BUG: ARM build failures due to Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 08, 2012 at 05:45:06PM +0000, Arnd Bergmann wrote:
> On Thursday 08 November 2012, Stefano Stabellini wrote:
> > From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > 
> > xen/arm: Fix compile errors when drivers are compiled as modules.
> > 
> > We end up with:
> > 
> > ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
> > ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> > ERROR: "HYPERVISOR_grant_table_op" [drivers/net/xen-netback/xen-netback.ko] undefined!
> > 
> > and this patch exports said function (which is implemented in hypercall.S).
> > 
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > 
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> 
> I guess it's best to merge that through the Xen tree.

applied.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 12:53:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 12:53:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWo50-0004XM-8P; Fri, 09 Nov 2012 12:53:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TWo4y-0004XF-S1
	for xen-devel@lists.xensource.com; Fri, 09 Nov 2012 12:53:01 +0000
Received: from [85.158.139.83:36328] by server-13.bemta-5.messagelabs.com id
	AF/77-27809-CACFC905; Fri, 09 Nov 2012 12:53:00 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352465577!22308602!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNDExMjM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28686 invoked from network); 9 Nov 2012 12:52:59 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-11.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 9 Nov 2012 12:52:59 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA9Cocjb010830
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 9 Nov 2012 12:50:39 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA9Cobra003397
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 9 Nov 2012 12:50:38 GMT
Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA9CoafA023623; Fri, 9 Nov 2012 06:50:37 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 09 Nov 2012 04:50:36 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id CB1444037A; Fri,  9 Nov 2012 07:50:33 -0500 (EST)
Date: Fri, 9 Nov 2012 07:50:33 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Arnd Bergmann <arnd@arndb.de>
Message-ID: <20121109125033.GA30634@phenom.dumpdata.com>
References: <20121106175749.GO28327@n2100.arm.linux.org.uk>
	<alpine.DEB.2.02.1211081544510.2689@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1211081554220.2689@kaball.uk.xensource.com>
	<201211081745.06518.arnd@arndb.de>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <201211081745.06518.arnd@arndb.de>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	"arm@kernel.org" <arm@kernel.org>, "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Xen-devel] BUG: ARM build failures due to Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 08, 2012 at 05:45:06PM +0000, Arnd Bergmann wrote:
> On Thursday 08 November 2012, Stefano Stabellini wrote:
> > From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > 
> > xen/arm: Fix compile errors when drivers are compiled as modules.
> > 
> > We end up with:
> > 
> > ERROR: "HYPERVISOR_event_channel_op" [drivers/xen/xen-gntdev.ko] undefined!
> > ERROR: "privcmd_call" [drivers/xen/xen-privcmd.ko] undefined!
> > ERROR: "HYPERVISOR_grant_table_op" [drivers/net/xen-netback/xen-netback.ko] undefined!
> > 
> > and this patch exports said function (which is implemented in hypercall.S).
> > 
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > 
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> 
> I guess it's best to merge that through the Xen tree.

applied.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 13:21:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 13:21:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWoWG-0004p0-0s; Fri, 09 Nov 2012 13:21:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWoWD-0004os-NR
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 13:21:10 +0000
Received: from [85.158.138.51:39794] by server-10.bemta-3.messagelabs.com id
	63/71-19806-0430D905; Fri, 09 Nov 2012 13:21:04 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1352467263!25338108!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5MzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1171 invoked from network); 9 Nov 2012 13:21:03 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-174.messagelabs.com with SMTP;
	9 Nov 2012 13:21:03 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 09 Nov 2012 13:21:04 +0000
Message-Id: <509D114F02000078000A77CC@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 09 Nov 2012 13:21:03 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part89B8492F.0__="
Subject: [Xen-devel] [PATCH] linux-2.6.18: make gnttab_dma_map_page()
 compound page aware
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part89B8492F.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

While this was found to be a problem in practice only on recent
kernels, it was nevertheless a mistake from the beginning to not take
into consideration compound pages.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/arch/i386/kernel/pci-dma-xen.c
+++ b/arch/i386/kernel/pci-dma-xen.c
@@ -120,7 +120,7 @@ dma_map_sg(struct device *hwdev, struct=20
 		for (i =3D 0; i < nents; i++ ) {
 			BUG_ON(!sg[i].page);
 			sg[i].dma_address =3D
-				gnttab_dma_map_page(sg[i].page) + =
sg[i].offset;
+				gnttab_dma_map_page(sg[i].page, sg[i].offse=
t);
 			sg[i].dma_length  =3D sg[i].length;
 			IOMMU_BUG_ON(address_needs_mapping(
 				hwdev, sg[i].dma_address));
@@ -165,7 +165,7 @@ dma_map_page(struct device *dev, struct=20
 		dma_addr =3D swiotlb_map_page(
 			dev, page, offset, size, direction);
 	} else {
-		dma_addr =3D gnttab_dma_map_page(page) + offset;
+		dma_addr =3D gnttab_dma_map_page(page, offset);
 		IOMMU_BUG_ON(address_needs_mapping(dev, dma_addr));
 	}
=20
@@ -363,8 +363,8 @@ dma_map_single(struct device *dev, void=20
 	if (swiotlb) {
 		dma =3D swiotlb_map_single(dev, ptr, size, direction);
 	} else {
-		dma =3D gnttab_dma_map_page(virt_to_page(ptr)) +
-		      offset_in_page(ptr);
+		dma =3D gnttab_dma_map_page(virt_to_page(ptr),
+					  offset_in_page(ptr));
 		IOMMU_BUG_ON(range_straddles_page_boundary(__pa(ptr), =
size));
 		IOMMU_BUG_ON(address_needs_mapping(dev, dma));
 	}
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -1522,7 +1522,7 @@ dma_map_sg(struct device *hwdev, struct=20
 		for (sg =3D sglist ; filled < nents ; filled++, sg++){
 			sg->dma_length =3D sg->length;
 #ifdef CONFIG_XEN
-			sg->dma_address =3D gnttab_dma_map_page(sg->page) =
+ sg->offset;
+			sg->dma_address =3D gnttab_dma_map_page(sg->page, =
sg->offset);
 #else
 			sg->dma_address =3D virt_to_bus(sba_sg_address(sg))=
;
 #endif
--- a/arch/ia64/xen/xen_dma.c
+++ b/arch/ia64/xen/xen_dma.c
@@ -92,7 +92,7 @@ dma_map_sg(struct device *hwdev, struct=20
 	int i;
=20
 	for (i =3D 0 ; i < nents ; i++) {
-		sg[i].dma_address =3D gnttab_dma_map_page(sg[i].page) + =
sg[i].offset;
+		sg[i].dma_address =3D gnttab_dma_map_page(sg[i].page, =
sg[i].offset);
 		sg[i].dma_length  =3D sg[i].length;
=20
 		IOMMU_BUG_ON(address_needs_mapping(dev, sg[i].dma_address))=
;
--- a/drivers/xen/core/gnttab.c
+++ b/drivers/xen/core/gnttab.c
@@ -705,6 +705,8 @@ void __gnttab_dma_map_page(struct page *
 	if (!is_running_on_xen() || !PageForeign(page))
 		return;
=20
+	BUG_ON(PageCompound(page));
+
 	do {
 		seq =3D read_seqbegin(&gnttab_dma_lock);
=20
--- a/include/asm-i386/mach-xen/asm/gnttab_dma.h
+++ b/include/asm-i386/mach-xen/asm/gnttab_dma.h
@@ -21,16 +21,24 @@
 #ifndef _ASM_I386_GNTTAB_DMA_H
 #define _ASM_I386_GNTTAB_DMA_H
=20
+#include <asm/bug.h>
+
 static inline int gnttab_dma_local_pfn(struct page *page)
 {
 	/* Has it become a local MFN? */
 	return pfn_valid(mfn_to_local_pfn(pfn_to_mfn(page_to_pfn(page))));
 }
=20
-static inline maddr_t gnttab_dma_map_page(struct page *page)
+static inline maddr_t gnttab_dma_map_page(struct page *page,
+					  unsigned long offset)
 {
+	unsigned int pgnr =3D offset >> PAGE_SHIFT;
+	unsigned int order =3D PageCompound(page) ? (long)page[1].lru.prev =
: 0;
+
+	BUG_ON(pgnr >> order);
 	__gnttab_dma_map_page(page);
-	return ((maddr_t)pfn_to_mfn(page_to_pfn(page)) << PAGE_SHIFT);
+	return ((maddr_t)pfn_to_mfn(page_to_pfn(page) + pgnr) << PAGE_SHIFT=
)
+	       + (offset & ~PAGE_MASK);
 }
=20
 static inline void gnttab_dma_unmap_page(maddr_t maddr)
--- a/include/asm-ia64/gnttab_dma.h
+++ b/include/asm-ia64/gnttab_dma.h
@@ -21,6 +21,8 @@
 #ifndef _ASM_IA64_GNTTAB_DMA_H
 #define _ASM_IA64_GNTTAB_DMA_H
=20
+#include <asm/bug.h>
+
 static inline int gnttab_dma_local_pfn(struct page *page)
 {
 	return 0;
@@ -32,10 +34,15 @@
 	__gnttab_dma_map_page(page);
 }
=20
-static inline dma_addr_t gnttab_dma_map_page(struct page *page)
+static inline dma_addr_t gnttab_dma_map_page(struct page *page,
+					     unsigned long offset)
 {
+	unsigned int pgnr =3D offset >> PAGE_SHIFT;
+	unsigned int order =3D PageCompound(page) ? (long)page[1].lru.prev =
: 0;
+
+	BUG_ON(pgnr >> order);
 	gnttab_dma_use_page(page);
-	return page_to_bus(page);
+	return page_to_bus(page + pgnr) + (offset & ~PAGE_MASK);
 }
=20
 static inline dma_addr_t gnttab_dma_map_virt(void *ptr)
--- a/lib/swiotlb-xen.c
+++ b/lib/swiotlb-xen.c
@@ -501,8 +501,8 @@ swiotlb_full(struct device *dev, size_t=20
 dma_addr_t
 swiotlb_map_single(struct device *hwdev, void *ptr, size_t size, int dir)
 {
-	dma_addr_t dev_addr =3D gnttab_dma_map_page(virt_to_page(ptr)) +
-			      offset_in_page(ptr);
+	dma_addr_t dev_addr =3D gnttab_dma_map_page(virt_to_page(ptr),
+						  offset_in_page(ptr));
 	void *map;
 	struct phys_addr buffer;
=20
@@ -613,7 +613,7 @@ swiotlb_map_sg(struct device *hwdev, str
 	BUG_ON(dir =3D=3D DMA_NONE);
=20
 	for (i =3D 0; i < nelems; i++, sg++) {
-		dev_addr =3D gnttab_dma_map_page(sg->page) + sg->offset;
+		dev_addr =3D gnttab_dma_map_page(sg->page, sg->offset);
=20
 		if (range_straddles_page_boundary(page_to_pseudophys(sg->pa=
ge)
 						  + sg->offset, sg->length)=

@@ -705,7 +705,7 @@ swiotlb_map_page(struct device *hwdev, s
 	dma_addr_t dev_addr;
 	char *map;
=20
-	dev_addr =3D gnttab_dma_map_page(page) + offset;
+	dev_addr =3D gnttab_dma_map_page(page, offset);
 	if (address_needs_mapping(hwdev, dev_addr)) {
 		gnttab_dma_unmap_page(dev_addr);
 		buffer.page   =3D page;



--=__Part89B8492F.0__=
Content-Type: text/plain; name="xen-gnttab-map-compound-page.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-gnttab-map-compound-page.patch"

make gnttab_dma_map_page() compound page aware=0A=0AWhile this was found =
to be a problem in practice only on recent=0Akernels, it was nevertheless =
a mistake from the beginning to not take=0Ainto consideration compound =
pages.=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- =
a/arch/i386/kernel/pci-dma-xen.c=0A+++ b/arch/i386/kernel/pci-dma-xen.c=0A@=
@ -120,7 +120,7 @@ dma_map_sg(struct device *hwdev, struct =0A 		=
for (i =3D 0; i < nents; i++ ) {=0A 			BUG_ON(!sg[i].page)=
;=0A 			sg[i].dma_address =3D=0A-				=
gnttab_dma_map_page(sg[i].page) + sg[i].offset;=0A+				=
gnttab_dma_map_page(sg[i].page, sg[i].offset);=0A 			=
sg[i].dma_length  =3D sg[i].length;=0A 			IOMMU_BUG_ON(addres=
s_needs_mapping(=0A 				hwdev, sg[i].dma_address));=
=0A@@ -165,7 +165,7 @@ dma_map_page(struct device *dev, struct =0A 		=
dma_addr =3D swiotlb_map_page(=0A 			dev, page, offset, =
size, direction);=0A 	} else {=0A-		dma_addr =3D gnttab_dma_map=
_page(page) + offset;=0A+		dma_addr =3D gnttab_dma_map_page(pa=
ge, offset);=0A 		IOMMU_BUG_ON(address_needs_mapping(dev, =
dma_addr));=0A 	}=0A =0A@@ -363,8 +363,8 @@ dma_map_single(struct device =
*dev, void =0A 	if (swiotlb) {=0A 		dma =3D swiotlb_map_single(=
dev, ptr, size, direction);=0A 	} else {=0A-		dma =3D gnttab_dma_=
map_page(virt_to_page(ptr)) +=0A-		      offset_in_page(ptr);=
=0A+		dma =3D gnttab_dma_map_page(virt_to_page(ptr),=0A+		=
			  offset_in_page(ptr));=0A 		IOMMU_BUG_O=
N(range_straddles_page_boundary(__pa(ptr), size));=0A 		IOMMU_BUG_O=
N(address_needs_mapping(dev, dma));=0A 	}=0A--- a/arch/ia64/hp/common/sba_i=
ommu.c=0A+++ b/arch/ia64/hp/common/sba_iommu.c=0A@@ -1522,7 +1522,7 @@ =
dma_map_sg(struct device *hwdev, struct =0A 		for (sg =3D sglist =
; filled < nents ; filled++, sg++){=0A 			sg->dma_length =3D =
sg->length;=0A #ifdef CONFIG_XEN=0A-			sg->dma_address =
=3D gnttab_dma_map_page(sg->page) + sg->offset;=0A+			=
sg->dma_address =3D gnttab_dma_map_page(sg->page, sg->offset);=0A #else=0A =
			sg->dma_address =3D virt_to_bus(sba_sg_address(sg))=
;=0A #endif=0A--- a/arch/ia64/xen/xen_dma.c=0A+++ b/arch/ia64/xen/xen_dma.c=
=0A@@ -92,7 +92,7 @@ dma_map_sg(struct device *hwdev, struct =0A 	=
int i;=0A =0A 	for (i =3D 0 ; i < nents ; i++) {=0A-		sg[i].dma_a=
ddress =3D gnttab_dma_map_page(sg[i].page) + sg[i].offset;=0A+		=
sg[i].dma_address =3D gnttab_dma_map_page(sg[i].page, sg[i].offset);=0A 	=
	sg[i].dma_length  =3D sg[i].length;=0A =0A 		IOMMU_BUG_O=
N(address_needs_mapping(dev, sg[i].dma_address));=0A--- a/drivers/xen/core/=
gnttab.c=0A+++ b/drivers/xen/core/gnttab.c=0A@@ -705,6 +705,8 @@ void =
__gnttab_dma_map_page(struct page *=0A 	if (!is_running_on_xen() || =
!PageForeign(page))=0A 		return;=0A =0A+	BUG_ON(PageCompound(page));=
=0A+=0A 	do {=0A 		seq =3D read_seqbegin(&gnttab_dma_l=
ock);=0A =0A--- a/include/asm-i386/mach-xen/asm/gnttab_dma.h=0A+++ =
b/include/asm-i386/mach-xen/asm/gnttab_dma.h=0A@@ -21,16 +21,24 @@=0A =
#ifndef _ASM_I386_GNTTAB_DMA_H=0A #define _ASM_I386_GNTTAB_DMA_H=0A =
=0A+#include <asm/bug.h>=0A+=0A static inline int gnttab_dma_local_pfn(stru=
ct page *page)=0A {=0A 	/* Has it become a local MFN? */=0A 	return =
pfn_valid(mfn_to_local_pfn(pfn_to_mfn(page_to_pfn(page))));=0A }=0A =
=0A-static inline maddr_t gnttab_dma_map_page(struct page *page)=0A+static =
inline maddr_t gnttab_dma_map_page(struct page *page,=0A+			=
		  unsigned long offset)=0A {=0A+	unsigned int pgnr =
=3D offset >> PAGE_SHIFT;=0A+	unsigned int order =3D PageCompound(page) =
? (long)page[1].lru.prev : 0;=0A+=0A+	BUG_ON(pgnr >> order);=0A 	=
__gnttab_dma_map_page(page);=0A-	return ((maddr_t)pfn_to_mfn(page_to=
_pfn(page)) << PAGE_SHIFT);=0A+	return ((maddr_t)pfn_to_mfn(page_to_pfn(pag=
e) + pgnr) << PAGE_SHIFT)=0A+	       + (offset & ~PAGE_MASK);=0A }=0A =
=0A static inline void gnttab_dma_unmap_page(maddr_t maddr)=0A--- =
a/include/asm-ia64/gnttab_dma.h=0A+++ b/include/asm-ia64/gnttab_dma.h=0A@@ =
-21,6 +21,8 @@=0A #ifndef _ASM_IA64_GNTTAB_DMA_H=0A #define _ASM_IA64_GNTTA=
B_DMA_H=0A =0A+#include <asm/bug.h>=0A+=0A static inline int gnttab_dma_loc=
al_pfn(struct page *page)=0A {=0A 	return 0;=0A@@ -32,10 +34,15 @@=0A =
	__gnttab_dma_map_page(page);=0A }=0A =0A-static inline dma_addr_t =
gnttab_dma_map_page(struct page *page)=0A+static inline dma_addr_t =
gnttab_dma_map_page(struct page *page,=0A+					=
     unsigned long offset)=0A {=0A+	unsigned int pgnr =3D offset >> =
PAGE_SHIFT;=0A+	unsigned int order =3D PageCompound(page) ? (long)page[1].l=
ru.prev : 0;=0A+=0A+	BUG_ON(pgnr >> order);=0A 	gnttab_dma_use_page=
(page);=0A-	return page_to_bus(page);=0A+	return page_to_bus(page + =
pgnr) + (offset & ~PAGE_MASK);=0A }=0A =0A static inline dma_addr_t =
gnttab_dma_map_virt(void *ptr)=0A--- a/lib/swiotlb-xen.c=0A+++ b/lib/swiotl=
b-xen.c=0A@@ -501,8 +501,8 @@ swiotlb_full(struct device *dev, size_t =0A =
dma_addr_t=0A swiotlb_map_single(struct device *hwdev, void *ptr, size_t =
size, int dir)=0A {=0A-	dma_addr_t dev_addr =3D gnttab_dma_map_page(virt_to=
_page(ptr)) +=0A-			      offset_in_page(ptr);=0A+	=
dma_addr_t dev_addr =3D gnttab_dma_map_page(virt_to_page(ptr),=0A+		=
				  offset_in_page(ptr));=0A 	void =
*map;=0A 	struct phys_addr buffer;=0A =0A@@ -613,7 +613,7 @@ =
swiotlb_map_sg(struct device *hwdev, str=0A 	BUG_ON(dir =3D=3D =
DMA_NONE);=0A =0A 	for (i =3D 0; i < nelems; i++, sg++) {=0A-		=
dev_addr =3D gnttab_dma_map_page(sg->page) + sg->offset;=0A+		=
dev_addr =3D gnttab_dma_map_page(sg->page, sg->offset);=0A =0A 		if =
(range_straddles_page_boundary(page_to_pseudophys(sg->page)=0A 			=
			  + sg->offset, sg->length)=0A@@ -705,7 +705,7 @@ =
swiotlb_map_page(struct device *hwdev, s=0A 	dma_addr_t dev_addr;=0A 	=
char *map;=0A =0A-	dev_addr =3D gnttab_dma_map_page(page) + offset;=0A=
+	dev_addr =3D gnttab_dma_map_page(page, offset);=0A 	if =
(address_needs_mapping(hwdev, dev_addr)) {=0A 		gnttab_dma_unmap_pa=
ge(dev_addr);=0A 		buffer.page   =3D page;=0A
--=__Part89B8492F.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.xen.org
http://lists.xen.org/xen-devel

--=__Part89B8492F.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 09 13:21:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 13:21:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWoWG-0004p0-0s; Fri, 09 Nov 2012 13:21:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWoWD-0004os-NR
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 13:21:10 +0000
Received: from [85.158.138.51:39794] by server-10.bemta-3.messagelabs.com id
	63/71-19806-0430D905; Fri, 09 Nov 2012 13:21:04 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1352467263!25338108!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5MzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1171 invoked from network); 9 Nov 2012 13:21:03 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-174.messagelabs.com with SMTP;
	9 Nov 2012 13:21:03 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 09 Nov 2012 13:21:04 +0000
Message-Id: <509D114F02000078000A77CC@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 09 Nov 2012 13:21:03 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part89B8492F.0__="
Subject: [Xen-devel] [PATCH] linux-2.6.18: make gnttab_dma_map_page()
 compound page aware
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part89B8492F.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

While this was found to be a problem in practice only on recent
kernels, it was nevertheless a mistake from the beginning to not take
into consideration compound pages.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/arch/i386/kernel/pci-dma-xen.c
+++ b/arch/i386/kernel/pci-dma-xen.c
@@ -120,7 +120,7 @@ dma_map_sg(struct device *hwdev, struct=20
 		for (i =3D 0; i < nents; i++ ) {
 			BUG_ON(!sg[i].page);
 			sg[i].dma_address =3D
-				gnttab_dma_map_page(sg[i].page) + =
sg[i].offset;
+				gnttab_dma_map_page(sg[i].page, sg[i].offse=
t);
 			sg[i].dma_length  =3D sg[i].length;
 			IOMMU_BUG_ON(address_needs_mapping(
 				hwdev, sg[i].dma_address));
@@ -165,7 +165,7 @@ dma_map_page(struct device *dev, struct=20
 		dma_addr =3D swiotlb_map_page(
 			dev, page, offset, size, direction);
 	} else {
-		dma_addr =3D gnttab_dma_map_page(page) + offset;
+		dma_addr =3D gnttab_dma_map_page(page, offset);
 		IOMMU_BUG_ON(address_needs_mapping(dev, dma_addr));
 	}
=20
@@ -363,8 +363,8 @@ dma_map_single(struct device *dev, void=20
 	if (swiotlb) {
 		dma =3D swiotlb_map_single(dev, ptr, size, direction);
 	} else {
-		dma =3D gnttab_dma_map_page(virt_to_page(ptr)) +
-		      offset_in_page(ptr);
+		dma =3D gnttab_dma_map_page(virt_to_page(ptr),
+					  offset_in_page(ptr));
 		IOMMU_BUG_ON(range_straddles_page_boundary(__pa(ptr), =
size));
 		IOMMU_BUG_ON(address_needs_mapping(dev, dma));
 	}
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -1522,7 +1522,7 @@ dma_map_sg(struct device *hwdev, struct=20
 		for (sg =3D sglist ; filled < nents ; filled++, sg++){
 			sg->dma_length =3D sg->length;
 #ifdef CONFIG_XEN
-			sg->dma_address =3D gnttab_dma_map_page(sg->page) =
+ sg->offset;
+			sg->dma_address =3D gnttab_dma_map_page(sg->page, =
sg->offset);
 #else
 			sg->dma_address =3D virt_to_bus(sba_sg_address(sg))=
;
 #endif
--- a/arch/ia64/xen/xen_dma.c
+++ b/arch/ia64/xen/xen_dma.c
@@ -92,7 +92,7 @@ dma_map_sg(struct device *hwdev, struct=20
 	int i;
=20
 	for (i =3D 0 ; i < nents ; i++) {
-		sg[i].dma_address =3D gnttab_dma_map_page(sg[i].page) + =
sg[i].offset;
+		sg[i].dma_address =3D gnttab_dma_map_page(sg[i].page, =
sg[i].offset);
 		sg[i].dma_length  =3D sg[i].length;
=20
 		IOMMU_BUG_ON(address_needs_mapping(dev, sg[i].dma_address))=
;
--- a/drivers/xen/core/gnttab.c
+++ b/drivers/xen/core/gnttab.c
@@ -705,6 +705,8 @@ void __gnttab_dma_map_page(struct page *
 	if (!is_running_on_xen() || !PageForeign(page))
 		return;
=20
+	BUG_ON(PageCompound(page));
+
 	do {
 		seq =3D read_seqbegin(&gnttab_dma_lock);
=20
--- a/include/asm-i386/mach-xen/asm/gnttab_dma.h
+++ b/include/asm-i386/mach-xen/asm/gnttab_dma.h
@@ -21,16 +21,24 @@
 #ifndef _ASM_I386_GNTTAB_DMA_H
 #define _ASM_I386_GNTTAB_DMA_H
=20
+#include <asm/bug.h>
+
 static inline int gnttab_dma_local_pfn(struct page *page)
 {
 	/* Has it become a local MFN? */
 	return pfn_valid(mfn_to_local_pfn(pfn_to_mfn(page_to_pfn(page))));
 }
=20
-static inline maddr_t gnttab_dma_map_page(struct page *page)
+static inline maddr_t gnttab_dma_map_page(struct page *page,
+					  unsigned long offset)
 {
+	unsigned int pgnr =3D offset >> PAGE_SHIFT;
+	unsigned int order =3D PageCompound(page) ? (long)page[1].lru.prev =
: 0;
+
+	BUG_ON(pgnr >> order);
 	__gnttab_dma_map_page(page);
-	return ((maddr_t)pfn_to_mfn(page_to_pfn(page)) << PAGE_SHIFT);
+	return ((maddr_t)pfn_to_mfn(page_to_pfn(page) + pgnr) << PAGE_SHIFT=
)
+	       + (offset & ~PAGE_MASK);
 }
=20
 static inline void gnttab_dma_unmap_page(maddr_t maddr)
--- a/include/asm-ia64/gnttab_dma.h
+++ b/include/asm-ia64/gnttab_dma.h
@@ -21,6 +21,8 @@
 #ifndef _ASM_IA64_GNTTAB_DMA_H
 #define _ASM_IA64_GNTTAB_DMA_H
=20
+#include <asm/bug.h>
+
 static inline int gnttab_dma_local_pfn(struct page *page)
 {
 	return 0;
@@ -32,10 +34,15 @@
 	__gnttab_dma_map_page(page);
 }
=20
-static inline dma_addr_t gnttab_dma_map_page(struct page *page)
+static inline dma_addr_t gnttab_dma_map_page(struct page *page,
+					     unsigned long offset)
 {
+	unsigned int pgnr =3D offset >> PAGE_SHIFT;
+	unsigned int order =3D PageCompound(page) ? (long)page[1].lru.prev =
: 0;
+
+	BUG_ON(pgnr >> order);
 	gnttab_dma_use_page(page);
-	return page_to_bus(page);
+	return page_to_bus(page + pgnr) + (offset & ~PAGE_MASK);
 }
=20
 static inline dma_addr_t gnttab_dma_map_virt(void *ptr)
--- a/lib/swiotlb-xen.c
+++ b/lib/swiotlb-xen.c
@@ -501,8 +501,8 @@ swiotlb_full(struct device *dev, size_t=20
 dma_addr_t
 swiotlb_map_single(struct device *hwdev, void *ptr, size_t size, int dir)
 {
-	dma_addr_t dev_addr =3D gnttab_dma_map_page(virt_to_page(ptr)) +
-			      offset_in_page(ptr);
+	dma_addr_t dev_addr =3D gnttab_dma_map_page(virt_to_page(ptr),
+						  offset_in_page(ptr));
 	void *map;
 	struct phys_addr buffer;
=20
@@ -613,7 +613,7 @@ swiotlb_map_sg(struct device *hwdev, str
 	BUG_ON(dir =3D=3D DMA_NONE);
=20
 	for (i =3D 0; i < nelems; i++, sg++) {
-		dev_addr =3D gnttab_dma_map_page(sg->page) + sg->offset;
+		dev_addr =3D gnttab_dma_map_page(sg->page, sg->offset);
=20
 		if (range_straddles_page_boundary(page_to_pseudophys(sg->pa=
ge)
 						  + sg->offset, sg->length)=

@@ -705,7 +705,7 @@ swiotlb_map_page(struct device *hwdev, s
 	dma_addr_t dev_addr;
 	char *map;
=20
-	dev_addr =3D gnttab_dma_map_page(page) + offset;
+	dev_addr =3D gnttab_dma_map_page(page, offset);
 	if (address_needs_mapping(hwdev, dev_addr)) {
 		gnttab_dma_unmap_page(dev_addr);
 		buffer.page   =3D page;



--=__Part89B8492F.0__=
Content-Type: text/plain; name="xen-gnttab-map-compound-page.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-gnttab-map-compound-page.patch"

make gnttab_dma_map_page() compound page aware=0A=0AWhile this was found =
to be a problem in practice only on recent=0Akernels, it was nevertheless =
a mistake from the beginning to not take=0Ainto consideration compound =
pages.=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- =
a/arch/i386/kernel/pci-dma-xen.c=0A+++ b/arch/i386/kernel/pci-dma-xen.c=0A@=
@ -120,7 +120,7 @@ dma_map_sg(struct device *hwdev, struct =0A 		=
for (i =3D 0; i < nents; i++ ) {=0A 			BUG_ON(!sg[i].page)=
;=0A 			sg[i].dma_address =3D=0A-				=
gnttab_dma_map_page(sg[i].page) + sg[i].offset;=0A+				=
gnttab_dma_map_page(sg[i].page, sg[i].offset);=0A 			=
sg[i].dma_length  =3D sg[i].length;=0A 			IOMMU_BUG_ON(addres=
s_needs_mapping(=0A 				hwdev, sg[i].dma_address));=
=0A@@ -165,7 +165,7 @@ dma_map_page(struct device *dev, struct =0A 		=
dma_addr =3D swiotlb_map_page(=0A 			dev, page, offset, =
size, direction);=0A 	} else {=0A-		dma_addr =3D gnttab_dma_map=
_page(page) + offset;=0A+		dma_addr =3D gnttab_dma_map_page(pa=
ge, offset);=0A 		IOMMU_BUG_ON(address_needs_mapping(dev, =
dma_addr));=0A 	}=0A =0A@@ -363,8 +363,8 @@ dma_map_single(struct device =
*dev, void =0A 	if (swiotlb) {=0A 		dma =3D swiotlb_map_single(=
dev, ptr, size, direction);=0A 	} else {=0A-		dma =3D gnttab_dma_=
map_page(virt_to_page(ptr)) +=0A-		      offset_in_page(ptr);=
=0A+		dma =3D gnttab_dma_map_page(virt_to_page(ptr),=0A+		=
			  offset_in_page(ptr));=0A 		IOMMU_BUG_O=
N(range_straddles_page_boundary(__pa(ptr), size));=0A 		IOMMU_BUG_O=
N(address_needs_mapping(dev, dma));=0A 	}=0A--- a/arch/ia64/hp/common/sba_i=
ommu.c=0A+++ b/arch/ia64/hp/common/sba_iommu.c=0A@@ -1522,7 +1522,7 @@ =
dma_map_sg(struct device *hwdev, struct =0A 		for (sg =3D sglist =
; filled < nents ; filled++, sg++){=0A 			sg->dma_length =3D =
sg->length;=0A #ifdef CONFIG_XEN=0A-			sg->dma_address =
=3D gnttab_dma_map_page(sg->page) + sg->offset;=0A+			=
sg->dma_address =3D gnttab_dma_map_page(sg->page, sg->offset);=0A #else=0A =
			sg->dma_address =3D virt_to_bus(sba_sg_address(sg))=
;=0A #endif=0A--- a/arch/ia64/xen/xen_dma.c=0A+++ b/arch/ia64/xen/xen_dma.c=
=0A@@ -92,7 +92,7 @@ dma_map_sg(struct device *hwdev, struct =0A 	=
int i;=0A =0A 	for (i =3D 0 ; i < nents ; i++) {=0A-		sg[i].dma_a=
ddress =3D gnttab_dma_map_page(sg[i].page) + sg[i].offset;=0A+		=
sg[i].dma_address =3D gnttab_dma_map_page(sg[i].page, sg[i].offset);=0A 	=
	sg[i].dma_length  =3D sg[i].length;=0A =0A 		IOMMU_BUG_O=
N(address_needs_mapping(dev, sg[i].dma_address));=0A--- a/drivers/xen/core/=
gnttab.c=0A+++ b/drivers/xen/core/gnttab.c=0A@@ -705,6 +705,8 @@ void =
__gnttab_dma_map_page(struct page *=0A 	if (!is_running_on_xen() || =
!PageForeign(page))=0A 		return;=0A =0A+	BUG_ON(PageCompound(page));=
=0A+=0A 	do {=0A 		seq =3D read_seqbegin(&gnttab_dma_l=
ock);=0A =0A--- a/include/asm-i386/mach-xen/asm/gnttab_dma.h=0A+++ =
b/include/asm-i386/mach-xen/asm/gnttab_dma.h=0A@@ -21,16 +21,24 @@=0A =
#ifndef _ASM_I386_GNTTAB_DMA_H=0A #define _ASM_I386_GNTTAB_DMA_H=0A =
=0A+#include <asm/bug.h>=0A+=0A static inline int gnttab_dma_local_pfn(stru=
ct page *page)=0A {=0A 	/* Has it become a local MFN? */=0A 	return =
pfn_valid(mfn_to_local_pfn(pfn_to_mfn(page_to_pfn(page))));=0A }=0A =
=0A-static inline maddr_t gnttab_dma_map_page(struct page *page)=0A+static =
inline maddr_t gnttab_dma_map_page(struct page *page,=0A+			=
		  unsigned long offset)=0A {=0A+	unsigned int pgnr =
=3D offset >> PAGE_SHIFT;=0A+	unsigned int order =3D PageCompound(page) =
? (long)page[1].lru.prev : 0;=0A+=0A+	BUG_ON(pgnr >> order);=0A 	=
__gnttab_dma_map_page(page);=0A-	return ((maddr_t)pfn_to_mfn(page_to=
_pfn(page)) << PAGE_SHIFT);=0A+	return ((maddr_t)pfn_to_mfn(page_to_pfn(pag=
e) + pgnr) << PAGE_SHIFT)=0A+	       + (offset & ~PAGE_MASK);=0A }=0A =
=0A static inline void gnttab_dma_unmap_page(maddr_t maddr)=0A--- =
a/include/asm-ia64/gnttab_dma.h=0A+++ b/include/asm-ia64/gnttab_dma.h=0A@@ =
-21,6 +21,8 @@=0A #ifndef _ASM_IA64_GNTTAB_DMA_H=0A #define _ASM_IA64_GNTTA=
B_DMA_H=0A =0A+#include <asm/bug.h>=0A+=0A static inline int gnttab_dma_loc=
al_pfn(struct page *page)=0A {=0A 	return 0;=0A@@ -32,10 +34,15 @@=0A =
	__gnttab_dma_map_page(page);=0A }=0A =0A-static inline dma_addr_t =
gnttab_dma_map_page(struct page *page)=0A+static inline dma_addr_t =
gnttab_dma_map_page(struct page *page,=0A+					=
     unsigned long offset)=0A {=0A+	unsigned int pgnr =3D offset >> =
PAGE_SHIFT;=0A+	unsigned int order =3D PageCompound(page) ? (long)page[1].l=
ru.prev : 0;=0A+=0A+	BUG_ON(pgnr >> order);=0A 	gnttab_dma_use_page=
(page);=0A-	return page_to_bus(page);=0A+	return page_to_bus(page + =
pgnr) + (offset & ~PAGE_MASK);=0A }=0A =0A static inline dma_addr_t =
gnttab_dma_map_virt(void *ptr)=0A--- a/lib/swiotlb-xen.c=0A+++ b/lib/swiotl=
b-xen.c=0A@@ -501,8 +501,8 @@ swiotlb_full(struct device *dev, size_t =0A =
dma_addr_t=0A swiotlb_map_single(struct device *hwdev, void *ptr, size_t =
size, int dir)=0A {=0A-	dma_addr_t dev_addr =3D gnttab_dma_map_page(virt_to=
_page(ptr)) +=0A-			      offset_in_page(ptr);=0A+	=
dma_addr_t dev_addr =3D gnttab_dma_map_page(virt_to_page(ptr),=0A+		=
				  offset_in_page(ptr));=0A 	void =
*map;=0A 	struct phys_addr buffer;=0A =0A@@ -613,7 +613,7 @@ =
swiotlb_map_sg(struct device *hwdev, str=0A 	BUG_ON(dir =3D=3D =
DMA_NONE);=0A =0A 	for (i =3D 0; i < nelems; i++, sg++) {=0A-		=
dev_addr =3D gnttab_dma_map_page(sg->page) + sg->offset;=0A+		=
dev_addr =3D gnttab_dma_map_page(sg->page, sg->offset);=0A =0A 		if =
(range_straddles_page_boundary(page_to_pseudophys(sg->page)=0A 			=
			  + sg->offset, sg->length)=0A@@ -705,7 +705,7 @@ =
swiotlb_map_page(struct device *hwdev, s=0A 	dma_addr_t dev_addr;=0A 	=
char *map;=0A =0A-	dev_addr =3D gnttab_dma_map_page(page) + offset;=0A=
+	dev_addr =3D gnttab_dma_map_page(page, offset);=0A 	if =
(address_needs_mapping(hwdev, dev_addr)) {=0A 		gnttab_dma_unmap_pa=
ge(dev_addr);=0A 		buffer.page   =3D page;=0A
--=__Part89B8492F.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.xen.org
http://lists.xen.org/xen-devel

--=__Part89B8492F.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 09 13:28:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 13:28:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWod9-0004xp-Sx; Fri, 09 Nov 2012 13:28:19 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWod8-0004xj-FM
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 13:28:18 +0000
Received: from [193.109.254.147:5896] by server-5.bemta-14.messagelabs.com id
	B7/12-10257-1F40D905; Fri, 09 Nov 2012 13:28:17 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1352467692!8585318!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5MzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16592 invoked from network); 9 Nov 2012 13:28:12 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-27.messagelabs.com with SMTP;
	9 Nov 2012 13:28:12 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 09 Nov 2012 13:28:12 +0000
Message-Id: <509D12FC02000078000A77E4@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 09 Nov 2012 13:28:12 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part5D6C9DFC.0__="
Subject: [Xen-devel] [PATCH] implement vmap()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part5D6C9DFC.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

... and use it as basis for a proper ioremap() on x86.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -100,6 +100,7 @@
 #include <xen/iocap.h>
 #include <xen/guest_access.h>
 #include <xen/pfn.h>
+#include <xen/vmap.h>
 #include <xen/xmalloc.h>
 #include <xen/efi.h>
 #include <xen/grant_table.h>
@@ -5460,6 +5561,32 @@ void __set_fixmap(
     map_pages_to_xen(fix_to_virt(idx), mfn, 1, flags);
 }
=20
+void *__init arch_vmap_virt_end(void)
+{
+    return (void *)fix_to_virt(__end_of_fixed_addresses);
+}
+
+void __iomem *ioremap(paddr_t pa, size_t len)
+{
+    unsigned long pfn =3D PFN_DOWN(pa);
+    void *va;
+
+    WARN_ON(page_is_ram_type(pfn, RAM_TYPE_CONVENTIONAL));
+
+    /* The low first Mb is always mapped. */
+    if ( !((pa + len - 1) >> 20) )
+        va =3D __va(pa);
+    else
+    {
+        unsigned int offs =3D pa & (PAGE_SIZE - 1);
+        unsigned int nr =3D PFN_UP(offs + len);
+
+        va =3D __vmap(&pfn, nr, 1, 1, PAGE_HYPERVISOR_NOCACHE) + offs;
+    }
+
+    return (void __force __iomem *)va;
+}
+
 #ifdef MEMORY_GUARD
=20
 void memguard_init(void)
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1104,6 +1104,7 @@ void __init __start_xen(unsigned long mb
     end_boot_allocator();
     system_state =3D SYS_STATE_boot;
=20
+    vm_init();
     vesa_init();
=20
     softirq_init();
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -36,6 +36,7 @@ obj-y +=3D time.o
 obj-y +=3D timer.o
 obj-y +=3D trace.o
 obj-y +=3D version.o
+obj-y +=3D vmap.o
 obj-y +=3D vsprintf.o
 obj-y +=3D wait.o
 obj-y +=3D xmalloc_tlsf.o
--- /dev/null
+++ b/xen/common/vmap.c
@@ -0,0 +1,204 @@
+#ifdef VMAP_VIRT_START
+#include <xen/bitmap.h>
+#include <xen/cache.h>
+#include <xen/init.h>
+#include <xen/mm.h>
+#include <xen/pfn.h>
+#include <xen/spinlock.h>
+#include <xen/types.h>
+#include <xen/vmap.h>
+#include <asm/page.h>
+
+static DEFINE_SPINLOCK(vm_lock);
+static void *__read_mostly vm_base;
+#define vm_bitmap ((unsigned long *)vm_base)
+/* highest allocated bit in the bitmap */
+static unsigned int __read_mostly vm_top;
+/* total number of bits in the bitmap */
+static unsigned int __read_mostly vm_end;
+/* lowest known clear bit in the bitmap */
+static unsigned int vm_low;
+
+void __init vm_init(void)
+{
+    unsigned int i, nr;
+    unsigned long va;
+
+    vm_base =3D (void *)VMAP_VIRT_START;
+    vm_end =3D PFN_DOWN(arch_vmap_virt_end() - vm_base);
+    vm_low =3D PFN_UP((vm_end + 7) / 8);
+    nr =3D PFN_UP((vm_low + 7) / 8);
+    vm_top =3D nr * PAGE_SIZE * 8;
+
+    for ( i =3D 0, va =3D (unsigned long)vm_bitmap; i < nr; ++i, va +=3D =
PAGE_SIZE )
+    {
+        struct page_info *pg =3D alloc_domheap_page(NULL, 0);
+
+        map_pages_to_xen(va, page_to_mfn(pg), 1, PAGE_HYPERVISOR);
+        clear_page((void *)va);
+    }
+    bitmap_fill(vm_bitmap, vm_low);
+
+    /* Populate page tables for the bitmap if necessary. */
+    map_pages_to_xen(va, 0, vm_low - nr, MAP_SMALL_PAGES);
+}
+
+void *vm_alloc(unsigned int nr, unsigned int align)
+{
+    unsigned int start, bit;
+
+    if ( !align )
+        align =3D 1;
+    else if ( align & (align - 1) )
+        align &=3D -align;
+
+    spin_lock(&vm_lock);
+    for ( ; ; )
+    {
+        struct page_info *pg;
+
+        ASSERT(!test_bit(vm_low, vm_bitmap));
+        for ( start =3D vm_low; ; )
+        {
+            bit =3D find_next_bit(vm_bitmap, vm_top, start + 1);
+            if ( bit > vm_top )
+                bit =3D vm_top;
+            /*
+             * Note that this skips the first bit, making the
+             * corresponding page a guard one.
+             */
+            start =3D (start + align) & ~(align - 1);
+            if ( start + nr <=3D bit )
+                break;
+            start =3D bit < vm_top ?
+                    find_next_zero_bit(vm_bitmap, vm_top, bit + 1) : bit;
+            if ( start >=3D vm_top )
+                break;
+        }
+
+        if ( start < vm_top )
+            break;
+
+        spin_unlock(&vm_lock);
+
+        if ( vm_top >=3D vm_end )
+            return NULL;
+
+        pg =3D alloc_domheap_page(NULL, 0);
+        if ( !pg )
+            return NULL;
+
+        spin_lock(&vm_lock);
+
+        if ( start >=3D vm_top )
+        {
+            unsigned long va =3D (unsigned long)vm_bitmap + vm_top / 8;
+
+            if ( !map_pages_to_xen(va, page_to_mfn(pg), 1, PAGE_HYPERVISOR=
) )
+            {
+                clear_page((void *)va);
+                vm_top +=3D PAGE_SIZE * 8;
+                if ( vm_top > vm_end )
+                    vm_top =3D vm_end;
+                continue;
+            }
+        }
+
+        free_domheap_page(pg);
+
+        if ( start >=3D vm_top )
+        {
+            spin_unlock(&vm_lock);
+            return NULL;
+        }
+    }
+
+    for ( bit =3D start; bit < start + nr; ++bit )
+        __set_bit(bit, vm_bitmap);
+    if ( start <=3D vm_low + 2 )
+        vm_low =3D bit;
+    spin_unlock(&vm_lock);
+
+    return vm_base + start * PAGE_SIZE;
+}
+
+static unsigned int vm_index(const void *va)
+{
+    unsigned long addr =3D (unsigned long)va & ~(PAGE_SIZE - 1);
+    unsigned int idx;
+
+    if ( addr < VMAP_VIRT_START + (vm_end / 8) ||
+         addr >=3D VMAP_VIRT_START + vm_top * PAGE_SIZE )
+        return 0;
+
+    idx =3D PFN_DOWN(va - vm_base);
+    return !test_bit(idx - 1, vm_bitmap) &&
+           test_bit(idx, vm_bitmap) ? idx : 0;
+}
+
+static unsigned int vm_size(const void *va)
+{
+    unsigned int start =3D vm_index(va), end;
+
+    if ( !start )
+        return 0;
+
+    end =3D find_next_zero_bit(vm_bitmap, vm_top, start + 1);
+
+    return min(end, vm_top) - start;
+}
+
+void vm_free(const void *va)
+{
+    unsigned int bit =3D vm_index(va);
+
+    if ( !bit )
+    {
+        WARN_ON(va !=3D NULL);
+        return;
+    }
+
+    spin_lock(&vm_lock);
+    if ( bit < vm_low )
+    {
+        vm_low =3D bit - 1;
+        while ( !test_bit(vm_low - 1, vm_bitmap) )
+            --vm_low;
+    }
+    while ( __test_and_clear_bit(bit, vm_bitmap) )
+        if ( ++bit =3D=3D vm_top )
+            break;
+    spin_unlock(&vm_lock);
+}
+
+void *__vmap(const unsigned long *mfn, unsigned int granularity,
+             unsigned int nr, unsigned int align, unsigned int flags)
+{
+    void *va =3D vm_alloc(nr * granularity, align);
+    unsigned long cur =3D (unsigned long)va;
+
+    for ( ; va && nr--; ++mfn, cur +=3D PAGE_SIZE * granularity )
+    {
+        if ( map_pages_to_xen(cur, *mfn, granularity, flags) )
+        {
+            vunmap(va);
+            va =3D NULL;
+        }
+    }
+
+    return va;
+}
+
+void *vmap(const unsigned long *mfn, unsigned int nr)
+{
+    return __vmap(mfn, 1, nr, 1, PAGE_HYPERVISOR);
+}
+
+void vunmap(const void *va)
+{
+    unsigned long addr =3D (unsigned long)va;
+
+    destroy_xen_mappings(addr, addr + PAGE_SIZE * vm_size(va));
+    vm_free(va);
+}
+#endif
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -247,9 +247,6 @@ static int erst_exec_move_data(struct ap
 {
 	int rc;
 	u64 offset;
-#ifdef CONFIG_X86
-	enum fixed_addresses idx;
-#endif
 	void *src, *dst;
=20
 	/* ioremap does not work in interrupt context */
@@ -263,39 +260,11 @@ static int erst_exec_move_data(struct ap
 	if (rc)
 		return rc;
=20
-#ifdef CONFIG_X86
-	switch (ctx->var2) {
-	case 0:
-		return 0;
-	case 1 ... PAGE_SIZE:
-		break;
-	default:
-		printk(KERN_WARNING
-		       "MOVE_DATA cannot be used for %#"PRIx64" bytes of =
data\n",
-		       ctx->var2);
-		return -EOPNOTSUPP;
-	}
-
-	src =3D __acpi_map_table(ctx->src_base + offset, ctx->var2);
-#else
 	src =3D ioremap(ctx->src_base + offset, ctx->var2);
-#endif
 	if (!src)
 		return -ENOMEM;
=20
-#ifdef CONFIG_X86
-	BUILD_BUG_ON(FIX_ACPI_PAGES < 4);
-	idx =3D virt_to_fix((unsigned long)src + 2 * PAGE_SIZE);
-	offset +=3D ctx->dst_base;
-	dst =3D (void *)fix_to_virt(idx) + (offset & ~PAGE_MASK);
-	set_fixmap(idx, offset);
-	if (PFN_DOWN(offset) !=3D PFN_DOWN(offset + ctx->var2 - 1)) {
-		idx =3D virt_to_fix((unsigned long)dst + PAGE_SIZE);
-		set_fixmap(idx, offset + PAGE_SIZE);
-	}
-#else
 	dst =3D ioremap(ctx->dst_base + offset, ctx->var2);
-#endif
 	if (dst) {
 		memmove(dst, src, ctx->var2);
 		iounmap(dst);
--- a/xen/drivers/video/vesa.c
+++ b/xen/drivers/video/vesa.c
@@ -10,6 +10,7 @@
 #include <xen/xmalloc.h>
 #include <xen/kernel.h>
 #include <xen/vga.h>
+#include <asm/io.h>
 #include <asm/page.h>
 #include "font.h"
=20
@@ -101,13 +102,11 @@ void __init vesa_init(void)
     if ( !line_len )
         goto fail;
=20
-    if ( map_pages_to_xen(IOREMAP_VIRT_START,
-                          vlfb_info.lfb_base >> PAGE_SHIFT,
-                          vram_remap >> PAGE_SHIFT,
-                          PAGE_HYPERVISOR_NOCACHE) )
+    lfb =3D ioremap(vlfb_info.lfb_base, vram_remap);
+    if ( !lfb )
         goto fail;
=20
-    lfb =3D memset((void *)IOREMAP_VIRT_START, 0, vram_remap);
+    memset(lfb, 0, vram_remap);
=20
     vga_puts =3D vesa_redraw_puts;
=20
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -144,7 +144,7 @@ extern unsigned char boot_edid_info[128]
  *  0xffff828000000000 - 0xffff82bfffffffff [256GB, 2^38 bytes, PML4:261]
  *    Machine-to-phys translation table.
  *  0xffff82c000000000 - 0xffff82c3ffffffff [16GB,  2^34 bytes, PML4:261]
- *    ioremap()/fixmap area.
+ *    vmap()/ioremap()/fixmap area.
  *  0xffff82c400000000 - 0xffff82c43fffffff [1GB,   2^30 bytes, PML4:261]
  *    Compatibility machine-to-phys translation table.
  *  0xffff82c440000000 - 0xffff82c47fffffff [1GB,   2^30 bytes, PML4:261]
@@ -205,11 +205,11 @@ extern unsigned char boot_edid_info[128]
 /* Slot 261: machine-to-phys conversion table (256GB). */
 #define RDWR_MPT_VIRT_START     (PML4_ADDR(261))
 #define RDWR_MPT_VIRT_END       (RDWR_MPT_VIRT_START + MPT_VIRT_SIZE)
-/* Slot 261: ioremap()/fixmap area (16GB). */
-#define IOREMAP_VIRT_START      RDWR_MPT_VIRT_END
-#define IOREMAP_VIRT_END        (IOREMAP_VIRT_START + GB(16))
+/* Slot 261: vmap()/ioremap()/fixmap area (16GB). */
+#define VMAP_VIRT_START         RDWR_MPT_VIRT_END
+#define VMAP_VIRT_END           (VMAP_VIRT_START + GB(16))
 /* Slot 261: compatibility machine-to-phys conversion table (1GB). */
-#define RDWR_COMPAT_MPT_VIRT_START IOREMAP_VIRT_END
+#define RDWR_COMPAT_MPT_VIRT_START VMAP_VIRT_END
 #define RDWR_COMPAT_MPT_VIRT_END (RDWR_COMPAT_MPT_VIRT_START + GB(1))
 /* Slot 261: high read-only compat machine-to-phys conversion table =
(1GB). */
 #define HIRO_COMPAT_MPT_VIRT_START RDWR_COMPAT_MPT_VIRT_END
--- a/xen/include/asm-x86/fixmap.h
+++ b/xen/include/asm-x86/fixmap.h
@@ -15,7 +15,7 @@
 #include <xen/config.h>
 #include <asm/page.h>
=20
-#define FIXADDR_TOP (IOREMAP_VIRT_END - PAGE_SIZE)
+#define FIXADDR_TOP (VMAP_VIRT_END - PAGE_SIZE)
=20
 #ifndef __ASSEMBLY__
=20
--- a/xen/include/asm-x86/io.h
+++ b/xen/include/asm-x86/io.h
@@ -1,14 +1,10 @@
 #ifndef _ASM_IO_H
 #define _ASM_IO_H
=20
-#include <xen/config.h>
+#include <xen/vmap.h>
 #include <xen/types.h>
 #include <asm/page.h>
=20
-/* We don't need real ioremap() on Xen/x86. */
-#define ioremap(x,l) (__va(x))
-#define iounmap(p)   ((void)0)
-
 #define readb(x) (*(volatile char *)(x))
 #define readw(x) (*(volatile short *)(x))
 #define readl(x) (*(volatile int *)(x))
--- /dev/null
+++ b/xen/include/xen/vmap.h
@@ -0,0 +1,24 @@
+#if !defined(__XEN_VMAP_H__) && defined(VMAP_VIRT_START)
+#define __XEN_VMAP_H__
+
+#include <xen/types.h>
+
+void *vm_alloc(unsigned int nr, unsigned int align);
+void vm_free(const void *);
+
+void *__vmap(const unsigned long *mfn, unsigned int granularity,
+             unsigned int nr, unsigned int align, unsigned int flags);
+void *vmap(const unsigned long *mfn, unsigned int nr);
+void vunmap(const void *);
+
+void __iomem *ioremap(paddr_t, size_t);
+
+static inline void iounmap(void __iomem *va)
+{
+    vunmap((void __force *)va);
+}
+
+void vm_init(void);
+void *arch_vmap_virt_end(void);
+
+#endif /* __XEN_VMAP_H__ */



--=__Part5D6C9DFC.0__=
Content-Type: text/plain; name="vmap.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="vmap.patch"

implement vmap()=0A=0A... and use it as basis for a proper ioremap() on =
x86.=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- =
a/xen/arch/x86/mm.c=0A+++ b/xen/arch/x86/mm.c=0A@@ -100,6 +100,7 @@=0A =
#include <xen/iocap.h>=0A #include <xen/guest_access.h>=0A #include =
<xen/pfn.h>=0A+#include <xen/vmap.h>=0A #include <xen/xmalloc.h>=0A =
#include <xen/efi.h>=0A #include <xen/grant_table.h>=0A@@ -5460,6 +5561,32 =
@@ void __set_fixmap(=0A     map_pages_to_xen(fix_to_virt(idx), mfn, 1, =
flags);=0A }=0A =0A+void *__init arch_vmap_virt_end(void)=0A+{=0A+    =
return (void *)fix_to_virt(__end_of_fixed_addresses);=0A+}=0A+=0A+void =
__iomem *ioremap(paddr_t pa, size_t len)=0A+{=0A+    unsigned long pfn =3D =
PFN_DOWN(pa);=0A+    void *va;=0A+=0A+    WARN_ON(page_is_ram_type(pfn, =
RAM_TYPE_CONVENTIONAL));=0A+=0A+    /* The low first Mb is always mapped. =
*/=0A+    if ( !((pa + len - 1) >> 20) )=0A+        va =3D __va(pa);=0A+   =
 else=0A+    {=0A+        unsigned int offs =3D pa & (PAGE_SIZE - 1);=0A+  =
      unsigned int nr =3D PFN_UP(offs + len);=0A+=0A+        va =3D =
__vmap(&pfn, nr, 1, 1, PAGE_HYPERVISOR_NOCACHE) + offs;=0A+    }=0A+=0A+   =
 return (void __force __iomem *)va;=0A+}=0A+=0A #ifdef MEMORY_GUARD=0A =0A =
void memguard_init(void)=0A--- a/xen/arch/x86/setup.c=0A+++ b/xen/arch/x86/=
setup.c=0A@@ -1104,6 +1104,7 @@ void __init __start_xen(unsigned long =
mb=0A     end_boot_allocator();=0A     system_state =3D SYS_STATE_boot;=0A =
=0A+    vm_init();=0A     vesa_init();=0A =0A     softirq_init();=0A--- =
a/xen/common/Makefile=0A+++ b/xen/common/Makefile=0A@@ -36,6 +36,7 @@ =
obj-y +=3D time.o=0A obj-y +=3D timer.o=0A obj-y +=3D trace.o=0A obj-y =
+=3D version.o=0A+obj-y +=3D vmap.o=0A obj-y +=3D vsprintf.o=0A obj-y +=3D =
wait.o=0A obj-y +=3D xmalloc_tlsf.o=0A--- /dev/null=0A+++ b/xen/common/vmap=
.c=0A@@ -0,0 +1,204 @@=0A+#ifdef VMAP_VIRT_START=0A+#include <xen/bitmap.h>=
=0A+#include <xen/cache.h>=0A+#include <xen/init.h>=0A+#include <xen/mm.h>=
=0A+#include <xen/pfn.h>=0A+#include <xen/spinlock.h>=0A+#include =
<xen/types.h>=0A+#include <xen/vmap.h>=0A+#include <asm/page.h>=0A+=0A+stat=
ic DEFINE_SPINLOCK(vm_lock);=0A+static void *__read_mostly vm_base;=0A+#def=
ine vm_bitmap ((unsigned long *)vm_base)=0A+/* highest allocated bit in =
the bitmap */=0A+static unsigned int __read_mostly vm_top;=0A+/* total =
number of bits in the bitmap */=0A+static unsigned int __read_mostly =
vm_end;=0A+/* lowest known clear bit in the bitmap */=0A+static unsigned =
int vm_low;=0A+=0A+void __init vm_init(void)=0A+{=0A+    unsigned int i, =
nr;=0A+    unsigned long va;=0A+=0A+    vm_base =3D (void *)VMAP_VIRT_START=
;=0A+    vm_end =3D PFN_DOWN(arch_vmap_virt_end() - vm_base);=0A+    =
vm_low =3D PFN_UP((vm_end + 7) / 8);=0A+    nr =3D PFN_UP((vm_low + 7) / =
8);=0A+    vm_top =3D nr * PAGE_SIZE * 8;=0A+=0A+    for ( i =3D 0, va =3D =
(unsigned long)vm_bitmap; i < nr; ++i, va +=3D PAGE_SIZE )=0A+    {=0A+    =
    struct page_info *pg =3D alloc_domheap_page(NULL, 0);=0A+=0A+        =
map_pages_to_xen(va, page_to_mfn(pg), 1, PAGE_HYPERVISOR);=0A+        =
clear_page((void *)va);=0A+    }=0A+    bitmap_fill(vm_bitmap, vm_low);=0A+=
=0A+    /* Populate page tables for the bitmap if necessary. */=0A+    =
map_pages_to_xen(va, 0, vm_low - nr, MAP_SMALL_PAGES);=0A+}=0A+=0A+void =
*vm_alloc(unsigned int nr, unsigned int align)=0A+{=0A+    unsigned int =
start, bit;=0A+=0A+    if ( !align )=0A+        align =3D 1;=0A+    else =
if ( align & (align - 1) )=0A+        align &=3D -align;=0A+=0A+    =
spin_lock(&vm_lock);=0A+    for ( ; ; )=0A+    {=0A+        struct =
page_info *pg;=0A+=0A+        ASSERT(!test_bit(vm_low, vm_bitmap));=0A+    =
    for ( start =3D vm_low; ; )=0A+        {=0A+            bit =3D =
find_next_bit(vm_bitmap, vm_top, start + 1);=0A+            if ( bit > =
vm_top )=0A+                bit =3D vm_top;=0A+            /*=0A+          =
   * Note that this skips the first bit, making the=0A+             * =
corresponding page a guard one.=0A+             */=0A+            start =
=3D (start + align) & ~(align - 1);=0A+            if ( start + nr <=3D =
bit )=0A+                break;=0A+            start =3D bit < vm_top =
?=0A+                    find_next_zero_bit(vm_bitmap, vm_top, bit + 1) : =
bit;=0A+            if ( start >=3D vm_top )=0A+                break;=0A+ =
       }=0A+=0A+        if ( start < vm_top )=0A+            break;=0A+=0A+=
        spin_unlock(&vm_lock);=0A+=0A+        if ( vm_top >=3D vm_end =
)=0A+            return NULL;=0A+=0A+        pg =3D alloc_domheap_page(NULL=
, 0);=0A+        if ( !pg )=0A+            return NULL;=0A+=0A+        =
spin_lock(&vm_lock);=0A+=0A+        if ( start >=3D vm_top )=0A+        =
{=0A+            unsigned long va =3D (unsigned long)vm_bitmap + vm_top / =
8;=0A+=0A+            if ( !map_pages_to_xen(va, page_to_mfn(pg), 1, =
PAGE_HYPERVISOR) )=0A+            {=0A+                clear_page((void =
*)va);=0A+                vm_top +=3D PAGE_SIZE * 8;=0A+                if =
( vm_top > vm_end )=0A+                    vm_top =3D vm_end;=0A+          =
      continue;=0A+            }=0A+        }=0A+=0A+        free_domheap_p=
age(pg);=0A+=0A+        if ( start >=3D vm_top )=0A+        {=0A+          =
  spin_unlock(&vm_lock);=0A+            return NULL;=0A+        }=0A+    =
}=0A+=0A+    for ( bit =3D start; bit < start + nr; ++bit )=0A+        =
__set_bit(bit, vm_bitmap);=0A+    if ( start <=3D vm_low + 2 )=0A+        =
vm_low =3D bit;=0A+    spin_unlock(&vm_lock);=0A+=0A+    return vm_base + =
start * PAGE_SIZE;=0A+}=0A+=0A+static unsigned int vm_index(const void =
*va)=0A+{=0A+    unsigned long addr =3D (unsigned long)va & ~(PAGE_SIZE - =
1);=0A+    unsigned int idx;=0A+=0A+    if ( addr < VMAP_VIRT_START + =
(vm_end / 8) ||=0A+         addr >=3D VMAP_VIRT_START + vm_top * PAGE_SIZE =
)=0A+        return 0;=0A+=0A+    idx =3D PFN_DOWN(va - vm_base);=0A+    =
return !test_bit(idx - 1, vm_bitmap) &&=0A+           test_bit(idx, =
vm_bitmap) ? idx : 0;=0A+}=0A+=0A+static unsigned int vm_size(const void =
*va)=0A+{=0A+    unsigned int start =3D vm_index(va), end;=0A+=0A+    if ( =
!start )=0A+        return 0;=0A+=0A+    end =3D find_next_zero_bit(vm_bitm=
ap, vm_top, start + 1);=0A+=0A+    return min(end, vm_top) - start;=0A+}=0A=
+=0A+void vm_free(const void *va)=0A+{=0A+    unsigned int bit =3D =
vm_index(va);=0A+=0A+    if ( !bit )=0A+    {=0A+        WARN_ON(va !=3D =
NULL);=0A+        return;=0A+    }=0A+=0A+    spin_lock(&vm_lock);=0A+    =
if ( bit < vm_low )=0A+    {=0A+        vm_low =3D bit - 1;=0A+        =
while ( !test_bit(vm_low - 1, vm_bitmap) )=0A+            --vm_low;=0A+    =
}=0A+    while ( __test_and_clear_bit(bit, vm_bitmap) )=0A+        if ( =
++bit =3D=3D vm_top )=0A+            break;=0A+    spin_unlock(&vm_lock);=
=0A+}=0A+=0A+void *__vmap(const unsigned long *mfn, unsigned int granularit=
y,=0A+             unsigned int nr, unsigned int align, unsigned int =
flags)=0A+{=0A+    void *va =3D vm_alloc(nr * granularity, align);=0A+    =
unsigned long cur =3D (unsigned long)va;=0A+=0A+    for ( ; va && nr--; =
++mfn, cur +=3D PAGE_SIZE * granularity )=0A+    {=0A+        if ( =
map_pages_to_xen(cur, *mfn, granularity, flags) )=0A+        {=0A+         =
   vunmap(va);=0A+            va =3D NULL;=0A+        }=0A+    }=0A+=0A+   =
 return va;=0A+}=0A+=0A+void *vmap(const unsigned long *mfn, unsigned int =
nr)=0A+{=0A+    return __vmap(mfn, 1, nr, 1, PAGE_HYPERVISOR);=0A+}=0A+=0A+=
void vunmap(const void *va)=0A+{=0A+    unsigned long addr =3D (unsigned =
long)va;=0A+=0A+    destroy_xen_mappings(addr, addr + PAGE_SIZE * =
vm_size(va));=0A+    vm_free(va);=0A+}=0A+#endif=0A--- a/xen/drivers/acpi/a=
pei/erst.c=0A+++ b/xen/drivers/acpi/apei/erst.c=0A@@ -247,9 +247,6 @@ =
static int erst_exec_move_data(struct ap=0A {=0A 	int rc;=0A 	=
u64 offset;=0A-#ifdef CONFIG_X86=0A-	enum fixed_addresses idx;=0A-#endif=
=0A 	void *src, *dst;=0A =0A 	/* ioremap does not work in =
interrupt context */=0A@@ -263,39 +260,11 @@ static int erst_exec_move_data=
(struct ap=0A 	if (rc)=0A 		return rc;=0A =0A-#ifdef CONFIG_X86=
=0A-	switch (ctx->var2) {=0A-	case 0:=0A-		return =
0;=0A-	case 1 ... PAGE_SIZE:=0A-		break;=0A-	default:=0A=
-		printk(KERN_WARNING=0A-		       "MOVE_DATA cannot =
be used for %#"PRIx64" bytes of data\n",=0A-		       ctx->var2);=
=0A-		return -EOPNOTSUPP;=0A-	}=0A-=0A-	src =3D __acpi_map_=
table(ctx->src_base + offset, ctx->var2);=0A-#else=0A 	src =3D ioremap(ctx=
->src_base + offset, ctx->var2);=0A-#endif=0A 	if (!src)=0A 		=
return -ENOMEM;=0A =0A-#ifdef CONFIG_X86=0A-	BUILD_BUG_ON(FIX_ACPI_PAGES=
 < 4);=0A-	idx =3D virt_to_fix((unsigned long)src + 2 * PAGE_SIZE);=0A=
-	offset +=3D ctx->dst_base;=0A-	dst =3D (void *)fix_to_virt(idx) + =
(offset & ~PAGE_MASK);=0A-	set_fixmap(idx, offset);=0A-	if =
(PFN_DOWN(offset) !=3D PFN_DOWN(offset + ctx->var2 - 1)) {=0A-		=
idx =3D virt_to_fix((unsigned long)dst + PAGE_SIZE);=0A-		=
set_fixmap(idx, offset + PAGE_SIZE);=0A-	}=0A-#else=0A 	dst =3D =
ioremap(ctx->dst_base + offset, ctx->var2);=0A-#endif=0A 	if (dst) =
{=0A 		memmove(dst, src, ctx->var2);=0A 		iounmap(dst=
);=0A--- a/xen/drivers/video/vesa.c=0A+++ b/xen/drivers/video/vesa.c=0A@@ =
-10,6 +10,7 @@=0A #include <xen/xmalloc.h>=0A #include <xen/kernel.h>=0A =
#include <xen/vga.h>=0A+#include <asm/io.h>=0A #include <asm/page.h>=0A =
#include "font.h"=0A =0A@@ -101,13 +102,11 @@ void __init vesa_init(void)=
=0A     if ( !line_len )=0A         goto fail;=0A =0A-    if ( map_pages_to=
_xen(IOREMAP_VIRT_START,=0A-                          vlfb_info.lfb_base =
>> PAGE_SHIFT,=0A-                          vram_remap >> PAGE_SHIFT,=0A-  =
                        PAGE_HYPERVISOR_NOCACHE) )=0A+    lfb =3D =
ioremap(vlfb_info.lfb_base, vram_remap);=0A+    if ( !lfb )=0A         =
goto fail;=0A =0A-    lfb =3D memset((void *)IOREMAP_VIRT_START, 0, =
vram_remap);=0A+    memset(lfb, 0, vram_remap);=0A =0A     vga_puts =3D =
vesa_redraw_puts;=0A =0A--- a/xen/include/asm-x86/config.h=0A+++ b/xen/incl=
ude/asm-x86/config.h=0A@@ -144,7 +144,7 @@ extern unsigned char boot_edid_i=
nfo[128]=0A  *  0xffff828000000000 - 0xffff82bfffffffff [256GB, 2^38 =
bytes, PML4:261]=0A  *    Machine-to-phys translation table.=0A  *  =
0xffff82c000000000 - 0xffff82c3ffffffff [16GB,  2^34 bytes, PML4:261]=0A- =
*    ioremap()/fixmap area.=0A+ *    vmap()/ioremap()/fixmap area.=0A  *  =
0xffff82c400000000 - 0xffff82c43fffffff [1GB,   2^30 bytes, PML4:261]=0A  =
*    Compatibility machine-to-phys translation table.=0A  *  0xffff82c44000=
0000 - 0xffff82c47fffffff [1GB,   2^30 bytes, PML4:261]=0A@@ -205,11 =
+205,11 @@ extern unsigned char boot_edid_info[128]=0A /* Slot 261: =
machine-to-phys conversion table (256GB). */=0A #define RDWR_MPT_VIRT_START=
     (PML4_ADDR(261))=0A #define RDWR_MPT_VIRT_END       (RDWR_MPT_VIRT_STA=
RT + MPT_VIRT_SIZE)=0A-/* Slot 261: ioremap()/fixmap area (16GB). =
*/=0A-#define IOREMAP_VIRT_START      RDWR_MPT_VIRT_END=0A-#define =
IOREMAP_VIRT_END        (IOREMAP_VIRT_START + GB(16))=0A+/* Slot 261: =
vmap()/ioremap()/fixmap area (16GB). */=0A+#define VMAP_VIRT_START         =
RDWR_MPT_VIRT_END=0A+#define VMAP_VIRT_END           (VMAP_VIRT_START + =
GB(16))=0A /* Slot 261: compatibility machine-to-phys conversion table =
(1GB). */=0A-#define RDWR_COMPAT_MPT_VIRT_START IOREMAP_VIRT_END=0A+#define=
 RDWR_COMPAT_MPT_VIRT_START VMAP_VIRT_END=0A #define RDWR_COMPAT_MPT_VIRT_E=
ND (RDWR_COMPAT_MPT_VIRT_START + GB(1))=0A /* Slot 261: high read-only =
compat machine-to-phys conversion table (1GB). */=0A #define HIRO_COMPAT_MP=
T_VIRT_START RDWR_COMPAT_MPT_VIRT_END=0A--- a/xen/include/asm-x86/fixmap.h=
=0A+++ b/xen/include/asm-x86/fixmap.h=0A@@ -15,7 +15,7 @@=0A #include =
<xen/config.h>=0A #include <asm/page.h>=0A =0A-#define FIXADDR_TOP =
(IOREMAP_VIRT_END - PAGE_SIZE)=0A+#define FIXADDR_TOP (VMAP_VIRT_END - =
PAGE_SIZE)=0A =0A #ifndef __ASSEMBLY__=0A =0A--- a/xen/include/asm-x86/io.h=
=0A+++ b/xen/include/asm-x86/io.h=0A@@ -1,14 +1,10 @@=0A #ifndef =
_ASM_IO_H=0A #define _ASM_IO_H=0A =0A-#include <xen/config.h>=0A+#include =
<xen/vmap.h>=0A #include <xen/types.h>=0A #include <asm/page.h>=0A =0A-/* =
We don't need real ioremap() on Xen/x86. */=0A-#define ioremap(x,l) =
(__va(x))=0A-#define iounmap(p)   ((void)0)=0A-=0A #define readb(x) =
(*(volatile char *)(x))=0A #define readw(x) (*(volatile short *)(x))=0A =
#define readl(x) (*(volatile int *)(x))=0A--- /dev/null=0A+++ b/xen/include=
/xen/vmap.h=0A@@ -0,0 +1,24 @@=0A+#if !defined(__XEN_VMAP_H__) && =
defined(VMAP_VIRT_START)=0A+#define __XEN_VMAP_H__=0A+=0A+#include =
<xen/types.h>=0A+=0A+void *vm_alloc(unsigned int nr, unsigned int =
align);=0A+void vm_free(const void *);=0A+=0A+void *__vmap(const unsigned =
long *mfn, unsigned int granularity,=0A+             unsigned int nr, =
unsigned int align, unsigned int flags);=0A+void *vmap(const unsigned long =
*mfn, unsigned int nr);=0A+void vunmap(const void *);=0A+=0A+void __iomem =
*ioremap(paddr_t, size_t);=0A+=0A+static inline void iounmap(void __iomem =
*va)=0A+{=0A+    vunmap((void __force *)va);=0A+}=0A+=0A+void vm_init(void)=
;=0A+void *arch_vmap_virt_end(void);=0A+=0A+#endif /* __XEN_VMAP_H__ */=0A
--=__Part5D6C9DFC.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.xen.org
http://lists.xen.org/xen-devel

--=__Part5D6C9DFC.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 09 13:28:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 13:28:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWod9-0004xp-Sx; Fri, 09 Nov 2012 13:28:19 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TWod8-0004xj-FM
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 13:28:18 +0000
Received: from [193.109.254.147:5896] by server-5.bemta-14.messagelabs.com id
	B7/12-10257-1F40D905; Fri, 09 Nov 2012 13:28:17 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1352467692!8585318!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5MzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16592 invoked from network); 9 Nov 2012 13:28:12 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-27.messagelabs.com with SMTP;
	9 Nov 2012 13:28:12 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 09 Nov 2012 13:28:12 +0000
Message-Id: <509D12FC02000078000A77E4@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 09 Nov 2012 13:28:12 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part5D6C9DFC.0__="
Subject: [Xen-devel] [PATCH] implement vmap()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part5D6C9DFC.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

... and use it as basis for a proper ioremap() on x86.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -100,6 +100,7 @@
 #include <xen/iocap.h>
 #include <xen/guest_access.h>
 #include <xen/pfn.h>
+#include <xen/vmap.h>
 #include <xen/xmalloc.h>
 #include <xen/efi.h>
 #include <xen/grant_table.h>
@@ -5460,6 +5561,32 @@ void __set_fixmap(
     map_pages_to_xen(fix_to_virt(idx), mfn, 1, flags);
 }
=20
+void *__init arch_vmap_virt_end(void)
+{
+    return (void *)fix_to_virt(__end_of_fixed_addresses);
+}
+
+void __iomem *ioremap(paddr_t pa, size_t len)
+{
+    unsigned long pfn =3D PFN_DOWN(pa);
+    void *va;
+
+    WARN_ON(page_is_ram_type(pfn, RAM_TYPE_CONVENTIONAL));
+
+    /* The low first Mb is always mapped. */
+    if ( !((pa + len - 1) >> 20) )
+        va =3D __va(pa);
+    else
+    {
+        unsigned int offs =3D pa & (PAGE_SIZE - 1);
+        unsigned int nr =3D PFN_UP(offs + len);
+
+        va =3D __vmap(&pfn, nr, 1, 1, PAGE_HYPERVISOR_NOCACHE) + offs;
+    }
+
+    return (void __force __iomem *)va;
+}
+
 #ifdef MEMORY_GUARD
=20
 void memguard_init(void)
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1104,6 +1104,7 @@ void __init __start_xen(unsigned long mb
     end_boot_allocator();
     system_state =3D SYS_STATE_boot;
=20
+    vm_init();
     vesa_init();
=20
     softirq_init();
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -36,6 +36,7 @@ obj-y +=3D time.o
 obj-y +=3D timer.o
 obj-y +=3D trace.o
 obj-y +=3D version.o
+obj-y +=3D vmap.o
 obj-y +=3D vsprintf.o
 obj-y +=3D wait.o
 obj-y +=3D xmalloc_tlsf.o
--- /dev/null
+++ b/xen/common/vmap.c
@@ -0,0 +1,204 @@
+#ifdef VMAP_VIRT_START
+#include <xen/bitmap.h>
+#include <xen/cache.h>
+#include <xen/init.h>
+#include <xen/mm.h>
+#include <xen/pfn.h>
+#include <xen/spinlock.h>
+#include <xen/types.h>
+#include <xen/vmap.h>
+#include <asm/page.h>
+
+static DEFINE_SPINLOCK(vm_lock);
+static void *__read_mostly vm_base;
+#define vm_bitmap ((unsigned long *)vm_base)
+/* highest allocated bit in the bitmap */
+static unsigned int __read_mostly vm_top;
+/* total number of bits in the bitmap */
+static unsigned int __read_mostly vm_end;
+/* lowest known clear bit in the bitmap */
+static unsigned int vm_low;
+
+void __init vm_init(void)
+{
+    unsigned int i, nr;
+    unsigned long va;
+
+    vm_base =3D (void *)VMAP_VIRT_START;
+    vm_end =3D PFN_DOWN(arch_vmap_virt_end() - vm_base);
+    vm_low =3D PFN_UP((vm_end + 7) / 8);
+    nr =3D PFN_UP((vm_low + 7) / 8);
+    vm_top =3D nr * PAGE_SIZE * 8;
+
+    for ( i =3D 0, va =3D (unsigned long)vm_bitmap; i < nr; ++i, va +=3D =
PAGE_SIZE )
+    {
+        struct page_info *pg =3D alloc_domheap_page(NULL, 0);
+
+        map_pages_to_xen(va, page_to_mfn(pg), 1, PAGE_HYPERVISOR);
+        clear_page((void *)va);
+    }
+    bitmap_fill(vm_bitmap, vm_low);
+
+    /* Populate page tables for the bitmap if necessary. */
+    map_pages_to_xen(va, 0, vm_low - nr, MAP_SMALL_PAGES);
+}
+
+void *vm_alloc(unsigned int nr, unsigned int align)
+{
+    unsigned int start, bit;
+
+    if ( !align )
+        align =3D 1;
+    else if ( align & (align - 1) )
+        align &=3D -align;
+
+    spin_lock(&vm_lock);
+    for ( ; ; )
+    {
+        struct page_info *pg;
+
+        ASSERT(!test_bit(vm_low, vm_bitmap));
+        for ( start =3D vm_low; ; )
+        {
+            bit =3D find_next_bit(vm_bitmap, vm_top, start + 1);
+            if ( bit > vm_top )
+                bit =3D vm_top;
+            /*
+             * Note that this skips the first bit, making the
+             * corresponding page a guard one.
+             */
+            start =3D (start + align) & ~(align - 1);
+            if ( start + nr <=3D bit )
+                break;
+            start =3D bit < vm_top ?
+                    find_next_zero_bit(vm_bitmap, vm_top, bit + 1) : bit;
+            if ( start >=3D vm_top )
+                break;
+        }
+
+        if ( start < vm_top )
+            break;
+
+        spin_unlock(&vm_lock);
+
+        if ( vm_top >=3D vm_end )
+            return NULL;
+
+        pg =3D alloc_domheap_page(NULL, 0);
+        if ( !pg )
+            return NULL;
+
+        spin_lock(&vm_lock);
+
+        if ( start >=3D vm_top )
+        {
+            unsigned long va =3D (unsigned long)vm_bitmap + vm_top / 8;
+
+            if ( !map_pages_to_xen(va, page_to_mfn(pg), 1, PAGE_HYPERVISOR=
) )
+            {
+                clear_page((void *)va);
+                vm_top +=3D PAGE_SIZE * 8;
+                if ( vm_top > vm_end )
+                    vm_top =3D vm_end;
+                continue;
+            }
+        }
+
+        free_domheap_page(pg);
+
+        if ( start >=3D vm_top )
+        {
+            spin_unlock(&vm_lock);
+            return NULL;
+        }
+    }
+
+    for ( bit =3D start; bit < start + nr; ++bit )
+        __set_bit(bit, vm_bitmap);
+    if ( start <=3D vm_low + 2 )
+        vm_low =3D bit;
+    spin_unlock(&vm_lock);
+
+    return vm_base + start * PAGE_SIZE;
+}
+
+static unsigned int vm_index(const void *va)
+{
+    unsigned long addr =3D (unsigned long)va & ~(PAGE_SIZE - 1);
+    unsigned int idx;
+
+    if ( addr < VMAP_VIRT_START + (vm_end / 8) ||
+         addr >=3D VMAP_VIRT_START + vm_top * PAGE_SIZE )
+        return 0;
+
+    idx =3D PFN_DOWN(va - vm_base);
+    return !test_bit(idx - 1, vm_bitmap) &&
+           test_bit(idx, vm_bitmap) ? idx : 0;
+}
+
+static unsigned int vm_size(const void *va)
+{
+    unsigned int start =3D vm_index(va), end;
+
+    if ( !start )
+        return 0;
+
+    end =3D find_next_zero_bit(vm_bitmap, vm_top, start + 1);
+
+    return min(end, vm_top) - start;
+}
+
+void vm_free(const void *va)
+{
+    unsigned int bit =3D vm_index(va);
+
+    if ( !bit )
+    {
+        WARN_ON(va !=3D NULL);
+        return;
+    }
+
+    spin_lock(&vm_lock);
+    if ( bit < vm_low )
+    {
+        vm_low =3D bit - 1;
+        while ( !test_bit(vm_low - 1, vm_bitmap) )
+            --vm_low;
+    }
+    while ( __test_and_clear_bit(bit, vm_bitmap) )
+        if ( ++bit =3D=3D vm_top )
+            break;
+    spin_unlock(&vm_lock);
+}
+
+void *__vmap(const unsigned long *mfn, unsigned int granularity,
+             unsigned int nr, unsigned int align, unsigned int flags)
+{
+    void *va =3D vm_alloc(nr * granularity, align);
+    unsigned long cur =3D (unsigned long)va;
+
+    for ( ; va && nr--; ++mfn, cur +=3D PAGE_SIZE * granularity )
+    {
+        if ( map_pages_to_xen(cur, *mfn, granularity, flags) )
+        {
+            vunmap(va);
+            va =3D NULL;
+        }
+    }
+
+    return va;
+}
+
+void *vmap(const unsigned long *mfn, unsigned int nr)
+{
+    return __vmap(mfn, 1, nr, 1, PAGE_HYPERVISOR);
+}
+
+void vunmap(const void *va)
+{
+    unsigned long addr =3D (unsigned long)va;
+
+    destroy_xen_mappings(addr, addr + PAGE_SIZE * vm_size(va));
+    vm_free(va);
+}
+#endif
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -247,9 +247,6 @@ static int erst_exec_move_data(struct ap
 {
 	int rc;
 	u64 offset;
-#ifdef CONFIG_X86
-	enum fixed_addresses idx;
-#endif
 	void *src, *dst;
=20
 	/* ioremap does not work in interrupt context */
@@ -263,39 +260,11 @@ static int erst_exec_move_data(struct ap
 	if (rc)
 		return rc;
=20
-#ifdef CONFIG_X86
-	switch (ctx->var2) {
-	case 0:
-		return 0;
-	case 1 ... PAGE_SIZE:
-		break;
-	default:
-		printk(KERN_WARNING
-		       "MOVE_DATA cannot be used for %#"PRIx64" bytes of =
data\n",
-		       ctx->var2);
-		return -EOPNOTSUPP;
-	}
-
-	src =3D __acpi_map_table(ctx->src_base + offset, ctx->var2);
-#else
 	src =3D ioremap(ctx->src_base + offset, ctx->var2);
-#endif
 	if (!src)
 		return -ENOMEM;
=20
-#ifdef CONFIG_X86
-	BUILD_BUG_ON(FIX_ACPI_PAGES < 4);
-	idx =3D virt_to_fix((unsigned long)src + 2 * PAGE_SIZE);
-	offset +=3D ctx->dst_base;
-	dst =3D (void *)fix_to_virt(idx) + (offset & ~PAGE_MASK);
-	set_fixmap(idx, offset);
-	if (PFN_DOWN(offset) !=3D PFN_DOWN(offset + ctx->var2 - 1)) {
-		idx =3D virt_to_fix((unsigned long)dst + PAGE_SIZE);
-		set_fixmap(idx, offset + PAGE_SIZE);
-	}
-#else
 	dst =3D ioremap(ctx->dst_base + offset, ctx->var2);
-#endif
 	if (dst) {
 		memmove(dst, src, ctx->var2);
 		iounmap(dst);
--- a/xen/drivers/video/vesa.c
+++ b/xen/drivers/video/vesa.c
@@ -10,6 +10,7 @@
 #include <xen/xmalloc.h>
 #include <xen/kernel.h>
 #include <xen/vga.h>
+#include <asm/io.h>
 #include <asm/page.h>
 #include "font.h"
=20
@@ -101,13 +102,11 @@ void __init vesa_init(void)
     if ( !line_len )
         goto fail;
=20
-    if ( map_pages_to_xen(IOREMAP_VIRT_START,
-                          vlfb_info.lfb_base >> PAGE_SHIFT,
-                          vram_remap >> PAGE_SHIFT,
-                          PAGE_HYPERVISOR_NOCACHE) )
+    lfb =3D ioremap(vlfb_info.lfb_base, vram_remap);
+    if ( !lfb )
         goto fail;
=20
-    lfb =3D memset((void *)IOREMAP_VIRT_START, 0, vram_remap);
+    memset(lfb, 0, vram_remap);
=20
     vga_puts =3D vesa_redraw_puts;
=20
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -144,7 +144,7 @@ extern unsigned char boot_edid_info[128]
  *  0xffff828000000000 - 0xffff82bfffffffff [256GB, 2^38 bytes, PML4:261]
  *    Machine-to-phys translation table.
  *  0xffff82c000000000 - 0xffff82c3ffffffff [16GB,  2^34 bytes, PML4:261]
- *    ioremap()/fixmap area.
+ *    vmap()/ioremap()/fixmap area.
  *  0xffff82c400000000 - 0xffff82c43fffffff [1GB,   2^30 bytes, PML4:261]
  *    Compatibility machine-to-phys translation table.
  *  0xffff82c440000000 - 0xffff82c47fffffff [1GB,   2^30 bytes, PML4:261]
@@ -205,11 +205,11 @@ extern unsigned char boot_edid_info[128]
 /* Slot 261: machine-to-phys conversion table (256GB). */
 #define RDWR_MPT_VIRT_START     (PML4_ADDR(261))
 #define RDWR_MPT_VIRT_END       (RDWR_MPT_VIRT_START + MPT_VIRT_SIZE)
-/* Slot 261: ioremap()/fixmap area (16GB). */
-#define IOREMAP_VIRT_START      RDWR_MPT_VIRT_END
-#define IOREMAP_VIRT_END        (IOREMAP_VIRT_START + GB(16))
+/* Slot 261: vmap()/ioremap()/fixmap area (16GB). */
+#define VMAP_VIRT_START         RDWR_MPT_VIRT_END
+#define VMAP_VIRT_END           (VMAP_VIRT_START + GB(16))
 /* Slot 261: compatibility machine-to-phys conversion table (1GB). */
-#define RDWR_COMPAT_MPT_VIRT_START IOREMAP_VIRT_END
+#define RDWR_COMPAT_MPT_VIRT_START VMAP_VIRT_END
 #define RDWR_COMPAT_MPT_VIRT_END (RDWR_COMPAT_MPT_VIRT_START + GB(1))
 /* Slot 261: high read-only compat machine-to-phys conversion table =
(1GB). */
 #define HIRO_COMPAT_MPT_VIRT_START RDWR_COMPAT_MPT_VIRT_END
--- a/xen/include/asm-x86/fixmap.h
+++ b/xen/include/asm-x86/fixmap.h
@@ -15,7 +15,7 @@
 #include <xen/config.h>
 #include <asm/page.h>
=20
-#define FIXADDR_TOP (IOREMAP_VIRT_END - PAGE_SIZE)
+#define FIXADDR_TOP (VMAP_VIRT_END - PAGE_SIZE)
=20
 #ifndef __ASSEMBLY__
=20
--- a/xen/include/asm-x86/io.h
+++ b/xen/include/asm-x86/io.h
@@ -1,14 +1,10 @@
 #ifndef _ASM_IO_H
 #define _ASM_IO_H
=20
-#include <xen/config.h>
+#include <xen/vmap.h>
 #include <xen/types.h>
 #include <asm/page.h>
=20
-/* We don't need real ioremap() on Xen/x86. */
-#define ioremap(x,l) (__va(x))
-#define iounmap(p)   ((void)0)
-
 #define readb(x) (*(volatile char *)(x))
 #define readw(x) (*(volatile short *)(x))
 #define readl(x) (*(volatile int *)(x))
--- /dev/null
+++ b/xen/include/xen/vmap.h
@@ -0,0 +1,24 @@
+#if !defined(__XEN_VMAP_H__) && defined(VMAP_VIRT_START)
+#define __XEN_VMAP_H__
+
+#include <xen/types.h>
+
+void *vm_alloc(unsigned int nr, unsigned int align);
+void vm_free(const void *);
+
+void *__vmap(const unsigned long *mfn, unsigned int granularity,
+             unsigned int nr, unsigned int align, unsigned int flags);
+void *vmap(const unsigned long *mfn, unsigned int nr);
+void vunmap(const void *);
+
+void __iomem *ioremap(paddr_t, size_t);
+
+static inline void iounmap(void __iomem *va)
+{
+    vunmap((void __force *)va);
+}
+
+void vm_init(void);
+void *arch_vmap_virt_end(void);
+
+#endif /* __XEN_VMAP_H__ */



--=__Part5D6C9DFC.0__=
Content-Type: text/plain; name="vmap.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="vmap.patch"

implement vmap()=0A=0A... and use it as basis for a proper ioremap() on =
x86.=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- =
a/xen/arch/x86/mm.c=0A+++ b/xen/arch/x86/mm.c=0A@@ -100,6 +100,7 @@=0A =
#include <xen/iocap.h>=0A #include <xen/guest_access.h>=0A #include =
<xen/pfn.h>=0A+#include <xen/vmap.h>=0A #include <xen/xmalloc.h>=0A =
#include <xen/efi.h>=0A #include <xen/grant_table.h>=0A@@ -5460,6 +5561,32 =
@@ void __set_fixmap(=0A     map_pages_to_xen(fix_to_virt(idx), mfn, 1, =
flags);=0A }=0A =0A+void *__init arch_vmap_virt_end(void)=0A+{=0A+    =
return (void *)fix_to_virt(__end_of_fixed_addresses);=0A+}=0A+=0A+void =
__iomem *ioremap(paddr_t pa, size_t len)=0A+{=0A+    unsigned long pfn =3D =
PFN_DOWN(pa);=0A+    void *va;=0A+=0A+    WARN_ON(page_is_ram_type(pfn, =
RAM_TYPE_CONVENTIONAL));=0A+=0A+    /* The low first Mb is always mapped. =
*/=0A+    if ( !((pa + len - 1) >> 20) )=0A+        va =3D __va(pa);=0A+   =
 else=0A+    {=0A+        unsigned int offs =3D pa & (PAGE_SIZE - 1);=0A+  =
      unsigned int nr =3D PFN_UP(offs + len);=0A+=0A+        va =3D =
__vmap(&pfn, nr, 1, 1, PAGE_HYPERVISOR_NOCACHE) + offs;=0A+    }=0A+=0A+   =
 return (void __force __iomem *)va;=0A+}=0A+=0A #ifdef MEMORY_GUARD=0A =0A =
void memguard_init(void)=0A--- a/xen/arch/x86/setup.c=0A+++ b/xen/arch/x86/=
setup.c=0A@@ -1104,6 +1104,7 @@ void __init __start_xen(unsigned long =
mb=0A     end_boot_allocator();=0A     system_state =3D SYS_STATE_boot;=0A =
=0A+    vm_init();=0A     vesa_init();=0A =0A     softirq_init();=0A--- =
a/xen/common/Makefile=0A+++ b/xen/common/Makefile=0A@@ -36,6 +36,7 @@ =
obj-y +=3D time.o=0A obj-y +=3D timer.o=0A obj-y +=3D trace.o=0A obj-y =
+=3D version.o=0A+obj-y +=3D vmap.o=0A obj-y +=3D vsprintf.o=0A obj-y +=3D =
wait.o=0A obj-y +=3D xmalloc_tlsf.o=0A--- /dev/null=0A+++ b/xen/common/vmap=
.c=0A@@ -0,0 +1,204 @@=0A+#ifdef VMAP_VIRT_START=0A+#include <xen/bitmap.h>=
=0A+#include <xen/cache.h>=0A+#include <xen/init.h>=0A+#include <xen/mm.h>=
=0A+#include <xen/pfn.h>=0A+#include <xen/spinlock.h>=0A+#include =
<xen/types.h>=0A+#include <xen/vmap.h>=0A+#include <asm/page.h>=0A+=0A+stat=
ic DEFINE_SPINLOCK(vm_lock);=0A+static void *__read_mostly vm_base;=0A+#def=
ine vm_bitmap ((unsigned long *)vm_base)=0A+/* highest allocated bit in =
the bitmap */=0A+static unsigned int __read_mostly vm_top;=0A+/* total =
number of bits in the bitmap */=0A+static unsigned int __read_mostly =
vm_end;=0A+/* lowest known clear bit in the bitmap */=0A+static unsigned =
int vm_low;=0A+=0A+void __init vm_init(void)=0A+{=0A+    unsigned int i, =
nr;=0A+    unsigned long va;=0A+=0A+    vm_base =3D (void *)VMAP_VIRT_START=
;=0A+    vm_end =3D PFN_DOWN(arch_vmap_virt_end() - vm_base);=0A+    =
vm_low =3D PFN_UP((vm_end + 7) / 8);=0A+    nr =3D PFN_UP((vm_low + 7) / =
8);=0A+    vm_top =3D nr * PAGE_SIZE * 8;=0A+=0A+    for ( i =3D 0, va =3D =
(unsigned long)vm_bitmap; i < nr; ++i, va +=3D PAGE_SIZE )=0A+    {=0A+    =
    struct page_info *pg =3D alloc_domheap_page(NULL, 0);=0A+=0A+        =
map_pages_to_xen(va, page_to_mfn(pg), 1, PAGE_HYPERVISOR);=0A+        =
clear_page((void *)va);=0A+    }=0A+    bitmap_fill(vm_bitmap, vm_low);=0A+=
=0A+    /* Populate page tables for the bitmap if necessary. */=0A+    =
map_pages_to_xen(va, 0, vm_low - nr, MAP_SMALL_PAGES);=0A+}=0A+=0A+void =
*vm_alloc(unsigned int nr, unsigned int align)=0A+{=0A+    unsigned int =
start, bit;=0A+=0A+    if ( !align )=0A+        align =3D 1;=0A+    else =
if ( align & (align - 1) )=0A+        align &=3D -align;=0A+=0A+    =
spin_lock(&vm_lock);=0A+    for ( ; ; )=0A+    {=0A+        struct =
page_info *pg;=0A+=0A+        ASSERT(!test_bit(vm_low, vm_bitmap));=0A+    =
    for ( start =3D vm_low; ; )=0A+        {=0A+            bit =3D =
find_next_bit(vm_bitmap, vm_top, start + 1);=0A+            if ( bit > =
vm_top )=0A+                bit =3D vm_top;=0A+            /*=0A+          =
   * Note that this skips the first bit, making the=0A+             * =
corresponding page a guard one.=0A+             */=0A+            start =
=3D (start + align) & ~(align - 1);=0A+            if ( start + nr <=3D =
bit )=0A+                break;=0A+            start =3D bit < vm_top =
?=0A+                    find_next_zero_bit(vm_bitmap, vm_top, bit + 1) : =
bit;=0A+            if ( start >=3D vm_top )=0A+                break;=0A+ =
       }=0A+=0A+        if ( start < vm_top )=0A+            break;=0A+=0A+=
        spin_unlock(&vm_lock);=0A+=0A+        if ( vm_top >=3D vm_end =
)=0A+            return NULL;=0A+=0A+        pg =3D alloc_domheap_page(NULL=
, 0);=0A+        if ( !pg )=0A+            return NULL;=0A+=0A+        =
spin_lock(&vm_lock);=0A+=0A+        if ( start >=3D vm_top )=0A+        =
{=0A+            unsigned long va =3D (unsigned long)vm_bitmap + vm_top / =
8;=0A+=0A+            if ( !map_pages_to_xen(va, page_to_mfn(pg), 1, =
PAGE_HYPERVISOR) )=0A+            {=0A+                clear_page((void =
*)va);=0A+                vm_top +=3D PAGE_SIZE * 8;=0A+                if =
( vm_top > vm_end )=0A+                    vm_top =3D vm_end;=0A+          =
      continue;=0A+            }=0A+        }=0A+=0A+        free_domheap_p=
age(pg);=0A+=0A+        if ( start >=3D vm_top )=0A+        {=0A+          =
  spin_unlock(&vm_lock);=0A+            return NULL;=0A+        }=0A+    =
}=0A+=0A+    for ( bit =3D start; bit < start + nr; ++bit )=0A+        =
__set_bit(bit, vm_bitmap);=0A+    if ( start <=3D vm_low + 2 )=0A+        =
vm_low =3D bit;=0A+    spin_unlock(&vm_lock);=0A+=0A+    return vm_base + =
start * PAGE_SIZE;=0A+}=0A+=0A+static unsigned int vm_index(const void =
*va)=0A+{=0A+    unsigned long addr =3D (unsigned long)va & ~(PAGE_SIZE - =
1);=0A+    unsigned int idx;=0A+=0A+    if ( addr < VMAP_VIRT_START + =
(vm_end / 8) ||=0A+         addr >=3D VMAP_VIRT_START + vm_top * PAGE_SIZE =
)=0A+        return 0;=0A+=0A+    idx =3D PFN_DOWN(va - vm_base);=0A+    =
return !test_bit(idx - 1, vm_bitmap) &&=0A+           test_bit(idx, =
vm_bitmap) ? idx : 0;=0A+}=0A+=0A+static unsigned int vm_size(const void =
*va)=0A+{=0A+    unsigned int start =3D vm_index(va), end;=0A+=0A+    if ( =
!start )=0A+        return 0;=0A+=0A+    end =3D find_next_zero_bit(vm_bitm=
ap, vm_top, start + 1);=0A+=0A+    return min(end, vm_top) - start;=0A+}=0A=
+=0A+void vm_free(const void *va)=0A+{=0A+    unsigned int bit =3D =
vm_index(va);=0A+=0A+    if ( !bit )=0A+    {=0A+        WARN_ON(va !=3D =
NULL);=0A+        return;=0A+    }=0A+=0A+    spin_lock(&vm_lock);=0A+    =
if ( bit < vm_low )=0A+    {=0A+        vm_low =3D bit - 1;=0A+        =
while ( !test_bit(vm_low - 1, vm_bitmap) )=0A+            --vm_low;=0A+    =
}=0A+    while ( __test_and_clear_bit(bit, vm_bitmap) )=0A+        if ( =
++bit =3D=3D vm_top )=0A+            break;=0A+    spin_unlock(&vm_lock);=
=0A+}=0A+=0A+void *__vmap(const unsigned long *mfn, unsigned int granularit=
y,=0A+             unsigned int nr, unsigned int align, unsigned int =
flags)=0A+{=0A+    void *va =3D vm_alloc(nr * granularity, align);=0A+    =
unsigned long cur =3D (unsigned long)va;=0A+=0A+    for ( ; va && nr--; =
++mfn, cur +=3D PAGE_SIZE * granularity )=0A+    {=0A+        if ( =
map_pages_to_xen(cur, *mfn, granularity, flags) )=0A+        {=0A+         =
   vunmap(va);=0A+            va =3D NULL;=0A+        }=0A+    }=0A+=0A+   =
 return va;=0A+}=0A+=0A+void *vmap(const unsigned long *mfn, unsigned int =
nr)=0A+{=0A+    return __vmap(mfn, 1, nr, 1, PAGE_HYPERVISOR);=0A+}=0A+=0A+=
void vunmap(const void *va)=0A+{=0A+    unsigned long addr =3D (unsigned =
long)va;=0A+=0A+    destroy_xen_mappings(addr, addr + PAGE_SIZE * =
vm_size(va));=0A+    vm_free(va);=0A+}=0A+#endif=0A--- a/xen/drivers/acpi/a=
pei/erst.c=0A+++ b/xen/drivers/acpi/apei/erst.c=0A@@ -247,9 +247,6 @@ =
static int erst_exec_move_data(struct ap=0A {=0A 	int rc;=0A 	=
u64 offset;=0A-#ifdef CONFIG_X86=0A-	enum fixed_addresses idx;=0A-#endif=
=0A 	void *src, *dst;=0A =0A 	/* ioremap does not work in =
interrupt context */=0A@@ -263,39 +260,11 @@ static int erst_exec_move_data=
(struct ap=0A 	if (rc)=0A 		return rc;=0A =0A-#ifdef CONFIG_X86=
=0A-	switch (ctx->var2) {=0A-	case 0:=0A-		return =
0;=0A-	case 1 ... PAGE_SIZE:=0A-		break;=0A-	default:=0A=
-		printk(KERN_WARNING=0A-		       "MOVE_DATA cannot =
be used for %#"PRIx64" bytes of data\n",=0A-		       ctx->var2);=
=0A-		return -EOPNOTSUPP;=0A-	}=0A-=0A-	src =3D __acpi_map_=
table(ctx->src_base + offset, ctx->var2);=0A-#else=0A 	src =3D ioremap(ctx=
->src_base + offset, ctx->var2);=0A-#endif=0A 	if (!src)=0A 		=
return -ENOMEM;=0A =0A-#ifdef CONFIG_X86=0A-	BUILD_BUG_ON(FIX_ACPI_PAGES=
 < 4);=0A-	idx =3D virt_to_fix((unsigned long)src + 2 * PAGE_SIZE);=0A=
-	offset +=3D ctx->dst_base;=0A-	dst =3D (void *)fix_to_virt(idx) + =
(offset & ~PAGE_MASK);=0A-	set_fixmap(idx, offset);=0A-	if =
(PFN_DOWN(offset) !=3D PFN_DOWN(offset + ctx->var2 - 1)) {=0A-		=
idx =3D virt_to_fix((unsigned long)dst + PAGE_SIZE);=0A-		=
set_fixmap(idx, offset + PAGE_SIZE);=0A-	}=0A-#else=0A 	dst =3D =
ioremap(ctx->dst_base + offset, ctx->var2);=0A-#endif=0A 	if (dst) =
{=0A 		memmove(dst, src, ctx->var2);=0A 		iounmap(dst=
);=0A--- a/xen/drivers/video/vesa.c=0A+++ b/xen/drivers/video/vesa.c=0A@@ =
-10,6 +10,7 @@=0A #include <xen/xmalloc.h>=0A #include <xen/kernel.h>=0A =
#include <xen/vga.h>=0A+#include <asm/io.h>=0A #include <asm/page.h>=0A =
#include "font.h"=0A =0A@@ -101,13 +102,11 @@ void __init vesa_init(void)=
=0A     if ( !line_len )=0A         goto fail;=0A =0A-    if ( map_pages_to=
_xen(IOREMAP_VIRT_START,=0A-                          vlfb_info.lfb_base =
>> PAGE_SHIFT,=0A-                          vram_remap >> PAGE_SHIFT,=0A-  =
                        PAGE_HYPERVISOR_NOCACHE) )=0A+    lfb =3D =
ioremap(vlfb_info.lfb_base, vram_remap);=0A+    if ( !lfb )=0A         =
goto fail;=0A =0A-    lfb =3D memset((void *)IOREMAP_VIRT_START, 0, =
vram_remap);=0A+    memset(lfb, 0, vram_remap);=0A =0A     vga_puts =3D =
vesa_redraw_puts;=0A =0A--- a/xen/include/asm-x86/config.h=0A+++ b/xen/incl=
ude/asm-x86/config.h=0A@@ -144,7 +144,7 @@ extern unsigned char boot_edid_i=
nfo[128]=0A  *  0xffff828000000000 - 0xffff82bfffffffff [256GB, 2^38 =
bytes, PML4:261]=0A  *    Machine-to-phys translation table.=0A  *  =
0xffff82c000000000 - 0xffff82c3ffffffff [16GB,  2^34 bytes, PML4:261]=0A- =
*    ioremap()/fixmap area.=0A+ *    vmap()/ioremap()/fixmap area.=0A  *  =
0xffff82c400000000 - 0xffff82c43fffffff [1GB,   2^30 bytes, PML4:261]=0A  =
*    Compatibility machine-to-phys translation table.=0A  *  0xffff82c44000=
0000 - 0xffff82c47fffffff [1GB,   2^30 bytes, PML4:261]=0A@@ -205,11 =
+205,11 @@ extern unsigned char boot_edid_info[128]=0A /* Slot 261: =
machine-to-phys conversion table (256GB). */=0A #define RDWR_MPT_VIRT_START=
     (PML4_ADDR(261))=0A #define RDWR_MPT_VIRT_END       (RDWR_MPT_VIRT_STA=
RT + MPT_VIRT_SIZE)=0A-/* Slot 261: ioremap()/fixmap area (16GB). =
*/=0A-#define IOREMAP_VIRT_START      RDWR_MPT_VIRT_END=0A-#define =
IOREMAP_VIRT_END        (IOREMAP_VIRT_START + GB(16))=0A+/* Slot 261: =
vmap()/ioremap()/fixmap area (16GB). */=0A+#define VMAP_VIRT_START         =
RDWR_MPT_VIRT_END=0A+#define VMAP_VIRT_END           (VMAP_VIRT_START + =
GB(16))=0A /* Slot 261: compatibility machine-to-phys conversion table =
(1GB). */=0A-#define RDWR_COMPAT_MPT_VIRT_START IOREMAP_VIRT_END=0A+#define=
 RDWR_COMPAT_MPT_VIRT_START VMAP_VIRT_END=0A #define RDWR_COMPAT_MPT_VIRT_E=
ND (RDWR_COMPAT_MPT_VIRT_START + GB(1))=0A /* Slot 261: high read-only =
compat machine-to-phys conversion table (1GB). */=0A #define HIRO_COMPAT_MP=
T_VIRT_START RDWR_COMPAT_MPT_VIRT_END=0A--- a/xen/include/asm-x86/fixmap.h=
=0A+++ b/xen/include/asm-x86/fixmap.h=0A@@ -15,7 +15,7 @@=0A #include =
<xen/config.h>=0A #include <asm/page.h>=0A =0A-#define FIXADDR_TOP =
(IOREMAP_VIRT_END - PAGE_SIZE)=0A+#define FIXADDR_TOP (VMAP_VIRT_END - =
PAGE_SIZE)=0A =0A #ifndef __ASSEMBLY__=0A =0A--- a/xen/include/asm-x86/io.h=
=0A+++ b/xen/include/asm-x86/io.h=0A@@ -1,14 +1,10 @@=0A #ifndef =
_ASM_IO_H=0A #define _ASM_IO_H=0A =0A-#include <xen/config.h>=0A+#include =
<xen/vmap.h>=0A #include <xen/types.h>=0A #include <asm/page.h>=0A =0A-/* =
We don't need real ioremap() on Xen/x86. */=0A-#define ioremap(x,l) =
(__va(x))=0A-#define iounmap(p)   ((void)0)=0A-=0A #define readb(x) =
(*(volatile char *)(x))=0A #define readw(x) (*(volatile short *)(x))=0A =
#define readl(x) (*(volatile int *)(x))=0A--- /dev/null=0A+++ b/xen/include=
/xen/vmap.h=0A@@ -0,0 +1,24 @@=0A+#if !defined(__XEN_VMAP_H__) && =
defined(VMAP_VIRT_START)=0A+#define __XEN_VMAP_H__=0A+=0A+#include =
<xen/types.h>=0A+=0A+void *vm_alloc(unsigned int nr, unsigned int =
align);=0A+void vm_free(const void *);=0A+=0A+void *__vmap(const unsigned =
long *mfn, unsigned int granularity,=0A+             unsigned int nr, =
unsigned int align, unsigned int flags);=0A+void *vmap(const unsigned long =
*mfn, unsigned int nr);=0A+void vunmap(const void *);=0A+=0A+void __iomem =
*ioremap(paddr_t, size_t);=0A+=0A+static inline void iounmap(void __iomem =
*va)=0A+{=0A+    vunmap((void __force *)va);=0A+}=0A+=0A+void vm_init(void)=
;=0A+void *arch_vmap_virt_end(void);=0A+=0A+#endif /* __XEN_VMAP_H__ */=0A
--=__Part5D6C9DFC.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.xen.org
http://lists.xen.org/xen-devel

--=__Part5D6C9DFC.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 09 13:31:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 13:31:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWog2-000562-MR; Fri, 09 Nov 2012 13:31:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TWog1-00055w-DD
	for xen-devel@lists.xensource.com; Fri, 09 Nov 2012 13:31:17 +0000
Received: from [85.158.138.51:33360] by server-4.bemta-3.messagelabs.com id
	6E/06-30023-1A50D905; Fri, 09 Nov 2012 13:31:13 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1352467749!29378592!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwNzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12363 invoked from network); 9 Nov 2012 13:29:09 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 13:29:09 -0000
X-IronPort-AV: E=Sophos;i="4.80,745,1344211200"; d="scan'208";a="15697118"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	09 Nov 2012 13:29:05 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Fri, 9 Nov 2012
	13:29:05 +0000
Message-ID: <1352467744.27833.21.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: John Weekes <lists.xen@nuclearfallout.net>
Date: Fri, 9 Nov 2012 13:29:04 +0000
In-Reply-To: <509C19DE.6010108@nuclearfallout.net>
References: <509C19DE.6010108@nuclearfallout.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Matt Wilson <msw@amazon.com>, Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] Bugs in xl that affect stubdom+tapdisk2, and others
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-08 at 20:45 +0000, John Weekes wrote:

> - It's not allowing multiple domains to use the same images, at least 
> under tapdisk2. If I start one domain using an image (a read-only CD-ROM 
> image, for instance), then start another, I can see in "tap-ctl list" 
> that only one of the domains actually receives the proper access. The 
> other either never gets it, or it is disconnected after it's created -- 
> I can't readily tell which.
> 
> - When I use "xl destroy" on a domain that also has an associated 
> stubdom, "xl" tries to destroy the tapdisk2 entries for both the domain 
> and its stubdomain, resulting in errors like these:
> 
> # xl destroy testvds4
> libxl: error: libxl_blktap2.c:73:libxl__device_destroy_tapdisk: Unable 
> to find type aio disk /servers/isos/DummyCD.iso: No such file or directory
> libxl: error: libxl_blktap2.c:73:libxl__device_destroy_tapdisk: Unable 
> to find type aio disk /servers/customers/testvds4.img: No such file or 
> directory
> libxl: error: libxl_blktap2.c:73:libxl__device_destroy_tapdisk: Unable 
> to find type aio disk /servers/isos/DummyCD-2.iso: No such file or directory
> libxl: error: libxl.c:1466:devices_destroy_cb: libxl__devices_destroy 
> failed for 19
> libxl: error: libxl.c:1466:devices_destroy_cb: libxl__devices_destroy 
> failed for 18
> 
> If I'm reading the source correctly, it seems as though the various 
> destruction functions aren't passing down the domid and ultimately 
> libxl__device_destroy_tapdisk is calling tap_ctl_find, which just 
> globally matches based on the type and name of the image, causing the 
> errors on destroy.

Both of these sound like genuine bugs which should be fixed, thanks for
reporting. Are either of them something you might be interested in
tackling? I'm nore than happy to give guidance etc.

For clarity it might be useful to have the config files for the various
domains involved here.

> Another, much more minor, bug in "xl" that I've found is that "xl 
> uptime" will not run without an argument; it is supposed to just show 
> all uptimes in this circumstance. This is an easy one-liner fix of 
> modifying line:
> 
> tools/libxl/xl_cmdimpl.c:5749:    while ((opt = def_getopt(argc, argv, 
> "s", "uptime", 1)) != -1) {
> 
> into this:
> 
> tools/libxl/xl_cmdimpl.c:5749:    while ((opt = def_getopt(argc, argv, 
> "s", "uptime", 0)) != -1) {
> 
> Also, a couple of small typos in "xl" --
> 
> libxl.c:556:        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting 
> domain info list");
> libxl.c:575:        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting 
> domain info list");
> libxl.c:678:        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting 
> domain info list");
> libxl.c:1393:        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "non-existant 
> domain %d", domid);

Would you mind submitting patches for these two issues please?

See http://wiki.xen.org/wiki/Submitting_Xen_Patches for some
hints/tip/guidance.

> Also, running "xl sched-credit" always gives me an error, even though it 
> seems to work. Maybe it should be silent if cpu pools aren't defined? 

George (CCd) submitted a fix for this a while back (see
http://marc.info/?l=xen-devel&m=134502346714773). There is an
outstanding question though.

> As an additional note about 4.2 -- this isn't an "xl" issue, but rather 
> a build problem -- even though I use "./configure --libdir=/usr/lib64", 
> the build is still creating a "dist/install/usr/lib" directory, and 
> because of this, running ./install.sh nukes my system's "/usr/lib" -> 
> "/usr/lib64" softlink (which in turn causes all sorts of other problems 
> until it's corrected). Files that are being put in that tree:
> 
> xen-4.2-testing.hg # find dist/install/usr/lib
> dist/install/usr/lib

This is an interesting one. I'm not sure how we can avoid this
behaviour, perhaps there is a tar option to cause it to follow rather
than clobber synlinks?

The only other choice I can think of is to change install.sh to use a
(long) explicit list of $(FOO_DIR)/* entries instead of the single * to
avoid including system directories, or to otherwise make install.sh more
fragile and prone to bitrot :-(

I must confess I didn't realise anyone used install.sh -- is there some
advantage to it over make foo-install?

OOI which distro has this lib->lib64 link and what issues does removing
it create?

> dist/install/usr/lib/xen

This is $(XENFIRMWAREDIR). I have a feeling there is a reason this is
not using $(LIBDIR), but I don't recall what it was -- Roget/Matt do you
remember?

Thanks again for reporting all these.

Ian.

> dist/install/usr/lib/xen/boot
> dist/install/usr/lib/xen/boot/xenstore-stubdom.gz
> dist/install/usr/lib/xen/boot/ioemu-stubdom.gz
> dist/install/usr/lib/xen/boot/pv-grub-x86_64.gz
> dist/install/usr/lib/xen/boot/hvmloader
> dist/install/usr/lib/xen/boot/pv-grub-x86_32.gz
> dist/install/usr/lib/xen/bin
> dist/install/usr/lib/xen/bin/stubdom-dm
> dist/install/usr/lib/xen/bin/qemu-io
> dist/install/usr/lib/xen/bin/qemu-nbd
> dist/install/usr/lib/xen/bin/qemu-img
> dist/install/usr/lib/xen/bin/xenpaging
> dist/install/usr/lib/xen/bin/qemu-dm
> dist/install/usr/lib/xen/bin/qemu-system-i386
> dist/install/usr/lib/xen/bin/qemu-ga
> dist/install/usr/lib/xen/bin/stubdompath.sh
> 
> -John
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 13:31:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 13:31:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWog2-000562-MR; Fri, 09 Nov 2012 13:31:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TWog1-00055w-DD
	for xen-devel@lists.xensource.com; Fri, 09 Nov 2012 13:31:17 +0000
Received: from [85.158.138.51:33360] by server-4.bemta-3.messagelabs.com id
	6E/06-30023-1A50D905; Fri, 09 Nov 2012 13:31:13 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1352467749!29378592!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwNzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12363 invoked from network); 9 Nov 2012 13:29:09 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 13:29:09 -0000
X-IronPort-AV: E=Sophos;i="4.80,745,1344211200"; d="scan'208";a="15697118"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	09 Nov 2012 13:29:05 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Fri, 9 Nov 2012
	13:29:05 +0000
Message-ID: <1352467744.27833.21.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: John Weekes <lists.xen@nuclearfallout.net>
Date: Fri, 9 Nov 2012 13:29:04 +0000
In-Reply-To: <509C19DE.6010108@nuclearfallout.net>
References: <509C19DE.6010108@nuclearfallout.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Matt Wilson <msw@amazon.com>, Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] Bugs in xl that affect stubdom+tapdisk2, and others
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-08 at 20:45 +0000, John Weekes wrote:

> - It's not allowing multiple domains to use the same images, at least 
> under tapdisk2. If I start one domain using an image (a read-only CD-ROM 
> image, for instance), then start another, I can see in "tap-ctl list" 
> that only one of the domains actually receives the proper access. The 
> other either never gets it, or it is disconnected after it's created -- 
> I can't readily tell which.
> 
> - When I use "xl destroy" on a domain that also has an associated 
> stubdom, "xl" tries to destroy the tapdisk2 entries for both the domain 
> and its stubdomain, resulting in errors like these:
> 
> # xl destroy testvds4
> libxl: error: libxl_blktap2.c:73:libxl__device_destroy_tapdisk: Unable 
> to find type aio disk /servers/isos/DummyCD.iso: No such file or directory
> libxl: error: libxl_blktap2.c:73:libxl__device_destroy_tapdisk: Unable 
> to find type aio disk /servers/customers/testvds4.img: No such file or 
> directory
> libxl: error: libxl_blktap2.c:73:libxl__device_destroy_tapdisk: Unable 
> to find type aio disk /servers/isos/DummyCD-2.iso: No such file or directory
> libxl: error: libxl.c:1466:devices_destroy_cb: libxl__devices_destroy 
> failed for 19
> libxl: error: libxl.c:1466:devices_destroy_cb: libxl__devices_destroy 
> failed for 18
> 
> If I'm reading the source correctly, it seems as though the various 
> destruction functions aren't passing down the domid and ultimately 
> libxl__device_destroy_tapdisk is calling tap_ctl_find, which just 
> globally matches based on the type and name of the image, causing the 
> errors on destroy.

Both of these sound like genuine bugs which should be fixed, thanks for
reporting. Are either of them something you might be interested in
tackling? I'm nore than happy to give guidance etc.

For clarity it might be useful to have the config files for the various
domains involved here.

> Another, much more minor, bug in "xl" that I've found is that "xl 
> uptime" will not run without an argument; it is supposed to just show 
> all uptimes in this circumstance. This is an easy one-liner fix of 
> modifying line:
> 
> tools/libxl/xl_cmdimpl.c:5749:    while ((opt = def_getopt(argc, argv, 
> "s", "uptime", 1)) != -1) {
> 
> into this:
> 
> tools/libxl/xl_cmdimpl.c:5749:    while ((opt = def_getopt(argc, argv, 
> "s", "uptime", 0)) != -1) {
> 
> Also, a couple of small typos in "xl" --
> 
> libxl.c:556:        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting 
> domain info list");
> libxl.c:575:        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting 
> domain info list");
> libxl.c:678:        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting 
> domain info list");
> libxl.c:1393:        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "non-existant 
> domain %d", domid);

Would you mind submitting patches for these two issues please?

See http://wiki.xen.org/wiki/Submitting_Xen_Patches for some
hints/tip/guidance.

> Also, running "xl sched-credit" always gives me an error, even though it 
> seems to work. Maybe it should be silent if cpu pools aren't defined? 

George (CCd) submitted a fix for this a while back (see
http://marc.info/?l=xen-devel&m=134502346714773). There is an
outstanding question though.

> As an additional note about 4.2 -- this isn't an "xl" issue, but rather 
> a build problem -- even though I use "./configure --libdir=/usr/lib64", 
> the build is still creating a "dist/install/usr/lib" directory, and 
> because of this, running ./install.sh nukes my system's "/usr/lib" -> 
> "/usr/lib64" softlink (which in turn causes all sorts of other problems 
> until it's corrected). Files that are being put in that tree:
> 
> xen-4.2-testing.hg # find dist/install/usr/lib
> dist/install/usr/lib

This is an interesting one. I'm not sure how we can avoid this
behaviour, perhaps there is a tar option to cause it to follow rather
than clobber synlinks?

The only other choice I can think of is to change install.sh to use a
(long) explicit list of $(FOO_DIR)/* entries instead of the single * to
avoid including system directories, or to otherwise make install.sh more
fragile and prone to bitrot :-(

I must confess I didn't realise anyone used install.sh -- is there some
advantage to it over make foo-install?

OOI which distro has this lib->lib64 link and what issues does removing
it create?

> dist/install/usr/lib/xen

This is $(XENFIRMWAREDIR). I have a feeling there is a reason this is
not using $(LIBDIR), but I don't recall what it was -- Roget/Matt do you
remember?

Thanks again for reporting all these.

Ian.

> dist/install/usr/lib/xen/boot
> dist/install/usr/lib/xen/boot/xenstore-stubdom.gz
> dist/install/usr/lib/xen/boot/ioemu-stubdom.gz
> dist/install/usr/lib/xen/boot/pv-grub-x86_64.gz
> dist/install/usr/lib/xen/boot/hvmloader
> dist/install/usr/lib/xen/boot/pv-grub-x86_32.gz
> dist/install/usr/lib/xen/bin
> dist/install/usr/lib/xen/bin/stubdom-dm
> dist/install/usr/lib/xen/bin/qemu-io
> dist/install/usr/lib/xen/bin/qemu-nbd
> dist/install/usr/lib/xen/bin/qemu-img
> dist/install/usr/lib/xen/bin/xenpaging
> dist/install/usr/lib/xen/bin/qemu-dm
> dist/install/usr/lib/xen/bin/qemu-system-i386
> dist/install/usr/lib/xen/bin/qemu-ga
> dist/install/usr/lib/xen/bin/stubdompath.sh
> 
> -John
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 13:49:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 13:49:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWowr-0005Js-A1; Fri, 09 Nov 2012 13:48:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TWowp-0005Jn-TP
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 13:48:40 +0000
Received: from [85.158.138.51:32469] by server-5.bemta-3.messagelabs.com id
	A2/77-26311-7B90D905; Fri, 09 Nov 2012 13:48:39 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1352468916!20498710!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1MjgxMA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26108 invoked from network); 9 Nov 2012 13:48:38 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 9 Nov 2012 13:48:38 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA9DmX8X014938
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 9 Nov 2012 13:48:34 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA9DmWA7002488
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 9 Nov 2012 13:48:33 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA9DmWxo016186; Fri, 9 Nov 2012 07:48:32 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 09 Nov 2012 05:48:32 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id E39774042D; Fri,  9 Nov 2012 08:48:29 -0500 (EST)
Date: Fri, 9 Nov 2012 08:48:29 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121109134829.GB30634@phenom.dumpdata.com>
References: <1350037688.14806.93.camel@zakaz.uk.xensource.com>
	<509CD50302000078000A76E4@nat28.tlf.novell.com>
	<1352452573.21048.35.camel@dagon.hellion.org.uk>
	<509CDDBA02000078000A772C@nat28.tlf.novell.com>
	<509CEAB402000078000A7772@nat28.tlf.novell.com>
	<509CFA7B02000078000A778C@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="5mCyUwZo2JvN/JJP"
Content-Disposition: inline
In-Reply-To: <509CFA7B02000078000A778C@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Ian Campbell <Ian.Campbell@citrix.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something issue in
 3.7-rc1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--5mCyUwZo2JvN/JJP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri, Nov 09, 2012 at 11:43:39AM +0000, Jan Beulich wrote:
> >>> On 09.11.12 at 11:36, "Jan Beulich" <JBeulich@suse.com> wrote:
> > In the forward ported kernels, those two checks are however
> > accompanied by range_needs_mapping() (aka
> > range_straddles_page_boundary()) checks, which ought to
> > take care of this. There is brokenness there with the invocations
> > of gnttab_dma_map_page(), but only if the initial offset is at
> > least PAGE_SIZE - will have to check whether that occurs.
> 
> And indeed, fixing this also makes the problem go away when
> the allocation order doesn't get forced to zero. So presumably
> there's also only that one problem I had pointed out in pv-ops.

The pvops one has this in the map-page variant (xen_swiotlb_map_page):

351         if (dma_capable(dev, dev_addr, size) &&
352             !range_straddles_page_boundary(phys, size) && !swiotlb_force)
353                 return dev_addr;

and in the sg variant:

494                 if (swiotlb_force ||
495                     !dma_capable(hwdev, dev_addr, sg->length) ||
496                     range_straddles_page_boundary(paddr, sg->length)) {
497                         void *map = swiotlb_tbl_map_single(hwdev,

So I think that check is OK. There is no gnttab_dma_map_page call - so that
can't be the issue.

I did play with this a bit and wrote this little driver (see attached) that
forces allocation of large pages and it worked as expected on Xen-SWIOTLB.

But while doing this I found that the 'skge' driver is busted - it does not
even work on baremetal if you do 'iommu=soft swiotlb=force'. Since
Xen-SWIOTLB would occasionaly use the bounce-buffer  - and with greater than
0-page order - the bug in skge became more obvious. I hadn't narrowed down
where the issue is with skge.
> 
> Jan

--5mCyUwZo2JvN/JJP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="dma_test.c"

#include <linux/module.h>
#include <linux/kthread.h>
#include <linux/pagemap.h>
#include <linux/init.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <xen/page.h>

#define DMA_TEST  "0.1"

MODULE_AUTHOR("Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>");
MODULE_DESCRIPTION("dma_test");
MODULE_LICENSE("GPL");
MODULE_VERSION(DMA_TEST);

static struct bus_type fallback_bus_type = {
	.name = "fallback_bus:",
};

static void fake_release(struct device *dev)
{
	/* No kfree as the device was allocated on stack. */
}

struct args {
	int len;
	enum dma_data_direction dir;
};

#define MAGIC_DEVICE 0xffffffdd
#define MAGIC_CPU 0xffffffcc

static int dma_test_thread(void *arg)
{
	struct page *page;
	dma_addr_t dma_addr = 0;
	struct device fake = {
		.coherent_dma_mask = DMA_BIT_MASK(32),
		.bus = &fallback_bus_type,
		.release = fake_release,
	};
	gfp_t gfp = __GFP_COMP | __GFP_NOWARN | GFP_ATOMIC;
	int ret;
	int i;
	void *addr;
	struct page *p;

	struct args *args = (struct args *)arg;
	int dir = args->dir;
	int len = args->len;

	dev_set_name(&fake, "%s", dir == DMA_TO_DEVICE ? "to_dev" : "to_cpu");
 	fake.dma_mask = &fake.coherent_dma_mask;
 	ret = device_register(&fake);
	if (ret)
		goto out;

	do {
		unsigned long prev_mfn = 0;
		bool bus_and_dma_same;

		page = alloc_pages(gfp, get_order(len));
		p = page;
		/* Check that the bus addresses are contingous. */
		for (i = 0; i < len / PAGE_SIZE; i++, p++) {
			unsigned long pfn, mfn;

			addr = page_address(p);
			pfn = PFN_DOWN(virt_to_phys(addr));
			if (xen_domain())
				mfn = pfn_to_mfn(pfn);
			else
				mfn = pfn;
			if (i != 0) {
				if (prev_mfn + 1 != mfn)
					dev_warn(&fake, "va: %lx (pfn:%lx, mfn:%lx) w.r.t prev mfn: %lx!\n",
						 (unsigned long)addr, pfn, mfn, prev_mfn);
			}
			prev_mfn = mfn;
		}
		dma_addr = dma_map_page(&fake, page, 0 /* no offset */, len, dir);
		/* Note, dma_addr is the physical address ! */
		if (dma_mapping_error(&fake, dma_addr)) {
			dev_warn(&fake, "DMA %lx for %lx is not right\n", (unsigned long)dma_addr,
				(unsigned long)page_address(page));
			__free_pages(page, get_order(len));
			page = NULL;
		}
		bus_and_dma_same = false;
		if (page) {
			unsigned long phys;
			unsigned long pfn, mfn, bus_addr_mfn;
			unsigned long bus_addr = 0;

			p = page;
			for (i = 0; i < len / PAGE_SIZE; i++, p++) {
				void *bus_va;

				addr = page_address(p);
				phys = virt_to_phys(addr);
				pfn = PFN_DOWN(phys);

				bus_va = (void *)(dma_addr + (i * PAGE_SIZE));

				if (xen_domain()) {
					void * tmp;

					/* Find the bus frame for the physical frame*/
					mfn = pfn_to_mfn(pfn);
					/* and .. voodoo time! */
					bus_addr_mfn = PFN_DOWN(dma_addr + (i * PAGE_SIZE));
					bus_addr = PFN_PHYS(mfn_to_pfn(bus_addr_mfn));
					tmp = __va(bus_addr);
					bus_va = mfn_to_virt(bus_addr_mfn);
					WARN(bus_va != tmp, "Expected %lx (%lx+%d*PAGE_SIZE), got: %lx (pfn: %lx, mfn: %lx)!\n",
						(unsigned long)bus_va, (unsigned long)dma_addr, i, (unsigned long)tmp, PFN_DOWN(bus_addr), bus_addr_mfn);
				} else {
					mfn = pfn;
					bus_addr = (unsigned long)bus_va;
					/* Assume DMA addr == physical addr */
					bus_addr_mfn = PFN_DOWN(bus_addr);
					bus_va = __va(PFN_PHYS(bus_addr_mfn));
				}

				dev_info(&fake, "%lx (pfn:%lx, bus frame: %lx) %s %lx (addr: %lx, frame: %lx)\n",
					(unsigned long)addr, pfn, mfn,
					dir == DMA_TO_DEVICE ? "=>" : "<=",
					(unsigned long)bus_va, bus_addr, bus_addr_mfn);

				if (!virt_addr_valid(bus_va))
					break;
				if (!virt_addr_valid(addr))
					break;

				/* CPU */
				memset(addr, 0xCC, PAGE_SIZE);

				/* Device */
				memset(bus_va, 0xDD, PAGE_SIZE);
				if (addr == bus_va)
					bus_and_dma_same = true;
			}
		}
		set_current_state(TASK_INTERRUPTIBLE);
		schedule_timeout_interruptible(5*HZ);

		if (!page)
			continue;
		p = page;

		for (i = 0; i < len / PAGE_SIZE; i++, p++) {
			if (bus_and_dma_same)
				continue;
			addr = page_address(p);
			if (((char *)addr)[0] != MAGIC_CPU)
				dev_warn(&fake, "%lx with DMA (%lx) has %x (expected %lx)\n",
					(unsigned long)addr, (unsigned long)(dma_addr + (i * PAGE_SIZE)),
					((char *)addr)[0], (unsigned long)MAGIC_CPU);
		}
		/* sync the page */
		dma_sync_single_for_cpu(&fake, dma_addr, len, dir);
		p = page;
		for (i = 0; i < len / PAGE_SIZE; i++, p++) {
			unsigned long check_val = MAGIC_DEVICE;

			addr = page_address(p);
			if (dir == DMA_TO_DEVICE)
				check_val = MAGIC_CPU;
			if (dir == DMA_FROM_DEVICE)
				check_val = MAGIC_DEVICE;

			dev_info(&fake, "%lx with DMA (%lx) has %x (expected %lx)\n",
				(unsigned long)addr, (unsigned long)(dma_addr + (i * PAGE_SIZE)),
				((char *)addr)[0], check_val);
		}
		dma_unmap_page(&fake, dma_addr, len, dir);
		dma_addr = 0;
		__free_pages(page, get_order(len));
		page = NULL;
	} while (!kthread_should_stop());

	if (dma_addr)
		dma_unmap_page(&fake, dma_addr, len, dir);
	if (page)
		__free_pages(page, get_order(len));
   	put_device(&fake);
 	device_unregister(&fake);
out:
	return 0;
}
static struct task_struct *t[2];
static struct args a[2];

static int __init dma_test_init(void)
{
	int ret;

	/* No point doing this without SWIOTLB */
	if (!swiotlb_nr_tbl())
		return -ENODEV;

	ret = bus_register(&fallback_bus_type);
	if (ret)
		return ret;

	a[0].dir = DMA_TO_DEVICE;
	a[0].len = 32768;
	t[0] = kthread_run(dma_test_thread, &a[0], "dma_test_dev");

	a[1].len = 16384;
	a[1].dir = DMA_FROM_DEVICE;
	t[1] = kthread_run(dma_test_thread, &a[1], "dma_test_cpu");
	return 0;
}
static void __exit dma_test_exit(void)
{
	if (t[0])
		kthread_stop(t[0]);
	if (t[1])
		kthread_stop(t[1]);

 	bus_unregister(&fallback_bus_type);
}
module_init(dma_test_init);
module_exit(dma_test_exit);

--5mCyUwZo2JvN/JJP
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.xen.org
http://lists.xen.org/xen-devel

--5mCyUwZo2JvN/JJP--


From xen-devel-bounces@lists.xen.org Fri Nov 09 13:49:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 13:49:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWowr-0005Js-A1; Fri, 09 Nov 2012 13:48:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TWowp-0005Jn-TP
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 13:48:40 +0000
Received: from [85.158.138.51:32469] by server-5.bemta-3.messagelabs.com id
	A2/77-26311-7B90D905; Fri, 09 Nov 2012 13:48:39 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1352468916!20498710!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1MjgxMA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26108 invoked from network); 9 Nov 2012 13:48:38 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 9 Nov 2012 13:48:38 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA9DmX8X014938
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 9 Nov 2012 13:48:34 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA9DmWA7002488
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 9 Nov 2012 13:48:33 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA9DmWxo016186; Fri, 9 Nov 2012 07:48:32 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 09 Nov 2012 05:48:32 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id E39774042D; Fri,  9 Nov 2012 08:48:29 -0500 (EST)
Date: Fri, 9 Nov 2012 08:48:29 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121109134829.GB30634@phenom.dumpdata.com>
References: <1350037688.14806.93.camel@zakaz.uk.xensource.com>
	<509CD50302000078000A76E4@nat28.tlf.novell.com>
	<1352452573.21048.35.camel@dagon.hellion.org.uk>
	<509CDDBA02000078000A772C@nat28.tlf.novell.com>
	<509CEAB402000078000A7772@nat28.tlf.novell.com>
	<509CFA7B02000078000A778C@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="5mCyUwZo2JvN/JJP"
Content-Disposition: inline
In-Reply-To: <509CFA7B02000078000A778C@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Ian Campbell <Ian.Campbell@citrix.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something issue in
 3.7-rc1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--5mCyUwZo2JvN/JJP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri, Nov 09, 2012 at 11:43:39AM +0000, Jan Beulich wrote:
> >>> On 09.11.12 at 11:36, "Jan Beulich" <JBeulich@suse.com> wrote:
> > In the forward ported kernels, those two checks are however
> > accompanied by range_needs_mapping() (aka
> > range_straddles_page_boundary()) checks, which ought to
> > take care of this. There is brokenness there with the invocations
> > of gnttab_dma_map_page(), but only if the initial offset is at
> > least PAGE_SIZE - will have to check whether that occurs.
> 
> And indeed, fixing this also makes the problem go away when
> the allocation order doesn't get forced to zero. So presumably
> there's also only that one problem I had pointed out in pv-ops.

The pvops one has this in the map-page variant (xen_swiotlb_map_page):

351         if (dma_capable(dev, dev_addr, size) &&
352             !range_straddles_page_boundary(phys, size) && !swiotlb_force)
353                 return dev_addr;

and in the sg variant:

494                 if (swiotlb_force ||
495                     !dma_capable(hwdev, dev_addr, sg->length) ||
496                     range_straddles_page_boundary(paddr, sg->length)) {
497                         void *map = swiotlb_tbl_map_single(hwdev,

So I think that check is OK. There is no gnttab_dma_map_page call - so that
can't be the issue.

I did play with this a bit and wrote this little driver (see attached) that
forces allocation of large pages and it worked as expected on Xen-SWIOTLB.

But while doing this I found that the 'skge' driver is busted - it does not
even work on baremetal if you do 'iommu=soft swiotlb=force'. Since
Xen-SWIOTLB would occasionaly use the bounce-buffer  - and with greater than
0-page order - the bug in skge became more obvious. I hadn't narrowed down
where the issue is with skge.
> 
> Jan

--5mCyUwZo2JvN/JJP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="dma_test.c"

#include <linux/module.h>
#include <linux/kthread.h>
#include <linux/pagemap.h>
#include <linux/init.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <xen/page.h>

#define DMA_TEST  "0.1"

MODULE_AUTHOR("Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>");
MODULE_DESCRIPTION("dma_test");
MODULE_LICENSE("GPL");
MODULE_VERSION(DMA_TEST);

static struct bus_type fallback_bus_type = {
	.name = "fallback_bus:",
};

static void fake_release(struct device *dev)
{
	/* No kfree as the device was allocated on stack. */
}

struct args {
	int len;
	enum dma_data_direction dir;
};

#define MAGIC_DEVICE 0xffffffdd
#define MAGIC_CPU 0xffffffcc

static int dma_test_thread(void *arg)
{
	struct page *page;
	dma_addr_t dma_addr = 0;
	struct device fake = {
		.coherent_dma_mask = DMA_BIT_MASK(32),
		.bus = &fallback_bus_type,
		.release = fake_release,
	};
	gfp_t gfp = __GFP_COMP | __GFP_NOWARN | GFP_ATOMIC;
	int ret;
	int i;
	void *addr;
	struct page *p;

	struct args *args = (struct args *)arg;
	int dir = args->dir;
	int len = args->len;

	dev_set_name(&fake, "%s", dir == DMA_TO_DEVICE ? "to_dev" : "to_cpu");
 	fake.dma_mask = &fake.coherent_dma_mask;
 	ret = device_register(&fake);
	if (ret)
		goto out;

	do {
		unsigned long prev_mfn = 0;
		bool bus_and_dma_same;

		page = alloc_pages(gfp, get_order(len));
		p = page;
		/* Check that the bus addresses are contingous. */
		for (i = 0; i < len / PAGE_SIZE; i++, p++) {
			unsigned long pfn, mfn;

			addr = page_address(p);
			pfn = PFN_DOWN(virt_to_phys(addr));
			if (xen_domain())
				mfn = pfn_to_mfn(pfn);
			else
				mfn = pfn;
			if (i != 0) {
				if (prev_mfn + 1 != mfn)
					dev_warn(&fake, "va: %lx (pfn:%lx, mfn:%lx) w.r.t prev mfn: %lx!\n",
						 (unsigned long)addr, pfn, mfn, prev_mfn);
			}
			prev_mfn = mfn;
		}
		dma_addr = dma_map_page(&fake, page, 0 /* no offset */, len, dir);
		/* Note, dma_addr is the physical address ! */
		if (dma_mapping_error(&fake, dma_addr)) {
			dev_warn(&fake, "DMA %lx for %lx is not right\n", (unsigned long)dma_addr,
				(unsigned long)page_address(page));
			__free_pages(page, get_order(len));
			page = NULL;
		}
		bus_and_dma_same = false;
		if (page) {
			unsigned long phys;
			unsigned long pfn, mfn, bus_addr_mfn;
			unsigned long bus_addr = 0;

			p = page;
			for (i = 0; i < len / PAGE_SIZE; i++, p++) {
				void *bus_va;

				addr = page_address(p);
				phys = virt_to_phys(addr);
				pfn = PFN_DOWN(phys);

				bus_va = (void *)(dma_addr + (i * PAGE_SIZE));

				if (xen_domain()) {
					void * tmp;

					/* Find the bus frame for the physical frame*/
					mfn = pfn_to_mfn(pfn);
					/* and .. voodoo time! */
					bus_addr_mfn = PFN_DOWN(dma_addr + (i * PAGE_SIZE));
					bus_addr = PFN_PHYS(mfn_to_pfn(bus_addr_mfn));
					tmp = __va(bus_addr);
					bus_va = mfn_to_virt(bus_addr_mfn);
					WARN(bus_va != tmp, "Expected %lx (%lx+%d*PAGE_SIZE), got: %lx (pfn: %lx, mfn: %lx)!\n",
						(unsigned long)bus_va, (unsigned long)dma_addr, i, (unsigned long)tmp, PFN_DOWN(bus_addr), bus_addr_mfn);
				} else {
					mfn = pfn;
					bus_addr = (unsigned long)bus_va;
					/* Assume DMA addr == physical addr */
					bus_addr_mfn = PFN_DOWN(bus_addr);
					bus_va = __va(PFN_PHYS(bus_addr_mfn));
				}

				dev_info(&fake, "%lx (pfn:%lx, bus frame: %lx) %s %lx (addr: %lx, frame: %lx)\n",
					(unsigned long)addr, pfn, mfn,
					dir == DMA_TO_DEVICE ? "=>" : "<=",
					(unsigned long)bus_va, bus_addr, bus_addr_mfn);

				if (!virt_addr_valid(bus_va))
					break;
				if (!virt_addr_valid(addr))
					break;

				/* CPU */
				memset(addr, 0xCC, PAGE_SIZE);

				/* Device */
				memset(bus_va, 0xDD, PAGE_SIZE);
				if (addr == bus_va)
					bus_and_dma_same = true;
			}
		}
		set_current_state(TASK_INTERRUPTIBLE);
		schedule_timeout_interruptible(5*HZ);

		if (!page)
			continue;
		p = page;

		for (i = 0; i < len / PAGE_SIZE; i++, p++) {
			if (bus_and_dma_same)
				continue;
			addr = page_address(p);
			if (((char *)addr)[0] != MAGIC_CPU)
				dev_warn(&fake, "%lx with DMA (%lx) has %x (expected %lx)\n",
					(unsigned long)addr, (unsigned long)(dma_addr + (i * PAGE_SIZE)),
					((char *)addr)[0], (unsigned long)MAGIC_CPU);
		}
		/* sync the page */
		dma_sync_single_for_cpu(&fake, dma_addr, len, dir);
		p = page;
		for (i = 0; i < len / PAGE_SIZE; i++, p++) {
			unsigned long check_val = MAGIC_DEVICE;

			addr = page_address(p);
			if (dir == DMA_TO_DEVICE)
				check_val = MAGIC_CPU;
			if (dir == DMA_FROM_DEVICE)
				check_val = MAGIC_DEVICE;

			dev_info(&fake, "%lx with DMA (%lx) has %x (expected %lx)\n",
				(unsigned long)addr, (unsigned long)(dma_addr + (i * PAGE_SIZE)),
				((char *)addr)[0], check_val);
		}
		dma_unmap_page(&fake, dma_addr, len, dir);
		dma_addr = 0;
		__free_pages(page, get_order(len));
		page = NULL;
	} while (!kthread_should_stop());

	if (dma_addr)
		dma_unmap_page(&fake, dma_addr, len, dir);
	if (page)
		__free_pages(page, get_order(len));
   	put_device(&fake);
 	device_unregister(&fake);
out:
	return 0;
}
static struct task_struct *t[2];
static struct args a[2];

static int __init dma_test_init(void)
{
	int ret;

	/* No point doing this without SWIOTLB */
	if (!swiotlb_nr_tbl())
		return -ENODEV;

	ret = bus_register(&fallback_bus_type);
	if (ret)
		return ret;

	a[0].dir = DMA_TO_DEVICE;
	a[0].len = 32768;
	t[0] = kthread_run(dma_test_thread, &a[0], "dma_test_dev");

	a[1].len = 16384;
	a[1].dir = DMA_FROM_DEVICE;
	t[1] = kthread_run(dma_test_thread, &a[1], "dma_test_cpu");
	return 0;
}
static void __exit dma_test_exit(void)
{
	if (t[0])
		kthread_stop(t[0]);
	if (t[1])
		kthread_stop(t[1]);

 	bus_unregister(&fallback_bus_type);
}
module_init(dma_test_init);
module_exit(dma_test_exit);

--5mCyUwZo2JvN/JJP
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.xen.org
http://lists.xen.org/xen-devel

--5mCyUwZo2JvN/JJP--


From xen-devel-bounces@lists.xen.org Fri Nov 09 13:56:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 13:56:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWp4T-0005av-TG; Fri, 09 Nov 2012 13:56:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jajcus@jajcus.net>) id 1TWp4S-0005am-4U
	for xen-devel@lists.xensource.com; Fri, 09 Nov 2012 13:56:32 +0000
Received: from [85.158.139.83:48242] by server-15.bemta-5.messagelabs.com id
	36/CC-26920-F8B0D905; Fri, 09 Nov 2012 13:56:31 +0000
X-Env-Sender: jajcus@jajcus.net
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352469390!28844870!1
X-Originating-IP: [212.106.158.142]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1428 invoked from network); 9 Nov 2012 13:56:30 -0000
Received: from eggsoft.sp.imz.pl (HELO jajo.eggsoft.pl) (212.106.158.142)
	by server-9.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 9 Nov 2012 13:56:30 -0000
Received: by jajo.eggsoft.pl (Postfix, from userid 1000)
	id 55873B002; Fri,  9 Nov 2012 14:56:29 +0100 (CET)
From: Jacek Konieczny <jajcus@jajcus.net>
To: xen-devel@lists.xensource.com
Date: Fri,  9 Nov 2012 14:56:11 +0100
Message-Id: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
X-Mailer: git-send-email 1.7.12.4
Cc: Jacek Konieczny <jajcus@jajcus.net>
Subject: [Xen-devel] [PATCH] Fix locking in tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The claim_lock() function would fail in the perl code with:

  Invalid argument at -e line 2.

because the Perl snippet opens for reading the file descriptor, which
was earlier opened for write (append).

Signed-off-by: Jacek Konieczny <jajcus@jajcus.net>
---
 tools/hotplug/Linux/locking.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/hotplug/Linux/locking.sh b/tools/hotplug/Linux/locking.sh
index e34f155..122bcfb 100644
--- a/tools/hotplug/Linux/locking.sh
+++ b/tools/hotplug/Linux/locking.sh
@@ -44,7 +44,7 @@ claim_lock()
     # See below for a correctness proof.
     local rightfile
     while true; do
-        eval "exec $_lockfd>>$_lockfile"
+        eval "exec $_lockfd<>$_lockfile"
         flock -x $_lockfd || return $?
         # We can't just stat /dev/stdin or /proc/self/fd/$_lockfd or
         # use bash's test -ef because those all go through what is
-- 
1.7.12.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 13:56:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 13:56:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWp4T-0005av-TG; Fri, 09 Nov 2012 13:56:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jajcus@jajcus.net>) id 1TWp4S-0005am-4U
	for xen-devel@lists.xensource.com; Fri, 09 Nov 2012 13:56:32 +0000
Received: from [85.158.139.83:48242] by server-15.bemta-5.messagelabs.com id
	36/CC-26920-F8B0D905; Fri, 09 Nov 2012 13:56:31 +0000
X-Env-Sender: jajcus@jajcus.net
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352469390!28844870!1
X-Originating-IP: [212.106.158.142]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1428 invoked from network); 9 Nov 2012 13:56:30 -0000
Received: from eggsoft.sp.imz.pl (HELO jajo.eggsoft.pl) (212.106.158.142)
	by server-9.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 9 Nov 2012 13:56:30 -0000
Received: by jajo.eggsoft.pl (Postfix, from userid 1000)
	id 55873B002; Fri,  9 Nov 2012 14:56:29 +0100 (CET)
From: Jacek Konieczny <jajcus@jajcus.net>
To: xen-devel@lists.xensource.com
Date: Fri,  9 Nov 2012 14:56:11 +0100
Message-Id: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
X-Mailer: git-send-email 1.7.12.4
Cc: Jacek Konieczny <jajcus@jajcus.net>
Subject: [Xen-devel] [PATCH] Fix locking in tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The claim_lock() function would fail in the perl code with:

  Invalid argument at -e line 2.

because the Perl snippet opens for reading the file descriptor, which
was earlier opened for write (append).

Signed-off-by: Jacek Konieczny <jajcus@jajcus.net>
---
 tools/hotplug/Linux/locking.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/hotplug/Linux/locking.sh b/tools/hotplug/Linux/locking.sh
index e34f155..122bcfb 100644
--- a/tools/hotplug/Linux/locking.sh
+++ b/tools/hotplug/Linux/locking.sh
@@ -44,7 +44,7 @@ claim_lock()
     # See below for a correctness proof.
     local rightfile
     while true; do
-        eval "exec $_lockfd>>$_lockfile"
+        eval "exec $_lockfd<>$_lockfile"
         flock -x $_lockfd || return $?
         # We can't just stat /dev/stdin or /proc/self/fd/$_lockfd or
         # use bash's test -ef because those all go through what is
-- 
1.7.12.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 14:11:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 14:11:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWpJ5-0005zs-CX; Fri, 09 Nov 2012 14:11:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TWpJ3-0005zl-9k
	for xen-devel@lists.xensource.com; Fri, 09 Nov 2012 14:11:37 +0000
Received: from [85.158.138.51:28973] by server-5.bemta-3.messagelabs.com id
	DD/89-26311-81F0D905; Fri, 09 Nov 2012 14:11:36 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1352470293!9667191!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1MjgxMA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7372 invoked from network); 9 Nov 2012 14:11:35 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-13.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 9 Nov 2012 14:11:35 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA9EBV2Z009451
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 9 Nov 2012 14:11:32 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA9EBUU5017075
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 9 Nov 2012 14:11:31 GMT
Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA9EBUph001995; Fri, 9 Nov 2012 08:11:30 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 09 Nov 2012 06:11:30 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id C4D054037A; Fri,  9 Nov 2012 09:11:27 -0500 (EST)
Date: Fri, 9 Nov 2012 09:11:27 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com
Message-ID: <20121109141127.GA16019@phenom.dumpdata.com>
MIME-Version: 1.0
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Subject: [Xen-devel] [GIT PULL] (xen) stable/for-linus-3.7-rc5-tag
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0202461555952865438=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--===============0202461555952865438==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="X1bOJ3K7DJ5YkBrT"
Content-Disposition: inline


--X1bOJ3K7DJ5YkBrT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hey Linus,

Please git pull the following tag:

 git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-linus-3.7-rc5-tag

which has bug-fixes. There are three ARM compile fixes (we forgot to export
certain functions and if the drivers are built as an module - we go belly-up).
There is also an mismatch of irq_enter() / exit_idle() calls sequence - which were
fixed some time ago in other piece of codes, but failed to appear in the Xen code.
Lastly a fix for to help in the field with troubleshooting in case we cannot get
the appropriate parameter and also fallback code when working with very old hypervisors.

Please pull!

 arch/arm/xen/enlighten.c             |   11 +++++
 arch/x86/include/asm/xen/hypercall.h |   21 +++------
 drivers/xen/Makefile                 |    1 +
 drivers/xen/events.c                 |    2 +-
 drivers/xen/fallback.c               |   80 ++++++++++++++++++++++++++++++++++
 include/xen/hvm.h                    |   34 +++++++++++++-
 6 files changed, 132 insertions(+), 17 deletions(-)

Jan Beulich (1):
      xen/hypercall: fix hypercall fallback code for very old hypervisors

Konrad Rzeszutek Wilk (3):
      xen/hvm: If we fail to fetch an HVM parameter print out which flag it is.
      xen/generic: Disable fallback build on ARM.
      xen/arm: Fix compile errors when drivers are compiled as modules.

Mojiong Qiu (1):
      xen/events: fix RCU warning, or Call idle notifier after irq_enter()

Stefano Stabellini (1):
      xen/arm: Fix compile errors when drivers are compiled as modules (export more).


--X1bOJ3K7DJ5YkBrT
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQEcBAEBAgAGBQJQnQ8LAAoJEFjIrFwIi8fJz3oH/1Ij7c2u0KlRYRvgipf6Gmv4
emorzbz+I1CRQHEE9idaHCEI1tH/7Eb46L0Cq/P8sXZOaS2MhLbh1LRbnprExw7q
6ur2Cms0acmxtnIvrz+l3ntAgfxO+D/a6lhd0rlNVGfa05BvP41xWdntrUdLgCI9
4aDB0ZtSU70bbgSyRnLRENtqisD9tulg+q+XseSEYnbOnik3z9jJaFWtOibRwFZN
udeFqbvji65KkpvvrjhvSx5MlMXx7oZRNdRmt9HP3wtTfSEhAxuXY/9nVv8NR6Xd
J5lWACZC14pLFiL0HILbQmy3HHRaQQnjeOoRdvvuJubQSk2p9R0IUdKm5rXBkdA=
=EBAd
-----END PGP SIGNATURE-----

--X1bOJ3K7DJ5YkBrT--


--===============0202461555952865438==
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.xen.org
http://lists.xen.org/xen-devel

--===============0202461555952865438==--


From xen-devel-bounces@lists.xen.org Fri Nov 09 14:11:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 14:11:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWpJ5-0005zs-CX; Fri, 09 Nov 2012 14:11:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TWpJ3-0005zl-9k
	for xen-devel@lists.xensource.com; Fri, 09 Nov 2012 14:11:37 +0000
Received: from [85.158.138.51:28973] by server-5.bemta-3.messagelabs.com id
	DD/89-26311-81F0D905; Fri, 09 Nov 2012 14:11:36 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1352470293!9667191!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1MjgxMA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7372 invoked from network); 9 Nov 2012 14:11:35 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-13.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 9 Nov 2012 14:11:35 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA9EBV2Z009451
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 9 Nov 2012 14:11:32 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA9EBUU5017075
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 9 Nov 2012 14:11:31 GMT
Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA9EBUph001995; Fri, 9 Nov 2012 08:11:30 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 09 Nov 2012 06:11:30 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id C4D054037A; Fri,  9 Nov 2012 09:11:27 -0500 (EST)
Date: Fri, 9 Nov 2012 09:11:27 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com
Message-ID: <20121109141127.GA16019@phenom.dumpdata.com>
MIME-Version: 1.0
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Subject: [Xen-devel] [GIT PULL] (xen) stable/for-linus-3.7-rc5-tag
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0202461555952865438=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--===============0202461555952865438==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="X1bOJ3K7DJ5YkBrT"
Content-Disposition: inline


--X1bOJ3K7DJ5YkBrT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hey Linus,

Please git pull the following tag:

 git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-linus-3.7-rc5-tag

which has bug-fixes. There are three ARM compile fixes (we forgot to export
certain functions and if the drivers are built as an module - we go belly-up).
There is also an mismatch of irq_enter() / exit_idle() calls sequence - which were
fixed some time ago in other piece of codes, but failed to appear in the Xen code.
Lastly a fix for to help in the field with troubleshooting in case we cannot get
the appropriate parameter and also fallback code when working with very old hypervisors.

Please pull!

 arch/arm/xen/enlighten.c             |   11 +++++
 arch/x86/include/asm/xen/hypercall.h |   21 +++------
 drivers/xen/Makefile                 |    1 +
 drivers/xen/events.c                 |    2 +-
 drivers/xen/fallback.c               |   80 ++++++++++++++++++++++++++++++++++
 include/xen/hvm.h                    |   34 +++++++++++++-
 6 files changed, 132 insertions(+), 17 deletions(-)

Jan Beulich (1):
      xen/hypercall: fix hypercall fallback code for very old hypervisors

Konrad Rzeszutek Wilk (3):
      xen/hvm: If we fail to fetch an HVM parameter print out which flag it is.
      xen/generic: Disable fallback build on ARM.
      xen/arm: Fix compile errors when drivers are compiled as modules.

Mojiong Qiu (1):
      xen/events: fix RCU warning, or Call idle notifier after irq_enter()

Stefano Stabellini (1):
      xen/arm: Fix compile errors when drivers are compiled as modules (export more).


--X1bOJ3K7DJ5YkBrT
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQEcBAEBAgAGBQJQnQ8LAAoJEFjIrFwIi8fJz3oH/1Ij7c2u0KlRYRvgipf6Gmv4
emorzbz+I1CRQHEE9idaHCEI1tH/7Eb46L0Cq/P8sXZOaS2MhLbh1LRbnprExw7q
6ur2Cms0acmxtnIvrz+l3ntAgfxO+D/a6lhd0rlNVGfa05BvP41xWdntrUdLgCI9
4aDB0ZtSU70bbgSyRnLRENtqisD9tulg+q+XseSEYnbOnik3z9jJaFWtOibRwFZN
udeFqbvji65KkpvvrjhvSx5MlMXx7oZRNdRmt9HP3wtTfSEhAxuXY/9nVv8NR6Xd
J5lWACZC14pLFiL0HILbQmy3HHRaQQnjeOoRdvvuJubQSk2p9R0IUdKm5rXBkdA=
=EBAd
-----END PGP SIGNATURE-----

--X1bOJ3K7DJ5YkBrT--


--===============0202461555952865438==
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.xen.org
http://lists.xen.org/xen-devel

--===============0202461555952865438==--


From xen-devel-bounces@lists.xen.org Fri Nov 09 14:56:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 14:56:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWpzp-0006HR-52; Fri, 09 Nov 2012 14:55:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TWpzn-0006HM-JL
	for xen-devel@lists.xensource.com; Fri, 09 Nov 2012 14:55:47 +0000
Received: from [85.158.137.99:54542] by server-12.bemta-3.messagelabs.com id
	C8/84-22757-F691D905; Fri, 09 Nov 2012 14:55:43 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1352472941!13653499!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1MjgxMA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18631 invoked from network); 9 Nov 2012 14:55:42 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 9 Nov 2012 14:55:42 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA9EtXKb027141
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 9 Nov 2012 14:55:33 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA9EtWET005925
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 9 Nov 2012 14:55:32 GMT
Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA9EtWWr029721; Fri, 9 Nov 2012 08:55:32 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 09 Nov 2012 06:55:31 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id A74294037B; Fri,  9 Nov 2012 09:55:29 -0500 (EST)
Date: Fri, 9 Nov 2012 09:55:29 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: axboe@kernel.dk, linux-kernel@vger.kernel.org,
	xen-devel@lists.xensource.com
Message-ID: <20121109145529.GB23023@phenom.dumpdata.com>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Subject: [Xen-devel] [GIT PULL] (xen) stable/for-jens-3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hey Jens,

Please git pull the following branch:

 git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-jens-3.8

which has a new feature of the blk[back|front] driver - it is called 'feature-persistent'.
Roger and Oliver patch says:
"  This patch implements persistent grants for the xen-blk{front,back}
    mechanism. The effect of this change is to reduce the number of unmap
    operations performed, since they cause a (costly) TLB shootdown. This
    allows the I/O performance to scale better when a large number of VMs
    are performing I/O.
    
    Previously, the blkfront driver was supplied a bvec[] from the request
    queue. This was granted to dom0; dom0 performed the I/O and wrote
    directly into the grant-mapped memory and unmapped it; blkfront then
    removed foreign access for that grant. The cost of unmapping scales
    badly with the number of CPUs in Dom0. An experiment showed that when
    Dom0 has 24 VCPUs, and guests are performing parallel I/O to a
    ramdisk, the IPIs from performing unmap's is a bottleneck at 5 guests
    (at which point 650,000 IOPS are being performed in total). If more
    than 5 guests are used, the performance declines. By 10 guests, only
    400,000 IOPS are being performed.
    
    This patch improves performance by only unmapping when the connection
    between blkfront and back is broken.
"

Note: You might get a conflict in the common.h file. It should
be fairly easy to fix it - it should end up looking as this:

160         /* Cached size parameter. */
161         sector_t                size;
162         unsigned int            flush_support:1;
163         unsigned int            discard_secure:1;
164         unsigned int            feature_gnt_persistent:1;
165         unsigned int            overflow_max_grants:1;
166 };

Thanks!

 drivers/block/xen-blkback/blkback.c |  295 ++++++++++++++++++++++++++++++++---
 drivers/block/xen-blkback/common.h  |   17 ++
 drivers/block/xen-blkback/xenbus.c  |   23 +++-
 drivers/block/xen-blkfront.c        |  198 ++++++++++++++++++++----
 4 files changed, 478 insertions(+), 55 deletions(-)

Roger Pau Monne (2):
      xen/blkback: Persistent grant maps for xen blk drivers
      xen/blkback: persistent-grants fixes


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 14:56:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 14:56:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWpzp-0006HR-52; Fri, 09 Nov 2012 14:55:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TWpzn-0006HM-JL
	for xen-devel@lists.xensource.com; Fri, 09 Nov 2012 14:55:47 +0000
Received: from [85.158.137.99:54542] by server-12.bemta-3.messagelabs.com id
	C8/84-22757-F691D905; Fri, 09 Nov 2012 14:55:43 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1352472941!13653499!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1MjgxMA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18631 invoked from network); 9 Nov 2012 14:55:42 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 9 Nov 2012 14:55:42 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qA9EtXKb027141
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 9 Nov 2012 14:55:33 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qA9EtWET005925
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 9 Nov 2012 14:55:32 GMT
Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qA9EtWWr029721; Fri, 9 Nov 2012 08:55:32 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 09 Nov 2012 06:55:31 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id A74294037B; Fri,  9 Nov 2012 09:55:29 -0500 (EST)
Date: Fri, 9 Nov 2012 09:55:29 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: axboe@kernel.dk, linux-kernel@vger.kernel.org,
	xen-devel@lists.xensource.com
Message-ID: <20121109145529.GB23023@phenom.dumpdata.com>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Subject: [Xen-devel] [GIT PULL] (xen) stable/for-jens-3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hey Jens,

Please git pull the following branch:

 git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-jens-3.8

which has a new feature of the blk[back|front] driver - it is called 'feature-persistent'.
Roger and Oliver patch says:
"  This patch implements persistent grants for the xen-blk{front,back}
    mechanism. The effect of this change is to reduce the number of unmap
    operations performed, since they cause a (costly) TLB shootdown. This
    allows the I/O performance to scale better when a large number of VMs
    are performing I/O.
    
    Previously, the blkfront driver was supplied a bvec[] from the request
    queue. This was granted to dom0; dom0 performed the I/O and wrote
    directly into the grant-mapped memory and unmapped it; blkfront then
    removed foreign access for that grant. The cost of unmapping scales
    badly with the number of CPUs in Dom0. An experiment showed that when
    Dom0 has 24 VCPUs, and guests are performing parallel I/O to a
    ramdisk, the IPIs from performing unmap's is a bottleneck at 5 guests
    (at which point 650,000 IOPS are being performed in total). If more
    than 5 guests are used, the performance declines. By 10 guests, only
    400,000 IOPS are being performed.
    
    This patch improves performance by only unmapping when the connection
    between blkfront and back is broken.
"

Note: You might get a conflict in the common.h file. It should
be fairly easy to fix it - it should end up looking as this:

160         /* Cached size parameter. */
161         sector_t                size;
162         unsigned int            flush_support:1;
163         unsigned int            discard_secure:1;
164         unsigned int            feature_gnt_persistent:1;
165         unsigned int            overflow_max_grants:1;
166 };

Thanks!

 drivers/block/xen-blkback/blkback.c |  295 ++++++++++++++++++++++++++++++++---
 drivers/block/xen-blkback/common.h  |   17 ++
 drivers/block/xen-blkback/xenbus.c  |   23 +++-
 drivers/block/xen-blkfront.c        |  198 ++++++++++++++++++++----
 4 files changed, 478 insertions(+), 55 deletions(-)

Roger Pau Monne (2):
      xen/blkback: Persistent grant maps for xen blk drivers
      xen/blkback: persistent-grants fixes


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 15:07:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 15:07:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWqAt-0006Us-HL; Fri, 09 Nov 2012 15:07:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TWqAr-0006Un-Ca
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 15:07:13 +0000
Received: from [193.109.254.147:41881] by server-3.bemta-14.messagelabs.com id
	C7/17-01317-02C1D905; Fri, 09 Nov 2012 15:07:12 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1352473632!10359996!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwNzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31566 invoked from network); 9 Nov 2012 15:07:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 15:07:12 -0000
X-IronPort-AV: E=Sophos;i="4.80,746,1344211200"; d="scan'208";a="15700158"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	09 Nov 2012 15:07:12 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Fri, 9 Nov 2012
	15:07:11 +0000
Message-ID: <1352473630.27833.74.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Date: Fri, 9 Nov 2012 15:07:10 +0000
In-Reply-To: <1351508996-54975-1-git-send-email-roger.pau@citrix.com>
References: <1351508996-54975-1-git-send-email-roger.pau@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] docs: document persistent grants
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-10-29 at 11:09 +0000, Roger Pau Monne wrote:
> + *      A value of "1" indicates that the backend can keep the grants used
> + *      by the frontend driver mapped, so the same set of grants should be
> + *      used in all transactions. The maximum number of grants the backend
> + *      can map persistently depends on the implementation, but ideally it
> + *      should be RING_SIZE * BLKIF_MAX_SEGMENTS_PER_REQUEST. Using this
> + *      feature the backend doesn't need to unmap each grant, preventing
> + *      costly TLB flushes.
> 
> @@ -279,6 +301,13 @@
>   *     'ring-ref' is used to communicate the grant reference for this
>   *     page to the backend.  When using a multi-page ring, the 'ring-ref'
>   *     node is not created.  Instead 'ring-ref0' - 'ring-refN' are used.
> + * (7) When using persistent grants data has to be copied from/to the page
> + *     where the grant is currently mapped. The overhead of doing this copy
> + *     however doesn't suppress the speed improvement of not having to unmap
> + *     the grants.
> + * (8) The frontend driver has to allow the backend driver to map all grants
> + *     with write access, even when they should be mapped read-only, since
> + *     further requests may reuse this grants and require write permisions.

                                                                  permissions

It not clear if it is required to always reuse a grant or if the
frontend can use a normal grant if it has run out of persistent slots.
It's also not all that clear how a grant becomes persistent and who
(front or back) gets to make that determination.

AIUI the backend makes the decision whether to keep a grant mapped
persistently or not while the frontend is expect to try and reuse grants
as much as possible when persistent mode is enabled, is that right?

Is there any provision for shrinking the size of the cached pool of
mappings when usage is low? I suppose that's a backend implementation
detail?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 15:07:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 15:07:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWqAt-0006Us-HL; Fri, 09 Nov 2012 15:07:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TWqAr-0006Un-Ca
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 15:07:13 +0000
Received: from [193.109.254.147:41881] by server-3.bemta-14.messagelabs.com id
	C7/17-01317-02C1D905; Fri, 09 Nov 2012 15:07:12 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1352473632!10359996!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwNzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31566 invoked from network); 9 Nov 2012 15:07:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 15:07:12 -0000
X-IronPort-AV: E=Sophos;i="4.80,746,1344211200"; d="scan'208";a="15700158"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	09 Nov 2012 15:07:12 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Fri, 9 Nov 2012
	15:07:11 +0000
Message-ID: <1352473630.27833.74.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Date: Fri, 9 Nov 2012 15:07:10 +0000
In-Reply-To: <1351508996-54975-1-git-send-email-roger.pau@citrix.com>
References: <1351508996-54975-1-git-send-email-roger.pau@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] docs: document persistent grants
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-10-29 at 11:09 +0000, Roger Pau Monne wrote:
> + *      A value of "1" indicates that the backend can keep the grants used
> + *      by the frontend driver mapped, so the same set of grants should be
> + *      used in all transactions. The maximum number of grants the backend
> + *      can map persistently depends on the implementation, but ideally it
> + *      should be RING_SIZE * BLKIF_MAX_SEGMENTS_PER_REQUEST. Using this
> + *      feature the backend doesn't need to unmap each grant, preventing
> + *      costly TLB flushes.
> 
> @@ -279,6 +301,13 @@
>   *     'ring-ref' is used to communicate the grant reference for this
>   *     page to the backend.  When using a multi-page ring, the 'ring-ref'
>   *     node is not created.  Instead 'ring-ref0' - 'ring-refN' are used.
> + * (7) When using persistent grants data has to be copied from/to the page
> + *     where the grant is currently mapped. The overhead of doing this copy
> + *     however doesn't suppress the speed improvement of not having to unmap
> + *     the grants.
> + * (8) The frontend driver has to allow the backend driver to map all grants
> + *     with write access, even when they should be mapped read-only, since
> + *     further requests may reuse this grants and require write permisions.

                                                                  permissions

It not clear if it is required to always reuse a grant or if the
frontend can use a normal grant if it has run out of persistent slots.
It's also not all that clear how a grant becomes persistent and who
(front or back) gets to make that determination.

AIUI the backend makes the decision whether to keep a grant mapped
persistently or not while the frontend is expect to try and reuse grants
as much as possible when persistent mode is enabled, is that right?

Is there any provision for shrinking the size of the cached pool of
mappings when usage is low? I suppose that's a backend implementation
detail?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 15:36:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 15:36:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWqcu-00071o-O6; Fri, 09 Nov 2012 15:36:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TWqct-00071j-Fg
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 15:36:11 +0000
Received: from [85.158.137.99:59305] by server-13.bemta-3.messagelabs.com id
	87/76-24887-AE22D905; Fri, 09 Nov 2012 15:36:10 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1352475369!13335233!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwNzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18697 invoked from network); 9 Nov 2012 15:36:10 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 15:36:10 -0000
X-IronPort-AV: E=Sophos;i="4.80,746,1344211200"; d="scan'208";a="15701016"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	09 Nov 2012 15:36:05 +0000
Received: from Roger-2.local (10.31.3.234) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Fri, 9 Nov 2012
	15:36:04 +0000
Message-ID: <509D22E6.2090005@citrix.com>
Date: Fri, 9 Nov 2012 16:36:06 +0100
From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <ian.campbell@citrix.com>
References: <CAF6-1L51R5yMBNO1wQe7YWoeGoM_bFJcAb0XN0cVg6cm7+Kzaw@mail.gmail.com>
	<1352363172.12977.87.camel@hastur.hellion.org.uk>
In-Reply-To: <1352363172.12977.87.camel@hastur.hellion.org.uk>
Cc: Sylvain Munaut <s.munaut@whatever-company.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Custom block script started twice for root block
 but only stopped once
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/12 09:26, Ian Campbell wrote:
> On Fri, 2012-11-02 at 10:37 +0000, Sylvain Munaut wrote:
>> Hi,
>>
>> I'm using a custom block script in my xen setup and when started, it
>> creates a new device node pointing to some network resources.
>>
>> Now I noticed that the script is called twice for the root block, the
>> first time for pygrub most likely, but is only stopped once ... I
>> don't mind creating two devices node, but then I need to destroy both
>> ...
>>
>> Is this a known issue ?
> 
> Not one I've heard. Running "xl -vvv create" might provide some logs
> which give an idea what is going on, likewise the logging
> in /var/log/xen/...
> 
> Roger -- any ideas?

Yes, I've been able to reproduce the error when using stubdoms, I'm
currently working on a fix. Have you seen this when using stubdomains
Sylvain?

Also I've realized that when using stubdomains with disks that use file
based backends ("file:/") it doesn't work, is this already known, or a
regression?

Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 15:36:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 15:36:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWqcu-00071o-O6; Fri, 09 Nov 2012 15:36:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TWqct-00071j-Fg
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 15:36:11 +0000
Received: from [85.158.137.99:59305] by server-13.bemta-3.messagelabs.com id
	87/76-24887-AE22D905; Fri, 09 Nov 2012 15:36:10 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1352475369!13335233!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwNzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18697 invoked from network); 9 Nov 2012 15:36:10 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 15:36:10 -0000
X-IronPort-AV: E=Sophos;i="4.80,746,1344211200"; d="scan'208";a="15701016"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	09 Nov 2012 15:36:05 +0000
Received: from Roger-2.local (10.31.3.234) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Fri, 9 Nov 2012
	15:36:04 +0000
Message-ID: <509D22E6.2090005@citrix.com>
Date: Fri, 9 Nov 2012 16:36:06 +0100
From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <ian.campbell@citrix.com>
References: <CAF6-1L51R5yMBNO1wQe7YWoeGoM_bFJcAb0XN0cVg6cm7+Kzaw@mail.gmail.com>
	<1352363172.12977.87.camel@hastur.hellion.org.uk>
In-Reply-To: <1352363172.12977.87.camel@hastur.hellion.org.uk>
Cc: Sylvain Munaut <s.munaut@whatever-company.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Custom block script started twice for root block
 but only stopped once
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 08/11/12 09:26, Ian Campbell wrote:
> On Fri, 2012-11-02 at 10:37 +0000, Sylvain Munaut wrote:
>> Hi,
>>
>> I'm using a custom block script in my xen setup and when started, it
>> creates a new device node pointing to some network resources.
>>
>> Now I noticed that the script is called twice for the root block, the
>> first time for pygrub most likely, but is only stopped once ... I
>> don't mind creating two devices node, but then I need to destroy both
>> ...
>>
>> Is this a known issue ?
> 
> Not one I've heard. Running "xl -vvv create" might provide some logs
> which give an idea what is going on, likewise the logging
> in /var/log/xen/...
> 
> Roger -- any ideas?

Yes, I've been able to reproduce the error when using stubdoms, I'm
currently working on a fix. Have you seen this when using stubdomains
Sylvain?

Also I've realized that when using stubdomains with disks that use file
based backends ("file:/") it doesn't work, is this already known, or a
regression?

Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 15:47:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 15:47:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWqnJ-0007CY-Ss; Fri, 09 Nov 2012 15:46:57 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TWqnH-0007CT-SB
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 15:46:55 +0000
Received: from [85.158.139.211:40075] by server-15.bemta-5.messagelabs.com id
	D9/11-26920-E652D905; Fri, 09 Nov 2012 15:46:54 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1352476014!19517754!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwNzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3686 invoked from network); 9 Nov 2012 15:46:54 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 15:46:54 -0000
X-IronPort-AV: E=Sophos;i="4.80,746,1344211200"; d="scan'208";a="15701272"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	09 Nov 2012 15:46:53 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Fri, 9 Nov 2012
	15:46:53 +0000
Message-ID: <1352476012.27833.96.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Date: Fri, 9 Nov 2012 15:46:52 +0000
In-Reply-To: <509D22E6.2090005@citrix.com>
References: <CAF6-1L51R5yMBNO1wQe7YWoeGoM_bFJcAb0XN0cVg6cm7+Kzaw@mail.gmail.com>
	<1352363172.12977.87.camel@hastur.hellion.org.uk>
	<509D22E6.2090005@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Sylvain Munaut <s.munaut@whatever-company.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Custom block script started twice for root block
 but only stopped once
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-09 at 15:36 +0000, Roger Pau Monne wrote:
> Also I've realized that when using stubdomains with disks that use
> file based backends ("file:/") it doesn't work, is this already known,
> or a regression? 

It's news to me... I don't know if it is a regression, but it seems like
it ought to work.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 15:47:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 15:47:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWqnJ-0007CY-Ss; Fri, 09 Nov 2012 15:46:57 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TWqnH-0007CT-SB
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 15:46:55 +0000
Received: from [85.158.139.211:40075] by server-15.bemta-5.messagelabs.com id
	D9/11-26920-E652D905; Fri, 09 Nov 2012 15:46:54 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1352476014!19517754!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwNzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3686 invoked from network); 9 Nov 2012 15:46:54 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 15:46:54 -0000
X-IronPort-AV: E=Sophos;i="4.80,746,1344211200"; d="scan'208";a="15701272"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	09 Nov 2012 15:46:53 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Fri, 9 Nov 2012
	15:46:53 +0000
Message-ID: <1352476012.27833.96.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Date: Fri, 9 Nov 2012 15:46:52 +0000
In-Reply-To: <509D22E6.2090005@citrix.com>
References: <CAF6-1L51R5yMBNO1wQe7YWoeGoM_bFJcAb0XN0cVg6cm7+Kzaw@mail.gmail.com>
	<1352363172.12977.87.camel@hastur.hellion.org.uk>
	<509D22E6.2090005@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Sylvain Munaut <s.munaut@whatever-company.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Custom block script started twice for root block
 but only stopped once
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-09 at 15:36 +0000, Roger Pau Monne wrote:
> Also I've realized that when using stubdomains with disks that use
> file based backends ("file:/") it doesn't work, is this already known,
> or a regression? 

It's news to me... I don't know if it is a regression, but it seems like
it ought to work.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 16:13:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 16:13:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWrCF-00087y-O3; Fri, 09 Nov 2012 16:12:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TWrCD-00087q-Rp; Fri, 09 Nov 2012 16:12:42 +0000
Received: from [85.158.137.99:22188] by server-4.bemta-3.messagelabs.com id
	08/83-30023-77B2D905; Fri, 09 Nov 2012 16:12:39 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1352477558!15309833!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwNzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25607 invoked from network); 9 Nov 2012 16:12:38 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 16:12:38 -0000
X-IronPort-AV: E=Sophos;i="4.80,746,1344211200"; d="scan'208";a="15702160"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	09 Nov 2012 16:12:33 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Fri, 9 Nov 2012
	16:12:32 +0000
Message-ID: <1352477552.27833.113.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: D K <daniel-knobe@web.de>
Date: Fri, 9 Nov 2012 16:12:32 +0000
In-Reply-To: <trinity-e31715ea-0225-4885-96ab-be80fbc9ff8a-1351859535290@3capp-webde-bs02>
References: <trinity-e31715ea-0225-4885-96ab-be80fbc9ff8a-1351859535290@3capp-webde-bs02>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-users@lists.xen.org" <xen-users@lists.xen.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [Xen-users] Remus: Xen 4.2.1 with Debian 6.0 does
	not work
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Adding xen-devel since this is an xl segfault.

Please can you not send html mail. Plain text is just fine.

On Fri, 2012-11-02 at 12:32 +0000, D K wrote:

> Xen: Version 4.2.-testing from mercurial

Which version exactly ? There was a batch of backports recently which
included some fixes to the ao infrastructure, including a fix for
aoinprogress (which appears in your stack trace).

So please can you try the most recent tip of 4.2-testing.

> 
> 
> Guest:
> 
> Config: http://pgb.game-host.org/xen/debian.cfg
> 
> 
> Erroranalysis:

> 
> 




>      1. Getting the vm started on PC1 with the following command works
>         fine:
>         
>         xl create debian.cfg
>         
>      2. Remus does not:
>         
>         
>         xl remus <domid> 129.217.43.51

Does normal migration work?

>         
> Segmentation fault
> 
> xc: error: read_exact_timed failed (select returned 0): Internal error 
> xc: error: Error reading QEMU signature (110 = Connection timed out): Internal error 
> xc: error: error buffering image tail, finishing: Internal error 
> 
> migration target: Remus Failover for domain 3 

It seems like there might be more than one issue here, the original
failure and then a failure in the error path too.

[...snip, I don't thin k w needed the whole story, just the resulting
stacktrace...]

Is this backtrace from the sending or the receiving xl?

> #0 0xb7e4bfea in malloc_consolidate (av=<value optimized out>) at malloc.c:5145 
> #1 0xb7e4e21d in _int_malloc (av=<value optimized out>, bytes=<value optimized out>) at malloc.c:4373 
> #2 0xb7e506f3 in *__GI___libc_malloc (bytes=1012) at malloc.c:3661 
> #3 0xb7f9e011 in datacopier_readable (egc=0xbffff2bc, ev=0x806a92c, fd=21, events=1, revents=1) at libxl_aoutils.c:144 
> #4 0xb7fa3072 in afterpoll_internal (egc=0xbffff2bc, poller=<value optimized out>, nfds=6, fds=0x806bb10, now=...) 
> at libxl_event.c:948 
> #5 0xb7fa3e1b in eventloop_iteration (egc=<value optimized out>, poller=0x806a688) at libxl_event.c:1368 
> #6 0xb7fa448f in libxl__ao_inprogress (ao=0x806a768, file=0xb7fb09cc "libxl.c", line=728, func=0xb7fb2c4f "libxl_domain_remus_start") at libxl_event.c:1614 
> #7 0xb7f842bf in libxl_domain_remus_start (ctx=0x806a030, info=0xbffff3c4, domid=2, send_fd=10, recv_fd=11, ao_how=0x0) at libxl.c:728 
> #8 0x0805045e in main_remus (argc=3, argv=0xbffff4f8) at xl_cmdimpl.c:6776 
> #9 0x0804d2be in main (argc=4, argv=0xbffff4f4) at xl.c:267
> 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 16:13:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 16:13:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWrCF-00087y-O3; Fri, 09 Nov 2012 16:12:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TWrCD-00087q-Rp; Fri, 09 Nov 2012 16:12:42 +0000
Received: from [85.158.137.99:22188] by server-4.bemta-3.messagelabs.com id
	08/83-30023-77B2D905; Fri, 09 Nov 2012 16:12:39 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1352477558!15309833!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwNzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25607 invoked from network); 9 Nov 2012 16:12:38 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 16:12:38 -0000
X-IronPort-AV: E=Sophos;i="4.80,746,1344211200"; d="scan'208";a="15702160"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	09 Nov 2012 16:12:33 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Fri, 9 Nov 2012
	16:12:32 +0000
Message-ID: <1352477552.27833.113.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: D K <daniel-knobe@web.de>
Date: Fri, 9 Nov 2012 16:12:32 +0000
In-Reply-To: <trinity-e31715ea-0225-4885-96ab-be80fbc9ff8a-1351859535290@3capp-webde-bs02>
References: <trinity-e31715ea-0225-4885-96ab-be80fbc9ff8a-1351859535290@3capp-webde-bs02>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-users@lists.xen.org" <xen-users@lists.xen.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [Xen-users] Remus: Xen 4.2.1 with Debian 6.0 does
	not work
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Adding xen-devel since this is an xl segfault.

Please can you not send html mail. Plain text is just fine.

On Fri, 2012-11-02 at 12:32 +0000, D K wrote:

> Xen: Version 4.2.-testing from mercurial

Which version exactly ? There was a batch of backports recently which
included some fixes to the ao infrastructure, including a fix for
aoinprogress (which appears in your stack trace).

So please can you try the most recent tip of 4.2-testing.

> 
> 
> Guest:
> 
> Config: http://pgb.game-host.org/xen/debian.cfg
> 
> 
> Erroranalysis:

> 
> 




>      1. Getting the vm started on PC1 with the following command works
>         fine:
>         
>         xl create debian.cfg
>         
>      2. Remus does not:
>         
>         
>         xl remus <domid> 129.217.43.51

Does normal migration work?

>         
> Segmentation fault
> 
> xc: error: read_exact_timed failed (select returned 0): Internal error 
> xc: error: Error reading QEMU signature (110 = Connection timed out): Internal error 
> xc: error: error buffering image tail, finishing: Internal error 
> 
> migration target: Remus Failover for domain 3 

It seems like there might be more than one issue here, the original
failure and then a failure in the error path too.

[...snip, I don't thin k w needed the whole story, just the resulting
stacktrace...]

Is this backtrace from the sending or the receiving xl?

> #0 0xb7e4bfea in malloc_consolidate (av=<value optimized out>) at malloc.c:5145 
> #1 0xb7e4e21d in _int_malloc (av=<value optimized out>, bytes=<value optimized out>) at malloc.c:4373 
> #2 0xb7e506f3 in *__GI___libc_malloc (bytes=1012) at malloc.c:3661 
> #3 0xb7f9e011 in datacopier_readable (egc=0xbffff2bc, ev=0x806a92c, fd=21, events=1, revents=1) at libxl_aoutils.c:144 
> #4 0xb7fa3072 in afterpoll_internal (egc=0xbffff2bc, poller=<value optimized out>, nfds=6, fds=0x806bb10, now=...) 
> at libxl_event.c:948 
> #5 0xb7fa3e1b in eventloop_iteration (egc=<value optimized out>, poller=0x806a688) at libxl_event.c:1368 
> #6 0xb7fa448f in libxl__ao_inprogress (ao=0x806a768, file=0xb7fb09cc "libxl.c", line=728, func=0xb7fb2c4f "libxl_domain_remus_start") at libxl_event.c:1614 
> #7 0xb7f842bf in libxl_domain_remus_start (ctx=0x806a030, info=0xbffff3c4, domid=2, send_fd=10, recv_fd=11, ao_how=0x0) at libxl.c:728 
> #8 0x0805045e in main_remus (argc=3, argv=0xbffff4f8) at xl_cmdimpl.c:6776 
> #9 0x0804d2be in main (argc=4, argv=0xbffff4f4) at xl.c:267
> 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 16:25:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 16:25:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWrOa-00006J-L8; Fri, 09 Nov 2012 16:25:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mcbeagle@gmx.de>) id 1TWrOZ-00006D-HG
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 16:25:27 +0000
Received: from [85.158.139.83:4725] by server-12.bemta-5.messagelabs.com id
	AC/ED-02886-67E2D905; Fri, 09 Nov 2012 16:25:26 +0000
X-Env-Sender: mcbeagle@gmx.de
X-Msg-Ref: server-8.tower-182.messagelabs.com!1352478325!18296401!1
X-Originating-IP: [213.165.64.22]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTMuMTY1LjY0LjIyID0+IDIzMDQyNQ==\n,sa_preprocessor: 
	QmFkIElQOiAyMTMuMTY1LjY0LjIyID0+IDIzMDQyNQ==\n, ML_RADAR_SPEW_LINKS_14, 
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14441 invoked from network); 9 Nov 2012 16:25:25 -0000
Received: from mailout-de.gmx.net (HELO mailout-de.gmx.net) (213.165.64.22)
	by server-8.tower-182.messagelabs.com with SMTP;
	9 Nov 2012 16:25:25 -0000
Received: (qmail invoked by alias); 09 Nov 2012 16:25:25 -0000
Received: from e182033070.adsl.alicedsl.de (EHLO sheik-lin.localnet)
	[85.182.33.70]
	by mail.gmx.net (mp016) with SMTP; 09 Nov 2012 17:25:25 +0100
X-Authenticated: #432297
X-Provags-ID: V01U2FsdGVkX19kQykpmOxkQ5h+9weCLynhr/YwvrNOpQTGnXhhBz
	UBFWEc2QdfKrSm
From: Hans Mueller <mcbeagle@gmx.de>
To: xen-devel@lists.xen.org
Date: Fri, 09 Nov 2012 17:25:23 +0100
Message-ID: <1382625.svAp90pkVF@sheik-lin>
User-Agent: KMail/4.9.2 (Linux/3.6.4-gentoo-c0; KDE/4.9.3; x86_64; ; )
In-Reply-To: <CAN3GA=T8Ztupou=XU4a6MeMWJN5yJgN=0fmDUp0BvXFRPEfLYw@mail.gmail.com>
References: <CAN3GA=T8Ztupou=XU4a6MeMWJN5yJgN=0fmDUp0BvXFRPEfLYw@mail.gmail.com>
MIME-Version: 1.0
X-Y-GMX-Trusted: 0
Subject: Re: [Xen-devel] PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
	IO_PAGE_FAULT:
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thursday, 8. November 2012 20:02:51 feral wrote:
> Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable.  Tested against all three.
> 
> VGA passthrough previously working with 4.1 is no longer working with >4.2.
> 
> Setup - Working:
> Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos), libvirt-bin,
> xend
> Asus Radeon HD 7870 DirectCU.
> Works perfect.  Benches on par with bare metal.
> 
> Setup - Broken:
> Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (from GIT), xl
> toolstack.
> Asus Radeon HD 7870 DirectCU.
> Some times the guest boots correctly but display is never enabled.
>  Sometimes BSOD, doesn't seem to be any rhyme or reason?
> 
> No errors in logs.   Found the following in 'xl dmesg':
> (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 2, device id = 0x600, fault address =
> 0x1ac800000, flags = 0

I had a similar problem since hg revision 25818:50adc933faaf which changes the 
qemu tag.
It looks like the qemu commit 
3e66da7266c84638c0e22a09c9d2b07529802576 
(qemu-xen-trad: fix msi_translate with PV event delivery) 
causes this behavior.

I solved the problem for me by using 'pci_msitranslate=0' in the domU config.
In addition I had to reboot (perhaps poweroff?) the dom0 once the IO_PAGE_FAULT 
occured.

Regards
Hans


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 16:25:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 16:25:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWrOa-00006J-L8; Fri, 09 Nov 2012 16:25:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mcbeagle@gmx.de>) id 1TWrOZ-00006D-HG
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 16:25:27 +0000
Received: from [85.158.139.83:4725] by server-12.bemta-5.messagelabs.com id
	AC/ED-02886-67E2D905; Fri, 09 Nov 2012 16:25:26 +0000
X-Env-Sender: mcbeagle@gmx.de
X-Msg-Ref: server-8.tower-182.messagelabs.com!1352478325!18296401!1
X-Originating-IP: [213.165.64.22]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTMuMTY1LjY0LjIyID0+IDIzMDQyNQ==\n,sa_preprocessor: 
	QmFkIElQOiAyMTMuMTY1LjY0LjIyID0+IDIzMDQyNQ==\n, ML_RADAR_SPEW_LINKS_14, 
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14441 invoked from network); 9 Nov 2012 16:25:25 -0000
Received: from mailout-de.gmx.net (HELO mailout-de.gmx.net) (213.165.64.22)
	by server-8.tower-182.messagelabs.com with SMTP;
	9 Nov 2012 16:25:25 -0000
Received: (qmail invoked by alias); 09 Nov 2012 16:25:25 -0000
Received: from e182033070.adsl.alicedsl.de (EHLO sheik-lin.localnet)
	[85.182.33.70]
	by mail.gmx.net (mp016) with SMTP; 09 Nov 2012 17:25:25 +0100
X-Authenticated: #432297
X-Provags-ID: V01U2FsdGVkX19kQykpmOxkQ5h+9weCLynhr/YwvrNOpQTGnXhhBz
	UBFWEc2QdfKrSm
From: Hans Mueller <mcbeagle@gmx.de>
To: xen-devel@lists.xen.org
Date: Fri, 09 Nov 2012 17:25:23 +0100
Message-ID: <1382625.svAp90pkVF@sheik-lin>
User-Agent: KMail/4.9.2 (Linux/3.6.4-gentoo-c0; KDE/4.9.3; x86_64; ; )
In-Reply-To: <CAN3GA=T8Ztupou=XU4a6MeMWJN5yJgN=0fmDUp0BvXFRPEfLYw@mail.gmail.com>
References: <CAN3GA=T8Ztupou=XU4a6MeMWJN5yJgN=0fmDUp0BvXFRPEfLYw@mail.gmail.com>
MIME-Version: 1.0
X-Y-GMX-Trusted: 0
Subject: Re: [Xen-devel] PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
	IO_PAGE_FAULT:
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thursday, 8. November 2012 20:02:51 feral wrote:
> Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable.  Tested against all three.
> 
> VGA passthrough previously working with 4.1 is no longer working with >4.2.
> 
> Setup - Working:
> Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos), libvirt-bin,
> xend
> Asus Radeon HD 7870 DirectCU.
> Works perfect.  Benches on par with bare metal.
> 
> Setup - Broken:
> Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (from GIT), xl
> toolstack.
> Asus Radeon HD 7870 DirectCU.
> Some times the guest boots correctly but display is never enabled.
>  Sometimes BSOD, doesn't seem to be any rhyme or reason?
> 
> No errors in logs.   Found the following in 'xl dmesg':
> (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 2, device id = 0x600, fault address =
> 0x1ac800000, flags = 0

I had a similar problem since hg revision 25818:50adc933faaf which changes the 
qemu tag.
It looks like the qemu commit 
3e66da7266c84638c0e22a09c9d2b07529802576 
(qemu-xen-trad: fix msi_translate with PV event delivery) 
causes this behavior.

I solved the problem for me by using 'pci_msitranslate=0' in the domU config.
In addition I had to reboot (perhaps poweroff?) the dom0 once the IO_PAGE_FAULT 
occured.

Regards
Hans


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 16:34:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 16:34:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWrWi-0000Jz-P4; Fri, 09 Nov 2012 16:33:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TWrWg-0000Ju-Q1
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 16:33:50 +0000
Received: from [85.158.143.35:29064] by server-3.bemta-4.messagelabs.com id
	82/A0-06841-E603D905; Fri, 09 Nov 2012 16:33:50 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352478829!12971136!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwNzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11211 invoked from network); 9 Nov 2012 16:33:49 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 16:33:49 -0000
X-IronPort-AV: E=Sophos;i="4.80,746,1344211200"; d="scan'208";a="15703064"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	09 Nov 2012 16:33:49 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Fri, 9 Nov 2012
	16:33:48 +0000
Message-ID: <1352478827.27833.127.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Hans Mueller <mcbeagle@gmx.de>
Date: Fri, 9 Nov 2012 16:33:47 +0000
In-Reply-To: <1382625.svAp90pkVF@sheik-lin>
References: <CAN3GA=T8Ztupou=XU4a6MeMWJN5yJgN=0fmDUp0BvXFRPEfLYw@mail.gmail.com>
	<1382625.svAp90pkVF@sheik-lin>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Stefano Stabellini <stefano.stabellini@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
 IO_PAGE_FAULT:
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-09 at 16:25 +0000, Hans Mueller wrote:
> On Thursday, 8. November 2012 20:02:51 feral wrote:
> > Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable.  Tested against all three.
> > 
> > VGA passthrough previously working with 4.1 is no longer working with >4.2.
> > 
> > Setup - Working:
> > Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos), libvirt-bin,
> > xend
> > Asus Radeon HD 7870 DirectCU.
> > Works perfect.  Benches on par with bare metal.
> > 
> > Setup - Broken:
> > Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (from GIT), xl
> > toolstack.
> > Asus Radeon HD 7870 DirectCU.
> > Some times the guest boots correctly but display is never enabled.
> >  Sometimes BSOD, doesn't seem to be any rhyme or reason?
> > 
> > No errors in logs.   Found the following in 'xl dmesg':
> > (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 2, device id = 0x600, fault address =
> > 0x1ac800000, flags = 0
> 
> I had a similar problem since hg revision 25818:50adc933faaf which changes the 
> qemu tag.
> It looks like the qemu commit 
> 3e66da7266c84638c0e22a09c9d2b07529802576 
> (qemu-xen-trad: fix msi_translate with PV event delivery) 
> causes this behavior.
> 
> I solved the problem for me by using 'pci_msitranslate=0' in the domU config.

I don't follow this stuff closely but I could have sworn we had disabled
msitranslate by default.

In any case I don't think that changeset was intended to cause anything
like this -- Stefano?

> In addition I had to reboot (perhaps poweroff?) the dom0 once the IO_PAGE_FAULT 
> occured.
> 
> Regards
> Hans
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 16:34:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 16:34:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWrWi-0000Jz-P4; Fri, 09 Nov 2012 16:33:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TWrWg-0000Ju-Q1
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 16:33:50 +0000
Received: from [85.158.143.35:29064] by server-3.bemta-4.messagelabs.com id
	82/A0-06841-E603D905; Fri, 09 Nov 2012 16:33:50 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352478829!12971136!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwNzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11211 invoked from network); 9 Nov 2012 16:33:49 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 16:33:49 -0000
X-IronPort-AV: E=Sophos;i="4.80,746,1344211200"; d="scan'208";a="15703064"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	09 Nov 2012 16:33:49 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Fri, 9 Nov 2012
	16:33:48 +0000
Message-ID: <1352478827.27833.127.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Hans Mueller <mcbeagle@gmx.de>
Date: Fri, 9 Nov 2012 16:33:47 +0000
In-Reply-To: <1382625.svAp90pkVF@sheik-lin>
References: <CAN3GA=T8Ztupou=XU4a6MeMWJN5yJgN=0fmDUp0BvXFRPEfLYw@mail.gmail.com>
	<1382625.svAp90pkVF@sheik-lin>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Stefano Stabellini <stefano.stabellini@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
 IO_PAGE_FAULT:
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-09 at 16:25 +0000, Hans Mueller wrote:
> On Thursday, 8. November 2012 20:02:51 feral wrote:
> > Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable.  Tested against all three.
> > 
> > VGA passthrough previously working with 4.1 is no longer working with >4.2.
> > 
> > Setup - Working:
> > Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos), libvirt-bin,
> > xend
> > Asus Radeon HD 7870 DirectCU.
> > Works perfect.  Benches on par with bare metal.
> > 
> > Setup - Broken:
> > Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (from GIT), xl
> > toolstack.
> > Asus Radeon HD 7870 DirectCU.
> > Some times the guest boots correctly but display is never enabled.
> >  Sometimes BSOD, doesn't seem to be any rhyme or reason?
> > 
> > No errors in logs.   Found the following in 'xl dmesg':
> > (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 2, device id = 0x600, fault address =
> > 0x1ac800000, flags = 0
> 
> I had a similar problem since hg revision 25818:50adc933faaf which changes the 
> qemu tag.
> It looks like the qemu commit 
> 3e66da7266c84638c0e22a09c9d2b07529802576 
> (qemu-xen-trad: fix msi_translate with PV event delivery) 
> causes this behavior.
> 
> I solved the problem for me by using 'pci_msitranslate=0' in the domU config.

I don't follow this stuff closely but I could have sworn we had disabled
msitranslate by default.

In any case I don't think that changeset was intended to cause anything
like this -- Stefano?

> In addition I had to reboot (perhaps poweroff?) the dom0 once the IO_PAGE_FAULT 
> occured.
> 
> Regards
> Hans
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 17:03:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 17:03:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWrz7-0000nP-VB; Fri, 09 Nov 2012 17:03:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mcbeagle@gmx.de>) id 1TWrz6-0000nJ-QE
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 17:03:13 +0000
Received: from [85.158.138.51:23708] by server-9.bemta-3.messagelabs.com id
	D8/A8-02388-F473D905; Fri, 09 Nov 2012 17:03:11 +0000
X-Env-Sender: mcbeagle@gmx.de
X-Msg-Ref: server-7.tower-174.messagelabs.com!1352480591!20525806!1
X-Originating-IP: [213.165.64.23]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjEzLjE2NS42NC4yMyA9PiAyMjUwNTI=\n,
	ML_RADAR_SPEW_LINKS_14,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30696 invoked from network); 9 Nov 2012 17:03:11 -0000
Received: from mailout-de.gmx.net (HELO mailout-de.gmx.net) (213.165.64.23)
	by server-7.tower-174.messagelabs.com with SMTP;
	9 Nov 2012 17:03:11 -0000
Received: (qmail invoked by alias); 09 Nov 2012 17:03:11 -0000
Received: from e182033070.adsl.alicedsl.de (EHLO sheik-lin.localnet)
	[85.182.33.70]
	by mail.gmx.net (mp037) with SMTP; 09 Nov 2012 18:03:11 +0100
X-Authenticated: #432297
X-Provags-ID: V01U2FsdGVkX19dbEZ+ukZdnFEGRUHnHGI24PJ1dDfuleiF4XXbT0
	bYKTDDkIatl6iL
From: Hans Mueller <mcbeagle@gmx.de>
To: xen-devel@lists.xen.org
Date: Fri, 09 Nov 2012 18:03:09 +0100
Message-ID: <2009372.tbv8COfH3K@sheik-lin>
User-Agent: KMail/4.9.2 (Linux/3.6.4-gentoo-c0; KDE/4.9.3; x86_64; ; )
In-Reply-To: <1352478827.27833.127.camel@zakaz.uk.xensource.com>
References: <CAN3GA=T8Ztupou=XU4a6MeMWJN5yJgN=0fmDUp0BvXFRPEfLYw@mail.gmail.com>
	<1382625.svAp90pkVF@sheik-lin>
	<1352478827.27833.127.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
X-Y-GMX-Trusted: 0
Subject: Re: [Xen-devel] PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
	IO_PAGE_FAULT:
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Friday, 9. November 2012 16:33:47 Ian Campbell wrote:
> On Fri, 2012-11-09 at 16:25 +0000, Hans Mueller wrote:
> > On Thursday, 8. November 2012 20:02:51 feral wrote:
> > > Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable.  Tested against all
> > > three.
> > > 
> > > VGA passthrough previously working with 4.1 is no longer working with
> > > >4.2.
> > > 
> > > Setup - Working:
> > > Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos),
> > > libvirt-bin,
> > > xend
> > > Asus Radeon HD 7870 DirectCU.
> > > Works perfect.  Benches on par with bare metal.
> > > 
> > > Setup - Broken:
> > > Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (from GIT), xl
> > > toolstack.
> > > Asus Radeon HD 7870 DirectCU.
> > > Some times the guest boots correctly but display is never enabled.
> > > 
> > >  Sometimes BSOD, doesn't seem to be any rhyme or reason?
> > > 
> > > No errors in logs.   Found the following in 'xl dmesg':
> > > (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 2, device id = 0x600, fault
> > > address =
> > > 0x1ac800000, flags = 0
> > 
> > I had a similar problem since hg revision 25818:50adc933faaf which changes
> > the qemu tag.
> > It looks like the qemu commit
> > 3e66da7266c84638c0e22a09c9d2b07529802576
> > (qemu-xen-trad: fix msi_translate with PV event delivery)
> > causes this behavior.
> > 
> > I solved the problem for me by using 'pci_msitranslate=0' in the domU
> > config.
>
> I don't follow this stuff closely but I could have sworn we had disabled
> msitranslate by default.

You're right - you don't have to explicitly disable msitranslate, you just may 
not enable it (which was the case in my domU config, not sure why it was 
enabled nor whether it was really required in the past - I think it was 
enabled during pci/gpu-passthrough testing and not changed back/disabled once 
it worked).


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 17:03:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 17:03:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWrz7-0000nP-VB; Fri, 09 Nov 2012 17:03:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mcbeagle@gmx.de>) id 1TWrz6-0000nJ-QE
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 17:03:13 +0000
Received: from [85.158.138.51:23708] by server-9.bemta-3.messagelabs.com id
	D8/A8-02388-F473D905; Fri, 09 Nov 2012 17:03:11 +0000
X-Env-Sender: mcbeagle@gmx.de
X-Msg-Ref: server-7.tower-174.messagelabs.com!1352480591!20525806!1
X-Originating-IP: [213.165.64.23]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjEzLjE2NS42NC4yMyA9PiAyMjUwNTI=\n,
	ML_RADAR_SPEW_LINKS_14,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30696 invoked from network); 9 Nov 2012 17:03:11 -0000
Received: from mailout-de.gmx.net (HELO mailout-de.gmx.net) (213.165.64.23)
	by server-7.tower-174.messagelabs.com with SMTP;
	9 Nov 2012 17:03:11 -0000
Received: (qmail invoked by alias); 09 Nov 2012 17:03:11 -0000
Received: from e182033070.adsl.alicedsl.de (EHLO sheik-lin.localnet)
	[85.182.33.70]
	by mail.gmx.net (mp037) with SMTP; 09 Nov 2012 18:03:11 +0100
X-Authenticated: #432297
X-Provags-ID: V01U2FsdGVkX19dbEZ+ukZdnFEGRUHnHGI24PJ1dDfuleiF4XXbT0
	bYKTDDkIatl6iL
From: Hans Mueller <mcbeagle@gmx.de>
To: xen-devel@lists.xen.org
Date: Fri, 09 Nov 2012 18:03:09 +0100
Message-ID: <2009372.tbv8COfH3K@sheik-lin>
User-Agent: KMail/4.9.2 (Linux/3.6.4-gentoo-c0; KDE/4.9.3; x86_64; ; )
In-Reply-To: <1352478827.27833.127.camel@zakaz.uk.xensource.com>
References: <CAN3GA=T8Ztupou=XU4a6MeMWJN5yJgN=0fmDUp0BvXFRPEfLYw@mail.gmail.com>
	<1382625.svAp90pkVF@sheik-lin>
	<1352478827.27833.127.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
X-Y-GMX-Trusted: 0
Subject: Re: [Xen-devel] PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
	IO_PAGE_FAULT:
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Friday, 9. November 2012 16:33:47 Ian Campbell wrote:
> On Fri, 2012-11-09 at 16:25 +0000, Hans Mueller wrote:
> > On Thursday, 8. November 2012 20:02:51 feral wrote:
> > > Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable.  Tested against all
> > > three.
> > > 
> > > VGA passthrough previously working with 4.1 is no longer working with
> > > >4.2.
> > > 
> > > Setup - Working:
> > > Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos),
> > > libvirt-bin,
> > > xend
> > > Asus Radeon HD 7870 DirectCU.
> > > Works perfect.  Benches on par with bare metal.
> > > 
> > > Setup - Broken:
> > > Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (from GIT), xl
> > > toolstack.
> > > Asus Radeon HD 7870 DirectCU.
> > > Some times the guest boots correctly but display is never enabled.
> > > 
> > >  Sometimes BSOD, doesn't seem to be any rhyme or reason?
> > > 
> > > No errors in logs.   Found the following in 'xl dmesg':
> > > (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 2, device id = 0x600, fault
> > > address =
> > > 0x1ac800000, flags = 0
> > 
> > I had a similar problem since hg revision 25818:50adc933faaf which changes
> > the qemu tag.
> > It looks like the qemu commit
> > 3e66da7266c84638c0e22a09c9d2b07529802576
> > (qemu-xen-trad: fix msi_translate with PV event delivery)
> > causes this behavior.
> > 
> > I solved the problem for me by using 'pci_msitranslate=0' in the domU
> > config.
>
> I don't follow this stuff closely but I could have sworn we had disabled
> msitranslate by default.

You're right - you don't have to explicitly disable msitranslate, you just may 
not enable it (which was the case in my domU config, not sure why it was 
enabled nor whether it was really required in the past - I think it was 
enabled during pci/gpu-passthrough testing and not changed back/disabled once 
it worked).


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 17:03:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 17:03:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWrzH-0000ny-BS; Fri, 09 Nov 2012 17:03:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pablo.llopis@gmail.com>) id 1TWrzE-0000nl-T2
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 17:03:21 +0000
Received: from [193.109.254.147:11717] by server-6.bemta-14.messagelabs.com id
	C6/8B-02788-7573D905; Fri, 09 Nov 2012 17:03:19 +0000
X-Env-Sender: pablo.llopis@gmail.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1352480597!2631525!1
X-Originating-IP: [209.85.214.173]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30925 invoked from network); 9 Nov 2012 17:03:18 -0000
Received: from mail-ob0-f173.google.com (HELO mail-ob0-f173.google.com)
	(209.85.214.173)
	by server-7.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 17:03:18 -0000
Received: by mail-ob0-f173.google.com with SMTP id wc18so4958990obb.32
	for <xen-devel@lists.xen.org>; Fri, 09 Nov 2012 09:03:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:content-type;
	bh=EWWY5egPpnSG2mAhshPRwfHT64QAB5pQoEpIK/kX5qE=;
	b=ou2iSln5GgLw+1n2pCj1nndgyfWUcVAsHCl2HClkDvd9omgMX2BoeAwtMf2XeOh2LV
	r4tBEzhH+yU+X5rWytcqkx4am9oJ4cU1DKP+H8n5sl+0yECEA2emiaH81JI0wGHCm52N
	UsfRqFKW+49tn+VYBmXFpnHCPU9kdhE/60YU1+Vb8OnsgIqFP4zuoik+IssQW+KcBqqH
	pfvfu1oPtuakXYdjT2zvSljGrcTCOSKpFAbJeQWo08Sc4TJGK3bBFJQnPCgT2BcpJnkI
	UB1IiMV9i8JhRYLoSTptr9t5ewMRPEiIDt46Z0eOpFwu9XbtyNbxIZXrKyqL0CxxckyL
	PaUw==
MIME-Version: 1.0
Received: by 10.182.141.73 with SMTP id rm9mr8922859obb.99.1352480596962; Fri,
	09 Nov 2012 09:03:16 -0800 (PST)
Received: by 10.182.87.129 with HTTP; Fri, 9 Nov 2012 09:03:16 -0800 (PST)
Date: Fri, 9 Nov 2012 18:03:16 +0100
X-Google-Sender-Auth: XLWic76TycdbMCE4uQJZQEsLugs
Message-ID: <CAL08nMHkUw+oTKHjMKz3f-eVCwya5Oyjayf2SruEsQ=3C6gbPg@mail.gmail.com>
From: Pablo Llopis <pllopis@arcos.inf.uc3m.es>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] Kernel Oops trying to share memory with gntalloc
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello Xen Developers,

I am experiencing crashes when attempting to acquire a large number of
grant table references through gntalloc.
I tried this on a 3.2 kernel and on the most recent stable (3.6.6)
kernel with the same result (Xen 4.1.1).
A simple program, run from Dom0, which tries to create a shared buffer
about 16MB or bigger with a DomU gives the kernel Oops included below.
After the crash, I am not able to kill the process (stays in
uninterruptible D state), and the xen-gntalloc module can not be
removed (resource temporarily unavailable). A hard reboot is required
as well, because the system will not reboot, and other programs will
randomly block and never return.

[  260.681539] main[4448]: segfault at 0 ip 00007f0c13f7e03b sp
00007fff36608e88 error 6 in libc-2.13.so[7f0c13ef1000+199000]
[  292.498807] BUG: unable to handle kernel paging request at ffffc90206047fc8
[  292.499020] IP: [<ffffffff813b6a93>] gnttab_query_foreign_access_v2+0x13/0x20
[  292.499180] PGD fa6446067 PUD 0
[  292.499365] Oops: 0000 [#1] SMP
[  292.499550] Modules linked in: xen_gntalloc xt_physdev xen_netback
xen_blkback ib_cm ib_sa ib_uverbs ib_umad mdio ib_mthca ib_mad ib_core
ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4
xt_state nf_conntrack ipt_REJECT xt_CHECKSUM iptable_mangle xt_tcpudp
iptable_filter ip_tables x_tables bridge stp llc nfsv4 nfsd nfs_acl
auth_rpcgss nfs fscache lockd sunrpc xenfs xen_privcmd xen_evtchn
usb_storage xen_gntdev w83793 sp5100_tco dm_multipath hwmon_vid [last
unloaded: xen_gntalloc]
[  292.502287] CPU 3
[  292.502346] Pid: 4454, comm: main Tainted: G        W    3.6.6 #3
Supermicro H8DGU/H8DGU
[  292.502554] RIP: e030:[<ffffffff813b6a93>]  [<ffffffff813b6a93>]
gnttab_query_foreign_access_v2+0x13/0x20
[  292.502740] RSP: e02b:ffff880f8acf3db0  EFLAGS: 00010286
[  292.502835] RAX: ffffc90006048000 RBX: ffff880e80a74a40 RCX: 0000000000002b4a
[  292.502935] RDX: 0000000000000000 RSI: ffff880e80a749c0 RDI: 00000000ffffffe4
[  292.503039] RBP: ffff880f8acf3db8 R08: 0000000000016960 R09: ffffea003a029d00
[  292.503138] R10: ffffffffa0206182 R11: 0000000000000002 R12: ffffffffffffffe4
[  292.503238] R13: 0000000000001ff8 R14: 0000000000000000 R15: ffff880f9c2e8000
[  292.503357] FS:  00007f97bc59eb40(0000) GS:ffff880faa860000(0000)
knlGS:0000000000000000
[  292.503487] CS:  e033 DS: 0000 ES: 0000 CR0: 000000008005003b
[  292.503582] CR2: ffffc90206047fc8 CR3: 0000000e869d5000 CR4: 0000000000000660
[  292.503682] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  292.503781] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[  292.503885] Process main (pid: 4454, threadinfo ffff880f8acf2000,
task ffff880f8c405b40)
[  292.504014] Stack:
[  292.504101]  ffffffff813b6ab3 ffff880f8acf3df8 ffffffffa0206195
ffff880f8acf3df8
[  292.504428]  ffffffff813b7e70 ffff880e80a74a40 0000000000001ff8
ffff880e80a74a40
[  292.504752]  ffff880e80a74a40 ffff880f8acf3ea8 ffffffffa02069c8
00000000015717f0
[  292.505074] Call Trace:
[  292.505161]  [<ffffffff813b6ab3>] ? gnttab_query_foreign_access+0x13/0x20
[  292.505264]  [<ffffffffa0206195>] __del_gref+0xf5/0x140 [xen_gntalloc]
[  292.505364]  [<ffffffff813b7e70>] ? gnttab_grant_foreign_access+0x30/0x70
[  292.505464]  [<ffffffffa02069c8>] gntalloc_ioctl+0x478/0x590 [xen_gntalloc]
[  292.505568]  [<ffffffff8118a5df>] do_vfs_ioctl+0x8f/0x4f0
[  292.505671]  [<ffffffff8116a2af>] ? kmem_cache_free+0x2f/0x110
[  292.505770]  [<ffffffff811833d3>] ? putname+0x33/0x50
[  292.505864]  [<ffffffff8118aad1>] sys_ioctl+0x91/0xa0
[  292.505960]  [<ffffffff8166a2e9>] system_call_fastpath+0x16/0x1b
[  292.506055] Code: 90 48 8b 05 88 81 b4 00 89 ff 5d 0f b7 04 f8 83
e0 18 c3 0f 1f 44 00 00 55 48 89 e5 66 66 66 66 90 48 8b 05 78 81 b4
00 89 ff 5d <0f> b7 04 78 83 e0 18 c3 0f 1f 44 00 00 55 48 89 e5 66 66
66 66
[  292.509405] RIP  [<ffffffff813b6a93>]
gnttab_query_foreign_access_v2+0x13/0x20
[  292.509586]  RSP <ffff880f8acf3db0>
[  292.509673] CR2: ffffc90206047fc8
[  292.509777] ---[ end trace d8a8651f22939589 ]---


The disassembly of the code looks something like this (function
begin/end edited by me). If I did things right, the fault occurs in
the movzwl instruction at <+43>):

0x00000000006010a0 <+0>: nop
   0x00000000006010a1 <+1>: mov    0xb48188(%rip),%rax        # 0x1149230
   0x00000000006010a8 <+8>: mov    %edi,%edi
   0x00000000006010aa <+10>: pop    %rbp
   0x00000000006010ab <+11>: movzwl (%rax,%rdi,8),%eax
   0x00000000006010af <+15>: and    $0x18,%eax
   0x00000000006010b2 <+18>: retq
   0x00000000006010b3 <+19>: nopl   0x0(%rax,%rax,1)
------ begin gnttab_query_foreign_access
   0x00000000006010b8 <+24>: push   %rbp
   0x00000000006010b9 <+25>: mov    %rsp,%rbp
   0x00000000006010bc <+28>: data32 data32 data32 xchg %ax,%ax
   0x00000000006010c1 <+33>: mov    0xb48178(%rip),%rax        # 0x1149240
   0x00000000006010c8 <+40>: mov    %edi,%edi
   0x00000000006010ca <+42>: pop    %rbp
   0x00000000006010cb <+43>: movzwl (%rax,%rdi,2),%eax
   0x00000000006010cf <+47>: and    $0x18,%eax
   0x00000000006010d2 <+50>: retq
------ end gnttab_query_foreign_access
   0x00000000006010d3 <+51>: nopl   0x0(%rax,%rax,1)
   0x00000000006010d8 <+56>: push   %rbp
   0x00000000006010d9 <+57>: mov    %rsp,%rbp
   0x00000000006010dc <+60>: data16
   0x00000000006010dd <+61>: data16
   0x00000000006010de <+62>: data16
   0x00000000006010df <+63>: data16
   0x00000000006010e0 <+64>: add    %al,(%rax)


I tried locating the bug, but could not:
something is odd because in order for the call trace to be as it is,
it seems to me that gntalloc_ioctl_alloc had to call add_grefs.
add_grefs calls gnttab_grant_foreign_access and then __del_gref, who
in turn does the call to gnttab_query_foreign_access, which seems to
segfault.
However, this did not seem logical to me, because the only way for
add_grefs to call __del_gref would be for gnttab_grant_foreign_access
to fail (gref->gref_id < 0), and in that case __del_gref does not call
gnttab_query_foreign_access because it is only called if gref->gref_id
> 0.
In spite of this, I see no other way execution would result in this
call trace (first gnttab_grant_foreign_access, then __del_gref, and
then finally gnttab_query_foreign_access). I must have missed
something.

In case it is needed, my memory alloc code which interfaces with
gntalloc looks like this: http://pastie.org/5351941
When loading xen-gntalloc, I am specifying the limit parameter with a
value higher than 1024 and higher than the number of pages I request.
This crash does not happen when I request a small amount of pages, but
as soon as I specify a large number (about 4096 or more), the crash
happens immediately. Regardless of the size, the crash happens
eventually when enough grant references have been requested. Even if I
am not deallocating things right (I think I am doing it right,
though), this should probably not happen.

I would appreciate any help for fixing this bug.

Thank you in advance,

Pablo

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 17:03:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 17:03:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWrzH-0000ny-BS; Fri, 09 Nov 2012 17:03:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pablo.llopis@gmail.com>) id 1TWrzE-0000nl-T2
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 17:03:21 +0000
Received: from [193.109.254.147:11717] by server-6.bemta-14.messagelabs.com id
	C6/8B-02788-7573D905; Fri, 09 Nov 2012 17:03:19 +0000
X-Env-Sender: pablo.llopis@gmail.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1352480597!2631525!1
X-Originating-IP: [209.85.214.173]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30925 invoked from network); 9 Nov 2012 17:03:18 -0000
Received: from mail-ob0-f173.google.com (HELO mail-ob0-f173.google.com)
	(209.85.214.173)
	by server-7.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 17:03:18 -0000
Received: by mail-ob0-f173.google.com with SMTP id wc18so4958990obb.32
	for <xen-devel@lists.xen.org>; Fri, 09 Nov 2012 09:03:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:content-type;
	bh=EWWY5egPpnSG2mAhshPRwfHT64QAB5pQoEpIK/kX5qE=;
	b=ou2iSln5GgLw+1n2pCj1nndgyfWUcVAsHCl2HClkDvd9omgMX2BoeAwtMf2XeOh2LV
	r4tBEzhH+yU+X5rWytcqkx4am9oJ4cU1DKP+H8n5sl+0yECEA2emiaH81JI0wGHCm52N
	UsfRqFKW+49tn+VYBmXFpnHCPU9kdhE/60YU1+Vb8OnsgIqFP4zuoik+IssQW+KcBqqH
	pfvfu1oPtuakXYdjT2zvSljGrcTCOSKpFAbJeQWo08Sc4TJGK3bBFJQnPCgT2BcpJnkI
	UB1IiMV9i8JhRYLoSTptr9t5ewMRPEiIDt46Z0eOpFwu9XbtyNbxIZXrKyqL0CxxckyL
	PaUw==
MIME-Version: 1.0
Received: by 10.182.141.73 with SMTP id rm9mr8922859obb.99.1352480596962; Fri,
	09 Nov 2012 09:03:16 -0800 (PST)
Received: by 10.182.87.129 with HTTP; Fri, 9 Nov 2012 09:03:16 -0800 (PST)
Date: Fri, 9 Nov 2012 18:03:16 +0100
X-Google-Sender-Auth: XLWic76TycdbMCE4uQJZQEsLugs
Message-ID: <CAL08nMHkUw+oTKHjMKz3f-eVCwya5Oyjayf2SruEsQ=3C6gbPg@mail.gmail.com>
From: Pablo Llopis <pllopis@arcos.inf.uc3m.es>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] Kernel Oops trying to share memory with gntalloc
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello Xen Developers,

I am experiencing crashes when attempting to acquire a large number of
grant table references through gntalloc.
I tried this on a 3.2 kernel and on the most recent stable (3.6.6)
kernel with the same result (Xen 4.1.1).
A simple program, run from Dom0, which tries to create a shared buffer
about 16MB or bigger with a DomU gives the kernel Oops included below.
After the crash, I am not able to kill the process (stays in
uninterruptible D state), and the xen-gntalloc module can not be
removed (resource temporarily unavailable). A hard reboot is required
as well, because the system will not reboot, and other programs will
randomly block and never return.

[  260.681539] main[4448]: segfault at 0 ip 00007f0c13f7e03b sp
00007fff36608e88 error 6 in libc-2.13.so[7f0c13ef1000+199000]
[  292.498807] BUG: unable to handle kernel paging request at ffffc90206047fc8
[  292.499020] IP: [<ffffffff813b6a93>] gnttab_query_foreign_access_v2+0x13/0x20
[  292.499180] PGD fa6446067 PUD 0
[  292.499365] Oops: 0000 [#1] SMP
[  292.499550] Modules linked in: xen_gntalloc xt_physdev xen_netback
xen_blkback ib_cm ib_sa ib_uverbs ib_umad mdio ib_mthca ib_mad ib_core
ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4
xt_state nf_conntrack ipt_REJECT xt_CHECKSUM iptable_mangle xt_tcpudp
iptable_filter ip_tables x_tables bridge stp llc nfsv4 nfsd nfs_acl
auth_rpcgss nfs fscache lockd sunrpc xenfs xen_privcmd xen_evtchn
usb_storage xen_gntdev w83793 sp5100_tco dm_multipath hwmon_vid [last
unloaded: xen_gntalloc]
[  292.502287] CPU 3
[  292.502346] Pid: 4454, comm: main Tainted: G        W    3.6.6 #3
Supermicro H8DGU/H8DGU
[  292.502554] RIP: e030:[<ffffffff813b6a93>]  [<ffffffff813b6a93>]
gnttab_query_foreign_access_v2+0x13/0x20
[  292.502740] RSP: e02b:ffff880f8acf3db0  EFLAGS: 00010286
[  292.502835] RAX: ffffc90006048000 RBX: ffff880e80a74a40 RCX: 0000000000002b4a
[  292.502935] RDX: 0000000000000000 RSI: ffff880e80a749c0 RDI: 00000000ffffffe4
[  292.503039] RBP: ffff880f8acf3db8 R08: 0000000000016960 R09: ffffea003a029d00
[  292.503138] R10: ffffffffa0206182 R11: 0000000000000002 R12: ffffffffffffffe4
[  292.503238] R13: 0000000000001ff8 R14: 0000000000000000 R15: ffff880f9c2e8000
[  292.503357] FS:  00007f97bc59eb40(0000) GS:ffff880faa860000(0000)
knlGS:0000000000000000
[  292.503487] CS:  e033 DS: 0000 ES: 0000 CR0: 000000008005003b
[  292.503582] CR2: ffffc90206047fc8 CR3: 0000000e869d5000 CR4: 0000000000000660
[  292.503682] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  292.503781] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[  292.503885] Process main (pid: 4454, threadinfo ffff880f8acf2000,
task ffff880f8c405b40)
[  292.504014] Stack:
[  292.504101]  ffffffff813b6ab3 ffff880f8acf3df8 ffffffffa0206195
ffff880f8acf3df8
[  292.504428]  ffffffff813b7e70 ffff880e80a74a40 0000000000001ff8
ffff880e80a74a40
[  292.504752]  ffff880e80a74a40 ffff880f8acf3ea8 ffffffffa02069c8
00000000015717f0
[  292.505074] Call Trace:
[  292.505161]  [<ffffffff813b6ab3>] ? gnttab_query_foreign_access+0x13/0x20
[  292.505264]  [<ffffffffa0206195>] __del_gref+0xf5/0x140 [xen_gntalloc]
[  292.505364]  [<ffffffff813b7e70>] ? gnttab_grant_foreign_access+0x30/0x70
[  292.505464]  [<ffffffffa02069c8>] gntalloc_ioctl+0x478/0x590 [xen_gntalloc]
[  292.505568]  [<ffffffff8118a5df>] do_vfs_ioctl+0x8f/0x4f0
[  292.505671]  [<ffffffff8116a2af>] ? kmem_cache_free+0x2f/0x110
[  292.505770]  [<ffffffff811833d3>] ? putname+0x33/0x50
[  292.505864]  [<ffffffff8118aad1>] sys_ioctl+0x91/0xa0
[  292.505960]  [<ffffffff8166a2e9>] system_call_fastpath+0x16/0x1b
[  292.506055] Code: 90 48 8b 05 88 81 b4 00 89 ff 5d 0f b7 04 f8 83
e0 18 c3 0f 1f 44 00 00 55 48 89 e5 66 66 66 66 90 48 8b 05 78 81 b4
00 89 ff 5d <0f> b7 04 78 83 e0 18 c3 0f 1f 44 00 00 55 48 89 e5 66 66
66 66
[  292.509405] RIP  [<ffffffff813b6a93>]
gnttab_query_foreign_access_v2+0x13/0x20
[  292.509586]  RSP <ffff880f8acf3db0>
[  292.509673] CR2: ffffc90206047fc8
[  292.509777] ---[ end trace d8a8651f22939589 ]---


The disassembly of the code looks something like this (function
begin/end edited by me). If I did things right, the fault occurs in
the movzwl instruction at <+43>):

0x00000000006010a0 <+0>: nop
   0x00000000006010a1 <+1>: mov    0xb48188(%rip),%rax        # 0x1149230
   0x00000000006010a8 <+8>: mov    %edi,%edi
   0x00000000006010aa <+10>: pop    %rbp
   0x00000000006010ab <+11>: movzwl (%rax,%rdi,8),%eax
   0x00000000006010af <+15>: and    $0x18,%eax
   0x00000000006010b2 <+18>: retq
   0x00000000006010b3 <+19>: nopl   0x0(%rax,%rax,1)
------ begin gnttab_query_foreign_access
   0x00000000006010b8 <+24>: push   %rbp
   0x00000000006010b9 <+25>: mov    %rsp,%rbp
   0x00000000006010bc <+28>: data32 data32 data32 xchg %ax,%ax
   0x00000000006010c1 <+33>: mov    0xb48178(%rip),%rax        # 0x1149240
   0x00000000006010c8 <+40>: mov    %edi,%edi
   0x00000000006010ca <+42>: pop    %rbp
   0x00000000006010cb <+43>: movzwl (%rax,%rdi,2),%eax
   0x00000000006010cf <+47>: and    $0x18,%eax
   0x00000000006010d2 <+50>: retq
------ end gnttab_query_foreign_access
   0x00000000006010d3 <+51>: nopl   0x0(%rax,%rax,1)
   0x00000000006010d8 <+56>: push   %rbp
   0x00000000006010d9 <+57>: mov    %rsp,%rbp
   0x00000000006010dc <+60>: data16
   0x00000000006010dd <+61>: data16
   0x00000000006010de <+62>: data16
   0x00000000006010df <+63>: data16
   0x00000000006010e0 <+64>: add    %al,(%rax)


I tried locating the bug, but could not:
something is odd because in order for the call trace to be as it is,
it seems to me that gntalloc_ioctl_alloc had to call add_grefs.
add_grefs calls gnttab_grant_foreign_access and then __del_gref, who
in turn does the call to gnttab_query_foreign_access, which seems to
segfault.
However, this did not seem logical to me, because the only way for
add_grefs to call __del_gref would be for gnttab_grant_foreign_access
to fail (gref->gref_id < 0), and in that case __del_gref does not call
gnttab_query_foreign_access because it is only called if gref->gref_id
> 0.
In spite of this, I see no other way execution would result in this
call trace (first gnttab_grant_foreign_access, then __del_gref, and
then finally gnttab_query_foreign_access). I must have missed
something.

In case it is needed, my memory alloc code which interfaces with
gntalloc looks like this: http://pastie.org/5351941
When loading xen-gntalloc, I am specifying the limit parameter with a
value higher than 1024 and higher than the number of pages I request.
This crash does not happen when I request a small amount of pages, but
as soon as I specify a large number (about 4096 or more), the crash
happens immediately. Regardless of the size, the crash happens
eventually when enough grant references have been requested. Even if I
am not deallocating things right (I think I am doing it right,
though), this should probably not happen.

I would appreciate any help for fixing this bug.

Thank you in advance,

Pablo

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 17:15:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 17:15:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWsAF-0001CJ-Mk; Fri, 09 Nov 2012 17:14:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mcbeagle@gmx.de>) id 1TWsAE-0001CE-9E
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 17:14:42 +0000
Received: from [85.158.138.51:17458] by server-7.bemta-3.messagelabs.com id
	DB/A3-01713-10A3D905; Fri, 09 Nov 2012 17:14:41 +0000
X-Env-Sender: mcbeagle@gmx.de
X-Msg-Ref: server-4.tower-174.messagelabs.com!1352481281!29393399!1
X-Originating-IP: [213.165.64.22]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTMuMTY1LjY0LjIyID0+IDIzMDQyNQ==\n,sa_preprocessor: 
	QmFkIElQOiAyMTMuMTY1LjY0LjIyID0+IDIzMDQyNQ==\n, ML_RADAR_SPEW_LINKS_14, 
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28812 invoked from network); 9 Nov 2012 17:14:41 -0000
Received: from mailout-de.gmx.net (HELO mailout-de.gmx.net) (213.165.64.22)
	by server-4.tower-174.messagelabs.com with SMTP;
	9 Nov 2012 17:14:41 -0000
Received: (qmail invoked by alias); 09 Nov 2012 17:14:40 -0000
Received: from e182033070.adsl.alicedsl.de (EHLO sheik-lin.localnet)
	[85.182.33.70]
	by mail.gmx.net (mp010) with SMTP; 09 Nov 2012 18:14:40 +0100
X-Authenticated: #432297
X-Provags-ID: V01U2FsdGVkX1/G8tRp3ynGbllB5rrugNbd0adeUarpFJckh/5jlP
	fV1ydyDX3YpZ3l
From: Hans Mueller <mcbeagle@gmx.de>
To: xen-devel@lists.xen.org
Date: Fri, 09 Nov 2012 18:14:39 +0100
Message-ID: <1871003.0Pup8WfsfS@sheik-lin>
User-Agent: KMail/4.9.2 (Linux/3.6.4-gentoo-c0; KDE/4.9.3; x86_64; ; )
In-Reply-To: <1352478827.27833.127.camel@zakaz.uk.xensource.com>
References: <CAN3GA=T8Ztupou=XU4a6MeMWJN5yJgN=0fmDUp0BvXFRPEfLYw@mail.gmail.com>
	<1382625.svAp90pkVF@sheik-lin>
	<1352478827.27833.127.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
X-Y-GMX-Trusted: 0
Subject: Re: [Xen-devel] PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
	IO_PAGE_FAULT:
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Friday, 9. November 2012 16:33:47 Ian Campbell wrote:
> On Fri, 2012-11-09 at 16:25 +0000, Hans Mueller wrote:
> > On Thursday, 8. November 2012 20:02:51 feral wrote:
> > > Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable.  Tested against all
> > > three.
> > > 
> > > VGA passthrough previously working with 4.1 is no longer working with
> > > >4.2.
> > > 
> > > Setup - Working:
> > > Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos),
> > > libvirt-bin,
> > > xend
> > > Asus Radeon HD 7870 DirectCU.
> > > Works perfect.  Benches on par with bare metal.
> > > 
> > > Setup - Broken:
> > > Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (from GIT), xl
> > > toolstack.
> > > Asus Radeon HD 7870 DirectCU.
> > > Some times the guest boots correctly but display is never enabled.
> > > 
> > >  Sometimes BSOD, doesn't seem to be any rhyme or reason?
> > > 
> > > No errors in logs.   Found the following in 'xl dmesg':
> > > (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 2, device id = 0x600, fault
> > > address =
> > > 0x1ac800000, flags = 0
> > 
> > I had a similar problem since hg revision 25818:50adc933faaf which changes
> > the qemu tag.
> > It looks like the qemu commit
> > 3e66da7266c84638c0e22a09c9d2b07529802576
> > (qemu-xen-trad: fix msi_translate with PV event delivery)
> > causes this behavior.
> > 
> > I solved the problem for me by using 'pci_msitranslate=0' in the domU
> > config.
> I don't follow this stuff closely but I could have sworn we had disabled
> msitranslate by default.
> 
> In any case I don't think that changeset was intended to cause anything
> like this -- Stefano?
> 
> > In addition I had to reboot (perhaps poweroff?) the dom0 once the
> > IO_PAGE_FAULT occured.

One more info for you - afair i noticed that it was not only the IO_PAGE_FAULT 
which occured but also the qemu process in dom0 crashed w/o any messages in 
the logs, perhaps feral can confirm this?


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 17:15:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 17:15:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWsAF-0001CJ-Mk; Fri, 09 Nov 2012 17:14:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mcbeagle@gmx.de>) id 1TWsAE-0001CE-9E
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 17:14:42 +0000
Received: from [85.158.138.51:17458] by server-7.bemta-3.messagelabs.com id
	DB/A3-01713-10A3D905; Fri, 09 Nov 2012 17:14:41 +0000
X-Env-Sender: mcbeagle@gmx.de
X-Msg-Ref: server-4.tower-174.messagelabs.com!1352481281!29393399!1
X-Originating-IP: [213.165.64.22]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTMuMTY1LjY0LjIyID0+IDIzMDQyNQ==\n,sa_preprocessor: 
	QmFkIElQOiAyMTMuMTY1LjY0LjIyID0+IDIzMDQyNQ==\n, ML_RADAR_SPEW_LINKS_14, 
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28812 invoked from network); 9 Nov 2012 17:14:41 -0000
Received: from mailout-de.gmx.net (HELO mailout-de.gmx.net) (213.165.64.22)
	by server-4.tower-174.messagelabs.com with SMTP;
	9 Nov 2012 17:14:41 -0000
Received: (qmail invoked by alias); 09 Nov 2012 17:14:40 -0000
Received: from e182033070.adsl.alicedsl.de (EHLO sheik-lin.localnet)
	[85.182.33.70]
	by mail.gmx.net (mp010) with SMTP; 09 Nov 2012 18:14:40 +0100
X-Authenticated: #432297
X-Provags-ID: V01U2FsdGVkX1/G8tRp3ynGbllB5rrugNbd0adeUarpFJckh/5jlP
	fV1ydyDX3YpZ3l
From: Hans Mueller <mcbeagle@gmx.de>
To: xen-devel@lists.xen.org
Date: Fri, 09 Nov 2012 18:14:39 +0100
Message-ID: <1871003.0Pup8WfsfS@sheik-lin>
User-Agent: KMail/4.9.2 (Linux/3.6.4-gentoo-c0; KDE/4.9.3; x86_64; ; )
In-Reply-To: <1352478827.27833.127.camel@zakaz.uk.xensource.com>
References: <CAN3GA=T8Ztupou=XU4a6MeMWJN5yJgN=0fmDUp0BvXFRPEfLYw@mail.gmail.com>
	<1382625.svAp90pkVF@sheik-lin>
	<1352478827.27833.127.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
X-Y-GMX-Trusted: 0
Subject: Re: [Xen-devel] PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
	IO_PAGE_FAULT:
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Friday, 9. November 2012 16:33:47 Ian Campbell wrote:
> On Fri, 2012-11-09 at 16:25 +0000, Hans Mueller wrote:
> > On Thursday, 8. November 2012 20:02:51 feral wrote:
> > > Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable.  Tested against all
> > > three.
> > > 
> > > VGA passthrough previously working with 4.1 is no longer working with
> > > >4.2.
> > > 
> > > Setup - Working:
> > > Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos),
> > > libvirt-bin,
> > > xend
> > > Asus Radeon HD 7870 DirectCU.
> > > Works perfect.  Benches on par with bare metal.
> > > 
> > > Setup - Broken:
> > > Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (from GIT), xl
> > > toolstack.
> > > Asus Radeon HD 7870 DirectCU.
> > > Some times the guest boots correctly but display is never enabled.
> > > 
> > >  Sometimes BSOD, doesn't seem to be any rhyme or reason?
> > > 
> > > No errors in logs.   Found the following in 'xl dmesg':
> > > (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 2, device id = 0x600, fault
> > > address =
> > > 0x1ac800000, flags = 0
> > 
> > I had a similar problem since hg revision 25818:50adc933faaf which changes
> > the qemu tag.
> > It looks like the qemu commit
> > 3e66da7266c84638c0e22a09c9d2b07529802576
> > (qemu-xen-trad: fix msi_translate with PV event delivery)
> > causes this behavior.
> > 
> > I solved the problem for me by using 'pci_msitranslate=0' in the domU
> > config.
> I don't follow this stuff closely but I could have sworn we had disabled
> msitranslate by default.
> 
> In any case I don't think that changeset was intended to cause anything
> like this -- Stefano?
> 
> > In addition I had to reboot (perhaps poweroff?) the dom0 once the
> > IO_PAGE_FAULT occured.

One more info for you - afair i noticed that it was not only the IO_PAGE_FAULT 
which occured but also the qemu process in dom0 crashed w/o any messages in 
the logs, perhaps feral can confirm this?


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 17:35:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 17:35:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWsTZ-0001ZD-1Y; Fri, 09 Nov 2012 17:34:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jbeulich@suse.com>) id 1TWsTX-0001Z8-2o
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 17:34:39 +0000
Received: from [193.109.254.147:33386] by server-1.bemta-14.messagelabs.com id
	EB/FE-25314-EAE3D905; Fri, 09 Nov 2012 17:34:38 +0000
X-Env-Sender: jbeulich@suse.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1352482477!2634808!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5MzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18798 invoked from network); 9 Nov 2012 17:34:37 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-27.messagelabs.com with SMTP;
	9 Nov 2012 17:34:37 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 09 Nov 2012 17:34:37 +0000
Message-Id: <509D3EAB020000780008F4B6@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 09 Nov 2012 17:34:35 +0000
From: "Jan Beulich" <jbeulich@suse.com>
To: <konrad.wilk@oracle.com>
References: <1350037688.14806.93.camel@zakaz.uk.xensource.com>
	<509CD50302000078000A76E4@nat28.tlf.novell.com>
	<1352452573.21048.35.camel@dagon.hellion.org.uk>
	<509CDDBA02000078000A772C@nat28.tlf.novell.com>
	<509CEAB402000078000A7772@nat28.tlf.novell.com>
	<509CFA7B02000078000A778C@nat28.tlf.novell.com>
	<20121109134829.GB30634@phenom.dumpdata.com>
In-Reply-To: <20121109134829.GB30634@phenom.dumpdata.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something issue in
 3.7-rc1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> 11/09/12 2:48 PM >>>
>On Fri, Nov 09, 2012 at 11:43:39AM +0000, Jan Beulich wrote:
>> >>> On 09.11.12 at 11:36, "Jan Beulich" <JBeulich@suse.com> wrote:
>> > In the forward ported kernels, those two checks are however
>> > accompanied by range_needs_mapping() (aka
>> > range_straddles_page_boundary()) checks, which ought to
>> > take care of this. There is brokenness there with the invocations
>> > of gnttab_dma_map_page(), but only if the initial offset is at
>> > least PAGE_SIZE - will have to check whether that occurs.
>> 
>> And indeed, fixing this also makes the problem go away when
>> the allocation order doesn't get forced to zero. So presumably
>> there's also only that one problem I had pointed out in pv-ops.
>
>The pvops one has this in the map-page variant (xen_swiotlb_map_page):
>
>351         if (dma_capable(dev, dev_addr, size) &&
>352             !range_straddles_page_boundary(phys, size) && !swiotlb_force)
>353                 return dev_addr;
>
>and in the sg variant:
>
>494                 if (swiotlb_force ||
>495                     !dma_capable(hwdev, dev_addr, sg->length) ||
>496                     range_straddles_page_boundary(paddr, sg->length)) {
>497                         void *map = swiotlb_tbl_map_single(hwdev,

Oh, right, I forgot that there's yet another clone of that code under drivers/xen/.

>So I think that check is OK. There is no gnttab_dma_map_page call - so that
>can't be the issue.

Indeed.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 17:35:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 17:35:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWsTZ-0001ZD-1Y; Fri, 09 Nov 2012 17:34:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jbeulich@suse.com>) id 1TWsTX-0001Z8-2o
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 17:34:39 +0000
Received: from [193.109.254.147:33386] by server-1.bemta-14.messagelabs.com id
	EB/FE-25314-EAE3D905; Fri, 09 Nov 2012 17:34:38 +0000
X-Env-Sender: jbeulich@suse.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1352482477!2634808!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5MzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18798 invoked from network); 9 Nov 2012 17:34:37 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-27.messagelabs.com with SMTP;
	9 Nov 2012 17:34:37 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 09 Nov 2012 17:34:37 +0000
Message-Id: <509D3EAB020000780008F4B6@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 09 Nov 2012 17:34:35 +0000
From: "Jan Beulich" <jbeulich@suse.com>
To: <konrad.wilk@oracle.com>
References: <1350037688.14806.93.camel@zakaz.uk.xensource.com>
	<509CD50302000078000A76E4@nat28.tlf.novell.com>
	<1352452573.21048.35.camel@dagon.hellion.org.uk>
	<509CDDBA02000078000A772C@nat28.tlf.novell.com>
	<509CEAB402000078000A7772@nat28.tlf.novell.com>
	<509CFA7B02000078000A778C@nat28.tlf.novell.com>
	<20121109134829.GB30634@phenom.dumpdata.com>
In-Reply-To: <20121109134829.GB30634@phenom.dumpdata.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something issue in
 3.7-rc1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> 11/09/12 2:48 PM >>>
>On Fri, Nov 09, 2012 at 11:43:39AM +0000, Jan Beulich wrote:
>> >>> On 09.11.12 at 11:36, "Jan Beulich" <JBeulich@suse.com> wrote:
>> > In the forward ported kernels, those two checks are however
>> > accompanied by range_needs_mapping() (aka
>> > range_straddles_page_boundary()) checks, which ought to
>> > take care of this. There is brokenness there with the invocations
>> > of gnttab_dma_map_page(), but only if the initial offset is at
>> > least PAGE_SIZE - will have to check whether that occurs.
>> 
>> And indeed, fixing this also makes the problem go away when
>> the allocation order doesn't get forced to zero. So presumably
>> there's also only that one problem I had pointed out in pv-ops.
>
>The pvops one has this in the map-page variant (xen_swiotlb_map_page):
>
>351         if (dma_capable(dev, dev_addr, size) &&
>352             !range_straddles_page_boundary(phys, size) && !swiotlb_force)
>353                 return dev_addr;
>
>and in the sg variant:
>
>494                 if (swiotlb_force ||
>495                     !dma_capable(hwdev, dev_addr, sg->length) ||
>496                     range_straddles_page_boundary(paddr, sg->length)) {
>497                         void *map = swiotlb_tbl_map_single(hwdev,

Oh, right, I forgot that there's yet another clone of that code under drivers/xen/.

>So I think that check is OK. There is no gnttab_dma_map_page call - so that
>can't be the issue.

Indeed.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 19:57:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 19:57:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWuhG-0002io-Ao; Fri, 09 Nov 2012 19:56:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <msw@amazon.com>) id 1TWuhE-0002ih-SR
	for xen-devel@lists.xensource.com; Fri, 09 Nov 2012 19:56:57 +0000
Received: from [85.158.143.99:52155] by server-2.bemta-4.messagelabs.com id
	D6/CF-28922-8006D905; Fri, 09 Nov 2012 19:56:56 +0000
X-Env-Sender: msw@amazon.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1352491013!18133364!1
X-Originating-IP: [207.171.178.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA3LjE3MS4xNzguMjUgPT4gODYxODQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27185 invoked from network); 9 Nov 2012 19:56:55 -0000
Received: from smtp-fw-31001.amazon.com (HELO smtp-fw-31001.amazon.com)
	(207.171.178.25)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 19:56:55 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=amazon.com; i=msw@amazon.com; q=dns/txt;
	s=amazon201209; t=1352491015; x=1384027015;
	h=date:from:to:cc:subject:message-id:references:
	mime-version:in-reply-to;
	bh=hz92b3blL4Ai1dIa7Rxiamj4GOk3hbB6hT5TIg2zwfU=;
	b=uthpp8MMw7FoiQ8F1Xt2MwNZpPud3+6H748OXXNxnk06OxYIjbzZIBIZ
	GQ6cXlu5oMwNzoRcOB+CLfuNvMdOpfcsMHsP/qrM41o8UTYkePCQkZ4yD
	hbdzc0Ts2EJUt+V97o+UaYceNcTCqGQzhEq5AH4AXD2UJ1qEattWCjaGN I=;
X-IronPort-AV: E=McAfee;i="5400,1158,6891"; a="324057864"
Received: from smtp-in-9003.sea19.amazon.com ([10.186.104.20])
	by smtp-border-fw-out-31001.sea31.amazon.com with
	ESMTP/TLS/DHE-RSA-AES256-SHA; 09 Nov 2012 19:56:50 +0000
Received: from ex10-hub-9004.ant.amazon.com (ex10-hub-9004.ant.amazon.com
	[10.185.137.182])
	by smtp-in-9003.sea19.amazon.com (8.13.8/8.13.8) with ESMTP id
	qA9JuoYC013878
	(version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=OK);
	Fri, 9 Nov 2012 19:56:50 GMT
Received: from u109add4315675089e695.ant.amazon.com (172.17.1.114) by
	ex10-hub-9004.ant.amazon.com (10.185.137.182) with Microsoft SMTP
	Server id 14.2.247.3; Fri, 9 Nov 2012 11:55:55 -0800
Received: by u109add4315675089e695.ant.amazon.com (sSMTP sendmail emulation); 
	Fri, 09 Nov 2012 11:55:55 -0800
Date: Fri, 9 Nov 2012 11:55:55 -0800
From: Matt Wilson <msw@amazon.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121109195553.GA11023@u109add4315675089e695.ant.amazon.com>
References: <509C19DE.6010108@nuclearfallout.net>
	<1352467744.27833.21.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352467744.27833.21.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	John Weekes <lists.xen@nuclearfallout.net>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] Bugs in xl that affect stubdom+tapdisk2, and others
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 09, 2012 at 01:29:04PM +0000, Ian Campbell wrote:
> On Thu, 2012-11-08 at 20:45 +0000, John Weekes wrote:
> > As an additional note about 4.2 -- this isn't an "xl" issue, but rather 
> > a build problem -- even though I use "./configure --libdir=/usr/lib64", 
> > the build is still creating a "dist/install/usr/lib" directory, and 
> > because of this, running ./install.sh nukes my system's "/usr/lib" -> 
> > "/usr/lib64" softlink (which in turn causes all sorts of other problems 
> > until it's corrected). Files that are being put in that tree:
> > 
> > xen-4.2-testing.hg # find dist/install/usr/lib
> > dist/install/usr/lib
> 
> This is an interesting one. I'm not sure how we can avoid this
> behaviour, perhaps there is a tar option to cause it to follow rather
> than clobber synlinks?
> 
> The only other choice I can think of is to change install.sh to use a
> (long) explicit list of $(FOO_DIR)/* entries instead of the single * to
> avoid including system directories, or to otherwise make install.sh more
> fragile and prone to bitrot :-(

Oh dear. If we find that there's not a good reason for it anymore, I'd
think it would be better to remove install.sh instead.

> I must confess I didn't realise anyone used install.sh -- is there some
> advantage to it over make foo-install?
> 
> OOI which distro has this lib->lib64 link and what issues does removing
> it create?
> 
> > dist/install/usr/lib/xen
> 
> This is $(XENFIRMWAREDIR). I have a feeling there is a reason this is
> not using $(LIBDIR), but I don't recall what it was -- Roget/Matt do you
> remember?

There's no need for these files to be multilib compatible, as they are
not runtime DSOs. They're internal to Xen and I think that they should
be moved to $LIBEXECDIR instead, like /usr/libexec/xen/. Unfortunately
there's not much agreement on the usefulness of /usr/libexec, so we'll
need to make sure that packagers can adjust the paths for their
systems' standards.

For 4.2 we didn't want to change where these files were being placed,
and I believe they've bin in $PREFIX/lib/ for quite some time.

Matt

> Thanks again for reporting all these.
> 
> Ian.
> 
> > dist/install/usr/lib/xen/boot
> > dist/install/usr/lib/xen/boot/xenstore-stubdom.gz
> > dist/install/usr/lib/xen/boot/ioemu-stubdom.gz
> > dist/install/usr/lib/xen/boot/pv-grub-x86_64.gz
> > dist/install/usr/lib/xen/boot/hvmloader
> > dist/install/usr/lib/xen/boot/pv-grub-x86_32.gz
> > dist/install/usr/lib/xen/bin
> > dist/install/usr/lib/xen/bin/stubdom-dm
> > dist/install/usr/lib/xen/bin/qemu-io
> > dist/install/usr/lib/xen/bin/qemu-nbd
> > dist/install/usr/lib/xen/bin/qemu-img
> > dist/install/usr/lib/xen/bin/xenpaging
> > dist/install/usr/lib/xen/bin/qemu-dm
> > dist/install/usr/lib/xen/bin/qemu-system-i386
> > dist/install/usr/lib/xen/bin/qemu-ga
> > dist/install/usr/lib/xen/bin/stubdompath.sh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 09 19:57:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Nov 2012 19:57:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TWuhG-0002io-Ao; Fri, 09 Nov 2012 19:56:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <msw@amazon.com>) id 1TWuhE-0002ih-SR
	for xen-devel@lists.xensource.com; Fri, 09 Nov 2012 19:56:57 +0000
Received: from [85.158.143.99:52155] by server-2.bemta-4.messagelabs.com id
	D6/CF-28922-8006D905; Fri, 09 Nov 2012 19:56:56 +0000
X-Env-Sender: msw@amazon.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1352491013!18133364!1
X-Originating-IP: [207.171.178.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA3LjE3MS4xNzguMjUgPT4gODYxODQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27185 invoked from network); 9 Nov 2012 19:56:55 -0000
Received: from smtp-fw-31001.amazon.com (HELO smtp-fw-31001.amazon.com)
	(207.171.178.25)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	9 Nov 2012 19:56:55 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=amazon.com; i=msw@amazon.com; q=dns/txt;
	s=amazon201209; t=1352491015; x=1384027015;
	h=date:from:to:cc:subject:message-id:references:
	mime-version:in-reply-to;
	bh=hz92b3blL4Ai1dIa7Rxiamj4GOk3hbB6hT5TIg2zwfU=;
	b=uthpp8MMw7FoiQ8F1Xt2MwNZpPud3+6H748OXXNxnk06OxYIjbzZIBIZ
	GQ6cXlu5oMwNzoRcOB+CLfuNvMdOpfcsMHsP/qrM41o8UTYkePCQkZ4yD
	hbdzc0Ts2EJUt+V97o+UaYceNcTCqGQzhEq5AH4AXD2UJ1qEattWCjaGN I=;
X-IronPort-AV: E=McAfee;i="5400,1158,6891"; a="324057864"
Received: from smtp-in-9003.sea19.amazon.com ([10.186.104.20])
	by smtp-border-fw-out-31001.sea31.amazon.com with
	ESMTP/TLS/DHE-RSA-AES256-SHA; 09 Nov 2012 19:56:50 +0000
Received: from ex10-hub-9004.ant.amazon.com (ex10-hub-9004.ant.amazon.com
	[10.185.137.182])
	by smtp-in-9003.sea19.amazon.com (8.13.8/8.13.8) with ESMTP id
	qA9JuoYC013878
	(version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=OK);
	Fri, 9 Nov 2012 19:56:50 GMT
Received: from u109add4315675089e695.ant.amazon.com (172.17.1.114) by
	ex10-hub-9004.ant.amazon.com (10.185.137.182) with Microsoft SMTP
	Server id 14.2.247.3; Fri, 9 Nov 2012 11:55:55 -0800
Received: by u109add4315675089e695.ant.amazon.com (sSMTP sendmail emulation); 
	Fri, 09 Nov 2012 11:55:55 -0800
Date: Fri, 9 Nov 2012 11:55:55 -0800
From: Matt Wilson <msw@amazon.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121109195553.GA11023@u109add4315675089e695.ant.amazon.com>
References: <509C19DE.6010108@nuclearfallout.net>
	<1352467744.27833.21.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352467744.27833.21.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	John Weekes <lists.xen@nuclearfallout.net>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] Bugs in xl that affect stubdom+tapdisk2, and others
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 09, 2012 at 01:29:04PM +0000, Ian Campbell wrote:
> On Thu, 2012-11-08 at 20:45 +0000, John Weekes wrote:
> > As an additional note about 4.2 -- this isn't an "xl" issue, but rather 
> > a build problem -- even though I use "./configure --libdir=/usr/lib64", 
> > the build is still creating a "dist/install/usr/lib" directory, and 
> > because of this, running ./install.sh nukes my system's "/usr/lib" -> 
> > "/usr/lib64" softlink (which in turn causes all sorts of other problems 
> > until it's corrected). Files that are being put in that tree:
> > 
> > xen-4.2-testing.hg # find dist/install/usr/lib
> > dist/install/usr/lib
> 
> This is an interesting one. I'm not sure how we can avoid this
> behaviour, perhaps there is a tar option to cause it to follow rather
> than clobber synlinks?
> 
> The only other choice I can think of is to change install.sh to use a
> (long) explicit list of $(FOO_DIR)/* entries instead of the single * to
> avoid including system directories, or to otherwise make install.sh more
> fragile and prone to bitrot :-(

Oh dear. If we find that there's not a good reason for it anymore, I'd
think it would be better to remove install.sh instead.

> I must confess I didn't realise anyone used install.sh -- is there some
> advantage to it over make foo-install?
> 
> OOI which distro has this lib->lib64 link and what issues does removing
> it create?
> 
> > dist/install/usr/lib/xen
> 
> This is $(XENFIRMWAREDIR). I have a feeling there is a reason this is
> not using $(LIBDIR), but I don't recall what it was -- Roget/Matt do you
> remember?

There's no need for these files to be multilib compatible, as they are
not runtime DSOs. They're internal to Xen and I think that they should
be moved to $LIBEXECDIR instead, like /usr/libexec/xen/. Unfortunately
there's not much agreement on the usefulness of /usr/libexec, so we'll
need to make sure that packagers can adjust the paths for their
systems' standards.

For 4.2 we didn't want to change where these files were being placed,
and I believe they've bin in $PREFIX/lib/ for quite some time.

Matt

> Thanks again for reporting all these.
> 
> Ian.
> 
> > dist/install/usr/lib/xen/boot
> > dist/install/usr/lib/xen/boot/xenstore-stubdom.gz
> > dist/install/usr/lib/xen/boot/ioemu-stubdom.gz
> > dist/install/usr/lib/xen/boot/pv-grub-x86_64.gz
> > dist/install/usr/lib/xen/boot/hvmloader
> > dist/install/usr/lib/xen/boot/pv-grub-x86_32.gz
> > dist/install/usr/lib/xen/bin
> > dist/install/usr/lib/xen/bin/stubdom-dm
> > dist/install/usr/lib/xen/bin/qemu-io
> > dist/install/usr/lib/xen/bin/qemu-nbd
> > dist/install/usr/lib/xen/bin/qemu-img
> > dist/install/usr/lib/xen/bin/xenpaging
> > dist/install/usr/lib/xen/bin/qemu-dm
> > dist/install/usr/lib/xen/bin/qemu-system-i386
> > dist/install/usr/lib/xen/bin/qemu-ga
> > dist/install/usr/lib/xen/bin/stubdompath.sh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 10 05:54:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Nov 2012 05:54:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TX40l-00014i-FE; Sat, 10 Nov 2012 05:53:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TX40k-00014d-Fp
	for xen-devel@lists.xensource.com; Sat, 10 Nov 2012 05:53:42 +0000
Received: from [85.158.139.83:7296] by server-15.bemta-5.messagelabs.com id
	65/54-26920-5EBED905; Sat, 10 Nov 2012 05:53:41 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1352526821!29900113!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgxMzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21566 invoked from network); 10 Nov 2012 05:53:41 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-10.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	10 Nov 2012 05:53:41 -0000
X-IronPort-AV: E=Sophos;i="4.80,750,1344211200"; d="scan'208";a="15716517"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	10 Nov 2012 05:53:36 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sat, 10 Nov 2012 05:53:36 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TX40e-00041l-7g;
	Sat, 10 Nov 2012 05:53:36 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TX40d-00061t-SZ;
	Sat, 10 Nov 2012 05:53:35 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14377-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sat, 10 Nov 2012 05:53:35 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14377: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14377 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14377/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14376
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14376
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14376
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14376

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  62885b3c34c8
baseline version:
 xen                  62885b3c34c8

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 10 05:54:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Nov 2012 05:54:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TX40l-00014i-FE; Sat, 10 Nov 2012 05:53:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TX40k-00014d-Fp
	for xen-devel@lists.xensource.com; Sat, 10 Nov 2012 05:53:42 +0000
Received: from [85.158.139.83:7296] by server-15.bemta-5.messagelabs.com id
	65/54-26920-5EBED905; Sat, 10 Nov 2012 05:53:41 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1352526821!29900113!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgxMzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21566 invoked from network); 10 Nov 2012 05:53:41 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-10.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	10 Nov 2012 05:53:41 -0000
X-IronPort-AV: E=Sophos;i="4.80,750,1344211200"; d="scan'208";a="15716517"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	10 Nov 2012 05:53:36 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sat, 10 Nov 2012 05:53:36 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TX40e-00041l-7g;
	Sat, 10 Nov 2012 05:53:36 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TX40d-00061t-SZ;
	Sat, 10 Nov 2012 05:53:35 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14377-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sat, 10 Nov 2012 05:53:35 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14377: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14377 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14377/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14376
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14376
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14376
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14376

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  62885b3c34c8
baseline version:
 xen                  62885b3c34c8

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 10 08:31:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Nov 2012 08:31:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TX6TC-0002HI-OK; Sat, 10 Nov 2012 08:31:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <juan@jelsupport.com>) id 1TWmVl-00019B-5e
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 11:12:33 +0000
Received: from [85.158.137.99:48742] by server-8.bemta-3.messagelabs.com id
	25/E3-07786-025EC905; Fri, 09 Nov 2012 11:12:32 +0000
X-Env-Sender: juan@jelsupport.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352459550!18305922!1
X-Originating-IP: [216.27.216.109]
X-SpamReason: No, hits=0.3 required=7.0 tests=HTML_60_70,HTML_MESSAGE
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14556 invoked from network); 9 Nov 2012 11:12:31 -0000
Received: from 109.216.27.216.static.ip.tnltd.net (HELO server.jel.local)
	(216.27.216.109) by server-14.tower-217.messagelabs.com with SMTP;
	9 Nov 2012 11:12:31 -0000
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Date: Fri, 9 Nov 2012 04:01:36 -0700
Message-ID: <F2EF84CA5BCF824AA4197956E124073848F4AE@server.jel.local>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: .vhd will not boot in VM
thread-index: Ac2+awC5nDBqeGW4SVy2ZUtsw2WP+g==
From: "Juan Lorenzana" <juan@jelsupport.com>
To: <xen-devel@lists.xen.org>
X-Mailman-Approved-At: Sat, 10 Nov 2012 08:31:14 +0000
Subject: [Xen-devel] .vhd will not boot in VM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1250336337164974587=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.

--===============1250336337164974587==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01CDBE69.965B71D2"

This is a multi-part message in MIME format.

------_=_NextPart_001_01CDBE69.965B71D2
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

We had a XCP 1.5 pool with 2 machines as hosts.  The storage pool which
as NFS mounted lost its ability to export the filesystem with the VM
images on it.

=20

We contacted the vendor and we were able to restore it.  However, they
had recommended that we delete the XCP Pool, recreate it, add the hosts
back in, and then mount the storage.

=20

That is where we are at now.  We can see the storage and the VM images.
However in XCP Xen Center when looking at the images is clear that the
metadata is lost.  So we can not see which image or snap shot belongs to
which VM.  The names all are blank when we look at the storage.

=20

Also, if I randomly mount an image to a VM, it does not boot.  It
produces an error that says:

=20

Traceback (most recent call last): - File "/usr/binpygrub", line 808, in
? - fs =3D fsimage.open(file,part_offs[0[, bootfsoptions) - IOError:
[Errno 95] Operation not supported.

=20

The system kept the VM information as we destroyed the pool and then
created a new one but it looks like we only see snapshots through
XenCenter.  Its like the real .vhd that were running are not showing up.

=20

I know it is pretty bad.  We should not have listened to the storage
guys. =20

=20

Does anyone know someone that can help?=20

=20

Juan


------_=_NextPart_001_01CDBE69.965B71D2
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=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii"><meta name=3DGenerator content=3D"Microsoft Word 14 =
(filtered medium)"><style><!--
/* Font Definitions */
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	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-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></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=3DEN-US link=3Dblue =
vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal>We had a =
XCP 1.5 pool with 2 machines as hosts.&nbsp; The storage pool which as =
NFS mounted lost its ability to export the filesystem with the VM images =
on it.<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal>We contacted the vendor and we were able to restore =
it.&nbsp; However, they had recommended that we delete the XCP Pool, =
recreate it, add the hosts back in, and then mount the =
storage.<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal>That is where we are at now.&nbsp; We can see the =
storage and the VM images.&nbsp; However in XCP Xen Center when looking =
at the images is clear that the metadata is lost.&nbsp; So we can not =
see which image or snap shot belongs to which VM.&nbsp; The names all =
are blank when we look at the storage.<o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>Also, if I =
randomly mount an image to a VM, it does not boot.&nbsp; It produces an =
error that says:<o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>Traceback =
(most recent call last): - File &#8220;/usr/binpygrub&#8221;, line 808, =
in ? &#8211; fs =3D fsimage.open(file,part_offs[0[, bootfsoptions) =
&#8211; IOError: [Errno 95] Operation not supported.<o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>The system =
kept the VM information as we destroyed the pool and then created a new =
one but it looks like we only see snapshots through XenCenter.&nbsp; Its =
like the real .vhd that were running are not showing =
up.<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal>I know it is pretty bad.&nbsp; We should not have =
listened to the storage guys.&nbsp; <o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>Does anyone =
know someone that can help? <o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal>Juan<o:p></o:p></p></div></body></html>
------_=_NextPart_001_01CDBE69.965B71D2--


--===============1250336337164974587==
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.xen.org
http://lists.xen.org/xen-devel

--===============1250336337164974587==--


From xen-devel-bounces@lists.xen.org Sat Nov 10 08:31:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Nov 2012 08:31:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TX6TC-0002HI-OK; Sat, 10 Nov 2012 08:31:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <juan@jelsupport.com>) id 1TWmVl-00019B-5e
	for xen-devel@lists.xen.org; Fri, 09 Nov 2012 11:12:33 +0000
Received: from [85.158.137.99:48742] by server-8.bemta-3.messagelabs.com id
	25/E3-07786-025EC905; Fri, 09 Nov 2012 11:12:32 +0000
X-Env-Sender: juan@jelsupport.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352459550!18305922!1
X-Originating-IP: [216.27.216.109]
X-SpamReason: No, hits=0.3 required=7.0 tests=HTML_60_70,HTML_MESSAGE
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14556 invoked from network); 9 Nov 2012 11:12:31 -0000
Received: from 109.216.27.216.static.ip.tnltd.net (HELO server.jel.local)
	(216.27.216.109) by server-14.tower-217.messagelabs.com with SMTP;
	9 Nov 2012 11:12:31 -0000
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Date: Fri, 9 Nov 2012 04:01:36 -0700
Message-ID: <F2EF84CA5BCF824AA4197956E124073848F4AE@server.jel.local>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: .vhd will not boot in VM
thread-index: Ac2+awC5nDBqeGW4SVy2ZUtsw2WP+g==
From: "Juan Lorenzana" <juan@jelsupport.com>
To: <xen-devel@lists.xen.org>
X-Mailman-Approved-At: Sat, 10 Nov 2012 08:31:14 +0000
Subject: [Xen-devel] .vhd will not boot in VM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1250336337164974587=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.

--===============1250336337164974587==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01CDBE69.965B71D2"

This is a multi-part message in MIME format.

------_=_NextPart_001_01CDBE69.965B71D2
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

We had a XCP 1.5 pool with 2 machines as hosts.  The storage pool which
as NFS mounted lost its ability to export the filesystem with the VM
images on it.

=20

We contacted the vendor and we were able to restore it.  However, they
had recommended that we delete the XCP Pool, recreate it, add the hosts
back in, and then mount the storage.

=20

That is where we are at now.  We can see the storage and the VM images.
However in XCP Xen Center when looking at the images is clear that the
metadata is lost.  So we can not see which image or snap shot belongs to
which VM.  The names all are blank when we look at the storage.

=20

Also, if I randomly mount an image to a VM, it does not boot.  It
produces an error that says:

=20

Traceback (most recent call last): - File "/usr/binpygrub", line 808, in
? - fs =3D fsimage.open(file,part_offs[0[, bootfsoptions) - IOError:
[Errno 95] Operation not supported.

=20

The system kept the VM information as we destroyed the pool and then
created a new one but it looks like we only see snapshots through
XenCenter.  Its like the real .vhd that were running are not showing up.

=20

I know it is pretty bad.  We should not have listened to the storage
guys. =20

=20

Does anyone know someone that can help?=20

=20

Juan


------_=_NextPart_001_01CDBE69.965B71D2
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=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii"><meta name=3DGenerator content=3D"Microsoft Word 14 =
(filtered medium)"><style><!--
/* Font Definitions */
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	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-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></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=3DEN-US link=3Dblue =
vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal>We had a =
XCP 1.5 pool with 2 machines as hosts.&nbsp; The storage pool which as =
NFS mounted lost its ability to export the filesystem with the VM images =
on it.<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal>We contacted the vendor and we were able to restore =
it.&nbsp; However, they had recommended that we delete the XCP Pool, =
recreate it, add the hosts back in, and then mount the =
storage.<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal>That is where we are at now.&nbsp; We can see the =
storage and the VM images.&nbsp; However in XCP Xen Center when looking =
at the images is clear that the metadata is lost.&nbsp; So we can not =
see which image or snap shot belongs to which VM.&nbsp; The names all =
are blank when we look at the storage.<o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>Also, if I =
randomly mount an image to a VM, it does not boot.&nbsp; It produces an =
error that says:<o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>Traceback =
(most recent call last): - File &#8220;/usr/binpygrub&#8221;, line 808, =
in ? &#8211; fs =3D fsimage.open(file,part_offs[0[, bootfsoptions) =
&#8211; IOError: [Errno 95] Operation not supported.<o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>The system =
kept the VM information as we destroyed the pool and then created a new =
one but it looks like we only see snapshots through XenCenter.&nbsp; Its =
like the real .vhd that were running are not showing =
up.<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal>I know it is pretty bad.&nbsp; We should not have =
listened to the storage guys.&nbsp; <o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>Does anyone =
know someone that can help? <o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal>Juan<o:p></o:p></p></div></body></html>
------_=_NextPart_001_01CDBE69.965B71D2--


--===============1250336337164974587==
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.xen.org
http://lists.xen.org/xen-devel

--===============1250336337164974587==--


From xen-devel-bounces@lists.xen.org Sat Nov 10 14:00:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Nov 2012 14:00:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXBb6-0003dE-DA; Sat, 10 Nov 2012 13:59:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TXBb4-0003d9-Vw
	for xen-devel@lists.xen.org; Sat, 10 Nov 2012 13:59:43 +0000
Received: from [85.158.139.83:7395] by server-16.bemta-5.messagelabs.com id
	3F/A2-04786-DCD5E905; Sat, 10 Nov 2012 13:59:41 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1352555979!29651600!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1NTg3MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24266 invoked from network); 10 Nov 2012 13:59:40 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-2.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 10 Nov 2012 13:59:40 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAADxZrf019766
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Sat, 10 Nov 2012 13:59:36 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAADxZej011086
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 10 Nov 2012 13:59:35 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAADxY5n008798; Sat, 10 Nov 2012 07:59:34 -0600
Received: from localhost.localdomain (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Sat, 10 Nov 2012 05:59:34 -0800
Date: Sat, 10 Nov 2012 08:59:32 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: annie.li@oracle.com, marcos.matsunaga@oracle.com, Ian.Campbell@citrix.com, 
	xen-devel@lists.xen.org
Message-ID: <20121110135931.GD23686@localhost.localdomain>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Subject: [Xen-devel] domU to domU networking issues in v3.7?
 (netserver/netperf failing to communicate)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hey Ian, Xen-devel mailingl list,

I think the issue of 70% traffic lost was actually introduced in v3.6 or
perhaps v3.5. Annie and Marcos (CC-ed here) are looking to see which of
the releases introduced this. The issue we are seeing is that a domU
to domU communication breaks - this is with netperf/netserver talking to
each other.

Anyhow, I think the 3.7 compound page exacerbated the problem and also
(at least on some of my test hardware) exposed existing issues with
drivers. The issue I have is that the 'skge' driver has a bug that has
been there for ages (I tested way back to 3.0 and still saw it) were it
can not work with SWIOTLB. It is probably missing an pci_dma_sync
somewhere. 

Anyhow the compound page got me to look at Xen-SWIOTLB and that looks
OK. Even with synthetic driver (the fake one I posted somewhere) it
dealt with compound pages properly (with debug or non-debug Xen
hypervisor).

So was wondering if you had looked at this in more details? Any
ideas? Or would it be more prudent to ask that once we know for sure
which Linux release introduced the communication failures between
guests?


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 10 14:00:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Nov 2012 14:00:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXBb6-0003dE-DA; Sat, 10 Nov 2012 13:59:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TXBb4-0003d9-Vw
	for xen-devel@lists.xen.org; Sat, 10 Nov 2012 13:59:43 +0000
Received: from [85.158.139.83:7395] by server-16.bemta-5.messagelabs.com id
	3F/A2-04786-DCD5E905; Sat, 10 Nov 2012 13:59:41 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1352555979!29651600!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1NTg3MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24266 invoked from network); 10 Nov 2012 13:59:40 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-2.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 10 Nov 2012 13:59:40 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAADxZrf019766
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Sat, 10 Nov 2012 13:59:36 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAADxZej011086
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 10 Nov 2012 13:59:35 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAADxY5n008798; Sat, 10 Nov 2012 07:59:34 -0600
Received: from localhost.localdomain (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Sat, 10 Nov 2012 05:59:34 -0800
Date: Sat, 10 Nov 2012 08:59:32 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: annie.li@oracle.com, marcos.matsunaga@oracle.com, Ian.Campbell@citrix.com, 
	xen-devel@lists.xen.org
Message-ID: <20121110135931.GD23686@localhost.localdomain>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Subject: [Xen-devel] domU to domU networking issues in v3.7?
 (netserver/netperf failing to communicate)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hey Ian, Xen-devel mailingl list,

I think the issue of 70% traffic lost was actually introduced in v3.6 or
perhaps v3.5. Annie and Marcos (CC-ed here) are looking to see which of
the releases introduced this. The issue we are seeing is that a domU
to domU communication breaks - this is with netperf/netserver talking to
each other.

Anyhow, I think the 3.7 compound page exacerbated the problem and also
(at least on some of my test hardware) exposed existing issues with
drivers. The issue I have is that the 'skge' driver has a bug that has
been there for ages (I tested way back to 3.0 and still saw it) were it
can not work with SWIOTLB. It is probably missing an pci_dma_sync
somewhere. 

Anyhow the compound page got me to look at Xen-SWIOTLB and that looks
OK. Even with synthetic driver (the fake one I posted somewhere) it
dealt with compound pages properly (with debug or non-debug Xen
hypervisor).

So was wondering if you had looked at this in more details? Any
ideas? Or would it be more prudent to ask that once we know for sure
which Linux release introduced the communication failures between
guests?


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 10 14:22:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Nov 2012 14:22:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXBwD-0003sP-AE; Sat, 10 Nov 2012 14:21:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bouyer@antioche.eu.org>) id 1TXBwC-0003sK-4P
	for xen-devel@lists.xen.org; Sat, 10 Nov 2012 14:21:32 +0000
Received: from [85.158.143.99:52945] by server-1.bemta-4.messagelabs.com id
	42/AB-27934-BE26E905; Sat, 10 Nov 2012 14:21:31 +0000
X-Env-Sender: bouyer@antioche.eu.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1352557290!24138153!1
X-Originating-IP: [132.227.60.30]
X-SpamReason: No, hits=0.7 required=7.0 tests=DATE_IN_PAST_03_06
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32709 invoked from network); 10 Nov 2012 14:21:30 -0000
Received: from osiris.lip6.fr (HELO osiris.lip6.fr) (132.227.60.30)
	by server-12.tower-216.messagelabs.com with SMTP;
	10 Nov 2012 14:21:30 -0000
Received: from tibre.lip6.fr (tibre.ipv6.lip6.fr
	[IPv6:2001:660:3302:282a:204:e2ff:fe09:d49f])
	by osiris.lip6.fr (8.14.5/lip6) with ESMTP id qAAELMlR008040
	; Sat, 10 Nov 2012 15:21:26 +0100 (CET)
X-pt: osiris.lip6.fr
Received: from baladeur.antioche.eu.org (sphinx [132.227.74.253])
	by tibre.lip6.fr (8.14.5/8.13.3) with ESMTP id qAAELBco004164;
	Sat, 10 Nov 2012 15:21:25 +0100 (MET)
Received: (from bouyer@localhost)
	by baladeur.antioche.eu.org (8.14.3/8.12.8/Submit) id qAAAjaTg001195;
	Sat, 10 Nov 2012 11:45:36 +0100 (CET)
Date: Sat, 10 Nov 2012 11:45:36 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Roger Pau Monne <roger.pau@citrix.com>
Message-ID: <20121110104536.GA1027@antioche.eu.org>
References: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-4.2.7
	(osiris.lip6.fr [IPv6:2001:660:3302:283c::1e]);
	Sat, 10 Nov 2012 15:21:26 +0100 (CET)
X-Scanned-By: MIMEDefang 2.73
Cc: port-xen@NetBSD.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: add persistent grants to xbd_xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sun, Nov 04, 2012 at 11:23:50PM +0100, Roger Pau Monne wrote:
> This patch implements persistent grants for xbd_xenbus (blkfront in
> Linux terminology). The effect of this change is to reduce the number
> of unmap operations performed, since they cause a (costly) TLB
> shootdown. This allows the I/O performance to scale better when a
> large number of VMs are performing I/O.
> 
> On startup xbd_xenbus notifies the backend driver that it is using
> persistent grants. If the backend driver is not capable of persistent
> mapping, xbd_xenbus will still use the same grants, since it is
> compatible with the previous protocol, and simplifies the code
> complexity in xbd_xenbus.
> 
> Each time a request is send to the backend driver, xbd_xenbus will
> check if there are free grants already mapped and will try to use one
> of those. If there are not enough grants already mapped, xbd_xenbus
> will request new grants, and they will be added to the list of free
> grants when the transaction is finished, so they can be reused. Data
> has to be copied from the request (struct buf) to the mapped grant, or
> from the mapped grant to the request, depending on the operation being
> performed.
> 
> To test the performance impact of this patch I've benchmarked the
> number of IOPS performed simultaneously by 15 NetBSD DomU guests on a
> Linux Dom0 that supports persistent grants. The backend used to
> perform this tests was a ramdisk of size 1GB.
> 
>                      Sum of IOPS
> Non-persistent            336718
> Persistent                686010
> 
> As seen, there's a x2 increase in the total number of IOPS being
> performed. As a reference, using exactly the same setup Linux DomUs
> are able to achieve 1102019 IOPS, so there's still plenty of room for
> improvement.

I'd like to see a similar test run against a NetBSD dom0. Also, how big
are your IOPs ?

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 10 14:22:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Nov 2012 14:22:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXBwD-0003sP-AE; Sat, 10 Nov 2012 14:21:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bouyer@antioche.eu.org>) id 1TXBwC-0003sK-4P
	for xen-devel@lists.xen.org; Sat, 10 Nov 2012 14:21:32 +0000
Received: from [85.158.143.99:52945] by server-1.bemta-4.messagelabs.com id
	42/AB-27934-BE26E905; Sat, 10 Nov 2012 14:21:31 +0000
X-Env-Sender: bouyer@antioche.eu.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1352557290!24138153!1
X-Originating-IP: [132.227.60.30]
X-SpamReason: No, hits=0.7 required=7.0 tests=DATE_IN_PAST_03_06
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32709 invoked from network); 10 Nov 2012 14:21:30 -0000
Received: from osiris.lip6.fr (HELO osiris.lip6.fr) (132.227.60.30)
	by server-12.tower-216.messagelabs.com with SMTP;
	10 Nov 2012 14:21:30 -0000
Received: from tibre.lip6.fr (tibre.ipv6.lip6.fr
	[IPv6:2001:660:3302:282a:204:e2ff:fe09:d49f])
	by osiris.lip6.fr (8.14.5/lip6) with ESMTP id qAAELMlR008040
	; Sat, 10 Nov 2012 15:21:26 +0100 (CET)
X-pt: osiris.lip6.fr
Received: from baladeur.antioche.eu.org (sphinx [132.227.74.253])
	by tibre.lip6.fr (8.14.5/8.13.3) with ESMTP id qAAELBco004164;
	Sat, 10 Nov 2012 15:21:25 +0100 (MET)
Received: (from bouyer@localhost)
	by baladeur.antioche.eu.org (8.14.3/8.12.8/Submit) id qAAAjaTg001195;
	Sat, 10 Nov 2012 11:45:36 +0100 (CET)
Date: Sat, 10 Nov 2012 11:45:36 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Roger Pau Monne <roger.pau@citrix.com>
Message-ID: <20121110104536.GA1027@antioche.eu.org>
References: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-4.2.7
	(osiris.lip6.fr [IPv6:2001:660:3302:283c::1e]);
	Sat, 10 Nov 2012 15:21:26 +0100 (CET)
X-Scanned-By: MIMEDefang 2.73
Cc: port-xen@NetBSD.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: add persistent grants to xbd_xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sun, Nov 04, 2012 at 11:23:50PM +0100, Roger Pau Monne wrote:
> This patch implements persistent grants for xbd_xenbus (blkfront in
> Linux terminology). The effect of this change is to reduce the number
> of unmap operations performed, since they cause a (costly) TLB
> shootdown. This allows the I/O performance to scale better when a
> large number of VMs are performing I/O.
> 
> On startup xbd_xenbus notifies the backend driver that it is using
> persistent grants. If the backend driver is not capable of persistent
> mapping, xbd_xenbus will still use the same grants, since it is
> compatible with the previous protocol, and simplifies the code
> complexity in xbd_xenbus.
> 
> Each time a request is send to the backend driver, xbd_xenbus will
> check if there are free grants already mapped and will try to use one
> of those. If there are not enough grants already mapped, xbd_xenbus
> will request new grants, and they will be added to the list of free
> grants when the transaction is finished, so they can be reused. Data
> has to be copied from the request (struct buf) to the mapped grant, or
> from the mapped grant to the request, depending on the operation being
> performed.
> 
> To test the performance impact of this patch I've benchmarked the
> number of IOPS performed simultaneously by 15 NetBSD DomU guests on a
> Linux Dom0 that supports persistent grants. The backend used to
> perform this tests was a ramdisk of size 1GB.
> 
>                      Sum of IOPS
> Non-persistent            336718
> Persistent                686010
> 
> As seen, there's a x2 increase in the total number of IOPS being
> performed. As a reference, using exactly the same setup Linux DomUs
> are able to achieve 1102019 IOPS, so there's still plenty of room for
> improvement.

I'd like to see a similar test run against a NetBSD dom0. Also, how big
are your IOPs ?

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 10 19:41:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Nov 2012 19:41:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXGvX-0005uJ-Mf; Sat, 10 Nov 2012 19:41:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TXGvW-0005uB-Du
	for xen-devel@lists.xen.org; Sat, 10 Nov 2012 19:41:10 +0000
Received: from [193.109.254.147:56290] by server-3.bemta-14.messagelabs.com id
	E1/2A-01317-5DDAE905; Sat, 10 Nov 2012 19:41:09 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1352576468!2725011!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.7 required=7.0 tests=DATE_IN_PAST_03_06
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19144 invoked from network); 10 Nov 2012 19:41:09 -0000
Received: from toccata.ens-lyon.org (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-7.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 10 Nov 2012 19:41:09 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 4F7B584094;
	Sat, 10 Nov 2012 20:41:08 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id cV1kXDIKDcCc; Sat, 10 Nov 2012 20:41:08 +0100 (CET)
Received: from type.ipv6 (unknown [38.121.228.2])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id 019168408C;
	Sat, 10 Nov 2012 20:41:08 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TXBTu-0002d1-FA; Sat, 10 Nov 2012 14:52:18 +0100
Date: Sat, 10 Nov 2012 14:52:18 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Xu Zhang <xzhang@cs.uic.edu>
Message-ID: <20121110135218.GA5436@type>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Xu Zhang <xzhang@cs.uic.edu>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	gm281@cam.ac.uk
References: <50871D90.50606@gmail.com> <20121025205653.GW5925@type.chello.at>
	<5098A674.5090203@cs.uic.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5098A674.5090203@cs.uic.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: gm281@cam.ac.uk, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Nested events in 64bit mini-OS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

Xu Zhang, le Mon 05 Nov 2012 23:56:04 -0600, a =E9crit :
> I haven't seen any updates on this matter, so I try to come up with a fix.

Thanks!

> Generally speaking, I want to mimic 32-bit mini-OS behaviour,

Ok. Probably a good thing :)

> The "git diff" output is attached to this email. I only did some naive
> "tests" by running it inside gdb.

Do you mean that you actually ran a stack merging, even if only in gdb?
I would trust that well enough.

> I am wondering is there a test suite for mini-OS?

You can simply run it, giving it a blk dev (or also a fb dev), it will
run app_main(), which keeps reading stuff, and draws squares on the fb.

Ideally you should manage to trigger fixups, by stuffing a wait loop in
the critical section.

> A follow-up question is that given this fix, do you still need
> hypercall iret?

Actually it's worse than that, see below.

> +	movq %rbx,5*8(%rsp)
...
> +
> +	# check against re-entrance
> +	movq RIP(%rsp),%rbx
> +	cmpq $scrit,%rbx
> +	jb 10f
> +	cmpq $ecrit,%rbx
> +	jb  critical_region_fixup
> +
> +10:	movq RBX(%rsp),%rbx			# restore rbx

Do we really need to restore %rbx?  I don't think do_hypervisor_callback
uses it.

> +    .byte 0x78,0x78,0x78,0x78,0x78            # jmp    hypercall_page + =
(__HYPERVISOR_iret * 32)

Here we would also need a fixup table for the code at hypercall_page!
A nicer fix would be to inline the hypercall code here.  That said, I
have to say I don't know any detail about the NMI flag, I don't see it
defined in the Intel manual, and I don't see it being set in the Xen
hypervisor.  Unless somebody knows more about it, I would assume that it
currently never happens, and simply stuff a

ud2 /* TODO: fix re-entrance fixup for hypercall in NMI case (when does tha=
t happen actually?) */

before the jmp, to catch it if it ever does happen.

Also, it would be good to check against critical section size change, in
case somebody e.g. changes a value, or a macro like XEN_PUT_VCPU_INFO.
For instance, stuff right after the table:

	.if (ecrit-scrit) !=3D (critical_fixup_table_end - critical_fixup_table)
	.error "The critical has changed, the fixup table needs updating"
	.endif

More generally, some cleanup could go along the patch, but I'd say
keep it as you have done, focused on only the fixup code, to have it
as such in the repository history, and then we could clean some things
afterwards.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 10 19:41:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Nov 2012 19:41:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXGvX-0005uJ-Mf; Sat, 10 Nov 2012 19:41:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TXGvW-0005uB-Du
	for xen-devel@lists.xen.org; Sat, 10 Nov 2012 19:41:10 +0000
Received: from [193.109.254.147:56290] by server-3.bemta-14.messagelabs.com id
	E1/2A-01317-5DDAE905; Sat, 10 Nov 2012 19:41:09 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1352576468!2725011!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.7 required=7.0 tests=DATE_IN_PAST_03_06
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19144 invoked from network); 10 Nov 2012 19:41:09 -0000
Received: from toccata.ens-lyon.org (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-7.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 10 Nov 2012 19:41:09 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 4F7B584094;
	Sat, 10 Nov 2012 20:41:08 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id cV1kXDIKDcCc; Sat, 10 Nov 2012 20:41:08 +0100 (CET)
Received: from type.ipv6 (unknown [38.121.228.2])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id 019168408C;
	Sat, 10 Nov 2012 20:41:08 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TXBTu-0002d1-FA; Sat, 10 Nov 2012 14:52:18 +0100
Date: Sat, 10 Nov 2012 14:52:18 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Xu Zhang <xzhang@cs.uic.edu>
Message-ID: <20121110135218.GA5436@type>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Xu Zhang <xzhang@cs.uic.edu>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	gm281@cam.ac.uk
References: <50871D90.50606@gmail.com> <20121025205653.GW5925@type.chello.at>
	<5098A674.5090203@cs.uic.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <5098A674.5090203@cs.uic.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: gm281@cam.ac.uk, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Nested events in 64bit mini-OS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

Xu Zhang, le Mon 05 Nov 2012 23:56:04 -0600, a =E9crit :
> I haven't seen any updates on this matter, so I try to come up with a fix.

Thanks!

> Generally speaking, I want to mimic 32-bit mini-OS behaviour,

Ok. Probably a good thing :)

> The "git diff" output is attached to this email. I only did some naive
> "tests" by running it inside gdb.

Do you mean that you actually ran a stack merging, even if only in gdb?
I would trust that well enough.

> I am wondering is there a test suite for mini-OS?

You can simply run it, giving it a blk dev (or also a fb dev), it will
run app_main(), which keeps reading stuff, and draws squares on the fb.

Ideally you should manage to trigger fixups, by stuffing a wait loop in
the critical section.

> A follow-up question is that given this fix, do you still need
> hypercall iret?

Actually it's worse than that, see below.

> +	movq %rbx,5*8(%rsp)
...
> +
> +	# check against re-entrance
> +	movq RIP(%rsp),%rbx
> +	cmpq $scrit,%rbx
> +	jb 10f
> +	cmpq $ecrit,%rbx
> +	jb  critical_region_fixup
> +
> +10:	movq RBX(%rsp),%rbx			# restore rbx

Do we really need to restore %rbx?  I don't think do_hypervisor_callback
uses it.

> +    .byte 0x78,0x78,0x78,0x78,0x78            # jmp    hypercall_page + =
(__HYPERVISOR_iret * 32)

Here we would also need a fixup table for the code at hypercall_page!
A nicer fix would be to inline the hypercall code here.  That said, I
have to say I don't know any detail about the NMI flag, I don't see it
defined in the Intel manual, and I don't see it being set in the Xen
hypervisor.  Unless somebody knows more about it, I would assume that it
currently never happens, and simply stuff a

ud2 /* TODO: fix re-entrance fixup for hypercall in NMI case (when does tha=
t happen actually?) */

before the jmp, to catch it if it ever does happen.

Also, it would be good to check against critical section size change, in
case somebody e.g. changes a value, or a macro like XEN_PUT_VCPU_INFO.
For instance, stuff right after the table:

	.if (ecrit-scrit) !=3D (critical_fixup_table_end - critical_fixup_table)
	.error "The critical has changed, the fixup table needs updating"
	.endif

More generally, some cleanup could go along the patch, but I'd say
keep it as you have done, focused on only the fixup code, to have it
as such in the repository history, and then we could clean some things
afterwards.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 10 19:43:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Nov 2012 19:43:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXGx7-0005yM-6Q; Sat, 10 Nov 2012 19:42:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <blistovmhz@gmail.com>) id 1TXGx5-0005y9-4n
	for xen-devel@lists.xen.org; Sat, 10 Nov 2012 19:42:47 +0000
Received: from [85.158.143.35:20865] by server-2.bemta-4.messagelabs.com id
	50/86-28922-63EAE905; Sat, 10 Nov 2012 19:42:46 +0000
X-Env-Sender: blistovmhz@gmail.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1352576562!17158274!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14335 invoked from network); 10 Nov 2012 19:42:43 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	10 Nov 2012 19:42:43 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl15so6047816vcb.32
	for <xen-devel@lists.xen.org>; Sat, 10 Nov 2012 11:42:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=5yyyWY3RJnFqL+A3SpP7XLzL08nx9V3PwxPS3ofcR8E=;
	b=EQQskPvU/MTVEjPVnA2YrN+au0nH285gAa9pcT44MjrGURO6XoyT0KTlv/oTbE0Nze
	sLDxdZ0tH/2OC7iKkN7n5r6oMc6P7/snqX7KfRfkTi+2i3SAY4Ns6bVguQnTUSp/tPOo
	Q5SlPVfbDd3AsfOVNgniB80u72B/L0sqNqzaojxdOdc1xxs4XnUPFBeWuF2SlQtItGRZ
	O3nxTCRkq8as4VpU9woKuuzA/G8uinLiu0fvHRef7GykNpqGa1li/UGRiOGMA9hM0uxz
	gxBXluIZpnaoDv9fEAGKhrETvEpTwip/O6aDDx2iZMPpFQVwZtfXwNgLo+Fw9wvry8Ng
	J1Xw==
MIME-Version: 1.0
Received: by 10.58.162.130 with SMTP id ya2mr11907149veb.2.1352576562572; Sat,
	10 Nov 2012 11:42:42 -0800 (PST)
Received: by 10.220.37.8 with HTTP; Sat, 10 Nov 2012 11:42:42 -0800 (PST)
In-Reply-To: <mailman.5.1352548802.11332.xen-devel@lists.xen.org>
References: <mailman.5.1352548802.11332.xen-devel@lists.xen.org>
Date: Sat, 10 Nov 2012 11:42:42 -0800
Message-ID: <CAN3GA=SiufUOi977SpWj+FGd9WdZUBtAoG18xUpQdSmr4g-boA@mail.gmail.com>
From: feral <blistovmhz@gmail.com>
To: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Xen-devel Digest, Vol 93, Issue 79
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1728157406802910382=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============1728157406802910382==
Content-Type: multipart/alternative; boundary=047d7b6766dc8b2e6104ce294575

--047d7b6766dc8b2e6104ce294575
Content-Type: text/plain; charset=ISO-8859-1

Re: PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
      IO_PAGE_FAULT: (Hans Mueller)
OMG, why do most messages only show up in the daily batch but not
individually?

@Hans
As far as I can tell, the guest is running fine until we see the IO_PAGE_FAULT.
 The machine is still pingable, but I suppose there's not much I can do to
verify the DomU's state.
Going to try running the newer qemu with Xen 4.1 and then Xen-4.2/4.3 with
the older qemu-dm today.


On Sat, Nov 10, 2012 at 4:00 AM, <xen-devel-request@lists.xen.org> wrote:

> Send Xen-devel mailing list submissions to
>         xen-devel@lists.xen.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel
> or, via email, send a message with subject or body 'help' to
>         xen-devel-request@lists.xen.org
>
> You can reach the person managing the list at
>         xen-devel-owner@lists.xen.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Xen-devel digest..."
>
>
> Today's Topics:
>
>    1. Re: PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
>       IO_PAGE_FAULT: (Hans Mueller)
>    2. Re: Dom0 physical networking/swiotlb/something issue in
>       3.7-rc1 (Jan Beulich)
>    3. Re: Bugs in xl that affect stubdom+tapdisk2, and others
>       (Matt Wilson)
>    4. [xen-unstable test] 14377: tolerable FAIL (xen.org)
>    5. .vhd will not boot in VM (Juan Lorenzana)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 09 Nov 2012 18:14:39 +0100
> From: Hans Mueller <mcbeagle@gmx.de>
> To: xen-devel@lists.xen.org
> Subject: Re: [Xen-devel] PCI/VGA passthrough on >Xen-4.2 - (XEN)
>         AMD-Vi: IO_PAGE_FAULT:
> Message-ID: <1871003.0Pup8WfsfS@sheik-lin>
> Content-Type: text/plain; charset="us-ascii"
>
> On Friday, 9. November 2012 16:33:47 Ian Campbell wrote:
> > On Fri, 2012-11-09 at 16:25 +0000, Hans Mueller wrote:
> > > On Thursday, 8. November 2012 20:02:51 feral wrote:
> > > > Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable.  Tested against all
> > > > three.
> > > >
> > > > VGA passthrough previously working with 4.1 is no longer working with
> > > > >4.2.
> > > >
> > > > Setup - Working:
> > > > Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos),
> > > > libvirt-bin,
> > > > xend
> > > > Asus Radeon HD 7870 DirectCU.
> > > > Works perfect.  Benches on par with bare metal.
> > > >
> > > > Setup - Broken:
> > > > Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (from
> GIT), xl
> > > > toolstack.
> > > > Asus Radeon HD 7870 DirectCU.
> > > > Some times the guest boots correctly but display is never enabled.
> > > >
> > > >  Sometimes BSOD, doesn't seem to be any rhyme or reason?
> > > >
> > > > No errors in logs.   Found the following in 'xl dmesg':
> > > > (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 2, device id = 0x600, fault
> > > > address =
> > > > 0x1ac800000, flags = 0
> > >
> > > I had a similar problem since hg revision 25818:50adc933faaf which
> changes
> > > the qemu tag.
> > > It looks like the qemu commit
> > > 3e66da7266c84638c0e22a09c9d2b07529802576
> > > (qemu-xen-trad: fix msi_translate with PV event delivery)
> > > causes this behavior.
> > >
> > > I solved the problem for me by using 'pci_msitranslate=0' in the domU
> > > config.
> > I don't follow this stuff closely but I could have sworn we had disabled
> > msitranslate by default.
> >
> > In any case I don't think that changeset was intended to cause anything
> > like this -- Stefano?
> >
> > > In addition I had to reboot (perhaps poweroff?) the dom0 once the
> > > IO_PAGE_FAULT occured.
>
> One more info for you - afair i noticed that it was not only the
> IO_PAGE_FAULT
> which occured but also the qemu process in dom0 crashed w/o any messages in
> the logs, perhaps feral can confirm this?
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 09 Nov 2012 17:34:35 +0000
> From: "Jan Beulich" <jbeulich@suse.com>
> To: <konrad.wilk@oracle.com>
> Cc: Ian.Campbell@citrix.com, xen-devel@lists.xen.org
> Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something
>         issue in 3.7-rc1
> Message-ID: <509D3EAB020000780008F4B6@nat28.tlf.novell.com>
> Content-Type: text/plain; charset=US-ASCII
>
> >>> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> 11/09/12 2:48 PM >>>
> >On Fri, Nov 09, 2012 at 11:43:39AM +0000, Jan Beulich wrote:
> >> >>> On 09.11.12 at 11:36, "Jan Beulich" <JBeulich@suse.com> wrote:
> >> > In the forward ported kernels, those two checks are however
> >> > accompanied by range_needs_mapping() (aka
> >> > range_straddles_page_boundary()) checks, which ought to
> >> > take care of this. There is brokenness there with the invocations
> >> > of gnttab_dma_map_page(), but only if the initial offset is at
> >> > least PAGE_SIZE - will have to check whether that occurs.
> >>
> >> And indeed, fixing this also makes the problem go away when
> >> the allocation order doesn't get forced to zero. So presumably
> >> there's also only that one problem I had pointed out in pv-ops.
> >
> >The pvops one has this in the map-page variant (xen_swiotlb_map_page):
> >
> >351         if (dma_capable(dev, dev_addr, size) &&
> >352             !range_straddles_page_boundary(phys, size) &&
> !swiotlb_force)
> >353                 return dev_addr;
> >
> >and in the sg variant:
> >
> >494                 if (swiotlb_force ||
> >495                     !dma_capable(hwdev, dev_addr, sg->length) ||
> >496                     range_straddles_page_boundary(paddr, sg->length))
> {
> >497                         void *map = swiotlb_tbl_map_single(hwdev,
>
> Oh, right, I forgot that there's yet another clone of that code under
> drivers/xen/.
>
> >So I think that check is OK. There is no gnttab_dma_map_page call - so
> that
> >can't be the issue.
>
> Indeed.
>
> Jan
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 9 Nov 2012 11:55:55 -0800
> From: Matt Wilson <msw@amazon.com>
> To: Ian Campbell <Ian.Campbell@citrix.com>
> Cc: "george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>,
>         "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
>        John
>         Weekes <lists.xen@nuclearfallout.net>,  Roger Pau Monne
>         <roger.pau@citrix.com>
> Subject: Re: [Xen-devel] Bugs in xl that affect stubdom+tapdisk2, and
>         others
> Message-ID:
>         <20121109195553.GA11023@u109add4315675089e695.ant.amazon.com>
> Content-Type: text/plain; charset="us-ascii"
>
> On Fri, Nov 09, 2012 at 01:29:04PM +0000, Ian Campbell wrote:
> > On Thu, 2012-11-08 at 20:45 +0000, John Weekes wrote:
> > > As an additional note about 4.2 -- this isn't an "xl" issue, but rather
> > > a build problem -- even though I use "./configure --libdir=/usr/lib64",
> > > the build is still creating a "dist/install/usr/lib" directory, and
> > > because of this, running ./install.sh nukes my system's "/usr/lib" ->
> > > "/usr/lib64" softlink (which in turn causes all sorts of other problems
> > > until it's corrected). Files that are being put in that tree:
> > >
> > > xen-4.2-testing.hg # find dist/install/usr/lib
> > > dist/install/usr/lib
> >
> > This is an interesting one. I'm not sure how we can avoid this
> > behaviour, perhaps there is a tar option to cause it to follow rather
> > than clobber synlinks?
> >
> > The only other choice I can think of is to change install.sh to use a
> > (long) explicit list of $(FOO_DIR)/* entries instead of the single * to
> > avoid including system directories, or to otherwise make install.sh more
> > fragile and prone to bitrot :-(
>
> Oh dear. If we find that there's not a good reason for it anymore, I'd
> think it would be better to remove install.sh instead.
>
> > I must confess I didn't realise anyone used install.sh -- is there some
> > advantage to it over make foo-install?
> >
> > OOI which distro has this lib->lib64 link and what issues does removing
> > it create?
> >
> > > dist/install/usr/lib/xen
> >
> > This is $(XENFIRMWAREDIR). I have a feeling there is a reason this is
> > not using $(LIBDIR), but I don't recall what it was -- Roget/Matt do you
> > remember?
>
> There's no need for these files to be multilib compatible, as they are
> not runtime DSOs. They're internal to Xen and I think that they should
> be moved to $LIBEXECDIR instead, like /usr/libexec/xen/. Unfortunately
> there's not much agreement on the usefulness of /usr/libexec, so we'll
> need to make sure that packagers can adjust the paths for their
> systems' standards.
>
> For 4.2 we didn't want to change where these files were being placed,
> and I believe they've bin in $PREFIX/lib/ for quite some time.
>
> Matt
>
> > Thanks again for reporting all these.
> >
> > Ian.
> >
> > > dist/install/usr/lib/xen/boot
> > > dist/install/usr/lib/xen/boot/xenstore-stubdom.gz
> > > dist/install/usr/lib/xen/boot/ioemu-stubdom.gz
> > > dist/install/usr/lib/xen/boot/pv-grub-x86_64.gz
> > > dist/install/usr/lib/xen/boot/hvmloader
> > > dist/install/usr/lib/xen/boot/pv-grub-x86_32.gz
> > > dist/install/usr/lib/xen/bin
> > > dist/install/usr/lib/xen/bin/stubdom-dm
> > > dist/install/usr/lib/xen/bin/qemu-io
> > > dist/install/usr/lib/xen/bin/qemu-nbd
> > > dist/install/usr/lib/xen/bin/qemu-img
> > > dist/install/usr/lib/xen/bin/xenpaging
> > > dist/install/usr/lib/xen/bin/qemu-dm
> > > dist/install/usr/lib/xen/bin/qemu-system-i386
> > > dist/install/usr/lib/xen/bin/qemu-ga
> > > dist/install/usr/lib/xen/bin/stubdompath.sh
>
>
>
> ------------------------------
>
> Message: 4
> Date: Sat, 10 Nov 2012 05:53:35 +0000
> From: xen.org <ian.jackson@eu.citrix.com>
> To: <xen-devel@lists.xensource.com>
> Cc: ian.jackson@eu.citrix.com
> Subject: [Xen-devel] [xen-unstable test] 14377: tolerable FAIL
> Message-ID: <osstest-14377-mainreport@xen.org>
> Content-Type: text/plain
>
> flight 14377 xen-unstable real [real]
> http://www.chiark.greenend.org.uk/~xensrcts/logs/14377/
>
> Failures :-/ but no regressions.
>
> Regressions which are regarded as allowable (not blocking):
>  test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like
> 14376
>  test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like
> 14376
>  test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like
> 14376
>  test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like
> 14376
>
> Tests which did not succeed, but are not blocking:
>  test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never
> pass
>  test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never
> pass
>  test-amd64-i386-win          16 leak-check/check             fail   never
> pass
>  test-amd64-amd64-win         16 leak-check/check             fail   never
> pass
>  test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never
> pass
>  test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never
> pass
>  test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never
> pass
>  test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never
> pass
>  test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never
> pass
>  test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never
> pass
>  test-amd64-amd64-xl-win      13 guest-stop                   fail   never
> pass
>
> version targeted for testing:
>  xen                  62885b3c34c8
> baseline version:
>  xen                  62885b3c34c8
>
> jobs:
>  build-amd64                                                  pass
>  build-i386                                                   pass
>  build-amd64-oldkern                                          pass
>  build-i386-oldkern                                           pass
>  build-amd64-pvops                                            pass
>  build-i386-pvops                                             pass
>  test-amd64-amd64-xl                                          pass
>  test-amd64-i386-xl                                           pass
>  test-amd64-i386-rhel6hvm-amd                                 pass
>  test-amd64-i386-qemuu-rhel6hvm-amd                           pass
>  test-amd64-amd64-xl-qemuu-win7-amd64                         fail
>  test-amd64-amd64-xl-win7-amd64                               fail
>  test-amd64-i386-xl-win7-amd64                                fail
>  test-amd64-i386-xl-credit2                                   pass
>  test-amd64-amd64-xl-pcipt-intel                              fail
>  test-amd64-i386-rhel6hvm-intel                               pass
>  test-amd64-i386-qemuu-rhel6hvm-intel                         pass
>  test-amd64-i386-xl-multivcpu                                 pass
>  test-amd64-amd64-pair                                        pass
>  test-amd64-i386-pair                                         pass
>  test-amd64-amd64-xl-sedf-pin                                 fail
>  test-amd64-amd64-pv                                          pass
>  test-amd64-i386-pv                                           pass
>  test-amd64-amd64-xl-sedf                                     fail
>  test-amd64-i386-win-vcpus1                                   fail
>  test-amd64-i386-xl-win-vcpus1                                fail
>  test-amd64-i386-xl-winxpsp3-vcpus1                           fail
>  test-amd64-amd64-win                                         fail
>  test-amd64-i386-win                                          fail
>  test-amd64-amd64-xl-win                                      fail
>  test-amd64-amd64-xl-qemuu-winxpsp3                           fail
>  test-amd64-i386-xend-winxpsp3                                fail
>  test-amd64-amd64-xl-winxpsp3                                 fail
>
>
> ------------------------------------------------------------
> sg-report-flight on woking.cam.xci-test.com
> logs: /home/xc_osstest/logs
> images: /home/xc_osstest/images
>
> Logs, config files, etc. are available at
>     http://www.chiark.greenend.org.uk/~xensrcts/logs
>
> Test harness code can be found at
>     http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary
>
>
> Published tested tree is already up to date.
>
>
>
>
> ------------------------------
>
> Message: 5
> Date: Fri, 9 Nov 2012 04:01:36 -0700
> From: "Juan Lorenzana" <juan@jelsupport.com>
> To: <xen-devel@lists.xen.org>
> Subject: [Xen-devel] .vhd will not boot in VM
> Message-ID: <F2EF84CA5BCF824AA4197956E124073848F4AE@server.jel.local>
> Content-Type: text/plain; charset="us-ascii"
>
> We had a XCP 1.5 pool with 2 machines as hosts.  The storage pool which
> as NFS mounted lost its ability to export the filesystem with the VM
> images on it.
>
>
>
> We contacted the vendor and we were able to restore it.  However, they
> had recommended that we delete the XCP Pool, recreate it, add the hosts
> back in, and then mount the storage.
>
>
>
> That is where we are at now.  We can see the storage and the VM images.
> However in XCP Xen Center when looking at the images is clear that the
> metadata is lost.  So we can not see which image or snap shot belongs to
> which VM.  The names all are blank when we look at the storage.
>
>
>
> Also, if I randomly mount an image to a VM, it does not boot.  It
> produces an error that says:
>
>
>
> Traceback (most recent call last): - File "/usr/binpygrub", line 808, in
> ? - fs = fsimage.open(file,part_offs[0[, bootfsoptions) - IOError:
> [Errno 95] Operation not supported.
>
>
>
> The system kept the VM information as we destroyed the pool and then
> created a new one but it looks like we only see snapshots through
> XenCenter.  Its like the real .vhd that were running are not showing up.
>
>
>
> I know it is pretty bad.  We should not have listened to the storage
> guys.
>
>
>
> Does anyone know someone that can help?
>
>
>
> Juan
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.xen.org/archives/html/xen-devel/attachments/20121109/a085ab22/attachment.html
> >
>
> ------------------------------
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>
> End of Xen-devel Digest, Vol 93, Issue 79
> *****************************************
>



-- 
_____
Fact:
1. Ninjas are mammals.
2. Ninjas fight ALL the time.
3. The purpose of the ninja is to flip out and kill people.

--047d7b6766dc8b2e6104ce294575
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<span style=3D"font-family:arial,sans-serif;font-size:13px">Re: PCI/VGA pas=
sthrough on &gt;Xen-4.2 - (XEN) AMD-Vi:</span><br style=3D"font-family:aria=
l,sans-serif;font-size:13px"><span style=3D"font-family:arial,sans-serif;fo=
nt-size:13px">=A0 =A0 =A0 IO_PAGE_FAULT: (Hans Mueller)</span><br>

<div><span style=3D"font-family:arial,sans-serif;font-size:13px">OMG, why d=
o most messages only show up in the daily batch but not individually?</span=
></div><div><span style=3D"font-family:arial,sans-serif;font-size:13px"><br=
>
</span></div><div><span style=3D"font-family:arial,sans-serif;font-size:13p=
x">@Hans</span></div><div><span style=3D"font-family:arial,sans-serif;font-=
size:13px">As far as I can tell, the guest is running fine until we see the=
=A0</span><font face=3D"arial, sans-serif">IO_PAGE_FAULT. =A0The machine is=
 still pingable, but I suppose there&#39;s not much I can do to verify the =
DomU&#39;s state.</font></div>
<div><font face=3D"arial, sans-serif">Going to try running the newer qemu w=
ith Xen 4.1 and then Xen-4.2/4.3 with the older qemu-dm today.</font></div>
<div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Sat, Nov 1=
0, 2012 at 4:00 AM,  <span dir=3D"ltr">&lt;<a href=3D"mailto:xen-devel-requ=
est@lists.xen.org" target=3D"_blank">xen-devel-request@lists.xen.org</a>&gt=
;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">Send Xen-devel mailing list submissions to<b=
r>
=A0 =A0 =A0 =A0 <a href=3D"mailto:xen-devel@lists.xen.org">xen-devel@lists.=
xen.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
=A0 =A0 =A0 =A0 <a href=3D"http://lists.xen.org/cgi-bin/mailman/listinfo/xe=
n-devel" target=3D"_blank">http://lists.xen.org/cgi-bin/mailman/listinfo/xe=
n-devel</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
=A0 =A0 =A0 =A0 <a href=3D"mailto:xen-devel-request@lists.xen.org">xen-deve=
l-request@lists.xen.org</a><br>
<br>
You can reach the person managing the list at<br>
=A0 =A0 =A0 =A0 <a href=3D"mailto:xen-devel-owner@lists.xen.org">xen-devel-=
owner@lists.xen.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of Xen-devel digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
=A0 =A01. Re: PCI/VGA passthrough on &gt;Xen-4.2 - (XEN) AMD-Vi:<br>
=A0 =A0 =A0 IO_PAGE_FAULT: (Hans Mueller)<br>
=A0 =A02. Re: Dom0 physical networking/swiotlb/something issue in<br>
=A0 =A0 =A0 3.7-rc1 (Jan Beulich)<br>
=A0 =A03. Re: Bugs in xl that affect stubdom+tapdisk2, and others<br>
=A0 =A0 =A0 (Matt Wilson)<br>
=A0 =A04. [xen-unstable test] 14377: tolerable FAIL (<a href=3D"http://xen.=
org" target=3D"_blank">xen.org</a>)<br>
=A0 =A05. .vhd will not boot in VM (Juan Lorenzana)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Fri, 09 Nov 2012 18:14:39 +0100<br>
From: Hans Mueller &lt;<a href=3D"mailto:mcbeagle@gmx.de">mcbeagle@gmx.de</=
a>&gt;<br>
To: <a href=3D"mailto:xen-devel@lists.xen.org">xen-devel@lists.xen.org</a><=
br>
Subject: Re: [Xen-devel] PCI/VGA passthrough on &gt;Xen-4.2 - (XEN)<br>
=A0 =A0 =A0 =A0 AMD-Vi: IO_PAGE_FAULT:<br>
Message-ID: &lt;1871003.0Pup8WfsfS@sheik-lin&gt;<br>
Content-Type: text/plain; charset=3D&quot;us-ascii&quot;<br>
<br>
On Friday, 9. November 2012 16:33:47 Ian Campbell wrote:<br>
&gt; On Fri, 2012-11-09 at 16:25 +0000, Hans Mueller wrote:<br>
&gt; &gt; On Thursday, 8. November 2012 20:02:51 feral wrote:<br>
&gt; &gt; &gt; Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable. =A0Tested aga=
inst all<br>
&gt; &gt; &gt; three.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; VGA passthrough previously working with 4.1 is no longer wor=
king with<br>
&gt; &gt; &gt; &gt;4.2.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Setup - Working:<br>
&gt; &gt; &gt; Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos)=
,<br>
&gt; &gt; &gt; libvirt-bin,<br>
&gt; &gt; &gt; xend<br>
&gt; &gt; &gt; Asus Radeon HD 7870 DirectCU.<br>
&gt; &gt; &gt; Works perfect. =A0Benches on par with bare metal.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Setup - Broken:<br>
&gt; &gt; &gt; Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (f=
rom GIT), xl<br>
&gt; &gt; &gt; toolstack.<br>
&gt; &gt; &gt; Asus Radeon HD 7870 DirectCU.<br>
&gt; &gt; &gt; Some times the guest boots correctly but display is never en=
abled.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; =A0Sometimes BSOD, doesn&#39;t seem to be any rhyme or reaso=
n?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; No errors in logs. =A0 Found the following in &#39;xl dmesg&=
#39;:<br>
&gt; &gt; &gt; (XEN) AMD-Vi: IO_PAGE_FAULT: domain =3D 2, device id =3D 0x6=
00, fault<br>
&gt; &gt; &gt; address =3D<br>
&gt; &gt; &gt; 0x1ac800000, flags =3D 0<br>
&gt; &gt;<br>
&gt; &gt; I had a similar problem since hg revision 25818:50adc933faaf whic=
h changes<br>
&gt; &gt; the qemu tag.<br>
&gt; &gt; It looks like the qemu commit<br>
&gt; &gt; 3e66da7266c84638c0e22a09c9d2b07529802576<br>
&gt; &gt; (qemu-xen-trad: fix msi_translate with PV event delivery)<br>
&gt; &gt; causes this behavior.<br>
&gt; &gt;<br>
&gt; &gt; I solved the problem for me by using &#39;pci_msitranslate=3D0&#3=
9; in the domU<br>
&gt; &gt; config.<br>
&gt; I don&#39;t follow this stuff closely but I could have sworn we had di=
sabled<br>
&gt; msitranslate by default.<br>
&gt;<br>
&gt; In any case I don&#39;t think that changeset was intended to cause any=
thing<br>
&gt; like this -- Stefano?<br>
&gt;<br>
&gt; &gt; In addition I had to reboot (perhaps poweroff?) the dom0 once the=
<br>
&gt; &gt; IO_PAGE_FAULT occured.<br>
<br>
One more info for you - afair i noticed that it was not only the IO_PAGE_FA=
ULT<br>
which occured but also the qemu process in dom0 crashed w/o any messages in=
<br>
the logs, perhaps feral can confirm this?<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Fri, 09 Nov 2012 17:34:35 +0000<br>
From: &quot;Jan Beulich&quot; &lt;<a href=3D"mailto:jbeulich@suse.com">jbeu=
lich@suse.com</a>&gt;<br>
To: &lt;<a href=3D"mailto:konrad.wilk@oracle.com">konrad.wilk@oracle.com</a=
>&gt;<br>
Cc: <a href=3D"mailto:Ian.Campbell@citrix.com">Ian.Campbell@citrix.com</a>,=
 <a href=3D"mailto:xen-devel@lists.xen.org">xen-devel@lists.xen.org</a><br>
Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something<br>
=A0 =A0 =A0 =A0 issue in 3.7-rc1<br>
Message-ID: &lt;<a href=3D"mailto:509D3EAB020000780008F4B6@nat28.tlf.novell=
.com">509D3EAB020000780008F4B6@nat28.tlf.novell.com</a>&gt;<br>
Content-Type: text/plain; charset=3DUS-ASCII<br>
<br>
&gt;&gt;&gt; Konrad Rzeszutek Wilk &lt;<a href=3D"mailto:konrad.wilk@oracle=
.com">konrad.wilk@oracle.com</a>&gt; 11/09/12 2:48 PM &gt;&gt;&gt;<br>
&gt;On Fri, Nov 09, 2012 at 11:43:39AM +0000, Jan Beulich wrote:<br>
&gt;&gt; &gt;&gt;&gt; On 09.11.12 at 11:36, &quot;Jan Beulich&quot; &lt;<a =
href=3D"mailto:JBeulich@suse.com">JBeulich@suse.com</a>&gt; wrote:<br>
&gt;&gt; &gt; In the forward ported kernels, those two checks are however<b=
r>
&gt;&gt; &gt; accompanied by range_needs_mapping() (aka<br>
&gt;&gt; &gt; range_straddles_page_boundary()) checks, which ought to<br>
&gt;&gt; &gt; take care of this. There is brokenness there with the invocat=
ions<br>
&gt;&gt; &gt; of gnttab_dma_map_page(), but only if the initial offset is a=
t<br>
&gt;&gt; &gt; least PAGE_SIZE - will have to check whether that occurs.<br>
&gt;&gt;<br>
&gt;&gt; And indeed, fixing this also makes the problem go away when<br>
&gt;&gt; the allocation order doesn&#39;t get forced to zero. So presumably=
<br>
&gt;&gt; there&#39;s also only that one problem I had pointed out in pv-ops=
.<br>
&gt;<br>
&gt;The pvops one has this in the map-page variant (xen_swiotlb_map_page):<=
br>
&gt;<br>
&gt;351 =A0 =A0 =A0 =A0 if (dma_capable(dev, dev_addr, size) &amp;&amp;<br>
&gt;352 =A0 =A0 =A0 =A0 =A0 =A0 !range_straddles_page_boundary(phys, size) =
&amp;&amp; !swiotlb_force)<br>
&gt;353 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return dev_addr;<br>
&gt;<br>
&gt;and in the sg variant:<br>
&gt;<br>
&gt;494 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (swiotlb_force ||<br>
&gt;495 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 !dma_capable(hwdev, dev_add=
r, sg-&gt;length) ||<br>
&gt;496 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 range_straddles_page_bounda=
ry(paddr, sg-&gt;length)) {<br>
&gt;497 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *map =3D swiot=
lb_tbl_map_single(hwdev,<br>
<br>
Oh, right, I forgot that there&#39;s yet another clone of that code under d=
rivers/xen/.<br>
<br>
&gt;So I think that check is OK. There is no gnttab_dma_map_page call - so =
that<br>
&gt;can&#39;t be the issue.<br>
<br>
Indeed.<br>
<br>
Jan<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Fri, 9 Nov 2012 11:55:55 -0800<br>
From: Matt Wilson &lt;<a href=3D"mailto:msw@amazon.com">msw@amazon.com</a>&=
gt;<br>
To: Ian Campbell &lt;<a href=3D"mailto:Ian.Campbell@citrix.com">Ian.Campbel=
l@citrix.com</a>&gt;<br>
Cc: &quot;<a href=3D"mailto:george.dunlap@eu.citrix.com">george.dunlap@eu.c=
itrix.com</a>&quot; &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">geor=
ge.dunlap@eu.citrix.com</a>&gt;,<br>
=A0 =A0 =A0 =A0 &quot;<a href=3D"mailto:xen-devel@lists.xensource.com">xen-=
devel@lists.xensource.com</a>&quot; &lt;<a href=3D"mailto:xen-devel@lists.x=
ensource.com">xen-devel@lists.xensource.com</a>&gt;, =A0 =A0 =A0 =A0John<br=
>
=A0 =A0 =A0 =A0 Weekes &lt;<a href=3D"mailto:lists.xen@nuclearfallout.net">=
lists.xen@nuclearfallout.net</a>&gt;, =A0Roger Pau Monne<br>
=A0 =A0 =A0 =A0 &lt;<a href=3D"mailto:roger.pau@citrix.com">roger.pau@citri=
x.com</a>&gt;<br>
Subject: Re: [Xen-devel] Bugs in xl that affect stubdom+tapdisk2, and<br>
=A0 =A0 =A0 =A0 others<br>
Message-ID:<br>
=A0 =A0 =A0 =A0 &lt;<a href=3D"mailto:20121109195553.GA11023@u109add4315675=
089e695.ant.amazon.com">20121109195553.GA11023@u109add4315675089e695.ant.am=
azon.com</a>&gt;<br>
Content-Type: text/plain; charset=3D&quot;us-ascii&quot;<br>
<br>
On Fri, Nov 09, 2012 at 01:29:04PM +0000, Ian Campbell wrote:<br>
&gt; On Thu, 2012-11-08 at 20:45 +0000, John Weekes wrote:<br>
&gt; &gt; As an additional note about 4.2 -- this isn&#39;t an &quot;xl&quo=
t; issue, but rather<br>
&gt; &gt; a build problem -- even though I use &quot;./configure --libdir=
=3D/usr/lib64&quot;,<br>
&gt; &gt; the build is still creating a &quot;dist/install/usr/lib&quot; di=
rectory, and<br>
&gt; &gt; because of this, running ./install.sh nukes my system&#39;s &quot=
;/usr/lib&quot; -&gt;<br>
&gt; &gt; &quot;/usr/lib64&quot; softlink (which in turn causes all sorts o=
f other problems<br>
&gt; &gt; until it&#39;s corrected). Files that are being put in that tree:=
<br>
&gt; &gt;<br>
&gt; &gt; xen-4.2-testing.hg # find dist/install/usr/lib<br>
&gt; &gt; dist/install/usr/lib<br>
&gt;<br>
&gt; This is an interesting one. I&#39;m not sure how we can avoid this<br>
&gt; behaviour, perhaps there is a tar option to cause it to follow rather<=
br>
&gt; than clobber synlinks?<br>
&gt;<br>
&gt; The only other choice I can think of is to change install.sh to use a<=
br>
&gt; (long) explicit list of $(FOO_DIR)/* entries instead of the single * t=
o<br>
&gt; avoid including system directories, or to otherwise make install.sh mo=
re<br>
&gt; fragile and prone to bitrot :-(<br>
<br>
Oh dear. If we find that there&#39;s not a good reason for it anymore, I&#3=
9;d<br>
think it would be better to remove install.sh instead.<br>
<br>
&gt; I must confess I didn&#39;t realise anyone used install.sh -- is there=
 some<br>
&gt; advantage to it over make foo-install?<br>
&gt;<br>
&gt; OOI which distro has this lib-&gt;lib64 link and what issues does remo=
ving<br>
&gt; it create?<br>
&gt;<br>
&gt; &gt; dist/install/usr/lib/xen<br>
&gt;<br>
&gt; This is $(XENFIRMWAREDIR). I have a feeling there is a reason this is<=
br>
&gt; not using $(LIBDIR), but I don&#39;t recall what it was -- Roget/Matt =
do you<br>
&gt; remember?<br>
<br>
There&#39;s no need for these files to be multilib compatible, as they are<=
br>
not runtime DSOs. They&#39;re internal to Xen and I think that they should<=
br>
be moved to $LIBEXECDIR instead, like /usr/libexec/xen/. Unfortunately<br>
there&#39;s not much agreement on the usefulness of /usr/libexec, so we&#39=
;ll<br>
need to make sure that packagers can adjust the paths for their<br>
systems&#39; standards.<br>
<br>
For 4.2 we didn&#39;t want to change where these files were being placed,<b=
r>
and I believe they&#39;ve bin in $PREFIX/lib/ for quite some time.<br>
<br>
Matt<br>
<br>
&gt; Thanks again for reporting all these.<br>
&gt;<br>
&gt; Ian.<br>
&gt;<br>
&gt; &gt; dist/install/usr/lib/xen/boot<br>
&gt; &gt; dist/install/usr/lib/xen/boot/xenstore-stubdom.gz<br>
&gt; &gt; dist/install/usr/lib/xen/boot/ioemu-stubdom.gz<br>
&gt; &gt; dist/install/usr/lib/xen/boot/pv-grub-x86_64.gz<br>
&gt; &gt; dist/install/usr/lib/xen/boot/hvmloader<br>
&gt; &gt; dist/install/usr/lib/xen/boot/pv-grub-x86_32.gz<br>
&gt; &gt; dist/install/usr/lib/xen/bin<br>
&gt; &gt; dist/install/usr/lib/xen/bin/stubdom-dm<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-io<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-nbd<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-img<br>
&gt; &gt; dist/install/usr/lib/xen/bin/xenpaging<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-dm<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-system-i386<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-ga<br>
&gt; &gt; dist/install/usr/lib/xen/bin/stubdompath.sh<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Sat, 10 Nov 2012 05:53:35 +0000<br>
From: <a href=3D"http://xen.org" target=3D"_blank">xen.org</a> &lt;<a href=
=3D"mailto:ian.jackson@eu.citrix.com">ian.jackson@eu.citrix.com</a>&gt;<br>
To: &lt;<a href=3D"mailto:xen-devel@lists.xensource.com">xen-devel@lists.xe=
nsource.com</a>&gt;<br>
Cc: <a href=3D"mailto:ian.jackson@eu.citrix.com">ian.jackson@eu.citrix.com<=
/a><br>
Subject: [Xen-devel] [xen-unstable test] 14377: tolerable FAIL<br>
Message-ID: &lt;<a href=3D"mailto:osstest-14377-mainreport@xen.org">osstest=
-14377-mainreport@xen.org</a>&gt;<br>
Content-Type: text/plain<br>
<br>
flight 14377 xen-unstable real [real]<br>
<a href=3D"http://www.chiark.greenend.org.uk/~xensrcts/logs/14377/" target=
=3D"_blank">http://www.chiark.greenend.org.uk/~xensrcts/logs/14377/</a><br>
<br>
Failures :-/ but no regressions.<br>
<br>
Regressions which are regarded as allowable (not blocking):<br>
=A0test-amd64-amd64-xl-sedf-pin 10 guest-saverestore =A0 =A0 =A0 =A0 =A0 =
=A0fail =A0 like 14376<br>
=A0test-amd64-amd64-xl-sedf =A0 =A0 =A05 xen-boot =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 fail =A0 like 14376<br>
=A0test-amd64-amd64-xl-qemuu-winxpsp3 =A09 guest-localmigrate =A0 =A0 =A0 f=
ail like 14376<br>
=A0test-amd64-amd64-xl-qemuu-win7-amd64 =A09 guest-localmigrate =A0 =A0 fai=
l like 14376<br>
<br>
Tests which did not succeed, but are not blocking:<br>
=A0test-amd64-amd64-xl-pcipt-intel =A09 guest-start =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 fail never pass<br>
=A0test-amd64-i386-xend-winxpsp3 16 leak-check/check =A0 =A0 =A0 =A0 =A0 =
=A0 fail =A0never pass<br>
=A0test-amd64-i386-win =A0 =A0 =A0 =A0 =A016 leak-check/check =A0 =A0 =A0 =
=A0 =A0 =A0 fail =A0 never pass<br>
=A0test-amd64-amd64-win =A0 =A0 =A0 =A0 16 leak-check/check =A0 =A0 =A0 =A0=
 =A0 =A0 fail =A0 never pass<br>
=A0test-amd64-i386-xl-win-vcpus1 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 fail =A0never pass<br>
=A0test-amd64-amd64-xl-win7-amd64 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 fail never pass<br>
=A0test-amd64-i386-win-vcpus1 =A0 16 leak-check/check =A0 =A0 =A0 =A0 =A0 =
=A0 fail =A0 never pass<br>
=A0test-amd64-i386-xl-win7-amd64 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 fail =A0never pass<br>
=A0test-amd64-amd64-xl-winxpsp3 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 fail =A0 never pass<br>
=A0test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 fail never pass<br>
=A0test-amd64-amd64-xl-win =A0 =A0 =A013 guest-stop =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 fail =A0 never pass<br>
<br>
version targeted for testing:<br>
=A0xen =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A062885b3c34c8<br>
baseline version:<br>
=A0xen =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A062885b3c34c8<br>
<br>
jobs:<br>
=A0build-amd64 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0build-i386 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0build-amd64-oldkern =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0build-i386-oldkern =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0build-amd64-pvops =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0build-i386-pvops =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0test-amd64-i386-xl =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-i386-rhel6hvm-amd =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-i386-qemuu-rhel6hvm-amd =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl-qemuu-win7-amd64 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 fail<br>
=A0test-amd64-amd64-xl-win7-amd64 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-xl-win7-amd64 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-i386-xl-credit2 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl-pcipt-intel =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-i386-rhel6hvm-intel =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-i386-qemuu-rhel6hvm-intel =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 pass<br>
=A0test-amd64-i386-xl-multivcpu =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-pair =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0test-amd64-i386-pair =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl-sedf-pin =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-amd64-pv =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0test-amd64-i386-pv =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl-sedf =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-win-vcpus1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-xl-win-vcpus1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-i386-xl-winxpsp3-vcpus1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-amd64-win =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-win =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-amd64-xl-win =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-amd64-xl-qemuu-winxpsp3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-xend-winxpsp3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-amd64-xl-winxpsp3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 fail<br>
<br>
<br>
------------------------------------------------------------<br>
sg-report-flight on <a href=3D"http://woking.cam.xci-test.com" target=3D"_b=
lank">woking.cam.xci-test.com</a><br>
logs: /home/xc_osstest/logs<br>
images: /home/xc_osstest/images<br>
<br>
Logs, config files, etc. are available at<br>
=A0 =A0 <a href=3D"http://www.chiark.greenend.org.uk/~xensrcts/logs" target=
=3D"_blank">http://www.chiark.greenend.org.uk/~xensrcts/logs</a><br>
<br>
Test harness code can be found at<br>
=A0 =A0 <a href=3D"http://xenbits.xensource.com/gitweb?p=3Dosstest.git;a=3D=
summary" target=3D"_blank">http://xenbits.xensource.com/gitweb?p=3Dosstest.=
git;a=3Dsummary</a><br>
<br>
<br>
Published tested tree is already up to date.<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Fri, 9 Nov 2012 04:01:36 -0700<br>
From: &quot;Juan Lorenzana&quot; &lt;<a href=3D"mailto:juan@jelsupport.com"=
>juan@jelsupport.com</a>&gt;<br>
To: &lt;<a href=3D"mailto:xen-devel@lists.xen.org">xen-devel@lists.xen.org<=
/a>&gt;<br>
Subject: [Xen-devel] .vhd will not boot in VM<br>
Message-ID: &lt;F2EF84CA5BCF824AA4197956E124073848F4AE@server.jel.local&gt;=
<br>
Content-Type: text/plain; charset=3D&quot;us-ascii&quot;<br>
<br>
We had a XCP 1.5 pool with 2 machines as hosts. =A0The storage pool which<b=
r>
as NFS mounted lost its ability to export the filesystem with the VM<br>
images on it.<br>
<br>
<br>
<br>
We contacted the vendor and we were able to restore it. =A0However, they<br=
>
had recommended that we delete the XCP Pool, recreate it, add the hosts<br>
back in, and then mount the storage.<br>
<br>
<br>
<br>
That is where we are at now. =A0We can see the storage and the VM images.<b=
r>
However in XCP Xen Center when looking at the images is clear that the<br>
metadata is lost. =A0So we can not see which image or snap shot belongs to<=
br>
which VM. =A0The names all are blank when we look at the storage.<br>
<br>
<br>
<br>
Also, if I randomly mount an image to a VM, it does not boot. =A0It<br>
produces an error that says:<br>
<br>
<br>
<br>
Traceback (most recent call last): - File &quot;/usr/binpygrub&quot;, line =
808, in<br>
? - fs =3D fsimage.open(file,part_offs[0[, bootfsoptions) - IOError:<br>
[Errno 95] Operation not supported.<br>
<br>
<br>
<br>
The system kept the VM information as we destroyed the pool and then<br>
created a new one but it looks like we only see snapshots through<br>
XenCenter. =A0Its like the real .vhd that were running are not showing up.<=
br>
<br>
<br>
<br>
I know it is pretty bad. =A0We should not have listened to the storage<br>
guys.<br>
<br>
<br>
<br>
Does anyone know someone that can help?<br>
<br>
<br>
<br>
Juan<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href=3D"http://lists.xen.org/archives/html/xen-devel/attachment=
s/20121109/a085ab22/attachment.html" target=3D"_blank">http://lists.xen.org=
/archives/html/xen-devel/attachments/20121109/a085ab22/attachment.html</a>&=
gt;<br>

<br>
------------------------------<br>
<br>
_______________________________________________<br>
Xen-devel mailing list<br>
<a href=3D"mailto:Xen-devel@lists.xen.org">Xen-devel@lists.xen.org</a><br>
<a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://lists.x=
en.org/xen-devel</a><br>
<br>
<br>
End of Xen-devel Digest, Vol 93, Issue 79<br>
*****************************************<br>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>_____<br>Fac=
t:<br>1. Ninjas are mammals.<br>2. Ninjas fight ALL the time.<br>3. The pur=
pose of the ninja is to flip out and kill people.<br>
</div>

--047d7b6766dc8b2e6104ce294575--


--===============1728157406802910382==
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.xen.org
http://lists.xen.org/xen-devel

--===============1728157406802910382==--


From xen-devel-bounces@lists.xen.org Sat Nov 10 19:43:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Nov 2012 19:43:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXGx7-0005yM-6Q; Sat, 10 Nov 2012 19:42:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <blistovmhz@gmail.com>) id 1TXGx5-0005y9-4n
	for xen-devel@lists.xen.org; Sat, 10 Nov 2012 19:42:47 +0000
Received: from [85.158.143.35:20865] by server-2.bemta-4.messagelabs.com id
	50/86-28922-63EAE905; Sat, 10 Nov 2012 19:42:46 +0000
X-Env-Sender: blistovmhz@gmail.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1352576562!17158274!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14335 invoked from network); 10 Nov 2012 19:42:43 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	10 Nov 2012 19:42:43 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl15so6047816vcb.32
	for <xen-devel@lists.xen.org>; Sat, 10 Nov 2012 11:42:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=5yyyWY3RJnFqL+A3SpP7XLzL08nx9V3PwxPS3ofcR8E=;
	b=EQQskPvU/MTVEjPVnA2YrN+au0nH285gAa9pcT44MjrGURO6XoyT0KTlv/oTbE0Nze
	sLDxdZ0tH/2OC7iKkN7n5r6oMc6P7/snqX7KfRfkTi+2i3SAY4Ns6bVguQnTUSp/tPOo
	Q5SlPVfbDd3AsfOVNgniB80u72B/L0sqNqzaojxdOdc1xxs4XnUPFBeWuF2SlQtItGRZ
	O3nxTCRkq8as4VpU9woKuuzA/G8uinLiu0fvHRef7GykNpqGa1li/UGRiOGMA9hM0uxz
	gxBXluIZpnaoDv9fEAGKhrETvEpTwip/O6aDDx2iZMPpFQVwZtfXwNgLo+Fw9wvry8Ng
	J1Xw==
MIME-Version: 1.0
Received: by 10.58.162.130 with SMTP id ya2mr11907149veb.2.1352576562572; Sat,
	10 Nov 2012 11:42:42 -0800 (PST)
Received: by 10.220.37.8 with HTTP; Sat, 10 Nov 2012 11:42:42 -0800 (PST)
In-Reply-To: <mailman.5.1352548802.11332.xen-devel@lists.xen.org>
References: <mailman.5.1352548802.11332.xen-devel@lists.xen.org>
Date: Sat, 10 Nov 2012 11:42:42 -0800
Message-ID: <CAN3GA=SiufUOi977SpWj+FGd9WdZUBtAoG18xUpQdSmr4g-boA@mail.gmail.com>
From: feral <blistovmhz@gmail.com>
To: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Xen-devel Digest, Vol 93, Issue 79
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1728157406802910382=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============1728157406802910382==
Content-Type: multipart/alternative; boundary=047d7b6766dc8b2e6104ce294575

--047d7b6766dc8b2e6104ce294575
Content-Type: text/plain; charset=ISO-8859-1

Re: PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
      IO_PAGE_FAULT: (Hans Mueller)
OMG, why do most messages only show up in the daily batch but not
individually?

@Hans
As far as I can tell, the guest is running fine until we see the IO_PAGE_FAULT.
 The machine is still pingable, but I suppose there's not much I can do to
verify the DomU's state.
Going to try running the newer qemu with Xen 4.1 and then Xen-4.2/4.3 with
the older qemu-dm today.


On Sat, Nov 10, 2012 at 4:00 AM, <xen-devel-request@lists.xen.org> wrote:

> Send Xen-devel mailing list submissions to
>         xen-devel@lists.xen.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel
> or, via email, send a message with subject or body 'help' to
>         xen-devel-request@lists.xen.org
>
> You can reach the person managing the list at
>         xen-devel-owner@lists.xen.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Xen-devel digest..."
>
>
> Today's Topics:
>
>    1. Re: PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
>       IO_PAGE_FAULT: (Hans Mueller)
>    2. Re: Dom0 physical networking/swiotlb/something issue in
>       3.7-rc1 (Jan Beulich)
>    3. Re: Bugs in xl that affect stubdom+tapdisk2, and others
>       (Matt Wilson)
>    4. [xen-unstable test] 14377: tolerable FAIL (xen.org)
>    5. .vhd will not boot in VM (Juan Lorenzana)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 09 Nov 2012 18:14:39 +0100
> From: Hans Mueller <mcbeagle@gmx.de>
> To: xen-devel@lists.xen.org
> Subject: Re: [Xen-devel] PCI/VGA passthrough on >Xen-4.2 - (XEN)
>         AMD-Vi: IO_PAGE_FAULT:
> Message-ID: <1871003.0Pup8WfsfS@sheik-lin>
> Content-Type: text/plain; charset="us-ascii"
>
> On Friday, 9. November 2012 16:33:47 Ian Campbell wrote:
> > On Fri, 2012-11-09 at 16:25 +0000, Hans Mueller wrote:
> > > On Thursday, 8. November 2012 20:02:51 feral wrote:
> > > > Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable.  Tested against all
> > > > three.
> > > >
> > > > VGA passthrough previously working with 4.1 is no longer working with
> > > > >4.2.
> > > >
> > > > Setup - Working:
> > > > Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos),
> > > > libvirt-bin,
> > > > xend
> > > > Asus Radeon HD 7870 DirectCU.
> > > > Works perfect.  Benches on par with bare metal.
> > > >
> > > > Setup - Broken:
> > > > Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (from
> GIT), xl
> > > > toolstack.
> > > > Asus Radeon HD 7870 DirectCU.
> > > > Some times the guest boots correctly but display is never enabled.
> > > >
> > > >  Sometimes BSOD, doesn't seem to be any rhyme or reason?
> > > >
> > > > No errors in logs.   Found the following in 'xl dmesg':
> > > > (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 2, device id = 0x600, fault
> > > > address =
> > > > 0x1ac800000, flags = 0
> > >
> > > I had a similar problem since hg revision 25818:50adc933faaf which
> changes
> > > the qemu tag.
> > > It looks like the qemu commit
> > > 3e66da7266c84638c0e22a09c9d2b07529802576
> > > (qemu-xen-trad: fix msi_translate with PV event delivery)
> > > causes this behavior.
> > >
> > > I solved the problem for me by using 'pci_msitranslate=0' in the domU
> > > config.
> > I don't follow this stuff closely but I could have sworn we had disabled
> > msitranslate by default.
> >
> > In any case I don't think that changeset was intended to cause anything
> > like this -- Stefano?
> >
> > > In addition I had to reboot (perhaps poweroff?) the dom0 once the
> > > IO_PAGE_FAULT occured.
>
> One more info for you - afair i noticed that it was not only the
> IO_PAGE_FAULT
> which occured but also the qemu process in dom0 crashed w/o any messages in
> the logs, perhaps feral can confirm this?
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 09 Nov 2012 17:34:35 +0000
> From: "Jan Beulich" <jbeulich@suse.com>
> To: <konrad.wilk@oracle.com>
> Cc: Ian.Campbell@citrix.com, xen-devel@lists.xen.org
> Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something
>         issue in 3.7-rc1
> Message-ID: <509D3EAB020000780008F4B6@nat28.tlf.novell.com>
> Content-Type: text/plain; charset=US-ASCII
>
> >>> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> 11/09/12 2:48 PM >>>
> >On Fri, Nov 09, 2012 at 11:43:39AM +0000, Jan Beulich wrote:
> >> >>> On 09.11.12 at 11:36, "Jan Beulich" <JBeulich@suse.com> wrote:
> >> > In the forward ported kernels, those two checks are however
> >> > accompanied by range_needs_mapping() (aka
> >> > range_straddles_page_boundary()) checks, which ought to
> >> > take care of this. There is brokenness there with the invocations
> >> > of gnttab_dma_map_page(), but only if the initial offset is at
> >> > least PAGE_SIZE - will have to check whether that occurs.
> >>
> >> And indeed, fixing this also makes the problem go away when
> >> the allocation order doesn't get forced to zero. So presumably
> >> there's also only that one problem I had pointed out in pv-ops.
> >
> >The pvops one has this in the map-page variant (xen_swiotlb_map_page):
> >
> >351         if (dma_capable(dev, dev_addr, size) &&
> >352             !range_straddles_page_boundary(phys, size) &&
> !swiotlb_force)
> >353                 return dev_addr;
> >
> >and in the sg variant:
> >
> >494                 if (swiotlb_force ||
> >495                     !dma_capable(hwdev, dev_addr, sg->length) ||
> >496                     range_straddles_page_boundary(paddr, sg->length))
> {
> >497                         void *map = swiotlb_tbl_map_single(hwdev,
>
> Oh, right, I forgot that there's yet another clone of that code under
> drivers/xen/.
>
> >So I think that check is OK. There is no gnttab_dma_map_page call - so
> that
> >can't be the issue.
>
> Indeed.
>
> Jan
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 9 Nov 2012 11:55:55 -0800
> From: Matt Wilson <msw@amazon.com>
> To: Ian Campbell <Ian.Campbell@citrix.com>
> Cc: "george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>,
>         "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
>        John
>         Weekes <lists.xen@nuclearfallout.net>,  Roger Pau Monne
>         <roger.pau@citrix.com>
> Subject: Re: [Xen-devel] Bugs in xl that affect stubdom+tapdisk2, and
>         others
> Message-ID:
>         <20121109195553.GA11023@u109add4315675089e695.ant.amazon.com>
> Content-Type: text/plain; charset="us-ascii"
>
> On Fri, Nov 09, 2012 at 01:29:04PM +0000, Ian Campbell wrote:
> > On Thu, 2012-11-08 at 20:45 +0000, John Weekes wrote:
> > > As an additional note about 4.2 -- this isn't an "xl" issue, but rather
> > > a build problem -- even though I use "./configure --libdir=/usr/lib64",
> > > the build is still creating a "dist/install/usr/lib" directory, and
> > > because of this, running ./install.sh nukes my system's "/usr/lib" ->
> > > "/usr/lib64" softlink (which in turn causes all sorts of other problems
> > > until it's corrected). Files that are being put in that tree:
> > >
> > > xen-4.2-testing.hg # find dist/install/usr/lib
> > > dist/install/usr/lib
> >
> > This is an interesting one. I'm not sure how we can avoid this
> > behaviour, perhaps there is a tar option to cause it to follow rather
> > than clobber synlinks?
> >
> > The only other choice I can think of is to change install.sh to use a
> > (long) explicit list of $(FOO_DIR)/* entries instead of the single * to
> > avoid including system directories, or to otherwise make install.sh more
> > fragile and prone to bitrot :-(
>
> Oh dear. If we find that there's not a good reason for it anymore, I'd
> think it would be better to remove install.sh instead.
>
> > I must confess I didn't realise anyone used install.sh -- is there some
> > advantage to it over make foo-install?
> >
> > OOI which distro has this lib->lib64 link and what issues does removing
> > it create?
> >
> > > dist/install/usr/lib/xen
> >
> > This is $(XENFIRMWAREDIR). I have a feeling there is a reason this is
> > not using $(LIBDIR), but I don't recall what it was -- Roget/Matt do you
> > remember?
>
> There's no need for these files to be multilib compatible, as they are
> not runtime DSOs. They're internal to Xen and I think that they should
> be moved to $LIBEXECDIR instead, like /usr/libexec/xen/. Unfortunately
> there's not much agreement on the usefulness of /usr/libexec, so we'll
> need to make sure that packagers can adjust the paths for their
> systems' standards.
>
> For 4.2 we didn't want to change where these files were being placed,
> and I believe they've bin in $PREFIX/lib/ for quite some time.
>
> Matt
>
> > Thanks again for reporting all these.
> >
> > Ian.
> >
> > > dist/install/usr/lib/xen/boot
> > > dist/install/usr/lib/xen/boot/xenstore-stubdom.gz
> > > dist/install/usr/lib/xen/boot/ioemu-stubdom.gz
> > > dist/install/usr/lib/xen/boot/pv-grub-x86_64.gz
> > > dist/install/usr/lib/xen/boot/hvmloader
> > > dist/install/usr/lib/xen/boot/pv-grub-x86_32.gz
> > > dist/install/usr/lib/xen/bin
> > > dist/install/usr/lib/xen/bin/stubdom-dm
> > > dist/install/usr/lib/xen/bin/qemu-io
> > > dist/install/usr/lib/xen/bin/qemu-nbd
> > > dist/install/usr/lib/xen/bin/qemu-img
> > > dist/install/usr/lib/xen/bin/xenpaging
> > > dist/install/usr/lib/xen/bin/qemu-dm
> > > dist/install/usr/lib/xen/bin/qemu-system-i386
> > > dist/install/usr/lib/xen/bin/qemu-ga
> > > dist/install/usr/lib/xen/bin/stubdompath.sh
>
>
>
> ------------------------------
>
> Message: 4
> Date: Sat, 10 Nov 2012 05:53:35 +0000
> From: xen.org <ian.jackson@eu.citrix.com>
> To: <xen-devel@lists.xensource.com>
> Cc: ian.jackson@eu.citrix.com
> Subject: [Xen-devel] [xen-unstable test] 14377: tolerable FAIL
> Message-ID: <osstest-14377-mainreport@xen.org>
> Content-Type: text/plain
>
> flight 14377 xen-unstable real [real]
> http://www.chiark.greenend.org.uk/~xensrcts/logs/14377/
>
> Failures :-/ but no regressions.
>
> Regressions which are regarded as allowable (not blocking):
>  test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like
> 14376
>  test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like
> 14376
>  test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like
> 14376
>  test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like
> 14376
>
> Tests which did not succeed, but are not blocking:
>  test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never
> pass
>  test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never
> pass
>  test-amd64-i386-win          16 leak-check/check             fail   never
> pass
>  test-amd64-amd64-win         16 leak-check/check             fail   never
> pass
>  test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never
> pass
>  test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never
> pass
>  test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never
> pass
>  test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never
> pass
>  test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never
> pass
>  test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never
> pass
>  test-amd64-amd64-xl-win      13 guest-stop                   fail   never
> pass
>
> version targeted for testing:
>  xen                  62885b3c34c8
> baseline version:
>  xen                  62885b3c34c8
>
> jobs:
>  build-amd64                                                  pass
>  build-i386                                                   pass
>  build-amd64-oldkern                                          pass
>  build-i386-oldkern                                           pass
>  build-amd64-pvops                                            pass
>  build-i386-pvops                                             pass
>  test-amd64-amd64-xl                                          pass
>  test-amd64-i386-xl                                           pass
>  test-amd64-i386-rhel6hvm-amd                                 pass
>  test-amd64-i386-qemuu-rhel6hvm-amd                           pass
>  test-amd64-amd64-xl-qemuu-win7-amd64                         fail
>  test-amd64-amd64-xl-win7-amd64                               fail
>  test-amd64-i386-xl-win7-amd64                                fail
>  test-amd64-i386-xl-credit2                                   pass
>  test-amd64-amd64-xl-pcipt-intel                              fail
>  test-amd64-i386-rhel6hvm-intel                               pass
>  test-amd64-i386-qemuu-rhel6hvm-intel                         pass
>  test-amd64-i386-xl-multivcpu                                 pass
>  test-amd64-amd64-pair                                        pass
>  test-amd64-i386-pair                                         pass
>  test-amd64-amd64-xl-sedf-pin                                 fail
>  test-amd64-amd64-pv                                          pass
>  test-amd64-i386-pv                                           pass
>  test-amd64-amd64-xl-sedf                                     fail
>  test-amd64-i386-win-vcpus1                                   fail
>  test-amd64-i386-xl-win-vcpus1                                fail
>  test-amd64-i386-xl-winxpsp3-vcpus1                           fail
>  test-amd64-amd64-win                                         fail
>  test-amd64-i386-win                                          fail
>  test-amd64-amd64-xl-win                                      fail
>  test-amd64-amd64-xl-qemuu-winxpsp3                           fail
>  test-amd64-i386-xend-winxpsp3                                fail
>  test-amd64-amd64-xl-winxpsp3                                 fail
>
>
> ------------------------------------------------------------
> sg-report-flight on woking.cam.xci-test.com
> logs: /home/xc_osstest/logs
> images: /home/xc_osstest/images
>
> Logs, config files, etc. are available at
>     http://www.chiark.greenend.org.uk/~xensrcts/logs
>
> Test harness code can be found at
>     http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary
>
>
> Published tested tree is already up to date.
>
>
>
>
> ------------------------------
>
> Message: 5
> Date: Fri, 9 Nov 2012 04:01:36 -0700
> From: "Juan Lorenzana" <juan@jelsupport.com>
> To: <xen-devel@lists.xen.org>
> Subject: [Xen-devel] .vhd will not boot in VM
> Message-ID: <F2EF84CA5BCF824AA4197956E124073848F4AE@server.jel.local>
> Content-Type: text/plain; charset="us-ascii"
>
> We had a XCP 1.5 pool with 2 machines as hosts.  The storage pool which
> as NFS mounted lost its ability to export the filesystem with the VM
> images on it.
>
>
>
> We contacted the vendor and we were able to restore it.  However, they
> had recommended that we delete the XCP Pool, recreate it, add the hosts
> back in, and then mount the storage.
>
>
>
> That is where we are at now.  We can see the storage and the VM images.
> However in XCP Xen Center when looking at the images is clear that the
> metadata is lost.  So we can not see which image or snap shot belongs to
> which VM.  The names all are blank when we look at the storage.
>
>
>
> Also, if I randomly mount an image to a VM, it does not boot.  It
> produces an error that says:
>
>
>
> Traceback (most recent call last): - File "/usr/binpygrub", line 808, in
> ? - fs = fsimage.open(file,part_offs[0[, bootfsoptions) - IOError:
> [Errno 95] Operation not supported.
>
>
>
> The system kept the VM information as we destroyed the pool and then
> created a new one but it looks like we only see snapshots through
> XenCenter.  Its like the real .vhd that were running are not showing up.
>
>
>
> I know it is pretty bad.  We should not have listened to the storage
> guys.
>
>
>
> Does anyone know someone that can help?
>
>
>
> Juan
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.xen.org/archives/html/xen-devel/attachments/20121109/a085ab22/attachment.html
> >
>
> ------------------------------
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>
> End of Xen-devel Digest, Vol 93, Issue 79
> *****************************************
>



-- 
_____
Fact:
1. Ninjas are mammals.
2. Ninjas fight ALL the time.
3. The purpose of the ninja is to flip out and kill people.

--047d7b6766dc8b2e6104ce294575
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<span style=3D"font-family:arial,sans-serif;font-size:13px">Re: PCI/VGA pas=
sthrough on &gt;Xen-4.2 - (XEN) AMD-Vi:</span><br style=3D"font-family:aria=
l,sans-serif;font-size:13px"><span style=3D"font-family:arial,sans-serif;fo=
nt-size:13px">=A0 =A0 =A0 IO_PAGE_FAULT: (Hans Mueller)</span><br>

<div><span style=3D"font-family:arial,sans-serif;font-size:13px">OMG, why d=
o most messages only show up in the daily batch but not individually?</span=
></div><div><span style=3D"font-family:arial,sans-serif;font-size:13px"><br=
>
</span></div><div><span style=3D"font-family:arial,sans-serif;font-size:13p=
x">@Hans</span></div><div><span style=3D"font-family:arial,sans-serif;font-=
size:13px">As far as I can tell, the guest is running fine until we see the=
=A0</span><font face=3D"arial, sans-serif">IO_PAGE_FAULT. =A0The machine is=
 still pingable, but I suppose there&#39;s not much I can do to verify the =
DomU&#39;s state.</font></div>
<div><font face=3D"arial, sans-serif">Going to try running the newer qemu w=
ith Xen 4.1 and then Xen-4.2/4.3 with the older qemu-dm today.</font></div>
<div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Sat, Nov 1=
0, 2012 at 4:00 AM,  <span dir=3D"ltr">&lt;<a href=3D"mailto:xen-devel-requ=
est@lists.xen.org" target=3D"_blank">xen-devel-request@lists.xen.org</a>&gt=
;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">Send Xen-devel mailing list submissions to<b=
r>
=A0 =A0 =A0 =A0 <a href=3D"mailto:xen-devel@lists.xen.org">xen-devel@lists.=
xen.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
=A0 =A0 =A0 =A0 <a href=3D"http://lists.xen.org/cgi-bin/mailman/listinfo/xe=
n-devel" target=3D"_blank">http://lists.xen.org/cgi-bin/mailman/listinfo/xe=
n-devel</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
=A0 =A0 =A0 =A0 <a href=3D"mailto:xen-devel-request@lists.xen.org">xen-deve=
l-request@lists.xen.org</a><br>
<br>
You can reach the person managing the list at<br>
=A0 =A0 =A0 =A0 <a href=3D"mailto:xen-devel-owner@lists.xen.org">xen-devel-=
owner@lists.xen.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of Xen-devel digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
=A0 =A01. Re: PCI/VGA passthrough on &gt;Xen-4.2 - (XEN) AMD-Vi:<br>
=A0 =A0 =A0 IO_PAGE_FAULT: (Hans Mueller)<br>
=A0 =A02. Re: Dom0 physical networking/swiotlb/something issue in<br>
=A0 =A0 =A0 3.7-rc1 (Jan Beulich)<br>
=A0 =A03. Re: Bugs in xl that affect stubdom+tapdisk2, and others<br>
=A0 =A0 =A0 (Matt Wilson)<br>
=A0 =A04. [xen-unstable test] 14377: tolerable FAIL (<a href=3D"http://xen.=
org" target=3D"_blank">xen.org</a>)<br>
=A0 =A05. .vhd will not boot in VM (Juan Lorenzana)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Fri, 09 Nov 2012 18:14:39 +0100<br>
From: Hans Mueller &lt;<a href=3D"mailto:mcbeagle@gmx.de">mcbeagle@gmx.de</=
a>&gt;<br>
To: <a href=3D"mailto:xen-devel@lists.xen.org">xen-devel@lists.xen.org</a><=
br>
Subject: Re: [Xen-devel] PCI/VGA passthrough on &gt;Xen-4.2 - (XEN)<br>
=A0 =A0 =A0 =A0 AMD-Vi: IO_PAGE_FAULT:<br>
Message-ID: &lt;1871003.0Pup8WfsfS@sheik-lin&gt;<br>
Content-Type: text/plain; charset=3D&quot;us-ascii&quot;<br>
<br>
On Friday, 9. November 2012 16:33:47 Ian Campbell wrote:<br>
&gt; On Fri, 2012-11-09 at 16:25 +0000, Hans Mueller wrote:<br>
&gt; &gt; On Thursday, 8. November 2012 20:02:51 feral wrote:<br>
&gt; &gt; &gt; Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable. =A0Tested aga=
inst all<br>
&gt; &gt; &gt; three.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; VGA passthrough previously working with 4.1 is no longer wor=
king with<br>
&gt; &gt; &gt; &gt;4.2.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Setup - Working:<br>
&gt; &gt; &gt; Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos)=
,<br>
&gt; &gt; &gt; libvirt-bin,<br>
&gt; &gt; &gt; xend<br>
&gt; &gt; &gt; Asus Radeon HD 7870 DirectCU.<br>
&gt; &gt; &gt; Works perfect. =A0Benches on par with bare metal.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Setup - Broken:<br>
&gt; &gt; &gt; Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (f=
rom GIT), xl<br>
&gt; &gt; &gt; toolstack.<br>
&gt; &gt; &gt; Asus Radeon HD 7870 DirectCU.<br>
&gt; &gt; &gt; Some times the guest boots correctly but display is never en=
abled.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; =A0Sometimes BSOD, doesn&#39;t seem to be any rhyme or reaso=
n?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; No errors in logs. =A0 Found the following in &#39;xl dmesg&=
#39;:<br>
&gt; &gt; &gt; (XEN) AMD-Vi: IO_PAGE_FAULT: domain =3D 2, device id =3D 0x6=
00, fault<br>
&gt; &gt; &gt; address =3D<br>
&gt; &gt; &gt; 0x1ac800000, flags =3D 0<br>
&gt; &gt;<br>
&gt; &gt; I had a similar problem since hg revision 25818:50adc933faaf whic=
h changes<br>
&gt; &gt; the qemu tag.<br>
&gt; &gt; It looks like the qemu commit<br>
&gt; &gt; 3e66da7266c84638c0e22a09c9d2b07529802576<br>
&gt; &gt; (qemu-xen-trad: fix msi_translate with PV event delivery)<br>
&gt; &gt; causes this behavior.<br>
&gt; &gt;<br>
&gt; &gt; I solved the problem for me by using &#39;pci_msitranslate=3D0&#3=
9; in the domU<br>
&gt; &gt; config.<br>
&gt; I don&#39;t follow this stuff closely but I could have sworn we had di=
sabled<br>
&gt; msitranslate by default.<br>
&gt;<br>
&gt; In any case I don&#39;t think that changeset was intended to cause any=
thing<br>
&gt; like this -- Stefano?<br>
&gt;<br>
&gt; &gt; In addition I had to reboot (perhaps poweroff?) the dom0 once the=
<br>
&gt; &gt; IO_PAGE_FAULT occured.<br>
<br>
One more info for you - afair i noticed that it was not only the IO_PAGE_FA=
ULT<br>
which occured but also the qemu process in dom0 crashed w/o any messages in=
<br>
the logs, perhaps feral can confirm this?<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Fri, 09 Nov 2012 17:34:35 +0000<br>
From: &quot;Jan Beulich&quot; &lt;<a href=3D"mailto:jbeulich@suse.com">jbeu=
lich@suse.com</a>&gt;<br>
To: &lt;<a href=3D"mailto:konrad.wilk@oracle.com">konrad.wilk@oracle.com</a=
>&gt;<br>
Cc: <a href=3D"mailto:Ian.Campbell@citrix.com">Ian.Campbell@citrix.com</a>,=
 <a href=3D"mailto:xen-devel@lists.xen.org">xen-devel@lists.xen.org</a><br>
Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something<br>
=A0 =A0 =A0 =A0 issue in 3.7-rc1<br>
Message-ID: &lt;<a href=3D"mailto:509D3EAB020000780008F4B6@nat28.tlf.novell=
.com">509D3EAB020000780008F4B6@nat28.tlf.novell.com</a>&gt;<br>
Content-Type: text/plain; charset=3DUS-ASCII<br>
<br>
&gt;&gt;&gt; Konrad Rzeszutek Wilk &lt;<a href=3D"mailto:konrad.wilk@oracle=
.com">konrad.wilk@oracle.com</a>&gt; 11/09/12 2:48 PM &gt;&gt;&gt;<br>
&gt;On Fri, Nov 09, 2012 at 11:43:39AM +0000, Jan Beulich wrote:<br>
&gt;&gt; &gt;&gt;&gt; On 09.11.12 at 11:36, &quot;Jan Beulich&quot; &lt;<a =
href=3D"mailto:JBeulich@suse.com">JBeulich@suse.com</a>&gt; wrote:<br>
&gt;&gt; &gt; In the forward ported kernels, those two checks are however<b=
r>
&gt;&gt; &gt; accompanied by range_needs_mapping() (aka<br>
&gt;&gt; &gt; range_straddles_page_boundary()) checks, which ought to<br>
&gt;&gt; &gt; take care of this. There is brokenness there with the invocat=
ions<br>
&gt;&gt; &gt; of gnttab_dma_map_page(), but only if the initial offset is a=
t<br>
&gt;&gt; &gt; least PAGE_SIZE - will have to check whether that occurs.<br>
&gt;&gt;<br>
&gt;&gt; And indeed, fixing this also makes the problem go away when<br>
&gt;&gt; the allocation order doesn&#39;t get forced to zero. So presumably=
<br>
&gt;&gt; there&#39;s also only that one problem I had pointed out in pv-ops=
.<br>
&gt;<br>
&gt;The pvops one has this in the map-page variant (xen_swiotlb_map_page):<=
br>
&gt;<br>
&gt;351 =A0 =A0 =A0 =A0 if (dma_capable(dev, dev_addr, size) &amp;&amp;<br>
&gt;352 =A0 =A0 =A0 =A0 =A0 =A0 !range_straddles_page_boundary(phys, size) =
&amp;&amp; !swiotlb_force)<br>
&gt;353 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return dev_addr;<br>
&gt;<br>
&gt;and in the sg variant:<br>
&gt;<br>
&gt;494 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (swiotlb_force ||<br>
&gt;495 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 !dma_capable(hwdev, dev_add=
r, sg-&gt;length) ||<br>
&gt;496 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 range_straddles_page_bounda=
ry(paddr, sg-&gt;length)) {<br>
&gt;497 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *map =3D swiot=
lb_tbl_map_single(hwdev,<br>
<br>
Oh, right, I forgot that there&#39;s yet another clone of that code under d=
rivers/xen/.<br>
<br>
&gt;So I think that check is OK. There is no gnttab_dma_map_page call - so =
that<br>
&gt;can&#39;t be the issue.<br>
<br>
Indeed.<br>
<br>
Jan<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Fri, 9 Nov 2012 11:55:55 -0800<br>
From: Matt Wilson &lt;<a href=3D"mailto:msw@amazon.com">msw@amazon.com</a>&=
gt;<br>
To: Ian Campbell &lt;<a href=3D"mailto:Ian.Campbell@citrix.com">Ian.Campbel=
l@citrix.com</a>&gt;<br>
Cc: &quot;<a href=3D"mailto:george.dunlap@eu.citrix.com">george.dunlap@eu.c=
itrix.com</a>&quot; &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">geor=
ge.dunlap@eu.citrix.com</a>&gt;,<br>
=A0 =A0 =A0 =A0 &quot;<a href=3D"mailto:xen-devel@lists.xensource.com">xen-=
devel@lists.xensource.com</a>&quot; &lt;<a href=3D"mailto:xen-devel@lists.x=
ensource.com">xen-devel@lists.xensource.com</a>&gt;, =A0 =A0 =A0 =A0John<br=
>
=A0 =A0 =A0 =A0 Weekes &lt;<a href=3D"mailto:lists.xen@nuclearfallout.net">=
lists.xen@nuclearfallout.net</a>&gt;, =A0Roger Pau Monne<br>
=A0 =A0 =A0 =A0 &lt;<a href=3D"mailto:roger.pau@citrix.com">roger.pau@citri=
x.com</a>&gt;<br>
Subject: Re: [Xen-devel] Bugs in xl that affect stubdom+tapdisk2, and<br>
=A0 =A0 =A0 =A0 others<br>
Message-ID:<br>
=A0 =A0 =A0 =A0 &lt;<a href=3D"mailto:20121109195553.GA11023@u109add4315675=
089e695.ant.amazon.com">20121109195553.GA11023@u109add4315675089e695.ant.am=
azon.com</a>&gt;<br>
Content-Type: text/plain; charset=3D&quot;us-ascii&quot;<br>
<br>
On Fri, Nov 09, 2012 at 01:29:04PM +0000, Ian Campbell wrote:<br>
&gt; On Thu, 2012-11-08 at 20:45 +0000, John Weekes wrote:<br>
&gt; &gt; As an additional note about 4.2 -- this isn&#39;t an &quot;xl&quo=
t; issue, but rather<br>
&gt; &gt; a build problem -- even though I use &quot;./configure --libdir=
=3D/usr/lib64&quot;,<br>
&gt; &gt; the build is still creating a &quot;dist/install/usr/lib&quot; di=
rectory, and<br>
&gt; &gt; because of this, running ./install.sh nukes my system&#39;s &quot=
;/usr/lib&quot; -&gt;<br>
&gt; &gt; &quot;/usr/lib64&quot; softlink (which in turn causes all sorts o=
f other problems<br>
&gt; &gt; until it&#39;s corrected). Files that are being put in that tree:=
<br>
&gt; &gt;<br>
&gt; &gt; xen-4.2-testing.hg # find dist/install/usr/lib<br>
&gt; &gt; dist/install/usr/lib<br>
&gt;<br>
&gt; This is an interesting one. I&#39;m not sure how we can avoid this<br>
&gt; behaviour, perhaps there is a tar option to cause it to follow rather<=
br>
&gt; than clobber synlinks?<br>
&gt;<br>
&gt; The only other choice I can think of is to change install.sh to use a<=
br>
&gt; (long) explicit list of $(FOO_DIR)/* entries instead of the single * t=
o<br>
&gt; avoid including system directories, or to otherwise make install.sh mo=
re<br>
&gt; fragile and prone to bitrot :-(<br>
<br>
Oh dear. If we find that there&#39;s not a good reason for it anymore, I&#3=
9;d<br>
think it would be better to remove install.sh instead.<br>
<br>
&gt; I must confess I didn&#39;t realise anyone used install.sh -- is there=
 some<br>
&gt; advantage to it over make foo-install?<br>
&gt;<br>
&gt; OOI which distro has this lib-&gt;lib64 link and what issues does remo=
ving<br>
&gt; it create?<br>
&gt;<br>
&gt; &gt; dist/install/usr/lib/xen<br>
&gt;<br>
&gt; This is $(XENFIRMWAREDIR). I have a feeling there is a reason this is<=
br>
&gt; not using $(LIBDIR), but I don&#39;t recall what it was -- Roget/Matt =
do you<br>
&gt; remember?<br>
<br>
There&#39;s no need for these files to be multilib compatible, as they are<=
br>
not runtime DSOs. They&#39;re internal to Xen and I think that they should<=
br>
be moved to $LIBEXECDIR instead, like /usr/libexec/xen/. Unfortunately<br>
there&#39;s not much agreement on the usefulness of /usr/libexec, so we&#39=
;ll<br>
need to make sure that packagers can adjust the paths for their<br>
systems&#39; standards.<br>
<br>
For 4.2 we didn&#39;t want to change where these files were being placed,<b=
r>
and I believe they&#39;ve bin in $PREFIX/lib/ for quite some time.<br>
<br>
Matt<br>
<br>
&gt; Thanks again for reporting all these.<br>
&gt;<br>
&gt; Ian.<br>
&gt;<br>
&gt; &gt; dist/install/usr/lib/xen/boot<br>
&gt; &gt; dist/install/usr/lib/xen/boot/xenstore-stubdom.gz<br>
&gt; &gt; dist/install/usr/lib/xen/boot/ioemu-stubdom.gz<br>
&gt; &gt; dist/install/usr/lib/xen/boot/pv-grub-x86_64.gz<br>
&gt; &gt; dist/install/usr/lib/xen/boot/hvmloader<br>
&gt; &gt; dist/install/usr/lib/xen/boot/pv-grub-x86_32.gz<br>
&gt; &gt; dist/install/usr/lib/xen/bin<br>
&gt; &gt; dist/install/usr/lib/xen/bin/stubdom-dm<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-io<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-nbd<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-img<br>
&gt; &gt; dist/install/usr/lib/xen/bin/xenpaging<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-dm<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-system-i386<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-ga<br>
&gt; &gt; dist/install/usr/lib/xen/bin/stubdompath.sh<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Sat, 10 Nov 2012 05:53:35 +0000<br>
From: <a href=3D"http://xen.org" target=3D"_blank">xen.org</a> &lt;<a href=
=3D"mailto:ian.jackson@eu.citrix.com">ian.jackson@eu.citrix.com</a>&gt;<br>
To: &lt;<a href=3D"mailto:xen-devel@lists.xensource.com">xen-devel@lists.xe=
nsource.com</a>&gt;<br>
Cc: <a href=3D"mailto:ian.jackson@eu.citrix.com">ian.jackson@eu.citrix.com<=
/a><br>
Subject: [Xen-devel] [xen-unstable test] 14377: tolerable FAIL<br>
Message-ID: &lt;<a href=3D"mailto:osstest-14377-mainreport@xen.org">osstest=
-14377-mainreport@xen.org</a>&gt;<br>
Content-Type: text/plain<br>
<br>
flight 14377 xen-unstable real [real]<br>
<a href=3D"http://www.chiark.greenend.org.uk/~xensrcts/logs/14377/" target=
=3D"_blank">http://www.chiark.greenend.org.uk/~xensrcts/logs/14377/</a><br>
<br>
Failures :-/ but no regressions.<br>
<br>
Regressions which are regarded as allowable (not blocking):<br>
=A0test-amd64-amd64-xl-sedf-pin 10 guest-saverestore =A0 =A0 =A0 =A0 =A0 =
=A0fail =A0 like 14376<br>
=A0test-amd64-amd64-xl-sedf =A0 =A0 =A05 xen-boot =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 fail =A0 like 14376<br>
=A0test-amd64-amd64-xl-qemuu-winxpsp3 =A09 guest-localmigrate =A0 =A0 =A0 f=
ail like 14376<br>
=A0test-amd64-amd64-xl-qemuu-win7-amd64 =A09 guest-localmigrate =A0 =A0 fai=
l like 14376<br>
<br>
Tests which did not succeed, but are not blocking:<br>
=A0test-amd64-amd64-xl-pcipt-intel =A09 guest-start =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 fail never pass<br>
=A0test-amd64-i386-xend-winxpsp3 16 leak-check/check =A0 =A0 =A0 =A0 =A0 =
=A0 fail =A0never pass<br>
=A0test-amd64-i386-win =A0 =A0 =A0 =A0 =A016 leak-check/check =A0 =A0 =A0 =
=A0 =A0 =A0 fail =A0 never pass<br>
=A0test-amd64-amd64-win =A0 =A0 =A0 =A0 16 leak-check/check =A0 =A0 =A0 =A0=
 =A0 =A0 fail =A0 never pass<br>
=A0test-amd64-i386-xl-win-vcpus1 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 fail =A0never pass<br>
=A0test-amd64-amd64-xl-win7-amd64 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 fail never pass<br>
=A0test-amd64-i386-win-vcpus1 =A0 16 leak-check/check =A0 =A0 =A0 =A0 =A0 =
=A0 fail =A0 never pass<br>
=A0test-amd64-i386-xl-win7-amd64 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 fail =A0never pass<br>
=A0test-amd64-amd64-xl-winxpsp3 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 fail =A0 never pass<br>
=A0test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 fail never pass<br>
=A0test-amd64-amd64-xl-win =A0 =A0 =A013 guest-stop =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 fail =A0 never pass<br>
<br>
version targeted for testing:<br>
=A0xen =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A062885b3c34c8<br>
baseline version:<br>
=A0xen =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A062885b3c34c8<br>
<br>
jobs:<br>
=A0build-amd64 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0build-i386 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0build-amd64-oldkern =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0build-i386-oldkern =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0build-amd64-pvops =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0build-i386-pvops =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0test-amd64-i386-xl =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-i386-rhel6hvm-amd =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-i386-qemuu-rhel6hvm-amd =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl-qemuu-win7-amd64 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 fail<br>
=A0test-amd64-amd64-xl-win7-amd64 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-xl-win7-amd64 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-i386-xl-credit2 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl-pcipt-intel =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-i386-rhel6hvm-intel =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-i386-qemuu-rhel6hvm-intel =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 pass<br>
=A0test-amd64-i386-xl-multivcpu =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-pair =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0test-amd64-i386-pair =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl-sedf-pin =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-amd64-pv =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0test-amd64-i386-pv =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl-sedf =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-win-vcpus1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-xl-win-vcpus1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-i386-xl-winxpsp3-vcpus1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-amd64-win =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-win =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-amd64-xl-win =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-amd64-xl-qemuu-winxpsp3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-xend-winxpsp3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-amd64-xl-winxpsp3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 fail<br>
<br>
<br>
------------------------------------------------------------<br>
sg-report-flight on <a href=3D"http://woking.cam.xci-test.com" target=3D"_b=
lank">woking.cam.xci-test.com</a><br>
logs: /home/xc_osstest/logs<br>
images: /home/xc_osstest/images<br>
<br>
Logs, config files, etc. are available at<br>
=A0 =A0 <a href=3D"http://www.chiark.greenend.org.uk/~xensrcts/logs" target=
=3D"_blank">http://www.chiark.greenend.org.uk/~xensrcts/logs</a><br>
<br>
Test harness code can be found at<br>
=A0 =A0 <a href=3D"http://xenbits.xensource.com/gitweb?p=3Dosstest.git;a=3D=
summary" target=3D"_blank">http://xenbits.xensource.com/gitweb?p=3Dosstest.=
git;a=3Dsummary</a><br>
<br>
<br>
Published tested tree is already up to date.<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Fri, 9 Nov 2012 04:01:36 -0700<br>
From: &quot;Juan Lorenzana&quot; &lt;<a href=3D"mailto:juan@jelsupport.com"=
>juan@jelsupport.com</a>&gt;<br>
To: &lt;<a href=3D"mailto:xen-devel@lists.xen.org">xen-devel@lists.xen.org<=
/a>&gt;<br>
Subject: [Xen-devel] .vhd will not boot in VM<br>
Message-ID: &lt;F2EF84CA5BCF824AA4197956E124073848F4AE@server.jel.local&gt;=
<br>
Content-Type: text/plain; charset=3D&quot;us-ascii&quot;<br>
<br>
We had a XCP 1.5 pool with 2 machines as hosts. =A0The storage pool which<b=
r>
as NFS mounted lost its ability to export the filesystem with the VM<br>
images on it.<br>
<br>
<br>
<br>
We contacted the vendor and we were able to restore it. =A0However, they<br=
>
had recommended that we delete the XCP Pool, recreate it, add the hosts<br>
back in, and then mount the storage.<br>
<br>
<br>
<br>
That is where we are at now. =A0We can see the storage and the VM images.<b=
r>
However in XCP Xen Center when looking at the images is clear that the<br>
metadata is lost. =A0So we can not see which image or snap shot belongs to<=
br>
which VM. =A0The names all are blank when we look at the storage.<br>
<br>
<br>
<br>
Also, if I randomly mount an image to a VM, it does not boot. =A0It<br>
produces an error that says:<br>
<br>
<br>
<br>
Traceback (most recent call last): - File &quot;/usr/binpygrub&quot;, line =
808, in<br>
? - fs =3D fsimage.open(file,part_offs[0[, bootfsoptions) - IOError:<br>
[Errno 95] Operation not supported.<br>
<br>
<br>
<br>
The system kept the VM information as we destroyed the pool and then<br>
created a new one but it looks like we only see snapshots through<br>
XenCenter. =A0Its like the real .vhd that were running are not showing up.<=
br>
<br>
<br>
<br>
I know it is pretty bad. =A0We should not have listened to the storage<br>
guys.<br>
<br>
<br>
<br>
Does anyone know someone that can help?<br>
<br>
<br>
<br>
Juan<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href=3D"http://lists.xen.org/archives/html/xen-devel/attachment=
s/20121109/a085ab22/attachment.html" target=3D"_blank">http://lists.xen.org=
/archives/html/xen-devel/attachments/20121109/a085ab22/attachment.html</a>&=
gt;<br>

<br>
------------------------------<br>
<br>
_______________________________________________<br>
Xen-devel mailing list<br>
<a href=3D"mailto:Xen-devel@lists.xen.org">Xen-devel@lists.xen.org</a><br>
<a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://lists.x=
en.org/xen-devel</a><br>
<br>
<br>
End of Xen-devel Digest, Vol 93, Issue 79<br>
*****************************************<br>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>_____<br>Fac=
t:<br>1. Ninjas are mammals.<br>2. Ninjas fight ALL the time.<br>3. The pur=
pose of the ninja is to flip out and kill people.<br>
</div>

--047d7b6766dc8b2e6104ce294575--


--===============1728157406802910382==
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.xen.org
http://lists.xen.org/xen-devel

--===============1728157406802910382==--


From xen-devel-bounces@lists.xen.org Sat Nov 10 20:11:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Nov 2012 20:11:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXHOa-0006j3-Pq; Sat, 10 Nov 2012 20:11:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <blistovmhz@gmail.com>) id 1TXHOZ-0006iy-4u
	for xen-devel@lists.xen.org; Sat, 10 Nov 2012 20:11:11 +0000
Received: from [85.158.143.35:20287] by server-2.bemta-4.messagelabs.com id
	69/6C-28922-ED4BE905; Sat, 10 Nov 2012 20:11:10 +0000
X-Env-Sender: blistovmhz@gmail.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1352578263!16565223!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1212 invoked from network); 10 Nov 2012 20:11:04 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-13.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	10 Nov 2012 20:11:04 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so6043957vbi.32
	for <xen-devel@lists.xen.org>; Sat, 10 Nov 2012 12:11:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=oKbV+h/PRTwEAtwKTOJojUJ5eJmLc/iHaYtmPGMZBLs=;
	b=iZ81VKDMaR84xxJHk7fEeNK3G5eIXqsv8vEyS3ecX82tEmE2qwSYheuPtHuyzAHkY0
	KA6DD5Bo2TZT1QIE1NioL7nG4rfzwkAiVpTjFI8Ux9GzEZRgYoXfcH3kfQemjgi7FNVL
	WrPlTH24S3t59O+ArYF8JWJz9557kW/cET1y1Dmv29X9uU2Hnxq6VIq8aRu4LabhajNz
	vn8yr+Fywr8kpiAiYFSs8ZWNfODWnE18PZzwPr9GNpXHXmZMHMNZL7iyJolBoUkRHuSO
	zAc8GEfkEVB8bEOTeOA9FvakoiLvmrPt0xCxUxsvv/50vNNCnL/0ecg133yf2Yu0O8Tv
	j6Ng==
MIME-Version: 1.0
Received: by 10.52.179.231 with SMTP id dj7mr14573430vdc.108.1352578262943;
	Sat, 10 Nov 2012 12:11:02 -0800 (PST)
Received: by 10.220.37.8 with HTTP; Sat, 10 Nov 2012 12:11:02 -0800 (PST)
In-Reply-To: <CAN3GA=SiufUOi977SpWj+FGd9WdZUBtAoG18xUpQdSmr4g-boA@mail.gmail.com>
References: <mailman.5.1352548802.11332.xen-devel@lists.xen.org>
	<CAN3GA=SiufUOi977SpWj+FGd9WdZUBtAoG18xUpQdSmr4g-boA@mail.gmail.com>
Date: Sat, 10 Nov 2012 12:11:02 -0800
Message-ID: <CAN3GA=RyB_O=huShjYuviqvbY7gNjHyn4c3s-GuAeBoR6=Uw4Q@mail.gmail.com>
From: feral <blistovmhz@gmail.com>
To: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Xen-devel Digest, Vol 93, Issue 79
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0408609209009085176=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0408609209009085176==
Content-Type: multipart/alternative; boundary=bcaec5014c71e4c85004ce29aa99

--bcaec5014c71e4c85004ce29aa99
Content-Type: text/plain; charset=ISO-8859-1

Can't run Xen-4.3 unstable kernel with old xm tools:
WARING:  Can't find version unstable of xen utils, fallback to default
version!
Error: Unable to connect to xend: No such file or directory. Is xend
running?

Guessing the same will be true of running the older 4.1 kernel with the new
xl toolstack, so not sure how to proceed in testing.

I should mention that the only reason I was testing 4.3 was because there
is a bug in usb-linux.c compiled into qemu-dm from 4.1 where you are unable
to attach a usb device which has a serial interface (eg: game controller
with analog controls).  My Logitech Driving Force GT wheel works fine in
4.1 but some Xbox controller couldn't be successfully passed through to the
DomU.
Perhaps I should be investigating some other avenue?
I suppose this is very unlikely to be a big deal for anyone.  I'm not using
the controller, was just testing usb-passthrough of devices I knew would
have a serial interface riding on top of usb.
Problem was solved in KVM qemu with a very simple patch and was wondering
if Xen had applied the same patch.


Re: PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
      IO_PAGE_FAULT: (Hans Mueller)
OMG, why do most messages only show up in the daily batch but not
individually?

@Hans
As far as I can tell, the guest is running fine until we see the IO_PAGE_FAULT.
 The machine is still pingable, but I suppose there's not much I can do to
verify the DomU's state.
Going to try running the newer qemu with Xen 4.1 and then Xen-4.2/4.3 with
the older qemu-dm today.





On Sat, Nov 10, 2012 at 11:42 AM, feral <blistovmhz@gmail.com> wrote:

> Re: PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
>       IO_PAGE_FAULT: (Hans Mueller)
> OMG, why do most messages only show up in the daily batch but not
> individually?
>
> @Hans
> As far as I can tell, the guest is running fine until we see the IO_PAGE_FAULT.
>  The machine is still pingable, but I suppose there's not much I can do to
> verify the DomU's state.
> Going to try running the newer qemu with Xen 4.1 and then Xen-4.2/4.3 with
> the older qemu-dm today.
>
>
> On Sat, Nov 10, 2012 at 4:00 AM, <xen-devel-request@lists.xen.org> wrote:
>
>> Send Xen-devel mailing list submissions to
>>         xen-devel@lists.xen.org
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>>         http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel
>> or, via email, send a message with subject or body 'help' to
>>         xen-devel-request@lists.xen.org
>>
>> You can reach the person managing the list at
>>         xen-devel-owner@lists.xen.org
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of Xen-devel digest..."
>>
>>
>> Today's Topics:
>>
>>    1. Re: PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
>>       IO_PAGE_FAULT: (Hans Mueller)
>>    2. Re: Dom0 physical networking/swiotlb/something issue in
>>       3.7-rc1 (Jan Beulich)
>>    3. Re: Bugs in xl that affect stubdom+tapdisk2, and others
>>       (Matt Wilson)
>>    4. [xen-unstable test] 14377: tolerable FAIL (xen.org)
>>    5. .vhd will not boot in VM (Juan Lorenzana)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Fri, 09 Nov 2012 18:14:39 +0100
>> From: Hans Mueller <mcbeagle@gmx.de>
>> To: xen-devel@lists.xen.org
>> Subject: Re: [Xen-devel] PCI/VGA passthrough on >Xen-4.2 - (XEN)
>>         AMD-Vi: IO_PAGE_FAULT:
>> Message-ID: <1871003.0Pup8WfsfS@sheik-lin>
>> Content-Type: text/plain; charset="us-ascii"
>>
>> On Friday, 9. November 2012 16:33:47 Ian Campbell wrote:
>> > On Fri, 2012-11-09 at 16:25 +0000, Hans Mueller wrote:
>> > > On Thursday, 8. November 2012 20:02:51 feral wrote:
>> > > > Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable.  Tested against all
>> > > > three.
>> > > >
>> > > > VGA passthrough previously working with 4.1 is no longer working
>> with
>> > > > >4.2.
>> > > >
>> > > > Setup - Working:
>> > > > Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos),
>> > > > libvirt-bin,
>> > > > xend
>> > > > Asus Radeon HD 7870 DirectCU.
>> > > > Works perfect.  Benches on par with bare metal.
>> > > >
>> > > > Setup - Broken:
>> > > > Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (from
>> GIT), xl
>> > > > toolstack.
>> > > > Asus Radeon HD 7870 DirectCU.
>> > > > Some times the guest boots correctly but display is never enabled.
>> > > >
>> > > >  Sometimes BSOD, doesn't seem to be any rhyme or reason?
>> > > >
>> > > > No errors in logs.   Found the following in 'xl dmesg':
>> > > > (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 2, device id = 0x600, fault
>> > > > address =
>> > > > 0x1ac800000, flags = 0
>> > >
>> > > I had a similar problem since hg revision 25818:50adc933faaf which
>> changes
>> > > the qemu tag.
>> > > It looks like the qemu commit
>> > > 3e66da7266c84638c0e22a09c9d2b07529802576
>> > > (qemu-xen-trad: fix msi_translate with PV event delivery)
>> > > causes this behavior.
>> > >
>> > > I solved the problem for me by using 'pci_msitranslate=0' in the domU
>> > > config.
>> > I don't follow this stuff closely but I could have sworn we had disabled
>> > msitranslate by default.
>> >
>> > In any case I don't think that changeset was intended to cause anything
>> > like this -- Stefano?
>> >
>> > > In addition I had to reboot (perhaps poweroff?) the dom0 once the
>> > > IO_PAGE_FAULT occured.
>>
>> One more info for you - afair i noticed that it was not only the
>> IO_PAGE_FAULT
>> which occured but also the qemu process in dom0 crashed w/o any messages
>> in
>> the logs, perhaps feral can confirm this?
>>
>>
>>
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Fri, 09 Nov 2012 17:34:35 +0000
>> From: "Jan Beulich" <jbeulich@suse.com>
>> To: <konrad.wilk@oracle.com>
>> Cc: Ian.Campbell@citrix.com, xen-devel@lists.xen.org
>> Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something
>>         issue in 3.7-rc1
>> Message-ID: <509D3EAB020000780008F4B6@nat28.tlf.novell.com>
>> Content-Type: text/plain; charset=US-ASCII
>>
>> >>> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> 11/09/12 2:48 PM >>>
>> >On Fri, Nov 09, 2012 at 11:43:39AM +0000, Jan Beulich wrote:
>> >> >>> On 09.11.12 at 11:36, "Jan Beulich" <JBeulich@suse.com> wrote:
>> >> > In the forward ported kernels, those two checks are however
>> >> > accompanied by range_needs_mapping() (aka
>> >> > range_straddles_page_boundary()) checks, which ought to
>> >> > take care of this. There is brokenness there with the invocations
>> >> > of gnttab_dma_map_page(), but only if the initial offset is at
>> >> > least PAGE_SIZE - will have to check whether that occurs.
>> >>
>> >> And indeed, fixing this also makes the problem go away when
>> >> the allocation order doesn't get forced to zero. So presumably
>> >> there's also only that one problem I had pointed out in pv-ops.
>> >
>> >The pvops one has this in the map-page variant (xen_swiotlb_map_page):
>> >
>> >351         if (dma_capable(dev, dev_addr, size) &&
>> >352             !range_straddles_page_boundary(phys, size) &&
>> !swiotlb_force)
>> >353                 return dev_addr;
>> >
>> >and in the sg variant:
>> >
>> >494                 if (swiotlb_force ||
>> >495                     !dma_capable(hwdev, dev_addr, sg->length) ||
>> >496                     range_straddles_page_boundary(paddr,
>> sg->length)) {
>> >497                         void *map = swiotlb_tbl_map_single(hwdev,
>>
>> Oh, right, I forgot that there's yet another clone of that code under
>> drivers/xen/.
>>
>> >So I think that check is OK. There is no gnttab_dma_map_page call - so
>> that
>> >can't be the issue.
>>
>> Indeed.
>>
>> Jan
>>
>>
>>
>>
>> ------------------------------
>>
>> Message: 3
>> Date: Fri, 9 Nov 2012 11:55:55 -0800
>> From: Matt Wilson <msw@amazon.com>
>> To: Ian Campbell <Ian.Campbell@citrix.com>
>> Cc: "george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>,
>>         "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
>>        John
>>         Weekes <lists.xen@nuclearfallout.net>,  Roger Pau Monne
>>         <roger.pau@citrix.com>
>> Subject: Re: [Xen-devel] Bugs in xl that affect stubdom+tapdisk2, and
>>         others
>> Message-ID:
>>         <20121109195553.GA11023@u109add4315675089e695.ant.amazon.com>
>> Content-Type: text/plain; charset="us-ascii"
>>
>> On Fri, Nov 09, 2012 at 01:29:04PM +0000, Ian Campbell wrote:
>> > On Thu, 2012-11-08 at 20:45 +0000, John Weekes wrote:
>> > > As an additional note about 4.2 -- this isn't an "xl" issue, but
>> rather
>> > > a build problem -- even though I use "./configure
>> --libdir=/usr/lib64",
>> > > the build is still creating a "dist/install/usr/lib" directory, and
>> > > because of this, running ./install.sh nukes my system's "/usr/lib" ->
>> > > "/usr/lib64" softlink (which in turn causes all sorts of other
>> problems
>> > > until it's corrected). Files that are being put in that tree:
>> > >
>> > > xen-4.2-testing.hg # find dist/install/usr/lib
>> > > dist/install/usr/lib
>> >
>> > This is an interesting one. I'm not sure how we can avoid this
>> > behaviour, perhaps there is a tar option to cause it to follow rather
>> > than clobber synlinks?
>> >
>> > The only other choice I can think of is to change install.sh to use a
>> > (long) explicit list of $(FOO_DIR)/* entries instead of the single * to
>> > avoid including system directories, or to otherwise make install.sh more
>> > fragile and prone to bitrot :-(
>>
>> Oh dear. If we find that there's not a good reason for it anymore, I'd
>> think it would be better to remove install.sh instead.
>>
>> > I must confess I didn't realise anyone used install.sh -- is there some
>> > advantage to it over make foo-install?
>> >
>> > OOI which distro has this lib->lib64 link and what issues does removing
>> > it create?
>> >
>> > > dist/install/usr/lib/xen
>> >
>> > This is $(XENFIRMWAREDIR). I have a feeling there is a reason this is
>> > not using $(LIBDIR), but I don't recall what it was -- Roget/Matt do you
>> > remember?
>>
>> There's no need for these files to be multilib compatible, as they are
>> not runtime DSOs. They're internal to Xen and I think that they should
>> be moved to $LIBEXECDIR instead, like /usr/libexec/xen/. Unfortunately
>> there's not much agreement on the usefulness of /usr/libexec, so we'll
>> need to make sure that packagers can adjust the paths for their
>> systems' standards.
>>
>> For 4.2 we didn't want to change where these files were being placed,
>> and I believe they've bin in $PREFIX/lib/ for quite some time.
>>
>> Matt
>>
>> > Thanks again for reporting all these.
>> >
>> > Ian.
>> >
>> > > dist/install/usr/lib/xen/boot
>> > > dist/install/usr/lib/xen/boot/xenstore-stubdom.gz
>> > > dist/install/usr/lib/xen/boot/ioemu-stubdom.gz
>> > > dist/install/usr/lib/xen/boot/pv-grub-x86_64.gz
>> > > dist/install/usr/lib/xen/boot/hvmloader
>> > > dist/install/usr/lib/xen/boot/pv-grub-x86_32.gz
>> > > dist/install/usr/lib/xen/bin
>> > > dist/install/usr/lib/xen/bin/stubdom-dm
>> > > dist/install/usr/lib/xen/bin/qemu-io
>> > > dist/install/usr/lib/xen/bin/qemu-nbd
>> > > dist/install/usr/lib/xen/bin/qemu-img
>> > > dist/install/usr/lib/xen/bin/xenpaging
>> > > dist/install/usr/lib/xen/bin/qemu-dm
>> > > dist/install/usr/lib/xen/bin/qemu-system-i386
>> > > dist/install/usr/lib/xen/bin/qemu-ga
>> > > dist/install/usr/lib/xen/bin/stubdompath.sh
>>
>>
>>
>> ------------------------------
>>
>> Message: 4
>> Date: Sat, 10 Nov 2012 05:53:35 +0000
>> From: xen.org <ian.jackson@eu.citrix.com>
>> To: <xen-devel@lists.xensource.com>
>> Cc: ian.jackson@eu.citrix.com
>> Subject: [Xen-devel] [xen-unstable test] 14377: tolerable FAIL
>> Message-ID: <osstest-14377-mainreport@xen.org>
>> Content-Type: text/plain
>>
>> flight 14377 xen-unstable real [real]
>> http://www.chiark.greenend.org.uk/~xensrcts/logs/14377/
>>
>> Failures :-/ but no regressions.
>>
>> Regressions which are regarded as allowable (not blocking):
>>  test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like
>> 14376
>>  test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like
>> 14376
>>  test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like
>> 14376
>>  test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like
>> 14376
>>
>> Tests which did not succeed, but are not blocking:
>>  test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail
>> never pass
>>  test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail
>>  never pass
>>  test-amd64-i386-win          16 leak-check/check             fail
>> never pass
>>  test-amd64-amd64-win         16 leak-check/check             fail
>> never pass
>>  test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail
>>  never pass
>>  test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail
>> never pass
>>  test-amd64-i386-win-vcpus1   16 leak-check/check             fail
>> never pass
>>  test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail
>>  never pass
>>  test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail
>> never pass
>>  test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail
>> never pass
>>  test-amd64-amd64-xl-win      13 guest-stop                   fail
>> never pass
>>
>> version targeted for testing:
>>  xen                  62885b3c34c8
>> baseline version:
>>  xen                  62885b3c34c8
>>
>> jobs:
>>  build-amd64                                                  pass
>>  build-i386                                                   pass
>>  build-amd64-oldkern                                          pass
>>  build-i386-oldkern                                           pass
>>  build-amd64-pvops                                            pass
>>  build-i386-pvops                                             pass
>>  test-amd64-amd64-xl                                          pass
>>  test-amd64-i386-xl                                           pass
>>  test-amd64-i386-rhel6hvm-amd                                 pass
>>  test-amd64-i386-qemuu-rhel6hvm-amd                           pass
>>  test-amd64-amd64-xl-qemuu-win7-amd64                         fail
>>  test-amd64-amd64-xl-win7-amd64                               fail
>>  test-amd64-i386-xl-win7-amd64                                fail
>>  test-amd64-i386-xl-credit2                                   pass
>>  test-amd64-amd64-xl-pcipt-intel                              fail
>>  test-amd64-i386-rhel6hvm-intel                               pass
>>  test-amd64-i386-qemuu-rhel6hvm-intel                         pass
>>  test-amd64-i386-xl-multivcpu                                 pass
>>  test-amd64-amd64-pair                                        pass
>>  test-amd64-i386-pair                                         pass
>>  test-amd64-amd64-xl-sedf-pin                                 fail
>>  test-amd64-amd64-pv                                          pass
>>  test-amd64-i386-pv                                           pass
>>  test-amd64-amd64-xl-sedf                                     fail
>>  test-amd64-i386-win-vcpus1                                   fail
>>  test-amd64-i386-xl-win-vcpus1                                fail
>>  test-amd64-i386-xl-winxpsp3-vcpus1                           fail
>>  test-amd64-amd64-win                                         fail
>>  test-amd64-i386-win                                          fail
>>  test-amd64-amd64-xl-win                                      fail
>>  test-amd64-amd64-xl-qemuu-winxpsp3                           fail
>>  test-amd64-i386-xend-winxpsp3                                fail
>>  test-amd64-amd64-xl-winxpsp3                                 fail
>>
>>
>> ------------------------------------------------------------
>> sg-report-flight on woking.cam.xci-test.com
>> logs: /home/xc_osstest/logs
>> images: /home/xc_osstest/images
>>
>> Logs, config files, etc. are available at
>>     http://www.chiark.greenend.org.uk/~xensrcts/logs
>>
>> Test harness code can be found at
>>     http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary
>>
>>
>> Published tested tree is already up to date.
>>
>>
>>
>>
>> ------------------------------
>>
>> Message: 5
>> Date: Fri, 9 Nov 2012 04:01:36 -0700
>> From: "Juan Lorenzana" <juan@jelsupport.com>
>> To: <xen-devel@lists.xen.org>
>> Subject: [Xen-devel] .vhd will not boot in VM
>> Message-ID: <F2EF84CA5BCF824AA4197956E124073848F4AE@server.jel.local>
>> Content-Type: text/plain; charset="us-ascii"
>>
>> We had a XCP 1.5 pool with 2 machines as hosts.  The storage pool which
>> as NFS mounted lost its ability to export the filesystem with the VM
>> images on it.
>>
>>
>>
>> We contacted the vendor and we were able to restore it.  However, they
>> had recommended that we delete the XCP Pool, recreate it, add the hosts
>> back in, and then mount the storage.
>>
>>
>>
>> That is where we are at now.  We can see the storage and the VM images.
>> However in XCP Xen Center when looking at the images is clear that the
>> metadata is lost.  So we can not see which image or snap shot belongs to
>> which VM.  The names all are blank when we look at the storage.
>>
>>
>>
>> Also, if I randomly mount an image to a VM, it does not boot.  It
>> produces an error that says:
>>
>>
>>
>> Traceback (most recent call last): - File "/usr/binpygrub", line 808, in
>> ? - fs = fsimage.open(file,part_offs[0[, bootfsoptions) - IOError:
>> [Errno 95] Operation not supported.
>>
>>
>>
>> The system kept the VM information as we destroyed the pool and then
>> created a new one but it looks like we only see snapshots through
>> XenCenter.  Its like the real .vhd that were running are not showing up.
>>
>>
>>
>> I know it is pretty bad.  We should not have listened to the storage
>> guys.
>>
>>
>>
>> Does anyone know someone that can help?
>>
>>
>>
>> Juan
>>
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <
>> http://lists.xen.org/archives/html/xen-devel/attachments/20121109/a085ab22/attachment.html
>> >
>>
>> ------------------------------
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>>
>>
>> End of Xen-devel Digest, Vol 93, Issue 79
>> *****************************************
>>
>
>
>
> --
> _____
> Fact:
> 1. Ninjas are mammals.
> 2. Ninjas fight ALL the time.
> 3. The purpose of the ninja is to flip out and kill people.
>



-- 
_____
Fact:
1. Ninjas are mammals.
2. Ninjas fight ALL the time.
3. The purpose of the ninja is to flip out and kill people.

--bcaec5014c71e4c85004ce29aa99
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div class=3D"im" style=3D"font-family:arial,sans-serif;font-size:13px">Can=
&#39;t run Xen-4.3 unstable kernel with old xm tools:</div><div class=3D"im=
"><div class=3D"im"><font face=3D"arial, sans-serif">WARING: =A0Can&#39;t f=
ind version unstable of xen utils, fallback to default version!</font></div=
>
<div class=3D"im"><font face=3D"arial, sans-serif">Error: Unable to connect=
 to xend: No such file or directory. Is xend running?</font></div><div styl=
e=3D"font-family:arial,sans-serif;font-size:13px"><br></div><div style=3D"f=
ont-family:arial,sans-serif;font-size:13px">
Guessing the same will be true of running the older 4.1 kernel with the new=
 xl toolstack, so not sure how to proceed in testing.</div><div style=3D"fo=
nt-family:arial,sans-serif;font-size:13px"><br></div><div style=3D"font-fam=
ily:arial,sans-serif;font-size:13px">
I should mention that the only reason I was testing 4.3 was because there i=
s a bug in usb-linux.c compiled into qemu-dm from 4.1 where you are unable =
to attach a usb device which has a serial interface (eg: game controller wi=
th analog controls). =A0My Logitech Driving Force GT wheel works fine in 4.=
1 but some Xbox controller couldn&#39;t be successfully passed through to t=
he DomU.</div>
<div style=3D"font-family:arial,sans-serif;font-size:13px">Perhaps I should=
 be investigating some other avenue? =A0<br>I suppose this is very unlikely=
 to be a big deal for anyone. =A0I&#39;m not using the controller, was just=
 testing usb-passthrough of devices I knew would have a serial interface ri=
ding on top of usb.</div>
<div style=3D"font-family:arial,sans-serif;font-size:13px">Problem was solv=
ed in KVM qemu with a very simple patch and was wondering if Xen had applie=
d the same patch.</div></div><div class=3D"im" style=3D"font-family:arial,s=
ans-serif;font-size:13px">
<br></div><div class=3D"im" style=3D"font-family:arial,sans-serif;font-size=
:13px"><br></div><div class=3D"im" style=3D"font-family:arial,sans-serif;fo=
nt-size:13px">Re: PCI/VGA passthrough on &gt;Xen-4.2 - (XEN) AMD-Vi:<br>=A0=
 =A0 =A0 IO_PAGE_FAULT: (Hans Mueller)<br>
</div><div style=3D"font-family:arial,sans-serif;font-size:13px">OMG, why d=
o most messages only show up in the daily batch but not individually?</div>=
<div style=3D"font-family:arial,sans-serif;font-size:13px"><br></div><div s=
tyle=3D"font-family:arial,sans-serif;font-size:13px">
@Hans</div><div style=3D"font-family:arial,sans-serif;font-size:13px">As fa=
r as I can tell, the guest is running fine until we see the=A0<font face=3D=
"arial, sans-serif">IO_PAGE_FAULT. =A0The machine is still pingable, but I =
suppose there&#39;s not much I can do to verify the DomU&#39;s state.</font=
></div>
<div style=3D"font-family:arial,sans-serif;font-size:13px"><font face=3D"ar=
ial, sans-serif">Going to try running the newer qemu with Xen 4.1 and then =
Xen-4.2/4.3 with the older qemu-dm today.</font></div><div style=3D"font-fa=
mily:arial,sans-serif;font-size:13px">
<font face=3D"arial, sans-serif"><br></font></div><div style=3D"font-family=
:arial,sans-serif;font-size:13px"><br></div><div style=3D"font-family:arial=
,sans-serif;font-size:13px"><font face=3D"arial, sans-serif"><br></font></d=
iv><div class=3D"gmail_extra">
<br><br><div class=3D"gmail_quote">On Sat, Nov 10, 2012 at 11:42 AM, feral =
<span dir=3D"ltr">&lt;<a href=3D"mailto:blistovmhz@gmail.com" target=3D"_bl=
ank">blistovmhz@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gma=
il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef=
t:1ex">
<div class=3D"im"><span style=3D"font-family:arial,sans-serif;font-size:13p=
x">Re: PCI/VGA passthrough on &gt;Xen-4.2 - (XEN) AMD-Vi:</span><br style=
=3D"font-family:arial,sans-serif;font-size:13px"><span style=3D"font-family=
:arial,sans-serif;font-size:13px">=A0 =A0 =A0 IO_PAGE_FAULT: (Hans Mueller)=
</span><br>


</div><div><span style=3D"font-family:arial,sans-serif;font-size:13px">OMG,=
 why do most messages only show up in the daily batch but not individually?=
</span></div><div><span style=3D"font-family:arial,sans-serif;font-size:13p=
x"><br>

</span></div><div><span style=3D"font-family:arial,sans-serif;font-size:13p=
x">@Hans</span></div><div><span style=3D"font-family:arial,sans-serif;font-=
size:13px">As far as I can tell, the guest is running fine until we see the=
=A0</span><font face=3D"arial, sans-serif">IO_PAGE_FAULT. =A0The machine is=
 still pingable, but I suppose there&#39;s not much I can do to verify the =
DomU&#39;s state.</font></div>

<div><font face=3D"arial, sans-serif">Going to try running the newer qemu w=
ith Xen 4.1 and then Xen-4.2/4.3 with the older qemu-dm today.</font></div>
<div class=3D"gmail_extra"><div><div class=3D"h5"><br><br><div class=3D"gma=
il_quote">On Sat, Nov 10, 2012 at 4:00 AM,  <span dir=3D"ltr">&lt;<a href=
=3D"mailto:xen-devel-request@lists.xen.org" target=3D"_blank">xen-devel-req=
uest@lists.xen.org</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">Send Xen-devel mailing list submissions to<b=
r>
=A0 =A0 =A0 =A0 <a href=3D"mailto:xen-devel@lists.xen.org" target=3D"_blank=
">xen-devel@lists.xen.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
=A0 =A0 =A0 =A0 <a href=3D"http://lists.xen.org/cgi-bin/mailman/listinfo/xe=
n-devel" target=3D"_blank">http://lists.xen.org/cgi-bin/mailman/listinfo/xe=
n-devel</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
=A0 =A0 =A0 =A0 <a href=3D"mailto:xen-devel-request@lists.xen.org" target=
=3D"_blank">xen-devel-request@lists.xen.org</a><br>
<br>
You can reach the person managing the list at<br>
=A0 =A0 =A0 =A0 <a href=3D"mailto:xen-devel-owner@lists.xen.org" target=3D"=
_blank">xen-devel-owner@lists.xen.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of Xen-devel digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
=A0 =A01. Re: PCI/VGA passthrough on &gt;Xen-4.2 - (XEN) AMD-Vi:<br>
=A0 =A0 =A0 IO_PAGE_FAULT: (Hans Mueller)<br>
=A0 =A02. Re: Dom0 physical networking/swiotlb/something issue in<br>
=A0 =A0 =A0 3.7-rc1 (Jan Beulich)<br>
=A0 =A03. Re: Bugs in xl that affect stubdom+tapdisk2, and others<br>
=A0 =A0 =A0 (Matt Wilson)<br>
=A0 =A04. [xen-unstable test] 14377: tolerable FAIL (<a href=3D"http://xen.=
org" target=3D"_blank">xen.org</a>)<br>
=A0 =A05. .vhd will not boot in VM (Juan Lorenzana)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Fri, 09 Nov 2012 18:14:39 +0100<br>
From: Hans Mueller &lt;<a href=3D"mailto:mcbeagle@gmx.de" target=3D"_blank"=
>mcbeagle@gmx.de</a>&gt;<br>
To: <a href=3D"mailto:xen-devel@lists.xen.org" target=3D"_blank">xen-devel@=
lists.xen.org</a><br>
Subject: Re: [Xen-devel] PCI/VGA passthrough on &gt;Xen-4.2 - (XEN)<br>
=A0 =A0 =A0 =A0 AMD-Vi: IO_PAGE_FAULT:<br>
Message-ID: &lt;1871003.0Pup8WfsfS@sheik-lin&gt;<br>
Content-Type: text/plain; charset=3D&quot;us-ascii&quot;<br>
<br>
On Friday, 9. November 2012 16:33:47 Ian Campbell wrote:<br>
&gt; On Fri, 2012-11-09 at 16:25 +0000, Hans Mueller wrote:<br>
&gt; &gt; On Thursday, 8. November 2012 20:02:51 feral wrote:<br>
&gt; &gt; &gt; Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable. =A0Tested aga=
inst all<br>
&gt; &gt; &gt; three.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; VGA passthrough previously working with 4.1 is no longer wor=
king with<br>
&gt; &gt; &gt; &gt;4.2.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Setup - Working:<br>
&gt; &gt; &gt; Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos)=
,<br>
&gt; &gt; &gt; libvirt-bin,<br>
&gt; &gt; &gt; xend<br>
&gt; &gt; &gt; Asus Radeon HD 7870 DirectCU.<br>
&gt; &gt; &gt; Works perfect. =A0Benches on par with bare metal.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Setup - Broken:<br>
&gt; &gt; &gt; Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (f=
rom GIT), xl<br>
&gt; &gt; &gt; toolstack.<br>
&gt; &gt; &gt; Asus Radeon HD 7870 DirectCU.<br>
&gt; &gt; &gt; Some times the guest boots correctly but display is never en=
abled.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; =A0Sometimes BSOD, doesn&#39;t seem to be any rhyme or reaso=
n?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; No errors in logs. =A0 Found the following in &#39;xl dmesg&=
#39;:<br>
&gt; &gt; &gt; (XEN) AMD-Vi: IO_PAGE_FAULT: domain =3D 2, device id =3D 0x6=
00, fault<br>
&gt; &gt; &gt; address =3D<br>
&gt; &gt; &gt; 0x1ac800000, flags =3D 0<br>
&gt; &gt;<br>
&gt; &gt; I had a similar problem since hg revision 25818:50adc933faaf whic=
h changes<br>
&gt; &gt; the qemu tag.<br>
&gt; &gt; It looks like the qemu commit<br>
&gt; &gt; 3e66da7266c84638c0e22a09c9d2b07529802576<br>
&gt; &gt; (qemu-xen-trad: fix msi_translate with PV event delivery)<br>
&gt; &gt; causes this behavior.<br>
&gt; &gt;<br>
&gt; &gt; I solved the problem for me by using &#39;pci_msitranslate=3D0&#3=
9; in the domU<br>
&gt; &gt; config.<br>
&gt; I don&#39;t follow this stuff closely but I could have sworn we had di=
sabled<br>
&gt; msitranslate by default.<br>
&gt;<br>
&gt; In any case I don&#39;t think that changeset was intended to cause any=
thing<br>
&gt; like this -- Stefano?<br>
&gt;<br>
&gt; &gt; In addition I had to reboot (perhaps poweroff?) the dom0 once the=
<br>
&gt; &gt; IO_PAGE_FAULT occured.<br>
<br>
One more info for you - afair i noticed that it was not only the IO_PAGE_FA=
ULT<br>
which occured but also the qemu process in dom0 crashed w/o any messages in=
<br>
the logs, perhaps feral can confirm this?<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Fri, 09 Nov 2012 17:34:35 +0000<br>
From: &quot;Jan Beulich&quot; &lt;<a href=3D"mailto:jbeulich@suse.com" targ=
et=3D"_blank">jbeulich@suse.com</a>&gt;<br>
To: &lt;<a href=3D"mailto:konrad.wilk@oracle.com" target=3D"_blank">konrad.=
wilk@oracle.com</a>&gt;<br>
Cc: <a href=3D"mailto:Ian.Campbell@citrix.com" target=3D"_blank">Ian.Campbe=
ll@citrix.com</a>, <a href=3D"mailto:xen-devel@lists.xen.org" target=3D"_bl=
ank">xen-devel@lists.xen.org</a><br>
Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something<br>
=A0 =A0 =A0 =A0 issue in 3.7-rc1<br>
Message-ID: &lt;<a href=3D"mailto:509D3EAB020000780008F4B6@nat28.tlf.novell=
.com" target=3D"_blank">509D3EAB020000780008F4B6@nat28.tlf.novell.com</a>&g=
t;<br>
Content-Type: text/plain; charset=3DUS-ASCII<br>
<br>
&gt;&gt;&gt; Konrad Rzeszutek Wilk &lt;<a href=3D"mailto:konrad.wilk@oracle=
.com" target=3D"_blank">konrad.wilk@oracle.com</a>&gt; 11/09/12 2:48 PM &gt=
;&gt;&gt;<br>
&gt;On Fri, Nov 09, 2012 at 11:43:39AM +0000, Jan Beulich wrote:<br>
&gt;&gt; &gt;&gt;&gt; On 09.11.12 at 11:36, &quot;Jan Beulich&quot; &lt;<a =
href=3D"mailto:JBeulich@suse.com" target=3D"_blank">JBeulich@suse.com</a>&g=
t; wrote:<br>
&gt;&gt; &gt; In the forward ported kernels, those two checks are however<b=
r>
&gt;&gt; &gt; accompanied by range_needs_mapping() (aka<br>
&gt;&gt; &gt; range_straddles_page_boundary()) checks, which ought to<br>
&gt;&gt; &gt; take care of this. There is brokenness there with the invocat=
ions<br>
&gt;&gt; &gt; of gnttab_dma_map_page(), but only if the initial offset is a=
t<br>
&gt;&gt; &gt; least PAGE_SIZE - will have to check whether that occurs.<br>
&gt;&gt;<br>
&gt;&gt; And indeed, fixing this also makes the problem go away when<br>
&gt;&gt; the allocation order doesn&#39;t get forced to zero. So presumably=
<br>
&gt;&gt; there&#39;s also only that one problem I had pointed out in pv-ops=
.<br>
&gt;<br>
&gt;The pvops one has this in the map-page variant (xen_swiotlb_map_page):<=
br>
&gt;<br>
&gt;351 =A0 =A0 =A0 =A0 if (dma_capable(dev, dev_addr, size) &amp;&amp;<br>
&gt;352 =A0 =A0 =A0 =A0 =A0 =A0 !range_straddles_page_boundary(phys, size) =
&amp;&amp; !swiotlb_force)<br>
&gt;353 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return dev_addr;<br>
&gt;<br>
&gt;and in the sg variant:<br>
&gt;<br>
&gt;494 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (swiotlb_force ||<br>
&gt;495 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 !dma_capable(hwdev, dev_add=
r, sg-&gt;length) ||<br>
&gt;496 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 range_straddles_page_bounda=
ry(paddr, sg-&gt;length)) {<br>
&gt;497 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *map =3D swiot=
lb_tbl_map_single(hwdev,<br>
<br>
Oh, right, I forgot that there&#39;s yet another clone of that code under d=
rivers/xen/.<br>
<br>
&gt;So I think that check is OK. There is no gnttab_dma_map_page call - so =
that<br>
&gt;can&#39;t be the issue.<br>
<br>
Indeed.<br>
<br>
Jan<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Fri, 9 Nov 2012 11:55:55 -0800<br>
From: Matt Wilson &lt;<a href=3D"mailto:msw@amazon.com" target=3D"_blank">m=
sw@amazon.com</a>&gt;<br>
To: Ian Campbell &lt;<a href=3D"mailto:Ian.Campbell@citrix.com" target=3D"_=
blank">Ian.Campbell@citrix.com</a>&gt;<br>
Cc: &quot;<a href=3D"mailto:george.dunlap@eu.citrix.com" target=3D"_blank">=
george.dunlap@eu.citrix.com</a>&quot; &lt;<a href=3D"mailto:george.dunlap@e=
u.citrix.com" target=3D"_blank">george.dunlap@eu.citrix.com</a>&gt;,<br>
=A0 =A0 =A0 =A0 &quot;<a href=3D"mailto:xen-devel@lists.xensource.com" targ=
et=3D"_blank">xen-devel@lists.xensource.com</a>&quot; &lt;<a href=3D"mailto=
:xen-devel@lists.xensource.com" target=3D"_blank">xen-devel@lists.xensource=
.com</a>&gt;, =A0 =A0 =A0 =A0John<br>

=A0 =A0 =A0 =A0 Weekes &lt;<a href=3D"mailto:lists.xen@nuclearfallout.net" =
target=3D"_blank">lists.xen@nuclearfallout.net</a>&gt;, =A0Roger Pau Monne<=
br>
=A0 =A0 =A0 =A0 &lt;<a href=3D"mailto:roger.pau@citrix.com" target=3D"_blan=
k">roger.pau@citrix.com</a>&gt;<br>
Subject: Re: [Xen-devel] Bugs in xl that affect stubdom+tapdisk2, and<br>
=A0 =A0 =A0 =A0 others<br>
Message-ID:<br>
=A0 =A0 =A0 =A0 &lt;<a href=3D"mailto:20121109195553.GA11023@u109add4315675=
089e695.ant.amazon.com" target=3D"_blank">20121109195553.GA11023@u109add431=
5675089e695.ant.amazon.com</a>&gt;<br>
Content-Type: text/plain; charset=3D&quot;us-ascii&quot;<br>
<br>
On Fri, Nov 09, 2012 at 01:29:04PM +0000, Ian Campbell wrote:<br>
&gt; On Thu, 2012-11-08 at 20:45 +0000, John Weekes wrote:<br>
&gt; &gt; As an additional note about 4.2 -- this isn&#39;t an &quot;xl&quo=
t; issue, but rather<br>
&gt; &gt; a build problem -- even though I use &quot;./configure --libdir=
=3D/usr/lib64&quot;,<br>
&gt; &gt; the build is still creating a &quot;dist/install/usr/lib&quot; di=
rectory, and<br>
&gt; &gt; because of this, running ./install.sh nukes my system&#39;s &quot=
;/usr/lib&quot; -&gt;<br>
&gt; &gt; &quot;/usr/lib64&quot; softlink (which in turn causes all sorts o=
f other problems<br>
&gt; &gt; until it&#39;s corrected). Files that are being put in that tree:=
<br>
&gt; &gt;<br>
&gt; &gt; xen-4.2-testing.hg # find dist/install/usr/lib<br>
&gt; &gt; dist/install/usr/lib<br>
&gt;<br>
&gt; This is an interesting one. I&#39;m not sure how we can avoid this<br>
&gt; behaviour, perhaps there is a tar option to cause it to follow rather<=
br>
&gt; than clobber synlinks?<br>
&gt;<br>
&gt; The only other choice I can think of is to change install.sh to use a<=
br>
&gt; (long) explicit list of $(FOO_DIR)/* entries instead of the single * t=
o<br>
&gt; avoid including system directories, or to otherwise make install.sh mo=
re<br>
&gt; fragile and prone to bitrot :-(<br>
<br>
Oh dear. If we find that there&#39;s not a good reason for it anymore, I&#3=
9;d<br>
think it would be better to remove install.sh instead.<br>
<br>
&gt; I must confess I didn&#39;t realise anyone used install.sh -- is there=
 some<br>
&gt; advantage to it over make foo-install?<br>
&gt;<br>
&gt; OOI which distro has this lib-&gt;lib64 link and what issues does remo=
ving<br>
&gt; it create?<br>
&gt;<br>
&gt; &gt; dist/install/usr/lib/xen<br>
&gt;<br>
&gt; This is $(XENFIRMWAREDIR). I have a feeling there is a reason this is<=
br>
&gt; not using $(LIBDIR), but I don&#39;t recall what it was -- Roget/Matt =
do you<br>
&gt; remember?<br>
<br>
There&#39;s no need for these files to be multilib compatible, as they are<=
br>
not runtime DSOs. They&#39;re internal to Xen and I think that they should<=
br>
be moved to $LIBEXECDIR instead, like /usr/libexec/xen/. Unfortunately<br>
there&#39;s not much agreement on the usefulness of /usr/libexec, so we&#39=
;ll<br>
need to make sure that packagers can adjust the paths for their<br>
systems&#39; standards.<br>
<br>
For 4.2 we didn&#39;t want to change where these files were being placed,<b=
r>
and I believe they&#39;ve bin in $PREFIX/lib/ for quite some time.<br>
<br>
Matt<br>
<br>
&gt; Thanks again for reporting all these.<br>
&gt;<br>
&gt; Ian.<br>
&gt;<br>
&gt; &gt; dist/install/usr/lib/xen/boot<br>
&gt; &gt; dist/install/usr/lib/xen/boot/xenstore-stubdom.gz<br>
&gt; &gt; dist/install/usr/lib/xen/boot/ioemu-stubdom.gz<br>
&gt; &gt; dist/install/usr/lib/xen/boot/pv-grub-x86_64.gz<br>
&gt; &gt; dist/install/usr/lib/xen/boot/hvmloader<br>
&gt; &gt; dist/install/usr/lib/xen/boot/pv-grub-x86_32.gz<br>
&gt; &gt; dist/install/usr/lib/xen/bin<br>
&gt; &gt; dist/install/usr/lib/xen/bin/stubdom-dm<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-io<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-nbd<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-img<br>
&gt; &gt; dist/install/usr/lib/xen/bin/xenpaging<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-dm<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-system-i386<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-ga<br>
&gt; &gt; dist/install/usr/lib/xen/bin/stubdompath.sh<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Sat, 10 Nov 2012 05:53:35 +0000<br>
From: <a href=3D"http://xen.org" target=3D"_blank">xen.org</a> &lt;<a href=
=3D"mailto:ian.jackson@eu.citrix.com" target=3D"_blank">ian.jackson@eu.citr=
ix.com</a>&gt;<br>
To: &lt;<a href=3D"mailto:xen-devel@lists.xensource.com" target=3D"_blank">=
xen-devel@lists.xensource.com</a>&gt;<br>
Cc: <a href=3D"mailto:ian.jackson@eu.citrix.com" target=3D"_blank">ian.jack=
son@eu.citrix.com</a><br>
Subject: [Xen-devel] [xen-unstable test] 14377: tolerable FAIL<br>
Message-ID: &lt;<a href=3D"mailto:osstest-14377-mainreport@xen.org" target=
=3D"_blank">osstest-14377-mainreport@xen.org</a>&gt;<br>
Content-Type: text/plain<br>
<br>
flight 14377 xen-unstable real [real]<br>
<a href=3D"http://www.chiark.greenend.org.uk/~xensrcts/logs/14377/" target=
=3D"_blank">http://www.chiark.greenend.org.uk/~xensrcts/logs/14377/</a><br>
<br>
Failures :-/ but no regressions.<br>
<br>
Regressions which are regarded as allowable (not blocking):<br>
=A0test-amd64-amd64-xl-sedf-pin 10 guest-saverestore =A0 =A0 =A0 =A0 =A0 =
=A0fail =A0 like 14376<br>
=A0test-amd64-amd64-xl-sedf =A0 =A0 =A05 xen-boot =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 fail =A0 like 14376<br>
=A0test-amd64-amd64-xl-qemuu-winxpsp3 =A09 guest-localmigrate =A0 =A0 =A0 f=
ail like 14376<br>
=A0test-amd64-amd64-xl-qemuu-win7-amd64 =A09 guest-localmigrate =A0 =A0 fai=
l like 14376<br>
<br>
Tests which did not succeed, but are not blocking:<br>
=A0test-amd64-amd64-xl-pcipt-intel =A09 guest-start =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 fail never pass<br>
=A0test-amd64-i386-xend-winxpsp3 16 leak-check/check =A0 =A0 =A0 =A0 =A0 =
=A0 fail =A0never pass<br>
=A0test-amd64-i386-win =A0 =A0 =A0 =A0 =A016 leak-check/check =A0 =A0 =A0 =
=A0 =A0 =A0 fail =A0 never pass<br>
=A0test-amd64-amd64-win =A0 =A0 =A0 =A0 16 leak-check/check =A0 =A0 =A0 =A0=
 =A0 =A0 fail =A0 never pass<br>
=A0test-amd64-i386-xl-win-vcpus1 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 fail =A0never pass<br>
=A0test-amd64-amd64-xl-win7-amd64 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 fail never pass<br>
=A0test-amd64-i386-win-vcpus1 =A0 16 leak-check/check =A0 =A0 =A0 =A0 =A0 =
=A0 fail =A0 never pass<br>
=A0test-amd64-i386-xl-win7-amd64 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 fail =A0never pass<br>
=A0test-amd64-amd64-xl-winxpsp3 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 fail =A0 never pass<br>
=A0test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 fail never pass<br>
=A0test-amd64-amd64-xl-win =A0 =A0 =A013 guest-stop =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 fail =A0 never pass<br>
<br>
version targeted for testing:<br>
=A0xen =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A062885b3c34c8<br>
baseline version:<br>
=A0xen =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A062885b3c34c8<br>
<br>
jobs:<br>
=A0build-amd64 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0build-i386 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0build-amd64-oldkern =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0build-i386-oldkern =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0build-amd64-pvops =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0build-i386-pvops =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0test-amd64-i386-xl =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-i386-rhel6hvm-amd =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-i386-qemuu-rhel6hvm-amd =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl-qemuu-win7-amd64 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 fail<br>
=A0test-amd64-amd64-xl-win7-amd64 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-xl-win7-amd64 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-i386-xl-credit2 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl-pcipt-intel =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-i386-rhel6hvm-intel =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-i386-qemuu-rhel6hvm-intel =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 pass<br>
=A0test-amd64-i386-xl-multivcpu =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-pair =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0test-amd64-i386-pair =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl-sedf-pin =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-amd64-pv =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0test-amd64-i386-pv =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl-sedf =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-win-vcpus1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-xl-win-vcpus1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-i386-xl-winxpsp3-vcpus1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-amd64-win =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-win =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-amd64-xl-win =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-amd64-xl-qemuu-winxpsp3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-xend-winxpsp3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-amd64-xl-winxpsp3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 fail<br>
<br>
<br>
------------------------------------------------------------<br>
sg-report-flight on <a href=3D"http://woking.cam.xci-test.com" target=3D"_b=
lank">woking.cam.xci-test.com</a><br>
logs: /home/xc_osstest/logs<br>
images: /home/xc_osstest/images<br>
<br>
Logs, config files, etc. are available at<br>
=A0 =A0 <a href=3D"http://www.chiark.greenend.org.uk/~xensrcts/logs" target=
=3D"_blank">http://www.chiark.greenend.org.uk/~xensrcts/logs</a><br>
<br>
Test harness code can be found at<br>
=A0 =A0 <a href=3D"http://xenbits.xensource.com/gitweb?p=3Dosstest.git;a=3D=
summary" target=3D"_blank">http://xenbits.xensource.com/gitweb?p=3Dosstest.=
git;a=3Dsummary</a><br>
<br>
<br>
Published tested tree is already up to date.<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Fri, 9 Nov 2012 04:01:36 -0700<br>
From: &quot;Juan Lorenzana&quot; &lt;<a href=3D"mailto:juan@jelsupport.com"=
 target=3D"_blank">juan@jelsupport.com</a>&gt;<br>
To: &lt;<a href=3D"mailto:xen-devel@lists.xen.org" target=3D"_blank">xen-de=
vel@lists.xen.org</a>&gt;<br>
Subject: [Xen-devel] .vhd will not boot in VM<br>
Message-ID: &lt;F2EF84CA5BCF824AA4197956E124073848F4AE@server.jel.local&gt;=
<br>
Content-Type: text/plain; charset=3D&quot;us-ascii&quot;<br>
<br>
We had a XCP 1.5 pool with 2 machines as hosts. =A0The storage pool which<b=
r>
as NFS mounted lost its ability to export the filesystem with the VM<br>
images on it.<br>
<br>
<br>
<br>
We contacted the vendor and we were able to restore it. =A0However, they<br=
>
had recommended that we delete the XCP Pool, recreate it, add the hosts<br>
back in, and then mount the storage.<br>
<br>
<br>
<br>
That is where we are at now. =A0We can see the storage and the VM images.<b=
r>
However in XCP Xen Center when looking at the images is clear that the<br>
metadata is lost. =A0So we can not see which image or snap shot belongs to<=
br>
which VM. =A0The names all are blank when we look at the storage.<br>
<br>
<br>
<br>
Also, if I randomly mount an image to a VM, it does not boot. =A0It<br>
produces an error that says:<br>
<br>
<br>
<br>
Traceback (most recent call last): - File &quot;/usr/binpygrub&quot;, line =
808, in<br>
? - fs =3D fsimage.open(file,part_offs[0[, bootfsoptions) - IOError:<br>
[Errno 95] Operation not supported.<br>
<br>
<br>
<br>
The system kept the VM information as we destroyed the pool and then<br>
created a new one but it looks like we only see snapshots through<br>
XenCenter. =A0Its like the real .vhd that were running are not showing up.<=
br>
<br>
<br>
<br>
I know it is pretty bad. =A0We should not have listened to the storage<br>
guys.<br>
<br>
<br>
<br>
Does anyone know someone that can help?<br>
<br>
<br>
<br>
Juan<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href=3D"http://lists.xen.org/archives/html/xen-devel/attachment=
s/20121109/a085ab22/attachment.html" target=3D"_blank">http://lists.xen.org=
/archives/html/xen-devel/attachments/20121109/a085ab22/attachment.html</a>&=
gt;<br>


<br>
------------------------------<br>
<br>
_______________________________________________<br>
Xen-devel mailing list<br>
<a href=3D"mailto:Xen-devel@lists.xen.org" target=3D"_blank">Xen-devel@list=
s.xen.org</a><br>
<a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://lists.x=
en.org/xen-devel</a><br>
<br>
<br>
End of Xen-devel Digest, Vol 93, Issue 79<br>
*****************************************<br>
</blockquote></div><br><br clear=3D"all"><div><br></div></div></div><span c=
lass=3D"HOEnZb"><font color=3D"#888888">-- <br>_____<br>Fact:<br>1. Ninjas =
are mammals.<br>2. Ninjas fight ALL the time.<br>3. The purpose of the ninj=
a is to flip out and kill people.<br>

</font></span></div>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>_____<br>Fac=
t:<br>1. Ninjas are mammals.<br>2. Ninjas fight ALL the time.<br>3. The pur=
pose of the ninja is to flip out and kill people.<br>
</div>

--bcaec5014c71e4c85004ce29aa99--


--===============0408609209009085176==
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.xen.org
http://lists.xen.org/xen-devel

--===============0408609209009085176==--


From xen-devel-bounces@lists.xen.org Sat Nov 10 20:11:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Nov 2012 20:11:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXHOa-0006j3-Pq; Sat, 10 Nov 2012 20:11:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <blistovmhz@gmail.com>) id 1TXHOZ-0006iy-4u
	for xen-devel@lists.xen.org; Sat, 10 Nov 2012 20:11:11 +0000
Received: from [85.158.143.35:20287] by server-2.bemta-4.messagelabs.com id
	69/6C-28922-ED4BE905; Sat, 10 Nov 2012 20:11:10 +0000
X-Env-Sender: blistovmhz@gmail.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1352578263!16565223!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1212 invoked from network); 10 Nov 2012 20:11:04 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-13.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	10 Nov 2012 20:11:04 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so6043957vbi.32
	for <xen-devel@lists.xen.org>; Sat, 10 Nov 2012 12:11:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=oKbV+h/PRTwEAtwKTOJojUJ5eJmLc/iHaYtmPGMZBLs=;
	b=iZ81VKDMaR84xxJHk7fEeNK3G5eIXqsv8vEyS3ecX82tEmE2qwSYheuPtHuyzAHkY0
	KA6DD5Bo2TZT1QIE1NioL7nG4rfzwkAiVpTjFI8Ux9GzEZRgYoXfcH3kfQemjgi7FNVL
	WrPlTH24S3t59O+ArYF8JWJz9557kW/cET1y1Dmv29X9uU2Hnxq6VIq8aRu4LabhajNz
	vn8yr+Fywr8kpiAiYFSs8ZWNfODWnE18PZzwPr9GNpXHXmZMHMNZL7iyJolBoUkRHuSO
	zAc8GEfkEVB8bEOTeOA9FvakoiLvmrPt0xCxUxsvv/50vNNCnL/0ecg133yf2Yu0O8Tv
	j6Ng==
MIME-Version: 1.0
Received: by 10.52.179.231 with SMTP id dj7mr14573430vdc.108.1352578262943;
	Sat, 10 Nov 2012 12:11:02 -0800 (PST)
Received: by 10.220.37.8 with HTTP; Sat, 10 Nov 2012 12:11:02 -0800 (PST)
In-Reply-To: <CAN3GA=SiufUOi977SpWj+FGd9WdZUBtAoG18xUpQdSmr4g-boA@mail.gmail.com>
References: <mailman.5.1352548802.11332.xen-devel@lists.xen.org>
	<CAN3GA=SiufUOi977SpWj+FGd9WdZUBtAoG18xUpQdSmr4g-boA@mail.gmail.com>
Date: Sat, 10 Nov 2012 12:11:02 -0800
Message-ID: <CAN3GA=RyB_O=huShjYuviqvbY7gNjHyn4c3s-GuAeBoR6=Uw4Q@mail.gmail.com>
From: feral <blistovmhz@gmail.com>
To: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Xen-devel Digest, Vol 93, Issue 79
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0408609209009085176=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0408609209009085176==
Content-Type: multipart/alternative; boundary=bcaec5014c71e4c85004ce29aa99

--bcaec5014c71e4c85004ce29aa99
Content-Type: text/plain; charset=ISO-8859-1

Can't run Xen-4.3 unstable kernel with old xm tools:
WARING:  Can't find version unstable of xen utils, fallback to default
version!
Error: Unable to connect to xend: No such file or directory. Is xend
running?

Guessing the same will be true of running the older 4.1 kernel with the new
xl toolstack, so not sure how to proceed in testing.

I should mention that the only reason I was testing 4.3 was because there
is a bug in usb-linux.c compiled into qemu-dm from 4.1 where you are unable
to attach a usb device which has a serial interface (eg: game controller
with analog controls).  My Logitech Driving Force GT wheel works fine in
4.1 but some Xbox controller couldn't be successfully passed through to the
DomU.
Perhaps I should be investigating some other avenue?
I suppose this is very unlikely to be a big deal for anyone.  I'm not using
the controller, was just testing usb-passthrough of devices I knew would
have a serial interface riding on top of usb.
Problem was solved in KVM qemu with a very simple patch and was wondering
if Xen had applied the same patch.


Re: PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
      IO_PAGE_FAULT: (Hans Mueller)
OMG, why do most messages only show up in the daily batch but not
individually?

@Hans
As far as I can tell, the guest is running fine until we see the IO_PAGE_FAULT.
 The machine is still pingable, but I suppose there's not much I can do to
verify the DomU's state.
Going to try running the newer qemu with Xen 4.1 and then Xen-4.2/4.3 with
the older qemu-dm today.





On Sat, Nov 10, 2012 at 11:42 AM, feral <blistovmhz@gmail.com> wrote:

> Re: PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
>       IO_PAGE_FAULT: (Hans Mueller)
> OMG, why do most messages only show up in the daily batch but not
> individually?
>
> @Hans
> As far as I can tell, the guest is running fine until we see the IO_PAGE_FAULT.
>  The machine is still pingable, but I suppose there's not much I can do to
> verify the DomU's state.
> Going to try running the newer qemu with Xen 4.1 and then Xen-4.2/4.3 with
> the older qemu-dm today.
>
>
> On Sat, Nov 10, 2012 at 4:00 AM, <xen-devel-request@lists.xen.org> wrote:
>
>> Send Xen-devel mailing list submissions to
>>         xen-devel@lists.xen.org
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>>         http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel
>> or, via email, send a message with subject or body 'help' to
>>         xen-devel-request@lists.xen.org
>>
>> You can reach the person managing the list at
>>         xen-devel-owner@lists.xen.org
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of Xen-devel digest..."
>>
>>
>> Today's Topics:
>>
>>    1. Re: PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
>>       IO_PAGE_FAULT: (Hans Mueller)
>>    2. Re: Dom0 physical networking/swiotlb/something issue in
>>       3.7-rc1 (Jan Beulich)
>>    3. Re: Bugs in xl that affect stubdom+tapdisk2, and others
>>       (Matt Wilson)
>>    4. [xen-unstable test] 14377: tolerable FAIL (xen.org)
>>    5. .vhd will not boot in VM (Juan Lorenzana)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Fri, 09 Nov 2012 18:14:39 +0100
>> From: Hans Mueller <mcbeagle@gmx.de>
>> To: xen-devel@lists.xen.org
>> Subject: Re: [Xen-devel] PCI/VGA passthrough on >Xen-4.2 - (XEN)
>>         AMD-Vi: IO_PAGE_FAULT:
>> Message-ID: <1871003.0Pup8WfsfS@sheik-lin>
>> Content-Type: text/plain; charset="us-ascii"
>>
>> On Friday, 9. November 2012 16:33:47 Ian Campbell wrote:
>> > On Fri, 2012-11-09 at 16:25 +0000, Hans Mueller wrote:
>> > > On Thursday, 8. November 2012 20:02:51 feral wrote:
>> > > > Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable.  Tested against all
>> > > > three.
>> > > >
>> > > > VGA passthrough previously working with 4.1 is no longer working
>> with
>> > > > >4.2.
>> > > >
>> > > > Setup - Working:
>> > > > Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos),
>> > > > libvirt-bin,
>> > > > xend
>> > > > Asus Radeon HD 7870 DirectCU.
>> > > > Works perfect.  Benches on par with bare metal.
>> > > >
>> > > > Setup - Broken:
>> > > > Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (from
>> GIT), xl
>> > > > toolstack.
>> > > > Asus Radeon HD 7870 DirectCU.
>> > > > Some times the guest boots correctly but display is never enabled.
>> > > >
>> > > >  Sometimes BSOD, doesn't seem to be any rhyme or reason?
>> > > >
>> > > > No errors in logs.   Found the following in 'xl dmesg':
>> > > > (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 2, device id = 0x600, fault
>> > > > address =
>> > > > 0x1ac800000, flags = 0
>> > >
>> > > I had a similar problem since hg revision 25818:50adc933faaf which
>> changes
>> > > the qemu tag.
>> > > It looks like the qemu commit
>> > > 3e66da7266c84638c0e22a09c9d2b07529802576
>> > > (qemu-xen-trad: fix msi_translate with PV event delivery)
>> > > causes this behavior.
>> > >
>> > > I solved the problem for me by using 'pci_msitranslate=0' in the domU
>> > > config.
>> > I don't follow this stuff closely but I could have sworn we had disabled
>> > msitranslate by default.
>> >
>> > In any case I don't think that changeset was intended to cause anything
>> > like this -- Stefano?
>> >
>> > > In addition I had to reboot (perhaps poweroff?) the dom0 once the
>> > > IO_PAGE_FAULT occured.
>>
>> One more info for you - afair i noticed that it was not only the
>> IO_PAGE_FAULT
>> which occured but also the qemu process in dom0 crashed w/o any messages
>> in
>> the logs, perhaps feral can confirm this?
>>
>>
>>
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Fri, 09 Nov 2012 17:34:35 +0000
>> From: "Jan Beulich" <jbeulich@suse.com>
>> To: <konrad.wilk@oracle.com>
>> Cc: Ian.Campbell@citrix.com, xen-devel@lists.xen.org
>> Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something
>>         issue in 3.7-rc1
>> Message-ID: <509D3EAB020000780008F4B6@nat28.tlf.novell.com>
>> Content-Type: text/plain; charset=US-ASCII
>>
>> >>> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> 11/09/12 2:48 PM >>>
>> >On Fri, Nov 09, 2012 at 11:43:39AM +0000, Jan Beulich wrote:
>> >> >>> On 09.11.12 at 11:36, "Jan Beulich" <JBeulich@suse.com> wrote:
>> >> > In the forward ported kernels, those two checks are however
>> >> > accompanied by range_needs_mapping() (aka
>> >> > range_straddles_page_boundary()) checks, which ought to
>> >> > take care of this. There is brokenness there with the invocations
>> >> > of gnttab_dma_map_page(), but only if the initial offset is at
>> >> > least PAGE_SIZE - will have to check whether that occurs.
>> >>
>> >> And indeed, fixing this also makes the problem go away when
>> >> the allocation order doesn't get forced to zero. So presumably
>> >> there's also only that one problem I had pointed out in pv-ops.
>> >
>> >The pvops one has this in the map-page variant (xen_swiotlb_map_page):
>> >
>> >351         if (dma_capable(dev, dev_addr, size) &&
>> >352             !range_straddles_page_boundary(phys, size) &&
>> !swiotlb_force)
>> >353                 return dev_addr;
>> >
>> >and in the sg variant:
>> >
>> >494                 if (swiotlb_force ||
>> >495                     !dma_capable(hwdev, dev_addr, sg->length) ||
>> >496                     range_straddles_page_boundary(paddr,
>> sg->length)) {
>> >497                         void *map = swiotlb_tbl_map_single(hwdev,
>>
>> Oh, right, I forgot that there's yet another clone of that code under
>> drivers/xen/.
>>
>> >So I think that check is OK. There is no gnttab_dma_map_page call - so
>> that
>> >can't be the issue.
>>
>> Indeed.
>>
>> Jan
>>
>>
>>
>>
>> ------------------------------
>>
>> Message: 3
>> Date: Fri, 9 Nov 2012 11:55:55 -0800
>> From: Matt Wilson <msw@amazon.com>
>> To: Ian Campbell <Ian.Campbell@citrix.com>
>> Cc: "george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>,
>>         "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
>>        John
>>         Weekes <lists.xen@nuclearfallout.net>,  Roger Pau Monne
>>         <roger.pau@citrix.com>
>> Subject: Re: [Xen-devel] Bugs in xl that affect stubdom+tapdisk2, and
>>         others
>> Message-ID:
>>         <20121109195553.GA11023@u109add4315675089e695.ant.amazon.com>
>> Content-Type: text/plain; charset="us-ascii"
>>
>> On Fri, Nov 09, 2012 at 01:29:04PM +0000, Ian Campbell wrote:
>> > On Thu, 2012-11-08 at 20:45 +0000, John Weekes wrote:
>> > > As an additional note about 4.2 -- this isn't an "xl" issue, but
>> rather
>> > > a build problem -- even though I use "./configure
>> --libdir=/usr/lib64",
>> > > the build is still creating a "dist/install/usr/lib" directory, and
>> > > because of this, running ./install.sh nukes my system's "/usr/lib" ->
>> > > "/usr/lib64" softlink (which in turn causes all sorts of other
>> problems
>> > > until it's corrected). Files that are being put in that tree:
>> > >
>> > > xen-4.2-testing.hg # find dist/install/usr/lib
>> > > dist/install/usr/lib
>> >
>> > This is an interesting one. I'm not sure how we can avoid this
>> > behaviour, perhaps there is a tar option to cause it to follow rather
>> > than clobber synlinks?
>> >
>> > The only other choice I can think of is to change install.sh to use a
>> > (long) explicit list of $(FOO_DIR)/* entries instead of the single * to
>> > avoid including system directories, or to otherwise make install.sh more
>> > fragile and prone to bitrot :-(
>>
>> Oh dear. If we find that there's not a good reason for it anymore, I'd
>> think it would be better to remove install.sh instead.
>>
>> > I must confess I didn't realise anyone used install.sh -- is there some
>> > advantage to it over make foo-install?
>> >
>> > OOI which distro has this lib->lib64 link and what issues does removing
>> > it create?
>> >
>> > > dist/install/usr/lib/xen
>> >
>> > This is $(XENFIRMWAREDIR). I have a feeling there is a reason this is
>> > not using $(LIBDIR), but I don't recall what it was -- Roget/Matt do you
>> > remember?
>>
>> There's no need for these files to be multilib compatible, as they are
>> not runtime DSOs. They're internal to Xen and I think that they should
>> be moved to $LIBEXECDIR instead, like /usr/libexec/xen/. Unfortunately
>> there's not much agreement on the usefulness of /usr/libexec, so we'll
>> need to make sure that packagers can adjust the paths for their
>> systems' standards.
>>
>> For 4.2 we didn't want to change where these files were being placed,
>> and I believe they've bin in $PREFIX/lib/ for quite some time.
>>
>> Matt
>>
>> > Thanks again for reporting all these.
>> >
>> > Ian.
>> >
>> > > dist/install/usr/lib/xen/boot
>> > > dist/install/usr/lib/xen/boot/xenstore-stubdom.gz
>> > > dist/install/usr/lib/xen/boot/ioemu-stubdom.gz
>> > > dist/install/usr/lib/xen/boot/pv-grub-x86_64.gz
>> > > dist/install/usr/lib/xen/boot/hvmloader
>> > > dist/install/usr/lib/xen/boot/pv-grub-x86_32.gz
>> > > dist/install/usr/lib/xen/bin
>> > > dist/install/usr/lib/xen/bin/stubdom-dm
>> > > dist/install/usr/lib/xen/bin/qemu-io
>> > > dist/install/usr/lib/xen/bin/qemu-nbd
>> > > dist/install/usr/lib/xen/bin/qemu-img
>> > > dist/install/usr/lib/xen/bin/xenpaging
>> > > dist/install/usr/lib/xen/bin/qemu-dm
>> > > dist/install/usr/lib/xen/bin/qemu-system-i386
>> > > dist/install/usr/lib/xen/bin/qemu-ga
>> > > dist/install/usr/lib/xen/bin/stubdompath.sh
>>
>>
>>
>> ------------------------------
>>
>> Message: 4
>> Date: Sat, 10 Nov 2012 05:53:35 +0000
>> From: xen.org <ian.jackson@eu.citrix.com>
>> To: <xen-devel@lists.xensource.com>
>> Cc: ian.jackson@eu.citrix.com
>> Subject: [Xen-devel] [xen-unstable test] 14377: tolerable FAIL
>> Message-ID: <osstest-14377-mainreport@xen.org>
>> Content-Type: text/plain
>>
>> flight 14377 xen-unstable real [real]
>> http://www.chiark.greenend.org.uk/~xensrcts/logs/14377/
>>
>> Failures :-/ but no regressions.
>>
>> Regressions which are regarded as allowable (not blocking):
>>  test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like
>> 14376
>>  test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like
>> 14376
>>  test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like
>> 14376
>>  test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like
>> 14376
>>
>> Tests which did not succeed, but are not blocking:
>>  test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail
>> never pass
>>  test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail
>>  never pass
>>  test-amd64-i386-win          16 leak-check/check             fail
>> never pass
>>  test-amd64-amd64-win         16 leak-check/check             fail
>> never pass
>>  test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail
>>  never pass
>>  test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail
>> never pass
>>  test-amd64-i386-win-vcpus1   16 leak-check/check             fail
>> never pass
>>  test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail
>>  never pass
>>  test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail
>> never pass
>>  test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail
>> never pass
>>  test-amd64-amd64-xl-win      13 guest-stop                   fail
>> never pass
>>
>> version targeted for testing:
>>  xen                  62885b3c34c8
>> baseline version:
>>  xen                  62885b3c34c8
>>
>> jobs:
>>  build-amd64                                                  pass
>>  build-i386                                                   pass
>>  build-amd64-oldkern                                          pass
>>  build-i386-oldkern                                           pass
>>  build-amd64-pvops                                            pass
>>  build-i386-pvops                                             pass
>>  test-amd64-amd64-xl                                          pass
>>  test-amd64-i386-xl                                           pass
>>  test-amd64-i386-rhel6hvm-amd                                 pass
>>  test-amd64-i386-qemuu-rhel6hvm-amd                           pass
>>  test-amd64-amd64-xl-qemuu-win7-amd64                         fail
>>  test-amd64-amd64-xl-win7-amd64                               fail
>>  test-amd64-i386-xl-win7-amd64                                fail
>>  test-amd64-i386-xl-credit2                                   pass
>>  test-amd64-amd64-xl-pcipt-intel                              fail
>>  test-amd64-i386-rhel6hvm-intel                               pass
>>  test-amd64-i386-qemuu-rhel6hvm-intel                         pass
>>  test-amd64-i386-xl-multivcpu                                 pass
>>  test-amd64-amd64-pair                                        pass
>>  test-amd64-i386-pair                                         pass
>>  test-amd64-amd64-xl-sedf-pin                                 fail
>>  test-amd64-amd64-pv                                          pass
>>  test-amd64-i386-pv                                           pass
>>  test-amd64-amd64-xl-sedf                                     fail
>>  test-amd64-i386-win-vcpus1                                   fail
>>  test-amd64-i386-xl-win-vcpus1                                fail
>>  test-amd64-i386-xl-winxpsp3-vcpus1                           fail
>>  test-amd64-amd64-win                                         fail
>>  test-amd64-i386-win                                          fail
>>  test-amd64-amd64-xl-win                                      fail
>>  test-amd64-amd64-xl-qemuu-winxpsp3                           fail
>>  test-amd64-i386-xend-winxpsp3                                fail
>>  test-amd64-amd64-xl-winxpsp3                                 fail
>>
>>
>> ------------------------------------------------------------
>> sg-report-flight on woking.cam.xci-test.com
>> logs: /home/xc_osstest/logs
>> images: /home/xc_osstest/images
>>
>> Logs, config files, etc. are available at
>>     http://www.chiark.greenend.org.uk/~xensrcts/logs
>>
>> Test harness code can be found at
>>     http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary
>>
>>
>> Published tested tree is already up to date.
>>
>>
>>
>>
>> ------------------------------
>>
>> Message: 5
>> Date: Fri, 9 Nov 2012 04:01:36 -0700
>> From: "Juan Lorenzana" <juan@jelsupport.com>
>> To: <xen-devel@lists.xen.org>
>> Subject: [Xen-devel] .vhd will not boot in VM
>> Message-ID: <F2EF84CA5BCF824AA4197956E124073848F4AE@server.jel.local>
>> Content-Type: text/plain; charset="us-ascii"
>>
>> We had a XCP 1.5 pool with 2 machines as hosts.  The storage pool which
>> as NFS mounted lost its ability to export the filesystem with the VM
>> images on it.
>>
>>
>>
>> We contacted the vendor and we were able to restore it.  However, they
>> had recommended that we delete the XCP Pool, recreate it, add the hosts
>> back in, and then mount the storage.
>>
>>
>>
>> That is where we are at now.  We can see the storage and the VM images.
>> However in XCP Xen Center when looking at the images is clear that the
>> metadata is lost.  So we can not see which image or snap shot belongs to
>> which VM.  The names all are blank when we look at the storage.
>>
>>
>>
>> Also, if I randomly mount an image to a VM, it does not boot.  It
>> produces an error that says:
>>
>>
>>
>> Traceback (most recent call last): - File "/usr/binpygrub", line 808, in
>> ? - fs = fsimage.open(file,part_offs[0[, bootfsoptions) - IOError:
>> [Errno 95] Operation not supported.
>>
>>
>>
>> The system kept the VM information as we destroyed the pool and then
>> created a new one but it looks like we only see snapshots through
>> XenCenter.  Its like the real .vhd that were running are not showing up.
>>
>>
>>
>> I know it is pretty bad.  We should not have listened to the storage
>> guys.
>>
>>
>>
>> Does anyone know someone that can help?
>>
>>
>>
>> Juan
>>
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <
>> http://lists.xen.org/archives/html/xen-devel/attachments/20121109/a085ab22/attachment.html
>> >
>>
>> ------------------------------
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>>
>>
>> End of Xen-devel Digest, Vol 93, Issue 79
>> *****************************************
>>
>
>
>
> --
> _____
> Fact:
> 1. Ninjas are mammals.
> 2. Ninjas fight ALL the time.
> 3. The purpose of the ninja is to flip out and kill people.
>



-- 
_____
Fact:
1. Ninjas are mammals.
2. Ninjas fight ALL the time.
3. The purpose of the ninja is to flip out and kill people.

--bcaec5014c71e4c85004ce29aa99
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div class=3D"im" style=3D"font-family:arial,sans-serif;font-size:13px">Can=
&#39;t run Xen-4.3 unstable kernel with old xm tools:</div><div class=3D"im=
"><div class=3D"im"><font face=3D"arial, sans-serif">WARING: =A0Can&#39;t f=
ind version unstable of xen utils, fallback to default version!</font></div=
>
<div class=3D"im"><font face=3D"arial, sans-serif">Error: Unable to connect=
 to xend: No such file or directory. Is xend running?</font></div><div styl=
e=3D"font-family:arial,sans-serif;font-size:13px"><br></div><div style=3D"f=
ont-family:arial,sans-serif;font-size:13px">
Guessing the same will be true of running the older 4.1 kernel with the new=
 xl toolstack, so not sure how to proceed in testing.</div><div style=3D"fo=
nt-family:arial,sans-serif;font-size:13px"><br></div><div style=3D"font-fam=
ily:arial,sans-serif;font-size:13px">
I should mention that the only reason I was testing 4.3 was because there i=
s a bug in usb-linux.c compiled into qemu-dm from 4.1 where you are unable =
to attach a usb device which has a serial interface (eg: game controller wi=
th analog controls). =A0My Logitech Driving Force GT wheel works fine in 4.=
1 but some Xbox controller couldn&#39;t be successfully passed through to t=
he DomU.</div>
<div style=3D"font-family:arial,sans-serif;font-size:13px">Perhaps I should=
 be investigating some other avenue? =A0<br>I suppose this is very unlikely=
 to be a big deal for anyone. =A0I&#39;m not using the controller, was just=
 testing usb-passthrough of devices I knew would have a serial interface ri=
ding on top of usb.</div>
<div style=3D"font-family:arial,sans-serif;font-size:13px">Problem was solv=
ed in KVM qemu with a very simple patch and was wondering if Xen had applie=
d the same patch.</div></div><div class=3D"im" style=3D"font-family:arial,s=
ans-serif;font-size:13px">
<br></div><div class=3D"im" style=3D"font-family:arial,sans-serif;font-size=
:13px"><br></div><div class=3D"im" style=3D"font-family:arial,sans-serif;fo=
nt-size:13px">Re: PCI/VGA passthrough on &gt;Xen-4.2 - (XEN) AMD-Vi:<br>=A0=
 =A0 =A0 IO_PAGE_FAULT: (Hans Mueller)<br>
</div><div style=3D"font-family:arial,sans-serif;font-size:13px">OMG, why d=
o most messages only show up in the daily batch but not individually?</div>=
<div style=3D"font-family:arial,sans-serif;font-size:13px"><br></div><div s=
tyle=3D"font-family:arial,sans-serif;font-size:13px">
@Hans</div><div style=3D"font-family:arial,sans-serif;font-size:13px">As fa=
r as I can tell, the guest is running fine until we see the=A0<font face=3D=
"arial, sans-serif">IO_PAGE_FAULT. =A0The machine is still pingable, but I =
suppose there&#39;s not much I can do to verify the DomU&#39;s state.</font=
></div>
<div style=3D"font-family:arial,sans-serif;font-size:13px"><font face=3D"ar=
ial, sans-serif">Going to try running the newer qemu with Xen 4.1 and then =
Xen-4.2/4.3 with the older qemu-dm today.</font></div><div style=3D"font-fa=
mily:arial,sans-serif;font-size:13px">
<font face=3D"arial, sans-serif"><br></font></div><div style=3D"font-family=
:arial,sans-serif;font-size:13px"><br></div><div style=3D"font-family:arial=
,sans-serif;font-size:13px"><font face=3D"arial, sans-serif"><br></font></d=
iv><div class=3D"gmail_extra">
<br><br><div class=3D"gmail_quote">On Sat, Nov 10, 2012 at 11:42 AM, feral =
<span dir=3D"ltr">&lt;<a href=3D"mailto:blistovmhz@gmail.com" target=3D"_bl=
ank">blistovmhz@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gma=
il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef=
t:1ex">
<div class=3D"im"><span style=3D"font-family:arial,sans-serif;font-size:13p=
x">Re: PCI/VGA passthrough on &gt;Xen-4.2 - (XEN) AMD-Vi:</span><br style=
=3D"font-family:arial,sans-serif;font-size:13px"><span style=3D"font-family=
:arial,sans-serif;font-size:13px">=A0 =A0 =A0 IO_PAGE_FAULT: (Hans Mueller)=
</span><br>


</div><div><span style=3D"font-family:arial,sans-serif;font-size:13px">OMG,=
 why do most messages only show up in the daily batch but not individually?=
</span></div><div><span style=3D"font-family:arial,sans-serif;font-size:13p=
x"><br>

</span></div><div><span style=3D"font-family:arial,sans-serif;font-size:13p=
x">@Hans</span></div><div><span style=3D"font-family:arial,sans-serif;font-=
size:13px">As far as I can tell, the guest is running fine until we see the=
=A0</span><font face=3D"arial, sans-serif">IO_PAGE_FAULT. =A0The machine is=
 still pingable, but I suppose there&#39;s not much I can do to verify the =
DomU&#39;s state.</font></div>

<div><font face=3D"arial, sans-serif">Going to try running the newer qemu w=
ith Xen 4.1 and then Xen-4.2/4.3 with the older qemu-dm today.</font></div>
<div class=3D"gmail_extra"><div><div class=3D"h5"><br><br><div class=3D"gma=
il_quote">On Sat, Nov 10, 2012 at 4:00 AM,  <span dir=3D"ltr">&lt;<a href=
=3D"mailto:xen-devel-request@lists.xen.org" target=3D"_blank">xen-devel-req=
uest@lists.xen.org</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">Send Xen-devel mailing list submissions to<b=
r>
=A0 =A0 =A0 =A0 <a href=3D"mailto:xen-devel@lists.xen.org" target=3D"_blank=
">xen-devel@lists.xen.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
=A0 =A0 =A0 =A0 <a href=3D"http://lists.xen.org/cgi-bin/mailman/listinfo/xe=
n-devel" target=3D"_blank">http://lists.xen.org/cgi-bin/mailman/listinfo/xe=
n-devel</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
=A0 =A0 =A0 =A0 <a href=3D"mailto:xen-devel-request@lists.xen.org" target=
=3D"_blank">xen-devel-request@lists.xen.org</a><br>
<br>
You can reach the person managing the list at<br>
=A0 =A0 =A0 =A0 <a href=3D"mailto:xen-devel-owner@lists.xen.org" target=3D"=
_blank">xen-devel-owner@lists.xen.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of Xen-devel digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
=A0 =A01. Re: PCI/VGA passthrough on &gt;Xen-4.2 - (XEN) AMD-Vi:<br>
=A0 =A0 =A0 IO_PAGE_FAULT: (Hans Mueller)<br>
=A0 =A02. Re: Dom0 physical networking/swiotlb/something issue in<br>
=A0 =A0 =A0 3.7-rc1 (Jan Beulich)<br>
=A0 =A03. Re: Bugs in xl that affect stubdom+tapdisk2, and others<br>
=A0 =A0 =A0 (Matt Wilson)<br>
=A0 =A04. [xen-unstable test] 14377: tolerable FAIL (<a href=3D"http://xen.=
org" target=3D"_blank">xen.org</a>)<br>
=A0 =A05. .vhd will not boot in VM (Juan Lorenzana)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Fri, 09 Nov 2012 18:14:39 +0100<br>
From: Hans Mueller &lt;<a href=3D"mailto:mcbeagle@gmx.de" target=3D"_blank"=
>mcbeagle@gmx.de</a>&gt;<br>
To: <a href=3D"mailto:xen-devel@lists.xen.org" target=3D"_blank">xen-devel@=
lists.xen.org</a><br>
Subject: Re: [Xen-devel] PCI/VGA passthrough on &gt;Xen-4.2 - (XEN)<br>
=A0 =A0 =A0 =A0 AMD-Vi: IO_PAGE_FAULT:<br>
Message-ID: &lt;1871003.0Pup8WfsfS@sheik-lin&gt;<br>
Content-Type: text/plain; charset=3D&quot;us-ascii&quot;<br>
<br>
On Friday, 9. November 2012 16:33:47 Ian Campbell wrote:<br>
&gt; On Fri, 2012-11-09 at 16:25 +0000, Hans Mueller wrote:<br>
&gt; &gt; On Thursday, 8. November 2012 20:02:51 feral wrote:<br>
&gt; &gt; &gt; Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable. =A0Tested aga=
inst all<br>
&gt; &gt; &gt; three.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; VGA passthrough previously working with 4.1 is no longer wor=
king with<br>
&gt; &gt; &gt; &gt;4.2.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Setup - Working:<br>
&gt; &gt; &gt; Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos)=
,<br>
&gt; &gt; &gt; libvirt-bin,<br>
&gt; &gt; &gt; xend<br>
&gt; &gt; &gt; Asus Radeon HD 7870 DirectCU.<br>
&gt; &gt; &gt; Works perfect. =A0Benches on par with bare metal.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Setup - Broken:<br>
&gt; &gt; &gt; Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (f=
rom GIT), xl<br>
&gt; &gt; &gt; toolstack.<br>
&gt; &gt; &gt; Asus Radeon HD 7870 DirectCU.<br>
&gt; &gt; &gt; Some times the guest boots correctly but display is never en=
abled.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; =A0Sometimes BSOD, doesn&#39;t seem to be any rhyme or reaso=
n?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; No errors in logs. =A0 Found the following in &#39;xl dmesg&=
#39;:<br>
&gt; &gt; &gt; (XEN) AMD-Vi: IO_PAGE_FAULT: domain =3D 2, device id =3D 0x6=
00, fault<br>
&gt; &gt; &gt; address =3D<br>
&gt; &gt; &gt; 0x1ac800000, flags =3D 0<br>
&gt; &gt;<br>
&gt; &gt; I had a similar problem since hg revision 25818:50adc933faaf whic=
h changes<br>
&gt; &gt; the qemu tag.<br>
&gt; &gt; It looks like the qemu commit<br>
&gt; &gt; 3e66da7266c84638c0e22a09c9d2b07529802576<br>
&gt; &gt; (qemu-xen-trad: fix msi_translate with PV event delivery)<br>
&gt; &gt; causes this behavior.<br>
&gt; &gt;<br>
&gt; &gt; I solved the problem for me by using &#39;pci_msitranslate=3D0&#3=
9; in the domU<br>
&gt; &gt; config.<br>
&gt; I don&#39;t follow this stuff closely but I could have sworn we had di=
sabled<br>
&gt; msitranslate by default.<br>
&gt;<br>
&gt; In any case I don&#39;t think that changeset was intended to cause any=
thing<br>
&gt; like this -- Stefano?<br>
&gt;<br>
&gt; &gt; In addition I had to reboot (perhaps poweroff?) the dom0 once the=
<br>
&gt; &gt; IO_PAGE_FAULT occured.<br>
<br>
One more info for you - afair i noticed that it was not only the IO_PAGE_FA=
ULT<br>
which occured but also the qemu process in dom0 crashed w/o any messages in=
<br>
the logs, perhaps feral can confirm this?<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Fri, 09 Nov 2012 17:34:35 +0000<br>
From: &quot;Jan Beulich&quot; &lt;<a href=3D"mailto:jbeulich@suse.com" targ=
et=3D"_blank">jbeulich@suse.com</a>&gt;<br>
To: &lt;<a href=3D"mailto:konrad.wilk@oracle.com" target=3D"_blank">konrad.=
wilk@oracle.com</a>&gt;<br>
Cc: <a href=3D"mailto:Ian.Campbell@citrix.com" target=3D"_blank">Ian.Campbe=
ll@citrix.com</a>, <a href=3D"mailto:xen-devel@lists.xen.org" target=3D"_bl=
ank">xen-devel@lists.xen.org</a><br>
Subject: Re: [Xen-devel] Dom0 physical networking/swiotlb/something<br>
=A0 =A0 =A0 =A0 issue in 3.7-rc1<br>
Message-ID: &lt;<a href=3D"mailto:509D3EAB020000780008F4B6@nat28.tlf.novell=
.com" target=3D"_blank">509D3EAB020000780008F4B6@nat28.tlf.novell.com</a>&g=
t;<br>
Content-Type: text/plain; charset=3DUS-ASCII<br>
<br>
&gt;&gt;&gt; Konrad Rzeszutek Wilk &lt;<a href=3D"mailto:konrad.wilk@oracle=
.com" target=3D"_blank">konrad.wilk@oracle.com</a>&gt; 11/09/12 2:48 PM &gt=
;&gt;&gt;<br>
&gt;On Fri, Nov 09, 2012 at 11:43:39AM +0000, Jan Beulich wrote:<br>
&gt;&gt; &gt;&gt;&gt; On 09.11.12 at 11:36, &quot;Jan Beulich&quot; &lt;<a =
href=3D"mailto:JBeulich@suse.com" target=3D"_blank">JBeulich@suse.com</a>&g=
t; wrote:<br>
&gt;&gt; &gt; In the forward ported kernels, those two checks are however<b=
r>
&gt;&gt; &gt; accompanied by range_needs_mapping() (aka<br>
&gt;&gt; &gt; range_straddles_page_boundary()) checks, which ought to<br>
&gt;&gt; &gt; take care of this. There is brokenness there with the invocat=
ions<br>
&gt;&gt; &gt; of gnttab_dma_map_page(), but only if the initial offset is a=
t<br>
&gt;&gt; &gt; least PAGE_SIZE - will have to check whether that occurs.<br>
&gt;&gt;<br>
&gt;&gt; And indeed, fixing this also makes the problem go away when<br>
&gt;&gt; the allocation order doesn&#39;t get forced to zero. So presumably=
<br>
&gt;&gt; there&#39;s also only that one problem I had pointed out in pv-ops=
.<br>
&gt;<br>
&gt;The pvops one has this in the map-page variant (xen_swiotlb_map_page):<=
br>
&gt;<br>
&gt;351 =A0 =A0 =A0 =A0 if (dma_capable(dev, dev_addr, size) &amp;&amp;<br>
&gt;352 =A0 =A0 =A0 =A0 =A0 =A0 !range_straddles_page_boundary(phys, size) =
&amp;&amp; !swiotlb_force)<br>
&gt;353 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return dev_addr;<br>
&gt;<br>
&gt;and in the sg variant:<br>
&gt;<br>
&gt;494 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (swiotlb_force ||<br>
&gt;495 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 !dma_capable(hwdev, dev_add=
r, sg-&gt;length) ||<br>
&gt;496 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 range_straddles_page_bounda=
ry(paddr, sg-&gt;length)) {<br>
&gt;497 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *map =3D swiot=
lb_tbl_map_single(hwdev,<br>
<br>
Oh, right, I forgot that there&#39;s yet another clone of that code under d=
rivers/xen/.<br>
<br>
&gt;So I think that check is OK. There is no gnttab_dma_map_page call - so =
that<br>
&gt;can&#39;t be the issue.<br>
<br>
Indeed.<br>
<br>
Jan<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Fri, 9 Nov 2012 11:55:55 -0800<br>
From: Matt Wilson &lt;<a href=3D"mailto:msw@amazon.com" target=3D"_blank">m=
sw@amazon.com</a>&gt;<br>
To: Ian Campbell &lt;<a href=3D"mailto:Ian.Campbell@citrix.com" target=3D"_=
blank">Ian.Campbell@citrix.com</a>&gt;<br>
Cc: &quot;<a href=3D"mailto:george.dunlap@eu.citrix.com" target=3D"_blank">=
george.dunlap@eu.citrix.com</a>&quot; &lt;<a href=3D"mailto:george.dunlap@e=
u.citrix.com" target=3D"_blank">george.dunlap@eu.citrix.com</a>&gt;,<br>
=A0 =A0 =A0 =A0 &quot;<a href=3D"mailto:xen-devel@lists.xensource.com" targ=
et=3D"_blank">xen-devel@lists.xensource.com</a>&quot; &lt;<a href=3D"mailto=
:xen-devel@lists.xensource.com" target=3D"_blank">xen-devel@lists.xensource=
.com</a>&gt;, =A0 =A0 =A0 =A0John<br>

=A0 =A0 =A0 =A0 Weekes &lt;<a href=3D"mailto:lists.xen@nuclearfallout.net" =
target=3D"_blank">lists.xen@nuclearfallout.net</a>&gt;, =A0Roger Pau Monne<=
br>
=A0 =A0 =A0 =A0 &lt;<a href=3D"mailto:roger.pau@citrix.com" target=3D"_blan=
k">roger.pau@citrix.com</a>&gt;<br>
Subject: Re: [Xen-devel] Bugs in xl that affect stubdom+tapdisk2, and<br>
=A0 =A0 =A0 =A0 others<br>
Message-ID:<br>
=A0 =A0 =A0 =A0 &lt;<a href=3D"mailto:20121109195553.GA11023@u109add4315675=
089e695.ant.amazon.com" target=3D"_blank">20121109195553.GA11023@u109add431=
5675089e695.ant.amazon.com</a>&gt;<br>
Content-Type: text/plain; charset=3D&quot;us-ascii&quot;<br>
<br>
On Fri, Nov 09, 2012 at 01:29:04PM +0000, Ian Campbell wrote:<br>
&gt; On Thu, 2012-11-08 at 20:45 +0000, John Weekes wrote:<br>
&gt; &gt; As an additional note about 4.2 -- this isn&#39;t an &quot;xl&quo=
t; issue, but rather<br>
&gt; &gt; a build problem -- even though I use &quot;./configure --libdir=
=3D/usr/lib64&quot;,<br>
&gt; &gt; the build is still creating a &quot;dist/install/usr/lib&quot; di=
rectory, and<br>
&gt; &gt; because of this, running ./install.sh nukes my system&#39;s &quot=
;/usr/lib&quot; -&gt;<br>
&gt; &gt; &quot;/usr/lib64&quot; softlink (which in turn causes all sorts o=
f other problems<br>
&gt; &gt; until it&#39;s corrected). Files that are being put in that tree:=
<br>
&gt; &gt;<br>
&gt; &gt; xen-4.2-testing.hg # find dist/install/usr/lib<br>
&gt; &gt; dist/install/usr/lib<br>
&gt;<br>
&gt; This is an interesting one. I&#39;m not sure how we can avoid this<br>
&gt; behaviour, perhaps there is a tar option to cause it to follow rather<=
br>
&gt; than clobber synlinks?<br>
&gt;<br>
&gt; The only other choice I can think of is to change install.sh to use a<=
br>
&gt; (long) explicit list of $(FOO_DIR)/* entries instead of the single * t=
o<br>
&gt; avoid including system directories, or to otherwise make install.sh mo=
re<br>
&gt; fragile and prone to bitrot :-(<br>
<br>
Oh dear. If we find that there&#39;s not a good reason for it anymore, I&#3=
9;d<br>
think it would be better to remove install.sh instead.<br>
<br>
&gt; I must confess I didn&#39;t realise anyone used install.sh -- is there=
 some<br>
&gt; advantage to it over make foo-install?<br>
&gt;<br>
&gt; OOI which distro has this lib-&gt;lib64 link and what issues does remo=
ving<br>
&gt; it create?<br>
&gt;<br>
&gt; &gt; dist/install/usr/lib/xen<br>
&gt;<br>
&gt; This is $(XENFIRMWAREDIR). I have a feeling there is a reason this is<=
br>
&gt; not using $(LIBDIR), but I don&#39;t recall what it was -- Roget/Matt =
do you<br>
&gt; remember?<br>
<br>
There&#39;s no need for these files to be multilib compatible, as they are<=
br>
not runtime DSOs. They&#39;re internal to Xen and I think that they should<=
br>
be moved to $LIBEXECDIR instead, like /usr/libexec/xen/. Unfortunately<br>
there&#39;s not much agreement on the usefulness of /usr/libexec, so we&#39=
;ll<br>
need to make sure that packagers can adjust the paths for their<br>
systems&#39; standards.<br>
<br>
For 4.2 we didn&#39;t want to change where these files were being placed,<b=
r>
and I believe they&#39;ve bin in $PREFIX/lib/ for quite some time.<br>
<br>
Matt<br>
<br>
&gt; Thanks again for reporting all these.<br>
&gt;<br>
&gt; Ian.<br>
&gt;<br>
&gt; &gt; dist/install/usr/lib/xen/boot<br>
&gt; &gt; dist/install/usr/lib/xen/boot/xenstore-stubdom.gz<br>
&gt; &gt; dist/install/usr/lib/xen/boot/ioemu-stubdom.gz<br>
&gt; &gt; dist/install/usr/lib/xen/boot/pv-grub-x86_64.gz<br>
&gt; &gt; dist/install/usr/lib/xen/boot/hvmloader<br>
&gt; &gt; dist/install/usr/lib/xen/boot/pv-grub-x86_32.gz<br>
&gt; &gt; dist/install/usr/lib/xen/bin<br>
&gt; &gt; dist/install/usr/lib/xen/bin/stubdom-dm<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-io<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-nbd<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-img<br>
&gt; &gt; dist/install/usr/lib/xen/bin/xenpaging<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-dm<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-system-i386<br>
&gt; &gt; dist/install/usr/lib/xen/bin/qemu-ga<br>
&gt; &gt; dist/install/usr/lib/xen/bin/stubdompath.sh<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Sat, 10 Nov 2012 05:53:35 +0000<br>
From: <a href=3D"http://xen.org" target=3D"_blank">xen.org</a> &lt;<a href=
=3D"mailto:ian.jackson@eu.citrix.com" target=3D"_blank">ian.jackson@eu.citr=
ix.com</a>&gt;<br>
To: &lt;<a href=3D"mailto:xen-devel@lists.xensource.com" target=3D"_blank">=
xen-devel@lists.xensource.com</a>&gt;<br>
Cc: <a href=3D"mailto:ian.jackson@eu.citrix.com" target=3D"_blank">ian.jack=
son@eu.citrix.com</a><br>
Subject: [Xen-devel] [xen-unstable test] 14377: tolerable FAIL<br>
Message-ID: &lt;<a href=3D"mailto:osstest-14377-mainreport@xen.org" target=
=3D"_blank">osstest-14377-mainreport@xen.org</a>&gt;<br>
Content-Type: text/plain<br>
<br>
flight 14377 xen-unstable real [real]<br>
<a href=3D"http://www.chiark.greenend.org.uk/~xensrcts/logs/14377/" target=
=3D"_blank">http://www.chiark.greenend.org.uk/~xensrcts/logs/14377/</a><br>
<br>
Failures :-/ but no regressions.<br>
<br>
Regressions which are regarded as allowable (not blocking):<br>
=A0test-amd64-amd64-xl-sedf-pin 10 guest-saverestore =A0 =A0 =A0 =A0 =A0 =
=A0fail =A0 like 14376<br>
=A0test-amd64-amd64-xl-sedf =A0 =A0 =A05 xen-boot =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 fail =A0 like 14376<br>
=A0test-amd64-amd64-xl-qemuu-winxpsp3 =A09 guest-localmigrate =A0 =A0 =A0 f=
ail like 14376<br>
=A0test-amd64-amd64-xl-qemuu-win7-amd64 =A09 guest-localmigrate =A0 =A0 fai=
l like 14376<br>
<br>
Tests which did not succeed, but are not blocking:<br>
=A0test-amd64-amd64-xl-pcipt-intel =A09 guest-start =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 fail never pass<br>
=A0test-amd64-i386-xend-winxpsp3 16 leak-check/check =A0 =A0 =A0 =A0 =A0 =
=A0 fail =A0never pass<br>
=A0test-amd64-i386-win =A0 =A0 =A0 =A0 =A016 leak-check/check =A0 =A0 =A0 =
=A0 =A0 =A0 fail =A0 never pass<br>
=A0test-amd64-amd64-win =A0 =A0 =A0 =A0 16 leak-check/check =A0 =A0 =A0 =A0=
 =A0 =A0 fail =A0 never pass<br>
=A0test-amd64-i386-xl-win-vcpus1 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 fail =A0never pass<br>
=A0test-amd64-amd64-xl-win7-amd64 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 fail never pass<br>
=A0test-amd64-i386-win-vcpus1 =A0 16 leak-check/check =A0 =A0 =A0 =A0 =A0 =
=A0 fail =A0 never pass<br>
=A0test-amd64-i386-xl-win7-amd64 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 fail =A0never pass<br>
=A0test-amd64-amd64-xl-winxpsp3 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 fail =A0 never pass<br>
=A0test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 fail never pass<br>
=A0test-amd64-amd64-xl-win =A0 =A0 =A013 guest-stop =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 fail =A0 never pass<br>
<br>
version targeted for testing:<br>
=A0xen =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A062885b3c34c8<br>
baseline version:<br>
=A0xen =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A062885b3c34c8<br>
<br>
jobs:<br>
=A0build-amd64 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0build-i386 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0build-amd64-oldkern =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0build-i386-oldkern =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0build-amd64-pvops =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0build-i386-pvops =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0test-amd64-i386-xl =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-i386-rhel6hvm-amd =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-i386-qemuu-rhel6hvm-amd =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl-qemuu-win7-amd64 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 fail<br>
=A0test-amd64-amd64-xl-win7-amd64 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-xl-win7-amd64 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-i386-xl-credit2 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl-pcipt-intel =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-i386-rhel6hvm-intel =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-i386-qemuu-rhel6hvm-intel =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 pass<br>
=A0test-amd64-i386-xl-multivcpu =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-pair =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0test-amd64-i386-pair =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl-sedf-pin =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-amd64-pv =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pass<br>
=A0test-amd64-i386-pv =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pass<br>
=A0test-amd64-amd64-xl-sedf =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-win-vcpus1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-xl-win-vcpus1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-i386-xl-winxpsp3-vcpus1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-amd64-win =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-win =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-amd64-xl-win =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-amd64-xl-qemuu-winxpsp3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 fail<br>
=A0test-amd64-i386-xend-winxpsp3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0fail<br>
=A0test-amd64-amd64-xl-winxpsp3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 fail<br>
<br>
<br>
------------------------------------------------------------<br>
sg-report-flight on <a href=3D"http://woking.cam.xci-test.com" target=3D"_b=
lank">woking.cam.xci-test.com</a><br>
logs: /home/xc_osstest/logs<br>
images: /home/xc_osstest/images<br>
<br>
Logs, config files, etc. are available at<br>
=A0 =A0 <a href=3D"http://www.chiark.greenend.org.uk/~xensrcts/logs" target=
=3D"_blank">http://www.chiark.greenend.org.uk/~xensrcts/logs</a><br>
<br>
Test harness code can be found at<br>
=A0 =A0 <a href=3D"http://xenbits.xensource.com/gitweb?p=3Dosstest.git;a=3D=
summary" target=3D"_blank">http://xenbits.xensource.com/gitweb?p=3Dosstest.=
git;a=3Dsummary</a><br>
<br>
<br>
Published tested tree is already up to date.<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Fri, 9 Nov 2012 04:01:36 -0700<br>
From: &quot;Juan Lorenzana&quot; &lt;<a href=3D"mailto:juan@jelsupport.com"=
 target=3D"_blank">juan@jelsupport.com</a>&gt;<br>
To: &lt;<a href=3D"mailto:xen-devel@lists.xen.org" target=3D"_blank">xen-de=
vel@lists.xen.org</a>&gt;<br>
Subject: [Xen-devel] .vhd will not boot in VM<br>
Message-ID: &lt;F2EF84CA5BCF824AA4197956E124073848F4AE@server.jel.local&gt;=
<br>
Content-Type: text/plain; charset=3D&quot;us-ascii&quot;<br>
<br>
We had a XCP 1.5 pool with 2 machines as hosts. =A0The storage pool which<b=
r>
as NFS mounted lost its ability to export the filesystem with the VM<br>
images on it.<br>
<br>
<br>
<br>
We contacted the vendor and we were able to restore it. =A0However, they<br=
>
had recommended that we delete the XCP Pool, recreate it, add the hosts<br>
back in, and then mount the storage.<br>
<br>
<br>
<br>
That is where we are at now. =A0We can see the storage and the VM images.<b=
r>
However in XCP Xen Center when looking at the images is clear that the<br>
metadata is lost. =A0So we can not see which image or snap shot belongs to<=
br>
which VM. =A0The names all are blank when we look at the storage.<br>
<br>
<br>
<br>
Also, if I randomly mount an image to a VM, it does not boot. =A0It<br>
produces an error that says:<br>
<br>
<br>
<br>
Traceback (most recent call last): - File &quot;/usr/binpygrub&quot;, line =
808, in<br>
? - fs =3D fsimage.open(file,part_offs[0[, bootfsoptions) - IOError:<br>
[Errno 95] Operation not supported.<br>
<br>
<br>
<br>
The system kept the VM information as we destroyed the pool and then<br>
created a new one but it looks like we only see snapshots through<br>
XenCenter. =A0Its like the real .vhd that were running are not showing up.<=
br>
<br>
<br>
<br>
I know it is pretty bad. =A0We should not have listened to the storage<br>
guys.<br>
<br>
<br>
<br>
Does anyone know someone that can help?<br>
<br>
<br>
<br>
Juan<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href=3D"http://lists.xen.org/archives/html/xen-devel/attachment=
s/20121109/a085ab22/attachment.html" target=3D"_blank">http://lists.xen.org=
/archives/html/xen-devel/attachments/20121109/a085ab22/attachment.html</a>&=
gt;<br>


<br>
------------------------------<br>
<br>
_______________________________________________<br>
Xen-devel mailing list<br>
<a href=3D"mailto:Xen-devel@lists.xen.org" target=3D"_blank">Xen-devel@list=
s.xen.org</a><br>
<a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://lists.x=
en.org/xen-devel</a><br>
<br>
<br>
End of Xen-devel Digest, Vol 93, Issue 79<br>
*****************************************<br>
</blockquote></div><br><br clear=3D"all"><div><br></div></div></div><span c=
lass=3D"HOEnZb"><font color=3D"#888888">-- <br>_____<br>Fact:<br>1. Ninjas =
are mammals.<br>2. Ninjas fight ALL the time.<br>3. The purpose of the ninj=
a is to flip out and kill people.<br>

</font></span></div>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>_____<br>Fac=
t:<br>1. Ninjas are mammals.<br>2. Ninjas fight ALL the time.<br>3. The pur=
pose of the ninja is to flip out and kill people.<br>
</div>

--bcaec5014c71e4c85004ce29aa99--


--===============0408609209009085176==
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.xen.org
http://lists.xen.org/xen-devel

--===============0408609209009085176==--


From xen-devel-bounces@lists.xen.org Sun Nov 11 03:58:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Nov 2012 03:58:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXOgJ-0004Mi-BY; Sun, 11 Nov 2012 03:57:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <davidxu06@gmail.com>) id 1TXOgH-0004Md-6o
	for xen-devel@lists.xen.org; Sun, 11 Nov 2012 03:57:57 +0000
Received: from [85.158.139.211:19065] by server-13.bemta-5.messagelabs.com id
	CE/9B-27809-3422F905; Sun, 11 Nov 2012 03:57:55 +0000
X-Env-Sender: davidxu06@gmail.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1352606274!19662073!1
X-Originating-IP: [209.85.216.173]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_10_20,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21909 invoked from network); 11 Nov 2012 03:57:55 -0000
Received: from mail-qc0-f173.google.com (HELO mail-qc0-f173.google.com)
	(209.85.216.173)
	by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	11 Nov 2012 03:57:55 -0000
Received: by mail-qc0-f173.google.com with SMTP id b12so3914227qca.32
	for <xen-devel@lists.xen.org>; Sat, 10 Nov 2012 19:57:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=r+sXOpspWmLe/pCWNklKLkpLHYqheH0OIWPFO2k0T7I=;
	b=NscaizyHjJEtHbsdPkxyYuhG8p/Vt1LLZF4nFzZB8zHF2E6+BxE1oUbHcu6Yv+JmEz
	xkHSn8Qk//QZtpt4A0P6OFpho0TSc5PwGTRl8mm9tFQtFeLRF1yZ+mm+TjjaFzi5RnV6
	/Yjj4nzhu3epO0ToyWNGfYHgImlXvwlFCKcF4d8yUbqkY/7EVOXyBdXF1p25ibFtLb23
	/i3Dr+yJ9565qa45Y8DekEjfKXj/ek0Q1V94rTk7D4AI0lIotKj/q0ylXldXQJesecVQ
	PQZJuJU8aCNzG50c3huDxr95I9NQrunXvtvcy9OX+UowHEpZx/qqbTw0YM7vpBuuLdct
	1Gqg==
MIME-Version: 1.0
Received: by 10.229.78.221 with SMTP id m29mr4891228qck.4.1352606274019; Sat,
	10 Nov 2012 19:57:54 -0800 (PST)
Received: by 10.49.1.116 with HTTP; Sat, 10 Nov 2012 19:57:53 -0800 (PST)
Date: Sat, 10 Nov 2012 22:57:53 -0500
Message-ID: <CAGjowiTF6h4snHTuqRz1BbxX8VNnKyPdoJaVfUAZFzRNJ9m0jg@mail.gmail.com>
From: David Xu <davidxu06@gmail.com>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] state of process on de-scheduled vCPU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4579465016845720189=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4579465016845720189==
Content-Type: multipart/alternative; boundary=00235429d2bc7be09f04ce3030bb

--00235429d2bc7be09f04ce3030bb
Content-Type: text/plain; charset=ISO-8859-1

Hi all,

I wonder if the state of process in guestOS will change when the
corresponding vCPU is de-scheduled. In other words, when a vCPU uses up its
credits and its state become over, how about the process context or softirq
context in guest OS on this vCPU? Does it still maintain the same running
state? Thanks.

Regards,
Cong

--00235429d2bc7be09f04ce3030bb
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi all,<div><br></div><div>I wonder if the state of process in guestOS will=
 change when the corresponding vCPU is de-scheduled. In other words, when a=
 vCPU uses up its credits and its state become over, how about the process =
context or softirq context in guest OS on this vCPU? Does it still maintain=
 the same running state? Thanks.</div>
<div><br></div><div>Regards,</div><div>Cong</div>

--00235429d2bc7be09f04ce3030bb--


--===============4579465016845720189==
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.xen.org
http://lists.xen.org/xen-devel

--===============4579465016845720189==--


From xen-devel-bounces@lists.xen.org Sun Nov 11 03:58:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Nov 2012 03:58:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXOgJ-0004Mi-BY; Sun, 11 Nov 2012 03:57:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <davidxu06@gmail.com>) id 1TXOgH-0004Md-6o
	for xen-devel@lists.xen.org; Sun, 11 Nov 2012 03:57:57 +0000
Received: from [85.158.139.211:19065] by server-13.bemta-5.messagelabs.com id
	CE/9B-27809-3422F905; Sun, 11 Nov 2012 03:57:55 +0000
X-Env-Sender: davidxu06@gmail.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1352606274!19662073!1
X-Originating-IP: [209.85.216.173]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_10_20,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21909 invoked from network); 11 Nov 2012 03:57:55 -0000
Received: from mail-qc0-f173.google.com (HELO mail-qc0-f173.google.com)
	(209.85.216.173)
	by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	11 Nov 2012 03:57:55 -0000
Received: by mail-qc0-f173.google.com with SMTP id b12so3914227qca.32
	for <xen-devel@lists.xen.org>; Sat, 10 Nov 2012 19:57:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=r+sXOpspWmLe/pCWNklKLkpLHYqheH0OIWPFO2k0T7I=;
	b=NscaizyHjJEtHbsdPkxyYuhG8p/Vt1LLZF4nFzZB8zHF2E6+BxE1oUbHcu6Yv+JmEz
	xkHSn8Qk//QZtpt4A0P6OFpho0TSc5PwGTRl8mm9tFQtFeLRF1yZ+mm+TjjaFzi5RnV6
	/Yjj4nzhu3epO0ToyWNGfYHgImlXvwlFCKcF4d8yUbqkY/7EVOXyBdXF1p25ibFtLb23
	/i3Dr+yJ9565qa45Y8DekEjfKXj/ek0Q1V94rTk7D4AI0lIotKj/q0ylXldXQJesecVQ
	PQZJuJU8aCNzG50c3huDxr95I9NQrunXvtvcy9OX+UowHEpZx/qqbTw0YM7vpBuuLdct
	1Gqg==
MIME-Version: 1.0
Received: by 10.229.78.221 with SMTP id m29mr4891228qck.4.1352606274019; Sat,
	10 Nov 2012 19:57:54 -0800 (PST)
Received: by 10.49.1.116 with HTTP; Sat, 10 Nov 2012 19:57:53 -0800 (PST)
Date: Sat, 10 Nov 2012 22:57:53 -0500
Message-ID: <CAGjowiTF6h4snHTuqRz1BbxX8VNnKyPdoJaVfUAZFzRNJ9m0jg@mail.gmail.com>
From: David Xu <davidxu06@gmail.com>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] state of process on de-scheduled vCPU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4579465016845720189=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4579465016845720189==
Content-Type: multipart/alternative; boundary=00235429d2bc7be09f04ce3030bb

--00235429d2bc7be09f04ce3030bb
Content-Type: text/plain; charset=ISO-8859-1

Hi all,

I wonder if the state of process in guestOS will change when the
corresponding vCPU is de-scheduled. In other words, when a vCPU uses up its
credits and its state become over, how about the process context or softirq
context in guest OS on this vCPU? Does it still maintain the same running
state? Thanks.

Regards,
Cong

--00235429d2bc7be09f04ce3030bb
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi all,<div><br></div><div>I wonder if the state of process in guestOS will=
 change when the corresponding vCPU is de-scheduled. In other words, when a=
 vCPU uses up its credits and its state become over, how about the process =
context or softirq context in guest OS on this vCPU? Does it still maintain=
 the same running state? Thanks.</div>
<div><br></div><div>Regards,</div><div>Cong</div>

--00235429d2bc7be09f04ce3030bb--


--===============4579465016845720189==
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.xen.org
http://lists.xen.org/xen-devel

--===============4579465016845720189==--


From xen-devel-bounces@lists.xen.org Sun Nov 11 05:45:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Nov 2012 05:45:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXQLr-00055A-MT; Sun, 11 Nov 2012 05:44:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TXQLq-000555-0I
	for xen-devel@lists.xensource.com; Sun, 11 Nov 2012 05:44:58 +0000
Received: from [85.158.137.99:49438] by server-16.bemta-3.messagelabs.com id
	A3/E9-07461-95B3F905; Sun, 11 Nov 2012 05:44:57 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1352612696!11756997!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgxMzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17219 invoked from network); 11 Nov 2012 05:44:56 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	11 Nov 2012 05:44:56 -0000
X-IronPort-AV: E=Sophos;i="4.80,756,1344211200"; d="scan'208";a="15727714"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	11 Nov 2012 05:44:52 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sun, 11 Nov 2012 05:44:51 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TXQLj-00039Q-I5;
	Sun, 11 Nov 2012 05:44:51 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TXQLj-0007HD-Bs;
	Sun, 11 Nov 2012 05:44:51 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14378-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sun, 11 Nov 2012 05:44:51 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14378: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14378 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14378/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14377
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14377
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14377
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14377

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  62885b3c34c8
baseline version:
 xen                  62885b3c34c8

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 11 05:45:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Nov 2012 05:45:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXQLr-00055A-MT; Sun, 11 Nov 2012 05:44:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TXQLq-000555-0I
	for xen-devel@lists.xensource.com; Sun, 11 Nov 2012 05:44:58 +0000
Received: from [85.158.137.99:49438] by server-16.bemta-3.messagelabs.com id
	A3/E9-07461-95B3F905; Sun, 11 Nov 2012 05:44:57 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1352612696!11756997!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgxMzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17219 invoked from network); 11 Nov 2012 05:44:56 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	11 Nov 2012 05:44:56 -0000
X-IronPort-AV: E=Sophos;i="4.80,756,1344211200"; d="scan'208";a="15727714"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	11 Nov 2012 05:44:52 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sun, 11 Nov 2012 05:44:51 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TXQLj-00039Q-I5;
	Sun, 11 Nov 2012 05:44:51 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TXQLj-0007HD-Bs;
	Sun, 11 Nov 2012 05:44:51 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14378-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sun, 11 Nov 2012 05:44:51 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14378: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14378 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14378/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14377
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14377
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14377
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14377

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  62885b3c34c8
baseline version:
 xen                  62885b3c34c8

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 11 08:52:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Nov 2012 08:52:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXTGB-0006SZ-P9; Sun, 11 Nov 2012 08:51:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXTGA-0006SU-1c
	for xen-devel@lists.xen.org; Sun, 11 Nov 2012 08:51:18 +0000
Received: from [85.158.137.99:32862] by server-6.bemta-3.messagelabs.com id
	2B/D2-28265-5076F905; Sun, 11 Nov 2012 08:51:17 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1352623876!13868202!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgxMzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20193 invoked from network); 11 Nov 2012 08:51:16 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	11 Nov 2012 08:51:16 -0000
X-IronPort-AV: E=Sophos;i="4.80,756,1344211200"; d="scan'208";a="15728674"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	11 Nov 2012 08:51:12 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Sun, 11 Nov 2012 08:51:11 +0000
Message-ID: <1352623871.21048.43.camel@dagon.hellion.org.uk>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: feral <blistovmhz@gmail.com>
Date: Sun, 11 Nov 2012 08:51:11 +0000
In-Reply-To: <CAN3GA=SiufUOi977SpWj+FGd9WdZUBtAoG18xUpQdSmr4g-boA@mail.gmail.com>
References: <mailman.5.1352548802.11332.xen-devel@lists.xen.org>
	<CAN3GA=SiufUOi977SpWj+FGd9WdZUBtAoG18xUpQdSmr4g-boA@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen-devel Digest, Vol 93, Issue 79
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, 2012-11-10 at 19:42 +0000, feral wrote:
> Re: PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
>       IO_PAGE_FAULT: (Hans Mueller)
> OMG, why do most messages only show up in the daily batch but not
> individually?

Because you appear to have turned on the option to receive the digest
version of the list. If you want individual messages then you need to
login to your account at
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel and turn off
that option.

In any case please don't quote the *entire* digest when replying, it is
doubly important to trim your quotes in this case. In this case you
included thousands of pointless lines of quotes.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 11 08:52:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Nov 2012 08:52:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXTGB-0006SZ-P9; Sun, 11 Nov 2012 08:51:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXTGA-0006SU-1c
	for xen-devel@lists.xen.org; Sun, 11 Nov 2012 08:51:18 +0000
Received: from [85.158.137.99:32862] by server-6.bemta-3.messagelabs.com id
	2B/D2-28265-5076F905; Sun, 11 Nov 2012 08:51:17 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1352623876!13868202!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgxMzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20193 invoked from network); 11 Nov 2012 08:51:16 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	11 Nov 2012 08:51:16 -0000
X-IronPort-AV: E=Sophos;i="4.80,756,1344211200"; d="scan'208";a="15728674"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	11 Nov 2012 08:51:12 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Sun, 11 Nov 2012 08:51:11 +0000
Message-ID: <1352623871.21048.43.camel@dagon.hellion.org.uk>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: feral <blistovmhz@gmail.com>
Date: Sun, 11 Nov 2012 08:51:11 +0000
In-Reply-To: <CAN3GA=SiufUOi977SpWj+FGd9WdZUBtAoG18xUpQdSmr4g-boA@mail.gmail.com>
References: <mailman.5.1352548802.11332.xen-devel@lists.xen.org>
	<CAN3GA=SiufUOi977SpWj+FGd9WdZUBtAoG18xUpQdSmr4g-boA@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen-devel Digest, Vol 93, Issue 79
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, 2012-11-10 at 19:42 +0000, feral wrote:
> Re: PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
>       IO_PAGE_FAULT: (Hans Mueller)
> OMG, why do most messages only show up in the daily batch but not
> individually?

Because you appear to have turned on the option to receive the digest
version of the list. If you want individual messages then you need to
login to your account at
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel and turn off
that option.

In any case please don't quote the *entire* digest when replying, it is
doubly important to trim your quotes in this case. In this case you
included thousands of pointless lines of quotes.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 11 13:14:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Nov 2012 13:14:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXXLx-00081X-LS; Sun, 11 Nov 2012 13:13:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <abb@gremwell.com>) id 1TXXLu-00081S-P7
	for xen-devel@lists.xen.org; Sun, 11 Nov 2012 13:13:31 +0000
Received: from [85.158.143.35:24101] by server-2.bemta-4.messagelabs.com id
	83/02-28922-A74AF905; Sun, 11 Nov 2012 13:13:30 +0000
X-Env-Sender: abb@gremwell.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1352639607!14434111!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_10_20,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4998 invoked from network); 11 Nov 2012 13:13:28 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	11 Nov 2012 13:13:28 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl15so6470853vcb.32
	for <xen-devel@lists.xen.org>; Sun, 11 Nov 2012 05:13:26 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:cc:content-type
	:x-gm-message-state;
	bh=9ASChrrsuQA65GbCQNfdRXZZLHT415mwWX9EJmWP2OM=;
	b=cDNamct+nAMC+CftP7GXsD0iN/33GYUa7zOhNExCw4ZSnLpvLYZdoscZqxKLPn9w4q
	jU6bILxsR9sFoY5gLVLbB11l7v4HhGXt3RYYVsdRcqdo8c7SeK/Z6SdbSN1ek4FGQNpy
	8Ty1qU+e7ze3QEM645IYB+saCansOwThNlOrH3cQTPBMzvYpuJgi4uUKqWa9+zOYRMO5
	z5UBFEM7uFs68r9kemD9fITJwRE3lhF3iZPCytqdd6dI73pWPb2v+AUeQ/4ilPC/dGR5
	WutV0b7QSOYqzKxOpqP3XNC45Ow66TTYdPSTJPfcXR+h8oVearHUTR4SybBA+dHT9eyr
	l26A==
MIME-Version: 1.0
Received: by 10.220.208.141 with SMTP id gc13mr19788270vcb.55.1352639606631;
	Sun, 11 Nov 2012 05:13:26 -0800 (PST)
Received: by 10.58.155.226 with HTTP; Sun, 11 Nov 2012 05:13:26 -0800 (PST)
Date: Sun, 11 Nov 2012 14:13:26 +0100
Message-ID: <CAHVcMdXOG1esS3gsfngOZgzuQsWOzAg0QB-UOD51tTiTAxAxGQ@mail.gmail.com>
From: Alexandre Bezroutchko <abb@gremwell.com>
To: xen-devel@lists.xen.org
Content-Type: multipart/mixed; boundary=bcaec517a674432cc304ce37f3ed
X-Gm-Message-State: ALoCoQkEytLqGO4nHjMmkbL2ydf8F2g4GKFJXDD1/zvwScvIRU01dEjWsTN2+TPOTFejcKRDrAui
Cc: Marek Marczykowski <marmarek@invisiblethingslab.com>
Subject: [Xen-devel] [xen-devel] kernel 3.4.12 crashes if built debugging
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--bcaec517a674432cc304ce37f3ed
Content-Type: multipart/alternative; boundary=bcaec517a674432cbf04ce37f3eb

--bcaec517a674432cbf04ce37f3eb
Content-Type: text/plain; charset=ISO-8859-1

Hi,

Kernel 3.4.12 built with debugging options crashes during bootstrap. The
issue is easily reproducible and also seems to affect 3.4.18. The
"offending" debug option is 'page allocation', if I switch it off but leave
other debugging options the kernel does not crash.

+CONFIG_DEBUG_PAGEALLOC=y
+CONFIG_WANT_PAGE_DEBUG_FLAGS=y
+CONFIG_PAGE_GUARD=y

The kernel is actually built from devel-3.4 branch of marmarek repo of
Qubes, but all the patches are disabled, so it supposed to be equivalent to
vanilla kernel.

Partial error messages are below. The kernel config file and full log are
attached.

----------------------------------------------------------------------------
[    0.575221] debug: unmapping init memory
ffffffff81879000..ffffffff81913000
[    0.575474] Write protecting the kernel read-only data: 8192k
[    0.579226] debug: unmapping init memory
ffff880001469000..ffff880001600000
[    0.579825] debug: unmapping init memory
ffff8800017fc000..ffff880001800000
[    0.601666] BUG: unable to handle kernel paging request at
ffff88000f66d000
[    0.601678] IP: [<ffffffff81109c64>] __tlb_remove_page+0x84/0xb0
[    0.601689] PGD 180c067 PUD 1810067 PMD 861067 PTE 801000000f66d064
[    0.601698] Oops: 0002 [#1] SMP DEBUG_PAGEALLOC
[    0.601705] CPU 5
[    0.601708] Modules linked in:
[    0.601713]
[    0.601717] Pid: 60, comm: init Not tainted
3.4.12-1alldebugnopvusb.pvops.qubes.x86_64 #1
[    0.601726] RIP: e030:[<ffffffff81109c64>]  [<ffffffff81109c64>]
__tlb_remove_page+0x84/0xb0
[    0.601736] RSP: e02b:ffff88000f645a78  EFLAGS: 00010286
[    0.601741] RAX: ffff88000f66d000 RBX: ffff88000f645c30 RCX:
0000000000000000
[    0.601747] RDX: ffff88000f66d000 RSI: 0000000000000010 RDI:
0000000000000200
[    0.601754] RBP: ffff88000f645a88 R08: 0000000000000000 R09:
ffff880000000000
[    0.601760] R10: 0000000000000001 R11: 00000000581c6204 R12:
ffff88000f62ec68
[    0.601766] R13: 0000000193e49125 R14: ffff88000f5e3150 R15:
000000000042a000
[    0.601777] FS:  00007fda48c7b740(0000) GS:ffff880018d40000(0000)
knlGS:0000000000000000
[    0.601784] CS:  e033 DS: 0000 ES: 0000 CR0: 000000008005003b
[    0.605188] CR2: ffff88000f66d000 CR3: 000000000f665000 CR4:
0000000000002660
[    0.605188] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
[    0.605188] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
0000000000000400
[    0.605188] Process init (pid: 60, threadinfo ffff88000f644000, task
ffff88000f6427c0)
[    0.605188] Stack:
[    0.605188]  ffffea00003d78c0 ffffea000048a680 ffff88000f645b78
ffffffff8110b1d8
[    0.605188]  000000009658ccc5 0000000000000100 0000000000000000
00000000000001ff
[    0.605188]  00000000004d9fff 00000000004da000 00000000004d9fff
ffff88000f62f000
[    0.605188] Call Trace:
[    0.605188]  [<ffffffff8110b1d8>] unmap_page_range+0x4a8/0x730
[    0.605188]  [<ffffffff8110b4c3>] unmap_single_vma+0x63/0xb0
[    0.605188]  [<ffffffff810f52b0>] ? put_pages_list+0x30/0x30
[    0.605188]  [<ffffffff8110bcde>] unmap_vmas+0x5e/0xb0
[    0.605188]  [<ffffffff811131c7>] exit_mmap+0x97/0x140
[    0.605188]  [<ffffffff810445c3>] mmput+0x73/0xf0
[    0.605188]  [<ffffffff811396ad>] flush_old_exec+0x3ed/0x720
[    0.605188]  [<ffffffff8117f8be>] load_elf_binary+0x31e/0x1840
[    0.605188]  [<ffffffff8117f5a0>] ? load_elf_library+0x200/0x200
[    0.605188]  [<ffffffff81138dc7>] search_binary_handler+0xe7/0x2f0
[    0.605188]  [<ffffffff8113a293>] do_execve_common.isra.32+0x3e3/0x4b0
[    0.605188]  [<ffffffff8113a376>] do_execve+0x16/0x20
[    0.605188]  [<ffffffff8101ad52>] sys_execve+0x42/0x70
[    0.605188]  [<ffffffff81460c3c>] stub_execve+0x6c/0xc0
[    0.605188] Code: 8b 47 10 48 8b 10 48 85 d2 74 0c 48 89 53 10 8b 42 0c
8b 52 08 eb bd 31 f6 bf 00 02 00 00 e8 d4 87 fe ff 48 85 c0 48 89 c2 74 1e
<48> c7 00 00 00 00 00 c7 40 08 00 00 00 00 c7 40 0c fe 01 00 00
[    0.605188] RIP  [<ffffffff81109c64>] __tlb_remove_page+0x84/0xb0
[    0.605188]  RSP <ffff88000f645a78>
[    0.605188] CR2: ffff88000f66d000
[    0.605188] ---[ end trace 555e8456cfdd3999 ]---
[    0.634427] ------------[ cut here ]------------
[    0.634435] kernel BUG at
/rw/home/user/qubes/qubes-builder/qubes-src/kernel/kernel-3.4.12/linux-3.4.12/arch/x86/kernel/paravirt.c:244!
[    0.634445] invalid opcode: 0000 [#2] SMP DEBUG_PAGEALLOC
[    0.634451] CPU 5
[    0.634453] Modules linked in:
[    0.634458]
[    0.634462] Pid: 60, comm: init Tainted: G      D
3.4.12-1alldebugnopvusb.pvops.qubes.x86_64 #1
[    0.634472] RIP: e030:[<ffffffff8144f3b7>]  [<ffffffff8144f3b7>]
enter_lazy.part.4+0x4/0x6
[    0.634483] RSP: e02b:ffff88000f645488  EFLAGS: 00010202
[    0.634489] RAX: 0000000000000001 RBX: ffff88000f664c68 RCX:
00003ffffffff000
[    0.634496] RDX: 0000000000000006 RSI: ffffea00003d9a80 RDI:
ffffea00003d9ab0
[    0.634502] RBP: ffff88000f645488 R08: 0000000000000000 R09:
0000000000000000
[    0.634508] R10: ffffffff81871d00 R11: 0000000000000001 R12:
ffff88000f669ff8
[    0.634514] R13: ffff88000f664c68 R14: ffff88000f66afe8 R15:
00007fffffffd000
[    0.634524] FS:  00007fda48c7b740(0000) GS:ffff880018d40000(0000)
knlGS:0000000000000000
[    0.634532] CS:  e033 DS: 0000 ES: 0000 CR0: 000000008005003b
[    0.634537] CR2: ffff88000f66d000 CR3: 000000000180b000 CR4:
0000000000002660
[    0.634544] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
[    0.634550] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
0000000000000400
[    0.634557] Process init (pid: 60, threadinfo ffff88000f644000, task
ffff88000f6427c0)
[    0.634564] Stack:
[    0.634567]  ffff88000f645498 ffffffff81039bf2 ffff88000f645588
ffffffff8110b002
[    0.634577]  0000000000000011 0000000000000100 0000000000000000
00000000000001ff
[    0.634586]  00007fffffffefff 00007ffffffff000 00007fffffffefff
ffff88000f6657f8
[    0.634596] Call Trace:
[    0.634602]  [<ffffffff81039bf2>] paravirt_enter_lazy_mmu+0x22/0x30
[    0.634609]  [<ffffffff8110b002>] unmap_page_range+0x2d2/0x730
[    0.634617]  [<ffffffff810f5098>] ? release_pages+0x148/0x1c0
[    0.634624]  [<ffffffff8110b4c3>] unmap_single_vma+0x63/0xb0
[    0.634631]  [<ffffffff810f52b0>] ? put_pages_list+0x30/0x30
[    0.634637]  [<ffffffff8110bcde>] unmap_vmas+0x5e/0xb0
[    0.634644]  [<ffffffff811131c7>] exit_mmap+0x97/0x140
[    0.634650]  [<ffffffff810445c3>] mmput+0x73/0xf0
[    0.634657]  [<ffffffff81049afd>] exit_mm+0xfd/0x120
[    0.634664]  [<ffffffff81009dc9>] ? xen_irq_enable_direct_reloc+0x4/0x4
[    0.634672]  [<ffffffff8104b244>] do_exit+0x164/0x8a0
[    0.634680]  [<ffffffff81458c42>] ? _raw_spin_unlock_irqrestore+0x12/0x20
[    0.634687]  [<ffffffff810490fa>] ? kmsg_dump+0x5a/0x100
[    0.634694]  [<ffffffff81459eb9>] oops_end+0x99/0xe0
[    0.634700]  [<ffffffff8144fc9f>] no_context+0x24e/0x279
[    0.634707]  [<ffffffff81007339>] ? xen_pmd_val+0x9/0x10
[    0.634713]  [<ffffffff8144fe84>] __bad_area_nosemaphore+0x1ba/0x1d9
[    0.634721]  [<ffffffff81459169>] ? restore_args+0x30/0x30
[    0.634727]  [<ffffffff8144feb1>] bad_area_nosemaphore+0xe/0x10
[    0.634734]  [<ffffffff8145c69b>] do_page_fault+0x32b/0x4f0
[    0.634741]  [<ffffffff8100728a>] ? pte_mfn_to_pfn+0x6a/0x100
[    0.634748]  [<ffffffff810f1cf3>] ? __alloc_pages_nodemask+0x193/0x850
[    0.634756]  [<ffffffff8114997a>] ? __d_lookup+0x7a/0x160
[    0.634763]  [<ffffffff814593a5>] page_fault+0x25/0x30
[    0.634769]  [<ffffffff81109c64>] ? __tlb_remove_page+0x84/0xb0
[    0.634776]  [<ffffffff81109c5c>] ? __tlb_remove_page+0x7c/0xb0
[    0.634782]  [<ffffffff8110b1d8>] unmap_page_range+0x4a8/0x730
[    0.634790]  [<ffffffff8110b4c3>] unmap_single_vma+0x63/0xb0
[    0.634797]  [<ffffffff810f52b0>] ? put_pages_list+0x30/0x30
[    0.634803]  [<ffffffff8110bcde>] unmap_vmas+0x5e/0xb0
[    0.634809]  [<ffffffff811131c7>] exit_mmap+0x97/0x140
[    0.634816]  [<ffffffff810445c3>] mmput+0x73/0xf0
[    0.634822]  [<ffffffff811396ad>] flush_old_exec+0x3ed/0x720
[    0.634830]  [<ffffffff8117f8be>] load_elf_binary+0x31e/0x1840
[    0.634838]  [<ffffffff8117f5a0>] ? load_elf_library+0x200/0x200
[    0.634845]  [<ffffffff81138dc7>] search_binary_handler+0xe7/0x2f0
[    0.634852]  [<ffffffff8113a293>] do_execve_common.isra.32+0x3e3/0x4b0
[    0.634858]  [<ffffffff8113a376>] do_execve+0x16/0x20
[    0.634864]  [<ffffffff8101ad52>] sys_execve+0x42/0x70
[    0.634871]  [<ffffffff81460c3c>] stub_execve+0x6c/0xc0
[    0.634876] Code: fa 44 89 e6 48 c7 c7 a8 e3 75 81 31 c0 e8 0b 0f 00 00
48 83 c4 18 5b 41 5c 41 5d 41 5e 41 5f 5d c3 55 48 89 e5 0f 0b 55 48 89 e5
<0f> 0b 55 48 89 e5 0f 0b 55 48 89 e5 41 55 41 54 53 31 db 48 85
[    0.634932] RIP  [<ffffffff8144f3b7>] enter_lazy.part.4+0x4/0x6
[    0.634938]  RSP <ffff88000f645488>
[    0.634941] ---[ end trace 555e8456cfdd399a ]---
[    0.634944] Fixing recursive fault but reboot is needed!
----------------------------------------------------------------------------

Regards,
Alex

--bcaec517a674432cbf04ce37f3eb
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,<br><br>Kernel 3.4.12 built with debugging options crashes during bootst=
rap. The issue is easily reproducible and also seems to affect 3.4.18. The =
&quot;offending&quot; debug option is &#39;page allocation&#39;, if I switc=
h it off but leave other debugging options the kernel does not crash.<br>
<br>+CONFIG_DEBUG_PAGEALLOC=3Dy<br>+CONFIG_WANT_PAGE_DEBUG_FLAGS=3Dy<br>+CO=
NFIG_PAGE_GUARD=3Dy<br><br>The kernel is actually built from devel-3.4 bran=
ch of marmarek repo of Qubes, but all the patches are disabled, so it suppo=
sed to be equivalent to vanilla kernel.<br>
<br>Partial error messages are below. The kernel config file and full log a=
re attached.<br><br>-------------------------------------------------------=
---------------------<br>[=A0=A0=A0 0.575221] debug: unmapping init memory =
ffffffff81879000..ffffffff81913000<br>
[=A0=A0=A0 0.575474] Write protecting the kernel read-only data: 8192k<br>[=
=A0=A0=A0 0.579226] debug: unmapping init memory ffff880001469000..ffff8800=
01600000<br>[=A0=A0=A0 0.579825] debug: unmapping init memory ffff8800017fc=
000..ffff880001800000<br>
[=A0=A0=A0 0.601666] BUG: unable to handle kernel paging request at ffff880=
00f66d000<br>[=A0=A0=A0 0.601678] IP: [&lt;ffffffff81109c64&gt;] __tlb_remo=
ve_page+0x84/0xb0<br>[=A0=A0=A0 0.601689] PGD 180c067 PUD 1810067 PMD 86106=
7 PTE 801000000f66d064<br>
[=A0=A0=A0 0.601698] Oops: 0002 [#1] SMP DEBUG_PAGEALLOC<br>[=A0=A0=A0 0.60=
1705] CPU 5 <br>[=A0=A0=A0 0.601708] Modules linked in:<br>[=A0=A0=A0 0.601=
713] <br>[=A0=A0=A0 0.601717] Pid: 60, comm: init Not tainted 3.4.12-1allde=
bugnopvusb.pvops.qubes.x86_64 #1=A0 <br>
[=A0=A0=A0 0.601726] RIP: e030:[&lt;ffffffff81109c64&gt;]=A0 [&lt;ffffffff8=
1109c64&gt;] __tlb_remove_page+0x84/0xb0<br>[=A0=A0=A0 0.601736] RSP: e02b:=
ffff88000f645a78=A0 EFLAGS: 00010286<br>[=A0=A0=A0 0.601741] RAX: ffff88000=
f66d000 RBX: ffff88000f645c30 RCX: 0000000000000000<br>
[=A0=A0=A0 0.601747] RDX: ffff88000f66d000 RSI: 0000000000000010 RDI: 00000=
00000000200<br>[=A0=A0=A0 0.601754] RBP: ffff88000f645a88 R08: 000000000000=
0000 R09: ffff880000000000<br>[=A0=A0=A0 0.601760] R10: 0000000000000001 R1=
1: 00000000581c6204 R12: ffff88000f62ec68<br>
[=A0=A0=A0 0.601766] R13: 0000000193e49125 R14: ffff88000f5e3150 R15: 00000=
0000042a000<br>[=A0=A0=A0 0.601777] FS:=A0 00007fda48c7b740(0000) GS:ffff88=
0018d40000(0000) knlGS:0000000000000000<br>[=A0=A0=A0 0.601784] CS:=A0 e033=
 DS: 0000 ES: 0000 CR0: 000000008005003b<br>
[=A0=A0=A0 0.605188] CR2: ffff88000f66d000 CR3: 000000000f665000 CR4: 00000=
00000002660<br>[=A0=A0=A0 0.605188] DR0: 0000000000000000 DR1: 000000000000=
0000 DR2: 0000000000000000<br>[=A0=A0=A0 0.605188] DR3: 0000000000000000 DR=
6: 00000000ffff0ff0 DR7: 0000000000000400<br>
[=A0=A0=A0 0.605188] Process init (pid: 60, threadinfo ffff88000f644000, ta=
sk ffff88000f6427c0)<br>[=A0=A0=A0 0.605188] Stack:<br>[=A0=A0=A0 0.605188]=
=A0 ffffea00003d78c0 ffffea000048a680 ffff88000f645b78 ffffffff8110b1d8<br>=
[=A0=A0=A0 0.605188]=A0 000000009658ccc5 0000000000000100 0000000000000000 =
00000000000001ff<br>
[=A0=A0=A0 0.605188]=A0 00000000004d9fff 00000000004da000 00000000004d9fff =
ffff88000f62f000<br>[=A0=A0=A0 0.605188] Call Trace:<br>[=A0=A0=A0 0.605188=
]=A0 [&lt;ffffffff8110b1d8&gt;] unmap_page_range+0x4a8/0x730<br>[=A0=A0=A0 =
0.605188]=A0 [&lt;ffffffff8110b4c3&gt;] unmap_single_vma+0x63/0xb0<br>
[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff810f52b0&gt;] ? put_pages_list+0x30/0x=
30<br>[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff8110bcde&gt;] unmap_vmas+0x5e/0x=
b0<br>[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff811131c7&gt;] exit_mmap+0x97/0x1=
40<br>[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff810445c3&gt;] mmput+0x73/0xf0<br=
>
[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff811396ad&gt;] flush_old_exec+0x3ed/0x7=
20<br>[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff8117f8be&gt;] load_elf_binary+0x=
31e/0x1840<br>[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff8117f5a0&gt;] ? load_elf=
_library+0x200/0x200<br>
[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff81138dc7&gt;] search_binary_handler+0x=
e7/0x2f0<br>[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff8113a293&gt;] do_execve_co=
mmon.isra.32+0x3e3/0x4b0<br>[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff8113a376&g=
t;] do_execve+0x16/0x20<br>
[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff8101ad52&gt;] sys_execve+0x42/0x70<br>=
[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff81460c3c&gt;] stub_execve+0x6c/0xc0<br=
>[=A0=A0=A0 0.605188] Code: 8b 47 10 48 8b 10 48 85 d2 74 0c 48 89 53 10 8b=
 42 0c 8b 52 08 eb bd 31 f6 bf 00 02 00 00 e8 d4 87 fe ff 48 85 c0 48 89 c2=
 74 1e &lt;48&gt; c7 00 00 00 00 00 c7 40 08 00 00 00 00 c7 40 0c fe 01 00 =
00 <br>
[=A0=A0=A0 0.605188] RIP=A0 [&lt;ffffffff81109c64&gt;] __tlb_remove_page+0x=
84/0xb0<br>[=A0=A0=A0 0.605188]=A0 RSP &lt;ffff88000f645a78&gt;<br>[=A0=A0=
=A0 0.605188] CR2: ffff88000f66d000<br>[=A0=A0=A0 0.605188] ---[ end trace =
555e8456cfdd3999 ]---<br>
[=A0=A0=A0 0.634427] ------------[ cut here ]------------<br>[=A0=A0=A0 0.6=
34435] kernel BUG at /rw/home/user/qubes/qubes-builder/qubes-src/kernel/ker=
nel-3.4.12/linux-3.4.12/arch/x86/kernel/paravirt.c:244!<br>[=A0=A0=A0 0.634=
445] invalid opcode: 0000 [#2] SMP DEBUG_PAGEALLOC<br>
[=A0=A0=A0 0.634451] CPU 5 <br>[=A0=A0=A0 0.634453] Modules linked in:<br>[=
=A0=A0=A0 0.634458] <br>[=A0=A0=A0 0.634462] Pid: 60, comm: init Tainted: G=
=A0=A0=A0=A0=A0 D=A0=A0=A0=A0=A0 3.4.12-1alldebugnopvusb.pvops.qubes.x86_64=
 #1=A0 <br>[=A0=A0=A0 0.634472] RIP: e030:[&lt;ffffffff8144f3b7&gt;]=A0 [&l=
t;ffffffff8144f3b7&gt;] enter_lazy.part.4+0x4/0x6<br>
[=A0=A0=A0 0.634483] RSP: e02b:ffff88000f645488=A0 EFLAGS: 00010202<br>[=A0=
=A0=A0 0.634489] RAX: 0000000000000001 RBX: ffff88000f664c68 RCX: 00003ffff=
ffff000<br>[=A0=A0=A0 0.634496] RDX: 0000000000000006 RSI: ffffea00003d9a80=
 RDI: ffffea00003d9ab0<br>
[=A0=A0=A0 0.634502] RBP: ffff88000f645488 R08: 0000000000000000 R09: 00000=
00000000000<br>[=A0=A0=A0 0.634508] R10: ffffffff81871d00 R11: 000000000000=
0001 R12: ffff88000f669ff8<br>[=A0=A0=A0 0.634514] R13: ffff88000f664c68 R1=
4: ffff88000f66afe8 R15: 00007fffffffd000<br>
[=A0=A0=A0 0.634524] FS:=A0 00007fda48c7b740(0000) GS:ffff880018d40000(0000=
) knlGS:0000000000000000<br>[=A0=A0=A0 0.634532] CS:=A0 e033 DS: 0000 ES: 0=
000 CR0: 000000008005003b<br>[=A0=A0=A0 0.634537] CR2: ffff88000f66d000 CR3=
: 000000000180b000 CR4: 0000000000002660<br>
[=A0=A0=A0 0.634544] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 00000=
00000000000<br>[=A0=A0=A0 0.634550] DR3: 0000000000000000 DR6: 00000000ffff=
0ff0 DR7: 0000000000000400<br>[=A0=A0=A0 0.634557] Process init (pid: 60, t=
hreadinfo ffff88000f644000, task ffff88000f6427c0)<br>
[=A0=A0=A0 0.634564] Stack:<br>[=A0=A0=A0 0.634567]=A0 ffff88000f645498 fff=
fffff81039bf2 ffff88000f645588 ffffffff8110b002<br>[=A0=A0=A0 0.634577]=A0 =
0000000000000011 0000000000000100 0000000000000000 00000000000001ff<br>[=A0=
=A0=A0 0.634586]=A0 00007fffffffefff 00007ffffffff000 00007fffffffefff ffff=
88000f6657f8<br>
[=A0=A0=A0 0.634596] Call Trace:<br>[=A0=A0=A0 0.634602]=A0 [&lt;ffffffff81=
039bf2&gt;] paravirt_enter_lazy_mmu+0x22/0x30<br>[=A0=A0=A0 0.634609]=A0 [&=
lt;ffffffff8110b002&gt;] unmap_page_range+0x2d2/0x730<br>[=A0=A0=A0 0.63461=
7]=A0 [&lt;ffffffff810f5098&gt;] ? release_pages+0x148/0x1c0<br>
[=A0=A0=A0 0.634624]=A0 [&lt;ffffffff8110b4c3&gt;] unmap_single_vma+0x63/0x=
b0<br>[=A0=A0=A0 0.634631]=A0 [&lt;ffffffff810f52b0&gt;] ? put_pages_list+0=
x30/0x30<br>[=A0=A0=A0 0.634637]=A0 [&lt;ffffffff8110bcde&gt;] unmap_vmas+0=
x5e/0xb0<br>[=A0=A0=A0 0.634644]=A0 [&lt;ffffffff811131c7&gt;] exit_mmap+0x=
97/0x140<br>
[=A0=A0=A0 0.634650]=A0 [&lt;ffffffff810445c3&gt;] mmput+0x73/0xf0<br>[=A0=
=A0=A0 0.634657]=A0 [&lt;ffffffff81049afd&gt;] exit_mm+0xfd/0x120<br>[=A0=
=A0=A0 0.634664]=A0 [&lt;ffffffff81009dc9&gt;] ? xen_irq_enable_direct_relo=
c+0x4/0x4<br>[=A0=A0=A0 0.634672]=A0 [&lt;ffffffff8104b244&gt;] do_exit+0x1=
64/0x8a0<br>
[=A0=A0=A0 0.634680]=A0 [&lt;ffffffff81458c42&gt;] ? _raw_spin_unlock_irqre=
store+0x12/0x20<br>[=A0=A0=A0 0.634687]=A0 [&lt;ffffffff810490fa&gt;] ? kms=
g_dump+0x5a/0x100<br>[=A0=A0=A0 0.634694]=A0 [&lt;ffffffff81459eb9&gt;] oop=
s_end+0x99/0xe0<br>[=A0=A0=A0 0.634700]=A0 [&lt;ffffffff8144fc9f&gt;] no_co=
ntext+0x24e/0x279<br>
[=A0=A0=A0 0.634707]=A0 [&lt;ffffffff81007339&gt;] ? xen_pmd_val+0x9/0x10<b=
r>[=A0=A0=A0 0.634713]=A0 [&lt;ffffffff8144fe84&gt;] __bad_area_nosemaphore=
+0x1ba/0x1d9<br>[=A0=A0=A0 0.634721]=A0 [&lt;ffffffff81459169&gt;] ? restor=
e_args+0x30/0x30<br>
[=A0=A0=A0 0.634727]=A0 [&lt;ffffffff8144feb1&gt;] bad_area_nosemaphore+0xe=
/0x10<br>[=A0=A0=A0 0.634734]=A0 [&lt;ffffffff8145c69b&gt;] do_page_fault+0=
x32b/0x4f0<br>[=A0=A0=A0 0.634741]=A0 [&lt;ffffffff8100728a&gt;] ? pte_mfn_=
to_pfn+0x6a/0x100<br>
[=A0=A0=A0 0.634748]=A0 [&lt;ffffffff810f1cf3&gt;] ? __alloc_pages_nodemask=
+0x193/0x850<br>[=A0=A0=A0 0.634756]=A0 [&lt;ffffffff8114997a&gt;] ? __d_lo=
okup+0x7a/0x160<br>[=A0=A0=A0 0.634763]=A0 [&lt;ffffffff814593a5&gt;] page_=
fault+0x25/0x30<br>[=A0=A0=A0 0.634769]=A0 [&lt;ffffffff81109c64&gt;] ? __t=
lb_remove_page+0x84/0xb0<br>
[=A0=A0=A0 0.634776]=A0 [&lt;ffffffff81109c5c&gt;] ? __tlb_remove_page+0x7c=
/0xb0<br>[=A0=A0=A0 0.634782]=A0 [&lt;ffffffff8110b1d8&gt;] unmap_page_rang=
e+0x4a8/0x730<br>[=A0=A0=A0 0.634790]=A0 [&lt;ffffffff8110b4c3&gt;] unmap_s=
ingle_vma+0x63/0xb0<br>
[=A0=A0=A0 0.634797]=A0 [&lt;ffffffff810f52b0&gt;] ? put_pages_list+0x30/0x=
30<br>[=A0=A0=A0 0.634803]=A0 [&lt;ffffffff8110bcde&gt;] unmap_vmas+0x5e/0x=
b0<br>[=A0=A0=A0 0.634809]=A0 [&lt;ffffffff811131c7&gt;] exit_mmap+0x97/0x1=
40<br>[=A0=A0=A0 0.634816]=A0 [&lt;ffffffff810445c3&gt;] mmput+0x73/0xf0<br=
>
[=A0=A0=A0 0.634822]=A0 [&lt;ffffffff811396ad&gt;] flush_old_exec+0x3ed/0x7=
20<br>[=A0=A0=A0 0.634830]=A0 [&lt;ffffffff8117f8be&gt;] load_elf_binary+0x=
31e/0x1840<br>[=A0=A0=A0 0.634838]=A0 [&lt;ffffffff8117f5a0&gt;] ? load_elf=
_library+0x200/0x200<br>
[=A0=A0=A0 0.634845]=A0 [&lt;ffffffff81138dc7&gt;] search_binary_handler+0x=
e7/0x2f0<br>[=A0=A0=A0 0.634852]=A0 [&lt;ffffffff8113a293&gt;] do_execve_co=
mmon.isra.32+0x3e3/0x4b0<br>[=A0=A0=A0 0.634858]=A0 [&lt;ffffffff8113a376&g=
t;] do_execve+0x16/0x20<br>
[=A0=A0=A0 0.634864]=A0 [&lt;ffffffff8101ad52&gt;] sys_execve+0x42/0x70<br>=
[=A0=A0=A0 0.634871]=A0 [&lt;ffffffff81460c3c&gt;] stub_execve+0x6c/0xc0<br=
>[=A0=A0=A0 0.634876] Code: fa 44 89 e6 48 c7 c7 a8 e3 75 81 31 c0 e8 0b 0f=
 00 00 48 83 c4 18 5b 41 5c 41 5d 41 5e 41 5f 5d c3 55 48 89 e5 0f 0b 55 48=
 89 e5 &lt;0f&gt; 0b 55 48 89 e5 0f 0b 55 48 89 e5 41 55 41 54 53 31 db 48 =
85 <br>
[=A0=A0=A0 0.634932] RIP=A0 [&lt;ffffffff8144f3b7&gt;] enter_lazy.part.4+0x=
4/0x6<br>[=A0=A0=A0 0.634938]=A0 RSP &lt;ffff88000f645488&gt;<br>[=A0=A0=A0=
 0.634941] ---[ end trace 555e8456cfdd399a ]---<br>[=A0=A0=A0 0.634944] Fix=
ing recursive fault but reboot is needed!<br>
---------------------------------------------------------------------------=
-<br><br>Regards,<br>Alex<br><br>

--bcaec517a674432cbf04ce37f3eb--
--bcaec517a674432cc304ce37f3ed
Content-Type: application/octet-stream; name="guest-work.log"
Content-Disposition: attachment; filename="guest-work.log"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_h9e6j5ne0

WyAgICAwLjAwMDAwMF0gSW5pdGlhbGl6aW5nIGNncm91cCBzdWJzeXMgY3B1c2V0DQpbICAgIDAu
M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ZmODExM2EzNzY+XSBk
b19leGVjdmUrMHgxNi8weDIwDQpbICAgIDAuNjM0ODY0XSAgWzxmZmZmZmZmZjgxMDFhZDUyPl0g
c3lzX2V4ZWN2ZSsweDQyLzB4NzANClsgICAgMC42MzQ4NzFdICBbPGZmZmZmZmZmODE0NjBjM2M+
XSBzdHViX2V4ZWN2ZSsweDZjLzB4YzANClsgICAgMC42MzQ4NzZdIENvZGU6IGZhIDQ0IDg5IGU2
IDQ4IGM3IGM3IGE4IGUzIDc1IDgxIDMxIGMwIGU4IDBiIDBmIDAwIDAwIDQ4IDgzIGM0IDE4IDVi
IDQxIDVjIDQxIDVkIDQxIDVlIDQxIDVmIDVkIGMzIDU1IDQ4IDg5IGU1IDBmIDBiIDU1IDQ4IDg5
IGU1IDwwZj4gMGIgNTUgNDggODkgZTUgMGYgMGIgNTUgNDggODkgZTUgNDEgNTUgNDEgNTQgNTMg
MzEgZGIgNDggODUgDQpbICAgIDAuNjM0OTMyXSBSSVAgIFs8ZmZmZmZmZmY4MTQ0ZjNiNz5dIGVu
dGVyX2xhenkucGFydC40KzB4NC8weDYNClsgICAgMC42MzQ5MzhdICBSU1AgPGZmZmY4ODAwMGY2
NDU0ODg+DQpbICAgIDAuNjM0OTQxXSAtLS1bIGVuZCB0cmFjZSA1NTVlODQ1NmNmZGQzOTlhIF0t
LS0NClsgICAgMC42MzQ5NDRdIEZpeGluZyByZWN1cnNpdmUgZmF1bHQgYnV0IHJlYm9vdCBpcyBu
ZWVkZWQhDQo=
--bcaec517a674432cc304ce37f3ed
Content-Type: application/octet-stream; name=config-pvops
Content-Disposition: attachment; filename=config-pvops
Content-Transfer-Encoding: base64
X-Attachment-Id: f_h9e6jk3w1

IwojIEF1dG9tYXRpY2FsbHkgZ2VuZXJhdGVkIGZpbGU7IERPIE5PVCBFRElULgojIExpbnV4L3g4
Nl82NCAzLjQuMTggS2VybmVsIENvbmZpZ3VyYXRpb24KIwpDT05GSUdfNjRCSVQ9eQojIENPTkZJ
R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ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

--bcaec517a674432cc304ce37f3ed--


From xen-devel-bounces@lists.xen.org Sun Nov 11 13:14:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Nov 2012 13:14:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXXLx-00081X-LS; Sun, 11 Nov 2012 13:13:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <abb@gremwell.com>) id 1TXXLu-00081S-P7
	for xen-devel@lists.xen.org; Sun, 11 Nov 2012 13:13:31 +0000
Received: from [85.158.143.35:24101] by server-2.bemta-4.messagelabs.com id
	83/02-28922-A74AF905; Sun, 11 Nov 2012 13:13:30 +0000
X-Env-Sender: abb@gremwell.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1352639607!14434111!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_10_20,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4998 invoked from network); 11 Nov 2012 13:13:28 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	11 Nov 2012 13:13:28 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl15so6470853vcb.32
	for <xen-devel@lists.xen.org>; Sun, 11 Nov 2012 05:13:26 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:cc:content-type
	:x-gm-message-state;
	bh=9ASChrrsuQA65GbCQNfdRXZZLHT415mwWX9EJmWP2OM=;
	b=cDNamct+nAMC+CftP7GXsD0iN/33GYUa7zOhNExCw4ZSnLpvLYZdoscZqxKLPn9w4q
	jU6bILxsR9sFoY5gLVLbB11l7v4HhGXt3RYYVsdRcqdo8c7SeK/Z6SdbSN1ek4FGQNpy
	8Ty1qU+e7ze3QEM645IYB+saCansOwThNlOrH3cQTPBMzvYpuJgi4uUKqWa9+zOYRMO5
	z5UBFEM7uFs68r9kemD9fITJwRE3lhF3iZPCytqdd6dI73pWPb2v+AUeQ/4ilPC/dGR5
	WutV0b7QSOYqzKxOpqP3XNC45Ow66TTYdPSTJPfcXR+h8oVearHUTR4SybBA+dHT9eyr
	l26A==
MIME-Version: 1.0
Received: by 10.220.208.141 with SMTP id gc13mr19788270vcb.55.1352639606631;
	Sun, 11 Nov 2012 05:13:26 -0800 (PST)
Received: by 10.58.155.226 with HTTP; Sun, 11 Nov 2012 05:13:26 -0800 (PST)
Date: Sun, 11 Nov 2012 14:13:26 +0100
Message-ID: <CAHVcMdXOG1esS3gsfngOZgzuQsWOzAg0QB-UOD51tTiTAxAxGQ@mail.gmail.com>
From: Alexandre Bezroutchko <abb@gremwell.com>
To: xen-devel@lists.xen.org
Content-Type: multipart/mixed; boundary=bcaec517a674432cc304ce37f3ed
X-Gm-Message-State: ALoCoQkEytLqGO4nHjMmkbL2ydf8F2g4GKFJXDD1/zvwScvIRU01dEjWsTN2+TPOTFejcKRDrAui
Cc: Marek Marczykowski <marmarek@invisiblethingslab.com>
Subject: [Xen-devel] [xen-devel] kernel 3.4.12 crashes if built debugging
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--bcaec517a674432cc304ce37f3ed
Content-Type: multipart/alternative; boundary=bcaec517a674432cbf04ce37f3eb

--bcaec517a674432cbf04ce37f3eb
Content-Type: text/plain; charset=ISO-8859-1

Hi,

Kernel 3.4.12 built with debugging options crashes during bootstrap. The
issue is easily reproducible and also seems to affect 3.4.18. The
"offending" debug option is 'page allocation', if I switch it off but leave
other debugging options the kernel does not crash.

+CONFIG_DEBUG_PAGEALLOC=y
+CONFIG_WANT_PAGE_DEBUG_FLAGS=y
+CONFIG_PAGE_GUARD=y

The kernel is actually built from devel-3.4 branch of marmarek repo of
Qubes, but all the patches are disabled, so it supposed to be equivalent to
vanilla kernel.

Partial error messages are below. The kernel config file and full log are
attached.

----------------------------------------------------------------------------
[    0.575221] debug: unmapping init memory
ffffffff81879000..ffffffff81913000
[    0.575474] Write protecting the kernel read-only data: 8192k
[    0.579226] debug: unmapping init memory
ffff880001469000..ffff880001600000
[    0.579825] debug: unmapping init memory
ffff8800017fc000..ffff880001800000
[    0.601666] BUG: unable to handle kernel paging request at
ffff88000f66d000
[    0.601678] IP: [<ffffffff81109c64>] __tlb_remove_page+0x84/0xb0
[    0.601689] PGD 180c067 PUD 1810067 PMD 861067 PTE 801000000f66d064
[    0.601698] Oops: 0002 [#1] SMP DEBUG_PAGEALLOC
[    0.601705] CPU 5
[    0.601708] Modules linked in:
[    0.601713]
[    0.601717] Pid: 60, comm: init Not tainted
3.4.12-1alldebugnopvusb.pvops.qubes.x86_64 #1
[    0.601726] RIP: e030:[<ffffffff81109c64>]  [<ffffffff81109c64>]
__tlb_remove_page+0x84/0xb0
[    0.601736] RSP: e02b:ffff88000f645a78  EFLAGS: 00010286
[    0.601741] RAX: ffff88000f66d000 RBX: ffff88000f645c30 RCX:
0000000000000000
[    0.601747] RDX: ffff88000f66d000 RSI: 0000000000000010 RDI:
0000000000000200
[    0.601754] RBP: ffff88000f645a88 R08: 0000000000000000 R09:
ffff880000000000
[    0.601760] R10: 0000000000000001 R11: 00000000581c6204 R12:
ffff88000f62ec68
[    0.601766] R13: 0000000193e49125 R14: ffff88000f5e3150 R15:
000000000042a000
[    0.601777] FS:  00007fda48c7b740(0000) GS:ffff880018d40000(0000)
knlGS:0000000000000000
[    0.601784] CS:  e033 DS: 0000 ES: 0000 CR0: 000000008005003b
[    0.605188] CR2: ffff88000f66d000 CR3: 000000000f665000 CR4:
0000000000002660
[    0.605188] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
[    0.605188] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
0000000000000400
[    0.605188] Process init (pid: 60, threadinfo ffff88000f644000, task
ffff88000f6427c0)
[    0.605188] Stack:
[    0.605188]  ffffea00003d78c0 ffffea000048a680 ffff88000f645b78
ffffffff8110b1d8
[    0.605188]  000000009658ccc5 0000000000000100 0000000000000000
00000000000001ff
[    0.605188]  00000000004d9fff 00000000004da000 00000000004d9fff
ffff88000f62f000
[    0.605188] Call Trace:
[    0.605188]  [<ffffffff8110b1d8>] unmap_page_range+0x4a8/0x730
[    0.605188]  [<ffffffff8110b4c3>] unmap_single_vma+0x63/0xb0
[    0.605188]  [<ffffffff810f52b0>] ? put_pages_list+0x30/0x30
[    0.605188]  [<ffffffff8110bcde>] unmap_vmas+0x5e/0xb0
[    0.605188]  [<ffffffff811131c7>] exit_mmap+0x97/0x140
[    0.605188]  [<ffffffff810445c3>] mmput+0x73/0xf0
[    0.605188]  [<ffffffff811396ad>] flush_old_exec+0x3ed/0x720
[    0.605188]  [<ffffffff8117f8be>] load_elf_binary+0x31e/0x1840
[    0.605188]  [<ffffffff8117f5a0>] ? load_elf_library+0x200/0x200
[    0.605188]  [<ffffffff81138dc7>] search_binary_handler+0xe7/0x2f0
[    0.605188]  [<ffffffff8113a293>] do_execve_common.isra.32+0x3e3/0x4b0
[    0.605188]  [<ffffffff8113a376>] do_execve+0x16/0x20
[    0.605188]  [<ffffffff8101ad52>] sys_execve+0x42/0x70
[    0.605188]  [<ffffffff81460c3c>] stub_execve+0x6c/0xc0
[    0.605188] Code: 8b 47 10 48 8b 10 48 85 d2 74 0c 48 89 53 10 8b 42 0c
8b 52 08 eb bd 31 f6 bf 00 02 00 00 e8 d4 87 fe ff 48 85 c0 48 89 c2 74 1e
<48> c7 00 00 00 00 00 c7 40 08 00 00 00 00 c7 40 0c fe 01 00 00
[    0.605188] RIP  [<ffffffff81109c64>] __tlb_remove_page+0x84/0xb0
[    0.605188]  RSP <ffff88000f645a78>
[    0.605188] CR2: ffff88000f66d000
[    0.605188] ---[ end trace 555e8456cfdd3999 ]---
[    0.634427] ------------[ cut here ]------------
[    0.634435] kernel BUG at
/rw/home/user/qubes/qubes-builder/qubes-src/kernel/kernel-3.4.12/linux-3.4.12/arch/x86/kernel/paravirt.c:244!
[    0.634445] invalid opcode: 0000 [#2] SMP DEBUG_PAGEALLOC
[    0.634451] CPU 5
[    0.634453] Modules linked in:
[    0.634458]
[    0.634462] Pid: 60, comm: init Tainted: G      D
3.4.12-1alldebugnopvusb.pvops.qubes.x86_64 #1
[    0.634472] RIP: e030:[<ffffffff8144f3b7>]  [<ffffffff8144f3b7>]
enter_lazy.part.4+0x4/0x6
[    0.634483] RSP: e02b:ffff88000f645488  EFLAGS: 00010202
[    0.634489] RAX: 0000000000000001 RBX: ffff88000f664c68 RCX:
00003ffffffff000
[    0.634496] RDX: 0000000000000006 RSI: ffffea00003d9a80 RDI:
ffffea00003d9ab0
[    0.634502] RBP: ffff88000f645488 R08: 0000000000000000 R09:
0000000000000000
[    0.634508] R10: ffffffff81871d00 R11: 0000000000000001 R12:
ffff88000f669ff8
[    0.634514] R13: ffff88000f664c68 R14: ffff88000f66afe8 R15:
00007fffffffd000
[    0.634524] FS:  00007fda48c7b740(0000) GS:ffff880018d40000(0000)
knlGS:0000000000000000
[    0.634532] CS:  e033 DS: 0000 ES: 0000 CR0: 000000008005003b
[    0.634537] CR2: ffff88000f66d000 CR3: 000000000180b000 CR4:
0000000000002660
[    0.634544] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
[    0.634550] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
0000000000000400
[    0.634557] Process init (pid: 60, threadinfo ffff88000f644000, task
ffff88000f6427c0)
[    0.634564] Stack:
[    0.634567]  ffff88000f645498 ffffffff81039bf2 ffff88000f645588
ffffffff8110b002
[    0.634577]  0000000000000011 0000000000000100 0000000000000000
00000000000001ff
[    0.634586]  00007fffffffefff 00007ffffffff000 00007fffffffefff
ffff88000f6657f8
[    0.634596] Call Trace:
[    0.634602]  [<ffffffff81039bf2>] paravirt_enter_lazy_mmu+0x22/0x30
[    0.634609]  [<ffffffff8110b002>] unmap_page_range+0x2d2/0x730
[    0.634617]  [<ffffffff810f5098>] ? release_pages+0x148/0x1c0
[    0.634624]  [<ffffffff8110b4c3>] unmap_single_vma+0x63/0xb0
[    0.634631]  [<ffffffff810f52b0>] ? put_pages_list+0x30/0x30
[    0.634637]  [<ffffffff8110bcde>] unmap_vmas+0x5e/0xb0
[    0.634644]  [<ffffffff811131c7>] exit_mmap+0x97/0x140
[    0.634650]  [<ffffffff810445c3>] mmput+0x73/0xf0
[    0.634657]  [<ffffffff81049afd>] exit_mm+0xfd/0x120
[    0.634664]  [<ffffffff81009dc9>] ? xen_irq_enable_direct_reloc+0x4/0x4
[    0.634672]  [<ffffffff8104b244>] do_exit+0x164/0x8a0
[    0.634680]  [<ffffffff81458c42>] ? _raw_spin_unlock_irqrestore+0x12/0x20
[    0.634687]  [<ffffffff810490fa>] ? kmsg_dump+0x5a/0x100
[    0.634694]  [<ffffffff81459eb9>] oops_end+0x99/0xe0
[    0.634700]  [<ffffffff8144fc9f>] no_context+0x24e/0x279
[    0.634707]  [<ffffffff81007339>] ? xen_pmd_val+0x9/0x10
[    0.634713]  [<ffffffff8144fe84>] __bad_area_nosemaphore+0x1ba/0x1d9
[    0.634721]  [<ffffffff81459169>] ? restore_args+0x30/0x30
[    0.634727]  [<ffffffff8144feb1>] bad_area_nosemaphore+0xe/0x10
[    0.634734]  [<ffffffff8145c69b>] do_page_fault+0x32b/0x4f0
[    0.634741]  [<ffffffff8100728a>] ? pte_mfn_to_pfn+0x6a/0x100
[    0.634748]  [<ffffffff810f1cf3>] ? __alloc_pages_nodemask+0x193/0x850
[    0.634756]  [<ffffffff8114997a>] ? __d_lookup+0x7a/0x160
[    0.634763]  [<ffffffff814593a5>] page_fault+0x25/0x30
[    0.634769]  [<ffffffff81109c64>] ? __tlb_remove_page+0x84/0xb0
[    0.634776]  [<ffffffff81109c5c>] ? __tlb_remove_page+0x7c/0xb0
[    0.634782]  [<ffffffff8110b1d8>] unmap_page_range+0x4a8/0x730
[    0.634790]  [<ffffffff8110b4c3>] unmap_single_vma+0x63/0xb0
[    0.634797]  [<ffffffff810f52b0>] ? put_pages_list+0x30/0x30
[    0.634803]  [<ffffffff8110bcde>] unmap_vmas+0x5e/0xb0
[    0.634809]  [<ffffffff811131c7>] exit_mmap+0x97/0x140
[    0.634816]  [<ffffffff810445c3>] mmput+0x73/0xf0
[    0.634822]  [<ffffffff811396ad>] flush_old_exec+0x3ed/0x720
[    0.634830]  [<ffffffff8117f8be>] load_elf_binary+0x31e/0x1840
[    0.634838]  [<ffffffff8117f5a0>] ? load_elf_library+0x200/0x200
[    0.634845]  [<ffffffff81138dc7>] search_binary_handler+0xe7/0x2f0
[    0.634852]  [<ffffffff8113a293>] do_execve_common.isra.32+0x3e3/0x4b0
[    0.634858]  [<ffffffff8113a376>] do_execve+0x16/0x20
[    0.634864]  [<ffffffff8101ad52>] sys_execve+0x42/0x70
[    0.634871]  [<ffffffff81460c3c>] stub_execve+0x6c/0xc0
[    0.634876] Code: fa 44 89 e6 48 c7 c7 a8 e3 75 81 31 c0 e8 0b 0f 00 00
48 83 c4 18 5b 41 5c 41 5d 41 5e 41 5f 5d c3 55 48 89 e5 0f 0b 55 48 89 e5
<0f> 0b 55 48 89 e5 0f 0b 55 48 89 e5 41 55 41 54 53 31 db 48 85
[    0.634932] RIP  [<ffffffff8144f3b7>] enter_lazy.part.4+0x4/0x6
[    0.634938]  RSP <ffff88000f645488>
[    0.634941] ---[ end trace 555e8456cfdd399a ]---
[    0.634944] Fixing recursive fault but reboot is needed!
----------------------------------------------------------------------------

Regards,
Alex

--bcaec517a674432cbf04ce37f3eb
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,<br><br>Kernel 3.4.12 built with debugging options crashes during bootst=
rap. The issue is easily reproducible and also seems to affect 3.4.18. The =
&quot;offending&quot; debug option is &#39;page allocation&#39;, if I switc=
h it off but leave other debugging options the kernel does not crash.<br>
<br>+CONFIG_DEBUG_PAGEALLOC=3Dy<br>+CONFIG_WANT_PAGE_DEBUG_FLAGS=3Dy<br>+CO=
NFIG_PAGE_GUARD=3Dy<br><br>The kernel is actually built from devel-3.4 bran=
ch of marmarek repo of Qubes, but all the patches are disabled, so it suppo=
sed to be equivalent to vanilla kernel.<br>
<br>Partial error messages are below. The kernel config file and full log a=
re attached.<br><br>-------------------------------------------------------=
---------------------<br>[=A0=A0=A0 0.575221] debug: unmapping init memory =
ffffffff81879000..ffffffff81913000<br>
[=A0=A0=A0 0.575474] Write protecting the kernel read-only data: 8192k<br>[=
=A0=A0=A0 0.579226] debug: unmapping init memory ffff880001469000..ffff8800=
01600000<br>[=A0=A0=A0 0.579825] debug: unmapping init memory ffff8800017fc=
000..ffff880001800000<br>
[=A0=A0=A0 0.601666] BUG: unable to handle kernel paging request at ffff880=
00f66d000<br>[=A0=A0=A0 0.601678] IP: [&lt;ffffffff81109c64&gt;] __tlb_remo=
ve_page+0x84/0xb0<br>[=A0=A0=A0 0.601689] PGD 180c067 PUD 1810067 PMD 86106=
7 PTE 801000000f66d064<br>
[=A0=A0=A0 0.601698] Oops: 0002 [#1] SMP DEBUG_PAGEALLOC<br>[=A0=A0=A0 0.60=
1705] CPU 5 <br>[=A0=A0=A0 0.601708] Modules linked in:<br>[=A0=A0=A0 0.601=
713] <br>[=A0=A0=A0 0.601717] Pid: 60, comm: init Not tainted 3.4.12-1allde=
bugnopvusb.pvops.qubes.x86_64 #1=A0 <br>
[=A0=A0=A0 0.601726] RIP: e030:[&lt;ffffffff81109c64&gt;]=A0 [&lt;ffffffff8=
1109c64&gt;] __tlb_remove_page+0x84/0xb0<br>[=A0=A0=A0 0.601736] RSP: e02b:=
ffff88000f645a78=A0 EFLAGS: 00010286<br>[=A0=A0=A0 0.601741] RAX: ffff88000=
f66d000 RBX: ffff88000f645c30 RCX: 0000000000000000<br>
[=A0=A0=A0 0.601747] RDX: ffff88000f66d000 RSI: 0000000000000010 RDI: 00000=
00000000200<br>[=A0=A0=A0 0.601754] RBP: ffff88000f645a88 R08: 000000000000=
0000 R09: ffff880000000000<br>[=A0=A0=A0 0.601760] R10: 0000000000000001 R1=
1: 00000000581c6204 R12: ffff88000f62ec68<br>
[=A0=A0=A0 0.601766] R13: 0000000193e49125 R14: ffff88000f5e3150 R15: 00000=
0000042a000<br>[=A0=A0=A0 0.601777] FS:=A0 00007fda48c7b740(0000) GS:ffff88=
0018d40000(0000) knlGS:0000000000000000<br>[=A0=A0=A0 0.601784] CS:=A0 e033=
 DS: 0000 ES: 0000 CR0: 000000008005003b<br>
[=A0=A0=A0 0.605188] CR2: ffff88000f66d000 CR3: 000000000f665000 CR4: 00000=
00000002660<br>[=A0=A0=A0 0.605188] DR0: 0000000000000000 DR1: 000000000000=
0000 DR2: 0000000000000000<br>[=A0=A0=A0 0.605188] DR3: 0000000000000000 DR=
6: 00000000ffff0ff0 DR7: 0000000000000400<br>
[=A0=A0=A0 0.605188] Process init (pid: 60, threadinfo ffff88000f644000, ta=
sk ffff88000f6427c0)<br>[=A0=A0=A0 0.605188] Stack:<br>[=A0=A0=A0 0.605188]=
=A0 ffffea00003d78c0 ffffea000048a680 ffff88000f645b78 ffffffff8110b1d8<br>=
[=A0=A0=A0 0.605188]=A0 000000009658ccc5 0000000000000100 0000000000000000 =
00000000000001ff<br>
[=A0=A0=A0 0.605188]=A0 00000000004d9fff 00000000004da000 00000000004d9fff =
ffff88000f62f000<br>[=A0=A0=A0 0.605188] Call Trace:<br>[=A0=A0=A0 0.605188=
]=A0 [&lt;ffffffff8110b1d8&gt;] unmap_page_range+0x4a8/0x730<br>[=A0=A0=A0 =
0.605188]=A0 [&lt;ffffffff8110b4c3&gt;] unmap_single_vma+0x63/0xb0<br>
[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff810f52b0&gt;] ? put_pages_list+0x30/0x=
30<br>[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff8110bcde&gt;] unmap_vmas+0x5e/0x=
b0<br>[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff811131c7&gt;] exit_mmap+0x97/0x1=
40<br>[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff810445c3&gt;] mmput+0x73/0xf0<br=
>
[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff811396ad&gt;] flush_old_exec+0x3ed/0x7=
20<br>[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff8117f8be&gt;] load_elf_binary+0x=
31e/0x1840<br>[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff8117f5a0&gt;] ? load_elf=
_library+0x200/0x200<br>
[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff81138dc7&gt;] search_binary_handler+0x=
e7/0x2f0<br>[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff8113a293&gt;] do_execve_co=
mmon.isra.32+0x3e3/0x4b0<br>[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff8113a376&g=
t;] do_execve+0x16/0x20<br>
[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff8101ad52&gt;] sys_execve+0x42/0x70<br>=
[=A0=A0=A0 0.605188]=A0 [&lt;ffffffff81460c3c&gt;] stub_execve+0x6c/0xc0<br=
>[=A0=A0=A0 0.605188] Code: 8b 47 10 48 8b 10 48 85 d2 74 0c 48 89 53 10 8b=
 42 0c 8b 52 08 eb bd 31 f6 bf 00 02 00 00 e8 d4 87 fe ff 48 85 c0 48 89 c2=
 74 1e &lt;48&gt; c7 00 00 00 00 00 c7 40 08 00 00 00 00 c7 40 0c fe 01 00 =
00 <br>
[=A0=A0=A0 0.605188] RIP=A0 [&lt;ffffffff81109c64&gt;] __tlb_remove_page+0x=
84/0xb0<br>[=A0=A0=A0 0.605188]=A0 RSP &lt;ffff88000f645a78&gt;<br>[=A0=A0=
=A0 0.605188] CR2: ffff88000f66d000<br>[=A0=A0=A0 0.605188] ---[ end trace =
555e8456cfdd3999 ]---<br>
[=A0=A0=A0 0.634427] ------------[ cut here ]------------<br>[=A0=A0=A0 0.6=
34435] kernel BUG at /rw/home/user/qubes/qubes-builder/qubes-src/kernel/ker=
nel-3.4.12/linux-3.4.12/arch/x86/kernel/paravirt.c:244!<br>[=A0=A0=A0 0.634=
445] invalid opcode: 0000 [#2] SMP DEBUG_PAGEALLOC<br>
[=A0=A0=A0 0.634451] CPU 5 <br>[=A0=A0=A0 0.634453] Modules linked in:<br>[=
=A0=A0=A0 0.634458] <br>[=A0=A0=A0 0.634462] Pid: 60, comm: init Tainted: G=
=A0=A0=A0=A0=A0 D=A0=A0=A0=A0=A0 3.4.12-1alldebugnopvusb.pvops.qubes.x86_64=
 #1=A0 <br>[=A0=A0=A0 0.634472] RIP: e030:[&lt;ffffffff8144f3b7&gt;]=A0 [&l=
t;ffffffff8144f3b7&gt;] enter_lazy.part.4+0x4/0x6<br>
[=A0=A0=A0 0.634483] RSP: e02b:ffff88000f645488=A0 EFLAGS: 00010202<br>[=A0=
=A0=A0 0.634489] RAX: 0000000000000001 RBX: ffff88000f664c68 RCX: 00003ffff=
ffff000<br>[=A0=A0=A0 0.634496] RDX: 0000000000000006 RSI: ffffea00003d9a80=
 RDI: ffffea00003d9ab0<br>
[=A0=A0=A0 0.634502] RBP: ffff88000f645488 R08: 0000000000000000 R09: 00000=
00000000000<br>[=A0=A0=A0 0.634508] R10: ffffffff81871d00 R11: 000000000000=
0001 R12: ffff88000f669ff8<br>[=A0=A0=A0 0.634514] R13: ffff88000f664c68 R1=
4: ffff88000f66afe8 R15: 00007fffffffd000<br>
[=A0=A0=A0 0.634524] FS:=A0 00007fda48c7b740(0000) GS:ffff880018d40000(0000=
) knlGS:0000000000000000<br>[=A0=A0=A0 0.634532] CS:=A0 e033 DS: 0000 ES: 0=
000 CR0: 000000008005003b<br>[=A0=A0=A0 0.634537] CR2: ffff88000f66d000 CR3=
: 000000000180b000 CR4: 0000000000002660<br>
[=A0=A0=A0 0.634544] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 00000=
00000000000<br>[=A0=A0=A0 0.634550] DR3: 0000000000000000 DR6: 00000000ffff=
0ff0 DR7: 0000000000000400<br>[=A0=A0=A0 0.634557] Process init (pid: 60, t=
hreadinfo ffff88000f644000, task ffff88000f6427c0)<br>
[=A0=A0=A0 0.634564] Stack:<br>[=A0=A0=A0 0.634567]=A0 ffff88000f645498 fff=
fffff81039bf2 ffff88000f645588 ffffffff8110b002<br>[=A0=A0=A0 0.634577]=A0 =
0000000000000011 0000000000000100 0000000000000000 00000000000001ff<br>[=A0=
=A0=A0 0.634586]=A0 00007fffffffefff 00007ffffffff000 00007fffffffefff ffff=
88000f6657f8<br>
[=A0=A0=A0 0.634596] Call Trace:<br>[=A0=A0=A0 0.634602]=A0 [&lt;ffffffff81=
039bf2&gt;] paravirt_enter_lazy_mmu+0x22/0x30<br>[=A0=A0=A0 0.634609]=A0 [&=
lt;ffffffff8110b002&gt;] unmap_page_range+0x2d2/0x730<br>[=A0=A0=A0 0.63461=
7]=A0 [&lt;ffffffff810f5098&gt;] ? release_pages+0x148/0x1c0<br>
[=A0=A0=A0 0.634624]=A0 [&lt;ffffffff8110b4c3&gt;] unmap_single_vma+0x63/0x=
b0<br>[=A0=A0=A0 0.634631]=A0 [&lt;ffffffff810f52b0&gt;] ? put_pages_list+0=
x30/0x30<br>[=A0=A0=A0 0.634637]=A0 [&lt;ffffffff8110bcde&gt;] unmap_vmas+0=
x5e/0xb0<br>[=A0=A0=A0 0.634644]=A0 [&lt;ffffffff811131c7&gt;] exit_mmap+0x=
97/0x140<br>
[=A0=A0=A0 0.634650]=A0 [&lt;ffffffff810445c3&gt;] mmput+0x73/0xf0<br>[=A0=
=A0=A0 0.634657]=A0 [&lt;ffffffff81049afd&gt;] exit_mm+0xfd/0x120<br>[=A0=
=A0=A0 0.634664]=A0 [&lt;ffffffff81009dc9&gt;] ? xen_irq_enable_direct_relo=
c+0x4/0x4<br>[=A0=A0=A0 0.634672]=A0 [&lt;ffffffff8104b244&gt;] do_exit+0x1=
64/0x8a0<br>
[=A0=A0=A0 0.634680]=A0 [&lt;ffffffff81458c42&gt;] ? _raw_spin_unlock_irqre=
store+0x12/0x20<br>[=A0=A0=A0 0.634687]=A0 [&lt;ffffffff810490fa&gt;] ? kms=
g_dump+0x5a/0x100<br>[=A0=A0=A0 0.634694]=A0 [&lt;ffffffff81459eb9&gt;] oop=
s_end+0x99/0xe0<br>[=A0=A0=A0 0.634700]=A0 [&lt;ffffffff8144fc9f&gt;] no_co=
ntext+0x24e/0x279<br>
[=A0=A0=A0 0.634707]=A0 [&lt;ffffffff81007339&gt;] ? xen_pmd_val+0x9/0x10<b=
r>[=A0=A0=A0 0.634713]=A0 [&lt;ffffffff8144fe84&gt;] __bad_area_nosemaphore=
+0x1ba/0x1d9<br>[=A0=A0=A0 0.634721]=A0 [&lt;ffffffff81459169&gt;] ? restor=
e_args+0x30/0x30<br>
[=A0=A0=A0 0.634727]=A0 [&lt;ffffffff8144feb1&gt;] bad_area_nosemaphore+0xe=
/0x10<br>[=A0=A0=A0 0.634734]=A0 [&lt;ffffffff8145c69b&gt;] do_page_fault+0=
x32b/0x4f0<br>[=A0=A0=A0 0.634741]=A0 [&lt;ffffffff8100728a&gt;] ? pte_mfn_=
to_pfn+0x6a/0x100<br>
[=A0=A0=A0 0.634748]=A0 [&lt;ffffffff810f1cf3&gt;] ? __alloc_pages_nodemask=
+0x193/0x850<br>[=A0=A0=A0 0.634756]=A0 [&lt;ffffffff8114997a&gt;] ? __d_lo=
okup+0x7a/0x160<br>[=A0=A0=A0 0.634763]=A0 [&lt;ffffffff814593a5&gt;] page_=
fault+0x25/0x30<br>[=A0=A0=A0 0.634769]=A0 [&lt;ffffffff81109c64&gt;] ? __t=
lb_remove_page+0x84/0xb0<br>
[=A0=A0=A0 0.634776]=A0 [&lt;ffffffff81109c5c&gt;] ? __tlb_remove_page+0x7c=
/0xb0<br>[=A0=A0=A0 0.634782]=A0 [&lt;ffffffff8110b1d8&gt;] unmap_page_rang=
e+0x4a8/0x730<br>[=A0=A0=A0 0.634790]=A0 [&lt;ffffffff8110b4c3&gt;] unmap_s=
ingle_vma+0x63/0xb0<br>
[=A0=A0=A0 0.634797]=A0 [&lt;ffffffff810f52b0&gt;] ? put_pages_list+0x30/0x=
30<br>[=A0=A0=A0 0.634803]=A0 [&lt;ffffffff8110bcde&gt;] unmap_vmas+0x5e/0x=
b0<br>[=A0=A0=A0 0.634809]=A0 [&lt;ffffffff811131c7&gt;] exit_mmap+0x97/0x1=
40<br>[=A0=A0=A0 0.634816]=A0 [&lt;ffffffff810445c3&gt;] mmput+0x73/0xf0<br=
>
[=A0=A0=A0 0.634822]=A0 [&lt;ffffffff811396ad&gt;] flush_old_exec+0x3ed/0x7=
20<br>[=A0=A0=A0 0.634830]=A0 [&lt;ffffffff8117f8be&gt;] load_elf_binary+0x=
31e/0x1840<br>[=A0=A0=A0 0.634838]=A0 [&lt;ffffffff8117f5a0&gt;] ? load_elf=
_library+0x200/0x200<br>
[=A0=A0=A0 0.634845]=A0 [&lt;ffffffff81138dc7&gt;] search_binary_handler+0x=
e7/0x2f0<br>[=A0=A0=A0 0.634852]=A0 [&lt;ffffffff8113a293&gt;] do_execve_co=
mmon.isra.32+0x3e3/0x4b0<br>[=A0=A0=A0 0.634858]=A0 [&lt;ffffffff8113a376&g=
t;] do_execve+0x16/0x20<br>
[=A0=A0=A0 0.634864]=A0 [&lt;ffffffff8101ad52&gt;] sys_execve+0x42/0x70<br>=
[=A0=A0=A0 0.634871]=A0 [&lt;ffffffff81460c3c&gt;] stub_execve+0x6c/0xc0<br=
>[=A0=A0=A0 0.634876] Code: fa 44 89 e6 48 c7 c7 a8 e3 75 81 31 c0 e8 0b 0f=
 00 00 48 83 c4 18 5b 41 5c 41 5d 41 5e 41 5f 5d c3 55 48 89 e5 0f 0b 55 48=
 89 e5 &lt;0f&gt; 0b 55 48 89 e5 0f 0b 55 48 89 e5 41 55 41 54 53 31 db 48 =
85 <br>
[=A0=A0=A0 0.634932] RIP=A0 [&lt;ffffffff8144f3b7&gt;] enter_lazy.part.4+0x=
4/0x6<br>[=A0=A0=A0 0.634938]=A0 RSP &lt;ffff88000f645488&gt;<br>[=A0=A0=A0=
 0.634941] ---[ end trace 555e8456cfdd399a ]---<br>[=A0=A0=A0 0.634944] Fix=
ing recursive fault but reboot is needed!<br>
---------------------------------------------------------------------------=
-<br><br>Regards,<br>Alex<br><br>

--bcaec517a674432cbf04ce37f3eb--
--bcaec517a674432cc304ce37f3ed
Content-Type: application/octet-stream; name="guest-work.log"
Content-Disposition: attachment; filename="guest-work.log"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_h9e6j5ne0

WyAgICAwLjAwMDAwMF0gSW5pdGlhbGl6aW5nIGNncm91cCBzdWJzeXMgY3B1c2V0DQpbICAgIDAu
MDAwMDAwXSBJbml0aWFsaXppbmcgY2dyb3VwIHN1YnN5cyBjcHUNClsgICAgMC4wMDAwMDBdIExp
bnV4IHZlcnNpb24gMy40LjEyLTFhbGxkZWJ1Z25vcHZ1c2IucHZvcHMucXViZXMueDg2XzY0ICh1
c2VyQHFkdnApIChnY2MgdmVyc2lvbiA0LjcuMiAyMD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DZjLzB4YzANClsgICAgMC42MzQ4NzZdIENvZGU6IGZhIDQ0IDg5IGU2
IDQ4IGM3IGM3IGE4IGUzIDc1IDgxIDMxIGMwIGU4IDBiIDBmIDAwIDAwIDQ4IDgzIGM0IDE4IDVi
IDQxIDVjIDQxIDVkIDQxIDVlIDQxIDVmIDVkIGMzIDU1IDQ4IDg5IGU1IDBmIDBiIDU1IDQ4IDg5
IGU1IDwwZj4gMGIgNTUgNDggODkgZTUgMGYgMGIgNTUgNDggODkgZTUgNDEgNTUgNDEgNTQgNTMg
MzEgZGIgNDggODUgDQpbICAgIDAuNjM0OTMyXSBSSVAgIFs8ZmZmZmZmZmY4MTQ0ZjNiNz5dIGVu
dGVyX2xhenkucGFydC40KzB4NC8weDYNClsgICAgMC42MzQ5MzhdICBSU1AgPGZmZmY4ODAwMGY2
NDU0ODg+DQpbICAgIDAuNjM0OTQxXSAtLS1bIGVuZCB0cmFjZSA1NTVlODQ1NmNmZGQzOTlhIF0t
LS0NClsgICAgMC42MzQ5NDRdIEZpeGluZyByZWN1cnNpdmUgZmF1bHQgYnV0IHJlYm9vdCBpcyBu
ZWVkZWQhDQo=
--bcaec517a674432cc304ce37f3ed
Content-Type: application/octet-stream; name=config-pvops
Content-Disposition: attachment; filename=config-pvops
Content-Transfer-Encoding: base64
X-Attachment-Id: f_h9e6jk3w1

IwojIEF1dG9tYXRpY2FsbHkgZ2VuZXJhdGVkIGZpbGU7IERPIE5PVCBFRElULgojIExpbnV4L3g4
Nl82NCAzLjQuMTggS2VybmVsIENvbmZpZ3VyYXRpb24KIwpDT05GSUdfNjRCSVQ9eQojIENPTkZJ
R19YODZfMzIgaXMgbm90IHNldApDT05GSUdfWDg2XzY0PXkKQ09ORklHX1g4Nj15CkNPTkZJR19J
TlNUUlVDVElPTl9ERUNPREVSPXkKQ09ORklHX09VVFBVVF9GT1JNQVQ9ImVsZjY0LXg4Ni02NCIK
Q09ORklHX0FSQ0hfREVGQ09ORklHPSJhcmNoL3g4Ni9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X0RFQ19BUk09eQpDT05GSUdf
WFpfREVDX0FSTVRIVU1CPXkKQ09ORklHX1haX0RFQ19TUEFSQz15CkNPTkZJR19YWl9ERUNfQkNK
PXkKIyBDT05GSUdfWFpfREVDX1RFU1QgaXMgbm90IHNldApDT05GSUdfREVDT01QUkVTU19HWklQ
PXkKQ09ORklHX0RFQ09NUFJFU1NfQlpJUDI9eQpDT05GSUdfREVDT01QUkVTU19MWk1BPXkKQ09O
RklHX0RFQ09NUFJFU1NfWFo9eQpDT05GSUdfREVDT01QUkVTU19MWk89eQpDT05GSUdfR0VORVJJ
Q19BTExPQ0FUT1I9eQpDT05GSUdfUkVFRF9TT0xPTU9OPW0KQ09ORklHX1JFRURfU09MT01PTl9E
RUMxNj15CkNPTkZJR19CQ0g9bQpDT05GSUdfQkNIX0NPTlNUX1BBUkFNUz15CkNPTkZJR19URVhU
U0VBUkNIPXkKQ09ORklHX1RFWFRTRUFSQ0hfS01QPW0KQ09ORklHX1RFWFRTRUFSQ0hfQk09bQpD
T05GSUdfVEVYVFNFQVJDSF9GU009bQpDT05GSUdfQlRSRUU9eQpDT05GSUdfSEFTX0lPTUVNPXkK
Q09ORklHX0hBU19JT1BPUlQ9eQpDT05GSUdfSEFTX0RNQT15CkNPTkZJR19DSEVDS19TSUdOQVRV
UkU9eQpDT05GSUdfQ1BVX1JNQVA9eQpDT05GSUdfRFFMPXkKQ09ORklHX05MQVRUUj15CkNPTkZJ
R19MUlVfQ0FDSEU9bQpDT05GSUdfQVZFUkFHRT15CkNPTkZJR19DT1JESUM9bQo=
--bcaec517a674432cc304ce37f3ed
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.xen.org
http://lists.xen.org/xen-devel

--bcaec517a674432cc304ce37f3ed--


From xen-devel-bounces@lists.xen.org Sun Nov 11 15:37:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Nov 2012 15:37:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXZaG-0000bv-M8; Sun, 11 Nov 2012 15:36:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xzhang@cs.uic.edu>) id 1TXZaF-0000bq-Mc
	for xen-devel@lists.xen.org; Sun, 11 Nov 2012 15:36:27 +0000
Received: from [193.109.254.147:5924] by server-11.bemta-14.messagelabs.com id
	67/59-29027-AF5CF905; Sun, 11 Nov 2012 15:36:26 +0000
X-Env-Sender: xzhang@cs.uic.edu
X-Msg-Ref: server-4.tower-27.messagelabs.com!1352648185!8665272!1
X-Originating-IP: [131.193.32.56]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4256 invoked from network); 11 Nov 2012 15:36:26 -0000
Received: from mailvm.cs.uic.edu (HELO mailvm.cs.uic.edu) (131.193.32.56)
	by server-4.tower-27.messagelabs.com with SMTP;
	11 Nov 2012 15:36:26 -0000
Received: from [10.8.202.201] (dhcp-vlan3039-14-233.wireless.uic.edu
	[128.248.17.233])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mailvm.cs.uic.edu (Postfix) with ESMTP id A70AF1F010F;
	Sun, 11 Nov 2012 09:36:22 -0600 (CST)
Message-ID: <509FC5F6.4050506@cs.uic.edu>
Date: Sun, 11 Nov 2012 09:36:22 -0600
From: Xu Zhang <xzhang@cs.uic.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120911 Thunderbird/15.0.1
MIME-Version: 1.0
To: Samuel Thibault <samuel.thibault@ens-lyon.org>, 
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, gm281@cam.ac.uk
References: <50871D90.50606@gmail.com> <20121025205653.GW5925@type.chello.at>
	<5098A674.5090203@cs.uic.edu> <20121110135218.GA5436@type>
In-Reply-To: <20121110135218.GA5436@type>
Subject: Re: [Xen-devel] Nested events in 64bit mini-OS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Samuel,

Thanks for the reply.

On 11/10/2012 07:52 AM, Samuel Thibault wrote:

> You can simply run it, giving it a blk dev (or also a fb dev), it will
> run app_main(), which keeps reading stuff, and draws squares on the fb.
>
> Ideally you should manage to trigger fixups, by stuffing a wait loop in
> the critical section.
I'll try this in the following week. Thank you for pointing it out.

>> A follow-up question is that given this fix, do you still need
>> hypercall iret?
> Actually it's worse than that, see below.
>
>> +	movq %rbx,5*8(%rsp)
> ...
>> +
>> +	# check against re-entrance
>> +	movq RIP(%rsp),%rbx
>> +	cmpq $scrit,%rbx
>> +	jb 10f
>> +	cmpq $ecrit,%rbx
>> +	jb  critical_region_fixup
>> +
>> +10:	movq RBX(%rsp),%rbx			# restore rbx
> Do we really need to restore %rbx?  I don't think do_hypervisor_callback
> uses it.
No I don't think so. I was just being pre-cautious. :-)

>> +    .byte 0x78,0x78,0x78,0x78,0x78            # jmp    hypercall_page + (__HYPERVISOR_iret * 32)
> Here we would also need a fixup table for the code at hypercall_page!
Nice catch!

> A nicer fix would be to inline the hypercall code here.  That said, I
> have to say I don't know any detail about the NMI flag, I don't see it
> defined in the Intel manual, and I don't see it being set in the Xen
> hypervisor.  Unless somebody knows more about it, I would assume that it
> currently never happens, and simply stuff a
>
> ud2 /* TODO: fix re-entrance fixup for hypercall in NMI case (when does that happen actually?) */
>
> before the jmp, to catch it if it ever does happen.
I don't know that either. I tried to rise guest domain an NMI with "xl 
trigger", but it seems that only works for HVM hosts.

>
> Also, it would be good to check against critical section size change, in
> case somebody e.g. changes a value, or a macro like XEN_PUT_VCPU_INFO.
> For instance, stuff right after the table:
>
> 	.if (ecrit-scrit) != (critical_fixup_table_end - critical_fixup_table)
> 	.error "The critical has changed, the fixup table needs updating"
> 	.endif
Totally agree. And it somewhat saves the obligation of checking if the 
table size matches the one of critical section by looking at disassemble 
output. :-)

>
> More generally, some cleanup could go along the patch, but I'd say
> keep it as you have done, focused on only the fixup code, to have it
> as such in the repository history, and then we could clean some things
> afterwards.
>
> Samuel
>
I really appreciate your feedback. Thanks again, Samuel!

Xu

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 11 15:37:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Nov 2012 15:37:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXZaG-0000bv-M8; Sun, 11 Nov 2012 15:36:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xzhang@cs.uic.edu>) id 1TXZaF-0000bq-Mc
	for xen-devel@lists.xen.org; Sun, 11 Nov 2012 15:36:27 +0000
Received: from [193.109.254.147:5924] by server-11.bemta-14.messagelabs.com id
	67/59-29027-AF5CF905; Sun, 11 Nov 2012 15:36:26 +0000
X-Env-Sender: xzhang@cs.uic.edu
X-Msg-Ref: server-4.tower-27.messagelabs.com!1352648185!8665272!1
X-Originating-IP: [131.193.32.56]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4256 invoked from network); 11 Nov 2012 15:36:26 -0000
Received: from mailvm.cs.uic.edu (HELO mailvm.cs.uic.edu) (131.193.32.56)
	by server-4.tower-27.messagelabs.com with SMTP;
	11 Nov 2012 15:36:26 -0000
Received: from [10.8.202.201] (dhcp-vlan3039-14-233.wireless.uic.edu
	[128.248.17.233])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mailvm.cs.uic.edu (Postfix) with ESMTP id A70AF1F010F;
	Sun, 11 Nov 2012 09:36:22 -0600 (CST)
Message-ID: <509FC5F6.4050506@cs.uic.edu>
Date: Sun, 11 Nov 2012 09:36:22 -0600
From: Xu Zhang <xzhang@cs.uic.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120911 Thunderbird/15.0.1
MIME-Version: 1.0
To: Samuel Thibault <samuel.thibault@ens-lyon.org>, 
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, gm281@cam.ac.uk
References: <50871D90.50606@gmail.com> <20121025205653.GW5925@type.chello.at>
	<5098A674.5090203@cs.uic.edu> <20121110135218.GA5436@type>
In-Reply-To: <20121110135218.GA5436@type>
Subject: Re: [Xen-devel] Nested events in 64bit mini-OS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Samuel,

Thanks for the reply.

On 11/10/2012 07:52 AM, Samuel Thibault wrote:

> You can simply run it, giving it a blk dev (or also a fb dev), it will
> run app_main(), which keeps reading stuff, and draws squares on the fb.
>
> Ideally you should manage to trigger fixups, by stuffing a wait loop in
> the critical section.
I'll try this in the following week. Thank you for pointing it out.

>> A follow-up question is that given this fix, do you still need
>> hypercall iret?
> Actually it's worse than that, see below.
>
>> +	movq %rbx,5*8(%rsp)
> ...
>> +
>> +	# check against re-entrance
>> +	movq RIP(%rsp),%rbx
>> +	cmpq $scrit,%rbx
>> +	jb 10f
>> +	cmpq $ecrit,%rbx
>> +	jb  critical_region_fixup
>> +
>> +10:	movq RBX(%rsp),%rbx			# restore rbx
> Do we really need to restore %rbx?  I don't think do_hypervisor_callback
> uses it.
No I don't think so. I was just being pre-cautious. :-)

>> +    .byte 0x78,0x78,0x78,0x78,0x78            # jmp    hypercall_page + (__HYPERVISOR_iret * 32)
> Here we would also need a fixup table for the code at hypercall_page!
Nice catch!

> A nicer fix would be to inline the hypercall code here.  That said, I
> have to say I don't know any detail about the NMI flag, I don't see it
> defined in the Intel manual, and I don't see it being set in the Xen
> hypervisor.  Unless somebody knows more about it, I would assume that it
> currently never happens, and simply stuff a
>
> ud2 /* TODO: fix re-entrance fixup for hypercall in NMI case (when does that happen actually?) */
>
> before the jmp, to catch it if it ever does happen.
I don't know that either. I tried to rise guest domain an NMI with "xl 
trigger", but it seems that only works for HVM hosts.

>
> Also, it would be good to check against critical section size change, in
> case somebody e.g. changes a value, or a macro like XEN_PUT_VCPU_INFO.
> For instance, stuff right after the table:
>
> 	.if (ecrit-scrit) != (critical_fixup_table_end - critical_fixup_table)
> 	.error "The critical has changed, the fixup table needs updating"
> 	.endif
Totally agree. And it somewhat saves the obligation of checking if the 
table size matches the one of critical section by looking at disassemble 
output. :-)

>
> More generally, some cleanup could go along the patch, but I'd say
> keep it as you have done, focused on only the fixup code, to have it
> as such in the repository history, and then we could clean some things
> afterwards.
>
> Samuel
>
I really appreciate your feedback. Thanks again, Samuel!

Xu

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 11 23:36:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Nov 2012 23:36:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXh3y-0002rX-Bu; Sun, 11 Nov 2012 23:35:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <sunds@peapod.net>) id 1TXh3w-0002rS-FZ
	for xen-devel@lists.xen.org; Sun, 11 Nov 2012 23:35:36 +0000
Received: from [85.158.137.99:60456] by server-16.bemta-3.messagelabs.com id
	A6/9A-07461-74630A05; Sun, 11 Nov 2012 23:35:35 +0000
X-Env-Sender: sunds@peapod.net
X-Msg-Ref: server-11.tower-217.messagelabs.com!1352676934!17784270!1
X-Originating-IP: [209.85.214.45]
X-SpamReason: No, hits=0.9 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_50_60,HTML_MESSAGE,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17218 invoked from network); 11 Nov 2012 23:35:34 -0000
Received: from mail-bk0-f45.google.com (HELO mail-bk0-f45.google.com)
	(209.85.214.45)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	11 Nov 2012 23:35:34 -0000
Received: by mail-bk0-f45.google.com with SMTP id je9so1285520bkc.32
	for <xen-devel@lists.xen.org>; Sun, 11 Nov 2012 15:35:34 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type
	:x-gm-message-state;
	bh=WNKDpiZSor66YOWeX6lFmFnU7/iIM+mcAR0K67pBH4s=;
	b=SM586JyNW4uEQyRyVlpBf1Cwmo2M+E5S1TRZ48+0kpDz/3xWcdBLSkHuoqJbWbWFPE
	rVeifpY2jc/QaczgPp+XwzMRt6I2f88mMAMHpG92zmA1DrG5jWvd6nOdk8Uy7ygwzwcG
	tIrZx9GcIykoZuasxnR0349CnN4J4edCj6R2bRNni/qMnHCFLwzGf3oD/k0Gc9Wyjybn
	2podhHvF8vX/6XUPiebszEyMzxFvOk2J9uvYJssdkMfVzeL38qpsAWHGdumpCqpmSyRF
	t0mK/wlZVQ9wg89s6choBjR3lPMz4d9jTfm3tD3EODTwzIReXaeFnD+Z6wc9o8OSQ4BJ
	L5fA==
MIME-Version: 1.0
Received: by 10.204.147.25 with SMTP id j25mr1111679bkv.36.1352676933897; Sun,
	11 Nov 2012 15:35:33 -0800 (PST)
Received: by 10.205.81.74 with HTTP; Sun, 11 Nov 2012 15:35:33 -0800 (PST)
Date: Sun, 11 Nov 2012 17:35:33 -0600
Message-ID: <CAP4+OA3-CsKxJizFpx-V48cCFKJc5KXNQzzY4oQ6pQ5pu0RFMg@mail.gmail.com>
From: D Sundstrom <sunds@peapod.net>
To: xen-devel@lists.xen.org
X-Gm-Message-State: ALoCoQkAJrv3g8xYJgmaDsQCLkPgpLID67K0XMddFJR0Fn/elgrM5LXv1dlD5ikRxm+88BMAJgcE
Subject: [Xen-devel] Immediate kernel panic using gntdev device
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7258340889973871494=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============7258340889973871494==
Content-Type: multipart/alternative; boundary=0015174c3b2c240f1e04ce40a497

--0015174c3b2c240f1e04ce40a497
Content-Type: text/plain; charset=ISO-8859-1

Running under debian wheezy kernel 3.2.0-3-686-pae (32 bit), under Xen 4.1
HVM.

The linux PV drivers load and all appears to be fine.

I want to use the gntalloc device to allocate a page of memory from Domain
A and then map that into Domain B using gntdev.  Both are unprivileged
domains.

Using Daniel DeGraaf's test program here:
http://lists.xen.org/archives/html/xen-devel/2011-01/txtzDU6iZhTkB.txt

I can run the command to create a grant, but upon running the command to
map the grant (from either the same domain or another DomU), the kernel
immediately crashes with no diagnostic output.

Should I expect to be able to map grants in a DomU allocated in another
DomU?

Example of running the test:

$  xenstore-read domid
8

$  thetestprogram

src-add <domid>       return gntref, address
map <domid> <ref>     return index, address
src-del <gntref>      no rv
gu <index>            no rv
unmap <address>       no rv
show                  print and change mapped items
This process bumps by 4000

src-add 8

src-add mapped 1372 at 0=0

show

00(-1217044480,0): current     4000    new    0

map 8 1372

(immediately crashes the VM)


Thanks,

David

--0015174c3b2c240f1e04ce40a497
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><div>Running under debian wheezy kernel 3.2.0-3-686-pae (32 bit), under=
 Xen 4.1 HVM.</div><div><br></div><div>The linux PV drivers load and all ap=
pears to be fine.</div><div><br></div><div>I want to use the gntalloc devic=
e to allocate a page of memory from Domain A and then map that into Domain =
B using gntdev. =A0Both are unprivileged domains. =A0</div>
<div><br></div><div>Using Daniel DeGraaf&#39;s test program here: <a href=
=3D"http://lists.xen.org/archives/html/xen-devel/2011-01/txtzDU6iZhTkB.txt"=
>http://lists.xen.org/archives/html/xen-devel/2011-01/txtzDU6iZhTkB.txt</a>=
</div>
<div><br></div><div>I can run the command to create a grant, but upon runni=
ng the command to map the grant (from either the same domain or another Dom=
U), the kernel immediately crashes with no diagnostic output.</div><div>
<br></div><div>Should I expect to be able to map grants in a DomU allocated=
 in another DomU?</div><div><br></div><div>Example of running the test:</di=
v><div><br></div><div>$ =A0xenstore-read domid</div><div>8</div><div><br>
</div><div>$ =A0thetestprogram</div><div><span class=3D"Apple-style-span" s=
tyle=3D"font-family:Times;font-size:medium"><pre style=3D"word-wrap:break-w=
ord;white-space:pre-wrap">src-add &lt;domid&gt;       return gntref, addres=
s
map &lt;domid&gt; &lt;ref&gt;     return index, address
src-del &lt;gntref&gt;      no rv
gu &lt;index&gt;            no rv
unmap &lt;address&gt;       no rv
show                  print and change mapped items
This process bumps by 4000</pre><pre style=3D"word-wrap:break-word;white-sp=
ace:pre-wrap">src-add 8</pre><pre style=3D"word-wrap:break-word;white-space=
:pre-wrap">src-add mapped 1372 at 0=3D0</pre><pre style=3D"word-wrap:break-=
word;white-space:pre-wrap">
show</pre><pre style=3D"word-wrap:break-word;white-space:pre-wrap">00(-1217=
044480,0): current     4000    new    0</pre><pre style=3D"word-wrap:break-=
word;white-space:pre-wrap">map 8 1372   </pre><pre style=3D"word-wrap:break=
-word;white-space:pre-wrap">
(immediately crashes the VM)</pre><pre style=3D"word-wrap:break-word;white-=
space:pre-wrap"><br></pre><pre style=3D"word-wrap:break-word;white-space:pr=
e-wrap">Thanks,</pre><pre style=3D"word-wrap:break-word;white-space:pre-wra=
p">
David</pre><pre style=3D"word-wrap:break-word;white-space:pre-wrap"><br></p=
re><pre style=3D"word-wrap:break-word;white-space:pre-wrap"><br></pre></spa=
n></div><div><br></div><div>=A0</div>

--0015174c3b2c240f1e04ce40a497--


--===============7258340889973871494==
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.xen.org
http://lists.xen.org/xen-devel

--===============7258340889973871494==--


From xen-devel-bounces@lists.xen.org Sun Nov 11 23:36:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Nov 2012 23:36:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXh3y-0002rX-Bu; Sun, 11 Nov 2012 23:35:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <sunds@peapod.net>) id 1TXh3w-0002rS-FZ
	for xen-devel@lists.xen.org; Sun, 11 Nov 2012 23:35:36 +0000
Received: from [85.158.137.99:60456] by server-16.bemta-3.messagelabs.com id
	A6/9A-07461-74630A05; Sun, 11 Nov 2012 23:35:35 +0000
X-Env-Sender: sunds@peapod.net
X-Msg-Ref: server-11.tower-217.messagelabs.com!1352676934!17784270!1
X-Originating-IP: [209.85.214.45]
X-SpamReason: No, hits=0.9 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_50_60,HTML_MESSAGE,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17218 invoked from network); 11 Nov 2012 23:35:34 -0000
Received: from mail-bk0-f45.google.com (HELO mail-bk0-f45.google.com)
	(209.85.214.45)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	11 Nov 2012 23:35:34 -0000
Received: by mail-bk0-f45.google.com with SMTP id je9so1285520bkc.32
	for <xen-devel@lists.xen.org>; Sun, 11 Nov 2012 15:35:34 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type
	:x-gm-message-state;
	bh=WNKDpiZSor66YOWeX6lFmFnU7/iIM+mcAR0K67pBH4s=;
	b=SM586JyNW4uEQyRyVlpBf1Cwmo2M+E5S1TRZ48+0kpDz/3xWcdBLSkHuoqJbWbWFPE
	rVeifpY2jc/QaczgPp+XwzMRt6I2f88mMAMHpG92zmA1DrG5jWvd6nOdk8Uy7ygwzwcG
	tIrZx9GcIykoZuasxnR0349CnN4J4edCj6R2bRNni/qMnHCFLwzGf3oD/k0Gc9Wyjybn
	2podhHvF8vX/6XUPiebszEyMzxFvOk2J9uvYJssdkMfVzeL38qpsAWHGdumpCqpmSyRF
	t0mK/wlZVQ9wg89s6choBjR3lPMz4d9jTfm3tD3EODTwzIReXaeFnD+Z6wc9o8OSQ4BJ
	L5fA==
MIME-Version: 1.0
Received: by 10.204.147.25 with SMTP id j25mr1111679bkv.36.1352676933897; Sun,
	11 Nov 2012 15:35:33 -0800 (PST)
Received: by 10.205.81.74 with HTTP; Sun, 11 Nov 2012 15:35:33 -0800 (PST)
Date: Sun, 11 Nov 2012 17:35:33 -0600
Message-ID: <CAP4+OA3-CsKxJizFpx-V48cCFKJc5KXNQzzY4oQ6pQ5pu0RFMg@mail.gmail.com>
From: D Sundstrom <sunds@peapod.net>
To: xen-devel@lists.xen.org
X-Gm-Message-State: ALoCoQkAJrv3g8xYJgmaDsQCLkPgpLID67K0XMddFJR0Fn/elgrM5LXv1dlD5ikRxm+88BMAJgcE
Subject: [Xen-devel] Immediate kernel panic using gntdev device
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7258340889973871494=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============7258340889973871494==
Content-Type: multipart/alternative; boundary=0015174c3b2c240f1e04ce40a497

--0015174c3b2c240f1e04ce40a497
Content-Type: text/plain; charset=ISO-8859-1

Running under debian wheezy kernel 3.2.0-3-686-pae (32 bit), under Xen 4.1
HVM.

The linux PV drivers load and all appears to be fine.

I want to use the gntalloc device to allocate a page of memory from Domain
A and then map that into Domain B using gntdev.  Both are unprivileged
domains.

Using Daniel DeGraaf's test program here:
http://lists.xen.org/archives/html/xen-devel/2011-01/txtzDU6iZhTkB.txt

I can run the command to create a grant, but upon running the command to
map the grant (from either the same domain or another DomU), the kernel
immediately crashes with no diagnostic output.

Should I expect to be able to map grants in a DomU allocated in another
DomU?

Example of running the test:

$  xenstore-read domid
8

$  thetestprogram

src-add <domid>       return gntref, address
map <domid> <ref>     return index, address
src-del <gntref>      no rv
gu <index>            no rv
unmap <address>       no rv
show                  print and change mapped items
This process bumps by 4000

src-add 8

src-add mapped 1372 at 0=0

show

00(-1217044480,0): current     4000    new    0

map 8 1372

(immediately crashes the VM)


Thanks,

David

--0015174c3b2c240f1e04ce40a497
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><div>Running under debian wheezy kernel 3.2.0-3-686-pae (32 bit), under=
 Xen 4.1 HVM.</div><div><br></div><div>The linux PV drivers load and all ap=
pears to be fine.</div><div><br></div><div>I want to use the gntalloc devic=
e to allocate a page of memory from Domain A and then map that into Domain =
B using gntdev. =A0Both are unprivileged domains. =A0</div>
<div><br></div><div>Using Daniel DeGraaf&#39;s test program here: <a href=
=3D"http://lists.xen.org/archives/html/xen-devel/2011-01/txtzDU6iZhTkB.txt"=
>http://lists.xen.org/archives/html/xen-devel/2011-01/txtzDU6iZhTkB.txt</a>=
</div>
<div><br></div><div>I can run the command to create a grant, but upon runni=
ng the command to map the grant (from either the same domain or another Dom=
U), the kernel immediately crashes with no diagnostic output.</div><div>
<br></div><div>Should I expect to be able to map grants in a DomU allocated=
 in another DomU?</div><div><br></div><div>Example of running the test:</di=
v><div><br></div><div>$ =A0xenstore-read domid</div><div>8</div><div><br>
</div><div>$ =A0thetestprogram</div><div><span class=3D"Apple-style-span" s=
tyle=3D"font-family:Times;font-size:medium"><pre style=3D"word-wrap:break-w=
ord;white-space:pre-wrap">src-add &lt;domid&gt;       return gntref, addres=
s
map &lt;domid&gt; &lt;ref&gt;     return index, address
src-del &lt;gntref&gt;      no rv
gu &lt;index&gt;            no rv
unmap &lt;address&gt;       no rv
show                  print and change mapped items
This process bumps by 4000</pre><pre style=3D"word-wrap:break-word;white-sp=
ace:pre-wrap">src-add 8</pre><pre style=3D"word-wrap:break-word;white-space=
:pre-wrap">src-add mapped 1372 at 0=3D0</pre><pre style=3D"word-wrap:break-=
word;white-space:pre-wrap">
show</pre><pre style=3D"word-wrap:break-word;white-space:pre-wrap">00(-1217=
044480,0): current     4000    new    0</pre><pre style=3D"word-wrap:break-=
word;white-space:pre-wrap">map 8 1372   </pre><pre style=3D"word-wrap:break=
-word;white-space:pre-wrap">
(immediately crashes the VM)</pre><pre style=3D"word-wrap:break-word;white-=
space:pre-wrap"><br></pre><pre style=3D"word-wrap:break-word;white-space:pr=
e-wrap">Thanks,</pre><pre style=3D"word-wrap:break-word;white-space:pre-wra=
p">
David</pre><pre style=3D"word-wrap:break-word;white-space:pre-wrap"><br></p=
re><pre style=3D"word-wrap:break-word;white-space:pre-wrap"><br></pre></spa=
n></div><div><br></div><div>=A0</div>

--0015174c3b2c240f1e04ce40a497--


--===============7258340889973871494==
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.xen.org
http://lists.xen.org/xen-devel

--===============7258340889973871494==--


From xen-devel-bounces@lists.xen.org Mon Nov 12 02:17:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 02:17:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXja1-0008Fz-2B; Mon, 12 Nov 2012 02:16:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <gabrielx.wu@intel.com>) id 1TXjZy-0008Fs-OZ
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 02:16:50 +0000
Received: from [85.158.143.99:7656] by server-2.bemta-4.messagelabs.com id
	8A/B3-28922-11C50A05; Mon, 12 Nov 2012 02:16:49 +0000
X-Env-Sender: gabrielx.wu@intel.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1352686608!29494540!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0MzYxMA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22150 invoked from network); 12 Nov 2012 02:16:49 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-15.tower-216.messagelabs.com with SMTP;
	12 Nov 2012 02:16:49 -0000
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
	by fmsmga101.fm.intel.com with ESMTP; 11 Nov 2012 18:16:48 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,759,1344236400"; d="scan'208";a="247384423"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by fmsmga002.fm.intel.com with ESMTP; 11 Nov 2012 18:16:47 -0800
Received: from fmsmsx102.amr.corp.intel.com (10.19.9.53) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Sun, 11 Nov 2012 18:16:47 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX102.amr.corp.intel.com (10.19.9.53) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Sun, 11 Nov 2012 18:16:47 -0800
Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.123]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Mon, 12 Nov 2012 10:16:45 +0800
From: "Wu, GabrielX" <gabrielx.wu@intel.com>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Thread-Topic: VMX status report. Xen:26127 & Dom0:3.6.5
Thread-Index: AQHNwHvCL6IjRYRsCUaX4S4w8C4zoA==
Date: Mon, 12 Nov 2012 02:16:44 +0000
Message-ID: <E4558C0C96688748837EB1B05BEED75A0FD83B81@SHSMSX102.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Ren, Yongjie" <yongjie.ren@intel.com>, "Liu,
	RongrongX" <rongrongx.liu@intel.com>, "Liu,
	SongtaoX" <songtaox.liu@intel.com>, "Zhou, Chao" <chao.zhou@intel.com>
Subject: [Xen-devel] VMX status report. Xen:26127 & Dom0:3.6.5
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi all,

This is the test report of xen-unstable tree, no new issue found and no issue fixed.

Version Info:
=================================================================
xen-changeset:   26127:bd78e5630a5b
Dom0:          linux.git  3.6.5
=================================================================

New issue(0)
==============

Fixed issue(0)
==============

Old issues(9)
==============
1. [ACPI] Dom0 can't resume from S3 sleep
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1707
2. [XL]"xl vcpu-set" causes dom0 crash or panic
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1730
3. [VT-D]fail to detach NIC from guest  
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1736
4. Sometimes Xen panic on ia32pae Sandybridge when restore guest
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1747
5. after detaching a VF from a guest, shutdown the guest is very slow
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1812
6. Poor performance when do guest save/restore and migration with linux 3.x dom0
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1784
7. 'xl vcpu-set' can't decrease the vCPU number of a HVM guest
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1822
8. Dom0 cannot be shutdown before PCI device detachment from guest
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1826
9. xl pci-list shows one PCI device (PF or VF) could be assigned to two different guests
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1834

Best Regards,
Ronghui Wu(Gabriel)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 02:17:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 02:17:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXja1-0008Fz-2B; Mon, 12 Nov 2012 02:16:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <gabrielx.wu@intel.com>) id 1TXjZy-0008Fs-OZ
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 02:16:50 +0000
Received: from [85.158.143.99:7656] by server-2.bemta-4.messagelabs.com id
	8A/B3-28922-11C50A05; Mon, 12 Nov 2012 02:16:49 +0000
X-Env-Sender: gabrielx.wu@intel.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1352686608!29494540!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0MzYxMA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22150 invoked from network); 12 Nov 2012 02:16:49 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-15.tower-216.messagelabs.com with SMTP;
	12 Nov 2012 02:16:49 -0000
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
	by fmsmga101.fm.intel.com with ESMTP; 11 Nov 2012 18:16:48 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,759,1344236400"; d="scan'208";a="247384423"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by fmsmga002.fm.intel.com with ESMTP; 11 Nov 2012 18:16:47 -0800
Received: from fmsmsx102.amr.corp.intel.com (10.19.9.53) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Sun, 11 Nov 2012 18:16:47 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX102.amr.corp.intel.com (10.19.9.53) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Sun, 11 Nov 2012 18:16:47 -0800
Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.123]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Mon, 12 Nov 2012 10:16:45 +0800
From: "Wu, GabrielX" <gabrielx.wu@intel.com>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Thread-Topic: VMX status report. Xen:26127 & Dom0:3.6.5
Thread-Index: AQHNwHvCL6IjRYRsCUaX4S4w8C4zoA==
Date: Mon, 12 Nov 2012 02:16:44 +0000
Message-ID: <E4558C0C96688748837EB1B05BEED75A0FD83B81@SHSMSX102.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Ren, Yongjie" <yongjie.ren@intel.com>, "Liu,
	RongrongX" <rongrongx.liu@intel.com>, "Liu,
	SongtaoX" <songtaox.liu@intel.com>, "Zhou, Chao" <chao.zhou@intel.com>
Subject: [Xen-devel] VMX status report. Xen:26127 & Dom0:3.6.5
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi all,

This is the test report of xen-unstable tree, no new issue found and no issue fixed.

Version Info:
=================================================================
xen-changeset:   26127:bd78e5630a5b
Dom0:          linux.git  3.6.5
=================================================================

New issue(0)
==============

Fixed issue(0)
==============

Old issues(9)
==============
1. [ACPI] Dom0 can't resume from S3 sleep
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1707
2. [XL]"xl vcpu-set" causes dom0 crash or panic
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1730
3. [VT-D]fail to detach NIC from guest  
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1736
4. Sometimes Xen panic on ia32pae Sandybridge when restore guest
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1747
5. after detaching a VF from a guest, shutdown the guest is very slow
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1812
6. Poor performance when do guest save/restore and migration with linux 3.x dom0
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1784
7. 'xl vcpu-set' can't decrease the vCPU number of a HVM guest
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1822
8. Dom0 cannot be shutdown before PCI device detachment from guest
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1826
9. xl pci-list shows one PCI device (PF or VF) could be assigned to two different guests
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1834

Best Regards,
Ronghui Wu(Gabriel)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 03:18:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 03:18:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXkX6-0000bQ-Tu; Mon, 12 Nov 2012 03:17:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mattjd@gmail.com>) id 1TXkX5-0000bL-Ig
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 03:17:55 +0000
Received: from [85.158.139.83:50559] by server-6.bemta-5.messagelabs.com id
	9A/EA-19321-26A60A05; Mon, 12 Nov 2012 03:17:54 +0000
X-Env-Sender: mattjd@gmail.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352690272!22568231!1
X-Originating-IP: [209.85.160.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12367 invoked from network); 12 Nov 2012 03:17:53 -0000
Received: from mail-pb0-f45.google.com (HELO mail-pb0-f45.google.com)
	(209.85.160.45)
	by server-11.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 03:17:53 -0000
Received: by mail-pb0-f45.google.com with SMTP id mc8so1387540pbc.32
	for <xen-devel@lists.xen.org>; Sun, 11 Nov 2012 19:17:52 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer;
	bh=4+ALUEsJLIY5eaoi2KMnIB6/wDBBMiTPimqBcrHu1zU=;
	b=HPMNQ0wgp7FBQDltvmSL2BopaosYG+iViaYKbA2gpJBEuZ4RWh876nWjTi4vtfYxr9
	EW9zVR5Gy+osyx+A2zy7rUS0nkD4PZmV+v6LbJ88JHj+2kytMB6vTZsfVyc5uj9PPlVS
	aU9l9qxSi7VrcM/JNKkjfUSTQhtMfnHUn4pPF/a0m88YwkF3qajnc4BjrcBiaQTVO4mf
	v1wXtxia81gjlkIdo5tEhOobILVOc8CZ0CLe30KoZeY6qhlDXbFRpC+XcufPwApXx7bu
	iFDH8c8SimoQuGdEzXTDE7/o2cZAcrmJ615Xzs95zKynscGCaukMamwYNQVjvi05LlHE
	oHCw==
Received: by 10.66.78.104 with SMTP id a8mr51430177pax.38.1352690271963;
	Sun, 11 Nov 2012 19:17:51 -0800 (PST)
Received: from morphism.xen.prgmr.com (morphism.xen.prgmr.com. [71.19.145.114])
	by mx.google.com with ESMTPS id a10sm3506757paz.35.2012.11.11.19.17.50
	(version=TLSv1/SSLv3 cipher=OTHER);
	Sun, 11 Nov 2012 19:17:51 -0800 (PST)
From: Matthew Daley <mattjd@gmail.com>
To: xen-devel@lists.xen.org
Date: Mon, 12 Nov 2012 16:17:22 +1300
Message-Id: <1352690242-28761-1-git-send-email-mattjd@gmail.com>
X-Mailer: git-send-email 1.7.10.4
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Matthew Daley <mattjd@gmail.com>
Subject: [Xen-devel] [PATCH] tmem: Prevent NULL dereference on error case
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

If the client / pool IDs given to tmemc_save_get_next_page are invalid,
the calculation of pagesize will dereference NULL.

Fix this by moving the calculation below the appropriate NULL check.

Signed-off-by: Matthew Daley <mattjd@gmail.com>

diff --git a/xen/common/tmem.c b/xen/common/tmem.c
index 1280537..ec59009 100644
--- a/xen/common/tmem.c
+++ b/xen/common/tmem.c
@@ -2436,10 +2436,13 @@ static NOINLINE int tmemc_save_get_next_page(int cli_id, uint32_t pool_id,
     OID oid;
     int ret = 0;
     struct tmem_handle h;
-    unsigned int pagesize = 1 << (pool->pageshift+12);
+    unsigned int pagesize;
 
     if ( pool == NULL || is_ephemeral(pool) )
         return -1;
+
+    pagesize = 1 << (pool->pageshift + 12);
+
     if ( bufsize < pagesize + sizeof(struct tmem_handle) )
         return -ENOMEM;
 
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 03:18:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 03:18:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXkX6-0000bQ-Tu; Mon, 12 Nov 2012 03:17:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mattjd@gmail.com>) id 1TXkX5-0000bL-Ig
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 03:17:55 +0000
Received: from [85.158.139.83:50559] by server-6.bemta-5.messagelabs.com id
	9A/EA-19321-26A60A05; Mon, 12 Nov 2012 03:17:54 +0000
X-Env-Sender: mattjd@gmail.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352690272!22568231!1
X-Originating-IP: [209.85.160.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12367 invoked from network); 12 Nov 2012 03:17:53 -0000
Received: from mail-pb0-f45.google.com (HELO mail-pb0-f45.google.com)
	(209.85.160.45)
	by server-11.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 03:17:53 -0000
Received: by mail-pb0-f45.google.com with SMTP id mc8so1387540pbc.32
	for <xen-devel@lists.xen.org>; Sun, 11 Nov 2012 19:17:52 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer;
	bh=4+ALUEsJLIY5eaoi2KMnIB6/wDBBMiTPimqBcrHu1zU=;
	b=HPMNQ0wgp7FBQDltvmSL2BopaosYG+iViaYKbA2gpJBEuZ4RWh876nWjTi4vtfYxr9
	EW9zVR5Gy+osyx+A2zy7rUS0nkD4PZmV+v6LbJ88JHj+2kytMB6vTZsfVyc5uj9PPlVS
	aU9l9qxSi7VrcM/JNKkjfUSTQhtMfnHUn4pPF/a0m88YwkF3qajnc4BjrcBiaQTVO4mf
	v1wXtxia81gjlkIdo5tEhOobILVOc8CZ0CLe30KoZeY6qhlDXbFRpC+XcufPwApXx7bu
	iFDH8c8SimoQuGdEzXTDE7/o2cZAcrmJ615Xzs95zKynscGCaukMamwYNQVjvi05LlHE
	oHCw==
Received: by 10.66.78.104 with SMTP id a8mr51430177pax.38.1352690271963;
	Sun, 11 Nov 2012 19:17:51 -0800 (PST)
Received: from morphism.xen.prgmr.com (morphism.xen.prgmr.com. [71.19.145.114])
	by mx.google.com with ESMTPS id a10sm3506757paz.35.2012.11.11.19.17.50
	(version=TLSv1/SSLv3 cipher=OTHER);
	Sun, 11 Nov 2012 19:17:51 -0800 (PST)
From: Matthew Daley <mattjd@gmail.com>
To: xen-devel@lists.xen.org
Date: Mon, 12 Nov 2012 16:17:22 +1300
Message-Id: <1352690242-28761-1-git-send-email-mattjd@gmail.com>
X-Mailer: git-send-email 1.7.10.4
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Matthew Daley <mattjd@gmail.com>
Subject: [Xen-devel] [PATCH] tmem: Prevent NULL dereference on error case
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

If the client / pool IDs given to tmemc_save_get_next_page are invalid,
the calculation of pagesize will dereference NULL.

Fix this by moving the calculation below the appropriate NULL check.

Signed-off-by: Matthew Daley <mattjd@gmail.com>

diff --git a/xen/common/tmem.c b/xen/common/tmem.c
index 1280537..ec59009 100644
--- a/xen/common/tmem.c
+++ b/xen/common/tmem.c
@@ -2436,10 +2436,13 @@ static NOINLINE int tmemc_save_get_next_page(int cli_id, uint32_t pool_id,
     OID oid;
     int ret = 0;
     struct tmem_handle h;
-    unsigned int pagesize = 1 << (pool->pageshift+12);
+    unsigned int pagesize;
 
     if ( pool == NULL || is_ephemeral(pool) )
         return -1;
+
+    pagesize = 1 << (pool->pageshift + 12);
+
     if ( bufsize < pagesize + sizeof(struct tmem_handle) )
         return -ENOMEM;
 
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 06:01:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 06:01:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXn4s-0001Vw-T9; Mon, 12 Nov 2012 06:00:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TXn4r-0001Vr-Pw
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 06:00:58 +0000
Received: from [85.158.138.51:17156] by server-13.bemta-3.messagelabs.com id
	75/D9-24887-49090A05; Mon, 12 Nov 2012 06:00:52 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1352700051!29534611!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3203 invoked from network); 12 Nov 2012 06:00:51 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 06:00:51 -0000
X-IronPort-AV: E=Sophos;i="4.80,759,1344211200"; d="scan'208";a="15738255"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 06:00:42 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 12 Nov 2012 06:00:41 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TXn4b-0002Ll-Pq;
	Mon, 12 Nov 2012 06:00:41 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TXn4b-0002s2-L7;
	Mon, 12 Nov 2012 06:00:41 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14379-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 12 Nov 2012 06:00:41 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14379: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14379 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14379/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-win7-amd64  7 windows-install     fail pass in 14378
 test-amd64-amd64-win          7 windows-install             fail pass in 14378

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14378
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14378
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14378
 test-amd64-amd64-xl-qemuu-win7-amd64 9 guest-localmigrate fail in 14378 like 14377

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check      fail in 14378 never pass

version targeted for testing:
 xen                  62885b3c34c8
baseline version:
 xen                  62885b3c34c8

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 06:01:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 06:01:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXn4s-0001Vw-T9; Mon, 12 Nov 2012 06:00:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TXn4r-0001Vr-Pw
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 06:00:58 +0000
Received: from [85.158.138.51:17156] by server-13.bemta-3.messagelabs.com id
	75/D9-24887-49090A05; Mon, 12 Nov 2012 06:00:52 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1352700051!29534611!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwNzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3203 invoked from network); 12 Nov 2012 06:00:51 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 06:00:51 -0000
X-IronPort-AV: E=Sophos;i="4.80,759,1344211200"; d="scan'208";a="15738255"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 06:00:42 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 12 Nov 2012 06:00:41 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TXn4b-0002Ll-Pq;
	Mon, 12 Nov 2012 06:00:41 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TXn4b-0002s2-L7;
	Mon, 12 Nov 2012 06:00:41 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14379-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 12 Nov 2012 06:00:41 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14379: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14379 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14379/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-win7-amd64  7 windows-install     fail pass in 14378
 test-amd64-amd64-win          7 windows-install             fail pass in 14378

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14378
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14378
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14378
 test-amd64-amd64-xl-qemuu-win7-amd64 9 guest-localmigrate fail in 14378 like 14377

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check      fail in 14378 never pass

version targeted for testing:
 xen                  62885b3c34c8
baseline version:
 xen                  62885b3c34c8

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 06:33:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 06:33:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXnZj-0001k2-JC; Mon, 12 Nov 2012 06:32:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mattjd@gmail.com>) id 1TXnZi-0001jx-4K
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 06:32:50 +0000
Received: from [85.158.143.35:27184] by server-2.bemta-4.messagelabs.com id
	32/B9-28922-11890A05; Mon, 12 Nov 2012 06:32:49 +0000
X-Env-Sender: mattjd@gmail.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352701966!13191883!1
X-Originating-IP: [209.85.160.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24637 invoked from network); 12 Nov 2012 06:32:48 -0000
Received: from mail-pb0-f45.google.com (HELO mail-pb0-f45.google.com)
	(209.85.160.45)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 06:32:48 -0000
Received: by mail-pb0-f45.google.com with SMTP id mc8so1486009pbc.32
	for <xen-devel@lists.xen.org>; Sun, 11 Nov 2012 22:32:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer;
	bh=0FyOSjeunepFRLBcDieHJ+9jukuk55iJXKcGH0eYji8=;
	b=gsrqAWuM+FOYX9VzpGeU/9g4R5ruDTM01n5VuxzfM9bgXfc+NNEqquS9kMcAyLcEyV
	WwdGOxgpYvC8GScFDQYryo/xldA3Cwits2/sPa2MVjBz9BhAhWf4oJRDw1qdTXr9dqtm
	nDh8Zx6SDRbQkhdBKcY0RClsTn3pB7iyIO7XzLZ9aYjeSen2yJFDrtev0uKZXwdMlhC8
	B/oCNnZfIbzJ/Ex4dURa1OpoXmR0xq5BFYYHsCcPJSVcn6EKKHgj5uxE9lQOREe1Cm9+
	IPhjL0KXmGCtTDRnEnLdSIEDK9fI2XmReltQJNCWAxNGtIigT1i63IaWfcJSIiWlx/53
	PIHg==
Received: by 10.66.84.131 with SMTP id z3mr52360099pay.34.1352701966435;
	Sun, 11 Nov 2012 22:32:46 -0800 (PST)
Received: from morphism.xen.prgmr.com (morphism.xen.prgmr.com. [71.19.145.114])
	by mx.google.com with ESMTPS id us7sm3688803pbc.40.2012.11.11.22.32.44
	(version=TLSv1/SSLv3 cipher=OTHER);
	Sun, 11 Nov 2012 22:32:45 -0800 (PST)
From: Matthew Daley <mattjd@gmail.com>
To: xen-devel@lists.xen.org
Date: Mon, 12 Nov 2012 19:33:05 +1300
Message-Id: <1352701985-3696-1-git-send-email-mattjd@gmail.com>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Daley <mattjd@gmail.com>
Subject: [Xen-devel] [PATCH] pygrub: Fix command line argument error handling
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

pygrub's individual config file parsers do not correctly check the
amount of command line arguments given to them. In addition, the LILO
config parser would report an incorrect message.

Use len() to correctly check the amount of arguments, and fix the LILO
error message.

Signed-off-by: Matthew Daley <mattjd@gmail.com>

diff --git a/tools/pygrub/src/ExtLinuxConf.py b/tools/pygrub/src/ExtLinuxConf.py
index 19776a3..510099b 100644
--- a/tools/pygrub/src/ExtLinuxConf.py
+++ b/tools/pygrub/src/ExtLinuxConf.py
@@ -207,7 +207,7 @@ class ExtLinuxConfigFile(object):
                  }
         
 if __name__ == "__main__":
-    if sys.argv < 2:
+    if len(sys.argv) < 2:
         raise RuntimeError, "Need a configuration file to read"
     g = ExtLinuxConfigFile(sys.argv[1])
     for i in g.images:
diff --git a/tools/pygrub/src/GrubConf.py b/tools/pygrub/src/GrubConf.py
index c4f543d..629951f 100644
--- a/tools/pygrub/src/GrubConf.py
+++ b/tools/pygrub/src/GrubConf.py
@@ -454,7 +454,7 @@ class Grub2ConfigFile(_GrubConfigFile):
                 }
         
 if __name__ == "__main__":
-    if sys.argv < 3:
+    if len(sys.argv) < 3:
         raise RuntimeError, "Need a grub version (\"grub\" or \"grub2\") and a grub.conf or grub.cfg to read"
     if sys.argv[1] == "grub":
         g = GrubConfigFile(sys.argv[2])
diff --git a/tools/pygrub/src/LiloConf.py b/tools/pygrub/src/LiloConf.py
index 9858ae2..2cb649f 100644
--- a/tools/pygrub/src/LiloConf.py
+++ b/tools/pygrub/src/LiloConf.py
@@ -169,8 +169,8 @@ class LiloConfigFile(object):
                  }
 
 if __name__ == "__main__":
-    if sys.argv < 2:
-        raise RuntimeError, "Need a grub.conf to read"
+    if len(sys.argv) < 2:
+        raise RuntimeError, "Need a lilo.conf to read"
     g = LiloConfigFile(sys.argv[1])
     for i in g.images:
         print i #, i.title, i.root, i.kernel, i.args, i.initrd
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 06:33:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 06:33:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXnZj-0001k2-JC; Mon, 12 Nov 2012 06:32:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mattjd@gmail.com>) id 1TXnZi-0001jx-4K
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 06:32:50 +0000
Received: from [85.158.143.35:27184] by server-2.bemta-4.messagelabs.com id
	32/B9-28922-11890A05; Mon, 12 Nov 2012 06:32:49 +0000
X-Env-Sender: mattjd@gmail.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352701966!13191883!1
X-Originating-IP: [209.85.160.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24637 invoked from network); 12 Nov 2012 06:32:48 -0000
Received: from mail-pb0-f45.google.com (HELO mail-pb0-f45.google.com)
	(209.85.160.45)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 06:32:48 -0000
Received: by mail-pb0-f45.google.com with SMTP id mc8so1486009pbc.32
	for <xen-devel@lists.xen.org>; Sun, 11 Nov 2012 22:32:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer;
	bh=0FyOSjeunepFRLBcDieHJ+9jukuk55iJXKcGH0eYji8=;
	b=gsrqAWuM+FOYX9VzpGeU/9g4R5ruDTM01n5VuxzfM9bgXfc+NNEqquS9kMcAyLcEyV
	WwdGOxgpYvC8GScFDQYryo/xldA3Cwits2/sPa2MVjBz9BhAhWf4oJRDw1qdTXr9dqtm
	nDh8Zx6SDRbQkhdBKcY0RClsTn3pB7iyIO7XzLZ9aYjeSen2yJFDrtev0uKZXwdMlhC8
	B/oCNnZfIbzJ/Ex4dURa1OpoXmR0xq5BFYYHsCcPJSVcn6EKKHgj5uxE9lQOREe1Cm9+
	IPhjL0KXmGCtTDRnEnLdSIEDK9fI2XmReltQJNCWAxNGtIigT1i63IaWfcJSIiWlx/53
	PIHg==
Received: by 10.66.84.131 with SMTP id z3mr52360099pay.34.1352701966435;
	Sun, 11 Nov 2012 22:32:46 -0800 (PST)
Received: from morphism.xen.prgmr.com (morphism.xen.prgmr.com. [71.19.145.114])
	by mx.google.com with ESMTPS id us7sm3688803pbc.40.2012.11.11.22.32.44
	(version=TLSv1/SSLv3 cipher=OTHER);
	Sun, 11 Nov 2012 22:32:45 -0800 (PST)
From: Matthew Daley <mattjd@gmail.com>
To: xen-devel@lists.xen.org
Date: Mon, 12 Nov 2012 19:33:05 +1300
Message-Id: <1352701985-3696-1-git-send-email-mattjd@gmail.com>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Daley <mattjd@gmail.com>
Subject: [Xen-devel] [PATCH] pygrub: Fix command line argument error handling
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

pygrub's individual config file parsers do not correctly check the
amount of command line arguments given to them. In addition, the LILO
config parser would report an incorrect message.

Use len() to correctly check the amount of arguments, and fix the LILO
error message.

Signed-off-by: Matthew Daley <mattjd@gmail.com>

diff --git a/tools/pygrub/src/ExtLinuxConf.py b/tools/pygrub/src/ExtLinuxConf.py
index 19776a3..510099b 100644
--- a/tools/pygrub/src/ExtLinuxConf.py
+++ b/tools/pygrub/src/ExtLinuxConf.py
@@ -207,7 +207,7 @@ class ExtLinuxConfigFile(object):
                  }
         
 if __name__ == "__main__":
-    if sys.argv < 2:
+    if len(sys.argv) < 2:
         raise RuntimeError, "Need a configuration file to read"
     g = ExtLinuxConfigFile(sys.argv[1])
     for i in g.images:
diff --git a/tools/pygrub/src/GrubConf.py b/tools/pygrub/src/GrubConf.py
index c4f543d..629951f 100644
--- a/tools/pygrub/src/GrubConf.py
+++ b/tools/pygrub/src/GrubConf.py
@@ -454,7 +454,7 @@ class Grub2ConfigFile(_GrubConfigFile):
                 }
         
 if __name__ == "__main__":
-    if sys.argv < 3:
+    if len(sys.argv) < 3:
         raise RuntimeError, "Need a grub version (\"grub\" or \"grub2\") and a grub.conf or grub.cfg to read"
     if sys.argv[1] == "grub":
         g = GrubConfigFile(sys.argv[2])
diff --git a/tools/pygrub/src/LiloConf.py b/tools/pygrub/src/LiloConf.py
index 9858ae2..2cb649f 100644
--- a/tools/pygrub/src/LiloConf.py
+++ b/tools/pygrub/src/LiloConf.py
@@ -169,8 +169,8 @@ class LiloConfigFile(object):
                  }
 
 if __name__ == "__main__":
-    if sys.argv < 2:
-        raise RuntimeError, "Need a grub.conf to read"
+    if len(sys.argv) < 2:
+        raise RuntimeError, "Need a lilo.conf to read"
     g = LiloConfigFile(sys.argv[1])
     for i in g.images:
         print i #, i.title, i.root, i.kernel, i.args, i.initrd
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 08:36:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 08:36:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXpUm-0003Eg-K4; Mon, 12 Nov 2012 08:35:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kgrace.liu@gmail.com>) id 1TXpUk-0003Eb-RQ
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 08:35:51 +0000
Received: from [85.158.143.35:18414] by server-2.bemta-4.messagelabs.com id
	23/A6-28922-6E4B0A05; Mon, 12 Nov 2012 08:35:50 +0000
X-Env-Sender: kgrace.liu@gmail.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1352709347!14508349!1
X-Originating-IP: [209.85.219.43]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_10_20,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20337 invoked from network); 12 Nov 2012 08:35:48 -0000
Received: from mail-oa0-f43.google.com (HELO mail-oa0-f43.google.com)
	(209.85.219.43)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 08:35:48 -0000
Received: by mail-oa0-f43.google.com with SMTP id k1so7678203oag.30
	for <multiple recipients>; Mon, 12 Nov 2012 00:35:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:content-type;
	bh=/QSgRehMviWLXaHq7AgEWYaE42eCsKlSljMEVUhJouI=;
	b=cp7c3mF2ijTQgkUjEdPyWf+LxHl1USBNgQJooANdJXt5mA3bb/AzP4MCTP+WK+XNNL
	prJMMztOocg2iwvXUncqbwpk+Qgi+Wb47srmbh1/wdfhr4Re5mgnXcMCryr3qjIgzuUA
	uYiBBj2/hvySuz5XiZoNIj54o6n0aJ55TND7d53Hn/iGxcoGXftORuhZyqxv77PDSIZa
	i5E0NfEXi1hUYtRrWRTxLxp1MxCcn6kZXnopLbTLTjFKkYQevbztpnIvnCYTYh9rRrZ3
	SFB4VSADy7nDFvpx9yYIpbXiUgPjG8OuRXSfef5EyefUcqnH4syuvnEZb1vSJ1P26Pfl
	KAsA==
MIME-Version: 1.0
Received: by 10.182.116.6 with SMTP id js6mr14452643obb.82.1352709346965; Mon,
	12 Nov 2012 00:35:46 -0800 (PST)
Received: by 10.60.21.163 with HTTP; Mon, 12 Nov 2012 00:35:46 -0800 (PST)
Date: Mon, 12 Nov 2012 16:35:46 +0800
X-Google-Sender-Auth: YyOrmLlXQ0PPugSO5wnhcI1YvJc
Message-ID: <CAERYnoYbLddzpE6729Nkx2YzMPcr09Do0f1rkob4U1h34NjQgQ@mail.gmail.com>
From: Chunyan Liu <cyliu@suse.com>
To: xen-devel@lists.xensource.com, xen-user@lists.xensource.com
Subject: [Xen-devel] question about xenstore-chmod MAX_PERMS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4214041216682342209=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4214041216682342209==
Content-Type: multipart/alternative; boundary=14dae9399d2b1c36f304ce483077

--14dae9399d2b1c36f304ce483077
Content-Type: text/plain; charset=UTF-8

Dear List,

I'm trying to issue:
"xenstore-chmod PATH r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15
r16 r17 r18"
it failed at error report "Too many permissions specified.  Maximum per
invocation is 16."

I changed MAX_PERMS to 18 for testing, it turns to be OK to run above
command.
I don't know why there is "MAX_PERMS=16" limitation and couldn't find
useful info about that. Does anyone know that?

Thanks!
Chunyan

--14dae9399d2b1c36f304ce483077
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Dear List,<br><br>I&#39;m trying to issue:<br>&quot;xenstore-chmod PATH r0 =
r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18&quot;<br>it =
failed at error report &quot;Too many permissions specified.=C2=A0 Maximum =
per invocation is 16.&quot;<br>
<br>I changed MAX_PERMS to 18 for testing, it turns to be OK to run above c=
ommand.<br>I don&#39;t know why there is &quot;MAX_PERMS=3D16&quot; limitat=
ion and couldn&#39;t find useful info about that. Does anyone know that?<br=
>
<br>Thanks!<br>Chunyan<br>

--14dae9399d2b1c36f304ce483077--


--===============4214041216682342209==
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.xen.org
http://lists.xen.org/xen-devel

--===============4214041216682342209==--


From xen-devel-bounces@lists.xen.org Mon Nov 12 08:36:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 08:36:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXpUm-0003Eg-K4; Mon, 12 Nov 2012 08:35:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kgrace.liu@gmail.com>) id 1TXpUk-0003Eb-RQ
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 08:35:51 +0000
Received: from [85.158.143.35:18414] by server-2.bemta-4.messagelabs.com id
	23/A6-28922-6E4B0A05; Mon, 12 Nov 2012 08:35:50 +0000
X-Env-Sender: kgrace.liu@gmail.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1352709347!14508349!1
X-Originating-IP: [209.85.219.43]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_10_20,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20337 invoked from network); 12 Nov 2012 08:35:48 -0000
Received: from mail-oa0-f43.google.com (HELO mail-oa0-f43.google.com)
	(209.85.219.43)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 08:35:48 -0000
Received: by mail-oa0-f43.google.com with SMTP id k1so7678203oag.30
	for <multiple recipients>; Mon, 12 Nov 2012 00:35:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:content-type;
	bh=/QSgRehMviWLXaHq7AgEWYaE42eCsKlSljMEVUhJouI=;
	b=cp7c3mF2ijTQgkUjEdPyWf+LxHl1USBNgQJooANdJXt5mA3bb/AzP4MCTP+WK+XNNL
	prJMMztOocg2iwvXUncqbwpk+Qgi+Wb47srmbh1/wdfhr4Re5mgnXcMCryr3qjIgzuUA
	uYiBBj2/hvySuz5XiZoNIj54o6n0aJ55TND7d53Hn/iGxcoGXftORuhZyqxv77PDSIZa
	i5E0NfEXi1hUYtRrWRTxLxp1MxCcn6kZXnopLbTLTjFKkYQevbztpnIvnCYTYh9rRrZ3
	SFB4VSADy7nDFvpx9yYIpbXiUgPjG8OuRXSfef5EyefUcqnH4syuvnEZb1vSJ1P26Pfl
	KAsA==
MIME-Version: 1.0
Received: by 10.182.116.6 with SMTP id js6mr14452643obb.82.1352709346965; Mon,
	12 Nov 2012 00:35:46 -0800 (PST)
Received: by 10.60.21.163 with HTTP; Mon, 12 Nov 2012 00:35:46 -0800 (PST)
Date: Mon, 12 Nov 2012 16:35:46 +0800
X-Google-Sender-Auth: YyOrmLlXQ0PPugSO5wnhcI1YvJc
Message-ID: <CAERYnoYbLddzpE6729Nkx2YzMPcr09Do0f1rkob4U1h34NjQgQ@mail.gmail.com>
From: Chunyan Liu <cyliu@suse.com>
To: xen-devel@lists.xensource.com, xen-user@lists.xensource.com
Subject: [Xen-devel] question about xenstore-chmod MAX_PERMS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4214041216682342209=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4214041216682342209==
Content-Type: multipart/alternative; boundary=14dae9399d2b1c36f304ce483077

--14dae9399d2b1c36f304ce483077
Content-Type: text/plain; charset=UTF-8

Dear List,

I'm trying to issue:
"xenstore-chmod PATH r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15
r16 r17 r18"
it failed at error report "Too many permissions specified.  Maximum per
invocation is 16."

I changed MAX_PERMS to 18 for testing, it turns to be OK to run above
command.
I don't know why there is "MAX_PERMS=16" limitation and couldn't find
useful info about that. Does anyone know that?

Thanks!
Chunyan

--14dae9399d2b1c36f304ce483077
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Dear List,<br><br>I&#39;m trying to issue:<br>&quot;xenstore-chmod PATH r0 =
r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18&quot;<br>it =
failed at error report &quot;Too many permissions specified.=C2=A0 Maximum =
per invocation is 16.&quot;<br>
<br>I changed MAX_PERMS to 18 for testing, it turns to be OK to run above c=
ommand.<br>I don&#39;t know why there is &quot;MAX_PERMS=3D16&quot; limitat=
ion and couldn&#39;t find useful info about that. Does anyone know that?<br=
>
<br>Thanks!<br>Chunyan<br>

--14dae9399d2b1c36f304ce483077--


--===============4214041216682342209==
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.xen.org
http://lists.xen.org/xen-devel

--===============4214041216682342209==--


From xen-devel-bounces@lists.xen.org Mon Nov 12 09:32:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 09:32:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXqMP-00046b-8t; Mon, 12 Nov 2012 09:31:17 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TXqMO-00046W-0N
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 09:31:16 +0000
Received: from [193.109.254.147:13335] by server-4.bemta-14.messagelabs.com id
	82/0D-18856-3E1C0A05; Mon, 12 Nov 2012 09:31:15 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352712657!3744223!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29608 invoked from network); 12 Nov 2012 09:30:59 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 09:30:59 -0000
X-IronPort-AV: E=Sophos;i="4.80,761,1344211200"; d="scan'208";a="15742376"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 09:30:57 +0000
Received: from [192.168.1.30] (10.31.3.234) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 09:30:56 +0000
Message-ID: <50A0C1D0.1060407@citrix.com>
Date: Mon, 12 Nov 2012 10:30:56 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Manuel Bouyer <bouyer@antioche.eu.org>
References: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
	<20121110104536.GA1027@antioche.eu.org>
In-Reply-To: <20121110104536.GA1027@antioche.eu.org>
Cc: "port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: add persistent grants to xbd_xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 10/11/12 11:45, Manuel Bouyer wrote:
> On Sun, Nov 04, 2012 at 11:23:50PM +0100, Roger Pau Monne wrote:
>> This patch implements persistent grants for xbd_xenbus (blkfront in
>> Linux terminology). The effect of this change is to reduce the number
>> of unmap operations performed, since they cause a (costly) TLB
>> shootdown. This allows the I/O performance to scale better when a
>> large number of VMs are performing I/O.
>>
>> On startup xbd_xenbus notifies the backend driver that it is using
>> persistent grants. If the backend driver is not capable of persistent
>> mapping, xbd_xenbus will still use the same grants, since it is
>> compatible with the previous protocol, and simplifies the code
>> complexity in xbd_xenbus.
>>
>> Each time a request is send to the backend driver, xbd_xenbus will
>> check if there are free grants already mapped and will try to use one
>> of those. If there are not enough grants already mapped, xbd_xenbus
>> will request new grants, and they will be added to the list of free
>> grants when the transaction is finished, so they can be reused. Data
>> has to be copied from the request (struct buf) to the mapped grant, or
>> from the mapped grant to the request, depending on the operation being
>> performed.
>>
>> To test the performance impact of this patch I've benchmarked the
>> number of IOPS performed simultaneously by 15 NetBSD DomU guests on a
>> Linux Dom0 that supports persistent grants. The backend used to
>> perform this tests was a ramdisk of size 1GB.
>>
>>                      Sum of IOPS
>> Non-persistent            336718
>> Persistent                686010
>>
>> As seen, there's a x2 increase in the total number of IOPS being
>> performed. As a reference, using exactly the same setup Linux DomUs
>> are able to achieve 1102019 IOPS, so there's still plenty of room for
>> improvement.
> 
> I'd like to see a similar test run against a NetBSD dom0. Also, how big
> are your IOPs ?

I will try to perform a similar test with a NetBSD Dom0, but with the
patch it will probably be a little bit slower than without it (because
we have to perform the memcpy in the frontend, but anyway NetBSD block
frontend was also performing a memcpy if the memory region was not
aligned to PAGE_SIZE).

I have to check, but I belive NetBSD Dom0 will not benefit from
persistent grants in the backend driver, because it is limited to only
one vcpu, and my guess is that with only one vcpu the TLB flush will be
faster than the memcpy (anyway I need to actually check this).

The test was performed with fio, using the following configuration:

[read]
rw=read
size=900m
bs=4k
filename=/foo/bar

Where /foo/bar is the mountpoint of a disk backed with a ramdisk on the
Dom0, the filesystem is FFSv2 without WAPL and default blocksize. Block
size used on the test is 4k, the test was performed 3 times and averaged.

Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 09:32:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 09:32:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXqMP-00046b-8t; Mon, 12 Nov 2012 09:31:17 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TXqMO-00046W-0N
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 09:31:16 +0000
Received: from [193.109.254.147:13335] by server-4.bemta-14.messagelabs.com id
	82/0D-18856-3E1C0A05; Mon, 12 Nov 2012 09:31:15 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352712657!3744223!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29608 invoked from network); 12 Nov 2012 09:30:59 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 09:30:59 -0000
X-IronPort-AV: E=Sophos;i="4.80,761,1344211200"; d="scan'208";a="15742376"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 09:30:57 +0000
Received: from [192.168.1.30] (10.31.3.234) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 09:30:56 +0000
Message-ID: <50A0C1D0.1060407@citrix.com>
Date: Mon, 12 Nov 2012 10:30:56 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Manuel Bouyer <bouyer@antioche.eu.org>
References: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
	<20121110104536.GA1027@antioche.eu.org>
In-Reply-To: <20121110104536.GA1027@antioche.eu.org>
Cc: "port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: add persistent grants to xbd_xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 10/11/12 11:45, Manuel Bouyer wrote:
> On Sun, Nov 04, 2012 at 11:23:50PM +0100, Roger Pau Monne wrote:
>> This patch implements persistent grants for xbd_xenbus (blkfront in
>> Linux terminology). The effect of this change is to reduce the number
>> of unmap operations performed, since they cause a (costly) TLB
>> shootdown. This allows the I/O performance to scale better when a
>> large number of VMs are performing I/O.
>>
>> On startup xbd_xenbus notifies the backend driver that it is using
>> persistent grants. If the backend driver is not capable of persistent
>> mapping, xbd_xenbus will still use the same grants, since it is
>> compatible with the previous protocol, and simplifies the code
>> complexity in xbd_xenbus.
>>
>> Each time a request is send to the backend driver, xbd_xenbus will
>> check if there are free grants already mapped and will try to use one
>> of those. If there are not enough grants already mapped, xbd_xenbus
>> will request new grants, and they will be added to the list of free
>> grants when the transaction is finished, so they can be reused. Data
>> has to be copied from the request (struct buf) to the mapped grant, or
>> from the mapped grant to the request, depending on the operation being
>> performed.
>>
>> To test the performance impact of this patch I've benchmarked the
>> number of IOPS performed simultaneously by 15 NetBSD DomU guests on a
>> Linux Dom0 that supports persistent grants. The backend used to
>> perform this tests was a ramdisk of size 1GB.
>>
>>                      Sum of IOPS
>> Non-persistent            336718
>> Persistent                686010
>>
>> As seen, there's a x2 increase in the total number of IOPS being
>> performed. As a reference, using exactly the same setup Linux DomUs
>> are able to achieve 1102019 IOPS, so there's still plenty of room for
>> improvement.
> 
> I'd like to see a similar test run against a NetBSD dom0. Also, how big
> are your IOPs ?

I will try to perform a similar test with a NetBSD Dom0, but with the
patch it will probably be a little bit slower than without it (because
we have to perform the memcpy in the frontend, but anyway NetBSD block
frontend was also performing a memcpy if the memory region was not
aligned to PAGE_SIZE).

I have to check, but I belive NetBSD Dom0 will not benefit from
persistent grants in the backend driver, because it is limited to only
one vcpu, and my guess is that with only one vcpu the TLB flush will be
faster than the memcpy (anyway I need to actually check this).

The test was performed with fio, using the following configuration:

[read]
rw=read
size=900m
bs=4k
filename=/foo/bar

Where /foo/bar is the mountpoint of a disk backed with a ramdisk on the
Dom0, the filesystem is FFSv2 without WAPL and default blocksize. Block
size used on the test is 4k, the test was performed 3 times and averaged.

Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 09:53:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 09:53:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXqhO-0004be-2X; Mon, 12 Nov 2012 09:52:58 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXqhM-0004bV-QV
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 09:52:57 +0000
Received: from [193.109.254.147:65346] by server-16.bemta-14.messagelabs.com
	id 54/87-09215-7F6C0A05; Mon, 12 Nov 2012 09:52:55 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1352713811!8759599!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24993 invoked from network); 12 Nov 2012 09:50:12 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 09:50:12 -0000
X-IronPort-AV: E=Sophos;i="4.80,761,1344211200"; d="scan'208";a="15742927"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 09:49:20 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 09:49:19 +0000
Message-ID: <1352713758.27833.134.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matt Wilson <msw@amazon.com>
Date: Mon, 12 Nov 2012 09:49:18 +0000
In-Reply-To: <20121109195553.GA11023@u109add4315675089e695.ant.amazon.com>
References: <509C19DE.6010108@nuclearfallout.net>
	<1352467744.27833.21.camel@zakaz.uk.xensource.com>
	<20121109195553.GA11023@u109add4315675089e695.ant.amazon.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	John Weekes <lists.xen@nuclearfallout.net>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] Bugs in xl that affect stubdom+tapdisk2, and others
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-09 at 19:55 +0000, Matt Wilson wrote:
> On Fri, Nov 09, 2012 at 01:29:04PM +0000, Ian Campbell wrote:
> > On Thu, 2012-11-08 at 20:45 +0000, John Weekes wrote:
> > > As an additional note about 4.2 -- this isn't an "xl" issue, but rather 
> > > a build problem -- even though I use "./configure --libdir=/usr/lib64", 
> > > the build is still creating a "dist/install/usr/lib" directory, and 
> > > because of this, running ./install.sh nukes my system's "/usr/lib" -> 
> > > "/usr/lib64" softlink (which in turn causes all sorts of other problems 
> > > until it's corrected). Files that are being put in that tree:
> > > 
> > > xen-4.2-testing.hg # find dist/install/usr/lib
> > > dist/install/usr/lib
> > 
> > This is an interesting one. I'm not sure how we can avoid this
> > behaviour, perhaps there is a tar option to cause it to follow rather
> > than clobber synlinks?
> > 
> > The only other choice I can think of is to change install.sh to use a
> > (long) explicit list of $(FOO_DIR)/* entries instead of the single * to
> > avoid including system directories, or to otherwise make install.sh more
> > fragile and prone to bitrot :-(
> 
> Oh dear. If we find that there's not a good reason for it anymore, I'd
> think it would be better to remove install.sh instead.

That's one option. If the list could be autogenerated (e.g configure
doing install.sh.in -> install.sh) then that might make it less prone to
problems.

> > I must confess I didn't realise anyone used install.sh -- is there some
> > advantage to it over make foo-install?
> > 
> > OOI which distro has this lib->lib64 link and what issues does removing
> > it create?
> > 
> > > dist/install/usr/lib/xen
> > 
> > This is $(XENFIRMWAREDIR). I have a feeling there is a reason this is
> > not using $(LIBDIR), but I don't recall what it was -- Roget/Matt do you
> > remember?
> 
> There's no need for these files to be multilib compatible, as they are
> not runtime DSOs. They're internal to Xen and I think that they should
> be moved to $LIBEXECDIR instead, like /usr/libexec/xen/. Unfortunately
> there's not much agreement on the usefulness of /usr/libexec, so we'll
> need to make sure that packagers can adjust the paths for their
> systems' standards.

Our configure seem to provide --libexecdir and I think packagers on
platforms which don't use /usr/libexec (e.g. Debian & derivatives) are
probably pretty used to passing that option.

> For 4.2 we didn't want to change where these files were being placed,
> and I believe they've bin in $PREFIX/lib/ for quite some time.

I remember now, yes deferring from 4.2 was the right thing to do but now
that 4.3 is in swing this seems like as good a time as any to be making
a change like this.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 09:53:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 09:53:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXqhO-0004be-2X; Mon, 12 Nov 2012 09:52:58 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXqhM-0004bV-QV
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 09:52:57 +0000
Received: from [193.109.254.147:65346] by server-16.bemta-14.messagelabs.com
	id 54/87-09215-7F6C0A05; Mon, 12 Nov 2012 09:52:55 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1352713811!8759599!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24993 invoked from network); 12 Nov 2012 09:50:12 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 09:50:12 -0000
X-IronPort-AV: E=Sophos;i="4.80,761,1344211200"; d="scan'208";a="15742927"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 09:49:20 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 09:49:19 +0000
Message-ID: <1352713758.27833.134.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matt Wilson <msw@amazon.com>
Date: Mon, 12 Nov 2012 09:49:18 +0000
In-Reply-To: <20121109195553.GA11023@u109add4315675089e695.ant.amazon.com>
References: <509C19DE.6010108@nuclearfallout.net>
	<1352467744.27833.21.camel@zakaz.uk.xensource.com>
	<20121109195553.GA11023@u109add4315675089e695.ant.amazon.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	John Weekes <lists.xen@nuclearfallout.net>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] Bugs in xl that affect stubdom+tapdisk2, and others
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-09 at 19:55 +0000, Matt Wilson wrote:
> On Fri, Nov 09, 2012 at 01:29:04PM +0000, Ian Campbell wrote:
> > On Thu, 2012-11-08 at 20:45 +0000, John Weekes wrote:
> > > As an additional note about 4.2 -- this isn't an "xl" issue, but rather 
> > > a build problem -- even though I use "./configure --libdir=/usr/lib64", 
> > > the build is still creating a "dist/install/usr/lib" directory, and 
> > > because of this, running ./install.sh nukes my system's "/usr/lib" -> 
> > > "/usr/lib64" softlink (which in turn causes all sorts of other problems 
> > > until it's corrected). Files that are being put in that tree:
> > > 
> > > xen-4.2-testing.hg # find dist/install/usr/lib
> > > dist/install/usr/lib
> > 
> > This is an interesting one. I'm not sure how we can avoid this
> > behaviour, perhaps there is a tar option to cause it to follow rather
> > than clobber synlinks?
> > 
> > The only other choice I can think of is to change install.sh to use a
> > (long) explicit list of $(FOO_DIR)/* entries instead of the single * to
> > avoid including system directories, or to otherwise make install.sh more
> > fragile and prone to bitrot :-(
> 
> Oh dear. If we find that there's not a good reason for it anymore, I'd
> think it would be better to remove install.sh instead.

That's one option. If the list could be autogenerated (e.g configure
doing install.sh.in -> install.sh) then that might make it less prone to
problems.

> > I must confess I didn't realise anyone used install.sh -- is there some
> > advantage to it over make foo-install?
> > 
> > OOI which distro has this lib->lib64 link and what issues does removing
> > it create?
> > 
> > > dist/install/usr/lib/xen
> > 
> > This is $(XENFIRMWAREDIR). I have a feeling there is a reason this is
> > not using $(LIBDIR), but I don't recall what it was -- Roget/Matt do you
> > remember?
> 
> There's no need for these files to be multilib compatible, as they are
> not runtime DSOs. They're internal to Xen and I think that they should
> be moved to $LIBEXECDIR instead, like /usr/libexec/xen/. Unfortunately
> there's not much agreement on the usefulness of /usr/libexec, so we'll
> need to make sure that packagers can adjust the paths for their
> systems' standards.

Our configure seem to provide --libexecdir and I think packagers on
platforms which don't use /usr/libexec (e.g. Debian & derivatives) are
probably pretty used to passing that option.

> For 4.2 we didn't want to change where these files were being placed,
> and I believe they've bin in $PREFIX/lib/ for quite some time.

I remember now, yes deferring from 4.2 was the right thing to do but now
that 4.3 is in swing this seems like as good a time as any to be making
a change like this.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 09:55:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 09:55:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXqjN-0004k4-80; Mon, 12 Nov 2012 09:55:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXqjL-0004js-3a
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 09:54:59 +0000
Received: from [85.158.143.99:27318] by server-3.bemta-4.messagelabs.com id
	6D/73-06841-277C0A05; Mon, 12 Nov 2012 09:54:58 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1352714097!29235231!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10018 invoked from network); 12 Nov 2012 09:54:58 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 09:54:58 -0000
X-IronPort-AV: E=Sophos;i="4.80,761,1344211200"; d="scan'208";a="15743112"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 09:54:46 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 09:54:45 +0000
Message-ID: <1352714084.27833.137.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Mon, 12 Nov 2012 09:54:44 +0000
In-Reply-To: <20121110135931.GD23686@localhost.localdomain>
References: <20121110135931.GD23686@localhost.localdomain>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "annie.li@oracle.com" <annie.li@oracle.com>,
	"marcos.matsunaga@oracle.com" <marcos.matsunaga@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] domU to domU networking issues in v3.7?
 (netserver/netperf failing to communicate)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, 2012-11-10 at 13:59 +0000, Konrad Rzeszutek Wilk wrote:
> Hey Ian, Xen-devel mailingl list,
> 
> I think the issue of 70% traffic lost was actually introduced in v3.6 or
> perhaps v3.5. Annie and Marcos (CC-ed here) are looking to see which of
> the releases introduced this. The issue we are seeing is that a domU
> to domU communication breaks - this is with netperf/netserver talking to
> each other.
> 
> Anyhow, I think the 3.7 compound page exacerbated the problem and also
> (at least on some of my test hardware) exposed existing issues with
> drivers. The issue I have is that the 'skge' driver has a bug that has
> been there for ages (I tested way back to 3.0 and still saw it) were it
> can not work with SWIOTLB. It is probably missing an pci_dma_sync
> somewhere. 
> 
> Anyhow the compound page got me to look at Xen-SWIOTLB and that looks
> OK. Even with synthetic driver (the fake one I posted somewhere) it
> dealt with compound pages properly (with debug or non-debug Xen
> hypervisor).

The debug build is probably most interesting since it deliberately
allocates a non 1-1 p-to-m mapping so as to catch exactly these sorts of
issues.

> So was wondering if you had looked at this in more details? Any
> ideas? Or would it be more prudent to ask that once we know for sure
> which Linux release introduced the communication failures between
> guests?

I've not looked at it any further I'm afraid.

If these changes (be they in 3.5 or later, or earlier) are exposing
driver bugs then I suspect the netdev chaps would want to know about it.

FWIW I see the issue with tg3.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 09:55:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 09:55:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXqjN-0004k4-80; Mon, 12 Nov 2012 09:55:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXqjL-0004js-3a
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 09:54:59 +0000
Received: from [85.158.143.99:27318] by server-3.bemta-4.messagelabs.com id
	6D/73-06841-277C0A05; Mon, 12 Nov 2012 09:54:58 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1352714097!29235231!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10018 invoked from network); 12 Nov 2012 09:54:58 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 09:54:58 -0000
X-IronPort-AV: E=Sophos;i="4.80,761,1344211200"; d="scan'208";a="15743112"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 09:54:46 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 09:54:45 +0000
Message-ID: <1352714084.27833.137.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Mon, 12 Nov 2012 09:54:44 +0000
In-Reply-To: <20121110135931.GD23686@localhost.localdomain>
References: <20121110135931.GD23686@localhost.localdomain>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "annie.li@oracle.com" <annie.li@oracle.com>,
	"marcos.matsunaga@oracle.com" <marcos.matsunaga@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] domU to domU networking issues in v3.7?
 (netserver/netperf failing to communicate)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, 2012-11-10 at 13:59 +0000, Konrad Rzeszutek Wilk wrote:
> Hey Ian, Xen-devel mailingl list,
> 
> I think the issue of 70% traffic lost was actually introduced in v3.6 or
> perhaps v3.5. Annie and Marcos (CC-ed here) are looking to see which of
> the releases introduced this. The issue we are seeing is that a domU
> to domU communication breaks - this is with netperf/netserver talking to
> each other.
> 
> Anyhow, I think the 3.7 compound page exacerbated the problem and also
> (at least on some of my test hardware) exposed existing issues with
> drivers. The issue I have is that the 'skge' driver has a bug that has
> been there for ages (I tested way back to 3.0 and still saw it) were it
> can not work with SWIOTLB. It is probably missing an pci_dma_sync
> somewhere. 
> 
> Anyhow the compound page got me to look at Xen-SWIOTLB and that looks
> OK. Even with synthetic driver (the fake one I posted somewhere) it
> dealt with compound pages properly (with debug or non-debug Xen
> hypervisor).

The debug build is probably most interesting since it deliberately
allocates a non 1-1 p-to-m mapping so as to catch exactly these sorts of
issues.

> So was wondering if you had looked at this in more details? Any
> ideas? Or would it be more prudent to ask that once we know for sure
> which Linux release introduced the communication failures between
> guests?

I've not looked at it any further I'm afraid.

If these changes (be they in 3.5 or later, or earlier) are exposing
driver bugs then I suspect the netdev chaps would want to know about it.

FWIW I see the issue with tg3.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 10:00:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 10:00:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXqoE-0005C2-Vh; Mon, 12 Nov 2012 10:00:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mattjd@gmail.com>) id 1TXqoD-000580-SH
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 10:00:02 +0000
Received: from [85.158.137.99:7104] by server-1.bemta-3.messagelabs.com id
	1A/49-12169-1A8C0A05; Mon, 12 Nov 2012 10:00:01 +0000
X-Env-Sender: mattjd@gmail.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1352714398!13912168!1
X-Originating-IP: [209.85.210.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2333 invoked from network); 12 Nov 2012 10:00:00 -0000
Received: from mail-da0-f45.google.com (HELO mail-da0-f45.google.com)
	(209.85.210.45)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 10:00:00 -0000
Received: by mail-da0-f45.google.com with SMTP id n15so2697870dad.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 01:59:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer;
	bh=TMMa1nACG1BqMU9JyQoijszbnYgVq/XeN85PmLzdQo0=;
	b=cGr/fBFt1I14SVdDziNja1Rd02fHTWrsNpyng6Vd2FvhAXqj0G0Lh0KfqF6PfXWj0O
	q7ETez7f0oMDI0u1UZpuMAF7syO5818xs/LKLnEydAZPbAupBYPenFjBM2oQpje8ew0P
	TjyGWiEeMSrgWMi+oHiNI2EwG2x1FaxEGZPaCcB+OgL+6KPB3ZcUbokL3+yK9oRImqhT
	ZEJeNpPBEYtSe5eEC1FAm3Gc8NkvCCefu6Kur6tEsgC61IsAHp/n+IeuhIpBx6Wvf2hO
	EqCtH/pbWIF59ohZGMIT6b9mUqAMprdkCK0BsJu4p5BUL2pjVxIbycrivy4V40/0/6Ce
	776g==
Received: by 10.68.194.101 with SMTP id hv5mr14882811pbc.121.1352714398176;
	Mon, 12 Nov 2012 01:59:58 -0800 (PST)
Received: from morphism.xen.prgmr.com (morphism.xen.prgmr.com. [71.19.145.114])
	by mx.google.com with ESMTPS id jw14sm3964804pbb.36.2012.11.12.01.59.56
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 12 Nov 2012 01:59:57 -0800 (PST)
From: Matthew Daley <mattjd@gmail.com>
To: xen-devel@lists.xen.org
Date: Mon, 12 Nov 2012 23:00:18 +1300
Message-Id: <1352714418-5776-1-git-send-email-mattjd@gmail.com>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Daley <mattjd@gmail.com>
Subject: [Xen-devel] [PATCH] x86 shadow: Fix typo in sh_invlpg sl3 page
	presence check
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


Signed-off-by: Matthew Daley <mattjd@gmail.com>

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index b0e6d72..39cb7de 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -3505,7 +3505,7 @@ sh_invlpg(struct vcpu *v, unsigned long va)
             perfc_incr(shadow_invlpg_fault);
             return 0;
         }
-        if ( (!shadow_l3e_get_flags(sl3e) & _PAGE_PRESENT) )
+        if ( !(shadow_l3e_get_flags(sl3e) & _PAGE_PRESENT) )
             return 0;
     }
 #else /* SHADOW_PAGING_LEVELS == 3 */
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 10:00:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 10:00:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXqoE-0005C2-Vh; Mon, 12 Nov 2012 10:00:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mattjd@gmail.com>) id 1TXqoD-000580-SH
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 10:00:02 +0000
Received: from [85.158.137.99:7104] by server-1.bemta-3.messagelabs.com id
	1A/49-12169-1A8C0A05; Mon, 12 Nov 2012 10:00:01 +0000
X-Env-Sender: mattjd@gmail.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1352714398!13912168!1
X-Originating-IP: [209.85.210.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2333 invoked from network); 12 Nov 2012 10:00:00 -0000
Received: from mail-da0-f45.google.com (HELO mail-da0-f45.google.com)
	(209.85.210.45)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 10:00:00 -0000
Received: by mail-da0-f45.google.com with SMTP id n15so2697870dad.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 01:59:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer;
	bh=TMMa1nACG1BqMU9JyQoijszbnYgVq/XeN85PmLzdQo0=;
	b=cGr/fBFt1I14SVdDziNja1Rd02fHTWrsNpyng6Vd2FvhAXqj0G0Lh0KfqF6PfXWj0O
	q7ETez7f0oMDI0u1UZpuMAF7syO5818xs/LKLnEydAZPbAupBYPenFjBM2oQpje8ew0P
	TjyGWiEeMSrgWMi+oHiNI2EwG2x1FaxEGZPaCcB+OgL+6KPB3ZcUbokL3+yK9oRImqhT
	ZEJeNpPBEYtSe5eEC1FAm3Gc8NkvCCefu6Kur6tEsgC61IsAHp/n+IeuhIpBx6Wvf2hO
	EqCtH/pbWIF59ohZGMIT6b9mUqAMprdkCK0BsJu4p5BUL2pjVxIbycrivy4V40/0/6Ce
	776g==
Received: by 10.68.194.101 with SMTP id hv5mr14882811pbc.121.1352714398176;
	Mon, 12 Nov 2012 01:59:58 -0800 (PST)
Received: from morphism.xen.prgmr.com (morphism.xen.prgmr.com. [71.19.145.114])
	by mx.google.com with ESMTPS id jw14sm3964804pbb.36.2012.11.12.01.59.56
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 12 Nov 2012 01:59:57 -0800 (PST)
From: Matthew Daley <mattjd@gmail.com>
To: xen-devel@lists.xen.org
Date: Mon, 12 Nov 2012 23:00:18 +1300
Message-Id: <1352714418-5776-1-git-send-email-mattjd@gmail.com>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Daley <mattjd@gmail.com>
Subject: [Xen-devel] [PATCH] x86 shadow: Fix typo in sh_invlpg sl3 page
	presence check
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


Signed-off-by: Matthew Daley <mattjd@gmail.com>

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index b0e6d72..39cb7de 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -3505,7 +3505,7 @@ sh_invlpg(struct vcpu *v, unsigned long va)
             perfc_incr(shadow_invlpg_fault);
             return 0;
         }
-        if ( (!shadow_l3e_get_flags(sl3e) & _PAGE_PRESENT) )
+        if ( !(shadow_l3e_get_flags(sl3e) & _PAGE_PRESENT) )
             return 0;
     }
 #else /* SHADOW_PAGING_LEVELS == 3 */
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 10:05:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 10:05:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXqt1-0005Qn-OO; Mon, 12 Nov 2012 10:04:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXqsz-0005Qa-SI
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 10:04:57 +0000
Received: from [85.158.137.99:16259] by server-14.bemta-3.messagelabs.com id
	69/94-12788-4C9C0A05; Mon, 12 Nov 2012 10:04:52 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1352714691!13590234!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10142 invoked from network); 12 Nov 2012 10:04:51 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 10:04:51 -0000
X-IronPort-AV: E=Sophos;i="4.80,761,1344211200"; d="scan'208";a="15743432"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 10:04:27 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 10:04:27 +0000
Message-ID: <1352714666.27833.144.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Date: Mon, 12 Nov 2012 10:04:26 +0000
In-Reply-To: <patchbomb.1351855134@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Keir Fraser <keir@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 0 of 5] docs: x86 PV MMU related functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

ping?

On Fri, 2012-11-02 at 11:18 +0000, Ian Campbell wrote:
> The following series adds some documentation for the PV MU related
> hypercalls. For the most part this is just a case of adding a suitable
> prototype and marking things up so they show up in the generated docs.
> 
> I also have a draft of a wiki article on the subject which references
> the information in the public headers which I hope to post soon.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 10:05:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 10:05:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXqt1-0005Qn-OO; Mon, 12 Nov 2012 10:04:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXqsz-0005Qa-SI
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 10:04:57 +0000
Received: from [85.158.137.99:16259] by server-14.bemta-3.messagelabs.com id
	69/94-12788-4C9C0A05; Mon, 12 Nov 2012 10:04:52 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1352714691!13590234!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10142 invoked from network); 12 Nov 2012 10:04:51 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 10:04:51 -0000
X-IronPort-AV: E=Sophos;i="4.80,761,1344211200"; d="scan'208";a="15743432"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 10:04:27 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 10:04:27 +0000
Message-ID: <1352714666.27833.144.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Date: Mon, 12 Nov 2012 10:04:26 +0000
In-Reply-To: <patchbomb.1351855134@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Keir Fraser <keir@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 0 of 5] docs: x86 PV MMU related functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

ping?

On Fri, 2012-11-02 at 11:18 +0000, Ian Campbell wrote:
> The following series adds some documentation for the PV MU related
> hypercalls. For the most part this is just a case of adding a suitable
> prototype and marking things up so they show up in the generated docs.
> 
> I also have a draft of a wiki article on the subject which references
> the information in the public headers which I hope to post soon.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 10:20:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 10:20:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXr6x-0005kL-52; Mon, 12 Nov 2012 10:19:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TXr6v-0005kG-0W
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 10:19:21 +0000
Received: from [85.158.143.99:9375] by server-2.bemta-4.messagelabs.com id
	8F/F6-28922-82DC0A05; Mon, 12 Nov 2012 10:19:20 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1352715559!29239146!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5406 invoked from network); 12 Nov 2012 10:19:19 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-5.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 12 Nov 2012 10:19:19 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TXr5v-0008HF-MJ; Mon, 12 Nov 2012 10:18:19 +0000
Date: Mon, 12 Nov 2012 10:18:19 +0000
From: Tim Deegan <tim@xen.org>
To: Matthew Daley <mattjd@gmail.com>
Message-ID: <20121112101819.GA30896@ocelot.phlegethon.org>
References: <1352714418-5776-1-git-send-email-mattjd@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352714418-5776-1-git-send-email-mattjd@gmail.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] x86 shadow: Fix typo in sh_invlpg sl3 page
	presence check
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 23:00 +1300 on 12 Nov (1352761218), Matthew Daley wrote:
> Signed-off-by: Matthew Daley <mattjd@gmail.com>

Applied, thanks.

Tim.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 10:20:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 10:20:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXr6x-0005kL-52; Mon, 12 Nov 2012 10:19:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TXr6v-0005kG-0W
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 10:19:21 +0000
Received: from [85.158.143.99:9375] by server-2.bemta-4.messagelabs.com id
	8F/F6-28922-82DC0A05; Mon, 12 Nov 2012 10:19:20 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1352715559!29239146!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5406 invoked from network); 12 Nov 2012 10:19:19 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-5.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 12 Nov 2012 10:19:19 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TXr5v-0008HF-MJ; Mon, 12 Nov 2012 10:18:19 +0000
Date: Mon, 12 Nov 2012 10:18:19 +0000
From: Tim Deegan <tim@xen.org>
To: Matthew Daley <mattjd@gmail.com>
Message-ID: <20121112101819.GA30896@ocelot.phlegethon.org>
References: <1352714418-5776-1-git-send-email-mattjd@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352714418-5776-1-git-send-email-mattjd@gmail.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] x86 shadow: Fix typo in sh_invlpg sl3 page
	presence check
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 23:00 +1300 on 12 Nov (1352761218), Matthew Daley wrote:
> Signed-off-by: Matthew Daley <mattjd@gmail.com>

Applied, thanks.

Tim.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 10:30:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 10:30:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXrGm-000607-Eo; Mon, 12 Nov 2012 10:29:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fantonifabio@tiscali.it>) id 1TXrGl-000600-D3
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 10:29:31 +0000
Received: from [85.158.143.35:19085] by server-1.bemta-4.messagelabs.com id
	EE/70-27934-A8FC0A05; Mon, 12 Nov 2012 10:29:30 +0000
X-Env-Sender: fantonifabio@tiscali.it
X-Msg-Ref: server-10.tower-21.messagelabs.com!1352716157!10116224!1
X-Originating-IP: [94.23.245.208]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28200 invoked from network); 12 Nov 2012 10:29:18 -0000
Received: from lnx3.fantu.it (HELO lnx3.fantu.it) (94.23.245.208)
	by server-10.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 10:29:18 -0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by lnx3.fantu.it (Postfix) with ESMTP id F33F0400285
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 11:29:16 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at lnx3.fantu.it
Received: from lnx3.fantu.it ([127.0.0.1])
	by localhost (lnx3.fantu.it [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id LrUsGRkaqz7V for <xen-devel@lists.xen.org>;
	Mon, 12 Nov 2012 11:29:15 +0100 (CET)
Received: from [192.168.178.50]
	(host51-78-dynamic.2-87-r.retail.telecomitalia.it [87.2.78.51])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: prova@fantu.it)
	by lnx3.fantu.it (Postfix) with ESMTPSA id 058D440021F
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 11:29:14 +0100 (CET)
Message-ID: <50A0CF73.5040807@tiscali.it>
Date: Mon, 12 Nov 2012 11:29:07 +0100
From: Fabio Fantoni <fantonifabio@tiscali.it>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel <xen-devel@lists.xen.org>
Subject: [Xen-devel] Qemu upstream status
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: fantonifabio@tiscali.it
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0581220439455297604=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--===============0581220439455297604==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms080902050007010800080506"

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--------------ms080902050007010800080506
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: quoted-printable

I see that qemu upstream repository on xen is not updated, why wasn't it =

updated with 1.3 unstable?=20
http://xenbits.xen.org/gitweb/?p=3Dstaging/qemu-upstream-unstable.git;a=3D=
summary
Recently I tested it:=20
http://lists.xen.org/archives/html/xen-devel/2012-10/msg01820.html
Save/restore is now working, the only problem found is network not=20
working on restore with windows domU.
cd-eject is working, cd-insert is not.
spice is working, but with qxl it causes crash of qemu, the same with=20
latest spice patches:=20
http://cgit.freedesktop.org/spice/qemu/log/?h=3Dspice.v63
On log there is this error:
(/usr/sbin/xl:3463): Spice-CRITICAL **: red_memslots.c:123:get_virt:=20
slot_id 194 too big, addr=3Dc2c2c2c2c2c2c2c2
A fix or change in xen is probably needed


--------------ms080902050007010800080506
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: Firma crittografica S/MIME

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIINhjCC
BjQwggQcoAMCAQICASAwDQYJKoZIhvcNAQEFBQAwfTELMAkGA1UEBhMCSUwxFjAUBgNVBAoT
DVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRl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dGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRhbCBDZXJ0aWZpY2F0
ZSBTaWduaW5nMTgwNgYDVQQDEy9TdGFydENvbSBDbGFzcyAyIFByaW1hcnkgSW50ZXJtZWRp
YXRlIENsaWVudCBDQQICHmMwDQYJKoZIhvcNAQEBBQAEggEApNziTQLlmi8ZGKT9Rzd9CfCs
mM+Zv4axkGqQmxGV1eXWPE3VSAOFI1FhlvVYx83UjiMQYkMo4HpdjOjR72mqPMYuJsVMsTFh
K1trTrtvxBdeV8S+8I92f9hK8QWJLF2llKaBf9B2S1eJ/IpjR2LS84qhmzuWRbA+DZz2QUXK
EhBAy4E2qTvKmbJwAqA0AEuPGtecz1FwSvwki2yPicbozt3w4sUJSrU3Hz0elPRsNlERZlR0
sYaO6VMN8mf4oVDE01DOwJfEanmFI4PViPaQEZx5WGFCpbkDJLfL5PuoMtUODpgUtyHRc1Mm
UsFhtnihO1sZcnKqfi91wHDP+aDGhwAAAAAAAA==
--------------ms080902050007010800080506--


--===============0581220439455297604==
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.xen.org
http://lists.xen.org/xen-devel

--===============0581220439455297604==--


From xen-devel-bounces@lists.xen.org Mon Nov 12 10:30:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 10:30:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXrGm-000607-Eo; Mon, 12 Nov 2012 10:29:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fantonifabio@tiscali.it>) id 1TXrGl-000600-D3
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 10:29:31 +0000
Received: from [85.158.143.35:19085] by server-1.bemta-4.messagelabs.com id
	EE/70-27934-A8FC0A05; Mon, 12 Nov 2012 10:29:30 +0000
X-Env-Sender: fantonifabio@tiscali.it
X-Msg-Ref: server-10.tower-21.messagelabs.com!1352716157!10116224!1
X-Originating-IP: [94.23.245.208]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28200 invoked from network); 12 Nov 2012 10:29:18 -0000
Received: from lnx3.fantu.it (HELO lnx3.fantu.it) (94.23.245.208)
	by server-10.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 10:29:18 -0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by lnx3.fantu.it (Postfix) with ESMTP id F33F0400285
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 11:29:16 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at lnx3.fantu.it
Received: from lnx3.fantu.it ([127.0.0.1])
	by localhost (lnx3.fantu.it [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id LrUsGRkaqz7V for <xen-devel@lists.xen.org>;
	Mon, 12 Nov 2012 11:29:15 +0100 (CET)
Received: from [192.168.178.50]
	(host51-78-dynamic.2-87-r.retail.telecomitalia.it [87.2.78.51])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: prova@fantu.it)
	by lnx3.fantu.it (Postfix) with ESMTPSA id 058D440021F
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 11:29:14 +0100 (CET)
Message-ID: <50A0CF73.5040807@tiscali.it>
Date: Mon, 12 Nov 2012 11:29:07 +0100
From: Fabio Fantoni <fantonifabio@tiscali.it>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel <xen-devel@lists.xen.org>
Subject: [Xen-devel] Qemu upstream status
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: fantonifabio@tiscali.it
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0581220439455297604=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--===============0581220439455297604==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms080902050007010800080506"

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--------------ms080902050007010800080506
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: quoted-printable

I see that qemu upstream repository on xen is not updated, why wasn't it =

updated with 1.3 unstable?=20
http://xenbits.xen.org/gitweb/?p=3Dstaging/qemu-upstream-unstable.git;a=3D=
summary
Recently I tested it:=20
http://lists.xen.org/archives/html/xen-devel/2012-10/msg01820.html
Save/restore is now working, the only problem found is network not=20
working on restore with windows domU.
cd-eject is working, cd-insert is not.
spice is working, but with qxl it causes crash of qemu, the same with=20
latest spice patches:=20
http://cgit.freedesktop.org/spice/qemu/log/?h=3Dspice.v63
On log there is this error:
(/usr/sbin/xl:3463): Spice-CRITICAL **: red_memslots.c:123:get_virt:=20
slot_id 194 too big, addr=3Dc2c2c2c2c2c2c2c2
A fix or change in xen is probably needed


--------------ms080902050007010800080506
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: Firma crittografica S/MIME

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIINhjCC
BjQwggQcoAMCAQICASAwDQYJKoZIhvcNAQEFBQAwfTELMAkGA1UEBhMCSUwxFjAUBgNVBAoT
DVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNp
Z25pbmcxKTAnBgNVBAMTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA3
MTAyNDIxMDI1NVoXDTE3MTAyNDIxMDI1NVowgYwxCzAJBgNVBAYTAklMMRYwFAYDVQQKEw1T
dGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRhbCBDZXJ0aWZpY2F0ZSBTaWdu
aW5nMTgwNgYDVQQDEy9TdGFydENvbSBDbGFzcyAyIFByaW1hcnkgSW50ZXJtZWRpYXRlIENs
aWVudCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMsohUWcASz7GfKrpTOM
KqANy9BV7V0igWdGxA8IU77L3aTxErQ+fcxtDYZ36Z6GH0YFn7fq5RADteP0AYzrCA+EQTfi
8q1+kA3m0nwtwXG94M5sIqsvs7lRP1aycBke/s5g9hJHryZ2acScnzczjBCAo7X1v5G3yw8M
DP2m2RCye0KfgZ4nODerZJVzhAlOD9YejvAXZqHksw56HzElVIoYSZ3q4+RJuPXXfIoyby+Y
2m1E+YzX5iCZXBx05gk6MKAW1vaw4/v2OOLy6FZH3XHHtOkzUreG//CsFnB9+uaYSlR65cdG
zTsmoIK8WH1ygoXhRBm98SD7Hf/r3FELNvUCAwEAAaOCAa0wggGpMA8GA1UdEwEB/wQFMAMB
Af8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSuVYNv7DHKufcd+q9rMfP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DGBljCBkzCBjDELMAkGA1UEBhMCSUwxFjAUBgNVBAoTDVN0
YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNpZ25p
bmcxODA2BgNVBAMTL1N0YXJ0Q29tIENsYXNzIDIgUHJpbWFyeSBJbnRlcm1lZGlhdGUgQ2xp
ZW50IENBAgIeYzCBpgYLKoZIhvcNAQkQAgsxgZaggZMwgYwxCzAJBgNVBAYTAklMMRYwFAYD
VQQKEw1TdGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRhbCBDZXJ0aWZpY2F0
ZSBTaWduaW5nMTgwNgYDVQQDEy9TdGFydENvbSBDbGFzcyAyIFByaW1hcnkgSW50ZXJtZWRp
YXRlIENsaWVudCBDQQICHmMwDQYJKoZIhvcNAQEBBQAEggEApNziTQLlmi8ZGKT9Rzd9CfCs
mM+Zv4axkGqQmxGV1eXWPE3VSAOFI1FhlvVYx83UjiMQYkMo4HpdjOjR72mqPMYuJsVMsTFh
K1trTrtvxBdeV8S+8I92f9hK8QWJLF2llKaBf9B2S1eJ/IpjR2LS84qhmzuWRbA+DZz2QUXK
EhBAy4E2qTvKmbJwAqA0AEuPGtecz1FwSvwki2yPicbozt3w4sUJSrU3Hz0elPRsNlERZlR0
sYaO6VMN8mf4oVDE01DOwJfEanmFI4PViPaQEZx5WGFCpbkDJLfL5PuoMtUODpgUtyHRc1Mm
UsFhtnihO1sZcnKqfi91wHDP+aDGhwAAAAAAAA==
--------------ms080902050007010800080506--


--===============0581220439455297604==
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.xen.org
http://lists.xen.org/xen-devel

--===============0581220439455297604==--


From xen-devel-bounces@lists.xen.org Mon Nov 12 11:04:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 11:04:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXro7-00079M-7b; Mon, 12 Nov 2012 11:03:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TXro5-00079E-29
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 11:03:57 +0000
Received: from [85.158.137.99:5700] by server-4.bemta-3.messagelabs.com id
	7E/F2-30023-C97D0A05; Mon, 12 Nov 2012 11:03:56 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1352718235!18736139!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31187 invoked from network); 12 Nov 2012 11:03:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 11:03:55 -0000
X-IronPort-AV: E=Sophos;i="4.80,761,1344211200"; d="scan'208";a="15745547"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 11:03:55 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 12 Nov 2012 11:03:55 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TXro3-0003zE-5E; Mon, 12 Nov 2012 11:03:55 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TXro3-0003EC-1F;
	Mon, 12 Nov 2012 11:03:55 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20640.55194.944103.42939@mariner.uk.xensource.com>
Date: Mon, 12 Nov 2012 11:03:54 +0000
To: Dan Magenheimer <dan.magenheimer@oracle.com>
In-Reply-To: <88261052-b3f5-46f5-bd0e-b650d827062e@default>
References: <7563be37-62f1-472e-9aec-1d0c55fa7c29@default>
	<CCC11199.443CE%keir.xen@gmail.com>
	<20635.34133.118531.778138@mariner.uk.xensource.com>
	<88261052-b3f5-46f5-bd0e-b650d827062e@default>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: "Tim \(Xen.org\)" <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	George Shuklin <george.shuklin@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Keir Fraser <keir.xen@gmail.com>, DarioFaggioli <raistlin@linux.it>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Dan Magenheimer writes ("RE: Proposed new "memory capacity claim" hypercall/feature"):
> But to ensure that any summary/restatement touches on your
> concerns, could you be more specific as to about what you are
> unconvinced?
> 
> I.e. I still think the toolstack can manage all memory
> allocation;

I'm still unconvinced that this is false.  I think it's probably true.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 11:04:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 11:04:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXro7-00079M-7b; Mon, 12 Nov 2012 11:03:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TXro5-00079E-29
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 11:03:57 +0000
Received: from [85.158.137.99:5700] by server-4.bemta-3.messagelabs.com id
	7E/F2-30023-C97D0A05; Mon, 12 Nov 2012 11:03:56 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1352718235!18736139!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31187 invoked from network); 12 Nov 2012 11:03:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 11:03:55 -0000
X-IronPort-AV: E=Sophos;i="4.80,761,1344211200"; d="scan'208";a="15745547"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 11:03:55 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 12 Nov 2012 11:03:55 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TXro3-0003zE-5E; Mon, 12 Nov 2012 11:03:55 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TXro3-0003EC-1F;
	Mon, 12 Nov 2012 11:03:55 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20640.55194.944103.42939@mariner.uk.xensource.com>
Date: Mon, 12 Nov 2012 11:03:54 +0000
To: Dan Magenheimer <dan.magenheimer@oracle.com>
In-Reply-To: <88261052-b3f5-46f5-bd0e-b650d827062e@default>
References: <7563be37-62f1-472e-9aec-1d0c55fa7c29@default>
	<CCC11199.443CE%keir.xen@gmail.com>
	<20635.34133.118531.778138@mariner.uk.xensource.com>
	<88261052-b3f5-46f5-bd0e-b650d827062e@default>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: "Tim \(Xen.org\)" <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	George Shuklin <george.shuklin@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Keir Fraser <keir.xen@gmail.com>, DarioFaggioli <raistlin@linux.it>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Proposed new "memory capacity claim"
	hypercall/feature
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Dan Magenheimer writes ("RE: Proposed new "memory capacity claim" hypercall/feature"):
> But to ensure that any summary/restatement touches on your
> concerns, could you be more specific as to about what you are
> unconvinced?
> 
> I.e. I still think the toolstack can manage all memory
> allocation;

I'm still unconvinced that this is false.  I think it's probably true.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 11:37:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 11:37:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXsJi-0007pW-26; Mon, 12 Nov 2012 11:36:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pablo.llopis@gmail.com>) id 1TXsJg-0007pR-GR
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 11:36:36 +0000
Received: from [85.158.143.99:24724] by server-3.bemta-4.messagelabs.com id
	9D/D0-06841-34FD0A05; Mon, 12 Nov 2012 11:36:35 +0000
X-Env-Sender: pablo.llopis@gmail.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1352720181!18373887!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10390 invoked from network); 12 Nov 2012 11:36:26 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 11:36:26 -0000
Received: by mail-ie0-f173.google.com with SMTP id 17so10430644iea.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 03:36:20 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=K/QnofI32rKt6oVZXP617Z/MAVxolp3uO+iQNiG+3W8=;
	b=MqKFFkSuDi2pqBKIz78AaftIo7H+HdcxYJt7US61eGv2ITKlqho5emknUsx3ySf+Zu
	7AiH1lrkUvkmcvG+38Rm7M/XsjQGiqUGWvm05LPbp3BBBFUVvUc9z8uiY2Rupx8GdXed
	2pwNCJpea872TlHoIv8AH2gHheViBNi7dGA4FxTGa4wCNYH4A/qae+OGSURO8FE5BL91
	+KrlD6jHS8FzB0+rgBMTww2IAWB9njtEayC9TthrPnL2UgfZmQU6Uu/liumehw0l5dTg
	4Caw0q2UrQmdSSPI0br0Qv38aF1pvMUKqPcp1bnHMsjJy8Eh0KC4HOclOojmEogg/gxD
	yWXg==
MIME-Version: 1.0
Received: by 10.50.17.129 with SMTP id o1mr7493744igd.21.1352720180742; Mon,
	12 Nov 2012 03:36:20 -0800 (PST)
Received: by 10.64.128.105 with HTTP; Mon, 12 Nov 2012 03:36:20 -0800 (PST)
In-Reply-To: <CAP4+OA3-CsKxJizFpx-V48cCFKJc5KXNQzzY4oQ6pQ5pu0RFMg@mail.gmail.com>
References: <CAP4+OA3-CsKxJizFpx-V48cCFKJc5KXNQzzY4oQ6pQ5pu0RFMg@mail.gmail.com>
Date: Mon, 12 Nov 2012 12:36:20 +0100
X-Google-Sender-Auth: JOR74zQeJg4tl92pBj7HbeKU9y0
Message-ID: <CAL08nMGDeaQO6HAJypK+pzmsmg8wcz2=WnLWwX==R5MRBCyoPA@mail.gmail.com>
From: Pablo Llopis <pllopis@arcos.inf.uc3m.es>
To: D Sundstrom <sunds@peapod.net>
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Immediate kernel panic using gntdev device
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello David,

I am not a Xen developer, but I think I can help with your issue :)

On Mon, Nov 12, 2012 at 12:35 AM, D Sundstrom <sunds@peapod.net> wrote:
>
> Running under debian wheezy kernel 3.2.0-3-686-pae (32 bit), under Xen 4.1
> HVM.
>
> The linux PV drivers load and all appears to be fine.
>
> I want to use the gntalloc device to allocate a page of memory from Domain A
> and then map that into Domain B using gntdev.  Both are unprivileged
> domains.
>
> Using Daniel DeGraaf's test program here:
> http://lists.xen.org/archives/html/xen-devel/2011-01/txtzDU6iZhTkB.txt
>

I am running a slightly different version of the tool,
http://lists.xen.org/archives/html/xen-devel/2011-02/msg00231.html (I
think this one is more up to date, I did not check if there was a more
recent one)

> I can run the command to create a grant, but upon running the command to map
> the grant (from either the same domain or another DomU), the kernel
> immediately crashes with no diagnostic output.
>
> Should I expect to be able to map grants in a DomU allocated in another
> DomU?

Yes, I think that is the main goal of grant references.

>
> Example of running the test:
>
> $  xenstore-read domid
> 8
>
> $  thetestprogram
>
> src-add <domid>       return gntref, address
> map <domid> <ref>     return index, address
> src-del <gntref>      no rv
> gu <index>            no rv
> unmap <address>       no rv
> show                  print and change mapped items
> This process bumps by 4000
>
> src-add 8
>
> src-add mapped 1372 at 0=0
>
> show
>
> 00(-1217044480,0): current     4000    new    0
>
> map 8 1372

It is not clear from your output from which domain you are running
each command. It looks like you are trying to issue a grant and map it
from within the same domain. That's probably the reason it crashes.
You are supposed to run this tool from both domains, running the calls
which interface with gntalloc from one domain, and the calls which
interface with gntdev from the other domain.
In any case, the domid you have to specify in the map must be the
domid of the domain which issued the grant. In other words, when
creating a grant, the domid which is granted access is specified. When
mapping a grant, the domid which issued the grant is specified. (i.e.
If you did "src-add 8" from dom0 you should run map 0 1372 from domU
8)

>
> (immediately crashes the VM)

I have also experienced this crash. The crash should probably not
happen, especially if it can be triggered from user-space, but I have
not looked into that.

>
>
> Thanks,
>
> David
>
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 11:37:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 11:37:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXsJi-0007pW-26; Mon, 12 Nov 2012 11:36:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pablo.llopis@gmail.com>) id 1TXsJg-0007pR-GR
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 11:36:36 +0000
Received: from [85.158.143.99:24724] by server-3.bemta-4.messagelabs.com id
	9D/D0-06841-34FD0A05; Mon, 12 Nov 2012 11:36:35 +0000
X-Env-Sender: pablo.llopis@gmail.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1352720181!18373887!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10390 invoked from network); 12 Nov 2012 11:36:26 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 11:36:26 -0000
Received: by mail-ie0-f173.google.com with SMTP id 17so10430644iea.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 03:36:20 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=K/QnofI32rKt6oVZXP617Z/MAVxolp3uO+iQNiG+3W8=;
	b=MqKFFkSuDi2pqBKIz78AaftIo7H+HdcxYJt7US61eGv2ITKlqho5emknUsx3ySf+Zu
	7AiH1lrkUvkmcvG+38Rm7M/XsjQGiqUGWvm05LPbp3BBBFUVvUc9z8uiY2Rupx8GdXed
	2pwNCJpea872TlHoIv8AH2gHheViBNi7dGA4FxTGa4wCNYH4A/qae+OGSURO8FE5BL91
	+KrlD6jHS8FzB0+rgBMTww2IAWB9njtEayC9TthrPnL2UgfZmQU6Uu/liumehw0l5dTg
	4Caw0q2UrQmdSSPI0br0Qv38aF1pvMUKqPcp1bnHMsjJy8Eh0KC4HOclOojmEogg/gxD
	yWXg==
MIME-Version: 1.0
Received: by 10.50.17.129 with SMTP id o1mr7493744igd.21.1352720180742; Mon,
	12 Nov 2012 03:36:20 -0800 (PST)
Received: by 10.64.128.105 with HTTP; Mon, 12 Nov 2012 03:36:20 -0800 (PST)
In-Reply-To: <CAP4+OA3-CsKxJizFpx-V48cCFKJc5KXNQzzY4oQ6pQ5pu0RFMg@mail.gmail.com>
References: <CAP4+OA3-CsKxJizFpx-V48cCFKJc5KXNQzzY4oQ6pQ5pu0RFMg@mail.gmail.com>
Date: Mon, 12 Nov 2012 12:36:20 +0100
X-Google-Sender-Auth: JOR74zQeJg4tl92pBj7HbeKU9y0
Message-ID: <CAL08nMGDeaQO6HAJypK+pzmsmg8wcz2=WnLWwX==R5MRBCyoPA@mail.gmail.com>
From: Pablo Llopis <pllopis@arcos.inf.uc3m.es>
To: D Sundstrom <sunds@peapod.net>
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Immediate kernel panic using gntdev device
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello David,

I am not a Xen developer, but I think I can help with your issue :)

On Mon, Nov 12, 2012 at 12:35 AM, D Sundstrom <sunds@peapod.net> wrote:
>
> Running under debian wheezy kernel 3.2.0-3-686-pae (32 bit), under Xen 4.1
> HVM.
>
> The linux PV drivers load and all appears to be fine.
>
> I want to use the gntalloc device to allocate a page of memory from Domain A
> and then map that into Domain B using gntdev.  Both are unprivileged
> domains.
>
> Using Daniel DeGraaf's test program here:
> http://lists.xen.org/archives/html/xen-devel/2011-01/txtzDU6iZhTkB.txt
>

I am running a slightly different version of the tool,
http://lists.xen.org/archives/html/xen-devel/2011-02/msg00231.html (I
think this one is more up to date, I did not check if there was a more
recent one)

> I can run the command to create a grant, but upon running the command to map
> the grant (from either the same domain or another DomU), the kernel
> immediately crashes with no diagnostic output.
>
> Should I expect to be able to map grants in a DomU allocated in another
> DomU?

Yes, I think that is the main goal of grant references.

>
> Example of running the test:
>
> $  xenstore-read domid
> 8
>
> $  thetestprogram
>
> src-add <domid>       return gntref, address
> map <domid> <ref>     return index, address
> src-del <gntref>      no rv
> gu <index>            no rv
> unmap <address>       no rv
> show                  print and change mapped items
> This process bumps by 4000
>
> src-add 8
>
> src-add mapped 1372 at 0=0
>
> show
>
> 00(-1217044480,0): current     4000    new    0
>
> map 8 1372

It is not clear from your output from which domain you are running
each command. It looks like you are trying to issue a grant and map it
from within the same domain. That's probably the reason it crashes.
You are supposed to run this tool from both domains, running the calls
which interface with gntalloc from one domain, and the calls which
interface with gntdev from the other domain.
In any case, the domid you have to specify in the map must be the
domid of the domain which issued the grant. In other words, when
creating a grant, the domid which is granted access is specified. When
mapping a grant, the domid which issued the grant is specified. (i.e.
If you did "src-add 8" from dom0 you should run map 0 1372 from domU
8)

>
> (immediately crashes the VM)

I have also experienced this crash. The crash should probably not
happen, especially if it can be triggered from user-space, but I have
not looked into that.

>
>
> Thanks,
>
> David
>
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 12:03:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 12:03:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXsil-0008Ln-CP; Mon, 12 Nov 2012 12:02:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TXsik-0008Lg-5E
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 12:02:30 +0000
Received: from [193.109.254.147:38294] by server-16.bemta-14.messagelabs.com
	id F0/32-09215-555E0A05; Mon, 12 Nov 2012 12:02:29 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352721748!2682288!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.7 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	MAILTO_TO_SPAM_ADDR,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25132 invoked from network); 12 Nov 2012 12:02:28 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 12:02:28 -0000
Received: by mail-we0-f173.google.com with SMTP id t11so3303010wey.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 04:02:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=B7wuDSKJhgUtlNcyL7IceAVIZkGuoTUV09i2BboNBMc=;
	b=O3ukV8umcAc2i/UMx5Ic+t46K++8l0h+oMSojlgVwlXKkor5OJPjUngZa6uH9TYf15
	LR5Kf8AXQSR2RemLmW0m/5oxBaQWJYvuppQ/y0pmQhGLC6pPTMJJW8rOuEkCswWoLKZt
	N0Xa3+2FyiSTTScUzkO/84JcbXcJir3IXQ9xjIMQldjtzHPcAeqHBm4N7OADiHIoZH6n
	+rOpE0EDon0XzaSAyojjQ/2dDoA34aIsW5F9lmoEoUKx+EB4VHi42k7DkCNy6CkL+4Dv
	SrKUkSJtyDH0J6/mGdp1xOyjVZ6sqg1es2nZEjoIQo8Q3KG7/LkorHYablEWwnlvCXOu
	AdVw==
MIME-Version: 1.0
Received: by 10.216.210.223 with SMTP id u73mr8116310weo.132.1352721748386;
	Mon, 12 Nov 2012 04:02:28 -0800 (PST)
Received: by 10.227.200.1 with HTTP; Mon, 12 Nov 2012 04:02:28 -0800 (PST)
In-Reply-To: <CAGjowiTF6h4snHTuqRz1BbxX8VNnKyPdoJaVfUAZFzRNJ9m0jg@mail.gmail.com>
References: <CAGjowiTF6h4snHTuqRz1BbxX8VNnKyPdoJaVfUAZFzRNJ9m0jg@mail.gmail.com>
Date: Mon, 12 Nov 2012 12:02:28 +0000
X-Google-Sender-Auth: 2ifzrDjnlJdnTI5o4Ne3OW8_QmQ
Message-ID: <CAFLBxZYbvC5VT+RhsX-MqEv0A7ObzF48SgHfN7d=8BuuWe7O=Q@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: David Xu <davidxu06@gmail.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] state of process on de-scheduled vCPU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4260752545493925165=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4260752545493925165==
Content-Type: multipart/alternative; boundary=001636c5b1944ae5a404ce4b137f

--001636c5b1944ae5a404ce4b137f
Content-Type: text/plain; charset=ISO-8859-1

On Sun, Nov 11, 2012 at 3:57 AM, David Xu <davidxu06@gmail.com> wrote:

> Hi all,
>
> I wonder if the state of process in guestOS will change when the
> corresponding vCPU is de-scheduled. In other words, when a vCPU uses up its
> credits and its state become over, how about the process context or softirq
> context in guest OS on this vCPU? Does it still maintain the same running
> state? Thanks.
>

I'm not sure what you mean "the same running state".  The state of the vcpu
-- the registers, the guest memory relating to it, and the fact that it's
not blocked -- is the same.  From the guest's perspective, it has
temporarily frozen in time until it gets to run again.  Does that answer
your question?

 -George

--001636c5b1944ae5a404ce4b137f
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Sun, Nov 11, 2012 at 3:57 AM, David Xu <span dir=3D"ltr">&lt;<a href=3D"=
mailto:davidxu06@gmail.com" target=3D"_blank">davidxu06@gmail.com</a>&gt;</=
span> wrote:<br><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote=
" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<div><br></div><div>I wonder if the state of process in guestOS will=
 change when the corresponding vCPU is de-scheduled. In other words, when a=
 vCPU uses up its credits and its state become over, how about the process =
context or softirq context in guest OS on this vCPU? Does it still maintain=
 the same running state? Thanks.</div>
</blockquote><div><br>I&#39;m not sure what you mean &quot;the same running=
 state&quot;.=A0 The state of the vcpu -- the registers, the guest memory r=
elating to it, and the fact that it&#39;s not blocked -- is the same.=A0 Fr=
om the guest&#39;s perspective, it has temporarily frozen in time until it =
gets to run again.=A0 Does that answer your question?<br>
<br>=A0-George<br></div></div><br>

--001636c5b1944ae5a404ce4b137f--


--===============4260752545493925165==
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.xen.org
http://lists.xen.org/xen-devel

--===============4260752545493925165==--


From xen-devel-bounces@lists.xen.org Mon Nov 12 12:03:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 12:03:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXsil-0008Ln-CP; Mon, 12 Nov 2012 12:02:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TXsik-0008Lg-5E
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 12:02:30 +0000
Received: from [193.109.254.147:38294] by server-16.bemta-14.messagelabs.com
	id F0/32-09215-555E0A05; Mon, 12 Nov 2012 12:02:29 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352721748!2682288!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.7 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	MAILTO_TO_SPAM_ADDR,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25132 invoked from network); 12 Nov 2012 12:02:28 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 12:02:28 -0000
Received: by mail-we0-f173.google.com with SMTP id t11so3303010wey.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 04:02:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=B7wuDSKJhgUtlNcyL7IceAVIZkGuoTUV09i2BboNBMc=;
	b=O3ukV8umcAc2i/UMx5Ic+t46K++8l0h+oMSojlgVwlXKkor5OJPjUngZa6uH9TYf15
	LR5Kf8AXQSR2RemLmW0m/5oxBaQWJYvuppQ/y0pmQhGLC6pPTMJJW8rOuEkCswWoLKZt
	N0Xa3+2FyiSTTScUzkO/84JcbXcJir3IXQ9xjIMQldjtzHPcAeqHBm4N7OADiHIoZH6n
	+rOpE0EDon0XzaSAyojjQ/2dDoA34aIsW5F9lmoEoUKx+EB4VHi42k7DkCNy6CkL+4Dv
	SrKUkSJtyDH0J6/mGdp1xOyjVZ6sqg1es2nZEjoIQo8Q3KG7/LkorHYablEWwnlvCXOu
	AdVw==
MIME-Version: 1.0
Received: by 10.216.210.223 with SMTP id u73mr8116310weo.132.1352721748386;
	Mon, 12 Nov 2012 04:02:28 -0800 (PST)
Received: by 10.227.200.1 with HTTP; Mon, 12 Nov 2012 04:02:28 -0800 (PST)
In-Reply-To: <CAGjowiTF6h4snHTuqRz1BbxX8VNnKyPdoJaVfUAZFzRNJ9m0jg@mail.gmail.com>
References: <CAGjowiTF6h4snHTuqRz1BbxX8VNnKyPdoJaVfUAZFzRNJ9m0jg@mail.gmail.com>
Date: Mon, 12 Nov 2012 12:02:28 +0000
X-Google-Sender-Auth: 2ifzrDjnlJdnTI5o4Ne3OW8_QmQ
Message-ID: <CAFLBxZYbvC5VT+RhsX-MqEv0A7ObzF48SgHfN7d=8BuuWe7O=Q@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: David Xu <davidxu06@gmail.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] state of process on de-scheduled vCPU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4260752545493925165=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4260752545493925165==
Content-Type: multipart/alternative; boundary=001636c5b1944ae5a404ce4b137f

--001636c5b1944ae5a404ce4b137f
Content-Type: text/plain; charset=ISO-8859-1

On Sun, Nov 11, 2012 at 3:57 AM, David Xu <davidxu06@gmail.com> wrote:

> Hi all,
>
> I wonder if the state of process in guestOS will change when the
> corresponding vCPU is de-scheduled. In other words, when a vCPU uses up its
> credits and its state become over, how about the process context or softirq
> context in guest OS on this vCPU? Does it still maintain the same running
> state? Thanks.
>

I'm not sure what you mean "the same running state".  The state of the vcpu
-- the registers, the guest memory relating to it, and the fact that it's
not blocked -- is the same.  From the guest's perspective, it has
temporarily frozen in time until it gets to run again.  Does that answer
your question?

 -George

--001636c5b1944ae5a404ce4b137f
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Sun, Nov 11, 2012 at 3:57 AM, David Xu <span dir=3D"ltr">&lt;<a href=3D"=
mailto:davidxu06@gmail.com" target=3D"_blank">davidxu06@gmail.com</a>&gt;</=
span> wrote:<br><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote=
" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<div><br></div><div>I wonder if the state of process in guestOS will=
 change when the corresponding vCPU is de-scheduled. In other words, when a=
 vCPU uses up its credits and its state become over, how about the process =
context or softirq context in guest OS on this vCPU? Does it still maintain=
 the same running state? Thanks.</div>
</blockquote><div><br>I&#39;m not sure what you mean &quot;the same running=
 state&quot;.=A0 The state of the vcpu -- the registers, the guest memory r=
elating to it, and the fact that it&#39;s not blocked -- is the same.=A0 Fr=
om the guest&#39;s perspective, it has temporarily frozen in time until it =
gets to run again.=A0 Does that answer your question?<br>
<br>=A0-George<br></div></div><br>

--001636c5b1944ae5a404ce4b137f--


--===============4260752545493925165==
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.xen.org
http://lists.xen.org/xen-devel

--===============4260752545493925165==--


From xen-devel-bounces@lists.xen.org Mon Nov 12 13:15:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 13:15:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXtr5-0000l1-HK; Mon, 12 Nov 2012 13:15:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <sunds@peapod.net>) id 1TXtr3-0000ko-8v
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 13:15:09 +0000
Received: from [85.158.138.51:10479] by server-9.bemta-3.messagelabs.com id
	A0/16-02388-956F0A05; Mon, 12 Nov 2012 13:15:05 +0000
X-Env-Sender: sunds@peapod.net
X-Msg-Ref: server-5.tower-174.messagelabs.com!1352726103!29753142!1
X-Originating-IP: [209.85.214.45]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18077 invoked from network); 12 Nov 2012 13:15:04 -0000
Received: from mail-bk0-f45.google.com (HELO mail-bk0-f45.google.com)
	(209.85.214.45)
	by server-5.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 13:15:04 -0000
Received: by mail-bk0-f45.google.com with SMTP id je9so1527000bkc.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 05:15:03 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=f3DxStGgJek993D1cehKq/xWh+Hln1hSLPSjIkwzmek=;
	b=G6A+7vGTidGyHIQEmlOxnmkCZZuJY4CMYp9zJKoo0Xf5KiHXuUHDPV5daYR8b/PCv/
	AZOOT9bdkPWOqr6Idn0yTxq1TXTWscxqSk0I14KvmhIb6Jj0OX9LOzA4Ak9MHVie/FM2
	qWa6OPkJwGCodzJvuV/hkMTngLFFDthcuoV2UlJZiusAR3ZuqmsiUsPeDNV/mCLwnIfC
	ppkH9lUPVXxTM0c+dPDwppxXW0L+zYBJfHq8PSAyIInScgYAySWQslm1/nyprEKc9A7h
	xF+SPUxEV+UI4e9S8gBeZui+1qesygh0cmDs7o7CIm7/5LJIhCrTLVaRLkeePlUiIzNl
	DFtQ==
MIME-Version: 1.0
Received: by 10.204.128.155 with SMTP id k27mr6950264bks.26.1352726103542;
	Mon, 12 Nov 2012 05:15:03 -0800 (PST)
Received: by 10.205.81.74 with HTTP; Mon, 12 Nov 2012 05:15:03 -0800 (PST)
In-Reply-To: <CAL08nMGDeaQO6HAJypK+pzmsmg8wcz2=WnLWwX==R5MRBCyoPA@mail.gmail.com>
References: <CAP4+OA3-CsKxJizFpx-V48cCFKJc5KXNQzzY4oQ6pQ5pu0RFMg@mail.gmail.com>
	<CAL08nMGDeaQO6HAJypK+pzmsmg8wcz2=WnLWwX==R5MRBCyoPA@mail.gmail.com>
Date: Mon, 12 Nov 2012 07:15:03 -0600
Message-ID: <CAP4+OA064YvLQyPahGWoyxPhWv+v5LLCjBUOUg09QF7XKJ1tZg@mail.gmail.com>
From: D Sundstrom <sunds@peapod.net>
To: Pablo Llopis <pllopis@arcos.inf.uc3m.es>
X-Gm-Message-State: ALoCoQl2mXxZKdRe15qpvftkZs0ZozV8iyFtPqKzBh84+2aiZ9+jsrLrM+qFIICat1YSKdfGbDXm
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Immediate kernel panic using gntdev device
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Thank you Pablo.

It makes no difference if I run both the src-add and map from the same
domain or from different DomU domains.
Whichever DomU I run the map function in crashes immediately.

You mention Dom0.  I just want to be clear that I'd like to share
between two DomU domains.  Have you gotten this to work?

I also tried the userspace APIs provided by Xen such as
xc_gnttab_map_grant_ref() and these also crash.  Of course, these use
the same driver IOCTLs, so this isn't a surprise.

I'll need to see if I can get some debug info from the DomU kernel to
make progress.

If I can get this to work, are there any restrictions on sharing large
amounts of memory?  Say 160Mb?  Or are grant tables intended for a
small number of pages?

Thanks,
David



On Mon, Nov 12, 2012 at 5:36 AM, Pablo Llopis <pllopis@arcos.inf.uc3m.es> wrote:
>
> It is not clear from your output from which domain you are running
> each command. It looks like you are trying to issue a grant and map it
> from within the same domain. That's probably the reason it crashes.
> You are supposed to run this tool from both domains, running the calls
> which interface with gntalloc from one domain, and the calls which
> interface with gntdev from the other domain.
> In any case, the domid you have to specify in the map must be the
> domid of the domain which issued the grant. In other words, when
> creating a grant, the domid which is granted access is specified. When
> mapping a grant, the domid which issued the grant is specified. (i.e.
> If you did "src-add 8" from dom0 you should run map 0 1372 from domU
> 8)
>
> >

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 13:15:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 13:15:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXtr5-0000l1-HK; Mon, 12 Nov 2012 13:15:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <sunds@peapod.net>) id 1TXtr3-0000ko-8v
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 13:15:09 +0000
Received: from [85.158.138.51:10479] by server-9.bemta-3.messagelabs.com id
	A0/16-02388-956F0A05; Mon, 12 Nov 2012 13:15:05 +0000
X-Env-Sender: sunds@peapod.net
X-Msg-Ref: server-5.tower-174.messagelabs.com!1352726103!29753142!1
X-Originating-IP: [209.85.214.45]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18077 invoked from network); 12 Nov 2012 13:15:04 -0000
Received: from mail-bk0-f45.google.com (HELO mail-bk0-f45.google.com)
	(209.85.214.45)
	by server-5.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 13:15:04 -0000
Received: by mail-bk0-f45.google.com with SMTP id je9so1527000bkc.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 05:15:03 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=f3DxStGgJek993D1cehKq/xWh+Hln1hSLPSjIkwzmek=;
	b=G6A+7vGTidGyHIQEmlOxnmkCZZuJY4CMYp9zJKoo0Xf5KiHXuUHDPV5daYR8b/PCv/
	AZOOT9bdkPWOqr6Idn0yTxq1TXTWscxqSk0I14KvmhIb6Jj0OX9LOzA4Ak9MHVie/FM2
	qWa6OPkJwGCodzJvuV/hkMTngLFFDthcuoV2UlJZiusAR3ZuqmsiUsPeDNV/mCLwnIfC
	ppkH9lUPVXxTM0c+dPDwppxXW0L+zYBJfHq8PSAyIInScgYAySWQslm1/nyprEKc9A7h
	xF+SPUxEV+UI4e9S8gBeZui+1qesygh0cmDs7o7CIm7/5LJIhCrTLVaRLkeePlUiIzNl
	DFtQ==
MIME-Version: 1.0
Received: by 10.204.128.155 with SMTP id k27mr6950264bks.26.1352726103542;
	Mon, 12 Nov 2012 05:15:03 -0800 (PST)
Received: by 10.205.81.74 with HTTP; Mon, 12 Nov 2012 05:15:03 -0800 (PST)
In-Reply-To: <CAL08nMGDeaQO6HAJypK+pzmsmg8wcz2=WnLWwX==R5MRBCyoPA@mail.gmail.com>
References: <CAP4+OA3-CsKxJizFpx-V48cCFKJc5KXNQzzY4oQ6pQ5pu0RFMg@mail.gmail.com>
	<CAL08nMGDeaQO6HAJypK+pzmsmg8wcz2=WnLWwX==R5MRBCyoPA@mail.gmail.com>
Date: Mon, 12 Nov 2012 07:15:03 -0600
Message-ID: <CAP4+OA064YvLQyPahGWoyxPhWv+v5LLCjBUOUg09QF7XKJ1tZg@mail.gmail.com>
From: D Sundstrom <sunds@peapod.net>
To: Pablo Llopis <pllopis@arcos.inf.uc3m.es>
X-Gm-Message-State: ALoCoQl2mXxZKdRe15qpvftkZs0ZozV8iyFtPqKzBh84+2aiZ9+jsrLrM+qFIICat1YSKdfGbDXm
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Immediate kernel panic using gntdev device
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Thank you Pablo.

It makes no difference if I run both the src-add and map from the same
domain or from different DomU domains.
Whichever DomU I run the map function in crashes immediately.

You mention Dom0.  I just want to be clear that I'd like to share
between two DomU domains.  Have you gotten this to work?

I also tried the userspace APIs provided by Xen such as
xc_gnttab_map_grant_ref() and these also crash.  Of course, these use
the same driver IOCTLs, so this isn't a surprise.

I'll need to see if I can get some debug info from the DomU kernel to
make progress.

If I can get this to work, are there any restrictions on sharing large
amounts of memory?  Say 160Mb?  Or are grant tables intended for a
small number of pages?

Thanks,
David



On Mon, Nov 12, 2012 at 5:36 AM, Pablo Llopis <pllopis@arcos.inf.uc3m.es> wrote:
>
> It is not clear from your output from which domain you are running
> each command. It looks like you are trying to issue a grant and map it
> from within the same domain. That's probably the reason it crashes.
> You are supposed to run this tool from both domains, running the calls
> which interface with gntalloc from one domain, and the calls which
> interface with gntdev from the other domain.
> In any case, the domid you have to specify in the map must be the
> domid of the domain which issued the grant. In other words, when
> creating a grant, the domid which is granted access is specified. When
> mapping a grant, the domid which issued the grant is specified. (i.e.
> If you did "src-add 8" from dom0 you should run map 0 1372 from domU
> 8)
>
> >

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 14:29:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 14:29:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXv0J-0001Oq-Bw; Mon, 12 Nov 2012 14:28:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TXv0I-0001Ol-3V
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 14:28:46 +0000
Received: from [85.158.139.211:14504] by server-11.bemta-5.messagelabs.com id
	54/3C-03409-D9701A05; Mon, 12 Nov 2012 14:28:45 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1352730522!19800526!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1NjgwMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28022 invoked from network); 12 Nov 2012 14:28:44 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 12 Nov 2012 14:28:44 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qACESdNf023105
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 12 Nov 2012 14:28:40 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qACESdex011096
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 12 Nov 2012 14:28:39 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qACEScQs009746; Mon, 12 Nov 2012 08:28:39 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Mon, 12 Nov 2012 06:28:38 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id DDEB240380; Mon, 12 Nov 2012 09:28:35 -0500 (EST)
Date: Mon, 12 Nov 2012 09:28:35 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121112142835.GG19860@phenom.dumpdata.com>
References: <20121110135931.GD23686@localhost.localdomain>
	<1352714084.27833.137.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352714084.27833.137.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "annie.li@oracle.com" <annie.li@oracle.com>,
	"marcos.matsunaga@oracle.com" <marcos.matsunaga@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] domU to domU networking issues in v3.7?
 (netserver/netperf failing to communicate)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 12, 2012 at 09:54:44AM +0000, Ian Campbell wrote:
> On Sat, 2012-11-10 at 13:59 +0000, Konrad Rzeszutek Wilk wrote:
> > Hey Ian, Xen-devel mailingl list,
> > 
> > I think the issue of 70% traffic lost was actually introduced in v3.6 or
> > perhaps v3.5. Annie and Marcos (CC-ed here) are looking to see which of
> > the releases introduced this. The issue we are seeing is that a domU
> > to domU communication breaks - this is with netperf/netserver talking to
> > each other.
> > 
> > Anyhow, I think the 3.7 compound page exacerbated the problem and also
> > (at least on some of my test hardware) exposed existing issues with
> > drivers. The issue I have is that the 'skge' driver has a bug that has
> > been there for ages (I tested way back to 3.0 and still saw it) were it
> > can not work with SWIOTLB. It is probably missing an pci_dma_sync
> > somewhere. 
> > 
> > Anyhow the compound page got me to look at Xen-SWIOTLB and that looks
> > OK. Even with synthetic driver (the fake one I posted somewhere) it
> > dealt with compound pages properly (with debug or non-debug Xen
> > hypervisor).
> 
> The debug build is probably most interesting since it deliberately
> allocates a non 1-1 p-to-m mapping so as to catch exactly these sorts of
> issues.

Right. My test env runs with that. And so far it only has issues
with the skge one.
> 
> > So was wondering if you had looked at this in more details? Any
> > ideas? Or would it be more prudent to ask that once we know for sure
> > which Linux release introduced the communication failures between
> > guests?
> 
> I've not looked at it any further I'm afraid.
> 
> If these changes (be they in 3.5 or later, or earlier) are exposing
> driver bugs then I suspect the netdev chaps would want to know about it.

Right. Annie (CC-ed here) mentioned to me that v3.5 looks to work ok.
And is off checking v3.6. v3.7 is definitly a no go.
> 
> FWIW I see the issue with tg3.

I should double-check that but I didn't get any issues with the tg3 I had.

I was running the netperf/netserver from/to to see if I could reproduce the
issues (70% loss) you described but did not have much luck.

> 
> Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 14:29:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 14:29:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXv0J-0001Oq-Bw; Mon, 12 Nov 2012 14:28:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TXv0I-0001Ol-3V
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 14:28:46 +0000
Received: from [85.158.139.211:14504] by server-11.bemta-5.messagelabs.com id
	54/3C-03409-D9701A05; Mon, 12 Nov 2012 14:28:45 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1352730522!19800526!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1NjgwMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28022 invoked from network); 12 Nov 2012 14:28:44 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 12 Nov 2012 14:28:44 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qACESdNf023105
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 12 Nov 2012 14:28:40 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qACESdex011096
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 12 Nov 2012 14:28:39 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qACEScQs009746; Mon, 12 Nov 2012 08:28:39 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Mon, 12 Nov 2012 06:28:38 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id DDEB240380; Mon, 12 Nov 2012 09:28:35 -0500 (EST)
Date: Mon, 12 Nov 2012 09:28:35 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121112142835.GG19860@phenom.dumpdata.com>
References: <20121110135931.GD23686@localhost.localdomain>
	<1352714084.27833.137.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352714084.27833.137.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "annie.li@oracle.com" <annie.li@oracle.com>,
	"marcos.matsunaga@oracle.com" <marcos.matsunaga@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] domU to domU networking issues in v3.7?
 (netserver/netperf failing to communicate)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 12, 2012 at 09:54:44AM +0000, Ian Campbell wrote:
> On Sat, 2012-11-10 at 13:59 +0000, Konrad Rzeszutek Wilk wrote:
> > Hey Ian, Xen-devel mailingl list,
> > 
> > I think the issue of 70% traffic lost was actually introduced in v3.6 or
> > perhaps v3.5. Annie and Marcos (CC-ed here) are looking to see which of
> > the releases introduced this. The issue we are seeing is that a domU
> > to domU communication breaks - this is with netperf/netserver talking to
> > each other.
> > 
> > Anyhow, I think the 3.7 compound page exacerbated the problem and also
> > (at least on some of my test hardware) exposed existing issues with
> > drivers. The issue I have is that the 'skge' driver has a bug that has
> > been there for ages (I tested way back to 3.0 and still saw it) were it
> > can not work with SWIOTLB. It is probably missing an pci_dma_sync
> > somewhere. 
> > 
> > Anyhow the compound page got me to look at Xen-SWIOTLB and that looks
> > OK. Even with synthetic driver (the fake one I posted somewhere) it
> > dealt with compound pages properly (with debug or non-debug Xen
> > hypervisor).
> 
> The debug build is probably most interesting since it deliberately
> allocates a non 1-1 p-to-m mapping so as to catch exactly these sorts of
> issues.

Right. My test env runs with that. And so far it only has issues
with the skge one.
> 
> > So was wondering if you had looked at this in more details? Any
> > ideas? Or would it be more prudent to ask that once we know for sure
> > which Linux release introduced the communication failures between
> > guests?
> 
> I've not looked at it any further I'm afraid.
> 
> If these changes (be they in 3.5 or later, or earlier) are exposing
> driver bugs then I suspect the netdev chaps would want to know about it.

Right. Annie (CC-ed here) mentioned to me that v3.5 looks to work ok.
And is off checking v3.6. v3.7 is definitly a no go.
> 
> FWIW I see the issue with tg3.

I should double-check that but I didn't get any issues with the tg3 I had.

I was running the netperf/netserver from/to to see if I could reproduce the
issues (70% loss) you described but did not have much luck.

> 
> Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 14:31:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 14:31:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXv2B-0001T9-Sf; Mon, 12 Nov 2012 14:30:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TXv2A-0001T0-6c
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 14:30:42 +0000
Received: from [85.158.143.99:7402] by server-2.bemta-4.messagelabs.com id
	96/FE-28922-11801A05; Mon, 12 Nov 2012 14:30:41 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-6.tower-216.messagelabs.com!1352730637!22571810!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10076 invoked from network); 12 Nov 2012 14:30:38 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 14:30:38 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148921743;
	Mon, 12 Nov 2012 09:30:10 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: key@linux.vnet.ibm.com, mail@srajiv.net, tpmdd@selhorst.net,
	tpmdd@sirrix.com, konrad.wilk@oracle.com, jeremy@goop.org,
	tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
	xen-devel@lists.xensource.com
Date: Mon, 12 Nov 2012 09:29:58 -0500
Message-Id: <1352730598-13904-1-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH v2] add xen-tpmfront.ko: Xen Virtual TPM
	frontend driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch ports the xen vtpm frontend driver for linux
from the linux-2.6.18-xen.hg tree to linux-stable. This
driver is designed be used with the mini-os tpmback driver
in Xen as part of the new mini-os virtual tpm subsystem.
See docs/misc/vtpm.txt in Xen and the xen-devel mailing list
for details.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 drivers/char/tpm/Kconfig             |   11 +
 drivers/char/tpm/Makefile            |    2 +
 drivers/char/tpm/tpm.h               |   10 +
 drivers/char/tpm/xen-tpmfront_if.c   |  688 ++++++++++++++++++++++++++++++++++
 drivers/char/tpm/xen-tpmfront_vtpm.c |  543 +++++++++++++++++++++++++++
 drivers/char/tpm/xen-tpmfront_vtpm.h |   55 +++
 include/xen/interface/io/tpmif.h     |   65 ++++
 7 files changed, 1374 insertions(+)
 create mode 100644 drivers/char/tpm/xen-tpmfront_if.c
 create mode 100644 drivers/char/tpm/xen-tpmfront_vtpm.c
 create mode 100644 drivers/char/tpm/xen-tpmfront_vtpm.h
 create mode 100644 include/xen/interface/io/tpmif.h

diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
index 915875e..23d272f 100644
--- a/drivers/char/tpm/Kconfig
+++ b/drivers/char/tpm/Kconfig
@@ -81,4 +81,15 @@ config TCG_IBMVTPM
 	  will be accessible from within Linux.  To compile this driver
 	  as a module, choose M here; the module will be called tpm_ibmvtpm.
 
+config TCG_XEN
+	tristate "XEN TPM Interface"
+	depends on TCG_TPM && XEN
+	---help---
+	  If you want to make TPM support available to a Xen user domain,
+	  say Yes and it will be accessible from within Linux. See
+	  the manpages for xl, xl.conf, and docs/misc/vtpm.txt in
+	  the Xen source repository for more details.
+	  To compile this driver as a module, choose M here; the module
+	  will be called xen-tpmfront.
+
 endif # TCG_TPM
diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
index 5b3fc8b..0161f05 100644
--- a/drivers/char/tpm/Makefile
+++ b/drivers/char/tpm/Makefile
@@ -17,3 +17,5 @@ obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
 obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
 obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
 obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
+obj-$(CONFIG_TCG_XEN) += xen-tpmfront.o
+xen-tpmfront-y = xen-tpmfront_if.o xen-tpmfront_vtpm.o
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 8ef7649..b575892 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -328,6 +328,16 @@ extern int tpm_pm_resume(struct device *);
 extern int wait_for_tpm_stat(struct tpm_chip *, u8, unsigned long,
 			     wait_queue_head_t *);
 
+static inline void *chip_get_private(const struct tpm_chip *chip)
+{
+	return chip->vendor.data;
+}
+
+static inline void chip_set_private(struct tpm_chip *chip, void *priv)
+{
+	chip->vendor.data = priv;
+}
+
 #ifdef CONFIG_ACPI
 extern int tpm_add_ppi(struct kobject *);
 extern void tpm_remove_ppi(struct kobject *);
diff --git a/drivers/char/tpm/xen-tpmfront_if.c b/drivers/char/tpm/xen-tpmfront_if.c
new file mode 100644
index 0000000..ba7fad8
--- /dev/null
+++ b/drivers/char/tpm/xen-tpmfront_if.c
@@ -0,0 +1,688 @@
+/*
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * Author: Stefan Berger, stefanb@us.ibm.com
+ * Grant table support: Mahadevan Gomathisankaran
+ *
+ * This code has been derived from drivers/xen/netfront/netfront.c
+ *
+ * Copyright (c) 2002-2004, K A Fraser
+ *
+ * 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.
+ */
+
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
+#include <linux/mutex.h>
+#include <linux/uaccess.h>
+#include <xen/events.h>
+#include <xen/interface/grant_table.h>
+#include <xen/interface/io/tpmif.h>
+#include <xen/grant_table.h>
+#include <xen/xenbus.h>
+#include <xen/page.h>
+#include "tpm.h"
+#include "xen-tpmfront_vtpm.h"
+
+#define GRANT_INVALID_REF 0
+
+/* local structures */
+struct tpm_private {
+	struct tpm_chip *chip;
+
+	struct tpmif_tx_interface *tx;
+	atomic_t refcnt;
+	unsigned int evtchn;
+	u8 is_connected;
+	u8 is_suspended;
+
+	spinlock_t tx_lock;
+
+	struct tx_buffer *tx_buffers[TPMIF_TX_RING_SIZE];
+
+	atomic_t tx_busy;
+	void *tx_remember;
+
+	domid_t backend_id;
+	wait_queue_head_t wait_q;
+
+	struct xenbus_device *dev;
+	int ring_ref;
+};
+
+struct tx_buffer {
+	unsigned int size;	/* available space in data */
+	unsigned int len;	/* used space in data */
+	unsigned char *data;	/* pointer to a page */
+};
+
+
+/* locally visible variables */
+static grant_ref_t gref_head;
+static struct tpm_private *my_priv;
+
+/* local function prototypes */
+static irqreturn_t tpmif_int(int irq,
+		void *tpm_priv);
+static void tpmif_rx_action(unsigned long unused);
+static int tpmif_connect(struct xenbus_device *dev,
+		struct tpm_private *tp,
+		domid_t domid);
+static DECLARE_TASKLET(tpmif_rx_tasklet, tpmif_rx_action, 0);
+static int tpmif_allocate_tx_buffers(struct tpm_private *tp);
+static void tpmif_free_tx_buffers(struct tpm_private *tp);
+static void tpmif_set_connected_state(struct tpm_private *tp,
+		u8 newstate);
+static int tpm_xmit(struct tpm_private *tp,
+		const u8 *buf, size_t count, int userbuffer,
+		void *remember);
+static void destroy_tpmring(struct tpm_private *tp);
+
+static inline int
+tx_buffer_copy(struct tx_buffer *txb, const u8 *src, int len,
+		int isuserbuffer)
+{
+	int copied = len;
+
+	if (len > txb->size)
+		copied = txb->size;
+	if (isuserbuffer) {
+		if (copy_from_user(txb->data, src, copied))
+			return -EFAULT;
+	} else {
+		memcpy(txb->data, src, copied);
+	}
+	txb->len = len;
+	return copied;
+}
+
+static inline struct tx_buffer *tx_buffer_alloc(void)
+{
+	struct tx_buffer *txb;
+
+	txb = kzalloc(sizeof(struct tx_buffer), GFP_KERNEL);
+	if (!txb)
+		return NULL;
+
+	txb->len = 0;
+	txb->size = PAGE_SIZE;
+	txb->data = (unsigned char *)__get_free_page(GFP_KERNEL);
+	if (txb->data == NULL) {
+		kfree(txb);
+		txb = NULL;
+	}
+
+	return txb;
+}
+
+
+static inline void tx_buffer_free(struct tx_buffer *txb)
+{
+	if (txb) {
+		free_page((long)txb->data);
+		kfree(txb);
+	}
+}
+
+/**************************************************************
+  Utility function for the tpm_private structure
+ **************************************************************/
+static void tpm_private_init(struct tpm_private *tp)
+{
+	spin_lock_init(&tp->tx_lock);
+	init_waitqueue_head(&tp->wait_q);
+	atomic_set(&tp->refcnt, 1);
+}
+
+static void tpm_private_put(void)
+{
+	if (!atomic_dec_and_test(&my_priv->refcnt))
+		return;
+
+	tpmif_free_tx_buffers(my_priv);
+	kfree(my_priv);
+	my_priv = NULL;
+}
+
+static struct tpm_private *tpm_private_get(void)
+{
+	int err;
+
+	if (my_priv) {
+		atomic_inc(&my_priv->refcnt);
+		return my_priv;
+	}
+
+	my_priv = kzalloc(sizeof(struct tpm_private), GFP_KERNEL);
+	if (!my_priv)
+		return NULL;
+
+	tpm_private_init(my_priv);
+	err = tpmif_allocate_tx_buffers(my_priv);
+	if (err < 0)
+		tpm_private_put();
+
+	return my_priv;
+}
+
+/**************************************************************
+
+  The interface to let the tpm plugin register its callback
+  function and send data to another partition using this module
+
+ **************************************************************/
+
+static DEFINE_MUTEX(suspend_lock);
+/*
+ * Send data via this module by calling this function
+ */
+int vtpm_vd_send(struct tpm_private *tp,
+		const u8 *buf, size_t count, void *ptr)
+{
+	int sent;
+
+	mutex_lock(&suspend_lock);
+	sent = tpm_xmit(tp, buf, count, 0, ptr);
+	mutex_unlock(&suspend_lock);
+
+	return sent;
+}
+
+/**************************************************************
+  XENBUS support code
+ **************************************************************/
+
+static int setup_tpmring(struct xenbus_device *dev,
+		struct tpm_private *tp)
+{
+	struct tpmif_tx_interface *sring;
+	int err;
+
+	tp->ring_ref = GRANT_INVALID_REF;
+
+	sring = (void *)__get_free_page(GFP_KERNEL);
+	if (!sring) {
+		xenbus_dev_fatal(dev, -ENOMEM, "allocating shared ring");
+		return -ENOMEM;
+	}
+	tp->tx = sring;
+
+	err = xenbus_grant_ring(dev, virt_to_mfn(tp->tx));
+	if (err < 0) {
+		free_page((unsigned long)sring);
+		tp->tx = NULL;
+		xenbus_dev_fatal(dev, err, "allocating grant reference");
+		goto fail;
+	}
+	tp->ring_ref = err;
+
+	err = tpmif_connect(dev, tp, dev->otherend_id);
+	if (err)
+		goto fail;
+
+	return 0;
+fail:
+	destroy_tpmring(tp);
+	return err;
+}
+
+
+static void destroy_tpmring(struct tpm_private *tp)
+{
+	tpmif_set_connected_state(tp, 0);
+
+	if (tp->ring_ref != GRANT_INVALID_REF) {
+		gnttab_end_foreign_access(tp->ring_ref,
+				0, (unsigned long)tp->tx);
+		tp->ring_ref = GRANT_INVALID_REF;
+		tp->tx = NULL;
+	}
+
+	if (tp->evtchn)
+		unbind_from_irqhandler(irq_from_evtchn(tp->evtchn), tp);
+
+	tp->evtchn = GRANT_INVALID_REF;
+}
+
+
+static int talk_to_backend(struct xenbus_device *dev,
+		struct tpm_private *tp)
+{
+	const char *message = NULL;
+	int err;
+	struct xenbus_transaction xbt;
+
+	err = setup_tpmring(dev, tp);
+	if (err) {
+		xenbus_dev_fatal(dev, err, "setting up ring");
+		goto out;
+	}
+
+again:
+	err = xenbus_transaction_start(&xbt);
+	if (err) {
+		xenbus_dev_fatal(dev, err, "starting transaction");
+		goto destroy_tpmring;
+	}
+
+	err = xenbus_printf(xbt, dev->nodename,
+			"ring-ref", "%u", tp->ring_ref);
+	if (err) {
+		message = "writing ring-ref";
+		goto abort_transaction;
+	}
+
+	err = xenbus_printf(xbt, dev->nodename, "event-channel", "%u",
+			tp->evtchn);
+	if (err) {
+		message = "writing event-channel";
+		goto abort_transaction;
+	}
+
+	err = xenbus_transaction_end(xbt, 0);
+	if (err == -EAGAIN)
+		goto again;
+	if (err) {
+		xenbus_dev_fatal(dev, err, "completing transaction");
+		goto destroy_tpmring;
+	}
+
+	xenbus_switch_state(dev, XenbusStateConnected);
+
+	return 0;
+
+abort_transaction:
+	xenbus_transaction_end(xbt, 1);
+	if (message)
+		xenbus_dev_error(dev, err, "%s", message);
+destroy_tpmring:
+	destroy_tpmring(tp);
+out:
+	return err;
+}
+
+/**
+ * Callback received when the backend's state changes.
+ */
+static void backend_changed(struct xenbus_device *dev,
+		enum xenbus_state backend_state)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+
+	switch (backend_state) {
+	case XenbusStateInitialising:
+	case XenbusStateInitWait:
+	case XenbusStateInitialised:
+	case XenbusStateReconfiguring:
+	case XenbusStateReconfigured:
+	case XenbusStateUnknown:
+		break;
+
+	case XenbusStateConnected:
+		tpmif_set_connected_state(tp, 1);
+		break;
+
+	case XenbusStateClosing:
+		tpmif_set_connected_state(tp, 0);
+		xenbus_frontend_closed(dev);
+		break;
+
+	case XenbusStateClosed:
+		tpmif_set_connected_state(tp, 0);
+		if (tp->is_suspended == 0)
+			device_unregister(&dev->dev);
+		xenbus_frontend_closed(dev);
+		break;
+	}
+}
+
+static int tpmfront_probe(struct xenbus_device *dev,
+		const struct xenbus_device_id *id)
+{
+	int err;
+	int handle;
+	struct tpm_private *tp = tpm_private_get();
+
+	if (!tp)
+		return -ENOMEM;
+
+	tp->chip = init_vtpm(&dev->dev, tp);
+	if (IS_ERR(tp->chip))
+		return PTR_ERR(tp->chip);
+
+	err = xenbus_scanf(XBT_NIL, dev->nodename,
+			"handle", "%i", &handle);
+	if (XENBUS_EXIST_ERR(err))
+		return err;
+
+	if (err < 0) {
+		xenbus_dev_fatal(dev, err, "reading virtual-device");
+		return err;
+	}
+
+	tp->dev = dev;
+
+	err = talk_to_backend(dev, tp);
+	if (err) {
+		tpm_private_put();
+		return err;
+	}
+
+	return 0;
+}
+
+
+static int __devexit tpmfront_remove(struct xenbus_device *dev)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+	destroy_tpmring(tp);
+	cleanup_vtpm(&dev->dev);
+	return 0;
+}
+
+static int tpmfront_suspend(struct xenbus_device *dev)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+	u32 ctr;
+
+	/* Take the lock, preventing any application from sending. */
+	mutex_lock(&suspend_lock);
+	tp->is_suspended = 1;
+
+	for (ctr = 0; atomic_read(&tp->tx_busy); ctr++) {
+		/* Wait for a request to be responded to. */
+		interruptible_sleep_on_timeout(&tp->wait_q, 100);
+	}
+
+	return 0;
+}
+
+static int tpmfront_suspend_finish(struct tpm_private *tp)
+{
+	tp->is_suspended = 0;
+	/* Allow applications to send again. */
+	mutex_unlock(&suspend_lock);
+	return 0;
+}
+
+static int tpmfront_resume(struct xenbus_device *dev)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+	destroy_tpmring(tp);
+	return talk_to_backend(dev, tp);
+}
+
+static int tpmif_connect(struct xenbus_device *dev,
+		struct tpm_private *tp,
+		domid_t domid)
+{
+	int err;
+
+	tp->backend_id = domid;
+	tp->evtchn = GRANT_INVALID_REF;
+
+	err = xenbus_alloc_evtchn(dev, &tp->evtchn);
+	if (err)
+		return err;
+
+	err = bind_evtchn_to_irqhandler(tp->evtchn, tpmif_int,
+			0, "tpmif", tp);
+	if (err <= 0)
+		return err;
+
+	return 0;
+}
+
+static const struct xenbus_device_id tpmfront_ids[] = {
+	{ "vtpm" },
+	{ "" }
+};
+MODULE_ALIAS("xen:vtpm");
+
+static DEFINE_XENBUS_DRIVER(tpmfront, ,
+		.probe = tpmfront_probe,
+		.remove =  __devexit_p(tpmfront_remove),
+		.resume = tpmfront_resume,
+		.otherend_changed = backend_changed,
+		.suspend = tpmfront_suspend,
+		);
+
+static int tpmif_allocate_tx_buffers(struct tpm_private *tp)
+{
+	unsigned int i;
+
+	for (i = 0; i < TPMIF_TX_RING_SIZE; i++) {
+		tp->tx_buffers[i] = tx_buffer_alloc();
+		if (!tp->tx_buffers[i]) {
+			tpmif_free_tx_buffers(tp);
+			return -ENOMEM;
+		}
+	}
+	return 0;
+}
+
+static void tpmif_free_tx_buffers(struct tpm_private *tp)
+{
+	unsigned int i;
+
+	for (i = 0; i < TPMIF_TX_RING_SIZE; i++)
+		tx_buffer_free(tp->tx_buffers[i]);
+}
+
+static void tpmif_rx_action(unsigned long priv)
+{
+	struct tpm_private *tp = (struct tpm_private *)priv;
+	int i = 0;
+	unsigned int received;
+	unsigned int offset = 0;
+	u8 *buffer;
+	struct tpmif_tx_request *tx = &tp->tx->ring[i].req;
+
+	atomic_set(&tp->tx_busy, 0);
+	wake_up_interruptible(&tp->wait_q);
+
+	received = tx->size;
+
+	buffer = kmalloc(received, GFP_ATOMIC);
+	if (!buffer)
+		return;
+
+	for (i = 0; i < TPMIF_TX_RING_SIZE && offset < received; i++) {
+		struct tx_buffer *txb = tp->tx_buffers[i];
+		struct tpmif_tx_request *tx;
+		unsigned int tocopy;
+
+		tx = &tp->tx->ring[i].req;
+		tocopy = tx->size;
+		if (tocopy > PAGE_SIZE)
+			tocopy = PAGE_SIZE;
+
+		memcpy(&buffer[offset], txb->data, tocopy);
+
+		gnttab_release_grant_reference(&gref_head, tx->ref);
+
+		offset += tocopy;
+	}
+
+	vtpm_vd_recv(tp->chip, buffer, received, tp->tx_remember);
+	kfree(buffer);
+}
+
+
+static irqreturn_t tpmif_int(int irq, void *tpm_priv)
+{
+	struct tpm_private *tp = tpm_priv;
+	unsigned long flags;
+
+	spin_lock_irqsave(&tp->tx_lock, flags);
+	tpmif_rx_tasklet.data = (unsigned long)tp;
+	tasklet_schedule(&tpmif_rx_tasklet);
+	spin_unlock_irqrestore(&tp->tx_lock, flags);
+
+	return IRQ_HANDLED;
+}
+
+
+static int tpm_xmit(struct tpm_private *tp,
+		const u8 *buf, size_t count, int isuserbuffer,
+		void *remember)
+{
+	struct tpmif_tx_request *tx;
+	int i;
+	unsigned int offset = 0;
+
+	spin_lock_irq(&tp->tx_lock);
+
+	if (unlikely(atomic_read(&tp->tx_busy))) {
+		spin_unlock_irq(&tp->tx_lock);
+		return -EBUSY;
+	}
+
+	if (tp->is_connected != 1) {
+		spin_unlock_irq(&tp->tx_lock);
+		return -EIO;
+	}
+
+	for (i = 0; count > 0 && i < TPMIF_TX_RING_SIZE; i++) {
+		struct tx_buffer *txb = tp->tx_buffers[i];
+		int copied;
+
+		if (!txb) {
+			spin_unlock_irq(&tp->tx_lock);
+			return -EFAULT;
+		}
+
+		copied = tx_buffer_copy(txb, &buf[offset], count,
+				isuserbuffer);
+		if (copied < 0) {
+			/* An error occurred */
+			spin_unlock_irq(&tp->tx_lock);
+			return copied;
+		}
+		count -= copied;
+		offset += copied;
+
+		tx = &tp->tx->ring[i].req;
+		tx->addr = virt_to_machine(txb->data).maddr;
+		tx->size = txb->len;
+		tx->unused = 0;
+
+		/* Get the granttable reference for this page. */
+		tx->ref = gnttab_claim_grant_reference(&gref_head);
+		if (tx->ref == -ENOSPC) {
+			spin_unlock_irq(&tp->tx_lock);
+			return -ENOSPC;
+		}
+		gnttab_grant_foreign_access_ref(tx->ref,
+				tp->backend_id,
+				virt_to_mfn(txb->data),
+				0 /*RW*/);
+		wmb();
+	}
+
+	atomic_set(&tp->tx_busy, 1);
+	tp->tx_remember = remember;
+
+	mb();
+
+	notify_remote_via_evtchn(tp->evtchn);
+
+	spin_unlock_irq(&tp->tx_lock);
+	return offset;
+}
+
+
+static void tpmif_notify_upperlayer(struct tpm_private *tp)
+{
+	/* Notify upper layer about the state of the connection to the BE. */
+	vtpm_vd_status(tp->chip, (tp->is_connected
+				? TPM_VD_STATUS_CONNECTED
+				: TPM_VD_STATUS_DISCONNECTED));
+}
+
+
+static void tpmif_set_connected_state(struct tpm_private *tp, u8 is_connected)
+{
+	/*
+	 * Don't notify upper layer if we are in suspend mode and
+	 * should disconnect - assumption is that we will resume
+	 * The mutex keeps apps from sending.
+	 */
+	if (is_connected == 0 && tp->is_suspended == 1)
+		return;
+
+	/*
+	 * Unlock the mutex if we are connected again
+	 * after being suspended - now resuming.
+	 * This also removes the suspend state.
+	 */
+	if (is_connected == 1 && tp->is_suspended == 1)
+		tpmfront_suspend_finish(tp);
+
+	if (is_connected != tp->is_connected) {
+		tp->is_connected = is_connected;
+		tpmif_notify_upperlayer(tp);
+	}
+}
+
+
+
+/* =================================================================
+ * Initialization function.
+ * =================================================================
+ */
+
+
+static int __init tpmif_init(void)
+{
+	struct tpm_private *tp;
+
+	if (!xen_domain())
+		return -ENODEV;
+
+	tp = tpm_private_get();
+	if (!tp)
+		return -ENOMEM;
+
+	if (gnttab_alloc_grant_references(TPMIF_TX_RING_SIZE,
+				&gref_head) < 0) {
+		tpm_private_put();
+		return -EFAULT;
+	}
+
+	return xenbus_register_frontend(&tpmfront_driver);
+}
+module_init(tpmif_init);
+
+static void __exit tpmif_exit(void)
+{
+	xenbus_unregister_driver(&tpmfront_driver);
+	gnttab_free_grant_references(gref_head);
+	tpm_private_put();
+}
+module_exit(tpmif_exit);
+
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/drivers/char/tpm/xen-tpmfront_vtpm.c b/drivers/char/tpm/xen-tpmfront_vtpm.c
new file mode 100644
index 0000000..d70f1df
--- /dev/null
+++ b/drivers/char/tpm/xen-tpmfront_vtpm.c
@@ -0,0 +1,543 @@
+/*
+ * Copyright (C) 2006 IBM Corporation
+ *
+ * Authors:
+ * Stefan Berger <stefanb@us.ibm.com>
+ *
+ * Generic device driver part for device drivers in a virtualized
+ * environment.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, version 2 of the
+ * License.
+ *
+ */
+
+#include <linux/uaccess.h>
+#include <linux/list.h>
+#include <linux/device.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include "tpm.h"
+#include "xen-tpmfront_vtpm.h"
+
+/* read status bits */
+enum {
+	STATUS_BUSY = 0x01,
+	STATUS_DATA_AVAIL = 0x02,
+	STATUS_READY = 0x04
+};
+
+struct transmission {
+	struct list_head next;
+
+	unsigned char *request;
+	size_t  request_len;
+	size_t  request_buflen;
+
+	unsigned char *response;
+	size_t  response_len;
+	size_t  response_buflen;
+
+	unsigned int flags;
+};
+
+enum {
+	TRANSMISSION_FLAG_WAS_QUEUED = 0x1
+};
+
+
+enum {
+	DATAEX_FLAG_QUEUED_ONLY = 0x1
+};
+
+
+/* local variables */
+
+/* local function prototypes */
+static int _vtpm_send_queued(struct tpm_chip *chip);
+
+
+/* =============================================================
+ * Some utility functions
+ * =============================================================
+ */
+static void vtpm_state_init(struct vtpm_state *vtpms)
+{
+	vtpms->current_request = NULL;
+	spin_lock_init(&vtpms->req_list_lock);
+	init_waitqueue_head(&vtpms->req_wait_queue);
+	INIT_LIST_HEAD(&vtpms->queued_requests);
+
+	vtpms->current_response = NULL;
+	spin_lock_init(&vtpms->resp_list_lock);
+	init_waitqueue_head(&vtpms->resp_wait_queue);
+
+	vtpms->disconnect_time = jiffies;
+}
+
+
+static inline struct transmission *transmission_alloc(void)
+{
+	return kzalloc(sizeof(struct transmission), GFP_ATOMIC);
+}
+
+static unsigned char *
+transmission_set_req_buffer(struct transmission *t,
+		unsigned char *buffer, size_t len)
+{
+	if (t->request_buflen < len) {
+		kfree(t->request);
+		t->request = kmalloc(len, GFP_KERNEL);
+		if (!t->request) {
+			t->request_buflen = 0;
+			return NULL;
+		}
+		t->request_buflen = len;
+	}
+
+	memcpy(t->request, buffer, len);
+	t->request_len = len;
+
+	return t->request;
+}
+
+static unsigned char *
+transmission_set_res_buffer(struct transmission *t,
+		const unsigned char *buffer, size_t len)
+{
+	if (t->response_buflen < len) {
+		kfree(t->response);
+		t->response = kmalloc(len, GFP_ATOMIC);
+		if (!t->response) {
+			t->response_buflen = 0;
+			return NULL;
+		}
+		t->response_buflen = len;
+	}
+
+	memcpy(t->response, buffer, len);
+	t->response_len = len;
+
+	return t->response;
+}
+
+static inline void transmission_free(struct transmission *t)
+{
+	kfree(t->request);
+	kfree(t->response);
+	kfree(t);
+}
+
+/* =============================================================
+ * Interface with the lower layer driver
+ * =============================================================
+ */
+/*
+ * Lower layer uses this function to make a response available.
+ */
+int vtpm_vd_recv(const struct tpm_chip *chip,
+		const unsigned char *buffer, size_t count,
+		void *ptr)
+{
+	unsigned long flags;
+	int ret_size = 0;
+	struct transmission *t;
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	/*
+	 * The list with requests must contain one request
+	 * only and the element there must be the one that
+	 * was passed to me from the front-end.
+	 */
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	if (vtpms->current_request != ptr) {
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		return 0;
+	}
+	t = vtpms->current_request;
+	if (t) {
+		transmission_free(t);
+		vtpms->current_request = NULL;
+	}
+
+	t = transmission_alloc();
+	if (t) {
+		if (!transmission_set_res_buffer(t, buffer, count)) {
+			transmission_free(t);
+			spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+			return -ENOMEM;
+		}
+		ret_size = count;
+		vtpms->current_response = t;
+		wake_up_interruptible(&vtpms->resp_wait_queue);
+	}
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+
+	return ret_size;
+}
+
+
+/*
+ * Lower layer indicates its status (connected/disconnected)
+ */
+void vtpm_vd_status(const struct tpm_chip *chip, u8 vd_status)
+{
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	vtpms->vd_status = vd_status;
+	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0)
+		vtpms->disconnect_time = jiffies;
+}
+
+/* =============================================================
+ * Interface with the generic TPM driver
+ * =============================================================
+ */
+static int vtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count)
+{
+	int rc = 0;
+	unsigned long flags;
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	/*
+	 * Check if the previous operation only queued the command
+	 * In this case there won't be a response, so I just
+	 * return from here and reset that flag. In any other
+	 * case I should receive a response from the back-end.
+	 */
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	if ((vtpms->flags & DATAEX_FLAG_QUEUED_ONLY) != 0) {
+		vtpms->flags &= ~DATAEX_FLAG_QUEUED_ONLY;
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		/*
+		 * The first few commands (measurements) must be
+		 * queued since it might not be possible to talk to the
+		 * TPM, yet.
+		 * Return a response of up to 30 '0's.
+		 */
+
+		count = min_t(size_t, count, 30);
+		memset(buf, 0x0, count);
+		return count;
+	}
+	/*
+	 * Check whether something is in the responselist and if
+	 * there's nothing in the list wait for something to appear.
+	 */
+
+	if (!vtpms->current_response) {
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		interruptible_sleep_on_timeout(&vtpms->resp_wait_queue,
+				1000);
+		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	}
+
+	if (vtpms->current_response) {
+		struct transmission *t = vtpms->current_response;
+		vtpms->current_response = NULL;
+		rc = min(count, t->response_len);
+		memcpy(buf, t->response, rc);
+		transmission_free(t);
+	}
+
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+	return rc;
+}
+
+static int vtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)
+{
+	int rc = 0;
+	unsigned long flags;
+	struct transmission *t = transmission_alloc();
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	if (!t)
+		return -ENOMEM;
+	/*
+	 * If there's a current request, it must be the
+	 * previous request that has timed out.
+	 */
+	spin_lock_irqsave(&vtpms->req_list_lock, flags);
+	if (vtpms->current_request != NULL) {
+		dev_warn(chip->dev, "Sending although there is a request outstanding.\n"
+				"         Previous request must have timed out.\n");
+		transmission_free(vtpms->current_request);
+		vtpms->current_request = NULL;
+	}
+	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+
+	/*
+	 * Queue the packet if the driver below is not
+	 * ready, yet, or there is any packet already
+	 * in the queue.
+	 * If the driver below is ready, unqueue all
+	 * packets first before sending our current
+	 * packet.
+	 * For each unqueued packet, except for the
+	 * last (=current) packet, call the function
+	 * tpm_xen_recv to wait for the response to come
+	 * back.
+	 */
+	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0) {
+		if (time_after(jiffies,
+					vtpms->disconnect_time + HZ * 10)) {
+			rc = -ENOENT;
+		} else {
+			goto queue_it;
+		}
+	} else {
+		/*
+		 * Send all queued packets.
+		 */
+		if (_vtpm_send_queued(chip) == 0) {
+
+			vtpms->current_request = t;
+
+			rc = vtpm_vd_send(vtpms->tpm_private,
+					buf,
+					count,
+					t);
+			/*
+			 * The generic TPM driver will call
+			 * the function to receive the response.
+			 */
+			if (rc < 0) {
+				vtpms->current_request = NULL;
+				goto queue_it;
+			}
+		} else {
+queue_it:
+			if (!transmission_set_req_buffer(t, buf, count)) {
+				transmission_free(t);
+				rc = -ENOMEM;
+				goto exit;
+			}
+			/*
+			 * An error occurred. Don't event try
+			 * to send the current request. Just
+			 * queue it.
+			 */
+			spin_lock_irqsave(&vtpms->req_list_lock, flags);
+			vtpms->flags |= DATAEX_FLAG_QUEUED_ONLY;
+			list_add_tail(&t->next, &vtpms->queued_requests);
+			spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+		}
+	}
+
+exit:
+	return rc;
+}
+
+
+/*
+ * Send all queued requests.
+ */
+static int _vtpm_send_queued(struct tpm_chip *chip)
+{
+	int rc;
+	int error = 0;
+	unsigned long flags;
+	unsigned char buffer[1];
+	struct vtpm_state *vtpms;
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	spin_lock_irqsave(&vtpms->req_list_lock, flags);
+
+	while (!list_empty(&vtpms->queued_requests)) {
+		/*
+		 * Need to dequeue them.
+		 * Read the result into a dummy buffer.
+		 */
+		struct transmission *qt = (struct transmission *)
+			vtpms->queued_requests.next;
+		list_del(&qt->next);
+		vtpms->current_request = qt;
+		spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+
+		rc = vtpm_vd_send(vtpms->tpm_private,
+				qt->request,
+				qt->request_len,
+				qt);
+
+		if (rc < 0) {
+			spin_lock_irqsave(&vtpms->req_list_lock, flags);
+			qt = vtpms->current_request;
+			if (qt != NULL) {
+				/*
+				 * requeue it at the beginning
+				 * of the list
+				 */
+				list_add(&qt->next,
+						&vtpms->queued_requests);
+			}
+			vtpms->current_request = NULL;
+			error = 1;
+			break;
+		}
+		/*
+		 * After this point qt is not valid anymore!
+		 * It is freed when the front-end is delivering
+		 * the data by calling tpm_recv
+		 */
+		/*
+		 * Receive response into provided dummy buffer
+		 */
+		rc = vtpm_recv(chip, buffer, sizeof(buffer));
+		spin_lock_irqsave(&vtpms->req_list_lock, flags);
+	}
+
+	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+
+	return error;
+}
+
+static void vtpm_cancel(struct tpm_chip *chip)
+{
+	unsigned long flags;
+	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+
+	if (!vtpms->current_response && vtpms->current_request) {
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		interruptible_sleep_on(&vtpms->resp_wait_queue);
+		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	}
+
+	if (vtpms->current_response) {
+		struct transmission *t = vtpms->current_response;
+		vtpms->current_response = NULL;
+		transmission_free(t);
+	}
+
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+}
+
+static u8 vtpm_status(struct tpm_chip *chip)
+{
+	u8 rc = 0;
+	unsigned long flags;
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	/*
+	 * Data are available if:
+	 *  - there's a current response
+	 *  - the last packet was queued only (this is fake, but necessary to
+	 *      get the generic TPM layer to call the receive function.)
+	 */
+	if (vtpms->current_response ||
+			0 != (vtpms->flags & DATAEX_FLAG_QUEUED_ONLY)) {
+		rc = STATUS_DATA_AVAIL;
+	} else if (!vtpms->current_response && !vtpms->current_request) {
+		rc = STATUS_READY;
+	}
+
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+	return rc;
+}
+
+static const struct file_operations vtpm_ops = {
+	.owner = THIS_MODULE,
+	.llseek = no_llseek,
+	.open = tpm_open,
+	.read = tpm_read,
+	.write = tpm_write,
+	.release = tpm_release,
+};
+
+static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
+static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
+static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);
+static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL);
+static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL);
+static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,
+		NULL);
+static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL);
+static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
+
+static struct attribute *vtpm_attrs[] = {
+	&dev_attr_pubek.attr,
+	&dev_attr_pcrs.attr,
+	&dev_attr_enabled.attr,
+	&dev_attr_active.attr,
+	&dev_attr_owned.attr,
+	&dev_attr_temp_deactivated.attr,
+	&dev_attr_caps.attr,
+	&dev_attr_cancel.attr,
+	NULL,
+};
+
+static struct attribute_group vtpm_attr_grp = { .attrs = vtpm_attrs };
+
+#define TPM_LONG_TIMEOUT   (10 * 60 * HZ)
+
+static struct tpm_vendor_specific tpm_vtpm = {
+	.recv = vtpm_recv,
+	.send = vtpm_send,
+	.cancel = vtpm_cancel,
+	.status = vtpm_status,
+	.req_complete_mask = STATUS_BUSY | STATUS_DATA_AVAIL,
+	.req_complete_val  = STATUS_DATA_AVAIL,
+	.req_canceled = STATUS_READY,
+	.attr_group = &vtpm_attr_grp,
+	.miscdev = {
+		.fops = &vtpm_ops,
+	},
+	.duration = {
+		TPM_LONG_TIMEOUT,
+		TPM_LONG_TIMEOUT,
+		TPM_LONG_TIMEOUT,
+	},
+};
+
+struct tpm_chip *init_vtpm(struct device *dev,
+		struct tpm_private *tp)
+{
+	long rc;
+	struct tpm_chip *chip;
+	struct vtpm_state *vtpms;
+
+	vtpms = kzalloc(sizeof(struct vtpm_state), GFP_KERNEL);
+	if (!vtpms)
+		return ERR_PTR(-ENOMEM);
+
+	vtpm_state_init(vtpms);
+	vtpms->tpm_private = tp;
+
+	chip = tpm_register_hardware(dev, &tpm_vtpm);
+	if (!chip) {
+		rc = -ENODEV;
+		goto err_free_mem;
+	}
+
+	chip_set_private(chip, vtpms);
+
+	return chip;
+
+err_free_mem:
+	kfree(vtpms);
+
+	return ERR_PTR(rc);
+}
+
+void cleanup_vtpm(struct device *dev)
+{
+	struct tpm_chip *chip = dev_get_drvdata(dev);
+	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
+	tpm_remove_hardware(dev);
+	kfree(vtpms);
+}
diff --git a/drivers/char/tpm/xen-tpmfront_vtpm.h b/drivers/char/tpm/xen-tpmfront_vtpm.h
new file mode 100644
index 0000000..16cf323
--- /dev/null
+++ b/drivers/char/tpm/xen-tpmfront_vtpm.h
@@ -0,0 +1,55 @@
+#ifndef XEN_TPMFRONT_VTPM_H
+#define XEN_TPMFRONT_VTPM_H
+
+struct tpm_chip;
+struct tpm_private;
+
+struct vtpm_state {
+	struct transmission *current_request;
+	spinlock_t           req_list_lock;
+	wait_queue_head_t    req_wait_queue;
+
+	struct list_head     queued_requests;
+
+	struct transmission *current_response;
+	spinlock_t           resp_list_lock;
+	wait_queue_head_t    resp_wait_queue;
+
+	u8                   vd_status;
+	u8                   flags;
+
+	unsigned long        disconnect_time;
+
+	/*
+	 * The following is a private structure of the underlying
+	 * driver. It is passed as parameter in the send function.
+	 */
+	struct tpm_private *tpm_private;
+};
+
+
+enum vdev_status {
+	TPM_VD_STATUS_DISCONNECTED = 0x0,
+	TPM_VD_STATUS_CONNECTED = 0x1
+};
+
+/* this function is called from tpm_vtpm.c */
+int vtpm_vd_send(struct tpm_private *tp,
+		const u8 *buf, size_t count, void *ptr);
+
+/* these functions are offered by tpm_vtpm.c */
+struct tpm_chip *init_vtpm(struct device *,
+		struct tpm_private *);
+void cleanup_vtpm(struct device *);
+int vtpm_vd_recv(const struct tpm_chip *chip,
+		const unsigned char *buffer, size_t count, void *ptr);
+void vtpm_vd_status(const struct tpm_chip *, u8 status);
+
+static inline struct tpm_private *tpm_private_from_dev(struct device *dev)
+{
+	struct tpm_chip *chip = dev_get_drvdata(dev);
+	struct vtpm_state *vtpms = (struct vtpm_state *)chip->vendor.data;
+	return vtpms->tpm_private;
+}
+
+#endif
diff --git a/include/xen/interface/io/tpmif.h b/include/xen/interface/io/tpmif.h
new file mode 100644
index 0000000..c9e7294
--- /dev/null
+++ b/include/xen/interface/io/tpmif.h
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * tpmif.h
+ *
+ * TPM I/O interface for Xen guest OSes.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (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.
+ *
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * Author: Stefan Berger, stefanb@us.ibm.com
+ * Grant table support: Mahadevan Gomathisankaran
+ *
+ * This code has been derived from tools/libxc/xen/io/netif.h
+ *
+ * Copyright (c) 2003-2004, Keir Fraser
+ */
+
+#ifndef __XEN_PUBLIC_IO_TPMIF_H__
+#define __XEN_PUBLIC_IO_TPMIF_H__
+
+#include "../grant_table.h"
+
+struct tpmif_tx_request {
+	unsigned long addr;   /* Machine address of packet.   */
+	grant_ref_t ref;      /* grant table access reference */
+	uint16_t unused;
+	uint16_t size;        /* Packet size in bytes.        */
+};
+struct tpmif_tx_request;
+
+/*
+ * The TPMIF_TX_RING_SIZE defines the number of pages the
+ * front-end and backend can exchange (= size of array).
+ */
+#define TPMIF_TX_RING_SIZE 1
+
+/* This structure must fit in a memory page. */
+
+struct tpmif_ring {
+	struct tpmif_tx_request req;
+};
+struct tpmif_ring;
+
+struct tpmif_tx_interface {
+	struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
+};
+struct tpmif_tx_interface;
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 14:31:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 14:31:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXv2B-0001T9-Sf; Mon, 12 Nov 2012 14:30:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TXv2A-0001T0-6c
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 14:30:42 +0000
Received: from [85.158.143.99:7402] by server-2.bemta-4.messagelabs.com id
	96/FE-28922-11801A05; Mon, 12 Nov 2012 14:30:41 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-6.tower-216.messagelabs.com!1352730637!22571810!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10076 invoked from network); 12 Nov 2012 14:30:38 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 14:30:38 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.148921743;
	Mon, 12 Nov 2012 09:30:10 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: key@linux.vnet.ibm.com, mail@srajiv.net, tpmdd@selhorst.net,
	tpmdd@sirrix.com, konrad.wilk@oracle.com, jeremy@goop.org,
	tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
	xen-devel@lists.xensource.com
Date: Mon, 12 Nov 2012 09:29:58 -0500
Message-Id: <1352730598-13904-1-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH v2] add xen-tpmfront.ko: Xen Virtual TPM
	frontend driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch ports the xen vtpm frontend driver for linux
from the linux-2.6.18-xen.hg tree to linux-stable. This
driver is designed be used with the mini-os tpmback driver
in Xen as part of the new mini-os virtual tpm subsystem.
See docs/misc/vtpm.txt in Xen and the xen-devel mailing list
for details.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 drivers/char/tpm/Kconfig             |   11 +
 drivers/char/tpm/Makefile            |    2 +
 drivers/char/tpm/tpm.h               |   10 +
 drivers/char/tpm/xen-tpmfront_if.c   |  688 ++++++++++++++++++++++++++++++++++
 drivers/char/tpm/xen-tpmfront_vtpm.c |  543 +++++++++++++++++++++++++++
 drivers/char/tpm/xen-tpmfront_vtpm.h |   55 +++
 include/xen/interface/io/tpmif.h     |   65 ++++
 7 files changed, 1374 insertions(+)
 create mode 100644 drivers/char/tpm/xen-tpmfront_if.c
 create mode 100644 drivers/char/tpm/xen-tpmfront_vtpm.c
 create mode 100644 drivers/char/tpm/xen-tpmfront_vtpm.h
 create mode 100644 include/xen/interface/io/tpmif.h

diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
index 915875e..23d272f 100644
--- a/drivers/char/tpm/Kconfig
+++ b/drivers/char/tpm/Kconfig
@@ -81,4 +81,15 @@ config TCG_IBMVTPM
 	  will be accessible from within Linux.  To compile this driver
 	  as a module, choose M here; the module will be called tpm_ibmvtpm.
 
+config TCG_XEN
+	tristate "XEN TPM Interface"
+	depends on TCG_TPM && XEN
+	---help---
+	  If you want to make TPM support available to a Xen user domain,
+	  say Yes and it will be accessible from within Linux. See
+	  the manpages for xl, xl.conf, and docs/misc/vtpm.txt in
+	  the Xen source repository for more details.
+	  To compile this driver as a module, choose M here; the module
+	  will be called xen-tpmfront.
+
 endif # TCG_TPM
diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
index 5b3fc8b..0161f05 100644
--- a/drivers/char/tpm/Makefile
+++ b/drivers/char/tpm/Makefile
@@ -17,3 +17,5 @@ obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
 obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
 obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
 obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
+obj-$(CONFIG_TCG_XEN) += xen-tpmfront.o
+xen-tpmfront-y = xen-tpmfront_if.o xen-tpmfront_vtpm.o
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 8ef7649..b575892 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -328,6 +328,16 @@ extern int tpm_pm_resume(struct device *);
 extern int wait_for_tpm_stat(struct tpm_chip *, u8, unsigned long,
 			     wait_queue_head_t *);
 
+static inline void *chip_get_private(const struct tpm_chip *chip)
+{
+	return chip->vendor.data;
+}
+
+static inline void chip_set_private(struct tpm_chip *chip, void *priv)
+{
+	chip->vendor.data = priv;
+}
+
 #ifdef CONFIG_ACPI
 extern int tpm_add_ppi(struct kobject *);
 extern void tpm_remove_ppi(struct kobject *);
diff --git a/drivers/char/tpm/xen-tpmfront_if.c b/drivers/char/tpm/xen-tpmfront_if.c
new file mode 100644
index 0000000..ba7fad8
--- /dev/null
+++ b/drivers/char/tpm/xen-tpmfront_if.c
@@ -0,0 +1,688 @@
+/*
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * Author: Stefan Berger, stefanb@us.ibm.com
+ * Grant table support: Mahadevan Gomathisankaran
+ *
+ * This code has been derived from drivers/xen/netfront/netfront.c
+ *
+ * Copyright (c) 2002-2004, K A Fraser
+ *
+ * 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.
+ */
+
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
+#include <linux/mutex.h>
+#include <linux/uaccess.h>
+#include <xen/events.h>
+#include <xen/interface/grant_table.h>
+#include <xen/interface/io/tpmif.h>
+#include <xen/grant_table.h>
+#include <xen/xenbus.h>
+#include <xen/page.h>
+#include "tpm.h"
+#include "xen-tpmfront_vtpm.h"
+
+#define GRANT_INVALID_REF 0
+
+/* local structures */
+struct tpm_private {
+	struct tpm_chip *chip;
+
+	struct tpmif_tx_interface *tx;
+	atomic_t refcnt;
+	unsigned int evtchn;
+	u8 is_connected;
+	u8 is_suspended;
+
+	spinlock_t tx_lock;
+
+	struct tx_buffer *tx_buffers[TPMIF_TX_RING_SIZE];
+
+	atomic_t tx_busy;
+	void *tx_remember;
+
+	domid_t backend_id;
+	wait_queue_head_t wait_q;
+
+	struct xenbus_device *dev;
+	int ring_ref;
+};
+
+struct tx_buffer {
+	unsigned int size;	/* available space in data */
+	unsigned int len;	/* used space in data */
+	unsigned char *data;	/* pointer to a page */
+};
+
+
+/* locally visible variables */
+static grant_ref_t gref_head;
+static struct tpm_private *my_priv;
+
+/* local function prototypes */
+static irqreturn_t tpmif_int(int irq,
+		void *tpm_priv);
+static void tpmif_rx_action(unsigned long unused);
+static int tpmif_connect(struct xenbus_device *dev,
+		struct tpm_private *tp,
+		domid_t domid);
+static DECLARE_TASKLET(tpmif_rx_tasklet, tpmif_rx_action, 0);
+static int tpmif_allocate_tx_buffers(struct tpm_private *tp);
+static void tpmif_free_tx_buffers(struct tpm_private *tp);
+static void tpmif_set_connected_state(struct tpm_private *tp,
+		u8 newstate);
+static int tpm_xmit(struct tpm_private *tp,
+		const u8 *buf, size_t count, int userbuffer,
+		void *remember);
+static void destroy_tpmring(struct tpm_private *tp);
+
+static inline int
+tx_buffer_copy(struct tx_buffer *txb, const u8 *src, int len,
+		int isuserbuffer)
+{
+	int copied = len;
+
+	if (len > txb->size)
+		copied = txb->size;
+	if (isuserbuffer) {
+		if (copy_from_user(txb->data, src, copied))
+			return -EFAULT;
+	} else {
+		memcpy(txb->data, src, copied);
+	}
+	txb->len = len;
+	return copied;
+}
+
+static inline struct tx_buffer *tx_buffer_alloc(void)
+{
+	struct tx_buffer *txb;
+
+	txb = kzalloc(sizeof(struct tx_buffer), GFP_KERNEL);
+	if (!txb)
+		return NULL;
+
+	txb->len = 0;
+	txb->size = PAGE_SIZE;
+	txb->data = (unsigned char *)__get_free_page(GFP_KERNEL);
+	if (txb->data == NULL) {
+		kfree(txb);
+		txb = NULL;
+	}
+
+	return txb;
+}
+
+
+static inline void tx_buffer_free(struct tx_buffer *txb)
+{
+	if (txb) {
+		free_page((long)txb->data);
+		kfree(txb);
+	}
+}
+
+/**************************************************************
+  Utility function for the tpm_private structure
+ **************************************************************/
+static void tpm_private_init(struct tpm_private *tp)
+{
+	spin_lock_init(&tp->tx_lock);
+	init_waitqueue_head(&tp->wait_q);
+	atomic_set(&tp->refcnt, 1);
+}
+
+static void tpm_private_put(void)
+{
+	if (!atomic_dec_and_test(&my_priv->refcnt))
+		return;
+
+	tpmif_free_tx_buffers(my_priv);
+	kfree(my_priv);
+	my_priv = NULL;
+}
+
+static struct tpm_private *tpm_private_get(void)
+{
+	int err;
+
+	if (my_priv) {
+		atomic_inc(&my_priv->refcnt);
+		return my_priv;
+	}
+
+	my_priv = kzalloc(sizeof(struct tpm_private), GFP_KERNEL);
+	if (!my_priv)
+		return NULL;
+
+	tpm_private_init(my_priv);
+	err = tpmif_allocate_tx_buffers(my_priv);
+	if (err < 0)
+		tpm_private_put();
+
+	return my_priv;
+}
+
+/**************************************************************
+
+  The interface to let the tpm plugin register its callback
+  function and send data to another partition using this module
+
+ **************************************************************/
+
+static DEFINE_MUTEX(suspend_lock);
+/*
+ * Send data via this module by calling this function
+ */
+int vtpm_vd_send(struct tpm_private *tp,
+		const u8 *buf, size_t count, void *ptr)
+{
+	int sent;
+
+	mutex_lock(&suspend_lock);
+	sent = tpm_xmit(tp, buf, count, 0, ptr);
+	mutex_unlock(&suspend_lock);
+
+	return sent;
+}
+
+/**************************************************************
+  XENBUS support code
+ **************************************************************/
+
+static int setup_tpmring(struct xenbus_device *dev,
+		struct tpm_private *tp)
+{
+	struct tpmif_tx_interface *sring;
+	int err;
+
+	tp->ring_ref = GRANT_INVALID_REF;
+
+	sring = (void *)__get_free_page(GFP_KERNEL);
+	if (!sring) {
+		xenbus_dev_fatal(dev, -ENOMEM, "allocating shared ring");
+		return -ENOMEM;
+	}
+	tp->tx = sring;
+
+	err = xenbus_grant_ring(dev, virt_to_mfn(tp->tx));
+	if (err < 0) {
+		free_page((unsigned long)sring);
+		tp->tx = NULL;
+		xenbus_dev_fatal(dev, err, "allocating grant reference");
+		goto fail;
+	}
+	tp->ring_ref = err;
+
+	err = tpmif_connect(dev, tp, dev->otherend_id);
+	if (err)
+		goto fail;
+
+	return 0;
+fail:
+	destroy_tpmring(tp);
+	return err;
+}
+
+
+static void destroy_tpmring(struct tpm_private *tp)
+{
+	tpmif_set_connected_state(tp, 0);
+
+	if (tp->ring_ref != GRANT_INVALID_REF) {
+		gnttab_end_foreign_access(tp->ring_ref,
+				0, (unsigned long)tp->tx);
+		tp->ring_ref = GRANT_INVALID_REF;
+		tp->tx = NULL;
+	}
+
+	if (tp->evtchn)
+		unbind_from_irqhandler(irq_from_evtchn(tp->evtchn), tp);
+
+	tp->evtchn = GRANT_INVALID_REF;
+}
+
+
+static int talk_to_backend(struct xenbus_device *dev,
+		struct tpm_private *tp)
+{
+	const char *message = NULL;
+	int err;
+	struct xenbus_transaction xbt;
+
+	err = setup_tpmring(dev, tp);
+	if (err) {
+		xenbus_dev_fatal(dev, err, "setting up ring");
+		goto out;
+	}
+
+again:
+	err = xenbus_transaction_start(&xbt);
+	if (err) {
+		xenbus_dev_fatal(dev, err, "starting transaction");
+		goto destroy_tpmring;
+	}
+
+	err = xenbus_printf(xbt, dev->nodename,
+			"ring-ref", "%u", tp->ring_ref);
+	if (err) {
+		message = "writing ring-ref";
+		goto abort_transaction;
+	}
+
+	err = xenbus_printf(xbt, dev->nodename, "event-channel", "%u",
+			tp->evtchn);
+	if (err) {
+		message = "writing event-channel";
+		goto abort_transaction;
+	}
+
+	err = xenbus_transaction_end(xbt, 0);
+	if (err == -EAGAIN)
+		goto again;
+	if (err) {
+		xenbus_dev_fatal(dev, err, "completing transaction");
+		goto destroy_tpmring;
+	}
+
+	xenbus_switch_state(dev, XenbusStateConnected);
+
+	return 0;
+
+abort_transaction:
+	xenbus_transaction_end(xbt, 1);
+	if (message)
+		xenbus_dev_error(dev, err, "%s", message);
+destroy_tpmring:
+	destroy_tpmring(tp);
+out:
+	return err;
+}
+
+/**
+ * Callback received when the backend's state changes.
+ */
+static void backend_changed(struct xenbus_device *dev,
+		enum xenbus_state backend_state)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+
+	switch (backend_state) {
+	case XenbusStateInitialising:
+	case XenbusStateInitWait:
+	case XenbusStateInitialised:
+	case XenbusStateReconfiguring:
+	case XenbusStateReconfigured:
+	case XenbusStateUnknown:
+		break;
+
+	case XenbusStateConnected:
+		tpmif_set_connected_state(tp, 1);
+		break;
+
+	case XenbusStateClosing:
+		tpmif_set_connected_state(tp, 0);
+		xenbus_frontend_closed(dev);
+		break;
+
+	case XenbusStateClosed:
+		tpmif_set_connected_state(tp, 0);
+		if (tp->is_suspended == 0)
+			device_unregister(&dev->dev);
+		xenbus_frontend_closed(dev);
+		break;
+	}
+}
+
+static int tpmfront_probe(struct xenbus_device *dev,
+		const struct xenbus_device_id *id)
+{
+	int err;
+	int handle;
+	struct tpm_private *tp = tpm_private_get();
+
+	if (!tp)
+		return -ENOMEM;
+
+	tp->chip = init_vtpm(&dev->dev, tp);
+	if (IS_ERR(tp->chip))
+		return PTR_ERR(tp->chip);
+
+	err = xenbus_scanf(XBT_NIL, dev->nodename,
+			"handle", "%i", &handle);
+	if (XENBUS_EXIST_ERR(err))
+		return err;
+
+	if (err < 0) {
+		xenbus_dev_fatal(dev, err, "reading virtual-device");
+		return err;
+	}
+
+	tp->dev = dev;
+
+	err = talk_to_backend(dev, tp);
+	if (err) {
+		tpm_private_put();
+		return err;
+	}
+
+	return 0;
+}
+
+
+static int __devexit tpmfront_remove(struct xenbus_device *dev)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+	destroy_tpmring(tp);
+	cleanup_vtpm(&dev->dev);
+	return 0;
+}
+
+static int tpmfront_suspend(struct xenbus_device *dev)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+	u32 ctr;
+
+	/* Take the lock, preventing any application from sending. */
+	mutex_lock(&suspend_lock);
+	tp->is_suspended = 1;
+
+	for (ctr = 0; atomic_read(&tp->tx_busy); ctr++) {
+		/* Wait for a request to be responded to. */
+		interruptible_sleep_on_timeout(&tp->wait_q, 100);
+	}
+
+	return 0;
+}
+
+static int tpmfront_suspend_finish(struct tpm_private *tp)
+{
+	tp->is_suspended = 0;
+	/* Allow applications to send again. */
+	mutex_unlock(&suspend_lock);
+	return 0;
+}
+
+static int tpmfront_resume(struct xenbus_device *dev)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+	destroy_tpmring(tp);
+	return talk_to_backend(dev, tp);
+}
+
+static int tpmif_connect(struct xenbus_device *dev,
+		struct tpm_private *tp,
+		domid_t domid)
+{
+	int err;
+
+	tp->backend_id = domid;
+	tp->evtchn = GRANT_INVALID_REF;
+
+	err = xenbus_alloc_evtchn(dev, &tp->evtchn);
+	if (err)
+		return err;
+
+	err = bind_evtchn_to_irqhandler(tp->evtchn, tpmif_int,
+			0, "tpmif", tp);
+	if (err <= 0)
+		return err;
+
+	return 0;
+}
+
+static const struct xenbus_device_id tpmfront_ids[] = {
+	{ "vtpm" },
+	{ "" }
+};
+MODULE_ALIAS("xen:vtpm");
+
+static DEFINE_XENBUS_DRIVER(tpmfront, ,
+		.probe = tpmfront_probe,
+		.remove =  __devexit_p(tpmfront_remove),
+		.resume = tpmfront_resume,
+		.otherend_changed = backend_changed,
+		.suspend = tpmfront_suspend,
+		);
+
+static int tpmif_allocate_tx_buffers(struct tpm_private *tp)
+{
+	unsigned int i;
+
+	for (i = 0; i < TPMIF_TX_RING_SIZE; i++) {
+		tp->tx_buffers[i] = tx_buffer_alloc();
+		if (!tp->tx_buffers[i]) {
+			tpmif_free_tx_buffers(tp);
+			return -ENOMEM;
+		}
+	}
+	return 0;
+}
+
+static void tpmif_free_tx_buffers(struct tpm_private *tp)
+{
+	unsigned int i;
+
+	for (i = 0; i < TPMIF_TX_RING_SIZE; i++)
+		tx_buffer_free(tp->tx_buffers[i]);
+}
+
+static void tpmif_rx_action(unsigned long priv)
+{
+	struct tpm_private *tp = (struct tpm_private *)priv;
+	int i = 0;
+	unsigned int received;
+	unsigned int offset = 0;
+	u8 *buffer;
+	struct tpmif_tx_request *tx = &tp->tx->ring[i].req;
+
+	atomic_set(&tp->tx_busy, 0);
+	wake_up_interruptible(&tp->wait_q);
+
+	received = tx->size;
+
+	buffer = kmalloc(received, GFP_ATOMIC);
+	if (!buffer)
+		return;
+
+	for (i = 0; i < TPMIF_TX_RING_SIZE && offset < received; i++) {
+		struct tx_buffer *txb = tp->tx_buffers[i];
+		struct tpmif_tx_request *tx;
+		unsigned int tocopy;
+
+		tx = &tp->tx->ring[i].req;
+		tocopy = tx->size;
+		if (tocopy > PAGE_SIZE)
+			tocopy = PAGE_SIZE;
+
+		memcpy(&buffer[offset], txb->data, tocopy);
+
+		gnttab_release_grant_reference(&gref_head, tx->ref);
+
+		offset += tocopy;
+	}
+
+	vtpm_vd_recv(tp->chip, buffer, received, tp->tx_remember);
+	kfree(buffer);
+}
+
+
+static irqreturn_t tpmif_int(int irq, void *tpm_priv)
+{
+	struct tpm_private *tp = tpm_priv;
+	unsigned long flags;
+
+	spin_lock_irqsave(&tp->tx_lock, flags);
+	tpmif_rx_tasklet.data = (unsigned long)tp;
+	tasklet_schedule(&tpmif_rx_tasklet);
+	spin_unlock_irqrestore(&tp->tx_lock, flags);
+
+	return IRQ_HANDLED;
+}
+
+
+static int tpm_xmit(struct tpm_private *tp,
+		const u8 *buf, size_t count, int isuserbuffer,
+		void *remember)
+{
+	struct tpmif_tx_request *tx;
+	int i;
+	unsigned int offset = 0;
+
+	spin_lock_irq(&tp->tx_lock);
+
+	if (unlikely(atomic_read(&tp->tx_busy))) {
+		spin_unlock_irq(&tp->tx_lock);
+		return -EBUSY;
+	}
+
+	if (tp->is_connected != 1) {
+		spin_unlock_irq(&tp->tx_lock);
+		return -EIO;
+	}
+
+	for (i = 0; count > 0 && i < TPMIF_TX_RING_SIZE; i++) {
+		struct tx_buffer *txb = tp->tx_buffers[i];
+		int copied;
+
+		if (!txb) {
+			spin_unlock_irq(&tp->tx_lock);
+			return -EFAULT;
+		}
+
+		copied = tx_buffer_copy(txb, &buf[offset], count,
+				isuserbuffer);
+		if (copied < 0) {
+			/* An error occurred */
+			spin_unlock_irq(&tp->tx_lock);
+			return copied;
+		}
+		count -= copied;
+		offset += copied;
+
+		tx = &tp->tx->ring[i].req;
+		tx->addr = virt_to_machine(txb->data).maddr;
+		tx->size = txb->len;
+		tx->unused = 0;
+
+		/* Get the granttable reference for this page. */
+		tx->ref = gnttab_claim_grant_reference(&gref_head);
+		if (tx->ref == -ENOSPC) {
+			spin_unlock_irq(&tp->tx_lock);
+			return -ENOSPC;
+		}
+		gnttab_grant_foreign_access_ref(tx->ref,
+				tp->backend_id,
+				virt_to_mfn(txb->data),
+				0 /*RW*/);
+		wmb();
+	}
+
+	atomic_set(&tp->tx_busy, 1);
+	tp->tx_remember = remember;
+
+	mb();
+
+	notify_remote_via_evtchn(tp->evtchn);
+
+	spin_unlock_irq(&tp->tx_lock);
+	return offset;
+}
+
+
+static void tpmif_notify_upperlayer(struct tpm_private *tp)
+{
+	/* Notify upper layer about the state of the connection to the BE. */
+	vtpm_vd_status(tp->chip, (tp->is_connected
+				? TPM_VD_STATUS_CONNECTED
+				: TPM_VD_STATUS_DISCONNECTED));
+}
+
+
+static void tpmif_set_connected_state(struct tpm_private *tp, u8 is_connected)
+{
+	/*
+	 * Don't notify upper layer if we are in suspend mode and
+	 * should disconnect - assumption is that we will resume
+	 * The mutex keeps apps from sending.
+	 */
+	if (is_connected == 0 && tp->is_suspended == 1)
+		return;
+
+	/*
+	 * Unlock the mutex if we are connected again
+	 * after being suspended - now resuming.
+	 * This also removes the suspend state.
+	 */
+	if (is_connected == 1 && tp->is_suspended == 1)
+		tpmfront_suspend_finish(tp);
+
+	if (is_connected != tp->is_connected) {
+		tp->is_connected = is_connected;
+		tpmif_notify_upperlayer(tp);
+	}
+}
+
+
+
+/* =================================================================
+ * Initialization function.
+ * =================================================================
+ */
+
+
+static int __init tpmif_init(void)
+{
+	struct tpm_private *tp;
+
+	if (!xen_domain())
+		return -ENODEV;
+
+	tp = tpm_private_get();
+	if (!tp)
+		return -ENOMEM;
+
+	if (gnttab_alloc_grant_references(TPMIF_TX_RING_SIZE,
+				&gref_head) < 0) {
+		tpm_private_put();
+		return -EFAULT;
+	}
+
+	return xenbus_register_frontend(&tpmfront_driver);
+}
+module_init(tpmif_init);
+
+static void __exit tpmif_exit(void)
+{
+	xenbus_unregister_driver(&tpmfront_driver);
+	gnttab_free_grant_references(gref_head);
+	tpm_private_put();
+}
+module_exit(tpmif_exit);
+
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/drivers/char/tpm/xen-tpmfront_vtpm.c b/drivers/char/tpm/xen-tpmfront_vtpm.c
new file mode 100644
index 0000000..d70f1df
--- /dev/null
+++ b/drivers/char/tpm/xen-tpmfront_vtpm.c
@@ -0,0 +1,543 @@
+/*
+ * Copyright (C) 2006 IBM Corporation
+ *
+ * Authors:
+ * Stefan Berger <stefanb@us.ibm.com>
+ *
+ * Generic device driver part for device drivers in a virtualized
+ * environment.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, version 2 of the
+ * License.
+ *
+ */
+
+#include <linux/uaccess.h>
+#include <linux/list.h>
+#include <linux/device.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include "tpm.h"
+#include "xen-tpmfront_vtpm.h"
+
+/* read status bits */
+enum {
+	STATUS_BUSY = 0x01,
+	STATUS_DATA_AVAIL = 0x02,
+	STATUS_READY = 0x04
+};
+
+struct transmission {
+	struct list_head next;
+
+	unsigned char *request;
+	size_t  request_len;
+	size_t  request_buflen;
+
+	unsigned char *response;
+	size_t  response_len;
+	size_t  response_buflen;
+
+	unsigned int flags;
+};
+
+enum {
+	TRANSMISSION_FLAG_WAS_QUEUED = 0x1
+};
+
+
+enum {
+	DATAEX_FLAG_QUEUED_ONLY = 0x1
+};
+
+
+/* local variables */
+
+/* local function prototypes */
+static int _vtpm_send_queued(struct tpm_chip *chip);
+
+
+/* =============================================================
+ * Some utility functions
+ * =============================================================
+ */
+static void vtpm_state_init(struct vtpm_state *vtpms)
+{
+	vtpms->current_request = NULL;
+	spin_lock_init(&vtpms->req_list_lock);
+	init_waitqueue_head(&vtpms->req_wait_queue);
+	INIT_LIST_HEAD(&vtpms->queued_requests);
+
+	vtpms->current_response = NULL;
+	spin_lock_init(&vtpms->resp_list_lock);
+	init_waitqueue_head(&vtpms->resp_wait_queue);
+
+	vtpms->disconnect_time = jiffies;
+}
+
+
+static inline struct transmission *transmission_alloc(void)
+{
+	return kzalloc(sizeof(struct transmission), GFP_ATOMIC);
+}
+
+static unsigned char *
+transmission_set_req_buffer(struct transmission *t,
+		unsigned char *buffer, size_t len)
+{
+	if (t->request_buflen < len) {
+		kfree(t->request);
+		t->request = kmalloc(len, GFP_KERNEL);
+		if (!t->request) {
+			t->request_buflen = 0;
+			return NULL;
+		}
+		t->request_buflen = len;
+	}
+
+	memcpy(t->request, buffer, len);
+	t->request_len = len;
+
+	return t->request;
+}
+
+static unsigned char *
+transmission_set_res_buffer(struct transmission *t,
+		const unsigned char *buffer, size_t len)
+{
+	if (t->response_buflen < len) {
+		kfree(t->response);
+		t->response = kmalloc(len, GFP_ATOMIC);
+		if (!t->response) {
+			t->response_buflen = 0;
+			return NULL;
+		}
+		t->response_buflen = len;
+	}
+
+	memcpy(t->response, buffer, len);
+	t->response_len = len;
+
+	return t->response;
+}
+
+static inline void transmission_free(struct transmission *t)
+{
+	kfree(t->request);
+	kfree(t->response);
+	kfree(t);
+}
+
+/* =============================================================
+ * Interface with the lower layer driver
+ * =============================================================
+ */
+/*
+ * Lower layer uses this function to make a response available.
+ */
+int vtpm_vd_recv(const struct tpm_chip *chip,
+		const unsigned char *buffer, size_t count,
+		void *ptr)
+{
+	unsigned long flags;
+	int ret_size = 0;
+	struct transmission *t;
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	/*
+	 * The list with requests must contain one request
+	 * only and the element there must be the one that
+	 * was passed to me from the front-end.
+	 */
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	if (vtpms->current_request != ptr) {
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		return 0;
+	}
+	t = vtpms->current_request;
+	if (t) {
+		transmission_free(t);
+		vtpms->current_request = NULL;
+	}
+
+	t = transmission_alloc();
+	if (t) {
+		if (!transmission_set_res_buffer(t, buffer, count)) {
+			transmission_free(t);
+			spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+			return -ENOMEM;
+		}
+		ret_size = count;
+		vtpms->current_response = t;
+		wake_up_interruptible(&vtpms->resp_wait_queue);
+	}
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+
+	return ret_size;
+}
+
+
+/*
+ * Lower layer indicates its status (connected/disconnected)
+ */
+void vtpm_vd_status(const struct tpm_chip *chip, u8 vd_status)
+{
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	vtpms->vd_status = vd_status;
+	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0)
+		vtpms->disconnect_time = jiffies;
+}
+
+/* =============================================================
+ * Interface with the generic TPM driver
+ * =============================================================
+ */
+static int vtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count)
+{
+	int rc = 0;
+	unsigned long flags;
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	/*
+	 * Check if the previous operation only queued the command
+	 * In this case there won't be a response, so I just
+	 * return from here and reset that flag. In any other
+	 * case I should receive a response from the back-end.
+	 */
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	if ((vtpms->flags & DATAEX_FLAG_QUEUED_ONLY) != 0) {
+		vtpms->flags &= ~DATAEX_FLAG_QUEUED_ONLY;
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		/*
+		 * The first few commands (measurements) must be
+		 * queued since it might not be possible to talk to the
+		 * TPM, yet.
+		 * Return a response of up to 30 '0's.
+		 */
+
+		count = min_t(size_t, count, 30);
+		memset(buf, 0x0, count);
+		return count;
+	}
+	/*
+	 * Check whether something is in the responselist and if
+	 * there's nothing in the list wait for something to appear.
+	 */
+
+	if (!vtpms->current_response) {
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		interruptible_sleep_on_timeout(&vtpms->resp_wait_queue,
+				1000);
+		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	}
+
+	if (vtpms->current_response) {
+		struct transmission *t = vtpms->current_response;
+		vtpms->current_response = NULL;
+		rc = min(count, t->response_len);
+		memcpy(buf, t->response, rc);
+		transmission_free(t);
+	}
+
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+	return rc;
+}
+
+static int vtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)
+{
+	int rc = 0;
+	unsigned long flags;
+	struct transmission *t = transmission_alloc();
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	if (!t)
+		return -ENOMEM;
+	/*
+	 * If there's a current request, it must be the
+	 * previous request that has timed out.
+	 */
+	spin_lock_irqsave(&vtpms->req_list_lock, flags);
+	if (vtpms->current_request != NULL) {
+		dev_warn(chip->dev, "Sending although there is a request outstanding.\n"
+				"         Previous request must have timed out.\n");
+		transmission_free(vtpms->current_request);
+		vtpms->current_request = NULL;
+	}
+	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+
+	/*
+	 * Queue the packet if the driver below is not
+	 * ready, yet, or there is any packet already
+	 * in the queue.
+	 * If the driver below is ready, unqueue all
+	 * packets first before sending our current
+	 * packet.
+	 * For each unqueued packet, except for the
+	 * last (=current) packet, call the function
+	 * tpm_xen_recv to wait for the response to come
+	 * back.
+	 */
+	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0) {
+		if (time_after(jiffies,
+					vtpms->disconnect_time + HZ * 10)) {
+			rc = -ENOENT;
+		} else {
+			goto queue_it;
+		}
+	} else {
+		/*
+		 * Send all queued packets.
+		 */
+		if (_vtpm_send_queued(chip) == 0) {
+
+			vtpms->current_request = t;
+
+			rc = vtpm_vd_send(vtpms->tpm_private,
+					buf,
+					count,
+					t);
+			/*
+			 * The generic TPM driver will call
+			 * the function to receive the response.
+			 */
+			if (rc < 0) {
+				vtpms->current_request = NULL;
+				goto queue_it;
+			}
+		} else {
+queue_it:
+			if (!transmission_set_req_buffer(t, buf, count)) {
+				transmission_free(t);
+				rc = -ENOMEM;
+				goto exit;
+			}
+			/*
+			 * An error occurred. Don't event try
+			 * to send the current request. Just
+			 * queue it.
+			 */
+			spin_lock_irqsave(&vtpms->req_list_lock, flags);
+			vtpms->flags |= DATAEX_FLAG_QUEUED_ONLY;
+			list_add_tail(&t->next, &vtpms->queued_requests);
+			spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+		}
+	}
+
+exit:
+	return rc;
+}
+
+
+/*
+ * Send all queued requests.
+ */
+static int _vtpm_send_queued(struct tpm_chip *chip)
+{
+	int rc;
+	int error = 0;
+	unsigned long flags;
+	unsigned char buffer[1];
+	struct vtpm_state *vtpms;
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	spin_lock_irqsave(&vtpms->req_list_lock, flags);
+
+	while (!list_empty(&vtpms->queued_requests)) {
+		/*
+		 * Need to dequeue them.
+		 * Read the result into a dummy buffer.
+		 */
+		struct transmission *qt = (struct transmission *)
+			vtpms->queued_requests.next;
+		list_del(&qt->next);
+		vtpms->current_request = qt;
+		spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+
+		rc = vtpm_vd_send(vtpms->tpm_private,
+				qt->request,
+				qt->request_len,
+				qt);
+
+		if (rc < 0) {
+			spin_lock_irqsave(&vtpms->req_list_lock, flags);
+			qt = vtpms->current_request;
+			if (qt != NULL) {
+				/*
+				 * requeue it at the beginning
+				 * of the list
+				 */
+				list_add(&qt->next,
+						&vtpms->queued_requests);
+			}
+			vtpms->current_request = NULL;
+			error = 1;
+			break;
+		}
+		/*
+		 * After this point qt is not valid anymore!
+		 * It is freed when the front-end is delivering
+		 * the data by calling tpm_recv
+		 */
+		/*
+		 * Receive response into provided dummy buffer
+		 */
+		rc = vtpm_recv(chip, buffer, sizeof(buffer));
+		spin_lock_irqsave(&vtpms->req_list_lock, flags);
+	}
+
+	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+
+	return error;
+}
+
+static void vtpm_cancel(struct tpm_chip *chip)
+{
+	unsigned long flags;
+	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+
+	if (!vtpms->current_response && vtpms->current_request) {
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		interruptible_sleep_on(&vtpms->resp_wait_queue);
+		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	}
+
+	if (vtpms->current_response) {
+		struct transmission *t = vtpms->current_response;
+		vtpms->current_response = NULL;
+		transmission_free(t);
+	}
+
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+}
+
+static u8 vtpm_status(struct tpm_chip *chip)
+{
+	u8 rc = 0;
+	unsigned long flags;
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	/*
+	 * Data are available if:
+	 *  - there's a current response
+	 *  - the last packet was queued only (this is fake, but necessary to
+	 *      get the generic TPM layer to call the receive function.)
+	 */
+	if (vtpms->current_response ||
+			0 != (vtpms->flags & DATAEX_FLAG_QUEUED_ONLY)) {
+		rc = STATUS_DATA_AVAIL;
+	} else if (!vtpms->current_response && !vtpms->current_request) {
+		rc = STATUS_READY;
+	}
+
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+	return rc;
+}
+
+static const struct file_operations vtpm_ops = {
+	.owner = THIS_MODULE,
+	.llseek = no_llseek,
+	.open = tpm_open,
+	.read = tpm_read,
+	.write = tpm_write,
+	.release = tpm_release,
+};
+
+static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
+static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
+static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);
+static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL);
+static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL);
+static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,
+		NULL);
+static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL);
+static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
+
+static struct attribute *vtpm_attrs[] = {
+	&dev_attr_pubek.attr,
+	&dev_attr_pcrs.attr,
+	&dev_attr_enabled.attr,
+	&dev_attr_active.attr,
+	&dev_attr_owned.attr,
+	&dev_attr_temp_deactivated.attr,
+	&dev_attr_caps.attr,
+	&dev_attr_cancel.attr,
+	NULL,
+};
+
+static struct attribute_group vtpm_attr_grp = { .attrs = vtpm_attrs };
+
+#define TPM_LONG_TIMEOUT   (10 * 60 * HZ)
+
+static struct tpm_vendor_specific tpm_vtpm = {
+	.recv = vtpm_recv,
+	.send = vtpm_send,
+	.cancel = vtpm_cancel,
+	.status = vtpm_status,
+	.req_complete_mask = STATUS_BUSY | STATUS_DATA_AVAIL,
+	.req_complete_val  = STATUS_DATA_AVAIL,
+	.req_canceled = STATUS_READY,
+	.attr_group = &vtpm_attr_grp,
+	.miscdev = {
+		.fops = &vtpm_ops,
+	},
+	.duration = {
+		TPM_LONG_TIMEOUT,
+		TPM_LONG_TIMEOUT,
+		TPM_LONG_TIMEOUT,
+	},
+};
+
+struct tpm_chip *init_vtpm(struct device *dev,
+		struct tpm_private *tp)
+{
+	long rc;
+	struct tpm_chip *chip;
+	struct vtpm_state *vtpms;
+
+	vtpms = kzalloc(sizeof(struct vtpm_state), GFP_KERNEL);
+	if (!vtpms)
+		return ERR_PTR(-ENOMEM);
+
+	vtpm_state_init(vtpms);
+	vtpms->tpm_private = tp;
+
+	chip = tpm_register_hardware(dev, &tpm_vtpm);
+	if (!chip) {
+		rc = -ENODEV;
+		goto err_free_mem;
+	}
+
+	chip_set_private(chip, vtpms);
+
+	return chip;
+
+err_free_mem:
+	kfree(vtpms);
+
+	return ERR_PTR(rc);
+}
+
+void cleanup_vtpm(struct device *dev)
+{
+	struct tpm_chip *chip = dev_get_drvdata(dev);
+	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
+	tpm_remove_hardware(dev);
+	kfree(vtpms);
+}
diff --git a/drivers/char/tpm/xen-tpmfront_vtpm.h b/drivers/char/tpm/xen-tpmfront_vtpm.h
new file mode 100644
index 0000000..16cf323
--- /dev/null
+++ b/drivers/char/tpm/xen-tpmfront_vtpm.h
@@ -0,0 +1,55 @@
+#ifndef XEN_TPMFRONT_VTPM_H
+#define XEN_TPMFRONT_VTPM_H
+
+struct tpm_chip;
+struct tpm_private;
+
+struct vtpm_state {
+	struct transmission *current_request;
+	spinlock_t           req_list_lock;
+	wait_queue_head_t    req_wait_queue;
+
+	struct list_head     queued_requests;
+
+	struct transmission *current_response;
+	spinlock_t           resp_list_lock;
+	wait_queue_head_t    resp_wait_queue;
+
+	u8                   vd_status;
+	u8                   flags;
+
+	unsigned long        disconnect_time;
+
+	/*
+	 * The following is a private structure of the underlying
+	 * driver. It is passed as parameter in the send function.
+	 */
+	struct tpm_private *tpm_private;
+};
+
+
+enum vdev_status {
+	TPM_VD_STATUS_DISCONNECTED = 0x0,
+	TPM_VD_STATUS_CONNECTED = 0x1
+};
+
+/* this function is called from tpm_vtpm.c */
+int vtpm_vd_send(struct tpm_private *tp,
+		const u8 *buf, size_t count, void *ptr);
+
+/* these functions are offered by tpm_vtpm.c */
+struct tpm_chip *init_vtpm(struct device *,
+		struct tpm_private *);
+void cleanup_vtpm(struct device *);
+int vtpm_vd_recv(const struct tpm_chip *chip,
+		const unsigned char *buffer, size_t count, void *ptr);
+void vtpm_vd_status(const struct tpm_chip *, u8 status);
+
+static inline struct tpm_private *tpm_private_from_dev(struct device *dev)
+{
+	struct tpm_chip *chip = dev_get_drvdata(dev);
+	struct vtpm_state *vtpms = (struct vtpm_state *)chip->vendor.data;
+	return vtpms->tpm_private;
+}
+
+#endif
diff --git a/include/xen/interface/io/tpmif.h b/include/xen/interface/io/tpmif.h
new file mode 100644
index 0000000..c9e7294
--- /dev/null
+++ b/include/xen/interface/io/tpmif.h
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * tpmif.h
+ *
+ * TPM I/O interface for Xen guest OSes.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (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.
+ *
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * Author: Stefan Berger, stefanb@us.ibm.com
+ * Grant table support: Mahadevan Gomathisankaran
+ *
+ * This code has been derived from tools/libxc/xen/io/netif.h
+ *
+ * Copyright (c) 2003-2004, Keir Fraser
+ */
+
+#ifndef __XEN_PUBLIC_IO_TPMIF_H__
+#define __XEN_PUBLIC_IO_TPMIF_H__
+
+#include "../grant_table.h"
+
+struct tpmif_tx_request {
+	unsigned long addr;   /* Machine address of packet.   */
+	grant_ref_t ref;      /* grant table access reference */
+	uint16_t unused;
+	uint16_t size;        /* Packet size in bytes.        */
+};
+struct tpmif_tx_request;
+
+/*
+ * The TPMIF_TX_RING_SIZE defines the number of pages the
+ * front-end and backend can exchange (= size of array).
+ */
+#define TPMIF_TX_RING_SIZE 1
+
+/* This structure must fit in a memory page. */
+
+struct tpmif_ring {
+	struct tpmif_tx_request req;
+};
+struct tpmif_ring;
+
+struct tpmif_tx_interface {
+	struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
+};
+struct tpmif_tx_interface;
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 14:43:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 14:43:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXvDN-0001oI-9v; Mon, 12 Nov 2012 14:42:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXvDM-0001oD-21
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 14:42:16 +0000
Received: from [85.158.143.35:53299] by server-3.bemta-4.messagelabs.com id
	A2/15-06841-7CA01A05; Mon, 12 Nov 2012 14:42:15 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1352731317!15551671!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20951 invoked from network); 12 Nov 2012 14:41:58 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-16.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 14:41:58 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; d="scan'208";a="15751997"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 14:41:50 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 14:41:49 +0000
Message-ID: <1352731308.27833.253.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Mon, 12 Nov 2012 14:41:48 +0000
In-Reply-To: <20121112142835.GG19860@phenom.dumpdata.com>
References: <20121110135931.GD23686@localhost.localdomain>
	<1352714084.27833.137.camel@zakaz.uk.xensource.com>
	<20121112142835.GG19860@phenom.dumpdata.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "annie.li@oracle.com" <annie.li@oracle.com>,
	"marcos.matsunaga@oracle.com" <marcos.matsunaga@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] domU to domU networking issues in v3.7?
 (netserver/netperf failing to communicate)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> > FWIW I see the issue with tg3.
> 
> I should double-check that but I didn't get any issues with the tg3 I had.
> 
> I was running the netperf/netserver from/to to see if I could reproduce the
> issues (70% loss) you described but did not have much luck.

I was running from offbox to a domU, if that helps. It only happened in
one direction but I can't recall which.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 14:43:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 14:43:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXvDN-0001oI-9v; Mon, 12 Nov 2012 14:42:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXvDM-0001oD-21
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 14:42:16 +0000
Received: from [85.158.143.35:53299] by server-3.bemta-4.messagelabs.com id
	A2/15-06841-7CA01A05; Mon, 12 Nov 2012 14:42:15 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1352731317!15551671!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20951 invoked from network); 12 Nov 2012 14:41:58 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-16.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 14:41:58 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; d="scan'208";a="15751997"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 14:41:50 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 14:41:49 +0000
Message-ID: <1352731308.27833.253.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Mon, 12 Nov 2012 14:41:48 +0000
In-Reply-To: <20121112142835.GG19860@phenom.dumpdata.com>
References: <20121110135931.GD23686@localhost.localdomain>
	<1352714084.27833.137.camel@zakaz.uk.xensource.com>
	<20121112142835.GG19860@phenom.dumpdata.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "annie.li@oracle.com" <annie.li@oracle.com>,
	"marcos.matsunaga@oracle.com" <marcos.matsunaga@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] domU to domU networking issues in v3.7?
 (netserver/netperf failing to communicate)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> > FWIW I see the issue with tg3.
> 
> I should double-check that but I didn't get any issues with the tg3 I had.
> 
> I was running the netperf/netserver from/to to see if I could reproduce the
> issues (70% loss) you described but did not have much luck.

I was running from offbox to a domU, if that helps. It only happened in
one direction but I can't recall which.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 14:51:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 14:51:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXvLL-0001xf-8p; Mon, 12 Nov 2012 14:50:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1TXvLJ-0001xW-Lk
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 14:50:29 +0000
Received: from [85.158.139.83:3943] by server-1.bemta-5.messagelabs.com id
	BD/DC-05877-4BC01A05; Mon, 12 Nov 2012 14:50:28 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-7.tower-182.messagelabs.com!1352731827!25945678!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18247 invoked from network); 12 Nov 2012 14:50:27 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Nov 2012 14:50:27 -0000
Received: from 102-64-ftth.on.nl ([88.159.64.102]:53686 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1TXvO1-0005ce-0v; Mon, 12 Nov 2012 15:53:17 +0100
Date: Mon, 12 Nov 2012 15:50:24 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <711956045.20121112155024@eikelenboom.it>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
In-Reply-To: <20121112142835.GG19860@phenom.dumpdata.com>
References: <20121110135931.GD23686@localhost.localdomain>
	<1352714084.27833.137.camel@zakaz.uk.xensource.com>
	<20121112142835.GG19860@phenom.dumpdata.com>
MIME-Version: 1.0
Cc: "annie.li@oracle.com" <annie.li@oracle.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"marcos.matsunaga@oracle.com" <marcos.matsunaga@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] domU to domU networking issues in v3.7?
	(netserver/netperf failing to communicate)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


Monday, November 12, 2012, 3:28:35 PM, you wrote:

> On Mon, Nov 12, 2012 at 09:54:44AM +0000, Ian Campbell wrote:
>> On Sat, 2012-11-10 at 13:59 +0000, Konrad Rzeszutek Wilk wrote:
>> > Hey Ian, Xen-devel mailingl list,
>> > 
>> > I think the issue of 70% traffic lost was actually introduced in v3.6 or
>> > perhaps v3.5. Annie and Marcos (CC-ed here) are looking to see which of
>> > the releases introduced this. The issue we are seeing is that a domU
>> > to domU communication breaks - this is with netperf/netserver talking to
>> > each other.
>> > 
>> > Anyhow, I think the 3.7 compound page exacerbated the problem and also
>> > (at least on some of my test hardware) exposed existing issues with
>> > drivers. The issue I have is that the 'skge' driver has a bug that has
>> > been there for ages (I tested way back to 3.0 and still saw it) were it
>> > can not work with SWIOTLB. It is probably missing an pci_dma_sync
>> > somewhere. 
>> > 
>> > Anyhow the compound page got me to look at Xen-SWIOTLB and that looks
>> > OK. Even with synthetic driver (the fake one I posted somewhere) it
>> > dealt with compound pages properly (with debug or non-debug Xen
>> > hypervisor).
>> 
>> The debug build is probably most interesting since it deliberately
>> allocates a non 1-1 p-to-m mapping so as to catch exactly these sorts of
>> issues.

> Right. My test env runs with that. And so far it only has issues
> with the skge one.
>> 
>> > So was wondering if you had looked at this in more details? Any
>> > ideas? Or would it be more prudent to ask that once we know for sure
>> > which Linux release introduced the communication failures between
>> > guests?
>> 
>> I've not looked at it any further I'm afraid.
>> 
>> If these changes (be they in 3.5 or later, or earlier) are exposing
>> driver bugs then I suspect the netdev chaps would want to know about it.

> Right. Annie (CC-ed here) mentioned to me that v3.5 looks to work ok.
> And is off checking v3.6. v3.7 is definitly a no go.
>> 
>> FWIW I see the issue with tg3.

After the issues with netback where fixed, I'm seeing the issues with net_front reverting the single commit 5640f7685831e088fe6c2e1f863a6805962f8e81 (that was pointed out for netback) also makes these disappear.
I haven't seen issues with netfront and netback before this commit. FWIW: the hardware nics in this machine are two r8169 's.

--
Sander

> I should double-check that but I didn't get any issues with the tg3 I had.

> I was running the netperf/netserver from/to to see if I could reproduce the
> issues (70% loss) you described but did not have much luck.

>> 
>> Ian.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 14:51:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 14:51:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXvLL-0001xf-8p; Mon, 12 Nov 2012 14:50:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1TXvLJ-0001xW-Lk
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 14:50:29 +0000
Received: from [85.158.139.83:3943] by server-1.bemta-5.messagelabs.com id
	BD/DC-05877-4BC01A05; Mon, 12 Nov 2012 14:50:28 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-7.tower-182.messagelabs.com!1352731827!25945678!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18247 invoked from network); 12 Nov 2012 14:50:27 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Nov 2012 14:50:27 -0000
Received: from 102-64-ftth.on.nl ([88.159.64.102]:53686 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1TXvO1-0005ce-0v; Mon, 12 Nov 2012 15:53:17 +0100
Date: Mon, 12 Nov 2012 15:50:24 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <711956045.20121112155024@eikelenboom.it>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
In-Reply-To: <20121112142835.GG19860@phenom.dumpdata.com>
References: <20121110135931.GD23686@localhost.localdomain>
	<1352714084.27833.137.camel@zakaz.uk.xensource.com>
	<20121112142835.GG19860@phenom.dumpdata.com>
MIME-Version: 1.0
Cc: "annie.li@oracle.com" <annie.li@oracle.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"marcos.matsunaga@oracle.com" <marcos.matsunaga@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] domU to domU networking issues in v3.7?
	(netserver/netperf failing to communicate)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


Monday, November 12, 2012, 3:28:35 PM, you wrote:

> On Mon, Nov 12, 2012 at 09:54:44AM +0000, Ian Campbell wrote:
>> On Sat, 2012-11-10 at 13:59 +0000, Konrad Rzeszutek Wilk wrote:
>> > Hey Ian, Xen-devel mailingl list,
>> > 
>> > I think the issue of 70% traffic lost was actually introduced in v3.6 or
>> > perhaps v3.5. Annie and Marcos (CC-ed here) are looking to see which of
>> > the releases introduced this. The issue we are seeing is that a domU
>> > to domU communication breaks - this is with netperf/netserver talking to
>> > each other.
>> > 
>> > Anyhow, I think the 3.7 compound page exacerbated the problem and also
>> > (at least on some of my test hardware) exposed existing issues with
>> > drivers. The issue I have is that the 'skge' driver has a bug that has
>> > been there for ages (I tested way back to 3.0 and still saw it) were it
>> > can not work with SWIOTLB. It is probably missing an pci_dma_sync
>> > somewhere. 
>> > 
>> > Anyhow the compound page got me to look at Xen-SWIOTLB and that looks
>> > OK. Even with synthetic driver (the fake one I posted somewhere) it
>> > dealt with compound pages properly (with debug or non-debug Xen
>> > hypervisor).
>> 
>> The debug build is probably most interesting since it deliberately
>> allocates a non 1-1 p-to-m mapping so as to catch exactly these sorts of
>> issues.

> Right. My test env runs with that. And so far it only has issues
> with the skge one.
>> 
>> > So was wondering if you had looked at this in more details? Any
>> > ideas? Or would it be more prudent to ask that once we know for sure
>> > which Linux release introduced the communication failures between
>> > guests?
>> 
>> I've not looked at it any further I'm afraid.
>> 
>> If these changes (be they in 3.5 or later, or earlier) are exposing
>> driver bugs then I suspect the netdev chaps would want to know about it.

> Right. Annie (CC-ed here) mentioned to me that v3.5 looks to work ok.
> And is off checking v3.6. v3.7 is definitly a no go.
>> 
>> FWIW I see the issue with tg3.

After the issues with netback where fixed, I'm seeing the issues with net_front reverting the single commit 5640f7685831e088fe6c2e1f863a6805962f8e81 (that was pointed out for netback) also makes these disappear.
I haven't seen issues with netfront and netback before this commit. FWIW: the hardware nics in this machine are two r8169 's.

--
Sander

> I should double-check that but I didn't get any issues with the tg3 I had.

> I was running the netperf/netserver from/to to see if I could reproduce the
> issues (70% loss) you described but did not have much luck.

>> 
>> Ian.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 15:02:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 15:02:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXvW2-0002Cy-FN; Mon, 12 Nov 2012 15:01:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <zhigang.x.wang@oracle.com>) id 1TXvW0-0002Ct-O8
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 15:01:33 +0000
Received: from [193.109.254.147:37403] by server-16.bemta-14.messagelabs.com
	id 5C/FF-09215-B4F01A05; Mon, 12 Nov 2012 15:01:31 +0000
X-Env-Sender: zhigang.x.wang@oracle.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1352732486!8530758!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNDU3NDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2520 invoked from network); 12 Nov 2012 15:01:27 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-12.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 15:01:27 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qACF1Mvf004305
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 12 Nov 2012 15:01:23 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qACF1L65012918
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 12 Nov 2012 15:01:22 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qACF1Lu2030706; Mon, 12 Nov 2012 09:01:21 -0600
Received: from zhigang.us.oracle.com (/10.149.236.110)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Mon, 12 Nov 2012 07:01:20 -0800
Message-ID: <50A10F3E.2030808@oracle.com>
Date: Mon, 12 Nov 2012 10:01:18 -0500
From: Zhigang Wang <zhigang.x.wang@oracle.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120827 Thunderbird/15.0
MIME-Version: 1.0
To: "Keir Fraser" <keir@xen.org>, Jan Beulich <jbeulich@suse.com>
Content-Type: multipart/mixed; boundary="------------010608060702090002000106"
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel <xen-devel@lists.xen.org>
Subject: [Xen-devel] VM memory allocation speed with cs 26056
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.
--------------010608060702090002000106
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hi Keir/Jan,

Recently I got a chance to access a big machine (2T mem/160 cpus) and I tested
your patch: http://xenbits.xen.org/hg/xen-unstable.hg/rev/177fdda0be56

Attached is the result.

Test environment old:

      # xm info
      host                   : ovs-3f-9e-04
      release                : 2.6.39-300.17.1.el5uek
      version                : #1 SMP Fri Oct 19 11:30:08 PDT 2012
      machine                : x86_64
      nr_cpus                : 160
      nr_nodes               : 8
      cores_per_socket       : 10
      threads_per_core       : 2
      cpu_mhz                : 2394
      hw_caps                :
bfebfbff:2c100800:00000000:00003f40:02bee3ff:00000000:00000001:00000000
      virt_caps              : hvm hvm_directio
      total_memory           : 2097142
      free_memory            : 2040108
      free_cpus              : 0
      xen_major              : 4
      xen_minor              : 1
      xen_extra              : .3OVM
      xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32
hvm-3.0-x86_32p hvm-3.0-x86_64
      xen_scheduler          : credit
      xen_pagesize           : 4096
      platform_params        : virt_start=0xffff800000000000
      xen_changeset          : unavailable
      xen_commandline        : dom0_mem=31390M no-bootscrub
      cc_compiler            : gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)
      cc_compile_by          : mockbuild
      cc_compile_domain      : us.oracle.com
      cc_compile_date        : Fri Oct 19 21:34:08 PDT 2012
      xend_config_format     : 4

      # uname -a
      Linux ovs-3f-9e-04 2.6.39-300.17.1.el5uek #1 SMP Fri Oct 19 11:30:08 PDT
2012 x86_64 x86_64 x86_64 GNU/Linux

      # cat /boot/grub/grub.conf
      ...
      kernel /xen.gz dom0_mem=31390M no-bootscrub dom0_vcpus_pin dom0_max_vcpus=32

Test environment new: old env + cs 26056

Test script: test-vm-memory-allocation.sh (attached)

My conclusion from the test:

  - HVM create time is greatly reduced.
  - PVM create time is increased dramatically for 4G, 8G, 16G, 32G, 64G, 128G.
  - HVM/PVM destroy time is not affected.
  - If most of our customers are using PVM, I think this patch is bad: because
most VM memory should under 128G.
  - If they are using HVM, then this patch is great.

Questions for discussion:

  - Did you get the same result?
  - It seems this result is not ideal. We may need to improve it.

Please note: Imay not have access to the same machine for awhile.

Thanks,

Zhigang


--------------010608060702090002000106
Content-Type: application/pdf;
 name="result.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="result.pdf"

JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9MZW5ndGggNjcvRmlsdGVyL0ZsYXRlRGVjb2Rl
Pj5zdHJlYW0KeJwzUDBU0DVUMFAwMzQCksm5XIVcTiFcxmYKpuZmCiEpXK4hXIFchQogJQZA
EigBRMm5CvoRaYYKLvkKgVwAv0kNugplbmRzdHJlYW0KZW5kb2JqCjUgMCBvYmoKPDwvUGFy
ZW50IDQgMCBSL0NvbnRlbnRzIDMgMCBSL1R5cGUvUGFnZS9SZXNvdXJjZXM8PC9YT2JqZWN0
PDwvWGYxIDEgMCBSPj4vUHJvY1NldCBbL1BERiAvVGV4dCAvSW1hZ2VCIC9JbWFnZUMgL0lt
YWdlSV0+Pi9NZWRpYUJveFswIDAgNjEyIDc5Ml0vUm90YXRlIDkwPj4KZW5kb2JqCjYgMCBv
YmoKP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kdWNlcihpVGV4dCAyLjEuNiBieSAx
VDNYVCkvTW9kRGF0ZShEOjIwMTIxMTEwMDkwNzMwLTA4JzAwJykvQ3JlYXRpb25EYXRlKEQ6
MjAxMjExMTAwOTA3MzAtMDgnMDAnKT4+CmVuZG9iagp4cmVmCjAgMTIKMDAwMDAwMDAwMCA2
NTUzNSBmIAowMDAwMDIzNDAyIDAwMDAwIG4gCjAwMDAwMjMyNzUgMDAwMDAgbiAKMDAwMDAw
MDAxNSAwMDAwMCBuIAowMDAwMDI4Nzk4IDAwMDAwIG4gCjAwMDAwMDAxNDggMDAwMDAgbiAK
MDAwMDAwMDMxOSAwMDAwMCBuIAowMDAwMDIyMjgwIDAwMDAwIG4gCjAwMDAwMjI0NjAgMDAw
MDAgbiAKMDAwMDAyMjgxMSAwMDAwMCBuIAowMDAwMDI4ODYxIDAwMDAwIG4gCjAwMDAwMjg5
MDcgMDAwMDAgbiAKdHJhaWxlcgo8PC9Sb290IDEwIDAgUi9JRCBbPDFlYjUxODQyYzc3ZTA1
YzA3YmI1ZjU1MWFjODcyOTlhPjw3NGNjMDNlZDlmMjY0YmMyOGU5OWQ5OGRiYThhZmYwNz5d
L0luZm8gMTEgMCBSL1NpemUgMTI+PgpzdGFydHhyZWYKMjkwMzAKJSVFT0YK
--------------010608060702090002000106
Content-Type: text/csv;
 name="result.csv"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="result.csv"

memory_size_gb,hvm_old_create,hvm_new_create,pvm_old_create,pvm_new_create,hvm_old_destroy,hvm_new_destroy,pvm_old_destroy,pvm_new_destroy
1,1.159,1.093,3.222,4.034,1.024,1.185,1.020,1.040
2,1.316,0.888,4.408,5.443,1.327,1.961,1.979,1.990
4,1.382,0.962,4.622,8.367,3.633,2.858,2.893,2.901
8,1.440,1.057,4.969,14.272,4.035,5.305,5.337,6.668
16,1.539,1.264,5.607,25.758,12.862,12.828,12.865,12.886
32,1.754,1.665,7.066,48.729,25.302,19.945,19.978,19.987
64,2.188,2.499,9.752,97.022,28.790,39.350,50.048,50.118
128,10.949,4.090,15.234,189.261,57.128,78.240,78.440,78.432
256,418.667,10.275,452.320,375.961,114.851,156.496,198.798,156.391
512,430.449,14.831,494.971,752.235,355.738,353.989,354.502,382.305
1024,867.145,28.570,1004.788,818.385,626.623,747.762,751.686,752.019
1500,1716.501,38.601,1968.900,1599.078,1083.900,1006.805,1000.907,1006.042

--------------010608060702090002000106
Content-Type: application/x-shellscript;
 name="test-vm-memory-allocation.sh"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="test-vm-memory-allocation.sh"

IyEvYmluL2Jhc2gKCnNldCAtZQoKZXhwb3J0IFRJTUVGT1JNQVQ9IiVSIgoKY2ZnPS90bXAv
cHZtLmNmZwoKZm9yIG1lbV9nYiBpbiAxIDIgNCA4IDE2IDMyIDY0IDEyOCAyNTYgNTEyIDEw
MjQgMTUwMDsgZG8KICAgIG1lbV9tYj0kKCgkbWVtX2diKjEwMjQpKQogICAgdm09JChncmVw
ICJebmFtZSIgJGNmZyB8IHNlZCAtZSAncy8gLy9nJyB8IHNlZCAtZSAncy8iLy9nJyB8IHNl
ZCAtZSAicy8nLy9nIiB8IGN1dCAtZD0gLWYyKQogICAgc2VkIC1pIC1lICJzL21lbW9yeSA9
IC4qL21lbW9yeSA9ICR7bWVtX21ifS9nIiAkY2ZnCiAgICBlY2hvICRtZW1fZ2IKICAgIHRp
bWUgeG0gY3JlYXRlIC1wICRjZmcgPi9kZXYvbnVsbAogICAgdGltZSB4bSBkZXN0cm95ICR2
bSA+L2Rldi9udWxsCiAgICBlY2hvCmRvbmUK
--------------010608060702090002000106
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.xen.org
http://lists.xen.org/xen-devel

--------------010608060702090002000106--


From xen-devel-bounces@lists.xen.org Mon Nov 12 15:02:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 15:02:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXvW2-0002Cy-FN; Mon, 12 Nov 2012 15:01:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <zhigang.x.wang@oracle.com>) id 1TXvW0-0002Ct-O8
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 15:01:33 +0000
Received: from [193.109.254.147:37403] by server-16.bemta-14.messagelabs.com
	id 5C/FF-09215-B4F01A05; Mon, 12 Nov 2012 15:01:31 +0000
X-Env-Sender: zhigang.x.wang@oracle.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1352732486!8530758!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNDU3NDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2520 invoked from network); 12 Nov 2012 15:01:27 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-12.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 15:01:27 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qACF1Mvf004305
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 12 Nov 2012 15:01:23 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qACF1L65012918
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 12 Nov 2012 15:01:22 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qACF1Lu2030706; Mon, 12 Nov 2012 09:01:21 -0600
Received: from zhigang.us.oracle.com (/10.149.236.110)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Mon, 12 Nov 2012 07:01:20 -0800
Message-ID: <50A10F3E.2030808@oracle.com>
Date: Mon, 12 Nov 2012 10:01:18 -0500
From: Zhigang Wang <zhigang.x.wang@oracle.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120827 Thunderbird/15.0
MIME-Version: 1.0
To: "Keir Fraser" <keir@xen.org>, Jan Beulich <jbeulich@suse.com>
Content-Type: multipart/mixed; boundary="------------010608060702090002000106"
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel <xen-devel@lists.xen.org>
Subject: [Xen-devel] VM memory allocation speed with cs 26056
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.
--------------010608060702090002000106
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hi Keir/Jan,

Recently I got a chance to access a big machine (2T mem/160 cpus) and I tested
your patch: http://xenbits.xen.org/hg/xen-unstable.hg/rev/177fdda0be56

Attached is the result.

Test environment old:

      # xm info
      host                   : ovs-3f-9e-04
      release                : 2.6.39-300.17.1.el5uek
      version                : #1 SMP Fri Oct 19 11:30:08 PDT 2012
      machine                : x86_64
      nr_cpus                : 160
      nr_nodes               : 8
      cores_per_socket       : 10
      threads_per_core       : 2
      cpu_mhz                : 2394
      hw_caps                :
bfebfbff:2c100800:00000000:00003f40:02bee3ff:00000000:00000001:00000000
      virt_caps              : hvm hvm_directio
      total_memory           : 2097142
      free_memory            : 2040108
      free_cpus              : 0
      xen_major              : 4
      xen_minor              : 1
      xen_extra              : .3OVM
      xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32
hvm-3.0-x86_32p hvm-3.0-x86_64
      xen_scheduler          : credit
      xen_pagesize           : 4096
      platform_params        : virt_start=0xffff800000000000
      xen_changeset          : unavailable
      xen_commandline        : dom0_mem=31390M no-bootscrub
      cc_compiler            : gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)
      cc_compile_by          : mockbuild
      cc_compile_domain      : us.oracle.com
      cc_compile_date        : Fri Oct 19 21:34:08 PDT 2012
      xend_config_format     : 4

      # uname -a
      Linux ovs-3f-9e-04 2.6.39-300.17.1.el5uek #1 SMP Fri Oct 19 11:30:08 PDT
2012 x86_64 x86_64 x86_64 GNU/Linux

      # cat /boot/grub/grub.conf
      ...
      kernel /xen.gz dom0_mem=31390M no-bootscrub dom0_vcpus_pin dom0_max_vcpus=32

Test environment new: old env + cs 26056

Test script: test-vm-memory-allocation.sh (attached)

My conclusion from the test:

  - HVM create time is greatly reduced.
  - PVM create time is increased dramatically for 4G, 8G, 16G, 32G, 64G, 128G.
  - HVM/PVM destroy time is not affected.
  - If most of our customers are using PVM, I think this patch is bad: because
most VM memory should under 128G.
  - If they are using HVM, then this patch is great.

Questions for discussion:

  - Did you get the same result?
  - It seems this result is not ideal. We may need to improve it.

Please note: Imay not have access to the same machine for awhile.

Thanks,

Zhigang


--------------010608060702090002000106
Content-Type: application/pdf;
 name="result.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="result.pdf"

JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9MZW5ndGggNjcvRmlsdGVyL0ZsYXRlRGVjb2Rl
Pj5zdHJlYW0KeJwzUDBU0DVUMFAwMzQCksm5XIVcTiFcxmYKpuZmCiEpXK4hXIFchQogJQZA
EigBRMm5CvoRaYYKLvkKgVwAv0kNugplbmRzdHJlYW0KZW5kb2JqCjUgMCBvYmoKPDwvUGFy
ZW50IDQgMCBSL0NvbnRlbnRzIDMgMCBSL1R5cGUvUGFnZS9SZXNvdXJjZXM8PC9YT2JqZWN0
PDwvWGYxIDEgMCBSPj4vUHJvY1NldCBbL1BERiAvVGV4dCAvSW1hZ2VCIC9JbWFnZUMgL0lt
YWdlSV0+Pi9NZWRpYUJveFswIDAgNjEyIDc5Ml0vUm90YXRlIDkwPj4KZW5kb2JqCjYgMCBv
YmoKPDwvTGVuZ3RoMSA1MjIwMC9MZW5ndGggMjE4NzgvRmlsdGVyL0ZsYXRlRGVjb2RlPj5z
dHJlYW0KeJzsvQl4FUXWP3yq17vfvvuSm+QmNxvcQIAkQDCaK7vsyCJBMgTZN1lVVBRwAURU
1HHDDRxUQB0CBAjoDOigjgvCjMuMzqiM4jIqyuuLzAgk9zunujskUceZ9/9+z/d/vie5/LqW
ruqqrjpbnapWYABgheUggjb5ysXxjbE/fYk5DwEoo6fNnz739aur12P8BOLy6XOunvZWw7YX
AJy1AAOWz5g6acpR/0tfAYw+inW6z8AMb2kwF2BMGNN5M+YuXjKx/OxYTFcClE+ZM2/yJHHz
qd0AazZgesbcSUvme+udywEOWLB8fP7CqfPz3xm6H9NFAPbfyvsggojKT0JEKgB8ZvozxOcU
Ns1Mf073KRS+wNoNBgA2wzNsJjwD++EFdgJrbYO9UA+/hxD0xfdaCr+EVaDAeM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AgbiAKdHJhaWxlcgo8PC9Sb290IDEwIDAgUi9JRCBbPDFlYjUxODQyYzc3ZTA1
YzA3YmI1ZjU1MWFjODcyOTlhPjw3NGNjMDNlZDlmMjY0YmMyOGU5OWQ5OGRiYThhZmYwNz5d
L0luZm8gMTEgMCBSL1NpemUgMTI+PgpzdGFydHhyZWYKMjkwMzAKJSVFT0YK
--------------010608060702090002000106
Content-Type: text/csv;
 name="result.csv"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="result.csv"

memory_size_gb,hvm_old_create,hvm_new_create,pvm_old_create,pvm_new_create,hvm_old_destroy,hvm_new_destroy,pvm_old_destroy,pvm_new_destroy
1,1.159,1.093,3.222,4.034,1.024,1.185,1.020,1.040
2,1.316,0.888,4.408,5.443,1.327,1.961,1.979,1.990
4,1.382,0.962,4.622,8.367,3.633,2.858,2.893,2.901
8,1.440,1.057,4.969,14.272,4.035,5.305,5.337,6.668
16,1.539,1.264,5.607,25.758,12.862,12.828,12.865,12.886
32,1.754,1.665,7.066,48.729,25.302,19.945,19.978,19.987
64,2.188,2.499,9.752,97.022,28.790,39.350,50.048,50.118
128,10.949,4.090,15.234,189.261,57.128,78.240,78.440,78.432
256,418.667,10.275,452.320,375.961,114.851,156.496,198.798,156.391
512,430.449,14.831,494.971,752.235,355.738,353.989,354.502,382.305
1024,867.145,28.570,1004.788,818.385,626.623,747.762,751.686,752.019
1500,1716.501,38.601,1968.900,1599.078,1083.900,1006.805,1000.907,1006.042

--------------010608060702090002000106
Content-Type: application/x-shellscript;
 name="test-vm-memory-allocation.sh"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="test-vm-memory-allocation.sh"

IyEvYmluL2Jhc2gKCnNldCAtZQoKZXhwb3J0IFRJTUVGT1JNQVQ9IiVSIgoKY2ZnPS90bXAv
cHZtLmNmZwoKZm9yIG1lbV9nYiBpbiAxIDIgNCA4IDE2IDMyIDY0IDEyOCAyNTYgNTEyIDEw
MjQgMTUwMDsgZG8KICAgIG1lbV9tYj0kKCgkbWVtX2diKjEwMjQpKQogICAgdm09JChncmVw
ICJebmFtZSIgJGNmZyB8IHNlZCAtZSAncy8gLy9nJyB8IHNlZCAtZSAncy8iLy9nJyB8IHNl
ZCAtZSAicy8nLy9nIiB8IGN1dCAtZD0gLWYyKQogICAgc2VkIC1pIC1lICJzL21lbW9yeSA9
IC4qL21lbW9yeSA9ICR7bWVtX21ifS9nIiAkY2ZnCiAgICBlY2hvICRtZW1fZ2IKICAgIHRp
bWUgeG0gY3JlYXRlIC1wICRjZmcgPi9kZXYvbnVsbAogICAgdGltZSB4bSBkZXN0cm95ICR2
bSA+L2Rldi9udWxsCiAgICBlY2hvCmRvbmUK
--------------010608060702090002000106
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.xen.org
http://lists.xen.org/xen-devel

--------------010608060702090002000106--


From xen-devel-bounces@lists.xen.org Mon Nov 12 15:17:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 15:17:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXvlI-0002c0-48; Mon, 12 Nov 2012 15:17:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXvlH-0002bi-FV
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 15:17:19 +0000
Received: from [85.158.143.99:11811] by server-2.bemta-4.messagelabs.com id
	17/9A-28922-EF211A05; Mon, 12 Nov 2012 15:17:18 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1352733438!24352077!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11303 invoked from network); 12 Nov 2012 15:17:18 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 15:17:18 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; d="scan'208";a="15753310"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 15:16:54 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 15:16:53 +0000
Message-ID: <1352733413.27833.272.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: feral <blistovmhz@gmail.com>
Date: Mon, 12 Nov 2012 15:16:53 +0000
In-Reply-To: <CAN3GA=RyB_O=huShjYuviqvbY7gNjHyn4c3s-GuAeBoR6=Uw4Q@mail.gmail.com>
References: <mailman.5.1352548802.11332.xen-devel@lists.xen.org>
	<CAN3GA=SiufUOi977SpWj+FGd9WdZUBtAoG18xUpQdSmr4g-boA@mail.gmail.com>
	<CAN3GA=RyB_O=huShjYuviqvbY7gNjHyn4c3s-GuAeBoR6=Uw4Q@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen-devel Digest, Vol 93, Issue 79
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Please trim your quotes, especially when replying to the digest. You
should adjust the subject line to reference the actual mail you are
replying to and avoid top posting too. This is all covered in
http://wiki.xen.org/wiki/Asking_Xen_Devel_Questions.

On Sat, 2012-11-10 at 20:11 +0000, feral wrote:
> Can't run Xen-4.3 unstable kernel with old xm tools:
> WARING:  Can't find version unstable of xen utils, fallback to default
> version!
> Error: Unable to connect to xend: No such file or directory. Is xend
> running?
> 
> 
> Guessing the same will be true of running the older 4.1 kernel with
> the new xl toolstack, so not sure how to proceed in testing.

You always need to have a matched pair of hypervisor and tools,
regardless of whether you are using xl or xm. You just need to install
the tools at the same time as you install the hypervisor.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 15:17:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 15:17:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXvlI-0002c0-48; Mon, 12 Nov 2012 15:17:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXvlH-0002bi-FV
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 15:17:19 +0000
Received: from [85.158.143.99:11811] by server-2.bemta-4.messagelabs.com id
	17/9A-28922-EF211A05; Mon, 12 Nov 2012 15:17:18 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1352733438!24352077!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11303 invoked from network); 12 Nov 2012 15:17:18 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 15:17:18 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; d="scan'208";a="15753310"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 15:16:54 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 15:16:53 +0000
Message-ID: <1352733413.27833.272.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: feral <blistovmhz@gmail.com>
Date: Mon, 12 Nov 2012 15:16:53 +0000
In-Reply-To: <CAN3GA=RyB_O=huShjYuviqvbY7gNjHyn4c3s-GuAeBoR6=Uw4Q@mail.gmail.com>
References: <mailman.5.1352548802.11332.xen-devel@lists.xen.org>
	<CAN3GA=SiufUOi977SpWj+FGd9WdZUBtAoG18xUpQdSmr4g-boA@mail.gmail.com>
	<CAN3GA=RyB_O=huShjYuviqvbY7gNjHyn4c3s-GuAeBoR6=Uw4Q@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen-devel Digest, Vol 93, Issue 79
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Please trim your quotes, especially when replying to the digest. You
should adjust the subject line to reference the actual mail you are
replying to and avoid top posting too. This is all covered in
http://wiki.xen.org/wiki/Asking_Xen_Devel_Questions.

On Sat, 2012-11-10 at 20:11 +0000, feral wrote:
> Can't run Xen-4.3 unstable kernel with old xm tools:
> WARING:  Can't find version unstable of xen utils, fallback to default
> version!
> Error: Unable to connect to xend: No such file or directory. Is xend
> running?
> 
> 
> Guessing the same will be true of running the older 4.1 kernel with
> the new xl toolstack, so not sure how to proceed in testing.

You always need to have a matched pair of hypervisor and tools,
regardless of whether you are using xl or xm. You just need to install
the tools at the same time as you install the hypervisor.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 15:17:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 15:17:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXvlH-0002bq-Og; Mon, 12 Nov 2012 15:17:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TXvlF-0002bX-NE
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 15:17:17 +0000
Received: from [85.158.137.99:43177] by server-14.bemta-3.messagelabs.com id
	FC/32-12788-CF211A05; Mon, 12 Nov 2012 15:17:16 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1352733436!14031412!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5MDI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10482 invoked from network); 12 Nov 2012 15:17:16 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-217.messagelabs.com with SMTP;
	12 Nov 2012 15:17:16 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 12 Nov 2012 15:17:16 +0000
Message-Id: <50A1210902000078000A7C86@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Mon, 12 Nov 2012 15:17:13 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Zhigang Wang" <zhigang.x.wang@oracle.com>
References: <50A10F3E.2030808@oracle.com>
In-Reply-To: <50A10F3E.2030808@oracle.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, Keir Fraser <keir@xen.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] VM memory allocation speed with cs 26056
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 12.11.12 at 16:01, Zhigang Wang <zhigang.x.wang@oracle.com> wrote:
> My conclusion from the test:
> 
>   - HVM create time is greatly reduced.
>   - PVM create time is increased dramatically for 4G, 8G, 16G, 32G, 64G, 128G.
>   - HVM/PVM destroy time is not affected.
>   - If most of our customers are using PVM, I think this patch is bad: because
> most VM memory should under 128G.
>   - If they are using HVM, then this patch is great.
> 
> Questions for discussion:
> 
>   - Did you get the same result?
>   - It seems this result is not ideal. We may need to improve it.

We'd first of all need to understand how this rather odd behavior
can be explained. In order to have a better comparison basis, did
you also do this for traditional PV? Or maybe I misunderstand
what PVM stands for, and am mixing it up with PVH? You certainly
agree that the two curves for what you call PVM have quite
unusual a relationship.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 15:17:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 15:17:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXvlH-0002bq-Og; Mon, 12 Nov 2012 15:17:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TXvlF-0002bX-NE
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 15:17:17 +0000
Received: from [85.158.137.99:43177] by server-14.bemta-3.messagelabs.com id
	FC/32-12788-CF211A05; Mon, 12 Nov 2012 15:17:16 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1352733436!14031412!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM5MDI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10482 invoked from network); 12 Nov 2012 15:17:16 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-217.messagelabs.com with SMTP;
	12 Nov 2012 15:17:16 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 12 Nov 2012 15:17:16 +0000
Message-Id: <50A1210902000078000A7C86@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Mon, 12 Nov 2012 15:17:13 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Zhigang Wang" <zhigang.x.wang@oracle.com>
References: <50A10F3E.2030808@oracle.com>
In-Reply-To: <50A10F3E.2030808@oracle.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, Keir Fraser <keir@xen.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] VM memory allocation speed with cs 26056
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 12.11.12 at 16:01, Zhigang Wang <zhigang.x.wang@oracle.com> wrote:
> My conclusion from the test:
> 
>   - HVM create time is greatly reduced.
>   - PVM create time is increased dramatically for 4G, 8G, 16G, 32G, 64G, 128G.
>   - HVM/PVM destroy time is not affected.
>   - If most of our customers are using PVM, I think this patch is bad: because
> most VM memory should under 128G.
>   - If they are using HVM, then this patch is great.
> 
> Questions for discussion:
> 
>   - Did you get the same result?
>   - It seems this result is not ideal. We may need to improve it.

We'd first of all need to understand how this rather odd behavior
can be explained. In order to have a better comparison basis, did
you also do this for traditional PV? Or maybe I misunderstand
what PVM stands for, and am mixing it up with PVH? You certainly
agree that the two curves for what you call PVM have quite
unusual a relationship.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 15:29:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 15:29:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXvwc-00036w-C2; Mon, 12 Nov 2012 15:29:02 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXvwb-00036q-0D
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 15:29:01 +0000
Received: from [193.109.254.147:8934] by server-1.bemta-14.messagelabs.com id
	36/C9-25314-CB511A05; Mon, 12 Nov 2012 15:29:00 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1352734139!2914334!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8165 invoked from network); 12 Nov 2012 15:28:59 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 15:28:59 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; d="scan'208";a="15753842"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 15:28:54 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 15:28:54 +0000
Message-ID: <1352734133.27833.277.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Chunyan Liu <cyliu@suse.com>
Date: Mon, 12 Nov 2012 15:28:53 +0000
In-Reply-To: <CAERYnoYbLddzpE6729Nkx2YzMPcr09Do0f1rkob4U1h34NjQgQ@mail.gmail.com>
References: <CAERYnoYbLddzpE6729Nkx2YzMPcr09Do0f1rkob4U1h34NjQgQ@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] question about xenstore-chmod MAX_PERMS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Dropping users list, please don't cross post.
On Mon, 2012-11-12 at 08:35 +0000, Chunyan Liu wrote:
> Dear List,
> 
> I'm trying to issue:
> "xenstore-chmod PATH r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14
> r15 r16 r17 r18"
> it failed at error report "Too many permissions specified.  Maximum
> per invocation is 16."
> 
> I changed MAX_PERMS to 18 for testing, it turns to be OK to run above
> command.
> I don't know why there is "MAX_PERMS=16" limitation and couldn't find
> useful info about that. Does anyone know that?

It seems like an obvious case of an arbitrary constant to me.

Do you actually have a practical requirement to be able to set > 16
perms via the command line tool?

I can't see anything obvious in the underlying library which would
prevent it handling essentially arbitrary length lists of perms. If you
want to change the client to increase the number supported I think you
should make it likewise handle arbitrary numbers rather than just
increasing MAX_PERMS.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 15:29:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 15:29:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXvwc-00036w-C2; Mon, 12 Nov 2012 15:29:02 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXvwb-00036q-0D
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 15:29:01 +0000
Received: from [193.109.254.147:8934] by server-1.bemta-14.messagelabs.com id
	36/C9-25314-CB511A05; Mon, 12 Nov 2012 15:29:00 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1352734139!2914334!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8165 invoked from network); 12 Nov 2012 15:28:59 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 15:28:59 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; d="scan'208";a="15753842"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 15:28:54 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 15:28:54 +0000
Message-ID: <1352734133.27833.277.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Chunyan Liu <cyliu@suse.com>
Date: Mon, 12 Nov 2012 15:28:53 +0000
In-Reply-To: <CAERYnoYbLddzpE6729Nkx2YzMPcr09Do0f1rkob4U1h34NjQgQ@mail.gmail.com>
References: <CAERYnoYbLddzpE6729Nkx2YzMPcr09Do0f1rkob4U1h34NjQgQ@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] question about xenstore-chmod MAX_PERMS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Dropping users list, please don't cross post.
On Mon, 2012-11-12 at 08:35 +0000, Chunyan Liu wrote:
> Dear List,
> 
> I'm trying to issue:
> "xenstore-chmod PATH r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14
> r15 r16 r17 r18"
> it failed at error report "Too many permissions specified.  Maximum
> per invocation is 16."
> 
> I changed MAX_PERMS to 18 for testing, it turns to be OK to run above
> command.
> I don't know why there is "MAX_PERMS=16" limitation and couldn't find
> useful info about that. Does anyone know that?

It seems like an obvious case of an arbitrary constant to me.

Do you actually have a practical requirement to be able to set > 16
perms via the command line tool?

I can't see anything obvious in the underlying library which would
prevent it handling essentially arbitrary length lists of perms. If you
want to change the client to increase the number supported I think you
should make it likewise handle arbitrary numbers rather than just
increasing MAX_PERMS.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 15:34:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 15:34:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXw1Q-0003Jg-43; Mon, 12 Nov 2012 15:34:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXw1O-0003Ja-VC
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 15:33:59 +0000
Received: from [85.158.139.83:41869] by server-1.bemta-5.messagelabs.com id
	74/15-05877-5E611A05; Mon, 12 Nov 2012 15:33:57 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352734436!22683063!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24430 invoked from network); 12 Nov 2012 15:33:57 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 15:33:57 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; d="scan'208";a="15754011"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 15:33:54 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 15:33:53 +0000
Message-ID: <1352734432.27833.280.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Date: Mon, 12 Nov 2012 15:33:52 +0000
In-Reply-To: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
References: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: add persistent grants to xbd_xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sun, 2012-11-04 at 22:23 +0000, Roger Pau Monne wrote:
> @@ -652,6 +686,15 @@ xbd_connect(struct xbd_xenbus_softc *sc)
>         else
>                 sc->sc_cache_flush = 0;
> 
> +       err = xenbus_read_ul(NULL, sc->sc_xbusd->xbusd_otherend,
> +           "feature-persistent", &feature_persistent, 10);
> +       if (err)
> +               feature_persistent = 0;
> +       if (feature_persistent > 0)
> +               sc->sc_persistent_grants = 1;
> +       else
> +               sc->sc_persistent_grants = 0;

I can't find anywhere which reads sc->sc_persistent_grants?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 15:34:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 15:34:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXw1Q-0003Jg-43; Mon, 12 Nov 2012 15:34:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXw1O-0003Ja-VC
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 15:33:59 +0000
Received: from [85.158.139.83:41869] by server-1.bemta-5.messagelabs.com id
	74/15-05877-5E611A05; Mon, 12 Nov 2012 15:33:57 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352734436!22683063!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24430 invoked from network); 12 Nov 2012 15:33:57 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 15:33:57 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; d="scan'208";a="15754011"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 15:33:54 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 15:33:53 +0000
Message-ID: <1352734432.27833.280.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Date: Mon, 12 Nov 2012 15:33:52 +0000
In-Reply-To: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
References: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: add persistent grants to xbd_xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sun, 2012-11-04 at 22:23 +0000, Roger Pau Monne wrote:
> @@ -652,6 +686,15 @@ xbd_connect(struct xbd_xenbus_softc *sc)
>         else
>                 sc->sc_cache_flush = 0;
> 
> +       err = xenbus_read_ul(NULL, sc->sc_xbusd->xbusd_otherend,
> +           "feature-persistent", &feature_persistent, 10);
> +       if (err)
> +               feature_persistent = 0;
> +       if (feature_persistent > 0)
> +               sc->sc_persistent_grants = 1;
> +       else
> +               sc->sc_persistent_grants = 0;

I can't find anywhere which reads sc->sc_persistent_grants?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 15:34:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 15:34:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXw1V-0003K5-Gh; Mon, 12 Nov 2012 15:34:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXw1T-0003Ju-D2
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 15:34:03 +0000
Received: from [85.158.139.83:42359] by server-9.bemta-5.messagelabs.com id
	30/ED-29295-AE611A05; Mon, 12 Nov 2012 15:34:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352734436!22683063!2
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24870 invoked from network); 12 Nov 2012 15:34:02 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 15:34:02 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; d="scan'208";a="15754015"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 15:34:01 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 15:34:01 +0000
Message-ID: <1352734440.27833.281.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau =?ISO-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Date: Mon, 12 Nov 2012 15:34:00 +0000
In-Reply-To: <50A0C1D0.1060407@citrix.com>
References: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
	<20121110104536.GA1027@antioche.eu.org> <50A0C1D0.1060407@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Manuel Bouyer <bouyer@antioche.eu.org>,
	"port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: add persistent grants to xbd_xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gTW9uLCAyMDEyLTExLTEyIGF0IDA5OjMwICswMDAwLCBSb2dlciBQYXUgTW9ubsOpIHdyb3Rl
Ogo+IAo+IEkgd2lsbCB0cnkgdG8gcGVyZm9ybSBhIHNpbWlsYXIgdGVzdCB3aXRoIGEgTmV0QlNE
IERvbTAsIGJ1dCB3aXRoIHRoZQo+IHBhdGNoIGl0IHdpbGwgcHJvYmFibHkgYmUgYSBsaXR0bGUg
Yml0IHNsb3dlciB0aGFuIHdpdGhvdXQgaXQgKGJlY2F1c2UKPiB3ZSBoYXZlIHRvIHBlcmZvcm0g
dGhlIG1lbWNweSBpbiB0aGUgZnJvbnRlbmQsIAoKRG9lc24ndCB0aGUgZnJvbnRlbmQgZmFsbGJh
Y2sgdG8gdGhlIHNhbWUgb2xkIGNvZGUgYXMgYWx3YXlzIGlmIHRoZSBiL2UKZG9lc24ndCBhZHZl
cnRpc2UgdGhlIG5ldyBmZWF0dXJlPwoKSWFuLgoKCl9fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxp
c3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Mon Nov 12 15:34:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 15:34:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXw1V-0003K5-Gh; Mon, 12 Nov 2012 15:34:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXw1T-0003Ju-D2
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 15:34:03 +0000
Received: from [85.158.139.83:42359] by server-9.bemta-5.messagelabs.com id
	30/ED-29295-AE611A05; Mon, 12 Nov 2012 15:34:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352734436!22683063!2
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24870 invoked from network); 12 Nov 2012 15:34:02 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 15:34:02 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; d="scan'208";a="15754015"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 15:34:01 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 15:34:01 +0000
Message-ID: <1352734440.27833.281.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau =?ISO-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Date: Mon, 12 Nov 2012 15:34:00 +0000
In-Reply-To: <50A0C1D0.1060407@citrix.com>
References: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
	<20121110104536.GA1027@antioche.eu.org> <50A0C1D0.1060407@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Manuel Bouyer <bouyer@antioche.eu.org>,
	"port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: add persistent grants to xbd_xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gTW9uLCAyMDEyLTExLTEyIGF0IDA5OjMwICswMDAwLCBSb2dlciBQYXUgTW9ubsOpIHdyb3Rl
Ogo+IAo+IEkgd2lsbCB0cnkgdG8gcGVyZm9ybSBhIHNpbWlsYXIgdGVzdCB3aXRoIGEgTmV0QlNE
IERvbTAsIGJ1dCB3aXRoIHRoZQo+IHBhdGNoIGl0IHdpbGwgcHJvYmFibHkgYmUgYSBsaXR0bGUg
Yml0IHNsb3dlciB0aGFuIHdpdGhvdXQgaXQgKGJlY2F1c2UKPiB3ZSBoYXZlIHRvIHBlcmZvcm0g
dGhlIG1lbWNweSBpbiB0aGUgZnJvbnRlbmQsIAoKRG9lc24ndCB0aGUgZnJvbnRlbmQgZmFsbGJh
Y2sgdG8gdGhlIHNhbWUgb2xkIGNvZGUgYXMgYWx3YXlzIGlmIHRoZSBiL2UKZG9lc24ndCBhZHZl
cnRpc2UgdGhlIG5ldyBmZWF0dXJlPwoKSWFuLgoKCl9fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxp
c3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Mon Nov 12 15:58:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 15:58:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwOS-0003lM-Sa; Mon, 12 Nov 2012 15:57:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <zhigang.x.wang@oracle.com>) id 1TXwOR-0003lE-Hw
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 15:57:47 +0000
Received: from [85.158.143.99:30144] by server-2.bemta-4.messagelabs.com id
	3F/26-28922-A7C11A05; Mon, 12 Nov 2012 15:57:46 +0000
X-Env-Sender: zhigang.x.wang@oracle.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1352735864!28705463!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNDU3NDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26337 invoked from network); 12 Nov 2012 15:57:46 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-13.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 12 Nov 2012 15:57:46 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qACFvfC9009846
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 12 Nov 2012 15:57:42 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qACFvehG011683
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 12 Nov 2012 15:57:40 GMT
Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qACFvdKf016030; Mon, 12 Nov 2012 09:57:39 -0600
Received: from zhigang.us.oracle.com (/10.149.236.110)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Mon, 12 Nov 2012 07:57:39 -0800
Message-ID: <50A11C71.4020507@oracle.com>
Date: Mon, 12 Nov 2012 10:57:37 -0500
From: Zhigang Wang <zhigang.x.wang@oracle.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120827 Thunderbird/15.0
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <50A10F3E.2030808@oracle.com>
	<50A1210902000078000A7C86@nat28.tlf.novell.com>
In-Reply-To: <50A1210902000078000A7C86@nat28.tlf.novell.com>
Content-Type: multipart/mixed; boundary="------------090605040006060609040303"
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, Keir Fraser <keir@xen.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] VM memory allocation speed with cs 26056
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.
--------------090605040006060609040303
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On 11/12/2012 10:17 AM, Jan Beulich wrote:
>>>> On 12.11.12 at 16:01, Zhigang Wang <zhigang.x.wang@oracle.com> wrote:
>> My conclusion from the test:
>>
>>   - HVM create time is greatly reduced.
>>   - PVM create time is increased dramatically for 4G, 8G, 16G, 32G, 64G, 128G.
>>   - HVM/PVM destroy time is not affected.
>>   - If most of our customers are using PVM, I think this patch is bad: because
>> most VM memory should under 128G.
>>   - If they are using HVM, then this patch is great.
>>
>> Questions for discussion:
>>
>>   - Did you get the same result?
>>   - It seems this result is not ideal. We may need to improve it.
> We'd first of all need to understand how this rather odd behavior
> can be explained. In order to have a better comparison basis, did
> you also do this for traditional PV? Or maybe I misunderstand
> what PVM stands for, and am mixing it up with PVH? You certainly
> agree that the two curves for what you call PVM have quite
> unusual a relationship.
>
Let me attach the HVM and PV guest configure files.

Actually I use xm create -p to create the VM, and destroy it immediately. So the
guest kernel doesn't matter.

Please see the test script for detail.

Thanks,

Zhigang


--------------090605040006060609040303
Content-Type: text/plain; charset=UTF-8;
 name="pvm.cfg"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="pvm.cfg"

vif = []
disk = ['file:/OVS/Repositories/0004fb0000030000013b01f1d983f4db/VirtualDisks/0004fb00001200004b87f14bde146192.img,xvda,r']
uuid = '0004fb00-0006-0000-7a63-1bf13fa33c30'
on_reboot = 'restart'
memory = 1536000
bootloader = '/usr/bin/pygrub'
name = '0004fb00000600007a631bf13fa33c30'
vfb = ['type=vnc,vncunused=1,vnclisten=0.0.0.0,keymap=en-us']
vcpus = 1

--------------090605040006060609040303
Content-Type: text/plain; charset=UTF-8;
 name="hvm.cfg"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="hvm.cfg"

serial = 'pty'
disk = ['file:/share/vm/microcore_3.5.1.iso,hdc:cdrom,r']
boot = 'd'
memory = 4096
pae = 1
acpi = 1
apic = 1
vnc = 1
vncunused = 1
vnclisten = '0.0.0.0'
name = 'microcorelinux_x86_hvm'
builder = 'hvm'
vcpus = 1

--------------090605040006060609040303
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.xen.org
http://lists.xen.org/xen-devel

--------------090605040006060609040303--


From xen-devel-bounces@lists.xen.org Mon Nov 12 15:58:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 15:58:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwOS-0003lM-Sa; Mon, 12 Nov 2012 15:57:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <zhigang.x.wang@oracle.com>) id 1TXwOR-0003lE-Hw
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 15:57:47 +0000
Received: from [85.158.143.99:30144] by server-2.bemta-4.messagelabs.com id
	3F/26-28922-A7C11A05; Mon, 12 Nov 2012 15:57:46 +0000
X-Env-Sender: zhigang.x.wang@oracle.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1352735864!28705463!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNDU3NDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26337 invoked from network); 12 Nov 2012 15:57:46 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-13.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 12 Nov 2012 15:57:46 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qACFvfC9009846
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 12 Nov 2012 15:57:42 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qACFvehG011683
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 12 Nov 2012 15:57:40 GMT
Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qACFvdKf016030; Mon, 12 Nov 2012 09:57:39 -0600
Received: from zhigang.us.oracle.com (/10.149.236.110)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Mon, 12 Nov 2012 07:57:39 -0800
Message-ID: <50A11C71.4020507@oracle.com>
Date: Mon, 12 Nov 2012 10:57:37 -0500
From: Zhigang Wang <zhigang.x.wang@oracle.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120827 Thunderbird/15.0
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <50A10F3E.2030808@oracle.com>
	<50A1210902000078000A7C86@nat28.tlf.novell.com>
In-Reply-To: <50A1210902000078000A7C86@nat28.tlf.novell.com>
Content-Type: multipart/mixed; boundary="------------090605040006060609040303"
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, Keir Fraser <keir@xen.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] VM memory allocation speed with cs 26056
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.
--------------090605040006060609040303
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On 11/12/2012 10:17 AM, Jan Beulich wrote:
>>>> On 12.11.12 at 16:01, Zhigang Wang <zhigang.x.wang@oracle.com> wrote:
>> My conclusion from the test:
>>
>>   - HVM create time is greatly reduced.
>>   - PVM create time is increased dramatically for 4G, 8G, 16G, 32G, 64G, 128G.
>>   - HVM/PVM destroy time is not affected.
>>   - If most of our customers are using PVM, I think this patch is bad: because
>> most VM memory should under 128G.
>>   - If they are using HVM, then this patch is great.
>>
>> Questions for discussion:
>>
>>   - Did you get the same result?
>>   - It seems this result is not ideal. We may need to improve it.
> We'd first of all need to understand how this rather odd behavior
> can be explained. In order to have a better comparison basis, did
> you also do this for traditional PV? Or maybe I misunderstand
> what PVM stands for, and am mixing it up with PVH? You certainly
> agree that the two curves for what you call PVM have quite
> unusual a relationship.
>
Let me attach the HVM and PV guest configure files.

Actually I use xm create -p to create the VM, and destroy it immediately. So the
guest kernel doesn't matter.

Please see the test script for detail.

Thanks,

Zhigang


--------------090605040006060609040303
Content-Type: text/plain; charset=UTF-8;
 name="pvm.cfg"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="pvm.cfg"

vif = []
disk = ['file:/OVS/Repositories/0004fb0000030000013b01f1d983f4db/VirtualDisks/0004fb00001200004b87f14bde146192.img,xvda,r']
uuid = '0004fb00-0006-0000-7a63-1bf13fa33c30'
on_reboot = 'restart'
memory = 1536000
bootloader = '/usr/bin/pygrub'
name = '0004fb00000600007a631bf13fa33c30'
vfb = ['type=vnc,vncunused=1,vnclisten=0.0.0.0,keymap=en-us']
vcpus = 1

--------------090605040006060609040303
Content-Type: text/plain; charset=UTF-8;
 name="hvm.cfg"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="hvm.cfg"

serial = 'pty'
disk = ['file:/share/vm/microcore_3.5.1.iso,hdc:cdrom,r']
boot = 'd'
memory = 4096
pae = 1
acpi = 1
apic = 1
vnc = 1
vncunused = 1
vnclisten = '0.0.0.0'
name = 'microcorelinux_x86_hvm'
builder = 'hvm'
vcpus = 1

--------------090605040006060609040303
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.xen.org
http://lists.xen.org/xen-devel

--------------090605040006060609040303--


From xen-devel-bounces@lists.xen.org Mon Nov 12 16:12:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:12:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwbw-0004Ps-8k; Mon, 12 Nov 2012 16:11:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <davidxu06@gmail.com>) id 1TXwbv-0004Pn-E4
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 16:11:43 +0000
Received: from [85.158.139.83:54531] by server-15.bemta-5.messagelabs.com id
	D8/FC-26920-EBF11A05; Mon, 12 Nov 2012 16:11:42 +0000
X-Env-Sender: davidxu06@gmail.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1352736700!25960746!1
X-Originating-IP: [209.85.216.52]
X-SpamReason: No, hits=0.7 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	MAILTO_TO_SPAM_ADDR,ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12188 invoked from network); 12 Nov 2012 16:11:41 -0000
Received: from mail-qa0-f52.google.com (HELO mail-qa0-f52.google.com)
	(209.85.216.52)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 16:11:41 -0000
Received: by mail-qa0-f52.google.com with SMTP id g14so1729297qab.11
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 08:11:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=X1v0sVwk5mPKf+mjgJcY5SeLx19kkULn72+Vbt1ZDgI=;
	b=YNH2mCOzwB2E5lMu2EcHP9JXg6eQeoc0TGjwxUhIW2z927ueL68rWzQo9G+eOu5iBk
	765paI0zQpWyOtL3/aN1yIDCkQEilGJ8FP9AzOBEtdwFA4lLPxpF+8UbRD4HE9lquAPP
	ReWqftxxVtzmktsJDhk8w7/i8m7roIcxlY5MOuyh+lhoO6s7lH4Cl/1yzaq31FENssbB
	SsuJUnfKYOq7sEMEndw6NbJ1qFBio3us/9vjZcbuzBo7QojeXmrj8t/MRA9DDGmMZNT7
	JSjzdutEpxv7tvnfsa9n2m/Z2NJOPUJmLQ7SD2EJJgnLPT7hBQOoD7Lfo+dnRuLgGpfn
	HEDg==
MIME-Version: 1.0
Received: by 10.224.27.3 with SMTP id g3mr21434218qac.44.1352736700401; Mon,
	12 Nov 2012 08:11:40 -0800 (PST)
Received: by 10.49.1.116 with HTTP; Mon, 12 Nov 2012 08:11:40 -0800 (PST)
In-Reply-To: <CAFLBxZYbvC5VT+RhsX-MqEv0A7ObzF48SgHfN7d=8BuuWe7O=Q@mail.gmail.com>
References: <CAGjowiTF6h4snHTuqRz1BbxX8VNnKyPdoJaVfUAZFzRNJ9m0jg@mail.gmail.com>
	<CAFLBxZYbvC5VT+RhsX-MqEv0A7ObzF48SgHfN7d=8BuuWe7O=Q@mail.gmail.com>
Date: Mon, 12 Nov 2012 11:11:40 -0500
Message-ID: <CAGjowiQvssGnDJ9AWQCcJ4OveAPpCqm14D9bPPeZf9HKKMV-=w@mail.gmail.com>
From: David Xu <davidxu06@gmail.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] state of process on de-scheduled vCPU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7250718826999406418=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============7250718826999406418==
Content-Type: multipart/alternative; boundary=bcaec5196c6b80891504ce4e8e31

--bcaec5196c6b80891504ce4e8e31
Content-Type: text/plain; charset=ISO-8859-1

Hi George,

Thanks for your quick reply. In my question, the running state is mainly
for the process. For example, when a vCPU becomes OVER, what's the state of
the running process(this process in running when this vCPU is UNDER) on it?
Besides, do you mean that from the guest's perspective its time is frozen
when the corresponding vCPU is de-scheduled? In this case, how about vSMP?
If a VM has 2 vCPUs, one is de-scheduled and the other is running, the time
on the running vCPU will continue going ahead, right? Thanks.

Regards,
Cong

2012/11/12 George Dunlap <George.Dunlap@eu.citrix.com>

> On Sun, Nov 11, 2012 at 3:57 AM, David Xu <davidxu06@gmail.com> wrote:
>
>> Hi all,
>>
>> I wonder if the state of process in guestOS will change when the
>> corresponding vCPU is de-scheduled. In other words, when a vCPU uses up its
>> credits and its state become over, how about the process context or softirq
>> context in guest OS on this vCPU? Does it still maintain the same running
>> state? Thanks.
>>
>
> I'm not sure what you mean "the same running state".  The state of the
> vcpu -- the registers, the guest memory relating to it, and the fact that
> it's not blocked -- is the same.  From the guest's perspective, it has
> temporarily frozen in time until it gets to run again.  Does that answer
> your question?
>
>  -George
>
>

--bcaec5196c6b80891504ce4e8e31
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi George,<div><br></div><div>Thanks for your quick reply. In my question, =
the running state is mainly for the process. For example, when a vCPU becom=
es OVER, what&#39;s the state of the running process(this process in runnin=
g when this vCPU is UNDER) on it? Besides, do you mean that from the guest&=
#39;s perspective its time is frozen when the corresponding vCPU is de-sche=
duled? In this case, how about vSMP? If a VM has 2 vCPUs, one is de-schedul=
ed and the other is running, the time on the running vCPU will continue goi=
ng ahead, right? Thanks.</div>
<div><br></div><div>Regards,</div><div>Cong<br><br><div class=3D"gmail_quot=
e">2012/11/12 George Dunlap <span dir=3D"ltr">&lt;<a href=3D"mailto:George.=
Dunlap@eu.citrix.com" target=3D"_blank">George.Dunlap@eu.citrix.com</a>&gt;=
</span><br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"im">On Sun, Nov 11, 2012 at 3:=
57 AM, David Xu <span dir=3D"ltr">&lt;<a href=3D"mailto:davidxu06@gmail.com=
" target=3D"_blank">davidxu06@gmail.com</a>&gt;</span> wrote:<br>
</div><div class=3D"gmail_quote"><div class=3D"im"><blockquote class=3D"gma=
il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef=
t:1ex">
Hi all,<div><br></div><div>I wonder if the state of process in guestOS will=
 change when the corresponding vCPU is de-scheduled. In other words, when a=
 vCPU uses up its credits and its state become over, how about the process =
context or softirq context in guest OS on this vCPU? Does it still maintain=
 the same running state? Thanks.</div>

</blockquote></div><div><br>I&#39;m not sure what you mean &quot;the same r=
unning state&quot;.=A0 The state of the vcpu -- the registers, the guest me=
mory relating to it, and the fact that it&#39;s not blocked -- is the same.=
=A0 From the guest&#39;s perspective, it has temporarily frozen in time unt=
il it gets to run again.=A0 Does that answer your question?<span class=3D"H=
OEnZb"><font color=3D"#888888"><br>

<br>=A0-George<br></font></span></div></div><br>
</blockquote></div><br></div>

--bcaec5196c6b80891504ce4e8e31--


--===============7250718826999406418==
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.xen.org
http://lists.xen.org/xen-devel

--===============7250718826999406418==--


From xen-devel-bounces@lists.xen.org Mon Nov 12 16:12:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:12:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwbw-0004Ps-8k; Mon, 12 Nov 2012 16:11:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <davidxu06@gmail.com>) id 1TXwbv-0004Pn-E4
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 16:11:43 +0000
Received: from [85.158.139.83:54531] by server-15.bemta-5.messagelabs.com id
	D8/FC-26920-EBF11A05; Mon, 12 Nov 2012 16:11:42 +0000
X-Env-Sender: davidxu06@gmail.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1352736700!25960746!1
X-Originating-IP: [209.85.216.52]
X-SpamReason: No, hits=0.7 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	MAILTO_TO_SPAM_ADDR,ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12188 invoked from network); 12 Nov 2012 16:11:41 -0000
Received: from mail-qa0-f52.google.com (HELO mail-qa0-f52.google.com)
	(209.85.216.52)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 16:11:41 -0000
Received: by mail-qa0-f52.google.com with SMTP id g14so1729297qab.11
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 08:11:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=X1v0sVwk5mPKf+mjgJcY5SeLx19kkULn72+Vbt1ZDgI=;
	b=YNH2mCOzwB2E5lMu2EcHP9JXg6eQeoc0TGjwxUhIW2z927ueL68rWzQo9G+eOu5iBk
	765paI0zQpWyOtL3/aN1yIDCkQEilGJ8FP9AzOBEtdwFA4lLPxpF+8UbRD4HE9lquAPP
	ReWqftxxVtzmktsJDhk8w7/i8m7roIcxlY5MOuyh+lhoO6s7lH4Cl/1yzaq31FENssbB
	SsuJUnfKYOq7sEMEndw6NbJ1qFBio3us/9vjZcbuzBo7QojeXmrj8t/MRA9DDGmMZNT7
	JSjzdutEpxv7tvnfsa9n2m/Z2NJOPUJmLQ7SD2EJJgnLPT7hBQOoD7Lfo+dnRuLgGpfn
	HEDg==
MIME-Version: 1.0
Received: by 10.224.27.3 with SMTP id g3mr21434218qac.44.1352736700401; Mon,
	12 Nov 2012 08:11:40 -0800 (PST)
Received: by 10.49.1.116 with HTTP; Mon, 12 Nov 2012 08:11:40 -0800 (PST)
In-Reply-To: <CAFLBxZYbvC5VT+RhsX-MqEv0A7ObzF48SgHfN7d=8BuuWe7O=Q@mail.gmail.com>
References: <CAGjowiTF6h4snHTuqRz1BbxX8VNnKyPdoJaVfUAZFzRNJ9m0jg@mail.gmail.com>
	<CAFLBxZYbvC5VT+RhsX-MqEv0A7ObzF48SgHfN7d=8BuuWe7O=Q@mail.gmail.com>
Date: Mon, 12 Nov 2012 11:11:40 -0500
Message-ID: <CAGjowiQvssGnDJ9AWQCcJ4OveAPpCqm14D9bPPeZf9HKKMV-=w@mail.gmail.com>
From: David Xu <davidxu06@gmail.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] state of process on de-scheduled vCPU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7250718826999406418=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============7250718826999406418==
Content-Type: multipart/alternative; boundary=bcaec5196c6b80891504ce4e8e31

--bcaec5196c6b80891504ce4e8e31
Content-Type: text/plain; charset=ISO-8859-1

Hi George,

Thanks for your quick reply. In my question, the running state is mainly
for the process. For example, when a vCPU becomes OVER, what's the state of
the running process(this process in running when this vCPU is UNDER) on it?
Besides, do you mean that from the guest's perspective its time is frozen
when the corresponding vCPU is de-scheduled? In this case, how about vSMP?
If a VM has 2 vCPUs, one is de-scheduled and the other is running, the time
on the running vCPU will continue going ahead, right? Thanks.

Regards,
Cong

2012/11/12 George Dunlap <George.Dunlap@eu.citrix.com>

> On Sun, Nov 11, 2012 at 3:57 AM, David Xu <davidxu06@gmail.com> wrote:
>
>> Hi all,
>>
>> I wonder if the state of process in guestOS will change when the
>> corresponding vCPU is de-scheduled. In other words, when a vCPU uses up its
>> credits and its state become over, how about the process context or softirq
>> context in guest OS on this vCPU? Does it still maintain the same running
>> state? Thanks.
>>
>
> I'm not sure what you mean "the same running state".  The state of the
> vcpu -- the registers, the guest memory relating to it, and the fact that
> it's not blocked -- is the same.  From the guest's perspective, it has
> temporarily frozen in time until it gets to run again.  Does that answer
> your question?
>
>  -George
>
>

--bcaec5196c6b80891504ce4e8e31
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi George,<div><br></div><div>Thanks for your quick reply. In my question, =
the running state is mainly for the process. For example, when a vCPU becom=
es OVER, what&#39;s the state of the running process(this process in runnin=
g when this vCPU is UNDER) on it? Besides, do you mean that from the guest&=
#39;s perspective its time is frozen when the corresponding vCPU is de-sche=
duled? In this case, how about vSMP? If a VM has 2 vCPUs, one is de-schedul=
ed and the other is running, the time on the running vCPU will continue goi=
ng ahead, right? Thanks.</div>
<div><br></div><div>Regards,</div><div>Cong<br><br><div class=3D"gmail_quot=
e">2012/11/12 George Dunlap <span dir=3D"ltr">&lt;<a href=3D"mailto:George.=
Dunlap@eu.citrix.com" target=3D"_blank">George.Dunlap@eu.citrix.com</a>&gt;=
</span><br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"im">On Sun, Nov 11, 2012 at 3:=
57 AM, David Xu <span dir=3D"ltr">&lt;<a href=3D"mailto:davidxu06@gmail.com=
" target=3D"_blank">davidxu06@gmail.com</a>&gt;</span> wrote:<br>
</div><div class=3D"gmail_quote"><div class=3D"im"><blockquote class=3D"gma=
il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef=
t:1ex">
Hi all,<div><br></div><div>I wonder if the state of process in guestOS will=
 change when the corresponding vCPU is de-scheduled. In other words, when a=
 vCPU uses up its credits and its state become over, how about the process =
context or softirq context in guest OS on this vCPU? Does it still maintain=
 the same running state? Thanks.</div>

</blockquote></div><div><br>I&#39;m not sure what you mean &quot;the same r=
unning state&quot;.=A0 The state of the vcpu -- the registers, the guest me=
mory relating to it, and the fact that it&#39;s not blocked -- is the same.=
=A0 From the guest&#39;s perspective, it has temporarily frozen in time unt=
il it gets to run again.=A0 Does that answer your question?<span class=3D"H=
OEnZb"><font color=3D"#888888"><br>

<br>=A0-George<br></font></span></div></div><br>
</blockquote></div><br></div>

--bcaec5196c6b80891504ce4e8e31--


--===============7250718826999406418==
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.xen.org
http://lists.xen.org/xen-devel

--===============7250718826999406418==--


From xen-devel-bounces@lists.xen.org Mon Nov 12 16:16:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:16:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwg1-0004Yx-Uq; Mon, 12 Nov 2012 16:15:57 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TXwfz-0004Yp-TZ
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 16:15:56 +0000
Received: from [193.109.254.147:61055] by server-16.bemta-14.messagelabs.com
	id 29/52-09215-BB021A05; Mon, 12 Nov 2012 16:15:55 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1352736943!9400935!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15711 invoked from network); 12 Nov 2012 16:15:44 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 16:15:44 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; d="scan'208";a="15755302"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 16:15:43 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 12 Nov 2012 16:15:43 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TXwfn-0007Go-Bg;
	Mon, 12 Nov 2012 16:15:43 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TXwfn-0005Sc-0P;
	Mon, 12 Nov 2012 16:15:43 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14380-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 12 Nov 2012 16:15:43 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14380: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14380 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14380/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-qemuu-rhel6hvm-amd 11 leak-check/check    fail REGR. vs. 14379

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14379
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14379
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14379
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14378

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  279bbf2a0b48
baseline version:
 xen                  62885b3c34c8

------------------------------------------------------------
People who touched revisions under test:
  Dario Faggioli <dario.faggioli@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Daley <mattjd@gmail.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26134:279bbf2a0b48
tag:         tip
user:        Matthew Daley <mattjd@gmail.com>
date:        Mon Nov 12 10:17:00 2012 +0000
    
    x86/mm x86 shadow: Fix typo in sh_invlpg sl3 page presence check
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Committed-by: Tim Deegan <tim@xen.org>
    
    
changeset:   26133:fdb69dd527cd
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 12 09:36:07 2012 +0100
    
    IOMMU: don't immediately disable bus mastering on faults
    
    Instead, give the owning domain at least a small opportunity of fixing
    things up, and allow for rare faults to not bring down the device at
    all.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
    
    
changeset:   26132:286ef4ced216
user:        Matthew Daley <mattjd@gmail.com>
date:        Mon Nov 12 09:34:57 2012 +0100
    
    tmem: Prevent NULL dereference on error case
    
    If the client / pool IDs given to tmemc_save_get_next_page are invalid,
    the calculation of pagesize will dereference NULL.
    
    Fix this by moving the calculation below the appropriate NULL check.
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Committed-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26131:62885b3c34c8
user:        Jan Beulich <jbeulich@suse.com>
date:        Thu Nov 08 17:58:19 2012 +0100
    
    x86/x2apic: properly implement cluster mode
    
    So far, cluster mode was just an alternative implementation of
    physical mode: Allowing only single CPU interrupt targets, and sending
    IPIs to each target CPU separately. Take advantage of what cluster
    mode really can do in that regard.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:16:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:16:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwg1-0004Yx-Uq; Mon, 12 Nov 2012 16:15:57 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TXwfz-0004Yp-TZ
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 16:15:56 +0000
Received: from [193.109.254.147:61055] by server-16.bemta-14.messagelabs.com
	id 29/52-09215-BB021A05; Mon, 12 Nov 2012 16:15:55 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1352736943!9400935!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15711 invoked from network); 12 Nov 2012 16:15:44 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 16:15:44 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; d="scan'208";a="15755302"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 16:15:43 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 12 Nov 2012 16:15:43 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TXwfn-0007Go-Bg;
	Mon, 12 Nov 2012 16:15:43 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TXwfn-0005Sc-0P;
	Mon, 12 Nov 2012 16:15:43 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14380-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 12 Nov 2012 16:15:43 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14380: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14380 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14380/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-qemuu-rhel6hvm-amd 11 leak-check/check    fail REGR. vs. 14379

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14379
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14379
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14379
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14378

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  279bbf2a0b48
baseline version:
 xen                  62885b3c34c8

------------------------------------------------------------
People who touched revisions under test:
  Dario Faggioli <dario.faggioli@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Daley <mattjd@gmail.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26134:279bbf2a0b48
tag:         tip
user:        Matthew Daley <mattjd@gmail.com>
date:        Mon Nov 12 10:17:00 2012 +0000
    
    x86/mm x86 shadow: Fix typo in sh_invlpg sl3 page presence check
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Committed-by: Tim Deegan <tim@xen.org>
    
    
changeset:   26133:fdb69dd527cd
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 12 09:36:07 2012 +0100
    
    IOMMU: don't immediately disable bus mastering on faults
    
    Instead, give the owning domain at least a small opportunity of fixing
    things up, and allow for rare faults to not bring down the device at
    all.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
    
    
changeset:   26132:286ef4ced216
user:        Matthew Daley <mattjd@gmail.com>
date:        Mon Nov 12 09:34:57 2012 +0100
    
    tmem: Prevent NULL dereference on error case
    
    If the client / pool IDs given to tmemc_save_get_next_page are invalid,
    the calculation of pagesize will dereference NULL.
    
    Fix this by moving the calculation below the appropriate NULL check.
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Committed-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26131:62885b3c34c8
user:        Jan Beulich <jbeulich@suse.com>
date:        Thu Nov 08 17:58:19 2012 +0100
    
    x86/x2apic: properly implement cluster mode
    
    So far, cluster mode was just an alternative implementation of
    physical mode: Allowing only single CPU interrupt targets, and sending
    IPIs to each target CPU separately. Take advantage of what cluster
    mode really can do in that regard.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:20:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:20:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwjO-0004jI-Oj; Mon, 12 Nov 2012 16:19:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <axboe@kernel.dk>) id 1TXwjO-0004jB-3H
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 16:19:26 +0000
Received: from [85.158.139.211:52799] by server-10.bemta-5.messagelabs.com id
	FF/21-09257-D8121A05; Mon, 12 Nov 2012 16:19:25 +0000
X-Env-Sender: axboe@kernel.dk
X-Msg-Ref: server-7.tower-206.messagelabs.com!1352737164!19432075!1
X-Originating-IP: [205.233.59.134]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA1LjIzMy41OS4xMzQgPT4gMTAwMDUx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25646 invoked from network); 12 Nov 2012 16:19:25 -0000
Received: from merlin.infradead.org (HELO merlin.infradead.org)
	(205.233.59.134)
	by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 16:19:25 -0000
Received: from 87-104-106-3-dynamic-customer.profibernet.dk ([87.104.106.3]
	helo=kernel.dk)
	by merlin.infradead.org with esmtpsa (Exim 4.76 #1 (Red Hat Linux))
	id 1TXwjK-0005S4-Ms; Mon, 12 Nov 2012 16:19:22 +0000
Received: from [10.50.103.56] (unknown [216.51.42.66])
	by kernel.dk (Postfix) with ESMTPA id 6DC0856295;
	Mon, 12 Nov 2012 17:19:20 +0100 (CET)
Message-ID: <50A12182.90305@kernel.dk>
Date: Mon, 12 Nov 2012 09:19:14 -0700
From: Jens Axboe <axboe@kernel.dk>
MIME-Version: 1.0
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
References: <20121109145529.GB23023@phenom.dumpdata.com>
In-Reply-To: <20121109145529.GB23023@phenom.dumpdata.com>
X-Enigmail-Version: 1.4.5
Cc: xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org
Subject: Re: [Xen-devel] [GIT PULL] (xen) stable/for-jens-3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 2012-11-09 07:55, Konrad Rzeszutek Wilk wrote:
> Hey Jens,
> 
> Please git pull the following branch:
> 
>  git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-jens-3.8
> 
> which has a new feature of the blk[back|front] driver - it is called 'feature-persistent'.
> Roger and Oliver patch says:
> "  This patch implements persistent grants for the xen-blk{front,back}
>     mechanism. The effect of this change is to reduce the number of unmap
>     operations performed, since they cause a (costly) TLB shootdown. This
>     allows the I/O performance to scale better when a large number of VMs
>     are performing I/O.
>     
>     Previously, the blkfront driver was supplied a bvec[] from the request
>     queue. This was granted to dom0; dom0 performed the I/O and wrote
>     directly into the grant-mapped memory and unmapped it; blkfront then
>     removed foreign access for that grant. The cost of unmapping scales
>     badly with the number of CPUs in Dom0. An experiment showed that when
>     Dom0 has 24 VCPUs, and guests are performing parallel I/O to a
>     ramdisk, the IPIs from performing unmap's is a bottleneck at 5 guests
>     (at which point 650,000 IOPS are being performed in total). If more
>     than 5 guests are used, the performance declines. By 10 guests, only
>     400,000 IOPS are being performed.
>     
>     This patch improves performance by only unmapping when the connection
>     between blkfront and back is broken.
> "
> 
> Note: You might get a conflict in the common.h file. It should
> be fairly easy to fix it - it should end up looking as this:
> 
> 160         /* Cached size parameter. */
> 161         sector_t                size;
> 162         unsigned int            flush_support:1;
> 163         unsigned int            discard_secure:1;
> 164         unsigned int            feature_gnt_persistent:1;
> 165         unsigned int            overflow_max_grants:1;
> 166 };
> 
> Thanks!

Thanks, pulled. No conflict observed, it merged cleanly.

-- 
Jens Axboe


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:20:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:20:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwjO-0004jI-Oj; Mon, 12 Nov 2012 16:19:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <axboe@kernel.dk>) id 1TXwjO-0004jB-3H
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 16:19:26 +0000
Received: from [85.158.139.211:52799] by server-10.bemta-5.messagelabs.com id
	FF/21-09257-D8121A05; Mon, 12 Nov 2012 16:19:25 +0000
X-Env-Sender: axboe@kernel.dk
X-Msg-Ref: server-7.tower-206.messagelabs.com!1352737164!19432075!1
X-Originating-IP: [205.233.59.134]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA1LjIzMy41OS4xMzQgPT4gMTAwMDUx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25646 invoked from network); 12 Nov 2012 16:19:25 -0000
Received: from merlin.infradead.org (HELO merlin.infradead.org)
	(205.233.59.134)
	by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 16:19:25 -0000
Received: from 87-104-106-3-dynamic-customer.profibernet.dk ([87.104.106.3]
	helo=kernel.dk)
	by merlin.infradead.org with esmtpsa (Exim 4.76 #1 (Red Hat Linux))
	id 1TXwjK-0005S4-Ms; Mon, 12 Nov 2012 16:19:22 +0000
Received: from [10.50.103.56] (unknown [216.51.42.66])
	by kernel.dk (Postfix) with ESMTPA id 6DC0856295;
	Mon, 12 Nov 2012 17:19:20 +0100 (CET)
Message-ID: <50A12182.90305@kernel.dk>
Date: Mon, 12 Nov 2012 09:19:14 -0700
From: Jens Axboe <axboe@kernel.dk>
MIME-Version: 1.0
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
References: <20121109145529.GB23023@phenom.dumpdata.com>
In-Reply-To: <20121109145529.GB23023@phenom.dumpdata.com>
X-Enigmail-Version: 1.4.5
Cc: xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org
Subject: Re: [Xen-devel] [GIT PULL] (xen) stable/for-jens-3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 2012-11-09 07:55, Konrad Rzeszutek Wilk wrote:
> Hey Jens,
> 
> Please git pull the following branch:
> 
>  git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-jens-3.8
> 
> which has a new feature of the blk[back|front] driver - it is called 'feature-persistent'.
> Roger and Oliver patch says:
> "  This patch implements persistent grants for the xen-blk{front,back}
>     mechanism. The effect of this change is to reduce the number of unmap
>     operations performed, since they cause a (costly) TLB shootdown. This
>     allows the I/O performance to scale better when a large number of VMs
>     are performing I/O.
>     
>     Previously, the blkfront driver was supplied a bvec[] from the request
>     queue. This was granted to dom0; dom0 performed the I/O and wrote
>     directly into the grant-mapped memory and unmapped it; blkfront then
>     removed foreign access for that grant. The cost of unmapping scales
>     badly with the number of CPUs in Dom0. An experiment showed that when
>     Dom0 has 24 VCPUs, and guests are performing parallel I/O to a
>     ramdisk, the IPIs from performing unmap's is a bottleneck at 5 guests
>     (at which point 650,000 IOPS are being performed in total). If more
>     than 5 guests are used, the performance declines. By 10 guests, only
>     400,000 IOPS are being performed.
>     
>     This patch improves performance by only unmapping when the connection
>     between blkfront and back is broken.
> "
> 
> Note: You might get a conflict in the common.h file. It should
> be fairly easy to fix it - it should end up looking as this:
> 
> 160         /* Cached size parameter. */
> 161         sector_t                size;
> 162         unsigned int            flush_support:1;
> 163         unsigned int            discard_secure:1;
> 164         unsigned int            feature_gnt_persistent:1;
> 165         unsigned int            overflow_max_grants:1;
> 166 };
> 
> Thanks!

Thanks, pulled. No conflict observed, it merged cleanly.

-- 
Jens Axboe


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:26:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:26:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwpa-000562-6b; Mon, 12 Nov 2012 16:25:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TXwpY-00055r-TC
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 16:25:49 +0000
Received: from [85.158.143.35:45687] by server-3.bemta-4.messagelabs.com id
	D7/75-06841-C0321A05; Mon, 12 Nov 2012 16:25:48 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1352737545!10174117!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNDU3NDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22126 invoked from network); 12 Nov 2012 16:25:47 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-10.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 16:25:47 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qACGPh6P012779
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 12 Nov 2012 16:25:44 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qACGPg09009499
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 12 Nov 2012 16:25:43 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qACGPgSX027514; Mon, 12 Nov 2012 10:25:42 -0600
MIME-Version: 1.0
Message-ID: <cec1ea7d-c0d8-4e9b-98c5-8d2798d8466a@default>
Date: Mon, 12 Nov 2012 08:25:40 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
References: <50A10F3E.2030808@oracle.com>
	<50A1210902000078000A7C86@nat28.tlf.novell.com>
In-Reply-To: <50A1210902000078000A7C86@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Konrad Wilk <konrad.wilk@oracle.com>, Keir Fraser <keir@xen.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] VM memory allocation speed with cs 26056
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Subject: Re: VM memory allocation speed with cs 26056
> 
> >>> On 12.11.12 at 16:01, Zhigang Wang <zhigang.x.wang@oracle.com> wrote:
> > My conclusion from the test:
> >
> >   - HVM create time is greatly reduced.
> >   - PVM create time is increased dramatically for 4G, 8G, 16G, 32G, 64G, 128G.
> >   - HVM/PVM destroy time is not affected.
> >   - If most of our customers are using PVM, I think this patch is bad: because
> > most VM memory should under 128G.
> >   - If they are using HVM, then this patch is great.
> >
> > Questions for discussion:
> >
> >   - Did you get the same result?
> >   - It seems this result is not ideal. We may need to improve it.
> 
> We'd first of all need to understand how this rather odd behavior
> can be explained. In order to have a better comparison basis, did
> you also do this for traditional PV? Or maybe I misunderstand
> what PVM stands for, and am mixing it up with PVH? You certainly
> agree that the two curves for what you call PVM have quite
> unusual a relationship.

("PVM" is unfortunately often used within Oracle and means the
same as "PV".  "PVM" == paravirtualized virtual machine.)

One significant difference is that a PV domain always allocates
memory one 4K page at a time and the patch improves allocation
performance only for larger-order allocations.  A reasonable
hypothesis is that the patch reduces performance on long
sequences of 4K pages, though this doesn't explain the curve
of the PV_create measurements at 256G and above.

With a one-line* hypervisor patch in alloc_heap_pages, one can
change HVM allocation so that all larger allocations are rejected.
It would be very interesting to see if that would result in an HVM
create curve similar to the PV create curve.

* change "unlikely(order > MAX_ORDER)" to "order > 0"

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:26:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:26:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwpa-000562-6b; Mon, 12 Nov 2012 16:25:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TXwpY-00055r-TC
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 16:25:49 +0000
Received: from [85.158.143.35:45687] by server-3.bemta-4.messagelabs.com id
	D7/75-06841-C0321A05; Mon, 12 Nov 2012 16:25:48 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1352737545!10174117!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNDU3NDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22126 invoked from network); 12 Nov 2012 16:25:47 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-10.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 16:25:47 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qACGPh6P012779
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 12 Nov 2012 16:25:44 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qACGPg09009499
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 12 Nov 2012 16:25:43 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qACGPgSX027514; Mon, 12 Nov 2012 10:25:42 -0600
MIME-Version: 1.0
Message-ID: <cec1ea7d-c0d8-4e9b-98c5-8d2798d8466a@default>
Date: Mon, 12 Nov 2012 08:25:40 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
References: <50A10F3E.2030808@oracle.com>
	<50A1210902000078000A7C86@nat28.tlf.novell.com>
In-Reply-To: <50A1210902000078000A7C86@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Konrad Wilk <konrad.wilk@oracle.com>, Keir Fraser <keir@xen.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] VM memory allocation speed with cs 26056
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Subject: Re: VM memory allocation speed with cs 26056
> 
> >>> On 12.11.12 at 16:01, Zhigang Wang <zhigang.x.wang@oracle.com> wrote:
> > My conclusion from the test:
> >
> >   - HVM create time is greatly reduced.
> >   - PVM create time is increased dramatically for 4G, 8G, 16G, 32G, 64G, 128G.
> >   - HVM/PVM destroy time is not affected.
> >   - If most of our customers are using PVM, I think this patch is bad: because
> > most VM memory should under 128G.
> >   - If they are using HVM, then this patch is great.
> >
> > Questions for discussion:
> >
> >   - Did you get the same result?
> >   - It seems this result is not ideal. We may need to improve it.
> 
> We'd first of all need to understand how this rather odd behavior
> can be explained. In order to have a better comparison basis, did
> you also do this for traditional PV? Or maybe I misunderstand
> what PVM stands for, and am mixing it up with PVH? You certainly
> agree that the two curves for what you call PVM have quite
> unusual a relationship.

("PVM" is unfortunately often used within Oracle and means the
same as "PV".  "PVM" == paravirtualized virtual machine.)

One significant difference is that a PV domain always allocates
memory one 4K page at a time and the patch improves allocation
performance only for larger-order allocations.  A reasonable
hypothesis is that the patch reduces performance on long
sequences of 4K pages, though this doesn't explain the curve
of the PV_create measurements at 256G and above.

With a one-line* hypervisor patch in alloc_heap_pages, one can
change HVM allocation so that all larger allocations are rejected.
It would be very interesting to see if that would result in an HVM
create curve similar to the PV create curve.

* change "unlikely(order > MAX_ORDER)" to "order > 0"

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:26:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:26:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwpb-00056H-J0; Mon, 12 Nov 2012 16:25:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXwpa-000561-Gk
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 16:25:50 +0000
Received: from [193.109.254.147:64766] by server-6.bemta-14.messagelabs.com id
	B0/49-02788-D0321A05; Mon, 12 Nov 2012 16:25:49 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1352737548!3673994!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16030 invoked from network); 12 Nov 2012 16:25:49 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 16:25:49 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; d="scan'208";a="15755588"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 16:25:44 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 16:25:43 +0000
Message-ID: <1352737542.27833.296.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Mon, 12 Nov 2012 16:25:42 +0000
In-Reply-To: <5081887502000078000A2A51@nat28.tlf.novell.com>
References: <506EE9A7.6090009@amd.com> <50815162.4090601@amd.com>
	<5081869B02000078000A2A1F@nat28.tlf.novell.com>
	<20609.27440.478178.971262@mariner.uk.xensource.com>
	<5081887502000078000A2A51@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Jinsong <jinsong.liu@intel.com>, Haicheng Li <haicheng.li@intel.com>,
	Christoph Egger <Christoph.Egger@amd.com>,
	"Keir \(Xen.org\)" <keir@xen.org>, XudongHao <xudong.hao@intel.com>,
	YunhongJiang <yunhong.jiang@intel.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] tools/xen-mceinj: support AMD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-10-19 at 16:05 +0100, Jan Beulich wrote:
> >>> On 19.10.12 at 17:01, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> > Jan Beulich writes ("Re: [Xen-devel] [PATCH] tools/xen-mceinj: support AMD"):
> >> >>> On 19.10.12 at 15:10, Christoph Egger <Christoph.Egger@amd.com> wrote:
> >> > Ping?
> >> 
> >> I'm afraid it's not really clear who should commit this - it's tools
> >> side code, so IanJ or IanC would normally be the ones, but otoh
> >> it's code requiring low level hardware knowledge to review the
> >> patch, so both of them might want to rather not do the review.
> >> In the past it was usually Keir who eventually committed such
> >> patches, but I don't know whether he put this on his to-look-at-
> >> and-eventually-commit list.
> > 
> > My view is that I would like an ack from someone who understands
> > what's going on ...
> 
> Which would ideally be those who introduced the code, i.e.
> Intel folks if I'm not mistaken...

Lets CC some of them then.

Intel folks -- any opinion on the patch below from Christoph?

8<----------------

# User Christoph Egger
# Date 1349437062 -7200
xen mceinj: support AMD.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>

diff -r 21704bc429b4 -r 1a3eea784e09 tools/tests/mce-test/tools/xen-mceinj.c
--- a/tools/tests/mce-test/tools/xen-mceinj.c
+++ b/tools/tests/mce-test/tools/xen-mceinj.c
@@ -1,6 +1,7 @@
 /*
  * xen-mceinj.c: utilities to inject fake MCE for x86.
  * Copyright (c) 2010, Intel Corporation.
+ * Copyright (c) 2012, AMD Cooperation Inc.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -18,6 +19,7 @@
  * Authors: Yunhong Jiang <yunhong.jiang@intel.com>
  *          Haicheng Li <haicheng.li@intel.com>
  *          Xudong Hao <xudong.hao@intel.com>
+ *          Christoph Egger <Christoph.Egger@amd.com>
  */
 
 
@@ -44,11 +46,14 @@
 #define MCi_type_STATUS     0x1
 #define MCi_type_ADDR       0x2
 #define MCi_type_MISC       0x3
-#define MCi_type_CTL2       0x4
+#define MC4_type_MISC1      0x4
+#define MC4_type_MISC2      0x5
+#define MC4_type_MISC3      0x6
+#define MCi_type_CTL2       0x7
 
 #define INVALID_MSR         ~0UL
 
-/* Intel MSRs */
+/* X86 machine check MSRs */
 #define MSR_IA32_MCG_CAP         0x00000179
 #define MSR_IA32_MCG_STATUS      0x0000017a
 #define MSR_IA32_MCG_CTL         0x0000017b
@@ -56,35 +61,66 @@
 #define MSR_IA32_MC0_STATUS      0x00000401
 #define MSR_IA32_MC0_ADDR        0x00000402
 #define MSR_IA32_MC0_MISC        0x00000403
+
+/* Intel MSRs */
 #define MSR_IA32_MC0_CTL2        0x00000280
 
-/* LLC (Last Level Cache) EWB (Explicit Write Back) SRAO MCE */
+/* Intel: LLC (Last Level Cache) EWB (Explicit Write Back) SRAO MCE */
 #define MCG_STATUS_SRAO_LLC_VAL  0x5
 #define MCE_SRAO_LLC_BANK        0x7
 #define MCi_STATUS_SRAO_LLC_VAL  0xBD2000008000017AUL
 #define MCi_MISC_SRAO_LLC_VAL    0x86UL
 
-/* Memory Patrol Scrub SRAO MCE */
+/* Intel: Memory Patrol Scrub SRAO MCE */
 #define MCG_STATUS_SRAO_MEM_VAL  0x5
 #define MCE_SRAO_MEM_BANK        0x8
 #define MCi_STATUS_SRAO_MEM_VAL  0xBD000000004000CFUL
 #define MCi_MISC_SRAO_MEM_VAL    0x86UL
 
-/* LLC EWB UCNA Error */
+/* Intel: LLC EWB UCNA Error */
 #define MCG_STATUS_UCNA_LLC_VAL  0x0
 #define CMCI_UCNA_LLC_BANK       0x9
 #define MCi_STATUS_UCNA_LLC_VAL  0xBC20000080000136UL
 #define MCi_MISC_UCNA_LLC_VAL    0x86UL
 
-/* Error Types */
-#define MCE_SRAO_MEM        0x0
-#define MCE_SRAO_LLC        0x1
-#define CMCI_UCNA_LLC       0x2
+/* Intel: Error Types */
+#define INTEL_MCE_SRAO_MEM        0x0
+#define INTEL_MCE_SRAO_LLC        0x1
+#define INTEL_CMCI_UCNA_LLC       0x2
+
+/* AMD: Memory Error */
+#define MCG_STATUS_MEM_VAL        0x5
+#define MCE_MEM_BANK              0x4
+#define MCi_STATUS_MEM_VAL        0xb4000000001c0100UL
+//#define MCi_STATUS_MEM_VAL        0xb600000000000100UL
+#define MCi_MISC_MEM_VAL          0x0
+
+/* AMD: L3 Cache Error */
+#define MCG_STATUS_L3_VAL         0x5
+#define MCE_L3_BANK               0x4
+#define MCi_STATUS_L3_VAL         0xbc000400001c010bULL
+#define MC4_MISC0_VAL             0x0
+#define MC4_MISC1_VAL             0x0
+#define MC4_MISC2_L3_VAL          0xc008000000000003ULL
+
+/* AMD: CPU corruption error */
+#define MCG_STATUS_CPU_VAL        0x5
+#define MCE_CPU_BANK              0x2
+#define MCi_STATUS_CPU_VAL        0x9200000000000000ULL
+//#define MCi_STATUS_CPU_VAL        0xb200000000000000ULL
+
+/* AMD: Error Types */
+#define AMD_MCE_MEM               0x20 /* memory error */
+#define AMD_MCE_L3                0x21 /* l3 cache */
 
 #define LOGFILE stdout
 
 int dump;
+int opt_exception;
 struct xen_mc_msrinject msr_inj;
+int cpu_is_amd;
+int cpu_is_intel;
+
 
 static void Lprintf(const char *fmt, ...)
 {
@@ -145,7 +181,7 @@ static int mca_cpuinfo(xc_interface *xc_
         return 0;
 }
 
-static int inject_cmci(xc_interface *xc_handle, int cpu_nr)
+static int intel_inject_cmci(xc_interface *xc_handle)
 {
     struct xen_mc mc;
     int nr_cpus;
@@ -191,6 +227,15 @@ static uint64_t bank_addr(int bank, int 
         case MCi_type_MISC:
             addr = MSR_IA32_MC0_CTL + (bank * 4) + type;
             break;
+        case MC4_type_MISC1:
+            addr = 0xc0000408;
+            break;
+        case MC4_type_MISC2:
+            addr = 0xc0000409;
+            break;
+        case MC4_type_MISC3:
+            addr = 0xc000040a;
+            break;
         case MCi_type_CTL2:
             addr = MSR_IA32_MC0_CTL2 + bank;
             break;
@@ -356,12 +401,11 @@ static int inject_mci_status(xc_interfac
 }
 
 static int inject_mci_misc(xc_interface *xc_handle,
-                             uint32_t cpu_nr,
-                             uint64_t bank,
-                             uint64_t val)
+                             uint32_t cpu_nr, uint32_t misctype,
+                             uint64_t bank, uint64_t val)
 {
     return add_msr_bank_intpose(xc_handle, cpu_nr, MC_MSRINJ_F_INTERPOSE,
-                                    MCi_type_MISC, bank, val); 
+                                    MCi_type_MISC + misctype, bank, val); 
 }
 
 static int inject_mci_addr(xc_interface *xc_handle,
@@ -373,10 +417,8 @@ static int inject_mci_addr(xc_interface 
                                     MCi_type_ADDR, bank, val); 
 }
 
-static int inject_llc_srao(xc_interface *xc_handle,
-                             uint32_t cpu_nr,
-                             uint32_t domain,
-                             uint64_t gaddr)
+static int intel_inject_llc_srao(xc_interface *xc_handle,
+    uint32_t cpu_nr, uint32_t domain, uint64_t gaddr)
 {
     uint64_t gpfn, mfn, haddr;
     int ret = 0;
@@ -390,7 +432,7 @@ static int inject_llc_srao(xc_interface 
     if ( ret )
         err(xc_handle, "Failed to inject MCi_STATUS MSR\n");
 
-    ret = inject_mci_misc(xc_handle, cpu_nr,
+    ret = inject_mci_misc(xc_handle, cpu_nr, 0,
                           MCE_SRAO_LLC_BANK, MCi_MISC_SRAO_LLC_VAL);
     if ( ret )
         err(xc_handle, "Failed to inject MCi_MISC MSR\n");
@@ -407,17 +449,17 @@ static int inject_llc_srao(xc_interface 
     ret = flush_msr_inj(xc_handle);
     if ( ret )
         err(xc_handle, "Failed to inject MSR\n");
-    ret = inject_mce(xc_handle, cpu_nr);
-    if ( ret )
-        err(xc_handle, "Failed to inject MCE error\n");
+    if (opt_exception) {
+        ret = inject_mce(xc_handle, cpu_nr);
+        if ( ret )
+            err(xc_handle, "Failed to inject MCE error\n");
+    }
 
     return 0;
 }
 
-static int inject_mem_srao(xc_interface *xc_handle,
-                             uint32_t cpu_nr,
-                             uint32_t domain,
-                             uint64_t gaddr)
+static int intel_inject_mem_srao(xc_interface *xc_handle,
+    uint32_t cpu_nr, uint32_t domain, uint64_t gaddr)
 {
     uint64_t gpfn, mfn, haddr;
     int ret = 0;
@@ -431,7 +473,7 @@ static int inject_mem_srao(xc_interface 
     if ( ret )
         err(xc_handle, "Failed to inject MCi_STATUS MSR\n");
 
-    ret = inject_mci_misc(xc_handle, cpu_nr,
+    ret = inject_mci_misc(xc_handle, cpu_nr, 0,
                           MCE_SRAO_MEM_BANK, MCi_MISC_SRAO_MEM_VAL);
     if ( ret )
         err(xc_handle, "Failed to inject MCi_MISC MSR\n");
@@ -448,17 +490,17 @@ static int inject_mem_srao(xc_interface 
     ret = flush_msr_inj(xc_handle);
     if ( ret )
         err(xc_handle, "Failed to inject MSR\n");
-    ret = inject_mce(xc_handle, cpu_nr);
-    if ( ret )
-        err(xc_handle, "Failed to inject MCE error\n");
+    if (opt_exception) {
+        ret = inject_mce(xc_handle, cpu_nr);
+        if ( ret )
+            err(xc_handle, "Failed to inject MCE error\n");
+    }
 
     return 0;
 }
 
-static int inject_llc_ucna(xc_interface *xc_handle,
-                             uint32_t cpu_nr,
-                             uint32_t domain,
-                             uint64_t gaddr)
+static int intel_inject_llc_ucna(xc_interface *xc_handle,
+    uint32_t cpu_nr, uint32_t domain, uint64_t gaddr)
 {
     uint64_t gpfn, mfn, haddr;
     int ret = 0;
@@ -472,7 +514,7 @@ static int inject_llc_ucna(xc_interface 
     if ( ret )
         err(xc_handle, "Failed to inject MCi_STATUS MSR\n");
 
-    ret = inject_mci_misc(xc_handle, cpu_nr,
+    ret = inject_mci_misc(xc_handle, cpu_nr, 0,
                           CMCI_UCNA_LLC_BANK, MCi_MISC_UCNA_LLC_VAL);
     if ( ret )
         err(xc_handle, "Failed to inject MCi_MISC MSR\n");
@@ -489,13 +531,108 @@ static int inject_llc_ucna(xc_interface 
     ret = flush_msr_inj(xc_handle);
     if ( ret )
         err(xc_handle, "Failed to inject MSR\n");
-    ret = inject_cmci(xc_handle, cpu_nr);
+    ret = intel_inject_cmci(xc_handle);
     if ( ret )
         err(xc_handle, "Failed to inject MCE error\n");
 
     return 0;
 }
 
+static int amd_inject_mem(xc_interface *xc_handle,
+    uint32_t cpu_nr, uint32_t domain, uint64_t gaddr)
+{
+    uint64_t gpfn, mfn, haddr;
+    int ret = 0;
+
+    ret = inject_mcg_status(xc_handle, cpu_nr, MCG_STATUS_MEM_VAL);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCG_STATUS MSR\n");
+
+    ret = inject_mci_status(xc_handle, cpu_nr,
+                            MCE_MEM_BANK, MCi_STATUS_MEM_VAL);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCi_STATUS MSR\n");
+
+    ret = inject_mci_misc(xc_handle, cpu_nr, 0,
+                          MCE_MEM_BANK, MCi_MISC_MEM_VAL);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCi_MISC MSR\n");
+
+    gpfn = gaddr >> PAGE_SHIFT;
+    mfn = mca_gpfn_to_mfn(xc_handle, domain, gpfn);
+    if (!mfn_valid(mfn))
+        err(xc_handle, "The MFN is not valid\n");
+    haddr = (mfn << PAGE_SHIFT) | (gaddr & (PAGE_SIZE - 1));
+    ret = inject_mci_addr(xc_handle, cpu_nr, MCE_MEM_BANK, haddr);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCi_ADDR MSR\n");
+
+    ret = flush_msr_inj(xc_handle);
+    if ( ret )
+        err(xc_handle, "Failed to inject MSR\n");
+
+    if (opt_exception) {
+        ret = inject_mce(xc_handle, cpu_nr);
+        if ( ret )
+            err(xc_handle, "Failed to inject MCE error\n");
+    }
+
+    return 0;
+}
+
+static int amd_inject_l3(xc_interface *xc_handle,
+    uint32_t cpu_nr, uint32_t domain, uint64_t gaddr)
+{
+    uint64_t gpfn, mfn, haddr;
+    int ret = 0;
+
+    ret = inject_mcg_status(xc_handle, cpu_nr, MCG_STATUS_L3_VAL);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCG_STATUS MSR\n");
+
+    ret = inject_mci_status(xc_handle, cpu_nr,
+                            MCE_L3_BANK, MCi_STATUS_L3_VAL);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCi_STATUS MSR\n");
+
+    ret = inject_mci_misc(xc_handle, cpu_nr, 0,
+                          MCE_L3_BANK, MC4_MISC0_VAL);
+    if ( ret )
+        err(xc_handle, "Failed to inject MC4_MISC0 MSR\n");
+
+    ret = inject_mci_misc(xc_handle, cpu_nr, 1,
+                          MCE_L3_BANK, MC4_MISC1_VAL);
+    if ( ret )
+        err(xc_handle, "Failed to inject MC4_MISC1 MSR\n");
+
+    ret = inject_mci_misc(xc_handle, cpu_nr, 2,
+                          MCE_L3_BANK, MC4_MISC2_L3_VAL);
+    if ( ret )
+        err(xc_handle, "Failed to inject MC4_MISC2 MSR\n");
+
+    gpfn = gaddr >> PAGE_SHIFT;
+    mfn = mca_gpfn_to_mfn(xc_handle, domain, gpfn);
+    if (!mfn_valid(mfn))
+        err(xc_handle, "The MFN is not valid\n");
+    haddr = (mfn << PAGE_SHIFT) | (gaddr & (PAGE_SIZE - 1));
+    ret = inject_mci_addr(xc_handle, cpu_nr, MCE_L3_BANK, haddr);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCi_ADDR MSR\n");
+
+    ret = flush_msr_inj(xc_handle);
+    if ( ret )
+        err(xc_handle, "Failed to inject MSR\n");
+
+    if (opt_exception) {
+        ret = inject_mce(xc_handle, cpu_nr);
+        if ( ret )
+            err(xc_handle, "Failed to inject MCE error\n");
+    }
+
+    return 0;
+}
+
+
 static long xs_get_dom_mem(int domid)
 {
     char path[128];
@@ -508,7 +645,7 @@ static long xs_get_dom_mem(int domid)
     if (!xs)
         return -1;
 
-    sprintf(path, "/local/domain/%d/memory/target", domid);
+    snprintf(path, sizeof(path), "/local/domain/%d/memory/target", domid);
     memstr = xs_read(xs, XBT_NULL, path, &plen);
     xs_daemon_close(xs);
 
@@ -540,30 +677,80 @@ static void help(void)
            "  -D, --dump           dump addr info without error injection\n"
            "  -c, --cpu=CPU_ID     target CPU\n"
            "  -d, --domain=DomID   target domain, the default is Xen itself\n"
+           "  -e                   raise MCE exception\n"
            "  -h, --help           print this page\n"
            "  -p, --phyaddr        physical address\n"
            "  -t, --type=error     error type\n"
-           "                        0 : MCE_SRAO_MEM\n"
-           "                        1 : MCE_SRAO_LLC\n"
-           "                        2 : CMCI_UCNA_LLC\n"
+           "                        0x0 : MCE_SRAO_MEM (Intel only)\n"
+           "                        0x1 : MCE_SRAO_LLC (Intel only)\n"
+           "                        0x2 : CMCI_UCNA_LLC (Intel only)\n"
+           "                        0x20: DRAM error (AMD only)\n"
+           "                        0x21: L3 cache error (AMD only)\n"
            "\n"
            );
 }
 
+static void cpuid(const unsigned int *input, unsigned int *regs)
+{
+    unsigned int count = (input[1] == XEN_CPUID_INPUT_UNUSED) ? 0 : input[1];
+    asm (
+#ifdef __i386__
+        "push %%ebx; push %%edx\n\t"
+#else
+        "push %%rbx; push %%rdx\n\t"
+#endif
+        "cpuid\n\t"
+        "mov %%ebx,4(%4)\n\t"
+        "mov %%edx,12(%4)\n\t"
+#ifdef __i386__
+        "pop %%edx; pop %%ebx\n\t"
+#else
+        "pop %%rdx; pop %%rbx\n\t"
+#endif
+        : "=a" (regs[0]), "=c" (regs[2])
+        : "0" (input[0]), "1" (count), "S" (regs)
+        : "memory" );
+}
+
+/* Get the manufacturer brand name of the host processor. */
+static void cpuid_brand_get(char *str)
+{
+    unsigned int input[2] = { 0, 0 };
+    unsigned int regs[4];
+
+    cpuid(input, regs);
+
+    *(uint32_t *)(str + 0) = regs[1];
+    *(uint32_t *)(str + 4) = regs[3];
+    *(uint32_t *)(str + 8) = regs[2];
+    str[12] = '\0';
+}
+
 int main(int argc, char *argv[])
 {
-    int type = MCE_SRAO_MEM;
+    int type;
     int c, opt_index;
     uint32_t domid;
     xc_interface *xc_handle;
-    int cpu_nr;
-    int64_t gaddr, gpfn, mfn, haddr, max_gpa;
+    unsigned int cpu_nr;
+    uint64_t gaddr, gpfn, mfn, haddr, max_gpa;
+    char cpu_brand[13];
 
     /* Default Value */
     domid = DOMID_XEN;
     gaddr = 0x180020;
     cpu_nr = 0;
 
+    cpu_is_amd = cpu_is_intel = 0;
+    cpuid_brand_get(cpu_brand);
+    if (strstr(cpu_brand, "AMD"))
+        cpu_is_amd = 1;
+    else
+        cpu_is_intel = 1;
+
+    if (cpu_is_intel)
+        type = INTEL_MCE_SRAO_MEM;
+
     init_msr_inj();
     xc_handle = xc_interface_open(0, 0, 0);
     if ( !xc_handle ) {
@@ -571,8 +758,8 @@ int main(int argc, char *argv[])
         exit(EXIT_FAILURE);
     }
 
-    while ( 1 ) {
-        c = getopt_long(argc, argv, "c:Dd:t:hp:r", opts, &opt_index);
+    for (;;) {
+        c = getopt_long(argc, argv, "c:Dd:t:hp:r:e", opts, &opt_index);
         if ( c == -1 )
             break;
         switch ( c ) {
@@ -580,23 +767,26 @@ int main(int argc, char *argv[])
             dump=1;
             break;
         case 'c':
-            cpu_nr = strtol(optarg, &optarg, 10);
+            cpu_nr = strtoul(optarg, &optarg, 0);
             if ( strlen(optarg) != 0 )
                 err(xc_handle, "Please input a digit parameter for CPU\n");
             break;
         case 'd':
-            domid = strtol(optarg, &optarg, 10);
+            domid = strtoul(optarg, &optarg, 0);
             if ( strlen(optarg) != 0 )
                 err(xc_handle, "Please input a digit parameter for domain\n");
             break;
         case 'p':
-            gaddr = strtol(optarg, &optarg, 0);
+            gaddr = strtoul(optarg, &optarg, 0);
             if ( strlen(optarg) != 0 )
                 err(xc_handle, "Please input correct page address\n");
             break;
         case 't':
             type = strtol(optarg, NULL, 0);
             break;
+        case 'e':
+            opt_exception = 1;
+            break;
         case 'h':
         default:
             help();
@@ -627,16 +817,26 @@ int main(int argc, char *argv[])
         goto out;
     }
 
-    switch ( type )
-    {
-    case MCE_SRAO_MEM:
-        inject_mem_srao(xc_handle, cpu_nr, domid, gaddr);
+    switch ( type ) {
+    case INTEL_MCE_SRAO_MEM:
+        if ( cpu_is_intel )
+            intel_inject_mem_srao(xc_handle, cpu_nr, domid, gaddr);
         break;
-    case MCE_SRAO_LLC:
-        inject_llc_srao(xc_handle, cpu_nr, domid, gaddr);
+    case INTEL_MCE_SRAO_LLC:
+        if ( cpu_is_intel )
+            intel_inject_llc_srao(xc_handle, cpu_nr, domid, gaddr);
         break;
-    case CMCI_UCNA_LLC:
-        inject_llc_ucna(xc_handle, cpu_nr, domid, gaddr);
+    case INTEL_CMCI_UCNA_LLC:
+        if ( cpu_is_intel )
+            intel_inject_llc_ucna(xc_handle, cpu_nr, domid, gaddr);
+        break;
+    case AMD_MCE_MEM:
+        if ( cpu_is_amd )
+            amd_inject_mem(xc_handle, cpu_nr, domid, gaddr);
+        break;
+    case AMD_MCE_L3:
+        if ( cpu_is_amd )
+            amd_inject_l3(xc_handle, cpu_nr, domid, gaddr);
         break;
     default:
         err(xc_handle, "Unsupported error type\n");


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:26:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:26:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwpb-00056H-J0; Mon, 12 Nov 2012 16:25:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXwpa-000561-Gk
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 16:25:50 +0000
Received: from [193.109.254.147:64766] by server-6.bemta-14.messagelabs.com id
	B0/49-02788-D0321A05; Mon, 12 Nov 2012 16:25:49 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1352737548!3673994!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16030 invoked from network); 12 Nov 2012 16:25:49 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 16:25:49 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; d="scan'208";a="15755588"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 16:25:44 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 16:25:43 +0000
Message-ID: <1352737542.27833.296.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Mon, 12 Nov 2012 16:25:42 +0000
In-Reply-To: <5081887502000078000A2A51@nat28.tlf.novell.com>
References: <506EE9A7.6090009@amd.com> <50815162.4090601@amd.com>
	<5081869B02000078000A2A1F@nat28.tlf.novell.com>
	<20609.27440.478178.971262@mariner.uk.xensource.com>
	<5081887502000078000A2A51@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Jinsong <jinsong.liu@intel.com>, Haicheng Li <haicheng.li@intel.com>,
	Christoph Egger <Christoph.Egger@amd.com>,
	"Keir \(Xen.org\)" <keir@xen.org>, XudongHao <xudong.hao@intel.com>,
	YunhongJiang <yunhong.jiang@intel.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] tools/xen-mceinj: support AMD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-10-19 at 16:05 +0100, Jan Beulich wrote:
> >>> On 19.10.12 at 17:01, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> > Jan Beulich writes ("Re: [Xen-devel] [PATCH] tools/xen-mceinj: support AMD"):
> >> >>> On 19.10.12 at 15:10, Christoph Egger <Christoph.Egger@amd.com> wrote:
> >> > Ping?
> >> 
> >> I'm afraid it's not really clear who should commit this - it's tools
> >> side code, so IanJ or IanC would normally be the ones, but otoh
> >> it's code requiring low level hardware knowledge to review the
> >> patch, so both of them might want to rather not do the review.
> >> In the past it was usually Keir who eventually committed such
> >> patches, but I don't know whether he put this on his to-look-at-
> >> and-eventually-commit list.
> > 
> > My view is that I would like an ack from someone who understands
> > what's going on ...
> 
> Which would ideally be those who introduced the code, i.e.
> Intel folks if I'm not mistaken...

Lets CC some of them then.

Intel folks -- any opinion on the patch below from Christoph?

8<----------------

# User Christoph Egger
# Date 1349437062 -7200
xen mceinj: support AMD.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>

diff -r 21704bc429b4 -r 1a3eea784e09 tools/tests/mce-test/tools/xen-mceinj.c
--- a/tools/tests/mce-test/tools/xen-mceinj.c
+++ b/tools/tests/mce-test/tools/xen-mceinj.c
@@ -1,6 +1,7 @@
 /*
  * xen-mceinj.c: utilities to inject fake MCE for x86.
  * Copyright (c) 2010, Intel Corporation.
+ * Copyright (c) 2012, AMD Cooperation Inc.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -18,6 +19,7 @@
  * Authors: Yunhong Jiang <yunhong.jiang@intel.com>
  *          Haicheng Li <haicheng.li@intel.com>
  *          Xudong Hao <xudong.hao@intel.com>
+ *          Christoph Egger <Christoph.Egger@amd.com>
  */
 
 
@@ -44,11 +46,14 @@
 #define MCi_type_STATUS     0x1
 #define MCi_type_ADDR       0x2
 #define MCi_type_MISC       0x3
-#define MCi_type_CTL2       0x4
+#define MC4_type_MISC1      0x4
+#define MC4_type_MISC2      0x5
+#define MC4_type_MISC3      0x6
+#define MCi_type_CTL2       0x7
 
 #define INVALID_MSR         ~0UL
 
-/* Intel MSRs */
+/* X86 machine check MSRs */
 #define MSR_IA32_MCG_CAP         0x00000179
 #define MSR_IA32_MCG_STATUS      0x0000017a
 #define MSR_IA32_MCG_CTL         0x0000017b
@@ -56,35 +61,66 @@
 #define MSR_IA32_MC0_STATUS      0x00000401
 #define MSR_IA32_MC0_ADDR        0x00000402
 #define MSR_IA32_MC0_MISC        0x00000403
+
+/* Intel MSRs */
 #define MSR_IA32_MC0_CTL2        0x00000280
 
-/* LLC (Last Level Cache) EWB (Explicit Write Back) SRAO MCE */
+/* Intel: LLC (Last Level Cache) EWB (Explicit Write Back) SRAO MCE */
 #define MCG_STATUS_SRAO_LLC_VAL  0x5
 #define MCE_SRAO_LLC_BANK        0x7
 #define MCi_STATUS_SRAO_LLC_VAL  0xBD2000008000017AUL
 #define MCi_MISC_SRAO_LLC_VAL    0x86UL
 
-/* Memory Patrol Scrub SRAO MCE */
+/* Intel: Memory Patrol Scrub SRAO MCE */
 #define MCG_STATUS_SRAO_MEM_VAL  0x5
 #define MCE_SRAO_MEM_BANK        0x8
 #define MCi_STATUS_SRAO_MEM_VAL  0xBD000000004000CFUL
 #define MCi_MISC_SRAO_MEM_VAL    0x86UL
 
-/* LLC EWB UCNA Error */
+/* Intel: LLC EWB UCNA Error */
 #define MCG_STATUS_UCNA_LLC_VAL  0x0
 #define CMCI_UCNA_LLC_BANK       0x9
 #define MCi_STATUS_UCNA_LLC_VAL  0xBC20000080000136UL
 #define MCi_MISC_UCNA_LLC_VAL    0x86UL
 
-/* Error Types */
-#define MCE_SRAO_MEM        0x0
-#define MCE_SRAO_LLC        0x1
-#define CMCI_UCNA_LLC       0x2
+/* Intel: Error Types */
+#define INTEL_MCE_SRAO_MEM        0x0
+#define INTEL_MCE_SRAO_LLC        0x1
+#define INTEL_CMCI_UCNA_LLC       0x2
+
+/* AMD: Memory Error */
+#define MCG_STATUS_MEM_VAL        0x5
+#define MCE_MEM_BANK              0x4
+#define MCi_STATUS_MEM_VAL        0xb4000000001c0100UL
+//#define MCi_STATUS_MEM_VAL        0xb600000000000100UL
+#define MCi_MISC_MEM_VAL          0x0
+
+/* AMD: L3 Cache Error */
+#define MCG_STATUS_L3_VAL         0x5
+#define MCE_L3_BANK               0x4
+#define MCi_STATUS_L3_VAL         0xbc000400001c010bULL
+#define MC4_MISC0_VAL             0x0
+#define MC4_MISC1_VAL             0x0
+#define MC4_MISC2_L3_VAL          0xc008000000000003ULL
+
+/* AMD: CPU corruption error */
+#define MCG_STATUS_CPU_VAL        0x5
+#define MCE_CPU_BANK              0x2
+#define MCi_STATUS_CPU_VAL        0x9200000000000000ULL
+//#define MCi_STATUS_CPU_VAL        0xb200000000000000ULL
+
+/* AMD: Error Types */
+#define AMD_MCE_MEM               0x20 /* memory error */
+#define AMD_MCE_L3                0x21 /* l3 cache */
 
 #define LOGFILE stdout
 
 int dump;
+int opt_exception;
 struct xen_mc_msrinject msr_inj;
+int cpu_is_amd;
+int cpu_is_intel;
+
 
 static void Lprintf(const char *fmt, ...)
 {
@@ -145,7 +181,7 @@ static int mca_cpuinfo(xc_interface *xc_
         return 0;
 }
 
-static int inject_cmci(xc_interface *xc_handle, int cpu_nr)
+static int intel_inject_cmci(xc_interface *xc_handle)
 {
     struct xen_mc mc;
     int nr_cpus;
@@ -191,6 +227,15 @@ static uint64_t bank_addr(int bank, int 
         case MCi_type_MISC:
             addr = MSR_IA32_MC0_CTL + (bank * 4) + type;
             break;
+        case MC4_type_MISC1:
+            addr = 0xc0000408;
+            break;
+        case MC4_type_MISC2:
+            addr = 0xc0000409;
+            break;
+        case MC4_type_MISC3:
+            addr = 0xc000040a;
+            break;
         case MCi_type_CTL2:
             addr = MSR_IA32_MC0_CTL2 + bank;
             break;
@@ -356,12 +401,11 @@ static int inject_mci_status(xc_interfac
 }
 
 static int inject_mci_misc(xc_interface *xc_handle,
-                             uint32_t cpu_nr,
-                             uint64_t bank,
-                             uint64_t val)
+                             uint32_t cpu_nr, uint32_t misctype,
+                             uint64_t bank, uint64_t val)
 {
     return add_msr_bank_intpose(xc_handle, cpu_nr, MC_MSRINJ_F_INTERPOSE,
-                                    MCi_type_MISC, bank, val); 
+                                    MCi_type_MISC + misctype, bank, val); 
 }
 
 static int inject_mci_addr(xc_interface *xc_handle,
@@ -373,10 +417,8 @@ static int inject_mci_addr(xc_interface 
                                     MCi_type_ADDR, bank, val); 
 }
 
-static int inject_llc_srao(xc_interface *xc_handle,
-                             uint32_t cpu_nr,
-                             uint32_t domain,
-                             uint64_t gaddr)
+static int intel_inject_llc_srao(xc_interface *xc_handle,
+    uint32_t cpu_nr, uint32_t domain, uint64_t gaddr)
 {
     uint64_t gpfn, mfn, haddr;
     int ret = 0;
@@ -390,7 +432,7 @@ static int inject_llc_srao(xc_interface 
     if ( ret )
         err(xc_handle, "Failed to inject MCi_STATUS MSR\n");
 
-    ret = inject_mci_misc(xc_handle, cpu_nr,
+    ret = inject_mci_misc(xc_handle, cpu_nr, 0,
                           MCE_SRAO_LLC_BANK, MCi_MISC_SRAO_LLC_VAL);
     if ( ret )
         err(xc_handle, "Failed to inject MCi_MISC MSR\n");
@@ -407,17 +449,17 @@ static int inject_llc_srao(xc_interface 
     ret = flush_msr_inj(xc_handle);
     if ( ret )
         err(xc_handle, "Failed to inject MSR\n");
-    ret = inject_mce(xc_handle, cpu_nr);
-    if ( ret )
-        err(xc_handle, "Failed to inject MCE error\n");
+    if (opt_exception) {
+        ret = inject_mce(xc_handle, cpu_nr);
+        if ( ret )
+            err(xc_handle, "Failed to inject MCE error\n");
+    }
 
     return 0;
 }
 
-static int inject_mem_srao(xc_interface *xc_handle,
-                             uint32_t cpu_nr,
-                             uint32_t domain,
-                             uint64_t gaddr)
+static int intel_inject_mem_srao(xc_interface *xc_handle,
+    uint32_t cpu_nr, uint32_t domain, uint64_t gaddr)
 {
     uint64_t gpfn, mfn, haddr;
     int ret = 0;
@@ -431,7 +473,7 @@ static int inject_mem_srao(xc_interface 
     if ( ret )
         err(xc_handle, "Failed to inject MCi_STATUS MSR\n");
 
-    ret = inject_mci_misc(xc_handle, cpu_nr,
+    ret = inject_mci_misc(xc_handle, cpu_nr, 0,
                           MCE_SRAO_MEM_BANK, MCi_MISC_SRAO_MEM_VAL);
     if ( ret )
         err(xc_handle, "Failed to inject MCi_MISC MSR\n");
@@ -448,17 +490,17 @@ static int inject_mem_srao(xc_interface 
     ret = flush_msr_inj(xc_handle);
     if ( ret )
         err(xc_handle, "Failed to inject MSR\n");
-    ret = inject_mce(xc_handle, cpu_nr);
-    if ( ret )
-        err(xc_handle, "Failed to inject MCE error\n");
+    if (opt_exception) {
+        ret = inject_mce(xc_handle, cpu_nr);
+        if ( ret )
+            err(xc_handle, "Failed to inject MCE error\n");
+    }
 
     return 0;
 }
 
-static int inject_llc_ucna(xc_interface *xc_handle,
-                             uint32_t cpu_nr,
-                             uint32_t domain,
-                             uint64_t gaddr)
+static int intel_inject_llc_ucna(xc_interface *xc_handle,
+    uint32_t cpu_nr, uint32_t domain, uint64_t gaddr)
 {
     uint64_t gpfn, mfn, haddr;
     int ret = 0;
@@ -472,7 +514,7 @@ static int inject_llc_ucna(xc_interface 
     if ( ret )
         err(xc_handle, "Failed to inject MCi_STATUS MSR\n");
 
-    ret = inject_mci_misc(xc_handle, cpu_nr,
+    ret = inject_mci_misc(xc_handle, cpu_nr, 0,
                           CMCI_UCNA_LLC_BANK, MCi_MISC_UCNA_LLC_VAL);
     if ( ret )
         err(xc_handle, "Failed to inject MCi_MISC MSR\n");
@@ -489,13 +531,108 @@ static int inject_llc_ucna(xc_interface 
     ret = flush_msr_inj(xc_handle);
     if ( ret )
         err(xc_handle, "Failed to inject MSR\n");
-    ret = inject_cmci(xc_handle, cpu_nr);
+    ret = intel_inject_cmci(xc_handle);
     if ( ret )
         err(xc_handle, "Failed to inject MCE error\n");
 
     return 0;
 }
 
+static int amd_inject_mem(xc_interface *xc_handle,
+    uint32_t cpu_nr, uint32_t domain, uint64_t gaddr)
+{
+    uint64_t gpfn, mfn, haddr;
+    int ret = 0;
+
+    ret = inject_mcg_status(xc_handle, cpu_nr, MCG_STATUS_MEM_VAL);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCG_STATUS MSR\n");
+
+    ret = inject_mci_status(xc_handle, cpu_nr,
+                            MCE_MEM_BANK, MCi_STATUS_MEM_VAL);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCi_STATUS MSR\n");
+
+    ret = inject_mci_misc(xc_handle, cpu_nr, 0,
+                          MCE_MEM_BANK, MCi_MISC_MEM_VAL);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCi_MISC MSR\n");
+
+    gpfn = gaddr >> PAGE_SHIFT;
+    mfn = mca_gpfn_to_mfn(xc_handle, domain, gpfn);
+    if (!mfn_valid(mfn))
+        err(xc_handle, "The MFN is not valid\n");
+    haddr = (mfn << PAGE_SHIFT) | (gaddr & (PAGE_SIZE - 1));
+    ret = inject_mci_addr(xc_handle, cpu_nr, MCE_MEM_BANK, haddr);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCi_ADDR MSR\n");
+
+    ret = flush_msr_inj(xc_handle);
+    if ( ret )
+        err(xc_handle, "Failed to inject MSR\n");
+
+    if (opt_exception) {
+        ret = inject_mce(xc_handle, cpu_nr);
+        if ( ret )
+            err(xc_handle, "Failed to inject MCE error\n");
+    }
+
+    return 0;
+}
+
+static int amd_inject_l3(xc_interface *xc_handle,
+    uint32_t cpu_nr, uint32_t domain, uint64_t gaddr)
+{
+    uint64_t gpfn, mfn, haddr;
+    int ret = 0;
+
+    ret = inject_mcg_status(xc_handle, cpu_nr, MCG_STATUS_L3_VAL);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCG_STATUS MSR\n");
+
+    ret = inject_mci_status(xc_handle, cpu_nr,
+                            MCE_L3_BANK, MCi_STATUS_L3_VAL);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCi_STATUS MSR\n");
+
+    ret = inject_mci_misc(xc_handle, cpu_nr, 0,
+                          MCE_L3_BANK, MC4_MISC0_VAL);
+    if ( ret )
+        err(xc_handle, "Failed to inject MC4_MISC0 MSR\n");
+
+    ret = inject_mci_misc(xc_handle, cpu_nr, 1,
+                          MCE_L3_BANK, MC4_MISC1_VAL);
+    if ( ret )
+        err(xc_handle, "Failed to inject MC4_MISC1 MSR\n");
+
+    ret = inject_mci_misc(xc_handle, cpu_nr, 2,
+                          MCE_L3_BANK, MC4_MISC2_L3_VAL);
+    if ( ret )
+        err(xc_handle, "Failed to inject MC4_MISC2 MSR\n");
+
+    gpfn = gaddr >> PAGE_SHIFT;
+    mfn = mca_gpfn_to_mfn(xc_handle, domain, gpfn);
+    if (!mfn_valid(mfn))
+        err(xc_handle, "The MFN is not valid\n");
+    haddr = (mfn << PAGE_SHIFT) | (gaddr & (PAGE_SIZE - 1));
+    ret = inject_mci_addr(xc_handle, cpu_nr, MCE_L3_BANK, haddr);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCi_ADDR MSR\n");
+
+    ret = flush_msr_inj(xc_handle);
+    if ( ret )
+        err(xc_handle, "Failed to inject MSR\n");
+
+    if (opt_exception) {
+        ret = inject_mce(xc_handle, cpu_nr);
+        if ( ret )
+            err(xc_handle, "Failed to inject MCE error\n");
+    }
+
+    return 0;
+}
+
+
 static long xs_get_dom_mem(int domid)
 {
     char path[128];
@@ -508,7 +645,7 @@ static long xs_get_dom_mem(int domid)
     if (!xs)
         return -1;
 
-    sprintf(path, "/local/domain/%d/memory/target", domid);
+    snprintf(path, sizeof(path), "/local/domain/%d/memory/target", domid);
     memstr = xs_read(xs, XBT_NULL, path, &plen);
     xs_daemon_close(xs);
 
@@ -540,30 +677,80 @@ static void help(void)
            "  -D, --dump           dump addr info without error injection\n"
            "  -c, --cpu=CPU_ID     target CPU\n"
            "  -d, --domain=DomID   target domain, the default is Xen itself\n"
+           "  -e                   raise MCE exception\n"
            "  -h, --help           print this page\n"
            "  -p, --phyaddr        physical address\n"
            "  -t, --type=error     error type\n"
-           "                        0 : MCE_SRAO_MEM\n"
-           "                        1 : MCE_SRAO_LLC\n"
-           "                        2 : CMCI_UCNA_LLC\n"
+           "                        0x0 : MCE_SRAO_MEM (Intel only)\n"
+           "                        0x1 : MCE_SRAO_LLC (Intel only)\n"
+           "                        0x2 : CMCI_UCNA_LLC (Intel only)\n"
+           "                        0x20: DRAM error (AMD only)\n"
+           "                        0x21: L3 cache error (AMD only)\n"
            "\n"
            );
 }
 
+static void cpuid(const unsigned int *input, unsigned int *regs)
+{
+    unsigned int count = (input[1] == XEN_CPUID_INPUT_UNUSED) ? 0 : input[1];
+    asm (
+#ifdef __i386__
+        "push %%ebx; push %%edx\n\t"
+#else
+        "push %%rbx; push %%rdx\n\t"
+#endif
+        "cpuid\n\t"
+        "mov %%ebx,4(%4)\n\t"
+        "mov %%edx,12(%4)\n\t"
+#ifdef __i386__
+        "pop %%edx; pop %%ebx\n\t"
+#else
+        "pop %%rdx; pop %%rbx\n\t"
+#endif
+        : "=a" (regs[0]), "=c" (regs[2])
+        : "0" (input[0]), "1" (count), "S" (regs)
+        : "memory" );
+}
+
+/* Get the manufacturer brand name of the host processor. */
+static void cpuid_brand_get(char *str)
+{
+    unsigned int input[2] = { 0, 0 };
+    unsigned int regs[4];
+
+    cpuid(input, regs);
+
+    *(uint32_t *)(str + 0) = regs[1];
+    *(uint32_t *)(str + 4) = regs[3];
+    *(uint32_t *)(str + 8) = regs[2];
+    str[12] = '\0';
+}
+
 int main(int argc, char *argv[])
 {
-    int type = MCE_SRAO_MEM;
+    int type;
     int c, opt_index;
     uint32_t domid;
     xc_interface *xc_handle;
-    int cpu_nr;
-    int64_t gaddr, gpfn, mfn, haddr, max_gpa;
+    unsigned int cpu_nr;
+    uint64_t gaddr, gpfn, mfn, haddr, max_gpa;
+    char cpu_brand[13];
 
     /* Default Value */
     domid = DOMID_XEN;
     gaddr = 0x180020;
     cpu_nr = 0;
 
+    cpu_is_amd = cpu_is_intel = 0;
+    cpuid_brand_get(cpu_brand);
+    if (strstr(cpu_brand, "AMD"))
+        cpu_is_amd = 1;
+    else
+        cpu_is_intel = 1;
+
+    if (cpu_is_intel)
+        type = INTEL_MCE_SRAO_MEM;
+
     init_msr_inj();
     xc_handle = xc_interface_open(0, 0, 0);
     if ( !xc_handle ) {
@@ -571,8 +758,8 @@ int main(int argc, char *argv[])
         exit(EXIT_FAILURE);
     }
 
-    while ( 1 ) {
-        c = getopt_long(argc, argv, "c:Dd:t:hp:r", opts, &opt_index);
+    for (;;) {
+        c = getopt_long(argc, argv, "c:Dd:t:hp:r:e", opts, &opt_index);
         if ( c == -1 )
             break;
         switch ( c ) {
@@ -580,23 +767,26 @@ int main(int argc, char *argv[])
             dump=1;
             break;
         case 'c':
-            cpu_nr = strtol(optarg, &optarg, 10);
+            cpu_nr = strtoul(optarg, &optarg, 0);
             if ( strlen(optarg) != 0 )
                 err(xc_handle, "Please input a digit parameter for CPU\n");
             break;
         case 'd':
-            domid = strtol(optarg, &optarg, 10);
+            domid = strtoul(optarg, &optarg, 0);
             if ( strlen(optarg) != 0 )
                 err(xc_handle, "Please input a digit parameter for domain\n");
             break;
         case 'p':
-            gaddr = strtol(optarg, &optarg, 0);
+            gaddr = strtoul(optarg, &optarg, 0);
             if ( strlen(optarg) != 0 )
                 err(xc_handle, "Please input correct page address\n");
             break;
         case 't':
             type = strtol(optarg, NULL, 0);
             break;
+        case 'e':
+            opt_exception = 1;
+            break;
         case 'h':
         default:
             help();
@@ -627,16 +817,26 @@ int main(int argc, char *argv[])
         goto out;
     }
 
-    switch ( type )
-    {
-    case MCE_SRAO_MEM:
-        inject_mem_srao(xc_handle, cpu_nr, domid, gaddr);
+    switch ( type ) {
+    case INTEL_MCE_SRAO_MEM:
+        if ( cpu_is_intel )
+            intel_inject_mem_srao(xc_handle, cpu_nr, domid, gaddr);
         break;
-    case MCE_SRAO_LLC:
-        inject_llc_srao(xc_handle, cpu_nr, domid, gaddr);
+    case INTEL_MCE_SRAO_LLC:
+        if ( cpu_is_intel )
+            intel_inject_llc_srao(xc_handle, cpu_nr, domid, gaddr);
         break;
-    case CMCI_UCNA_LLC:
-        inject_llc_ucna(xc_handle, cpu_nr, domid, gaddr);
+    case INTEL_CMCI_UCNA_LLC:
+        if ( cpu_is_intel )
+            intel_inject_llc_ucna(xc_handle, cpu_nr, domid, gaddr);
+        break;
+    case AMD_MCE_MEM:
+        if ( cpu_is_amd )
+            amd_inject_mem(xc_handle, cpu_nr, domid, gaddr);
+        break;
+    case AMD_MCE_L3:
+        if ( cpu_is_amd )
+            amd_inject_l3(xc_handle, cpu_nr, domid, gaddr);
         break;
     default:
         err(xc_handle, "Unsupported error type\n");


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:27:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:27:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwqm-0005Hb-9U; Mon, 12 Nov 2012 16:27:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXwqk-0005HQ-Qb
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 16:27:02 +0000
Received: from [85.158.143.99:48611] by server-3.bemta-4.messagelabs.com id
	7A/67-06841-65321A05; Mon, 12 Nov 2012 16:27:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1352737621!18683743!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27450 invoked from network); 12 Nov 2012 16:27:01 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 16:27:01 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; d="scan'208";a="15755630"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 16:27:00 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 16:27:00 +0000
Message-ID: <1352737619.27833.297.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Dario Faggioli <dario.faggioli@citrix.com>
Date: Mon, 12 Nov 2012 16:26:59 +0000
In-Reply-To: <4e5e196ea494ba7c4aaf.1350657295@Solace>
References: <patchbomb.1350657293@Solace>
	<4e5e196ea494ba7c4aaf.1350657295@Solace>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Andre Przywara <andre.przywara@amd.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 3 v2] libxl,
 xl: user can ask for min and max nodes to use during placement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-10-19 at 15:34 +0100, Dario Faggioli wrote:
> @@ -219,6 +219,11 @@ int libxl__domain_build_info_setdefault(
>  
>      libxl_defbool_setdefault(&b_info->numa_placement, true);
>  
> +    if (!b_info->min_nodes)
> +        b_info->min_nodes = 0;
> +    if (!b_info->max_nodes)
> +        b_info->max_nodes = 0; 

Aren't both of these if statements tautologous?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:27:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:27:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwqm-0005Hb-9U; Mon, 12 Nov 2012 16:27:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXwqk-0005HQ-Qb
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 16:27:02 +0000
Received: from [85.158.143.99:48611] by server-3.bemta-4.messagelabs.com id
	7A/67-06841-65321A05; Mon, 12 Nov 2012 16:27:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1352737621!18683743!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27450 invoked from network); 12 Nov 2012 16:27:01 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 16:27:01 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; d="scan'208";a="15755630"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 16:27:00 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 16:27:00 +0000
Message-ID: <1352737619.27833.297.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Dario Faggioli <dario.faggioli@citrix.com>
Date: Mon, 12 Nov 2012 16:26:59 +0000
In-Reply-To: <4e5e196ea494ba7c4aaf.1350657295@Solace>
References: <patchbomb.1350657293@Solace>
	<4e5e196ea494ba7c4aaf.1350657295@Solace>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Andre Przywara <andre.przywara@amd.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 3 v2] libxl,
 xl: user can ask for min and max nodes to use during placement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-10-19 at 15:34 +0100, Dario Faggioli wrote:
> @@ -219,6 +219,11 @@ int libxl__domain_build_info_setdefault(
>  
>      libxl_defbool_setdefault(&b_info->numa_placement, true);
>  
> +    if (!b_info->min_nodes)
> +        b_info->min_nodes = 0;
> +    if (!b_info->max_nodes)
> +        b_info->max_nodes = 0; 

Aren't both of these if statements tautologous?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:31:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:31:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwuL-0005ax-U9; Mon, 12 Nov 2012 16:30:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TXwuJ-0005al-MJ
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 16:30:43 +0000
Received: from [85.158.139.83:16291] by server-10.bemta-5.messagelabs.com id
	4D/A9-09257-23421A05; Mon, 12 Nov 2012 16:30:42 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1352737840!25964182!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1NjgwMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31660 invoked from network); 12 Nov 2012 16:30:41 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 16:30:41 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qACGUbVI030667
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 12 Nov 2012 16:30:38 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qACGUbJk001392
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 12 Nov 2012 16:30:37 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qACGUbco006450; Mon, 12 Nov 2012 10:30:37 -0600
MIME-Version: 1.0
Message-ID: <3f722899-a618-4388-8a09-e68fc50c1a70@default>
Date: Mon, 12 Nov 2012 08:30:35 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Matthew Daley <mattjd@gmail.com>, xen-devel@lists.xen.org
References: <<1352690242-28761-1-git-send-email-mattjd@gmail.com>>
In-Reply-To: <<1352690242-28761-1-git-send-email-mattjd@gmail.com>>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Subject: Re: [Xen-devel] [PATCH] tmem: Prevent NULL dereference on error case
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Matthew Daley [mailto:mattjd@gmail.com]
> Subject: [PATCH] tmem: Prevent NULL dereference on error case
> 
> If the client / pool IDs given to tmemc_save_get_next_page are invalid,
> the calculation of pagesize will dereference NULL.
> 
> Fix this by moving the calculation below the appropriate NULL check.
> 
> Signed-off-by: Matthew Daley <mattjd@gmail.com>

Good catch!

Did you see this on an actual save/restore or just by inspection?
This should only happen as a result of a buggy toolstack so I'm
wondering if fixing this hides a toolstack bug.  In either case,
this should be fixed in the hypervisor.

Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
 
> diff --git a/xen/common/tmem.c b/xen/common/tmem.c
> index 1280537..ec59009 100644
> --- a/xen/common/tmem.c
> +++ b/xen/common/tmem.c
> @@ -2436,10 +2436,13 @@ static NOINLINE int tmemc_save_get_next_page(int cli_id, uint32_t pool_id,
>      OID oid;
>      int ret = 0;
>      struct tmem_handle h;
> -    unsigned int pagesize = 1 << (pool->pageshift+12);
> +    unsigned int pagesize;
> 
>      if ( pool == NULL || is_ephemeral(pool) )
>          return -1;
> +
> +    pagesize = 1 << (pool->pageshift + 12);
> +
>      if ( bufsize < pagesize + sizeof(struct tmem_handle) )
>          return -ENOMEM;
> 
> --
> 1.7.10.4

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:31:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:31:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwuL-0005ax-U9; Mon, 12 Nov 2012 16:30:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TXwuJ-0005al-MJ
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 16:30:43 +0000
Received: from [85.158.139.83:16291] by server-10.bemta-5.messagelabs.com id
	4D/A9-09257-23421A05; Mon, 12 Nov 2012 16:30:42 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1352737840!25964182!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1NjgwMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31660 invoked from network); 12 Nov 2012 16:30:41 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 16:30:41 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qACGUbVI030667
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 12 Nov 2012 16:30:38 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qACGUbJk001392
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 12 Nov 2012 16:30:37 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qACGUbco006450; Mon, 12 Nov 2012 10:30:37 -0600
MIME-Version: 1.0
Message-ID: <3f722899-a618-4388-8a09-e68fc50c1a70@default>
Date: Mon, 12 Nov 2012 08:30:35 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Matthew Daley <mattjd@gmail.com>, xen-devel@lists.xen.org
References: <<1352690242-28761-1-git-send-email-mattjd@gmail.com>>
In-Reply-To: <<1352690242-28761-1-git-send-email-mattjd@gmail.com>>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Subject: Re: [Xen-devel] [PATCH] tmem: Prevent NULL dereference on error case
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Matthew Daley [mailto:mattjd@gmail.com]
> Subject: [PATCH] tmem: Prevent NULL dereference on error case
> 
> If the client / pool IDs given to tmemc_save_get_next_page are invalid,
> the calculation of pagesize will dereference NULL.
> 
> Fix this by moving the calculation below the appropriate NULL check.
> 
> Signed-off-by: Matthew Daley <mattjd@gmail.com>

Good catch!

Did you see this on an actual save/restore or just by inspection?
This should only happen as a result of a buggy toolstack so I'm
wondering if fixing this hides a toolstack bug.  In either case,
this should be fixed in the hypervisor.

Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
 
> diff --git a/xen/common/tmem.c b/xen/common/tmem.c
> index 1280537..ec59009 100644
> --- a/xen/common/tmem.c
> +++ b/xen/common/tmem.c
> @@ -2436,10 +2436,13 @@ static NOINLINE int tmemc_save_get_next_page(int cli_id, uint32_t pool_id,
>      OID oid;
>      int ret = 0;
>      struct tmem_handle h;
> -    unsigned int pagesize = 1 << (pool->pageshift+12);
> +    unsigned int pagesize;
> 
>      if ( pool == NULL || is_ephemeral(pool) )
>          return -1;
> +
> +    pagesize = 1 << (pool->pageshift + 12);
> +
>      if ( bufsize < pagesize + sizeof(struct tmem_handle) )
>          return -ENOMEM;
> 
> --
> 1.7.10.4

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:32:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:32:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwv4-0005iM-ES; Mon, 12 Nov 2012 16:31:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TXwv2-0005hY-1c
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 16:31:29 +0000
Received: from [85.158.137.99:26325] by server-16.bemta-3.messagelabs.com id
	3B/08-07461-B5421A05; Mon, 12 Nov 2012 16:31:23 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1352737880!15645031!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1NjgwMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27379 invoked from network); 12 Nov 2012 16:31:22 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 12 Nov 2012 16:31:22 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qACGV1DK031267
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 12 Nov 2012 16:31:03 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qACGUxRu011184
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 12 Nov 2012 16:30:59 GMT
Received: from abhmt115.oracle.com (abhmt115.oracle.com [141.146.116.67])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qACGUu6b011838; Mon, 12 Nov 2012 10:30:56 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Mon, 12 Nov 2012 08:30:55 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 839FC4037A; Mon, 12 Nov 2012 11:30:52 -0500 (EST)
Date: Mon, 12 Nov 2012 11:30:52 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121112163052.GA9575@phenom.dumpdata.com>
References: <1352730598-13904-1-git-send-email-matthew.fioravante@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352730598-13904-1-git-send-email-matthew.fioravante@jhuapl.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: jeremy@goop.org, xen-devel@lists.xensource.com, tpmdd@selhorst.net,
	linux-kernel@vger.kernel.org, mail@srajiv.net,
	tpmdd-devel@lists.sourceforge.net, key@linux.vnet.ibm.com, tpmdd@sirrix.com
Subject: Re: [Xen-devel] [PATCH v2] add xen-tpmfront.ko: Xen Virtual TPM
	frontend driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 12, 2012 at 09:29:58AM -0500, Matthew Fioravante wrote:
> This patch ports the xen vtpm frontend driver for linux
> from the linux-2.6.18-xen.hg tree to linux-stable. This
> driver is designed be used with the mini-os tpmback driver
> in Xen as part of the new mini-os virtual tpm subsystem.
> See docs/misc/vtpm.txt in Xen and the xen-devel mailing list
> for details.

I didn't look in details but off the bat - you are missing
the Documentation/../sysfs file.

I still think you should include the full vtpm.txt in this
patch description and refer at the end to the docs/misc/vtpm.txt
in Xen as the source for the up-to-date version.

> 
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> ---
>  drivers/char/tpm/Kconfig             |   11 +
>  drivers/char/tpm/Makefile            |    2 +
>  drivers/char/tpm/tpm.h               |   10 +
>  drivers/char/tpm/xen-tpmfront_if.c   |  688 ++++++++++++++++++++++++++++++++++
>  drivers/char/tpm/xen-tpmfront_vtpm.c |  543 +++++++++++++++++++++++++++
>  drivers/char/tpm/xen-tpmfront_vtpm.h |   55 +++
>  include/xen/interface/io/tpmif.h     |   65 ++++
>  7 files changed, 1374 insertions(+)
>  create mode 100644 drivers/char/tpm/xen-tpmfront_if.c
>  create mode 100644 drivers/char/tpm/xen-tpmfront_vtpm.c
>  create mode 100644 drivers/char/tpm/xen-tpmfront_vtpm.h
>  create mode 100644 include/xen/interface/io/tpmif.h
> 
> diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
> index 915875e..23d272f 100644
> --- a/drivers/char/tpm/Kconfig
> +++ b/drivers/char/tpm/Kconfig
> @@ -81,4 +81,15 @@ config TCG_IBMVTPM
>  	  will be accessible from within Linux.  To compile this driver
>  	  as a module, choose M here; the module will be called tpm_ibmvtpm.
>  
> +config TCG_XEN
> +	tristate "XEN TPM Interface"
> +	depends on TCG_TPM && XEN
> +	---help---
> +	  If you want to make TPM support available to a Xen user domain,
> +	  say Yes and it will be accessible from within Linux. See
> +	  the manpages for xl, xl.conf, and docs/misc/vtpm.txt in
> +	  the Xen source repository for more details.
> +	  To compile this driver as a module, choose M here; the module
> +	  will be called xen-tpmfront.
> +
>  endif # TCG_TPM
> diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
> index 5b3fc8b..0161f05 100644
> --- a/drivers/char/tpm/Makefile
> +++ b/drivers/char/tpm/Makefile
> @@ -17,3 +17,5 @@ obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
>  obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
>  obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
>  obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
> +obj-$(CONFIG_TCG_XEN) += xen-tpmfront.o
> +xen-tpmfront-y = xen-tpmfront_if.o xen-tpmfront_vtpm.o
> diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
> index 8ef7649..b575892 100644
> --- a/drivers/char/tpm/tpm.h
> +++ b/drivers/char/tpm/tpm.h
> @@ -328,6 +328,16 @@ extern int tpm_pm_resume(struct device *);
>  extern int wait_for_tpm_stat(struct tpm_chip *, u8, unsigned long,
>  			     wait_queue_head_t *);
>  
> +static inline void *chip_get_private(const struct tpm_chip *chip)
> +{
> +	return chip->vendor.data;
> +}
> +
> +static inline void chip_set_private(struct tpm_chip *chip, void *priv)
> +{
> +	chip->vendor.data = priv;
> +}
> +
>  #ifdef CONFIG_ACPI
>  extern int tpm_add_ppi(struct kobject *);
>  extern void tpm_remove_ppi(struct kobject *);
> diff --git a/drivers/char/tpm/xen-tpmfront_if.c b/drivers/char/tpm/xen-tpmfront_if.c
> new file mode 100644
> index 0000000..ba7fad8
> --- /dev/null
> +++ b/drivers/char/tpm/xen-tpmfront_if.c
> @@ -0,0 +1,688 @@
> +/*
> + * Copyright (c) 2005, IBM Corporation
> + *
> + * Author: Stefan Berger, stefanb@us.ibm.com
> + * Grant table support: Mahadevan Gomathisankaran
> + *
> + * This code has been derived from drivers/xen/netfront/netfront.c
> + *
> + * Copyright (c) 2002-2004, K A Fraser
> + *
> + * 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.
> + */
> +
> +#include <linux/errno.h>
> +#include <linux/err.h>
> +#include <linux/interrupt.h>
> +#include <linux/mutex.h>
> +#include <linux/uaccess.h>
> +#include <xen/events.h>
> +#include <xen/interface/grant_table.h>
> +#include <xen/interface/io/tpmif.h>
> +#include <xen/grant_table.h>
> +#include <xen/xenbus.h>
> +#include <xen/page.h>
> +#include "tpm.h"
> +#include "xen-tpmfront_vtpm.h"
> +
> +#define GRANT_INVALID_REF 0
> +
> +/* local structures */
> +struct tpm_private {
> +	struct tpm_chip *chip;
> +
> +	struct tpmif_tx_interface *tx;
> +	atomic_t refcnt;
> +	unsigned int evtchn;
> +	u8 is_connected;
> +	u8 is_suspended;
> +
> +	spinlock_t tx_lock;
> +
> +	struct tx_buffer *tx_buffers[TPMIF_TX_RING_SIZE];
> +
> +	atomic_t tx_busy;
> +	void *tx_remember;
> +
> +	domid_t backend_id;
> +	wait_queue_head_t wait_q;
> +
> +	struct xenbus_device *dev;
> +	int ring_ref;
> +};
> +
> +struct tx_buffer {
> +	unsigned int size;	/* available space in data */
> +	unsigned int len;	/* used space in data */
> +	unsigned char *data;	/* pointer to a page */
> +};
> +
> +
> +/* locally visible variables */
> +static grant_ref_t gref_head;
> +static struct tpm_private *my_priv;
> +
> +/* local function prototypes */
> +static irqreturn_t tpmif_int(int irq,
> +		void *tpm_priv);
> +static void tpmif_rx_action(unsigned long unused);
> +static int tpmif_connect(struct xenbus_device *dev,
> +		struct tpm_private *tp,
> +		domid_t domid);
> +static DECLARE_TASKLET(tpmif_rx_tasklet, tpmif_rx_action, 0);
> +static int tpmif_allocate_tx_buffers(struct tpm_private *tp);
> +static void tpmif_free_tx_buffers(struct tpm_private *tp);
> +static void tpmif_set_connected_state(struct tpm_private *tp,
> +		u8 newstate);
> +static int tpm_xmit(struct tpm_private *tp,
> +		const u8 *buf, size_t count, int userbuffer,
> +		void *remember);
> +static void destroy_tpmring(struct tpm_private *tp);
> +
> +static inline int
> +tx_buffer_copy(struct tx_buffer *txb, const u8 *src, int len,
> +		int isuserbuffer)
> +{
> +	int copied = len;
> +
> +	if (len > txb->size)
> +		copied = txb->size;
> +	if (isuserbuffer) {
> +		if (copy_from_user(txb->data, src, copied))
> +			return -EFAULT;
> +	} else {
> +		memcpy(txb->data, src, copied);
> +	}
> +	txb->len = len;
> +	return copied;
> +}
> +
> +static inline struct tx_buffer *tx_buffer_alloc(void)
> +{
> +	struct tx_buffer *txb;
> +
> +	txb = kzalloc(sizeof(struct tx_buffer), GFP_KERNEL);
> +	if (!txb)
> +		return NULL;
> +
> +	txb->len = 0;
> +	txb->size = PAGE_SIZE;
> +	txb->data = (unsigned char *)__get_free_page(GFP_KERNEL);
> +	if (txb->data == NULL) {
> +		kfree(txb);
> +		txb = NULL;
> +	}
> +
> +	return txb;
> +}
> +
> +
> +static inline void tx_buffer_free(struct tx_buffer *txb)
> +{
> +	if (txb) {
> +		free_page((long)txb->data);
> +		kfree(txb);
> +	}
> +}
> +
> +/**************************************************************
> +  Utility function for the tpm_private structure
> + **************************************************************/
> +static void tpm_private_init(struct tpm_private *tp)
> +{
> +	spin_lock_init(&tp->tx_lock);
> +	init_waitqueue_head(&tp->wait_q);
> +	atomic_set(&tp->refcnt, 1);
> +}
> +
> +static void tpm_private_put(void)
> +{
> +	if (!atomic_dec_and_test(&my_priv->refcnt))
> +		return;
> +
> +	tpmif_free_tx_buffers(my_priv);
> +	kfree(my_priv);
> +	my_priv = NULL;
> +}
> +
> +static struct tpm_private *tpm_private_get(void)
> +{
> +	int err;
> +
> +	if (my_priv) {
> +		atomic_inc(&my_priv->refcnt);
> +		return my_priv;
> +	}
> +
> +	my_priv = kzalloc(sizeof(struct tpm_private), GFP_KERNEL);
> +	if (!my_priv)
> +		return NULL;
> +
> +	tpm_private_init(my_priv);
> +	err = tpmif_allocate_tx_buffers(my_priv);
> +	if (err < 0)
> +		tpm_private_put();
> +
> +	return my_priv;
> +}
> +
> +/**************************************************************
> +
> +  The interface to let the tpm plugin register its callback
> +  function and send data to another partition using this module
> +
> + **************************************************************/
> +
> +static DEFINE_MUTEX(suspend_lock);
> +/*
> + * Send data via this module by calling this function
> + */
> +int vtpm_vd_send(struct tpm_private *tp,
> +		const u8 *buf, size_t count, void *ptr)
> +{
> +	int sent;
> +
> +	mutex_lock(&suspend_lock);
> +	sent = tpm_xmit(tp, buf, count, 0, ptr);
> +	mutex_unlock(&suspend_lock);
> +
> +	return sent;
> +}
> +
> +/**************************************************************
> +  XENBUS support code
> + **************************************************************/
> +
> +static int setup_tpmring(struct xenbus_device *dev,
> +		struct tpm_private *tp)
> +{
> +	struct tpmif_tx_interface *sring;
> +	int err;
> +
> +	tp->ring_ref = GRANT_INVALID_REF;
> +
> +	sring = (void *)__get_free_page(GFP_KERNEL);
> +	if (!sring) {
> +		xenbus_dev_fatal(dev, -ENOMEM, "allocating shared ring");
> +		return -ENOMEM;
> +	}
> +	tp->tx = sring;
> +
> +	err = xenbus_grant_ring(dev, virt_to_mfn(tp->tx));
> +	if (err < 0) {
> +		free_page((unsigned long)sring);
> +		tp->tx = NULL;
> +		xenbus_dev_fatal(dev, err, "allocating grant reference");
> +		goto fail;
> +	}
> +	tp->ring_ref = err;
> +
> +	err = tpmif_connect(dev, tp, dev->otherend_id);
> +	if (err)
> +		goto fail;
> +
> +	return 0;
> +fail:
> +	destroy_tpmring(tp);
> +	return err;
> +}
> +
> +
> +static void destroy_tpmring(struct tpm_private *tp)
> +{
> +	tpmif_set_connected_state(tp, 0);
> +
> +	if (tp->ring_ref != GRANT_INVALID_REF) {
> +		gnttab_end_foreign_access(tp->ring_ref,
> +				0, (unsigned long)tp->tx);
> +		tp->ring_ref = GRANT_INVALID_REF;
> +		tp->tx = NULL;
> +	}
> +
> +	if (tp->evtchn)
> +		unbind_from_irqhandler(irq_from_evtchn(tp->evtchn), tp);
> +
> +	tp->evtchn = GRANT_INVALID_REF;
> +}
> +
> +
> +static int talk_to_backend(struct xenbus_device *dev,
> +		struct tpm_private *tp)
> +{
> +	const char *message = NULL;
> +	int err;
> +	struct xenbus_transaction xbt;
> +
> +	err = setup_tpmring(dev, tp);
> +	if (err) {
> +		xenbus_dev_fatal(dev, err, "setting up ring");
> +		goto out;
> +	}
> +
> +again:
> +	err = xenbus_transaction_start(&xbt);
> +	if (err) {
> +		xenbus_dev_fatal(dev, err, "starting transaction");
> +		goto destroy_tpmring;
> +	}
> +
> +	err = xenbus_printf(xbt, dev->nodename,
> +			"ring-ref", "%u", tp->ring_ref);
> +	if (err) {
> +		message = "writing ring-ref";
> +		goto abort_transaction;
> +	}
> +
> +	err = xenbus_printf(xbt, dev->nodename, "event-channel", "%u",
> +			tp->evtchn);
> +	if (err) {
> +		message = "writing event-channel";
> +		goto abort_transaction;
> +	}
> +
> +	err = xenbus_transaction_end(xbt, 0);
> +	if (err == -EAGAIN)
> +		goto again;
> +	if (err) {
> +		xenbus_dev_fatal(dev, err, "completing transaction");
> +		goto destroy_tpmring;
> +	}
> +
> +	xenbus_switch_state(dev, XenbusStateConnected);
> +
> +	return 0;
> +
> +abort_transaction:
> +	xenbus_transaction_end(xbt, 1);
> +	if (message)
> +		xenbus_dev_error(dev, err, "%s", message);
> +destroy_tpmring:
> +	destroy_tpmring(tp);
> +out:
> +	return err;
> +}
> +
> +/**
> + * Callback received when the backend's state changes.
> + */
> +static void backend_changed(struct xenbus_device *dev,
> +		enum xenbus_state backend_state)
> +{
> +	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
> +
> +	switch (backend_state) {
> +	case XenbusStateInitialising:
> +	case XenbusStateInitWait:
> +	case XenbusStateInitialised:
> +	case XenbusStateReconfiguring:
> +	case XenbusStateReconfigured:
> +	case XenbusStateUnknown:
> +		break;
> +
> +	case XenbusStateConnected:
> +		tpmif_set_connected_state(tp, 1);
> +		break;
> +
> +	case XenbusStateClosing:
> +		tpmif_set_connected_state(tp, 0);
> +		xenbus_frontend_closed(dev);
> +		break;
> +
> +	case XenbusStateClosed:
> +		tpmif_set_connected_state(tp, 0);
> +		if (tp->is_suspended == 0)
> +			device_unregister(&dev->dev);
> +		xenbus_frontend_closed(dev);
> +		break;
> +	}
> +}
> +
> +static int tpmfront_probe(struct xenbus_device *dev,
> +		const struct xenbus_device_id *id)
> +{
> +	int err;
> +	int handle;
> +	struct tpm_private *tp = tpm_private_get();
> +
> +	if (!tp)
> +		return -ENOMEM;
> +
> +	tp->chip = init_vtpm(&dev->dev, tp);
> +	if (IS_ERR(tp->chip))
> +		return PTR_ERR(tp->chip);
> +
> +	err = xenbus_scanf(XBT_NIL, dev->nodename,
> +			"handle", "%i", &handle);
> +	if (XENBUS_EXIST_ERR(err))
> +		return err;
> +
> +	if (err < 0) {
> +		xenbus_dev_fatal(dev, err, "reading virtual-device");
> +		return err;
> +	}
> +
> +	tp->dev = dev;
> +
> +	err = talk_to_backend(dev, tp);
> +	if (err) {
> +		tpm_private_put();
> +		return err;
> +	}
> +
> +	return 0;
> +}
> +
> +
> +static int __devexit tpmfront_remove(struct xenbus_device *dev)
> +{
> +	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
> +	destroy_tpmring(tp);
> +	cleanup_vtpm(&dev->dev);
> +	return 0;
> +}
> +
> +static int tpmfront_suspend(struct xenbus_device *dev)
> +{
> +	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
> +	u32 ctr;
> +
> +	/* Take the lock, preventing any application from sending. */
> +	mutex_lock(&suspend_lock);
> +	tp->is_suspended = 1;
> +
> +	for (ctr = 0; atomic_read(&tp->tx_busy); ctr++) {
> +		/* Wait for a request to be responded to. */
> +		interruptible_sleep_on_timeout(&tp->wait_q, 100);
> +	}
> +
> +	return 0;
> +}
> +
> +static int tpmfront_suspend_finish(struct tpm_private *tp)
> +{
> +	tp->is_suspended = 0;
> +	/* Allow applications to send again. */
> +	mutex_unlock(&suspend_lock);
> +	return 0;
> +}
> +
> +static int tpmfront_resume(struct xenbus_device *dev)
> +{
> +	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
> +	destroy_tpmring(tp);
> +	return talk_to_backend(dev, tp);
> +}
> +
> +static int tpmif_connect(struct xenbus_device *dev,
> +		struct tpm_private *tp,
> +		domid_t domid)
> +{
> +	int err;
> +
> +	tp->backend_id = domid;
> +	tp->evtchn = GRANT_INVALID_REF;
> +
> +	err = xenbus_alloc_evtchn(dev, &tp->evtchn);
> +	if (err)
> +		return err;
> +
> +	err = bind_evtchn_to_irqhandler(tp->evtchn, tpmif_int,
> +			0, "tpmif", tp);
> +	if (err <= 0)
> +		return err;
> +
> +	return 0;
> +}
> +
> +static const struct xenbus_device_id tpmfront_ids[] = {
> +	{ "vtpm" },
> +	{ "" }
> +};
> +MODULE_ALIAS("xen:vtpm");
> +
> +static DEFINE_XENBUS_DRIVER(tpmfront, ,
> +		.probe = tpmfront_probe,
> +		.remove =  __devexit_p(tpmfront_remove),
> +		.resume = tpmfront_resume,
> +		.otherend_changed = backend_changed,
> +		.suspend = tpmfront_suspend,
> +		);
> +
> +static int tpmif_allocate_tx_buffers(struct tpm_private *tp)
> +{
> +	unsigned int i;
> +
> +	for (i = 0; i < TPMIF_TX_RING_SIZE; i++) {
> +		tp->tx_buffers[i] = tx_buffer_alloc();
> +		if (!tp->tx_buffers[i]) {
> +			tpmif_free_tx_buffers(tp);
> +			return -ENOMEM;
> +		}
> +	}
> +	return 0;
> +}
> +
> +static void tpmif_free_tx_buffers(struct tpm_private *tp)
> +{
> +	unsigned int i;
> +
> +	for (i = 0; i < TPMIF_TX_RING_SIZE; i++)
> +		tx_buffer_free(tp->tx_buffers[i]);
> +}
> +
> +static void tpmif_rx_action(unsigned long priv)
> +{
> +	struct tpm_private *tp = (struct tpm_private *)priv;
> +	int i = 0;
> +	unsigned int received;
> +	unsigned int offset = 0;
> +	u8 *buffer;
> +	struct tpmif_tx_request *tx = &tp->tx->ring[i].req;
> +
> +	atomic_set(&tp->tx_busy, 0);
> +	wake_up_interruptible(&tp->wait_q);
> +
> +	received = tx->size;
> +
> +	buffer = kmalloc(received, GFP_ATOMIC);
> +	if (!buffer)
> +		return;
> +
> +	for (i = 0; i < TPMIF_TX_RING_SIZE && offset < received; i++) {
> +		struct tx_buffer *txb = tp->tx_buffers[i];
> +		struct tpmif_tx_request *tx;
> +		unsigned int tocopy;
> +
> +		tx = &tp->tx->ring[i].req;
> +		tocopy = tx->size;
> +		if (tocopy > PAGE_SIZE)
> +			tocopy = PAGE_SIZE;
> +
> +		memcpy(&buffer[offset], txb->data, tocopy);
> +
> +		gnttab_release_grant_reference(&gref_head, tx->ref);
> +
> +		offset += tocopy;
> +	}
> +
> +	vtpm_vd_recv(tp->chip, buffer, received, tp->tx_remember);
> +	kfree(buffer);
> +}
> +
> +
> +static irqreturn_t tpmif_int(int irq, void *tpm_priv)
> +{
> +	struct tpm_private *tp = tpm_priv;
> +	unsigned long flags;
> +
> +	spin_lock_irqsave(&tp->tx_lock, flags);
> +	tpmif_rx_tasklet.data = (unsigned long)tp;
> +	tasklet_schedule(&tpmif_rx_tasklet);
> +	spin_unlock_irqrestore(&tp->tx_lock, flags);
> +
> +	return IRQ_HANDLED;
> +}
> +
> +
> +static int tpm_xmit(struct tpm_private *tp,
> +		const u8 *buf, size_t count, int isuserbuffer,
> +		void *remember)
> +{
> +	struct tpmif_tx_request *tx;
> +	int i;
> +	unsigned int offset = 0;
> +
> +	spin_lock_irq(&tp->tx_lock);
> +
> +	if (unlikely(atomic_read(&tp->tx_busy))) {
> +		spin_unlock_irq(&tp->tx_lock);
> +		return -EBUSY;
> +	}
> +
> +	if (tp->is_connected != 1) {
> +		spin_unlock_irq(&tp->tx_lock);
> +		return -EIO;
> +	}
> +
> +	for (i = 0; count > 0 && i < TPMIF_TX_RING_SIZE; i++) {
> +		struct tx_buffer *txb = tp->tx_buffers[i];
> +		int copied;
> +
> +		if (!txb) {
> +			spin_unlock_irq(&tp->tx_lock);
> +			return -EFAULT;
> +		}
> +
> +		copied = tx_buffer_copy(txb, &buf[offset], count,
> +				isuserbuffer);
> +		if (copied < 0) {
> +			/* An error occurred */
> +			spin_unlock_irq(&tp->tx_lock);
> +			return copied;
> +		}
> +		count -= copied;
> +		offset += copied;
> +
> +		tx = &tp->tx->ring[i].req;
> +		tx->addr = virt_to_machine(txb->data).maddr;
> +		tx->size = txb->len;
> +		tx->unused = 0;
> +
> +		/* Get the granttable reference for this page. */
> +		tx->ref = gnttab_claim_grant_reference(&gref_head);
> +		if (tx->ref == -ENOSPC) {
> +			spin_unlock_irq(&tp->tx_lock);
> +			return -ENOSPC;
> +		}
> +		gnttab_grant_foreign_access_ref(tx->ref,
> +				tp->backend_id,
> +				virt_to_mfn(txb->data),
> +				0 /*RW*/);
> +		wmb();
> +	}
> +
> +	atomic_set(&tp->tx_busy, 1);
> +	tp->tx_remember = remember;
> +
> +	mb();
> +
> +	notify_remote_via_evtchn(tp->evtchn);
> +
> +	spin_unlock_irq(&tp->tx_lock);
> +	return offset;
> +}
> +
> +
> +static void tpmif_notify_upperlayer(struct tpm_private *tp)
> +{
> +	/* Notify upper layer about the state of the connection to the BE. */
> +	vtpm_vd_status(tp->chip, (tp->is_connected
> +				? TPM_VD_STATUS_CONNECTED
> +				: TPM_VD_STATUS_DISCONNECTED));
> +}
> +
> +
> +static void tpmif_set_connected_state(struct tpm_private *tp, u8 is_connected)
> +{
> +	/*
> +	 * Don't notify upper layer if we are in suspend mode and
> +	 * should disconnect - assumption is that we will resume
> +	 * The mutex keeps apps from sending.
> +	 */
> +	if (is_connected == 0 && tp->is_suspended == 1)
> +		return;
> +
> +	/*
> +	 * Unlock the mutex if we are connected again
> +	 * after being suspended - now resuming.
> +	 * This also removes the suspend state.
> +	 */
> +	if (is_connected == 1 && tp->is_suspended == 1)
> +		tpmfront_suspend_finish(tp);
> +
> +	if (is_connected != tp->is_connected) {
> +		tp->is_connected = is_connected;
> +		tpmif_notify_upperlayer(tp);
> +	}
> +}
> +
> +
> +
> +/* =================================================================
> + * Initialization function.
> + * =================================================================
> + */
> +
> +
> +static int __init tpmif_init(void)
> +{
> +	struct tpm_private *tp;
> +
> +	if (!xen_domain())
> +		return -ENODEV;
> +
> +	tp = tpm_private_get();
> +	if (!tp)
> +		return -ENOMEM;
> +
> +	if (gnttab_alloc_grant_references(TPMIF_TX_RING_SIZE,
> +				&gref_head) < 0) {
> +		tpm_private_put();
> +		return -EFAULT;
> +	}
> +
> +	return xenbus_register_frontend(&tpmfront_driver);
> +}
> +module_init(tpmif_init);
> +
> +static void __exit tpmif_exit(void)
> +{
> +	xenbus_unregister_driver(&tpmfront_driver);
> +	gnttab_free_grant_references(gref_head);
> +	tpm_private_put();
> +}
> +module_exit(tpmif_exit);
> +
> +MODULE_LICENSE("Dual BSD/GPL");
> diff --git a/drivers/char/tpm/xen-tpmfront_vtpm.c b/drivers/char/tpm/xen-tpmfront_vtpm.c
> new file mode 100644
> index 0000000..d70f1df
> --- /dev/null
> +++ b/drivers/char/tpm/xen-tpmfront_vtpm.c
> @@ -0,0 +1,543 @@
> +/*
> + * Copyright (C) 2006 IBM Corporation
> + *
> + * Authors:
> + * Stefan Berger <stefanb@us.ibm.com>
> + *
> + * Generic device driver part for device drivers in a virtualized
> + * environment.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation, version 2 of the
> + * License.
> + *
> + */
> +
> +#include <linux/uaccess.h>
> +#include <linux/list.h>
> +#include <linux/device.h>
> +#include <linux/interrupt.h>
> +#include <linux/platform_device.h>
> +#include <linux/slab.h>
> +#include "tpm.h"
> +#include "xen-tpmfront_vtpm.h"
> +
> +/* read status bits */
> +enum {
> +	STATUS_BUSY = 0x01,
> +	STATUS_DATA_AVAIL = 0x02,
> +	STATUS_READY = 0x04
> +};
> +
> +struct transmission {
> +	struct list_head next;
> +
> +	unsigned char *request;
> +	size_t  request_len;
> +	size_t  request_buflen;
> +
> +	unsigned char *response;
> +	size_t  response_len;
> +	size_t  response_buflen;
> +
> +	unsigned int flags;
> +};
> +
> +enum {
> +	TRANSMISSION_FLAG_WAS_QUEUED = 0x1
> +};
> +
> +
> +enum {
> +	DATAEX_FLAG_QUEUED_ONLY = 0x1
> +};
> +
> +
> +/* local variables */
> +
> +/* local function prototypes */
> +static int _vtpm_send_queued(struct tpm_chip *chip);
> +
> +
> +/* =============================================================
> + * Some utility functions
> + * =============================================================
> + */
> +static void vtpm_state_init(struct vtpm_state *vtpms)
> +{
> +	vtpms->current_request = NULL;
> +	spin_lock_init(&vtpms->req_list_lock);
> +	init_waitqueue_head(&vtpms->req_wait_queue);
> +	INIT_LIST_HEAD(&vtpms->queued_requests);
> +
> +	vtpms->current_response = NULL;
> +	spin_lock_init(&vtpms->resp_list_lock);
> +	init_waitqueue_head(&vtpms->resp_wait_queue);
> +
> +	vtpms->disconnect_time = jiffies;
> +}
> +
> +
> +static inline struct transmission *transmission_alloc(void)
> +{
> +	return kzalloc(sizeof(struct transmission), GFP_ATOMIC);
> +}
> +
> +static unsigned char *
> +transmission_set_req_buffer(struct transmission *t,
> +		unsigned char *buffer, size_t len)
> +{
> +	if (t->request_buflen < len) {
> +		kfree(t->request);
> +		t->request = kmalloc(len, GFP_KERNEL);
> +		if (!t->request) {
> +			t->request_buflen = 0;
> +			return NULL;
> +		}
> +		t->request_buflen = len;
> +	}
> +
> +	memcpy(t->request, buffer, len);
> +	t->request_len = len;
> +
> +	return t->request;
> +}
> +
> +static unsigned char *
> +transmission_set_res_buffer(struct transmission *t,
> +		const unsigned char *buffer, size_t len)
> +{
> +	if (t->response_buflen < len) {
> +		kfree(t->response);
> +		t->response = kmalloc(len, GFP_ATOMIC);
> +		if (!t->response) {
> +			t->response_buflen = 0;
> +			return NULL;
> +		}
> +		t->response_buflen = len;
> +	}
> +
> +	memcpy(t->response, buffer, len);
> +	t->response_len = len;
> +
> +	return t->response;
> +}
> +
> +static inline void transmission_free(struct transmission *t)
> +{
> +	kfree(t->request);
> +	kfree(t->response);
> +	kfree(t);
> +}
> +
> +/* =============================================================
> + * Interface with the lower layer driver
> + * =============================================================
> + */
> +/*
> + * Lower layer uses this function to make a response available.
> + */
> +int vtpm_vd_recv(const struct tpm_chip *chip,
> +		const unsigned char *buffer, size_t count,
> +		void *ptr)
> +{
> +	unsigned long flags;
> +	int ret_size = 0;
> +	struct transmission *t;
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	/*
> +	 * The list with requests must contain one request
> +	 * only and the element there must be the one that
> +	 * was passed to me from the front-end.
> +	 */
> +	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	if (vtpms->current_request != ptr) {
> +		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +		return 0;
> +	}
> +	t = vtpms->current_request;
> +	if (t) {
> +		transmission_free(t);
> +		vtpms->current_request = NULL;
> +	}
> +
> +	t = transmission_alloc();
> +	if (t) {
> +		if (!transmission_set_res_buffer(t, buffer, count)) {
> +			transmission_free(t);
> +			spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +			return -ENOMEM;
> +		}
> +		ret_size = count;
> +		vtpms->current_response = t;
> +		wake_up_interruptible(&vtpms->resp_wait_queue);
> +	}
> +	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +
> +	return ret_size;
> +}
> +
> +
> +/*
> + * Lower layer indicates its status (connected/disconnected)
> + */
> +void vtpm_vd_status(const struct tpm_chip *chip, u8 vd_status)
> +{
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	vtpms->vd_status = vd_status;
> +	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0)
> +		vtpms->disconnect_time = jiffies;
> +}
> +
> +/* =============================================================
> + * Interface with the generic TPM driver
> + * =============================================================
> + */
> +static int vtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count)
> +{
> +	int rc = 0;
> +	unsigned long flags;
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	/*
> +	 * Check if the previous operation only queued the command
> +	 * In this case there won't be a response, so I just
> +	 * return from here and reset that flag. In any other
> +	 * case I should receive a response from the back-end.
> +	 */
> +	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	if ((vtpms->flags & DATAEX_FLAG_QUEUED_ONLY) != 0) {
> +		vtpms->flags &= ~DATAEX_FLAG_QUEUED_ONLY;
> +		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +		/*
> +		 * The first few commands (measurements) must be
> +		 * queued since it might not be possible to talk to the
> +		 * TPM, yet.
> +		 * Return a response of up to 30 '0's.
> +		 */
> +
> +		count = min_t(size_t, count, 30);
> +		memset(buf, 0x0, count);
> +		return count;
> +	}
> +	/*
> +	 * Check whether something is in the responselist and if
> +	 * there's nothing in the list wait for something to appear.
> +	 */
> +
> +	if (!vtpms->current_response) {
> +		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +		interruptible_sleep_on_timeout(&vtpms->resp_wait_queue,
> +				1000);
> +		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	}
> +
> +	if (vtpms->current_response) {
> +		struct transmission *t = vtpms->current_response;
> +		vtpms->current_response = NULL;
> +		rc = min(count, t->response_len);
> +		memcpy(buf, t->response, rc);
> +		transmission_free(t);
> +	}
> +
> +	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +	return rc;
> +}
> +
> +static int vtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)
> +{
> +	int rc = 0;
> +	unsigned long flags;
> +	struct transmission *t = transmission_alloc();
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	if (!t)
> +		return -ENOMEM;
> +	/*
> +	 * If there's a current request, it must be the
> +	 * previous request that has timed out.
> +	 */
> +	spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +	if (vtpms->current_request != NULL) {
> +		dev_warn(chip->dev, "Sending although there is a request outstanding.\n"
> +				"         Previous request must have timed out.\n");
> +		transmission_free(vtpms->current_request);
> +		vtpms->current_request = NULL;
> +	}
> +	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
> +
> +	/*
> +	 * Queue the packet if the driver below is not
> +	 * ready, yet, or there is any packet already
> +	 * in the queue.
> +	 * If the driver below is ready, unqueue all
> +	 * packets first before sending our current
> +	 * packet.
> +	 * For each unqueued packet, except for the
> +	 * last (=current) packet, call the function
> +	 * tpm_xen_recv to wait for the response to come
> +	 * back.
> +	 */
> +	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0) {
> +		if (time_after(jiffies,
> +					vtpms->disconnect_time + HZ * 10)) {
> +			rc = -ENOENT;
> +		} else {
> +			goto queue_it;
> +		}
> +	} else {
> +		/*
> +		 * Send all queued packets.
> +		 */
> +		if (_vtpm_send_queued(chip) == 0) {
> +
> +			vtpms->current_request = t;
> +
> +			rc = vtpm_vd_send(vtpms->tpm_private,
> +					buf,
> +					count,
> +					t);
> +			/*
> +			 * The generic TPM driver will call
> +			 * the function to receive the response.
> +			 */
> +			if (rc < 0) {
> +				vtpms->current_request = NULL;
> +				goto queue_it;
> +			}
> +		} else {
> +queue_it:
> +			if (!transmission_set_req_buffer(t, buf, count)) {
> +				transmission_free(t);
> +				rc = -ENOMEM;
> +				goto exit;
> +			}
> +			/*
> +			 * An error occurred. Don't event try
> +			 * to send the current request. Just
> +			 * queue it.
> +			 */
> +			spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +			vtpms->flags |= DATAEX_FLAG_QUEUED_ONLY;
> +			list_add_tail(&t->next, &vtpms->queued_requests);
> +			spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
> +		}
> +	}
> +
> +exit:
> +	return rc;
> +}
> +
> +
> +/*
> + * Send all queued requests.
> + */
> +static int _vtpm_send_queued(struct tpm_chip *chip)
> +{
> +	int rc;
> +	int error = 0;
> +	unsigned long flags;
> +	unsigned char buffer[1];
> +	struct vtpm_state *vtpms;
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +
> +	while (!list_empty(&vtpms->queued_requests)) {
> +		/*
> +		 * Need to dequeue them.
> +		 * Read the result into a dummy buffer.
> +		 */
> +		struct transmission *qt = (struct transmission *)
> +			vtpms->queued_requests.next;
> +		list_del(&qt->next);
> +		vtpms->current_request = qt;
> +		spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
> +
> +		rc = vtpm_vd_send(vtpms->tpm_private,
> +				qt->request,
> +				qt->request_len,
> +				qt);
> +
> +		if (rc < 0) {
> +			spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +			qt = vtpms->current_request;
> +			if (qt != NULL) {
> +				/*
> +				 * requeue it at the beginning
> +				 * of the list
> +				 */
> +				list_add(&qt->next,
> +						&vtpms->queued_requests);
> +			}
> +			vtpms->current_request = NULL;
> +			error = 1;
> +			break;
> +		}
> +		/*
> +		 * After this point qt is not valid anymore!
> +		 * It is freed when the front-end is delivering
> +		 * the data by calling tpm_recv
> +		 */
> +		/*
> +		 * Receive response into provided dummy buffer
> +		 */
> +		rc = vtpm_recv(chip, buffer, sizeof(buffer));
> +		spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +	}
> +
> +	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
> +
> +	return error;
> +}
> +
> +static void vtpm_cancel(struct tpm_chip *chip)
> +{
> +	unsigned long flags;
> +	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +
> +	if (!vtpms->current_response && vtpms->current_request) {
> +		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +		interruptible_sleep_on(&vtpms->resp_wait_queue);
> +		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	}
> +
> +	if (vtpms->current_response) {
> +		struct transmission *t = vtpms->current_response;
> +		vtpms->current_response = NULL;
> +		transmission_free(t);
> +	}
> +
> +	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +}
> +
> +static u8 vtpm_status(struct tpm_chip *chip)
> +{
> +	u8 rc = 0;
> +	unsigned long flags;
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	/*
> +	 * Data are available if:
> +	 *  - there's a current response
> +	 *  - the last packet was queued only (this is fake, but necessary to
> +	 *      get the generic TPM layer to call the receive function.)
> +	 */
> +	if (vtpms->current_response ||
> +			0 != (vtpms->flags & DATAEX_FLAG_QUEUED_ONLY)) {
> +		rc = STATUS_DATA_AVAIL;
> +	} else if (!vtpms->current_response && !vtpms->current_request) {
> +		rc = STATUS_READY;
> +	}
> +
> +	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +	return rc;
> +}
> +
> +static const struct file_operations vtpm_ops = {
> +	.owner = THIS_MODULE,
> +	.llseek = no_llseek,
> +	.open = tpm_open,
> +	.read = tpm_read,
> +	.write = tpm_write,
> +	.release = tpm_release,
> +};
> +
> +static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
> +static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
> +static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);
> +static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL);
> +static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL);
> +static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,
> +		NULL);
> +static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL);
> +static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
> +
> +static struct attribute *vtpm_attrs[] = {
> +	&dev_attr_pubek.attr,
> +	&dev_attr_pcrs.attr,
> +	&dev_attr_enabled.attr,
> +	&dev_attr_active.attr,
> +	&dev_attr_owned.attr,
> +	&dev_attr_temp_deactivated.attr,
> +	&dev_attr_caps.attr,
> +	&dev_attr_cancel.attr,
> +	NULL,
> +};
> +
> +static struct attribute_group vtpm_attr_grp = { .attrs = vtpm_attrs };
> +
> +#define TPM_LONG_TIMEOUT   (10 * 60 * HZ)
> +
> +static struct tpm_vendor_specific tpm_vtpm = {
> +	.recv = vtpm_recv,
> +	.send = vtpm_send,
> +	.cancel = vtpm_cancel,
> +	.status = vtpm_status,
> +	.req_complete_mask = STATUS_BUSY | STATUS_DATA_AVAIL,
> +	.req_complete_val  = STATUS_DATA_AVAIL,
> +	.req_canceled = STATUS_READY,
> +	.attr_group = &vtpm_attr_grp,
> +	.miscdev = {
> +		.fops = &vtpm_ops,
> +	},
> +	.duration = {
> +		TPM_LONG_TIMEOUT,
> +		TPM_LONG_TIMEOUT,
> +		TPM_LONG_TIMEOUT,
> +	},
> +};
> +
> +struct tpm_chip *init_vtpm(struct device *dev,
> +		struct tpm_private *tp)
> +{
> +	long rc;
> +	struct tpm_chip *chip;
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = kzalloc(sizeof(struct vtpm_state), GFP_KERNEL);
> +	if (!vtpms)
> +		return ERR_PTR(-ENOMEM);
> +
> +	vtpm_state_init(vtpms);
> +	vtpms->tpm_private = tp;
> +
> +	chip = tpm_register_hardware(dev, &tpm_vtpm);
> +	if (!chip) {
> +		rc = -ENODEV;
> +		goto err_free_mem;
> +	}
> +
> +	chip_set_private(chip, vtpms);
> +
> +	return chip;
> +
> +err_free_mem:
> +	kfree(vtpms);
> +
> +	return ERR_PTR(rc);
> +}
> +
> +void cleanup_vtpm(struct device *dev)
> +{
> +	struct tpm_chip *chip = dev_get_drvdata(dev);
> +	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
> +	tpm_remove_hardware(dev);
> +	kfree(vtpms);
> +}
> diff --git a/drivers/char/tpm/xen-tpmfront_vtpm.h b/drivers/char/tpm/xen-tpmfront_vtpm.h
> new file mode 100644
> index 0000000..16cf323
> --- /dev/null
> +++ b/drivers/char/tpm/xen-tpmfront_vtpm.h
> @@ -0,0 +1,55 @@
> +#ifndef XEN_TPMFRONT_VTPM_H
> +#define XEN_TPMFRONT_VTPM_H
> +
> +struct tpm_chip;
> +struct tpm_private;
> +
> +struct vtpm_state {
> +	struct transmission *current_request;
> +	spinlock_t           req_list_lock;
> +	wait_queue_head_t    req_wait_queue;
> +
> +	struct list_head     queued_requests;
> +
> +	struct transmission *current_response;
> +	spinlock_t           resp_list_lock;
> +	wait_queue_head_t    resp_wait_queue;
> +
> +	u8                   vd_status;
> +	u8                   flags;
> +
> +	unsigned long        disconnect_time;
> +
> +	/*
> +	 * The following is a private structure of the underlying
> +	 * driver. It is passed as parameter in the send function.
> +	 */
> +	struct tpm_private *tpm_private;
> +};
> +
> +
> +enum vdev_status {
> +	TPM_VD_STATUS_DISCONNECTED = 0x0,
> +	TPM_VD_STATUS_CONNECTED = 0x1
> +};
> +
> +/* this function is called from tpm_vtpm.c */
> +int vtpm_vd_send(struct tpm_private *tp,
> +		const u8 *buf, size_t count, void *ptr);
> +
> +/* these functions are offered by tpm_vtpm.c */
> +struct tpm_chip *init_vtpm(struct device *,
> +		struct tpm_private *);
> +void cleanup_vtpm(struct device *);
> +int vtpm_vd_recv(const struct tpm_chip *chip,
> +		const unsigned char *buffer, size_t count, void *ptr);
> +void vtpm_vd_status(const struct tpm_chip *, u8 status);
> +
> +static inline struct tpm_private *tpm_private_from_dev(struct device *dev)
> +{
> +	struct tpm_chip *chip = dev_get_drvdata(dev);
> +	struct vtpm_state *vtpms = (struct vtpm_state *)chip->vendor.data;
> +	return vtpms->tpm_private;
> +}
> +
> +#endif
> diff --git a/include/xen/interface/io/tpmif.h b/include/xen/interface/io/tpmif.h
> new file mode 100644
> index 0000000..c9e7294
> --- /dev/null
> +++ b/include/xen/interface/io/tpmif.h
> @@ -0,0 +1,65 @@
> +/******************************************************************************
> + * tpmif.h
> + *
> + * TPM I/O interface for Xen guest OSes.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a copy
> + * of this software and associated documentation files (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.
> + *
> + * Copyright (c) 2005, IBM Corporation
> + *
> + * Author: Stefan Berger, stefanb@us.ibm.com
> + * Grant table support: Mahadevan Gomathisankaran
> + *
> + * This code has been derived from tools/libxc/xen/io/netif.h
> + *
> + * Copyright (c) 2003-2004, Keir Fraser
> + */
> +
> +#ifndef __XEN_PUBLIC_IO_TPMIF_H__
> +#define __XEN_PUBLIC_IO_TPMIF_H__
> +
> +#include "../grant_table.h"
> +
> +struct tpmif_tx_request {
> +	unsigned long addr;   /* Machine address of packet.   */
> +	grant_ref_t ref;      /* grant table access reference */
> +	uint16_t unused;
> +	uint16_t size;        /* Packet size in bytes.        */
> +};
> +struct tpmif_tx_request;
> +
> +/*
> + * The TPMIF_TX_RING_SIZE defines the number of pages the
> + * front-end and backend can exchange (= size of array).
> + */
> +#define TPMIF_TX_RING_SIZE 1
> +
> +/* This structure must fit in a memory page. */
> +
> +struct tpmif_ring {
> +	struct tpmif_tx_request req;
> +};
> +struct tpmif_ring;
> +
> +struct tpmif_tx_interface {
> +	struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
> +};
> +struct tpmif_tx_interface;
> +
> +#endif
> -- 
> 1.7.10.4

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:32:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:32:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwv4-0005iM-ES; Mon, 12 Nov 2012 16:31:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TXwv2-0005hY-1c
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 16:31:29 +0000
Received: from [85.158.137.99:26325] by server-16.bemta-3.messagelabs.com id
	3B/08-07461-B5421A05; Mon, 12 Nov 2012 16:31:23 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1352737880!15645031!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1NjgwMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27379 invoked from network); 12 Nov 2012 16:31:22 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 12 Nov 2012 16:31:22 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qACGV1DK031267
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 12 Nov 2012 16:31:03 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qACGUxRu011184
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 12 Nov 2012 16:30:59 GMT
Received: from abhmt115.oracle.com (abhmt115.oracle.com [141.146.116.67])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qACGUu6b011838; Mon, 12 Nov 2012 10:30:56 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Mon, 12 Nov 2012 08:30:55 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 839FC4037A; Mon, 12 Nov 2012 11:30:52 -0500 (EST)
Date: Mon, 12 Nov 2012 11:30:52 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121112163052.GA9575@phenom.dumpdata.com>
References: <1352730598-13904-1-git-send-email-matthew.fioravante@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352730598-13904-1-git-send-email-matthew.fioravante@jhuapl.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: jeremy@goop.org, xen-devel@lists.xensource.com, tpmdd@selhorst.net,
	linux-kernel@vger.kernel.org, mail@srajiv.net,
	tpmdd-devel@lists.sourceforge.net, key@linux.vnet.ibm.com, tpmdd@sirrix.com
Subject: Re: [Xen-devel] [PATCH v2] add xen-tpmfront.ko: Xen Virtual TPM
	frontend driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 12, 2012 at 09:29:58AM -0500, Matthew Fioravante wrote:
> This patch ports the xen vtpm frontend driver for linux
> from the linux-2.6.18-xen.hg tree to linux-stable. This
> driver is designed be used with the mini-os tpmback driver
> in Xen as part of the new mini-os virtual tpm subsystem.
> See docs/misc/vtpm.txt in Xen and the xen-devel mailing list
> for details.

I didn't look in details but off the bat - you are missing
the Documentation/../sysfs file.

I still think you should include the full vtpm.txt in this
patch description and refer at the end to the docs/misc/vtpm.txt
in Xen as the source for the up-to-date version.

> 
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> ---
>  drivers/char/tpm/Kconfig             |   11 +
>  drivers/char/tpm/Makefile            |    2 +
>  drivers/char/tpm/tpm.h               |   10 +
>  drivers/char/tpm/xen-tpmfront_if.c   |  688 ++++++++++++++++++++++++++++++++++
>  drivers/char/tpm/xen-tpmfront_vtpm.c |  543 +++++++++++++++++++++++++++
>  drivers/char/tpm/xen-tpmfront_vtpm.h |   55 +++
>  include/xen/interface/io/tpmif.h     |   65 ++++
>  7 files changed, 1374 insertions(+)
>  create mode 100644 drivers/char/tpm/xen-tpmfront_if.c
>  create mode 100644 drivers/char/tpm/xen-tpmfront_vtpm.c
>  create mode 100644 drivers/char/tpm/xen-tpmfront_vtpm.h
>  create mode 100644 include/xen/interface/io/tpmif.h
> 
> diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
> index 915875e..23d272f 100644
> --- a/drivers/char/tpm/Kconfig
> +++ b/drivers/char/tpm/Kconfig
> @@ -81,4 +81,15 @@ config TCG_IBMVTPM
>  	  will be accessible from within Linux.  To compile this driver
>  	  as a module, choose M here; the module will be called tpm_ibmvtpm.
>  
> +config TCG_XEN
> +	tristate "XEN TPM Interface"
> +	depends on TCG_TPM && XEN
> +	---help---
> +	  If you want to make TPM support available to a Xen user domain,
> +	  say Yes and it will be accessible from within Linux. See
> +	  the manpages for xl, xl.conf, and docs/misc/vtpm.txt in
> +	  the Xen source repository for more details.
> +	  To compile this driver as a module, choose M here; the module
> +	  will be called xen-tpmfront.
> +
>  endif # TCG_TPM
> diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
> index 5b3fc8b..0161f05 100644
> --- a/drivers/char/tpm/Makefile
> +++ b/drivers/char/tpm/Makefile
> @@ -17,3 +17,5 @@ obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
>  obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
>  obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
>  obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
> +obj-$(CONFIG_TCG_XEN) += xen-tpmfront.o
> +xen-tpmfront-y = xen-tpmfront_if.o xen-tpmfront_vtpm.o
> diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
> index 8ef7649..b575892 100644
> --- a/drivers/char/tpm/tpm.h
> +++ b/drivers/char/tpm/tpm.h
> @@ -328,6 +328,16 @@ extern int tpm_pm_resume(struct device *);
>  extern int wait_for_tpm_stat(struct tpm_chip *, u8, unsigned long,
>  			     wait_queue_head_t *);
>  
> +static inline void *chip_get_private(const struct tpm_chip *chip)
> +{
> +	return chip->vendor.data;
> +}
> +
> +static inline void chip_set_private(struct tpm_chip *chip, void *priv)
> +{
> +	chip->vendor.data = priv;
> +}
> +
>  #ifdef CONFIG_ACPI
>  extern int tpm_add_ppi(struct kobject *);
>  extern void tpm_remove_ppi(struct kobject *);
> diff --git a/drivers/char/tpm/xen-tpmfront_if.c b/drivers/char/tpm/xen-tpmfront_if.c
> new file mode 100644
> index 0000000..ba7fad8
> --- /dev/null
> +++ b/drivers/char/tpm/xen-tpmfront_if.c
> @@ -0,0 +1,688 @@
> +/*
> + * Copyright (c) 2005, IBM Corporation
> + *
> + * Author: Stefan Berger, stefanb@us.ibm.com
> + * Grant table support: Mahadevan Gomathisankaran
> + *
> + * This code has been derived from drivers/xen/netfront/netfront.c
> + *
> + * Copyright (c) 2002-2004, K A Fraser
> + *
> + * 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.
> + */
> +
> +#include <linux/errno.h>
> +#include <linux/err.h>
> +#include <linux/interrupt.h>
> +#include <linux/mutex.h>
> +#include <linux/uaccess.h>
> +#include <xen/events.h>
> +#include <xen/interface/grant_table.h>
> +#include <xen/interface/io/tpmif.h>
> +#include <xen/grant_table.h>
> +#include <xen/xenbus.h>
> +#include <xen/page.h>
> +#include "tpm.h"
> +#include "xen-tpmfront_vtpm.h"
> +
> +#define GRANT_INVALID_REF 0
> +
> +/* local structures */
> +struct tpm_private {
> +	struct tpm_chip *chip;
> +
> +	struct tpmif_tx_interface *tx;
> +	atomic_t refcnt;
> +	unsigned int evtchn;
> +	u8 is_connected;
> +	u8 is_suspended;
> +
> +	spinlock_t tx_lock;
> +
> +	struct tx_buffer *tx_buffers[TPMIF_TX_RING_SIZE];
> +
> +	atomic_t tx_busy;
> +	void *tx_remember;
> +
> +	domid_t backend_id;
> +	wait_queue_head_t wait_q;
> +
> +	struct xenbus_device *dev;
> +	int ring_ref;
> +};
> +
> +struct tx_buffer {
> +	unsigned int size;	/* available space in data */
> +	unsigned int len;	/* used space in data */
> +	unsigned char *data;	/* pointer to a page */
> +};
> +
> +
> +/* locally visible variables */
> +static grant_ref_t gref_head;
> +static struct tpm_private *my_priv;
> +
> +/* local function prototypes */
> +static irqreturn_t tpmif_int(int irq,
> +		void *tpm_priv);
> +static void tpmif_rx_action(unsigned long unused);
> +static int tpmif_connect(struct xenbus_device *dev,
> +		struct tpm_private *tp,
> +		domid_t domid);
> +static DECLARE_TASKLET(tpmif_rx_tasklet, tpmif_rx_action, 0);
> +static int tpmif_allocate_tx_buffers(struct tpm_private *tp);
> +static void tpmif_free_tx_buffers(struct tpm_private *tp);
> +static void tpmif_set_connected_state(struct tpm_private *tp,
> +		u8 newstate);
> +static int tpm_xmit(struct tpm_private *tp,
> +		const u8 *buf, size_t count, int userbuffer,
> +		void *remember);
> +static void destroy_tpmring(struct tpm_private *tp);
> +
> +static inline int
> +tx_buffer_copy(struct tx_buffer *txb, const u8 *src, int len,
> +		int isuserbuffer)
> +{
> +	int copied = len;
> +
> +	if (len > txb->size)
> +		copied = txb->size;
> +	if (isuserbuffer) {
> +		if (copy_from_user(txb->data, src, copied))
> +			return -EFAULT;
> +	} else {
> +		memcpy(txb->data, src, copied);
> +	}
> +	txb->len = len;
> +	return copied;
> +}
> +
> +static inline struct tx_buffer *tx_buffer_alloc(void)
> +{
> +	struct tx_buffer *txb;
> +
> +	txb = kzalloc(sizeof(struct tx_buffer), GFP_KERNEL);
> +	if (!txb)
> +		return NULL;
> +
> +	txb->len = 0;
> +	txb->size = PAGE_SIZE;
> +	txb->data = (unsigned char *)__get_free_page(GFP_KERNEL);
> +	if (txb->data == NULL) {
> +		kfree(txb);
> +		txb = NULL;
> +	}
> +
> +	return txb;
> +}
> +
> +
> +static inline void tx_buffer_free(struct tx_buffer *txb)
> +{
> +	if (txb) {
> +		free_page((long)txb->data);
> +		kfree(txb);
> +	}
> +}
> +
> +/**************************************************************
> +  Utility function for the tpm_private structure
> + **************************************************************/
> +static void tpm_private_init(struct tpm_private *tp)
> +{
> +	spin_lock_init(&tp->tx_lock);
> +	init_waitqueue_head(&tp->wait_q);
> +	atomic_set(&tp->refcnt, 1);
> +}
> +
> +static void tpm_private_put(void)
> +{
> +	if (!atomic_dec_and_test(&my_priv->refcnt))
> +		return;
> +
> +	tpmif_free_tx_buffers(my_priv);
> +	kfree(my_priv);
> +	my_priv = NULL;
> +}
> +
> +static struct tpm_private *tpm_private_get(void)
> +{
> +	int err;
> +
> +	if (my_priv) {
> +		atomic_inc(&my_priv->refcnt);
> +		return my_priv;
> +	}
> +
> +	my_priv = kzalloc(sizeof(struct tpm_private), GFP_KERNEL);
> +	if (!my_priv)
> +		return NULL;
> +
> +	tpm_private_init(my_priv);
> +	err = tpmif_allocate_tx_buffers(my_priv);
> +	if (err < 0)
> +		tpm_private_put();
> +
> +	return my_priv;
> +}
> +
> +/**************************************************************
> +
> +  The interface to let the tpm plugin register its callback
> +  function and send data to another partition using this module
> +
> + **************************************************************/
> +
> +static DEFINE_MUTEX(suspend_lock);
> +/*
> + * Send data via this module by calling this function
> + */
> +int vtpm_vd_send(struct tpm_private *tp,
> +		const u8 *buf, size_t count, void *ptr)
> +{
> +	int sent;
> +
> +	mutex_lock(&suspend_lock);
> +	sent = tpm_xmit(tp, buf, count, 0, ptr);
> +	mutex_unlock(&suspend_lock);
> +
> +	return sent;
> +}
> +
> +/**************************************************************
> +  XENBUS support code
> + **************************************************************/
> +
> +static int setup_tpmring(struct xenbus_device *dev,
> +		struct tpm_private *tp)
> +{
> +	struct tpmif_tx_interface *sring;
> +	int err;
> +
> +	tp->ring_ref = GRANT_INVALID_REF;
> +
> +	sring = (void *)__get_free_page(GFP_KERNEL);
> +	if (!sring) {
> +		xenbus_dev_fatal(dev, -ENOMEM, "allocating shared ring");
> +		return -ENOMEM;
> +	}
> +	tp->tx = sring;
> +
> +	err = xenbus_grant_ring(dev, virt_to_mfn(tp->tx));
> +	if (err < 0) {
> +		free_page((unsigned long)sring);
> +		tp->tx = NULL;
> +		xenbus_dev_fatal(dev, err, "allocating grant reference");
> +		goto fail;
> +	}
> +	tp->ring_ref = err;
> +
> +	err = tpmif_connect(dev, tp, dev->otherend_id);
> +	if (err)
> +		goto fail;
> +
> +	return 0;
> +fail:
> +	destroy_tpmring(tp);
> +	return err;
> +}
> +
> +
> +static void destroy_tpmring(struct tpm_private *tp)
> +{
> +	tpmif_set_connected_state(tp, 0);
> +
> +	if (tp->ring_ref != GRANT_INVALID_REF) {
> +		gnttab_end_foreign_access(tp->ring_ref,
> +				0, (unsigned long)tp->tx);
> +		tp->ring_ref = GRANT_INVALID_REF;
> +		tp->tx = NULL;
> +	}
> +
> +	if (tp->evtchn)
> +		unbind_from_irqhandler(irq_from_evtchn(tp->evtchn), tp);
> +
> +	tp->evtchn = GRANT_INVALID_REF;
> +}
> +
> +
> +static int talk_to_backend(struct xenbus_device *dev,
> +		struct tpm_private *tp)
> +{
> +	const char *message = NULL;
> +	int err;
> +	struct xenbus_transaction xbt;
> +
> +	err = setup_tpmring(dev, tp);
> +	if (err) {
> +		xenbus_dev_fatal(dev, err, "setting up ring");
> +		goto out;
> +	}
> +
> +again:
> +	err = xenbus_transaction_start(&xbt);
> +	if (err) {
> +		xenbus_dev_fatal(dev, err, "starting transaction");
> +		goto destroy_tpmring;
> +	}
> +
> +	err = xenbus_printf(xbt, dev->nodename,
> +			"ring-ref", "%u", tp->ring_ref);
> +	if (err) {
> +		message = "writing ring-ref";
> +		goto abort_transaction;
> +	}
> +
> +	err = xenbus_printf(xbt, dev->nodename, "event-channel", "%u",
> +			tp->evtchn);
> +	if (err) {
> +		message = "writing event-channel";
> +		goto abort_transaction;
> +	}
> +
> +	err = xenbus_transaction_end(xbt, 0);
> +	if (err == -EAGAIN)
> +		goto again;
> +	if (err) {
> +		xenbus_dev_fatal(dev, err, "completing transaction");
> +		goto destroy_tpmring;
> +	}
> +
> +	xenbus_switch_state(dev, XenbusStateConnected);
> +
> +	return 0;
> +
> +abort_transaction:
> +	xenbus_transaction_end(xbt, 1);
> +	if (message)
> +		xenbus_dev_error(dev, err, "%s", message);
> +destroy_tpmring:
> +	destroy_tpmring(tp);
> +out:
> +	return err;
> +}
> +
> +/**
> + * Callback received when the backend's state changes.
> + */
> +static void backend_changed(struct xenbus_device *dev,
> +		enum xenbus_state backend_state)
> +{
> +	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
> +
> +	switch (backend_state) {
> +	case XenbusStateInitialising:
> +	case XenbusStateInitWait:
> +	case XenbusStateInitialised:
> +	case XenbusStateReconfiguring:
> +	case XenbusStateReconfigured:
> +	case XenbusStateUnknown:
> +		break;
> +
> +	case XenbusStateConnected:
> +		tpmif_set_connected_state(tp, 1);
> +		break;
> +
> +	case XenbusStateClosing:
> +		tpmif_set_connected_state(tp, 0);
> +		xenbus_frontend_closed(dev);
> +		break;
> +
> +	case XenbusStateClosed:
> +		tpmif_set_connected_state(tp, 0);
> +		if (tp->is_suspended == 0)
> +			device_unregister(&dev->dev);
> +		xenbus_frontend_closed(dev);
> +		break;
> +	}
> +}
> +
> +static int tpmfront_probe(struct xenbus_device *dev,
> +		const struct xenbus_device_id *id)
> +{
> +	int err;
> +	int handle;
> +	struct tpm_private *tp = tpm_private_get();
> +
> +	if (!tp)
> +		return -ENOMEM;
> +
> +	tp->chip = init_vtpm(&dev->dev, tp);
> +	if (IS_ERR(tp->chip))
> +		return PTR_ERR(tp->chip);
> +
> +	err = xenbus_scanf(XBT_NIL, dev->nodename,
> +			"handle", "%i", &handle);
> +	if (XENBUS_EXIST_ERR(err))
> +		return err;
> +
> +	if (err < 0) {
> +		xenbus_dev_fatal(dev, err, "reading virtual-device");
> +		return err;
> +	}
> +
> +	tp->dev = dev;
> +
> +	err = talk_to_backend(dev, tp);
> +	if (err) {
> +		tpm_private_put();
> +		return err;
> +	}
> +
> +	return 0;
> +}
> +
> +
> +static int __devexit tpmfront_remove(struct xenbus_device *dev)
> +{
> +	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
> +	destroy_tpmring(tp);
> +	cleanup_vtpm(&dev->dev);
> +	return 0;
> +}
> +
> +static int tpmfront_suspend(struct xenbus_device *dev)
> +{
> +	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
> +	u32 ctr;
> +
> +	/* Take the lock, preventing any application from sending. */
> +	mutex_lock(&suspend_lock);
> +	tp->is_suspended = 1;
> +
> +	for (ctr = 0; atomic_read(&tp->tx_busy); ctr++) {
> +		/* Wait for a request to be responded to. */
> +		interruptible_sleep_on_timeout(&tp->wait_q, 100);
> +	}
> +
> +	return 0;
> +}
> +
> +static int tpmfront_suspend_finish(struct tpm_private *tp)
> +{
> +	tp->is_suspended = 0;
> +	/* Allow applications to send again. */
> +	mutex_unlock(&suspend_lock);
> +	return 0;
> +}
> +
> +static int tpmfront_resume(struct xenbus_device *dev)
> +{
> +	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
> +	destroy_tpmring(tp);
> +	return talk_to_backend(dev, tp);
> +}
> +
> +static int tpmif_connect(struct xenbus_device *dev,
> +		struct tpm_private *tp,
> +		domid_t domid)
> +{
> +	int err;
> +
> +	tp->backend_id = domid;
> +	tp->evtchn = GRANT_INVALID_REF;
> +
> +	err = xenbus_alloc_evtchn(dev, &tp->evtchn);
> +	if (err)
> +		return err;
> +
> +	err = bind_evtchn_to_irqhandler(tp->evtchn, tpmif_int,
> +			0, "tpmif", tp);
> +	if (err <= 0)
> +		return err;
> +
> +	return 0;
> +}
> +
> +static const struct xenbus_device_id tpmfront_ids[] = {
> +	{ "vtpm" },
> +	{ "" }
> +};
> +MODULE_ALIAS("xen:vtpm");
> +
> +static DEFINE_XENBUS_DRIVER(tpmfront, ,
> +		.probe = tpmfront_probe,
> +		.remove =  __devexit_p(tpmfront_remove),
> +		.resume = tpmfront_resume,
> +		.otherend_changed = backend_changed,
> +		.suspend = tpmfront_suspend,
> +		);
> +
> +static int tpmif_allocate_tx_buffers(struct tpm_private *tp)
> +{
> +	unsigned int i;
> +
> +	for (i = 0; i < TPMIF_TX_RING_SIZE; i++) {
> +		tp->tx_buffers[i] = tx_buffer_alloc();
> +		if (!tp->tx_buffers[i]) {
> +			tpmif_free_tx_buffers(tp);
> +			return -ENOMEM;
> +		}
> +	}
> +	return 0;
> +}
> +
> +static void tpmif_free_tx_buffers(struct tpm_private *tp)
> +{
> +	unsigned int i;
> +
> +	for (i = 0; i < TPMIF_TX_RING_SIZE; i++)
> +		tx_buffer_free(tp->tx_buffers[i]);
> +}
> +
> +static void tpmif_rx_action(unsigned long priv)
> +{
> +	struct tpm_private *tp = (struct tpm_private *)priv;
> +	int i = 0;
> +	unsigned int received;
> +	unsigned int offset = 0;
> +	u8 *buffer;
> +	struct tpmif_tx_request *tx = &tp->tx->ring[i].req;
> +
> +	atomic_set(&tp->tx_busy, 0);
> +	wake_up_interruptible(&tp->wait_q);
> +
> +	received = tx->size;
> +
> +	buffer = kmalloc(received, GFP_ATOMIC);
> +	if (!buffer)
> +		return;
> +
> +	for (i = 0; i < TPMIF_TX_RING_SIZE && offset < received; i++) {
> +		struct tx_buffer *txb = tp->tx_buffers[i];
> +		struct tpmif_tx_request *tx;
> +		unsigned int tocopy;
> +
> +		tx = &tp->tx->ring[i].req;
> +		tocopy = tx->size;
> +		if (tocopy > PAGE_SIZE)
> +			tocopy = PAGE_SIZE;
> +
> +		memcpy(&buffer[offset], txb->data, tocopy);
> +
> +		gnttab_release_grant_reference(&gref_head, tx->ref);
> +
> +		offset += tocopy;
> +	}
> +
> +	vtpm_vd_recv(tp->chip, buffer, received, tp->tx_remember);
> +	kfree(buffer);
> +}
> +
> +
> +static irqreturn_t tpmif_int(int irq, void *tpm_priv)
> +{
> +	struct tpm_private *tp = tpm_priv;
> +	unsigned long flags;
> +
> +	spin_lock_irqsave(&tp->tx_lock, flags);
> +	tpmif_rx_tasklet.data = (unsigned long)tp;
> +	tasklet_schedule(&tpmif_rx_tasklet);
> +	spin_unlock_irqrestore(&tp->tx_lock, flags);
> +
> +	return IRQ_HANDLED;
> +}
> +
> +
> +static int tpm_xmit(struct tpm_private *tp,
> +		const u8 *buf, size_t count, int isuserbuffer,
> +		void *remember)
> +{
> +	struct tpmif_tx_request *tx;
> +	int i;
> +	unsigned int offset = 0;
> +
> +	spin_lock_irq(&tp->tx_lock);
> +
> +	if (unlikely(atomic_read(&tp->tx_busy))) {
> +		spin_unlock_irq(&tp->tx_lock);
> +		return -EBUSY;
> +	}
> +
> +	if (tp->is_connected != 1) {
> +		spin_unlock_irq(&tp->tx_lock);
> +		return -EIO;
> +	}
> +
> +	for (i = 0; count > 0 && i < TPMIF_TX_RING_SIZE; i++) {
> +		struct tx_buffer *txb = tp->tx_buffers[i];
> +		int copied;
> +
> +		if (!txb) {
> +			spin_unlock_irq(&tp->tx_lock);
> +			return -EFAULT;
> +		}
> +
> +		copied = tx_buffer_copy(txb, &buf[offset], count,
> +				isuserbuffer);
> +		if (copied < 0) {
> +			/* An error occurred */
> +			spin_unlock_irq(&tp->tx_lock);
> +			return copied;
> +		}
> +		count -= copied;
> +		offset += copied;
> +
> +		tx = &tp->tx->ring[i].req;
> +		tx->addr = virt_to_machine(txb->data).maddr;
> +		tx->size = txb->len;
> +		tx->unused = 0;
> +
> +		/* Get the granttable reference for this page. */
> +		tx->ref = gnttab_claim_grant_reference(&gref_head);
> +		if (tx->ref == -ENOSPC) {
> +			spin_unlock_irq(&tp->tx_lock);
> +			return -ENOSPC;
> +		}
> +		gnttab_grant_foreign_access_ref(tx->ref,
> +				tp->backend_id,
> +				virt_to_mfn(txb->data),
> +				0 /*RW*/);
> +		wmb();
> +	}
> +
> +	atomic_set(&tp->tx_busy, 1);
> +	tp->tx_remember = remember;
> +
> +	mb();
> +
> +	notify_remote_via_evtchn(tp->evtchn);
> +
> +	spin_unlock_irq(&tp->tx_lock);
> +	return offset;
> +}
> +
> +
> +static void tpmif_notify_upperlayer(struct tpm_private *tp)
> +{
> +	/* Notify upper layer about the state of the connection to the BE. */
> +	vtpm_vd_status(tp->chip, (tp->is_connected
> +				? TPM_VD_STATUS_CONNECTED
> +				: TPM_VD_STATUS_DISCONNECTED));
> +}
> +
> +
> +static void tpmif_set_connected_state(struct tpm_private *tp, u8 is_connected)
> +{
> +	/*
> +	 * Don't notify upper layer if we are in suspend mode and
> +	 * should disconnect - assumption is that we will resume
> +	 * The mutex keeps apps from sending.
> +	 */
> +	if (is_connected == 0 && tp->is_suspended == 1)
> +		return;
> +
> +	/*
> +	 * Unlock the mutex if we are connected again
> +	 * after being suspended - now resuming.
> +	 * This also removes the suspend state.
> +	 */
> +	if (is_connected == 1 && tp->is_suspended == 1)
> +		tpmfront_suspend_finish(tp);
> +
> +	if (is_connected != tp->is_connected) {
> +		tp->is_connected = is_connected;
> +		tpmif_notify_upperlayer(tp);
> +	}
> +}
> +
> +
> +
> +/* =================================================================
> + * Initialization function.
> + * =================================================================
> + */
> +
> +
> +static int __init tpmif_init(void)
> +{
> +	struct tpm_private *tp;
> +
> +	if (!xen_domain())
> +		return -ENODEV;
> +
> +	tp = tpm_private_get();
> +	if (!tp)
> +		return -ENOMEM;
> +
> +	if (gnttab_alloc_grant_references(TPMIF_TX_RING_SIZE,
> +				&gref_head) < 0) {
> +		tpm_private_put();
> +		return -EFAULT;
> +	}
> +
> +	return xenbus_register_frontend(&tpmfront_driver);
> +}
> +module_init(tpmif_init);
> +
> +static void __exit tpmif_exit(void)
> +{
> +	xenbus_unregister_driver(&tpmfront_driver);
> +	gnttab_free_grant_references(gref_head);
> +	tpm_private_put();
> +}
> +module_exit(tpmif_exit);
> +
> +MODULE_LICENSE("Dual BSD/GPL");
> diff --git a/drivers/char/tpm/xen-tpmfront_vtpm.c b/drivers/char/tpm/xen-tpmfront_vtpm.c
> new file mode 100644
> index 0000000..d70f1df
> --- /dev/null
> +++ b/drivers/char/tpm/xen-tpmfront_vtpm.c
> @@ -0,0 +1,543 @@
> +/*
> + * Copyright (C) 2006 IBM Corporation
> + *
> + * Authors:
> + * Stefan Berger <stefanb@us.ibm.com>
> + *
> + * Generic device driver part for device drivers in a virtualized
> + * environment.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation, version 2 of the
> + * License.
> + *
> + */
> +
> +#include <linux/uaccess.h>
> +#include <linux/list.h>
> +#include <linux/device.h>
> +#include <linux/interrupt.h>
> +#include <linux/platform_device.h>
> +#include <linux/slab.h>
> +#include "tpm.h"
> +#include "xen-tpmfront_vtpm.h"
> +
> +/* read status bits */
> +enum {
> +	STATUS_BUSY = 0x01,
> +	STATUS_DATA_AVAIL = 0x02,
> +	STATUS_READY = 0x04
> +};
> +
> +struct transmission {
> +	struct list_head next;
> +
> +	unsigned char *request;
> +	size_t  request_len;
> +	size_t  request_buflen;
> +
> +	unsigned char *response;
> +	size_t  response_len;
> +	size_t  response_buflen;
> +
> +	unsigned int flags;
> +};
> +
> +enum {
> +	TRANSMISSION_FLAG_WAS_QUEUED = 0x1
> +};
> +
> +
> +enum {
> +	DATAEX_FLAG_QUEUED_ONLY = 0x1
> +};
> +
> +
> +/* local variables */
> +
> +/* local function prototypes */
> +static int _vtpm_send_queued(struct tpm_chip *chip);
> +
> +
> +/* =============================================================
> + * Some utility functions
> + * =============================================================
> + */
> +static void vtpm_state_init(struct vtpm_state *vtpms)
> +{
> +	vtpms->current_request = NULL;
> +	spin_lock_init(&vtpms->req_list_lock);
> +	init_waitqueue_head(&vtpms->req_wait_queue);
> +	INIT_LIST_HEAD(&vtpms->queued_requests);
> +
> +	vtpms->current_response = NULL;
> +	spin_lock_init(&vtpms->resp_list_lock);
> +	init_waitqueue_head(&vtpms->resp_wait_queue);
> +
> +	vtpms->disconnect_time = jiffies;
> +}
> +
> +
> +static inline struct transmission *transmission_alloc(void)
> +{
> +	return kzalloc(sizeof(struct transmission), GFP_ATOMIC);
> +}
> +
> +static unsigned char *
> +transmission_set_req_buffer(struct transmission *t,
> +		unsigned char *buffer, size_t len)
> +{
> +	if (t->request_buflen < len) {
> +		kfree(t->request);
> +		t->request = kmalloc(len, GFP_KERNEL);
> +		if (!t->request) {
> +			t->request_buflen = 0;
> +			return NULL;
> +		}
> +		t->request_buflen = len;
> +	}
> +
> +	memcpy(t->request, buffer, len);
> +	t->request_len = len;
> +
> +	return t->request;
> +}
> +
> +static unsigned char *
> +transmission_set_res_buffer(struct transmission *t,
> +		const unsigned char *buffer, size_t len)
> +{
> +	if (t->response_buflen < len) {
> +		kfree(t->response);
> +		t->response = kmalloc(len, GFP_ATOMIC);
> +		if (!t->response) {
> +			t->response_buflen = 0;
> +			return NULL;
> +		}
> +		t->response_buflen = len;
> +	}
> +
> +	memcpy(t->response, buffer, len);
> +	t->response_len = len;
> +
> +	return t->response;
> +}
> +
> +static inline void transmission_free(struct transmission *t)
> +{
> +	kfree(t->request);
> +	kfree(t->response);
> +	kfree(t);
> +}
> +
> +/* =============================================================
> + * Interface with the lower layer driver
> + * =============================================================
> + */
> +/*
> + * Lower layer uses this function to make a response available.
> + */
> +int vtpm_vd_recv(const struct tpm_chip *chip,
> +		const unsigned char *buffer, size_t count,
> +		void *ptr)
> +{
> +	unsigned long flags;
> +	int ret_size = 0;
> +	struct transmission *t;
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	/*
> +	 * The list with requests must contain one request
> +	 * only and the element there must be the one that
> +	 * was passed to me from the front-end.
> +	 */
> +	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	if (vtpms->current_request != ptr) {
> +		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +		return 0;
> +	}
> +	t = vtpms->current_request;
> +	if (t) {
> +		transmission_free(t);
> +		vtpms->current_request = NULL;
> +	}
> +
> +	t = transmission_alloc();
> +	if (t) {
> +		if (!transmission_set_res_buffer(t, buffer, count)) {
> +			transmission_free(t);
> +			spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +			return -ENOMEM;
> +		}
> +		ret_size = count;
> +		vtpms->current_response = t;
> +		wake_up_interruptible(&vtpms->resp_wait_queue);
> +	}
> +	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +
> +	return ret_size;
> +}
> +
> +
> +/*
> + * Lower layer indicates its status (connected/disconnected)
> + */
> +void vtpm_vd_status(const struct tpm_chip *chip, u8 vd_status)
> +{
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	vtpms->vd_status = vd_status;
> +	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0)
> +		vtpms->disconnect_time = jiffies;
> +}
> +
> +/* =============================================================
> + * Interface with the generic TPM driver
> + * =============================================================
> + */
> +static int vtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count)
> +{
> +	int rc = 0;
> +	unsigned long flags;
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	/*
> +	 * Check if the previous operation only queued the command
> +	 * In this case there won't be a response, so I just
> +	 * return from here and reset that flag. In any other
> +	 * case I should receive a response from the back-end.
> +	 */
> +	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	if ((vtpms->flags & DATAEX_FLAG_QUEUED_ONLY) != 0) {
> +		vtpms->flags &= ~DATAEX_FLAG_QUEUED_ONLY;
> +		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +		/*
> +		 * The first few commands (measurements) must be
> +		 * queued since it might not be possible to talk to the
> +		 * TPM, yet.
> +		 * Return a response of up to 30 '0's.
> +		 */
> +
> +		count = min_t(size_t, count, 30);
> +		memset(buf, 0x0, count);
> +		return count;
> +	}
> +	/*
> +	 * Check whether something is in the responselist and if
> +	 * there's nothing in the list wait for something to appear.
> +	 */
> +
> +	if (!vtpms->current_response) {
> +		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +		interruptible_sleep_on_timeout(&vtpms->resp_wait_queue,
> +				1000);
> +		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	}
> +
> +	if (vtpms->current_response) {
> +		struct transmission *t = vtpms->current_response;
> +		vtpms->current_response = NULL;
> +		rc = min(count, t->response_len);
> +		memcpy(buf, t->response, rc);
> +		transmission_free(t);
> +	}
> +
> +	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +	return rc;
> +}
> +
> +static int vtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)
> +{
> +	int rc = 0;
> +	unsigned long flags;
> +	struct transmission *t = transmission_alloc();
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	if (!t)
> +		return -ENOMEM;
> +	/*
> +	 * If there's a current request, it must be the
> +	 * previous request that has timed out.
> +	 */
> +	spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +	if (vtpms->current_request != NULL) {
> +		dev_warn(chip->dev, "Sending although there is a request outstanding.\n"
> +				"         Previous request must have timed out.\n");
> +		transmission_free(vtpms->current_request);
> +		vtpms->current_request = NULL;
> +	}
> +	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
> +
> +	/*
> +	 * Queue the packet if the driver below is not
> +	 * ready, yet, or there is any packet already
> +	 * in the queue.
> +	 * If the driver below is ready, unqueue all
> +	 * packets first before sending our current
> +	 * packet.
> +	 * For each unqueued packet, except for the
> +	 * last (=current) packet, call the function
> +	 * tpm_xen_recv to wait for the response to come
> +	 * back.
> +	 */
> +	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0) {
> +		if (time_after(jiffies,
> +					vtpms->disconnect_time + HZ * 10)) {
> +			rc = -ENOENT;
> +		} else {
> +			goto queue_it;
> +		}
> +	} else {
> +		/*
> +		 * Send all queued packets.
> +		 */
> +		if (_vtpm_send_queued(chip) == 0) {
> +
> +			vtpms->current_request = t;
> +
> +			rc = vtpm_vd_send(vtpms->tpm_private,
> +					buf,
> +					count,
> +					t);
> +			/*
> +			 * The generic TPM driver will call
> +			 * the function to receive the response.
> +			 */
> +			if (rc < 0) {
> +				vtpms->current_request = NULL;
> +				goto queue_it;
> +			}
> +		} else {
> +queue_it:
> +			if (!transmission_set_req_buffer(t, buf, count)) {
> +				transmission_free(t);
> +				rc = -ENOMEM;
> +				goto exit;
> +			}
> +			/*
> +			 * An error occurred. Don't event try
> +			 * to send the current request. Just
> +			 * queue it.
> +			 */
> +			spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +			vtpms->flags |= DATAEX_FLAG_QUEUED_ONLY;
> +			list_add_tail(&t->next, &vtpms->queued_requests);
> +			spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
> +		}
> +	}
> +
> +exit:
> +	return rc;
> +}
> +
> +
> +/*
> + * Send all queued requests.
> + */
> +static int _vtpm_send_queued(struct tpm_chip *chip)
> +{
> +	int rc;
> +	int error = 0;
> +	unsigned long flags;
> +	unsigned char buffer[1];
> +	struct vtpm_state *vtpms;
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +
> +	while (!list_empty(&vtpms->queued_requests)) {
> +		/*
> +		 * Need to dequeue them.
> +		 * Read the result into a dummy buffer.
> +		 */
> +		struct transmission *qt = (struct transmission *)
> +			vtpms->queued_requests.next;
> +		list_del(&qt->next);
> +		vtpms->current_request = qt;
> +		spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
> +
> +		rc = vtpm_vd_send(vtpms->tpm_private,
> +				qt->request,
> +				qt->request_len,
> +				qt);
> +
> +		if (rc < 0) {
> +			spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +			qt = vtpms->current_request;
> +			if (qt != NULL) {
> +				/*
> +				 * requeue it at the beginning
> +				 * of the list
> +				 */
> +				list_add(&qt->next,
> +						&vtpms->queued_requests);
> +			}
> +			vtpms->current_request = NULL;
> +			error = 1;
> +			break;
> +		}
> +		/*
> +		 * After this point qt is not valid anymore!
> +		 * It is freed when the front-end is delivering
> +		 * the data by calling tpm_recv
> +		 */
> +		/*
> +		 * Receive response into provided dummy buffer
> +		 */
> +		rc = vtpm_recv(chip, buffer, sizeof(buffer));
> +		spin_lock_irqsave(&vtpms->req_list_lock, flags);
> +	}
> +
> +	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
> +
> +	return error;
> +}
> +
> +static void vtpm_cancel(struct tpm_chip *chip)
> +{
> +	unsigned long flags;
> +	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +
> +	if (!vtpms->current_response && vtpms->current_request) {
> +		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +		interruptible_sleep_on(&vtpms->resp_wait_queue);
> +		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	}
> +
> +	if (vtpms->current_response) {
> +		struct transmission *t = vtpms->current_response;
> +		vtpms->current_response = NULL;
> +		transmission_free(t);
> +	}
> +
> +	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +}
> +
> +static u8 vtpm_status(struct tpm_chip *chip)
> +{
> +	u8 rc = 0;
> +	unsigned long flags;
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = (struct vtpm_state *)chip_get_private(chip);
> +
> +	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
> +	/*
> +	 * Data are available if:
> +	 *  - there's a current response
> +	 *  - the last packet was queued only (this is fake, but necessary to
> +	 *      get the generic TPM layer to call the receive function.)
> +	 */
> +	if (vtpms->current_response ||
> +			0 != (vtpms->flags & DATAEX_FLAG_QUEUED_ONLY)) {
> +		rc = STATUS_DATA_AVAIL;
> +	} else if (!vtpms->current_response && !vtpms->current_request) {
> +		rc = STATUS_READY;
> +	}
> +
> +	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
> +	return rc;
> +}
> +
> +static const struct file_operations vtpm_ops = {
> +	.owner = THIS_MODULE,
> +	.llseek = no_llseek,
> +	.open = tpm_open,
> +	.read = tpm_read,
> +	.write = tpm_write,
> +	.release = tpm_release,
> +};
> +
> +static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
> +static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
> +static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);
> +static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL);
> +static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL);
> +static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,
> +		NULL);
> +static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL);
> +static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
> +
> +static struct attribute *vtpm_attrs[] = {
> +	&dev_attr_pubek.attr,
> +	&dev_attr_pcrs.attr,
> +	&dev_attr_enabled.attr,
> +	&dev_attr_active.attr,
> +	&dev_attr_owned.attr,
> +	&dev_attr_temp_deactivated.attr,
> +	&dev_attr_caps.attr,
> +	&dev_attr_cancel.attr,
> +	NULL,
> +};
> +
> +static struct attribute_group vtpm_attr_grp = { .attrs = vtpm_attrs };
> +
> +#define TPM_LONG_TIMEOUT   (10 * 60 * HZ)
> +
> +static struct tpm_vendor_specific tpm_vtpm = {
> +	.recv = vtpm_recv,
> +	.send = vtpm_send,
> +	.cancel = vtpm_cancel,
> +	.status = vtpm_status,
> +	.req_complete_mask = STATUS_BUSY | STATUS_DATA_AVAIL,
> +	.req_complete_val  = STATUS_DATA_AVAIL,
> +	.req_canceled = STATUS_READY,
> +	.attr_group = &vtpm_attr_grp,
> +	.miscdev = {
> +		.fops = &vtpm_ops,
> +	},
> +	.duration = {
> +		TPM_LONG_TIMEOUT,
> +		TPM_LONG_TIMEOUT,
> +		TPM_LONG_TIMEOUT,
> +	},
> +};
> +
> +struct tpm_chip *init_vtpm(struct device *dev,
> +		struct tpm_private *tp)
> +{
> +	long rc;
> +	struct tpm_chip *chip;
> +	struct vtpm_state *vtpms;
> +
> +	vtpms = kzalloc(sizeof(struct vtpm_state), GFP_KERNEL);
> +	if (!vtpms)
> +		return ERR_PTR(-ENOMEM);
> +
> +	vtpm_state_init(vtpms);
> +	vtpms->tpm_private = tp;
> +
> +	chip = tpm_register_hardware(dev, &tpm_vtpm);
> +	if (!chip) {
> +		rc = -ENODEV;
> +		goto err_free_mem;
> +	}
> +
> +	chip_set_private(chip, vtpms);
> +
> +	return chip;
> +
> +err_free_mem:
> +	kfree(vtpms);
> +
> +	return ERR_PTR(rc);
> +}
> +
> +void cleanup_vtpm(struct device *dev)
> +{
> +	struct tpm_chip *chip = dev_get_drvdata(dev);
> +	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
> +	tpm_remove_hardware(dev);
> +	kfree(vtpms);
> +}
> diff --git a/drivers/char/tpm/xen-tpmfront_vtpm.h b/drivers/char/tpm/xen-tpmfront_vtpm.h
> new file mode 100644
> index 0000000..16cf323
> --- /dev/null
> +++ b/drivers/char/tpm/xen-tpmfront_vtpm.h
> @@ -0,0 +1,55 @@
> +#ifndef XEN_TPMFRONT_VTPM_H
> +#define XEN_TPMFRONT_VTPM_H
> +
> +struct tpm_chip;
> +struct tpm_private;
> +
> +struct vtpm_state {
> +	struct transmission *current_request;
> +	spinlock_t           req_list_lock;
> +	wait_queue_head_t    req_wait_queue;
> +
> +	struct list_head     queued_requests;
> +
> +	struct transmission *current_response;
> +	spinlock_t           resp_list_lock;
> +	wait_queue_head_t    resp_wait_queue;
> +
> +	u8                   vd_status;
> +	u8                   flags;
> +
> +	unsigned long        disconnect_time;
> +
> +	/*
> +	 * The following is a private structure of the underlying
> +	 * driver. It is passed as parameter in the send function.
> +	 */
> +	struct tpm_private *tpm_private;
> +};
> +
> +
> +enum vdev_status {
> +	TPM_VD_STATUS_DISCONNECTED = 0x0,
> +	TPM_VD_STATUS_CONNECTED = 0x1
> +};
> +
> +/* this function is called from tpm_vtpm.c */
> +int vtpm_vd_send(struct tpm_private *tp,
> +		const u8 *buf, size_t count, void *ptr);
> +
> +/* these functions are offered by tpm_vtpm.c */
> +struct tpm_chip *init_vtpm(struct device *,
> +		struct tpm_private *);
> +void cleanup_vtpm(struct device *);
> +int vtpm_vd_recv(const struct tpm_chip *chip,
> +		const unsigned char *buffer, size_t count, void *ptr);
> +void vtpm_vd_status(const struct tpm_chip *, u8 status);
> +
> +static inline struct tpm_private *tpm_private_from_dev(struct device *dev)
> +{
> +	struct tpm_chip *chip = dev_get_drvdata(dev);
> +	struct vtpm_state *vtpms = (struct vtpm_state *)chip->vendor.data;
> +	return vtpms->tpm_private;
> +}
> +
> +#endif
> diff --git a/include/xen/interface/io/tpmif.h b/include/xen/interface/io/tpmif.h
> new file mode 100644
> index 0000000..c9e7294
> --- /dev/null
> +++ b/include/xen/interface/io/tpmif.h
> @@ -0,0 +1,65 @@
> +/******************************************************************************
> + * tpmif.h
> + *
> + * TPM I/O interface for Xen guest OSes.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a copy
> + * of this software and associated documentation files (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.
> + *
> + * Copyright (c) 2005, IBM Corporation
> + *
> + * Author: Stefan Berger, stefanb@us.ibm.com
> + * Grant table support: Mahadevan Gomathisankaran
> + *
> + * This code has been derived from tools/libxc/xen/io/netif.h
> + *
> + * Copyright (c) 2003-2004, Keir Fraser
> + */
> +
> +#ifndef __XEN_PUBLIC_IO_TPMIF_H__
> +#define __XEN_PUBLIC_IO_TPMIF_H__
> +
> +#include "../grant_table.h"
> +
> +struct tpmif_tx_request {
> +	unsigned long addr;   /* Machine address of packet.   */
> +	grant_ref_t ref;      /* grant table access reference */
> +	uint16_t unused;
> +	uint16_t size;        /* Packet size in bytes.        */
> +};
> +struct tpmif_tx_request;
> +
> +/*
> + * The TPMIF_TX_RING_SIZE defines the number of pages the
> + * front-end and backend can exchange (= size of array).
> + */
> +#define TPMIF_TX_RING_SIZE 1
> +
> +/* This structure must fit in a memory page. */
> +
> +struct tpmif_ring {
> +	struct tpmif_tx_request req;
> +};
> +struct tpmif_ring;
> +
> +struct tpmif_tx_interface {
> +	struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
> +};
> +struct tpmif_tx_interface;
> +
> +#endif
> -- 
> 1.7.10.4

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:32:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:32:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwvu-0005pO-3e; Mon, 12 Nov 2012 16:32:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TXwvs-0005oP-ML
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 16:32:20 +0000
Received: from [85.158.143.99:13275] by server-2.bemta-4.messagelabs.com id
	0D/F7-28922-49421A05; Mon, 12 Nov 2012 16:32:20 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1352737937!26962564!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1NjgwMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29130 invoked from network); 12 Nov 2012 16:32:19 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-5.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 16:32:19 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qACGW8CN032578
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 12 Nov 2012 16:32:09 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qACGW7Rc004836
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 12 Nov 2012 16:32:07 GMT
Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qACGW7QN012977; Mon, 12 Nov 2012 10:32:07 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Mon, 12 Nov 2012 08:32:07 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 3DF904046C; Mon, 12 Nov 2012 11:32:04 -0500 (EST)
Date: Mon, 12 Nov 2012 11:32:04 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Sander Eikelenboom <linux@eikelenboom.it>
Message-ID: <20121112163204.GB9575@phenom.dumpdata.com>
References: <20121110135931.GD23686@localhost.localdomain>
	<1352714084.27833.137.camel@zakaz.uk.xensource.com>
	<20121112142835.GG19860@phenom.dumpdata.com>
	<711956045.20121112155024@eikelenboom.it>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <711956045.20121112155024@eikelenboom.it>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "annie.li@oracle.com" <annie.li@oracle.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"marcos.matsunaga@oracle.com" <marcos.matsunaga@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] domU to domU networking issues in v3.7?
 (netserver/netperf failing to communicate)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 12, 2012 at 03:50:24PM +0100, Sander Eikelenboom wrote:
> 
> Monday, November 12, 2012, 3:28:35 PM, you wrote:
> 
> > On Mon, Nov 12, 2012 at 09:54:44AM +0000, Ian Campbell wrote:
> >> On Sat, 2012-11-10 at 13:59 +0000, Konrad Rzeszutek Wilk wrote:
> >> > Hey Ian, Xen-devel mailingl list,
> >> > 
> >> > I think the issue of 70% traffic lost was actually introduced in v3.6 or
> >> > perhaps v3.5. Annie and Marcos (CC-ed here) are looking to see which of
> >> > the releases introduced this. The issue we are seeing is that a domU
> >> > to domU communication breaks - this is with netperf/netserver talking to
> >> > each other.
> >> > 
> >> > Anyhow, I think the 3.7 compound page exacerbated the problem and also
> >> > (at least on some of my test hardware) exposed existing issues with
> >> > drivers. The issue I have is that the 'skge' driver has a bug that has
> >> > been there for ages (I tested way back to 3.0 and still saw it) were it
> >> > can not work with SWIOTLB. It is probably missing an pci_dma_sync
> >> > somewhere. 
> >> > 
> >> > Anyhow the compound page got me to look at Xen-SWIOTLB and that looks
> >> > OK. Even with synthetic driver (the fake one I posted somewhere) it
> >> > dealt with compound pages properly (with debug or non-debug Xen
> >> > hypervisor).
> >> 
> >> The debug build is probably most interesting since it deliberately
> >> allocates a non 1-1 p-to-m mapping so as to catch exactly these sorts of
> >> issues.
> 
> > Right. My test env runs with that. And so far it only has issues
> > with the skge one.
> >> 
> >> > So was wondering if you had looked at this in more details? Any
> >> > ideas? Or would it be more prudent to ask that once we know for sure
> >> > which Linux release introduced the communication failures between
> >> > guests?
> >> 
> >> I've not looked at it any further I'm afraid.
> >> 
> >> If these changes (be they in 3.5 or later, or earlier) are exposing
> >> driver bugs then I suspect the netdev chaps would want to know about it.
> 
> > Right. Annie (CC-ed here) mentioned to me that v3.5 looks to work ok.
> > And is off checking v3.6. v3.7 is definitly a no go.
> >> 
> >> FWIW I see the issue with tg3.
> 
> After the issues with netback where fixed, I'm seeing the issues with net_front reverting the single commit 5640f7685831e088fe6c2e1f863a6805962f8e81 (that was pointed out for netback) also makes these disappear.

Were you ever able to trigger the BUG_ON in the patch that Ian posted?

> I haven't seen issues with netfront and netback before this commit. FWIW: the hardware nics in this machine are two r8169 's.
> 
> --
> Sander
> 
> > I should double-check that but I didn't get any issues with the tg3 I had.
> 
> > I was running the netperf/netserver from/to to see if I could reproduce the
> > issues (70% loss) you described but did not have much luck.
> 
> >> 
> >> Ian.
> 
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:32:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:32:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwvu-0005pO-3e; Mon, 12 Nov 2012 16:32:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TXwvs-0005oP-ML
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 16:32:20 +0000
Received: from [85.158.143.99:13275] by server-2.bemta-4.messagelabs.com id
	0D/F7-28922-49421A05; Mon, 12 Nov 2012 16:32:20 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1352737937!26962564!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1NjgwMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29130 invoked from network); 12 Nov 2012 16:32:19 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-5.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 16:32:19 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qACGW8CN032578
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 12 Nov 2012 16:32:09 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qACGW7Rc004836
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 12 Nov 2012 16:32:07 GMT
Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qACGW7QN012977; Mon, 12 Nov 2012 10:32:07 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Mon, 12 Nov 2012 08:32:07 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 3DF904046C; Mon, 12 Nov 2012 11:32:04 -0500 (EST)
Date: Mon, 12 Nov 2012 11:32:04 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Sander Eikelenboom <linux@eikelenboom.it>
Message-ID: <20121112163204.GB9575@phenom.dumpdata.com>
References: <20121110135931.GD23686@localhost.localdomain>
	<1352714084.27833.137.camel@zakaz.uk.xensource.com>
	<20121112142835.GG19860@phenom.dumpdata.com>
	<711956045.20121112155024@eikelenboom.it>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <711956045.20121112155024@eikelenboom.it>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "annie.li@oracle.com" <annie.li@oracle.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"marcos.matsunaga@oracle.com" <marcos.matsunaga@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] domU to domU networking issues in v3.7?
 (netserver/netperf failing to communicate)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 12, 2012 at 03:50:24PM +0100, Sander Eikelenboom wrote:
> 
> Monday, November 12, 2012, 3:28:35 PM, you wrote:
> 
> > On Mon, Nov 12, 2012 at 09:54:44AM +0000, Ian Campbell wrote:
> >> On Sat, 2012-11-10 at 13:59 +0000, Konrad Rzeszutek Wilk wrote:
> >> > Hey Ian, Xen-devel mailingl list,
> >> > 
> >> > I think the issue of 70% traffic lost was actually introduced in v3.6 or
> >> > perhaps v3.5. Annie and Marcos (CC-ed here) are looking to see which of
> >> > the releases introduced this. The issue we are seeing is that a domU
> >> > to domU communication breaks - this is with netperf/netserver talking to
> >> > each other.
> >> > 
> >> > Anyhow, I think the 3.7 compound page exacerbated the problem and also
> >> > (at least on some of my test hardware) exposed existing issues with
> >> > drivers. The issue I have is that the 'skge' driver has a bug that has
> >> > been there for ages (I tested way back to 3.0 and still saw it) were it
> >> > can not work with SWIOTLB. It is probably missing an pci_dma_sync
> >> > somewhere. 
> >> > 
> >> > Anyhow the compound page got me to look at Xen-SWIOTLB and that looks
> >> > OK. Even with synthetic driver (the fake one I posted somewhere) it
> >> > dealt with compound pages properly (with debug or non-debug Xen
> >> > hypervisor).
> >> 
> >> The debug build is probably most interesting since it deliberately
> >> allocates a non 1-1 p-to-m mapping so as to catch exactly these sorts of
> >> issues.
> 
> > Right. My test env runs with that. And so far it only has issues
> > with the skge one.
> >> 
> >> > So was wondering if you had looked at this in more details? Any
> >> > ideas? Or would it be more prudent to ask that once we know for sure
> >> > which Linux release introduced the communication failures between
> >> > guests?
> >> 
> >> I've not looked at it any further I'm afraid.
> >> 
> >> If these changes (be they in 3.5 or later, or earlier) are exposing
> >> driver bugs then I suspect the netdev chaps would want to know about it.
> 
> > Right. Annie (CC-ed here) mentioned to me that v3.5 looks to work ok.
> > And is off checking v3.6. v3.7 is definitly a no go.
> >> 
> >> FWIW I see the issue with tg3.
> 
> After the issues with netback where fixed, I'm seeing the issues with net_front reverting the single commit 5640f7685831e088fe6c2e1f863a6805962f8e81 (that was pointed out for netback) also makes these disappear.

Were you ever able to trigger the BUG_ON in the patch that Ian posted?

> I haven't seen issues with netfront and netback before this commit. FWIW: the hardware nics in this machine are two r8169 's.
> 
> --
> Sander
> 
> > I should double-check that but I didn't get any issues with the tg3 I had.
> 
> > I was running the netperf/netserver from/to to see if I could reproduce the
> > issues (70% loss) you described but did not have much luck.
> 
> >> 
> >> Ian.
> 
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:35:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:35:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwyN-00066A-LM; Mon, 12 Nov 2012 16:34:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dario.faggioli@citrix.com>) id 1TXwyM-00065x-GG
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 16:34:55 +0000
Received: from [85.158.138.51:59998] by server-11.bemta-3.messagelabs.com id
	97/36-19361-D2521A05; Mon, 12 Nov 2012 16:34:53 +0000
X-Env-Sender: dario.faggioli@citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352738092!21632071!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22271 invoked from network); 12 Nov 2012 16:34:53 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 16:34:53 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; 
	d="asc'?scan'208";a="15756004"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 16:34:52 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 16:34:51 +0000
Message-ID: <1352738082.32203.7.camel@Solace>
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Date: Mon, 12 Nov 2012 17:34:42 +0100
In-Reply-To: <1352737619.27833.297.camel@zakaz.uk.xensource.com>
References: <patchbomb.1350657293@Solace>
	<4e5e196ea494ba7c4aaf.1350657295@Solace>
	<1352737619.27833.297.camel@zakaz.uk.xensource.com>
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Andre Przywara <andre.przywara@amd.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 3 v2] libxl,
 xl: user can ask for min and max nodes to use during placement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8351398986138395391=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============8351398986138395391==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="=-qZuhBs324O6DucYIS65i"

--=-qZuhBs324O6DucYIS65i
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, 2012-11-12 at 16:26 +0000, Ian Campbell wrote:
> On Fri, 2012-10-19 at 15:34 +0100, Dario Faggioli wrote:
> > @@ -219,6 +219,11 @@ int libxl__domain_build_info_setdefault(
> > =20
> >      libxl_defbool_setdefault(&b_info->numa_placement, true);
> > =20
> > +    if (!b_info->min_nodes)
> > +        b_info->min_nodes =3D 0;
> > +    if (!b_info->max_nodes)
> > +        b_info->max_nodes =3D 0;=20
>=20
> Aren't both of these if statements tautologous?
>=20
Looks like they are. I'll double check this before reposting.

I think what I wanted to do was making sure to zero those new fields, if
not otherwise initialized by someone else... and, of course, I got that
wrong! :-P


Thanks,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-qZuhBs324O6DucYIS65i
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlChJSIACgkQk4XaBE3IOsR7LwCeIdLCWcOJtBiiMcMBnHxnjlQO
FasAnRLhIGzhJaVtGXDrD+AUikdyRxaU
=jyVz
-----END PGP SIGNATURE-----

--=-qZuhBs324O6DucYIS65i--


--===============8351398986138395391==
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.xen.org
http://lists.xen.org/xen-devel

--===============8351398986138395391==--


From xen-devel-bounces@lists.xen.org Mon Nov 12 16:35:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:35:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXwyN-00066A-LM; Mon, 12 Nov 2012 16:34:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dario.faggioli@citrix.com>) id 1TXwyM-00065x-GG
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 16:34:55 +0000
Received: from [85.158.138.51:59998] by server-11.bemta-3.messagelabs.com id
	97/36-19361-D2521A05; Mon, 12 Nov 2012 16:34:53 +0000
X-Env-Sender: dario.faggioli@citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352738092!21632071!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22271 invoked from network); 12 Nov 2012 16:34:53 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 16:34:53 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; 
	d="asc'?scan'208";a="15756004"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 16:34:52 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 16:34:51 +0000
Message-ID: <1352738082.32203.7.camel@Solace>
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Date: Mon, 12 Nov 2012 17:34:42 +0100
In-Reply-To: <1352737619.27833.297.camel@zakaz.uk.xensource.com>
References: <patchbomb.1350657293@Solace>
	<4e5e196ea494ba7c4aaf.1350657295@Solace>
	<1352737619.27833.297.camel@zakaz.uk.xensource.com>
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Andre Przywara <andre.przywara@amd.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 3 v2] libxl,
 xl: user can ask for min and max nodes to use during placement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8351398986138395391=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============8351398986138395391==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="=-qZuhBs324O6DucYIS65i"

--=-qZuhBs324O6DucYIS65i
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, 2012-11-12 at 16:26 +0000, Ian Campbell wrote:
> On Fri, 2012-10-19 at 15:34 +0100, Dario Faggioli wrote:
> > @@ -219,6 +219,11 @@ int libxl__domain_build_info_setdefault(
> > =20
> >      libxl_defbool_setdefault(&b_info->numa_placement, true);
> > =20
> > +    if (!b_info->min_nodes)
> > +        b_info->min_nodes =3D 0;
> > +    if (!b_info->max_nodes)
> > +        b_info->max_nodes =3D 0;=20
>=20
> Aren't both of these if statements tautologous?
>=20
Looks like they are. I'll double check this before reposting.

I think what I wanted to do was making sure to zero those new fields, if
not otherwise initialized by someone else... and, of course, I got that
wrong! :-P


Thanks,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-qZuhBs324O6DucYIS65i
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlChJSIACgkQk4XaBE3IOsR7LwCeIdLCWcOJtBiiMcMBnHxnjlQO
FasAnRLhIGzhJaVtGXDrD+AUikdyRxaU
=jyVz
-----END PGP SIGNATURE-----

--=-qZuhBs324O6DucYIS65i--


--===============8351398986138395391==
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.xen.org
http://lists.xen.org/xen-devel

--===============8351398986138395391==--


From xen-devel-bounces@lists.xen.org Mon Nov 12 16:44:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:44:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXx6e-0006S3-L6; Mon, 12 Nov 2012 16:43:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXx6d-0006Ry-2h
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 16:43:27 +0000
Received: from [193.109.254.147:61408] by server-12.bemta-14.messagelabs.com
	id D1/6B-00510-E2721A05; Mon, 12 Nov 2012 16:43:26 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352738560!2721831!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2682 invoked from network); 12 Nov 2012 16:42:40 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 16:42:40 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; d="scan'208";a="15756194"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 16:42:39 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 16:42:39 +0000
Message-ID: <1352738557.27833.302.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jacek Konieczny <jajcus@jajcus.net>
Date: Mon, 12 Nov 2012 16:42:37 +0000
In-Reply-To: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, Ian
	Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] Fix locking in
 tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-09 at 13:56 +0000, Jacek Konieczny wrote:
> The claim_lock() function would fail in the perl code with:
> 
>   Invalid argument at -e line 2.
> 
> because the Perl snippet opens for reading the file descriptor, which
> was earlier opened for write (append).

Looks plausible to me.

How does this interact with the 
        eval "exec $_lockfd<&-"
which Olaf added in 26079:b3b03536789a ? I suppose close is close and
<&- and >&- or even <>&- are equivalent?

> 
> Signed-off-by: Jacek Konieczny <jajcus@jajcus.net>
> ---
>  tools/hotplug/Linux/locking.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/hotplug/Linux/locking.sh b/tools/hotplug/Linux/locking.sh
> index e34f155..122bcfb 100644
> --- a/tools/hotplug/Linux/locking.sh
> +++ b/tools/hotplug/Linux/locking.sh
> @@ -44,7 +44,7 @@ claim_lock()
>      # See below for a correctness proof.
>      local rightfile
>      while true; do
> -        eval "exec $_lockfd>>$_lockfile"
> +        eval "exec $_lockfd<>$_lockfile"
>          flock -x $_lockfd || return $?
>          # We can't just stat /dev/stdin or /proc/self/fd/$_lockfd or
>          # use bash's test -ef because those all go through what is



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:44:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:44:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXx6e-0006S3-L6; Mon, 12 Nov 2012 16:43:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXx6d-0006Ry-2h
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 16:43:27 +0000
Received: from [193.109.254.147:61408] by server-12.bemta-14.messagelabs.com
	id D1/6B-00510-E2721A05; Mon, 12 Nov 2012 16:43:26 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352738560!2721831!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2682 invoked from network); 12 Nov 2012 16:42:40 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 16:42:40 -0000
X-IronPort-AV: E=Sophos;i="4.80,762,1344211200"; d="scan'208";a="15756194"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 16:42:39 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 16:42:39 +0000
Message-ID: <1352738557.27833.302.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jacek Konieczny <jajcus@jajcus.net>
Date: Mon, 12 Nov 2012 16:42:37 +0000
In-Reply-To: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, Ian
	Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] Fix locking in
 tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-09 at 13:56 +0000, Jacek Konieczny wrote:
> The claim_lock() function would fail in the perl code with:
> 
>   Invalid argument at -e line 2.
> 
> because the Perl snippet opens for reading the file descriptor, which
> was earlier opened for write (append).

Looks plausible to me.

How does this interact with the 
        eval "exec $_lockfd<&-"
which Olaf added in 26079:b3b03536789a ? I suppose close is close and
<&- and >&- or even <>&- are equivalent?

> 
> Signed-off-by: Jacek Konieczny <jajcus@jajcus.net>
> ---
>  tools/hotplug/Linux/locking.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/hotplug/Linux/locking.sh b/tools/hotplug/Linux/locking.sh
> index e34f155..122bcfb 100644
> --- a/tools/hotplug/Linux/locking.sh
> +++ b/tools/hotplug/Linux/locking.sh
> @@ -44,7 +44,7 @@ claim_lock()
>      # See below for a correctness proof.
>      local rightfile
>      while true; do
> -        eval "exec $_lockfd>>$_lockfile"
> +        eval "exec $_lockfd<>$_lockfile"
>          flock -x $_lockfd || return $?
>          # We can't just stat /dev/stdin or /proc/self/fd/$_lockfd or
>          # use bash's test -ef because those all go through what is



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:59:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:59:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXxM0-0006g5-8w; Mon, 12 Nov 2012 16:59:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TXxLy-0006g0-Q0
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 16:59:19 +0000
Received: from [85.158.143.35:11981] by server-3.bemta-4.messagelabs.com id
	06/63-06841-6EA21A05; Mon, 12 Nov 2012 16:59:18 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1352739554!5199356!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32666 invoked from network); 12 Nov 2012 16:59:14 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 16:59:14 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="15756716"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 16:59:14 +0000
Received: from [192.168.1.30] (10.31.3.234) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 16:59:13 +0000
Message-ID: <50A12AE1.7010104@citrix.com>
Date: Mon, 12 Nov 2012 17:59:13 +0100
From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
	<20121110104536.GA1027@antioche.eu.org>
	<50A0C1D0.1060407@citrix.com>
	<1352734440.27833.281.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352734440.27833.281.camel@zakaz.uk.xensource.com>
Cc: Manuel Bouyer <bouyer@antioche.eu.org>,
	"port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: add persistent grants to xbd_xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-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QgYmFja2Vu
ZCBsZXRzIHRvIGEgbW9yZSBjb25zaXN0ZW50IHBlcmZvcm1hbmNlLCBzZWUgdGhlCmZvbGxvd2lu
ZyBncmFwaDoKCmh0dHA6Ly94ZW5iaXRzLnhlbi5vcmcvcGVvcGxlL3JveWdlci9wZXJzaXN0ZW50
X2dyYW50cy9ub25wZXJzX3JlYWQucG5nCgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMu
eGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Mon Nov 12 16:59:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 16:59:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXxM0-0006g5-8w; Mon, 12 Nov 2012 16:59:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TXxLy-0006g0-Q0
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 16:59:19 +0000
Received: from [85.158.143.35:11981] by server-3.bemta-4.messagelabs.com id
	06/63-06841-6EA21A05; Mon, 12 Nov 2012 16:59:18 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1352739554!5199356!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32666 invoked from network); 12 Nov 2012 16:59:14 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 16:59:14 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="15756716"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 16:59:14 +0000
Received: from [192.168.1.30] (10.31.3.234) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 16:59:13 +0000
Message-ID: <50A12AE1.7010104@citrix.com>
Date: Mon, 12 Nov 2012 17:59:13 +0100
From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
	<20121110104536.GA1027@antioche.eu.org>
	<50A0C1D0.1060407@citrix.com>
	<1352734440.27833.281.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352734440.27833.281.camel@zakaz.uk.xensource.com>
Cc: Manuel Bouyer <bouyer@antioche.eu.org>,
	"port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: add persistent grants to xbd_xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gMTIvMTEvMTIgMTY6MzQsIElhbiBDYW1wYmVsbCB3cm90ZToKPiBPbiBNb24sIDIwMTItMTEt
MTIgYXQgMDk6MzAgKzAwMDAsIFJvZ2VyIFBhdSBNb25uw6kgd3JvdGU6Cj4+Cj4+IEkgd2lsbCB0
cnkgdG8gcGVyZm9ybSBhIHNpbWlsYXIgdGVzdCB3aXRoIGEgTmV0QlNEIERvbTAsIGJ1dCB3aXRo
IHRoZQo+PiBwYXRjaCBpdCB3aWxsIHByb2JhYmx5IGJlIGEgbGl0dGxlIGJpdCBzbG93ZXIgdGhh
biB3aXRob3V0IGl0IChiZWNhdXNlCj4+IHdlIGhhdmUgdG8gcGVyZm9ybSB0aGUgbWVtY3B5IGlu
IHRoZSBmcm9udGVuZCwgCj4gCj4gRG9lc24ndCB0aGUgZnJvbnRlbmQgZmFsbGJhY2sgdG8gdGhl
IHNhbWUgb2xkIGNvZGUgYXMgYWx3YXlzIGlmIHRoZSBiL2UKPiBkb2Vzbid0IGFkdmVydGlzZSB0
aGUgbmV3IGZlYXR1cmU/CgpObywgdGhlIGZyb250ZW5kIGFsd2F5cyB1c2VzIHBlcnNpc3RlbnQg
Z3JhbnRzLCBzaW5jZSBpdCdzIGNvbXBhdGlibGUKd2l0aCBhIGJhY2tlbmQgbm90IHVzaW5nIHBl
cnNpc3RlbnQgZ3JhbnRzLCB0aGUgZnJvbnRlbmQgd2lsbCByZXVzZSB0aGUKc2FtZSBncmFudHMs
IGFuZCB0aGUgYmFja2VuZCB3aWxsIHVzZSB0aGUgb2xkIG1lY2hhbmlzbSBvZiBtYXBwaW5nIGFu
ZAp1bm1hcHBpbmcgdGhlbS4KCkFjdHVhbGx5IGl0IHNlZW1zIEkgd2FzIHdyb25nIG9uIHRoYXQs
IHVzaW5nIGEgcGVyc2lzdGVudCBmcm9udGVuZCB3aXRoCmEgbm9uLXBlcnNpc3RlbnQgYmFja2Vu
ZCBsZXRzIHRvIGEgbW9yZSBjb25zaXN0ZW50IHBlcmZvcm1hbmNlLCBzZWUgdGhlCmZvbGxvd2lu
ZyBncmFwaDoKCmh0dHA6Ly94ZW5iaXRzLnhlbi5vcmcvcGVvcGxlL3JveWdlci9wZXJzaXN0ZW50
X2dyYW50cy9ub25wZXJzX3JlYWQucG5nCgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMu
eGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Mon Nov 12 17:04:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 17:04:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXxQN-0006tc-VO; Mon, 12 Nov 2012 17:03:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXxQM-0006tS-71
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 17:03:50 +0000
Received: from [85.158.143.99:56460] by server-2.bemta-4.messagelabs.com id
	31/60-28922-5FB21A05; Mon, 12 Nov 2012 17:03:49 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1352739829!24357908!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27429 invoked from network); 12 Nov 2012 17:03:49 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 17:03:49 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="15756848"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 17:03:48 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 17:03:48 +0000
Message-ID: <1352739827.27833.307.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Daley <mattjd@gmail.com>
Date: Mon, 12 Nov 2012 17:03:47 +0000
In-Reply-To: <1352701985-3696-1-git-send-email-mattjd@gmail.com>
References: <1352701985-3696-1-git-send-email-mattjd@gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] pygrub: Fix command line argument error
 handling
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-12 at 06:33 +0000, Matthew Daley wrote:
> pygrub's individual config file parsers do not correctly check the
> amount of command line arguments given to them. In addition, the LILO
> config parser would report an incorrect message.
> 
> Use len() to correctly check the amount of arguments, and fix the LILO
> error message.
> 
> Signed-off-by: Matthew Daley <mattjd@gmail.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

and applied, thanks.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 17:04:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 17:04:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXxQN-0006tc-VO; Mon, 12 Nov 2012 17:03:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXxQM-0006tS-71
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 17:03:50 +0000
Received: from [85.158.143.99:56460] by server-2.bemta-4.messagelabs.com id
	31/60-28922-5FB21A05; Mon, 12 Nov 2012 17:03:49 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1352739829!24357908!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27429 invoked from network); 12 Nov 2012 17:03:49 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 17:03:49 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="15756848"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 17:03:48 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 17:03:48 +0000
Message-ID: <1352739827.27833.307.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Daley <mattjd@gmail.com>
Date: Mon, 12 Nov 2012 17:03:47 +0000
In-Reply-To: <1352701985-3696-1-git-send-email-mattjd@gmail.com>
References: <1352701985-3696-1-git-send-email-mattjd@gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] pygrub: Fix command line argument error
 handling
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-12 at 06:33 +0000, Matthew Daley wrote:
> pygrub's individual config file parsers do not correctly check the
> amount of command line arguments given to them. In addition, the LILO
> config parser would report an incorrect message.
> 
> Use len() to correctly check the amount of arguments, and fix the LILO
> error message.
> 
> Signed-off-by: Matthew Daley <mattjd@gmail.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

and applied, thanks.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 17:04:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 17:04:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXxQj-0006vP-Bh; Mon, 12 Nov 2012 17:04:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXxQi-0006v7-4l
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 17:04:12 +0000
Received: from [85.158.139.211:8330] by server-8.bemta-5.messagelabs.com id
	0A/B0-06050-B0C21A05; Mon, 12 Nov 2012 17:04:11 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1352739850!19847225!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8854 invoked from network); 12 Nov 2012 17:04:10 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 17:04:10 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="15756859"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 17:04:10 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 17:04:09 +0000
Message-ID: <1352739849.27833.308.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Kouya Shimura <kouya@jp.fujitsu.com>
Date: Mon, 12 Nov 2012 17:04:09 +0000
In-Reply-To: <509CB5FB.7020404@jp.fujitsu.com>
References: <509CB5FB.7020404@jp.fujitsu.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] libxl: fix reboot failure of migrated domain
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-09 at 07:51 +0000, Kouya Shimura wrote:
> The same problem was once fixed by c/s 23878:59c7213b5949
> but c/s 25344:0f3b1e13d6af broke it.
> 
> Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

and applied.

Ian (J): Not sure if the test harness does much after the migration
phase but adding a few lifecycle ops as a sanity check might be useful?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 17:04:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 17:04:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXxQj-0006vP-Bh; Mon, 12 Nov 2012 17:04:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXxQi-0006v7-4l
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 17:04:12 +0000
Received: from [85.158.139.211:8330] by server-8.bemta-5.messagelabs.com id
	0A/B0-06050-B0C21A05; Mon, 12 Nov 2012 17:04:11 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1352739850!19847225!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8854 invoked from network); 12 Nov 2012 17:04:10 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 17:04:10 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="15756859"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 17:04:10 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 17:04:09 +0000
Message-ID: <1352739849.27833.308.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Kouya Shimura <kouya@jp.fujitsu.com>
Date: Mon, 12 Nov 2012 17:04:09 +0000
In-Reply-To: <509CB5FB.7020404@jp.fujitsu.com>
References: <509CB5FB.7020404@jp.fujitsu.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] libxl: fix reboot failure of migrated domain
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-09 at 07:51 +0000, Kouya Shimura wrote:
> The same problem was once fixed by c/s 23878:59c7213b5949
> but c/s 25344:0f3b1e13d6af broke it.
> 
> Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

and applied.

Ian (J): Not sure if the test harness does much after the migration
phase but adding a few lifecycle ops as a sanity check might be useful?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 17:05:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 17:05:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXxR9-0006z1-PW; Mon, 12 Nov 2012 17:04:39 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXxR8-0006yg-Iu
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 17:04:38 +0000
Received: from [85.158.143.99:31328] by server-1.bemta-4.messagelabs.com id
	C9/D5-27934-52C21A05; Mon, 12 Nov 2012 17:04:37 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1352739876!28714281!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4921 invoked from network); 12 Nov 2012 17:04:36 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 17:04:36 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="15756873"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 17:04:36 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 17:04:35 +0000
Message-ID: <1352739874.27833.309.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
Date: Mon, 12 Nov 2012 17:04:34 +0000
In-Reply-To: <F84E37B1-7AE6-4319-A821-73FDA1BC0E9D@gridcentric.ca>
References: <5171750d133ef2c27ac8.1350055853@xdev.gridcentric.ca>
	<1350547689.28188.31.camel@dagon.hellion.org.uk>
	<F84E37B1-7AE6-4319-A821-73FDA1BC0E9D@gridcentric.ca>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Christoph Egger <Christoph.Egger@amd.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Andres Lagar-Cavilla <andres@lagarcavilla.org>,
	Attilio Rao <attilio.rao@citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH] Synchronize privcmd header constants
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-10-19 at 03:20 +0100, Andres Lagar-Cavilla wrote:
> I've had a look. The xen.org tree knows about three other OSes: minios, solaris and netbsd. None knows about paged out frames. None uses the XEN_DOMCTL_PFINFO_PAGEDTAB constant in domctl.h
> 
> 1. The domctl.h constant can still go away without hurting other OSes.
> 2. It is trivial to add the PRIVCMD_MMAPBATCH_* constants to the privcmd.h of other OSes. It can't hurt. I can do it here. Each OS Xen maintainer would have to take care of syncing that up in the respective upstream. However ...
> 3. Not that trivial to teach all these OSes about paged out frames. Does anyone care?
> 
> Please advise.

I'm convinced, I'd forgotten that only Linux dom0 did paging.

Acked-by: Ian Campbell <ian.campbell@citrix.com> and applied, thanks &
sorry for the delay.

> Thanks
> Andres
> 
> On Oct 18, 2012, at 4:08 AM, Ian Campbell <ian.campbell@citrix.com> wrote:
> 
> > On Fri, 2012-10-12 at 16:30 +0100, Andres Lagar-Cavilla wrote:
> >> tools/include/xen-sys/Linux/privcmd.h |   3 +++
> >> tools/libxc/xc_linux_osdep.c          |  10 +++++-----
> >> xen/include/public/domctl.h           |   1 -
> >> 3 files changed, 8 insertions(+), 6 deletions(-)
> >> 
> >> 
> >> Since Linux's git commit ceb90fa0a8008059ecbbf9114cb89dc71a730bb6, the
> >> privcmd.h interface between Linux and libxc specifies two new constants,
> >> PRIVCMD_MMAPBATCH_MFN_ERROR and PRIVCMD_MMAPBATCH_PAGED_ERROR. These constants
> >> represent the error codes encoded in the top nibble of an mfn slot passed to
> >> the legacy MMAPBATCH ioctl.
> >> 
> >> In particular, libxenctrl checks for the equivalent of the latter constant when
> >> dealing with paged out frames that might be the target of a foreign map.
> >> 
> >> Previously, the relevant constant was defined in the domctl hypervisor
> >> interface header (XEN_DOMCTL_PFINFO_PAGEDTAB). Because this top-nibble encoding
> >> is a contract between the dom0 kernel and libxc, a domctl.h definition is
> >> misplaced.
> >> 
> >> - Sync the privcmd.h header to that now available in upstream Linux
> > 
> > Although the ioctl is Linux specific is the top-nibble behaviour (and
> > therefore the #define) common to other dom0s like *BSD? Can a BSD person
> > confirm that this change won't breaking things for them please.
> > 
> >> - Update libxc appropriately
> >> - Remove the unnecessary constant in domctl.h
> >> 
> >> Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
> >> 
> >> diff -r 4eed5e64544f -r 5171750d133e tools/include/xen-sys/Linux/privcmd.h
> >> --- a/tools/include/xen-sys/Linux/privcmd.h
> >> +++ b/tools/include/xen-sys/Linux/privcmd.h
> >> @@ -64,6 +64,9 @@ typedef struct privcmd_mmapbatch {
> >> 	xen_pfn_t __user *arr; /* array of mfns - top nibble set on err */
> >> } privcmd_mmapbatch_t; 
> >> 
> >> +#define PRIVCMD_MMAPBATCH_MFN_ERROR     0xf0000000U
> >> +#define PRIVCMD_MMAPBATCH_PAGED_ERROR   0x80000000U
> >> +
> >> typedef struct privcmd_mmapbatch_v2 {
> >> 	unsigned int num; /* number of pages to populate */
> >> 	domid_t dom;      /* target domain */
> >> diff -r 4eed5e64544f -r 5171750d133e tools/libxc/xc_linux_osdep.c
> >> --- a/tools/libxc/xc_linux_osdep.c
> >> +++ b/tools/libxc/xc_linux_osdep.c
> >> @@ -129,7 +129,7 @@ static int xc_map_foreign_batch_single(i
> >> 
> >>     do
> >>     {
> >> -        *mfn ^= XEN_DOMCTL_PFINFO_PAGEDTAB;
> >> +        *mfn ^= PRIVCMD_MMAPBATCH_PAGED_ERROR;
> >>         usleep(100);
> >>         rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
> >>     }
> >> @@ -166,8 +166,8 @@ static void *linux_privcmd_map_foreign_b
> >> 
> >>         for ( i = 0; i < num; i++ )
> >>         {
> >> -            if ( (arr[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
> >> -                 XEN_DOMCTL_PFINFO_PAGEDTAB )
> >> +            if ( (arr[i] & PRIVCMD_MMAPBATCH_MFN_ERROR) ==
> >> +                           PRIVCMD_MMAPBATCH_PAGED_ERROR )
> >>             {
> >>                 unsigned long paged_addr = (unsigned long)addr + (i << XC_PAGE_SHIFT);
> >>                 rc = xc_map_foreign_batch_single(fd, dom, &arr[i],
> >> @@ -323,12 +323,12 @@ static void *linux_privcmd_map_foreign_b
> >>             default:
> >>                 err[i] = -EINVAL;
> >>                 continue;
> >> -            case XEN_DOMCTL_PFINFO_PAGEDTAB:
> >> +            case PRIVCMD_MMAPBATCH_PAGED_ERROR:
> >>                 if ( rc != -ENOENT )
> >>                 {
> >>                     err[i] = rc ?: -EINVAL;
> >>                     continue;
> >> -                 }
> >> +                }
> >>                 rc = xc_map_foreign_batch_single(fd, dom, pfn + i,
> >>                         (unsigned long)addr + ((unsigned long)i<<XC_PAGE_SHIFT));
> >>                 if ( rc < 0 )
> >> diff -r 4eed5e64544f -r 5171750d133e xen/include/public/domctl.h
> >> --- a/xen/include/public/domctl.h
> >> +++ b/xen/include/public/domctl.h
> >> @@ -135,7 +135,6 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_getme
> >> #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
> >> #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
> >> #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
> >> -#define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
> >> #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
> >> 
> >> struct xen_domctl_getpageframeinfo {
> > 
> > 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 17:05:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 17:05:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXxR9-0006z1-PW; Mon, 12 Nov 2012 17:04:39 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXxR8-0006yg-Iu
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 17:04:38 +0000
Received: from [85.158.143.99:31328] by server-1.bemta-4.messagelabs.com id
	C9/D5-27934-52C21A05; Mon, 12 Nov 2012 17:04:37 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1352739876!28714281!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4921 invoked from network); 12 Nov 2012 17:04:36 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 17:04:36 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="15756873"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 17:04:36 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 17:04:35 +0000
Message-ID: <1352739874.27833.309.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
Date: Mon, 12 Nov 2012 17:04:34 +0000
In-Reply-To: <F84E37B1-7AE6-4319-A821-73FDA1BC0E9D@gridcentric.ca>
References: <5171750d133ef2c27ac8.1350055853@xdev.gridcentric.ca>
	<1350547689.28188.31.camel@dagon.hellion.org.uk>
	<F84E37B1-7AE6-4319-A821-73FDA1BC0E9D@gridcentric.ca>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Christoph Egger <Christoph.Egger@amd.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Andres Lagar-Cavilla <andres@lagarcavilla.org>,
	Attilio Rao <attilio.rao@citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH] Synchronize privcmd header constants
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-10-19 at 03:20 +0100, Andres Lagar-Cavilla wrote:
> I've had a look. The xen.org tree knows about three other OSes: minios, solaris and netbsd. None knows about paged out frames. None uses the XEN_DOMCTL_PFINFO_PAGEDTAB constant in domctl.h
> 
> 1. The domctl.h constant can still go away without hurting other OSes.
> 2. It is trivial to add the PRIVCMD_MMAPBATCH_* constants to the privcmd.h of other OSes. It can't hurt. I can do it here. Each OS Xen maintainer would have to take care of syncing that up in the respective upstream. However ...
> 3. Not that trivial to teach all these OSes about paged out frames. Does anyone care?
> 
> Please advise.

I'm convinced, I'd forgotten that only Linux dom0 did paging.

Acked-by: Ian Campbell <ian.campbell@citrix.com> and applied, thanks &
sorry for the delay.

> Thanks
> Andres
> 
> On Oct 18, 2012, at 4:08 AM, Ian Campbell <ian.campbell@citrix.com> wrote:
> 
> > On Fri, 2012-10-12 at 16:30 +0100, Andres Lagar-Cavilla wrote:
> >> tools/include/xen-sys/Linux/privcmd.h |   3 +++
> >> tools/libxc/xc_linux_osdep.c          |  10 +++++-----
> >> xen/include/public/domctl.h           |   1 -
> >> 3 files changed, 8 insertions(+), 6 deletions(-)
> >> 
> >> 
> >> Since Linux's git commit ceb90fa0a8008059ecbbf9114cb89dc71a730bb6, the
> >> privcmd.h interface between Linux and libxc specifies two new constants,
> >> PRIVCMD_MMAPBATCH_MFN_ERROR and PRIVCMD_MMAPBATCH_PAGED_ERROR. These constants
> >> represent the error codes encoded in the top nibble of an mfn slot passed to
> >> the legacy MMAPBATCH ioctl.
> >> 
> >> In particular, libxenctrl checks for the equivalent of the latter constant when
> >> dealing with paged out frames that might be the target of a foreign map.
> >> 
> >> Previously, the relevant constant was defined in the domctl hypervisor
> >> interface header (XEN_DOMCTL_PFINFO_PAGEDTAB). Because this top-nibble encoding
> >> is a contract between the dom0 kernel and libxc, a domctl.h definition is
> >> misplaced.
> >> 
> >> - Sync the privcmd.h header to that now available in upstream Linux
> > 
> > Although the ioctl is Linux specific is the top-nibble behaviour (and
> > therefore the #define) common to other dom0s like *BSD? Can a BSD person
> > confirm that this change won't breaking things for them please.
> > 
> >> - Update libxc appropriately
> >> - Remove the unnecessary constant in domctl.h
> >> 
> >> Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
> >> 
> >> diff -r 4eed5e64544f -r 5171750d133e tools/include/xen-sys/Linux/privcmd.h
> >> --- a/tools/include/xen-sys/Linux/privcmd.h
> >> +++ b/tools/include/xen-sys/Linux/privcmd.h
> >> @@ -64,6 +64,9 @@ typedef struct privcmd_mmapbatch {
> >> 	xen_pfn_t __user *arr; /* array of mfns - top nibble set on err */
> >> } privcmd_mmapbatch_t; 
> >> 
> >> +#define PRIVCMD_MMAPBATCH_MFN_ERROR     0xf0000000U
> >> +#define PRIVCMD_MMAPBATCH_PAGED_ERROR   0x80000000U
> >> +
> >> typedef struct privcmd_mmapbatch_v2 {
> >> 	unsigned int num; /* number of pages to populate */
> >> 	domid_t dom;      /* target domain */
> >> diff -r 4eed5e64544f -r 5171750d133e tools/libxc/xc_linux_osdep.c
> >> --- a/tools/libxc/xc_linux_osdep.c
> >> +++ b/tools/libxc/xc_linux_osdep.c
> >> @@ -129,7 +129,7 @@ static int xc_map_foreign_batch_single(i
> >> 
> >>     do
> >>     {
> >> -        *mfn ^= XEN_DOMCTL_PFINFO_PAGEDTAB;
> >> +        *mfn ^= PRIVCMD_MMAPBATCH_PAGED_ERROR;
> >>         usleep(100);
> >>         rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
> >>     }
> >> @@ -166,8 +166,8 @@ static void *linux_privcmd_map_foreign_b
> >> 
> >>         for ( i = 0; i < num; i++ )
> >>         {
> >> -            if ( (arr[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
> >> -                 XEN_DOMCTL_PFINFO_PAGEDTAB )
> >> +            if ( (arr[i] & PRIVCMD_MMAPBATCH_MFN_ERROR) ==
> >> +                           PRIVCMD_MMAPBATCH_PAGED_ERROR )
> >>             {
> >>                 unsigned long paged_addr = (unsigned long)addr + (i << XC_PAGE_SHIFT);
> >>                 rc = xc_map_foreign_batch_single(fd, dom, &arr[i],
> >> @@ -323,12 +323,12 @@ static void *linux_privcmd_map_foreign_b
> >>             default:
> >>                 err[i] = -EINVAL;
> >>                 continue;
> >> -            case XEN_DOMCTL_PFINFO_PAGEDTAB:
> >> +            case PRIVCMD_MMAPBATCH_PAGED_ERROR:
> >>                 if ( rc != -ENOENT )
> >>                 {
> >>                     err[i] = rc ?: -EINVAL;
> >>                     continue;
> >> -                 }
> >> +                }
> >>                 rc = xc_map_foreign_batch_single(fd, dom, pfn + i,
> >>                         (unsigned long)addr + ((unsigned long)i<<XC_PAGE_SHIFT));
> >>                 if ( rc < 0 )
> >> diff -r 4eed5e64544f -r 5171750d133e xen/include/public/domctl.h
> >> --- a/xen/include/public/domctl.h
> >> +++ b/xen/include/public/domctl.h
> >> @@ -135,7 +135,6 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_getme
> >> #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
> >> #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
> >> #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
> >> -#define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
> >> #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
> >> 
> >> struct xen_domctl_getpageframeinfo {
> > 
> > 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 17:05:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 17:05:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXxRR-00073H-DP; Mon, 12 Nov 2012 17:04:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXxRP-00072i-If
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 17:04:55 +0000
Received: from [85.158.137.99:61292] by server-12.bemta-3.messagelabs.com id
	EB/36-22757-63C21A05; Mon, 12 Nov 2012 17:04:54 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1352739893!15649801!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17415 invoked from network); 12 Nov 2012 17:04:53 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 17:04:53 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="15756882"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 17:04:53 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 17:04:52 +0000
Message-ID: <1352739892.27833.310.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Date: Mon, 12 Nov 2012 17:04:52 +0000
In-Reply-To: <CAFLBxZbqRDOiyQO6NNDfTUqnPgwzJujtYEGPhaM=rJZaPMZBFQ@mail.gmail.com>
References: <20121012173222.31965.33368.sendpatchset@magnum.int.mccr.org>
	<CAFLBxZbqRDOiyQO6NNDfTUqnPgwzJujtYEGPhaM=rJZaPMZBFQ@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Dave McCracken <dcm@mccr.org>, "Keir \(Xen.org\)" <keir@xen.org>,
	Xen Developers List <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] Make restore work properly with PV
 superpage flag
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-10-18 at 15:41 +0100, George Dunlap wrote:
> On Fri, Oct 12, 2012 at 6:32 PM, Dave McCracken <dcm@mccr.org> wrote:
> > For PV guests, the superpage flag means to unconditionally allocate all
> > pages as superpages, which is required for Linux hugepages to work.  Support
> > for this on restore was not supported.  This patch adds proper support for
> > the superpage flag on restore.
> >
> > For HVM guests, the superpage flag has been used to mean attempt to allocate
> > superpages if possible on restore.  This functionality has been preserved.
> >
> > Signed-off-by: Dave McCracken <dave.mccracken@oracle.com>
[...]
> 
> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

Applied, sorry for the delay.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 17:05:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 17:05:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXxRR-00073H-DP; Mon, 12 Nov 2012 17:04:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXxRP-00072i-If
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 17:04:55 +0000
Received: from [85.158.137.99:61292] by server-12.bemta-3.messagelabs.com id
	EB/36-22757-63C21A05; Mon, 12 Nov 2012 17:04:54 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1352739893!15649801!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17415 invoked from network); 12 Nov 2012 17:04:53 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 17:04:53 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="15756882"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 17:04:53 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 17:04:52 +0000
Message-ID: <1352739892.27833.310.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Date: Mon, 12 Nov 2012 17:04:52 +0000
In-Reply-To: <CAFLBxZbqRDOiyQO6NNDfTUqnPgwzJujtYEGPhaM=rJZaPMZBFQ@mail.gmail.com>
References: <20121012173222.31965.33368.sendpatchset@magnum.int.mccr.org>
	<CAFLBxZbqRDOiyQO6NNDfTUqnPgwzJujtYEGPhaM=rJZaPMZBFQ@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Dave McCracken <dcm@mccr.org>, "Keir \(Xen.org\)" <keir@xen.org>,
	Xen Developers List <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] Make restore work properly with PV
 superpage flag
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-10-18 at 15:41 +0100, George Dunlap wrote:
> On Fri, Oct 12, 2012 at 6:32 PM, Dave McCracken <dcm@mccr.org> wrote:
> > For PV guests, the superpage flag means to unconditionally allocate all
> > pages as superpages, which is required for Linux hugepages to work.  Support
> > for this on restore was not supported.  This patch adds proper support for
> > the superpage flag on restore.
> >
> > For HVM guests, the superpage flag has been used to mean attempt to allocate
> > superpages if possible on restore.  This functionality has been preserved.
> >
> > Signed-off-by: Dave McCracken <dave.mccracken@oracle.com>
[...]
> 
> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

Applied, sorry for the delay.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 17:10:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 17:10:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXxWY-0007VK-6M; Mon, 12 Nov 2012 17:10:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXxWX-0007VF-Ai
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 17:10:13 +0000
Received: from [85.158.139.211:13012] by server-9.bemta-5.messagelabs.com id
	23/9C-29295-47D21A05; Mon, 12 Nov 2012 17:10:12 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1352740211!19813092!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12383 invoked from network); 12 Nov 2012 17:10:11 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 17:10:11 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="15757012"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 17:10:11 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 17:10:10 +0000
Message-ID: <1352740209.27833.314.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Date: Mon, 12 Nov 2012 17:10:09 +0000
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233537BA4E@SHSMSX101.ccr.corp.intel.com>
References: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
	<1352273413.12977.27.camel@hastur.hellion.org.uk>
	<DE8DF0795D48FD4CA783C40EC829233537BA4E@SHSMSX101.ccr.corp.intel.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] Handle broken page with regard to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-07 at 14:25 +0000, Liu, Jinsong wrote:
> Ian Campbell wrote:
> >> At the target
> >>   it would set p2m as p2m_ram_broken for broken page, so that if
> >>   guest access the broken page again, it would kill itself as
> >> expected.
> >
> > Can you add a few words here about why this is preferable to just
> > ignoring the issue and populating a regular page non-broken page on
> > the target? I think I know why but it would be useful to be explicit
> > in the changelog.
> >
> > I also spotted a typo:
> >> +                     * vMCE occur during migration +
> >> * +                     *   At sender, it marks broken page to dirty
> >> bitmap, +                     *   so that at copypages stage of
> >> migration, brokan
> >
> >
> > broken
> >
> > Ian.
> 
> OK, add some comments and correct typo.
> 
> Thanks,
> Jinsong
> 
> ==============
> Handle broken page with regard to migration
> 
> Generally, there are 2 cases:
> 1. broken page occurs before migration
> 2. broken page occurs during migration
> 
> At the sender
>   For case 1, the broken page would be mapped but not copied to target
>   (otherwise it may trigger more serious error, say, SRAR error).
>   While its pfn_type and pfn number would be transferred to target
>   so that target take appropriate action.
> 
>   For case 2, mce handler marks the broken page to dirty bitmap, so that
>   at copypages stage of migration, its pfn_type and pfn number would be
>   transferred to target and then take appropriate action.
> 
> At the target
>   When migration target would populate pages for guest. As for the case
>   of broken page wrt migration, we prefer keep the corresponding page,
>   for the sake of seamless migration.
> 
>   At target it would set p2m as p2m_ram_broken for broken page. Guest MCE
>   may have good chance to handle its broken page, while if guest access
>   the broken page again it would kill itself as expected.
> 
> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

I believe George Acked this patch in
<CAFLBxZYy8mqvfNH4Hp9x=o0jqZ4r9hnCS_qLR0O8+rkY2AAdTA@mail.gmail.com>.
Were there other acks, e.g. from Jan for the hypervisor side?

Please do collect acks into the commit log and keep them while the patch
hasn't change substantially to invalidate them (especially when a series
has had many iterations and variations like this one), otherwise I have
to go hunting for them which makes it more likely that I'll either get
distracted or go and apply some easier to deal with patch instead.

Anyway, I afraid that when I went to apply this there were loads of
rejects, I suspect a conflict with the superpage migration patch, sorry.
Please can you rebase and resend (with patchbomb).

Thanks,
Ian.

> 
> diff -r d675797494bd tools/libxc/xc_domain.c
> --- a/tools/libxc/xc_domain.c   Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xc_domain.c   Thu Nov 08 05:07:20 2012 +0800
> @@ -283,6 +283,22 @@
>      return ret;
>  }
> 
> +/* set broken page p2m */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn)
> +{
> +    int ret;
> +    DECLARE_DOMCTL;
> +
> +    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
> +    domctl.domain = (domid_t)domid;
> +    domctl.u.set_broken_page_p2m.pfn = pfn;
> +    ret = do_domctl(xch, &domctl);
> +
> +    return ret ? -1 : 0;
> +}
> +
>  /* get info from hvm guest for save */
>  int xc_domain_hvm_getcontext(xc_interface *xch,
>                               uint32_t domid,
> diff -r d675797494bd tools/libxc/xc_domain_restore.c
> --- a/tools/libxc/xc_domain_restore.c   Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xc_domain_restore.c   Thu Nov 08 05:07:20 2012 +0800
> @@ -962,9 +962,15 @@
> 
>      countpages = count;
>      for (i = oldcount; i < buf->nr_pages; ++i)
> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
> +    {
> +        unsigned long pagetype;
> +
> +        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
> +        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
> +             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
> +             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>              --countpages;
> +    }
> 
>      if (!countpages)
>          return count;
> @@ -1200,6 +1206,17 @@
>              /* a bogus/unmapped/allocate-only page: skip it */
>              continue;
> 
> +        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
> +        {
> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
> +            {
> +                ERROR("Set p2m for broken page failed, "
> +                      "dom=%d, pfn=%lx\n", dom, pfn);
> +                goto err_mapped;
> +            }
> +            continue;
> +        }
> +
>          if (pfn_err[i])
>          {
>              ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
> diff -r d675797494bd tools/libxc/xc_domain_save.c
> --- a/tools/libxc/xc_domain_save.c      Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xc_domain_save.c      Thu Nov 08 05:07:20 2012 +0800
> @@ -1277,6 +1277,13 @@
>                  if ( !hvm )
>                      gmfn = pfn_to_mfn(gmfn);
> 
> +                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                {
> +                    pfn_type[j] |= pfn_batch[j];
> +                    ++run;
> +                    continue;
> +                }
> +
>                  if ( pfn_err[j] )
>                  {
>                      if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
> @@ -1371,8 +1378,12 @@
>                      }
>                  }
> 
> -                /* skip pages that aren't present or are alloc-only */
> +                /*
> +                 * skip pages that aren't present,
> +                 * or are broken, or are alloc-only
> +                 */
>                  if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
> +                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
>                      || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>                      continue;
> 
> diff -r d675797494bd tools/libxc/xenctrl.h
> --- a/tools/libxc/xenctrl.h     Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xenctrl.h     Thu Nov 08 05:07:20 2012 +0800
> @@ -575,6 +575,17 @@
>                            xc_domaininfo_t *info);
> 
>  /**
> + * This function set p2m for broken page
> + * &parm xch a handle to an open hypervisor interface
> + * @parm domid the domain id which broken page belong to
> + * @parm pfn the pfn number of the broken page
> + * @return 0 on success, -1 on failure
> + */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn);
> +
> +/**
>   * This function returns information about the context of a hvm domain
>   * @parm xch a handle to an open hypervisor interface
>   * @parm domid the domain to get information from
> diff -r d675797494bd xen/arch/x86/cpu/mcheck/mcaction.c
> --- a/xen/arch/x86/cpu/mcheck/mcaction.c        Fri Nov 02 11:08:37 2012 +0800
> +++ b/xen/arch/x86/cpu/mcheck/mcaction.c        Thu Nov 08 05:07:20 2012 +0800
> @@ -1,5 +1,6 @@
>  #include <xen/types.h>
>  #include <xen/sched.h>
> +#include <asm/p2m.h>
>  #include "mcaction.h"
>  #include "vmce.h"
>  #include "mce.h"
> @@ -91,6 +92,24 @@
>                      goto vmce_failed;
>                  }
> 
> +                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram &&
> +                     paging_mode_log_dirty(d) )
> +                {
> +                    /*
> +                     * vMCE occur during migration
> +                     *
> +                     *   At sender, it marks broken page to dirty bitmap,
> +                     *   so that at copypages stage of migration, broken
> +                     *   page's pfn_type and pfn number would be transferred
> +                     *   to target and then take appropriate action.
> +                     *
> +                     *   At target, it would set p2m as p2m_ram_broken for
> +                     *   broken page, so that if guest access the broken page
> +                     *   again, it would kill itself as expected.
> +                     */
> +                    paging_mark_dirty(d, mfn);
> +                }
> +
>                  if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
>                  {
>                      printk("Unmap broken memory %lx for DOM%d failed\n",
> diff -r d675797494bd xen/arch/x86/domctl.c
> --- a/xen/arch/x86/domctl.c     Fri Nov 02 11:08:37 2012 +0800
> +++ b/xen/arch/x86/domctl.c     Thu Nov 08 05:07:20 2012 +0800
> @@ -209,12 +209,18 @@
>                  for ( j = 0; j < k; j++ )
>                  {
>                      unsigned long type = 0;
> +                    p2m_type_t t;
> 
> -                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
> +                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
> 
>                      if ( unlikely(!page) ||
>                           unlikely(is_xen_heap_page(page)) )
> -                        type = XEN_DOMCTL_PFINFO_XTAB;
> +                    {
> +                        if ( p2m_is_broken(t) )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
> +                        else
> +                            type = XEN_DOMCTL_PFINFO_XTAB;
> +                    }
>                      else
>                      {
>                          switch( page->u.inuse.type_info & PGT_type_mask )
> @@ -235,6 +241,9 @@
> 
>                          if ( page->u.inuse.type_info & PGT_pinned )
>                              type |= XEN_DOMCTL_PFINFO_LPINTAB;
> +
> +                        if ( page->count_info & PGC_broken )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
>                      }
> 
>                      if ( page )
> @@ -1568,6 +1577,29 @@
>      }
>      break;
> 
> +    case XEN_DOMCTL_set_broken_page_p2m:
> +    {
> +        struct domain *d;
> +
> +        d = rcu_lock_domain_by_id(domctl->domain);
> +        if ( d != NULL )
> +        {
> +            p2m_type_t pt;
> +            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
> +            mfn_t mfn = get_gfn_query(d, pfn, &pt);
> +
> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
> +                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
> +                ret = -EINVAL;
> +
> +            put_gfn(d, pfn);
> +            rcu_unlock_domain(d);
> +        }
> +        else
> +            ret = -ESRCH;
> +    }
> +    break;
> +
>      default:
>          ret = iommu_do_domctl(domctl, u_domctl);
>          break;
> diff -r d675797494bd xen/include/public/domctl.h
> --- a/xen/include/public/domctl.h       Fri Nov 02 11:08:37 2012 +0800
> +++ b/xen/include/public/domctl.h       Thu Nov 08 05:07:20 2012 +0800
> @@ -136,6 +136,7 @@
>  #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
>  #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
>  #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
> +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
>  #define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
>  #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
> 
> @@ -835,6 +836,12 @@
>  typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
>  DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
> 
> +struct xen_domctl_set_broken_page_p2m {
> +    uint64_aligned_t pfn;
> +};
> +typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
> +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
> +
>  struct xen_domctl {
>      uint32_t cmd;
>  #define XEN_DOMCTL_createdomain                   1
> @@ -900,6 +907,7 @@
>  #define XEN_DOMCTL_set_access_required           64
>  #define XEN_DOMCTL_audit_p2m                     65
>  #define XEN_DOMCTL_set_virq_handler              66
> +#define XEN_DOMCTL_set_broken_page_p2m           67
>  #define XEN_DOMCTL_gdbsx_guestmemio            1000
>  #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>  #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
> @@ -955,6 +963,7 @@
>          struct xen_domctl_audit_p2m         audit_p2m;
>          struct xen_domctl_set_virq_handler  set_virq_handler;
>          struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>          struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>          struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>          uint8_t                             pad[128];



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 17:10:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 17:10:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXxWY-0007VK-6M; Mon, 12 Nov 2012 17:10:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TXxWX-0007VF-Ai
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 17:10:13 +0000
Received: from [85.158.139.211:13012] by server-9.bemta-5.messagelabs.com id
	23/9C-29295-47D21A05; Mon, 12 Nov 2012 17:10:12 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1352740211!19813092!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12383 invoked from network); 12 Nov 2012 17:10:11 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 17:10:11 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="15757012"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 17:10:11 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 12 Nov 2012 17:10:10 +0000
Message-ID: <1352740209.27833.314.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Date: Mon, 12 Nov 2012 17:10:09 +0000
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233537BA4E@SHSMSX101.ccr.corp.intel.com>
References: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
	<1352273413.12977.27.camel@hastur.hellion.org.uk>
	<DE8DF0795D48FD4CA783C40EC829233537BA4E@SHSMSX101.ccr.corp.intel.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] Handle broken page with regard to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-07 at 14:25 +0000, Liu, Jinsong wrote:
> Ian Campbell wrote:
> >> At the target
> >>   it would set p2m as p2m_ram_broken for broken page, so that if
> >>   guest access the broken page again, it would kill itself as
> >> expected.
> >
> > Can you add a few words here about why this is preferable to just
> > ignoring the issue and populating a regular page non-broken page on
> > the target? I think I know why but it would be useful to be explicit
> > in the changelog.
> >
> > I also spotted a typo:
> >> +                     * vMCE occur during migration +
> >> * +                     *   At sender, it marks broken page to dirty
> >> bitmap, +                     *   so that at copypages stage of
> >> migration, brokan
> >
> >
> > broken
> >
> > Ian.
> 
> OK, add some comments and correct typo.
> 
> Thanks,
> Jinsong
> 
> ==============
> Handle broken page with regard to migration
> 
> Generally, there are 2 cases:
> 1. broken page occurs before migration
> 2. broken page occurs during migration
> 
> At the sender
>   For case 1, the broken page would be mapped but not copied to target
>   (otherwise it may trigger more serious error, say, SRAR error).
>   While its pfn_type and pfn number would be transferred to target
>   so that target take appropriate action.
> 
>   For case 2, mce handler marks the broken page to dirty bitmap, so that
>   at copypages stage of migration, its pfn_type and pfn number would be
>   transferred to target and then take appropriate action.
> 
> At the target
>   When migration target would populate pages for guest. As for the case
>   of broken page wrt migration, we prefer keep the corresponding page,
>   for the sake of seamless migration.
> 
>   At target it would set p2m as p2m_ram_broken for broken page. Guest MCE
>   may have good chance to handle its broken page, while if guest access
>   the broken page again it would kill itself as expected.
> 
> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

I believe George Acked this patch in
<CAFLBxZYy8mqvfNH4Hp9x=o0jqZ4r9hnCS_qLR0O8+rkY2AAdTA@mail.gmail.com>.
Were there other acks, e.g. from Jan for the hypervisor side?

Please do collect acks into the commit log and keep them while the patch
hasn't change substantially to invalidate them (especially when a series
has had many iterations and variations like this one), otherwise I have
to go hunting for them which makes it more likely that I'll either get
distracted or go and apply some easier to deal with patch instead.

Anyway, I afraid that when I went to apply this there were loads of
rejects, I suspect a conflict with the superpage migration patch, sorry.
Please can you rebase and resend (with patchbomb).

Thanks,
Ian.

> 
> diff -r d675797494bd tools/libxc/xc_domain.c
> --- a/tools/libxc/xc_domain.c   Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xc_domain.c   Thu Nov 08 05:07:20 2012 +0800
> @@ -283,6 +283,22 @@
>      return ret;
>  }
> 
> +/* set broken page p2m */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn)
> +{
> +    int ret;
> +    DECLARE_DOMCTL;
> +
> +    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
> +    domctl.domain = (domid_t)domid;
> +    domctl.u.set_broken_page_p2m.pfn = pfn;
> +    ret = do_domctl(xch, &domctl);
> +
> +    return ret ? -1 : 0;
> +}
> +
>  /* get info from hvm guest for save */
>  int xc_domain_hvm_getcontext(xc_interface *xch,
>                               uint32_t domid,
> diff -r d675797494bd tools/libxc/xc_domain_restore.c
> --- a/tools/libxc/xc_domain_restore.c   Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xc_domain_restore.c   Thu Nov 08 05:07:20 2012 +0800
> @@ -962,9 +962,15 @@
> 
>      countpages = count;
>      for (i = oldcount; i < buf->nr_pages; ++i)
> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
> +    {
> +        unsigned long pagetype;
> +
> +        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
> +        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
> +             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
> +             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>              --countpages;
> +    }
> 
>      if (!countpages)
>          return count;
> @@ -1200,6 +1206,17 @@
>              /* a bogus/unmapped/allocate-only page: skip it */
>              continue;
> 
> +        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
> +        {
> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
> +            {
> +                ERROR("Set p2m for broken page failed, "
> +                      "dom=%d, pfn=%lx\n", dom, pfn);
> +                goto err_mapped;
> +            }
> +            continue;
> +        }
> +
>          if (pfn_err[i])
>          {
>              ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
> diff -r d675797494bd tools/libxc/xc_domain_save.c
> --- a/tools/libxc/xc_domain_save.c      Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xc_domain_save.c      Thu Nov 08 05:07:20 2012 +0800
> @@ -1277,6 +1277,13 @@
>                  if ( !hvm )
>                      gmfn = pfn_to_mfn(gmfn);
> 
> +                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                {
> +                    pfn_type[j] |= pfn_batch[j];
> +                    ++run;
> +                    continue;
> +                }
> +
>                  if ( pfn_err[j] )
>                  {
>                      if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
> @@ -1371,8 +1378,12 @@
>                      }
>                  }
> 
> -                /* skip pages that aren't present or are alloc-only */
> +                /*
> +                 * skip pages that aren't present,
> +                 * or are broken, or are alloc-only
> +                 */
>                  if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
> +                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
>                      || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>                      continue;
> 
> diff -r d675797494bd tools/libxc/xenctrl.h
> --- a/tools/libxc/xenctrl.h     Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xenctrl.h     Thu Nov 08 05:07:20 2012 +0800
> @@ -575,6 +575,17 @@
>                            xc_domaininfo_t *info);
> 
>  /**
> + * This function set p2m for broken page
> + * &parm xch a handle to an open hypervisor interface
> + * @parm domid the domain id which broken page belong to
> + * @parm pfn the pfn number of the broken page
> + * @return 0 on success, -1 on failure
> + */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn);
> +
> +/**
>   * This function returns information about the context of a hvm domain
>   * @parm xch a handle to an open hypervisor interface
>   * @parm domid the domain to get information from
> diff -r d675797494bd xen/arch/x86/cpu/mcheck/mcaction.c
> --- a/xen/arch/x86/cpu/mcheck/mcaction.c        Fri Nov 02 11:08:37 2012 +0800
> +++ b/xen/arch/x86/cpu/mcheck/mcaction.c        Thu Nov 08 05:07:20 2012 +0800
> @@ -1,5 +1,6 @@
>  #include <xen/types.h>
>  #include <xen/sched.h>
> +#include <asm/p2m.h>
>  #include "mcaction.h"
>  #include "vmce.h"
>  #include "mce.h"
> @@ -91,6 +92,24 @@
>                      goto vmce_failed;
>                  }
> 
> +                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram &&
> +                     paging_mode_log_dirty(d) )
> +                {
> +                    /*
> +                     * vMCE occur during migration
> +                     *
> +                     *   At sender, it marks broken page to dirty bitmap,
> +                     *   so that at copypages stage of migration, broken
> +                     *   page's pfn_type and pfn number would be transferred
> +                     *   to target and then take appropriate action.
> +                     *
> +                     *   At target, it would set p2m as p2m_ram_broken for
> +                     *   broken page, so that if guest access the broken page
> +                     *   again, it would kill itself as expected.
> +                     */
> +                    paging_mark_dirty(d, mfn);
> +                }
> +
>                  if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
>                  {
>                      printk("Unmap broken memory %lx for DOM%d failed\n",
> diff -r d675797494bd xen/arch/x86/domctl.c
> --- a/xen/arch/x86/domctl.c     Fri Nov 02 11:08:37 2012 +0800
> +++ b/xen/arch/x86/domctl.c     Thu Nov 08 05:07:20 2012 +0800
> @@ -209,12 +209,18 @@
>                  for ( j = 0; j < k; j++ )
>                  {
>                      unsigned long type = 0;
> +                    p2m_type_t t;
> 
> -                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
> +                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
> 
>                      if ( unlikely(!page) ||
>                           unlikely(is_xen_heap_page(page)) )
> -                        type = XEN_DOMCTL_PFINFO_XTAB;
> +                    {
> +                        if ( p2m_is_broken(t) )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
> +                        else
> +                            type = XEN_DOMCTL_PFINFO_XTAB;
> +                    }
>                      else
>                      {
>                          switch( page->u.inuse.type_info & PGT_type_mask )
> @@ -235,6 +241,9 @@
> 
>                          if ( page->u.inuse.type_info & PGT_pinned )
>                              type |= XEN_DOMCTL_PFINFO_LPINTAB;
> +
> +                        if ( page->count_info & PGC_broken )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
>                      }
> 
>                      if ( page )
> @@ -1568,6 +1577,29 @@
>      }
>      break;
> 
> +    case XEN_DOMCTL_set_broken_page_p2m:
> +    {
> +        struct domain *d;
> +
> +        d = rcu_lock_domain_by_id(domctl->domain);
> +        if ( d != NULL )
> +        {
> +            p2m_type_t pt;
> +            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
> +            mfn_t mfn = get_gfn_query(d, pfn, &pt);
> +
> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
> +                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
> +                ret = -EINVAL;
> +
> +            put_gfn(d, pfn);
> +            rcu_unlock_domain(d);
> +        }
> +        else
> +            ret = -ESRCH;
> +    }
> +    break;
> +
>      default:
>          ret = iommu_do_domctl(domctl, u_domctl);
>          break;
> diff -r d675797494bd xen/include/public/domctl.h
> --- a/xen/include/public/domctl.h       Fri Nov 02 11:08:37 2012 +0800
> +++ b/xen/include/public/domctl.h       Thu Nov 08 05:07:20 2012 +0800
> @@ -136,6 +136,7 @@
>  #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
>  #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
>  #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
> +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
>  #define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
>  #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
> 
> @@ -835,6 +836,12 @@
>  typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
>  DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
> 
> +struct xen_domctl_set_broken_page_p2m {
> +    uint64_aligned_t pfn;
> +};
> +typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
> +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
> +
>  struct xen_domctl {
>      uint32_t cmd;
>  #define XEN_DOMCTL_createdomain                   1
> @@ -900,6 +907,7 @@
>  #define XEN_DOMCTL_set_access_required           64
>  #define XEN_DOMCTL_audit_p2m                     65
>  #define XEN_DOMCTL_set_virq_handler              66
> +#define XEN_DOMCTL_set_broken_page_p2m           67
>  #define XEN_DOMCTL_gdbsx_guestmemio            1000
>  #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>  #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
> @@ -955,6 +963,7 @@
>          struct xen_domctl_audit_p2m         audit_p2m;
>          struct xen_domctl_set_virq_handler  set_virq_handler;
>          struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>          struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>          struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>          uint8_t                             pad[128];



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 17:13:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 17:13:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXxZB-0007fs-W2; Mon, 12 Nov 2012 17:12:57 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TXxZA-0007fm-K4
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 17:12:56 +0000
Received: from [193.109.254.147:2853] by server-11.bemta-14.messagelabs.com id
	57/88-29027-71E21A05; Mon, 12 Nov 2012 17:12:55 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352740373!2725416!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNDU3NDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8102 invoked from network); 12 Nov 2012 17:12:55 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-15.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 17:12:55 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qACHCZSS007344
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 12 Nov 2012 17:12:36 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qACHCZrV015543
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 12 Nov 2012 17:12:35 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qACHCYOG013712; Mon, 12 Nov 2012 11:12:34 -0600
MIME-Version: 1.0
Message-ID: <e1b7c5c9-12d9-4d38-a6f0-8058a3ccedcc@default>
Date: Mon, 12 Nov 2012 09:12:33 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
References: <20121106202816.GA29655@aepfle.de>
	<CCBF2785.442DA%keir.xen@gmail.com> <20121106221806.GA1813@aepfle.de>
	<50999ACF.4040106@citrix.com>
	<721bf725-662f-41cb-a1a3-7c908e05c188@default>
	<509A65D6.6050505@citrix.com>
	<73e55d7f-737f-4690-8b69-0252e0b749dd@default>
	<CAFLBxZYBo4Bmx1eZZ523rcz7EkoduY=JM+4q8eJwCEp6JtcO4Q@mail.gmail.com>
In-Reply-To: <CAFLBxZYBo4Bmx1eZZ523rcz7EkoduY=JM+4q8eJwCEp6JtcO4Q@mail.gmail.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: George Dunlap [mailto:George.Dunlap@eu.citrix.com]
> Subject: Re: [Xen-devel] reliable live migration of large and busy guests
> 
> On Wed, Nov 7, 2012 at 3:10 PM, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> 
> 
> 	> From an idealistic point of view, it might be quite nice to have several
> 
> 	> live migrate mechanisms, so the user can choose whether they value
> 	> minimum downtime, minimum network utilisation, or maximum safety.
> 
> 	Agreed.  IIRC, when post-copy was suggested for Xen years ago,
> 	Ian Pratt was against it, though I don't recall why, so Michael
> 	Hines work was never pursued (outside of academia).  Probably
> 	worth asking IanP before investing too much time into it.
> 
> Was he against a hybrid approach, where you "push" things first, and then "pull" things later?  Or
> just against a pure "pull" approach?  I'm pretty sure a pure "pull" approach would result in lower
> performance during the migration.

Sorry, I don't recall.
 
> Just tossing another idea out there: What about throttling the VM if it's dirtying too many pages?
> You can use the "cap" feature of the credit1 scheduler to reduce the amount of cpu time a given VM
> gets, even if there is free cpu time available.  You could play around with doing N iterations, and
> then cranking down the cap on each iteration after that; then the application wouldn't have a several-
> second pause, it would just be "running slowly" for some period of time.
> 
> Overall doing a hybrid "send dirty pages for a while, then move and pull the rest in" seems like the
> best approach in the long-run, but it's fairly complicated.  A throttling approach is probably less
> optimal but simpler to get working as a temporary measure.

I agree there are lots of interesting hybrid possibilities worth exploring.
There are side-effects to be considered though... for example, the current
push approach is the only one that should be used when the goal of the
migration is to evacuate a physical machine so that it can be powered
off ASAP for maintenance or power management.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 17:13:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 17:13:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXxZB-0007fs-W2; Mon, 12 Nov 2012 17:12:57 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TXxZA-0007fm-K4
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 17:12:56 +0000
Received: from [193.109.254.147:2853] by server-11.bemta-14.messagelabs.com id
	57/88-29027-71E21A05; Mon, 12 Nov 2012 17:12:55 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352740373!2725416!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNDU3NDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8102 invoked from network); 12 Nov 2012 17:12:55 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-15.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 17:12:55 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qACHCZSS007344
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 12 Nov 2012 17:12:36 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qACHCZrV015543
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 12 Nov 2012 17:12:35 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qACHCYOG013712; Mon, 12 Nov 2012 11:12:34 -0600
MIME-Version: 1.0
Message-ID: <e1b7c5c9-12d9-4d38-a6f0-8058a3ccedcc@default>
Date: Mon, 12 Nov 2012 09:12:33 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
References: <20121106202816.GA29655@aepfle.de>
	<CCBF2785.442DA%keir.xen@gmail.com> <20121106221806.GA1813@aepfle.de>
	<50999ACF.4040106@citrix.com>
	<721bf725-662f-41cb-a1a3-7c908e05c188@default>
	<509A65D6.6050505@citrix.com>
	<73e55d7f-737f-4690-8b69-0252e0b749dd@default>
	<CAFLBxZYBo4Bmx1eZZ523rcz7EkoduY=JM+4q8eJwCEp6JtcO4Q@mail.gmail.com>
In-Reply-To: <CAFLBxZYBo4Bmx1eZZ523rcz7EkoduY=JM+4q8eJwCEp6JtcO4Q@mail.gmail.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] reliable live migration of large and busy guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: George Dunlap [mailto:George.Dunlap@eu.citrix.com]
> Subject: Re: [Xen-devel] reliable live migration of large and busy guests
> 
> On Wed, Nov 7, 2012 at 3:10 PM, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> 
> 
> 	> From an idealistic point of view, it might be quite nice to have several
> 
> 	> live migrate mechanisms, so the user can choose whether they value
> 	> minimum downtime, minimum network utilisation, or maximum safety.
> 
> 	Agreed.  IIRC, when post-copy was suggested for Xen years ago,
> 	Ian Pratt was against it, though I don't recall why, so Michael
> 	Hines work was never pursued (outside of academia).  Probably
> 	worth asking IanP before investing too much time into it.
> 
> Was he against a hybrid approach, where you "push" things first, and then "pull" things later?  Or
> just against a pure "pull" approach?  I'm pretty sure a pure "pull" approach would result in lower
> performance during the migration.

Sorry, I don't recall.
 
> Just tossing another idea out there: What about throttling the VM if it's dirtying too many pages?
> You can use the "cap" feature of the credit1 scheduler to reduce the amount of cpu time a given VM
> gets, even if there is free cpu time available.  You could play around with doing N iterations, and
> then cranking down the cap on each iteration after that; then the application wouldn't have a several-
> second pause, it would just be "running slowly" for some period of time.
> 
> Overall doing a hybrid "send dirty pages for a while, then move and pull the rest in" seems like the
> best approach in the long-run, but it's fairly complicated.  A throttling approach is probably less
> optimal but simpler to get working as a temporary measure.

I agree there are lots of interesting hybrid possibilities worth exploring.
There are side-effects to be considered though... for example, the current
push approach is the only one that should be used when the goal of the
migration is to evacuate a physical machine so that it can be powered
off ASAP for maintenance or power management.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 17:21:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 17:21:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXxgz-0007sf-W3; Mon, 12 Nov 2012 17:21:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1TXxgx-0007sa-W0
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 17:21:00 +0000
Received: from [85.158.139.83:39344] by server-13.bemta-5.messagelabs.com id
	A5/6E-27809-BFF21A05; Mon, 12 Nov 2012 17:20:59 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-8.tower-182.messagelabs.com!1352740858!18652565!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6166 invoked from network); 12 Nov 2012 17:20:58 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Nov 2012 17:20:58 -0000
Received: from 102-64-ftth.on.nl ([88.159.64.102]:54549 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1TXxjh-0006KV-13; Mon, 12 Nov 2012 18:23:49 +0100
Date: Mon, 12 Nov 2012 18:20:55 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <1945521669.20121112182055@eikelenboom.it>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
In-Reply-To: <20121112163204.GB9575@phenom.dumpdata.com>
References: <20121110135931.GD23686@localhost.localdomain>
	<1352714084.27833.137.camel@zakaz.uk.xensource.com>
	<20121112142835.GG19860@phenom.dumpdata.com>
	<711956045.20121112155024@eikelenboom.it>
	<20121112163204.GB9575@phenom.dumpdata.com>
MIME-Version: 1.0
Cc: "annie.li@oracle.com" <annie.li@oracle.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"marcos.matsunaga@oracle.com" <marcos.matsunaga@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] domU to domU networking issues in v3.7?
	(netserver/netperf failing to communicate)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


Monday, November 12, 2012, 5:32:04 PM, you wrote:

> On Mon, Nov 12, 2012 at 03:50:24PM +0100, Sander Eikelenboom wrote:
>> 
>> Monday, November 12, 2012, 3:28:35 PM, you wrote:
>> 
>> > On Mon, Nov 12, 2012 at 09:54:44AM +0000, Ian Campbell wrote:
>> >> On Sat, 2012-11-10 at 13:59 +0000, Konrad Rzeszutek Wilk wrote:
>> >> > Hey Ian, Xen-devel mailingl list,
>> >> > 
>> >> > I think the issue of 70% traffic lost was actually introduced in v3.6 or
>> >> > perhaps v3.5. Annie and Marcos (CC-ed here) are looking to see which of
>> >> > the releases introduced this. The issue we are seeing is that a domU
>> >> > to domU communication breaks - this is with netperf/netserver talking to
>> >> > each other.
>> >> > 
>> >> > Anyhow, I think the 3.7 compound page exacerbated the problem and also
>> >> > (at least on some of my test hardware) exposed existing issues with
>> >> > drivers. The issue I have is that the 'skge' driver has a bug that has
>> >> > been there for ages (I tested way back to 3.0 and still saw it) were it
>> >> > can not work with SWIOTLB. It is probably missing an pci_dma_sync
>> >> > somewhere. 
>> >> > 
>> >> > Anyhow the compound page got me to look at Xen-SWIOTLB and that looks
>> >> > OK. Even with synthetic driver (the fake one I posted somewhere) it
>> >> > dealt with compound pages properly (with debug or non-debug Xen
>> >> > hypervisor).
>> >> 
>> >> The debug build is probably most interesting since it deliberately
>> >> allocates a non 1-1 p-to-m mapping so as to catch exactly these sorts of
>> >> issues.
>> 
>> > Right. My test env runs with that. And so far it only has issues
>> > with the skge one.
>> >> 
>> >> > So was wondering if you had looked at this in more details? Any
>> >> > ideas? Or would it be more prudent to ask that once we know for sure
>> >> > which Linux release introduced the communication failures between
>> >> > guests?
>> >> 
>> >> I've not looked at it any further I'm afraid.
>> >> 
>> >> If these changes (be they in 3.5 or later, or earlier) are exposing
>> >> driver bugs then I suspect the netdev chaps would want to know about it.
>> 
>> > Right. Annie (CC-ed here) mentioned to me that v3.5 looks to work ok.
>> > And is off checking v3.6. v3.7 is definitly a no go.
>> >> 
>> >> FWIW I see the issue with tg3.
>> 
>> After the issues with netback where fixed, I'm seeing the issues with net_front reverting the single commit 5640f7685831e088fe6c2e1f863a6805962f8e81 (that was pointed out for netback) also makes these disappear.

> Were you ever able to trigger the BUG_ON in the patch that Ian posted?

What exact patch (or any other patch that can help you ) ?
(so i can try again to be sure)


>> I haven't seen issues with netfront and netback before this commit. FWIW: the hardware nics in this machine are two r8169 's.
>> 
>> --
>> Sander
>> 
>> > I should double-check that but I didn't get any issues with the tg3 I had.
>> 
>> > I was running the netperf/netserver from/to to see if I could reproduce the
>> > issues (70% loss) you described but did not have much luck.
>> 
>> >> 
>> >> Ian.
>> 
>> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 17:21:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 17:21:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXxgz-0007sf-W3; Mon, 12 Nov 2012 17:21:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1TXxgx-0007sa-W0
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 17:21:00 +0000
Received: from [85.158.139.83:39344] by server-13.bemta-5.messagelabs.com id
	A5/6E-27809-BFF21A05; Mon, 12 Nov 2012 17:20:59 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-8.tower-182.messagelabs.com!1352740858!18652565!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6166 invoked from network); 12 Nov 2012 17:20:58 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Nov 2012 17:20:58 -0000
Received: from 102-64-ftth.on.nl ([88.159.64.102]:54549 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1TXxjh-0006KV-13; Mon, 12 Nov 2012 18:23:49 +0100
Date: Mon, 12 Nov 2012 18:20:55 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <1945521669.20121112182055@eikelenboom.it>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
In-Reply-To: <20121112163204.GB9575@phenom.dumpdata.com>
References: <20121110135931.GD23686@localhost.localdomain>
	<1352714084.27833.137.camel@zakaz.uk.xensource.com>
	<20121112142835.GG19860@phenom.dumpdata.com>
	<711956045.20121112155024@eikelenboom.it>
	<20121112163204.GB9575@phenom.dumpdata.com>
MIME-Version: 1.0
Cc: "annie.li@oracle.com" <annie.li@oracle.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"marcos.matsunaga@oracle.com" <marcos.matsunaga@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] domU to domU networking issues in v3.7?
	(netserver/netperf failing to communicate)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


Monday, November 12, 2012, 5:32:04 PM, you wrote:

> On Mon, Nov 12, 2012 at 03:50:24PM +0100, Sander Eikelenboom wrote:
>> 
>> Monday, November 12, 2012, 3:28:35 PM, you wrote:
>> 
>> > On Mon, Nov 12, 2012 at 09:54:44AM +0000, Ian Campbell wrote:
>> >> On Sat, 2012-11-10 at 13:59 +0000, Konrad Rzeszutek Wilk wrote:
>> >> > Hey Ian, Xen-devel mailingl list,
>> >> > 
>> >> > I think the issue of 70% traffic lost was actually introduced in v3.6 or
>> >> > perhaps v3.5. Annie and Marcos (CC-ed here) are looking to see which of
>> >> > the releases introduced this. The issue we are seeing is that a domU
>> >> > to domU communication breaks - this is with netperf/netserver talking to
>> >> > each other.
>> >> > 
>> >> > Anyhow, I think the 3.7 compound page exacerbated the problem and also
>> >> > (at least on some of my test hardware) exposed existing issues with
>> >> > drivers. The issue I have is that the 'skge' driver has a bug that has
>> >> > been there for ages (I tested way back to 3.0 and still saw it) were it
>> >> > can not work with SWIOTLB. It is probably missing an pci_dma_sync
>> >> > somewhere. 
>> >> > 
>> >> > Anyhow the compound page got me to look at Xen-SWIOTLB and that looks
>> >> > OK. Even with synthetic driver (the fake one I posted somewhere) it
>> >> > dealt with compound pages properly (with debug or non-debug Xen
>> >> > hypervisor).
>> >> 
>> >> The debug build is probably most interesting since it deliberately
>> >> allocates a non 1-1 p-to-m mapping so as to catch exactly these sorts of
>> >> issues.
>> 
>> > Right. My test env runs with that. And so far it only has issues
>> > with the skge one.
>> >> 
>> >> > So was wondering if you had looked at this in more details? Any
>> >> > ideas? Or would it be more prudent to ask that once we know for sure
>> >> > which Linux release introduced the communication failures between
>> >> > guests?
>> >> 
>> >> I've not looked at it any further I'm afraid.
>> >> 
>> >> If these changes (be they in 3.5 or later, or earlier) are exposing
>> >> driver bugs then I suspect the netdev chaps would want to know about it.
>> 
>> > Right. Annie (CC-ed here) mentioned to me that v3.5 looks to work ok.
>> > And is off checking v3.6. v3.7 is definitly a no go.
>> >> 
>> >> FWIW I see the issue with tg3.
>> 
>> After the issues with netback where fixed, I'm seeing the issues with net_front reverting the single commit 5640f7685831e088fe6c2e1f863a6805962f8e81 (that was pointed out for netback) also makes these disappear.

> Were you ever able to trigger the BUG_ON in the patch that Ian posted?

What exact patch (or any other patch that can help you ) ?
(so i can try again to be sure)


>> I haven't seen issues with netfront and netback before this commit. FWIW: the hardware nics in this machine are two r8169 's.
>> 
>> --
>> Sander
>> 
>> > I should double-check that but I didn't get any issues with the tg3 I had.
>> 
>> > I was running the netperf/netserver from/to to see if I could reproduce the
>> > issues (70% loss) you described but did not have much luck.
>> 
>> >> 
>> >> Ian.
>> 
>> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 17:23:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 17:23:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXxj8-00081J-Iq; Mon, 12 Nov 2012 17:23:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TXxj5-00081B-Ll
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 17:23:12 +0000
Received: from [85.158.137.99:27625] by server-7.bemta-3.messagelabs.com id
	5B/D9-01713-E7031A05; Mon, 12 Nov 2012 17:23:10 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-3.tower-217.messagelabs.com!1352740988!13729767!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6264 invoked from network); 12 Nov 2012 17:23:09 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-3.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 17:23:09 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157154400;
	Mon, 12 Nov 2012 12:22:02 -0500
Message-ID: <50A13039.2070909@jhuapl.edu>
Date: Mon, 12 Nov 2012 12:22:01 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
References: <1352730598-13904-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121112163052.GA9575@phenom.dumpdata.com>
In-Reply-To: <20121112163052.GA9575@phenom.dumpdata.com>
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"tpmdd@selhorst.net" <tpmdd@selhorst.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	"key@linux.vnet.ibm.com" <key@linux.vnet.ibm.com>,
	"tpmdd@sirrix.com" <tpmdd@sirrix.com>
Subject: Re: [Xen-devel] [PATCH v2] add xen-tpmfront.ko: Xen Virtual TPM
	frontend driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8071776088080929173=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============8071776088080929173==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms090603020802090608070101"

This is a cryptographically signed message in MIME format.

--------------ms090603020802090608070101
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/12/2012 11:30 AM, Konrad Rzeszutek Wilk wrote:
> On Mon, Nov 12, 2012 at 09:29:58AM -0500, Matthew Fioravante wrote:
>> This patch ports the xen vtpm frontend driver for linux
>> from the linux-2.6.18-xen.hg tree to linux-stable. This
>> driver is designed be used with the mini-os tpmback driver
>> in Xen as part of the new mini-os virtual tpm subsystem.
>> See docs/misc/vtpm.txt in Xen and the xen-devel mailing list
>> for details.
> I didn't look in details but off the bat - you are missing
> the Documentation/../sysfs file.
It looks like Kent submitted a patch that documents sysfs generically
for all of the TPM drivers.
>
> I still think you should include the full vtpm.txt in this
> patch description and refer at the end to the docs/misc/vtpm.txt
> in Xen as the source for the up-to-date version.
The current docs/misc/vtpm.txt in Xen is still the old version. I've=20
just written a new one and am reviewing it. It will come in the next=20
resubmission of my vtpm patches to xen. I'll include the text here for=20
the next resubmission of this patch as well.



--------------ms090603020802090608070101
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTD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HQh4YNChVLzuZqK5ARJARD8JoujGZ
fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTExMjE3MjIwMVowIwYJKoZIhvcNAQkEMRYEFJPFWr9ZfnF3BcET
68Yq5ttbLCTXMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAiOHtiOdqTXHNXAiT2HsZrKtOVBHbLCTYw
BOTGpj5qE1z8YKYBDWVVIRe3arLR98f+lqSJLzcOBeZs9CTRqnv1lXr+3Bz2rNK7BfUgd22r
P2zISikZD0++9X0goPilRbGw6UHL0N2wxF107d0PcowQ+SEvskqslkDFiPtwwv39pwAAAAAA
AA==
--------------ms090603020802090608070101--


--===============8071776088080929173==
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.xen.org
http://lists.xen.org/xen-devel

--===============8071776088080929173==--


From xen-devel-bounces@lists.xen.org Mon Nov 12 17:23:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 17:23:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXxj8-00081J-Iq; Mon, 12 Nov 2012 17:23:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TXxj5-00081B-Ll
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 17:23:12 +0000
Received: from [85.158.137.99:27625] by server-7.bemta-3.messagelabs.com id
	5B/D9-01713-E7031A05; Mon, 12 Nov 2012 17:23:10 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-3.tower-217.messagelabs.com!1352740988!13729767!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6264 invoked from network); 12 Nov 2012 17:23:09 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-3.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 17:23:09 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157154400;
	Mon, 12 Nov 2012 12:22:02 -0500
Message-ID: <50A13039.2070909@jhuapl.edu>
Date: Mon, 12 Nov 2012 12:22:01 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
References: <1352730598-13904-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121112163052.GA9575@phenom.dumpdata.com>
In-Reply-To: <20121112163052.GA9575@phenom.dumpdata.com>
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"tpmdd@selhorst.net" <tpmdd@selhorst.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	"key@linux.vnet.ibm.com" <key@linux.vnet.ibm.com>,
	"tpmdd@sirrix.com" <tpmdd@sirrix.com>
Subject: Re: [Xen-devel] [PATCH v2] add xen-tpmfront.ko: Xen Virtual TPM
	frontend driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8071776088080929173=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============8071776088080929173==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms090603020802090608070101"

This is a cryptographically signed message in MIME format.

--------------ms090603020802090608070101
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/12/2012 11:30 AM, Konrad Rzeszutek Wilk wrote:
> On Mon, Nov 12, 2012 at 09:29:58AM -0500, Matthew Fioravante wrote:
>> This patch ports the xen vtpm frontend driver for linux
>> from the linux-2.6.18-xen.hg tree to linux-stable. This
>> driver is designed be used with the mini-os tpmback driver
>> in Xen as part of the new mini-os virtual tpm subsystem.
>> See docs/misc/vtpm.txt in Xen and the xen-devel mailing list
>> for details.
> I didn't look in details but off the bat - you are missing
> the Documentation/../sysfs file.
It looks like Kent submitted a patch that documents sysfs generically
for all of the TPM drivers.
>
> I still think you should include the full vtpm.txt in this
> patch description and refer at the end to the docs/misc/vtpm.txt
> in Xen as the source for the up-to-date version.
The current docs/misc/vtpm.txt in Xen is still the old version. I've=20
just written a new one and am reviewing it. It will come in the next=20
resubmission of my vtpm patches to xen. I'll include the text here for=20
the next resubmission of this patch as well.



--------------ms090603020802090608070101
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlCwMBAQEBBAoWCGZpb3Jh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YI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAiOHtiOdqTXHNXAiT2HsZrKtOVBHbLCTYw
BOTGpj5qE1z8YKYBDWVVIRe3arLR98f+lqSJLzcOBeZs9CTRqnv1lXr+3Bz2rNK7BfUgd22r
P2zISikZD0++9X0goPilRbGw6UHL0N2wxF107d0PcowQ+SEvskqslkDFiPtwwv39pwAAAAAA
AA==
--------------ms090603020802090608070101--


--===============8071776088080929173==
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.xen.org
http://lists.xen.org/xen-devel

--===============8071776088080929173==--


From xen-devel-bounces@lists.xen.org Mon Nov 12 18:06:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 18:06:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXyO2-0000Ah-Aq; Mon, 12 Nov 2012 18:05:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jajcus@jajcus.net>) id 1TXyO1-0000Ac-BW
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 18:05:29 +0000
Received: from [85.158.138.51:36480] by server-2.bemta-3.messagelabs.com id
	89/19-04744-36A31A05; Mon, 12 Nov 2012 18:05:23 +0000
X-Env-Sender: jajcus@jajcus.net
X-Msg-Ref: server-12.tower-174.messagelabs.com!1352743521!21795400!1
X-Originating-IP: [84.205.176.49]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3844 invoked from network); 12 Nov 2012 18:05:22 -0000
Received: from tropek.jajcus.net (HELO tropek.jajcus.net) (84.205.176.49)
	by server-12.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 12 Nov 2012 18:05:22 -0000
Received: from localhost (lolek.nigdzie [10.253.0.124])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by tropek.jajcus.net (Postfix) with ESMTPSA id 6583C5002;
	Mon, 12 Nov 2012 19:05:20 +0100 (CET)
Date: Mon, 12 Nov 2012 19:05:20 +0100
From: Jacek Konieczny <jajcus@jajcus.net>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121112180519.GA2114@lolek.nigdzie>
Mail-Followup-To: Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Olaf Hering <olaf@aepfle.de>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
	<1352738557.27833.302.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352738557.27833.302.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] Fix locking in
	tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 12, 2012 at 04:42:37PM +0000, Ian Campbell wrote:
> On Fri, 2012-11-09 at 13:56 +0000, Jacek Konieczny wrote:
> > The claim_lock() function would fail in the perl code with:
> > 
> >   Invalid argument at -e line 2.
> > 
> > because the Perl snippet opens for reading the file descriptor, which
> > was earlier opened for write (append).
> 
> Looks plausible to me.
> 
> How does this interact with the 
>         eval "exec $_lockfd<&-"
> which Olaf added in 26079:b3b03536789a ? I suppose close is close and
> <&- and >&- or even <>&- are equivalent?

It seems <&- and >&- are indeed the same and there is no such thing as '<>&-'.

I have added the Olaf's change to my test setup and it works properly. So
no conflict here.

> > 
> > Signed-off-by: Jacek Konieczny <jajcus@jajcus.net>
> > ---
> >  tools/hotplug/Linux/locking.sh | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/hotplug/Linux/locking.sh b/tools/hotplug/Linux/locking.sh
> > index e34f155..122bcfb 100644
> > --- a/tools/hotplug/Linux/locking.sh
> > +++ b/tools/hotplug/Linux/locking.sh
> > @@ -44,7 +44,7 @@ claim_lock()
> >      # See below for a correctness proof.
> >      local rightfile
> >      while true; do
> > -        eval "exec $_lockfd>>$_lockfile"
> > +        eval "exec $_lockfd<>$_lockfile"
> >          flock -x $_lockfd || return $?
> >          # We can't just stat /dev/stdin or /proc/self/fd/$_lockfd or
> >          # use bash's test -ef because those all go through what is

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 18:06:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 18:06:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXyO2-0000Ah-Aq; Mon, 12 Nov 2012 18:05:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jajcus@jajcus.net>) id 1TXyO1-0000Ac-BW
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 18:05:29 +0000
Received: from [85.158.138.51:36480] by server-2.bemta-3.messagelabs.com id
	89/19-04744-36A31A05; Mon, 12 Nov 2012 18:05:23 +0000
X-Env-Sender: jajcus@jajcus.net
X-Msg-Ref: server-12.tower-174.messagelabs.com!1352743521!21795400!1
X-Originating-IP: [84.205.176.49]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3844 invoked from network); 12 Nov 2012 18:05:22 -0000
Received: from tropek.jajcus.net (HELO tropek.jajcus.net) (84.205.176.49)
	by server-12.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 12 Nov 2012 18:05:22 -0000
Received: from localhost (lolek.nigdzie [10.253.0.124])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by tropek.jajcus.net (Postfix) with ESMTPSA id 6583C5002;
	Mon, 12 Nov 2012 19:05:20 +0100 (CET)
Date: Mon, 12 Nov 2012 19:05:20 +0100
From: Jacek Konieczny <jajcus@jajcus.net>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121112180519.GA2114@lolek.nigdzie>
Mail-Followup-To: Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Olaf Hering <olaf@aepfle.de>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
	<1352738557.27833.302.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352738557.27833.302.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] Fix locking in
	tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 12, 2012 at 04:42:37PM +0000, Ian Campbell wrote:
> On Fri, 2012-11-09 at 13:56 +0000, Jacek Konieczny wrote:
> > The claim_lock() function would fail in the perl code with:
> > 
> >   Invalid argument at -e line 2.
> > 
> > because the Perl snippet opens for reading the file descriptor, which
> > was earlier opened for write (append).
> 
> Looks plausible to me.
> 
> How does this interact with the 
>         eval "exec $_lockfd<&-"
> which Olaf added in 26079:b3b03536789a ? I suppose close is close and
> <&- and >&- or even <>&- are equivalent?

It seems <&- and >&- are indeed the same and there is no such thing as '<>&-'.

I have added the Olaf's change to my test setup and it works properly. So
no conflict here.

> > 
> > Signed-off-by: Jacek Konieczny <jajcus@jajcus.net>
> > ---
> >  tools/hotplug/Linux/locking.sh | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/hotplug/Linux/locking.sh b/tools/hotplug/Linux/locking.sh
> > index e34f155..122bcfb 100644
> > --- a/tools/hotplug/Linux/locking.sh
> > +++ b/tools/hotplug/Linux/locking.sh
> > @@ -44,7 +44,7 @@ claim_lock()
> >      # See below for a correctness proof.
> >      local rightfile
> >      while true; do
> > -        eval "exec $_lockfd>>$_lockfile"
> > +        eval "exec $_lockfd<>$_lockfile"
> >          flock -x $_lockfd || return $?
> >          # We can't just stat /dev/stdin or /proc/self/fd/$_lockfd or
> >          # use bash's test -ef because those all go through what is

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 18:08:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 18:08:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXyQC-0000G6-Ts; Mon, 12 Nov 2012 18:07:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TXyQB-0000G0-27
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 18:07:43 +0000
Received: from [85.158.143.99:39385] by server-1.bemta-4.messagelabs.com id
	CA/B1-27934-EEA31A05; Mon, 12 Nov 2012 18:07:42 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-6.tower-216.messagelabs.com!1352743661!22601613!1
X-Originating-IP: [81.169.146.178]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3OCA9PiAyNTczMA==\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3OCA9PiAyNTczMA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5137 invoked from network); 12 Nov 2012 18:07:42 -0000
Received: from mo-p04-ob.rzone.de (HELO mo-p04-ob.rzone.de) (81.169.146.178)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 18:07:42 -0000
X-RZG-CLASS-ID: mo04
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmxtMZ80VwmRNV6KE=
Received: from probook.site (ip-80-226-24-2.vodafone-net.de [80.226.24.2])
	by smtp.strato.de (jored mo15) (RZmta 31.3 SBL|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id U018ceoACI44Wb ;
	Mon, 12 Nov 2012 19:07:40 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id A8B7C189BA; Mon, 12 Nov 2012 19:07:38 +0100 (CET)
Date: Mon, 12 Nov 2012 19:07:38 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121112180738.GA26672@aepfle.de>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
	<1352738557.27833.302.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352738557.27833.302.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Jacek Konieczny <jajcus@jajcus.net>
Subject: Re: [Xen-devel] [PATCH] Fix locking in
	tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 12, Ian Campbell wrote:

> On Fri, 2012-11-09 at 13:56 +0000, Jacek Konieczny wrote:
> > The claim_lock() function would fail in the perl code with:
> > 
> >   Invalid argument at -e line 2.
> > 
> > because the Perl snippet opens for reading the file descriptor, which
> > was earlier opened for write (append).
> 
> Looks plausible to me.
> 
> How does this interact with the 
>         eval "exec $_lockfd<&-"
> which Olaf added in 26079:b3b03536789a ? I suppose close is close and
> <&- and >&- or even <>&- are equivalent?

I did not see the perl error, in what environment did you notice this
error?

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 18:08:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 18:08:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXyQC-0000G6-Ts; Mon, 12 Nov 2012 18:07:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TXyQB-0000G0-27
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 18:07:43 +0000
Received: from [85.158.143.99:39385] by server-1.bemta-4.messagelabs.com id
	CA/B1-27934-EEA31A05; Mon, 12 Nov 2012 18:07:42 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-6.tower-216.messagelabs.com!1352743661!22601613!1
X-Originating-IP: [81.169.146.178]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3OCA9PiAyNTczMA==\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3OCA9PiAyNTczMA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5137 invoked from network); 12 Nov 2012 18:07:42 -0000
Received: from mo-p04-ob.rzone.de (HELO mo-p04-ob.rzone.de) (81.169.146.178)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 18:07:42 -0000
X-RZG-CLASS-ID: mo04
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmxtMZ80VwmRNV6KE=
Received: from probook.site (ip-80-226-24-2.vodafone-net.de [80.226.24.2])
	by smtp.strato.de (jored mo15) (RZmta 31.3 SBL|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id U018ceoACI44Wb ;
	Mon, 12 Nov 2012 19:07:40 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id A8B7C189BA; Mon, 12 Nov 2012 19:07:38 +0100 (CET)
Date: Mon, 12 Nov 2012 19:07:38 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121112180738.GA26672@aepfle.de>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
	<1352738557.27833.302.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352738557.27833.302.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Jacek Konieczny <jajcus@jajcus.net>
Subject: Re: [Xen-devel] [PATCH] Fix locking in
	tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 12, Ian Campbell wrote:

> On Fri, 2012-11-09 at 13:56 +0000, Jacek Konieczny wrote:
> > The claim_lock() function would fail in the perl code with:
> > 
> >   Invalid argument at -e line 2.
> > 
> > because the Perl snippet opens for reading the file descriptor, which
> > was earlier opened for write (append).
> 
> Looks plausible to me.
> 
> How does this interact with the 
>         eval "exec $_lockfd<&-"
> which Olaf added in 26079:b3b03536789a ? I suppose close is close and
> <&- and >&- or even <>&- are equivalent?

I did not see the perl error, in what environment did you notice this
error?

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 18:17:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 18:17:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXyYi-0000Xg-1M; Mon, 12 Nov 2012 18:16:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1TXyYg-0000XH-HW; Mon, 12 Nov 2012 18:16:30 +0000
Received: from [85.158.137.99:60915] by server-5.bemta-3.messagelabs.com id
	9C/A6-26311-8FC31A05; Mon, 12 Nov 2012 18:16:24 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1352744183!13735230!1
X-Originating-IP: [209.85.214.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10176 invoked from network); 12 Nov 2012 18:16:24 -0000
Received: from mail-bk0-f45.google.com (HELO mail-bk0-f45.google.com)
	(209.85.214.45)
	by server-3.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 18:16:24 -0000
Received: by mail-bk0-f45.google.com with SMTP id je9so1704222bkc.32
	for <multiple recipients>; Mon, 12 Nov 2012 10:16:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:date:from:reply-to:user-agent:mime-version:to
	:subject:content-type:content-transfer-encoding;
	bh=oH0qiROsoRnBKT/ng0B9hQtYiosiymv6E2B3UJzsaSw=;
	b=ypuPhq3BVCJGdkfMHvnGprdU2BVH0c6tg32Q8Y41b7Dy+1ZTYTCOdIrlPZUmqVcmXx
	xoEBsLLcQMJ/8hHPl5o1ZZOpPXSCoVsny6FFWw2llele34L1Nh+WMj8XKl1912r1Kk1C
	zQRZxIFzVwCPhO5Tw/UjlqHfqdkfd7ZPJ4vzDKtzI0nTTmM+EzYaPXOWjuKJSIMJbzA9
	TqWi/DPVysVCgZxVvTu9SqHdSrufThwL72mFpFxLuz+k9lYfJ7cs1DqHJi5mgKUNcZ0z
	uQpADHYqDP2IRfBxhBQN95Ko/HZHmJwk2F/qLOBqV4v8neFY3waW+BjyEyioL+kQe8QW
	AUcg==
Received: by 10.204.147.139 with SMTP id l11mr7557777bkv.100.1352744183712;
	Mon, 12 Nov 2012 10:16:23 -0800 (PST)
Received: from [172.16.26.11] (b0fb37e5.bb.sky.com. [176.251.55.229])
	by mx.google.com with ESMTPS id hm4sm1878045bkc.7.2012.11.12.10.16.22
	(version=SSLv3 cipher=OTHER); Mon, 12 Nov 2012 10:16:23 -0800 (PST)
Message-ID: <50A13CF8.3040301@xen.org>
Date: Mon, 12 Nov 2012 18:16:24 +0000
From: Lars Kurth <lars.kurth@xen.org>
User-Agent: Mozilla/5.0 (Windows NT 6.1;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: xci-devel@lists.xen.org, 
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: [Xen-devel] Results of XCI archivation review
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: lars.kurth@xen.org
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi everybody,
two weeks ago I proposed that XCI should be archived. We had 3 votes by 
committers in favour of archivation and no objections. Unless somebody 
strongly objects, I will archive XCI later this week. This is the last 
chance to shout.
Best Regards
Lars

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 18:17:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 18:17:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXyYi-0000Xg-1M; Mon, 12 Nov 2012 18:16:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1TXyYg-0000XH-HW; Mon, 12 Nov 2012 18:16:30 +0000
Received: from [85.158.137.99:60915] by server-5.bemta-3.messagelabs.com id
	9C/A6-26311-8FC31A05; Mon, 12 Nov 2012 18:16:24 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1352744183!13735230!1
X-Originating-IP: [209.85.214.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10176 invoked from network); 12 Nov 2012 18:16:24 -0000
Received: from mail-bk0-f45.google.com (HELO mail-bk0-f45.google.com)
	(209.85.214.45)
	by server-3.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 18:16:24 -0000
Received: by mail-bk0-f45.google.com with SMTP id je9so1704222bkc.32
	for <multiple recipients>; Mon, 12 Nov 2012 10:16:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:date:from:reply-to:user-agent:mime-version:to
	:subject:content-type:content-transfer-encoding;
	bh=oH0qiROsoRnBKT/ng0B9hQtYiosiymv6E2B3UJzsaSw=;
	b=ypuPhq3BVCJGdkfMHvnGprdU2BVH0c6tg32Q8Y41b7Dy+1ZTYTCOdIrlPZUmqVcmXx
	xoEBsLLcQMJ/8hHPl5o1ZZOpPXSCoVsny6FFWw2llele34L1Nh+WMj8XKl1912r1Kk1C
	zQRZxIFzVwCPhO5Tw/UjlqHfqdkfd7ZPJ4vzDKtzI0nTTmM+EzYaPXOWjuKJSIMJbzA9
	TqWi/DPVysVCgZxVvTu9SqHdSrufThwL72mFpFxLuz+k9lYfJ7cs1DqHJi5mgKUNcZ0z
	uQpADHYqDP2IRfBxhBQN95Ko/HZHmJwk2F/qLOBqV4v8neFY3waW+BjyEyioL+kQe8QW
	AUcg==
Received: by 10.204.147.139 with SMTP id l11mr7557777bkv.100.1352744183712;
	Mon, 12 Nov 2012 10:16:23 -0800 (PST)
Received: from [172.16.26.11] (b0fb37e5.bb.sky.com. [176.251.55.229])
	by mx.google.com with ESMTPS id hm4sm1878045bkc.7.2012.11.12.10.16.22
	(version=SSLv3 cipher=OTHER); Mon, 12 Nov 2012 10:16:23 -0800 (PST)
Message-ID: <50A13CF8.3040301@xen.org>
Date: Mon, 12 Nov 2012 18:16:24 +0000
From: Lars Kurth <lars.kurth@xen.org>
User-Agent: Mozilla/5.0 (Windows NT 6.1;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: xci-devel@lists.xen.org, 
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: [Xen-devel] Results of XCI archivation review
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: lars.kurth@xen.org
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi everybody,
two weeks ago I proposed that XCI should be archived. We had 3 votes by 
committers in favour of archivation and no objections. Unless somebody 
strongly objects, I will archive XCI later this week. This is the last 
chance to shout.
Best Regards
Lars

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 18:18:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 18:18:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXya9-0000dJ-HB; Mon, 12 Nov 2012 18:18:01 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rlampe@tqhosting.com>) id 1TXx80-0006WV-HT
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 16:44:52 +0000
Received: from [193.109.254.147:51565] by server-16.bemta-14.messagelabs.com
	id 34/45-09215-38721A05; Mon, 12 Nov 2012 16:44:51 +0000
X-Env-Sender: rlampe@tqhosting.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352738689!7992580!1
X-Originating-IP: [209.85.216.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12466 invoked from network); 12 Nov 2012 16:44:50 -0000
Received: from mail-qc0-f173.google.com (HELO mail-qc0-f173.google.com)
	(209.85.216.173)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 16:44:50 -0000
Received: by mail-qc0-f173.google.com with SMTP id b12so4679459qca.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 08:44:49 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type
	:x-gm-message-state;
	bh=i3rW8pG8SbOSjP51uefkzEUoYMkpI2JiWfJz30Ohnvg=;
	b=T4kQT+yHxD20UiMSnWsGgVo5sb2JySA6cxL518kiCdAgXHeT78XwcKAoz3yta79MKA
	YnTGcW8Hdun0kqJEdH6grj/wCNDTjKzDRyWv+JD3cdUQcn3PBDZgtDIGyIgKIVNbU15I
	TRms8QO9yMybRoxRdhBZgmmOs3cKVK1ocC8sn5PVOrifQOTjW6WysWfpuT20e2X8PriS
	WwbYBJk21haJRinCbaQ+O+OIUMgqxmMNUsXNJCdDny06LMN5AtlJYx54NcL9y/3Hs/ed
	6Rv3Du+8IOuD+lQXh9fy540zkL+3eWEQrmvS9YtjWJi9byoYDAlyeB70w1lT2F0e4ekW
	UL2Q==
MIME-Version: 1.0
Received: by 10.229.106.131 with SMTP id x3mr5252018qco.91.1352738689385; Mon,
	12 Nov 2012 08:44:49 -0800 (PST)
Received: by 10.49.72.202 with HTTP; Mon, 12 Nov 2012 08:44:49 -0800 (PST)
Date: Mon, 12 Nov 2012 11:44:49 -0500
Message-ID: <CAJ-XR45wpOH_uwENAh-Ozn4mJjb2AjXw+uTGfVcqndYVdRov8A@mail.gmail.com>
From: Rob Lampe <rlampe@tqhosting.com>
To: xen-devel@lists.xen.org
X-Gm-Message-State: ALoCoQktk3QiUepnvH0wzhtTdQIypKx+vYNFdaJ7oEGX/1FCa4LGMJd3a+i7ubn8gouI4wrfo1rA
X-Mailman-Approved-At: Mon, 12 Nov 2012 18:18:00 +0000
Subject: [Xen-devel] Reboot failure in Xen 4.2.0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

I am having an issue where a small percentage of the time, rebooting a
VM from the VM does not actually work.

Xen Version: 4.2.0
OS: Debian 6.0
Kernel: 3.2.30

Note, we are still using xend instead of xl. Could that be the problem?

xend.log output
----------------------

[2012-11-12 14:47:20 2381] INFO (XendDomainInfo:2079) Domain has
shutdown: name=ie3d.x.rootbsd.net id=77 reason=reboot.
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:3077)
XendDomainInfo.destroy: domid=77
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2402) Destroying device model
[2012-11-12 14:47:20 2381] INFO (image:615) ie3d.x.rootbsd.net device
model terminated
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2409) Releasing devices
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2415) Removing vif/0
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:1276)
XendDomainInfo.destroyDevice: deviceClass = vif, device = vif/0
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2415) Removing vif/1
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:1276)
XendDomainInfo.destroyDevice: deviceClass = vif, device = vif/1
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2415) Removing console/0
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:1276)
XendDomainInfo.destroyDevice: deviceClass = console, device =
console/0
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2415) Removing vbd/768
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:1276)
XendDomainInfo.destroyDevice: deviceClass = vbd, device = vbd/768
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2415) Removing vfb/0
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:1276)
XendDomainInfo.destroyDevice: deviceClass = vfb, device = vfb/0
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:125)
XendDomainInfo.create_from_dict({'vcpus_params': {'cap': 0, 'weight':
256}, 'PV_args': '', 'features': '', 'cpus': [[], []], 'paused': 0,
'use_tmp_kernel': False, 'actions_after_reboot': 'restart',
'memory_sharing': 0, 'superpages': 0, 'VCPUs_live': 2,
'PV_bootloader': '', 'actions_after_crash': 'restart', 'vbd_refs':
['7413f24b-3ea4-468c-be55-613b842efdc7'], 'PV_ramdisk': '',
'is_control_domain': False, 'name_label': 'ie3d.x.rootbsd.net',
'VCPUs_at_startup': 1, 'HVM_boot_params': {'order': 'nc'}, 'platform':
{'videoram': '4', 'hpet': '0', 'stdvga': '0', 'vnclisten': '0.0.0.0',
'loader': '/usr/lib/xen/boot/hvmloader', 'serial': 'pty', 'vncunused':
'0', 'xen_platform_pci': '1', 'usb': '1', 'nestedhvm': '0', 'boot':
'nc', 'rtc_timeoffset': 1, 'vncpasswd': 'XXXXXXXX', 'pci': [], 'pae':
'1', 'vpt_align': '1', 'hap': '1', 'viridian': '0', 'acpi': '1',
'localtime': '0', 'timer_mode': '1', 'vnc': '1', 'nographic': '0',
'vncdisplay': '749', 'pci_msitranslate': '1', 'oos': '1', 'apic': '1',
'sdl': '0', 'nomigrate': '0', 'guest_os_type': 'default', 'tsc_mode':
'0', 'usbdevice': 'tablet', 'device_model':
'/usr/lib/xen/bin/qemu-dm', 'pci_power_mgmt': '0', 'xauthority':
'/root/.Xauthority', 'isa': '0'}, 'PV_kernel': '', 'console_refs':
['011f85bb-c354-33d5-b1f6-bbc3699f1ad1',
'c853847e-a218-46c1-70ba-346551ea43e9'], 'online_vcpus': 2, 'blocked':
0, 'on_xend_stop': 'ignore', 'pool_name': 'Pool-0', 'shutdown': 0,
'HVM_boot_policy': 'BIOS order', 'description': '', 'shutdown_reason':
1, 'VCPUs_max': 2, 'start_time': 1352731059.4260111,
'memory_static_max': 536870912, 'actions_after_shutdown': 'destroy',
'use_tmp_ramdisk': False, 'on_xend_start': 'ignore', 'crashed': 0,
'memory_dynamic_max': 536870912, 'actions_after_suspend': '',
'is_a_template': False, 'PV_bootloader_args': '',
'memory_dynamic_min': 536870912, 'uuid':
'8ef5dc51-f0df-20e1-41b2-ad1fea07399f', 'cpu_time':
36.203068825000003, 'shadow_memory': 6, 'memory_static_min': 0,
'dying': 0, 'vcpu_avail': 3, 'notes': {'SUSPEND_CANCEL': 1},
'other_config': {}, 'auto_power_on': False, 'running': 0, 'domid': 77,
'Description': '', 'vif_refs':
['b27dbf8a-47c6-eabb-f40e-c81a961440eb',
'20bb6946-f8b2-a7ba-80f7-3bc6145f35c6'], 'target': 0, 'vtpm_refs': [],
's3_integrity': 1, 'devices': {'20bb6946-f8b2-a7ba-80f7-3bc6145f35c6':
('vif', {'bridge': 'pri700', 'uuid':
'20bb6946-f8b2-a7ba-80f7-3bc6145f35c6', 'devid': 1, 'mac':
'00:16:3e:3f:0b:ea', 'model': 'e1000', 'type': 'ioemu'}),
'b27dbf8a-47c6-eabb-f40e-c81a961440eb': ('vif', {'bridge': 'pub700',
'uuid': 'b27dbf8a-47c6-eabb-f40e-c81a961440eb', 'devid': 0, 'mac':
'00:16:3e:6c:95:10', 'model': 'e1000', 'type': 'ioemu'}),
'c853847e-a218-46c1-70ba-346551ea43e9': ('console', {'location': '5',
'devid': 0, 'protocol': 'vt100', 'uuid':
'c853847e-a218-46c1-70ba-346551ea43e9', 'other_config': {}}),
'011f85bb-c354-33d5-b1f6-bbc3699f1ad1': ('vfb', {'vncunused': 0,
'other_config': {'vncunused': 0, 'vncpasswd': 'XXXXXXXX', 'vnclisten':
'0.0.0.0', 'vnc': '1', 'vncdisplay': 749}, 'vnc': '1', 'uuid':
'011f85bb-c354-33d5-b1f6-bbc3699f1ad1', 'vnclisten': '0.0.0.0',
'vncdisplay': 749, 'vncpasswd': 'XXXXXXXX', 'location':
'0.0.0.0:6649', 'devid': 0}), '7413f24b-3ea4-468c-be55-613b842efdc7':
('vbd', {'uuid': '7413f24b-3ea4-468c-be55-613b842efdc7', 'bootable':
1, 'devid': 768, 'driver': 'paravirtualised', 'dev': 'hda', 'uname':
'phy:/var/run/ganeti/instance-disks/ie3d.x.rootbsd.net:0', 'mode':
'w'})}})
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2499)
XendDomainInfo.constructDomain
[2012-11-12 14:47:20 2381] ERROR (XendDomainInfo:488) VM start failed
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 473, in start
    XendTask.log_progress(0, 30, self._constructDomain)
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendTask.py", line
209, in log_progress
    retval = func(*args, **kwds)
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 2576, in _constructDomain
    self._recreateDom()
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 1730, in _recreateDom
    complete(self.dompath, lambda t: self._recreateDomFunc(t))
  File "/usr/lib/python2.6/dist-packages/xen/xend/xenstore/xstransact.py",
line 364, in complete
    if t.commit():
  File "/usr/lib/python2.6/dist-packages/xen/xend/xenstore/xstransact.py",
line 41, in commit
    rc = xshandle().transaction_end(self.transaction, False)
Error: (2, 'No such file or directory')
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:3077)
XendDomainInfo.destroy: domid=78
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2407) No device model
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2409) Releasing devices
[2012-11-12 14:47:20 2381] ERROR (XendDomainInfo:130) Domain construction failed
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 128, in create_from_dict
    vm.start()
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 473, in start
    XendTask.log_progress(0, 30, self._constructDomain)
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendTask.py", line
209, in log_progress
    retval = func(*args, **kwds)
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 2576, in _constructDomain
    self._recreateDom()
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 1730, in _recreateDom
    complete(self.dompath, lambda t: self._recreateDomFunc(t))
  File "/usr/lib/python2.6/dist-packages/xen/xend/xenstore/xstransact.py",
line 364, in complete
    if t.commit():
  File "/usr/lib/python2.6/dist-packages/xen/xend/xenstore/xstransact.py",
line 41, in commit
    rc = xshandle().transaction_end(self.transaction, False)
Error: (2, 'No such file or directory')
[2012-11-12 14:47:20 2381] ERROR (XendDomainInfo:2235) Failed to
restart domain 77.
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 2218, in _restart
    new_dom_info)
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomain.py", line
1017, in domain_create_from_dict
    dominfo = XendDomainInfo.create_from_dict(config_dict)
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 128, in create_from_dict
    vm.start()
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 473, in start
    XendTask.log_progress(0, 30, self._constructDomain)
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendTask.py", line
209, in log_progress
    retval = func(*args, **kwds)
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 2576, in _constructDomain
    self._recreateDom()
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 1730, in _recreateDom
    complete(self.dompath, lambda t: self._recreateDomFunc(t))
  File "/usr/lib/python2.6/dist-packages/xen/xend/xenstore/xstransact.py",
line 364, in complete
    if t.commit():
  File "/usr/lib/python2.6/dist-packages/xen/xend/xenstore/xstransact.py",
line 41, in commit
    rc = xshandle().transaction_end(self.transaction, False)
Error: (2, 'No such file or directory')


vm configuration file
---------------------------------
kernel = '/usr/lib/xen/boot/hvmloader'
builder = 'hvm'
memory = 512
vcpus = 2
name = 'ie3d.x.rootbsd.net'
pae = 1
acpi = 1
apic = 1
device_model = '/usr/lib/xen/bin/qemu-dm'
boot = 'nc'
sdl = 0
usb = 1
usbdevice = 'tablet'
vnc = 1
vnclisten = '0.0.0.0'
vncdisplay = 749
vncunused = 0
vncpasswd = 'JJw1ZHwQ'
serial = 'pty'
vif = ['mac=00:16:3e:6c:95:10, model=e1000, type=ioemu,
bridge=pub700','mac=00:16:3e:3f:0b:ea, model=e1000, type=ioemu,
bridge=pri700']
disk = ['phy:/var/run/ganeti/instance-disks/ie3d.x.rootbsd.net:0,hda,w']
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 18:18:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 18:18:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXya9-0000dJ-HB; Mon, 12 Nov 2012 18:18:01 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rlampe@tqhosting.com>) id 1TXx80-0006WV-HT
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 16:44:52 +0000
Received: from [193.109.254.147:51565] by server-16.bemta-14.messagelabs.com
	id 34/45-09215-38721A05; Mon, 12 Nov 2012 16:44:51 +0000
X-Env-Sender: rlampe@tqhosting.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352738689!7992580!1
X-Originating-IP: [209.85.216.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12466 invoked from network); 12 Nov 2012 16:44:50 -0000
Received: from mail-qc0-f173.google.com (HELO mail-qc0-f173.google.com)
	(209.85.216.173)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 16:44:50 -0000
Received: by mail-qc0-f173.google.com with SMTP id b12so4679459qca.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 08:44:49 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type
	:x-gm-message-state;
	bh=i3rW8pG8SbOSjP51uefkzEUoYMkpI2JiWfJz30Ohnvg=;
	b=T4kQT+yHxD20UiMSnWsGgVo5sb2JySA6cxL518kiCdAgXHeT78XwcKAoz3yta79MKA
	YnTGcW8Hdun0kqJEdH6grj/wCNDTjKzDRyWv+JD3cdUQcn3PBDZgtDIGyIgKIVNbU15I
	TRms8QO9yMybRoxRdhBZgmmOs3cKVK1ocC8sn5PVOrifQOTjW6WysWfpuT20e2X8PriS
	WwbYBJk21haJRinCbaQ+O+OIUMgqxmMNUsXNJCdDny06LMN5AtlJYx54NcL9y/3Hs/ed
	6Rv3Du+8IOuD+lQXh9fy540zkL+3eWEQrmvS9YtjWJi9byoYDAlyeB70w1lT2F0e4ekW
	UL2Q==
MIME-Version: 1.0
Received: by 10.229.106.131 with SMTP id x3mr5252018qco.91.1352738689385; Mon,
	12 Nov 2012 08:44:49 -0800 (PST)
Received: by 10.49.72.202 with HTTP; Mon, 12 Nov 2012 08:44:49 -0800 (PST)
Date: Mon, 12 Nov 2012 11:44:49 -0500
Message-ID: <CAJ-XR45wpOH_uwENAh-Ozn4mJjb2AjXw+uTGfVcqndYVdRov8A@mail.gmail.com>
From: Rob Lampe <rlampe@tqhosting.com>
To: xen-devel@lists.xen.org
X-Gm-Message-State: ALoCoQktk3QiUepnvH0wzhtTdQIypKx+vYNFdaJ7oEGX/1FCa4LGMJd3a+i7ubn8gouI4wrfo1rA
X-Mailman-Approved-At: Mon, 12 Nov 2012 18:18:00 +0000
Subject: [Xen-devel] Reboot failure in Xen 4.2.0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

I am having an issue where a small percentage of the time, rebooting a
VM from the VM does not actually work.

Xen Version: 4.2.0
OS: Debian 6.0
Kernel: 3.2.30

Note, we are still using xend instead of xl. Could that be the problem?

xend.log output
----------------------

[2012-11-12 14:47:20 2381] INFO (XendDomainInfo:2079) Domain has
shutdown: name=ie3d.x.rootbsd.net id=77 reason=reboot.
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:3077)
XendDomainInfo.destroy: domid=77
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2402) Destroying device model
[2012-11-12 14:47:20 2381] INFO (image:615) ie3d.x.rootbsd.net device
model terminated
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2409) Releasing devices
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2415) Removing vif/0
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:1276)
XendDomainInfo.destroyDevice: deviceClass = vif, device = vif/0
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2415) Removing vif/1
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:1276)
XendDomainInfo.destroyDevice: deviceClass = vif, device = vif/1
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2415) Removing console/0
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:1276)
XendDomainInfo.destroyDevice: deviceClass = console, device =
console/0
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2415) Removing vbd/768
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:1276)
XendDomainInfo.destroyDevice: deviceClass = vbd, device = vbd/768
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2415) Removing vfb/0
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:1276)
XendDomainInfo.destroyDevice: deviceClass = vfb, device = vfb/0
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:125)
XendDomainInfo.create_from_dict({'vcpus_params': {'cap': 0, 'weight':
256}, 'PV_args': '', 'features': '', 'cpus': [[], []], 'paused': 0,
'use_tmp_kernel': False, 'actions_after_reboot': 'restart',
'memory_sharing': 0, 'superpages': 0, 'VCPUs_live': 2,
'PV_bootloader': '', 'actions_after_crash': 'restart', 'vbd_refs':
['7413f24b-3ea4-468c-be55-613b842efdc7'], 'PV_ramdisk': '',
'is_control_domain': False, 'name_label': 'ie3d.x.rootbsd.net',
'VCPUs_at_startup': 1, 'HVM_boot_params': {'order': 'nc'}, 'platform':
{'videoram': '4', 'hpet': '0', 'stdvga': '0', 'vnclisten': '0.0.0.0',
'loader': '/usr/lib/xen/boot/hvmloader', 'serial': 'pty', 'vncunused':
'0', 'xen_platform_pci': '1', 'usb': '1', 'nestedhvm': '0', 'boot':
'nc', 'rtc_timeoffset': 1, 'vncpasswd': 'XXXXXXXX', 'pci': [], 'pae':
'1', 'vpt_align': '1', 'hap': '1', 'viridian': '0', 'acpi': '1',
'localtime': '0', 'timer_mode': '1', 'vnc': '1', 'nographic': '0',
'vncdisplay': '749', 'pci_msitranslate': '1', 'oos': '1', 'apic': '1',
'sdl': '0', 'nomigrate': '0', 'guest_os_type': 'default', 'tsc_mode':
'0', 'usbdevice': 'tablet', 'device_model':
'/usr/lib/xen/bin/qemu-dm', 'pci_power_mgmt': '0', 'xauthority':
'/root/.Xauthority', 'isa': '0'}, 'PV_kernel': '', 'console_refs':
['011f85bb-c354-33d5-b1f6-bbc3699f1ad1',
'c853847e-a218-46c1-70ba-346551ea43e9'], 'online_vcpus': 2, 'blocked':
0, 'on_xend_stop': 'ignore', 'pool_name': 'Pool-0', 'shutdown': 0,
'HVM_boot_policy': 'BIOS order', 'description': '', 'shutdown_reason':
1, 'VCPUs_max': 2, 'start_time': 1352731059.4260111,
'memory_static_max': 536870912, 'actions_after_shutdown': 'destroy',
'use_tmp_ramdisk': False, 'on_xend_start': 'ignore', 'crashed': 0,
'memory_dynamic_max': 536870912, 'actions_after_suspend': '',
'is_a_template': False, 'PV_bootloader_args': '',
'memory_dynamic_min': 536870912, 'uuid':
'8ef5dc51-f0df-20e1-41b2-ad1fea07399f', 'cpu_time':
36.203068825000003, 'shadow_memory': 6, 'memory_static_min': 0,
'dying': 0, 'vcpu_avail': 3, 'notes': {'SUSPEND_CANCEL': 1},
'other_config': {}, 'auto_power_on': False, 'running': 0, 'domid': 77,
'Description': '', 'vif_refs':
['b27dbf8a-47c6-eabb-f40e-c81a961440eb',
'20bb6946-f8b2-a7ba-80f7-3bc6145f35c6'], 'target': 0, 'vtpm_refs': [],
's3_integrity': 1, 'devices': {'20bb6946-f8b2-a7ba-80f7-3bc6145f35c6':
('vif', {'bridge': 'pri700', 'uuid':
'20bb6946-f8b2-a7ba-80f7-3bc6145f35c6', 'devid': 1, 'mac':
'00:16:3e:3f:0b:ea', 'model': 'e1000', 'type': 'ioemu'}),
'b27dbf8a-47c6-eabb-f40e-c81a961440eb': ('vif', {'bridge': 'pub700',
'uuid': 'b27dbf8a-47c6-eabb-f40e-c81a961440eb', 'devid': 0, 'mac':
'00:16:3e:6c:95:10', 'model': 'e1000', 'type': 'ioemu'}),
'c853847e-a218-46c1-70ba-346551ea43e9': ('console', {'location': '5',
'devid': 0, 'protocol': 'vt100', 'uuid':
'c853847e-a218-46c1-70ba-346551ea43e9', 'other_config': {}}),
'011f85bb-c354-33d5-b1f6-bbc3699f1ad1': ('vfb', {'vncunused': 0,
'other_config': {'vncunused': 0, 'vncpasswd': 'XXXXXXXX', 'vnclisten':
'0.0.0.0', 'vnc': '1', 'vncdisplay': 749}, 'vnc': '1', 'uuid':
'011f85bb-c354-33d5-b1f6-bbc3699f1ad1', 'vnclisten': '0.0.0.0',
'vncdisplay': 749, 'vncpasswd': 'XXXXXXXX', 'location':
'0.0.0.0:6649', 'devid': 0}), '7413f24b-3ea4-468c-be55-613b842efdc7':
('vbd', {'uuid': '7413f24b-3ea4-468c-be55-613b842efdc7', 'bootable':
1, 'devid': 768, 'driver': 'paravirtualised', 'dev': 'hda', 'uname':
'phy:/var/run/ganeti/instance-disks/ie3d.x.rootbsd.net:0', 'mode':
'w'})}})
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2499)
XendDomainInfo.constructDomain
[2012-11-12 14:47:20 2381] ERROR (XendDomainInfo:488) VM start failed
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 473, in start
    XendTask.log_progress(0, 30, self._constructDomain)
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendTask.py", line
209, in log_progress
    retval = func(*args, **kwds)
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 2576, in _constructDomain
    self._recreateDom()
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 1730, in _recreateDom
    complete(self.dompath, lambda t: self._recreateDomFunc(t))
  File "/usr/lib/python2.6/dist-packages/xen/xend/xenstore/xstransact.py",
line 364, in complete
    if t.commit():
  File "/usr/lib/python2.6/dist-packages/xen/xend/xenstore/xstransact.py",
line 41, in commit
    rc = xshandle().transaction_end(self.transaction, False)
Error: (2, 'No such file or directory')
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:3077)
XendDomainInfo.destroy: domid=78
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2407) No device model
[2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2409) Releasing devices
[2012-11-12 14:47:20 2381] ERROR (XendDomainInfo:130) Domain construction failed
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 128, in create_from_dict
    vm.start()
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 473, in start
    XendTask.log_progress(0, 30, self._constructDomain)
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendTask.py", line
209, in log_progress
    retval = func(*args, **kwds)
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 2576, in _constructDomain
    self._recreateDom()
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 1730, in _recreateDom
    complete(self.dompath, lambda t: self._recreateDomFunc(t))
  File "/usr/lib/python2.6/dist-packages/xen/xend/xenstore/xstransact.py",
line 364, in complete
    if t.commit():
  File "/usr/lib/python2.6/dist-packages/xen/xend/xenstore/xstransact.py",
line 41, in commit
    rc = xshandle().transaction_end(self.transaction, False)
Error: (2, 'No such file or directory')
[2012-11-12 14:47:20 2381] ERROR (XendDomainInfo:2235) Failed to
restart domain 77.
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 2218, in _restart
    new_dom_info)
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomain.py", line
1017, in domain_create_from_dict
    dominfo = XendDomainInfo.create_from_dict(config_dict)
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 128, in create_from_dict
    vm.start()
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 473, in start
    XendTask.log_progress(0, 30, self._constructDomain)
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendTask.py", line
209, in log_progress
    retval = func(*args, **kwds)
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 2576, in _constructDomain
    self._recreateDom()
  File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py",
line 1730, in _recreateDom
    complete(self.dompath, lambda t: self._recreateDomFunc(t))
  File "/usr/lib/python2.6/dist-packages/xen/xend/xenstore/xstransact.py",
line 364, in complete
    if t.commit():
  File "/usr/lib/python2.6/dist-packages/xen/xend/xenstore/xstransact.py",
line 41, in commit
    rc = xshandle().transaction_end(self.transaction, False)
Error: (2, 'No such file or directory')


vm configuration file
---------------------------------
kernel = '/usr/lib/xen/boot/hvmloader'
builder = 'hvm'
memory = 512
vcpus = 2
name = 'ie3d.x.rootbsd.net'
pae = 1
acpi = 1
apic = 1
device_model = '/usr/lib/xen/bin/qemu-dm'
boot = 'nc'
sdl = 0
usb = 1
usbdevice = 'tablet'
vnc = 1
vnclisten = '0.0.0.0'
vncdisplay = 749
vncunused = 0
vncpasswd = 'JJw1ZHwQ'
serial = 'pty'
vif = ['mac=00:16:3e:6c:95:10, model=e1000, type=ioemu,
bridge=pub700','mac=00:16:3e:3f:0b:ea, model=e1000, type=ioemu,
bridge=pri700']
disk = ['phy:/var/run/ganeti/instance-disks/ie3d.x.rootbsd.net:0,hda,w']
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 18:26:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 18:26:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXyi8-0000sc-0o; Mon, 12 Nov 2012 18:26:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TXyi5-0000sU-M2
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 18:26:14 +0000
Received: from [85.158.137.99:54450] by server-1.bemta-3.messagelabs.com id
	E7/7C-12169-73F31A05; Mon, 12 Nov 2012 18:25:59 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1352744758!18690503!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6940 invoked from network); 12 Nov 2012 18:25:58 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 18:25:58 -0000
Received: by mail-wg0-f51.google.com with SMTP id ed3so3057142wgb.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 10:25:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=CWtF0xPYomT83Arc13JugSdENSZE06Un8E82ziV7Nk0=;
	b=Vyy/WsIhYntX+7nGknzq9NhX29U0zLF0S+6blWX/kmGyU2skOv/SlFfpY6adzl4GNe
	e106JVhscWDgfEM/grCA01fzZW5cFogHPTz8oGrTjXQlOZlMsYzfE9TU/73+oGZ5N83X
	ReUvp+6ZyoHef/Kkoj++ErUl2MrWPyLivQzx+n8qfkH/pwGJsfA+0Fzxf0M6KIsU232i
	ETNVvzD+jdDqC9812ZxBTejnB7dzS1R2poOFezY00eYhf0Uh49za1aiAX2SRwul3ZtqM
	2qkU8QGAWQpBtFwoj7/hetfqSj549kBpd+xLahW0LVjtbRqbOg3cjpAhv+256PluHr4V
	5RyA==
Received: by 10.180.8.134 with SMTP id r6mr11997346wia.19.1352744758250;
	Mon, 12 Nov 2012 10:25:58 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id s12sm15585433wik.11.2012.11.12.10.25.52
	(version=SSLv3 cipher=OTHER); Mon, 12 Nov 2012 10:25:57 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Mon, 12 Nov 2012 18:25:49 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Zhigang Wang <zhigang.x.wang@oracle.com>, Jan Beulich <jbeulich@suse.com>
Message-ID: <CCC6EFAD.44728%keir.xen@gmail.com>
Thread-Topic: VM memory allocation speed with cs 26056
Thread-Index: Ac3BAyOa+QFipbl9cE+clf42eTHdVQ==
In-Reply-To: <50A10F3E.2030808@oracle.com>
Mime-version: 1.0
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] VM memory allocation speed with cs 26056
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 12/11/2012 15:01, "Zhigang Wang" <zhigang.x.wang@oracle.com> wrote:

> Hi Keir/Jan,
> 
> Recently I got a chance to access a big machine (2T mem/160 cpus) and I tested
> your patch: http://xenbits.xen.org/hg/xen-unstable.hg/rev/177fdda0be56
> 
> Attached is the result.

The PVM result is weird, there is a small-ish slowdown for small domains,
becoming a very large %age slowdown as domain memory increases, and then
turning into a *speedup* as the memory size gets very large indeed.

What are the error bars like on these measurements I wonder? One thing we
could do to allow PV guests doing 4k-at-a-time allocations through
alloc_heap_pages() to benefit from the TLB-flush improvements, is pull the
filtering-and-flush out into populate_physmap() and increase_reservation().
This is listed as a todo in the original patch (26056).

To be honest I don't know why the original patch would make PV domain
creation slower, and certainly not by a varying %age depending on domain
memory size!

 -- Keir

> Test environment old:
> 
>       # xm info
>       host                   : ovs-3f-9e-04
>       release                : 2.6.39-300.17.1.el5uek
>       version                : #1 SMP Fri Oct 19 11:30:08 PDT 2012
>       machine                : x86_64
>       nr_cpus                : 160
>       nr_nodes               : 8
>       cores_per_socket       : 10
>       threads_per_core       : 2
>       cpu_mhz                : 2394
>       hw_caps                :
> bfebfbff:2c100800:00000000:00003f40:02bee3ff:00000000:00000001:00000000
>       virt_caps              : hvm hvm_directio
>       total_memory           : 2097142
>       free_memory            : 2040108
>       free_cpus              : 0
>       xen_major              : 4
>       xen_minor              : 1
>       xen_extra              : .3OVM
>       xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32
> hvm-3.0-x86_32p hvm-3.0-x86_64
>       xen_scheduler          : credit
>       xen_pagesize           : 4096
>       platform_params        : virt_start=0xffff800000000000
>       xen_changeset          : unavailable
>       xen_commandline        : dom0_mem=31390M no-bootscrub
>       cc_compiler            : gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)
>       cc_compile_by          : mockbuild
>       cc_compile_domain      : us.oracle.com
>       cc_compile_date        : Fri Oct 19 21:34:08 PDT 2012
>       xend_config_format     : 4
> 
>       # uname -a
>       Linux ovs-3f-9e-04 2.6.39-300.17.1.el5uek #1 SMP Fri Oct 19 11:30:08 PDT
> 2012 x86_64 x86_64 x86_64 GNU/Linux
> 
>       # cat /boot/grub/grub.conf
>       ...
>       kernel /xen.gz dom0_mem=31390M no-bootscrub dom0_vcpus_pin
> dom0_max_vcpus=32
> 
> Test environment new: old env + cs 26056
> 
> Test script: test-vm-memory-allocation.sh (attached)
> 
> My conclusion from the test:
> 
>   - HVM create time is greatly reduced.
>   - PVM create time is increased dramatically for 4G, 8G, 16G, 32G, 64G, 128G.
>   - HVM/PVM destroy time is not affected.
>   - If most of our customers are using PVM, I think this patch is bad: because
> most VM memory should under 128G.
>   - If they are using HVM, then this patch is great.
> 
> Questions for discussion:
> 
>   - Did you get the same result?
>   - It seems this result is not ideal. We may need to improve it.
> 
> Please note: Imay not have access to the same machine for awhile.
> 
> Thanks,
> 
> Zhigang
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 18:26:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 18:26:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXyi8-0000sc-0o; Mon, 12 Nov 2012 18:26:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TXyi5-0000sU-M2
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 18:26:14 +0000
Received: from [85.158.137.99:54450] by server-1.bemta-3.messagelabs.com id
	E7/7C-12169-73F31A05; Mon, 12 Nov 2012 18:25:59 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1352744758!18690503!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6940 invoked from network); 12 Nov 2012 18:25:58 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 18:25:58 -0000
Received: by mail-wg0-f51.google.com with SMTP id ed3so3057142wgb.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 10:25:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=CWtF0xPYomT83Arc13JugSdENSZE06Un8E82ziV7Nk0=;
	b=Vyy/WsIhYntX+7nGknzq9NhX29U0zLF0S+6blWX/kmGyU2skOv/SlFfpY6adzl4GNe
	e106JVhscWDgfEM/grCA01fzZW5cFogHPTz8oGrTjXQlOZlMsYzfE9TU/73+oGZ5N83X
	ReUvp+6ZyoHef/Kkoj++ErUl2MrWPyLivQzx+n8qfkH/pwGJsfA+0Fzxf0M6KIsU232i
	ETNVvzD+jdDqC9812ZxBTejnB7dzS1R2poOFezY00eYhf0Uh49za1aiAX2SRwul3ZtqM
	2qkU8QGAWQpBtFwoj7/hetfqSj549kBpd+xLahW0LVjtbRqbOg3cjpAhv+256PluHr4V
	5RyA==
Received: by 10.180.8.134 with SMTP id r6mr11997346wia.19.1352744758250;
	Mon, 12 Nov 2012 10:25:58 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id s12sm15585433wik.11.2012.11.12.10.25.52
	(version=SSLv3 cipher=OTHER); Mon, 12 Nov 2012 10:25:57 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Mon, 12 Nov 2012 18:25:49 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Zhigang Wang <zhigang.x.wang@oracle.com>, Jan Beulich <jbeulich@suse.com>
Message-ID: <CCC6EFAD.44728%keir.xen@gmail.com>
Thread-Topic: VM memory allocation speed with cs 26056
Thread-Index: Ac3BAyOa+QFipbl9cE+clf42eTHdVQ==
In-Reply-To: <50A10F3E.2030808@oracle.com>
Mime-version: 1.0
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] VM memory allocation speed with cs 26056
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 12/11/2012 15:01, "Zhigang Wang" <zhigang.x.wang@oracle.com> wrote:

> Hi Keir/Jan,
> 
> Recently I got a chance to access a big machine (2T mem/160 cpus) and I tested
> your patch: http://xenbits.xen.org/hg/xen-unstable.hg/rev/177fdda0be56
> 
> Attached is the result.

The PVM result is weird, there is a small-ish slowdown for small domains,
becoming a very large %age slowdown as domain memory increases, and then
turning into a *speedup* as the memory size gets very large indeed.

What are the error bars like on these measurements I wonder? One thing we
could do to allow PV guests doing 4k-at-a-time allocations through
alloc_heap_pages() to benefit from the TLB-flush improvements, is pull the
filtering-and-flush out into populate_physmap() and increase_reservation().
This is listed as a todo in the original patch (26056).

To be honest I don't know why the original patch would make PV domain
creation slower, and certainly not by a varying %age depending on domain
memory size!

 -- Keir

> Test environment old:
> 
>       # xm info
>       host                   : ovs-3f-9e-04
>       release                : 2.6.39-300.17.1.el5uek
>       version                : #1 SMP Fri Oct 19 11:30:08 PDT 2012
>       machine                : x86_64
>       nr_cpus                : 160
>       nr_nodes               : 8
>       cores_per_socket       : 10
>       threads_per_core       : 2
>       cpu_mhz                : 2394
>       hw_caps                :
> bfebfbff:2c100800:00000000:00003f40:02bee3ff:00000000:00000001:00000000
>       virt_caps              : hvm hvm_directio
>       total_memory           : 2097142
>       free_memory            : 2040108
>       free_cpus              : 0
>       xen_major              : 4
>       xen_minor              : 1
>       xen_extra              : .3OVM
>       xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32
> hvm-3.0-x86_32p hvm-3.0-x86_64
>       xen_scheduler          : credit
>       xen_pagesize           : 4096
>       platform_params        : virt_start=0xffff800000000000
>       xen_changeset          : unavailable
>       xen_commandline        : dom0_mem=31390M no-bootscrub
>       cc_compiler            : gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)
>       cc_compile_by          : mockbuild
>       cc_compile_domain      : us.oracle.com
>       cc_compile_date        : Fri Oct 19 21:34:08 PDT 2012
>       xend_config_format     : 4
> 
>       # uname -a
>       Linux ovs-3f-9e-04 2.6.39-300.17.1.el5uek #1 SMP Fri Oct 19 11:30:08 PDT
> 2012 x86_64 x86_64 x86_64 GNU/Linux
> 
>       # cat /boot/grub/grub.conf
>       ...
>       kernel /xen.gz dom0_mem=31390M no-bootscrub dom0_vcpus_pin
> dom0_max_vcpus=32
> 
> Test environment new: old env + cs 26056
> 
> Test script: test-vm-memory-allocation.sh (attached)
> 
> My conclusion from the test:
> 
>   - HVM create time is greatly reduced.
>   - PVM create time is increased dramatically for 4G, 8G, 16G, 32G, 64G, 128G.
>   - HVM/PVM destroy time is not affected.
>   - If most of our customers are using PVM, I think this patch is bad: because
> most VM memory should under 128G.
>   - If they are using HVM, then this patch is great.
> 
> Questions for discussion:
> 
>   - Did you get the same result?
>   - It seems this result is not ideal. We may need to improve it.
> 
> Please note: Imay not have access to the same machine for awhile.
> 
> Thanks,
> 
> Zhigang
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 18:35:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 18:35:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXyqd-00017l-3e; Mon, 12 Nov 2012 18:35:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jajcus@jajcus.net>) id 1TXyqb-00017g-CY
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 18:35:01 +0000
Received: from [193.109.254.147:60816] by server-10.bemta-14.messagelabs.com
	id AD/88-31741-45141A05; Mon, 12 Nov 2012 18:35:00 +0000
X-Env-Sender: jajcus@jajcus.net
X-Msg-Ref: server-14.tower-27.messagelabs.com!1352745298!3720418!1
X-Originating-IP: [84.205.176.49]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15058 invoked from network); 12 Nov 2012 18:34:58 -0000
Received: from tropek.jajcus.net (HELO tropek.jajcus.net) (84.205.176.49)
	by server-14.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 18:34:58 -0000
Received: from localhost (lolek.nigdzie [10.253.0.124])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by tropek.jajcus.net (Postfix) with ESMTPSA id D31B25002;
	Mon, 12 Nov 2012 19:34:57 +0100 (CET)
Date: Mon, 12 Nov 2012 19:34:57 +0100
From: Jacek Konieczny <jajcus@jajcus.net>
To: Olaf Hering <olaf@aepfle.de>
Message-ID: <20121112183457.GB2114@lolek.nigdzie>
Mail-Followup-To: Olaf Hering <olaf@aepfle.de>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
	<1352738557.27833.302.camel@zakaz.uk.xensource.com>
	<20121112180738.GA26672@aepfle.de>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121112180738.GA26672@aepfle.de>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH] Fix locking in
	tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 12, 2012 at 07:07:38PM +0100, Olaf Hering wrote:
> On Mon, Nov 12, Ian Campbell wrote:
> 
> > On Fri, 2012-11-09 at 13:56 +0000, Jacek Konieczny wrote:
> > > The claim_lock() function would fail in the perl code with:
> > > 
> > >   Invalid argument at -e line 2.
> > > 
> > > because the Perl snippet opens for reading the file descriptor, which
> > > was earlier opened for write (append).
> > 
> > Looks plausible to me.
> > 
> > How does this interact with the 
> >         eval "exec $_lockfd<&-"
> > which Olaf added in 26079:b3b03536789a ? I suppose close is close and
> > <&- and >&- or even <>&- are equivalent?
> 
> I did not see the perl error, in what environment did you notice this
> error?

Xen 4.2.0

# uname -rm
3.6.6-aos4 x86_64

# perl --version
This is perl, v5.8.8 built for x86_64-pld-linux-thread-multi

I find it a bit strange that it seems to work for everybody else that
me, but the source of my error seems obvious (opening write-only file
descriptor for reading).

I guess my perl, for some reason, does something more when using open()
on an existing file descriptor.

Greets,
        Jacek

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 18:35:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 18:35:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXyqd-00017l-3e; Mon, 12 Nov 2012 18:35:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jajcus@jajcus.net>) id 1TXyqb-00017g-CY
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 18:35:01 +0000
Received: from [193.109.254.147:60816] by server-10.bemta-14.messagelabs.com
	id AD/88-31741-45141A05; Mon, 12 Nov 2012 18:35:00 +0000
X-Env-Sender: jajcus@jajcus.net
X-Msg-Ref: server-14.tower-27.messagelabs.com!1352745298!3720418!1
X-Originating-IP: [84.205.176.49]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15058 invoked from network); 12 Nov 2012 18:34:58 -0000
Received: from tropek.jajcus.net (HELO tropek.jajcus.net) (84.205.176.49)
	by server-14.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 18:34:58 -0000
Received: from localhost (lolek.nigdzie [10.253.0.124])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by tropek.jajcus.net (Postfix) with ESMTPSA id D31B25002;
	Mon, 12 Nov 2012 19:34:57 +0100 (CET)
Date: Mon, 12 Nov 2012 19:34:57 +0100
From: Jacek Konieczny <jajcus@jajcus.net>
To: Olaf Hering <olaf@aepfle.de>
Message-ID: <20121112183457.GB2114@lolek.nigdzie>
Mail-Followup-To: Olaf Hering <olaf@aepfle.de>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
	<1352738557.27833.302.camel@zakaz.uk.xensource.com>
	<20121112180738.GA26672@aepfle.de>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121112180738.GA26672@aepfle.de>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH] Fix locking in
	tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 12, 2012 at 07:07:38PM +0100, Olaf Hering wrote:
> On Mon, Nov 12, Ian Campbell wrote:
> 
> > On Fri, 2012-11-09 at 13:56 +0000, Jacek Konieczny wrote:
> > > The claim_lock() function would fail in the perl code with:
> > > 
> > >   Invalid argument at -e line 2.
> > > 
> > > because the Perl snippet opens for reading the file descriptor, which
> > > was earlier opened for write (append).
> > 
> > Looks plausible to me.
> > 
> > How does this interact with the 
> >         eval "exec $_lockfd<&-"
> > which Olaf added in 26079:b3b03536789a ? I suppose close is close and
> > <&- and >&- or even <>&- are equivalent?
> 
> I did not see the perl error, in what environment did you notice this
> error?

Xen 4.2.0

# uname -rm
3.6.6-aos4 x86_64

# perl --version
This is perl, v5.8.8 built for x86_64-pld-linux-thread-multi

I find it a bit strange that it seems to work for everybody else that
me, but the source of my error seems obvious (opening write-only file
descriptor for reading).

I guess my perl, for some reason, does something more when using open()
on an existing file descriptor.

Greets,
        Jacek

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 18:41:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 18:41:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXywI-0001JW-2T; Mon, 12 Nov 2012 18:40:54 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TXywG-0001JR-4o
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 18:40:52 +0000
Received: from [193.109.254.147:49030] by server-5.bemta-14.messagelabs.com id
	DE/4A-10257-3B241A05; Mon, 12 Nov 2012 18:40:51 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-6.tower-27.messagelabs.com!1352745650!3688089!1
X-Originating-IP: [81.169.146.176]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NiA9PiAyNTg3MA==\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NiA9PiAyNTg3MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12379 invoked from network); 12 Nov 2012 18:40:50 -0000
Received: from mo-p04-ob.rzone.de (HELO mo-p04-ob.rzone.de) (81.169.146.176)
	by server-6.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 18:40:50 -0000
X-RZG-CLASS-ID: mo04
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmxtMZ80VwmRNV6KE=
Received: from probook.site (ip-80-226-24-2.vodafone-net.de [80.226.24.2])
	by smtp.strato.de (joses mo34) (RZmta 31.3 SBL|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id j02e0aoACI5Gro ;
	Mon, 12 Nov 2012 19:40:50 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 01C1D189BA; Mon, 12 Nov 2012 19:40:47 +0100 (CET)
Date: Mon, 12 Nov 2012 19:40:47 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Message-ID: <20121112184047.GA28988@aepfle.de>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
	<1352738557.27833.302.camel@zakaz.uk.xensource.com>
	<20121112180738.GA26672@aepfle.de>
	<20121112183457.GB2114@lolek.nigdzie>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121112183457.GB2114@lolek.nigdzie>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Subject: Re: [Xen-devel] [PATCH] Fix locking in
	tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 12, Jacek Konieczny wrote:

> # perl --version
> This is perl, v5.8.8 built for x86_64-pld-linux-thread-multi

sles11sp2 has perl 5.10.0, maybe there is different behaviour in
different perl versions.

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 18:41:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 18:41:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXywI-0001JW-2T; Mon, 12 Nov 2012 18:40:54 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TXywG-0001JR-4o
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 18:40:52 +0000
Received: from [193.109.254.147:49030] by server-5.bemta-14.messagelabs.com id
	DE/4A-10257-3B241A05; Mon, 12 Nov 2012 18:40:51 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-6.tower-27.messagelabs.com!1352745650!3688089!1
X-Originating-IP: [81.169.146.176]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NiA9PiAyNTg3MA==\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NiA9PiAyNTg3MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12379 invoked from network); 12 Nov 2012 18:40:50 -0000
Received: from mo-p04-ob.rzone.de (HELO mo-p04-ob.rzone.de) (81.169.146.176)
	by server-6.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 12 Nov 2012 18:40:50 -0000
X-RZG-CLASS-ID: mo04
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmxtMZ80VwmRNV6KE=
Received: from probook.site (ip-80-226-24-2.vodafone-net.de [80.226.24.2])
	by smtp.strato.de (joses mo34) (RZmta 31.3 SBL|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id j02e0aoACI5Gro ;
	Mon, 12 Nov 2012 19:40:50 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 01C1D189BA; Mon, 12 Nov 2012 19:40:47 +0100 (CET)
Date: Mon, 12 Nov 2012 19:40:47 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Message-ID: <20121112184047.GA28988@aepfle.de>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
	<1352738557.27833.302.camel@zakaz.uk.xensource.com>
	<20121112180738.GA26672@aepfle.de>
	<20121112183457.GB2114@lolek.nigdzie>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121112183457.GB2114@lolek.nigdzie>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Subject: Re: [Xen-devel] [PATCH] Fix locking in
	tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 12, Jacek Konieczny wrote:

> # perl --version
> This is perl, v5.8.8 built for x86_64-pld-linux-thread-multi

sles11sp2 has perl 5.10.0, maybe there is different behaviour in
different perl versions.

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 19:08:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 19:08:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXzMj-00020J-3b; Mon, 12 Nov 2012 19:08:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kristian@hagsted.dk>) id 1TXzMh-00020E-AY
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 19:08:12 +0000
Received: from [85.158.137.99:30075] by server-7.bemta-3.messagelabs.com id
	CC/49-01713-71941A05; Mon, 12 Nov 2012 19:08:07 +0000
X-Env-Sender: kristian@hagsted.dk
X-Msg-Ref: server-2.tower-217.messagelabs.com!1352747286!18693822!1
X-Originating-IP: [80.160.77.114]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuMTYwLjc3LjExNCA9PiAzNzY0MTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29300 invoked from network); 12 Nov 2012 19:08:06 -0000
Received: from pasmtpa.tele.dk (HELO pasmtpA.tele.dk) (80.160.77.114)
	by server-2.tower-217.messagelabs.com with SMTP;
	12 Nov 2012 19:08:06 -0000
Received: from hagsted.dk (unknown [2.108.99.186])
	by pasmtpA.tele.dk (Postfix) with ESMTP id 79D2580004C
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 20:08:05 +0100 (CET)
Received: from HAGSTED-BSERVER.hagsted.dk ([fe80::91b7:737e:e057:7c8b]) by
	hagsted-bserver.hagsted.dk ([fe80::91b7:737e:e057:7c8b%10]) with mapi
	id 14.02.0318.004; Mon, 12 Nov 2012 20:08:06 +0100
From: Kristian Hagsted Rasmussen <kristian@hagsted.dk>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Thread-Topic: xen EFI boot and vga-passthrough
Thread-Index: Ac3BCUwxBONJB3zmT1y62jykNdtmkQ==
Date: Mon, 12 Nov 2012 19:08:05 +0000
Message-ID: <19EF9FEB5AF86243A3F18E5CE75971640A00B0F5@hagsted-bserver.hagsted.dk>
Accept-Language: da-DK, en-US
Content-Language: da-DK
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [192.168.1.103]
Content-Type: multipart/mixed;
	boundary="_004_19EF9FEB5AF86243A3F18E5CE75971640A00B0F5hagstedbserverh_"
MIME-Version: 1.0
Subject: [Xen-devel] xen EFI boot and vga-passthrough
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_004_19EF9FEB5AF86243A3F18E5CE75971640A00B0F5hagstedbserverh_
Content-Type: multipart/alternative;
	boundary="_000_19EF9FEB5AF86243A3F18E5CE75971640A00B0F5hagstedbserverh_"

--_000_19EF9FEB5AF86243A3F18E5CE75971640A00B0F5hagstedbserverh_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi all



I can't seem to find any information on vga-passthrough when booting throug=
h xen.efi, so I assume it should work. But I encounter a problem on a windo=
ws 7 HVM that boots fine when dom0 is booted through MBR but fails when dom=
0 is booted through UEFI.



My system is:

DQ77KB motherboard with bios version 44

Core i7-3779T with VT-d

Intel HD graphics 4000



In the qemu log it seem like xen cannot reach the vga-bios. Is this a known=
 problem when booting through xen.efi or is it a bug?



dm-command: hot insert pass-through pci dev

register_real_device: Assigning real physical device 00:02.0 ...

register_real_device: Disable MSI translation via per device option

register_real_device: Disable power management

pt_iomul_init: Error: pt_iomul_init can't open file /dev/xen/pci_iomul: No =
such file or directory: 0x0:0x2.0x0

pt_register_regions: IO region registered (size=3D0x00400000 base_addr=3D0x=
f7000004)

pt_register_regions: IO region registered (size=3D0x10000000 base_addr=3D0x=
e000000c)

pt_register_regions: IO region registered (size=3D0x00000040 base_addr=3D0x=
0000f001)

setup_vga_pt: vga bios size (0x0) is invalid!

register_real_device: Setup VGA BIOS of passthroughed gfx failed!



Log file is attached.



Kind regards Kristian Hagsted Rasmussen


--_000_19EF9FEB5AF86243A3F18E5CE75971640A00B0F5hagstedbserverh_
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-micr=
osoft-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=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
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;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
	{mso-style-priority:99;
	mso-style-link:"Almindelig tekst Tegn";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
span.AlmindeligtekstTegn
	{mso-style-name:"Almindelig tekst Tegn";
	mso-style-priority:99;
	mso-style-link:"Almindelig tekst";
	font-family:"Calibri","sans-serif";}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:3.0cm 2.0cm 3.0cm 2.0cm;}
div.WordSection1
	{page:WordSection1;}
--></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=3D"DA" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoPlainText"><span lang=3D"EN-US">Hi all<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">I can't seem to find any inf=
ormation on vga-passthrough when booting through xen.efi, so I assume it sh=
ould work. But I encounter a problem on a windows 7 HVM that boots fine whe=
n dom0 is booted through MBR but fails
 when dom0 is booted through UEFI.<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">My system is:<o:p></o:p></sp=
an></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">DQ77KB motherboard with bios=
 version 44<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">Core i7-3779T with VT-d<o:p>=
</o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">Intel HD graphics 4000<o:p><=
/o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">In the qemu log it seem like=
 xen cannot reach the vga-bios. Is this a known problem when booting throug=
h xen.efi or is it a bug?<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">dm-command: hot insert pass-=
through pci dev<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">register_real_device: Assign=
ing real physical device 00:02.0 ...<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">register_real_device: Disabl=
e MSI translation via per device option<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">register_real_device: Disabl=
e power management<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">pt_iomul_init: Error: pt_iom=
ul_init can't open file /dev/xen/pci_iomul: No such file or directory: 0x0:=
0x2.0x0<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">pt_register_regions: IO regi=
on registered (size=3D0x00400000 base_addr=3D0xf7000004)<o:p></o:p></span><=
/p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">pt_register_regions: IO regi=
on registered (size=3D0x10000000 base_addr=3D0xe000000c)<o:p></o:p></span><=
/p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">pt_register_regions: IO regi=
on registered (size=3D0x00000040 base_addr=3D0x0000f001)<o:p></o:p></span><=
/p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">setup_vga_pt: vga bios size =
(0x0) is invalid!<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">register_real_device: Setup =
VGA BIOS of passthroughed gfx failed!<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">Log file is attached.<o:p></=
o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">Kind regards Kristian Hagste=
d Rasmussen<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
</div>
</body>
</html>

--_000_19EF9FEB5AF86243A3F18E5CE75971640A00B0F5hagstedbserverh_--

--_004_19EF9FEB5AF86243A3F18E5CE75971640A00B0F5hagstedbserverh_
Content-Type: application/octet-stream; name="windows-domU.log"
Content-Description: windows-domU.log
Content-Disposition: attachment; filename="windows-domU.log"; size=6272;
	creation-date="Mon, 12 Nov 2012 18:43:00 GMT";
	modification-date="Mon, 12 Nov 2012 18:43:00 GMT"
Content-Transfer-Encoding: base64

ZG9taWQ6IDYNClVzaW5nIHh2ZGEgZm9yIGd1ZXN0J3MgaGRhDQpVc2luZyBmaWxlIC9kZXYvc2Rh
NiBpbiByZWFkLXdyaXRlIG1vZGUNCldhdGNoaW5nIC9sb2NhbC9kb21haW4vMC9kZXZpY2UtbW9k
ZWwvNi9sb2dkaXJ0eS9jbWQNCldhdGNoaW5nIC9sb2NhbC9kb21haW4vMC9kZXZpY2UtbW9kZWwv
Ni9jb21tYW5kDQpXYXRjaGluZyAvbG9jYWwvZG9tYWluLzYvY3B1DQpjaGFyIGRldmljZSByZWRp
cmVjdGVkIHRvIC9kZXYvcHRzLzQNCnFlbXVfbWFwX2NhY2hlX2luaXQgbnJfYnVja2V0cyA9IDEw
MDAwIHNpemUgNDE5NDMwNA0Kc2hhcmVkIHBhZ2UgYXQgcGZuIGZlZmZkDQpidWZmZXJlZCBpbyBw
YWdlIGF0IHBmbiBmZWZmYg0KR3Vlc3QgdXVpZCA9IDdhYjk5OTQ1LWNhNDItNDIzMC05NjI4LTBl
ODJjOGJhZTI1Nw0KUmVnaXN0ZXIgeGVuIHBsYXRmb3JtLg0KRG9uZSByZWdpc3RlciBwbGF0Zm9y
bS4NCnBsYXRmb3JtX2ZpeGVkX2lvcG9ydDogY2hhbmdlZCByby9ydyBzdGF0ZSBvZiBST00gbWVt
b3J5IGFyZWEuIG5vdyBpcyBydyBzdGF0ZS4NCnhzX3JlYWQoL2xvY2FsL2RvbWFpbi8wL2Rldmlj
ZS1tb2RlbC82L3hlbl9leHRl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0X21hcD0wDQpwdF9pb21lbV9tYXA6IGVfcGh5cz1mZmZm
ZmZmZiBtYWRkcj1mNzQwMDAwMCB0eXBlPTAgbGVuPTQxOTQzMDQgaW5kZXg9MiBmaXJzdF9tYXA9
MA0KcHRfaW9tZW1fbWFwOiBlX3BoeXM9ZjE0MDAwMDAgbWFkZHI9Zjc4MDAwMDAgdHlwZT0wIGxl
bj00MTk0MzA0IGluZGV4PTAgZmlyc3RfbWFwPTANCnB0X2lvbWVtX21hcDogZV9waHlzPWYxODAw
MDAwIG1hZGRyPWY3NDAwMDAwIHR5cGU9MCBsZW49NDE5NDMwNCBpbmRleD0yIGZpcnN0X21hcD0w
DQo=

--_004_19EF9FEB5AF86243A3F18E5CE75971640A00B0F5hagstedbserverh_
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.xen.org
http://lists.xen.org/xen-devel

--_004_19EF9FEB5AF86243A3F18E5CE75971640A00B0F5hagstedbserverh_--


From xen-devel-bounces@lists.xen.org Mon Nov 12 19:08:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 19:08:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXzMj-00020J-3b; Mon, 12 Nov 2012 19:08:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kristian@hagsted.dk>) id 1TXzMh-00020E-AY
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 19:08:12 +0000
Received: from [85.158.137.99:30075] by server-7.bemta-3.messagelabs.com id
	CC/49-01713-71941A05; Mon, 12 Nov 2012 19:08:07 +0000
X-Env-Sender: kristian@hagsted.dk
X-Msg-Ref: server-2.tower-217.messagelabs.com!1352747286!18693822!1
X-Originating-IP: [80.160.77.114]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuMTYwLjc3LjExNCA9PiAzNzY0MTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29300 invoked from network); 12 Nov 2012 19:08:06 -0000
Received: from pasmtpa.tele.dk (HELO pasmtpA.tele.dk) (80.160.77.114)
	by server-2.tower-217.messagelabs.com with SMTP;
	12 Nov 2012 19:08:06 -0000
Received: from hagsted.dk (unknown [2.108.99.186])
	by pasmtpA.tele.dk (Postfix) with ESMTP id 79D2580004C
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 20:08:05 +0100 (CET)
Received: from HAGSTED-BSERVER.hagsted.dk ([fe80::91b7:737e:e057:7c8b]) by
	hagsted-bserver.hagsted.dk ([fe80::91b7:737e:e057:7c8b%10]) with mapi
	id 14.02.0318.004; Mon, 12 Nov 2012 20:08:06 +0100
From: Kristian Hagsted Rasmussen <kristian@hagsted.dk>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Thread-Topic: xen EFI boot and vga-passthrough
Thread-Index: Ac3BCUwxBONJB3zmT1y62jykNdtmkQ==
Date: Mon, 12 Nov 2012 19:08:05 +0000
Message-ID: <19EF9FEB5AF86243A3F18E5CE75971640A00B0F5@hagsted-bserver.hagsted.dk>
Accept-Language: da-DK, en-US
Content-Language: da-DK
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [192.168.1.103]
Content-Type: multipart/mixed;
	boundary="_004_19EF9FEB5AF86243A3F18E5CE75971640A00B0F5hagstedbserverh_"
MIME-Version: 1.0
Subject: [Xen-devel] xen EFI boot and vga-passthrough
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_004_19EF9FEB5AF86243A3F18E5CE75971640A00B0F5hagstedbserverh_
Content-Type: multipart/alternative;
	boundary="_000_19EF9FEB5AF86243A3F18E5CE75971640A00B0F5hagstedbserverh_"

--_000_19EF9FEB5AF86243A3F18E5CE75971640A00B0F5hagstedbserverh_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi all



I can't seem to find any information on vga-passthrough when booting throug=
h xen.efi, so I assume it should work. But I encounter a problem on a windo=
ws 7 HVM that boots fine when dom0 is booted through MBR but fails when dom=
0 is booted through UEFI.



My system is:

DQ77KB motherboard with bios version 44

Core i7-3779T with VT-d

Intel HD graphics 4000



In the qemu log it seem like xen cannot reach the vga-bios. Is this a known=
 problem when booting through xen.efi or is it a bug?



dm-command: hot insert pass-through pci dev

register_real_device: Assigning real physical device 00:02.0 ...

register_real_device: Disable MSI translation via per device option

register_real_device: Disable power management

pt_iomul_init: Error: pt_iomul_init can't open file /dev/xen/pci_iomul: No =
such file or directory: 0x0:0x2.0x0

pt_register_regions: IO region registered (size=3D0x00400000 base_addr=3D0x=
f7000004)

pt_register_regions: IO region registered (size=3D0x10000000 base_addr=3D0x=
e000000c)

pt_register_regions: IO region registered (size=3D0x00000040 base_addr=3D0x=
0000f001)

setup_vga_pt: vga bios size (0x0) is invalid!

register_real_device: Setup VGA BIOS of passthroughed gfx failed!



Log file is attached.



Kind regards Kristian Hagsted Rasmussen


--_000_19EF9FEB5AF86243A3F18E5CE75971640A00B0F5hagstedbserverh_
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-micr=
osoft-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=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
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;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
	{mso-style-priority:99;
	mso-style-link:"Almindelig tekst Tegn";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
span.AlmindeligtekstTegn
	{mso-style-name:"Almindelig tekst Tegn";
	mso-style-priority:99;
	mso-style-link:"Almindelig tekst";
	font-family:"Calibri","sans-serif";}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:3.0cm 2.0cm 3.0cm 2.0cm;}
div.WordSection1
	{page:WordSection1;}
--></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=3D"DA" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoPlainText"><span lang=3D"EN-US">Hi all<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">I can't seem to find any inf=
ormation on vga-passthrough when booting through xen.efi, so I assume it sh=
ould work. But I encounter a problem on a windows 7 HVM that boots fine whe=
n dom0 is booted through MBR but fails
 when dom0 is booted through UEFI.<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">My system is:<o:p></o:p></sp=
an></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">DQ77KB motherboard with bios=
 version 44<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">Core i7-3779T with VT-d<o:p>=
</o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">Intel HD graphics 4000<o:p><=
/o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">In the qemu log it seem like=
 xen cannot reach the vga-bios. Is this a known problem when booting throug=
h xen.efi or is it a bug?<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">dm-command: hot insert pass-=
through pci dev<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">register_real_device: Assign=
ing real physical device 00:02.0 ...<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">register_real_device: Disabl=
e MSI translation via per device option<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">register_real_device: Disabl=
e power management<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">pt_iomul_init: Error: pt_iom=
ul_init can't open file /dev/xen/pci_iomul: No such file or directory: 0x0:=
0x2.0x0<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">pt_register_regions: IO regi=
on registered (size=3D0x00400000 base_addr=3D0xf7000004)<o:p></o:p></span><=
/p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">pt_register_regions: IO regi=
on registered (size=3D0x10000000 base_addr=3D0xe000000c)<o:p></o:p></span><=
/p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">pt_register_regions: IO regi=
on registered (size=3D0x00000040 base_addr=3D0x0000f001)<o:p></o:p></span><=
/p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">setup_vga_pt: vga bios size =
(0x0) is invalid!<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">register_real_device: Setup =
VGA BIOS of passthroughed gfx failed!<o:p></o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">Log file is attached.<o:p></=
o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoPlainText"><span lang=3D"EN-US">Kind regards Kristian Hagste=
d Rasmussen<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
</div>
</body>
</html>

--_000_19EF9FEB5AF86243A3F18E5CE75971640A00B0F5hagstedbserverh_--

--_004_19EF9FEB5AF86243A3F18E5CE75971640A00B0F5hagstedbserverh_
Content-Type: application/octet-stream; name="windows-domU.log"
Content-Description: windows-domU.log
Content-Disposition: attachment; filename="windows-domU.log"; size=6272;
	creation-date="Mon, 12 Nov 2012 18:43:00 GMT";
	modification-date="Mon, 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0MzA0IGluZGV4PTAgZmlyc3RfbWFwPTANCnB0X2lvbWVtX21hcDogZV9waHlzPWYxODAw
MDAwIG1hZGRyPWY3NDAwMDAwIHR5cGU9MCBsZW49NDE5NDMwNCBpbmRleD0yIGZpcnN0X21hcD0w
DQo=

--_004_19EF9FEB5AF86243A3F18E5CE75971640A00B0F5hagstedbserverh_
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.xen.org
http://lists.xen.org/xen-devel

--_004_19EF9FEB5AF86243A3F18E5CE75971640A00B0F5hagstedbserverh_--


From xen-devel-bounces@lists.xen.org Mon Nov 12 19:19:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 19:19:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXzWs-0002Db-8W; Mon, 12 Nov 2012 19:18:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kristian@hagsted.dk>) id 1TXzWq-0002DW-Ja
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 19:18:40 +0000
Received: from [193.109.254.147:30148] by server-2.bemta-14.messagelabs.com id
	11/98-20829-F8B41A05; Mon, 12 Nov 2012 19:18:39 +0000
X-Env-Sender: kristian@hagsted.dk
X-Msg-Ref: server-2.tower-27.messagelabs.com!1352747917!9091625!1
X-Originating-IP: [80.160.77.114]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuMTYwLjc3LjExNCA9PiAzNzY0MTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28679 invoked from network); 12 Nov 2012 19:18:37 -0000
Received: from pasmtpa.tele.dk (HELO pasmtpA.tele.dk) (80.160.77.114)
	by server-2.tower-27.messagelabs.com with SMTP;
	12 Nov 2012 19:18:37 -0000
Received: from hagsted.dk (unknown [2.108.99.186])
	by pasmtpA.tele.dk (Postfix) with ESMTP id 5724080004C
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 20:18:36 +0100 (CET)
Received: from HAGSTED-BSERVER.hagsted.dk ([fe80::91b7:737e:e057:7c8b]) by
	hagsted-bserver.hagsted.dk ([fe80::91b7:737e:e057:7c8b%10]) with mapi
	id 14.02.0318.004; Mon, 12 Nov 2012 20:18:36 +0100
From: Kristian Hagsted Rasmussen <kristian@hagsted.dk>
To: Kristian Hagsted Rasmussen <kristian@hagsted.dk>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Thread-Topic: xen EFI boot and vga-passthrough
Thread-Index: Ac3BCUwxBONJB3zmT1y62jykNdtmkQAAQFdA
Date: Mon, 12 Nov 2012 19:18:36 +0000
Message-ID: <19EF9FEB5AF86243A3F18E5CE75971640A00B204@hagsted-bserver.hagsted.dk>
References: <19EF9FEB5AF86243A3F18E5CE75971640A00B0F5@hagsted-bserver.hagsted.dk>
In-Reply-To: <19EF9FEB5AF86243A3F18E5CE75971640A00B0F5@hagsted-bserver.hagsted.dk>
Accept-Language: da-DK, en-US
Content-Language: da-DK
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [192.168.1.103]
Content-Type: multipart/mixed;
	boundary="_002_19EF9FEB5AF86243A3F18E5CE75971640A00B204hagstedbserverh_"
MIME-Version: 1.0
Subject: Re: [Xen-devel] xen EFI boot and vga-passthrough
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_19EF9FEB5AF86243A3F18E5CE75971640A00B204hagstedbserverh_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi all

I can't seem to find any information on vga-passthrough when booting throug=
h xen.efi, so I assume it should work. But I encounter a problem on a windo=
ws 7 HVM that boots fine when dom0 is booted through MBR but fails when dom=
0 is booted through UEFI.

My system is:
DQ77KB motherboard with bios version 44
Core i7-3779T with VT-d
Intel HD graphics 4000

In the qemu log it seem like xen cannot reach the vga-bios. Is this a known=
 problem when booting through xen.efi or is it a bug?

dm-command: hot insert pass-through pci dev
register_real_device: Assigning real physical device 00:02.0 ...
register_real_device: Disable MSI translation via per device option
register_real_device: Disable power management
pt_iomul_init: Error: pt_iomul_init can't open file /dev/xen/pci_iomul: No =
such file or directory: 0x0:0x2.0x0
pt_register_regions: IO region registered (size=3D0x00400000 base_addr=3D0x=
f7000004)
pt_register_regions: IO region registered (size=3D0x10000000 base_addr=3D0x=
e000000c)
pt_register_regions: IO region registered (size=3D0x00000040 base_addr=3D0x=
0000f001)
setup_vga_pt: vga bios size (0x0) is invalid!
register_real_device: Setup VGA BIOS of passthroughed gfx failed!

Log file is attached.

Just compared a log file from efi boot to one from MBR boot and found this =
discrepancy between the two:
pt_register_regions: IO region registered (size=3D0x00400000 base_addr=3D0x=
dfc00004) - MBR boot see last addr	0xdfc00004
pt_register_regions: IO region registered (size=3D0x00400000 base_addr=3D0x=
f7000004) - EFI boot compare to MBR	0xf7000004

Kind regards Kristian Hagsted Rasmussen


--_002_19EF9FEB5AF86243A3F18E5CE75971640A00B204hagstedbserverh_
Content-Type: application/octet-stream; name="windows-domU.log"
Content-Description: windows-domU.log
Content-Disposition: attachment; filename="windows-domU.log"; size=6272;
	creation-date="Mon, 12 Nov 2012 18:43:00 GMT";
	modification-date="Mon, 12 Nov 2012 18:43:00 GMT"
Content-Transfer-Encoding: base64

ZG9taWQ6IDYNClVzaW5nIHh2ZGEgZm9yIGd1ZXN0J3MgaGRhDQpVc2luZyBmaWxlIC9kZXYvc2Rh
NiBpbiByZWFkLXdyaXRlIG1vZGUNCldhdGNoaW5nIC9sb2NhbC9kb21haW4vMC9kZXZpY2UtbW9k
ZWwvNi9sb2dkaXJ0eS9jbWQNCldhdGNoaW5nIC9sb2NhbC9kb21haW4vMC9kZXZpY2UtbW9kZWwv
Ni9jb21tYW5kDQpXYXRjaGluZyAvbG9jYWwvZG9tYWluLzYvY3B1DQpjaGFyIGRldmljZSByZWRp
cmVjdGVkIHRvIC9kZXYvcHRzLzQNCnFlbXVfbWFwX2NhY2hlX2luaXQgbnJfYnVja2V0cyA9IDEw
MDAwIHNpemUgNDE5NDMwNA0Kc2hhcmVkIHBhZ2UgYXQgcGZuIGZlZmZkDQpidWZmZXJlZCBpbyBw
YWdlIGF0IHBmbiBmZWZmYg0KR3Vlc3QgdXVpZCA9IDdhYjk5OTQ1LWNhNDItNDIzMC05NjI4LTBl
ODJjOGJhZTI1Nw0KUmVnaXN0ZXIgeGVuIHBsYXRmb3JtLg0KRG9uZSByZWdpc3RlciBwbGF0Zm9y
bS4NCnBsYXRmb3JtX2ZpeGVkX2lvcG9ydDogY2hhbmdlZCByby9ydyBzdGF0ZSBvZiBST00gbWVt
b3J5IGFyZWEuIG5vdyBpcyBydyBzdGF0ZS4NCnhzX3JlYWQoL2xvY2FsL2RvbWFpbi8wL2Rldmlj
ZS1tb2RlbC82L3hlbl9leHRlbmRlZF9wb3dlcl9tZ210KTogcmVhZCBlcnJvcg0KeHNfcmVhZCgp
OiB2bmNwYXNzd2QgZ2V0IGVycm9yLiAvdm0vN2FiOTk5NDUtY2E0Mi00MjMwLTk2MjgtMGU4MmM4
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RfaW9tZW1fbWFwOiBlX3BoeXM9ZjE0MDAwMDAgbWFkZHI9Zjc4MDAwMDAgdHlwZT0wIGxl
bj00MTk0MzA0IGluZGV4PTAgZmlyc3RfbWFwPTANCnB0X2lvbWVtX21hcDogZV9waHlzPWYxODAw
MDAwIG1hZGRyPWY3NDAwMDAwIHR5cGU9MCBsZW49NDE5NDMwNCBpbmRleD0yIGZpcnN0X21hcD0w
DQo=

--_002_19EF9FEB5AF86243A3F18E5CE75971640A00B204hagstedbserverh_
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.xen.org
http://lists.xen.org/xen-devel

--_002_19EF9FEB5AF86243A3F18E5CE75971640A00B204hagstedbserverh_--


From xen-devel-bounces@lists.xen.org Mon Nov 12 19:19:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 19:19:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TXzWs-0002Db-8W; Mon, 12 Nov 2012 19:18:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kristian@hagsted.dk>) id 1TXzWq-0002DW-Ja
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 19:18:40 +0000
Received: from [193.109.254.147:30148] by server-2.bemta-14.messagelabs.com id
	11/98-20829-F8B41A05; Mon, 12 Nov 2012 19:18:39 +0000
X-Env-Sender: kristian@hagsted.dk
X-Msg-Ref: server-2.tower-27.messagelabs.com!1352747917!9091625!1
X-Originating-IP: [80.160.77.114]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuMTYwLjc3LjExNCA9PiAzNzY0MTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28679 invoked from network); 12 Nov 2012 19:18:37 -0000
Received: from pasmtpa.tele.dk (HELO pasmtpA.tele.dk) (80.160.77.114)
	by server-2.tower-27.messagelabs.com with SMTP;
	12 Nov 2012 19:18:37 -0000
Received: from hagsted.dk (unknown [2.108.99.186])
	by pasmtpA.tele.dk (Postfix) with ESMTP id 5724080004C
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 20:18:36 +0100 (CET)
Received: from HAGSTED-BSERVER.hagsted.dk ([fe80::91b7:737e:e057:7c8b]) by
	hagsted-bserver.hagsted.dk ([fe80::91b7:737e:e057:7c8b%10]) with mapi
	id 14.02.0318.004; Mon, 12 Nov 2012 20:18:36 +0100
From: Kristian Hagsted Rasmussen <kristian@hagsted.dk>
To: Kristian Hagsted Rasmussen <kristian@hagsted.dk>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Thread-Topic: xen EFI boot and vga-passthrough
Thread-Index: Ac3BCUwxBONJB3zmT1y62jykNdtmkQAAQFdA
Date: Mon, 12 Nov 2012 19:18:36 +0000
Message-ID: <19EF9FEB5AF86243A3F18E5CE75971640A00B204@hagsted-bserver.hagsted.dk>
References: <19EF9FEB5AF86243A3F18E5CE75971640A00B0F5@hagsted-bserver.hagsted.dk>
In-Reply-To: <19EF9FEB5AF86243A3F18E5CE75971640A00B0F5@hagsted-bserver.hagsted.dk>
Accept-Language: da-DK, en-US
Content-Language: da-DK
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [192.168.1.103]
Content-Type: multipart/mixed;
	boundary="_002_19EF9FEB5AF86243A3F18E5CE75971640A00B204hagstedbserverh_"
MIME-Version: 1.0
Subject: Re: [Xen-devel] xen EFI boot and vga-passthrough
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_19EF9FEB5AF86243A3F18E5CE75971640A00B204hagstedbserverh_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi all

I can't seem to find any information on vga-passthrough when booting throug=
h xen.efi, so I assume it should work. But I encounter a problem on a windo=
ws 7 HVM that boots fine when dom0 is booted through MBR but fails when dom=
0 is booted through UEFI.

My system is:
DQ77KB motherboard with bios version 44
Core i7-3779T with VT-d
Intel HD graphics 4000

In the qemu log it seem like xen cannot reach the vga-bios. Is this a known=
 problem when booting through xen.efi or is it a bug?

dm-command: hot insert pass-through pci dev
register_real_device: Assigning real physical device 00:02.0 ...
register_real_device: Disable MSI translation via per device option
register_real_device: Disable power management
pt_iomul_init: Error: pt_iomul_init can't open file /dev/xen/pci_iomul: No =
such file or directory: 0x0:0x2.0x0
pt_register_regions: IO region registered (size=3D0x00400000 base_addr=3D0x=
f7000004)
pt_register_regions: IO region registered (size=3D0x10000000 base_addr=3D0x=
e000000c)
pt_register_regions: IO region registered (size=3D0x00000040 base_addr=3D0x=
0000f001)
setup_vga_pt: vga bios size (0x0) is invalid!
register_real_device: Setup VGA BIOS of passthroughed gfx failed!

Log file is attached.

Just compared a log file from efi boot to one from MBR boot and found this =
discrepancy between the two:
pt_register_regions: IO region registered (size=3D0x00400000 base_addr=3D0x=
dfc00004) - MBR boot see last addr	0xdfc00004
pt_register_regions: IO region registered (size=3D0x00400000 base_addr=3D0x=
f7000004) - EFI boot compare to MBR	0xf7000004

Kind regards Kristian Hagsted Rasmussen


--_002_19EF9FEB5AF86243A3F18E5CE75971640A00B204hagstedbserverh_
Content-Type: application/octet-stream; name="windows-domU.log"
Content-Description: windows-domU.log
Content-Disposition: attachment; filename="windows-domU.log"; size=6272;
	creation-date="Mon, 12 Nov 2012 18:43:00 GMT";
	modification-date="Mon, 12 Nov 2012 18:43:00 GMT"
Content-Transfer-Encoding: base64

ZG9taWQ6IDYNClVzaW5nIHh2ZGEgZm9yIGd1ZXN0J3MgaGRhDQpVc2luZyBmaWxlIC9kZXYvc2Rh
NiBpbiByZWFkLXdyaXRlIG1vZGUNCldhdGNoaW5nIC9sb2NhbC9kb21haW4vMC9kZXZpY2UtbW9k
ZWwvNi9sb2dkaXJ0eS9jbWQNCldhdGNoaW5nIC9sb2NhbC9kb21haW4vMC9kZXZpY2UtbW9kZWwv
Ni9jb21tYW5kDQpXYXRjaGluZyAvbG9jYWwvZG9tYWluLzYvY3B1DQpjaGFyIGRldmljZSByZWRp
cmVjdGVkIHRvIC9kZXYvcHRzLzQNCnFlbXVfbWFwX2NhY2hlX2luaXQgbnJfYnVja2V0cyA9IDEw
MDAwIHNpemUgNDE5NDMwNA0Kc2hhcmVkIHBhZ2UgYXQgcGZuIGZlZmZkDQpidWZmZXJlZCBpbyBw
YWdlIGF0IHBmbiBmZWZmYg0KR3Vlc3QgdXVpZCA9IDdhYjk5OTQ1LWNhNDItNDIzMC05NjI4LTBl
ODJjOGJhZTI1Nw0KUmVnaXN0ZXIgeGVuIHBsYXRmb3JtLg0KRG9uZSByZWdpc3RlciBwbGF0Zm9y
bS4NCnBsYXRmb3JtX2ZpeGVkX2lvcG9ydDogY2hhbmdlZCByby9ydyBzdGF0ZSBvZiBST00gbWVt
b3J5IGFyZWEuIG5vdyBpcyBydyBzdGF0ZS4NCnhzX3JlYWQoL2xvY2FsL2RvbWFpbi8wL2Rldmlj
ZS1tb2RlbC82L3hlbl9leHRlbmRlZF9wb3dlcl9tZ210KTogcmVhZCBlcnJvcg0KeHNfcmVhZCgp
Oi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YWRkcj1mNzQwMDAwMCB0eXBlPTAgbGVuPTQxOTQzMDQgaW5kZXg9MiBmaXJzdF9tYXA9
MA0KcHRfaW9tZW1fbWFwOiBlX3BoeXM9ZjE0MDAwMDAgbWFkZHI9Zjc4MDAwMDAgdHlwZT0wIGxl
bj00MTk0MzA0IGluZGV4PTAgZmlyc3RfbWFwPTANCnB0X2lvbWVtX21hcDogZV9waHlzPWYxODAw
MDAwIG1hZGRyPWY3NDAwMDAwIHR5cGU9MCBsZW49NDE5NDMwNCBpbmRleD0yIGZpcnN0X21hcD0w
DQo=

--_002_19EF9FEB5AF86243A3F18E5CE75971640A00B204hagstedbserverh_
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.xen.org
http://lists.xen.org/xen-devel

--_002_19EF9FEB5AF86243A3F18E5CE75971640A00B204hagstedbserverh_--


From xen-devel-bounces@lists.xen.org Mon Nov 12 21:02:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 21:02:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY18X-0003UR-US; Mon, 12 Nov 2012 21:01:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TY18X-0003U9-0Z
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 21:01:41 +0000
Received: from [85.158.139.211:33098] by server-12.bemta-5.messagelabs.com id
	11/2D-02886-4B361A05; Mon, 12 Nov 2012 21:01:40 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1352754099!18396805!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12523 invoked from network); 12 Nov 2012 21:01:39 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 21:01:39 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="15761349"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 21:01:34 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 12 Nov 2012 21:01:34 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TY18Q-0000ok-8B;
	Mon, 12 Nov 2012 21:01:34 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TY18Q-0004aE-75;
	Mon, 12 Nov 2012 21:01:34 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14381-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 12 Nov 2012 21:01:34 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14381: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14381 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14381/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14379
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14379
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14379
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14378

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  279bbf2a0b48
baseline version:
 xen                  62885b3c34c8

------------------------------------------------------------
People who touched revisions under test:
  Dario Faggioli <dario.faggioli@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Daley <mattjd@gmail.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=279bbf2a0b48
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 279bbf2a0b48
+ branch=xen-unstable
+ revision=279bbf2a0b48
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 279bbf2a0b48 ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 3 changesets with 7 changes to 7 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 21:02:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 21:02:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY18X-0003UR-US; Mon, 12 Nov 2012 21:01:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TY18X-0003U9-0Z
	for xen-devel@lists.xensource.com; Mon, 12 Nov 2012 21:01:41 +0000
Received: from [85.158.139.211:33098] by server-12.bemta-5.messagelabs.com id
	11/2D-02886-4B361A05; Mon, 12 Nov 2012 21:01:40 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1352754099!18396805!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgwODM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12523 invoked from network); 12 Nov 2012 21:01:39 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 21:01:39 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="15761349"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 21:01:34 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 12 Nov 2012 21:01:34 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TY18Q-0000ok-8B;
	Mon, 12 Nov 2012 21:01:34 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TY18Q-0004aE-75;
	Mon, 12 Nov 2012 21:01:34 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14381-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 12 Nov 2012 21:01:34 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14381: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14381 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14381/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14379
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14379
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14379
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14378

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  279bbf2a0b48
baseline version:
 xen                  62885b3c34c8

------------------------------------------------------------
People who touched revisions under test:
  Dario Faggioli <dario.faggioli@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Daley <mattjd@gmail.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=279bbf2a0b48
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 279bbf2a0b48
+ branch=xen-unstable
+ revision=279bbf2a0b48
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 279bbf2a0b48 ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 3 changesets with 7 changes to 7 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 21:12:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 21:12:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY1J0-0003hR-41; Mon, 12 Nov 2012 21:12:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TY1Iz-0003hM-5B
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 21:12:29 +0000
Received: from [85.158.139.83:65467] by server-5.bemta-5.messagelabs.com id
	5C/5B-11353-C3661A05; Mon, 12 Nov 2012 21:12:28 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1352754747!21346178!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19070 invoked from network); 12 Nov 2012 21:12:27 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-16.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 21:12:27 -0000
Received: by mail-ee0-f45.google.com with SMTP id d49so1525066eek.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 13:12:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:subject
	:content-type:content-transfer-encoding;
	bh=aoGzK4CnKq8fEKXZ72DOi2SoPYWIkKEOxV0U21wQ5eM=;
	b=EIOWW5xPHlfXT1xOdsDox/kRWLwdwtsn+yCTamiwuRNGGnreJBp39JJH1y5xr672fS
	KS0JM0OBo+mlA0A/hUnvZD1FIXo3AUCwv8gKyMWJzWD9TXzvvEO9T/YcDj6eJ6HIW4fz
	w4wSs48aLRQAhO6LozRaZbHSXRRA9cWYA6ZU+4kmbaKh6V3uH2C8a4YGlgnHOY9vwbmx
	8OamHQzk3p9wYdxIbPoaCDimSIaYFV1hluWVULDhxJFpVeoYeq6Pu8O0bCI7KrZscANy
	d5mzLO8VBqnPpzr/Nt1PS2mJqh0Tks8lOlq4mMrXt4QlsuQJ42AFMi22BRQhe7CMLATV
	v4/Q==
Received: by 10.14.194.72 with SMTP id l48mr67369011een.9.1352754747434;
	Mon, 12 Nov 2012 13:12:27 -0800 (PST)
Received: from [192.168.228.100] ([188.25.211.16])
	by mx.google.com with ESMTPS id y44sm3759371eel.14.2012.11.12.13.12.26
	(version=SSLv3 cipher=OTHER); Mon, 12 Nov 2012 13:12:26 -0800 (PST)
Message-ID: <50A16639.2090209@gmail.com>
Date: Mon, 12 Nov 2012 23:12:25 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.10) Gecko/20121106 Thunderbird/10.0.10
MIME-Version: 1.0
To: xen-devel@lists.xen.org
Subject: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

I'm interested in establishing a communication channel between the Xen
hypervisor and a dom0 userspace application. Ideally this would be a
2-way channel, with the hypervisor asynchronously notifying this
application, and then (for certain types of messages) wait for a reply
from the userspace consumer.

To this end, I've been reading xen-devel posts [1], read the
xentrace-related Xen source code [2], and studied tools such as Ether
[3]. I've also read as much as time permitted of "The Definitive Guide
to the Xen Hypervisor" [4] book. However, I have very limited experience
as a kernel developer, and none working on the Xen hypervisor, so I'm
still digesting the information.

A particularly good choice is riding on xentrace, since that's already
been tested, has it's own tools, and it's the fastest way to get data
moving in one direction. However (putting aside the fact that it's not
bidirectional communication) the problem is that the messages I'd like
to pass to my application are longer than 28 bytes, so to be able to get
what I need I'd have to either increase the default trace buffer, or
send a message in several chunks. None of these solutions look elegant
to me.

So I'm thinking about writing a custom channel from scratch, and I'd
like to know what the best way to proceed is. I'll likely need to add a
new VIRQ like the TRACE VIRQ and use that for notifications. However,
allocating and sharing a new page is trickier. I've read about grant
tables and HYPERVISOR_grant_table_op, but trace.c simply calls
share_xen_page_with_privileged_guests(). I've read about ring buffers
and DEFINE_RING_TYPES, but trace.{h,c} has nothing to do with that
macro. Is the "The Definitive Guide to the Xen Hypervisor" book still
relevant?

What would you recommend for my case? Where (if anywhere) might I be
able to find a clear, concise, example of allocating and sharing memory
pages containing a ring buffer used for hypervisor <-> dom0 userspace
communication (hopefully even simpler that trace.c)?

What resources that would accelerate learning and facilitate Xen
enlightenment would you recommend to a developer new to the Xen hypervisor?

Thank you,
Razvan

[1]
http://old-list-archives.xen.org/archives/html/xen-devel/2008-07/msg00589.html
[2] http://code.metager.de/source/xref/xen/xen/common/trace.c
[3] http://ether.gtisc.gatech.edu/source.html
[4] http://www.amazon.com/The-Definitive-Guide-Xen-Hypervisor/dp/013234971X

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 21:12:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 21:12:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY1J0-0003hR-41; Mon, 12 Nov 2012 21:12:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TY1Iz-0003hM-5B
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 21:12:29 +0000
Received: from [85.158.139.83:65467] by server-5.bemta-5.messagelabs.com id
	5C/5B-11353-C3661A05; Mon, 12 Nov 2012 21:12:28 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1352754747!21346178!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19070 invoked from network); 12 Nov 2012 21:12:27 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-16.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 21:12:27 -0000
Received: by mail-ee0-f45.google.com with SMTP id d49so1525066eek.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 13:12:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:subject
	:content-type:content-transfer-encoding;
	bh=aoGzK4CnKq8fEKXZ72DOi2SoPYWIkKEOxV0U21wQ5eM=;
	b=EIOWW5xPHlfXT1xOdsDox/kRWLwdwtsn+yCTamiwuRNGGnreJBp39JJH1y5xr672fS
	KS0JM0OBo+mlA0A/hUnvZD1FIXo3AUCwv8gKyMWJzWD9TXzvvEO9T/YcDj6eJ6HIW4fz
	w4wSs48aLRQAhO6LozRaZbHSXRRA9cWYA6ZU+4kmbaKh6V3uH2C8a4YGlgnHOY9vwbmx
	8OamHQzk3p9wYdxIbPoaCDimSIaYFV1hluWVULDhxJFpVeoYeq6Pu8O0bCI7KrZscANy
	d5mzLO8VBqnPpzr/Nt1PS2mJqh0Tks8lOlq4mMrXt4QlsuQJ42AFMi22BRQhe7CMLATV
	v4/Q==
Received: by 10.14.194.72 with SMTP id l48mr67369011een.9.1352754747434;
	Mon, 12 Nov 2012 13:12:27 -0800 (PST)
Received: from [192.168.228.100] ([188.25.211.16])
	by mx.google.com with ESMTPS id y44sm3759371eel.14.2012.11.12.13.12.26
	(version=SSLv3 cipher=OTHER); Mon, 12 Nov 2012 13:12:26 -0800 (PST)
Message-ID: <50A16639.2090209@gmail.com>
Date: Mon, 12 Nov 2012 23:12:25 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.10) Gecko/20121106 Thunderbird/10.0.10
MIME-Version: 1.0
To: xen-devel@lists.xen.org
Subject: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

I'm interested in establishing a communication channel between the Xen
hypervisor and a dom0 userspace application. Ideally this would be a
2-way channel, with the hypervisor asynchronously notifying this
application, and then (for certain types of messages) wait for a reply
from the userspace consumer.

To this end, I've been reading xen-devel posts [1], read the
xentrace-related Xen source code [2], and studied tools such as Ether
[3]. I've also read as much as time permitted of "The Definitive Guide
to the Xen Hypervisor" [4] book. However, I have very limited experience
as a kernel developer, and none working on the Xen hypervisor, so I'm
still digesting the information.

A particularly good choice is riding on xentrace, since that's already
been tested, has it's own tools, and it's the fastest way to get data
moving in one direction. However (putting aside the fact that it's not
bidirectional communication) the problem is that the messages I'd like
to pass to my application are longer than 28 bytes, so to be able to get
what I need I'd have to either increase the default trace buffer, or
send a message in several chunks. None of these solutions look elegant
to me.

So I'm thinking about writing a custom channel from scratch, and I'd
like to know what the best way to proceed is. I'll likely need to add a
new VIRQ like the TRACE VIRQ and use that for notifications. However,
allocating and sharing a new page is trickier. I've read about grant
tables and HYPERVISOR_grant_table_op, but trace.c simply calls
share_xen_page_with_privileged_guests(). I've read about ring buffers
and DEFINE_RING_TYPES, but trace.{h,c} has nothing to do with that
macro. Is the "The Definitive Guide to the Xen Hypervisor" book still
relevant?

What would you recommend for my case? Where (if anywhere) might I be
able to find a clear, concise, example of allocating and sharing memory
pages containing a ring buffer used for hypervisor <-> dom0 userspace
communication (hopefully even simpler that trace.c)?

What resources that would accelerate learning and facilitate Xen
enlightenment would you recommend to a developer new to the Xen hypervisor?

Thank you,
Razvan

[1]
http://old-list-archives.xen.org/archives/html/xen-devel/2008-07/msg00589.html
[2] http://code.metager.de/source/xref/xen/xen/common/trace.c
[3] http://ether.gtisc.gatech.edu/source.html
[4] http://www.amazon.com/The-Definitive-Guide-Xen-Hypervisor/dp/013234971X

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 21:23:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 21:23:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY1TE-0003yB-9B; Mon, 12 Nov 2012 21:23:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lersek@redhat.com>) id 1TY1TC-0003y6-QK
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 21:23:03 +0000
Received: from [85.158.138.51:30907] by server-1.bemta-3.messagelabs.com id
	5C/14-12169-6B861A05; Mon, 12 Nov 2012 21:23:02 +0000
X-Env-Sender: lersek@redhat.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1352755380!23398629!1
X-Originating-IP: [209.132.183.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTc3NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4302 invoked from network); 12 Nov 2012 21:23:01 -0000
Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28)
	by server-14.tower-174.messagelabs.com with SMTP;
	12 Nov 2012 21:23:01 -0000
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qACLMh1D026651
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 12 Nov 2012 16:22:44 -0500
Received: from lacos-laptop.usersys.redhat.com (vpn1-4-201.ams2.redhat.com
	[10.36.4.201])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id qACLMfEM006964; Mon, 12 Nov 2012 16:22:43 -0500
Message-ID: <50A16906.9000301@redhat.com>
Date: Mon, 12 Nov 2012 22:24:22 +0100
From: Laszlo Ersek <lersek@redhat.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.10) Gecko/20121026 Thunderbird/10.0.10
MIME-Version: 1.0
To: Kristian Hagsted Rasmussen <kristian@hagsted.dk>
References: <19EF9FEB5AF86243A3F18E5CE75971640A00B0F5@hagsted-bserver.hagsted.dk>
In-Reply-To: <19EF9FEB5AF86243A3F18E5CE75971640A00B0F5@hagsted-bserver.hagsted.dk>
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] xen EFI boot and vga-passthrough
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/12/12 20:08, Kristian Hagsted Rasmussen wrote:
> Hi all
> 
> I can't seem to find any information on vga-passthrough when booting
> through xen.efi, so I assume it should work. But I encounter a problem
> on a windows 7 HVM that boots fine when dom0 is booted through MBR but
> fails when dom0 is booted through UEFI.
> 
> My system is:
> DQ77KB motherboard with bios version 44
> Core i7-3779T with VT-d
> Intel HD graphics 4000
> 
> In the qemu log it seem like xen cannot reach the vga-bios. Is this a
> known problem when booting through xen.efi or is it a bug?

The legacy VGA BIOS is not present on UEFI platforms unless an
(optional) compatibility support module provides it. (Tangentially,
Secure Boot disables CSMs.)

Windows 7 / Windows 2008 R2 have a bug: even when booted on an UEFI
platform, they depend on the optional VGA BIOS unconditionally. This
seems to have been fixed in Windows 8 / Windows Server 2012.

See <http://www.linux-kvm.org/page/OVMF#Windows_Server_2008_R2_SP1>
and/or the long "OVMF + Windows 2008 r2 sp1" thread on edk2-devel.

(Apologies if I misunderstood your question. Admittedly, I haven't done
any homework wrt. xen.efi or vga passthrough. But your email had too
many keywords to push my buttons.)

Laszlo

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 21:23:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 21:23:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY1TE-0003yB-9B; Mon, 12 Nov 2012 21:23:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lersek@redhat.com>) id 1TY1TC-0003y6-QK
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 21:23:03 +0000
Received: from [85.158.138.51:30907] by server-1.bemta-3.messagelabs.com id
	5C/14-12169-6B861A05; Mon, 12 Nov 2012 21:23:02 +0000
X-Env-Sender: lersek@redhat.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1352755380!23398629!1
X-Originating-IP: [209.132.183.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTc3NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4302 invoked from network); 12 Nov 2012 21:23:01 -0000
Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28)
	by server-14.tower-174.messagelabs.com with SMTP;
	12 Nov 2012 21:23:01 -0000
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qACLMh1D026651
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 12 Nov 2012 16:22:44 -0500
Received: from lacos-laptop.usersys.redhat.com (vpn1-4-201.ams2.redhat.com
	[10.36.4.201])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id qACLMfEM006964; Mon, 12 Nov 2012 16:22:43 -0500
Message-ID: <50A16906.9000301@redhat.com>
Date: Mon, 12 Nov 2012 22:24:22 +0100
From: Laszlo Ersek <lersek@redhat.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.10) Gecko/20121026 Thunderbird/10.0.10
MIME-Version: 1.0
To: Kristian Hagsted Rasmussen <kristian@hagsted.dk>
References: <19EF9FEB5AF86243A3F18E5CE75971640A00B0F5@hagsted-bserver.hagsted.dk>
In-Reply-To: <19EF9FEB5AF86243A3F18E5CE75971640A00B0F5@hagsted-bserver.hagsted.dk>
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] xen EFI boot and vga-passthrough
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/12/12 20:08, Kristian Hagsted Rasmussen wrote:
> Hi all
> 
> I can't seem to find any information on vga-passthrough when booting
> through xen.efi, so I assume it should work. But I encounter a problem
> on a windows 7 HVM that boots fine when dom0 is booted through MBR but
> fails when dom0 is booted through UEFI.
> 
> My system is:
> DQ77KB motherboard with bios version 44
> Core i7-3779T with VT-d
> Intel HD graphics 4000
> 
> In the qemu log it seem like xen cannot reach the vga-bios. Is this a
> known problem when booting through xen.efi or is it a bug?

The legacy VGA BIOS is not present on UEFI platforms unless an
(optional) compatibility support module provides it. (Tangentially,
Secure Boot disables CSMs.)

Windows 7 / Windows 2008 R2 have a bug: even when booted on an UEFI
platform, they depend on the optional VGA BIOS unconditionally. This
seems to have been fixed in Windows 8 / Windows Server 2012.

See <http://www.linux-kvm.org/page/OVMF#Windows_Server_2008_R2_SP1>
and/or the long "OVMF + Windows 2008 r2 sp1" thread on edk2-devel.

(Apologies if I misunderstood your question. Admittedly, I haven't done
any homework wrt. xen.efi or vga passthrough. But your email had too
many keywords to push my buttons.)

Laszlo

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 21:32:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 21:32:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY1c9-00048Q-AC; Mon, 12 Nov 2012 21:32:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <robert.phillips@citrix.com>) id 1TY1c7-00048L-4D
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 21:32:15 +0000
Received: from [85.158.143.35:20331] by server-2.bemta-4.messagelabs.com id
	FA/2F-28922-EDA61A05; Mon, 12 Nov 2012 21:32:14 +0000
X-Env-Sender: robert.phillips@citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1352755932!14616307!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMwMDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11981 invoked from network); 12 Nov 2012 21:32:13 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 21:32:13 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="44332992"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 21:32:01 +0000
Received: from FTLPMAILBOX02.citrite.net ([10.13.98.209]) by
	FTLPMAILMX02.citrite.net ([10.13.107.66]) with mapi; Mon, 12 Nov 2012
	16:32:02 -0500
From: Robert Phillips <robert.phillips@citrix.com>
To: "Tim (Xen.org)" <tim@xen.org>
Date: Mon, 12 Nov 2012 16:31:58 -0500
Thread-Topic: [Xen-devel] [PATCH] Provide support for multiple frame buffers
	in Xen.
Thread-Index: Ac29tISgskj15PbzRniL91JPgz0BOQDZuVjA
Message-ID: <048EAD622912254A9DEA24C1734613C18C87A62327@FTLPMAILBOX02.citrite.net>
References: <1350411302-5470-1-git-send-email-robert.phillips@citrix.com>
	<20121101142434.GC61948@ocelot.phlegethon.org>
	<048EAD622912254A9DEA24C1734613C18C876560B1@FTLPMAILBOX02.citrite.net>
	<20121108132522.GG76638@ocelot.phlegethon.org>
In-Reply-To: <20121108132522.GG76638@ocelot.phlegethon.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
 in Xen.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

I'm sending version 3 of the patch shortly.  I think it addresses all your concerns.

> -----Original Message-----
> From: Tim Deegan [mailto:tim@xen.org]
> Sent: Thursday, November 08, 2012 8:25 AM
> To: Robert Phillips
> Cc: xen-devel@lists.xen.org
> Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
> in Xen.
> 
> Hi,
> 
> Thanks for the update patch.
> 
> At 15:36 -0500 on 07 Nov (1352302577), Robert Phillips wrote:
> > > More substantive comments:
> > >  - I think the dirty_vram.c and dirty_vram.h files belong under mm/
> > >    rather than under hvm/.  The ``#include "../mm/mm-locks.h"'' is
> > >    an indicator that this is really MM code.
> >
> > I have moved dirty_vram.c under mm/
> > I have moved dirty_vram.h under include/asm-x86 .  In that location it
> > is available to modules like hvm.c
> 
> Sure, that seems sgood.
> 
> > > I'd be
> > > inclined to just put all paddr_links in the linked list (and have an
> > > array of pointers rather than an array of paddr_link_ts).  Is it worth
> > > having the extra complexity here, and at the callers, to avoid a single
> > > memory read?
> >
> > Almost all frame buffer pages have a single mapping so the algorithm's
> > common case is met by constructing pl_tab as an array of paddr_links.
> > That is, the table's paddr_links will rarely point to a chain of
> > extension paddr_links.  The code encapsulates the complexity in a
> > single function.  Sorry it required so much staring.  Even if all
> > paddr_links were stored in a linked list, the caller would have to
> > walk that linked list, so would be just as complex.
> 
> OK.
> 
> > > > +        if (set)
> > > > +        {
> > > > +            /* Did we find sl1ma in either the main table or the linked list? */
> > > > +            if (pl == NULL) /* no, so we'll need to alloc a link */
> > > > +            {
> > > > +                ASSERT(ppl != NULL);
> > > > +                /* alloc link and append it to list */
> > > > +                (*ppl) = pl = alloc_paddr_link(d);
> > > > +                if (pl == NULL)
> > > > +                    goto out;
> > >
> > > This needs to signal some sort of error.  Otherwise, if we can't add
> > > this sl1e to the list we'll just silently fail to track it.
> >
> > I don't know what sort of error we can signal.
> >
> > The immediate symptom would be that areas of the monitor would not be
> > refreshed.  But, since we're running out of memory, that might be the
> > least of the quests's woes.  The updated patch actually makes the
> > symptom more likely (though still very unlikely) by putting an
> > arbitrary bound on the length of paddr_link chains.  It handles a
> > rogue process, one that has an arbitrarily large number of mappings
> > for frame buffer pages, by simply not recording the excessive
> > mappings.  If that results in unrefreshed blocks on the monitor, so be
> > it.
> 
> I think the correct behaviour would be to report these pages as dirty.
> That way anything that relies on seeing all changes will behave
> correctly, though less efficiently.

Ok, I've associated a boolean called "stuck_dirty" with each frame buffer page.
If for any reason we're unable to generated a complete set of mappings,
the bit gets set and that frame buffer page is considered dirty forever more,
or until the range gets torn down.

I was unable to make a failure happen (not surprisingly) so I added some
fault injection code for testing.  It's currently disabled/compiled-out.

> 
> > > > +#endif
> > > > +                free_paddr_link(d, ppl, pl);
> > > > +                if ( --range->nr_mappings == 0 )
> > > > +                {
> > > > +                    dirty_vram_range_free(d, range);
> > >
> > > What's this for?  If the guest unmaps the framebuffer and remaps it (or
> > > if the shadow PTs of the mappings are temporarily discarded) this will
> > > stop us from tracking the new mappings until the toolstack asks for the
> > > bitmap (and then it will be expensive to go and find the mappings).
> > >
> >
> > I don't see this happening.  If the guest unmaps the framebuffer, the
> > shadow code lazily recovers the shadow pages, so tracking will
> > continue until it decides a page is no longer a shadow page.  That is
> > when this code is invoked.
> 
> If the guest unmaps the buffer by clearing the PTEs then when the PTE
> changes are propagated into the shadows this will cause nr_mappings to
> fall to zero here.  If we _don't_ free the range, then when the FB is
> mapped again we'll spot the new PTEs as they're shadowed and DTRT.  If we
> _do_ free the range we end up walking all shadows looking for the
> mappings.
> 

Ok, I've removed the teardown code.  Ranges are no longer torn down
just because they have no mappings.  But they can still be torn down
if another mapping is created, one that overlaps, or if dirty vram 
bookkeeping is stopped altogether, which happens as a side-effect
of requesting a range with zero pages.

> > It tears down the mappings to that page and if some range ends up
> > with no mappings then the range is useless.  Vram ranges are generated
> > willy-nilly as needed.  This is the only mechanism for cleaning them up.
> 
> Shouldn't there be some way for the tools to indicate that they're done
> with a range?  I guess they can tear down the whole lot and then start
> again with whatever ranges are still in use.

Right.  Like little children, they do not clean up after themselves.

> 
> > > Oughtn't we to return all 1s in the bitmap here?  If the range isn't
> > > currently being tracked we should conservatively assume it's all dirty,
> > > right?
> >
> > The callers will should ensure that the range exists.  This is just a
> > conservative test.
> 
> OK.
> 
> > Anyway, it begs the question of whether a new range should be
> > considered all dirty or all clean.  Intuitively "all dirty" seems the
> > right answer but in practice it works fine as written since the guest
> > is busy updating the whole frame buffer.
> 
> What if the guest's not writing to the framebuffer at the moment, or
> only to a part of it?  Shouldn't the tools see the existing content?

Ok, in HAP a new range is considered to be "all dirty".

> 
> > > And, since you know you're in HAP mode, not in log-dirty mode, and
> > > already have the paging lock, you can just set
> > > d->arch.paging.mode |= PG_log_dirty there rather than jumping through
> > > the paging_log_dirty_enable() path and messing with locks.
> >
> > No, paging_log_dirty_enable() goes through several layers of functions and
> > ends up calling hap_enable_vram_tracking(), which does quite a bit of
> stuff.
> 
> OK.
> 
> > > > +/* paging_mark_dirty_hap()
> > > > + * Make a hap page writeable and mark it as dirty.
> > > > + * This done atomically under the p2m and paging locks to avoid
> leaving
> > > > + * a window where the page might be modified without being marked
> as
> > > dirty.
> > > > + */
> > >
> > > I'm perplexed by this -- AFAICT it's either not necessary (because all
> > > log-dirty read/clean ops are done with the domain paused) or not
> sufficient
> > > (because although the bitmap and the PTE are updated under the p2m
> lock,
> > > the actual dirtying of the page happens at some other time).  Can you
> > > spell out for me exactly what this is protecting against?
> >
> > The comment over-stated the problem so I've toned it down
> > from "without being marked" to "without being counted".
> >
> > paging_mark_dirty_hap() is in the page fault path and has two steps:
> >
> > (1) It calls p2m_change_type() to re-mark some pfn as writeable
> >     (i.e. p2m_ram_rw), which is a no-op if the pfn is already writeable.
> >     This must be done under the p2m_lock.
> >
> > (2) If the pfn was previously read-only (i.e. p2m_ram_logdirty) then
> >     it bumps two dirty counts.  And it marks the page as dirty.  This must
> >     be done under the paging lock.
> >
> > As an invariant, the dirty counts should be precisely the number of pages
> > made writeable.
> 
> That invariant is already doomed -- any other agent (including the guest
> itself) can change the p2m mappings for one of the pfns, or mark the pfn
> dirty, without going through the NPF fault handler.  AFAICS the counts
> could just as well be implemented as flags, to say 'something in this
> range was dirtied'; the only interesting case is when they're 0.
> 
> > It may be that this invariant is not particularly useful, that things
> > will just work out.  But I do wonder if, without it, we'll have
> > situations where the dirty counts will indicate dirty pages when there
> > are none, or no dirty pages when there are some.
> 
> The second of those cases would be the bad one; I think that can be
> avoided by just switching the order of paging_mark_dirty() and
> p2m_change_type() in hvm_hap_nested_page_fault(), and maybe putting a
> wmb() between them.

Ok, I've done as you suggested.  I don't think the wmb() is needed
but I could be convinced.

> 
> Cheers,
> 
> Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 21:32:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 21:32:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY1c9-00048Q-AC; Mon, 12 Nov 2012 21:32:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <robert.phillips@citrix.com>) id 1TY1c7-00048L-4D
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 21:32:15 +0000
Received: from [85.158.143.35:20331] by server-2.bemta-4.messagelabs.com id
	FA/2F-28922-EDA61A05; Mon, 12 Nov 2012 21:32:14 +0000
X-Env-Sender: robert.phillips@citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1352755932!14616307!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMwMDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11981 invoked from network); 12 Nov 2012 21:32:13 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 21:32:13 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="44332992"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	12 Nov 2012 21:32:01 +0000
Received: from FTLPMAILBOX02.citrite.net ([10.13.98.209]) by
	FTLPMAILMX02.citrite.net ([10.13.107.66]) with mapi; Mon, 12 Nov 2012
	16:32:02 -0500
From: Robert Phillips <robert.phillips@citrix.com>
To: "Tim (Xen.org)" <tim@xen.org>
Date: Mon, 12 Nov 2012 16:31:58 -0500
Thread-Topic: [Xen-devel] [PATCH] Provide support for multiple frame buffers
	in Xen.
Thread-Index: Ac29tISgskj15PbzRniL91JPgz0BOQDZuVjA
Message-ID: <048EAD622912254A9DEA24C1734613C18C87A62327@FTLPMAILBOX02.citrite.net>
References: <1350411302-5470-1-git-send-email-robert.phillips@citrix.com>
	<20121101142434.GC61948@ocelot.phlegethon.org>
	<048EAD622912254A9DEA24C1734613C18C876560B1@FTLPMAILBOX02.citrite.net>
	<20121108132522.GG76638@ocelot.phlegethon.org>
In-Reply-To: <20121108132522.GG76638@ocelot.phlegethon.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
 in Xen.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

I'm sending version 3 of the patch shortly.  I think it addresses all your concerns.

> -----Original Message-----
> From: Tim Deegan [mailto:tim@xen.org]
> Sent: Thursday, November 08, 2012 8:25 AM
> To: Robert Phillips
> Cc: xen-devel@lists.xen.org
> Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
> in Xen.
> 
> Hi,
> 
> Thanks for the update patch.
> 
> At 15:36 -0500 on 07 Nov (1352302577), Robert Phillips wrote:
> > > More substantive comments:
> > >  - I think the dirty_vram.c and dirty_vram.h files belong under mm/
> > >    rather than under hvm/.  The ``#include "../mm/mm-locks.h"'' is
> > >    an indicator that this is really MM code.
> >
> > I have moved dirty_vram.c under mm/
> > I have moved dirty_vram.h under include/asm-x86 .  In that location it
> > is available to modules like hvm.c
> 
> Sure, that seems sgood.
> 
> > > I'd be
> > > inclined to just put all paddr_links in the linked list (and have an
> > > array of pointers rather than an array of paddr_link_ts).  Is it worth
> > > having the extra complexity here, and at the callers, to avoid a single
> > > memory read?
> >
> > Almost all frame buffer pages have a single mapping so the algorithm's
> > common case is met by constructing pl_tab as an array of paddr_links.
> > That is, the table's paddr_links will rarely point to a chain of
> > extension paddr_links.  The code encapsulates the complexity in a
> > single function.  Sorry it required so much staring.  Even if all
> > paddr_links were stored in a linked list, the caller would have to
> > walk that linked list, so would be just as complex.
> 
> OK.
> 
> > > > +        if (set)
> > > > +        {
> > > > +            /* Did we find sl1ma in either the main table or the linked list? */
> > > > +            if (pl == NULL) /* no, so we'll need to alloc a link */
> > > > +            {
> > > > +                ASSERT(ppl != NULL);
> > > > +                /* alloc link and append it to list */
> > > > +                (*ppl) = pl = alloc_paddr_link(d);
> > > > +                if (pl == NULL)
> > > > +                    goto out;
> > >
> > > This needs to signal some sort of error.  Otherwise, if we can't add
> > > this sl1e to the list we'll just silently fail to track it.
> >
> > I don't know what sort of error we can signal.
> >
> > The immediate symptom would be that areas of the monitor would not be
> > refreshed.  But, since we're running out of memory, that might be the
> > least of the quests's woes.  The updated patch actually makes the
> > symptom more likely (though still very unlikely) by putting an
> > arbitrary bound on the length of paddr_link chains.  It handles a
> > rogue process, one that has an arbitrarily large number of mappings
> > for frame buffer pages, by simply not recording the excessive
> > mappings.  If that results in unrefreshed blocks on the monitor, so be
> > it.
> 
> I think the correct behaviour would be to report these pages as dirty.
> That way anything that relies on seeing all changes will behave
> correctly, though less efficiently.

Ok, I've associated a boolean called "stuck_dirty" with each frame buffer page.
If for any reason we're unable to generated a complete set of mappings,
the bit gets set and that frame buffer page is considered dirty forever more,
or until the range gets torn down.

I was unable to make a failure happen (not surprisingly) so I added some
fault injection code for testing.  It's currently disabled/compiled-out.

> 
> > > > +#endif
> > > > +                free_paddr_link(d, ppl, pl);
> > > > +                if ( --range->nr_mappings == 0 )
> > > > +                {
> > > > +                    dirty_vram_range_free(d, range);
> > >
> > > What's this for?  If the guest unmaps the framebuffer and remaps it (or
> > > if the shadow PTs of the mappings are temporarily discarded) this will
> > > stop us from tracking the new mappings until the toolstack asks for the
> > > bitmap (and then it will be expensive to go and find the mappings).
> > >
> >
> > I don't see this happening.  If the guest unmaps the framebuffer, the
> > shadow code lazily recovers the shadow pages, so tracking will
> > continue until it decides a page is no longer a shadow page.  That is
> > when this code is invoked.
> 
> If the guest unmaps the buffer by clearing the PTEs then when the PTE
> changes are propagated into the shadows this will cause nr_mappings to
> fall to zero here.  If we _don't_ free the range, then when the FB is
> mapped again we'll spot the new PTEs as they're shadowed and DTRT.  If we
> _do_ free the range we end up walking all shadows looking for the
> mappings.
> 

Ok, I've removed the teardown code.  Ranges are no longer torn down
just because they have no mappings.  But they can still be torn down
if another mapping is created, one that overlaps, or if dirty vram 
bookkeeping is stopped altogether, which happens as a side-effect
of requesting a range with zero pages.

> > It tears down the mappings to that page and if some range ends up
> > with no mappings then the range is useless.  Vram ranges are generated
> > willy-nilly as needed.  This is the only mechanism for cleaning them up.
> 
> Shouldn't there be some way for the tools to indicate that they're done
> with a range?  I guess they can tear down the whole lot and then start
> again with whatever ranges are still in use.

Right.  Like little children, they do not clean up after themselves.

> 
> > > Oughtn't we to return all 1s in the bitmap here?  If the range isn't
> > > currently being tracked we should conservatively assume it's all dirty,
> > > right?
> >
> > The callers will should ensure that the range exists.  This is just a
> > conservative test.
> 
> OK.
> 
> > Anyway, it begs the question of whether a new range should be
> > considered all dirty or all clean.  Intuitively "all dirty" seems the
> > right answer but in practice it works fine as written since the guest
> > is busy updating the whole frame buffer.
> 
> What if the guest's not writing to the framebuffer at the moment, or
> only to a part of it?  Shouldn't the tools see the existing content?

Ok, in HAP a new range is considered to be "all dirty".

> 
> > > And, since you know you're in HAP mode, not in log-dirty mode, and
> > > already have the paging lock, you can just set
> > > d->arch.paging.mode |= PG_log_dirty there rather than jumping through
> > > the paging_log_dirty_enable() path and messing with locks.
> >
> > No, paging_log_dirty_enable() goes through several layers of functions and
> > ends up calling hap_enable_vram_tracking(), which does quite a bit of
> stuff.
> 
> OK.
> 
> > > > +/* paging_mark_dirty_hap()
> > > > + * Make a hap page writeable and mark it as dirty.
> > > > + * This done atomically under the p2m and paging locks to avoid
> leaving
> > > > + * a window where the page might be modified without being marked
> as
> > > dirty.
> > > > + */
> > >
> > > I'm perplexed by this -- AFAICT it's either not necessary (because all
> > > log-dirty read/clean ops are done with the domain paused) or not
> sufficient
> > > (because although the bitmap and the PTE are updated under the p2m
> lock,
> > > the actual dirtying of the page happens at some other time).  Can you
> > > spell out for me exactly what this is protecting against?
> >
> > The comment over-stated the problem so I've toned it down
> > from "without being marked" to "without being counted".
> >
> > paging_mark_dirty_hap() is in the page fault path and has two steps:
> >
> > (1) It calls p2m_change_type() to re-mark some pfn as writeable
> >     (i.e. p2m_ram_rw), which is a no-op if the pfn is already writeable.
> >     This must be done under the p2m_lock.
> >
> > (2) If the pfn was previously read-only (i.e. p2m_ram_logdirty) then
> >     it bumps two dirty counts.  And it marks the page as dirty.  This must
> >     be done under the paging lock.
> >
> > As an invariant, the dirty counts should be precisely the number of pages
> > made writeable.
> 
> That invariant is already doomed -- any other agent (including the guest
> itself) can change the p2m mappings for one of the pfns, or mark the pfn
> dirty, without going through the NPF fault handler.  AFAICS the counts
> could just as well be implemented as flags, to say 'something in this
> range was dirtied'; the only interesting case is when they're 0.
> 
> > It may be that this invariant is not particularly useful, that things
> > will just work out.  But I do wonder if, without it, we'll have
> > situations where the dirty counts will indicate dirty pages when there
> > are none, or no dirty pages when there are some.
> 
> The second of those cases would be the bad one; I think that can be
> avoided by just switching the order of paging_mark_dirty() and
> p2m_change_type() in hvm_hap_nested_page_fault(), and maybe putting a
> wmb() between them.

Ok, I've done as you suggested.  I don't think the wmb() is needed
but I could be convinced.

> 
> Cheers,
> 
> Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 21:32:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 21:32:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY1cC-000490-SA; Mon, 12 Nov 2012 21:32:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <robert.phillips@citrix.com>) id 1TY1cB-00048L-Bm
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 21:32:19 +0000
Received: from [85.158.143.35:25106] by server-2.bemta-4.messagelabs.com id
	59/3F-28922-3EA61A05; Mon, 12 Nov 2012 21:32:19 +0000
X-Env-Sender: robert.phillips@citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1352755932!14616307!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMwMDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12006 invoked from network); 12 Nov 2012 21:32:15 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 21:32:15 -0000
X-SBRS: -2.2
X-MesageID: 44332997
X-Ironport-Server: ftlpip01.citrite.net
X-Remote-IP: 75.150.106.249
X-Policy: $Relay
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="44332997"
Received: from 75-150-106-249-newengland.hfc.comcastbusiness.net (HELO
	paine.oldroadcomputing.net) ([75.150.106.249])
	by SMTP.CITRIX.COM with ESMTP; 12 Nov 2012 21:32:03 +0000
From: Robert Phillips <robert.phillips@citrix.com>
To: xen-devel@lists.xen.org
Date: Mon, 12 Nov 2012 16:31:53 -0500
Message-Id: <1352755913-4229-1-git-send-email-robert.phillips@citrix.com>
X-Mailer: git-send-email 1.7.9.5
Cc: Robert Phillips <robert.phillips@citrix.com>
Subject: [Xen-devel] [PATCH] Provide support for multiple frame buffers in
	Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Support is provided for both shadow and hardware assisted paging (HAP) modes.
This code bookkeeps the set of video frame buffers (vram),
detects when the guest has modified any of those buffers and, upon request,
returns a bitmap of the modified pages.
This lets other software components re-paint the portions of the monitor (or monitors) that have changed.
Each monitor has a frame buffer of some size at some position in guest physical memory.
The set of frame buffers being tracked can change over time as monitors are plugged and unplugged.
(Version 3 of this patch.)

Signed-Off-By: Robert Phillips <robert.phillips@citrix.com>
---
 tools/libxc/xenctrl.h            |   17 +-
 xen/arch/x86/hvm/Makefile        |    2 +-
 xen/arch/x86/hvm/hvm.c           |   16 +-
 xen/arch/x86/mm/Makefile         |    1 +
 xen/arch/x86/mm/dirty_vram.c     |  992 ++++++++++++++++++++++++++++++++++++++
 xen/arch/x86/mm/hap/hap.c        |  140 +-----
 xen/arch/x86/mm/paging.c         |  196 ++------
 xen/arch/x86/mm/shadow/common.c  |  335 +++++++------
 xen/arch/x86/mm/shadow/multi.c   |  174 +++----
 xen/arch/x86/mm/shadow/multi.h   |    7 +-
 xen/arch/x86/mm/shadow/types.h   |    1 +
 xen/include/asm-x86/dirty_vram.h |  201 ++++++++
 xen/include/asm-x86/hap.h        |    4 -
 xen/include/asm-x86/hvm/domain.h |    2 +-
 xen/include/asm-x86/paging.h     |   17 +-
 xen/include/asm-x86/shadow.h     |    6 -
 16 files changed, 1549 insertions(+), 562 deletions(-)
 create mode 100644 xen/arch/x86/mm/dirty_vram.c
 create mode 100644 xen/include/asm-x86/dirty_vram.h

diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..693d7fe 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -1552,15 +1552,20 @@ int xc_hvm_inject_msi(
     xc_interface *xch, domid_t dom, uint64_t addr, uint32_t data);
 
 /*
- * Track dirty bit changes in the VRAM area
+ * Track dirty bit changes in a VRAM region defined by
+ * [ first_pfn : first_pfn + nr - 1 ]
  *
  * All of this is done atomically:
- * - get the dirty bitmap since the last call
- * - set up dirty tracking area for period up to the next call
- * - clear the dirty tracking area.
+ * - gets the dirty bitmap since the last call, all zeroes for
+ *   the first call with some new region
+ * - sets up a dirty tracking region for period up to the next call
+ * - clears the specified dirty tracking region.
  *
- * Returns -ENODATA and does not fill bitmap if the area has changed since the
- * last call.
+ * Creating a new region causes any existing regions that it overlaps
+ * to be discarded.
+ *
+ * Specifying nr == 0 causes all regions to be discarded and
+ * disables dirty bit tracking.
  */
 int xc_hvm_track_dirty_vram(
     xc_interface *xch, domid_t dom,
diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile
index eea5555..e374aac 100644
--- a/xen/arch/x86/hvm/Makefile
+++ b/xen/arch/x86/hvm/Makefile
@@ -22,4 +22,4 @@ obj-y += vlapic.o
 obj-y += vmsi.o
 obj-y += vpic.o
 obj-y += vpt.o
-obj-y += vpmu.o
\ No newline at end of file
+obj-y += vpmu.o
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 34da2f5..3a3e5e4 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -57,6 +57,7 @@
 #include <asm/hvm/cacheattr.h>
 #include <asm/hvm/trace.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/dirty_vram.h>
 #include <asm/mtrr.h>
 #include <asm/apic.h>
 #include <public/sched.h>
@@ -66,6 +67,7 @@
 #include <asm/mem_event.h>
 #include <asm/mem_access.h>
 #include <public/mem_event.h>
+#include "../mm/mm-locks.h"
 
 bool_t __read_mostly hvm_enabled;
 
@@ -1433,8 +1435,20 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
          */
         if ( access_w )
         {
+            p2m_type_t pt;
+            pt = p2m_change_type(v->domain, gfn, p2m_ram_logdirty, p2m_ram_rw);
+            
+            paging_lock(v->domain);
+            if ( pt == p2m_ram_logdirty )
+            {
+                dv_range_t *range;
+                v->domain->arch.paging.log_dirty.dirty_count++;
+                range = dirty_vram_range_find_gfn(v->domain, gfn);
+                if ( range )
+                    range->dirty_count++;
+            }
             paging_mark_dirty(v->domain, mfn_x(mfn));
-            p2m_change_type(v->domain, gfn, p2m_ram_logdirty, p2m_ram_rw);
+            paging_unlock(v->domain);
         }
         rc = 1;
         goto out_put_gfn;
diff --git a/xen/arch/x86/mm/Makefile b/xen/arch/x86/mm/Makefile
index 73dcdf4..becd0c9 100644
--- a/xen/arch/x86/mm/Makefile
+++ b/xen/arch/x86/mm/Makefile
@@ -5,6 +5,7 @@ obj-y += paging.o
 obj-y += p2m.o p2m-pt.o p2m-ept.o p2m-pod.o
 obj-y += guest_walk_2.o
 obj-y += guest_walk_3.o
+obj-y += dirty_vram.o
 obj-$(x86_64) += guest_walk_4.o
 obj-$(x86_64) += mem_event.o
 obj-$(x86_64) += mem_paging.o
diff --git a/xen/arch/x86/mm/dirty_vram.c b/xen/arch/x86/mm/dirty_vram.c
new file mode 100644
index 0000000..e3c7c1f
--- /dev/null
+++ b/xen/arch/x86/mm/dirty_vram.c
@@ -0,0 +1,992 @@
+/*
+ * arch/x86/mm/dirty_vram.c: Bookkeep/query dirty VRAM pages
+ * with support for multiple frame buffers.
+ *
+ * Copyright (c) 2012, Citrix Systems, Inc. (Robert Phillips)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+
+#include <xen/types.h>
+#include <xen/sched.h>
+#include <xen/guest_access.h>
+#include <asm/shadow.h>
+#include <asm/dirty_vram.h>
+#include "mm-locks.h"
+
+#define DEBUG_stop_tracking_all_vram          0
+#define DEBUG_allocating_dirty_vram_range     0
+#define DEBUG_high_water_mark_for_vram_ranges 0
+#define DEBUG_freeing_dirty_vram_range        0
+#define DEBUG_allocate_paddr_links_page       0
+#define DEBUG_update_vram_mapping             0
+#define DEBUG_alloc_paddr_inject_fault        0
+
+/* Allocates domain's dirty_vram structure */
+dv_dirty_vram_t *
+dirty_vram_alloc(struct domain *d)
+{
+    dv_dirty_vram_t *dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    dirty_vram = d->arch.hvm_domain.dirty_vram = xzalloc(dv_dirty_vram_t);
+    if ( dirty_vram )
+    {
+        INIT_LIST_HEAD(&dirty_vram->range_head);
+        INIT_LIST_HEAD(&dirty_vram->ext_head);
+    }
+    return dirty_vram;
+}
+
+/*
+ * Returns domain's dirty_vram structure,
+ * allocating it if necessary
+ */
+dv_dirty_vram_t *
+dirty_vram_find_or_alloc(struct domain *d)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( !dirty_vram )
+        dirty_vram = dirty_vram_alloc(d);
+    return dirty_vram;
+}
+
+
+/* Free domain's dirty_vram structure */
+void dirty_vram_free(struct domain *d)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        struct list_head *curr, *next;
+        /* Free all the ranges */
+        list_for_each_safe(curr, next, &dirty_vram->range_head)
+        {
+            dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+#if DEBUG_stop_tracking_all_vram
+            gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] stop tracking all vram\n",
+                     range->begin_pfn, range->end_pfn);
+#endif
+            xfree(range->pl_tab);
+            xfree(range);
+        }
+        /* Free all the extension pages */
+        list_for_each_safe(curr, next, &dirty_vram->ext_head)
+        {
+            struct dv_paddr_link_ext *ext =
+                container_of(
+                    curr, struct dv_paddr_link_ext, ext_link);
+            struct page_info *pg = __virt_to_page(ext);
+            d->arch.paging.free_page(d, pg);
+        }
+
+        xfree(dirty_vram);
+        d->arch.hvm_domain.dirty_vram = NULL;
+    }
+}
+
+/* Returns dirty vram range containing gfn, NULL if none */
+struct dv_range *
+dirty_vram_range_find_gfn(struct domain *d,
+                          unsigned long gfn)
+{
+    struct dv_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        struct list_head *curr;
+        list_for_each(curr, &dirty_vram->range_head)
+        {
+            dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+            if ( gfn >= range->begin_pfn &&
+                 gfn <  range->end_pfn )
+                return range;
+        }
+    }
+    return NULL;
+}
+
+/*
+ * Returns pointer to dirty vram range matching [begin_pfn .. end_pfn ),
+ * NULL if none.
+ */
+dv_range_t *
+dirty_vram_range_find(struct domain *d,
+                      unsigned long begin_pfn,
+                      unsigned long nr)
+{
+    unsigned long end_pfn = begin_pfn + nr;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        struct list_head *curr;
+        list_for_each(curr, &dirty_vram->range_head)
+        {
+            dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+            if ( begin_pfn == range->begin_pfn &&
+                 end_pfn   == range->end_pfn )
+                return range;
+        }
+    }
+    return NULL;
+}
+
+/* Allocate specified dirty_vram range */
+static dv_range_t *
+_dirty_vram_range_alloc(struct domain *d,
+                        unsigned long begin_pfn,
+                        unsigned long nr)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_range_t *range = NULL;
+    unsigned long end_pfn = begin_pfn + nr;
+    dv_pl_entry_t *pl_tab = NULL;
+    int i;
+
+    ASSERT( paging_locked_by_me(d) );
+    ASSERT( dirty_vram != NULL );
+
+#if DEBUG_allocating_dirty_vram_range
+    gdprintk(XENLOG_DEBUG,
+             "[%05lx:%05lx] Allocating dirty vram range hap:%d\n",
+             begin_pfn, end_pfn,
+             d->arch.hvm_domain.hap_enabled);
+#endif
+
+    range = xzalloc(dv_range_t);
+    if ( range == NULL )
+        goto err_out;
+
+    INIT_LIST_HEAD(&range->range_link);
+
+    range->begin_pfn = begin_pfn;
+    range->end_pfn = end_pfn;
+
+    if ( !hap_enabled(d) )
+    {
+        if ( (pl_tab = xzalloc_array(dv_pl_entry_t, nr)) == NULL )
+            goto err_out;
+
+        for ( i = 0; i != nr; i++ )
+        {
+            pl_tab[i].mapping.sl1ma = INVALID_PADDR;
+        }
+    }
+
+    range->pl_tab = pl_tab;
+    range->mappings_hwm = 1;
+
+    list_add(&range->range_link, &dirty_vram->range_head);
+    if ( ++dirty_vram->nr_ranges > dirty_vram->ranges_hwm )
+    {
+        dirty_vram->ranges_hwm = dirty_vram->nr_ranges;
+#if DEBUG_high_water_mark_for_vram_ranges
+        gdprintk(XENLOG_DEBUG,
+                 "High water mark for number of vram ranges is now:%d\n",
+                 dirty_vram->ranges_hwm);
+#endif
+    }
+    return range;
+
+ err_out:
+    xfree(pl_tab);
+    xfree(range);
+    return NULL;
+}
+
+
+/* Frees specified dirty_vram range */
+void dirty_vram_range_free(struct domain *d,
+                           dv_range_t *range)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        int i, nr = range->end_pfn - range->begin_pfn;
+
+#if DEBUG_freeing_dirty_vram_range
+        gdprintk(XENLOG_DEBUG,
+                 "[%05lx:%05lx] Freeing dirty vram range\n",
+                 range->begin_pfn, range->end_pfn);
+#endif
+
+        if ( range->pl_tab )
+        {
+            for ( i = 0; i != nr; i++ )
+            {
+                dv_paddr_link_t *plx;
+                plx = range->pl_tab[i].mapping.pl_next;
+                /* Does current FB page have multiple mappings? */
+                if ( plx ) /* yes */
+                {
+                    /* Find the last element in singly-linked list */
+                    while ( plx->pl_next != NULL )
+                        plx = plx->pl_next;
+                    
+                    /* Prepend whole list to the free list */
+                    plx->pl_next = dirty_vram->pl_free;
+                    dirty_vram->pl_free = range->pl_tab[i].mapping.pl_next;
+                }
+            }
+            xfree(range->pl_tab);
+            range->pl_tab = NULL;
+        }
+
+        /* Remove range from the linked list, free it, and adjust count*/
+        list_del(&range->range_link);
+        xfree(range);
+        dirty_vram->nr_ranges--;
+    }
+}
+
+/*
+ * dirty_vram_range_alloc()
+ * This function ensures that the new range does not overlap any existing
+ * ranges -- deleting them if necessary -- and then calls
+ * _dirty_vram_range_alloc to actually allocate the new range.
+ */
+dv_range_t *
+dirty_vram_range_alloc(struct domain *d,
+                        unsigned long begin_pfn,
+                        unsigned long nr)
+{
+    unsigned long end_pfn = begin_pfn + nr;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_range_t *range;
+    struct list_head *curr, *next;
+
+    ASSERT( paging_locked_by_me(d) );
+    ASSERT( dirty_vram != NULL );
+
+    /*
+     * Ranges cannot overlap so
+     * free any range that overlaps [ begin_pfn .. end_pfn )
+     */
+    list_for_each_safe(curr, next, &dirty_vram->range_head)
+    {
+        dv_range_t *rng = list_entry(curr, dv_range_t, range_link);
+        if ( ( ( rng->begin_pfn <= begin_pfn ) &&
+               ( begin_pfn <  rng->end_pfn   )
+                 ) ||
+             ( ( begin_pfn <= rng->begin_pfn ) &&
+               ( rng->begin_pfn < end_pfn    )
+                 ) )
+        {
+            /* Different tracking, tear the previous down. */
+            dirty_vram_range_free(d, rng);
+        }
+    }
+
+    range = _dirty_vram_range_alloc(d, begin_pfn, nr);
+    if ( !range )
+        goto out;
+
+ out:
+    return range;
+}
+
+/*
+ * dirty_vram_range_find_or_alloc()
+ * Find the range for [begin_pfn:begin_pfn+nr).
+ * If it doesn't exists, create it.
+ */
+dv_range_t *
+dirty_vram_range_find_or_alloc(struct domain *d,
+                                unsigned long begin_pfn,
+                                unsigned long nr)
+{
+    dv_range_t *range;
+    ASSERT( paging_locked_by_me(d) );
+    range = dirty_vram_range_find(d, begin_pfn, nr);
+    if ( !range )
+        range = dirty_vram_range_alloc(d, begin_pfn, nr);
+    
+    return range;
+}
+
+
+
+/* Allocate a dv_paddr_link struct */
+static dv_paddr_link_t *
+alloc_paddr_link(struct domain *d)
+{
+    dv_paddr_link_t * pl = NULL;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+
+    ASSERT( paging_locked_by_me(d) );
+    BUILD_BUG_ON(sizeof(dv_paddr_link_ext_t) > PAGE_SIZE);
+    /* Is the list of free pl's empty? */
+    if ( dirty_vram->pl_free == NULL ) /* yes */
+    {
+        /*
+         * Allocate another page of pl's.
+         * Link them all together and point the free list head at them
+         */
+        int i;
+        struct page_info *pg = d->arch.paging.alloc_page(d);
+        dv_paddr_link_ext_t *ext = __page_to_virt(pg);
+        if ( ext == NULL )
+            goto out;
+
+#if DEBUG_allocate_paddr_links_page
+        gdprintk(XENLOG_DEBUG, "Allocated another page of paddr_links\n");
+#endif
+        list_add(&ext->ext_link, &dirty_vram->ext_head);
+
+        /* initialize and link together the new pl entries */
+        for ( i = 0; i != ARRAY_SIZE(ext->entries); i++ )
+        {
+            ext->entries[i].sl1ma = INVALID_PADDR;
+            ext->entries[i].pl_next = &ext->entries[i+1];
+        }
+        ext->entries[ARRAY_SIZE(ext->entries) - 1].pl_next = NULL;
+        dirty_vram->pl_free = &ext->entries[0];
+    }
+    pl = dirty_vram->pl_free;
+    dirty_vram->pl_free = pl->pl_next;
+
+    pl->sl1ma = INVALID_PADDR;
+    pl->pl_next = NULL;
+ out:
+    return pl;
+}
+
+
+/*
+ * Free a paddr_link struct.
+ *
+ * The caller has walked the singly-linked list of elements
+ * that have, as their head, an element in a pl_tab cell.
+ * The list walks has reached the element to be freed.
+ * (Each element is a dv_paddr_link_t struct.)
+ *
+ * @pl points to the element to be freed.
+ * @ppl points to its predecessor element's next member.
+ *
+ * After linking the precessor to the element's successor,
+ * we can free @pl by prepending it to the list of free
+ * elements.
+ *
+ * As a boundary case (which happens to be the common case),
+ * @pl points to a cell in the pl_tab rather than to some
+ * extension element danging from that cell.
+ * We recognize this case because @ppl is NULL.
+ * In that case we promote the first extension element by
+ * copying it into the pl_tab cell and free it.
+ */
+
+dv_paddr_link_t *
+free_paddr_link(struct domain *d,
+                dv_paddr_link_t **ppl,
+                dv_paddr_link_t *pl)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_paddr_link_t *npl; /* next pl */
+
+    ASSERT( paging_locked_by_me(d) );
+    /* extension mapping? */
+    if ( ppl ) /* yes. free it */
+    {
+        ASSERT(pl == (*ppl));
+        (*ppl) = npl = pl->pl_next;
+    }
+    else  /* main table */
+    {
+        /*
+         * move 2nd mapping to main table.
+         * and free 2nd mapping
+         */
+        dv_paddr_link_t * spl;
+        spl = pl->pl_next;
+        if ( spl == NULL )
+        {
+            pl->sl1ma = INVALID_PADDR;
+            return pl;
+        }
+        pl->sl1ma = spl->sl1ma;
+        pl->pl_next = spl->pl_next;
+        npl = pl; /* reprocess main table entry again */
+        pl = spl;
+    }
+    pl->sl1ma = INVALID_PADDR;
+    pl->pl_next = dirty_vram->pl_free;
+    dirty_vram->pl_free = pl;
+    return npl;
+}
+
+
+/*
+ * dirty_vram_range_update()
+ *
+ * This is called whenever a level 1 page table entry is modified.
+ * If the L1PTE is being cleared, the function removes any paddr_links
+ * that refer to it.
+ * If the L1PTE is being set to a frame buffer page, a paddr_link is
+ * created for that page's entry in pl_tab.
+ * Returns 1 iff entry found and set or cleared.
+ */
+int dirty_vram_range_update(struct domain *d,
+                            unsigned long gfn,
+                            paddr_t sl1ma,
+                            int set)
+{
+    int effective = 0;
+    dv_range_t *range;
+    unsigned long i;
+    dv_paddr_link_t *pl;
+    dv_paddr_link_t **ppl;
+    int len = 0;
+
+    ASSERT(paging_locked_by_me(d));
+    range = dirty_vram_range_find_gfn(d, gfn);
+    if ( !range )
+        return effective;
+
+    
+    i = gfn - range->begin_pfn;
+    pl = &range->pl_tab[ i ].mapping;
+    ppl = NULL;
+
+    /*
+     * find matching entry (pl), if any, and its predecessor
+     * in linked list (ppl)
+     */
+    while ( pl != NULL )
+    {
+        if ( pl->sl1ma == sl1ma || pl->sl1ma == INVALID_PADDR )
+            break;
+            
+        ppl = &pl->pl_next;
+        pl = *ppl;
+        len++;
+    }
+
+    if ( set )
+    {
+        /* Did we find sl1ma in either the main table or the linked list? */
+        if ( pl == NULL ) /* no, so we'll need to alloc a link */
+        {
+            ASSERT(ppl != NULL);
+            
+#if DEBUG_alloc_paddr_inject_fault
+            {
+                static int counter;
+                
+                /* Test stuck_dirty logic for some cases */
+                if ( (++counter) % 4 == 0 )
+                {
+                    /* Simply mark the frame buffer page as always dirty */
+                    range->pl_tab[ i ].stuck_dirty = 1;
+                    gdprintk(XENLOG_DEBUG,
+                             "[%lx] inject stuck dirty fault\n",
+                             gfn );
+                    goto out;
+                }
+            }
+#endif
+            /*
+             * Have we reached the limit of mappings we're willing
+             * to bookkeep?
+             */
+            if (len > DV_ADDR_LINK_LIST_LIMIT) /* yes */
+            {
+                /* Simply mark the frame buffer page as always dirty */
+                range->pl_tab[ i ].stuck_dirty = 1;
+                
+                gdprintk(XENLOG_DEBUG,
+                         "[%lx] link limit exceeded\n",
+                         gfn );
+                
+                goto out;
+            }
+
+            /* alloc link and append it to list */
+            (*ppl) = pl = alloc_paddr_link(d);
+            /* Were we able to allocate a link? */
+            if ( pl == NULL ) /* no */
+            {
+                /* Simply mark the frame buffer page as always dirty */
+                range->pl_tab[ i ].stuck_dirty = 1;
+                
+                gdprintk(XENLOG_DEBUG,
+                         "[%lx] alloc failure\n",
+                         gfn );
+                
+                goto out;
+            }
+        }
+        if ( pl->sl1ma != sl1ma )
+        {
+            ASSERT(pl->sl1ma == INVALID_PADDR);
+            pl->sl1ma = sl1ma;
+            range->nr_mappings++;
+        }
+        effective = 1;
+        if ( len > range->mappings_hwm )
+        {
+            range->mappings_hwm = len;
+#if DEBUG_update_vram_mapping
+            gdprintk(XENLOG_DEBUG,
+                     "[%lx] set      sl1ma:%lx hwm:%d mappings:%d freepages:%d\n",
+                     gfn, sl1ma,
+                     range->mappings_hwm,
+                     range->nr_mappings,
+                     d->arch.paging.shadow.free_pages);
+#endif
+        }
+    }
+    else /* clear */
+    {
+        if ( pl && pl->sl1ma == sl1ma )
+        {
+#if DEBUG_update_vram_mapping
+            gdprintk(XENLOG_DEBUG,
+                     "[%lx] clear    sl1ma:%lx mappings:%d\n",
+                     gfn, sl1ma,
+                     range->nr_mappings - 1);
+#endif
+            free_paddr_link(d, ppl, pl);
+            --range->nr_mappings;
+            effective = 1;
+        }
+    }
+ out:
+    return effective;
+}
+
+
+/*
+ * shadow_scan_dirty_flags()
+ * This produces a dirty bitmap for the range by examining every
+ * L1PTE referenced by some dv_paddr_link in the range's pl_tab table.
+ * It tests and clears each such L1PTE's dirty flag.
+ */
+static int shadow_scan_dirty_flags(struct domain *d,
+                                   dv_range_t *range,
+                                   uint8_t *dirty_bitmap)
+{
+    int flush_tlb = 0;
+    unsigned long i;
+    unsigned long nr = range->end_pfn - range->begin_pfn;
+
+    ASSERT( paging_locked_by_me(d) );
+    /* Iterate over VRAM to track dirty bits. */
+    for ( i = 0; i < nr; i++ )
+    {
+        int dirty = 0, len = 1;
+        dv_paddr_link_t *pl;
+        /* Does the frame buffer have an incomplete set of mappings? */
+        if ( unlikely(range->pl_tab[i].stuck_dirty) ) /* yes */
+            dirty = 1;
+        else /* The frame buffer's set of mappings is complete.  Scan it. */
+            for ( pl = &range->pl_tab[i].mapping; pl; pl = pl->pl_next, len++ )
+            {
+                l1_pgentry_t *sl1e;
+                paddr_t sl1ma = pl->sl1ma;
+                if (sl1ma == INVALID_PADDR) /* FB page is unmapped */
+                    continue;
+                sl1e = maddr_to_virt(sl1ma);
+                if ( l1e_get_flags(*sl1e) & _PAGE_DIRTY )
+                {
+                    dirty = 1;
+                    /* Clear dirty so we can detect if page gets re-dirtied.
+                     * Note: this is atomic, so we may clear a
+                     * _PAGE_ACCESSED set by another processor.
+                     */
+                    l1e_remove_flags(*sl1e, _PAGE_DIRTY);
+                    flush_tlb = 1;
+                }
+            } /* for */
+        
+        if ( dirty )
+            dirty_bitmap[i >> 3] |= (1 << (i & 7));
+
+    }
+
+    return flush_tlb;
+}
+
+
+/*
+ * shadow_track_dirty_vram()
+ * This is the API called by the guest to determine which pages in the range
+ * from [begin_pfn:begin_pfn+nr) have been dirtied since the last call.
+ * It creates the domain's dv_dirty_vram on demand.
+ * It creates ranges on demand when some [begin_pfn:nr) is first encountered.
+ * To collect the dirty bitmask it calls shadow_scan_dirty_flags().
+ * It copies the dirty bitmask into guest storage.
+ */
+int shadow_track_dirty_vram(struct domain *d,
+                            unsigned long begin_pfn,
+                            unsigned long nr,
+                            XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
+{
+    int rc = 0;
+    unsigned long end_pfn = begin_pfn + nr;
+    int flush_tlb = 0;
+    dv_range_t *range;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+
+    /*
+     * This range test is tricky.
+     *
+     * The range [begin_pfn..end_pfn) is an open interval, so end_pfn is a pfn
+     * beyond the end of the range.
+     *
+     * p2m->max_mapped_pfn is a valid PFN so p2m->max_mapped_pfn + 1 is an
+     * invalid PFN.
+     *
+     * If end_pfn is beyond *that* then the range is invalid.
+     */
+    if ( end_pfn < begin_pfn
+         || begin_pfn > p2m->max_mapped_pfn
+         || end_pfn > p2m->max_mapped_pfn + 1 )
+        return -EINVAL;
+
+    paging_lock(d);
+
+    if (!nr)
+    {
+        dirty_vram_free(d);
+        goto out;
+    }
+
+    if ( guest_handle_is_null(guest_dirty_bitmap) )
+        goto out;
+
+    if ( !dirty_vram_find_or_alloc(d) )
+    {
+        rc = -ENOMEM;
+        goto out;
+    }
+
+    range = dirty_vram_range_find(d, begin_pfn, nr);
+    if ( !range )
+    {
+        range = dirty_vram_range_alloc(d, begin_pfn, nr);
+        if ( range )
+            sh_find_all_vram_mappings(d->vcpu[0], range);
+    }
+    if ( range )
+    {
+        int size = (nr + BITS_PER_LONG - 1) / BITS_PER_LONG;
+        unsigned long dirty_bitmap[size];
+
+        memset(dirty_bitmap, 0x00, size * BYTES_PER_LONG);
+
+	flush_tlb |= shadow_scan_dirty_flags(d, range, (uint8_t*)dirty_bitmap);
+
+        rc = -EFAULT;
+        if ( copy_to_guest(guest_dirty_bitmap,
+                           (uint8_t*)dirty_bitmap,
+                           size * BYTES_PER_LONG) == 0 )
+            rc = 0;
+    }
+    
+    if ( flush_tlb )
+        flush_tlb_mask(d->domain_dirty_cpumask);
+
+out:
+    paging_unlock(d);
+    return rc;
+}
+
+
+/************************************************/
+/*          HAP VRAM TRACKING SUPPORT           */
+/************************************************/
+
+/*
+ * hap_enable_vram_tracking()
+ * For all ranges, mark all vram pages in range as logdirty read-only.
+ */
+static int hap_enable_vram_tracking(struct domain *d)
+{
+    int rc = 0;
+    dv_dirty_vram_t *dirty_vram;
+    struct list_head *curr;
+
+    /* turn on PG_log_dirty bit in paging mode */
+    paging_lock(d);
+    d->arch.paging.mode |= PG_log_dirty;
+    paging_unlock(d);
+
+    p2m_lock(p2m_get_hostp2m(d));
+    paging_lock(d);
+
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+
+    /*
+     * dirty_vram != NULL iff we're tracking dirty vram.
+     * If we start tracking dirty pages for all memory then
+     * the dirty_vram structure is freed.
+     */
+    if ( !dirty_vram )
+    {
+        rc = -EINVAL;
+        goto out;
+    }
+
+    /* set l1e entries of P2M table to be read-only. */
+    list_for_each(curr, &dirty_vram->range_head)
+    {
+	dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+	gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] enable  vram tracking\n",
+		 range->begin_pfn, range->end_pfn);
+	p2m_change_type_range(d, range->begin_pfn, range->end_pfn,
+			      p2m_ram_rw, p2m_ram_logdirty);
+    }
+
+    flush_tlb_mask(d->domain_dirty_cpumask);
+ out:
+    paging_unlock(d);
+    p2m_unlock(p2m_get_hostp2m(d));
+    if ( rc )
+    {
+        paging_lock(d);
+        d->arch.paging.mode &= ~PG_log_dirty;
+        paging_unlock(d);
+    }
+    return rc;
+}
+
+/*
+ * hap_disable_vram_tracking()
+ * For all ranges, mark all vram pages in range as logdirty read-write.
+ */
+static int hap_disable_vram_tracking(struct domain *d)
+{
+    int rc = 0;
+    dv_dirty_vram_t *dirty_vram;
+    struct list_head *curr;
+
+    paging_lock(d);
+    d->arch.paging.mode &= ~PG_log_dirty;
+    paging_unlock(d);
+
+    p2m_lock(p2m_get_hostp2m(d));
+    paging_lock(d);
+
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+    if ( !dirty_vram )
+    {
+        rc = -EINVAL;
+        goto out;
+    }
+
+    /* set l1e entries of P2M table with normal mode */
+    list_for_each(curr, &dirty_vram->range_head)
+    {
+	dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+	gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] disable vram tracking\n",
+		 range->begin_pfn, range->end_pfn);
+	p2m_change_type_range(d, range->begin_pfn, range->end_pfn,
+			      p2m_ram_logdirty, p2m_ram_rw);
+    }
+    flush_tlb_mask(d->domain_dirty_cpumask);
+ out:
+    paging_unlock(d);
+    p2m_unlock(p2m_get_hostp2m(d));
+    if ( rc )
+    {
+        paging_lock(d);
+        d->arch.paging.mode |= PG_log_dirty;
+        paging_unlock(d);
+    }
+    return rc;
+}
+
+/*
+ * hap_clean_vram_tracking_range()
+ * For all the pages in the range specified by [begin_pfn,nr),
+ * note in the dirty bitmap any page that has been marked as read-write,
+ * which signifies that the page has been dirtied, and reset the page
+ * to ram_logdirty.
+ */
+void hap_clean_vram_tracking_range(struct domain *d,
+                                   unsigned long begin_pfn,
+                                   unsigned long nr,
+                                   uint8_t *dirty_bitmap)
+{
+    int i;
+    unsigned long pfn;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_range_t *range;
+
+    ASSERT(p2m_locked_by_me(p2m_get_hostp2m(d)));
+    ASSERT(paging_locked_by_me(d));
+
+    if ( !dirty_vram )
+    {
+        gdprintk(XENLOG_DEBUG,
+                 "Should only be called while tracking dirty vram.\n");
+        return;
+    }
+
+    range = dirty_vram_range_find(d, begin_pfn, nr);
+    if ( !range )
+        return;
+
+    /* set l1e entries of P2M table to be read-only. */
+    /*
+     * On first write, it page faults, its entry is changed to read-write,
+     * its bit in the dirty bitmap is set, and on retry the write succeeds.
+     */
+    for ( i = 0, pfn = range->begin_pfn; pfn < range->end_pfn; i++, pfn++ )
+    {
+        p2m_type_t pt;
+        pt = p2m_change_type(d, pfn, p2m_ram_rw, p2m_ram_logdirty);
+        if ( pt == p2m_ram_rw )
+            dirty_bitmap[i >> 3] |= (1 << (i & 7));
+    }
+    flush_tlb_mask(d->domain_dirty_cpumask);
+}
+
+static void hap_vram_tracking_init(struct domain *d)
+{
+    paging_log_dirty_init(d, hap_enable_vram_tracking,
+                          hap_disable_vram_tracking,
+                          NULL);
+}
+
+/*
+ * hap_track_dirty_vram()
+ * Create the domain's dv_dirty_vram struct on demand.
+ * Create a dirty vram range on demand when some [begin_pfn:begin_pfn+nr] is
+ * first encountered.
+ * Collect the guest_dirty bitmask, a bit mask of the dirty vram pages, by
+ * calling paging_log_dirty_range().
+ */
+int hap_track_dirty_vram(struct domain *d,
+                         unsigned long begin_pfn,
+                         unsigned long nr,
+                         XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
+{
+    long rc = 0;
+    dv_dirty_vram_t *dirty_vram;
+
+    paging_lock(d);
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+    if ( nr )
+    {
+        dv_range_t *range = NULL;
+        int size = ( nr + BITS_PER_LONG - 1 ) & ~( BITS_PER_LONG - 1 );
+        uint8_t dirty_bitmap[size];
+        bool_t new_range = 0;
+
+        /* Already tracking dirty vram? */
+        if ( paging_mode_log_dirty(d) && dirty_vram ) /* yes */
+        {
+            /* Handle the addition of another range */
+            range = dirty_vram_range_find(d, begin_pfn, nr);
+            if ( !range )
+            {
+                rc = -ENOMEM;
+                if ( !(range = dirty_vram_range_alloc(d, begin_pfn, nr)) )
+                    goto param_fail;
+                new_range = 1;
+            }
+        }
+        /* Just starting to track dirty vram? */
+        else if ( !paging_mode_log_dirty(d) && !dirty_vram ) /* yes */
+        {
+            rc = -ENOMEM;
+            if ( !(dirty_vram = dirty_vram_alloc(d)) )
+                goto param_fail;
+
+            if ( !(range = dirty_vram_range_find_or_alloc(d, begin_pfn, nr)) )
+                goto param_fail;
+
+            new_range = 1;
+            
+            /* Initialize callbacks for vram tracking */
+            hap_vram_tracking_init(d);
+
+            /* Enable HAP vram tracking */
+            paging_unlock(d);
+            rc = paging_log_dirty_enable(d);
+            paging_lock(d);
+            
+            if ( rc != 0 )
+                goto param_fail;
+        }
+        else
+        {
+            /* Test for invalid combination */
+            if ( !paging_mode_log_dirty(d) && dirty_vram )
+                rc = -EINVAL;
+            else /* logging dirty of all memory, not tracking dirty vram */
+                rc = -ENODATA;
+            goto param_fail;
+        }
+
+        paging_unlock(d);
+        /* Is this query the very first for this range? */
+        if ( new_range ) /* yes */
+            memset(dirty_bitmap, 0xff, size); /* consider all pages dirty */
+        else
+        {
+            memset(dirty_bitmap, 0x00, size);
+            paging_log_dirty_range(d, begin_pfn, nr, dirty_bitmap);
+        }
+        rc = -EFAULT;
+        if ( copy_to_guest(guest_dirty_bitmap,
+                           dirty_bitmap,
+                           size) == 0 )
+        {
+            rc = 0;
+        }
+    }
+    else
+    {
+        /*
+         * If zero pages specified while already tracking dirty vram
+         * then stop tracking
+         */
+        if ( paging_mode_log_dirty(d) && dirty_vram )
+        {
+            /* Disable HAP vram tracking */
+            paging_unlock(d);
+            rc = paging_log_dirty_disable(d);
+            paging_lock(d);
+            
+            dirty_vram_free(d);
+        }
+        else /* benign no-op */
+        {
+            rc = 0;
+        }
+        paging_unlock(d);
+    }
+
+    return rc;
+
+param_fail:
+    dirty_vram_free(d);
+    paging_unlock(d);
+    return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index fd99cde..09cdba2 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -41,6 +41,7 @@
 #include <asm/domain.h>
 #include <xen/numa.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/dirty_vram.h>
 
 #include "private.h"
 
@@ -53,139 +54,6 @@
 #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
 
 /************************************************/
-/*          HAP VRAM TRACKING SUPPORT           */
-/************************************************/
-
-static int hap_enable_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return -EINVAL;
-
-    /* turn on PG_log_dirty bit in paging mode */
-    paging_lock(d);
-    d->arch.paging.mode |= PG_log_dirty;
-    paging_unlock(d);
-
-    /* set l1e entries of P2M table to be read-only. */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_rw, p2m_ram_logdirty);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-    return 0;
-}
-
-static int hap_disable_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return -EINVAL;
-
-    paging_lock(d);
-    d->arch.paging.mode &= ~PG_log_dirty;
-    paging_unlock(d);
-
-    /* set l1e entries of P2M table with normal mode */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_logdirty, p2m_ram_rw);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-    return 0;
-}
-
-static void hap_clean_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return;
-
-    /* set l1e entries of P2M table to be read-only. */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_rw, p2m_ram_logdirty);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-}
-
-static void hap_vram_tracking_init(struct domain *d)
-{
-    paging_log_dirty_init(d, hap_enable_vram_tracking,
-                          hap_disable_vram_tracking,
-                          hap_clean_vram_tracking);
-}
-
-int hap_track_dirty_vram(struct domain *d,
-                         unsigned long begin_pfn,
-                         unsigned long nr,
-                         XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
-{
-    long rc = 0;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( nr )
-    {
-        if ( paging_mode_log_dirty(d) && dirty_vram )
-        {
-            if ( begin_pfn != dirty_vram->begin_pfn ||
-                 begin_pfn + nr != dirty_vram->end_pfn )
-            {
-                paging_log_dirty_disable(d);
-                dirty_vram->begin_pfn = begin_pfn;
-                dirty_vram->end_pfn = begin_pfn + nr;
-                rc = paging_log_dirty_enable(d);
-                if (rc != 0)
-                    goto param_fail;
-            }
-        }
-        else if ( !paging_mode_log_dirty(d) && !dirty_vram )
-        {
-            rc = -ENOMEM;
-            if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL )
-                goto param_fail;
-
-            dirty_vram->begin_pfn = begin_pfn;
-            dirty_vram->end_pfn = begin_pfn + nr;
-            d->arch.hvm_domain.dirty_vram = dirty_vram;
-            hap_vram_tracking_init(d);
-            rc = paging_log_dirty_enable(d);
-            if (rc != 0)
-                goto param_fail;
-        }
-        else
-        {
-            if ( !paging_mode_log_dirty(d) && dirty_vram )
-                rc = -EINVAL;
-            else
-                rc = -ENODATA;
-            goto param_fail;
-        }
-        /* get the bitmap */
-        rc = paging_log_dirty_range(d, begin_pfn, nr, dirty_bitmap);
-    }
-    else
-    {
-        if ( paging_mode_log_dirty(d) && dirty_vram ) {
-            rc = paging_log_dirty_disable(d);
-            xfree(dirty_vram);
-            dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-        } else
-            rc = 0;
-    }
-
-    return rc;
-
-param_fail:
-    if ( dirty_vram )
-    {
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-    }
-    return rc;
-}
-
-/************************************************/
 /*            HAP LOG DIRTY SUPPORT             */
 /************************************************/
 
@@ -223,14 +91,12 @@ static void hap_clean_dirty_bitmap(struct domain *d)
 
 void hap_logdirty_init(struct domain *d)
 {
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    struct dv_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
     if ( paging_mode_log_dirty(d) && dirty_vram )
     {
         paging_log_dirty_disable(d);
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
+        dirty_vram_free(d);
     }
-
     /* Reinitialize logdirty mechanism */
     paging_log_dirty_init(d, hap_enable_log_dirty,
                           hap_disable_log_dirty,
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index ea44e39..55bedde 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -27,6 +27,7 @@
 #include <asm/p2m.h>
 #include <asm/hap.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/dirty_vram.h>
 #include <xen/numa.h>
 #include <xsm/xsm.h>
 
@@ -333,8 +334,11 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
     mfn_t *l4, *l3, *l2;
     unsigned long *l1;
     int i4, i3, i2;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
 
     domain_pause(d);
+    /* Locking hierarchy requires p2m lock to be taken first */
+    p2m_lock(p2m);
     paging_lock(d);
 
     clean = (sc->op == XEN_DOMCTL_SHADOW_OP_CLEAN);
@@ -345,6 +349,14 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
                  d->arch.paging.log_dirty.fault_count,
                  d->arch.paging.log_dirty.dirty_count);
 
+    if ( hap_enabled(d) && d->arch.hvm_domain.dirty_vram )
+    {
+        /* If we're cleaning/peeking all guest memory, we should not be tracking
+         * dirty vram. */
+        rv = -EINVAL;
+        goto out;
+    }
+
     sc->stats.fault_count = d->arch.paging.log_dirty.fault_count;
     sc->stats.dirty_count = d->arch.paging.log_dirty.dirty_count;
 
@@ -424,170 +436,64 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
 
     if ( clean )
     {
-        /* We need to further call clean_dirty_bitmap() functions of specific
-         * paging modes (shadow or hap).  Safe because the domain is paused. */
-        d->arch.paging.log_dirty.clean_dirty_bitmap(d);
+        /* Is null if tracking dirty vram */
+        if ( d->arch.paging.log_dirty.clean_dirty_bitmap )
+        {
+            /*
+             * We need to call clean_dirty_bitmap() functions of specific
+             * paging modes (shadow or hap).
+             * Safe because the domain is paused.
+             */
+            d->arch.paging.log_dirty.clean_dirty_bitmap(d);
+        }
     }
     domain_unpause(d);
     return rv;
 
  out:
     paging_unlock(d);
+    p2m_unlock(p2m);
     domain_unpause(d);
     return rv;
 }
 
-int paging_log_dirty_range(struct domain *d,
-                            unsigned long begin_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
+void paging_log_dirty_range(struct domain *d,
+                           unsigned long begin_pfn,
+                           unsigned long nr,
+                           uint8_t *dirty_bitmap)
 {
-    int rv = 0;
-    unsigned long pages = 0;
-    mfn_t *l4, *l3, *l2;
-    unsigned long *l1;
-    int b1, b2, b3, b4;
-    int i2, i3, i4;
-
-    d->arch.paging.log_dirty.clean_dirty_bitmap(d);
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    dv_range_t *range;
+    unsigned int range_dirty_count = 0;
+    
+    p2m_lock(p2m);
     paging_lock(d);
 
-    PAGING_DEBUG(LOGDIRTY, "log-dirty-range: dom %u faults=%u dirty=%u\n",
-                 d->domain_id,
-                 d->arch.paging.log_dirty.fault_count,
-                 d->arch.paging.log_dirty.dirty_count);
-
-    if ( unlikely(d->arch.paging.log_dirty.failed_allocs) ) {
-        printk("%s: %d failed page allocs while logging dirty pages\n",
-               __FUNCTION__, d->arch.paging.log_dirty.failed_allocs);
-        rv = -ENOMEM;
-        goto out;
-    }
-
-    if ( !d->arch.paging.log_dirty.fault_count &&
-         !d->arch.paging.log_dirty.dirty_count ) {
-        unsigned int size = BITS_TO_LONGS(nr);
-
-        if ( clear_guest(dirty_bitmap, size * BYTES_PER_LONG) != 0 )
-            rv = -EFAULT;
-        goto out;
-    }
-    d->arch.paging.log_dirty.fault_count = 0;
-    d->arch.paging.log_dirty.dirty_count = 0;
-
-    b1 = L1_LOGDIRTY_IDX(begin_pfn);
-    b2 = L2_LOGDIRTY_IDX(begin_pfn);
-    b3 = L3_LOGDIRTY_IDX(begin_pfn);
-    b4 = L4_LOGDIRTY_IDX(begin_pfn);
-    l4 = paging_map_log_dirty_bitmap(d);
-
-    for ( i4 = b4;
-          (pages < nr) && (i4 < LOGDIRTY_NODE_ENTRIES);
-          i4++ )
+    /* Only called when tracking dirty vram in HAP mode */
+    ASSERT(hap_enabled(d) && d->arch.hvm_domain.dirty_vram);
+    
+    range = dirty_vram_range_find_gfn(d, begin_pfn);
+    if ( range )
     {
-        l3 = (l4 && mfn_valid(l4[i4])) ? map_domain_page(mfn_x(l4[i4])) : NULL;
-        for ( i3 = b3;
-              (pages < nr) && (i3 < LOGDIRTY_NODE_ENTRIES);
-              i3++ )
-        {
-            l2 = ((l3 && mfn_valid(l3[i3])) ?
-                  map_domain_page(mfn_x(l3[i3])) : NULL);
-            for ( i2 = b2;
-                  (pages < nr) && (i2 < LOGDIRTY_NODE_ENTRIES);
-                  i2++ )
-            {
-                unsigned int bytes = PAGE_SIZE;
-                uint8_t *s;
-                l1 = ((l2 && mfn_valid(l2[i2])) ?
-                      map_domain_page(mfn_x(l2[i2])) : NULL);
-
-                s = ((uint8_t*)l1) + (b1 >> 3);
-                bytes -= b1 >> 3;
-
-                if ( likely(((nr - pages + 7) >> 3) < bytes) )
-                    bytes = (unsigned int)((nr - pages + 7) >> 3);
-
-                if ( !l1 )
-                {
-                    if ( clear_guest_offset(dirty_bitmap, pages >> 3,
-                                            bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-                /* begin_pfn is not 32K aligned, hence we have to bit
-                 * shift the bitmap */
-                else if ( b1 & 0x7 )
-                {
-                    int i, j;
-                    uint32_t *l = (uint32_t*) s;
-                    int bits = b1 & 0x7;
-                    int bitmask = (1 << bits) - 1;
-                    int size = (bytes + BYTES_PER_LONG - 1) / BYTES_PER_LONG;
-                    unsigned long bitmap[size];
-                    static unsigned long printed = 0;
-
-                    if ( printed != begin_pfn )
-                    {
-                        dprintk(XENLOG_DEBUG, "%s: begin_pfn %lx is not 32K aligned!\n",
-                                __FUNCTION__, begin_pfn);
-                        printed = begin_pfn;
-                    }
-
-                    for ( i = 0; i < size - 1; i++, l++ ) {
-                        bitmap[i] = ((*l) >> bits) |
-                            (((*((uint8_t*)(l + 1))) & bitmask) << (sizeof(*l) * 8 - bits));
-                    }
-                    s = (uint8_t*) l;
-                    size = BYTES_PER_LONG - ((b1 >> 3) & 0x3);
-                    bitmap[i] = 0;
-                    for ( j = 0; j < size; j++, s++ )
-                        bitmap[i] |= (*s) << (j * 8);
-                    bitmap[i] = (bitmap[i] >> bits) | (bitmask << (size * 8 - bits));
-                    if ( copy_to_guest_offset(dirty_bitmap, (pages >> 3),
-                                (uint8_t*) bitmap, bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-                else
-                {
-                    if ( copy_to_guest_offset(dirty_bitmap, pages >> 3,
-                                              s, bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-
-                pages += bytes << 3;
-                if ( l1 )
-                {
-                    clear_page(l1);
-                    unmap_domain_page(l1);
-                }
-                b1 = b1 & 0x7;
-            }
-            b2 = 0;
-            if ( l2 )
-                unmap_domain_page(l2);
-        }
-        b3 = 0;
-        if ( l3 )
-            unmap_domain_page(l3);
+        range_dirty_count = range->dirty_count;
+        range->dirty_count = 0;
     }
-    if ( l4 )
-        unmap_domain_page(l4);
-
-    paging_unlock(d);
+    
+    if ( !range_dirty_count)
+        goto out;
 
-    return rv;
+    PAGING_DEBUG(LOGDIRTY,
+                 "log-dirty-range: dom %u [%05lx:%05lx] range_dirty=%u\n",
+                 d->domain_id,
+                 begin_pfn,
+                 range->end_pfn,
+                 range_dirty_count);
 
+    hap_clean_vram_tracking_range(d, begin_pfn, nr, dirty_bitmap);
  out:
     paging_unlock(d);
-    return rv;
+    p2m_unlock(p2m);
+    return;
 }
 
 /* Note that this function takes three function pointers. Callers must supply
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index ce79131..56afd16 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -36,6 +36,7 @@
 #include <asm/current.h>
 #include <asm/flushtlb.h>
 #include <asm/shadow.h>
+#include <asm/dirty_vram.h>
 #include <xen/numa.h>
 #include "private.h"
 
@@ -3121,12 +3122,7 @@ void shadow_teardown(struct domain *d)
      * calls now that we've torn down the bitmap */
     d->arch.paging.mode &= ~PG_log_dirty;
 
-    if (d->arch.hvm_domain.dirty_vram) {
-        xfree(d->arch.hvm_domain.dirty_vram->sl1ma);
-        xfree(d->arch.hvm_domain.dirty_vram->dirty_bitmap);
-        xfree(d->arch.hvm_domain.dirty_vram);
-        d->arch.hvm_domain.dirty_vram = NULL;
-    }
+    dirty_vram_free(d);
 
     paging_unlock(d);
 
@@ -3463,179 +3459,212 @@ void shadow_clean_dirty_bitmap(struct domain *d)
 
 
 /**************************************************************************/
-/* VRAM dirty tracking support */
-int shadow_track_dirty_vram(struct domain *d,
-                            unsigned long begin_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
-{
-    int rc;
-    unsigned long end_pfn = begin_pfn + nr;
-    unsigned long dirty_size = (nr + 7) / 8;
-    int flush_tlb = 0;
-    unsigned long i;
-    p2m_type_t t;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-    struct p2m_domain *p2m = p2m_get_hostp2m(d);
-
-    if (end_pfn < begin_pfn
-            || begin_pfn > p2m->max_mapped_pfn
-            || end_pfn >= p2m->max_mapped_pfn)
-        return -EINVAL;
-
-    /* We perform p2m lookups, so lock the p2m upfront to avoid deadlock */
-    p2m_lock(p2m_get_hostp2m(d));
-    paging_lock(d);
+/* Support functions for shadow-based dirty VRAM code */
 
-    if ( dirty_vram && (!nr ||
-             ( begin_pfn != dirty_vram->begin_pfn
-            || end_pfn   != dirty_vram->end_pfn )) )
-    {
-        /* Different tracking, tear the previous down. */
-        gdprintk(XENLOG_INFO, "stopping tracking VRAM %lx - %lx\n", dirty_vram->begin_pfn, dirty_vram->end_pfn);
-        xfree(dirty_vram->sl1ma);
-        xfree(dirty_vram->dirty_bitmap);
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-    }
+#define DEBUG_unshadow_sl1ma                  0          
+#define DEBUG_unshadow_sl1ma_detail           0
+#define DEBUG_count_initial_mappings          1
 
-    if ( !nr )
+/* smfn is no longer a shadow page.  Remove it from any
+ * dirty vram range mapping. */
+void
+dirty_vram_delete_shadow(struct vcpu *v,
+                         unsigned long gfn,
+                         unsigned int shadow_type, 
+                         mfn_t smfn)
+{
+    static unsigned int l1_shadow_mask = 
+          1 << SH_type_l1_32_shadow
+        | 1 << SH_type_fl1_32_shadow
+        | 1 << SH_type_l1_pae_shadow
+        | 1 << SH_type_fl1_pae_shadow
+        | 1 << SH_type_l1_64_shadow
+        | 1 << SH_type_fl1_64_shadow
+        ;
+    struct domain *d = v->domain;
+    dv_dirty_vram_t *dirty_vram;
+    struct list_head *curr, *next;
+    
+    ASSERT(paging_locked_by_me(d));
+    /* Ignore all but level 1 shadows */
+    
+    if ( (l1_shadow_mask & (1 << shadow_type)) == 0 )
     {
-        rc = 0;
         goto out;
     }
 
-    /* This should happen seldomly (Video mode change),
-     * no need to be careful. */
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
     if ( !dirty_vram )
     {
-        /* Throw away all the shadows rather than walking through them 
-         * up to nr times getting rid of mappings of each pfn */
-        shadow_blow_tables(d);
-
-        gdprintk(XENLOG_INFO, "tracking VRAM %lx - %lx\n", begin_pfn, end_pfn);
-
-        rc = -ENOMEM;
-        if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL )
-            goto out;
-        dirty_vram->begin_pfn = begin_pfn;
-        dirty_vram->end_pfn = end_pfn;
-        d->arch.hvm_domain.dirty_vram = dirty_vram;
-
-        if ( (dirty_vram->sl1ma = xmalloc_array(paddr_t, nr)) == NULL )
-            goto out_dirty_vram;
-        memset(dirty_vram->sl1ma, ~0, sizeof(paddr_t) * nr);
-
-        if ( (dirty_vram->dirty_bitmap = xzalloc_array(uint8_t, dirty_size)) == NULL )
-            goto out_sl1ma;
-
-        dirty_vram->last_dirty = NOW();
-
-        /* Tell the caller that this time we could not track dirty bits. */
-        rc = -ENODATA;
-    }
-    else if (dirty_vram->last_dirty == -1)
-    {
-        /* still completely clean, just copy our empty bitmap */
-        rc = -EFAULT;
-        if ( copy_to_guest(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size) == 0 )
-            rc = 0;
+        goto out;
     }
-    else
+        
+    list_for_each_safe(curr, next, &dirty_vram->range_head)
     {
-        /* Iterate over VRAM to track dirty bits. */
-        for ( i = 0; i < nr; i++ ) {
-            mfn_t mfn = get_gfn_query_unlocked(d, begin_pfn + i, &t);
-            struct page_info *page;
-            int dirty = 0;
-            paddr_t sl1ma = dirty_vram->sl1ma[i];
-
-            if (mfn_x(mfn) == INVALID_MFN)
-            {
-                dirty = 1;
-            }
-            else
+        dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+        unsigned long i;
+        int max_mappings = 1, mappings = 0;
+        int unshadowed = 0;
+        for ( i = 0; i != range->end_pfn - range->begin_pfn; i++ )
+        {
+            dv_paddr_link_t *pl = &range->pl_tab[ i ].mapping;
+            dv_paddr_link_t **ppl = NULL;
+            mappings = 0;
+            
+            while ( pl != NULL )
             {
-                page = mfn_to_page(mfn);
-                switch (page->u.inuse.type_info & PGT_count_mask)
-                {
-                case 0:
-                    /* No guest reference, nothing to track. */
-                    break;
-                case 1:
-                    /* One guest reference. */
-                    if ( sl1ma == INVALID_PADDR )
-                    {
-                        /* We don't know which sl1e points to this, too bad. */
-                        dirty = 1;
-                        /* TODO: Heuristics for finding the single mapping of
-                         * this gmfn */
-                        flush_tlb |= sh_remove_all_mappings(d->vcpu[0], mfn);
-                    }
-                    else
-                    {
-                        /* Hopefully the most common case: only one mapping,
-                         * whose dirty bit we can use. */
-                        l1_pgentry_t *sl1e = maddr_to_virt(sl1ma);
-
-                        if ( l1e_get_flags(*sl1e) & _PAGE_DIRTY )
-                        {
-                            dirty = 1;
-                            /* Note: this is atomic, so we may clear a
-                             * _PAGE_ACCESSED set by another processor. */
-                            l1e_remove_flags(*sl1e, _PAGE_DIRTY);
-                            flush_tlb = 1;
-                        }
-                    }
-                    break;
-                default:
-                    /* More than one guest reference,
-                     * we don't afford tracking that. */
-                    dirty = 1;
+                paddr_t sl1ma = pl->sl1ma;
+                unsigned long sl1mn;
+                
+                if ( sl1ma == INVALID_PADDR )
                     break;
+                
+                sl1mn = sl1ma >> PAGE_SHIFT;
+                if ( sl1mn == mfn_x(smfn) ) {
+#if DEBUG_unshadow_sl1ma_detail
+                    gdprintk(XENLOG_DEBUG,
+                             "[%lx] gfn[%lx] unshadow sl1ma:%lx\n",
+                             mfn_x(smfn),
+                             range->begin_pfn + i,
+                             sl1ma);
+#endif
+                    unshadowed++;
+                    pl = free_paddr_link(d, ppl, pl);
+                    --range->nr_mappings;
+                }
+                else
+                {
+                    ppl = &pl->pl_next;
+                    pl = *ppl;
+                    mappings++;
                 }
             }
-
-            if ( dirty )
+        }
+        if ( mappings > max_mappings )
+            max_mappings = mappings;
+        
+        if ( unshadowed ) {
+#if DEBUG_unshadow_sl1ma
+            gdprintk(XENLOG_DEBUG,
+                     "[%lx] gfn[%05lx:%05lx] unshadowed:%d mappings:0x%x max_mappings:%d\n",
+                     mfn_x(smfn),
+                     range->begin_pfn, range->end_pfn,
+                     unshadowed, range->nr_mappings, max_mappings);
+#endif
+            if ( range->nr_mappings == 0 )
             {
-                dirty_vram->dirty_bitmap[i / 8] |= 1 << (i % 8);
-                dirty_vram->last_dirty = NOW();
+                dirty_vram_range_free(d, range);                    
             }
         }
+    }
+ out:
+    return;
+}
+
+
+typedef int (*hash_pfn_callback_t)(struct vcpu *v,
+                                   mfn_t smfn,
+                                   unsigned long begin_pfn,
+                                   unsigned long end_pfn,
+                                   int *removed);
+
+static int hash_pfn_foreach(struct vcpu *v, 
+                            unsigned int callback_mask, 
+                            hash_pfn_callback_t callbacks[], 
+                            unsigned long begin_pfn,
+                            unsigned long end_pfn)
+/* Walk the hash table looking at the types of the entries and 
+ * calling the appropriate callback function for each entry. 
+ * The mask determines which shadow types we call back for, and the array
+ * of callbacks tells us which function to call.
+ * Any callback may return non-zero to let us skip the rest of the scan. 
+ *
+ * WARNING: Callbacks MUST NOT add or remove hash entries unless they 
+ * then return non-zero to terminate the scan. */
+{
+    int i, done = 0, removed = 0;
+    struct domain *d = v->domain;
+    struct page_info *x;
+
+    /* Say we're here, to stop hash-lookups reordering the chains */
+    ASSERT(paging_locked_by_me(d));
+    ASSERT(d->arch.paging.shadow.hash_walking == 0);
+    d->arch.paging.shadow.hash_walking = 1;
 
-        rc = -EFAULT;
-        if ( copy_to_guest(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size) == 0 ) {
-            memset(dirty_vram->dirty_bitmap, 0, dirty_size);
-            if (dirty_vram->last_dirty + SECONDS(2) < NOW())
+    for ( i = 0; i < SHADOW_HASH_BUCKETS; i++ ) 
+    {
+        /* WARNING: This is not safe against changes to the hash table.
+         * The callback *must* return non-zero if it has inserted or
+         * deleted anything from the hash (lookups are OK, though). */
+        for ( x = d->arch.paging.shadow.hash_table[i]; x; x = next_shadow(x) )
+        {
+            if ( callback_mask & (1 << x->u.sh.type) )
             {
-                /* was clean for more than two seconds, try to disable guest
-                 * write access */
-                for ( i = begin_pfn; i < end_pfn; i++ ) {
-                    mfn_t mfn = get_gfn_query_unlocked(d, i, &t);
-                    if (mfn_x(mfn) != INVALID_MFN)
-                        flush_tlb |= sh_remove_write_access(d->vcpu[0], mfn, 1, 0);
-                }
-                dirty_vram->last_dirty = -1;
+                ASSERT(x->u.sh.type <= 15);
+                ASSERT(callbacks[x->u.sh.type] != NULL);
+                done = callbacks[x->u.sh.type](v, page_to_mfn(x), 
+                                               begin_pfn, end_pfn,
+                                               &removed);
+                if ( done ) break;
             }
-            rc = 0;
         }
+        if ( done ) break; 
     }
-    if ( flush_tlb )
-        flush_tlb_mask(d->domain_dirty_cpumask);
-    goto out;
+    d->arch.paging.shadow.hash_walking = 0;
+    return removed;
+}
 
-out_sl1ma:
-    xfree(dirty_vram->sl1ma);
-out_dirty_vram:
-    xfree(dirty_vram);
-    dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
+void sh_find_all_vram_mappings(struct vcpu *v,
+                               dv_range_t *range)
+{
+    /* Dispatch table for getting per-type functions */
+    static hash_pfn_callback_t callbacks[SH_type_unused] = {
+        NULL, /* none    */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 2), /* l1_32   */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 2), /* fl1_32  */
+        NULL, /* l2_32   */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 3), /* l1_pae  */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 3), /* fl1_pae */
+        NULL, /* l2_pae  */
+        NULL, /* l2h_pae */
+#if CONFIG_PAGING_LEVELS >= 4
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 4), /* l1_64   */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 4), /* fl1_64  */
+#else
+        NULL, /* l1_64   */
+        NULL, /* fl1_64  */
+#endif
+        NULL, /* l2_64   */
+        NULL, /* l2h_64  */
+        NULL, /* l3_64   */
+        NULL, /* l4_64   */
+        NULL, /* p2m     */
+        NULL  /* unused  */
+    };
 
-out:
-    paging_unlock(d);
-    p2m_unlock(p2m_get_hostp2m(d));
-    return rc;
+    static unsigned int callback_mask = 
+          1 << SH_type_l1_32_shadow
+        | 1 << SH_type_fl1_32_shadow
+        | 1 << SH_type_l1_pae_shadow
+        | 1 << SH_type_fl1_pae_shadow
+        | 1 << SH_type_l1_64_shadow
+        | 1 << SH_type_fl1_64_shadow
+        ;
+
+    perfc_incr(shadow_mappings);
+
+    hash_pfn_foreach(v, callback_mask, callbacks,
+                     range->begin_pfn,
+                     range->end_pfn);
+
+#if DEBUG_count_initial_mappings
+    gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] count of initial mappings:%d\n",
+             range->begin_pfn, range->end_pfn,
+             range->nr_mappings);
+#endif
 }
 
+
 /**************************************************************************/
 /* Shadow-control XEN_DOMCTL dispatcher */
 
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index b0e6d72..9c00574 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -35,6 +35,7 @@
 #include <asm/flushtlb.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/cacheattr.h>
+#include <asm/dirty_vram.h>
 #include <asm/mtrr.h>
 #include <asm/guest_pt.h>
 #include <public/sched.h>
@@ -149,6 +150,10 @@ delete_fl1_shadow_status(struct vcpu *v, gfn_t gfn, mfn_t smfn)
     SHADOW_PRINTK("gfn=%"SH_PRI_gfn", type=%08x, smfn=%05lx\n",
                    gfn_x(gfn), SH_type_fl1_shadow, mfn_x(smfn));
     ASSERT(mfn_to_page(smfn)->u.sh.head);
+
+    /* Removing any dv_paddr_links to the erstwhile shadow page */
+    dirty_vram_delete_shadow(v, gfn_x(gfn), SH_type_fl1_shadow, smfn);
+    
     shadow_hash_delete(v, gfn_x(gfn), SH_type_fl1_shadow, smfn);
 }
 
@@ -160,6 +165,10 @@ delete_shadow_status(struct vcpu *v, mfn_t gmfn, u32 shadow_type, mfn_t smfn)
                    v->domain->domain_id, v->vcpu_id,
                    mfn_x(gmfn), shadow_type, mfn_x(smfn));
     ASSERT(mfn_to_page(smfn)->u.sh.head);
+    
+    /* Removing any dv_paddr_links to the erstwhile shadow page */
+    dirty_vram_delete_shadow(v, mfn_x(gmfn), shadow_type, smfn);
+    
     shadow_hash_delete(v, mfn_x(gmfn), shadow_type, smfn);
     /* 32-on-64 PV guests don't own their l4 pages; see set_shadow_status */
     if ( !is_pv_32on64_vcpu(v) || shadow_type != SH_type_l4_64_shadow )
@@ -516,7 +525,6 @@ _sh_propagate(struct vcpu *v,
     guest_l1e_t guest_entry = { guest_intpte };
     shadow_l1e_t *sp = shadow_entry_ptr;
     struct domain *d = v->domain;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
     gfn_t target_gfn = guest_l1e_get_gfn(guest_entry);
     u32 pass_thru_flags;
     u32 gflags, sflags;
@@ -663,17 +671,6 @@ _sh_propagate(struct vcpu *v,
         }
     }
 
-    if ( unlikely((level == 1) && dirty_vram
-            && dirty_vram->last_dirty == -1
-            && gfn_x(target_gfn) >= dirty_vram->begin_pfn
-            && gfn_x(target_gfn) < dirty_vram->end_pfn) )
-    {
-        if ( ft & FETCH_TYPE_WRITE )
-            dirty_vram->last_dirty = NOW();
-        else
-            sflags &= ~_PAGE_RW;
-    }
-
     /* Read-only memory */
     if ( p2m_is_readonly(p2mt) ||
          (p2mt == p2m_mmio_direct &&
@@ -1072,101 +1069,60 @@ static int shadow_set_l2e(struct vcpu *v,
     return flags;
 }
 
-static inline void shadow_vram_get_l1e(shadow_l1e_t new_sl1e,
+/* shadow_vram_fix_l1e()
+ *
+ * Tests L1PTEs as they are modified, looking for when they start to
+ * (or cease to) point to frame buffer pages.  If the old and new gfns differ,
+ * calls dirty_vram_range_update() to updates the dirty_vram structures.
+ */
+static inline void shadow_vram_fix_l1e(shadow_l1e_t old_sl1e,
+                                       shadow_l1e_t new_sl1e,
                                        shadow_l1e_t *sl1e,
                                        mfn_t sl1mfn,
                                        struct domain *d)
 { 
-    mfn_t mfn = shadow_l1e_get_mfn(new_sl1e);
-    int flags = shadow_l1e_get_flags(new_sl1e);
-    unsigned long gfn;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    mfn_t new_mfn, old_mfn;
+    unsigned long new_gfn = INVALID_M2P_ENTRY, old_gfn = INVALID_M2P_ENTRY;
+    paddr_t sl1ma;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
 
-    if ( !dirty_vram         /* tracking disabled? */
-         || !(flags & _PAGE_RW) /* read-only mapping? */
-         || !mfn_valid(mfn) )   /* mfn can be invalid in mmio_direct */
+    if ( !dirty_vram )
         return;
 
-    gfn = mfn_to_gfn(d, mfn);
-    /* Page sharing not supported on shadow PTs */
-    BUG_ON(SHARED_M2P(gfn));
+    sl1ma = pfn_to_paddr(mfn_x(sl1mfn)) | ((unsigned long)sl1e & ~PAGE_MASK);
 
-    if ( (gfn >= dirty_vram->begin_pfn) && (gfn < dirty_vram->end_pfn) )
+    old_mfn = shadow_l1e_get_mfn(old_sl1e);
+
+    if ( !sh_l1e_is_magic(old_sl1e) &&
+         (l1e_get_flags(old_sl1e) & _PAGE_PRESENT) &&
+         mfn_valid(old_mfn))
     {
-        unsigned long i = gfn - dirty_vram->begin_pfn;
-        struct page_info *page = mfn_to_page(mfn);
-        
-        if ( (page->u.inuse.type_info & PGT_count_mask) == 1 )
-            /* Initial guest reference, record it */
-            dirty_vram->sl1ma[i] = pfn_to_paddr(mfn_x(sl1mfn))
-                | ((unsigned long)sl1e & ~PAGE_MASK);
+        old_gfn = mfn_to_gfn(d, old_mfn);
     }
-}
-
-static inline void shadow_vram_put_l1e(shadow_l1e_t old_sl1e,
-                                       shadow_l1e_t *sl1e,
-                                       mfn_t sl1mfn,
-                                       struct domain *d)
-{
-    mfn_t mfn = shadow_l1e_get_mfn(old_sl1e);
-    int flags = shadow_l1e_get_flags(old_sl1e);
-    unsigned long gfn;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram         /* tracking disabled? */
-         || !(flags & _PAGE_RW) /* read-only mapping? */
-         || !mfn_valid(mfn) )   /* mfn can be invalid in mmio_direct */
-        return;
-
-    gfn = mfn_to_gfn(d, mfn);
-    /* Page sharing not supported on shadow PTs */
-    BUG_ON(SHARED_M2P(gfn));
-
-    if ( (gfn >= dirty_vram->begin_pfn) && (gfn < dirty_vram->end_pfn) )
+    
+    new_mfn = shadow_l1e_get_mfn(new_sl1e);
+    if ( !sh_l1e_is_magic(new_sl1e) &&
+         (l1e_get_flags(new_sl1e) & _PAGE_PRESENT) &&
+         mfn_valid(new_mfn))
     {
-        unsigned long i = gfn - dirty_vram->begin_pfn;
-        struct page_info *page = mfn_to_page(mfn);
-        int dirty = 0;
-        paddr_t sl1ma = pfn_to_paddr(mfn_x(sl1mfn))
-            | ((unsigned long)sl1e & ~PAGE_MASK);
+        new_gfn = mfn_to_gfn(d, new_mfn);
+    }
 
-        if ( (page->u.inuse.type_info & PGT_count_mask) == 1 )
-        {
-            /* Last reference */
-            if ( dirty_vram->sl1ma[i] == INVALID_PADDR ) {
-                /* We didn't know it was that one, let's say it is dirty */
-                dirty = 1;
-            }
-            else
-            {
-                ASSERT(dirty_vram->sl1ma[i] == sl1ma);
-                dirty_vram->sl1ma[i] = INVALID_PADDR;
-                if ( flags & _PAGE_DIRTY )
-                    dirty = 1;
-            }
-        }
-        else
+    if ( old_gfn == new_gfn ) return;
+
+    if ( VALID_M2P(old_gfn) )
+        if ( dirty_vram_range_update(d, old_gfn, sl1ma, 0/*clear*/) )
         {
-            /* We had more than one reference, just consider the page dirty. */
-            dirty = 1;
-            /* Check that it's not the one we recorded. */
-            if ( dirty_vram->sl1ma[i] == sl1ma )
-            {
-                /* Too bad, we remembered the wrong one... */
-                dirty_vram->sl1ma[i] = INVALID_PADDR;
-            }
-            else
-            {
-                /* Ok, our recorded sl1e is still pointing to this page, let's
-                 * just hope it will remain. */
-            }
+            SHADOW_PRINTK("gfn %lx (mfn %lx) cleared vram pte\n",
+                          old_gfn, mfn_x(old_mfn));
         }
-        if ( dirty )
+
+    if ( VALID_M2P(new_gfn) )
+        if ( dirty_vram_range_update(d, new_gfn, sl1ma, 1/*set*/) )
         {
-            dirty_vram->dirty_bitmap[i / 8] |= 1 << (i % 8);
-            dirty_vram->last_dirty = NOW();
+            SHADOW_PRINTK("gfn %lx (mfn %lx) set vram pte\n",
+                          new_gfn, mfn_x(new_mfn));
         }
-    }
 }
 
 static int shadow_set_l1e(struct vcpu *v, 
@@ -1211,12 +1167,13 @@ static int shadow_set_l1e(struct vcpu *v,
                 shadow_l1e_remove_flags(new_sl1e, _PAGE_RW);
                 /* fall through */
             case 0:
-                shadow_vram_get_l1e(new_sl1e, sl1e, sl1mfn, d);
                 break;
             }
         }
     } 
 
+    shadow_vram_fix_l1e(old_sl1e, new_sl1e, sl1e, sl1mfn, d);
+
     /* Write the new entry */
     shadow_write_entries(sl1e, &new_sl1e, 1, sl1mfn);
     flags |= SHADOW_SET_CHANGED;
@@ -1231,7 +1188,6 @@ static int shadow_set_l1e(struct vcpu *v,
          * trigger a flush later. */
         if ( shadow_mode_refcounts(d) ) 
         {
-            shadow_vram_put_l1e(old_sl1e, sl1e, sl1mfn, d);
             shadow_put_page_from_l1e(old_sl1e, d);
             TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_SHADOW_L1_PUT_REF);
         } 
@@ -2018,7 +1974,6 @@ void sh_destroy_l1_shadow(struct vcpu *v, mfn_t smfn)
         SHADOW_FOREACH_L1E(sl1mfn, sl1e, 0, 0, {
             if ( (shadow_l1e_get_flags(*sl1e) & _PAGE_PRESENT)
                  && !sh_l1e_is_magic(*sl1e) ) {
-                shadow_vram_put_l1e(*sl1e, sl1e, sl1mfn, d);
                 shadow_put_page_from_l1e(*sl1e, d);
             }
         });
@@ -4336,6 +4291,37 @@ int sh_rm_mappings_from_l1(struct vcpu *v, mfn_t sl1mfn, mfn_t target_mfn)
     return done;
 }
 
+
+int sh_find_vram_mappings_in_l1(struct vcpu *v,
+                                mfn_t sl1mfn,
+                                unsigned long begin_pfn,
+                                unsigned long end_pfn,
+                                int *removed)
+/* Find all VRAM mappings in this shadow l1 table */
+{
+    struct domain *d = v->domain;
+    shadow_l1e_t *sl1e;
+    int done = 0;
+
+    /* only returns _PAGE_PRESENT entries */
+    SHADOW_FOREACH_L1E(sl1mfn, sl1e, 0, done, 
+    {
+        unsigned long gfn;
+        mfn_t gmfn = shadow_l1e_get_mfn(*sl1e);
+        if ( !mfn_valid(gmfn) )
+            continue;
+        gfn = mfn_to_gfn(d, gmfn);
+        if ( VALID_M2P(gfn) && (begin_pfn <= gfn) && (gfn < end_pfn) ) 
+        {
+            paddr_t sl1ma =
+                pfn_to_paddr(mfn_x(sl1mfn)) |
+                ( (unsigned long)sl1e & ~PAGE_MASK );
+            dirty_vram_range_update(v->domain, gfn, sl1ma, 1/*set*/);
+        }
+    });
+    return 0;
+}
+
 /**************************************************************************/
 /* Functions to excise all pointers to shadows from higher-level shadows. */
 
diff --git a/xen/arch/x86/mm/shadow/multi.h b/xen/arch/x86/mm/shadow/multi.h
index 835121e..436a4ac 100644
--- a/xen/arch/x86/mm/shadow/multi.h
+++ b/xen/arch/x86/mm/shadow/multi.h
@@ -66,7 +66,12 @@ SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, GUEST_LEVELS)
 extern int
 SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, GUEST_LEVELS)
     (struct vcpu *v, mfn_t sl1mfn, mfn_t target_mfn);
-
+extern int
+SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, GUEST_LEVELS)
+     (struct vcpu *v, mfn_t sl1mfn, 
+      unsigned long begin_pfn,
+      unsigned long end_pfn,
+      int *removed);
 extern void
 SHADOW_INTERNAL_NAME(sh_clear_shadow_entry, GUEST_LEVELS)
     (struct vcpu *v, void *ep, mfn_t smfn);
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index 43ce1db..5b0f9f7 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -229,6 +229,7 @@ static inline shadow_l4e_t shadow_l4e_from_mfn(mfn_t mfn, u32 flags)
 #define sh_update_cr3              INTERNAL_NAME(sh_update_cr3)
 #define sh_rm_write_access_from_l1 INTERNAL_NAME(sh_rm_write_access_from_l1)
 #define sh_rm_mappings_from_l1     INTERNAL_NAME(sh_rm_mappings_from_l1)
+#define sh_find_vram_mappings_in_l1 INTERNAL_NAME(sh_find_vram_mappings_in_l1)
 #define sh_remove_l1_shadow        INTERNAL_NAME(sh_remove_l1_shadow)
 #define sh_remove_l2_shadow        INTERNAL_NAME(sh_remove_l2_shadow)
 #define sh_remove_l3_shadow        INTERNAL_NAME(sh_remove_l3_shadow)
diff --git a/xen/include/asm-x86/dirty_vram.h b/xen/include/asm-x86/dirty_vram.h
new file mode 100644
index 0000000..95637de
--- /dev/null
+++ b/xen/include/asm-x86/dirty_vram.h
@@ -0,0 +1,201 @@
+/******************************************************************************
+ * include/asm-x86/dirty_vram.h
+ *
+ * Interface for tracking dirty VRAM pages
+ *
+ * Copyright (c) 2012 Citrix Systems, Inc. (Robert Phillips)
+ * Parts of this code are Copyright (c) 2006 by XenSource Inc.
+ * Parts of this code are Copyright (c) 2006 by Michael A Fetterman
+ * Parts based on earlier work by Michael A Fetterman, Ian Pratt et al.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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
+ */
+
+#ifndef _DIRTY_VRAM_H
+#define _DIRTY_VRAM_H
+
+/*
+ * In shadow mode we need to bookkeep all the L1 page table entries that
+ * map a frame buffer page.  Struct dv_paddr_link does this
+ * by recording the address of a L1 page table entry for some frame buffer page.
+ * Also has a link to additional pl entries if the frame buffer page
+ * has multiple mappings.
+ * In practice very few pages have multiple mappings.
+ * But to rule out some pathological situation, we limit the number of
+ * mappings we're willing to bookkeep.
+ */
+
+#define DV_ADDR_LINK_LIST_LIMIT 20
+
+typedef struct dv_paddr_link {
+    paddr_t sl1ma;
+    struct dv_paddr_link *pl_next;
+} dv_paddr_link_t;
+
+typedef struct dv_pl_entry {
+    dv_paddr_link_t mapping;
+    bool_t stuck_dirty;
+} dv_pl_entry_t;
+
+/*
+ * This defines an extension page of pl entries for FB pages with multiple
+ * mappings. All such pages (of a domain) are linked together.
+ */
+typedef struct dv_paddr_link_ext {
+    struct list_head ext_link;
+    dv_paddr_link_t entries[ ( PAGE_SIZE - sizeof( struct list_head ) ) /
+                             sizeof( dv_paddr_link_t ) ];
+} dv_paddr_link_ext_t;
+
+/*
+ * This defines a single frame buffer range.  It bookkeeps all the level 1 PTEs
+ * that map guest pages within that range.
+ * All such ranges (of a domain) are linked together.
+ */
+typedef struct dv_range {
+    struct list_head range_link; /* the several ranges form a linked list */
+    unsigned long begin_pfn;
+    unsigned long end_pfn;
+    dv_pl_entry_t *pl_tab; /* table has 1 pl entry per pfn in range */
+    int nr_mappings;  /* total number of mappings in this range */
+    int mappings_hwm; /* high water mark of max mapping count */
+    unsigned int dirty_count;
+} dv_range_t;
+
+/*
+ * This contains all the data structures required by a domain to
+ * bookkeep the dirty pages within its frame buffers.
+ */
+typedef struct dv_dirty_vram {
+    struct list_head range_head; /* head of the linked list of ranges */
+    struct list_head ext_head; /* head of list of extension pages */
+    dv_paddr_link_t *pl_free; /* free list of pl's within extension pages */
+    int nr_ranges; /* bookkeeps number of ranges */
+    int ranges_hwm; /* high water mark of max number of ranges */
+} dv_dirty_vram_t;
+
+/* Allocates domain's dirty_vram structure */
+dv_dirty_vram_t *
+dirty_vram_alloc(struct domain *d);
+
+/*
+ * Returns domain's dirty_vram structure,
+ * allocating it if necessary
+ */
+dv_dirty_vram_t *
+dirty_vram_find_or_alloc(struct domain *d);
+
+/* Frees domain's dirty_vram structure */
+void dirty_vram_free(struct domain *d);
+
+/* Returns dirty vram range containing gfn, NULL if none */
+struct dv_range *
+dirty_vram_range_find_gfn(struct domain *d,
+                          unsigned long gfn);
+
+/*
+ * Returns dirty vram range matching [ begin_pfn .. begin_pfn+nr ),
+ * NULL if none
+ */
+dv_range_t *
+dirty_vram_range_find(struct domain *d,
+                      unsigned long begin_pfn,
+                      unsigned long nr);
+
+/*
+ * Allocate dirty vram range containing [ begin_pfn .. begin_pfn+nr ),
+ * freeing any existing range that overlaps the new range.
+ */
+dv_range_t *
+dirty_vram_range_alloc(struct domain *d,
+                       unsigned long begin_pfn,
+                       unsigned long nr);
+
+/*
+ * Returns dirty vram range matching [ begin_pfn .. begin_pfn+nr ),
+ * creating a range if none already exists and
+ * freeing any existing range that overlaps the new range.
+ */
+dv_range_t *
+dirty_vram_range_find_or_alloc(struct domain *d,
+                               unsigned long begin_pfn,
+                               unsigned long nr);
+
+void dirty_vram_range_free(struct domain *d,
+                           dv_range_t *range);
+
+/* Bookkeep PTE address of a frame buffer page */
+int dirty_vram_range_update(struct domain *d,
+                            unsigned long gfn,
+                            paddr_t sl1ma,
+                            int set);
+
+/*
+ * smfn is no longer a shadow page.  Remove it from any
+ * dirty vram range mapping.
+ */
+void
+dirty_vram_delete_shadow(struct vcpu *v,
+                         unsigned long gfn,
+                         unsigned int shadow_type,
+                         mfn_t smfn);
+
+
+/*
+ * Scan all the L1 tables looking for VRAM mappings.
+ * Record them in the domain's dv_dirty_vram structure
+ */
+void sh_find_all_vram_mappings(struct vcpu *v,
+                               dv_range_t *range);
+
+/*
+ * Free a paddr_link struct, given address of its
+ * predecessor in singly-linked list
+ */
+dv_paddr_link_t *
+free_paddr_link(struct domain *d,
+                dv_paddr_link_t **ppl,
+                dv_paddr_link_t *pl);
+
+
+/* Enable VRAM dirty tracking. */
+int
+shadow_track_dirty_vram(struct domain *d,
+			unsigned long first_pfn,
+			unsigned long nr,
+			XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+
+int
+hap_track_dirty_vram(struct domain *d,
+		     unsigned long begin_pfn,
+		     unsigned long nr,
+		     XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+
+void
+hap_clean_vram_tracking_range(struct domain *d,
+			      unsigned long begin_pfn,
+			      unsigned long nr,
+			      uint8_t *dirty_bitmap);
+
+#endif /* _DIRTY_VRAM_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-x86/hap.h b/xen/include/asm-x86/hap.h
index 916a35b..3e3a1f5 100644
--- a/xen/include/asm-x86/hap.h
+++ b/xen/include/asm-x86/hap.h
@@ -57,10 +57,6 @@ void  hap_final_teardown(struct domain *d);
 void  hap_teardown(struct domain *d);
 void  hap_vcpu_init(struct vcpu *v);
 void  hap_logdirty_init(struct domain *d);
-int   hap_track_dirty_vram(struct domain *d,
-                           unsigned long begin_pfn,
-                           unsigned long nr,
-                           XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
 
 extern const struct paging_mode *hap_paging_get_mode(struct vcpu *);
 
diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h
index 27b3de5..6146542 100644
--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -74,7 +74,7 @@ struct hvm_domain {
     struct list_head       pinned_cacheattr_ranges;
 
     /* VRAM dirty support. */
-    struct sh_dirty_vram *dirty_vram;
+    struct dv_dirty_vram * dirty_vram;
 
     /* If one of vcpus of this domain is in no_fill_mode or
      * mtrr/pat between vcpus is not the same, set is_in_uc_mode
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 9a40f2c..f96ca3b 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -137,10 +137,10 @@ struct paging_mode {
 void paging_free_log_dirty_bitmap(struct domain *d);
 
 /* get the dirty bitmap for a specific range of pfns */
-int paging_log_dirty_range(struct domain *d,
-                           unsigned long begin_pfn,
-                           unsigned long nr,
-                           XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+void paging_log_dirty_range(struct domain *d,
+                            unsigned long begin_pfn,
+                            unsigned long nr,
+                            uint8_t *dirty_bitmap);
 
 /* enable log dirty */
 int paging_log_dirty_enable(struct domain *d);
@@ -183,15 +183,6 @@ int paging_mfn_is_dirty(struct domain *d, mfn_t gmfn);
 #define L4_LOGDIRTY_IDX(pfn) 0
 #endif
 
-/* VRAM dirty tracking support */
-struct sh_dirty_vram {
-    unsigned long begin_pfn;
-    unsigned long end_pfn;
-    paddr_t *sl1ma;
-    uint8_t *dirty_bitmap;
-    s_time_t last_dirty;
-};
-
 /*****************************************************************************
  * Entry points into the paging-assistance code */
 
diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
index 2eb6efc..940d7fd 100644
--- a/xen/include/asm-x86/shadow.h
+++ b/xen/include/asm-x86/shadow.h
@@ -62,12 +62,6 @@ void shadow_vcpu_init(struct vcpu *v);
 /* Enable an arbitrary shadow mode.  Call once at domain creation. */
 int shadow_enable(struct domain *d, u32 mode);
 
-/* Enable VRAM dirty bit tracking. */
-int shadow_track_dirty_vram(struct domain *d,
-                            unsigned long first_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
-
 /* Handler for shadow control ops: operations from user-space to enable
  * and disable ephemeral shadow modes (test mode and log-dirty mode) and
  * manipulate the log-dirty bitmap. */
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 21:32:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 21:32:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY1cC-000490-SA; Mon, 12 Nov 2012 21:32:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <robert.phillips@citrix.com>) id 1TY1cB-00048L-Bm
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 21:32:19 +0000
Received: from [85.158.143.35:25106] by server-2.bemta-4.messagelabs.com id
	59/3F-28922-3EA61A05; Mon, 12 Nov 2012 21:32:19 +0000
X-Env-Sender: robert.phillips@citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1352755932!14616307!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMwMDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12006 invoked from network); 12 Nov 2012 21:32:15 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 21:32:15 -0000
X-SBRS: -2.2
X-MesageID: 44332997
X-Ironport-Server: ftlpip01.citrite.net
X-Remote-IP: 75.150.106.249
X-Policy: $Relay
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="44332997"
Received: from 75-150-106-249-newengland.hfc.comcastbusiness.net (HELO
	paine.oldroadcomputing.net) ([75.150.106.249])
	by SMTP.CITRIX.COM with ESMTP; 12 Nov 2012 21:32:03 +0000
From: Robert Phillips <robert.phillips@citrix.com>
To: xen-devel@lists.xen.org
Date: Mon, 12 Nov 2012 16:31:53 -0500
Message-Id: <1352755913-4229-1-git-send-email-robert.phillips@citrix.com>
X-Mailer: git-send-email 1.7.9.5
Cc: Robert Phillips <robert.phillips@citrix.com>
Subject: [Xen-devel] [PATCH] Provide support for multiple frame buffers in
	Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Support is provided for both shadow and hardware assisted paging (HAP) modes.
This code bookkeeps the set of video frame buffers (vram),
detects when the guest has modified any of those buffers and, upon request,
returns a bitmap of the modified pages.
This lets other software components re-paint the portions of the monitor (or monitors) that have changed.
Each monitor has a frame buffer of some size at some position in guest physical memory.
The set of frame buffers being tracked can change over time as monitors are plugged and unplugged.
(Version 3 of this patch.)

Signed-Off-By: Robert Phillips <robert.phillips@citrix.com>
---
 tools/libxc/xenctrl.h            |   17 +-
 xen/arch/x86/hvm/Makefile        |    2 +-
 xen/arch/x86/hvm/hvm.c           |   16 +-
 xen/arch/x86/mm/Makefile         |    1 +
 xen/arch/x86/mm/dirty_vram.c     |  992 ++++++++++++++++++++++++++++++++++++++
 xen/arch/x86/mm/hap/hap.c        |  140 +-----
 xen/arch/x86/mm/paging.c         |  196 ++------
 xen/arch/x86/mm/shadow/common.c  |  335 +++++++------
 xen/arch/x86/mm/shadow/multi.c   |  174 +++----
 xen/arch/x86/mm/shadow/multi.h   |    7 +-
 xen/arch/x86/mm/shadow/types.h   |    1 +
 xen/include/asm-x86/dirty_vram.h |  201 ++++++++
 xen/include/asm-x86/hap.h        |    4 -
 xen/include/asm-x86/hvm/domain.h |    2 +-
 xen/include/asm-x86/paging.h     |   17 +-
 xen/include/asm-x86/shadow.h     |    6 -
 16 files changed, 1549 insertions(+), 562 deletions(-)
 create mode 100644 xen/arch/x86/mm/dirty_vram.c
 create mode 100644 xen/include/asm-x86/dirty_vram.h

diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..693d7fe 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -1552,15 +1552,20 @@ int xc_hvm_inject_msi(
     xc_interface *xch, domid_t dom, uint64_t addr, uint32_t data);
 
 /*
- * Track dirty bit changes in the VRAM area
+ * Track dirty bit changes in a VRAM region defined by
+ * [ first_pfn : first_pfn + nr - 1 ]
  *
  * All of this is done atomically:
- * - get the dirty bitmap since the last call
- * - set up dirty tracking area for period up to the next call
- * - clear the dirty tracking area.
+ * - gets the dirty bitmap since the last call, all zeroes for
+ *   the first call with some new region
+ * - sets up a dirty tracking region for period up to the next call
+ * - clears the specified dirty tracking region.
  *
- * Returns -ENODATA and does not fill bitmap if the area has changed since the
- * last call.
+ * Creating a new region causes any existing regions that it overlaps
+ * to be discarded.
+ *
+ * Specifying nr == 0 causes all regions to be discarded and
+ * disables dirty bit tracking.
  */
 int xc_hvm_track_dirty_vram(
     xc_interface *xch, domid_t dom,
diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile
index eea5555..e374aac 100644
--- a/xen/arch/x86/hvm/Makefile
+++ b/xen/arch/x86/hvm/Makefile
@@ -22,4 +22,4 @@ obj-y += vlapic.o
 obj-y += vmsi.o
 obj-y += vpic.o
 obj-y += vpt.o
-obj-y += vpmu.o
\ No newline at end of file
+obj-y += vpmu.o
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 34da2f5..3a3e5e4 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -57,6 +57,7 @@
 #include <asm/hvm/cacheattr.h>
 #include <asm/hvm/trace.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/dirty_vram.h>
 #include <asm/mtrr.h>
 #include <asm/apic.h>
 #include <public/sched.h>
@@ -66,6 +67,7 @@
 #include <asm/mem_event.h>
 #include <asm/mem_access.h>
 #include <public/mem_event.h>
+#include "../mm/mm-locks.h"
 
 bool_t __read_mostly hvm_enabled;
 
@@ -1433,8 +1435,20 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
          */
         if ( access_w )
         {
+            p2m_type_t pt;
+            pt = p2m_change_type(v->domain, gfn, p2m_ram_logdirty, p2m_ram_rw);
+            
+            paging_lock(v->domain);
+            if ( pt == p2m_ram_logdirty )
+            {
+                dv_range_t *range;
+                v->domain->arch.paging.log_dirty.dirty_count++;
+                range = dirty_vram_range_find_gfn(v->domain, gfn);
+                if ( range )
+                    range->dirty_count++;
+            }
             paging_mark_dirty(v->domain, mfn_x(mfn));
-            p2m_change_type(v->domain, gfn, p2m_ram_logdirty, p2m_ram_rw);
+            paging_unlock(v->domain);
         }
         rc = 1;
         goto out_put_gfn;
diff --git a/xen/arch/x86/mm/Makefile b/xen/arch/x86/mm/Makefile
index 73dcdf4..becd0c9 100644
--- a/xen/arch/x86/mm/Makefile
+++ b/xen/arch/x86/mm/Makefile
@@ -5,6 +5,7 @@ obj-y += paging.o
 obj-y += p2m.o p2m-pt.o p2m-ept.o p2m-pod.o
 obj-y += guest_walk_2.o
 obj-y += guest_walk_3.o
+obj-y += dirty_vram.o
 obj-$(x86_64) += guest_walk_4.o
 obj-$(x86_64) += mem_event.o
 obj-$(x86_64) += mem_paging.o
diff --git a/xen/arch/x86/mm/dirty_vram.c b/xen/arch/x86/mm/dirty_vram.c
new file mode 100644
index 0000000..e3c7c1f
--- /dev/null
+++ b/xen/arch/x86/mm/dirty_vram.c
@@ -0,0 +1,992 @@
+/*
+ * arch/x86/mm/dirty_vram.c: Bookkeep/query dirty VRAM pages
+ * with support for multiple frame buffers.
+ *
+ * Copyright (c) 2012, Citrix Systems, Inc. (Robert Phillips)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+
+#include <xen/types.h>
+#include <xen/sched.h>
+#include <xen/guest_access.h>
+#include <asm/shadow.h>
+#include <asm/dirty_vram.h>
+#include "mm-locks.h"
+
+#define DEBUG_stop_tracking_all_vram          0
+#define DEBUG_allocating_dirty_vram_range     0
+#define DEBUG_high_water_mark_for_vram_ranges 0
+#define DEBUG_freeing_dirty_vram_range        0
+#define DEBUG_allocate_paddr_links_page       0
+#define DEBUG_update_vram_mapping             0
+#define DEBUG_alloc_paddr_inject_fault        0
+
+/* Allocates domain's dirty_vram structure */
+dv_dirty_vram_t *
+dirty_vram_alloc(struct domain *d)
+{
+    dv_dirty_vram_t *dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    dirty_vram = d->arch.hvm_domain.dirty_vram = xzalloc(dv_dirty_vram_t);
+    if ( dirty_vram )
+    {
+        INIT_LIST_HEAD(&dirty_vram->range_head);
+        INIT_LIST_HEAD(&dirty_vram->ext_head);
+    }
+    return dirty_vram;
+}
+
+/*
+ * Returns domain's dirty_vram structure,
+ * allocating it if necessary
+ */
+dv_dirty_vram_t *
+dirty_vram_find_or_alloc(struct domain *d)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( !dirty_vram )
+        dirty_vram = dirty_vram_alloc(d);
+    return dirty_vram;
+}
+
+
+/* Free domain's dirty_vram structure */
+void dirty_vram_free(struct domain *d)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        struct list_head *curr, *next;
+        /* Free all the ranges */
+        list_for_each_safe(curr, next, &dirty_vram->range_head)
+        {
+            dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+#if DEBUG_stop_tracking_all_vram
+            gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] stop tracking all vram\n",
+                     range->begin_pfn, range->end_pfn);
+#endif
+            xfree(range->pl_tab);
+            xfree(range);
+        }
+        /* Free all the extension pages */
+        list_for_each_safe(curr, next, &dirty_vram->ext_head)
+        {
+            struct dv_paddr_link_ext *ext =
+                container_of(
+                    curr, struct dv_paddr_link_ext, ext_link);
+            struct page_info *pg = __virt_to_page(ext);
+            d->arch.paging.free_page(d, pg);
+        }
+
+        xfree(dirty_vram);
+        d->arch.hvm_domain.dirty_vram = NULL;
+    }
+}
+
+/* Returns dirty vram range containing gfn, NULL if none */
+struct dv_range *
+dirty_vram_range_find_gfn(struct domain *d,
+                          unsigned long gfn)
+{
+    struct dv_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        struct list_head *curr;
+        list_for_each(curr, &dirty_vram->range_head)
+        {
+            dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+            if ( gfn >= range->begin_pfn &&
+                 gfn <  range->end_pfn )
+                return range;
+        }
+    }
+    return NULL;
+}
+
+/*
+ * Returns pointer to dirty vram range matching [begin_pfn .. end_pfn ),
+ * NULL if none.
+ */
+dv_range_t *
+dirty_vram_range_find(struct domain *d,
+                      unsigned long begin_pfn,
+                      unsigned long nr)
+{
+    unsigned long end_pfn = begin_pfn + nr;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        struct list_head *curr;
+        list_for_each(curr, &dirty_vram->range_head)
+        {
+            dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+            if ( begin_pfn == range->begin_pfn &&
+                 end_pfn   == range->end_pfn )
+                return range;
+        }
+    }
+    return NULL;
+}
+
+/* Allocate specified dirty_vram range */
+static dv_range_t *
+_dirty_vram_range_alloc(struct domain *d,
+                        unsigned long begin_pfn,
+                        unsigned long nr)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_range_t *range = NULL;
+    unsigned long end_pfn = begin_pfn + nr;
+    dv_pl_entry_t *pl_tab = NULL;
+    int i;
+
+    ASSERT( paging_locked_by_me(d) );
+    ASSERT( dirty_vram != NULL );
+
+#if DEBUG_allocating_dirty_vram_range
+    gdprintk(XENLOG_DEBUG,
+             "[%05lx:%05lx] Allocating dirty vram range hap:%d\n",
+             begin_pfn, end_pfn,
+             d->arch.hvm_domain.hap_enabled);
+#endif
+
+    range = xzalloc(dv_range_t);
+    if ( range == NULL )
+        goto err_out;
+
+    INIT_LIST_HEAD(&range->range_link);
+
+    range->begin_pfn = begin_pfn;
+    range->end_pfn = end_pfn;
+
+    if ( !hap_enabled(d) )
+    {
+        if ( (pl_tab = xzalloc_array(dv_pl_entry_t, nr)) == NULL )
+            goto err_out;
+
+        for ( i = 0; i != nr; i++ )
+        {
+            pl_tab[i].mapping.sl1ma = INVALID_PADDR;
+        }
+    }
+
+    range->pl_tab = pl_tab;
+    range->mappings_hwm = 1;
+
+    list_add(&range->range_link, &dirty_vram->range_head);
+    if ( ++dirty_vram->nr_ranges > dirty_vram->ranges_hwm )
+    {
+        dirty_vram->ranges_hwm = dirty_vram->nr_ranges;
+#if DEBUG_high_water_mark_for_vram_ranges
+        gdprintk(XENLOG_DEBUG,
+                 "High water mark for number of vram ranges is now:%d\n",
+                 dirty_vram->ranges_hwm);
+#endif
+    }
+    return range;
+
+ err_out:
+    xfree(pl_tab);
+    xfree(range);
+    return NULL;
+}
+
+
+/* Frees specified dirty_vram range */
+void dirty_vram_range_free(struct domain *d,
+                           dv_range_t *range)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        int i, nr = range->end_pfn - range->begin_pfn;
+
+#if DEBUG_freeing_dirty_vram_range
+        gdprintk(XENLOG_DEBUG,
+                 "[%05lx:%05lx] Freeing dirty vram range\n",
+                 range->begin_pfn, range->end_pfn);
+#endif
+
+        if ( range->pl_tab )
+        {
+            for ( i = 0; i != nr; i++ )
+            {
+                dv_paddr_link_t *plx;
+                plx = range->pl_tab[i].mapping.pl_next;
+                /* Does current FB page have multiple mappings? */
+                if ( plx ) /* yes */
+                {
+                    /* Find the last element in singly-linked list */
+                    while ( plx->pl_next != NULL )
+                        plx = plx->pl_next;
+                    
+                    /* Prepend whole list to the free list */
+                    plx->pl_next = dirty_vram->pl_free;
+                    dirty_vram->pl_free = range->pl_tab[i].mapping.pl_next;
+                }
+            }
+            xfree(range->pl_tab);
+            range->pl_tab = NULL;
+        }
+
+        /* Remove range from the linked list, free it, and adjust count*/
+        list_del(&range->range_link);
+        xfree(range);
+        dirty_vram->nr_ranges--;
+    }
+}
+
+/*
+ * dirty_vram_range_alloc()
+ * This function ensures that the new range does not overlap any existing
+ * ranges -- deleting them if necessary -- and then calls
+ * _dirty_vram_range_alloc to actually allocate the new range.
+ */
+dv_range_t *
+dirty_vram_range_alloc(struct domain *d,
+                        unsigned long begin_pfn,
+                        unsigned long nr)
+{
+    unsigned long end_pfn = begin_pfn + nr;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_range_t *range;
+    struct list_head *curr, *next;
+
+    ASSERT( paging_locked_by_me(d) );
+    ASSERT( dirty_vram != NULL );
+
+    /*
+     * Ranges cannot overlap so
+     * free any range that overlaps [ begin_pfn .. end_pfn )
+     */
+    list_for_each_safe(curr, next, &dirty_vram->range_head)
+    {
+        dv_range_t *rng = list_entry(curr, dv_range_t, range_link);
+        if ( ( ( rng->begin_pfn <= begin_pfn ) &&
+               ( begin_pfn <  rng->end_pfn   )
+                 ) ||
+             ( ( begin_pfn <= rng->begin_pfn ) &&
+               ( rng->begin_pfn < end_pfn    )
+                 ) )
+        {
+            /* Different tracking, tear the previous down. */
+            dirty_vram_range_free(d, rng);
+        }
+    }
+
+    range = _dirty_vram_range_alloc(d, begin_pfn, nr);
+    if ( !range )
+        goto out;
+
+ out:
+    return range;
+}
+
+/*
+ * dirty_vram_range_find_or_alloc()
+ * Find the range for [begin_pfn:begin_pfn+nr).
+ * If it doesn't exists, create it.
+ */
+dv_range_t *
+dirty_vram_range_find_or_alloc(struct domain *d,
+                                unsigned long begin_pfn,
+                                unsigned long nr)
+{
+    dv_range_t *range;
+    ASSERT( paging_locked_by_me(d) );
+    range = dirty_vram_range_find(d, begin_pfn, nr);
+    if ( !range )
+        range = dirty_vram_range_alloc(d, begin_pfn, nr);
+    
+    return range;
+}
+
+
+
+/* Allocate a dv_paddr_link struct */
+static dv_paddr_link_t *
+alloc_paddr_link(struct domain *d)
+{
+    dv_paddr_link_t * pl = NULL;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+
+    ASSERT( paging_locked_by_me(d) );
+    BUILD_BUG_ON(sizeof(dv_paddr_link_ext_t) > PAGE_SIZE);
+    /* Is the list of free pl's empty? */
+    if ( dirty_vram->pl_free == NULL ) /* yes */
+    {
+        /*
+         * Allocate another page of pl's.
+         * Link them all together and point the free list head at them
+         */
+        int i;
+        struct page_info *pg = d->arch.paging.alloc_page(d);
+        dv_paddr_link_ext_t *ext = __page_to_virt(pg);
+        if ( ext == NULL )
+            goto out;
+
+#if DEBUG_allocate_paddr_links_page
+        gdprintk(XENLOG_DEBUG, "Allocated another page of paddr_links\n");
+#endif
+        list_add(&ext->ext_link, &dirty_vram->ext_head);
+
+        /* initialize and link together the new pl entries */
+        for ( i = 0; i != ARRAY_SIZE(ext->entries); i++ )
+        {
+            ext->entries[i].sl1ma = INVALID_PADDR;
+            ext->entries[i].pl_next = &ext->entries[i+1];
+        }
+        ext->entries[ARRAY_SIZE(ext->entries) - 1].pl_next = NULL;
+        dirty_vram->pl_free = &ext->entries[0];
+    }
+    pl = dirty_vram->pl_free;
+    dirty_vram->pl_free = pl->pl_next;
+
+    pl->sl1ma = INVALID_PADDR;
+    pl->pl_next = NULL;
+ out:
+    return pl;
+}
+
+
+/*
+ * Free a paddr_link struct.
+ *
+ * The caller has walked the singly-linked list of elements
+ * that have, as their head, an element in a pl_tab cell.
+ * The list walks has reached the element to be freed.
+ * (Each element is a dv_paddr_link_t struct.)
+ *
+ * @pl points to the element to be freed.
+ * @ppl points to its predecessor element's next member.
+ *
+ * After linking the precessor to the element's successor,
+ * we can free @pl by prepending it to the list of free
+ * elements.
+ *
+ * As a boundary case (which happens to be the common case),
+ * @pl points to a cell in the pl_tab rather than to some
+ * extension element danging from that cell.
+ * We recognize this case because @ppl is NULL.
+ * In that case we promote the first extension element by
+ * copying it into the pl_tab cell and free it.
+ */
+
+dv_paddr_link_t *
+free_paddr_link(struct domain *d,
+                dv_paddr_link_t **ppl,
+                dv_paddr_link_t *pl)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_paddr_link_t *npl; /* next pl */
+
+    ASSERT( paging_locked_by_me(d) );
+    /* extension mapping? */
+    if ( ppl ) /* yes. free it */
+    {
+        ASSERT(pl == (*ppl));
+        (*ppl) = npl = pl->pl_next;
+    }
+    else  /* main table */
+    {
+        /*
+         * move 2nd mapping to main table.
+         * and free 2nd mapping
+         */
+        dv_paddr_link_t * spl;
+        spl = pl->pl_next;
+        if ( spl == NULL )
+        {
+            pl->sl1ma = INVALID_PADDR;
+            return pl;
+        }
+        pl->sl1ma = spl->sl1ma;
+        pl->pl_next = spl->pl_next;
+        npl = pl; /* reprocess main table entry again */
+        pl = spl;
+    }
+    pl->sl1ma = INVALID_PADDR;
+    pl->pl_next = dirty_vram->pl_free;
+    dirty_vram->pl_free = pl;
+    return npl;
+}
+
+
+/*
+ * dirty_vram_range_update()
+ *
+ * This is called whenever a level 1 page table entry is modified.
+ * If the L1PTE is being cleared, the function removes any paddr_links
+ * that refer to it.
+ * If the L1PTE is being set to a frame buffer page, a paddr_link is
+ * created for that page's entry in pl_tab.
+ * Returns 1 iff entry found and set or cleared.
+ */
+int dirty_vram_range_update(struct domain *d,
+                            unsigned long gfn,
+                            paddr_t sl1ma,
+                            int set)
+{
+    int effective = 0;
+    dv_range_t *range;
+    unsigned long i;
+    dv_paddr_link_t *pl;
+    dv_paddr_link_t **ppl;
+    int len = 0;
+
+    ASSERT(paging_locked_by_me(d));
+    range = dirty_vram_range_find_gfn(d, gfn);
+    if ( !range )
+        return effective;
+
+    
+    i = gfn - range->begin_pfn;
+    pl = &range->pl_tab[ i ].mapping;
+    ppl = NULL;
+
+    /*
+     * find matching entry (pl), if any, and its predecessor
+     * in linked list (ppl)
+     */
+    while ( pl != NULL )
+    {
+        if ( pl->sl1ma == sl1ma || pl->sl1ma == INVALID_PADDR )
+            break;
+            
+        ppl = &pl->pl_next;
+        pl = *ppl;
+        len++;
+    }
+
+    if ( set )
+    {
+        /* Did we find sl1ma in either the main table or the linked list? */
+        if ( pl == NULL ) /* no, so we'll need to alloc a link */
+        {
+            ASSERT(ppl != NULL);
+            
+#if DEBUG_alloc_paddr_inject_fault
+            {
+                static int counter;
+                
+                /* Test stuck_dirty logic for some cases */
+                if ( (++counter) % 4 == 0 )
+                {
+                    /* Simply mark the frame buffer page as always dirty */
+                    range->pl_tab[ i ].stuck_dirty = 1;
+                    gdprintk(XENLOG_DEBUG,
+                             "[%lx] inject stuck dirty fault\n",
+                             gfn );
+                    goto out;
+                }
+            }
+#endif
+            /*
+             * Have we reached the limit of mappings we're willing
+             * to bookkeep?
+             */
+            if (len > DV_ADDR_LINK_LIST_LIMIT) /* yes */
+            {
+                /* Simply mark the frame buffer page as always dirty */
+                range->pl_tab[ i ].stuck_dirty = 1;
+                
+                gdprintk(XENLOG_DEBUG,
+                         "[%lx] link limit exceeded\n",
+                         gfn );
+                
+                goto out;
+            }
+
+            /* alloc link and append it to list */
+            (*ppl) = pl = alloc_paddr_link(d);
+            /* Were we able to allocate a link? */
+            if ( pl == NULL ) /* no */
+            {
+                /* Simply mark the frame buffer page as always dirty */
+                range->pl_tab[ i ].stuck_dirty = 1;
+                
+                gdprintk(XENLOG_DEBUG,
+                         "[%lx] alloc failure\n",
+                         gfn );
+                
+                goto out;
+            }
+        }
+        if ( pl->sl1ma != sl1ma )
+        {
+            ASSERT(pl->sl1ma == INVALID_PADDR);
+            pl->sl1ma = sl1ma;
+            range->nr_mappings++;
+        }
+        effective = 1;
+        if ( len > range->mappings_hwm )
+        {
+            range->mappings_hwm = len;
+#if DEBUG_update_vram_mapping
+            gdprintk(XENLOG_DEBUG,
+                     "[%lx] set      sl1ma:%lx hwm:%d mappings:%d freepages:%d\n",
+                     gfn, sl1ma,
+                     range->mappings_hwm,
+                     range->nr_mappings,
+                     d->arch.paging.shadow.free_pages);
+#endif
+        }
+    }
+    else /* clear */
+    {
+        if ( pl && pl->sl1ma == sl1ma )
+        {
+#if DEBUG_update_vram_mapping
+            gdprintk(XENLOG_DEBUG,
+                     "[%lx] clear    sl1ma:%lx mappings:%d\n",
+                     gfn, sl1ma,
+                     range->nr_mappings - 1);
+#endif
+            free_paddr_link(d, ppl, pl);
+            --range->nr_mappings;
+            effective = 1;
+        }
+    }
+ out:
+    return effective;
+}
+
+
+/*
+ * shadow_scan_dirty_flags()
+ * This produces a dirty bitmap for the range by examining every
+ * L1PTE referenced by some dv_paddr_link in the range's pl_tab table.
+ * It tests and clears each such L1PTE's dirty flag.
+ */
+static int shadow_scan_dirty_flags(struct domain *d,
+                                   dv_range_t *range,
+                                   uint8_t *dirty_bitmap)
+{
+    int flush_tlb = 0;
+    unsigned long i;
+    unsigned long nr = range->end_pfn - range->begin_pfn;
+
+    ASSERT( paging_locked_by_me(d) );
+    /* Iterate over VRAM to track dirty bits. */
+    for ( i = 0; i < nr; i++ )
+    {
+        int dirty = 0, len = 1;
+        dv_paddr_link_t *pl;
+        /* Does the frame buffer have an incomplete set of mappings? */
+        if ( unlikely(range->pl_tab[i].stuck_dirty) ) /* yes */
+            dirty = 1;
+        else /* The frame buffer's set of mappings is complete.  Scan it. */
+            for ( pl = &range->pl_tab[i].mapping; pl; pl = pl->pl_next, len++ )
+            {
+                l1_pgentry_t *sl1e;
+                paddr_t sl1ma = pl->sl1ma;
+                if (sl1ma == INVALID_PADDR) /* FB page is unmapped */
+                    continue;
+                sl1e = maddr_to_virt(sl1ma);
+                if ( l1e_get_flags(*sl1e) & _PAGE_DIRTY )
+                {
+                    dirty = 1;
+                    /* Clear dirty so we can detect if page gets re-dirtied.
+                     * Note: this is atomic, so we may clear a
+                     * _PAGE_ACCESSED set by another processor.
+                     */
+                    l1e_remove_flags(*sl1e, _PAGE_DIRTY);
+                    flush_tlb = 1;
+                }
+            } /* for */
+        
+        if ( dirty )
+            dirty_bitmap[i >> 3] |= (1 << (i & 7));
+
+    }
+
+    return flush_tlb;
+}
+
+
+/*
+ * shadow_track_dirty_vram()
+ * This is the API called by the guest to determine which pages in the range
+ * from [begin_pfn:begin_pfn+nr) have been dirtied since the last call.
+ * It creates the domain's dv_dirty_vram on demand.
+ * It creates ranges on demand when some [begin_pfn:nr) is first encountered.
+ * To collect the dirty bitmask it calls shadow_scan_dirty_flags().
+ * It copies the dirty bitmask into guest storage.
+ */
+int shadow_track_dirty_vram(struct domain *d,
+                            unsigned long begin_pfn,
+                            unsigned long nr,
+                            XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
+{
+    int rc = 0;
+    unsigned long end_pfn = begin_pfn + nr;
+    int flush_tlb = 0;
+    dv_range_t *range;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+
+    /*
+     * This range test is tricky.
+     *
+     * The range [begin_pfn..end_pfn) is an open interval, so end_pfn is a pfn
+     * beyond the end of the range.
+     *
+     * p2m->max_mapped_pfn is a valid PFN so p2m->max_mapped_pfn + 1 is an
+     * invalid PFN.
+     *
+     * If end_pfn is beyond *that* then the range is invalid.
+     */
+    if ( end_pfn < begin_pfn
+         || begin_pfn > p2m->max_mapped_pfn
+         || end_pfn > p2m->max_mapped_pfn + 1 )
+        return -EINVAL;
+
+    paging_lock(d);
+
+    if (!nr)
+    {
+        dirty_vram_free(d);
+        goto out;
+    }
+
+    if ( guest_handle_is_null(guest_dirty_bitmap) )
+        goto out;
+
+    if ( !dirty_vram_find_or_alloc(d) )
+    {
+        rc = -ENOMEM;
+        goto out;
+    }
+
+    range = dirty_vram_range_find(d, begin_pfn, nr);
+    if ( !range )
+    {
+        range = dirty_vram_range_alloc(d, begin_pfn, nr);
+        if ( range )
+            sh_find_all_vram_mappings(d->vcpu[0], range);
+    }
+    if ( range )
+    {
+        int size = (nr + BITS_PER_LONG - 1) / BITS_PER_LONG;
+        unsigned long dirty_bitmap[size];
+
+        memset(dirty_bitmap, 0x00, size * BYTES_PER_LONG);
+
+	flush_tlb |= shadow_scan_dirty_flags(d, range, (uint8_t*)dirty_bitmap);
+
+        rc = -EFAULT;
+        if ( copy_to_guest(guest_dirty_bitmap,
+                           (uint8_t*)dirty_bitmap,
+                           size * BYTES_PER_LONG) == 0 )
+            rc = 0;
+    }
+    
+    if ( flush_tlb )
+        flush_tlb_mask(d->domain_dirty_cpumask);
+
+out:
+    paging_unlock(d);
+    return rc;
+}
+
+
+/************************************************/
+/*          HAP VRAM TRACKING SUPPORT           */
+/************************************************/
+
+/*
+ * hap_enable_vram_tracking()
+ * For all ranges, mark all vram pages in range as logdirty read-only.
+ */
+static int hap_enable_vram_tracking(struct domain *d)
+{
+    int rc = 0;
+    dv_dirty_vram_t *dirty_vram;
+    struct list_head *curr;
+
+    /* turn on PG_log_dirty bit in paging mode */
+    paging_lock(d);
+    d->arch.paging.mode |= PG_log_dirty;
+    paging_unlock(d);
+
+    p2m_lock(p2m_get_hostp2m(d));
+    paging_lock(d);
+
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+
+    /*
+     * dirty_vram != NULL iff we're tracking dirty vram.
+     * If we start tracking dirty pages for all memory then
+     * the dirty_vram structure is freed.
+     */
+    if ( !dirty_vram )
+    {
+        rc = -EINVAL;
+        goto out;
+    }
+
+    /* set l1e entries of P2M table to be read-only. */
+    list_for_each(curr, &dirty_vram->range_head)
+    {
+	dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+	gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] enable  vram tracking\n",
+		 range->begin_pfn, range->end_pfn);
+	p2m_change_type_range(d, range->begin_pfn, range->end_pfn,
+			      p2m_ram_rw, p2m_ram_logdirty);
+    }
+
+    flush_tlb_mask(d->domain_dirty_cpumask);
+ out:
+    paging_unlock(d);
+    p2m_unlock(p2m_get_hostp2m(d));
+    if ( rc )
+    {
+        paging_lock(d);
+        d->arch.paging.mode &= ~PG_log_dirty;
+        paging_unlock(d);
+    }
+    return rc;
+}
+
+/*
+ * hap_disable_vram_tracking()
+ * For all ranges, mark all vram pages in range as logdirty read-write.
+ */
+static int hap_disable_vram_tracking(struct domain *d)
+{
+    int rc = 0;
+    dv_dirty_vram_t *dirty_vram;
+    struct list_head *curr;
+
+    paging_lock(d);
+    d->arch.paging.mode &= ~PG_log_dirty;
+    paging_unlock(d);
+
+    p2m_lock(p2m_get_hostp2m(d));
+    paging_lock(d);
+
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+    if ( !dirty_vram )
+    {
+        rc = -EINVAL;
+        goto out;
+    }
+
+    /* set l1e entries of P2M table with normal mode */
+    list_for_each(curr, &dirty_vram->range_head)
+    {
+	dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+	gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] disable vram tracking\n",
+		 range->begin_pfn, range->end_pfn);
+	p2m_change_type_range(d, range->begin_pfn, range->end_pfn,
+			      p2m_ram_logdirty, p2m_ram_rw);
+    }
+    flush_tlb_mask(d->domain_dirty_cpumask);
+ out:
+    paging_unlock(d);
+    p2m_unlock(p2m_get_hostp2m(d));
+    if ( rc )
+    {
+        paging_lock(d);
+        d->arch.paging.mode |= PG_log_dirty;
+        paging_unlock(d);
+    }
+    return rc;
+}
+
+/*
+ * hap_clean_vram_tracking_range()
+ * For all the pages in the range specified by [begin_pfn,nr),
+ * note in the dirty bitmap any page that has been marked as read-write,
+ * which signifies that the page has been dirtied, and reset the page
+ * to ram_logdirty.
+ */
+void hap_clean_vram_tracking_range(struct domain *d,
+                                   unsigned long begin_pfn,
+                                   unsigned long nr,
+                                   uint8_t *dirty_bitmap)
+{
+    int i;
+    unsigned long pfn;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_range_t *range;
+
+    ASSERT(p2m_locked_by_me(p2m_get_hostp2m(d)));
+    ASSERT(paging_locked_by_me(d));
+
+    if ( !dirty_vram )
+    {
+        gdprintk(XENLOG_DEBUG,
+                 "Should only be called while tracking dirty vram.\n");
+        return;
+    }
+
+    range = dirty_vram_range_find(d, begin_pfn, nr);
+    if ( !range )
+        return;
+
+    /* set l1e entries of P2M table to be read-only. */
+    /*
+     * On first write, it page faults, its entry is changed to read-write,
+     * its bit in the dirty bitmap is set, and on retry the write succeeds.
+     */
+    for ( i = 0, pfn = range->begin_pfn; pfn < range->end_pfn; i++, pfn++ )
+    {
+        p2m_type_t pt;
+        pt = p2m_change_type(d, pfn, p2m_ram_rw, p2m_ram_logdirty);
+        if ( pt == p2m_ram_rw )
+            dirty_bitmap[i >> 3] |= (1 << (i & 7));
+    }
+    flush_tlb_mask(d->domain_dirty_cpumask);
+}
+
+static void hap_vram_tracking_init(struct domain *d)
+{
+    paging_log_dirty_init(d, hap_enable_vram_tracking,
+                          hap_disable_vram_tracking,
+                          NULL);
+}
+
+/*
+ * hap_track_dirty_vram()
+ * Create the domain's dv_dirty_vram struct on demand.
+ * Create a dirty vram range on demand when some [begin_pfn:begin_pfn+nr] is
+ * first encountered.
+ * Collect the guest_dirty bitmask, a bit mask of the dirty vram pages, by
+ * calling paging_log_dirty_range().
+ */
+int hap_track_dirty_vram(struct domain *d,
+                         unsigned long begin_pfn,
+                         unsigned long nr,
+                         XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
+{
+    long rc = 0;
+    dv_dirty_vram_t *dirty_vram;
+
+    paging_lock(d);
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+    if ( nr )
+    {
+        dv_range_t *range = NULL;
+        int size = ( nr + BITS_PER_LONG - 1 ) & ~( BITS_PER_LONG - 1 );
+        uint8_t dirty_bitmap[size];
+        bool_t new_range = 0;
+
+        /* Already tracking dirty vram? */
+        if ( paging_mode_log_dirty(d) && dirty_vram ) /* yes */
+        {
+            /* Handle the addition of another range */
+            range = dirty_vram_range_find(d, begin_pfn, nr);
+            if ( !range )
+            {
+                rc = -ENOMEM;
+                if ( !(range = dirty_vram_range_alloc(d, begin_pfn, nr)) )
+                    goto param_fail;
+                new_range = 1;
+            }
+        }
+        /* Just starting to track dirty vram? */
+        else if ( !paging_mode_log_dirty(d) && !dirty_vram ) /* yes */
+        {
+            rc = -ENOMEM;
+            if ( !(dirty_vram = dirty_vram_alloc(d)) )
+                goto param_fail;
+
+            if ( !(range = dirty_vram_range_find_or_alloc(d, begin_pfn, nr)) )
+                goto param_fail;
+
+            new_range = 1;
+            
+            /* Initialize callbacks for vram tracking */
+            hap_vram_tracking_init(d);
+
+            /* Enable HAP vram tracking */
+            paging_unlock(d);
+            rc = paging_log_dirty_enable(d);
+            paging_lock(d);
+            
+            if ( rc != 0 )
+                goto param_fail;
+        }
+        else
+        {
+            /* Test for invalid combination */
+            if ( !paging_mode_log_dirty(d) && dirty_vram )
+                rc = -EINVAL;
+            else /* logging dirty of all memory, not tracking dirty vram */
+                rc = -ENODATA;
+            goto param_fail;
+        }
+
+        paging_unlock(d);
+        /* Is this query the very first for this range? */
+        if ( new_range ) /* yes */
+            memset(dirty_bitmap, 0xff, size); /* consider all pages dirty */
+        else
+        {
+            memset(dirty_bitmap, 0x00, size);
+            paging_log_dirty_range(d, begin_pfn, nr, dirty_bitmap);
+        }
+        rc = -EFAULT;
+        if ( copy_to_guest(guest_dirty_bitmap,
+                           dirty_bitmap,
+                           size) == 0 )
+        {
+            rc = 0;
+        }
+    }
+    else
+    {
+        /*
+         * If zero pages specified while already tracking dirty vram
+         * then stop tracking
+         */
+        if ( paging_mode_log_dirty(d) && dirty_vram )
+        {
+            /* Disable HAP vram tracking */
+            paging_unlock(d);
+            rc = paging_log_dirty_disable(d);
+            paging_lock(d);
+            
+            dirty_vram_free(d);
+        }
+        else /* benign no-op */
+        {
+            rc = 0;
+        }
+        paging_unlock(d);
+    }
+
+    return rc;
+
+param_fail:
+    dirty_vram_free(d);
+    paging_unlock(d);
+    return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index fd99cde..09cdba2 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -41,6 +41,7 @@
 #include <asm/domain.h>
 #include <xen/numa.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/dirty_vram.h>
 
 #include "private.h"
 
@@ -53,139 +54,6 @@
 #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
 
 /************************************************/
-/*          HAP VRAM TRACKING SUPPORT           */
-/************************************************/
-
-static int hap_enable_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return -EINVAL;
-
-    /* turn on PG_log_dirty bit in paging mode */
-    paging_lock(d);
-    d->arch.paging.mode |= PG_log_dirty;
-    paging_unlock(d);
-
-    /* set l1e entries of P2M table to be read-only. */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_rw, p2m_ram_logdirty);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-    return 0;
-}
-
-static int hap_disable_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return -EINVAL;
-
-    paging_lock(d);
-    d->arch.paging.mode &= ~PG_log_dirty;
-    paging_unlock(d);
-
-    /* set l1e entries of P2M table with normal mode */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_logdirty, p2m_ram_rw);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-    return 0;
-}
-
-static void hap_clean_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return;
-
-    /* set l1e entries of P2M table to be read-only. */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_rw, p2m_ram_logdirty);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-}
-
-static void hap_vram_tracking_init(struct domain *d)
-{
-    paging_log_dirty_init(d, hap_enable_vram_tracking,
-                          hap_disable_vram_tracking,
-                          hap_clean_vram_tracking);
-}
-
-int hap_track_dirty_vram(struct domain *d,
-                         unsigned long begin_pfn,
-                         unsigned long nr,
-                         XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
-{
-    long rc = 0;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( nr )
-    {
-        if ( paging_mode_log_dirty(d) && dirty_vram )
-        {
-            if ( begin_pfn != dirty_vram->begin_pfn ||
-                 begin_pfn + nr != dirty_vram->end_pfn )
-            {
-                paging_log_dirty_disable(d);
-                dirty_vram->begin_pfn = begin_pfn;
-                dirty_vram->end_pfn = begin_pfn + nr;
-                rc = paging_log_dirty_enable(d);
-                if (rc != 0)
-                    goto param_fail;
-            }
-        }
-        else if ( !paging_mode_log_dirty(d) && !dirty_vram )
-        {
-            rc = -ENOMEM;
-            if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL )
-                goto param_fail;
-
-            dirty_vram->begin_pfn = begin_pfn;
-            dirty_vram->end_pfn = begin_pfn + nr;
-            d->arch.hvm_domain.dirty_vram = dirty_vram;
-            hap_vram_tracking_init(d);
-            rc = paging_log_dirty_enable(d);
-            if (rc != 0)
-                goto param_fail;
-        }
-        else
-        {
-            if ( !paging_mode_log_dirty(d) && dirty_vram )
-                rc = -EINVAL;
-            else
-                rc = -ENODATA;
-            goto param_fail;
-        }
-        /* get the bitmap */
-        rc = paging_log_dirty_range(d, begin_pfn, nr, dirty_bitmap);
-    }
-    else
-    {
-        if ( paging_mode_log_dirty(d) && dirty_vram ) {
-            rc = paging_log_dirty_disable(d);
-            xfree(dirty_vram);
-            dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-        } else
-            rc = 0;
-    }
-
-    return rc;
-
-param_fail:
-    if ( dirty_vram )
-    {
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-    }
-    return rc;
-}
-
-/************************************************/
 /*            HAP LOG DIRTY SUPPORT             */
 /************************************************/
 
@@ -223,14 +91,12 @@ static void hap_clean_dirty_bitmap(struct domain *d)
 
 void hap_logdirty_init(struct domain *d)
 {
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    struct dv_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
     if ( paging_mode_log_dirty(d) && dirty_vram )
     {
         paging_log_dirty_disable(d);
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
+        dirty_vram_free(d);
     }
-
     /* Reinitialize logdirty mechanism */
     paging_log_dirty_init(d, hap_enable_log_dirty,
                           hap_disable_log_dirty,
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index ea44e39..55bedde 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -27,6 +27,7 @@
 #include <asm/p2m.h>
 #include <asm/hap.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/dirty_vram.h>
 #include <xen/numa.h>
 #include <xsm/xsm.h>
 
@@ -333,8 +334,11 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
     mfn_t *l4, *l3, *l2;
     unsigned long *l1;
     int i4, i3, i2;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
 
     domain_pause(d);
+    /* Locking hierarchy requires p2m lock to be taken first */
+    p2m_lock(p2m);
     paging_lock(d);
 
     clean = (sc->op == XEN_DOMCTL_SHADOW_OP_CLEAN);
@@ -345,6 +349,14 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
                  d->arch.paging.log_dirty.fault_count,
                  d->arch.paging.log_dirty.dirty_count);
 
+    if ( hap_enabled(d) && d->arch.hvm_domain.dirty_vram )
+    {
+        /* If we're cleaning/peeking all guest memory, we should not be tracking
+         * dirty vram. */
+        rv = -EINVAL;
+        goto out;
+    }
+
     sc->stats.fault_count = d->arch.paging.log_dirty.fault_count;
     sc->stats.dirty_count = d->arch.paging.log_dirty.dirty_count;
 
@@ -424,170 +436,64 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
 
     if ( clean )
     {
-        /* We need to further call clean_dirty_bitmap() functions of specific
-         * paging modes (shadow or hap).  Safe because the domain is paused. */
-        d->arch.paging.log_dirty.clean_dirty_bitmap(d);
+        /* Is null if tracking dirty vram */
+        if ( d->arch.paging.log_dirty.clean_dirty_bitmap )
+        {
+            /*
+             * We need to call clean_dirty_bitmap() functions of specific
+             * paging modes (shadow or hap).
+             * Safe because the domain is paused.
+             */
+            d->arch.paging.log_dirty.clean_dirty_bitmap(d);
+        }
     }
     domain_unpause(d);
     return rv;
 
  out:
     paging_unlock(d);
+    p2m_unlock(p2m);
     domain_unpause(d);
     return rv;
 }
 
-int paging_log_dirty_range(struct domain *d,
-                            unsigned long begin_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
+void paging_log_dirty_range(struct domain *d,
+                           unsigned long begin_pfn,
+                           unsigned long nr,
+                           uint8_t *dirty_bitmap)
 {
-    int rv = 0;
-    unsigned long pages = 0;
-    mfn_t *l4, *l3, *l2;
-    unsigned long *l1;
-    int b1, b2, b3, b4;
-    int i2, i3, i4;
-
-    d->arch.paging.log_dirty.clean_dirty_bitmap(d);
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    dv_range_t *range;
+    unsigned int range_dirty_count = 0;
+    
+    p2m_lock(p2m);
     paging_lock(d);
 
-    PAGING_DEBUG(LOGDIRTY, "log-dirty-range: dom %u faults=%u dirty=%u\n",
-                 d->domain_id,
-                 d->arch.paging.log_dirty.fault_count,
-                 d->arch.paging.log_dirty.dirty_count);
-
-    if ( unlikely(d->arch.paging.log_dirty.failed_allocs) ) {
-        printk("%s: %d failed page allocs while logging dirty pages\n",
-               __FUNCTION__, d->arch.paging.log_dirty.failed_allocs);
-        rv = -ENOMEM;
-        goto out;
-    }
-
-    if ( !d->arch.paging.log_dirty.fault_count &&
-         !d->arch.paging.log_dirty.dirty_count ) {
-        unsigned int size = BITS_TO_LONGS(nr);
-
-        if ( clear_guest(dirty_bitmap, size * BYTES_PER_LONG) != 0 )
-            rv = -EFAULT;
-        goto out;
-    }
-    d->arch.paging.log_dirty.fault_count = 0;
-    d->arch.paging.log_dirty.dirty_count = 0;
-
-    b1 = L1_LOGDIRTY_IDX(begin_pfn);
-    b2 = L2_LOGDIRTY_IDX(begin_pfn);
-    b3 = L3_LOGDIRTY_IDX(begin_pfn);
-    b4 = L4_LOGDIRTY_IDX(begin_pfn);
-    l4 = paging_map_log_dirty_bitmap(d);
-
-    for ( i4 = b4;
-          (pages < nr) && (i4 < LOGDIRTY_NODE_ENTRIES);
-          i4++ )
+    /* Only called when tracking dirty vram in HAP mode */
+    ASSERT(hap_enabled(d) && d->arch.hvm_domain.dirty_vram);
+    
+    range = dirty_vram_range_find_gfn(d, begin_pfn);
+    if ( range )
     {
-        l3 = (l4 && mfn_valid(l4[i4])) ? map_domain_page(mfn_x(l4[i4])) : NULL;
-        for ( i3 = b3;
-              (pages < nr) && (i3 < LOGDIRTY_NODE_ENTRIES);
-              i3++ )
-        {
-            l2 = ((l3 && mfn_valid(l3[i3])) ?
-                  map_domain_page(mfn_x(l3[i3])) : NULL);
-            for ( i2 = b2;
-                  (pages < nr) && (i2 < LOGDIRTY_NODE_ENTRIES);
-                  i2++ )
-            {
-                unsigned int bytes = PAGE_SIZE;
-                uint8_t *s;
-                l1 = ((l2 && mfn_valid(l2[i2])) ?
-                      map_domain_page(mfn_x(l2[i2])) : NULL);
-
-                s = ((uint8_t*)l1) + (b1 >> 3);
-                bytes -= b1 >> 3;
-
-                if ( likely(((nr - pages + 7) >> 3) < bytes) )
-                    bytes = (unsigned int)((nr - pages + 7) >> 3);
-
-                if ( !l1 )
-                {
-                    if ( clear_guest_offset(dirty_bitmap, pages >> 3,
-                                            bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-                /* begin_pfn is not 32K aligned, hence we have to bit
-                 * shift the bitmap */
-                else if ( b1 & 0x7 )
-                {
-                    int i, j;
-                    uint32_t *l = (uint32_t*) s;
-                    int bits = b1 & 0x7;
-                    int bitmask = (1 << bits) - 1;
-                    int size = (bytes + BYTES_PER_LONG - 1) / BYTES_PER_LONG;
-                    unsigned long bitmap[size];
-                    static unsigned long printed = 0;
-
-                    if ( printed != begin_pfn )
-                    {
-                        dprintk(XENLOG_DEBUG, "%s: begin_pfn %lx is not 32K aligned!\n",
-                                __FUNCTION__, begin_pfn);
-                        printed = begin_pfn;
-                    }
-
-                    for ( i = 0; i < size - 1; i++, l++ ) {
-                        bitmap[i] = ((*l) >> bits) |
-                            (((*((uint8_t*)(l + 1))) & bitmask) << (sizeof(*l) * 8 - bits));
-                    }
-                    s = (uint8_t*) l;
-                    size = BYTES_PER_LONG - ((b1 >> 3) & 0x3);
-                    bitmap[i] = 0;
-                    for ( j = 0; j < size; j++, s++ )
-                        bitmap[i] |= (*s) << (j * 8);
-                    bitmap[i] = (bitmap[i] >> bits) | (bitmask << (size * 8 - bits));
-                    if ( copy_to_guest_offset(dirty_bitmap, (pages >> 3),
-                                (uint8_t*) bitmap, bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-                else
-                {
-                    if ( copy_to_guest_offset(dirty_bitmap, pages >> 3,
-                                              s, bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-
-                pages += bytes << 3;
-                if ( l1 )
-                {
-                    clear_page(l1);
-                    unmap_domain_page(l1);
-                }
-                b1 = b1 & 0x7;
-            }
-            b2 = 0;
-            if ( l2 )
-                unmap_domain_page(l2);
-        }
-        b3 = 0;
-        if ( l3 )
-            unmap_domain_page(l3);
+        range_dirty_count = range->dirty_count;
+        range->dirty_count = 0;
     }
-    if ( l4 )
-        unmap_domain_page(l4);
-
-    paging_unlock(d);
+    
+    if ( !range_dirty_count)
+        goto out;
 
-    return rv;
+    PAGING_DEBUG(LOGDIRTY,
+                 "log-dirty-range: dom %u [%05lx:%05lx] range_dirty=%u\n",
+                 d->domain_id,
+                 begin_pfn,
+                 range->end_pfn,
+                 range_dirty_count);
 
+    hap_clean_vram_tracking_range(d, begin_pfn, nr, dirty_bitmap);
  out:
     paging_unlock(d);
-    return rv;
+    p2m_unlock(p2m);
+    return;
 }
 
 /* Note that this function takes three function pointers. Callers must supply
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index ce79131..56afd16 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -36,6 +36,7 @@
 #include <asm/current.h>
 #include <asm/flushtlb.h>
 #include <asm/shadow.h>
+#include <asm/dirty_vram.h>
 #include <xen/numa.h>
 #include "private.h"
 
@@ -3121,12 +3122,7 @@ void shadow_teardown(struct domain *d)
      * calls now that we've torn down the bitmap */
     d->arch.paging.mode &= ~PG_log_dirty;
 
-    if (d->arch.hvm_domain.dirty_vram) {
-        xfree(d->arch.hvm_domain.dirty_vram->sl1ma);
-        xfree(d->arch.hvm_domain.dirty_vram->dirty_bitmap);
-        xfree(d->arch.hvm_domain.dirty_vram);
-        d->arch.hvm_domain.dirty_vram = NULL;
-    }
+    dirty_vram_free(d);
 
     paging_unlock(d);
 
@@ -3463,179 +3459,212 @@ void shadow_clean_dirty_bitmap(struct domain *d)
 
 
 /**************************************************************************/
-/* VRAM dirty tracking support */
-int shadow_track_dirty_vram(struct domain *d,
-                            unsigned long begin_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
-{
-    int rc;
-    unsigned long end_pfn = begin_pfn + nr;
-    unsigned long dirty_size = (nr + 7) / 8;
-    int flush_tlb = 0;
-    unsigned long i;
-    p2m_type_t t;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-    struct p2m_domain *p2m = p2m_get_hostp2m(d);
-
-    if (end_pfn < begin_pfn
-            || begin_pfn > p2m->max_mapped_pfn
-            || end_pfn >= p2m->max_mapped_pfn)
-        return -EINVAL;
-
-    /* We perform p2m lookups, so lock the p2m upfront to avoid deadlock */
-    p2m_lock(p2m_get_hostp2m(d));
-    paging_lock(d);
+/* Support functions for shadow-based dirty VRAM code */
 
-    if ( dirty_vram && (!nr ||
-             ( begin_pfn != dirty_vram->begin_pfn
-            || end_pfn   != dirty_vram->end_pfn )) )
-    {
-        /* Different tracking, tear the previous down. */
-        gdprintk(XENLOG_INFO, "stopping tracking VRAM %lx - %lx\n", dirty_vram->begin_pfn, dirty_vram->end_pfn);
-        xfree(dirty_vram->sl1ma);
-        xfree(dirty_vram->dirty_bitmap);
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-    }
+#define DEBUG_unshadow_sl1ma                  0          
+#define DEBUG_unshadow_sl1ma_detail           0
+#define DEBUG_count_initial_mappings          1
 
-    if ( !nr )
+/* smfn is no longer a shadow page.  Remove it from any
+ * dirty vram range mapping. */
+void
+dirty_vram_delete_shadow(struct vcpu *v,
+                         unsigned long gfn,
+                         unsigned int shadow_type, 
+                         mfn_t smfn)
+{
+    static unsigned int l1_shadow_mask = 
+          1 << SH_type_l1_32_shadow
+        | 1 << SH_type_fl1_32_shadow
+        | 1 << SH_type_l1_pae_shadow
+        | 1 << SH_type_fl1_pae_shadow
+        | 1 << SH_type_l1_64_shadow
+        | 1 << SH_type_fl1_64_shadow
+        ;
+    struct domain *d = v->domain;
+    dv_dirty_vram_t *dirty_vram;
+    struct list_head *curr, *next;
+    
+    ASSERT(paging_locked_by_me(d));
+    /* Ignore all but level 1 shadows */
+    
+    if ( (l1_shadow_mask & (1 << shadow_type)) == 0 )
     {
-        rc = 0;
         goto out;
     }
 
-    /* This should happen seldomly (Video mode change),
-     * no need to be careful. */
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
     if ( !dirty_vram )
     {
-        /* Throw away all the shadows rather than walking through them 
-         * up to nr times getting rid of mappings of each pfn */
-        shadow_blow_tables(d);
-
-        gdprintk(XENLOG_INFO, "tracking VRAM %lx - %lx\n", begin_pfn, end_pfn);
-
-        rc = -ENOMEM;
-        if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL )
-            goto out;
-        dirty_vram->begin_pfn = begin_pfn;
-        dirty_vram->end_pfn = end_pfn;
-        d->arch.hvm_domain.dirty_vram = dirty_vram;
-
-        if ( (dirty_vram->sl1ma = xmalloc_array(paddr_t, nr)) == NULL )
-            goto out_dirty_vram;
-        memset(dirty_vram->sl1ma, ~0, sizeof(paddr_t) * nr);
-
-        if ( (dirty_vram->dirty_bitmap = xzalloc_array(uint8_t, dirty_size)) == NULL )
-            goto out_sl1ma;
-
-        dirty_vram->last_dirty = NOW();
-
-        /* Tell the caller that this time we could not track dirty bits. */
-        rc = -ENODATA;
-    }
-    else if (dirty_vram->last_dirty == -1)
-    {
-        /* still completely clean, just copy our empty bitmap */
-        rc = -EFAULT;
-        if ( copy_to_guest(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size) == 0 )
-            rc = 0;
+        goto out;
     }
-    else
+        
+    list_for_each_safe(curr, next, &dirty_vram->range_head)
     {
-        /* Iterate over VRAM to track dirty bits. */
-        for ( i = 0; i < nr; i++ ) {
-            mfn_t mfn = get_gfn_query_unlocked(d, begin_pfn + i, &t);
-            struct page_info *page;
-            int dirty = 0;
-            paddr_t sl1ma = dirty_vram->sl1ma[i];
-
-            if (mfn_x(mfn) == INVALID_MFN)
-            {
-                dirty = 1;
-            }
-            else
+        dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+        unsigned long i;
+        int max_mappings = 1, mappings = 0;
+        int unshadowed = 0;
+        for ( i = 0; i != range->end_pfn - range->begin_pfn; i++ )
+        {
+            dv_paddr_link_t *pl = &range->pl_tab[ i ].mapping;
+            dv_paddr_link_t **ppl = NULL;
+            mappings = 0;
+            
+            while ( pl != NULL )
             {
-                page = mfn_to_page(mfn);
-                switch (page->u.inuse.type_info & PGT_count_mask)
-                {
-                case 0:
-                    /* No guest reference, nothing to track. */
-                    break;
-                case 1:
-                    /* One guest reference. */
-                    if ( sl1ma == INVALID_PADDR )
-                    {
-                        /* We don't know which sl1e points to this, too bad. */
-                        dirty = 1;
-                        /* TODO: Heuristics for finding the single mapping of
-                         * this gmfn */
-                        flush_tlb |= sh_remove_all_mappings(d->vcpu[0], mfn);
-                    }
-                    else
-                    {
-                        /* Hopefully the most common case: only one mapping,
-                         * whose dirty bit we can use. */
-                        l1_pgentry_t *sl1e = maddr_to_virt(sl1ma);
-
-                        if ( l1e_get_flags(*sl1e) & _PAGE_DIRTY )
-                        {
-                            dirty = 1;
-                            /* Note: this is atomic, so we may clear a
-                             * _PAGE_ACCESSED set by another processor. */
-                            l1e_remove_flags(*sl1e, _PAGE_DIRTY);
-                            flush_tlb = 1;
-                        }
-                    }
-                    break;
-                default:
-                    /* More than one guest reference,
-                     * we don't afford tracking that. */
-                    dirty = 1;
+                paddr_t sl1ma = pl->sl1ma;
+                unsigned long sl1mn;
+                
+                if ( sl1ma == INVALID_PADDR )
                     break;
+                
+                sl1mn = sl1ma >> PAGE_SHIFT;
+                if ( sl1mn == mfn_x(smfn) ) {
+#if DEBUG_unshadow_sl1ma_detail
+                    gdprintk(XENLOG_DEBUG,
+                             "[%lx] gfn[%lx] unshadow sl1ma:%lx\n",
+                             mfn_x(smfn),
+                             range->begin_pfn + i,
+                             sl1ma);
+#endif
+                    unshadowed++;
+                    pl = free_paddr_link(d, ppl, pl);
+                    --range->nr_mappings;
+                }
+                else
+                {
+                    ppl = &pl->pl_next;
+                    pl = *ppl;
+                    mappings++;
                 }
             }
-
-            if ( dirty )
+        }
+        if ( mappings > max_mappings )
+            max_mappings = mappings;
+        
+        if ( unshadowed ) {
+#if DEBUG_unshadow_sl1ma
+            gdprintk(XENLOG_DEBUG,
+                     "[%lx] gfn[%05lx:%05lx] unshadowed:%d mappings:0x%x max_mappings:%d\n",
+                     mfn_x(smfn),
+                     range->begin_pfn, range->end_pfn,
+                     unshadowed, range->nr_mappings, max_mappings);
+#endif
+            if ( range->nr_mappings == 0 )
             {
-                dirty_vram->dirty_bitmap[i / 8] |= 1 << (i % 8);
-                dirty_vram->last_dirty = NOW();
+                dirty_vram_range_free(d, range);                    
             }
         }
+    }
+ out:
+    return;
+}
+
+
+typedef int (*hash_pfn_callback_t)(struct vcpu *v,
+                                   mfn_t smfn,
+                                   unsigned long begin_pfn,
+                                   unsigned long end_pfn,
+                                   int *removed);
+
+static int hash_pfn_foreach(struct vcpu *v, 
+                            unsigned int callback_mask, 
+                            hash_pfn_callback_t callbacks[], 
+                            unsigned long begin_pfn,
+                            unsigned long end_pfn)
+/* Walk the hash table looking at the types of the entries and 
+ * calling the appropriate callback function for each entry. 
+ * The mask determines which shadow types we call back for, and the array
+ * of callbacks tells us which function to call.
+ * Any callback may return non-zero to let us skip the rest of the scan. 
+ *
+ * WARNING: Callbacks MUST NOT add or remove hash entries unless they 
+ * then return non-zero to terminate the scan. */
+{
+    int i, done = 0, removed = 0;
+    struct domain *d = v->domain;
+    struct page_info *x;
+
+    /* Say we're here, to stop hash-lookups reordering the chains */
+    ASSERT(paging_locked_by_me(d));
+    ASSERT(d->arch.paging.shadow.hash_walking == 0);
+    d->arch.paging.shadow.hash_walking = 1;
 
-        rc = -EFAULT;
-        if ( copy_to_guest(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size) == 0 ) {
-            memset(dirty_vram->dirty_bitmap, 0, dirty_size);
-            if (dirty_vram->last_dirty + SECONDS(2) < NOW())
+    for ( i = 0; i < SHADOW_HASH_BUCKETS; i++ ) 
+    {
+        /* WARNING: This is not safe against changes to the hash table.
+         * The callback *must* return non-zero if it has inserted or
+         * deleted anything from the hash (lookups are OK, though). */
+        for ( x = d->arch.paging.shadow.hash_table[i]; x; x = next_shadow(x) )
+        {
+            if ( callback_mask & (1 << x->u.sh.type) )
             {
-                /* was clean for more than two seconds, try to disable guest
-                 * write access */
-                for ( i = begin_pfn; i < end_pfn; i++ ) {
-                    mfn_t mfn = get_gfn_query_unlocked(d, i, &t);
-                    if (mfn_x(mfn) != INVALID_MFN)
-                        flush_tlb |= sh_remove_write_access(d->vcpu[0], mfn, 1, 0);
-                }
-                dirty_vram->last_dirty = -1;
+                ASSERT(x->u.sh.type <= 15);
+                ASSERT(callbacks[x->u.sh.type] != NULL);
+                done = callbacks[x->u.sh.type](v, page_to_mfn(x), 
+                                               begin_pfn, end_pfn,
+                                               &removed);
+                if ( done ) break;
             }
-            rc = 0;
         }
+        if ( done ) break; 
     }
-    if ( flush_tlb )
-        flush_tlb_mask(d->domain_dirty_cpumask);
-    goto out;
+    d->arch.paging.shadow.hash_walking = 0;
+    return removed;
+}
 
-out_sl1ma:
-    xfree(dirty_vram->sl1ma);
-out_dirty_vram:
-    xfree(dirty_vram);
-    dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
+void sh_find_all_vram_mappings(struct vcpu *v,
+                               dv_range_t *range)
+{
+    /* Dispatch table for getting per-type functions */
+    static hash_pfn_callback_t callbacks[SH_type_unused] = {
+        NULL, /* none    */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 2), /* l1_32   */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 2), /* fl1_32  */
+        NULL, /* l2_32   */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 3), /* l1_pae  */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 3), /* fl1_pae */
+        NULL, /* l2_pae  */
+        NULL, /* l2h_pae */
+#if CONFIG_PAGING_LEVELS >= 4
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 4), /* l1_64   */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 4), /* fl1_64  */
+#else
+        NULL, /* l1_64   */
+        NULL, /* fl1_64  */
+#endif
+        NULL, /* l2_64   */
+        NULL, /* l2h_64  */
+        NULL, /* l3_64   */
+        NULL, /* l4_64   */
+        NULL, /* p2m     */
+        NULL  /* unused  */
+    };
 
-out:
-    paging_unlock(d);
-    p2m_unlock(p2m_get_hostp2m(d));
-    return rc;
+    static unsigned int callback_mask = 
+          1 << SH_type_l1_32_shadow
+        | 1 << SH_type_fl1_32_shadow
+        | 1 << SH_type_l1_pae_shadow
+        | 1 << SH_type_fl1_pae_shadow
+        | 1 << SH_type_l1_64_shadow
+        | 1 << SH_type_fl1_64_shadow
+        ;
+
+    perfc_incr(shadow_mappings);
+
+    hash_pfn_foreach(v, callback_mask, callbacks,
+                     range->begin_pfn,
+                     range->end_pfn);
+
+#if DEBUG_count_initial_mappings
+    gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] count of initial mappings:%d\n",
+             range->begin_pfn, range->end_pfn,
+             range->nr_mappings);
+#endif
 }
 
+
 /**************************************************************************/
 /* Shadow-control XEN_DOMCTL dispatcher */
 
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index b0e6d72..9c00574 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -35,6 +35,7 @@
 #include <asm/flushtlb.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/cacheattr.h>
+#include <asm/dirty_vram.h>
 #include <asm/mtrr.h>
 #include <asm/guest_pt.h>
 #include <public/sched.h>
@@ -149,6 +150,10 @@ delete_fl1_shadow_status(struct vcpu *v, gfn_t gfn, mfn_t smfn)
     SHADOW_PRINTK("gfn=%"SH_PRI_gfn", type=%08x, smfn=%05lx\n",
                    gfn_x(gfn), SH_type_fl1_shadow, mfn_x(smfn));
     ASSERT(mfn_to_page(smfn)->u.sh.head);
+
+    /* Removing any dv_paddr_links to the erstwhile shadow page */
+    dirty_vram_delete_shadow(v, gfn_x(gfn), SH_type_fl1_shadow, smfn);
+    
     shadow_hash_delete(v, gfn_x(gfn), SH_type_fl1_shadow, smfn);
 }
 
@@ -160,6 +165,10 @@ delete_shadow_status(struct vcpu *v, mfn_t gmfn, u32 shadow_type, mfn_t smfn)
                    v->domain->domain_id, v->vcpu_id,
                    mfn_x(gmfn), shadow_type, mfn_x(smfn));
     ASSERT(mfn_to_page(smfn)->u.sh.head);
+    
+    /* Removing any dv_paddr_links to the erstwhile shadow page */
+    dirty_vram_delete_shadow(v, mfn_x(gmfn), shadow_type, smfn);
+    
     shadow_hash_delete(v, mfn_x(gmfn), shadow_type, smfn);
     /* 32-on-64 PV guests don't own their l4 pages; see set_shadow_status */
     if ( !is_pv_32on64_vcpu(v) || shadow_type != SH_type_l4_64_shadow )
@@ -516,7 +525,6 @@ _sh_propagate(struct vcpu *v,
     guest_l1e_t guest_entry = { guest_intpte };
     shadow_l1e_t *sp = shadow_entry_ptr;
     struct domain *d = v->domain;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
     gfn_t target_gfn = guest_l1e_get_gfn(guest_entry);
     u32 pass_thru_flags;
     u32 gflags, sflags;
@@ -663,17 +671,6 @@ _sh_propagate(struct vcpu *v,
         }
     }
 
-    if ( unlikely((level == 1) && dirty_vram
-            && dirty_vram->last_dirty == -1
-            && gfn_x(target_gfn) >= dirty_vram->begin_pfn
-            && gfn_x(target_gfn) < dirty_vram->end_pfn) )
-    {
-        if ( ft & FETCH_TYPE_WRITE )
-            dirty_vram->last_dirty = NOW();
-        else
-            sflags &= ~_PAGE_RW;
-    }
-
     /* Read-only memory */
     if ( p2m_is_readonly(p2mt) ||
          (p2mt == p2m_mmio_direct &&
@@ -1072,101 +1069,60 @@ static int shadow_set_l2e(struct vcpu *v,
     return flags;
 }
 
-static inline void shadow_vram_get_l1e(shadow_l1e_t new_sl1e,
+/* shadow_vram_fix_l1e()
+ *
+ * Tests L1PTEs as they are modified, looking for when they start to
+ * (or cease to) point to frame buffer pages.  If the old and new gfns differ,
+ * calls dirty_vram_range_update() to updates the dirty_vram structures.
+ */
+static inline void shadow_vram_fix_l1e(shadow_l1e_t old_sl1e,
+                                       shadow_l1e_t new_sl1e,
                                        shadow_l1e_t *sl1e,
                                        mfn_t sl1mfn,
                                        struct domain *d)
 { 
-    mfn_t mfn = shadow_l1e_get_mfn(new_sl1e);
-    int flags = shadow_l1e_get_flags(new_sl1e);
-    unsigned long gfn;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    mfn_t new_mfn, old_mfn;
+    unsigned long new_gfn = INVALID_M2P_ENTRY, old_gfn = INVALID_M2P_ENTRY;
+    paddr_t sl1ma;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
 
-    if ( !dirty_vram         /* tracking disabled? */
-         || !(flags & _PAGE_RW) /* read-only mapping? */
-         || !mfn_valid(mfn) )   /* mfn can be invalid in mmio_direct */
+    if ( !dirty_vram )
         return;
 
-    gfn = mfn_to_gfn(d, mfn);
-    /* Page sharing not supported on shadow PTs */
-    BUG_ON(SHARED_M2P(gfn));
+    sl1ma = pfn_to_paddr(mfn_x(sl1mfn)) | ((unsigned long)sl1e & ~PAGE_MASK);
 
-    if ( (gfn >= dirty_vram->begin_pfn) && (gfn < dirty_vram->end_pfn) )
+    old_mfn = shadow_l1e_get_mfn(old_sl1e);
+
+    if ( !sh_l1e_is_magic(old_sl1e) &&
+         (l1e_get_flags(old_sl1e) & _PAGE_PRESENT) &&
+         mfn_valid(old_mfn))
     {
-        unsigned long i = gfn - dirty_vram->begin_pfn;
-        struct page_info *page = mfn_to_page(mfn);
-        
-        if ( (page->u.inuse.type_info & PGT_count_mask) == 1 )
-            /* Initial guest reference, record it */
-            dirty_vram->sl1ma[i] = pfn_to_paddr(mfn_x(sl1mfn))
-                | ((unsigned long)sl1e & ~PAGE_MASK);
+        old_gfn = mfn_to_gfn(d, old_mfn);
     }
-}
-
-static inline void shadow_vram_put_l1e(shadow_l1e_t old_sl1e,
-                                       shadow_l1e_t *sl1e,
-                                       mfn_t sl1mfn,
-                                       struct domain *d)
-{
-    mfn_t mfn = shadow_l1e_get_mfn(old_sl1e);
-    int flags = shadow_l1e_get_flags(old_sl1e);
-    unsigned long gfn;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram         /* tracking disabled? */
-         || !(flags & _PAGE_RW) /* read-only mapping? */
-         || !mfn_valid(mfn) )   /* mfn can be invalid in mmio_direct */
-        return;
-
-    gfn = mfn_to_gfn(d, mfn);
-    /* Page sharing not supported on shadow PTs */
-    BUG_ON(SHARED_M2P(gfn));
-
-    if ( (gfn >= dirty_vram->begin_pfn) && (gfn < dirty_vram->end_pfn) )
+    
+    new_mfn = shadow_l1e_get_mfn(new_sl1e);
+    if ( !sh_l1e_is_magic(new_sl1e) &&
+         (l1e_get_flags(new_sl1e) & _PAGE_PRESENT) &&
+         mfn_valid(new_mfn))
     {
-        unsigned long i = gfn - dirty_vram->begin_pfn;
-        struct page_info *page = mfn_to_page(mfn);
-        int dirty = 0;
-        paddr_t sl1ma = pfn_to_paddr(mfn_x(sl1mfn))
-            | ((unsigned long)sl1e & ~PAGE_MASK);
+        new_gfn = mfn_to_gfn(d, new_mfn);
+    }
 
-        if ( (page->u.inuse.type_info & PGT_count_mask) == 1 )
-        {
-            /* Last reference */
-            if ( dirty_vram->sl1ma[i] == INVALID_PADDR ) {
-                /* We didn't know it was that one, let's say it is dirty */
-                dirty = 1;
-            }
-            else
-            {
-                ASSERT(dirty_vram->sl1ma[i] == sl1ma);
-                dirty_vram->sl1ma[i] = INVALID_PADDR;
-                if ( flags & _PAGE_DIRTY )
-                    dirty = 1;
-            }
-        }
-        else
+    if ( old_gfn == new_gfn ) return;
+
+    if ( VALID_M2P(old_gfn) )
+        if ( dirty_vram_range_update(d, old_gfn, sl1ma, 0/*clear*/) )
         {
-            /* We had more than one reference, just consider the page dirty. */
-            dirty = 1;
-            /* Check that it's not the one we recorded. */
-            if ( dirty_vram->sl1ma[i] == sl1ma )
-            {
-                /* Too bad, we remembered the wrong one... */
-                dirty_vram->sl1ma[i] = INVALID_PADDR;
-            }
-            else
-            {
-                /* Ok, our recorded sl1e is still pointing to this page, let's
-                 * just hope it will remain. */
-            }
+            SHADOW_PRINTK("gfn %lx (mfn %lx) cleared vram pte\n",
+                          old_gfn, mfn_x(old_mfn));
         }
-        if ( dirty )
+
+    if ( VALID_M2P(new_gfn) )
+        if ( dirty_vram_range_update(d, new_gfn, sl1ma, 1/*set*/) )
         {
-            dirty_vram->dirty_bitmap[i / 8] |= 1 << (i % 8);
-            dirty_vram->last_dirty = NOW();
+            SHADOW_PRINTK("gfn %lx (mfn %lx) set vram pte\n",
+                          new_gfn, mfn_x(new_mfn));
         }
-    }
 }
 
 static int shadow_set_l1e(struct vcpu *v, 
@@ -1211,12 +1167,13 @@ static int shadow_set_l1e(struct vcpu *v,
                 shadow_l1e_remove_flags(new_sl1e, _PAGE_RW);
                 /* fall through */
             case 0:
-                shadow_vram_get_l1e(new_sl1e, sl1e, sl1mfn, d);
                 break;
             }
         }
     } 
 
+    shadow_vram_fix_l1e(old_sl1e, new_sl1e, sl1e, sl1mfn, d);
+
     /* Write the new entry */
     shadow_write_entries(sl1e, &new_sl1e, 1, sl1mfn);
     flags |= SHADOW_SET_CHANGED;
@@ -1231,7 +1188,6 @@ static int shadow_set_l1e(struct vcpu *v,
          * trigger a flush later. */
         if ( shadow_mode_refcounts(d) ) 
         {
-            shadow_vram_put_l1e(old_sl1e, sl1e, sl1mfn, d);
             shadow_put_page_from_l1e(old_sl1e, d);
             TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_SHADOW_L1_PUT_REF);
         } 
@@ -2018,7 +1974,6 @@ void sh_destroy_l1_shadow(struct vcpu *v, mfn_t smfn)
         SHADOW_FOREACH_L1E(sl1mfn, sl1e, 0, 0, {
             if ( (shadow_l1e_get_flags(*sl1e) & _PAGE_PRESENT)
                  && !sh_l1e_is_magic(*sl1e) ) {
-                shadow_vram_put_l1e(*sl1e, sl1e, sl1mfn, d);
                 shadow_put_page_from_l1e(*sl1e, d);
             }
         });
@@ -4336,6 +4291,37 @@ int sh_rm_mappings_from_l1(struct vcpu *v, mfn_t sl1mfn, mfn_t target_mfn)
     return done;
 }
 
+
+int sh_find_vram_mappings_in_l1(struct vcpu *v,
+                                mfn_t sl1mfn,
+                                unsigned long begin_pfn,
+                                unsigned long end_pfn,
+                                int *removed)
+/* Find all VRAM mappings in this shadow l1 table */
+{
+    struct domain *d = v->domain;
+    shadow_l1e_t *sl1e;
+    int done = 0;
+
+    /* only returns _PAGE_PRESENT entries */
+    SHADOW_FOREACH_L1E(sl1mfn, sl1e, 0, done, 
+    {
+        unsigned long gfn;
+        mfn_t gmfn = shadow_l1e_get_mfn(*sl1e);
+        if ( !mfn_valid(gmfn) )
+            continue;
+        gfn = mfn_to_gfn(d, gmfn);
+        if ( VALID_M2P(gfn) && (begin_pfn <= gfn) && (gfn < end_pfn) ) 
+        {
+            paddr_t sl1ma =
+                pfn_to_paddr(mfn_x(sl1mfn)) |
+                ( (unsigned long)sl1e & ~PAGE_MASK );
+            dirty_vram_range_update(v->domain, gfn, sl1ma, 1/*set*/);
+        }
+    });
+    return 0;
+}
+
 /**************************************************************************/
 /* Functions to excise all pointers to shadows from higher-level shadows. */
 
diff --git a/xen/arch/x86/mm/shadow/multi.h b/xen/arch/x86/mm/shadow/multi.h
index 835121e..436a4ac 100644
--- a/xen/arch/x86/mm/shadow/multi.h
+++ b/xen/arch/x86/mm/shadow/multi.h
@@ -66,7 +66,12 @@ SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, GUEST_LEVELS)
 extern int
 SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, GUEST_LEVELS)
     (struct vcpu *v, mfn_t sl1mfn, mfn_t target_mfn);
-
+extern int
+SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, GUEST_LEVELS)
+     (struct vcpu *v, mfn_t sl1mfn, 
+      unsigned long begin_pfn,
+      unsigned long end_pfn,
+      int *removed);
 extern void
 SHADOW_INTERNAL_NAME(sh_clear_shadow_entry, GUEST_LEVELS)
     (struct vcpu *v, void *ep, mfn_t smfn);
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index 43ce1db..5b0f9f7 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -229,6 +229,7 @@ static inline shadow_l4e_t shadow_l4e_from_mfn(mfn_t mfn, u32 flags)
 #define sh_update_cr3              INTERNAL_NAME(sh_update_cr3)
 #define sh_rm_write_access_from_l1 INTERNAL_NAME(sh_rm_write_access_from_l1)
 #define sh_rm_mappings_from_l1     INTERNAL_NAME(sh_rm_mappings_from_l1)
+#define sh_find_vram_mappings_in_l1 INTERNAL_NAME(sh_find_vram_mappings_in_l1)
 #define sh_remove_l1_shadow        INTERNAL_NAME(sh_remove_l1_shadow)
 #define sh_remove_l2_shadow        INTERNAL_NAME(sh_remove_l2_shadow)
 #define sh_remove_l3_shadow        INTERNAL_NAME(sh_remove_l3_shadow)
diff --git a/xen/include/asm-x86/dirty_vram.h b/xen/include/asm-x86/dirty_vram.h
new file mode 100644
index 0000000..95637de
--- /dev/null
+++ b/xen/include/asm-x86/dirty_vram.h
@@ -0,0 +1,201 @@
+/******************************************************************************
+ * include/asm-x86/dirty_vram.h
+ *
+ * Interface for tracking dirty VRAM pages
+ *
+ * Copyright (c) 2012 Citrix Systems, Inc. (Robert Phillips)
+ * Parts of this code are Copyright (c) 2006 by XenSource Inc.
+ * Parts of this code are Copyright (c) 2006 by Michael A Fetterman
+ * Parts based on earlier work by Michael A Fetterman, Ian Pratt et al.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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
+ */
+
+#ifndef _DIRTY_VRAM_H
+#define _DIRTY_VRAM_H
+
+/*
+ * In shadow mode we need to bookkeep all the L1 page table entries that
+ * map a frame buffer page.  Struct dv_paddr_link does this
+ * by recording the address of a L1 page table entry for some frame buffer page.
+ * Also has a link to additional pl entries if the frame buffer page
+ * has multiple mappings.
+ * In practice very few pages have multiple mappings.
+ * But to rule out some pathological situation, we limit the number of
+ * mappings we're willing to bookkeep.
+ */
+
+#define DV_ADDR_LINK_LIST_LIMIT 20
+
+typedef struct dv_paddr_link {
+    paddr_t sl1ma;
+    struct dv_paddr_link *pl_next;
+} dv_paddr_link_t;
+
+typedef struct dv_pl_entry {
+    dv_paddr_link_t mapping;
+    bool_t stuck_dirty;
+} dv_pl_entry_t;
+
+/*
+ * This defines an extension page of pl entries for FB pages with multiple
+ * mappings. All such pages (of a domain) are linked together.
+ */
+typedef struct dv_paddr_link_ext {
+    struct list_head ext_link;
+    dv_paddr_link_t entries[ ( PAGE_SIZE - sizeof( struct list_head ) ) /
+                             sizeof( dv_paddr_link_t ) ];
+} dv_paddr_link_ext_t;
+
+/*
+ * This defines a single frame buffer range.  It bookkeeps all the level 1 PTEs
+ * that map guest pages within that range.
+ * All such ranges (of a domain) are linked together.
+ */
+typedef struct dv_range {
+    struct list_head range_link; /* the several ranges form a linked list */
+    unsigned long begin_pfn;
+    unsigned long end_pfn;
+    dv_pl_entry_t *pl_tab; /* table has 1 pl entry per pfn in range */
+    int nr_mappings;  /* total number of mappings in this range */
+    int mappings_hwm; /* high water mark of max mapping count */
+    unsigned int dirty_count;
+} dv_range_t;
+
+/*
+ * This contains all the data structures required by a domain to
+ * bookkeep the dirty pages within its frame buffers.
+ */
+typedef struct dv_dirty_vram {
+    struct list_head range_head; /* head of the linked list of ranges */
+    struct list_head ext_head; /* head of list of extension pages */
+    dv_paddr_link_t *pl_free; /* free list of pl's within extension pages */
+    int nr_ranges; /* bookkeeps number of ranges */
+    int ranges_hwm; /* high water mark of max number of ranges */
+} dv_dirty_vram_t;
+
+/* Allocates domain's dirty_vram structure */
+dv_dirty_vram_t *
+dirty_vram_alloc(struct domain *d);
+
+/*
+ * Returns domain's dirty_vram structure,
+ * allocating it if necessary
+ */
+dv_dirty_vram_t *
+dirty_vram_find_or_alloc(struct domain *d);
+
+/* Frees domain's dirty_vram structure */
+void dirty_vram_free(struct domain *d);
+
+/* Returns dirty vram range containing gfn, NULL if none */
+struct dv_range *
+dirty_vram_range_find_gfn(struct domain *d,
+                          unsigned long gfn);
+
+/*
+ * Returns dirty vram range matching [ begin_pfn .. begin_pfn+nr ),
+ * NULL if none
+ */
+dv_range_t *
+dirty_vram_range_find(struct domain *d,
+                      unsigned long begin_pfn,
+                      unsigned long nr);
+
+/*
+ * Allocate dirty vram range containing [ begin_pfn .. begin_pfn+nr ),
+ * freeing any existing range that overlaps the new range.
+ */
+dv_range_t *
+dirty_vram_range_alloc(struct domain *d,
+                       unsigned long begin_pfn,
+                       unsigned long nr);
+
+/*
+ * Returns dirty vram range matching [ begin_pfn .. begin_pfn+nr ),
+ * creating a range if none already exists and
+ * freeing any existing range that overlaps the new range.
+ */
+dv_range_t *
+dirty_vram_range_find_or_alloc(struct domain *d,
+                               unsigned long begin_pfn,
+                               unsigned long nr);
+
+void dirty_vram_range_free(struct domain *d,
+                           dv_range_t *range);
+
+/* Bookkeep PTE address of a frame buffer page */
+int dirty_vram_range_update(struct domain *d,
+                            unsigned long gfn,
+                            paddr_t sl1ma,
+                            int set);
+
+/*
+ * smfn is no longer a shadow page.  Remove it from any
+ * dirty vram range mapping.
+ */
+void
+dirty_vram_delete_shadow(struct vcpu *v,
+                         unsigned long gfn,
+                         unsigned int shadow_type,
+                         mfn_t smfn);
+
+
+/*
+ * Scan all the L1 tables looking for VRAM mappings.
+ * Record them in the domain's dv_dirty_vram structure
+ */
+void sh_find_all_vram_mappings(struct vcpu *v,
+                               dv_range_t *range);
+
+/*
+ * Free a paddr_link struct, given address of its
+ * predecessor in singly-linked list
+ */
+dv_paddr_link_t *
+free_paddr_link(struct domain *d,
+                dv_paddr_link_t **ppl,
+                dv_paddr_link_t *pl);
+
+
+/* Enable VRAM dirty tracking. */
+int
+shadow_track_dirty_vram(struct domain *d,
+			unsigned long first_pfn,
+			unsigned long nr,
+			XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+
+int
+hap_track_dirty_vram(struct domain *d,
+		     unsigned long begin_pfn,
+		     unsigned long nr,
+		     XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+
+void
+hap_clean_vram_tracking_range(struct domain *d,
+			      unsigned long begin_pfn,
+			      unsigned long nr,
+			      uint8_t *dirty_bitmap);
+
+#endif /* _DIRTY_VRAM_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-x86/hap.h b/xen/include/asm-x86/hap.h
index 916a35b..3e3a1f5 100644
--- a/xen/include/asm-x86/hap.h
+++ b/xen/include/asm-x86/hap.h
@@ -57,10 +57,6 @@ void  hap_final_teardown(struct domain *d);
 void  hap_teardown(struct domain *d);
 void  hap_vcpu_init(struct vcpu *v);
 void  hap_logdirty_init(struct domain *d);
-int   hap_track_dirty_vram(struct domain *d,
-                           unsigned long begin_pfn,
-                           unsigned long nr,
-                           XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
 
 extern const struct paging_mode *hap_paging_get_mode(struct vcpu *);
 
diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h
index 27b3de5..6146542 100644
--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -74,7 +74,7 @@ struct hvm_domain {
     struct list_head       pinned_cacheattr_ranges;
 
     /* VRAM dirty support. */
-    struct sh_dirty_vram *dirty_vram;
+    struct dv_dirty_vram * dirty_vram;
 
     /* If one of vcpus of this domain is in no_fill_mode or
      * mtrr/pat between vcpus is not the same, set is_in_uc_mode
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 9a40f2c..f96ca3b 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -137,10 +137,10 @@ struct paging_mode {
 void paging_free_log_dirty_bitmap(struct domain *d);
 
 /* get the dirty bitmap for a specific range of pfns */
-int paging_log_dirty_range(struct domain *d,
-                           unsigned long begin_pfn,
-                           unsigned long nr,
-                           XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+void paging_log_dirty_range(struct domain *d,
+                            unsigned long begin_pfn,
+                            unsigned long nr,
+                            uint8_t *dirty_bitmap);
 
 /* enable log dirty */
 int paging_log_dirty_enable(struct domain *d);
@@ -183,15 +183,6 @@ int paging_mfn_is_dirty(struct domain *d, mfn_t gmfn);
 #define L4_LOGDIRTY_IDX(pfn) 0
 #endif
 
-/* VRAM dirty tracking support */
-struct sh_dirty_vram {
-    unsigned long begin_pfn;
-    unsigned long end_pfn;
-    paddr_t *sl1ma;
-    uint8_t *dirty_bitmap;
-    s_time_t last_dirty;
-};
-
 /*****************************************************************************
  * Entry points into the paging-assistance code */
 
diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
index 2eb6efc..940d7fd 100644
--- a/xen/include/asm-x86/shadow.h
+++ b/xen/include/asm-x86/shadow.h
@@ -62,12 +62,6 @@ void shadow_vcpu_init(struct vcpu *v);
 /* Enable an arbitrary shadow mode.  Call once at domain creation. */
 int shadow_enable(struct domain *d, u32 mode);
 
-/* Enable VRAM dirty bit tracking. */
-int shadow_track_dirty_vram(struct domain *d,
-                            unsigned long first_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
-
 /* Handler for shadow control ops: operations from user-space to enable
  * and disable ephemeral shadow modes (test mode and log-dirty mode) and
  * manipulate the log-dirty bitmap. */
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 23:03:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 23:03:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY31a-00057T-3o; Mon, 12 Nov 2012 23:02:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mattjd@gmail.com>) id 1TY31Z-00057O-8Z
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 23:02:37 +0000
Received: from [85.158.143.35:37577] by server-3.bemta-4.messagelabs.com id
	74/51-06841-C0081A05; Mon, 12 Nov 2012 23:02:36 +0000
X-Env-Sender: mattjd@gmail.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1352761354!11965630!1
X-Originating-IP: [209.85.214.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27811 invoked from network); 12 Nov 2012 23:02:36 -0000
Received: from mail-ob0-f173.google.com (HELO mail-ob0-f173.google.com)
	(209.85.214.173)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 23:02:36 -0000
Received: by mail-ob0-f173.google.com with SMTP id x4so1016473obh.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 15:02:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=l6rWfotPuckpNd79FvIHUW/5Sv02mtkXn2bzLYrB1oc=;
	b=dtRT2sNSy+madv6YdknYX1/6gytPMh3sON9uFY+2u3u10sPXuO5AWARHb2tb54cUKz
	QK+qWTDAhD0Z98Nh/cdUobWsO3LJw0gyKGCl4w+/n5nAAHDv68BI0mTxdymXO9TR8i3u
	e6erlR74iiff58sC0Khjll2VkOo4G0TIOyeEVb2JwfX0lZ9+w0MgUoP1GPbBEaNkksws
	Nn7io4CNSkAGs8qr0V209Uj7OxCROvz/H7MSOZ2qaCcDJOzY6JMiAwXsv+o0DOsy82CK
	fhxva6vXqXhCuXzu1SBcR/DZT2ppujJfOajHBhRGsU+PJfwMJTdvswYKHPCdyh1x9pL+
	b6ow==
MIME-Version: 1.0
Received: by 10.182.146.46 with SMTP id sz14mr16330987obb.76.1352761354548;
	Mon, 12 Nov 2012 15:02:34 -0800 (PST)
Received: by 10.76.171.130 with HTTP; Mon, 12 Nov 2012 15:02:34 -0800 (PST)
In-Reply-To: <3f722899-a618-4388-8a09-e68fc50c1a70@default>
References: <3f722899-a618-4388-8a09-e68fc50c1a70@default>
Date: Tue, 13 Nov 2012 12:02:34 +1300
Message-ID: <CA+nUz_JEQ97FxVZZFg9VJe+0ty+w4v4FYcaRyucnrXY9wo3uJg@mail.gmail.com>
From: Matthew Daley <mattjd@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] tmem: Prevent NULL dereference on error case
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 13, 2012 at 5:30 AM, Dan Magenheimer
<dan.magenheimer@oracle.com> wrote:
> Did you see this on an actual save/restore or just by inspection?
> This should only happen as a result of a buggy toolstack so I'm
> wondering if fixing this hides a toolstack bug.

Just by inspection of the hypervisor side, so there's no need to worry
about the toolstack.

- Matthew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 23:03:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 23:03:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY31a-00057T-3o; Mon, 12 Nov 2012 23:02:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mattjd@gmail.com>) id 1TY31Z-00057O-8Z
	for xen-devel@lists.xen.org; Mon, 12 Nov 2012 23:02:37 +0000
Received: from [85.158.143.35:37577] by server-3.bemta-4.messagelabs.com id
	74/51-06841-C0081A05; Mon, 12 Nov 2012 23:02:36 +0000
X-Env-Sender: mattjd@gmail.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1352761354!11965630!1
X-Originating-IP: [209.85.214.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27811 invoked from network); 12 Nov 2012 23:02:36 -0000
Received: from mail-ob0-f173.google.com (HELO mail-ob0-f173.google.com)
	(209.85.214.173)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 23:02:36 -0000
Received: by mail-ob0-f173.google.com with SMTP id x4so1016473obh.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 15:02:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=l6rWfotPuckpNd79FvIHUW/5Sv02mtkXn2bzLYrB1oc=;
	b=dtRT2sNSy+madv6YdknYX1/6gytPMh3sON9uFY+2u3u10sPXuO5AWARHb2tb54cUKz
	QK+qWTDAhD0Z98Nh/cdUobWsO3LJw0gyKGCl4w+/n5nAAHDv68BI0mTxdymXO9TR8i3u
	e6erlR74iiff58sC0Khjll2VkOo4G0TIOyeEVb2JwfX0lZ9+w0MgUoP1GPbBEaNkksws
	Nn7io4CNSkAGs8qr0V209Uj7OxCROvz/H7MSOZ2qaCcDJOzY6JMiAwXsv+o0DOsy82CK
	fhxva6vXqXhCuXzu1SBcR/DZT2ppujJfOajHBhRGsU+PJfwMJTdvswYKHPCdyh1x9pL+
	b6ow==
MIME-Version: 1.0
Received: by 10.182.146.46 with SMTP id sz14mr16330987obb.76.1352761354548;
	Mon, 12 Nov 2012 15:02:34 -0800 (PST)
Received: by 10.76.171.130 with HTTP; Mon, 12 Nov 2012 15:02:34 -0800 (PST)
In-Reply-To: <3f722899-a618-4388-8a09-e68fc50c1a70@default>
References: <3f722899-a618-4388-8a09-e68fc50c1a70@default>
Date: Tue, 13 Nov 2012 12:02:34 +1300
Message-ID: <CA+nUz_JEQ97FxVZZFg9VJe+0ty+w4v4FYcaRyucnrXY9wo3uJg@mail.gmail.com>
From: Matthew Daley <mattjd@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] tmem: Prevent NULL dereference on error case
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 13, 2012 at 5:30 AM, Dan Magenheimer
<dan.magenheimer@oracle.com> wrote:
> Did you see this on an actual save/restore or just by inspection?
> This should only happen as a result of a buggy toolstack so I'm
> wondering if fixing this hides a toolstack bug.

Just by inspection of the hypervisor side, so there's no need to worry
about the toolstack.

- Matthew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 12 23:07:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 23:07:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY36A-0005FU-Qo; Mon, 12 Nov 2012 23:07:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <robertrhinehart@gmail.com>)
	id 1TY369-0005FK-Nt; Mon, 12 Nov 2012 23:07:21 +0000
Received: from [85.158.137.99:38458] by server-7.bemta-3.messagelabs.com id
	BB/B3-01713-82181A05; Mon, 12 Nov 2012 23:07:20 +0000
X-Env-Sender: robertrhinehart@gmail.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1352761640!17939202!1
X-Originating-IP: [209.85.212.179]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_10_20,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2641 invoked from network); 12 Nov 2012 23:07:20 -0000
Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com)
	(209.85.212.179)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 23:07:20 -0000
Received: by mail-wi0-f179.google.com with SMTP id hm6so2489663wib.14
	for <multiple recipients>; Mon, 12 Nov 2012 15:07:20 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:from:date:x-google-sender-auth:message-id
	:subject:to:content-type;
	bh=IiwwHIGvA8Nwc7ZNkbwEJp0hvI784fLQjQ6B4OSGX0M=;
	b=peznoKYaQl151E2qABWGaiu1qrB7zkRAVbEHJjiMYVEOlZ3PxuU+RLm2ZeoFZalEqu
	QFsD6AF6QVoWLGfvmK+RP4zujQeUEy0dpdYSTk7j4JoA4i+0DTv4zcv0rix+xunR24xz
	bHQ0MX8LR+FwSxFJWn2SdvdJBxRpIQjBkLz0PYHBHBV/2LQQD8dRSvT49TQ0YYZjVlnH
	pZ8omWIzzFR/4WjbuCy50gYTaSjo4yvbqY2MXZNQh6rhKUAjC/5CvIJ62SKF/qGTdmtN
	/ROcVNh4kv+0Xbgu+wdQLUqitM+1p8DQrEm3ULDOfjk5LCrIjU+ys0QcGTCpa40tyg1C
	IGLg==
Received: by 10.216.197.155 with SMTP id t27mr8126071wen.216.1352761640026;
	Mon, 12 Nov 2012 15:07:20 -0800 (PST)
MIME-Version: 1.0
Received: by 10.216.218.193 with HTTP; Mon, 12 Nov 2012 15:06:39 -0800 (PST)
From: Rob Rhinehart <robrhinehart@ieee.org>
Date: Mon, 12 Nov 2012 15:06:39 -0800
X-Google-Sender-Auth: VjnS2nBvcCI7fASVu0XqPsQig4E
Message-ID: <CA+W74gbZNW7Kjm2f6yabT3CGLrtZqVm=7cFhqoXf8_eTHBnW2w@mail.gmail.com>
To: xen-users@lists.xen.org, xen-devel@lists.xen.org
Subject: [Xen-devel] NVIDIA VGX Hypervisor
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============9185951647196231441=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============9185951647196231441==
Content-Type: multipart/alternative; boundary=001636c5b4f405032e04ce545d6a

--001636c5b4f405032e04ce545d6a
Content-Type: text/plain; charset=ISO-8859-1

I've been reading that Xenserver supports GPU virtualization with NVIDIA
VGX. I assume this is different than PCI passthrough. Is there any support
for this in open source xen, or efforts to do so?

Thank you

--001636c5b4f405032e04ce545d6a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I&#39;ve been reading that Xenserver supports GPU virtualization with NVIDI=
A VGX. I assume this is different than PCI passthrough.=A0Is there any supp=
ort for this in open source xen, or efforts to do so?<div><br></div><div>Th=
ank you</div>



--001636c5b4f405032e04ce545d6a--


--===============9185951647196231441==
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.xen.org
http://lists.xen.org/xen-devel

--===============9185951647196231441==--


From xen-devel-bounces@lists.xen.org Mon Nov 12 23:07:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Nov 2012 23:07:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY36A-0005FU-Qo; Mon, 12 Nov 2012 23:07:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <robertrhinehart@gmail.com>)
	id 1TY369-0005FK-Nt; Mon, 12 Nov 2012 23:07:21 +0000
Received: from [85.158.137.99:38458] by server-7.bemta-3.messagelabs.com id
	BB/B3-01713-82181A05; Mon, 12 Nov 2012 23:07:20 +0000
X-Env-Sender: robertrhinehart@gmail.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1352761640!17939202!1
X-Originating-IP: [209.85.212.179]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_10_20,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2641 invoked from network); 12 Nov 2012 23:07:20 -0000
Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com)
	(209.85.212.179)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	12 Nov 2012 23:07:20 -0000
Received: by mail-wi0-f179.google.com with SMTP id hm6so2489663wib.14
	for <multiple recipients>; Mon, 12 Nov 2012 15:07:20 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:from:date:x-google-sender-auth:message-id
	:subject:to:content-type;
	bh=IiwwHIGvA8Nwc7ZNkbwEJp0hvI784fLQjQ6B4OSGX0M=;
	b=peznoKYaQl151E2qABWGaiu1qrB7zkRAVbEHJjiMYVEOlZ3PxuU+RLm2ZeoFZalEqu
	QFsD6AF6QVoWLGfvmK+RP4zujQeUEy0dpdYSTk7j4JoA4i+0DTv4zcv0rix+xunR24xz
	bHQ0MX8LR+FwSxFJWn2SdvdJBxRpIQjBkLz0PYHBHBV/2LQQD8dRSvT49TQ0YYZjVlnH
	pZ8omWIzzFR/4WjbuCy50gYTaSjo4yvbqY2MXZNQh6rhKUAjC/5CvIJ62SKF/qGTdmtN
	/ROcVNh4kv+0Xbgu+wdQLUqitM+1p8DQrEm3ULDOfjk5LCrIjU+ys0QcGTCpa40tyg1C
	IGLg==
Received: by 10.216.197.155 with SMTP id t27mr8126071wen.216.1352761640026;
	Mon, 12 Nov 2012 15:07:20 -0800 (PST)
MIME-Version: 1.0
Received: by 10.216.218.193 with HTTP; Mon, 12 Nov 2012 15:06:39 -0800 (PST)
From: Rob Rhinehart <robrhinehart@ieee.org>
Date: Mon, 12 Nov 2012 15:06:39 -0800
X-Google-Sender-Auth: VjnS2nBvcCI7fASVu0XqPsQig4E
Message-ID: <CA+W74gbZNW7Kjm2f6yabT3CGLrtZqVm=7cFhqoXf8_eTHBnW2w@mail.gmail.com>
To: xen-users@lists.xen.org, xen-devel@lists.xen.org
Subject: [Xen-devel] NVIDIA VGX Hypervisor
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============9185951647196231441=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============9185951647196231441==
Content-Type: multipart/alternative; boundary=001636c5b4f405032e04ce545d6a

--001636c5b4f405032e04ce545d6a
Content-Type: text/plain; charset=ISO-8859-1

I've been reading that Xenserver supports GPU virtualization with NVIDIA
VGX. I assume this is different than PCI passthrough. Is there any support
for this in open source xen, or efforts to do so?

Thank you

--001636c5b4f405032e04ce545d6a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I&#39;ve been reading that Xenserver supports GPU virtualization with NVIDI=
A VGX. I assume this is different than PCI passthrough.=A0Is there any supp=
ort for this in open source xen, or efforts to do so?<div><br></div><div>Th=
ank you</div>



--001636c5b4f405032e04ce545d6a--


--===============9185951647196231441==
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.xen.org
http://lists.xen.org/xen-devel

--===============9185951647196231441==--


From xen-devel-bounces@lists.xen.org Tue Nov 13 00:12:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 00:12:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY46i-0006Yx-K4; Tue, 13 Nov 2012 00:12:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <yang.z.zhang@intel.com>) id 1TY46h-0006Ys-6L
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 00:11:59 +0000
Received: from [85.158.139.211:9230] by server-7.bemta-5.messagelabs.com id
	0B/2D-23096-E4091A05; Tue, 13 Nov 2012 00:11:58 +0000
X-Env-Sender: yang.z.zhang@intel.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1352765514!19920503!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjI5NTg1\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16438 invoked from network); 13 Nov 2012 00:11:56 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-11.tower-206.messagelabs.com with SMTP;
	13 Nov 2012 00:11:56 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga102.ch.intel.com with ESMTP; 12 Nov 2012 16:11:53 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,764,1344236400"; d="scan'208";a="216781406"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by azsmga001.ch.intel.com with ESMTP; 12 Nov 2012 16:11:52 -0800
Received: from FMSMSX109.amr.corp.intel.com (10.19.9.28) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Mon, 12 Nov 2012 16:11:40 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	fmsmsx109.amr.corp.intel.com (10.19.9.28) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Mon, 12 Nov 2012 16:11:40 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Tue, 13 Nov 2012 08:11:38 +0800
From: "Zhang, Yang Z" <yang.z.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, "wei.huang2@amd.com"
	<wei.huang2@amd.com>, "weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	"Zhang, Xiantao" <xiantao.zhang@intel.com>
Thread-Topic: [Xen-devel] iommu=dom0-passthrough behavior
Thread-Index: AQHNu2JnOrR2IJOBmEueKZ07SNjEopfm7FWQ
Date: Tue, 13 Nov 2012 00:11:37 +0000
Message-ID: <A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
In-Reply-To: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Jan Beulich wrote on 2012-11-05:
> All,
> 
> so far it was my understanding that this option is intended to get
> the DMA behavior that Dom0 observes as close as possible to how
> it would be without IOMMU.

Correct. There is a bit in context entry which controlling the DMA request(from this device) to walk or not walk the iommu page table.
As we known, walking page table introduced extra cost, so we use this parameter to make sure the device which owned by dom0 not to walking iommu page table when DMA request is arrived.
 
> However, we're now dealing with a customer report where a
> single function device is observed to initiate DMA operations
> appearing to originate from function 1, which makes obvious that
> the option above is not making things as transparent as I would
> have expected them to be: Without IOMMU, such requests get
> processed fine, while with IOMMU (due to there not being a
> context entry for the bogus device) the device fails to initialize
> (causing DMA faults, the presence of which I had to convince
> myself of separately, as for whatever reason at least the VT-d
> code doesn't issue any log message in that case).

Sorry, I cannot understand your problem. Is there any bug in current VT-d code?

> So I'm now seeking for alternative workaround suggestions that
> we could pass to that customer (less intrusive than "iommu=off").



Best regards,
Yang


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 00:12:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 00:12:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY46i-0006Yx-K4; Tue, 13 Nov 2012 00:12:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <yang.z.zhang@intel.com>) id 1TY46h-0006Ys-6L
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 00:11:59 +0000
Received: from [85.158.139.211:9230] by server-7.bemta-5.messagelabs.com id
	0B/2D-23096-E4091A05; Tue, 13 Nov 2012 00:11:58 +0000
X-Env-Sender: yang.z.zhang@intel.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1352765514!19920503!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjI5NTg1\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16438 invoked from network); 13 Nov 2012 00:11:56 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-11.tower-206.messagelabs.com with SMTP;
	13 Nov 2012 00:11:56 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga102.ch.intel.com with ESMTP; 12 Nov 2012 16:11:53 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,764,1344236400"; d="scan'208";a="216781406"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by azsmga001.ch.intel.com with ESMTP; 12 Nov 2012 16:11:52 -0800
Received: from FMSMSX109.amr.corp.intel.com (10.19.9.28) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Mon, 12 Nov 2012 16:11:40 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	fmsmsx109.amr.corp.intel.com (10.19.9.28) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Mon, 12 Nov 2012 16:11:40 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Tue, 13 Nov 2012 08:11:38 +0800
From: "Zhang, Yang Z" <yang.z.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, "wei.huang2@amd.com"
	<wei.huang2@amd.com>, "weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	"Zhang, Xiantao" <xiantao.zhang@intel.com>
Thread-Topic: [Xen-devel] iommu=dom0-passthrough behavior
Thread-Index: AQHNu2JnOrR2IJOBmEueKZ07SNjEopfm7FWQ
Date: Tue, 13 Nov 2012 00:11:37 +0000
Message-ID: <A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
In-Reply-To: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Jan Beulich wrote on 2012-11-05:
> All,
> 
> so far it was my understanding that this option is intended to get
> the DMA behavior that Dom0 observes as close as possible to how
> it would be without IOMMU.

Correct. There is a bit in context entry which controlling the DMA request(from this device) to walk or not walk the iommu page table.
As we known, walking page table introduced extra cost, so we use this parameter to make sure the device which owned by dom0 not to walking iommu page table when DMA request is arrived.
 
> However, we're now dealing with a customer report where a
> single function device is observed to initiate DMA operations
> appearing to originate from function 1, which makes obvious that
> the option above is not making things as transparent as I would
> have expected them to be: Without IOMMU, such requests get
> processed fine, while with IOMMU (due to there not being a
> context entry for the bogus device) the device fails to initialize
> (causing DMA faults, the presence of which I had to convince
> myself of separately, as for whatever reason at least the VT-d
> code doesn't issue any log message in that case).

Sorry, I cannot understand your problem. Is there any bug in current VT-d code?

> So I'm now seeking for alternative workaround suggestions that
> we could pass to that customer (less intrusive than "iommu=off").



Best regards,
Yang


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 00:55:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 00:55:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY4mK-0006vv-5j; Tue, 13 Nov 2012 00:55:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TY4mI-0006vq-TI
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 00:54:59 +0000
Received: from [85.158.143.35:17220] by server-2.bemta-4.messagelabs.com id
	94/BB-28922-16A91A05; Tue, 13 Nov 2012 00:54:57 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1352768097!11891631!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgxNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3974 invoked from network); 13 Nov 2012 00:54:57 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 00:54:57 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="15764652"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 00:54:52 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 13 Nov 2012 00:54:52 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TY4mC-00021T-Aq;
	Tue, 13 Nov 2012 00:54:52 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TY4mB-0004mf-W5;
	Tue, 13 Nov 2012 00:54:52 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14384-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 13 Nov 2012 00:54:52 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14384: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14384 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14384/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14381
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14381
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14381
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14381

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  a3cde70320ad
baseline version:
 xen                  279bbf2a0b48

------------------------------------------------------------
People who touched revisions under test:
  Andres Lagar-Cavilla <andres@lagarcavilla.org>
  Dave McCracken <dave.mccracken@oracle.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Kouya Shimura <kouya@jp.fujitsu.com>
  Matthew Daley <mattjd@gmail.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=a3cde70320ad
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable a3cde70320ad
+ branch=xen-unstable
+ revision=a3cde70320ad
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r a3cde70320ad ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 4 changesets with 8 changes to 8 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 00:55:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 00:55:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY4mK-0006vv-5j; Tue, 13 Nov 2012 00:55:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TY4mI-0006vq-TI
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 00:54:59 +0000
Received: from [85.158.143.35:17220] by server-2.bemta-4.messagelabs.com id
	94/BB-28922-16A91A05; Tue, 13 Nov 2012 00:54:57 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1352768097!11891631!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgxNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3974 invoked from network); 13 Nov 2012 00:54:57 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 00:54:57 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="15764652"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 00:54:52 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 13 Nov 2012 00:54:52 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TY4mC-00021T-Aq;
	Tue, 13 Nov 2012 00:54:52 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TY4mB-0004mf-W5;
	Tue, 13 Nov 2012 00:54:52 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14384-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 13 Nov 2012 00:54:52 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14384: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14384 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14384/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14381
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14381
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14381
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14381

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  a3cde70320ad
baseline version:
 xen                  279bbf2a0b48

------------------------------------------------------------
People who touched revisions under test:
  Andres Lagar-Cavilla <andres@lagarcavilla.org>
  Dave McCracken <dave.mccracken@oracle.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Kouya Shimura <kouya@jp.fujitsu.com>
  Matthew Daley <mattjd@gmail.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=a3cde70320ad
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable a3cde70320ad
+ branch=xen-unstable
+ revision=a3cde70320ad
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r a3cde70320ad ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 4 changesets with 8 changes to 8 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 01:41:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 01:41:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY5UP-0002nL-MB; Tue, 13 Nov 2012 01:40:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xudong.hao@intel.com>) id 1TY5UO-0002nG-Jp
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 01:40:32 +0000
Received: from [85.158.137.99:35329] by server-3.bemta-3.messagelabs.com id
	B2/50-31566-F05A1A05; Tue, 13 Nov 2012 01:40:31 +0000
X-Env-Sender: xudong.hao@intel.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1352770828!11987435!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjI5NTg1\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1207 invoked from network); 13 Nov 2012 01:40:29 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-8.tower-217.messagelabs.com with SMTP;
	13 Nov 2012 01:40:29 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga102.ch.intel.com with ESMTP; 12 Nov 2012 17:40:27 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,764,1344236400"; d="scan'208";a="216811589"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by azsmga001.ch.intel.com with ESMTP; 12 Nov 2012 17:40:26 -0800
Received: from fmsmsx153.amr.corp.intel.com (10.19.17.7) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Mon, 12 Nov 2012 17:40:26 -0800
Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by
	FMSMSX153.amr.corp.intel.com (10.19.17.7) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Mon, 12 Nov 2012 17:40:26 -0800
Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.123]) by
	SHSMSX101.ccr.corp.intel.com ([169.254.1.134]) with mapi id
	14.01.0355.002; Tue, 13 Nov 2012 09:40:24 +0800
From: "Hao, Xudong" <xudong.hao@intel.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, Christoph Egger
	<Christoph.Egger@amd.com>
Thread-Topic: [Xen-devel] [PATCH] tools/xen-mceinj: support AMD
Thread-Index: AQHNwPJ/vRtiVnNpX0G1LON37louEpfm92Bw
Date: Tue, 13 Nov 2012 01:40:23 +0000
Message-ID: <403610A45A2B5242BD291EDAE8B37D300FF02D43@SHSMSX102.ccr.corp.intel.com>
References: <506EE9A7.6090009@amd.com> <50815162.4090601@amd.com>
	<5081869B02000078000A2A1F@nat28.tlf.novell.com>
	<20609.27440.478178.971262@mariner.uk.xensource.com>
	<5081887502000078000A2A51@nat28.tlf.novell.com>
	<1352737542.27833.296.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352737542.27833.296.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>, "Li,
	Haicheng" <haicheng.li@intel.com>, "Keir \(Xen.org\)" <keir@xen.org>,
	"Jiang, Yunhong" <yunhong.jiang@intel.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] tools/xen-mceinj: support AMD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> -----Original Message-----
> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> Sent: Tuesday, November 13, 2012 12:26 AM
> To: Jan Beulich
> Cc: Ian Jackson; Christoph Egger; xen-devel@lists.xen.org; Keir (Xen.org); Liu,
> Jinsong; Liu, Jinsong; Jiang, Yunhong; Li, Haicheng; Hao, Xudong
> Subject: Re: [Xen-devel] [PATCH] tools/xen-mceinj: support AMD
> 
> On Fri, 2012-10-19 at 16:05 +0100, Jan Beulich wrote:
> > >>> On 19.10.12 at 17:01, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> > > Jan Beulich writes ("Re: [Xen-devel] [PATCH] tools/xen-mceinj: support
> AMD"):
> > >> >>> On 19.10.12 at 15:10, Christoph Egger <Christoph.Egger@amd.com>
> wrote:
> > >> > Ping?
> > >>
> > >> I'm afraid it's not really clear who should commit this - it's tools
> > >> side code, so IanJ or IanC would normally be the ones, but otoh
> > >> it's code requiring low level hardware knowledge to review the
> > >> patch, so both of them might want to rather not do the review.
> > >> In the past it was usually Keir who eventually committed such
> > >> patches, but I don't know whether he put this on his to-look-at-
> > >> and-eventually-commit list.
> > >
> > > My view is that I would like an ack from someone who understands
> > > what's going on ...
> >
> > Which would ideally be those who introduced the code, i.e.
> > Intel folks if I'm not mistaken...
> 
> Lets CC some of them then.
> 
> Intel folks -- any opinion on the patch below from Christoph?
> 

It's ok for me except for one comments. See below.
Of course I did not review the AMD only code.

> +    if (strstr(cpu_brand, "AMD"))
> +        cpu_is_amd = 1;
> +    else
> +        cpu_is_intel = 1;
> +
> +    if (cpu_is_intel)
> +        type = INTEL_MCE_SRAO_MEM;
> +

Isn't necessary to set a default AMD type? The "-t" parameter is required for amd but not always for Intel for users, it's better to give a unified usage for all users.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 01:41:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 01:41:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY5UP-0002nL-MB; Tue, 13 Nov 2012 01:40:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xudong.hao@intel.com>) id 1TY5UO-0002nG-Jp
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 01:40:32 +0000
Received: from [85.158.137.99:35329] by server-3.bemta-3.messagelabs.com id
	B2/50-31566-F05A1A05; Tue, 13 Nov 2012 01:40:31 +0000
X-Env-Sender: xudong.hao@intel.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1352770828!11987435!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjI5NTg1\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1207 invoked from network); 13 Nov 2012 01:40:29 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-8.tower-217.messagelabs.com with SMTP;
	13 Nov 2012 01:40:29 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga102.ch.intel.com with ESMTP; 12 Nov 2012 17:40:27 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,764,1344236400"; d="scan'208";a="216811589"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by azsmga001.ch.intel.com with ESMTP; 12 Nov 2012 17:40:26 -0800
Received: from fmsmsx153.amr.corp.intel.com (10.19.17.7) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Mon, 12 Nov 2012 17:40:26 -0800
Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by
	FMSMSX153.amr.corp.intel.com (10.19.17.7) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Mon, 12 Nov 2012 17:40:26 -0800
Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.123]) by
	SHSMSX101.ccr.corp.intel.com ([169.254.1.134]) with mapi id
	14.01.0355.002; Tue, 13 Nov 2012 09:40:24 +0800
From: "Hao, Xudong" <xudong.hao@intel.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, Christoph Egger
	<Christoph.Egger@amd.com>
Thread-Topic: [Xen-devel] [PATCH] tools/xen-mceinj: support AMD
Thread-Index: AQHNwPJ/vRtiVnNpX0G1LON37louEpfm92Bw
Date: Tue, 13 Nov 2012 01:40:23 +0000
Message-ID: <403610A45A2B5242BD291EDAE8B37D300FF02D43@SHSMSX102.ccr.corp.intel.com>
References: <506EE9A7.6090009@amd.com> <50815162.4090601@amd.com>
	<5081869B02000078000A2A1F@nat28.tlf.novell.com>
	<20609.27440.478178.971262@mariner.uk.xensource.com>
	<5081887502000078000A2A51@nat28.tlf.novell.com>
	<1352737542.27833.296.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352737542.27833.296.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>, "Li,
	Haicheng" <haicheng.li@intel.com>, "Keir \(Xen.org\)" <keir@xen.org>,
	"Jiang, Yunhong" <yunhong.jiang@intel.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] tools/xen-mceinj: support AMD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> -----Original Message-----
> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> Sent: Tuesday, November 13, 2012 12:26 AM
> To: Jan Beulich
> Cc: Ian Jackson; Christoph Egger; xen-devel@lists.xen.org; Keir (Xen.org); Liu,
> Jinsong; Liu, Jinsong; Jiang, Yunhong; Li, Haicheng; Hao, Xudong
> Subject: Re: [Xen-devel] [PATCH] tools/xen-mceinj: support AMD
> 
> On Fri, 2012-10-19 at 16:05 +0100, Jan Beulich wrote:
> > >>> On 19.10.12 at 17:01, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> > > Jan Beulich writes ("Re: [Xen-devel] [PATCH] tools/xen-mceinj: support
> AMD"):
> > >> >>> On 19.10.12 at 15:10, Christoph Egger <Christoph.Egger@amd.com>
> wrote:
> > >> > Ping?
> > >>
> > >> I'm afraid it's not really clear who should commit this - it's tools
> > >> side code, so IanJ or IanC would normally be the ones, but otoh
> > >> it's code requiring low level hardware knowledge to review the
> > >> patch, so both of them might want to rather not do the review.
> > >> In the past it was usually Keir who eventually committed such
> > >> patches, but I don't know whether he put this on his to-look-at-
> > >> and-eventually-commit list.
> > >
> > > My view is that I would like an ack from someone who understands
> > > what's going on ...
> >
> > Which would ideally be those who introduced the code, i.e.
> > Intel folks if I'm not mistaken...
> 
> Lets CC some of them then.
> 
> Intel folks -- any opinion on the patch below from Christoph?
> 

It's ok for me except for one comments. See below.
Of course I did not review the AMD only code.

> +    if (strstr(cpu_brand, "AMD"))
> +        cpu_is_amd = 1;
> +    else
> +        cpu_is_intel = 1;
> +
> +    if (cpu_is_intel)
> +        type = INTEL_MCE_SRAO_MEM;
> +

Isn't necessary to set a default AMD type? The "-t" parameter is required for amd but not always for Intel for users, it's better to give a unified usage for all users.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 01:59:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 01:59:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY5mX-00032t-EB; Tue, 13 Nov 2012 01:59:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kgrace.liu@gmail.com>) id 1TY5mV-00032o-IA
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 01:59:15 +0000
Received: from [85.158.138.51:32144] by server-9.bemta-3.messagelabs.com id
	39/32-02388-279A1A05; Tue, 13 Nov 2012 01:59:14 +0000
X-Env-Sender: kgrace.liu@gmail.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1352771952!21830343!1
X-Originating-IP: [209.85.214.171]
X-SpamReason: No, hits=0.9 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_30_40,HTML_MESSAGE,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28823 invoked from network); 13 Nov 2012 01:59:13 -0000
Received: from mail-ob0-f171.google.com (HELO mail-ob0-f171.google.com)
	(209.85.214.171)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 01:59:13 -0000
Received: by mail-ob0-f171.google.com with SMTP id dn14so1840235obc.30
	for <xen-devel@lists.xensource.com>;
	Mon, 12 Nov 2012 17:59:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=nd4vUfyoDB2cEnGnv9tkIyjhg7cHL4dLNJc+KSHSXuI=;
	b=L0htRYP4pDciJvtrQdSBA4Iyt+X/EpTGyKqNN0uBW7v7/HMctmhwJ3hHPhqiQWyhau
	B280x/F9UrHK7aWhwzu6eDhOs1Lz9s6DBWScB10VpfycMfoc6fvreojunTmg8iFPzd7/
	oWd0SbxtqXwajf6JEWsp9Eh8qqDiP+TPRhh5qNdBxXXy99mZuy6XuZps42ZW5uvRzQJn
	Jnn41OFNbawTe2bsdzhqQa/vtka9+g+aT2sxO0ljxknJp1tMOR/qeB97qzV7x9XbBI4T
	OtkouaDyo/fg4Fx5FXt0/ZMm6kn1wHIALUlPrf37lY6/UfYoT0ZAYwBMENQXHkeFUbxe
	BvNA==
MIME-Version: 1.0
Received: by 10.60.27.166 with SMTP id u6mr15860738oeg.86.1352771952153; Mon,
	12 Nov 2012 17:59:12 -0800 (PST)
Received: by 10.60.21.163 with HTTP; Mon, 12 Nov 2012 17:59:11 -0800 (PST)
In-Reply-To: <1352734133.27833.277.camel@zakaz.uk.xensource.com>
References: <CAERYnoYbLddzpE6729Nkx2YzMPcr09Do0f1rkob4U1h34NjQgQ@mail.gmail.com>
	<1352734133.27833.277.camel@zakaz.uk.xensource.com>
Date: Tue, 13 Nov 2012 09:59:11 +0800
X-Google-Sender-Auth: MvsrP7P07a28yj8Bx7aHMvzRSOk
Message-ID: <CAERYnoYg1iaM==-Gk__LtXLbQKaSpM-KAR-jr-cUPkt-WEe_aA@mail.gmail.com>
From: Chunyan Liu <cyliu@suse.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] question about xenstore-chmod MAX_PERMS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7583719734613829421=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============7583719734613829421==
Content-Type: multipart/alternative; boundary=e89a8fb2058eab955304ce56c32f

--e89a8fb2058eab955304ce56c32f
Content-Type: text/plain; charset=UTF-8

2012/11/12 Ian Campbell <Ian.Campbell@citrix.com>

> Dropping users list, please don't cross post.
>
Sorry. Thanks for reminding.


> On Mon, 2012-11-12 at 08:35 +0000, Chunyan Liu wrote:
> > Dear List,
> >
> > I'm trying to issue:
> > "xenstore-chmod PATH r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14
> > r15 r16 r17 r18"
> > it failed at error report "Too many permissions specified.  Maximum
> > per invocation is 16."
> >
> > I changed MAX_PERMS to 18 for testing, it turns to be OK to run above
> > command.
> > I don't know why there is "MAX_PERMS=16" limitation and couldn't find
> > useful info about that. Does anyone know that?
>
> It seems like an obvious case of an arbitrary constant to me.
>
> Do you actually have a practical requirement to be able to set > 16
> perms via the command line tool?
>
> Yes. Our customer plans to have some hypervisor running above 32 domUs and
needs to share common information between xen domU. He uses xenstore
capabilities:
i.e. xenstore-write /local/domain/0/foo "8 CPU"
Then he gives read access to domU with:
xenstore-chmod /local/domain/0/foo r0 r2 r3 r4 r5 r6 r7 r9 r10 r11 r12 r13
r17 r18 r19 r20 r21 r22
With current MAX_PERM limitation, xenstore-chmod will report "Too many
permissions specified. Maximum per invocation is 16".
And serial commands:
xenstore-chmod /local/domain/0/foo r0
xenstore-chmod /local/domain/0/foo r1
...
couldn't achieve that either. (result will be only the last command).


> I can't see anything obvious in the underlying library which would
> prevent it handling essentially arbitrary length lists of perms. If you
> want to change the client to increase the number supported I think you
> should make it likewise handle arbitrary numbers rather than just
> increasing MAX_PERMS.
>
> Sure, if there is nothing that prevents handling an arbitrary number of
perms, it's better to handle it like arbitrary numbers rather than
increasing MAX_PERMS. I was just not sure if there was some consideration
to set a limitation.
I'll modify code and test.

Ian.
>
>
>
>

--e89a8fb2058eab955304ce56c32f
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">2012/11/12 Ian Campbell <span dir=3D"ltr=
">&lt;<a href=3D"mailto:Ian.Campbell@citrix.com" target=3D"_blank">Ian.Camp=
bell@citrix.com</a>&gt;</span><br><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dropping users list, please don&#39;t cross post.<br></blockquote><div>Sorr=
y. Thanks for reminding.<br>=C2=A0<br></div><blockquote class=3D"gmail_quot=
e" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class=3D"h5">On Mon, 2012-11-12 at 08:35 +0000, Chunyan Liu wrote=
:<br>
&gt; Dear List,<br>
&gt;<br>
&gt; I&#39;m trying to issue:<br>
&gt; &quot;xenstore-chmod PATH r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r1=
3 r14<br>
&gt; r15 r16 r17 r18&quot;<br>
&gt; it failed at error report &quot;Too many permissions specified. =C2=A0=
Maximum<br>
&gt; per invocation is 16.&quot;<br>
&gt;<br>
&gt; I changed MAX_PERMS to 18 for testing, it turns to be OK to run above<=
br>
&gt; command.<br>
&gt; I don&#39;t know why there is &quot;MAX_PERMS=3D16&quot; limitation an=
d couldn&#39;t find<br>
&gt; useful info about that. Does anyone know that?<br>
<br>
</div></div>It seems like an obvious case of an arbitrary constant to me.<b=
r>
<br>
Do you actually have a practical requirement to be able to set &gt; 16<br>
perms via the command line tool?<br>
<br></blockquote><div>Yes. Our customer plans to have some hypervisor runni=
ng above 32 domUs=20
and needs to share common information between xen domU. He uses xenstore
 capabilities: <br>i.e. xenstore-write /local/domain/0/foo &quot;8 CPU&quot=
;<br>Then he gives read access to domU with:<br>xenstore-chmod /local/domai=
n/0/foo r0 r2 r3 r4 r5 r6 r7 r9 r10 r11 r12 r13 r17 r18 r19 r20 r21 r22<br>
With current MAX_PERM limitation, xenstore-chmod will report &quot;Too many=
 permissions specified.  Maximum per invocation is 16&quot;.<br>And serial =
commands:<br>xenstore-chmod /local/domain/0/foo r0<br>xenstore-chmod /local=
/domain/0/foo r1<br>
...<br>couldn&#39;t achieve that either. (result will be only the last comm=
and).<br>=C2=A0<br></div><blockquote class=3D"gmail_quote" style=3D"margin:=
0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I can&#39;t see anything obvious in the underlying library which would<br>
prevent it handling essentially arbitrary length lists of perms. If you<br>
want to change the client to increase the number supported I think you<br>
should make it likewise handle arbitrary numbers rather than just<br>
increasing MAX_PERMS.<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br></font></span></blockquo=
te><div>Sure, if there is nothing that prevents handling an arbitrary numbe=
r of perms, it&#39;s better to handle it like arbitrary numbers rather than=
 increasing MAX_PERMS. I was just not sure if there was some consideration =
to set a limitation.<br>
I&#39;ll modify code and test. <br><br></div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"=
><span class=3D"HOEnZb"><font color=3D"#888888">
Ian.<br>
<br>
<br>
<br>
</font></span></blockquote></div><br>

--e89a8fb2058eab955304ce56c32f--


--===============7583719734613829421==
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.xen.org
http://lists.xen.org/xen-devel

--===============7583719734613829421==--


From xen-devel-bounces@lists.xen.org Tue Nov 13 01:59:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 01:59:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY5mX-00032t-EB; Tue, 13 Nov 2012 01:59:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kgrace.liu@gmail.com>) id 1TY5mV-00032o-IA
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 01:59:15 +0000
Received: from [85.158.138.51:32144] by server-9.bemta-3.messagelabs.com id
	39/32-02388-279A1A05; Tue, 13 Nov 2012 01:59:14 +0000
X-Env-Sender: kgrace.liu@gmail.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1352771952!21830343!1
X-Originating-IP: [209.85.214.171]
X-SpamReason: No, hits=0.9 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_30_40,HTML_MESSAGE,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28823 invoked from network); 13 Nov 2012 01:59:13 -0000
Received: from mail-ob0-f171.google.com (HELO mail-ob0-f171.google.com)
	(209.85.214.171)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 01:59:13 -0000
Received: by mail-ob0-f171.google.com with SMTP id dn14so1840235obc.30
	for <xen-devel@lists.xensource.com>;
	Mon, 12 Nov 2012 17:59:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=nd4vUfyoDB2cEnGnv9tkIyjhg7cHL4dLNJc+KSHSXuI=;
	b=L0htRYP4pDciJvtrQdSBA4Iyt+X/EpTGyKqNN0uBW7v7/HMctmhwJ3hHPhqiQWyhau
	B280x/F9UrHK7aWhwzu6eDhOs1Lz9s6DBWScB10VpfycMfoc6fvreojunTmg8iFPzd7/
	oWd0SbxtqXwajf6JEWsp9Eh8qqDiP+TPRhh5qNdBxXXy99mZuy6XuZps42ZW5uvRzQJn
	Jnn41OFNbawTe2bsdzhqQa/vtka9+g+aT2sxO0ljxknJp1tMOR/qeB97qzV7x9XbBI4T
	OtkouaDyo/fg4Fx5FXt0/ZMm6kn1wHIALUlPrf37lY6/UfYoT0ZAYwBMENQXHkeFUbxe
	BvNA==
MIME-Version: 1.0
Received: by 10.60.27.166 with SMTP id u6mr15860738oeg.86.1352771952153; Mon,
	12 Nov 2012 17:59:12 -0800 (PST)
Received: by 10.60.21.163 with HTTP; Mon, 12 Nov 2012 17:59:11 -0800 (PST)
In-Reply-To: <1352734133.27833.277.camel@zakaz.uk.xensource.com>
References: <CAERYnoYbLddzpE6729Nkx2YzMPcr09Do0f1rkob4U1h34NjQgQ@mail.gmail.com>
	<1352734133.27833.277.camel@zakaz.uk.xensource.com>
Date: Tue, 13 Nov 2012 09:59:11 +0800
X-Google-Sender-Auth: MvsrP7P07a28yj8Bx7aHMvzRSOk
Message-ID: <CAERYnoYg1iaM==-Gk__LtXLbQKaSpM-KAR-jr-cUPkt-WEe_aA@mail.gmail.com>
From: Chunyan Liu <cyliu@suse.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] question about xenstore-chmod MAX_PERMS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7583719734613829421=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============7583719734613829421==
Content-Type: multipart/alternative; boundary=e89a8fb2058eab955304ce56c32f

--e89a8fb2058eab955304ce56c32f
Content-Type: text/plain; charset=UTF-8

2012/11/12 Ian Campbell <Ian.Campbell@citrix.com>

> Dropping users list, please don't cross post.
>
Sorry. Thanks for reminding.


> On Mon, 2012-11-12 at 08:35 +0000, Chunyan Liu wrote:
> > Dear List,
> >
> > I'm trying to issue:
> > "xenstore-chmod PATH r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14
> > r15 r16 r17 r18"
> > it failed at error report "Too many permissions specified.  Maximum
> > per invocation is 16."
> >
> > I changed MAX_PERMS to 18 for testing, it turns to be OK to run above
> > command.
> > I don't know why there is "MAX_PERMS=16" limitation and couldn't find
> > useful info about that. Does anyone know that?
>
> It seems like an obvious case of an arbitrary constant to me.
>
> Do you actually have a practical requirement to be able to set > 16
> perms via the command line tool?
>
> Yes. Our customer plans to have some hypervisor running above 32 domUs and
needs to share common information between xen domU. He uses xenstore
capabilities:
i.e. xenstore-write /local/domain/0/foo "8 CPU"
Then he gives read access to domU with:
xenstore-chmod /local/domain/0/foo r0 r2 r3 r4 r5 r6 r7 r9 r10 r11 r12 r13
r17 r18 r19 r20 r21 r22
With current MAX_PERM limitation, xenstore-chmod will report "Too many
permissions specified. Maximum per invocation is 16".
And serial commands:
xenstore-chmod /local/domain/0/foo r0
xenstore-chmod /local/domain/0/foo r1
...
couldn't achieve that either. (result will be only the last command).


> I can't see anything obvious in the underlying library which would
> prevent it handling essentially arbitrary length lists of perms. If you
> want to change the client to increase the number supported I think you
> should make it likewise handle arbitrary numbers rather than just
> increasing MAX_PERMS.
>
> Sure, if there is nothing that prevents handling an arbitrary number of
perms, it's better to handle it like arbitrary numbers rather than
increasing MAX_PERMS. I was just not sure if there was some consideration
to set a limitation.
I'll modify code and test.

Ian.
>
>
>
>

--e89a8fb2058eab955304ce56c32f
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">2012/11/12 Ian Campbell <span dir=3D"ltr=
">&lt;<a href=3D"mailto:Ian.Campbell@citrix.com" target=3D"_blank">Ian.Camp=
bell@citrix.com</a>&gt;</span><br><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dropping users list, please don&#39;t cross post.<br></blockquote><div>Sorr=
y. Thanks for reminding.<br>=C2=A0<br></div><blockquote class=3D"gmail_quot=
e" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class=3D"h5">On Mon, 2012-11-12 at 08:35 +0000, Chunyan Liu wrote=
:<br>
&gt; Dear List,<br>
&gt;<br>
&gt; I&#39;m trying to issue:<br>
&gt; &quot;xenstore-chmod PATH r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r1=
3 r14<br>
&gt; r15 r16 r17 r18&quot;<br>
&gt; it failed at error report &quot;Too many permissions specified. =C2=A0=
Maximum<br>
&gt; per invocation is 16.&quot;<br>
&gt;<br>
&gt; I changed MAX_PERMS to 18 for testing, it turns to be OK to run above<=
br>
&gt; command.<br>
&gt; I don&#39;t know why there is &quot;MAX_PERMS=3D16&quot; limitation an=
d couldn&#39;t find<br>
&gt; useful info about that. Does anyone know that?<br>
<br>
</div></div>It seems like an obvious case of an arbitrary constant to me.<b=
r>
<br>
Do you actually have a practical requirement to be able to set &gt; 16<br>
perms via the command line tool?<br>
<br></blockquote><div>Yes. Our customer plans to have some hypervisor runni=
ng above 32 domUs=20
and needs to share common information between xen domU. He uses xenstore
 capabilities: <br>i.e. xenstore-write /local/domain/0/foo &quot;8 CPU&quot=
;<br>Then he gives read access to domU with:<br>xenstore-chmod /local/domai=
n/0/foo r0 r2 r3 r4 r5 r6 r7 r9 r10 r11 r12 r13 r17 r18 r19 r20 r21 r22<br>
With current MAX_PERM limitation, xenstore-chmod will report &quot;Too many=
 permissions specified.  Maximum per invocation is 16&quot;.<br>And serial =
commands:<br>xenstore-chmod /local/domain/0/foo r0<br>xenstore-chmod /local=
/domain/0/foo r1<br>
...<br>couldn&#39;t achieve that either. (result will be only the last comm=
and).<br>=C2=A0<br></div><blockquote class=3D"gmail_quote" style=3D"margin:=
0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I can&#39;t see anything obvious in the underlying library which would<br>
prevent it handling essentially arbitrary length lists of perms. If you<br>
want to change the client to increase the number supported I think you<br>
should make it likewise handle arbitrary numbers rather than just<br>
increasing MAX_PERMS.<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br></font></span></blockquo=
te><div>Sure, if there is nothing that prevents handling an arbitrary numbe=
r of perms, it&#39;s better to handle it like arbitrary numbers rather than=
 increasing MAX_PERMS. I was just not sure if there was some consideration =
to set a limitation.<br>
I&#39;ll modify code and test. <br><br></div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"=
><span class=3D"HOEnZb"><font color=3D"#888888">
Ian.<br>
<br>
<br>
<br>
</font></span></blockquote></div><br>

--e89a8fb2058eab955304ce56c32f--


--===============7583719734613829421==
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.xen.org
http://lists.xen.org/xen-devel

--===============7583719734613829421==--


From xen-devel-bounces@lists.xen.org Tue Nov 13 03:10:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 03:10:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY6so-0004Hx-SA; Tue, 13 Nov 2012 03:09:50 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TY6sn-0004Hs-0e
	for Xen-devel@lists.xensource.com; Tue, 13 Nov 2012 03:09:49 +0000
Received: from [193.109.254.147:37782] by server-2.bemta-14.messagelabs.com id
	32/A0-20829-CF9B1A05; Tue, 13 Nov 2012 03:09:48 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1352776185!8865793!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1ODMyMA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22857 invoked from network); 13 Nov 2012 03:09:46 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 03:09:46 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAD39hCW017325
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <Xen-devel@lists.xensource.com>; Tue, 13 Nov 2012 03:09:44 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAD39gBn019485
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <Xen-devel@lists.xensource.com>; Tue, 13 Nov 2012 03:09:43 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAD39gek028933
	for <Xen-devel@lists.xensource.com>; Mon, 12 Nov 2012 21:09:42 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Mon, 12 Nov 2012 19:09:42 -0800
Date: Mon, 12 Nov 2012 19:09:34 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Message-ID: <20121112190934.5e702799@mantra.us.oracle.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Subject: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

I am wondering if there's libxl expert who can help me make some PVH
related changes to libxl, pref in the US time zone. I could consult on
irc or the phone. I find the libxl code hard to read, and don't
want to spend lot of time figuring it out if someone can just help
quickly.

thanks,
Mukesh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 03:10:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 03:10:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY6so-0004Hx-SA; Tue, 13 Nov 2012 03:09:50 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TY6sn-0004Hs-0e
	for Xen-devel@lists.xensource.com; Tue, 13 Nov 2012 03:09:49 +0000
Received: from [193.109.254.147:37782] by server-2.bemta-14.messagelabs.com id
	32/A0-20829-CF9B1A05; Tue, 13 Nov 2012 03:09:48 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1352776185!8865793!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1ODMyMA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22857 invoked from network); 13 Nov 2012 03:09:46 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 03:09:46 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAD39hCW017325
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <Xen-devel@lists.xensource.com>; Tue, 13 Nov 2012 03:09:44 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAD39gBn019485
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <Xen-devel@lists.xensource.com>; Tue, 13 Nov 2012 03:09:43 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAD39gek028933
	for <Xen-devel@lists.xensource.com>; Mon, 12 Nov 2012 21:09:42 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Mon, 12 Nov 2012 19:09:42 -0800
Date: Mon, 12 Nov 2012 19:09:34 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Message-ID: <20121112190934.5e702799@mantra.us.oracle.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Subject: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

I am wondering if there's libxl expert who can help me make some PVH
related changes to libxl, pref in the US time zone. I could consult on
irc or the phone. I find the libxl code hard to read, and don't
want to spend lot of time figuring it out if someone can just help
quickly.

thanks,
Mukesh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 05:50:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 05:50:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY9Ng-00060f-5e; Tue, 13 Nov 2012 05:49:52 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TY9Ne-00060a-Uq
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 05:49:51 +0000
Received: from [193.109.254.147:17714] by server-7.bemta-14.messagelabs.com id
	69/81-02272-E7FD1A05; Tue, 13 Nov 2012 05:49:50 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1352785789!3732367!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgxNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 763 invoked from network); 13 Nov 2012 05:49:49 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 05:49:49 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="15767113"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 05:49:45 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 13 Nov 2012 05:49:44 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TY9NY-0003YF-G7;
	Tue, 13 Nov 2012 05:49:44 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TY9NY-0005zt-19;
	Tue, 13 Nov 2012 05:49:44 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14385-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 13 Nov 2012 05:49:44 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14385: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14385 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14385/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14384
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14384
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14384
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14384

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  a3cde70320ad
baseline version:
 xen                  a3cde70320ad

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 05:50:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 05:50:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY9Ng-00060f-5e; Tue, 13 Nov 2012 05:49:52 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TY9Ne-00060a-Uq
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 05:49:51 +0000
Received: from [193.109.254.147:17714] by server-7.bemta-14.messagelabs.com id
	69/81-02272-E7FD1A05; Tue, 13 Nov 2012 05:49:50 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1352785789!3732367!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgxNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 763 invoked from network); 13 Nov 2012 05:49:49 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 05:49:49 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208";a="15767113"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 05:49:45 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 13 Nov 2012 05:49:44 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TY9NY-0003YF-G7;
	Tue, 13 Nov 2012 05:49:44 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TY9NY-0005zt-19;
	Tue, 13 Nov 2012 05:49:44 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14385-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 13 Nov 2012 05:49:44 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14385: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14385 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14385/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14384
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14384
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14384
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14384

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  a3cde70320ad
baseline version:
 xen                  a3cde70320ad

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 06:04:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 06:04:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY9bp-0006JO-Jp; Tue, 13 Nov 2012 06:04:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mattjd@gmail.com>) id 1TY9bo-0006JJ-73
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 06:04:28 +0000
Received: from [193.109.254.147:25534] by server-16.bemta-14.messagelabs.com
	id 57/82-09215-BE2E1A05; Tue, 13 Nov 2012 06:04:27 +0000
X-Env-Sender: mattjd@gmail.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352786665!8050465!1
X-Originating-IP: [209.85.160.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13196 invoked from network); 13 Nov 2012 06:04:27 -0000
Received: from mail-pb0-f45.google.com (HELO mail-pb0-f45.google.com)
	(209.85.160.45)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 06:04:27 -0000
Received: by mail-pb0-f45.google.com with SMTP id mc8so2285966pbc.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 22:04:25 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer;
	bh=U+A+UbXvFHBhNM9sGjSPedetgLZbqhBZge3i3Ad5hiU=;
	b=CizF4IX1XNuZ1d82UCfl1LhPsoLfPwlVXUp46KPcDoprD//chohPGHwVllzfdseTyQ
	U2DpnvtDqNszZ4jgnQZPxYlTnXpaqwKmGhHub14xNadvTJhl89MSS+cAK4sBK/XU1iHb
	33nR4AeNcz7eYNTsr6ZENUXht55f3dL9JdTZmM+CE8eJAtb7mR4oUY8BneW6WCwxmY/X
	ZwLx0cwozWsol7dEYVk6ZnpMxDb+2CbNjegon4m77gYTFa4MsifUlLFLqrfS92ZGZr5q
	kjAMatTOW8OBsnTKPORu3juH3VX5h6nVoWXyhR3H8e8iMX7hgwHzmt7q08RWrF4lKjQq
	BrDg==
Received: by 10.69.0.40 with SMTP id av8mr64642084pbd.117.1352786664945;
	Mon, 12 Nov 2012 22:04:24 -0800 (PST)
Received: from morphism.xen.prgmr.com (morphism.xen.prgmr.com. [71.19.145.114])
	by mx.google.com with ESMTPS id c1sm5568250pav.23.2012.11.12.22.04.23
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 12 Nov 2012 22:04:24 -0800 (PST)
From: Matthew Daley <mattjd@gmail.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 19:04:47 +1300
Message-Id: <1352786687-4498-1-git-send-email-mattjd@gmail.com>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Daley <mattjd@gmail.com>
Subject: [Xen-devel] [PATCH] xen: Fix xenctl_cpumap_to_cpumask buffer size
	check
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

xenctl_cpumap_to_cpumask incorrectly uses sizeof when checking whether
bits should be masked off from the input cpumap bitmap or not.

Fix by using the correct cpumask buffer size in place of sizeof.

Signed-off-by: Matthew Daley <mattjd@gmail.com>

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index e153cb4..204e951 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -78,7 +78,7 @@ int xenctl_cpumap_to_cpumask(
     {
         if ( copy_from_guest(bytemap, xenctl_cpumap->bitmap, copy_bytes) )
             err = -EFAULT;
-        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <= sizeof(bytemap)) )
+        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <= (nr_cpu_ids + 7) / 8) )
             bytemap[guest_bytes-1] &= ~(0xff << (xenctl_cpumap->nr_cpus & 7));
     }
 
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 06:04:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 06:04:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY9bp-0006JO-Jp; Tue, 13 Nov 2012 06:04:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mattjd@gmail.com>) id 1TY9bo-0006JJ-73
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 06:04:28 +0000
Received: from [193.109.254.147:25534] by server-16.bemta-14.messagelabs.com
	id 57/82-09215-BE2E1A05; Tue, 13 Nov 2012 06:04:27 +0000
X-Env-Sender: mattjd@gmail.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352786665!8050465!1
X-Originating-IP: [209.85.160.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13196 invoked from network); 13 Nov 2012 06:04:27 -0000
Received: from mail-pb0-f45.google.com (HELO mail-pb0-f45.google.com)
	(209.85.160.45)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 06:04:27 -0000
Received: by mail-pb0-f45.google.com with SMTP id mc8so2285966pbc.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 22:04:25 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer;
	bh=U+A+UbXvFHBhNM9sGjSPedetgLZbqhBZge3i3Ad5hiU=;
	b=CizF4IX1XNuZ1d82UCfl1LhPsoLfPwlVXUp46KPcDoprD//chohPGHwVllzfdseTyQ
	U2DpnvtDqNszZ4jgnQZPxYlTnXpaqwKmGhHub14xNadvTJhl89MSS+cAK4sBK/XU1iHb
	33nR4AeNcz7eYNTsr6ZENUXht55f3dL9JdTZmM+CE8eJAtb7mR4oUY8BneW6WCwxmY/X
	ZwLx0cwozWsol7dEYVk6ZnpMxDb+2CbNjegon4m77gYTFa4MsifUlLFLqrfS92ZGZr5q
	kjAMatTOW8OBsnTKPORu3juH3VX5h6nVoWXyhR3H8e8iMX7hgwHzmt7q08RWrF4lKjQq
	BrDg==
Received: by 10.69.0.40 with SMTP id av8mr64642084pbd.117.1352786664945;
	Mon, 12 Nov 2012 22:04:24 -0800 (PST)
Received: from morphism.xen.prgmr.com (morphism.xen.prgmr.com. [71.19.145.114])
	by mx.google.com with ESMTPS id c1sm5568250pav.23.2012.11.12.22.04.23
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 12 Nov 2012 22:04:24 -0800 (PST)
From: Matthew Daley <mattjd@gmail.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 19:04:47 +1300
Message-Id: <1352786687-4498-1-git-send-email-mattjd@gmail.com>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Daley <mattjd@gmail.com>
Subject: [Xen-devel] [PATCH] xen: Fix xenctl_cpumap_to_cpumask buffer size
	check
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

xenctl_cpumap_to_cpumask incorrectly uses sizeof when checking whether
bits should be masked off from the input cpumap bitmap or not.

Fix by using the correct cpumask buffer size in place of sizeof.

Signed-off-by: Matthew Daley <mattjd@gmail.com>

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index e153cb4..204e951 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -78,7 +78,7 @@ int xenctl_cpumap_to_cpumask(
     {
         if ( copy_from_guest(bytemap, xenctl_cpumap->bitmap, copy_bytes) )
             err = -EFAULT;
-        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <= sizeof(bytemap)) )
+        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <= (nr_cpu_ids + 7) / 8) )
             bytemap[guest_bytes-1] &= ~(0xff << (xenctl_cpumap->nr_cpus & 7));
     }
 
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 06:29:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 06:29:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY9z7-0006aE-Vt; Tue, 13 Nov 2012 06:28:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kristian@hagsted.dk>) id 1TY9z6-0006a9-5A
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 06:28:32 +0000
Received: from [85.158.139.83:51656] by server-6.bemta-5.messagelabs.com id
	8A/61-19321-F88E1A05; Tue, 13 Nov 2012 06:28:31 +0000
X-Env-Sender: kristian@hagsted.dk
X-Msg-Ref: server-14.tower-182.messagelabs.com!1352788110!25702413!1
X-Originating-IP: [80.160.77.98]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuMTYwLjc3Ljk4ID0+IDM0MzYzMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21427 invoked from network); 13 Nov 2012 06:28:30 -0000
Received: from pasmtpb.tele.dk (HELO pasmtpB.tele.dk) (80.160.77.98)
	by server-14.tower-182.messagelabs.com with SMTP;
	13 Nov 2012 06:28:30 -0000
Received: from hagsted.dk (unknown [2.108.99.186])
	by pasmtpB.tele.dk (Postfix) with ESMTP id 27A99D80A6;
	Tue, 13 Nov 2012 07:28:30 +0100 (CET)
Received: from HAGSTED-BSERVER.hagsted.dk ([fe80::91b7:737e:e057:7c8b]) by
	hagsted-bserver.hagsted.dk ([fe80::91b7:737e:e057:7c8b%10]) with mapi
	id 14.02.0318.004; Tue, 13 Nov 2012 07:28:24 +0100
From: Kristian Hagsted Rasmussen <kristian@hagsted.dk>
To: Ricardo Jesus <ricardo.meb.jesus@gmail.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>
Thread-Topic: [Xen-devel] xen EFI boot and vga-passthrough
Thread-Index: Ac3BCUwxBONJB3zmT1y62jykNdtmkQAAQFdAAAbVtwAAEIqFAA==
Date: Tue, 13 Nov 2012 06:28:22 +0000
Message-ID: <19EF9FEB5AF86243A3F18E5CE75971640A00B4AA@hagsted-bserver.hagsted.dk>
References: <19EF9FEB5AF86243A3F18E5CE75971640A00B0F5@hagsted-bserver.hagsted.dk>
	<19EF9FEB5AF86243A3F18E5CE75971640A00B204@hagsted-bserver.hagsted.dk>
	<CADnevChOxU8Ut3PQX28+E56uFZBiryLQyN3mZ1hL-ddTfiQ7+A@mail.gmail.com>
In-Reply-To: <CADnevChOxU8Ut3PQX28+E56uFZBiryLQyN3mZ1hL-ddTfiQ7+A@mail.gmail.com>
Accept-Language: da-DK, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [192.38.90.11]
MIME-Version: 1.0
Subject: Re: [Xen-devel] xen EFI boot and vga-passthrough
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> -----Original Message-----
> From: Ricardo Jesus [mailto:ricardo.meb.jesus@gmail.com]

> Update DQ77MK's BIOS. BIOS 00050 fixed a bug with UEFI and Linux.
I am convinced that for the DQ77kb, a bios for DQ77MK does not work, but the same bug has been fixed in the 0044 bios version for that board.

 
> The current BIOS release is 00053 and you can find the release notes at
> http://downloadmirror.intel.com/22094/eng/MK_0053_ReleaseNotes.pdf
> 
> On Mon, Nov 12, 2012 at 7:18 PM, Kristian Hagsted Rasmussen
> <kristian@hagsted.dk> wrote:
> > Hi all
> >
> > I can't seem to find any information on vga-passthrough when booting
> through xen.efi, so I assume it should work. But I encounter a problem on a
> windows 7 HVM that boots fine when dom0 is booted through MBR but fails
> when dom0 is booted through UEFI.
> >
> > My system is:
> > DQ77KB motherboard with bios version 44 Core i7-3779T with VT-d Intel
> > HD graphics 4000
> >
> > In the qemu log it seem like xen cannot reach the vga-bios. Is this a known
> problem when booting through xen.efi or is it a bug?
> >
> > dm-command: hot insert pass-through pci dev
> > register_real_device: Assigning real physical device 00:02.0 ...
> > register_real_device: Disable MSI translation via per device option
> > register_real_device: Disable power management
> > pt_iomul_init: Error: pt_iomul_init can't open file
> > /dev/xen/pci_iomul: No such file or directory: 0x0:0x2.0x0
> > pt_register_regions: IO region registered (size=0x00400000
> > base_addr=0xf7000004)
> > pt_register_regions: IO region registered (size=0x10000000
> > base_addr=0xe000000c)
> > pt_register_regions: IO region registered (size=0x00000040
> > base_addr=0x0000f001)
> > setup_vga_pt: vga bios size (0x0) is invalid!
> > register_real_device: Setup VGA BIOS of passthroughed gfx failed!
> >
> > Log file is attached.
> >
> > Just compared a log file from efi boot to one from MBR boot and found this
> discrepancy between the two:
> > pt_register_regions: IO region registered (size=0x00400000
> base_addr=0xdfc00004) - MBR boot see last addr       0xdfc00004
> > pt_register_regions: IO region registered (size=0x00400000
> base_addr=0xf7000004) - EFI boot compare to MBR      0xf7000004
> >
> > Kind regards Kristian Hagsted Rasmussen
> >
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
> >

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 06:29:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 06:29:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TY9z7-0006aE-Vt; Tue, 13 Nov 2012 06:28:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kristian@hagsted.dk>) id 1TY9z6-0006a9-5A
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 06:28:32 +0000
Received: from [85.158.139.83:51656] by server-6.bemta-5.messagelabs.com id
	8A/61-19321-F88E1A05; Tue, 13 Nov 2012 06:28:31 +0000
X-Env-Sender: kristian@hagsted.dk
X-Msg-Ref: server-14.tower-182.messagelabs.com!1352788110!25702413!1
X-Originating-IP: [80.160.77.98]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuMTYwLjc3Ljk4ID0+IDM0MzYzMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21427 invoked from network); 13 Nov 2012 06:28:30 -0000
Received: from pasmtpb.tele.dk (HELO pasmtpB.tele.dk) (80.160.77.98)
	by server-14.tower-182.messagelabs.com with SMTP;
	13 Nov 2012 06:28:30 -0000
Received: from hagsted.dk (unknown [2.108.99.186])
	by pasmtpB.tele.dk (Postfix) with ESMTP id 27A99D80A6;
	Tue, 13 Nov 2012 07:28:30 +0100 (CET)
Received: from HAGSTED-BSERVER.hagsted.dk ([fe80::91b7:737e:e057:7c8b]) by
	hagsted-bserver.hagsted.dk ([fe80::91b7:737e:e057:7c8b%10]) with mapi
	id 14.02.0318.004; Tue, 13 Nov 2012 07:28:24 +0100
From: Kristian Hagsted Rasmussen <kristian@hagsted.dk>
To: Ricardo Jesus <ricardo.meb.jesus@gmail.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>
Thread-Topic: [Xen-devel] xen EFI boot and vga-passthrough
Thread-Index: Ac3BCUwxBONJB3zmT1y62jykNdtmkQAAQFdAAAbVtwAAEIqFAA==
Date: Tue, 13 Nov 2012 06:28:22 +0000
Message-ID: <19EF9FEB5AF86243A3F18E5CE75971640A00B4AA@hagsted-bserver.hagsted.dk>
References: <19EF9FEB5AF86243A3F18E5CE75971640A00B0F5@hagsted-bserver.hagsted.dk>
	<19EF9FEB5AF86243A3F18E5CE75971640A00B204@hagsted-bserver.hagsted.dk>
	<CADnevChOxU8Ut3PQX28+E56uFZBiryLQyN3mZ1hL-ddTfiQ7+A@mail.gmail.com>
In-Reply-To: <CADnevChOxU8Ut3PQX28+E56uFZBiryLQyN3mZ1hL-ddTfiQ7+A@mail.gmail.com>
Accept-Language: da-DK, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [192.38.90.11]
MIME-Version: 1.0
Subject: Re: [Xen-devel] xen EFI boot and vga-passthrough
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> -----Original Message-----
> From: Ricardo Jesus [mailto:ricardo.meb.jesus@gmail.com]

> Update DQ77MK's BIOS. BIOS 00050 fixed a bug with UEFI and Linux.
I am convinced that for the DQ77kb, a bios for DQ77MK does not work, but the same bug has been fixed in the 0044 bios version for that board.

 
> The current BIOS release is 00053 and you can find the release notes at
> http://downloadmirror.intel.com/22094/eng/MK_0053_ReleaseNotes.pdf
> 
> On Mon, Nov 12, 2012 at 7:18 PM, Kristian Hagsted Rasmussen
> <kristian@hagsted.dk> wrote:
> > Hi all
> >
> > I can't seem to find any information on vga-passthrough when booting
> through xen.efi, so I assume it should work. But I encounter a problem on a
> windows 7 HVM that boots fine when dom0 is booted through MBR but fails
> when dom0 is booted through UEFI.
> >
> > My system is:
> > DQ77KB motherboard with bios version 44 Core i7-3779T with VT-d Intel
> > HD graphics 4000
> >
> > In the qemu log it seem like xen cannot reach the vga-bios. Is this a known
> problem when booting through xen.efi or is it a bug?
> >
> > dm-command: hot insert pass-through pci dev
> > register_real_device: Assigning real physical device 00:02.0 ...
> > register_real_device: Disable MSI translation via per device option
> > register_real_device: Disable power management
> > pt_iomul_init: Error: pt_iomul_init can't open file
> > /dev/xen/pci_iomul: No such file or directory: 0x0:0x2.0x0
> > pt_register_regions: IO region registered (size=0x00400000
> > base_addr=0xf7000004)
> > pt_register_regions: IO region registered (size=0x10000000
> > base_addr=0xe000000c)
> > pt_register_regions: IO region registered (size=0x00000040
> > base_addr=0x0000f001)
> > setup_vga_pt: vga bios size (0x0) is invalid!
> > register_real_device: Setup VGA BIOS of passthroughed gfx failed!
> >
> > Log file is attached.
> >
> > Just compared a log file from efi boot to one from MBR boot and found this
> discrepancy between the two:
> > pt_register_regions: IO region registered (size=0x00400000
> base_addr=0xdfc00004) - MBR boot see last addr       0xdfc00004
> > pt_register_regions: IO region registered (size=0x00400000
> base_addr=0xf7000004) - EFI boot compare to MBR      0xf7000004
> >
> > Kind regards Kristian Hagsted Rasmussen
> >
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
> >

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 06:36:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 06:36:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYA6U-0006mZ-7x; Tue, 13 Nov 2012 06:36:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kristian@hagsted.dk>) id 1TYA6S-0006mU-O5
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 06:36:08 +0000
Received: from [193.109.254.147:59281] by server-5.bemta-14.messagelabs.com id
	21/1C-10257-75AE1A05; Tue, 13 Nov 2012 06:36:07 +0000
X-Env-Sender: kristian@hagsted.dk
X-Msg-Ref: server-6.tower-27.messagelabs.com!1352788566!3735919!1
X-Originating-IP: [80.160.77.98]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuMTYwLjc3Ljk4ID0+IDM0MzYzMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1109 invoked from network); 13 Nov 2012 06:36:06 -0000
Received: from pasmtpb.tele.dk (HELO pasmtpB.tele.dk) (80.160.77.98)
	by server-6.tower-27.messagelabs.com with SMTP;
	13 Nov 2012 06:36:06 -0000
Received: from hagsted.dk (unknown [2.108.99.186])
	by pasmtpB.tele.dk (Postfix) with ESMTP id 0F640D80F5;
	Tue, 13 Nov 2012 07:36:06 +0100 (CET)
Received: from HAGSTED-BSERVER.hagsted.dk ([fe80::91b7:737e:e057:7c8b]) by
	hagsted-bserver.hagsted.dk ([fe80::91b7:737e:e057:7c8b%10]) with mapi
	id 14.02.0318.004; Tue, 13 Nov 2012 07:36:06 +0100
From: Kristian Hagsted Rasmussen <kristian@hagsted.dk>
To: Laszlo Ersek <lersek@redhat.com>
Thread-Topic: [Xen-devel] xen EFI boot and vga-passthrough
Thread-Index: Ac3BCUwxBONJB3zmT1y62jykNdtmkQACmcUAABUYj5A=
Date: Tue, 13 Nov 2012 06:36:05 +0000
Message-ID: <19EF9FEB5AF86243A3F18E5CE75971640A00B4CE@hagsted-bserver.hagsted.dk>
References: <19EF9FEB5AF86243A3F18E5CE75971640A00B0F5@hagsted-bserver.hagsted.dk>
	<50A16906.9000301@redhat.com>
In-Reply-To: <50A16906.9000301@redhat.com>
Accept-Language: da-DK, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [192.38.90.11]
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] xen EFI boot and vga-passthrough
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



> -----Original Message-----
> From: Laszlo Ersek [mailto:lersek@redhat.com]

> On 11/12/12 20:08, Kristian Hagsted Rasmussen wrote:
> > Hi all
> >
> > I can't seem to find any information on vga-passthrough when booting
> > through xen.efi, so I assume it should work. But I encounter a problem
> > on a windows 7 HVM that boots fine when dom0 is booted through MBR
> but
> > fails when dom0 is booted through UEFI.
> >
> > My system is:
> > DQ77KB motherboard with bios version 44 Core i7-3779T with VT-d Intel
> > HD graphics 4000
> >
> > In the qemu log it seem like xen cannot reach the vga-bios. Is this a
> > known problem when booting through xen.efi or is it a bug?
> 
> The legacy VGA BIOS is not present on UEFI platforms unless an
> (optional) compatibility support module provides it. (Tangentially, Secure
> Boot disables CSMs.)
> 
> Windows 7 / Windows 2008 R2 have a bug: even when booted on an UEFI
> platform, they depend on the optional VGA BIOS unconditionally. This seems
> to have been fixed in Windows 8 / Windows Server 2012.
I will have to try to install windows 8 when I have time then.

Just compared a log file from efi boot to one from MBR boot and found this discrepancy between the two:
pt_register_regions: IO region registered (size=0x00400000 base_addr=0xdfc00004) - MBR boot see last addr	0xdfc00004
pt_register_regions: IO region registered (size=0x00400000 base_addr=0xf7000004) - EFI boot compare to MBR	0xf7000004
Can UEFI explain this discrepancy in base_addr?
It is admittedly the first portion of memory on the graphic card and is 4M in size, so I suspect it is the vga-bios.
And if it should not be present when boot through UEFI I will happily live with the error, if windows 8 can boot.
 
> See <http://www.linux-
> kvm.org/page/OVMF#Windows_Server_2008_R2_SP1>
> and/or the long "OVMF + Windows 2008 r2 sp1" thread on edk2-devel.
> 
> (Apologies if I misunderstood your question. Admittedly, I haven't done any
> homework wrt. xen.efi or vga passthrough. But your email had too many
> keywords to push my buttons.)
> 
> Laszlo

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 06:36:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 06:36:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYA6U-0006mZ-7x; Tue, 13 Nov 2012 06:36:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kristian@hagsted.dk>) id 1TYA6S-0006mU-O5
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 06:36:08 +0000
Received: from [193.109.254.147:59281] by server-5.bemta-14.messagelabs.com id
	21/1C-10257-75AE1A05; Tue, 13 Nov 2012 06:36:07 +0000
X-Env-Sender: kristian@hagsted.dk
X-Msg-Ref: server-6.tower-27.messagelabs.com!1352788566!3735919!1
X-Originating-IP: [80.160.77.98]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuMTYwLjc3Ljk4ID0+IDM0MzYzMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1109 invoked from network); 13 Nov 2012 06:36:06 -0000
Received: from pasmtpb.tele.dk (HELO pasmtpB.tele.dk) (80.160.77.98)
	by server-6.tower-27.messagelabs.com with SMTP;
	13 Nov 2012 06:36:06 -0000
Received: from hagsted.dk (unknown [2.108.99.186])
	by pasmtpB.tele.dk (Postfix) with ESMTP id 0F640D80F5;
	Tue, 13 Nov 2012 07:36:06 +0100 (CET)
Received: from HAGSTED-BSERVER.hagsted.dk ([fe80::91b7:737e:e057:7c8b]) by
	hagsted-bserver.hagsted.dk ([fe80::91b7:737e:e057:7c8b%10]) with mapi
	id 14.02.0318.004; Tue, 13 Nov 2012 07:36:06 +0100
From: Kristian Hagsted Rasmussen <kristian@hagsted.dk>
To: Laszlo Ersek <lersek@redhat.com>
Thread-Topic: [Xen-devel] xen EFI boot and vga-passthrough
Thread-Index: Ac3BCUwxBONJB3zmT1y62jykNdtmkQACmcUAABUYj5A=
Date: Tue, 13 Nov 2012 06:36:05 +0000
Message-ID: <19EF9FEB5AF86243A3F18E5CE75971640A00B4CE@hagsted-bserver.hagsted.dk>
References: <19EF9FEB5AF86243A3F18E5CE75971640A00B0F5@hagsted-bserver.hagsted.dk>
	<50A16906.9000301@redhat.com>
In-Reply-To: <50A16906.9000301@redhat.com>
Accept-Language: da-DK, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [192.38.90.11]
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] xen EFI boot and vga-passthrough
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



> -----Original Message-----
> From: Laszlo Ersek [mailto:lersek@redhat.com]

> On 11/12/12 20:08, Kristian Hagsted Rasmussen wrote:
> > Hi all
> >
> > I can't seem to find any information on vga-passthrough when booting
> > through xen.efi, so I assume it should work. But I encounter a problem
> > on a windows 7 HVM that boots fine when dom0 is booted through MBR
> but
> > fails when dom0 is booted through UEFI.
> >
> > My system is:
> > DQ77KB motherboard with bios version 44 Core i7-3779T with VT-d Intel
> > HD graphics 4000
> >
> > In the qemu log it seem like xen cannot reach the vga-bios. Is this a
> > known problem when booting through xen.efi or is it a bug?
> 
> The legacy VGA BIOS is not present on UEFI platforms unless an
> (optional) compatibility support module provides it. (Tangentially, Secure
> Boot disables CSMs.)
> 
> Windows 7 / Windows 2008 R2 have a bug: even when booted on an UEFI
> platform, they depend on the optional VGA BIOS unconditionally. This seems
> to have been fixed in Windows 8 / Windows Server 2012.
I will have to try to install windows 8 when I have time then.

Just compared a log file from efi boot to one from MBR boot and found this discrepancy between the two:
pt_register_regions: IO region registered (size=0x00400000 base_addr=0xdfc00004) - MBR boot see last addr	0xdfc00004
pt_register_regions: IO region registered (size=0x00400000 base_addr=0xf7000004) - EFI boot compare to MBR	0xf7000004
Can UEFI explain this discrepancy in base_addr?
It is admittedly the first portion of memory on the graphic card and is 4M in size, so I suspect it is the vga-bios.
And if it should not be present when boot through UEFI I will happily live with the error, if windows 8 can boot.
 
> See <http://www.linux-
> kvm.org/page/OVMF#Windows_Server_2008_R2_SP1>
> and/or the long "OVMF + Windows 2008 r2 sp1" thread on edk2-devel.
> 
> (Apologies if I misunderstood your question. Admittedly, I haven't done any
> homework wrt. xen.efi or vga passthrough. But your email had too many
> keywords to push my buttons.)
> 
> Laszlo

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 08:08:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 08:08:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYBXG-00084Y-M1; Tue, 13 Nov 2012 08:07:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYBXF-00084T-B2
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 08:07:53 +0000
Received: from [85.158.143.35:5538] by server-3.bemta-4.messagelabs.com id
	FE/32-06841-8DFF1A05; Tue, 13 Nov 2012 08:07:52 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1352794072!5268732!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM3NjM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7604 invoked from network); 13 Nov 2012 08:07:52 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-21.messagelabs.com with SMTP;
	13 Nov 2012 08:07:52 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 08:07:50 +0000
Message-Id: <50A20DE302000078000A7F6B@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 08:07:47 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>,
	"Yang Z Zhang" <yang.z.zhang@intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 01:11, "Zhang, Yang Z" <yang.z.zhang@intel.com> wrote:
> Jan Beulich wrote on 2012-11-05:
>> so far it was my understanding that this option is intended to get
>> the DMA behavior that Dom0 observes as close as possible to how
>> it would be without IOMMU.
> 
> Correct. There is a bit in context entry which controlling the DMA 
> request(from this device) to walk or not walk the iommu page table.
> As we known, walking page table introduced extra cost, so we use this 
> parameter to make sure the device which owned by dom0 not to walking iommu 
> page table when DMA request is arrived.

Okay, so that would be slightly different from the meaning I give
to the option (as described above).

>> However, we're now dealing with a customer report where a
>> single function device is observed to initiate DMA operations
>> appearing to originate from function 1, which makes obvious that
>> the option above is not making things as transparent as I would
>> have expected them to be: Without IOMMU, such requests get
>> processed fine, while with IOMMU (due to there not being a
>> context entry for the bogus device) the device fails to initialize
>> (causing DMA faults, the presence of which I had to convince
>> myself of separately, as for whatever reason at least the VT-d
>> code doesn't issue any log message in that case).
> 
> Sorry, I cannot understand your problem. Is there any bug in current VT-d 
> code?

We need to settle on the concept here first: What specifically is
said option intended to do?

Only then we can talk about bugs, and if there is one I suspect it's
not only in VT-d code, but equally much in AMD IOMMU's.

The thing here is that a device functioning properly without IOMMU
(with "properly" not necessarily meaning it being implemented
correctly as per specification, albeit I also didn't check whether the
spec would allow for the observed behavior) doesn't once DMA
translation is enabled (even if suppressed for Dom0 via above
option).

The problem being that while device enumeration only finds a single
device at function zero of the respective (seg,bus,dev) tuple, DMA
requests - as seen by the IOMMU - originate from non-zero
functions under the same tuple. Since a non-discovered device
doesn't get a context entry inserted, this result in an IOMMU fault,
rendering the device non-functional.

The data from the system I have so far doesn't tell me whether the
device incorrectly claims itself as single function (with the functions
other than func 0 simply not being discovered during device
enumeration, as single function devices don't get their non-zero
functions scanned) or whether the config space for functions 1-7
indeed is unpopulated, with the device issuing requests with non-
zero function number for other, unexplained reasons.

Bottom line - I'm seeking advice as to whether working around
this problem in the IOMMU code is desirable/necessary, or
whether this is a design flaw on the device's side that just
cannot be tolerated with an IOMMU in the picture (which would
need good reasoning, so that a customer expecting such a
device to work regardless of IOMMU usage can understand that
this cannot reasonably be made work).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 08:08:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 08:08:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYBXG-00084Y-M1; Tue, 13 Nov 2012 08:07:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYBXF-00084T-B2
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 08:07:53 +0000
Received: from [85.158.143.35:5538] by server-3.bemta-4.messagelabs.com id
	FE/32-06841-8DFF1A05; Tue, 13 Nov 2012 08:07:52 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1352794072!5268732!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM3NjM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7604 invoked from network); 13 Nov 2012 08:07:52 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-21.messagelabs.com with SMTP;
	13 Nov 2012 08:07:52 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 08:07:50 +0000
Message-Id: <50A20DE302000078000A7F6B@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 08:07:47 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>,
	"Yang Z Zhang" <yang.z.zhang@intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 01:11, "Zhang, Yang Z" <yang.z.zhang@intel.com> wrote:
> Jan Beulich wrote on 2012-11-05:
>> so far it was my understanding that this option is intended to get
>> the DMA behavior that Dom0 observes as close as possible to how
>> it would be without IOMMU.
> 
> Correct. There is a bit in context entry which controlling the DMA 
> request(from this device) to walk or not walk the iommu page table.
> As we known, walking page table introduced extra cost, so we use this 
> parameter to make sure the device which owned by dom0 not to walking iommu 
> page table when DMA request is arrived.

Okay, so that would be slightly different from the meaning I give
to the option (as described above).

>> However, we're now dealing with a customer report where a
>> single function device is observed to initiate DMA operations
>> appearing to originate from function 1, which makes obvious that
>> the option above is not making things as transparent as I would
>> have expected them to be: Without IOMMU, such requests get
>> processed fine, while with IOMMU (due to there not being a
>> context entry for the bogus device) the device fails to initialize
>> (causing DMA faults, the presence of which I had to convince
>> myself of separately, as for whatever reason at least the VT-d
>> code doesn't issue any log message in that case).
> 
> Sorry, I cannot understand your problem. Is there any bug in current VT-d 
> code?

We need to settle on the concept here first: What specifically is
said option intended to do?

Only then we can talk about bugs, and if there is one I suspect it's
not only in VT-d code, but equally much in AMD IOMMU's.

The thing here is that a device functioning properly without IOMMU
(with "properly" not necessarily meaning it being implemented
correctly as per specification, albeit I also didn't check whether the
spec would allow for the observed behavior) doesn't once DMA
translation is enabled (even if suppressed for Dom0 via above
option).

The problem being that while device enumeration only finds a single
device at function zero of the respective (seg,bus,dev) tuple, DMA
requests - as seen by the IOMMU - originate from non-zero
functions under the same tuple. Since a non-discovered device
doesn't get a context entry inserted, this result in an IOMMU fault,
rendering the device non-functional.

The data from the system I have so far doesn't tell me whether the
device incorrectly claims itself as single function (with the functions
other than func 0 simply not being discovered during device
enumeration, as single function devices don't get their non-zero
functions scanned) or whether the config space for functions 1-7
indeed is unpopulated, with the device issuing requests with non-
zero function number for other, unexplained reasons.

Bottom line - I'm seeking advice as to whether working around
this problem in the IOMMU code is desirable/necessary, or
whether this is a design flaw on the device's side that just
cannot be tolerated with an IOMMU in the picture (which would
need good reasoning, so that a customer expecting such a
device to work regardless of IOMMU usage can understand that
this cannot reasonably be made work).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 08:37:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 08:37:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYBzR-0008Of-Qu; Tue, 13 Nov 2012 08:37:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYBzQ-0008Oa-BG
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 08:37:00 +0000
Received: from [85.158.143.99:8417] by server-2.bemta-4.messagelabs.com id
	43/A7-28922-BA602A05; Tue, 13 Nov 2012 08:36:59 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1352795819!29730245!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM3NjM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16236 invoked from network); 13 Nov 2012 08:36:59 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-216.messagelabs.com with SMTP;
	13 Nov 2012 08:36:59 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 08:36:58 +0000
Message-Id: <50A214B902000078000A7F88@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 08:36:57 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Matthew Daley" <mattjd@gmail.com>
References: <1352786687-4498-1-git-send-email-mattjd@gmail.com>
In-Reply-To: <1352786687-4498-1-git-send-email-mattjd@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: Fix xenctl_cpumap_to_cpumask buffer
 size check
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 07:04, Matthew Daley <mattjd@gmail.com> wrote:
> xenctl_cpumap_to_cpumask incorrectly uses sizeof when checking whether
> bits should be masked off from the input cpumap bitmap or not.
> 
> Fix by using the correct cpumask buffer size in place of sizeof.
> 
> Signed-off-by: Matthew Daley <mattjd@gmail.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

However, I would have preferred the adjustment to be ...

> diff --git a/xen/common/domctl.c b/xen/common/domctl.c
> index e153cb4..204e951 100644
> --- a/xen/common/domctl.c
> +++ b/xen/common/domctl.c
> @@ -78,7 +78,7 @@ int xenctl_cpumap_to_cpumask(
>      {
>          if ( copy_from_guest(bytemap, xenctl_cpumap->bitmap, copy_bytes) )
>              err = -EFAULT;
> -        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <= sizeof(bytemap)) )
> +        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <= (nr_cpu_ids + 7) / 8) )

        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <= copy_bytes) )

or even (considering that guest_bytes >= copy_bytes due to the
way copy_bytes gets initialized)

        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes == copy_bytes) )

to make explicit when exactly the masking is necessary.

Further, the fact this is not security relevant (i.e. the bug could
not cause memory corruption) isn't obvious either: It is implied
from _xmalloc() never returning chunks of data smaller than the
size of a pointer, i.e. even if sizeof(void*) > guest_bytes >
copy_bytes, the piece of memory erroneously written to would
still be inside the allocation done at the top of the function. I'd
suppose that would have been worth mentioning in the change
description.

And, for the record (and in order to determine backporting
needs), I caused this with c/s 23991:a7ccbc79fc17.

Jan

>              bytemap[guest_bytes-1] &= ~(0xff << (xenctl_cpumap->nr_cpus & 7));
>      }
>  
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 08:37:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 08:37:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYBzR-0008Of-Qu; Tue, 13 Nov 2012 08:37:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYBzQ-0008Oa-BG
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 08:37:00 +0000
Received: from [85.158.143.99:8417] by server-2.bemta-4.messagelabs.com id
	43/A7-28922-BA602A05; Tue, 13 Nov 2012 08:36:59 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1352795819!29730245!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM3NjM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16236 invoked from network); 13 Nov 2012 08:36:59 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-216.messagelabs.com with SMTP;
	13 Nov 2012 08:36:59 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 08:36:58 +0000
Message-Id: <50A214B902000078000A7F88@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 08:36:57 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Matthew Daley" <mattjd@gmail.com>
References: <1352786687-4498-1-git-send-email-mattjd@gmail.com>
In-Reply-To: <1352786687-4498-1-git-send-email-mattjd@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: Fix xenctl_cpumap_to_cpumask buffer
 size check
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 07:04, Matthew Daley <mattjd@gmail.com> wrote:
> xenctl_cpumap_to_cpumask incorrectly uses sizeof when checking whether
> bits should be masked off from the input cpumap bitmap or not.
> 
> Fix by using the correct cpumask buffer size in place of sizeof.
> 
> Signed-off-by: Matthew Daley <mattjd@gmail.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

However, I would have preferred the adjustment to be ...

> diff --git a/xen/common/domctl.c b/xen/common/domctl.c
> index e153cb4..204e951 100644
> --- a/xen/common/domctl.c
> +++ b/xen/common/domctl.c
> @@ -78,7 +78,7 @@ int xenctl_cpumap_to_cpumask(
>      {
>          if ( copy_from_guest(bytemap, xenctl_cpumap->bitmap, copy_bytes) )
>              err = -EFAULT;
> -        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <= sizeof(bytemap)) )
> +        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <= (nr_cpu_ids + 7) / 8) )

        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <= copy_bytes) )

or even (considering that guest_bytes >= copy_bytes due to the
way copy_bytes gets initialized)

        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes == copy_bytes) )

to make explicit when exactly the masking is necessary.

Further, the fact this is not security relevant (i.e. the bug could
not cause memory corruption) isn't obvious either: It is implied
from _xmalloc() never returning chunks of data smaller than the
size of a pointer, i.e. even if sizeof(void*) > guest_bytes >
copy_bytes, the piece of memory erroneously written to would
still be inside the allocation done at the top of the function. I'd
suppose that would have been worth mentioning in the change
description.

And, for the record (and in order to determine backporting
needs), I caused this with c/s 23991:a7ccbc79fc17.

Jan

>              bytemap[guest_bytes-1] &= ~(0xff << (xenctl_cpumap->nr_cpus & 7));
>      }
>  
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 08:41:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 08:41:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYC2w-000056-LR; Tue, 13 Nov 2012 08:40:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYC2w-00004z-3c
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 08:40:38 +0000
Received: from [85.158.143.99:38987] by server-1.bemta-4.messagelabs.com id
	5E/70-27934-58702A05; Tue, 13 Nov 2012 08:40:37 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352796036!26331097!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM3NjM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29382 invoked from network); 13 Nov 2012 08:40:36 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-216.messagelabs.com with SMTP;
	13 Nov 2012 08:40:36 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 08:40:36 +0000
Message-Id: <50A2159002000078000A7F96@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 08:40:32 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Christoph Egger" <Christoph.Egger@amd.com>,
	"Xudong Hao" <xudong.hao@intel.com>
References: <506EE9A7.6090009@amd.com> <50815162.4090601@amd.com>
	<5081869B02000078000A2A1F@nat28.tlf.novell.com>
	<20609.27440.478178.971262@mariner.uk.xensource.com>
	<5081887502000078000A2A51@nat28.tlf.novell.com>
	<1352737542.27833.296.camel@zakaz.uk.xensource.com>
	<403610A45A2B5242BD291EDAE8B37D300FF02D43@SHSMSX102.ccr.corp.intel.com>
In-Reply-To: <403610A45A2B5242BD291EDAE8B37D300FF02D43@SHSMSX102.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Haicheng Li <haicheng.li@intel.com>, Jinsong Liu <jinsong.liu@intel.com>,
	"Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Yunhong Jiang <yunhong.jiang@intel.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] tools/xen-mceinj: support AMD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 02:40, "Hao, Xudong" <xudong.hao@intel.com> wrote:
>>  -----Original Message-----
>> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
>> Sent: Tuesday, November 13, 2012 12:26 AM
>> To: Jan Beulich
>> Cc: Ian Jackson; Christoph Egger; xen-devel@lists.xen.org; Keir (Xen.org); 
> Liu,
>> Jinsong; Liu, Jinsong; Jiang, Yunhong; Li, Haicheng; Hao, Xudong
>> Subject: Re: [Xen-devel] [PATCH] tools/xen-mceinj: support AMD
>> 
>> On Fri, 2012-10-19 at 16:05 +0100, Jan Beulich wrote:
>> > >>> On 19.10.12 at 17:01, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
>> > > Jan Beulich writes ("Re: [Xen-devel] [PATCH] tools/xen-mceinj: support
>> AMD"):
>> > >> >>> On 19.10.12 at 15:10, Christoph Egger <Christoph.Egger@amd.com>
>> wrote:
>> > >> > Ping?
>> > >>
>> > >> I'm afraid it's not really clear who should commit this - it's tools
>> > >> side code, so IanJ or IanC would normally be the ones, but otoh
>> > >> it's code requiring low level hardware knowledge to review the
>> > >> patch, so both of them might want to rather not do the review.
>> > >> In the past it was usually Keir who eventually committed such
>> > >> patches, but I don't know whether he put this on his to-look-at-
>> > >> and-eventually-commit list.
>> > >
>> > > My view is that I would like an ack from someone who understands
>> > > what's going on ...
>> >
>> > Which would ideally be those who introduced the code, i.e.
>> > Intel folks if I'm not mistaken...
>> 
>> Lets CC some of them then.
>> 
>> Intel folks -- any opinion on the patch below from Christoph?
>> 
> 
> It's ok for me except for one comments. See below.
> Of course I did not review the AMD only code.
> 
>> +    if (strstr(cpu_brand, "AMD"))
>> +        cpu_is_amd = 1;
>> +    else
>> +        cpu_is_intel = 1;
>> +
>> +    if (cpu_is_intel)
>> +        type = INTEL_MCE_SRAO_MEM;
>> +
> 
> Isn't necessary to set a default AMD type? The "-t" parameter is required 
> for amd but not always for Intel for users, it's better to give a unified 
> usage for all users.

Yes, I had pointed this out in an earlier reply already, as much as
I had asked (in the context of a matching hypervisor side patch)
about the reason for only dealing with bank 4 registers here.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 08:41:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 08:41:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYC2w-000056-LR; Tue, 13 Nov 2012 08:40:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYC2w-00004z-3c
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 08:40:38 +0000
Received: from [85.158.143.99:38987] by server-1.bemta-4.messagelabs.com id
	5E/70-27934-58702A05; Tue, 13 Nov 2012 08:40:37 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352796036!26331097!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDM3NjM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29382 invoked from network); 13 Nov 2012 08:40:36 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-216.messagelabs.com with SMTP;
	13 Nov 2012 08:40:36 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 08:40:36 +0000
Message-Id: <50A2159002000078000A7F96@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 08:40:32 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Christoph Egger" <Christoph.Egger@amd.com>,
	"Xudong Hao" <xudong.hao@intel.com>
References: <506EE9A7.6090009@amd.com> <50815162.4090601@amd.com>
	<5081869B02000078000A2A1F@nat28.tlf.novell.com>
	<20609.27440.478178.971262@mariner.uk.xensource.com>
	<5081887502000078000A2A51@nat28.tlf.novell.com>
	<1352737542.27833.296.camel@zakaz.uk.xensource.com>
	<403610A45A2B5242BD291EDAE8B37D300FF02D43@SHSMSX102.ccr.corp.intel.com>
In-Reply-To: <403610A45A2B5242BD291EDAE8B37D300FF02D43@SHSMSX102.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Haicheng Li <haicheng.li@intel.com>, Jinsong Liu <jinsong.liu@intel.com>,
	"Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Yunhong Jiang <yunhong.jiang@intel.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] tools/xen-mceinj: support AMD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 02:40, "Hao, Xudong" <xudong.hao@intel.com> wrote:
>>  -----Original Message-----
>> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
>> Sent: Tuesday, November 13, 2012 12:26 AM
>> To: Jan Beulich
>> Cc: Ian Jackson; Christoph Egger; xen-devel@lists.xen.org; Keir (Xen.org); 
> Liu,
>> Jinsong; Liu, Jinsong; Jiang, Yunhong; Li, Haicheng; Hao, Xudong
>> Subject: Re: [Xen-devel] [PATCH] tools/xen-mceinj: support AMD
>> 
>> On Fri, 2012-10-19 at 16:05 +0100, Jan Beulich wrote:
>> > >>> On 19.10.12 at 17:01, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
>> > > Jan Beulich writes ("Re: [Xen-devel] [PATCH] tools/xen-mceinj: support
>> AMD"):
>> > >> >>> On 19.10.12 at 15:10, Christoph Egger <Christoph.Egger@amd.com>
>> wrote:
>> > >> > Ping?
>> > >>
>> > >> I'm afraid it's not really clear who should commit this - it's tools
>> > >> side code, so IanJ or IanC would normally be the ones, but otoh
>> > >> it's code requiring low level hardware knowledge to review the
>> > >> patch, so both of them might want to rather not do the review.
>> > >> In the past it was usually Keir who eventually committed such
>> > >> patches, but I don't know whether he put this on his to-look-at-
>> > >> and-eventually-commit list.
>> > >
>> > > My view is that I would like an ack from someone who understands
>> > > what's going on ...
>> >
>> > Which would ideally be those who introduced the code, i.e.
>> > Intel folks if I'm not mistaken...
>> 
>> Lets CC some of them then.
>> 
>> Intel folks -- any opinion on the patch below from Christoph?
>> 
> 
> It's ok for me except for one comments. See below.
> Of course I did not review the AMD only code.
> 
>> +    if (strstr(cpu_brand, "AMD"))
>> +        cpu_is_amd = 1;
>> +    else
>> +        cpu_is_intel = 1;
>> +
>> +    if (cpu_is_intel)
>> +        type = INTEL_MCE_SRAO_MEM;
>> +
> 
> Isn't necessary to set a default AMD type? The "-t" parameter is required 
> for amd but not always for Intel for users, it's better to give a unified 
> usage for all users.

Yes, I had pointed this out in an earlier reply already, as much as
I had asked (in the context of a matching hypervisor side patch)
about the reason for only dealing with bank 4 registers here.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 08:48:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 08:48:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYCAP-0000KQ-Q0; Tue, 13 Nov 2012 08:48:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Paul.Durrant@citrix.com>)
	id 1TYCAO-0000KI-SU; Tue, 13 Nov 2012 08:48:21 +0000
Received: from [193.109.254.147:32903] by server-7.bemta-14.messagelabs.com id
	BB/09-02272-35902A05; Tue, 13 Nov 2012 08:48:19 +0000
X-Env-Sender: Paul.Durrant@citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1352796371!8978064!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgxNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12581 invoked from network); 13 Nov 2012 08:46:11 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 08:46:11 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208,217";a="15769746"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 08:46:11 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Tue, 13 Nov 2012
	08:46:11 +0000
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Rob Rhinehart <robrhinehart@ieee.org>, "xen-users@lists.xen.org"
	<xen-users@lists.xen.org>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>
Date: Tue, 13 Nov 2012 08:46:44 +0000
Thread-Topic: [Xen-devel] NVIDIA VGX Hypervisor
Thread-Index: Ac3BKp4j0OCeFQ4ZT1qqLsNBIrHJDAAUE/vQ
Message-ID: <291EDFCB1E9E224A99088639C4762022011052985567@LONPMAILBOX01.citrite.net>
References: <CA+W74gbZNW7Kjm2f6yabT3CGLrtZqVm=7cFhqoXf8_eTHBnW2w@mail.gmail.com>
In-Reply-To: <CA+W74gbZNW7Kjm2f6yabT3CGLrtZqVm=7cFhqoXf8_eTHBnW2w@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] NVIDIA VGX Hypervisor
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0438394981905534461=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0438394981905534461==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_291EDFCB1E9E224A99088639C4762022011052985567LONPMAILBOX_"

--_000_291EDFCB1E9E224A99088639C4762022011052985567LONPMAILBOX_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi,

  XenServer does not yet support GPU virtualization. It is something that i=
s planned or a future release. Indeed it is not the same as passthrough. It=
 may work on open source Xen at some future date, but it's not something we=
're actively pursuing.

  Paul

From: xen-devel-bounces@lists.xen.org [mailto:xen-devel-bounces@lists.xen.o=
rg] On Behalf Of Rob Rhinehart
Sent: 12 November 2012 23:07
To: xen-users@lists.xen.org; xen-devel@lists.xen.org
Subject: [Xen-devel] NVIDIA VGX Hypervisor

I've been reading that Xenserver supports GPU virtualization with NVIDIA VG=
X. I assume this is different than PCI passthrough. Is there any support fo=
r this in open source xen, or efforts to do so?

Thank you

--_000_291EDFCB1E9E224A99088639C4762022011052985567LONPMAILBOX_
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-micr=
osoft-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=3D"Content-Type" CONTENT=
=3D"text/html; charset=3Dus-ascii"><meta name=3DGenerator content=3D"Micros=
oft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","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-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></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=3DEN-GB link=3Dblue vli=
nk=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal><span style=3D'f=
ont-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi,<o:p><=
/o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-f=
amily:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sa=
ns-serif";color:#1F497D'>&nbsp; XenServer does not yet support GPU virtuali=
zation. It is something that is planned or a future release. Indeed it is n=
ot the same as passthrough. It may work on open source Xen at some future d=
ate, but it&#8217;s not something we&#8217;re actively pursuing.<o:p></o:p>=
</span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family=
:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=
=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-se=
rif";color:#1F497D'>&nbsp; Paul<o:p></o:p></span></p><p class=3DMsoNormal><=
span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F=
497D'><o:p>&nbsp;</o:p></span></p><div style=3D'border:none;border-left:sol=
id blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style=3D'border:none;bor=
der-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=3DMsoNormal=
><b><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Tahoma","sans=
-serif"'>From:</span></b><span lang=3DEN-US style=3D'font-size:10.0pt;font-=
family:"Tahoma","sans-serif"'> xen-devel-bounces@lists.xen.org [mailto:xen-=
devel-bounces@lists.xen.org] <b>On Behalf Of </b>Rob Rhinehart<br><b>Sent:<=
/b> 12 November 2012 23:07<br><b>To:</b> xen-users@lists.xen.org; xen-devel=
@lists.xen.org<br><b>Subject:</b> [Xen-devel] NVIDIA VGX Hypervisor<o:p></o=
:p></span></p></div></div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p clas=
s=3DMsoNormal>I've been reading that Xenserver supports GPU virtualization =
with NVIDIA VGX. I assume this is different than PCI passthrough.&nbsp;Is t=
here any support for this in open source xen, or efforts to do so?<o:p></o:=
p></p><div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=3D=
MsoNormal>Thank you<o:p></o:p></p></div></div></div></body></html>=

--_000_291EDFCB1E9E224A99088639C4762022011052985567LONPMAILBOX_--


--===============0438394981905534461==
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.xen.org
http://lists.xen.org/xen-devel

--===============0438394981905534461==--


From xen-devel-bounces@lists.xen.org Tue Nov 13 08:48:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 08:48:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYCAP-0000KQ-Q0; Tue, 13 Nov 2012 08:48:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Paul.Durrant@citrix.com>)
	id 1TYCAO-0000KI-SU; Tue, 13 Nov 2012 08:48:21 +0000
Received: from [193.109.254.147:32903] by server-7.bemta-14.messagelabs.com id
	BB/09-02272-35902A05; Tue, 13 Nov 2012 08:48:19 +0000
X-Env-Sender: Paul.Durrant@citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1352796371!8978064!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgxNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12581 invoked from network); 13 Nov 2012 08:46:11 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 08:46:11 -0000
X-IronPort-AV: E=Sophos;i="4.80,764,1344211200"; d="scan'208,217";a="15769746"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 08:46:11 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Tue, 13 Nov 2012
	08:46:11 +0000
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Rob Rhinehart <robrhinehart@ieee.org>, "xen-users@lists.xen.org"
	<xen-users@lists.xen.org>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>
Date: Tue, 13 Nov 2012 08:46:44 +0000
Thread-Topic: [Xen-devel] NVIDIA VGX Hypervisor
Thread-Index: Ac3BKp4j0OCeFQ4ZT1qqLsNBIrHJDAAUE/vQ
Message-ID: <291EDFCB1E9E224A99088639C4762022011052985567@LONPMAILBOX01.citrite.net>
References: <CA+W74gbZNW7Kjm2f6yabT3CGLrtZqVm=7cFhqoXf8_eTHBnW2w@mail.gmail.com>
In-Reply-To: <CA+W74gbZNW7Kjm2f6yabT3CGLrtZqVm=7cFhqoXf8_eTHBnW2w@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] NVIDIA VGX Hypervisor
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0438394981905534461=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0438394981905534461==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_291EDFCB1E9E224A99088639C4762022011052985567LONPMAILBOX_"

--_000_291EDFCB1E9E224A99088639C4762022011052985567LONPMAILBOX_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi,

  XenServer does not yet support GPU virtualization. It is something that i=
s planned or a future release. Indeed it is not the same as passthrough. It=
 may work on open source Xen at some future date, but it's not something we=
're actively pursuing.

  Paul

From: xen-devel-bounces@lists.xen.org [mailto:xen-devel-bounces@lists.xen.o=
rg] On Behalf Of Rob Rhinehart
Sent: 12 November 2012 23:07
To: xen-users@lists.xen.org; xen-devel@lists.xen.org
Subject: [Xen-devel] NVIDIA VGX Hypervisor

I've been reading that Xenserver supports GPU virtualization with NVIDIA VG=
X. I assume this is different than PCI passthrough. Is there any support fo=
r this in open source xen, or efforts to do so?

Thank you

--_000_291EDFCB1E9E224A99088639C4762022011052985567LONPMAILBOX_
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-micr=
osoft-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=3D"Content-Type" CONTENT=
=3D"text/html; charset=3Dus-ascii"><meta name=3DGenerator content=3D"Micros=
oft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","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-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></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=3DEN-GB link=3Dblue vli=
nk=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal><span style=3D'f=
ont-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi,<o:p><=
/o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-f=
amily:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sa=
ns-serif";color:#1F497D'>&nbsp; XenServer does not yet support GPU virtuali=
zation. It is something that is planned or a future release. Indeed it is n=
ot the same as passthrough. It may work on open source Xen at some future d=
ate, but it&#8217;s not something we&#8217;re actively pursuing.<o:p></o:p>=
</span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family=
:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=
=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-se=
rif";color:#1F497D'>&nbsp; Paul<o:p></o:p></span></p><p class=3DMsoNormal><=
span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F=
497D'><o:p>&nbsp;</o:p></span></p><div style=3D'border:none;border-left:sol=
id blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style=3D'border:none;bor=
der-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=3DMsoNormal=
><b><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Tahoma","sans=
-serif"'>From:</span></b><span lang=3DEN-US style=3D'font-size:10.0pt;font-=
family:"Tahoma","sans-serif"'> xen-devel-bounces@lists.xen.org [mailto:xen-=
devel-bounces@lists.xen.org] <b>On Behalf Of </b>Rob Rhinehart<br><b>Sent:<=
/b> 12 November 2012 23:07<br><b>To:</b> xen-users@lists.xen.org; xen-devel=
@lists.xen.org<br><b>Subject:</b> [Xen-devel] NVIDIA VGX Hypervisor<o:p></o=
:p></span></p></div></div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p clas=
s=3DMsoNormal>I've been reading that Xenserver supports GPU virtualization =
with NVIDIA VGX. I assume this is different than PCI passthrough.&nbsp;Is t=
here any support for this in open source xen, or efforts to do so?<o:p></o:=
p></p><div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=3D=
MsoNormal>Thank you<o:p></o:p></p></div></div></div></body></html>=

--_000_291EDFCB1E9E224A99088639C4762022011052985567LONPMAILBOX_--


--===============0438394981905534461==
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.xen.org
http://lists.xen.org/xen-devel

--===============0438394981905534461==--


From xen-devel-bounces@lists.xen.org Tue Nov 13 08:50:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 08:50:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYCCN-0000WD-3k; Tue, 13 Nov 2012 08:50:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TYCCM-0000W4-1s
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 08:50:22 +0000
Received: from [85.158.143.99:35278] by server-1.bemta-4.messagelabs.com id
	96/CD-27934-DC902A05; Tue, 13 Nov 2012 08:50:21 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1352796618!24440872!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjI5NTg1\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11730 invoked from network); 13 Nov 2012 08:50:19 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-12.tower-216.messagelabs.com with SMTP;
	13 Nov 2012 08:50:19 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga102.ch.intel.com with ESMTP; 13 Nov 2012 00:50:17 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,764,1344236400"; d="scan'208";a="167661391"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by AZSMGA002.ch.intel.com with ESMTP; 13 Nov 2012 00:50:16 -0800
Received: from FMSMSX110.amr.corp.intel.com (10.19.9.29) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 13 Nov 2012 00:50:15 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	fmsmsx110.amr.corp.intel.com (10.19.9.29) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 13 Nov 2012 00:50:15 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Tue, 13 Nov 2012 16:50:13 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, "Zhang, Yang Z" <yang.z.zhang@intel.com>
Thread-Topic: [Xen-devel] iommu=dom0-passthrough behavior
Thread-Index: AQHNwXYJqLF+2AjHBkK5l/uG97/aIZfnbfFg
Date: Tue, 13 Nov 2012 08:50:13 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
In-Reply-To: <50A20DE302000078000A7F6B@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>, "Zhang,
	Xiantao" <xiantao.zhang@intel.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Tuesday, November 13, 2012 4:08 PM
> To: Zhang, Xiantao; Zhang, Yang Z
> Cc: wei.huang2@amd.com; weiwang.dd@gmail.com; xen-devel
> Subject: RE: [Xen-devel] iommu=dom0-passthrough behavior
> 
> >>> On 13.11.12 at 01:11, "Zhang, Yang Z" <yang.z.zhang@intel.com> wrote:
> > Jan Beulich wrote on 2012-11-05:
> >> so far it was my understanding that this option is intended to get
> >> the DMA behavior that Dom0 observes as close as possible to how it
> >> would be without IOMMU.
> >
> > Correct. There is a bit in context entry which controlling the DMA
> > request(from this device) to walk or not walk the iommu page table.
> > As we known, walking page table introduced extra cost, so we use this
> > parameter to make sure the device which owned by dom0 not to walking
> > iommu page table when DMA request is arrived.
> 
> Okay, so that would be slightly different from the meaning I give to the
> option (as described above).
> 
> >> However, we're now dealing with a customer report where a single
> >> function device is observed to initiate DMA operations appearing to
> >> originate from function 1, which makes obvious that the option above
> >> is not making things as transparent as I would have expected them to
> >> be: Without IOMMU, such requests get processed fine, while with
> IOMMU
> >> (due to there not being a context entry for the bogus device) the
> >> device fails to initialize (causing DMA faults, the presence of which
> >> I had to convince myself of separately, as for whatever reason at
> >> least the VT-d code doesn't issue any log message in that case).
> >
> > Sorry, I cannot understand your problem. Is there any bug in current
> > VT-d code?
> 
> We need to settle on the concept here first: What specifically is said option
> intended to do? 

Basically,  this options just allows the transactions from dom0's devices not subject to VT-d engine.  Actually,  It is not targeted to fix something, but just allows users isolating VT-d issues from dom0. 
As I know, in early days, VT-d is not that stable,   if dom0's devices are controlled by VT-d,  some strange issues may trigger in system's boot stage, so use this options to disable VT-d for Dom0. 

> Only then we can talk about bugs, and if there is one I suspect it's not only in
> VT-d code, but equally much in AMD IOMMU's.
> 
> The thing here is that a device functioning properly without IOMMU (with
> "properly" not necessarily meaning it being implemented correctly as per
> specification, albeit I also didn't check whether the spec would allow for the
> observed behavior) doesn't once DMA translation is enabled (even if
> suppressed for Dom0 via above option).
> 
> The problem being that while device enumeration only finds a single device
> at function zero of the respective (seg,bus,dev) tuple, DMA requests - as
> seen by the IOMMU - originate from non-zero functions under the same
> tuple. Since a non-discovered device doesn't get a context entry inserted,
> this result in an IOMMU fault, rendering the device non-functional.
> 
> The data from the system I have so far doesn't tell me whether the device
> incorrectly claims itself as single function (with the functions other than func
> 0 simply not being discovered during device enumeration, as single function
> devices don't get their non-zero functions scanned) or whether the config
> space for functions 1-7 indeed is unpopulated, with the device issuing
> requests with non- zero function number for other, unexplained reasons.


> Bottom line - I'm seeking advice as to whether working around this problem
> in the IOMMU code is desirable/necessary, or whether this is a design flaw
> on the device's side that just cannot be tolerated with an IOMMU in the
> picture (which would need good reasoning, so that a customer expecting
> such a device to work regardless of IOMMU usage can understand that this
> cannot reasonably be made work).

The issue is why the non-zero functions don't claim themselves during PCI bus scan.   From security point of view,  VT-d shouldn't allow transactions from the unknown devices. 
Xiantao



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 08:50:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 08:50:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYCCN-0000WD-3k; Tue, 13 Nov 2012 08:50:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TYCCM-0000W4-1s
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 08:50:22 +0000
Received: from [85.158.143.99:35278] by server-1.bemta-4.messagelabs.com id
	96/CD-27934-DC902A05; Tue, 13 Nov 2012 08:50:21 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1352796618!24440872!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjI5NTg1\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11730 invoked from network); 13 Nov 2012 08:50:19 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-12.tower-216.messagelabs.com with SMTP;
	13 Nov 2012 08:50:19 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga102.ch.intel.com with ESMTP; 13 Nov 2012 00:50:17 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,764,1344236400"; d="scan'208";a="167661391"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by AZSMGA002.ch.intel.com with ESMTP; 13 Nov 2012 00:50:16 -0800
Received: from FMSMSX110.amr.corp.intel.com (10.19.9.29) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 13 Nov 2012 00:50:15 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	fmsmsx110.amr.corp.intel.com (10.19.9.29) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 13 Nov 2012 00:50:15 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Tue, 13 Nov 2012 16:50:13 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, "Zhang, Yang Z" <yang.z.zhang@intel.com>
Thread-Topic: [Xen-devel] iommu=dom0-passthrough behavior
Thread-Index: AQHNwXYJqLF+2AjHBkK5l/uG97/aIZfnbfFg
Date: Tue, 13 Nov 2012 08:50:13 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
In-Reply-To: <50A20DE302000078000A7F6B@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>, "Zhang,
	Xiantao" <xiantao.zhang@intel.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Tuesday, November 13, 2012 4:08 PM
> To: Zhang, Xiantao; Zhang, Yang Z
> Cc: wei.huang2@amd.com; weiwang.dd@gmail.com; xen-devel
> Subject: RE: [Xen-devel] iommu=dom0-passthrough behavior
> 
> >>> On 13.11.12 at 01:11, "Zhang, Yang Z" <yang.z.zhang@intel.com> wrote:
> > Jan Beulich wrote on 2012-11-05:
> >> so far it was my understanding that this option is intended to get
> >> the DMA behavior that Dom0 observes as close as possible to how it
> >> would be without IOMMU.
> >
> > Correct. There is a bit in context entry which controlling the DMA
> > request(from this device) to walk or not walk the iommu page table.
> > As we known, walking page table introduced extra cost, so we use this
> > parameter to make sure the device which owned by dom0 not to walking
> > iommu page table when DMA request is arrived.
> 
> Okay, so that would be slightly different from the meaning I give to the
> option (as described above).
> 
> >> However, we're now dealing with a customer report where a single
> >> function device is observed to initiate DMA operations appearing to
> >> originate from function 1, which makes obvious that the option above
> >> is not making things as transparent as I would have expected them to
> >> be: Without IOMMU, such requests get processed fine, while with
> IOMMU
> >> (due to there not being a context entry for the bogus device) the
> >> device fails to initialize (causing DMA faults, the presence of which
> >> I had to convince myself of separately, as for whatever reason at
> >> least the VT-d code doesn't issue any log message in that case).
> >
> > Sorry, I cannot understand your problem. Is there any bug in current
> > VT-d code?
> 
> We need to settle on the concept here first: What specifically is said option
> intended to do? 

Basically,  this options just allows the transactions from dom0's devices not subject to VT-d engine.  Actually,  It is not targeted to fix something, but just allows users isolating VT-d issues from dom0. 
As I know, in early days, VT-d is not that stable,   if dom0's devices are controlled by VT-d,  some strange issues may trigger in system's boot stage, so use this options to disable VT-d for Dom0. 

> Only then we can talk about bugs, and if there is one I suspect it's not only in
> VT-d code, but equally much in AMD IOMMU's.
> 
> The thing here is that a device functioning properly without IOMMU (with
> "properly" not necessarily meaning it being implemented correctly as per
> specification, albeit I also didn't check whether the spec would allow for the
> observed behavior) doesn't once DMA translation is enabled (even if
> suppressed for Dom0 via above option).
> 
> The problem being that while device enumeration only finds a single device
> at function zero of the respective (seg,bus,dev) tuple, DMA requests - as
> seen by the IOMMU - originate from non-zero functions under the same
> tuple. Since a non-discovered device doesn't get a context entry inserted,
> this result in an IOMMU fault, rendering the device non-functional.
> 
> The data from the system I have so far doesn't tell me whether the device
> incorrectly claims itself as single function (with the functions other than func
> 0 simply not being discovered during device enumeration, as single function
> devices don't get their non-zero functions scanned) or whether the config
> space for functions 1-7 indeed is unpopulated, with the device issuing
> requests with non- zero function number for other, unexplained reasons.


> Bottom line - I'm seeking advice as to whether working around this problem
> in the IOMMU code is desirable/necessary, or whether this is a design flaw
> on the device's side that just cannot be tolerated with an IOMMU in the
> picture (which would need good reasoning, so that a customer expecting
> such a device to work regardless of IOMMU usage can understand that this
> cannot reasonably be made work).

The issue is why the non-zero functions don't claim themselves during PCI bus scan.   From security point of view,  VT-d shouldn't allow transactions from the unknown devices. 
Xiantao



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 09:15:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 09:15:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYCab-0001Ef-RG; Tue, 13 Nov 2012 09:15:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <qianhu2011@gmail.com>) id 1TYA0o-0006eT-Ly
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 06:30:18 +0000
Received: from [193.109.254.147:33095] by server-11.bemta-14.messagelabs.com
	id 65/2F-29027-9F8E1A05; Tue, 13 Nov 2012 06:30:17 +0000
X-Env-Sender: qianhu2011@gmail.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1352788215!9463448!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17340 invoked from network); 13 Nov 2012 06:30:16 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 06:30:16 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl15so8509528vcb.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 22:30:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=2+bE1UV1mcftgrtmHoRSFkVRrVs1/Frg3F2pQPbE8pQ=;
	b=ZnZgreHlL8B+F4F0XkG/Cyz9Y1N2WBIql7N5ZiWPtWSHrb2qIM2aGnWqWSryIdl08B
	nV5v74Ezx4z2d6F7ZvgM/WdWydlzq+GHrlik9nzSp4HjN3s5W660En8fCoyb0B3zoHKX
	ebUxPzUJXNXqgsHHQmti9/ejpKNvgtYDtnj7A0NsiyyEYy6Urm05GUPGVnIE3I4sZUc/
	pXQBj1VGL6MWplgPmyPmBcTn0YDuJw7OjXXk4Ey/8lG8I/FnYAicAT/0Q2K8Uioudc1C
	ItcbND7Ezn5GKDy2aHAhxPg9JzKUZUf70lYOvIUe1Kcu+NubeJr01gufBtwq8yINp/cX
	Ajow==
MIME-Version: 1.0
Received: by 10.58.94.109 with SMTP id db13mr24949208veb.39.1352788215088;
	Mon, 12 Nov 2012 22:30:15 -0800 (PST)
Received: by 10.58.219.42 with HTTP; Mon, 12 Nov 2012 22:30:14 -0800 (PST)
Date: Tue, 13 Nov 2012 14:30:14 +0800
Message-ID: <CALCpXpDcvBLtXG=tUeHsF==7AiCGCsaUMoGd8DGtjax6d5wiaQ@mail.gmail.com>
From: Qian Hu <qianhu2011@gmail.com>
To: xen-devel@lists.xen.org
X-Mailman-Approved-At: Tue, 13 Nov 2012 09:15:24 +0000
Subject: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the virtual
 machine created by xl command?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8820481319959022908=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============8820481319959022908==
Content-Type: multipart/alternative; boundary=047d7b6dcba804452d04ce5a8d84

--047d7b6dcba804452d04ce5a8d84
Content-Type: text/plain; charset=ISO-8859-1

Hi, everyone!

I am working on xen-4.2.0 with spice remote connect.  My host is Fedora 14
and guest is win7.

I have installed spice package and now I can connect to guest by spice
client.

For better graphics experience, I want to try the  VGA passthrough.

With spice tool, I have to create a VM by xl command, and now I am
wondering if it supports VGA passghrouth?

If so, how should I  test it ?

The device model in my config file is "qemu-xen".

Thank you!

huqian

--047d7b6dcba804452d04ce5a8d84
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<span style=3D"font-family:arial,sans-serif;font-size:13.63636302947998px;b=
ackground-color:rgb(255,255,255)">Hi, everyone!</span><br style=3D"font-fam=
ily:arial,sans-serif;font-size:13.63636302947998px;background-color:rgb(255=
,255,255)">
<br style=3D"font-family:arial,sans-serif;font-size:13.63636302947998px;bac=
kground-color:rgb(255,255,255)"><span style=3D"font-family:arial,sans-serif=
;font-size:13.63636302947998px;background-color:rgb(255,255,255)">I am work=
ing on xen-4.2.0 with spice remote connect. =A0My host is Fedora 14 and gue=
st is win7.</span><div>
<span style=3D"font-family:arial,sans-serif;font-size:13.63636302947998px;b=
ackground-color:rgb(255,255,255)"><br></span></div><div><span style=3D"font=
-family:arial,sans-serif;font-size:13.63636302947998px;background-color:rgb=
(255,255,255)">I have installed spice package and now I can connect to gues=
t by spice client.</span></div>
<div><span style=3D"font-family:arial,sans-serif;font-size:13.6363630294799=
8px;background-color:rgb(255,255,255)"><br></span></div><div><span style=3D=
"font-family:arial,sans-serif;font-size:13.63636302947998px;background-colo=
r:rgb(255,255,255)">For better graphics experience, I want to try the =A0VG=
A passthrough.</span><div>
<span style=3D"font-family:arial,sans-serif;font-size:13.63636302947998px;b=
ackground-color:rgb(255,255,255)"><br></span></div><div><span style=3D"font=
-family:arial,sans-serif;font-size:13.63636302947998px;background-color:rgb=
(255,255,255)">With spice tool, I have to create a VM by xl command, and no=
w I am wondering if it=A0</span><span style=3D"font-family:arial,sans-serif=
;font-size:13.63636302947998px;background-color:rgb(255,255,255)">supports =
VGA passghrouth?</span><br style=3D"font-family:arial,sans-serif;font-size:=
13.63636302947998px;background-color:rgb(255,255,255)">
<br style=3D"font-family:arial,sans-serif;font-size:13.63636302947998px;bac=
kground-color:rgb(255,255,255)"><span style=3D"font-family:arial,sans-serif=
;font-size:13.63636302947998px;background-color:rgb(255,255,255)">If so, ho=
w should I =A0test it ?</span><div>
<span style=3D"background-color:rgb(255,255,255);font-family:arial,sans-ser=
if;font-size:13.63636302947998px"><br></span></div><div><span style=3D"back=
ground-color:rgb(255,255,255);font-family:arial,sans-serif;font-size:13.636=
36302947998px">The device model in my config file is &quot;qemu-xen&quot;.<=
/span></div>
<div><span style=3D"background-color:rgb(255,255,255);font-family:arial,san=
s-serif;font-size:13.63636302947998px"><br></span></div><div><span style=3D=
"background-color:rgb(255,255,255);font-family:arial,sans-serif;font-size:1=
3.63636302947998px">Thank you!</span></div>
<div><br></div><div><font face=3D"arial, sans-serif">huqian</font></div><di=
v><br></div></div></div>

--047d7b6dcba804452d04ce5a8d84--


--===============8820481319959022908==
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.xen.org
http://lists.xen.org/xen-devel

--===============8820481319959022908==--


From xen-devel-bounces@lists.xen.org Tue Nov 13 09:15:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 09:15:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYCab-0001Ef-RG; Tue, 13 Nov 2012 09:15:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <qianhu2011@gmail.com>) id 1TYA0o-0006eT-Ly
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 06:30:18 +0000
Received: from [193.109.254.147:33095] by server-11.bemta-14.messagelabs.com
	id 65/2F-29027-9F8E1A05; Tue, 13 Nov 2012 06:30:17 +0000
X-Env-Sender: qianhu2011@gmail.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1352788215!9463448!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17340 invoked from network); 13 Nov 2012 06:30:16 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 06:30:16 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl15so8509528vcb.32
	for <xen-devel@lists.xen.org>; Mon, 12 Nov 2012 22:30:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=2+bE1UV1mcftgrtmHoRSFkVRrVs1/Frg3F2pQPbE8pQ=;
	b=ZnZgreHlL8B+F4F0XkG/Cyz9Y1N2WBIql7N5ZiWPtWSHrb2qIM2aGnWqWSryIdl08B
	nV5v74Ezx4z2d6F7ZvgM/WdWydlzq+GHrlik9nzSp4HjN3s5W660En8fCoyb0B3zoHKX
	ebUxPzUJXNXqgsHHQmti9/ejpKNvgtYDtnj7A0NsiyyEYy6Urm05GUPGVnIE3I4sZUc/
	pXQBj1VGL6MWplgPmyPmBcTn0YDuJw7OjXXk4Ey/8lG8I/FnYAicAT/0Q2K8Uioudc1C
	ItcbND7Ezn5GKDy2aHAhxPg9JzKUZUf70lYOvIUe1Kcu+NubeJr01gufBtwq8yINp/cX
	Ajow==
MIME-Version: 1.0
Received: by 10.58.94.109 with SMTP id db13mr24949208veb.39.1352788215088;
	Mon, 12 Nov 2012 22:30:15 -0800 (PST)
Received: by 10.58.219.42 with HTTP; Mon, 12 Nov 2012 22:30:14 -0800 (PST)
Date: Tue, 13 Nov 2012 14:30:14 +0800
Message-ID: <CALCpXpDcvBLtXG=tUeHsF==7AiCGCsaUMoGd8DGtjax6d5wiaQ@mail.gmail.com>
From: Qian Hu <qianhu2011@gmail.com>
To: xen-devel@lists.xen.org
X-Mailman-Approved-At: Tue, 13 Nov 2012 09:15:24 +0000
Subject: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the virtual
 machine created by xl command?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8820481319959022908=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============8820481319959022908==
Content-Type: multipart/alternative; boundary=047d7b6dcba804452d04ce5a8d84

--047d7b6dcba804452d04ce5a8d84
Content-Type: text/plain; charset=ISO-8859-1

Hi, everyone!

I am working on xen-4.2.0 with spice remote connect.  My host is Fedora 14
and guest is win7.

I have installed spice package and now I can connect to guest by spice
client.

For better graphics experience, I want to try the  VGA passthrough.

With spice tool, I have to create a VM by xl command, and now I am
wondering if it supports VGA passghrouth?

If so, how should I  test it ?

The device model in my config file is "qemu-xen".

Thank you!

huqian

--047d7b6dcba804452d04ce5a8d84
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<span style=3D"font-family:arial,sans-serif;font-size:13.63636302947998px;b=
ackground-color:rgb(255,255,255)">Hi, everyone!</span><br style=3D"font-fam=
ily:arial,sans-serif;font-size:13.63636302947998px;background-color:rgb(255=
,255,255)">
<br style=3D"font-family:arial,sans-serif;font-size:13.63636302947998px;bac=
kground-color:rgb(255,255,255)"><span style=3D"font-family:arial,sans-serif=
;font-size:13.63636302947998px;background-color:rgb(255,255,255)">I am work=
ing on xen-4.2.0 with spice remote connect. =A0My host is Fedora 14 and gue=
st is win7.</span><div>
<span style=3D"font-family:arial,sans-serif;font-size:13.63636302947998px;b=
ackground-color:rgb(255,255,255)"><br></span></div><div><span style=3D"font=
-family:arial,sans-serif;font-size:13.63636302947998px;background-color:rgb=
(255,255,255)">I have installed spice package and now I can connect to gues=
t by spice client.</span></div>
<div><span style=3D"font-family:arial,sans-serif;font-size:13.6363630294799=
8px;background-color:rgb(255,255,255)"><br></span></div><div><span style=3D=
"font-family:arial,sans-serif;font-size:13.63636302947998px;background-colo=
r:rgb(255,255,255)">For better graphics experience, I want to try the =A0VG=
A passthrough.</span><div>
<span style=3D"font-family:arial,sans-serif;font-size:13.63636302947998px;b=
ackground-color:rgb(255,255,255)"><br></span></div><div><span style=3D"font=
-family:arial,sans-serif;font-size:13.63636302947998px;background-color:rgb=
(255,255,255)">With spice tool, I have to create a VM by xl command, and no=
w I am wondering if it=A0</span><span style=3D"font-family:arial,sans-serif=
;font-size:13.63636302947998px;background-color:rgb(255,255,255)">supports =
VGA passghrouth?</span><br style=3D"font-family:arial,sans-serif;font-size:=
13.63636302947998px;background-color:rgb(255,255,255)">
<br style=3D"font-family:arial,sans-serif;font-size:13.63636302947998px;bac=
kground-color:rgb(255,255,255)"><span style=3D"font-family:arial,sans-serif=
;font-size:13.63636302947998px;background-color:rgb(255,255,255)">If so, ho=
w should I =A0test it ?</span><div>
<span style=3D"background-color:rgb(255,255,255);font-family:arial,sans-ser=
if;font-size:13.63636302947998px"><br></span></div><div><span style=3D"back=
ground-color:rgb(255,255,255);font-family:arial,sans-serif;font-size:13.636=
36302947998px">The device model in my config file is &quot;qemu-xen&quot;.<=
/span></div>
<div><span style=3D"background-color:rgb(255,255,255);font-family:arial,san=
s-serif;font-size:13.63636302947998px"><br></span></div><div><span style=3D=
"background-color:rgb(255,255,255);font-family:arial,sans-serif;font-size:1=
3.63636302947998px">Thank you!</span></div>
<div><br></div><div><font face=3D"arial, sans-serif">huqian</font></div><di=
v><br></div></div></div>

--047d7b6dcba804452d04ce5a8d84--


--===============8820481319959022908==
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.xen.org
http://lists.xen.org/xen-devel

--===============8820481319959022908==--


From xen-devel-bounces@lists.xen.org Tue Nov 13 09:42:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 09:42:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYD01-0001Yu-T9; Tue, 13 Nov 2012 09:41:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYD00-0001Yj-Nb
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 09:41:40 +0000
Received: from [85.158.143.99:14369] by server-2.bemta-4.messagelabs.com id
	4F/43-28922-3D512A05; Tue, 13 Nov 2012 09:41:39 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352799697!29147963!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7920 invoked from network); 13 Nov 2012 09:41:37 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-216.messagelabs.com with SMTP;
	13 Nov 2012 09:41:37 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 09:41:37 +0000
Message-Id: <50A223DE02000078000A7FE6@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 09:41:34 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>,
	"Yang Z Zhang" <yang.z.zhang@intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 09:50, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
>> From: Jan Beulich [mailto:JBeulich@suse.com]
>> We need to settle on the concept here first: What specifically is said 
>> option intended to do? 
> 
> Basically,  this options just allows the transactions from dom0's devices 
> not subject to VT-d engine.  Actually,  It is not targeted to fix something, 
> but just allows users isolating VT-d issues from dom0. 
> As I know, in early days, VT-d is not that stable,   if dom0's devices are 
> controlled by VT-d,  some strange issues may trigger in system's boot stage, 
> so use this options to disable VT-d for Dom0. 

Which it doesn't, as the specific case here shows.

>> Bottom line - I'm seeking advice as to whether working around this problem
>> in the IOMMU code is desirable/necessary, or whether this is a design flaw
>> on the device's side that just cannot be tolerated with an IOMMU in the
>> picture (which would need good reasoning, so that a customer expecting
>> such a device to work regardless of IOMMU usage can understand that this
>> cannot reasonably be made work).
> 
> The issue is why the non-zero functions don't claim themselves during PCI bus 
> scan.

As said - I can't tell whether there is a secondary function in the
first place (and I didn't try to find out because it doesn't really
matter for the purpose of finding a solution/workaround).

>   From security point of view,  VT-d shouldn't allow transactions from 
> the unknown devices. 

That's inconsistent with what you say above: Either there is a way
to suppress IOMMU involvement in Dom0 operation (which is
inherently insecure), or there is not. If there is, there's no point in
claiming security for one aspect but not another.

I think it is obvious that I'm not suggesting to allow pass through of
such a device at this point (albeit even that would seem possible and,
from a customer's pov, desirable), and as long as users are aware of
the security implications when using the option under discussion here,
I don't see why that option shouldn't be made fully work. It should be
left to the admins of individual systems to decide between security
and functionality, we should provide them with ways to implement
their choice.

Otoh I'm unaware of a similar option for native Linux, yet it is
suffering the same problem on that system when DMA translation
gets turned on.

But the direction you give to the discussion doesn't lead us towards
a solution for the customer (or a profound explanation why none
is possible), so if we could please focus on that aspect again.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 09:42:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 09:42:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYD01-0001Yu-T9; Tue, 13 Nov 2012 09:41:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYD00-0001Yj-Nb
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 09:41:40 +0000
Received: from [85.158.143.99:14369] by server-2.bemta-4.messagelabs.com id
	4F/43-28922-3D512A05; Tue, 13 Nov 2012 09:41:39 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352799697!29147963!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7920 invoked from network); 13 Nov 2012 09:41:37 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-216.messagelabs.com with SMTP;
	13 Nov 2012 09:41:37 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 09:41:37 +0000
Message-Id: <50A223DE02000078000A7FE6@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 09:41:34 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>,
	"Yang Z Zhang" <yang.z.zhang@intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 09:50, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
>> From: Jan Beulich [mailto:JBeulich@suse.com]
>> We need to settle on the concept here first: What specifically is said 
>> option intended to do? 
> 
> Basically,  this options just allows the transactions from dom0's devices 
> not subject to VT-d engine.  Actually,  It is not targeted to fix something, 
> but just allows users isolating VT-d issues from dom0. 
> As I know, in early days, VT-d is not that stable,   if dom0's devices are 
> controlled by VT-d,  some strange issues may trigger in system's boot stage, 
> so use this options to disable VT-d for Dom0. 

Which it doesn't, as the specific case here shows.

>> Bottom line - I'm seeking advice as to whether working around this problem
>> in the IOMMU code is desirable/necessary, or whether this is a design flaw
>> on the device's side that just cannot be tolerated with an IOMMU in the
>> picture (which would need good reasoning, so that a customer expecting
>> such a device to work regardless of IOMMU usage can understand that this
>> cannot reasonably be made work).
> 
> The issue is why the non-zero functions don't claim themselves during PCI bus 
> scan.

As said - I can't tell whether there is a secondary function in the
first place (and I didn't try to find out because it doesn't really
matter for the purpose of finding a solution/workaround).

>   From security point of view,  VT-d shouldn't allow transactions from 
> the unknown devices. 

That's inconsistent with what you say above: Either there is a way
to suppress IOMMU involvement in Dom0 operation (which is
inherently insecure), or there is not. If there is, there's no point in
claiming security for one aspect but not another.

I think it is obvious that I'm not suggesting to allow pass through of
such a device at this point (albeit even that would seem possible and,
from a customer's pov, desirable), and as long as users are aware of
the security implications when using the option under discussion here,
I don't see why that option shouldn't be made fully work. It should be
left to the admins of individual systems to decide between security
and functionality, we should provide them with ways to implement
their choice.

Otoh I'm unaware of a similar option for native Linux, yet it is
suffering the same problem on that system when DMA translation
gets turned on.

But the direction you give to the discussion doesn't lead us towards
a solution for the customer (or a profound explanation why none
is possible), so if we could please focus on that aspect again.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 09:46:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 09:46:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYD41-0001nM-Na; Tue, 13 Nov 2012 09:45:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYD40-0001nE-21
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 09:45:48 +0000
Received: from [85.158.139.83:16736] by server-7.bemta-5.messagelabs.com id
	F9/06-23096-BC612A05; Tue, 13 Nov 2012 09:45:47 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1352799946!30006939!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15599 invoked from network); 13 Nov 2012 09:45:46 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 09:45:46 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15771498"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 09:45:42 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 09:45:41 +0000
Message-ID: <1352799940.7491.11.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Juan Lorenzana <juan@jelsupport.com>
Date: Tue, 13 Nov 2012 09:45:40 +0000
In-Reply-To: <F2EF84CA5BCF824AA4197956E124073848F4AE@server.jel.local>
References: <F2EF84CA5BCF824AA4197956E124073848F4AE@server.jel.local>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] .vhd will not boot in VM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

VGhpcyBsaXN0IGlzIGZvciBkZXZlbG9wbWVudCBvZiB0aGUgWGVuIGh5cGVydmlzb3IsIG5vdCBm
b3IgdXNlciB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X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWls
aW5nIGxpc3QKWGVuLWRldmVsQGxpc3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVu
LWRldmVsCg==

From xen-devel-bounces@lists.xen.org Tue Nov 13 09:46:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 09:46:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYD41-0001nM-Na; Tue, 13 Nov 2012 09:45:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYD40-0001nE-21
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 09:45:48 +0000
Received: from [85.158.139.83:16736] by server-7.bemta-5.messagelabs.com id
	F9/06-23096-BC612A05; Tue, 13 Nov 2012 09:45:47 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1352799946!30006939!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15599 invoked from network); 13 Nov 2012 09:45:46 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 09:45:46 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15771498"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 09:45:42 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 09:45:41 +0000
Message-ID: <1352799940.7491.11.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Juan Lorenzana <juan@jelsupport.com>
Date: Tue, 13 Nov 2012 09:45:40 +0000
In-Reply-To: <F2EF84CA5BCF824AA4197956E124073848F4AE@server.jel.local>
References: <F2EF84CA5BCF824AA4197956E124073848F4AE@server.jel.local>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] .vhd will not boot in VM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

VGhpcyBsaXN0IGlzIGZvciBkZXZlbG9wbWVudCBvZiB0aGUgWGVuIGh5cGVydmlzb3IsIG5vdCBm
b3IgdXNlciBzdXBwb3J0Cm9mIGVpdGhlciB0aGUgWGVuIHN1cHBsaWVkIHRvb2xzIG9yIFhDUC4K
ClRoZSBYQ1AgZXhwZXJ0aXNlIHRlbmRzIHRvIGhhbmcgb3V0IG9uIHhlb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
LWRldmVsCg==

From xen-devel-bounces@lists.xen.org Tue Nov 13 09:52:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 09:52:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYDAV-00021c-My; Tue, 13 Nov 2012 09:52:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYDAU-00020X-8O
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 09:52:30 +0000
Received: from [85.158.143.35:6532] by server-1.bemta-4.messagelabs.com id
	8D/CA-27934-D5812A05; Tue, 13 Nov 2012 09:52:29 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1352800348!12020588!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26670 invoked from network); 13 Nov 2012 09:52:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 09:52:28 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15771698"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 09:52:28 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 09:52:27 +0000
Message-ID: <1352800347.7491.15.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Rob Lampe <rlampe@tqhosting.com>
Date: Tue, 13 Nov 2012 09:52:27 +0000
In-Reply-To: <CAJ-XR45wpOH_uwENAh-Ozn4mJjb2AjXw+uTGfVcqndYVdRov8A@mail.gmail.com>
References: <CAJ-XR45wpOH_uwENAh-Ozn4mJjb2AjXw+uTGfVcqndYVdRov8A@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Reboot failure in Xen 4.2.0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-12 at 16:44 +0000, Rob Lampe wrote:
> Hi,
> 
> I am having an issue where a small percentage of the time, rebooting a
> VM from the VM does not actually work.
> 
> Xen Version: 4.2.0
> OS: Debian 6.0
> Kernel: 3.2.30
> 
> Note, we are still using xend instead of xl. Could that be the problem?

>From the trace this certainly appears to be a xend problem. I'm afraid
that rather limits the time people here are going to be able to spend
investigating.

> [2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2499) XendDomainInfo.constructDomain
> [2012-11-12 14:47:20 2381] ERROR (XendDomainInfo:488) VM start failed Traceback (most recent call last):
>   File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py", line 473, in start
>     XendTask.log_progress(0, 30, self._constructDomain)
>   File "/usr/lib/python2.6/dist-packages/xen/xend/XendTask.py", line 209, in log_progress
>     retval = func(*args, **kwds)
>   File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py", line 2576, in _constructDomain
>     self._recreateDom()
>   File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py", line 1730, in _recreateDom
>     complete(self.dompath, lambda t: self._recreateDomFunc(t))
>   File "/usr/lib/python2.6/dist-packages/xen/xend/xenstore/xstransact.py", line 364, in complete
>     if t.commit():
>   File "/usr/lib/python2.6/dist-packages/xen/xend/xenstore/xstransact.py", line 41, in commit
>     rc = xshandle().transaction_end(self.transaction, False)
> Error: (2, 'No such file or directory')

I guess this is the issue. If you want to try and track it down I'd
suggest adding additional logging at the various locations pointed to by
this callchain to try and identify what it is doing and what is not
present ("No such file or directory").

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 09:52:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 09:52:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYDAV-00021c-My; Tue, 13 Nov 2012 09:52:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYDAU-00020X-8O
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 09:52:30 +0000
Received: from [85.158.143.35:6532] by server-1.bemta-4.messagelabs.com id
	8D/CA-27934-D5812A05; Tue, 13 Nov 2012 09:52:29 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1352800348!12020588!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26670 invoked from network); 13 Nov 2012 09:52:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 09:52:28 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15771698"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 09:52:28 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 09:52:27 +0000
Message-ID: <1352800347.7491.15.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Rob Lampe <rlampe@tqhosting.com>
Date: Tue, 13 Nov 2012 09:52:27 +0000
In-Reply-To: <CAJ-XR45wpOH_uwENAh-Ozn4mJjb2AjXw+uTGfVcqndYVdRov8A@mail.gmail.com>
References: <CAJ-XR45wpOH_uwENAh-Ozn4mJjb2AjXw+uTGfVcqndYVdRov8A@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Reboot failure in Xen 4.2.0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-12 at 16:44 +0000, Rob Lampe wrote:
> Hi,
> 
> I am having an issue where a small percentage of the time, rebooting a
> VM from the VM does not actually work.
> 
> Xen Version: 4.2.0
> OS: Debian 6.0
> Kernel: 3.2.30
> 
> Note, we are still using xend instead of xl. Could that be the problem?

>From the trace this certainly appears to be a xend problem. I'm afraid
that rather limits the time people here are going to be able to spend
investigating.

> [2012-11-12 14:47:20 2381] DEBUG (XendDomainInfo:2499) XendDomainInfo.constructDomain
> [2012-11-12 14:47:20 2381] ERROR (XendDomainInfo:488) VM start failed Traceback (most recent call last):
>   File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py", line 473, in start
>     XendTask.log_progress(0, 30, self._constructDomain)
>   File "/usr/lib/python2.6/dist-packages/xen/xend/XendTask.py", line 209, in log_progress
>     retval = func(*args, **kwds)
>   File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py", line 2576, in _constructDomain
>     self._recreateDom()
>   File "/usr/lib/python2.6/dist-packages/xen/xend/XendDomainInfo.py", line 1730, in _recreateDom
>     complete(self.dompath, lambda t: self._recreateDomFunc(t))
>   File "/usr/lib/python2.6/dist-packages/xen/xend/xenstore/xstransact.py", line 364, in complete
>     if t.commit():
>   File "/usr/lib/python2.6/dist-packages/xen/xend/xenstore/xstransact.py", line 41, in commit
>     rc = xshandle().transaction_end(self.transaction, False)
> Error: (2, 'No such file or directory')

I guess this is the issue. If you want to try and track it down I'd
suggest adding additional logging at the various locations pointed to by
this callchain to try and identify what it is doing and what is not
present ("No such file or directory").

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:00:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:00:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYDHf-0002As-JZ; Tue, 13 Nov 2012 09:59:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYDHe-0002An-IZ
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 09:59:54 +0000
Received: from [85.158.138.51:7164] by server-2.bemta-3.messagelabs.com id
	C3/BF-04744-91A12A05; Tue, 13 Nov 2012 09:59:53 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1352800792!29807516!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6846 invoked from network); 13 Nov 2012 09:59:53 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 09:59:53 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15771919"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 09:59:52 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 09:59:52 +0000
Message-ID: <1352800791.7491.21.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Razvan Cojocaru <rzvncj@gmail.com>
Date: Tue, 13 Nov 2012 09:59:51 +0000
In-Reply-To: <50A16639.2090209@gmail.com>
References: <50A16639.2090209@gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-12 at 21:12 +0000, Razvan Cojocaru wrote:
> Hello,
> 
> I'm interested in establishing a communication channel between the Xen
> hypervisor and a dom0 userspace application. Ideally this would be a
> 2-way channel, with the hypervisor asynchronously notifying this
> application, and then (for certain types of messages) wait for a reply
> from the userspace consumer.

Sounds a lot like the model used by the IOREQs, this is the mechanism
for dispatching MMIO emulation to the qemu process for HVM domains.

> What would you recommend for my case? Where (if anywhere) might I be
> able to find a clear, concise, example of allocating and sharing memory
> pages containing a ring buffer used for hypervisor <-> dom0 userspace
> communication (hopefully even simpler that trace.c)?

I think I'd look at the ioreq stuff in preference to the trace stuff.
You probably want to use a normal evtchn rather than VIRQ. The code
which handles HVM_PARAM_BUFIOREQ_PFN and HVM_PARAM_BUFIOREQ_EVTCHN
should give a reasonable starting point (I think, I'm not actually the
familiar with this bit of Xen).

It might also be useful if you describe your actual end-goal -- i.e.
what you are ultimately trying to achieve. It may be that there are
better approaches or even existing solutions or things which are already
close to your needs.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:00:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:00:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYDHf-0002As-JZ; Tue, 13 Nov 2012 09:59:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYDHe-0002An-IZ
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 09:59:54 +0000
Received: from [85.158.138.51:7164] by server-2.bemta-3.messagelabs.com id
	C3/BF-04744-91A12A05; Tue, 13 Nov 2012 09:59:53 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1352800792!29807516!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6846 invoked from network); 13 Nov 2012 09:59:53 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 09:59:53 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15771919"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 09:59:52 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 09:59:52 +0000
Message-ID: <1352800791.7491.21.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Razvan Cojocaru <rzvncj@gmail.com>
Date: Tue, 13 Nov 2012 09:59:51 +0000
In-Reply-To: <50A16639.2090209@gmail.com>
References: <50A16639.2090209@gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-12 at 21:12 +0000, Razvan Cojocaru wrote:
> Hello,
> 
> I'm interested in establishing a communication channel between the Xen
> hypervisor and a dom0 userspace application. Ideally this would be a
> 2-way channel, with the hypervisor asynchronously notifying this
> application, and then (for certain types of messages) wait for a reply
> from the userspace consumer.

Sounds a lot like the model used by the IOREQs, this is the mechanism
for dispatching MMIO emulation to the qemu process for HVM domains.

> What would you recommend for my case? Where (if anywhere) might I be
> able to find a clear, concise, example of allocating and sharing memory
> pages containing a ring buffer used for hypervisor <-> dom0 userspace
> communication (hopefully even simpler that trace.c)?

I think I'd look at the ioreq stuff in preference to the trace stuff.
You probably want to use a normal evtchn rather than VIRQ. The code
which handles HVM_PARAM_BUFIOREQ_PFN and HVM_PARAM_BUFIOREQ_EVTCHN
should give a reasonable starting point (I think, I'm not actually the
familiar with this bit of Xen).

It might also be useful if you describe your actual end-goal -- i.e.
what you are ultimately trying to achieve. It may be that there are
better approaches or even existing solutions or things which are already
close to your needs.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:01:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:01:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYDIl-0002JM-2V; Tue, 13 Nov 2012 10:01:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYDIj-0002J5-QZ
	for Xen-devel@lists.xensource.com; Tue, 13 Nov 2012 10:01:02 +0000
Received: from [85.158.143.35:54643] by server-1.bemta-4.messagelabs.com id
	3C/8A-27934-D5A12A05; Tue, 13 Nov 2012 10:01:01 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1352800859!17468198!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21844 invoked from network); 13 Nov 2012 10:00:59 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:00:59 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15771954"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:00:54 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:00:54 +0000
Message-ID: <1352800853.7491.22.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>
Date: Tue, 13 Nov 2012 10:00:53 +0000
In-Reply-To: <20121112190934.5e702799@mantra.us.oracle.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 03:09 +0000, Mukesh Rathor wrote:
> Hi,
> 
> I am wondering if there's libxl expert who can help me make some PVH
> related changes to libxl, pref in the US time zone. I could consult on
> irc or the phone.

I think most of the libxl experts are in European time zones. Probably
the best bet is to just ask your questions either here or on IRC.

>  I find the libxl code hard to read, and don't
> want to spend lot of time figuring it out if someone can just help
> quickly.

Can you elaborate on this? We'd like to improve things if we can.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:01:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:01:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYDIl-0002JM-2V; Tue, 13 Nov 2012 10:01:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYDIj-0002J5-QZ
	for Xen-devel@lists.xensource.com; Tue, 13 Nov 2012 10:01:02 +0000
Received: from [85.158.143.35:54643] by server-1.bemta-4.messagelabs.com id
	3C/8A-27934-D5A12A05; Tue, 13 Nov 2012 10:01:01 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1352800859!17468198!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21844 invoked from network); 13 Nov 2012 10:00:59 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:00:59 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15771954"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:00:54 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:00:54 +0000
Message-ID: <1352800853.7491.22.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>
Date: Tue, 13 Nov 2012 10:00:53 +0000
In-Reply-To: <20121112190934.5e702799@mantra.us.oracle.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 03:09 +0000, Mukesh Rathor wrote:
> Hi,
> 
> I am wondering if there's libxl expert who can help me make some PVH
> related changes to libxl, pref in the US time zone. I could consult on
> irc or the phone.

I think most of the libxl experts are in European time zones. Probably
the best bet is to just ask your questions either here or on IRC.

>  I find the libxl code hard to read, and don't
> want to spend lot of time figuring it out if someone can just help
> quickly.

Can you elaborate on this? We'd like to improve things if we can.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:02:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:02:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYDK4-0002SE-Hz; Tue, 13 Nov 2012 10:02:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYDK2-0002S1-QH
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:02:22 +0000
Received: from [85.158.139.211:17941] by server-15.bemta-5.messagelabs.com id
	B2/8E-26920-DAA12A05; Tue, 13 Nov 2012 10:02:21 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1352800940!20002740!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15391 invoked from network); 13 Nov 2012 10:02:20 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:02:20 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15772001"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:02:05 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:02:04 +0000
Message-ID: <1352800923.7491.23.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Qian Hu <qianhu2011@gmail.com>
Date: Tue, 13 Nov 2012 10:02:03 +0000
In-Reply-To: <CALCpXpDcvBLtXG=tUeHsF==7AiCGCsaUMoGd8DGtjax6d5wiaQ@mail.gmail.com>
References: <CALCpXpDcvBLtXG=tUeHsF==7AiCGCsaUMoGd8DGtjax6d5wiaQ@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the
 virtual machine created by xl command?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 06:30 +0000, Qian Hu wrote:

> With spice tool, I have to create a VM by xl command, and now I am
> wondering if it supports VGA passghrouth?

This list is for the development of Xen. You';d probably have more luck
with these sorts of support requests on the xen-users list.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:02:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:02:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYDK4-0002SE-Hz; Tue, 13 Nov 2012 10:02:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYDK2-0002S1-QH
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:02:22 +0000
Received: from [85.158.139.211:17941] by server-15.bemta-5.messagelabs.com id
	B2/8E-26920-DAA12A05; Tue, 13 Nov 2012 10:02:21 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1352800940!20002740!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15391 invoked from network); 13 Nov 2012 10:02:20 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:02:20 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15772001"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:02:05 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:02:04 +0000
Message-ID: <1352800923.7491.23.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Qian Hu <qianhu2011@gmail.com>
Date: Tue, 13 Nov 2012 10:02:03 +0000
In-Reply-To: <CALCpXpDcvBLtXG=tUeHsF==7AiCGCsaUMoGd8DGtjax6d5wiaQ@mail.gmail.com>
References: <CALCpXpDcvBLtXG=tUeHsF==7AiCGCsaUMoGd8DGtjax6d5wiaQ@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the
 virtual machine created by xl command?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 06:30 +0000, Qian Hu wrote:

> With spice tool, I have to create a VM by xl command, and now I am
> wondering if it supports VGA passghrouth?

This list is for the development of Xen. You';d probably have more luck
with these sorts of support requests on the xen-users list.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:10:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:10:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYDS5-0002nP-At; Tue, 13 Nov 2012 10:10:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TYDS3-0002nK-6r
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:10:39 +0000
Received: from [85.158.139.83:4583] by server-11.bemta-5.messagelabs.com id
	9B/C0-03409-E9C12A05; Tue, 13 Nov 2012 10:10:38 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1352801436!25736805!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31687 invoked from network); 13 Nov 2012 10:10:36 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:10:36 -0000
Received: by mail-wg0-f51.google.com with SMTP id ed3so3355491wgb.32
	for <xen-devel@lists.xen.org>; Tue, 13 Nov 2012 02:10:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=EvQWz52jXFo/fMnNfr7F4Nsq4OLsIjbDTY0fV9c0O2U=;
	b=EG74WBAUjT+66N1CDuKz4o6otIvsqThuOp7wUVMwihA8YjzByM01hWEWZmulyrIf8T
	ivy0EQ8sLdn3Ps6n3jxfnPwt1/VWqVe8kXZOBARZJYPQwr8V8VtIkbginDZT6kJhSgB6
	4fDyIZ7cPwOJDtGmhqwwqyRCNgm5+lcl41Rtn0sf5WMczVOlTCtZsyEmDGuWz5+50yLc
	+9hJEIUa8klX52H9AIt4y99B1PzJZTimtarq+AHDZTp/ogU3lPqk4AQXv9awFlDUg99m
	myW+LkrOHStyzEhaKd9774ZqfpHGAS24hIXgLBdtpoZZcStQ2nZMLMMOxgDZ3p952GcN
	Qc9g==
Received: by 10.216.218.9 with SMTP id j9mr28002wep.115.1352801436364;
	Tue, 13 Nov 2012 02:10:36 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id b1sm2277941wix.11.2012.11.13.02.10.34
	(version=SSLv3 cipher=OTHER); Tue, 13 Nov 2012 02:10:35 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Tue, 13 Nov 2012 10:10:31 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	Matthew Daley <mattjd@gmail.com>
Message-ID: <CCC7CD17.5206A%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] xen: Fix xenctl_cpumap_to_cpumask buffer
	size check
Thread-Index: Ac3Bhxy1iQeGYjnp+EG6ChoSWN+GzA==
In-Reply-To: <50A214B902000078000A7F88@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: Fix xenctl_cpumap_to_cpumask buffer
 size check
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 13/11/2012 08:36, "Jan Beulich" <JBeulich@suse.com> wrote:

>> Fix by using the correct cpumask buffer size in place of sizeof.
>> 
>> Signed-off-by: Matthew Daley <mattjd@gmail.com>
> 
> Acked-by: Jan Beulich <jbeulich@suse.com>
> 
> However, I would have preferred the adjustment to be ...
> 
>> diff --git a/xen/common/domctl.c b/xen/common/domctl.c
>> index e153cb4..204e951 100644
>> --- a/xen/common/domctl.c
>> +++ b/xen/common/domctl.c
>> @@ -78,7 +78,7 @@ int xenctl_cpumap_to_cpumask(
>>      {
>>          if ( copy_from_guest(bytemap, xenctl_cpumap->bitmap, copy_bytes) )
>>              err = -EFAULT;
>> -        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <=
>> sizeof(bytemap)) )
>> +        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <= (nr_cpu_ids +
>> 7) / 8) )
> 
>         if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <= copy_bytes) )
> 
> or even (considering that guest_bytes >= copy_bytes due to the
> way copy_bytes gets initialized)
> 
>         if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes == copy_bytes) )
> 
> to make explicit when exactly the masking is necessary.

Any of the three alternatives is fine by me.

Acked-by: Keir Fraser <keir@xen.org>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:10:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:10:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYDS5-0002nP-At; Tue, 13 Nov 2012 10:10:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TYDS3-0002nK-6r
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:10:39 +0000
Received: from [85.158.139.83:4583] by server-11.bemta-5.messagelabs.com id
	9B/C0-03409-E9C12A05; Tue, 13 Nov 2012 10:10:38 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1352801436!25736805!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31687 invoked from network); 13 Nov 2012 10:10:36 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:10:36 -0000
Received: by mail-wg0-f51.google.com with SMTP id ed3so3355491wgb.32
	for <xen-devel@lists.xen.org>; Tue, 13 Nov 2012 02:10:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=EvQWz52jXFo/fMnNfr7F4Nsq4OLsIjbDTY0fV9c0O2U=;
	b=EG74WBAUjT+66N1CDuKz4o6otIvsqThuOp7wUVMwihA8YjzByM01hWEWZmulyrIf8T
	ivy0EQ8sLdn3Ps6n3jxfnPwt1/VWqVe8kXZOBARZJYPQwr8V8VtIkbginDZT6kJhSgB6
	4fDyIZ7cPwOJDtGmhqwwqyRCNgm5+lcl41Rtn0sf5WMczVOlTCtZsyEmDGuWz5+50yLc
	+9hJEIUa8klX52H9AIt4y99B1PzJZTimtarq+AHDZTp/ogU3lPqk4AQXv9awFlDUg99m
	myW+LkrOHStyzEhaKd9774ZqfpHGAS24hIXgLBdtpoZZcStQ2nZMLMMOxgDZ3p952GcN
	Qc9g==
Received: by 10.216.218.9 with SMTP id j9mr28002wep.115.1352801436364;
	Tue, 13 Nov 2012 02:10:36 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id b1sm2277941wix.11.2012.11.13.02.10.34
	(version=SSLv3 cipher=OTHER); Tue, 13 Nov 2012 02:10:35 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Tue, 13 Nov 2012 10:10:31 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	Matthew Daley <mattjd@gmail.com>
Message-ID: <CCC7CD17.5206A%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] xen: Fix xenctl_cpumap_to_cpumask buffer
	size check
Thread-Index: Ac3Bhxy1iQeGYjnp+EG6ChoSWN+GzA==
In-Reply-To: <50A214B902000078000A7F88@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: Fix xenctl_cpumap_to_cpumask buffer
 size check
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 13/11/2012 08:36, "Jan Beulich" <JBeulich@suse.com> wrote:

>> Fix by using the correct cpumask buffer size in place of sizeof.
>> 
>> Signed-off-by: Matthew Daley <mattjd@gmail.com>
> 
> Acked-by: Jan Beulich <jbeulich@suse.com>
> 
> However, I would have preferred the adjustment to be ...
> 
>> diff --git a/xen/common/domctl.c b/xen/common/domctl.c
>> index e153cb4..204e951 100644
>> --- a/xen/common/domctl.c
>> +++ b/xen/common/domctl.c
>> @@ -78,7 +78,7 @@ int xenctl_cpumap_to_cpumask(
>>      {
>>          if ( copy_from_guest(bytemap, xenctl_cpumap->bitmap, copy_bytes) )
>>              err = -EFAULT;
>> -        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <=
>> sizeof(bytemap)) )
>> +        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <= (nr_cpu_ids +
>> 7) / 8) )
> 
>         if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <= copy_bytes) )
> 
> or even (considering that guest_bytes >= copy_bytes due to the
> way copy_bytes gets initialized)
> 
>         if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes == copy_bytes) )
> 
> to make explicit when exactly the masking is necessary.

Any of the three alternatives is fine by me.

Acked-by: Keir Fraser <keir@xen.org>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:14:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:14:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYDVg-0002yY-VU; Tue, 13 Nov 2012 10:14:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYDVf-0002yQ-Q2
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:14:23 +0000
Received: from [85.158.143.99:20641] by server-2.bemta-4.messagelabs.com id
	3A/03-28922-F7D12A05; Tue, 13 Nov 2012 10:14:23 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352801662!29154009!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10975 invoked from network); 13 Nov 2012 10:14:22 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-216.messagelabs.com with SMTP;
	13 Nov 2012 10:14:22 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 10:14:22 +0000
Message-Id: <50A22B8C02000078000A800F@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 10:14:20 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <mrsanna1@gmail.com>,<Philippe.Simonet@swisscom.com>
References: <1352294551.12977.61.camel@hastur.hellion.org.uk>
	<CCC04D8E.51A0E%keir@xen.org>
	<509B8BF802000078000A72A3@nat28.tlf.novell.com>
	<FF93AF260AC2BB499A119CC65B092CF73151843F@sg000713.corproot.net>
	<1352384968.12977.104.camel@hastur.hellion.org.uk>
	<FF93AF260AC2BB499A119CC65B092CF73151901D@sg000713.corproot.net>
In-Reply-To: <FF93AF260AC2BB499A119CC65B092CF73151901D@sg000713.corproot.net>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartEBDA146C.3__="
Cc: keir@xen.org, 599161@bugs.debian.org, xen-devel@lists.xen.org,
	ijc@hellion.org.uk
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartEBDA146C.3__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

>>> On 09.11.12 at 10:05, <Philippe.Simonet@swisscom.com> wrote:

Since it looks like this got stalled again, attached is a slightly
extended version of Keir's debugging patch, allowing to rule out
any inconsistencies of the globals between the first and second
instances of the two invocations of __read_platform_stime().

Should the numbers printed turn out identical between the two
invocations and identical to the boot time determined values, then
I'm afraid I'm out of explanations as well as debugging suggestions.

Please remember to add "loglvl=3Dall" to the hypervisor command
line.

The patch is against a 4.0.3 based tree I had still lying around, so
I hope it'll apply cleanly to your 4.0.1 based one.

Jan


--=__PartEBDA146C.3__=
Content-Type: application/octet-stream; name="00-tsc-debug"
Content-Transfer-Encoding: base64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cHM9IiwgJnBzLCAiLyIpOworICAgICAgICBwcmludF90aW1lX3NjYWxl
KCIiLCAmcGx0X3NjYWxlLCAiXG4iKTsKKworICAgICAgICBicmVhazsKICAgICAgICAgcGx0X3N0
YW1wNjQgKz0gcGx0X21hc2sgKyAxOwogICAgIH0KICAgICBpZiAoIGkgIT0gMCApCkBAIC02OTQs
NiArNzE2LDcgQEAgc3RhdGljIHZvaWQgX19pbml0IGluaXRfcGxhdGZvcm1fdGltZXIodgogICAg
IHBsdF9tYXNrID0gKHU2NCl+MHVsbCA+PiAoNjQgLSBwdHMtPmNvdW50ZXJfYml0cyk7CiAKICAg
ICBzZXRfdGltZV9zY2FsZSgmcGx0X3NjYWxlLCBwdHMtPmZyZXF1ZW5jeSk7CisgICAgcHJpbnRf
dGltZV9zY2FsZSgicGx0X3NjYWxlPSIsICZwbHRfc2NhbGUsICJcbiIpOwogCiAgICAgcGx0X292
ZXJmbG93X3BlcmlvZCA9IHNjYWxlX2RlbHRhKAogICAgICAgICAxdWxsIDw8IChwdHMtPmNvdW50
ZXJfYml0cy0xKSwgJnBsdF9zY2FsZSk7Cg==

--=__PartEBDA146C.3__=
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.xen.org
http://lists.xen.org/xen-devel

--=__PartEBDA146C.3__=--


From xen-devel-bounces@lists.xen.org Tue Nov 13 10:14:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:14:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYDVg-0002yY-VU; Tue, 13 Nov 2012 10:14:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYDVf-0002yQ-Q2
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:14:23 +0000
Received: from [85.158.143.99:20641] by server-2.bemta-4.messagelabs.com id
	3A/03-28922-F7D12A05; Tue, 13 Nov 2012 10:14:23 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352801662!29154009!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10975 invoked from network); 13 Nov 2012 10:14:22 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-216.messagelabs.com with SMTP;
	13 Nov 2012 10:14:22 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 10:14:22 +0000
Message-Id: <50A22B8C02000078000A800F@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 10:14:20 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <mrsanna1@gmail.com>,<Philippe.Simonet@swisscom.com>
References: <1352294551.12977.61.camel@hastur.hellion.org.uk>
	<CCC04D8E.51A0E%keir@xen.org>
	<509B8BF802000078000A72A3@nat28.tlf.novell.com>
	<FF93AF260AC2BB499A119CC65B092CF73151843F@sg000713.corproot.net>
	<1352384968.12977.104.camel@hastur.hellion.org.uk>
	<FF93AF260AC2BB499A119CC65B092CF73151901D@sg000713.corproot.net>
In-Reply-To: <FF93AF260AC2BB499A119CC65B092CF73151901D@sg000713.corproot.net>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartEBDA146C.3__="
Cc: keir@xen.org, 599161@bugs.debian.org, xen-devel@lists.xen.org,
	ijc@hellion.org.uk
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartEBDA146C.3__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

>>> On 09.11.12 at 10:05, <Philippe.Simonet@swisscom.com> wrote:

Since it looks like this got stalled again, attached is a slightly
extended version of Keir's debugging patch, allowing to rule out
any inconsistencies of the globals between the first and second
instances of the two invocations of __read_platform_stime().

Should the numbers printed turn out identical between the two
invocations and identical to the boot time determined values, then
I'm afraid I'm out of explanations as well as debugging suggestions.

Please remember to add "loglvl=3Dall" to the hypervisor command
line.

The patch is against a 4.0.3 based tree I had still lying around, so
I hope it'll apply cleanly to your 4.0.1 based one.

Jan


--=__PartEBDA146C.3__=
Content-Type: application/octet-stream; name="00-tsc-debug"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="00-tsc-debug"

LS0tIGEveGVuL2FyY2gveDg2L3RpbWUuYworKysgYi94ZW4vYXJjaC94ODYvdGltZS5jCkBAIC01
NzgsMTQgKzU3OCwyMyBAQCBzdGF0aWMgc190aW1lX3QgX19yZWFkX3BsYXRmb3JtX3N0aW1lKHU2
CiAgICAgcmV0dXJuIChzdGltZV9wbGF0Zm9ybV9zdGFtcCArIHNjYWxlX2RlbHRhKGRpZmYsICZw
bHRfc2Nhb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m93KSApCiAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgcmR0
c2NsbCh0c2MpOworICAgICAgICBwcmludGsoIlhYWCBwbHRfb3ZlcmZsb3c6IHBsdF9ub3c9JSJQ
Ukl4NjQiIHBsdF93cmFwPSUiUFJJeDY0CisgICAgICAgICAgICAgICAiIG5vdz0lIlBSSXg2NCIg
b2xkX3N0YW1wPSUiUFJJeDY0IiBuZXdfc3RhbXA9JSJQUkl4NjQKKyAgICAgICAgICAgICAgICIg
cGx0X3N0YW1wNjQ9JSJQUkl4NjQiIHBsdF9tYXNrPSUiUFJJeDY0CisgICAgICAgICAgICAgICAi
IHRzYz0lIlBSSXg2NCIgdHNjX3N0YW1wPSUiUFJJeDY0IlxuIiwKKyAgICAgICAgICAgICAgIHBs
dF9ub3csIHBsdF93cmFwLCBub3csIG9sZF9zdGFtcCwgcGx0X3N0YW1wLCBwbHRfc3RhbXA2NCwK
KyAgICAgICAgICAgICAgIHBsdF9tYXNrLCB0c2MsIHRoaXNfY3B1KGNwdV90aW1lKS5sb2NhbF90
c2Nfc3RhbXApOworICAgICAgICBwcmludGsoIlhYWCBwdHM9JSJQUkl4NjQiLyUiUFJJeDY0IiBz
cHM9JSJQUkl4NjQiLyUiUFJJeDY0IlxuIiwKKyAgICAgICAgICAgICAgIHB0cywgcGxhdGZvcm1f
dGltZXJfc3RhbXAsIHNwcywgc3RpbWVfcGxhdGZvcm1fc3RhbXApOworICAgICAgICBwcmludF90
aW1lX3NjYWxlKCJYWFggcHM9IiwgJnBzLCAiLyIpOworICAgICAgICBwcmludF90aW1lX3NjYWxl
KCIiLCAmcGx0X3NjYWxlLCAiXG4iKTsKKworICAgICAgICBicmVhazsKICAgICAgICAgcGx0X3N0
YW1wNjQgKz0gcGx0X21hc2sgKyAxOwogICAgIH0KICAgICBpZiAoIGkgIT0gMCApCkBAIC02OTQs
NiArNzE2LDcgQEAgc3RhdGljIHZvaWQgX19pbml0IGluaXRfcGxhdGZvcm1fdGltZXIodgogICAg
IHBsdF9tYXNrID0gKHU2NCl+MHVsbCA+PiAoNjQgLSBwdHMtPmNvdW50ZXJfYml0cyk7CiAKICAg
ICBzZXRfdGltZV9zY2FsZSgmcGx0X3NjYWxlLCBwdHMtPmZyZXF1ZW5jeSk7CisgICAgcHJpbnRf
dGltZV9zY2FsZSgicGx0X3NjYWxlPSIsICZwbHRfc2NhbGUsICJcbiIpOwogCiAgICAgcGx0X292
ZXJmbG93X3BlcmlvZCA9IHNjYWxlX2RlbHRhKAogICAgICAgICAxdWxsIDw8IChwdHMtPmNvdW50
ZXJfYml0cy0xKSwgJnBsdF9zY2FsZSk7Cg==

--=__PartEBDA146C.3__=
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.xen.org
http://lists.xen.org/xen-devel

--=__PartEBDA146C.3__=--


From xen-devel-bounces@lists.xen.org Tue Nov 13 10:18:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:18:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYDZ5-0003Dw-AA; Tue, 13 Nov 2012 10:17:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mattjd@gmail.com>) id 1TYDZ3-0003Do-8e
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:17:53 +0000
Received: from [85.158.143.35:42846] by server-2.bemta-4.messagelabs.com id
	58/49-28922-05E12A05; Tue, 13 Nov 2012 10:17:52 +0000
X-Env-Sender: mattjd@gmail.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1352801851!15027073!1
X-Originating-IP: [209.85.160.45]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1599 invoked from network); 13 Nov 2012 10:17:33 -0000
Received: from mail-pb0-f45.google.com (HELO mail-pb0-f45.google.com)
	(209.85.160.45)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:17:33 -0000
Received: by mail-pb0-f45.google.com with SMTP id mc8so2412587pbc.32
	for <xen-devel@lists.xen.org>; Tue, 13 Nov 2012 02:17:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
	bh=0LlNbFIjtKW00BHdHSjTYQ9OC4ugOXHd1Dhv5mUnYxs=;
	b=XqIjlQ80lS5/kMsFm0FRkDlN8ZHB9lHIhCmKEMb+EKnI+HEDrmMOvOqBFne0TsZ+h5
	NvoD0ba2HJVfyRbHzjvYDGhFwgXBnzI4SHmfLzqdtzk8XRL46Vt6eRI4Ub9lDZ7Zu3Hw
	ocq0nk5wu+YN+mXUtvM2QLADOQ+Uh96a0a/odtQyj6E9u6AhLb0MOOi9dlFRoFPMKsWc
	uGDXzs532zjomvZAH0uXvc+m9rKVmF32BD5MXWf+N1s8mbhIB39Ju3y545s7z+aOu9bb
	IR6OQ3oXW0CDzbeFeq2LW9h5VgfO2/5xzeEE5AZb+q0BedJt2wlfyYsEzwqLZjB0XLBt
	qUKg==
Received: by 10.69.1.8 with SMTP id bc8mr67202047pbd.9.1352801851328;
	Tue, 13 Nov 2012 02:17:31 -0800 (PST)
Received: from morphism.xen.prgmr.com (morphism.xen.prgmr.com. [71.19.145.114])
	by mx.google.com with ESMTPS id kb3sm5765042pbc.27.2012.11.13.02.17.29
	(version=TLSv1/SSLv3 cipher=OTHER);
	Tue, 13 Nov 2012 02:17:30 -0800 (PST)
From: Matthew Daley <mattjd@gmail.com>
To: JBeulich@suse.com
Date: Tue, 13 Nov 2012 23:17:46 +1300
Message-Id: <1352801866-9512-1-git-send-email-mattjd@gmail.com>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <50A214B902000078000A7F88@nat28.tlf.novell.com>
References: <50A214B902000078000A7F88@nat28.tlf.novell.com>
Cc: Matthew Daley <mattjd@gmail.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] xen: Fix xenctl_cpumap_to_cpumask buffer size
	check
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

xenctl_cpumap_to_cpumask incorrectly uses sizeof when checking whether
bits should be masked off from the input cpumap bitmap or not.

Fix and make clearer by simply comparing the amount of bytes given in
the input cpumap to the amount actually copied; if equal, bits may need
to be masked off.

This does not have security impact: _xmalloc never returns allocations
smaller than the size of a pointer, hence the uncorrected buffer size
check would still not allow writes to unallocated memory.

Signed-off-by: Matthew Daley <mattjd@gmail.com>
---
Jan: Agreed with both of your points. Here's a v2.

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index e153cb4..a7a6b9f 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -78,7 +78,7 @@ int xenctl_cpumap_to_cpumask(
     {
         if ( copy_from_guest(bytemap, xenctl_cpumap->bitmap, copy_bytes) )
             err = -EFAULT;
-        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <= sizeof(bytemap)) )
+        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes == copy_bytes) )
             bytemap[guest_bytes-1] &= ~(0xff << (xenctl_cpumap->nr_cpus & 7));
     }
 
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:18:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:18:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYDZ5-0003Dw-AA; Tue, 13 Nov 2012 10:17:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mattjd@gmail.com>) id 1TYDZ3-0003Do-8e
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:17:53 +0000
Received: from [85.158.143.35:42846] by server-2.bemta-4.messagelabs.com id
	58/49-28922-05E12A05; Tue, 13 Nov 2012 10:17:52 +0000
X-Env-Sender: mattjd@gmail.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1352801851!15027073!1
X-Originating-IP: [209.85.160.45]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1599 invoked from network); 13 Nov 2012 10:17:33 -0000
Received: from mail-pb0-f45.google.com (HELO mail-pb0-f45.google.com)
	(209.85.160.45)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:17:33 -0000
Received: by mail-pb0-f45.google.com with SMTP id mc8so2412587pbc.32
	for <xen-devel@lists.xen.org>; Tue, 13 Nov 2012 02:17:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
	bh=0LlNbFIjtKW00BHdHSjTYQ9OC4ugOXHd1Dhv5mUnYxs=;
	b=XqIjlQ80lS5/kMsFm0FRkDlN8ZHB9lHIhCmKEMb+EKnI+HEDrmMOvOqBFne0TsZ+h5
	NvoD0ba2HJVfyRbHzjvYDGhFwgXBnzI4SHmfLzqdtzk8XRL46Vt6eRI4Ub9lDZ7Zu3Hw
	ocq0nk5wu+YN+mXUtvM2QLADOQ+Uh96a0a/odtQyj6E9u6AhLb0MOOi9dlFRoFPMKsWc
	uGDXzs532zjomvZAH0uXvc+m9rKVmF32BD5MXWf+N1s8mbhIB39Ju3y545s7z+aOu9bb
	IR6OQ3oXW0CDzbeFeq2LW9h5VgfO2/5xzeEE5AZb+q0BedJt2wlfyYsEzwqLZjB0XLBt
	qUKg==
Received: by 10.69.1.8 with SMTP id bc8mr67202047pbd.9.1352801851328;
	Tue, 13 Nov 2012 02:17:31 -0800 (PST)
Received: from morphism.xen.prgmr.com (morphism.xen.prgmr.com. [71.19.145.114])
	by mx.google.com with ESMTPS id kb3sm5765042pbc.27.2012.11.13.02.17.29
	(version=TLSv1/SSLv3 cipher=OTHER);
	Tue, 13 Nov 2012 02:17:30 -0800 (PST)
From: Matthew Daley <mattjd@gmail.com>
To: JBeulich@suse.com
Date: Tue, 13 Nov 2012 23:17:46 +1300
Message-Id: <1352801866-9512-1-git-send-email-mattjd@gmail.com>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <50A214B902000078000A7F88@nat28.tlf.novell.com>
References: <50A214B902000078000A7F88@nat28.tlf.novell.com>
Cc: Matthew Daley <mattjd@gmail.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] xen: Fix xenctl_cpumap_to_cpumask buffer size
	check
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

xenctl_cpumap_to_cpumask incorrectly uses sizeof when checking whether
bits should be masked off from the input cpumap bitmap or not.

Fix and make clearer by simply comparing the amount of bytes given in
the input cpumap to the amount actually copied; if equal, bits may need
to be masked off.

This does not have security impact: _xmalloc never returns allocations
smaller than the size of a pointer, hence the uncorrected buffer size
check would still not allow writes to unallocated memory.

Signed-off-by: Matthew Daley <mattjd@gmail.com>
---
Jan: Agreed with both of your points. Here's a v2.

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index e153cb4..a7a6b9f 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -78,7 +78,7 @@ int xenctl_cpumap_to_cpumask(
     {
         if ( copy_from_guest(bytemap, xenctl_cpumap->bitmap, copy_bytes) )
             err = -EFAULT;
-        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <= sizeof(bytemap)) )
+        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes == copy_bytes) )
             bytemap[guest_bytes-1] &= ~(0xff << (xenctl_cpumap->nr_cpus & 7));
     }
 
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:26:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:26:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYDh4-0003cn-D5; Tue, 13 Nov 2012 10:26:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TYDh3-0003cg-0o
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:26:09 +0000
Received: from [85.158.137.99:47866] by server-9.bemta-3.messagelabs.com id
	72/24-02388-04022A05; Tue, 13 Nov 2012 10:26:08 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1352802367!18888555!1
X-Originating-IP: [91.199.104.2]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_14,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19169 invoked from network); 13 Nov 2012 10:26:07 -0000
Received: from mail.bitdefender.com (HELO mail.bitdefender.com) (91.199.104.2)
	by server-4.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 10:26:07 -0000
Received: (qmail 26740 invoked from network); 13 Nov 2012 12:26:06 +0200
Received: from rcojocaru.dsd.ro (HELO ?10.10.14.59?)
	(rcojocaru@bitdefender.com@10.10.14.59)
	by mail.bitdefender.com with AES256-SHA encrypted SMTP;
	13 Nov 2012 12:26:06 +0200
Message-ID: <50A22044.6060608@gmail.com>
Date: Tue, 13 Nov 2012 12:26:12 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <50A16639.2090209@gmail.com>
	<1352800791.7491.21.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352800791.7491.21.camel@zakaz.uk.xensource.com>
X-BitDefender-Spam: No (0)
X-BitDefender-SpamStamp: Build: [Engines: 2.13.3.14894, Dats: 226271,
	Stamp: 3], Multi: [Enabled], BW: [Enabled], RBL DNSBL: [Disabled],
	APM: [Enabled, Score: 500, Flags: NN_GMAIL_WITH_XMAILER_ADN;
	NN_LEGIT_VALID_REPLY; NN_NO_LINK_NMD;
	NN_EXEC_H_YAHOO_AND_GMAIL_NO_DOMAIN_KEY; NN_LEGIT_S_SQARE_BRACKETS;
	NN_LEGIT_MAILING_LIST_TO], SGN: [Enabled], URL: [Enabled], URI DNSBL:
	[Disabled], SQMD: [Enabled, Hits: none, MD5:
	e8437b1472d26965707b26009c3d5b7d.fuzzy.fzrbl.org], RTDA: [Disabled,
	Hit: No], total: 0(775)
X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.0 on
	elfie.dsd.hq, sigver: 7.43988
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> I think I'd look at the ioreq stuff in preference to the trace stuff.
> You probably want to use a normal evtchn rather than VIRQ. The code
> which handles HVM_PARAM_BUFIOREQ_PFN and HVM_PARAM_BUFIOREQ_EVTCHN
> should give a reasonable starting point (I think, I'm not actually the
> familiar with this bit of Xen).

Thanks, I'll look that up.

> It might also be useful if you describe your actual end-goal -- i.e.
> what you are ultimately trying to achieve. It may be that there are
> better approaches or even existing solutions or things which are already
> close to your needs.

OK, my immediate end-goal is real-time logging of hypervisor events via 
a dom0 userspace application. These events are always about a currently 
running virtual machine, and said virtual machine is paused at the time.
The userspace tool should be immediately notified, so no polling.

Ideally, in the future, based on information received from the 
hypervisor, the dom0 application would control other virtual machines 
(restart them, shut them down, and so on). This, I'm thinking, could 
either be done by replying to the hypervisor itself via the 
communication channel and do some work there, or, since the application 
is in dom0, do this via libxl or some other available userspace tool. 
However, the paused virtual machine should not be allowed to resume 
unless the userspace application replies that it is OK to resume.

Hope that made sense,
Razvan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:26:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:26:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYDh4-0003cn-D5; Tue, 13 Nov 2012 10:26:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TYDh3-0003cg-0o
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:26:09 +0000
Received: from [85.158.137.99:47866] by server-9.bemta-3.messagelabs.com id
	72/24-02388-04022A05; Tue, 13 Nov 2012 10:26:08 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1352802367!18888555!1
X-Originating-IP: [91.199.104.2]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_14,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19169 invoked from network); 13 Nov 2012 10:26:07 -0000
Received: from mail.bitdefender.com (HELO mail.bitdefender.com) (91.199.104.2)
	by server-4.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 10:26:07 -0000
Received: (qmail 26740 invoked from network); 13 Nov 2012 12:26:06 +0200
Received: from rcojocaru.dsd.ro (HELO ?10.10.14.59?)
	(rcojocaru@bitdefender.com@10.10.14.59)
	by mail.bitdefender.com with AES256-SHA encrypted SMTP;
	13 Nov 2012 12:26:06 +0200
Message-ID: <50A22044.6060608@gmail.com>
Date: Tue, 13 Nov 2012 12:26:12 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <50A16639.2090209@gmail.com>
	<1352800791.7491.21.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352800791.7491.21.camel@zakaz.uk.xensource.com>
X-BitDefender-Spam: No (0)
X-BitDefender-SpamStamp: Build: [Engines: 2.13.3.14894, Dats: 226271,
	Stamp: 3], Multi: [Enabled], BW: [Enabled], RBL DNSBL: [Disabled],
	APM: [Enabled, Score: 500, Flags: NN_GMAIL_WITH_XMAILER_ADN;
	NN_LEGIT_VALID_REPLY; NN_NO_LINK_NMD;
	NN_EXEC_H_YAHOO_AND_GMAIL_NO_DOMAIN_KEY; NN_LEGIT_S_SQARE_BRACKETS;
	NN_LEGIT_MAILING_LIST_TO], SGN: [Enabled], URL: [Enabled], URI DNSBL:
	[Disabled], SQMD: [Enabled, Hits: none, MD5:
	e8437b1472d26965707b26009c3d5b7d.fuzzy.fzrbl.org], RTDA: [Disabled,
	Hit: No], total: 0(775)
X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.0 on
	elfie.dsd.hq, sigver: 7.43988
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> I think I'd look at the ioreq stuff in preference to the trace stuff.
> You probably want to use a normal evtchn rather than VIRQ. The code
> which handles HVM_PARAM_BUFIOREQ_PFN and HVM_PARAM_BUFIOREQ_EVTCHN
> should give a reasonable starting point (I think, I'm not actually the
> familiar with this bit of Xen).

Thanks, I'll look that up.

> It might also be useful if you describe your actual end-goal -- i.e.
> what you are ultimately trying to achieve. It may be that there are
> better approaches or even existing solutions or things which are already
> close to your needs.

OK, my immediate end-goal is real-time logging of hypervisor events via 
a dom0 userspace application. These events are always about a currently 
running virtual machine, and said virtual machine is paused at the time.
The userspace tool should be immediately notified, so no polling.

Ideally, in the future, based on information received from the 
hypervisor, the dom0 application would control other virtual machines 
(restart them, shut them down, and so on). This, I'm thinking, could 
either be done by replying to the hypervisor itself via the 
communication channel and do some work there, or, since the application 
is in dom0, do this via libxl or some other available userspace tool. 
However, the paused virtual machine should not be allowed to resume 
unless the userspace application replies that it is OK to resume.

Hope that made sense,
Razvan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:36:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:36:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYDr8-0003uZ-Mk; Tue, 13 Nov 2012 10:36:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYDr6-0003uU-Ph
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:36:32 +0000
Received: from [85.158.143.35:30918] by server-1.bemta-4.messagelabs.com id
	A8/A2-27934-0B222A05; Tue, 13 Nov 2012 10:36:32 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1352802974!12029620!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20196 invoked from network); 13 Nov 2012 10:36:16 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:36:16 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15773108"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:36:14 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:36:14 +0000
Message-ID: <1352802973.7491.40.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Razvan Cojocaru <rzvncj@gmail.com>
Date: Tue, 13 Nov 2012 10:36:13 +0000
In-Reply-To: <50A22044.6060608@gmail.com>
References: <50A16639.2090209@gmail.com>
	<1352800791.7491.21.camel@zakaz.uk.xensource.com>
	<50A22044.6060608@gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 10:26 +0000, Razvan Cojocaru wrote:
> > I think I'd look at the ioreq stuff in preference to the trace stuff.
> > You probably want to use a normal evtchn rather than VIRQ. The code
> > which handles HVM_PARAM_BUFIOREQ_PFN and HVM_PARAM_BUFIOREQ_EVTCHN
> > should give a reasonable starting point (I think, I'm not actually the
> > familiar with this bit of Xen).
> 
> Thanks, I'll look that up.
> 
> > It might also be useful if you describe your actual end-goal -- i.e.
> > what you are ultimately trying to achieve. It may be that there are
> > better approaches or even existing solutions or things which are already
> > close to your needs.
> 
> OK, my immediate end-goal is real-time logging of hypervisor events via 
> a dom0 userspace application. These events are always about a currently 
> running virtual machine, and said virtual machine is paused at the time.
> The userspace tool should be immediately notified, so no polling.

This is very like the ioreq model, where the domain (or maybe just the
vcpu, I'm not sure) is paused while qemu does its thing.

What sort of events are we talking about here? 

> Ideally, in the future, based on information received from the 
> hypervisor, the dom0 application would control other virtual machines 
> (restart them, shut them down, and so on). This, I'm thinking, could 
> either be done by replying to the hypervisor itself via the 
> communication channel and do some work there, or, since the application 
> is in dom0, do this via libxl or some other available userspace tool. 

The right thing to do here is for the userspace tool to communicate with
the toolstack (by whatever means) rather the hypervisor in order to
control the domains.

> However, the paused virtual machine should not be allowed to resume 
> unless the userspace application replies that it is OK to resume.

You might also find some inspiration for this sort of model in the
xenpaging and memshare code.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:36:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:36:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYDr8-0003uZ-Mk; Tue, 13 Nov 2012 10:36:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYDr6-0003uU-Ph
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:36:32 +0000
Received: from [85.158.143.35:30918] by server-1.bemta-4.messagelabs.com id
	A8/A2-27934-0B222A05; Tue, 13 Nov 2012 10:36:32 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1352802974!12029620!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20196 invoked from network); 13 Nov 2012 10:36:16 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:36:16 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15773108"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:36:14 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:36:14 +0000
Message-ID: <1352802973.7491.40.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Razvan Cojocaru <rzvncj@gmail.com>
Date: Tue, 13 Nov 2012 10:36:13 +0000
In-Reply-To: <50A22044.6060608@gmail.com>
References: <50A16639.2090209@gmail.com>
	<1352800791.7491.21.camel@zakaz.uk.xensource.com>
	<50A22044.6060608@gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 10:26 +0000, Razvan Cojocaru wrote:
> > I think I'd look at the ioreq stuff in preference to the trace stuff.
> > You probably want to use a normal evtchn rather than VIRQ. The code
> > which handles HVM_PARAM_BUFIOREQ_PFN and HVM_PARAM_BUFIOREQ_EVTCHN
> > should give a reasonable starting point (I think, I'm not actually the
> > familiar with this bit of Xen).
> 
> Thanks, I'll look that up.
> 
> > It might also be useful if you describe your actual end-goal -- i.e.
> > what you are ultimately trying to achieve. It may be that there are
> > better approaches or even existing solutions or things which are already
> > close to your needs.
> 
> OK, my immediate end-goal is real-time logging of hypervisor events via 
> a dom0 userspace application. These events are always about a currently 
> running virtual machine, and said virtual machine is paused at the time.
> The userspace tool should be immediately notified, so no polling.

This is very like the ioreq model, where the domain (or maybe just the
vcpu, I'm not sure) is paused while qemu does its thing.

What sort of events are we talking about here? 

> Ideally, in the future, based on information received from the 
> hypervisor, the dom0 application would control other virtual machines 
> (restart them, shut them down, and so on). This, I'm thinking, could 
> either be done by replying to the hypervisor itself via the 
> communication channel and do some work there, or, since the application 
> is in dom0, do this via libxl or some other available userspace tool. 

The right thing to do here is for the userspace tool to communicate with
the toolstack (by whatever means) rather the hypervisor in order to
control the domains.

> However, the paused virtual machine should not be allowed to resume 
> unless the userspace application replies that it is OK to resume.

You might also find some inspiration for this sort of model in the
xenpaging and memshare code.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:47:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:47:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYE1e-0004C3-0W; Tue, 13 Nov 2012 10:47:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYE1c-0004By-2q
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:47:24 +0000
Received: from [85.158.139.83:14586] by server-1.bemta-5.messagelabs.com id
	95/66-05877-B3522A05; Tue, 13 Nov 2012 10:47:23 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1352803642!27672788!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13792 invoked from network); 13 Nov 2012 10:47:22 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-10.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:47:22 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15773532"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:47:18 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:47:17 +0000
Message-ID: <1352803636.7491.43.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Tue, 13 Nov 2012 10:47:16 +0000
In-Reply-To: <20121106151315.GK5802@type.bordeaux.inria.fr>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121106151315.GK5802@type.bordeaux.inria.fr>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 1/9] Disable -DGNT_DEBUG and
	-DGNTMAP_DEBUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVHVlLCAyMDEyLTExLTA2IGF0IDE1OjEzICswMDAwLCBTYW11ZWwgVGhpYmF1bHQgd3JvdGU6
Cj4gTWF0dGhldyBGaW9yYXZhbnRlLCBsZSBUaHUgMDEgTm92IDIwMTIgMTY6MzM6MjQgLTA0MDAs
IGEgw6ljcml0IDoKPiA+IERpc2FibGluZyB0aGUgYWJvdmUgZmxhZ3MgaW4gZGVmYXVsdCBtaW5p
LW9zIGJ1aWxkLiBUaGV5IGdlbmVyYXRlIGEKPiA+IGxvdCBvZiBzcGFtLgo+ID4gCj4gPiBTaWdu
ZWQtb2ZmLWJ5OiBNYXR0aGV3IEZpb3JhdmFudGUgPG1hdHRoZXcuZmlvcmF2YW50ZUBqaHVhcGwu
ZWR1Pgo+IAo+IEFja2VkLWJ5OiBTYW11ZWwgVGhpYmF1bHQgPHNhbXVlbC50aGliYXVsdEBlbnMt
bHlvbi5vcmc+CgpBcHBsaWVkLCB0aGFua3MuCgoKCl9fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxp
c3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:47:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:47:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYE1e-0004C3-0W; Tue, 13 Nov 2012 10:47:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYE1c-0004By-2q
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:47:24 +0000
Received: from [85.158.139.83:14586] by server-1.bemta-5.messagelabs.com id
	95/66-05877-B3522A05; Tue, 13 Nov 2012 10:47:23 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1352803642!27672788!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13792 invoked from network); 13 Nov 2012 10:47:22 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-10.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:47:22 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15773532"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:47:18 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:47:17 +0000
Message-ID: <1352803636.7491.43.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Tue, 13 Nov 2012 10:47:16 +0000
In-Reply-To: <20121106151315.GK5802@type.bordeaux.inria.fr>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121106151315.GK5802@type.bordeaux.inria.fr>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 1/9] Disable -DGNT_DEBUG and
	-DGNTMAP_DEBUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVHVlLCAyMDEyLTExLTA2IGF0IDE1OjEzICswMDAwLCBTYW11ZWwgVGhpYmF1bHQgd3JvdGU6
Cj4gTWF0dGhldyBGaW9yYXZhbnRlLCBsZSBUaHUgMDEgTm92IDIwMTIgMTY6MzM6MjQgLTA0MDAs
IGEgw6ljcml0IDoKPiA+IERpc2FibGluZyB0aGUgYWJvdmUgZmxhZ3MgaW4gZGVmYXVsdCBtaW5p
LW9zIGJ1aWxkLiBUaGV5IGdlbmVyYXRlIGEKPiA+IGxvdCBvZiBzcGFtLgo+ID4gCj4gPiBTaWdu
ZWQtb2ZmLWJ5OiBNYXR0aGV3IEZpb3JhdmFudGUgPG1hdHRoZXcuZmlvcmF2YW50ZUBqaHVhcGwu
ZWR1Pgo+IAo+IEFja2VkLWJ5OiBTYW11ZWwgVGhpYmF1bHQgPHNhbXVlbC50aGliYXVsdEBlbnMt
bHlvbi5vcmc+CgpBcHBsaWVkLCB0aGFua3MuCgoKCl9fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxp
c3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:48:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:48:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYE2m-0004Fz-FR; Tue, 13 Nov 2012 10:48:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYE2l-0004Fo-5j
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:48:35 +0000
Received: from [85.158.143.99:35588] by server-1.bemta-4.messagelabs.com id
	19/1A-27934-28522A05; Tue, 13 Nov 2012 10:48:34 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1352803713!28808747!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9100 invoked from network); 13 Nov 2012 10:48:34 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:48:34 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15773575"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:48:33 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:48:32 +0000
Message-ID: <1352803712.7491.45.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Tue, 13 Nov 2012 10:48:32 +0000
In-Reply-To: <1351802007-19178-3-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1351802007-19178-3-git-send-email-matthew.fioravante@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "samuel.thibault@ens-lyon.org" <samuel.thibault@ens-lyon.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 3/9] add tpmfront, tpm_tis,
 and tpmback drivers to mini-os
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-01 at 20:33 +0000, Matthew Fioravante wrote:
> This patch adds 3 new drivers to mini-os.
> 
> tpmfront - paravirtualized tpm frontend driver
> tpmback - paravirtualized tpm backend driver
> tpm_tis - hardware tpm driver
> 
> Unfortunately these drivers were derived from GPL
> licensed linux kernel drivers so they must carry
> the GPL license. However, since mini-os now
> supports conditional compilation, hopefully these
> drivers can be included into the xen tree and
> conditionally removed from non-gpl projects.
> By default they are disabled in the makefile.

I think this is OK but please could you send a followup patch to
extras/mini-os/COPYING which clarifies the situation. Something like
"... Certain files in this directory are licensed under the GPLv2. By
default these are not built and linked into MiniOS however enabling them
will cause the whole work to become covered by the GPL.". Or something
like that (Ian Jackson -- perhaps you have an opinion on the wording?)

Anyway, for this patch:
Acked-by: Ian Campbell <ian.campbell@citrix.com>

And applied.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:48:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:48:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYE2m-0004Fz-FR; Tue, 13 Nov 2012 10:48:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYE2l-0004Fo-5j
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:48:35 +0000
Received: from [85.158.143.99:35588] by server-1.bemta-4.messagelabs.com id
	19/1A-27934-28522A05; Tue, 13 Nov 2012 10:48:34 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1352803713!28808747!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9100 invoked from network); 13 Nov 2012 10:48:34 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:48:34 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15773575"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:48:33 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:48:32 +0000
Message-ID: <1352803712.7491.45.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Tue, 13 Nov 2012 10:48:32 +0000
In-Reply-To: <1351802007-19178-3-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1351802007-19178-3-git-send-email-matthew.fioravante@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "samuel.thibault@ens-lyon.org" <samuel.thibault@ens-lyon.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 3/9] add tpmfront, tpm_tis,
 and tpmback drivers to mini-os
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-01 at 20:33 +0000, Matthew Fioravante wrote:
> This patch adds 3 new drivers to mini-os.
> 
> tpmfront - paravirtualized tpm frontend driver
> tpmback - paravirtualized tpm backend driver
> tpm_tis - hardware tpm driver
> 
> Unfortunately these drivers were derived from GPL
> licensed linux kernel drivers so they must carry
> the GPL license. However, since mini-os now
> supports conditional compilation, hopefully these
> drivers can be included into the xen tree and
> conditionally removed from non-gpl projects.
> By default they are disabled in the makefile.

I think this is OK but please could you send a followup patch to
extras/mini-os/COPYING which clarifies the situation. Something like
"... Certain files in this directory are licensed under the GPLv2. By
default these are not built and linked into MiniOS however enabling them
will cause the whole work to become covered by the GPL.". Or something
like that (Ian Jackson -- perhaps you have an opinion on the wording?)

Anyway, for this patch:
Acked-by: Ian Campbell <ian.campbell@citrix.com>

And applied.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:49:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:49:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYE2w-0004H3-Rr; Tue, 13 Nov 2012 10:48:46 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYE2v-0004Gk-A5
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:48:45 +0000
Received: from [193.109.254.147:40743] by server-11.bemta-14.messagelabs.com
	id 5E/1A-29027-C8522A05; Tue, 13 Nov 2012 10:48:44 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1352803658!10753026!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1310 invoked from network); 13 Nov 2012 10:47:38 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:47:38 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15773543"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:47:37 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:47:37 +0000
Message-ID: <1352803656.7491.44.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Tue, 13 Nov 2012 10:47:36 +0000
In-Reply-To: <20121101213222.GR5569@type.youpi.perso.aquilenet.fr>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1351802007-19178-2-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121101213222.GR5569@type.youpi.perso.aquilenet.fr>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 2/9] add xenbus_read_uuid to mini-os
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVGh1LCAyMDEyLTExLTAxIGF0IDIxOjMyICswMDAwLCBTYW11ZWwgVGhpYmF1bHQgd3JvdGU6
Cj4gTWF0dGhldyBGaW9yYXZhbnRlLCBsZSBUaHUgMDEgTm92IDIwMTIgMTY6MzM6MjUgLTA0MDAs
IGEgw6ljcml0IDoKPiA+IFNpbWlsYXIgdG8geGVuYnVzX3JlYWRfaW50ZWdlciwgdGhpcyBmdW5j
dGlvbiByZWFkcyBhIHhlbnN0b3JlIHBhdGgKPiA+IGFuZCBwYXJzZXMgaXQgYXMgYSB1dWlkLiBT
ZWUgaW5jbHVkZS94ZW5idXMuaCBmb3IgZGV0YWlscy4KPiA+IAo+ID4gU2lnbmVkLW9mZi1ieTog
TWF0dGhldyBGaW9yYXZhbnRlIDxtYXR0aGV3LmZpb3JhdmFudGVAamh1YXBsLmVkdT4KPiAKPiBB
Y2tlZC1ieTogU2FtdWVsIFRoaWJhdWx0IDxzYW11ZWwudGhpYmF1bHRAZW5zLWx5b24ub3JnPgoK
QXBwbGllZC4gVGhhbmtzLgoKCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fXwpYZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3Jn
Cmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:49:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:49:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYE2w-0004H3-Rr; Tue, 13 Nov 2012 10:48:46 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYE2v-0004Gk-A5
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:48:45 +0000
Received: from [193.109.254.147:40743] by server-11.bemta-14.messagelabs.com
	id 5E/1A-29027-C8522A05; Tue, 13 Nov 2012 10:48:44 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1352803658!10753026!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1310 invoked from network); 13 Nov 2012 10:47:38 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:47:38 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15773543"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:47:37 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:47:37 +0000
Message-ID: <1352803656.7491.44.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Tue, 13 Nov 2012 10:47:36 +0000
In-Reply-To: <20121101213222.GR5569@type.youpi.perso.aquilenet.fr>
References: <1351802007-19178-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1351802007-19178-2-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121101213222.GR5569@type.youpi.perso.aquilenet.fr>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 2/9] add xenbus_read_uuid to mini-os
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVGh1LCAyMDEyLTExLTAxIGF0IDIxOjMyICswMDAwLCBTYW11ZWwgVGhpYmF1bHQgd3JvdGU6
Cj4gTWF0dGhldyBGaW9yYXZhbnRlLCBsZSBUaHUgMDEgTm92IDIwMTIgMTY6MzM6MjUgLTA0MDAs
IGEgw6ljcml0IDoKPiA+IFNpbWlsYXIgdG8geGVuYnVzX3JlYWRfaW50ZWdlciwgdGhpcyBmdW5j
dGlvbiByZWFkcyBhIHhlbnN0b3JlIHBhdGgKPiA+IGFuZCBwYXJzZXMgaXQgYXMgYSB1dWlkLiBT
ZWUgaW5jbHVkZS94ZW5idXMuaCBmb3IgZGV0YWlscy4KPiA+IAo+ID4gU2lnbmVkLW9mZi1ieTog
TWF0dGhldyBGaW9yYXZhbnRlIDxtYXR0aGV3LmZpb3JhdmFudGVAamh1YXBsLmVkdT4KPiAKPiBB
Y2tlZC1ieTogU2FtdWVsIFRoaWJhdWx0IDxzYW11ZWwudGhpYmF1bHRAZW5zLWx5b24ub3JnPgoK
QXBwbGllZC4gVGhhbmtzLgoKCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fXwpYZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3Jn
Cmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:49:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:49:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYE3E-0004KA-9P; Tue, 13 Nov 2012 10:49:04 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYE3C-0004JS-2l
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:49:02 +0000
Received: from [193.109.254.147:29284] by server-13.bemta-14.messagelabs.com
	id 12/A9-11239-D9522A05; Tue, 13 Nov 2012 10:49:01 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1352803738!8895644!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9641 invoked from network); 13 Nov 2012 10:49:00 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:49:00 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15773583"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:48:53 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:48:53 +0000
Message-ID: <1352803732.7491.46.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Tue, 13 Nov 2012 10:48:52 +0000
In-Reply-To: <1351802096-19224-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802096-19224-1-git-send-email-matthew.fioravante@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 5/9] add vtpm support to libxl
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-01 at 20:34 +0000, Matthew Fioravante wrote:
> This patch adds vtpm support to libxl. It adds vtpm parsing to config
> files and 3 new xl commands:
> vtpm-attach
> vtpm-detach
> vtpm-list
> 
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

Acked-by: Ian Campbell <ian.campbell@citrix.com> and applied. thanks.

> 
> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
> index 428da21..fe4fac9 100644
> --- a/docs/man/xl.cfg.pod.5
> +++ b/docs/man/xl.cfg.pod.5
> @@ -298,6 +298,35 @@ Specifies the networking provision (both emulated network adapters,
>  and Xen virtual interfaces) to provided to the guest.  See
>  F<docs/misc/xl-network-configuration.markdown>.
> 
> +=item B<vtpm=[ "VTPM_SPEC_STRING", "VTPM_SPEC_STRING", ...]>
> +
> +Specifies the virtual trusted platform module to be
> +provided to the guest. Please see F<docs/misc/vtpm.txt>
> +for more details.
> +
> +Each B<VTPM_SPEC_STRING> is a comma-separated list of C<KEY=VALUE>
> +settings, from the following list:
> +
> +=over 4
> +
> +=item C<backend=DOMAIN>
> +
> +Specify the backend domain name of id. This value is required!
> +If this domain is a guest, the backend should be set to the
> +vtpm domain name. If this domain is a vtpm, the
> +backend should be set to the vtpm manager domain name.
> +
> +=item C<uuid=UUID>
> +
> +Specify the uuid of this vtpm device. The uuid is used to uniquely
> +identify the vtpm device. You can create one using the uuidgen
> +program on unix systems. If left unspecified, a new uuid
> +will be randomly generated every time the domain boots.
> +If this is a vtpm domain, you should specify a value. The
> +value is optional if this is a guest domain.
> +
> +=back
> +
>  =item B<vfb=[ "VFB_SPEC_STRING", "VFB_SPEC_STRING", ...]>
> 
>  Specifies the paravirtual framebuffer devices which should be supplied
> diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
> index 7b1f2cf..097fe43 100644
> --- a/docs/man/xl.pod.1
> +++ b/docs/man/xl.pod.1
> @@ -1106,6 +1106,31 @@ List virtual network interfaces for a domain.
> 
>  =back
> 
> +=head2 VTPM DEVICES
> +
> +=over 4
> +
> +=item B<vtpm-attach> I<domain-id> I<vtpm-device>
> +
> +Creates a new vtpm device in the domain specified by I<domain-id>.
> +I<vtpm-device> describes the device to attach, using the same format as the
> +B<vtpm> string in the domain config file. See L<xl.cfg> for
> +more information.
> +
> +=item B<vtpm-detach> I<domain-id> I<devid|uuid>
> +
> +Removes the vtpm device from the domain specified by I<domain-id>.
> +I<devid> is the numeric device id given to the virtual trusted
> +platform module device. You will need to run B<xl vtpm-list> to determine that number.
> +Alternatively the I<uuid> of the vtpm can be used to
> +select the virtual device to detach.
> +
> +=item B<vtpm-list> I<domain-id>
> +
> +List virtual trusted platform modules for a domain.
> +
> +=back
> +
>  =head1 PCI PASS-THROUGH
> 
>  =over 4
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index 665385b..be457f4 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -1710,6 +1710,243 @@ out:
>  }
> 
>  /******************************************************************************/
> +int libxl__device_vtpm_setdefault(libxl__gc *gc, libxl_device_vtpm *vtpm)
> +{
> +   if(libxl_uuid_is_nil(&vtpm->uuid)) {
> +      libxl_uuid_generate(&vtpm->uuid);
> +   }
> +   return 0;
> +}
> +
> +static int libxl__device_from_vtpm(libxl__gc *gc, uint32_t domid,
> +                                   libxl_device_vtpm *vtpm,
> +                                   libxl__device *device)
> +{
> +   device->backend_devid   = vtpm->devid;
> +   device->backend_domid   = vtpm->backend_domid;
> +   device->backend_kind    = LIBXL__DEVICE_KIND_VTPM;
> +   device->devid           = vtpm->devid;
> +   device->domid           = domid;
> +   device->kind            = LIBXL__DEVICE_KIND_VTPM;
> +
> +   return 0;
> +}
> +
> +void libxl__device_vtpm_add(libxl__egc *egc, uint32_t domid,
> +                           libxl_device_vtpm *vtpm,
> +                           libxl__ao_device *aodev)
> +{
> +    STATE_AO_GC(aodev->ao);
> +    flexarray_t *front;
> +    flexarray_t *back;
> +    libxl__device *device;
> +    char *dompath, **l;
> +    unsigned int nb, rc;
> +
> +    rc = libxl__device_vtpm_setdefault(gc, vtpm);
> +    if (rc) goto out;
> +
> +    front = flexarray_make(gc, 16, 1);
> +    back = flexarray_make(gc, 16, 1);
> +
> +    if(vtpm->devid == -1) {
> +        if (!(dompath = libxl__xs_get_dompath(gc, domid))) {
> +            rc = ERROR_FAIL;
> +            goto out;
> +        }
> +        l = libxl__xs_directory(gc, XBT_NULL,
> +              GCSPRINTF("%s/device/vtpm", dompath), &nb);
> +        if(l == NULL || nb == 0) {
> +            vtpm->devid = 0;
> +        } else {
> +            vtpm->devid = strtoul(l[nb - 1], NULL, 10) + 1;
> +        }
> +    }
> +
> +    GCNEW(device);
> +    rc = libxl__device_from_vtpm(gc, domid, vtpm, device);
> +    if ( rc != 0 ) goto out;
> +
> +    flexarray_append(back, "frontend-id");
> +    flexarray_append(back, GCSPRINTF("%d", domid));
> +    flexarray_append(back, "online");
> +    flexarray_append(back, "1");
> +    flexarray_append(back, "state");
> +    flexarray_append(back, GCSPRINTF("%d", 1));
> +    flexarray_append(back, "handle");
> +    flexarray_append(back, GCSPRINTF("%d", vtpm->devid));
> +
> +    flexarray_append(back, "uuid");
> +    flexarray_append(back, GCSPRINTF(LIBXL_UUID_FMT, LIBXL_UUID_BYTES(vtpm->uuid)));
> +    flexarray_append(back, "resume");
> +    flexarray_append(back, "False");
> +
> +    flexarray_append(front, "backend-id");
> +    flexarray_append(front, GCSPRINTF("%d", vtpm->backend_domid));
> +    flexarray_append(front, "state");
> +    flexarray_append(front, GCSPRINTF("%d", 1));
> +    flexarray_append(front, "handle");
> +    flexarray_append(front, GCSPRINTF("%d", vtpm->devid));
> +
> +    libxl__device_generic_add(gc, XBT_NULL, device,
> +                             libxl__xs_kvs_of_flexarray(gc, back, back->count),
> +                             libxl__xs_kvs_of_flexarray(gc, front, front->count));
> +
> +    aodev->dev = device;
> +    aodev->action = DEVICE_CONNECT;
> +    libxl__wait_device_connection(egc, aodev);
> +
> +    rc = 0;
> +out:
> +    aodev->rc = rc;
> +    if(rc) aodev->callback(egc, aodev);
> +    return;
> +}
> +
> +libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx, uint32_t domid, int *num)
> +{
> +    GC_INIT(ctx);
> +
> +    libxl_device_vtpm* vtpms = NULL;
> +    char* fe_path = NULL;
> +    char** dir = NULL;
> +    unsigned int ndirs = 0;
> +
> +    *num = 0;
> +
> +    fe_path = libxl__sprintf(gc, "%s/device/vtpm", libxl__xs_get_dompath(gc, domid));
> +    dir = libxl__xs_directory(gc, XBT_NULL, fe_path, &ndirs);
> +    if(dir) {
> +       vtpms = malloc(sizeof(*vtpms) * ndirs);
> +       libxl_device_vtpm* vtpm;
> +       libxl_device_vtpm* end = vtpms + ndirs;
> +       for(vtpm = vtpms; vtpm < end; ++vtpm, ++dir) {
> +          char* tmp;
> +          const char* be_path = libxl__xs_read(gc, XBT_NULL,
> +                GCSPRINTF("%s/%s/backend",
> +                   fe_path, *dir));
> +
> +          vtpm->devid = atoi(*dir);
> +
> +          tmp = libxl__xs_read(gc, XBT_NULL,
> +                GCSPRINTF("%s/%s/backend_id",
> +                   fe_path, *dir));
> +          vtpm->backend_domid = atoi(tmp);
> +
> +          tmp = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/uuid", be_path));
> +          if(tmp) {
> +             if(libxl_uuid_from_string(&(vtpm->uuid), tmp)) {
> +                LOG(ERROR, "%s/uuid is a malformed uuid?? (%s) Probably a bug!!\n", be_path, tmp);
> +                exit(1);
> +             }
> +          }
> +       }
> +    }
> +    *num = ndirs;
> +
> +    GC_FREE;
> +    return vtpms;
> +}
> +
> +int libxl_device_vtpm_getinfo(libxl_ctx *ctx,
> +                              uint32_t domid,
> +                              libxl_device_vtpm *vtpm,
> +                              libxl_vtpminfo *vtpminfo)
> +{
> +    GC_INIT(ctx);
> +    char *dompath, *vtpmpath;
> +    char *val;
> +    int rc = 0;
> +
> +    libxl_vtpminfo_init(vtpminfo);
> +    dompath = libxl__xs_get_dompath(gc, domid);
> +    vtpminfo->devid = vtpm->devid;
> +
> +    vtpmpath = GCSPRINTF("%s/device/vtpm/%d", dompath, vtpminfo->devid);
> +    vtpminfo->backend = xs_read(ctx->xsh, XBT_NULL,
> +          GCSPRINTF("%s/backend", vtpmpath), NULL);
> +    if (!vtpminfo->backend) {
> +        goto err;
> +    }
> +    if(!libxl__xs_read(gc, XBT_NULL, vtpminfo->backend)) {
> +       goto err;
> +    }
> +
> +    val = libxl__xs_read(gc, XBT_NULL,
> +          GCSPRINTF("%s/backend-id", vtpmpath));
> +    vtpminfo->backend_id = val ? strtoul(val, NULL, 10) : -1;
> +
> +    val = libxl__xs_read(gc, XBT_NULL,
> +          GCSPRINTF("%s/state", vtpmpath));
> +    vtpminfo->state = val ? strtoul(val, NULL, 10) : -1;
> +
> +    val = libxl__xs_read(gc, XBT_NULL,
> +          GCSPRINTF("%s/event-channel", vtpmpath));
> +    vtpminfo->evtch = val ? strtoul(val, NULL, 10) : -1;
> +
> +    val = libxl__xs_read(gc, XBT_NULL,
> +          GCSPRINTF("%s/ring-ref", vtpmpath));
> +    vtpminfo->rref = val ? strtoul(val, NULL, 10) : -1;
> +
> +    vtpminfo->frontend = xs_read(ctx->xsh, XBT_NULL,
> +          GCSPRINTF("%s/frontend", vtpminfo->backend), NULL);
> +
> +    val = libxl__xs_read(gc, XBT_NULL,
> +          GCSPRINTF("%s/frontend-id", vtpminfo->backend));
> +    vtpminfo->frontend_id = val ? strtoul(val, NULL, 10) : -1;
> +
> +    val = libxl__xs_read(gc, XBT_NULL,
> +          GCSPRINTF("%s/uuid", vtpminfo->backend));
> +    if(val == NULL) {
> +       LOG(ERROR, "%s/uuid does not exist!\n", vtpminfo->backend);
> +       goto err;
> +    }
> +    if(libxl_uuid_from_string(&(vtpminfo->uuid), val)) {
> +       LOG(ERROR,
> +             "%s/uuid is a malformed uuid?? (%s) Probably a bug!\n",
> +             vtpminfo->backend, val);
> +       goto err;
> +    }
> +
> +    goto exit;
> +err:
> +    rc = ERROR_FAIL;
> +exit:
> +    GC_FREE;
> +    return rc;
> +}
> +
> +int libxl_devid_to_device_vtpm(libxl_ctx *ctx,
> +                               uint32_t domid,
> +                               int devid,
> +                               libxl_device_vtpm *vtpm)
> +{
> +    libxl_device_vtpm *vtpms;
> +    int nb, i;
> +    int rc;
> +
> +    vtpms = libxl_device_vtpm_list(ctx, domid, &nb);
> +    if (!vtpms)
> +        return ERROR_FAIL;
> +
> +    memset(vtpm, 0, sizeof (libxl_device_vtpm));
> +    rc = 1;
> +    for (i = 0; i < nb; ++i) {
> +        if(devid == vtpms[i].devid) {
> +            vtpm->backend_domid = vtpms[i].backend_domid;
> +            vtpm->devid = vtpms[i].devid;
> +            libxl_uuid_copy(&vtpm->uuid, &vtpms[i].uuid);
> +            rc = 0;
> +            break;
> +        }
> +    }
> +
> +    libxl_device_vtpm_list_free(vtpms, nb);
> +    return rc;
> +}
> +
> +
> +/******************************************************************************/
> 
>  int libxl__device_disk_setdefault(libxl__gc *gc, libxl_device_disk *disk)
>  {
> @@ -3046,6 +3283,8 @@ out:
>   * libxl_device_disk_destroy
>   * libxl_device_nic_remove
>   * libxl_device_nic_destroy
> + * libxl_device_vtpm_remove
> + * libxl_device_vtpm_destroy
>   * libxl_device_vkb_remove
>   * libxl_device_vkb_destroy
>   * libxl_device_vfb_remove
> @@ -3097,6 +3336,10 @@ DEFINE_DEVICE_REMOVE(vkb, destroy, 1)
>  DEFINE_DEVICE_REMOVE(vfb, remove, 0)
>  DEFINE_DEVICE_REMOVE(vfb, destroy, 1)
> 
> +/* vtpm */
> +DEFINE_DEVICE_REMOVE(vtpm, remove, 0)
> +DEFINE_DEVICE_REMOVE(vtpm, destroy, 1)
> +
>  #undef DEFINE_DEVICE_REMOVE
> 
>  /******************************************************************************/
> @@ -3105,6 +3348,7 @@ DEFINE_DEVICE_REMOVE(vfb, destroy, 1)
>  /* The following functions are defined:
>   * libxl_device_disk_add
>   * libxl_device_nic_add
> + * libxl_device_vtpm_add
>   */
> 
>  #define DEFINE_DEVICE_ADD(type)                                         \
> @@ -3131,6 +3375,9 @@ DEFINE_DEVICE_ADD(disk)
>  /* nic */
>  DEFINE_DEVICE_ADD(nic)
> 
> +/* vtpm */
> +DEFINE_DEVICE_ADD(vtpm)
> +
>  #undef DEFINE_DEVICE_ADD
> 
>  /******************************************************************************/
> diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
> index 7a7c419..e2ba549 100644
> --- a/tools/libxl/libxl.h
> +++ b/tools/libxl/libxl.h
> @@ -478,13 +478,14 @@ typedef struct {
>      libxl_domain_create_info c_info;
>      libxl_domain_build_info b_info;
> 
> -    int num_disks, num_nics, num_pcidevs, num_vfbs, num_vkbs;
> +    int num_disks, num_nics, num_pcidevs, num_vfbs, num_vkbs, num_vtpms;
> 
>      libxl_device_disk *disks;
>      libxl_device_nic *nics;
>      libxl_device_pci *pcidevs;
>      libxl_device_vfb *vfbs;
>      libxl_device_vkb *vkbs;
> +    libxl_device_vtpm *vtpms;
> 
>      libxl_action_on_shutdown on_poweroff;
>      libxl_action_on_shutdown on_reboot;
> @@ -645,6 +646,9 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
>                                  int *nb_vcpu, int *nr_vcpus_out);
>  void libxl_vcpuinfo_list_free(libxl_vcpuinfo *, int nr_vcpus);
> 
> +void libxl_device_vtpm_list_free(libxl_device_vtpm*, int nr_vtpms);
> +void libxl_vtpminfo_list_free(libxl_vtpminfo *, int nr_vtpms);
> +
>  /*
>   * Devices
>   * =======
> @@ -745,6 +749,23 @@ libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx, uint32_t domid, int *num
>  int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
>                                libxl_device_nic *nic, libxl_nicinfo *nicinfo);
> 
> +/* Virtual TPMs */
> +int libxl_device_vtpm_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vtpm *vtpm,
> +                          const libxl_asyncop_how *ao_how)
> +                          LIBXL_EXTERNAL_CALLERS_ONLY;
> +int libxl_device_vtpm_remove(libxl_ctx *ctx, uint32_t domid,
> +                            libxl_device_vtpm *vtpm,
> +                            const libxl_asyncop_how *ao_how)
> +                            LIBXL_EXTERNAL_CALLERS_ONLY;
> +int libxl_device_vtpm_destroy(libxl_ctx *ctx, uint32_t domid,
> +                              libxl_device_vtpm *vtpm,
> +                              const libxl_asyncop_how *ao_how)
> +                              LIBXL_EXTERNAL_CALLERS_ONLY;
> +
> +libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx, uint32_t domid, int *num);
> +int libxl_device_vtpm_getinfo(libxl_ctx *ctx, uint32_t domid,
> +                               libxl_device_vtpm *vtpm, libxl_vtpminfo *vtpminfo);
> +
>  /* Keyboard */
>  int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb,
>                           const libxl_asyncop_how *ao_how)
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index e81747b..9d20086 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -55,6 +55,8 @@ void libxl_domain_config_dispose(libxl_domain_config *d_config)
>          libxl_device_vkb_dispose(&d_config->vkbs[i]);
>      free(d_config->vkbs);
> 
> +    libxl_device_vtpm_list_free(d_config->vtpms, d_config->num_vtpms);
> +
>      libxl_domain_create_info_dispose(&d_config->c_info);
>      libxl_domain_build_info_dispose(&d_config->b_info);
>  }
> @@ -601,6 +603,8 @@ static void domcreate_bootloader_done(libxl__egc *egc,
>  static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *aodevs,
>                                  int ret);
> 
> +static void domcreate_attach_vtpms(libxl__egc *egc, libxl__multidev *multidev,
> +                                   int ret);
>  static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *aodevs,
>                                   int ret);
> 
> @@ -1085,13 +1089,13 @@ static void domcreate_devmodel_started(libxl__egc *egc,
>      if (d_config->num_nics > 0) {
>          /* Attach nics */
>          libxl__multidev_begin(ao, &dcs->multidev);
> -        dcs->multidev.callback = domcreate_attach_pci;
> +        dcs->multidev.callback = domcreate_attach_vtpms;
>          libxl__add_nics(egc, ao, domid, d_config, &dcs->multidev);
>          libxl__multidev_prepared(egc, &dcs->multidev, 0);
>          return;
>      }
> 
> -    domcreate_attach_pci(egc, &dcs->multidev, 0);
> +    domcreate_attach_vtpms(egc, &dcs->multidev, 0);
>      return;
> 
>  error_out:
> @@ -1099,6 +1103,39 @@ error_out:
>      domcreate_complete(egc, dcs, ret);
>  }
> 
> +static void domcreate_attach_vtpms(libxl__egc *egc,
> +                                   libxl__multidev *multidev,
> +                                   int ret)
> +{
> +   libxl__domain_create_state *dcs = CONTAINER_OF(multidev, *dcs, multidev);
> +   STATE_AO_GC(dcs->ao);
> +   int domid = dcs->guest_domid;
> +
> +   libxl_domain_config* const d_config = dcs->guest_config;
> +
> +   if(ret) {
> +       LOG(ERROR, "unable to add nic devices");
> +       goto error_out;
> +   }
> +
> +    /* Plug vtpm devices */
> +   if (d_config->num_vtpms > 0) {
> +       /* Attach vtpms */
> +       libxl__multidev_begin(ao, &dcs->multidev);
> +       dcs->multidev.callback = domcreate_attach_pci;
> +       libxl__add_vtpms(egc, ao, domid, d_config, &dcs->multidev);
> +       libxl__multidev_prepared(egc, &dcs->multidev, 0);
> +       return;
> +   }
> +
> +   domcreate_attach_pci(egc, multidev, 0);
> +   return;
> +
> +error_out:
> +   assert(ret);
> +   domcreate_complete(egc, dcs, ret);
> +}
> +
>  static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
>                                   int ret)
>  {
> @@ -1112,7 +1149,7 @@ static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
>      libxl_domain_config *const d_config = dcs->guest_config;
> 
>      if (ret) {
> -        LOG(ERROR, "unable to add nic devices");
> +        LOG(ERROR, "unable to add vtpm devices");
>          goto error_out;
>      }
> 
> diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
> index c3283f1..51dd06e 100644
> --- a/tools/libxl/libxl_device.c
> +++ b/tools/libxl/libxl_device.c
> @@ -497,6 +497,7 @@ void libxl__multidev_prepared(libxl__egc *egc,
>   * The following functions are defined:
>   * libxl__add_disks
>   * libxl__add_nics
> + * libxl__add_vtpms
>   */
> 
>  #define DEFINE_DEVICES_ADD(type)                                        \
> @@ -515,6 +516,7 @@ void libxl__multidev_prepared(libxl__egc *egc,
> 
>  DEFINE_DEVICES_ADD(disk)
>  DEFINE_DEVICES_ADD(nic)
> +DEFINE_DEVICES_ADD(vtpm)
> 
>  #undef DEFINE_DEVICES_ADD
> 
> diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
> index 8f220cb..cba3616 100644
> --- a/tools/libxl/libxl_internal.h
> +++ b/tools/libxl/libxl_internal.h
> @@ -958,6 +958,7 @@ _hidden int libxl__device_disk_setdefault(libxl__gc *gc,
>                                            libxl_device_disk *disk);
>  _hidden int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic,
>                                           uint32_t domid);
> +_hidden int libxl__device_vtpm_setdefault(libxl__gc *gc, libxl_device_vtpm *vtpm);
>  _hidden int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb);
>  _hidden int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb);
>  _hidden int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci);
> @@ -2007,6 +2008,10 @@ _hidden void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
>                                     libxl_device_nic *nic,
>                                     libxl__ao_device *aodev);
> 
> +_hidden void libxl__device_vtpm_add(libxl__egc *egc, uint32_t domid,
> +                                   libxl_device_vtpm *vtpm,
> +                                   libxl__ao_device *aodev);
> +
>  /* Internal function to connect a vkb device */
>  _hidden int libxl__device_vkb_add(libxl__gc *gc, uint32_t domid,
>                                    libxl_device_vkb *vkb);
> @@ -2439,6 +2444,10 @@ _hidden void libxl__add_nics(libxl__egc *egc, libxl__ao *ao, uint32_t domid,
>                               libxl_domain_config *d_config,
>                               libxl__multidev *multidev);
> 
> +_hidden void libxl__add_vtpms(libxl__egc *egc, libxl__ao *ao, uint32_t domid,
> +                             libxl_domain_config *d_config,
> +                             libxl__multidev *multidev);
> +
>  /*----- device model creation -----*/
> 
>  /* First layer; wraps libxl__spawn_spawn. */
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index de111a6..7eac4a8 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -395,6 +395,12 @@ libxl_device_pci = Struct("device_pci", [
>      ("permissive", bool),
>      ])
> 
> +libxl_device_vtpm = Struct("device_vtpm", [
> +    ("backend_domid",    libxl_domid),
> +    ("devid",            libxl_devid),
> +    ("uuid",             libxl_uuid),
> +])
> +
>  libxl_diskinfo = Struct("diskinfo", [
>      ("backend", string),
>      ("backend_id", uint32),
> @@ -418,6 +424,18 @@ libxl_nicinfo = Struct("nicinfo", [
>      ("rref_rx", integer),
>      ], dir=DIR_OUT)
> 
> +libxl_vtpminfo = Struct("vtpminfo", [
> +    ("backend", string),
> +    ("backend_id", uint32),
> +    ("frontend", string),
> +    ("frontend_id", uint32),
> +    ("devid", libxl_devid),
> +    ("state", integer),
> +    ("evtch", integer),
> +    ("rref", integer),
> +    ("uuid", libxl_uuid),
> +    ], dir=DIR_OUT)
> +
>  libxl_vcpuinfo = Struct("vcpuinfo", [
>      ("vcpuid", uint32),
>      ("cpu", uint32),
> diff --git a/tools/libxl/libxl_types_internal.idl b/tools/libxl/libxl_types_internal.idl
> index 5ac8c9c..c40120e 100644
> --- a/tools/libxl/libxl_types_internal.idl
> +++ b/tools/libxl/libxl_types_internal.idl
> @@ -19,6 +19,7 @@ libxl__device_kind = Enumeration("device_kind", [
>      (5, "VFB"),
>      (6, "VKBD"),
>      (7, "CONSOLE"),
> +    (8, "VTPM"),
>      ])
> 
>  libxl__console_backend = Enumeration("console_backend", [
> diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
> index 55cd299..8f78790 100644
> --- a/tools/libxl/libxl_utils.c
> +++ b/tools/libxl/libxl_utils.c
> @@ -463,6 +463,33 @@ int libxl_pipe(libxl_ctx *ctx, int pipes[2])
>      return 0;
>  }
> 
> +int libxl_uuid_to_device_vtpm(libxl_ctx *ctx, uint32_t domid,
> +                            libxl_uuid* uuid, libxl_device_vtpm *vtpm)
> +{
> +    libxl_device_vtpm *vtpms;
> +    int nb, i;
> +    int rc;
> +
> +    vtpms = libxl_device_vtpm_list(ctx, domid, &nb);
> +    if (!vtpms)
> +        return ERROR_FAIL;
> +
> +    memset(vtpm, 0, sizeof (libxl_device_vtpm));
> +    rc = 1;
> +    for (i = 0; i < nb; ++i) {
> +        if(!libxl_uuid_compare(uuid, &vtpms[i].uuid)) {
> +            vtpm->backend_domid = vtpms[i].backend_domid;
> +            vtpm->devid = vtpms[i].devid;
> +            libxl_uuid_copy(&vtpm->uuid, &vtpms[i].uuid);
> +            rc = 0;
> +            break;
> +        }
> +    }
> +
> +    libxl_device_vtpm_list_free(vtpms, nb);
> +    return rc;
> +}
> +
>  int libxl_mac_to_device_nic(libxl_ctx *ctx, uint32_t domid,
>                              const char *mac, libxl_device_nic *nic)
>  {
> @@ -819,6 +846,22 @@ void libxl_cpupoolinfo_list_free(libxl_cpupoolinfo *list, int nr)
>      free(list);
>  }
> 
> +void libxl_vtpminfo_list_free(libxl_vtpminfo* list, int nr)
> +{
> +   int i;
> +   for (i = 0; i < nr; i++)
> +      libxl_vtpminfo_dispose(&list[i]);
> +   free(list);
> +}
> +
> +void libxl_device_vtpm_list_free(libxl_device_vtpm* list, int nr)
> +{
> +   int i;
> +   for (i = 0; i < nr; i++)
> +      libxl_device_vtpm_dispose(&list[i]);
> +   free(list);
> +}
> +
>  int libxl_domid_valid_guest(uint32_t domid)
>  {
>      /* returns 1 if the value _could_ be a valid guest domid, 0 otherwise
> diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
> index 83aaac7..40f3f30 100644
> --- a/tools/libxl/libxl_utils.h
> +++ b/tools/libxl/libxl_utils.h
> @@ -64,6 +64,11 @@ int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid, int devid,
>  int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid, const char *vdev,
>                                 libxl_device_disk *disk);
> 
> +int libxl_uuid_to_device_vtpm(libxl_ctx *ctx, uint32_t domid,
> +                               libxl_uuid *uuid, libxl_device_vtpm *vtpm);
> +int libxl_devid_to_device_vtpm(libxl_ctx *ctx, uint32_t domid,
> +                               int devid, libxl_device_vtpm *vtpm);
> +
>  int libxl_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *bitmap, int n_bits);
>      /* Allocated bimap is from malloc, libxl_bitmap_dispose() to be
>       * called by the application when done. */
> diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
> index 0b2f848..be6f38b 100644
> --- a/tools/libxl/xl.h
> +++ b/tools/libxl/xl.h
> @@ -79,6 +79,9 @@ int main_networkdetach(int argc, char **argv);
>  int main_blockattach(int argc, char **argv);
>  int main_blocklist(int argc, char **argv);
>  int main_blockdetach(int argc, char **argv);
> +int main_vtpmattach(int argc, char **argv);
> +int main_vtpmlist(int argc, char **argv);
> +int main_vtpmdetach(int argc, char **argv);
>  int main_uptime(int argc, char **argv);
>  int main_tmem_list(int argc, char **argv);
>  int main_tmem_freeze(int argc, char **argv);
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index a43b371..65f83bd 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -573,7 +573,7 @@ static void parse_config_data(const char *config_source,
>      const char *buf;
>      long l;
>      XLU_Config *config;
> -    XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids;
> +    XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids, *vtpms;
>      XLU_ConfigList *ioports, *irqs, *iomem;
>      int num_ioports, num_irqs, num_iomem;
>      int pci_power_mgmt = 0;
> @@ -1048,6 +1048,58 @@ static void parse_config_data(const char *config_source,
>          }
>      }
> 
> +    if (!xlu_cfg_get_list(config, "vtpm", &vtpms, 0, 0)) {
> +        d_config->num_vtpms = 0;
> +        d_config->vtpms = NULL;
> +        while ((buf = xlu_cfg_get_listitem (vtpms, d_config->num_vtpms)) != NULL) {
> +            libxl_device_vtpm *vtpm;
> +            char * buf2 = strdup(buf);
> +            char *p, *p2;
> +            bool got_backend = false;
> +
> +            d_config->vtpms = (libxl_device_vtpm *) realloc(d_config->vtpms,
> +                  sizeof(libxl_device_vtpm) * (d_config->num_vtpms+1));
> +            vtpm = d_config->vtpms + d_config->num_vtpms;
> +            libxl_device_vtpm_init(vtpm);
> +            vtpm->devid = d_config->num_vtpms;
> +
> +            p = strtok(buf2, ",");
> +            if(p) {
> +               do {
> +                  while(*p == ' ')
> +                     ++p;
> +                  if ((p2 = strchr(p, '=')) == NULL)
> +                     break;
> +                  *p2 = '\0';
> +                  if (!strcmp(p, "backend")) {
> +                     if(domain_qualifier_to_domid(p2 + 1, &(vtpm->backend_domid), 0))
> +                     {
> +                        fprintf(stderr,
> +                              "Specified vtpm backend domain `%s' does not exist!\n", p2 + 1);
> +                        exit(1);
> +                     }
> +                     got_backend = true;
> +                  } else if(!strcmp(p, "uuid")) {
> +                     if( libxl_uuid_from_string(&vtpm->uuid, p2 + 1) ) {
> +                        fprintf(stderr,
> +                              "Failed to parse vtpm UUID: %s\n", p2 + 1);
> +                        exit(1);
> +                    }
> +                  } else {
> +                     fprintf(stderr, "Unknown string `%s' in vtpm spec\n", p);
> +                     exit(1);
> +                  }
> +               } while ((p = strtok(NULL, ",")) != NULL);
> +            }
> +            if(!got_backend) {
> +               fprintf(stderr, "vtpm spec missing required backend field!\n");
> +               exit(1);
> +            }
> +            free(buf2);
> +            d_config->num_vtpms++;
> +        }
> +    }
> +
>      if (!xlu_cfg_get_list (config, "vif", &nics, 0, 0)) {
>          d_config->num_nics = 0;
>          d_config->nics = NULL;
> @@ -1073,7 +1125,7 @@ static void parse_config_data(const char *config_source,
> 
>              p = strtok(buf2, ",");
>              if (!p)
> -                goto skip;
> +                goto skip_nic;
>              do {
>                  while (*p == ' ')
>                      p++;
> @@ -1137,7 +1189,7 @@ static void parse_config_data(const char *config_source,
>                      fprintf(stderr, "the accel parameter for vifs is currently not supported\n");
>                  }
>              } while ((p = strtok(NULL, ",")) != NULL);
> -skip:
> +skip_nic:
>              free(buf2);
>              d_config->num_nics++;
>          }
> @@ -5634,6 +5686,132 @@ int main_blockdetach(int argc, char **argv)
>      return rc;
>  }
> 
> +int main_vtpmattach(int argc, char **argv)
> +{
> +    int opt;
> +    libxl_device_vtpm vtpm;
> +    char *oparg;
> +    unsigned int val;
> +    uint32_t domid;
> +
> +    if ((opt = def_getopt(argc, argv, "", "vtpm-attach", 1)) != -1)
> +        return opt;
> +
> +    if (domain_qualifier_to_domid(argv[optind], &domid, 0) < 0) {
> +        fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
> +        return 1;
> +    }
> +    ++optind;
> +
> +    libxl_device_vtpm_init(&vtpm);
> +    for (argv += optind, argc -= optind; argc > 0; ++argv, --argc) {
> +        if (MATCH_OPTION("uuid", *argv, oparg)) {
> +            if(libxl_uuid_from_string(&(vtpm.uuid), oparg)) {
> +                fprintf(stderr, "Invalid uuid specified (%s)\n", oparg);
> +                return 1;
> +            }
> +        } else if (MATCH_OPTION("backend", *argv, oparg)) {
> +            if(domain_qualifier_to_domid(oparg, &val, 0)) {
> +                fprintf(stderr,
> +                      "Specified backend domain does not exist, defaulting to Dom0\n");
> +                val = 0;
> +            }
> +            vtpm.backend_domid = val;
> +        } else {
> +            fprintf(stderr, "unrecognized argument `%s'\n", *argv);
> +            return 1;
> +        }
> +    }
> +
> +    if(dryrun_only) {
> +       char* json = libxl_device_vtpm_to_json(ctx, &vtpm);
> +       printf("vtpm: %s\n", json);
> +       free(json);
> +       libxl_device_vtpm_dispose(&vtpm);
> +       if (ferror(stdout) || fflush(stdout)) { perror("stdout"); exit(-1); }
> +       return 0;
> +    }
> +
> +    if (libxl_device_vtpm_add(ctx, domid, &vtpm, 0)) {
> +        fprintf(stderr, "libxl_device_vtpm_add failed.\n");
> +        return 1;
> +    }
> +    libxl_device_vtpm_dispose(&vtpm);
> +    return 0;
> +}
> +
> +int main_vtpmlist(int argc, char **argv)
> +{
> +    int opt;
> +    libxl_device_vtpm *vtpms;
> +    libxl_vtpminfo vtpminfo;
> +    int nb, i;
> +
> +    if ((opt = def_getopt(argc, argv, "", "vtpm-list", 1)) != -1)
> +        return opt;
> +
> +    /*      Idx  BE   UUID   Hdl  Sta  evch rref  BE-path */
> +    printf("%-3s %-2s %-36s %-6s %-5s %-6s %-5s %-10s\n",
> +           "Idx", "BE", "Uuid", "handle", "state", "evt-ch", "ring-ref", "BE-path");
> +    for (argv += optind, argc -= optind; argc > 0; --argc, ++argv) {
> +        uint32_t domid;
> +        if (domain_qualifier_to_domid(*argv, &domid, 0) < 0) {
> +            fprintf(stderr, "%s is an invalid domain identifier\n", *argv);
> +            continue;
> +        }
> +        if (!(vtpms = libxl_device_vtpm_list(ctx, domid, &nb))) {
> +            continue;
> +        }
> +        for (i = 0; i < nb; ++i) {
> +           if(!libxl_device_vtpm_getinfo(ctx, domid, &vtpms[i], &vtpminfo)) {
> +              /*      Idx  BE     UUID             Hdl Sta evch rref BE-path*/
> +              printf("%-3d %-2d " LIBXL_UUID_FMT " %6d %5d %6d %8d %-30s\n",
> +                    vtpminfo.devid, vtpminfo.backend_id,
> +                    LIBXL_UUID_BYTES(vtpminfo.uuid),
> +                    vtpminfo.devid, vtpminfo.state, vtpminfo.evtch,
> +                    vtpminfo.rref, vtpminfo.backend);
> +
> +              libxl_vtpminfo_dispose(&vtpminfo);
> +           }
> +           libxl_device_vtpm_dispose(&vtpms[i]);
> +        }
> +        free(vtpms);
> +    }
> +    return 0;
> +}
> +
> +int main_vtpmdetach(int argc, char **argv)
> +{
> +    uint32_t domid;
> +    int opt, rc=0;
> +    libxl_device_vtpm vtpm;
> +    libxl_uuid uuid;
> +
> +    if ((opt = def_getopt(argc, argv, "", "vtpm-detach", 2)) != -1)
> +        return opt;
> +
> +    domid = find_domain(argv[optind]);
> +
> +    if ( libxl_uuid_from_string(&uuid, argv[optind+1])) {
> +        if (libxl_devid_to_device_vtpm(ctx, domid, atoi(argv[optind+1]), &vtpm)) {
> +            fprintf(stderr, "Unknown device %s.\n", argv[optind+1]);
> +            return 1;
> +        }
> +    } else {
> +        if (libxl_uuid_to_device_vtpm(ctx, domid, &uuid, &vtpm)) {
> +            fprintf(stderr, "Unknown device %s.\n", argv[optind+1]);
> +            return 1;
> +        }
> +    }
> +    rc = libxl_device_vtpm_remove(ctx, domid, &vtpm, 0);
> +    if (rc) {
> +        fprintf(stderr, "libxl_device_vtpm_remove failed.\n");
> +    }
> +    libxl_device_vtpm_dispose(&vtpm);
> +    return rc;
> +}
> +
> +
>  static char *uptime_to_string(unsigned long uptime, int short_mode)
>  {
>      int sec, min, hour, day;
> diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
> index d3a215d..ac58642 100644
> --- a/tools/libxl/xl_cmdtable.c
> +++ b/tools/libxl/xl_cmdtable.c
> @@ -341,6 +341,21 @@ struct cmd_spec cmd_table[] = {
>        "Destroy a domain's virtual block device",
>        "<Domain> <DevId>",
>      },
> +    { "vtpm-attach",
> +      &main_vtpmattach, 1, 1,
> +      "Create a new virtual TPM device",
> +      "<Domain> [uuid=<uuid>] [backend=<BackDomain>]",
> +    },
> +    { "vtpm-list",
> +      &main_vtpmlist, 0, 0,
> +      "List virtual TPM devices for a domain",
> +      "<Domain(s)>",
> +    },
> +    { "vtpm-detach",
> +      &main_vtpmdetach, 0, 1,
> +      "Destroy a domain's virtual TPM device",
> +      "<Domain> <DevId|uuid>",
> +    },
>      { "uptime",
>        &main_uptime, 0, 0,
>        "Print uptime for all/some domains",
> --
> 1.7.10.4
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:49:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:49:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYE3E-0004KA-9P; Tue, 13 Nov 2012 10:49:04 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYE3C-0004JS-2l
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:49:02 +0000
Received: from [193.109.254.147:29284] by server-13.bemta-14.messagelabs.com
	id 12/A9-11239-D9522A05; Tue, 13 Nov 2012 10:49:01 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1352803738!8895644!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9641 invoked from network); 13 Nov 2012 10:49:00 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:49:00 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15773583"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:48:53 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:48:53 +0000
Message-ID: <1352803732.7491.46.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Tue, 13 Nov 2012 10:48:52 +0000
In-Reply-To: <1351802096-19224-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802096-19224-1-git-send-email-matthew.fioravante@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 5/9] add vtpm support to libxl
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-01 at 20:34 +0000, Matthew Fioravante wrote:
> This patch adds vtpm support to libxl. It adds vtpm parsing to config
> files and 3 new xl commands:
> vtpm-attach
> vtpm-detach
> vtpm-list
> 
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

Acked-by: Ian Campbell <ian.campbell@citrix.com> and applied. thanks.

> 
> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
> index 428da21..fe4fac9 100644
> --- a/docs/man/xl.cfg.pod.5
> +++ b/docs/man/xl.cfg.pod.5
> @@ -298,6 +298,35 @@ Specifies the networking provision (both emulated network adapters,
>  and Xen virtual interfaces) to provided to the guest.  See
>  F<docs/misc/xl-network-configuration.markdown>.
> 
> +=item B<vtpm=[ "VTPM_SPEC_STRING", "VTPM_SPEC_STRING", ...]>
> +
> +Specifies the virtual trusted platform module to be
> +provided to the guest. Please see F<docs/misc/vtpm.txt>
> +for more details.
> +
> +Each B<VTPM_SPEC_STRING> is a comma-separated list of C<KEY=VALUE>
> +settings, from the following list:
> +
> +=over 4
> +
> +=item C<backend=DOMAIN>
> +
> +Specify the backend domain name of id. This value is required!
> +If this domain is a guest, the backend should be set to the
> +vtpm domain name. If this domain is a vtpm, the
> +backend should be set to the vtpm manager domain name.
> +
> +=item C<uuid=UUID>
> +
> +Specify the uuid of this vtpm device. The uuid is used to uniquely
> +identify the vtpm device. You can create one using the uuidgen
> +program on unix systems. If left unspecified, a new uuid
> +will be randomly generated every time the domain boots.
> +If this is a vtpm domain, you should specify a value. The
> +value is optional if this is a guest domain.
> +
> +=back
> +
>  =item B<vfb=[ "VFB_SPEC_STRING", "VFB_SPEC_STRING", ...]>
> 
>  Specifies the paravirtual framebuffer devices which should be supplied
> diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
> index 7b1f2cf..097fe43 100644
> --- a/docs/man/xl.pod.1
> +++ b/docs/man/xl.pod.1
> @@ -1106,6 +1106,31 @@ List virtual network interfaces for a domain.
> 
>  =back
> 
> +=head2 VTPM DEVICES
> +
> +=over 4
> +
> +=item B<vtpm-attach> I<domain-id> I<vtpm-device>
> +
> +Creates a new vtpm device in the domain specified by I<domain-id>.
> +I<vtpm-device> describes the device to attach, using the same format as the
> +B<vtpm> string in the domain config file. See L<xl.cfg> for
> +more information.
> +
> +=item B<vtpm-detach> I<domain-id> I<devid|uuid>
> +
> +Removes the vtpm device from the domain specified by I<domain-id>.
> +I<devid> is the numeric device id given to the virtual trusted
> +platform module device. You will need to run B<xl vtpm-list> to determine that number.
> +Alternatively the I<uuid> of the vtpm can be used to
> +select the virtual device to detach.
> +
> +=item B<vtpm-list> I<domain-id>
> +
> +List virtual trusted platform modules for a domain.
> +
> +=back
> +
>  =head1 PCI PASS-THROUGH
> 
>  =over 4
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index 665385b..be457f4 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -1710,6 +1710,243 @@ out:
>  }
> 
>  /******************************************************************************/
> +int libxl__device_vtpm_setdefault(libxl__gc *gc, libxl_device_vtpm *vtpm)
> +{
> +   if(libxl_uuid_is_nil(&vtpm->uuid)) {
> +      libxl_uuid_generate(&vtpm->uuid);
> +   }
> +   return 0;
> +}
> +
> +static int libxl__device_from_vtpm(libxl__gc *gc, uint32_t domid,
> +                                   libxl_device_vtpm *vtpm,
> +                                   libxl__device *device)
> +{
> +   device->backend_devid   = vtpm->devid;
> +   device->backend_domid   = vtpm->backend_domid;
> +   device->backend_kind    = LIBXL__DEVICE_KIND_VTPM;
> +   device->devid           = vtpm->devid;
> +   device->domid           = domid;
> +   device->kind            = LIBXL__DEVICE_KIND_VTPM;
> +
> +   return 0;
> +}
> +
> +void libxl__device_vtpm_add(libxl__egc *egc, uint32_t domid,
> +                           libxl_device_vtpm *vtpm,
> +                           libxl__ao_device *aodev)
> +{
> +    STATE_AO_GC(aodev->ao);
> +    flexarray_t *front;
> +    flexarray_t *back;
> +    libxl__device *device;
> +    char *dompath, **l;
> +    unsigned int nb, rc;
> +
> +    rc = libxl__device_vtpm_setdefault(gc, vtpm);
> +    if (rc) goto out;
> +
> +    front = flexarray_make(gc, 16, 1);
> +    back = flexarray_make(gc, 16, 1);
> +
> +    if(vtpm->devid == -1) {
> +        if (!(dompath = libxl__xs_get_dompath(gc, domid))) {
> +            rc = ERROR_FAIL;
> +            goto out;
> +        }
> +        l = libxl__xs_directory(gc, XBT_NULL,
> +              GCSPRINTF("%s/device/vtpm", dompath), &nb);
> +        if(l == NULL || nb == 0) {
> +            vtpm->devid = 0;
> +        } else {
> +            vtpm->devid = strtoul(l[nb - 1], NULL, 10) + 1;
> +        }
> +    }
> +
> +    GCNEW(device);
> +    rc = libxl__device_from_vtpm(gc, domid, vtpm, device);
> +    if ( rc != 0 ) goto out;
> +
> +    flexarray_append(back, "frontend-id");
> +    flexarray_append(back, GCSPRINTF("%d", domid));
> +    flexarray_append(back, "online");
> +    flexarray_append(back, "1");
> +    flexarray_append(back, "state");
> +    flexarray_append(back, GCSPRINTF("%d", 1));
> +    flexarray_append(back, "handle");
> +    flexarray_append(back, GCSPRINTF("%d", vtpm->devid));
> +
> +    flexarray_append(back, "uuid");
> +    flexarray_append(back, GCSPRINTF(LIBXL_UUID_FMT, LIBXL_UUID_BYTES(vtpm->uuid)));
> +    flexarray_append(back, "resume");
> +    flexarray_append(back, "False");
> +
> +    flexarray_append(front, "backend-id");
> +    flexarray_append(front, GCSPRINTF("%d", vtpm->backend_domid));
> +    flexarray_append(front, "state");
> +    flexarray_append(front, GCSPRINTF("%d", 1));
> +    flexarray_append(front, "handle");
> +    flexarray_append(front, GCSPRINTF("%d", vtpm->devid));
> +
> +    libxl__device_generic_add(gc, XBT_NULL, device,
> +                             libxl__xs_kvs_of_flexarray(gc, back, back->count),
> +                             libxl__xs_kvs_of_flexarray(gc, front, front->count));
> +
> +    aodev->dev = device;
> +    aodev->action = DEVICE_CONNECT;
> +    libxl__wait_device_connection(egc, aodev);
> +
> +    rc = 0;
> +out:
> +    aodev->rc = rc;
> +    if(rc) aodev->callback(egc, aodev);
> +    return;
> +}
> +
> +libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx, uint32_t domid, int *num)
> +{
> +    GC_INIT(ctx);
> +
> +    libxl_device_vtpm* vtpms = NULL;
> +    char* fe_path = NULL;
> +    char** dir = NULL;
> +    unsigned int ndirs = 0;
> +
> +    *num = 0;
> +
> +    fe_path = libxl__sprintf(gc, "%s/device/vtpm", libxl__xs_get_dompath(gc, domid));
> +    dir = libxl__xs_directory(gc, XBT_NULL, fe_path, &ndirs);
> +    if(dir) {
> +       vtpms = malloc(sizeof(*vtpms) * ndirs);
> +       libxl_device_vtpm* vtpm;
> +       libxl_device_vtpm* end = vtpms + ndirs;
> +       for(vtpm = vtpms; vtpm < end; ++vtpm, ++dir) {
> +          char* tmp;
> +          const char* be_path = libxl__xs_read(gc, XBT_NULL,
> +                GCSPRINTF("%s/%s/backend",
> +                   fe_path, *dir));
> +
> +          vtpm->devid = atoi(*dir);
> +
> +          tmp = libxl__xs_read(gc, XBT_NULL,
> +                GCSPRINTF("%s/%s/backend_id",
> +                   fe_path, *dir));
> +          vtpm->backend_domid = atoi(tmp);
> +
> +          tmp = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/uuid", be_path));
> +          if(tmp) {
> +             if(libxl_uuid_from_string(&(vtpm->uuid), tmp)) {
> +                LOG(ERROR, "%s/uuid is a malformed uuid?? (%s) Probably a bug!!\n", be_path, tmp);
> +                exit(1);
> +             }
> +          }
> +       }
> +    }
> +    *num = ndirs;
> +
> +    GC_FREE;
> +    return vtpms;
> +}
> +
> +int libxl_device_vtpm_getinfo(libxl_ctx *ctx,
> +                              uint32_t domid,
> +                              libxl_device_vtpm *vtpm,
> +                              libxl_vtpminfo *vtpminfo)
> +{
> +    GC_INIT(ctx);
> +    char *dompath, *vtpmpath;
> +    char *val;
> +    int rc = 0;
> +
> +    libxl_vtpminfo_init(vtpminfo);
> +    dompath = libxl__xs_get_dompath(gc, domid);
> +    vtpminfo->devid = vtpm->devid;
> +
> +    vtpmpath = GCSPRINTF("%s/device/vtpm/%d", dompath, vtpminfo->devid);
> +    vtpminfo->backend = xs_read(ctx->xsh, XBT_NULL,
> +          GCSPRINTF("%s/backend", vtpmpath), NULL);
> +    if (!vtpminfo->backend) {
> +        goto err;
> +    }
> +    if(!libxl__xs_read(gc, XBT_NULL, vtpminfo->backend)) {
> +       goto err;
> +    }
> +
> +    val = libxl__xs_read(gc, XBT_NULL,
> +          GCSPRINTF("%s/backend-id", vtpmpath));
> +    vtpminfo->backend_id = val ? strtoul(val, NULL, 10) : -1;
> +
> +    val = libxl__xs_read(gc, XBT_NULL,
> +          GCSPRINTF("%s/state", vtpmpath));
> +    vtpminfo->state = val ? strtoul(val, NULL, 10) : -1;
> +
> +    val = libxl__xs_read(gc, XBT_NULL,
> +          GCSPRINTF("%s/event-channel", vtpmpath));
> +    vtpminfo->evtch = val ? strtoul(val, NULL, 10) : -1;
> +
> +    val = libxl__xs_read(gc, XBT_NULL,
> +          GCSPRINTF("%s/ring-ref", vtpmpath));
> +    vtpminfo->rref = val ? strtoul(val, NULL, 10) : -1;
> +
> +    vtpminfo->frontend = xs_read(ctx->xsh, XBT_NULL,
> +          GCSPRINTF("%s/frontend", vtpminfo->backend), NULL);
> +
> +    val = libxl__xs_read(gc, XBT_NULL,
> +          GCSPRINTF("%s/frontend-id", vtpminfo->backend));
> +    vtpminfo->frontend_id = val ? strtoul(val, NULL, 10) : -1;
> +
> +    val = libxl__xs_read(gc, XBT_NULL,
> +          GCSPRINTF("%s/uuid", vtpminfo->backend));
> +    if(val == NULL) {
> +       LOG(ERROR, "%s/uuid does not exist!\n", vtpminfo->backend);
> +       goto err;
> +    }
> +    if(libxl_uuid_from_string(&(vtpminfo->uuid), val)) {
> +       LOG(ERROR,
> +             "%s/uuid is a malformed uuid?? (%s) Probably a bug!\n",
> +             vtpminfo->backend, val);
> +       goto err;
> +    }
> +
> +    goto exit;
> +err:
> +    rc = ERROR_FAIL;
> +exit:
> +    GC_FREE;
> +    return rc;
> +}
> +
> +int libxl_devid_to_device_vtpm(libxl_ctx *ctx,
> +                               uint32_t domid,
> +                               int devid,
> +                               libxl_device_vtpm *vtpm)
> +{
> +    libxl_device_vtpm *vtpms;
> +    int nb, i;
> +    int rc;
> +
> +    vtpms = libxl_device_vtpm_list(ctx, domid, &nb);
> +    if (!vtpms)
> +        return ERROR_FAIL;
> +
> +    memset(vtpm, 0, sizeof (libxl_device_vtpm));
> +    rc = 1;
> +    for (i = 0; i < nb; ++i) {
> +        if(devid == vtpms[i].devid) {
> +            vtpm->backend_domid = vtpms[i].backend_domid;
> +            vtpm->devid = vtpms[i].devid;
> +            libxl_uuid_copy(&vtpm->uuid, &vtpms[i].uuid);
> +            rc = 0;
> +            break;
> +        }
> +    }
> +
> +    libxl_device_vtpm_list_free(vtpms, nb);
> +    return rc;
> +}
> +
> +
> +/******************************************************************************/
> 
>  int libxl__device_disk_setdefault(libxl__gc *gc, libxl_device_disk *disk)
>  {
> @@ -3046,6 +3283,8 @@ out:
>   * libxl_device_disk_destroy
>   * libxl_device_nic_remove
>   * libxl_device_nic_destroy
> + * libxl_device_vtpm_remove
> + * libxl_device_vtpm_destroy
>   * libxl_device_vkb_remove
>   * libxl_device_vkb_destroy
>   * libxl_device_vfb_remove
> @@ -3097,6 +3336,10 @@ DEFINE_DEVICE_REMOVE(vkb, destroy, 1)
>  DEFINE_DEVICE_REMOVE(vfb, remove, 0)
>  DEFINE_DEVICE_REMOVE(vfb, destroy, 1)
> 
> +/* vtpm */
> +DEFINE_DEVICE_REMOVE(vtpm, remove, 0)
> +DEFINE_DEVICE_REMOVE(vtpm, destroy, 1)
> +
>  #undef DEFINE_DEVICE_REMOVE
> 
>  /******************************************************************************/
> @@ -3105,6 +3348,7 @@ DEFINE_DEVICE_REMOVE(vfb, destroy, 1)
>  /* The following functions are defined:
>   * libxl_device_disk_add
>   * libxl_device_nic_add
> + * libxl_device_vtpm_add
>   */
> 
>  #define DEFINE_DEVICE_ADD(type)                                         \
> @@ -3131,6 +3375,9 @@ DEFINE_DEVICE_ADD(disk)
>  /* nic */
>  DEFINE_DEVICE_ADD(nic)
> 
> +/* vtpm */
> +DEFINE_DEVICE_ADD(vtpm)
> +
>  #undef DEFINE_DEVICE_ADD
> 
>  /******************************************************************************/
> diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
> index 7a7c419..e2ba549 100644
> --- a/tools/libxl/libxl.h
> +++ b/tools/libxl/libxl.h
> @@ -478,13 +478,14 @@ typedef struct {
>      libxl_domain_create_info c_info;
>      libxl_domain_build_info b_info;
> 
> -    int num_disks, num_nics, num_pcidevs, num_vfbs, num_vkbs;
> +    int num_disks, num_nics, num_pcidevs, num_vfbs, num_vkbs, num_vtpms;
> 
>      libxl_device_disk *disks;
>      libxl_device_nic *nics;
>      libxl_device_pci *pcidevs;
>      libxl_device_vfb *vfbs;
>      libxl_device_vkb *vkbs;
> +    libxl_device_vtpm *vtpms;
> 
>      libxl_action_on_shutdown on_poweroff;
>      libxl_action_on_shutdown on_reboot;
> @@ -645,6 +646,9 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
>                                  int *nb_vcpu, int *nr_vcpus_out);
>  void libxl_vcpuinfo_list_free(libxl_vcpuinfo *, int nr_vcpus);
> 
> +void libxl_device_vtpm_list_free(libxl_device_vtpm*, int nr_vtpms);
> +void libxl_vtpminfo_list_free(libxl_vtpminfo *, int nr_vtpms);
> +
>  /*
>   * Devices
>   * =======
> @@ -745,6 +749,23 @@ libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx, uint32_t domid, int *num
>  int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
>                                libxl_device_nic *nic, libxl_nicinfo *nicinfo);
> 
> +/* Virtual TPMs */
> +int libxl_device_vtpm_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vtpm *vtpm,
> +                          const libxl_asyncop_how *ao_how)
> +                          LIBXL_EXTERNAL_CALLERS_ONLY;
> +int libxl_device_vtpm_remove(libxl_ctx *ctx, uint32_t domid,
> +                            libxl_device_vtpm *vtpm,
> +                            const libxl_asyncop_how *ao_how)
> +                            LIBXL_EXTERNAL_CALLERS_ONLY;
> +int libxl_device_vtpm_destroy(libxl_ctx *ctx, uint32_t domid,
> +                              libxl_device_vtpm *vtpm,
> +                              const libxl_asyncop_how *ao_how)
> +                              LIBXL_EXTERNAL_CALLERS_ONLY;
> +
> +libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx, uint32_t domid, int *num);
> +int libxl_device_vtpm_getinfo(libxl_ctx *ctx, uint32_t domid,
> +                               libxl_device_vtpm *vtpm, libxl_vtpminfo *vtpminfo);
> +
>  /* Keyboard */
>  int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb,
>                           const libxl_asyncop_how *ao_how)
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index e81747b..9d20086 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -55,6 +55,8 @@ void libxl_domain_config_dispose(libxl_domain_config *d_config)
>          libxl_device_vkb_dispose(&d_config->vkbs[i]);
>      free(d_config->vkbs);
> 
> +    libxl_device_vtpm_list_free(d_config->vtpms, d_config->num_vtpms);
> +
>      libxl_domain_create_info_dispose(&d_config->c_info);
>      libxl_domain_build_info_dispose(&d_config->b_info);
>  }
> @@ -601,6 +603,8 @@ static void domcreate_bootloader_done(libxl__egc *egc,
>  static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *aodevs,
>                                  int ret);
> 
> +static void domcreate_attach_vtpms(libxl__egc *egc, libxl__multidev *multidev,
> +                                   int ret);
>  static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *aodevs,
>                                   int ret);
> 
> @@ -1085,13 +1089,13 @@ static void domcreate_devmodel_started(libxl__egc *egc,
>      if (d_config->num_nics > 0) {
>          /* Attach nics */
>          libxl__multidev_begin(ao, &dcs->multidev);
> -        dcs->multidev.callback = domcreate_attach_pci;
> +        dcs->multidev.callback = domcreate_attach_vtpms;
>          libxl__add_nics(egc, ao, domid, d_config, &dcs->multidev);
>          libxl__multidev_prepared(egc, &dcs->multidev, 0);
>          return;
>      }
> 
> -    domcreate_attach_pci(egc, &dcs->multidev, 0);
> +    domcreate_attach_vtpms(egc, &dcs->multidev, 0);
>      return;
> 
>  error_out:
> @@ -1099,6 +1103,39 @@ error_out:
>      domcreate_complete(egc, dcs, ret);
>  }
> 
> +static void domcreate_attach_vtpms(libxl__egc *egc,
> +                                   libxl__multidev *multidev,
> +                                   int ret)
> +{
> +   libxl__domain_create_state *dcs = CONTAINER_OF(multidev, *dcs, multidev);
> +   STATE_AO_GC(dcs->ao);
> +   int domid = dcs->guest_domid;
> +
> +   libxl_domain_config* const d_config = dcs->guest_config;
> +
> +   if(ret) {
> +       LOG(ERROR, "unable to add nic devices");
> +       goto error_out;
> +   }
> +
> +    /* Plug vtpm devices */
> +   if (d_config->num_vtpms > 0) {
> +       /* Attach vtpms */
> +       libxl__multidev_begin(ao, &dcs->multidev);
> +       dcs->multidev.callback = domcreate_attach_pci;
> +       libxl__add_vtpms(egc, ao, domid, d_config, &dcs->multidev);
> +       libxl__multidev_prepared(egc, &dcs->multidev, 0);
> +       return;
> +   }
> +
> +   domcreate_attach_pci(egc, multidev, 0);
> +   return;
> +
> +error_out:
> +   assert(ret);
> +   domcreate_complete(egc, dcs, ret);
> +}
> +
>  static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
>                                   int ret)
>  {
> @@ -1112,7 +1149,7 @@ static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
>      libxl_domain_config *const d_config = dcs->guest_config;
> 
>      if (ret) {
> -        LOG(ERROR, "unable to add nic devices");
> +        LOG(ERROR, "unable to add vtpm devices");
>          goto error_out;
>      }
> 
> diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
> index c3283f1..51dd06e 100644
> --- a/tools/libxl/libxl_device.c
> +++ b/tools/libxl/libxl_device.c
> @@ -497,6 +497,7 @@ void libxl__multidev_prepared(libxl__egc *egc,
>   * The following functions are defined:
>   * libxl__add_disks
>   * libxl__add_nics
> + * libxl__add_vtpms
>   */
> 
>  #define DEFINE_DEVICES_ADD(type)                                        \
> @@ -515,6 +516,7 @@ void libxl__multidev_prepared(libxl__egc *egc,
> 
>  DEFINE_DEVICES_ADD(disk)
>  DEFINE_DEVICES_ADD(nic)
> +DEFINE_DEVICES_ADD(vtpm)
> 
>  #undef DEFINE_DEVICES_ADD
> 
> diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
> index 8f220cb..cba3616 100644
> --- a/tools/libxl/libxl_internal.h
> +++ b/tools/libxl/libxl_internal.h
> @@ -958,6 +958,7 @@ _hidden int libxl__device_disk_setdefault(libxl__gc *gc,
>                                            libxl_device_disk *disk);
>  _hidden int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic,
>                                           uint32_t domid);
> +_hidden int libxl__device_vtpm_setdefault(libxl__gc *gc, libxl_device_vtpm *vtpm);
>  _hidden int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb);
>  _hidden int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb);
>  _hidden int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci);
> @@ -2007,6 +2008,10 @@ _hidden void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
>                                     libxl_device_nic *nic,
>                                     libxl__ao_device *aodev);
> 
> +_hidden void libxl__device_vtpm_add(libxl__egc *egc, uint32_t domid,
> +                                   libxl_device_vtpm *vtpm,
> +                                   libxl__ao_device *aodev);
> +
>  /* Internal function to connect a vkb device */
>  _hidden int libxl__device_vkb_add(libxl__gc *gc, uint32_t domid,
>                                    libxl_device_vkb *vkb);
> @@ -2439,6 +2444,10 @@ _hidden void libxl__add_nics(libxl__egc *egc, libxl__ao *ao, uint32_t domid,
>                               libxl_domain_config *d_config,
>                               libxl__multidev *multidev);
> 
> +_hidden void libxl__add_vtpms(libxl__egc *egc, libxl__ao *ao, uint32_t domid,
> +                             libxl_domain_config *d_config,
> +                             libxl__multidev *multidev);
> +
>  /*----- device model creation -----*/
> 
>  /* First layer; wraps libxl__spawn_spawn. */
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index de111a6..7eac4a8 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -395,6 +395,12 @@ libxl_device_pci = Struct("device_pci", [
>      ("permissive", bool),
>      ])
> 
> +libxl_device_vtpm = Struct("device_vtpm", [
> +    ("backend_domid",    libxl_domid),
> +    ("devid",            libxl_devid),
> +    ("uuid",             libxl_uuid),
> +])
> +
>  libxl_diskinfo = Struct("diskinfo", [
>      ("backend", string),
>      ("backend_id", uint32),
> @@ -418,6 +424,18 @@ libxl_nicinfo = Struct("nicinfo", [
>      ("rref_rx", integer),
>      ], dir=DIR_OUT)
> 
> +libxl_vtpminfo = Struct("vtpminfo", [
> +    ("backend", string),
> +    ("backend_id", uint32),
> +    ("frontend", string),
> +    ("frontend_id", uint32),
> +    ("devid", libxl_devid),
> +    ("state", integer),
> +    ("evtch", integer),
> +    ("rref", integer),
> +    ("uuid", libxl_uuid),
> +    ], dir=DIR_OUT)
> +
>  libxl_vcpuinfo = Struct("vcpuinfo", [
>      ("vcpuid", uint32),
>      ("cpu", uint32),
> diff --git a/tools/libxl/libxl_types_internal.idl b/tools/libxl/libxl_types_internal.idl
> index 5ac8c9c..c40120e 100644
> --- a/tools/libxl/libxl_types_internal.idl
> +++ b/tools/libxl/libxl_types_internal.idl
> @@ -19,6 +19,7 @@ libxl__device_kind = Enumeration("device_kind", [
>      (5, "VFB"),
>      (6, "VKBD"),
>      (7, "CONSOLE"),
> +    (8, "VTPM"),
>      ])
> 
>  libxl__console_backend = Enumeration("console_backend", [
> diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
> index 55cd299..8f78790 100644
> --- a/tools/libxl/libxl_utils.c
> +++ b/tools/libxl/libxl_utils.c
> @@ -463,6 +463,33 @@ int libxl_pipe(libxl_ctx *ctx, int pipes[2])
>      return 0;
>  }
> 
> +int libxl_uuid_to_device_vtpm(libxl_ctx *ctx, uint32_t domid,
> +                            libxl_uuid* uuid, libxl_device_vtpm *vtpm)
> +{
> +    libxl_device_vtpm *vtpms;
> +    int nb, i;
> +    int rc;
> +
> +    vtpms = libxl_device_vtpm_list(ctx, domid, &nb);
> +    if (!vtpms)
> +        return ERROR_FAIL;
> +
> +    memset(vtpm, 0, sizeof (libxl_device_vtpm));
> +    rc = 1;
> +    for (i = 0; i < nb; ++i) {
> +        if(!libxl_uuid_compare(uuid, &vtpms[i].uuid)) {
> +            vtpm->backend_domid = vtpms[i].backend_domid;
> +            vtpm->devid = vtpms[i].devid;
> +            libxl_uuid_copy(&vtpm->uuid, &vtpms[i].uuid);
> +            rc = 0;
> +            break;
> +        }
> +    }
> +
> +    libxl_device_vtpm_list_free(vtpms, nb);
> +    return rc;
> +}
> +
>  int libxl_mac_to_device_nic(libxl_ctx *ctx, uint32_t domid,
>                              const char *mac, libxl_device_nic *nic)
>  {
> @@ -819,6 +846,22 @@ void libxl_cpupoolinfo_list_free(libxl_cpupoolinfo *list, int nr)
>      free(list);
>  }
> 
> +void libxl_vtpminfo_list_free(libxl_vtpminfo* list, int nr)
> +{
> +   int i;
> +   for (i = 0; i < nr; i++)
> +      libxl_vtpminfo_dispose(&list[i]);
> +   free(list);
> +}
> +
> +void libxl_device_vtpm_list_free(libxl_device_vtpm* list, int nr)
> +{
> +   int i;
> +   for (i = 0; i < nr; i++)
> +      libxl_device_vtpm_dispose(&list[i]);
> +   free(list);
> +}
> +
>  int libxl_domid_valid_guest(uint32_t domid)
>  {
>      /* returns 1 if the value _could_ be a valid guest domid, 0 otherwise
> diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
> index 83aaac7..40f3f30 100644
> --- a/tools/libxl/libxl_utils.h
> +++ b/tools/libxl/libxl_utils.h
> @@ -64,6 +64,11 @@ int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid, int devid,
>  int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid, const char *vdev,
>                                 libxl_device_disk *disk);
> 
> +int libxl_uuid_to_device_vtpm(libxl_ctx *ctx, uint32_t domid,
> +                               libxl_uuid *uuid, libxl_device_vtpm *vtpm);
> +int libxl_devid_to_device_vtpm(libxl_ctx *ctx, uint32_t domid,
> +                               int devid, libxl_device_vtpm *vtpm);
> +
>  int libxl_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *bitmap, int n_bits);
>      /* Allocated bimap is from malloc, libxl_bitmap_dispose() to be
>       * called by the application when done. */
> diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
> index 0b2f848..be6f38b 100644
> --- a/tools/libxl/xl.h
> +++ b/tools/libxl/xl.h
> @@ -79,6 +79,9 @@ int main_networkdetach(int argc, char **argv);
>  int main_blockattach(int argc, char **argv);
>  int main_blocklist(int argc, char **argv);
>  int main_blockdetach(int argc, char **argv);
> +int main_vtpmattach(int argc, char **argv);
> +int main_vtpmlist(int argc, char **argv);
> +int main_vtpmdetach(int argc, char **argv);
>  int main_uptime(int argc, char **argv);
>  int main_tmem_list(int argc, char **argv);
>  int main_tmem_freeze(int argc, char **argv);
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index a43b371..65f83bd 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -573,7 +573,7 @@ static void parse_config_data(const char *config_source,
>      const char *buf;
>      long l;
>      XLU_Config *config;
> -    XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids;
> +    XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids, *vtpms;
>      XLU_ConfigList *ioports, *irqs, *iomem;
>      int num_ioports, num_irqs, num_iomem;
>      int pci_power_mgmt = 0;
> @@ -1048,6 +1048,58 @@ static void parse_config_data(const char *config_source,
>          }
>      }
> 
> +    if (!xlu_cfg_get_list(config, "vtpm", &vtpms, 0, 0)) {
> +        d_config->num_vtpms = 0;
> +        d_config->vtpms = NULL;
> +        while ((buf = xlu_cfg_get_listitem (vtpms, d_config->num_vtpms)) != NULL) {
> +            libxl_device_vtpm *vtpm;
> +            char * buf2 = strdup(buf);
> +            char *p, *p2;
> +            bool got_backend = false;
> +
> +            d_config->vtpms = (libxl_device_vtpm *) realloc(d_config->vtpms,
> +                  sizeof(libxl_device_vtpm) * (d_config->num_vtpms+1));
> +            vtpm = d_config->vtpms + d_config->num_vtpms;
> +            libxl_device_vtpm_init(vtpm);
> +            vtpm->devid = d_config->num_vtpms;
> +
> +            p = strtok(buf2, ",");
> +            if(p) {
> +               do {
> +                  while(*p == ' ')
> +                     ++p;
> +                  if ((p2 = strchr(p, '=')) == NULL)
> +                     break;
> +                  *p2 = '\0';
> +                  if (!strcmp(p, "backend")) {
> +                     if(domain_qualifier_to_domid(p2 + 1, &(vtpm->backend_domid), 0))
> +                     {
> +                        fprintf(stderr,
> +                              "Specified vtpm backend domain `%s' does not exist!\n", p2 + 1);
> +                        exit(1);
> +                     }
> +                     got_backend = true;
> +                  } else if(!strcmp(p, "uuid")) {
> +                     if( libxl_uuid_from_string(&vtpm->uuid, p2 + 1) ) {
> +                        fprintf(stderr,
> +                              "Failed to parse vtpm UUID: %s\n", p2 + 1);
> +                        exit(1);
> +                    }
> +                  } else {
> +                     fprintf(stderr, "Unknown string `%s' in vtpm spec\n", p);
> +                     exit(1);
> +                  }
> +               } while ((p = strtok(NULL, ",")) != NULL);
> +            }
> +            if(!got_backend) {
> +               fprintf(stderr, "vtpm spec missing required backend field!\n");
> +               exit(1);
> +            }
> +            free(buf2);
> +            d_config->num_vtpms++;
> +        }
> +    }
> +
>      if (!xlu_cfg_get_list (config, "vif", &nics, 0, 0)) {
>          d_config->num_nics = 0;
>          d_config->nics = NULL;
> @@ -1073,7 +1125,7 @@ static void parse_config_data(const char *config_source,
> 
>              p = strtok(buf2, ",");
>              if (!p)
> -                goto skip;
> +                goto skip_nic;
>              do {
>                  while (*p == ' ')
>                      p++;
> @@ -1137,7 +1189,7 @@ static void parse_config_data(const char *config_source,
>                      fprintf(stderr, "the accel parameter for vifs is currently not supported\n");
>                  }
>              } while ((p = strtok(NULL, ",")) != NULL);
> -skip:
> +skip_nic:
>              free(buf2);
>              d_config->num_nics++;
>          }
> @@ -5634,6 +5686,132 @@ int main_blockdetach(int argc, char **argv)
>      return rc;
>  }
> 
> +int main_vtpmattach(int argc, char **argv)
> +{
> +    int opt;
> +    libxl_device_vtpm vtpm;
> +    char *oparg;
> +    unsigned int val;
> +    uint32_t domid;
> +
> +    if ((opt = def_getopt(argc, argv, "", "vtpm-attach", 1)) != -1)
> +        return opt;
> +
> +    if (domain_qualifier_to_domid(argv[optind], &domid, 0) < 0) {
> +        fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
> +        return 1;
> +    }
> +    ++optind;
> +
> +    libxl_device_vtpm_init(&vtpm);
> +    for (argv += optind, argc -= optind; argc > 0; ++argv, --argc) {
> +        if (MATCH_OPTION("uuid", *argv, oparg)) {
> +            if(libxl_uuid_from_string(&(vtpm.uuid), oparg)) {
> +                fprintf(stderr, "Invalid uuid specified (%s)\n", oparg);
> +                return 1;
> +            }
> +        } else if (MATCH_OPTION("backend", *argv, oparg)) {
> +            if(domain_qualifier_to_domid(oparg, &val, 0)) {
> +                fprintf(stderr,
> +                      "Specified backend domain does not exist, defaulting to Dom0\n");
> +                val = 0;
> +            }
> +            vtpm.backend_domid = val;
> +        } else {
> +            fprintf(stderr, "unrecognized argument `%s'\n", *argv);
> +            return 1;
> +        }
> +    }
> +
> +    if(dryrun_only) {
> +       char* json = libxl_device_vtpm_to_json(ctx, &vtpm);
> +       printf("vtpm: %s\n", json);
> +       free(json);
> +       libxl_device_vtpm_dispose(&vtpm);
> +       if (ferror(stdout) || fflush(stdout)) { perror("stdout"); exit(-1); }
> +       return 0;
> +    }
> +
> +    if (libxl_device_vtpm_add(ctx, domid, &vtpm, 0)) {
> +        fprintf(stderr, "libxl_device_vtpm_add failed.\n");
> +        return 1;
> +    }
> +    libxl_device_vtpm_dispose(&vtpm);
> +    return 0;
> +}
> +
> +int main_vtpmlist(int argc, char **argv)
> +{
> +    int opt;
> +    libxl_device_vtpm *vtpms;
> +    libxl_vtpminfo vtpminfo;
> +    int nb, i;
> +
> +    if ((opt = def_getopt(argc, argv, "", "vtpm-list", 1)) != -1)
> +        return opt;
> +
> +    /*      Idx  BE   UUID   Hdl  Sta  evch rref  BE-path */
> +    printf("%-3s %-2s %-36s %-6s %-5s %-6s %-5s %-10s\n",
> +           "Idx", "BE", "Uuid", "handle", "state", "evt-ch", "ring-ref", "BE-path");
> +    for (argv += optind, argc -= optind; argc > 0; --argc, ++argv) {
> +        uint32_t domid;
> +        if (domain_qualifier_to_domid(*argv, &domid, 0) < 0) {
> +            fprintf(stderr, "%s is an invalid domain identifier\n", *argv);
> +            continue;
> +        }
> +        if (!(vtpms = libxl_device_vtpm_list(ctx, domid, &nb))) {
> +            continue;
> +        }
> +        for (i = 0; i < nb; ++i) {
> +           if(!libxl_device_vtpm_getinfo(ctx, domid, &vtpms[i], &vtpminfo)) {
> +              /*      Idx  BE     UUID             Hdl Sta evch rref BE-path*/
> +              printf("%-3d %-2d " LIBXL_UUID_FMT " %6d %5d %6d %8d %-30s\n",
> +                    vtpminfo.devid, vtpminfo.backend_id,
> +                    LIBXL_UUID_BYTES(vtpminfo.uuid),
> +                    vtpminfo.devid, vtpminfo.state, vtpminfo.evtch,
> +                    vtpminfo.rref, vtpminfo.backend);
> +
> +              libxl_vtpminfo_dispose(&vtpminfo);
> +           }
> +           libxl_device_vtpm_dispose(&vtpms[i]);
> +        }
> +        free(vtpms);
> +    }
> +    return 0;
> +}
> +
> +int main_vtpmdetach(int argc, char **argv)
> +{
> +    uint32_t domid;
> +    int opt, rc=0;
> +    libxl_device_vtpm vtpm;
> +    libxl_uuid uuid;
> +
> +    if ((opt = def_getopt(argc, argv, "", "vtpm-detach", 2)) != -1)
> +        return opt;
> +
> +    domid = find_domain(argv[optind]);
> +
> +    if ( libxl_uuid_from_string(&uuid, argv[optind+1])) {
> +        if (libxl_devid_to_device_vtpm(ctx, domid, atoi(argv[optind+1]), &vtpm)) {
> +            fprintf(stderr, "Unknown device %s.\n", argv[optind+1]);
> +            return 1;
> +        }
> +    } else {
> +        if (libxl_uuid_to_device_vtpm(ctx, domid, &uuid, &vtpm)) {
> +            fprintf(stderr, "Unknown device %s.\n", argv[optind+1]);
> +            return 1;
> +        }
> +    }
> +    rc = libxl_device_vtpm_remove(ctx, domid, &vtpm, 0);
> +    if (rc) {
> +        fprintf(stderr, "libxl_device_vtpm_remove failed.\n");
> +    }
> +    libxl_device_vtpm_dispose(&vtpm);
> +    return rc;
> +}
> +
> +
>  static char *uptime_to_string(unsigned long uptime, int short_mode)
>  {
>      int sec, min, hour, day;
> diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
> index d3a215d..ac58642 100644
> --- a/tools/libxl/xl_cmdtable.c
> +++ b/tools/libxl/xl_cmdtable.c
> @@ -341,6 +341,21 @@ struct cmd_spec cmd_table[] = {
>        "Destroy a domain's virtual block device",
>        "<Domain> <DevId>",
>      },
> +    { "vtpm-attach",
> +      &main_vtpmattach, 1, 1,
> +      "Create a new virtual TPM device",
> +      "<Domain> [uuid=<uuid>] [backend=<BackDomain>]",
> +    },
> +    { "vtpm-list",
> +      &main_vtpmlist, 0, 0,
> +      "List virtual TPM devices for a domain",
> +      "<Domain(s)>",
> +    },
> +    { "vtpm-detach",
> +      &main_vtpmdetach, 0, 1,
> +      "Destroy a domain's virtual TPM device",
> +      "<Domain> <DevId|uuid>",
> +    },
>      { "uptime",
>        &main_uptime, 0, 0,
>        "Print uptime for all/some domains",
> --
> 1.7.10.4
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:49:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:49:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYE3r-0004T7-DU; Tue, 13 Nov 2012 10:49:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TYE3p-0004Sl-Rc
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:49:42 +0000
Received: from [85.158.138.51:33055] by server-12.bemta-3.messagelabs.com id
	19/AA-22757-5C522A05; Tue, 13 Nov 2012 10:49:41 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352803780!21730856!1
X-Originating-IP: [91.199.104.2]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5307 invoked from network); 13 Nov 2012 10:49:40 -0000
Received: from mail.bitdefender.com (HELO mail.bitdefender.com) (91.199.104.2)
	by server-3.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 10:49:40 -0000
Received: (qmail 27313 invoked from network); 13 Nov 2012 12:49:38 +0200
Received: from rcojocaru.dsd.ro (HELO ?10.10.14.59?)
	(rcojocaru@bitdefender.com@10.10.14.59)
	by mail.bitdefender.com with AES256-SHA encrypted SMTP;
	13 Nov 2012 12:49:38 +0200
Message-ID: <50A225CA.2080705@gmail.com>
Date: Tue, 13 Nov 2012 12:49:46 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <50A16639.2090209@gmail.com>
	<1352800791.7491.21.camel@zakaz.uk.xensource.com>
	<50A22044.6060608@gmail.com>
	<1352802973.7491.40.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352802973.7491.40.camel@zakaz.uk.xensource.com>
X-BitDefender-Spam: No (0)
X-BitDefender-SpamStamp: Build: [Engines: 2.13.3.14894, Dats: 226275,
	Stamp: 3], Multi: [Enabled], BW: [Enabled], RBL DNSBL: [Disabled],
	APM: [Enabled, Score: 500, Flags: NN_GMAIL_WITH_XMAILER_ADN;
	NN_LEGIT_VALID_REPLY; NN_NO_LINK_NMD;
	NN_EXEC_H_YAHOO_AND_GMAIL_NO_DOMAIN_KEY; NN_LEGIT_S_SQARE_BRACKETS;
	NN_LEGIT_MAILING_LIST_TO], SGN: [Enabled], URL: [Enabled], URI DNSBL:
	[Disabled], SQMD: [Enabled, Hits: none, MD5:
	ac99bdfe8c2928be4e953c5e206af251.fuzzy.fzrbl.org], RTDA: [Disabled,
	Hit: No], total: 0(775)
X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.0 on
	elfie.dsd.hq, sigver: 7.43988
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>> OK, my immediate end-goal is real-time logging of hypervisor events via
>> a dom0 userspace application. These events are always about a currently
>> running virtual machine, and said virtual machine is paused at the time.
>> The userspace tool should be immediately notified, so no polling.
>
> This is very like the ioreq model, where the domain (or maybe just the
> vcpu, I'm not sure) is paused while qemu does its thing.
>
> What sort of events are we talking about here?

A list of interesting registers that changed, that a page fault occured, 
things like that, occasionally containing some small string messages 
with extra information. Should be around 64 bytes or so.

> The right thing to do here is for the userspace tool to communicate with
> the toolstack (by whatever means) rather the hypervisor in order to
> control the domains.

That's what I was thinking too.

> You might also find some inspiration for this sort of model in the
> xenpaging and memshare code.

Will look those things up, I appreciate the replies.

Thanks,
Razvan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:49:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:49:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYE3r-0004T7-DU; Tue, 13 Nov 2012 10:49:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TYE3p-0004Sl-Rc
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:49:42 +0000
Received: from [85.158.138.51:33055] by server-12.bemta-3.messagelabs.com id
	19/AA-22757-5C522A05; Tue, 13 Nov 2012 10:49:41 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352803780!21730856!1
X-Originating-IP: [91.199.104.2]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5307 invoked from network); 13 Nov 2012 10:49:40 -0000
Received: from mail.bitdefender.com (HELO mail.bitdefender.com) (91.199.104.2)
	by server-3.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 10:49:40 -0000
Received: (qmail 27313 invoked from network); 13 Nov 2012 12:49:38 +0200
Received: from rcojocaru.dsd.ro (HELO ?10.10.14.59?)
	(rcojocaru@bitdefender.com@10.10.14.59)
	by mail.bitdefender.com with AES256-SHA encrypted SMTP;
	13 Nov 2012 12:49:38 +0200
Message-ID: <50A225CA.2080705@gmail.com>
Date: Tue, 13 Nov 2012 12:49:46 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <50A16639.2090209@gmail.com>
	<1352800791.7491.21.camel@zakaz.uk.xensource.com>
	<50A22044.6060608@gmail.com>
	<1352802973.7491.40.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352802973.7491.40.camel@zakaz.uk.xensource.com>
X-BitDefender-Spam: No (0)
X-BitDefender-SpamStamp: Build: [Engines: 2.13.3.14894, Dats: 226275,
	Stamp: 3], Multi: [Enabled], BW: [Enabled], RBL DNSBL: [Disabled],
	APM: [Enabled, Score: 500, Flags: NN_GMAIL_WITH_XMAILER_ADN;
	NN_LEGIT_VALID_REPLY; NN_NO_LINK_NMD;
	NN_EXEC_H_YAHOO_AND_GMAIL_NO_DOMAIN_KEY; NN_LEGIT_S_SQARE_BRACKETS;
	NN_LEGIT_MAILING_LIST_TO], SGN: [Enabled], URL: [Enabled], URI DNSBL:
	[Disabled], SQMD: [Enabled, Hits: none, MD5:
	ac99bdfe8c2928be4e953c5e206af251.fuzzy.fzrbl.org], RTDA: [Disabled,
	Hit: No], total: 0(775)
X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.0 on
	elfie.dsd.hq, sigver: 7.43988
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>> OK, my immediate end-goal is real-time logging of hypervisor events via
>> a dom0 userspace application. These events are always about a currently
>> running virtual machine, and said virtual machine is paused at the time.
>> The userspace tool should be immediately notified, so no polling.
>
> This is very like the ioreq model, where the domain (or maybe just the
> vcpu, I'm not sure) is paused while qemu does its thing.
>
> What sort of events are we talking about here?

A list of interesting registers that changed, that a page fault occured, 
things like that, occasionally containing some small string messages 
with extra information. Should be around 64 bytes or so.

> The right thing to do here is for the userspace tool to communicate with
> the toolstack (by whatever means) rather the hypervisor in order to
> control the domains.

That's what I was thinking too.

> You might also find some inspiration for this sort of model in the
> xenpaging and memshare code.

Will look those things up, I appreciate the replies.

Thanks,
Razvan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:51:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:51:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYE55-0004gE-T2; Tue, 13 Nov 2012 10:50:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYE54-0004g1-MY
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:50:59 +0000
Received: from [85.158.139.211:40963] by server-10.bemta-5.messagelabs.com id
	68/AE-09257-11622A05; Tue, 13 Nov 2012 10:50:57 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1352803856!19963327!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25370 invoked from network); 13 Nov 2012 10:50:56 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:50:56 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15773658"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:50:56 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:50:55 +0000
Message-ID: <1352803854.7491.48.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Tue, 13 Nov 2012 10:50:54 +0000
In-Reply-To: <1351802150-19258-4-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1351802150-19258-4-git-send-email-matthew.fioravante@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 9/9] vtpm/vtpmmgr and required libs to
 stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-01 at 20:35 +0000, Matthew Fioravante wrote:
> Add 3 new libraries to stubdom:
> libgmp
> polarssl
> Berlios TPM Emulator 0.7.4
> 
> Also adds makefile structure for vtpm-stubdom and vtpmmgrdom
> 
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

Patch 7, 8 & 9 all:
Acked-by: Ian Campbell <ian.campbell@citrix.com>

(I must confess I did not review in detail, but it is all self contained
and has an active maintainer...)

However rather than apply straight away I have downloaded these three
files:
ftp://ftp.gmplib.org/pub/gmp-4.3.2/gmp-4.3.2.tar.bz2
http://polarssl.org/code/releases/polarssl-1.1.4-gpl.tgz
http://download.berlios.de/tpm-emulator/tpm_emulator-0.7.4.tar.gz
with checksums:
$ sha256sum gmp-4.3.2.tar.bz2 polarssl-1.1.4-gpl.tgz tpm_emulator-0.7.4.tar.gz
936162c0312886c21581002b79932829aa048cfaf9937c6265aeaa14f1cd1775  gmp-4.3.2.tar.bz2
2d29fd04a0d0ba29dae6bd29fb418944c08d3916665dcca74afb297ef37584b6  polarssl-1.1.4-gpl.tgz
4e48ea0d83dd9441cc1af04ab18cd6c961b9fa54d5cbf2c2feee038988dea459  tpm_emulator-0.7.4.tar.gz
$
and placed them at the $(XEN_EXTFILES_URL).

Please could you confirm that these are correct and respin to use
XEN_EXTFILES_URL?

> 
> diff --git a/stubdom/Makefile b/stubdom/Makefile
> index 50ba360..96801b2 100644
> --- a/stubdom/Makefile
> +++ b/stubdom/Makefile
> @@ -31,6 +31,18 @@ GRUB_VERSION=0.97
>  OCAML_URL?=http://caml.inria.fr/pub/distrib/ocaml-3.11
>  OCAML_VERSION=3.11.0
>  
> +GMP_VERSION=4.3.2
> +#GMP_URL?=$(XEN_EXTFILES_URL)
> +GMP_URL?=ftp://ftp.gmplib.org/pub/gmp-$(GMP_VERSION)

This is a 2010 release -- any plans to upgrade to the more recent 5.x
stream?



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:51:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:51:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYE55-0004gE-T2; Tue, 13 Nov 2012 10:50:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYE54-0004g1-MY
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:50:59 +0000
Received: from [85.158.139.211:40963] by server-10.bemta-5.messagelabs.com id
	68/AE-09257-11622A05; Tue, 13 Nov 2012 10:50:57 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1352803856!19963327!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25370 invoked from network); 13 Nov 2012 10:50:56 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:50:56 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15773658"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:50:56 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:50:55 +0000
Message-ID: <1352803854.7491.48.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Tue, 13 Nov 2012 10:50:54 +0000
In-Reply-To: <1351802150-19258-4-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1351802150-19258-4-git-send-email-matthew.fioravante@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 9/9] vtpm/vtpmmgr and required libs to
 stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-01 at 20:35 +0000, Matthew Fioravante wrote:
> Add 3 new libraries to stubdom:
> libgmp
> polarssl
> Berlios TPM Emulator 0.7.4
> 
> Also adds makefile structure for vtpm-stubdom and vtpmmgrdom
> 
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

Patch 7, 8 & 9 all:
Acked-by: Ian Campbell <ian.campbell@citrix.com>

(I must confess I did not review in detail, but it is all self contained
and has an active maintainer...)

However rather than apply straight away I have downloaded these three
files:
ftp://ftp.gmplib.org/pub/gmp-4.3.2/gmp-4.3.2.tar.bz2
http://polarssl.org/code/releases/polarssl-1.1.4-gpl.tgz
http://download.berlios.de/tpm-emulator/tpm_emulator-0.7.4.tar.gz
with checksums:
$ sha256sum gmp-4.3.2.tar.bz2 polarssl-1.1.4-gpl.tgz tpm_emulator-0.7.4.tar.gz
936162c0312886c21581002b79932829aa048cfaf9937c6265aeaa14f1cd1775  gmp-4.3.2.tar.bz2
2d29fd04a0d0ba29dae6bd29fb418944c08d3916665dcca74afb297ef37584b6  polarssl-1.1.4-gpl.tgz
4e48ea0d83dd9441cc1af04ab18cd6c961b9fa54d5cbf2c2feee038988dea459  tpm_emulator-0.7.4.tar.gz
$
and placed them at the $(XEN_EXTFILES_URL).

Please could you confirm that these are correct and respin to use
XEN_EXTFILES_URL?

> 
> diff --git a/stubdom/Makefile b/stubdom/Makefile
> index 50ba360..96801b2 100644
> --- a/stubdom/Makefile
> +++ b/stubdom/Makefile
> @@ -31,6 +31,18 @@ GRUB_VERSION=0.97
>  OCAML_URL?=http://caml.inria.fr/pub/distrib/ocaml-3.11
>  OCAML_VERSION=3.11.0
>  
> +GMP_VERSION=4.3.2
> +#GMP_URL?=$(XEN_EXTFILES_URL)
> +GMP_URL?=ftp://ftp.gmplib.org/pub/gmp-$(GMP_VERSION)

This is a 2010 release -- any plans to upgrade to the more recent 5.x
stream?



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:57:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:57:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEAz-00057O-1T; Tue, 13 Nov 2012 10:57:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYEAx-00057J-Np
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 10:57:03 +0000
Received: from [85.158.138.51:64451] by server-14.bemta-3.messagelabs.com id
	21/5A-12788-A7722A05; Tue, 13 Nov 2012 10:56:58 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1352804216!20930200!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16349 invoked from network); 13 Nov 2012 10:56:58 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:56:58 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="214302706"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:56:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 05:56:56 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYEAp-0003uK-VI;
	Tue, 13 Nov 2012 10:56:55 +0000
Date: Tue, 13 Nov 2012 10:56:23 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Paolo Bonzini <pbonzini@redhat.com>
In-Reply-To: <50A2250A.4070108@redhat.com>
Message-ID: <alpine.DEB.2.02.1211131054200.28049@kaball.uk.xensource.com>
References: <50A0E79F0200009100082E4C@novprvoes0310.provo.novell.com>
	<50A2250A.4070108@redhat.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Charles Arnold <carnold@suse.com>, Kevin Wolf <kwolf@redhat.com>,
	thanos.makatos@citrix.com, xen-devel@lists.xensource.com,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"stefanha@redhat.com" <stefanha@redhat.com>
Subject: Re: [Xen-devel] [PATCH] block: vpc support for ~2 TB disks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 13 Nov 2012, Paolo Bonzini wrote:
> Il 12/11/2012 20:12, Charles Arnold ha scritto:
> > Ping?
> > 
> > Any thoughts on whether this is acceptable?
> 
> I would like to know what is done by other platforms.  Stefano, any idea
> about XenServer?
> 

I am not sure, but maybe Thanos, that is working on blktap3, knows, or
at least knows who to CC.



> > - Charles
> > 
> >>>> On 10/30/2012 at 08:59 PM, in message <50A0E561.5B74.0091.0@suse.com>, Charles
> > Arnold wrote: 
> >> The VHD specification allows for up to a 2 TB disk size. The current
> >> implementation in qemu emulates EIDE and ATA-2 hardware which only allows
> >> for up to 127 GB.  This disk size limitation can be overridden by allowing
> >> up to 255 heads instead of the normal 4 bit limitation of 16.  Doing so
> >> allows disk images to be created of up to nearly 2 TB.  This change does
> >> not violate the VHD format specification nor does it change how smaller
> >> disks (ie, <=127GB) are defined. 
> >>
> >> Signed-off-by: Charles Arnold <carnold@suse.com>
> >>
> >> diff --git a/block/vpc.c b/block/vpc.c
> >> index b6bf52f..0c2eaf8 100644
> >> --- a/block/vpc.c
> >> +++ b/block/vpc.c
> >> @@ -198,7 +198,8 @@ static int vpc_open(BlockDriverState *bs, int flags)
> >>      bs->total_sectors = (int64_t)
> >>          be16_to_cpu(footer->cyls) * footer->heads * footer->secs_per_cyl;
> >>  
> >> -    if (bs->total_sectors >= 65535 * 16 * 255) {
> >> +    /* Allow a maximum disk size of approximately 2 TB */
> >> +    if (bs->total_sectors >= 65535LL * 255 * 255) {qemu-devel@nongnu.org
> >>          err = -EFBIG;
> >>          goto fail;
> >>      }
> >> @@ -524,19 +525,27 @@ static coroutine_fn int vpc_co_write(BlockDriverState 
> >> *bs, int64_t sector_num,
> >>   * Note that the geometry doesn't always exactly match total_sectors but
> >>   * may round it down.
> >>   *
> >> - * Returns 0 on success, -EFBIG if the size is larger than 127 GB
> >> + * Returns 0 on success, -EFBIG if the size is larger than ~2 TB. Override
> >> + * the hardware EIDE and ATA-2 limit of 16 heads (max disk size of 127 GB)
> >> + * and instead allow up to 255 heads.
> >>   */
> >>  static int calculate_geometry(int64_t total_sectors, uint16_t* cyls,
> >>      uint8_t* heads, uint8_t* secs_per_cyl)
> >>  {
> >>      uint32_t cyls_times_heads;
> >>  
> >> -    if (total_sectors > 65535 * 16 * 255)
> >> +    /* Allow a maximum disk size of approximately 2 TB */
> >> +    if (total_sectors > 65535LL * 255 * 255) {
> >>          return -EFBIG;
> >> +    }
> >>  
> >>      if (total_sectors > 65535 * 16 * 63) {
> >>          *secs_per_cyl = 255;
> >> -        *heads = 16;
> >> +        if (total_sectors > 65535 * 16 * 255) {
> >> +            *heads = 255;
> >> +        } else {
> >> +            *heads = 16;
> >> +        }
> >>          cyls_times_heads = total_sectors / *secs_per_cyl;
> >>      } else {
> >>          *secs_per_cyl = 17;
> > 
> > 
> > 
> > 
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:57:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:57:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEAz-00057O-1T; Tue, 13 Nov 2012 10:57:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYEAx-00057J-Np
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 10:57:03 +0000
Received: from [85.158.138.51:64451] by server-14.bemta-3.messagelabs.com id
	21/5A-12788-A7722A05; Tue, 13 Nov 2012 10:56:58 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1352804216!20930200!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16349 invoked from network); 13 Nov 2012 10:56:58 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:56:58 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="214302706"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:56:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 05:56:56 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYEAp-0003uK-VI;
	Tue, 13 Nov 2012 10:56:55 +0000
Date: Tue, 13 Nov 2012 10:56:23 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Paolo Bonzini <pbonzini@redhat.com>
In-Reply-To: <50A2250A.4070108@redhat.com>
Message-ID: <alpine.DEB.2.02.1211131054200.28049@kaball.uk.xensource.com>
References: <50A0E79F0200009100082E4C@novprvoes0310.provo.novell.com>
	<50A2250A.4070108@redhat.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Charles Arnold <carnold@suse.com>, Kevin Wolf <kwolf@redhat.com>,
	thanos.makatos@citrix.com, xen-devel@lists.xensource.com,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"stefanha@redhat.com" <stefanha@redhat.com>
Subject: Re: [Xen-devel] [PATCH] block: vpc support for ~2 TB disks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 13 Nov 2012, Paolo Bonzini wrote:
> Il 12/11/2012 20:12, Charles Arnold ha scritto:
> > Ping?
> > 
> > Any thoughts on whether this is acceptable?
> 
> I would like to know what is done by other platforms.  Stefano, any idea
> about XenServer?
> 

I am not sure, but maybe Thanos, that is working on blktap3, knows, or
at least knows who to CC.



> > - Charles
> > 
> >>>> On 10/30/2012 at 08:59 PM, in message <50A0E561.5B74.0091.0@suse.com>, Charles
> > Arnold wrote: 
> >> The VHD specification allows for up to a 2 TB disk size. The current
> >> implementation in qemu emulates EIDE and ATA-2 hardware which only allows
> >> for up to 127 GB.  This disk size limitation can be overridden by allowing
> >> up to 255 heads instead of the normal 4 bit limitation of 16.  Doing so
> >> allows disk images to be created of up to nearly 2 TB.  This change does
> >> not violate the VHD format specification nor does it change how smaller
> >> disks (ie, <=127GB) are defined. 
> >>
> >> Signed-off-by: Charles Arnold <carnold@suse.com>
> >>
> >> diff --git a/block/vpc.c b/block/vpc.c
> >> index b6bf52f..0c2eaf8 100644
> >> --- a/block/vpc.c
> >> +++ b/block/vpc.c
> >> @@ -198,7 +198,8 @@ static int vpc_open(BlockDriverState *bs, int flags)
> >>      bs->total_sectors = (int64_t)
> >>          be16_to_cpu(footer->cyls) * footer->heads * footer->secs_per_cyl;
> >>  
> >> -    if (bs->total_sectors >= 65535 * 16 * 255) {
> >> +    /* Allow a maximum disk size of approximately 2 TB */
> >> +    if (bs->total_sectors >= 65535LL * 255 * 255) {qemu-devel@nongnu.org
> >>          err = -EFBIG;
> >>          goto fail;
> >>      }
> >> @@ -524,19 +525,27 @@ static coroutine_fn int vpc_co_write(BlockDriverState 
> >> *bs, int64_t sector_num,
> >>   * Note that the geometry doesn't always exactly match total_sectors but
> >>   * may round it down.
> >>   *
> >> - * Returns 0 on success, -EFBIG if the size is larger than 127 GB
> >> + * Returns 0 on success, -EFBIG if the size is larger than ~2 TB. Override
> >> + * the hardware EIDE and ATA-2 limit of 16 heads (max disk size of 127 GB)
> >> + * and instead allow up to 255 heads.
> >>   */
> >>  static int calculate_geometry(int64_t total_sectors, uint16_t* cyls,
> >>      uint8_t* heads, uint8_t* secs_per_cyl)
> >>  {
> >>      uint32_t cyls_times_heads;
> >>  
> >> -    if (total_sectors > 65535 * 16 * 255)
> >> +    /* Allow a maximum disk size of approximately 2 TB */
> >> +    if (total_sectors > 65535LL * 255 * 255) {
> >>          return -EFBIG;
> >> +    }
> >>  
> >>      if (total_sectors > 65535 * 16 * 63) {
> >>          *secs_per_cyl = 255;
> >> -        *heads = 16;
> >> +        if (total_sectors > 65535 * 16 * 255) {
> >> +            *heads = 255;
> >> +        } else {
> >> +            *heads = 16;
> >> +        }
> >>          cyls_times_heads = total_sectors / *secs_per_cyl;
> >>      } else {
> >>          *secs_per_cyl = 17;
> > 
> > 
> > 
> > 
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:58:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:58:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYECC-0005CU-Gj; Tue, 13 Nov 2012 10:58:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TYECB-0005CL-78
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:58:19 +0000
Received: from [193.109.254.147:33010] by server-3.bemta-14.messagelabs.com id
	97/05-01317-AC722A05; Tue, 13 Nov 2012 10:58:18 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1352804297!8911043!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1000 invoked from network); 13 Nov 2012 10:58:18 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:58:18 -0000
Received: by mail-wg0-f51.google.com with SMTP id ed3so3372726wgb.32
	for <xen-devel@lists.xen.org>; Tue, 13 Nov 2012 02:58:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=NTgnlOOApjcOu6ynVWRZ/dIDScM18FVziu96F7G8e2w=;
	b=jLlaypHDvKNpkwNcloYKYMoOA/ADMN8jCdR3TkzI4fR+6+01vw678DEao4OievN5Hd
	YFi2HtznZY+D6nX5QHaRBqVv8K0/TqZWXKAWYSH/UsCo/iaTjwJRV0TwefLlnkmUYMKX
	7zoEiT+pOkhU3QfZMJes307RDBhLythMVSz8qWYkP61X1THNApNeOYe9g7rA4CBvQZeI
	77opWR2oRpq0kEUZeLpm96DBiVY3Jx+A7drKnu3faT71kOcjTQtdflByNXhUJRGKABlH
	pc9JEM9dF9cZ+06l/tQ7O2FO3D7lH/lB5Pm8PDz99nv3MBLYODgm36dEiXH9hNcQWvjd
	JkvQ==
Received: by 10.216.30.76 with SMTP id j54mr72365wea.11.1352804297098;
	Tue, 13 Nov 2012 02:58:17 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id gk9sm18324626wib.4.2012.11.13.02.58.14
	(version=SSLv3 cipher=OTHER); Tue, 13 Nov 2012 02:58:16 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Tue, 13 Nov 2012 10:58:12 +0000
From: Keir Fraser <keir@xen.org>
To: Matthew Daley <mattjd@gmail.com>,
	<JBeulich@suse.com>
Message-ID: <CCC7D844.5209E%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] xen: Fix xenctl_cpumap_to_cpumask buffer
	size check
Thread-Index: Ac3BjcX/rN9pMum9Ikqv6SvyR9c2YQ==
In-Reply-To: <1352801866-9512-1-git-send-email-mattjd@gmail.com>
Mime-version: 1.0
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: Fix xenctl_cpumap_to_cpumask buffer
 size check
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 13/11/2012 10:17, "Matthew Daley" <mattjd@gmail.com> wrote:

> xenctl_cpumap_to_cpumask incorrectly uses sizeof when checking whether
> bits should be masked off from the input cpumap bitmap or not.
> 
> Fix and make clearer by simply comparing the amount of bytes given in
> the input cpumap to the amount actually copied; if equal, bits may need
> to be masked off.
> 
> This does not have security impact: _xmalloc never returns allocations
> smaller than the size of a pointer, hence the uncorrected buffer size
> check would still not allow writes to unallocated memory.
> 
> Signed-off-by: Matthew Daley <mattjd@gmail.com>

Acked-by: Keir Fraser <keir@xen.org>

> ---
> Jan: Agreed with both of your points. Here's a v2.
> 
> diff --git a/xen/common/domctl.c b/xen/common/domctl.c
> index e153cb4..a7a6b9f 100644
> --- a/xen/common/domctl.c
> +++ b/xen/common/domctl.c
> @@ -78,7 +78,7 @@ int xenctl_cpumap_to_cpumask(
>      {
>          if ( copy_from_guest(bytemap, xenctl_cpumap->bitmap, copy_bytes) )
>              err = -EFAULT;
> -        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <= sizeof(bytemap))
> )
> +        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes == copy_bytes) )
>              bytemap[guest_bytes-1] &= ~(0xff << (xenctl_cpumap->nr_cpus &
> 7));
>      }
>  



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 10:58:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 10:58:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYECC-0005CU-Gj; Tue, 13 Nov 2012 10:58:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TYECB-0005CL-78
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:58:19 +0000
Received: from [193.109.254.147:33010] by server-3.bemta-14.messagelabs.com id
	97/05-01317-AC722A05; Tue, 13 Nov 2012 10:58:18 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1352804297!8911043!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1000 invoked from network); 13 Nov 2012 10:58:18 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:58:18 -0000
Received: by mail-wg0-f51.google.com with SMTP id ed3so3372726wgb.32
	for <xen-devel@lists.xen.org>; Tue, 13 Nov 2012 02:58:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=NTgnlOOApjcOu6ynVWRZ/dIDScM18FVziu96F7G8e2w=;
	b=jLlaypHDvKNpkwNcloYKYMoOA/ADMN8jCdR3TkzI4fR+6+01vw678DEao4OievN5Hd
	YFi2HtznZY+D6nX5QHaRBqVv8K0/TqZWXKAWYSH/UsCo/iaTjwJRV0TwefLlnkmUYMKX
	7zoEiT+pOkhU3QfZMJes307RDBhLythMVSz8qWYkP61X1THNApNeOYe9g7rA4CBvQZeI
	77opWR2oRpq0kEUZeLpm96DBiVY3Jx+A7drKnu3faT71kOcjTQtdflByNXhUJRGKABlH
	pc9JEM9dF9cZ+06l/tQ7O2FO3D7lH/lB5Pm8PDz99nv3MBLYODgm36dEiXH9hNcQWvjd
	JkvQ==
Received: by 10.216.30.76 with SMTP id j54mr72365wea.11.1352804297098;
	Tue, 13 Nov 2012 02:58:17 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id gk9sm18324626wib.4.2012.11.13.02.58.14
	(version=SSLv3 cipher=OTHER); Tue, 13 Nov 2012 02:58:16 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Tue, 13 Nov 2012 10:58:12 +0000
From: Keir Fraser <keir@xen.org>
To: Matthew Daley <mattjd@gmail.com>,
	<JBeulich@suse.com>
Message-ID: <CCC7D844.5209E%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] xen: Fix xenctl_cpumap_to_cpumask buffer
	size check
Thread-Index: Ac3BjcX/rN9pMum9Ikqv6SvyR9c2YQ==
In-Reply-To: <1352801866-9512-1-git-send-email-mattjd@gmail.com>
Mime-version: 1.0
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: Fix xenctl_cpumap_to_cpumask buffer
 size check
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 13/11/2012 10:17, "Matthew Daley" <mattjd@gmail.com> wrote:

> xenctl_cpumap_to_cpumask incorrectly uses sizeof when checking whether
> bits should be masked off from the input cpumap bitmap or not.
> 
> Fix and make clearer by simply comparing the amount of bytes given in
> the input cpumap to the amount actually copied; if equal, bits may need
> to be masked off.
> 
> This does not have security impact: _xmalloc never returns allocations
> smaller than the size of a pointer, hence the uncorrected buffer size
> check would still not allow writes to unallocated memory.
> 
> Signed-off-by: Matthew Daley <mattjd@gmail.com>

Acked-by: Keir Fraser <keir@xen.org>

> ---
> Jan: Agreed with both of your points. Here's a v2.
> 
> diff --git a/xen/common/domctl.c b/xen/common/domctl.c
> index e153cb4..a7a6b9f 100644
> --- a/xen/common/domctl.c
> +++ b/xen/common/domctl.c
> @@ -78,7 +78,7 @@ int xenctl_cpumap_to_cpumask(
>      {
>          if ( copy_from_guest(bytemap, xenctl_cpumap->bitmap, copy_bytes) )
>              err = -EFAULT;
> -        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes <= sizeof(bytemap))
> )
> +        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes == copy_bytes) )
>              bytemap[guest_bytes-1] &= ~(0xff << (xenctl_cpumap->nr_cpus &
> 7));
>      }
>  



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:08:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:08:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEM7-0005Wf-Af; Tue, 13 Nov 2012 11:08:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYEM5-0005Wa-HP
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 11:08:33 +0000
Received: from [193.109.254.147:39498] by server-5.bemta-14.messagelabs.com id
	65/2D-10257-03A22A05; Tue, 13 Nov 2012 11:08:32 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1352804910!3923293!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19401 invoked from network); 13 Nov 2012 11:08:31 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-10.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 11:08:31 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="sh'?scan'208";a="15774284"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 11:08:30 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:08:29 +0000
Message-ID: <1352804909.7491.55.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Olaf Hering <olaf@aepfle.de>
Date: Tue, 13 Nov 2012 11:08:29 +0000
In-Reply-To: <20121112184047.GA28988@aepfle.de>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
	<1352738557.27833.302.camel@zakaz.uk.xensource.com>
	<20121112180738.GA26672@aepfle.de>
	<20121112183457.GB2114@lolek.nigdzie>
	<20121112184047.GA28988@aepfle.de>
Organization: Citrix Systems, Inc.
Content-Type: multipart/mixed; boundary="=-xgLP/J8hfobzRv1seyy9"
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, Ian
	Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] Fix locking in
 tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--=-xgLP/J8hfobzRv1seyy9
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit

On Mon, 2012-11-12 at 18:40 +0000, Olaf Hering wrote:
> On Mon, Nov 12, Jacek Konieczny wrote:
> 
> > # perl --version
> > This is perl, v5.8.8 built for x86_64-pld-linux-thread-multi
> 
> sles11sp2 has perl 5.10.0, maybe there is different behaviour in
> different perl versions.

More likely to be the kernel, since Perl would have to jump through
hoops to figure out if a random fd which it got passed was r/o or r/w, I
think.

Perhaps its a security thing (e.g. selinux or something like that)
enforcing something extra?

Might be interesting to run things under strace ? Per the attached t.sh.
Which for me produces the below without complaint:

Ian.

+ _lockfd=42
+ _lockfile=/tmp/lockfile
+ eval 'exec 42>>/tmp/lockfile'
++ exec
+ flock -x 42
++ strace perl -e '
            open STDIN, "<&42" or die $!;
            my $fd_inum = (stat STDIN)[1]; die $! unless defined $fd_inum;
            my $file_inum = (stat $ARGV[0])[1];
            print "y\n" if $fd_inum eq $file_inum;
                             ' /tmp/lockfile
execve("/usr/bin/perl", ["perl", "-e", "\n            open STDIN, \"<&42\" "..., "/tmp/lockfile"], [/* 35 vars */]) = 0
brk(0)                                  = 0xea0000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08728d7000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=68197, ...}) = 0
mmap(NULL, 68197, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f08728c6000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/libperl.so.5.10", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\222\3\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=1495208, ...}) = 0
mmap(NULL, 3590856, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f087234f000
mprotect(0x7f08724b4000, 2093056, PROT_NONE) = 0
mmap(0x7f08726b3000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x164000) = 0x7f08726b3000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libdl.so.2", O_RDONLY)       = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\r\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=14696, ...}) = 0
mmap(NULL, 2109696, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f087214b000
mprotect(0x7f087214d000, 2097152, PROT_NONE) = 0
mmap(0x7f087234d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f087234d000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libm.so.6", O_RDONLY)        = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360>\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=530736, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08728c5000
mmap(NULL, 2625768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f0871ec9000
mprotect(0x7f0871f49000, 2097152, PROT_NONE) = 0
mmap(0x7f0872149000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x80000) = 0x7f0872149000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libpthread.so.0", O_RDONLY)  = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360Y\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=131258, ...}) = 0
mmap(NULL, 2208640, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f0871cad000
mprotect(0x7f0871cc4000, 2093056, PROT_NONE) = 0
mmap(0x7f0871ec3000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0x7f0871ec3000
mmap(0x7f0871ec5000, 13184, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f0871ec5000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\355\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1437064, ...}) = 0
mmap(NULL, 3545160, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f087194b000
mprotect(0x7f0871aa4000, 2093056, PROT_NONE) = 0
mmap(0x7f0871ca3000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x158000) = 0x7f0871ca3000
mmap(0x7f0871ca8000, 18504, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f0871ca8000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libcrypt.so.1", O_RDONLY)    = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\n\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=35104, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08728c4000
mmap(NULL, 2318784, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f0871714000
mprotect(0x7f087171c000, 2093056, PROT_NONE) = 0
mmap(0x7f087191b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7f087191b000
mmap(0x7f087191d000, 184768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f087191d000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08728c3000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08728c2000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08728c1000
arch_prctl(ARCH_SET_FS, 0x7f08728c2700) = 0
mprotect(0x7f087191b000, 4096, PROT_READ) = 0
mprotect(0x7f0871ca3000, 16384, PROT_READ) = 0
mprotect(0x7f0871ec3000, 4096, PROT_READ) = 0
mprotect(0x7f0872149000, 4096, PROT_READ) = 0
mprotect(0x7f087234d000, 4096, PROT_READ) = 0
mprotect(0x7f08728d9000, 4096, PROT_READ) = 0
munmap(0x7f08728c6000, 68197)           = 0
set_tid_address(0x7f08728c29d0)         = 17761
set_robust_list(0x7f08728c29e0, 0x18)   = 0
futex(0x7fffbb03b91c, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7fffbb03b91c, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, 7f08728c2700) = -1 EAGAIN (Resource temporarily unavailable)
rt_sigaction(SIGRTMIN, {0x7f0871cb2870, [], SA_RESTORER|SA_SIGINFO, 0x7f0871cbbff0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x7f0871cb2900, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7f0871cbbff0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
rt_sigaction(SIGFPE, {SIG_IGN, [FPE], SA_RESTORER|SA_RESTART, 0x7f087197d230}, {SIG_DFL, [], 0}, 8) = 0
brk(0)                                  = 0xea0000
brk(0xec1000)                           = 0xec1000
getuid()                                = 1161
geteuid()                               = 1161
getgid()                                = 10020
getegid()                               = 10020
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2018512, ...}) = 0
mmap(NULL, 2018512, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0871527000
close(3)                                = 0
open("/dev/urandom", O_RDONLY)          = 3
read(3, "\346\340\354H", 4)             = 4
close(3)                                = 0
readlink("/proc/self/exe", "/usr/bin/perl", 4095) = 13
stat("/usr/local/lib/site_perl/5.10.1/x86_64-linux-gnu-thread-multi", 0x7fffbb03b390) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/site_perl/5.10.1", 0x7fffbb03b390) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/site_perl/x86_64-linux-gnu-thread-multi", 0x7fffbb03b390) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/perl/5.10.0", 0x7fffbb03b4d0) = -1 ENOENT (No such file or directory)
stat("/usr/local/share/perl/5.10.0", 0x7fffbb03b4d0) = -1 ENOENT (No such file or directory)
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
lseek(0, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffbb03b260) = -1 EINVAL (Invalid argument)
lseek(1, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffbb03b270) = -1 ENOTTY (Inappropriate ioctl for device)
lseek(2, 0, SEEK_CUR)                   = 7954
open("/dev/null", O_RDONLY)             = 3
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffbb03b390) = -1 ENOTTY (Inappropriate ioctl for device)
lseek(3, 0, SEEK_CUR)                   = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
fstat(3, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 3), ...}) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0
brk(0xee2000)                           = 0xee2000
close(3)                                = 0
dup(42)                                 = 3
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffbb03b320) = -1 ENOTTY (Inappropriate ioctl for device)
lseek(3, 0, SEEK_CUR)                   = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
dup2(3, 0)                              = 0
close(3)                                = 0
fcntl(0, F_SETFD, 0)                    = 0
fstat(0, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
stat("/tmp/lockfile", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
rt_sigaction(SIG_0, NULL, {0x7fffbb03b810, ~[HUP INT QUIT TRAP BUS FPE USR1 SEGV USR2 TERM CONT TTIN TTOU URG XFSZ PROF WINCH RTMIN RT_1 RT_2 RT_3 RT_5 RT_6 RT_7 RT_8 RT_16 RT_17 RT_18 RT_19 RT_20 RT_21 RT_22 RT_23 RT_24 RT_25 RT_26 RT_27 RT_28 RT_29 RT_30 RT_31], 0}, 8) = -1 EINVAL (Invalid argument)
rt_sigaction(SIGHUP, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGQUIT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGILL, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTRAP, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGABRT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGBUS, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGFPE, NULL, {SIG_IGN, [FPE], SA_RESTORER|SA_RESTART, 0x7f087197d230}, 8) = 0
rt_sigaction(SIGKILL, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGUSR1, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGSEGV, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGUSR2, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGPIPE, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGALRM, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTERM, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGSTKFLT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGCONT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGSTOP, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTSTP, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTTIN, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTTOU, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGURG, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGXCPU, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGXFSZ, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGVTALRM, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGPROF, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGWINCH, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGIO, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGPWR, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGSYS, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_2, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_3, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_4, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_5, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_6, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_7, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_8, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_9, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_10, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_11, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_12, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_13, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_14, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_15, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_16, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_17, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_18, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_19, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_20, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_21, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_22, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_23, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_24, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_25, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_26, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_27, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_28, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_29, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_30, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_31, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_32, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGABRT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGIO, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGSYS, NULL, {SIG_DFL, [], 0}, 8) = 0
write(1, "y\n", 2)                      = 2
exit_group(0)                           = ?
+ rightfile=y
+ echo y


--=-xgLP/J8hfobzRv1seyy9
Content-Type: application/x-shellscript; name="t.sh"
Content-Disposition: attachment; filename="t.sh"
Content-Transfer-Encoding: 7bit

#!/bin/bash

set -ex

_lockfd=42
_lockfile=/tmp/lockfile

eval "exec $_lockfd>>$_lockfile"
flock -x $_lockfd || return $?
        # We can't just stat /dev/stdin or /proc/self/fd/$_lockfd or
        # use bash's test -ef because those all go through what is
        # actually a synthetic symlink in /proc and we aren't
        # guaranteed that our stat(2) won't lose the race with an
        # rm(1) between reading the synthetic link and traversing the
        # file system to find the inum.  Perl is very fast so use that.
rightfile=$( strace perl -e '
            open STDIN, "<&'$_lockfd'" or die $!;
            my $fd_inum = (stat STDIN)[1]; die $! unless defined $fd_inum;
            my $file_inum = (stat $ARGV[0])[1];
            print "y\n" if $fd_inum eq $file_inum;
                             ' "$_lockfile" )
echo $rightfile

--=-xgLP/J8hfobzRv1seyy9
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.xen.org
http://lists.xen.org/xen-devel

--=-xgLP/J8hfobzRv1seyy9--


From xen-devel-bounces@lists.xen.org Tue Nov 13 11:08:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:08:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEM7-0005Wf-Af; Tue, 13 Nov 2012 11:08:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYEM5-0005Wa-HP
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 11:08:33 +0000
Received: from [193.109.254.147:39498] by server-5.bemta-14.messagelabs.com id
	65/2D-10257-03A22A05; Tue, 13 Nov 2012 11:08:32 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1352804910!3923293!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19401 invoked from network); 13 Nov 2012 11:08:31 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-10.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 11:08:31 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="sh'?scan'208";a="15774284"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 11:08:30 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:08:29 +0000
Message-ID: <1352804909.7491.55.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Olaf Hering <olaf@aepfle.de>
Date: Tue, 13 Nov 2012 11:08:29 +0000
In-Reply-To: <20121112184047.GA28988@aepfle.de>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
	<1352738557.27833.302.camel@zakaz.uk.xensource.com>
	<20121112180738.GA26672@aepfle.de>
	<20121112183457.GB2114@lolek.nigdzie>
	<20121112184047.GA28988@aepfle.de>
Organization: Citrix Systems, Inc.
Content-Type: multipart/mixed; boundary="=-xgLP/J8hfobzRv1seyy9"
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, Ian
	Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] Fix locking in
 tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--=-xgLP/J8hfobzRv1seyy9
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit

On Mon, 2012-11-12 at 18:40 +0000, Olaf Hering wrote:
> On Mon, Nov 12, Jacek Konieczny wrote:
> 
> > # perl --version
> > This is perl, v5.8.8 built for x86_64-pld-linux-thread-multi
> 
> sles11sp2 has perl 5.10.0, maybe there is different behaviour in
> different perl versions.

More likely to be the kernel, since Perl would have to jump through
hoops to figure out if a random fd which it got passed was r/o or r/w, I
think.

Perhaps its a security thing (e.g. selinux or something like that)
enforcing something extra?

Might be interesting to run things under strace ? Per the attached t.sh.
Which for me produces the below without complaint:

Ian.

+ _lockfd=42
+ _lockfile=/tmp/lockfile
+ eval 'exec 42>>/tmp/lockfile'
++ exec
+ flock -x 42
++ strace perl -e '
            open STDIN, "<&42" or die $!;
            my $fd_inum = (stat STDIN)[1]; die $! unless defined $fd_inum;
            my $file_inum = (stat $ARGV[0])[1];
            print "y\n" if $fd_inum eq $file_inum;
                             ' /tmp/lockfile
execve("/usr/bin/perl", ["perl", "-e", "\n            open STDIN, \"<&42\" "..., "/tmp/lockfile"], [/* 35 vars */]) = 0
brk(0)                                  = 0xea0000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08728d7000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=68197, ...}) = 0
mmap(NULL, 68197, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f08728c6000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/libperl.so.5.10", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\222\3\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=1495208, ...}) = 0
mmap(NULL, 3590856, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f087234f000
mprotect(0x7f08724b4000, 2093056, PROT_NONE) = 0
mmap(0x7f08726b3000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x164000) = 0x7f08726b3000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libdl.so.2", O_RDONLY)       = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\r\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=14696, ...}) = 0
mmap(NULL, 2109696, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f087214b000
mprotect(0x7f087214d000, 2097152, PROT_NONE) = 0
mmap(0x7f087234d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f087234d000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libm.so.6", O_RDONLY)        = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360>\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=530736, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08728c5000
mmap(NULL, 2625768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f0871ec9000
mprotect(0x7f0871f49000, 2097152, PROT_NONE) = 0
mmap(0x7f0872149000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x80000) = 0x7f0872149000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libpthread.so.0", O_RDONLY)  = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360Y\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=131258, ...}) = 0
mmap(NULL, 2208640, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f0871cad000
mprotect(0x7f0871cc4000, 2093056, PROT_NONE) = 0
mmap(0x7f0871ec3000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0x7f0871ec3000
mmap(0x7f0871ec5000, 13184, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f0871ec5000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\355\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1437064, ...}) = 0
mmap(NULL, 3545160, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f087194b000
mprotect(0x7f0871aa4000, 2093056, PROT_NONE) = 0
mmap(0x7f0871ca3000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x158000) = 0x7f0871ca3000
mmap(0x7f0871ca8000, 18504, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f0871ca8000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libcrypt.so.1", O_RDONLY)    = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\n\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=35104, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08728c4000
mmap(NULL, 2318784, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f0871714000
mprotect(0x7f087171c000, 2093056, PROT_NONE) = 0
mmap(0x7f087191b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7f087191b000
mmap(0x7f087191d000, 184768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f087191d000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08728c3000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08728c2000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08728c1000
arch_prctl(ARCH_SET_FS, 0x7f08728c2700) = 0
mprotect(0x7f087191b000, 4096, PROT_READ) = 0
mprotect(0x7f0871ca3000, 16384, PROT_READ) = 0
mprotect(0x7f0871ec3000, 4096, PROT_READ) = 0
mprotect(0x7f0872149000, 4096, PROT_READ) = 0
mprotect(0x7f087234d000, 4096, PROT_READ) = 0
mprotect(0x7f08728d9000, 4096, PROT_READ) = 0
munmap(0x7f08728c6000, 68197)           = 0
set_tid_address(0x7f08728c29d0)         = 17761
set_robust_list(0x7f08728c29e0, 0x18)   = 0
futex(0x7fffbb03b91c, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7fffbb03b91c, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, 7f08728c2700) = -1 EAGAIN (Resource temporarily unavailable)
rt_sigaction(SIGRTMIN, {0x7f0871cb2870, [], SA_RESTORER|SA_SIGINFO, 0x7f0871cbbff0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x7f0871cb2900, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7f0871cbbff0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
rt_sigaction(SIGFPE, {SIG_IGN, [FPE], SA_RESTORER|SA_RESTART, 0x7f087197d230}, {SIG_DFL, [], 0}, 8) = 0
brk(0)                                  = 0xea0000
brk(0xec1000)                           = 0xec1000
getuid()                                = 1161
geteuid()                               = 1161
getgid()                                = 10020
getegid()                               = 10020
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2018512, ...}) = 0
mmap(NULL, 2018512, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0871527000
close(3)                                = 0
open("/dev/urandom", O_RDONLY)          = 3
read(3, "\346\340\354H", 4)             = 4
close(3)                                = 0
readlink("/proc/self/exe", "/usr/bin/perl", 4095) = 13
stat("/usr/local/lib/site_perl/5.10.1/x86_64-linux-gnu-thread-multi", 0x7fffbb03b390) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/site_perl/5.10.1", 0x7fffbb03b390) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/site_perl/x86_64-linux-gnu-thread-multi", 0x7fffbb03b390) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/perl/5.10.0", 0x7fffbb03b4d0) = -1 ENOENT (No such file or directory)
stat("/usr/local/share/perl/5.10.0", 0x7fffbb03b4d0) = -1 ENOENT (No such file or directory)
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
lseek(0, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffbb03b260) = -1 EINVAL (Invalid argument)
lseek(1, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffbb03b270) = -1 ENOTTY (Inappropriate ioctl for device)
lseek(2, 0, SEEK_CUR)                   = 7954
open("/dev/null", O_RDONLY)             = 3
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffbb03b390) = -1 ENOTTY (Inappropriate ioctl for device)
lseek(3, 0, SEEK_CUR)                   = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
fstat(3, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 3), ...}) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0
brk(0xee2000)                           = 0xee2000
close(3)                                = 0
dup(42)                                 = 3
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffbb03b320) = -1 ENOTTY (Inappropriate ioctl for device)
lseek(3, 0, SEEK_CUR)                   = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
dup2(3, 0)                              = 0
close(3)                                = 0
fcntl(0, F_SETFD, 0)                    = 0
fstat(0, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
stat("/tmp/lockfile", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
rt_sigaction(SIG_0, NULL, {0x7fffbb03b810, ~[HUP INT QUIT TRAP BUS FPE USR1 SEGV USR2 TERM CONT TTIN TTOU URG XFSZ PROF WINCH RTMIN RT_1 RT_2 RT_3 RT_5 RT_6 RT_7 RT_8 RT_16 RT_17 RT_18 RT_19 RT_20 RT_21 RT_22 RT_23 RT_24 RT_25 RT_26 RT_27 RT_28 RT_29 RT_30 RT_31], 0}, 8) = -1 EINVAL (Invalid argument)
rt_sigaction(SIGHUP, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGQUIT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGILL, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTRAP, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGABRT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGBUS, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGFPE, NULL, {SIG_IGN, [FPE], SA_RESTORER|SA_RESTART, 0x7f087197d230}, 8) = 0
rt_sigaction(SIGKILL, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGUSR1, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGSEGV, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGUSR2, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGPIPE, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGALRM, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTERM, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGSTKFLT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGCONT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGSTOP, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTSTP, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTTIN, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTTOU, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGURG, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGXCPU, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGXFSZ, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGVTALRM, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGPROF, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGWINCH, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGIO, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGPWR, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGSYS, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_2, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_3, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_4, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_5, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_6, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_7, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_8, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_9, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_10, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_11, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_12, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_13, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_14, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_15, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_16, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_17, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_18, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_19, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_20, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_21, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_22, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_23, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_24, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_25, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_26, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_27, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_28, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_29, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_30, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_31, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGRT_32, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGABRT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGIO, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGSYS, NULL, {SIG_DFL, [], 0}, 8) = 0
write(1, "y\n", 2)                      = 2
exit_group(0)                           = ?
+ rightfile=y
+ echo y


--=-xgLP/J8hfobzRv1seyy9
Content-Type: application/x-shellscript; name="t.sh"
Content-Disposition: attachment; filename="t.sh"
Content-Transfer-Encoding: 7bit

#!/bin/bash

set -ex

_lockfd=42
_lockfile=/tmp/lockfile

eval "exec $_lockfd>>$_lockfile"
flock -x $_lockfd || return $?
        # We can't just stat /dev/stdin or /proc/self/fd/$_lockfd or
        # use bash's test -ef because those all go through what is
        # actually a synthetic symlink in /proc and we aren't
        # guaranteed that our stat(2) won't lose the race with an
        # rm(1) between reading the synthetic link and traversing the
        # file system to find the inum.  Perl is very fast so use that.
rightfile=$( strace perl -e '
            open STDIN, "<&'$_lockfd'" or die $!;
            my $fd_inum = (stat STDIN)[1]; die $! unless defined $fd_inum;
            my $file_inum = (stat $ARGV[0])[1];
            print "y\n" if $fd_inum eq $file_inum;
                             ' "$_lockfile" )
echo $rightfile

--=-xgLP/J8hfobzRv1seyy9
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.xen.org
http://lists.xen.org/xen-devel

--=-xgLP/J8hfobzRv1seyy9--


From xen-devel-bounces@lists.xen.org Tue Nov 13 11:13:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:13:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEQO-0005k0-6t; Tue, 13 Nov 2012 11:13:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYEQM-0005jt-Rb
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:12:59 +0000
Received: from [85.158.138.51:17937] by server-15.bemta-3.messagelabs.com id
	FA/24-09445-83B22A05; Tue, 13 Nov 2012 11:12:56 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1352805175!29820191!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14737 invoked from network); 13 Nov 2012 11:12:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 11:12:55 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15774455"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 11:12:54 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:12:54 +0000
Message-ID: <1352805173.7491.57.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Razvan Cojocaru <rzvncj@gmail.com>
Date: Tue, 13 Nov 2012 11:12:53 +0000
In-Reply-To: <50A225CA.2080705@gmail.com>
References: <50A16639.2090209@gmail.com>
	<1352800791.7491.21.camel@zakaz.uk.xensource.com>
	<50A22044.6060608@gmail.com>
	<1352802973.7491.40.camel@zakaz.uk.xensource.com>
	<50A225CA.2080705@gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 10:49 +0000, Razvan Cojocaru wrote:
> >> OK, my immediate end-goal is real-time logging of hypervisor events via
> >> a dom0 userspace application. These events are always about a currently
> >> running virtual machine, and said virtual machine is paused at the time.
> >> The userspace tool should be immediately notified, so no polling.
> >
> > This is very like the ioreq model, where the domain (or maybe just the
> > vcpu, I'm not sure) is paused while qemu does its thing.
> >
> > What sort of events are we talking about here?
> 
> A list of interesting registers that changed, that a page fault occured, 
> things like that, occasionally containing some small string messages 
> with extra information. Should be around 64 bytes or so.

Perhaps it would be useful to build on the vmitools (previously
xenaccess)? http://code.google.com/p/vmitools/ 

I don't know what level of support it has for trapping on certain events
but it seems like a model where the guest is stopped due to an event,
the tools are signalled and use vmi to figure out what changed etc might
be an interesting one.

In general we prefer not to put stuff in the hypervisor unless
absolutely required.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:13:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:13:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEQO-0005k0-6t; Tue, 13 Nov 2012 11:13:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYEQM-0005jt-Rb
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:12:59 +0000
Received: from [85.158.138.51:17937] by server-15.bemta-3.messagelabs.com id
	FA/24-09445-83B22A05; Tue, 13 Nov 2012 11:12:56 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1352805175!29820191!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14737 invoked from network); 13 Nov 2012 11:12:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 11:12:55 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15774455"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 11:12:54 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:12:54 +0000
Message-ID: <1352805173.7491.57.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Razvan Cojocaru <rzvncj@gmail.com>
Date: Tue, 13 Nov 2012 11:12:53 +0000
In-Reply-To: <50A225CA.2080705@gmail.com>
References: <50A16639.2090209@gmail.com>
	<1352800791.7491.21.camel@zakaz.uk.xensource.com>
	<50A22044.6060608@gmail.com>
	<1352802973.7491.40.camel@zakaz.uk.xensource.com>
	<50A225CA.2080705@gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 10:49 +0000, Razvan Cojocaru wrote:
> >> OK, my immediate end-goal is real-time logging of hypervisor events via
> >> a dom0 userspace application. These events are always about a currently
> >> running virtual machine, and said virtual machine is paused at the time.
> >> The userspace tool should be immediately notified, so no polling.
> >
> > This is very like the ioreq model, where the domain (or maybe just the
> > vcpu, I'm not sure) is paused while qemu does its thing.
> >
> > What sort of events are we talking about here?
> 
> A list of interesting registers that changed, that a page fault occured, 
> things like that, occasionally containing some small string messages 
> with extra information. Should be around 64 bytes or so.

Perhaps it would be useful to build on the vmitools (previously
xenaccess)? http://code.google.com/p/vmitools/ 

I don't know what level of support it has for trapping on certain events
but it seems like a model where the guest is stopped due to an event,
the tools are signalled and use vmi to figure out what changed etc might
be an interesting one.

In general we prefer not to put stuff in the hypervisor unless
absolutely required.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:14:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:14:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYERC-0005qK-Mf; Tue, 13 Nov 2012 11:13:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <yang.z.zhang@intel.com>) id 1TYERB-0005q8-DQ
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:13:49 +0000
Received: from [85.158.137.99:44548] by server-16.bemta-3.messagelabs.com id
	B4/3C-07461-86B22A05; Tue, 13 Nov 2012 11:13:44 +0000
X-Env-Sender: yang.z.zhang@intel.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1352805222!15753803!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjMwNjQ1\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12955 invoked from network); 13 Nov 2012 11:13:43 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-12.tower-217.messagelabs.com with SMTP;
	13 Nov 2012 11:13:43 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga101.ch.intel.com with ESMTP; 13 Nov 2012 03:13:41 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,765,1344236400"; d="scan'208";a="167697569"
Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37])
	by AZSMGA002.ch.intel.com with ESMTP; 13 Nov 2012 03:13:17 -0800
Received: from fmsmsx152.amr.corp.intel.com (10.19.17.221) by
	FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 13 Nov 2012 03:13:17 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	fmsmsx152.amr.corp.intel.com (10.19.17.221) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 13 Nov 2012 03:13:17 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Tue, 13 Nov 2012 19:13:15 +0800
From: "Zhang, Yang Z" <yang.z.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, "Zhang, Xiantao" <xiantao.zhang@intel.com>
Thread-Topic: [Xen-devel] iommu=dom0-passthrough behavior
Thread-Index: AQHNu2JnOrR2IJOBmEueKZ07SNjEopfm7FWQgACjJM2AABgNcA==
Date: Tue, 13 Nov 2012 11:13:14 +0000
Message-ID: <A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
In-Reply-To: <50A223DE02000078000A7FE6@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Jan Beulich wrote on 2012-11-13:
>>>> On 13.11.12 at 09:50, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
>>> From: Jan Beulich [mailto:JBeulich@suse.com]
>>> We need to settle on the concept here first: What specifically is said
>>> option intended to do?
>> 
>> Basically,  this options just allows the transactions from dom0's devices
>> not subject to VT-d engine.  Actually,  It is not targeted to fix something,
>> but just allows users isolating VT-d issues from dom0.
>> As I know, in early days, VT-d is not that stable,   if dom0's devices are
>> controlled by VT-d,  some strange issues may trigger in system's boot stage,
>> so use this options to disable VT-d for Dom0.
> 
> Which it doesn't, as the specific case here shows.
> 
>>> Bottom line - I'm seeking advice as to whether working around this problem
>>> in the IOMMU code is desirable/necessary, or whether this is a design flaw
>>> on the device's side that just cannot be tolerated with an IOMMU in the
>>> picture (which would need good reasoning, so that a customer expecting
>>> such a device to work regardless of IOMMU usage can understand that this
>>> cannot reasonably be made work).

Why not just disable the IOMMU in this case ?

>> The issue is why the non-zero functions don't claim themselves during PCI bus
>> scan.
> 
> As said - I can't tell whether there is a secondary function in the
> first place (and I didn't try to find out because it doesn't really
> matter for the purpose of finding a solution/workaround).

If software cannot see it, then how to use it? If there still have an approach to detect it, then xen can do it too and setup the context entry as passthrough.

>>   From security point of view,  VT-d shouldn't allow transactions from
>> the unknown devices.
> 
> That's inconsistent with what you say above: Either there is a way
> to suppress IOMMU involvement in Dom0 operation (which is
> inherently insecure), or there is not. If there is, there's no point in
> claiming security for one aspect but not another.
> 
> I think it is obvious that I'm not suggesting to allow pass through of
> such a device at this point (albeit even that would seem possible and,
> from a customer's pov, desirable), and as long as users are aware of
> the security implications when using the option under discussion here,
> I don't see why that option shouldn't be made fully work. It should be
> left to the admins of individual systems to decide between security
> and functionality, we should provide them with ways to implement
> their choice.
> 
> Otoh I'm unaware of a similar option for native Linux, yet it is
> suffering the same problem on that system when DMA translation
> gets turned on.
> 
> But the direction you give to the discussion doesn't lead us towards
> a solution for the customer (or a profound explanation why none
> is possible), so if we could please focus on that aspect again.
> 
> Jan


Best regards,
Yang


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:14:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:14:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYERC-0005qK-Mf; Tue, 13 Nov 2012 11:13:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <yang.z.zhang@intel.com>) id 1TYERB-0005q8-DQ
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:13:49 +0000
Received: from [85.158.137.99:44548] by server-16.bemta-3.messagelabs.com id
	B4/3C-07461-86B22A05; Tue, 13 Nov 2012 11:13:44 +0000
X-Env-Sender: yang.z.zhang@intel.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1352805222!15753803!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjMwNjQ1\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12955 invoked from network); 13 Nov 2012 11:13:43 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-12.tower-217.messagelabs.com with SMTP;
	13 Nov 2012 11:13:43 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga101.ch.intel.com with ESMTP; 13 Nov 2012 03:13:41 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,765,1344236400"; d="scan'208";a="167697569"
Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37])
	by AZSMGA002.ch.intel.com with ESMTP; 13 Nov 2012 03:13:17 -0800
Received: from fmsmsx152.amr.corp.intel.com (10.19.17.221) by
	FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 13 Nov 2012 03:13:17 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	fmsmsx152.amr.corp.intel.com (10.19.17.221) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 13 Nov 2012 03:13:17 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Tue, 13 Nov 2012 19:13:15 +0800
From: "Zhang, Yang Z" <yang.z.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, "Zhang, Xiantao" <xiantao.zhang@intel.com>
Thread-Topic: [Xen-devel] iommu=dom0-passthrough behavior
Thread-Index: AQHNu2JnOrR2IJOBmEueKZ07SNjEopfm7FWQgACjJM2AABgNcA==
Date: Tue, 13 Nov 2012 11:13:14 +0000
Message-ID: <A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
In-Reply-To: <50A223DE02000078000A7FE6@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Jan Beulich wrote on 2012-11-13:
>>>> On 13.11.12 at 09:50, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
>>> From: Jan Beulich [mailto:JBeulich@suse.com]
>>> We need to settle on the concept here first: What specifically is said
>>> option intended to do?
>> 
>> Basically,  this options just allows the transactions from dom0's devices
>> not subject to VT-d engine.  Actually,  It is not targeted to fix something,
>> but just allows users isolating VT-d issues from dom0.
>> As I know, in early days, VT-d is not that stable,   if dom0's devices are
>> controlled by VT-d,  some strange issues may trigger in system's boot stage,
>> so use this options to disable VT-d for Dom0.
> 
> Which it doesn't, as the specific case here shows.
> 
>>> Bottom line - I'm seeking advice as to whether working around this problem
>>> in the IOMMU code is desirable/necessary, or whether this is a design flaw
>>> on the device's side that just cannot be tolerated with an IOMMU in the
>>> picture (which would need good reasoning, so that a customer expecting
>>> such a device to work regardless of IOMMU usage can understand that this
>>> cannot reasonably be made work).

Why not just disable the IOMMU in this case ?

>> The issue is why the non-zero functions don't claim themselves during PCI bus
>> scan.
> 
> As said - I can't tell whether there is a secondary function in the
> first place (and I didn't try to find out because it doesn't really
> matter for the purpose of finding a solution/workaround).

If software cannot see it, then how to use it? If there still have an approach to detect it, then xen can do it too and setup the context entry as passthrough.

>>   From security point of view,  VT-d shouldn't allow transactions from
>> the unknown devices.
> 
> That's inconsistent with what you say above: Either there is a way
> to suppress IOMMU involvement in Dom0 operation (which is
> inherently insecure), or there is not. If there is, there's no point in
> claiming security for one aspect but not another.
> 
> I think it is obvious that I'm not suggesting to allow pass through of
> such a device at this point (albeit even that would seem possible and,
> from a customer's pov, desirable), and as long as users are aware of
> the security implications when using the option under discussion here,
> I don't see why that option shouldn't be made fully work. It should be
> left to the admins of individual systems to decide between security
> and functionality, we should provide them with ways to implement
> their choice.
> 
> Otoh I'm unaware of a similar option for native Linux, yet it is
> suffering the same problem on that system when DMA translation
> gets turned on.
> 
> But the direction you give to the discussion doesn't lead us towards
> a solution for the customer (or a profound explanation why none
> is possible), so if we could please focus on that aspect again.
> 
> Jan


Best regards,
Yang


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:20:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:20:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEXE-000659-PQ; Tue, 13 Nov 2012 11:20:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYEXC-000654-SD
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:20:02 +0000
Received: from [85.158.138.51:62134] by server-3.bemta-3.messagelabs.com id
	16/54-31566-2EC22A05; Tue, 13 Nov 2012 11:20:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1352805600!21892621!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19965 invoked from network); 13 Nov 2012 11:20:01 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 11:20:01 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15774676"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 11:19:23 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:19:22 +0000
Message-ID: <1352805562.7491.59.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ronny Hegewald <ronny.hegewald@online.de>
Date: Tue, 13 Nov 2012 11:19:22 +0000
In-Reply-To: <201211030255.37630.ronny.hegewald@online.de>
References: <201211010218.14872.ronny.hegewald@online.de>
	<1351756924.25014.29.camel@hastur.hellion.org.uk>
	<201211022101.08926.ronny.hegewald@online.de>
	<201211030255.37630.ronny.hegewald@online.de>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] fix vfb related assertion problem when
 starting pv-domU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, 2012-11-03 at 02:55 +0000, Ronny Hegewald wrote:
> >
> > Signed-off-by: Ronny Hegewald@online.de
> >
> 
> Somehow the sign off gone wrong. it was supposed to be
> 
> Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>

Acked-by: Ian Campbell <ian.campbell@citrix.com> and applied, thanks.

For future reference can you generate patches so they apply with "patch
-p1", the tooling copes much better with those sorts of patches.

e.g.:
--- tools/libxl/libxl.c.org
+++ tools/libxl/libxl.c

should look like:
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
or:
--- xen.orig/tools/libxl/libxl.c
+++ xen/tools/libxl/libxl.c
or:
--- xen/tools/libxl/libxl.c.orig
+++ xen/tools/libxl/libxl.c
etc.

Tools like git format-patch + send-email or hg export / hg email (the
last described in http://wiki.xen.org/wiki/Submitting_Xen_Patches) do
this automatically I think.

Thanks,
Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:20:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:20:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEXE-000659-PQ; Tue, 13 Nov 2012 11:20:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYEXC-000654-SD
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:20:02 +0000
Received: from [85.158.138.51:62134] by server-3.bemta-3.messagelabs.com id
	16/54-31566-2EC22A05; Tue, 13 Nov 2012 11:20:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1352805600!21892621!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19965 invoked from network); 13 Nov 2012 11:20:01 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 11:20:01 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15774676"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 11:19:23 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:19:22 +0000
Message-ID: <1352805562.7491.59.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ronny Hegewald <ronny.hegewald@online.de>
Date: Tue, 13 Nov 2012 11:19:22 +0000
In-Reply-To: <201211030255.37630.ronny.hegewald@online.de>
References: <201211010218.14872.ronny.hegewald@online.de>
	<1351756924.25014.29.camel@hastur.hellion.org.uk>
	<201211022101.08926.ronny.hegewald@online.de>
	<201211030255.37630.ronny.hegewald@online.de>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] fix vfb related assertion problem when
 starting pv-domU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, 2012-11-03 at 02:55 +0000, Ronny Hegewald wrote:
> >
> > Signed-off-by: Ronny Hegewald@online.de
> >
> 
> Somehow the sign off gone wrong. it was supposed to be
> 
> Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>

Acked-by: Ian Campbell <ian.campbell@citrix.com> and applied, thanks.

For future reference can you generate patches so they apply with "patch
-p1", the tooling copes much better with those sorts of patches.

e.g.:
--- tools/libxl/libxl.c.org
+++ tools/libxl/libxl.c

should look like:
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
or:
--- xen.orig/tools/libxl/libxl.c
+++ xen/tools/libxl/libxl.c
or:
--- xen/tools/libxl/libxl.c.orig
+++ xen/tools/libxl/libxl.c
etc.

Tools like git format-patch + send-email or hg export / hg email (the
last described in http://wiki.xen.org/wiki/Submitting_Xen_Patches) do
this automatically I think.

Thanks,
Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:23:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:23:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEai-0006GJ-Ed; Tue, 13 Nov 2012 11:23:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <malcolm.crossley@citrix.com>) id 1TYEag-0006GE-83
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 11:23:38 +0000
Received: from [193.109.254.147:24802] by server-16.bemta-14.messagelabs.com
	id 35/29-09215-9BD22A05; Tue, 13 Nov 2012 11:23:37 +0000
X-Env-Sender: malcolm.crossley@citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1352805816!9179547!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26177 invoked from network); 13 Nov 2012 11:23:37 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 11:23:37 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15774810"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 11:23:36 +0000
Received: from [127.0.1.1] (10.80.3.206) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:36 +0000
MIME-Version: 1.0
X-Mercurial-Node: ea756059a8da1217e64414dde68f1a6ea60427b3
Message-ID: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Tue, 13 Nov 2012 11:23:25 +0000
From: Malcolm Crossley <malcolm.crossley@citrix.com>
To: xen-devel@lists.xensource.com
Cc: eddie.dong@intel.com, jun.nakajima@intel.com
Subject: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The self_nmi() code cause's an NMI to be triggered by sending an APIC message
to the local processor. Unfortunately there is a delay in the delivery of the
APIC message and we may already have re-entered the HVM guest by the time the
NMI is taken. This results in the VMEXIT code calling the self_nmi() function
again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop before
the HVM guest resumes normal operation.

Volume 3 Chapter 27 Section 1 of the Intel SDM states:

An NMI causes subsequent NMIs to be blocked, but only after the VM exit
completes.

So we believe it is safe to directly invoke the INT call as NMI's should
already be blocked.

diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
                  (X86_EVENTTYPE_NMI << 8) )
                 goto exit_and_crash;
             HVMTRACE_0D(NMI);
-            self_nmi(); /* Real NMI, vector 2: normal processing. */
+            asm("int $2"); /* Real NMI, vector 2: normal processing. */
             break;
         case TRAP_machine_check:
             HVMTRACE_0D(MCE);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:23:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:23:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEai-0006GJ-Ed; Tue, 13 Nov 2012 11:23:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <malcolm.crossley@citrix.com>) id 1TYEag-0006GE-83
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 11:23:38 +0000
Received: from [193.109.254.147:24802] by server-16.bemta-14.messagelabs.com
	id 35/29-09215-9BD22A05; Tue, 13 Nov 2012 11:23:37 +0000
X-Env-Sender: malcolm.crossley@citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1352805816!9179547!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26177 invoked from network); 13 Nov 2012 11:23:37 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 11:23:37 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15774810"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 11:23:36 +0000
Received: from [127.0.1.1] (10.80.3.206) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:36 +0000
MIME-Version: 1.0
X-Mercurial-Node: ea756059a8da1217e64414dde68f1a6ea60427b3
Message-ID: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Tue, 13 Nov 2012 11:23:25 +0000
From: Malcolm Crossley <malcolm.crossley@citrix.com>
To: xen-devel@lists.xensource.com
Cc: eddie.dong@intel.com, jun.nakajima@intel.com
Subject: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The self_nmi() code cause's an NMI to be triggered by sending an APIC message
to the local processor. Unfortunately there is a delay in the delivery of the
APIC message and we may already have re-entered the HVM guest by the time the
NMI is taken. This results in the VMEXIT code calling the self_nmi() function
again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop before
the HVM guest resumes normal operation.

Volume 3 Chapter 27 Section 1 of the Intel SDM states:

An NMI causes subsequent NMIs to be blocked, but only after the VM exit
completes.

So we believe it is safe to directly invoke the INT call as NMI's should
already be blocked.

diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
                  (X86_EVENTTYPE_NMI << 8) )
                 goto exit_and_crash;
             HVMTRACE_0D(NMI);
-            self_nmi(); /* Real NMI, vector 2: normal processing. */
+            asm("int $2"); /* Real NMI, vector 2: normal processing. */
             break;
         case TRAP_machine_check:
             HVMTRACE_0D(MCE);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:24:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:24:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEbA-0006Ir-Rn; Tue, 13 Nov 2012 11:24:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TYEbA-0006Id-0L
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:24:08 +0000
Received: from [85.158.139.83:35348] by server-15.bemta-5.messagelabs.com id
	B7/DE-26920-7DD22A05; Tue, 13 Nov 2012 11:24:07 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1352805846!29489850!1
X-Originating-IP: [91.199.104.2]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30567 invoked from network); 13 Nov 2012 11:24:06 -0000
Received: from mail.bitdefender.com (HELO mail.bitdefender.com) (91.199.104.2)
	by server-13.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 11:24:06 -0000
Received: (qmail 27786 invoked from network); 13 Nov 2012 13:24:00 +0200
Received: from rcojocaru.dsd.ro (HELO ?10.10.14.59?)
	(rcojocaru@bitdefender.com@10.10.14.59)
	by mail.bitdefender.com with AES256-SHA encrypted SMTP;
	13 Nov 2012 13:24:00 +0200
Message-ID: <50A22DD7.7020901@gmail.com>
Date: Tue, 13 Nov 2012 13:24:07 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <50A16639.2090209@gmail.com>
	<1352800791.7491.21.camel@zakaz.uk.xensource.com>
	<50A22044.6060608@gmail.com>
	<1352802973.7491.40.camel@zakaz.uk.xensource.com>
	<50A225CA.2080705@gmail.com>
	<1352805173.7491.57.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352805173.7491.57.camel@zakaz.uk.xensource.com>
X-BitDefender-Spam: No (0)
X-BitDefender-SpamStamp: Build: [Engines: 2.13.3.14894, Dats: 226282,
	Stamp: 3], Multi: [Enabled], BW: [Enabled], RBL DNSBL: [Disabled],
	APM: [Enabled, Score: 500, Flags: NN_GMAIL_WITH_XMAILER_ADN;
	NN_LEGIT_VALID_REPLY; NN_EXEC_H_YAHOO_AND_GMAIL_NO_DOMAIN_KEY;
	NN_LEGIT_S_SQARE_BRACKETS; NN_LEGIT_MAILING_LIST_TO], SGN: [Enabled],
	URL: [Enabled], URI DNSBL: [Disabled], SQMD: [Enabled, Hits: none,
	MD5: 4f4c5f1d0905d9dbef385dd509407798.fuzzy.fzrbl.org], RTDA:
	[Disabled, Hit: No], total: 0(775)
X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.0 on
	elfie.dsd.hq, sigver: 7.43989
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> Perhaps it would be useful to build on the vmitools (previously
> xenaccess)? http://code.google.com/p/vmitools/

Indeed, but LibVMI does not offer event-based access, and polling is not 
really a solution.

> In general we prefer not to put stuff in the hypervisor unless
> absolutely required.

Me too :)

Thanks,
Razvan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:24:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:24:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEbA-0006Ir-Rn; Tue, 13 Nov 2012 11:24:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TYEbA-0006Id-0L
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:24:08 +0000
Received: from [85.158.139.83:35348] by server-15.bemta-5.messagelabs.com id
	B7/DE-26920-7DD22A05; Tue, 13 Nov 2012 11:24:07 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1352805846!29489850!1
X-Originating-IP: [91.199.104.2]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30567 invoked from network); 13 Nov 2012 11:24:06 -0000
Received: from mail.bitdefender.com (HELO mail.bitdefender.com) (91.199.104.2)
	by server-13.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 11:24:06 -0000
Received: (qmail 27786 invoked from network); 13 Nov 2012 13:24:00 +0200
Received: from rcojocaru.dsd.ro (HELO ?10.10.14.59?)
	(rcojocaru@bitdefender.com@10.10.14.59)
	by mail.bitdefender.com with AES256-SHA encrypted SMTP;
	13 Nov 2012 13:24:00 +0200
Message-ID: <50A22DD7.7020901@gmail.com>
Date: Tue, 13 Nov 2012 13:24:07 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <50A16639.2090209@gmail.com>
	<1352800791.7491.21.camel@zakaz.uk.xensource.com>
	<50A22044.6060608@gmail.com>
	<1352802973.7491.40.camel@zakaz.uk.xensource.com>
	<50A225CA.2080705@gmail.com>
	<1352805173.7491.57.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352805173.7491.57.camel@zakaz.uk.xensource.com>
X-BitDefender-Spam: No (0)
X-BitDefender-SpamStamp: Build: [Engines: 2.13.3.14894, Dats: 226282,
	Stamp: 3], Multi: [Enabled], BW: [Enabled], RBL DNSBL: [Disabled],
	APM: [Enabled, Score: 500, Flags: NN_GMAIL_WITH_XMAILER_ADN;
	NN_LEGIT_VALID_REPLY; NN_EXEC_H_YAHOO_AND_GMAIL_NO_DOMAIN_KEY;
	NN_LEGIT_S_SQARE_BRACKETS; NN_LEGIT_MAILING_LIST_TO], SGN: [Enabled],
	URL: [Enabled], URI DNSBL: [Disabled], SQMD: [Enabled, Hits: none,
	MD5: 4f4c5f1d0905d9dbef385dd509407798.fuzzy.fzrbl.org], RTDA:
	[Disabled, Hit: No], total: 0(775)
X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.0 on
	elfie.dsd.hq, sigver: 7.43989
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> Perhaps it would be useful to build on the vmitools (previously
> xenaccess)? http://code.google.com/p/vmitools/

Indeed, but LibVMI does not offer event-based access, and polling is not 
really a solution.

> In general we prefer not to put stuff in the hypervisor unless
> absolutely required.

Me too :)

Thanks,
Razvan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:25:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:25:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEbq-0006OS-9Y; Tue, 13 Nov 2012 11:24:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYEbo-0006O3-Bz
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:24:48 +0000
Received: from [85.158.139.211:18749] by server-13.bemta-5.messagelabs.com id
	60/C4-27809-FFD22A05; Tue, 13 Nov 2012 11:24:47 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1352805886!19924624!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11239 invoked from network); 13 Nov 2012 11:24:47 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-206.messagelabs.com with SMTP;
	13 Nov 2012 11:24:47 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 11:24:46 +0000
Message-Id: <50A23C0C02000078000A8085@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 11:24:44 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>,
	"Yang Z Zhang" <yang.z.zhang@intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 12:13, "Zhang, Yang Z" <yang.z.zhang@intel.com> wrote:
> Jan Beulich wrote on 2012-11-13:
>>>>> On 13.11.12 at 09:50, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
>>>> From: Jan Beulich [mailto:JBeulich@suse.com]
>>>> Bottom line - I'm seeking advice as to whether working around this problem
>>>> in the IOMMU code is desirable/necessary, or whether this is a design flaw
>>>> on the device's side that just cannot be tolerated with an IOMMU in the
>>>> picture (which would need good reasoning, so that a customer expecting
>>>> such a device to work regardless of IOMMU usage can understand that this
>>>> cannot reasonably be made work).
> 
> Why not just disable the IOMMU in this case ?

Because that disables (secure) pass through of other devices.

>>> The issue is why the non-zero functions don't claim themselves during PCI bus
>>> scan.
>> 
>> As said - I can't tell whether there is a secondary function in the
>> first place (and I didn't try to find out because it doesn't really
>> matter for the purpose of finding a solution/workaround).
> 
> If software cannot see it, then how to use it? If there still have an 
> approach to detect it, then xen can do it too and setup the context entry as 
> passthrough.

We see it the latest at the point the fault occurs. So there are
multiple options:
a) if the device is "real" as in having a valid config space despite
    func 0 not advertising itself as multi-function, we have ways to
    discover the device (at boot time)
b) we could insert the context entry in the fault handler, assuming
    the device is able to recover
c) we could provide a command line option to allow fake devices to
    be created
d) we could create context entries for all BDFs, whether or not a
    device exists there
Does any of these have obvious downsides?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:25:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:25:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEbq-0006OS-9Y; Tue, 13 Nov 2012 11:24:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYEbo-0006O3-Bz
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:24:48 +0000
Received: from [85.158.139.211:18749] by server-13.bemta-5.messagelabs.com id
	60/C4-27809-FFD22A05; Tue, 13 Nov 2012 11:24:47 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1352805886!19924624!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11239 invoked from network); 13 Nov 2012 11:24:47 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-206.messagelabs.com with SMTP;
	13 Nov 2012 11:24:47 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 11:24:46 +0000
Message-Id: <50A23C0C02000078000A8085@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 11:24:44 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>,
	"Yang Z Zhang" <yang.z.zhang@intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 12:13, "Zhang, Yang Z" <yang.z.zhang@intel.com> wrote:
> Jan Beulich wrote on 2012-11-13:
>>>>> On 13.11.12 at 09:50, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
>>>> From: Jan Beulich [mailto:JBeulich@suse.com]
>>>> Bottom line - I'm seeking advice as to whether working around this problem
>>>> in the IOMMU code is desirable/necessary, or whether this is a design flaw
>>>> on the device's side that just cannot be tolerated with an IOMMU in the
>>>> picture (which would need good reasoning, so that a customer expecting
>>>> such a device to work regardless of IOMMU usage can understand that this
>>>> cannot reasonably be made work).
> 
> Why not just disable the IOMMU in this case ?

Because that disables (secure) pass through of other devices.

>>> The issue is why the non-zero functions don't claim themselves during PCI bus
>>> scan.
>> 
>> As said - I can't tell whether there is a secondary function in the
>> first place (and I didn't try to find out because it doesn't really
>> matter for the purpose of finding a solution/workaround).
> 
> If software cannot see it, then how to use it? If there still have an 
> approach to detect it, then xen can do it too and setup the context entry as 
> passthrough.

We see it the latest at the point the fault occurs. So there are
multiple options:
a) if the device is "real" as in having a valid config space despite
    func 0 not advertising itself as multi-function, we have ways to
    discover the device (at boot time)
b) we could insert the context entry in the fault handler, assuming
    the device is able to recover
c) we could provide a command line option to allow fake devices to
    be created
d) we could create context entries for all BDFs, whether or not a
    device exists there
Does any of these have obvious downsides?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:29:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:29:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEgf-0006iB-Ms; Tue, 13 Nov 2012 11:29:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYEge-0006i4-Qj
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:29:49 +0000
Received: from [85.158.143.99:26192] by server-3.bemta-4.messagelabs.com id
	98/4B-06841-C2F22A05; Tue, 13 Nov 2012 11:29:48 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1352806186!22208558!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8967 invoked from network); 13 Nov 2012 11:29:47 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-11.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 11:29:47 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="214306000"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 11:29:45 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 06:29:45 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYEga-0004OJ-Ne;
	Tue, 13 Nov 2012 11:29:44 +0000
Date: Tue, 13 Nov 2012 11:29:12 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1352478827.27833.127.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211131119010.28049@kaball.uk.xensource.com>
References: <CAN3GA=T8Ztupou=XU4a6MeMWJN5yJgN=0fmDUp0BvXFRPEfLYw@mail.gmail.com>
	<1382625.svAp90pkVF@sheik-lin>
	<1352478827.27833.127.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Hans Mueller <mcbeagle@gmx.de>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
 IO_PAGE_FAULT:
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 9 Nov 2012, Ian Campbell wrote:
> On Fri, 2012-11-09 at 16:25 +0000, Hans Mueller wrote:
> > On Thursday, 8. November 2012 20:02:51 feral wrote:
> > > Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable.  Tested against all three.
> > > 
> > > VGA passthrough previously working with 4.1 is no longer working with >4.2.
> > > 
> > > Setup - Working:
> > > Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos), libvirt-bin,
> > > xend
> > > Asus Radeon HD 7870 DirectCU.
> > > Works perfect.  Benches on par with bare metal.
> > > 
> > > Setup - Broken:
> > > Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (from GIT), xl
> > > toolstack.
> > > Asus Radeon HD 7870 DirectCU.
> > > Some times the guest boots correctly but display is never enabled.
> > >  Sometimes BSOD, doesn't seem to be any rhyme or reason?
> > > 
> > > No errors in logs.   Found the following in 'xl dmesg':
> > > (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 2, device id = 0x600, fault address =
> > > 0x1ac800000, flags = 0
> > 
> > I had a similar problem since hg revision 25818:50adc933faaf which changes the 
> > qemu tag.
> > It looks like the qemu commit 
> > 3e66da7266c84638c0e22a09c9d2b07529802576 
> > (qemu-xen-trad: fix msi_translate with PV event delivery) 
> > causes this behavior.
> > 
> > I solved the problem for me by using 'pci_msitranslate=0' in the domU config.
> 
> I don't follow this stuff closely but I could have sworn we had disabled
> msitranslate by default.
> 
> In any case I don't think that changeset was intended to cause anything
> like this -- Stefano?

No, it wasn't.

Can you please try reverting that specific commit on the qemu tree and
let me know if everything works afterwards (git revert
3e66da7266c84638c0e22a09c9d2b07529802576)?
Are you testing with a Linux or a Windows guest?

In any case, it is always safer to run with msi_translate=0, we have
found problems in the past using msi_translate with Nvidia graphic
cards.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:29:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:29:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEgf-0006iB-Ms; Tue, 13 Nov 2012 11:29:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYEge-0006i4-Qj
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:29:49 +0000
Received: from [85.158.143.99:26192] by server-3.bemta-4.messagelabs.com id
	98/4B-06841-C2F22A05; Tue, 13 Nov 2012 11:29:48 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1352806186!22208558!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8967 invoked from network); 13 Nov 2012 11:29:47 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-11.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 11:29:47 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="214306000"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 11:29:45 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 06:29:45 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYEga-0004OJ-Ne;
	Tue, 13 Nov 2012 11:29:44 +0000
Date: Tue, 13 Nov 2012 11:29:12 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1352478827.27833.127.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211131119010.28049@kaball.uk.xensource.com>
References: <CAN3GA=T8Ztupou=XU4a6MeMWJN5yJgN=0fmDUp0BvXFRPEfLYw@mail.gmail.com>
	<1382625.svAp90pkVF@sheik-lin>
	<1352478827.27833.127.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Hans Mueller <mcbeagle@gmx.de>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] PCI/VGA passthrough on >Xen-4.2 - (XEN) AMD-Vi:
 IO_PAGE_FAULT:
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 9 Nov 2012, Ian Campbell wrote:
> On Fri, 2012-11-09 at 16:25 +0000, Hans Mueller wrote:
> > On Thursday, 8. November 2012 20:02:51 feral wrote:
> > > Upgraded from Xen-4.1 to 4.2/4.3/4.3-unstable.  Tested against all three.
> > > 
> > > VGA passthrough previously working with 4.1 is no longer working with >4.2.
> > > 
> > > Setup - Working:
> > > Mint13, kernel-3.2.0-32, Xen-4.1 (from Ubuntu-Precise repos), libvirt-bin,
> > > xend
> > > Asus Radeon HD 7870 DirectCU.
> > > Works perfect.  Benches on par with bare metal.
> > > 
> > > Setup - Broken:
> > > Mint13, kernel-3.2.0-32, Xen-4.2,Xen-4.3,Xen-4.3-unstable (from GIT), xl
> > > toolstack.
> > > Asus Radeon HD 7870 DirectCU.
> > > Some times the guest boots correctly but display is never enabled.
> > >  Sometimes BSOD, doesn't seem to be any rhyme or reason?
> > > 
> > > No errors in logs.   Found the following in 'xl dmesg':
> > > (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 2, device id = 0x600, fault address =
> > > 0x1ac800000, flags = 0
> > 
> > I had a similar problem since hg revision 25818:50adc933faaf which changes the 
> > qemu tag.
> > It looks like the qemu commit 
> > 3e66da7266c84638c0e22a09c9d2b07529802576 
> > (qemu-xen-trad: fix msi_translate with PV event delivery) 
> > causes this behavior.
> > 
> > I solved the problem for me by using 'pci_msitranslate=0' in the domU config.
> 
> I don't follow this stuff closely but I could have sworn we had disabled
> msitranslate by default.
> 
> In any case I don't think that changeset was intended to cause anything
> like this -- Stefano?

No, it wasn't.

Can you please try reverting that specific commit on the qemu tree and
let me know if everything works afterwards (git revert
3e66da7266c84638c0e22a09c9d2b07529802576)?
Are you testing with a Linux or a Windows guest?

In any case, it is always safer to run with msi_translate=0, we have
found problems in the past using msi_translate with Nvidia graphic
cards.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:38:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:38:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEoo-00071g-M9; Tue, 13 Nov 2012 11:38:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYEom-00071b-NK
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:38:12 +0000
Received: from [85.158.139.83:35528] by server-11.bemta-5.messagelabs.com id
	40/CA-03409-32132A05; Tue, 13 Nov 2012 11:38:11 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352806691!29337807!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17695 invoked from network); 13 Nov 2012 11:38:11 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-182.messagelabs.com with SMTP;
	13 Nov 2012 11:38:11 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 11:38:10 +0000
Message-Id: <50A23F3102000078000A80BE@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 11:38:09 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Malcolm Crossley" <malcolm.crossley@citrix.com>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
In-Reply-To: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
Mime-Version: 1.0
Content-Disposition: inline
Cc: eddie.dong@intel.com, jun.nakajima@intel.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 12:23, Malcolm Crossley <malcolm.crossley@citrix.com> wrote:
> The self_nmi() code cause's an NMI to be triggered by sending an APIC message
> to the local processor. Unfortunately there is a delay in the delivery of 
> the
> APIC message and we may already have re-entered the HVM guest by the time the
> NMI is taken. This results in the VMEXIT code calling the self_nmi() 
> function
> again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop 
> before
> the HVM guest resumes normal operation.

But it does, eventually? I ask because ...

> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
> 
> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
> completes.

... this blocking of NMIs should last until you enter the guest
again, so I would actually expect this to be an infinite loop ...

> So we believe it is safe to directly invoke the INT call as NMI's should
> already be blocked.

... and this not only be safe, but actually required.

> diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
>                   (X86_EVENTTYPE_NMI << 8) )
>                  goto exit_and_crash;
>              HVMTRACE_0D(NMI);
> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
> +            asm("int $2"); /* Real NMI, vector 2: normal processing. */

In any case - why can't you call do_nmi() directly from here?

Jan

>              break;
>          case TRAP_machine_check:
>              HVMTRACE_0D(MCE);
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:38:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:38:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEoo-00071g-M9; Tue, 13 Nov 2012 11:38:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYEom-00071b-NK
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:38:12 +0000
Received: from [85.158.139.83:35528] by server-11.bemta-5.messagelabs.com id
	40/CA-03409-32132A05; Tue, 13 Nov 2012 11:38:11 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352806691!29337807!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17695 invoked from network); 13 Nov 2012 11:38:11 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-182.messagelabs.com with SMTP;
	13 Nov 2012 11:38:11 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 11:38:10 +0000
Message-Id: <50A23F3102000078000A80BE@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 11:38:09 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Malcolm Crossley" <malcolm.crossley@citrix.com>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
In-Reply-To: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
Mime-Version: 1.0
Content-Disposition: inline
Cc: eddie.dong@intel.com, jun.nakajima@intel.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 12:23, Malcolm Crossley <malcolm.crossley@citrix.com> wrote:
> The self_nmi() code cause's an NMI to be triggered by sending an APIC message
> to the local processor. Unfortunately there is a delay in the delivery of 
> the
> APIC message and we may already have re-entered the HVM guest by the time the
> NMI is taken. This results in the VMEXIT code calling the self_nmi() 
> function
> again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop 
> before
> the HVM guest resumes normal operation.

But it does, eventually? I ask because ...

> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
> 
> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
> completes.

... this blocking of NMIs should last until you enter the guest
again, so I would actually expect this to be an infinite loop ...

> So we believe it is safe to directly invoke the INT call as NMI's should
> already be blocked.

... and this not only be safe, but actually required.

> diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
>                   (X86_EVENTTYPE_NMI << 8) )
>                  goto exit_and_crash;
>              HVMTRACE_0D(NMI);
> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
> +            asm("int $2"); /* Real NMI, vector 2: normal processing. */

In any case - why can't you call do_nmi() directly from here?

Jan

>              break;
>          case TRAP_machine_check:
>              HVMTRACE_0D(MCE);
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:47:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:47:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYExi-0007H0-UU; Tue, 13 Nov 2012 11:47:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYExh-0007Gv-TJ
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:47:25 +0000
Received: from [193.109.254.147:25370] by server-14.bemta-14.messagelabs.com
	id 34/16-14517-D4332A05; Tue, 13 Nov 2012 11:47:25 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352807243!3917145!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12169 invoked from network); 13 Nov 2012 11:47:24 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-11.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 11:47:24 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYExW-000C2c-BZ; Tue, 13 Nov 2012 11:47:14 +0000
Date: Tue, 13 Nov 2012 11:47:14 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121113114714.GB44675@ocelot.phlegethon.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A23F3102000078000A80BE@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>, eddie.dong@intel.com,
	jun.nakajima@intel.com, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
	process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi, 

Would need to go and read manuals to comment on much of this, but...

At 11:38 +0000 on 13 Nov (1352806689), Jan Beulich wrote:
> > diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
> > --- a/xen/arch/x86/hvm/vmx/vmx.c
> > +++ b/xen/arch/x86/hvm/vmx/vmx.c
> > @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
> >                   (X86_EVENTTYPE_NMI << 8) )
> >                  goto exit_and_crash;
> >              HVMTRACE_0D(NMI);
> > -            self_nmi(); /* Real NMI, vector 2: normal processing. */
> > +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
> 
> In any case - why can't you call do_nmi() directly from here?

... this is my doing.  There used to be a call to do_nmi() here, but
do_nmi() doesn't block NMIs, so you can't just call it here in case you
get _another_ NMI while you're in the NMI handler.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:47:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:47:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYExi-0007H0-UU; Tue, 13 Nov 2012 11:47:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYExh-0007Gv-TJ
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:47:25 +0000
Received: from [193.109.254.147:25370] by server-14.bemta-14.messagelabs.com
	id 34/16-14517-D4332A05; Tue, 13 Nov 2012 11:47:25 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352807243!3917145!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12169 invoked from network); 13 Nov 2012 11:47:24 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-11.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 11:47:24 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYExW-000C2c-BZ; Tue, 13 Nov 2012 11:47:14 +0000
Date: Tue, 13 Nov 2012 11:47:14 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121113114714.GB44675@ocelot.phlegethon.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A23F3102000078000A80BE@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>, eddie.dong@intel.com,
	jun.nakajima@intel.com, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
	process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi, 

Would need to go and read manuals to comment on much of this, but...

At 11:38 +0000 on 13 Nov (1352806689), Jan Beulich wrote:
> > diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
> > --- a/xen/arch/x86/hvm/vmx/vmx.c
> > +++ b/xen/arch/x86/hvm/vmx/vmx.c
> > @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
> >                   (X86_EVENTTYPE_NMI << 8) )
> >                  goto exit_and_crash;
> >              HVMTRACE_0D(NMI);
> > -            self_nmi(); /* Real NMI, vector 2: normal processing. */
> > +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
> 
> In any case - why can't you call do_nmi() directly from here?

... this is my doing.  There used to be a call to do_nmi() here, but
do_nmi() doesn't block NMIs, so you can't just call it here in case you
get _another_ NMI while you're in the NMI handler.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:48:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:48:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEyr-0007LH-Dm; Tue, 13 Nov 2012 11:48:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TYEyq-0007L7-1N
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:48:36 +0000
Received: from [85.158.139.83:7036] by server-1.bemta-5.messagelabs.com id
	D3/1F-05877-39332A05; Tue, 13 Nov 2012 11:48:35 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352807313!22820211!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30210 invoked from network); 13 Nov 2012 11:48:34 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-11.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 11:48:34 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="214307146"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 11:48:04 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 06:48:04 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TYEyJ-0004e6-Lf	for
	xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:48:03 +0000
Message-ID: <50A23373.3020805@citrix.com>
Date: Tue, 13 Nov 2012 11:48:03 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel@lists.xen.org
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
In-Reply-To: <50A23F3102000078000A80BE@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.5
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 13/11/12 11:38, Jan Beulich wrote:
>>>> On 13.11.12 at 12:23, Malcolm Crossley <malcolm.crossley@citrix.com> wrote:
>> The self_nmi() code cause's an NMI to be triggered by sending an APIC message
>> to the local processor. Unfortunately there is a delay in the delivery of 
>> the
>> APIC message and we may already have re-entered the HVM guest by the time the
>> NMI is taken. This results in the VMEXIT code calling the self_nmi() 
>> function
>> again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop 
>> before
>> the HVM guest resumes normal operation.
> But it does, eventually? I ask because ...
>
>> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
>>
>> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
>> completes.
> ... this blocking of NMIs should last until you enter the guest
> again, so I would actually expect this to be an infinite loop ...

The observed behaviour was some other event like a timer interrupt
breaking it out of the loop and taking a different path through the
vmexit handler.

>
>> So we believe it is safe to directly invoke the INT call as NMI's should
>> already be blocked.
> ... and this not only be safe, but actually required.
>
>> diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>> @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
>>                   (X86_EVENTTYPE_NMI << 8) )
>>                  goto exit_and_crash;
>>              HVMTRACE_0D(NMI);
>> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>> +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
> In any case - why can't you call do_nmi() directly from here?
>
> Jan

Actually, thinking about it that is a better idea than my suggestion,
because if for some reason another, different NMI occurs (the Intel SDM
is not exactly clear on exactly when NMIs are blocked till), the other
NMI will enter on the real NMI stack and not trample over itself.

~Andrew

>
>>              break;
>>          case TRAP_machine_check:
>>              HVMTRACE_0D(MCE);
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org 
>> http://lists.xen.org/xen-devel 
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:48:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:48:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYEyr-0007LH-Dm; Tue, 13 Nov 2012 11:48:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TYEyq-0007L7-1N
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:48:36 +0000
Received: from [85.158.139.83:7036] by server-1.bemta-5.messagelabs.com id
	D3/1F-05877-39332A05; Tue, 13 Nov 2012 11:48:35 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352807313!22820211!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30210 invoked from network); 13 Nov 2012 11:48:34 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-11.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 11:48:34 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="214307146"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 11:48:04 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 06:48:04 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TYEyJ-0004e6-Lf	for
	xen-devel@lists.xen.org; Tue, 13 Nov 2012 11:48:03 +0000
Message-ID: <50A23373.3020805@citrix.com>
Date: Tue, 13 Nov 2012 11:48:03 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel@lists.xen.org
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
In-Reply-To: <50A23F3102000078000A80BE@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.5
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 13/11/12 11:38, Jan Beulich wrote:
>>>> On 13.11.12 at 12:23, Malcolm Crossley <malcolm.crossley@citrix.com> wrote:
>> The self_nmi() code cause's an NMI to be triggered by sending an APIC message
>> to the local processor. Unfortunately there is a delay in the delivery of 
>> the
>> APIC message and we may already have re-entered the HVM guest by the time the
>> NMI is taken. This results in the VMEXIT code calling the self_nmi() 
>> function
>> again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop 
>> before
>> the HVM guest resumes normal operation.
> But it does, eventually? I ask because ...
>
>> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
>>
>> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
>> completes.
> ... this blocking of NMIs should last until you enter the guest
> again, so I would actually expect this to be an infinite loop ...

The observed behaviour was some other event like a timer interrupt
breaking it out of the loop and taking a different path through the
vmexit handler.

>
>> So we believe it is safe to directly invoke the INT call as NMI's should
>> already be blocked.
> ... and this not only be safe, but actually required.
>
>> diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>> @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
>>                   (X86_EVENTTYPE_NMI << 8) )
>>                  goto exit_and_crash;
>>              HVMTRACE_0D(NMI);
>> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>> +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
> In any case - why can't you call do_nmi() directly from here?
>
> Jan

Actually, thinking about it that is a better idea than my suggestion,
because if for some reason another, different NMI occurs (the Intel SDM
is not exactly clear on exactly when NMIs are blocked till), the other
NMI will enter on the real NMI stack and not trample over itself.

~Andrew

>
>>              break;
>>          case TRAP_machine_check:
>>              HVMTRACE_0D(MCE);
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org 
>> http://lists.xen.org/xen-devel 
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:58:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:58:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYF8R-0007d6-Gw; Tue, 13 Nov 2012 11:58:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYF8P-0007d1-W0
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 11:58:30 +0000
Received: from [193.109.254.147:43923] by server-4.bemta-14.messagelabs.com id
	03/54-18856-5E532A05; Tue, 13 Nov 2012 11:58:29 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1352807907!10776948!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31895 invoked from network); 13 Nov 2012 11:58:28 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 11:58:28 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="214307677"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 11:57:58 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 06:57:58 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYF7t-0004n3-IJ;
	Tue, 13 Nov 2012 11:57:57 +0000
Date: Tue, 13 Nov 2012 11:57:25 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Tim Deegan <tim@xen.org>
In-Reply-To: <20121027100929.GA89901@ocelot.phlegethon.org>
Message-ID: <alpine.DEB.2.02.1211131156270.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1210241455080.2689@kaball.uk.xensource.com>
	<1351091027-20740-1-git-send-email-stefano.stabellini@eu.citrix.com>
	<1351157246.18035.129.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1210261732000.2689@kaball.uk.xensource.com>
	<1351269622.15162.105.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1210261940300.2689@kaball.uk.xensource.com>
	<1351284440.12176.9.camel@dagon.hellion.org.uk>
	<20121027100929.GA89901@ocelot.phlegethon.org>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/7] xen/arm: fix rank calculation in
 vgic_vcpu_inject_irq
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, 27 Oct 2012, Tim Deegan wrote:
> At 21:47 +0100 on 26 Oct (1351288040), Ian Campbell wrote:
> > On Fri, 2012-10-26 at 19:42 +0100, Stefano Stabellini wrote:
> > > I think that the problem is the usage of vgic_irq_rank with registers
> > > that have 1 bit per interrupt.
> > 
> > That's very plausible indeed.
> > 
> > > diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
> > > index 3c3983f..92731b6 100644
> > > --- a/xen/arch/arm/vgic.c
> > > +++ b/xen/arch/arm/vgic.c
> > > @@ -42,13 +42,7 @@
> > >   */
> > >  static inline int REG_RANK_NR(int b, uint32_t n)
> > >  {
> > > -    switch ( b )
> > > -    {
> > > -    case 8: return n >> 3;
> > > -    case 4: return n >> 2;
> > > -    case 2: return n >> 1;
> > > -    default: BUG();
> > > -    }
> > > +    return n / b;
> > 
> > All the infrastructure will fall apart if b isn't a power of two, that's
> > why I used the switch. Can you just add the appropriate case 1 instead?
> > Probably the bug should be a call to an undefined function to make this
> > a compile time rather than runtime failure too.
> 
> BUILD_BUG_ON((b & -b) != b); ?

I can't do that:

error: expression in static assertion is not constant

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 11:58:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 11:58:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYF8R-0007d6-Gw; Tue, 13 Nov 2012 11:58:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYF8P-0007d1-W0
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 11:58:30 +0000
Received: from [193.109.254.147:43923] by server-4.bemta-14.messagelabs.com id
	03/54-18856-5E532A05; Tue, 13 Nov 2012 11:58:29 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1352807907!10776948!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31895 invoked from network); 13 Nov 2012 11:58:28 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 11:58:28 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="214307677"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 11:57:58 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 06:57:58 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYF7t-0004n3-IJ;
	Tue, 13 Nov 2012 11:57:57 +0000
Date: Tue, 13 Nov 2012 11:57:25 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Tim Deegan <tim@xen.org>
In-Reply-To: <20121027100929.GA89901@ocelot.phlegethon.org>
Message-ID: <alpine.DEB.2.02.1211131156270.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1210241455080.2689@kaball.uk.xensource.com>
	<1351091027-20740-1-git-send-email-stefano.stabellini@eu.citrix.com>
	<1351157246.18035.129.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1210261732000.2689@kaball.uk.xensource.com>
	<1351269622.15162.105.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1210261940300.2689@kaball.uk.xensource.com>
	<1351284440.12176.9.camel@dagon.hellion.org.uk>
	<20121027100929.GA89901@ocelot.phlegethon.org>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/7] xen/arm: fix rank calculation in
 vgic_vcpu_inject_irq
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, 27 Oct 2012, Tim Deegan wrote:
> At 21:47 +0100 on 26 Oct (1351288040), Ian Campbell wrote:
> > On Fri, 2012-10-26 at 19:42 +0100, Stefano Stabellini wrote:
> > > I think that the problem is the usage of vgic_irq_rank with registers
> > > that have 1 bit per interrupt.
> > 
> > That's very plausible indeed.
> > 
> > > diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
> > > index 3c3983f..92731b6 100644
> > > --- a/xen/arch/arm/vgic.c
> > > +++ b/xen/arch/arm/vgic.c
> > > @@ -42,13 +42,7 @@
> > >   */
> > >  static inline int REG_RANK_NR(int b, uint32_t n)
> > >  {
> > > -    switch ( b )
> > > -    {
> > > -    case 8: return n >> 3;
> > > -    case 4: return n >> 2;
> > > -    case 2: return n >> 1;
> > > -    default: BUG();
> > > -    }
> > > +    return n / b;
> > 
> > All the infrastructure will fall apart if b isn't a power of two, that's
> > why I used the switch. Can you just add the appropriate case 1 instead?
> > Probably the bug should be a call to an undefined function to make this
> > a compile time rather than runtime failure too.
> 
> BUILD_BUG_ON((b & -b) != b); ?

I can't do that:

error: expression in static assertion is not constant

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:01:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:01:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYFAz-0007pb-Ob; Tue, 13 Nov 2012 12:01:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYFAx-0007pE-HL
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 12:01:07 +0000
Received: from [85.158.139.83:52461] by server-1.bemta-5.messagelabs.com id
	7B/37-05877-28632A05; Tue, 13 Nov 2012 12:01:06 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1352808065!29761760!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14338 invoked from network); 13 Nov 2012 12:01:05 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 12:01:05 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15775726"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 12:00:55 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 12:00:55 +0000
Message-ID: <1352808054.7491.66.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Tue, 13 Nov 2012 12:00:54 +0000
In-Reply-To: <alpine.DEB.2.02.1211131156270.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1210241455080.2689@kaball.uk.xensource.com>
	<1351091027-20740-1-git-send-email-stefano.stabellini@eu.citrix.com>
	<1351157246.18035.129.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1210261732000.2689@kaball.uk.xensource.com>
	<1351269622.15162.105.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1210261940300.2689@kaball.uk.xensource.com>
	<1351284440.12176.9.camel@dagon.hellion.org.uk>
	<20121027100929.GA89901@ocelot.phlegethon.org>
	<alpine.DEB.2.02.1211131156270.28049@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"Tim \(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 1/7] xen/arm: fix rank calculation in
 vgic_vcpu_inject_irq
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 11:57 +0000, Stefano Stabellini wrote:
> On Sat, 27 Oct 2012, Tim Deegan wrote:
> > At 21:47 +0100 on 26 Oct (1351288040), Ian Campbell wrote:
> > > On Fri, 2012-10-26 at 19:42 +0100, Stefano Stabellini wrote:
> > > > I think that the problem is the usage of vgic_irq_rank with registers
> > > > that have 1 bit per interrupt.
> > > 
> > > That's very plausible indeed.
> > > 
> > > > diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
> > > > index 3c3983f..92731b6 100644
> > > > --- a/xen/arch/arm/vgic.c
> > > > +++ b/xen/arch/arm/vgic.c
> > > > @@ -42,13 +42,7 @@
> > > >   */
> > > >  static inline int REG_RANK_NR(int b, uint32_t n)
> > > >  {
> > > > -    switch ( b )
> > > > -    {
> > > > -    case 8: return n >> 3;
> > > > -    case 4: return n >> 2;
> > > > -    case 2: return n >> 1;
> > > > -    default: BUG();
> > > > -    }
> > > > +    return n / b;
> > > 
> > > All the infrastructure will fall apart if b isn't a power of two, that's
> > > why I used the switch. Can you just add the appropriate case 1 instead?
> > > Probably the bug should be a call to an undefined function to make this
> > > a compile time rather than runtime failure too.
> > 
> > BUILD_BUG_ON((b & -b) != b); ?
> 
> I can't do that:
> 
> error: expression in static assertion is not constant

I suppose you could make REG_RANK_NR a macro (as it's name implies it
ought to be, oops!).

If not then given that b must be in {1,2,4,8} maybe the switch is
ok/tolerable? If we end up supporting b=16 or 32 then more thought is
probably required around the place anyway.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:01:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:01:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYFAz-0007pb-Ob; Tue, 13 Nov 2012 12:01:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYFAx-0007pE-HL
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 12:01:07 +0000
Received: from [85.158.139.83:52461] by server-1.bemta-5.messagelabs.com id
	7B/37-05877-28632A05; Tue, 13 Nov 2012 12:01:06 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1352808065!29761760!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14338 invoked from network); 13 Nov 2012 12:01:05 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 12:01:05 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15775726"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 12:00:55 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 12:00:55 +0000
Message-ID: <1352808054.7491.66.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Tue, 13 Nov 2012 12:00:54 +0000
In-Reply-To: <alpine.DEB.2.02.1211131156270.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1210241455080.2689@kaball.uk.xensource.com>
	<1351091027-20740-1-git-send-email-stefano.stabellini@eu.citrix.com>
	<1351157246.18035.129.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1210261732000.2689@kaball.uk.xensource.com>
	<1351269622.15162.105.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1210261940300.2689@kaball.uk.xensource.com>
	<1351284440.12176.9.camel@dagon.hellion.org.uk>
	<20121027100929.GA89901@ocelot.phlegethon.org>
	<alpine.DEB.2.02.1211131156270.28049@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"Tim \(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 1/7] xen/arm: fix rank calculation in
 vgic_vcpu_inject_irq
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 11:57 +0000, Stefano Stabellini wrote:
> On Sat, 27 Oct 2012, Tim Deegan wrote:
> > At 21:47 +0100 on 26 Oct (1351288040), Ian Campbell wrote:
> > > On Fri, 2012-10-26 at 19:42 +0100, Stefano Stabellini wrote:
> > > > I think that the problem is the usage of vgic_irq_rank with registers
> > > > that have 1 bit per interrupt.
> > > 
> > > That's very plausible indeed.
> > > 
> > > > diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
> > > > index 3c3983f..92731b6 100644
> > > > --- a/xen/arch/arm/vgic.c
> > > > +++ b/xen/arch/arm/vgic.c
> > > > @@ -42,13 +42,7 @@
> > > >   */
> > > >  static inline int REG_RANK_NR(int b, uint32_t n)
> > > >  {
> > > > -    switch ( b )
> > > > -    {
> > > > -    case 8: return n >> 3;
> > > > -    case 4: return n >> 2;
> > > > -    case 2: return n >> 1;
> > > > -    default: BUG();
> > > > -    }
> > > > +    return n / b;
> > > 
> > > All the infrastructure will fall apart if b isn't a power of two, that's
> > > why I used the switch. Can you just add the appropriate case 1 instead?
> > > Probably the bug should be a call to an undefined function to make this
> > > a compile time rather than runtime failure too.
> > 
> > BUILD_BUG_ON((b & -b) != b); ?
> 
> I can't do that:
> 
> error: expression in static assertion is not constant

I suppose you could make REG_RANK_NR a macro (as it's name implies it
ought to be, oops!).

If not then given that b must be in {1,2,4,8} maybe the switch is
ok/tolerable? If we end up supporting b=16 or 32 then more thought is
probably required around the place anyway.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:02:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:02:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYFBz-0007ym-8j; Tue, 13 Nov 2012 12:02:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYFBy-0007yb-4B
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 12:02:10 +0000
Received: from [85.158.143.99:24855] by server-2.bemta-4.messagelabs.com id
	41/3A-28922-1C632A05; Tue, 13 Nov 2012 12:02:09 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352808127!29171154!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4966 invoked from network); 13 Nov 2012 12:02:08 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-3.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 12:02:08 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="44387694"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 12:02:07 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 07:02:07 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYFBu-0004rb-Jn;
	Tue, 13 Nov 2012 12:02:06 +0000
Date: Tue, 13 Nov 2012 12:01:34 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Tim Deegan <tim@xen.org>
In-Reply-To: <20121027104428.GB89901@ocelot.phlegethon.org>
Message-ID: <alpine.DEB.2.02.1211131159060.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1210241455080.2689@kaball.uk.xensource.com>
	<1351091027-20740-6-git-send-email-stefano.stabellini@eu.citrix.com>
	<20121024155945.GD39126@ocelot.phlegethon.org>
	<alpine.DEB.2.02.1210241706160.2689@kaball.uk.xensource.com>
	<20121026090141.GB76080@ocelot.phlegethon.org>
	<alpine.DEB.2.02.1210261646490.2689@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1210261654590.2689@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1210261700310.2689@kaball.uk.xensource.com>
	<20121026165549.GF76080@ocelot.phlegethon.org>
	<alpine.DEB.2.02.1210261937180.2689@kaball.uk.xensource.com>
	<20121027104428.GB89901@ocelot.phlegethon.org>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 6/7] xen/arm: flush D-cache and I-cache when
 appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, 27 Oct 2012, Tim Deegan wrote:
> At 19:40 +0100 on 26 Oct (1351280413), Stefano Stabellini wrote:
> > > No!  It's always safe to flush the entire line -- regardless of what
> > > other writes might be happening to it.  After all, the cache controller
> > > might evict that line on its own at any time, so nothing can be relying
> > > on its _not_ being flushed.
> > > 
> > > The only problem with not knowing how big a cacheline is is this: if the
> > > object is _bigger_ than a cache line we might use one DCCMVAC where more
> > > than one is needed.  We can avoid that by a compile-time check on some
> > > sort of architectural minimum cacheline size.
> >  
> > If we want to do that then we need to pass a size argument to
> > flush_xen_dcache_va and have a loop in the function, each iteration
> > flushing a cacheline:
> > 
> > static inline void flush_xen_dcache_va(void *p, unsigned long size)
> > {
> >     unsigned long cacheline_size = READ_CP32(CCSIDR);
> >     unsigned long i;
> >     for (i = 0; i < size; i += cacheline_size, p += cacheline_size) {
> >         asm volatile (
> >             "dsb;"
> >             STORE_CP32(0, DCCMVAC)
> >             "dsb;"
> >             : : "r" (p));
> >     }
> > }
> 
> I think we should have two functions.  One should look almost like that
> and be for flushing large ranges, and one much simpler for flushing
> small items.  Like this (totally untested, uncompiled even):
> 
>  #define MIN_CACHELINE_BYTES 32 // or whatever
> 
>  /* In setup.c somewhere. */
>  if ( READ_CP32(CCSIDR) < MIN_CACHELINE_BYTES )
>      panic("CPU has preposterously small cache lines");
> 
>  /* Function for flushing medium-sized areas.
>   * if 'range' is large enough we might want to use model-specific
>   * full-cache flushes. */
>  static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
>  {
>      void *end;
>      unsigned long cacheline_bytes = READ_CP32(CCSIDR);
>      barrier();       /* So the compiler issues all writes to the range */
>      dsb();           /* So the CPU issues all writes to the range */ 
>      for ( end = p + size; p < end; p += cacheline_bytes )
>          WRITE_CP32(DCCMVAC, p);
>      dsb();           /* So we know the flushes happen before continuing */
>  }
> 
>  /* Macro for flushing a single small item.  The predicate is always 
>   * compile-time constant so this will compile down to 3 instructions in
>   * the common case.  Make sure to call it with the correct type of
>   * pointer! */
>  #define flush_xen_dcache_va(p) do {                       \
>      typeof(p) _p = (p);                                   \
>      if ( (sizeof *_p) > MIN_CACHELINE_BYTES )             \
>          flush_xen_dcache_va_range(_p, sizeof *_p);        \
>      else                                                  \
>          asm volatile (                                    \
>              "dsb;"   /* Finish all earlier writes */      \
>              STORE_CP32(0, DCCMVAC)                        \
>              "dsb;"   /* Finish flush before continuing */ \
>              : : "r" (_p), "m" (*_p));                     \
>  } while (0)
> 
> What do you think?

I think that is OK, but I would like to avoid reading CCSIDR every
single time we need to do a dcache flush, I don't know how slow that
coprocessor read is but I wouldn't want to have to find out :)

I am thinking of introducing a global variable to hold the cacheline
size and initialize it in start_xen.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:02:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:02:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYFBz-0007ym-8j; Tue, 13 Nov 2012 12:02:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYFBy-0007yb-4B
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 12:02:10 +0000
Received: from [85.158.143.99:24855] by server-2.bemta-4.messagelabs.com id
	41/3A-28922-1C632A05; Tue, 13 Nov 2012 12:02:09 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352808127!29171154!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4966 invoked from network); 13 Nov 2012 12:02:08 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-3.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 12:02:08 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="44387694"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 12:02:07 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 07:02:07 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYFBu-0004rb-Jn;
	Tue, 13 Nov 2012 12:02:06 +0000
Date: Tue, 13 Nov 2012 12:01:34 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Tim Deegan <tim@xen.org>
In-Reply-To: <20121027104428.GB89901@ocelot.phlegethon.org>
Message-ID: <alpine.DEB.2.02.1211131159060.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1210241455080.2689@kaball.uk.xensource.com>
	<1351091027-20740-6-git-send-email-stefano.stabellini@eu.citrix.com>
	<20121024155945.GD39126@ocelot.phlegethon.org>
	<alpine.DEB.2.02.1210241706160.2689@kaball.uk.xensource.com>
	<20121026090141.GB76080@ocelot.phlegethon.org>
	<alpine.DEB.2.02.1210261646490.2689@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1210261654590.2689@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1210261700310.2689@kaball.uk.xensource.com>
	<20121026165549.GF76080@ocelot.phlegethon.org>
	<alpine.DEB.2.02.1210261937180.2689@kaball.uk.xensource.com>
	<20121027104428.GB89901@ocelot.phlegethon.org>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 6/7] xen/arm: flush D-cache and I-cache when
 appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, 27 Oct 2012, Tim Deegan wrote:
> At 19:40 +0100 on 26 Oct (1351280413), Stefano Stabellini wrote:
> > > No!  It's always safe to flush the entire line -- regardless of what
> > > other writes might be happening to it.  After all, the cache controller
> > > might evict that line on its own at any time, so nothing can be relying
> > > on its _not_ being flushed.
> > > 
> > > The only problem with not knowing how big a cacheline is is this: if the
> > > object is _bigger_ than a cache line we might use one DCCMVAC where more
> > > than one is needed.  We can avoid that by a compile-time check on some
> > > sort of architectural minimum cacheline size.
> >  
> > If we want to do that then we need to pass a size argument to
> > flush_xen_dcache_va and have a loop in the function, each iteration
> > flushing a cacheline:
> > 
> > static inline void flush_xen_dcache_va(void *p, unsigned long size)
> > {
> >     unsigned long cacheline_size = READ_CP32(CCSIDR);
> >     unsigned long i;
> >     for (i = 0; i < size; i += cacheline_size, p += cacheline_size) {
> >         asm volatile (
> >             "dsb;"
> >             STORE_CP32(0, DCCMVAC)
> >             "dsb;"
> >             : : "r" (p));
> >     }
> > }
> 
> I think we should have two functions.  One should look almost like that
> and be for flushing large ranges, and one much simpler for flushing
> small items.  Like this (totally untested, uncompiled even):
> 
>  #define MIN_CACHELINE_BYTES 32 // or whatever
> 
>  /* In setup.c somewhere. */
>  if ( READ_CP32(CCSIDR) < MIN_CACHELINE_BYTES )
>      panic("CPU has preposterously small cache lines");
> 
>  /* Function for flushing medium-sized areas.
>   * if 'range' is large enough we might want to use model-specific
>   * full-cache flushes. */
>  static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
>  {
>      void *end;
>      unsigned long cacheline_bytes = READ_CP32(CCSIDR);
>      barrier();       /* So the compiler issues all writes to the range */
>      dsb();           /* So the CPU issues all writes to the range */ 
>      for ( end = p + size; p < end; p += cacheline_bytes )
>          WRITE_CP32(DCCMVAC, p);
>      dsb();           /* So we know the flushes happen before continuing */
>  }
> 
>  /* Macro for flushing a single small item.  The predicate is always 
>   * compile-time constant so this will compile down to 3 instructions in
>   * the common case.  Make sure to call it with the correct type of
>   * pointer! */
>  #define flush_xen_dcache_va(p) do {                       \
>      typeof(p) _p = (p);                                   \
>      if ( (sizeof *_p) > MIN_CACHELINE_BYTES )             \
>          flush_xen_dcache_va_range(_p, sizeof *_p);        \
>      else                                                  \
>          asm volatile (                                    \
>              "dsb;"   /* Finish all earlier writes */      \
>              STORE_CP32(0, DCCMVAC)                        \
>              "dsb;"   /* Finish flush before continuing */ \
>              : : "r" (_p), "m" (*_p));                     \
>  } while (0)
> 
> What do you think?

I think that is OK, but I would like to avoid reading CCSIDR every
single time we need to do a dcache flush, I don't know how slow that
coprocessor read is but I wouldn't want to have to find out :)

I am thinking of introducing a global variable to hold the cacheline
size and initialize it in start_xen.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:06:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:06:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYFFk-0008Fj-V4; Tue, 13 Nov 2012 12:06:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYFFj-0008FZ-AI
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 12:06:03 +0000
Received: from [85.158.139.211:7944] by server-11.bemta-5.messagelabs.com id
	C3/05-03409-AA732A05; Tue, 13 Nov 2012 12:06:02 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1352808361!19545744!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9099 invoked from network); 13 Nov 2012 12:06:01 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 12:06:01 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYFFb-000C6W-Ps; Tue, 13 Nov 2012 12:05:55 +0000
Date: Tue, 13 Nov 2012 12:05:55 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121113120555.GC44675@ocelot.phlegethon.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121113114714.GB44675@ocelot.phlegethon.org>
User-Agent: Mutt/1.4.2.1i
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>, eddie.dong@intel.com,
	jun.nakajima@intel.com, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
	process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 11:47 +0000 on 13 Nov (1352807234), Tim Deegan wrote:
> At 11:38 +0000 on 13 Nov (1352806689), Jan Beulich wrote:
> > > diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
> > > --- a/xen/arch/x86/hvm/vmx/vmx.c
> > > +++ b/xen/arch/x86/hvm/vmx/vmx.c
> > > @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
> > >                   (X86_EVENTTYPE_NMI << 8) )
> > >                  goto exit_and_crash;
> > >              HVMTRACE_0D(NMI);
> > > -            self_nmi(); /* Real NMI, vector 2: normal processing. */
> > > +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
> > 
> > In any case - why can't you call do_nmi() directly from here?
> 
> ... this is my doing.  There used to be a call to do_nmi() here, but
> do_nmi() doesn't block NMIs, so you can't just call it here in case you
> get _another_ NMI while you're in the NMI handler.

Oh wait, I see -- you're saying that this (20059:76a65bf2aa4d) is wrong
because NMIs are indeed blocked, and have been since the VMEXIT.

In that case, I agree that we should just run the NMI handler, but first
I would really like to know what _unblocks_ NMIs in this case.  Any of
the things I can think of (the next vmenter, the next iret, ??) will
need some handling to make sure they actually happen before, say, we
take this CPU into the idle loop...

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:06:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:06:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYFFk-0008Fj-V4; Tue, 13 Nov 2012 12:06:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYFFj-0008FZ-AI
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 12:06:03 +0000
Received: from [85.158.139.211:7944] by server-11.bemta-5.messagelabs.com id
	C3/05-03409-AA732A05; Tue, 13 Nov 2012 12:06:02 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1352808361!19545744!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9099 invoked from network); 13 Nov 2012 12:06:01 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 12:06:01 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYFFb-000C6W-Ps; Tue, 13 Nov 2012 12:05:55 +0000
Date: Tue, 13 Nov 2012 12:05:55 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121113120555.GC44675@ocelot.phlegethon.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121113114714.GB44675@ocelot.phlegethon.org>
User-Agent: Mutt/1.4.2.1i
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>, eddie.dong@intel.com,
	jun.nakajima@intel.com, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
	process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 11:47 +0000 on 13 Nov (1352807234), Tim Deegan wrote:
> At 11:38 +0000 on 13 Nov (1352806689), Jan Beulich wrote:
> > > diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
> > > --- a/xen/arch/x86/hvm/vmx/vmx.c
> > > +++ b/xen/arch/x86/hvm/vmx/vmx.c
> > > @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
> > >                   (X86_EVENTTYPE_NMI << 8) )
> > >                  goto exit_and_crash;
> > >              HVMTRACE_0D(NMI);
> > > -            self_nmi(); /* Real NMI, vector 2: normal processing. */
> > > +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
> > 
> > In any case - why can't you call do_nmi() directly from here?
> 
> ... this is my doing.  There used to be a call to do_nmi() here, but
> do_nmi() doesn't block NMIs, so you can't just call it here in case you
> get _another_ NMI while you're in the NMI handler.

Oh wait, I see -- you're saying that this (20059:76a65bf2aa4d) is wrong
because NMIs are indeed blocked, and have been since the VMEXIT.

In that case, I agree that we should just run the NMI handler, but first
I would really like to know what _unblocks_ NMIs in this case.  Any of
the things I can think of (the next vmenter, the next iret, ??) will
need some handling to make sure they actually happen before, say, we
take this CPU into the idle loop...

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:06:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:06:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYFG3-0008I1-Fo; Tue, 13 Nov 2012 12:06:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYE3b-0004PX-Fw
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:49:28 +0000
Received: from [85.158.138.51:7043] by server-15.bemta-3.messagelabs.com id
	64/AD-09445-6B522A05; Tue, 13 Nov 2012 10:49:26 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1352803762!27912505!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=Mail larger than max spam size
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22352 invoked from network); 13 Nov 2012 10:49:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:49:23 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15773595"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:49:17 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:49:16 +0000
Message-ID: <1352803755.7491.47.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Tue, 13 Nov 2012 10:49:15 +0000
In-Reply-To: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
X-Mailman-Approved-At: Tue, 13 Nov 2012 12:06:22 +0000
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-01 at 20:35 +0000, Matthew Fioravante wrote:
> Remove the old vtpm process model. It doesn't work very
> well and is no longer supported.
> 
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> 
> diff --git a/tools/Makefile b/tools/Makefile
> index d8c8cc0..2ca43b9 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -18,8 +18,6 @@ SUBDIRS-$(CONFIG_XCUTILS) += xcutils
>  SUBDIRS-$(CONFIG_X86) += firmware
>  SUBDIRS-y += console
>  SUBDIRS-y += xenmon
> -SUBDIRS-$(VTPM_TOOLS) += vtpm_manager
> -SUBDIRS-$(VTPM_TOOLS) += vtpm
>  SUBDIRS-y += xenstat
>  SUBDIRS-$(CONFIG_Linux) += $(SUBDIRS-libaio)
>  SUBDIRS-$(CONFIG_Linux) += memshr
> diff --git a/tools/blktap2/drivers/hashtable.c b/tools/blktap2/drivers/hashtable.c
> index 631306b..90a6b85 100644
> --- a/tools/blktap2/drivers/hashtable.c
> +++ b/tools/blktap2/drivers/hashtable.c
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/xenstore/hashtable.c
> - *  - tools/vtpm_manager/util/hashtable.c
>   */
> 
>  #include "hashtable.h"
> diff --git a/tools/blktap2/drivers/hashtable.h b/tools/blktap2/drivers/hashtable.h
> index 89aa3dc..56ca053 100644
> --- a/tools/blktap2/drivers/hashtable.h
> +++ b/tools/blktap2/drivers/hashtable.h
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/xenstore/hashtable.h
> - *  - tools/vtpm_manager/util/hashtable.h
>   */
> 
>  #ifndef __HASHTABLE_CWC22_H__
> diff --git a/tools/blktap2/drivers/hashtable_itr.c b/tools/blktap2/drivers/hashtable_itr.c
> index 402e06b..731917c 100644
> --- a/tools/blktap2/drivers/hashtable_itr.c
> +++ b/tools/blktap2/drivers/hashtable_itr.c
> @@ -1,10 +1,5 @@
>  /* Copyright (C) 2002, 2004 Christopher Clark  <firstname.lastname@cl.cam.ac.uk> */
> 
> -/*
> - * There are duplicates of this code in:
> - *  - tools/vtpm_manager/util/hashtable_itr.c
> - */
> -
>  #include "hashtable.h"
>  #include "hashtable_private.h"
>  #include "hashtable_itr.h"
> diff --git a/tools/blktap2/drivers/hashtable_itr.h b/tools/blktap2/drivers/hashtable_itr.h
> index 3d80638..81da838 100644
> --- a/tools/blktap2/drivers/hashtable_itr.h
> +++ b/tools/blktap2/drivers/hashtable_itr.h
> @@ -1,10 +1,5 @@
>  /* Copyright (C) 2002, 2004 Christopher Clark <firstname.lastname@cl.cam.ac.uk> */
> 
> -/*
> - * There are duplicates of this code in:
> - *  - tools/vtpm_manager/util/hashtable_itr.h
> - */
> -
>  #ifndef __HASHTABLE_ITR_CWC22__
>  #define __HASHTABLE_ITR_CWC22__
>  #include "hashtable.h"
> diff --git a/tools/blktap2/drivers/hashtable_private.h b/tools/blktap2/drivers/hashtable_private.h
> index 5a13a65..954ecc3 100644
> --- a/tools/blktap2/drivers/hashtable_private.h
> +++ b/tools/blktap2/drivers/hashtable_private.h
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/xenstore/hashtable_private.h
> - *  - tools/vtpm_manager/util/hashtable_private.h
>   */
> 
>  #ifndef __HASHTABLE_PRIVATE_CWC22_H__
> diff --git a/tools/configure.ac b/tools/configure.ac
> index e708f01..586313d 100644
> --- a/tools/configure.ac
> +++ b/tools/configure.ac
> @@ -40,7 +40,6 @@ m4_include([m4/fetcher.m4])
>  # Enable/disable options
>  AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
>  AX_ARG_DEFAULT_ENABLE([monitors], [Disable xenstat and xentop monitoring tools])
> -AX_ARG_DEFAULT_DISABLE([vtpm], [Enable Virtual Trusted Platform Module])
>  AX_ARG_DEFAULT_DISABLE([xenapi], [Enable Xen API Bindings])
>  AX_ARG_DEFAULT_ENABLE([ocamltools], [Disable Ocaml tools])
>  AX_ARG_DEFAULT_DISABLE([miniterm], [Enable miniterm])
> diff --git a/tools/examples/README b/tools/examples/README
> index 5b0314e..2225d5c 100644
> --- a/tools/examples/README
> +++ b/tools/examples/README
> @@ -25,13 +25,7 @@ vif-bridge          - virtual network start/stop script in bridged mode
>  vif-common.sh       - sourced by vif-bridge
>  vif-nat             - xen virtual network start/stop script in NAT mode
>  vif-route           - xen virtual network start/stop script in routed mode
> -vtpm                - called by xen-backend.agent to bind/unbind vTPM devices
> -vtpm-common.sh      - common code for vTPM handling
> -vtpm-delete         - remove an entry from the vTPM table given the
> -                      domain's name
> -vtpm-hotplug-common.sh - sourced by vtpm
> -vtpm-migration.sh   - sourced by external-device-migrate
> -xen-backend.agent   - calls block, vif-*, vtpm scripts to add, remove, hotplug
> +xen-backend.agent   - calls block, vif-* scripts to add, remove, hotplug
>                        devices
>  xen-backend.rules   - hotplug script rules
>  xend-config.sxp     - default xend configuration file
> diff --git a/tools/examples/xmexample.pv-grub b/tools/examples/xmexample.pv-grub
> index 85f847c..e04e6c1 100644
> --- a/tools/examples/xmexample.pv-grub
> +++ b/tools/examples/xmexample.pv-grub
> @@ -105,20 +105,6 @@ disk = [ 'phy:hda1,hda1,w' ]
>  # configured in xend-config.sxp.
> 
>  #----------------------------------------------------------------------------
> -# Define to which TPM instance the user domain should communicate.
> -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> -# where INSTANCE indicates the instance number of the TPM the VM
> -# should be talking to and DOM provides the domain where the backend
> -# is located.
> -# Note that no two virtual machines should try to connect to the same
> -# TPM instance. The handling of all TPM instances does require
> -# some management effort in so far that VM configration files (and thus
> -# a VM) should be associated with a TPM instance throughout the lifetime
> -# of the VM / VM configuration file. The instance number must be
> -# greater or equal to 1.
> -#vtpm = [ 'instance=1,backend=0' ]
> -
> -#----------------------------------------------------------------------------
>  # Configure the behaviour when a domain exits.  There are three 'reasons'
>  # for a domain to stop: poweroff, reboot, and crash.  For each of these you
>  # may specify:
> diff --git a/tools/examples/xmexample1 b/tools/examples/xmexample1
> index 330aaf0..c951200 100644
> --- a/tools/examples/xmexample1
> +++ b/tools/examples/xmexample1
> @@ -101,20 +101,6 @@ disk = [ 'phy:hda1,hda1,w' ]
>  # configured in xend-config.sxp.
> 
>  #----------------------------------------------------------------------------
> -# Define to which TPM instance the user domain should communicate.
> -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> -# where INSTANCE indicates the instance number of the TPM the VM
> -# should be talking to and DOM provides the domain where the backend
> -# is located.
> -# Note that no two virtual machines should try to connect to the same
> -# TPM instance. The handling of all TPM instances does require
> -# some management effort in so far that VM configration files (and thus
> -# a VM) should be associated with a TPM instance throughout the lifetime
> -# of the VM / VM configuration file. The instance number must be
> -# greater or equal to 1.
> -#vtpm = [ 'instance=1,backend=0' ]
> -
> -#----------------------------------------------------------------------------
>  # Set the kernel command line for the new domain.
>  # You only need to define the IP parameters and hostname if the domain's
>  # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
> diff --git a/tools/examples/xmexample2 b/tools/examples/xmexample2
> index 4e5eb3d..8c5137e 100644
> --- a/tools/examples/xmexample2
> +++ b/tools/examples/xmexample2
> @@ -137,20 +137,6 @@ disk = [ 'phy:sda%d,sda1,w' % (7+vmid),
>  # configured in xend-config.sxp.
> 
>  #----------------------------------------------------------------------------
> -# Define to which TPM instance the user domain should communicate.
> -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> -# where INSTANCE indicates the instance number of the TPM the VM
> -# should be talking to and DOM provides the domain where the backend
> -# is located.
> -# Note that no two virtual machines should try to connect to the same
> -# TPM instance. The handling of all TPM instances does require
> -# some management effort in so far that VM configration files (and thus
> -# a VM) should be associated with a TPM instance throughout the lifetime
> -# of the VM / VM configuration file. The instance number must be
> -# greater or equal to 1.
> -#vtpm = ['instance=%d,backend=0' % (vmid) ]
> -
> -#----------------------------------------------------------------------------
>  # Set the kernel command line for the new domain.
>  # You only need to define the IP parameters and hostname if the domain's
>  # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
> diff --git a/tools/examples/xmexample3 b/tools/examples/xmexample3
> index dc22ce1..ae799f9 100644
> --- a/tools/examples/xmexample3
> +++ b/tools/examples/xmexample3
> @@ -122,20 +122,6 @@ disk = [ 'phy:hda%d,hda1,w' % (vmid)]
>  # configured in xend-config.sxp.
> 
>  #----------------------------------------------------------------------------
> -# Define to which TPM instance the user domain should communicate.
> -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> -# where INSTANCE indicates the instance number of the TPM the VM
> -# should be talking to and DOM provides the domain where the backend
> -# is located.
> -# Note that no two virtual machines should try to connect to the same
> -# TPM instance. The handling of all TPM instances does require
> -# some management effort in so far that VM configration files (and thus
> -# a VM) should be associated with a TPM instance throughout the lifetime
> -# of the VM / VM configuration file. The instance number must be
> -# greater or equal to 1.
> -#vtpm = ['instance=%d,backend=0' % (vmid) ]
> -
> -#----------------------------------------------------------------------------
>  # Set the kernel command line for the new domain.
>  # You only need to define the IP parameters and hostname if the domain's
>  # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
> diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
> index 0166790..0605559 100644
> --- a/tools/hotplug/Linux/Makefile
> +++ b/tools/hotplug/Linux/Makefile
> @@ -18,14 +18,12 @@ XEN_SCRIPTS += vif-setup
>  XEN_SCRIPTS += block
>  XEN_SCRIPTS += block-enbd block-nbd
>  XEN_SCRIPTS += blktap
> -XEN_SCRIPTS += vtpm vtpm-delete
>  XEN_SCRIPTS += xen-hotplug-cleanup
>  XEN_SCRIPTS += external-device-migrate
>  XEN_SCRIPTS += vscsi
>  XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
>  XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
> -XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
> -XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
> +XEN_SCRIPT_DATA += block-common.sh
> 
>  UDEV_RULES_DIR = $(CONFIG_DIR)/udev
>  UDEV_RULES = xen-backend.rules xend.rules
> diff --git a/tools/hotplug/Linux/vtpm b/tools/hotplug/Linux/vtpm
> deleted file mode 100644
> index 38a4532..0000000
> --- a/tools/hotplug/Linux/vtpm
> +++ /dev/null
> @@ -1,22 +0,0 @@
> -#!/bin/bash
> -
> -dir=$(dirname "$0")
> -. "$dir/vtpm-hotplug-common.sh"
> -
> -vtpm_fatal_error=0
> -
> -case "$command" in
> -  add)
> -    vtpm_create_instance
> -  ;;
> -  remove)
> -    vtpm_remove_instance
> -  ;;
> -esac
> -
> -if [ $vtpm_fatal_error -eq 0 ]; then
> -       log debug "Successful vTPM operation '$command'."
> -       success
> -else
> -       fatal "Error while executing vTPM operation '$command'."
> -fi
> diff --git a/tools/hotplug/Linux/vtpm-common.sh b/tools/hotplug/Linux/vtpm-common.sh
> deleted file mode 100644
> index d0d7935..0000000
> --- a/tools/hotplug/Linux/vtpm-common.sh
> +++ /dev/null
> @@ -1,448 +0,0 @@
> -#
> -# Copyright (c) 2005 IBM Corporation
> -# Copyright (c) 2005 XenSource Ltd.
> -#
> -# 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
> -#
> -
> -dir=$(dirname "$0")
> -. "$dir/logging.sh"
> -. "$dir/locking.sh"
> -
> -VTPMDB="/var/vtpm/vtpm.db"
> -
> -#In the vtpm-impl file some commands should be defined:
> -#      vtpm_create, vtpm_setup, vtpm_start, etc. (see below)
> -if [ -r "$dir/vtpm-impl.alt" ]; then
> -       . "$dir/vtpm-impl.alt"
> -elif [ -r "$dir/vtpm-impl" ]; then
> -       . "$dir/vtpm-impl"
> -else
> -       function vtpm_create () {
> -               true
> -       }
> -       function vtpm_setup() {
> -               true
> -       }
> -       function vtpm_start() {
> -               true
> -       }
> -       function vtpm_suspend() {
> -               true
> -       }
> -       function vtpm_resume() {
> -               true
> -       }
> -       function vtpm_delete() {
> -               true
> -       }
> -       function vtpm_migrate() {
> -               echo "Error: vTPM migration accross machines not implemented."
> -       }
> -       function vtpm_migrate_local() {
> -               echo "Error: local vTPM migration not supported"
> -       }
> -       function vtpm_migrate_recover() {
> -               true
> -       }
> -fi
> -
> -
> -#Find the instance number for the vtpm given the name of the domain
> -# Parameters
> -# - vmname : the name of the vm
> -# Return value
> -#  Returns '0' if instance number could not be found, otherwise
> -#  it returns the instance number in the variable 'instance'
> -function vtpmdb_find_instance () {
> -       local vmname ret instance
> -       vmname=$1
> -       ret=0
> -
> -       instance=$(cat $VTPMDB |                   \
> -                 awk -vvmname=$vmname             \
> -                 '{                               \
> -                    if ( 1 != index($1,"#")) {    \
> -                      if ( $1 == vmname ) {       \
> -                        print $2;                 \
> -                        exit;                     \
> -                      }                           \
> -                    }                             \
> -                  }')
> -       if [ "$instance" != "" ]; then
> -               ret=$instance
> -       fi
> -       echo "$ret"
> -}
> -
> -
> -# Check whether a particular instance number is still available
> -# returns "0" if it is not available, "1" otherwise.
> -function vtpmdb_is_free_instancenum () {
> -       local instance instances avail i
> -       instance=$1
> -       avail=1
> -       #Allowed instance number range: 1-255
> -       if [ $instance -eq 0 -o $instance -gt 255 ]; then
> -               avail=0
> -       else
> -               instances=$(cat $VTPMDB |                \
> -                          awk                          \
> -                          '{                            \
> -                              if (1 != index($1,"#")) { \
> -                                printf("%s ",$2);       \
> -                              }                         \
> -                           }')
> -               for i in $instances; do
> -                       if [ $i -eq $instance ]; then
> -                               avail=0
> -                               break
> -                       fi
> -               done
> -       fi
> -       echo "$avail"
> -}
> -
> -
> -# Get an available instance number given the database
> -# Returns an unused instance number
> -function vtpmdb_get_free_instancenum () {
> -       local ctr instances don found
> -       instances=$(cat $VTPMDB |                \
> -                  awk                          \
> -                  '{                            \
> -                      if (1 != index($1,"#")) { \
> -                        printf("%s ",$2);       \
> -                      }                         \
> -                   }')
> -       ctr=1
> -       don=0
> -       while [ $don -eq 0 ]; do
> -               found=0
> -               for i in $instances; do
> -                       if [ $i -eq $ctr ]; then
> -                               found=1;
> -                               break;
> -                       fi
> -               done
> -
> -               if [ $found -eq 0 ]; then
> -                       don=1
> -                       break
> -               fi
> -               let ctr=ctr+1
> -       done
> -       echo "$ctr"
> -}
> -
> -
> -# Add a domain name and instance number to the DB file
> -function vtpmdb_add_instance () {
> -       local res vmname inst
> -       vmname=$1
> -       inst=$2
> -
> -       if [ ! -f $VTPMDB ]; then
> -               echo "#Database for VM to vTPM association" > $VTPMDB
> -               echo "#1st column: domain name" >> $VTPMDB
> -               echo "#2nd column: TPM instance number" >> $VTPMDB
> -       fi
> -       res=$(vtpmdb_validate_entry $vmname $inst)
> -       if [ $res -eq 0 ]; then
> -               echo "$vmname $inst" >> $VTPMDB
> -       fi
> -}
> -
> -
> -#Validate whether an entry is the same as passed to this
> -#function
> -function vtpmdb_validate_entry () {
> -       local res rc vmname inst
> -       rc=0
> -       vmname=$1
> -       inst=$2
> -
> -       res=$(cat $VTPMDB |            \
> -            awk -vvmname=$vmname     \
> -                 -vinst=$inst         \
> -            '{                        \
> -                if ( 1 == index($1,"#")) {\
> -                } else                \
> -                if ( $1 == vmname &&  \
> -                     $2 == inst) {    \
> -                   printf("1");       \
> -                   exit;              \
> -                } else                \
> -                if ( $1 == vmname ||  \
> -                     $2 == inst) {    \
> -                   printf("2");       \
> -                   exit;              \
> -                }                     \
> -            }')
> -
> -       if [ "$res" == "1" ]; then
> -               rc=1
> -       elif [ "$res" == "2" ]; then
> -               rc=2
> -       fi
> -       echo "$rc"
> -}
> -
> -
> -#Remove an entry from the vTPM database given its domain name
> -#and instance number
> -function vtpmdb_remove_entry () {
> -       local vmname instance VTPMDB_TMP
> -       vmname=$1
> -       instance=$2
> -       VTPMDB_TMP="$VTPMDB".tmp
> -
> -       $(cat $VTPMDB |            \
> -        awk -vvmname=$vmname     \
> -        '{                        \
> -           if ( $1 != vmname ) {  \
> -             print $0;            \
> -           }                      \
> -        '} > $VTPMDB_TMP)
> -       if [ -e $VTPMDB_TMP ]; then
> -               mv -f $VTPMDB_TMP $VTPMDB
> -               vtpm_delete $instance
> -       else
> -               log err "Error creating temporary file '$VTPMDB_TMP'."
> -       fi
> -}
> -
> -
> -# Find the reason for the creation of this device:
> -# Returns 'resume' or 'create'
> -function vtpm_get_create_reason () {
> -       local resume
> -       resume=$(xenstore_read $XENBUS_PATH/resume)
> -       if [ "$resume" == "True" ]; then
> -               echo "resume"
> -       else
> -               echo "create"
> -       fi
> -}
> -
> -
> -#Create a vTPM instance
> -# If no entry in the TPM database is found, the instance is
> -# created and an entry added to the database.
> -function vtpm_create_instance () {
> -       local res instance domname reason uuid
> -       uuid=$(xenstore_read "$XENBUS_PATH"/uuid)
> -       reason=$(vtpm_get_create_reason)
> -
> -       claim_lock vtpmdb
> -
> -       instance="0"
> -
> -       if [ "$uuid" != "" ]; then
> -               instance=$(vtpmdb_find_instance $uuid)
> -       fi
> -       if [ "$instance" == "0" ]; then
> -               domname=$(xenstore_read "$XENBUS_PATH"/domain)
> -               instance=$(vtpmdb_find_instance $domname)
> -       fi
> -
> -       if [ "$instance" == "0" -a "$reason" != "create" ]; then
> -               release_lock vtpmdb
> -               return
> -       fi
> -
> -       if [ "$instance" == "0" ]; then
> -               #Try to give the preferred instance to the domain
> -               instance=$(xenstore_read "$XENBUS_PATH"/pref_instance)
> -               if [ "$instance" != "" ]; then
> -                       res=$(vtpmdb_is_free_instancenum $instance)
> -                       if [ $res -eq 0 ]; then
> -                               instance=$(vtpmdb_get_free_instancenum)
> -                       fi
> -               else
> -                       instance=$(vtpmdb_get_free_instancenum)
> -               fi
> -
> -               vtpm_create $instance
> -
> -               if [ $vtpm_fatal_error -eq 0 ]; then
> -                       if [ "$uuid" != "" ]; then
> -                               vtpmdb_add_instance $uuid $instance
> -                       else
> -                               vtpmdb_add_instance $domname $instance
> -                       fi
> -               fi
> -       else
> -               if [ "$reason" == "resume" ]; then
> -                       vtpm_resume $instance
> -               else
> -                       vtpm_start $instance
> -               fi
> -       fi
> -
> -       release_lock vtpmdb
> -
> -       xenstore_write $XENBUS_PATH/instance $instance
> -}
> -
> -
> -#Remove an instance when a VM is terminating or suspending.
> -#Since it is assumed that the VM will appear again, the
> -#entry is kept in the VTPMDB file.
> -function vtpm_remove_instance () {
> -       local instance reason domname uuid
> -       #Stop script execution quietly if path does not exist (anymore)
> -       xenstore-exists "$XENBUS_PATH"/domain
> -       uuid=$(xenstore_read "$XENBUS_PATH"/uuid)
> -
> -       claim_lock vtpmdb
> -
> -       instance="0"
> -
> -       if [ "$uuid" != "" ]; then
> -               instance=$(vtpmdb_find_instance $uuid)
> -       fi
> -
> -       if [ "$instance" == "0" ]; then
> -               domname=$(xenstore_read "$XENBUS_PATH"/domain)
> -               instance=$(vtpmdb_find_instance $domname)
> -       fi
> -
> -       if [ "$instance" != "0" ]; then
> -               vtpm_suspend $instance
> -       fi
> -
> -       release_lock vtpmdb
> -}
> -
> -
> -#Remove an entry in the VTPMDB file given the domain's name
> -#1st parameter: The name of the domain
> -function vtpm_delete_instance () {
> -       local instance
> -
> -       claim_lock vtpmdb
> -
> -       instance=$(vtpmdb_find_instance $1)
> -       if [ "$instance" != "0" ]; then
> -               vtpmdb_remove_entry $1 $instance
> -       fi
> -
> -       release_lock vtpmdb
> -}
> -
> -# Determine whether the given address is local to this machine
> -# Return values:
> -#  "-1" : the given machine name is invalid
> -#  "0"  : this is not an address of this machine
> -#  "1"  : this is an address local to this machine
> -function vtpm_isLocalAddress() {
> -       local addr res
> -       addr=$(ping $1 -c 1 |  \
> -              awk '{ print substr($3,2,length($3)-2); exit }')
> -       if [ "$addr" == "" ]; then
> -               echo "-1"
> -               return
> -       fi
> -       res=$(ifconfig | grep "inet addr" |  \
> -            awk -vaddr=$addr               \
> -            '{                              \
> -               if ( addr == substr($2, 6)) {\
> -                 print "1";                 \
> -               }                            \
> -            }'                              \
> -           )
> -       if [ "$res" == "" ]; then
> -               echo "0"
> -               return
> -       fi
> -       echo "1"
> -}
> -
> -# Perform a migration step. This function differentiates between migration
> -# to the local host or to a remote machine.
> -# Parameters:
> -# 1st: destination host to migrate to
> -# 2nd: name of the domain to migrate
> -# 3rd: the migration step to perform
> -function vtpm_migration_step() {
> -       local res=$(vtpm_isLocalAddress $1)
> -       if [ "$res" == "0" ]; then
> -               vtpm_migrate $1 $2 $3
> -       else
> -               vtpm_migrate_local
> -       fi
> -}
> -
> -# Recover from migration due to an error. This function differentiates
> -# between migration to the local host or to a remote machine.
> -# Parameters:
> -# 1st: destination host the migration was going to
> -# 2nd: name of the domain that was to be migrated
> -# 3rd: the last successful migration step that was done
> -function vtpm_recover() {
> -       local res
> -       res=$(vtpm_isLocalAddress $1)
> -       if [ "$res" == "0" ]; then
> -               vtpm_migrate_recover $1 $2 $3
> -       fi
> -}
> -
> -
> -#Determine the domain id given a domain's name.
> -#1st parameter: name of the domain
> -#return value: domain id  or -1 if domain id could not be determined
> -function vtpm_domid_from_name () {
> -       local id name ids
> -       ids=$(xenstore-list /local/domain)
> -       for id in $ids; do
> -               name=$(xenstore-read /local/domain/$id/name)
> -               if [ "$name" == "$1" ]; then
> -                       echo "$id"
> -                       return
> -               fi
> -       done
> -       echo "-1"
> -}
> -
> -#Determine the virtual TPM's instance number using the domain ID.
> -#1st parm: domain ID
> -function vtpm_uuid_by_domid() {
> -       echo $(xenstore-read /local/domain/0/backend/vtpm/$1/0/uuid)
> -}
> -
> -
> -# Determine the vTPM's UUID by the name of the VM
> -function vtpm_uuid_from_vmname() {
> -       local domid=$(vtpm_domid_from_name $1)
> -       if [ "$domid" != "-1" ]; then
> -               echo $(vtpm_uuid_by_domid $domid)
> -               return
> -       fi
> -       echo ""
> -}
> -
> -#Add a virtual TPM instance number and its associated domain name
> -#to the VTPMDB file and activate usage of this virtual TPM instance
> -#by writing the instance number into the xenstore
> -#1st parm: name of virtual machine
> -#2nd parm: instance of associated virtual TPM
> -function vtpm_add_and_activate() {
> -       local domid=$(vtpm_domid_from_name $1)
> -       local vtpm_uuid=$(vtpm_uuid_from_vmname $1)
> -       if [ "$vtpm_uuid" != "" -a "$domid" != "-1" ]; then
> -               vtpmdb_add_instance $vtpm_uuid $2
> -               xenstore-write backend/vtpm/$domid/0/instance $2
> -       fi
> -}
> diff --git a/tools/hotplug/Linux/vtpm-delete b/tools/hotplug/Linux/vtpm-delete
> deleted file mode 100644
> index b75b95b..0000000
> --- a/tools/hotplug/Linux/vtpm-delete
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -#!/bin/bash
> -
> -# This scripts must be called the following way:
> -# vtpm-delete <vtpm uuid>
> -# or
> -# vtpm-delete --vmname <vm name>
> -
> -dir=$(dirname "$0")
> -. "$dir/vtpm-common.sh"
> -
> -if [ "$1" == "--vmname" ]; then
> -       vtpm_uuid=$(vtpm_uuid_from_vmname $2)
> -       if [ "$vtpm_uuid" != "" ];then
> -               vtpm_delete_instance $vtpm_uuid
> -       fi
> -else
> -       vtpm_delete_instance $1
> -fi
> diff --git a/tools/hotplug/Linux/vtpm-hotplug-common.sh b/tools/hotplug/Linux/vtpm-hotplug-common.sh
> deleted file mode 100644
> index 9fd35e7..0000000
> --- a/tools/hotplug/Linux/vtpm-hotplug-common.sh
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -#
> -# Copyright (c) 2005 IBM Corporation
> -# Copyright (c) 2005 XenSource Ltd.
> -#
> -# 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
> -#
> -
> -dir=$(dirname "$0")
> -. "$dir/xen-hotplug-common.sh"
> -
> -findCommand "$@"
> -if [ "$command" != "online" ]  &&
> -   [ "$command" != "offline" ] &&
> -   [ "$command" != "add" ]     &&
> -   [ "$command" != "remove" ]
> -then
> -       log err "Invalid command: $command"
> -       exit 1
> -fi
> -
> -
> -XENBUS_PATH="${XENBUS_PATH:?}"
> -
> -. "$dir/vtpm-common.sh"
> diff --git a/tools/hotplug/Linux/vtpm-impl b/tools/hotplug/Linux/vtpm-impl
> deleted file mode 100644
> index 4f9a1fd..0000000
> --- a/tools/hotplug/Linux/vtpm-impl
> +++ /dev/null
> @@ -1,208 +0,0 @@
> -#!/bin/bash
> -# ===================================================================
> -#
> -# Copyright (c) 2005, Intel Corp.
> -# All rights reserved.
> -#
> -# Redistribution and use in source and binary forms, with or without
> -# modification, are permitted provided that the following conditions
> -# are met:
> -#
> -#   * Redistributions of source code must retain the above copyright
> -#     notice, this list of conditions and the following disclaimer.
> -#   * Redistributions in binary form must reproduce the above
> -#     copyright notice, this list of conditions and the following
> -#     disclaimer in the documentation and/or other materials provided
> -#     with the distribution.
> -#   * Neither the name of Intel Corporation nor the names of its
> -#     contributors may be used to endorse or promote products derived
> -#     from this software without specific prior written permission.
> -#
> -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -# OF THE POSSIBILITY OF SUCH DAMAGE.
> -# ===================================================================
> -
> -#            |        SRC        |    TAG  |      CMD SIZE     |        ORD       |mtype|strt
> -TPM_CMD_OPEN=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x11\\x01\\x00\\x00\\x01\\x01\\x01
> -TPM_CMD_RESM=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x11\\x01\\x00\\x00\\x01\\x01\\x02
> -TPM_CMD_CLOS=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x0e\\x01\\x00\\x00\\x02
> -TPM_CMD_DELE=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x0e\\x01\\x00\\x00\\x03
> -
> -TPM_TYPE_PVM=\\x01
> -TPM_TYPE_HVM=\\x02
> -
> -TPM_SUCCESS=00000000
> -
> -TX_VTPM_MANAGER=/var/vtpm/fifos/from_console.fifo
> -RX_VTPM_MANAGER=/var/vtpm/fifos/to_console.fifo
> -
> -VTPM_MIG=/usr/bin/vtpm_migrator
> -
> -# -------------------- Helpers for binary streams -----------
> -
> -function str_to_hex32() {
> - printf "%0.8x" $1
> -}
> -
> -function hex32_to_bin() {
> - local inst=$(str_to_hex32 $1);
> -
> - local n1=`echo $inst | sed 's/\(..\)....../\\\\x\1/'`
> - local n2=`echo $inst | sed 's/..\(..\)..../\\\\x\1/'`
> - local n3=`echo $inst | sed 's/....\(..\)../\\\\x\1/'`
> - local n4=`echo $inst | sed 's/......\(..\)/\\\\x\1/'`
> -
> - echo "$n1$n2$n3$n4"
> -}
> -
> -function vtpm_manager_cmd() {
> - local cmd=$1;
> - local inst=$2;
> - local inst_bin=$(hex32_to_bin $inst);
> -
> - claim_lock vtpm_mgr
> -
> - #send cmd to vtpm_manager
> - printf "$cmd$inst_bin" > $TX_VTPM_MANAGER
> -
> - #recv response
> - set +e
> - local resp_hex=`dd skip=10 bs=1 count=4 if=$RX_VTPM_MANAGER 2> /dev/null | xxd -ps`
> - set -e
> -
> - release_lock vtpm_mgr
> -
> - #return whether the command was successful
> - if [ $resp_hex -ne $TPM_SUCCESS ]; then
> -   vtpm_fatal_error=1
> -   false
> -  else
> -   true
> - fi
> -}
> -
> -# Helper to get vm type to pass to vtpm_manager open/resume
> -function vtpm_get_type() {
> - local inst=$(xenstore_read $XENBUS_PATH/frontend-id)
> - local vm=$(xenstore_read /local/domain/$inst/vm)
> - if [ "$vm" != "" ]; then
> -  local ostype=$(xenstore-read $vm/image/ostype)
> -  if [ "$ostype" == "hvm" ]; then
> -   echo $TPM_TYPE_HVM;
> -  else
> -   echo $TPM_TYPE_PVM;
> -  fi
> - fi
> -}
> -
> -# ------------------ Command handlers -----------------
> -
> -# Create new vtpm instance & set it up for use
> -function vtpm_create () {
> - # Creation is handled implicitly by the manager on first setup
> - # so just set it up for use
> - $(vtpm_start $1)
> -}
> -
> -# Setup vtpm instance for use.
> -function vtpm_start() {
> - local vmtype=$(vtpm_get_type);
> - $(vtpm_manager_cmd $TPM_CMD_OPEN$vmtype $1)
> -}
> -
> -function vtpm_resume() {
> - local vmtype=$(vtpm_get_type);
> - $(vtpm_manager_cmd $TPM_CMD_RESM$vmtype $1)
> -}
> -
> -# Reset the vtpm AKA clear PCRs
> -function vtpm_reset() {
> - #not used by current implemenation
> - true
> -}
> -
> -# Shutdown the vtpm while the vm is down
> -# This could be a suspend of shutdown
> -# we cannot distinquish, so save the state
> -# and decide on startup if we should keep is
> -function vtpm_suspend() {
> - $(vtpm_manager_cmd $TPM_CMD_CLOS $1)
> -}
> -
> -
> -function vtpm_delete() {
> - local inst=$1
> - if $(vtpm_manager_cmd $TPM_CMD_DELE $inst); then
> -   rm -f /var/vtpm/vtpm_dm_$1.data
> -   true
> - else
> -   vtpm_fatal_error=1
> -   false
> - fi
> -}
> -
> -# Perform a migration step. This function differentiates between migration
> -# to the local host or to a remote machine.
> -# Parameters:
> -# 1st: destination host to migrate to
> -# 2nd: name of the domain to migrate
> -# 3rd: the migration step to perform
> -function vtpm_migrate() {
> - local instance res
> -
> - instance=$(vtpmdb_find_instance $2)
> - if [ "$instance" == "" ]; then
> -  log err "VTPM Migratoin failed. Unable to translation of domain name"
> -  echo "Error: VTPM Migration failed while looking up instance number"
> - fi
> -
> - case "$3" in
> -  0)
> -   #Incicate migration supported
> -   echo "0"
> -  ;;
> -
> -  1)
> -   # Get Public Key from Destination
> -   # Call vtpm_manager's migration part 1
> -   claim_lock vtpm_mgr
> -   $VTPM_MIG $1 $2 $instance $3
> -   release_lock vtpm_mgr
> -  ;;
> -
> -  2)
> -   # Call manager's migration step 2 and send result to destination
> -   # If successful remove from db
> -   claim_lock vtpm_mgr
> -   $VTPM_MIG $1 $2 $instance $3
> -   release_lock vtpm_mgr
> -  ;;
> -
> -  3)
> -   if `ps x | grep "$VTPM_MIG $1"`; then
> -    log err "VTPM Migration failed to complete."
> -    echo "Error: VTPM Migration failed to complete."
> -   fi
> -  ;;
> - esac
> -
> -}
> -
> -
> -function vtpm_migrate_recover() {
> - echo "Error: Recovery not supported yet"
> -}
> -
> -function vtpm_migrate_local() {
> - echo "Error: local vTPM migration not supported"
> -}
> diff --git a/tools/hotplug/Linux/vtpm-migration.sh b/tools/hotplug/Linux/vtpm-migration.sh
> deleted file mode 100644
> index 7e38ae2..0000000
> --- a/tools/hotplug/Linux/vtpm-migration.sh
> +++ /dev/null
> @@ -1,19 +0,0 @@
> -#
> -# Copyright (c) 2005 IBM Corporation
> -#
> -# 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
> -#
> -
> -dir=$(dirname "$0")
> -. "$dir/vtpm-common.sh"
> diff --git a/tools/hotplug/Linux/xen-backend.rules b/tools/hotplug/Linux/xen-backend.rules
> index c591a3f..a0d409e 100644
> --- a/tools/hotplug/Linux/xen-backend.rules
> +++ b/tools/hotplug/Linux/xen-backend.rules
> @@ -1,6 +1,5 @@
>  SUBSYSTEM=="xen-backend", KERNEL=="tap*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/blktap $env{ACTION}"
>  SUBSYSTEM=="xen-backend", KERNEL=="vbd*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/block $env{ACTION}"
> -SUBSYSTEM=="xen-backend", KERNEL=="vtpm*", RUN+="/etc/xen/scripts/vtpm $env{ACTION}"
>  SUBSYSTEM=="xen-backend", KERNEL=="vif2-*", RUN+="/etc/xen/scripts/vif2 $env{ACTION}"
>  SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="online", RUN+="/etc/xen/scripts/vif-setup online type_if=vif"
>  SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="offline", RUN+="/etc/xen/scripts/vif-setup offline type_if=vif"
> diff --git a/tools/vtpm/Makefile b/tools/vtpm/Makefile
> deleted file mode 100644
> index 7b3efa5..0000000
> --- a/tools/vtpm/Makefile
> +++ /dev/null
> @@ -1,74 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../..
> -
> -# Base definitions and rules
> -include $(XEN_ROOT)/tools/vtpm/Rules.mk
> -
> -# Dir name for emulator (as dom0 tpm driver)
> -TPM_EMULATOR_DIR = tpm_emulator
> -# Dir name for vtpm instance
> -VTPM_DIR = vtpm
> -ORIG_DIR = orig
> -
> -# Emulator tarball name
> -TPM_EMULATOR_NAME = tpm_emulator-0.5.1
> -TPM_EMULATOR_TARFILE = $(TPM_EMULATOR_NAME).tar.gz
> -
> -GMP_HEADER = /usr/include/gmp.h
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: build_sub
> -
> -.PHONY: install
> -install: build
> -       $(MAKE) -C $(VTPM_DIR) install-recursive
> -
> -.PHONY: clean
> -clean:
> -       @if [ -d $(TPM_EMULATOR_DIR) ]; \
> -               then $(MAKE) -C $(TPM_EMULATOR_DIR) clean; \
> -       fi
> -       @if [ -d $(VTPM_DIR) ]; \
> -               then $(MAKE) -C $(VTPM_DIR) clean; \
> -       fi
> -
> -.PHONY: mrproper
> -mrproper:
> -       rm -f $(TPM_EMULATOR_TARFILE) tpm_emulator.patch.old vtpm.patch.old
> -       rm -rf $(TPM_EMULATOR_DIR) $(VTPM_DIR) $(ORIG_DIR)
> -
> -# Download Swiss emulator
> -$(TPM_EMULATOR_TARFILE):
> -       wget http://download.berlios.de/tpm-emulator/$(TPM_EMULATOR_TARFILE)
> -
> -# Create vtpm dirs
> -$(VTPM_DIR)/tpmd/tpmd: $(TPM_EMULATOR_TARFILE) vtpm-0.5.1.patch
> -       rm -rf $(VTPM_DIR)
> -       tar -xzf $(TPM_EMULATOR_TARFILE)
> -       mv $(TPM_EMULATOR_NAME) $(VTPM_DIR)
> -
> -       set -e; cd $(VTPM_DIR); \
> -       patch -p1 < ../vtpm-0.5.1.patch; \
> -       patch -p1 < ../vtpm-0.5.1-LDLIBS.patch
> -
> -orig: $(TPM_EMULATOR_TARFILE)
> -       mkdir $(ORIG_DIR);
> -       set -e; cd $(ORIG_DIR); \
> -       tar -xzf ../$(TPM_EMULATOR_TARFILE);
> -
> -updatepatches: clean orig
> -       find $(VTPM_DIR) -name "*.orig" -print | xargs rm -f;
> -       mv vtpm.patch vtpm.patch.old;
> -       diff -uprN $(TPM_EMULATOR_DIR) $(VTPM_DIR) > vtpm.patch || true;
> -
> -.PHONY: build_sub
> -build_sub: $(VTPM_DIR)/tpmd/tpmd
> -       set -e; if [ -e $(GMP_HEADER) ]; then \
> -               $(MAKE) -C $(VTPM_DIR) version; \
> -               $(MAKE) -C $(VTPM_DIR) all-recursive; \
> -       else \
> -               echo "=== Unable to build VTPMs. libgmp could not be found."; \
> -       fi
> -
> diff --git a/tools/vtpm/README b/tools/vtpm/README
> deleted file mode 100644
> index 2008cbd..0000000
> --- a/tools/vtpm/README
> +++ /dev/null
> @@ -1,45 +0,0 @@
> -
> -Directory Structure
> -===================
> -tools/vtpm/tpm_emulator-0.2b.tar.gz    -> TPM Emulator downloaded at build time that will
> -                                          be patched and used for our vtpms
> -tools/vtpm/vtpm.patch                  -> patch applied to tpm_emulator to make vtpm
> -tools/vtpm/vtpm/                       -> (created on build) tpm_emulator moved to ring 3,
> -                                          listens on a pair of fifos for TPM commands,
> -                                          persistent state is sent via named fifo to vtpm
> -                                            manager, which encrypts it and protects it.
> -tools/vtpm/tpm_emulator.patch          -> To allow for debugging and testing on non-TPM
> -                                          platforms, this patches the emulator to allow
> -                                          it to be inserted into the dom0 kernel
> -tools/vtpm/tpm_emulator-0.2            -> (created on build) directory containing patched emulator
> -
> -Compile Flags
> -===================
> -VTPM_MULTI_VM                -> Defined (not finished): VTPMs run in their own VMs
> -                                Not Defined (default): VTPMs are processes
> -
> -Requirements
> -============
> -- xen-unstable
> -- IBM frontend/backend vtpm driver patch
> -- vtpm_managerd
> -- GNU MP Big number library (GMP)
> -
> -vtpmd Flow (for vtpm_manager. vtpmd never run by default)
> -============================
> -- Launch the VTPM manager (vtpm_managerd) which which begins listening to the BE with one thread
> -  and listens to a named fifo that is shared by the vtpms to commuincate with the manager.
> -- VTPM Manager listens to TPM BE.
> -- When xend launches a tpm frontend equipped VM it contacts the manager over the vtpm backend.
> -- When the manager receives the open message from the BE, it launches a vtpm
> -- Xend allows the VM to continue booting.
> -- When a TPM request is issued to the front end, the front end transmits the TPM request to the backend.
> -- The manager receives the TPM requests and uses a named fifo to forward the request to the vtpm.
> -- The fifo listener begins listening for the reply from vtpm for the request.
> -- Vtpm processes request and replies to manager over shared named fifo.
> -- If needed, the vtpm may send a request to the vtpm_manager at any time to save it's secrets to disk.
> -- Manager receives response from vtpm and passes it back to backend for forwarding to guest.
> -
> -tpm_emulator flow
> -==================
> -Read documentation in tpm_emulator-0.2 directory
> diff --git a/tools/vtpm/Rules.mk b/tools/vtpm/Rules.mk
> deleted file mode 100644
> index 548cff0..0000000
> --- a/tools/vtpm/Rules.mk
> +++ /dev/null
> @@ -1,26 +0,0 @@
> -# Base definitions and rules (XEN_ROOT must be defined in including Makefile)
> -include $(XEN_ROOT)/tools/Rules.mk
> -
> -#
> -# Tool definitions
> -#
> -
> -# General compiler flags
> -CFLAGS   = -Werror -g3
> -
> -# Generic project files
> -HDRS   = $(wildcard *.h)
> -SRCS   = $(wildcard *.c)
> -OBJS   = $(patsubst %.c,%.o,$(SRCS))
> -
> -# Generic (non-header) dependencies
> -$(SRCS): Makefile $(XEN_ROOT)/tools/Rules.mk $(XEN_ROOT)/tools/vtpm/Rules.mk
> -
> -$(OBJS): $(SRCS)
> -
> --include $(DEPS)
> -
> -BUILD_EMULATOR = y
> -
> -# Make sure these are just rules
> -.PHONY : all build install clean
> diff --git a/tools/vtpm/tpm_emulator.patch b/tools/vtpm/tpm_emulator.patch
> deleted file mode 100644
> index c34c665..0000000
> --- a/tools/vtpm/tpm_emulator.patch
> +++ /dev/null
> @@ -1,1919 +0,0 @@
> -diff -uprN orig/tpm_emulator-0.4/AUTHORS tpm_emulator/AUTHORS
> ---- orig/tpm_emulator-0.4/AUTHORS      2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/AUTHORS       2006-07-24 14:35:35.000000000 -0700
> -@@ -1,2 +1,3 @@
> - Mario Strasser <mast@gmx.net>
> - Heiko Stamer <stamer@gaos.org> [DAA]
> -+INTEL Corp <> [Dropped to Ring3]
> -diff -uprN orig/tpm_emulator-0.4/ChangeLog tpm_emulator/ChangeLog
> ---- orig/tpm_emulator-0.4/ChangeLog    2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/ChangeLog     2006-07-24 14:35:35.000000000 -0700
> -@@ -1,3 +1,6 @@
> -+????-??-?? Intel Corp
> -+      * Moved module out of kernel to run as a ring 3 app
> -+
> - 2006-06-23  Mario Strasser <mast@gmx.net>
> -       * tpm_startup.c: behaviour of ST_CLEAR and storage of
> -               persistent data adapted
> -diff -uprN orig/tpm_emulator-0.4/crypto/gmp_kernel_wrapper.c tpm_emulator/crypto/gmp_kernel_wrapper.c
> ---- orig/tpm_emulator-0.4/crypto/gmp_kernel_wrapper.c  2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/crypto/gmp_kernel_wrapper.c   2006-07-24 14:35:35.000000000 -0700
> -@@ -1,5 +1,6 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -24,15 +25,10 @@ int __gmp_junk;
> - void __attribute__ ((regparm(0))) __gmp_assert_fail(const char *filename,
> -   int linenum, const char *expr)
> - {
> --  panic(KERN_CRIT TPM_MODULE_NAME "%s:%d: GNU MP assertion failed: %s\n",
> -+  error("%s:%d: GNU MP assertion failed: %s\n",
> -     filename, linenum, expr);
> - }
> -
> --void __attribute__ ((regparm(0))) abort(void)
> --{
> --  panic(KERN_CRIT TPM_MODULE_NAME "GNU MP abort() was called\n");
> --}
> --
> - /* overwrite GNU MP random functions (used by mpz/millerrabin.c) */
> -
> - void __attribute__ ((regparm(0))) gmp_randinit(gmp_randstate_t rstate,
> -@@ -77,20 +73,19 @@ void __attribute__ ((regparm(0))) mpz_ur
> -
> - void __attribute__ ((regparm(0))) *kernel_allocate(size_t size)
> - {
> --  void *ret  = (void*)kmalloc(size, GFP_KERNEL);
> --  if (!ret) panic(KERN_CRIT TPM_MODULE_NAME
> --    "GMP: cannot allocate memory (size=%u)\n", size);
> -+  void *ret  = (void*)malloc(size);
> -+  if (!ret) error("GMP: cannot allocate memory (size=%Zu)\n", size);
> -   return ret;
> - }
> -
> - void __attribute__ ((regparm(0))) *kernel_reallocate(void *oldptr,
> -   size_t old_size, size_t new_size)
> - {
> --  void *ret = (void*)kmalloc(new_size, GFP_KERNEL);
> --  if (!ret) panic(KERN_CRIT TPM_MODULE_NAME "GMP: Cannot reallocate memory "
> --    "(old_size=%u new_size=%u)\n", old_size, new_size);
> -+  void *ret = (void*)malloc(new_size);
> -+  if (!ret) error("GMP: Cannot reallocate memory "
> -+    "(old_size=%Zu new_size=%Zu)\n", old_size, new_size);
> -   memcpy(ret, oldptr, old_size);
> --  kfree(oldptr);
> -+  free(oldptr);
> -   return ret;
> - }
> -
> -@@ -99,7 +94,7 @@ void __attribute__ ((regparm(0))) kernel
> -   /* overwrite used memory */
> -   if (blk_ptr != NULL) {
> -     memset(blk_ptr, 0, blk_size);
> --    kfree(blk_ptr);
> -+    free(blk_ptr);
> -   }
> - }
> -
> -diff -uprN orig/tpm_emulator-0.4/crypto/rsa.c tpm_emulator/crypto/rsa.c
> ---- orig/tpm_emulator-0.4/crypto/rsa.c 2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/crypto/rsa.c  2006-07-24 14:35:35.000000000 -0700
> -@@ -1,5 +1,6 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -381,7 +382,7 @@ static int encode_message(int type, uint
> -       msg[0] = 0x00;
> -       get_random_bytes(&msg[1], SHA1_DIGEST_LENGTH);
> -       sha1_init(&ctx);
> --      sha1_update(&ctx, "TCPA", 4);
> -+      sha1_update(&ctx, (uint8_t *) "TCPA", 4);
> -       sha1_final(&ctx, &msg[1 + SHA1_DIGEST_LENGTH]);
> -       memset(&msg[1 + 2 * SHA1_DIGEST_LENGTH], 0x00,
> -         msg_len - data_len - 2 * SHA1_DIGEST_LENGTH - 2);
> -@@ -429,7 +430,7 @@ static int decode_message(int type, uint
> -       mask_generation(&msg[1], SHA1_DIGEST_LENGTH,
> -         &msg[1 + SHA1_DIGEST_LENGTH], msg_len - SHA1_DIGEST_LENGTH - 1);
> -       sha1_init(&ctx);
> --      sha1_update(&ctx, "TCPA", 4);
> -+      sha1_update(&ctx, (uint8_t *) "TCPA", 4);
> -       sha1_final(&ctx, &msg[1]);
> -       if (memcmp(&msg[1], &msg[1 + SHA1_DIGEST_LENGTH],
> -           SHA1_DIGEST_LENGTH) != 0) return -1;
> -diff -uprN orig/tpm_emulator-0.4/linux_module.c tpm_emulator/linux_module.c
> ---- orig/tpm_emulator-0.4/linux_module.c       2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/linux_module.c        1969-12-31 16:00:00.000000000 -0800
> -@@ -1,195 +0,0 @@
> --/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -- * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -- *
> -- * This module is free software; you can redistribute it and/or modify
> -- * it under the terms of the GNU General Public License as published
> -- * by the Free Software Foundation; either version 2 of the License,
> -- * or (at your option) any later version.
> -- *
> -- * This module 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.
> -- *
> -- * $Id: linux_module.c 91 2006-03-13 13:51:41Z mast $
> -- */
> --
> --#include <linux/module.h>
> --#include <linux/kernel.h>
> --#include <linux/init.h>
> --#include <linux/miscdevice.h>
> --#include <linux/poll.h>
> --#include "linux_module.h"
> --#include "tpm/tpm_emulator.h"
> --
> --MODULE_LICENSE("GPL");
> --MODULE_AUTHOR("Mario Strasser <mast@gmx.net>");
> --MODULE_DESCRIPTION("Trusted Platform Module (TPM) Emulator");
> --MODULE_SUPPORTED_DEVICE(TPM_DEVICE_NAME);
> --
> --/* module startup parameters */
> --char *startup = "save";
> --module_param(startup, charp, 0444);
> --MODULE_PARM_DESC(startup, " Sets the startup mode of the TPM. "
> --  "Possible values are 'clear', 'save' (default) and 'deactivated.");
> --char *storage_file = "/var/tpm/tpm_emulator-1.2.0.2";
> --module_param(storage_file, charp, 0644);
> --MODULE_PARM_DESC(storage_file, " Sets the persistent-data storage "
> --  "file of the TPM.");
> --
> --/* TPM lock */
> --static struct semaphore tpm_mutex;
> --
> --/* TPM command response */
> --static struct {
> --  uint8_t *data;
> --  uint32_t size;
> --} tpm_response;
> --
> --/* module state */
> --#define STATE_IS_OPEN 0
> --static uint32_t module_state;
> --static struct timespec old_time;
> --
> --static int tpm_open(struct inode *inode, struct file *file)
> --{
> --  debug("%s()", __FUNCTION__);
> --  if (test_and_set_bit(STATE_IS_OPEN, (void*)&module_state)) return -EBUSY;
> --  return 0;
> --}
> --
> --static int tpm_release(struct inode *inode, struct file *file)
> --{
> --  debug("%s()", __FUNCTION__);
> --  clear_bit(STATE_IS_OPEN, (void*)&module_state);
> --  down(&tpm_mutex);
> --  if (tpm_response.data != NULL) {
> --    kfree(tpm_response.data);
> --    tpm_response.data = NULL;
> --  }
> --  up(&tpm_mutex);
> --  return 0;
> --}
> --
> --static ssize_t tpm_read(struct file *file, char *buf, size_t count, loff_t *ppos)
> --{
> --  debug("%s(%d)", __FUNCTION__, count);
> --  down(&tpm_mutex);
> --  if (tpm_response.data != NULL) {
> --    count = min(count, (size_t)tpm_response.size - (size_t)*ppos);
> --    count -= copy_to_user(buf, &tpm_response.data[*ppos], count);
> --    *ppos += count;
> --    if ((size_t)tpm_response.size == (size_t)*ppos) {
> --      kfree(tpm_response.data);
> --      tpm_response.data = NULL;
> --    }
> --  } else {
> --    count = 0;
> --  }
> --  up(&tpm_mutex);
> --  return count;
> --}
> --
> --static ssize_t tpm_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
> --{
> --  debug("%s(%d)", __FUNCTION__, count);
> --  down(&tpm_mutex);
> --  *ppos = 0;
> --  if (tpm_response.data != NULL) kfree(tpm_response.data);
> --  if (tpm_handle_command(buf, count, &tpm_response.data,
> --                         &tpm_response.size) != 0) {
> --    count = -EILSEQ;
> --    tpm_response.data = NULL;
> --  }
> --  up(&tpm_mutex);
> --  return count;
> --}
> --
> --#define TPMIOC_CANCEL   _IO('T', 0x00)
> --#define TPMIOC_TRANSMIT _IO('T', 0x01)
> --
> --static int tpm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
> --{
> --  debug("%s(%d, %p)", __FUNCTION__, cmd, (char*)arg);
> --  if (cmd == TPMIOC_TRANSMIT) {
> --    uint32_t count = ntohl(*(uint32_t*)(arg + 2));
> --    down(&tpm_mutex);
> --    if (tpm_response.data != NULL) kfree(tpm_response.data);
> --    if (tpm_handle_command((char*)arg, count, &tpm_response.data,
> --                           &tpm_response.size) == 0) {
> --      tpm_response.size -= copy_to_user((char*)arg, tpm_response.data,
> --                            tpm_response.size);
> --      kfree(tpm_response.data);
> --      tpm_response.data = NULL;
> --    } else {
> --      tpm_response.size = 0;
> --      tpm_response.data = NULL;
> --    }
> --    up(&tpm_mutex);
> --    return tpm_response.size;
> --  }
> --  return -1;
> --}
> --
> --struct file_operations fops = {
> --  .owner   = THIS_MODULE,
> --  .open    = tpm_open,
> --  .release = tpm_release,
> --  .read    = tpm_read,
> --  .write   = tpm_write,
> --  .ioctl   = tpm_ioctl,
> --};
> --
> --static struct miscdevice tpm_dev = {
> --  .minor      = TPM_DEVICE_MINOR,
> --  .name       = TPM_DEVICE_NAME,
> --  .fops       = &fops,
> --};
> --
> --int __init init_tpm_module(void)
> --{
> --  int res = misc_register(&tpm_dev);
> --  if (res != 0) {
> --    error("misc_register() failed for minor %d\n", TPM_DEVICE_MINOR);
> --    return res;
> --  }
> --  /* initialize variables */
> --  sema_init(&tpm_mutex, 1);
> --  module_state = 0;
> --  tpm_response.data = NULL;
> --  old_time = current_kernel_time();
> --  /* initialize TPM emulator */
> --  if (!strcmp(startup, "clear")) {
> --    tpm_emulator_init(1);
> --  } else if (!strcmp(startup, "save")) {
> --    tpm_emulator_init(2);
> --  } else if (!strcmp(startup, "deactivated")) {
> --    tpm_emulator_init(3);
> --  } else {
> --    error("invalid startup mode '%s'; must be 'clear', "
> --      "'save' (default) or 'deactivated", startup);
> --    misc_deregister(&tpm_dev);
> --    return -EINVAL;
> --  }
> --  return 0;
> --}
> --
> --void __exit cleanup_tpm_module(void)
> --{
> --  tpm_emulator_shutdown();
> --  misc_deregister(&tpm_dev);
> --  if (tpm_response.data != NULL) kfree(tpm_response.data);
> --}
> --
> --module_init(init_tpm_module);
> --module_exit(cleanup_tpm_module);
> --
> --uint64_t tpm_get_ticks(void)
> --{
> --  struct timespec new_time = current_kernel_time();
> --  uint64_t ticks = (uint64_t)(new_time.tv_sec - old_time.tv_sec) * 1000000
> --                   + (new_time.tv_nsec - old_time.tv_nsec) / 1000;
> --  old_time = new_time;
> --  return (ticks > 0) ? ticks : 1;
> --}
> --
> -diff -uprN orig/tpm_emulator-0.4/linux_module.h tpm_emulator/linux_module.h
> ---- orig/tpm_emulator-0.4/linux_module.h       2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/linux_module.h        2006-07-24 14:35:35.000000000 -0700
> -@@ -1,5 +1,6 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -17,54 +18,62 @@
> - #ifndef _LINUX_MODULE_H_
> - #define _LINUX_MODULE_H_
> -
> --#include <linux/version.h>
> --#include <linux/kernel.h>
> --#include <linux/slab.h>
> -+#include <malloc.h>
> -+#include <stdint.h>
> -+#include <stdio.h>
> -+#include <string.h>
> - #include <linux/types.h>
> --#include <linux/string.h>
> --#include <linux/random.h>
> --#include <linux/time.h>
> --#include <asm/byteorder.h>
> -
> --/* module settings */
> -+#include <endian.h>
> -+#define __BYTEORDER_HAS_U64__
> -+#ifdef LITTLE_ENDIAN
> -+ #include <linux/byteorder/little_endian.h>
> -+#else
> -+ #include <linux/byteorder/big_endian.h>
> -+#endif
> -
> -+/* module settings */
> -+#define min(A,B) ((A)<(B)?(A):(B))
> -+#ifndef STR
> - #define STR(s) __STR__(s)
> - #define __STR__(s) #s
> -+#endif
> - #include "tpm_version.h"
> -
> - #define TPM_DEVICE_MINOR  224
> - #define TPM_DEVICE_NAME   "tpm"
> - #define TPM_MODULE_NAME   "tpm_emulator"
> -
> --/* debug and log output functions */
> --
> - #ifdef DEBUG
> --#define debug(fmt, ...) printk(KERN_DEBUG "%s %s:%d: Debug: " fmt "\n", \
> --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug(fmt, ...) printf("TPMD: %s:%d: Debug: " fmt "\n", \
> -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> - #else
> - #define debug(fmt, ...)
> - #endif
> --#define info(fmt, ...)  printk(KERN_INFO "%s %s:%d: Info: " fmt "\n", \
> --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> --#define error(fmt, ...) printk(KERN_ERR "%s %s:%d: Error: " fmt "\n", \
> --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> --#define alert(fmt, ...) printk(KERN_ALERT "%s %s:%d: Alert: " fmt "\n", \
> --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define info(fmt, ...)  printf("TPMD: %s:%d: Info: " fmt "\n", \
> -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define error(fmt, ...) printf("TPMD: %s:%d: Error: " fmt "\n", \
> -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define alert(fmt, ...) printf("TPMD: %s:%d: Alert: " fmt "\n", \
> -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> -
> - /* memory allocation */
> -
> - static inline void *tpm_malloc(size_t size)
> - {
> --  return kmalloc(size, GFP_KERNEL);
> -+  return malloc(size);
> - }
> -
> - static inline void tpm_free(const void *ptr)
> - {
> --  if (ptr != NULL) kfree(ptr);
> -+  if (ptr != NULL) free( (void *) ptr);
> - }
> -
> - /* random numbers */
> -
> -+//FIXME;
> -+void get_random_bytes(void *buf, int nbytes);
> -+
> - static inline void tpm_get_random_bytes(void *buf, int nbytes)
> - {
> -   get_random_bytes(buf, nbytes);
> -@@ -84,9 +93,9 @@ uint64_t tpm_get_ticks(void);
> - #define CPU_TO_LE16(x) __cpu_to_le16(x)
> -
> - #define BE64_TO_CPU(x) __be64_to_cpu(x)
> --#define LE64_TO_CPU(x) __be64_to_cpu(x)
> -+#define LE64_TO_CPU(x) __le64_to_cpu(x)
> - #define BE32_TO_CPU(x) __be32_to_cpu(x)
> --#define LE32_TO_CPU(x) __be32_to_cpu(x)
> -+#define LE32_TO_CPU(x) __le32_to_cpu(x)
> - #define BE16_TO_CPU(x) __be16_to_cpu(x)
> - #define LE16_TO_CPU(x) __le16_to_cpu(x)
> -
> -diff -uprN orig/tpm_emulator-0.4/Makefile tpm_emulator/Makefile
> ---- orig/tpm_emulator-0.4/Makefile     2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/Makefile      2006-07-24 14:35:35.000000000 -0700
> -@@ -1,24 +1,40 @@
> - # Software-Based Trusted Platform Module (TPM) Emulator for Linux
> - # Copyright (C) 2004 Mario Strasser <mast@gmx.net>
> -+# Copyright (C) 2006 INTEL Corp.
> - #
> - # $Id: Makefile 115 2006-06-23 10:36:44Z mast $
> -
> --# kernel settings
> --KERNEL_RELEASE := $(shell uname -r)
> --KERNEL_BUILD   := /lib/modules/$(KERNEL_RELEASE)/build
> --MOD_SUBDIR     := misc
> -+COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
> -
> - # module settings
> --MODULE_NAME    := tpm_emulator
> -+BIN            := tpm_emulator
> - VERSION_MAJOR  := 0
> - VERSION_MINOR  := 4
> - VERSION_BUILD  := $(shell date +"%s")
> -
> --# enable/disable DEBUG messages
> --EXTRA_CFLAGS   += -Wall -DDEBUG -g
> -+# Installation program and options
> -+INSTALL         = install
> -+INSTALL_PROG    = $(INSTALL) -m0755
> -+INSTALL_DIR     = $(INSTALL) -d -m0755
> -+
> -+# Xen tools installation directory
> -+TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin
> -+
> -+CC      := gcc
> -+CFLAGS  += -g -Wall $(INCLUDE) -DDEBUG
> -+CFLAGS  += -I. -Itpm
> -+
> -+# Is the simulator running in it's own vm?
> -+#CFLAGS += -DVTPM_MULTI_VM
> -+
> -+ifeq ($(COMPILE_ARCH),x86_64)
> -+LIBDIR = lib64
> -+else
> -+LIBDIR = lib
> -+endif
> -
> - # GNU MP configuration
> --GMP_LIB        := /usr/lib/libgmp.a
> -+GMP_LIB        := /usr/$(LIBDIR)/libgmp.a
> - GMP_HEADER     := /usr/include/gmp.h
> -
> - # sources and objects
> -@@ -27,38 +43,32 @@ DIRS           := . crypto tpm
> - SRCS           := $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.c))
> - OBJS           := $(patsubst %.c, %.o, $(SRCS))
> - SRCS           += $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.h))
> --DISTSRC        := ./README ./AUTHORS ./ChangeLog ./Makefile $(SRCS)
> --DISTDIR        := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)
> -
> --obj-m               := $(MODULE_NAME).o
> --$(MODULE_NAME)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
> -+obj-m               := $(BIN)
> -+$(BIN)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
> -
> - EXTRA_CFLAGS   += -I$(src) -I$(src)/crypto -I$(src)/tpm
> -
> - # do not print "Entering directory ..."
> - MAKEFLAGS      += --no-print-directory
> -
> --all:  $(src)/crypto/gmp.h $(src)/crypto/libgmp.a version
> --      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules
> -+all: $(BIN)
> -
> --install:
> --      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules_install
> --      test -d /var/tpm || mkdir /var/tpm
> --      test -c /dev/tpm || mknod /dev/tpm c 10 224
> --      chmod 666 /dev/tpm
> --      depmod -a
> -+$(BIN):       $(src)/crypto/gmp.h $(src)/crypto/libgmp.a version $(SRCS) $(OBJS)
> -+      $(CC) $(CFLAGS) $(OBJS) $(src)/crypto/libgmp.a -o $(BIN)
> -+
> -+%.o: %.c
> -+      $(CC) $(CFLAGS) -c $< -o $@
> -+
> -+install: $(BIN)
> -+      $(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)
> -+      @if [ ! -d "/var/tpm" ]; then mkdir /var/tpm; fi
> -
> - clean:
> --      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) clean
> --      rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a
> -+      rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a $(OBJS)
> -
> --dist: $(DISTSRC)
> --      rm -rf $(DISTDIR)
> --      mkdir $(DISTDIR)
> --      cp --parents $(DISTSRC) $(DISTDIR)/
> --      rm -f $(DISTDIR)/crypto/gmp.h
> --      tar -chzf $(DISTDIR).tar.gz $(DISTDIR)
> --      rm -rf $(DISTDIR)
> -+mrproper: clean
> -+      rm -f $(BIN) tpm_version.h
> -
> - $(src)/crypto/libgmp.a:
> -       test -f $(src)/crypto/libgmp.a || ln -s $(GMP_LIB) $(src)/crypto/libgmp.a
> -@@ -88,4 +98,3 @@ version:
> -       @echo "#endif /* _TPM_VERSION_H_ */" >> $(src)/tpm_version.h
> -
> - .PHONY: all install clean dist gmp version
> --
> -diff -uprN orig/tpm_emulator-0.4/README tpm_emulator/README
> ---- orig/tpm_emulator-0.4/README       2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/README        2006-07-24 14:35:35.000000000 -0700
> -@@ -13,7 +13,8 @@ $Id: README 113 2006-06-18 12:38:13Z hst
> - Copyright
> - --------------------------------------------------------------------------
> - Copyright (C) 2004 Mario Strasser <mast@gmx.net> and Swiss Federal
> --Institute of Technology (ETH) Zurich.
> -+                   Institute of Technology (ETH) Zurich.
> -+Copyright (C) 2005 INTEL Corp
> -
> - This program is free software; you can redistribute it and/or modify
> - it under the terms of the GNU General Public License as published by
> -@@ -43,6 +44,12 @@ Example:
> - GMP_LIB        := /usr/lib/libgmp.a
> - GMP_HEADER     := /usr/include/gmp.h
> -
> -+GNU MP Library on 64 bit Systems
> -+--------------------------------------------------------------------------
> -+Some 64-bit kernels have problems with importing the user-space gmp
> -+library (/usr/lib*/libgmp.a) into kernel space.  These kernels will require
> -+that the gmp library be recompiled for kernel space with -mcmodel=kernel.
> -+
> - Installation
> - --------------------------------------------------------------------------
> - The compilation and installation process uses the build environment for
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_capability.c tpm_emulator/tpm/tpm_capability.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_capability.c 2006-06-23 19:37:07.000000000 +0900
> -+++ tpm_emulator/tpm/tpm_capability.c  2007-12-28 22:50:19.000000000 +0900
> -@@ -701,7 +701,10 @@ TPM_RESULT TPM_GetCapabilityOwner(TPM_VE
> -   TPM_RESULT res;
> -
> -   info("TPM_GetCapabilityOwner()");
> --
> -+
> -+  if (!tpmData.permanent.flags.owned) {
> -+    return TPM_NOSRK;
> -+  }
> -   /* Verify owner authorization */
> -   res = tpm_verify_auth(auth1, tpmData.permanent.data.ownerAuth, TPM_KH_OWNER);
> -   if (res != TPM_SUCCESS) return res;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c tpm_emulator/tpm/tpm_cmd_handler.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c        2006-06-23 19:37:07.000000000 +0900
> -+++ tpm_emulator/tpm/tpm_cmd_handler.c 2007-09-12 20:23:00.000000000 +0900
> -@@ -565,7 +565,7 @@ static TPM_RESULT execute_TPM_Seal(TPM_R
> -   if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle)
> -       || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth)
> -       || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize)
> --      || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)
> -+      || (pcrInfoSize >0 && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo))
> -       || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize)
> -       || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize)
> -       || len != 0) return TPM_BAD_PARAMETER;
> -@@ -798,7 +798,7 @@ static TPM_RESULT execute_TPM_Sealx(TPM_
> -   if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle)
> -       || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth)
> -       || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize)
> --      || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)
> -+      || (pcrInfoSize > 0 && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo))
> -       || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize)
> -       || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize)
> -       || len != 0) return TPM_BAD_PARAMETER;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_credentials.c tpm_emulator/tpm/tpm_credentials.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_credentials.c        2006-06-23 19:37:07.000000000 +0900
> -+++ tpm_emulator/tpm/tpm_credentials.c 2007-09-12 20:23:30.000000000 +0900
> -@@ -47,20 +47,20 @@ int tpm_compute_pubkey_checksum(TPM_NONC
> -
> - TPM_RESULT tpm_get_pubek(TPM_PUBKEY *pubEndorsementKey)
> - {
> --  UINT32 key_length;
> -+  size_t key_length;
> -   if (!tpmData.permanent.data.endorsementKey.size) return TPM_NO_ENDORSEMENT;
> -   /* setup TPM_PUBKEY structure */
> --  key_length = tpmData.permanent.data.endorsementKey.size;
> --  pubEndorsementKey->pubKey.keyLength = key_length >> 3;
> -+  pubEndorsementKey->pubKey.keyLength = tpmData.permanent.data.endorsementKey.size >> 3;
> -   pubEndorsementKey->pubKey.key = tpm_malloc(pubEndorsementKey->pubKey.keyLength);
> -   if (pubEndorsementKey->pubKey.key == NULL) return TPM_FAIL;
> -   rsa_export_modulus(&tpmData.permanent.data.endorsementKey,
> --    pubEndorsementKey->pubKey.key,
> --    &pubEndorsementKey->pubKey.keyLength);
> -+                   pubEndorsementKey->pubKey.key,
> -+                   &key_length);
> -+  pubEndorsementKey->pubKey.keyLength = key_length;
> -   pubEndorsementKey->algorithmParms.algorithmID = TPM_ALG_RSA;
> -   pubEndorsementKey->algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
> -   pubEndorsementKey->algorithmParms.sigScheme = TPM_SS_NONE;
> --  pubEndorsementKey->algorithmParms.parms.rsa.keyLength = key_length;
> -+  pubEndorsementKey->algorithmParms.parms.rsa.keyLength = key_length << 3;
> -   pubEndorsementKey->algorithmParms.parms.rsa.numPrimes = 2;
> -   pubEndorsementKey->algorithmParms.parms.rsa.exponentSize = 0;
> -   pubEndorsementKey->algorithmParms.parms.rsa.exponent = NULL;
> -@@ -175,6 +175,7 @@ TPM_RESULT TPM_OwnerReadInternalPub(TPM_
> - {
> -   TPM_RESULT res;
> -   TPM_KEY_DATA *srk = &tpmData.permanent.data.srk;
> -+  size_t key_length;
> -   info("TPM_OwnerReadInternalPub()");
> -   /* verify authorization */
> -   res = tpm_verify_auth(auth1, tpmData.permanent.data.ownerAuth, TPM_KH_OWNER);
> -@@ -186,7 +187,8 @@ TPM_RESULT TPM_OwnerReadInternalPub(TPM_
> -     publicPortion->pubKey.key = tpm_malloc(publicPortion->pubKey.keyLength);
> -     if (publicPortion->pubKey.key == NULL) return TPM_FAIL;
> -     rsa_export_modulus(&srk->key, publicPortion->pubKey.key,
> --      &publicPortion->pubKey.keyLength);
> -+      &key_length);
> -+    publicPortion->pubKey.keyLength = key_length;
> -     publicPortion->algorithmParms.algorithmID = TPM_ALG_RSA;
> -     publicPortion->algorithmParms.encScheme = srk->encScheme;
> -     publicPortion->algorithmParms.sigScheme = srk->sigScheme;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_crypto.c tpm_emulator/tpm/tpm_crypto.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_crypto.c     2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_crypto.c      2006-07-24 14:35:35.000000000 -0700
> -@@ -182,7 +182,8 @@ TPM_RESULT TPM_CertifyKey(TPM_KEY_HANDLE
> -   TPM_KEY_DATA *cert, *key;
> -   sha1_ctx_t sha1_ctx;
> -   BYTE *buf, *p;
> --  UINT32 length;
> -+  UINT32 length32;
> -+  size_t length;
> -   info("TPM_CertifyKey()");
> -   /* get keys */
> -   cert = tpm_get_key(certHandle);
> -@@ -264,14 +265,15 @@ TPM_RESULT TPM_CertifyKey(TPM_KEY_HANDLE
> -   /* compute the digest of the CERTIFY_INFO[2] structure and sign it */
> -   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
> -   p = buf = tpm_malloc(length);
> -+  length32=(UINT32) length;
> -   if (buf == NULL
> --      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length, certifyInfo)) {
> -+      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length32, certifyInfo)) {
> -     free_TPM_KEY_PARMS(certifyInfo->algorithmParms);
> -     return TPM_FAIL;
> -   }
> -   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
> -   sha1_init(&sha1_ctx);
> --  sha1_update(&sha1_ctx, buf, length);
> -+  sha1_update(&sha1_ctx, buf, (size_t) length);
> -   sha1_final(&sha1_ctx, buf);
> -   res = tpm_sign(cert, auth1, FALSE, buf, SHA1_DIGEST_LENGTH, outData, outDataSize);
> -   tpm_free(buf);
> -@@ -292,7 +294,8 @@ TPM_RESULT TPM_CertifyKey2(TPM_KEY_HANDL
> -   TPM_KEY_DATA *cert, *key;
> -   sha1_ctx_t sha1_ctx;
> -   BYTE *buf, *p;
> --  UINT32 length;
> -+  size_t length;
> -+  UINT32 length32;
> -   info("TPM_CertifyKey2()");
> -   /* get keys */
> -   cert = tpm_get_key(certHandle);
> -@@ -362,8 +365,9 @@ TPM_RESULT TPM_CertifyKey2(TPM_KEY_HANDL
> -   /* compute the digest of the CERTIFY_INFO[2] structure and sign it */
> -   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
> -   p = buf = tpm_malloc(length);
> -+  length32 = (UINT32) length;
> -   if (buf == NULL
> --      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length, certifyInfo)) {
> -+      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length32, certifyInfo)) {
> -     free_TPM_KEY_PARMS(certifyInfo->algorithmParms);
> -     return TPM_FAIL;
> -   }
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_daa.c tpm_emulator/tpm/tpm_daa.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_daa.c        2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_daa.c 2006-07-24 14:35:35.000000000 -0700
> -@@ -716,14 +716,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -805,14 +805,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -1489,14 +1489,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -1712,14 +1712,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -1793,14 +1793,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -2918,14 +2918,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -3143,7 +3143,7 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -         sha1_init(&sha1);
> -         sha1_update(&sha1, (BYTE*) &session->DAA_session.DAA_digest,
> -           sizeof(session->DAA_session.DAA_digest));
> --        sha1_update(&sha1, "\x01", 1);
> -+        sha1_update(&sha1, (BYTE *) "\x01", 1);
> -         sha1_update(&sha1, inputData1, inputSize1);
> -         sha1_final(&sha1, (BYTE*) &session->DAA_session.DAA_digest);
> -       }
> -@@ -3172,7 +3172,7 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -         sha1_init(&sha1);
> -         sha1_update(&sha1, (BYTE*) &session->DAA_session.DAA_digest,
> -           sizeof(session->DAA_session.DAA_digest));
> --        sha1_update(&sha1, "\x00", 1);
> -+        sha1_update(&sha1, (BYTE*) "\x00", 1);
> -         rsa_export_modulus(&aikData->key, scratch, &size);
> -         sha1_update(&sha1, scratch, size);
> -         sha1_final(&sha1, (BYTE*) &session->DAA_session.DAA_digest);
> -@@ -3229,14 +3229,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -3309,14 +3309,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_data.c tpm_emulator/tpm/tpm_data.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_data.c       2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_data.c        2006-07-24 14:35:35.000000000 -0700
> -@@ -40,6 +40,7 @@ static inline void init_pcr_attr(int pcr
> - void tpm_init_data(void)
> - {
> -   /* endorsement key */
> -+#ifndef TPM_GENERATE_EK
> -   uint8_t ek_n[] =  "\xa8\xdb\xa9\x42\xa8\xf3\xb8\x06\x85\x90\x76\x93\xad\xf7"
> -     "\x74\xec\x3f\xd3\x3d\x9d\xe8\x2e\xff\x15\xed\x0e\xce\x5f\x93"
> -     "\x92\xeb\xd1\x96\x2b\x72\x18\x81\x79\x12\x9d\x9c\x40\xd7\x1a"
> -@@ -77,6 +78,8 @@ void tpm_init_data(void)
> -     "\xd1\xc0\x8b\x5b\xa2\x2e\xa7\x15\xca\x50\x75\x10\x48\x9c\x2b"
> -     "\x18\xb9\x67\x8f\x5d\x64\xc3\x28\x9f\x2f\x16\x2f\x08\xda\x47"
> -     "\xec\x86\x43\x0c\x80\x99\x07\x34\x0f";
> -+#endif
> -+
> -   int i;
> -   /* reset all data to NULL, FALSE or 0 */
> -   memset(&tpmData, 0, sizeof(tpmData));
> -@@ -152,44 +155,43 @@ void tpm_release_data(void)
> -
> - #ifdef TPM_STORE_TO_FILE
> -
> --#include <linux/fs.h>
> --#include <linux/unistd.h>
> --#include <asm/uaccess.h>
> -+#include <sys/types.h>
> -+#include <sys/stat.h>
> -+#include <fcntl.h>
> -+#include <unistd.h>
> -
> - #define TPM_STORAGE_FILE "/var/tpm/tpm_emulator-1.2." STR(VERSION_MAJOR) "." STR(VERSION_MINOR)
> -
> - static int write_to_file(uint8_t *data, size_t data_length)
> - {
> -   int res;
> --  struct file *fp;
> --  mm_segment_t old_fs = get_fs();
> --  fp = filp_open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> --  if (IS_ERR(fp)) return -1;
> --  set_fs(get_ds());
> --  res = fp->f_op->write(fp, data, data_length, &fp->f_pos);
> --  set_fs(old_fs);
> --  filp_close(fp, NULL);
> -+  int fp;
> -+  fp = open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> -+  res = write(fp, data, data_length);
> -+  close(fp);
> -   return (res == data_length) ? 0 : -1;
> - }
> -
> - static int read_from_file(uint8_t **data, size_t *data_length)
> - {
> -   int res;
> --  struct file *fp;
> --  mm_segment_t old_fs = get_fs();
> --  fp = filp_open(TPM_STORAGE_FILE, O_RDONLY, 0);
> --  if (IS_ERR(fp)) return -1;
> --  *data_length = (size_t)fp->f_dentry->d_inode->i_size;
> --  /* *data_length = i_size_read(fp->f_dentry->d_inode); */
> -+  int fp, file_status;
> -+  struct stat file_info;
> -+  fp = open(TPM_STORAGE_FILE, O_RDONLY, 0);
> -+  file_status = fstat(fp, &file_info);
> -+  if (file_status < 0) {
> -+    close(fp);
> -+    return -1;
> -+  }
> -+
> -+  *data_length = file_info.st_size;
> -   *data = tpm_malloc(*data_length);
> -   if (*data == NULL) {
> --    filp_close(fp, NULL);
> -+    close(fp);
> -     return -1;
> -   }
> --  set_fs(get_ds());
> --  res = fp->f_op->read(fp, *data, *data_length, &fp->f_pos);
> --  set_fs(old_fs);
> --  filp_close(fp, NULL);
> -+  res = read(fp, *data, *data_length);
> -+  close(fp);
> -   if (res != *data_length) {
> -     tpm_free(*data);
> -     return -1;
> -@@ -216,23 +218,30 @@ static int read_from_file(uint8_t **data
> - int tpm_store_permanent_data(void)
> - {
> -   uint8_t *buf, *ptr;
> --  size_t buf_length, len;
> -+  UINT32 buf_length, len;
> -
> -   /* marshal data */
> --  buf_length = len = sizeof_TPM_STCLEAR_FLAGS(tpmData.stclear.flags)
> --    + sizeof_TPM_PERMANENT_FLAGS(tpmData.permanent.flags) + 2
> --    + sizeof_TPM_PERMANENT_DATA(tpmData.permanent.data);
> -+  buf_length = len = 4 + sizeof_TPM_STCLEAR_FLAGS(tpmData.stclear.flags)
> -+    + sizeof_TPM_PERMANENT_FLAGS(tpmData.permanent.flags)
> -+    + sizeof_TPM_STANY_FLAGS(tpmData.stany.flags) + 2
> -+    + sizeof_TPM_STCLEAR_DATA(tpmData.stclear.data)
> -+    + sizeof_TPM_PERMANENT_DATA(tpmData.permanent.data)
> -+    + sizeof_TPM_STANY_DATA(tpmData.stany.data);
> -   buf = ptr = tpm_malloc(buf_length);
> -   if (buf == NULL
> -       || tpm_marshal_TPM_VERSION(&ptr, &len, &tpmData.permanent.data.version)
> -       || tpm_marshal_TPM_STCLEAR_FLAGS(&ptr, &len, &tpmData.stclear.flags)
> -       || tpm_marshal_TPM_PERMANENT_FLAGS(&ptr, &len, &tpmData.permanent.flags)
> -+      || tpm_marshal_TPM_STANY_FLAGS(&ptr, &len, &tpmData.stany.flags)
> -       || tpm_marshal_BOOL(&ptr, &len, tpmData.permanent.flags.selfTestSucceeded)
> -       || tpm_marshal_BOOL(&ptr, &len, tpmData.permanent.flags.owned)
> --      || tpm_marshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)) {
> -+      || tpm_marshal_TPM_STCLEAR_DATA(&ptr, &len, &tpmData.stclear.data)
> -+      || tpm_marshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)
> -+      || tpm_marshal_TPM_STANY_DATA(&ptr, &len, &tpmData.stany.data)) {
> -     tpm_free(buf);
> -     return -1;
> -   }
> -+
> -   if (write_to_file(buf, buf_length - len)) {
> -     tpm_free(buf);
> -     return -1;
> -@@ -244,31 +253,36 @@ int tpm_store_permanent_data(void)
> - int tpm_restore_permanent_data(void)
> - {
> -   uint8_t *buf, *ptr;
> --  size_t buf_length, len;
> -+  size_t buf_length;
> -+  UINT32 len;
> -   TPM_VERSION ver;
> -
> -   /* read data */
> -   if (read_from_file(&buf, &buf_length)) return -1;
> -   ptr = buf;
> --  len = buf_length;
> -+  len = (uint32_t) buf_length;
> -   /* unmarshal data */
> -   if (tpm_unmarshal_TPM_VERSION(&ptr, &len, &ver)
> -       || memcmp(&ver, &tpmData.permanent.data.version, sizeof(TPM_VERSION))
> -       || tpm_unmarshal_TPM_STCLEAR_FLAGS(&ptr, &len, &tpmData.stclear.flags)
> -       || tpm_unmarshal_TPM_PERMANENT_FLAGS(&ptr, &len, &tpmData.permanent.flags)
> -+      || tpm_unmarshal_TPM_STANY_FLAGS(&ptr, &len, &tpmData.stany.flags)
> -       || tpm_unmarshal_BOOL(&ptr, &len, &tpmData.permanent.flags.selfTestSucceeded)
> -       || tpm_unmarshal_BOOL(&ptr, &len, &tpmData.permanent.flags.owned)
> --      || tpm_unmarshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)) {
> -+      || tpm_unmarshal_TPM_STCLEAR_DATA(&ptr, &len, &tpmData.stclear.data)
> -+      || tpm_unmarshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)
> -+      || tpm_unmarshal_TPM_STANY_DATA(&ptr, &len, &tpmData.stany.data)) {
> -     tpm_free(buf);
> -     return -1;
> -   }
> -+
> -   tpm_free(buf);
> -   return 0;
> - }
> -
> - int tpm_erase_permanent_data(void)
> - {
> --  int res = write_to_file("", 0);
> -+  int res = write_to_file((uint8_t *) "", 0);
> -   return res;
> - }
> -
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_deprecated.c tpm_emulator/tpm/tpm_deprecated.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_deprecated.c 2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_deprecated.c  2006-07-24 14:35:35.000000000 -0700
> -@@ -1,6 +1,7 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -50,7 +51,7 @@ TPM_RESULT TPM_SaveKeyContext(TPM_KEY_HA
> -   BYTE *ptr;
> -   UINT32 len;
> -   info("TPM_SaveKeyContext()");
> --  res = TPM_SaveContext(keyHandle, TPM_RT_KEY, "SaveKeyContext..",
> -+  res = TPM_SaveContext(keyHandle, TPM_RT_KEY, (BYTE*)"SaveKeyContext..",
> -                         keyContextSize, &contextBlob);
> -   if (res != TPM_SUCCESS) return res;
> -   len = *keyContextSize;
> -@@ -82,7 +83,7 @@ TPM_RESULT TPM_SaveAuthContext(TPM_AUTHH
> -   BYTE *ptr;
> -   UINT32 len;
> -   info("TPM_SaveAuthContext()");
> --  res = TPM_SaveContext(authHandle, TPM_RT_KEY, "SaveAuthContext.",
> -+  res = TPM_SaveContext(authHandle, TPM_RT_KEY, (BYTE*)"SaveAuthContext.",
> -                         authContextSize, &contextBlob);
> -   if (res != TPM_SUCCESS) return res;
> -   len = *authContextSize;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_emulator.h tpm_emulator/tpm/tpm_emulator.h
> ---- orig/tpm_emulator-0.4/tpm/tpm_emulator.h   2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_emulator.h    2006-07-24 14:35:35.000000000 -0700
> -@@ -1,5 +1,6 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -22,7 +23,8 @@
> - /* TPM configuration */
> - #define TPM_STORE_TO_FILE       1
> - #undef  TPM_STRONG_PERSISTENCE
> --#undef  TPM_GENERATE_EK
> -+//#undef  TPM_GENERATE_EK
> -+#define  TPM_GENERATE_EK
> - #undef  TPM_GENERATE_SEED_DAA
> -
> - #define TPM_MANUFACTURER 0x4554485A /* 'ETHZ' */
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_marshalling.c tpm_emulator/tpm/tpm_marshalling.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_marshalling.c        2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_marshalling.c 2006-07-24 14:35:35.000000000 -0700
> -@@ -1312,7 +1312,7 @@ int tpm_unmarshal_TPM_STANY_FLAGS(BYTE *
> -
> - int tpm_marshal_RSA(BYTE **ptr, UINT32 *length, rsa_private_key_t *v)
> - {
> --  UINT32 m_len, e_len, q_len;
> -+  size_t m_len, e_len, q_len;
> -   if (*length < sizeof_RSA((*v))) return -1;
> -   if (v->size > 0) {
> -     rsa_export_modulus(v, &(*ptr)[6], &m_len);
> -@@ -1460,6 +1460,66 @@ int tpm_unmarshal_TPM_PERMANENT_DATA(BYT
> -   return 0;
> - }
> -
> -+int tpm_marshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v)
> -+{
> -+  if (tpm_marshal_TPM_STRUCTURE_TAG(ptr, length, v->tag)
> -+    || tpm_marshal_TPM_NONCE(ptr, length, &v->contextNonceKey)
> -+    || tpm_marshal_TPM_COUNT_ID(ptr, length, v->countID) ) return -1;
> -+
> -+  return 0;
> -+}
> -+
> -+int tpm_unmarshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v)
> -+{
> -+  if (tpm_unmarshal_TPM_STRUCTURE_TAG(ptr, length, &v->tag)
> -+    || tpm_unmarshal_TPM_NONCE(ptr, length, &v->contextNonceKey)
> -+    || tpm_unmarshal_TPM_COUNT_ID(ptr, length, &v->countID) ) return -1;
> -+
> -+  return 0;
> -+}
> -+
> -+int tpm_marshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v)
> -+{
> -+  UINT32 i;
> -+  if (tpm_marshal_TPM_STRUCTURE_TAG(ptr, length, v->tag)
> -+    || tpm_marshal_TPM_NONCE(ptr, length, &v->contextNonceSession)
> -+    || tpm_marshal_TPM_DIGEST(ptr, length, &v->auditDigest)
> -+    || tpm_marshal_BOOL(ptr, length, v->auditSession)
> -+    || tpm_marshal_TPM_CURRENT_TICKS(ptr, length, &v->currentTicks)
> -+    || tpm_marshal_UINT32(ptr, length, v->contextCount)
> -+    || tpm_marshal_UINT32_ARRAY(ptr, length, v->contextList, TPM_MAX_SESSION_LIST)) return -1;
> -+  for (i = 0; i < TPM_MAX_SESSIONS; i++) {
> -+    if (tpm_marshal_TPM_SESSION_DATA(ptr, length, &v->sessions[i])) return -1;
> -+  }
> -+  for (i = 0; i < TPM_MAX_SESSIONS_DAA; i++) {
> -+    if (tpm_marshal_TPM_DAA_SESSION_DATA(ptr, length, &v->sessionsDAA[i])) return -1;
> -+  }
> -+  if (tpm_marshal_TPM_TRANSHANDLE(ptr, length, v->transExclusive)) return -1;
> -+
> -+  return 0;
> -+}
> -+
> -+int tpm_unmarshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v)
> -+{
> -+  UINT32 i;
> -+  if (tpm_unmarshal_TPM_STRUCTURE_TAG(ptr, length, &v->tag)
> -+    || tpm_unmarshal_TPM_NONCE(ptr, length, &v->contextNonceSession)
> -+    || tpm_unmarshal_TPM_DIGEST(ptr, length, &v->auditDigest)
> -+    || tpm_unmarshal_BOOL(ptr, length, &v->auditSession)
> -+    || tpm_unmarshal_TPM_CURRENT_TICKS(ptr, length, &v->currentTicks)
> -+    || tpm_unmarshal_UINT32(ptr, length, &v->contextCount)
> -+    || tpm_unmarshal_UINT32_ARRAY(ptr, length, v->contextList, TPM_MAX_SESSION_LIST)) return -1;
> -+  for (i = 0; i < TPM_MAX_SESSIONS; i++) {
> -+    if (tpm_unmarshal_TPM_SESSION_DATA(ptr, length, &v->sessions[i])) return -1;
> -+  }
> -+  for (i = 0; i < TPM_MAX_SESSIONS_DAA; i++) {
> -+    if (tpm_unmarshal_TPM_DAA_SESSION_DATA(ptr, length, &v->sessionsDAA[i])) return -1;
> -+  }
> -+  if (tpm_unmarshal_TPM_TRANSHANDLE(ptr, length, &v->transExclusive)) return -1;
> -+
> -+  return 0;
> -+}
> -+
> - int tpm_marshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v)
> - {
> -   if (tpm_marshal_BYTE(ptr, length, v->type)
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_marshalling.h tpm_emulator/tpm/tpm_marshalling.h
> ---- orig/tpm_emulator-0.4/tpm/tpm_marshalling.h        2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_marshalling.h 2006-07-24 14:35:35.000000000 -0700
> -@@ -432,6 +432,12 @@ int tpm_unmarshal_TPM_KEY_DATA(BYTE **pt
> - int tpm_marshal_TPM_PERMANENT_DATA(BYTE **ptr, UINT32 *length, TPM_PERMANENT_DATA *);
> - int tpm_unmarshal_TPM_PERMANENT_DATA(BYTE **ptr, UINT32 *length, TPM_PERMANENT_DATA *);
> -
> -+int tpm_marshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v);
> -+int tpm_unmarshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v);
> -+
> -+int tpm_marshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v);
> -+int tpm_unmarshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v);
> -+
> - int tpm_marshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v);
> - int tpm_unmarshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v);
> -
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_owner.c tpm_emulator/tpm/tpm_owner.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_owner.c      2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_owner.c       2006-07-24 14:35:35.000000000 -0700
> -@@ -108,7 +108,7 @@ TPM_RESULT TPM_TakeOwnership(TPM_PROTOCO
> -   TPM_RESULT res;
> -   rsa_private_key_t *ek = &tpmData.permanent.data.endorsementKey;
> -   TPM_KEY_DATA *srk = &tpmData.permanent.data.srk;
> --  UINT32 buf_size = ek->size >> 3;
> -+  size_t buf_size = ek->size >> 3, key_length;
> -   BYTE buf[buf_size];
> -
> -   info("TPM_TakeOwnership()");
> -@@ -173,7 +173,8 @@ TPM_RESULT TPM_TakeOwnership(TPM_PROTOCO
> -     return TPM_FAIL;
> -   }
> -   rsa_export_modulus(&srk->key, srkPub->pubKey.key,
> --    &srkPub->pubKey.keyLength);
> -+                   &key_length);
> -+  srkPub->pubKey.keyLength = (UINT32) key_length;
> -   /* setup tpmProof and set state to owned */
> -   tpm_get_random_bytes(tpmData.permanent.data.tpmProof.nonce,
> -     sizeof(tpmData.permanent.data.tpmProof.nonce));
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_startup.c tpm_emulator/tpm/tpm_startup.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_startup.c    2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_startup.c     2006-07-24 14:35:35.000000000 -0700
> -@@ -41,26 +41,29 @@ void TPM_Init(TPM_STARTUP_TYPE startupTy
> - TPM_RESULT TPM_Startup(TPM_STARTUP_TYPE startupType)
> - {
> -   int i;
> -+  int restore_fail;
> -   info("TPM_Startup(%d)", startupType);
> -   if (tpmData.stany.flags.postInitialise == FALSE) return TPM_INVALID_POSTINIT;
> --  /* reset STANY_FLAGS */
> --  SET_TO_ZERO(&tpmData.stany.flags);
> --  tpmData.stany.flags.tag = TPM_TAG_STANY_FLAGS;
> --  /* reset STANY_DATA (invalidates ALL sessions) */
> --  SET_TO_ZERO(&tpmData.stany.data);
> --  tpmData.stany.data.tag = TPM_TAG_STANY_DATA;
> --  /* init session-context nonce */
> --  SET_TO_RAND(&tpmData.stany.data.contextNonceSession);
> -+
> -+  /* try and restore state to get EK, SRK, etc */
> -+  restore_fail = tpm_restore_permanent_data();
> -+
> -   /* set data and flags according to the given startup type */
> -   if (startupType == TPM_ST_CLEAR) {
> --    /* if available, restore permanent data */
> --    tpm_restore_permanent_data();
> -+    /* reset STANY_FLAGS */
> -+    SET_TO_ZERO(&tpmData.stany.flags);
> -+    tpmData.stany.flags.tag = TPM_TAG_STANY_FLAGS;
> -+    /* reset STANY_DATA (invalidates ALL sessions) */
> -+    SET_TO_ZERO(&tpmData.stany.data);
> -+    tpmData.stany.data.tag = TPM_TAG_STANY_DATA;
> -+    /* init session-context nonce */
> -+    SET_TO_RAND(&tpmData.stany.data.contextNonceSession);
> -     /* reset PCR values */
> -     for (i = 0; i < TPM_NUM_PCR; i++) {
> --      if (tpmData.permanent.data.pcrAttrib[i].pcrReset)
> --        SET_TO_ZERO(tpmData.permanent.data.pcrValue[i].digest);
> -+      if (!tpmData.permanent.data.pcrAttrib[i].pcrReset)
> -+        SET_TO_ZERO(&tpmData.permanent.data.pcrValue[i].digest);
> -       else
> --        SET_TO_0xFF(tpmData.permanent.data.pcrValue[i].digest);
> -+        SET_TO_0xFF(&tpmData.permanent.data.pcrValue[i].digest);
> -     }
> -     /* reset STCLEAR_FLAGS */
> -     SET_TO_ZERO(&tpmData.stclear.flags);
> -@@ -79,7 +82,8 @@ TPM_RESULT TPM_Startup(TPM_STARTUP_TYPE
> -     /* init key-context nonce */
> -     SET_TO_RAND(&tpmData.stclear.data.contextNonceKey);
> -   } else if (startupType == TPM_ST_STATE) {
> --    if (tpm_restore_permanent_data()) {
> -+    /* restore must have been successful for TPM_ST_STATE */
> -+    if (restore_fail) {
> -       error("restoring permanent data failed");
> -       tpmData.permanent.data.testResult = "tpm_restore_permanent_data() failed";
> -       tpmData.permanent.flags.selfTestSucceeded = FALSE;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_storage.c tpm_emulator/tpm/tpm_storage.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_storage.c    2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_storage.c     2006-07-24 14:35:35.000000000 -0700
> -@@ -58,6 +58,7 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
> -                         BYTE *enc, UINT32 *enc_size)
> - {
> -   UINT32 len;
> -+  size_t enc_size32 = *enc_size;
> -   BYTE *buf, *ptr;
> -   rsa_public_key_t pub_key;
> -   int scheme;
> -@@ -72,7 +73,7 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
> -   if (buf == NULL
> -       || tpm_marshal_TPM_SEALED_DATA(&ptr, &len, seal)
> -       || rsa_encrypt(&pub_key, scheme, buf, sizeof_TPM_SEALED_DATA((*seal)),
> --                     enc, enc_size)) {
> -+                     enc, &enc_size32)) {
> -     tpm_free(buf);
> -     rsa_release_public_key(&pub_key);
> -     return -1;
> -@@ -85,7 +86,8 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
> - int decrypt_sealed_data(TPM_KEY_DATA *key, BYTE *enc, UINT32 enc_size,
> -                         TPM_SEALED_DATA *seal, BYTE **buf)
> - {
> --  UINT32 len;
> -+  size_t len;
> -+  UINT32 len32;
> -   BYTE *ptr;
> -   int scheme;
> -   switch (key->encScheme) {
> -@@ -96,8 +98,12 @@ int decrypt_sealed_data(TPM_KEY_DATA *ke
> -   len = enc_size;
> -   *buf = ptr = tpm_malloc(len);
> -   if (*buf == NULL
> --      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len)
> --      || tpm_unmarshal_TPM_SEALED_DATA(&ptr, &len, seal)) {
> -+      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len) ){
> -+    tpm_free(*buf);
> -+    return -1;
> -+  }
> -+  len32 = len;
> -+  if (tpm_unmarshal_TPM_SEALED_DATA(&ptr, &len32, seal)) {
> -     tpm_free(*buf);
> -     return -1;
> -   }
> -@@ -240,11 +246,12 @@ TPM_RESULT TPM_Unseal(TPM_KEY_HANDLE par
> -
> - TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE keyHandle, UINT32 inDataSize,
> -                       BYTE *inData, TPM_AUTH *auth1,
> --                      UINT32 *outDataSize, BYTE **outData)
> -+                      UINT32 *outDataSize32, BYTE **outData)
> - {
> -   TPM_RESULT res;
> -   TPM_KEY_DATA *key;
> -   int scheme;
> -+  size_t outDataSize;
> -
> -   info("TPM_UnBind()");
> -   /* get key */
> -@@ -262,8 +269,8 @@ TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE key
> -   /* the size of the input data muss be greater than zero */
> -   if (inDataSize == 0) return TPM_BAD_PARAMETER;
> -   /* decrypt data */
> --  *outDataSize = inDataSize;
> --  *outData = tpm_malloc(*outDataSize);
> -+  outDataSize = inDataSize;
> -+  *outData = tpm_malloc(outDataSize);
> -   if (*outData == NULL) return TPM_NOSPACE;
> -   switch (key->encScheme) {
> -     case TPM_ES_RSAESOAEP_SHA1_MGF1: scheme = RSA_ES_OAEP_SHA1; break;
> -@@ -271,20 +278,21 @@ TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE key
> -     default: tpm_free(*outData); return TPM_DECRYPT_ERROR;
> -   }
> -   if (rsa_decrypt(&key->key, scheme, inData, inDataSize,
> --      *outData, outDataSize)) {
> -+      *outData, &outDataSize)) {
> -     tpm_free(*outData);
> -     return TPM_DECRYPT_ERROR;
> -   }
> -   /* verify data if it is of type TPM_BOUND_DATA */
> -   if (key->encScheme == TPM_ES_RSAESOAEP_SHA1_MGF1
> -       || key->keyUsage != TPM_KEY_LEGACY) {
> --    if (*outDataSize < 5 || memcmp(*outData, "\x01\x01\00\x00\x02", 5) != 0) {
> -+    if (outDataSize < 5 || memcmp(*outData, "\x01\x01\00\x00\x02", 5) != 0) {
> -       tpm_free(*outData);
> -       return TPM_DECRYPT_ERROR;
> -     }
> --    *outDataSize -= 5;
> --    memmove(*outData, &(*outData)[5], *outDataSize);
> -+    outDataSize -= 5;
> -+    memmove(*outData, &(*outData)[5], outDataSize);
> -   }
> -+  *outDataSize32 = (UINT32) outDataSize;
> -   return TPM_SUCCESS;
> - }
> -
> -@@ -334,12 +342,13 @@ int compute_pubkey_digest(TPM_PUBKEY *ke
> - }
> -
> - int encrypt_private_key(TPM_KEY_DATA *key, TPM_STORE_ASYMKEY *store,
> --                        BYTE *enc, UINT32 *enc_size)
> -+                        BYTE *enc, UINT32 *enc_size32)
> - {
> -   UINT32 len;
> -   BYTE *buf, *ptr;
> -   rsa_public_key_t pub_key;
> -   int scheme;
> -+  size_t enc_size;
> -   switch (key->encScheme) {
> -     case TPM_ES_RSAESOAEP_SHA1_MGF1: scheme = RSA_ES_OAEP_SHA1; break;
> -     case TPM_ES_RSAESPKCSv15: scheme = RSA_ES_PKCSV15; break;
> -@@ -351,11 +360,12 @@ int encrypt_private_key(TPM_KEY_DATA *ke
> -   if (buf == NULL
> -       || tpm_marshal_TPM_STORE_ASYMKEY(&ptr, &len, store)
> -       || rsa_encrypt(&pub_key, scheme, buf, sizeof_TPM_STORE_ASYMKEY((*store)),
> --                     enc, enc_size)) {
> -+                     enc, &enc_size)) {
> -     tpm_free(buf);
> -     rsa_release_public_key(&pub_key);
> -     return -1;
> -   }
> -+  *enc_size32 = (UINT32) enc_size;
> -   tpm_free(buf);
> -   rsa_release_public_key(&pub_key);
> -   return 0;
> -@@ -364,7 +374,8 @@ int encrypt_private_key(TPM_KEY_DATA *ke
> - int decrypt_private_key(TPM_KEY_DATA *key, BYTE *enc, UINT32 enc_size,
> -                         TPM_STORE_ASYMKEY *store, BYTE **buf)
> - {
> --  UINT32 len;
> -+  UINT32 len32;
> -+  size_t len;
> -   BYTE *ptr;
> -   int scheme;
> -   switch (key->encScheme) {
> -@@ -375,8 +386,12 @@ int decrypt_private_key(TPM_KEY_DATA *ke
> -   len = enc_size;
> -   *buf = ptr = tpm_malloc(len);
> -   if (*buf == NULL
> --      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len)
> --      || tpm_unmarshal_TPM_STORE_ASYMKEY(&ptr, &len, store)) {
> -+      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len) ) {
> -+    tpm_free(*buf);
> -+    return -1;
> -+  }
> -+  len32 = (UINT32) len;
> -+  if (tpm_unmarshal_TPM_STORE_ASYMKEY(&ptr, &len32, store)) {
> -     tpm_free(*buf);
> -     return -1;
> -   }
> -@@ -394,7 +409,7 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
> -   TPM_SESSION_DATA *session;
> -   TPM_STORE_ASYMKEY store;
> -   rsa_private_key_t rsa;
> --  UINT32 key_length;
> -+  size_t key_length;
> -
> -   info("TPM_CreateWrapKey()");
> -   /* get parent key */
> -@@ -450,11 +465,11 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
> -     }
> -   }
> -   /* generate key and store it */
> --  key_length = keyInfo->algorithmParms.parms.rsa.keyLength;
> --  if (rsa_generate_key(&rsa, key_length)) return TPM_FAIL;
> --  wrappedKey->pubKey.keyLength = key_length >> 3;
> -+  if (rsa_generate_key(&rsa, keyInfo->algorithmParms.parms.rsa.keyLength))
> -+    return TPM_FAIL;
> -+  wrappedKey->pubKey.keyLength = keyInfo->algorithmParms.parms.rsa.keyLength >> 3;
> -   wrappedKey->pubKey.key = tpm_malloc(wrappedKey->pubKey.keyLength);
> --  store.privKey.keyLength = key_length >> 4;
> -+  store.privKey.keyLength = keyInfo->algorithmParms.parms.rsa.keyLength >> 4;
> -   store.privKey.key = tpm_malloc(store.privKey.keyLength);
> -   wrappedKey->encDataSize = parent->key.size >> 3;
> -   wrappedKey->encData = tpm_malloc(wrappedKey->encDataSize);
> -@@ -466,9 +481,11 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
> -     tpm_free(wrappedKey->encData);
> -     return TPM_NOSPACE;
> -   }
> --  rsa_export_modulus(&rsa, wrappedKey->pubKey.key,
> --    &wrappedKey->pubKey.keyLength);
> --  rsa_export_prime1(&rsa, store.privKey.key, &store.privKey.keyLength);
> -+  rsa_export_modulus(&rsa, wrappedKey->pubKey.key,
> -+                   &key_length);
> -+  wrappedKey->pubKey.keyLength = (UINT32) key_length;
> -+  rsa_export_prime1(&rsa, store.privKey.key, &key_length);
> -+  store.privKey.keyLength = (UINT32) key_length;
> -   rsa_release_private_key(&rsa);
> -   /* compute the digest of the wrapped key (without encData) */
> -   if (compute_key_digest(wrappedKey, &store.pubDataDigest)) {
> -@@ -602,6 +619,7 @@ TPM_RESULT TPM_LoadKey2(TPM_KEY_HANDLE p
> -
> - int tpm_setup_key_parms(TPM_KEY_DATA *key, TPM_KEY_PARMS *parms)
> - {
> -+  size_t key_length;
> -   parms->algorithmID = TPM_ALG_RSA;
> -   parms->encScheme = key->encScheme;
> -   parms->sigScheme = key->sigScheme;
> -@@ -611,7 +629,8 @@ int tpm_setup_key_parms(TPM_KEY_DATA *ke
> -   parms->parms.rsa.exponent = tpm_malloc(parms->parms.rsa.exponentSize);
> -   if (parms->parms.rsa.exponent == NULL) return -1;
> -   rsa_export_exponent(&key->key, parms->parms.rsa.exponent,
> --    &parms->parms.rsa.exponentSize);
> -+    &key_length);
> -+  parms->parms.rsa.exponentSize = (UINT32) key_length;
> -   parms->parmSize = 12 + parms->parms.rsa.exponentSize;
> -   return 0;
> - }
> -@@ -622,6 +641,7 @@ TPM_RESULT TPM_GetPubKey(TPM_KEY_HANDLE
> -   TPM_RESULT res;
> -   TPM_KEY_DATA *key;
> -   TPM_DIGEST digest;
> -+  size_t key_length;
> -   info("TPM_GetPubKey()");
> -   /* get key */
> -   if (keyHandle == TPM_KH_SRK
> -@@ -650,8 +670,8 @@ TPM_RESULT TPM_GetPubKey(TPM_KEY_HANDLE
> -   pubKey->pubKey.keyLength = key->key.size >> 3;
> -   pubKey->pubKey.key = tpm_malloc(pubKey->pubKey.keyLength);
> -   if (pubKey->pubKey.key == NULL) return TPM_NOSPACE;
> --  rsa_export_modulus(&key->key, pubKey->pubKey.key,
> --    &pubKey->pubKey.keyLength);
> -+  rsa_export_modulus(&key->key, pubKey->pubKey.key, &key_length);
> -+  pubKey->pubKey.keyLength = (UINT32) key_length;
> -   if (tpm_setup_key_parms(key, &pubKey->algorithmParms) != 0) {
> -     error("TPM_GetPubKey(): tpm_setup_key_parms() failed.");
> -     tpm_free(pubKey->pubKey.key);
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_structures.h tpm_emulator/tpm/tpm_structures.h
> ---- orig/tpm_emulator-0.4/tpm/tpm_structures.h 2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_structures.h  2006-07-24 14:35:35.000000000 -0700
> -@@ -1958,6 +1958,7 @@ typedef struct tdTPM_DAA_ISSUER {
> -   TPM_DIGEST DAA_digest_gamma;
> -   BYTE DAA_generic_q[26];
> - } TPM_DAA_ISSUER;
> -+#define sizeof_TPM_DAA_ISSUER(s) (2 + (20 * 6) + 26 )
> -
> - /*
> -  * TPM_DAA_TPM ([TPM_Part2], Section 22.4)
> -@@ -1973,6 +1974,7 @@ typedef struct tdTPM_DAA_TPM {
> -   TPM_DIGEST DAA_rekey;
> -   UINT32 DAA_count;
> - } TPM_DAA_TPM;
> -+#define sizeof_TPM_DAA_TPM(s) (2 + (4 * 20) + 4)
> -
> - /*
> -  * TPM_DAA_CONTEXT ([TPM_Part2], Section 22.5)
> -@@ -1987,6 +1989,7 @@ typedef struct tdTPM_DAA_CONTEXT {
> -   BYTE DAA_scratch[256];
> -   BYTE DAA_stage;
> - } TPM_DAA_CONTEXT;
> -+#define sizeof_TPM_DAA_CONTEXT(s) (2 + (3 * 20) + 256 + 1)
> -
> - /*
> -  * TPM_DAA_JOINDATA ([TPM_Part2], Section 22.6)
> -@@ -1998,6 +2001,7 @@ typedef struct tdTPM_DAA_JOINDATA {
> -   BYTE DAA_join_u1[138];
> -   TPM_DIGEST DAA_digest_n0;
> - } TPM_DAA_JOINDATA;
> -+#define sizeof_TPM_DAA_JOINDATA(s) (1 + 1 + 20)
> -
> - /*
> -  * TPM_DAA_BLOB ([TPM_Part2], Section 22.8)
> -@@ -2202,6 +2206,7 @@ typedef struct tdTPM_STCLEAR_DATA {
> -   //UINT32 ownerReference;
> -   //BOOL disableResetLock;
> - } TPM_STCLEAR_DATA;
> -+#define sizeof_TPM_STCLEAR_DATA(s) (2 + 20 + 4)
> -
> - /*
> -  * TPM_SESSION_DATA
> -@@ -2238,6 +2243,11 @@ typedef struct tdTPM_DAA_SESSION_DATA {
> -   TPM_DAA_JOINDATA DAA_joinSession;
> -   TPM_HANDLE handle;
> - } TPM_DAA_SESSION_DATA;
> -+#define sizeof_TPM_DAA_SESSION_DATA(s) ( 1 \
> -+  + sizeof_TPM_DAA_ISSUER(s.DAA_issuerSettings) \
> -+  + sizeof_TPM_DAA_TPM(s.DAA_tpmSpecific) \
> -+  + sizeof_TPM_DAA_CONTEXT(s.DAA_session) \
> -+  + sizeof_TPM_DAA_JOINDATA(s.DAA_joinSession) + 4)
> -
> - /*
> -  * TPM_STANY_DATA ([TPM_Part2], Section 7.6)
> -@@ -2262,6 +2272,11 @@ typedef struct tdTPM_STANY_DATA {
> -   TPM_DAAHANDLE currentDAA;
> -   TPM_TRANSHANDLE transExclusive;
> - } TPM_STANY_DATA;
> -+#define sizeof_TPM_STANY_DATA(s) (2 + 20 + 20 + 1 \
> -+  + sizeof_TPM_CURRENT_TICKS(s.currentTicks) \
> -+  + 4 + (4 * TPM_MAX_SESSION_LIST) \
> -+  + (sizeof_TPM_SESSION_DATA(s.sessions[0]) * TPM_MAX_SESSION_LIST) \
> -+  + (sizeof_TPM_DAA_SESSION_DATA(s.sessionsDAA[0]) * TPM_MAX_SESSIONS_DAA) + 4)
> -
> - /*
> -  * TPM_DATA
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_testing.c tpm_emulator/tpm/tpm_testing.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_testing.c    2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_testing.c     2006-07-24 14:35:35.000000000 -0700
> -@@ -1,6 +1,7 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -95,24 +96,24 @@ static int tpm_test_sha1(void)
> -   struct {
> -     uint8_t *data; uint32_t repetitions; uint8_t *digest;
> -   } test_cases[] =  {{
> --    "abc", 1,
> --    "\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D"
> -+      (uint8_t*)"abc", 1,
> -+    (uint8_t*)"\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D"
> -   }, {
> --    "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 1,
> --    "\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29\xE5\xE5\x46\x70\xF1"
> -+    (uint8_t*)"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 1,
> -+    (uint8_t*)"\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29\xE5\xE5\x46\x70\xF1"
> -   }, {
> --    "a", 1000000,
> --    "\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F"
> -+    (uint8_t*)"a", 1000000,
> -+    (uint8_t*)"\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F"
> -   }, {
> --    "0123456701234567012345670123456701234567012345670123456701234567", 10,
> --    "\xDE\xA3\x56\xA2\xCD\xDD\x90\xC7\xA7\xEC\xED\xC5\xEB\xB5\x63\x93\x4F\x46\x04\x52"
> -+    (uint8_t*)"0123456701234567012345670123456701234567012345670123456701234567", 10,
> -+    (uint8_t*)"\xDE\xA3\x56\xA2\xCD\xDD\x90\xC7\xA7\xEC\xED\xC5\xEB\xB5\x63\x93\x4F\x46\x04\x52"
> -   }};
> -
> -   debug("tpm_test_sha1()");
> -   for (i = 0; i < sizeof(test_cases) / sizeof(test_cases[0]); i++) {
> -     sha1_init(&ctx);
> -     for (j = 0; j < test_cases[i].repetitions; j++)
> --      sha1_update(&ctx, test_cases[i].data, strlen(test_cases[i].data));
> -+      sha1_update(&ctx, test_cases[i].data, strlen((char*)test_cases[i].data));
> -     sha1_final(&ctx, digest);
> -     if (memcmp(digest, test_cases[i].digest, SHA1_DIGEST_LENGTH) != 0) return -1;
> -   }
> -@@ -128,41 +129,41 @@ static int tpm_test_hmac(void)
> -   struct {
> -     uint8_t *key, key_len, *data, data_len, *digest;
> -   } test_cases[] = {{
> --    "\x0b", 20, "Hi There", 8,
> --    "\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"
> -+    (uint8_t*)"\x0b", 20, (uint8_t*)"Hi There", 8,
> -+    (uint8_t*)"\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"
> -   }, {
> --    "Jefe", 4, "what do ya want for nothing?", 28,
> --    "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79"
> -+    (uint8_t*)"Jefe", 4, (uint8_t*)"what do ya want for nothing?", 28,
> -+    (uint8_t*)"\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79"
> -   }, {
> --    "\xaa", 20, "\xdd", 50,
> --    "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3"
> -+    (uint8_t*)"\xaa", 20, (uint8_t*)"\xdd", 50,
> -+    (uint8_t*)"\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3"
> -   }, {
> --    "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
> --    "\x15\x16\x17\x18\x19", 25, "\xcd", 50,
> --    "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda"
> -+    (uint8_t*)"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
> -+    "\x15\x16\x17\x18\x19", 25, (uint8_t*)"\xcd", 50,
> -+    (uint8_t*)"\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda"
> -   }, {
> --    "\x0c", 20, "Test With Truncation", 20,
> --    "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04"
> -+    (uint8_t*)"\x0c", 20, (uint8_t*)"Test With Truncation", 20,
> -+    (uint8_t*)"\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04"
> -   }, {
> --    "\xaa", 80, "Test Using Larger Than Block-Size Key - Hash Key First", 54,
> --    "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12"
> -+    (uint8_t*)"\xaa", 80, (uint8_t*)"Test Using Larger Than Block-Size Key - Hash Key First", 54,
> -+    (uint8_t*)"\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12"
> -   }, {
> --    "\xaa", 80,
> --    "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", 73,
> --    "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91"
> -+    (uint8_t*)"\xaa", 80,
> -+    (uint8_t*)"Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", 73,
> -+    (uint8_t*)"\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91"
> -   }};
> -
> -   debug("tpm_test_hmac()");
> -   for (i = 0; i < sizeof(test_cases) / sizeof(test_cases[0]); i++) {
> --    if (strlen(test_cases[i].key) < test_cases[i].key_len) {
> -+    if (strlen((char*)test_cases[i].key) < test_cases[i].key_len) {
> -       uint8_t key[test_cases[i].key_len];
> -       memset(key, test_cases[i].key[0], test_cases[i].key_len);
> -       hmac_init(&ctx, key, test_cases[i].key_len);
> -     } else {
> -       hmac_init(&ctx, test_cases[i].key, test_cases[i].key_len);
> -     }
> --    for (j = 0; j < test_cases[i].data_len; j += strlen(test_cases[i].data)) {
> --      hmac_update(&ctx, test_cases[i].data, strlen(test_cases[i].data));
> -+    for (j = 0; j < test_cases[i].data_len; j += strlen((char*)test_cases[i].data)) {
> -+      hmac_update(&ctx, test_cases[i].data, strlen((char*)test_cases[i].data));
> -     }
> -     hmac_final(&ctx, digest);
> -     if (memcmp(digest, test_cases[i].digest, SHA1_DIGEST_LENGTH) != 0) return -1;
> -@@ -173,9 +174,9 @@ static int tpm_test_hmac(void)
> - static int tpm_test_rsa_EK(void)
> - {
> -   int res = 0;
> --  char *data = "RSA PKCS #1 v1.5 Test-String";
> -+  uint8_t *data = (uint8_t*)"RSA PKCS #1 v1.5 Test-String";
> -   uint8_t buf[256];
> --  size_t buf_len, data_len = strlen(data);
> -+  size_t buf_len, data_len = strlen((char*)data);
> -   rsa_private_key_t priv_key;
> -   rsa_public_key_t pub_key;
> -
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_ticks.c tpm_emulator/tpm/tpm_ticks.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_ticks.c      2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_ticks.c       2006-07-24 14:35:35.000000000 -0700
> -@@ -1,6 +1,7 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -39,9 +40,7 @@ TPM_RESULT TPM_SetTickType(TPM_TICKTYPE
> - TPM_RESULT TPM_GetTicks(TPM_CURRENT_TICKS *currentTime)
> - {
> -   info("TPM_GetTicks()");
> --  memcpy(currentTime, &tpmData.stany.data.currentTicks,
> --    sizeof(TPM_CURRENT_TICKS));
> --  return TPM_SUCCESS;
> -+  return TPM_DISABLED_CMD;
> - }
> -
> - TPM_RESULT TPM_TickStampBlob(TPM_KEY_HANDLE keyHandle, TPM_NONCE *antiReplay,
> -@@ -49,64 +48,11 @@ TPM_RESULT TPM_TickStampBlob(TPM_KEY_HAN
> -                              TPM_CURRENT_TICKS *currentTicks,
> -                              UINT32 *sigSize, BYTE **sig)
> - {
> --  TPM_RESULT res;
> --  TPM_KEY_DATA *key;
> --  BYTE *info, *p;
> --  UINT32 info_length, length;
> -   info("TPM_TickStampBlob()");
> --  /* get key */
> --  key = tpm_get_key(keyHandle);
> --  if (key == NULL) return TPM_INVALID_KEYHANDLE;
> --  /* verify authorization */
> --  res = tpm_verify_auth(auth1, key->usageAuth, keyHandle);
> --  if (res != TPM_SUCCESS) return res;
> --  if (key->keyUsage != TPM_KEY_SIGNING && key->keyUsage != TPM_KEY_LEGACY
> --      && key->keyUsage != TPM_KEY_IDENTITY) return TPM_INVALID_KEYUSAGE;
> --  /* get current ticks */
> --  TPM_GetTicks(currentTicks);
> --  /* sign data using signature scheme PKCS1_SHA1 and TPM_SIGN_INFO container */
> --  *sigSize = key->key.size >> 3;
> --  *sig = tpm_malloc(*sigSize);
> --  if (*sig == NULL) return TPM_FAIL;
> --  /* setup TPM_SIGN_INFO structure */
> --  info_length = 30 + sizeof(TPM_DIGEST) + sizeof_TPM_CURRENT_TICKS(currentTicks);
> --  info = tpm_malloc(info_length);
> --  if (info == NULL) {
> --    tpm_free(*sig);
> --    return TPM_FAIL;
> --  }
> --  memcpy(&info[0], "\x05\x00TSTP", 6);
> --  memcpy(&info[6], antiReplay->nonce, 20);
> --  *(UINT32*)&info[26] = CPU_TO_BE32(20
> --                        + sizeof_TPM_CURRENT_TICKS(currentTicks));
> --  memcpy(&info[30], digestToStamp->digest, sizeof(TPM_DIGEST));
> --  p = &info[30 + sizeof(TPM_DIGEST)];
> --  length = sizeof_TPM_CURRENT_TICKS(currentTicks);
> --  if (tpm_marshal_TPM_CURRENT_TICKS(&p, &length, currentTicks)
> --      || rsa_sign(&key->key, RSA_SSA_PKCS1_SHA1, info, info_length, *sig)) {
> --    tpm_free(*sig);
> --    tpm_free(info);
> --    return TPM_FAIL;
> --  }
> --  return TPM_SUCCESS;
> -+  return TPM_DISABLED_CMD;
> - }
> -
> - void tpm_update_ticks(void)
> - {
> --  if (tpmData.stany.data.currentTicks.tag == 0) {
> --    tpmData.stany.data.currentTicks.tag = TPM_TAG_CURRENT_TICKS;
> --    tpmData.stany.data.currentTicks.currentTicks += tpm_get_ticks();
> --/* removed since v1.2 rev 94
> --    tpmData.stany.data.currentTicks.tickType = tpmData.permanent.data.tickType;
> --*/
> --    tpm_get_random_bytes(tpmData.stany.data.currentTicks.tickNonce.nonce,
> --      sizeof(TPM_NONCE));
> --    tpmData.stany.data.currentTicks.tickRate = 1;
> --/* removed since v1.2 rev 94
> --    tpmData.stany.data.currentTicks.tickSecurity = TICK_SEC_NO_CHECK;
> --*/
> --  } else {
> --    tpmData.stany.data.currentTicks.currentTicks += tpm_get_ticks();
> --  }
> - }
> -
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_transport.c tpm_emulator/tpm/tpm_transport.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_transport.c  2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_transport.c   2006-07-24 14:35:35.000000000 -0700
> -@@ -189,7 +189,7 @@ static void decrypt_wrapped_command(BYTE
> -     sha1_init(&sha1);
> -     sha1_update(&sha1, auth->nonceEven.nonce, sizeof(auth->nonceEven.nonce));
> -     sha1_update(&sha1, auth->nonceOdd.nonce, sizeof(auth->nonceOdd.nonce));
> --    sha1_update(&sha1, "in", 2);
> -+    sha1_update(&sha1, (BYTE*)"in", 2);
> -     sha1_update(&sha1, secret, sizeof(TPM_SECRET));
> -     j = CPU_TO_BE32(i);
> -     sha1_update(&sha1, (BYTE*)&j, 4);
> -@@ -211,7 +211,7 @@ static void encrypt_wrapped_command(BYTE
> -     sha1_init(&sha1);
> -     sha1_update(&sha1, auth->nonceEven.nonce, sizeof(auth->nonceEven.nonce));
> -     sha1_update(&sha1, auth->nonceOdd.nonce, sizeof(auth->nonceOdd.nonce));
> --    sha1_update(&sha1, "out", 3);
> -+    sha1_update(&sha1, (BYTE*)"out", 3);
> -     sha1_update(&sha1, secret, sizeof(TPM_SECRET));
> -     j = CPU_TO_BE32(i);
> -     sha1_update(&sha1, (BYTE*)&j, 4);
> -diff -uprN orig/tpm_emulator-0.4/tpmd.c tpm_emulator/tpmd.c
> ---- orig/tpm_emulator-0.4/tpmd.c       1969-12-31 16:00:00.000000000 -0800
> -+++ tpm_emulator/tpmd.c        2006-07-24 14:35:35.000000000 -0700
> -@@ -0,0 +1,156 @@
> -+/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -+ * Copyright (C) 2005 INTEL Corp
> -+ *
> -+ * This module is free software; you can redistribute it and/or modify
> -+ * it under the terms of the GNU General Public License as published
> -+ * by the Free Software Foundation; either version 2 of the License,
> -+ * or (at your option) any later version.
> -+ *
> -+ * This module 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.
> -+ *
> -+ */
> -+
> -+#include <stdio.h>
> -+#include <stdlib.h>
> -+#include <unistd.h>
> -+#include <string.h>
> -+#include <sys/types.h>
> -+#include <sys/stat.h>
> -+#include <fcntl.h>
> -+#include <sys/time.h>
> -+
> -+#include "tpm_emulator.h"
> -+
> -+#define TPM_RX_FNAME "/var/tpm/tpm_in.fifo"
> -+#define TPM_TX_FNAME "/var/tpm/tpm_out.fifo"
> -+
> -+#define BUFFER_SIZE 2048
> -+
> -+static int devurandom=0;
> -+
> -+void get_random_bytes(void *buf, int nbytes) {
> -+
> -+  if (devurandom == 0) {
> -+    devurandom = open("/dev/urandom", O_RDONLY);
> -+  }
> -+
> -+  if (read(devurandom, buf, nbytes) != nbytes) {
> -+      printf("Can't get random number.\n");
> -+      exit(-1);
> -+  }
> -+}
> -+
> -+uint64_t tpm_get_ticks(void)
> -+{
> -+  //struct timeval tv;
> -+  //int gettimeofday(&tv, struct timezone *tz);
> -+  return 0;
> -+}
> -+
> -+int main(int argc, char **argv)
> -+{
> -+  uint8_t in[BUFFER_SIZE], *out;
> -+  uint32_t out_size;
> -+  int in_size, written;
> -+  int i;
> -+  struct stat file_info;
> -+
> -+  int tpm_tx_fh=-1, tpm_rx_fh=-1;
> -+  if (argc < 2) {
> -+    printf("Usage: tpmd clear|save|deactivated\n" );
> -+        return -1;
> -+  }
> -+
> -+  /* initialize TPM emulator */
> -+  if (!strcmp(argv[1], "clear")) {
> -+    printf("Initializing tpm: %s\n", argv[1]);
> -+    tpm_emulator_init(1);
> -+  } else if (!strcmp(argv[1], "save")) {
> -+    printf("Initializing tpm: %s\n", argv[1]);
> -+    tpm_emulator_init(2);
> -+  } else if (!strcmp(argv[1], "deactivated")) {
> -+    printf("Initializing tpm: %s\n", argv[1]);
> -+    tpm_emulator_init(3);
> -+  } else {
> -+    printf("invalid startup mode '%s'; must be 'clear', "
> -+      "'save' (default) or 'deactivated", argv[1]);
> -+    return -1;
> -+  }
> -+
> -+  if ( stat(TPM_RX_FNAME, &file_info) == -1) {
> -+    if ( mkfifo(TPM_RX_FNAME, S_IWUSR | S_IRUSR ) ) {
> -+      printf("Failed to create fifo %s.\n", TPM_RX_FNAME);
> -+      return -1;
> -+    }
> -+  }
> -+
> -+  if ( stat(TPM_TX_FNAME, &file_info) == -1) {
> -+    if ( mkfifo(TPM_TX_FNAME, S_IWUSR | S_IRUSR ) ) {
> -+      printf("Failed to create fifo %s.\n", TPM_TX_FNAME);
> -+      return -1;
> -+    }
> -+  }
> -+
> -+  while (1) {
> -+abort_command:
> -+    if (tpm_rx_fh < 0) {
> -+      tpm_rx_fh = open(TPM_RX_FNAME, O_RDONLY);
> -+    }
> -+
> -+    if (tpm_rx_fh < 0) {
> -+      printf("ERROR: failed to open devices to listen to guest.\n");
> -+      return -1;
> -+    }
> -+
> -+    if (tpm_tx_fh < 0) {
> -+      tpm_tx_fh = open(TPM_TX_FNAME, O_WRONLY);
> -+    }
> -+
> -+    if (tpm_tx_fh < 0) {
> -+      printf("ERROR: failed to open devices to respond to guest.\n");
> -+      return -1;
> -+    }
> -+
> -+    in_size = read(tpm_rx_fh, in, BUFFER_SIZE);
> -+    if (in_size < 6) { // Magic size of minium TPM command
> -+      printf("Recv[%d] to small: 0x", in_size);
> -+      if (in_size <= 0) {
> -+          close(tpm_rx_fh);
> -+          tpm_rx_fh = -1;
> -+          goto abort_command;
> -+      }
> -+    } else {
> -+      printf("Recv[%d]: 0x", in_size);
> -+      for (i=0; i< in_size; i++)
> -+        printf("%x ", in[i]);
> -+      printf("\n");
> -+    }
> -+
> -+
> -+    if (tpm_handle_command(in, in_size, &out, &out_size) != 0) {
> -+        printf("ERROR: Handler Failed.\n");
> -+    }
> -+
> -+    written = write(tpm_tx_fh, out, out_size);
> -+
> -+    if (written != out_size ) {
> -+      printf("ERROR: Part of response not written %d/%d.\nAttempt: ", written, out_size);
> -+    } else {
> -+      printf("Sent[%Zu]: ", out_size);
> -+    }
> -+    for (i=0; i< out_size; i++)
> -+      printf("%x ", out[i]);
> -+    printf("\n");
> -+    tpm_free(out);
> -+
> -+  } // loop
> -+
> -+  tpm_emulator_shutdown();
> -+
> -+  close(tpm_tx_fh);
> -+  close(tpm_rx_fh);
> -+
> -+}
> -Binary files orig/tpm_emulator-0.4/tpm_emulator and tpm_emulator/tpm_emulator differ
> -diff -uprN orig/tpm_emulator-0.4/tpm_version.h tpm_emulator/tpm_version.h
> ---- orig/tpm_emulator-0.4/tpm_version.h        2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm_version.h 2006-07-24 14:35:41.000000000 -0700
> -@@ -2,5 +2,5 @@
> - #define _TPM_VERSION_H_
> - #define VERSION_MAJOR 0
> - #define VERSION_MINOR 4
> --#define VERSION_BUILD 1151058734
> -+#define VERSION_BUILD 1153776940
> - #endif /* _TPM_VERSION_H_ */
> diff --git a/tools/vtpm/vtpm-0.5.1-LDLIBS.patch b/tools/vtpm/vtpm-0.5.1-LDLIBS.patch
> deleted file mode 100644
> index 95586c1..0000000
> --- a/tools/vtpm/vtpm-0.5.1-LDLIBS.patch
> +++ /dev/null
> @@ -1,12 +0,0 @@
> -diff -Naurp tpm_emulator-0.5.1/tpmd/Makefile tpm_emulator-0.5.1/tpmd/Makefile
> ---- tpm_emulator-0.5.1/tpmd/Makefile
> -+++ tpm_emulator-0.5.1/tpmd/Makefile
> -@@ -8,7 +8,7 @@ WFLAGS  := -Wall -Wno-unused -Wpointer-a
> -            #WFLAGS  += -Wextra -Wcast-qual -Wmissing-prototypes -Wmissing-declarations -Wstrict-aliasing
> - CFLAGS  += $(WFLAGS) -g -I.. -I. -O2 -fno-strict-aliasing
> - CFLAGS  += -I../../../../tools/vtpm_manager/manager
> --LDFLAGS += -lgmp
> -+LDLIBS  += -lgmp
> -
> - BINDIR  := /usr/bin/
> -
> diff --git a/tools/vtpm/vtpm-0.5.1.patch b/tools/vtpm/vtpm-0.5.1.patch
> deleted file mode 100644
> index 2aeb745..0000000
> --- a/tools/vtpm/vtpm-0.5.1.patch
> +++ /dev/null
> @@ -1,766 +0,0 @@
> -diff -Naurp tpm_emulator-0.5.1/Makefile tpm5-test/Makefile
> ---- tpm_emulator-0.5.1/Makefile        2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/Makefile 2009-07-15 09:45:28.000000000 -0400
> -@@ -10,7 +10,7 @@ VERSION_MINOR  := 5
> - VERSION_BUILD  := $(shell date +"%s")
> - VERSION_SUFFIX := .1
> -
> --SUBDIRS := tpmd tpmd_dev tddl
> -+SUBDIRS := tpmd
> -
> - all: version all-recursive
> -
> -@@ -48,12 +48,12 @@ user_install: user
> - modules_install: modules
> -       @$(MAKE) -C tpmd_dev install || exit -1
> -
> --DIRS    := . tpm crypto tpmd tpmd_dev tddl tpmd_dev_openbsd
> -+DIRS    := . tpm crypto tpmd
> - DISTSRC := $(foreach dir, $(DIRS), $(wildcard $(dir)/*.c))
> - DISTSRC += $(foreach dir, $(DIRS), $(wildcard $(dir)/*.h))
> --DIRS    := . tpmd tpmd_dev tddl tpmd_dev_openbsd
> -+DIRS    := . tpmd
> - DISTSRC += $(foreach dir, $(DIRS), $(dir)/Makefile)
> --DISTSRC += ./README ./AUTHORS ./ChangeLog tpmd_dev/tpmd_dev.rules.in
> -+DISTSRC += ./README ./AUTHORS ./ChangeLog
> - DISTDIR := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_SUFFIX)
> -
> - dist: $(DISTSRC)
> -diff -Naurp tpm_emulator-0.5.1/tpm/tpm_capability.c tpm5-test/tpm/tpm_capability.c
> ---- tpm_emulator-0.5.1/tpm/tpm_capability.c    2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/tpm/tpm_capability.c     2009-07-16 12:04:20.000000000 -0400
> -@@ -136,8 +136,19 @@ static TPM_RESULT cap_property(UINT32 su
> -
> -     case TPM_CAP_PROP_TIS_TIMEOUT:
> -       debug("[TPM_CAP_PROP_TIS_TIMEOUT]");
> --      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT */
> --      return TPM_FAIL;
> -+      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT: Measure these values and determine correct ones */
> -+      UINT32 len = *respSize = 16;
> -+      BYTE *ptr = *resp = tpm_malloc(*respSize);
> -+      if (ptr == NULL ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000)) {
> -+        tpm_free(*resp);
> -+        return TPM_FAIL;
> -+      }
> -+      return TPM_SUCCESS;
> -+
> -
> -     case TPM_CAP_PROP_STARTUP_EFFECT:
> -       debug("[TPM_CAP_PROP_STARTUP_EFFECT]");
> -@@ -189,8 +200,12 @@ static TPM_RESULT cap_property(UINT32 su
> -
> -     case TPM_CAP_PROP_DURATION:
> -       debug("[TPM_CAP_PROP_DURATION]");
> --      /* TODO: TPM_CAP_PROP_DURATION */
> --      return TPM_FAIL;
> -+      /* TODO: TPM_CAP_PROP_DURATION: Measure these values and return accurate ones */
> -+      BYTE dur[]= {0x0,0x0,0x0,0xc,0x0,0x7,0xa1,0x20,0x0,0x1e,0x84,0x80,0x11,0xe1,0xa3,0x0};
> -+      *respSize = 16;
> -+      *resp = tpm_malloc(*respSize);
> -+      memcpy(*resp,dur,16);
> -+
> -
> -     case TPM_CAP_PROP_ACTIVE_COUNTER:
> -       debug("[TPM_CAP_PROP_ACTIVE_COUNTER]");
> -diff -Naurp tpm_emulator-0.5.1/tpmd/Makefile tpm5-test/tpmd/Makefile
> ---- tpm_emulator-0.5.1/tpmd/Makefile   2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/tpmd/Makefile    2009-07-16 12:08:26.000000000 -0400
> -@@ -8,9 +8,10 @@ WFLAGS  := -Wall -Wno-unused -Wpointer-a
> -            -Wwrite-strings -Wsign-compare -Wno-multichar
> -            #WFLAGS  += -Wextra -Wcast-qual -Wmissing-prototypes -Wmissing-declarations -Wstrict-aliasing
> - CFLAGS  += $(WFLAGS) -g -I.. -I. -O2 -fno-strict-aliasing
> -+CFLAGS  += -I../../../../tools/vtpm_manager/manager
> - LDFLAGS += -lgmp
> -
> --BINDIR  := /usr/sbin/
> -+BINDIR  := /usr/bin/
> -
> - TPMD    := tpmd
> - DIRS    := ../tpm ../crypto
> -@@ -18,6 +19,8 @@ SRCS    := $(foreach dir, $(DIRS), $(wil
> - OBJS    := $(patsubst %.c, %.o, $(SRCS))
> - OBJS    := $(foreach dir, $(DIRS), $(patsubst $(dir)/%.o, %.o, $(filter $(dir)/%.o, $(OBJS))))
> -
> -+VTPM_BIN := vtpmd
> -+
> - vpath %.c $(strip $(DIRS))
> -
> - all: $(TPMD)
> -@@ -32,10 +35,8 @@ TPMD_GROUP ?= tss
> - INSTALL    ?= install
> -
> - install: $(TPMD)
> --      $(INSTALL) -m 755 -o $(TPMD_USER) -g $(TPMD_GROUP) -d $(DESTDIR)/var/lib/tpm
> --      $(INSTALL) -m 755 -o $(TPMD_USER) -g $(TPMD_GROUP) -d $(DESTDIR)/var/run/tpm
> -       $(INSTALL) -D -d $(DESTDIR)/$(BINDIR)
> --      $(INSTALL) -m 755 $(TPMD) $(DESTDIR)/$(BINDIR)
> -+      $(INSTALL) -m 755 $(TPMD) $(DESTDIR)/$(BINDIR)/$(VTPM_BIN)
> -
> - .PHONY: all clean install
> -
> -diff -Naurp tpm_emulator-0.5.1/tpmd/tpmd.c tpm5-test/tpmd/tpmd.c
> ---- tpm_emulator-0.5.1/tpmd/tpmd.c     2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/tpmd/tpmd.c      2009-07-16 11:19:05.000000000 -0400
> -@@ -32,6 +32,9 @@
> - #include <grp.h>
> - #include "tpm_emulator_config.h"
> - #include "tpm/tpm_emulator.h"
> -+#include "tpm/tpm_structures.h"
> -+#include "tpm/tpm_marshalling.h"
> -+#include "vtpm_manager.h"
> -
> - #define TPM_DAEMON_NAME     "tpmd"
> - #define TPM_CMD_BUF_SIZE    4096
> -@@ -39,6 +42,24 @@
> - #define TPM_RANDOM_DEVICE   "/dev/urandom"
> - #undef  TPM_MKDIRS
> -
> -+#ifdef VTPM_MULTI_VM
> -+ #define DEV_BE "/dev/vtpm"
> -+ #define DEV_FE "/dev/tpm"
> -+#else
> -+ #define PVM_RX_FIFO_D "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
> -+ #define PVM_TX_FIFO "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
> -+ #define HVM_RX_FIFO_D "/var/vtpm/socks/%d.socket"
> -+
> -+ #define VTPM_RX_FIFO_D "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
> -+ #define VTPM_TX_FIFO "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
> -+
> -+ static char *vtpm_rx_name=NULL;
> -+#endif
> -+
> -+ static int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> -+
> -+#define BUFFER_SIZE 2048
> -+
> - static volatile int stopflag = 0;
> - static int is_daemon = 0;
> - static int opt_debug = 0;
> -@@ -49,6 +70,8 @@ static const char *opt_storage_file = "/
> - static uid_t opt_uid = 0;
> - static gid_t opt_gid = 0;
> - static int tpm_startup = 2;
> -+static int vtpm_type = VTPM_TYPE_PVM;
> -+int dmi_id = 0;
> - static int rand_fh;
> -
> - void tpm_log(int priority, const char *fmt, ...)
> -@@ -90,56 +113,241 @@ uint64_t tpm_get_ticks(void)
> -
> - int tpm_write_to_file(uint8_t *data, size_t data_length)
> - {
> --    int fh;
> --    ssize_t res;
> --    fh = open(opt_storage_file, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> --    if (fh < 0) return -1;
> --    while (data_length > 0) {
> --        res = write(fh, data, data_length);
> --      if (res < 0) {
> --          close(fh);
> --          return -1;
> --      }
> --      data_length -= res;
> --      data += res;
> -+  int res, out_data_size, in_header_size;
> -+  BYTE *ptr, *out_data, *in_header;
> -+  UINT32 result, len, in_rsp_size;
> -+  UINT16 tag = VTPM_TAG_REQ;
> -+
> -+  printf("Saving NVM\n");
> -+  if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> -+#else
> -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_tx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Send request to VTPM Manager to encrypt data
> -+#ifdef VTPM_MUTLI_VM
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT + data_length;
> -+#else
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV + data_length;
> -+#endif
> -+
> -+  out_data = ptr = (BYTE *) malloc(len);
> -+
> -+  if (ptr == NULL
> -+#ifndef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> -+#endif
> -+        || tpm_marshal_UINT16(&ptr, &len, tag)
> -+#ifdef VTPM_MUTLI_VM
> -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> -+#else
> -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> -+#endif
> -+        || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_SAVENVM)
> -+        || tpm_marshal_BYTE_ARRAY(&ptr, &len, data, data_length)) {
> -+      free(out_data);
> -+      return -1;
> -+  }
> -+
> -+  printf("\tSending SaveNVM Command.\n");
> -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> -+  free(out_data);
> -+  if (res != out_data_size) return -1;
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_rx_fh = vtpm_tx_fh
> -+#else
> -+    if (vtpm_rx_name == NULL) {
> -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> -     }
> --    close(fh);
> --    return 0;
> -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Read Header of response so we can get the size & status
> -+#ifdef VTPM_MUTLI_VM
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  in_header = ptr = malloc(in_header_size);
> -+
> -+  printf("\tReading SaveNVM header.\n");
> -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> -+
> -+  if ( (res != in_header_size)
> -+#ifndef VTPM_MUTLI_VM
> -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> -+#endif
> -+         || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> -+         || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> -+         || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> -+        free(in_header);
> -+        return -1;
> -+  }
> -+  free(in_header);
> -+
> -+  if (result != VTPM_SUCCESS) {
> -+      return -1;
> -+  }
> -+
> -+#ifdef VTPM_MUTLI_VM
> -+  close(vtpm_tx_fh); close(vtpm_rx_fh);
> -+#endif
> -+
> -+  printf("\tFinishing up SaveNVM\n");
> -+  return (0);
> - }
> -
> - int tpm_read_from_file(uint8_t **data, size_t *data_length)
> - {
> --    int fh;
> --    ssize_t res;
> --    size_t total_length;
> --    fh = open(opt_storage_file, O_RDONLY);
> --    if (fh < 0) return -1;
> --    total_length = lseek(fh, 0, SEEK_END);
> --    lseek(fh, 0, SEEK_SET);
> --    *data = tpm_malloc(total_length);
> --    if (*data == NULL) {
> --        close(fh);
> --        return -1;
> --    }
> --    *data_length = 0;
> --    while (total_length > 0) {
> --        res = read(fh, &(*data)[*data_length], total_length);
> --      if (res < 0) {
> --          close(fh);
> --          tpm_free(*data);
> --          return -1;
> --      }
> --        *data_length += res;
> --      total_length -= res;
> -+  int res, out_data_size, in_header_size;
> -+  uint8_t *ptr, *out_data, *in_header;
> -+  UINT16 tag = VTPM_TAG_REQ;
> -+  UINT32 len, in_rsp_size, result;
> -+#ifdef VTPM_MUTLI_VM
> -+      int vtpm_rx_fh, vtpm_tx_fh;
> -+#endif
> -+
> -+  printf("Loading NVM.\n");
> -+  if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> -+#else
> -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_tx_fh < 0) {
> -+      printf("Error in read_from_file:301\n");
> -+              return -1;
> -+  }
> -+
> -+  // Send request to VTPM Manager to encrypt data
> -+#ifdef VTPM_MUTLI_VM
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  out_data = ptr = (BYTE *) malloc(len);
> -+
> -+  if (ptr == NULL
> -+#ifndef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> -+#endif
> -+      || tpm_marshal_UINT16(&ptr, &len, tag)
> -+#ifdef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> -+#else
> -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> -+#endif
> -+      || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_LOADNVM)) {
> -+    free(out_data);
> -+    printf("Error in read_from_file:325\n");
> -+
> -+    return -1;
> -+  }
> -+
> -+  printf("\tSending LoadNVM command\n");
> -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> -+  free(out_data);
> -+  if (res != out_data_size)
> -+    {
> -+      printf("Error in read_from_file:335\n");
> -+      return -1;
> -+    }
> -+
> -+    if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_rx_fh = vtpm_tx_fh;
> -+#else
> -+    if (vtpm_rx_name == NULL) {
> -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> -     }
> --    close(fh);
> --    return 0;
> -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+      printf("Error in read_from_file:352\n");
> -+      return -1;
> -+  }
> -+
> -+  // Read Header of response so we can get the size & status
> -+#ifdef VTPM_MUTLI_VM
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  in_header = ptr = malloc(in_header_size);
> -+
> -+  printf("\tReading LoadNVM header\n");
> -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> -+
> -+  if ( (res != in_header_size)
> -+#ifndef VTPM_MUTLI_VM
> -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> -+#endif
> -+       || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> -+       || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> -+       || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> -+      free(in_header);
> -+      printf("Error in read_from_file:375\n");
> -+      return -1;
> -+  }
> -+  free(in_header);
> -+
> -+  if (result != VTPM_SUCCESS) {
> -+    printf("Error in read_from_file:381\n");
> -+    return -1;
> -+  }
> -+
> -+  // Read Encrypted data from VTPM Manager
> -+  *data_length = in_rsp_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> -+  *data = (uint8_t *) malloc(*data_length);
> -+
> -+  printf("\tReading clear data from LoadNVM.\n");
> -+  res = read(vtpm_rx_fh, *data, *data_length);
> -+#ifdef VTPM_MUTLI_VM
> -+  close(vtpm_rx_fh);close(vtpm_tx_fh);
> -+#endif
> -+
> -+  printf("\tReturing from loading NVM\n");
> -+  if (res != (int)*data_length) {
> -+      free(*data);
> -+      printf("Error in read_from_file:398\n");
> -+      return -1;
> -+  } else {
> -+      return 0;
> -+  }
> -+
> -+
> -+
> - }
> -
> - static void print_usage(char *name)
> - {
> -     printf("usage: %s [-d] [-f] [-s storage file] [-u unix socket name] "
> --           "[-o user name] [-g group name] [-h] [startup mode]\n", name);
> -+           "[-o user name] [-g group name] [-h]"
> -+#ifdef VTPM_MULTI_VM
> -+         "clear|save|deactivated\n", name);
> -+#else
> -+         "clear|save|deactivated pvm|hvm vtpmid\n", name);
> -+#endif
> -     printf("  d : enable debug mode\n");
> -     printf("  f : forces the application to run in the foreground\n");
> -     printf("  s : storage file to use (default: %s)\n", opt_storage_file);
> -@@ -205,7 +413,13 @@ static void parse_options(int argc, char
> -                 exit(EXIT_SUCCESS);
> -         }
> -     }
> --    if (optind < argc) {
> -+    /*Make sure we have all required options*/
> -+#ifdef VTPM_MULTI_VM
> -+#define EXTRA_OPTS 0
> -+#else
> -+#define EXTRA_OPTS 2
> -+#endif
> -+    if (optind < argc - EXTRA_OPTS ) {
> -         debug("startup mode = '%s'", argv[optind]);
> -         if (!strcmp(argv[optind], "clear")) {
> -             tpm_startup = 1;
> -@@ -219,6 +433,25 @@ static void parse_options(int argc, char
> -             print_usage(argv[0]);
> -             exit(EXIT_SUCCESS);
> -         }
> -+#ifndef VTPM_MULTI_VM
> -+        ++optind;
> -+      if(!strcmp(argv[optind], "pvm")) {
> -+              vtpm_type = VTPM_TYPE_PVM;      // Get commands from vTPM Manager through fifo
> -+      } else if (!strcmp(argv[optind], "hvm")) {
> -+              vtpm_type = VTPM_TYPE_HVM;      // Get commands from qemu via socket
> -+        } else {
> -+              error("Invalid vm mode '%s'; must be 'pvm', "
> -+                      "or 'hvm' ", argv[optind]);
> -+              print_usage(argv[0]);
> -+              exit(EXIT_SUCCESS);
> -+      }
> -+        ++optind;
> -+      dmi_id = atoi(argv[optind]);
> -+#endif
> -+    } else {
> -+      error("Invalid number of arguments");
> -+      print_usage(argv[0]);
> -+      exit(EXIT_SUCCESS);
> -     }
> - }
> -
> -@@ -348,93 +581,180 @@ static int init_socket(const char *name)
> -
> - static void main_loop(void)
> - {
> --    int sock, fh, res;
> --    int32_t in_len;
> -+    int32_t in_len, written;
> -     uint32_t out_len;
> --    uint8_t in[TPM_CMD_BUF_SIZE], *out;
> -+    uint8_t in[TPM_CMD_BUF_SIZE], *out, *addressed_out;
> -+    int guest_id=-1;
> -+    int i;
> -+    char *vtpm_rx_file=NULL;
> -+    int res;
> -+
> -+#ifndef VTPM_MULTI_VM
> -+    int sockfd = -1;
> -     struct sockaddr_un addr;
> --    socklen_t addr_len;
> --    fd_set rfds;
> --    struct timeval tv;
> -+    struct sockaddr_un client_addr;
> -+    unsigned int client_length;
> -+#endif
> -+
> -+    int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> -+
> -+#ifndef VTPM_MULTI_VM
> -+  if (vtpm_type == VTPM_TYPE_PVM) {
> -+    vtpm_rx_file = malloc(10 + strlen(PVM_RX_FIFO_D));
> -+    sprintf(vtpm_rx_file, PVM_RX_FIFO_D, (uint32_t) dmi_id);
> -+  } else {
> -+    vtpm_rx_file = malloc(10 + strlen(HVM_RX_FIFO_D));
> -+    sprintf(vtpm_rx_file, HVM_RX_FIFO_D, (uint32_t) dmi_id);
> -+
> -+    if ( (sockfd = socket(PF_UNIX,SOCK_STREAM,0)) < 0) {
> -+          error("Unable to create socket. errno = %d\n", errno);
> -+      exit (-1);
> -+    }
> -+
> -+    memset(&addr, 0, sizeof(addr));
> -+    addr.sun_family = AF_UNIX;
> -+    strcpy(addr.sun_path,vtpm_rx_file );
> -+    unlink(addr.sun_path);
> -+  }
> -+#endif
> -
> -     info("staring main loop");
> --    /* open UNIX socket */
> --    sock = init_socket(opt_socket_name);
> --    if (sock < 0) exit(EXIT_FAILURE);
> -     /* init tpm emulator */
> --    debug("initializing TPM emulator: %d", tpm_startup);
> -+#ifdef VTPM_MULTI_VM
> -+    debug("initializing TPM emulator: state=%d", tpm_startup);
> -+#else
> -+    debug("initializing TPM emulator: state=%d, type=%d, id=%d", tpm_startup, vtpm_type, dmi_id);
> -+#endif
> -     tpm_emulator_init(tpm_startup);
> -     /* start command processing */
> -     while (!stopflag) {
> -         /* wait for incomming connections */
> -         debug("waiting for connections...");
> --        FD_ZERO(&rfds);
> --        FD_SET(sock, &rfds);
> --        tv.tv_sec = 10;
> --        tv.tv_usec = 0;
> --        res = select(sock + 1, &rfds, NULL, NULL, &tv);
> --        if (res < 0) {
> --            error("select(sock) failed: %s", strerror(errno));
> --            break;
> --        } else if (res == 0) {
> --            continue;
> --        }
> --        addr_len = sizeof(addr);
> --        fh = accept(sock, (struct sockaddr*)&addr, &addr_len);
> --        if (fh < 0) {
> --            error("accept() failed: %s", strerror(errno));
> --            continue;
> --        }
> -+      if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+          vtpm_rx_fh = open(DEV_BE, O_RDWR);
> -+#else
> -+          if (vtpm_type == VTPM_TYPE_PVM)
> -+          {
> -+              vtpm_rx_fh = open(vtpm_rx_file, O_RDONLY);
> -+          } else {
> -+              if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
> -+                  error("Unable to bind(). errno = %d\n", errno);
> -+                  exit (-1);
> -+              }
> -+
> -+              if (listen(sockfd, 10) <0) {
> -+                  error("Unable to listen(). errno = %d\n", errno);
> -+                  exit (-1);
> -+              }
> -+
> -+               memset(&client_addr, 0, sizeof(client_addr));
> -+               client_length = sizeof(client_addr);
> -+
> -+               vtpm_rx_fh = vtpm_tx_fh = accept(sockfd, (struct sockaddr *)&client_addr, &client_length);
> -+          }
> -+#endif
> -+      }
> -+
> -+      /*Error Checking*/
> -+      if (vtpm_rx_fh < 0) {
> -+        error("Failed to open devices to listen to guest.\n");
> -+        exit(-1);
> -+      }
> -+
> -         /* receive and handle commands */
> -         in_len = 0;
> -         do {
> -             debug("waiting for commands...");
> --            FD_ZERO(&rfds);
> --            FD_SET(fh, &rfds);
> --            tv.tv_sec = TPM_COMMAND_TIMEOUT;
> --            tv.tv_usec = 0;
> --            res = select(fh + 1, &rfds, NULL, NULL, &tv);
> --            if (res < 0) {
> --                error("select(fh) failed: %s", strerror(errno));
> --                close(fh);
> --                break;
> --            } else if (res == 0) {
> --#ifdef TPMD_DISCONNECT_IDLE_CLIENTS
> --                info("connection closed due to inactivity");
> --                close(fh);
> --                break;
> --#else
> --                continue;
> --#endif
> --            }
> --            in_len = read(fh, in, sizeof(in));
> --            if (in_len > 0) {
> -+
> -+            in_len = read(vtpm_rx_fh, in, sizeof(in));
> -+          /*Magic size of minimum TPM command is 6*/
> -+              //FIXME Magic size check may not be required anymore
> -+            if (in_len < 6) {
> -+              info("Recv incomplete command of %d bytes.", in_len);
> -+              if (in_len <= 0) {
> -+                  close(vtpm_rx_fh);
> -+                  vtpm_rx_fh = -1;
> -+                  continue;
> -+                 }
> -+          } else {
> -+              /*Debug Printouts*/
> -                 debug("received %d bytes", in_len);
> -+              debug_nostop("Recv[%d]: 0x", in_len);
> -+              for (i=0; i< in_len; i++)
> -+                  debug_more("%x ", in[i]);
> -+              debug_more("\n");
> -+              /*Multiple Guest check*/
> -+              if (guest_id == -1) {
> -+                  guest_id = *((int32_t *) in);
> -+              } else {
> -+                  if (guest_id != *((int32_t *) in) ) {
> -+                      error("WARNING: More than one guest attached\n");
> -+                  }
> -+              }
> -+
> -+              /*Open tx handle now*/
> -+              if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+                  vtpm_tx_fh = open(DEV_BE, O_RDWR);
> -+                  vtpm_rx_fh = vtpm_tx_fh;
> -+#else
> -+                  if (vtpm_type == VTPM_TYPE_PVM) {
> -+                      vtpm_tx_fh = open(PVM_TX_FIFO, O_WRONLY);
> -+                  } // No need to open the other direction for HVM
> -+#endif
> -+              }
> -+              if (vtpm_tx_fh < 0) {
> -+                error("Failed to open devices to respond to guest.\n");
> -+                exit(-1);
> -+              }
> -+
> -+              /*Handle the TPM command now*/
> -                 out = NULL;
> --                res = tpm_handle_command(in, in_len, &out, &out_len);
> -+                res = tpm_handle_command(in + sizeof(uint32_t), in_len - sizeof(uint32_t), &out, &out_len);
> -                 if (res < 0) {
> -                     error("tpm_handle_command() failed");
> -                 } else {
> -                     debug("sending %d bytes", out_len);
> -+                  //FIXME this prepending may or may not be needed
> -+                  /*Prepend the first 4 bytes of the in buffer.. why?*/
> -+                  addressed_out = (uint8_t *) tpm_malloc(sizeof(uint32_t) + out_len);
> -+                  *(uint32_t *) addressed_out = *(uint32_t *) in;
> -+                  memcpy(addressed_out + sizeof(uint32_t), out, out_len);
> -+                  out_len += sizeof(uint32_t);
> -+                  /*End Prepend*/
> -+
> -+                  /*Perform write operation now*/
> -                     while (out_len > 0) {
> --                        res = write(fh, out, out_len);
> -+                        res = write(vtpm_tx_fh, addressed_out, out_len);
> -+
> -                         if (res < 0) {
> -                             error("write(%d) failed: %s", out_len, strerror(errno));
> -                             break;
> --                        }
> -+                        } else {
> -+                        debug_nostop("Sent[%Zu]: ", out_len);
> -+                        for (i=0; (unsigned int)i< out_len; i++)
> -+                          debug_more("%x ", addressed_out[i]);
> -+                        debug_more("\n");
> -+                      }
> -                         out_len       -= res;
> -                     }
> -                     tpm_free(out);
> -+                  tpm_free(addressed_out);
> -                 }
> -             }
> -         } while (in_len > 0);
> --        close(fh);
> -+        //close(fh);
> -     }
> -+
> -     /* shutdown tpm emulator */
> -     tpm_emulator_shutdown();
> --    /* close socket */
> --    close(sock);
> --    unlink(opt_socket_name);
> -+    /* Close handles */
> -+    close(vtpm_tx_fh);
> -+#ifndef VTPM_MULTI_VM
> -+    close(vtpm_rx_fh);
> -+    free(vtpm_rx_file);
> -+#endif
> -     info("main loop stopped");
> - }
> -
> -@@ -450,12 +770,13 @@ int main(int argc, char **argv)
> -     /* open random device */
> -     init_random();
> -     /* init signal handlers */
> --    init_signal_handler();
> -+    //init_signal_handler();
> -     /* unless requested otherwiese, fork and daemonize process */
> --    if (!opt_foreground) daemonize();
> -+    //if (!opt_foreground) daemonize();
> -     /* start main processing loop */
> -     main_loop();
> -     info("stopping TPM Emulator daemon");
> -     closelog();
> -     return 0;
> - }
> -+
> -diff -Naurp tpm_emulator-0.5.1/tpmd/tpm_emulator_config.h tpm5-test/tpmd/tpm_emulator_config.h
> ---- tpm_emulator-0.5.1/tpmd/tpm_emulator_config.h      2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/tpmd/tpm_emulator_config.h       2009-07-16 11:25:26.000000000 -0400
> -@@ -29,23 +29,28 @@
> -
> - /* TPM emulator configuration */
> -
> --#undef  TPM_STRONG_PERSISTENCE
> --#undef  TPM_GENERATE_EK
> -+#define  TPM_STRONG_PERSISTENCE
> -+#define  TPM_GENERATE_EK
> - #undef  TPM_GENERATE_SEED_DAA
> - #undef  TPM_MEMORY_ALIGNMENT_MANDATORY
> -
> -+extern int dmi_id;
> -+
> - /* log macros */
> -
> - void tpm_log(int priority, const char *fmt, ...);
> -
> --#define debug(fmt, ...) tpm_log(LOG_DEBUG, "%s:%d: Debug: " fmt "\n", \
> --                                __FILE__, __LINE__, ## __VA_ARGS__)
> --#define info(fmt, ...)  tpm_log(LOG_INFO, "%s:%d: Info: " fmt "\n", \
> --                                __FILE__, __LINE__, ## __VA_ARGS__)
> --#define error(fmt, ...) tpm_log(LOG_ERR, "%s:%d: Error: " fmt "\n", \
> --                                __FILE__, __LINE__, ## __VA_ARGS__)
> --#define alert(fmt, ...) tpm_log(LOG_ALERT, "%s:%d: Alert: " fmt "\n", \
> --                                __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug(fmt, ...) tpm_log(LOG_DEBUG, "VTPMD[%d]: %s:%d: Debug: " fmt "\n", \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define info(fmt, ...)  tpm_log(LOG_INFO, "VTPMD[%d]: %s:%d: Info: " fmt "\n", \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define error(fmt, ...) tpm_log(LOG_ERR, "VTPMD[%d]: %s:%d: Error: " fmt "\n", \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define alert(fmt, ...) tpm_log(LOG_ALERT, "VTPMD[%d]: %s:%d: Alert: " fmt "\n", \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug_nostop(fmt, ...) tpm_log(LOG_DEBUG, "VTPMD[%d]: %s:%d: Debug: " fmt, \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug_more(fmt, ...) tpm_log(LOG_DEBUG, fmt, ## __VA_ARGS__)
> -
> - /*  min/max macros that also do strict type-checking */
> -
> diff --git a/tools/vtpm/vtpm.patch b/tools/vtpm/vtpm.patch
> deleted file mode 100644
> index e896b25..0000000
> --- a/tools/vtpm/vtpm.patch
> +++ /dev/null
> @@ -1,716 +0,0 @@
> -diff -uprN tpm_emulator/AUTHORS vtpm/AUTHORS
> ---- tpm_emulator/AUTHORS       2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/AUTHORS       2006-12-13 16:38:52.000000000 -0800
> -@@ -1,3 +1,3 @@
> - Mario Strasser <mast@gmx.net>
> - Heiko Stamer <stamer@gaos.org> [DAA]
> --INTEL Corp <> [Dropped to Ring3]
> -+INTEL Corp <> [VTPM Extensions]
> -diff -uprN tpm_emulator/ChangeLog vtpm/ChangeLog
> ---- tpm_emulator/ChangeLog     2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/ChangeLog     2006-12-13 16:38:52.000000000 -0800
> -@@ -1,5 +1,6 @@
> - ????-??-?? Intel Corp
> -       * Moved module out of kernel to run as a ring 3 app
> -+      * Modified save_to_file and load_from_file to call xen VTPM manager
> -
> - 2006-06-23  Mario Strasser <mast@gmx.net>
> -       * tpm_startup.c: behaviour of ST_CLEAR and storage of
> -diff -uprN tpm_emulator/linux_module.h vtpm/linux_module.h
> ---- tpm_emulator/linux_module.h        2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/linux_module.h        2007-01-09 14:49:06.000000000 -0800
> -@@ -44,18 +44,26 @@
> - #define TPM_DEVICE_NAME   "tpm"
> - #define TPM_MODULE_NAME   "tpm_emulator"
> -
> -+/* debug and log output functions */
> -+extern int dmi_id;
> -+
> - #ifdef DEBUG
> --#define debug(fmt, ...) printf("TPMD: %s:%d: Debug: " fmt "\n", \
> --                        __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug(fmt, ...) printf("TPMD[%d]: %s:%d: Debug: " fmt "\n", \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug_nostop(fmt, ...) printf("TPMD[%d]: %s:%d: Debug: " fmt, \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug_more(fmt, ...) printf( fmt, ## __VA_ARGS__ )
> - #else
> - #define debug(fmt, ...)
> -+#define debug_nostop(fmt, ...)
> -+#define debug_more(fmt, ...)
> - #endif
> --#define info(fmt, ...)  printf("TPMD: %s:%d: Info: " fmt "\n", \
> --                        __FILE__, __LINE__, ## __VA_ARGS__)
> --#define error(fmt, ...) printf("TPMD: %s:%d: Error: " fmt "\n", \
> --                        __FILE__, __LINE__, ## __VA_ARGS__)
> --#define alert(fmt, ...) printf("TPMD: %s:%d: Alert: " fmt "\n", \
> --                        __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define info(fmt, ...)  printf("TPMD[%d]: %s:%d: Info: " fmt "\n", \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define error(fmt, ...) printf("TPMD[%d]: %s:%d: Error: " fmt "\n", \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define alert(fmt, ...) printf("TPMD[%d]: %s:%d: Alert: " fmt "\n", \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -
> - /* memory allocation */
> -
> -diff -uprN tpm_emulator/Makefile vtpm/Makefile
> ---- tpm_emulator/Makefile      2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/Makefile      2006-12-13 16:38:52.000000000 -0800
> -@@ -7,7 +7,7 @@
> - COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
> -
> - # module settings
> --BIN            := tpm_emulator
> -+BIN            := vtpmd
> - VERSION_MAJOR  := 0
> - VERSION_MINOR  := 4
> - VERSION_BUILD  := $(shell date +"%s")
> -@@ -22,7 +22,7 @@ TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin
> -
> - CC      := gcc
> - CFLAGS  += -g -Wall $(INCLUDE) -DDEBUG
> --CFLAGS  += -I. -Itpm
> -+CFLAGS  += -I. -Itpm -I../../vtpm_manager/manager
> -
> - # Is the simulator running in it's own vm?
> - #CFLAGS += -DVTPM_MULTI_VM
> -@@ -62,7 +62,6 @@ $(BIN):      $(src)/crypto/gmp.h $(src)/crypt
> -
> - install: $(BIN)
> -       $(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)
> --      @if [ ! -d "/var/tpm" ]; then mkdir /var/tpm; fi
> -
> - clean:
> -       rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a $(OBJS)
> -@@ -98,3 +97,4 @@ version:
> -       @echo "#endif /* _TPM_VERSION_H_ */" >> $(src)/tpm_version.h
> -
> - .PHONY: all install clean dist gmp version
> -+
> -diff -uprN tpm_emulator/tpm/tpm_capability.c vtpm/tpm/tpm_capability.c
> ---- tpm_emulator/tpm/tpm_capability.c  2006-06-23 03:37:07.000000000 -0700
> -+++ vtpm/tpm/tpm_capability.c  2007-01-10 10:00:49.000000000 -0800
> -@@ -136,8 +136,18 @@ static TPM_RESULT cap_property(UINT32 su
> -
> -     case TPM_CAP_PROP_TIS_TIMEOUT:
> -       debug("[TPM_CAP_PROP_TIS_TIMEOUT]");
> --      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT */
> --      return TPM_FAIL;
> -+      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT: Measure these values and determine correct ones */
> -+      UINT32 len = *respSize = 16;
> -+      BYTE *ptr = *resp = tpm_malloc(*respSize);
> -+      if (ptr == NULL ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000)) {
> -+        tpm_free(*resp);
> -+        return TPM_FAIL;
> -+      }
> -+      return TPM_SUCCESS;
> -
> -     case TPM_CAP_PROP_STARTUP_EFFECT:
> -       debug("[TPM_CAP_PROP_STARTUP_EFFECT]");
> -@@ -190,7 +200,11 @@ static TPM_RESULT cap_property(UINT32 su
> -
> -     case TPM_CAP_PROP_DURATION:
> -       debug("[TPM_CAP_PROP_DURATION]");
> --      /* TODO: TPM_CAP_PROP_DURATION */
> -+      /* TODO: TPM_CAP_PROP_DURATION: Measure these values and return accurate ones */
> -+      BYTE dur[]= {0x0,0x0,0x0,0xc,0x0,0x7,0xa1,0x20,0x0,0x1e,0x84,0x80,0x11,0xe1,0xa3,0x0};
> -+      *respSize = 16;
> -+      *resp = tpm_malloc(*respSize);
> -+      memcpy(*resp,dur,16);
> -       return TPM_FAIL;
> -
> -     case TPM_CAP_PROP_ACTIVE_COUNTER:
> -diff -uprN tpm_emulator/tpm/tpm_cmd_handler.c vtpm/tpm/tpm_cmd_handler.c
> ---- tpm_emulator/tpm/tpm_cmd_handler.c 2008-02-27 16:35:41.000000000 -0500
> -+++ vtpm/tpm/tpm_cmd_handler.c 2008-02-28 14:43:28.000000000 -0500
> -@@ -94,12 +94,18 @@ void tpm_compute_out_param_digest(TPM_CO
> -   sha1_ctx_t sha1;
> -   UINT32 res = CPU_TO_BE32(rsp->result);
> -   UINT32 ord = CPU_TO_BE32(ordinal);
> -+  UINT32 offset = 0;
> -
> -   /* compute SHA1 hash */
> -   sha1_init(&sha1);
> -   sha1_update(&sha1, (BYTE*)&res, 4);
> -   sha1_update(&sha1, (BYTE*)&ord, 4);
> --  sha1_update(&sha1, rsp->param, rsp->paramSize);
> -+  if (ordinal == TPM_ORD_LoadKey2) {
> -+      offset = 4;
> -+  }
> -+  if (rsp->paramSize - offset > 0) {
> -+      sha1_update(&sha1, rsp->param + offset, rsp->paramSize - offset);
> -+  }
> -   sha1_final(&sha1, rsp->auth1->digest);
> -   if (rsp->auth2 != NULL) memcpy(rsp->auth2->digest,
> -     rsp->auth1->digest, sizeof(rsp->auth1->digest));
> -diff -uprN tpm_emulator/tpm/tpm_data.c vtpm/tpm/tpm_data.c
> ---- tpm_emulator/tpm/tpm_data.c        2008-02-27 16:35:41.000000000 -0500
> -+++ vtpm/tpm/tpm_data.c        2008-02-27 16:35:40.000000000 -0500
> -@@ -1,6 +1,7 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -15,10 +16,15 @@
> -  * $Id: tpm_data.c 98 2006-05-07 14:16:29Z hstamer $
> -  */
> -
> -+#include <sys/types.h>
> -+#include <sys/stat.h>
> -+#include <fcntl.h>
> -+#include <unistd.h>
> -+
> - #include "tpm_emulator.h"
> - #include "tpm_structures.h"
> - #include "tpm_marshalling.h"
> --#include "linux_module.h"
> -+#include "vtpm_manager.h"
> -
> - TPM_DATA tpmData;
> -
> -@@ -158,45 +164,232 @@ void tpm_release_data(void)
> - #include <sys/types.h>
> - #include <sys/stat.h>
> - #include <fcntl.h>
> --#include <unistd.h>
> -
> --#define TPM_STORAGE_FILE "/var/tpm/tpm_emulator-1.2." STR(VERSION_MAJOR) "." STR(VERSION_MINOR)
> -+ static int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> -+
> -+#ifdef VTPM_MUTLI_VM
> -+ #define DEV_FE "/dev/tpm"
> -+#else
> -+ #define VTPM_RX_FIFO_D  "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
> -+ #define VTPM_TX_FIFO  "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
> -+
> -+ extern int dmi_id;
> -+ static char *vtpm_rx_name=NULL;
> -+#endif
> -
> - static int write_to_file(uint8_t *data, size_t data_length)
> - {
> --  int res;
> --  int fp;
> --  fp = open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> --  res = write(fp, data, data_length);
> --  close(fp);
> --  return (res == data_length) ? 0 : -1;
> -+  int res, out_data_size, in_header_size;
> -+  BYTE *ptr, *out_data, *in_header;
> -+  UINT32 result, len, in_rsp_size;
> -+  UINT16 tag = VTPM_TAG_REQ;
> -+
> -+  printf("Saving NVM\n");
> -+  if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> -+#else
> -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_tx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Send request to VTPM Manager to encrypt data
> -+#ifdef VTPM_MUTLI_VM
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT + data_length;
> -+#else
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV + data_length;
> -+#endif
> -+
> -+  out_data = ptr = (BYTE *) malloc(len);
> -+
> -+  if (ptr == NULL
> -+#ifndef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> -+#endif
> -+        || tpm_marshal_UINT16(&ptr, &len, tag)
> -+#ifdef VTPM_MUTLI_VM
> -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> -+#else
> -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> -+#endif
> -+        || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_SAVENVM)
> -+        || tpm_marshal_BYTE_ARRAY(&ptr, &len, data, data_length)) {
> -+      free(out_data);
> -+      return -1;
> -+  }
> -+
> -+  printf("\tSending SaveNVM Command.\n");
> -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> -+  free(out_data);
> -+  if (res != out_data_size) return -1;
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_rx_fh = vtpm_tx_fh
> -+#else
> -+    if (vtpm_rx_name == NULL) {
> -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> -+    }
> -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Read Header of response so we can get the size & status
> -+#ifdef VTPM_MUTLI_VM
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  in_header = ptr = malloc(in_header_size);
> -+
> -+  printf("\tReading SaveNVM header.\n");
> -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> -+
> -+  if ( (res != in_header_size)
> -+#ifndef VTPM_MUTLI_VM
> -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> -+#endif
> -+         || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> -+         || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> -+         || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> -+        free(in_header);
> -+        return -1;
> -+  }
> -+  free(in_header);
> -+
> -+  if (result != VTPM_SUCCESS) {
> -+      return -1;
> -+  }
> -+
> -+#ifdef VTPM_MUTLI_VM
> -+  close(vtpm_tx_fh); close(vtpm_rx_fh);
> -+#endif
> -+
> -+  printf("\tFinishing up SaveNVM\n");
> -+  return (0);
> - }
> -
> - static int read_from_file(uint8_t **data, size_t *data_length)
> - {
> --  int res;
> --  int fp, file_status;
> --  struct stat file_info;
> --  fp = open(TPM_STORAGE_FILE, O_RDONLY, 0);
> --  file_status = fstat(fp, &file_info);
> --  if (file_status < 0) {
> --    close(fp);
> --    return -1;
> --  }
> -+  int res, out_data_size, in_header_size;
> -+  uint8_t *ptr, *out_data, *in_header;
> -+  UINT16 tag = VTPM_TAG_REQ;
> -+  UINT32 len, in_rsp_size, result;
> -+#ifdef VTPM_MUTLI_VM
> -+      int vtpm_rx_fh, vtpm_tx_fh;
> -+#endif
> -+
> -+  printf("Loading NVM.\n");
> -+  if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> -+#else
> -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> -+#endif
> -+  }
> -
> --  *data_length = file_info.st_size;
> --  *data = tpm_malloc(*data_length);
> --  if (*data == NULL) {
> --    close(fp);
> -+  if (vtpm_tx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Send request to VTPM Manager to encrypt data
> -+#ifdef VTPM_MUTLI_VM
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  out_data = ptr = (BYTE *) malloc(len);
> -+
> -+  if (ptr == NULL
> -+#ifndef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> -+#endif
> -+      || tpm_marshal_UINT16(&ptr, &len, tag)
> -+#ifdef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> -+#else
> -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> -+#endif
> -+      || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_LOADNVM)) {
> -+    free(out_data);
> -     return -1;
> -   }
> --  res = read(fp, *data, *data_length);
> --  close(fp);
> -+
> -+  printf("\tSending LoadNVM command\n");
> -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> -+  free(out_data);
> -+  if (res != out_data_size) return -1;
> -+
> -+    if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_rx_fh = vtpm_tx_fh;
> -+#else
> -+    if (vtpm_rx_name == NULL) {
> -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> -+    }
> -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Read Header of response so we can get the size & status
> -+#ifdef VTPM_MUTLI_VM
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  in_header = ptr = malloc(in_header_size);
> -+
> -+  printf("\tReading LoadNVM header\n");
> -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> -+
> -+  if ( (res != in_header_size)
> -+#ifndef VTPM_MUTLI_VM
> -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> -+#endif
> -+       || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> -+       || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> -+       || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> -+      free(in_header);
> -+      return -1;
> -+  }
> -+  free(in_header);
> -+
> -+  if (result != VTPM_SUCCESS) {
> -+      return -1;
> -+  }
> -+
> -+  // Read Encrypted data from VTPM Manager
> -+  *data_length = in_rsp_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> -+  *data = (uint8_t *) malloc(*data_length);
> -+
> -+  printf("\tReading clear data from LoadNVM.\n");
> -+  res = read(vtpm_rx_fh, *data, *data_length);
> -+#ifdef VTPM_MUTLI_VM
> -+  close(vtpm_rx_fh);close(vtpm_tx_fh);
> -+#endif
> -+
> -+  printf("\tReturing from loading NVM\n");
> -   if (res != *data_length) {
> --    tpm_free(*data);
> --    return -1;
> -+      free(*data);
> -+      return -1;
> -+  } else {
> -+      return 0;
> -   }
> --  return 0;
> -+
> - }
> -
> - #else
> -diff -uprN tpm_emulator/tpmd.c vtpm/tpmd.c
> ---- tpm_emulator/tpmd.c        2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/tpmd.c        2007-01-09 14:48:56.000000000 -0800
> -@@ -21,12 +21,24 @@
> - #include <sys/stat.h>
> - #include <fcntl.h>
> - #include <sys/time.h>
> -+#include <sys/socket.h>
> -+#include <sys/un.h>
> -+#include <errno.h>
> -
> - #include "tpm_emulator.h"
> -+#include "vtpm_manager.h"
> -
> --#define TPM_RX_FNAME "/var/tpm/tpm_in.fifo"
> --#define TPM_TX_FNAME "/var/tpm/tpm_out.fifo"
> -+#ifdef VTPM_MULTI_VM
> -+ #define DEV_BE "/dev/vtpm"
> -+#else
> -+ #define PVM_RX_FIFO_D "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
> -+ #define PVM_TX_FIFO "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
> -
> -+ #define HVM_RX_FIFO_D "/var/vtpm/socks/%d.socket"
> -+#endif
> -+
> -+ int dmi_id;
> -+
> - #define BUFFER_SIZE 2048
> -
> - static int devurandom=0;
> -@@ -38,7 +50,7 @@ void get_random_bytes(void *buf, int nby
> -   }
> -
> -   if (read(devurandom, buf, nbytes) != nbytes) {
> --      printf("Can't get random number.\n");
> -+      error("Can't get random number.\n");
> -       exit(-1);
> -   }
> - }
> -@@ -52,105 +64,182 @@ uint64_t tpm_get_ticks(void)
> -
> - int main(int argc, char **argv)
> - {
> --  uint8_t in[BUFFER_SIZE], *out;
> -+  uint8_t type, in[BUFFER_SIZE], *out, *addressed_out;
> -+  char *vtpm_rx_file=NULL;
> -   uint32_t out_size;
> -   int in_size, written;
> --  int i;
> --  struct stat file_info;
> -+  int i, guest_id=-1;
> -
> --  int tpm_tx_fh=-1, tpm_rx_fh=-1;
> -+#ifndef VTPM_MULTI_VM
> -+  int sockfd = -1;
> -+  struct sockaddr_un addr;
> -+  struct sockaddr_un client_addr;
> -+  unsigned int client_length;
> -+
> -+#endif
> -+
> -+  int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> -+#ifdef VTPM_MULTI_VM
> -   if (argc < 2) {
> --    printf("Usage: tpmd clear|save|deactivated\n" );
> -+    error("Usage: tpmd clear|save|deactivated\n" );
> -+#else
> -+  if (argc < 4) {
> -+    error("Usage: tpmd clear|save|deactivated pvm|hvm vtpmid\n" );
> -+#endif
> -         return -1;
> -   }
> -
> -+#ifndef VTPM_MULTI_VM
> -+  /* setup type of vm */
> -+  if (!strcmp(argv[2], "pvm")) {
> -+    type = VTPM_TYPE_PVM; // Get commands from vTPM Manager through fifo
> -+  } else if (!strcmp(argv[2], "hvm")) {
> -+    type = VTPM_TYPE_HVM; // Get commands from qemu via socket
> -+  } else {
> -+    error("invalid vTPM type '%s'.\n", argv[2]);
> -+  }
> -+
> -+  dmi_id = atoi(argv[3]);
> -+
> -+  if (type == VTPM_TYPE_PVM) {
> -+    vtpm_rx_file = malloc(10 + strlen(PVM_RX_FIFO_D));
> -+    sprintf(vtpm_rx_file, PVM_RX_FIFO_D, (uint32_t) dmi_id);
> -+  } else {
> -+    vtpm_rx_file = malloc(10 + strlen(HVM_RX_FIFO_D));
> -+    sprintf(vtpm_rx_file, HVM_RX_FIFO_D, (uint32_t) dmi_id);
> -+
> -+    if ( (sockfd = socket(PF_UNIX,SOCK_STREAM,0)) < 0) {
> -+          error("Unable to create socket. errno = %d\n", errno);
> -+      exit (-1);
> -+    }
> -+
> -+    memset(&addr, 0, sizeof(addr));
> -+    addr.sun_family = AF_UNIX;
> -+    strcpy(addr.sun_path,vtpm_rx_file );
> -+    unlink(addr.sun_path);
> -+  }
> -+#endif
> -+
> -+#ifdef VTPM_MULTI_VM
> -+  info("Initializing tpm state: %s\n", argv[1]);
> -+#else
> -+  info("Initializing tpm state: %s, type: %s, id: %d\n", argv[1], argv[2], dmi_id);
> -+#endif
> -+
> -   /* initialize TPM emulator */
> -   if (!strcmp(argv[1], "clear")) {
> --    printf("Initializing tpm: %s\n", argv[1]);
> -     tpm_emulator_init(1);
> --  } else if (!strcmp(argv[1], "save")) {
> --    printf("Initializing tpm: %s\n", argv[1]);
> -+  } else if (!strcmp(argv[1], "save")) {
> -     tpm_emulator_init(2);
> -   } else if (!strcmp(argv[1], "deactivated")) {
> --    printf("Initializing tpm: %s\n", argv[1]);
> -     tpm_emulator_init(3);
> -   } else {
> --    printf("invalid startup mode '%s'; must be 'clear', "
> -+    error("invalid startup mode '%s'; must be 'clear', "
> -       "'save' (default) or 'deactivated", argv[1]);
> -     return -1;
> -   }
> --
> --  if ( stat(TPM_RX_FNAME, &file_info) == -1) {
> --    if ( mkfifo(TPM_RX_FNAME, S_IWUSR | S_IRUSR ) ) {
> --      printf("Failed to create fifo %s.\n", TPM_RX_FNAME);
> --      return -1;
> --    }
> --  }
> --
> --  if ( stat(TPM_TX_FNAME, &file_info) == -1) {
> --    if ( mkfifo(TPM_TX_FNAME, S_IWUSR | S_IRUSR ) ) {
> --      printf("Failed to create fifo %s.\n", TPM_TX_FNAME);
> --      return -1;
> --    }
> --  }
> --
> -+
> -   while (1) {
> - abort_command:
> --    if (tpm_rx_fh < 0) {
> --      tpm_rx_fh = open(TPM_RX_FNAME, O_RDONLY);
> -+    if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+      vtpm_rx_fh = open(DEV_BE, O_RDWR);
> -+#else
> -+      if (type == VTPM_TYPE_PVM) {
> -+        vtpm_rx_fh = open(vtpm_rx_file, O_RDONLY);
> -+      } else {
> -+        if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
> -+          error("Unable to bind(). errno = %d\n", errno);
> -+          exit (-1);
> -+        }
> -+
> -+        if (listen(sockfd, 10) <0) {
> -+          error("Unable to listen(). errno = %d\n", errno);
> -+          exit (-1);
> -+        }
> -+
> -+        memset(&client_addr, 0, sizeof(client_addr));
> -+        client_length = sizeof(client_addr);
> -+
> -+        vtpm_rx_fh = vtpm_tx_fh = accept(sockfd, (struct sockaddr *)&client_addr, &client_length);
> -+      }
> -+#endif
> -     }
> -
> --    if (tpm_rx_fh < 0) {
> --      printf("ERROR: failed to open devices to listen to guest.\n");
> -+    if (vtpm_rx_fh < 0) {
> -+      error("Failed to open devices to listen to guest.\n");
> -       return -1;
> -     }
> -
> --    if (tpm_tx_fh < 0) {
> --      tpm_tx_fh = open(TPM_TX_FNAME, O_WRONLY);
> --    }
> --
> --    if (tpm_tx_fh < 0) {
> --      printf("ERROR: failed to open devices to respond to guest.\n");
> --      return -1;
> --    }
> --
> --    in_size = read(tpm_rx_fh, in, BUFFER_SIZE);
> -+    in_size = read(vtpm_rx_fh, in, BUFFER_SIZE);
> -     if (in_size < 6) { // Magic size of minium TPM command
> --      printf("Recv[%d] to small: 0x", in_size);
> -+      info("Recv incomplete command of %d bytes.", in_size);
> -       if (in_size <= 0) {
> --          close(tpm_rx_fh);
> --          tpm_rx_fh = -1;
> -+          close(vtpm_rx_fh);
> -+          vtpm_rx_fh = -1;
> -           goto abort_command;
> -       }
> -     } else {
> --      printf("Recv[%d]: 0x", in_size);
> -+      debug_nostop("Recv[%d]: 0x", in_size);
> -       for (i=0; i< in_size; i++)
> --        printf("%x ", in[i]);
> --      printf("\n");
> -+        debug_more("%x ", in[i]);
> -+      debug_more("\n");
> -     }
> -
> --
> --    if (tpm_handle_command(in, in_size, &out, &out_size) != 0) {
> --        printf("ERROR: Handler Failed.\n");
> -+    if (guest_id == -1) {
> -+        guest_id = *((uint32_t *) in);
> -+    } else {
> -+        if (guest_id != *((uint32_t *) in) ) {
> -+            error("WARNING: More than one guest attached\n");
> -+        }
> -+    }
> -+
> -+    if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+      vtpm_tx_fh = open(DEV_BE, O_RDWR);
> -+      vtpm_rx_fh = vtpm_tx_fh;
> -+#else
> -+      if (type == VTPM_TYPE_PVM) {
> -+        vtpm_tx_fh = open(PVM_TX_FIFO, O_WRONLY);
> -+      } // No need to open the other direction for HVM
> -+#endif
> -+    }
> -+
> -+    if (vtpm_tx_fh < 0) {
> -+      error("Failed to open devices to respond to guest.\n");
> -+      return -1;
> -+    }
> -+
> -+    // Handle the command, but skip the domain id header
> -+    if (tpm_handle_command(in + sizeof(uint32_t), in_size - sizeof(uint32_t), &out, &out_size) != 0) {
> -+      error("Handler Failed.\n");
> -     }
> -
> --    written = write(tpm_tx_fh, out, out_size);
> -+    addressed_out = (uint8_t *) tpm_malloc(sizeof(uint32_t) + out_size);
> -+    *(uint32_t *) addressed_out = *(uint32_t *) in;
> -+    memcpy(addressed_out + sizeof(uint32_t), out, out_size);
> -+
> -+    written = write(vtpm_tx_fh, addressed_out, out_size + sizeof(uint32_t));
> -
> --    if (written != out_size ) {
> --      printf("ERROR: Part of response not written %d/%d.\nAttempt: ", written, out_size);
> -+    if (written != out_size + sizeof(uint32_t)) {
> -+      error("Part of response not written %d/%d.\n", written, out_size);
> -     } else {
> --      printf("Sent[%Zu]: ", out_size);
> -+      debug_nostop("Sent[%Zu]: ", out_size + sizeof(uint32_t));
> -+      for (i=0; i< out_size+ sizeof(uint32_t); i++)
> -+        debug_more("%x ", addressed_out[i]);
> -+      debug_more("\n");
> -     }
> --    for (i=0; i< out_size; i++)
> --      printf("%x ", out[i]);
> --    printf("\n");
> -     tpm_free(out);
> -+    tpm_free(addressed_out);
> -
> -   } // loop
> -
> -   tpm_emulator_shutdown();
> -
> --  close(tpm_tx_fh);
> --  close(tpm_rx_fh);
> -+  close(vtpm_tx_fh);
> -+#ifndef VTPM_MUTLI_VM
> -+  close(vtpm_rx_fh);
> -+  free (vtpm_rx_file);
> -+#endif
> -
> - }
> diff --git a/tools/vtpm_manager/COPYING b/tools/vtpm_manager/COPYING
> deleted file mode 100644
> index c4b86b7..0000000
> --- a/tools/vtpm_manager/COPYING
> +++ /dev/null
> @@ -1,32 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> diff --git a/tools/vtpm_manager/Makefile b/tools/vtpm_manager/Makefile
> deleted file mode 100644
> index 632f41b..0000000
> --- a/tools/vtpm_manager/Makefile
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../..
> -
> -# Base definitions and rules
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -SUBDIRS                = crypto tcs util manager migration
> -OPENSSL_HEADER = /usr/include/openssl/crypto.h
> -
> -.PHONY: all clean install
> -all clean install: %: subdirs-%
> -
> -.PHONY: mrproper
> -mrproper:
> -       @set -e; for subdir in $(SUBDIRS); do \
> -               $(MAKE) -C $$subdir $@; \
> -       done
> -
> -
> diff --git a/tools/vtpm_manager/README b/tools/vtpm_manager/README
> deleted file mode 100644
> index f0d1e98..0000000
> --- a/tools/vtpm_manager/README
> +++ /dev/null
> @@ -1,94 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -Directory Structure
> -===================
> -tools/vtpm_manager/crypto    -> crypto files
> -tools/vtpm_manager/TCS       -> TCS implementation
> -tools/vtpm_manager/util      -> Utility Library. Include disk-io and buffers.
> -tools/vtpm_manager/manager   -> VTPM Manager
> -
> -Compile Flags
> -===================
> -LOGGING_MODULES              -> How extensive logging happens
> -                                see util/log.h for more info
> -
> -VTPM_MULTI_VM                -> Defined: VTPMs run in their own VMs
> -                                Not Defined (default): VTPMs are processes
> -
> -# Debugging flags that may disappear without notice in the future
> -
> -DUMMY_BACKEND                -> vtpm_manager listens on /tmp/in.fifo and
> -                                /tmp/out.fifo rather than backend
> -
> -MANUAL_DM_LAUNCH             -> Must manually launch & kill VTPMs
> -
> -WELL_KNOWN_OWNER_AUTH        -> Rather than randomly generating the password for the owner,
> -                                use a well known value. This is useful for debugging and for
> -                                poor bios which do not support clearing TPM if OwnerAuth is
> -                                lost. However this has no protection from malicious app
> -                                issuing a TPM_OwnerClear to wipe the TPM
> -
> -Requirements
> -============
> -- xen-unstable
> -- vtpm frontend/backend driver patch
> -- OpenSSL Library
> -
> -Single-VM Flow
> -============================
> -- Launch the VTPM manager (vtpm_managerd) which which begins listening to the BE with one thread
> -  and listens to a named fifo that is shared by the vtpms to commuincate with the manager.
> -- VTPM Manager listens to TPM BE.
> -- When xend launches a tpm frontend equipped VM it contacts the manager over the vtpm backend.
> -- When the manager receives the open message from the BE, it launches a vtpm
> -- Xend allows the VM to continue booting.
> -- When a TPM request is issued to the front end, the front end transmits the TPM request to the backend.
> -- The manager receives the TPM requests and uses a named fifo to forward the request to the vtpm.
> -- The fifo listener begins listening for the reply from vtpm for the request.
> -- Vtpm processes request and replies to manager over shared named fifo.
> -- If needed, the vtpm may send a request to the vtpm_manager at any time to save it's secrets to disk.
> -- Manager receives response from vtpm and passes it back to backend for forwarding to guest.
> -
> -NOTES:
> -* SaveService SHOULD seal it's table before saving it to disk. However,
> -  the current Xen infrastructure does not provide a mechanism for this to be
> -  unsealed later. Specifically, the auth and wrapped key must be available ONLY
> -  to the service, or it's not even worth encrypting
> -
> -  In the future the vtpm manager will be protected by an early boot mechanism
> -  that will allow for better protection of it's data.
> -
> -TODO:
> -- Timeout on crashed vtpms
> -- create lock for shared fifo for talking to vtpms.
> diff --git a/tools/vtpm_manager/Rules.mk b/tools/vtpm_manager/Rules.mk
> deleted file mode 100644
> index 651772b..0000000
> --- a/tools/vtpm_manager/Rules.mk
> +++ /dev/null
> @@ -1,59 +0,0 @@
> -# Base definitions and rules (XEN_ROOT must be defined in including Makefile)
> -include $(XEN_ROOT)/tools/Rules.mk
> -
> -#
> -# Tool definitions
> -#
> -
> -# General compiler flags
> -CFLAGS = -Werror -g3
> -
> -# Generic project files
> -HDRS   = $(wildcard *.h)
> -SRCS   = $(wildcard *.c)
> -OBJS   = $(patsubst %.c,%.o,$(SRCS))
> -
> -# Generic (non-header) dependencies
> -$(SRCS): Makefile $(XEN_ROOT)/tools/Rules.mk $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -$(OBJS): $(SRCS)
> -
> --include $(FILES)
> -
> -# Make sure these are just rules
> -.PHONY : all build install clean
> -
> -#
> -# Project-specific definitions
> -#
> -
> -# Need UNIX98 spec for pthread rwlocks
> -CFLAGS += -D_GNU_SOURCE
> -
> -# Logging Level. See utils/tools.h for usage
> -CFLAGS += -DLOGGING_MODULES="(BITMASK(VTPM_LOG_TCS)|BITMASK(VTPM_LOG_VTSP)|BITMASK(VTPM_LOG_VTPM))"
> -
> -# Silent Mode
> -#CFLAGS += -DLOGGING_MODULES=0x0
> -#CFLAGS += -DLOGGING_MODULES=0xff
> -
> -# Use frontend/backend pairs between manager & DMs?
> -#CFLAGS += -DVTPM_MULTI_VM
> -
> -# vtpm_manager listens on fifo's rather than backend
> -#CFLAGS += -DDUMMY_BACKEND
> -
> -# TCS talks to fifo's rather than /dev/tpm. TPM Emulator assumed on fifos
> -#CFLAGS += -DDUMMY_TPM
> -
> -# Do not have manager launch DMs.
> -#CFLAGS += -DMANUAL_DM_LAUNCH
> -
> -# Fixed OwnerAuth
> -#CFLAGS += -DWELL_KNOWN_OWNER_AUTH
> -
> -# Include
> -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/crypto
> -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/util
> -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/tcs
> -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/manager
> diff --git a/tools/vtpm_manager/crypto/Makefile b/tools/vtpm_manager/crypto/Makefile
> deleted file mode 100644
> index 13b61c9..0000000
> --- a/tools/vtpm_manager/crypto/Makefile
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -BIN            = libtcpaCrypto.a
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIN)
> -
> -.PHONY: install
> -install: build
> -
> -.PHONY: clean
> -clean:
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIN): $(OBJS)
> -       $(AR) rcs $(BIN) $(OBJS)
> diff --git a/tools/vtpm_manager/crypto/crypto.c b/tools/vtpm_manager/crypto/crypto.c
> deleted file mode 100644
> index 7dae655..0000000
> --- a/tools/vtpm_manager/crypto/crypto.c
> +++ /dev/null
> @@ -1,88 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// crypto.c
> -//
> -//  This file will handle all the TPM Crypto functionality
> -//
> -// ==================================================================
> -
> -#include <string.h>
> -#include <openssl/crypto.h>
> -#include <openssl/err.h>
> -#include <openssl/evp.h>
> -#include <openssl/rand.h>
> -#include "crypto.h"
> -#include "log.h"
> -
> -/**
> - * Initialize cryptography library
> - * @rand: random seed
> - * @size: size of @rand
> - */
> -void Crypto_Init(const BYTE* rand, int size) {
> -       ERR_load_crypto_strings();
> -  CRYPTO_malloc_init();
> -  OpenSSL_add_all_algorithms();
> -  SYM_CIPHER = EVP_aes_128_cbc();
> -  RAND_poll();
> -  if (rand == NULL)
> -    return;
> -
> -  RAND_add(rand, size, size);
> -}
> -
> -/**
> - * Shutdown cryptography library
> - */
> -void Crypto_Exit() {
> -  ERR_free_strings();
> -  ERR_remove_state(0);
> -  EVP_cleanup();
> -}
> -
> -
> -/**
> - * Get random data
> - * @data: (OUT) Random data
> - * @size: Size of @data
> - */
> -void Crypto_GetRandom(void* data, int size) {
> -  int result;
> -
> -  result = RAND_pseudo_bytes((BYTE*) data, size);
> -
> -  if (result <= 0)
> -    vtpmlogerror (VTPM_LOG_CRYPTO, "RAND_pseudo_bytes failed: %s\n",
> -            ERR_error_string (ERR_get_error(), NULL));
> -}
> diff --git a/tools/vtpm_manager/crypto/crypto.h b/tools/vtpm_manager/crypto/crypto.h
> deleted file mode 100644
> index 488d4d6..0000000
> --- a/tools/vtpm_manager/crypto/crypto.h
> +++ /dev/null
> @@ -1,175 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// crypto.h
> -//
> -//  This file defines the TPM Crypto API
> -//
> -// ==================================================================
> -
> -#ifndef __CRYPTO_H__
> -#define __CRYPTO_H__
> -
> -#include <stddef.h>
> -#include <stdint.h>
> -#include <stdbool.h>
> -
> -#include "tcg.h"
> -#include "sym_crypto.h"
> -
> -#define CRYPTO_MAX_SIG_SIZE (2048 / 8)
> -#define CRYPTO_MAX_RSA_KEY_SIZE (4096 / 8) //in bytes
> -
> -#define OAEP_P "TCPA"
> -#define OAEP_P_SIZE 4
> -
> -// Algorithms supported by crypto. Stored in CRYPTO_INFO.algorithmID
> -#define CRYPTO_ALGORITH_RSA 0x01
> -
> -// Supported Encryption Schemes CRYPTO_INFO.encScheme
> -#define CRYPTO_ES_NONE 0x0001
> -#define CRYPTO_ES_RSAESPKCSv15 0x0002
> -#define CRYPTO_ES_RSAESOAEP_SHA1_MGF1 0x0003
> -
> -// Supported Signature schemes CRYPTO_INFO.sigScheme
> -#define CRYPTO_SS_NONE 0x0001
> -#define CRYPTO_SS_RSASSAPKCS1v15_SHA1 0x0002
> -#define CRYPTO_SS_RSASSAPKCS1v15_DER 0x0003
> -
> -typedef struct CRYPTO_INFO {
> -  void *keyInfo;
> -  UINT32 algorithmID;
> -  UINT32 encScheme;
> -  UINT32 sigScheme;
> -} CRYPTO_INFO;
> -
> -
> -void Crypto_Init(const BYTE* rand, int size);
> -
> -void Crypto_Exit();
> -
> -void Crypto_GetRandom(void* data, int size);
> -
> -void Crypto_HMAC(   const BYTE* text,
> -                    int text_len,
> -                    const BYTE* key,
> -                    int key_len,
> -                    BYTE* digest);
> -
> -TPM_RESULT Crypto_HMAC_buf (const buffer_t * text,
> -                            const buffer_t * key,
> -                            BYTE * o_digest); /* presumably of 20 bytes */
> -
> -void Crypto_SHA1Full(   const BYTE* text,
> -                        UINT32 size,
> -                        BYTE* hash); //Complete 3part SHA1
> -
> -// o_hash needs to be large enough to hold the digest, ie 20 bytes
> -TPM_RESULT Crypto_SHA1Full_buf (const buffer_t * buf,
> -                                BYTE * o_hash);
> -
> -void Crypto_SHA1Start(UINT32* maxNumBytes);
> -void Crypto_SHA1Update(int numBytes, const BYTE* hashData);
> -void Crypto_SHA1Complete(   int hashDataSize,
> -                            const BYTE* hashData,
> -                            BYTE* hashValue);
> -
> -void Crypto_RSACreateKey(   /*in*/ UINT32 keySize,
> -                            /*in*/ UINT32 pubExpSize,
> -                            /*in*/ BYTE *pubExp,
> -                            /*out*/ UINT32 *privExpSize,
> -                            /*out*/ BYTE *privExp,
> -                            /*out*/ UINT32 *modulusSize,
> -                            /*out*/ BYTE *modulus,
> -                            /*out*/ CRYPTO_INFO *keys);
> -
> -void Crypto_RSABuildCryptoInfo( /*[IN]*/ UINT32 pubExpSize,
> -                                /*[IN]*/ BYTE *pubExp,
> -                                /*[IN]*/ UINT32 privExpSize,
> -                                /*[IN]*/ BYTE *privExp,
> -                                /*[IN]*/ UINT32 modulusSize,
> -                                /*[IN]*/ BYTE *modulus,
> -                                /*[OUT]*/ CRYPTO_INFO* cryptoInfo);
> -
> -void Crypto_RSABuildCryptoInfoPublic(   /*[IN]*/ UINT32 pubExpSize,
> -                                        /*[IN]*/ BYTE *pubExp,
> -                                        /*[IN]*/ UINT32 modulusSize,
> -                                        /*[IN]*/ BYTE *modulus,
> -                                        CRYPTO_INFO* cryptoInfo);
> -
> -//
> -// symmetric pack and unpack operations
> -//
> -TPM_RESULT Crypto_RSAPackCryptoInfo (const CRYPTO_INFO* cryptoInfo,
> -                                     BYTE ** io_buf, UINT32 * io_buflen);
> -
> -TPM_RESULT Crypto_RSAUnpackCryptoInfo (CRYPTO_INFO * ci,
> -                                       BYTE * in, UINT32 len,
> -                                       UINT32 * o_lenread);
> -
> -
> -// return 0 on success, -1 on error
> -int Crypto_RSAEnc(  CRYPTO_INFO *keys,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *outDataSize,
> -                    /*out*/ BYTE *outData);
> -
> -// return 0 on success, -1 on error
> -int Crypto_RSADec(  CRYPTO_INFO *keys,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *outDataSize,
> -                    /*out*/ BYTE *outData);
> -
> -// return 0 on success, -1 on error
> -int Crypto_RSASign( CRYPTO_INFO *keys,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *sigSize,
> -                    /*out*/ BYTE *sig);
> -
> -bool Crypto_RSAVerify(  CRYPTO_INFO *keys,
> -                        UINT32 inDataSize,
> -                        BYTE *inData,
> -                        UINT32 sigSize,
> -                        BYTE *sig);
> -
> -//private:
> -int RSA_verify_DER(int dtype, unsigned char *m, unsigned int m_len,
> -                   unsigned char *sigbuf, unsigned int siglen, CRYPTO_INFO *key);
> -
> -int RSA_sign_DER(int type, unsigned char *m, unsigned int m_len,
> -              unsigned char *sigret, unsigned int *siglen, CRYPTO_INFO *key);
> -
> -#endif // __CRYPTO_H__
> diff --git a/tools/vtpm_manager/crypto/hash.c b/tools/vtpm_manager/crypto/hash.c
> deleted file mode 100644
> index c73114a..0000000
> --- a/tools/vtpm_manager/crypto/hash.c
> +++ /dev/null
> @@ -1,153 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// hash.c
> -//
> -//  This file will handle all the TPM Hash functionality
> -//
> -// ==================================================================
> -
> -#include <string.h>
> -#include <openssl/crypto.h>
> -#include <openssl/err.h>
> -#include <openssl/evp.h>
> -#include <openssl/rand.h>
> -#include <openssl/hmac.h>
> -#include <openssl/sha.h>
> -#include <openssl/bn.h>
> -#include <openssl/rsa.h>
> -
> -#include "tcg.h"         // for TPM_SUCCESS
> -#include "crypto.h"
> -
> -static SHA_CTX g_shaContext;
> -
> -void Crypto_HMAC(   const BYTE* text,
> -                    int text_len,
> -                    const BYTE* key,
> -                    int key_len,
> -                    BYTE* digest) {
> -  if (text == NULL || key == NULL || text_len == 0 || key_len == 0)
> -    return;
> -
> -  HMAC(EVP_sha1(), key, key_len, text, text_len, digest, NULL);
> -}
> -
> -TPM_RESULT Crypto_HMAC_buf (const buffer_t * text,
> -                           const buffer_t * key,
> -                           BYTE * o_digest) { /* presumably of 20 bytes */
> -
> -  Crypto_HMAC (text->bytes, text->size,
> -              key->bytes, key->size,
> -              o_digest);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -/*
> - * SHA1
> - * (OUT) Create a SHA1 hash of text. Calls all three SHA1 steps internally
> - */
> -void Crypto_SHA1Full( const BYTE* text,
> -      uint32_t size,
> -      BYTE* hash) {
> -
> -  if (text == NULL || size == 0)
> -    return;
> -
> -  // Run SHA1Start + SHAUpdate (if necessary) + SHAComplete
> -  uint32_t maxBytes; // Not used for anything
> -  Crypto_SHA1Start(&maxBytes);
> -
> -  while (size > 64){
> -    Crypto_SHA1Update(64, text);
> -    size -= 64;
> -    text += 64;
> -  }
> -
> -  Crypto_SHA1Complete(size, text, hash);
> -}
> -
> -// same thing using buffer_t
> -TPM_RESULT Crypto_SHA1Full_buf (const buffer_t * buf,
> -                                 BYTE * o_digest) {
> -
> -  if (buf->bytes == NULL || buf->size == 0)
> -    return TPM_BAD_PARAMETER;
> -
> -  Crypto_SHA1Full (buf->bytes, buf->size, o_digest);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -/*
> - * Initialize SHA1
> - * (OUT) Maximum number of bytes that can be sent to SHA1Update.
> - *   Must be a multiple of 64 bytes.
> - */
> -void Crypto_SHA1Start(uint32_t* maxNumBytes) {
> -  int max = SHA_CBLOCK;
> -  // Initialize the crypto library
> -  SHA1_Init(&g_shaContext);
> -  *maxNumBytes = max;
> -}
> -
> -/*
> - * Process SHA1
> - * @numBytes: (IN) The number of bytes in hashData.
> - *       Must be a multiple of 64 bytes.
> - * @hashData: (IN) Bytes to be hashed.
> - */
> -void Crypto_SHA1Update(int numBytes, const BYTE* hashData) {
> -
> -  if (hashData == NULL || numBytes == 0 || numBytes%64 != 0)
> -    return;
> -
> -  SHA1_Update(&g_shaContext, hashData, numBytes);
> -}
> -
> -/*
> - * Complete the SHA1 process
> - * @hashDataSize: (IN) Number of bytes in hashData.
> - *       Must be a multiple of 64 bytes.
> - * @hashData: (IN) Final bytes to be hashed.
> - * @hashValue: (OUT) The output of the SHA-1 hash.
> - */
> -void Crypto_SHA1Complete(int hashDataSize,
> -                        const BYTE* hashData,
> -                        BYTE* hashValue) {
> -  SHA1_Update(&g_shaContext, hashData, hashDataSize);
> -  SHA1_Final(hashValue, &g_shaContext);
> -}
> diff --git a/tools/vtpm_manager/crypto/rsa.c b/tools/vtpm_manager/crypto/rsa.c
> deleted file mode 100644
> index 7737dc6..0000000
> --- a/tools/vtpm_manager/crypto/rsa.c
> +++ /dev/null
> @@ -1,434 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// rsa.c
> -//
> -//  This file will handle all the TPM RSA crypto functionality
> -//
> -// ==================================================================
> -
> -#include <string.h>
> -#include <openssl/crypto.h>
> -#include <openssl/evp.h>
> -#include <openssl/bn.h>
> -#include <openssl/rsa.h>
> -#include <openssl/rand.h>
> -#include <openssl/x509.h>
> -
> -#include <openssl/err.h>
> -#include <stdio.h>
> -
> -#include "tcg.h"
> -#include "buffer.h"
> -#include "crypto.h"
> -#include "log.h"
> -
> -void Crypto_RSACreateKey(   /*in*/ UINT32 keySize,
> -                            /*in*/ UINT32 pubExpSize,
> -                            /*in*/ BYTE *pubExp,
> -                            /*out*/ UINT32 *privExpSize,
> -                            /*out*/ BYTE *privExp,
> -                            /*out*/ UINT32 *modulusSize,
> -                            /*out*/ BYTE *modulus,
> -                            /*out*/ CRYPTO_INFO *keys) {
> -  unsigned long e_value;
> -
> -  if (pubExpSize == 0) // Default e = 2^16+1
> -    e_value = (0x01 << 16) + 1;
> -  else {
> -    // This is not supported, but the following line MIGHT work
> -    // under then assumption that the format is BigNum compatable
> -    // Though it's not in the spec, so who knows what it is.
> -    // Forcing the default.
> -    //BN_bin2bn(pubExp, pubExpSize, NULL);
> -    e_value = (0x01 << 16) + 1;
> -  }
> -
> -  RSA *rsa = RSA_generate_key(keySize, e_value, NULL, NULL);
> -
> -  if (keys) {
> -    keys->keyInfo = rsa;
> -    keys->algorithmID = CRYPTO_ALGORITH_RSA;
> -  }
> -
> -  if (modulus)   *modulusSize   = BN_bn2bin(rsa->n, modulus);
> -  if (privExp)   *privExpSize   = BN_bn2bin(rsa->d, privExp);
> -}
> -
> -// Create a CRYPTO_INFO struct from the BYTE * key parts.
> -// If pubExp info is NULL, use TCG default.
> -// If there is a remainder while calculating the privExp, return FALSE.
> -
> -void Crypto_RSABuildCryptoInfo( /*[IN]*/ UINT32 pubExpSize,
> -                                /*[IN]*/ BYTE *pubExp,
> -                                /*[IN]*/ UINT32 privExpSize,
> -                                /*[IN]*/ BYTE *privExp,
> -                                /*[IN]*/ UINT32 modulusSize,
> -                                /*[IN]*/ BYTE *modulus,
> -                                CRYPTO_INFO* cryptoInfo) {
> -  cryptoInfo->keyInfo = RSA_new();
> -  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
> -
> -  rsa->e = BN_new();
> -
> -  if (pubExpSize == 0) { // Default e = 2^16+1
> -    BN_set_bit(rsa->e, 16);
> -    BN_set_bit(rsa->e, 0);
> -  } else {
> -    // This is not supported, but the following line MIGHT work
> -    // under then assumption that the format is BigNum compatable
> -    // Though it's not in the spec, so who knows what it is.
> -    // Forcing the default.
> -    //BN_bin2bn(pubExp, pubExpSize, NULL);
> -    BN_set_bit(rsa->e, 16);
> -    BN_set_bit(rsa->e, 0);
> -  }
> -
> -  rsa->n = BN_bin2bn(modulus, modulusSize, NULL);
> -  rsa->d = BN_bin2bn(privExp, privExpSize, NULL);
> -}
> -
> -// Create a CRYPTO_INFO struct from the BYTE * key parts.
> -// If pubExp info is NULL, use TCG default.
> -// If there is a remainder while calculating the privExp, return FALSE.
> -
> -void Crypto_RSABuildCryptoInfoPublic(   /*[IN]*/ UINT32 pubExpSize,
> -                                        /*[IN]*/ BYTE *pubExp,
> -                                        /*[IN]*/ UINT32 modulusSize,
> -                                        /*[IN]*/ BYTE *modulus,
> -                                        CRYPTO_INFO* cryptoInfo) {
> -  cryptoInfo->keyInfo = RSA_new();
> -  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
> -
> -  rsa->e = BN_new();
> -
> -  if (pubExpSize == 0) { // Default e = 2^16+1
> -    BN_set_bit(rsa->e, 16);
> -    BN_set_bit(rsa->e, 0);
> -  } else {
> -    // This is not supported, but the following line MIGHT work
> -    // under then assumption that the format is BigNum compatable
> -    // Though it's not in the spec, so who knows what it is.
> -    // Forcing the default.
> -    //BN_bin2bn(pubExp, pubExpSize, NULL);
> -    BN_set_bit(rsa->e, 16);
> -    BN_set_bit(rsa->e, 0);
> -  }
> -
> -  rsa->n = BN_bin2bn(modulus, modulusSize, NULL);
> -
> -}
> -
> -int Crypto_RSAEnc(  CRYPTO_INFO *key,
> -                   UINT32 inDataSize,
> -                   BYTE *inData,
> -                   /*out*/ UINT32 *outDataSize,
> -                   /*out*/ BYTE *outData) {
> -  RSA *rsa = (RSA *) key->keyInfo;
> -  UINT32 paddedDataSize = RSA_size (rsa);
> -  BYTE *paddedData = (BYTE *)malloc(sizeof(BYTE) * paddedDataSize);
> -  int rc;
> -
> -  if (paddedData == NULL)
> -    return -1;
> -
> -  *outDataSize = 0;
> -
> -  switch (key->encScheme) {
> -  case CRYPTO_ES_RSAESPKCSv15:
> -    if (RSA_padding_add_PKCS1_type_2(paddedData, paddedDataSize, inData, inDataSize) <= 0) {
> -      rc = -1;
> -      goto abort_egress;
> -    }
> -    break;
> -  case CRYPTO_ES_RSAESOAEP_SHA1_MGF1:
> -    if (RSA_padding_add_PKCS1_OAEP(paddedData,paddedDataSize,inData,inDataSize, (BYTE *) OAEP_P,OAEP_P_SIZE) <= 0 ) {
> -      rc = -1;
> -      goto abort_egress;
> -    }
> -    break;
> -  default:
> -    rc = -1;
> -    goto abort_egress;
> -  }
> -
> -  rc = RSA_public_encrypt(paddedDataSize, paddedData, outData, rsa, RSA_NO_PADDING);
> -  if (rc == -1)
> -    goto abort_egress;
> -
> -  *outDataSize = rc;
> -
> -  if (rc > 0) rc = 0;
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  if (paddedData)
> -    free (paddedData);
> -  return rc;
> -
> -}
> -
> -int Crypto_RSADec(  CRYPTO_INFO *key,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *outDataSize,
> -                    /*out*/ BYTE *outData) {
> -
> -  RSA *rsa = (RSA *) key->keyInfo;
> -  UINT32 paddedDataSize = RSA_size (rsa);
> -  BYTE *paddedData = (BYTE *)malloc(sizeof(BYTE) * paddedDataSize);
> -  int rc;
> -
> -  if (paddedData == NULL)
> -    goto abort_egress;
> -
> -  rc = RSA_private_decrypt(inDataSize, inData, paddedData, rsa, RSA_NO_PADDING);
> -  if (rc == -1) {
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_private_decrypt: %s\n", ERR_error_string(ERR_get_error(), NULL));
> -    goto abort_egress;
> -  }
> -
> -  paddedDataSize = rc;
> -
> -  switch (key->encScheme) {
> -  case CRYPTO_ES_RSAESPKCSv15:
> -    rc = RSA_padding_check_PKCS1_type_2 (outData, paddedDataSize,
> -                                        paddedData + 1, paddedDataSize - 1,
> -                                        RSA_size(rsa));
> -    if (rc == -1) {
> -      vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_padding_check_PKCS1_type_2: %s\n",
> -             ERR_error_string(ERR_get_error(), NULL));
> -      goto abort_egress;
> -    }
> -    *outDataSize = rc;
> -    break;
> -  case CRYPTO_ES_RSAESOAEP_SHA1_MGF1:
> -    rc = RSA_padding_check_PKCS1_OAEP(outData, paddedDataSize,
> -                                     paddedData + 1, paddedDataSize - 1,
> -                                     RSA_size(rsa),
> -                                     (BYTE *) OAEP_P, OAEP_P_SIZE);
> -    if (rc == -1) {
> -      vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_padding_check_PKCS1_OAEP: %s\n",
> -             ERR_error_string(ERR_get_error(), NULL));
> -      goto abort_egress;
> -    }
> -    *outDataSize = rc;
> -    break;
> -  default:
> -    *outDataSize = 0;
> -  }
> -
> -  free(paddedData); paddedData = NULL;
> -  goto egress;
> -
> - abort_egress:
> -
> -  if (paddedData)
> -    free (paddedData);
> -  return -1;
> -
> - egress:
> -  return 0;
> -}
> -
> -// Signs either a SHA1 digest of a message or a DER encoding of a message
> -// Textual messages MUST be encoded or Hashed before sending into this function
> -// It will NOT SHA the message.
> -int Crypto_RSASign( CRYPTO_INFO *key,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *sigSize,
> -                    /*out*/ BYTE *sig) {
> -  int status;
> -  unsigned int intSigSize;
> -
> -  switch(key->sigScheme) {
> -  case CRYPTO_SS_RSASSAPKCS1v15_SHA1:
> -    status = RSA_sign(NID_sha1, inData, inDataSize, sig, &intSigSize, (RSA *) key->keyInfo);
> -    break;
> -  case CRYPTO_SS_RSASSAPKCS1v15_DER:
> -    //        status = Crypto_RSA_sign_DER(NID_md5_sha1, inData, inDataSize, sig, &intSigSize, key);
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "Crypto: Unimplemented sign type (%d)\n", key->sigScheme);
> -    status = 0;
> -    break;
> -  default:
> -    status = 0;
> -  }
> -
> -  if (status == 0) {
> -    *sigSize = 0;
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "%s\n", ERR_error_string(ERR_get_error(), NULL));
> -    return -1;
> -  }
> -
> -  *sigSize = (UINT32) intSigSize;
> -  return 0;
> -}
> -
> -bool Crypto_RSAVerify(  CRYPTO_INFO *key,
> -                        UINT32 inDataSize,
> -                        BYTE *inData,
> -                        UINT32 sigSize,
> -                        BYTE *sig) {
> -  int status;
> -
> -  switch(key->sigScheme){
> -  case CRYPTO_SS_RSASSAPKCS1v15_SHA1:
> -    status = RSA_verify(NID_sha1, inData, inDataSize, sig, sigSize, (RSA *) key->keyInfo);
> -    break;
> -  case CRYPTO_SS_RSASSAPKCS1v15_DER:
> -    //status = Crypto_RSA_verify_DER(NID_md5_sha1, inData, inDataSize, sig, sigSize, key);
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "Crypto: Unimplemented sign type (%d)\n", key->sigScheme);
> -    status = 0;
> -    break;
> -  default:
> -    status = 0;
> -  }
> -
> -  if (status)
> -    return(1);
> -  else {
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "RSA verify: %s\n", ERR_error_string(ERR_get_error(), NULL));
> -    return(0);
> -  }
> -
> -}
> -
> -// helper which packs everything into a BIO!
> -
> -// packs the parameters first, then the private key, then the public key
> -// if *io_buf is NULL, allocate it here as needed. otherwise its size is in
> -// *io_buflen
> -TPM_RESULT Crypto_RSAPackCryptoInfo (const CRYPTO_INFO* cryptoInfo,
> -                                      BYTE ** io_buf, UINT32 * io_buflen) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -  BYTE * buf;
> -  long len, outlen = *io_buflen;
> -
> -  const long PARAMSLEN = 3*sizeof(UINT32);
> -
> -  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
> -
> -  BIO *mem = BIO_new(BIO_s_mem());
> -
> -
> -  // write the openssl keys to the BIO
> -  if ( i2d_RSAPrivateKey_bio (mem, rsa) == 0 ) {
> -    ERR_print_errors_fp (stderr);
> -    ERRORDIE (TPM_SIZE);
> -  }
> -  if ( i2d_RSAPublicKey_bio (mem, rsa) == 0 ) {
> -    ERR_print_errors_fp (stderr);
> -    ERRORDIE (TPM_SIZE);
> -  }
> -
> -  // get the buffer out
> -  len = BIO_get_mem_data (mem, &buf);
> -
> -  // see if we need to allocate a return buffer
> -  if (*io_buf == NULL) {
> -    *io_buf = (BYTE*) malloc (PARAMSLEN + len);
> -    if (*io_buf == NULL)
> -      ERRORDIE (TPM_SIZE);
> -  } else {                      // *io_buf is already allocated
> -    if (outlen < len + PARAMSLEN)
> -      ERRORDIE (TPM_SIZE); // but not large enough!
> -  }
> -
> -  // copy over the parameters (three UINT32's starting at algorithmID)
> -  memcpy (*io_buf, &cryptoInfo->algorithmID, PARAMSLEN);
> -
> -  // copy over the DER keys
> -  memcpy (*io_buf + PARAMSLEN, buf, len);
> -
> -  *io_buflen = len + PARAMSLEN;
> -
> -  goto egress;
> -
> -
> - abort_egress:
> - egress:
> -
> -  BIO_free (mem);
> -
> -  return status;
> -}
> -
> -
> -
> -// sets up ci, and returns the number of bytes read in o_lenread
> -TPM_RESULT Crypto_RSAUnpackCryptoInfo (CRYPTO_INFO * ci,
> -                                        BYTE * in, UINT32 len,
> -                                        UINT32 * o_lenread) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  long l;
> -  BIO *mem;
> -  RSA *rsa;
> -
> -  // first load up the params
> -  l = 3 * sizeof(UINT32);
> -  memcpy (&ci->algorithmID, in, l);
> -  len -= l;
> -  in += l;
> -
> -  // and now the openssl keys, private first
> -  mem = BIO_new_mem_buf (in, len);
> -
> -  if ( (rsa = d2i_RSAPrivateKey_bio (mem, NULL)) == NULL ) {
> -    ERR_print_errors_fp (stderr);
> -    ERRORDIE (TPM_BAD_PARAMETER);
> -  }
> -  // now use the same RSA object and fill in the private key
> -  if ( d2i_RSAPublicKey_bio (mem, &rsa) == NULL ) {
> -    ERR_print_errors_fp (stderr);
> -    ERRORDIE (TPM_BAD_PARAMETER);
> -  }
> -
> -  ci->keyInfo = rsa;          // needs to be freed somehow later
> -
> -  // FIXME: havent figured out yet how to tell how many bytes were read in the
> -  // above oprations! so o_lenread is not set
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  BIO_free (mem);
> -
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/crypto/sym_crypto.c b/tools/vtpm_manager/crypto/sym_crypto.c
> deleted file mode 100644
> index 3d86e19..0000000
> --- a/tools/vtpm_manager/crypto/sym_crypto.c
> +++ /dev/null
> @@ -1,237 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// sym_crypto.c
> -//
> -//     Symmetric crypto portion of crypto
> -//
> -// ==================================================================
> -
> -#include <openssl/evp.h>
> -#include <openssl/rand.h>
> -
> -#include "tcg.h"
> -#include "sym_crypto.h"
> -
> -typedef enum crypt_op_type_t {
> -  CRYPT_ENCRYPT,
> -  CRYPT_DECRYPT
> -} crypt_op_type_t;
> -
> -TPM_RESULT ossl_symcrypto_op (symkey_t* key,
> -                              const buffer_t* in,
> -                              const buffer_t* iv,
> -                              buffer_t * out,
> -                              crypt_op_type_t optype);
> -
> -
> -// this is initialized in Crypto_Init()
> -const EVP_CIPHER * SYM_CIPHER = NULL;
> -
> -const BYTE ZERO_IV[EVP_MAX_IV_LENGTH] = {0};
> -
> -
> -TPM_RESULT Crypto_symcrypto_initkey (symkey_t * key, const buffer_t* keybits) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  EVP_CIPHER_CTX_init (&key->context);
> -
> -  key->cipher = SYM_CIPHER;
> -
> -  TPMTRYRETURN( buffer_init_copy (&key->key, keybits));
> -
> -  goto egress;
> -
> - abort_egress:
> -  EVP_CIPHER_CTX_cleanup (&key->context);
> -
> - egress:
> -
> -  return status;
> -}
> -
> -
> -
> -TPM_RESULT Crypto_symcrypto_genkey (symkey_t * key) {
> -  int res;
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  // hmm, EVP_CIPHER_CTX_init does not return a value
> -  EVP_CIPHER_CTX_init (&key->context);
> -
> -  key->cipher = SYM_CIPHER;
> -
> -  TPMTRYRETURN( buffer_init (&key->key, EVP_CIPHER_key_length(key->cipher), NULL)) ;
> -
> -  // and generate the key material
> -  res = RAND_pseudo_bytes (key->key.bytes, key->key.size);
> -  if (res < 0)
> -    ERRORDIE (TPM_SHORTRANDOM);
> -
> -
> -  goto egress;
> -
> - abort_egress:
> -  EVP_CIPHER_CTX_cleanup (&key->context);
> -  buffer_free (&key->key);
> -
> - egress:
> -  return status;
> -}
> -
> -
> -TPM_RESULT Crypto_symcrypto_encrypt (symkey_t* key,
> -                              const buffer_t* clear,
> -                              buffer_t* o_cipher) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  buffer_t iv, cipher_alias;
> -
> -  buffer_init_const (&iv, EVP_MAX_IV_LENGTH, ZERO_IV);
> -
> -  buffer_init (o_cipher,
> -              clear->size +
> -              EVP_CIPHER_iv_length(key->cipher) +
> -              EVP_CIPHER_block_size (key->cipher),
> -                                0);
> -
> -  // copy the IV into the front
> -  buffer_copy (o_cipher, &iv);
> -
> -  // make an alias into which we'll put the ciphertext
> -  buffer_init_alias (&cipher_alias, o_cipher, EVP_CIPHER_iv_length(key->cipher), 0);
> -
> -  TPMTRYRETURN( ossl_symcrypto_op (key, clear, &iv, &cipher_alias, CRYPT_ENCRYPT) );
> -
> -  // set the output size correctly
> -  o_cipher->size += cipher_alias.size;
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -
> -}
> -
> -
> -
> -TPM_RESULT Crypto_symcrypto_decrypt (symkey_t* key,
> -                              const buffer_t* cipher,
> -                              buffer_t* o_clear) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  buffer_t iv, cipher_alias;
> -
> -  // alias for the IV
> -  buffer_init_alias (&iv, cipher, 0, EVP_CIPHER_iv_length(key->cipher));
> -
> -  // make an alias to where the ciphertext is, after the IV
> -  buffer_init_alias (&cipher_alias, cipher, EVP_CIPHER_iv_length(key->cipher), 0);
> -
> -  // prepare the output buffer
> -  TPMTRYRETURN( buffer_init (o_clear,
> -                       cipher->size
> -                       - EVP_CIPHER_iv_length(key->cipher)
> -                       + EVP_CIPHER_block_size(key->cipher),
> -                       0) );
> -
> -  // and decrypt
> -  TPMTRYRETURN ( ossl_symcrypto_op (key, &cipher_alias, &iv, o_clear, CRYPT_DECRYPT) );
> -
> -  goto egress;
> -
> - abort_egress:
> -  buffer_free (o_clear);
> -
> - egress:
> -
> -  return status;
> -}
> -
> -
> -
> -TPM_RESULT Crypto_symcrypto_freekey (symkey_t * key) {
> -  buffer_memset (&key->key, 0);
> -  buffer_free (&key->key);
> -
> -  EVP_CIPHER_CTX_cleanup (&key->context);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -TPM_RESULT ossl_symcrypto_op (symkey_t* key,
> -                              const buffer_t* in,
> -                              const buffer_t* iv,
> -                              buffer_t * out,
> -                              crypt_op_type_t optype) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  int inlen, outlen;
> -  tpm_size_t running;
> -
> -  if ( ! EVP_CipherInit_ex (&key->context,
> -                           key->cipher, NULL, key->key.bytes, iv->bytes,
> -                           optype == CRYPT_ENCRYPT ? 1 : 0) )
> -    ERRORDIE (TPM_FAIL);
> -
> -
> -
> -  inlen = in->size;
> -
> -  outlen  = 0;
> -  running = 0;
> -
> -
> -  if ( ! EVP_CipherUpdate (&key->context, out->bytes, &outlen, in->bytes, inlen) )
> -    ERRORDIE (TPM_FAIL);
> -
> -  running += outlen;
> -
> -  if ( ! EVP_CipherFinal_ex (&key->context, out->bytes + running, &outlen) )
> -    ERRORDIE (TPM_FAIL);
> -
> -  running += outlen;
> -
> -  out->size = running;
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/crypto/sym_crypto.h b/tools/vtpm_manager/crypto/sym_crypto.h
> deleted file mode 100644
> index 7fb59a8..0000000
> --- a/tools/vtpm_manager/crypto/sym_crypto.h
> +++ /dev/null
> @@ -1,72 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// sym_crypto.h
> -//
> -//     Symmetric Crypto
> -//
> -// ==================================================================
> -
> -#ifndef _SYM_CRYPTO_H
> -#define _SYM_CRYPTO_H
> -
> -#include <openssl/evp.h>
> -#include "buffer.h"
> -
> -typedef struct symkey_t {
> -  buffer_t key;
> -
> -  EVP_CIPHER_CTX context;
> -  const EVP_CIPHER * cipher;
> -} symkey_t;
> -
> -extern const EVP_CIPHER * SYM_CIPHER;
> -
> -TPM_RESULT Crypto_symcrypto_genkey (symkey_t * key);
> -
> -TPM_RESULT Crypto_symcrypto_initkey (symkey_t * key, const buffer_t* keybits);
> -
> -
> -// these functions will allocate their output buffers
> -TPM_RESULT Crypto_symcrypto_encrypt (symkey_t* key,
> -                              const buffer_t* clear,
> -                              buffer_t* o_cipher);
> -
> -TPM_RESULT Crypto_symcrypto_decrypt (symkey_t* key,
> -                              const buffer_t* cipher,
> -                              buffer_t* o_clear);
> -
> -// only free the internal parts, not the 'key' ptr
> -TPM_RESULT Crypto_symcrypto_freekey (symkey_t * key);
> -
> -#endif /* _SYM_CRYPTO_H */
> diff --git a/tools/vtpm_manager/manager/Makefile b/tools/vtpm_manager/manager/Makefile
> deleted file mode 100644
> index a33c18a..0000000
> --- a/tools/vtpm_manager/manager/Makefile
> +++ /dev/null
> @@ -1,38 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -BIN            = vtpm_managerd
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIN)
> -
> -.PHONY: install
> -install: build
> -       if [ ! -d "$(DESTDIR)/var/vtpm/fifos" ]; \
> -               then mkdir -p $(DESTDIR)/var/vtpm/fifos; \
> -       fi
> -       if [ ! -d "$(DESTDIR)/var/vtpm/socks" ]; \
> -               then mkdir -p $(DESTDIR)/var/vtpm/socks; \
> -       fi
> -       $(INSTALL_PROG) $(BIN) $(DESTDIR)$(BINDIR)
> -
> -.PHONY: clean
> -clean:
> -       rm -f $(BIN)
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIN): $(OBJS)
> -       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
> -
> -# libraries
> -LIBS += ../tcs/libTCS.a ../util/libTCGUtils.a ../crypto/libtcpaCrypto.a
> -LIBS += -lcrypto $(PTHREAD_LIBS) -lm
> -CFLAGS += $(PTHREAD_CFLAGS)
> -LDFLAGS += $(PTHREAD_LDFLAGS)
> diff --git a/tools/vtpm_manager/manager/dmictl.c b/tools/vtpm_manager/manager/dmictl.c
> deleted file mode 100644
> index 5c3cf7e..0000000
> --- a/tools/vtpm_manager/manager/dmictl.c
> +++ /dev/null
> @@ -1,266 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -//   dmictl.c
> -//
> -//     Functions for creating and destroying DMIs
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <string.h>
> -
> -#include "vtpmpriv.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -#include "vtpm_ipc.h"
> -
> -#define TPM_EMULATOR_PATH "/usr/bin/vtpmd"
> -
> -// if dmi_res is non-null, then return a pointer to new object.
> -// Also, this does not fill in the measurements. They should be filled by
> -// design dependent code or saveNVM
> -TPM_RESULT init_dmi(UINT32 dmi_id, BYTE dmi_type, VTPM_DMI_RESOURCE **dmi_res) {
> -
> -  TPM_RESULT status=TPM_SUCCESS;
> -  VTPM_DMI_RESOURCE *new_dmi=NULL;
> -  UINT32 *dmi_id_key=NULL;
> -
> -  if ((new_dmi = (VTPM_DMI_RESOURCE *) malloc (sizeof(VTPM_DMI_RESOURCE))) == NULL) {
> -      status = TPM_RESOURCES;
> -      goto abort_egress;
> -  }
> -  memset(new_dmi, 0, sizeof(VTPM_DMI_RESOURCE));
> -  new_dmi->dmi_id = dmi_id;
> -  new_dmi->dmi_type = dmi_type;
> -  new_dmi->connected = FALSE;
> -  new_dmi->TCSContext = 0;
> -
> -  new_dmi->NVMLocation = (char *) malloc(11 + strlen(DMI_NVM_FILE));
> -  sprintf(new_dmi->NVMLocation, DMI_NVM_FILE, (uint32_t) new_dmi->dmi_id);
> -
> -  if ((dmi_id_key = (UINT32 *) malloc (sizeof(UINT32))) == NULL) {
> -    status = TPM_RESOURCES;
> -    goto abort_egress;
> -  }
> -  *dmi_id_key = new_dmi->dmi_id;
> -
> -  // install into map
> -  if (!hashtable_insert(vtpm_globals->dmi_map, dmi_id_key, new_dmi)){
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to insert instance into table. Aborting.\n", dmi_id);
> -    status = TPM_FAIL;
> -    goto abort_egress;
> -  }
> -
> -  if (dmi_res)
> -    *dmi_res = new_dmi;
> -
> -  goto egress;
> -
> - abort_egress:
> -  if (new_dmi) {
> -    free(new_dmi->NVMLocation);
> -    free(new_dmi);
> -  }
> -  free(dmi_id_key);
> -
> - egress:
> -  return status;
> -}
> -
> -TPM_RESULT close_dmi(VTPM_DMI_RESOURCE *dmi_res) {
> -  if (dmi_res == NULL)
> -    return TPM_SUCCESS;
> -
> -  if (dmi_res->dmi_id == VTPM_CTL_DM)
> -    return(TPM_BAD_PARAMETER);
> -
> -  TCS_CloseContext(dmi_res->TCSContext);
> -  dmi_res->connected = FALSE;
> -
> -  vtpm_globals->connected_dmis--;
> -
> -  return (VTPM_Close_DMI_Extra(dmi_res) );
> -}
> -
> -TPM_RESULT VTPM_Handle_New_DMI(const buffer_t *param_buf) {
> -
> -  VTPM_DMI_RESOURCE *new_dmi=NULL;
> -  TPM_RESULT status=TPM_FAIL;
> -  BYTE dmi_type, vm_type, startup_mode;
> -  UINT32 dmi_id;
> -
> -  if (param_buf == NULL) { // Assume creation of Dom 0 control
> -    dmi_type = VTPM_TYPE_NON_MIGRATABLE;
> -    dmi_id = VTPM_CTL_DM;
> -  } else if (buffer_len(param_buf) != sizeof(BYTE) * 3  + sizeof(UINT32)) {
> -    vtpmloginfo(VTPM_LOG_VTPM, "New DMI command wrong length: %d.\n", buffer_len(param_buf));
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  } else {
> -    vtpm_globals->connected_dmis++; // Put this here so we don't count Dom0
> -    BSG_UnpackList( param_buf->bytes, 4,
> -                   BSG_TYPE_BYTE, &dmi_type,
> -                   BSG_TYPE_BYTE, &startup_mode,
> -                   BSG_TYPE_BYTE, &vm_type,
> -                   BSG_TYPE_UINT32,  &dmi_id);
> -  }
> -
> -  if ((dmi_type != VTPM_TYPE_NON_MIGRATABLE) && (dmi_type != VTPM_TYPE_MIGRATABLE)) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Creation of VTPM with illegal type.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  new_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> -  if (new_dmi == NULL) {
> -    vtpmloginfo(VTPM_LOG_VTPM, "Creating new DMI instance %d attached.\n", dmi_id );
> -    // Brand New DMI. Initialize the persistent pieces
> -    TPMTRYRETURN(init_dmi(dmi_id, dmi_type, &new_dmi) );
> -  } else
> -    vtpmloginfo(VTPM_LOG_VTPM, "Re-attaching DMI instance %d.\n", dmi_id);
> -
> -  if (new_dmi->connected) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Attempt to re-attach, currently attached instance %d. Ignoring\n", dmi_id);
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  if (new_dmi->dmi_type == VTPM_TYPE_MIGRATED) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Attempt to re-attach previously migrated instance %d without recovering first. Ignoring\n", dmi_id);
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  // Initialize the Non-persistent pieces
> -  TPMTRYRETURN( TCS_OpenContext(&new_dmi->TCSContext) );
> -
> -  new_dmi->connected = TRUE;
> -
> -  // Design specific new DMI code.
> -  // Includes: create IPCs, Measuring DMI, and maybe launching DMI
> -  TPMTRYRETURN(VTPM_New_DMI_Extra(new_dmi, vm_type, startup_mode) );
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to create DMI id=%d due to status=%s. Cleaning.\n", dmi_id, tpm_get_error_name(status));
> -  close_dmi(new_dmi );
> -
> - egress:
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Close_DMI( const buffer_t *param_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_DMI_RESOURCE *dmi_res=NULL;
> -  UINT32 dmi_id;
> -
> -  if ((param_buf == NULL) || (buffer_len(param_buf) != sizeof(UINT32)) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing DMI has bad size.");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  BSG_UnpackList( param_buf->bytes, 1,
> -                 BSG_TYPE_UINT32, &dmi_id);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Closing DMI %d.\n", dmi_id);
> -
> -  dmi_res = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> -  if (dmi_res == NULL ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Trying to close nonexistent DMI.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  if (!dmi_res->connected) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing non-connected DMI.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  // Close Dmi
> -       TPMTRYRETURN(close_dmi( dmi_res ));
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Delete_DMI( const buffer_t *param_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_DMI_RESOURCE *dmi_res=NULL;
> -  UINT32 dmi_id;
> -
> -  if ((param_buf == NULL) || (buffer_len(param_buf) != sizeof(UINT32)) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing DMI has bad size.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  BSG_UnpackList( param_buf->bytes, 1,
> -                 BSG_TYPE_UINT32, &dmi_id);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Deleting DMI %d.\n", dmi_id);
> -
> -  dmi_res = (VTPM_DMI_RESOURCE *) hashtable_remove(vtpm_globals->dmi_map, &dmi_id);
> -  if (dmi_res == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing non-existent DMI.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  //vtpm scripts delete file dmi_res->NVMLocation for us
> -
> -  // Close DMI first
> -  TPMTRYRETURN(close_dmi( dmi_res ));
> -  free ( dmi_res );
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/manager/migration.c b/tools/vtpm_manager/manager/migration.c
> deleted file mode 100644
> index 54da708..0000000
> --- a/tools/vtpm_manager/manager/migration.c
> +++ /dev/null
> @@ -1,307 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -//   dmictl.c
> -//
> -//     Functions for creating and destroying DMIs
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <string.h>
> -
> -#include "vtpmpriv.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "hashtable.h"
> -
> -TPM_RESULT VTPM_Handle_Migrate_In( const buffer_t *param_buf,
> -                                   buffer_t *result_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_DMI_RESOURCE *mig_dmi=NULL;
> -  UINT32 dmi_id;
> -  buffer_t dmi_state_abuf = NULL_BUF, enc_dmi_abuf = NULL_BUF, clear_dmi_blob = NULL_BUF;
> -
> -  if (param_buf == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Migration Out Failed due to bad parameter.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  struct pack_buf_t enc_dmi_state_pack;
> -
> -  BSG_UnpackList(param_buf->bytes, 2,
> -                 BSG_TYPE_UINT32, &dmi_id,
> -                 BSG_TPM_SIZE32_DATA, &enc_dmi_state_pack) ;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Migrating VTPM in dmi %d.\n", dmi_id);
> -
> -  mig_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> -  if (mig_dmi) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Incoming VTPM claims unavailable id: %d.\n", dmi_id);
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  /** UnBind Blob **/
> -  TPMTRYRETURN( buffer_init_alias_convert( &enc_dmi_abuf,
> -                                           enc_dmi_state_pack.size,
> -                                           enc_dmi_state_pack.data) );
> -
> -  TPMTRYRETURN( envelope_decrypt( &enc_dmi_abuf,
> -                                   vtpm_globals->manager_tcs_handle,
> -                                   vtpm_globals->storageKeyHandle,
> -                                   (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
> -                                   &clear_dmi_blob) );
> -
> -  // Create new dmi
> -  TPMTRYRETURN( init_dmi(dmi_id, VTPM_TYPE_MIGRATABLE, &mig_dmi ) );
> -
> -  /** Open Blob **/
> -  struct pack_buf_t dmi_state_pack;
> -
> -  BSG_UnpackList(clear_dmi_blob.bytes, 2,
> -                 BSG_TPM_DIGEST, &mig_dmi->DMI_measurement,
> -                 BSG_TPM_SIZE32_DATA, &dmi_state_pack);
> -
> -  TPMTRYRETURN( buffer_init_alias_convert(&dmi_state_abuf,
> -                                          dmi_state_pack.size,
> -                                          dmi_state_pack.data) );
> -
> -  TPMTRYRETURN( VTPM_Handle_Save_NVM(mig_dmi, &dmi_state_abuf, NULL ) );
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Migration IN of instance %d failed because of %s.\n", dmi_id, tpm_get_error_name(status) );
> -
> - egress:
> -  buffer_free(&clear_dmi_blob);
> -  buffer_free(&dmi_state_abuf);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Migrate_Out( const buffer_t *param_buf,
> -                                    buffer_t *result_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_DMI_RESOURCE *mig_dmi;
> -  UINT32 dmi_id;
> -  VTPM_MIGKEY_LIST *last_mig, *mig_key;
> -  buffer_t dmi_state=NULL_BUF, clear_dmi_blob=NULL_BUF;
> -
> -  if (param_buf == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Migration Out Failed due to bad parameter.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  struct pack_buf_t name_pack;
> -
> -  BSG_UnpackList( param_buf->bytes, 2,
> -                  BSG_TYPE_UINT32, &dmi_id,
> -                  BSG_TPM_SIZE32_DATA, &name_pack);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Migrating out dmi %d.\n", dmi_id);
> -
> -  mig_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> -  if (mig_dmi == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Non-existent VTPM instance (%d) in migration.\n", dmi_id );
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  if (mig_dmi->dmi_type != VTPM_TYPE_MIGRATABLE) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Bad VTPM type (%d) in migration of instance (%d).\n", mig_dmi->dmi_type, dmi_id );
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  /** Find migration key for dest **/
> -  last_mig = NULL;
> -  mig_key = vtpm_globals->mig_keys;
> -  while (mig_key != NULL) {
> -    if (mig_key->name_size == name_pack.size)
> -      if (memcmp(mig_key->name, name_pack.data, name_pack.size) == 0) {
> -        break;
> -      }
> -
> -    last_mig = mig_key;
> -    mig_key = mig_key->next;
> -  }
> -
> -  if (!mig_key) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unknown Migration target host.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  /** Mark vtpm as migrated **/
> -  mig_dmi->dmi_type = VTPM_TYPE_MIGRATED;
> -
> -  /** Build Blob **/
> -  TPMTRYRETURN( VTPM_Handle_Load_NVM(mig_dmi, NULL, &dmi_state) );
> -
> -  TPMTRYRETURN( buffer_init(&clear_dmi_blob, sizeof(TPM_DIGEST) + sizeof(UINT32) + buffer_len(&dmi_state), NULL ) );
> -
> -  struct pack_constbuf_t dmi_state_pack;
> -
> -  dmi_state_pack.size = buffer_len(&dmi_state);
> -  dmi_state_pack.data = dmi_state.bytes;
> -
> -  BSG_PackList(clear_dmi_blob.bytes, 2,
> -               BSG_TPM_DIGEST, &mig_dmi->DMI_measurement,
> -               BSG_TPM_SIZE32_DATA, &dmi_state_pack);
> -
> -  /** Bind Blob **/
> -  TPMTRYRETURN( envelope_encrypt( &clear_dmi_blob,
> -                                  &mig_key->key,
> -                                  result_buf) );
> -
> -  if (last_mig)
> -    last_mig->next = mig_key->next;
> -  else
> -    vtpm_globals->mig_keys = mig_key->next;
> -
> -  free(mig_key->name);
> -  free(mig_key);
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Migration OUT of instance %d failed because of %s. Migratoin recovery may be needed.\n", dmi_id, tpm_get_error_name(status) );
> -
> -    //TODO: Create and implement a policy for what happens to mig_key on failed migrations.
> -
> - egress:
> -
> -  buffer_free(&clear_dmi_blob);
> -  buffer_free(&dmi_state);
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTPM_Handle_Get_Migration_key( const buffer_t *param_buf,
> -                                          buffer_t *result_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Getting Migration Public Key.\n");
> -
> -  struct pack_buf_t pubkey_exp_pack, pubkey_mod_pack;
> -  TPM_KEY mig_key;
> -
> -  // Unpack/return key structure
> -  BSG_Unpack(BSG_TPM_KEY, vtpm_globals->storageKeyWrap.bytes , &mig_key);
> -  TPM_RSA_KEY_PARMS rsaKeyParms;
> -
> -  BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
> -               mig_key.algorithmParms.parms,
> -               &rsaKeyParms);
> -
> -  pubkey_exp_pack.size = rsaKeyParms.exponentSize;
> -  pubkey_exp_pack.data = rsaKeyParms.exponent;
> -  pubkey_mod_pack.size = mig_key.pubKey.keyLength;
> -  pubkey_mod_pack.data = mig_key.pubKey.key;
> -
> -  TPMTRYRETURN( buffer_init( result_buf, 2*sizeof(UINT32) +
> -                                         pubkey_exp_pack.size +
> -                                         pubkey_mod_pack.size, NULL ) );
> -
> -  BSG_PackList( result_buf->bytes, 2,
> -                  BSG_TPM_SIZE32_DATA, &pubkey_exp_pack,
> -                  BSG_TPM_SIZE32_DATA, &pubkey_mod_pack);
> -
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Get Migration Key failed because of %s.\n", tpm_get_error_name(status) );
> - egress:
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Load_Migration_key( const buffer_t *param_buf,
> -                                           buffer_t *result_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_MIGKEY_LIST *mig_key;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Loading Migration Public Key.\n");
> -
> -  //FIXME: Review all uses of unpacking pack_buf_t and ensure free.
> -  //FIXME: Review all declarations/initializations of buffer_t that could have a goto that skips them and then tries to free them
> -
> -  struct pack_buf_t name_pack, pubkey_exp_pack, pubkey_mod_pack;
> -
> -  //FIXME: scan list and verify name is not already in the list
> -
> -  BSG_UnpackList( param_buf->bytes, 3,
> -                  BSG_TPM_SIZE32_DATA, &name_pack,
> -                  BSG_TPM_SIZE32_DATA, &pubkey_exp_pack,
> -                  BSG_TPM_SIZE32_DATA, &pubkey_mod_pack);
> -
> -  //TODO: Maintain a persistent list for pub_keys.
> -  //TODO: Verify pub_key is trusted
> -
> -  mig_key = (VTPM_MIGKEY_LIST *) malloc(sizeof(VTPM_MIGKEY_LIST));
> -  memset(mig_key, 0, sizeof(VTPM_MIGKEY_LIST) );
> -  mig_key->name_size = name_pack.size;
> -  mig_key->name = name_pack.data;
> -
> -  mig_key->key.encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
> -  Crypto_RSABuildCryptoInfoPublic( pubkey_exp_pack.size,
> -                                   pubkey_exp_pack.data,
> -                                   pubkey_mod_pack.size,
> -                                   pubkey_mod_pack.data,
> -                                   &mig_key->key);
> -
> -
> -  mig_key->next = vtpm_globals->mig_keys;
> -  vtpm_globals->mig_keys = mig_key;
> -
> -  // free(name_pack.data); Do not free. data is now part of mig_key.
> -  free(pubkey_exp_pack.data);
> -  free(pubkey_mod_pack.data);
> -
> -  return TPM_SUCCESS;
> -}
> diff --git a/tools/vtpm_manager/manager/securestorage.c b/tools/vtpm_manager/manager/securestorage.c
> deleted file mode 100644
> index d5e6ffd..0000000
> --- a/tools/vtpm_manager/manager/securestorage.c
> +++ /dev/null
> @@ -1,512 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// securestorage.c
> -//
> -//  Functions regarding securely storing DMI secrets.
> -//
> -// ==================================================================
> -
> -#include <sys/types.h>
> -#include <sys/stat.h>
> -#include <fcntl.h>
> -#include <unistd.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "vtsp.h"
> -#include "bsg.h"
> -#include "crypto.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -#include "buffer.h"
> -#include "log.h"
> -
> -TPM_RESULT envelope_encrypt(const buffer_t     *inbuf,
> -                            CRYPTO_INFO        *asymkey,
> -                            buffer_t           *sealed_data) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -  symkey_t    symkey;
> -  buffer_t    data_cipher = NULL_BUF,
> -              symkey_cipher = NULL_BUF;
> -
> -  UINT32 i;
> -  struct pack_constbuf_t symkey_cipher32, data_cipher32;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Enveloping Input[%d]: 0x", buffer_len(inbuf));
> -  for (i=0; i< buffer_len(inbuf); i++)
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", inbuf->bytes[i]);
> -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -  // Generate a sym key and encrypt state with it
> -  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_symcrypto_genkey (&symkey) );
> -  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_symcrypto_encrypt (&symkey, inbuf, &data_cipher) );
> -
> -  // Encrypt symmetric key
> -  TPMTRYRETURN( VTSP_Bind(    asymkey,
> -                             &symkey.key,
> -                             &symkey_cipher) );
> -
> -  // Create output blob: symkey_size + symkey_cipher + state_cipher_size + state_cipher
> -
> -  symkey_cipher32.size = buffer_len(&symkey_cipher);
> -  symkey_cipher32.data = symkey_cipher.bytes;
> -
> -  data_cipher32.size = buffer_len(&data_cipher);
> -  data_cipher32.data = data_cipher.bytes;
> -
> -  TPMTRYRETURN( buffer_init(sealed_data, 2 * sizeof(UINT32) + symkey_cipher32.size + data_cipher32.size, NULL));
> -
> -  BSG_PackList(sealed_data->bytes, 2,
> -              BSG_TPM_SIZE32_DATA, &symkey_cipher32,
> -              BSG_TPM_SIZE32_DATA, &data_cipher32);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Saved %d bytes of E(symkey) + %d bytes of E(data)\n", buffer_len(&symkey_cipher), buffer_len(&data_cipher));
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Enveloping Output[%d]: 0x", buffer_len(sealed_data));
> -  for (i=0; i< buffer_len(sealed_data); i++)
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", sealed_data->bytes[i]);
> -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to envelope encrypt\n.");
> -
> - egress:
> -
> -  buffer_free ( &data_cipher);
> -  buffer_free ( &symkey_cipher);
> -  Crypto_symcrypto_freekey (&symkey);
> -
> -  return status;
> -}
> -
> -TPM_RESULT envelope_decrypt(const buffer_t     *cipher,
> -                            TCS_CONTEXT_HANDLE TCSContext,
> -                           TPM_HANDLE         keyHandle,
> -                           const TPM_AUTHDATA *key_usage_auth,
> -                            buffer_t           *unsealed_data) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  symkey_t    symkey;
> -  buffer_t    data_cipher = NULL_BUF,
> -              symkey_clear = NULL_BUF,
> -              symkey_cipher = NULL_BUF;
> -  struct pack_buf_t symkey_cipher32, data_cipher32;
> -  int i;
> -
> -  memset(&symkey, 0, sizeof(symkey_t));
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Envelope Decrypt Input[%d]: 0x", buffer_len(cipher) );
> -  for (i=0; i< buffer_len(cipher); i++)
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cipher->bytes[i]);
> -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -  BSG_UnpackList(cipher->bytes, 2,
> -                BSG_TPM_SIZE32_DATA, &symkey_cipher32,
> -                BSG_TPM_SIZE32_DATA, &data_cipher32);
> -
> -  TPMTRYRETURN( buffer_init_alias_convert (&symkey_cipher,
> -                                          symkey_cipher32.size,
> -                                          symkey_cipher32.data) );
> -
> -  TPMTRYRETURN( buffer_init_alias_convert (&data_cipher,
> -                                          data_cipher32.size,
> -                                          data_cipher32.data) );
> -
> -  // Decrypt Symmetric Key
> -  TPMTRYRETURN( VTSP_Unbind(  TCSContext,
> -                             keyHandle,
> -                             &symkey_cipher,
> -                             key_usage_auth,
> -                             &symkey_clear,
> -                             &(vtpm_globals->keyAuth) ) );
> -
> -  // create symmetric key using saved bits
> -  Crypto_symcrypto_initkey (&symkey, &symkey_clear);
> -
> -  // Decrypt State
> -  TPMTRY(TPM_DECRYPT_ERROR, Crypto_symcrypto_decrypt (&symkey, &data_cipher, unsealed_data) );
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Envelope Decrypte Output[%d]: 0x", buffer_len(unsealed_data));
> -  for (i=0; i< buffer_len(unsealed_data); i++)
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", unsealed_data->bytes[i]);
> -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to envelope decrypt data\n.");
> -
> - egress:
> -  buffer_free ( &data_cipher);
> -  buffer_free ( &symkey_clear);
> -  buffer_free ( &symkey_cipher);
> -  Crypto_symcrypto_freekey (&symkey);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Save_NVM(VTPM_DMI_RESOURCE *myDMI,
> -                               const buffer_t *inbuf,
> -                               buffer_t *outbuf) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  int fh;
> -  long bytes_written;
> -  buffer_t sealed_NVM = NULL_BUF;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Saving %d bytes of NVM.\n", buffer_len(inbuf));
> -
> -  TPMTRYRETURN( envelope_encrypt(inbuf,
> -                                 &vtpm_globals->storageKey,
> -                                 &sealed_NVM) );
> -
> -  // Write sealed blob off disk from NVMLocation
> -  // TODO: How to properly return from these. Do we care if we return failure
> -  //       after writing the file? We can't get the old one back.
> -  // TODO: Backup old file and try and recover that way.
> -  fh = open(myDMI->NVMLocation, O_WRONLY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
> -  if ( (bytes_written = write(fh, sealed_NVM.bytes, buffer_len(&sealed_NVM) ) != (long) buffer_len(&sealed_NVM))) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "We just overwrote a DMI_NVM and failed to finish. %ld/%ld bytes.\n", bytes_written, (long)buffer_len(&sealed_NVM));
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -  close(fh);
> -
> -  Crypto_SHA1Full (sealed_NVM.bytes, buffer_len(&sealed_NVM), (BYTE *) &myDMI->NVM_measurement);
> -
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to save NVM\n.");
> -
> - egress:
> -  buffer_free(&sealed_NVM);
> -  return status;
> -}
> -
> -
> -/* Expected Params: inbuf = null, outbuf = sealed blob size, sealed blob.*/
> -TPM_RESULT VTPM_Handle_Load_NVM(VTPM_DMI_RESOURCE *myDMI,
> -                               const buffer_t    *inbuf,
> -                               buffer_t          *outbuf) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  buffer_t sealed_NVM = NULL_BUF;
> -  long fh_size;
> -  int fh, stat_ret, i;
> -  struct stat file_stat;
> -  TPM_DIGEST sealedNVMHash;
> -
> -  if (myDMI->NVMLocation == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to load NVM because the file name NULL.\n");
> -    status = TPM_AUTHFAIL;
> -    goto abort_egress;
> -  }
> -
> -  //Read sealed blob off disk from NVMLocation
> -  fh = open(myDMI->NVMLocation, O_RDONLY);
> -  stat_ret = fstat(fh, &file_stat);
> -  if (stat_ret == 0)
> -    fh_size = file_stat.st_size;
> -  else {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  TPMTRYRETURN( buffer_init( &sealed_NVM, fh_size, NULL) );
> -  if (read(fh, sealed_NVM.bytes, buffer_len(&sealed_NVM)) != fh_size) {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -  close(fh);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Load_NVMing[%d],\n", buffer_len(&sealed_NVM));
> -
> -  Crypto_SHA1Full(sealed_NVM.bytes, buffer_len(&sealed_NVM), (BYTE *) &sealedNVMHash);
> -
> -  // Verify measurement of sealed blob.
> -  if (memcmp(&sealedNVMHash, &myDMI->NVM_measurement, sizeof(TPM_DIGEST)) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM LoadNVM NVM measurement check failed.\n");
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Correct hash: ");
> -    for (i=0; i< sizeof(TPM_DIGEST); i++)
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", ((BYTE*)&myDMI->NVM_measurement)[i]);
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Measured hash: ");
> -    for (i=0; i< sizeof(TPM_DIGEST); i++)
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", ((BYTE*)&sealedNVMHash)[i]);
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -    status = TPM_AUTHFAIL;
> -    goto abort_egress;
> -  }
> -
> -  TPMTRYRETURN( envelope_decrypt(&sealed_NVM,
> -                                 myDMI->TCSContext,
> -                                vtpm_globals->storageKeyHandle,
> -                                (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
> -                                 outbuf) );
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to load NVM\n.");
> -
> - egress:
> -  buffer_free( &sealed_NVM );
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTPM_SaveManagerData(void) {
> -  TPM_RESULT status=TPM_SUCCESS;
> -  int fh, dmis=-1;
> -
> -  BYTE *flat_boot_key=NULL, *flat_dmis=NULL, *flat_enc=NULL;
> -  buffer_t clear_flat_global=NULL_BUF, enc_flat_global=NULL_BUF;
> -  UINT32 storageKeySize = buffer_len(&vtpm_globals->storageKeyWrap);
> -  UINT32 bootKeySize = buffer_len(&vtpm_globals->bootKeyWrap);
> -  struct pack_buf_t storage_key_pack = {storageKeySize, vtpm_globals->storageKeyWrap.bytes};
> -  struct pack_buf_t boot_key_pack = {bootKeySize, vtpm_globals->bootKeyWrap.bytes};
> -  BYTE vtpm_manager_gen = VTPM_MANAGER_GEN;
> -
> -  struct hashtable_itr *dmi_itr;
> -  VTPM_DMI_RESOURCE *dmi_res;
> -
> -  UINT32 boot_key_size = 0, flat_dmis_size = 0;
> -
> -  // Initially fill these with buffer sizes for each data type. Later fill
> -  // in actual size, once flattened.
> -  boot_key_size =  sizeof(UINT32) +       // bootkeysize
> -                   bootKeySize;           // boot key
> -
> -  TPMTRYRETURN(buffer_init(&clear_flat_global,sizeof(BYTE) + // manager version
> -                                              3*sizeof(TPM_DIGEST) + // Auths
> -                                              sizeof(UINT32) +// storagekeysize
> -                                              storageKeySize, NULL) ); // storage key
> -
> -
> -  flat_boot_key = (BYTE *) malloc( boot_key_size );
> -  flat_enc = (BYTE *) malloc( sizeof(UINT32) );
> -
> -  boot_key_size = BSG_PackList(flat_boot_key, 1,
> -                               BSG_TPM_SIZE32_DATA, &boot_key_pack);
> -
> -  BSG_PackList(clear_flat_global.bytes, 4,
> -                BSG_TYPE_BYTE,    &vtpm_manager_gen,
> -                BSG_TPM_AUTHDATA, &vtpm_globals->owner_usage_auth,
> -                BSG_TPM_SECRET,   &vtpm_globals->storage_key_usage_auth,
> -                BSG_TPM_SIZE32_DATA, &storage_key_pack);
> -
> -  TPMTRYRETURN(envelope_encrypt(&clear_flat_global,
> -                                &vtpm_globals->bootKey,
> -                                &enc_flat_global) );
> -
> -  BSG_PackConst(buffer_len(&enc_flat_global), 4, flat_enc);
> -
> -  // Per DMI values to be saved (if any exit)
> -  if (hashtable_count(vtpm_globals->dmi_map) > 1) {
> -
> -    flat_dmis = (BYTE *) malloc(
> -                     (hashtable_count(vtpm_globals->dmi_map) - 1) * // num DMIS (-1 for Dom0)
> -                     (sizeof(UINT32) +sizeof(BYTE) + 2*sizeof(TPM_DIGEST)) ); // Per DMI info
> -
> -    dmi_itr = hashtable_iterator(vtpm_globals->dmi_map);
> -    do {
> -      dmi_res = (VTPM_DMI_RESOURCE *) hashtable_iterator_value(dmi_itr);
> -      dmis++;
> -
> -      // No need to save dmi0.
> -      if (dmi_res->dmi_id == 0)
> -        continue;
> -
> -
> -      flat_dmis_size += BSG_PackList( flat_dmis + flat_dmis_size, 4,
> -                                        BSG_TYPE_UINT32, &dmi_res->dmi_id,
> -                                        BSG_TYPE_BYTE, &dmi_res->dmi_type,
> -                                        BSG_TPM_DIGEST, &dmi_res->NVM_measurement,
> -                                        BSG_TPM_DIGEST, &dmi_res->DMI_measurement);
> -
> -    } while (hashtable_iterator_advance(dmi_itr));
> -  }
> -
> -  fh = open(STATE_FILE, O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
> -  if (fh == -1) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to open %s file for write.\n", STATE_FILE);
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if ( ( write(fh, flat_boot_key, boot_key_size) != boot_key_size ) ||
> -       ( write(fh, flat_enc, sizeof(UINT32)) != sizeof(UINT32) ) ||
> -       ( write(fh, enc_flat_global.bytes, buffer_len(&enc_flat_global)) != buffer_len(&enc_flat_global) ) ||
> -       ( write(fh, flat_dmis, flat_dmis_size) != flat_dmis_size ) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to completely write service data.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> - }
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  free(flat_boot_key);
> -  free(flat_enc);
> -  buffer_free(&enc_flat_global);
> -  free(flat_dmis);
> -  close(fh);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Saved VTPM Manager state (status = %d, dmis = %d)\n", (int) status, dmis);
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_LoadManagerData(void) {
> -
> -  TPM_RESULT status=TPM_SUCCESS;
> -  int fh, stat_ret, dmis=0;
> -  long fh_size = 0, step_size;
> -  BYTE *flat_table=NULL;
> -  buffer_t  unsealed_data, enc_table_abuf;
> -  struct pack_buf_t storage_key_pack, boot_key_pack;
> -  UINT32 *dmi_id_key, enc_size;
> -  BYTE vtpm_manager_gen;
> -
> -  VTPM_DMI_RESOURCE *dmi_res;
> -  UINT32 dmi_id;
> -  BYTE dmi_type;
> -  struct stat file_stat;
> -
> -  TPM_HANDLE boot_key_handle;
> -  TPM_AUTHDATA boot_usage_auth;
> -  memset(&boot_usage_auth, 0, sizeof(TPM_AUTHDATA));
> -
> -  fh = open(STATE_FILE, O_RDONLY );
> -  stat_ret = fstat(fh, &file_stat);
> -  if (stat_ret == 0)
> -    fh_size = file_stat.st_size;
> -  else {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  flat_table = (BYTE *) malloc(fh_size);
> -
> -  if ((long) read(fh, flat_table, fh_size) != fh_size ) {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  // Read Boot Key
> -  step_size = BSG_UnpackList( flat_table, 2,
> -                              BSG_TPM_SIZE32_DATA, &boot_key_pack,
> -                              BSG_TYPE_UINT32, &enc_size);
> -
> -  TPMTRYRETURN(buffer_init(&vtpm_globals->bootKeyWrap, 0, 0) );
> -  TPMTRYRETURN(buffer_init_alias_convert(&enc_table_abuf, enc_size, flat_table + step_size) );
> -  TPMTRYRETURN(buffer_append_raw(&vtpm_globals->bootKeyWrap, boot_key_pack.size, boot_key_pack.data) );
> -
> -  //Load Boot Key
> -  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
> -                              TPM_SRK_KEYHANDLE,
> -                              &vtpm_globals->bootKeyWrap,
> -                              &SRK_AUTH,
> -                              &boot_key_handle,
> -                              &vtpm_globals->keyAuth,
> -                              &vtpm_globals->bootKey,
> -                              FALSE) );
> -
> -  TPMTRYRETURN( envelope_decrypt(&enc_table_abuf,
> -                                 vtpm_globals->manager_tcs_handle,
> -                                 boot_key_handle,
> -                                 (const TPM_AUTHDATA*) &boot_usage_auth,
> -                                 &unsealed_data) );
> -  step_size += enc_size;
> -
> -  if (*unsealed_data.bytes != VTPM_MANAGER_GEN) {
> -      // Once there is more than one gen, this will include some compatability stuff
> -      vtpmlogerror(VTPM_LOG_VTPM, "Warning: Manager Data file is gen %d, which this manager is gen %d.\n", vtpm_manager_gen, VTPM_MANAGER_GEN);
> -  }
> -
> -  // Global Values needing to be saved
> -  BSG_UnpackList( unsealed_data.bytes, 4,
> -                  BSG_TYPE_BYTE,    &vtpm_manager_gen,
> -                  BSG_TPM_AUTHDATA, &vtpm_globals->owner_usage_auth,
> -                  BSG_TPM_SECRET,   &vtpm_globals->storage_key_usage_auth,
> -                  BSG_TPM_SIZE32_DATA, &storage_key_pack);
> -
> -  TPMTRYRETURN(buffer_init(&vtpm_globals->storageKeyWrap, 0, 0) );
> -  TPMTRYRETURN(buffer_append_raw(&vtpm_globals->storageKeyWrap, storage_key_pack.size, storage_key_pack.data) );
> -
> -  // Per DMI values to be saved
> -  while ( step_size < fh_size ){
> -    if (fh_size - step_size < (long) (sizeof(UINT32) + sizeof(BYTE) + 2*sizeof(TPM_DIGEST))) {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Encountered %ld extra bytes at end of manager state.\n", fh_size-step_size);
> -      step_size = fh_size;
> -    } else {
> -      step_size += BSG_UnpackList(flat_table + step_size, 2,
> -                                 BSG_TYPE_UINT32, &dmi_id,
> -                                 BSG_TYPE_BYTE, &dmi_type);
> -
> -      //TODO: Try and gracefully recover from problems.
> -      TPMTRYRETURN(init_dmi(dmi_id, dmi_type, &dmi_res) );
> -      dmis++;
> -
> -      step_size += BSG_UnpackList(flat_table + step_size, 2,
> -                                 BSG_TPM_DIGEST, &dmi_res->NVM_measurement,
> -                                 BSG_TPM_DIGEST, &dmi_res->DMI_measurement);
> -    }
> -
> -  }
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Loaded saved state (dmis = %d).\n", dmis);
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to load service data with error = %s\n", tpm_get_error_name(status));
> - egress:
> -
> -  free(flat_table);
> -  close(fh);
> -
> -  // TODO: Could be nice and evict BootKey. (Need to add EvictKey to VTSP.
> -
> -  return status;
> -}
> -
> diff --git a/tools/vtpm_manager/manager/tpmpassthrough.c b/tools/vtpm_manager/manager/tpmpassthrough.c
> deleted file mode 100644
> index 9b1e5f8..0000000
> --- a/tools/vtpm_manager/manager/tpmpassthrough.c
> +++ /dev/null
> @@ -1,110 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tpmpassthrough.c
> -//
> -//  Functions regarding passing DMI requests to HWTPM
> -//
> -// ==================================================================
> -
> -#include "tcg.h"
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "vtsp.h"
> -#include "log.h"
> -
> -TPM_RESULT VTPM_Handle_TPM_Command( VTPM_DMI_RESOURCE *dmi,
> -                                   buffer_t *inbuf,
> -                                   buffer_t *outbuf) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE *ord;
> -
> -  ord = (TPM_COMMAND_CODE *) (inbuf->bytes + sizeof(TPM_TAG) + sizeof(UINT32));
> -
> -  switch (*ord) {
> -
> -    // Forbidden for DMI use
> -  case TPM_ORD_TakeOwnership:
> -  case TPM_ORD_ChangeAuthOwner:
> -  case TPM_ORD_DirWriteAuth:
> -  case TPM_ORD_DirRead:
> -  case TPM_ORD_AuthorizeMigrationKey:
> -  case TPM_ORD_CreateMaintenanceArchive:
> -  case TPM_ORD_LoadMaintenanceArchive:
> -  case TPM_ORD_KillMaintenanceFeature:
> -  case TPM_ORD_LoadManuMaintPub:
> -  case TPM_ORD_ReadManuMaintPub:
> -  case TPM_ORD_SelfTestFull:
> -  case TPM_ORD_SelfTestStartup:
> -  case TPM_ORD_CertifySelfTest:
> -  case TPM_ORD_ContinueSelfTest:
> -  case TPM_ORD_GetTestResult:
> -  case TPM_ORD_Reset:
> -  case TPM_ORD_OwnerClear:
> -  case TPM_ORD_DisableOwnerClear:
> -  case TPM_ORD_ForceClear:
> -  case TPM_ORD_DisableForceClear:
> -  case TPM_ORD_GetCapabilityOwner:
> -  case TPM_ORD_OwnerSetDisable:
> -  case TPM_ORD_PhysicalEnable:
> -  case TPM_ORD_PhysicalDisable:
> -  case TPM_ORD_SetOwnerInstall:
> -  case TPM_ORD_PhysicalSetDeactivated:
> -  case TPM_ORD_SetTempDeactivated:
> -  case TPM_ORD_CreateEndorsementKeyPair:
> -  case TPM_ORD_GetAuditEvent:
> -  case TPM_ORD_GetAuditEventSigned:
> -  case TPM_ORD_GetOrdinalAuditStatus:
> -  case TPM_ORD_SetOrdinalAuditStatus:
> -  case TPM_ORD_SetRedirection:
> -  case TPM_ORD_FieldUpgrade:
> -  case TSC_ORD_PhysicalPresence:
> -    status = TPM_DISABLED_CMD;
> -    goto abort_egress;
> -    break;
> -
> -  } // End ORD Switch
> -
> -  // Call TCS with command
> -
> -  TPMTRY(TPM_IOERROR, VTSP_RawTransmit( dmi->TCSContext,inbuf, outbuf) );
> -
> -  goto egress;
> -
> - abort_egress:
> -  vtpmloginfo(VTPM_LOG_VTPM, "TPM Command Failed in tpmpassthrough.\n");
> - egress:
> -
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/manager/vtpm_ipc.c b/tools/vtpm_manager/manager/vtpm_ipc.c
> deleted file mode 100644
> index 319dc83..0000000
> --- a/tools/vtpm_manager/manager/vtpm_ipc.c
> +++ /dev/null
> @@ -1,141 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_ipc.c Implements ipc routines using file io. This file can
> -// be replaced with other ipc types.
> -//
> -// ===================================================================
> -
> -#include <sys/stat.h>
> -#include "vtpm_ipc.h"
> -#include "vtpmpriv.h"
> -#include "log.h"
> -
> -int vtpm_ipc_init(vtpm_ipc_handle_t *ipc_h, char* name, int flags, BOOL create) {
> -  ipc_h->name = name;
> -  ipc_h->flags = flags;
> -  ipc_h->fh = VTPM_IPC_CLOSED;
> -
> -  if (create)
> -    return(vtpm_ipc_create(ipc_h));
> -  else
> -    return 0;
> -}
> -
> -// Create the file that needs opening. Used only for FIFOs
> -// FYI: This may cause problems in other file IO schemes. We'll see.
> -int vtpm_ipc_create(vtpm_ipc_handle_t *ipc_h) {
> -  int fh;
> -  struct stat file_info;
> -
> -  if ((!ipc_h) || (!ipc_h->name))
> -    return -1;
> -
> -  if ( stat(ipc_h->name, &file_info) == -1) {
> -    if ( mkfifo(ipc_h->name, S_IWUSR | S_IRUSR ) ) {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Failed to create fifo %s.\n", ipc_h->name);
> -      return -1;
> -    }
> -  }
> -
> -  ipc_h->fh = VTPM_IPC_CLOSED;
> -
> -  return 0;
> -}
> -
> -
> -// Read size bytes. If FH isn't open, open it.
> -int vtpm_ipc_read(vtpm_ipc_handle_t *ipc_h, vtpm_ipc_handle_t *alt_ipc_h, BYTE *bytes, UINT32 size){
> -  vtpm_ipc_handle_t *my_ipc_h;
> -  int result;
> -
> -  if (ipc_h) {
> -    my_ipc_h = ipc_h;
> -  } else {
> -    my_ipc_h = alt_ipc_h;
> -  }
> -
> -  if (my_ipc_h->fh == VTPM_IPC_CLOSED) {
> -    my_ipc_h->fh = open(my_ipc_h->name, my_ipc_h->flags);
> -  }
> -
> -  if ( my_ipc_h->fh == VTPM_IPC_CLOSED ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM ERROR: Can't open %s for reading.\n", my_ipc_h->name);
> -    return -1;
> -  }
> -
> -  result = read(my_ipc_h->fh, bytes, size);
> -  if (result < 0) {
> -    my_ipc_h->fh = VTPM_IPC_CLOSED;
> -  }
> -
> -  return (result);
> -}
> -
> -// Write size bytes. If FH isn't open, open it.
> -int vtpm_ipc_write(vtpm_ipc_handle_t *ipc_h, vtpm_ipc_handle_t *alt_ipc_h, BYTE *bytes, UINT32 size) {
> -  vtpm_ipc_handle_t *my_ipc_h;
> -  int result;
> -
> -  if (ipc_h) {
> -    my_ipc_h = ipc_h;
> -  } else {
> -    my_ipc_h = alt_ipc_h;
> -  }
> -
> -  if (my_ipc_h->fh == VTPM_IPC_CLOSED) {
> -    my_ipc_h->fh = open(my_ipc_h->name, my_ipc_h->flags);
> -  }
> -
> -  if ( my_ipc_h->fh == VTPM_IPC_CLOSED ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM ERROR: Can't open %s for writing.\n", my_ipc_h->name);
> -    return -1;
> -  }
> -
> -  result = write(my_ipc_h->fh, bytes, size);
> -  if (result < 0) {
> -    my_ipc_h->fh = VTPM_IPC_CLOSED;
> -  }
> -
> -  return (result);
> -}
> -
> -// Mark file as closed and try and close it. Errors not reported.
> -void vtpm_ipc_close(vtpm_ipc_handle_t *ipc_h) {
> -
> -  if (ipc_h) {
> -    close(ipc_h->fh);
> -    ipc_h->fh = VTPM_IPC_CLOSED;
> -  }
> -
> -}
> diff --git a/tools/vtpm_manager/manager/vtpm_ipc.h b/tools/vtpm_manager/manager/vtpm_ipc.h
> deleted file mode 100644
> index 529c4a2..0000000
> --- a/tools/vtpm_manager/manager/vtpm_ipc.h
> +++ /dev/null
> @@ -1,71 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_ipc.h Header for interprocess communication between VTPM manager
> -// and Guests or VTPMs
> -//
> -// ===================================================================
> -
> -#ifndef __VTPM_IO_H__
> -#define __VTPM_IO_H__
> -
> -#include "tcg.h"
> -
> -#define VTPM_IPC_CLOSED -1
> -
> -// Represents an (somewhat) abstracted io handle.
> -typedef struct vtpm_ipc_handle_t {
> -  int fh;              // IO handle.
> -  int flags;           // Flags for opening. This may need to become
> -                       // a void *, but for now files use an int.
> -  char *name;          // Names for debugging as well as filenames
> -                       // for file-based io.
> -} vtpm_ipc_handle_t;
> -
> -
> -int vtpm_ipc_init(vtpm_ipc_handle_t *ioh, char* name, int flags, BOOL create);
> -
> -// Create the file that needs opening. Used only for FIFOs
> -// FYI: This may cause problems in other file IO schemes. We'll see.
> -int vtpm_ipc_create(vtpm_ipc_handle_t *ioh);
> -
> -// Read size bytes. If FH isn't open, open it.
> -int vtpm_ipc_read(vtpm_ipc_handle_t *ioh, vtpm_ipc_handle_t *alt_ioh, BYTE *bytes, UINT32 size);
> -
> -// Write size bytes. If FH isn't open, open it.
> -int vtpm_ipc_write(vtpm_ipc_handle_t *ioh, vtpm_ipc_handle_t *alt_ioh, BYTE *bytes, UINT32 size);
> -
> -// Mark file as closed and try and close it. Errors not reported.
> -void vtpm_ipc_close(vtpm_ipc_handle_t *ioh);
> -
> -#endif
> diff --git a/tools/vtpm_manager/manager/vtpm_lock.c b/tools/vtpm_manager/manager/vtpm_lock.c
> deleted file mode 100644
> index e737d60..0000000
> --- a/tools/vtpm_manager/manager/vtpm_lock.c
> +++ /dev/null
> @@ -1,63 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_lock.c Provided controlled sync around access to vtpm structures
> -//
> -// ===================================================================
> -
> -#include <pthread.h>
> -#include "vtpm_lock.h"
> -
> -static pthread_rwlock_t vtpm_lock;
> -
> -void vtpm_lock_init() {
> -
> -  pthread_rwlock_init( &vtpm_lock, NULL);
> -}
> -
> -void vtpm_lock_destroy(){
> -  pthread_rwlock_destroy(&vtpm_lock);
> -}
> -
> -void vtpm_lock_rdlock(){
> -  pthread_rwlock_rdlock(&vtpm_lock);
> -}
> -
> -void vtpm_lock_wrlock(){
> -  pthread_rwlock_wrlock(&vtpm_lock);
> -}
> -
> -void vtpm_lock_unlock(){
> -  pthread_rwlock_unlock(&vtpm_lock);
> -}
> -
> diff --git a/tools/vtpm_manager/manager/vtpm_lock.h b/tools/vtpm_manager/manager/vtpm_lock.h
> deleted file mode 100644
> index 53a339d..0000000
> --- a/tools/vtpm_manager/manager/vtpm_lock.h
> +++ /dev/null
> @@ -1,48 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_lock.h Provided controlled sync around access to vtpm structures
> -//
> -// ===================================================================
> -
> -#ifndef __VTPM_LOCK_H__
> -#define __VTPM_LOCK_H__
> -
> -void vtpm_lock_init();
> -void vtpm_lock_destroy();
> -
> -void vtpm_lock_rdlock();
> -void vtpm_lock_wrlock();
> -void vtpm_lock_unlock();
> -
> -#endif
> diff --git a/tools/vtpm_manager/manager/vtpm_manager.c b/tools/vtpm_manager/manager/vtpm_manager.c
> deleted file mode 100644
> index e089f78..0000000
> --- a/tools/vtpm_manager/manager/vtpm_manager.c
> +++ /dev/null
> @@ -1,285 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_manager.c
> -//
> -//  This file will house the main logic of the VTPM Manager
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <string.h>
> -
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "vtsp.h"
> -#include "bsg.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -
> -#include "log.h"
> -#include "buffer.h"
> -
> -VTPM_GLOBALS *vtpm_globals=NULL;
> -
> -// --------------------------- Well Known Auths --------------------------
> -const TPM_AUTHDATA SRK_AUTH = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
> -                                  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
> -
> -#ifdef WELL_KNOWN_OWNER_AUTH
> -static BYTE FIXED_OWNER_AUTH[20] =  {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
> -                                  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
> -#endif
> -
> -
> -// -------------------------- Hash table functions --------------------
> -
> -static unsigned int hashfunc32(void *ky) {
> -  return (* (UINT32 *) ky);
> -}
> -
> -static int equals32(void *k1, void *k2) {
> -  return (*(UINT32 *) k1 == *(UINT32 *) k2);
> -}
> -
> -// --------------------------- Functions ------------------------------
> -
> -TPM_RESULT VTPM_Create_Manager(){
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  // Generate Auth for Owner
> -#ifdef WELL_KNOWN_OWNER_AUTH
> -  memcpy(vtpm_globals->owner_usage_auth, FIXED_OWNER_AUTH, sizeof(TPM_AUTHDATA));
> -#else
> -  Crypto_GetRandom(vtpm_globals->owner_usage_auth, sizeof(TPM_AUTHDATA) );
> -#endif
> -
> -  // Take Owership of TPM
> -  CRYPTO_INFO ek_cryptoInfo;
> -
> -  status = VTSP_ReadPubek(vtpm_globals->manager_tcs_handle, &ek_cryptoInfo);
> -
> -  // If we can read PubEK then there is no owner and we should take it.
> -  // We use the abilty to read the pubEK to flag that the TPM is owned.
> -  // FIXME: Change to just trying to take ownership and react to the status
> -  if (status == TPM_SUCCESS) {
> -    TPMTRYRETURN(VTSP_TakeOwnership(vtpm_globals->manager_tcs_handle,
> -                                   (const TPM_AUTHDATA*)&vtpm_globals->owner_usage_auth,
> -                                   &SRK_AUTH,
> -                                   &ek_cryptoInfo,
> -                                   &vtpm_globals->keyAuth));
> -
> -    TPMTRYRETURN(VTSP_DisablePubekRead(vtpm_globals->manager_tcs_handle,
> -                                       (const TPM_AUTHDATA*)&vtpm_globals->owner_usage_auth,
> -                                       &vtpm_globals->keyAuth));
> -  } else {
> -    vtpmloginfo(VTPM_LOG_VTPM, "Failed to readEK meaning TPM has an owner. Creating Keys off existing SRK.\n");
> -  }
> -
> -  // Generate storage key's auth
> -  Crypto_GetRandom(  &vtpm_globals->storage_key_usage_auth,
> -                    sizeof(TPM_AUTHDATA) );
> -
> -  TCS_AUTH osap;
> -  TPM_AUTHDATA sharedsecret;
> -
> -  TPMTRYRETURN( VTSP_OSAP(vtpm_globals->manager_tcs_handle,
> -                         TPM_ET_KEYHANDLE,
> -                         TPM_SRK_KEYHANDLE,
> -                         &SRK_AUTH,
> -                         &sharedsecret,
> -                         &osap) );
> -
> -  osap.fContinueAuthSession = FALSE;
> -
> -
> -  TPMTRYRETURN( VTSP_CreateWrapKey( vtpm_globals->manager_tcs_handle,
> -                                   TPM_KEY_BIND,
> -                                   (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
> -                                   TPM_SRK_KEYHANDLE,
> -                                   (const TPM_AUTHDATA*)&sharedsecret,
> -                                   &vtpm_globals->storageKeyWrap,
> -                                   &osap) );
> -
> -  // Generate boot key's auth
> -  TPM_AUTHDATA bootKeyWrapAuth;
> -  memset(&bootKeyWrapAuth, 0, sizeof(bootKeyWrapAuth));
> -
> -  TPMTRYRETURN( VTSP_OSAP(vtpm_globals->manager_tcs_handle,
> -                         TPM_ET_KEYHANDLE,
> -                         TPM_SRK_KEYHANDLE,
> -                         &SRK_AUTH,
> -                         &sharedsecret,
> -                         &osap) );
> -
> -  osap.fContinueAuthSession = FALSE;
> -
> -  // FIXME: This key protects the global secrets on disk. It should use TPM
> -  //        PCR bindings to limit its use to legit configurations.
> -  //        Current binds are open, implying a Trusted VM contains this code.
> -  //        If this VM is not Trusted, use measurement and PCR bindings.
> -  TPMTRYRETURN( VTSP_CreateWrapKey( vtpm_globals->manager_tcs_handle,
> -                                   TPM_KEY_BIND,
> -                                   (const TPM_AUTHDATA*)&bootKeyWrapAuth,
> -                                   TPM_SRK_KEYHANDLE,
> -                                   (const TPM_AUTHDATA*)&sharedsecret,
> -                                   &vtpm_globals->bootKeyWrap,
> -                                   &osap) );
> -
> -  // Populate CRYPTO_INFO vtpm_globals->bootKey. This does not load it into the TPM
> -  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
> -                              TPM_SRK_KEYHANDLE,
> -                              &vtpm_globals->bootKeyWrap,
> -                              NULL,
> -                              NULL,
> -                              NULL,
> -                              &vtpm_globals->bootKey,
> -                              TRUE ) );
> -
> -  TPMTRYRETURN( VTSP_SaveState(vtpm_globals->manager_tcs_handle) );
> -  goto egress;
> -
> - abort_egress:
> -  exit(1);
> -
> - egress:
> -  vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager (Status = %d).\n", status);
> -  return status;
> -
> -}
> -
> -///////////////////////////////////////////////////////////////////////////////
> -TPM_RESULT VTPM_Init_Manager() {
> -  TPM_RESULT status = TPM_FAIL, serviceStatus;
> -  BYTE *randomsead;
> -  UINT32 randomsize=256;
> -
> -  if ((vtpm_globals = (VTPM_GLOBALS *) malloc(sizeof(VTPM_GLOBALS))) == NULL){
> -    status = TPM_FAIL;
> -    goto abort_egress;
> -  }
> -  memset(vtpm_globals, 0, sizeof(VTPM_GLOBALS));
> -
> -  vtpm_globals->connected_dmis = 0;
> -
> -  if ((vtpm_globals->dmi_map = create_hashtable(10, hashfunc32, equals32)) == NULL){
> -    status = TPM_FAIL;
> -    goto abort_egress;
> -  }
> -
> -  // Create new TCS Object
> -  vtpm_globals->manager_tcs_handle = 0;
> -
> -  TPMTRYRETURN(TCS_create());
> -
> -  // Create TCS Context for service
> -  TPMTRYRETURN( TCS_OpenContext(&vtpm_globals->manager_tcs_handle ) );
> -
> -  TPMTRYRETURN( TCSP_GetRandom(vtpm_globals->manager_tcs_handle,
> -                              &randomsize,
> -                              &randomsead));
> -
> -  Crypto_Init(randomsead, randomsize);
> -  TPMTRYRETURN( TCS_FreeMemory (vtpm_globals->manager_tcs_handle, randomsead));
> -
> -  // Create OIAP session for service's authorized commands
> -  TPMTRYRETURN( VTSP_OIAP( vtpm_globals->manager_tcs_handle,
> -                          &vtpm_globals->keyAuth) );
> -  vtpm_globals->keyAuth.fContinueAuthSession = TRUE;
> -
> -  vtpm_globals->mig_keys = NULL;
> -
> -  // If fails, create new Manager.
> -  serviceStatus = VTPM_LoadManagerData();
> -  if (serviceStatus == TPM_IOERROR) {
> -    vtpmloginfo(VTPM_LOG_VTPM, "Failed to read manager file. Assuming first time initialization.\n");
> -    TPMTRYRETURN( VTPM_Create_Manager() );
> -    TPMTRYRETURN( VTPM_SaveManagerData() );
> -  } else if (serviceStatus != TPM_SUCCESS) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to read existing manager file");
> -    exit(1);
> -  }
> -
> -  //Load Storage Key
> -  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
> -                             TPM_SRK_KEYHANDLE,
> -                             &vtpm_globals->storageKeyWrap,
> -                             &SRK_AUTH,
> -                             &vtpm_globals->storageKeyHandle,
> -                             &vtpm_globals->keyAuth,
> -                             &vtpm_globals->storageKey,
> -                              FALSE ) );
> -
> -  // Create entry for Dom0 for control messages
> -  TPMTRYRETURN( VTPM_Handle_New_DMI(NULL) );
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return(status);
> -}
> -
> -///////////////////////////////////////////////////////////////////////////////
> -void VTPM_Stop_Manager() {
> -  VTPM_DMI_RESOURCE *dmi_res;
> -  struct hashtable_itr *dmi_itr;
> -
> -  // Close all the TCS contexts. TCS should evict keys based on this
> -  if (hashtable_count(vtpm_globals->dmi_map) > 0) {
> -    dmi_itr = hashtable_iterator(vtpm_globals->dmi_map);
> -    do {
> -      dmi_res = (VTPM_DMI_RESOURCE *) hashtable_iterator_value(dmi_itr);
> -      if (dmi_res->connected)
> -       close_dmi( dmi_res ); // Not really interested in return code
> -
> -    } while (hashtable_iterator_advance(dmi_itr));
> -               free (dmi_itr);
> -  }
> -
> -  if ( VTPM_SaveManagerData() != TPM_SUCCESS )
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to save manager data.\n");
> -
> -  TCS_CloseContext(vtpm_globals->manager_tcs_handle);
> -  TCS_destroy();
> -
> -  hashtable_destroy(vtpm_globals->dmi_map, 1);
> -  free(vtpm_globals);
> -
> -  Crypto_Exit();
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
> -}
> diff --git a/tools/vtpm_manager/manager/vtpm_manager.h b/tools/vtpm_manager/manager/vtpm_manager.h
> deleted file mode 100644
> index a324a8f..0000000
> --- a/tools/vtpm_manager/manager/vtpm_manager.h
> +++ /dev/null
> @@ -1,150 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_manager.h
> -//
> -//  Public Interface header for VTPM Manager
> -//
> -// ==================================================================
> -
> -#ifndef __VTPM_MANAGER_H__
> -#define __VTPM_MANAGER_H__
> -
> -#define VTPM_TAG_REQ 0x01c1
> -#define VTPM_TAG_RSP 0x01c4
> -#define COMMAND_BUFFER_SIZE 4096
> -
> -// Header sizes. Note Header MAY include the DMI
> -#define VTPM_COMMAND_HEADER_SIZE_CLT ( 2 + 4 + 4)
> -//                    sizeof(TPM_TAG + UINT32 + TPM_COMMAND_CODE)
> -#define VTPM_COMMAND_HEADER_SIZE_SRV ( 4 + VTPM_COMMAND_HEADER_SIZE_CLT )
> -//                    sizeof( UINT32 + VTPM_COMMAND_HEADER_SIZE_CLT)
> -
> -//************************ Command Codes ****************************
> -#define VTPM_ORD_BASE       0x0000
> -#define VTPM_PRIV_MASK      0x01000000 // Priviledged VTPM Command
> -#define VTPM_PRIV_BASE      (VTPM_ORD_BASE | VTPM_PRIV_MASK)
> -
> -// Non-priviledged VTPM Commands (From DMI's)
> -#define VTPM_ORD_SAVENVM      (VTPM_ORD_BASE + 1) // DMI Saves Secrets
> -#define VTPM_ORD_LOADNVM      (VTPM_ORD_BASE + 2) // DMI Loads Secrets
> -#define VTPM_ORD_TPMCOMMAND   (VTPM_ORD_BASE + 3) // DMI issues HW TPM Command
> -#define VTPM_ORD_GET_MIG_KEY  (VTPM_ORD_BASE + 4) // Get manager's migration key
> -#define VTPM_ORD_LOAD_MIG_KEY (VTPM_ORD_BASE + 5) // load dest migration key
> -
> -// Priviledged VTPM Commands (From management console)
> -#define VTPM_ORD_OPEN         (VTPM_PRIV_BASE + 1) // Creates/reopens DMI
> -#define VTPM_ORD_CLOSE        (VTPM_PRIV_BASE + 2) // Closes a DMI
> -#define VTPM_ORD_DELETE       (VTPM_PRIV_BASE + 3) // Permemently Deletes DMI
> -#define VTPM_ORD_MIGRATE_IN   (VTPM_PRIV_BASE + 4) // Load migrated VTPM
> -#define VTPM_ORD_MIGRATE_OUT  (VTPM_PRIV_BASE + 5) // migrate VTPM to dest
> -
> -//************************ Return Codes ****************************
> -#define VTPM_TYPE_PVM 1 // Paravirtualized Domain
> -#define VTPM_TYPE_HVM 2 // HVM Domain
> -
> -//************************ Return Codes ****************************
> -#define VTPM_SUCCESS               0
> -#define VTPM_FAIL                  1
> -#define VTPM_UNSUPPORTED           2
> -#define VTPM_FORBIDDEN             3
> -#define VTPM_RESTORE_CONTEXT_FAILED    4
> -#define VTPM_INVALID_REQUEST       5
> -
> -//*********************** Parameter Values *************************
> -#define VTPM_TYPE_NON_MIGRATABLE  0x00
> -#define VTPM_TYPE_MIGRATABLE      0x01
> -#define VTPM_TYPE_MIGRATED        0xFF // VTPM has been migrated.
> -                                       // VTPM can be recovered or deleted only
> -
> -/******************* Command Parameter API *************************
> -
> -VTPM Command Format
> -  dmi: 4 bytes                  // Source of message.
> -                                // WARNING: This is prepended by the channel.
> -                                // Thus it is received by VTPM Manager,
> -                                // but not sent by DMI
> -  tpm tag: 2 bytes
> -  command size: 4 bytes         // Size of command including header but not DMI
> -  ord: 4 bytes                  // Command ordinal above
> -  parameters: size - 10 bytes   // Command Parameter
> -
> -VTPM Response Format
> -  tpm tag: 2 bytes
> -  response_size: 4 bytes
> -  status: 4 bytes
> -  parameters: size - 10 bytes
> -
> -
> -VTPM_Open:
> -  Input Parameters:
> -    mig_type: 1 byte
> -    startup_mode: 1 byte // Cold Boot = 1, resume = 2, deactive = 3
> -    domain type: 1 byte
> -    instance_id: 4 bytes
> -  Output Parameters:
> -    None
> -
> -VTPM_Close
> -  Input Parameters:
> -    instance_id: 4 bytes
> -  Output Parameters:
> -    None
> -
> -VTPM_Delete
> -  Input Parameters:
> -    instance_id: 4 bytes
> -  Output Parameters:
> -    None
> -
> -VTPM_SaveNVM
> -  Input Parameters:
> -    data: n bytes (Header indicates size of data)
> -  Output Parameters:
> -    None
> -
> -VTPM_LoadNVM
> -  Input Parameters:
> -    None
> -  Output Parameters:
> -    data: n bytes (Header indicates size of data)
> -
> -VTPM_TPMCommand
> -  Input Parameters:
> -    TPM Command Byte Stream: n bytes
> -  Output Parameters:
> -    TPM Reponse Byte Stream: n bytes
> -
> -*********************************************************************/
> -
> -#endif //_VTPM_MANAGER_H_
> diff --git a/tools/vtpm_manager/manager/vtpm_manager_handler.c b/tools/vtpm_manager/manager/vtpm_manager_handler.c
> deleted file mode 100644
> index 2001074..0000000
> --- a/tools/vtpm_manager/manager/vtpm_manager_handler.c
> +++ /dev/null
> @@ -1,488 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_manager_handler.c
> -//
> -//  This file will house the main logic of the VTPM Manager
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <string.h>
> -#include <errno.h>
> -
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "vtsp.h"
> -#include "bsg.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -#include "log.h"
> -#include "buffer.h"
> -
> -#define vtpmhandlerloginfo(module,fmt,args...) vtpmloginfo (module, "[%s]: " fmt, thread_name, ##args );
> -#define vtpmhandlerloginfomore(module,fmt,args...) vtpmloginfomore (module, fmt, ##args );
> -#define vtpmhandlerlogerror(module,fmt,args...) vtpmlogerror (module, "[%s]: " fmt, thread_name, ##args );
> -
> -// ---------------------- Prototypes -------------------
> -TPM_RESULT vtpm_manager_handle_vtpm_cmd(VTPM_DMI_RESOURCE *dmi_res,
> -                                       TPM_COMMAND_CODE ord,
> -                                       buffer_t *command_buf,
> -                                       buffer_t *result_buf,
> -                                        BOOL is_priv,
> -                                        char *thread_name);
> -
> -TPM_RESULT vtpm_manager_handle_tpm_cmd(vtpm_ipc_handle_t *tx_ipc_h,
> -                                       vtpm_ipc_handle_t *rx_ipc_h,
> -                                       VTPM_DMI_RESOURCE *dmi_res,
> -                                       BYTE *cmd_header,
> -                                       buffer_t *param_buf,
> -                                       buffer_t *result_buf,
> -                                       char *thread_name);
> -
> -TPM_RESULT VTPM_Manager_Handler( vtpm_ipc_handle_t *tx_ipc_h,
> -                                 vtpm_ipc_handle_t *rx_ipc_h,
> -                                 BOOL fw_tpm,   // Forward TPM cmds?
> -                                 vtpm_ipc_handle_t *fw_tx_ipc_h,
> -                                 vtpm_ipc_handle_t *fw_rx_ipc_h,
> -                                 BOOL is_priv,
> -                                 char *thread_name) {
> -  TPM_RESULT      status =  TPM_FAIL; // Should never return
> -  UINT32          dmi, in_param_size, cmd_size, out_param_size, out_message_size, reply_size;
> -  BYTE            *cmd_header=NULL, *in_param=NULL, *out_message=NULL, *reply;
> -  buffer_t        *command_buf=NULL, *result_buf=NULL;
> -  TPM_TAG         tag;
> -  TPM_COMMAND_CODE ord;
> -  VTPM_DMI_RESOURCE *dmi_res;
> -  int  size_read, size_write, i;
> -  BOOL add_header=TRUE; // This indicates to prepend a header on result_buf before sending
> -
> -  cmd_header = (BYTE *) malloc(VTPM_COMMAND_HEADER_SIZE_SRV);
> -  command_buf = (buffer_t *) malloc(sizeof(buffer_t));
> -  result_buf = (buffer_t *) malloc(sizeof(buffer_t));
> -
> -  // ------------------------ Main Loop --------------------------------
> -  while(1) {
> -
> -    vtpmhandlerloginfo(VTPM_LOG_VTPM, "%s waiting for messages.\n", thread_name);
> -
> -    // --------------------- Read Cmd from Sender ----------------
> -
> -    // Read command header
> -    size_read = vtpm_ipc_read(rx_ipc_h, NULL, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -    if (size_read > 0) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "RECV[%d]: 0x", size_read);
> -      for (i=0; i<size_read; i++)
> -       vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s can't read from ipc. Errono = %d. Aborting... \n", thread_name, errno);
> -      goto abort_command;
> -    }
> -
> -    if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "\n");
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command shorter than normal header (%d bytes). Aborting...\n", size_read);
> -      goto abort_command;
> -    }
> -
> -    // Unpack header
> -    BSG_UnpackList(cmd_header, 4,
> -                  BSG_TYPE_UINT32, &dmi,
> -                  BSG_TPM_TAG, &tag,
> -                  BSG_TYPE_UINT32, &in_param_size,
> -                  BSG_TPM_COMMAND_CODE, &ord );
> -
> -    // Using the header info, read the parameters of the command
> -    // Note that in_param_size is in the client's context
> -    cmd_size = in_param_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> -    if (cmd_size > 0) {
> -      in_param = (BYTE *) malloc(cmd_size);
> -      size_read = vtpm_ipc_read( rx_ipc_h, NULL, in_param, cmd_size);
> -      if (size_read > 0) {
> -       for (i=0; i<size_read; i++)
> -         vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
> -
> -      } else {
> -        vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s had error reading cmd from ipc. Aborting... \n", thread_name);
> -       goto abort_command;
> -      }
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -      if (size_read < (int) cmd_size) {
> -       vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -       vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d). Aborting...\n", size_read, cmd_size);
> -       goto abort_command;
> -      }
> -    } else {
> -      in_param = NULL;
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -    }
> -
> -    // Init the buffers used to handle the command and the response
> -    if ( (buffer_init_convert(command_buf, cmd_size, in_param) != TPM_SUCCESS) ||
> -        (buffer_init(result_buf, 0, 0) != TPM_SUCCESS) ) {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Failed to setup buffers. Aborting...\n");
> -      goto abort_command;
> -    }
> -
> -    // -------------- Dispatch Commands to Handlers -----------
> -    if ((tag == VTPM_TAG_REQ) && (ord & VTPM_PRIV_MASK)) {
> -      vtpm_lock_wrlock();
> -    } else {
> -      vtpm_lock_rdlock();
> -    }
> -
> -    if ( !(dmi_res = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi)) ||
> -         (!dmi_res->connected) ) {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Attempted access to non-existent or disconnected DMI %d. Aborting...\n", dmi);
> -      status = TPM_BAD_PARAMETER;
> -      // We have no one to reply to, they don't exist.
> -      goto abort_command;
> -    }
> -
> -    if (tag == VTPM_TAG_REQ) {
> -
> -      status = vtpm_manager_handle_vtpm_cmd(dmi_res, ord, command_buf, result_buf, is_priv, thread_name);
> -
> -    } else { // This is not a VTPM Command at all.
> -      if (fw_tpm) {
> -        status = vtpm_manager_handle_tpm_cmd(fw_tx_ipc_h, fw_rx_ipc_h, dmi_res, cmd_header, command_buf, result_buf, thread_name);
> -
> -        // This means calling the DMI failed, not that the cmd failed in the DMI
> -        // Since the return will be interpretted by a TPM app, all errors are IO_ERRORs to the app
> -        if (status != TPM_SUCCESS) {
> -          status = TPM_IOERROR;
> -         goto abort_with_error;
> -        }
> -        // Unlike all other commands, forwarded commands yield a result_buf that includes the DMI's status. This
> -        // should be forwarded to the caller VM
> -        add_header = FALSE;
> -      } else {
> -        // We are not supposed to forward TPM commands at all.
> -        int i;
> -        vtpmhandlerlogerror(VTPM_LOG_VTPM, "Attempt to use unsupported direct access to TPM.\n");
> -        vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "Bad Command. dmi:%d, tag:%d, size:%d, ord:%d, Params: ", dmi, tag, in_param_size, ord);
> -        for (i=0; i<cmd_size; i++)
> -          vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
> -
> -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -        status = TPM_FAIL;
> -        goto abort_with_error;
> -     }
> -
> -    } // end else for is VTPM Command
> -
> -    // ------------------- Respond to Sender ------------------
> -
> -    // Errors while handling responses jump here to reply with error messages
> -    // NOTE: Currently there are no recoverable errors in multi-VM mode. If one
> -    //       is added to the code, this ifdef should be removed.
> -    //       Also note this is NOT referring to errors in commands, but rather
> -    //       this is about I/O errors and such.
> -#ifndef VTPM_MULTI_VM
> - abort_with_error:
> -#endif
> -
> -    if (add_header) {
> -      // Prepend VTPM header with destination DM stamped
> -      out_param_size = buffer_len(result_buf);
> -      out_message_size = VTPM_COMMAND_HEADER_SIZE_CLT + out_param_size;
> -      reply_size = VTPM_COMMAND_HEADER_SIZE_SRV + out_param_size;
> -      out_message = (BYTE *) malloc (reply_size);
> -      reply = out_message;
> -
> -      BSG_PackList(out_message, 4,
> -                  BSG_TYPE_UINT32, (BYTE *) &dmi,
> -                  BSG_TPM_TAG, (BYTE *) &tag,
> -                  BSG_TYPE_UINT32, (BYTE *) &out_message_size,
> -                  BSG_TPM_RESULT, (BYTE *) &status);
> -
> -      if (buffer_len(result_buf) > 0)
> -        memcpy(out_message + VTPM_COMMAND_HEADER_SIZE_SRV, result_buf->bytes, out_param_size);
> -      //Note: Send message + dmi_id
> -    } else {
> -      reply = result_buf->bytes;
> -      reply_size = buffer_len(result_buf);
> -    }
> -    size_write = vtpm_ipc_write(tx_ipc_h, (dmi_res ? dmi_res->tx_vtpm_ipc_h : NULL), reply, reply_size );
> -    if (size_write > 0) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT: 0x");
> -      for (i=0; i < reply_size; i++)
> -       vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", reply[i]);
> -
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s had error writing to ipc. Aborting... \n", thread_name);
> -      goto abort_command;
> -    }
> -    free(out_message); out_message=NULL;
> -
> -    if (size_write < (int)reply_size) {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s unable to write full command to ipc (%d/%d)\n", thread_name, size_write, reply_size);
> -      goto abort_command;
> -    }
> -
> -    // On certain failures an error message cannot be sent.
> -    // This marks the beginning of cleanup in preperation for the next command.
> -  abort_command:
> -    //free buffers
> -    bzero(cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -    //free(in_param); // This was converted to command_buf. No need to free
> -    buffer_free(result_buf);
> -    buffer_free(command_buf);
> -
> -    // If we have a write lock, save the manager table
> -    if ((tag == VTPM_TAG_REQ) && (ord & VTPM_PRIV_MASK) &&
> -        (VTPM_SaveManagerData() != TPM_SUCCESS) ) {
> -       vtpmhandlerlogerror(VTPM_LOG_VTPM, "ERROR: Unable to save manager data.\n");
> -    }
> -
> -    vtpm_lock_unlock();
> -    add_header = TRUE; // Reset to the default
> -  } // End while(1)
> -
> -}
> -
> -/////////////////////////////////////////////////////////////////////////
> -TPM_RESULT vtpm_manager_handle_vtpm_cmd(VTPM_DMI_RESOURCE *dmi_res,
> -                                       TPM_COMMAND_CODE ord,
> -                                       buffer_t *command_buf,
> -                                       buffer_t *result_buf,
> -                                        BOOL is_priv,
> -                                        char *thread_name) {
> -
> -  TPM_RESULT status = TPM_FAIL;
> -
> -  switch (ord) {
> -  case VTPM_ORD_SAVENVM:
> -    status= VTPM_Handle_Save_NVM(dmi_res,
> -                                 command_buf,
> -                                 result_buf);
> -    break;
> -
> -  case VTPM_ORD_LOADNVM:
> -    status= VTPM_Handle_Load_NVM(dmi_res,
> -                                 command_buf,
> -                                 result_buf);
> -    break;
> -
> -  case VTPM_ORD_TPMCOMMAND:
> -    status= VTPM_Handle_TPM_Command(dmi_res,
> -                                    command_buf,
> -                                    result_buf);
> -    break;
> -
> -  case VTPM_ORD_GET_MIG_KEY:
> -    status = VTPM_Handle_Get_Migration_key(command_buf,
> -                                           result_buf);
> -    break;
> -
> -  case VTPM_ORD_LOAD_MIG_KEY:
> -    status = VTPM_Handle_Load_Migration_key(command_buf,
> -                                           result_buf);
> -    break;
> -
> -  default:
> -    // Privileged handlers can do maintanance
> -    if (is_priv) {
> -      switch (ord) {
> -      case VTPM_ORD_OPEN:
> -        status = VTPM_Handle_New_DMI(command_buf);
> -        break;
> -
> -      case VTPM_ORD_CLOSE:
> -        status = VTPM_Handle_Close_DMI(command_buf);
> -        break;
> -
> -      case VTPM_ORD_DELETE:
> -        status = VTPM_Handle_Delete_DMI(command_buf);
> -        break;
> -
> -      case VTPM_ORD_MIGRATE_IN:
> -        status = VTPM_Handle_Migrate_In(command_buf, result_buf);
> -        break;
> -
> -      case VTPM_ORD_MIGRATE_OUT:
> -        status = VTPM_Handle_Migrate_Out(command_buf, result_buf);
> -        break;
> -
> -      default:
> -        status = TPM_BAD_ORDINAL;
> -      } // switch
> -    } else { // is priv command
> -
> -        status = TPM_BAD_ORDINAL;
> -    } // inner switch
> -  } // outer switch
> -
> -  return(status);
> -}
> -
> -/////////////////////////////////////////////////////////////////////
> -TPM_RESULT vtpm_manager_handle_tpm_cmd(vtpm_ipc_handle_t *tx_ipc_h,
> -                                       vtpm_ipc_handle_t *rx_ipc_h,
> -                                      VTPM_DMI_RESOURCE *dmi_res,
> -                                      BYTE *cmd_header,
> -                                      buffer_t *param_buf,
> -                                      buffer_t *result_buf,
> -                                       char *thread_name) {
> -
> -  TPM_RESULT status = TPM_FAIL;
> -  UINT32 dmi_dst;
> -  TPM_COMMAND_CODE ord;
> -  TPM_TAG tag_out;
> -  UINT32 dmi_cmd_size, in_param_size, adj_param_size;
> -  BYTE *dmi_cmd, *in_param;
> -  int  size_read, size_write, i;
> -
> -  //// Dom0 can't talk to the BE, so this must be a broken FE/BE or badness
> -  if (dmi_res->dmi_id == VTPM_CTL_DM) {
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Illegal use of TPM command from dom0\n");
> -    status = TPM_FAIL;
> -    goto abort_with_error;
> -  }
> -
> -  vtpmhandlerloginfo(VTPM_LOG_VTPM, "Forwarding command to DMI.\n");
> -
> -  //Forward TPM CMD stamped with dmi_id to DMI for handling
> -  if (buffer_len(param_buf)) {
> -    dmi_cmd = (BYTE *) malloc(VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf));
> -    dmi_cmd_size = VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf);
> -    memcpy(dmi_cmd, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -    memcpy(dmi_cmd + VTPM_COMMAND_HEADER_SIZE_SRV, param_buf->bytes, buffer_len(param_buf));
> -    size_write = vtpm_ipc_write(tx_ipc_h, dmi_res->tx_tpm_ipc_h, dmi_cmd, dmi_cmd_size);
> -
> -    if (size_write > 0) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT (DMI): 0x");
> -      for (i=0; i<VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf); i++) {
> -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", dmi_cmd[i]);
> -      }
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error writing to DMI. Aborting... \n");
> -      status = TPM_IOERROR;
> -      goto abort_with_error;
> -    }
> -    free(dmi_cmd);
> -  } else {
> -    dmi_cmd_size = VTPM_COMMAND_HEADER_SIZE_SRV;
> -    size_write = vtpm_ipc_write(tx_ipc_h, dmi_res->tx_tpm_ipc_h, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV );
> -    if (size_write > 0) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT (DMI): 0x");
> -      for (i=0; i<VTPM_COMMAND_HEADER_SIZE_SRV; i++)
> -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> -
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error writing to DMI. Aborting... \n");
> -      status = TPM_IOERROR;
> -      goto abort_with_error;
> -    }
> -  }
> -
> -  if (size_write != (int) dmi_cmd_size)
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Could not write entire command to DMI (%d/%d)\n", size_write, dmi_cmd_size);
> -
> -  buffer_free(param_buf);
> -
> -  // Read header for response to TPM command from DMI
> -  size_read = vtpm_ipc_read( rx_ipc_h, dmi_res->rx_tpm_ipc_h, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -  if (size_read > 0) {
> -    vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "RECV (DMI): 0x");
> -    for (i=0; i<size_read; i++)
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> -
> -  } else {
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error reading from DMI. Aborting... \n");
> -    status = TPM_IOERROR;
> -    goto abort_with_error;
> -  }
> -
> -  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command from DMI shorter than normal header. Aborting...\n");
> -    status = TPM_IOERROR;
> -    goto abort_with_error;
> -  }
> -
> -  // Unpack response from DMI for TPM command
> -  BSG_UnpackList(cmd_header, 4,
> -                 BSG_TYPE_UINT32, &dmi_dst,
> -                 BSG_TPM_TAG, &tag_out,
> -                 BSG_TYPE_UINT32, &in_param_size,
> -                 BSG_TPM_COMMAND_CODE, &status );
> -
> -  // If response has parameters, read them.
> -  // Note that in_param_size is in the client's context
> -  adj_param_size = in_param_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> -  if (adj_param_size > 0) {
> -    in_param = (BYTE *) malloc(adj_param_size);
> -    size_read = vtpm_ipc_read(rx_ipc_h, dmi_res->rx_tpm_ipc_h, in_param, adj_param_size);
> -    if (size_read > 0) {
> -      for (i=0; i<size_read; i++)
> -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
> -
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error reading from BE. Aborting... \n");
> -      goto abort_with_error;
> -    }
> -    vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
> -
> -    if (size_read < (int)adj_param_size) {
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command read(%d) from DMI is shorter than header indicates(%d). Aborting...\n", size_read, adj_param_size);
> -      status = TPM_IOERROR;
> -      goto abort_with_error;
> -    }
> -  } else {
> -    in_param = NULL;
> -    vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
> -  }
> -
> -  if ( (buffer_init(result_buf, VTPM_COMMAND_HEADER_SIZE_SRV, cmd_header) != TPM_SUCCESS) ||
> -       (buffer_append_raw(result_buf, adj_param_size, in_param) != TPM_SUCCESS) ) {
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Failed to setup buffers. Aborting...\n");
> -    status = TPM_FAIL;
> -    goto abort_with_error;
> -  }
> -
> -  vtpmhandlerloginfo(VTPM_LOG_VTPM, "Sending DMI's response to guest.\n");
> -
> -  status = TPM_SUCCESS;
> -
> - abort_with_error:
> -
> -  return status;
> -}
> -
> diff --git a/tools/vtpm_manager/manager/vtpmd.c b/tools/vtpm_manager/manager/vtpmd.c
> deleted file mode 100644
> index cf58ba3..0000000
> --- a/tools/vtpm_manager/manager/vtpmd.c
> +++ /dev/null
> @@ -1,371 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpmd.c
> -//
> -//  Application
> -//
> -// ===================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <sys/types.h>
> -#include <sys/stat.h>
> -#include <fcntl.h>
> -#include <signal.h>
> -#include <string.h>
> -#include <pthread.h>
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "tcg.h"
> -#include "log.h"
> -#include "vtpm_ipc.h"
> -
> -#define TPM_EMULATOR_PATH "/usr/bin/vtpmd"
> -
> -#define VTPM_BE_FNAME          "/dev/vtpm"
> -#define VTPM_DUMMY_TX_BE_FNAME "/var/vtpm/fifos/dummy_out.fifo"
> -#define VTPM_DUMMY_RX_BE_FNAME "/var/vtpm/fifos/dummy_in.fifo"
> -#define VTPM_TX_TPM_FNAME      "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
> -#define VTPM_RX_TPM_FNAME      "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
> -#define VTPM_TX_VTPM_FNAME     "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
> -#define VTPM_RX_VTPM_FNAME     "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
> -#define VTPM_TX_HP_FNAME       "/var/vtpm/fifos/to_console.fifo"
> -#define VTPM_RX_HP_FNAME       "/var/vtpm/fifos/from_console.fifo"
> -
> -#define VTPM_TYPE_PVM_STRING "pvm"
> -#define VTPM_TYPE_HVM_STRING "hvm"
> -
> -struct vtpm_thread_params_s {
> -  vtpm_ipc_handle_t *tx_ipc_h;
> -  vtpm_ipc_handle_t *rx_ipc_h;
> -  BOOL fw_tpm;
> -  vtpm_ipc_handle_t *fw_tx_ipc_h;
> -  vtpm_ipc_handle_t *fw_rx_ipc_h;
> -  BOOL is_priv;
> -  char *thread_name;
> -};
> -
> -// This is needed to all extra_close_dmi to close this to prevent a
> -// broken pipe when no DMIs are left.
> -static vtpm_ipc_handle_t *g_rx_tpm_ipc_h;
> -
> -void *vtpm_manager_thread(void *arg_void) {
> -  TPM_RESULT *status = (TPM_RESULT *) malloc(sizeof(TPM_RESULT) );
> -  struct vtpm_thread_params_s *arg = (struct vtpm_thread_params_s *) arg_void;
> -
> -  *status = VTPM_Manager_Handler(arg->tx_ipc_h, arg->rx_ipc_h,
> -                                 arg->fw_tpm, arg->fw_tx_ipc_h, arg->fw_rx_ipc_h,
> -                                 arg->is_priv, arg->thread_name);
> -
> -  return (status);
> -}
> -
> -
> -void signal_handler(int reason) {
> -  if (pthread_equal(pthread_self(), vtpm_globals->master_pid)) {
> -    vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager shutting down for signal %d.\n", reason);
> -  } else {
> -    // For old Linux Thread machines, signals are delivered to each thread. Deal with them.
> -    vtpmloginfo(VTPM_LOG_VTPM, "Child shutting down\n");
> -    pthread_exit(NULL);
> -  }
> -
> -  VTPM_Stop_Manager();
> -  exit(-1);
> -}
> -
> -struct sigaction ctl_c_handler;
> -
> -TPM_RESULT VTPM_New_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res, BYTE vm_type, BYTE startup_mode) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  int fh;
> -  char dmi_id_str[11]; // UINT32s are up to 10 digits + NULL
> -  char *tx_vtpm_name, *tx_tpm_name, *vm_type_string;
> -  struct stat file_info;
> -
> -  if (dmi_res->dmi_id == VTPM_CTL_DM) {
> -    dmi_res->tx_tpm_ipc_h = NULL;
> -    dmi_res->rx_tpm_ipc_h = NULL;
> -    dmi_res->tx_vtpm_ipc_h = NULL;
> -    dmi_res->rx_vtpm_ipc_h = NULL;
> -  } else {
> -    // Create a pair of fifo pipes
> -    dmi_res->rx_tpm_ipc_h = NULL;
> -    dmi_res->rx_vtpm_ipc_h = NULL;
> -
> -    if ( ((dmi_res->tx_tpm_ipc_h = (vtpm_ipc_handle_t *) malloc (sizeof(vtpm_ipc_handle_t))) == NULL ) ||
> -         ((dmi_res->tx_vtpm_ipc_h =(vtpm_ipc_handle_t *) malloc (sizeof(vtpm_ipc_handle_t))) == NULL ) ||
> -         ((tx_tpm_name = (char *) malloc(11 + strlen(VTPM_TX_TPM_FNAME))) == NULL ) ||
> -         ((tx_vtpm_name =(char *) malloc(11 + strlen(VTPM_TX_VTPM_FNAME))) == NULL) ) {
> -      status =TPM_RESOURCES;
> -      goto abort_egress;
> -    }
> -
> -    sprintf(tx_tpm_name, VTPM_TX_TPM_FNAME, (uint32_t) dmi_res->dmi_id);
> -    sprintf(tx_vtpm_name, VTPM_TX_VTPM_FNAME, (uint32_t) dmi_res->dmi_id);
> -
> -    if ( (vtpm_ipc_init(dmi_res->tx_tpm_ipc_h, tx_tpm_name, O_WRONLY | O_NONBLOCK, TRUE) != 0) ||
> -         (vtpm_ipc_init(dmi_res->tx_vtpm_ipc_h, tx_vtpm_name, O_WRONLY, TRUE) != 0) ) { //FIXME: O_NONBLOCK?
> -      status = TPM_IOERROR;
> -      goto abort_egress;
> -    }
> -
> -    // Measure DMI
> -    // FIXME: This will measure DMI. Until then use a fixed DMI_Measurement value
> -    // Also, this mechanism is specific to 1 VM architecture.
> -    /*
> -    fh = open(TPM_EMULATOR_PATH, O_RDONLY);
> -    stat_ret = fstat(fh, &file_stat);
> -    if (stat_ret == 0)
> -      dmi_size = file_stat.st_size;
> -    else {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Could not open vtpmd!!\n");
> -      status = TPM_IOERROR;
> -      goto abort_egress;
> -    }
> -    dmi_buffer
> -    */
> -    memset(&dmi_res->DMI_measurement, 0xcc, sizeof(TPM_DIGEST));
> -
> -    if (vm_type == VTPM_TYPE_PVM)
> -      vm_type_string = (BYTE *)&VTPM_TYPE_PVM_STRING;
> -    else
> -      vm_type_string = (BYTE *)&VTPM_TYPE_HVM_STRING;
> -
> -    // Launch DMI
> -    sprintf(dmi_id_str, "%d", (int) dmi_res->dmi_id);
> -#ifdef MANUAL_DM_LAUNCH
> -    vtpmlogerror(VTPM_LOG_VTPM, "Manually start VTPM with dmi=%s now.\n", dmi_id_str);
> -    dmi_res->dmi_pid = 0;
> -#else
> -    pid_t pid = fork();
> -
> -    if (pid == -1) {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Could not fork to launch vtpm\n");
> -      status = TPM_RESOURCES;
> -      goto abort_egress;
> -    } else if (pid == 0) {
> -      switch (startup_mode) {
> -      case TPM_ST_CLEAR:
> -        execl (TPM_EMULATOR_PATH, "vtpmd", "clear", vm_type_string, dmi_id_str, NULL);
> -        break;
> -      case TPM_ST_STATE:
> -        execl (TPM_EMULATOR_PATH, "vtpmd", "save", vm_type_string, dmi_id_str, NULL);
> -        break;
> -      case TPM_ST_DEACTIVATED:
> -        execl (TPM_EMULATOR_PATH, "vtpmd", "deactivated", vm_type_string, dmi_id_str, NULL);
> -        break;
> -      default:
> -        status = TPM_BAD_PARAMETER;
> -        goto abort_egress;
> -      }
> -
> -      // Returning from these at all is an error.
> -      vtpmlogerror(VTPM_LOG_VTPM, "Could not exec to launch vtpm\n");
> -    } else {
> -      dmi_res->dmi_pid = pid;
> -      vtpmloginfo(VTPM_LOG_VTPM, "Launching DMI on PID = %d\n", pid);
> -    }
> -#endif // MANUAL_DM_LAUNCH
> -
> -  } // If DMI = VTPM_CTL_DM
> -    status = TPM_SUCCESS;
> -
> -abort_egress:
> -  return (status);
> -}
> -
> -TPM_RESULT VTPM_Close_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  if (vtpm_globals->connected_dmis == 0) {
> -    // No more DMI's connected. Close fifo to prevent a broken pipe.
> -    // This is hackish. Need to think of another way.
> -    vtpm_ipc_close(g_rx_tpm_ipc_h);
> -  }
> -
> -
> -  if (dmi_res->dmi_id != VTPM_CTL_DM) {
> -    vtpm_ipc_close(dmi_res->tx_tpm_ipc_h);
> -    vtpm_ipc_close(dmi_res->tx_vtpm_ipc_h);
> -
> -    free(dmi_res->tx_tpm_ipc_h->name);
> -    free(dmi_res->tx_vtpm_ipc_h->name);
> -
> -#ifndef MANUAL_DM_LAUNCH
> -    if (dmi_res->dmi_id != VTPM_CTL_DM) {
> -      if (dmi_res->dmi_pid != 0) {
> -        vtpmloginfo(VTPM_LOG_VTPM, "Killing dmi on pid %d.\n", dmi_res->dmi_pid);
> -        if (kill(dmi_res->dmi_pid, SIGKILL) !=0) {
> -          vtpmloginfo(VTPM_LOG_VTPM, "DMI on pid %d is already dead.\n", dmi_res->dmi_pid);
> -        } else if (waitpid(dmi_res->dmi_pid, NULL, 0) != dmi_res->dmi_pid) {
> -          vtpmlogerror(VTPM_LOG_VTPM, "DMI on pid %d failed to stop.\n", dmi_res->dmi_pid);
> -          status = TPM_FAIL;
> -        }
> -      } else {
> -        vtpmlogerror(VTPM_LOG_VTPM, "Could not kill dmi because it's pid was 0.\n");
> -        status = TPM_FAIL;
> -      }
> -    }
> -#endif
> -
> -  } //endif ! dom0
> -  return status;
> -}
> -
> -
> -int main(int argc, char **argv) {
> -  vtpm_ipc_handle_t *tx_be_ipc_h, *rx_be_ipc_h, rx_tpm_ipc_h, rx_vtpm_ipc_h, tx_hp_ipc_h, rx_hp_ipc_h;
> -  struct vtpm_thread_params_s be_thread_params, dmi_thread_params, hp_thread_params;
> -  pthread_t be_thread, dmi_thread, hp_thread;
> -
> -#ifdef DUMMY_BACKEND
> -  vtpm_ipc_handle_t tx_dummy_ipc_h, rx_dummy_ipc_h;
> -#else
> -  vtpm_ipc_handle_t real_be_ipc_h;
> -#endif
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Starting VTPM.\n");
> -
> -  // -------------------- Initialize Manager -----------------
> -  if (VTPM_Init_Manager() != TPM_SUCCESS) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing vtpmd due to error during startup.\n");
> -    return -1;
> -  }
> -
> -  // -------------------- Setup Ctrl+C Handlers --------------
> -  ctl_c_handler.sa_handler = signal_handler;
> -  sigemptyset(&ctl_c_handler.sa_mask);
> -  ctl_c_handler.sa_flags = 0;
> -
> -  if (sigaction(SIGINT, &ctl_c_handler, NULL) == -1)
> -    vtpmlogerror(VTPM_LOG_VTPM, "Could not install SIGINT handler. Ctl+break will not stop manager gently.\n");
> -
> -  // For easier debuggin with gdb
> -  if (sigaction(SIGHUP, &ctl_c_handler, NULL) == -1)
> -    vtpmlogerror(VTPM_LOG_VTPM, "Could not install SIGHUP handler. Ctl+break will not stop manager gently.\n");
> -
> -  sigset_t sig_mask;
> -  sigemptyset(&sig_mask);
> -  sigaddset(&sig_mask, SIGPIPE);
> -  sigprocmask(SIG_BLOCK, &sig_mask, NULL);
> -
> -  // ------------------- Set up file ipc structures ----------
> -#ifdef DUMMY_BACKEND
> -  if ( (vtpm_ipc_init(&tx_dummy_ipc_h, VTPM_DUMMY_TX_BE_FNAME, O_RDWR, TRUE) != 0) ||
> -       (vtpm_ipc_init(&rx_dummy_ipc_h, VTPM_DUMMY_RX_BE_FNAME, O_RDWR, TRUE) != 0) ) {
> -
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to create Dummy BE FIFOs.\n");
> -    exit(-1);
> -  }
> -
> -  tx_be_ipc_h = &tx_dummy_ipc_h;
> -  rx_be_ipc_h = &rx_dummy_ipc_h;
> -#else
> -  vtpm_ipc_init(&real_be_ipc_h, VTPM_BE_FNAME, O_RDWR, FALSE);
> -
> -  tx_be_ipc_h = &real_be_ipc_h;
> -  rx_be_ipc_h = &real_be_ipc_h;
> -#endif
> -
> -  if ( (vtpm_ipc_init(&rx_tpm_ipc_h, VTPM_RX_TPM_FNAME, O_RDONLY, TRUE) != 0) ||
> -       (vtpm_ipc_init(&rx_vtpm_ipc_h, VTPM_RX_VTPM_FNAME, O_RDWR, TRUE) != 0) || //FIXME: O_RDONLY?
> -       (vtpm_ipc_init(&tx_hp_ipc_h,  VTPM_TX_HP_FNAME, O_RDWR, TRUE) != 0)    ||
> -       (vtpm_ipc_init(&rx_hp_ipc_h,  VTPM_RX_HP_FNAME, O_RDWR, TRUE) != 0) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to create initial FIFOs.\n");
> -    exit(-1);
> -  }
> -
> -  g_rx_tpm_ipc_h = &rx_tpm_ipc_h;
> -
> -  // -------------------- Set up thread params -------------
> -
> -  be_thread_params.tx_ipc_h = tx_be_ipc_h;
> -  be_thread_params.rx_ipc_h = rx_be_ipc_h;
> -  be_thread_params.fw_tpm = TRUE;
> -  be_thread_params.fw_tx_ipc_h = NULL;
> -  be_thread_params.fw_rx_ipc_h = &rx_tpm_ipc_h;
> -  be_thread_params.is_priv = FALSE;
> -  be_thread_params.thread_name = "Backend Listener";
> -
> -  dmi_thread_params.tx_ipc_h = NULL;
> -  dmi_thread_params.rx_ipc_h = &rx_vtpm_ipc_h;
> -  dmi_thread_params.fw_tpm = FALSE;
> -  dmi_thread_params.fw_tx_ipc_h = NULL;
> -  dmi_thread_params.fw_rx_ipc_h = NULL;
> -  dmi_thread_params.is_priv = FALSE;
> -  dmi_thread_params.thread_name = "VTPM Listener";
> -
> -  hp_thread_params.tx_ipc_h = &tx_hp_ipc_h;
> -  hp_thread_params.rx_ipc_h = &rx_hp_ipc_h;
> -  hp_thread_params.fw_tpm = FALSE;
> -  hp_thread_params.fw_tx_ipc_h = NULL;
> -  hp_thread_params.fw_rx_ipc_h = NULL;
> -  hp_thread_params.is_priv = TRUE;
> -  hp_thread_params.thread_name = "Hotplug Listener";
> -
> -  // --------------------- Launch Threads -----------------
> -
> -  vtpm_lock_init();
> -
> -  vtpm_globals->master_pid = pthread_self();
> -
> -  if (pthread_create(&be_thread, NULL, vtpm_manager_thread, &be_thread_params) != 0) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch BE Thread.\n");
> -    exit(-1);
> -  }
> -
> -  if (pthread_create(&dmi_thread, NULL, vtpm_manager_thread, &dmi_thread_params) != 0) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch DMI Thread.\n");
> -    exit(-1);
> -  }
> -
> -
> -  if (pthread_create(&hp_thread, NULL, vtpm_manager_thread, &hp_thread_params) != 0) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch HP Thread.\n");
> -    exit(-1);
> -  }
> -
> -  //Join the other threads until exit time.
> -  pthread_join(be_thread, NULL);
> -  pthread_join(dmi_thread, NULL);
> -  pthread_join(hp_thread, NULL);
> -
> -  vtpmlogerror(VTPM_LOG_VTPM, "VTPM Manager shut down unexpectedly.\n");
> -
> -  VTPM_Stop_Manager();
> -  vtpm_lock_destroy();
> -  return 0;
> -}
> diff --git a/tools/vtpm_manager/manager/vtpmpriv.h b/tools/vtpm_manager/manager/vtpmpriv.h
> deleted file mode 100644
> index 41e8d2d..0000000
> --- a/tools/vtpm_manager/manager/vtpmpriv.h
> +++ /dev/null
> @@ -1,186 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpmpriv.h
> -//
> -//  Structures and functions private to the manager
> -//
> -// ==================================================================
> -
> -#ifndef __VTPMPRIV_H__
> -#define __VTPMPRIV_H__
> -
> -#include "vtpm_manager.h"
> -#include "tcg.h"
> -#include "tcs.h"
> -#include "buffer.h"
> -#include "crypto.h"
> -#include "vtpm_ipc.h"
> -
> -#define VTPM_MANAGER_GEN   2     // This is incremented when the manager's table
> -                                 // is changed. It's used for backwards compatability
> -
> -#define STATE_FILE         "/var/vtpm/VTPM"
> -#define DMI_NVM_FILE       "/var/vtpm/vtpm_dm_%d.data"
> -#define VTPM_CTL_DM        0
> -
> -// ------------------------ Private Structures -----------------------
> -typedef struct VTPM_DMI_RESOURCE_T {
> -  // I/O info for Manager to talk to DMI's and controllers
> -  vtpm_ipc_handle_t      *tx_vtpm_ipc_h;    // TX VTPM Results to DMI
> -  vtpm_ipc_handle_t      *rx_vtpm_ipc_h;    // RX VTPM Commands from DMI
> -  vtpm_ipc_handle_t      *tx_tpm_ipc_h;     // TX TPM Commands to DMI
> -  vtpm_ipc_handle_t      *rx_tpm_ipc_h;     // RX TPM Results from DMI
> -
> -#ifndef VTPM_MULTI_VM
> -  pid_t                 dmi_pid;
> -#endif
> -
> -  // Non-persistent Information
> -  bool                  connected;
> -  UINT32                dmi_domain_id;
> -  TCS_CONTEXT_HANDLE    TCSContext;     // TCS Handle
> -  char                  *NVMLocation;   // NULL term string indicating location
> -                                        // of NVM.
> -  // Persistent Information about DMI
> -  UINT32                dmi_id;
> -  BYTE                  dmi_type;
> -  TPM_DIGEST            NVM_measurement;  // Equal to the SHA1 of the blob
> -  TPM_DIGEST            DMI_measurement;  // Correct measurement of the owning DMI
> -} VTPM_DMI_RESOURCE;
> -
> -typedef struct tdVTPM_MIGKEY_LIST {
> -  UINT32                name_size;
> -  BYTE                  *name; // Name of destination (IP addr, domain name, etc)
> -  CRYPTO_INFO           key;
> -  struct tdVTPM_MIGKEY_LIST *next;
> -} VTPM_MIGKEY_LIST;
> -
> -
> -typedef struct tdVTPM_GLOBALS {
> -  // Non-persistent data
> -#ifndef VTPM_MULTI_VM
> -  pid_t               master_pid;
> -#endif
> -
> -  int                 connected_dmis;     // To close guest_rx when no dmis are connected
> -
> -  struct hashtable    *dmi_map;               // Table of all DMI's known indexed by persistent instance #
> -  VTPM_MIGKEY_LIST    *mig_keys;              // Table of migration keys
> -                      // Currently keys are loaded at migration time,
> -                      // TODO: Make VTPM man store a keys persistently
> -                      //       and update script to check if key is needed
> -                      //       before fetching it.
> -
> -  TCS_CONTEXT_HANDLE  manager_tcs_handle;     // TCS Handle used by manager
> -  TPM_HANDLE          storageKeyHandle;       // Key used by persistent store
> -  CRYPTO_INFO         storageKey;             // For software encryption
> -  CRYPTO_INFO         bootKey;                // For saving table
> -  TCS_AUTH            keyAuth;                // OIAP session for storageKey
> -
> -  // Persistent Data
> -  TPM_AUTHDATA        owner_usage_auth;       // OwnerAuth of real TPM
> -  buffer_t            storageKeyWrap;         // Wrapped copy of storageKey
> -  TPM_AUTHDATA        srk_usage_auth;
> -  TPM_AUTHDATA        storage_key_usage_auth;
> -
> -  buffer_t            bootKeyWrap;            // Wrapped copy of boot key
> -
> -}VTPM_GLOBALS;
> -
> -// --------------------------- Global Values --------------------------
> -extern VTPM_GLOBALS *vtpm_globals;   // Key info and DMI states
> -extern const TPM_AUTHDATA SRK_AUTH;  // SRK Well Known Auth Value
> -
> -// ********************** VTPM Functions *************************
> -TPM_RESULT VTPM_Init_Manager(); // Start VTPM Service
> -void VTPM_Stop_Manager();  // Stop VTPM Service
> -TPM_RESULT VTPM_Manager_Handler(vtpm_ipc_handle_t *tx_ipc_h,
> -                                vtpm_ipc_handle_t *rx_ipc_h,
> -                                BOOL fw_tpm,   // Should forward TPM cmds
> -                                vtpm_ipc_handle_t *fw_tx_ipc_h,
> -                                vtpm_ipc_handle_t *fw_rx_ipc_h,
> -                                BOOL is_priv,
> -                                char *client_name);
> -
> -// ********************** Command Handler Prototypes ***********************
> -
> -TPM_RESULT VTPM_Handle_Load_NVM(       VTPM_DMI_RESOURCE *myDMI,
> -                                        const buffer_t *inbuf,
> -                                        buffer_t *outbuf);
> -
> -TPM_RESULT VTPM_Handle_Save_NVM(       VTPM_DMI_RESOURCE *myDMI,
> -                                        const buffer_t *inbuf,
> -                                        buffer_t *outbuf);
> -
> -TPM_RESULT VTPM_Handle_TPM_Command(    VTPM_DMI_RESOURCE *dmi,
> -                                        buffer_t *inbuf,
> -                                        buffer_t *outbuf);
> -
> -TPM_RESULT VTPM_Handle_New_DMI(const buffer_t *param_buf);
> -
> -TPM_RESULT VTPM_Handle_Close_DMI(const buffer_t *param_buf);
> -
> -TPM_RESULT VTPM_Handle_Delete_DMI(const buffer_t *param_buf);
> -
> -TPM_RESULT VTPM_Handle_Migrate_In( const buffer_t *param_buf,
> -                                   buffer_t *result_buf);
> -
> -TPM_RESULT VTPM_Handle_Migrate_Out ( const buffer_t *param_buf,
> -                                     buffer_t *result_buf);
> -
> -TPM_RESULT VTPM_Handle_Get_Migration_key( const buffer_t *param_buf,
> -                                          buffer_t *result_buf);
> -
> -TPM_RESULT VTPM_SaveManagerData(void);
> -TPM_RESULT VTPM_LoadManagerData(void);
> -
> -TPM_RESULT VTPM_New_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res, BYTE vm_type, BYTE startup_mode);
> -
> -TPM_RESULT VTPM_Close_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res);
> -
> -// Helper functions
> -TPM_RESULT close_dmi(VTPM_DMI_RESOURCE *dmi_res);
> -TPM_RESULT init_dmi(UINT32 dmi_id, BYTE type,  VTPM_DMI_RESOURCE **dmi_res);
> -
> -TPM_RESULT envelope_encrypt(const buffer_t     *inbuf,
> -                             CRYPTO_INFO        *asymkey,
> -                             buffer_t           *sealed_data);
> -
> -TPM_RESULT envelope_decrypt(const buffer_t     *cipher,
> -                            TCS_CONTEXT_HANDLE TCSContext,
> -                            TPM_HANDLE         keyHandle,
> -                            const TPM_AUTHDATA *key_usage_auth,
> -                            buffer_t           *unsealed_data);
> -
> -#endif // __VTPMPRIV_H__
> diff --git a/tools/vtpm_manager/manager/vtsp.c b/tools/vtpm_manager/manager/vtsp.c
> deleted file mode 100644
> index fc8a66f..0000000
> --- a/tools/vtpm_manager/manager/vtsp.c
> +++ /dev/null
> @@ -1,1042 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtsp.c
> -//
> -//  Higher level interface to TCS for use in service.
> -//
> -// ==================================================================
> -
> -#include <string.h>
> -#include "tcg.h"
> -#include "tcs.h"
> -#include "bsg.h"
> -#include "log.h"
> -#include "crypto.h"
> -#include "vtsp.h"
> -#include "buffer.h"
> -
> -#define  RSA_KEY_SIZE 0x0800
> -
> -/***********************************************************************************
> - * GenerateAuth: Generate authorization info to be sent back to application
> - *
> - * Parameters: outParamDigestText  The concatenation of output parameters to be SHA1ed
> - *    outParamDigestTextSize Size of inParamDigestText
> - *    HMACkey     Key to be used for HMACing
> - *          For OIAP use key.authUsage or PersistStore.ownerAuth
> - *          For OSAP use shared secret
> - *    pAuth     Authorization information from the application
> - *
> - * Return:  TPM_SUCCESS   Authorization data created
> - *    TPM_AUTHFAIL   Invalid (NULL) HMACkey presented for OSAP
> - *************************************************************************************/
> -TPM_RESULT GenerateAuth( /*[IN]*/ const BYTE *inParamDigestText,
> -                        /*[IN]*/ UINT32 inParamDigestTextSize,
> -                        /*[IN]*/ const TPM_SECRET *HMACkey,
> -                        /*[IN,OUT]*/ TCS_AUTH *auth) {
> -
> -  if (inParamDigestText == NULL || auth == NULL)
> -    return (TPM_AUTHFAIL);
> -  else {
> -
> -    //Generate new OddNonce
> -    Crypto_GetRandom(auth->NonceOdd.nonce, sizeof(TPM_NONCE));
> -
> -    // Create SHA1 inParamDigest
> -    TPM_DIGEST inParamDigest;
> -    Crypto_SHA1Full(inParamDigestText, inParamDigestTextSize, (BYTE *) &inParamDigest);
> -
> -    // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
> -    BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
> -
> -    BSG_PackList(   hmacText, 4,
> -                   BSG_TPM_DIGEST, &inParamDigest,
> -                   BSG_TPM_NONCE, &(auth->NonceEven),
> -                   BSG_TPM_NONCE, &(auth->NonceOdd),
> -                   BSG_TYPE_BOOL, &(auth->fContinueAuthSession) );
> -
> -    Crypto_HMAC((BYTE *) hmacText, sizeof(hmacText), (BYTE *) HMACkey, sizeof(TPM_DIGEST), (BYTE *) &(auth->HMAC));
> -
> -    return(TPM_SUCCESS);
> -
> -  }
> -}
> -
> -/***********************************************************************************
> - * VerifyAuth: Verify the authdata for a command requiring authorization
> - *
> - * Parameters: inParamDigestText  The concatenation of parameters to be SHA1ed
> - *    inParamDigestTextSize Size of inParamDigestText
> - *    authDataUsage   AuthDataUsage for the Entity being used
> - *          Key->authDataUsage or TPM_AUTH_OWNER
> - *    HMACkey     Key to be used for HMACing
> - *          For OIAP use key.authUsage or PersistStore.ownerAuth
> - *          For OSAP use NULL (It will be aquired from the Auth Session)
> - *          If unknown (default), assume OIAP
> - *    sessionAuth    A TCS_AUTH info for the session
> - *    pAuth     Authorization information from the application
> - *              hContext        If specified, on failed Auth, VerifyAuth will
> - *                                      generate a new OIAP session in place of themselves
> - *                                      destroyed session.
> - *
> - * Return:  TPM_SUCCESS   Authorization Verified
> - *    TPM_AUTHFAIL   Authorization Failed
> - *    TPM_FAIL    Failure during SHA1 routines
> - *************************************************************************************/
> -TPM_RESULT VerifyAuth( /*[IN]*/ const BYTE *outParamDigestText,
> -                      /*[IN]*/ UINT32 outParamDigestTextSize,
> -                      /*[IN]*/ const TPM_SECRET *HMACkey,
> -                      /*[IN,OUT]*/ TCS_AUTH *auth,
> -                      /*[IN]*/  TCS_CONTEXT_HANDLE hContext) {
> -  if (outParamDigestText == NULL || auth == NULL)
> -    return (TPM_AUTHFAIL);
> -
> -
> -  // Create SHA1 inParamDigest
> -  TPM_DIGEST outParamDigest;
> -  Crypto_SHA1Full(outParamDigestText, outParamDigestTextSize, (BYTE *) &outParamDigest);
> -
> -  // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
> -  TPM_DIGEST hm;
> -  BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
> -
> -  BSG_PackList(   hmacText, 4,
> -                 BSG_TPM_DIGEST, &outParamDigest,
> -                 BSG_TPM_NONCE, &(auth->NonceEven),
> -                 BSG_TPM_NONCE, &(auth->NonceOdd),
> -                 BSG_TYPE_BOOL, &(auth->fContinueAuthSession) );
> -
> -  Crypto_HMAC((BYTE *) hmacText, sizeof(hmacText),
> -             (BYTE *) HMACkey, sizeof(TPM_DIGEST), (BYTE *) &hm);
> -
> -  // Compare correct HMAC with provided one.
> -  if (memcmp (&hm, &(auth->HMAC), sizeof(TPM_DIGEST)) == 0) { // 0 indicates equality
> -    if (!auth->fContinueAuthSession)
> -      vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM by fContinue=0.\n", auth->AuthHandle);
> -
> -    return (TPM_SUCCESS);
> -  } else {
> -    // If specified, reconnect the OIAP session.
> -    // NOTE: This only works for TCS's that never have a 0 context.
> -    if (hContext) {
> -      vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM due to failure.\n", auth->AuthHandle);
> -      VTSP_OIAP( hContext, auth);
> -    }
> -    return (TPM_AUTHFAIL);
> -  }
> -}
> -
> -TPM_RESULT VTSP_OIAP(const TCS_CONTEXT_HANDLE hContext,
> -                    TCS_AUTH *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "OIAP.\n");
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPMTRYRETURN( TCSP_OIAP(hContext,
> -                         &auth->AuthHandle,
> -                         &auth->NonceEven) );
> -
> -  memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
> -  auth->fContinueAuthSession = FALSE;
> -
> -  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x opened by TPM_OIAP.\n", auth->AuthHandle);
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_OSAP(const TCS_CONTEXT_HANDLE hContext,
> -                    const TPM_ENTITY_TYPE entityType,
> -                    const UINT32 entityValue,
> -                    const TPM_AUTHDATA *usageAuth,
> -                    TPM_SECRET *sharedSecret,
> -                    TCS_AUTH *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "OSAP.\n");
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_NONCE nonceEvenOSAP, nonceOddOSAP;
> -
> -  Crypto_GetRandom((BYTE *) &nonceOddOSAP, sizeof(TPM_NONCE) );
> -
> -  TPMTRYRETURN( TCSP_OSAP(    hContext,
> -                             entityType,
> -                             entityValue,
> -                             nonceOddOSAP,
> -                             &auth->AuthHandle,
> -                             &auth->NonceEven,
> -                             &nonceEvenOSAP) );
> -
> -  // Calculating Session Secret
> -  BYTE sharedSecretText[TPM_DIGEST_SIZE * 2];
> -
> -  BSG_PackList(  sharedSecretText, 2,
> -                BSG_TPM_NONCE, &nonceEvenOSAP,
> -                BSG_TPM_NONCE, &nonceOddOSAP);
> -
> -  Crypto_HMAC(sharedSecretText, sizeof(sharedSecretText), (BYTE *) usageAuth, TPM_DIGEST_SIZE, (BYTE *) sharedSecret);
> -
> -  memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
> -  auth->fContinueAuthSession = FALSE;
> -
> -  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x opened by TPM_OSAP.\n", auth->AuthHandle);
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTSP_TerminateHandle(const TCS_CONTEXT_HANDLE hContext,
> -                                const TCS_AUTH *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Terminate Handle.\n");
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPMTRYRETURN( TCSP_TerminateHandle(hContext, auth->AuthHandle) );
> -
> -  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM_TerminateHandle.\n", auth->AuthHandle);
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTSP_ReadPubek(   const TCS_CONTEXT_HANDLE hContext,
> -                             CRYPTO_INFO *crypto_info) {
> -
> -  TPM_RESULT status;
> -  TPM_NONCE antiReplay;
> -  TPM_DIGEST   checksum;
> -  BYTE *pubEKtext;
> -  UINT32 pubEKtextsize;
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Reading Public EK.\n");
> -
> -  // GenerateAuth new nonceOdd
> -  Crypto_GetRandom(&antiReplay, sizeof(TPM_NONCE) );
> -
> -
> -  TPMTRYRETURN( TCSP_ReadPubek(  hContext,
> -                                antiReplay,
> -                                &pubEKtextsize,
> -                                &pubEKtext,
> -                                &checksum) );
> -
> -
> -  // Extract the remaining output parameters
> -  TPM_PUBKEY pubEK;
> -
> -  BSG_Unpack(BSG_TPM_PUBKEY, pubEKtext, (BYTE *) &pubEK);
> -
> -  // Build CryptoInfo for the bindingKey
> -  TPM_RSA_KEY_PARMS rsaKeyParms;
> -
> -  BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
> -            pubEK.algorithmParms.parms,
> -            &rsaKeyParms);
> -
> -  Crypto_RSABuildCryptoInfoPublic(rsaKeyParms.exponentSize,
> -                                 rsaKeyParms.exponent,
> -                                 pubEK.pubKey.keyLength,
> -                                 pubEK.pubKey.key,
> -                                 crypto_info);
> -
> -  // Destroy rsaKeyParms
> -  BSG_Destroy(BSG_TPM_RSA_KEY_PARMS, &rsaKeyParms);
> -
> -  // Set encryption scheme
> -  crypto_info->encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
> -  //crypto_info->encScheme = pubEK.algorithmParms.encScheme;
> -  crypto_info->algorithmID = pubEK.algorithmParms.algorithmID;
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_TakeOwnership(   const TCS_CONTEXT_HANDLE hContext,
> -                                 const TPM_AUTHDATA *ownerAuth,
> -                                 const TPM_AUTHDATA *srkAuth,
> -                                 CRYPTO_INFO *ek_cryptoInfo,
> -                                 TCS_AUTH *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Taking Ownership of TPM.\n");
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_TakeOwnership;
> -  TPM_PROTOCOL_ID proto_id = TPM_PID_OWNER;
> -  BYTE *new_srk;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // vars for srkpubkey parameter
> -  TPM_KEY srkPub;
> -  TPM_KEY_PARMS srkKeyInfo = {TPM_ALG_RSA, TPM_ES_RSAESOAEP_SHA1_MGF1, TPM_SS_NONE, 12, 0};
> -  BYTE srkRSAkeyInfo[12] = { 0x00, 0x00, (RSA_KEY_SIZE >> 8), 0x00,   0x00, 0x00, 0x00, 0x02,   0x00, 0x00, 0x00, 0x00};
> -  srkKeyInfo.parms = (BYTE *) &srkRSAkeyInfo;
> -
> -  struct pack_buf_t srkText;
> -
> -  //These values are accurate for an enc(AuthData).
> -  struct pack_buf_t encOwnerAuth, encSrkAuth;
> -
> -  encOwnerAuth.data = (BYTE *)malloc(sizeof(BYTE) * 256);
> -  encSrkAuth.data = (BYTE *)malloc(sizeof(BYTE) * 256);
> -
> -  if (encOwnerAuth.data == NULL || encSrkAuth.data == NULL) {
> -    vtpmloginfo(VTPM_LOG_VTSP, "Could not malloc encrypted auths.\n");
> -    status = TPM_RESOURCES;
> -    goto abort_egress;
> -  }
> -
> -  Crypto_RSAEnc(ek_cryptoInfo, sizeof(TPM_SECRET), (BYTE *) ownerAuth, &encOwnerAuth.size, encOwnerAuth.data);
> -  Crypto_RSAEnc(ek_cryptoInfo, sizeof(TPM_SECRET), (BYTE *) srkAuth, &encSrkAuth.size, encSrkAuth.data);
> -
> -
> -  // Build srk public key struct
> -  srkPub.ver = TPM_STRUCT_VER_1_1;
> -  srkPub.keyUsage = TPM_KEY_STORAGE;
> -  srkPub.keyFlags = 0x00;
> -  srkPub.authDataUsage = TPM_AUTH_ALWAYS;
> -  memcpy(&srkPub.algorithmParms, &srkKeyInfo, sizeof(TPM_KEY_PARMS));
> -  srkPub.PCRInfoSize = 0;
> -  srkPub.PCRInfo = 0;
> -  srkPub.pubKey.keyLength= 0;
> -  srkPub.encDataSize = 0;
> -
> -  srkText.data = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -  srkText.size = BSG_Pack(BSG_TPM_KEY, (BYTE *) &srkPub, srkText.data);
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 5,
> -                              BSG_TPM_COMMAND_CODE,&command,
> -                              BSG_TPM_PROTOCOL_ID, &proto_id,
> -                              BSG_TPM_SIZE32_DATA, &encOwnerAuth,
> -                              BSG_TPM_SIZE32_DATA, &encSrkAuth,
> -                              BSG_TPM_KEY, &srkPub);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize, ownerAuth, auth) );
> -
> -  new_srk = srkText.data;
> -  TPMTRYRETURN( TCSP_TakeOwnership ( hContext,
> -                                    proto_id,
> -                                    encOwnerAuth.size,
> -                                    encOwnerAuth.data,
> -                                    encSrkAuth.size,
> -                                    encSrkAuth.data,
> -                                    &srkText.size,
> -                                    &new_srk,
> -                                    auth ) );
> -
> -
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                              BSG_TPM_RESULT, &status,
> -                              BSG_TPM_COMMAND_CODE, &command);
> -  memcpy(paramText + paramTextSize, new_srk, srkText.size);
> -  paramTextSize += srkText.size;
> -
> -
> -  TPMTRYRETURN( VerifyAuth(  paramText, paramTextSize,
> -                            ownerAuth, auth,
> -                            hContext) );
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  free(srkText.data);
> -  free(encSrkAuth.data);
> -  free(encOwnerAuth.data);
> -  free(paramText);
> -
> -  TCS_FreeMemory(hContext, new_srk);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_DisablePubekRead( const TCS_CONTEXT_HANDLE    hContext,
> -                                  const TPM_AUTHDATA          *ownerAuth,
> -                                  TCS_AUTH                    *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Disabling Pubek Read.\n");
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_DisablePubekRead;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 1,
> -                              BSG_TPM_COMMAND_CODE, &command);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                             ownerAuth, auth) );
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_DisablePubekRead ( hContext, // in
> -                                        auth) );
> -
> -  // Verify Auth
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                              BSG_TPM_RESULT, &status,
> -                              BSG_TPM_COMMAND_CODE, &command);
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                           ownerAuth, auth,
> -                           hContext) );
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -  free(paramText);
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_CreateWrapKey(  const TCS_CONTEXT_HANDLE hContext,
> -                                const TPM_KEY_USAGE      usage,
> -                                const TPM_AUTHDATA       *newKeyAuth,
> -                                const TCS_KEY_HANDLE     parentHandle,
> -                                const TPM_AUTHDATA       *osapSharedSecret,
> -                                buffer_t                 *pubKeyBuf,
> -                                TCS_AUTH                 *auth) {
> -
> -  int i;
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_CreateWrapKey;
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Creating new key of type %d.\n", usage);
> -
> -  // vars for Calculate encUsageAuth
> -  BYTE *paramText;
> -  UINT32 paramTextSize;
> -
> -  // vars for Calculate encUsageAuth
> -  BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
> -  TPM_DIGEST XORKey1;
> -  UINT32 XORbufferSize;
> -  TPM_SECRET encUsageAuth, encMigrationAuth;
> -
> -  // vars for Flatten newKey prototype
> -  BYTE *flatKey = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -  UINT32 flatKeySize = TCPA_MAX_BUFFER_LENGTH;
> -  struct pack_buf_t newKeyText;
> -
> -  // Fill in newKey
> -  TPM_KEY newKey;
> -
> -  BYTE RSAkeyInfo[12] = { 0x00, 0x00, (RSA_KEY_SIZE >> 8), 0x00,   0x00, 0x00, 0x00, 0x02,   0x00, 0x00, 0x00, 0x00};
> -  newKey.algorithmParms.algorithmID = TPM_ALG_RSA;
> -  newKey.algorithmParms.parms = (BYTE *) &RSAkeyInfo;
> -  newKey.algorithmParms.parmSize = 12;
> -
> -  switch (usage) {
> -  case TPM_KEY_SIGNING:
> -    vtpmloginfo(VTPM_LOG_VTSP, "Creating Signing Key...\n");
> -    newKey.keyUsage = TPM_KEY_SIGNING;
> -    newKey.algorithmParms.encScheme = TPM_ES_NONE;
> -    newKey.algorithmParms.sigScheme = TPM_SS_RSASSAPKCS1v15_SHA1;
> -    break;
> -  case TPM_KEY_STORAGE:
> -    vtpmloginfo(VTPM_LOG_VTSP, "Creating Storage Key...\n");
> -    newKey.keyUsage = TPM_KEY_STORAGE;
> -    newKey.algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
> -    newKey.algorithmParms.sigScheme = TPM_SS_NONE;
> -    break;
> -  case TPM_KEY_BIND:
> -    vtpmloginfo(VTPM_LOG_VTSP, "Creating Binding Key...\n");
> -    newKey.keyUsage = TPM_KEY_BIND;
> -    newKey.algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
> -    newKey.algorithmParms.sigScheme = TPM_SS_NONE;
> -    break;
> -  default:
> -    vtpmloginfo(VTPM_LOG_VTSP, "Cannot create key. Invalid Key Type.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -
> -  newKey.ver = TPM_STRUCT_VER_1_1;
> -
> -  newKey.keyFlags = 0;
> -  newKey.authDataUsage = TPM_AUTH_ALWAYS;
> -  newKey.pubKey.keyLength= 0;
> -  newKey.encDataSize = 0;
> -  newKey.encData = NULL;
> -
> -  // FIXME: Support PCR bindings
> -  newKey.PCRInfoSize = 0;
> -  newKey.PCRInfo = NULL;
> -
> -  // Calculate encUsageAuth
> -  XORbufferSize = BSG_PackList(  XORbuffer, 2,
> -                                BSG_TPM_SECRET, osapSharedSecret,
> -                                BSG_TPM_NONCE, &auth->NonceEven);
> -  Crypto_SHA1Full(XORbuffer, XORbufferSize, (BYTE *) &XORKey1);
> -
> -  // FIXME: No support for migratable keys.
> -  for (i=0; i < TPM_DIGEST_SIZE; i++)
> -    ((BYTE *) &encUsageAuth)[i] = ((BYTE *) &XORKey1)[i] ^ ((BYTE *) newKeyAuth)[i];
> -
> -  // Flatten newKey prototype
> -  flatKeySize = BSG_Pack(BSG_TPM_KEY, (BYTE *) &newKey, flatKey);
> -  newKeyText.data = flatKey;
> -  newKeyText.size = flatKeySize;
> -
> -  // Generate HMAC
> -  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 3,
> -                              BSG_TPM_COMMAND_CODE, &command,
> -                              BSG_TPM_AUTHDATA, &encUsageAuth,
> -                              BSG_TPM_AUTHDATA, &encMigrationAuth);
> -  memcpy(paramText + paramTextSize, newKeyText.data, newKeyText.size);
> -  paramTextSize += newKeyText.size;
> -
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                             osapSharedSecret, auth) );
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_CreateWrapKey(  hContext,
> -                                    parentHandle,
> -                                    encUsageAuth,
> -                                    encMigrationAuth,
> -                                    &newKeyText.size,
> -                                    &newKeyText.data,
> -                                    auth) );
> -
> -  // Verify Auth
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                              BSG_TPM_RESULT, &status,
> -                              BSG_TPM_COMMAND_CODE, &command);
> -  memcpy(paramText + paramTextSize, newKeyText.data, newKeyText.size);
> -  paramTextSize += newKeyText.size;
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                           osapSharedSecret, auth, 0) );
> -
> -  // Unpack/return key structure
> -  TPMTRYRETURN(buffer_init(pubKeyBuf, 0, 0) );
> -  TPMTRYRETURN(buffer_append_raw(pubKeyBuf, newKeyText.size, newKeyText.data) );
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  free(flatKey);
> -  free(paramText);
> -  TCS_FreeMemory(hContext, newKeyText.data);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_LoadKey(const TCS_CONTEXT_HANDLE    hContext,
> -                        const TCS_KEY_HANDLE        hUnwrappingKey,
> -                        const buffer_t              *rgbWrappedKeyBlob,
> -                        const TPM_AUTHDATA          *parentAuth,
> -                        TPM_HANDLE                  *newKeyHandle,
> -                        TCS_AUTH                    *auth,
> -                        CRYPTO_INFO                 *cryptoinfo,
> -                        const BOOL                  skipTPMLoad) {
> -
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Loading Key %s.\n", (!skipTPMLoad ? "into TPM" : "only into memory"));
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_LoadKey;
> -
> -  BYTE *paramText=NULL;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // SkipTPMLoad stops key from being loaded into TPM, but still generates CRYPTO_INFO for it
> -  if (! skipTPMLoad) {
> -
> -    if ((rgbWrappedKeyBlob == NULL) || (parentAuth == NULL) ||
> -        (newKeyHandle==NULL) || (auth==NULL)) {
> -      status = TPM_BAD_PARAMETER;
> -      goto abort_egress;
> -    }
> -
> -    // Generate Extra TCS Parameters
> -    TPM_HANDLE phKeyHMAC;
> -
> -    paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -
> -    paramTextSize = BSG_PackList(paramText, 1,
> -                                BSG_TPM_COMMAND_CODE, &command);
> -
> -    memcpy(paramText + paramTextSize, rgbWrappedKeyBlob->bytes, buffer_len(rgbWrappedKeyBlob));
> -    paramTextSize += buffer_len(rgbWrappedKeyBlob);
> -
> -    TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                             parentAuth, auth) );
> -
> -    // Call TCS
> -    TPMTRYRETURN( TCSP_LoadKeyByBlob(  hContext,
> -                                      hUnwrappingKey,
> -                                      buffer_len(rgbWrappedKeyBlob),
> -                                      rgbWrappedKeyBlob->bytes,
> -                                      auth,
> -                                      newKeyHandle,
> -                                      &phKeyHMAC) );
> -
> -    // Verify Auth
> -    paramTextSize = BSG_PackList(paramText, 3,
> -                                BSG_TPM_RESULT, &status,
> -                                BSG_TPM_COMMAND_CODE, &command,
> -                                BSG_TPM_HANDLE, newKeyHandle);
> -
> -    TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                             parentAuth, auth,
> -                             hContext) );
> -  }
> -
> -  // Build cryptoinfo structure for software crypto function.
> -  if (cryptoinfo != NULL) {
> -    TPM_KEY newKey;
> -
> -    // Unpack/return key structure
> -    BSG_Unpack(BSG_TPM_KEY, rgbWrappedKeyBlob->bytes , &newKey);
> -    TPM_RSA_KEY_PARMS rsaKeyParms;
> -
> -    BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
> -              newKey.algorithmParms.parms,
> -              &rsaKeyParms);
> -
> -    Crypto_RSABuildCryptoInfoPublic(rsaKeyParms.exponentSize,
> -                                   rsaKeyParms.exponent,
> -                                   newKey.pubKey.keyLength,
> -                                   newKey.pubKey.key,
> -                                   cryptoinfo);
> -
> -    // Destroy rsaKeyParms
> -    BSG_Destroy(BSG_TPM_RSA_KEY_PARMS, &rsaKeyParms);
> -
> -    // Set encryption scheme
> -    cryptoinfo->encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
> -  }
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  free(paramText);
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_Unbind( const TCS_CONTEXT_HANDLE    hContext,
> -                        const TPM_KEY_HANDLE        key_handle,
> -                        const buffer_t              *bound_data,
> -                        const TPM_AUTHDATA          *usage_auth,
> -                        buffer_t                    *clear_data,
> -                        TCS_AUTH                    *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Unbinding %d bytes of data.\n", buffer_len(bound_data));
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_UnBind;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // Generate Extra TCS Parameters
> -  struct pack_buf_t clear_data32;
> -  BYTE *clear_data_text;
> -  UINT32 clear_data_size;
> -
> -  struct pack_buf_t bound_data32 = {bound_data->size, bound_data->bytes};
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                              BSG_TPM_COMMAND_CODE, &command,
> -                              BSG_TPM_SIZE32_DATA, &bound_data32);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                             usage_auth, auth) );
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_UnBind( hContext,
> -                            key_handle,
> -                            buffer_len(bound_data),
> -                            bound_data->bytes,
> -                            auth,
> -                            &clear_data_size,
> -                            &clear_data_text) );
> -
> -
> -  // Verify Auth
> -  clear_data32.size = clear_data_size;
> -  clear_data32.data = clear_data_text;
> -  paramTextSize = BSG_PackList(paramText, 3,
> -                              BSG_TPM_RESULT, &status,
> -                              BSG_TPM_COMMAND_CODE, &command,
> -                              BSG_TPM_SIZE32_DATA, &clear_data32);
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                           usage_auth, auth,
> -                           hContext) );
> -
> -  // Unpack/return key structure
> -  TPMTRYRETURN(buffer_init(clear_data, 0, 0));
> -  TPMTRYRETURN(buffer_append_raw (clear_data, clear_data_size, clear_data_text) );
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  free(paramText);
> -  TCS_FreeMemory(hContext, clear_data_text);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_Bind(   CRYPTO_INFO *cryptoInfo,
> -                       const buffer_t *inData,
> -                       buffer_t *outData)
> -{
> -  vtpmloginfo(VTPM_LOG_VTSP, "Binding %d bytes of data.\n", buffer_len(inData));
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_BOUND_DATA boundData;
> -  UINT32 i;
> -
> -  // Fill boundData's accessory information
> -  boundData.ver = TPM_STRUCT_VER_1_1;
> -  boundData.payload = TPM_PT_BIND;
> -  boundData.payloadData = inData->bytes;
> -
> -  // Pack boundData before encryption
> -  BYTE* flatBoundData = (BYTE *)malloc(sizeof(BYTE) *
> -                                      (sizeof(TPM_VERSION) +
> -                                       sizeof(TPM_PAYLOAD_TYPE) +
> -                                       buffer_len(inData)));
> -  if (flatBoundData == NULL) {
> -    return TPM_NOSPACE;
> -  }
> -  UINT32 flatBoundDataSize = 0;
> -  flatBoundDataSize = BSG_PackList(  flatBoundData, 2,
> -                                    BSG_TPM_VERSION, &boundData.ver,
> -                                    BSG_TYPE_BYTE, &boundData.payload);
> -
> -  memcpy(flatBoundData+flatBoundDataSize, inData->bytes, buffer_len(inData));
> -  flatBoundDataSize += buffer_len(inData);
> -
> -  BYTE out_tmp[RSA_KEY_SIZE/8]; // RSAEnc does not do blocking, So this is what will come out.
> -  UINT32 out_tmp_size;
> -
> -  // Encrypt flatBoundData
> -  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_RSAEnc( cryptoInfo,
> -                                           flatBoundDataSize,
> -                                           flatBoundData,
> -                                           &out_tmp_size,
> -                                           out_tmp) );
> -
> -  if (out_tmp_size > RSA_KEY_SIZE/8) {
> -    // The result of RSAEnc should be a fixed size based on key size.
> -    vtpmlogerror(VTPM_LOG_VTSP, "Enc buffer just overflowed.\n");
> -  }
> -
> -  buffer_init(outData, 0, NULL);
> -  buffer_append_raw(outData, out_tmp_size, out_tmp);
> -
> -  vtpmloginfo(VTPM_LOG_TXDATA, "Bind Generated[%d] = 0x", out_tmp_size);
> -  for(i = 0 ; i < out_tmp_size ; i++) {
> -    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out_tmp[i]);
> -  }
> -  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> -
> -  goto egress;
> -  abort_egress:
> -  egress:
> -
> -  // Free flatBoundData
> -  free(flatBoundData);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -TPM_RESULT VTSP_Seal(const TCS_CONTEXT_HANDLE    hContext,
> -                     const TPM_KEY_HANDLE        keyHandle,
> -                     const TPM_AUTHDATA          *sealDataAuth,
> -                     const TPM_PCR_COMPOSITE     *pcrComp,
> -                     const buffer_t              *inData,
> -                     TPM_STORED_DATA             *sealedData,
> -                     const TPM_SECRET            *osapSharedSecret,
> -                     TCS_AUTH                    *auth) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_Seal;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // Generate PCR_Info Struct from Comp
> -  TPM_PCR_INFO pcrInfo;
> -  UINT32 pcrInfoSize, flatpcrSize;
> -  BYTE flatpcr[3 +                          // PCR_Select = 3 1 byte banks
> -               sizeof(UINT16) +             //              2 byte UINT16
> -               sizeof(UINT32) +             // PCR_Comp   = 4 byte UINT32
> -               24 * sizeof(TPM_PCRVALUE) ]; //              up to 24 PCRs
> -
> -  if (pcrComp != NULL) {
> -      //printf("\n\tBinding to PCRs: ");
> -      //for(int i = 0 ; i < pcrComp->select.sizeOfSelect ; i++)
> -      //printf("%2.2x", pcrComp->select.pcrSelect[i]);
> -
> -      memcpy(&pcrInfo.pcrSelection, &pcrComp->select, sizeof(TPM_PCR_SELECTION));
> -
> -      flatpcrSize = BSG_Pack(BSG_TPM_PCR_COMPOSITE, (BYTE *) pcrComp, flatpcr);
> -      Crypto_SHA1Full((BYTE *) flatpcr, flatpcrSize, (BYTE *) &(pcrInfo.digestAtRelease));
> -      memset(&(pcrInfo.digestAtCreation), 0, sizeof(TPM_DIGEST));
> -      pcrInfoSize = BSG_Pack(BSG_TPM_PCR_INFO, (BYTE *) &pcrInfo, flatpcr);
> -  } else {
> -      //printf("\n\tBinding to no PCRS.");
> -      pcrInfoSize = 0;
> -  }
> -
> -  // Calculate encUsageAuth
> -  BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
> -  UINT32 XORbufferSize = sizeof(XORbuffer);
> -  TPM_DIGEST XORKey;
> -  TPM_ENCAUTH encAuth;
> -
> -  BSG_PackList( XORbuffer, 2,
> -                BSG_TPM_SECRET, osapSharedSecret,
> -                BSG_TPM_NONCE, &auth->NonceEven );
> -
> -  Crypto_SHA1Full(XORbuffer, XORbufferSize, (BYTE *) &XORKey);
> -
> -  int i;
> -  for (i=0; i < TPM_DIGEST_SIZE; i++)
> -    ((BYTE *) &encAuth)[i] = ((BYTE *) &XORKey)[i] ^ ((BYTE *) sealDataAuth)[i];
> -
> -  // Generate Extra TCS Parameters
> -  UINT32 inDataSize = buffer_len(inData);
> -  struct pack_buf_t inData_pack = {inDataSize, inData->bytes};
> -  struct pack_buf_t pcrInfo_pack = {pcrInfoSize, flatpcr};
> -
> -  UINT32 sealedDataSize;
> -  BYTE *flatSealedData=NULL;
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 4,
> -                               BSG_TPM_COMMAND_CODE, &command,
> -                               BSG_TPM_ENCAUTH, &encAuth,
> -                               BSG_TPM_SIZE32_DATA, &pcrInfo_pack,
> -                               BSG_TPM_SIZE32_DATA, &inData_pack);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                              osapSharedSecret, auth) );
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_Seal( hContext,
> -                           keyHandle,
> -                           encAuth,
> -                           pcrInfoSize,
> -                           flatpcr,
> -                           inDataSize,
> -                           inData->bytes,
> -                           auth,
> -                           &sealedDataSize,
> -                           &flatSealedData) );
> -
> -  // Unpack/return key structure
> -  BSG_Unpack( BSG_TPM_STORED_DATA, flatSealedData, sealedData );
> -
> -  paramTextSize = BSG_PackList(paramText, 3,
> -                               BSG_TPM_RESULT, &status,
> -                               BSG_TPM_COMMAND_CODE, &command,
> -                               BSG_TPM_STORED_DATA, sealedData);
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                            osapSharedSecret, auth,
> -                            0) );
> -
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  if (flatSealedData)
> -    TCS_FreeMemory( hContext, flatSealedData);
> -
> -  free(paramText);
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTSP_Unseal(const TCS_CONTEXT_HANDLE    hContext,
> -                       const TPM_KEY_HANDLE        keyHandle,
> -                       const TPM_STORED_DATA       *sealedData,
> -                       const TPM_AUTHDATA          *key_usage_auth,
> -                       const TPM_AUTHDATA          *data_usage_auth,
> -                       buffer_t                    *outData,
> -                       TCS_AUTH                    *auth,
> -                       TCS_AUTH                    *dataAuth) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_Unseal;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // Generate Extra TCS Parameters
> -  UINT32 sealDataSize, clearDataSize;
> -  BYTE *flatSealedData= (BYTE *) malloc(sizeof(TPM_VERSION) +
> -                                        2 * sizeof(UINT32) +
> -                                        sealedData->sealInfoSize +
> -                                        sealedData->encDataSize),
> -       *clearData=NULL;
> -
> -  sealDataSize = BSG_Pack(BSG_TPM_STORED_DATA, sealedData, flatSealedData );
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                               BSG_TPM_COMMAND_CODE, &command,
> -                               BSG_TPM_STORED_DATA, sealedData);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                              key_usage_auth, auth) );
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                              data_usage_auth, dataAuth) );
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_Unseal(  hContext,
> -                              keyHandle,
> -                              sealDataSize,
> -                              flatSealedData,
> -                              auth,
> -                              dataAuth,
> -                              &clearDataSize,
> -                              &clearData) );
> -
> -  // Verify Auth
> -  struct pack_buf_t clearData_pack = {clearDataSize, clearData};
> -
> -  paramTextSize = BSG_PackList(paramText, 3,
> -                               BSG_TPM_RESULT, &status,
> -                               BSG_TPM_COMMAND_CODE, &command,
> -                               BSG_TPM_SIZE32_DATA, &clearData_pack);
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                            key_usage_auth, auth,
> -                            hContext) );
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                            data_usage_auth, dataAuth,
> -                            hContext) );
> -
> -  // Unpack/return key structure
> -  TPMTRYRETURN( buffer_init(outData, clearDataSize, clearData) );
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  if (flatSealedData)
> -    TCS_FreeMemory( hContext, clearData);
> -
> -  free(paramText);
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_SaveState( const TCS_CONTEXT_HANDLE    hContext) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Calling TPM_SaveState.\n");
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  // Call TCS
> -  return ( TCSP_SaveState ( hContext ) );
> -
> -}
> -
> -
> -// Function Reaches into unsupported TCS command, beware.
> -TPM_RESULT VTSP_RawTransmit(const TCS_CONTEXT_HANDLE    hContext,
> -                            const buffer_t *inbuf,
> -                            buffer_t *outbuf ) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Passthrough in use.\n");
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  // Generate Extra TCS Parameters
> -  BYTE *resultText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -  UINT32 resultTextSize =  TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_RawTransmitData(buffer_len(inbuf), inbuf->bytes,
> -                                    &resultTextSize, resultText) );
> -
> -  // Unpack/return key structure
> -  TPMTRYRETURN(buffer_init (outbuf, resultTextSize, resultText) );
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -  TCS_FreeMemory(hContext, resultText);
> -  free(resultText);
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/manager/vtsp.h b/tools/vtpm_manager/manager/vtsp.h
> deleted file mode 100644
> index 2fb0440..0000000
> --- a/tools/vtpm_manager/manager/vtsp.h
> +++ /dev/null
> @@ -1,126 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtsp.h
> -//
> -//  Higher level interface to TCS.
> -//
> -// ==================================================================
> -
> -#ifndef __VTSP_H__
> -#define __VTSP_H__
> -
> -#include "tcg.h"
> -#include "tcs.h"
> -
> -#define KEY_BUFFER_SIZE 2048
> -
> -TPM_RESULT VTSP_RawTransmit(const TCS_CONTEXT_HANDLE    hContext,
> -                            const buffer_t *inbuf,
> -                            buffer_t *outbuf );
> -
> -TPM_RESULT VTSP_OIAP(  const TCS_CONTEXT_HANDLE hContext,
> -                       TCS_AUTH *auth);
> -
> -TPM_RESULT VTSP_OSAP(  const TCS_CONTEXT_HANDLE hContext,
> -                       const TPM_ENTITY_TYPE entityType,
> -                       const UINT32 entityValue,
> -                       const TPM_AUTHDATA *usageAuth,
> -                       TPM_SECRET *sharedsecret,
> -                       TCS_AUTH *auth);
> -
> -TPM_RESULT VTSP_TerminateHandle(const TCS_CONTEXT_HANDLE hContext,
> -                                const TCS_AUTH *auth);
> -
> -TPM_RESULT VTSP_ReadPubek(   const TCS_CONTEXT_HANDLE hContext,
> -                             CRYPTO_INFO *cypto_info);
> -
> -TPM_RESULT VTSP_TakeOwnership(   const TCS_CONTEXT_HANDLE hContext,
> -                                 const TPM_AUTHDATA *ownerAuth,
> -                                 const TPM_AUTHDATA *srkAuth,
> -                                 CRYPTO_INFO *ek_cryptoInfo,
> -                                 TCS_AUTH *auth);
> -
> -TPM_RESULT VTSP_DisablePubekRead( const TCS_CONTEXT_HANDLE    hContext,
> -                                  const TPM_AUTHDATA *ownerAuth,
> -                                  TCS_AUTH                    *auth);
> -
> -TPM_RESULT VTSP_CreateWrapKey(  const TCS_CONTEXT_HANDLE hContext,
> -                                const TPM_KEY_USAGE      usage,
> -                                const TPM_AUTHDATA       *newKeyAuth,
> -                                const TCS_KEY_HANDLE     parentHandle,
> -                                const TPM_AUTHDATA       *osapSharedSecret,
> -                                buffer_t                 *pubKeyBuf,
> -                                TCS_AUTH                 *auth);
> -
> -TPM_RESULT VTSP_LoadKey(const TCS_CONTEXT_HANDLE    hContext,
> -                        const TCS_KEY_HANDLE        hUnwrappingKey,
> -                        const buffer_t              *rgbWrappedKeyBlob,
> -                        const TPM_AUTHDATA          *parentAuth,
> -                        TPM_HANDLE                  *newKeyHandle,
> -                        TCS_AUTH                    *pAuth,
> -                        CRYPTO_INFO                 *cryptoinfo,
> -                        const BOOL                  skipTPMLoad);
> -
> -TPM_RESULT VTSP_Unbind( const TCS_CONTEXT_HANDLE    hContext,
> -                        const TPM_KEY_HANDLE        key_handle,
> -                        const buffer_t              *bound_data,
> -                        const TPM_AUTHDATA          *usage_auth,
> -                        buffer_t                    *clear_data,
> -                        TCS_AUTH                    *auth);
> -
> -TPM_RESULT VTSP_Bind(   CRYPTO_INFO *cryptoInfo,
> -            const buffer_t *inData,
> -            buffer_t *outData);
> -
> -TPM_RESULT VTSP_Seal(const TCS_CONTEXT_HANDLE    hContext,
> -                     const TPM_KEY_HANDLE        keyHandle,
> -                     const TPM_AUTHDATA          *sealDataAuth,
> -                     const TPM_PCR_COMPOSITE     *pcrComp,
> -                     const buffer_t              *inData,
> -                     TPM_STORED_DATA             *sealedData,
> -                     const TPM_SECRET            *osapSharedSecret,
> -                     TCS_AUTH                    *auth);
> -
> -TPM_RESULT VTSP_Unseal(const TCS_CONTEXT_HANDLE    hContext,
> -                       const TPM_KEY_HANDLE        keyHandle,
> -                       const TPM_STORED_DATA       *sealedData,
> -                       const TPM_AUTHDATA          *key_usage_auth,
> -                       const TPM_AUTHDATA          *data_usage_auth,
> -                       buffer_t                    *outData,
> -                       TCS_AUTH                    *auth,
> -                       TCS_AUTH                    *dataAuth);
> -
> -TPM_RESULT VTSP_SaveState( const TCS_CONTEXT_HANDLE    hContext);
> -
> -#endif //_VTSP_H_
> diff --git a/tools/vtpm_manager/migration/Makefile b/tools/vtpm_manager/migration/Makefile
> deleted file mode 100644
> index e33ae95..0000000
> --- a/tools/vtpm_manager/migration/Makefile
> +++ /dev/null
> @@ -1,42 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -VPATH = ../manager
> -
> -BIND           = vtpm_migratord
> -BINC           = vtpm_migrator
> -
> -SRCSD    = vtpm_manager_if.c vtpm_migratord.c vtpm_migratord_handler.c vtpm_ipc.c
> -SRCSC    = vtpm_manager_if.c vtpm_migrator_if.c vtpm_migratorc.c vtpm_ipc.c
> -
> -OBJSD    = $(patsubst %.c,%.o,$(SRCSD))
> -OBJSC    = $(patsubst %.c,%.o,$(SRCSC))
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIND) $(BINC)
> -
> -.PHONY: install
> -install: build
> -       $(INSTALL_PROG) $(BIND) $(DESTDIR)$(BINDIR)
> -       $(INSTALL_PROG) $(BINC) $(DESTDIR)$(BINDIR)
> -
> -.PHONY: clean
> -clean:
> -       rm -f $(BINC) $(BIND)
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIND): $(OBJSD)
> -       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
> -
> -$(BINC): $(OBJSC)
> -       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
> -
> -# libraries
> -LIBS += ../util/libTCGUtils.a
> diff --git a/tools/vtpm_manager/migration/vtpm_manager_if.c b/tools/vtpm_manager/migration/vtpm_manager_if.c
> deleted file mode 100644
> index 08986f4..0000000
> --- a/tools/vtpm_manager/migration/vtpm_manager_if.c
> +++ /dev/null
> @@ -1,186 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_manager_if.c
> -//
> -//  Provides functions to call local vtpm manager interface (Hotplug)
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <fcntl.h>
> -#include <malloc.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "vtpm_ipc.h"
> -#include "bsg.h"
> -#include "vtpm_migrator.h"
> -#include "vtpm_manager.h"
> -
> -#define VTPM_TX_HP_FNAME       "/var/vtpm/fifos/from_console.fifo"
> -#define VTPM_RX_HP_FNAME       "/var/vtpm/fifos/to_console.fifo"
> -
> -static vtpm_ipc_handle_t tx_ipc_h, rx_ipc_h;
> -
> -TPM_RESULT vtpm_manager_open(){
> -
> -  if ( (vtpm_ipc_init(&tx_ipc_h,  VTPM_TX_HP_FNAME, O_RDWR, TRUE) != 0) ||  //FIXME: wronly
> -       (vtpm_ipc_init(&rx_ipc_h,  VTPM_RX_HP_FNAME, O_RDWR, TRUE) != 0) ) { //FIXME: rdonly
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to connect to vtpm_manager.\n");
> -    return TPM_IOERROR;
> -  }
> -
> -  return TPM_SUCCESS;
> -}
> -
> -void vtpm_manager_close() {
> -
> -  vtpm_ipc_close(&tx_ipc_h);
> -  vtpm_ipc_close(&rx_ipc_h);
> -}
> -
> -
> -TPM_RESULT vtpm_manager_command(TPM_COMMAND_CODE ord,
> -                                buffer_t *command_param_buf,
> -                                TPM_RESULT *cmd_status, /* out */
> -                                buffer_t *result_param_buf) {
> -
> -  TPM_RESULT status = TPM_FAIL;
> -  int  size_read, size_write, i;
> -  BYTE *adj_command, response_header[VTPM_COMMAND_HEADER_SIZE_SRV];
> -  UINT32 dmi_id=0, adj_command_size, out_param_size, adj_param_size;
> -  TPM_TAG tag=VTPM_TAG_REQ;
> -
> -  if ( (!command_param_buf) || (!result_param_buf) || (!cmd_status) ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  adj_command_size = VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(command_param_buf);
> -  adj_command = (BYTE *) malloc( adj_command_size );
> -  if (!adj_command) {
> -    status = TPM_RESOURCES;
> -    goto abort_egress;
> -  }
> -
> -  out_param_size = VTPM_COMMAND_HEADER_SIZE + buffer_len(command_param_buf);
> -  BSG_PackList(adj_command, 4,
> -                 BSG_TYPE_UINT32, &dmi_id,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &out_param_size,
> -                 BSG_TPM_COMMAND_CODE, &ord );
> -
> -  memcpy(adj_command + VTPM_COMMAND_HEADER_SIZE_SRV, command_param_buf->bytes, buffer_len(command_param_buf));
> -
> -  size_write = vtpm_ipc_write(&tx_ipc_h, NULL, adj_command, adj_command_size);
> -
> -  if (size_write > 0) {
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT (MGR): 0x");
> -    for (i=0; i< adj_command_size; i++) {
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", adj_command[i]);
> -    }
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -  } else {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Error writing VTPM Manager console.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (size_write != (int) adj_command_size )
> -    vtpmlogerror(VTPM_LOG_VTPM, "Could not write entire command to mgr (%d/%d)\n", size_write, adj_command_size);
> -
> -  // Read header for response to manager command
> -  size_read = vtpm_ipc_read(&rx_ipc_h, NULL, response_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -  if (size_read > 0) {
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV (MGR): 0x");
> -    for (i=0; i<size_read; i++)
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", response_header[i]);
> -
> -  } else {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Error reading from vtpm manager.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Command from vtpm_manager shorter than std header.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  // Unpack response from DMI for TPM command
> -  BSG_UnpackList(response_header, 4,
> -                 BSG_TYPE_UINT32, &dmi_id,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &out_param_size,
> -                 BSG_TPM_COMMAND_CODE, cmd_status );
> -
> -  // If response has parameters, read them.
> -  // Note that out_param_size is in the client's context
> -  adj_param_size = out_param_size - VTPM_COMMAND_HEADER_SIZE;
> -  if (adj_param_size > 0) {
> -    TPMTRYRETURN( buffer_init( result_param_buf, adj_param_size, NULL) );
> -    size_read = vtpm_ipc_read(&rx_ipc_h, NULL, result_param_buf->bytes, adj_param_size);
> -    if (size_read > 0) {
> -      for (i=0; i< size_read; i++)
> -        vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_param_buf->bytes[i]);
> -
> -    } else {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Error reading from vtpm manager.\n");
> -      goto abort_egress;
> -    }
> -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -
> -    if (size_read < (int)adj_param_size) {
> -      vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -      vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
> -      status = TPM_IOERROR;
> -      goto abort_egress;
> -    }
> -  } else {
> -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -  }
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> -
> -
> diff --git a/tools/vtpm_manager/migration/vtpm_migrator.h b/tools/vtpm_manager/migration/vtpm_migrator.h
> deleted file mode 100644
> index 8d52e66..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migrator.h
> +++ /dev/null
> @@ -1,104 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_migrator.h
> -//
> -//  Public Interface header for VTPM Migrator
> -//
> -// ==================================================================
> -
> -#ifndef __VTPM_MIGRATOR_H__
> -#define __VTPM_MIGRATOR_H__
> -
> -#define VTPM_MTAG_REQ 0x02c1
> -#define VTPM_MTAG_RSP 0x02c4
> -
> -// Header sizes.
> -#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
> -//               sizeof(TPM_TAG + UINT32 + TPM_COMMAND_CODE)
> -
> -//*********************** Connection Info **************************
> -#define VTPM_MIG_PORT 48879
> -
> -//************************ Command Codes ***************************
> -#define VTPM_MORD_MIG_STEP1     0x00
> -#define VTPM_MORD_MIG_STEP2     0x01
> -#define VTPM_MORD_MIG_STEP3     0x02
> -#define VTPM_MORD_MIG_STEP4     0x03
> -
> -//************************ Return Codes ****************************
> -#define VTPM_SUCCESS               0
> -#define VTPM_FAIL                  1
> -
> -/******************* Command Parameter API *************************
> -
> -VTPM Command Format
> -  tpm tag: 2 bytes
> -  command size: 4 bytes         // Size of command including header but not DMI
> -  ord: 4 bytes                  // Command ordinal above
> -  parameters: size - 10 bytes   // Command Parameter
> -
> -VTPM Response Format
> -  tpm tag: 2 bytes
> -  response_size: 4 bytes
> -  status: 4 bytes
> -  parameters: size - 10 bytes
> -
> -
> -VTPM_Mig_Phase1:
> -    Unsupported: (Handled by scripts)
> -
> -VTPM_Mig_Phase2
> -  Input Parameters:
> -    domain_name_size: 4 bytes
> -    domain_name : domain_name_size bytes
> -  Output Parameters:
> -    pub_exp_size: 4 bytes
> -    pub_exp: pub_exp_size bytes
> -    pub_mod_size: 4 bytes
> -    pub_mod: pub_mod_size bytes
> -
> -VTPM_Mig_Phase3
> -  Input Parameters:
> -    vtpm_state_size: 4 bytes
> -    vtpm_state: vtpm_state_size bytes
> -  Output Parameters:
> -    none
> -
> -VTPM_Mig_Phase4
> -    Unsupported: (Handled by scripts)
> -
> -
> -*********************************************************************/
> -
> -#endif //_VTPM_MANAGER_H_
> diff --git a/tools/vtpm_manager/migration/vtpm_migrator_if.c b/tools/vtpm_manager/migration/vtpm_migrator_if.c
> deleted file mode 100644
> index de48b2d..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migrator_if.c
> +++ /dev/null
> @@ -1,219 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_migrator_if.c
> -//
> -//  Provides functions to call open network connection & call
> -//  a function on the vtpm_migratord on the destination
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <sys/types.h>
> -#include <sys/socket.h>
> -#include <netinet/in.h>
> -#include <arpa/inet.h>
> -#include <netdb.h>
> -#include <string.h>
> -#include <malloc.h>
> -
> -#include "tcg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "bsg.h"
> -#include "vtpm_migrator.h"
> -
> -static int sock_desc;
> -
> -
> -TPM_RESULT vtpm_migratord_open(char *server_address){
> -
> -  TPM_RESULT status = TPM_FAIL;
> -
> -  /* network variables */
> -  struct in_addr ip_addr;
> -  struct sockaddr_in server_addr;
> -  int addr_len;
> -  struct hostent *dns_info=NULL;
> -
> -  /* set up connection to server*/
> -  dns_info = gethostbyname(server_address);
> -  ip_addr.s_addr = *((unsigned long *) dns_info->h_addr_list[0]);
> -
> -  if(ip_addr.s_addr < 0) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  /* set up server variable */
> -  memset((char *)&server_addr, 0, sizeof(server_addr));
> -  server_addr.sin_family = AF_INET;
> -  server_addr.sin_port = htons(VTPM_MIG_PORT);
> -  server_addr.sin_addr.s_addr = ip_addr.s_addr;
> -
> -  /* open socket, make connection */
> -  sock_desc = socket(AF_INET, SOCK_STREAM, 0);
> -
> -  if (sock_desc < 0 ) {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (connect(sock_desc,
> -              (struct sockaddr *)&server_addr,
> -              sizeof(server_addr)) < 0 ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  status = TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> -
> -void vtpm_migratord_close() {
> -  close(sock_desc);
> -}
> -
> -
> -TPM_RESULT vtpm_migratord_command(TPM_COMMAND_CODE ord,
> -                                buffer_t *command_param_buf,
> -                                TPM_RESULT *cmd_status, /* out */
> -                                buffer_t *result_param_buf) {
> -
> -  TPM_RESULT status = TPM_FAIL;
> -  int  size_read, size_write, i;
> -  BYTE *command, response_header[VTPM_COMMAND_HEADER_SIZE];
> -  UINT32 dmi_id=0, command_size, out_param_size, adj_param_size;
> -  TPM_TAG tag=VTPM_MTAG_REQ;
> -
> -  if ( (!command_param_buf) || (!result_param_buf) || (!cmd_status) ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  command_size = VTPM_COMMAND_HEADER_SIZE + buffer_len(command_param_buf);
> -  command = (BYTE *) malloc( command_size );
> -  if (!command) {
> -    status = TPM_RESOURCES;
> -    goto abort_egress;
> -  }
> -
> -  BSG_PackList(command, 3,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &command_size,
> -                 BSG_TPM_COMMAND_CODE, &ord );
> -
> -  memcpy(command + VTPM_COMMAND_HEADER_SIZE, command_param_buf->bytes, buffer_len(command_param_buf));
> -
> -  size_write = write(sock_desc, command, command_size);
> -
> -  if (size_write > 0) {
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT (MIGd): 0x");
> -    for (i=0; i< command_size; i++) {
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", command[i]);
> -    }
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -  } else {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Error writing to migration server via network.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (size_write != (int) command_size )
> -    vtpmlogerror(VTPM_LOG_VTPM, "Could not write entire command to migration server (%d/%d)\n", size_write, command_size);
> -
> -  // Read header for response
> -  size_read = read(sock_desc, response_header, VTPM_COMMAND_HEADER_SIZE);
> -  if (size_read > 0) {
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV (MIGd): 0x");
> -    for (i=0; i<size_read; i++)
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", response_header[i]);
> -
> -  } else {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Error reading from Migration Server.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Command from migration server shorter than std header.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  // Unpack response from DMI for TPM command
> -  BSG_UnpackList(response_header, 3,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &out_param_size,
> -                 BSG_TPM_COMMAND_CODE, cmd_status );
> -
> -  // If response has parameters, read them.
> -  adj_param_size = out_param_size - VTPM_COMMAND_HEADER_SIZE;
> -  if (adj_param_size > 0) {
> -    TPMTRYRETURN( buffer_init( result_param_buf, adj_param_size, NULL) );
> -    size_read = read(sock_desc, result_param_buf->bytes, adj_param_size);
> -    if (size_read > 0) {
> -      for (i=0; i< size_read; i++)
> -        vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_param_buf->bytes[i]);
> -
> -    } else {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Error reading from migration server.\n");
> -      goto abort_egress;
> -    }
> -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -
> -    if (size_read < (int)adj_param_size) {
> -      vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -      vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
> -      status = TPM_IOERROR;
> -      goto abort_egress;
> -    }
> -  } else {
> -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -  }
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> -
> -
> diff --git a/tools/vtpm_manager/migration/vtpm_migratorc.c b/tools/vtpm_manager/migration/vtpm_migratorc.c
> deleted file mode 100644
> index 18b3bdb..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migratorc.c
> +++ /dev/null
> @@ -1,211 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <stdio.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "log.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -#include "vtpm_migrator.h"
> -#include "vtpm_manager.h"
> -
> -TPM_RESULT handle_vtpm_mig_step2(char *server_addr,
> -                                 char *name,
> -                                 UINT32 instance) {
> -  TPM_RESULT status, cmd_status;
> -  buffer_t out_param_buf=NULL_BUF, mig_key_buf=NULL_BUF, empty_buf=NULL_BUF;
> -  UINT32 offset;
> -  struct pack_buf_t addr_data32;
> -
> -  //===== Get Destination's Public Migration Key ======
> -  TPMTRYRETURN( vtpm_migratord_open(server_addr) );
> -
> -  TPMTRYRETURN( vtpm_migratord_command(VTPM_MORD_MIG_STEP2,
> -                                     &out_param_buf,
> -                                     &cmd_status,
> -                                     &mig_key_buf) );
> -  vtpm_migratord_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  //===== Load migration key into vtpm_manager ========
> -
> -  addr_data32.data = (BYTE *)server_addr;
> -  addr_data32.size = strlen(server_addr) + 1; // Include the null
> -
> -  TPMTRYRETURN ( buffer_init ( &out_param_buf,
> -                               sizeof(UINT32) + addr_data32.size +buffer_len(&mig_key_buf),
> -                               NULL ) ) ;
> -
> -  offset =  BSG_PackList(out_param_buf.bytes, 1,
> -               BSG_TPM_SIZE32_DATA, &addr_data32);
> -
> -  memcpy(out_param_buf.bytes + offset , mig_key_buf.bytes, buffer_len(&mig_key_buf) );
> -
> -  TPMTRYRETURN ( vtpm_manager_open() );
> -
> -  TPMTRYRETURN ( vtpm_manager_command(VTPM_ORD_LOAD_MIG_KEY,
> -                                      &out_param_buf,
> -                                      &cmd_status,
> -                                      &empty_buf) );
> -
> -  vtpm_manager_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  buffer_free(&mig_key_buf);
> -  buffer_free(&out_param_buf);
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT handle_vtpm_mig_step3(char *server_addr,
> -                                 char *name,
> -                                 UINT32 instance) {
> -  TPM_RESULT status, cmd_status;
> -  buffer_t out_param_buf=NULL_BUF, state_buf=NULL_BUF, empty_buf=NULL_BUF;
> -  struct pack_buf_t addr_data32, name_data32, state_data32;
> -
> -  //===== Get vtpm state from vtpm_manager ========
> -  addr_data32.data = (BYTE *)server_addr;
> -  addr_data32.size = strlen(server_addr) + 1; // Include the null
> -
> -  TPMTRYRETURN ( buffer_init ( &out_param_buf,
> -                               (2 * sizeof(UINT32)) + addr_data32.size,
> -                               NULL ) ) ;
> -
> -  BSG_PackList(out_param_buf.bytes, 2,
> -                 BSG_TYPE_UINT32, &instance,
> -                 BSG_TPM_SIZE32_DATA, &addr_data32);
> -
> -  TPMTRYRETURN ( vtpm_manager_open() );
> -
> -  TPMTRYRETURN ( vtpm_manager_command(VTPM_ORD_MIGRATE_OUT,
> -                                      &out_param_buf,
> -                                      &cmd_status,
> -                                      &state_buf) );
> -
> -  vtpm_manager_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  TPMTRYRETURN( buffer_free( &out_param_buf ) );
> -
> -  //===== Send vtpm state to destination ======
> -  name_data32.data = (BYTE *)name;
> -  name_data32.size = strlen(name) + 1; // Include the null
> -  state_data32.data = state_buf.bytes;
> -  state_data32.size = buffer_len(&state_buf);
> -
> -  TPMTRYRETURN( buffer_init( &out_param_buf,
> -                             2 * sizeof(UINT32) + name_data32.size + state_data32.size,
> -                             NULL ) ) ;
> -
> -  BSG_PackList(out_param_buf.bytes, 2,
> -                 BSG_TPM_SIZE32_DATA, &name_data32,
> -                 BSG_TPM_SIZE32_DATA, &state_data32);
> -
> -  TPMTRYRETURN( vtpm_migratord_open(server_addr) );
> -
> -  TPMTRYRETURN( vtpm_migratord_command(VTPM_MORD_MIG_STEP3,
> -                                     &out_param_buf,
> -                                     &cmd_status,
> -                                     &empty_buf) );
> -  vtpm_migratord_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  buffer_free( &out_param_buf);
> -  buffer_free( &state_buf);
> -  buffer_free( &empty_buf);
> -
> -  return status;
> -}
> -
> -
> -// Usage vtpm_migrator addr domain_name instance step
> -
> -int main(int argc, char **argv) {
> -
> -    /* variables for processing of command */
> -    TPM_RESULT status = TPM_FAIL;
> -    char *server_addr, *name;
> -    UINT32 instance, step;
> -
> -    if (argc != 5) {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Usage: vtpm_migrator addr vm_name instance step\n");
> -      vtpmlogerror(VTPM_LOG_VTPM, "       params given %d\n", argc);
> -      status= TPM_BAD_PARAMETER;
> -      goto abort_egress;
> -    }
> -
> -    server_addr = argv[1];
> -    name = argv[2];
> -    instance = atoi( argv[3] );
> -    step = atoi( argv[4] );
> -
> -    switch (step) {
> -    case VTPM_MORD_MIG_STEP2:
> -      status = handle_vtpm_mig_step2(server_addr, name, instance);
> -      break;
> -
> -    case VTPM_MORD_MIG_STEP3:
> -      status = handle_vtpm_mig_step3(server_addr, name, instance);
> -      break;
> -
> -    default:
> -      status = TPM_BAD_PARAMETER;
> -      goto abort_egress;
> -      break;
> -    }
> -
> -    goto egress;
> - abort_egress:
> - egress:
> -
> -    return status;
> -}
> -
> diff --git a/tools/vtpm_manager/migration/vtpm_migratord.c b/tools/vtpm_manager/migration/vtpm_migratord.c
> deleted file mode 100644
> index ea18c8c..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migratord.c
> +++ /dev/null
> @@ -1,202 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <stdio.h>
> -#include <sys/types.h>
> -#include <sys/socket.h>
> -#include <netinet/in.h>
> -#include <arpa/inet.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "log.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -#include "vtpm_migrator.h"
> -
> -void build_error_msg( buffer_t *buf, TPM_RESULT status) {
> -  TPM_TAG tag = VTPM_MTAG_RSP;
> -  UINT32 out_param_size = VTPM_COMMAND_HEADER_SIZE;
> -
> -  buffer_init(buf, out_param_size, NULL);
> -
> -  BSG_PackList(buf->bytes, 3,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &out_param_size,
> -                 BSG_TPM_RESULT, &status );
> -}
> -
> -int main() {
> -
> -    /* network variables */
> -    int sock_descr, client_sock=-1, len;
> -    struct sockaddr_in addr;
> -    struct sockaddr_in client_addr;
> -    unsigned int client_length;
> -    int bytes;
> -
> -    /* variables for processing of command */
> -    TPM_RESULT status = TPM_FAIL;
> -    BYTE cmd_header[VTPM_COMMAND_HEADER_SIZE];
> -    TPM_TAG tag;
> -    TPM_COMMAND_CODE ord;
> -    UINT32 in_param_size, adj_param_size;
> -    int i, size_read, size_write;
> -    buffer_t in_param_buf=NULL_BUF, result_buf=NULL_BUF;
> -
> -
> -    /* setup socket */
> -    sock_descr = socket(AF_INET, SOCK_STREAM, 0);
> -
> -    memset(&addr, 0, sizeof(addr));
> -    addr.sin_family = AF_INET;
> -    addr.sin_addr.s_addr = htonl(INADDR_ANY);
> -    addr.sin_port = htons(VTPM_MIG_PORT);
> -
> -    if (bind(sock_descr, (struct sockaddr *)&addr, sizeof(addr)) == -1 ) {
> -        vtpmlogerror(VTPM_LOG_VTPM, "Failed to bind to port %d.\n", VTPM_MIG_PORT);
> -        return 1;
> -    }
> -
> -    listen(sock_descr, 10);
> -
> -    for(;;) {
> -        // ============ clear client info and wait for connection ==========
> -        memset(&client_addr, 0, sizeof(client_addr));
> -        client_length = sizeof(client_addr);
> -
> -        vtpmloginfo(VTPM_LOG_VTPM, "Waiting for incoming migrations...\n");
> -        client_sock=accept(sock_descr, &client_addr, &client_length);
> -        if (client_sock == -1) {
> -            vtpmlogerror(VTPM_LOG_VTPM, "Incoming connectionn failed.\n");
> -            goto abort_command;
> -        } else {
> -            vtpmloginfo(VTPM_LOG_VTPM, "Incoming connection accepted.\n");
> -        }
> -
> -        // =================== Read incoming command ======================
> -        size_read = read( client_sock, cmd_header, VTPM_COMMAND_HEADER_SIZE);
> -        if (size_read > 0) {
> -            vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV: 0x");
> -            for (i=0; i<size_read; i++)
> -                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> -
> -        } else {
> -            vtpmlogerror(VTPM_LOG_VTPM, "Error reading from socket.\n");
> -            build_error_msg(&result_buf, TPM_IOERROR);
> -            goto abort_command_with_error;
> -        }
> -
> -        if (size_read < (int) VTPM_COMMAND_HEADER_SIZE) {
> -            vtpmlogerror(VTPM_LOG_VTPM, "Command from socket shorter than std header.\n");
> -            build_error_msg(&result_buf, TPM_BAD_PARAMETER);
> -            goto abort_command_with_error;
> -        }
> -
> -        // Unpack response from client
> -        BSG_UnpackList(cmd_header, 3,
> -                       BSG_TPM_TAG, &tag,
> -                       BSG_TYPE_UINT32, &in_param_size,
> -                       BSG_TPM_COMMAND_CODE, &ord );
> -
> -
> -        // If response has parameters, read them.
> -        // Note that out_param_size is in the client's context
> -        adj_param_size = in_param_size - VTPM_COMMAND_HEADER_SIZE;
> -        if (adj_param_size > 0) {
> -            buffer_init( &in_param_buf, adj_param_size, NULL);
> -            size_read = read(client_sock, in_param_buf.bytes, adj_param_size);
> -            if (size_read > 0) {
> -                for (i=0; i< size_read; i++)
> -                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param_buf.bytes[i]);
> -
> -            } else {
> -                vtpmlogerror(VTPM_LOG_VTPM, "Error reading from socket.\n");
> -                build_error_msg(&result_buf, TPM_IOERROR);
> -                goto abort_command_with_error;
> -            }
> -            vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -
> -            if (size_read < (int)adj_param_size) {
> -                vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -                vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
> -                build_error_msg(&result_buf, TPM_BAD_PARAMETER);
> -                goto abort_command_with_error;
> -            }
> -        } else {
> -            vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -        }
> -
> -        /* Handle Command */
> -        switch (ord) {
> -        case VTPM_MORD_MIG_STEP2:
> -          handle_vtpm_mig_step2(&in_param_buf, &result_buf);
> -          break;
> -
> -        case VTPM_MORD_MIG_STEP3:
> -          handle_vtpm_mig_step3(&in_param_buf, &result_buf);
> -          break;
> -
> -        default:
> -            build_error_msg(&result_buf, TPM_BAD_PARAMETER);
> -            goto abort_command_with_error;
> -        }
> -
> -  abort_command_with_error:
> -        /* Write Response */
> -        size_write = write(client_sock, result_buf.bytes, buffer_len(&result_buf));
> -
> -        if (size_write > 0) {
> -            vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT: 0x");
> -            for (i=0; i< buffer_len(&result_buf); i++) {
> -                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_buf.bytes[i]);
> -            }
> -            vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -        } else {
> -            vtpmlogerror(VTPM_LOG_VTPM, "Error writing response to client.\n");
> -            goto abort_command;
> -        }
> -
> -        if (size_write != (int) buffer_len(&result_buf) )
> -           vtpmlogerror(VTPM_LOG_VTPM, "Could not send entire response to client(%d/%d)\n", size_write, buffer_len(&result_buf));
> -
> -  abort_command:
> -        close(client_sock);
> -        buffer_free(&in_param_buf);
> -        buffer_free(&result_buf);
> -
> -    } // For (;;)
> -
> -    return 0;
> -}
> -
> diff --git a/tools/vtpm_manager/migration/vtpm_migratord_handler.c b/tools/vtpm_manager/migration/vtpm_migratord_handler.c
> deleted file mode 100644
> index 0a8a2d5..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migratord_handler.c
> +++ /dev/null
> @@ -1,177 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <stdlib.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "bsg.h"
> -#include "log.h"
> -#include "vtpm_migrator.h"
> -#include "vtpm_manager.h"
> -
> -#define VTPM_SH_CMD_HDR  "bash -c \"cd /etc/xen/scripts; source /etc/xen/scripts/vtpm-common.sh;"
> -#define VTPM_SH_CMD_FTR  "\""
> -#define VTPM_SH_GETINST  "vtpmdb_get_free_instancenum"
> -#define VTPM_SH_ADD      "vtpm_add_and_activate"
> -#define VTPM_SH_RESUME   "vtpm_resume"
> -
> -// This must be updated to the longest command name. Currently GETINST
> -#define VTPM_SH_CMD_SIZE (strlen(VTPM_SH_CMD_HDR) + strlen(VTPM_SH_CMD_FTR) + 1 + strlen(VTPM_SH_GETINST) + 2)
> -
> -void handle_vtpm_mig_step2(buffer_t *in_param_buf, buffer_t *result_buf)
> -{
> -  TPM_TAG tag = VTPM_TAG_RSP;
> -  buffer_t out_param_buf= NULL_BUF, mig_key_buf=NULL_BUF;
> -  TPM_RESULT status=TPM_SUCCESS, cmd_status;
> -  UINT32 out_param_size;
> -
> -  if ( (!in_param_buf) || (!result_buf) ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  // ================= Call manager and get mig key ===============
> -  TPMTRYRETURN( vtpm_manager_open() );
> -  TPMTRYRETURN( vtpm_manager_command(VTPM_ORD_GET_MIG_KEY,
> -                                     &out_param_buf, // Empty
> -                                     &cmd_status,
> -                                     &mig_key_buf) );
> -
> -  vtpm_manager_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  // ==================== return the  mig key =====================
> -  out_param_size =  VTPM_COMMAND_HEADER_SIZE + buffer_len(&mig_key_buf);
> -
> -  TPMTRYRETURN( buffer_init(result_buf,
> -                            out_param_size,
> -                            NULL) );
> -
> -  BSG_PackList( result_buf->bytes, 3,
> -                  BSG_TPM_TAG, &tag,
> -                  BSG_TYPE_UINT32, &out_param_size,
> -                  BSG_TPM_RESULT, &status);
> -
> -  memcpy(result_buf->bytes + VTPM_COMMAND_HEADER_SIZE,
> -         mig_key_buf.bytes, buffer_len(&mig_key_buf));
> -
> -  goto egress;
> -
> - abort_egress:
> -  buffer_free(result_buf);
> -  build_error_msg(result_buf, status);
> -
> - egress:
> -  return;
> -}
> -
> -void handle_vtpm_mig_step3(buffer_t *in_param_buf, buffer_t *result_buf)
> -{
> -  TPM_TAG tag = VTPM_TAG_RSP;
> -  buffer_t out_param_buf= NULL_BUF, mig_key_buf=NULL_BUF, empty_buf=NULL_BUF;
> -  TPM_RESULT status=TPM_SUCCESS, cmd_status;
> -  UINT32 out_param_size, instance;
> -  char *shell_cmd_str=NULL;
> -  size_t shell_cmd_strlen;
> -  FILE *shell_f=NULL;
> -
> -  if ( (!in_param_buf) || (!result_buf) ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  // ================= Read Parameters ===============
> -  struct pack_buf_t name_data32, state_data32;
> -
> -  BSG_UnpackList(in_param_buf->bytes, 2,
> -                 BSG_TPM_SIZE32_DATA, &name_data32,
> -                 BSG_TPM_SIZE32_DATA, &state_data32);
> -
> -  // Before using this string, protect us from a non-null term array.
> -  if (name_data32.data[name_data32.size -1] != 0x00) {
> -    name_data32.data[name_data32.size -1] = 0x00;
> -  }
> -
> -  // ====== Call hotplug-script and get an instance ======
> -  shell_cmd_strlen = VTPM_SH_CMD_SIZE + name_data32.size + 10;
> -  shell_cmd_str = (char *) malloc(shell_cmd_strlen); // 10 is just padding for the UINT32
> -
> -  snprintf(shell_cmd_str, shell_cmd_strlen,
> -       VTPM_SH_CMD_HDR VTPM_SH_GETINST VTPM_SH_CMD_FTR);
> -
> -  shell_f = popen(shell_cmd_str, "r");
> -  fscanf(shell_f, "%d", &instance);
> -  pclose(shell_f);
> -
> -  // ====== Call hotplug-script and add instance ======
> -  snprintf(shell_cmd_str, shell_cmd_strlen,
> -       VTPM_SH_CMD_HDR VTPM_SH_ADD " %s %d" VTPM_SH_CMD_FTR,
> -       name_data32.data, instance);
> -  system(shell_cmd_str);
> -
> -  // ========= Call vtpm_manager and load VTPM =======
> -  TPMTRYRETURN( buffer_init( &out_param_buf,
> -                             2*sizeof(UINT32) + state_data32.size,
> -                             NULL) );
> -
> -  BSG_PackList(out_param_buf.bytes, 2,
> -                 BSG_TYPE_UINT32, &instance,
> -                 BSG_TPM_SIZE32_DATA, &state_data32);
> -
> -  TPMTRYRETURN( vtpm_manager_open() );
> -  TPMTRYRETURN( vtpm_manager_command(VTPM_ORD_MIGRATE_IN,
> -                                     &out_param_buf,
> -                                     &cmd_status,
> -                                     &empty_buf) );
> -
> -  vtpm_manager_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  // ====== Call hotplug-script and resume instance ======
> -  snprintf(shell_cmd_str, shell_cmd_strlen,
> -       VTPM_SH_CMD_HDR VTPM_SH_RESUME " %d" VTPM_SH_CMD_FTR, instance);
> -  system(shell_cmd_str);
> -
> -  goto egress;
> - abort_egress:
> - egress:
> -  free(shell_cmd_str);
> -
> -  // In this case no params come back, so reuse build_error_msg even for succes.
> -  build_error_msg(result_buf, status);
> -  return;
> -}
> -
> diff --git a/tools/vtpm_manager/tcs/Makefile b/tools/vtpm_manager/tcs/Makefile
> deleted file mode 100644
> index 11af91e..0000000
> --- a/tools/vtpm_manager/tcs/Makefile
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -BIN            = libTCS.a
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIN)
> -
> -.PHONY: install
> -install: build
> -
> -.PHONY: clean
> -clean:
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIN): $(OBJS)
> -       $(AR) rcs $(BIN) $(OBJS)
> diff --git a/tools/vtpm_manager/tcs/contextmgr.c b/tools/vtpm_manager/tcs/contextmgr.c
> deleted file mode 100644
> index cf3803c..0000000
> --- a/tools/vtpm_manager/tcs/contextmgr.c
> +++ /dev/null
> @@ -1,224 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// contextmgr.c
> -//
> -//  This file contains the context management functions for TCS.
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <string.h>
> -#include <malloc.h>
> -#include "tcs.h"
> -#include "contextmgr.h"
> -#include "log.h"
> -#include "hashtable.h"
> -
> -BYTE* AddMemBlock(CONTEXT_HANDLE* pContextHandle, // in
> -                 int    BlockSize)  { // in
> -
> -  BLOCK* pCurrentBlock = NULL;
> -  BLOCK* pBlock = NULL;
> -
> -  // check incoming params
> -  if (pContextHandle == NULL || BlockSize == 0)
> -    return NULL;
> -
> -  // Create New Block
> -  pBlock = (BLOCK *)malloc(sizeof(BLOCK));
> -  if (pBlock == NULL)
> -    return (0);
> -
> -  pBlock->aMemory = (BYTE *)malloc(sizeof(BYTE) * BlockSize);
> -  if (pBlock->aMemory == NULL)
> -    return (0);
> -
> -  memset(pBlock->aMemory, 0, BlockSize);
> -  pBlock->nBlockSize = BlockSize;
> -  pBlock->pNextBlock = NULL;
> -
> -  // search for the last block created where to add the
> -  // newly created block
> -  if(pContextHandle->pTopBlock != NULL) {
> -    pCurrentBlock = pContextHandle->pTopBlock;
> -    while(pCurrentBlock->pNextBlock != NULL)
> -      pCurrentBlock = pCurrentBlock->pNextBlock;
> -
> -
> -    pCurrentBlock->pNextBlock= pBlock;
> -  } else
> -    pContextHandle->pTopBlock = pBlock;
> -
> -
> -  pContextHandle->nBlockCount++;
> -
> -  return pBlock->aMemory;
> -}
> -
> -
> -BOOL DeleteMemBlock(CONTEXT_HANDLE* pContextHandle, // in
> -                    BYTE*   pTCPA_BYTEs) { // in
> -  BLOCK* pCurrentBlock = NULL;
> -  BLOCK* pParentBlock = NULL;
> -  BOOL bFound = FALSE;
> -
> -  if (pContextHandle == NULL)
> -    return FALSE;
> -
> -
> -  // Search for the Block in the context by aMemory pointer
> -  pParentBlock = NULL;
> -  pCurrentBlock = pContextHandle->pTopBlock;
> -
> -  while(pCurrentBlock != NULL) {
> -    // If aMemory block is found, delete it
> -    if(pCurrentBlock->aMemory == pTCPA_BYTEs || pTCPA_BYTEs == NULL) {
> -      // if it is the top Block, remove it from the top,
> -      // otherwise remove it from the ParentBlock and stitch
> -      // the NextBlock to the ParentBlock
> -      if(pParentBlock == NULL)
> -       pContextHandle->pTopBlock = pContextHandle->pTopBlock->pNextBlock;
> -      else
> -       pParentBlock->pNextBlock = pCurrentBlock->pNextBlock;
> -
> -      // delete memory Block associated with pointer pTCPA_BYTEs
> -      free(pCurrentBlock->aMemory);
> -      pCurrentBlock->aMemory = NULL;
> -
> -      free(pCurrentBlock);
> -      pCurrentBlock = pParentBlock;
> -
> -      pContextHandle->nBlockCount--;
> -      bFound = TRUE;
> -    }
> -
> -    if(pCurrentBlock != NULL) {
> -      pParentBlock = pCurrentBlock;
> -      pCurrentBlock = pCurrentBlock->pNextBlock;
> -    }
> -  }
> -
> -  return bFound;
> -}
> -
> -BOOL AddHandleToList(TCS_CONTEXT_HANDLE hContext, // in
> -                    TPM_RESOURCE_TYPE type, // in
> -                    TPM_HANDLE    handle)  { // in
> -  HANDLE_LIST* pNewHandle = NULL;
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Adding Handle to list\n");
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  if (pContextHandle == NULL)
> -    return 0;
> -
> -  pNewHandle = (HANDLE_LIST *)malloc(sizeof(HANDLE_LIST));
> -
> -  if (pNewHandle == NULL)
> -    return (0);
> -
> -  pNewHandle->handle = handle;
> -  pNewHandle->type = type;
> -  pNewHandle->pNextHandle = pContextHandle->pHandleList;
> -
> -  pContextHandle->pHandleList = pNewHandle;
> -
> -  return 1;
> -}
> -
> -BOOL DeleteHandleFromList(   TCS_CONTEXT_HANDLE hContext, // in
> -                             TPM_HANDLE          handle) { // in
> -
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  HANDLE_LIST *pCurrentHandle = pContextHandle->pHandleList,
> -              *pLastHandle = pCurrentHandle;
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Deleting Handle from list\n");
> -
> -  if (pContextHandle == NULL)
> -    return 0;
> -
> -  while (1) {
> -
> -    if (pCurrentHandle->handle == handle) { // Found element
> -      if (pCurrentHandle == pLastHandle) { // First element in list
> -       pContextHandle->pHandleList = pCurrentHandle->pNextHandle;
> -       free(pCurrentHandle);
> -      } else { // Ordinary element
> -       pLastHandle->pNextHandle = pCurrentHandle->pNextHandle;
> -       free(pCurrentHandle);
> -      }
> -
> -      return 1;
> -
> -    } else { // Not found yet;
> -      pLastHandle = pCurrentHandle;
> -      pCurrentHandle = pCurrentHandle->pNextHandle;
> -      if (pCurrentHandle == NULL) // Found end of list
> -       return 0;
> -    }
> -
> -  }
> -}
> -
> -BOOL FreeHandleList(    CONTEXT_HANDLE*     pContextHandle) { // in
> -  HANDLE_LIST* pCurrentHandle;
> -  BOOL returncode = TRUE;
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Freeing all handles for context\n");
> -
> -  if (pContextHandle == NULL)
> -    return 1;
> -
> -  pCurrentHandle = pContextHandle->pHandleList;
> -  while (pCurrentHandle != NULL) {
> -
> -    switch (pCurrentHandle->type) {
> -    case TPM_RT_KEY:
> -      returncode = returncode && !TCSP_EvictKey(pContextHandle->handle, pCurrentHandle->handle);
> -      break;
> -    case TPM_RT_AUTH:
> -      returncode = returncode && !TCSP_TerminateHandle(pContextHandle->handle, pCurrentHandle->handle);
> -      break;
> -    default:
> -      returncode = FALSE;
> -    }
> -
> -    pCurrentHandle = pCurrentHandle->pNextHandle;
> -
> -  }
> -
> -  return 1;
> -}
> diff --git a/tools/vtpm_manager/tcs/contextmgr.h b/tools/vtpm_manager/tcs/contextmgr.h
> deleted file mode 100644
> index e3fdf0f..0000000
> --- a/tools/vtpm_manager/tcs/contextmgr.h
> +++ /dev/null
> @@ -1,82 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// contextmgr.c
> -//
> -//  This file contains the context management functions for TCS.
> -//
> -// ==================================================================
> -
> -#ifndef __CONTEXTMGR_H__
> -#define __CONTEXTMGR_H__
> -
> -#include "tcg.h"
> -
> -#define BLOCK_SIZE 300
> -
> -typedef struct block {
> -  int nBlockSize;
> -  BYTE* aMemory;
> -  struct block* pNextBlock;
> -} BLOCK;
> -
> -typedef struct handle_List {
> -  TPM_HANDLE handle;
> -  TPM_RESOURCE_TYPE type;
> -  struct handle_List* pNextHandle;
> -} HANDLE_LIST;
> -
> -typedef struct context_handle {
> -  TCS_CONTEXT_HANDLE handle;
> -  int nBlockCount;
> -  BLOCK* pTopBlock;
> -  HANDLE_LIST* pHandleList;
> -} CONTEXT_HANDLE;
> -
> -BYTE* AddMemBlock(  CONTEXT_HANDLE*     pContextHandle, // in
> -                    int                 BlockSize);  // in
> -
> -BOOL DeleteMemBlock(CONTEXT_HANDLE* pContextHandle, // in
> -                    BYTE*           pTCPA_BYTEs); // in
> -
> -
> -BOOL AddHandleToList(   TCS_CONTEXT_HANDLE hContext, // in
> -                        TPM_RESOURCE_TYPE   type, // in
> -                        TPM_HANDLE          handle); // in
> -
> -BOOL DeleteHandleFromList(   TCS_CONTEXT_HANDLE hContext, // in
> -                             TPM_HANDLE          handle); // in
> -
> -BOOL FreeHandleList(    CONTEXT_HANDLE*     pContextHandle); // in
> -
> -#endif //_CONTEXTMGR_H_
> diff --git a/tools/vtpm_manager/tcs/tcs.c b/tools/vtpm_manager/tcs/tcs.c
> deleted file mode 100644
> index 7c1378c..0000000
> --- a/tools/vtpm_manager/tcs/tcs.c
> +++ /dev/null
> @@ -1,1192 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tcs.c
> -//
> -//  This file contains the functions that implement a TCS.
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <string.h>
> -#include <malloc.h>
> -
> -#include "tcg.h"
> -#include "bsg.h"
> -#include "tcs.h"
> -#include "contextmgr.h"
> -#include "tpmddl.h"
> -#include "log.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -
> -// Static Global Vars for the TCS
> -static int TCS_m_nCount = 0;
> -
> -#define TCPA_MAX_BUFFER_LENGTH 0x2000
> -
> -static BYTE InBuf [TCPA_MAX_BUFFER_LENGTH];
> -static BYTE OutBuf[TCPA_MAX_BUFFER_LENGTH];
> -
> -struct hashtable *context_ht;
> -
> -// -------------------------- Hash table functions --------------------
> -
> -static unsigned int hashfunc32(void *ky) {
> -  return (* (UINT32 *) ky);
> -}
> -
> -static int equals32(void *k1, void *k2) {
> -  return (*(UINT32 *) k1 == *(UINT32 *) k2);
> -}
> -
> -CONTEXT_HANDLE *LookupContext( TCS_CONTEXT_HANDLE  hContext) {
> -  return( (CONTEXT_HANDLE *) hashtable_search(context_ht, &hContext) );
> -}
> -
> -// ---------------------------------------------------------------------------------
> -// Initialization/Uninitialization SubComponent API
> -// ---------------------------------------------------------------------------------
> -TPM_RESULT TCS_create() {
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TPM_RESULT result = TPM_FAIL;
> -
> -  if (TCS_m_nCount == 0) {
> -    vtpmloginfo(VTPM_LOG_TCS, "Constructing new TCS:\n");
> -    hRes = TDDL_Open();
> -
> -    context_ht = create_hashtable(10, hashfunc32, equals32);
> -
> -    if ((hRes == TDDL_SUCCESS) && (context_ht != NULL)) {
> -      result = TPM_SUCCESS;
> -      TCS_m_nCount++;
> -    } else {
> -      result = TPM_IOERROR;
> -      hashtable_destroy(context_ht, 1);
> -    }
> -  } else
> -    TCS_m_nCount++;
> -
> -  return(result);
> -}
> -
> -
> -void TCS_destroy()
> -{
> -  TCS_m_nCount--;
> -
> -  if (TCS_m_nCount == 0) {
> -    vtpmloginfo(VTPM_LOG_TCS, "Destructing TCS:\n");
> -    TDDL_Close();
> -
> -    struct hashtable_itr *context_itr;
> -    TCS_CONTEXT_HANDLE  *hContext;
> -
> -    // Close all the TCS contexts. TCS should evict keys based on this
> -    if (hashtable_count(context_ht) > 0) {
> -      context_itr = hashtable_iterator(context_ht);
> -      do {
> -        hContext = (TCS_CONTEXT_HANDLE *) hashtable_iterator_key(context_itr);
> -       if (TCS_CloseContext(*hContext) != TPM_SUCCESS)
> -           vtpmlogerror(VTPM_LOG_TCS, "Failed to close context %d properly.\n", *hContext);
> -
> -      } while (hashtable_iterator_advance(context_itr));
> -      free(context_itr);
> -    }
> -    hashtable_destroy(context_ht, 1);
> -  }
> -
> -}
> -
> -TPM_RESULT TCS_Malloc(  TCS_CONTEXT_HANDLE  hContext, // in
> -                        UINT32              MemSize, // in
> -                        BYTE**              ppMemPtr) {// out
> -
> -  TPM_RESULT returnCode = TPM_FAIL;
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  if (pContextHandle != NULL && ppMemPtr != NULL) {
> -    *ppMemPtr = (BYTE *)AddMemBlock(pContextHandle, MemSize);
> -    returnCode = TPM_SUCCESS;
> -  }
> -
> -  return returnCode;
> -}
> -
> -TPM_RESULT TCS_FreeMemory(  TCS_CONTEXT_HANDLE  hContext, // in
> -                            BYTE*               pMemory) { // in
> -  TPM_RESULT returnCode = TPM_FAIL;
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  if ( (pContextHandle != NULL && pMemory != NULL) &&
> -       (DeleteMemBlock(pContextHandle, pMemory) == TRUE) )
> -    returnCode = TPM_SUCCESS;
> -
> -
> -  return returnCode;
> -}
> -
> -TPM_RESULT TCS_OpenContext(TCS_CONTEXT_HANDLE* hContext) { // out
> -  TPM_RESULT returnCode = TPM_FAIL;
> -  TCS_CONTEXT_HANDLE *newContext;
> -
> -  vtpmloginfo(VTPM_LOG_TCS, "Calling TCS_OpenContext:\n");
> -
> -  if (hContext) {
> -    CONTEXT_HANDLE* pContextHandle = (CONTEXT_HANDLE *) malloc(sizeof(CONTEXT_HANDLE));
> -    if (pContextHandle == NULL)
> -      return TPM_SIZE;
> -
> -    // initialize to 0
> -    pContextHandle->nBlockCount = 0;
> -    pContextHandle->pTopBlock = NULL;
> -    pContextHandle->pHandleList = NULL;
> -
> -    // Create New Block
> -    AddMemBlock(pContextHandle, BLOCK_SIZE);
> -
> -    newContext = (TCS_CONTEXT_HANDLE *) malloc(sizeof(TCS_CONTEXT_HANDLE));
> -    *newContext = (TCS_CONTEXT_HANDLE) (((uintptr_t) pContextHandle >> 2) & 0xffffffff);
> -
> -    if (hashtable_search(context_ht, &newContext) !=NULL)
> -       *newContext += 1;
> -
> -    pContextHandle->handle = *newContext;
> -    if (!hashtable_insert(context_ht, newContext, pContextHandle)) {
> -        free(newContext);
> -        free(pContextHandle);
> -       returnCode = TPM_FAIL;
> -    } else {
> -       *hContext = *newContext;
> -       returnCode = TPM_SUCCESS;
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCS_CloseContext(TCS_CONTEXT_HANDLE hContext) {// in
> -  //FIXME: TCS SHOULD Track failed auths and make sure
> -  //we don't try and re-free them here.
> -  TPM_RESULT returnCode = TPM_FAIL;
> -
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  if(pContextHandle != NULL) {
> -    // Print test info
> -    vtpmloginfo(VTPM_LOG_TCS, "Calling TCS_CloseContext.\n");
> -
> -    // free memory for all the blocks
> -    DeleteMemBlock(pContextHandle, NULL );
> -    pContextHandle->pTopBlock = NULL;
> -
> -    FreeHandleList(pContextHandle);
> -    if (pContextHandle->pHandleList != NULL)
> -      vtpmlogerror(VTPM_LOG_TCS, "Not all handles evicted from TPM.\n");
> -
> -    // Release the TPM's resources
> -    if (hashtable_remove(context_ht, &hContext) == NULL)
> -      vtpmlogerror(VTPM_LOG_TCS, "Not all handles evicted from TPM.\n");
> -
> -    free(pContextHandle);
> -    returnCode = TPM_SUCCESS;
> -  }
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Finished closing context\n");
> -  return(returnCode);
> -}
> -
> -// ------------------------------------------------------------------
> -// Internal Functions
> -// ------------------------------------------------------------------
> -int packAuth(BYTE* dst, TCS_AUTH* auth) {
> -  // CHECK: according to the command specs, the outgoing auth params are:
> -  // nonceEven
> -  // nonceOdd
> -  // continueAuthSession
> -  // auth digest for return params
> -  //
> -  // this is a bit different than this code...
> -
> -  return BSG_PackList(dst, 4,
> -                     BSG_TYPE_UINT32, &(auth->AuthHandle),
> -                     BSG_TPM_NONCE, &(auth->NonceOdd),
> -                     BSG_TYPE_BOOL, &(auth->fContinueAuthSession),
> -                     BSG_TPM_AUTHDATA, &(auth->HMAC));
> -}
> -
> -int unpackAuth(TCS_AUTH* auth, BYTE* src) {
> -  return BSG_UnpackList(src, 3,
> -                       BSG_TPM_NONCE, &(auth->NonceEven),
> -                       BSG_TYPE_BOOL, &(auth->fContinueAuthSession),
> -                       BSG_TPM_AUTHDATA, &(auth->HMAC));
> -}
> -
> -// ------------------------------------------------------------------
> -// Authorization Commands
> -// ------------------------------------------------------------------
> -
> -TPM_RESULT TCSP_OIAP(TCS_CONTEXT_HANDLE hContext, // in
> -                    TCS_AUTHHANDLE*  authHandle, // out
> -                    TPM_NONCE*   nonce0)  // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_OIAP;
> -  UINT32 paramSize = 0;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (authHandle == NULL || nonce0 == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 3,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal);
> -
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -      == TDDL_SUCCESS) {
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList( OutBuf, 3,
> -                           BSG_TPM_TAG, &tag,
> -                           BSG_TYPE_UINT32, &paramSize,
> -                           BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Extract the remaining output parameters
> -      BSG_UnpackList(OutBuf+i, 2,
> -                    BSG_TYPE_UINT32, authHandle,
> -                    BSG_TPM_NONCE, nonce0);
> -
> -      if (!AddHandleToList(hContext, TPM_RT_AUTH, *authHandle))
> -        vtpmlogerror(VTPM_LOG_TCS, "New AuthHandle not recorded\n");
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "Failed with return code %s\n", tpm_get_error_name(returnCode));
> -
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_OSAP(TCS_CONTEXT_HANDLE hContext,  // in
> -                    TPM_ENTITY_TYPE  entityType,  // in
> -                    UINT32    entityValue, // in
> -                    TPM_NONCE   nonceOddOSAP, // in
> -                    TCS_AUTHHANDLE*  authHandle,  // out
> -                    TPM_NONCE*   nonceEven,  // out
> -                    TPM_NONCE*   nonceEvenOSAP) // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_OSAP;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (authHandle == NULL || nonceEven == NULL || nonceEvenOSAP == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 6,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT16, &entityType,
> -                         BSG_TYPE_UINT32, &entityValue,
> -                         BSG_TPM_NONCE, &nonceOddOSAP);
> -
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -            == TDDL_SUCCESS) {
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Extract the remaining output parameters
> -      BSG_UnpackList(OutBuf+i, 3,
> -                    BSG_TYPE_UINT32, authHandle,
> -                    BSG_TPM_NONCE, nonceEven,
> -                    BSG_TPM_NONCE, nonceEvenOSAP);
> -
> -      if (!AddHandleToList(hContext, TPM_RT_AUTH, *authHandle)) {
> -           vtpmlogerror(VTPM_LOG_TCS, "New AuthHandle not recorded\n");
> -      }
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "Failed with return code %s\n", tpm_get_error_name(returnCode));
> -
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_TakeOwnership(TCS_CONTEXT_HANDLE hContext,   // in
> -                             UINT16    protocolID,   // in
> -                             UINT32    encOwnerAuthSize, // in
> -                             BYTE*    encOwnerAuth,  // in
> -                             UINT32    encSrkAuthSize,  // in
> -                             BYTE*    encSrkAuth,   // in
> -                             UINT32*    SrkSize,   // in, out
> -                             BYTE**    Srk,    // in, out
> -                             TCS_AUTH*   ownerAuth)   // in, out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_TakeOwnership;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (encOwnerAuth == NULL || encSrkAuth == NULL || SrkSize == NULL || *Srk == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 5,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT16, &protocolID,
> -                         BSG_TYPE_UINT32, &encOwnerAuthSize);
> -
> -  memcpy(InBuf+InLength, encOwnerAuth, encOwnerAuthSize);
> -  InLength += encOwnerAuthSize;
> -  InLength += BSG_Pack(   BSG_TYPE_UINT32,
> -                         &encSrkAuthSize,
> -                         InBuf+InLength);
> -  memcpy(InBuf+InLength, encSrkAuth, encSrkAuthSize);
> -  InLength += encSrkAuthSize;
> -  memcpy(InBuf+InLength, *Srk, *SrkSize);
> -  InLength += *SrkSize;
> -  InLength += packAuth(InBuf+InLength, ownerAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32,
> -          &InLength,
> -          InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS){
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList( OutBuf, 3,
> -                           BSG_TPM_TAG, &tag,
> -                           BSG_TYPE_UINT32, &paramSize,
> -                           BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      TPM_KEY srkPub;
> -      i += BSG_Unpack(BSG_TPM_KEY,  OutBuf+i,  &srkPub);
> -      unpackAuth(ownerAuth, OutBuf+i);
> -
> -      // fill output params
> -      BYTE tempBuf[1024];
> -      *SrkSize = BSG_Pack(BSG_TPM_KEY,  &srkPub, tempBuf);
> -      if (TCS_Malloc(hContext, *SrkSize, Srk) == TPM_FAIL) {
> -       return(TPM_SIZE);
> -      }
> -      memcpy(*Srk, tempBuf, *SrkSize);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_TakeOwnership Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_DisablePubekRead (  TCS_CONTEXT_HANDLE hContext, // in
> -                                    TCS_AUTH*   ownerAuth) { // in, out
> -
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_DisablePubekRead;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 3,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal);
> -
> -  InLength += packAuth(InBuf+InLength, ownerAuth);
> -
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS){
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList( OutBuf, 3,
> -                           BSG_TPM_TAG, &tag,
> -                           BSG_TYPE_UINT32, &paramSize,
> -                           BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      unpackAuth(ownerAuth, OutBuf+i);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_DisablePubekRead Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_TerminateHandle(TCS_CONTEXT_HANDLE hContext, // in
> -                                TCS_AUTHHANDLE  handle)  // in
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_Terminate_Handle;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &handle);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS) {
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (!DeleteHandleFromList(hContext, handle))
> -      vtpmlogerror(VTPM_LOG_TCS, "KeyHandle not removed from list\n");
> -
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Print debug info
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_TerminateHandle Failed with return code %s\n", tpm_get_error_name(returnCode));
> -
> -  }
> -
> -  return(returnCode);
> -}
> -
> -// TPM Mandatory
> -TPM_RESULT TCSP_Extend( TCS_CONTEXT_HANDLE hContext, // in
> -                        TPM_PCRINDEX  pcrNum,  // in
> -                        TPM_DIGEST  inDigest, // in
> -                        TPM_PCRVALUE*  outDigest) // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_Extend;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 5,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &pcrNum,
> -                         BSG_TPM_DIGEST, &inDigest);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS) {
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND){
> -      // Extract the remaining output parameters
> -      BSG_Unpack(BSG_TPM_PCRVALUE, OutBuf+i, outDigest);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Extend Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_Seal(   TCS_CONTEXT_HANDLE hContext,  // in
> -                        TCS_KEY_HANDLE  keyHandle,  // in
> -                        TPM_ENCAUTH   encAuth,  // in
> -                        UINT32    pcrInfoSize, // in
> -                        BYTE*    PcrInfo,  // in
> -                        UINT32    inDataSize,  // in
> -                        BYTE*    inData,   // in
> -                        TCS_AUTH*   pubAuth,  // in, out
> -                        UINT32*    SealedDataSize, // out
> -                        BYTE**    SealedData)  // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_Seal;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (inData == NULL || pubAuth == NULL || SealedDataSize == NULL || SealedData == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 6,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &keyHandle,
> -                         BSG_TPM_ENCAUTH, encAuth,
> -                         BSG_TYPE_UINT32, &pcrInfoSize);
> -  memcpy(InBuf+InLength, PcrInfo, pcrInfoSize);
> -  InLength += pcrInfoSize;
> -  InLength += BSG_Pack(BSG_TYPE_UINT32, &inDataSize, InBuf+InLength);
> -  memcpy(InBuf+InLength, inData, inDataSize);
> -  InLength += inDataSize;
> -  InLength += packAuth(InBuf+InLength, pubAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      TPM_STORED_DATA sealedData;
> -
> -      i += BSG_Unpack(BSG_TPM_STORED_DATA, OutBuf+i, &sealedData);
> -      unpackAuth(pubAuth, OutBuf+i);
> -
> -      // fill SealedData
> -      BYTE tempBuf[1024];
> -      *SealedDataSize = BSG_Pack(BSG_TPM_STORED_DATA, &sealedData, tempBuf);
> -      if (TCS_Malloc(hContext, *SealedDataSize, SealedData) == TPM_FAIL) {
> -       return TPM_SIZE;
> -      }
> -      memcpy(*SealedData, tempBuf, *SealedDataSize);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Seal Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_Unseal(TCS_CONTEXT_HANDLE hContext,  // in
> -                      TCS_KEY_HANDLE  parentHandle, // in
> -                      UINT32    SealedDataSize, // in
> -                      BYTE*    SealedData,  // in
> -                      TCS_AUTH*   parentAuth,  // in, out
> -                      TCS_AUTH*   dataAuth,  // in, out
> -                      UINT32*   DataSize,  // out
> -                      BYTE**    Data)   // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH2_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_Unseal;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (SealedData == NULL || parentAuth == NULL || dataAuth == NULL ||
> -      DataSize == NULL || Data == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                                     BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &ordinal,
> -                          BSG_TYPE_UINT32, &parentHandle);
> -  memcpy(InBuf+InLength, SealedData, SealedDataSize);
> -  InLength += SealedDataSize;
> -  InLength += packAuth(InBuf+InLength, parentAuth);
> -  InLength += packAuth(InBuf+InLength, dataAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList( OutBuf, 3,
> -                            BSG_TPM_TAG, &tag,
> -                            BSG_TYPE_UINT32, &paramSize,
> -                            BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH2_COMMAND) {
> -      // Extract the remaining output parameters
> -      i += BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, DataSize);
> -      if (TCS_Malloc(hContext, *DataSize, Data) == TPM_FAIL) {
> -        return TPM_SIZE;
> -      }
> -      memcpy(*Data, OutBuf+i, *DataSize);
> -      i += *DataSize;
> -      i += unpackAuth(parentAuth, OutBuf+i);
> -      unpackAuth(dataAuth, OutBuf+i);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Unseal Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_UnBind(TCS_CONTEXT_HANDLE hContext,  // in
> -                      TCS_KEY_HANDLE  keyHandle,  // in
> -                      UINT32    inDataSize,  // in
> -                      BYTE*    inData,   // in
> -                      TCS_AUTH*   privAuth,  // in, out
> -                      UINT32*   outDataSize, // out
> -                      BYTE**    outData)  // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_UnBind;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (inData == NULL || privAuth == NULL || outDataSize == NULL || outData == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 5,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &keyHandle,
> -                         BSG_TYPE_UINT32, &inDataSize);
> -  memcpy(InBuf+InLength, inData, inDataSize);
> -  InLength += inDataSize;
> -  InLength += packAuth(InBuf+InLength, privAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "\n\tSending paramSize = %d", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      i += BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, outDataSize);
> -      if (TCS_Malloc(hContext, *outDataSize, outData) == TPM_FAIL)
> -        return TPM_SIZE;
> -
> -      memcpy(*outData, OutBuf+i, *outDataSize);
> -      i += *outDataSize;
> -      unpackAuth(privAuth, OutBuf+i);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_UnBind Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_CreateWrapKey(TCS_CONTEXT_HANDLE hContext,   // in
> -                             TCS_KEY_HANDLE  hWrappingKey,  // in
> -                             TPM_ENCAUTH  KeyUsageAuth,  // in
> -                             TPM_ENCAUTH  KeyMigrationAuth, // in
> -                             UINT32*    pcKeySize,   // in, out
> -                             BYTE**    prgbKey,   // in, out
> -                             TCS_AUTH*   pAuth)    // in, out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_CreateWrapKey;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (pcKeySize == NULL || *prgbKey == NULL || pAuth == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 6,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &hWrappingKey,
> -                         BSG_TPM_ENCAUTH, KeyUsageAuth,
> -                         BSG_TPM_ENCAUTH, KeyMigrationAuth);
> -  memcpy(InBuf+InLength, *prgbKey, *pcKeySize);
> -  InLength += *pcKeySize;
> -  InLength += packAuth(InBuf+InLength, pAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_RESULT, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      TPM_KEY wrappedKey;
> -
> -      i += BSG_Unpack(BSG_TPM_KEY, OutBuf+i, &wrappedKey);
> -      unpackAuth(pAuth, OutBuf+i);
> -
> -      // Fill prgbKey
> -      BYTE tempBuf[1024];
> -      *pcKeySize = BSG_Pack(BSG_TPM_KEY, &wrappedKey, tempBuf);
> -      if (TCS_Malloc(hContext, *pcKeySize, prgbKey) == TPM_FAIL)
> -        return TPM_SIZE;
> -
> -      memcpy(*prgbKey, tempBuf, *pcKeySize);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_CreateWrapKey Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_LoadKeyByBlob(TCS_CONTEXT_HANDLE hContext,    // in
> -                             TCS_KEY_HANDLE  hUnwrappingKey,   // in
> -                             UINT32    cWrappedKeyBlobSize, // in
> -                             BYTE*    rgbWrappedKeyBlob,  // in
> -                             TCS_AUTH*   pAuth,     // in, out
> -                             TCS_KEY_HANDLE*  phKeyTCSI,    // out
> -                             TCS_KEY_HANDLE*  phKeyHMAC)    // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_LoadKey;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (rgbWrappedKeyBlob == NULL || pAuth == NULL || phKeyTCSI == NULL || phKeyHMAC == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  *phKeyHMAC = hUnwrappingKey; // the parent key is the one that the TPM use to make the HMAC calc
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &hUnwrappingKey);
> -  memcpy(InBuf+InLength, rgbWrappedKeyBlob, cWrappedKeyBlobSize);
> -  InLength += cWrappedKeyBlobSize;
> -  InLength += packAuth(InBuf+InLength, pAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      i += BSG_Unpack(BSG_TYPE_UINT32,
> -                     OutBuf+i,
> -                     phKeyTCSI);
> -      unpackAuth(pAuth, OutBuf+i);
> -
> -      if (!AddHandleToList(hContext, TPM_RT_KEY, *phKeyTCSI)) {
> -        vtpmlogerror(VTPM_LOG_TCS, "New KeyHandle not recorded\n");
> -      }
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -     } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_LoadKeyByBlob Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_EvictKey(TCS_CONTEXT_HANDLE hContext, // in
> -                        TCS_KEY_HANDLE  hKey)  // in
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_EvictKey;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &hKey);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (!DeleteHandleFromList(hContext, hKey)) {
> -      vtpmlogerror(VTPM_LOG_TCS, "KeyHandle not removed from list\n");
> -    }
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else {
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_EvictKey Failed with return code %s\n", tpm_get_error_name(returnCode));
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_GetRandom(TCS_CONTEXT_HANDLE hContext,  // in
> -                         UINT32*    bytesRequested, // in, out
> -                         BYTE**    randomBytes) // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_GetRandom;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (bytesRequested == NULL || *randomBytes == NULL){
> -    return TPM_BAD_PARAMETER;
> -  }
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, bytesRequested);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Extract the remaining output parameters
> -      BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, bytesRequested);
> -      if (TCS_Malloc(hContext, *bytesRequested, randomBytes) == TPM_FAIL) {
> -        return TPM_SIZE;
> -      }
> -      memcpy(*randomBytes, OutBuf+i+sizeof(UINT32), *bytesRequested);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else {
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_GetRandom Failed with return code %s\n", tpm_get_error_name(returnCode));
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_ReadPubek(TCS_CONTEXT_HANDLE   hContext,               // in
> -                         TPM_NONCE            antiReplay,             // in
> -                         UINT32*              pubEndorsementKeySize,  // out
> -                         BYTE**               pubEndorsementKey,      // out
> -                         TPM_DIGEST*          checksum)               // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_ReadPubek;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32   OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (pubEndorsementKeySize == NULL || pubEndorsementKey == NULL || checksum == NULL) {
> -    return TPM_BAD_PARAMETER;
> -  }
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TPM_NONCE, &antiReplay);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Extract the remaining output parameters
> -      TPM_PUBKEY pubEK;
> -      i += BSG_UnpackList(OutBuf+i, 2,
> -                         BSG_TPM_PUBKEY, &pubEK,
> -                         BSG_TPM_DIGEST, checksum);
> -
> -      // fill EndorsementKey
> -      BYTE tempBuf[1024];
> -      *pubEndorsementKeySize = BSG_Pack(BSG_TPM_PUBKEY, &pubEK, tempBuf);
> -      if (TCS_Malloc(hContext, *pubEndorsementKeySize, pubEndorsementKey) == TPM_FAIL) {
> -        return TPM_SIZE;
> -      }
> -      memcpy(*pubEndorsementKey, tempBuf, *pubEndorsementKeySize);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else {
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_ReadPubek Failed with return code %s\n", tpm_get_error_name(returnCode));
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_SaveState(TCS_CONTEXT_HANDLE   hContext)  // in
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_SaveState;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &ordinal);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    BSG_UnpackList(OutBuf, 3,
> -                           BSG_TPM_TAG, &tag,
> -                           BSG_TYPE_UINT32, &paramSize,
> -                           BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else {
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_SaveState Failed with return code %s\n", tpm_get_error_name(returnCode));
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_RawTransmitData(   UINT32 inDataSize,  // in
> -                                  BYTE *inData,       // in
> -                                  UINT32 *outDataSize,// in/out
> -                                  BYTE *outData) {    // out
> -
> -  TDDL_RESULT hRes;
> -
> -  vtpmloginfo(VTPM_LOG_TCS, "Calling TransmitData directly.\n");
> -  //FIXME: Add Context Management
> -  hRes = TDDL_TransmitData( inData,
> -                           inDataSize,
> -                           outData,
> -                           outDataSize);
> -
> -  if (hRes == TDDL_SUCCESS) {
> -    return TPM_SUCCESS;
> -  } else {
> -    vtpmlogerror(VTPM_LOG_TCS, "TCSP_RawTransmitData Failed with return code %s\n", tpm_get_error_name(TPM_IOERROR));
> -    return TPM_IOERROR;
> -  }
> -
> -}
> diff --git a/tools/vtpm_manager/tcs/tcs.h b/tools/vtpm_manager/tcs/tcs.h
> deleted file mode 100644
> index 83b9cd0..0000000
> --- a/tools/vtpm_manager/tcs/tcs.h
> +++ /dev/null
> @@ -1,245 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tcs.h
> -//
> -//  This file declares the TCS API
> -//
> -// ==================================================================
> -
> -#ifndef __TCS_H__
> -#define __TCS_H__
> -
> -#include "tcg.h"
> -#include "contextmgr.h"
> -#include "buffer.h"
> -
> -#define HANDLE_NULL 0
> -
> -// ------------------------------------------------------------------
> -// Exposed API
> -// ------------------------------------------------------------------
> -
> -TPM_RESULT TCS_create();
> -void TCS_destroy();
> -
> -TPM_RESULT TCS_OpenContext( /* OUT */ TCS_CONTEXT_HANDLE* hContext );
> -
> -TPM_RESULT TCS_CloseContext ( /* IN */ TCS_CONTEXT_HANDLE hContext );
> -
> -TPM_RESULT TCS_Malloc ( TCS_CONTEXT_HANDLE hContext, // in
> -                       UINT32   MemSize, // in
> -                       BYTE**   ppMemPtr ); //out
> -
> -TPM_RESULT TCS_FreeMemory ( TCS_CONTEXT_HANDLE hContext, // in
> -                           BYTE*    pMemory);  // in
> -
> -// ------------------------------------------------------------------
> -// Exposed API
> -// ------------------------------------------------------------------
> -
> -// TPM v1.1B Command Set
> -
> -// Authorzation
> -TPM_RESULT TCSP_OIAP( TCS_CONTEXT_HANDLE hContext, // in
> -                     TCS_AUTHHANDLE*  authHandle, // out
> -                     TPM_NONCE*   nonce0  // out
> -                     );
> -
> -TPM_RESULT TCSP_OSAP (  TCS_CONTEXT_HANDLE hContext,  // in
> -                       TPM_ENTITY_TYPE entityType,  // in
> -                       UINT32    entityValue, // in
> -                       TPM_NONCE   nonceOddOSAP, // in
> -                       TCS_AUTHHANDLE*  authHandle,  // out
> -                       TPM_NONCE*   nonceEven,  // out
> -                       TPM_NONCE*   nonceEvenOSAP // out
> -                       );
> -
> -TPM_RESULT TCSP_TakeOwnership (  TCS_CONTEXT_HANDLE hContext,   // in
> -                                UINT16    protocolID,   // in
> -                                UINT32    encOwnerAuthSize, // in
> -                                BYTE*    encOwnerAuth,  // in
> -                                UINT32    encSrkAuthSize,  // in
> -                                BYTE*    encSrkAuth,   // in
> -                                UINT32*    SrkSize,   // in, out
> -                                BYTE**    Srk,    // in, out
> -                                TCS_AUTH*   ownerAuth   // in, out
> -                                );
> -
> -TPM_RESULT TCSP_DisablePubekRead (  TCS_CONTEXT_HANDLE hContext, // in
> -                                    TCS_AUTH*   ownerAuth // in, out
> -                                    );
> -
> -TPM_RESULT TCSP_TerminateHandle (  TCS_CONTEXT_HANDLE hContext, // in
> -                                  TCS_AUTHHANDLE  handle  // in
> -                                  );
> -
> -TPM_RESULT TCSP_FlushSpecific (  TCS_CONTEXT_HANDLE hContext, // in
> -                                TCS_AUTHHANDLE  handle,  // in
> -                                TPM_RESOURCE_TYPE resourceType //in
> -                                );
> -
> -// TPM Mandatory
> -TPM_RESULT TCSP_Extend (  TCS_CONTEXT_HANDLE hContext, // in
> -                         TPM_PCRINDEX  pcrNum,  // in
> -                         TPM_DIGEST   inDigest, // in
> -                         TPM_PCRVALUE*   outDigest // out
> -                         );
> -
> -TPM_RESULT TCSP_PcrRead (  TCS_CONTEXT_HANDLE hContext, // in
> -                          TPM_PCRINDEX  pcrNum,  // in
> -                          TPM_PCRVALUE*  outDigest // out
> -                          );
> -
> -TPM_RESULT TCSP_Quote (  TCS_CONTEXT_HANDLE hContext,  // in
> -                        TCS_KEY_HANDLE  keyHandle,  // in
> -                        TPM_NONCE   antiReplay,  // in
> -                        UINT32*    PcrDataSize, // in, out
> -                        BYTE**    PcrData,  // in, out
> -                        TCS_AUTH*   privAuth,  // in, out
> -                        UINT32*    sigSize,  // out
> -                        BYTE**    sig    // out
> -                        );
> -
> -TPM_RESULT TCSP_Seal (  TCS_CONTEXT_HANDLE hContext,  // in
> -                       TCS_KEY_HANDLE  keyHandle,  // in
> -                       TPM_ENCAUTH  encAuth,  // in
> -                       UINT32    pcrInfoSize, // in
> -                       BYTE*    PcrInfo,  // in
> -                       UINT32    inDataSize,  // in
> -                       BYTE*    inData,   // in
> -                       TCS_AUTH*   pubAuth,  // in, out
> -                       UINT32*    SealedDataSize, // out
> -                       BYTE**    SealedData  // out
> -                       );
> -
> -TPM_RESULT TCSP_Unseal (  TCS_CONTEXT_HANDLE hContext,  // in
> -                         TCS_KEY_HANDLE  parentHandle, // in
> -                         UINT32    SealedDataSize, // in
> -                         BYTE*    SealedData,  // in
> -                         TCS_AUTH*   parentAuth,  // in, out
> -                         TCS_AUTH*   dataAuth,  // in, out
> -                         UINT32*    DataSize,  // out
> -                         BYTE**    Data   // out
> -                         );
> -
> -TPM_RESULT TCSP_DirWriteAuth (  TCS_CONTEXT_HANDLE hContext,  // in
> -                               TPM_DIRINDEX  dirIndex,  // in
> -                               TPM_DIRVALUE  newContents, // in
> -                               TCS_AUTH*   ownerAuth  // in, out
> -                               );
> -
> -TPM_RESULT TCSP_DirRead (  TCS_CONTEXT_HANDLE hContext, // in
> -                          TPM_DIRINDEX  dirIndex, // in
> -                          TPM_DIRVALUE*  dirValue // out
> -                          );
> -
> -TPM_RESULT TCSP_UnBind (  TCS_CONTEXT_HANDLE hContext,  // in
> -                         TCS_KEY_HANDLE  keyHandle,  // in
> -                         UINT32    inDataSize,  // in
> -                         BYTE*    inData,   // in
> -                         TCS_AUTH*   privAuth,  // in, out
> -                         UINT32*    outDataSize, // out
> -                         BYTE**    outData   // out
> -                         );
> -
> -TPM_RESULT TCSP_CreateWrapKey (  TCS_CONTEXT_HANDLE hContext,   // in
> -                                TCS_KEY_HANDLE  hWrappingKey,  // in
> -                                TPM_ENCAUTH  KeyUsageAuth,  // in
> -                                TPM_ENCAUTH  KeyMigrationAuth, // in
> -                                UINT32*    pcKeySize,   // in, out
> -                                BYTE**    prgbKey,   // in, out
> -                                TCS_AUTH*   pAuth    // in, out
> -                                );
> -
> -TPM_RESULT TCSP_LoadKeyByBlob (  TCS_CONTEXT_HANDLE hContext,    // in
> -                                TCS_KEY_HANDLE  hUnwrappingKey,   // in
> -                                UINT32    cWrappedKeyBlobSize, // in
> -                                BYTE*    rgbWrappedKeyBlob,  // in
> -                                TCS_AUTH*   pAuth,     // in, out
> -                                TCS_KEY_HANDLE*  phKeyTCSI,    // out
> -                                TCS_KEY_HANDLE*  phKeyHMAC    // out
> -                                );
> -
> -TPM_RESULT TCSP_GetPubKey (  TCS_CONTEXT_HANDLE hContext,  // in
> -                            TCS_KEY_HANDLE  hKey,   // in
> -                            TCS_AUTH*   pAuth,   // in, out
> -                            UINT32*    pcPubKeySize, // out
> -                            BYTE**    prgbPubKey  // out
> -                            );
> -
> -TPM_RESULT TCSP_EvictKey (  TCS_CONTEXT_HANDLE hContext, // in
> -                           TCS_KEY_HANDLE  hKey  // in
> -                           );
> -
> -TPM_RESULT TCSP_Sign (  TCS_CONTEXT_HANDLE hContext,  // in
> -                       TCS_KEY_HANDLE  keyHandle,  // in
> -                       UINT32    areaToSignSize, // in
> -                       BYTE*    areaToSign,  // in
> -                       TCS_AUTH*   privAuth,  // in, out
> -                       UINT32*    sigSize,  // out
> -                       BYTE**    sig    // out
> -                       );
> -
> -TPM_RESULT TCSP_GetRandom (  TCS_CONTEXT_HANDLE hContext,  // in
> -                            UINT32*    bytesRequested, // in, out
> -                            BYTE**    randomBytes  // out
> -                            );
> -
> -TPM_RESULT TCSP_StirRandom (  TCS_CONTEXT_HANDLE hContext, // in
> -                             UINT32    inDataSize, // in
> -                             BYTE*    inData  // in
> -                             );
> -
> -TPM_RESULT TCSP_ReadPubek (  TCS_CONTEXT_HANDLE hContext,    // in
> -                            TPM_NONCE   antiReplay,    // in
> -                            UINT32*    pubEndorsementKeySize, // out
> -                            BYTE**    pubEndorsementKey,  // out
> -                            TPM_DIGEST*  checksum    // out
> -                            );
> -
> -
> -// Non-Standard TCSP calls
> -TPM_RESULT TCSP_SaveState(TCS_CONTEXT_HANDLE   hContext);  // in
> -
> -//Give direct access to TransmitData.
> -// Key and Auth Management is done before transfering command to TDDL.
> -TPM_RESULT TCSP_RawTransmitData(UINT32 inDataSize,  // in
> -                               BYTE *inData,       // in
> -                               UINT32 *outDataSize,// in/out
> -                               BYTE *outData);     // out
> -
> -///////////// Private Functions ////////////////////
> -CONTEXT_HANDLE* LookupContext( TCS_CONTEXT_HANDLE hContext);
> -
> -#endif //TCS_H
> diff --git a/tools/vtpm_manager/tcs/tpmddl.h b/tools/vtpm_manager/tcs/tpmddl.h
> deleted file mode 100644
> index e7e54f1..0000000
> --- a/tools/vtpm_manager/tcs/tpmddl.h
> +++ /dev/null
> @@ -1,69 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tpmddl.c
> -//
> -//  This file defines the TDDLI API
> -//
> -// ==================================================================
> -
> -#ifndef __TPMDDL_H__
> -#define __TPMDDL_H__
> -
> -#define TDDL_CAP_PROP_MANUFACTURER 0x0001
> -
> -#define TDDL_E_FAIL 1
> -#define TDDL_E_SUCCESS 0
> -#define TDDL_SUCCESS 0
> -
> -typedef unsigned int TDDL_UINT32;
> -typedef TDDL_UINT32 TDDL_RESULT;
> -typedef unsigned char TDDL_BYTE;
> -
> -TDDL_RESULT TDDL_Open();
> -void TDDL_Close();
> -TDDL_RESULT TDDL_TransmitData( TDDL_BYTE* in,
> -                              TDDL_UINT32 insize,
> -                              TDDL_BYTE* out,
> -                              TDDL_UINT32* outsize);
> -TDDL_RESULT TDDL_GetStatus();
> -TDDL_RESULT TDDL_GetCapability( TDDL_UINT32 cap,
> -                               TDDL_UINT32 sub,
> -                               TDDL_BYTE* buffer,
> -                               TDDL_UINT32* size);
> -TDDL_RESULT TDDL_SetCapability( TDDL_UINT32 cap,
> -                               TDDL_UINT32 sub,
> -                               TDDL_BYTE* buffer,
> -                               TDDL_UINT32* size);
> -
> -#endif // __TPMDDL_H__
> diff --git a/tools/vtpm_manager/tcs/transmit.c b/tools/vtpm_manager/tcs/transmit.c
> deleted file mode 100644
> index 74bbdca..0000000
> --- a/tools/vtpm_manager/tcs/transmit.c
> +++ /dev/null
> @@ -1,147 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <unistd.h>
> -#include <stdio.h>
> -#include <errno.h>
> -#include <fcntl.h>
> -
> -#include "tcg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "tpmddl.h"
> -
> -// flag to track whether TDDL has been opened
> -static int g_TDDL_open = 0;
> -static int g_tx_fd = -1;              // the fd to the TPM
> -
> -#ifndef DUMMY_TPM
> - #define TPM_TX_FNAME "/dev/tpm0"
> - static int *g_rx_fdp = &g_tx_fd;
> -#else
> - #define TPM_TX_FNAME "/var/tpm/tpm_in.fifo"
> - #define TPM_RX_FNAME "/var/tpm/tpm_out.fifo"
> - static int g_rx_fd = -1;
> - static int *g_rx_fdp = &g_rx_fd;              // the fd to the TPM
> -#endif
> -
> -TPM_RESULT
> -TDDL_TransmitData( TDDL_BYTE* in,
> -                  TDDL_UINT32 insize,
> -                  TDDL_BYTE* out,
> -                  TDDL_UINT32* outsize) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TDDL_UINT32 i;
> -
> -  vtpmloginfo(VTPM_LOG_TXDATA, "Sending buffer = 0x");
> -  for(i = 0 ; i < insize ; i++)
> -    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", in[i]);
> -
> -  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> -
> -  ssize_t size = 0;
> -
> -  // send the request
> -  size = write (g_tx_fd, in, insize);
> -  if (size < 0) {
> -    vtpmlogerror(VTPM_LOG_TXDATA, "write() failed");
> -    ERRORDIE (TPM_IOERROR);
> -  }
> -  else if ((TDDL_UINT32) size < insize) {
> -    vtpmlogerror(VTPM_LOG_TXDATA, "Wrote %d instead of %d bytes!\n", (int) size, insize);
> -    // ... ?
> -  }
> -
> -  // read the response
> -  size = read (*g_rx_fdp, out, TCPA_MAX_BUFFER_LENGTH);
> -  if (size < 0) {
> -    vtpmlogerror(VTPM_LOG_TXDATA, "read() failed");
> -    ERRORDIE (TPM_IOERROR);
> -  }
> -
> -  vtpmloginfo(VTPM_LOG_TXDATA, "Receiving buffer = 0x");
> -  for(i = 0 ; i < size ; i++)
> -    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out[i]);
> -
> -  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> -
> -  *outsize = size;
> -  // close connection
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -  return status;
> -}
> -
> -TPM_RESULT TDDL_Open() {
> -
> -  TDDL_RESULT status = TDDL_SUCCESS;
> -
> -  if (g_TDDL_open)
> -    return TPM_FAIL;
> -
> -#ifdef DUMMY_TPM
> -  *g_rx_fdp = open (TPM_RX_FNAME, O_RDWR);
> -#endif
> -
> -  g_tx_fd = open (TPM_TX_FNAME, O_RDWR);
> -  if (g_tx_fd < 0) {
> -    vtpmlogerror(VTPM_LOG_TXDATA, "TPM open failed");
> -    return TPM_IOERROR;
> -  }
> -
> -  g_TDDL_open = 1;
> -
> -  return status;
> -}
> -
> -void TDDL_Close() {
> -  if (! g_TDDL_open)
> -        return;
> -
> -  if (g_tx_fd>= 0) {
> -    if (close(g_tx_fd) < 0)
> -      vtpmlogerror(VTPM_LOG_TXDATA, "closeing tpm failed");
> -    g_tx_fd = -1;
> -  }
> -
> -  if (*g_rx_fdp>= 0) {
> -    if (close(*g_rx_fdp) < 0)
> -      vtpmlogerror(VTPM_LOG_TXDATA, "closeing tpm failed");
> -    *g_rx_fdp = -1;
> -  }
> -
> -  g_TDDL_open = 0;
> -
> -}
> diff --git a/tools/vtpm_manager/util/Makefile b/tools/vtpm_manager/util/Makefile
> deleted file mode 100644
> index 36bc38f..0000000
> --- a/tools/vtpm_manager/util/Makefile
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -BIN            = libTCGUtils.a
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIN)
> -
> -.PHONY: install
> -install: build
> -
> -.PHONY: clean
> -clean:
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIN): $(OBJS)
> -       $(AR) rcs $(BIN) $(OBJS)
> diff --git a/tools/vtpm_manager/util/bsg.c b/tools/vtpm_manager/util/bsg.c
> deleted file mode 100644
> index fa36ce7..0000000
> --- a/tools/vtpm_manager/util/bsg.c
> +++ /dev/null
> @@ -1,829 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// bsg.cpp
> -//
> -//  This file will handle all the TPM Byte Stream functions
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <string.h>
> -#include <stdarg.h>
> -#include <malloc.h>
> -#include "tcg.h"
> -#include "crypto.h"
> -#include "bsg.h"
> -#include "log.h"
> -
> -static int g_log_recursion_level = 0;
> -
> -// a largest buffer size. if we get a buf size bigger than this when unpacking,
> -// will complain!
> -#define BSG_MAX_BUF_SIZE (1<<18)
> -
> -#define bsglog(fmt, ...) do { \
> -    int __i; \
> -    for (__i=0; __i < g_log_recursion_level; __i++) {               \
> -      vtpmloginfomore (VTPM_LOG_BSG, "%s", "  ");                           \
> -    }                                                                 \
> -    vtpmloginfomore (VTPM_LOG_BSG, fmt, __VA_ARGS__);                         \
> -  } while (0)
> -
> -
> -// FIXME:  trigger the selfcheck--need to use glibc hook to do this
> -//BOOL dummy1 = BSG_static_selfcheck();
> -
> -
> -// Interpretting Types
> -// -------------------
> -//
> -// Incoming Types are composed of two parts {format, info} squished into a
> -// BSG_UINT32.  The first 4 bits is a format spec indicating what type of
> -// data it is.  If the first 4 bits are zero the info corresponds to a value in
> -// BSG_s_fmt[]. This is a structure whose composition is described in
> -// BSG_s_fmt[]. If the value is non-zero, info corresponds to the size of the
> -// data (in bytes) being passed in. For example a UINT32 being passed in would
> -// have a format of (__FMT_CONST | 4). If both, the format and info are zero,
> -// this is interpretted as the end of the structure, and the result is returned.
> -
> -// these flags are mutually exclusive, so I'll just make them
> -// format values which indicate the semantics of the 'info' part and the source
> -// data. The above description has been accordingly adjusted.
> -
> -// format values for determining what type of data the incoming type is
> -// it's a 4 bit value, occupying the high 4 bits
> -#define __FMT_CONST (1UL << 28) // Constant sized value
> -#define __FMT_DATA  (2UL << 28) // Believed to be raw data NOT {size,data}
> -#define __FMT_SIZE  (3UL << 28) // A size. Used in FMT_SIZE??_DATA.
> -#define __FMT_HSIZE (4UL << 28) // A number of handles
> -#define __FMT_PACKED (5UL << 28) // 'info' is unused; the source data consists
> -                                 // of {size32, data} but we're to pack only the
> -                                 // data as that is already packed, and so
> -                                 // can/must be unpacked without
> -                                 // explicitly reading it size
> -
> -#define __FMT_MASK  0x0FFFFFFFUL // this masks out the 4-bit format
> -#define __FMT_MASK_SIZE(type)   ((type) & __FMT_MASK)
> -#define __FMT_MASK_FORMAT(type) ((type) & (~__FMT_MASK))
> -
> -// constant (8/16/32-bits)
> -#define FMT_U8 (__FMT_CONST | 1UL)
> -#define FMT_U16 (__FMT_CONST | 2UL)
> -#define FMT_U32 (__FMT_CONST | 4UL)
> -
> -// const with a compiler-computed size
> -#define FMT_SIZEOF(type) (__FMT_CONST | sizeof(type))
> -
> -// other data (size bytes)
> -// Used primarily for DIGESTS -> FMT_DATA(20)
> -#define FMT_DATA(size) (__FMT_DATA | ((BSG_UINT32) (size) & __FMT_MASK))
> -
> -// 16/32-bit size followed by N bytes of data
> -#define FMT_SIZE16_DATA (__FMT_SIZE | 2UL)
> -#define FMT_SIZE32_DATA (__FMT_SIZE | 4UL)
> -
> -// 16-bit size followed by N key handles
> -#define FMT_SIZE16_HANDLES (__FMT_HSIZE | 2UL)
> -
> -#define DIGEST_SIZE 20
> -typedef BSG_UINT32 BSG_HANDLE;
> -
> -// TCPA_AUTH has 11 fields!
> -#define MAX_FIELDS 11
> -typedef struct BSG_Format
> -{
> -  BSG_Type type;
> -  const char* name;
> -  BSG_UINT32 fields[MAX_FIELDS + 1];
> -} BSG_Format;
> -
> -/*
> - * TCPA structure data formats
> - */
> -// this has to be manually kept in sync with the
> -// Type enum!! the static_selfcheck() function should be used regularly!
> -static BSG_Format s_fmt[] =
> -{
> -  {BSG_TYPE_UINT32, "BSG_TYPE_UINT32", {FMT_U32, 0}},
> -  {BSG_TYPE_UINT16, "BSG_TYPE_UINT16", {FMT_U16, 0}},
> -  {BSG_TYPE_BYTE, "BSG_TYPE_BYTE", {FMT_U8, 0}},
> -  {BSG_TYPE_BOOL, "BSG_TYPE_BOOL", {FMT_U8, 0}},
> -  {BSG_TPM_SIZE32_DATA, "BSG_TPM_SIZE32_DATA", {FMT_SIZE32_DATA, 0}},
> -  {BSG_TPM_TAG, "BSG_TPM_TAG", {FMT_SIZEOF(TPM_TAG), 0}},
> -  {BSG_TPM_HANDLE, "BSG_TPM_HANDLE", {FMT_SIZEOF(TPM_HANDLE), 0}},
> -  {BSG_TPM_RESULT, "BSG_TPM_RESULT", {FMT_SIZEOF(TPM_RESULT), 0}},
> -  {BSG_TPM_RESOURCE_TYPE, "BSG_TPM_RESOURCE_TYPE", {FMT_SIZEOF(TPM_RESOURCE_TYPE), 0}},
> -  {BSG_TPM_COMMAND_CODE, "BSG_TPM_COMMAND_CODE", {FMT_U32, 0}},
> -  {BSG_TPM_AUTH_DATA_USAGE, "BSG_TPM_AUTH_DATA_USAGE", {FMT_U8, 0}},
> -  {BSG_TPM_ALGORITHM_ID, "BSG_TPM_ALGORITHM_ID", {FMT_U32, 0}},
> -  {BSG_TPM_PROTOCOL_ID, "BSG_TPM_PROTOCOL_ID", {FMT_SIZEOF(TPM_PROTOCOL_ID), 0}},
> -  {BSG_TPM_KEY_USAGE, "BSG_TPM_KEY_USAGE", {FMT_U16, 0}},
> -  {BSG_TPM_ENC_SCHEME, "BSG_TPM_ENC_SCHEME", {FMT_U16, 0}},
> -  {BSG_TPM_SIG_SCHEME, "BSG_TPM_SIG_SCHEME", {FMT_U16, 0}},
> -  {BSG_TPM_MIGRATE_SCHEME, "BSG_TPM_MIGRATE_SCHEME", {FMT_U16, 0}},
> -  {BSG_TPM_KEY_FLAGS, "BSG_TPM_KEY_FLAGS", {FMT_U32, 0}},
> -
> -  {BSG_TPM_AUTHDATA, "BSG_TPM_AUTHDATA", {FMT_DATA(DIGEST_SIZE), 0}},
> -  {BSG_TPM_SECRET, "BSG_TPM_SECRET", {BSG_TPM_AUTHDATA, 0}},
> -  {BSG_TPM_ENCAUTH, "BSG_TPM_ENCAUTH", {BSG_TPM_AUTHDATA, 0}},
> -  {BSG_TPM_PAYLOAD_TYPE, "BSG_TPM_PAYLOAD_TYPE", {FMT_SIZEOF(TPM_PAYLOAD_TYPE), 0}},
> -
> -  {BSG_TPM_VERSION, "BSG_TPM_VERSION", {FMT_DATA(4), 0}}, // vers 1.2
> -  {BSG_TPM_DIGEST, "BSG_TPM_DIGEST", {FMT_DATA(DIGEST_SIZE), 0}},
> -  {BSG_TPM_COMPOSITE_HASH, "BSG_TPM_COMPOSITE_HASH", {BSG_TPM_DIGEST, 0}},
> -  {BSG_TPM_CHOSENID_HASH, "BSG_TPM_CHOSENID_HASH", {BSG_TPM_DIGEST, 0}},
> -
> -  {BSG_TPM_NONCE, "BSG_TPM_NONCE", {FMT_DATA(DIGEST_SIZE), 0}},
> -  {BSG_TPM_KEY_HANDLE, "BSG_TPM_KEY_HANDLE", {FMT_SIZEOF(TPM_KEY_HANDLE), 0}},
> -  {BSG_TPM_KEY_HANDLE_LIST, "BSG_TPM_KEY_HANDLE_LIST",
> -   {FMT_SIZE16_HANDLES, 0}},
> -
> -  {BSG_TPM_KEY_PARMS, "BSG_TPM_KEY_PARMS", {
> -      BSG_TPM_ALGORITHM_ID,
> -      BSG_TPM_ENC_SCHEME,
> -      BSG_TPM_SIG_SCHEME,
> -      FMT_SIZE32_DATA,
> -      0}},
> -  {BSG_TPM_RSA_KEY_PARMS, "BSG_TPM_RSA_KEY_PARMS", {
> -      FMT_U32, FMT_U32, FMT_SIZE32_DATA, 0}},
> -  {BSG_TPM_STORE_PUBKEY, "BSG_TPM_STORE_PUBKEY", {FMT_SIZE32_DATA, 0}},
> -  {BSG_TPM_PUBKEY, "BSG_TPM_PUBKEY", {BSG_TPM_KEY_PARMS, BSG_TPM_STORE_PUBKEY, 0}},
> -  {BSG_TPM_KEY, "BSG_TPM_KEY", {
> -      BSG_TPM_VERSION,
> -      BSG_TPM_KEY_USAGE,
> -      BSG_TPM_KEY_FLAGS,
> -      BSG_TPM_AUTH_DATA_USAGE,
> -      BSG_TPM_KEY_PARMS,
> -      FMT_SIZE32_DATA,        // the PCR_INFO
> -      BSG_TPM_STORE_PUBKEY,
> -      FMT_SIZE32_DATA,        // the encrypted part
> -      0}},
> -
> -  {BSG_TPM_MIGRATIONKEYAUTH, "BSG_TPM_MIGRATIONKEYAUTH", {
> -      BSG_TPM_PUBKEY,
> -      BSG_TPM_MIGRATE_SCHEME,
> -      BSG_TPM_DIGEST, 0}},
> -
> -  {BSG_TCPA_AUDIT_EVENT, "TCPA_AUDIT_EVENT", {
> -      BSG_TPM_COMMAND_CODE,
> -      BSG_TPM_RESULT, 0 }},
> -
> -  {BSG_TCPA_EVENT_CERT, "TCPA_EVENT_CERT", {
> -      BSG_TPM_DIGEST,
> -      BSG_TPM_DIGEST,
> -      FMT_DATA(2),
> -      FMT_SIZE32_DATA, 0}},
> -
> -  {BSG_TPM_PCR_SELECTION, "BSG_TPM_PCR_SELECTION", {FMT_SIZE16_DATA, 0} },
> -  {BSG_TPM_PCR_COMPOSITE, "BSG_TPM_PCR_COMPOSITE", { BSG_TPM_PCR_SELECTION,
> -                                                    FMT_SIZE32_DATA,
> -                                                    0} },
> -
> -  {BSG_TPM_PCR_INFO, "BSG_TPM_PCR_INFO", { BSG_TPM_PCR_SELECTION,
> -                                          BSG_TPM_COMPOSITE_HASH,
> -                                          BSG_TPM_COMPOSITE_HASH,
> -                                          0} },
> -
> -
> -  {BSG_TPM_STORED_DATA, "BSG_TPM_STORED_DATA", {
> -      BSG_TPM_VERSION,
> -      FMT_SIZE32_DATA,
> -      FMT_SIZE32_DATA,
> -      0}},
> -  {BSG_TPM_SYMMETRIC_KEY, "BSG_TPM_SYMMETRIC_KEY", {
> -      BSG_TPM_ALGORITHM_ID,
> -      BSG_TPM_ENC_SCHEME,
> -      FMT_SIZE16_DATA,
> -      0}},
> -  {BSG_TPM_STORE_PRIVKEY, "BSG_TPM_STORE_PRIVKEY", {FMT_SIZE32_DATA, 0}},
> -  {BSG_TPM_STORE_ASYMKEY, "BSG_TPM_STORE_ASYMKEY", {
> -      BSG_TPM_PAYLOAD_TYPE,
> -      BSG_TPM_SECRET,
> -      BSG_TPM_SECRET,
> -      BSG_TPM_DIGEST,
> -      BSG_TPM_STORE_PRIVKEY,
> -      0}},
> -  {BSG_TPM_MIGRATE_ASYMKEY, "BSG_TPM_MIGRATE_ASYMKEY", {
> -      BSG_TPM_PAYLOAD_TYPE,
> -      BSG_TPM_SECRET,
> -      BSG_TPM_DIGEST,
> -      FMT_U32,
> -      BSG_TPM_STORE_PRIVKEY,
> -      0}},
> -
> -  {BSG_TPM_QUOTE_INFO, "BSG_TPM_QUOTE_INFO", {
> -      BSG_TPM_VERSION,
> -      FMT_DATA(4),
> -      BSG_TPM_COMPOSITE_HASH,
> -      BSG_TPM_NONCE,
> -      0}},
> -
> -  {BSG_TPM_IDENTITY_CONTENTS, "BSG_TPM_IDENTITY_CONTENTS", {
> -      BSG_TPM_VERSION,
> -      FMT_U32,
> -      BSG_TPM_CHOSENID_HASH,
> -      BSG_TPM_PUBKEY,
> -      0}},
> -
> -  {BSG_TPM_PCRVALUE, "BSG_TPM_PCRVALUE", {FMT_DATA(DIGEST_SIZE), 0}},
> -
> -  {BSG_TCPA_PCR_FLAGS, "TCPA_PCR_FLAGS", {
> -      FMT_U8,
> -      FMT_U8,
> -      0}},
> -
> -  {BSG_TCS_AUTH, "TCS_AUTH", {
> -      BSG_TYPE_UINT32,
> -      BSG_TPM_NONCE,
> -      BSG_TPM_NONCE,
> -      BSG_TYPE_BOOL,
> -      BSG_TPM_AUTHDATA,
> -      0}},
> -
> -  {BSG_TPM_KEY_NONSENSITIVE, "BSG_TPM_KEY_NONSENSITIVE", {
> -      BSG_TPM_VERSION,
> -      BSG_TPM_KEY_USAGE,
> -      BSG_TPM_KEY_FLAGS,
> -      BSG_TPM_AUTH_DATA_USAGE,
> -      BSG_TPM_KEY_PARMS,
> -      FMT_SIZE32_DATA,
> -      BSG_TPM_STORE_PUBKEY,
> -      0}},
> -
> -  {BSG_PACKED, "BSG_PACKED", {
> -      __FMT_PACKED,
> -      0 }},
> -
> -  {BSG_TYPE_MAX, "", {0}},
> -};
> -
> -
> -static const BSG_Format* find_format (BSG_Type t) {
> -  BSG_Format * f = s_fmt;
> -
> -  if (t >= BSG_TYPE_MAX) {
> -    return NULL;
> -  }
> -
> -  // WARNING: this depends on the enum and s_fmt[] array being in sync! make
> -  // sure to run the static_selfcheck() to make sure
> -  f = s_fmt + (t - BSG_TYPE_FIRST);
> -
> -  return f;
> -}
> -
> -//
> -// a consistency-checking routine which can be run at compile time
> -// (ie. immediately after compilation)
> -//
> -// tasks:
> -// - verify that s_fmt has one entry per Type t, and that entry is at s_fmt[t]
> -//
> -// conditions:
> -// - need that s_fmt[0] is the first type listed in the Type enum! ie the first
> -//   Type has value 0, not 1
> -//
> -// FIXME: should have a function be passed in here which is called if the test
> -// fails. Then the caller can decide what to do: abort, notify, whatever
> -//
> -BOOL BSG_static_selfcheck ()
> -{
> -  int i;
> -
> -  for (i=BSG_TYPE_FIRST; i <= BSG_TYPE_MAX; i++) {
> -    if (s_fmt[i - BSG_TYPE_FIRST].type != i) {
> -      bsglog ("%s\n", "BSG: static_selfcheck failed!\n");
> -      bsglog ("failure at %i, allegedly %s\n",
> -             i, s_fmt[i - BSG_TYPE_FIRST].name);
> -      abort();
> -      return FALSE;
> -    }
> -  }
> -
> -  bsglog ("%s\n", "BSG: static_selfcheck success!");
> -  return TRUE;
> -}
> -
> -
> -/**
> - * Flatten a TCPA structure into a buffer in big-endian format
> - * @type: TCPA structure type
> - * @src: (IN) TCPA structure (OUT) end of TCPA structure
> - * @dst: (OUT) flattened data
> - * Returns: Flattened size or -1 for unknown types
> - */
> -// make it so that it can just run through the whole process and return
> -// the packed size, without packing anything. this will be done if dst is NULL.
> -static int BSG_Pack_private(BSG_Type type, const BSG_BYTE** src, BSG_BYTE* dst)
> -{
> -  // check incoming parameters
> -  if (*src == NULL)
> -    return 0;
> -
> -  const BSG_BYTE* s = *src;
> -  BSG_BYTE* d = dst;
> -
> -  BSG_UINT32 size   = __FMT_MASK_SIZE(type);
> -  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
> -
> -  if (format == __FMT_CONST) // We are dealing with a fixed length value eg. UINT32
> -    {
> -      BSG_UINT32 val = 0;
> -      switch (size) {
> -      case 1: val = * (BYTE*) s; break;
> -      case 2: val = * (unsigned short*) s; break;
> -      case 4: val = * (BSG_UINT32*) s; break;
> -      }
> -      if (dst)
> -       BSG_PackConst(val, size, d);
> -
> -      s += size;
> -      d += size;
> -    } else if (format == __FMT_DATA) { // We are dealing with raw data. Not sure when
> -    // this is used.
> -
> -      if (dst) {
> -        bsglog ("BSG: __FMT_DATA size %d, src %p, dst %p\n", size, s, d);
> -        memcpy(d, s, size);
> -      }
> -
> -      s += size;
> -      d += size;
> -  } else if (format == __FMT_SIZE || format == __FMT_HSIZE) { // It's a size, followed by that much data or handles
> -
> -    BSG_UINT32 psize = 0;
> -    switch (size) {
> -    case 1: psize = * (BYTE*) s; break;
> -    case 2: psize = * (unsigned short*) s; break;
> -    case 4: psize = * (BSG_UINT32*) s; break;
> -    }
> -
> -    if (dst)
> -      BSG_PackConst(psize, size, d);
> -
> -    s += size;
> -    d += size;
> -
> -    // now 's' points to an address, so cast it to BSG_BYTE**
> -    const BSG_BYTE* pdata = * ((BSG_BYTE**) s);
> -    s += sizeof(BSG_BYTE*);
> -
> -    if (format == __FMT_HSIZE) {// This is a list of psize Handles
> -      if (dst) {
> -       BSG_HANDLE* d2 = (BSG_HANDLE*) d;
> -       BSG_HANDLE* p2 = (BSG_HANDLE*) pdata;
> -       BSG_UINT32 i;
> -       for (i = 0; i < psize; i++)
> -         d2[i] = BSG_UnpackConst((BSG_BYTE*)(p2 + i), 4);
> -
> -      }
> -      d += psize * sizeof(BSG_HANDLE);
> -    } else {// If it's not psize handles, it's psize data.
> -      if (psize > 0) {
> -       if (dst) {
> -         bsglog ("BSG: __FMT_SIZE, size=%d, src=%p, dst=%p\n",
> -                 psize, pdata, d);
> -         memcpy(d, pdata, psize);
> -       }
> -      }
> -      d += psize;
> -    }
> -  } else if (format == __FMT_PACKED) {
> -    // the source buffer is a pack_constbuf_t, which has a size and a
> -    // pointer. just copy the buffer value, the size is not included in the
> -    // output stream.
> -    pack_constbuf_t * buf = (pack_constbuf_t*) s;
> -
> -    if (dst) {
> -      bsglog ("BSG: __FMT_PACKED, size=%d, src=%p, dst=%p\n",
> -             buf->size, buf->data, d);
> -      memcpy(d, buf->data, buf->size);
> -    }
> -
> -    s += buf->size;
> -    d += buf->size;
> -  } else if (format == 0) {// No flags are set. This is a structure & it should
> -                          // be looked up in the bsg_s_fmt[]
> -
> -    const BSG_Format* x = find_format (type);
> -    if (x == NULL) {
> -      vtpmloginfo(VTPM_LOG_BSG, "BSG_Pack: cannot find type %d\n", type);
> -      return -1;
> -    }
> -
> -    if (dst)
> -      bsglog ("BSG_Pack type %s\n", x->name);
> -
> -
> -    // iterate through the fields
> -    const BSG_UINT32* f = x->fields;
> -    for (; *f; f++) {
> -      int fsize;
> -
> -      g_log_recursion_level++;
> -      fsize = BSG_Pack_private((BSG_Type) *f, &s, dst ? d : NULL);
> -      g_log_recursion_level--;
> -
> -      if (fsize <= 0)
> -       return fsize;
> -
> -      d += fsize;
> -    }
> -  } else {
> -    vtpmlogerror(VTPM_LOG_BSG, "BSG_Pack(): Unknown format %d\n", format);
> -    return -1;
> -  }
> -
> -  *src = s;
> -  return (d - dst);
> -}
> -
> -/**
> - * Unflatten a TCPA structure from a buffer in big-endian format
> - * @type: TCPA structure type
> - * @src: flattened data
> - * @dst: (IN) TCPA structure (OUT) end of TCPA structure
> - * Returns: Flattened size
> - * Note: Returns flattened size NOT the unpacked structure size
> - */
> -static int BSG_Unpack_private(BSG_Type type, const BSG_BYTE* src, BSG_BYTE** dst) {
> -  // check incoming parameters
> -  if (src == NULL)
> -    return 0;
> -
> -
> -  const BSG_BYTE* s = src;
> -  BSG_BYTE* d = dst ? *dst:NULL;
> -  if (dst && !d)
> -    dst = NULL;
> -
> -  BSG_UINT32 size = __FMT_MASK_SIZE(type);
> -  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
> -
> -  if (format == __FMT_CONST) {// We are dealing with a fixed length value ie. UINT32
> -
> -    BSG_UINT32 val = BSG_UnpackConst(s, size);
> -
> -    if (dst) {
> -      switch (size) {
> -      case 1: *(BYTE *) d = (BSG_BYTE) val; break;
> -      case 2: *(unsigned short*) d = (unsigned short) val; break;
> -      case 4: *(BSG_UINT32*) d = (BSG_UINT32) val; break;
> -      }
> -    }
> -
> -    s += size;
> -    d += size;
> -  } else if (format == __FMT_DATA) {// We are dealing with raw data. Not sure when this is used.
> -    if (dst)
> -      memcpy(d, s, size);
> -
> -    d += size;
> -    s += size;
> -  } else if (format == __FMT_SIZE || format == __FMT_HSIZE) {// It's a size, followed by that much data or handles
> -
> -    BSG_UINT32 psize = BSG_UnpackConst(s, size);
> -
> -    if (psize > BSG_MAX_BUF_SIZE) {
> -      vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack runs into var-sized data bigger than %u bytes!!\n",
> -              BSG_MAX_BUF_SIZE);
> -      return -1;
> -    }
> -
> -    if (dst) {
> -      switch (size) {
> -      case 1: *(BYTE *) d = (BSG_BYTE) psize; break;
> -      case 2: *(unsigned short*) d = (unsigned short) psize; break;
> -      case 4: *(BSG_UINT32*) d = (BSG_UINT32) psize; break;
> -      }
> -    }
> -
> -    s += size;
> -    d += size;
> -
> -    BSG_BYTE* pdata = NULL;
> -
> -    if (psize) {
> -      if (format == __FMT_HSIZE) { // This is a list of psize Handles
> -       if (dst) {
> -         BSG_HANDLE* s2 = (BSG_HANDLE*) s;
> -         pdata = (BSG_BYTE *)malloc(psize * sizeof(BSG_HANDLE));
> -          if (!pdata)
> -            return -1;
> -
> -         BSG_HANDLE* p2 = (BSG_HANDLE*) pdata;
> -         BSG_UINT32 i;
> -         for (i = 0; i < psize; i++) {
> -           BSG_PackConst(s2[i], 4, (BSG_BYTE*)(p2 + i));
> -         }
> -       }
> -       s += psize * sizeof(BSG_HANDLE);
> -      } else { // If it's not psize handles, it's psize data.
> -       if (dst) {
> -         pdata = (BSG_BYTE *)malloc(sizeof(BSG_BYTE) * psize);
> -          if (!pdata)
> -            return -1;
> -         memcpy(pdata, s, psize);
> -       }
> -       s += psize;
> -      }
> -    }
> -    if (dst)
> -      *(void**) d = pdata;
> -
> -    d += sizeof(void*);
> -  } else if (format == __FMT_PACKED) {
> -
> -    // this doesn't make sense for unpacking!
> -    vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack() called with format __FMT_PACKED. "
> -                                                          "This does not make sense\n");
> -
> -    return -1;
> -  } else if (format == 0) {// No flags are set. This is a structure & it should
> -                          // be looked up in the bsg_s_fmt[]
> -
> -    const BSG_Format* x = find_format (type);
> -    if (x == NULL) {
> -      vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack: cannot find type %d\n", type);
> -      return -1;
> -    }
> -
> -    const BSG_UINT32* f = x->fields;
> -    for (; *f; f++) {
> -      int fsize = BSG_Unpack_private((BSG_Type) *f, s, dst ? &d:NULL);
> -      if (fsize <= 0)
> -       return fsize;
> -      s += fsize;
> -    }
> -  }
> -
> -  if (dst)
> -    *dst = d;
> -  return (s - src);
> -}
> -
> -/**
> - * Free memory associated with unpacked TCPA structure
> - * @type: TCPA structure type
> - * @src: (IN) TCPA structure (OUT) end of TCPA structure
> - * Note: Destroy should be called on all structures created with Unpack
> - *       to ensure that any allocated memory is freed
> - */
> -static void BSG_Destroy_private(BSG_Type type, BSG_BYTE** src) {
> -  BSG_BYTE* s = *src;
> -
> -  BSG_UINT32 size = __FMT_MASK_SIZE(type);
> -  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
> -
> -  if ((src == NULL) || (*src == NULL)) {
> -        vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy() called with NULL src\n");
> -    return;
> -  }
> -
> -  if (format == __FMT_CONST || format == __FMT_DATA)
> -    s += size;
> -  else if (format == __FMT_SIZE || format == __FMT_HSIZE) {
> -    s += size;
> -    BSG_BYTE* ptr = *(BSG_BYTE**) s;
> -    free(ptr);
> -    s += sizeof(void*);
> -  } else if (format == __FMT_PACKED) {
> -
> -    // this doesn't make sense for unpacking, hence also for Destroy()
> -    vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy() called with format __FMT_PACKED. "
> -                                                          "This does not make sense\n");
> -
> -    return;
> -  } else if (format == 0) {
> -    const BSG_Format* x = find_format (type);
> -    if (x == NULL) {
> -      vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy: cannot find type %d\n", type);
> -      return;
> -    }
> -
> -    const BSG_UINT32* f = x->fields;
> -    for (; *f; f++)
> -      BSG_Destroy_private((BSG_Type) *f, &s);
> -  }
> -
> -  *src = s;
> -}
> -
> -int BSG_Pack(BSG_Type type, const void* src, BSG_BYTE* dst)
> -{
> -  const BSG_BYTE* src2 = (const BSG_BYTE*) src;
> -  return BSG_Pack_private(type, &src2, dst);
> -}
> -
> -int BSG_Unpack(BSG_Type type, const BSG_BYTE* src, void* dst)
> -{
> -  BSG_BYTE* dst2 = (BSG_BYTE*) dst;
> -  return BSG_Unpack_private(type, src, dst ? &dst2:NULL);
> -}
> -
> -void BSG_Destroy(BSG_Type type, void* src)
> -{
> -  BSG_BYTE* src2 = (BSG_BYTE*) src;
> -  BSG_Destroy_private(type, &src2);
> -}
> -
> -/**
> - * Pack a 8/16/32-bit constant into a buffer in big-endian format
> - * @val: constant value
> - * @size: constant size in bytes (1, 2, or 4)
> - * @dst: (OUT) buffer
> - */
> -void BSG_PackConst(BSG_UINT32 val, int size, BSG_BYTE* dst) {
> -  bsglog ("BSG: PackConst on %d of size %i into address %p\n", val, size, dst);
> -
> -  switch (size) {
> -  case 4:
> -    dst[0] = (BSG_BYTE)((val >> 24) & 0xff);
> -    dst[1] = (BSG_BYTE)((val >> 16) & 0xff);
> -    dst[2] = (BSG_BYTE)((val >> 8) & 0xff);
> -    dst[3] = (BSG_BYTE)(val & 0xff);
> -    break;
> -  case 2:
> -    dst[0] = (BSG_BYTE)((val >> 8) & 0xff);
> -    dst[1] = (BSG_BYTE)(val & 0xff);
> -    break;
> -  case 1:
> -    dst[0] = (BSG_BYTE)(val & 0xff);
> -    break;
> -  }
> -}
> -
> -/**
> - * Unpack a 8/16/32-bit constant from a buffer in big-endian format
> - * @src: buffer
> - * @size: constant size in bytes (1, 2, or 4)
> - */
> -BSG_UINT32 BSG_UnpackConst(const BSG_BYTE* src, int size) {
> -  BSG_UINT32 val = 0;
> -
> -  if (src == NULL)
> -    return 0;
> -
> -  switch (size) {
> -  case 4:
> -    val = (((BSG_UINT32) src[0]) << 24
> -          | ((BSG_UINT32) src[1]) << 16
> -          | ((BSG_UINT32) src[2]) << 8
> -          | (BSG_UINT32) src[3]);
> -    break;
> -  case 2:
> -    val = (((BSG_UINT32) src[0]) << 8 | (BSG_UINT32) src[1]);
> -    break;
> -  case 1:
> -    val = (BSG_UINT32) src[0];
> -    break;
> -  }
> -  return val;
> -}
> -
> -// Pack a list of parameters. Beware not to send values, but rather you must
> -// send a pointer to your values Instead. This includes UINT32's.
> -int BSG_PackList( BSG_BYTE* dst, int ParamCount, ... ) {
> -  int ParamNumber;
> -  BSG_Type format;
> -  BSG_BYTE* val = NULL;
> -  int size=0;
> -
> -  va_list paramList;
> -  va_start( paramList, ParamCount );
> -
> -  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
> -    //Strangeness with int is because gcc wanted an int rather than a enum of ints.
> -    format =  (BSG_Type) va_arg( paramList, int );
> -    val = va_arg( paramList, BSG_BYTE* );
> -    size += BSG_Pack(format, val, dst == NULL ? NULL : dst + size);
> -  }
> -
> -  va_end (paramList);
> -
> -  return size;
> -}
> -
> -// Unpack a list of parameters.
> -int BSG_UnpackList( const BSG_BYTE* src, int ParamCount, ... ) {
> -  int ParamNumber = 0;
> -  BSG_Type format;
> -  BSG_BYTE* val = NULL;
> -  int size = 0;
> -
> -  va_list paramList;
> -  va_start( paramList, ParamCount );
> -
> -  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
> -    format = (BSG_Type) va_arg( paramList, int );
> -    val  = va_arg( paramList, BSG_BYTE* );
> -
> -    size += BSG_Unpack(format, src + size, val);
> -  }
> -
> -  va_end( paramList );
> -
> -  return size;
> -}
> -
> -// Destroy any memory allocated by calls to unpack
> -void BSG_DestroyList(int ParamCount, ... ) {
> -  int ParamNumber = 0;
> -  BSG_Type argType;
> -  BSG_BYTE* paramValue = NULL;
> -
> -  va_list paramList;
> -  va_start( paramList, ParamCount );
> -
> -  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
> -    argType = (BSG_Type) va_arg( paramList, int );
> -    paramValue  = va_arg( paramList, BSG_BYTE* );
> -
> -    BSG_Destroy(argType, paramValue);
> -  }
> -
> -  va_end( paramList );
> -
> -  return;
> -}
> -
> -
> -// and a tuple version
> -TPM_RESULT BSG_DestroyTuple (int numParams, pack_tuple_t params[]) {
> -  int i;
> -
> -  for (i = 0; i < numParams; i++)
> -    BSG_Destroy (params[i].type, params[i].addr);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -//
> -// wrappers of Pack and PackList which malloc the ouput buffer. to be freed
> -// by the caller later
> -//
> -
> -int BSG_PackMalloc (BSG_Type type, const void* src, BSG_BYTE** o_dst) {
> -  int size = BSG_Pack (type, src, NULL);
> -  BSG_BYTE * dest = (BSG_BYTE*) malloc (size);
> -  if (dest == NULL)
> -    return -1;
> -
> -  size = BSG_Pack(type, src, dest);
> -  *o_dst = dest;
> -  return size;
> -}
> -
> -
> -
> -int BSG_PackListMalloc(BSG_BYTE** outBuffer, int ParamCount, ... ) {
> -  va_list args;
> -  int size;
> -
> -  va_start (args, ParamCount);
> -  size = BSG_PackList (NULL, ParamCount, args);
> -  va_end (args);
> -
> -  BSG_BYTE * dest = (BSG_BYTE*) malloc (size);
> -  if (dest == NULL)
> -    return -1;
> -
> -  va_start (args, ParamCount);
> -  size = BSG_PackList (dest, ParamCount, args);
> -  va_end (args);
> -
> -  *outBuffer = dest;
> -  return size;
> -}
> diff --git a/tools/vtpm_manager/util/bsg.h b/tools/vtpm_manager/util/bsg.h
> deleted file mode 100644
> index 0896812..0000000
> --- a/tools/vtpm_manager/util/bsg.h
> +++ /dev/null
> @@ -1,166 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// bsg.h
> -//
> -//  This file contains API's for the TPM Byte Stream functions
> -//
> -// ==================================================================
> -
> -#ifndef __BSG_H__
> -#define __BSG_H__
> -
> -#include <stdarg.h>
> -#include "buffer.h"
> -
> -typedef unsigned int BSG_UINT32;
> -typedef unsigned char BSG_BYTE;
> -
> -// forward decl
> -struct pack_const_tuple_t;
> -
> -struct pack_tuple_t;
> -
> -
> -/**
> - * Byte stream generator
> - */
> -// this has to be manually kept in sync with the
> -// s_fmt array!!
> -// but now we have a self-check function which can make sure things are well
> -// (if used!)
> -typedef enum BSG_Type
> -{
> -  BSG_TYPE_FIRST = 1,
> -  BSG_TYPE_UINT32 = 1, // start at 1 so that Type 0 only serves as an
> -                       // unused/special value
> -  BSG_TYPE_UINT16,
> -  BSG_TYPE_BYTE,
> -  BSG_TYPE_BOOL,
> -  BSG_TPM_SIZE32_DATA,  // a 32 bit unsigned size, followed by
> -                        // a pointer to that much data. can pass a
> -                        // struct pack_buf_t as the param
> -  BSG_TPM_TAG,
> -  BSG_TPM_HANDLE,
> -  BSG_TPM_RESULT,
> -  BSG_TPM_RESOURCE_TYPE,
> -  BSG_TPM_COMMAND_CODE,
> -  BSG_TPM_AUTH_DATA_USAGE,
> -  BSG_TPM_ALGORITHM_ID,
> -  BSG_TPM_PROTOCOL_ID,
> -  BSG_TPM_KEY_USAGE,
> -  BSG_TPM_ENC_SCHEME,
> -  BSG_TPM_SIG_SCHEME,
> -  BSG_TPM_MIGRATE_SCHEME,
> -  BSG_TPM_KEY_FLAGS,
> -  BSG_TPM_AUTHDATA,
> -  BSG_TPM_SECRET,
> -  BSG_TPM_ENCAUTH,
> -  BSG_TPM_PAYLOAD_TYPE,
> -
> -  BSG_TPM_VERSION,
> -  BSG_TPM_DIGEST,
> -  BSG_TPM_COMPOSITE_HASH,
> -  BSG_TPM_CHOSENID_HASH,
> -  BSG_TPM_NONCE,
> -  BSG_TPM_KEY_HANDLE,
> -  BSG_TPM_KEY_HANDLE_LIST,
> -  BSG_TPM_KEY_PARMS,
> -  BSG_TPM_RSA_KEY_PARMS,
> -  BSG_TPM_STORE_PUBKEY,
> -  BSG_TPM_PUBKEY,
> -  BSG_TPM_KEY,
> -
> -  BSG_TPM_MIGRATIONKEYAUTH,
> -  BSG_TCPA_AUDIT_EVENT,
> -  BSG_TCPA_EVENT_CERT,
> -  BSG_TPM_PCR_SELECTION,
> -  BSG_TPM_PCR_COMPOSITE,
> -  BSG_TPM_PCR_INFO,
> -  BSG_TPM_STORED_DATA,
> -  BSG_TPM_SYMMETRIC_KEY,
> -  BSG_TPM_STORE_PRIVKEY,
> -  BSG_TPM_STORE_ASYMKEY,
> -  BSG_TPM_MIGRATE_ASYMKEY,
> -  BSG_TPM_QUOTE_INFO,
> -  BSG_TPM_IDENTITY_CONTENTS,
> -  BSG_TPM_PCRVALUE,
> -  BSG_TCPA_PCR_FLAGS,
> -  BSG_TCS_AUTH,
> -
> -  // this is the BSG_TPM_KEY struct without the encData field
> -  BSG_TPM_KEY_NONSENSITIVE,
> -
> -  BSG_PACKED,
> -
> -  BSG_TYPE_MAX
> -} BSG_Type;
> -
> -struct pack_const_tuple_t {
> -  BSG_Type type;
> -  const void * addr;
> -};
> -
> -
> -typedef struct pack_tuple_t {
> -  BSG_Type type;
> -  void * addr;
> -} pack_tuple_t;
> -
> -int BSG_Pack(BSG_Type type, const void* src, BSG_BYTE* dst);
> -int BSG_Unpack(BSG_Type type, const BSG_BYTE* src, void* dst);
> -void BSG_Destroy(BSG_Type type, void* src);
> -
> -// wrappers of Pack and PackList which malloc the ouput buffer. to be freed
> -// by the caller later. returns size of allocated buffer, or -1 in case
> -// allocation failed
> -int BSG_PackMalloc (BSG_Type type, const void* src, BSG_BYTE** o_dst);
> -int BSG_PackListMalloc (BSG_BYTE** outBuffer, int ParamCount, ... );
> -
> -// a va_list version of PackList
> -int BSG_PackList(BSG_BYTE* outBuffer, int ParamCount, ... );
> -int BSG_UnpackList(const BSG_BYTE* inBuffer, int ParamCount, ... );
> -void BSG_DestroyList(int ParamCount, ... );
> -
> -// wrapper of PackList which uses a buffer_t
> -TPM_RESULT BSG_PackListBuf (buffer_t * o_buf, int ParamCount, ...);
> -
> -// and a tuple version
> -TPM_RESULT BSG_DestroyTuple (int numParams, pack_tuple_t params[]);
> -
> -void BSG_PackConst(BSG_UINT32 val, int size, BSG_BYTE* dst);
> -BSG_UINT32 BSG_UnpackConst(const BSG_BYTE* src, int size);
> -
> -BOOL BSG_static_selfcheck ();
> -
> -#endif
> diff --git a/tools/vtpm_manager/util/buffer.c b/tools/vtpm_manager/util/buffer.c
> deleted file mode 100644
> index df48bc2..0000000
> --- a/tools/vtpm_manager/util/buffer.c
> +++ /dev/null
> @@ -1,226 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -
> -#include <stdarg.h>
> -#include <string.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <sys/param.h>
> -
> -#include "tcg.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -
> -static TPM_RESULT buffer_priv_realloc (buffer_t * buf, tpm_size_t newsize);
> -
> -//
> -// buffer functions!
> -//
> -
> -TPM_RESULT buffer_init (buffer_t * buf, tpm_size_t initsize, const BYTE* initval) {
> -  if (initsize == 0) {
> -    memset(buf, 0, sizeof(*buf));
> -    return TPM_SUCCESS;
> -  }
> -
> -
> -  buf->bytes = (BYTE*) malloc (initsize);
> -  if (buf->bytes == NULL)
> -    return TPM_RESOURCES;
> -
> -  buf->size = initsize;
> -  buf->alloc_size = initsize;
> -
> -  if (initval)
> -    memcpy (buf->bytes, initval, initsize);
> -
> -  buf->is_owner = TRUE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -TPM_RESULT buffer_init_convert (buffer_t * buf, tpm_size_t initsize, BYTE* initval) {
> -
> -  buf->size = initsize;
> -  buf->alloc_size = initsize;
> -  buf->bytes = initval;
> -
> -  buf->is_owner = TRUE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -TPM_RESULT buffer_init_copy (buffer_t * buf, const buffer_t * src) {
> -  TPM_RESULT status = buffer_init (buf, src->size, src->bytes);
> -  buf->is_owner = TRUE;
> -
> -  return status;
> -}
> -
> -
> -
> -// make an alias to a constant array
> -TPM_RESULT buffer_init_const (buffer_t * buf, tpm_size_t size, const BYTE* val) {
> -  // TODO: try to enforce the const things somehow!
> -  buf->bytes = (BYTE*) val;
> -  buf->size = size;
> -  buf->alloc_size = 0;        // this field is now unneeded
> -
> -  buf->is_owner = FALSE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -// make an alias into buf, with given offset and length
> -// if len = 0, make the alias go to the end of buf
> -TPM_RESULT buffer_init_alias (buffer_t * buf, const buffer_t * b,
> -                              tpm_size_t offset, tpm_size_t len) {
> -  if (offset + len > b->size) {
> -    return TPM_NOSPACE;
> -  }
> -
> -  buf->bytes = b->bytes + offset;
> -  buf->size = len > 0 ? len : b->size - offset;
> -
> -  //VS/ buf->alloc_size = 0;
> -  if (len ==0)
> -    buf->alloc_size = b->alloc_size - offset;
> -  else
> -    buf->alloc_size = MIN(b->alloc_size - offset, len);
> -
> -
> -  buf->is_owner = FALSE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -// make an alias buffer_t into bytestream, with given length
> -TPM_RESULT buffer_init_alias_convert (buffer_t * buf, tpm_size_t size, BYTE* val) {
> -
> -  buf->size = size;
> -  buf->alloc_size = size;
> -  buf->bytes = val;
> -
> -  buf->is_owner = FALSE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -
> -// copy into the start of dest
> -TPM_RESULT buffer_copy (buffer_t * dest, const buffer_t* src)
> -{
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  if (dest->alloc_size < src->size) {
> -    TPMTRYRETURN( buffer_priv_realloc (dest, src->size) );
> -  }
> -
> -  memcpy (dest->bytes, src->bytes, src->size);
> -  dest->size = src->size;
> -
> -  //VS/ dest->is_owner = TRUE;
> -
> - abort_egress:
> -
> -  return status;
> -}
> -
> -
> -
> -BOOL buffer_eq (const buffer_t * a, const buffer_t * b) {
> -  return (a->size == b->size && memcmp (a->bytes, b->bytes, a->size) == 0);
> -}
> -
> -
> -void buffer_memset (buffer_t * buf, BYTE b) {
> -  memset (buf->bytes, b, buf->size);
> -}
> -
> -
> -TPM_RESULT buffer_append_raw (buffer_t * buf, tpm_size_t len, const BYTE* bytes) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  if (buf->alloc_size < buf->size + len) {
> -    TPMTRYRETURN( buffer_priv_realloc (buf, buf->size + len) );
> -  }
> -
> -  memcpy (buf->bytes + buf->size, bytes, len);
> -
> -  buf->size += len;
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -tpm_size_t buffer_len (const buffer_t* buf) {
> -  return buf->size;
> -}
> -
> -TPM_RESULT buffer_free (buffer_t * buf) {
> -  if (buf && buf->is_owner && buf->bytes != NULL) {
> -    free (buf->bytes);
> -    buf->bytes = NULL;
> -    buf->size = buf->alloc_size = 0;
> -
> -  }
> -
> -  return TPM_SUCCESS;
> -}
> -
> -TPM_RESULT buffer_priv_realloc (buffer_t * buf, tpm_size_t newsize) {
> -
> -  // we want to realloc to twice the size, or the new size, whichever
> -  // bigger
> -
> -  BYTE * tmpbuf = NULL;
> -
> -  newsize = MAX (buf->alloc_size * 2, newsize);
> -
> -  tmpbuf = (BYTE*) realloc (buf->bytes, newsize);
> -  if (tmpbuf == NULL)
> -    return TPM_SIZE;
> -
> -
> -  buf->bytes = tmpbuf;
> -  buf->alloc_size = newsize;
> -
> -  return TPM_SUCCESS;
> -}
> diff --git a/tools/vtpm_manager/util/buffer.h b/tools/vtpm_manager/util/buffer.h
> deleted file mode 100644
> index d8a9abc..0000000
> --- a/tools/vtpm_manager/util/buffer.h
> +++ /dev/null
> @@ -1,95 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#ifndef __VTPM_BUFFER_H__
> -#define __VTPM_BUFFER_H__
> -
> -#include <stddef.h>             // for pointer NULL
> -#include "tcg.h"
> -
> -typedef UINT32 tpm_size_t;
> -
> -// first version, probably will be expanded...
> -
> -#define NULL_BUF {0,0,0,0}
> -
> -typedef struct {
> -  // private!!
> -  tpm_size_t size, alloc_size;
> -  BYTE * bytes;
> -
> -  BOOL is_owner;              // do we own this buffer, and need to free it?
> -} buffer_t;
> -
> -// allocate the buffer if initsize > 0, copying over initval if provided
> -TPM_RESULT buffer_init (buffer_t * buf,
> -                        tpm_size_t initsize,
> -                        const BYTE* initval);
> -
> -// Create a new buffer from a BYTE *. Use buffer_free to destroy original BYTE *
> -TPM_RESULT buffer_init_convert (buffer_t * buf,
> -                                tpm_size_t initsize,
> -                                BYTE* initval);
> -
> -// make an alias to a constant array, no copying
> -TPM_RESULT buffer_init_const (buffer_t * buf, tpm_size_t size, const BYTE* val);
> -
> -// make an alias into buf, with given offset and length
> -// if len = 0, make the alias go to the end of buf
> -TPM_RESULT buffer_init_alias (buffer_t * buf, const buffer_t * b,
> -                              tpm_size_t offset, tpm_size_t);
> -
> -// make an alias buffer into a bytestream
> -TPM_RESULT buffer_init_alias_convert (buffer_t * buf,
> -                                      tpm_size_t size, BYTE* val);
> -
> -// "copy constructor"
> -TPM_RESULT buffer_init_copy (buffer_t * buf, const buffer_t * src);
> -
> -
> -// copy into the start of a
> -TPM_RESULT buffer_copy (buffer_t * dest, const buffer_t* src);
> -
> -// are they equal?
> -BOOL buffer_eq (const buffer_t * a, const buffer_t * b);
> -
> -// set the buffer to a constant byte
> -void buffer_memset (buffer_t * buf, BYTE b);
> -
> -tpm_size_t buffer_len (const buffer_t* buf);
> -
> -TPM_RESULT buffer_free (buffer_t * buf);
> -
> -TPM_RESULT buffer_append_raw (buffer_t * buf, tpm_size_t len, const BYTE* bytes);
> -
> -#endif // _TOOLS_H_
> diff --git a/tools/vtpm_manager/util/hashtable.c b/tools/vtpm_manager/util/hashtable.c
> deleted file mode 100644
> index aff0e2b..0000000
> --- a/tools/vtpm_manager/util/hashtable.c
> +++ /dev/null
> @@ -1,316 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/xenstore/hashtable.c
> - *  - tools/blktap2/drivers/hashtable.c
> - */
> -
> -#include "hashtable.h"
> -#include "hashtable_private.h"
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> -#include <math.h>
> -
> -/*
> -Credit for primes table: Aaron Krowne
> - http://br.endernet.org/~akrowne/
> - http://planetmath.org/encyclopedia/GoodHashTablePrimes.html
> -*/
> -static const unsigned int primes[] = {
> -53, 97, 193, 389,
> -769, 1543, 3079, 6151,
> -12289, 24593, 49157, 98317,
> -196613, 393241, 786433, 1572869,
> -3145739, 6291469, 12582917, 25165843,
> -50331653, 100663319, 201326611, 402653189,
> -805306457, 1610612741
> -};
> -const unsigned int prime_table_length = sizeof(primes)/sizeof(primes[0]);
> -const float max_load_factor = 0.65;
> -
> -/*****************************************************************************/
> -struct hashtable *
> -create_hashtable(unsigned int minsize,
> -                 unsigned int (*hashf) (void*),
> -                 int (*eqf) (void*,void*))
> -{
> -    struct hashtable *h;
> -    unsigned int pindex, size = primes[0];
> -    /* Check requested hashtable isn't too large */
> -    if (minsize > (1u << 30)) return NULL;
> -    /* Enforce size as prime */
> -    for (pindex=0; pindex < prime_table_length; pindex++) {
> -        if (primes[pindex] > minsize) { size = primes[pindex]; break; }
> -    }
> -    h = (struct hashtable *)malloc(sizeof(struct hashtable));
> -    if (NULL == h) return NULL; /*oom*/
> -    h->table = (struct entry **)malloc(sizeof(struct entry*) * size);
> -    if (NULL == h->table) { free(h); return NULL; } /*oom*/
> -    memset(h->table, 0, size * sizeof(struct entry *));
> -    h->tablelength  = size;
> -    h->primeindex   = pindex;
> -    h->entrycount   = 0;
> -    h->hashfn       = hashf;
> -    h->eqfn         = eqf;
> -    h->loadlimit    = (unsigned int) ceil(size * max_load_factor);
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_init(&h->mutex, NULL);
> -#endif
> -    return h;
> -}
> -
> -/*****************************************************************************/
> -unsigned int
> -hash(struct hashtable *h, void *k)
> -{
> -    unsigned int i = h->hashfn(k);
> -    i += ~(i << 9);
> -    i ^=  ((i >> 14) | (i << 18)); /* >>> */
> -    i +=  (i << 4);
> -    i ^=  ((i >> 10) | (i << 22)); /* >>> */
> -    return i;
> -}
> -
> -/*****************************************************************************/
> -static int
> -hashtable_expand(struct hashtable *h)
> -{
> -    /* Double the size of the table to accomodate more entries */
> -    struct entry **newtable;
> -    struct entry *e;
> -    struct entry **pE;
> -    unsigned int newsize, i, index;
> -    /* Check we're not hitting max capacity */
> -    if (h->primeindex == (prime_table_length - 1)) return 0;
> -    newsize = primes[++(h->primeindex)];
> -
> -    newtable = (struct entry **)malloc(sizeof(struct entry*) * newsize);
> -    if (NULL != newtable)
> -    {
> -        memset(newtable, 0, newsize * sizeof(struct entry *));
> -        /* This algorithm is not 'stable'. ie. it reverses the list
> -         * when it transfers entries between the tables */
> -        for (i = 0; i < h->tablelength; i++) {
> -            while (NULL != (e = h->table[i])) {
> -                h->table[i] = e->next;
> -                index = indexFor(newsize,e->h);
> -                e->next = newtable[index];
> -                newtable[index] = e;
> -            }
> -        }
> -        free(h->table);
> -        h->table = newtable;
> -    }
> -    /* Plan B: realloc instead */
> -    else
> -    {
> -        newtable = (struct entry **)
> -                   realloc(h->table, newsize * sizeof(struct entry *));
> -        if (NULL == newtable) { (h->primeindex)--; return 0; }
> -        h->table = newtable;
> -        memset(newtable[h->tablelength], 0, newsize - h->tablelength);
> -        for (i = 0; i < h->tablelength; i++) {
> -            for (pE = &(newtable[i]), e = *pE; e != NULL; e = *pE) {
> -                index = indexFor(newsize,e->h);
> -                if (index == i)
> -                {
> -                    pE = &(e->next);
> -                }
> -                else
> -                {
> -                    *pE = e->next;
> -                    e->next = newtable[index];
> -                    newtable[index] = e;
> -                }
> -            }
> -        }
> -    }
> -    h->tablelength = newsize;
> -    h->loadlimit   = (unsigned int) ceil(newsize * max_load_factor);
> -    return -1;
> -}
> -
> -/*****************************************************************************/
> -unsigned int
> -hashtable_count(struct hashtable *h)
> -{
> -    unsigned int count;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    count = h->entrycount;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return count;
> -}
> -
> -/*****************************************************************************/
> -int
> -hashtable_insert(struct hashtable *h, void *k, void *v)
> -{
> -    /* This method allows duplicate keys - but they shouldn't be used */
> -    unsigned int index;
> -    struct entry *e;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    if (++(h->entrycount) > h->loadlimit)
> -    {
> -        /* Ignore the return value. If expand fails, we should
> -         * still try cramming just this value into the existing table
> -         * -- we may not have memory for a larger table, but one more
> -         * element may be ok. Next time we insert, we'll try expanding again.*/
> -        hashtable_expand(h);
> -    }
> -    e = (struct entry *)malloc(sizeof(struct entry));
> -    if (NULL == e) { --(h->entrycount); return 0; } /*oom*/
> -    e->h = hash(h,k);
> -    index = indexFor(h->tablelength,e->h);
> -    e->k = k;
> -    e->v = v;
> -    e->next = h->table[index];
> -    h->table[index] = e;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return -1;
> -}
> -
> -/*****************************************************************************/
> -void * /* returns value associated with key */
> -hashtable_search(struct hashtable *h, void *k)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    struct entry *e;
> -    unsigned int hashvalue, index;
> -    hashvalue = hash(h,k);
> -    index = indexFor(h->tablelength,hashvalue);
> -    e = h->table[index];
> -    while (NULL != e)
> -    {
> -        /* Check hash value to short circuit heavier comparison */
> -        if ((hashvalue == e->h) && (h->eqfn(k, e->k))) {
> -#ifdef HASHTABLE_THREADED
> -          pthread_mutex_unlock(&h->mutex);
> -#endif
> -          return e->v;
> -        }
> -        e = e->next;
> -    }
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return NULL;
> -}
> -
> -/*****************************************************************************/
> -void * /* returns value associated with key */
> -hashtable_remove(struct hashtable *h, void *k)
> -{
> -    /* TODO: consider compacting the table when the load factor drops enough,
> -     *       or provide a 'compact' method. */
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    struct entry *e;
> -    struct entry **pE;
> -    void *v;
> -    unsigned int hashvalue, index;
> -
> -    hashvalue = hash(h,k);
> -    index = indexFor(h->tablelength,hash(h,k));
> -    pE = &(h->table[index]);
> -    e = *pE;
> -    while (NULL != e)
> -    {
> -        /* Check hash value to short circuit heavier comparison */
> -        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
> -        {
> -            *pE = e->next;
> -            h->entrycount--;
> -            v = e->v;
> -            freekey(e->k);
> -            free(e);
> -            return v;
> -        }
> -        pE = &(e->next);
> -        e = e->next;
> -    }
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return NULL;
> -}
> -
> -/*****************************************************************************/
> -/* destroy */
> -void
> -hashtable_destroy(struct hashtable *h, int free_values)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    unsigned int i;
> -    struct entry *e, *f;
> -    struct entry **table = h->table;
> -    if (free_values)
> -    {
> -        for (i = 0; i < h->tablelength; i++)
> -        {
> -            e = table[i];
> -            while (NULL != e)
> -            { f = e; e = e->next; freekey(f->k); free(f->v); free(f); }
> -        }
> -    }
> -    else
> -    {
> -        for (i = 0; i < h->tablelength; i++)
> -        {
> -            e = table[i];
> -            while (NULL != e)
> -            { f = e; e = e->next; freekey(f->k); free(f); }
> -        }
> -    }
> -    free(h->table);
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_destroy(&h->mutex);
> -#endif
> -    free(h);
> -}
> diff --git a/tools/vtpm_manager/util/hashtable.h b/tools/vtpm_manager/util/hashtable.h
> deleted file mode 100644
> index dedc60a..0000000
> --- a/tools/vtpm_manager/util/hashtable.h
> +++ /dev/null
> @@ -1,204 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/xenstore/hashtable.h
> - *  - tools/blktap2/drivers/hashtable.h
> - */
> -
> -#ifndef __HASHTABLE_CWC22_H__
> -#define __HASHTABLE_CWC22_H__
> -
> -struct hashtable;
> -
> -/* Example of use:
> - *
> - *      struct hashtable  *h;
> - *      struct some_key   *k;
> - *      struct some_value *v;
> - *
> - *      static unsigned int         hash_from_key_fn( void *k );
> - *      static int                  keys_equal_fn ( void *key1, void *key2 );
> - *
> - *      h = create_hashtable(16, hash_from_key_fn, keys_equal_fn);
> - *      k = (struct some_key *)     malloc(sizeof(struct some_key));
> - *      v = (struct some_value *)   malloc(sizeof(struct some_value));
> - *
> - *      (initialise k and v to suitable values)
> - *
> - *      if (! hashtable_insert(h,k,v) )
> - *      {     exit(-1);               }
> - *
> - *      if (NULL == (found = hashtable_search(h,k) ))
> - *      {    printf("not found!");                  }
> - *
> - *      if (NULL == (found = hashtable_remove(h,k) ))
> - *      {    printf("Not found\n");                 }
> - *
> - */
> -
> -/* Macros may be used to define type-safe(r) hashtable access functions, with
> - * methods specialized to take known key and value types as parameters.
> - *
> - * Example:
> - *
> - * Insert this at the start of your file:
> - *
> - * DEFINE_HASHTABLE_INSERT(insert_some, struct some_key, struct some_value);
> - * DEFINE_HASHTABLE_SEARCH(search_some, struct some_key, struct some_value);
> - * DEFINE_HASHTABLE_REMOVE(remove_some, struct some_key, struct some_value);
> - *
> - * This defines the functions 'insert_some', 'search_some' and 'remove_some'.
> - * These operate just like hashtable_insert etc., with the same parameters,
> - * but their function signatures have 'struct some_key *' rather than
> - * 'void *', and hence can generate compile time errors if your program is
> - * supplying incorrect data as a key (and similarly for value).
> - *
> - * Note that the hash and key equality functions passed to create_hashtable
> - * still take 'void *' parameters instead of 'some key *'. This shouldn't be
> - * a difficult issue as they're only defined and passed once, and the other
> - * functions will ensure that only valid keys are supplied to them.
> - *
> - * The cost for this checking is increased code size and runtime overhead
> - * - if performance is important, it may be worth switching back to the
> - * unsafe methods once your program has been debugged with the safe methods.
> - * This just requires switching to some simple alternative defines - eg:
> - * #define insert_some hashtable_insert
> - *
> - */
> -
> -/*****************************************************************************
> - * create_hashtable
> -
> - * @name                    create_hashtable
> - * @param   minsize         minimum initial size of hashtable
> - * @param   hashfunction    function for hashing keys
> - * @param   key_eq_fn       function for determining key equality
> - * @return                  newly created hashtable or NULL on failure
> - */
> -
> -struct hashtable *
> -create_hashtable(unsigned int minsize,
> -                 unsigned int (*hashfunction) (void*),
> -                 int (*key_eq_fn) (void*,void*));
> -
> -/*****************************************************************************
> - * hashtable_insert
> -
> - * @name        hashtable_insert
> - * @param   h   the hashtable to insert into
> - * @param   k   the key - hashtable claims ownership and will free on removal
> - * @param   v   the value - does not claim ownership
> - * @return      non-zero for successful insertion
> - *
> - * This function will cause the table to expand if the insertion would take
> - * the ratio of entries to table size over the maximum load factor.
> - *
> - * This function does not check for repeated insertions with a duplicate key.
> - * The value returned when using a duplicate key is undefined -- when
> - * the hashtable changes size, the order of retrieval of duplicate key
> - * entries is reversed.
> - * If in doubt, remove before insert.
> - */
> -
> -int
> -hashtable_insert(struct hashtable *h, void *k, void *v);
> -
> -#define DEFINE_HASHTABLE_INSERT(fnname, keytype, valuetype) \
> -int fnname (struct hashtable *h, keytype *k, valuetype *v) \
> -{ \
> -    return hashtable_insert(h,k,v); \
> -}
> -
> -/*****************************************************************************
> - * hashtable_search
> -
> - * @name        hashtable_search
> - * @param   h   the hashtable to search
> - * @param   k   the key to search for  - does not claim ownership
> - * @return      the value associated with the key, or NULL if none found
> - */
> -
> -void *
> -hashtable_search(struct hashtable *h, void *k);
> -
> -#define DEFINE_HASHTABLE_SEARCH(fnname, keytype, valuetype) \
> -valuetype * fnname (struct hashtable *h, keytype *k) \
> -{ \
> -    return (valuetype *) (hashtable_search(h,k)); \
> -}
> -
> -/*****************************************************************************
> - * hashtable_remove
> -
> - * @name        hashtable_remove
> - * @param   h   the hashtable to remove the item from
> - * @param   k   the key to search for  - does not claim ownership
> - * @return      the value associated with the key, or NULL if none found
> - */
> -
> -void * /* returns value */
> -hashtable_remove(struct hashtable *h, void *k);
> -
> -#define DEFINE_HASHTABLE_REMOVE(fnname, keytype, valuetype) \
> -valuetype * fnname (struct hashtable *h, keytype *k) \
> -{ \
> -    return (valuetype *) (hashtable_remove(h,k)); \
> -}
> -
> -
> -/*****************************************************************************
> - * hashtable_count
> -
> - * @name        hashtable_count
> - * @param   h   the hashtable
> - * @return      the number of items stored in the hashtable
> - */
> -unsigned int
> -hashtable_count(struct hashtable *h);
> -
> -
> -/*****************************************************************************
> - * hashtable_destroy
> -
> - * @name        hashtable_destroy
> - * @param   h   the hashtable
> - * @param       free_values     whether to call 'free' on the remaining values
> - */
> -
> -void
> -hashtable_destroy(struct hashtable *h, int free_values);
> -
> -#endif /* __HASHTABLE_CWC22_H__ */
> diff --git a/tools/vtpm_manager/util/hashtable_itr.c b/tools/vtpm_manager/util/hashtable_itr.c
> deleted file mode 100644
> index dcf42c8..0000000
> --- a/tools/vtpm_manager/util/hashtable_itr.c
> +++ /dev/null
> @@ -1,236 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/blktap2/drivers/hashtable_itr.c
> - */
> -
> -#include "hashtable.h"
> -#include "hashtable_private.h"
> -#include "hashtable_itr.h"
> -#include <stdlib.h> /* defines NULL */
> -
> -/*****************************************************************************/
> -/* hashtable_iterator    - iterator constructor */
> -
> -struct hashtable_itr *
> -hashtable_iterator(struct hashtable *h)
> -{
> -    unsigned int i, tablelength;
> -    struct hashtable_itr *itr = (struct hashtable_itr *)
> -        malloc(sizeof(struct hashtable_itr));
> -    if (NULL == itr) return NULL;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    itr->h = h;
> -    itr->e = NULL;
> -    itr->parent = NULL;
> -    tablelength = h->tablelength;
> -    itr->index = tablelength;
> -    if (0 == h->entrycount) {
> -#ifdef HASHTABLE_THREADED
> -      pthread_mutex_unlock(&h->mutex);
> -#endif
> -      return itr;
> -    }
> -
> -    for (i = 0; i < tablelength; i++)
> -    {
> -        if (NULL != h->table[i])
> -        {
> -            itr->e = h->table[i];
> -            itr->index = i;
> -            break;
> -        }
> -    }
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return itr;
> -}
> -
> -/*****************************************************************************/
> -/* key      - return the key of the (key,value) pair at the current position */
> -/* value    - return the value of the (key,value) pair at the current position */
> -
> -void *
> -hashtable_iterator_key(struct hashtable_itr *i)
> -{ return i->e->k; }
> -
> -void *
> -hashtable_iterator_value(struct hashtable_itr *i)
> -{ return i->e->v; }
> -
> -/*****************************************************************************/
> -/* advance - advance the iterator to the next element
> - *           returns zero if advanced to end of table */
> -
> -int
> -hashtable_iterator_advance(struct hashtable_itr *itr)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&itr->h->mutex);
> -#endif
> -    unsigned int j,tablelength;
> -    struct entry **table;
> -    struct entry *next;
> -    int ret;
> -    if (NULL == itr->e) { /* stupidity check */
> -      ret = 0;
> -      goto egress;
> -    }
> -
> -    next = itr->e->next;
> -    if (NULL != next)
> -    {
> -        itr->parent = itr->e;
> -        itr->e = next;
> -        ret = -1;
> -        goto egress;
> -    }
> -
> -    tablelength = itr->h->tablelength;
> -    itr->parent = NULL;
> -    if (tablelength <= (j = ++(itr->index)))
> -    {
> -        itr->e = NULL;
> -        ret = 0;
> -        goto egress;
> -    }
> -    table = itr->h->table;
> -    while (NULL == (next = table[j]))
> -    {
> -        if (++j >= tablelength)
> -        {
> -            itr->index = tablelength;
> -            itr->e = NULL;
> -            ret = 0;
> -            goto egress;
> -        }
> -    }
> -    itr->index = j;
> -    itr->e = next;
> -    ret = -1;
> -
> - egress:
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&itr->h->mutex);
> -#endif
> -    return ret;
> -}
> -
> -/*****************************************************************************/
> -/* remove - remove the entry at the current iterator position
> - *          and advance the iterator, if there is a successive
> - *          element.
> - *          If you want the value, read it before you remove:
> - *          beware memory leaks if you don't.
> - *          Returns zero if end of iteration. */
> -
> -int
> -hashtable_iterator_remove(struct hashtable_itr *itr)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&itr->h->mutex);
> -#endif
> -    struct entry *remember_e, *remember_parent;
> -    int ret;
> -
> -    /* Do the removal */
> -    if (NULL == (itr->parent))
> -    {
> -        /* element is head of a chain */
> -        itr->h->table[itr->index] = itr->e->next;
> -    } else {
> -        /* element is mid-chain */
> -        itr->parent->next = itr->e->next;
> -    }
> -    /* itr->e is now outside the hashtable */
> -    remember_e = itr->e;
> -    itr->h->entrycount--;
> -    freekey(remember_e->k);
> -
> -    /* Advance the iterator, correcting the parent */
> -    remember_parent = itr->parent;
> -    ret = hashtable_iterator_advance(itr);
> -    if (itr->parent == remember_e) { itr->parent = remember_parent; }
> -    free(remember_e);
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&itr->h->mutex);
> -#endif
> -    return ret;
> -}
> -
> -/*****************************************************************************/
> -int /* returns zero if not found */
> -hashtable_iterator_search(struct hashtable_itr *itr,
> -                          struct hashtable *h, void *k)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    struct entry *e, *parent;
> -    unsigned int hashvalue, index;
> -    int ret;
> -
> -    hashvalue = hash(h,k);
> -    index = indexFor(h->tablelength,hashvalue);
> -
> -    e = h->table[index];
> -    parent = NULL;
> -    while (NULL != e)
> -    {
> -        /* Check hash value to short circuit heavier comparison */
> -        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
> -        {
> -            itr->index = index;
> -            itr->e = e;
> -            itr->parent = parent;
> -            itr->h = h;
> -            ret= -1;
> -            goto egress;
> -        }
> -        parent = e;
> -        e = e->next;
> -    }
> -  ret = 0;
> -
> -egress:
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return ret;
> -}
> diff --git a/tools/vtpm_manager/util/hashtable_itr.h b/tools/vtpm_manager/util/hashtable_itr.h
> deleted file mode 100644
> index 35654e0..0000000
> --- a/tools/vtpm_manager/util/hashtable_itr.h
> +++ /dev/null
> @@ -1,109 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/blktap2/drivers/hashtable_itr.h
> - */
> -
> -
> -#ifndef __HASHTABLE_ITR_CWC22__
> -#define __HASHTABLE_ITR_CWC22__
> -#include "hashtable.h"
> -#include "hashtable_private.h" /* needed to enable inlining */
> -
> -/*****************************************************************************/
> -/* This struct is only concrete here to allow the inlining of two of the
> - * accessor functions. */
> -struct hashtable_itr
> -{
> -    struct hashtable *h;
> -    struct entry *e;
> -    struct entry *parent;
> -    unsigned int index;
> -};
> -
> -
> -/*****************************************************************************/
> -/* hashtable_iterator
> - */
> -
> -struct hashtable_itr *
> -hashtable_iterator(struct hashtable *h);
> -
> -/*****************************************************************************/
> -/* hashtable_iterator_key
> - * - return the value of the (key,value) pair at the current position */
> -
> -void *hashtable_iterator_key(struct hashtable_itr *i);
> -
> -/*****************************************************************************/
> -/* value - return the value of the (key,value) pair at the current position */
> -
> -void *hashtable_iterator_value(struct hashtable_itr *i);
> -
> -/*****************************************************************************/
> -/* advance - advance the iterator to the next element
> - *           returns zero if advanced to end of table */
> -
> -int
> -hashtable_iterator_advance(struct hashtable_itr *itr);
> -
> -/*****************************************************************************/
> -/* remove - remove current element and advance the iterator to the next element
> - *          NB: if you need the value to free it, read it before
> - *          removing. ie: beware memory leaks!
> - *          returns zero if advanced to end of table */
> -
> -int
> -hashtable_iterator_remove(struct hashtable_itr *itr);
> -
> -/*****************************************************************************/
> -/* search - overwrite the supplied iterator, to point to the entry
> - *          matching the supplied key.
> -            h points to the hashtable to be searched.
> - *          returns zero if not found. */
> -int
> -hashtable_iterator_search(struct hashtable_itr *itr,
> -                          struct hashtable *h, void *k);
> -
> -#define DEFINE_HASHTABLE_ITERATOR_SEARCH(fnname, keytype) \
> -int fnname (struct hashtable_itr *i, struct hashtable *h, keytype *k) \
> -{ \
> -    return (hashtable_iterator_search(i,h,k)); \
> -}
> -
> -
> -
> -#endif /* __HASHTABLE_ITR_CWC22__*/
> diff --git a/tools/vtpm_manager/util/hashtable_private.h b/tools/vtpm_manager/util/hashtable_private.h
> deleted file mode 100644
> index d87a7f9..0000000
> --- a/tools/vtpm_manager/util/hashtable_private.h
> +++ /dev/null
> @@ -1,96 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/xenstore/hashtable_private.h
> - *  - tools/blktap2/drivers/hashtable_private.h
> - */
> -
> -#ifndef __HASHTABLE_PRIVATE_CWC22_H__
> -#define __HASHTABLE_PRIVATE_CWC22_H__
> -
> -#include "hashtable.h"
> -#ifdef HASHTABLE_THREADED
> -#include <pthread.h>
> -#endif
> -
> -/*****************************************************************************/
> -struct entry
> -{
> -    void *k, *v;
> -    unsigned int h;
> -    struct entry *next;
> -};
> -
> -struct hashtable {
> -    unsigned int tablelength;
> -    struct entry **table;
> -    unsigned int entrycount;
> -    unsigned int loadlimit;
> -    unsigned int primeindex;
> -    unsigned int (*hashfn) (void *k);
> -    int (*eqfn) (void *k1, void *k2);
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_t mutex;
> -#endif
> -};
> -
> -/*****************************************************************************/
> -unsigned int
> -hash(struct hashtable *h, void *k);
> -
> -/*****************************************************************************/
> -/* indexFor */
> -static inline unsigned int
> -indexFor(unsigned int tablelength, unsigned int hashvalue) {
> -    return (hashvalue % tablelength);
> -};
> -
> -/* Only works if tablelength == 2^N */
> -/*static inline unsigned int
> -indexFor(unsigned int tablelength, unsigned int hashvalue)
> -{
> -    return (hashvalue & (tablelength - 1u));
> -}
> -*/
> -
> -/*****************************************************************************/
> -#define freekey(X) free(X)
> -/*define freekey(X) ; */
> -
> -
> -/*****************************************************************************/
> -
> -#endif /* __HASHTABLE_PRIVATE_CWC22_H__*/
> diff --git a/tools/vtpm_manager/util/log.c b/tools/vtpm_manager/util/log.c
> deleted file mode 100644
> index 75fe91a..0000000
> --- a/tools/vtpm_manager/util/log.c
> +++ /dev/null
> @@ -1,142 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <stdlib.h>
> -#include <string.h>
> -#include <stdio.h>
> -
> -#include "buffer.h"
> -#include "tcg.h"
> -
> -// Helper code for the consts, eg. to produce messages for error codes.
> -
> -typedef struct error_code_entry_t {
> -  TPM_RESULT code;
> -  char * code_name;
> -  char * msg;
> -} error_code_entry_t;
> -
> -static const error_code_entry_t error_msgs [] = {
> -  { TPM_SUCCESS, "TPM_SUCCESS", "Successful completion of the operation" },
> -  { TPM_AUTHFAIL, "TPM_AUTHFAIL", "Authentication failed" },
> -  { TPM_BADINDEX, "TPM_BADINDEX", "The index to a PCR, DIR or other register is incorrect" },
> -  { TPM_BAD_PARAMETER, "TPM_BAD_PARAMETER", "One or more parameter is bad" },
> -  { TPM_AUDITFAILURE, "TPM_AUDITFAILURE", "An operation completed successfully but the auditing of that operation failed." },
> -  { TPM_CLEAR_DISABLED, "TPM_CLEAR_DISABLED", "The clear disable flag is set and all clear operations now require physical access" },
> -  { TPM_DEACTIVATED, "TPM_DEACTIVATED", "The TPM is deactivated" },
> -  { TPM_DISABLED, "TPM_DISABLED", "The TPM is disabled" },
> -  { TPM_DISABLED_CMD, "TPM_DISABLED_CMD", "The target command has been disabled" },
> -  { TPM_FAIL, "TPM_FAIL", "The operation failed" },
> -  { TPM_BAD_ORDINAL, "TPM_BAD_ORDINAL", "The ordinal was unknown or inconsistent" },
> -  { TPM_INSTALL_DISABLED, "TPM_INSTALL_DISABLED", "The ability to install an owner is disabled" },
> -  { TPM_INVALID_KEYHANDLE, "TPM_INVALID_KEYHANDLE", "The key handle presented was invalid" },
> -  { TPM_KEYNOTFOUND, "TPM_KEYNOTFOUND", "The target key was not found" },
> -  { TPM_INAPPROPRIATE_ENC, "TPM_INAPPROPRIATE_ENC", "Unacceptable encryption scheme" },
> -  { TPM_MIGRATEFAIL, "TPM_MIGRATEFAIL", "Migration authorization failed" },
> -  { TPM_INVALID_PCR_INFO, "TPM_INVALID_PCR_INFO", "PCR information could not be interpreted" },
> -  { TPM_NOSPACE, "TPM_NOSPACE", "No room to load key." },
> -  { TPM_NOSRK, "TPM_NOSRK", "There is no SRK set" },
> -  { TPM_NOTSEALED_BLOB, "TPM_NOTSEALED_BLOB", "An encrypted blob is invalid or was not created by this TPM" },
> -  { TPM_OWNER_SET, "TPM_OWNER_SET", "There is already an Owner" },
> -  { TPM_RESOURCES, "TPM_RESOURCES", "The TPM has insufficient internal resources to perform the requested action." },
> -  { TPM_SHORTRANDOM, "TPM_SHORTRANDOM", "A random string was too short" },
> -  { TPM_SIZE, "TPM_SIZE", "The TPM does not have the space to perform the operation." },
> -  { TPM_WRONGPCRVAL, "TPM_WRONGPCRVAL", "The named PCR value does not match the current PCR value." },
> -  { TPM_BAD_PARAM_SIZE, "TPM_BAD_PARAM_SIZE", "The paramSize argument to the command has the incorrect value" },
> -  { TPM_SHA_THREAD, "TPM_SHA_THREAD", "There is no existing SHA-1 thread." },
> -  { TPM_SHA_ERROR, "TPM_SHA_ERROR", "The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error." },
> -  { TPM_FAILEDSELFTEST, "TPM_FAILEDSELFTEST", "Self-test has failed and the TPM has shutdown." },
> -  { TPM_AUTH2FAIL, "TPM_AUTH2FAIL", "The authorization for the second key in a 2 key function failed authorization" },
> -  { TPM_BADTAG, "TPM_BADTAG", "The tag value sent to for a command is invalid" },
> -  { TPM_IOERROR, "TPM_IOERROR", "An IO error occurred transmitting information to the TPM" },
> -  { TPM_ENCRYPT_ERROR, "TPM_ENCRYPT_ERROR", "The encryption process had a problem." },
> -  { TPM_DECRYPT_ERROR, "TPM_DECRYPT_ERROR", "The decryption process did not complete." },
> -  { TPM_INVALID_AUTHHANDLE, "TPM_INVALID_AUTHHANDLE", "An invalid handle was used." },
> -  { TPM_NO_ENDORSEMENT, "TPM_NO_ENDORSEMENT", "The TPM does not a EK installed" },
> -  { TPM_INVALID_KEYUSAGE, "TPM_INVALID_KEYUSAGE", "The usage of a key is not allowed" },
> -  { TPM_WRONG_ENTITYTYPE, "TPM_WRONG_ENTITYTYPE", "The submitted entity type is not allowed" },
> -  { TPM_INVALID_POSTINIT, "TPM_INVALID_POSTINIT", "The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup" },
> -  { TPM_INAPPROPRIATE_SIG, "TPM_INAPPROPRIATE_SIG", "Signed data cannot include additional DER information" },
> -  { TPM_BAD_KEY_PROPERTY, "TPM_BAD_KEY_PROPERTY", "The key properties in TPM_KEY_PARMs are not supported by this TPM" },
> -
> -  { TPM_BAD_MIGRATION, "TPM_BAD_MIGRATION", "The migration properties of this key are incorrect." },
> -  { TPM_BAD_SCHEME, "TPM_BAD_SCHEME", "The signature or encryption scheme for this key is incorrect or not permitted in this situation." },
> -  { TPM_BAD_DATASIZE, "TPM_BAD_DATASIZE", "The size of the data (or blob) parameter is bad or inconsistent with the referenced key" },
> -  { TPM_BAD_MODE, "TPM_BAD_MODE", "A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob." },
> -  { TPM_BAD_PRESENCE, "TPM_BAD_PRESENCE", "Either the physicalPresence or physicalPresenceLock bits have the wrong value" },
> -  { TPM_BAD_VERSION, "TPM_BAD_VERSION", "The TPM cannot perform this version of the capability" },
> -  { TPM_NO_WRAP_TRANSPORT, "TPM_NO_WRAP_TRANSPORT", "The TPM does not allow for wrapped transport sessions" },
> -  { TPM_AUDITFAIL_UNSUCCESSFUL, "TPM_AUDITFAIL_UNSUCCESSFUL", "TPM audit construction failed and the underlying command was returning a failure code also" },
> -  { TPM_AUDITFAIL_SUCCESSFUL, "TPM_AUDITFAIL_SUCCESSFUL", "TPM audit construction failed and the underlying command was returning success" },
> -  { TPM_NOTRESETABLE, "TPM_NOTRESETABLE", "Attempt to reset a PCR register that does not have the resettable attribute" },
> -  { TPM_NOTLOCAL, "TPM_NOTLOCAL", "Attempt to reset a PCR register that requires locality and locality modifier not part of command transport" },
> -  { TPM_BAD_TYPE, "TPM_BAD_TYPE", "Make identity blob not properly typed" },
> -  { TPM_INVALID_RESOURCE, "TPM_INVALID_RESOURCE", "When saving context identified resource type does not match actual resource" },
> -  { TPM_NOTFIPS, "TPM_NOTFIPS", "The TPM is attempting to execute a command only available when in FIPS mode" },
> -  { TPM_INVALID_FAMILY, "TPM_INVALID_FAMILY", "The command is attempting to use an invalid family ID" },
> -  { TPM_NO_NV_PERMISSION, "TPM_NO_NV_PERMISSION", "The permission to manipulate the NV storage is not available" },
> -  { TPM_REQUIRES_SIGN, "TPM_REQUIRES_SIGN", "The operation requires a signed command" },
> -  { TPM_KEY_NOTSUPPORTED, "TPM_KEY_NOTSUPPORTED", "Wrong operation to load an NV key" },
> -  { TPM_AUTH_CONFLICT, "TPM_AUTH_CONFLICT", "NV_LoadKey blob requires both owner and blob authorization" },
> -  { TPM_AREA_LOCKED, "TPM_AREA_LOCKED", "The NV area is locked and not writtable" },
> -  { TPM_BAD_LOCALITY, "TPM_BAD_LOCALITY", "The locality is incorrect for the attempted operation" },
> -  { TPM_READ_ONLY, "TPM_READ_ONLY", "The NV area is read only and can't be written to" },
> -  { TPM_PER_NOWRITE, "TPM_PER_NOWRITE", "There is no protection on the write to the NV area" },
> -  { TPM_FAMILYCOUNT, "TPM_FAMILYCOUNT", "The family count value does not match" },
> -  { TPM_WRITE_LOCKED, "TPM_WRITE_LOCKED", "The NV area has already been written to" },
> -  { TPM_BAD_ATTRIBUTES, "TPM_BAD_ATTRIBUTES", "The NV area attributes conflict" },
> -  { TPM_INVALID_STRUCTURE, "TPM_INVALID_STRUCTURE", "The structure tag and version are invalid or inconsistent" },
> -  { TPM_KEY_OWNER_CONTROL, "TPM_KEY_OWNER_CONTROL", "The key is under control of the TPM Owner and can only be evicted by the TPM Owner." },
> -  { TPM_BAD_COUNTER, "TPM_BAD_COUNTER", "The counter handle is incorrect" },
> -  { TPM_NOT_FULLWRITE, "TPM_NOT_FULLWRITE", "The write is not a complete write of the area" },
> -  { TPM_CONTEXT_GAP, "TPM_CONTEXT_GAP", "The gap between saved context counts is too large" },
> -  { TPM_MAXNVWRITES, "TPM_MAXNVWRITES", "The maximum number of NV writes without an owner has been exceeded" },
> -  { TPM_NOOPERATOR, "TPM_NOOPERATOR", "No operator authorization value is set" },
> -  { TPM_RESOURCEMISSING, "TPM_RESOURCEMISSING", "The resource pointed to by context is not loaded" },
> -  { TPM_DELEGATE_LOCK, "TPM_DELEGATE_LOCK", "The delegate administration is locked" },
> -  { TPM_DELEGATE_FAMILY, "TPM_DELEGATE_FAMILY", "Attempt to manage a family other then the delegated family" },
> -  { TPM_DELEGATE_ADMIN, "TPM_DELEGATE_ADMIN", "Delegation table management not enabled" },
> -  { TPM_TRANSPORT_EXCLUSIVE, "TPM_TRANSPORT_EXCLUSIVE", "There was a command executed outside of an exclusive transport session" },
> -};
> -
> -
> -// helper function for the error codes:
> -const char* tpm_get_error_name (TPM_RESULT code) {
> -  // just do a linear scan for now
> -  unsigned i;
> -  for (i = 0; i < sizeof(error_msgs)/sizeof(error_msgs[0]); i++)
> -    if (code == error_msgs[i].code)
> -      return error_msgs[i].code_name;
> -
> -    return("Unknown Error Code");
> -}
> diff --git a/tools/vtpm_manager/util/log.h b/tools/vtpm_manager/util/log.h
> deleted file mode 100644
> index 1f15f5b..0000000
> --- a/tools/vtpm_manager/util/log.h
> +++ /dev/null
> @@ -1,94 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#ifndef __VTPM_LOG_H__
> -#define __VTPM_LOG_H__
> -
> -#include <stdint.h>             // for uint32_t
> -#include <stddef.h>             // for pointer NULL
> -
> -// =========================== LOGGING ==============================
> -
> -// the logging module numbers
> -#define VTPM_LOG_CRYPTO      1
> -#define VTPM_LOG_BSG         2
> -#define VTPM_LOG_TXDATA      3
> -#define VTPM_LOG_TCS         4
> -#define VTPM_LOG_TCS_DEEP    5
> -#define VTPM_LOG_VTSP        6
> -#define VTPM_LOG_VTPM        7
> -#define VTPM_LOG_VTPM_DEEP   8
> -#define VTPM_LOG_VTSP_DEEP   9
> -
> -static char *module_names[] = { "",
> -                                "CRYPTO",
> -                                "BSG",
> -                                "TXDATA",
> -                                "TCS",
> -                                "TCS",
> -                                "VTSP",
> -                                "VTPM",
> -                                "VTPM",
> -                                "VTSP"
> -                              };
> -
> -// Default to standard logging
> -#ifndef LOGGING_MODULES
> -#define LOGGING_MODULES (BITMASK(VTPM_LOG_VTPM))
> -#endif
> -
> -// bit-access macros
> -#define BITMASK(idx)      ( 1U << (idx) )
> -#define GETBIT(num,idx)   ( ((num) & BITMASK(idx)) >> idx )
> -#define SETBIT(num,idx)   (num) |= BITMASK(idx)
> -#define CLEARBIT(num,idx) (num) &= ( ~ BITMASK(idx) )
> -
> -#define vtpmloginfo(module, fmt, args...) \
> -  if (GETBIT (LOGGING_MODULES, module) == 1) {                         \
> -    fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); \
> -  }
> -
> -#define vtpmloginfomore(module, fmt, args...) \
> -  if (GETBIT (LOGGING_MODULES, module) == 1) {                       \
> -    fprintf (stdout, fmt,##args);                                    \
> -  }
> -
> -#define vtpmlogerror(module, fmt, args...) \
> -  fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
> -
> -//typedef UINT32 tpm_size_t;
> -
> -// helper function for the error codes:
> -const char* tpm_get_error_name (TPM_RESULT code);
> -
> -#endif // _VTPM_LOG_H_
> diff --git a/tools/vtpm_manager/util/tcg.h b/tools/vtpm_manager/util/tcg.h
> deleted file mode 100644
> index 5c42913..0000000
> --- a/tools/vtpm_manager/util/tcg.h
> +++ /dev/null
> @@ -1,503 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tcg.h
> -//
> -//  This file contains all the structure and type definitions
> -//
> -// ==================================================================
> -
> -#ifndef __TCG_H__
> -#define __TCG_H__
> -
> -// This pragma is used to disallow structure padding
> -#pragma pack(push, 1)
> -
> -// *************************** TYPEDEFS *********************************
> -typedef unsigned char BYTE;
> -typedef unsigned char BOOL;
> -typedef unsigned short UINT16;
> -typedef unsigned int UINT32;
> -typedef unsigned long long UINT64;
> -
> -typedef UINT32 TPM_RESULT;
> -typedef UINT32 TPM_PCRINDEX;
> -typedef UINT32 TPM_DIRINDEX;
> -typedef UINT32 TPM_HANDLE;
> -typedef TPM_HANDLE TPM_AUTHHANDLE;
> -typedef TPM_HANDLE TCPA_HASHHANDLE;
> -typedef TPM_HANDLE TCPA_HMACHANDLE;
> -typedef TPM_HANDLE TCPA_ENCHANDLE;
> -typedef TPM_HANDLE TPM_KEY_HANDLE;
> -typedef TPM_HANDLE TCPA_ENTITYHANDLE;
> -typedef UINT32 TPM_RESOURCE_TYPE;
> -typedef UINT32 TPM_COMMAND_CODE;
> -typedef UINT16 TPM_PROTOCOL_ID;
> -typedef BYTE TPM_AUTH_DATA_USAGE;
> -typedef UINT16 TPM_ENTITY_TYPE;
> -typedef UINT32 TPM_ALGORITHM_ID;
> -typedef UINT16 TPM_KEY_USAGE;
> -typedef UINT16 TPM_STARTUP_TYPE;
> -typedef UINT32 TPM_CAPABILITY_AREA;
> -typedef UINT16 TPM_ENC_SCHEME;
> -typedef UINT16 TPM_SIG_SCHEME;
> -typedef UINT16 TPM_MIGRATE_SCHEME;
> -typedef UINT16 TPM_PHYSICAL_PRESENCE;
> -typedef UINT32 TPM_KEY_FLAGS;
> -
> -#define TPM_DIGEST_SIZE 20  // Don't change this
> -typedef BYTE TPM_AUTHDATA[TPM_DIGEST_SIZE];
> -typedef TPM_AUTHDATA TPM_SECRET;
> -typedef TPM_AUTHDATA TPM_ENCAUTH;
> -typedef BYTE TPM_PAYLOAD_TYPE;
> -typedef UINT16 TPM_TAG;
> -
> -// Data Types of the TCS
> -typedef UINT32 TCS_AUTHHANDLE;  // Handle addressing a authorization session
> -typedef UINT32 TCS_CONTEXT_HANDLE; // Basic context handle
> -typedef UINT32 TCS_KEY_HANDLE;  // Basic key handle
> -
> -// ************************* STRUCTURES **********************************
> -
> -typedef struct TPM_VERSION {
> -  BYTE major;
> -  BYTE minor;
> -  BYTE revMajor;
> -  BYTE revMinor;
> -} TPM_VERSION;
> -
> -static const TPM_VERSION TPM_STRUCT_VER_1_1 = { 1,1,0,0 };
> -
> -typedef struct TPM_DIGEST {
> -  BYTE digest[TPM_DIGEST_SIZE];
> -} TPM_DIGEST;
> -
> -typedef TPM_DIGEST TPM_PCRVALUE;
> -typedef TPM_DIGEST TPM_COMPOSITE_HASH;
> -typedef TPM_DIGEST TPM_DIRVALUE;
> -typedef TPM_DIGEST TPM_HMAC;
> -typedef TPM_DIGEST TPM_CHOSENID_HASH;
> -
> -typedef struct TPM_NONCE {
> -  BYTE nonce[TPM_DIGEST_SIZE];
> -} TPM_NONCE;
> -
> -typedef struct TPM_KEY_PARMS {
> -  TPM_ALGORITHM_ID algorithmID;
> -  TPM_ENC_SCHEME encScheme;
> -  TPM_SIG_SCHEME sigScheme;
> -  UINT32 parmSize;
> -  BYTE* parms;
> -} TPM_KEY_PARMS;
> -
> -typedef struct TPM_RSA_KEY_PARMS {
> -  UINT32 keyLength;
> -  UINT32 numPrimes;
> -  UINT32 exponentSize;
> -  BYTE* exponent;
> -} TPM_RSA_KEY_PARMS;
> -
> -typedef struct TPM_STORE_PUBKEY {
> -  UINT32 keyLength;
> -  BYTE* key;
> -} TPM_STORE_PUBKEY;
> -
> -typedef struct TPM_PUBKEY {
> -  TPM_KEY_PARMS algorithmParms;
> -  TPM_STORE_PUBKEY pubKey;
> -} TPM_PUBKEY;
> -
> -typedef struct TPM_KEY {
> -  TPM_VERSION         ver;
> -  TPM_KEY_USAGE       keyUsage;
> -  TPM_KEY_FLAGS       keyFlags;
> -  TPM_AUTH_DATA_USAGE authDataUsage;
> -  TPM_KEY_PARMS       algorithmParms;
> -  UINT32              PCRInfoSize;
> -  BYTE*               PCRInfo; // this should be a TPM_PCR_INFO, or NULL
> -  TPM_STORE_PUBKEY    pubKey;
> -  UINT32              encDataSize;
> -  BYTE*               encData;
> -} TPM_KEY;
> -
> -typedef struct TPM_PCR_SELECTION {
> -  UINT16 sizeOfSelect;        /// in bytes
> -  BYTE* pcrSelect;
> -} TPM_PCR_SELECTION;
> -
> -typedef struct TPM_PCR_COMPOSITE {
> -  TPM_PCR_SELECTION select;
> -  UINT32 valueSize;
> -  TPM_PCRVALUE* pcrValue;
> -} TPM_PCR_COMPOSITE;
> -
> -
> -typedef struct TPM_PCR_INFO {
> -  TPM_PCR_SELECTION pcrSelection;
> -  TPM_COMPOSITE_HASH digestAtRelease;
> -  TPM_COMPOSITE_HASH digestAtCreation;
> -} TPM_PCR_INFO;
> -
> -
> -typedef struct TPM_BOUND_DATA {
> -  TPM_VERSION ver;
> -  TPM_PAYLOAD_TYPE payload;
> -  BYTE* payloadData;
> -} TPM_BOUND_DATA;
> -
> -typedef struct TPM_STORED_DATA {
> -  TPM_VERSION ver;
> -  UINT32 sealInfoSize;
> -  BYTE* sealInfo;
> -  UINT32 encDataSize;
> -  BYTE* encData;
> -} TPM_STORED_DATA;
> -
> -typedef struct TCS_AUTH {
> -  TCS_AUTHHANDLE  AuthHandle;
> -  TPM_NONCE   NonceOdd;   // system
> -  TPM_NONCE   NonceEven;   // TPM
> -  BOOL   fContinueAuthSession;
> -  TPM_AUTHDATA  HMAC;
> -} TCS_AUTH;
> -
> -// structures for dealing with sizes followed by buffers in all the
> -// TCG structure.
> -typedef struct pack_buf_t {
> -  UINT32 size;
> -  BYTE * data;
> -} pack_buf_t;
> -
> -typedef struct pack_constbuf_t {
> -  UINT32 size;
> -  const BYTE* data;
> -} pack_constbuf_t;
> -
> -
> -
> -// **************************** CONSTANTS *********************************
> -
> -// BOOL values
> -#define TRUE 0x01
> -#define FALSE 0x00
> -
> -#define TCPA_MAX_BUFFER_LENGTH 0x2000
> -
> -//
> -// TPM_COMMAND_CODE values
> -#define TPM_PROTECTED_ORDINAL 0x00000000UL
> -#define TPM_UNPROTECTED_ORDINAL 0x80000000UL
> -#define TPM_CONNECTION_ORDINAL 0x40000000UL
> -#define TPM_VENDOR_ORDINAL 0x20000000UL
> -
> -#define TPM_ORD_OIAP                     (10UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_OSAP                     (11UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ChangeAuth               (12UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_TakeOwnership            (13UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ChangeAuthAsymStart      (14UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ChangeAuthAsymFinish     (15UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ChangeAuthOwner          (16UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Extend                   (20UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_PcrRead                  (21UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Quote                    (22UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Seal                     (23UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Unseal                   (24UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DirWriteAuth             (25UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DirRead                  (26UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_UnBind                   (30UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CreateWrapKey            (31UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadKey                  (32UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetPubKey                (33UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_EvictKey                 (34UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CreateMigrationBlob      (40UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ReWrapKey                (41UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ConvertMigrationBlob     (42UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_AuthorizeMigrationKey    (43UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CreateMaintenanceArchive (44UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadMaintenanceArchive   (45UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_KillMaintenanceFeature   (46UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadManuMaintPub         (47UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ReadManuMaintPub         (48UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CertifyKey               (50UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Sign                     (60UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetRandom                (70UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_StirRandom               (71UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SelfTestFull             (80UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SelfTestStartup          (81UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CertifySelfTest          (82UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ContinueSelfTest         (83UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetTestResult            (84UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Reset                    (90UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_OwnerClear               (91UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DisableOwnerClear        (92UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ForceClear               (93UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DisableForceClear        (94UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetCapabilitySigned      (100UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetCapability            (101UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetCapabilityOwner       (102UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_OwnerSetDisable          (110UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_PhysicalEnable           (111UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_PhysicalDisable          (112UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SetOwnerInstall          (113UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_PhysicalSetDeactivated   (114UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SetTempDeactivated       (115UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CreateEndorsementKeyPair (120UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_MakeIdentity             (121UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ActivateIdentity         (122UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ReadPubek                (124UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_OwnerReadPubek           (125UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DisablePubekRead         (126UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetAuditEvent            (130UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetAuditEventSigned      (131UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetOrdinalAuditStatus    (140UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SetOrdinalAuditStatus    (141UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Terminate_Handle         (150UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Init                     (151UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SaveState                (152UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Startup                  (153UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SetRedirection           (154UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SHA1Start                (160UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SHA1Update               (161UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SHA1Complete             (162UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SHA1CompleteExtend       (163UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_FieldUpgrade             (170UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SaveKeyContext           (180UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadKeyContext           (181UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SaveAuthContext          (182UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadAuthContext          (183UL + TPM_PROTECTED_ORDINAL)
> -#define TSC_ORD_PhysicalPresence         (10UL + TPM_CONNECTION_ORDINAL)
> -
> -
> -
> -//
> -// TPM_RESULT values
> -//
> -// just put in the whole table from spec 1.2
> -
> -#define TPM_BASE   0x0 // The start of TPM return codes
> -#define TPM_VENDOR_ERROR 0x00000400 // Mask to indicate that the error code is vendor specific for vendor specific commands
> -#define TPM_NON_FATAL  0x00000800 // Mask to indicate that the error code is a non-fatal failure.
> -
> -#define TPM_SUCCESS   TPM_BASE // Successful completion of the operation
> -#define TPM_AUTHFAIL      TPM_BASE + 1 // Authentication failed
> -#define TPM_BADINDEX      TPM_BASE + 2 // The index to a PCR, DIR or other register is incorrect
> -#define TPM_BAD_PARAMETER     TPM_BASE + 3 // One or more parameter is bad
> -#define TPM_AUDITFAILURE     TPM_BASE + 4 // An operation completed successfully but the auditing of that operation failed.
> -#define TPM_CLEAR_DISABLED     TPM_BASE + 5 // The clear disable flag is set and all clear operations now require physical access
> -#define TPM_DEACTIVATED     TPM_BASE + 6 // The TPM is deactivated
> -#define TPM_DISABLED      TPM_BASE + 7 // The TPM is disabled
> -#define TPM_DISABLED_CMD     TPM_BASE + 8 // The target command has been disabled
> -#define TPM_FAIL       TPM_BASE + 9 // The operation failed
> -#define TPM_BAD_ORDINAL     TPM_BASE + 10 // The ordinal was unknown or inconsistent
> -#define TPM_INSTALL_DISABLED   TPM_BASE + 11 // The ability to install an owner is disabled
> -#define TPM_INVALID_KEYHANDLE  TPM_BASE + 12 // The key handle presented was invalid
> -#define TPM_KEYNOTFOUND     TPM_BASE + 13 // The target key was not found
> -#define TPM_INAPPROPRIATE_ENC  TPM_BASE + 14 // Unacceptable encryption scheme
> -#define TPM_MIGRATEFAIL     TPM_BASE + 15 // Migration authorization failed
> -#define TPM_INVALID_PCR_INFO   TPM_BASE + 16 // PCR information could not be interpreted
> -#define TPM_NOSPACE      TPM_BASE + 17 // No room to load key.
> -#define TPM_NOSRK       TPM_BASE + 18 // There is no SRK set
> -#define TPM_NOTSEALED_BLOB     TPM_BASE + 19 // An encrypted blob is invalid or was not created by this TPM
> -#define TPM_OWNER_SET      TPM_BASE + 20 // There is already an Owner
> -#define TPM_RESOURCES      TPM_BASE + 21 // The TPM has insufficient internal resources to perform the requested action.
> -#define TPM_SHORTRANDOM     TPM_BASE + 22 // A random string was too short
> -#define TPM_SIZE       TPM_BASE + 23 // The TPM does not have the space to perform the operation.
> -#define TPM_WRONGPCRVAL     TPM_BASE + 24 // The named PCR value does not match the current PCR value.
> -#define TPM_BAD_PARAM_SIZE     TPM_BASE + 25 // The paramSize argument to the command has the incorrect value
> -#define TPM_SHA_THREAD      TPM_BASE + 26 // There is no existing SHA-1 thread.
> -#define TPM_SHA_ERROR      TPM_BASE + 27 // The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error.
> -#define TPM_FAILEDSELFTEST     TPM_BASE + 28 // Self-test has failed and the TPM has shutdown.
> -#define TPM_AUTH2FAIL      TPM_BASE + 29 // The authorization for the second key in a 2 key function failed authorization
> -#define TPM_BADTAG       TPM_BASE + 30 // The tag value sent to for a command is invalid
> -#define TPM_IOERROR      TPM_BASE + 31 // An IO error occurred transmitting information to the TPM
> -#define TPM_ENCRYPT_ERROR     TPM_BASE + 32 // The encryption process had a problem.
> -#define TPM_DECRYPT_ERROR     TPM_BASE + 33 // The decryption process did not complete.
> -#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 // An invalid handle was used.
> -#define TPM_NO_ENDORSEMENT     TPM_BASE + 35 // The TPM does not a EK installed
> -#define TPM_INVALID_KEYUSAGE   TPM_BASE + 36 // The usage of a key is not allowed
> -#define TPM_WRONG_ENTITYTYPE   TPM_BASE + 37 // The submitted entity type is not allowed
> -#define TPM_INVALID_POSTINIT   TPM_BASE + 38 // The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup
> -#define TPM_INAPPROPRIATE_SIG  TPM_BASE + 39 // Signed data cannot include additional DER information
> -#define TPM_BAD_KEY_PROPERTY   TPM_BASE + 40 // The key properties in TPM_KEY_PARMs are not supported by this TPM
> -
> -#define TPM_BAD_MIGRATION      TPM_BASE + 41 // The migration properties of this key are incorrect.
> -#define TPM_BAD_SCHEME       TPM_BASE + 42 // The signature or encryption scheme for this key is incorrect or not permitted in this situation.
> -#define TPM_BAD_DATASIZE      TPM_BASE + 43 // The size of the data (or blob) parameter is bad or inconsistent with the referenced key
> -#define TPM_BAD_MODE       TPM_BASE + 44 // A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob.
> -#define TPM_BAD_PRESENCE      TPM_BASE + 45 // Either the physicalPresence or physicalPresenceLock bits have the wrong value
> -#define TPM_BAD_VERSION      TPM_BASE + 46 // The TPM cannot perform this version of the capability
> -#define TPM_NO_WRAP_TRANSPORT     TPM_BASE + 47 // The TPM does not allow for wrapped transport sessions
> -#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 // TPM audit construction failed and the underlying command was returning a failure code also
> -#define TPM_AUDITFAIL_SUCCESSFUL   TPM_BASE + 49 // TPM audit construction failed and the underlying command was returning success
> -#define TPM_NOTRESETABLE      TPM_BASE + 50 // Attempt to reset a PCR register that does not have the resettable attribute
> -#define TPM_NOTLOCAL       TPM_BASE + 51 // Attempt to reset a PCR register that requires locality and locality modifier not part of command transport
> -#define TPM_BAD_TYPE       TPM_BASE + 52 // Make identity blob not properly typed
> -#define TPM_INVALID_RESOURCE     TPM_BASE + 53 // When saving context identified resource type does not match actual resource
> -#define TPM_NOTFIPS       TPM_BASE + 54 // The TPM is attempting to execute a command only available when in FIPS mode
> -#define TPM_INVALID_FAMILY      TPM_BASE + 55 // The command is attempting to use an invalid family ID
> -#define TPM_NO_NV_PERMISSION     TPM_BASE + 56 // The permission to manipulate the NV storage is not available
> -#define TPM_REQUIRES_SIGN      TPM_BASE + 57 // The operation requires a signed command
> -#define TPM_KEY_NOTSUPPORTED     TPM_BASE + 58 // Wrong operation to load an NV key
> -#define TPM_AUTH_CONFLICT      TPM_BASE + 59 // NV_LoadKey blob requires both owner and blob authorization
> -#define TPM_AREA_LOCKED      TPM_BASE + 60 // The NV area is locked and not writtable
> -#define TPM_BAD_LOCALITY      TPM_BASE + 61 // The locality is incorrect for the attempted operation
> -#define TPM_READ_ONLY       TPM_BASE + 62 // The NV area is read only and can't be written to
> -#define TPM_PER_NOWRITE      TPM_BASE + 63 // There is no protection on the write to the NV area
> -#define TPM_FAMILYCOUNT      TPM_BASE + 64 // The family count value does not match
> -#define TPM_WRITE_LOCKED      TPM_BASE + 65 // The NV area has already been written to
> -#define TPM_BAD_ATTRIBUTES      TPM_BASE + 66 // The NV area attributes conflict
> -#define TPM_INVALID_STRUCTURE     TPM_BASE + 67 // The structure tag and version are invalid or inconsistent
> -#define TPM_KEY_OWNER_CONTROL     TPM_BASE + 68 // The key is under control of the TPM Owner and can only be evicted by the TPM Owner.
> -#define TPM_BAD_COUNTER      TPM_BASE + 69 // The counter handle is incorrect
> -#define TPM_NOT_FULLWRITE      TPM_BASE + 70 // The write is not a complete write of the area
> -#define TPM_CONTEXT_GAP      TPM_BASE + 71 // The gap between saved context counts is too large
> -#define TPM_MAXNVWRITES      TPM_BASE + 72 // The maximum number of NV writes without an owner has been exceeded
> -#define TPM_NOOPERATOR       TPM_BASE + 73 // No operator authorization value is set
> -#define TPM_RESOURCEMISSING     TPM_BASE + 74 // The resource pointed to by context is not loaded
> -#define TPM_DELEGATE_LOCK      TPM_BASE + 75 // The delegate administration is locked
> -#define TPM_DELEGATE_FAMILY     TPM_BASE + 76 // Attempt to manage a family other then the delegated family
> -#define TPM_DELEGATE_ADMIN      TPM_BASE + 77 // Delegation table management not enabled
> -#define TPM_TRANSPORT_EXCLUSIVE    TPM_BASE + 78 // There was a command executed outside of an exclusive transport session
> -
> -// TPM_STARTUP_TYPE values
> -#define TPM_ST_CLEAR 0x0001
> -#define TPM_ST_STATE 0x0002
> -#define TPM_ST_DEACTIVATED 0x003
> -
> -// TPM_TAG values
> -#define TPM_TAG_RQU_COMMAND 0x00c1
> -#define TPM_TAG_RQU_AUTH1_COMMAND 0x00c2
> -#define TPM_TAG_RQU_AUTH2_COMMAND 0x00c3
> -#define TPM_TAG_RSP_COMMAND 0x00c4
> -#define TPM_TAG_RSP_AUTH1_COMMAND 0x00c5
> -#define TPM_TAG_RSP_AUTH2_COMMAND 0x00c6
> -
> -// TPM_PAYLOAD_TYPE values
> -#define TPM_PT_ASYM 0x01
> -#define TPM_PT_BIND 0x02
> -#define TPM_PT_MIGRATE 0x03
> -#define TPM_PT_MAINT 0x04
> -#define TPM_PT_SEAL 0x05
> -
> -// TPM_ENTITY_TYPE values
> -#define TPM_ET_KEYHANDLE 0x0001
> -#define TPM_ET_OWNER 0x0002
> -#define TPM_ET_DATA 0x0003
> -#define TPM_ET_SRK 0x0004
> -#define TPM_ET_KEY 0x0005
> -
> -/// TPM_ResourceTypes
> -#define TPM_RT_KEY      0x00000001
> -#define TPM_RT_AUTH     0x00000002
> -#define TPM_RT_TRANS    0x00000004
> -#define TPM_RT_CONTEXT  0x00000005
> -
> -// TPM_PROTOCOL_ID values
> -#define TPM_PID_OIAP 0x0001
> -#define TPM_PID_OSAP 0x0002
> -#define TPM_PID_ADIP 0x0003
> -#define TPM_PID_ADCP 0x0004
> -#define TPM_PID_OWNER 0x0005
> -
> -// TPM_ALGORITHM_ID values
> -#define TPM_ALG_RSA 0x00000001
> -#define TPM_ALG_DES 0x00000002
> -#define TPM_ALG_3DES 0X00000003
> -#define TPM_ALG_SHA 0x00000004
> -#define TPM_ALG_HMAC 0x00000005
> -#define TCPA_ALG_AES 0x00000006
> -
> -// TPM_ENC_SCHEME values
> -#define TPM_ES_NONE 0x0001
> -#define TPM_ES_RSAESPKCSv15 0x0002
> -#define TPM_ES_RSAESOAEP_SHA1_MGF1 0x0003
> -
> -// TPM_SIG_SCHEME values
> -#define TPM_SS_NONE 0x0001
> -#define TPM_SS_RSASSAPKCS1v15_SHA1 0x0002
> -#define TPM_SS_RSASSAPKCS1v15_DER 0x0003
> -
> -// TPM_KEY_USAGE values
> -#define TPM_KEY_EK 0x0000
> -#define TPM_KEY_SIGNING 0x0010
> -#define TPM_KEY_STORAGE 0x0011
> -#define TPM_KEY_IDENTITY 0x0012
> -#define TPM_KEY_AUTHCHANGE 0X0013
> -#define TPM_KEY_BIND 0x0014
> -#define TPM_KEY_LEGACY 0x0015
> -
> -// TPM_AUTH_DATA_USAGE values
> -#define TPM_AUTH_NEVER 0x00
> -#define TPM_AUTH_ALWAYS 0x01
> -
> -// Key Handle of owner and srk
> -#define TPM_OWNER_KEYHANDLE 0x40000001
> -#define TPM_SRK_KEYHANDLE 0x40000000
> -
> -// ---------------------- Functions for checking TPM_RESULTs -----------------
> -
> -#include <stdio.h>
> -
> -// FIXME: Review use of these and delete unneeded ones.
> -
> -// these are really badly dependent on local structure:
> -// DEPENDS: local var 'status' of type TPM_RESULT
> -// DEPENDS: label 'abort_egress' which cleans up and returns the status
> -#define ERRORDIE(s) do { status = s; \
> -                         fprintf (stderr, "*** ERRORDIE in %s at %s: %i\n", __func__, __FILE__, __LINE__); \
> -                         goto abort_egress; } \
> -                    while (0)
> -
> -// DEPENDS: local var 'status' of type TPM_RESULT
> -// DEPENDS: label 'abort_egress' which cleans up and returns the status
> -// Try command c. If it fails, set status to s and goto abort.
> -#define TPMTRY(s,c) if (c != TPM_SUCCESS) { \
> -                       status = s; \
> -                       printf("ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
> -                       goto abort_egress; \
> -                    } else {\
> -                       status = c; \
> -                    }
> -
> -// Try command c. If it fails, print error message, set status to actual return code. Goto abort
> -#define TPMTRYRETURN(c) do { status = c; \
> -                             if (status != TPM_SUCCESS) { \
> -                               fprintf(stderr, "ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
> -                               goto abort_egress; \
> -                             } \
> -                        } while(0)
> -
> -
> -#pragma pack(pop)
> -
> -#endif //__TCPA_H__
> diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c
> index 3b89223..0ba1d55 100644
> --- a/tools/xenstore/hashtable.c
> +++ b/tools/xenstore/hashtable.c
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/blktap2/drivers/hashtable.c
> - *  - tools/vtpm_manager/util/hashtable.c
>   */
> 
>  #include "hashtable.h"
> diff --git a/tools/xenstore/hashtable.h b/tools/xenstore/hashtable.h
> index 8e6bb5b..4d68223 100644
> --- a/tools/xenstore/hashtable.h
> +++ b/tools/xenstore/hashtable.h
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/blktap2/drivers/hashtable.h
> - *  - tools/vtpm_manager/util/hashtable.h
>   */
> 
>  #ifndef __HASHTABLE_CWC22_H__
> diff --git a/tools/xenstore/hashtable_private.h b/tools/xenstore/hashtable_private.h
> index cabaffe..a08559d 100644
> --- a/tools/xenstore/hashtable_private.h
> +++ b/tools/xenstore/hashtable_private.h
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/blktap2/drivers/hashtable_private.h
> - *  - tools/vtpm_manager/util/hashtable_private.h
>   */
> 
>  #ifndef __HASHTABLE_PRIVATE_CWC22_H__
> diff --git a/tools/xm-test/configure.ac b/tools/xm-test/configure.ac
> index ad1eb78..c142140 100644
> --- a/tools/xm-test/configure.ac
> +++ b/tools/xm-test/configure.ac
> @@ -143,7 +143,6 @@ AC_CONFIG_FILES([
>      tests/unpause/Makefile
>      tests/vcpu-pin/Makefile
>      tests/vcpu-disable/Makefile
> -    tests/vtpm/Makefile
>      tests/xapi/Makefile
>      tests/enforce_dom0_cpus/Makefile
>      tests/cpupool/Makefile
> diff --git a/tools/xm-test/grouptest/default b/tools/xm-test/grouptest/default
> index f0516b2..e04591b 100644
> --- a/tools/xm-test/grouptest/default
> +++ b/tools/xm-test/grouptest/default
> @@ -27,5 +27,4 @@ sysrq
>  unpause
>  vcpu-disable
>  vcpu-pin
> -vtpm
>  xapi
> diff --git a/tools/xm-test/grouptest/medium b/tools/xm-test/grouptest/medium
> index bafc988..5c3e1b1 100644
> --- a/tools/xm-test/grouptest/medium
> +++ b/tools/xm-test/grouptest/medium
> @@ -22,4 +22,3 @@ sysrq 01_sysrq_basic_neg.test 02_sysrq_sync_pos.test
>  unpause
>  vcpu-disable
>  vcpu-pin
> -vtpm
> diff --git a/tools/xm-test/grouptest/xapi b/tools/xm-test/grouptest/xapi
> index 3b04921..7a08b77 100644
> --- a/tools/xm-test/grouptest/xapi
> +++ b/tools/xm-test/grouptest/xapi
> @@ -1,2 +1 @@
>  xapi
> -vtpm 09_vtpm-xapi.test
> diff --git a/tools/xm-test/lib/XmTestLib/XenDomain.py b/tools/xm-test/lib/XmTestLib/XenDomain.py
> index ae8c550..3ba7433 100644
> --- a/tools/xm-test/lib/XmTestLib/XenDomain.py
> +++ b/tools/xm-test/lib/XmTestLib/XenDomain.py
> @@ -59,7 +59,6 @@ class XenConfig:
>          # These options need to be lists
>          self.defaultOpts["disk"] = []
>          self.defaultOpts["vif"]  = []
> -        self.defaultOpts["vtpm"] = []
> 
>          self.opts = self.defaultOpts
> 
> diff --git a/tools/xm-test/tests/Makefile.am b/tools/xm-test/tests/Makefile.am
> index 8d673ed..455f50c 100644
> --- a/tools/xm-test/tests/Makefile.am
> +++ b/tools/xm-test/tests/Makefile.am
> @@ -25,7 +25,6 @@ SUBDIRS =                     \
>                 unpause         \
>                 vcpu-disable    \
>                 vcpu-pin        \
> -               vtpm            \
>                 enforce_dom0_cpus       \
>                 save restore migrate    \
>                 cpupool
> diff --git a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py b/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
> deleted file mode 100644
> index dfd1227..0000000
> --- a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
> +++ /dev/null
> @@ -1,40 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                verify list
> -
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -
> -try:
> -    domain.start(noConsole=True)
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    vtpm_cleanup(domain.getName())
> -    FAIL("Unable to create domain")
> -
> -
> -domName = domain.getName()
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -status, output = traceCommand("xm vtpm-list %s" % domain.getId())
> -eyecatcher = "/local/domain/0/backend/vtpm"
> -where = output.find(eyecatcher)
> -if status != 0:
> -    FAIL("xm vtpm-list returned bad status, expected 0, status is %i" % status)
> -elif where < 0:
> -    FAIL("Fail to list virtual TPM device")
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py b/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
> deleted file mode 100644
> index a18cbab..0000000
> --- a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
> +++ /dev/null
> @@ -1,49 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                check list of pcrs
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -domain.closeConsole()
> -
> -domain.stop()
> -
> -if not re.search("PCR-00:",run["output"]):
> -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> diff --git a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py b/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
> deleted file mode 100644
> index b863f27..0000000
> --- a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
> +++ /dev/null
> @@ -1,99 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                check list of pcrs; suspend and resume the domain and
> -#                check list of pcrs again
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm save %s %s.save" %
> -                                      (domName, domName),
> -                                      timeout=30)
> -
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm save did not succeed")
> -
> -    try:
> -        status, ouptut = traceCommand("xm restore %s.save" %
> -                                      (domName),
> -                                      timeout=30)
> -    except TimeoutError, e:
> -        os.remove("%s.save" % domName)
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    os.remove("%s.save" % domName)
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm restore did not succeed")
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL(str(e))
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> -
> diff --git a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py b/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
> deleted file mode 100644
> index ccc8b73..0000000
> --- a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
> +++ /dev/null
> @@ -1,93 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                check list of pcrs; locally migrate the domain and
> -#                check list of pcrs again
> -#                This test does local live migration.
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -old_domid = domid(domName)
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm migrate -l %s localhost" %
> -                                      domName,
> -                                      timeout=90)
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm migrate did not succeed. External device migration activated?")
> -
> -
> -    domName = domain.getName()
> -    new_domid = domid(domName)
> -
> -    if (old_domid == new_domid):
> -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> -             (old_domid,loop))
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL("No result from dumping the PCRs")
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py b/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py
> deleted file mode 100644
> index 57b87df..0000000
> --- a/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py
> +++ /dev/null
> @@ -1,93 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                check list of pcrs; locally migrate the domain and
> -#                check list of pcrs again
> -#                This test does local (non-live) migration.
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -old_domid = domid(domName)
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm migrate %s localhost" %
> -                                      domName,
> -                                      timeout=90)
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm migrate did not succeed. External device migration activated?")
> -
> -
> -    domName = domain.getName()
> -    new_domid = domid(domName)
> -
> -    if (old_domid == new_domid):
> -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> -             (old_domid,loop))
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL("No result from dumping the PCRs")
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py b/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
> deleted file mode 100644
> index c70691d..0000000
> --- a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
> +++ /dev/null
> @@ -1,125 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                extend a pcr
> -#                check list of pcrs; suspend and resume the domain and
> -#                check list of pcrs again and validate extended pcr
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("mknod /dev/tpm0 c 10 224")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while creating /dev/tpm0")
> -
> -try:
> -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while extending PCR 0")
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm save %s %s.save" %
> -                                      (domName, domName),
> -                                      timeout=30)
> -
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm save did not succeed")
> -
> -    try:
> -        status, ouptut = traceCommand("xm restore %s.save" %
> -                                      (domName),
> -                                      timeout=30)
> -    except TimeoutError, e:
> -        os.remove("%s.save" % domName)
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    os.remove("%s.save" % domName)
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm restore did not succeed")
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL(str(e))
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> -
> diff --git a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py b/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
> deleted file mode 100644
> index 4ff3360..0000000
> --- a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
> +++ /dev/null
> @@ -1,119 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                extend a pcr
> -#                check list of pcrs; locally migrate the domain and
> -#                check list of pcrs again and validate extended pcr
> -#                This test does local live migration.
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("mknod /dev/tpm0 c 10 224")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while creating /dev/tpm0")
> -
> -try:
> -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while extending PCR 0")
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -old_domid = domid(domName)
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm migrate -l %s localhost" %
> -                                      domName,
> -                                      timeout=90)
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm migrate did not succeed. External device migration activated?")
> -
> -
> -    domName = domain.getName()
> -    new_domid = domid(domName)
> -
> -    if (old_domid == new_domid):
> -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> -             (old_domid,loop))
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL("No result from dumping the PCRs")
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py b/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
> deleted file mode 100644
> index 27125fc..0000000
> --- a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
> +++ /dev/null
> @@ -1,119 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                extend a pcr
> -#                check list of pcrs; locally migrate the domain and
> -#                check list of pcrs again and validate extended pcr
> -#                This test does local (non-live) migration.
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("mknod /dev/tpm0 c 10 224")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while creating /dev/tpm0")
> -
> -try:
> -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while extending PCR 0")
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -old_domid = domid(domName)
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm migrate %s localhost" %
> -                                      domName,
> -                                      timeout=90)
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm migrate did not succeed. External device migration activated?")
> -
> -
> -    domName = domain.getName()
> -    new_domid = domid(domName)
> -
> -    if (old_domid == new_domid):
> -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> -             (old_domid,loop))
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL("No result from dumping the PCRs")
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py b/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
> deleted file mode 100644
> index a1aa8b3..0000000
> --- a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
> +++ /dev/null
> @@ -1,158 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Test to test the vtpm class through the Xen-API
> -#
> -# Tested methods:
> -#  VTPM: get_uuid, get_backend, get_by_uuid, get_record
> -#        create, destroy, get_VM
> -#  VM: get_VTPMS
> -
> -from XmTestLib import xapi
> -from XmTestLib.XenAPIDomain import XmTestAPIDomain
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -
> -VTPM_RECORD_KEYS = [ 'backend', 'VM', 'uuid', 'other_config' ]
> -
> -try:
> -    # XmTestAPIDomain tries to establish a connection to XenD
> -    domain = XmTestAPIDomain()
> -except Exception, e:
> -    SKIP("Skipping test. Error: %s" % str(e))
> -vm_uuid = domain.get_uuid()
> -
> -vtpmcfg = {}
> -vtpmcfg['backend'] = DOM0_UUID
> -vtpmcfg['VM'] = vm_uuid
> -
> -session = xapi.connect()
> -
> -vtpm_uuid = session.xenapi.VTPM.create(vtpmcfg)
> -
> -vtpm_be = session.xenapi.VTPM.get_backend(vtpm_uuid)
> -if vtpm_be != vtpmcfg['backend']:
> -    FAIL("vTPM's backend is in '%s', expected: '%s'" %
> -         (vtpm_be, vtpmcfg['backend']))
> -
> -vtpm_rec = session.xenapi.VTPM.get_record(vtpm_uuid)
> -
> -miss_keys = []
> -for k in VTPM_RECORD_KEYS:
> -    if k not in vtpm_rec.keys():
> -        miss_keys.append(k)
> -if len(miss_keys) > 0:
> -    FAIL("vTPM record is missing key(s): %s" % miss_keys)
> -
> -if vtpm_rec['uuid']  != vtpm_uuid:
> -    FAIL("vTPM record shows vtpm uuid '%s', expected: '%s'" %
> -         (vtpm_rec['uuid'], vtpm_uuid))
> -if vtpm_rec['VM']  != vm_uuid:
> -    FAIL("vTPM record shows VM uuid '%s', expected: '%s'" %
> -         (vtpm_rec['VM'], vm_uuid))
> -if vtpm_rec['backend'] != vtpmcfg['backend']:
> -    FAIL("vTPM record shows VM bakcned '%s', expected: '%s'" %
> -         (vtpm_rev['backend'], vtpmcfg['backend']))
> -
> -badkeys = []
> -keys = vtpm_rec.keys()
> -for k in keys:
> -    if k not in VTPM_RECORD_KEYS:
> -        badkeys.append(k)
> -if len(badkeys) > 0:
> -    FAIL("Unexpected attributes in result: %s" % badkeys)
> -
> -if vm_uuid != session.xenapi.VTPM.get_VM(vtpm_uuid):
> -    FAIL("VM uuid from VTPM.get_VM different (%s) than expected (%s)." %
> -         (vm_ref, vm_uuid))
> -
> -uuid = session.xenapi.VTPM.get_uuid(vtpm_uuid)
> -if uuid != vtpm_uuid:
> -    FAIL("vTPM from VTPM.get_uuid different (%s) than expected (%s)." %
> -         (uuid, vtpm_uuid))
> -
> -vtpm_ref = session.xenapi.VTPM.get_by_uuid(vtpm_uuid)
> -if vtpm_ref != vtpm_uuid:
> -    FAIL("vTPM from VTPM.get_by_uuid different (%s) than expected (%s)." %
> -         (vtpm_ref, vtpm_uuid))
> -
> -vm_vtpms = session.xenapi.VM.get_VTPMs(vm_uuid)
> -if len(vm_vtpms) != 1:
> -    FAIL("Number of vTPMs from get_VTPMs is (%d) not what was expected (%d)" %
> -         (len(vm_vtpms), 1))
> -if vtpm_uuid not in vm_vtpms:
> -    FAIL("Other vTPM uuid (%s) returned from VM.get_VTPMs than expected (%s)" %
> -         (vm_vtpms[0], vtpm_uuid))
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    FAIL("Unable to create domain.")
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("1. No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("1. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -try:
> -    session.xenapi.VTPM.destroy(vtpm_uuid)
> -    #Should never get here
> -    FAIL("Could destroy vTPM while VM is running")
> -except:
> -    pass
> -
> -rc = session.xenapi.VM.suspend(vm_uuid)
> -if rc:
> -    FAIL("Could not suspend VM")
> -
> -try:
> -    session.xenapi.VTPM.destroy(vtpm_uuid)
> -    #May not throw an exception in 'suspend' state
> -except:
> -    pass
> -
> -rc = session.xenapi.VM.resume(vm_uuid, False)
> -if rc:
> -    FAIL("Could not resume VM")
> -
> -try:
> -    console = domain.getConsole()
> -except ConsoleError, e:
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("2. No result from dumping the PCRs. vTPM has been removed?")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("2. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -domain.stop()
> -
> -try:
> -    session.xenapi.VTPM.destroy(vtpm_uuid)
> -except:
> -    FAIL("Could NOT destroy vTPM while domain is halted.")
> -
> -domain.destroy()
> diff --git a/tools/xm-test/tests/vtpm/Makefile.am b/tools/xm-test/tests/vtpm/Makefile.am
> deleted file mode 100644
> index dd67e45..0000000
> --- a/tools/xm-test/tests/vtpm/Makefile.am
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -SUBDIRS =
> -
> -TESTS = 01_vtpm-list_pos.test \
> -        02_vtpm-cat_pcrs.test \
> -        03_vtpm-susp_res.test \
> -        04_vtpm-loc_migr.test \
> -        05_vtpm-loc_migr.test \
> -        06_vtpm-susp_res_pcrs.test \
> -        07_vtpm-mig_pcrs.test \
> -        08_vtpm-mig_pcrs.test \
> -        09_vtpm-xapi.test
> -
> -XFAIL_TESTS =
> -
> -EXTRA_DIST = $(TESTS) $(XFAIL_TESTS) vtpm_utils.py
> -TESTS_ENVIRONMENT=@TENV@
> -
> -%.test: %.py
> -       cp $< $@
> -       chmod +x $@
> -
> -clean-local: am_config_clean-local
> -
> -am_config_clean-local:
> -       rm -f *test
> -       rm -f *log
> -       rm -f *~
> diff --git a/tools/xm-test/tests/vtpm/vtpm_utils.py b/tools/xm-test/tests/vtpm/vtpm_utils.py
> deleted file mode 100644
> index 4e5b281..0000000
> --- a/tools/xm-test/tests/vtpm/vtpm_utils.py
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -from XmTestLib import *
> -
> -if ENABLE_HVM_SUPPORT:
> -    SKIP("vtpm tests not supported for HVM domains")
> -
> -status, output = traceCommand("COLUMNS=200 ; "
> -                              "ps aux | grep vtpm_manager | grep -v grep")
> -if output == "":
> -    SKIP("virtual TPM manager must be started to run this test; might "
> -         "need /dev/tpm0")
> -
> -def vtpm_cleanup(domName):
> -    traceCommand("/etc/xen/scripts/vtpm-delete "
> -                 "`xenstore-read /local/domain/0/backend/vtpm/%s/0/uuid`" %
> -                 str(domid(domName)))
> -
> -def vtpm_cleanup(uuid):
> -    from xen.xm import main
> -    if main.serverType != main.SERVER_XEN_API:
> -        traceCommand("/etc/xen/scripts/vtpm-delete %s" % uuid)
> -
> -def vtpm_get_uuid(domainid):
> -    s, o = traceCommand("xenstore-read "
> -                        "/local/domain/0/backend/vtpm/%s/0/uuid" % domainid)
> -    return o
> --
> 1.7.10.4
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:06:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:06:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYFG3-0008I1-Fo; Tue, 13 Nov 2012 12:06:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYE3b-0004PX-Fw
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 10:49:28 +0000
Received: from [85.158.138.51:7043] by server-15.bemta-3.messagelabs.com id
	64/AD-09445-6B522A05; Tue, 13 Nov 2012 10:49:26 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1352803762!27912505!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=Mail larger than max spam size
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22352 invoked from network); 13 Nov 2012 10:49:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 10:49:23 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15773595"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 10:49:17 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:49:16 +0000
Message-ID: <1352803755.7491.47.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Tue, 13 Nov 2012 10:49:15 +0000
In-Reply-To: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
X-Mailman-Approved-At: Tue, 13 Nov 2012 12:06:22 +0000
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-01 at 20:35 +0000, Matthew Fioravante wrote:
> Remove the old vtpm process model. It doesn't work very
> well and is no longer supported.
> 
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> 
> diff --git a/tools/Makefile b/tools/Makefile
> index d8c8cc0..2ca43b9 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -18,8 +18,6 @@ SUBDIRS-$(CONFIG_XCUTILS) += xcutils
>  SUBDIRS-$(CONFIG_X86) += firmware
>  SUBDIRS-y += console
>  SUBDIRS-y += xenmon
> -SUBDIRS-$(VTPM_TOOLS) += vtpm_manager
> -SUBDIRS-$(VTPM_TOOLS) += vtpm
>  SUBDIRS-y += xenstat
>  SUBDIRS-$(CONFIG_Linux) += $(SUBDIRS-libaio)
>  SUBDIRS-$(CONFIG_Linux) += memshr
> diff --git a/tools/blktap2/drivers/hashtable.c b/tools/blktap2/drivers/hashtable.c
> index 631306b..90a6b85 100644
> --- a/tools/blktap2/drivers/hashtable.c
> +++ b/tools/blktap2/drivers/hashtable.c
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/xenstore/hashtable.c
> - *  - tools/vtpm_manager/util/hashtable.c
>   */
> 
>  #include "hashtable.h"
> diff --git a/tools/blktap2/drivers/hashtable.h b/tools/blktap2/drivers/hashtable.h
> index 89aa3dc..56ca053 100644
> --- a/tools/blktap2/drivers/hashtable.h
> +++ b/tools/blktap2/drivers/hashtable.h
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/xenstore/hashtable.h
> - *  - tools/vtpm_manager/util/hashtable.h
>   */
> 
>  #ifndef __HASHTABLE_CWC22_H__
> diff --git a/tools/blktap2/drivers/hashtable_itr.c b/tools/blktap2/drivers/hashtable_itr.c
> index 402e06b..731917c 100644
> --- a/tools/blktap2/drivers/hashtable_itr.c
> +++ b/tools/blktap2/drivers/hashtable_itr.c
> @@ -1,10 +1,5 @@
>  /* Copyright (C) 2002, 2004 Christopher Clark  <firstname.lastname@cl.cam.ac.uk> */
> 
> -/*
> - * There are duplicates of this code in:
> - *  - tools/vtpm_manager/util/hashtable_itr.c
> - */
> -
>  #include "hashtable.h"
>  #include "hashtable_private.h"
>  #include "hashtable_itr.h"
> diff --git a/tools/blktap2/drivers/hashtable_itr.h b/tools/blktap2/drivers/hashtable_itr.h
> index 3d80638..81da838 100644
> --- a/tools/blktap2/drivers/hashtable_itr.h
> +++ b/tools/blktap2/drivers/hashtable_itr.h
> @@ -1,10 +1,5 @@
>  /* Copyright (C) 2002, 2004 Christopher Clark <firstname.lastname@cl.cam.ac.uk> */
> 
> -/*
> - * There are duplicates of this code in:
> - *  - tools/vtpm_manager/util/hashtable_itr.h
> - */
> -
>  #ifndef __HASHTABLE_ITR_CWC22__
>  #define __HASHTABLE_ITR_CWC22__
>  #include "hashtable.h"
> diff --git a/tools/blktap2/drivers/hashtable_private.h b/tools/blktap2/drivers/hashtable_private.h
> index 5a13a65..954ecc3 100644
> --- a/tools/blktap2/drivers/hashtable_private.h
> +++ b/tools/blktap2/drivers/hashtable_private.h
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/xenstore/hashtable_private.h
> - *  - tools/vtpm_manager/util/hashtable_private.h
>   */
> 
>  #ifndef __HASHTABLE_PRIVATE_CWC22_H__
> diff --git a/tools/configure.ac b/tools/configure.ac
> index e708f01..586313d 100644
> --- a/tools/configure.ac
> +++ b/tools/configure.ac
> @@ -40,7 +40,6 @@ m4_include([m4/fetcher.m4])
>  # Enable/disable options
>  AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
>  AX_ARG_DEFAULT_ENABLE([monitors], [Disable xenstat and xentop monitoring tools])
> -AX_ARG_DEFAULT_DISABLE([vtpm], [Enable Virtual Trusted Platform Module])
>  AX_ARG_DEFAULT_DISABLE([xenapi], [Enable Xen API Bindings])
>  AX_ARG_DEFAULT_ENABLE([ocamltools], [Disable Ocaml tools])
>  AX_ARG_DEFAULT_DISABLE([miniterm], [Enable miniterm])
> diff --git a/tools/examples/README b/tools/examples/README
> index 5b0314e..2225d5c 100644
> --- a/tools/examples/README
> +++ b/tools/examples/README
> @@ -25,13 +25,7 @@ vif-bridge          - virtual network start/stop script in bridged mode
>  vif-common.sh       - sourced by vif-bridge
>  vif-nat             - xen virtual network start/stop script in NAT mode
>  vif-route           - xen virtual network start/stop script in routed mode
> -vtpm                - called by xen-backend.agent to bind/unbind vTPM devices
> -vtpm-common.sh      - common code for vTPM handling
> -vtpm-delete         - remove an entry from the vTPM table given the
> -                      domain's name
> -vtpm-hotplug-common.sh - sourced by vtpm
> -vtpm-migration.sh   - sourced by external-device-migrate
> -xen-backend.agent   - calls block, vif-*, vtpm scripts to add, remove, hotplug
> +xen-backend.agent   - calls block, vif-* scripts to add, remove, hotplug
>                        devices
>  xen-backend.rules   - hotplug script rules
>  xend-config.sxp     - default xend configuration file
> diff --git a/tools/examples/xmexample.pv-grub b/tools/examples/xmexample.pv-grub
> index 85f847c..e04e6c1 100644
> --- a/tools/examples/xmexample.pv-grub
> +++ b/tools/examples/xmexample.pv-grub
> @@ -105,20 +105,6 @@ disk = [ 'phy:hda1,hda1,w' ]
>  # configured in xend-config.sxp.
> 
>  #----------------------------------------------------------------------------
> -# Define to which TPM instance the user domain should communicate.
> -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> -# where INSTANCE indicates the instance number of the TPM the VM
> -# should be talking to and DOM provides the domain where the backend
> -# is located.
> -# Note that no two virtual machines should try to connect to the same
> -# TPM instance. The handling of all TPM instances does require
> -# some management effort in so far that VM configration files (and thus
> -# a VM) should be associated with a TPM instance throughout the lifetime
> -# of the VM / VM configuration file. The instance number must be
> -# greater or equal to 1.
> -#vtpm = [ 'instance=1,backend=0' ]
> -
> -#----------------------------------------------------------------------------
>  # Configure the behaviour when a domain exits.  There are three 'reasons'
>  # for a domain to stop: poweroff, reboot, and crash.  For each of these you
>  # may specify:
> diff --git a/tools/examples/xmexample1 b/tools/examples/xmexample1
> index 330aaf0..c951200 100644
> --- a/tools/examples/xmexample1
> +++ b/tools/examples/xmexample1
> @@ -101,20 +101,6 @@ disk = [ 'phy:hda1,hda1,w' ]
>  # configured in xend-config.sxp.
> 
>  #----------------------------------------------------------------------------
> -# Define to which TPM instance the user domain should communicate.
> -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> -# where INSTANCE indicates the instance number of the TPM the VM
> -# should be talking to and DOM provides the domain where the backend
> -# is located.
> -# Note that no two virtual machines should try to connect to the same
> -# TPM instance. The handling of all TPM instances does require
> -# some management effort in so far that VM configration files (and thus
> -# a VM) should be associated with a TPM instance throughout the lifetime
> -# of the VM / VM configuration file. The instance number must be
> -# greater or equal to 1.
> -#vtpm = [ 'instance=1,backend=0' ]
> -
> -#----------------------------------------------------------------------------
>  # Set the kernel command line for the new domain.
>  # You only need to define the IP parameters and hostname if the domain's
>  # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
> diff --git a/tools/examples/xmexample2 b/tools/examples/xmexample2
> index 4e5eb3d..8c5137e 100644
> --- a/tools/examples/xmexample2
> +++ b/tools/examples/xmexample2
> @@ -137,20 +137,6 @@ disk = [ 'phy:sda%d,sda1,w' % (7+vmid),
>  # configured in xend-config.sxp.
> 
>  #----------------------------------------------------------------------------
> -# Define to which TPM instance the user domain should communicate.
> -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> -# where INSTANCE indicates the instance number of the TPM the VM
> -# should be talking to and DOM provides the domain where the backend
> -# is located.
> -# Note that no two virtual machines should try to connect to the same
> -# TPM instance. The handling of all TPM instances does require
> -# some management effort in so far that VM configration files (and thus
> -# a VM) should be associated with a TPM instance throughout the lifetime
> -# of the VM / VM configuration file. The instance number must be
> -# greater or equal to 1.
> -#vtpm = ['instance=%d,backend=0' % (vmid) ]
> -
> -#----------------------------------------------------------------------------
>  # Set the kernel command line for the new domain.
>  # You only need to define the IP parameters and hostname if the domain's
>  # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
> diff --git a/tools/examples/xmexample3 b/tools/examples/xmexample3
> index dc22ce1..ae799f9 100644
> --- a/tools/examples/xmexample3
> +++ b/tools/examples/xmexample3
> @@ -122,20 +122,6 @@ disk = [ 'phy:hda%d,hda1,w' % (vmid)]
>  # configured in xend-config.sxp.
> 
>  #----------------------------------------------------------------------------
> -# Define to which TPM instance the user domain should communicate.
> -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> -# where INSTANCE indicates the instance number of the TPM the VM
> -# should be talking to and DOM provides the domain where the backend
> -# is located.
> -# Note that no two virtual machines should try to connect to the same
> -# TPM instance. The handling of all TPM instances does require
> -# some management effort in so far that VM configration files (and thus
> -# a VM) should be associated with a TPM instance throughout the lifetime
> -# of the VM / VM configuration file. The instance number must be
> -# greater or equal to 1.
> -#vtpm = ['instance=%d,backend=0' % (vmid) ]
> -
> -#----------------------------------------------------------------------------
>  # Set the kernel command line for the new domain.
>  # You only need to define the IP parameters and hostname if the domain's
>  # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
> diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
> index 0166790..0605559 100644
> --- a/tools/hotplug/Linux/Makefile
> +++ b/tools/hotplug/Linux/Makefile
> @@ -18,14 +18,12 @@ XEN_SCRIPTS += vif-setup
>  XEN_SCRIPTS += block
>  XEN_SCRIPTS += block-enbd block-nbd
>  XEN_SCRIPTS += blktap
> -XEN_SCRIPTS += vtpm vtpm-delete
>  XEN_SCRIPTS += xen-hotplug-cleanup
>  XEN_SCRIPTS += external-device-migrate
>  XEN_SCRIPTS += vscsi
>  XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
>  XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
> -XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
> -XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
> +XEN_SCRIPT_DATA += block-common.sh
> 
>  UDEV_RULES_DIR = $(CONFIG_DIR)/udev
>  UDEV_RULES = xen-backend.rules xend.rules
> diff --git a/tools/hotplug/Linux/vtpm b/tools/hotplug/Linux/vtpm
> deleted file mode 100644
> index 38a4532..0000000
> --- a/tools/hotplug/Linux/vtpm
> +++ /dev/null
> @@ -1,22 +0,0 @@
> -#!/bin/bash
> -
> -dir=$(dirname "$0")
> -. "$dir/vtpm-hotplug-common.sh"
> -
> -vtpm_fatal_error=0
> -
> -case "$command" in
> -  add)
> -    vtpm_create_instance
> -  ;;
> -  remove)
> -    vtpm_remove_instance
> -  ;;
> -esac
> -
> -if [ $vtpm_fatal_error -eq 0 ]; then
> -       log debug "Successful vTPM operation '$command'."
> -       success
> -else
> -       fatal "Error while executing vTPM operation '$command'."
> -fi
> diff --git a/tools/hotplug/Linux/vtpm-common.sh b/tools/hotplug/Linux/vtpm-common.sh
> deleted file mode 100644
> index d0d7935..0000000
> --- a/tools/hotplug/Linux/vtpm-common.sh
> +++ /dev/null
> @@ -1,448 +0,0 @@
> -#
> -# Copyright (c) 2005 IBM Corporation
> -# Copyright (c) 2005 XenSource Ltd.
> -#
> -# 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
> -#
> -
> -dir=$(dirname "$0")
> -. "$dir/logging.sh"
> -. "$dir/locking.sh"
> -
> -VTPMDB="/var/vtpm/vtpm.db"
> -
> -#In the vtpm-impl file some commands should be defined:
> -#      vtpm_create, vtpm_setup, vtpm_start, etc. (see below)
> -if [ -r "$dir/vtpm-impl.alt" ]; then
> -       . "$dir/vtpm-impl.alt"
> -elif [ -r "$dir/vtpm-impl" ]; then
> -       . "$dir/vtpm-impl"
> -else
> -       function vtpm_create () {
> -               true
> -       }
> -       function vtpm_setup() {
> -               true
> -       }
> -       function vtpm_start() {
> -               true
> -       }
> -       function vtpm_suspend() {
> -               true
> -       }
> -       function vtpm_resume() {
> -               true
> -       }
> -       function vtpm_delete() {
> -               true
> -       }
> -       function vtpm_migrate() {
> -               echo "Error: vTPM migration accross machines not implemented."
> -       }
> -       function vtpm_migrate_local() {
> -               echo "Error: local vTPM migration not supported"
> -       }
> -       function vtpm_migrate_recover() {
> -               true
> -       }
> -fi
> -
> -
> -#Find the instance number for the vtpm given the name of the domain
> -# Parameters
> -# - vmname : the name of the vm
> -# Return value
> -#  Returns '0' if instance number could not be found, otherwise
> -#  it returns the instance number in the variable 'instance'
> -function vtpmdb_find_instance () {
> -       local vmname ret instance
> -       vmname=$1
> -       ret=0
> -
> -       instance=$(cat $VTPMDB |                   \
> -                 awk -vvmname=$vmname             \
> -                 '{                               \
> -                    if ( 1 != index($1,"#")) {    \
> -                      if ( $1 == vmname ) {       \
> -                        print $2;                 \
> -                        exit;                     \
> -                      }                           \
> -                    }                             \
> -                  }')
> -       if [ "$instance" != "" ]; then
> -               ret=$instance
> -       fi
> -       echo "$ret"
> -}
> -
> -
> -# Check whether a particular instance number is still available
> -# returns "0" if it is not available, "1" otherwise.
> -function vtpmdb_is_free_instancenum () {
> -       local instance instances avail i
> -       instance=$1
> -       avail=1
> -       #Allowed instance number range: 1-255
> -       if [ $instance -eq 0 -o $instance -gt 255 ]; then
> -               avail=0
> -       else
> -               instances=$(cat $VTPMDB |                \
> -                          awk                          \
> -                          '{                            \
> -                              if (1 != index($1,"#")) { \
> -                                printf("%s ",$2);       \
> -                              }                         \
> -                           }')
> -               for i in $instances; do
> -                       if [ $i -eq $instance ]; then
> -                               avail=0
> -                               break
> -                       fi
> -               done
> -       fi
> -       echo "$avail"
> -}
> -
> -
> -# Get an available instance number given the database
> -# Returns an unused instance number
> -function vtpmdb_get_free_instancenum () {
> -       local ctr instances don found
> -       instances=$(cat $VTPMDB |                \
> -                  awk                          \
> -                  '{                            \
> -                      if (1 != index($1,"#")) { \
> -                        printf("%s ",$2);       \
> -                      }                         \
> -                   }')
> -       ctr=1
> -       don=0
> -       while [ $don -eq 0 ]; do
> -               found=0
> -               for i in $instances; do
> -                       if [ $i -eq $ctr ]; then
> -                               found=1;
> -                               break;
> -                       fi
> -               done
> -
> -               if [ $found -eq 0 ]; then
> -                       don=1
> -                       break
> -               fi
> -               let ctr=ctr+1
> -       done
> -       echo "$ctr"
> -}
> -
> -
> -# Add a domain name and instance number to the DB file
> -function vtpmdb_add_instance () {
> -       local res vmname inst
> -       vmname=$1
> -       inst=$2
> -
> -       if [ ! -f $VTPMDB ]; then
> -               echo "#Database for VM to vTPM association" > $VTPMDB
> -               echo "#1st column: domain name" >> $VTPMDB
> -               echo "#2nd column: TPM instance number" >> $VTPMDB
> -       fi
> -       res=$(vtpmdb_validate_entry $vmname $inst)
> -       if [ $res -eq 0 ]; then
> -               echo "$vmname $inst" >> $VTPMDB
> -       fi
> -}
> -
> -
> -#Validate whether an entry is the same as passed to this
> -#function
> -function vtpmdb_validate_entry () {
> -       local res rc vmname inst
> -       rc=0
> -       vmname=$1
> -       inst=$2
> -
> -       res=$(cat $VTPMDB |            \
> -            awk -vvmname=$vmname     \
> -                 -vinst=$inst         \
> -            '{                        \
> -                if ( 1 == index($1,"#")) {\
> -                } else                \
> -                if ( $1 == vmname &&  \
> -                     $2 == inst) {    \
> -                   printf("1");       \
> -                   exit;              \
> -                } else                \
> -                if ( $1 == vmname ||  \
> -                     $2 == inst) {    \
> -                   printf("2");       \
> -                   exit;              \
> -                }                     \
> -            }')
> -
> -       if [ "$res" == "1" ]; then
> -               rc=1
> -       elif [ "$res" == "2" ]; then
> -               rc=2
> -       fi
> -       echo "$rc"
> -}
> -
> -
> -#Remove an entry from the vTPM database given its domain name
> -#and instance number
> -function vtpmdb_remove_entry () {
> -       local vmname instance VTPMDB_TMP
> -       vmname=$1
> -       instance=$2
> -       VTPMDB_TMP="$VTPMDB".tmp
> -
> -       $(cat $VTPMDB |            \
> -        awk -vvmname=$vmname     \
> -        '{                        \
> -           if ( $1 != vmname ) {  \
> -             print $0;            \
> -           }                      \
> -        '} > $VTPMDB_TMP)
> -       if [ -e $VTPMDB_TMP ]; then
> -               mv -f $VTPMDB_TMP $VTPMDB
> -               vtpm_delete $instance
> -       else
> -               log err "Error creating temporary file '$VTPMDB_TMP'."
> -       fi
> -}
> -
> -
> -# Find the reason for the creation of this device:
> -# Returns 'resume' or 'create'
> -function vtpm_get_create_reason () {
> -       local resume
> -       resume=$(xenstore_read $XENBUS_PATH/resume)
> -       if [ "$resume" == "True" ]; then
> -               echo "resume"
> -       else
> -               echo "create"
> -       fi
> -}
> -
> -
> -#Create a vTPM instance
> -# If no entry in the TPM database is found, the instance is
> -# created and an entry added to the database.
> -function vtpm_create_instance () {
> -       local res instance domname reason uuid
> -       uuid=$(xenstore_read "$XENBUS_PATH"/uuid)
> -       reason=$(vtpm_get_create_reason)
> -
> -       claim_lock vtpmdb
> -
> -       instance="0"
> -
> -       if [ "$uuid" != "" ]; then
> -               instance=$(vtpmdb_find_instance $uuid)
> -       fi
> -       if [ "$instance" == "0" ]; then
> -               domname=$(xenstore_read "$XENBUS_PATH"/domain)
> -               instance=$(vtpmdb_find_instance $domname)
> -       fi
> -
> -       if [ "$instance" == "0" -a "$reason" != "create" ]; then
> -               release_lock vtpmdb
> -               return
> -       fi
> -
> -       if [ "$instance" == "0" ]; then
> -               #Try to give the preferred instance to the domain
> -               instance=$(xenstore_read "$XENBUS_PATH"/pref_instance)
> -               if [ "$instance" != "" ]; then
> -                       res=$(vtpmdb_is_free_instancenum $instance)
> -                       if [ $res -eq 0 ]; then
> -                               instance=$(vtpmdb_get_free_instancenum)
> -                       fi
> -               else
> -                       instance=$(vtpmdb_get_free_instancenum)
> -               fi
> -
> -               vtpm_create $instance
> -
> -               if [ $vtpm_fatal_error -eq 0 ]; then
> -                       if [ "$uuid" != "" ]; then
> -                               vtpmdb_add_instance $uuid $instance
> -                       else
> -                               vtpmdb_add_instance $domname $instance
> -                       fi
> -               fi
> -       else
> -               if [ "$reason" == "resume" ]; then
> -                       vtpm_resume $instance
> -               else
> -                       vtpm_start $instance
> -               fi
> -       fi
> -
> -       release_lock vtpmdb
> -
> -       xenstore_write $XENBUS_PATH/instance $instance
> -}
> -
> -
> -#Remove an instance when a VM is terminating or suspending.
> -#Since it is assumed that the VM will appear again, the
> -#entry is kept in the VTPMDB file.
> -function vtpm_remove_instance () {
> -       local instance reason domname uuid
> -       #Stop script execution quietly if path does not exist (anymore)
> -       xenstore-exists "$XENBUS_PATH"/domain
> -       uuid=$(xenstore_read "$XENBUS_PATH"/uuid)
> -
> -       claim_lock vtpmdb
> -
> -       instance="0"
> -
> -       if [ "$uuid" != "" ]; then
> -               instance=$(vtpmdb_find_instance $uuid)
> -       fi
> -
> -       if [ "$instance" == "0" ]; then
> -               domname=$(xenstore_read "$XENBUS_PATH"/domain)
> -               instance=$(vtpmdb_find_instance $domname)
> -       fi
> -
> -       if [ "$instance" != "0" ]; then
> -               vtpm_suspend $instance
> -       fi
> -
> -       release_lock vtpmdb
> -}
> -
> -
> -#Remove an entry in the VTPMDB file given the domain's name
> -#1st parameter: The name of the domain
> -function vtpm_delete_instance () {
> -       local instance
> -
> -       claim_lock vtpmdb
> -
> -       instance=$(vtpmdb_find_instance $1)
> -       if [ "$instance" != "0" ]; then
> -               vtpmdb_remove_entry $1 $instance
> -       fi
> -
> -       release_lock vtpmdb
> -}
> -
> -# Determine whether the given address is local to this machine
> -# Return values:
> -#  "-1" : the given machine name is invalid
> -#  "0"  : this is not an address of this machine
> -#  "1"  : this is an address local to this machine
> -function vtpm_isLocalAddress() {
> -       local addr res
> -       addr=$(ping $1 -c 1 |  \
> -              awk '{ print substr($3,2,length($3)-2); exit }')
> -       if [ "$addr" == "" ]; then
> -               echo "-1"
> -               return
> -       fi
> -       res=$(ifconfig | grep "inet addr" |  \
> -            awk -vaddr=$addr               \
> -            '{                              \
> -               if ( addr == substr($2, 6)) {\
> -                 print "1";                 \
> -               }                            \
> -            }'                              \
> -           )
> -       if [ "$res" == "" ]; then
> -               echo "0"
> -               return
> -       fi
> -       echo "1"
> -}
> -
> -# Perform a migration step. This function differentiates between migration
> -# to the local host or to a remote machine.
> -# Parameters:
> -# 1st: destination host to migrate to
> -# 2nd: name of the domain to migrate
> -# 3rd: the migration step to perform
> -function vtpm_migration_step() {
> -       local res=$(vtpm_isLocalAddress $1)
> -       if [ "$res" == "0" ]; then
> -               vtpm_migrate $1 $2 $3
> -       else
> -               vtpm_migrate_local
> -       fi
> -}
> -
> -# Recover from migration due to an error. This function differentiates
> -# between migration to the local host or to a remote machine.
> -# Parameters:
> -# 1st: destination host the migration was going to
> -# 2nd: name of the domain that was to be migrated
> -# 3rd: the last successful migration step that was done
> -function vtpm_recover() {
> -       local res
> -       res=$(vtpm_isLocalAddress $1)
> -       if [ "$res" == "0" ]; then
> -               vtpm_migrate_recover $1 $2 $3
> -       fi
> -}
> -
> -
> -#Determine the domain id given a domain's name.
> -#1st parameter: name of the domain
> -#return value: domain id  or -1 if domain id could not be determined
> -function vtpm_domid_from_name () {
> -       local id name ids
> -       ids=$(xenstore-list /local/domain)
> -       for id in $ids; do
> -               name=$(xenstore-read /local/domain/$id/name)
> -               if [ "$name" == "$1" ]; then
> -                       echo "$id"
> -                       return
> -               fi
> -       done
> -       echo "-1"
> -}
> -
> -#Determine the virtual TPM's instance number using the domain ID.
> -#1st parm: domain ID
> -function vtpm_uuid_by_domid() {
> -       echo $(xenstore-read /local/domain/0/backend/vtpm/$1/0/uuid)
> -}
> -
> -
> -# Determine the vTPM's UUID by the name of the VM
> -function vtpm_uuid_from_vmname() {
> -       local domid=$(vtpm_domid_from_name $1)
> -       if [ "$domid" != "-1" ]; then
> -               echo $(vtpm_uuid_by_domid $domid)
> -               return
> -       fi
> -       echo ""
> -}
> -
> -#Add a virtual TPM instance number and its associated domain name
> -#to the VTPMDB file and activate usage of this virtual TPM instance
> -#by writing the instance number into the xenstore
> -#1st parm: name of virtual machine
> -#2nd parm: instance of associated virtual TPM
> -function vtpm_add_and_activate() {
> -       local domid=$(vtpm_domid_from_name $1)
> -       local vtpm_uuid=$(vtpm_uuid_from_vmname $1)
> -       if [ "$vtpm_uuid" != "" -a "$domid" != "-1" ]; then
> -               vtpmdb_add_instance $vtpm_uuid $2
> -               xenstore-write backend/vtpm/$domid/0/instance $2
> -       fi
> -}
> diff --git a/tools/hotplug/Linux/vtpm-delete b/tools/hotplug/Linux/vtpm-delete
> deleted file mode 100644
> index b75b95b..0000000
> --- a/tools/hotplug/Linux/vtpm-delete
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -#!/bin/bash
> -
> -# This scripts must be called the following way:
> -# vtpm-delete <vtpm uuid>
> -# or
> -# vtpm-delete --vmname <vm name>
> -
> -dir=$(dirname "$0")
> -. "$dir/vtpm-common.sh"
> -
> -if [ "$1" == "--vmname" ]; then
> -       vtpm_uuid=$(vtpm_uuid_from_vmname $2)
> -       if [ "$vtpm_uuid" != "" ];then
> -               vtpm_delete_instance $vtpm_uuid
> -       fi
> -else
> -       vtpm_delete_instance $1
> -fi
> diff --git a/tools/hotplug/Linux/vtpm-hotplug-common.sh b/tools/hotplug/Linux/vtpm-hotplug-common.sh
> deleted file mode 100644
> index 9fd35e7..0000000
> --- a/tools/hotplug/Linux/vtpm-hotplug-common.sh
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -#
> -# Copyright (c) 2005 IBM Corporation
> -# Copyright (c) 2005 XenSource Ltd.
> -#
> -# 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
> -#
> -
> -dir=$(dirname "$0")
> -. "$dir/xen-hotplug-common.sh"
> -
> -findCommand "$@"
> -if [ "$command" != "online" ]  &&
> -   [ "$command" != "offline" ] &&
> -   [ "$command" != "add" ]     &&
> -   [ "$command" != "remove" ]
> -then
> -       log err "Invalid command: $command"
> -       exit 1
> -fi
> -
> -
> -XENBUS_PATH="${XENBUS_PATH:?}"
> -
> -. "$dir/vtpm-common.sh"
> diff --git a/tools/hotplug/Linux/vtpm-impl b/tools/hotplug/Linux/vtpm-impl
> deleted file mode 100644
> index 4f9a1fd..0000000
> --- a/tools/hotplug/Linux/vtpm-impl
> +++ /dev/null
> @@ -1,208 +0,0 @@
> -#!/bin/bash
> -# ===================================================================
> -#
> -# Copyright (c) 2005, Intel Corp.
> -# All rights reserved.
> -#
> -# Redistribution and use in source and binary forms, with or without
> -# modification, are permitted provided that the following conditions
> -# are met:
> -#
> -#   * Redistributions of source code must retain the above copyright
> -#     notice, this list of conditions and the following disclaimer.
> -#   * Redistributions in binary form must reproduce the above
> -#     copyright notice, this list of conditions and the following
> -#     disclaimer in the documentation and/or other materials provided
> -#     with the distribution.
> -#   * Neither the name of Intel Corporation nor the names of its
> -#     contributors may be used to endorse or promote products derived
> -#     from this software without specific prior written permission.
> -#
> -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -# OF THE POSSIBILITY OF SUCH DAMAGE.
> -# ===================================================================
> -
> -#            |        SRC        |    TAG  |      CMD SIZE     |        ORD       |mtype|strt
> -TPM_CMD_OPEN=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x11\\x01\\x00\\x00\\x01\\x01\\x01
> -TPM_CMD_RESM=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x11\\x01\\x00\\x00\\x01\\x01\\x02
> -TPM_CMD_CLOS=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x0e\\x01\\x00\\x00\\x02
> -TPM_CMD_DELE=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x0e\\x01\\x00\\x00\\x03
> -
> -TPM_TYPE_PVM=\\x01
> -TPM_TYPE_HVM=\\x02
> -
> -TPM_SUCCESS=00000000
> -
> -TX_VTPM_MANAGER=/var/vtpm/fifos/from_console.fifo
> -RX_VTPM_MANAGER=/var/vtpm/fifos/to_console.fifo
> -
> -VTPM_MIG=/usr/bin/vtpm_migrator
> -
> -# -------------------- Helpers for binary streams -----------
> -
> -function str_to_hex32() {
> - printf "%0.8x" $1
> -}
> -
> -function hex32_to_bin() {
> - local inst=$(str_to_hex32 $1);
> -
> - local n1=`echo $inst | sed 's/\(..\)....../\\\\x\1/'`
> - local n2=`echo $inst | sed 's/..\(..\)..../\\\\x\1/'`
> - local n3=`echo $inst | sed 's/....\(..\)../\\\\x\1/'`
> - local n4=`echo $inst | sed 's/......\(..\)/\\\\x\1/'`
> -
> - echo "$n1$n2$n3$n4"
> -}
> -
> -function vtpm_manager_cmd() {
> - local cmd=$1;
> - local inst=$2;
> - local inst_bin=$(hex32_to_bin $inst);
> -
> - claim_lock vtpm_mgr
> -
> - #send cmd to vtpm_manager
> - printf "$cmd$inst_bin" > $TX_VTPM_MANAGER
> -
> - #recv response
> - set +e
> - local resp_hex=`dd skip=10 bs=1 count=4 if=$RX_VTPM_MANAGER 2> /dev/null | xxd -ps`
> - set -e
> -
> - release_lock vtpm_mgr
> -
> - #return whether the command was successful
> - if [ $resp_hex -ne $TPM_SUCCESS ]; then
> -   vtpm_fatal_error=1
> -   false
> -  else
> -   true
> - fi
> -}
> -
> -# Helper to get vm type to pass to vtpm_manager open/resume
> -function vtpm_get_type() {
> - local inst=$(xenstore_read $XENBUS_PATH/frontend-id)
> - local vm=$(xenstore_read /local/domain/$inst/vm)
> - if [ "$vm" != "" ]; then
> -  local ostype=$(xenstore-read $vm/image/ostype)
> -  if [ "$ostype" == "hvm" ]; then
> -   echo $TPM_TYPE_HVM;
> -  else
> -   echo $TPM_TYPE_PVM;
> -  fi
> - fi
> -}
> -
> -# ------------------ Command handlers -----------------
> -
> -# Create new vtpm instance & set it up for use
> -function vtpm_create () {
> - # Creation is handled implicitly by the manager on first setup
> - # so just set it up for use
> - $(vtpm_start $1)
> -}
> -
> -# Setup vtpm instance for use.
> -function vtpm_start() {
> - local vmtype=$(vtpm_get_type);
> - $(vtpm_manager_cmd $TPM_CMD_OPEN$vmtype $1)
> -}
> -
> -function vtpm_resume() {
> - local vmtype=$(vtpm_get_type);
> - $(vtpm_manager_cmd $TPM_CMD_RESM$vmtype $1)
> -}
> -
> -# Reset the vtpm AKA clear PCRs
> -function vtpm_reset() {
> - #not used by current implemenation
> - true
> -}
> -
> -# Shutdown the vtpm while the vm is down
> -# This could be a suspend of shutdown
> -# we cannot distinquish, so save the state
> -# and decide on startup if we should keep is
> -function vtpm_suspend() {
> - $(vtpm_manager_cmd $TPM_CMD_CLOS $1)
> -}
> -
> -
> -function vtpm_delete() {
> - local inst=$1
> - if $(vtpm_manager_cmd $TPM_CMD_DELE $inst); then
> -   rm -f /var/vtpm/vtpm_dm_$1.data
> -   true
> - else
> -   vtpm_fatal_error=1
> -   false
> - fi
> -}
> -
> -# Perform a migration step. This function differentiates between migration
> -# to the local host or to a remote machine.
> -# Parameters:
> -# 1st: destination host to migrate to
> -# 2nd: name of the domain to migrate
> -# 3rd: the migration step to perform
> -function vtpm_migrate() {
> - local instance res
> -
> - instance=$(vtpmdb_find_instance $2)
> - if [ "$instance" == "" ]; then
> -  log err "VTPM Migratoin failed. Unable to translation of domain name"
> -  echo "Error: VTPM Migration failed while looking up instance number"
> - fi
> -
> - case "$3" in
> -  0)
> -   #Incicate migration supported
> -   echo "0"
> -  ;;
> -
> -  1)
> -   # Get Public Key from Destination
> -   # Call vtpm_manager's migration part 1
> -   claim_lock vtpm_mgr
> -   $VTPM_MIG $1 $2 $instance $3
> -   release_lock vtpm_mgr
> -  ;;
> -
> -  2)
> -   # Call manager's migration step 2 and send result to destination
> -   # If successful remove from db
> -   claim_lock vtpm_mgr
> -   $VTPM_MIG $1 $2 $instance $3
> -   release_lock vtpm_mgr
> -  ;;
> -
> -  3)
> -   if `ps x | grep "$VTPM_MIG $1"`; then
> -    log err "VTPM Migration failed to complete."
> -    echo "Error: VTPM Migration failed to complete."
> -   fi
> -  ;;
> - esac
> -
> -}
> -
> -
> -function vtpm_migrate_recover() {
> - echo "Error: Recovery not supported yet"
> -}
> -
> -function vtpm_migrate_local() {
> - echo "Error: local vTPM migration not supported"
> -}
> diff --git a/tools/hotplug/Linux/vtpm-migration.sh b/tools/hotplug/Linux/vtpm-migration.sh
> deleted file mode 100644
> index 7e38ae2..0000000
> --- a/tools/hotplug/Linux/vtpm-migration.sh
> +++ /dev/null
> @@ -1,19 +0,0 @@
> -#
> -# Copyright (c) 2005 IBM Corporation
> -#
> -# 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
> -#
> -
> -dir=$(dirname "$0")
> -. "$dir/vtpm-common.sh"
> diff --git a/tools/hotplug/Linux/xen-backend.rules b/tools/hotplug/Linux/xen-backend.rules
> index c591a3f..a0d409e 100644
> --- a/tools/hotplug/Linux/xen-backend.rules
> +++ b/tools/hotplug/Linux/xen-backend.rules
> @@ -1,6 +1,5 @@
>  SUBSYSTEM=="xen-backend", KERNEL=="tap*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/blktap $env{ACTION}"
>  SUBSYSTEM=="xen-backend", KERNEL=="vbd*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/block $env{ACTION}"
> -SUBSYSTEM=="xen-backend", KERNEL=="vtpm*", RUN+="/etc/xen/scripts/vtpm $env{ACTION}"
>  SUBSYSTEM=="xen-backend", KERNEL=="vif2-*", RUN+="/etc/xen/scripts/vif2 $env{ACTION}"
>  SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="online", RUN+="/etc/xen/scripts/vif-setup online type_if=vif"
>  SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="offline", RUN+="/etc/xen/scripts/vif-setup offline type_if=vif"
> diff --git a/tools/vtpm/Makefile b/tools/vtpm/Makefile
> deleted file mode 100644
> index 7b3efa5..0000000
> --- a/tools/vtpm/Makefile
> +++ /dev/null
> @@ -1,74 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../..
> -
> -# Base definitions and rules
> -include $(XEN_ROOT)/tools/vtpm/Rules.mk
> -
> -# Dir name for emulator (as dom0 tpm driver)
> -TPM_EMULATOR_DIR = tpm_emulator
> -# Dir name for vtpm instance
> -VTPM_DIR = vtpm
> -ORIG_DIR = orig
> -
> -# Emulator tarball name
> -TPM_EMULATOR_NAME = tpm_emulator-0.5.1
> -TPM_EMULATOR_TARFILE = $(TPM_EMULATOR_NAME).tar.gz
> -
> -GMP_HEADER = /usr/include/gmp.h
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: build_sub
> -
> -.PHONY: install
> -install: build
> -       $(MAKE) -C $(VTPM_DIR) install-recursive
> -
> -.PHONY: clean
> -clean:
> -       @if [ -d $(TPM_EMULATOR_DIR) ]; \
> -               then $(MAKE) -C $(TPM_EMULATOR_DIR) clean; \
> -       fi
> -       @if [ -d $(VTPM_DIR) ]; \
> -               then $(MAKE) -C $(VTPM_DIR) clean; \
> -       fi
> -
> -.PHONY: mrproper
> -mrproper:
> -       rm -f $(TPM_EMULATOR_TARFILE) tpm_emulator.patch.old vtpm.patch.old
> -       rm -rf $(TPM_EMULATOR_DIR) $(VTPM_DIR) $(ORIG_DIR)
> -
> -# Download Swiss emulator
> -$(TPM_EMULATOR_TARFILE):
> -       wget http://download.berlios.de/tpm-emulator/$(TPM_EMULATOR_TARFILE)
> -
> -# Create vtpm dirs
> -$(VTPM_DIR)/tpmd/tpmd: $(TPM_EMULATOR_TARFILE) vtpm-0.5.1.patch
> -       rm -rf $(VTPM_DIR)
> -       tar -xzf $(TPM_EMULATOR_TARFILE)
> -       mv $(TPM_EMULATOR_NAME) $(VTPM_DIR)
> -
> -       set -e; cd $(VTPM_DIR); \
> -       patch -p1 < ../vtpm-0.5.1.patch; \
> -       patch -p1 < ../vtpm-0.5.1-LDLIBS.patch
> -
> -orig: $(TPM_EMULATOR_TARFILE)
> -       mkdir $(ORIG_DIR);
> -       set -e; cd $(ORIG_DIR); \
> -       tar -xzf ../$(TPM_EMULATOR_TARFILE);
> -
> -updatepatches: clean orig
> -       find $(VTPM_DIR) -name "*.orig" -print | xargs rm -f;
> -       mv vtpm.patch vtpm.patch.old;
> -       diff -uprN $(TPM_EMULATOR_DIR) $(VTPM_DIR) > vtpm.patch || true;
> -
> -.PHONY: build_sub
> -build_sub: $(VTPM_DIR)/tpmd/tpmd
> -       set -e; if [ -e $(GMP_HEADER) ]; then \
> -               $(MAKE) -C $(VTPM_DIR) version; \
> -               $(MAKE) -C $(VTPM_DIR) all-recursive; \
> -       else \
> -               echo "=== Unable to build VTPMs. libgmp could not be found."; \
> -       fi
> -
> diff --git a/tools/vtpm/README b/tools/vtpm/README
> deleted file mode 100644
> index 2008cbd..0000000
> --- a/tools/vtpm/README
> +++ /dev/null
> @@ -1,45 +0,0 @@
> -
> -Directory Structure
> -===================
> -tools/vtpm/tpm_emulator-0.2b.tar.gz    -> TPM Emulator downloaded at build time that will
> -                                          be patched and used for our vtpms
> -tools/vtpm/vtpm.patch                  -> patch applied to tpm_emulator to make vtpm
> -tools/vtpm/vtpm/                       -> (created on build) tpm_emulator moved to ring 3,
> -                                          listens on a pair of fifos for TPM commands,
> -                                          persistent state is sent via named fifo to vtpm
> -                                            manager, which encrypts it and protects it.
> -tools/vtpm/tpm_emulator.patch          -> To allow for debugging and testing on non-TPM
> -                                          platforms, this patches the emulator to allow
> -                                          it to be inserted into the dom0 kernel
> -tools/vtpm/tpm_emulator-0.2            -> (created on build) directory containing patched emulator
> -
> -Compile Flags
> -===================
> -VTPM_MULTI_VM                -> Defined (not finished): VTPMs run in their own VMs
> -                                Not Defined (default): VTPMs are processes
> -
> -Requirements
> -============
> -- xen-unstable
> -- IBM frontend/backend vtpm driver patch
> -- vtpm_managerd
> -- GNU MP Big number library (GMP)
> -
> -vtpmd Flow (for vtpm_manager. vtpmd never run by default)
> -============================
> -- Launch the VTPM manager (vtpm_managerd) which which begins listening to the BE with one thread
> -  and listens to a named fifo that is shared by the vtpms to commuincate with the manager.
> -- VTPM Manager listens to TPM BE.
> -- When xend launches a tpm frontend equipped VM it contacts the manager over the vtpm backend.
> -- When the manager receives the open message from the BE, it launches a vtpm
> -- Xend allows the VM to continue booting.
> -- When a TPM request is issued to the front end, the front end transmits the TPM request to the backend.
> -- The manager receives the TPM requests and uses a named fifo to forward the request to the vtpm.
> -- The fifo listener begins listening for the reply from vtpm for the request.
> -- Vtpm processes request and replies to manager over shared named fifo.
> -- If needed, the vtpm may send a request to the vtpm_manager at any time to save it's secrets to disk.
> -- Manager receives response from vtpm and passes it back to backend for forwarding to guest.
> -
> -tpm_emulator flow
> -==================
> -Read documentation in tpm_emulator-0.2 directory
> diff --git a/tools/vtpm/Rules.mk b/tools/vtpm/Rules.mk
> deleted file mode 100644
> index 548cff0..0000000
> --- a/tools/vtpm/Rules.mk
> +++ /dev/null
> @@ -1,26 +0,0 @@
> -# Base definitions and rules (XEN_ROOT must be defined in including Makefile)
> -include $(XEN_ROOT)/tools/Rules.mk
> -
> -#
> -# Tool definitions
> -#
> -
> -# General compiler flags
> -CFLAGS   = -Werror -g3
> -
> -# Generic project files
> -HDRS   = $(wildcard *.h)
> -SRCS   = $(wildcard *.c)
> -OBJS   = $(patsubst %.c,%.o,$(SRCS))
> -
> -# Generic (non-header) dependencies
> -$(SRCS): Makefile $(XEN_ROOT)/tools/Rules.mk $(XEN_ROOT)/tools/vtpm/Rules.mk
> -
> -$(OBJS): $(SRCS)
> -
> --include $(DEPS)
> -
> -BUILD_EMULATOR = y
> -
> -# Make sure these are just rules
> -.PHONY : all build install clean
> diff --git a/tools/vtpm/tpm_emulator.patch b/tools/vtpm/tpm_emulator.patch
> deleted file mode 100644
> index c34c665..0000000
> --- a/tools/vtpm/tpm_emulator.patch
> +++ /dev/null
> @@ -1,1919 +0,0 @@
> -diff -uprN orig/tpm_emulator-0.4/AUTHORS tpm_emulator/AUTHORS
> ---- orig/tpm_emulator-0.4/AUTHORS      2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/AUTHORS       2006-07-24 14:35:35.000000000 -0700
> -@@ -1,2 +1,3 @@
> - Mario Strasser <mast@gmx.net>
> - Heiko Stamer <stamer@gaos.org> [DAA]
> -+INTEL Corp <> [Dropped to Ring3]
> -diff -uprN orig/tpm_emulator-0.4/ChangeLog tpm_emulator/ChangeLog
> ---- orig/tpm_emulator-0.4/ChangeLog    2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/ChangeLog     2006-07-24 14:35:35.000000000 -0700
> -@@ -1,3 +1,6 @@
> -+????-??-?? Intel Corp
> -+      * Moved module out of kernel to run as a ring 3 app
> -+
> - 2006-06-23  Mario Strasser <mast@gmx.net>
> -       * tpm_startup.c: behaviour of ST_CLEAR and storage of
> -               persistent data adapted
> -diff -uprN orig/tpm_emulator-0.4/crypto/gmp_kernel_wrapper.c tpm_emulator/crypto/gmp_kernel_wrapper.c
> ---- orig/tpm_emulator-0.4/crypto/gmp_kernel_wrapper.c  2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/crypto/gmp_kernel_wrapper.c   2006-07-24 14:35:35.000000000 -0700
> -@@ -1,5 +1,6 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -24,15 +25,10 @@ int __gmp_junk;
> - void __attribute__ ((regparm(0))) __gmp_assert_fail(const char *filename,
> -   int linenum, const char *expr)
> - {
> --  panic(KERN_CRIT TPM_MODULE_NAME "%s:%d: GNU MP assertion failed: %s\n",
> -+  error("%s:%d: GNU MP assertion failed: %s\n",
> -     filename, linenum, expr);
> - }
> -
> --void __attribute__ ((regparm(0))) abort(void)
> --{
> --  panic(KERN_CRIT TPM_MODULE_NAME "GNU MP abort() was called\n");
> --}
> --
> - /* overwrite GNU MP random functions (used by mpz/millerrabin.c) */
> -
> - void __attribute__ ((regparm(0))) gmp_randinit(gmp_randstate_t rstate,
> -@@ -77,20 +73,19 @@ void __attribute__ ((regparm(0))) mpz_ur
> -
> - void __attribute__ ((regparm(0))) *kernel_allocate(size_t size)
> - {
> --  void *ret  = (void*)kmalloc(size, GFP_KERNEL);
> --  if (!ret) panic(KERN_CRIT TPM_MODULE_NAME
> --    "GMP: cannot allocate memory (size=%u)\n", size);
> -+  void *ret  = (void*)malloc(size);
> -+  if (!ret) error("GMP: cannot allocate memory (size=%Zu)\n", size);
> -   return ret;
> - }
> -
> - void __attribute__ ((regparm(0))) *kernel_reallocate(void *oldptr,
> -   size_t old_size, size_t new_size)
> - {
> --  void *ret = (void*)kmalloc(new_size, GFP_KERNEL);
> --  if (!ret) panic(KERN_CRIT TPM_MODULE_NAME "GMP: Cannot reallocate memory "
> --    "(old_size=%u new_size=%u)\n", old_size, new_size);
> -+  void *ret = (void*)malloc(new_size);
> -+  if (!ret) error("GMP: Cannot reallocate memory "
> -+    "(old_size=%Zu new_size=%Zu)\n", old_size, new_size);
> -   memcpy(ret, oldptr, old_size);
> --  kfree(oldptr);
> -+  free(oldptr);
> -   return ret;
> - }
> -
> -@@ -99,7 +94,7 @@ void __attribute__ ((regparm(0))) kernel
> -   /* overwrite used memory */
> -   if (blk_ptr != NULL) {
> -     memset(blk_ptr, 0, blk_size);
> --    kfree(blk_ptr);
> -+    free(blk_ptr);
> -   }
> - }
> -
> -diff -uprN orig/tpm_emulator-0.4/crypto/rsa.c tpm_emulator/crypto/rsa.c
> ---- orig/tpm_emulator-0.4/crypto/rsa.c 2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/crypto/rsa.c  2006-07-24 14:35:35.000000000 -0700
> -@@ -1,5 +1,6 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -381,7 +382,7 @@ static int encode_message(int type, uint
> -       msg[0] = 0x00;
> -       get_random_bytes(&msg[1], SHA1_DIGEST_LENGTH);
> -       sha1_init(&ctx);
> --      sha1_update(&ctx, "TCPA", 4);
> -+      sha1_update(&ctx, (uint8_t *) "TCPA", 4);
> -       sha1_final(&ctx, &msg[1 + SHA1_DIGEST_LENGTH]);
> -       memset(&msg[1 + 2 * SHA1_DIGEST_LENGTH], 0x00,
> -         msg_len - data_len - 2 * SHA1_DIGEST_LENGTH - 2);
> -@@ -429,7 +430,7 @@ static int decode_message(int type, uint
> -       mask_generation(&msg[1], SHA1_DIGEST_LENGTH,
> -         &msg[1 + SHA1_DIGEST_LENGTH], msg_len - SHA1_DIGEST_LENGTH - 1);
> -       sha1_init(&ctx);
> --      sha1_update(&ctx, "TCPA", 4);
> -+      sha1_update(&ctx, (uint8_t *) "TCPA", 4);
> -       sha1_final(&ctx, &msg[1]);
> -       if (memcmp(&msg[1], &msg[1 + SHA1_DIGEST_LENGTH],
> -           SHA1_DIGEST_LENGTH) != 0) return -1;
> -diff -uprN orig/tpm_emulator-0.4/linux_module.c tpm_emulator/linux_module.c
> ---- orig/tpm_emulator-0.4/linux_module.c       2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/linux_module.c        1969-12-31 16:00:00.000000000 -0800
> -@@ -1,195 +0,0 @@
> --/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -- * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -- *
> -- * This module is free software; you can redistribute it and/or modify
> -- * it under the terms of the GNU General Public License as published
> -- * by the Free Software Foundation; either version 2 of the License,
> -- * or (at your option) any later version.
> -- *
> -- * This module 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.
> -- *
> -- * $Id: linux_module.c 91 2006-03-13 13:51:41Z mast $
> -- */
> --
> --#include <linux/module.h>
> --#include <linux/kernel.h>
> --#include <linux/init.h>
> --#include <linux/miscdevice.h>
> --#include <linux/poll.h>
> --#include "linux_module.h"
> --#include "tpm/tpm_emulator.h"
> --
> --MODULE_LICENSE("GPL");
> --MODULE_AUTHOR("Mario Strasser <mast@gmx.net>");
> --MODULE_DESCRIPTION("Trusted Platform Module (TPM) Emulator");
> --MODULE_SUPPORTED_DEVICE(TPM_DEVICE_NAME);
> --
> --/* module startup parameters */
> --char *startup = "save";
> --module_param(startup, charp, 0444);
> --MODULE_PARM_DESC(startup, " Sets the startup mode of the TPM. "
> --  "Possible values are 'clear', 'save' (default) and 'deactivated.");
> --char *storage_file = "/var/tpm/tpm_emulator-1.2.0.2";
> --module_param(storage_file, charp, 0644);
> --MODULE_PARM_DESC(storage_file, " Sets the persistent-data storage "
> --  "file of the TPM.");
> --
> --/* TPM lock */
> --static struct semaphore tpm_mutex;
> --
> --/* TPM command response */
> --static struct {
> --  uint8_t *data;
> --  uint32_t size;
> --} tpm_response;
> --
> --/* module state */
> --#define STATE_IS_OPEN 0
> --static uint32_t module_state;
> --static struct timespec old_time;
> --
> --static int tpm_open(struct inode *inode, struct file *file)
> --{
> --  debug("%s()", __FUNCTION__);
> --  if (test_and_set_bit(STATE_IS_OPEN, (void*)&module_state)) return -EBUSY;
> --  return 0;
> --}
> --
> --static int tpm_release(struct inode *inode, struct file *file)
> --{
> --  debug("%s()", __FUNCTION__);
> --  clear_bit(STATE_IS_OPEN, (void*)&module_state);
> --  down(&tpm_mutex);
> --  if (tpm_response.data != NULL) {
> --    kfree(tpm_response.data);
> --    tpm_response.data = NULL;
> --  }
> --  up(&tpm_mutex);
> --  return 0;
> --}
> --
> --static ssize_t tpm_read(struct file *file, char *buf, size_t count, loff_t *ppos)
> --{
> --  debug("%s(%d)", __FUNCTION__, count);
> --  down(&tpm_mutex);
> --  if (tpm_response.data != NULL) {
> --    count = min(count, (size_t)tpm_response.size - (size_t)*ppos);
> --    count -= copy_to_user(buf, &tpm_response.data[*ppos], count);
> --    *ppos += count;
> --    if ((size_t)tpm_response.size == (size_t)*ppos) {
> --      kfree(tpm_response.data);
> --      tpm_response.data = NULL;
> --    }
> --  } else {
> --    count = 0;
> --  }
> --  up(&tpm_mutex);
> --  return count;
> --}
> --
> --static ssize_t tpm_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
> --{
> --  debug("%s(%d)", __FUNCTION__, count);
> --  down(&tpm_mutex);
> --  *ppos = 0;
> --  if (tpm_response.data != NULL) kfree(tpm_response.data);
> --  if (tpm_handle_command(buf, count, &tpm_response.data,
> --                         &tpm_response.size) != 0) {
> --    count = -EILSEQ;
> --    tpm_response.data = NULL;
> --  }
> --  up(&tpm_mutex);
> --  return count;
> --}
> --
> --#define TPMIOC_CANCEL   _IO('T', 0x00)
> --#define TPMIOC_TRANSMIT _IO('T', 0x01)
> --
> --static int tpm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
> --{
> --  debug("%s(%d, %p)", __FUNCTION__, cmd, (char*)arg);
> --  if (cmd == TPMIOC_TRANSMIT) {
> --    uint32_t count = ntohl(*(uint32_t*)(arg + 2));
> --    down(&tpm_mutex);
> --    if (tpm_response.data != NULL) kfree(tpm_response.data);
> --    if (tpm_handle_command((char*)arg, count, &tpm_response.data,
> --                           &tpm_response.size) == 0) {
> --      tpm_response.size -= copy_to_user((char*)arg, tpm_response.data,
> --                            tpm_response.size);
> --      kfree(tpm_response.data);
> --      tpm_response.data = NULL;
> --    } else {
> --      tpm_response.size = 0;
> --      tpm_response.data = NULL;
> --    }
> --    up(&tpm_mutex);
> --    return tpm_response.size;
> --  }
> --  return -1;
> --}
> --
> --struct file_operations fops = {
> --  .owner   = THIS_MODULE,
> --  .open    = tpm_open,
> --  .release = tpm_release,
> --  .read    = tpm_read,
> --  .write   = tpm_write,
> --  .ioctl   = tpm_ioctl,
> --};
> --
> --static struct miscdevice tpm_dev = {
> --  .minor      = TPM_DEVICE_MINOR,
> --  .name       = TPM_DEVICE_NAME,
> --  .fops       = &fops,
> --};
> --
> --int __init init_tpm_module(void)
> --{
> --  int res = misc_register(&tpm_dev);
> --  if (res != 0) {
> --    error("misc_register() failed for minor %d\n", TPM_DEVICE_MINOR);
> --    return res;
> --  }
> --  /* initialize variables */
> --  sema_init(&tpm_mutex, 1);
> --  module_state = 0;
> --  tpm_response.data = NULL;
> --  old_time = current_kernel_time();
> --  /* initialize TPM emulator */
> --  if (!strcmp(startup, "clear")) {
> --    tpm_emulator_init(1);
> --  } else if (!strcmp(startup, "save")) {
> --    tpm_emulator_init(2);
> --  } else if (!strcmp(startup, "deactivated")) {
> --    tpm_emulator_init(3);
> --  } else {
> --    error("invalid startup mode '%s'; must be 'clear', "
> --      "'save' (default) or 'deactivated", startup);
> --    misc_deregister(&tpm_dev);
> --    return -EINVAL;
> --  }
> --  return 0;
> --}
> --
> --void __exit cleanup_tpm_module(void)
> --{
> --  tpm_emulator_shutdown();
> --  misc_deregister(&tpm_dev);
> --  if (tpm_response.data != NULL) kfree(tpm_response.data);
> --}
> --
> --module_init(init_tpm_module);
> --module_exit(cleanup_tpm_module);
> --
> --uint64_t tpm_get_ticks(void)
> --{
> --  struct timespec new_time = current_kernel_time();
> --  uint64_t ticks = (uint64_t)(new_time.tv_sec - old_time.tv_sec) * 1000000
> --                   + (new_time.tv_nsec - old_time.tv_nsec) / 1000;
> --  old_time = new_time;
> --  return (ticks > 0) ? ticks : 1;
> --}
> --
> -diff -uprN orig/tpm_emulator-0.4/linux_module.h tpm_emulator/linux_module.h
> ---- orig/tpm_emulator-0.4/linux_module.h       2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/linux_module.h        2006-07-24 14:35:35.000000000 -0700
> -@@ -1,5 +1,6 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -17,54 +18,62 @@
> - #ifndef _LINUX_MODULE_H_
> - #define _LINUX_MODULE_H_
> -
> --#include <linux/version.h>
> --#include <linux/kernel.h>
> --#include <linux/slab.h>
> -+#include <malloc.h>
> -+#include <stdint.h>
> -+#include <stdio.h>
> -+#include <string.h>
> - #include <linux/types.h>
> --#include <linux/string.h>
> --#include <linux/random.h>
> --#include <linux/time.h>
> --#include <asm/byteorder.h>
> -
> --/* module settings */
> -+#include <endian.h>
> -+#define __BYTEORDER_HAS_U64__
> -+#ifdef LITTLE_ENDIAN
> -+ #include <linux/byteorder/little_endian.h>
> -+#else
> -+ #include <linux/byteorder/big_endian.h>
> -+#endif
> -
> -+/* module settings */
> -+#define min(A,B) ((A)<(B)?(A):(B))
> -+#ifndef STR
> - #define STR(s) __STR__(s)
> - #define __STR__(s) #s
> -+#endif
> - #include "tpm_version.h"
> -
> - #define TPM_DEVICE_MINOR  224
> - #define TPM_DEVICE_NAME   "tpm"
> - #define TPM_MODULE_NAME   "tpm_emulator"
> -
> --/* debug and log output functions */
> --
> - #ifdef DEBUG
> --#define debug(fmt, ...) printk(KERN_DEBUG "%s %s:%d: Debug: " fmt "\n", \
> --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug(fmt, ...) printf("TPMD: %s:%d: Debug: " fmt "\n", \
> -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> - #else
> - #define debug(fmt, ...)
> - #endif
> --#define info(fmt, ...)  printk(KERN_INFO "%s %s:%d: Info: " fmt "\n", \
> --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> --#define error(fmt, ...) printk(KERN_ERR "%s %s:%d: Error: " fmt "\n", \
> --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> --#define alert(fmt, ...) printk(KERN_ALERT "%s %s:%d: Alert: " fmt "\n", \
> --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define info(fmt, ...)  printf("TPMD: %s:%d: Info: " fmt "\n", \
> -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define error(fmt, ...) printf("TPMD: %s:%d: Error: " fmt "\n", \
> -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define alert(fmt, ...) printf("TPMD: %s:%d: Alert: " fmt "\n", \
> -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> -
> - /* memory allocation */
> -
> - static inline void *tpm_malloc(size_t size)
> - {
> --  return kmalloc(size, GFP_KERNEL);
> -+  return malloc(size);
> - }
> -
> - static inline void tpm_free(const void *ptr)
> - {
> --  if (ptr != NULL) kfree(ptr);
> -+  if (ptr != NULL) free( (void *) ptr);
> - }
> -
> - /* random numbers */
> -
> -+//FIXME;
> -+void get_random_bytes(void *buf, int nbytes);
> -+
> - static inline void tpm_get_random_bytes(void *buf, int nbytes)
> - {
> -   get_random_bytes(buf, nbytes);
> -@@ -84,9 +93,9 @@ uint64_t tpm_get_ticks(void);
> - #define CPU_TO_LE16(x) __cpu_to_le16(x)
> -
> - #define BE64_TO_CPU(x) __be64_to_cpu(x)
> --#define LE64_TO_CPU(x) __be64_to_cpu(x)
> -+#define LE64_TO_CPU(x) __le64_to_cpu(x)
> - #define BE32_TO_CPU(x) __be32_to_cpu(x)
> --#define LE32_TO_CPU(x) __be32_to_cpu(x)
> -+#define LE32_TO_CPU(x) __le32_to_cpu(x)
> - #define BE16_TO_CPU(x) __be16_to_cpu(x)
> - #define LE16_TO_CPU(x) __le16_to_cpu(x)
> -
> -diff -uprN orig/tpm_emulator-0.4/Makefile tpm_emulator/Makefile
> ---- orig/tpm_emulator-0.4/Makefile     2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/Makefile      2006-07-24 14:35:35.000000000 -0700
> -@@ -1,24 +1,40 @@
> - # Software-Based Trusted Platform Module (TPM) Emulator for Linux
> - # Copyright (C) 2004 Mario Strasser <mast@gmx.net>
> -+# Copyright (C) 2006 INTEL Corp.
> - #
> - # $Id: Makefile 115 2006-06-23 10:36:44Z mast $
> -
> --# kernel settings
> --KERNEL_RELEASE := $(shell uname -r)
> --KERNEL_BUILD   := /lib/modules/$(KERNEL_RELEASE)/build
> --MOD_SUBDIR     := misc
> -+COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
> -
> - # module settings
> --MODULE_NAME    := tpm_emulator
> -+BIN            := tpm_emulator
> - VERSION_MAJOR  := 0
> - VERSION_MINOR  := 4
> - VERSION_BUILD  := $(shell date +"%s")
> -
> --# enable/disable DEBUG messages
> --EXTRA_CFLAGS   += -Wall -DDEBUG -g
> -+# Installation program and options
> -+INSTALL         = install
> -+INSTALL_PROG    = $(INSTALL) -m0755
> -+INSTALL_DIR     = $(INSTALL) -d -m0755
> -+
> -+# Xen tools installation directory
> -+TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin
> -+
> -+CC      := gcc
> -+CFLAGS  += -g -Wall $(INCLUDE) -DDEBUG
> -+CFLAGS  += -I. -Itpm
> -+
> -+# Is the simulator running in it's own vm?
> -+#CFLAGS += -DVTPM_MULTI_VM
> -+
> -+ifeq ($(COMPILE_ARCH),x86_64)
> -+LIBDIR = lib64
> -+else
> -+LIBDIR = lib
> -+endif
> -
> - # GNU MP configuration
> --GMP_LIB        := /usr/lib/libgmp.a
> -+GMP_LIB        := /usr/$(LIBDIR)/libgmp.a
> - GMP_HEADER     := /usr/include/gmp.h
> -
> - # sources and objects
> -@@ -27,38 +43,32 @@ DIRS           := . crypto tpm
> - SRCS           := $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.c))
> - OBJS           := $(patsubst %.c, %.o, $(SRCS))
> - SRCS           += $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.h))
> --DISTSRC        := ./README ./AUTHORS ./ChangeLog ./Makefile $(SRCS)
> --DISTDIR        := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)
> -
> --obj-m               := $(MODULE_NAME).o
> --$(MODULE_NAME)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
> -+obj-m               := $(BIN)
> -+$(BIN)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
> -
> - EXTRA_CFLAGS   += -I$(src) -I$(src)/crypto -I$(src)/tpm
> -
> - # do not print "Entering directory ..."
> - MAKEFLAGS      += --no-print-directory
> -
> --all:  $(src)/crypto/gmp.h $(src)/crypto/libgmp.a version
> --      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules
> -+all: $(BIN)
> -
> --install:
> --      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules_install
> --      test -d /var/tpm || mkdir /var/tpm
> --      test -c /dev/tpm || mknod /dev/tpm c 10 224
> --      chmod 666 /dev/tpm
> --      depmod -a
> -+$(BIN):       $(src)/crypto/gmp.h $(src)/crypto/libgmp.a version $(SRCS) $(OBJS)
> -+      $(CC) $(CFLAGS) $(OBJS) $(src)/crypto/libgmp.a -o $(BIN)
> -+
> -+%.o: %.c
> -+      $(CC) $(CFLAGS) -c $< -o $@
> -+
> -+install: $(BIN)
> -+      $(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)
> -+      @if [ ! -d "/var/tpm" ]; then mkdir /var/tpm; fi
> -
> - clean:
> --      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) clean
> --      rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a
> -+      rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a $(OBJS)
> -
> --dist: $(DISTSRC)
> --      rm -rf $(DISTDIR)
> --      mkdir $(DISTDIR)
> --      cp --parents $(DISTSRC) $(DISTDIR)/
> --      rm -f $(DISTDIR)/crypto/gmp.h
> --      tar -chzf $(DISTDIR).tar.gz $(DISTDIR)
> --      rm -rf $(DISTDIR)
> -+mrproper: clean
> -+      rm -f $(BIN) tpm_version.h
> -
> - $(src)/crypto/libgmp.a:
> -       test -f $(src)/crypto/libgmp.a || ln -s $(GMP_LIB) $(src)/crypto/libgmp.a
> -@@ -88,4 +98,3 @@ version:
> -       @echo "#endif /* _TPM_VERSION_H_ */" >> $(src)/tpm_version.h
> -
> - .PHONY: all install clean dist gmp version
> --
> -diff -uprN orig/tpm_emulator-0.4/README tpm_emulator/README
> ---- orig/tpm_emulator-0.4/README       2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/README        2006-07-24 14:35:35.000000000 -0700
> -@@ -13,7 +13,8 @@ $Id: README 113 2006-06-18 12:38:13Z hst
> - Copyright
> - --------------------------------------------------------------------------
> - Copyright (C) 2004 Mario Strasser <mast@gmx.net> and Swiss Federal
> --Institute of Technology (ETH) Zurich.
> -+                   Institute of Technology (ETH) Zurich.
> -+Copyright (C) 2005 INTEL Corp
> -
> - This program is free software; you can redistribute it and/or modify
> - it under the terms of the GNU General Public License as published by
> -@@ -43,6 +44,12 @@ Example:
> - GMP_LIB        := /usr/lib/libgmp.a
> - GMP_HEADER     := /usr/include/gmp.h
> -
> -+GNU MP Library on 64 bit Systems
> -+--------------------------------------------------------------------------
> -+Some 64-bit kernels have problems with importing the user-space gmp
> -+library (/usr/lib*/libgmp.a) into kernel space.  These kernels will require
> -+that the gmp library be recompiled for kernel space with -mcmodel=kernel.
> -+
> - Installation
> - --------------------------------------------------------------------------
> - The compilation and installation process uses the build environment for
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_capability.c tpm_emulator/tpm/tpm_capability.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_capability.c 2006-06-23 19:37:07.000000000 +0900
> -+++ tpm_emulator/tpm/tpm_capability.c  2007-12-28 22:50:19.000000000 +0900
> -@@ -701,7 +701,10 @@ TPM_RESULT TPM_GetCapabilityOwner(TPM_VE
> -   TPM_RESULT res;
> -
> -   info("TPM_GetCapabilityOwner()");
> --
> -+
> -+  if (!tpmData.permanent.flags.owned) {
> -+    return TPM_NOSRK;
> -+  }
> -   /* Verify owner authorization */
> -   res = tpm_verify_auth(auth1, tpmData.permanent.data.ownerAuth, TPM_KH_OWNER);
> -   if (res != TPM_SUCCESS) return res;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c tpm_emulator/tpm/tpm_cmd_handler.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c        2006-06-23 19:37:07.000000000 +0900
> -+++ tpm_emulator/tpm/tpm_cmd_handler.c 2007-09-12 20:23:00.000000000 +0900
> -@@ -565,7 +565,7 @@ static TPM_RESULT execute_TPM_Seal(TPM_R
> -   if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle)
> -       || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth)
> -       || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize)
> --      || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)
> -+      || (pcrInfoSize >0 && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo))
> -       || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize)
> -       || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize)
> -       || len != 0) return TPM_BAD_PARAMETER;
> -@@ -798,7 +798,7 @@ static TPM_RESULT execute_TPM_Sealx(TPM_
> -   if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle)
> -       || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth)
> -       || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize)
> --      || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)
> -+      || (pcrInfoSize > 0 && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo))
> -       || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize)
> -       || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize)
> -       || len != 0) return TPM_BAD_PARAMETER;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_credentials.c tpm_emulator/tpm/tpm_credentials.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_credentials.c        2006-06-23 19:37:07.000000000 +0900
> -+++ tpm_emulator/tpm/tpm_credentials.c 2007-09-12 20:23:30.000000000 +0900
> -@@ -47,20 +47,20 @@ int tpm_compute_pubkey_checksum(TPM_NONC
> -
> - TPM_RESULT tpm_get_pubek(TPM_PUBKEY *pubEndorsementKey)
> - {
> --  UINT32 key_length;
> -+  size_t key_length;
> -   if (!tpmData.permanent.data.endorsementKey.size) return TPM_NO_ENDORSEMENT;
> -   /* setup TPM_PUBKEY structure */
> --  key_length = tpmData.permanent.data.endorsementKey.size;
> --  pubEndorsementKey->pubKey.keyLength = key_length >> 3;
> -+  pubEndorsementKey->pubKey.keyLength = tpmData.permanent.data.endorsementKey.size >> 3;
> -   pubEndorsementKey->pubKey.key = tpm_malloc(pubEndorsementKey->pubKey.keyLength);
> -   if (pubEndorsementKey->pubKey.key == NULL) return TPM_FAIL;
> -   rsa_export_modulus(&tpmData.permanent.data.endorsementKey,
> --    pubEndorsementKey->pubKey.key,
> --    &pubEndorsementKey->pubKey.keyLength);
> -+                   pubEndorsementKey->pubKey.key,
> -+                   &key_length);
> -+  pubEndorsementKey->pubKey.keyLength = key_length;
> -   pubEndorsementKey->algorithmParms.algorithmID = TPM_ALG_RSA;
> -   pubEndorsementKey->algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
> -   pubEndorsementKey->algorithmParms.sigScheme = TPM_SS_NONE;
> --  pubEndorsementKey->algorithmParms.parms.rsa.keyLength = key_length;
> -+  pubEndorsementKey->algorithmParms.parms.rsa.keyLength = key_length << 3;
> -   pubEndorsementKey->algorithmParms.parms.rsa.numPrimes = 2;
> -   pubEndorsementKey->algorithmParms.parms.rsa.exponentSize = 0;
> -   pubEndorsementKey->algorithmParms.parms.rsa.exponent = NULL;
> -@@ -175,6 +175,7 @@ TPM_RESULT TPM_OwnerReadInternalPub(TPM_
> - {
> -   TPM_RESULT res;
> -   TPM_KEY_DATA *srk = &tpmData.permanent.data.srk;
> -+  size_t key_length;
> -   info("TPM_OwnerReadInternalPub()");
> -   /* verify authorization */
> -   res = tpm_verify_auth(auth1, tpmData.permanent.data.ownerAuth, TPM_KH_OWNER);
> -@@ -186,7 +187,8 @@ TPM_RESULT TPM_OwnerReadInternalPub(TPM_
> -     publicPortion->pubKey.key = tpm_malloc(publicPortion->pubKey.keyLength);
> -     if (publicPortion->pubKey.key == NULL) return TPM_FAIL;
> -     rsa_export_modulus(&srk->key, publicPortion->pubKey.key,
> --      &publicPortion->pubKey.keyLength);
> -+      &key_length);
> -+    publicPortion->pubKey.keyLength = key_length;
> -     publicPortion->algorithmParms.algorithmID = TPM_ALG_RSA;
> -     publicPortion->algorithmParms.encScheme = srk->encScheme;
> -     publicPortion->algorithmParms.sigScheme = srk->sigScheme;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_crypto.c tpm_emulator/tpm/tpm_crypto.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_crypto.c     2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_crypto.c      2006-07-24 14:35:35.000000000 -0700
> -@@ -182,7 +182,8 @@ TPM_RESULT TPM_CertifyKey(TPM_KEY_HANDLE
> -   TPM_KEY_DATA *cert, *key;
> -   sha1_ctx_t sha1_ctx;
> -   BYTE *buf, *p;
> --  UINT32 length;
> -+  UINT32 length32;
> -+  size_t length;
> -   info("TPM_CertifyKey()");
> -   /* get keys */
> -   cert = tpm_get_key(certHandle);
> -@@ -264,14 +265,15 @@ TPM_RESULT TPM_CertifyKey(TPM_KEY_HANDLE
> -   /* compute the digest of the CERTIFY_INFO[2] structure and sign it */
> -   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
> -   p = buf = tpm_malloc(length);
> -+  length32=(UINT32) length;
> -   if (buf == NULL
> --      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length, certifyInfo)) {
> -+      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length32, certifyInfo)) {
> -     free_TPM_KEY_PARMS(certifyInfo->algorithmParms);
> -     return TPM_FAIL;
> -   }
> -   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
> -   sha1_init(&sha1_ctx);
> --  sha1_update(&sha1_ctx, buf, length);
> -+  sha1_update(&sha1_ctx, buf, (size_t) length);
> -   sha1_final(&sha1_ctx, buf);
> -   res = tpm_sign(cert, auth1, FALSE, buf, SHA1_DIGEST_LENGTH, outData, outDataSize);
> -   tpm_free(buf);
> -@@ -292,7 +294,8 @@ TPM_RESULT TPM_CertifyKey2(TPM_KEY_HANDL
> -   TPM_KEY_DATA *cert, *key;
> -   sha1_ctx_t sha1_ctx;
> -   BYTE *buf, *p;
> --  UINT32 length;
> -+  size_t length;
> -+  UINT32 length32;
> -   info("TPM_CertifyKey2()");
> -   /* get keys */
> -   cert = tpm_get_key(certHandle);
> -@@ -362,8 +365,9 @@ TPM_RESULT TPM_CertifyKey2(TPM_KEY_HANDL
> -   /* compute the digest of the CERTIFY_INFO[2] structure and sign it */
> -   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
> -   p = buf = tpm_malloc(length);
> -+  length32 = (UINT32) length;
> -   if (buf == NULL
> --      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length, certifyInfo)) {
> -+      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length32, certifyInfo)) {
> -     free_TPM_KEY_PARMS(certifyInfo->algorithmParms);
> -     return TPM_FAIL;
> -   }
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_daa.c tpm_emulator/tpm/tpm_daa.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_daa.c        2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_daa.c 2006-07-24 14:35:35.000000000 -0700
> -@@ -716,14 +716,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -805,14 +805,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -1489,14 +1489,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -1712,14 +1712,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -1793,14 +1793,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -2918,14 +2918,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -3143,7 +3143,7 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -         sha1_init(&sha1);
> -         sha1_update(&sha1, (BYTE*) &session->DAA_session.DAA_digest,
> -           sizeof(session->DAA_session.DAA_digest));
> --        sha1_update(&sha1, "\x01", 1);
> -+        sha1_update(&sha1, (BYTE *) "\x01", 1);
> -         sha1_update(&sha1, inputData1, inputSize1);
> -         sha1_final(&sha1, (BYTE*) &session->DAA_session.DAA_digest);
> -       }
> -@@ -3172,7 +3172,7 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -         sha1_init(&sha1);
> -         sha1_update(&sha1, (BYTE*) &session->DAA_session.DAA_digest,
> -           sizeof(session->DAA_session.DAA_digest));
> --        sha1_update(&sha1, "\x00", 1);
> -+        sha1_update(&sha1, (BYTE*) "\x00", 1);
> -         rsa_export_modulus(&aikData->key, scratch, &size);
> -         sha1_update(&sha1, scratch, size);
> -         sha1_final(&sha1, (BYTE*) &session->DAA_session.DAA_digest);
> -@@ -3229,14 +3229,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -3309,14 +3309,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_data.c tpm_emulator/tpm/tpm_data.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_data.c       2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_data.c        2006-07-24 14:35:35.000000000 -0700
> -@@ -40,6 +40,7 @@ static inline void init_pcr_attr(int pcr
> - void tpm_init_data(void)
> - {
> -   /* endorsement key */
> -+#ifndef TPM_GENERATE_EK
> -   uint8_t ek_n[] =  "\xa8\xdb\xa9\x42\xa8\xf3\xb8\x06\x85\x90\x76\x93\xad\xf7"
> -     "\x74\xec\x3f\xd3\x3d\x9d\xe8\x2e\xff\x15\xed\x0e\xce\x5f\x93"
> -     "\x92\xeb\xd1\x96\x2b\x72\x18\x81\x79\x12\x9d\x9c\x40\xd7\x1a"
> -@@ -77,6 +78,8 @@ void tpm_init_data(void)
> -     "\xd1\xc0\x8b\x5b\xa2\x2e\xa7\x15\xca\x50\x75\x10\x48\x9c\x2b"
> -     "\x18\xb9\x67\x8f\x5d\x64\xc3\x28\x9f\x2f\x16\x2f\x08\xda\x47"
> -     "\xec\x86\x43\x0c\x80\x99\x07\x34\x0f";
> -+#endif
> -+
> -   int i;
> -   /* reset all data to NULL, FALSE or 0 */
> -   memset(&tpmData, 0, sizeof(tpmData));
> -@@ -152,44 +155,43 @@ void tpm_release_data(void)
> -
> - #ifdef TPM_STORE_TO_FILE
> -
> --#include <linux/fs.h>
> --#include <linux/unistd.h>
> --#include <asm/uaccess.h>
> -+#include <sys/types.h>
> -+#include <sys/stat.h>
> -+#include <fcntl.h>
> -+#include <unistd.h>
> -
> - #define TPM_STORAGE_FILE "/var/tpm/tpm_emulator-1.2." STR(VERSION_MAJOR) "." STR(VERSION_MINOR)
> -
> - static int write_to_file(uint8_t *data, size_t data_length)
> - {
> -   int res;
> --  struct file *fp;
> --  mm_segment_t old_fs = get_fs();
> --  fp = filp_open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> --  if (IS_ERR(fp)) return -1;
> --  set_fs(get_ds());
> --  res = fp->f_op->write(fp, data, data_length, &fp->f_pos);
> --  set_fs(old_fs);
> --  filp_close(fp, NULL);
> -+  int fp;
> -+  fp = open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> -+  res = write(fp, data, data_length);
> -+  close(fp);
> -   return (res == data_length) ? 0 : -1;
> - }
> -
> - static int read_from_file(uint8_t **data, size_t *data_length)
> - {
> -   int res;
> --  struct file *fp;
> --  mm_segment_t old_fs = get_fs();
> --  fp = filp_open(TPM_STORAGE_FILE, O_RDONLY, 0);
> --  if (IS_ERR(fp)) return -1;
> --  *data_length = (size_t)fp->f_dentry->d_inode->i_size;
> --  /* *data_length = i_size_read(fp->f_dentry->d_inode); */
> -+  int fp, file_status;
> -+  struct stat file_info;
> -+  fp = open(TPM_STORAGE_FILE, O_RDONLY, 0);
> -+  file_status = fstat(fp, &file_info);
> -+  if (file_status < 0) {
> -+    close(fp);
> -+    return -1;
> -+  }
> -+
> -+  *data_length = file_info.st_size;
> -   *data = tpm_malloc(*data_length);
> -   if (*data == NULL) {
> --    filp_close(fp, NULL);
> -+    close(fp);
> -     return -1;
> -   }
> --  set_fs(get_ds());
> --  res = fp->f_op->read(fp, *data, *data_length, &fp->f_pos);
> --  set_fs(old_fs);
> --  filp_close(fp, NULL);
> -+  res = read(fp, *data, *data_length);
> -+  close(fp);
> -   if (res != *data_length) {
> -     tpm_free(*data);
> -     return -1;
> -@@ -216,23 +218,30 @@ static int read_from_file(uint8_t **data
> - int tpm_store_permanent_data(void)
> - {
> -   uint8_t *buf, *ptr;
> --  size_t buf_length, len;
> -+  UINT32 buf_length, len;
> -
> -   /* marshal data */
> --  buf_length = len = sizeof_TPM_STCLEAR_FLAGS(tpmData.stclear.flags)
> --    + sizeof_TPM_PERMANENT_FLAGS(tpmData.permanent.flags) + 2
> --    + sizeof_TPM_PERMANENT_DATA(tpmData.permanent.data);
> -+  buf_length = len = 4 + sizeof_TPM_STCLEAR_FLAGS(tpmData.stclear.flags)
> -+    + sizeof_TPM_PERMANENT_FLAGS(tpmData.permanent.flags)
> -+    + sizeof_TPM_STANY_FLAGS(tpmData.stany.flags) + 2
> -+    + sizeof_TPM_STCLEAR_DATA(tpmData.stclear.data)
> -+    + sizeof_TPM_PERMANENT_DATA(tpmData.permanent.data)
> -+    + sizeof_TPM_STANY_DATA(tpmData.stany.data);
> -   buf = ptr = tpm_malloc(buf_length);
> -   if (buf == NULL
> -       || tpm_marshal_TPM_VERSION(&ptr, &len, &tpmData.permanent.data.version)
> -       || tpm_marshal_TPM_STCLEAR_FLAGS(&ptr, &len, &tpmData.stclear.flags)
> -       || tpm_marshal_TPM_PERMANENT_FLAGS(&ptr, &len, &tpmData.permanent.flags)
> -+      || tpm_marshal_TPM_STANY_FLAGS(&ptr, &len, &tpmData.stany.flags)
> -       || tpm_marshal_BOOL(&ptr, &len, tpmData.permanent.flags.selfTestSucceeded)
> -       || tpm_marshal_BOOL(&ptr, &len, tpmData.permanent.flags.owned)
> --      || tpm_marshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)) {
> -+      || tpm_marshal_TPM_STCLEAR_DATA(&ptr, &len, &tpmData.stclear.data)
> -+      || tpm_marshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)
> -+      || tpm_marshal_TPM_STANY_DATA(&ptr, &len, &tpmData.stany.data)) {
> -     tpm_free(buf);
> -     return -1;
> -   }
> -+
> -   if (write_to_file(buf, buf_length - len)) {
> -     tpm_free(buf);
> -     return -1;
> -@@ -244,31 +253,36 @@ int tpm_store_permanent_data(void)
> - int tpm_restore_permanent_data(void)
> - {
> -   uint8_t *buf, *ptr;
> --  size_t buf_length, len;
> -+  size_t buf_length;
> -+  UINT32 len;
> -   TPM_VERSION ver;
> -
> -   /* read data */
> -   if (read_from_file(&buf, &buf_length)) return -1;
> -   ptr = buf;
> --  len = buf_length;
> -+  len = (uint32_t) buf_length;
> -   /* unmarshal data */
> -   if (tpm_unmarshal_TPM_VERSION(&ptr, &len, &ver)
> -       || memcmp(&ver, &tpmData.permanent.data.version, sizeof(TPM_VERSION))
> -       || tpm_unmarshal_TPM_STCLEAR_FLAGS(&ptr, &len, &tpmData.stclear.flags)
> -       || tpm_unmarshal_TPM_PERMANENT_FLAGS(&ptr, &len, &tpmData.permanent.flags)
> -+      || tpm_unmarshal_TPM_STANY_FLAGS(&ptr, &len, &tpmData.stany.flags)
> -       || tpm_unmarshal_BOOL(&ptr, &len, &tpmData.permanent.flags.selfTestSucceeded)
> -       || tpm_unmarshal_BOOL(&ptr, &len, &tpmData.permanent.flags.owned)
> --      || tpm_unmarshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)) {
> -+      || tpm_unmarshal_TPM_STCLEAR_DATA(&ptr, &len, &tpmData.stclear.data)
> -+      || tpm_unmarshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)
> -+      || tpm_unmarshal_TPM_STANY_DATA(&ptr, &len, &tpmData.stany.data)) {
> -     tpm_free(buf);
> -     return -1;
> -   }
> -+
> -   tpm_free(buf);
> -   return 0;
> - }
> -
> - int tpm_erase_permanent_data(void)
> - {
> --  int res = write_to_file("", 0);
> -+  int res = write_to_file((uint8_t *) "", 0);
> -   return res;
> - }
> -
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_deprecated.c tpm_emulator/tpm/tpm_deprecated.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_deprecated.c 2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_deprecated.c  2006-07-24 14:35:35.000000000 -0700
> -@@ -1,6 +1,7 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -50,7 +51,7 @@ TPM_RESULT TPM_SaveKeyContext(TPM_KEY_HA
> -   BYTE *ptr;
> -   UINT32 len;
> -   info("TPM_SaveKeyContext()");
> --  res = TPM_SaveContext(keyHandle, TPM_RT_KEY, "SaveKeyContext..",
> -+  res = TPM_SaveContext(keyHandle, TPM_RT_KEY, (BYTE*)"SaveKeyContext..",
> -                         keyContextSize, &contextBlob);
> -   if (res != TPM_SUCCESS) return res;
> -   len = *keyContextSize;
> -@@ -82,7 +83,7 @@ TPM_RESULT TPM_SaveAuthContext(TPM_AUTHH
> -   BYTE *ptr;
> -   UINT32 len;
> -   info("TPM_SaveAuthContext()");
> --  res = TPM_SaveContext(authHandle, TPM_RT_KEY, "SaveAuthContext.",
> -+  res = TPM_SaveContext(authHandle, TPM_RT_KEY, (BYTE*)"SaveAuthContext.",
> -                         authContextSize, &contextBlob);
> -   if (res != TPM_SUCCESS) return res;
> -   len = *authContextSize;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_emulator.h tpm_emulator/tpm/tpm_emulator.h
> ---- orig/tpm_emulator-0.4/tpm/tpm_emulator.h   2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_emulator.h    2006-07-24 14:35:35.000000000 -0700
> -@@ -1,5 +1,6 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -22,7 +23,8 @@
> - /* TPM configuration */
> - #define TPM_STORE_TO_FILE       1
> - #undef  TPM_STRONG_PERSISTENCE
> --#undef  TPM_GENERATE_EK
> -+//#undef  TPM_GENERATE_EK
> -+#define  TPM_GENERATE_EK
> - #undef  TPM_GENERATE_SEED_DAA
> -
> - #define TPM_MANUFACTURER 0x4554485A /* 'ETHZ' */
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_marshalling.c tpm_emulator/tpm/tpm_marshalling.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_marshalling.c        2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_marshalling.c 2006-07-24 14:35:35.000000000 -0700
> -@@ -1312,7 +1312,7 @@ int tpm_unmarshal_TPM_STANY_FLAGS(BYTE *
> -
> - int tpm_marshal_RSA(BYTE **ptr, UINT32 *length, rsa_private_key_t *v)
> - {
> --  UINT32 m_len, e_len, q_len;
> -+  size_t m_len, e_len, q_len;
> -   if (*length < sizeof_RSA((*v))) return -1;
> -   if (v->size > 0) {
> -     rsa_export_modulus(v, &(*ptr)[6], &m_len);
> -@@ -1460,6 +1460,66 @@ int tpm_unmarshal_TPM_PERMANENT_DATA(BYT
> -   return 0;
> - }
> -
> -+int tpm_marshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v)
> -+{
> -+  if (tpm_marshal_TPM_STRUCTURE_TAG(ptr, length, v->tag)
> -+    || tpm_marshal_TPM_NONCE(ptr, length, &v->contextNonceKey)
> -+    || tpm_marshal_TPM_COUNT_ID(ptr, length, v->countID) ) return -1;
> -+
> -+  return 0;
> -+}
> -+
> -+int tpm_unmarshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v)
> -+{
> -+  if (tpm_unmarshal_TPM_STRUCTURE_TAG(ptr, length, &v->tag)
> -+    || tpm_unmarshal_TPM_NONCE(ptr, length, &v->contextNonceKey)
> -+    || tpm_unmarshal_TPM_COUNT_ID(ptr, length, &v->countID) ) return -1;
> -+
> -+  return 0;
> -+}
> -+
> -+int tpm_marshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v)
> -+{
> -+  UINT32 i;
> -+  if (tpm_marshal_TPM_STRUCTURE_TAG(ptr, length, v->tag)
> -+    || tpm_marshal_TPM_NONCE(ptr, length, &v->contextNonceSession)
> -+    || tpm_marshal_TPM_DIGEST(ptr, length, &v->auditDigest)
> -+    || tpm_marshal_BOOL(ptr, length, v->auditSession)
> -+    || tpm_marshal_TPM_CURRENT_TICKS(ptr, length, &v->currentTicks)
> -+    || tpm_marshal_UINT32(ptr, length, v->contextCount)
> -+    || tpm_marshal_UINT32_ARRAY(ptr, length, v->contextList, TPM_MAX_SESSION_LIST)) return -1;
> -+  for (i = 0; i < TPM_MAX_SESSIONS; i++) {
> -+    if (tpm_marshal_TPM_SESSION_DATA(ptr, length, &v->sessions[i])) return -1;
> -+  }
> -+  for (i = 0; i < TPM_MAX_SESSIONS_DAA; i++) {
> -+    if (tpm_marshal_TPM_DAA_SESSION_DATA(ptr, length, &v->sessionsDAA[i])) return -1;
> -+  }
> -+  if (tpm_marshal_TPM_TRANSHANDLE(ptr, length, v->transExclusive)) return -1;
> -+
> -+  return 0;
> -+}
> -+
> -+int tpm_unmarshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v)
> -+{
> -+  UINT32 i;
> -+  if (tpm_unmarshal_TPM_STRUCTURE_TAG(ptr, length, &v->tag)
> -+    || tpm_unmarshal_TPM_NONCE(ptr, length, &v->contextNonceSession)
> -+    || tpm_unmarshal_TPM_DIGEST(ptr, length, &v->auditDigest)
> -+    || tpm_unmarshal_BOOL(ptr, length, &v->auditSession)
> -+    || tpm_unmarshal_TPM_CURRENT_TICKS(ptr, length, &v->currentTicks)
> -+    || tpm_unmarshal_UINT32(ptr, length, &v->contextCount)
> -+    || tpm_unmarshal_UINT32_ARRAY(ptr, length, v->contextList, TPM_MAX_SESSION_LIST)) return -1;
> -+  for (i = 0; i < TPM_MAX_SESSIONS; i++) {
> -+    if (tpm_unmarshal_TPM_SESSION_DATA(ptr, length, &v->sessions[i])) return -1;
> -+  }
> -+  for (i = 0; i < TPM_MAX_SESSIONS_DAA; i++) {
> -+    if (tpm_unmarshal_TPM_DAA_SESSION_DATA(ptr, length, &v->sessionsDAA[i])) return -1;
> -+  }
> -+  if (tpm_unmarshal_TPM_TRANSHANDLE(ptr, length, &v->transExclusive)) return -1;
> -+
> -+  return 0;
> -+}
> -+
> - int tpm_marshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v)
> - {
> -   if (tpm_marshal_BYTE(ptr, length, v->type)
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_marshalling.h tpm_emulator/tpm/tpm_marshalling.h
> ---- orig/tpm_emulator-0.4/tpm/tpm_marshalling.h        2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_marshalling.h 2006-07-24 14:35:35.000000000 -0700
> -@@ -432,6 +432,12 @@ int tpm_unmarshal_TPM_KEY_DATA(BYTE **pt
> - int tpm_marshal_TPM_PERMANENT_DATA(BYTE **ptr, UINT32 *length, TPM_PERMANENT_DATA *);
> - int tpm_unmarshal_TPM_PERMANENT_DATA(BYTE **ptr, UINT32 *length, TPM_PERMANENT_DATA *);
> -
> -+int tpm_marshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v);
> -+int tpm_unmarshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v);
> -+
> -+int tpm_marshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v);
> -+int tpm_unmarshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v);
> -+
> - int tpm_marshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v);
> - int tpm_unmarshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v);
> -
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_owner.c tpm_emulator/tpm/tpm_owner.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_owner.c      2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_owner.c       2006-07-24 14:35:35.000000000 -0700
> -@@ -108,7 +108,7 @@ TPM_RESULT TPM_TakeOwnership(TPM_PROTOCO
> -   TPM_RESULT res;
> -   rsa_private_key_t *ek = &tpmData.permanent.data.endorsementKey;
> -   TPM_KEY_DATA *srk = &tpmData.permanent.data.srk;
> --  UINT32 buf_size = ek->size >> 3;
> -+  size_t buf_size = ek->size >> 3, key_length;
> -   BYTE buf[buf_size];
> -
> -   info("TPM_TakeOwnership()");
> -@@ -173,7 +173,8 @@ TPM_RESULT TPM_TakeOwnership(TPM_PROTOCO
> -     return TPM_FAIL;
> -   }
> -   rsa_export_modulus(&srk->key, srkPub->pubKey.key,
> --    &srkPub->pubKey.keyLength);
> -+                   &key_length);
> -+  srkPub->pubKey.keyLength = (UINT32) key_length;
> -   /* setup tpmProof and set state to owned */
> -   tpm_get_random_bytes(tpmData.permanent.data.tpmProof.nonce,
> -     sizeof(tpmData.permanent.data.tpmProof.nonce));
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_startup.c tpm_emulator/tpm/tpm_startup.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_startup.c    2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_startup.c     2006-07-24 14:35:35.000000000 -0700
> -@@ -41,26 +41,29 @@ void TPM_Init(TPM_STARTUP_TYPE startupTy
> - TPM_RESULT TPM_Startup(TPM_STARTUP_TYPE startupType)
> - {
> -   int i;
> -+  int restore_fail;
> -   info("TPM_Startup(%d)", startupType);
> -   if (tpmData.stany.flags.postInitialise == FALSE) return TPM_INVALID_POSTINIT;
> --  /* reset STANY_FLAGS */
> --  SET_TO_ZERO(&tpmData.stany.flags);
> --  tpmData.stany.flags.tag = TPM_TAG_STANY_FLAGS;
> --  /* reset STANY_DATA (invalidates ALL sessions) */
> --  SET_TO_ZERO(&tpmData.stany.data);
> --  tpmData.stany.data.tag = TPM_TAG_STANY_DATA;
> --  /* init session-context nonce */
> --  SET_TO_RAND(&tpmData.stany.data.contextNonceSession);
> -+
> -+  /* try and restore state to get EK, SRK, etc */
> -+  restore_fail = tpm_restore_permanent_data();
> -+
> -   /* set data and flags according to the given startup type */
> -   if (startupType == TPM_ST_CLEAR) {
> --    /* if available, restore permanent data */
> --    tpm_restore_permanent_data();
> -+    /* reset STANY_FLAGS */
> -+    SET_TO_ZERO(&tpmData.stany.flags);
> -+    tpmData.stany.flags.tag = TPM_TAG_STANY_FLAGS;
> -+    /* reset STANY_DATA (invalidates ALL sessions) */
> -+    SET_TO_ZERO(&tpmData.stany.data);
> -+    tpmData.stany.data.tag = TPM_TAG_STANY_DATA;
> -+    /* init session-context nonce */
> -+    SET_TO_RAND(&tpmData.stany.data.contextNonceSession);
> -     /* reset PCR values */
> -     for (i = 0; i < TPM_NUM_PCR; i++) {
> --      if (tpmData.permanent.data.pcrAttrib[i].pcrReset)
> --        SET_TO_ZERO(tpmData.permanent.data.pcrValue[i].digest);
> -+      if (!tpmData.permanent.data.pcrAttrib[i].pcrReset)
> -+        SET_TO_ZERO(&tpmData.permanent.data.pcrValue[i].digest);
> -       else
> --        SET_TO_0xFF(tpmData.permanent.data.pcrValue[i].digest);
> -+        SET_TO_0xFF(&tpmData.permanent.data.pcrValue[i].digest);
> -     }
> -     /* reset STCLEAR_FLAGS */
> -     SET_TO_ZERO(&tpmData.stclear.flags);
> -@@ -79,7 +82,8 @@ TPM_RESULT TPM_Startup(TPM_STARTUP_TYPE
> -     /* init key-context nonce */
> -     SET_TO_RAND(&tpmData.stclear.data.contextNonceKey);
> -   } else if (startupType == TPM_ST_STATE) {
> --    if (tpm_restore_permanent_data()) {
> -+    /* restore must have been successful for TPM_ST_STATE */
> -+    if (restore_fail) {
> -       error("restoring permanent data failed");
> -       tpmData.permanent.data.testResult = "tpm_restore_permanent_data() failed";
> -       tpmData.permanent.flags.selfTestSucceeded = FALSE;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_storage.c tpm_emulator/tpm/tpm_storage.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_storage.c    2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_storage.c     2006-07-24 14:35:35.000000000 -0700
> -@@ -58,6 +58,7 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
> -                         BYTE *enc, UINT32 *enc_size)
> - {
> -   UINT32 len;
> -+  size_t enc_size32 = *enc_size;
> -   BYTE *buf, *ptr;
> -   rsa_public_key_t pub_key;
> -   int scheme;
> -@@ -72,7 +73,7 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
> -   if (buf == NULL
> -       || tpm_marshal_TPM_SEALED_DATA(&ptr, &len, seal)
> -       || rsa_encrypt(&pub_key, scheme, buf, sizeof_TPM_SEALED_DATA((*seal)),
> --                     enc, enc_size)) {
> -+                     enc, &enc_size32)) {
> -     tpm_free(buf);
> -     rsa_release_public_key(&pub_key);
> -     return -1;
> -@@ -85,7 +86,8 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
> - int decrypt_sealed_data(TPM_KEY_DATA *key, BYTE *enc, UINT32 enc_size,
> -                         TPM_SEALED_DATA *seal, BYTE **buf)
> - {
> --  UINT32 len;
> -+  size_t len;
> -+  UINT32 len32;
> -   BYTE *ptr;
> -   int scheme;
> -   switch (key->encScheme) {
> -@@ -96,8 +98,12 @@ int decrypt_sealed_data(TPM_KEY_DATA *ke
> -   len = enc_size;
> -   *buf = ptr = tpm_malloc(len);
> -   if (*buf == NULL
> --      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len)
> --      || tpm_unmarshal_TPM_SEALED_DATA(&ptr, &len, seal)) {
> -+      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len) ){
> -+    tpm_free(*buf);
> -+    return -1;
> -+  }
> -+  len32 = len;
> -+  if (tpm_unmarshal_TPM_SEALED_DATA(&ptr, &len32, seal)) {
> -     tpm_free(*buf);
> -     return -1;
> -   }
> -@@ -240,11 +246,12 @@ TPM_RESULT TPM_Unseal(TPM_KEY_HANDLE par
> -
> - TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE keyHandle, UINT32 inDataSize,
> -                       BYTE *inData, TPM_AUTH *auth1,
> --                      UINT32 *outDataSize, BYTE **outData)
> -+                      UINT32 *outDataSize32, BYTE **outData)
> - {
> -   TPM_RESULT res;
> -   TPM_KEY_DATA *key;
> -   int scheme;
> -+  size_t outDataSize;
> -
> -   info("TPM_UnBind()");
> -   /* get key */
> -@@ -262,8 +269,8 @@ TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE key
> -   /* the size of the input data muss be greater than zero */
> -   if (inDataSize == 0) return TPM_BAD_PARAMETER;
> -   /* decrypt data */
> --  *outDataSize = inDataSize;
> --  *outData = tpm_malloc(*outDataSize);
> -+  outDataSize = inDataSize;
> -+  *outData = tpm_malloc(outDataSize);
> -   if (*outData == NULL) return TPM_NOSPACE;
> -   switch (key->encScheme) {
> -     case TPM_ES_RSAESOAEP_SHA1_MGF1: scheme = RSA_ES_OAEP_SHA1; break;
> -@@ -271,20 +278,21 @@ TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE key
> -     default: tpm_free(*outData); return TPM_DECRYPT_ERROR;
> -   }
> -   if (rsa_decrypt(&key->key, scheme, inData, inDataSize,
> --      *outData, outDataSize)) {
> -+      *outData, &outDataSize)) {
> -     tpm_free(*outData);
> -     return TPM_DECRYPT_ERROR;
> -   }
> -   /* verify data if it is of type TPM_BOUND_DATA */
> -   if (key->encScheme == TPM_ES_RSAESOAEP_SHA1_MGF1
> -       || key->keyUsage != TPM_KEY_LEGACY) {
> --    if (*outDataSize < 5 || memcmp(*outData, "\x01\x01\00\x00\x02", 5) != 0) {
> -+    if (outDataSize < 5 || memcmp(*outData, "\x01\x01\00\x00\x02", 5) != 0) {
> -       tpm_free(*outData);
> -       return TPM_DECRYPT_ERROR;
> -     }
> --    *outDataSize -= 5;
> --    memmove(*outData, &(*outData)[5], *outDataSize);
> -+    outDataSize -= 5;
> -+    memmove(*outData, &(*outData)[5], outDataSize);
> -   }
> -+  *outDataSize32 = (UINT32) outDataSize;
> -   return TPM_SUCCESS;
> - }
> -
> -@@ -334,12 +342,13 @@ int compute_pubkey_digest(TPM_PUBKEY *ke
> - }
> -
> - int encrypt_private_key(TPM_KEY_DATA *key, TPM_STORE_ASYMKEY *store,
> --                        BYTE *enc, UINT32 *enc_size)
> -+                        BYTE *enc, UINT32 *enc_size32)
> - {
> -   UINT32 len;
> -   BYTE *buf, *ptr;
> -   rsa_public_key_t pub_key;
> -   int scheme;
> -+  size_t enc_size;
> -   switch (key->encScheme) {
> -     case TPM_ES_RSAESOAEP_SHA1_MGF1: scheme = RSA_ES_OAEP_SHA1; break;
> -     case TPM_ES_RSAESPKCSv15: scheme = RSA_ES_PKCSV15; break;
> -@@ -351,11 +360,12 @@ int encrypt_private_key(TPM_KEY_DATA *ke
> -   if (buf == NULL
> -       || tpm_marshal_TPM_STORE_ASYMKEY(&ptr, &len, store)
> -       || rsa_encrypt(&pub_key, scheme, buf, sizeof_TPM_STORE_ASYMKEY((*store)),
> --                     enc, enc_size)) {
> -+                     enc, &enc_size)) {
> -     tpm_free(buf);
> -     rsa_release_public_key(&pub_key);
> -     return -1;
> -   }
> -+  *enc_size32 = (UINT32) enc_size;
> -   tpm_free(buf);
> -   rsa_release_public_key(&pub_key);
> -   return 0;
> -@@ -364,7 +374,8 @@ int encrypt_private_key(TPM_KEY_DATA *ke
> - int decrypt_private_key(TPM_KEY_DATA *key, BYTE *enc, UINT32 enc_size,
> -                         TPM_STORE_ASYMKEY *store, BYTE **buf)
> - {
> --  UINT32 len;
> -+  UINT32 len32;
> -+  size_t len;
> -   BYTE *ptr;
> -   int scheme;
> -   switch (key->encScheme) {
> -@@ -375,8 +386,12 @@ int decrypt_private_key(TPM_KEY_DATA *ke
> -   len = enc_size;
> -   *buf = ptr = tpm_malloc(len);
> -   if (*buf == NULL
> --      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len)
> --      || tpm_unmarshal_TPM_STORE_ASYMKEY(&ptr, &len, store)) {
> -+      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len) ) {
> -+    tpm_free(*buf);
> -+    return -1;
> -+  }
> -+  len32 = (UINT32) len;
> -+  if (tpm_unmarshal_TPM_STORE_ASYMKEY(&ptr, &len32, store)) {
> -     tpm_free(*buf);
> -     return -1;
> -   }
> -@@ -394,7 +409,7 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
> -   TPM_SESSION_DATA *session;
> -   TPM_STORE_ASYMKEY store;
> -   rsa_private_key_t rsa;
> --  UINT32 key_length;
> -+  size_t key_length;
> -
> -   info("TPM_CreateWrapKey()");
> -   /* get parent key */
> -@@ -450,11 +465,11 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
> -     }
> -   }
> -   /* generate key and store it */
> --  key_length = keyInfo->algorithmParms.parms.rsa.keyLength;
> --  if (rsa_generate_key(&rsa, key_length)) return TPM_FAIL;
> --  wrappedKey->pubKey.keyLength = key_length >> 3;
> -+  if (rsa_generate_key(&rsa, keyInfo->algorithmParms.parms.rsa.keyLength))
> -+    return TPM_FAIL;
> -+  wrappedKey->pubKey.keyLength = keyInfo->algorithmParms.parms.rsa.keyLength >> 3;
> -   wrappedKey->pubKey.key = tpm_malloc(wrappedKey->pubKey.keyLength);
> --  store.privKey.keyLength = key_length >> 4;
> -+  store.privKey.keyLength = keyInfo->algorithmParms.parms.rsa.keyLength >> 4;
> -   store.privKey.key = tpm_malloc(store.privKey.keyLength);
> -   wrappedKey->encDataSize = parent->key.size >> 3;
> -   wrappedKey->encData = tpm_malloc(wrappedKey->encDataSize);
> -@@ -466,9 +481,11 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
> -     tpm_free(wrappedKey->encData);
> -     return TPM_NOSPACE;
> -   }
> --  rsa_export_modulus(&rsa, wrappedKey->pubKey.key,
> --    &wrappedKey->pubKey.keyLength);
> --  rsa_export_prime1(&rsa, store.privKey.key, &store.privKey.keyLength);
> -+  rsa_export_modulus(&rsa, wrappedKey->pubKey.key,
> -+                   &key_length);
> -+  wrappedKey->pubKey.keyLength = (UINT32) key_length;
> -+  rsa_export_prime1(&rsa, store.privKey.key, &key_length);
> -+  store.privKey.keyLength = (UINT32) key_length;
> -   rsa_release_private_key(&rsa);
> -   /* compute the digest of the wrapped key (without encData) */
> -   if (compute_key_digest(wrappedKey, &store.pubDataDigest)) {
> -@@ -602,6 +619,7 @@ TPM_RESULT TPM_LoadKey2(TPM_KEY_HANDLE p
> -
> - int tpm_setup_key_parms(TPM_KEY_DATA *key, TPM_KEY_PARMS *parms)
> - {
> -+  size_t key_length;
> -   parms->algorithmID = TPM_ALG_RSA;
> -   parms->encScheme = key->encScheme;
> -   parms->sigScheme = key->sigScheme;
> -@@ -611,7 +629,8 @@ int tpm_setup_key_parms(TPM_KEY_DATA *ke
> -   parms->parms.rsa.exponent = tpm_malloc(parms->parms.rsa.exponentSize);
> -   if (parms->parms.rsa.exponent == NULL) return -1;
> -   rsa_export_exponent(&key->key, parms->parms.rsa.exponent,
> --    &parms->parms.rsa.exponentSize);
> -+    &key_length);
> -+  parms->parms.rsa.exponentSize = (UINT32) key_length;
> -   parms->parmSize = 12 + parms->parms.rsa.exponentSize;
> -   return 0;
> - }
> -@@ -622,6 +641,7 @@ TPM_RESULT TPM_GetPubKey(TPM_KEY_HANDLE
> -   TPM_RESULT res;
> -   TPM_KEY_DATA *key;
> -   TPM_DIGEST digest;
> -+  size_t key_length;
> -   info("TPM_GetPubKey()");
> -   /* get key */
> -   if (keyHandle == TPM_KH_SRK
> -@@ -650,8 +670,8 @@ TPM_RESULT TPM_GetPubKey(TPM_KEY_HANDLE
> -   pubKey->pubKey.keyLength = key->key.size >> 3;
> -   pubKey->pubKey.key = tpm_malloc(pubKey->pubKey.keyLength);
> -   if (pubKey->pubKey.key == NULL) return TPM_NOSPACE;
> --  rsa_export_modulus(&key->key, pubKey->pubKey.key,
> --    &pubKey->pubKey.keyLength);
> -+  rsa_export_modulus(&key->key, pubKey->pubKey.key, &key_length);
> -+  pubKey->pubKey.keyLength = (UINT32) key_length;
> -   if (tpm_setup_key_parms(key, &pubKey->algorithmParms) != 0) {
> -     error("TPM_GetPubKey(): tpm_setup_key_parms() failed.");
> -     tpm_free(pubKey->pubKey.key);
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_structures.h tpm_emulator/tpm/tpm_structures.h
> ---- orig/tpm_emulator-0.4/tpm/tpm_structures.h 2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_structures.h  2006-07-24 14:35:35.000000000 -0700
> -@@ -1958,6 +1958,7 @@ typedef struct tdTPM_DAA_ISSUER {
> -   TPM_DIGEST DAA_digest_gamma;
> -   BYTE DAA_generic_q[26];
> - } TPM_DAA_ISSUER;
> -+#define sizeof_TPM_DAA_ISSUER(s) (2 + (20 * 6) + 26 )
> -
> - /*
> -  * TPM_DAA_TPM ([TPM_Part2], Section 22.4)
> -@@ -1973,6 +1974,7 @@ typedef struct tdTPM_DAA_TPM {
> -   TPM_DIGEST DAA_rekey;
> -   UINT32 DAA_count;
> - } TPM_DAA_TPM;
> -+#define sizeof_TPM_DAA_TPM(s) (2 + (4 * 20) + 4)
> -
> - /*
> -  * TPM_DAA_CONTEXT ([TPM_Part2], Section 22.5)
> -@@ -1987,6 +1989,7 @@ typedef struct tdTPM_DAA_CONTEXT {
> -   BYTE DAA_scratch[256];
> -   BYTE DAA_stage;
> - } TPM_DAA_CONTEXT;
> -+#define sizeof_TPM_DAA_CONTEXT(s) (2 + (3 * 20) + 256 + 1)
> -
> - /*
> -  * TPM_DAA_JOINDATA ([TPM_Part2], Section 22.6)
> -@@ -1998,6 +2001,7 @@ typedef struct tdTPM_DAA_JOINDATA {
> -   BYTE DAA_join_u1[138];
> -   TPM_DIGEST DAA_digest_n0;
> - } TPM_DAA_JOINDATA;
> -+#define sizeof_TPM_DAA_JOINDATA(s) (1 + 1 + 20)
> -
> - /*
> -  * TPM_DAA_BLOB ([TPM_Part2], Section 22.8)
> -@@ -2202,6 +2206,7 @@ typedef struct tdTPM_STCLEAR_DATA {
> -   //UINT32 ownerReference;
> -   //BOOL disableResetLock;
> - } TPM_STCLEAR_DATA;
> -+#define sizeof_TPM_STCLEAR_DATA(s) (2 + 20 + 4)
> -
> - /*
> -  * TPM_SESSION_DATA
> -@@ -2238,6 +2243,11 @@ typedef struct tdTPM_DAA_SESSION_DATA {
> -   TPM_DAA_JOINDATA DAA_joinSession;
> -   TPM_HANDLE handle;
> - } TPM_DAA_SESSION_DATA;
> -+#define sizeof_TPM_DAA_SESSION_DATA(s) ( 1 \
> -+  + sizeof_TPM_DAA_ISSUER(s.DAA_issuerSettings) \
> -+  + sizeof_TPM_DAA_TPM(s.DAA_tpmSpecific) \
> -+  + sizeof_TPM_DAA_CONTEXT(s.DAA_session) \
> -+  + sizeof_TPM_DAA_JOINDATA(s.DAA_joinSession) + 4)
> -
> - /*
> -  * TPM_STANY_DATA ([TPM_Part2], Section 7.6)
> -@@ -2262,6 +2272,11 @@ typedef struct tdTPM_STANY_DATA {
> -   TPM_DAAHANDLE currentDAA;
> -   TPM_TRANSHANDLE transExclusive;
> - } TPM_STANY_DATA;
> -+#define sizeof_TPM_STANY_DATA(s) (2 + 20 + 20 + 1 \
> -+  + sizeof_TPM_CURRENT_TICKS(s.currentTicks) \
> -+  + 4 + (4 * TPM_MAX_SESSION_LIST) \
> -+  + (sizeof_TPM_SESSION_DATA(s.sessions[0]) * TPM_MAX_SESSION_LIST) \
> -+  + (sizeof_TPM_DAA_SESSION_DATA(s.sessionsDAA[0]) * TPM_MAX_SESSIONS_DAA) + 4)
> -
> - /*
> -  * TPM_DATA
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_testing.c tpm_emulator/tpm/tpm_testing.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_testing.c    2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_testing.c     2006-07-24 14:35:35.000000000 -0700
> -@@ -1,6 +1,7 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -95,24 +96,24 @@ static int tpm_test_sha1(void)
> -   struct {
> -     uint8_t *data; uint32_t repetitions; uint8_t *digest;
> -   } test_cases[] =  {{
> --    "abc", 1,
> --    "\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D"
> -+      (uint8_t*)"abc", 1,
> -+    (uint8_t*)"\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D"
> -   }, {
> --    "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 1,
> --    "\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29\xE5\xE5\x46\x70\xF1"
> -+    (uint8_t*)"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 1,
> -+    (uint8_t*)"\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29\xE5\xE5\x46\x70\xF1"
> -   }, {
> --    "a", 1000000,
> --    "\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F"
> -+    (uint8_t*)"a", 1000000,
> -+    (uint8_t*)"\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F"
> -   }, {
> --    "0123456701234567012345670123456701234567012345670123456701234567", 10,
> --    "\xDE\xA3\x56\xA2\xCD\xDD\x90\xC7\xA7\xEC\xED\xC5\xEB\xB5\x63\x93\x4F\x46\x04\x52"
> -+    (uint8_t*)"0123456701234567012345670123456701234567012345670123456701234567", 10,
> -+    (uint8_t*)"\xDE\xA3\x56\xA2\xCD\xDD\x90\xC7\xA7\xEC\xED\xC5\xEB\xB5\x63\x93\x4F\x46\x04\x52"
> -   }};
> -
> -   debug("tpm_test_sha1()");
> -   for (i = 0; i < sizeof(test_cases) / sizeof(test_cases[0]); i++) {
> -     sha1_init(&ctx);
> -     for (j = 0; j < test_cases[i].repetitions; j++)
> --      sha1_update(&ctx, test_cases[i].data, strlen(test_cases[i].data));
> -+      sha1_update(&ctx, test_cases[i].data, strlen((char*)test_cases[i].data));
> -     sha1_final(&ctx, digest);
> -     if (memcmp(digest, test_cases[i].digest, SHA1_DIGEST_LENGTH) != 0) return -1;
> -   }
> -@@ -128,41 +129,41 @@ static int tpm_test_hmac(void)
> -   struct {
> -     uint8_t *key, key_len, *data, data_len, *digest;
> -   } test_cases[] = {{
> --    "\x0b", 20, "Hi There", 8,
> --    "\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"
> -+    (uint8_t*)"\x0b", 20, (uint8_t*)"Hi There", 8,
> -+    (uint8_t*)"\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"
> -   }, {
> --    "Jefe", 4, "what do ya want for nothing?", 28,
> --    "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79"
> -+    (uint8_t*)"Jefe", 4, (uint8_t*)"what do ya want for nothing?", 28,
> -+    (uint8_t*)"\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79"
> -   }, {
> --    "\xaa", 20, "\xdd", 50,
> --    "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3"
> -+    (uint8_t*)"\xaa", 20, (uint8_t*)"\xdd", 50,
> -+    (uint8_t*)"\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3"
> -   }, {
> --    "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
> --    "\x15\x16\x17\x18\x19", 25, "\xcd", 50,
> --    "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda"
> -+    (uint8_t*)"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
> -+    "\x15\x16\x17\x18\x19", 25, (uint8_t*)"\xcd", 50,
> -+    (uint8_t*)"\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda"
> -   }, {
> --    "\x0c", 20, "Test With Truncation", 20,
> --    "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04"
> -+    (uint8_t*)"\x0c", 20, (uint8_t*)"Test With Truncation", 20,
> -+    (uint8_t*)"\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04"
> -   }, {
> --    "\xaa", 80, "Test Using Larger Than Block-Size Key - Hash Key First", 54,
> --    "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12"
> -+    (uint8_t*)"\xaa", 80, (uint8_t*)"Test Using Larger Than Block-Size Key - Hash Key First", 54,
> -+    (uint8_t*)"\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12"
> -   }, {
> --    "\xaa", 80,
> --    "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", 73,
> --    "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91"
> -+    (uint8_t*)"\xaa", 80,
> -+    (uint8_t*)"Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", 73,
> -+    (uint8_t*)"\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91"
> -   }};
> -
> -   debug("tpm_test_hmac()");
> -   for (i = 0; i < sizeof(test_cases) / sizeof(test_cases[0]); i++) {
> --    if (strlen(test_cases[i].key) < test_cases[i].key_len) {
> -+    if (strlen((char*)test_cases[i].key) < test_cases[i].key_len) {
> -       uint8_t key[test_cases[i].key_len];
> -       memset(key, test_cases[i].key[0], test_cases[i].key_len);
> -       hmac_init(&ctx, key, test_cases[i].key_len);
> -     } else {
> -       hmac_init(&ctx, test_cases[i].key, test_cases[i].key_len);
> -     }
> --    for (j = 0; j < test_cases[i].data_len; j += strlen(test_cases[i].data)) {
> --      hmac_update(&ctx, test_cases[i].data, strlen(test_cases[i].data));
> -+    for (j = 0; j < test_cases[i].data_len; j += strlen((char*)test_cases[i].data)) {
> -+      hmac_update(&ctx, test_cases[i].data, strlen((char*)test_cases[i].data));
> -     }
> -     hmac_final(&ctx, digest);
> -     if (memcmp(digest, test_cases[i].digest, SHA1_DIGEST_LENGTH) != 0) return -1;
> -@@ -173,9 +174,9 @@ static int tpm_test_hmac(void)
> - static int tpm_test_rsa_EK(void)
> - {
> -   int res = 0;
> --  char *data = "RSA PKCS #1 v1.5 Test-String";
> -+  uint8_t *data = (uint8_t*)"RSA PKCS #1 v1.5 Test-String";
> -   uint8_t buf[256];
> --  size_t buf_len, data_len = strlen(data);
> -+  size_t buf_len, data_len = strlen((char*)data);
> -   rsa_private_key_t priv_key;
> -   rsa_public_key_t pub_key;
> -
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_ticks.c tpm_emulator/tpm/tpm_ticks.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_ticks.c      2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_ticks.c       2006-07-24 14:35:35.000000000 -0700
> -@@ -1,6 +1,7 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -39,9 +40,7 @@ TPM_RESULT TPM_SetTickType(TPM_TICKTYPE
> - TPM_RESULT TPM_GetTicks(TPM_CURRENT_TICKS *currentTime)
> - {
> -   info("TPM_GetTicks()");
> --  memcpy(currentTime, &tpmData.stany.data.currentTicks,
> --    sizeof(TPM_CURRENT_TICKS));
> --  return TPM_SUCCESS;
> -+  return TPM_DISABLED_CMD;
> - }
> -
> - TPM_RESULT TPM_TickStampBlob(TPM_KEY_HANDLE keyHandle, TPM_NONCE *antiReplay,
> -@@ -49,64 +48,11 @@ TPM_RESULT TPM_TickStampBlob(TPM_KEY_HAN
> -                              TPM_CURRENT_TICKS *currentTicks,
> -                              UINT32 *sigSize, BYTE **sig)
> - {
> --  TPM_RESULT res;
> --  TPM_KEY_DATA *key;
> --  BYTE *info, *p;
> --  UINT32 info_length, length;
> -   info("TPM_TickStampBlob()");
> --  /* get key */
> --  key = tpm_get_key(keyHandle);
> --  if (key == NULL) return TPM_INVALID_KEYHANDLE;
> --  /* verify authorization */
> --  res = tpm_verify_auth(auth1, key->usageAuth, keyHandle);
> --  if (res != TPM_SUCCESS) return res;
> --  if (key->keyUsage != TPM_KEY_SIGNING && key->keyUsage != TPM_KEY_LEGACY
> --      && key->keyUsage != TPM_KEY_IDENTITY) return TPM_INVALID_KEYUSAGE;
> --  /* get current ticks */
> --  TPM_GetTicks(currentTicks);
> --  /* sign data using signature scheme PKCS1_SHA1 and TPM_SIGN_INFO container */
> --  *sigSize = key->key.size >> 3;
> --  *sig = tpm_malloc(*sigSize);
> --  if (*sig == NULL) return TPM_FAIL;
> --  /* setup TPM_SIGN_INFO structure */
> --  info_length = 30 + sizeof(TPM_DIGEST) + sizeof_TPM_CURRENT_TICKS(currentTicks);
> --  info = tpm_malloc(info_length);
> --  if (info == NULL) {
> --    tpm_free(*sig);
> --    return TPM_FAIL;
> --  }
> --  memcpy(&info[0], "\x05\x00TSTP", 6);
> --  memcpy(&info[6], antiReplay->nonce, 20);
> --  *(UINT32*)&info[26] = CPU_TO_BE32(20
> --                        + sizeof_TPM_CURRENT_TICKS(currentTicks));
> --  memcpy(&info[30], digestToStamp->digest, sizeof(TPM_DIGEST));
> --  p = &info[30 + sizeof(TPM_DIGEST)];
> --  length = sizeof_TPM_CURRENT_TICKS(currentTicks);
> --  if (tpm_marshal_TPM_CURRENT_TICKS(&p, &length, currentTicks)
> --      || rsa_sign(&key->key, RSA_SSA_PKCS1_SHA1, info, info_length, *sig)) {
> --    tpm_free(*sig);
> --    tpm_free(info);
> --    return TPM_FAIL;
> --  }
> --  return TPM_SUCCESS;
> -+  return TPM_DISABLED_CMD;
> - }
> -
> - void tpm_update_ticks(void)
> - {
> --  if (tpmData.stany.data.currentTicks.tag == 0) {
> --    tpmData.stany.data.currentTicks.tag = TPM_TAG_CURRENT_TICKS;
> --    tpmData.stany.data.currentTicks.currentTicks += tpm_get_ticks();
> --/* removed since v1.2 rev 94
> --    tpmData.stany.data.currentTicks.tickType = tpmData.permanent.data.tickType;
> --*/
> --    tpm_get_random_bytes(tpmData.stany.data.currentTicks.tickNonce.nonce,
> --      sizeof(TPM_NONCE));
> --    tpmData.stany.data.currentTicks.tickRate = 1;
> --/* removed since v1.2 rev 94
> --    tpmData.stany.data.currentTicks.tickSecurity = TICK_SEC_NO_CHECK;
> --*/
> --  } else {
> --    tpmData.stany.data.currentTicks.currentTicks += tpm_get_ticks();
> --  }
> - }
> -
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_transport.c tpm_emulator/tpm/tpm_transport.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_transport.c  2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_transport.c   2006-07-24 14:35:35.000000000 -0700
> -@@ -189,7 +189,7 @@ static void decrypt_wrapped_command(BYTE
> -     sha1_init(&sha1);
> -     sha1_update(&sha1, auth->nonceEven.nonce, sizeof(auth->nonceEven.nonce));
> -     sha1_update(&sha1, auth->nonceOdd.nonce, sizeof(auth->nonceOdd.nonce));
> --    sha1_update(&sha1, "in", 2);
> -+    sha1_update(&sha1, (BYTE*)"in", 2);
> -     sha1_update(&sha1, secret, sizeof(TPM_SECRET));
> -     j = CPU_TO_BE32(i);
> -     sha1_update(&sha1, (BYTE*)&j, 4);
> -@@ -211,7 +211,7 @@ static void encrypt_wrapped_command(BYTE
> -     sha1_init(&sha1);
> -     sha1_update(&sha1, auth->nonceEven.nonce, sizeof(auth->nonceEven.nonce));
> -     sha1_update(&sha1, auth->nonceOdd.nonce, sizeof(auth->nonceOdd.nonce));
> --    sha1_update(&sha1, "out", 3);
> -+    sha1_update(&sha1, (BYTE*)"out", 3);
> -     sha1_update(&sha1, secret, sizeof(TPM_SECRET));
> -     j = CPU_TO_BE32(i);
> -     sha1_update(&sha1, (BYTE*)&j, 4);
> -diff -uprN orig/tpm_emulator-0.4/tpmd.c tpm_emulator/tpmd.c
> ---- orig/tpm_emulator-0.4/tpmd.c       1969-12-31 16:00:00.000000000 -0800
> -+++ tpm_emulator/tpmd.c        2006-07-24 14:35:35.000000000 -0700
> -@@ -0,0 +1,156 @@
> -+/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -+ * Copyright (C) 2005 INTEL Corp
> -+ *
> -+ * This module is free software; you can redistribute it and/or modify
> -+ * it under the terms of the GNU General Public License as published
> -+ * by the Free Software Foundation; either version 2 of the License,
> -+ * or (at your option) any later version.
> -+ *
> -+ * This module 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.
> -+ *
> -+ */
> -+
> -+#include <stdio.h>
> -+#include <stdlib.h>
> -+#include <unistd.h>
> -+#include <string.h>
> -+#include <sys/types.h>
> -+#include <sys/stat.h>
> -+#include <fcntl.h>
> -+#include <sys/time.h>
> -+
> -+#include "tpm_emulator.h"
> -+
> -+#define TPM_RX_FNAME "/var/tpm/tpm_in.fifo"
> -+#define TPM_TX_FNAME "/var/tpm/tpm_out.fifo"
> -+
> -+#define BUFFER_SIZE 2048
> -+
> -+static int devurandom=0;
> -+
> -+void get_random_bytes(void *buf, int nbytes) {
> -+
> -+  if (devurandom == 0) {
> -+    devurandom = open("/dev/urandom", O_RDONLY);
> -+  }
> -+
> -+  if (read(devurandom, buf, nbytes) != nbytes) {
> -+      printf("Can't get random number.\n");
> -+      exit(-1);
> -+  }
> -+}
> -+
> -+uint64_t tpm_get_ticks(void)
> -+{
> -+  //struct timeval tv;
> -+  //int gettimeofday(&tv, struct timezone *tz);
> -+  return 0;
> -+}
> -+
> -+int main(int argc, char **argv)
> -+{
> -+  uint8_t in[BUFFER_SIZE], *out;
> -+  uint32_t out_size;
> -+  int in_size, written;
> -+  int i;
> -+  struct stat file_info;
> -+
> -+  int tpm_tx_fh=-1, tpm_rx_fh=-1;
> -+  if (argc < 2) {
> -+    printf("Usage: tpmd clear|save|deactivated\n" );
> -+        return -1;
> -+  }
> -+
> -+  /* initialize TPM emulator */
> -+  if (!strcmp(argv[1], "clear")) {
> -+    printf("Initializing tpm: %s\n", argv[1]);
> -+    tpm_emulator_init(1);
> -+  } else if (!strcmp(argv[1], "save")) {
> -+    printf("Initializing tpm: %s\n", argv[1]);
> -+    tpm_emulator_init(2);
> -+  } else if (!strcmp(argv[1], "deactivated")) {
> -+    printf("Initializing tpm: %s\n", argv[1]);
> -+    tpm_emulator_init(3);
> -+  } else {
> -+    printf("invalid startup mode '%s'; must be 'clear', "
> -+      "'save' (default) or 'deactivated", argv[1]);
> -+    return -1;
> -+  }
> -+
> -+  if ( stat(TPM_RX_FNAME, &file_info) == -1) {
> -+    if ( mkfifo(TPM_RX_FNAME, S_IWUSR | S_IRUSR ) ) {
> -+      printf("Failed to create fifo %s.\n", TPM_RX_FNAME);
> -+      return -1;
> -+    }
> -+  }
> -+
> -+  if ( stat(TPM_TX_FNAME, &file_info) == -1) {
> -+    if ( mkfifo(TPM_TX_FNAME, S_IWUSR | S_IRUSR ) ) {
> -+      printf("Failed to create fifo %s.\n", TPM_TX_FNAME);
> -+      return -1;
> -+    }
> -+  }
> -+
> -+  while (1) {
> -+abort_command:
> -+    if (tpm_rx_fh < 0) {
> -+      tpm_rx_fh = open(TPM_RX_FNAME, O_RDONLY);
> -+    }
> -+
> -+    if (tpm_rx_fh < 0) {
> -+      printf("ERROR: failed to open devices to listen to guest.\n");
> -+      return -1;
> -+    }
> -+
> -+    if (tpm_tx_fh < 0) {
> -+      tpm_tx_fh = open(TPM_TX_FNAME, O_WRONLY);
> -+    }
> -+
> -+    if (tpm_tx_fh < 0) {
> -+      printf("ERROR: failed to open devices to respond to guest.\n");
> -+      return -1;
> -+    }
> -+
> -+    in_size = read(tpm_rx_fh, in, BUFFER_SIZE);
> -+    if (in_size < 6) { // Magic size of minium TPM command
> -+      printf("Recv[%d] to small: 0x", in_size);
> -+      if (in_size <= 0) {
> -+          close(tpm_rx_fh);
> -+          tpm_rx_fh = -1;
> -+          goto abort_command;
> -+      }
> -+    } else {
> -+      printf("Recv[%d]: 0x", in_size);
> -+      for (i=0; i< in_size; i++)
> -+        printf("%x ", in[i]);
> -+      printf("\n");
> -+    }
> -+
> -+
> -+    if (tpm_handle_command(in, in_size, &out, &out_size) != 0) {
> -+        printf("ERROR: Handler Failed.\n");
> -+    }
> -+
> -+    written = write(tpm_tx_fh, out, out_size);
> -+
> -+    if (written != out_size ) {
> -+      printf("ERROR: Part of response not written %d/%d.\nAttempt: ", written, out_size);
> -+    } else {
> -+      printf("Sent[%Zu]: ", out_size);
> -+    }
> -+    for (i=0; i< out_size; i++)
> -+      printf("%x ", out[i]);
> -+    printf("\n");
> -+    tpm_free(out);
> -+
> -+  } // loop
> -+
> -+  tpm_emulator_shutdown();
> -+
> -+  close(tpm_tx_fh);
> -+  close(tpm_rx_fh);
> -+
> -+}
> -Binary files orig/tpm_emulator-0.4/tpm_emulator and tpm_emulator/tpm_emulator differ
> -diff -uprN orig/tpm_emulator-0.4/tpm_version.h tpm_emulator/tpm_version.h
> ---- orig/tpm_emulator-0.4/tpm_version.h        2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm_version.h 2006-07-24 14:35:41.000000000 -0700
> -@@ -2,5 +2,5 @@
> - #define _TPM_VERSION_H_
> - #define VERSION_MAJOR 0
> - #define VERSION_MINOR 4
> --#define VERSION_BUILD 1151058734
> -+#define VERSION_BUILD 1153776940
> - #endif /* _TPM_VERSION_H_ */
> diff --git a/tools/vtpm/vtpm-0.5.1-LDLIBS.patch b/tools/vtpm/vtpm-0.5.1-LDLIBS.patch
> deleted file mode 100644
> index 95586c1..0000000
> --- a/tools/vtpm/vtpm-0.5.1-LDLIBS.patch
> +++ /dev/null
> @@ -1,12 +0,0 @@
> -diff -Naurp tpm_emulator-0.5.1/tpmd/Makefile tpm_emulator-0.5.1/tpmd/Makefile
> ---- tpm_emulator-0.5.1/tpmd/Makefile
> -+++ tpm_emulator-0.5.1/tpmd/Makefile
> -@@ -8,7 +8,7 @@ WFLAGS  := -Wall -Wno-unused -Wpointer-a
> -            #WFLAGS  += -Wextra -Wcast-qual -Wmissing-prototypes -Wmissing-declarations -Wstrict-aliasing
> - CFLAGS  += $(WFLAGS) -g -I.. -I. -O2 -fno-strict-aliasing
> - CFLAGS  += -I../../../../tools/vtpm_manager/manager
> --LDFLAGS += -lgmp
> -+LDLIBS  += -lgmp
> -
> - BINDIR  := /usr/bin/
> -
> diff --git a/tools/vtpm/vtpm-0.5.1.patch b/tools/vtpm/vtpm-0.5.1.patch
> deleted file mode 100644
> index 2aeb745..0000000
> --- a/tools/vtpm/vtpm-0.5.1.patch
> +++ /dev/null
> @@ -1,766 +0,0 @@
> -diff -Naurp tpm_emulator-0.5.1/Makefile tpm5-test/Makefile
> ---- tpm_emulator-0.5.1/Makefile        2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/Makefile 2009-07-15 09:45:28.000000000 -0400
> -@@ -10,7 +10,7 @@ VERSION_MINOR  := 5
> - VERSION_BUILD  := $(shell date +"%s")
> - VERSION_SUFFIX := .1
> -
> --SUBDIRS := tpmd tpmd_dev tddl
> -+SUBDIRS := tpmd
> -
> - all: version all-recursive
> -
> -@@ -48,12 +48,12 @@ user_install: user
> - modules_install: modules
> -       @$(MAKE) -C tpmd_dev install || exit -1
> -
> --DIRS    := . tpm crypto tpmd tpmd_dev tddl tpmd_dev_openbsd
> -+DIRS    := . tpm crypto tpmd
> - DISTSRC := $(foreach dir, $(DIRS), $(wildcard $(dir)/*.c))
> - DISTSRC += $(foreach dir, $(DIRS), $(wildcard $(dir)/*.h))
> --DIRS    := . tpmd tpmd_dev tddl tpmd_dev_openbsd
> -+DIRS    := . tpmd
> - DISTSRC += $(foreach dir, $(DIRS), $(dir)/Makefile)
> --DISTSRC += ./README ./AUTHORS ./ChangeLog tpmd_dev/tpmd_dev.rules.in
> -+DISTSRC += ./README ./AUTHORS ./ChangeLog
> - DISTDIR := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_SUFFIX)
> -
> - dist: $(DISTSRC)
> -diff -Naurp tpm_emulator-0.5.1/tpm/tpm_capability.c tpm5-test/tpm/tpm_capability.c
> ---- tpm_emulator-0.5.1/tpm/tpm_capability.c    2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/tpm/tpm_capability.c     2009-07-16 12:04:20.000000000 -0400
> -@@ -136,8 +136,19 @@ static TPM_RESULT cap_property(UINT32 su
> -
> -     case TPM_CAP_PROP_TIS_TIMEOUT:
> -       debug("[TPM_CAP_PROP_TIS_TIMEOUT]");
> --      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT */
> --      return TPM_FAIL;
> -+      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT: Measure these values and determine correct ones */
> -+      UINT32 len = *respSize = 16;
> -+      BYTE *ptr = *resp = tpm_malloc(*respSize);
> -+      if (ptr == NULL ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000)) {
> -+        tpm_free(*resp);
> -+        return TPM_FAIL;
> -+      }
> -+      return TPM_SUCCESS;
> -+
> -
> -     case TPM_CAP_PROP_STARTUP_EFFECT:
> -       debug("[TPM_CAP_PROP_STARTUP_EFFECT]");
> -@@ -189,8 +200,12 @@ static TPM_RESULT cap_property(UINT32 su
> -
> -     case TPM_CAP_PROP_DURATION:
> -       debug("[TPM_CAP_PROP_DURATION]");
> --      /* TODO: TPM_CAP_PROP_DURATION */
> --      return TPM_FAIL;
> -+      /* TODO: TPM_CAP_PROP_DURATION: Measure these values and return accurate ones */
> -+      BYTE dur[]= {0x0,0x0,0x0,0xc,0x0,0x7,0xa1,0x20,0x0,0x1e,0x84,0x80,0x11,0xe1,0xa3,0x0};
> -+      *respSize = 16;
> -+      *resp = tpm_malloc(*respSize);
> -+      memcpy(*resp,dur,16);
> -+
> -
> -     case TPM_CAP_PROP_ACTIVE_COUNTER:
> -       debug("[TPM_CAP_PROP_ACTIVE_COUNTER]");
> -diff -Naurp tpm_emulator-0.5.1/tpmd/Makefile tpm5-test/tpmd/Makefile
> ---- tpm_emulator-0.5.1/tpmd/Makefile   2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/tpmd/Makefile    2009-07-16 12:08:26.000000000 -0400
> -@@ -8,9 +8,10 @@ WFLAGS  := -Wall -Wno-unused -Wpointer-a
> -            -Wwrite-strings -Wsign-compare -Wno-multichar
> -            #WFLAGS  += -Wextra -Wcast-qual -Wmissing-prototypes -Wmissing-declarations -Wstrict-aliasing
> - CFLAGS  += $(WFLAGS) -g -I.. -I. -O2 -fno-strict-aliasing
> -+CFLAGS  += -I../../../../tools/vtpm_manager/manager
> - LDFLAGS += -lgmp
> -
> --BINDIR  := /usr/sbin/
> -+BINDIR  := /usr/bin/
> -
> - TPMD    := tpmd
> - DIRS    := ../tpm ../crypto
> -@@ -18,6 +19,8 @@ SRCS    := $(foreach dir, $(DIRS), $(wil
> - OBJS    := $(patsubst %.c, %.o, $(SRCS))
> - OBJS    := $(foreach dir, $(DIRS), $(patsubst $(dir)/%.o, %.o, $(filter $(dir)/%.o, $(OBJS))))
> -
> -+VTPM_BIN := vtpmd
> -+
> - vpath %.c $(strip $(DIRS))
> -
> - all: $(TPMD)
> -@@ -32,10 +35,8 @@ TPMD_GROUP ?= tss
> - INSTALL    ?= install
> -
> - install: $(TPMD)
> --      $(INSTALL) -m 755 -o $(TPMD_USER) -g $(TPMD_GROUP) -d $(DESTDIR)/var/lib/tpm
> --      $(INSTALL) -m 755 -o $(TPMD_USER) -g $(TPMD_GROUP) -d $(DESTDIR)/var/run/tpm
> -       $(INSTALL) -D -d $(DESTDIR)/$(BINDIR)
> --      $(INSTALL) -m 755 $(TPMD) $(DESTDIR)/$(BINDIR)
> -+      $(INSTALL) -m 755 $(TPMD) $(DESTDIR)/$(BINDIR)/$(VTPM_BIN)
> -
> - .PHONY: all clean install
> -
> -diff -Naurp tpm_emulator-0.5.1/tpmd/tpmd.c tpm5-test/tpmd/tpmd.c
> ---- tpm_emulator-0.5.1/tpmd/tpmd.c     2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/tpmd/tpmd.c      2009-07-16 11:19:05.000000000 -0400
> -@@ -32,6 +32,9 @@
> - #include <grp.h>
> - #include "tpm_emulator_config.h"
> - #include "tpm/tpm_emulator.h"
> -+#include "tpm/tpm_structures.h"
> -+#include "tpm/tpm_marshalling.h"
> -+#include "vtpm_manager.h"
> -
> - #define TPM_DAEMON_NAME     "tpmd"
> - #define TPM_CMD_BUF_SIZE    4096
> -@@ -39,6 +42,24 @@
> - #define TPM_RANDOM_DEVICE   "/dev/urandom"
> - #undef  TPM_MKDIRS
> -
> -+#ifdef VTPM_MULTI_VM
> -+ #define DEV_BE "/dev/vtpm"
> -+ #define DEV_FE "/dev/tpm"
> -+#else
> -+ #define PVM_RX_FIFO_D "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
> -+ #define PVM_TX_FIFO "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
> -+ #define HVM_RX_FIFO_D "/var/vtpm/socks/%d.socket"
> -+
> -+ #define VTPM_RX_FIFO_D "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
> -+ #define VTPM_TX_FIFO "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
> -+
> -+ static char *vtpm_rx_name=NULL;
> -+#endif
> -+
> -+ static int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> -+
> -+#define BUFFER_SIZE 2048
> -+
> - static volatile int stopflag = 0;
> - static int is_daemon = 0;
> - static int opt_debug = 0;
> -@@ -49,6 +70,8 @@ static const char *opt_storage_file = "/
> - static uid_t opt_uid = 0;
> - static gid_t opt_gid = 0;
> - static int tpm_startup = 2;
> -+static int vtpm_type = VTPM_TYPE_PVM;
> -+int dmi_id = 0;
> - static int rand_fh;
> -
> - void tpm_log(int priority, const char *fmt, ...)
> -@@ -90,56 +113,241 @@ uint64_t tpm_get_ticks(void)
> -
> - int tpm_write_to_file(uint8_t *data, size_t data_length)
> - {
> --    int fh;
> --    ssize_t res;
> --    fh = open(opt_storage_file, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> --    if (fh < 0) return -1;
> --    while (data_length > 0) {
> --        res = write(fh, data, data_length);
> --      if (res < 0) {
> --          close(fh);
> --          return -1;
> --      }
> --      data_length -= res;
> --      data += res;
> -+  int res, out_data_size, in_header_size;
> -+  BYTE *ptr, *out_data, *in_header;
> -+  UINT32 result, len, in_rsp_size;
> -+  UINT16 tag = VTPM_TAG_REQ;
> -+
> -+  printf("Saving NVM\n");
> -+  if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> -+#else
> -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_tx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Send request to VTPM Manager to encrypt data
> -+#ifdef VTPM_MUTLI_VM
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT + data_length;
> -+#else
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV + data_length;
> -+#endif
> -+
> -+  out_data = ptr = (BYTE *) malloc(len);
> -+
> -+  if (ptr == NULL
> -+#ifndef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> -+#endif
> -+        || tpm_marshal_UINT16(&ptr, &len, tag)
> -+#ifdef VTPM_MUTLI_VM
> -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> -+#else
> -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> -+#endif
> -+        || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_SAVENVM)
> -+        || tpm_marshal_BYTE_ARRAY(&ptr, &len, data, data_length)) {
> -+      free(out_data);
> -+      return -1;
> -+  }
> -+
> -+  printf("\tSending SaveNVM Command.\n");
> -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> -+  free(out_data);
> -+  if (res != out_data_size) return -1;
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_rx_fh = vtpm_tx_fh
> -+#else
> -+    if (vtpm_rx_name == NULL) {
> -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> -     }
> --    close(fh);
> --    return 0;
> -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Read Header of response so we can get the size & status
> -+#ifdef VTPM_MUTLI_VM
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  in_header = ptr = malloc(in_header_size);
> -+
> -+  printf("\tReading SaveNVM header.\n");
> -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> -+
> -+  if ( (res != in_header_size)
> -+#ifndef VTPM_MUTLI_VM
> -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> -+#endif
> -+         || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> -+         || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> -+         || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> -+        free(in_header);
> -+        return -1;
> -+  }
> -+  free(in_header);
> -+
> -+  if (result != VTPM_SUCCESS) {
> -+      return -1;
> -+  }
> -+
> -+#ifdef VTPM_MUTLI_VM
> -+  close(vtpm_tx_fh); close(vtpm_rx_fh);
> -+#endif
> -+
> -+  printf("\tFinishing up SaveNVM\n");
> -+  return (0);
> - }
> -
> - int tpm_read_from_file(uint8_t **data, size_t *data_length)
> - {
> --    int fh;
> --    ssize_t res;
> --    size_t total_length;
> --    fh = open(opt_storage_file, O_RDONLY);
> --    if (fh < 0) return -1;
> --    total_length = lseek(fh, 0, SEEK_END);
> --    lseek(fh, 0, SEEK_SET);
> --    *data = tpm_malloc(total_length);
> --    if (*data == NULL) {
> --        close(fh);
> --        return -1;
> --    }
> --    *data_length = 0;
> --    while (total_length > 0) {
> --        res = read(fh, &(*data)[*data_length], total_length);
> --      if (res < 0) {
> --          close(fh);
> --          tpm_free(*data);
> --          return -1;
> --      }
> --        *data_length += res;
> --      total_length -= res;
> -+  int res, out_data_size, in_header_size;
> -+  uint8_t *ptr, *out_data, *in_header;
> -+  UINT16 tag = VTPM_TAG_REQ;
> -+  UINT32 len, in_rsp_size, result;
> -+#ifdef VTPM_MUTLI_VM
> -+      int vtpm_rx_fh, vtpm_tx_fh;
> -+#endif
> -+
> -+  printf("Loading NVM.\n");
> -+  if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> -+#else
> -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_tx_fh < 0) {
> -+      printf("Error in read_from_file:301\n");
> -+              return -1;
> -+  }
> -+
> -+  // Send request to VTPM Manager to encrypt data
> -+#ifdef VTPM_MUTLI_VM
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  out_data = ptr = (BYTE *) malloc(len);
> -+
> -+  if (ptr == NULL
> -+#ifndef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> -+#endif
> -+      || tpm_marshal_UINT16(&ptr, &len, tag)
> -+#ifdef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> -+#else
> -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> -+#endif
> -+      || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_LOADNVM)) {
> -+    free(out_data);
> -+    printf("Error in read_from_file:325\n");
> -+
> -+    return -1;
> -+  }
> -+
> -+  printf("\tSending LoadNVM command\n");
> -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> -+  free(out_data);
> -+  if (res != out_data_size)
> -+    {
> -+      printf("Error in read_from_file:335\n");
> -+      return -1;
> -+    }
> -+
> -+    if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_rx_fh = vtpm_tx_fh;
> -+#else
> -+    if (vtpm_rx_name == NULL) {
> -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> -     }
> --    close(fh);
> --    return 0;
> -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+      printf("Error in read_from_file:352\n");
> -+      return -1;
> -+  }
> -+
> -+  // Read Header of response so we can get the size & status
> -+#ifdef VTPM_MUTLI_VM
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  in_header = ptr = malloc(in_header_size);
> -+
> -+  printf("\tReading LoadNVM header\n");
> -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> -+
> -+  if ( (res != in_header_size)
> -+#ifndef VTPM_MUTLI_VM
> -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> -+#endif
> -+       || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> -+       || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> -+       || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> -+      free(in_header);
> -+      printf("Error in read_from_file:375\n");
> -+      return -1;
> -+  }
> -+  free(in_header);
> -+
> -+  if (result != VTPM_SUCCESS) {
> -+    printf("Error in read_from_file:381\n");
> -+    return -1;
> -+  }
> -+
> -+  // Read Encrypted data from VTPM Manager
> -+  *data_length = in_rsp_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> -+  *data = (uint8_t *) malloc(*data_length);
> -+
> -+  printf("\tReading clear data from LoadNVM.\n");
> -+  res = read(vtpm_rx_fh, *data, *data_length);
> -+#ifdef VTPM_MUTLI_VM
> -+  close(vtpm_rx_fh);close(vtpm_tx_fh);
> -+#endif
> -+
> -+  printf("\tReturing from loading NVM\n");
> -+  if (res != (int)*data_length) {
> -+      free(*data);
> -+      printf("Error in read_from_file:398\n");
> -+      return -1;
> -+  } else {
> -+      return 0;
> -+  }
> -+
> -+
> -+
> - }
> -
> - static void print_usage(char *name)
> - {
> -     printf("usage: %s [-d] [-f] [-s storage file] [-u unix socket name] "
> --           "[-o user name] [-g group name] [-h] [startup mode]\n", name);
> -+           "[-o user name] [-g group name] [-h]"
> -+#ifdef VTPM_MULTI_VM
> -+         "clear|save|deactivated\n", name);
> -+#else
> -+         "clear|save|deactivated pvm|hvm vtpmid\n", name);
> -+#endif
> -     printf("  d : enable debug mode\n");
> -     printf("  f : forces the application to run in the foreground\n");
> -     printf("  s : storage file to use (default: %s)\n", opt_storage_file);
> -@@ -205,7 +413,13 @@ static void parse_options(int argc, char
> -                 exit(EXIT_SUCCESS);
> -         }
> -     }
> --    if (optind < argc) {
> -+    /*Make sure we have all required options*/
> -+#ifdef VTPM_MULTI_VM
> -+#define EXTRA_OPTS 0
> -+#else
> -+#define EXTRA_OPTS 2
> -+#endif
> -+    if (optind < argc - EXTRA_OPTS ) {
> -         debug("startup mode = '%s'", argv[optind]);
> -         if (!strcmp(argv[optind], "clear")) {
> -             tpm_startup = 1;
> -@@ -219,6 +433,25 @@ static void parse_options(int argc, char
> -             print_usage(argv[0]);
> -             exit(EXIT_SUCCESS);
> -         }
> -+#ifndef VTPM_MULTI_VM
> -+        ++optind;
> -+      if(!strcmp(argv[optind], "pvm")) {
> -+              vtpm_type = VTPM_TYPE_PVM;      // Get commands from vTPM Manager through fifo
> -+      } else if (!strcmp(argv[optind], "hvm")) {
> -+              vtpm_type = VTPM_TYPE_HVM;      // Get commands from qemu via socket
> -+        } else {
> -+              error("Invalid vm mode '%s'; must be 'pvm', "
> -+                      "or 'hvm' ", argv[optind]);
> -+              print_usage(argv[0]);
> -+              exit(EXIT_SUCCESS);
> -+      }
> -+        ++optind;
> -+      dmi_id = atoi(argv[optind]);
> -+#endif
> -+    } else {
> -+      error("Invalid number of arguments");
> -+      print_usage(argv[0]);
> -+      exit(EXIT_SUCCESS);
> -     }
> - }
> -
> -@@ -348,93 +581,180 @@ static int init_socket(const char *name)
> -
> - static void main_loop(void)
> - {
> --    int sock, fh, res;
> --    int32_t in_len;
> -+    int32_t in_len, written;
> -     uint32_t out_len;
> --    uint8_t in[TPM_CMD_BUF_SIZE], *out;
> -+    uint8_t in[TPM_CMD_BUF_SIZE], *out, *addressed_out;
> -+    int guest_id=-1;
> -+    int i;
> -+    char *vtpm_rx_file=NULL;
> -+    int res;
> -+
> -+#ifndef VTPM_MULTI_VM
> -+    int sockfd = -1;
> -     struct sockaddr_un addr;
> --    socklen_t addr_len;
> --    fd_set rfds;
> --    struct timeval tv;
> -+    struct sockaddr_un client_addr;
> -+    unsigned int client_length;
> -+#endif
> -+
> -+    int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> -+
> -+#ifndef VTPM_MULTI_VM
> -+  if (vtpm_type == VTPM_TYPE_PVM) {
> -+    vtpm_rx_file = malloc(10 + strlen(PVM_RX_FIFO_D));
> -+    sprintf(vtpm_rx_file, PVM_RX_FIFO_D, (uint32_t) dmi_id);
> -+  } else {
> -+    vtpm_rx_file = malloc(10 + strlen(HVM_RX_FIFO_D));
> -+    sprintf(vtpm_rx_file, HVM_RX_FIFO_D, (uint32_t) dmi_id);
> -+
> -+    if ( (sockfd = socket(PF_UNIX,SOCK_STREAM,0)) < 0) {
> -+          error("Unable to create socket. errno = %d\n", errno);
> -+      exit (-1);
> -+    }
> -+
> -+    memset(&addr, 0, sizeof(addr));
> -+    addr.sun_family = AF_UNIX;
> -+    strcpy(addr.sun_path,vtpm_rx_file );
> -+    unlink(addr.sun_path);
> -+  }
> -+#endif
> -
> -     info("staring main loop");
> --    /* open UNIX socket */
> --    sock = init_socket(opt_socket_name);
> --    if (sock < 0) exit(EXIT_FAILURE);
> -     /* init tpm emulator */
> --    debug("initializing TPM emulator: %d", tpm_startup);
> -+#ifdef VTPM_MULTI_VM
> -+    debug("initializing TPM emulator: state=%d", tpm_startup);
> -+#else
> -+    debug("initializing TPM emulator: state=%d, type=%d, id=%d", tpm_startup, vtpm_type, dmi_id);
> -+#endif
> -     tpm_emulator_init(tpm_startup);
> -     /* start command processing */
> -     while (!stopflag) {
> -         /* wait for incomming connections */
> -         debug("waiting for connections...");
> --        FD_ZERO(&rfds);
> --        FD_SET(sock, &rfds);
> --        tv.tv_sec = 10;
> --        tv.tv_usec = 0;
> --        res = select(sock + 1, &rfds, NULL, NULL, &tv);
> --        if (res < 0) {
> --            error("select(sock) failed: %s", strerror(errno));
> --            break;
> --        } else if (res == 0) {
> --            continue;
> --        }
> --        addr_len = sizeof(addr);
> --        fh = accept(sock, (struct sockaddr*)&addr, &addr_len);
> --        if (fh < 0) {
> --            error("accept() failed: %s", strerror(errno));
> --            continue;
> --        }
> -+      if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+          vtpm_rx_fh = open(DEV_BE, O_RDWR);
> -+#else
> -+          if (vtpm_type == VTPM_TYPE_PVM)
> -+          {
> -+              vtpm_rx_fh = open(vtpm_rx_file, O_RDONLY);
> -+          } else {
> -+              if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
> -+                  error("Unable to bind(). errno = %d\n", errno);
> -+                  exit (-1);
> -+              }
> -+
> -+              if (listen(sockfd, 10) <0) {
> -+                  error("Unable to listen(). errno = %d\n", errno);
> -+                  exit (-1);
> -+              }
> -+
> -+               memset(&client_addr, 0, sizeof(client_addr));
> -+               client_length = sizeof(client_addr);
> -+
> -+               vtpm_rx_fh = vtpm_tx_fh = accept(sockfd, (struct sockaddr *)&client_addr, &client_length);
> -+          }
> -+#endif
> -+      }
> -+
> -+      /*Error Checking*/
> -+      if (vtpm_rx_fh < 0) {
> -+        error("Failed to open devices to listen to guest.\n");
> -+        exit(-1);
> -+      }
> -+
> -         /* receive and handle commands */
> -         in_len = 0;
> -         do {
> -             debug("waiting for commands...");
> --            FD_ZERO(&rfds);
> --            FD_SET(fh, &rfds);
> --            tv.tv_sec = TPM_COMMAND_TIMEOUT;
> --            tv.tv_usec = 0;
> --            res = select(fh + 1, &rfds, NULL, NULL, &tv);
> --            if (res < 0) {
> --                error("select(fh) failed: %s", strerror(errno));
> --                close(fh);
> --                break;
> --            } else if (res == 0) {
> --#ifdef TPMD_DISCONNECT_IDLE_CLIENTS
> --                info("connection closed due to inactivity");
> --                close(fh);
> --                break;
> --#else
> --                continue;
> --#endif
> --            }
> --            in_len = read(fh, in, sizeof(in));
> --            if (in_len > 0) {
> -+
> -+            in_len = read(vtpm_rx_fh, in, sizeof(in));
> -+          /*Magic size of minimum TPM command is 6*/
> -+              //FIXME Magic size check may not be required anymore
> -+            if (in_len < 6) {
> -+              info("Recv incomplete command of %d bytes.", in_len);
> -+              if (in_len <= 0) {
> -+                  close(vtpm_rx_fh);
> -+                  vtpm_rx_fh = -1;
> -+                  continue;
> -+                 }
> -+          } else {
> -+              /*Debug Printouts*/
> -                 debug("received %d bytes", in_len);
> -+              debug_nostop("Recv[%d]: 0x", in_len);
> -+              for (i=0; i< in_len; i++)
> -+                  debug_more("%x ", in[i]);
> -+              debug_more("\n");
> -+              /*Multiple Guest check*/
> -+              if (guest_id == -1) {
> -+                  guest_id = *((int32_t *) in);
> -+              } else {
> -+                  if (guest_id != *((int32_t *) in) ) {
> -+                      error("WARNING: More than one guest attached\n");
> -+                  }
> -+              }
> -+
> -+              /*Open tx handle now*/
> -+              if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+                  vtpm_tx_fh = open(DEV_BE, O_RDWR);
> -+                  vtpm_rx_fh = vtpm_tx_fh;
> -+#else
> -+                  if (vtpm_type == VTPM_TYPE_PVM) {
> -+                      vtpm_tx_fh = open(PVM_TX_FIFO, O_WRONLY);
> -+                  } // No need to open the other direction for HVM
> -+#endif
> -+              }
> -+              if (vtpm_tx_fh < 0) {
> -+                error("Failed to open devices to respond to guest.\n");
> -+                exit(-1);
> -+              }
> -+
> -+              /*Handle the TPM command now*/
> -                 out = NULL;
> --                res = tpm_handle_command(in, in_len, &out, &out_len);
> -+                res = tpm_handle_command(in + sizeof(uint32_t), in_len - sizeof(uint32_t), &out, &out_len);
> -                 if (res < 0) {
> -                     error("tpm_handle_command() failed");
> -                 } else {
> -                     debug("sending %d bytes", out_len);
> -+                  //FIXME this prepending may or may not be needed
> -+                  /*Prepend the first 4 bytes of the in buffer.. why?*/
> -+                  addressed_out = (uint8_t *) tpm_malloc(sizeof(uint32_t) + out_len);
> -+                  *(uint32_t *) addressed_out = *(uint32_t *) in;
> -+                  memcpy(addressed_out + sizeof(uint32_t), out, out_len);
> -+                  out_len += sizeof(uint32_t);
> -+                  /*End Prepend*/
> -+
> -+                  /*Perform write operation now*/
> -                     while (out_len > 0) {
> --                        res = write(fh, out, out_len);
> -+                        res = write(vtpm_tx_fh, addressed_out, out_len);
> -+
> -                         if (res < 0) {
> -                             error("write(%d) failed: %s", out_len, strerror(errno));
> -                             break;
> --                        }
> -+                        } else {
> -+                        debug_nostop("Sent[%Zu]: ", out_len);
> -+                        for (i=0; (unsigned int)i< out_len; i++)
> -+                          debug_more("%x ", addressed_out[i]);
> -+                        debug_more("\n");
> -+                      }
> -                         out_len       -= res;
> -                     }
> -                     tpm_free(out);
> -+                  tpm_free(addressed_out);
> -                 }
> -             }
> -         } while (in_len > 0);
> --        close(fh);
> -+        //close(fh);
> -     }
> -+
> -     /* shutdown tpm emulator */
> -     tpm_emulator_shutdown();
> --    /* close socket */
> --    close(sock);
> --    unlink(opt_socket_name);
> -+    /* Close handles */
> -+    close(vtpm_tx_fh);
> -+#ifndef VTPM_MULTI_VM
> -+    close(vtpm_rx_fh);
> -+    free(vtpm_rx_file);
> -+#endif
> -     info("main loop stopped");
> - }
> -
> -@@ -450,12 +770,13 @@ int main(int argc, char **argv)
> -     /* open random device */
> -     init_random();
> -     /* init signal handlers */
> --    init_signal_handler();
> -+    //init_signal_handler();
> -     /* unless requested otherwiese, fork and daemonize process */
> --    if (!opt_foreground) daemonize();
> -+    //if (!opt_foreground) daemonize();
> -     /* start main processing loop */
> -     main_loop();
> -     info("stopping TPM Emulator daemon");
> -     closelog();
> -     return 0;
> - }
> -+
> -diff -Naurp tpm_emulator-0.5.1/tpmd/tpm_emulator_config.h tpm5-test/tpmd/tpm_emulator_config.h
> ---- tpm_emulator-0.5.1/tpmd/tpm_emulator_config.h      2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/tpmd/tpm_emulator_config.h       2009-07-16 11:25:26.000000000 -0400
> -@@ -29,23 +29,28 @@
> -
> - /* TPM emulator configuration */
> -
> --#undef  TPM_STRONG_PERSISTENCE
> --#undef  TPM_GENERATE_EK
> -+#define  TPM_STRONG_PERSISTENCE
> -+#define  TPM_GENERATE_EK
> - #undef  TPM_GENERATE_SEED_DAA
> - #undef  TPM_MEMORY_ALIGNMENT_MANDATORY
> -
> -+extern int dmi_id;
> -+
> - /* log macros */
> -
> - void tpm_log(int priority, const char *fmt, ...);
> -
> --#define debug(fmt, ...) tpm_log(LOG_DEBUG, "%s:%d: Debug: " fmt "\n", \
> --                                __FILE__, __LINE__, ## __VA_ARGS__)
> --#define info(fmt, ...)  tpm_log(LOG_INFO, "%s:%d: Info: " fmt "\n", \
> --                                __FILE__, __LINE__, ## __VA_ARGS__)
> --#define error(fmt, ...) tpm_log(LOG_ERR, "%s:%d: Error: " fmt "\n", \
> --                                __FILE__, __LINE__, ## __VA_ARGS__)
> --#define alert(fmt, ...) tpm_log(LOG_ALERT, "%s:%d: Alert: " fmt "\n", \
> --                                __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug(fmt, ...) tpm_log(LOG_DEBUG, "VTPMD[%d]: %s:%d: Debug: " fmt "\n", \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define info(fmt, ...)  tpm_log(LOG_INFO, "VTPMD[%d]: %s:%d: Info: " fmt "\n", \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define error(fmt, ...) tpm_log(LOG_ERR, "VTPMD[%d]: %s:%d: Error: " fmt "\n", \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define alert(fmt, ...) tpm_log(LOG_ALERT, "VTPMD[%d]: %s:%d: Alert: " fmt "\n", \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug_nostop(fmt, ...) tpm_log(LOG_DEBUG, "VTPMD[%d]: %s:%d: Debug: " fmt, \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug_more(fmt, ...) tpm_log(LOG_DEBUG, fmt, ## __VA_ARGS__)
> -
> - /*  min/max macros that also do strict type-checking */
> -
> diff --git a/tools/vtpm/vtpm.patch b/tools/vtpm/vtpm.patch
> deleted file mode 100644
> index e896b25..0000000
> --- a/tools/vtpm/vtpm.patch
> +++ /dev/null
> @@ -1,716 +0,0 @@
> -diff -uprN tpm_emulator/AUTHORS vtpm/AUTHORS
> ---- tpm_emulator/AUTHORS       2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/AUTHORS       2006-12-13 16:38:52.000000000 -0800
> -@@ -1,3 +1,3 @@
> - Mario Strasser <mast@gmx.net>
> - Heiko Stamer <stamer@gaos.org> [DAA]
> --INTEL Corp <> [Dropped to Ring3]
> -+INTEL Corp <> [VTPM Extensions]
> -diff -uprN tpm_emulator/ChangeLog vtpm/ChangeLog
> ---- tpm_emulator/ChangeLog     2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/ChangeLog     2006-12-13 16:38:52.000000000 -0800
> -@@ -1,5 +1,6 @@
> - ????-??-?? Intel Corp
> -       * Moved module out of kernel to run as a ring 3 app
> -+      * Modified save_to_file and load_from_file to call xen VTPM manager
> -
> - 2006-06-23  Mario Strasser <mast@gmx.net>
> -       * tpm_startup.c: behaviour of ST_CLEAR and storage of
> -diff -uprN tpm_emulator/linux_module.h vtpm/linux_module.h
> ---- tpm_emulator/linux_module.h        2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/linux_module.h        2007-01-09 14:49:06.000000000 -0800
> -@@ -44,18 +44,26 @@
> - #define TPM_DEVICE_NAME   "tpm"
> - #define TPM_MODULE_NAME   "tpm_emulator"
> -
> -+/* debug and log output functions */
> -+extern int dmi_id;
> -+
> - #ifdef DEBUG
> --#define debug(fmt, ...) printf("TPMD: %s:%d: Debug: " fmt "\n", \
> --                        __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug(fmt, ...) printf("TPMD[%d]: %s:%d: Debug: " fmt "\n", \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug_nostop(fmt, ...) printf("TPMD[%d]: %s:%d: Debug: " fmt, \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug_more(fmt, ...) printf( fmt, ## __VA_ARGS__ )
> - #else
> - #define debug(fmt, ...)
> -+#define debug_nostop(fmt, ...)
> -+#define debug_more(fmt, ...)
> - #endif
> --#define info(fmt, ...)  printf("TPMD: %s:%d: Info: " fmt "\n", \
> --                        __FILE__, __LINE__, ## __VA_ARGS__)
> --#define error(fmt, ...) printf("TPMD: %s:%d: Error: " fmt "\n", \
> --                        __FILE__, __LINE__, ## __VA_ARGS__)
> --#define alert(fmt, ...) printf("TPMD: %s:%d: Alert: " fmt "\n", \
> --                        __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define info(fmt, ...)  printf("TPMD[%d]: %s:%d: Info: " fmt "\n", \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define error(fmt, ...) printf("TPMD[%d]: %s:%d: Error: " fmt "\n", \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define alert(fmt, ...) printf("TPMD[%d]: %s:%d: Alert: " fmt "\n", \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -
> - /* memory allocation */
> -
> -diff -uprN tpm_emulator/Makefile vtpm/Makefile
> ---- tpm_emulator/Makefile      2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/Makefile      2006-12-13 16:38:52.000000000 -0800
> -@@ -7,7 +7,7 @@
> - COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
> -
> - # module settings
> --BIN            := tpm_emulator
> -+BIN            := vtpmd
> - VERSION_MAJOR  := 0
> - VERSION_MINOR  := 4
> - VERSION_BUILD  := $(shell date +"%s")
> -@@ -22,7 +22,7 @@ TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin
> -
> - CC      := gcc
> - CFLAGS  += -g -Wall $(INCLUDE) -DDEBUG
> --CFLAGS  += -I. -Itpm
> -+CFLAGS  += -I. -Itpm -I../../vtpm_manager/manager
> -
> - # Is the simulator running in it's own vm?
> - #CFLAGS += -DVTPM_MULTI_VM
> -@@ -62,7 +62,6 @@ $(BIN):      $(src)/crypto/gmp.h $(src)/crypt
> -
> - install: $(BIN)
> -       $(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)
> --      @if [ ! -d "/var/tpm" ]; then mkdir /var/tpm; fi
> -
> - clean:
> -       rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a $(OBJS)
> -@@ -98,3 +97,4 @@ version:
> -       @echo "#endif /* _TPM_VERSION_H_ */" >> $(src)/tpm_version.h
> -
> - .PHONY: all install clean dist gmp version
> -+
> -diff -uprN tpm_emulator/tpm/tpm_capability.c vtpm/tpm/tpm_capability.c
> ---- tpm_emulator/tpm/tpm_capability.c  2006-06-23 03:37:07.000000000 -0700
> -+++ vtpm/tpm/tpm_capability.c  2007-01-10 10:00:49.000000000 -0800
> -@@ -136,8 +136,18 @@ static TPM_RESULT cap_property(UINT32 su
> -
> -     case TPM_CAP_PROP_TIS_TIMEOUT:
> -       debug("[TPM_CAP_PROP_TIS_TIMEOUT]");
> --      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT */
> --      return TPM_FAIL;
> -+      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT: Measure these values and determine correct ones */
> -+      UINT32 len = *respSize = 16;
> -+      BYTE *ptr = *resp = tpm_malloc(*respSize);
> -+      if (ptr == NULL ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000)) {
> -+        tpm_free(*resp);
> -+        return TPM_FAIL;
> -+      }
> -+      return TPM_SUCCESS;
> -
> -     case TPM_CAP_PROP_STARTUP_EFFECT:
> -       debug("[TPM_CAP_PROP_STARTUP_EFFECT]");
> -@@ -190,7 +200,11 @@ static TPM_RESULT cap_property(UINT32 su
> -
> -     case TPM_CAP_PROP_DURATION:
> -       debug("[TPM_CAP_PROP_DURATION]");
> --      /* TODO: TPM_CAP_PROP_DURATION */
> -+      /* TODO: TPM_CAP_PROP_DURATION: Measure these values and return accurate ones */
> -+      BYTE dur[]= {0x0,0x0,0x0,0xc,0x0,0x7,0xa1,0x20,0x0,0x1e,0x84,0x80,0x11,0xe1,0xa3,0x0};
> -+      *respSize = 16;
> -+      *resp = tpm_malloc(*respSize);
> -+      memcpy(*resp,dur,16);
> -       return TPM_FAIL;
> -
> -     case TPM_CAP_PROP_ACTIVE_COUNTER:
> -diff -uprN tpm_emulator/tpm/tpm_cmd_handler.c vtpm/tpm/tpm_cmd_handler.c
> ---- tpm_emulator/tpm/tpm_cmd_handler.c 2008-02-27 16:35:41.000000000 -0500
> -+++ vtpm/tpm/tpm_cmd_handler.c 2008-02-28 14:43:28.000000000 -0500
> -@@ -94,12 +94,18 @@ void tpm_compute_out_param_digest(TPM_CO
> -   sha1_ctx_t sha1;
> -   UINT32 res = CPU_TO_BE32(rsp->result);
> -   UINT32 ord = CPU_TO_BE32(ordinal);
> -+  UINT32 offset = 0;
> -
> -   /* compute SHA1 hash */
> -   sha1_init(&sha1);
> -   sha1_update(&sha1, (BYTE*)&res, 4);
> -   sha1_update(&sha1, (BYTE*)&ord, 4);
> --  sha1_update(&sha1, rsp->param, rsp->paramSize);
> -+  if (ordinal == TPM_ORD_LoadKey2) {
> -+      offset = 4;
> -+  }
> -+  if (rsp->paramSize - offset > 0) {
> -+      sha1_update(&sha1, rsp->param + offset, rsp->paramSize - offset);
> -+  }
> -   sha1_final(&sha1, rsp->auth1->digest);
> -   if (rsp->auth2 != NULL) memcpy(rsp->auth2->digest,
> -     rsp->auth1->digest, sizeof(rsp->auth1->digest));
> -diff -uprN tpm_emulator/tpm/tpm_data.c vtpm/tpm/tpm_data.c
> ---- tpm_emulator/tpm/tpm_data.c        2008-02-27 16:35:41.000000000 -0500
> -+++ vtpm/tpm/tpm_data.c        2008-02-27 16:35:40.000000000 -0500
> -@@ -1,6 +1,7 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -15,10 +16,15 @@
> -  * $Id: tpm_data.c 98 2006-05-07 14:16:29Z hstamer $
> -  */
> -
> -+#include <sys/types.h>
> -+#include <sys/stat.h>
> -+#include <fcntl.h>
> -+#include <unistd.h>
> -+
> - #include "tpm_emulator.h"
> - #include "tpm_structures.h"
> - #include "tpm_marshalling.h"
> --#include "linux_module.h"
> -+#include "vtpm_manager.h"
> -
> - TPM_DATA tpmData;
> -
> -@@ -158,45 +164,232 @@ void tpm_release_data(void)
> - #include <sys/types.h>
> - #include <sys/stat.h>
> - #include <fcntl.h>
> --#include <unistd.h>
> -
> --#define TPM_STORAGE_FILE "/var/tpm/tpm_emulator-1.2." STR(VERSION_MAJOR) "." STR(VERSION_MINOR)
> -+ static int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> -+
> -+#ifdef VTPM_MUTLI_VM
> -+ #define DEV_FE "/dev/tpm"
> -+#else
> -+ #define VTPM_RX_FIFO_D  "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
> -+ #define VTPM_TX_FIFO  "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
> -+
> -+ extern int dmi_id;
> -+ static char *vtpm_rx_name=NULL;
> -+#endif
> -
> - static int write_to_file(uint8_t *data, size_t data_length)
> - {
> --  int res;
> --  int fp;
> --  fp = open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> --  res = write(fp, data, data_length);
> --  close(fp);
> --  return (res == data_length) ? 0 : -1;
> -+  int res, out_data_size, in_header_size;
> -+  BYTE *ptr, *out_data, *in_header;
> -+  UINT32 result, len, in_rsp_size;
> -+  UINT16 tag = VTPM_TAG_REQ;
> -+
> -+  printf("Saving NVM\n");
> -+  if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> -+#else
> -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_tx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Send request to VTPM Manager to encrypt data
> -+#ifdef VTPM_MUTLI_VM
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT + data_length;
> -+#else
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV + data_length;
> -+#endif
> -+
> -+  out_data = ptr = (BYTE *) malloc(len);
> -+
> -+  if (ptr == NULL
> -+#ifndef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> -+#endif
> -+        || tpm_marshal_UINT16(&ptr, &len, tag)
> -+#ifdef VTPM_MUTLI_VM
> -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> -+#else
> -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> -+#endif
> -+        || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_SAVENVM)
> -+        || tpm_marshal_BYTE_ARRAY(&ptr, &len, data, data_length)) {
> -+      free(out_data);
> -+      return -1;
> -+  }
> -+
> -+  printf("\tSending SaveNVM Command.\n");
> -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> -+  free(out_data);
> -+  if (res != out_data_size) return -1;
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_rx_fh = vtpm_tx_fh
> -+#else
> -+    if (vtpm_rx_name == NULL) {
> -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> -+    }
> -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Read Header of response so we can get the size & status
> -+#ifdef VTPM_MUTLI_VM
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  in_header = ptr = malloc(in_header_size);
> -+
> -+  printf("\tReading SaveNVM header.\n");
> -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> -+
> -+  if ( (res != in_header_size)
> -+#ifndef VTPM_MUTLI_VM
> -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> -+#endif
> -+         || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> -+         || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> -+         || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> -+        free(in_header);
> -+        return -1;
> -+  }
> -+  free(in_header);
> -+
> -+  if (result != VTPM_SUCCESS) {
> -+      return -1;
> -+  }
> -+
> -+#ifdef VTPM_MUTLI_VM
> -+  close(vtpm_tx_fh); close(vtpm_rx_fh);
> -+#endif
> -+
> -+  printf("\tFinishing up SaveNVM\n");
> -+  return (0);
> - }
> -
> - static int read_from_file(uint8_t **data, size_t *data_length)
> - {
> --  int res;
> --  int fp, file_status;
> --  struct stat file_info;
> --  fp = open(TPM_STORAGE_FILE, O_RDONLY, 0);
> --  file_status = fstat(fp, &file_info);
> --  if (file_status < 0) {
> --    close(fp);
> --    return -1;
> --  }
> -+  int res, out_data_size, in_header_size;
> -+  uint8_t *ptr, *out_data, *in_header;
> -+  UINT16 tag = VTPM_TAG_REQ;
> -+  UINT32 len, in_rsp_size, result;
> -+#ifdef VTPM_MUTLI_VM
> -+      int vtpm_rx_fh, vtpm_tx_fh;
> -+#endif
> -+
> -+  printf("Loading NVM.\n");
> -+  if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> -+#else
> -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> -+#endif
> -+  }
> -
> --  *data_length = file_info.st_size;
> --  *data = tpm_malloc(*data_length);
> --  if (*data == NULL) {
> --    close(fp);
> -+  if (vtpm_tx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Send request to VTPM Manager to encrypt data
> -+#ifdef VTPM_MUTLI_VM
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  out_data = ptr = (BYTE *) malloc(len);
> -+
> -+  if (ptr == NULL
> -+#ifndef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> -+#endif
> -+      || tpm_marshal_UINT16(&ptr, &len, tag)
> -+#ifdef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> -+#else
> -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> -+#endif
> -+      || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_LOADNVM)) {
> -+    free(out_data);
> -     return -1;
> -   }
> --  res = read(fp, *data, *data_length);
> --  close(fp);
> -+
> -+  printf("\tSending LoadNVM command\n");
> -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> -+  free(out_data);
> -+  if (res != out_data_size) return -1;
> -+
> -+    if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_rx_fh = vtpm_tx_fh;
> -+#else
> -+    if (vtpm_rx_name == NULL) {
> -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> -+    }
> -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Read Header of response so we can get the size & status
> -+#ifdef VTPM_MUTLI_VM
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  in_header = ptr = malloc(in_header_size);
> -+
> -+  printf("\tReading LoadNVM header\n");
> -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> -+
> -+  if ( (res != in_header_size)
> -+#ifndef VTPM_MUTLI_VM
> -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> -+#endif
> -+       || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> -+       || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> -+       || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> -+      free(in_header);
> -+      return -1;
> -+  }
> -+  free(in_header);
> -+
> -+  if (result != VTPM_SUCCESS) {
> -+      return -1;
> -+  }
> -+
> -+  // Read Encrypted data from VTPM Manager
> -+  *data_length = in_rsp_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> -+  *data = (uint8_t *) malloc(*data_length);
> -+
> -+  printf("\tReading clear data from LoadNVM.\n");
> -+  res = read(vtpm_rx_fh, *data, *data_length);
> -+#ifdef VTPM_MUTLI_VM
> -+  close(vtpm_rx_fh);close(vtpm_tx_fh);
> -+#endif
> -+
> -+  printf("\tReturing from loading NVM\n");
> -   if (res != *data_length) {
> --    tpm_free(*data);
> --    return -1;
> -+      free(*data);
> -+      return -1;
> -+  } else {
> -+      return 0;
> -   }
> --  return 0;
> -+
> - }
> -
> - #else
> -diff -uprN tpm_emulator/tpmd.c vtpm/tpmd.c
> ---- tpm_emulator/tpmd.c        2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/tpmd.c        2007-01-09 14:48:56.000000000 -0800
> -@@ -21,12 +21,24 @@
> - #include <sys/stat.h>
> - #include <fcntl.h>
> - #include <sys/time.h>
> -+#include <sys/socket.h>
> -+#include <sys/un.h>
> -+#include <errno.h>
> -
> - #include "tpm_emulator.h"
> -+#include "vtpm_manager.h"
> -
> --#define TPM_RX_FNAME "/var/tpm/tpm_in.fifo"
> --#define TPM_TX_FNAME "/var/tpm/tpm_out.fifo"
> -+#ifdef VTPM_MULTI_VM
> -+ #define DEV_BE "/dev/vtpm"
> -+#else
> -+ #define PVM_RX_FIFO_D "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
> -+ #define PVM_TX_FIFO "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
> -
> -+ #define HVM_RX_FIFO_D "/var/vtpm/socks/%d.socket"
> -+#endif
> -+
> -+ int dmi_id;
> -+
> - #define BUFFER_SIZE 2048
> -
> - static int devurandom=0;
> -@@ -38,7 +50,7 @@ void get_random_bytes(void *buf, int nby
> -   }
> -
> -   if (read(devurandom, buf, nbytes) != nbytes) {
> --      printf("Can't get random number.\n");
> -+      error("Can't get random number.\n");
> -       exit(-1);
> -   }
> - }
> -@@ -52,105 +64,182 @@ uint64_t tpm_get_ticks(void)
> -
> - int main(int argc, char **argv)
> - {
> --  uint8_t in[BUFFER_SIZE], *out;
> -+  uint8_t type, in[BUFFER_SIZE], *out, *addressed_out;
> -+  char *vtpm_rx_file=NULL;
> -   uint32_t out_size;
> -   int in_size, written;
> --  int i;
> --  struct stat file_info;
> -+  int i, guest_id=-1;
> -
> --  int tpm_tx_fh=-1, tpm_rx_fh=-1;
> -+#ifndef VTPM_MULTI_VM
> -+  int sockfd = -1;
> -+  struct sockaddr_un addr;
> -+  struct sockaddr_un client_addr;
> -+  unsigned int client_length;
> -+
> -+#endif
> -+
> -+  int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> -+#ifdef VTPM_MULTI_VM
> -   if (argc < 2) {
> --    printf("Usage: tpmd clear|save|deactivated\n" );
> -+    error("Usage: tpmd clear|save|deactivated\n" );
> -+#else
> -+  if (argc < 4) {
> -+    error("Usage: tpmd clear|save|deactivated pvm|hvm vtpmid\n" );
> -+#endif
> -         return -1;
> -   }
> -
> -+#ifndef VTPM_MULTI_VM
> -+  /* setup type of vm */
> -+  if (!strcmp(argv[2], "pvm")) {
> -+    type = VTPM_TYPE_PVM; // Get commands from vTPM Manager through fifo
> -+  } else if (!strcmp(argv[2], "hvm")) {
> -+    type = VTPM_TYPE_HVM; // Get commands from qemu via socket
> -+  } else {
> -+    error("invalid vTPM type '%s'.\n", argv[2]);
> -+  }
> -+
> -+  dmi_id = atoi(argv[3]);
> -+
> -+  if (type == VTPM_TYPE_PVM) {
> -+    vtpm_rx_file = malloc(10 + strlen(PVM_RX_FIFO_D));
> -+    sprintf(vtpm_rx_file, PVM_RX_FIFO_D, (uint32_t) dmi_id);
> -+  } else {
> -+    vtpm_rx_file = malloc(10 + strlen(HVM_RX_FIFO_D));
> -+    sprintf(vtpm_rx_file, HVM_RX_FIFO_D, (uint32_t) dmi_id);
> -+
> -+    if ( (sockfd = socket(PF_UNIX,SOCK_STREAM,0)) < 0) {
> -+          error("Unable to create socket. errno = %d\n", errno);
> -+      exit (-1);
> -+    }
> -+
> -+    memset(&addr, 0, sizeof(addr));
> -+    addr.sun_family = AF_UNIX;
> -+    strcpy(addr.sun_path,vtpm_rx_file );
> -+    unlink(addr.sun_path);
> -+  }
> -+#endif
> -+
> -+#ifdef VTPM_MULTI_VM
> -+  info("Initializing tpm state: %s\n", argv[1]);
> -+#else
> -+  info("Initializing tpm state: %s, type: %s, id: %d\n", argv[1], argv[2], dmi_id);
> -+#endif
> -+
> -   /* initialize TPM emulator */
> -   if (!strcmp(argv[1], "clear")) {
> --    printf("Initializing tpm: %s\n", argv[1]);
> -     tpm_emulator_init(1);
> --  } else if (!strcmp(argv[1], "save")) {
> --    printf("Initializing tpm: %s\n", argv[1]);
> -+  } else if (!strcmp(argv[1], "save")) {
> -     tpm_emulator_init(2);
> -   } else if (!strcmp(argv[1], "deactivated")) {
> --    printf("Initializing tpm: %s\n", argv[1]);
> -     tpm_emulator_init(3);
> -   } else {
> --    printf("invalid startup mode '%s'; must be 'clear', "
> -+    error("invalid startup mode '%s'; must be 'clear', "
> -       "'save' (default) or 'deactivated", argv[1]);
> -     return -1;
> -   }
> --
> --  if ( stat(TPM_RX_FNAME, &file_info) == -1) {
> --    if ( mkfifo(TPM_RX_FNAME, S_IWUSR | S_IRUSR ) ) {
> --      printf("Failed to create fifo %s.\n", TPM_RX_FNAME);
> --      return -1;
> --    }
> --  }
> --
> --  if ( stat(TPM_TX_FNAME, &file_info) == -1) {
> --    if ( mkfifo(TPM_TX_FNAME, S_IWUSR | S_IRUSR ) ) {
> --      printf("Failed to create fifo %s.\n", TPM_TX_FNAME);
> --      return -1;
> --    }
> --  }
> --
> -+
> -   while (1) {
> - abort_command:
> --    if (tpm_rx_fh < 0) {
> --      tpm_rx_fh = open(TPM_RX_FNAME, O_RDONLY);
> -+    if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+      vtpm_rx_fh = open(DEV_BE, O_RDWR);
> -+#else
> -+      if (type == VTPM_TYPE_PVM) {
> -+        vtpm_rx_fh = open(vtpm_rx_file, O_RDONLY);
> -+      } else {
> -+        if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
> -+          error("Unable to bind(). errno = %d\n", errno);
> -+          exit (-1);
> -+        }
> -+
> -+        if (listen(sockfd, 10) <0) {
> -+          error("Unable to listen(). errno = %d\n", errno);
> -+          exit (-1);
> -+        }
> -+
> -+        memset(&client_addr, 0, sizeof(client_addr));
> -+        client_length = sizeof(client_addr);
> -+
> -+        vtpm_rx_fh = vtpm_tx_fh = accept(sockfd, (struct sockaddr *)&client_addr, &client_length);
> -+      }
> -+#endif
> -     }
> -
> --    if (tpm_rx_fh < 0) {
> --      printf("ERROR: failed to open devices to listen to guest.\n");
> -+    if (vtpm_rx_fh < 0) {
> -+      error("Failed to open devices to listen to guest.\n");
> -       return -1;
> -     }
> -
> --    if (tpm_tx_fh < 0) {
> --      tpm_tx_fh = open(TPM_TX_FNAME, O_WRONLY);
> --    }
> --
> --    if (tpm_tx_fh < 0) {
> --      printf("ERROR: failed to open devices to respond to guest.\n");
> --      return -1;
> --    }
> --
> --    in_size = read(tpm_rx_fh, in, BUFFER_SIZE);
> -+    in_size = read(vtpm_rx_fh, in, BUFFER_SIZE);
> -     if (in_size < 6) { // Magic size of minium TPM command
> --      printf("Recv[%d] to small: 0x", in_size);
> -+      info("Recv incomplete command of %d bytes.", in_size);
> -       if (in_size <= 0) {
> --          close(tpm_rx_fh);
> --          tpm_rx_fh = -1;
> -+          close(vtpm_rx_fh);
> -+          vtpm_rx_fh = -1;
> -           goto abort_command;
> -       }
> -     } else {
> --      printf("Recv[%d]: 0x", in_size);
> -+      debug_nostop("Recv[%d]: 0x", in_size);
> -       for (i=0; i< in_size; i++)
> --        printf("%x ", in[i]);
> --      printf("\n");
> -+        debug_more("%x ", in[i]);
> -+      debug_more("\n");
> -     }
> -
> --
> --    if (tpm_handle_command(in, in_size, &out, &out_size) != 0) {
> --        printf("ERROR: Handler Failed.\n");
> -+    if (guest_id == -1) {
> -+        guest_id = *((uint32_t *) in);
> -+    } else {
> -+        if (guest_id != *((uint32_t *) in) ) {
> -+            error("WARNING: More than one guest attached\n");
> -+        }
> -+    }
> -+
> -+    if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+      vtpm_tx_fh = open(DEV_BE, O_RDWR);
> -+      vtpm_rx_fh = vtpm_tx_fh;
> -+#else
> -+      if (type == VTPM_TYPE_PVM) {
> -+        vtpm_tx_fh = open(PVM_TX_FIFO, O_WRONLY);
> -+      } // No need to open the other direction for HVM
> -+#endif
> -+    }
> -+
> -+    if (vtpm_tx_fh < 0) {
> -+      error("Failed to open devices to respond to guest.\n");
> -+      return -1;
> -+    }
> -+
> -+    // Handle the command, but skip the domain id header
> -+    if (tpm_handle_command(in + sizeof(uint32_t), in_size - sizeof(uint32_t), &out, &out_size) != 0) {
> -+      error("Handler Failed.\n");
> -     }
> -
> --    written = write(tpm_tx_fh, out, out_size);
> -+    addressed_out = (uint8_t *) tpm_malloc(sizeof(uint32_t) + out_size);
> -+    *(uint32_t *) addressed_out = *(uint32_t *) in;
> -+    memcpy(addressed_out + sizeof(uint32_t), out, out_size);
> -+
> -+    written = write(vtpm_tx_fh, addressed_out, out_size + sizeof(uint32_t));
> -
> --    if (written != out_size ) {
> --      printf("ERROR: Part of response not written %d/%d.\nAttempt: ", written, out_size);
> -+    if (written != out_size + sizeof(uint32_t)) {
> -+      error("Part of response not written %d/%d.\n", written, out_size);
> -     } else {
> --      printf("Sent[%Zu]: ", out_size);
> -+      debug_nostop("Sent[%Zu]: ", out_size + sizeof(uint32_t));
> -+      for (i=0; i< out_size+ sizeof(uint32_t); i++)
> -+        debug_more("%x ", addressed_out[i]);
> -+      debug_more("\n");
> -     }
> --    for (i=0; i< out_size; i++)
> --      printf("%x ", out[i]);
> --    printf("\n");
> -     tpm_free(out);
> -+    tpm_free(addressed_out);
> -
> -   } // loop
> -
> -   tpm_emulator_shutdown();
> -
> --  close(tpm_tx_fh);
> --  close(tpm_rx_fh);
> -+  close(vtpm_tx_fh);
> -+#ifndef VTPM_MUTLI_VM
> -+  close(vtpm_rx_fh);
> -+  free (vtpm_rx_file);
> -+#endif
> -
> - }
> diff --git a/tools/vtpm_manager/COPYING b/tools/vtpm_manager/COPYING
> deleted file mode 100644
> index c4b86b7..0000000
> --- a/tools/vtpm_manager/COPYING
> +++ /dev/null
> @@ -1,32 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> diff --git a/tools/vtpm_manager/Makefile b/tools/vtpm_manager/Makefile
> deleted file mode 100644
> index 632f41b..0000000
> --- a/tools/vtpm_manager/Makefile
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../..
> -
> -# Base definitions and rules
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -SUBDIRS                = crypto tcs util manager migration
> -OPENSSL_HEADER = /usr/include/openssl/crypto.h
> -
> -.PHONY: all clean install
> -all clean install: %: subdirs-%
> -
> -.PHONY: mrproper
> -mrproper:
> -       @set -e; for subdir in $(SUBDIRS); do \
> -               $(MAKE) -C $$subdir $@; \
> -       done
> -
> -
> diff --git a/tools/vtpm_manager/README b/tools/vtpm_manager/README
> deleted file mode 100644
> index f0d1e98..0000000
> --- a/tools/vtpm_manager/README
> +++ /dev/null
> @@ -1,94 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -Directory Structure
> -===================
> -tools/vtpm_manager/crypto    -> crypto files
> -tools/vtpm_manager/TCS       -> TCS implementation
> -tools/vtpm_manager/util      -> Utility Library. Include disk-io and buffers.
> -tools/vtpm_manager/manager   -> VTPM Manager
> -
> -Compile Flags
> -===================
> -LOGGING_MODULES              -> How extensive logging happens
> -                                see util/log.h for more info
> -
> -VTPM_MULTI_VM                -> Defined: VTPMs run in their own VMs
> -                                Not Defined (default): VTPMs are processes
> -
> -# Debugging flags that may disappear without notice in the future
> -
> -DUMMY_BACKEND                -> vtpm_manager listens on /tmp/in.fifo and
> -                                /tmp/out.fifo rather than backend
> -
> -MANUAL_DM_LAUNCH             -> Must manually launch & kill VTPMs
> -
> -WELL_KNOWN_OWNER_AUTH        -> Rather than randomly generating the password for the owner,
> -                                use a well known value. This is useful for debugging and for
> -                                poor bios which do not support clearing TPM if OwnerAuth is
> -                                lost. However this has no protection from malicious app
> -                                issuing a TPM_OwnerClear to wipe the TPM
> -
> -Requirements
> -============
> -- xen-unstable
> -- vtpm frontend/backend driver patch
> -- OpenSSL Library
> -
> -Single-VM Flow
> -============================
> -- Launch the VTPM manager (vtpm_managerd) which which begins listening to the BE with one thread
> -  and listens to a named fifo that is shared by the vtpms to commuincate with the manager.
> -- VTPM Manager listens to TPM BE.
> -- When xend launches a tpm frontend equipped VM it contacts the manager over the vtpm backend.
> -- When the manager receives the open message from the BE, it launches a vtpm
> -- Xend allows the VM to continue booting.
> -- When a TPM request is issued to the front end, the front end transmits the TPM request to the backend.
> -- The manager receives the TPM requests and uses a named fifo to forward the request to the vtpm.
> -- The fifo listener begins listening for the reply from vtpm for the request.
> -- Vtpm processes request and replies to manager over shared named fifo.
> -- If needed, the vtpm may send a request to the vtpm_manager at any time to save it's secrets to disk.
> -- Manager receives response from vtpm and passes it back to backend for forwarding to guest.
> -
> -NOTES:
> -* SaveService SHOULD seal it's table before saving it to disk. However,
> -  the current Xen infrastructure does not provide a mechanism for this to be
> -  unsealed later. Specifically, the auth and wrapped key must be available ONLY
> -  to the service, or it's not even worth encrypting
> -
> -  In the future the vtpm manager will be protected by an early boot mechanism
> -  that will allow for better protection of it's data.
> -
> -TODO:
> -- Timeout on crashed vtpms
> -- create lock for shared fifo for talking to vtpms.
> diff --git a/tools/vtpm_manager/Rules.mk b/tools/vtpm_manager/Rules.mk
> deleted file mode 100644
> index 651772b..0000000
> --- a/tools/vtpm_manager/Rules.mk
> +++ /dev/null
> @@ -1,59 +0,0 @@
> -# Base definitions and rules (XEN_ROOT must be defined in including Makefile)
> -include $(XEN_ROOT)/tools/Rules.mk
> -
> -#
> -# Tool definitions
> -#
> -
> -# General compiler flags
> -CFLAGS = -Werror -g3
> -
> -# Generic project files
> -HDRS   = $(wildcard *.h)
> -SRCS   = $(wildcard *.c)
> -OBJS   = $(patsubst %.c,%.o,$(SRCS))
> -
> -# Generic (non-header) dependencies
> -$(SRCS): Makefile $(XEN_ROOT)/tools/Rules.mk $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -$(OBJS): $(SRCS)
> -
> --include $(FILES)
> -
> -# Make sure these are just rules
> -.PHONY : all build install clean
> -
> -#
> -# Project-specific definitions
> -#
> -
> -# Need UNIX98 spec for pthread rwlocks
> -CFLAGS += -D_GNU_SOURCE
> -
> -# Logging Level. See utils/tools.h for usage
> -CFLAGS += -DLOGGING_MODULES="(BITMASK(VTPM_LOG_TCS)|BITMASK(VTPM_LOG_VTSP)|BITMASK(VTPM_LOG_VTPM))"
> -
> -# Silent Mode
> -#CFLAGS += -DLOGGING_MODULES=0x0
> -#CFLAGS += -DLOGGING_MODULES=0xff
> -
> -# Use frontend/backend pairs between manager & DMs?
> -#CFLAGS += -DVTPM_MULTI_VM
> -
> -# vtpm_manager listens on fifo's rather than backend
> -#CFLAGS += -DDUMMY_BACKEND
> -
> -# TCS talks to fifo's rather than /dev/tpm. TPM Emulator assumed on fifos
> -#CFLAGS += -DDUMMY_TPM
> -
> -# Do not have manager launch DMs.
> -#CFLAGS += -DMANUAL_DM_LAUNCH
> -
> -# Fixed OwnerAuth
> -#CFLAGS += -DWELL_KNOWN_OWNER_AUTH
> -
> -# Include
> -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/crypto
> -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/util
> -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/tcs
> -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/manager
> diff --git a/tools/vtpm_manager/crypto/Makefile b/tools/vtpm_manager/crypto/Makefile
> deleted file mode 100644
> index 13b61c9..0000000
> --- a/tools/vtpm_manager/crypto/Makefile
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -BIN            = libtcpaCrypto.a
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIN)
> -
> -.PHONY: install
> -install: build
> -
> -.PHONY: clean
> -clean:
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIN): $(OBJS)
> -       $(AR) rcs $(BIN) $(OBJS)
> diff --git a/tools/vtpm_manager/crypto/crypto.c b/tools/vtpm_manager/crypto/crypto.c
> deleted file mode 100644
> index 7dae655..0000000
> --- a/tools/vtpm_manager/crypto/crypto.c
> +++ /dev/null
> @@ -1,88 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// crypto.c
> -//
> -//  This file will handle all the TPM Crypto functionality
> -//
> -// ==================================================================
> -
> -#include <string.h>
> -#include <openssl/crypto.h>
> -#include <openssl/err.h>
> -#include <openssl/evp.h>
> -#include <openssl/rand.h>
> -#include "crypto.h"
> -#include "log.h"
> -
> -/**
> - * Initialize cryptography library
> - * @rand: random seed
> - * @size: size of @rand
> - */
> -void Crypto_Init(const BYTE* rand, int size) {
> -       ERR_load_crypto_strings();
> -  CRYPTO_malloc_init();
> -  OpenSSL_add_all_algorithms();
> -  SYM_CIPHER = EVP_aes_128_cbc();
> -  RAND_poll();
> -  if (rand == NULL)
> -    return;
> -
> -  RAND_add(rand, size, size);
> -}
> -
> -/**
> - * Shutdown cryptography library
> - */
> -void Crypto_Exit() {
> -  ERR_free_strings();
> -  ERR_remove_state(0);
> -  EVP_cleanup();
> -}
> -
> -
> -/**
> - * Get random data
> - * @data: (OUT) Random data
> - * @size: Size of @data
> - */
> -void Crypto_GetRandom(void* data, int size) {
> -  int result;
> -
> -  result = RAND_pseudo_bytes((BYTE*) data, size);
> -
> -  if (result <= 0)
> -    vtpmlogerror (VTPM_LOG_CRYPTO, "RAND_pseudo_bytes failed: %s\n",
> -            ERR_error_string (ERR_get_error(), NULL));
> -}
> diff --git a/tools/vtpm_manager/crypto/crypto.h b/tools/vtpm_manager/crypto/crypto.h
> deleted file mode 100644
> index 488d4d6..0000000
> --- a/tools/vtpm_manager/crypto/crypto.h
> +++ /dev/null
> @@ -1,175 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// crypto.h
> -//
> -//  This file defines the TPM Crypto API
> -//
> -// ==================================================================
> -
> -#ifndef __CRYPTO_H__
> -#define __CRYPTO_H__
> -
> -#include <stddef.h>
> -#include <stdint.h>
> -#include <stdbool.h>
> -
> -#include "tcg.h"
> -#include "sym_crypto.h"
> -
> -#define CRYPTO_MAX_SIG_SIZE (2048 / 8)
> -#define CRYPTO_MAX_RSA_KEY_SIZE (4096 / 8) //in bytes
> -
> -#define OAEP_P "TCPA"
> -#define OAEP_P_SIZE 4
> -
> -// Algorithms supported by crypto. Stored in CRYPTO_INFO.algorithmID
> -#define CRYPTO_ALGORITH_RSA 0x01
> -
> -// Supported Encryption Schemes CRYPTO_INFO.encScheme
> -#define CRYPTO_ES_NONE 0x0001
> -#define CRYPTO_ES_RSAESPKCSv15 0x0002
> -#define CRYPTO_ES_RSAESOAEP_SHA1_MGF1 0x0003
> -
> -// Supported Signature schemes CRYPTO_INFO.sigScheme
> -#define CRYPTO_SS_NONE 0x0001
> -#define CRYPTO_SS_RSASSAPKCS1v15_SHA1 0x0002
> -#define CRYPTO_SS_RSASSAPKCS1v15_DER 0x0003
> -
> -typedef struct CRYPTO_INFO {
> -  void *keyInfo;
> -  UINT32 algorithmID;
> -  UINT32 encScheme;
> -  UINT32 sigScheme;
> -} CRYPTO_INFO;
> -
> -
> -void Crypto_Init(const BYTE* rand, int size);
> -
> -void Crypto_Exit();
> -
> -void Crypto_GetRandom(void* data, int size);
> -
> -void Crypto_HMAC(   const BYTE* text,
> -                    int text_len,
> -                    const BYTE* key,
> -                    int key_len,
> -                    BYTE* digest);
> -
> -TPM_RESULT Crypto_HMAC_buf (const buffer_t * text,
> -                            const buffer_t * key,
> -                            BYTE * o_digest); /* presumably of 20 bytes */
> -
> -void Crypto_SHA1Full(   const BYTE* text,
> -                        UINT32 size,
> -                        BYTE* hash); //Complete 3part SHA1
> -
> -// o_hash needs to be large enough to hold the digest, ie 20 bytes
> -TPM_RESULT Crypto_SHA1Full_buf (const buffer_t * buf,
> -                                BYTE * o_hash);
> -
> -void Crypto_SHA1Start(UINT32* maxNumBytes);
> -void Crypto_SHA1Update(int numBytes, const BYTE* hashData);
> -void Crypto_SHA1Complete(   int hashDataSize,
> -                            const BYTE* hashData,
> -                            BYTE* hashValue);
> -
> -void Crypto_RSACreateKey(   /*in*/ UINT32 keySize,
> -                            /*in*/ UINT32 pubExpSize,
> -                            /*in*/ BYTE *pubExp,
> -                            /*out*/ UINT32 *privExpSize,
> -                            /*out*/ BYTE *privExp,
> -                            /*out*/ UINT32 *modulusSize,
> -                            /*out*/ BYTE *modulus,
> -                            /*out*/ CRYPTO_INFO *keys);
> -
> -void Crypto_RSABuildCryptoInfo( /*[IN]*/ UINT32 pubExpSize,
> -                                /*[IN]*/ BYTE *pubExp,
> -                                /*[IN]*/ UINT32 privExpSize,
> -                                /*[IN]*/ BYTE *privExp,
> -                                /*[IN]*/ UINT32 modulusSize,
> -                                /*[IN]*/ BYTE *modulus,
> -                                /*[OUT]*/ CRYPTO_INFO* cryptoInfo);
> -
> -void Crypto_RSABuildCryptoInfoPublic(   /*[IN]*/ UINT32 pubExpSize,
> -                                        /*[IN]*/ BYTE *pubExp,
> -                                        /*[IN]*/ UINT32 modulusSize,
> -                                        /*[IN]*/ BYTE *modulus,
> -                                        CRYPTO_INFO* cryptoInfo);
> -
> -//
> -// symmetric pack and unpack operations
> -//
> -TPM_RESULT Crypto_RSAPackCryptoInfo (const CRYPTO_INFO* cryptoInfo,
> -                                     BYTE ** io_buf, UINT32 * io_buflen);
> -
> -TPM_RESULT Crypto_RSAUnpackCryptoInfo (CRYPTO_INFO * ci,
> -                                       BYTE * in, UINT32 len,
> -                                       UINT32 * o_lenread);
> -
> -
> -// return 0 on success, -1 on error
> -int Crypto_RSAEnc(  CRYPTO_INFO *keys,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *outDataSize,
> -                    /*out*/ BYTE *outData);
> -
> -// return 0 on success, -1 on error
> -int Crypto_RSADec(  CRYPTO_INFO *keys,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *outDataSize,
> -                    /*out*/ BYTE *outData);
> -
> -// return 0 on success, -1 on error
> -int Crypto_RSASign( CRYPTO_INFO *keys,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *sigSize,
> -                    /*out*/ BYTE *sig);
> -
> -bool Crypto_RSAVerify(  CRYPTO_INFO *keys,
> -                        UINT32 inDataSize,
> -                        BYTE *inData,
> -                        UINT32 sigSize,
> -                        BYTE *sig);
> -
> -//private:
> -int RSA_verify_DER(int dtype, unsigned char *m, unsigned int m_len,
> -                   unsigned char *sigbuf, unsigned int siglen, CRYPTO_INFO *key);
> -
> -int RSA_sign_DER(int type, unsigned char *m, unsigned int m_len,
> -              unsigned char *sigret, unsigned int *siglen, CRYPTO_INFO *key);
> -
> -#endif // __CRYPTO_H__
> diff --git a/tools/vtpm_manager/crypto/hash.c b/tools/vtpm_manager/crypto/hash.c
> deleted file mode 100644
> index c73114a..0000000
> --- a/tools/vtpm_manager/crypto/hash.c
> +++ /dev/null
> @@ -1,153 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// hash.c
> -//
> -//  This file will handle all the TPM Hash functionality
> -//
> -// ==================================================================
> -
> -#include <string.h>
> -#include <openssl/crypto.h>
> -#include <openssl/err.h>
> -#include <openssl/evp.h>
> -#include <openssl/rand.h>
> -#include <openssl/hmac.h>
> -#include <openssl/sha.h>
> -#include <openssl/bn.h>
> -#include <openssl/rsa.h>
> -
> -#include "tcg.h"         // for TPM_SUCCESS
> -#include "crypto.h"
> -
> -static SHA_CTX g_shaContext;
> -
> -void Crypto_HMAC(   const BYTE* text,
> -                    int text_len,
> -                    const BYTE* key,
> -                    int key_len,
> -                    BYTE* digest) {
> -  if (text == NULL || key == NULL || text_len == 0 || key_len == 0)
> -    return;
> -
> -  HMAC(EVP_sha1(), key, key_len, text, text_len, digest, NULL);
> -}
> -
> -TPM_RESULT Crypto_HMAC_buf (const buffer_t * text,
> -                           const buffer_t * key,
> -                           BYTE * o_digest) { /* presumably of 20 bytes */
> -
> -  Crypto_HMAC (text->bytes, text->size,
> -              key->bytes, key->size,
> -              o_digest);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -/*
> - * SHA1
> - * (OUT) Create a SHA1 hash of text. Calls all three SHA1 steps internally
> - */
> -void Crypto_SHA1Full( const BYTE* text,
> -      uint32_t size,
> -      BYTE* hash) {
> -
> -  if (text == NULL || size == 0)
> -    return;
> -
> -  // Run SHA1Start + SHAUpdate (if necessary) + SHAComplete
> -  uint32_t maxBytes; // Not used for anything
> -  Crypto_SHA1Start(&maxBytes);
> -
> -  while (size > 64){
> -    Crypto_SHA1Update(64, text);
> -    size -= 64;
> -    text += 64;
> -  }
> -
> -  Crypto_SHA1Complete(size, text, hash);
> -}
> -
> -// same thing using buffer_t
> -TPM_RESULT Crypto_SHA1Full_buf (const buffer_t * buf,
> -                                 BYTE * o_digest) {
> -
> -  if (buf->bytes == NULL || buf->size == 0)
> -    return TPM_BAD_PARAMETER;
> -
> -  Crypto_SHA1Full (buf->bytes, buf->size, o_digest);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -/*
> - * Initialize SHA1
> - * (OUT) Maximum number of bytes that can be sent to SHA1Update.
> - *   Must be a multiple of 64 bytes.
> - */
> -void Crypto_SHA1Start(uint32_t* maxNumBytes) {
> -  int max = SHA_CBLOCK;
> -  // Initialize the crypto library
> -  SHA1_Init(&g_shaContext);
> -  *maxNumBytes = max;
> -}
> -
> -/*
> - * Process SHA1
> - * @numBytes: (IN) The number of bytes in hashData.
> - *       Must be a multiple of 64 bytes.
> - * @hashData: (IN) Bytes to be hashed.
> - */
> -void Crypto_SHA1Update(int numBytes, const BYTE* hashData) {
> -
> -  if (hashData == NULL || numBytes == 0 || numBytes%64 != 0)
> -    return;
> -
> -  SHA1_Update(&g_shaContext, hashData, numBytes);
> -}
> -
> -/*
> - * Complete the SHA1 process
> - * @hashDataSize: (IN) Number of bytes in hashData.
> - *       Must be a multiple of 64 bytes.
> - * @hashData: (IN) Final bytes to be hashed.
> - * @hashValue: (OUT) The output of the SHA-1 hash.
> - */
> -void Crypto_SHA1Complete(int hashDataSize,
> -                        const BYTE* hashData,
> -                        BYTE* hashValue) {
> -  SHA1_Update(&g_shaContext, hashData, hashDataSize);
> -  SHA1_Final(hashValue, &g_shaContext);
> -}
> diff --git a/tools/vtpm_manager/crypto/rsa.c b/tools/vtpm_manager/crypto/rsa.c
> deleted file mode 100644
> index 7737dc6..0000000
> --- a/tools/vtpm_manager/crypto/rsa.c
> +++ /dev/null
> @@ -1,434 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// rsa.c
> -//
> -//  This file will handle all the TPM RSA crypto functionality
> -//
> -// ==================================================================
> -
> -#include <string.h>
> -#include <openssl/crypto.h>
> -#include <openssl/evp.h>
> -#include <openssl/bn.h>
> -#include <openssl/rsa.h>
> -#include <openssl/rand.h>
> -#include <openssl/x509.h>
> -
> -#include <openssl/err.h>
> -#include <stdio.h>
> -
> -#include "tcg.h"
> -#include "buffer.h"
> -#include "crypto.h"
> -#include "log.h"
> -
> -void Crypto_RSACreateKey(   /*in*/ UINT32 keySize,
> -                            /*in*/ UINT32 pubExpSize,
> -                            /*in*/ BYTE *pubExp,
> -                            /*out*/ UINT32 *privExpSize,
> -                            /*out*/ BYTE *privExp,
> -                            /*out*/ UINT32 *modulusSize,
> -                            /*out*/ BYTE *modulus,
> -                            /*out*/ CRYPTO_INFO *keys) {
> -  unsigned long e_value;
> -
> -  if (pubExpSize == 0) // Default e = 2^16+1
> -    e_value = (0x01 << 16) + 1;
> -  else {
> -    // This is not supported, but the following line MIGHT work
> -    // under then assumption that the format is BigNum compatable
> -    // Though it's not in the spec, so who knows what it is.
> -    // Forcing the default.
> -    //BN_bin2bn(pubExp, pubExpSize, NULL);
> -    e_value = (0x01 << 16) + 1;
> -  }
> -
> -  RSA *rsa = RSA_generate_key(keySize, e_value, NULL, NULL);
> -
> -  if (keys) {
> -    keys->keyInfo = rsa;
> -    keys->algorithmID = CRYPTO_ALGORITH_RSA;
> -  }
> -
> -  if (modulus)   *modulusSize   = BN_bn2bin(rsa->n, modulus);
> -  if (privExp)   *privExpSize   = BN_bn2bin(rsa->d, privExp);
> -}
> -
> -// Create a CRYPTO_INFO struct from the BYTE * key parts.
> -// If pubExp info is NULL, use TCG default.
> -// If there is a remainder while calculating the privExp, return FALSE.
> -
> -void Crypto_RSABuildCryptoInfo( /*[IN]*/ UINT32 pubExpSize,
> -                                /*[IN]*/ BYTE *pubExp,
> -                                /*[IN]*/ UINT32 privExpSize,
> -                                /*[IN]*/ BYTE *privExp,
> -                                /*[IN]*/ UINT32 modulusSize,
> -                                /*[IN]*/ BYTE *modulus,
> -                                CRYPTO_INFO* cryptoInfo) {
> -  cryptoInfo->keyInfo = RSA_new();
> -  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
> -
> -  rsa->e = BN_new();
> -
> -  if (pubExpSize == 0) { // Default e = 2^16+1
> -    BN_set_bit(rsa->e, 16);
> -    BN_set_bit(rsa->e, 0);
> -  } else {
> -    // This is not supported, but the following line MIGHT work
> -    // under then assumption that the format is BigNum compatable
> -    // Though it's not in the spec, so who knows what it is.
> -    // Forcing the default.
> -    //BN_bin2bn(pubExp, pubExpSize, NULL);
> -    BN_set_bit(rsa->e, 16);
> -    BN_set_bit(rsa->e, 0);
> -  }
> -
> -  rsa->n = BN_bin2bn(modulus, modulusSize, NULL);
> -  rsa->d = BN_bin2bn(privExp, privExpSize, NULL);
> -}
> -
> -// Create a CRYPTO_INFO struct from the BYTE * key parts.
> -// If pubExp info is NULL, use TCG default.
> -// If there is a remainder while calculating the privExp, return FALSE.
> -
> -void Crypto_RSABuildCryptoInfoPublic(   /*[IN]*/ UINT32 pubExpSize,
> -                                        /*[IN]*/ BYTE *pubExp,
> -                                        /*[IN]*/ UINT32 modulusSize,
> -                                        /*[IN]*/ BYTE *modulus,
> -                                        CRYPTO_INFO* cryptoInfo) {
> -  cryptoInfo->keyInfo = RSA_new();
> -  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
> -
> -  rsa->e = BN_new();
> -
> -  if (pubExpSize == 0) { // Default e = 2^16+1
> -    BN_set_bit(rsa->e, 16);
> -    BN_set_bit(rsa->e, 0);
> -  } else {
> -    // This is not supported, but the following line MIGHT work
> -    // under then assumption that the format is BigNum compatable
> -    // Though it's not in the spec, so who knows what it is.
> -    // Forcing the default.
> -    //BN_bin2bn(pubExp, pubExpSize, NULL);
> -    BN_set_bit(rsa->e, 16);
> -    BN_set_bit(rsa->e, 0);
> -  }
> -
> -  rsa->n = BN_bin2bn(modulus, modulusSize, NULL);
> -
> -}
> -
> -int Crypto_RSAEnc(  CRYPTO_INFO *key,
> -                   UINT32 inDataSize,
> -                   BYTE *inData,
> -                   /*out*/ UINT32 *outDataSize,
> -                   /*out*/ BYTE *outData) {
> -  RSA *rsa = (RSA *) key->keyInfo;
> -  UINT32 paddedDataSize = RSA_size (rsa);
> -  BYTE *paddedData = (BYTE *)malloc(sizeof(BYTE) * paddedDataSize);
> -  int rc;
> -
> -  if (paddedData == NULL)
> -    return -1;
> -
> -  *outDataSize = 0;
> -
> -  switch (key->encScheme) {
> -  case CRYPTO_ES_RSAESPKCSv15:
> -    if (RSA_padding_add_PKCS1_type_2(paddedData, paddedDataSize, inData, inDataSize) <= 0) {
> -      rc = -1;
> -      goto abort_egress;
> -    }
> -    break;
> -  case CRYPTO_ES_RSAESOAEP_SHA1_MGF1:
> -    if (RSA_padding_add_PKCS1_OAEP(paddedData,paddedDataSize,inData,inDataSize, (BYTE *) OAEP_P,OAEP_P_SIZE) <= 0 ) {
> -      rc = -1;
> -      goto abort_egress;
> -    }
> -    break;
> -  default:
> -    rc = -1;
> -    goto abort_egress;
> -  }
> -
> -  rc = RSA_public_encrypt(paddedDataSize, paddedData, outData, rsa, RSA_NO_PADDING);
> -  if (rc == -1)
> -    goto abort_egress;
> -
> -  *outDataSize = rc;
> -
> -  if (rc > 0) rc = 0;
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  if (paddedData)
> -    free (paddedData);
> -  return rc;
> -
> -}
> -
> -int Crypto_RSADec(  CRYPTO_INFO *key,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *outDataSize,
> -                    /*out*/ BYTE *outData) {
> -
> -  RSA *rsa = (RSA *) key->keyInfo;
> -  UINT32 paddedDataSize = RSA_size (rsa);
> -  BYTE *paddedData = (BYTE *)malloc(sizeof(BYTE) * paddedDataSize);
> -  int rc;
> -
> -  if (paddedData == NULL)
> -    goto abort_egress;
> -
> -  rc = RSA_private_decrypt(inDataSize, inData, paddedData, rsa, RSA_NO_PADDING);
> -  if (rc == -1) {
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_private_decrypt: %s\n", ERR_error_string(ERR_get_error(), NULL));
> -    goto abort_egress;
> -  }
> -
> -  paddedDataSize = rc;
> -
> -  switch (key->encScheme) {
> -  case CRYPTO_ES_RSAESPKCSv15:
> -    rc = RSA_padding_check_PKCS1_type_2 (outData, paddedDataSize,
> -                                        paddedData + 1, paddedDataSize - 1,
> -                                        RSA_size(rsa));
> -    if (rc == -1) {
> -      vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_padding_check_PKCS1_type_2: %s\n",
> -             ERR_error_string(ERR_get_error(), NULL));
> -      goto abort_egress;
> -    }
> -    *outDataSize = rc;
> -    break;
> -  case CRYPTO_ES_RSAESOAEP_SHA1_MGF1:
> -    rc = RSA_padding_check_PKCS1_OAEP(outData, paddedDataSize,
> -                                     paddedData + 1, paddedDataSize - 1,
> -                                     RSA_size(rsa),
> -                                     (BYTE *) OAEP_P, OAEP_P_SIZE);
> -    if (rc == -1) {
> -      vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_padding_check_PKCS1_OAEP: %s\n",
> -             ERR_error_string(ERR_get_error(), NULL));
> -      goto abort_egress;
> -    }
> -    *outDataSize = rc;
> -    break;
> -  default:
> -    *outDataSize = 0;
> -  }
> -
> -  free(paddedData); paddedData = NULL;
> -  goto egress;
> -
> - abort_egress:
> -
> -  if (paddedData)
> -    free (paddedData);
> -  return -1;
> -
> - egress:
> -  return 0;
> -}
> -
> -// Signs either a SHA1 digest of a message or a DER encoding of a message
> -// Textual messages MUST be encoded or Hashed before sending into this function
> -// It will NOT SHA the message.
> -int Crypto_RSASign( CRYPTO_INFO *key,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *sigSize,
> -                    /*out*/ BYTE *sig) {
> -  int status;
> -  unsigned int intSigSize;
> -
> -  switch(key->sigScheme) {
> -  case CRYPTO_SS_RSASSAPKCS1v15_SHA1:
> -    status = RSA_sign(NID_sha1, inData, inDataSize, sig, &intSigSize, (RSA *) key->keyInfo);
> -    break;
> -  case CRYPTO_SS_RSASSAPKCS1v15_DER:
> -    //        status = Crypto_RSA_sign_DER(NID_md5_sha1, inData, inDataSize, sig, &intSigSize, key);
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "Crypto: Unimplemented sign type (%d)\n", key->sigScheme);
> -    status = 0;
> -    break;
> -  default:
> -    status = 0;
> -  }
> -
> -  if (status == 0) {
> -    *sigSize = 0;
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "%s\n", ERR_error_string(ERR_get_error(), NULL));
> -    return -1;
> -  }
> -
> -  *sigSize = (UINT32) intSigSize;
> -  return 0;
> -}
> -
> -bool Crypto_RSAVerify(  CRYPTO_INFO *key,
> -                        UINT32 inDataSize,
> -                        BYTE *inData,
> -                        UINT32 sigSize,
> -                        BYTE *sig) {
> -  int status;
> -
> -  switch(key->sigScheme){
> -  case CRYPTO_SS_RSASSAPKCS1v15_SHA1:
> -    status = RSA_verify(NID_sha1, inData, inDataSize, sig, sigSize, (RSA *) key->keyInfo);
> -    break;
> -  case CRYPTO_SS_RSASSAPKCS1v15_DER:
> -    //status = Crypto_RSA_verify_DER(NID_md5_sha1, inData, inDataSize, sig, sigSize, key);
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "Crypto: Unimplemented sign type (%d)\n", key->sigScheme);
> -    status = 0;
> -    break;
> -  default:
> -    status = 0;
> -  }
> -
> -  if (status)
> -    return(1);
> -  else {
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "RSA verify: %s\n", ERR_error_string(ERR_get_error(), NULL));
> -    return(0);
> -  }
> -
> -}
> -
> -// helper which packs everything into a BIO!
> -
> -// packs the parameters first, then the private key, then the public key
> -// if *io_buf is NULL, allocate it here as needed. otherwise its size is in
> -// *io_buflen
> -TPM_RESULT Crypto_RSAPackCryptoInfo (const CRYPTO_INFO* cryptoInfo,
> -                                      BYTE ** io_buf, UINT32 * io_buflen) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -  BYTE * buf;
> -  long len, outlen = *io_buflen;
> -
> -  const long PARAMSLEN = 3*sizeof(UINT32);
> -
> -  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
> -
> -  BIO *mem = BIO_new(BIO_s_mem());
> -
> -
> -  // write the openssl keys to the BIO
> -  if ( i2d_RSAPrivateKey_bio (mem, rsa) == 0 ) {
> -    ERR_print_errors_fp (stderr);
> -    ERRORDIE (TPM_SIZE);
> -  }
> -  if ( i2d_RSAPublicKey_bio (mem, rsa) == 0 ) {
> -    ERR_print_errors_fp (stderr);
> -    ERRORDIE (TPM_SIZE);
> -  }
> -
> -  // get the buffer out
> -  len = BIO_get_mem_data (mem, &buf);
> -
> -  // see if we need to allocate a return buffer
> -  if (*io_buf == NULL) {
> -    *io_buf = (BYTE*) malloc (PARAMSLEN + len);
> -    if (*io_buf == NULL)
> -      ERRORDIE (TPM_SIZE);
> -  } else {                      // *io_buf is already allocated
> -    if (outlen < len + PARAMSLEN)
> -      ERRORDIE (TPM_SIZE); // but not large enough!
> -  }
> -
> -  // copy over the parameters (three UINT32's starting at algorithmID)
> -  memcpy (*io_buf, &cryptoInfo->algorithmID, PARAMSLEN);
> -
> -  // copy over the DER keys
> -  memcpy (*io_buf + PARAMSLEN, buf, len);
> -
> -  *io_buflen = len + PARAMSLEN;
> -
> -  goto egress;
> -
> -
> - abort_egress:
> - egress:
> -
> -  BIO_free (mem);
> -
> -  return status;
> -}
> -
> -
> -
> -// sets up ci, and returns the number of bytes read in o_lenread
> -TPM_RESULT Crypto_RSAUnpackCryptoInfo (CRYPTO_INFO * ci,
> -                                        BYTE * in, UINT32 len,
> -                                        UINT32 * o_lenread) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  long l;
> -  BIO *mem;
> -  RSA *rsa;
> -
> -  // first load up the params
> -  l = 3 * sizeof(UINT32);
> -  memcpy (&ci->algorithmID, in, l);
> -  len -= l;
> -  in += l;
> -
> -  // and now the openssl keys, private first
> -  mem = BIO_new_mem_buf (in, len);
> -
> -  if ( (rsa = d2i_RSAPrivateKey_bio (mem, NULL)) == NULL ) {
> -    ERR_print_errors_fp (stderr);
> -    ERRORDIE (TPM_BAD_PARAMETER);
> -  }
> -  // now use the same RSA object and fill in the private key
> -  if ( d2i_RSAPublicKey_bio (mem, &rsa) == NULL ) {
> -    ERR_print_errors_fp (stderr);
> -    ERRORDIE (TPM_BAD_PARAMETER);
> -  }
> -
> -  ci->keyInfo = rsa;          // needs to be freed somehow later
> -
> -  // FIXME: havent figured out yet how to tell how many bytes were read in the
> -  // above oprations! so o_lenread is not set
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  BIO_free (mem);
> -
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/crypto/sym_crypto.c b/tools/vtpm_manager/crypto/sym_crypto.c
> deleted file mode 100644
> index 3d86e19..0000000
> --- a/tools/vtpm_manager/crypto/sym_crypto.c
> +++ /dev/null
> @@ -1,237 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// sym_crypto.c
> -//
> -//     Symmetric crypto portion of crypto
> -//
> -// ==================================================================
> -
> -#include <openssl/evp.h>
> -#include <openssl/rand.h>
> -
> -#include "tcg.h"
> -#include "sym_crypto.h"
> -
> -typedef enum crypt_op_type_t {
> -  CRYPT_ENCRYPT,
> -  CRYPT_DECRYPT
> -} crypt_op_type_t;
> -
> -TPM_RESULT ossl_symcrypto_op (symkey_t* key,
> -                              const buffer_t* in,
> -                              const buffer_t* iv,
> -                              buffer_t * out,
> -                              crypt_op_type_t optype);
> -
> -
> -// this is initialized in Crypto_Init()
> -const EVP_CIPHER * SYM_CIPHER = NULL;
> -
> -const BYTE ZERO_IV[EVP_MAX_IV_LENGTH] = {0};
> -
> -
> -TPM_RESULT Crypto_symcrypto_initkey (symkey_t * key, const buffer_t* keybits) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  EVP_CIPHER_CTX_init (&key->context);
> -
> -  key->cipher = SYM_CIPHER;
> -
> -  TPMTRYRETURN( buffer_init_copy (&key->key, keybits));
> -
> -  goto egress;
> -
> - abort_egress:
> -  EVP_CIPHER_CTX_cleanup (&key->context);
> -
> - egress:
> -
> -  return status;
> -}
> -
> -
> -
> -TPM_RESULT Crypto_symcrypto_genkey (symkey_t * key) {
> -  int res;
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  // hmm, EVP_CIPHER_CTX_init does not return a value
> -  EVP_CIPHER_CTX_init (&key->context);
> -
> -  key->cipher = SYM_CIPHER;
> -
> -  TPMTRYRETURN( buffer_init (&key->key, EVP_CIPHER_key_length(key->cipher), NULL)) ;
> -
> -  // and generate the key material
> -  res = RAND_pseudo_bytes (key->key.bytes, key->key.size);
> -  if (res < 0)
> -    ERRORDIE (TPM_SHORTRANDOM);
> -
> -
> -  goto egress;
> -
> - abort_egress:
> -  EVP_CIPHER_CTX_cleanup (&key->context);
> -  buffer_free (&key->key);
> -
> - egress:
> -  return status;
> -}
> -
> -
> -TPM_RESULT Crypto_symcrypto_encrypt (symkey_t* key,
> -                              const buffer_t* clear,
> -                              buffer_t* o_cipher) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  buffer_t iv, cipher_alias;
> -
> -  buffer_init_const (&iv, EVP_MAX_IV_LENGTH, ZERO_IV);
> -
> -  buffer_init (o_cipher,
> -              clear->size +
> -              EVP_CIPHER_iv_length(key->cipher) +
> -              EVP_CIPHER_block_size (key->cipher),
> -                                0);
> -
> -  // copy the IV into the front
> -  buffer_copy (o_cipher, &iv);
> -
> -  // make an alias into which we'll put the ciphertext
> -  buffer_init_alias (&cipher_alias, o_cipher, EVP_CIPHER_iv_length(key->cipher), 0);
> -
> -  TPMTRYRETURN( ossl_symcrypto_op (key, clear, &iv, &cipher_alias, CRYPT_ENCRYPT) );
> -
> -  // set the output size correctly
> -  o_cipher->size += cipher_alias.size;
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -
> -}
> -
> -
> -
> -TPM_RESULT Crypto_symcrypto_decrypt (symkey_t* key,
> -                              const buffer_t* cipher,
> -                              buffer_t* o_clear) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  buffer_t iv, cipher_alias;
> -
> -  // alias for the IV
> -  buffer_init_alias (&iv, cipher, 0, EVP_CIPHER_iv_length(key->cipher));
> -
> -  // make an alias to where the ciphertext is, after the IV
> -  buffer_init_alias (&cipher_alias, cipher, EVP_CIPHER_iv_length(key->cipher), 0);
> -
> -  // prepare the output buffer
> -  TPMTRYRETURN( buffer_init (o_clear,
> -                       cipher->size
> -                       - EVP_CIPHER_iv_length(key->cipher)
> -                       + EVP_CIPHER_block_size(key->cipher),
> -                       0) );
> -
> -  // and decrypt
> -  TPMTRYRETURN ( ossl_symcrypto_op (key, &cipher_alias, &iv, o_clear, CRYPT_DECRYPT) );
> -
> -  goto egress;
> -
> - abort_egress:
> -  buffer_free (o_clear);
> -
> - egress:
> -
> -  return status;
> -}
> -
> -
> -
> -TPM_RESULT Crypto_symcrypto_freekey (symkey_t * key) {
> -  buffer_memset (&key->key, 0);
> -  buffer_free (&key->key);
> -
> -  EVP_CIPHER_CTX_cleanup (&key->context);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -TPM_RESULT ossl_symcrypto_op (symkey_t* key,
> -                              const buffer_t* in,
> -                              const buffer_t* iv,
> -                              buffer_t * out,
> -                              crypt_op_type_t optype) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  int inlen, outlen;
> -  tpm_size_t running;
> -
> -  if ( ! EVP_CipherInit_ex (&key->context,
> -                           key->cipher, NULL, key->key.bytes, iv->bytes,
> -                           optype == CRYPT_ENCRYPT ? 1 : 0) )
> -    ERRORDIE (TPM_FAIL);
> -
> -
> -
> -  inlen = in->size;
> -
> -  outlen  = 0;
> -  running = 0;
> -
> -
> -  if ( ! EVP_CipherUpdate (&key->context, out->bytes, &outlen, in->bytes, inlen) )
> -    ERRORDIE (TPM_FAIL);
> -
> -  running += outlen;
> -
> -  if ( ! EVP_CipherFinal_ex (&key->context, out->bytes + running, &outlen) )
> -    ERRORDIE (TPM_FAIL);
> -
> -  running += outlen;
> -
> -  out->size = running;
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/crypto/sym_crypto.h b/tools/vtpm_manager/crypto/sym_crypto.h
> deleted file mode 100644
> index 7fb59a8..0000000
> --- a/tools/vtpm_manager/crypto/sym_crypto.h
> +++ /dev/null
> @@ -1,72 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// sym_crypto.h
> -//
> -//     Symmetric Crypto
> -//
> -// ==================================================================
> -
> -#ifndef _SYM_CRYPTO_H
> -#define _SYM_CRYPTO_H
> -
> -#include <openssl/evp.h>
> -#include "buffer.h"
> -
> -typedef struct symkey_t {
> -  buffer_t key;
> -
> -  EVP_CIPHER_CTX context;
> -  const EVP_CIPHER * cipher;
> -} symkey_t;
> -
> -extern const EVP_CIPHER * SYM_CIPHER;
> -
> -TPM_RESULT Crypto_symcrypto_genkey (symkey_t * key);
> -
> -TPM_RESULT Crypto_symcrypto_initkey (symkey_t * key, const buffer_t* keybits);
> -
> -
> -// these functions will allocate their output buffers
> -TPM_RESULT Crypto_symcrypto_encrypt (symkey_t* key,
> -                              const buffer_t* clear,
> -                              buffer_t* o_cipher);
> -
> -TPM_RESULT Crypto_symcrypto_decrypt (symkey_t* key,
> -                              const buffer_t* cipher,
> -                              buffer_t* o_clear);
> -
> -// only free the internal parts, not the 'key' ptr
> -TPM_RESULT Crypto_symcrypto_freekey (symkey_t * key);
> -
> -#endif /* _SYM_CRYPTO_H */
> diff --git a/tools/vtpm_manager/manager/Makefile b/tools/vtpm_manager/manager/Makefile
> deleted file mode 100644
> index a33c18a..0000000
> --- a/tools/vtpm_manager/manager/Makefile
> +++ /dev/null
> @@ -1,38 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -BIN            = vtpm_managerd
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIN)
> -
> -.PHONY: install
> -install: build
> -       if [ ! -d "$(DESTDIR)/var/vtpm/fifos" ]; \
> -               then mkdir -p $(DESTDIR)/var/vtpm/fifos; \
> -       fi
> -       if [ ! -d "$(DESTDIR)/var/vtpm/socks" ]; \
> -               then mkdir -p $(DESTDIR)/var/vtpm/socks; \
> -       fi
> -       $(INSTALL_PROG) $(BIN) $(DESTDIR)$(BINDIR)
> -
> -.PHONY: clean
> -clean:
> -       rm -f $(BIN)
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIN): $(OBJS)
> -       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
> -
> -# libraries
> -LIBS += ../tcs/libTCS.a ../util/libTCGUtils.a ../crypto/libtcpaCrypto.a
> -LIBS += -lcrypto $(PTHREAD_LIBS) -lm
> -CFLAGS += $(PTHREAD_CFLAGS)
> -LDFLAGS += $(PTHREAD_LDFLAGS)
> diff --git a/tools/vtpm_manager/manager/dmictl.c b/tools/vtpm_manager/manager/dmictl.c
> deleted file mode 100644
> index 5c3cf7e..0000000
> --- a/tools/vtpm_manager/manager/dmictl.c
> +++ /dev/null
> @@ -1,266 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -//   dmictl.c
> -//
> -//     Functions for creating and destroying DMIs
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <string.h>
> -
> -#include "vtpmpriv.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -#include "vtpm_ipc.h"
> -
> -#define TPM_EMULATOR_PATH "/usr/bin/vtpmd"
> -
> -// if dmi_res is non-null, then return a pointer to new object.
> -// Also, this does not fill in the measurements. They should be filled by
> -// design dependent code or saveNVM
> -TPM_RESULT init_dmi(UINT32 dmi_id, BYTE dmi_type, VTPM_DMI_RESOURCE **dmi_res) {
> -
> -  TPM_RESULT status=TPM_SUCCESS;
> -  VTPM_DMI_RESOURCE *new_dmi=NULL;
> -  UINT32 *dmi_id_key=NULL;
> -
> -  if ((new_dmi = (VTPM_DMI_RESOURCE *) malloc (sizeof(VTPM_DMI_RESOURCE))) == NULL) {
> -      status = TPM_RESOURCES;
> -      goto abort_egress;
> -  }
> -  memset(new_dmi, 0, sizeof(VTPM_DMI_RESOURCE));
> -  new_dmi->dmi_id = dmi_id;
> -  new_dmi->dmi_type = dmi_type;
> -  new_dmi->connected = FALSE;
> -  new_dmi->TCSContext = 0;
> -
> -  new_dmi->NVMLocation = (char *) malloc(11 + strlen(DMI_NVM_FILE));
> -  sprintf(new_dmi->NVMLocation, DMI_NVM_FILE, (uint32_t) new_dmi->dmi_id);
> -
> -  if ((dmi_id_key = (UINT32 *) malloc (sizeof(UINT32))) == NULL) {
> -    status = TPM_RESOURCES;
> -    goto abort_egress;
> -  }
> -  *dmi_id_key = new_dmi->dmi_id;
> -
> -  // install into map
> -  if (!hashtable_insert(vtpm_globals->dmi_map, dmi_id_key, new_dmi)){
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to insert instance into table. Aborting.\n", dmi_id);
> -    status = TPM_FAIL;
> -    goto abort_egress;
> -  }
> -
> -  if (dmi_res)
> -    *dmi_res = new_dmi;
> -
> -  goto egress;
> -
> - abort_egress:
> -  if (new_dmi) {
> -    free(new_dmi->NVMLocation);
> -    free(new_dmi);
> -  }
> -  free(dmi_id_key);
> -
> - egress:
> -  return status;
> -}
> -
> -TPM_RESULT close_dmi(VTPM_DMI_RESOURCE *dmi_res) {
> -  if (dmi_res == NULL)
> -    return TPM_SUCCESS;
> -
> -  if (dmi_res->dmi_id == VTPM_CTL_DM)
> -    return(TPM_BAD_PARAMETER);
> -
> -  TCS_CloseContext(dmi_res->TCSContext);
> -  dmi_res->connected = FALSE;
> -
> -  vtpm_globals->connected_dmis--;
> -
> -  return (VTPM_Close_DMI_Extra(dmi_res) );
> -}
> -
> -TPM_RESULT VTPM_Handle_New_DMI(const buffer_t *param_buf) {
> -
> -  VTPM_DMI_RESOURCE *new_dmi=NULL;
> -  TPM_RESULT status=TPM_FAIL;
> -  BYTE dmi_type, vm_type, startup_mode;
> -  UINT32 dmi_id;
> -
> -  if (param_buf == NULL) { // Assume creation of Dom 0 control
> -    dmi_type = VTPM_TYPE_NON_MIGRATABLE;
> -    dmi_id = VTPM_CTL_DM;
> -  } else if (buffer_len(param_buf) != sizeof(BYTE) * 3  + sizeof(UINT32)) {
> -    vtpmloginfo(VTPM_LOG_VTPM, "New DMI command wrong length: %d.\n", buffer_len(param_buf));
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  } else {
> -    vtpm_globals->connected_dmis++; // Put this here so we don't count Dom0
> -    BSG_UnpackList( param_buf->bytes, 4,
> -                   BSG_TYPE_BYTE, &dmi_type,
> -                   BSG_TYPE_BYTE, &startup_mode,
> -                   BSG_TYPE_BYTE, &vm_type,
> -                   BSG_TYPE_UINT32,  &dmi_id);
> -  }
> -
> -  if ((dmi_type != VTPM_TYPE_NON_MIGRATABLE) && (dmi_type != VTPM_TYPE_MIGRATABLE)) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Creation of VTPM with illegal type.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  new_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> -  if (new_dmi == NULL) {
> -    vtpmloginfo(VTPM_LOG_VTPM, "Creating new DMI instance %d attached.\n", dmi_id );
> -    // Brand New DMI. Initialize the persistent pieces
> -    TPMTRYRETURN(init_dmi(dmi_id, dmi_type, &new_dmi) );
> -  } else
> -    vtpmloginfo(VTPM_LOG_VTPM, "Re-attaching DMI instance %d.\n", dmi_id);
> -
> -  if (new_dmi->connected) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Attempt to re-attach, currently attached instance %d. Ignoring\n", dmi_id);
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  if (new_dmi->dmi_type == VTPM_TYPE_MIGRATED) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Attempt to re-attach previously migrated instance %d without recovering first. Ignoring\n", dmi_id);
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  // Initialize the Non-persistent pieces
> -  TPMTRYRETURN( TCS_OpenContext(&new_dmi->TCSContext) );
> -
> -  new_dmi->connected = TRUE;
> -
> -  // Design specific new DMI code.
> -  // Includes: create IPCs, Measuring DMI, and maybe launching DMI
> -  TPMTRYRETURN(VTPM_New_DMI_Extra(new_dmi, vm_type, startup_mode) );
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to create DMI id=%d due to status=%s. Cleaning.\n", dmi_id, tpm_get_error_name(status));
> -  close_dmi(new_dmi );
> -
> - egress:
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Close_DMI( const buffer_t *param_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_DMI_RESOURCE *dmi_res=NULL;
> -  UINT32 dmi_id;
> -
> -  if ((param_buf == NULL) || (buffer_len(param_buf) != sizeof(UINT32)) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing DMI has bad size.");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  BSG_UnpackList( param_buf->bytes, 1,
> -                 BSG_TYPE_UINT32, &dmi_id);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Closing DMI %d.\n", dmi_id);
> -
> -  dmi_res = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> -  if (dmi_res == NULL ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Trying to close nonexistent DMI.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  if (!dmi_res->connected) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing non-connected DMI.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  // Close Dmi
> -       TPMTRYRETURN(close_dmi( dmi_res ));
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Delete_DMI( const buffer_t *param_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_DMI_RESOURCE *dmi_res=NULL;
> -  UINT32 dmi_id;
> -
> -  if ((param_buf == NULL) || (buffer_len(param_buf) != sizeof(UINT32)) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing DMI has bad size.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  BSG_UnpackList( param_buf->bytes, 1,
> -                 BSG_TYPE_UINT32, &dmi_id);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Deleting DMI %d.\n", dmi_id);
> -
> -  dmi_res = (VTPM_DMI_RESOURCE *) hashtable_remove(vtpm_globals->dmi_map, &dmi_id);
> -  if (dmi_res == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing non-existent DMI.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  //vtpm scripts delete file dmi_res->NVMLocation for us
> -
> -  // Close DMI first
> -  TPMTRYRETURN(close_dmi( dmi_res ));
> -  free ( dmi_res );
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/manager/migration.c b/tools/vtpm_manager/manager/migration.c
> deleted file mode 100644
> index 54da708..0000000
> --- a/tools/vtpm_manager/manager/migration.c
> +++ /dev/null
> @@ -1,307 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -//   dmictl.c
> -//
> -//     Functions for creating and destroying DMIs
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <string.h>
> -
> -#include "vtpmpriv.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "hashtable.h"
> -
> -TPM_RESULT VTPM_Handle_Migrate_In( const buffer_t *param_buf,
> -                                   buffer_t *result_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_DMI_RESOURCE *mig_dmi=NULL;
> -  UINT32 dmi_id;
> -  buffer_t dmi_state_abuf = NULL_BUF, enc_dmi_abuf = NULL_BUF, clear_dmi_blob = NULL_BUF;
> -
> -  if (param_buf == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Migration Out Failed due to bad parameter.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  struct pack_buf_t enc_dmi_state_pack;
> -
> -  BSG_UnpackList(param_buf->bytes, 2,
> -                 BSG_TYPE_UINT32, &dmi_id,
> -                 BSG_TPM_SIZE32_DATA, &enc_dmi_state_pack) ;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Migrating VTPM in dmi %d.\n", dmi_id);
> -
> -  mig_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> -  if (mig_dmi) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Incoming VTPM claims unavailable id: %d.\n", dmi_id);
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  /** UnBind Blob **/
> -  TPMTRYRETURN( buffer_init_alias_convert( &enc_dmi_abuf,
> -                                           enc_dmi_state_pack.size,
> -                                           enc_dmi_state_pack.data) );
> -
> -  TPMTRYRETURN( envelope_decrypt( &enc_dmi_abuf,
> -                                   vtpm_globals->manager_tcs_handle,
> -                                   vtpm_globals->storageKeyHandle,
> -                                   (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
> -                                   &clear_dmi_blob) );
> -
> -  // Create new dmi
> -  TPMTRYRETURN( init_dmi(dmi_id, VTPM_TYPE_MIGRATABLE, &mig_dmi ) );
> -
> -  /** Open Blob **/
> -  struct pack_buf_t dmi_state_pack;
> -
> -  BSG_UnpackList(clear_dmi_blob.bytes, 2,
> -                 BSG_TPM_DIGEST, &mig_dmi->DMI_measurement,
> -                 BSG_TPM_SIZE32_DATA, &dmi_state_pack);
> -
> -  TPMTRYRETURN( buffer_init_alias_convert(&dmi_state_abuf,
> -                                          dmi_state_pack.size,
> -                                          dmi_state_pack.data) );
> -
> -  TPMTRYRETURN( VTPM_Handle_Save_NVM(mig_dmi, &dmi_state_abuf, NULL ) );
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Migration IN of instance %d failed because of %s.\n", dmi_id, tpm_get_error_name(status) );
> -
> - egress:
> -  buffer_free(&clear_dmi_blob);
> -  buffer_free(&dmi_state_abuf);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Migrate_Out( const buffer_t *param_buf,
> -                                    buffer_t *result_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_DMI_RESOURCE *mig_dmi;
> -  UINT32 dmi_id;
> -  VTPM_MIGKEY_LIST *last_mig, *mig_key;
> -  buffer_t dmi_state=NULL_BUF, clear_dmi_blob=NULL_BUF;
> -
> -  if (param_buf == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Migration Out Failed due to bad parameter.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  struct pack_buf_t name_pack;
> -
> -  BSG_UnpackList( param_buf->bytes, 2,
> -                  BSG_TYPE_UINT32, &dmi_id,
> -                  BSG_TPM_SIZE32_DATA, &name_pack);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Migrating out dmi %d.\n", dmi_id);
> -
> -  mig_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> -  if (mig_dmi == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Non-existent VTPM instance (%d) in migration.\n", dmi_id );
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  if (mig_dmi->dmi_type != VTPM_TYPE_MIGRATABLE) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Bad VTPM type (%d) in migration of instance (%d).\n", mig_dmi->dmi_type, dmi_id );
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  /** Find migration key for dest **/
> -  last_mig = NULL;
> -  mig_key = vtpm_globals->mig_keys;
> -  while (mig_key != NULL) {
> -    if (mig_key->name_size == name_pack.size)
> -      if (memcmp(mig_key->name, name_pack.data, name_pack.size) == 0) {
> -        break;
> -      }
> -
> -    last_mig = mig_key;
> -    mig_key = mig_key->next;
> -  }
> -
> -  if (!mig_key) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unknown Migration target host.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  /** Mark vtpm as migrated **/
> -  mig_dmi->dmi_type = VTPM_TYPE_MIGRATED;
> -
> -  /** Build Blob **/
> -  TPMTRYRETURN( VTPM_Handle_Load_NVM(mig_dmi, NULL, &dmi_state) );
> -
> -  TPMTRYRETURN( buffer_init(&clear_dmi_blob, sizeof(TPM_DIGEST) + sizeof(UINT32) + buffer_len(&dmi_state), NULL ) );
> -
> -  struct pack_constbuf_t dmi_state_pack;
> -
> -  dmi_state_pack.size = buffer_len(&dmi_state);
> -  dmi_state_pack.data = dmi_state.bytes;
> -
> -  BSG_PackList(clear_dmi_blob.bytes, 2,
> -               BSG_TPM_DIGEST, &mig_dmi->DMI_measurement,
> -               BSG_TPM_SIZE32_DATA, &dmi_state_pack);
> -
> -  /** Bind Blob **/
> -  TPMTRYRETURN( envelope_encrypt( &clear_dmi_blob,
> -                                  &mig_key->key,
> -                                  result_buf) );
> -
> -  if (last_mig)
> -    last_mig->next = mig_key->next;
> -  else
> -    vtpm_globals->mig_keys = mig_key->next;
> -
> -  free(mig_key->name);
> -  free(mig_key);
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Migration OUT of instance %d failed because of %s. Migratoin recovery may be needed.\n", dmi_id, tpm_get_error_name(status) );
> -
> -    //TODO: Create and implement a policy for what happens to mig_key on failed migrations.
> -
> - egress:
> -
> -  buffer_free(&clear_dmi_blob);
> -  buffer_free(&dmi_state);
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTPM_Handle_Get_Migration_key( const buffer_t *param_buf,
> -                                          buffer_t *result_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Getting Migration Public Key.\n");
> -
> -  struct pack_buf_t pubkey_exp_pack, pubkey_mod_pack;
> -  TPM_KEY mig_key;
> -
> -  // Unpack/return key structure
> -  BSG_Unpack(BSG_TPM_KEY, vtpm_globals->storageKeyWrap.bytes , &mig_key);
> -  TPM_RSA_KEY_PARMS rsaKeyParms;
> -
> -  BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
> -               mig_key.algorithmParms.parms,
> -               &rsaKeyParms);
> -
> -  pubkey_exp_pack.size = rsaKeyParms.exponentSize;
> -  pubkey_exp_pack.data = rsaKeyParms.exponent;
> -  pubkey_mod_pack.size = mig_key.pubKey.keyLength;
> -  pubkey_mod_pack.data = mig_key.pubKey.key;
> -
> -  TPMTRYRETURN( buffer_init( result_buf, 2*sizeof(UINT32) +
> -                                         pubkey_exp_pack.size +
> -                                         pubkey_mod_pack.size, NULL ) );
> -
> -  BSG_PackList( result_buf->bytes, 2,
> -                  BSG_TPM_SIZE32_DATA, &pubkey_exp_pack,
> -                  BSG_TPM_SIZE32_DATA, &pubkey_mod_pack);
> -
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Get Migration Key failed because of %s.\n", tpm_get_error_name(status) );
> - egress:
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Load_Migration_key( const buffer_t *param_buf,
> -                                           buffer_t *result_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_MIGKEY_LIST *mig_key;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Loading Migration Public Key.\n");
> -
> -  //FIXME: Review all uses of unpacking pack_buf_t and ensure free.
> -  //FIXME: Review all declarations/initializations of buffer_t that could have a goto that skips them and then tries to free them
> -
> -  struct pack_buf_t name_pack, pubkey_exp_pack, pubkey_mod_pack;
> -
> -  //FIXME: scan list and verify name is not already in the list
> -
> -  BSG_UnpackList( param_buf->bytes, 3,
> -                  BSG_TPM_SIZE32_DATA, &name_pack,
> -                  BSG_TPM_SIZE32_DATA, &pubkey_exp_pack,
> -                  BSG_TPM_SIZE32_DATA, &pubkey_mod_pack);
> -
> -  //TODO: Maintain a persistent list for pub_keys.
> -  //TODO: Verify pub_key is trusted
> -
> -  mig_key = (VTPM_MIGKEY_LIST *) malloc(sizeof(VTPM_MIGKEY_LIST));
> -  memset(mig_key, 0, sizeof(VTPM_MIGKEY_LIST) );
> -  mig_key->name_size = name_pack.size;
> -  mig_key->name = name_pack.data;
> -
> -  mig_key->key.encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
> -  Crypto_RSABuildCryptoInfoPublic( pubkey_exp_pack.size,
> -                                   pubkey_exp_pack.data,
> -                                   pubkey_mod_pack.size,
> -                                   pubkey_mod_pack.data,
> -                                   &mig_key->key);
> -
> -
> -  mig_key->next = vtpm_globals->mig_keys;
> -  vtpm_globals->mig_keys = mig_key;
> -
> -  // free(name_pack.data); Do not free. data is now part of mig_key.
> -  free(pubkey_exp_pack.data);
> -  free(pubkey_mod_pack.data);
> -
> -  return TPM_SUCCESS;
> -}
> diff --git a/tools/vtpm_manager/manager/securestorage.c b/tools/vtpm_manager/manager/securestorage.c
> deleted file mode 100644
> index d5e6ffd..0000000
> --- a/tools/vtpm_manager/manager/securestorage.c
> +++ /dev/null
> @@ -1,512 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// securestorage.c
> -//
> -//  Functions regarding securely storing DMI secrets.
> -//
> -// ==================================================================
> -
> -#include <sys/types.h>
> -#include <sys/stat.h>
> -#include <fcntl.h>
> -#include <unistd.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "vtsp.h"
> -#include "bsg.h"
> -#include "crypto.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -#include "buffer.h"
> -#include "log.h"
> -
> -TPM_RESULT envelope_encrypt(const buffer_t     *inbuf,
> -                            CRYPTO_INFO        *asymkey,
> -                            buffer_t           *sealed_data) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -  symkey_t    symkey;
> -  buffer_t    data_cipher = NULL_BUF,
> -              symkey_cipher = NULL_BUF;
> -
> -  UINT32 i;
> -  struct pack_constbuf_t symkey_cipher32, data_cipher32;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Enveloping Input[%d]: 0x", buffer_len(inbuf));
> -  for (i=0; i< buffer_len(inbuf); i++)
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", inbuf->bytes[i]);
> -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -  // Generate a sym key and encrypt state with it
> -  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_symcrypto_genkey (&symkey) );
> -  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_symcrypto_encrypt (&symkey, inbuf, &data_cipher) );
> -
> -  // Encrypt symmetric key
> -  TPMTRYRETURN( VTSP_Bind(    asymkey,
> -                             &symkey.key,
> -                             &symkey_cipher) );
> -
> -  // Create output blob: symkey_size + symkey_cipher + state_cipher_size + state_cipher
> -
> -  symkey_cipher32.size = buffer_len(&symkey_cipher);
> -  symkey_cipher32.data = symkey_cipher.bytes;
> -
> -  data_cipher32.size = buffer_len(&data_cipher);
> -  data_cipher32.data = data_cipher.bytes;
> -
> -  TPMTRYRETURN( buffer_init(sealed_data, 2 * sizeof(UINT32) + symkey_cipher32.size + data_cipher32.size, NULL));
> -
> -  BSG_PackList(sealed_data->bytes, 2,
> -              BSG_TPM_SIZE32_DATA, &symkey_cipher32,
> -              BSG_TPM_SIZE32_DATA, &data_cipher32);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Saved %d bytes of E(symkey) + %d bytes of E(data)\n", buffer_len(&symkey_cipher), buffer_len(&data_cipher));
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Enveloping Output[%d]: 0x", buffer_len(sealed_data));
> -  for (i=0; i< buffer_len(sealed_data); i++)
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", sealed_data->bytes[i]);
> -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to envelope encrypt\n.");
> -
> - egress:
> -
> -  buffer_free ( &data_cipher);
> -  buffer_free ( &symkey_cipher);
> -  Crypto_symcrypto_freekey (&symkey);
> -
> -  return status;
> -}
> -
> -TPM_RESULT envelope_decrypt(const buffer_t     *cipher,
> -                            TCS_CONTEXT_HANDLE TCSContext,
> -                           TPM_HANDLE         keyHandle,
> -                           const TPM_AUTHDATA *key_usage_auth,
> -                            buffer_t           *unsealed_data) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  symkey_t    symkey;
> -  buffer_t    data_cipher = NULL_BUF,
> -              symkey_clear = NULL_BUF,
> -              symkey_cipher = NULL_BUF;
> -  struct pack_buf_t symkey_cipher32, data_cipher32;
> -  int i;
> -
> -  memset(&symkey, 0, sizeof(symkey_t));
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Envelope Decrypt Input[%d]: 0x", buffer_len(cipher) );
> -  for (i=0; i< buffer_len(cipher); i++)
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cipher->bytes[i]);
> -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -  BSG_UnpackList(cipher->bytes, 2,
> -                BSG_TPM_SIZE32_DATA, &symkey_cipher32,
> -                BSG_TPM_SIZE32_DATA, &data_cipher32);
> -
> -  TPMTRYRETURN( buffer_init_alias_convert (&symkey_cipher,
> -                                          symkey_cipher32.size,
> -                                          symkey_cipher32.data) );
> -
> -  TPMTRYRETURN( buffer_init_alias_convert (&data_cipher,
> -                                          data_cipher32.size,
> -                                          data_cipher32.data) );
> -
> -  // Decrypt Symmetric Key
> -  TPMTRYRETURN( VTSP_Unbind(  TCSContext,
> -                             keyHandle,
> -                             &symkey_cipher,
> -                             key_usage_auth,
> -                             &symkey_clear,
> -                             &(vtpm_globals->keyAuth) ) );
> -
> -  // create symmetric key using saved bits
> -  Crypto_symcrypto_initkey (&symkey, &symkey_clear);
> -
> -  // Decrypt State
> -  TPMTRY(TPM_DECRYPT_ERROR, Crypto_symcrypto_decrypt (&symkey, &data_cipher, unsealed_data) );
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Envelope Decrypte Output[%d]: 0x", buffer_len(unsealed_data));
> -  for (i=0; i< buffer_len(unsealed_data); i++)
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", unsealed_data->bytes[i]);
> -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to envelope decrypt data\n.");
> -
> - egress:
> -  buffer_free ( &data_cipher);
> -  buffer_free ( &symkey_clear);
> -  buffer_free ( &symkey_cipher);
> -  Crypto_symcrypto_freekey (&symkey);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Save_NVM(VTPM_DMI_RESOURCE *myDMI,
> -                               const buffer_t *inbuf,
> -                               buffer_t *outbuf) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  int fh;
> -  long bytes_written;
> -  buffer_t sealed_NVM = NULL_BUF;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Saving %d bytes of NVM.\n", buffer_len(inbuf));
> -
> -  TPMTRYRETURN( envelope_encrypt(inbuf,
> -                                 &vtpm_globals->storageKey,
> -                                 &sealed_NVM) );
> -
> -  // Write sealed blob off disk from NVMLocation
> -  // TODO: How to properly return from these. Do we care if we return failure
> -  //       after writing the file? We can't get the old one back.
> -  // TODO: Backup old file and try and recover that way.
> -  fh = open(myDMI->NVMLocation, O_WRONLY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
> -  if ( (bytes_written = write(fh, sealed_NVM.bytes, buffer_len(&sealed_NVM) ) != (long) buffer_len(&sealed_NVM))) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "We just overwrote a DMI_NVM and failed to finish. %ld/%ld bytes.\n", bytes_written, (long)buffer_len(&sealed_NVM));
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -  close(fh);
> -
> -  Crypto_SHA1Full (sealed_NVM.bytes, buffer_len(&sealed_NVM), (BYTE *) &myDMI->NVM_measurement);
> -
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to save NVM\n.");
> -
> - egress:
> -  buffer_free(&sealed_NVM);
> -  return status;
> -}
> -
> -
> -/* Expected Params: inbuf = null, outbuf = sealed blob size, sealed blob.*/
> -TPM_RESULT VTPM_Handle_Load_NVM(VTPM_DMI_RESOURCE *myDMI,
> -                               const buffer_t    *inbuf,
> -                               buffer_t          *outbuf) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  buffer_t sealed_NVM = NULL_BUF;
> -  long fh_size;
> -  int fh, stat_ret, i;
> -  struct stat file_stat;
> -  TPM_DIGEST sealedNVMHash;
> -
> -  if (myDMI->NVMLocation == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to load NVM because the file name NULL.\n");
> -    status = TPM_AUTHFAIL;
> -    goto abort_egress;
> -  }
> -
> -  //Read sealed blob off disk from NVMLocation
> -  fh = open(myDMI->NVMLocation, O_RDONLY);
> -  stat_ret = fstat(fh, &file_stat);
> -  if (stat_ret == 0)
> -    fh_size = file_stat.st_size;
> -  else {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  TPMTRYRETURN( buffer_init( &sealed_NVM, fh_size, NULL) );
> -  if (read(fh, sealed_NVM.bytes, buffer_len(&sealed_NVM)) != fh_size) {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -  close(fh);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Load_NVMing[%d],\n", buffer_len(&sealed_NVM));
> -
> -  Crypto_SHA1Full(sealed_NVM.bytes, buffer_len(&sealed_NVM), (BYTE *) &sealedNVMHash);
> -
> -  // Verify measurement of sealed blob.
> -  if (memcmp(&sealedNVMHash, &myDMI->NVM_measurement, sizeof(TPM_DIGEST)) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM LoadNVM NVM measurement check failed.\n");
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Correct hash: ");
> -    for (i=0; i< sizeof(TPM_DIGEST); i++)
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", ((BYTE*)&myDMI->NVM_measurement)[i]);
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Measured hash: ");
> -    for (i=0; i< sizeof(TPM_DIGEST); i++)
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", ((BYTE*)&sealedNVMHash)[i]);
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -    status = TPM_AUTHFAIL;
> -    goto abort_egress;
> -  }
> -
> -  TPMTRYRETURN( envelope_decrypt(&sealed_NVM,
> -                                 myDMI->TCSContext,
> -                                vtpm_globals->storageKeyHandle,
> -                                (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
> -                                 outbuf) );
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to load NVM\n.");
> -
> - egress:
> -  buffer_free( &sealed_NVM );
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTPM_SaveManagerData(void) {
> -  TPM_RESULT status=TPM_SUCCESS;
> -  int fh, dmis=-1;
> -
> -  BYTE *flat_boot_key=NULL, *flat_dmis=NULL, *flat_enc=NULL;
> -  buffer_t clear_flat_global=NULL_BUF, enc_flat_global=NULL_BUF;
> -  UINT32 storageKeySize = buffer_len(&vtpm_globals->storageKeyWrap);
> -  UINT32 bootKeySize = buffer_len(&vtpm_globals->bootKeyWrap);
> -  struct pack_buf_t storage_key_pack = {storageKeySize, vtpm_globals->storageKeyWrap.bytes};
> -  struct pack_buf_t boot_key_pack = {bootKeySize, vtpm_globals->bootKeyWrap.bytes};
> -  BYTE vtpm_manager_gen = VTPM_MANAGER_GEN;
> -
> -  struct hashtable_itr *dmi_itr;
> -  VTPM_DMI_RESOURCE *dmi_res;
> -
> -  UINT32 boot_key_size = 0, flat_dmis_size = 0;
> -
> -  // Initially fill these with buffer sizes for each data type. Later fill
> -  // in actual size, once flattened.
> -  boot_key_size =  sizeof(UINT32) +       // bootkeysize
> -                   bootKeySize;           // boot key
> -
> -  TPMTRYRETURN(buffer_init(&clear_flat_global,sizeof(BYTE) + // manager version
> -                                              3*sizeof(TPM_DIGEST) + // Auths
> -                                              sizeof(UINT32) +// storagekeysize
> -                                              storageKeySize, NULL) ); // storage key
> -
> -
> -  flat_boot_key = (BYTE *) malloc( boot_key_size );
> -  flat_enc = (BYTE *) malloc( sizeof(UINT32) );
> -
> -  boot_key_size = BSG_PackList(flat_boot_key, 1,
> -                               BSG_TPM_SIZE32_DATA, &boot_key_pack);
> -
> -  BSG_PackList(clear_flat_global.bytes, 4,
> -                BSG_TYPE_BYTE,    &vtpm_manager_gen,
> -                BSG_TPM_AUTHDATA, &vtpm_globals->owner_usage_auth,
> -                BSG_TPM_SECRET,   &vtpm_globals->storage_key_usage_auth,
> -                BSG_TPM_SIZE32_DATA, &storage_key_pack);
> -
> -  TPMTRYRETURN(envelope_encrypt(&clear_flat_global,
> -                                &vtpm_globals->bootKey,
> -                                &enc_flat_global) );
> -
> -  BSG_PackConst(buffer_len(&enc_flat_global), 4, flat_enc);
> -
> -  // Per DMI values to be saved (if any exit)
> -  if (hashtable_count(vtpm_globals->dmi_map) > 1) {
> -
> -    flat_dmis = (BYTE *) malloc(
> -                     (hashtable_count(vtpm_globals->dmi_map) - 1) * // num DMIS (-1 for Dom0)
> -                     (sizeof(UINT32) +sizeof(BYTE) + 2*sizeof(TPM_DIGEST)) ); // Per DMI info
> -
> -    dmi_itr = hashtable_iterator(vtpm_globals->dmi_map);
> -    do {
> -      dmi_res = (VTPM_DMI_RESOURCE *) hashtable_iterator_value(dmi_itr);
> -      dmis++;
> -
> -      // No need to save dmi0.
> -      if (dmi_res->dmi_id == 0)
> -        continue;
> -
> -
> -      flat_dmis_size += BSG_PackList( flat_dmis + flat_dmis_size, 4,
> -                                        BSG_TYPE_UINT32, &dmi_res->dmi_id,
> -                                        BSG_TYPE_BYTE, &dmi_res->dmi_type,
> -                                        BSG_TPM_DIGEST, &dmi_res->NVM_measurement,
> -                                        BSG_TPM_DIGEST, &dmi_res->DMI_measurement);
> -
> -    } while (hashtable_iterator_advance(dmi_itr));
> -  }
> -
> -  fh = open(STATE_FILE, O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
> -  if (fh == -1) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to open %s file for write.\n", STATE_FILE);
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if ( ( write(fh, flat_boot_key, boot_key_size) != boot_key_size ) ||
> -       ( write(fh, flat_enc, sizeof(UINT32)) != sizeof(UINT32) ) ||
> -       ( write(fh, enc_flat_global.bytes, buffer_len(&enc_flat_global)) != buffer_len(&enc_flat_global) ) ||
> -       ( write(fh, flat_dmis, flat_dmis_size) != flat_dmis_size ) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to completely write service data.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> - }
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  free(flat_boot_key);
> -  free(flat_enc);
> -  buffer_free(&enc_flat_global);
> -  free(flat_dmis);
> -  close(fh);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Saved VTPM Manager state (status = %d, dmis = %d)\n", (int) status, dmis);
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_LoadManagerData(void) {
> -
> -  TPM_RESULT status=TPM_SUCCESS;
> -  int fh, stat_ret, dmis=0;
> -  long fh_size = 0, step_size;
> -  BYTE *flat_table=NULL;
> -  buffer_t  unsealed_data, enc_table_abuf;
> -  struct pack_buf_t storage_key_pack, boot_key_pack;
> -  UINT32 *dmi_id_key, enc_size;
> -  BYTE vtpm_manager_gen;
> -
> -  VTPM_DMI_RESOURCE *dmi_res;
> -  UINT32 dmi_id;
> -  BYTE dmi_type;
> -  struct stat file_stat;
> -
> -  TPM_HANDLE boot_key_handle;
> -  TPM_AUTHDATA boot_usage_auth;
> -  memset(&boot_usage_auth, 0, sizeof(TPM_AUTHDATA));
> -
> -  fh = open(STATE_FILE, O_RDONLY );
> -  stat_ret = fstat(fh, &file_stat);
> -  if (stat_ret == 0)
> -    fh_size = file_stat.st_size;
> -  else {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  flat_table = (BYTE *) malloc(fh_size);
> -
> -  if ((long) read(fh, flat_table, fh_size) != fh_size ) {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  // Read Boot Key
> -  step_size = BSG_UnpackList( flat_table, 2,
> -                              BSG_TPM_SIZE32_DATA, &boot_key_pack,
> -                              BSG_TYPE_UINT32, &enc_size);
> -
> -  TPMTRYRETURN(buffer_init(&vtpm_globals->bootKeyWrap, 0, 0) );
> -  TPMTRYRETURN(buffer_init_alias_convert(&enc_table_abuf, enc_size, flat_table + step_size) );
> -  TPMTRYRETURN(buffer_append_raw(&vtpm_globals->bootKeyWrap, boot_key_pack.size, boot_key_pack.data) );
> -
> -  //Load Boot Key
> -  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
> -                              TPM_SRK_KEYHANDLE,
> -                              &vtpm_globals->bootKeyWrap,
> -                              &SRK_AUTH,
> -                              &boot_key_handle,
> -                              &vtpm_globals->keyAuth,
> -                              &vtpm_globals->bootKey,
> -                              FALSE) );
> -
> -  TPMTRYRETURN( envelope_decrypt(&enc_table_abuf,
> -                                 vtpm_globals->manager_tcs_handle,
> -                                 boot_key_handle,
> -                                 (const TPM_AUTHDATA*) &boot_usage_auth,
> -                                 &unsealed_data) );
> -  step_size += enc_size;
> -
> -  if (*unsealed_data.bytes != VTPM_MANAGER_GEN) {
> -      // Once there is more than one gen, this will include some compatability stuff
> -      vtpmlogerror(VTPM_LOG_VTPM, "Warning: Manager Data file is gen %d, which this manager is gen %d.\n", vtpm_manager_gen, VTPM_MANAGER_GEN);
> -  }
> -
> -  // Global Values needing to be saved
> -  BSG_UnpackList( unsealed_data.bytes, 4,
> -                  BSG_TYPE_BYTE,    &vtpm_manager_gen,
> -                  BSG_TPM_AUTHDATA, &vtpm_globals->owner_usage_auth,
> -                  BSG_TPM_SECRET,   &vtpm_globals->storage_key_usage_auth,
> -                  BSG_TPM_SIZE32_DATA, &storage_key_pack);
> -
> -  TPMTRYRETURN(buffer_init(&vtpm_globals->storageKeyWrap, 0, 0) );
> -  TPMTRYRETURN(buffer_append_raw(&vtpm_globals->storageKeyWrap, storage_key_pack.size, storage_key_pack.data) );
> -
> -  // Per DMI values to be saved
> -  while ( step_size < fh_size ){
> -    if (fh_size - step_size < (long) (sizeof(UINT32) + sizeof(BYTE) + 2*sizeof(TPM_DIGEST))) {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Encountered %ld extra bytes at end of manager state.\n", fh_size-step_size);
> -      step_size = fh_size;
> -    } else {
> -      step_size += BSG_UnpackList(flat_table + step_size, 2,
> -                                 BSG_TYPE_UINT32, &dmi_id,
> -                                 BSG_TYPE_BYTE, &dmi_type);
> -
> -      //TODO: Try and gracefully recover from problems.
> -      TPMTRYRETURN(init_dmi(dmi_id, dmi_type, &dmi_res) );
> -      dmis++;
> -
> -      step_size += BSG_UnpackList(flat_table + step_size, 2,
> -                                 BSG_TPM_DIGEST, &dmi_res->NVM_measurement,
> -                                 BSG_TPM_DIGEST, &dmi_res->DMI_measurement);
> -    }
> -
> -  }
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Loaded saved state (dmis = %d).\n", dmis);
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to load service data with error = %s\n", tpm_get_error_name(status));
> - egress:
> -
> -  free(flat_table);
> -  close(fh);
> -
> -  // TODO: Could be nice and evict BootKey. (Need to add EvictKey to VTSP.
> -
> -  return status;
> -}
> -
> diff --git a/tools/vtpm_manager/manager/tpmpassthrough.c b/tools/vtpm_manager/manager/tpmpassthrough.c
> deleted file mode 100644
> index 9b1e5f8..0000000
> --- a/tools/vtpm_manager/manager/tpmpassthrough.c
> +++ /dev/null
> @@ -1,110 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tpmpassthrough.c
> -//
> -//  Functions regarding passing DMI requests to HWTPM
> -//
> -// ==================================================================
> -
> -#include "tcg.h"
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "vtsp.h"
> -#include "log.h"
> -
> -TPM_RESULT VTPM_Handle_TPM_Command( VTPM_DMI_RESOURCE *dmi,
> -                                   buffer_t *inbuf,
> -                                   buffer_t *outbuf) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE *ord;
> -
> -  ord = (TPM_COMMAND_CODE *) (inbuf->bytes + sizeof(TPM_TAG) + sizeof(UINT32));
> -
> -  switch (*ord) {
> -
> -    // Forbidden for DMI use
> -  case TPM_ORD_TakeOwnership:
> -  case TPM_ORD_ChangeAuthOwner:
> -  case TPM_ORD_DirWriteAuth:
> -  case TPM_ORD_DirRead:
> -  case TPM_ORD_AuthorizeMigrationKey:
> -  case TPM_ORD_CreateMaintenanceArchive:
> -  case TPM_ORD_LoadMaintenanceArchive:
> -  case TPM_ORD_KillMaintenanceFeature:
> -  case TPM_ORD_LoadManuMaintPub:
> -  case TPM_ORD_ReadManuMaintPub:
> -  case TPM_ORD_SelfTestFull:
> -  case TPM_ORD_SelfTestStartup:
> -  case TPM_ORD_CertifySelfTest:
> -  case TPM_ORD_ContinueSelfTest:
> -  case TPM_ORD_GetTestResult:
> -  case TPM_ORD_Reset:
> -  case TPM_ORD_OwnerClear:
> -  case TPM_ORD_DisableOwnerClear:
> -  case TPM_ORD_ForceClear:
> -  case TPM_ORD_DisableForceClear:
> -  case TPM_ORD_GetCapabilityOwner:
> -  case TPM_ORD_OwnerSetDisable:
> -  case TPM_ORD_PhysicalEnable:
> -  case TPM_ORD_PhysicalDisable:
> -  case TPM_ORD_SetOwnerInstall:
> -  case TPM_ORD_PhysicalSetDeactivated:
> -  case TPM_ORD_SetTempDeactivated:
> -  case TPM_ORD_CreateEndorsementKeyPair:
> -  case TPM_ORD_GetAuditEvent:
> -  case TPM_ORD_GetAuditEventSigned:
> -  case TPM_ORD_GetOrdinalAuditStatus:
> -  case TPM_ORD_SetOrdinalAuditStatus:
> -  case TPM_ORD_SetRedirection:
> -  case TPM_ORD_FieldUpgrade:
> -  case TSC_ORD_PhysicalPresence:
> -    status = TPM_DISABLED_CMD;
> -    goto abort_egress;
> -    break;
> -
> -  } // End ORD Switch
> -
> -  // Call TCS with command
> -
> -  TPMTRY(TPM_IOERROR, VTSP_RawTransmit( dmi->TCSContext,inbuf, outbuf) );
> -
> -  goto egress;
> -
> - abort_egress:
> -  vtpmloginfo(VTPM_LOG_VTPM, "TPM Command Failed in tpmpassthrough.\n");
> - egress:
> -
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/manager/vtpm_ipc.c b/tools/vtpm_manager/manager/vtpm_ipc.c
> deleted file mode 100644
> index 319dc83..0000000
> --- a/tools/vtpm_manager/manager/vtpm_ipc.c
> +++ /dev/null
> @@ -1,141 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_ipc.c Implements ipc routines using file io. This file can
> -// be replaced with other ipc types.
> -//
> -// ===================================================================
> -
> -#include <sys/stat.h>
> -#include "vtpm_ipc.h"
> -#include "vtpmpriv.h"
> -#include "log.h"
> -
> -int vtpm_ipc_init(vtpm_ipc_handle_t *ipc_h, char* name, int flags, BOOL create) {
> -  ipc_h->name = name;
> -  ipc_h->flags = flags;
> -  ipc_h->fh = VTPM_IPC_CLOSED;
> -
> -  if (create)
> -    return(vtpm_ipc_create(ipc_h));
> -  else
> -    return 0;
> -}
> -
> -// Create the file that needs opening. Used only for FIFOs
> -// FYI: This may cause problems in other file IO schemes. We'll see.
> -int vtpm_ipc_create(vtpm_ipc_handle_t *ipc_h) {
> -  int fh;
> -  struct stat file_info;
> -
> -  if ((!ipc_h) || (!ipc_h->name))
> -    return -1;
> -
> -  if ( stat(ipc_h->name, &file_info) == -1) {
> -    if ( mkfifo(ipc_h->name, S_IWUSR | S_IRUSR ) ) {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Failed to create fifo %s.\n", ipc_h->name);
> -      return -1;
> -    }
> -  }
> -
> -  ipc_h->fh = VTPM_IPC_CLOSED;
> -
> -  return 0;
> -}
> -
> -
> -// Read size bytes. If FH isn't open, open it.
> -int vtpm_ipc_read(vtpm_ipc_handle_t *ipc_h, vtpm_ipc_handle_t *alt_ipc_h, BYTE *bytes, UINT32 size){
> -  vtpm_ipc_handle_t *my_ipc_h;
> -  int result;
> -
> -  if (ipc_h) {
> -    my_ipc_h = ipc_h;
> -  } else {
> -    my_ipc_h = alt_ipc_h;
> -  }
> -
> -  if (my_ipc_h->fh == VTPM_IPC_CLOSED) {
> -    my_ipc_h->fh = open(my_ipc_h->name, my_ipc_h->flags);
> -  }
> -
> -  if ( my_ipc_h->fh == VTPM_IPC_CLOSED ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM ERROR: Can't open %s for reading.\n", my_ipc_h->name);
> -    return -1;
> -  }
> -
> -  result = read(my_ipc_h->fh, bytes, size);
> -  if (result < 0) {
> -    my_ipc_h->fh = VTPM_IPC_CLOSED;
> -  }
> -
> -  return (result);
> -}
> -
> -// Write size bytes. If FH isn't open, open it.
> -int vtpm_ipc_write(vtpm_ipc_handle_t *ipc_h, vtpm_ipc_handle_t *alt_ipc_h, BYTE *bytes, UINT32 size) {
> -  vtpm_ipc_handle_t *my_ipc_h;
> -  int result;
> -
> -  if (ipc_h) {
> -    my_ipc_h = ipc_h;
> -  } else {
> -    my_ipc_h = alt_ipc_h;
> -  }
> -
> -  if (my_ipc_h->fh == VTPM_IPC_CLOSED) {
> -    my_ipc_h->fh = open(my_ipc_h->name, my_ipc_h->flags);
> -  }
> -
> -  if ( my_ipc_h->fh == VTPM_IPC_CLOSED ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM ERROR: Can't open %s for writing.\n", my_ipc_h->name);
> -    return -1;
> -  }
> -
> -  result = write(my_ipc_h->fh, bytes, size);
> -  if (result < 0) {
> -    my_ipc_h->fh = VTPM_IPC_CLOSED;
> -  }
> -
> -  return (result);
> -}
> -
> -// Mark file as closed and try and close it. Errors not reported.
> -void vtpm_ipc_close(vtpm_ipc_handle_t *ipc_h) {
> -
> -  if (ipc_h) {
> -    close(ipc_h->fh);
> -    ipc_h->fh = VTPM_IPC_CLOSED;
> -  }
> -
> -}
> diff --git a/tools/vtpm_manager/manager/vtpm_ipc.h b/tools/vtpm_manager/manager/vtpm_ipc.h
> deleted file mode 100644
> index 529c4a2..0000000
> --- a/tools/vtpm_manager/manager/vtpm_ipc.h
> +++ /dev/null
> @@ -1,71 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_ipc.h Header for interprocess communication between VTPM manager
> -// and Guests or VTPMs
> -//
> -// ===================================================================
> -
> -#ifndef __VTPM_IO_H__
> -#define __VTPM_IO_H__
> -
> -#include "tcg.h"
> -
> -#define VTPM_IPC_CLOSED -1
> -
> -// Represents an (somewhat) abstracted io handle.
> -typedef struct vtpm_ipc_handle_t {
> -  int fh;              // IO handle.
> -  int flags;           // Flags for opening. This may need to become
> -                       // a void *, but for now files use an int.
> -  char *name;          // Names for debugging as well as filenames
> -                       // for file-based io.
> -} vtpm_ipc_handle_t;
> -
> -
> -int vtpm_ipc_init(vtpm_ipc_handle_t *ioh, char* name, int flags, BOOL create);
> -
> -// Create the file that needs opening. Used only for FIFOs
> -// FYI: This may cause problems in other file IO schemes. We'll see.
> -int vtpm_ipc_create(vtpm_ipc_handle_t *ioh);
> -
> -// Read size bytes. If FH isn't open, open it.
> -int vtpm_ipc_read(vtpm_ipc_handle_t *ioh, vtpm_ipc_handle_t *alt_ioh, BYTE *bytes, UINT32 size);
> -
> -// Write size bytes. If FH isn't open, open it.
> -int vtpm_ipc_write(vtpm_ipc_handle_t *ioh, vtpm_ipc_handle_t *alt_ioh, BYTE *bytes, UINT32 size);
> -
> -// Mark file as closed and try and close it. Errors not reported.
> -void vtpm_ipc_close(vtpm_ipc_handle_t *ioh);
> -
> -#endif
> diff --git a/tools/vtpm_manager/manager/vtpm_lock.c b/tools/vtpm_manager/manager/vtpm_lock.c
> deleted file mode 100644
> index e737d60..0000000
> --- a/tools/vtpm_manager/manager/vtpm_lock.c
> +++ /dev/null
> @@ -1,63 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_lock.c Provided controlled sync around access to vtpm structures
> -//
> -// ===================================================================
> -
> -#include <pthread.h>
> -#include "vtpm_lock.h"
> -
> -static pthread_rwlock_t vtpm_lock;
> -
> -void vtpm_lock_init() {
> -
> -  pthread_rwlock_init( &vtpm_lock, NULL);
> -}
> -
> -void vtpm_lock_destroy(){
> -  pthread_rwlock_destroy(&vtpm_lock);
> -}
> -
> -void vtpm_lock_rdlock(){
> -  pthread_rwlock_rdlock(&vtpm_lock);
> -}
> -
> -void vtpm_lock_wrlock(){
> -  pthread_rwlock_wrlock(&vtpm_lock);
> -}
> -
> -void vtpm_lock_unlock(){
> -  pthread_rwlock_unlock(&vtpm_lock);
> -}
> -
> diff --git a/tools/vtpm_manager/manager/vtpm_lock.h b/tools/vtpm_manager/manager/vtpm_lock.h
> deleted file mode 100644
> index 53a339d..0000000
> --- a/tools/vtpm_manager/manager/vtpm_lock.h
> +++ /dev/null
> @@ -1,48 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_lock.h Provided controlled sync around access to vtpm structures
> -//
> -// ===================================================================
> -
> -#ifndef __VTPM_LOCK_H__
> -#define __VTPM_LOCK_H__
> -
> -void vtpm_lock_init();
> -void vtpm_lock_destroy();
> -
> -void vtpm_lock_rdlock();
> -void vtpm_lock_wrlock();
> -void vtpm_lock_unlock();
> -
> -#endif
> diff --git a/tools/vtpm_manager/manager/vtpm_manager.c b/tools/vtpm_manager/manager/vtpm_manager.c
> deleted file mode 100644
> index e089f78..0000000
> --- a/tools/vtpm_manager/manager/vtpm_manager.c
> +++ /dev/null
> @@ -1,285 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_manager.c
> -//
> -//  This file will house the main logic of the VTPM Manager
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <string.h>
> -
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "vtsp.h"
> -#include "bsg.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -
> -#include "log.h"
> -#include "buffer.h"
> -
> -VTPM_GLOBALS *vtpm_globals=NULL;
> -
> -// --------------------------- Well Known Auths --------------------------
> -const TPM_AUTHDATA SRK_AUTH = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
> -                                  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
> -
> -#ifdef WELL_KNOWN_OWNER_AUTH
> -static BYTE FIXED_OWNER_AUTH[20] =  {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
> -                                  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
> -#endif
> -
> -
> -// -------------------------- Hash table functions --------------------
> -
> -static unsigned int hashfunc32(void *ky) {
> -  return (* (UINT32 *) ky);
> -}
> -
> -static int equals32(void *k1, void *k2) {
> -  return (*(UINT32 *) k1 == *(UINT32 *) k2);
> -}
> -
> -// --------------------------- Functions ------------------------------
> -
> -TPM_RESULT VTPM_Create_Manager(){
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  // Generate Auth for Owner
> -#ifdef WELL_KNOWN_OWNER_AUTH
> -  memcpy(vtpm_globals->owner_usage_auth, FIXED_OWNER_AUTH, sizeof(TPM_AUTHDATA));
> -#else
> -  Crypto_GetRandom(vtpm_globals->owner_usage_auth, sizeof(TPM_AUTHDATA) );
> -#endif
> -
> -  // Take Owership of TPM
> -  CRYPTO_INFO ek_cryptoInfo;
> -
> -  status = VTSP_ReadPubek(vtpm_globals->manager_tcs_handle, &ek_cryptoInfo);
> -
> -  // If we can read PubEK then there is no owner and we should take it.
> -  // We use the abilty to read the pubEK to flag that the TPM is owned.
> -  // FIXME: Change to just trying to take ownership and react to the status
> -  if (status == TPM_SUCCESS) {
> -    TPMTRYRETURN(VTSP_TakeOwnership(vtpm_globals->manager_tcs_handle,
> -                                   (const TPM_AUTHDATA*)&vtpm_globals->owner_usage_auth,
> -                                   &SRK_AUTH,
> -                                   &ek_cryptoInfo,
> -                                   &vtpm_globals->keyAuth));
> -
> -    TPMTRYRETURN(VTSP_DisablePubekRead(vtpm_globals->manager_tcs_handle,
> -                                       (const TPM_AUTHDATA*)&vtpm_globals->owner_usage_auth,
> -                                       &vtpm_globals->keyAuth));
> -  } else {
> -    vtpmloginfo(VTPM_LOG_VTPM, "Failed to readEK meaning TPM has an owner. Creating Keys off existing SRK.\n");
> -  }
> -
> -  // Generate storage key's auth
> -  Crypto_GetRandom(  &vtpm_globals->storage_key_usage_auth,
> -                    sizeof(TPM_AUTHDATA) );
> -
> -  TCS_AUTH osap;
> -  TPM_AUTHDATA sharedsecret;
> -
> -  TPMTRYRETURN( VTSP_OSAP(vtpm_globals->manager_tcs_handle,
> -                         TPM_ET_KEYHANDLE,
> -                         TPM_SRK_KEYHANDLE,
> -                         &SRK_AUTH,
> -                         &sharedsecret,
> -                         &osap) );
> -
> -  osap.fContinueAuthSession = FALSE;
> -
> -
> -  TPMTRYRETURN( VTSP_CreateWrapKey( vtpm_globals->manager_tcs_handle,
> -                                   TPM_KEY_BIND,
> -                                   (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
> -                                   TPM_SRK_KEYHANDLE,
> -                                   (const TPM_AUTHDATA*)&sharedsecret,
> -                                   &vtpm_globals->storageKeyWrap,
> -                                   &osap) );
> -
> -  // Generate boot key's auth
> -  TPM_AUTHDATA bootKeyWrapAuth;
> -  memset(&bootKeyWrapAuth, 0, sizeof(bootKeyWrapAuth));
> -
> -  TPMTRYRETURN( VTSP_OSAP(vtpm_globals->manager_tcs_handle,
> -                         TPM_ET_KEYHANDLE,
> -                         TPM_SRK_KEYHANDLE,
> -                         &SRK_AUTH,
> -                         &sharedsecret,
> -                         &osap) );
> -
> -  osap.fContinueAuthSession = FALSE;
> -
> -  // FIXME: This key protects the global secrets on disk. It should use TPM
> -  //        PCR bindings to limit its use to legit configurations.
> -  //        Current binds are open, implying a Trusted VM contains this code.
> -  //        If this VM is not Trusted, use measurement and PCR bindings.
> -  TPMTRYRETURN( VTSP_CreateWrapKey( vtpm_globals->manager_tcs_handle,
> -                                   TPM_KEY_BIND,
> -                                   (const TPM_AUTHDATA*)&bootKeyWrapAuth,
> -                                   TPM_SRK_KEYHANDLE,
> -                                   (const TPM_AUTHDATA*)&sharedsecret,
> -                                   &vtpm_globals->bootKeyWrap,
> -                                   &osap) );
> -
> -  // Populate CRYPTO_INFO vtpm_globals->bootKey. This does not load it into the TPM
> -  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
> -                              TPM_SRK_KEYHANDLE,
> -                              &vtpm_globals->bootKeyWrap,
> -                              NULL,
> -                              NULL,
> -                              NULL,
> -                              &vtpm_globals->bootKey,
> -                              TRUE ) );
> -
> -  TPMTRYRETURN( VTSP_SaveState(vtpm_globals->manager_tcs_handle) );
> -  goto egress;
> -
> - abort_egress:
> -  exit(1);
> -
> - egress:
> -  vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager (Status = %d).\n", status);
> -  return status;
> -
> -}
> -
> -///////////////////////////////////////////////////////////////////////////////
> -TPM_RESULT VTPM_Init_Manager() {
> -  TPM_RESULT status = TPM_FAIL, serviceStatus;
> -  BYTE *randomsead;
> -  UINT32 randomsize=256;
> -
> -  if ((vtpm_globals = (VTPM_GLOBALS *) malloc(sizeof(VTPM_GLOBALS))) == NULL){
> -    status = TPM_FAIL;
> -    goto abort_egress;
> -  }
> -  memset(vtpm_globals, 0, sizeof(VTPM_GLOBALS));
> -
> -  vtpm_globals->connected_dmis = 0;
> -
> -  if ((vtpm_globals->dmi_map = create_hashtable(10, hashfunc32, equals32)) == NULL){
> -    status = TPM_FAIL;
> -    goto abort_egress;
> -  }
> -
> -  // Create new TCS Object
> -  vtpm_globals->manager_tcs_handle = 0;
> -
> -  TPMTRYRETURN(TCS_create());
> -
> -  // Create TCS Context for service
> -  TPMTRYRETURN( TCS_OpenContext(&vtpm_globals->manager_tcs_handle ) );
> -
> -  TPMTRYRETURN( TCSP_GetRandom(vtpm_globals->manager_tcs_handle,
> -                              &randomsize,
> -                              &randomsead));
> -
> -  Crypto_Init(randomsead, randomsize);
> -  TPMTRYRETURN( TCS_FreeMemory (vtpm_globals->manager_tcs_handle, randomsead));
> -
> -  // Create OIAP session for service's authorized commands
> -  TPMTRYRETURN( VTSP_OIAP( vtpm_globals->manager_tcs_handle,
> -                          &vtpm_globals->keyAuth) );
> -  vtpm_globals->keyAuth.fContinueAuthSession = TRUE;
> -
> -  vtpm_globals->mig_keys = NULL;
> -
> -  // If fails, create new Manager.
> -  serviceStatus = VTPM_LoadManagerData();
> -  if (serviceStatus == TPM_IOERROR) {
> -    vtpmloginfo(VTPM_LOG_VTPM, "Failed to read manager file. Assuming first time initialization.\n");
> -    TPMTRYRETURN( VTPM_Create_Manager() );
> -    TPMTRYRETURN( VTPM_SaveManagerData() );
> -  } else if (serviceStatus != TPM_SUCCESS) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to read existing manager file");
> -    exit(1);
> -  }
> -
> -  //Load Storage Key
> -  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
> -                             TPM_SRK_KEYHANDLE,
> -                             &vtpm_globals->storageKeyWrap,
> -                             &SRK_AUTH,
> -                             &vtpm_globals->storageKeyHandle,
> -                             &vtpm_globals->keyAuth,
> -                             &vtpm_globals->storageKey,
> -                              FALSE ) );
> -
> -  // Create entry for Dom0 for control messages
> -  TPMTRYRETURN( VTPM_Handle_New_DMI(NULL) );
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return(status);
> -}
> -
> -///////////////////////////////////////////////////////////////////////////////
> -void VTPM_Stop_Manager() {
> -  VTPM_DMI_RESOURCE *dmi_res;
> -  struct hashtable_itr *dmi_itr;
> -
> -  // Close all the TCS contexts. TCS should evict keys based on this
> -  if (hashtable_count(vtpm_globals->dmi_map) > 0) {
> -    dmi_itr = hashtable_iterator(vtpm_globals->dmi_map);
> -    do {
> -      dmi_res = (VTPM_DMI_RESOURCE *) hashtable_iterator_value(dmi_itr);
> -      if (dmi_res->connected)
> -       close_dmi( dmi_res ); // Not really interested in return code
> -
> -    } while (hashtable_iterator_advance(dmi_itr));
> -               free (dmi_itr);
> -  }
> -
> -  if ( VTPM_SaveManagerData() != TPM_SUCCESS )
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to save manager data.\n");
> -
> -  TCS_CloseContext(vtpm_globals->manager_tcs_handle);
> -  TCS_destroy();
> -
> -  hashtable_destroy(vtpm_globals->dmi_map, 1);
> -  free(vtpm_globals);
> -
> -  Crypto_Exit();
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
> -}
> diff --git a/tools/vtpm_manager/manager/vtpm_manager.h b/tools/vtpm_manager/manager/vtpm_manager.h
> deleted file mode 100644
> index a324a8f..0000000
> --- a/tools/vtpm_manager/manager/vtpm_manager.h
> +++ /dev/null
> @@ -1,150 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_manager.h
> -//
> -//  Public Interface header for VTPM Manager
> -//
> -// ==================================================================
> -
> -#ifndef __VTPM_MANAGER_H__
> -#define __VTPM_MANAGER_H__
> -
> -#define VTPM_TAG_REQ 0x01c1
> -#define VTPM_TAG_RSP 0x01c4
> -#define COMMAND_BUFFER_SIZE 4096
> -
> -// Header sizes. Note Header MAY include the DMI
> -#define VTPM_COMMAND_HEADER_SIZE_CLT ( 2 + 4 + 4)
> -//                    sizeof(TPM_TAG + UINT32 + TPM_COMMAND_CODE)
> -#define VTPM_COMMAND_HEADER_SIZE_SRV ( 4 + VTPM_COMMAND_HEADER_SIZE_CLT )
> -//                    sizeof( UINT32 + VTPM_COMMAND_HEADER_SIZE_CLT)
> -
> -//************************ Command Codes ****************************
> -#define VTPM_ORD_BASE       0x0000
> -#define VTPM_PRIV_MASK      0x01000000 // Priviledged VTPM Command
> -#define VTPM_PRIV_BASE      (VTPM_ORD_BASE | VTPM_PRIV_MASK)
> -
> -// Non-priviledged VTPM Commands (From DMI's)
> -#define VTPM_ORD_SAVENVM      (VTPM_ORD_BASE + 1) // DMI Saves Secrets
> -#define VTPM_ORD_LOADNVM      (VTPM_ORD_BASE + 2) // DMI Loads Secrets
> -#define VTPM_ORD_TPMCOMMAND   (VTPM_ORD_BASE + 3) // DMI issues HW TPM Command
> -#define VTPM_ORD_GET_MIG_KEY  (VTPM_ORD_BASE + 4) // Get manager's migration key
> -#define VTPM_ORD_LOAD_MIG_KEY (VTPM_ORD_BASE + 5) // load dest migration key
> -
> -// Priviledged VTPM Commands (From management console)
> -#define VTPM_ORD_OPEN         (VTPM_PRIV_BASE + 1) // Creates/reopens DMI
> -#define VTPM_ORD_CLOSE        (VTPM_PRIV_BASE + 2) // Closes a DMI
> -#define VTPM_ORD_DELETE       (VTPM_PRIV_BASE + 3) // Permemently Deletes DMI
> -#define VTPM_ORD_MIGRATE_IN   (VTPM_PRIV_BASE + 4) // Load migrated VTPM
> -#define VTPM_ORD_MIGRATE_OUT  (VTPM_PRIV_BASE + 5) // migrate VTPM to dest
> -
> -//************************ Return Codes ****************************
> -#define VTPM_TYPE_PVM 1 // Paravirtualized Domain
> -#define VTPM_TYPE_HVM 2 // HVM Domain
> -
> -//************************ Return Codes ****************************
> -#define VTPM_SUCCESS               0
> -#define VTPM_FAIL                  1
> -#define VTPM_UNSUPPORTED           2
> -#define VTPM_FORBIDDEN             3
> -#define VTPM_RESTORE_CONTEXT_FAILED    4
> -#define VTPM_INVALID_REQUEST       5
> -
> -//*********************** Parameter Values *************************
> -#define VTPM_TYPE_NON_MIGRATABLE  0x00
> -#define VTPM_TYPE_MIGRATABLE      0x01
> -#define VTPM_TYPE_MIGRATED        0xFF // VTPM has been migrated.
> -                                       // VTPM can be recovered or deleted only
> -
> -/******************* Command Parameter API *************************
> -
> -VTPM Command Format
> -  dmi: 4 bytes                  // Source of message.
> -                                // WARNING: This is prepended by the channel.
> -                                // Thus it is received by VTPM Manager,
> -                                // but not sent by DMI
> -  tpm tag: 2 bytes
> -  command size: 4 bytes         // Size of command including header but not DMI
> -  ord: 4 bytes                  // Command ordinal above
> -  parameters: size - 10 bytes   // Command Parameter
> -
> -VTPM Response Format
> -  tpm tag: 2 bytes
> -  response_size: 4 bytes
> -  status: 4 bytes
> -  parameters: size - 10 bytes
> -
> -
> -VTPM_Open:
> -  Input Parameters:
> -    mig_type: 1 byte
> -    startup_mode: 1 byte // Cold Boot = 1, resume = 2, deactive = 3
> -    domain type: 1 byte
> -    instance_id: 4 bytes
> -  Output Parameters:
> -    None
> -
> -VTPM_Close
> -  Input Parameters:
> -    instance_id: 4 bytes
> -  Output Parameters:
> -    None
> -
> -VTPM_Delete
> -  Input Parameters:
> -    instance_id: 4 bytes
> -  Output Parameters:
> -    None
> -
> -VTPM_SaveNVM
> -  Input Parameters:
> -    data: n bytes (Header indicates size of data)
> -  Output Parameters:
> -    None
> -
> -VTPM_LoadNVM
> -  Input Parameters:
> -    None
> -  Output Parameters:
> -    data: n bytes (Header indicates size of data)
> -
> -VTPM_TPMCommand
> -  Input Parameters:
> -    TPM Command Byte Stream: n bytes
> -  Output Parameters:
> -    TPM Reponse Byte Stream: n bytes
> -
> -*********************************************************************/
> -
> -#endif //_VTPM_MANAGER_H_
> diff --git a/tools/vtpm_manager/manager/vtpm_manager_handler.c b/tools/vtpm_manager/manager/vtpm_manager_handler.c
> deleted file mode 100644
> index 2001074..0000000
> --- a/tools/vtpm_manager/manager/vtpm_manager_handler.c
> +++ /dev/null
> @@ -1,488 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_manager_handler.c
> -//
> -//  This file will house the main logic of the VTPM Manager
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <string.h>
> -#include <errno.h>
> -
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "vtsp.h"
> -#include "bsg.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -#include "log.h"
> -#include "buffer.h"
> -
> -#define vtpmhandlerloginfo(module,fmt,args...) vtpmloginfo (module, "[%s]: " fmt, thread_name, ##args );
> -#define vtpmhandlerloginfomore(module,fmt,args...) vtpmloginfomore (module, fmt, ##args );
> -#define vtpmhandlerlogerror(module,fmt,args...) vtpmlogerror (module, "[%s]: " fmt, thread_name, ##args );
> -
> -// ---------------------- Prototypes -------------------
> -TPM_RESULT vtpm_manager_handle_vtpm_cmd(VTPM_DMI_RESOURCE *dmi_res,
> -                                       TPM_COMMAND_CODE ord,
> -                                       buffer_t *command_buf,
> -                                       buffer_t *result_buf,
> -                                        BOOL is_priv,
> -                                        char *thread_name);
> -
> -TPM_RESULT vtpm_manager_handle_tpm_cmd(vtpm_ipc_handle_t *tx_ipc_h,
> -                                       vtpm_ipc_handle_t *rx_ipc_h,
> -                                       VTPM_DMI_RESOURCE *dmi_res,
> -                                       BYTE *cmd_header,
> -                                       buffer_t *param_buf,
> -                                       buffer_t *result_buf,
> -                                       char *thread_name);
> -
> -TPM_RESULT VTPM_Manager_Handler( vtpm_ipc_handle_t *tx_ipc_h,
> -                                 vtpm_ipc_handle_t *rx_ipc_h,
> -                                 BOOL fw_tpm,   // Forward TPM cmds?
> -                                 vtpm_ipc_handle_t *fw_tx_ipc_h,
> -                                 vtpm_ipc_handle_t *fw_rx_ipc_h,
> -                                 BOOL is_priv,
> -                                 char *thread_name) {
> -  TPM_RESULT      status =  TPM_FAIL; // Should never return
> -  UINT32          dmi, in_param_size, cmd_size, out_param_size, out_message_size, reply_size;
> -  BYTE            *cmd_header=NULL, *in_param=NULL, *out_message=NULL, *reply;
> -  buffer_t        *command_buf=NULL, *result_buf=NULL;
> -  TPM_TAG         tag;
> -  TPM_COMMAND_CODE ord;
> -  VTPM_DMI_RESOURCE *dmi_res;
> -  int  size_read, size_write, i;
> -  BOOL add_header=TRUE; // This indicates to prepend a header on result_buf before sending
> -
> -  cmd_header = (BYTE *) malloc(VTPM_COMMAND_HEADER_SIZE_SRV);
> -  command_buf = (buffer_t *) malloc(sizeof(buffer_t));
> -  result_buf = (buffer_t *) malloc(sizeof(buffer_t));
> -
> -  // ------------------------ Main Loop --------------------------------
> -  while(1) {
> -
> -    vtpmhandlerloginfo(VTPM_LOG_VTPM, "%s waiting for messages.\n", thread_name);
> -
> -    // --------------------- Read Cmd from Sender ----------------
> -
> -    // Read command header
> -    size_read = vtpm_ipc_read(rx_ipc_h, NULL, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -    if (size_read > 0) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "RECV[%d]: 0x", size_read);
> -      for (i=0; i<size_read; i++)
> -       vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s can't read from ipc. Errono = %d. Aborting... \n", thread_name, errno);
> -      goto abort_command;
> -    }
> -
> -    if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "\n");
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command shorter than normal header (%d bytes). Aborting...\n", size_read);
> -      goto abort_command;
> -    }
> -
> -    // Unpack header
> -    BSG_UnpackList(cmd_header, 4,
> -                  BSG_TYPE_UINT32, &dmi,
> -                  BSG_TPM_TAG, &tag,
> -                  BSG_TYPE_UINT32, &in_param_size,
> -                  BSG_TPM_COMMAND_CODE, &ord );
> -
> -    // Using the header info, read the parameters of the command
> -    // Note that in_param_size is in the client's context
> -    cmd_size = in_param_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> -    if (cmd_size > 0) {
> -      in_param = (BYTE *) malloc(cmd_size);
> -      size_read = vtpm_ipc_read( rx_ipc_h, NULL, in_param, cmd_size);
> -      if (size_read > 0) {
> -       for (i=0; i<size_read; i++)
> -         vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
> -
> -      } else {
> -        vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s had error reading cmd from ipc. Aborting... \n", thread_name);
> -       goto abort_command;
> -      }
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -      if (size_read < (int) cmd_size) {
> -       vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -       vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d). Aborting...\n", size_read, cmd_size);
> -       goto abort_command;
> -      }
> -    } else {
> -      in_param = NULL;
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -    }
> -
> -    // Init the buffers used to handle the command and the response
> -    if ( (buffer_init_convert(command_buf, cmd_size, in_param) != TPM_SUCCESS) ||
> -        (buffer_init(result_buf, 0, 0) != TPM_SUCCESS) ) {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Failed to setup buffers. Aborting...\n");
> -      goto abort_command;
> -    }
> -
> -    // -------------- Dispatch Commands to Handlers -----------
> -    if ((tag == VTPM_TAG_REQ) && (ord & VTPM_PRIV_MASK)) {
> -      vtpm_lock_wrlock();
> -    } else {
> -      vtpm_lock_rdlock();
> -    }
> -
> -    if ( !(dmi_res = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi)) ||
> -         (!dmi_res->connected) ) {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Attempted access to non-existent or disconnected DMI %d. Aborting...\n", dmi);
> -      status = TPM_BAD_PARAMETER;
> -      // We have no one to reply to, they don't exist.
> -      goto abort_command;
> -    }
> -
> -    if (tag == VTPM_TAG_REQ) {
> -
> -      status = vtpm_manager_handle_vtpm_cmd(dmi_res, ord, command_buf, result_buf, is_priv, thread_name);
> -
> -    } else { // This is not a VTPM Command at all.
> -      if (fw_tpm) {
> -        status = vtpm_manager_handle_tpm_cmd(fw_tx_ipc_h, fw_rx_ipc_h, dmi_res, cmd_header, command_buf, result_buf, thread_name);
> -
> -        // This means calling the DMI failed, not that the cmd failed in the DMI
> -        // Since the return will be interpretted by a TPM app, all errors are IO_ERRORs to the app
> -        if (status != TPM_SUCCESS) {
> -          status = TPM_IOERROR;
> -         goto abort_with_error;
> -        }
> -        // Unlike all other commands, forwarded commands yield a result_buf that includes the DMI's status. This
> -        // should be forwarded to the caller VM
> -        add_header = FALSE;
> -      } else {
> -        // We are not supposed to forward TPM commands at all.
> -        int i;
> -        vtpmhandlerlogerror(VTPM_LOG_VTPM, "Attempt to use unsupported direct access to TPM.\n");
> -        vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "Bad Command. dmi:%d, tag:%d, size:%d, ord:%d, Params: ", dmi, tag, in_param_size, ord);
> -        for (i=0; i<cmd_size; i++)
> -          vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
> -
> -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -        status = TPM_FAIL;
> -        goto abort_with_error;
> -     }
> -
> -    } // end else for is VTPM Command
> -
> -    // ------------------- Respond to Sender ------------------
> -
> -    // Errors while handling responses jump here to reply with error messages
> -    // NOTE: Currently there are no recoverable errors in multi-VM mode. If one
> -    //       is added to the code, this ifdef should be removed.
> -    //       Also note this is NOT referring to errors in commands, but rather
> -    //       this is about I/O errors and such.
> -#ifndef VTPM_MULTI_VM
> - abort_with_error:
> -#endif
> -
> -    if (add_header) {
> -      // Prepend VTPM header with destination DM stamped
> -      out_param_size = buffer_len(result_buf);
> -      out_message_size = VTPM_COMMAND_HEADER_SIZE_CLT + out_param_size;
> -      reply_size = VTPM_COMMAND_HEADER_SIZE_SRV + out_param_size;
> -      out_message = (BYTE *) malloc (reply_size);
> -      reply = out_message;
> -
> -      BSG_PackList(out_message, 4,
> -                  BSG_TYPE_UINT32, (BYTE *) &dmi,
> -                  BSG_TPM_TAG, (BYTE *) &tag,
> -                  BSG_TYPE_UINT32, (BYTE *) &out_message_size,
> -                  BSG_TPM_RESULT, (BYTE *) &status);
> -
> -      if (buffer_len(result_buf) > 0)
> -        memcpy(out_message + VTPM_COMMAND_HEADER_SIZE_SRV, result_buf->bytes, out_param_size);
> -      //Note: Send message + dmi_id
> -    } else {
> -      reply = result_buf->bytes;
> -      reply_size = buffer_len(result_buf);
> -    }
> -    size_write = vtpm_ipc_write(tx_ipc_h, (dmi_res ? dmi_res->tx_vtpm_ipc_h : NULL), reply, reply_size );
> -    if (size_write > 0) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT: 0x");
> -      for (i=0; i < reply_size; i++)
> -       vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", reply[i]);
> -
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s had error writing to ipc. Aborting... \n", thread_name);
> -      goto abort_command;
> -    }
> -    free(out_message); out_message=NULL;
> -
> -    if (size_write < (int)reply_size) {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s unable to write full command to ipc (%d/%d)\n", thread_name, size_write, reply_size);
> -      goto abort_command;
> -    }
> -
> -    // On certain failures an error message cannot be sent.
> -    // This marks the beginning of cleanup in preperation for the next command.
> -  abort_command:
> -    //free buffers
> -    bzero(cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -    //free(in_param); // This was converted to command_buf. No need to free
> -    buffer_free(result_buf);
> -    buffer_free(command_buf);
> -
> -    // If we have a write lock, save the manager table
> -    if ((tag == VTPM_TAG_REQ) && (ord & VTPM_PRIV_MASK) &&
> -        (VTPM_SaveManagerData() != TPM_SUCCESS) ) {
> -       vtpmhandlerlogerror(VTPM_LOG_VTPM, "ERROR: Unable to save manager data.\n");
> -    }
> -
> -    vtpm_lock_unlock();
> -    add_header = TRUE; // Reset to the default
> -  } // End while(1)
> -
> -}
> -
> -/////////////////////////////////////////////////////////////////////////
> -TPM_RESULT vtpm_manager_handle_vtpm_cmd(VTPM_DMI_RESOURCE *dmi_res,
> -                                       TPM_COMMAND_CODE ord,
> -                                       buffer_t *command_buf,
> -                                       buffer_t *result_buf,
> -                                        BOOL is_priv,
> -                                        char *thread_name) {
> -
> -  TPM_RESULT status = TPM_FAIL;
> -
> -  switch (ord) {
> -  case VTPM_ORD_SAVENVM:
> -    status= VTPM_Handle_Save_NVM(dmi_res,
> -                                 command_buf,
> -                                 result_buf);
> -    break;
> -
> -  case VTPM_ORD_LOADNVM:
> -    status= VTPM_Handle_Load_NVM(dmi_res,
> -                                 command_buf,
> -                                 result_buf);
> -    break;
> -
> -  case VTPM_ORD_TPMCOMMAND:
> -    status= VTPM_Handle_TPM_Command(dmi_res,
> -                                    command_buf,
> -                                    result_buf);
> -    break;
> -
> -  case VTPM_ORD_GET_MIG_KEY:
> -    status = VTPM_Handle_Get_Migration_key(command_buf,
> -                                           result_buf);
> -    break;
> -
> -  case VTPM_ORD_LOAD_MIG_KEY:
> -    status = VTPM_Handle_Load_Migration_key(command_buf,
> -                                           result_buf);
> -    break;
> -
> -  default:
> -    // Privileged handlers can do maintanance
> -    if (is_priv) {
> -      switch (ord) {
> -      case VTPM_ORD_OPEN:
> -        status = VTPM_Handle_New_DMI(command_buf);
> -        break;
> -
> -      case VTPM_ORD_CLOSE:
> -        status = VTPM_Handle_Close_DMI(command_buf);
> -        break;
> -
> -      case VTPM_ORD_DELETE:
> -        status = VTPM_Handle_Delete_DMI(command_buf);
> -        break;
> -
> -      case VTPM_ORD_MIGRATE_IN:
> -        status = VTPM_Handle_Migrate_In(command_buf, result_buf);
> -        break;
> -
> -      case VTPM_ORD_MIGRATE_OUT:
> -        status = VTPM_Handle_Migrate_Out(command_buf, result_buf);
> -        break;
> -
> -      default:
> -        status = TPM_BAD_ORDINAL;
> -      } // switch
> -    } else { // is priv command
> -
> -        status = TPM_BAD_ORDINAL;
> -    } // inner switch
> -  } // outer switch
> -
> -  return(status);
> -}
> -
> -/////////////////////////////////////////////////////////////////////
> -TPM_RESULT vtpm_manager_handle_tpm_cmd(vtpm_ipc_handle_t *tx_ipc_h,
> -                                       vtpm_ipc_handle_t *rx_ipc_h,
> -                                      VTPM_DMI_RESOURCE *dmi_res,
> -                                      BYTE *cmd_header,
> -                                      buffer_t *param_buf,
> -                                      buffer_t *result_buf,
> -                                       char *thread_name) {
> -
> -  TPM_RESULT status = TPM_FAIL;
> -  UINT32 dmi_dst;
> -  TPM_COMMAND_CODE ord;
> -  TPM_TAG tag_out;
> -  UINT32 dmi_cmd_size, in_param_size, adj_param_size;
> -  BYTE *dmi_cmd, *in_param;
> -  int  size_read, size_write, i;
> -
> -  //// Dom0 can't talk to the BE, so this must be a broken FE/BE or badness
> -  if (dmi_res->dmi_id == VTPM_CTL_DM) {
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Illegal use of TPM command from dom0\n");
> -    status = TPM_FAIL;
> -    goto abort_with_error;
> -  }
> -
> -  vtpmhandlerloginfo(VTPM_LOG_VTPM, "Forwarding command to DMI.\n");
> -
> -  //Forward TPM CMD stamped with dmi_id to DMI for handling
> -  if (buffer_len(param_buf)) {
> -    dmi_cmd = (BYTE *) malloc(VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf));
> -    dmi_cmd_size = VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf);
> -    memcpy(dmi_cmd, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -    memcpy(dmi_cmd + VTPM_COMMAND_HEADER_SIZE_SRV, param_buf->bytes, buffer_len(param_buf));
> -    size_write = vtpm_ipc_write(tx_ipc_h, dmi_res->tx_tpm_ipc_h, dmi_cmd, dmi_cmd_size);
> -
> -    if (size_write > 0) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT (DMI): 0x");
> -      for (i=0; i<VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf); i++) {
> -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", dmi_cmd[i]);
> -      }
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error writing to DMI. Aborting... \n");
> -      status = TPM_IOERROR;
> -      goto abort_with_error;
> -    }
> -    free(dmi_cmd);
> -  } else {
> -    dmi_cmd_size = VTPM_COMMAND_HEADER_SIZE_SRV;
> -    size_write = vtpm_ipc_write(tx_ipc_h, dmi_res->tx_tpm_ipc_h, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV );
> -    if (size_write > 0) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT (DMI): 0x");
> -      for (i=0; i<VTPM_COMMAND_HEADER_SIZE_SRV; i++)
> -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> -
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error writing to DMI. Aborting... \n");
> -      status = TPM_IOERROR;
> -      goto abort_with_error;
> -    }
> -  }
> -
> -  if (size_write != (int) dmi_cmd_size)
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Could not write entire command to DMI (%d/%d)\n", size_write, dmi_cmd_size);
> -
> -  buffer_free(param_buf);
> -
> -  // Read header for response to TPM command from DMI
> -  size_read = vtpm_ipc_read( rx_ipc_h, dmi_res->rx_tpm_ipc_h, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -  if (size_read > 0) {
> -    vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "RECV (DMI): 0x");
> -    for (i=0; i<size_read; i++)
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> -
> -  } else {
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error reading from DMI. Aborting... \n");
> -    status = TPM_IOERROR;
> -    goto abort_with_error;
> -  }
> -
> -  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command from DMI shorter than normal header. Aborting...\n");
> -    status = TPM_IOERROR;
> -    goto abort_with_error;
> -  }
> -
> -  // Unpack response from DMI for TPM command
> -  BSG_UnpackList(cmd_header, 4,
> -                 BSG_TYPE_UINT32, &dmi_dst,
> -                 BSG_TPM_TAG, &tag_out,
> -                 BSG_TYPE_UINT32, &in_param_size,
> -                 BSG_TPM_COMMAND_CODE, &status );
> -
> -  // If response has parameters, read them.
> -  // Note that in_param_size is in the client's context
> -  adj_param_size = in_param_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> -  if (adj_param_size > 0) {
> -    in_param = (BYTE *) malloc(adj_param_size);
> -    size_read = vtpm_ipc_read(rx_ipc_h, dmi_res->rx_tpm_ipc_h, in_param, adj_param_size);
> -    if (size_read > 0) {
> -      for (i=0; i<size_read; i++)
> -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
> -
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error reading from BE. Aborting... \n");
> -      goto abort_with_error;
> -    }
> -    vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
> -
> -    if (size_read < (int)adj_param_size) {
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command read(%d) from DMI is shorter than header indicates(%d). Aborting...\n", size_read, adj_param_size);
> -      status = TPM_IOERROR;
> -      goto abort_with_error;
> -    }
> -  } else {
> -    in_param = NULL;
> -    vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
> -  }
> -
> -  if ( (buffer_init(result_buf, VTPM_COMMAND_HEADER_SIZE_SRV, cmd_header) != TPM_SUCCESS) ||
> -       (buffer_append_raw(result_buf, adj_param_size, in_param) != TPM_SUCCESS) ) {
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Failed to setup buffers. Aborting...\n");
> -    status = TPM_FAIL;
> -    goto abort_with_error;
> -  }
> -
> -  vtpmhandlerloginfo(VTPM_LOG_VTPM, "Sending DMI's response to guest.\n");
> -
> -  status = TPM_SUCCESS;
> -
> - abort_with_error:
> -
> -  return status;
> -}
> -
> diff --git a/tools/vtpm_manager/manager/vtpmd.c b/tools/vtpm_manager/manager/vtpmd.c
> deleted file mode 100644
> index cf58ba3..0000000
> --- a/tools/vtpm_manager/manager/vtpmd.c
> +++ /dev/null
> @@ -1,371 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpmd.c
> -//
> -//  Application
> -//
> -// ===================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <sys/types.h>
> -#include <sys/stat.h>
> -#include <fcntl.h>
> -#include <signal.h>
> -#include <string.h>
> -#include <pthread.h>
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "tcg.h"
> -#include "log.h"
> -#include "vtpm_ipc.h"
> -
> -#define TPM_EMULATOR_PATH "/usr/bin/vtpmd"
> -
> -#define VTPM_BE_FNAME          "/dev/vtpm"
> -#define VTPM_DUMMY_TX_BE_FNAME "/var/vtpm/fifos/dummy_out.fifo"
> -#define VTPM_DUMMY_RX_BE_FNAME "/var/vtpm/fifos/dummy_in.fifo"
> -#define VTPM_TX_TPM_FNAME      "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
> -#define VTPM_RX_TPM_FNAME      "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
> -#define VTPM_TX_VTPM_FNAME     "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
> -#define VTPM_RX_VTPM_FNAME     "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
> -#define VTPM_TX_HP_FNAME       "/var/vtpm/fifos/to_console.fifo"
> -#define VTPM_RX_HP_FNAME       "/var/vtpm/fifos/from_console.fifo"
> -
> -#define VTPM_TYPE_PVM_STRING "pvm"
> -#define VTPM_TYPE_HVM_STRING "hvm"
> -
> -struct vtpm_thread_params_s {
> -  vtpm_ipc_handle_t *tx_ipc_h;
> -  vtpm_ipc_handle_t *rx_ipc_h;
> -  BOOL fw_tpm;
> -  vtpm_ipc_handle_t *fw_tx_ipc_h;
> -  vtpm_ipc_handle_t *fw_rx_ipc_h;
> -  BOOL is_priv;
> -  char *thread_name;
> -};
> -
> -// This is needed to all extra_close_dmi to close this to prevent a
> -// broken pipe when no DMIs are left.
> -static vtpm_ipc_handle_t *g_rx_tpm_ipc_h;
> -
> -void *vtpm_manager_thread(void *arg_void) {
> -  TPM_RESULT *status = (TPM_RESULT *) malloc(sizeof(TPM_RESULT) );
> -  struct vtpm_thread_params_s *arg = (struct vtpm_thread_params_s *) arg_void;
> -
> -  *status = VTPM_Manager_Handler(arg->tx_ipc_h, arg->rx_ipc_h,
> -                                 arg->fw_tpm, arg->fw_tx_ipc_h, arg->fw_rx_ipc_h,
> -                                 arg->is_priv, arg->thread_name);
> -
> -  return (status);
> -}
> -
> -
> -void signal_handler(int reason) {
> -  if (pthread_equal(pthread_self(), vtpm_globals->master_pid)) {
> -    vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager shutting down for signal %d.\n", reason);
> -  } else {
> -    // For old Linux Thread machines, signals are delivered to each thread. Deal with them.
> -    vtpmloginfo(VTPM_LOG_VTPM, "Child shutting down\n");
> -    pthread_exit(NULL);
> -  }
> -
> -  VTPM_Stop_Manager();
> -  exit(-1);
> -}
> -
> -struct sigaction ctl_c_handler;
> -
> -TPM_RESULT VTPM_New_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res, BYTE vm_type, BYTE startup_mode) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  int fh;
> -  char dmi_id_str[11]; // UINT32s are up to 10 digits + NULL
> -  char *tx_vtpm_name, *tx_tpm_name, *vm_type_string;
> -  struct stat file_info;
> -
> -  if (dmi_res->dmi_id == VTPM_CTL_DM) {
> -    dmi_res->tx_tpm_ipc_h = NULL;
> -    dmi_res->rx_tpm_ipc_h = NULL;
> -    dmi_res->tx_vtpm_ipc_h = NULL;
> -    dmi_res->rx_vtpm_ipc_h = NULL;
> -  } else {
> -    // Create a pair of fifo pipes
> -    dmi_res->rx_tpm_ipc_h = NULL;
> -    dmi_res->rx_vtpm_ipc_h = NULL;
> -
> -    if ( ((dmi_res->tx_tpm_ipc_h = (vtpm_ipc_handle_t *) malloc (sizeof(vtpm_ipc_handle_t))) == NULL ) ||
> -         ((dmi_res->tx_vtpm_ipc_h =(vtpm_ipc_handle_t *) malloc (sizeof(vtpm_ipc_handle_t))) == NULL ) ||
> -         ((tx_tpm_name = (char *) malloc(11 + strlen(VTPM_TX_TPM_FNAME))) == NULL ) ||
> -         ((tx_vtpm_name =(char *) malloc(11 + strlen(VTPM_TX_VTPM_FNAME))) == NULL) ) {
> -      status =TPM_RESOURCES;
> -      goto abort_egress;
> -    }
> -
> -    sprintf(tx_tpm_name, VTPM_TX_TPM_FNAME, (uint32_t) dmi_res->dmi_id);
> -    sprintf(tx_vtpm_name, VTPM_TX_VTPM_FNAME, (uint32_t) dmi_res->dmi_id);
> -
> -    if ( (vtpm_ipc_init(dmi_res->tx_tpm_ipc_h, tx_tpm_name, O_WRONLY | O_NONBLOCK, TRUE) != 0) ||
> -         (vtpm_ipc_init(dmi_res->tx_vtpm_ipc_h, tx_vtpm_name, O_WRONLY, TRUE) != 0) ) { //FIXME: O_NONBLOCK?
> -      status = TPM_IOERROR;
> -      goto abort_egress;
> -    }
> -
> -    // Measure DMI
> -    // FIXME: This will measure DMI. Until then use a fixed DMI_Measurement value
> -    // Also, this mechanism is specific to 1 VM architecture.
> -    /*
> -    fh = open(TPM_EMULATOR_PATH, O_RDONLY);
> -    stat_ret = fstat(fh, &file_stat);
> -    if (stat_ret == 0)
> -      dmi_size = file_stat.st_size;
> -    else {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Could not open vtpmd!!\n");
> -      status = TPM_IOERROR;
> -      goto abort_egress;
> -    }
> -    dmi_buffer
> -    */
> -    memset(&dmi_res->DMI_measurement, 0xcc, sizeof(TPM_DIGEST));
> -
> -    if (vm_type == VTPM_TYPE_PVM)
> -      vm_type_string = (BYTE *)&VTPM_TYPE_PVM_STRING;
> -    else
> -      vm_type_string = (BYTE *)&VTPM_TYPE_HVM_STRING;
> -
> -    // Launch DMI
> -    sprintf(dmi_id_str, "%d", (int) dmi_res->dmi_id);
> -#ifdef MANUAL_DM_LAUNCH
> -    vtpmlogerror(VTPM_LOG_VTPM, "Manually start VTPM with dmi=%s now.\n", dmi_id_str);
> -    dmi_res->dmi_pid = 0;
> -#else
> -    pid_t pid = fork();
> -
> -    if (pid == -1) {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Could not fork to launch vtpm\n");
> -      status = TPM_RESOURCES;
> -      goto abort_egress;
> -    } else if (pid == 0) {
> -      switch (startup_mode) {
> -      case TPM_ST_CLEAR:
> -        execl (TPM_EMULATOR_PATH, "vtpmd", "clear", vm_type_string, dmi_id_str, NULL);
> -        break;
> -      case TPM_ST_STATE:
> -        execl (TPM_EMULATOR_PATH, "vtpmd", "save", vm_type_string, dmi_id_str, NULL);
> -        break;
> -      case TPM_ST_DEACTIVATED:
> -        execl (TPM_EMULATOR_PATH, "vtpmd", "deactivated", vm_type_string, dmi_id_str, NULL);
> -        break;
> -      default:
> -        status = TPM_BAD_PARAMETER;
> -        goto abort_egress;
> -      }
> -
> -      // Returning from these at all is an error.
> -      vtpmlogerror(VTPM_LOG_VTPM, "Could not exec to launch vtpm\n");
> -    } else {
> -      dmi_res->dmi_pid = pid;
> -      vtpmloginfo(VTPM_LOG_VTPM, "Launching DMI on PID = %d\n", pid);
> -    }
> -#endif // MANUAL_DM_LAUNCH
> -
> -  } // If DMI = VTPM_CTL_DM
> -    status = TPM_SUCCESS;
> -
> -abort_egress:
> -  return (status);
> -}
> -
> -TPM_RESULT VTPM_Close_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  if (vtpm_globals->connected_dmis == 0) {
> -    // No more DMI's connected. Close fifo to prevent a broken pipe.
> -    // This is hackish. Need to think of another way.
> -    vtpm_ipc_close(g_rx_tpm_ipc_h);
> -  }
> -
> -
> -  if (dmi_res->dmi_id != VTPM_CTL_DM) {
> -    vtpm_ipc_close(dmi_res->tx_tpm_ipc_h);
> -    vtpm_ipc_close(dmi_res->tx_vtpm_ipc_h);
> -
> -    free(dmi_res->tx_tpm_ipc_h->name);
> -    free(dmi_res->tx_vtpm_ipc_h->name);
> -
> -#ifndef MANUAL_DM_LAUNCH
> -    if (dmi_res->dmi_id != VTPM_CTL_DM) {
> -      if (dmi_res->dmi_pid != 0) {
> -        vtpmloginfo(VTPM_LOG_VTPM, "Killing dmi on pid %d.\n", dmi_res->dmi_pid);
> -        if (kill(dmi_res->dmi_pid, SIGKILL) !=0) {
> -          vtpmloginfo(VTPM_LOG_VTPM, "DMI on pid %d is already dead.\n", dmi_res->dmi_pid);
> -        } else if (waitpid(dmi_res->dmi_pid, NULL, 0) != dmi_res->dmi_pid) {
> -          vtpmlogerror(VTPM_LOG_VTPM, "DMI on pid %d failed to stop.\n", dmi_res->dmi_pid);
> -          status = TPM_FAIL;
> -        }
> -      } else {
> -        vtpmlogerror(VTPM_LOG_VTPM, "Could not kill dmi because it's pid was 0.\n");
> -        status = TPM_FAIL;
> -      }
> -    }
> -#endif
> -
> -  } //endif ! dom0
> -  return status;
> -}
> -
> -
> -int main(int argc, char **argv) {
> -  vtpm_ipc_handle_t *tx_be_ipc_h, *rx_be_ipc_h, rx_tpm_ipc_h, rx_vtpm_ipc_h, tx_hp_ipc_h, rx_hp_ipc_h;
> -  struct vtpm_thread_params_s be_thread_params, dmi_thread_params, hp_thread_params;
> -  pthread_t be_thread, dmi_thread, hp_thread;
> -
> -#ifdef DUMMY_BACKEND
> -  vtpm_ipc_handle_t tx_dummy_ipc_h, rx_dummy_ipc_h;
> -#else
> -  vtpm_ipc_handle_t real_be_ipc_h;
> -#endif
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Starting VTPM.\n");
> -
> -  // -------------------- Initialize Manager -----------------
> -  if (VTPM_Init_Manager() != TPM_SUCCESS) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing vtpmd due to error during startup.\n");
> -    return -1;
> -  }
> -
> -  // -------------------- Setup Ctrl+C Handlers --------------
> -  ctl_c_handler.sa_handler = signal_handler;
> -  sigemptyset(&ctl_c_handler.sa_mask);
> -  ctl_c_handler.sa_flags = 0;
> -
> -  if (sigaction(SIGINT, &ctl_c_handler, NULL) == -1)
> -    vtpmlogerror(VTPM_LOG_VTPM, "Could not install SIGINT handler. Ctl+break will not stop manager gently.\n");
> -
> -  // For easier debuggin with gdb
> -  if (sigaction(SIGHUP, &ctl_c_handler, NULL) == -1)
> -    vtpmlogerror(VTPM_LOG_VTPM, "Could not install SIGHUP handler. Ctl+break will not stop manager gently.\n");
> -
> -  sigset_t sig_mask;
> -  sigemptyset(&sig_mask);
> -  sigaddset(&sig_mask, SIGPIPE);
> -  sigprocmask(SIG_BLOCK, &sig_mask, NULL);
> -
> -  // ------------------- Set up file ipc structures ----------
> -#ifdef DUMMY_BACKEND
> -  if ( (vtpm_ipc_init(&tx_dummy_ipc_h, VTPM_DUMMY_TX_BE_FNAME, O_RDWR, TRUE) != 0) ||
> -       (vtpm_ipc_init(&rx_dummy_ipc_h, VTPM_DUMMY_RX_BE_FNAME, O_RDWR, TRUE) != 0) ) {
> -
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to create Dummy BE FIFOs.\n");
> -    exit(-1);
> -  }
> -
> -  tx_be_ipc_h = &tx_dummy_ipc_h;
> -  rx_be_ipc_h = &rx_dummy_ipc_h;
> -#else
> -  vtpm_ipc_init(&real_be_ipc_h, VTPM_BE_FNAME, O_RDWR, FALSE);
> -
> -  tx_be_ipc_h = &real_be_ipc_h;
> -  rx_be_ipc_h = &real_be_ipc_h;
> -#endif
> -
> -  if ( (vtpm_ipc_init(&rx_tpm_ipc_h, VTPM_RX_TPM_FNAME, O_RDONLY, TRUE) != 0) ||
> -       (vtpm_ipc_init(&rx_vtpm_ipc_h, VTPM_RX_VTPM_FNAME, O_RDWR, TRUE) != 0) || //FIXME: O_RDONLY?
> -       (vtpm_ipc_init(&tx_hp_ipc_h,  VTPM_TX_HP_FNAME, O_RDWR, TRUE) != 0)    ||
> -       (vtpm_ipc_init(&rx_hp_ipc_h,  VTPM_RX_HP_FNAME, O_RDWR, TRUE) != 0) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to create initial FIFOs.\n");
> -    exit(-1);
> -  }
> -
> -  g_rx_tpm_ipc_h = &rx_tpm_ipc_h;
> -
> -  // -------------------- Set up thread params -------------
> -
> -  be_thread_params.tx_ipc_h = tx_be_ipc_h;
> -  be_thread_params.rx_ipc_h = rx_be_ipc_h;
> -  be_thread_params.fw_tpm = TRUE;
> -  be_thread_params.fw_tx_ipc_h = NULL;
> -  be_thread_params.fw_rx_ipc_h = &rx_tpm_ipc_h;
> -  be_thread_params.is_priv = FALSE;
> -  be_thread_params.thread_name = "Backend Listener";
> -
> -  dmi_thread_params.tx_ipc_h = NULL;
> -  dmi_thread_params.rx_ipc_h = &rx_vtpm_ipc_h;
> -  dmi_thread_params.fw_tpm = FALSE;
> -  dmi_thread_params.fw_tx_ipc_h = NULL;
> -  dmi_thread_params.fw_rx_ipc_h = NULL;
> -  dmi_thread_params.is_priv = FALSE;
> -  dmi_thread_params.thread_name = "VTPM Listener";
> -
> -  hp_thread_params.tx_ipc_h = &tx_hp_ipc_h;
> -  hp_thread_params.rx_ipc_h = &rx_hp_ipc_h;
> -  hp_thread_params.fw_tpm = FALSE;
> -  hp_thread_params.fw_tx_ipc_h = NULL;
> -  hp_thread_params.fw_rx_ipc_h = NULL;
> -  hp_thread_params.is_priv = TRUE;
> -  hp_thread_params.thread_name = "Hotplug Listener";
> -
> -  // --------------------- Launch Threads -----------------
> -
> -  vtpm_lock_init();
> -
> -  vtpm_globals->master_pid = pthread_self();
> -
> -  if (pthread_create(&be_thread, NULL, vtpm_manager_thread, &be_thread_params) != 0) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch BE Thread.\n");
> -    exit(-1);
> -  }
> -
> -  if (pthread_create(&dmi_thread, NULL, vtpm_manager_thread, &dmi_thread_params) != 0) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch DMI Thread.\n");
> -    exit(-1);
> -  }
> -
> -
> -  if (pthread_create(&hp_thread, NULL, vtpm_manager_thread, &hp_thread_params) != 0) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch HP Thread.\n");
> -    exit(-1);
> -  }
> -
> -  //Join the other threads until exit time.
> -  pthread_join(be_thread, NULL);
> -  pthread_join(dmi_thread, NULL);
> -  pthread_join(hp_thread, NULL);
> -
> -  vtpmlogerror(VTPM_LOG_VTPM, "VTPM Manager shut down unexpectedly.\n");
> -
> -  VTPM_Stop_Manager();
> -  vtpm_lock_destroy();
> -  return 0;
> -}
> diff --git a/tools/vtpm_manager/manager/vtpmpriv.h b/tools/vtpm_manager/manager/vtpmpriv.h
> deleted file mode 100644
> index 41e8d2d..0000000
> --- a/tools/vtpm_manager/manager/vtpmpriv.h
> +++ /dev/null
> @@ -1,186 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpmpriv.h
> -//
> -//  Structures and functions private to the manager
> -//
> -// ==================================================================
> -
> -#ifndef __VTPMPRIV_H__
> -#define __VTPMPRIV_H__
> -
> -#include "vtpm_manager.h"
> -#include "tcg.h"
> -#include "tcs.h"
> -#include "buffer.h"
> -#include "crypto.h"
> -#include "vtpm_ipc.h"
> -
> -#define VTPM_MANAGER_GEN   2     // This is incremented when the manager's table
> -                                 // is changed. It's used for backwards compatability
> -
> -#define STATE_FILE         "/var/vtpm/VTPM"
> -#define DMI_NVM_FILE       "/var/vtpm/vtpm_dm_%d.data"
> -#define VTPM_CTL_DM        0
> -
> -// ------------------------ Private Structures -----------------------
> -typedef struct VTPM_DMI_RESOURCE_T {
> -  // I/O info for Manager to talk to DMI's and controllers
> -  vtpm_ipc_handle_t      *tx_vtpm_ipc_h;    // TX VTPM Results to DMI
> -  vtpm_ipc_handle_t      *rx_vtpm_ipc_h;    // RX VTPM Commands from DMI
> -  vtpm_ipc_handle_t      *tx_tpm_ipc_h;     // TX TPM Commands to DMI
> -  vtpm_ipc_handle_t      *rx_tpm_ipc_h;     // RX TPM Results from DMI
> -
> -#ifndef VTPM_MULTI_VM
> -  pid_t                 dmi_pid;
> -#endif
> -
> -  // Non-persistent Information
> -  bool                  connected;
> -  UINT32                dmi_domain_id;
> -  TCS_CONTEXT_HANDLE    TCSContext;     // TCS Handle
> -  char                  *NVMLocation;   // NULL term string indicating location
> -                                        // of NVM.
> -  // Persistent Information about DMI
> -  UINT32                dmi_id;
> -  BYTE                  dmi_type;
> -  TPM_DIGEST            NVM_measurement;  // Equal to the SHA1 of the blob
> -  TPM_DIGEST            DMI_measurement;  // Correct measurement of the owning DMI
> -} VTPM_DMI_RESOURCE;
> -
> -typedef struct tdVTPM_MIGKEY_LIST {
> -  UINT32                name_size;
> -  BYTE                  *name; // Name of destination (IP addr, domain name, etc)
> -  CRYPTO_INFO           key;
> -  struct tdVTPM_MIGKEY_LIST *next;
> -} VTPM_MIGKEY_LIST;
> -
> -
> -typedef struct tdVTPM_GLOBALS {
> -  // Non-persistent data
> -#ifndef VTPM_MULTI_VM
> -  pid_t               master_pid;
> -#endif
> -
> -  int                 connected_dmis;     // To close guest_rx when no dmis are connected
> -
> -  struct hashtable    *dmi_map;               // Table of all DMI's known indexed by persistent instance #
> -  VTPM_MIGKEY_LIST    *mig_keys;              // Table of migration keys
> -                      // Currently keys are loaded at migration time,
> -                      // TODO: Make VTPM man store a keys persistently
> -                      //       and update script to check if key is needed
> -                      //       before fetching it.
> -
> -  TCS_CONTEXT_HANDLE  manager_tcs_handle;     // TCS Handle used by manager
> -  TPM_HANDLE          storageKeyHandle;       // Key used by persistent store
> -  CRYPTO_INFO         storageKey;             // For software encryption
> -  CRYPTO_INFO         bootKey;                // For saving table
> -  TCS_AUTH            keyAuth;                // OIAP session for storageKey
> -
> -  // Persistent Data
> -  TPM_AUTHDATA        owner_usage_auth;       // OwnerAuth of real TPM
> -  buffer_t            storageKeyWrap;         // Wrapped copy of storageKey
> -  TPM_AUTHDATA        srk_usage_auth;
> -  TPM_AUTHDATA        storage_key_usage_auth;
> -
> -  buffer_t            bootKeyWrap;            // Wrapped copy of boot key
> -
> -}VTPM_GLOBALS;
> -
> -// --------------------------- Global Values --------------------------
> -extern VTPM_GLOBALS *vtpm_globals;   // Key info and DMI states
> -extern const TPM_AUTHDATA SRK_AUTH;  // SRK Well Known Auth Value
> -
> -// ********************** VTPM Functions *************************
> -TPM_RESULT VTPM_Init_Manager(); // Start VTPM Service
> -void VTPM_Stop_Manager();  // Stop VTPM Service
> -TPM_RESULT VTPM_Manager_Handler(vtpm_ipc_handle_t *tx_ipc_h,
> -                                vtpm_ipc_handle_t *rx_ipc_h,
> -                                BOOL fw_tpm,   // Should forward TPM cmds
> -                                vtpm_ipc_handle_t *fw_tx_ipc_h,
> -                                vtpm_ipc_handle_t *fw_rx_ipc_h,
> -                                BOOL is_priv,
> -                                char *client_name);
> -
> -// ********************** Command Handler Prototypes ***********************
> -
> -TPM_RESULT VTPM_Handle_Load_NVM(       VTPM_DMI_RESOURCE *myDMI,
> -                                        const buffer_t *inbuf,
> -                                        buffer_t *outbuf);
> -
> -TPM_RESULT VTPM_Handle_Save_NVM(       VTPM_DMI_RESOURCE *myDMI,
> -                                        const buffer_t *inbuf,
> -                                        buffer_t *outbuf);
> -
> -TPM_RESULT VTPM_Handle_TPM_Command(    VTPM_DMI_RESOURCE *dmi,
> -                                        buffer_t *inbuf,
> -                                        buffer_t *outbuf);
> -
> -TPM_RESULT VTPM_Handle_New_DMI(const buffer_t *param_buf);
> -
> -TPM_RESULT VTPM_Handle_Close_DMI(const buffer_t *param_buf);
> -
> -TPM_RESULT VTPM_Handle_Delete_DMI(const buffer_t *param_buf);
> -
> -TPM_RESULT VTPM_Handle_Migrate_In( const buffer_t *param_buf,
> -                                   buffer_t *result_buf);
> -
> -TPM_RESULT VTPM_Handle_Migrate_Out ( const buffer_t *param_buf,
> -                                     buffer_t *result_buf);
> -
> -TPM_RESULT VTPM_Handle_Get_Migration_key( const buffer_t *param_buf,
> -                                          buffer_t *result_buf);
> -
> -TPM_RESULT VTPM_SaveManagerData(void);
> -TPM_RESULT VTPM_LoadManagerData(void);
> -
> -TPM_RESULT VTPM_New_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res, BYTE vm_type, BYTE startup_mode);
> -
> -TPM_RESULT VTPM_Close_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res);
> -
> -// Helper functions
> -TPM_RESULT close_dmi(VTPM_DMI_RESOURCE *dmi_res);
> -TPM_RESULT init_dmi(UINT32 dmi_id, BYTE type,  VTPM_DMI_RESOURCE **dmi_res);
> -
> -TPM_RESULT envelope_encrypt(const buffer_t     *inbuf,
> -                             CRYPTO_INFO        *asymkey,
> -                             buffer_t           *sealed_data);
> -
> -TPM_RESULT envelope_decrypt(const buffer_t     *cipher,
> -                            TCS_CONTEXT_HANDLE TCSContext,
> -                            TPM_HANDLE         keyHandle,
> -                            const TPM_AUTHDATA *key_usage_auth,
> -                            buffer_t           *unsealed_data);
> -
> -#endif // __VTPMPRIV_H__
> diff --git a/tools/vtpm_manager/manager/vtsp.c b/tools/vtpm_manager/manager/vtsp.c
> deleted file mode 100644
> index fc8a66f..0000000
> --- a/tools/vtpm_manager/manager/vtsp.c
> +++ /dev/null
> @@ -1,1042 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtsp.c
> -//
> -//  Higher level interface to TCS for use in service.
> -//
> -// ==================================================================
> -
> -#include <string.h>
> -#include "tcg.h"
> -#include "tcs.h"
> -#include "bsg.h"
> -#include "log.h"
> -#include "crypto.h"
> -#include "vtsp.h"
> -#include "buffer.h"
> -
> -#define  RSA_KEY_SIZE 0x0800
> -
> -/***********************************************************************************
> - * GenerateAuth: Generate authorization info to be sent back to application
> - *
> - * Parameters: outParamDigestText  The concatenation of output parameters to be SHA1ed
> - *    outParamDigestTextSize Size of inParamDigestText
> - *    HMACkey     Key to be used for HMACing
> - *          For OIAP use key.authUsage or PersistStore.ownerAuth
> - *          For OSAP use shared secret
> - *    pAuth     Authorization information from the application
> - *
> - * Return:  TPM_SUCCESS   Authorization data created
> - *    TPM_AUTHFAIL   Invalid (NULL) HMACkey presented for OSAP
> - *************************************************************************************/
> -TPM_RESULT GenerateAuth( /*[IN]*/ const BYTE *inParamDigestText,
> -                        /*[IN]*/ UINT32 inParamDigestTextSize,
> -                        /*[IN]*/ const TPM_SECRET *HMACkey,
> -                        /*[IN,OUT]*/ TCS_AUTH *auth) {
> -
> -  if (inParamDigestText == NULL || auth == NULL)
> -    return (TPM_AUTHFAIL);
> -  else {
> -
> -    //Generate new OddNonce
> -    Crypto_GetRandom(auth->NonceOdd.nonce, sizeof(TPM_NONCE));
> -
> -    // Create SHA1 inParamDigest
> -    TPM_DIGEST inParamDigest;
> -    Crypto_SHA1Full(inParamDigestText, inParamDigestTextSize, (BYTE *) &inParamDigest);
> -
> -    // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
> -    BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
> -
> -    BSG_PackList(   hmacText, 4,
> -                   BSG_TPM_DIGEST, &inParamDigest,
> -                   BSG_TPM_NONCE, &(auth->NonceEven),
> -                   BSG_TPM_NONCE, &(auth->NonceOdd),
> -                   BSG_TYPE_BOOL, &(auth->fContinueAuthSession) );
> -
> -    Crypto_HMAC((BYTE *) hmacText, sizeof(hmacText), (BYTE *) HMACkey, sizeof(TPM_DIGEST), (BYTE *) &(auth->HMAC));
> -
> -    return(TPM_SUCCESS);
> -
> -  }
> -}
> -
> -/***********************************************************************************
> - * VerifyAuth: Verify the authdata for a command requiring authorization
> - *
> - * Parameters: inParamDigestText  The concatenation of parameters to be SHA1ed
> - *    inParamDigestTextSize Size of inParamDigestText
> - *    authDataUsage   AuthDataUsage for the Entity being used
> - *          Key->authDataUsage or TPM_AUTH_OWNER
> - *    HMACkey     Key to be used for HMACing
> - *          For OIAP use key.authUsage or PersistStore.ownerAuth
> - *          For OSAP use NULL (It will be aquired from the Auth Session)
> - *          If unknown (default), assume OIAP
> - *    sessionAuth    A TCS_AUTH info for the session
> - *    pAuth     Authorization information from the application
> - *              hContext        If specified, on failed Auth, VerifyAuth will
> - *                                      generate a new OIAP session in place of themselves
> - *                                      destroyed session.
> - *
> - * Return:  TPM_SUCCESS   Authorization Verified
> - *    TPM_AUTHFAIL   Authorization Failed
> - *    TPM_FAIL    Failure during SHA1 routines
> - *************************************************************************************/
> -TPM_RESULT VerifyAuth( /*[IN]*/ const BYTE *outParamDigestText,
> -                      /*[IN]*/ UINT32 outParamDigestTextSize,
> -                      /*[IN]*/ const TPM_SECRET *HMACkey,
> -                      /*[IN,OUT]*/ TCS_AUTH *auth,
> -                      /*[IN]*/  TCS_CONTEXT_HANDLE hContext) {
> -  if (outParamDigestText == NULL || auth == NULL)
> -    return (TPM_AUTHFAIL);
> -
> -
> -  // Create SHA1 inParamDigest
> -  TPM_DIGEST outParamDigest;
> -  Crypto_SHA1Full(outParamDigestText, outParamDigestTextSize, (BYTE *) &outParamDigest);
> -
> -  // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
> -  TPM_DIGEST hm;
> -  BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
> -
> -  BSG_PackList(   hmacText, 4,
> -                 BSG_TPM_DIGEST, &outParamDigest,
> -                 BSG_TPM_NONCE, &(auth->NonceEven),
> -                 BSG_TPM_NONCE, &(auth->NonceOdd),
> -                 BSG_TYPE_BOOL, &(auth->fContinueAuthSession) );
> -
> -  Crypto_HMAC((BYTE *) hmacText, sizeof(hmacText),
> -             (BYTE *) HMACkey, sizeof(TPM_DIGEST), (BYTE *) &hm);
> -
> -  // Compare correct HMAC with provided one.
> -  if (memcmp (&hm, &(auth->HMAC), sizeof(TPM_DIGEST)) == 0) { // 0 indicates equality
> -    if (!auth->fContinueAuthSession)
> -      vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM by fContinue=0.\n", auth->AuthHandle);
> -
> -    return (TPM_SUCCESS);
> -  } else {
> -    // If specified, reconnect the OIAP session.
> -    // NOTE: This only works for TCS's that never have a 0 context.
> -    if (hContext) {
> -      vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM due to failure.\n", auth->AuthHandle);
> -      VTSP_OIAP( hContext, auth);
> -    }
> -    return (TPM_AUTHFAIL);
> -  }
> -}
> -
> -TPM_RESULT VTSP_OIAP(const TCS_CONTEXT_HANDLE hContext,
> -                    TCS_AUTH *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "OIAP.\n");
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPMTRYRETURN( TCSP_OIAP(hContext,
> -                         &auth->AuthHandle,
> -                         &auth->NonceEven) );
> -
> -  memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
> -  auth->fContinueAuthSession = FALSE;
> -
> -  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x opened by TPM_OIAP.\n", auth->AuthHandle);
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_OSAP(const TCS_CONTEXT_HANDLE hContext,
> -                    const TPM_ENTITY_TYPE entityType,
> -                    const UINT32 entityValue,
> -                    const TPM_AUTHDATA *usageAuth,
> -                    TPM_SECRET *sharedSecret,
> -                    TCS_AUTH *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "OSAP.\n");
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_NONCE nonceEvenOSAP, nonceOddOSAP;
> -
> -  Crypto_GetRandom((BYTE *) &nonceOddOSAP, sizeof(TPM_NONCE) );
> -
> -  TPMTRYRETURN( TCSP_OSAP(    hContext,
> -                             entityType,
> -                             entityValue,
> -                             nonceOddOSAP,
> -                             &auth->AuthHandle,
> -                             &auth->NonceEven,
> -                             &nonceEvenOSAP) );
> -
> -  // Calculating Session Secret
> -  BYTE sharedSecretText[TPM_DIGEST_SIZE * 2];
> -
> -  BSG_PackList(  sharedSecretText, 2,
> -                BSG_TPM_NONCE, &nonceEvenOSAP,
> -                BSG_TPM_NONCE, &nonceOddOSAP);
> -
> -  Crypto_HMAC(sharedSecretText, sizeof(sharedSecretText), (BYTE *) usageAuth, TPM_DIGEST_SIZE, (BYTE *) sharedSecret);
> -
> -  memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
> -  auth->fContinueAuthSession = FALSE;
> -
> -  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x opened by TPM_OSAP.\n", auth->AuthHandle);
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTSP_TerminateHandle(const TCS_CONTEXT_HANDLE hContext,
> -                                const TCS_AUTH *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Terminate Handle.\n");
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPMTRYRETURN( TCSP_TerminateHandle(hContext, auth->AuthHandle) );
> -
> -  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM_TerminateHandle.\n", auth->AuthHandle);
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTSP_ReadPubek(   const TCS_CONTEXT_HANDLE hContext,
> -                             CRYPTO_INFO *crypto_info) {
> -
> -  TPM_RESULT status;
> -  TPM_NONCE antiReplay;
> -  TPM_DIGEST   checksum;
> -  BYTE *pubEKtext;
> -  UINT32 pubEKtextsize;
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Reading Public EK.\n");
> -
> -  // GenerateAuth new nonceOdd
> -  Crypto_GetRandom(&antiReplay, sizeof(TPM_NONCE) );
> -
> -
> -  TPMTRYRETURN( TCSP_ReadPubek(  hContext,
> -                                antiReplay,
> -                                &pubEKtextsize,
> -                                &pubEKtext,
> -                                &checksum) );
> -
> -
> -  // Extract the remaining output parameters
> -  TPM_PUBKEY pubEK;
> -
> -  BSG_Unpack(BSG_TPM_PUBKEY, pubEKtext, (BYTE *) &pubEK);
> -
> -  // Build CryptoInfo for the bindingKey
> -  TPM_RSA_KEY_PARMS rsaKeyParms;
> -
> -  BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
> -            pubEK.algorithmParms.parms,
> -            &rsaKeyParms);
> -
> -  Crypto_RSABuildCryptoInfoPublic(rsaKeyParms.exponentSize,
> -                                 rsaKeyParms.exponent,
> -                                 pubEK.pubKey.keyLength,
> -                                 pubEK.pubKey.key,
> -                                 crypto_info);
> -
> -  // Destroy rsaKeyParms
> -  BSG_Destroy(BSG_TPM_RSA_KEY_PARMS, &rsaKeyParms);
> -
> -  // Set encryption scheme
> -  crypto_info->encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
> -  //crypto_info->encScheme = pubEK.algorithmParms.encScheme;
> -  crypto_info->algorithmID = pubEK.algorithmParms.algorithmID;
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_TakeOwnership(   const TCS_CONTEXT_HANDLE hContext,
> -                                 const TPM_AUTHDATA *ownerAuth,
> -                                 const TPM_AUTHDATA *srkAuth,
> -                                 CRYPTO_INFO *ek_cryptoInfo,
> -                                 TCS_AUTH *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Taking Ownership of TPM.\n");
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_TakeOwnership;
> -  TPM_PROTOCOL_ID proto_id = TPM_PID_OWNER;
> -  BYTE *new_srk;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // vars for srkpubkey parameter
> -  TPM_KEY srkPub;
> -  TPM_KEY_PARMS srkKeyInfo = {TPM_ALG_RSA, TPM_ES_RSAESOAEP_SHA1_MGF1, TPM_SS_NONE, 12, 0};
> -  BYTE srkRSAkeyInfo[12] = { 0x00, 0x00, (RSA_KEY_SIZE >> 8), 0x00,   0x00, 0x00, 0x00, 0x02,   0x00, 0x00, 0x00, 0x00};
> -  srkKeyInfo.parms = (BYTE *) &srkRSAkeyInfo;
> -
> -  struct pack_buf_t srkText;
> -
> -  //These values are accurate for an enc(AuthData).
> -  struct pack_buf_t encOwnerAuth, encSrkAuth;
> -
> -  encOwnerAuth.data = (BYTE *)malloc(sizeof(BYTE) * 256);
> -  encSrkAuth.data = (BYTE *)malloc(sizeof(BYTE) * 256);
> -
> -  if (encOwnerAuth.data == NULL || encSrkAuth.data == NULL) {
> -    vtpmloginfo(VTPM_LOG_VTSP, "Could not malloc encrypted auths.\n");
> -    status = TPM_RESOURCES;
> -    goto abort_egress;
> -  }
> -
> -  Crypto_RSAEnc(ek_cryptoInfo, sizeof(TPM_SECRET), (BYTE *) ownerAuth, &encOwnerAuth.size, encOwnerAuth.data);
> -  Crypto_RSAEnc(ek_cryptoInfo, sizeof(TPM_SECRET), (BYTE *) srkAuth, &encSrkAuth.size, encSrkAuth.data);
> -
> -
> -  // Build srk public key struct
> -  srkPub.ver = TPM_STRUCT_VER_1_1;
> -  srkPub.keyUsage = TPM_KEY_STORAGE;
> -  srkPub.keyFlags = 0x00;
> -  srkPub.authDataUsage = TPM_AUTH_ALWAYS;
> -  memcpy(&srkPub.algorithmParms, &srkKeyInfo, sizeof(TPM_KEY_PARMS));
> -  srkPub.PCRInfoSize = 0;
> -  srkPub.PCRInfo = 0;
> -  srkPub.pubKey.keyLength= 0;
> -  srkPub.encDataSize = 0;
> -
> -  srkText.data = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -  srkText.size = BSG_Pack(BSG_TPM_KEY, (BYTE *) &srkPub, srkText.data);
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 5,
> -                              BSG_TPM_COMMAND_CODE,&command,
> -                              BSG_TPM_PROTOCOL_ID, &proto_id,
> -                              BSG_TPM_SIZE32_DATA, &encOwnerAuth,
> -                              BSG_TPM_SIZE32_DATA, &encSrkAuth,
> -                              BSG_TPM_KEY, &srkPub);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize, ownerAuth, auth) );
> -
> -  new_srk = srkText.data;
> -  TPMTRYRETURN( TCSP_TakeOwnership ( hContext,
> -                                    proto_id,
> -                                    encOwnerAuth.size,
> -                                    encOwnerAuth.data,
> -                                    encSrkAuth.size,
> -                                    encSrkAuth.data,
> -                                    &srkText.size,
> -                                    &new_srk,
> -                                    auth ) );
> -
> -
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                              BSG_TPM_RESULT, &status,
> -                              BSG_TPM_COMMAND_CODE, &command);
> -  memcpy(paramText + paramTextSize, new_srk, srkText.size);
> -  paramTextSize += srkText.size;
> -
> -
> -  TPMTRYRETURN( VerifyAuth(  paramText, paramTextSize,
> -                            ownerAuth, auth,
> -                            hContext) );
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  free(srkText.data);
> -  free(encSrkAuth.data);
> -  free(encOwnerAuth.data);
> -  free(paramText);
> -
> -  TCS_FreeMemory(hContext, new_srk);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_DisablePubekRead( const TCS_CONTEXT_HANDLE    hContext,
> -                                  const TPM_AUTHDATA          *ownerAuth,
> -                                  TCS_AUTH                    *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Disabling Pubek Read.\n");
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_DisablePubekRead;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 1,
> -                              BSG_TPM_COMMAND_CODE, &command);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                             ownerAuth, auth) );
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_DisablePubekRead ( hContext, // in
> -                                        auth) );
> -
> -  // Verify Auth
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                              BSG_TPM_RESULT, &status,
> -                              BSG_TPM_COMMAND_CODE, &command);
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                           ownerAuth, auth,
> -                           hContext) );
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -  free(paramText);
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_CreateWrapKey(  const TCS_CONTEXT_HANDLE hContext,
> -                                const TPM_KEY_USAGE      usage,
> -                                const TPM_AUTHDATA       *newKeyAuth,
> -                                const TCS_KEY_HANDLE     parentHandle,
> -                                const TPM_AUTHDATA       *osapSharedSecret,
> -                                buffer_t                 *pubKeyBuf,
> -                                TCS_AUTH                 *auth) {
> -
> -  int i;
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_CreateWrapKey;
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Creating new key of type %d.\n", usage);
> -
> -  // vars for Calculate encUsageAuth
> -  BYTE *paramText;
> -  UINT32 paramTextSize;
> -
> -  // vars for Calculate encUsageAuth
> -  BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
> -  TPM_DIGEST XORKey1;
> -  UINT32 XORbufferSize;
> -  TPM_SECRET encUsageAuth, encMigrationAuth;
> -
> -  // vars for Flatten newKey prototype
> -  BYTE *flatKey = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -  UINT32 flatKeySize = TCPA_MAX_BUFFER_LENGTH;
> -  struct pack_buf_t newKeyText;
> -
> -  // Fill in newKey
> -  TPM_KEY newKey;
> -
> -  BYTE RSAkeyInfo[12] = { 0x00, 0x00, (RSA_KEY_SIZE >> 8), 0x00,   0x00, 0x00, 0x00, 0x02,   0x00, 0x00, 0x00, 0x00};
> -  newKey.algorithmParms.algorithmID = TPM_ALG_RSA;
> -  newKey.algorithmParms.parms = (BYTE *) &RSAkeyInfo;
> -  newKey.algorithmParms.parmSize = 12;
> -
> -  switch (usage) {
> -  case TPM_KEY_SIGNING:
> -    vtpmloginfo(VTPM_LOG_VTSP, "Creating Signing Key...\n");
> -    newKey.keyUsage = TPM_KEY_SIGNING;
> -    newKey.algorithmParms.encScheme = TPM_ES_NONE;
> -    newKey.algorithmParms.sigScheme = TPM_SS_RSASSAPKCS1v15_SHA1;
> -    break;
> -  case TPM_KEY_STORAGE:
> -    vtpmloginfo(VTPM_LOG_VTSP, "Creating Storage Key...\n");
> -    newKey.keyUsage = TPM_KEY_STORAGE;
> -    newKey.algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
> -    newKey.algorithmParms.sigScheme = TPM_SS_NONE;
> -    break;
> -  case TPM_KEY_BIND:
> -    vtpmloginfo(VTPM_LOG_VTSP, "Creating Binding Key...\n");
> -    newKey.keyUsage = TPM_KEY_BIND;
> -    newKey.algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
> -    newKey.algorithmParms.sigScheme = TPM_SS_NONE;
> -    break;
> -  default:
> -    vtpmloginfo(VTPM_LOG_VTSP, "Cannot create key. Invalid Key Type.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -
> -  newKey.ver = TPM_STRUCT_VER_1_1;
> -
> -  newKey.keyFlags = 0;
> -  newKey.authDataUsage = TPM_AUTH_ALWAYS;
> -  newKey.pubKey.keyLength= 0;
> -  newKey.encDataSize = 0;
> -  newKey.encData = NULL;
> -
> -  // FIXME: Support PCR bindings
> -  newKey.PCRInfoSize = 0;
> -  newKey.PCRInfo = NULL;
> -
> -  // Calculate encUsageAuth
> -  XORbufferSize = BSG_PackList(  XORbuffer, 2,
> -                                BSG_TPM_SECRET, osapSharedSecret,
> -                                BSG_TPM_NONCE, &auth->NonceEven);
> -  Crypto_SHA1Full(XORbuffer, XORbufferSize, (BYTE *) &XORKey1);
> -
> -  // FIXME: No support for migratable keys.
> -  for (i=0; i < TPM_DIGEST_SIZE; i++)
> -    ((BYTE *) &encUsageAuth)[i] = ((BYTE *) &XORKey1)[i] ^ ((BYTE *) newKeyAuth)[i];
> -
> -  // Flatten newKey prototype
> -  flatKeySize = BSG_Pack(BSG_TPM_KEY, (BYTE *) &newKey, flatKey);
> -  newKeyText.data = flatKey;
> -  newKeyText.size = flatKeySize;
> -
> -  // Generate HMAC
> -  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 3,
> -                              BSG_TPM_COMMAND_CODE, &command,
> -                              BSG_TPM_AUTHDATA, &encUsageAuth,
> -                              BSG_TPM_AUTHDATA, &encMigrationAuth);
> -  memcpy(paramText + paramTextSize, newKeyText.data, newKeyText.size);
> -  paramTextSize += newKeyText.size;
> -
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                             osapSharedSecret, auth) );
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_CreateWrapKey(  hContext,
> -                                    parentHandle,
> -                                    encUsageAuth,
> -                                    encMigrationAuth,
> -                                    &newKeyText.size,
> -                                    &newKeyText.data,
> -                                    auth) );
> -
> -  // Verify Auth
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                              BSG_TPM_RESULT, &status,
> -                              BSG_TPM_COMMAND_CODE, &command);
> -  memcpy(paramText + paramTextSize, newKeyText.data, newKeyText.size);
> -  paramTextSize += newKeyText.size;
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                           osapSharedSecret, auth, 0) );
> -
> -  // Unpack/return key structure
> -  TPMTRYRETURN(buffer_init(pubKeyBuf, 0, 0) );
> -  TPMTRYRETURN(buffer_append_raw(pubKeyBuf, newKeyText.size, newKeyText.data) );
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  free(flatKey);
> -  free(paramText);
> -  TCS_FreeMemory(hContext, newKeyText.data);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_LoadKey(const TCS_CONTEXT_HANDLE    hContext,
> -                        const TCS_KEY_HANDLE        hUnwrappingKey,
> -                        const buffer_t              *rgbWrappedKeyBlob,
> -                        const TPM_AUTHDATA          *parentAuth,
> -                        TPM_HANDLE                  *newKeyHandle,
> -                        TCS_AUTH                    *auth,
> -                        CRYPTO_INFO                 *cryptoinfo,
> -                        const BOOL                  skipTPMLoad) {
> -
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Loading Key %s.\n", (!skipTPMLoad ? "into TPM" : "only into memory"));
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_LoadKey;
> -
> -  BYTE *paramText=NULL;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // SkipTPMLoad stops key from being loaded into TPM, but still generates CRYPTO_INFO for it
> -  if (! skipTPMLoad) {
> -
> -    if ((rgbWrappedKeyBlob == NULL) || (parentAuth == NULL) ||
> -        (newKeyHandle==NULL) || (auth==NULL)) {
> -      status = TPM_BAD_PARAMETER;
> -      goto abort_egress;
> -    }
> -
> -    // Generate Extra TCS Parameters
> -    TPM_HANDLE phKeyHMAC;
> -
> -    paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -
> -    paramTextSize = BSG_PackList(paramText, 1,
> -                                BSG_TPM_COMMAND_CODE, &command);
> -
> -    memcpy(paramText + paramTextSize, rgbWrappedKeyBlob->bytes, buffer_len(rgbWrappedKeyBlob));
> -    paramTextSize += buffer_len(rgbWrappedKeyBlob);
> -
> -    TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                             parentAuth, auth) );
> -
> -    // Call TCS
> -    TPMTRYRETURN( TCSP_LoadKeyByBlob(  hContext,
> -                                      hUnwrappingKey,
> -                                      buffer_len(rgbWrappedKeyBlob),
> -                                      rgbWrappedKeyBlob->bytes,
> -                                      auth,
> -                                      newKeyHandle,
> -                                      &phKeyHMAC) );
> -
> -    // Verify Auth
> -    paramTextSize = BSG_PackList(paramText, 3,
> -                                BSG_TPM_RESULT, &status,
> -                                BSG_TPM_COMMAND_CODE, &command,
> -                                BSG_TPM_HANDLE, newKeyHandle);
> -
> -    TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                             parentAuth, auth,
> -                             hContext) );
> -  }
> -
> -  // Build cryptoinfo structure for software crypto function.
> -  if (cryptoinfo != NULL) {
> -    TPM_KEY newKey;
> -
> -    // Unpack/return key structure
> -    BSG_Unpack(BSG_TPM_KEY, rgbWrappedKeyBlob->bytes , &newKey);
> -    TPM_RSA_KEY_PARMS rsaKeyParms;
> -
> -    BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
> -              newKey.algorithmParms.parms,
> -              &rsaKeyParms);
> -
> -    Crypto_RSABuildCryptoInfoPublic(rsaKeyParms.exponentSize,
> -                                   rsaKeyParms.exponent,
> -                                   newKey.pubKey.keyLength,
> -                                   newKey.pubKey.key,
> -                                   cryptoinfo);
> -
> -    // Destroy rsaKeyParms
> -    BSG_Destroy(BSG_TPM_RSA_KEY_PARMS, &rsaKeyParms);
> -
> -    // Set encryption scheme
> -    cryptoinfo->encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
> -  }
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  free(paramText);
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_Unbind( const TCS_CONTEXT_HANDLE    hContext,
> -                        const TPM_KEY_HANDLE        key_handle,
> -                        const buffer_t              *bound_data,
> -                        const TPM_AUTHDATA          *usage_auth,
> -                        buffer_t                    *clear_data,
> -                        TCS_AUTH                    *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Unbinding %d bytes of data.\n", buffer_len(bound_data));
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_UnBind;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // Generate Extra TCS Parameters
> -  struct pack_buf_t clear_data32;
> -  BYTE *clear_data_text;
> -  UINT32 clear_data_size;
> -
> -  struct pack_buf_t bound_data32 = {bound_data->size, bound_data->bytes};
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                              BSG_TPM_COMMAND_CODE, &command,
> -                              BSG_TPM_SIZE32_DATA, &bound_data32);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                             usage_auth, auth) );
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_UnBind( hContext,
> -                            key_handle,
> -                            buffer_len(bound_data),
> -                            bound_data->bytes,
> -                            auth,
> -                            &clear_data_size,
> -                            &clear_data_text) );
> -
> -
> -  // Verify Auth
> -  clear_data32.size = clear_data_size;
> -  clear_data32.data = clear_data_text;
> -  paramTextSize = BSG_PackList(paramText, 3,
> -                              BSG_TPM_RESULT, &status,
> -                              BSG_TPM_COMMAND_CODE, &command,
> -                              BSG_TPM_SIZE32_DATA, &clear_data32);
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                           usage_auth, auth,
> -                           hContext) );
> -
> -  // Unpack/return key structure
> -  TPMTRYRETURN(buffer_init(clear_data, 0, 0));
> -  TPMTRYRETURN(buffer_append_raw (clear_data, clear_data_size, clear_data_text) );
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  free(paramText);
> -  TCS_FreeMemory(hContext, clear_data_text);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_Bind(   CRYPTO_INFO *cryptoInfo,
> -                       const buffer_t *inData,
> -                       buffer_t *outData)
> -{
> -  vtpmloginfo(VTPM_LOG_VTSP, "Binding %d bytes of data.\n", buffer_len(inData));
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_BOUND_DATA boundData;
> -  UINT32 i;
> -
> -  // Fill boundData's accessory information
> -  boundData.ver = TPM_STRUCT_VER_1_1;
> -  boundData.payload = TPM_PT_BIND;
> -  boundData.payloadData = inData->bytes;
> -
> -  // Pack boundData before encryption
> -  BYTE* flatBoundData = (BYTE *)malloc(sizeof(BYTE) *
> -                                      (sizeof(TPM_VERSION) +
> -                                       sizeof(TPM_PAYLOAD_TYPE) +
> -                                       buffer_len(inData)));
> -  if (flatBoundData == NULL) {
> -    return TPM_NOSPACE;
> -  }
> -  UINT32 flatBoundDataSize = 0;
> -  flatBoundDataSize = BSG_PackList(  flatBoundData, 2,
> -                                    BSG_TPM_VERSION, &boundData.ver,
> -                                    BSG_TYPE_BYTE, &boundData.payload);
> -
> -  memcpy(flatBoundData+flatBoundDataSize, inData->bytes, buffer_len(inData));
> -  flatBoundDataSize += buffer_len(inData);
> -
> -  BYTE out_tmp[RSA_KEY_SIZE/8]; // RSAEnc does not do blocking, So this is what will come out.
> -  UINT32 out_tmp_size;
> -
> -  // Encrypt flatBoundData
> -  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_RSAEnc( cryptoInfo,
> -                                           flatBoundDataSize,
> -                                           flatBoundData,
> -                                           &out_tmp_size,
> -                                           out_tmp) );
> -
> -  if (out_tmp_size > RSA_KEY_SIZE/8) {
> -    // The result of RSAEnc should be a fixed size based on key size.
> -    vtpmlogerror(VTPM_LOG_VTSP, "Enc buffer just overflowed.\n");
> -  }
> -
> -  buffer_init(outData, 0, NULL);
> -  buffer_append_raw(outData, out_tmp_size, out_tmp);
> -
> -  vtpmloginfo(VTPM_LOG_TXDATA, "Bind Generated[%d] = 0x", out_tmp_size);
> -  for(i = 0 ; i < out_tmp_size ; i++) {
> -    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out_tmp[i]);
> -  }
> -  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> -
> -  goto egress;
> -  abort_egress:
> -  egress:
> -
> -  // Free flatBoundData
> -  free(flatBoundData);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -TPM_RESULT VTSP_Seal(const TCS_CONTEXT_HANDLE    hContext,
> -                     const TPM_KEY_HANDLE        keyHandle,
> -                     const TPM_AUTHDATA          *sealDataAuth,
> -                     const TPM_PCR_COMPOSITE     *pcrComp,
> -                     const buffer_t              *inData,
> -                     TPM_STORED_DATA             *sealedData,
> -                     const TPM_SECRET            *osapSharedSecret,
> -                     TCS_AUTH                    *auth) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_Seal;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // Generate PCR_Info Struct from Comp
> -  TPM_PCR_INFO pcrInfo;
> -  UINT32 pcrInfoSize, flatpcrSize;
> -  BYTE flatpcr[3 +                          // PCR_Select = 3 1 byte banks
> -               sizeof(UINT16) +             //              2 byte UINT16
> -               sizeof(UINT32) +             // PCR_Comp   = 4 byte UINT32
> -               24 * sizeof(TPM_PCRVALUE) ]; //              up to 24 PCRs
> -
> -  if (pcrComp != NULL) {
> -      //printf("\n\tBinding to PCRs: ");
> -      //for(int i = 0 ; i < pcrComp->select.sizeOfSelect ; i++)
> -      //printf("%2.2x", pcrComp->select.pcrSelect[i]);
> -
> -      memcpy(&pcrInfo.pcrSelection, &pcrComp->select, sizeof(TPM_PCR_SELECTION));
> -
> -      flatpcrSize = BSG_Pack(BSG_TPM_PCR_COMPOSITE, (BYTE *) pcrComp, flatpcr);
> -      Crypto_SHA1Full((BYTE *) flatpcr, flatpcrSize, (BYTE *) &(pcrInfo.digestAtRelease));
> -      memset(&(pcrInfo.digestAtCreation), 0, sizeof(TPM_DIGEST));
> -      pcrInfoSize = BSG_Pack(BSG_TPM_PCR_INFO, (BYTE *) &pcrInfo, flatpcr);
> -  } else {
> -      //printf("\n\tBinding to no PCRS.");
> -      pcrInfoSize = 0;
> -  }
> -
> -  // Calculate encUsageAuth
> -  BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
> -  UINT32 XORbufferSize = sizeof(XORbuffer);
> -  TPM_DIGEST XORKey;
> -  TPM_ENCAUTH encAuth;
> -
> -  BSG_PackList( XORbuffer, 2,
> -                BSG_TPM_SECRET, osapSharedSecret,
> -                BSG_TPM_NONCE, &auth->NonceEven );
> -
> -  Crypto_SHA1Full(XORbuffer, XORbufferSize, (BYTE *) &XORKey);
> -
> -  int i;
> -  for (i=0; i < TPM_DIGEST_SIZE; i++)
> -    ((BYTE *) &encAuth)[i] = ((BYTE *) &XORKey)[i] ^ ((BYTE *) sealDataAuth)[i];
> -
> -  // Generate Extra TCS Parameters
> -  UINT32 inDataSize = buffer_len(inData);
> -  struct pack_buf_t inData_pack = {inDataSize, inData->bytes};
> -  struct pack_buf_t pcrInfo_pack = {pcrInfoSize, flatpcr};
> -
> -  UINT32 sealedDataSize;
> -  BYTE *flatSealedData=NULL;
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 4,
> -                               BSG_TPM_COMMAND_CODE, &command,
> -                               BSG_TPM_ENCAUTH, &encAuth,
> -                               BSG_TPM_SIZE32_DATA, &pcrInfo_pack,
> -                               BSG_TPM_SIZE32_DATA, &inData_pack);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                              osapSharedSecret, auth) );
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_Seal( hContext,
> -                           keyHandle,
> -                           encAuth,
> -                           pcrInfoSize,
> -                           flatpcr,
> -                           inDataSize,
> -                           inData->bytes,
> -                           auth,
> -                           &sealedDataSize,
> -                           &flatSealedData) );
> -
> -  // Unpack/return key structure
> -  BSG_Unpack( BSG_TPM_STORED_DATA, flatSealedData, sealedData );
> -
> -  paramTextSize = BSG_PackList(paramText, 3,
> -                               BSG_TPM_RESULT, &status,
> -                               BSG_TPM_COMMAND_CODE, &command,
> -                               BSG_TPM_STORED_DATA, sealedData);
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                            osapSharedSecret, auth,
> -                            0) );
> -
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  if (flatSealedData)
> -    TCS_FreeMemory( hContext, flatSealedData);
> -
> -  free(paramText);
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTSP_Unseal(const TCS_CONTEXT_HANDLE    hContext,
> -                       const TPM_KEY_HANDLE        keyHandle,
> -                       const TPM_STORED_DATA       *sealedData,
> -                       const TPM_AUTHDATA          *key_usage_auth,
> -                       const TPM_AUTHDATA          *data_usage_auth,
> -                       buffer_t                    *outData,
> -                       TCS_AUTH                    *auth,
> -                       TCS_AUTH                    *dataAuth) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_Unseal;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // Generate Extra TCS Parameters
> -  UINT32 sealDataSize, clearDataSize;
> -  BYTE *flatSealedData= (BYTE *) malloc(sizeof(TPM_VERSION) +
> -                                        2 * sizeof(UINT32) +
> -                                        sealedData->sealInfoSize +
> -                                        sealedData->encDataSize),
> -       *clearData=NULL;
> -
> -  sealDataSize = BSG_Pack(BSG_TPM_STORED_DATA, sealedData, flatSealedData );
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                               BSG_TPM_COMMAND_CODE, &command,
> -                               BSG_TPM_STORED_DATA, sealedData);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                              key_usage_auth, auth) );
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                              data_usage_auth, dataAuth) );
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_Unseal(  hContext,
> -                              keyHandle,
> -                              sealDataSize,
> -                              flatSealedData,
> -                              auth,
> -                              dataAuth,
> -                              &clearDataSize,
> -                              &clearData) );
> -
> -  // Verify Auth
> -  struct pack_buf_t clearData_pack = {clearDataSize, clearData};
> -
> -  paramTextSize = BSG_PackList(paramText, 3,
> -                               BSG_TPM_RESULT, &status,
> -                               BSG_TPM_COMMAND_CODE, &command,
> -                               BSG_TPM_SIZE32_DATA, &clearData_pack);
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                            key_usage_auth, auth,
> -                            hContext) );
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                            data_usage_auth, dataAuth,
> -                            hContext) );
> -
> -  // Unpack/return key structure
> -  TPMTRYRETURN( buffer_init(outData, clearDataSize, clearData) );
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  if (flatSealedData)
> -    TCS_FreeMemory( hContext, clearData);
> -
> -  free(paramText);
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_SaveState( const TCS_CONTEXT_HANDLE    hContext) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Calling TPM_SaveState.\n");
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  // Call TCS
> -  return ( TCSP_SaveState ( hContext ) );
> -
> -}
> -
> -
> -// Function Reaches into unsupported TCS command, beware.
> -TPM_RESULT VTSP_RawTransmit(const TCS_CONTEXT_HANDLE    hContext,
> -                            const buffer_t *inbuf,
> -                            buffer_t *outbuf ) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Passthrough in use.\n");
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  // Generate Extra TCS Parameters
> -  BYTE *resultText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -  UINT32 resultTextSize =  TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_RawTransmitData(buffer_len(inbuf), inbuf->bytes,
> -                                    &resultTextSize, resultText) );
> -
> -  // Unpack/return key structure
> -  TPMTRYRETURN(buffer_init (outbuf, resultTextSize, resultText) );
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -  TCS_FreeMemory(hContext, resultText);
> -  free(resultText);
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/manager/vtsp.h b/tools/vtpm_manager/manager/vtsp.h
> deleted file mode 100644
> index 2fb0440..0000000
> --- a/tools/vtpm_manager/manager/vtsp.h
> +++ /dev/null
> @@ -1,126 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtsp.h
> -//
> -//  Higher level interface to TCS.
> -//
> -// ==================================================================
> -
> -#ifndef __VTSP_H__
> -#define __VTSP_H__
> -
> -#include "tcg.h"
> -#include "tcs.h"
> -
> -#define KEY_BUFFER_SIZE 2048
> -
> -TPM_RESULT VTSP_RawTransmit(const TCS_CONTEXT_HANDLE    hContext,
> -                            const buffer_t *inbuf,
> -                            buffer_t *outbuf );
> -
> -TPM_RESULT VTSP_OIAP(  const TCS_CONTEXT_HANDLE hContext,
> -                       TCS_AUTH *auth);
> -
> -TPM_RESULT VTSP_OSAP(  const TCS_CONTEXT_HANDLE hContext,
> -                       const TPM_ENTITY_TYPE entityType,
> -                       const UINT32 entityValue,
> -                       const TPM_AUTHDATA *usageAuth,
> -                       TPM_SECRET *sharedsecret,
> -                       TCS_AUTH *auth);
> -
> -TPM_RESULT VTSP_TerminateHandle(const TCS_CONTEXT_HANDLE hContext,
> -                                const TCS_AUTH *auth);
> -
> -TPM_RESULT VTSP_ReadPubek(   const TCS_CONTEXT_HANDLE hContext,
> -                             CRYPTO_INFO *cypto_info);
> -
> -TPM_RESULT VTSP_TakeOwnership(   const TCS_CONTEXT_HANDLE hContext,
> -                                 const TPM_AUTHDATA *ownerAuth,
> -                                 const TPM_AUTHDATA *srkAuth,
> -                                 CRYPTO_INFO *ek_cryptoInfo,
> -                                 TCS_AUTH *auth);
> -
> -TPM_RESULT VTSP_DisablePubekRead( const TCS_CONTEXT_HANDLE    hContext,
> -                                  const TPM_AUTHDATA *ownerAuth,
> -                                  TCS_AUTH                    *auth);
> -
> -TPM_RESULT VTSP_CreateWrapKey(  const TCS_CONTEXT_HANDLE hContext,
> -                                const TPM_KEY_USAGE      usage,
> -                                const TPM_AUTHDATA       *newKeyAuth,
> -                                const TCS_KEY_HANDLE     parentHandle,
> -                                const TPM_AUTHDATA       *osapSharedSecret,
> -                                buffer_t                 *pubKeyBuf,
> -                                TCS_AUTH                 *auth);
> -
> -TPM_RESULT VTSP_LoadKey(const TCS_CONTEXT_HANDLE    hContext,
> -                        const TCS_KEY_HANDLE        hUnwrappingKey,
> -                        const buffer_t              *rgbWrappedKeyBlob,
> -                        const TPM_AUTHDATA          *parentAuth,
> -                        TPM_HANDLE                  *newKeyHandle,
> -                        TCS_AUTH                    *pAuth,
> -                        CRYPTO_INFO                 *cryptoinfo,
> -                        const BOOL                  skipTPMLoad);
> -
> -TPM_RESULT VTSP_Unbind( const TCS_CONTEXT_HANDLE    hContext,
> -                        const TPM_KEY_HANDLE        key_handle,
> -                        const buffer_t              *bound_data,
> -                        const TPM_AUTHDATA          *usage_auth,
> -                        buffer_t                    *clear_data,
> -                        TCS_AUTH                    *auth);
> -
> -TPM_RESULT VTSP_Bind(   CRYPTO_INFO *cryptoInfo,
> -            const buffer_t *inData,
> -            buffer_t *outData);
> -
> -TPM_RESULT VTSP_Seal(const TCS_CONTEXT_HANDLE    hContext,
> -                     const TPM_KEY_HANDLE        keyHandle,
> -                     const TPM_AUTHDATA          *sealDataAuth,
> -                     const TPM_PCR_COMPOSITE     *pcrComp,
> -                     const buffer_t              *inData,
> -                     TPM_STORED_DATA             *sealedData,
> -                     const TPM_SECRET            *osapSharedSecret,
> -                     TCS_AUTH                    *auth);
> -
> -TPM_RESULT VTSP_Unseal(const TCS_CONTEXT_HANDLE    hContext,
> -                       const TPM_KEY_HANDLE        keyHandle,
> -                       const TPM_STORED_DATA       *sealedData,
> -                       const TPM_AUTHDATA          *key_usage_auth,
> -                       const TPM_AUTHDATA          *data_usage_auth,
> -                       buffer_t                    *outData,
> -                       TCS_AUTH                    *auth,
> -                       TCS_AUTH                    *dataAuth);
> -
> -TPM_RESULT VTSP_SaveState( const TCS_CONTEXT_HANDLE    hContext);
> -
> -#endif //_VTSP_H_
> diff --git a/tools/vtpm_manager/migration/Makefile b/tools/vtpm_manager/migration/Makefile
> deleted file mode 100644
> index e33ae95..0000000
> --- a/tools/vtpm_manager/migration/Makefile
> +++ /dev/null
> @@ -1,42 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -VPATH = ../manager
> -
> -BIND           = vtpm_migratord
> -BINC           = vtpm_migrator
> -
> -SRCSD    = vtpm_manager_if.c vtpm_migratord.c vtpm_migratord_handler.c vtpm_ipc.c
> -SRCSC    = vtpm_manager_if.c vtpm_migrator_if.c vtpm_migratorc.c vtpm_ipc.c
> -
> -OBJSD    = $(patsubst %.c,%.o,$(SRCSD))
> -OBJSC    = $(patsubst %.c,%.o,$(SRCSC))
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIND) $(BINC)
> -
> -.PHONY: install
> -install: build
> -       $(INSTALL_PROG) $(BIND) $(DESTDIR)$(BINDIR)
> -       $(INSTALL_PROG) $(BINC) $(DESTDIR)$(BINDIR)
> -
> -.PHONY: clean
> -clean:
> -       rm -f $(BINC) $(BIND)
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIND): $(OBJSD)
> -       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
> -
> -$(BINC): $(OBJSC)
> -       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
> -
> -# libraries
> -LIBS += ../util/libTCGUtils.a
> diff --git a/tools/vtpm_manager/migration/vtpm_manager_if.c b/tools/vtpm_manager/migration/vtpm_manager_if.c
> deleted file mode 100644
> index 08986f4..0000000
> --- a/tools/vtpm_manager/migration/vtpm_manager_if.c
> +++ /dev/null
> @@ -1,186 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_manager_if.c
> -//
> -//  Provides functions to call local vtpm manager interface (Hotplug)
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <fcntl.h>
> -#include <malloc.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "vtpm_ipc.h"
> -#include "bsg.h"
> -#include "vtpm_migrator.h"
> -#include "vtpm_manager.h"
> -
> -#define VTPM_TX_HP_FNAME       "/var/vtpm/fifos/from_console.fifo"
> -#define VTPM_RX_HP_FNAME       "/var/vtpm/fifos/to_console.fifo"
> -
> -static vtpm_ipc_handle_t tx_ipc_h, rx_ipc_h;
> -
> -TPM_RESULT vtpm_manager_open(){
> -
> -  if ( (vtpm_ipc_init(&tx_ipc_h,  VTPM_TX_HP_FNAME, O_RDWR, TRUE) != 0) ||  //FIXME: wronly
> -       (vtpm_ipc_init(&rx_ipc_h,  VTPM_RX_HP_FNAME, O_RDWR, TRUE) != 0) ) { //FIXME: rdonly
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to connect to vtpm_manager.\n");
> -    return TPM_IOERROR;
> -  }
> -
> -  return TPM_SUCCESS;
> -}
> -
> -void vtpm_manager_close() {
> -
> -  vtpm_ipc_close(&tx_ipc_h);
> -  vtpm_ipc_close(&rx_ipc_h);
> -}
> -
> -
> -TPM_RESULT vtpm_manager_command(TPM_COMMAND_CODE ord,
> -                                buffer_t *command_param_buf,
> -                                TPM_RESULT *cmd_status, /* out */
> -                                buffer_t *result_param_buf) {
> -
> -  TPM_RESULT status = TPM_FAIL;
> -  int  size_read, size_write, i;
> -  BYTE *adj_command, response_header[VTPM_COMMAND_HEADER_SIZE_SRV];
> -  UINT32 dmi_id=0, adj_command_size, out_param_size, adj_param_size;
> -  TPM_TAG tag=VTPM_TAG_REQ;
> -
> -  if ( (!command_param_buf) || (!result_param_buf) || (!cmd_status) ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  adj_command_size = VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(command_param_buf);
> -  adj_command = (BYTE *) malloc( adj_command_size );
> -  if (!adj_command) {
> -    status = TPM_RESOURCES;
> -    goto abort_egress;
> -  }
> -
> -  out_param_size = VTPM_COMMAND_HEADER_SIZE + buffer_len(command_param_buf);
> -  BSG_PackList(adj_command, 4,
> -                 BSG_TYPE_UINT32, &dmi_id,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &out_param_size,
> -                 BSG_TPM_COMMAND_CODE, &ord );
> -
> -  memcpy(adj_command + VTPM_COMMAND_HEADER_SIZE_SRV, command_param_buf->bytes, buffer_len(command_param_buf));
> -
> -  size_write = vtpm_ipc_write(&tx_ipc_h, NULL, adj_command, adj_command_size);
> -
> -  if (size_write > 0) {
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT (MGR): 0x");
> -    for (i=0; i< adj_command_size; i++) {
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", adj_command[i]);
> -    }
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -  } else {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Error writing VTPM Manager console.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (size_write != (int) adj_command_size )
> -    vtpmlogerror(VTPM_LOG_VTPM, "Could not write entire command to mgr (%d/%d)\n", size_write, adj_command_size);
> -
> -  // Read header for response to manager command
> -  size_read = vtpm_ipc_read(&rx_ipc_h, NULL, response_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -  if (size_read > 0) {
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV (MGR): 0x");
> -    for (i=0; i<size_read; i++)
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", response_header[i]);
> -
> -  } else {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Error reading from vtpm manager.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Command from vtpm_manager shorter than std header.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  // Unpack response from DMI for TPM command
> -  BSG_UnpackList(response_header, 4,
> -                 BSG_TYPE_UINT32, &dmi_id,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &out_param_size,
> -                 BSG_TPM_COMMAND_CODE, cmd_status );
> -
> -  // If response has parameters, read them.
> -  // Note that out_param_size is in the client's context
> -  adj_param_size = out_param_size - VTPM_COMMAND_HEADER_SIZE;
> -  if (adj_param_size > 0) {
> -    TPMTRYRETURN( buffer_init( result_param_buf, adj_param_size, NULL) );
> -    size_read = vtpm_ipc_read(&rx_ipc_h, NULL, result_param_buf->bytes, adj_param_size);
> -    if (size_read > 0) {
> -      for (i=0; i< size_read; i++)
> -        vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_param_buf->bytes[i]);
> -
> -    } else {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Error reading from vtpm manager.\n");
> -      goto abort_egress;
> -    }
> -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -
> -    if (size_read < (int)adj_param_size) {
> -      vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -      vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
> -      status = TPM_IOERROR;
> -      goto abort_egress;
> -    }
> -  } else {
> -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -  }
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> -
> -
> diff --git a/tools/vtpm_manager/migration/vtpm_migrator.h b/tools/vtpm_manager/migration/vtpm_migrator.h
> deleted file mode 100644
> index 8d52e66..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migrator.h
> +++ /dev/null
> @@ -1,104 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_migrator.h
> -//
> -//  Public Interface header for VTPM Migrator
> -//
> -// ==================================================================
> -
> -#ifndef __VTPM_MIGRATOR_H__
> -#define __VTPM_MIGRATOR_H__
> -
> -#define VTPM_MTAG_REQ 0x02c1
> -#define VTPM_MTAG_RSP 0x02c4
> -
> -// Header sizes.
> -#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
> -//               sizeof(TPM_TAG + UINT32 + TPM_COMMAND_CODE)
> -
> -//*********************** Connection Info **************************
> -#define VTPM_MIG_PORT 48879
> -
> -//************************ Command Codes ***************************
> -#define VTPM_MORD_MIG_STEP1     0x00
> -#define VTPM_MORD_MIG_STEP2     0x01
> -#define VTPM_MORD_MIG_STEP3     0x02
> -#define VTPM_MORD_MIG_STEP4     0x03
> -
> -//************************ Return Codes ****************************
> -#define VTPM_SUCCESS               0
> -#define VTPM_FAIL                  1
> -
> -/******************* Command Parameter API *************************
> -
> -VTPM Command Format
> -  tpm tag: 2 bytes
> -  command size: 4 bytes         // Size of command including header but not DMI
> -  ord: 4 bytes                  // Command ordinal above
> -  parameters: size - 10 bytes   // Command Parameter
> -
> -VTPM Response Format
> -  tpm tag: 2 bytes
> -  response_size: 4 bytes
> -  status: 4 bytes
> -  parameters: size - 10 bytes
> -
> -
> -VTPM_Mig_Phase1:
> -    Unsupported: (Handled by scripts)
> -
> -VTPM_Mig_Phase2
> -  Input Parameters:
> -    domain_name_size: 4 bytes
> -    domain_name : domain_name_size bytes
> -  Output Parameters:
> -    pub_exp_size: 4 bytes
> -    pub_exp: pub_exp_size bytes
> -    pub_mod_size: 4 bytes
> -    pub_mod: pub_mod_size bytes
> -
> -VTPM_Mig_Phase3
> -  Input Parameters:
> -    vtpm_state_size: 4 bytes
> -    vtpm_state: vtpm_state_size bytes
> -  Output Parameters:
> -    none
> -
> -VTPM_Mig_Phase4
> -    Unsupported: (Handled by scripts)
> -
> -
> -*********************************************************************/
> -
> -#endif //_VTPM_MANAGER_H_
> diff --git a/tools/vtpm_manager/migration/vtpm_migrator_if.c b/tools/vtpm_manager/migration/vtpm_migrator_if.c
> deleted file mode 100644
> index de48b2d..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migrator_if.c
> +++ /dev/null
> @@ -1,219 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_migrator_if.c
> -//
> -//  Provides functions to call open network connection & call
> -//  a function on the vtpm_migratord on the destination
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <sys/types.h>
> -#include <sys/socket.h>
> -#include <netinet/in.h>
> -#include <arpa/inet.h>
> -#include <netdb.h>
> -#include <string.h>
> -#include <malloc.h>
> -
> -#include "tcg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "bsg.h"
> -#include "vtpm_migrator.h"
> -
> -static int sock_desc;
> -
> -
> -TPM_RESULT vtpm_migratord_open(char *server_address){
> -
> -  TPM_RESULT status = TPM_FAIL;
> -
> -  /* network variables */
> -  struct in_addr ip_addr;
> -  struct sockaddr_in server_addr;
> -  int addr_len;
> -  struct hostent *dns_info=NULL;
> -
> -  /* set up connection to server*/
> -  dns_info = gethostbyname(server_address);
> -  ip_addr.s_addr = *((unsigned long *) dns_info->h_addr_list[0]);
> -
> -  if(ip_addr.s_addr < 0) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  /* set up server variable */
> -  memset((char *)&server_addr, 0, sizeof(server_addr));
> -  server_addr.sin_family = AF_INET;
> -  server_addr.sin_port = htons(VTPM_MIG_PORT);
> -  server_addr.sin_addr.s_addr = ip_addr.s_addr;
> -
> -  /* open socket, make connection */
> -  sock_desc = socket(AF_INET, SOCK_STREAM, 0);
> -
> -  if (sock_desc < 0 ) {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (connect(sock_desc,
> -              (struct sockaddr *)&server_addr,
> -              sizeof(server_addr)) < 0 ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  status = TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> -
> -void vtpm_migratord_close() {
> -  close(sock_desc);
> -}
> -
> -
> -TPM_RESULT vtpm_migratord_command(TPM_COMMAND_CODE ord,
> -                                buffer_t *command_param_buf,
> -                                TPM_RESULT *cmd_status, /* out */
> -                                buffer_t *result_param_buf) {
> -
> -  TPM_RESULT status = TPM_FAIL;
> -  int  size_read, size_write, i;
> -  BYTE *command, response_header[VTPM_COMMAND_HEADER_SIZE];
> -  UINT32 dmi_id=0, command_size, out_param_size, adj_param_size;
> -  TPM_TAG tag=VTPM_MTAG_REQ;
> -
> -  if ( (!command_param_buf) || (!result_param_buf) || (!cmd_status) ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  command_size = VTPM_COMMAND_HEADER_SIZE + buffer_len(command_param_buf);
> -  command = (BYTE *) malloc( command_size );
> -  if (!command) {
> -    status = TPM_RESOURCES;
> -    goto abort_egress;
> -  }
> -
> -  BSG_PackList(command, 3,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &command_size,
> -                 BSG_TPM_COMMAND_CODE, &ord );
> -
> -  memcpy(command + VTPM_COMMAND_HEADER_SIZE, command_param_buf->bytes, buffer_len(command_param_buf));
> -
> -  size_write = write(sock_desc, command, command_size);
> -
> -  if (size_write > 0) {
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT (MIGd): 0x");
> -    for (i=0; i< command_size; i++) {
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", command[i]);
> -    }
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -  } else {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Error writing to migration server via network.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (size_write != (int) command_size )
> -    vtpmlogerror(VTPM_LOG_VTPM, "Could not write entire command to migration server (%d/%d)\n", size_write, command_size);
> -
> -  // Read header for response
> -  size_read = read(sock_desc, response_header, VTPM_COMMAND_HEADER_SIZE);
> -  if (size_read > 0) {
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV (MIGd): 0x");
> -    for (i=0; i<size_read; i++)
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", response_header[i]);
> -
> -  } else {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Error reading from Migration Server.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Command from migration server shorter than std header.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  // Unpack response from DMI for TPM command
> -  BSG_UnpackList(response_header, 3,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &out_param_size,
> -                 BSG_TPM_COMMAND_CODE, cmd_status );
> -
> -  // If response has parameters, read them.
> -  adj_param_size = out_param_size - VTPM_COMMAND_HEADER_SIZE;
> -  if (adj_param_size > 0) {
> -    TPMTRYRETURN( buffer_init( result_param_buf, adj_param_size, NULL) );
> -    size_read = read(sock_desc, result_param_buf->bytes, adj_param_size);
> -    if (size_read > 0) {
> -      for (i=0; i< size_read; i++)
> -        vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_param_buf->bytes[i]);
> -
> -    } else {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Error reading from migration server.\n");
> -      goto abort_egress;
> -    }
> -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -
> -    if (size_read < (int)adj_param_size) {
> -      vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -      vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
> -      status = TPM_IOERROR;
> -      goto abort_egress;
> -    }
> -  } else {
> -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -  }
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> -
> -
> diff --git a/tools/vtpm_manager/migration/vtpm_migratorc.c b/tools/vtpm_manager/migration/vtpm_migratorc.c
> deleted file mode 100644
> index 18b3bdb..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migratorc.c
> +++ /dev/null
> @@ -1,211 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <stdio.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "log.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -#include "vtpm_migrator.h"
> -#include "vtpm_manager.h"
> -
> -TPM_RESULT handle_vtpm_mig_step2(char *server_addr,
> -                                 char *name,
> -                                 UINT32 instance) {
> -  TPM_RESULT status, cmd_status;
> -  buffer_t out_param_buf=NULL_BUF, mig_key_buf=NULL_BUF, empty_buf=NULL_BUF;
> -  UINT32 offset;
> -  struct pack_buf_t addr_data32;
> -
> -  //===== Get Destination's Public Migration Key ======
> -  TPMTRYRETURN( vtpm_migratord_open(server_addr) );
> -
> -  TPMTRYRETURN( vtpm_migratord_command(VTPM_MORD_MIG_STEP2,
> -                                     &out_param_buf,
> -                                     &cmd_status,
> -                                     &mig_key_buf) );
> -  vtpm_migratord_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  //===== Load migration key into vtpm_manager ========
> -
> -  addr_data32.data = (BYTE *)server_addr;
> -  addr_data32.size = strlen(server_addr) + 1; // Include the null
> -
> -  TPMTRYRETURN ( buffer_init ( &out_param_buf,
> -                               sizeof(UINT32) + addr_data32.size +buffer_len(&mig_key_buf),
> -                               NULL ) ) ;
> -
> -  offset =  BSG_PackList(out_param_buf.bytes, 1,
> -               BSG_TPM_SIZE32_DATA, &addr_data32);
> -
> -  memcpy(out_param_buf.bytes + offset , mig_key_buf.bytes, buffer_len(&mig_key_buf) );
> -
> -  TPMTRYRETURN ( vtpm_manager_open() );
> -
> -  TPMTRYRETURN ( vtpm_manager_command(VTPM_ORD_LOAD_MIG_KEY,
> -                                      &out_param_buf,
> -                                      &cmd_status,
> -                                      &empty_buf) );
> -
> -  vtpm_manager_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  buffer_free(&mig_key_buf);
> -  buffer_free(&out_param_buf);
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT handle_vtpm_mig_step3(char *server_addr,
> -                                 char *name,
> -                                 UINT32 instance) {
> -  TPM_RESULT status, cmd_status;
> -  buffer_t out_param_buf=NULL_BUF, state_buf=NULL_BUF, empty_buf=NULL_BUF;
> -  struct pack_buf_t addr_data32, name_data32, state_data32;
> -
> -  //===== Get vtpm state from vtpm_manager ========
> -  addr_data32.data = (BYTE *)server_addr;
> -  addr_data32.size = strlen(server_addr) + 1; // Include the null
> -
> -  TPMTRYRETURN ( buffer_init ( &out_param_buf,
> -                               (2 * sizeof(UINT32)) + addr_data32.size,
> -                               NULL ) ) ;
> -
> -  BSG_PackList(out_param_buf.bytes, 2,
> -                 BSG_TYPE_UINT32, &instance,
> -                 BSG_TPM_SIZE32_DATA, &addr_data32);
> -
> -  TPMTRYRETURN ( vtpm_manager_open() );
> -
> -  TPMTRYRETURN ( vtpm_manager_command(VTPM_ORD_MIGRATE_OUT,
> -                                      &out_param_buf,
> -                                      &cmd_status,
> -                                      &state_buf) );
> -
> -  vtpm_manager_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  TPMTRYRETURN( buffer_free( &out_param_buf ) );
> -
> -  //===== Send vtpm state to destination ======
> -  name_data32.data = (BYTE *)name;
> -  name_data32.size = strlen(name) + 1; // Include the null
> -  state_data32.data = state_buf.bytes;
> -  state_data32.size = buffer_len(&state_buf);
> -
> -  TPMTRYRETURN( buffer_init( &out_param_buf,
> -                             2 * sizeof(UINT32) + name_data32.size + state_data32.size,
> -                             NULL ) ) ;
> -
> -  BSG_PackList(out_param_buf.bytes, 2,
> -                 BSG_TPM_SIZE32_DATA, &name_data32,
> -                 BSG_TPM_SIZE32_DATA, &state_data32);
> -
> -  TPMTRYRETURN( vtpm_migratord_open(server_addr) );
> -
> -  TPMTRYRETURN( vtpm_migratord_command(VTPM_MORD_MIG_STEP3,
> -                                     &out_param_buf,
> -                                     &cmd_status,
> -                                     &empty_buf) );
> -  vtpm_migratord_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  buffer_free( &out_param_buf);
> -  buffer_free( &state_buf);
> -  buffer_free( &empty_buf);
> -
> -  return status;
> -}
> -
> -
> -// Usage vtpm_migrator addr domain_name instance step
> -
> -int main(int argc, char **argv) {
> -
> -    /* variables for processing of command */
> -    TPM_RESULT status = TPM_FAIL;
> -    char *server_addr, *name;
> -    UINT32 instance, step;
> -
> -    if (argc != 5) {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Usage: vtpm_migrator addr vm_name instance step\n");
> -      vtpmlogerror(VTPM_LOG_VTPM, "       params given %d\n", argc);
> -      status= TPM_BAD_PARAMETER;
> -      goto abort_egress;
> -    }
> -
> -    server_addr = argv[1];
> -    name = argv[2];
> -    instance = atoi( argv[3] );
> -    step = atoi( argv[4] );
> -
> -    switch (step) {
> -    case VTPM_MORD_MIG_STEP2:
> -      status = handle_vtpm_mig_step2(server_addr, name, instance);
> -      break;
> -
> -    case VTPM_MORD_MIG_STEP3:
> -      status = handle_vtpm_mig_step3(server_addr, name, instance);
> -      break;
> -
> -    default:
> -      status = TPM_BAD_PARAMETER;
> -      goto abort_egress;
> -      break;
> -    }
> -
> -    goto egress;
> - abort_egress:
> - egress:
> -
> -    return status;
> -}
> -
> diff --git a/tools/vtpm_manager/migration/vtpm_migratord.c b/tools/vtpm_manager/migration/vtpm_migratord.c
> deleted file mode 100644
> index ea18c8c..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migratord.c
> +++ /dev/null
> @@ -1,202 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <stdio.h>
> -#include <sys/types.h>
> -#include <sys/socket.h>
> -#include <netinet/in.h>
> -#include <arpa/inet.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "log.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -#include "vtpm_migrator.h"
> -
> -void build_error_msg( buffer_t *buf, TPM_RESULT status) {
> -  TPM_TAG tag = VTPM_MTAG_RSP;
> -  UINT32 out_param_size = VTPM_COMMAND_HEADER_SIZE;
> -
> -  buffer_init(buf, out_param_size, NULL);
> -
> -  BSG_PackList(buf->bytes, 3,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &out_param_size,
> -                 BSG_TPM_RESULT, &status );
> -}
> -
> -int main() {
> -
> -    /* network variables */
> -    int sock_descr, client_sock=-1, len;
> -    struct sockaddr_in addr;
> -    struct sockaddr_in client_addr;
> -    unsigned int client_length;
> -    int bytes;
> -
> -    /* variables for processing of command */
> -    TPM_RESULT status = TPM_FAIL;
> -    BYTE cmd_header[VTPM_COMMAND_HEADER_SIZE];
> -    TPM_TAG tag;
> -    TPM_COMMAND_CODE ord;
> -    UINT32 in_param_size, adj_param_size;
> -    int i, size_read, size_write;
> -    buffer_t in_param_buf=NULL_BUF, result_buf=NULL_BUF;
> -
> -
> -    /* setup socket */
> -    sock_descr = socket(AF_INET, SOCK_STREAM, 0);
> -
> -    memset(&addr, 0, sizeof(addr));
> -    addr.sin_family = AF_INET;
> -    addr.sin_addr.s_addr = htonl(INADDR_ANY);
> -    addr.sin_port = htons(VTPM_MIG_PORT);
> -
> -    if (bind(sock_descr, (struct sockaddr *)&addr, sizeof(addr)) == -1 ) {
> -        vtpmlogerror(VTPM_LOG_VTPM, "Failed to bind to port %d.\n", VTPM_MIG_PORT);
> -        return 1;
> -    }
> -
> -    listen(sock_descr, 10);
> -
> -    for(;;) {
> -        // ============ clear client info and wait for connection ==========
> -        memset(&client_addr, 0, sizeof(client_addr));
> -        client_length = sizeof(client_addr);
> -
> -        vtpmloginfo(VTPM_LOG_VTPM, "Waiting for incoming migrations...\n");
> -        client_sock=accept(sock_descr, &client_addr, &client_length);
> -        if (client_sock == -1) {
> -            vtpmlogerror(VTPM_LOG_VTPM, "Incoming connectionn failed.\n");
> -            goto abort_command;
> -        } else {
> -            vtpmloginfo(VTPM_LOG_VTPM, "Incoming connection accepted.\n");
> -        }
> -
> -        // =================== Read incoming command ======================
> -        size_read = read( client_sock, cmd_header, VTPM_COMMAND_HEADER_SIZE);
> -        if (size_read > 0) {
> -            vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV: 0x");
> -            for (i=0; i<size_read; i++)
> -                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> -
> -        } else {
> -            vtpmlogerror(VTPM_LOG_VTPM, "Error reading from socket.\n");
> -            build_error_msg(&result_buf, TPM_IOERROR);
> -            goto abort_command_with_error;
> -        }
> -
> -        if (size_read < (int) VTPM_COMMAND_HEADER_SIZE) {
> -            vtpmlogerror(VTPM_LOG_VTPM, "Command from socket shorter than std header.\n");
> -            build_error_msg(&result_buf, TPM_BAD_PARAMETER);
> -            goto abort_command_with_error;
> -        }
> -
> -        // Unpack response from client
> -        BSG_UnpackList(cmd_header, 3,
> -                       BSG_TPM_TAG, &tag,
> -                       BSG_TYPE_UINT32, &in_param_size,
> -                       BSG_TPM_COMMAND_CODE, &ord );
> -
> -
> -        // If response has parameters, read them.
> -        // Note that out_param_size is in the client's context
> -        adj_param_size = in_param_size - VTPM_COMMAND_HEADER_SIZE;
> -        if (adj_param_size > 0) {
> -            buffer_init( &in_param_buf, adj_param_size, NULL);
> -            size_read = read(client_sock, in_param_buf.bytes, adj_param_size);
> -            if (size_read > 0) {
> -                for (i=0; i< size_read; i++)
> -                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param_buf.bytes[i]);
> -
> -            } else {
> -                vtpmlogerror(VTPM_LOG_VTPM, "Error reading from socket.\n");
> -                build_error_msg(&result_buf, TPM_IOERROR);
> -                goto abort_command_with_error;
> -            }
> -            vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -
> -            if (size_read < (int)adj_param_size) {
> -                vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -                vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
> -                build_error_msg(&result_buf, TPM_BAD_PARAMETER);
> -                goto abort_command_with_error;
> -            }
> -        } else {
> -            vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -        }
> -
> -        /* Handle Command */
> -        switch (ord) {
> -        case VTPM_MORD_MIG_STEP2:
> -          handle_vtpm_mig_step2(&in_param_buf, &result_buf);
> -          break;
> -
> -        case VTPM_MORD_MIG_STEP3:
> -          handle_vtpm_mig_step3(&in_param_buf, &result_buf);
> -          break;
> -
> -        default:
> -            build_error_msg(&result_buf, TPM_BAD_PARAMETER);
> -            goto abort_command_with_error;
> -        }
> -
> -  abort_command_with_error:
> -        /* Write Response */
> -        size_write = write(client_sock, result_buf.bytes, buffer_len(&result_buf));
> -
> -        if (size_write > 0) {
> -            vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT: 0x");
> -            for (i=0; i< buffer_len(&result_buf); i++) {
> -                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_buf.bytes[i]);
> -            }
> -            vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -        } else {
> -            vtpmlogerror(VTPM_LOG_VTPM, "Error writing response to client.\n");
> -            goto abort_command;
> -        }
> -
> -        if (size_write != (int) buffer_len(&result_buf) )
> -           vtpmlogerror(VTPM_LOG_VTPM, "Could not send entire response to client(%d/%d)\n", size_write, buffer_len(&result_buf));
> -
> -  abort_command:
> -        close(client_sock);
> -        buffer_free(&in_param_buf);
> -        buffer_free(&result_buf);
> -
> -    } // For (;;)
> -
> -    return 0;
> -}
> -
> diff --git a/tools/vtpm_manager/migration/vtpm_migratord_handler.c b/tools/vtpm_manager/migration/vtpm_migratord_handler.c
> deleted file mode 100644
> index 0a8a2d5..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migratord_handler.c
> +++ /dev/null
> @@ -1,177 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <stdlib.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "bsg.h"
> -#include "log.h"
> -#include "vtpm_migrator.h"
> -#include "vtpm_manager.h"
> -
> -#define VTPM_SH_CMD_HDR  "bash -c \"cd /etc/xen/scripts; source /etc/xen/scripts/vtpm-common.sh;"
> -#define VTPM_SH_CMD_FTR  "\""
> -#define VTPM_SH_GETINST  "vtpmdb_get_free_instancenum"
> -#define VTPM_SH_ADD      "vtpm_add_and_activate"
> -#define VTPM_SH_RESUME   "vtpm_resume"
> -
> -// This must be updated to the longest command name. Currently GETINST
> -#define VTPM_SH_CMD_SIZE (strlen(VTPM_SH_CMD_HDR) + strlen(VTPM_SH_CMD_FTR) + 1 + strlen(VTPM_SH_GETINST) + 2)
> -
> -void handle_vtpm_mig_step2(buffer_t *in_param_buf, buffer_t *result_buf)
> -{
> -  TPM_TAG tag = VTPM_TAG_RSP;
> -  buffer_t out_param_buf= NULL_BUF, mig_key_buf=NULL_BUF;
> -  TPM_RESULT status=TPM_SUCCESS, cmd_status;
> -  UINT32 out_param_size;
> -
> -  if ( (!in_param_buf) || (!result_buf) ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  // ================= Call manager and get mig key ===============
> -  TPMTRYRETURN( vtpm_manager_open() );
> -  TPMTRYRETURN( vtpm_manager_command(VTPM_ORD_GET_MIG_KEY,
> -                                     &out_param_buf, // Empty
> -                                     &cmd_status,
> -                                     &mig_key_buf) );
> -
> -  vtpm_manager_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  // ==================== return the  mig key =====================
> -  out_param_size =  VTPM_COMMAND_HEADER_SIZE + buffer_len(&mig_key_buf);
> -
> -  TPMTRYRETURN( buffer_init(result_buf,
> -                            out_param_size,
> -                            NULL) );
> -
> -  BSG_PackList( result_buf->bytes, 3,
> -                  BSG_TPM_TAG, &tag,
> -                  BSG_TYPE_UINT32, &out_param_size,
> -                  BSG_TPM_RESULT, &status);
> -
> -  memcpy(result_buf->bytes + VTPM_COMMAND_HEADER_SIZE,
> -         mig_key_buf.bytes, buffer_len(&mig_key_buf));
> -
> -  goto egress;
> -
> - abort_egress:
> -  buffer_free(result_buf);
> -  build_error_msg(result_buf, status);
> -
> - egress:
> -  return;
> -}
> -
> -void handle_vtpm_mig_step3(buffer_t *in_param_buf, buffer_t *result_buf)
> -{
> -  TPM_TAG tag = VTPM_TAG_RSP;
> -  buffer_t out_param_buf= NULL_BUF, mig_key_buf=NULL_BUF, empty_buf=NULL_BUF;
> -  TPM_RESULT status=TPM_SUCCESS, cmd_status;
> -  UINT32 out_param_size, instance;
> -  char *shell_cmd_str=NULL;
> -  size_t shell_cmd_strlen;
> -  FILE *shell_f=NULL;
> -
> -  if ( (!in_param_buf) || (!result_buf) ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  // ================= Read Parameters ===============
> -  struct pack_buf_t name_data32, state_data32;
> -
> -  BSG_UnpackList(in_param_buf->bytes, 2,
> -                 BSG_TPM_SIZE32_DATA, &name_data32,
> -                 BSG_TPM_SIZE32_DATA, &state_data32);
> -
> -  // Before using this string, protect us from a non-null term array.
> -  if (name_data32.data[name_data32.size -1] != 0x00) {
> -    name_data32.data[name_data32.size -1] = 0x00;
> -  }
> -
> -  // ====== Call hotplug-script and get an instance ======
> -  shell_cmd_strlen = VTPM_SH_CMD_SIZE + name_data32.size + 10;
> -  shell_cmd_str = (char *) malloc(shell_cmd_strlen); // 10 is just padding for the UINT32
> -
> -  snprintf(shell_cmd_str, shell_cmd_strlen,
> -       VTPM_SH_CMD_HDR VTPM_SH_GETINST VTPM_SH_CMD_FTR);
> -
> -  shell_f = popen(shell_cmd_str, "r");
> -  fscanf(shell_f, "%d", &instance);
> -  pclose(shell_f);
> -
> -  // ====== Call hotplug-script and add instance ======
> -  snprintf(shell_cmd_str, shell_cmd_strlen,
> -       VTPM_SH_CMD_HDR VTPM_SH_ADD " %s %d" VTPM_SH_CMD_FTR,
> -       name_data32.data, instance);
> -  system(shell_cmd_str);
> -
> -  // ========= Call vtpm_manager and load VTPM =======
> -  TPMTRYRETURN( buffer_init( &out_param_buf,
> -                             2*sizeof(UINT32) + state_data32.size,
> -                             NULL) );
> -
> -  BSG_PackList(out_param_buf.bytes, 2,
> -                 BSG_TYPE_UINT32, &instance,
> -                 BSG_TPM_SIZE32_DATA, &state_data32);
> -
> -  TPMTRYRETURN( vtpm_manager_open() );
> -  TPMTRYRETURN( vtpm_manager_command(VTPM_ORD_MIGRATE_IN,
> -                                     &out_param_buf,
> -                                     &cmd_status,
> -                                     &empty_buf) );
> -
> -  vtpm_manager_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  // ====== Call hotplug-script and resume instance ======
> -  snprintf(shell_cmd_str, shell_cmd_strlen,
> -       VTPM_SH_CMD_HDR VTPM_SH_RESUME " %d" VTPM_SH_CMD_FTR, instance);
> -  system(shell_cmd_str);
> -
> -  goto egress;
> - abort_egress:
> - egress:
> -  free(shell_cmd_str);
> -
> -  // In this case no params come back, so reuse build_error_msg even for succes.
> -  build_error_msg(result_buf, status);
> -  return;
> -}
> -
> diff --git a/tools/vtpm_manager/tcs/Makefile b/tools/vtpm_manager/tcs/Makefile
> deleted file mode 100644
> index 11af91e..0000000
> --- a/tools/vtpm_manager/tcs/Makefile
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -BIN            = libTCS.a
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIN)
> -
> -.PHONY: install
> -install: build
> -
> -.PHONY: clean
> -clean:
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIN): $(OBJS)
> -       $(AR) rcs $(BIN) $(OBJS)
> diff --git a/tools/vtpm_manager/tcs/contextmgr.c b/tools/vtpm_manager/tcs/contextmgr.c
> deleted file mode 100644
> index cf3803c..0000000
> --- a/tools/vtpm_manager/tcs/contextmgr.c
> +++ /dev/null
> @@ -1,224 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// contextmgr.c
> -//
> -//  This file contains the context management functions for TCS.
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <string.h>
> -#include <malloc.h>
> -#include "tcs.h"
> -#include "contextmgr.h"
> -#include "log.h"
> -#include "hashtable.h"
> -
> -BYTE* AddMemBlock(CONTEXT_HANDLE* pContextHandle, // in
> -                 int    BlockSize)  { // in
> -
> -  BLOCK* pCurrentBlock = NULL;
> -  BLOCK* pBlock = NULL;
> -
> -  // check incoming params
> -  if (pContextHandle == NULL || BlockSize == 0)
> -    return NULL;
> -
> -  // Create New Block
> -  pBlock = (BLOCK *)malloc(sizeof(BLOCK));
> -  if (pBlock == NULL)
> -    return (0);
> -
> -  pBlock->aMemory = (BYTE *)malloc(sizeof(BYTE) * BlockSize);
> -  if (pBlock->aMemory == NULL)
> -    return (0);
> -
> -  memset(pBlock->aMemory, 0, BlockSize);
> -  pBlock->nBlockSize = BlockSize;
> -  pBlock->pNextBlock = NULL;
> -
> -  // search for the last block created where to add the
> -  // newly created block
> -  if(pContextHandle->pTopBlock != NULL) {
> -    pCurrentBlock = pContextHandle->pTopBlock;
> -    while(pCurrentBlock->pNextBlock != NULL)
> -      pCurrentBlock = pCurrentBlock->pNextBlock;
> -
> -
> -    pCurrentBlock->pNextBlock= pBlock;
> -  } else
> -    pContextHandle->pTopBlock = pBlock;
> -
> -
> -  pContextHandle->nBlockCount++;
> -
> -  return pBlock->aMemory;
> -}
> -
> -
> -BOOL DeleteMemBlock(CONTEXT_HANDLE* pContextHandle, // in
> -                    BYTE*   pTCPA_BYTEs) { // in
> -  BLOCK* pCurrentBlock = NULL;
> -  BLOCK* pParentBlock = NULL;
> -  BOOL bFound = FALSE;
> -
> -  if (pContextHandle == NULL)
> -    return FALSE;
> -
> -
> -  // Search for the Block in the context by aMemory pointer
> -  pParentBlock = NULL;
> -  pCurrentBlock = pContextHandle->pTopBlock;
> -
> -  while(pCurrentBlock != NULL) {
> -    // If aMemory block is found, delete it
> -    if(pCurrentBlock->aMemory == pTCPA_BYTEs || pTCPA_BYTEs == NULL) {
> -      // if it is the top Block, remove it from the top,
> -      // otherwise remove it from the ParentBlock and stitch
> -      // the NextBlock to the ParentBlock
> -      if(pParentBlock == NULL)
> -       pContextHandle->pTopBlock = pContextHandle->pTopBlock->pNextBlock;
> -      else
> -       pParentBlock->pNextBlock = pCurrentBlock->pNextBlock;
> -
> -      // delete memory Block associated with pointer pTCPA_BYTEs
> -      free(pCurrentBlock->aMemory);
> -      pCurrentBlock->aMemory = NULL;
> -
> -      free(pCurrentBlock);
> -      pCurrentBlock = pParentBlock;
> -
> -      pContextHandle->nBlockCount--;
> -      bFound = TRUE;
> -    }
> -
> -    if(pCurrentBlock != NULL) {
> -      pParentBlock = pCurrentBlock;
> -      pCurrentBlock = pCurrentBlock->pNextBlock;
> -    }
> -  }
> -
> -  return bFound;
> -}
> -
> -BOOL AddHandleToList(TCS_CONTEXT_HANDLE hContext, // in
> -                    TPM_RESOURCE_TYPE type, // in
> -                    TPM_HANDLE    handle)  { // in
> -  HANDLE_LIST* pNewHandle = NULL;
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Adding Handle to list\n");
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  if (pContextHandle == NULL)
> -    return 0;
> -
> -  pNewHandle = (HANDLE_LIST *)malloc(sizeof(HANDLE_LIST));
> -
> -  if (pNewHandle == NULL)
> -    return (0);
> -
> -  pNewHandle->handle = handle;
> -  pNewHandle->type = type;
> -  pNewHandle->pNextHandle = pContextHandle->pHandleList;
> -
> -  pContextHandle->pHandleList = pNewHandle;
> -
> -  return 1;
> -}
> -
> -BOOL DeleteHandleFromList(   TCS_CONTEXT_HANDLE hContext, // in
> -                             TPM_HANDLE          handle) { // in
> -
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  HANDLE_LIST *pCurrentHandle = pContextHandle->pHandleList,
> -              *pLastHandle = pCurrentHandle;
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Deleting Handle from list\n");
> -
> -  if (pContextHandle == NULL)
> -    return 0;
> -
> -  while (1) {
> -
> -    if (pCurrentHandle->handle == handle) { // Found element
> -      if (pCurrentHandle == pLastHandle) { // First element in list
> -       pContextHandle->pHandleList = pCurrentHandle->pNextHandle;
> -       free(pCurrentHandle);
> -      } else { // Ordinary element
> -       pLastHandle->pNextHandle = pCurrentHandle->pNextHandle;
> -       free(pCurrentHandle);
> -      }
> -
> -      return 1;
> -
> -    } else { // Not found yet;
> -      pLastHandle = pCurrentHandle;
> -      pCurrentHandle = pCurrentHandle->pNextHandle;
> -      if (pCurrentHandle == NULL) // Found end of list
> -       return 0;
> -    }
> -
> -  }
> -}
> -
> -BOOL FreeHandleList(    CONTEXT_HANDLE*     pContextHandle) { // in
> -  HANDLE_LIST* pCurrentHandle;
> -  BOOL returncode = TRUE;
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Freeing all handles for context\n");
> -
> -  if (pContextHandle == NULL)
> -    return 1;
> -
> -  pCurrentHandle = pContextHandle->pHandleList;
> -  while (pCurrentHandle != NULL) {
> -
> -    switch (pCurrentHandle->type) {
> -    case TPM_RT_KEY:
> -      returncode = returncode && !TCSP_EvictKey(pContextHandle->handle, pCurrentHandle->handle);
> -      break;
> -    case TPM_RT_AUTH:
> -      returncode = returncode && !TCSP_TerminateHandle(pContextHandle->handle, pCurrentHandle->handle);
> -      break;
> -    default:
> -      returncode = FALSE;
> -    }
> -
> -    pCurrentHandle = pCurrentHandle->pNextHandle;
> -
> -  }
> -
> -  return 1;
> -}
> diff --git a/tools/vtpm_manager/tcs/contextmgr.h b/tools/vtpm_manager/tcs/contextmgr.h
> deleted file mode 100644
> index e3fdf0f..0000000
> --- a/tools/vtpm_manager/tcs/contextmgr.h
> +++ /dev/null
> @@ -1,82 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// contextmgr.c
> -//
> -//  This file contains the context management functions for TCS.
> -//
> -// ==================================================================
> -
> -#ifndef __CONTEXTMGR_H__
> -#define __CONTEXTMGR_H__
> -
> -#include "tcg.h"
> -
> -#define BLOCK_SIZE 300
> -
> -typedef struct block {
> -  int nBlockSize;
> -  BYTE* aMemory;
> -  struct block* pNextBlock;
> -} BLOCK;
> -
> -typedef struct handle_List {
> -  TPM_HANDLE handle;
> -  TPM_RESOURCE_TYPE type;
> -  struct handle_List* pNextHandle;
> -} HANDLE_LIST;
> -
> -typedef struct context_handle {
> -  TCS_CONTEXT_HANDLE handle;
> -  int nBlockCount;
> -  BLOCK* pTopBlock;
> -  HANDLE_LIST* pHandleList;
> -} CONTEXT_HANDLE;
> -
> -BYTE* AddMemBlock(  CONTEXT_HANDLE*     pContextHandle, // in
> -                    int                 BlockSize);  // in
> -
> -BOOL DeleteMemBlock(CONTEXT_HANDLE* pContextHandle, // in
> -                    BYTE*           pTCPA_BYTEs); // in
> -
> -
> -BOOL AddHandleToList(   TCS_CONTEXT_HANDLE hContext, // in
> -                        TPM_RESOURCE_TYPE   type, // in
> -                        TPM_HANDLE          handle); // in
> -
> -BOOL DeleteHandleFromList(   TCS_CONTEXT_HANDLE hContext, // in
> -                             TPM_HANDLE          handle); // in
> -
> -BOOL FreeHandleList(    CONTEXT_HANDLE*     pContextHandle); // in
> -
> -#endif //_CONTEXTMGR_H_
> diff --git a/tools/vtpm_manager/tcs/tcs.c b/tools/vtpm_manager/tcs/tcs.c
> deleted file mode 100644
> index 7c1378c..0000000
> --- a/tools/vtpm_manager/tcs/tcs.c
> +++ /dev/null
> @@ -1,1192 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tcs.c
> -//
> -//  This file contains the functions that implement a TCS.
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <string.h>
> -#include <malloc.h>
> -
> -#include "tcg.h"
> -#include "bsg.h"
> -#include "tcs.h"
> -#include "contextmgr.h"
> -#include "tpmddl.h"
> -#include "log.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -
> -// Static Global Vars for the TCS
> -static int TCS_m_nCount = 0;
> -
> -#define TCPA_MAX_BUFFER_LENGTH 0x2000
> -
> -static BYTE InBuf [TCPA_MAX_BUFFER_LENGTH];
> -static BYTE OutBuf[TCPA_MAX_BUFFER_LENGTH];
> -
> -struct hashtable *context_ht;
> -
> -// -------------------------- Hash table functions --------------------
> -
> -static unsigned int hashfunc32(void *ky) {
> -  return (* (UINT32 *) ky);
> -}
> -
> -static int equals32(void *k1, void *k2) {
> -  return (*(UINT32 *) k1 == *(UINT32 *) k2);
> -}
> -
> -CONTEXT_HANDLE *LookupContext( TCS_CONTEXT_HANDLE  hContext) {
> -  return( (CONTEXT_HANDLE *) hashtable_search(context_ht, &hContext) );
> -}
> -
> -// ---------------------------------------------------------------------------------
> -// Initialization/Uninitialization SubComponent API
> -// ---------------------------------------------------------------------------------
> -TPM_RESULT TCS_create() {
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TPM_RESULT result = TPM_FAIL;
> -
> -  if (TCS_m_nCount == 0) {
> -    vtpmloginfo(VTPM_LOG_TCS, "Constructing new TCS:\n");
> -    hRes = TDDL_Open();
> -
> -    context_ht = create_hashtable(10, hashfunc32, equals32);
> -
> -    if ((hRes == TDDL_SUCCESS) && (context_ht != NULL)) {
> -      result = TPM_SUCCESS;
> -      TCS_m_nCount++;
> -    } else {
> -      result = TPM_IOERROR;
> -      hashtable_destroy(context_ht, 1);
> -    }
> -  } else
> -    TCS_m_nCount++;
> -
> -  return(result);
> -}
> -
> -
> -void TCS_destroy()
> -{
> -  TCS_m_nCount--;
> -
> -  if (TCS_m_nCount == 0) {
> -    vtpmloginfo(VTPM_LOG_TCS, "Destructing TCS:\n");
> -    TDDL_Close();
> -
> -    struct hashtable_itr *context_itr;
> -    TCS_CONTEXT_HANDLE  *hContext;
> -
> -    // Close all the TCS contexts. TCS should evict keys based on this
> -    if (hashtable_count(context_ht) > 0) {
> -      context_itr = hashtable_iterator(context_ht);
> -      do {
> -        hContext = (TCS_CONTEXT_HANDLE *) hashtable_iterator_key(context_itr);
> -       if (TCS_CloseContext(*hContext) != TPM_SUCCESS)
> -           vtpmlogerror(VTPM_LOG_TCS, "Failed to close context %d properly.\n", *hContext);
> -
> -      } while (hashtable_iterator_advance(context_itr));
> -      free(context_itr);
> -    }
> -    hashtable_destroy(context_ht, 1);
> -  }
> -
> -}
> -
> -TPM_RESULT TCS_Malloc(  TCS_CONTEXT_HANDLE  hContext, // in
> -                        UINT32              MemSize, // in
> -                        BYTE**              ppMemPtr) {// out
> -
> -  TPM_RESULT returnCode = TPM_FAIL;
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  if (pContextHandle != NULL && ppMemPtr != NULL) {
> -    *ppMemPtr = (BYTE *)AddMemBlock(pContextHandle, MemSize);
> -    returnCode = TPM_SUCCESS;
> -  }
> -
> -  return returnCode;
> -}
> -
> -TPM_RESULT TCS_FreeMemory(  TCS_CONTEXT_HANDLE  hContext, // in
> -                            BYTE*               pMemory) { // in
> -  TPM_RESULT returnCode = TPM_FAIL;
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  if ( (pContextHandle != NULL && pMemory != NULL) &&
> -       (DeleteMemBlock(pContextHandle, pMemory) == TRUE) )
> -    returnCode = TPM_SUCCESS;
> -
> -
> -  return returnCode;
> -}
> -
> -TPM_RESULT TCS_OpenContext(TCS_CONTEXT_HANDLE* hContext) { // out
> -  TPM_RESULT returnCode = TPM_FAIL;
> -  TCS_CONTEXT_HANDLE *newContext;
> -
> -  vtpmloginfo(VTPM_LOG_TCS, "Calling TCS_OpenContext:\n");
> -
> -  if (hContext) {
> -    CONTEXT_HANDLE* pContextHandle = (CONTEXT_HANDLE *) malloc(sizeof(CONTEXT_HANDLE));
> -    if (pContextHandle == NULL)
> -      return TPM_SIZE;
> -
> -    // initialize to 0
> -    pContextHandle->nBlockCount = 0;
> -    pContextHandle->pTopBlock = NULL;
> -    pContextHandle->pHandleList = NULL;
> -
> -    // Create New Block
> -    AddMemBlock(pContextHandle, BLOCK_SIZE);
> -
> -    newContext = (TCS_CONTEXT_HANDLE *) malloc(sizeof(TCS_CONTEXT_HANDLE));
> -    *newContext = (TCS_CONTEXT_HANDLE) (((uintptr_t) pContextHandle >> 2) & 0xffffffff);
> -
> -    if (hashtable_search(context_ht, &newContext) !=NULL)
> -       *newContext += 1;
> -
> -    pContextHandle->handle = *newContext;
> -    if (!hashtable_insert(context_ht, newContext, pContextHandle)) {
> -        free(newContext);
> -        free(pContextHandle);
> -       returnCode = TPM_FAIL;
> -    } else {
> -       *hContext = *newContext;
> -       returnCode = TPM_SUCCESS;
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCS_CloseContext(TCS_CONTEXT_HANDLE hContext) {// in
> -  //FIXME: TCS SHOULD Track failed auths and make sure
> -  //we don't try and re-free them here.
> -  TPM_RESULT returnCode = TPM_FAIL;
> -
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  if(pContextHandle != NULL) {
> -    // Print test info
> -    vtpmloginfo(VTPM_LOG_TCS, "Calling TCS_CloseContext.\n");
> -
> -    // free memory for all the blocks
> -    DeleteMemBlock(pContextHandle, NULL );
> -    pContextHandle->pTopBlock = NULL;
> -
> -    FreeHandleList(pContextHandle);
> -    if (pContextHandle->pHandleList != NULL)
> -      vtpmlogerror(VTPM_LOG_TCS, "Not all handles evicted from TPM.\n");
> -
> -    // Release the TPM's resources
> -    if (hashtable_remove(context_ht, &hContext) == NULL)
> -      vtpmlogerror(VTPM_LOG_TCS, "Not all handles evicted from TPM.\n");
> -
> -    free(pContextHandle);
> -    returnCode = TPM_SUCCESS;
> -  }
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Finished closing context\n");
> -  return(returnCode);
> -}
> -
> -// ------------------------------------------------------------------
> -// Internal Functions
> -// ------------------------------------------------------------------
> -int packAuth(BYTE* dst, TCS_AUTH* auth) {
> -  // CHECK: according to the command specs, the outgoing auth params are:
> -  // nonceEven
> -  // nonceOdd
> -  // continueAuthSession
> -  // auth digest for return params
> -  //
> -  // this is a bit different than this code...
> -
> -  return BSG_PackList(dst, 4,
> -                     BSG_TYPE_UINT32, &(auth->AuthHandle),
> -                     BSG_TPM_NONCE, &(auth->NonceOdd),
> -                     BSG_TYPE_BOOL, &(auth->fContinueAuthSession),
> -                     BSG_TPM_AUTHDATA, &(auth->HMAC));
> -}
> -
> -int unpackAuth(TCS_AUTH* auth, BYTE* src) {
> -  return BSG_UnpackList(src, 3,
> -                       BSG_TPM_NONCE, &(auth->NonceEven),
> -                       BSG_TYPE_BOOL, &(auth->fContinueAuthSession),
> -                       BSG_TPM_AUTHDATA, &(auth->HMAC));
> -}
> -
> -// ------------------------------------------------------------------
> -// Authorization Commands
> -// ------------------------------------------------------------------
> -
> -TPM_RESULT TCSP_OIAP(TCS_CONTEXT_HANDLE hContext, // in
> -                    TCS_AUTHHANDLE*  authHandle, // out
> -                    TPM_NONCE*   nonce0)  // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_OIAP;
> -  UINT32 paramSize = 0;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (authHandle == NULL || nonce0 == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 3,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal);
> -
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -      == TDDL_SUCCESS) {
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList( OutBuf, 3,
> -                           BSG_TPM_TAG, &tag,
> -                           BSG_TYPE_UINT32, &paramSize,
> -                           BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Extract the remaining output parameters
> -      BSG_UnpackList(OutBuf+i, 2,
> -                    BSG_TYPE_UINT32, authHandle,
> -                    BSG_TPM_NONCE, nonce0);
> -
> -      if (!AddHandleToList(hContext, TPM_RT_AUTH, *authHandle))
> -        vtpmlogerror(VTPM_LOG_TCS, "New AuthHandle not recorded\n");
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "Failed with return code %s\n", tpm_get_error_name(returnCode));
> -
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_OSAP(TCS_CONTEXT_HANDLE hContext,  // in
> -                    TPM_ENTITY_TYPE  entityType,  // in
> -                    UINT32    entityValue, // in
> -                    TPM_NONCE   nonceOddOSAP, // in
> -                    TCS_AUTHHANDLE*  authHandle,  // out
> -                    TPM_NONCE*   nonceEven,  // out
> -                    TPM_NONCE*   nonceEvenOSAP) // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_OSAP;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (authHandle == NULL || nonceEven == NULL || nonceEvenOSAP == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 6,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT16, &entityType,
> -                         BSG_TYPE_UINT32, &entityValue,
> -                         BSG_TPM_NONCE, &nonceOddOSAP);
> -
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -            == TDDL_SUCCESS) {
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Extract the remaining output parameters
> -      BSG_UnpackList(OutBuf+i, 3,
> -                    BSG_TYPE_UINT32, authHandle,
> -                    BSG_TPM_NONCE, nonceEven,
> -                    BSG_TPM_NONCE, nonceEvenOSAP);
> -
> -      if (!AddHandleToList(hContext, TPM_RT_AUTH, *authHandle)) {
> -           vtpmlogerror(VTPM_LOG_TCS, "New AuthHandle not recorded\n");
> -      }
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "Failed with return code %s\n", tpm_get_error_name(returnCode));
> -
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_TakeOwnership(TCS_CONTEXT_HANDLE hContext,   // in
> -                             UINT16    protocolID,   // in
> -                             UINT32    encOwnerAuthSize, // in
> -                             BYTE*    encOwnerAuth,  // in
> -                             UINT32    encSrkAuthSize,  // in
> -                             BYTE*    encSrkAuth,   // in
> -                             UINT32*    SrkSize,   // in, out
> -                             BYTE**    Srk,    // in, out
> -                             TCS_AUTH*   ownerAuth)   // in, out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_TakeOwnership;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (encOwnerAuth == NULL || encSrkAuth == NULL || SrkSize == NULL || *Srk == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 5,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT16, &protocolID,
> -                         BSG_TYPE_UINT32, &encOwnerAuthSize);
> -
> -  memcpy(InBuf+InLength, encOwnerAuth, encOwnerAuthSize);
> -  InLength += encOwnerAuthSize;
> -  InLength += BSG_Pack(   BSG_TYPE_UINT32,
> -                         &encSrkAuthSize,
> -                         InBuf+InLength);
> -  memcpy(InBuf+InLength, encSrkAuth, encSrkAuthSize);
> -  InLength += encSrkAuthSize;
> -  memcpy(InBuf+InLength, *Srk, *SrkSize);
> -  InLength += *SrkSize;
> -  InLength += packAuth(InBuf+InLength, ownerAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32,
> -          &InLength,
> -          InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS){
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList( OutBuf, 3,
> -                           BSG_TPM_TAG, &tag,
> -                           BSG_TYPE_UINT32, &paramSize,
> -                           BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      TPM_KEY srkPub;
> -      i += BSG_Unpack(BSG_TPM_KEY,  OutBuf+i,  &srkPub);
> -      unpackAuth(ownerAuth, OutBuf+i);
> -
> -      // fill output params
> -      BYTE tempBuf[1024];
> -      *SrkSize = BSG_Pack(BSG_TPM_KEY,  &srkPub, tempBuf);
> -      if (TCS_Malloc(hContext, *SrkSize, Srk) == TPM_FAIL) {
> -       return(TPM_SIZE);
> -      }
> -      memcpy(*Srk, tempBuf, *SrkSize);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_TakeOwnership Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_DisablePubekRead (  TCS_CONTEXT_HANDLE hContext, // in
> -                                    TCS_AUTH*   ownerAuth) { // in, out
> -
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_DisablePubekRead;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 3,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal);
> -
> -  InLength += packAuth(InBuf+InLength, ownerAuth);
> -
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS){
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList( OutBuf, 3,
> -                           BSG_TPM_TAG, &tag,
> -                           BSG_TYPE_UINT32, &paramSize,
> -                           BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      unpackAuth(ownerAuth, OutBuf+i);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_DisablePubekRead Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_TerminateHandle(TCS_CONTEXT_HANDLE hContext, // in
> -                                TCS_AUTHHANDLE  handle)  // in
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_Terminate_Handle;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &handle);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS) {
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (!DeleteHandleFromList(hContext, handle))
> -      vtpmlogerror(VTPM_LOG_TCS, "KeyHandle not removed from list\n");
> -
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Print debug info
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_TerminateHandle Failed with return code %s\n", tpm_get_error_name(returnCode));
> -
> -  }
> -
> -  return(returnCode);
> -}
> -
> -// TPM Mandatory
> -TPM_RESULT TCSP_Extend( TCS_CONTEXT_HANDLE hContext, // in
> -                        TPM_PCRINDEX  pcrNum,  // in
> -                        TPM_DIGEST  inDigest, // in
> -                        TPM_PCRVALUE*  outDigest) // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_Extend;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 5,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &pcrNum,
> -                         BSG_TPM_DIGEST, &inDigest);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS) {
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND){
> -      // Extract the remaining output parameters
> -      BSG_Unpack(BSG_TPM_PCRVALUE, OutBuf+i, outDigest);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Extend Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_Seal(   TCS_CONTEXT_HANDLE hContext,  // in
> -                        TCS_KEY_HANDLE  keyHandle,  // in
> -                        TPM_ENCAUTH   encAuth,  // in
> -                        UINT32    pcrInfoSize, // in
> -                        BYTE*    PcrInfo,  // in
> -                        UINT32    inDataSize,  // in
> -                        BYTE*    inData,   // in
> -                        TCS_AUTH*   pubAuth,  // in, out
> -                        UINT32*    SealedDataSize, // out
> -                        BYTE**    SealedData)  // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_Seal;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (inData == NULL || pubAuth == NULL || SealedDataSize == NULL || SealedData == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 6,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &keyHandle,
> -                         BSG_TPM_ENCAUTH, encAuth,
> -                         BSG_TYPE_UINT32, &pcrInfoSize);
> -  memcpy(InBuf+InLength, PcrInfo, pcrInfoSize);
> -  InLength += pcrInfoSize;
> -  InLength += BSG_Pack(BSG_TYPE_UINT32, &inDataSize, InBuf+InLength);
> -  memcpy(InBuf+InLength, inData, inDataSize);
> -  InLength += inDataSize;
> -  InLength += packAuth(InBuf+InLength, pubAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      TPM_STORED_DATA sealedData;
> -
> -      i += BSG_Unpack(BSG_TPM_STORED_DATA, OutBuf+i, &sealedData);
> -      unpackAuth(pubAuth, OutBuf+i);
> -
> -      // fill SealedData
> -      BYTE tempBuf[1024];
> -      *SealedDataSize = BSG_Pack(BSG_TPM_STORED_DATA, &sealedData, tempBuf);
> -      if (TCS_Malloc(hContext, *SealedDataSize, SealedData) == TPM_FAIL) {
> -       return TPM_SIZE;
> -      }
> -      memcpy(*SealedData, tempBuf, *SealedDataSize);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Seal Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_Unseal(TCS_CONTEXT_HANDLE hContext,  // in
> -                      TCS_KEY_HANDLE  parentHandle, // in
> -                      UINT32    SealedDataSize, // in
> -                      BYTE*    SealedData,  // in
> -                      TCS_AUTH*   parentAuth,  // in, out
> -                      TCS_AUTH*   dataAuth,  // in, out
> -                      UINT32*   DataSize,  // out
> -                      BYTE**    Data)   // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH2_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_Unseal;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (SealedData == NULL || parentAuth == NULL || dataAuth == NULL ||
> -      DataSize == NULL || Data == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                                     BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &ordinal,
> -                          BSG_TYPE_UINT32, &parentHandle);
> -  memcpy(InBuf+InLength, SealedData, SealedDataSize);
> -  InLength += SealedDataSize;
> -  InLength += packAuth(InBuf+InLength, parentAuth);
> -  InLength += packAuth(InBuf+InLength, dataAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList( OutBuf, 3,
> -                            BSG_TPM_TAG, &tag,
> -                            BSG_TYPE_UINT32, &paramSize,
> -                            BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH2_COMMAND) {
> -      // Extract the remaining output parameters
> -      i += BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, DataSize);
> -      if (TCS_Malloc(hContext, *DataSize, Data) == TPM_FAIL) {
> -        return TPM_SIZE;
> -      }
> -      memcpy(*Data, OutBuf+i, *DataSize);
> -      i += *DataSize;
> -      i += unpackAuth(parentAuth, OutBuf+i);
> -      unpackAuth(dataAuth, OutBuf+i);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Unseal Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_UnBind(TCS_CONTEXT_HANDLE hContext,  // in
> -                      TCS_KEY_HANDLE  keyHandle,  // in
> -                      UINT32    inDataSize,  // in
> -                      BYTE*    inData,   // in
> -                      TCS_AUTH*   privAuth,  // in, out
> -                      UINT32*   outDataSize, // out
> -                      BYTE**    outData)  // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_UnBind;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (inData == NULL || privAuth == NULL || outDataSize == NULL || outData == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 5,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &keyHandle,
> -                         BSG_TYPE_UINT32, &inDataSize);
> -  memcpy(InBuf+InLength, inData, inDataSize);
> -  InLength += inDataSize;
> -  InLength += packAuth(InBuf+InLength, privAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "\n\tSending paramSize = %d", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      i += BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, outDataSize);
> -      if (TCS_Malloc(hContext, *outDataSize, outData) == TPM_FAIL)
> -        return TPM_SIZE;
> -
> -      memcpy(*outData, OutBuf+i, *outDataSize);
> -      i += *outDataSize;
> -      unpackAuth(privAuth, OutBuf+i);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_UnBind Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_CreateWrapKey(TCS_CONTEXT_HANDLE hContext,   // in
> -                             TCS_KEY_HANDLE  hWrappingKey,  // in
> -                             TPM_ENCAUTH  KeyUsageAuth,  // in
> -                             TPM_ENCAUTH  KeyMigrationAuth, // in
> -                             UINT32*    pcKeySize,   // in, out
> -                             BYTE**    prgbKey,   // in, out
> -                             TCS_AUTH*   pAuth)    // in, out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_CreateWrapKey;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (pcKeySize == NULL || *prgbKey == NULL || pAuth == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 6,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &hWrappingKey,
> -                         BSG_TPM_ENCAUTH, KeyUsageAuth,
> -                         BSG_TPM_ENCAUTH, KeyMigrationAuth);
> -  memcpy(InBuf+InLength, *prgbKey, *pcKeySize);
> -  InLength += *pcKeySize;
> -  InLength += packAuth(InBuf+InLength, pAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_RESULT, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      TPM_KEY wrappedKey;
> -
> -      i += BSG_Unpack(BSG_TPM_KEY, OutBuf+i, &wrappedKey);
> -      unpackAuth(pAuth, OutBuf+i);
> -
> -      // Fill prgbKey
> -      BYTE tempBuf[1024];
> -      *pcKeySize = BSG_Pack(BSG_TPM_KEY, &wrappedKey, tempBuf);
> -      if (TCS_Malloc(hContext, *pcKeySize, prgbKey) == TPM_FAIL)
> -        return TPM_SIZE;
> -
> -      memcpy(*prgbKey, tempBuf, *pcKeySize);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_CreateWrapKey Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_LoadKeyByBlob(TCS_CONTEXT_HANDLE hContext,    // in
> -                             TCS_KEY_HANDLE  hUnwrappingKey,   // in
> -                             UINT32    cWrappedKeyBlobSize, // in
> -                             BYTE*    rgbWrappedKeyBlob,  // in
> -                             TCS_AUTH*   pAuth,     // in, out
> -                             TCS_KEY_HANDLE*  phKeyTCSI,    // out
> -                             TCS_KEY_HANDLE*  phKeyHMAC)    // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_LoadKey;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (rgbWrappedKeyBlob == NULL || pAuth == NULL || phKeyTCSI == NULL || phKeyHMAC == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  *phKeyHMAC = hUnwrappingKey; // the parent key is the one that the TPM use to make the HMAC calc
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &hUnwrappingKey);
> -  memcpy(InBuf+InLength, rgbWrappedKeyBlob, cWrappedKeyBlobSize);
> -  InLength += cWrappedKeyBlobSize;
> -  InLength += packAuth(InBuf+InLength, pAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      i += BSG_Unpack(BSG_TYPE_UINT32,
> -                     OutBuf+i,
> -                     phKeyTCSI);
> -      unpackAuth(pAuth, OutBuf+i);
> -
> -      if (!AddHandleToList(hContext, TPM_RT_KEY, *phKeyTCSI)) {
> -        vtpmlogerror(VTPM_LOG_TCS, "New KeyHandle not recorded\n");
> -      }
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -     } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_LoadKeyByBlob Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_EvictKey(TCS_CONTEXT_HANDLE hContext, // in
> -                        TCS_KEY_HANDLE  hKey)  // in
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_EvictKey;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &hKey);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (!DeleteHandleFromList(hContext, hKey)) {
> -      vtpmlogerror(VTPM_LOG_TCS, "KeyHandle not removed from list\n");
> -    }
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else {
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_EvictKey Failed with return code %s\n", tpm_get_error_name(returnCode));
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_GetRandom(TCS_CONTEXT_HANDLE hContext,  // in
> -                         UINT32*    bytesRequested, // in, out
> -                         BYTE**    randomBytes) // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_GetRandom;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (bytesRequested == NULL || *randomBytes == NULL){
> -    return TPM_BAD_PARAMETER;
> -  }
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, bytesRequested);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Extract the remaining output parameters
> -      BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, bytesRequested);
> -      if (TCS_Malloc(hContext, *bytesRequested, randomBytes) == TPM_FAIL) {
> -        return TPM_SIZE;
> -      }
> -      memcpy(*randomBytes, OutBuf+i+sizeof(UINT32), *bytesRequested);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else {
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_GetRandom Failed with return code %s\n", tpm_get_error_name(returnCode));
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_ReadPubek(TCS_CONTEXT_HANDLE   hContext,               // in
> -                         TPM_NONCE            antiReplay,             // in
> -                         UINT32*              pubEndorsementKeySize,  // out
> -                         BYTE**               pubEndorsementKey,      // out
> -                         TPM_DIGEST*          checksum)               // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_ReadPubek;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32   OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (pubEndorsementKeySize == NULL || pubEndorsementKey == NULL || checksum == NULL) {
> -    return TPM_BAD_PARAMETER;
> -  }
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TPM_NONCE, &antiReplay);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Extract the remaining output parameters
> -      TPM_PUBKEY pubEK;
> -      i += BSG_UnpackList(OutBuf+i, 2,
> -                         BSG_TPM_PUBKEY, &pubEK,
> -                         BSG_TPM_DIGEST, checksum);
> -
> -      // fill EndorsementKey
> -      BYTE tempBuf[1024];
> -      *pubEndorsementKeySize = BSG_Pack(BSG_TPM_PUBKEY, &pubEK, tempBuf);
> -      if (TCS_Malloc(hContext, *pubEndorsementKeySize, pubEndorsementKey) == TPM_FAIL) {
> -        return TPM_SIZE;
> -      }
> -      memcpy(*pubEndorsementKey, tempBuf, *pubEndorsementKeySize);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else {
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_ReadPubek Failed with return code %s\n", tpm_get_error_name(returnCode));
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_SaveState(TCS_CONTEXT_HANDLE   hContext)  // in
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_SaveState;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &ordinal);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    BSG_UnpackList(OutBuf, 3,
> -                           BSG_TPM_TAG, &tag,
> -                           BSG_TYPE_UINT32, &paramSize,
> -                           BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else {
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_SaveState Failed with return code %s\n", tpm_get_error_name(returnCode));
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_RawTransmitData(   UINT32 inDataSize,  // in
> -                                  BYTE *inData,       // in
> -                                  UINT32 *outDataSize,// in/out
> -                                  BYTE *outData) {    // out
> -
> -  TDDL_RESULT hRes;
> -
> -  vtpmloginfo(VTPM_LOG_TCS, "Calling TransmitData directly.\n");
> -  //FIXME: Add Context Management
> -  hRes = TDDL_TransmitData( inData,
> -                           inDataSize,
> -                           outData,
> -                           outDataSize);
> -
> -  if (hRes == TDDL_SUCCESS) {
> -    return TPM_SUCCESS;
> -  } else {
> -    vtpmlogerror(VTPM_LOG_TCS, "TCSP_RawTransmitData Failed with return code %s\n", tpm_get_error_name(TPM_IOERROR));
> -    return TPM_IOERROR;
> -  }
> -
> -}
> diff --git a/tools/vtpm_manager/tcs/tcs.h b/tools/vtpm_manager/tcs/tcs.h
> deleted file mode 100644
> index 83b9cd0..0000000
> --- a/tools/vtpm_manager/tcs/tcs.h
> +++ /dev/null
> @@ -1,245 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tcs.h
> -//
> -//  This file declares the TCS API
> -//
> -// ==================================================================
> -
> -#ifndef __TCS_H__
> -#define __TCS_H__
> -
> -#include "tcg.h"
> -#include "contextmgr.h"
> -#include "buffer.h"
> -
> -#define HANDLE_NULL 0
> -
> -// ------------------------------------------------------------------
> -// Exposed API
> -// ------------------------------------------------------------------
> -
> -TPM_RESULT TCS_create();
> -void TCS_destroy();
> -
> -TPM_RESULT TCS_OpenContext( /* OUT */ TCS_CONTEXT_HANDLE* hContext );
> -
> -TPM_RESULT TCS_CloseContext ( /* IN */ TCS_CONTEXT_HANDLE hContext );
> -
> -TPM_RESULT TCS_Malloc ( TCS_CONTEXT_HANDLE hContext, // in
> -                       UINT32   MemSize, // in
> -                       BYTE**   ppMemPtr ); //out
> -
> -TPM_RESULT TCS_FreeMemory ( TCS_CONTEXT_HANDLE hContext, // in
> -                           BYTE*    pMemory);  // in
> -
> -// ------------------------------------------------------------------
> -// Exposed API
> -// ------------------------------------------------------------------
> -
> -// TPM v1.1B Command Set
> -
> -// Authorzation
> -TPM_RESULT TCSP_OIAP( TCS_CONTEXT_HANDLE hContext, // in
> -                     TCS_AUTHHANDLE*  authHandle, // out
> -                     TPM_NONCE*   nonce0  // out
> -                     );
> -
> -TPM_RESULT TCSP_OSAP (  TCS_CONTEXT_HANDLE hContext,  // in
> -                       TPM_ENTITY_TYPE entityType,  // in
> -                       UINT32    entityValue, // in
> -                       TPM_NONCE   nonceOddOSAP, // in
> -                       TCS_AUTHHANDLE*  authHandle,  // out
> -                       TPM_NONCE*   nonceEven,  // out
> -                       TPM_NONCE*   nonceEvenOSAP // out
> -                       );
> -
> -TPM_RESULT TCSP_TakeOwnership (  TCS_CONTEXT_HANDLE hContext,   // in
> -                                UINT16    protocolID,   // in
> -                                UINT32    encOwnerAuthSize, // in
> -                                BYTE*    encOwnerAuth,  // in
> -                                UINT32    encSrkAuthSize,  // in
> -                                BYTE*    encSrkAuth,   // in
> -                                UINT32*    SrkSize,   // in, out
> -                                BYTE**    Srk,    // in, out
> -                                TCS_AUTH*   ownerAuth   // in, out
> -                                );
> -
> -TPM_RESULT TCSP_DisablePubekRead (  TCS_CONTEXT_HANDLE hContext, // in
> -                                    TCS_AUTH*   ownerAuth // in, out
> -                                    );
> -
> -TPM_RESULT TCSP_TerminateHandle (  TCS_CONTEXT_HANDLE hContext, // in
> -                                  TCS_AUTHHANDLE  handle  // in
> -                                  );
> -
> -TPM_RESULT TCSP_FlushSpecific (  TCS_CONTEXT_HANDLE hContext, // in
> -                                TCS_AUTHHANDLE  handle,  // in
> -                                TPM_RESOURCE_TYPE resourceType //in
> -                                );
> -
> -// TPM Mandatory
> -TPM_RESULT TCSP_Extend (  TCS_CONTEXT_HANDLE hContext, // in
> -                         TPM_PCRINDEX  pcrNum,  // in
> -                         TPM_DIGEST   inDigest, // in
> -                         TPM_PCRVALUE*   outDigest // out
> -                         );
> -
> -TPM_RESULT TCSP_PcrRead (  TCS_CONTEXT_HANDLE hContext, // in
> -                          TPM_PCRINDEX  pcrNum,  // in
> -                          TPM_PCRVALUE*  outDigest // out
> -                          );
> -
> -TPM_RESULT TCSP_Quote (  TCS_CONTEXT_HANDLE hContext,  // in
> -                        TCS_KEY_HANDLE  keyHandle,  // in
> -                        TPM_NONCE   antiReplay,  // in
> -                        UINT32*    PcrDataSize, // in, out
> -                        BYTE**    PcrData,  // in, out
> -                        TCS_AUTH*   privAuth,  // in, out
> -                        UINT32*    sigSize,  // out
> -                        BYTE**    sig    // out
> -                        );
> -
> -TPM_RESULT TCSP_Seal (  TCS_CONTEXT_HANDLE hContext,  // in
> -                       TCS_KEY_HANDLE  keyHandle,  // in
> -                       TPM_ENCAUTH  encAuth,  // in
> -                       UINT32    pcrInfoSize, // in
> -                       BYTE*    PcrInfo,  // in
> -                       UINT32    inDataSize,  // in
> -                       BYTE*    inData,   // in
> -                       TCS_AUTH*   pubAuth,  // in, out
> -                       UINT32*    SealedDataSize, // out
> -                       BYTE**    SealedData  // out
> -                       );
> -
> -TPM_RESULT TCSP_Unseal (  TCS_CONTEXT_HANDLE hContext,  // in
> -                         TCS_KEY_HANDLE  parentHandle, // in
> -                         UINT32    SealedDataSize, // in
> -                         BYTE*    SealedData,  // in
> -                         TCS_AUTH*   parentAuth,  // in, out
> -                         TCS_AUTH*   dataAuth,  // in, out
> -                         UINT32*    DataSize,  // out
> -                         BYTE**    Data   // out
> -                         );
> -
> -TPM_RESULT TCSP_DirWriteAuth (  TCS_CONTEXT_HANDLE hContext,  // in
> -                               TPM_DIRINDEX  dirIndex,  // in
> -                               TPM_DIRVALUE  newContents, // in
> -                               TCS_AUTH*   ownerAuth  // in, out
> -                               );
> -
> -TPM_RESULT TCSP_DirRead (  TCS_CONTEXT_HANDLE hContext, // in
> -                          TPM_DIRINDEX  dirIndex, // in
> -                          TPM_DIRVALUE*  dirValue // out
> -                          );
> -
> -TPM_RESULT TCSP_UnBind (  TCS_CONTEXT_HANDLE hContext,  // in
> -                         TCS_KEY_HANDLE  keyHandle,  // in
> -                         UINT32    inDataSize,  // in
> -                         BYTE*    inData,   // in
> -                         TCS_AUTH*   privAuth,  // in, out
> -                         UINT32*    outDataSize, // out
> -                         BYTE**    outData   // out
> -                         );
> -
> -TPM_RESULT TCSP_CreateWrapKey (  TCS_CONTEXT_HANDLE hContext,   // in
> -                                TCS_KEY_HANDLE  hWrappingKey,  // in
> -                                TPM_ENCAUTH  KeyUsageAuth,  // in
> -                                TPM_ENCAUTH  KeyMigrationAuth, // in
> -                                UINT32*    pcKeySize,   // in, out
> -                                BYTE**    prgbKey,   // in, out
> -                                TCS_AUTH*   pAuth    // in, out
> -                                );
> -
> -TPM_RESULT TCSP_LoadKeyByBlob (  TCS_CONTEXT_HANDLE hContext,    // in
> -                                TCS_KEY_HANDLE  hUnwrappingKey,   // in
> -                                UINT32    cWrappedKeyBlobSize, // in
> -                                BYTE*    rgbWrappedKeyBlob,  // in
> -                                TCS_AUTH*   pAuth,     // in, out
> -                                TCS_KEY_HANDLE*  phKeyTCSI,    // out
> -                                TCS_KEY_HANDLE*  phKeyHMAC    // out
> -                                );
> -
> -TPM_RESULT TCSP_GetPubKey (  TCS_CONTEXT_HANDLE hContext,  // in
> -                            TCS_KEY_HANDLE  hKey,   // in
> -                            TCS_AUTH*   pAuth,   // in, out
> -                            UINT32*    pcPubKeySize, // out
> -                            BYTE**    prgbPubKey  // out
> -                            );
> -
> -TPM_RESULT TCSP_EvictKey (  TCS_CONTEXT_HANDLE hContext, // in
> -                           TCS_KEY_HANDLE  hKey  // in
> -                           );
> -
> -TPM_RESULT TCSP_Sign (  TCS_CONTEXT_HANDLE hContext,  // in
> -                       TCS_KEY_HANDLE  keyHandle,  // in
> -                       UINT32    areaToSignSize, // in
> -                       BYTE*    areaToSign,  // in
> -                       TCS_AUTH*   privAuth,  // in, out
> -                       UINT32*    sigSize,  // out
> -                       BYTE**    sig    // out
> -                       );
> -
> -TPM_RESULT TCSP_GetRandom (  TCS_CONTEXT_HANDLE hContext,  // in
> -                            UINT32*    bytesRequested, // in, out
> -                            BYTE**    randomBytes  // out
> -                            );
> -
> -TPM_RESULT TCSP_StirRandom (  TCS_CONTEXT_HANDLE hContext, // in
> -                             UINT32    inDataSize, // in
> -                             BYTE*    inData  // in
> -                             );
> -
> -TPM_RESULT TCSP_ReadPubek (  TCS_CONTEXT_HANDLE hContext,    // in
> -                            TPM_NONCE   antiReplay,    // in
> -                            UINT32*    pubEndorsementKeySize, // out
> -                            BYTE**    pubEndorsementKey,  // out
> -                            TPM_DIGEST*  checksum    // out
> -                            );
> -
> -
> -// Non-Standard TCSP calls
> -TPM_RESULT TCSP_SaveState(TCS_CONTEXT_HANDLE   hContext);  // in
> -
> -//Give direct access to TransmitData.
> -// Key and Auth Management is done before transfering command to TDDL.
> -TPM_RESULT TCSP_RawTransmitData(UINT32 inDataSize,  // in
> -                               BYTE *inData,       // in
> -                               UINT32 *outDataSize,// in/out
> -                               BYTE *outData);     // out
> -
> -///////////// Private Functions ////////////////////
> -CONTEXT_HANDLE* LookupContext( TCS_CONTEXT_HANDLE hContext);
> -
> -#endif //TCS_H
> diff --git a/tools/vtpm_manager/tcs/tpmddl.h b/tools/vtpm_manager/tcs/tpmddl.h
> deleted file mode 100644
> index e7e54f1..0000000
> --- a/tools/vtpm_manager/tcs/tpmddl.h
> +++ /dev/null
> @@ -1,69 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tpmddl.c
> -//
> -//  This file defines the TDDLI API
> -//
> -// ==================================================================
> -
> -#ifndef __TPMDDL_H__
> -#define __TPMDDL_H__
> -
> -#define TDDL_CAP_PROP_MANUFACTURER 0x0001
> -
> -#define TDDL_E_FAIL 1
> -#define TDDL_E_SUCCESS 0
> -#define TDDL_SUCCESS 0
> -
> -typedef unsigned int TDDL_UINT32;
> -typedef TDDL_UINT32 TDDL_RESULT;
> -typedef unsigned char TDDL_BYTE;
> -
> -TDDL_RESULT TDDL_Open();
> -void TDDL_Close();
> -TDDL_RESULT TDDL_TransmitData( TDDL_BYTE* in,
> -                              TDDL_UINT32 insize,
> -                              TDDL_BYTE* out,
> -                              TDDL_UINT32* outsize);
> -TDDL_RESULT TDDL_GetStatus();
> -TDDL_RESULT TDDL_GetCapability( TDDL_UINT32 cap,
> -                               TDDL_UINT32 sub,
> -                               TDDL_BYTE* buffer,
> -                               TDDL_UINT32* size);
> -TDDL_RESULT TDDL_SetCapability( TDDL_UINT32 cap,
> -                               TDDL_UINT32 sub,
> -                               TDDL_BYTE* buffer,
> -                               TDDL_UINT32* size);
> -
> -#endif // __TPMDDL_H__
> diff --git a/tools/vtpm_manager/tcs/transmit.c b/tools/vtpm_manager/tcs/transmit.c
> deleted file mode 100644
> index 74bbdca..0000000
> --- a/tools/vtpm_manager/tcs/transmit.c
> +++ /dev/null
> @@ -1,147 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <unistd.h>
> -#include <stdio.h>
> -#include <errno.h>
> -#include <fcntl.h>
> -
> -#include "tcg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "tpmddl.h"
> -
> -// flag to track whether TDDL has been opened
> -static int g_TDDL_open = 0;
> -static int g_tx_fd = -1;              // the fd to the TPM
> -
> -#ifndef DUMMY_TPM
> - #define TPM_TX_FNAME "/dev/tpm0"
> - static int *g_rx_fdp = &g_tx_fd;
> -#else
> - #define TPM_TX_FNAME "/var/tpm/tpm_in.fifo"
> - #define TPM_RX_FNAME "/var/tpm/tpm_out.fifo"
> - static int g_rx_fd = -1;
> - static int *g_rx_fdp = &g_rx_fd;              // the fd to the TPM
> -#endif
> -
> -TPM_RESULT
> -TDDL_TransmitData( TDDL_BYTE* in,
> -                  TDDL_UINT32 insize,
> -                  TDDL_BYTE* out,
> -                  TDDL_UINT32* outsize) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TDDL_UINT32 i;
> -
> -  vtpmloginfo(VTPM_LOG_TXDATA, "Sending buffer = 0x");
> -  for(i = 0 ; i < insize ; i++)
> -    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", in[i]);
> -
> -  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> -
> -  ssize_t size = 0;
> -
> -  // send the request
> -  size = write (g_tx_fd, in, insize);
> -  if (size < 0) {
> -    vtpmlogerror(VTPM_LOG_TXDATA, "write() failed");
> -    ERRORDIE (TPM_IOERROR);
> -  }
> -  else if ((TDDL_UINT32) size < insize) {
> -    vtpmlogerror(VTPM_LOG_TXDATA, "Wrote %d instead of %d bytes!\n", (int) size, insize);
> -    // ... ?
> -  }
> -
> -  // read the response
> -  size = read (*g_rx_fdp, out, TCPA_MAX_BUFFER_LENGTH);
> -  if (size < 0) {
> -    vtpmlogerror(VTPM_LOG_TXDATA, "read() failed");
> -    ERRORDIE (TPM_IOERROR);
> -  }
> -
> -  vtpmloginfo(VTPM_LOG_TXDATA, "Receiving buffer = 0x");
> -  for(i = 0 ; i < size ; i++)
> -    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out[i]);
> -
> -  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> -
> -  *outsize = size;
> -  // close connection
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -  return status;
> -}
> -
> -TPM_RESULT TDDL_Open() {
> -
> -  TDDL_RESULT status = TDDL_SUCCESS;
> -
> -  if (g_TDDL_open)
> -    return TPM_FAIL;
> -
> -#ifdef DUMMY_TPM
> -  *g_rx_fdp = open (TPM_RX_FNAME, O_RDWR);
> -#endif
> -
> -  g_tx_fd = open (TPM_TX_FNAME, O_RDWR);
> -  if (g_tx_fd < 0) {
> -    vtpmlogerror(VTPM_LOG_TXDATA, "TPM open failed");
> -    return TPM_IOERROR;
> -  }
> -
> -  g_TDDL_open = 1;
> -
> -  return status;
> -}
> -
> -void TDDL_Close() {
> -  if (! g_TDDL_open)
> -        return;
> -
> -  if (g_tx_fd>= 0) {
> -    if (close(g_tx_fd) < 0)
> -      vtpmlogerror(VTPM_LOG_TXDATA, "closeing tpm failed");
> -    g_tx_fd = -1;
> -  }
> -
> -  if (*g_rx_fdp>= 0) {
> -    if (close(*g_rx_fdp) < 0)
> -      vtpmlogerror(VTPM_LOG_TXDATA, "closeing tpm failed");
> -    *g_rx_fdp = -1;
> -  }
> -
> -  g_TDDL_open = 0;
> -
> -}
> diff --git a/tools/vtpm_manager/util/Makefile b/tools/vtpm_manager/util/Makefile
> deleted file mode 100644
> index 36bc38f..0000000
> --- a/tools/vtpm_manager/util/Makefile
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -BIN            = libTCGUtils.a
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIN)
> -
> -.PHONY: install
> -install: build
> -
> -.PHONY: clean
> -clean:
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIN): $(OBJS)
> -       $(AR) rcs $(BIN) $(OBJS)
> diff --git a/tools/vtpm_manager/util/bsg.c b/tools/vtpm_manager/util/bsg.c
> deleted file mode 100644
> index fa36ce7..0000000
> --- a/tools/vtpm_manager/util/bsg.c
> +++ /dev/null
> @@ -1,829 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// bsg.cpp
> -//
> -//  This file will handle all the TPM Byte Stream functions
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <string.h>
> -#include <stdarg.h>
> -#include <malloc.h>
> -#include "tcg.h"
> -#include "crypto.h"
> -#include "bsg.h"
> -#include "log.h"
> -
> -static int g_log_recursion_level = 0;
> -
> -// a largest buffer size. if we get a buf size bigger than this when unpacking,
> -// will complain!
> -#define BSG_MAX_BUF_SIZE (1<<18)
> -
> -#define bsglog(fmt, ...) do { \
> -    int __i; \
> -    for (__i=0; __i < g_log_recursion_level; __i++) {               \
> -      vtpmloginfomore (VTPM_LOG_BSG, "%s", "  ");                           \
> -    }                                                                 \
> -    vtpmloginfomore (VTPM_LOG_BSG, fmt, __VA_ARGS__);                         \
> -  } while (0)
> -
> -
> -// FIXME:  trigger the selfcheck--need to use glibc hook to do this
> -//BOOL dummy1 = BSG_static_selfcheck();
> -
> -
> -// Interpretting Types
> -// -------------------
> -//
> -// Incoming Types are composed of two parts {format, info} squished into a
> -// BSG_UINT32.  The first 4 bits is a format spec indicating what type of
> -// data it is.  If the first 4 bits are zero the info corresponds to a value in
> -// BSG_s_fmt[]. This is a structure whose composition is described in
> -// BSG_s_fmt[]. If the value is non-zero, info corresponds to the size of the
> -// data (in bytes) being passed in. For example a UINT32 being passed in would
> -// have a format of (__FMT_CONST | 4). If both, the format and info are zero,
> -// this is interpretted as the end of the structure, and the result is returned.
> -
> -// these flags are mutually exclusive, so I'll just make them
> -// format values which indicate the semantics of the 'info' part and the source
> -// data. The above description has been accordingly adjusted.
> -
> -// format values for determining what type of data the incoming type is
> -// it's a 4 bit value, occupying the high 4 bits
> -#define __FMT_CONST (1UL << 28) // Constant sized value
> -#define __FMT_DATA  (2UL << 28) // Believed to be raw data NOT {size,data}
> -#define __FMT_SIZE  (3UL << 28) // A size. Used in FMT_SIZE??_DATA.
> -#define __FMT_HSIZE (4UL << 28) // A number of handles
> -#define __FMT_PACKED (5UL << 28) // 'info' is unused; the source data consists
> -                                 // of {size32, data} but we're to pack only the
> -                                 // data as that is already packed, and so
> -                                 // can/must be unpacked without
> -                                 // explicitly reading it size
> -
> -#define __FMT_MASK  0x0FFFFFFFUL // this masks out the 4-bit format
> -#define __FMT_MASK_SIZE(type)   ((type) & __FMT_MASK)
> -#define __FMT_MASK_FORMAT(type) ((type) & (~__FMT_MASK))
> -
> -// constant (8/16/32-bits)
> -#define FMT_U8 (__FMT_CONST | 1UL)
> -#define FMT_U16 (__FMT_CONST | 2UL)
> -#define FMT_U32 (__FMT_CONST | 4UL)
> -
> -// const with a compiler-computed size
> -#define FMT_SIZEOF(type) (__FMT_CONST | sizeof(type))
> -
> -// other data (size bytes)
> -// Used primarily for DIGESTS -> FMT_DATA(20)
> -#define FMT_DATA(size) (__FMT_DATA | ((BSG_UINT32) (size) & __FMT_MASK))
> -
> -// 16/32-bit size followed by N bytes of data
> -#define FMT_SIZE16_DATA (__FMT_SIZE | 2UL)
> -#define FMT_SIZE32_DATA (__FMT_SIZE | 4UL)
> -
> -// 16-bit size followed by N key handles
> -#define FMT_SIZE16_HANDLES (__FMT_HSIZE | 2UL)
> -
> -#define DIGEST_SIZE 20
> -typedef BSG_UINT32 BSG_HANDLE;
> -
> -// TCPA_AUTH has 11 fields!
> -#define MAX_FIELDS 11
> -typedef struct BSG_Format
> -{
> -  BSG_Type type;
> -  const char* name;
> -  BSG_UINT32 fields[MAX_FIELDS + 1];
> -} BSG_Format;
> -
> -/*
> - * TCPA structure data formats
> - */
> -// this has to be manually kept in sync with the
> -// Type enum!! the static_selfcheck() function should be used regularly!
> -static BSG_Format s_fmt[] =
> -{
> -  {BSG_TYPE_UINT32, "BSG_TYPE_UINT32", {FMT_U32, 0}},
> -  {BSG_TYPE_UINT16, "BSG_TYPE_UINT16", {FMT_U16, 0}},
> -  {BSG_TYPE_BYTE, "BSG_TYPE_BYTE", {FMT_U8, 0}},
> -  {BSG_TYPE_BOOL, "BSG_TYPE_BOOL", {FMT_U8, 0}},
> -  {BSG_TPM_SIZE32_DATA, "BSG_TPM_SIZE32_DATA", {FMT_SIZE32_DATA, 0}},
> -  {BSG_TPM_TAG, "BSG_TPM_TAG", {FMT_SIZEOF(TPM_TAG), 0}},
> -  {BSG_TPM_HANDLE, "BSG_TPM_HANDLE", {FMT_SIZEOF(TPM_HANDLE), 0}},
> -  {BSG_TPM_RESULT, "BSG_TPM_RESULT", {FMT_SIZEOF(TPM_RESULT), 0}},
> -  {BSG_TPM_RESOURCE_TYPE, "BSG_TPM_RESOURCE_TYPE", {FMT_SIZEOF(TPM_RESOURCE_TYPE), 0}},
> -  {BSG_TPM_COMMAND_CODE, "BSG_TPM_COMMAND_CODE", {FMT_U32, 0}},
> -  {BSG_TPM_AUTH_DATA_USAGE, "BSG_TPM_AUTH_DATA_USAGE", {FMT_U8, 0}},
> -  {BSG_TPM_ALGORITHM_ID, "BSG_TPM_ALGORITHM_ID", {FMT_U32, 0}},
> -  {BSG_TPM_PROTOCOL_ID, "BSG_TPM_PROTOCOL_ID", {FMT_SIZEOF(TPM_PROTOCOL_ID), 0}},
> -  {BSG_TPM_KEY_USAGE, "BSG_TPM_KEY_USAGE", {FMT_U16, 0}},
> -  {BSG_TPM_ENC_SCHEME, "BSG_TPM_ENC_SCHEME", {FMT_U16, 0}},
> -  {BSG_TPM_SIG_SCHEME, "BSG_TPM_SIG_SCHEME", {FMT_U16, 0}},
> -  {BSG_TPM_MIGRATE_SCHEME, "BSG_TPM_MIGRATE_SCHEME", {FMT_U16, 0}},
> -  {BSG_TPM_KEY_FLAGS, "BSG_TPM_KEY_FLAGS", {FMT_U32, 0}},
> -
> -  {BSG_TPM_AUTHDATA, "BSG_TPM_AUTHDATA", {FMT_DATA(DIGEST_SIZE), 0}},
> -  {BSG_TPM_SECRET, "BSG_TPM_SECRET", {BSG_TPM_AUTHDATA, 0}},
> -  {BSG_TPM_ENCAUTH, "BSG_TPM_ENCAUTH", {BSG_TPM_AUTHDATA, 0}},
> -  {BSG_TPM_PAYLOAD_TYPE, "BSG_TPM_PAYLOAD_TYPE", {FMT_SIZEOF(TPM_PAYLOAD_TYPE), 0}},
> -
> -  {BSG_TPM_VERSION, "BSG_TPM_VERSION", {FMT_DATA(4), 0}}, // vers 1.2
> -  {BSG_TPM_DIGEST, "BSG_TPM_DIGEST", {FMT_DATA(DIGEST_SIZE), 0}},
> -  {BSG_TPM_COMPOSITE_HASH, "BSG_TPM_COMPOSITE_HASH", {BSG_TPM_DIGEST, 0}},
> -  {BSG_TPM_CHOSENID_HASH, "BSG_TPM_CHOSENID_HASH", {BSG_TPM_DIGEST, 0}},
> -
> -  {BSG_TPM_NONCE, "BSG_TPM_NONCE", {FMT_DATA(DIGEST_SIZE), 0}},
> -  {BSG_TPM_KEY_HANDLE, "BSG_TPM_KEY_HANDLE", {FMT_SIZEOF(TPM_KEY_HANDLE), 0}},
> -  {BSG_TPM_KEY_HANDLE_LIST, "BSG_TPM_KEY_HANDLE_LIST",
> -   {FMT_SIZE16_HANDLES, 0}},
> -
> -  {BSG_TPM_KEY_PARMS, "BSG_TPM_KEY_PARMS", {
> -      BSG_TPM_ALGORITHM_ID,
> -      BSG_TPM_ENC_SCHEME,
> -      BSG_TPM_SIG_SCHEME,
> -      FMT_SIZE32_DATA,
> -      0}},
> -  {BSG_TPM_RSA_KEY_PARMS, "BSG_TPM_RSA_KEY_PARMS", {
> -      FMT_U32, FMT_U32, FMT_SIZE32_DATA, 0}},
> -  {BSG_TPM_STORE_PUBKEY, "BSG_TPM_STORE_PUBKEY", {FMT_SIZE32_DATA, 0}},
> -  {BSG_TPM_PUBKEY, "BSG_TPM_PUBKEY", {BSG_TPM_KEY_PARMS, BSG_TPM_STORE_PUBKEY, 0}},
> -  {BSG_TPM_KEY, "BSG_TPM_KEY", {
> -      BSG_TPM_VERSION,
> -      BSG_TPM_KEY_USAGE,
> -      BSG_TPM_KEY_FLAGS,
> -      BSG_TPM_AUTH_DATA_USAGE,
> -      BSG_TPM_KEY_PARMS,
> -      FMT_SIZE32_DATA,        // the PCR_INFO
> -      BSG_TPM_STORE_PUBKEY,
> -      FMT_SIZE32_DATA,        // the encrypted part
> -      0}},
> -
> -  {BSG_TPM_MIGRATIONKEYAUTH, "BSG_TPM_MIGRATIONKEYAUTH", {
> -      BSG_TPM_PUBKEY,
> -      BSG_TPM_MIGRATE_SCHEME,
> -      BSG_TPM_DIGEST, 0}},
> -
> -  {BSG_TCPA_AUDIT_EVENT, "TCPA_AUDIT_EVENT", {
> -      BSG_TPM_COMMAND_CODE,
> -      BSG_TPM_RESULT, 0 }},
> -
> -  {BSG_TCPA_EVENT_CERT, "TCPA_EVENT_CERT", {
> -      BSG_TPM_DIGEST,
> -      BSG_TPM_DIGEST,
> -      FMT_DATA(2),
> -      FMT_SIZE32_DATA, 0}},
> -
> -  {BSG_TPM_PCR_SELECTION, "BSG_TPM_PCR_SELECTION", {FMT_SIZE16_DATA, 0} },
> -  {BSG_TPM_PCR_COMPOSITE, "BSG_TPM_PCR_COMPOSITE", { BSG_TPM_PCR_SELECTION,
> -                                                    FMT_SIZE32_DATA,
> -                                                    0} },
> -
> -  {BSG_TPM_PCR_INFO, "BSG_TPM_PCR_INFO", { BSG_TPM_PCR_SELECTION,
> -                                          BSG_TPM_COMPOSITE_HASH,
> -                                          BSG_TPM_COMPOSITE_HASH,
> -                                          0} },
> -
> -
> -  {BSG_TPM_STORED_DATA, "BSG_TPM_STORED_DATA", {
> -      BSG_TPM_VERSION,
> -      FMT_SIZE32_DATA,
> -      FMT_SIZE32_DATA,
> -      0}},
> -  {BSG_TPM_SYMMETRIC_KEY, "BSG_TPM_SYMMETRIC_KEY", {
> -      BSG_TPM_ALGORITHM_ID,
> -      BSG_TPM_ENC_SCHEME,
> -      FMT_SIZE16_DATA,
> -      0}},
> -  {BSG_TPM_STORE_PRIVKEY, "BSG_TPM_STORE_PRIVKEY", {FMT_SIZE32_DATA, 0}},
> -  {BSG_TPM_STORE_ASYMKEY, "BSG_TPM_STORE_ASYMKEY", {
> -      BSG_TPM_PAYLOAD_TYPE,
> -      BSG_TPM_SECRET,
> -      BSG_TPM_SECRET,
> -      BSG_TPM_DIGEST,
> -      BSG_TPM_STORE_PRIVKEY,
> -      0}},
> -  {BSG_TPM_MIGRATE_ASYMKEY, "BSG_TPM_MIGRATE_ASYMKEY", {
> -      BSG_TPM_PAYLOAD_TYPE,
> -      BSG_TPM_SECRET,
> -      BSG_TPM_DIGEST,
> -      FMT_U32,
> -      BSG_TPM_STORE_PRIVKEY,
> -      0}},
> -
> -  {BSG_TPM_QUOTE_INFO, "BSG_TPM_QUOTE_INFO", {
> -      BSG_TPM_VERSION,
> -      FMT_DATA(4),
> -      BSG_TPM_COMPOSITE_HASH,
> -      BSG_TPM_NONCE,
> -      0}},
> -
> -  {BSG_TPM_IDENTITY_CONTENTS, "BSG_TPM_IDENTITY_CONTENTS", {
> -      BSG_TPM_VERSION,
> -      FMT_U32,
> -      BSG_TPM_CHOSENID_HASH,
> -      BSG_TPM_PUBKEY,
> -      0}},
> -
> -  {BSG_TPM_PCRVALUE, "BSG_TPM_PCRVALUE", {FMT_DATA(DIGEST_SIZE), 0}},
> -
> -  {BSG_TCPA_PCR_FLAGS, "TCPA_PCR_FLAGS", {
> -      FMT_U8,
> -      FMT_U8,
> -      0}},
> -
> -  {BSG_TCS_AUTH, "TCS_AUTH", {
> -      BSG_TYPE_UINT32,
> -      BSG_TPM_NONCE,
> -      BSG_TPM_NONCE,
> -      BSG_TYPE_BOOL,
> -      BSG_TPM_AUTHDATA,
> -      0}},
> -
> -  {BSG_TPM_KEY_NONSENSITIVE, "BSG_TPM_KEY_NONSENSITIVE", {
> -      BSG_TPM_VERSION,
> -      BSG_TPM_KEY_USAGE,
> -      BSG_TPM_KEY_FLAGS,
> -      BSG_TPM_AUTH_DATA_USAGE,
> -      BSG_TPM_KEY_PARMS,
> -      FMT_SIZE32_DATA,
> -      BSG_TPM_STORE_PUBKEY,
> -      0}},
> -
> -  {BSG_PACKED, "BSG_PACKED", {
> -      __FMT_PACKED,
> -      0 }},
> -
> -  {BSG_TYPE_MAX, "", {0}},
> -};
> -
> -
> -static const BSG_Format* find_format (BSG_Type t) {
> -  BSG_Format * f = s_fmt;
> -
> -  if (t >= BSG_TYPE_MAX) {
> -    return NULL;
> -  }
> -
> -  // WARNING: this depends on the enum and s_fmt[] array being in sync! make
> -  // sure to run the static_selfcheck() to make sure
> -  f = s_fmt + (t - BSG_TYPE_FIRST);
> -
> -  return f;
> -}
> -
> -//
> -// a consistency-checking routine which can be run at compile time
> -// (ie. immediately after compilation)
> -//
> -// tasks:
> -// - verify that s_fmt has one entry per Type t, and that entry is at s_fmt[t]
> -//
> -// conditions:
> -// - need that s_fmt[0] is the first type listed in the Type enum! ie the first
> -//   Type has value 0, not 1
> -//
> -// FIXME: should have a function be passed in here which is called if the test
> -// fails. Then the caller can decide what to do: abort, notify, whatever
> -//
> -BOOL BSG_static_selfcheck ()
> -{
> -  int i;
> -
> -  for (i=BSG_TYPE_FIRST; i <= BSG_TYPE_MAX; i++) {
> -    if (s_fmt[i - BSG_TYPE_FIRST].type != i) {
> -      bsglog ("%s\n", "BSG: static_selfcheck failed!\n");
> -      bsglog ("failure at %i, allegedly %s\n",
> -             i, s_fmt[i - BSG_TYPE_FIRST].name);
> -      abort();
> -      return FALSE;
> -    }
> -  }
> -
> -  bsglog ("%s\n", "BSG: static_selfcheck success!");
> -  return TRUE;
> -}
> -
> -
> -/**
> - * Flatten a TCPA structure into a buffer in big-endian format
> - * @type: TCPA structure type
> - * @src: (IN) TCPA structure (OUT) end of TCPA structure
> - * @dst: (OUT) flattened data
> - * Returns: Flattened size or -1 for unknown types
> - */
> -// make it so that it can just run through the whole process and return
> -// the packed size, without packing anything. this will be done if dst is NULL.
> -static int BSG_Pack_private(BSG_Type type, const BSG_BYTE** src, BSG_BYTE* dst)
> -{
> -  // check incoming parameters
> -  if (*src == NULL)
> -    return 0;
> -
> -  const BSG_BYTE* s = *src;
> -  BSG_BYTE* d = dst;
> -
> -  BSG_UINT32 size   = __FMT_MASK_SIZE(type);
> -  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
> -
> -  if (format == __FMT_CONST) // We are dealing with a fixed length value eg. UINT32
> -    {
> -      BSG_UINT32 val = 0;
> -      switch (size) {
> -      case 1: val = * (BYTE*) s; break;
> -      case 2: val = * (unsigned short*) s; break;
> -      case 4: val = * (BSG_UINT32*) s; break;
> -      }
> -      if (dst)
> -       BSG_PackConst(val, size, d);
> -
> -      s += size;
> -      d += size;
> -    } else if (format == __FMT_DATA) { // We are dealing with raw data. Not sure when
> -    // this is used.
> -
> -      if (dst) {
> -        bsglog ("BSG: __FMT_DATA size %d, src %p, dst %p\n", size, s, d);
> -        memcpy(d, s, size);
> -      }
> -
> -      s += size;
> -      d += size;
> -  } else if (format == __FMT_SIZE || format == __FMT_HSIZE) { // It's a size, followed by that much data or handles
> -
> -    BSG_UINT32 psize = 0;
> -    switch (size) {
> -    case 1: psize = * (BYTE*) s; break;
> -    case 2: psize = * (unsigned short*) s; break;
> -    case 4: psize = * (BSG_UINT32*) s; break;
> -    }
> -
> -    if (dst)
> -      BSG_PackConst(psize, size, d);
> -
> -    s += size;
> -    d += size;
> -
> -    // now 's' points to an address, so cast it to BSG_BYTE**
> -    const BSG_BYTE* pdata = * ((BSG_BYTE**) s);
> -    s += sizeof(BSG_BYTE*);
> -
> -    if (format == __FMT_HSIZE) {// This is a list of psize Handles
> -      if (dst) {
> -       BSG_HANDLE* d2 = (BSG_HANDLE*) d;
> -       BSG_HANDLE* p2 = (BSG_HANDLE*) pdata;
> -       BSG_UINT32 i;
> -       for (i = 0; i < psize; i++)
> -         d2[i] = BSG_UnpackConst((BSG_BYTE*)(p2 + i), 4);
> -
> -      }
> -      d += psize * sizeof(BSG_HANDLE);
> -    } else {// If it's not psize handles, it's psize data.
> -      if (psize > 0) {
> -       if (dst) {
> -         bsglog ("BSG: __FMT_SIZE, size=%d, src=%p, dst=%p\n",
> -                 psize, pdata, d);
> -         memcpy(d, pdata, psize);
> -       }
> -      }
> -      d += psize;
> -    }
> -  } else if (format == __FMT_PACKED) {
> -    // the source buffer is a pack_constbuf_t, which has a size and a
> -    // pointer. just copy the buffer value, the size is not included in the
> -    // output stream.
> -    pack_constbuf_t * buf = (pack_constbuf_t*) s;
> -
> -    if (dst) {
> -      bsglog ("BSG: __FMT_PACKED, size=%d, src=%p, dst=%p\n",
> -             buf->size, buf->data, d);
> -      memcpy(d, buf->data, buf->size);
> -    }
> -
> -    s += buf->size;
> -    d += buf->size;
> -  } else if (format == 0) {// No flags are set. This is a structure & it should
> -                          // be looked up in the bsg_s_fmt[]
> -
> -    const BSG_Format* x = find_format (type);
> -    if (x == NULL) {
> -      vtpmloginfo(VTPM_LOG_BSG, "BSG_Pack: cannot find type %d\n", type);
> -      return -1;
> -    }
> -
> -    if (dst)
> -      bsglog ("BSG_Pack type %s\n", x->name);
> -
> -
> -    // iterate through the fields
> -    const BSG_UINT32* f = x->fields;
> -    for (; *f; f++) {
> -      int fsize;
> -
> -      g_log_recursion_level++;
> -      fsize = BSG_Pack_private((BSG_Type) *f, &s, dst ? d : NULL);
> -      g_log_recursion_level--;
> -
> -      if (fsize <= 0)
> -       return fsize;
> -
> -      d += fsize;
> -    }
> -  } else {
> -    vtpmlogerror(VTPM_LOG_BSG, "BSG_Pack(): Unknown format %d\n", format);
> -    return -1;
> -  }
> -
> -  *src = s;
> -  return (d - dst);
> -}
> -
> -/**
> - * Unflatten a TCPA structure from a buffer in big-endian format
> - * @type: TCPA structure type
> - * @src: flattened data
> - * @dst: (IN) TCPA structure (OUT) end of TCPA structure
> - * Returns: Flattened size
> - * Note: Returns flattened size NOT the unpacked structure size
> - */
> -static int BSG_Unpack_private(BSG_Type type, const BSG_BYTE* src, BSG_BYTE** dst) {
> -  // check incoming parameters
> -  if (src == NULL)
> -    return 0;
> -
> -
> -  const BSG_BYTE* s = src;
> -  BSG_BYTE* d = dst ? *dst:NULL;
> -  if (dst && !d)
> -    dst = NULL;
> -
> -  BSG_UINT32 size = __FMT_MASK_SIZE(type);
> -  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
> -
> -  if (format == __FMT_CONST) {// We are dealing with a fixed length value ie. UINT32
> -
> -    BSG_UINT32 val = BSG_UnpackConst(s, size);
> -
> -    if (dst) {
> -      switch (size) {
> -      case 1: *(BYTE *) d = (BSG_BYTE) val; break;
> -      case 2: *(unsigned short*) d = (unsigned short) val; break;
> -      case 4: *(BSG_UINT32*) d = (BSG_UINT32) val; break;
> -      }
> -    }
> -
> -    s += size;
> -    d += size;
> -  } else if (format == __FMT_DATA) {// We are dealing with raw data. Not sure when this is used.
> -    if (dst)
> -      memcpy(d, s, size);
> -
> -    d += size;
> -    s += size;
> -  } else if (format == __FMT_SIZE || format == __FMT_HSIZE) {// It's a size, followed by that much data or handles
> -
> -    BSG_UINT32 psize = BSG_UnpackConst(s, size);
> -
> -    if (psize > BSG_MAX_BUF_SIZE) {
> -      vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack runs into var-sized data bigger than %u bytes!!\n",
> -              BSG_MAX_BUF_SIZE);
> -      return -1;
> -    }
> -
> -    if (dst) {
> -      switch (size) {
> -      case 1: *(BYTE *) d = (BSG_BYTE) psize; break;
> -      case 2: *(unsigned short*) d = (unsigned short) psize; break;
> -      case 4: *(BSG_UINT32*) d = (BSG_UINT32) psize; break;
> -      }
> -    }
> -
> -    s += size;
> -    d += size;
> -
> -    BSG_BYTE* pdata = NULL;
> -
> -    if (psize) {
> -      if (format == __FMT_HSIZE) { // This is a list of psize Handles
> -       if (dst) {
> -         BSG_HANDLE* s2 = (BSG_HANDLE*) s;
> -         pdata = (BSG_BYTE *)malloc(psize * sizeof(BSG_HANDLE));
> -          if (!pdata)
> -            return -1;
> -
> -         BSG_HANDLE* p2 = (BSG_HANDLE*) pdata;
> -         BSG_UINT32 i;
> -         for (i = 0; i < psize; i++) {
> -           BSG_PackConst(s2[i], 4, (BSG_BYTE*)(p2 + i));
> -         }
> -       }
> -       s += psize * sizeof(BSG_HANDLE);
> -      } else { // If it's not psize handles, it's psize data.
> -       if (dst) {
> -         pdata = (BSG_BYTE *)malloc(sizeof(BSG_BYTE) * psize);
> -          if (!pdata)
> -            return -1;
> -         memcpy(pdata, s, psize);
> -       }
> -       s += psize;
> -      }
> -    }
> -    if (dst)
> -      *(void**) d = pdata;
> -
> -    d += sizeof(void*);
> -  } else if (format == __FMT_PACKED) {
> -
> -    // this doesn't make sense for unpacking!
> -    vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack() called with format __FMT_PACKED. "
> -                                                          "This does not make sense\n");
> -
> -    return -1;
> -  } else if (format == 0) {// No flags are set. This is a structure & it should
> -                          // be looked up in the bsg_s_fmt[]
> -
> -    const BSG_Format* x = find_format (type);
> -    if (x == NULL) {
> -      vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack: cannot find type %d\n", type);
> -      return -1;
> -    }
> -
> -    const BSG_UINT32* f = x->fields;
> -    for (; *f; f++) {
> -      int fsize = BSG_Unpack_private((BSG_Type) *f, s, dst ? &d:NULL);
> -      if (fsize <= 0)
> -       return fsize;
> -      s += fsize;
> -    }
> -  }
> -
> -  if (dst)
> -    *dst = d;
> -  return (s - src);
> -}
> -
> -/**
> - * Free memory associated with unpacked TCPA structure
> - * @type: TCPA structure type
> - * @src: (IN) TCPA structure (OUT) end of TCPA structure
> - * Note: Destroy should be called on all structures created with Unpack
> - *       to ensure that any allocated memory is freed
> - */
> -static void BSG_Destroy_private(BSG_Type type, BSG_BYTE** src) {
> -  BSG_BYTE* s = *src;
> -
> -  BSG_UINT32 size = __FMT_MASK_SIZE(type);
> -  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
> -
> -  if ((src == NULL) || (*src == NULL)) {
> -        vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy() called with NULL src\n");
> -    return;
> -  }
> -
> -  if (format == __FMT_CONST || format == __FMT_DATA)
> -    s += size;
> -  else if (format == __FMT_SIZE || format == __FMT_HSIZE) {
> -    s += size;
> -    BSG_BYTE* ptr = *(BSG_BYTE**) s;
> -    free(ptr);
> -    s += sizeof(void*);
> -  } else if (format == __FMT_PACKED) {
> -
> -    // this doesn't make sense for unpacking, hence also for Destroy()
> -    vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy() called with format __FMT_PACKED. "
> -                                                          "This does not make sense\n");
> -
> -    return;
> -  } else if (format == 0) {
> -    const BSG_Format* x = find_format (type);
> -    if (x == NULL) {
> -      vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy: cannot find type %d\n", type);
> -      return;
> -    }
> -
> -    const BSG_UINT32* f = x->fields;
> -    for (; *f; f++)
> -      BSG_Destroy_private((BSG_Type) *f, &s);
> -  }
> -
> -  *src = s;
> -}
> -
> -int BSG_Pack(BSG_Type type, const void* src, BSG_BYTE* dst)
> -{
> -  const BSG_BYTE* src2 = (const BSG_BYTE*) src;
> -  return BSG_Pack_private(type, &src2, dst);
> -}
> -
> -int BSG_Unpack(BSG_Type type, const BSG_BYTE* src, void* dst)
> -{
> -  BSG_BYTE* dst2 = (BSG_BYTE*) dst;
> -  return BSG_Unpack_private(type, src, dst ? &dst2:NULL);
> -}
> -
> -void BSG_Destroy(BSG_Type type, void* src)
> -{
> -  BSG_BYTE* src2 = (BSG_BYTE*) src;
> -  BSG_Destroy_private(type, &src2);
> -}
> -
> -/**
> - * Pack a 8/16/32-bit constant into a buffer in big-endian format
> - * @val: constant value
> - * @size: constant size in bytes (1, 2, or 4)
> - * @dst: (OUT) buffer
> - */
> -void BSG_PackConst(BSG_UINT32 val, int size, BSG_BYTE* dst) {
> -  bsglog ("BSG: PackConst on %d of size %i into address %p\n", val, size, dst);
> -
> -  switch (size) {
> -  case 4:
> -    dst[0] = (BSG_BYTE)((val >> 24) & 0xff);
> -    dst[1] = (BSG_BYTE)((val >> 16) & 0xff);
> -    dst[2] = (BSG_BYTE)((val >> 8) & 0xff);
> -    dst[3] = (BSG_BYTE)(val & 0xff);
> -    break;
> -  case 2:
> -    dst[0] = (BSG_BYTE)((val >> 8) & 0xff);
> -    dst[1] = (BSG_BYTE)(val & 0xff);
> -    break;
> -  case 1:
> -    dst[0] = (BSG_BYTE)(val & 0xff);
> -    break;
> -  }
> -}
> -
> -/**
> - * Unpack a 8/16/32-bit constant from a buffer in big-endian format
> - * @src: buffer
> - * @size: constant size in bytes (1, 2, or 4)
> - */
> -BSG_UINT32 BSG_UnpackConst(const BSG_BYTE* src, int size) {
> -  BSG_UINT32 val = 0;
> -
> -  if (src == NULL)
> -    return 0;
> -
> -  switch (size) {
> -  case 4:
> -    val = (((BSG_UINT32) src[0]) << 24
> -          | ((BSG_UINT32) src[1]) << 16
> -          | ((BSG_UINT32) src[2]) << 8
> -          | (BSG_UINT32) src[3]);
> -    break;
> -  case 2:
> -    val = (((BSG_UINT32) src[0]) << 8 | (BSG_UINT32) src[1]);
> -    break;
> -  case 1:
> -    val = (BSG_UINT32) src[0];
> -    break;
> -  }
> -  return val;
> -}
> -
> -// Pack a list of parameters. Beware not to send values, but rather you must
> -// send a pointer to your values Instead. This includes UINT32's.
> -int BSG_PackList( BSG_BYTE* dst, int ParamCount, ... ) {
> -  int ParamNumber;
> -  BSG_Type format;
> -  BSG_BYTE* val = NULL;
> -  int size=0;
> -
> -  va_list paramList;
> -  va_start( paramList, ParamCount );
> -
> -  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
> -    //Strangeness with int is because gcc wanted an int rather than a enum of ints.
> -    format =  (BSG_Type) va_arg( paramList, int );
> -    val = va_arg( paramList, BSG_BYTE* );
> -    size += BSG_Pack(format, val, dst == NULL ? NULL : dst + size);
> -  }
> -
> -  va_end (paramList);
> -
> -  return size;
> -}
> -
> -// Unpack a list of parameters.
> -int BSG_UnpackList( const BSG_BYTE* src, int ParamCount, ... ) {
> -  int ParamNumber = 0;
> -  BSG_Type format;
> -  BSG_BYTE* val = NULL;
> -  int size = 0;
> -
> -  va_list paramList;
> -  va_start( paramList, ParamCount );
> -
> -  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
> -    format = (BSG_Type) va_arg( paramList, int );
> -    val  = va_arg( paramList, BSG_BYTE* );
> -
> -    size += BSG_Unpack(format, src + size, val);
> -  }
> -
> -  va_end( paramList );
> -
> -  return size;
> -}
> -
> -// Destroy any memory allocated by calls to unpack
> -void BSG_DestroyList(int ParamCount, ... ) {
> -  int ParamNumber = 0;
> -  BSG_Type argType;
> -  BSG_BYTE* paramValue = NULL;
> -
> -  va_list paramList;
> -  va_start( paramList, ParamCount );
> -
> -  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
> -    argType = (BSG_Type) va_arg( paramList, int );
> -    paramValue  = va_arg( paramList, BSG_BYTE* );
> -
> -    BSG_Destroy(argType, paramValue);
> -  }
> -
> -  va_end( paramList );
> -
> -  return;
> -}
> -
> -
> -// and a tuple version
> -TPM_RESULT BSG_DestroyTuple (int numParams, pack_tuple_t params[]) {
> -  int i;
> -
> -  for (i = 0; i < numParams; i++)
> -    BSG_Destroy (params[i].type, params[i].addr);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -//
> -// wrappers of Pack and PackList which malloc the ouput buffer. to be freed
> -// by the caller later
> -//
> -
> -int BSG_PackMalloc (BSG_Type type, const void* src, BSG_BYTE** o_dst) {
> -  int size = BSG_Pack (type, src, NULL);
> -  BSG_BYTE * dest = (BSG_BYTE*) malloc (size);
> -  if (dest == NULL)
> -    return -1;
> -
> -  size = BSG_Pack(type, src, dest);
> -  *o_dst = dest;
> -  return size;
> -}
> -
> -
> -
> -int BSG_PackListMalloc(BSG_BYTE** outBuffer, int ParamCount, ... ) {
> -  va_list args;
> -  int size;
> -
> -  va_start (args, ParamCount);
> -  size = BSG_PackList (NULL, ParamCount, args);
> -  va_end (args);
> -
> -  BSG_BYTE * dest = (BSG_BYTE*) malloc (size);
> -  if (dest == NULL)
> -    return -1;
> -
> -  va_start (args, ParamCount);
> -  size = BSG_PackList (dest, ParamCount, args);
> -  va_end (args);
> -
> -  *outBuffer = dest;
> -  return size;
> -}
> diff --git a/tools/vtpm_manager/util/bsg.h b/tools/vtpm_manager/util/bsg.h
> deleted file mode 100644
> index 0896812..0000000
> --- a/tools/vtpm_manager/util/bsg.h
> +++ /dev/null
> @@ -1,166 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// bsg.h
> -//
> -//  This file contains API's for the TPM Byte Stream functions
> -//
> -// ==================================================================
> -
> -#ifndef __BSG_H__
> -#define __BSG_H__
> -
> -#include <stdarg.h>
> -#include "buffer.h"
> -
> -typedef unsigned int BSG_UINT32;
> -typedef unsigned char BSG_BYTE;
> -
> -// forward decl
> -struct pack_const_tuple_t;
> -
> -struct pack_tuple_t;
> -
> -
> -/**
> - * Byte stream generator
> - */
> -// this has to be manually kept in sync with the
> -// s_fmt array!!
> -// but now we have a self-check function which can make sure things are well
> -// (if used!)
> -typedef enum BSG_Type
> -{
> -  BSG_TYPE_FIRST = 1,
> -  BSG_TYPE_UINT32 = 1, // start at 1 so that Type 0 only serves as an
> -                       // unused/special value
> -  BSG_TYPE_UINT16,
> -  BSG_TYPE_BYTE,
> -  BSG_TYPE_BOOL,
> -  BSG_TPM_SIZE32_DATA,  // a 32 bit unsigned size, followed by
> -                        // a pointer to that much data. can pass a
> -                        // struct pack_buf_t as the param
> -  BSG_TPM_TAG,
> -  BSG_TPM_HANDLE,
> -  BSG_TPM_RESULT,
> -  BSG_TPM_RESOURCE_TYPE,
> -  BSG_TPM_COMMAND_CODE,
> -  BSG_TPM_AUTH_DATA_USAGE,
> -  BSG_TPM_ALGORITHM_ID,
> -  BSG_TPM_PROTOCOL_ID,
> -  BSG_TPM_KEY_USAGE,
> -  BSG_TPM_ENC_SCHEME,
> -  BSG_TPM_SIG_SCHEME,
> -  BSG_TPM_MIGRATE_SCHEME,
> -  BSG_TPM_KEY_FLAGS,
> -  BSG_TPM_AUTHDATA,
> -  BSG_TPM_SECRET,
> -  BSG_TPM_ENCAUTH,
> -  BSG_TPM_PAYLOAD_TYPE,
> -
> -  BSG_TPM_VERSION,
> -  BSG_TPM_DIGEST,
> -  BSG_TPM_COMPOSITE_HASH,
> -  BSG_TPM_CHOSENID_HASH,
> -  BSG_TPM_NONCE,
> -  BSG_TPM_KEY_HANDLE,
> -  BSG_TPM_KEY_HANDLE_LIST,
> -  BSG_TPM_KEY_PARMS,
> -  BSG_TPM_RSA_KEY_PARMS,
> -  BSG_TPM_STORE_PUBKEY,
> -  BSG_TPM_PUBKEY,
> -  BSG_TPM_KEY,
> -
> -  BSG_TPM_MIGRATIONKEYAUTH,
> -  BSG_TCPA_AUDIT_EVENT,
> -  BSG_TCPA_EVENT_CERT,
> -  BSG_TPM_PCR_SELECTION,
> -  BSG_TPM_PCR_COMPOSITE,
> -  BSG_TPM_PCR_INFO,
> -  BSG_TPM_STORED_DATA,
> -  BSG_TPM_SYMMETRIC_KEY,
> -  BSG_TPM_STORE_PRIVKEY,
> -  BSG_TPM_STORE_ASYMKEY,
> -  BSG_TPM_MIGRATE_ASYMKEY,
> -  BSG_TPM_QUOTE_INFO,
> -  BSG_TPM_IDENTITY_CONTENTS,
> -  BSG_TPM_PCRVALUE,
> -  BSG_TCPA_PCR_FLAGS,
> -  BSG_TCS_AUTH,
> -
> -  // this is the BSG_TPM_KEY struct without the encData field
> -  BSG_TPM_KEY_NONSENSITIVE,
> -
> -  BSG_PACKED,
> -
> -  BSG_TYPE_MAX
> -} BSG_Type;
> -
> -struct pack_const_tuple_t {
> -  BSG_Type type;
> -  const void * addr;
> -};
> -
> -
> -typedef struct pack_tuple_t {
> -  BSG_Type type;
> -  void * addr;
> -} pack_tuple_t;
> -
> -int BSG_Pack(BSG_Type type, const void* src, BSG_BYTE* dst);
> -int BSG_Unpack(BSG_Type type, const BSG_BYTE* src, void* dst);
> -void BSG_Destroy(BSG_Type type, void* src);
> -
> -// wrappers of Pack and PackList which malloc the ouput buffer. to be freed
> -// by the caller later. returns size of allocated buffer, or -1 in case
> -// allocation failed
> -int BSG_PackMalloc (BSG_Type type, const void* src, BSG_BYTE** o_dst);
> -int BSG_PackListMalloc (BSG_BYTE** outBuffer, int ParamCount, ... );
> -
> -// a va_list version of PackList
> -int BSG_PackList(BSG_BYTE* outBuffer, int ParamCount, ... );
> -int BSG_UnpackList(const BSG_BYTE* inBuffer, int ParamCount, ... );
> -void BSG_DestroyList(int ParamCount, ... );
> -
> -// wrapper of PackList which uses a buffer_t
> -TPM_RESULT BSG_PackListBuf (buffer_t * o_buf, int ParamCount, ...);
> -
> -// and a tuple version
> -TPM_RESULT BSG_DestroyTuple (int numParams, pack_tuple_t params[]);
> -
> -void BSG_PackConst(BSG_UINT32 val, int size, BSG_BYTE* dst);
> -BSG_UINT32 BSG_UnpackConst(const BSG_BYTE* src, int size);
> -
> -BOOL BSG_static_selfcheck ();
> -
> -#endif
> diff --git a/tools/vtpm_manager/util/buffer.c b/tools/vtpm_manager/util/buffer.c
> deleted file mode 100644
> index df48bc2..0000000
> --- a/tools/vtpm_manager/util/buffer.c
> +++ /dev/null
> @@ -1,226 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -
> -#include <stdarg.h>
> -#include <string.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <sys/param.h>
> -
> -#include "tcg.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -
> -static TPM_RESULT buffer_priv_realloc (buffer_t * buf, tpm_size_t newsize);
> -
> -//
> -// buffer functions!
> -//
> -
> -TPM_RESULT buffer_init (buffer_t * buf, tpm_size_t initsize, const BYTE* initval) {
> -  if (initsize == 0) {
> -    memset(buf, 0, sizeof(*buf));
> -    return TPM_SUCCESS;
> -  }
> -
> -
> -  buf->bytes = (BYTE*) malloc (initsize);
> -  if (buf->bytes == NULL)
> -    return TPM_RESOURCES;
> -
> -  buf->size = initsize;
> -  buf->alloc_size = initsize;
> -
> -  if (initval)
> -    memcpy (buf->bytes, initval, initsize);
> -
> -  buf->is_owner = TRUE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -TPM_RESULT buffer_init_convert (buffer_t * buf, tpm_size_t initsize, BYTE* initval) {
> -
> -  buf->size = initsize;
> -  buf->alloc_size = initsize;
> -  buf->bytes = initval;
> -
> -  buf->is_owner = TRUE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -TPM_RESULT buffer_init_copy (buffer_t * buf, const buffer_t * src) {
> -  TPM_RESULT status = buffer_init (buf, src->size, src->bytes);
> -  buf->is_owner = TRUE;
> -
> -  return status;
> -}
> -
> -
> -
> -// make an alias to a constant array
> -TPM_RESULT buffer_init_const (buffer_t * buf, tpm_size_t size, const BYTE* val) {
> -  // TODO: try to enforce the const things somehow!
> -  buf->bytes = (BYTE*) val;
> -  buf->size = size;
> -  buf->alloc_size = 0;        // this field is now unneeded
> -
> -  buf->is_owner = FALSE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -// make an alias into buf, with given offset and length
> -// if len = 0, make the alias go to the end of buf
> -TPM_RESULT buffer_init_alias (buffer_t * buf, const buffer_t * b,
> -                              tpm_size_t offset, tpm_size_t len) {
> -  if (offset + len > b->size) {
> -    return TPM_NOSPACE;
> -  }
> -
> -  buf->bytes = b->bytes + offset;
> -  buf->size = len > 0 ? len : b->size - offset;
> -
> -  //VS/ buf->alloc_size = 0;
> -  if (len ==0)
> -    buf->alloc_size = b->alloc_size - offset;
> -  else
> -    buf->alloc_size = MIN(b->alloc_size - offset, len);
> -
> -
> -  buf->is_owner = FALSE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -// make an alias buffer_t into bytestream, with given length
> -TPM_RESULT buffer_init_alias_convert (buffer_t * buf, tpm_size_t size, BYTE* val) {
> -
> -  buf->size = size;
> -  buf->alloc_size = size;
> -  buf->bytes = val;
> -
> -  buf->is_owner = FALSE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -
> -// copy into the start of dest
> -TPM_RESULT buffer_copy (buffer_t * dest, const buffer_t* src)
> -{
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  if (dest->alloc_size < src->size) {
> -    TPMTRYRETURN( buffer_priv_realloc (dest, src->size) );
> -  }
> -
> -  memcpy (dest->bytes, src->bytes, src->size);
> -  dest->size = src->size;
> -
> -  //VS/ dest->is_owner = TRUE;
> -
> - abort_egress:
> -
> -  return status;
> -}
> -
> -
> -
> -BOOL buffer_eq (const buffer_t * a, const buffer_t * b) {
> -  return (a->size == b->size && memcmp (a->bytes, b->bytes, a->size) == 0);
> -}
> -
> -
> -void buffer_memset (buffer_t * buf, BYTE b) {
> -  memset (buf->bytes, b, buf->size);
> -}
> -
> -
> -TPM_RESULT buffer_append_raw (buffer_t * buf, tpm_size_t len, const BYTE* bytes) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  if (buf->alloc_size < buf->size + len) {
> -    TPMTRYRETURN( buffer_priv_realloc (buf, buf->size + len) );
> -  }
> -
> -  memcpy (buf->bytes + buf->size, bytes, len);
> -
> -  buf->size += len;
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -tpm_size_t buffer_len (const buffer_t* buf) {
> -  return buf->size;
> -}
> -
> -TPM_RESULT buffer_free (buffer_t * buf) {
> -  if (buf && buf->is_owner && buf->bytes != NULL) {
> -    free (buf->bytes);
> -    buf->bytes = NULL;
> -    buf->size = buf->alloc_size = 0;
> -
> -  }
> -
> -  return TPM_SUCCESS;
> -}
> -
> -TPM_RESULT buffer_priv_realloc (buffer_t * buf, tpm_size_t newsize) {
> -
> -  // we want to realloc to twice the size, or the new size, whichever
> -  // bigger
> -
> -  BYTE * tmpbuf = NULL;
> -
> -  newsize = MAX (buf->alloc_size * 2, newsize);
> -
> -  tmpbuf = (BYTE*) realloc (buf->bytes, newsize);
> -  if (tmpbuf == NULL)
> -    return TPM_SIZE;
> -
> -
> -  buf->bytes = tmpbuf;
> -  buf->alloc_size = newsize;
> -
> -  return TPM_SUCCESS;
> -}
> diff --git a/tools/vtpm_manager/util/buffer.h b/tools/vtpm_manager/util/buffer.h
> deleted file mode 100644
> index d8a9abc..0000000
> --- a/tools/vtpm_manager/util/buffer.h
> +++ /dev/null
> @@ -1,95 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#ifndef __VTPM_BUFFER_H__
> -#define __VTPM_BUFFER_H__
> -
> -#include <stddef.h>             // for pointer NULL
> -#include "tcg.h"
> -
> -typedef UINT32 tpm_size_t;
> -
> -// first version, probably will be expanded...
> -
> -#define NULL_BUF {0,0,0,0}
> -
> -typedef struct {
> -  // private!!
> -  tpm_size_t size, alloc_size;
> -  BYTE * bytes;
> -
> -  BOOL is_owner;              // do we own this buffer, and need to free it?
> -} buffer_t;
> -
> -// allocate the buffer if initsize > 0, copying over initval if provided
> -TPM_RESULT buffer_init (buffer_t * buf,
> -                        tpm_size_t initsize,
> -                        const BYTE* initval);
> -
> -// Create a new buffer from a BYTE *. Use buffer_free to destroy original BYTE *
> -TPM_RESULT buffer_init_convert (buffer_t * buf,
> -                                tpm_size_t initsize,
> -                                BYTE* initval);
> -
> -// make an alias to a constant array, no copying
> -TPM_RESULT buffer_init_const (buffer_t * buf, tpm_size_t size, const BYTE* val);
> -
> -// make an alias into buf, with given offset and length
> -// if len = 0, make the alias go to the end of buf
> -TPM_RESULT buffer_init_alias (buffer_t * buf, const buffer_t * b,
> -                              tpm_size_t offset, tpm_size_t);
> -
> -// make an alias buffer into a bytestream
> -TPM_RESULT buffer_init_alias_convert (buffer_t * buf,
> -                                      tpm_size_t size, BYTE* val);
> -
> -// "copy constructor"
> -TPM_RESULT buffer_init_copy (buffer_t * buf, const buffer_t * src);
> -
> -
> -// copy into the start of a
> -TPM_RESULT buffer_copy (buffer_t * dest, const buffer_t* src);
> -
> -// are they equal?
> -BOOL buffer_eq (const buffer_t * a, const buffer_t * b);
> -
> -// set the buffer to a constant byte
> -void buffer_memset (buffer_t * buf, BYTE b);
> -
> -tpm_size_t buffer_len (const buffer_t* buf);
> -
> -TPM_RESULT buffer_free (buffer_t * buf);
> -
> -TPM_RESULT buffer_append_raw (buffer_t * buf, tpm_size_t len, const BYTE* bytes);
> -
> -#endif // _TOOLS_H_
> diff --git a/tools/vtpm_manager/util/hashtable.c b/tools/vtpm_manager/util/hashtable.c
> deleted file mode 100644
> index aff0e2b..0000000
> --- a/tools/vtpm_manager/util/hashtable.c
> +++ /dev/null
> @@ -1,316 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/xenstore/hashtable.c
> - *  - tools/blktap2/drivers/hashtable.c
> - */
> -
> -#include "hashtable.h"
> -#include "hashtable_private.h"
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> -#include <math.h>
> -
> -/*
> -Credit for primes table: Aaron Krowne
> - http://br.endernet.org/~akrowne/
> - http://planetmath.org/encyclopedia/GoodHashTablePrimes.html
> -*/
> -static const unsigned int primes[] = {
> -53, 97, 193, 389,
> -769, 1543, 3079, 6151,
> -12289, 24593, 49157, 98317,
> -196613, 393241, 786433, 1572869,
> -3145739, 6291469, 12582917, 25165843,
> -50331653, 100663319, 201326611, 402653189,
> -805306457, 1610612741
> -};
> -const unsigned int prime_table_length = sizeof(primes)/sizeof(primes[0]);
> -const float max_load_factor = 0.65;
> -
> -/*****************************************************************************/
> -struct hashtable *
> -create_hashtable(unsigned int minsize,
> -                 unsigned int (*hashf) (void*),
> -                 int (*eqf) (void*,void*))
> -{
> -    struct hashtable *h;
> -    unsigned int pindex, size = primes[0];
> -    /* Check requested hashtable isn't too large */
> -    if (minsize > (1u << 30)) return NULL;
> -    /* Enforce size as prime */
> -    for (pindex=0; pindex < prime_table_length; pindex++) {
> -        if (primes[pindex] > minsize) { size = primes[pindex]; break; }
> -    }
> -    h = (struct hashtable *)malloc(sizeof(struct hashtable));
> -    if (NULL == h) return NULL; /*oom*/
> -    h->table = (struct entry **)malloc(sizeof(struct entry*) * size);
> -    if (NULL == h->table) { free(h); return NULL; } /*oom*/
> -    memset(h->table, 0, size * sizeof(struct entry *));
> -    h->tablelength  = size;
> -    h->primeindex   = pindex;
> -    h->entrycount   = 0;
> -    h->hashfn       = hashf;
> -    h->eqfn         = eqf;
> -    h->loadlimit    = (unsigned int) ceil(size * max_load_factor);
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_init(&h->mutex, NULL);
> -#endif
> -    return h;
> -}
> -
> -/*****************************************************************************/
> -unsigned int
> -hash(struct hashtable *h, void *k)
> -{
> -    unsigned int i = h->hashfn(k);
> -    i += ~(i << 9);
> -    i ^=  ((i >> 14) | (i << 18)); /* >>> */
> -    i +=  (i << 4);
> -    i ^=  ((i >> 10) | (i << 22)); /* >>> */
> -    return i;
> -}
> -
> -/*****************************************************************************/
> -static int
> -hashtable_expand(struct hashtable *h)
> -{
> -    /* Double the size of the table to accomodate more entries */
> -    struct entry **newtable;
> -    struct entry *e;
> -    struct entry **pE;
> -    unsigned int newsize, i, index;
> -    /* Check we're not hitting max capacity */
> -    if (h->primeindex == (prime_table_length - 1)) return 0;
> -    newsize = primes[++(h->primeindex)];
> -
> -    newtable = (struct entry **)malloc(sizeof(struct entry*) * newsize);
> -    if (NULL != newtable)
> -    {
> -        memset(newtable, 0, newsize * sizeof(struct entry *));
> -        /* This algorithm is not 'stable'. ie. it reverses the list
> -         * when it transfers entries between the tables */
> -        for (i = 0; i < h->tablelength; i++) {
> -            while (NULL != (e = h->table[i])) {
> -                h->table[i] = e->next;
> -                index = indexFor(newsize,e->h);
> -                e->next = newtable[index];
> -                newtable[index] = e;
> -            }
> -        }
> -        free(h->table);
> -        h->table = newtable;
> -    }
> -    /* Plan B: realloc instead */
> -    else
> -    {
> -        newtable = (struct entry **)
> -                   realloc(h->table, newsize * sizeof(struct entry *));
> -        if (NULL == newtable) { (h->primeindex)--; return 0; }
> -        h->table = newtable;
> -        memset(newtable[h->tablelength], 0, newsize - h->tablelength);
> -        for (i = 0; i < h->tablelength; i++) {
> -            for (pE = &(newtable[i]), e = *pE; e != NULL; e = *pE) {
> -                index = indexFor(newsize,e->h);
> -                if (index == i)
> -                {
> -                    pE = &(e->next);
> -                }
> -                else
> -                {
> -                    *pE = e->next;
> -                    e->next = newtable[index];
> -                    newtable[index] = e;
> -                }
> -            }
> -        }
> -    }
> -    h->tablelength = newsize;
> -    h->loadlimit   = (unsigned int) ceil(newsize * max_load_factor);
> -    return -1;
> -}
> -
> -/*****************************************************************************/
> -unsigned int
> -hashtable_count(struct hashtable *h)
> -{
> -    unsigned int count;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    count = h->entrycount;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return count;
> -}
> -
> -/*****************************************************************************/
> -int
> -hashtable_insert(struct hashtable *h, void *k, void *v)
> -{
> -    /* This method allows duplicate keys - but they shouldn't be used */
> -    unsigned int index;
> -    struct entry *e;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    if (++(h->entrycount) > h->loadlimit)
> -    {
> -        /* Ignore the return value. If expand fails, we should
> -         * still try cramming just this value into the existing table
> -         * -- we may not have memory for a larger table, but one more
> -         * element may be ok. Next time we insert, we'll try expanding again.*/
> -        hashtable_expand(h);
> -    }
> -    e = (struct entry *)malloc(sizeof(struct entry));
> -    if (NULL == e) { --(h->entrycount); return 0; } /*oom*/
> -    e->h = hash(h,k);
> -    index = indexFor(h->tablelength,e->h);
> -    e->k = k;
> -    e->v = v;
> -    e->next = h->table[index];
> -    h->table[index] = e;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return -1;
> -}
> -
> -/*****************************************************************************/
> -void * /* returns value associated with key */
> -hashtable_search(struct hashtable *h, void *k)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    struct entry *e;
> -    unsigned int hashvalue, index;
> -    hashvalue = hash(h,k);
> -    index = indexFor(h->tablelength,hashvalue);
> -    e = h->table[index];
> -    while (NULL != e)
> -    {
> -        /* Check hash value to short circuit heavier comparison */
> -        if ((hashvalue == e->h) && (h->eqfn(k, e->k))) {
> -#ifdef HASHTABLE_THREADED
> -          pthread_mutex_unlock(&h->mutex);
> -#endif
> -          return e->v;
> -        }
> -        e = e->next;
> -    }
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return NULL;
> -}
> -
> -/*****************************************************************************/
> -void * /* returns value associated with key */
> -hashtable_remove(struct hashtable *h, void *k)
> -{
> -    /* TODO: consider compacting the table when the load factor drops enough,
> -     *       or provide a 'compact' method. */
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    struct entry *e;
> -    struct entry **pE;
> -    void *v;
> -    unsigned int hashvalue, index;
> -
> -    hashvalue = hash(h,k);
> -    index = indexFor(h->tablelength,hash(h,k));
> -    pE = &(h->table[index]);
> -    e = *pE;
> -    while (NULL != e)
> -    {
> -        /* Check hash value to short circuit heavier comparison */
> -        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
> -        {
> -            *pE = e->next;
> -            h->entrycount--;
> -            v = e->v;
> -            freekey(e->k);
> -            free(e);
> -            return v;
> -        }
> -        pE = &(e->next);
> -        e = e->next;
> -    }
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return NULL;
> -}
> -
> -/*****************************************************************************/
> -/* destroy */
> -void
> -hashtable_destroy(struct hashtable *h, int free_values)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    unsigned int i;
> -    struct entry *e, *f;
> -    struct entry **table = h->table;
> -    if (free_values)
> -    {
> -        for (i = 0; i < h->tablelength; i++)
> -        {
> -            e = table[i];
> -            while (NULL != e)
> -            { f = e; e = e->next; freekey(f->k); free(f->v); free(f); }
> -        }
> -    }
> -    else
> -    {
> -        for (i = 0; i < h->tablelength; i++)
> -        {
> -            e = table[i];
> -            while (NULL != e)
> -            { f = e; e = e->next; freekey(f->k); free(f); }
> -        }
> -    }
> -    free(h->table);
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_destroy(&h->mutex);
> -#endif
> -    free(h);
> -}
> diff --git a/tools/vtpm_manager/util/hashtable.h b/tools/vtpm_manager/util/hashtable.h
> deleted file mode 100644
> index dedc60a..0000000
> --- a/tools/vtpm_manager/util/hashtable.h
> +++ /dev/null
> @@ -1,204 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/xenstore/hashtable.h
> - *  - tools/blktap2/drivers/hashtable.h
> - */
> -
> -#ifndef __HASHTABLE_CWC22_H__
> -#define __HASHTABLE_CWC22_H__
> -
> -struct hashtable;
> -
> -/* Example of use:
> - *
> - *      struct hashtable  *h;
> - *      struct some_key   *k;
> - *      struct some_value *v;
> - *
> - *      static unsigned int         hash_from_key_fn( void *k );
> - *      static int                  keys_equal_fn ( void *key1, void *key2 );
> - *
> - *      h = create_hashtable(16, hash_from_key_fn, keys_equal_fn);
> - *      k = (struct some_key *)     malloc(sizeof(struct some_key));
> - *      v = (struct some_value *)   malloc(sizeof(struct some_value));
> - *
> - *      (initialise k and v to suitable values)
> - *
> - *      if (! hashtable_insert(h,k,v) )
> - *      {     exit(-1);               }
> - *
> - *      if (NULL == (found = hashtable_search(h,k) ))
> - *      {    printf("not found!");                  }
> - *
> - *      if (NULL == (found = hashtable_remove(h,k) ))
> - *      {    printf("Not found\n");                 }
> - *
> - */
> -
> -/* Macros may be used to define type-safe(r) hashtable access functions, with
> - * methods specialized to take known key and value types as parameters.
> - *
> - * Example:
> - *
> - * Insert this at the start of your file:
> - *
> - * DEFINE_HASHTABLE_INSERT(insert_some, struct some_key, struct some_value);
> - * DEFINE_HASHTABLE_SEARCH(search_some, struct some_key, struct some_value);
> - * DEFINE_HASHTABLE_REMOVE(remove_some, struct some_key, struct some_value);
> - *
> - * This defines the functions 'insert_some', 'search_some' and 'remove_some'.
> - * These operate just like hashtable_insert etc., with the same parameters,
> - * but their function signatures have 'struct some_key *' rather than
> - * 'void *', and hence can generate compile time errors if your program is
> - * supplying incorrect data as a key (and similarly for value).
> - *
> - * Note that the hash and key equality functions passed to create_hashtable
> - * still take 'void *' parameters instead of 'some key *'. This shouldn't be
> - * a difficult issue as they're only defined and passed once, and the other
> - * functions will ensure that only valid keys are supplied to them.
> - *
> - * The cost for this checking is increased code size and runtime overhead
> - * - if performance is important, it may be worth switching back to the
> - * unsafe methods once your program has been debugged with the safe methods.
> - * This just requires switching to some simple alternative defines - eg:
> - * #define insert_some hashtable_insert
> - *
> - */
> -
> -/*****************************************************************************
> - * create_hashtable
> -
> - * @name                    create_hashtable
> - * @param   minsize         minimum initial size of hashtable
> - * @param   hashfunction    function for hashing keys
> - * @param   key_eq_fn       function for determining key equality
> - * @return                  newly created hashtable or NULL on failure
> - */
> -
> -struct hashtable *
> -create_hashtable(unsigned int minsize,
> -                 unsigned int (*hashfunction) (void*),
> -                 int (*key_eq_fn) (void*,void*));
> -
> -/*****************************************************************************
> - * hashtable_insert
> -
> - * @name        hashtable_insert
> - * @param   h   the hashtable to insert into
> - * @param   k   the key - hashtable claims ownership and will free on removal
> - * @param   v   the value - does not claim ownership
> - * @return      non-zero for successful insertion
> - *
> - * This function will cause the table to expand if the insertion would take
> - * the ratio of entries to table size over the maximum load factor.
> - *
> - * This function does not check for repeated insertions with a duplicate key.
> - * The value returned when using a duplicate key is undefined -- when
> - * the hashtable changes size, the order of retrieval of duplicate key
> - * entries is reversed.
> - * If in doubt, remove before insert.
> - */
> -
> -int
> -hashtable_insert(struct hashtable *h, void *k, void *v);
> -
> -#define DEFINE_HASHTABLE_INSERT(fnname, keytype, valuetype) \
> -int fnname (struct hashtable *h, keytype *k, valuetype *v) \
> -{ \
> -    return hashtable_insert(h,k,v); \
> -}
> -
> -/*****************************************************************************
> - * hashtable_search
> -
> - * @name        hashtable_search
> - * @param   h   the hashtable to search
> - * @param   k   the key to search for  - does not claim ownership
> - * @return      the value associated with the key, or NULL if none found
> - */
> -
> -void *
> -hashtable_search(struct hashtable *h, void *k);
> -
> -#define DEFINE_HASHTABLE_SEARCH(fnname, keytype, valuetype) \
> -valuetype * fnname (struct hashtable *h, keytype *k) \
> -{ \
> -    return (valuetype *) (hashtable_search(h,k)); \
> -}
> -
> -/*****************************************************************************
> - * hashtable_remove
> -
> - * @name        hashtable_remove
> - * @param   h   the hashtable to remove the item from
> - * @param   k   the key to search for  - does not claim ownership
> - * @return      the value associated with the key, or NULL if none found
> - */
> -
> -void * /* returns value */
> -hashtable_remove(struct hashtable *h, void *k);
> -
> -#define DEFINE_HASHTABLE_REMOVE(fnname, keytype, valuetype) \
> -valuetype * fnname (struct hashtable *h, keytype *k) \
> -{ \
> -    return (valuetype *) (hashtable_remove(h,k)); \
> -}
> -
> -
> -/*****************************************************************************
> - * hashtable_count
> -
> - * @name        hashtable_count
> - * @param   h   the hashtable
> - * @return      the number of items stored in the hashtable
> - */
> -unsigned int
> -hashtable_count(struct hashtable *h);
> -
> -
> -/*****************************************************************************
> - * hashtable_destroy
> -
> - * @name        hashtable_destroy
> - * @param   h   the hashtable
> - * @param       free_values     whether to call 'free' on the remaining values
> - */
> -
> -void
> -hashtable_destroy(struct hashtable *h, int free_values);
> -
> -#endif /* __HASHTABLE_CWC22_H__ */
> diff --git a/tools/vtpm_manager/util/hashtable_itr.c b/tools/vtpm_manager/util/hashtable_itr.c
> deleted file mode 100644
> index dcf42c8..0000000
> --- a/tools/vtpm_manager/util/hashtable_itr.c
> +++ /dev/null
> @@ -1,236 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/blktap2/drivers/hashtable_itr.c
> - */
> -
> -#include "hashtable.h"
> -#include "hashtable_private.h"
> -#include "hashtable_itr.h"
> -#include <stdlib.h> /* defines NULL */
> -
> -/*****************************************************************************/
> -/* hashtable_iterator    - iterator constructor */
> -
> -struct hashtable_itr *
> -hashtable_iterator(struct hashtable *h)
> -{
> -    unsigned int i, tablelength;
> -    struct hashtable_itr *itr = (struct hashtable_itr *)
> -        malloc(sizeof(struct hashtable_itr));
> -    if (NULL == itr) return NULL;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    itr->h = h;
> -    itr->e = NULL;
> -    itr->parent = NULL;
> -    tablelength = h->tablelength;
> -    itr->index = tablelength;
> -    if (0 == h->entrycount) {
> -#ifdef HASHTABLE_THREADED
> -      pthread_mutex_unlock(&h->mutex);
> -#endif
> -      return itr;
> -    }
> -
> -    for (i = 0; i < tablelength; i++)
> -    {
> -        if (NULL != h->table[i])
> -        {
> -            itr->e = h->table[i];
> -            itr->index = i;
> -            break;
> -        }
> -    }
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return itr;
> -}
> -
> -/*****************************************************************************/
> -/* key      - return the key of the (key,value) pair at the current position */
> -/* value    - return the value of the (key,value) pair at the current position */
> -
> -void *
> -hashtable_iterator_key(struct hashtable_itr *i)
> -{ return i->e->k; }
> -
> -void *
> -hashtable_iterator_value(struct hashtable_itr *i)
> -{ return i->e->v; }
> -
> -/*****************************************************************************/
> -/* advance - advance the iterator to the next element
> - *           returns zero if advanced to end of table */
> -
> -int
> -hashtable_iterator_advance(struct hashtable_itr *itr)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&itr->h->mutex);
> -#endif
> -    unsigned int j,tablelength;
> -    struct entry **table;
> -    struct entry *next;
> -    int ret;
> -    if (NULL == itr->e) { /* stupidity check */
> -      ret = 0;
> -      goto egress;
> -    }
> -
> -    next = itr->e->next;
> -    if (NULL != next)
> -    {
> -        itr->parent = itr->e;
> -        itr->e = next;
> -        ret = -1;
> -        goto egress;
> -    }
> -
> -    tablelength = itr->h->tablelength;
> -    itr->parent = NULL;
> -    if (tablelength <= (j = ++(itr->index)))
> -    {
> -        itr->e = NULL;
> -        ret = 0;
> -        goto egress;
> -    }
> -    table = itr->h->table;
> -    while (NULL == (next = table[j]))
> -    {
> -        if (++j >= tablelength)
> -        {
> -            itr->index = tablelength;
> -            itr->e = NULL;
> -            ret = 0;
> -            goto egress;
> -        }
> -    }
> -    itr->index = j;
> -    itr->e = next;
> -    ret = -1;
> -
> - egress:
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&itr->h->mutex);
> -#endif
> -    return ret;
> -}
> -
> -/*****************************************************************************/
> -/* remove - remove the entry at the current iterator position
> - *          and advance the iterator, if there is a successive
> - *          element.
> - *          If you want the value, read it before you remove:
> - *          beware memory leaks if you don't.
> - *          Returns zero if end of iteration. */
> -
> -int
> -hashtable_iterator_remove(struct hashtable_itr *itr)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&itr->h->mutex);
> -#endif
> -    struct entry *remember_e, *remember_parent;
> -    int ret;
> -
> -    /* Do the removal */
> -    if (NULL == (itr->parent))
> -    {
> -        /* element is head of a chain */
> -        itr->h->table[itr->index] = itr->e->next;
> -    } else {
> -        /* element is mid-chain */
> -        itr->parent->next = itr->e->next;
> -    }
> -    /* itr->e is now outside the hashtable */
> -    remember_e = itr->e;
> -    itr->h->entrycount--;
> -    freekey(remember_e->k);
> -
> -    /* Advance the iterator, correcting the parent */
> -    remember_parent = itr->parent;
> -    ret = hashtable_iterator_advance(itr);
> -    if (itr->parent == remember_e) { itr->parent = remember_parent; }
> -    free(remember_e);
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&itr->h->mutex);
> -#endif
> -    return ret;
> -}
> -
> -/*****************************************************************************/
> -int /* returns zero if not found */
> -hashtable_iterator_search(struct hashtable_itr *itr,
> -                          struct hashtable *h, void *k)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    struct entry *e, *parent;
> -    unsigned int hashvalue, index;
> -    int ret;
> -
> -    hashvalue = hash(h,k);
> -    index = indexFor(h->tablelength,hashvalue);
> -
> -    e = h->table[index];
> -    parent = NULL;
> -    while (NULL != e)
> -    {
> -        /* Check hash value to short circuit heavier comparison */
> -        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
> -        {
> -            itr->index = index;
> -            itr->e = e;
> -            itr->parent = parent;
> -            itr->h = h;
> -            ret= -1;
> -            goto egress;
> -        }
> -        parent = e;
> -        e = e->next;
> -    }
> -  ret = 0;
> -
> -egress:
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return ret;
> -}
> diff --git a/tools/vtpm_manager/util/hashtable_itr.h b/tools/vtpm_manager/util/hashtable_itr.h
> deleted file mode 100644
> index 35654e0..0000000
> --- a/tools/vtpm_manager/util/hashtable_itr.h
> +++ /dev/null
> @@ -1,109 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/blktap2/drivers/hashtable_itr.h
> - */
> -
> -
> -#ifndef __HASHTABLE_ITR_CWC22__
> -#define __HASHTABLE_ITR_CWC22__
> -#include "hashtable.h"
> -#include "hashtable_private.h" /* needed to enable inlining */
> -
> -/*****************************************************************************/
> -/* This struct is only concrete here to allow the inlining of two of the
> - * accessor functions. */
> -struct hashtable_itr
> -{
> -    struct hashtable *h;
> -    struct entry *e;
> -    struct entry *parent;
> -    unsigned int index;
> -};
> -
> -
> -/*****************************************************************************/
> -/* hashtable_iterator
> - */
> -
> -struct hashtable_itr *
> -hashtable_iterator(struct hashtable *h);
> -
> -/*****************************************************************************/
> -/* hashtable_iterator_key
> - * - return the value of the (key,value) pair at the current position */
> -
> -void *hashtable_iterator_key(struct hashtable_itr *i);
> -
> -/*****************************************************************************/
> -/* value - return the value of the (key,value) pair at the current position */
> -
> -void *hashtable_iterator_value(struct hashtable_itr *i);
> -
> -/*****************************************************************************/
> -/* advance - advance the iterator to the next element
> - *           returns zero if advanced to end of table */
> -
> -int
> -hashtable_iterator_advance(struct hashtable_itr *itr);
> -
> -/*****************************************************************************/
> -/* remove - remove current element and advance the iterator to the next element
> - *          NB: if you need the value to free it, read it before
> - *          removing. ie: beware memory leaks!
> - *          returns zero if advanced to end of table */
> -
> -int
> -hashtable_iterator_remove(struct hashtable_itr *itr);
> -
> -/*****************************************************************************/
> -/* search - overwrite the supplied iterator, to point to the entry
> - *          matching the supplied key.
> -            h points to the hashtable to be searched.
> - *          returns zero if not found. */
> -int
> -hashtable_iterator_search(struct hashtable_itr *itr,
> -                          struct hashtable *h, void *k);
> -
> -#define DEFINE_HASHTABLE_ITERATOR_SEARCH(fnname, keytype) \
> -int fnname (struct hashtable_itr *i, struct hashtable *h, keytype *k) \
> -{ \
> -    return (hashtable_iterator_search(i,h,k)); \
> -}
> -
> -
> -
> -#endif /* __HASHTABLE_ITR_CWC22__*/
> diff --git a/tools/vtpm_manager/util/hashtable_private.h b/tools/vtpm_manager/util/hashtable_private.h
> deleted file mode 100644
> index d87a7f9..0000000
> --- a/tools/vtpm_manager/util/hashtable_private.h
> +++ /dev/null
> @@ -1,96 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/xenstore/hashtable_private.h
> - *  - tools/blktap2/drivers/hashtable_private.h
> - */
> -
> -#ifndef __HASHTABLE_PRIVATE_CWC22_H__
> -#define __HASHTABLE_PRIVATE_CWC22_H__
> -
> -#include "hashtable.h"
> -#ifdef HASHTABLE_THREADED
> -#include <pthread.h>
> -#endif
> -
> -/*****************************************************************************/
> -struct entry
> -{
> -    void *k, *v;
> -    unsigned int h;
> -    struct entry *next;
> -};
> -
> -struct hashtable {
> -    unsigned int tablelength;
> -    struct entry **table;
> -    unsigned int entrycount;
> -    unsigned int loadlimit;
> -    unsigned int primeindex;
> -    unsigned int (*hashfn) (void *k);
> -    int (*eqfn) (void *k1, void *k2);
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_t mutex;
> -#endif
> -};
> -
> -/*****************************************************************************/
> -unsigned int
> -hash(struct hashtable *h, void *k);
> -
> -/*****************************************************************************/
> -/* indexFor */
> -static inline unsigned int
> -indexFor(unsigned int tablelength, unsigned int hashvalue) {
> -    return (hashvalue % tablelength);
> -};
> -
> -/* Only works if tablelength == 2^N */
> -/*static inline unsigned int
> -indexFor(unsigned int tablelength, unsigned int hashvalue)
> -{
> -    return (hashvalue & (tablelength - 1u));
> -}
> -*/
> -
> -/*****************************************************************************/
> -#define freekey(X) free(X)
> -/*define freekey(X) ; */
> -
> -
> -/*****************************************************************************/
> -
> -#endif /* __HASHTABLE_PRIVATE_CWC22_H__*/
> diff --git a/tools/vtpm_manager/util/log.c b/tools/vtpm_manager/util/log.c
> deleted file mode 100644
> index 75fe91a..0000000
> --- a/tools/vtpm_manager/util/log.c
> +++ /dev/null
> @@ -1,142 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <stdlib.h>
> -#include <string.h>
> -#include <stdio.h>
> -
> -#include "buffer.h"
> -#include "tcg.h"
> -
> -// Helper code for the consts, eg. to produce messages for error codes.
> -
> -typedef struct error_code_entry_t {
> -  TPM_RESULT code;
> -  char * code_name;
> -  char * msg;
> -} error_code_entry_t;
> -
> -static const error_code_entry_t error_msgs [] = {
> -  { TPM_SUCCESS, "TPM_SUCCESS", "Successful completion of the operation" },
> -  { TPM_AUTHFAIL, "TPM_AUTHFAIL", "Authentication failed" },
> -  { TPM_BADINDEX, "TPM_BADINDEX", "The index to a PCR, DIR or other register is incorrect" },
> -  { TPM_BAD_PARAMETER, "TPM_BAD_PARAMETER", "One or more parameter is bad" },
> -  { TPM_AUDITFAILURE, "TPM_AUDITFAILURE", "An operation completed successfully but the auditing of that operation failed." },
> -  { TPM_CLEAR_DISABLED, "TPM_CLEAR_DISABLED", "The clear disable flag is set and all clear operations now require physical access" },
> -  { TPM_DEACTIVATED, "TPM_DEACTIVATED", "The TPM is deactivated" },
> -  { TPM_DISABLED, "TPM_DISABLED", "The TPM is disabled" },
> -  { TPM_DISABLED_CMD, "TPM_DISABLED_CMD", "The target command has been disabled" },
> -  { TPM_FAIL, "TPM_FAIL", "The operation failed" },
> -  { TPM_BAD_ORDINAL, "TPM_BAD_ORDINAL", "The ordinal was unknown or inconsistent" },
> -  { TPM_INSTALL_DISABLED, "TPM_INSTALL_DISABLED", "The ability to install an owner is disabled" },
> -  { TPM_INVALID_KEYHANDLE, "TPM_INVALID_KEYHANDLE", "The key handle presented was invalid" },
> -  { TPM_KEYNOTFOUND, "TPM_KEYNOTFOUND", "The target key was not found" },
> -  { TPM_INAPPROPRIATE_ENC, "TPM_INAPPROPRIATE_ENC", "Unacceptable encryption scheme" },
> -  { TPM_MIGRATEFAIL, "TPM_MIGRATEFAIL", "Migration authorization failed" },
> -  { TPM_INVALID_PCR_INFO, "TPM_INVALID_PCR_INFO", "PCR information could not be interpreted" },
> -  { TPM_NOSPACE, "TPM_NOSPACE", "No room to load key." },
> -  { TPM_NOSRK, "TPM_NOSRK", "There is no SRK set" },
> -  { TPM_NOTSEALED_BLOB, "TPM_NOTSEALED_BLOB", "An encrypted blob is invalid or was not created by this TPM" },
> -  { TPM_OWNER_SET, "TPM_OWNER_SET", "There is already an Owner" },
> -  { TPM_RESOURCES, "TPM_RESOURCES", "The TPM has insufficient internal resources to perform the requested action." },
> -  { TPM_SHORTRANDOM, "TPM_SHORTRANDOM", "A random string was too short" },
> -  { TPM_SIZE, "TPM_SIZE", "The TPM does not have the space to perform the operation." },
> -  { TPM_WRONGPCRVAL, "TPM_WRONGPCRVAL", "The named PCR value does not match the current PCR value." },
> -  { TPM_BAD_PARAM_SIZE, "TPM_BAD_PARAM_SIZE", "The paramSize argument to the command has the incorrect value" },
> -  { TPM_SHA_THREAD, "TPM_SHA_THREAD", "There is no existing SHA-1 thread." },
> -  { TPM_SHA_ERROR, "TPM_SHA_ERROR", "The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error." },
> -  { TPM_FAILEDSELFTEST, "TPM_FAILEDSELFTEST", "Self-test has failed and the TPM has shutdown." },
> -  { TPM_AUTH2FAIL, "TPM_AUTH2FAIL", "The authorization for the second key in a 2 key function failed authorization" },
> -  { TPM_BADTAG, "TPM_BADTAG", "The tag value sent to for a command is invalid" },
> -  { TPM_IOERROR, "TPM_IOERROR", "An IO error occurred transmitting information to the TPM" },
> -  { TPM_ENCRYPT_ERROR, "TPM_ENCRYPT_ERROR", "The encryption process had a problem." },
> -  { TPM_DECRYPT_ERROR, "TPM_DECRYPT_ERROR", "The decryption process did not complete." },
> -  { TPM_INVALID_AUTHHANDLE, "TPM_INVALID_AUTHHANDLE", "An invalid handle was used." },
> -  { TPM_NO_ENDORSEMENT, "TPM_NO_ENDORSEMENT", "The TPM does not a EK installed" },
> -  { TPM_INVALID_KEYUSAGE, "TPM_INVALID_KEYUSAGE", "The usage of a key is not allowed" },
> -  { TPM_WRONG_ENTITYTYPE, "TPM_WRONG_ENTITYTYPE", "The submitted entity type is not allowed" },
> -  { TPM_INVALID_POSTINIT, "TPM_INVALID_POSTINIT", "The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup" },
> -  { TPM_INAPPROPRIATE_SIG, "TPM_INAPPROPRIATE_SIG", "Signed data cannot include additional DER information" },
> -  { TPM_BAD_KEY_PROPERTY, "TPM_BAD_KEY_PROPERTY", "The key properties in TPM_KEY_PARMs are not supported by this TPM" },
> -
> -  { TPM_BAD_MIGRATION, "TPM_BAD_MIGRATION", "The migration properties of this key are incorrect." },
> -  { TPM_BAD_SCHEME, "TPM_BAD_SCHEME", "The signature or encryption scheme for this key is incorrect or not permitted in this situation." },
> -  { TPM_BAD_DATASIZE, "TPM_BAD_DATASIZE", "The size of the data (or blob) parameter is bad or inconsistent with the referenced key" },
> -  { TPM_BAD_MODE, "TPM_BAD_MODE", "A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob." },
> -  { TPM_BAD_PRESENCE, "TPM_BAD_PRESENCE", "Either the physicalPresence or physicalPresenceLock bits have the wrong value" },
> -  { TPM_BAD_VERSION, "TPM_BAD_VERSION", "The TPM cannot perform this version of the capability" },
> -  { TPM_NO_WRAP_TRANSPORT, "TPM_NO_WRAP_TRANSPORT", "The TPM does not allow for wrapped transport sessions" },
> -  { TPM_AUDITFAIL_UNSUCCESSFUL, "TPM_AUDITFAIL_UNSUCCESSFUL", "TPM audit construction failed and the underlying command was returning a failure code also" },
> -  { TPM_AUDITFAIL_SUCCESSFUL, "TPM_AUDITFAIL_SUCCESSFUL", "TPM audit construction failed and the underlying command was returning success" },
> -  { TPM_NOTRESETABLE, "TPM_NOTRESETABLE", "Attempt to reset a PCR register that does not have the resettable attribute" },
> -  { TPM_NOTLOCAL, "TPM_NOTLOCAL", "Attempt to reset a PCR register that requires locality and locality modifier not part of command transport" },
> -  { TPM_BAD_TYPE, "TPM_BAD_TYPE", "Make identity blob not properly typed" },
> -  { TPM_INVALID_RESOURCE, "TPM_INVALID_RESOURCE", "When saving context identified resource type does not match actual resource" },
> -  { TPM_NOTFIPS, "TPM_NOTFIPS", "The TPM is attempting to execute a command only available when in FIPS mode" },
> -  { TPM_INVALID_FAMILY, "TPM_INVALID_FAMILY", "The command is attempting to use an invalid family ID" },
> -  { TPM_NO_NV_PERMISSION, "TPM_NO_NV_PERMISSION", "The permission to manipulate the NV storage is not available" },
> -  { TPM_REQUIRES_SIGN, "TPM_REQUIRES_SIGN", "The operation requires a signed command" },
> -  { TPM_KEY_NOTSUPPORTED, "TPM_KEY_NOTSUPPORTED", "Wrong operation to load an NV key" },
> -  { TPM_AUTH_CONFLICT, "TPM_AUTH_CONFLICT", "NV_LoadKey blob requires both owner and blob authorization" },
> -  { TPM_AREA_LOCKED, "TPM_AREA_LOCKED", "The NV area is locked and not writtable" },
> -  { TPM_BAD_LOCALITY, "TPM_BAD_LOCALITY", "The locality is incorrect for the attempted operation" },
> -  { TPM_READ_ONLY, "TPM_READ_ONLY", "The NV area is read only and can't be written to" },
> -  { TPM_PER_NOWRITE, "TPM_PER_NOWRITE", "There is no protection on the write to the NV area" },
> -  { TPM_FAMILYCOUNT, "TPM_FAMILYCOUNT", "The family count value does not match" },
> -  { TPM_WRITE_LOCKED, "TPM_WRITE_LOCKED", "The NV area has already been written to" },
> -  { TPM_BAD_ATTRIBUTES, "TPM_BAD_ATTRIBUTES", "The NV area attributes conflict" },
> -  { TPM_INVALID_STRUCTURE, "TPM_INVALID_STRUCTURE", "The structure tag and version are invalid or inconsistent" },
> -  { TPM_KEY_OWNER_CONTROL, "TPM_KEY_OWNER_CONTROL", "The key is under control of the TPM Owner and can only be evicted by the TPM Owner." },
> -  { TPM_BAD_COUNTER, "TPM_BAD_COUNTER", "The counter handle is incorrect" },
> -  { TPM_NOT_FULLWRITE, "TPM_NOT_FULLWRITE", "The write is not a complete write of the area" },
> -  { TPM_CONTEXT_GAP, "TPM_CONTEXT_GAP", "The gap between saved context counts is too large" },
> -  { TPM_MAXNVWRITES, "TPM_MAXNVWRITES", "The maximum number of NV writes without an owner has been exceeded" },
> -  { TPM_NOOPERATOR, "TPM_NOOPERATOR", "No operator authorization value is set" },
> -  { TPM_RESOURCEMISSING, "TPM_RESOURCEMISSING", "The resource pointed to by context is not loaded" },
> -  { TPM_DELEGATE_LOCK, "TPM_DELEGATE_LOCK", "The delegate administration is locked" },
> -  { TPM_DELEGATE_FAMILY, "TPM_DELEGATE_FAMILY", "Attempt to manage a family other then the delegated family" },
> -  { TPM_DELEGATE_ADMIN, "TPM_DELEGATE_ADMIN", "Delegation table management not enabled" },
> -  { TPM_TRANSPORT_EXCLUSIVE, "TPM_TRANSPORT_EXCLUSIVE", "There was a command executed outside of an exclusive transport session" },
> -};
> -
> -
> -// helper function for the error codes:
> -const char* tpm_get_error_name (TPM_RESULT code) {
> -  // just do a linear scan for now
> -  unsigned i;
> -  for (i = 0; i < sizeof(error_msgs)/sizeof(error_msgs[0]); i++)
> -    if (code == error_msgs[i].code)
> -      return error_msgs[i].code_name;
> -
> -    return("Unknown Error Code");
> -}
> diff --git a/tools/vtpm_manager/util/log.h b/tools/vtpm_manager/util/log.h
> deleted file mode 100644
> index 1f15f5b..0000000
> --- a/tools/vtpm_manager/util/log.h
> +++ /dev/null
> @@ -1,94 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#ifndef __VTPM_LOG_H__
> -#define __VTPM_LOG_H__
> -
> -#include <stdint.h>             // for uint32_t
> -#include <stddef.h>             // for pointer NULL
> -
> -// =========================== LOGGING ==============================
> -
> -// the logging module numbers
> -#define VTPM_LOG_CRYPTO      1
> -#define VTPM_LOG_BSG         2
> -#define VTPM_LOG_TXDATA      3
> -#define VTPM_LOG_TCS         4
> -#define VTPM_LOG_TCS_DEEP    5
> -#define VTPM_LOG_VTSP        6
> -#define VTPM_LOG_VTPM        7
> -#define VTPM_LOG_VTPM_DEEP   8
> -#define VTPM_LOG_VTSP_DEEP   9
> -
> -static char *module_names[] = { "",
> -                                "CRYPTO",
> -                                "BSG",
> -                                "TXDATA",
> -                                "TCS",
> -                                "TCS",
> -                                "VTSP",
> -                                "VTPM",
> -                                "VTPM",
> -                                "VTSP"
> -                              };
> -
> -// Default to standard logging
> -#ifndef LOGGING_MODULES
> -#define LOGGING_MODULES (BITMASK(VTPM_LOG_VTPM))
> -#endif
> -
> -// bit-access macros
> -#define BITMASK(idx)      ( 1U << (idx) )
> -#define GETBIT(num,idx)   ( ((num) & BITMASK(idx)) >> idx )
> -#define SETBIT(num,idx)   (num) |= BITMASK(idx)
> -#define CLEARBIT(num,idx) (num) &= ( ~ BITMASK(idx) )
> -
> -#define vtpmloginfo(module, fmt, args...) \
> -  if (GETBIT (LOGGING_MODULES, module) == 1) {                         \
> -    fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); \
> -  }
> -
> -#define vtpmloginfomore(module, fmt, args...) \
> -  if (GETBIT (LOGGING_MODULES, module) == 1) {                       \
> -    fprintf (stdout, fmt,##args);                                    \
> -  }
> -
> -#define vtpmlogerror(module, fmt, args...) \
> -  fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
> -
> -//typedef UINT32 tpm_size_t;
> -
> -// helper function for the error codes:
> -const char* tpm_get_error_name (TPM_RESULT code);
> -
> -#endif // _VTPM_LOG_H_
> diff --git a/tools/vtpm_manager/util/tcg.h b/tools/vtpm_manager/util/tcg.h
> deleted file mode 100644
> index 5c42913..0000000
> --- a/tools/vtpm_manager/util/tcg.h
> +++ /dev/null
> @@ -1,503 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tcg.h
> -//
> -//  This file contains all the structure and type definitions
> -//
> -// ==================================================================
> -
> -#ifndef __TCG_H__
> -#define __TCG_H__
> -
> -// This pragma is used to disallow structure padding
> -#pragma pack(push, 1)
> -
> -// *************************** TYPEDEFS *********************************
> -typedef unsigned char BYTE;
> -typedef unsigned char BOOL;
> -typedef unsigned short UINT16;
> -typedef unsigned int UINT32;
> -typedef unsigned long long UINT64;
> -
> -typedef UINT32 TPM_RESULT;
> -typedef UINT32 TPM_PCRINDEX;
> -typedef UINT32 TPM_DIRINDEX;
> -typedef UINT32 TPM_HANDLE;
> -typedef TPM_HANDLE TPM_AUTHHANDLE;
> -typedef TPM_HANDLE TCPA_HASHHANDLE;
> -typedef TPM_HANDLE TCPA_HMACHANDLE;
> -typedef TPM_HANDLE TCPA_ENCHANDLE;
> -typedef TPM_HANDLE TPM_KEY_HANDLE;
> -typedef TPM_HANDLE TCPA_ENTITYHANDLE;
> -typedef UINT32 TPM_RESOURCE_TYPE;
> -typedef UINT32 TPM_COMMAND_CODE;
> -typedef UINT16 TPM_PROTOCOL_ID;
> -typedef BYTE TPM_AUTH_DATA_USAGE;
> -typedef UINT16 TPM_ENTITY_TYPE;
> -typedef UINT32 TPM_ALGORITHM_ID;
> -typedef UINT16 TPM_KEY_USAGE;
> -typedef UINT16 TPM_STARTUP_TYPE;
> -typedef UINT32 TPM_CAPABILITY_AREA;
> -typedef UINT16 TPM_ENC_SCHEME;
> -typedef UINT16 TPM_SIG_SCHEME;
> -typedef UINT16 TPM_MIGRATE_SCHEME;
> -typedef UINT16 TPM_PHYSICAL_PRESENCE;
> -typedef UINT32 TPM_KEY_FLAGS;
> -
> -#define TPM_DIGEST_SIZE 20  // Don't change this
> -typedef BYTE TPM_AUTHDATA[TPM_DIGEST_SIZE];
> -typedef TPM_AUTHDATA TPM_SECRET;
> -typedef TPM_AUTHDATA TPM_ENCAUTH;
> -typedef BYTE TPM_PAYLOAD_TYPE;
> -typedef UINT16 TPM_TAG;
> -
> -// Data Types of the TCS
> -typedef UINT32 TCS_AUTHHANDLE;  // Handle addressing a authorization session
> -typedef UINT32 TCS_CONTEXT_HANDLE; // Basic context handle
> -typedef UINT32 TCS_KEY_HANDLE;  // Basic key handle
> -
> -// ************************* STRUCTURES **********************************
> -
> -typedef struct TPM_VERSION {
> -  BYTE major;
> -  BYTE minor;
> -  BYTE revMajor;
> -  BYTE revMinor;
> -} TPM_VERSION;
> -
> -static const TPM_VERSION TPM_STRUCT_VER_1_1 = { 1,1,0,0 };
> -
> -typedef struct TPM_DIGEST {
> -  BYTE digest[TPM_DIGEST_SIZE];
> -} TPM_DIGEST;
> -
> -typedef TPM_DIGEST TPM_PCRVALUE;
> -typedef TPM_DIGEST TPM_COMPOSITE_HASH;
> -typedef TPM_DIGEST TPM_DIRVALUE;
> -typedef TPM_DIGEST TPM_HMAC;
> -typedef TPM_DIGEST TPM_CHOSENID_HASH;
> -
> -typedef struct TPM_NONCE {
> -  BYTE nonce[TPM_DIGEST_SIZE];
> -} TPM_NONCE;
> -
> -typedef struct TPM_KEY_PARMS {
> -  TPM_ALGORITHM_ID algorithmID;
> -  TPM_ENC_SCHEME encScheme;
> -  TPM_SIG_SCHEME sigScheme;
> -  UINT32 parmSize;
> -  BYTE* parms;
> -} TPM_KEY_PARMS;
> -
> -typedef struct TPM_RSA_KEY_PARMS {
> -  UINT32 keyLength;
> -  UINT32 numPrimes;
> -  UINT32 exponentSize;
> -  BYTE* exponent;
> -} TPM_RSA_KEY_PARMS;
> -
> -typedef struct TPM_STORE_PUBKEY {
> -  UINT32 keyLength;
> -  BYTE* key;
> -} TPM_STORE_PUBKEY;
> -
> -typedef struct TPM_PUBKEY {
> -  TPM_KEY_PARMS algorithmParms;
> -  TPM_STORE_PUBKEY pubKey;
> -} TPM_PUBKEY;
> -
> -typedef struct TPM_KEY {
> -  TPM_VERSION         ver;
> -  TPM_KEY_USAGE       keyUsage;
> -  TPM_KEY_FLAGS       keyFlags;
> -  TPM_AUTH_DATA_USAGE authDataUsage;
> -  TPM_KEY_PARMS       algorithmParms;
> -  UINT32              PCRInfoSize;
> -  BYTE*               PCRInfo; // this should be a TPM_PCR_INFO, or NULL
> -  TPM_STORE_PUBKEY    pubKey;
> -  UINT32              encDataSize;
> -  BYTE*               encData;
> -} TPM_KEY;
> -
> -typedef struct TPM_PCR_SELECTION {
> -  UINT16 sizeOfSelect;        /// in bytes
> -  BYTE* pcrSelect;
> -} TPM_PCR_SELECTION;
> -
> -typedef struct TPM_PCR_COMPOSITE {
> -  TPM_PCR_SELECTION select;
> -  UINT32 valueSize;
> -  TPM_PCRVALUE* pcrValue;
> -} TPM_PCR_COMPOSITE;
> -
> -
> -typedef struct TPM_PCR_INFO {
> -  TPM_PCR_SELECTION pcrSelection;
> -  TPM_COMPOSITE_HASH digestAtRelease;
> -  TPM_COMPOSITE_HASH digestAtCreation;
> -} TPM_PCR_INFO;
> -
> -
> -typedef struct TPM_BOUND_DATA {
> -  TPM_VERSION ver;
> -  TPM_PAYLOAD_TYPE payload;
> -  BYTE* payloadData;
> -} TPM_BOUND_DATA;
> -
> -typedef struct TPM_STORED_DATA {
> -  TPM_VERSION ver;
> -  UINT32 sealInfoSize;
> -  BYTE* sealInfo;
> -  UINT32 encDataSize;
> -  BYTE* encData;
> -} TPM_STORED_DATA;
> -
> -typedef struct TCS_AUTH {
> -  TCS_AUTHHANDLE  AuthHandle;
> -  TPM_NONCE   NonceOdd;   // system
> -  TPM_NONCE   NonceEven;   // TPM
> -  BOOL   fContinueAuthSession;
> -  TPM_AUTHDATA  HMAC;
> -} TCS_AUTH;
> -
> -// structures for dealing with sizes followed by buffers in all the
> -// TCG structure.
> -typedef struct pack_buf_t {
> -  UINT32 size;
> -  BYTE * data;
> -} pack_buf_t;
> -
> -typedef struct pack_constbuf_t {
> -  UINT32 size;
> -  const BYTE* data;
> -} pack_constbuf_t;
> -
> -
> -
> -// **************************** CONSTANTS *********************************
> -
> -// BOOL values
> -#define TRUE 0x01
> -#define FALSE 0x00
> -
> -#define TCPA_MAX_BUFFER_LENGTH 0x2000
> -
> -//
> -// TPM_COMMAND_CODE values
> -#define TPM_PROTECTED_ORDINAL 0x00000000UL
> -#define TPM_UNPROTECTED_ORDINAL 0x80000000UL
> -#define TPM_CONNECTION_ORDINAL 0x40000000UL
> -#define TPM_VENDOR_ORDINAL 0x20000000UL
> -
> -#define TPM_ORD_OIAP                     (10UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_OSAP                     (11UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ChangeAuth               (12UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_TakeOwnership            (13UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ChangeAuthAsymStart      (14UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ChangeAuthAsymFinish     (15UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ChangeAuthOwner          (16UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Extend                   (20UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_PcrRead                  (21UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Quote                    (22UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Seal                     (23UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Unseal                   (24UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DirWriteAuth             (25UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DirRead                  (26UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_UnBind                   (30UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CreateWrapKey            (31UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadKey                  (32UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetPubKey                (33UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_EvictKey                 (34UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CreateMigrationBlob      (40UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ReWrapKey                (41UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ConvertMigrationBlob     (42UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_AuthorizeMigrationKey    (43UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CreateMaintenanceArchive (44UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadMaintenanceArchive   (45UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_KillMaintenanceFeature   (46UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadManuMaintPub         (47UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ReadManuMaintPub         (48UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CertifyKey               (50UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Sign                     (60UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetRandom                (70UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_StirRandom               (71UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SelfTestFull             (80UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SelfTestStartup          (81UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CertifySelfTest          (82UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ContinueSelfTest         (83UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetTestResult            (84UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Reset                    (90UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_OwnerClear               (91UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DisableOwnerClear        (92UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ForceClear               (93UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DisableForceClear        (94UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetCapabilitySigned      (100UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetCapability            (101UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetCapabilityOwner       (102UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_OwnerSetDisable          (110UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_PhysicalEnable           (111UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_PhysicalDisable          (112UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SetOwnerInstall          (113UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_PhysicalSetDeactivated   (114UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SetTempDeactivated       (115UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CreateEndorsementKeyPair (120UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_MakeIdentity             (121UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ActivateIdentity         (122UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ReadPubek                (124UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_OwnerReadPubek           (125UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DisablePubekRead         (126UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetAuditEvent            (130UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetAuditEventSigned      (131UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetOrdinalAuditStatus    (140UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SetOrdinalAuditStatus    (141UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Terminate_Handle         (150UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Init                     (151UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SaveState                (152UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Startup                  (153UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SetRedirection           (154UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SHA1Start                (160UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SHA1Update               (161UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SHA1Complete             (162UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SHA1CompleteExtend       (163UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_FieldUpgrade             (170UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SaveKeyContext           (180UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadKeyContext           (181UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SaveAuthContext          (182UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadAuthContext          (183UL + TPM_PROTECTED_ORDINAL)
> -#define TSC_ORD_PhysicalPresence         (10UL + TPM_CONNECTION_ORDINAL)
> -
> -
> -
> -//
> -// TPM_RESULT values
> -//
> -// just put in the whole table from spec 1.2
> -
> -#define TPM_BASE   0x0 // The start of TPM return codes
> -#define TPM_VENDOR_ERROR 0x00000400 // Mask to indicate that the error code is vendor specific for vendor specific commands
> -#define TPM_NON_FATAL  0x00000800 // Mask to indicate that the error code is a non-fatal failure.
> -
> -#define TPM_SUCCESS   TPM_BASE // Successful completion of the operation
> -#define TPM_AUTHFAIL      TPM_BASE + 1 // Authentication failed
> -#define TPM_BADINDEX      TPM_BASE + 2 // The index to a PCR, DIR or other register is incorrect
> -#define TPM_BAD_PARAMETER     TPM_BASE + 3 // One or more parameter is bad
> -#define TPM_AUDITFAILURE     TPM_BASE + 4 // An operation completed successfully but the auditing of that operation failed.
> -#define TPM_CLEAR_DISABLED     TPM_BASE + 5 // The clear disable flag is set and all clear operations now require physical access
> -#define TPM_DEACTIVATED     TPM_BASE + 6 // The TPM is deactivated
> -#define TPM_DISABLED      TPM_BASE + 7 // The TPM is disabled
> -#define TPM_DISABLED_CMD     TPM_BASE + 8 // The target command has been disabled
> -#define TPM_FAIL       TPM_BASE + 9 // The operation failed
> -#define TPM_BAD_ORDINAL     TPM_BASE + 10 // The ordinal was unknown or inconsistent
> -#define TPM_INSTALL_DISABLED   TPM_BASE + 11 // The ability to install an owner is disabled
> -#define TPM_INVALID_KEYHANDLE  TPM_BASE + 12 // The key handle presented was invalid
> -#define TPM_KEYNOTFOUND     TPM_BASE + 13 // The target key was not found
> -#define TPM_INAPPROPRIATE_ENC  TPM_BASE + 14 // Unacceptable encryption scheme
> -#define TPM_MIGRATEFAIL     TPM_BASE + 15 // Migration authorization failed
> -#define TPM_INVALID_PCR_INFO   TPM_BASE + 16 // PCR information could not be interpreted
> -#define TPM_NOSPACE      TPM_BASE + 17 // No room to load key.
> -#define TPM_NOSRK       TPM_BASE + 18 // There is no SRK set
> -#define TPM_NOTSEALED_BLOB     TPM_BASE + 19 // An encrypted blob is invalid or was not created by this TPM
> -#define TPM_OWNER_SET      TPM_BASE + 20 // There is already an Owner
> -#define TPM_RESOURCES      TPM_BASE + 21 // The TPM has insufficient internal resources to perform the requested action.
> -#define TPM_SHORTRANDOM     TPM_BASE + 22 // A random string was too short
> -#define TPM_SIZE       TPM_BASE + 23 // The TPM does not have the space to perform the operation.
> -#define TPM_WRONGPCRVAL     TPM_BASE + 24 // The named PCR value does not match the current PCR value.
> -#define TPM_BAD_PARAM_SIZE     TPM_BASE + 25 // The paramSize argument to the command has the incorrect value
> -#define TPM_SHA_THREAD      TPM_BASE + 26 // There is no existing SHA-1 thread.
> -#define TPM_SHA_ERROR      TPM_BASE + 27 // The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error.
> -#define TPM_FAILEDSELFTEST     TPM_BASE + 28 // Self-test has failed and the TPM has shutdown.
> -#define TPM_AUTH2FAIL      TPM_BASE + 29 // The authorization for the second key in a 2 key function failed authorization
> -#define TPM_BADTAG       TPM_BASE + 30 // The tag value sent to for a command is invalid
> -#define TPM_IOERROR      TPM_BASE + 31 // An IO error occurred transmitting information to the TPM
> -#define TPM_ENCRYPT_ERROR     TPM_BASE + 32 // The encryption process had a problem.
> -#define TPM_DECRYPT_ERROR     TPM_BASE + 33 // The decryption process did not complete.
> -#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 // An invalid handle was used.
> -#define TPM_NO_ENDORSEMENT     TPM_BASE + 35 // The TPM does not a EK installed
> -#define TPM_INVALID_KEYUSAGE   TPM_BASE + 36 // The usage of a key is not allowed
> -#define TPM_WRONG_ENTITYTYPE   TPM_BASE + 37 // The submitted entity type is not allowed
> -#define TPM_INVALID_POSTINIT   TPM_BASE + 38 // The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup
> -#define TPM_INAPPROPRIATE_SIG  TPM_BASE + 39 // Signed data cannot include additional DER information
> -#define TPM_BAD_KEY_PROPERTY   TPM_BASE + 40 // The key properties in TPM_KEY_PARMs are not supported by this TPM
> -
> -#define TPM_BAD_MIGRATION      TPM_BASE + 41 // The migration properties of this key are incorrect.
> -#define TPM_BAD_SCHEME       TPM_BASE + 42 // The signature or encryption scheme for this key is incorrect or not permitted in this situation.
> -#define TPM_BAD_DATASIZE      TPM_BASE + 43 // The size of the data (or blob) parameter is bad or inconsistent with the referenced key
> -#define TPM_BAD_MODE       TPM_BASE + 44 // A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob.
> -#define TPM_BAD_PRESENCE      TPM_BASE + 45 // Either the physicalPresence or physicalPresenceLock bits have the wrong value
> -#define TPM_BAD_VERSION      TPM_BASE + 46 // The TPM cannot perform this version of the capability
> -#define TPM_NO_WRAP_TRANSPORT     TPM_BASE + 47 // The TPM does not allow for wrapped transport sessions
> -#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 // TPM audit construction failed and the underlying command was returning a failure code also
> -#define TPM_AUDITFAIL_SUCCESSFUL   TPM_BASE + 49 // TPM audit construction failed and the underlying command was returning success
> -#define TPM_NOTRESETABLE      TPM_BASE + 50 // Attempt to reset a PCR register that does not have the resettable attribute
> -#define TPM_NOTLOCAL       TPM_BASE + 51 // Attempt to reset a PCR register that requires locality and locality modifier not part of command transport
> -#define TPM_BAD_TYPE       TPM_BASE + 52 // Make identity blob not properly typed
> -#define TPM_INVALID_RESOURCE     TPM_BASE + 53 // When saving context identified resource type does not match actual resource
> -#define TPM_NOTFIPS       TPM_BASE + 54 // The TPM is attempting to execute a command only available when in FIPS mode
> -#define TPM_INVALID_FAMILY      TPM_BASE + 55 // The command is attempting to use an invalid family ID
> -#define TPM_NO_NV_PERMISSION     TPM_BASE + 56 // The permission to manipulate the NV storage is not available
> -#define TPM_REQUIRES_SIGN      TPM_BASE + 57 // The operation requires a signed command
> -#define TPM_KEY_NOTSUPPORTED     TPM_BASE + 58 // Wrong operation to load an NV key
> -#define TPM_AUTH_CONFLICT      TPM_BASE + 59 // NV_LoadKey blob requires both owner and blob authorization
> -#define TPM_AREA_LOCKED      TPM_BASE + 60 // The NV area is locked and not writtable
> -#define TPM_BAD_LOCALITY      TPM_BASE + 61 // The locality is incorrect for the attempted operation
> -#define TPM_READ_ONLY       TPM_BASE + 62 // The NV area is read only and can't be written to
> -#define TPM_PER_NOWRITE      TPM_BASE + 63 // There is no protection on the write to the NV area
> -#define TPM_FAMILYCOUNT      TPM_BASE + 64 // The family count value does not match
> -#define TPM_WRITE_LOCKED      TPM_BASE + 65 // The NV area has already been written to
> -#define TPM_BAD_ATTRIBUTES      TPM_BASE + 66 // The NV area attributes conflict
> -#define TPM_INVALID_STRUCTURE     TPM_BASE + 67 // The structure tag and version are invalid or inconsistent
> -#define TPM_KEY_OWNER_CONTROL     TPM_BASE + 68 // The key is under control of the TPM Owner and can only be evicted by the TPM Owner.
> -#define TPM_BAD_COUNTER      TPM_BASE + 69 // The counter handle is incorrect
> -#define TPM_NOT_FULLWRITE      TPM_BASE + 70 // The write is not a complete write of the area
> -#define TPM_CONTEXT_GAP      TPM_BASE + 71 // The gap between saved context counts is too large
> -#define TPM_MAXNVWRITES      TPM_BASE + 72 // The maximum number of NV writes without an owner has been exceeded
> -#define TPM_NOOPERATOR       TPM_BASE + 73 // No operator authorization value is set
> -#define TPM_RESOURCEMISSING     TPM_BASE + 74 // The resource pointed to by context is not loaded
> -#define TPM_DELEGATE_LOCK      TPM_BASE + 75 // The delegate administration is locked
> -#define TPM_DELEGATE_FAMILY     TPM_BASE + 76 // Attempt to manage a family other then the delegated family
> -#define TPM_DELEGATE_ADMIN      TPM_BASE + 77 // Delegation table management not enabled
> -#define TPM_TRANSPORT_EXCLUSIVE    TPM_BASE + 78 // There was a command executed outside of an exclusive transport session
> -
> -// TPM_STARTUP_TYPE values
> -#define TPM_ST_CLEAR 0x0001
> -#define TPM_ST_STATE 0x0002
> -#define TPM_ST_DEACTIVATED 0x003
> -
> -// TPM_TAG values
> -#define TPM_TAG_RQU_COMMAND 0x00c1
> -#define TPM_TAG_RQU_AUTH1_COMMAND 0x00c2
> -#define TPM_TAG_RQU_AUTH2_COMMAND 0x00c3
> -#define TPM_TAG_RSP_COMMAND 0x00c4
> -#define TPM_TAG_RSP_AUTH1_COMMAND 0x00c5
> -#define TPM_TAG_RSP_AUTH2_COMMAND 0x00c6
> -
> -// TPM_PAYLOAD_TYPE values
> -#define TPM_PT_ASYM 0x01
> -#define TPM_PT_BIND 0x02
> -#define TPM_PT_MIGRATE 0x03
> -#define TPM_PT_MAINT 0x04
> -#define TPM_PT_SEAL 0x05
> -
> -// TPM_ENTITY_TYPE values
> -#define TPM_ET_KEYHANDLE 0x0001
> -#define TPM_ET_OWNER 0x0002
> -#define TPM_ET_DATA 0x0003
> -#define TPM_ET_SRK 0x0004
> -#define TPM_ET_KEY 0x0005
> -
> -/// TPM_ResourceTypes
> -#define TPM_RT_KEY      0x00000001
> -#define TPM_RT_AUTH     0x00000002
> -#define TPM_RT_TRANS    0x00000004
> -#define TPM_RT_CONTEXT  0x00000005
> -
> -// TPM_PROTOCOL_ID values
> -#define TPM_PID_OIAP 0x0001
> -#define TPM_PID_OSAP 0x0002
> -#define TPM_PID_ADIP 0x0003
> -#define TPM_PID_ADCP 0x0004
> -#define TPM_PID_OWNER 0x0005
> -
> -// TPM_ALGORITHM_ID values
> -#define TPM_ALG_RSA 0x00000001
> -#define TPM_ALG_DES 0x00000002
> -#define TPM_ALG_3DES 0X00000003
> -#define TPM_ALG_SHA 0x00000004
> -#define TPM_ALG_HMAC 0x00000005
> -#define TCPA_ALG_AES 0x00000006
> -
> -// TPM_ENC_SCHEME values
> -#define TPM_ES_NONE 0x0001
> -#define TPM_ES_RSAESPKCSv15 0x0002
> -#define TPM_ES_RSAESOAEP_SHA1_MGF1 0x0003
> -
> -// TPM_SIG_SCHEME values
> -#define TPM_SS_NONE 0x0001
> -#define TPM_SS_RSASSAPKCS1v15_SHA1 0x0002
> -#define TPM_SS_RSASSAPKCS1v15_DER 0x0003
> -
> -// TPM_KEY_USAGE values
> -#define TPM_KEY_EK 0x0000
> -#define TPM_KEY_SIGNING 0x0010
> -#define TPM_KEY_STORAGE 0x0011
> -#define TPM_KEY_IDENTITY 0x0012
> -#define TPM_KEY_AUTHCHANGE 0X0013
> -#define TPM_KEY_BIND 0x0014
> -#define TPM_KEY_LEGACY 0x0015
> -
> -// TPM_AUTH_DATA_USAGE values
> -#define TPM_AUTH_NEVER 0x00
> -#define TPM_AUTH_ALWAYS 0x01
> -
> -// Key Handle of owner and srk
> -#define TPM_OWNER_KEYHANDLE 0x40000001
> -#define TPM_SRK_KEYHANDLE 0x40000000
> -
> -// ---------------------- Functions for checking TPM_RESULTs -----------------
> -
> -#include <stdio.h>
> -
> -// FIXME: Review use of these and delete unneeded ones.
> -
> -// these are really badly dependent on local structure:
> -// DEPENDS: local var 'status' of type TPM_RESULT
> -// DEPENDS: label 'abort_egress' which cleans up and returns the status
> -#define ERRORDIE(s) do { status = s; \
> -                         fprintf (stderr, "*** ERRORDIE in %s at %s: %i\n", __func__, __FILE__, __LINE__); \
> -                         goto abort_egress; } \
> -                    while (0)
> -
> -// DEPENDS: local var 'status' of type TPM_RESULT
> -// DEPENDS: label 'abort_egress' which cleans up and returns the status
> -// Try command c. If it fails, set status to s and goto abort.
> -#define TPMTRY(s,c) if (c != TPM_SUCCESS) { \
> -                       status = s; \
> -                       printf("ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
> -                       goto abort_egress; \
> -                    } else {\
> -                       status = c; \
> -                    }
> -
> -// Try command c. If it fails, print error message, set status to actual return code. Goto abort
> -#define TPMTRYRETURN(c) do { status = c; \
> -                             if (status != TPM_SUCCESS) { \
> -                               fprintf(stderr, "ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
> -                               goto abort_egress; \
> -                             } \
> -                        } while(0)
> -
> -
> -#pragma pack(pop)
> -
> -#endif //__TCPA_H__
> diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c
> index 3b89223..0ba1d55 100644
> --- a/tools/xenstore/hashtable.c
> +++ b/tools/xenstore/hashtable.c
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/blktap2/drivers/hashtable.c
> - *  - tools/vtpm_manager/util/hashtable.c
>   */
> 
>  #include "hashtable.h"
> diff --git a/tools/xenstore/hashtable.h b/tools/xenstore/hashtable.h
> index 8e6bb5b..4d68223 100644
> --- a/tools/xenstore/hashtable.h
> +++ b/tools/xenstore/hashtable.h
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/blktap2/drivers/hashtable.h
> - *  - tools/vtpm_manager/util/hashtable.h
>   */
> 
>  #ifndef __HASHTABLE_CWC22_H__
> diff --git a/tools/xenstore/hashtable_private.h b/tools/xenstore/hashtable_private.h
> index cabaffe..a08559d 100644
> --- a/tools/xenstore/hashtable_private.h
> +++ b/tools/xenstore/hashtable_private.h
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/blktap2/drivers/hashtable_private.h
> - *  - tools/vtpm_manager/util/hashtable_private.h
>   */
> 
>  #ifndef __HASHTABLE_PRIVATE_CWC22_H__
> diff --git a/tools/xm-test/configure.ac b/tools/xm-test/configure.ac
> index ad1eb78..c142140 100644
> --- a/tools/xm-test/configure.ac
> +++ b/tools/xm-test/configure.ac
> @@ -143,7 +143,6 @@ AC_CONFIG_FILES([
>      tests/unpause/Makefile
>      tests/vcpu-pin/Makefile
>      tests/vcpu-disable/Makefile
> -    tests/vtpm/Makefile
>      tests/xapi/Makefile
>      tests/enforce_dom0_cpus/Makefile
>      tests/cpupool/Makefile
> diff --git a/tools/xm-test/grouptest/default b/tools/xm-test/grouptest/default
> index f0516b2..e04591b 100644
> --- a/tools/xm-test/grouptest/default
> +++ b/tools/xm-test/grouptest/default
> @@ -27,5 +27,4 @@ sysrq
>  unpause
>  vcpu-disable
>  vcpu-pin
> -vtpm
>  xapi
> diff --git a/tools/xm-test/grouptest/medium b/tools/xm-test/grouptest/medium
> index bafc988..5c3e1b1 100644
> --- a/tools/xm-test/grouptest/medium
> +++ b/tools/xm-test/grouptest/medium
> @@ -22,4 +22,3 @@ sysrq 01_sysrq_basic_neg.test 02_sysrq_sync_pos.test
>  unpause
>  vcpu-disable
>  vcpu-pin
> -vtpm
> diff --git a/tools/xm-test/grouptest/xapi b/tools/xm-test/grouptest/xapi
> index 3b04921..7a08b77 100644
> --- a/tools/xm-test/grouptest/xapi
> +++ b/tools/xm-test/grouptest/xapi
> @@ -1,2 +1 @@
>  xapi
> -vtpm 09_vtpm-xapi.test
> diff --git a/tools/xm-test/lib/XmTestLib/XenDomain.py b/tools/xm-test/lib/XmTestLib/XenDomain.py
> index ae8c550..3ba7433 100644
> --- a/tools/xm-test/lib/XmTestLib/XenDomain.py
> +++ b/tools/xm-test/lib/XmTestLib/XenDomain.py
> @@ -59,7 +59,6 @@ class XenConfig:
>          # These options need to be lists
>          self.defaultOpts["disk"] = []
>          self.defaultOpts["vif"]  = []
> -        self.defaultOpts["vtpm"] = []
> 
>          self.opts = self.defaultOpts
> 
> diff --git a/tools/xm-test/tests/Makefile.am b/tools/xm-test/tests/Makefile.am
> index 8d673ed..455f50c 100644
> --- a/tools/xm-test/tests/Makefile.am
> +++ b/tools/xm-test/tests/Makefile.am
> @@ -25,7 +25,6 @@ SUBDIRS =                     \
>                 unpause         \
>                 vcpu-disable    \
>                 vcpu-pin        \
> -               vtpm            \
>                 enforce_dom0_cpus       \
>                 save restore migrate    \
>                 cpupool
> diff --git a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py b/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
> deleted file mode 100644
> index dfd1227..0000000
> --- a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
> +++ /dev/null
> @@ -1,40 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                verify list
> -
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -
> -try:
> -    domain.start(noConsole=True)
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    vtpm_cleanup(domain.getName())
> -    FAIL("Unable to create domain")
> -
> -
> -domName = domain.getName()
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -status, output = traceCommand("xm vtpm-list %s" % domain.getId())
> -eyecatcher = "/local/domain/0/backend/vtpm"
> -where = output.find(eyecatcher)
> -if status != 0:
> -    FAIL("xm vtpm-list returned bad status, expected 0, status is %i" % status)
> -elif where < 0:
> -    FAIL("Fail to list virtual TPM device")
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py b/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
> deleted file mode 100644
> index a18cbab..0000000
> --- a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
> +++ /dev/null
> @@ -1,49 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                check list of pcrs
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -domain.closeConsole()
> -
> -domain.stop()
> -
> -if not re.search("PCR-00:",run["output"]):
> -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> diff --git a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py b/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
> deleted file mode 100644
> index b863f27..0000000
> --- a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
> +++ /dev/null
> @@ -1,99 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                check list of pcrs; suspend and resume the domain and
> -#                check list of pcrs again
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm save %s %s.save" %
> -                                      (domName, domName),
> -                                      timeout=30)
> -
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm save did not succeed")
> -
> -    try:
> -        status, ouptut = traceCommand("xm restore %s.save" %
> -                                      (domName),
> -                                      timeout=30)
> -    except TimeoutError, e:
> -        os.remove("%s.save" % domName)
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    os.remove("%s.save" % domName)
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm restore did not succeed")
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL(str(e))
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> -
> diff --git a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py b/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
> deleted file mode 100644
> index ccc8b73..0000000
> --- a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
> +++ /dev/null
> @@ -1,93 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                check list of pcrs; locally migrate the domain and
> -#                check list of pcrs again
> -#                This test does local live migration.
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -old_domid = domid(domName)
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm migrate -l %s localhost" %
> -                                      domName,
> -                                      timeout=90)
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm migrate did not succeed. External device migration activated?")
> -
> -
> -    domName = domain.getName()
> -    new_domid = domid(domName)
> -
> -    if (old_domid == new_domid):
> -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> -             (old_domid,loop))
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL("No result from dumping the PCRs")
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py b/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py
> deleted file mode 100644
> index 57b87df..0000000
> --- a/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py
> +++ /dev/null
> @@ -1,93 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                check list of pcrs; locally migrate the domain and
> -#                check list of pcrs again
> -#                This test does local (non-live) migration.
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -old_domid = domid(domName)
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm migrate %s localhost" %
> -                                      domName,
> -                                      timeout=90)
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm migrate did not succeed. External device migration activated?")
> -
> -
> -    domName = domain.getName()
> -    new_domid = domid(domName)
> -
> -    if (old_domid == new_domid):
> -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> -             (old_domid,loop))
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL("No result from dumping the PCRs")
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py b/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
> deleted file mode 100644
> index c70691d..0000000
> --- a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
> +++ /dev/null
> @@ -1,125 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                extend a pcr
> -#                check list of pcrs; suspend and resume the domain and
> -#                check list of pcrs again and validate extended pcr
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("mknod /dev/tpm0 c 10 224")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while creating /dev/tpm0")
> -
> -try:
> -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while extending PCR 0")
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm save %s %s.save" %
> -                                      (domName, domName),
> -                                      timeout=30)
> -
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm save did not succeed")
> -
> -    try:
> -        status, ouptut = traceCommand("xm restore %s.save" %
> -                                      (domName),
> -                                      timeout=30)
> -    except TimeoutError, e:
> -        os.remove("%s.save" % domName)
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    os.remove("%s.save" % domName)
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm restore did not succeed")
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL(str(e))
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> -
> diff --git a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py b/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
> deleted file mode 100644
> index 4ff3360..0000000
> --- a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
> +++ /dev/null
> @@ -1,119 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                extend a pcr
> -#                check list of pcrs; locally migrate the domain and
> -#                check list of pcrs again and validate extended pcr
> -#                This test does local live migration.
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("mknod /dev/tpm0 c 10 224")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while creating /dev/tpm0")
> -
> -try:
> -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while extending PCR 0")
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -old_domid = domid(domName)
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm migrate -l %s localhost" %
> -                                      domName,
> -                                      timeout=90)
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm migrate did not succeed. External device migration activated?")
> -
> -
> -    domName = domain.getName()
> -    new_domid = domid(domName)
> -
> -    if (old_domid == new_domid):
> -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> -             (old_domid,loop))
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL("No result from dumping the PCRs")
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py b/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
> deleted file mode 100644
> index 27125fc..0000000
> --- a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
> +++ /dev/null
> @@ -1,119 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                extend a pcr
> -#                check list of pcrs; locally migrate the domain and
> -#                check list of pcrs again and validate extended pcr
> -#                This test does local (non-live) migration.
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("mknod /dev/tpm0 c 10 224")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while creating /dev/tpm0")
> -
> -try:
> -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while extending PCR 0")
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -old_domid = domid(domName)
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm migrate %s localhost" %
> -                                      domName,
> -                                      timeout=90)
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm migrate did not succeed. External device migration activated?")
> -
> -
> -    domName = domain.getName()
> -    new_domid = domid(domName)
> -
> -    if (old_domid == new_domid):
> -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> -             (old_domid,loop))
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL("No result from dumping the PCRs")
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py b/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
> deleted file mode 100644
> index a1aa8b3..0000000
> --- a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
> +++ /dev/null
> @@ -1,158 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Test to test the vtpm class through the Xen-API
> -#
> -# Tested methods:
> -#  VTPM: get_uuid, get_backend, get_by_uuid, get_record
> -#        create, destroy, get_VM
> -#  VM: get_VTPMS
> -
> -from XmTestLib import xapi
> -from XmTestLib.XenAPIDomain import XmTestAPIDomain
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -
> -VTPM_RECORD_KEYS = [ 'backend', 'VM', 'uuid', 'other_config' ]
> -
> -try:
> -    # XmTestAPIDomain tries to establish a connection to XenD
> -    domain = XmTestAPIDomain()
> -except Exception, e:
> -    SKIP("Skipping test. Error: %s" % str(e))
> -vm_uuid = domain.get_uuid()
> -
> -vtpmcfg = {}
> -vtpmcfg['backend'] = DOM0_UUID
> -vtpmcfg['VM'] = vm_uuid
> -
> -session = xapi.connect()
> -
> -vtpm_uuid = session.xenapi.VTPM.create(vtpmcfg)
> -
> -vtpm_be = session.xenapi.VTPM.get_backend(vtpm_uuid)
> -if vtpm_be != vtpmcfg['backend']:
> -    FAIL("vTPM's backend is in '%s', expected: '%s'" %
> -         (vtpm_be, vtpmcfg['backend']))
> -
> -vtpm_rec = session.xenapi.VTPM.get_record(vtpm_uuid)
> -
> -miss_keys = []
> -for k in VTPM_RECORD_KEYS:
> -    if k not in vtpm_rec.keys():
> -        miss_keys.append(k)
> -if len(miss_keys) > 0:
> -    FAIL("vTPM record is missing key(s): %s" % miss_keys)
> -
> -if vtpm_rec['uuid']  != vtpm_uuid:
> -    FAIL("vTPM record shows vtpm uuid '%s', expected: '%s'" %
> -         (vtpm_rec['uuid'], vtpm_uuid))
> -if vtpm_rec['VM']  != vm_uuid:
> -    FAIL("vTPM record shows VM uuid '%s', expected: '%s'" %
> -         (vtpm_rec['VM'], vm_uuid))
> -if vtpm_rec['backend'] != vtpmcfg['backend']:
> -    FAIL("vTPM record shows VM bakcned '%s', expected: '%s'" %
> -         (vtpm_rev['backend'], vtpmcfg['backend']))
> -
> -badkeys = []
> -keys = vtpm_rec.keys()
> -for k in keys:
> -    if k not in VTPM_RECORD_KEYS:
> -        badkeys.append(k)
> -if len(badkeys) > 0:
> -    FAIL("Unexpected attributes in result: %s" % badkeys)
> -
> -if vm_uuid != session.xenapi.VTPM.get_VM(vtpm_uuid):
> -    FAIL("VM uuid from VTPM.get_VM different (%s) than expected (%s)." %
> -         (vm_ref, vm_uuid))
> -
> -uuid = session.xenapi.VTPM.get_uuid(vtpm_uuid)
> -if uuid != vtpm_uuid:
> -    FAIL("vTPM from VTPM.get_uuid different (%s) than expected (%s)." %
> -         (uuid, vtpm_uuid))
> -
> -vtpm_ref = session.xenapi.VTPM.get_by_uuid(vtpm_uuid)
> -if vtpm_ref != vtpm_uuid:
> -    FAIL("vTPM from VTPM.get_by_uuid different (%s) than expected (%s)." %
> -         (vtpm_ref, vtpm_uuid))
> -
> -vm_vtpms = session.xenapi.VM.get_VTPMs(vm_uuid)
> -if len(vm_vtpms) != 1:
> -    FAIL("Number of vTPMs from get_VTPMs is (%d) not what was expected (%d)" %
> -         (len(vm_vtpms), 1))
> -if vtpm_uuid not in vm_vtpms:
> -    FAIL("Other vTPM uuid (%s) returned from VM.get_VTPMs than expected (%s)" %
> -         (vm_vtpms[0], vtpm_uuid))
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    FAIL("Unable to create domain.")
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("1. No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("1. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -try:
> -    session.xenapi.VTPM.destroy(vtpm_uuid)
> -    #Should never get here
> -    FAIL("Could destroy vTPM while VM is running")
> -except:
> -    pass
> -
> -rc = session.xenapi.VM.suspend(vm_uuid)
> -if rc:
> -    FAIL("Could not suspend VM")
> -
> -try:
> -    session.xenapi.VTPM.destroy(vtpm_uuid)
> -    #May not throw an exception in 'suspend' state
> -except:
> -    pass
> -
> -rc = session.xenapi.VM.resume(vm_uuid, False)
> -if rc:
> -    FAIL("Could not resume VM")
> -
> -try:
> -    console = domain.getConsole()
> -except ConsoleError, e:
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("2. No result from dumping the PCRs. vTPM has been removed?")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("2. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -domain.stop()
> -
> -try:
> -    session.xenapi.VTPM.destroy(vtpm_uuid)
> -except:
> -    FAIL("Could NOT destroy vTPM while domain is halted.")
> -
> -domain.destroy()
> diff --git a/tools/xm-test/tests/vtpm/Makefile.am b/tools/xm-test/tests/vtpm/Makefile.am
> deleted file mode 100644
> index dd67e45..0000000
> --- a/tools/xm-test/tests/vtpm/Makefile.am
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -SUBDIRS =
> -
> -TESTS = 01_vtpm-list_pos.test \
> -        02_vtpm-cat_pcrs.test \
> -        03_vtpm-susp_res.test \
> -        04_vtpm-loc_migr.test \
> -        05_vtpm-loc_migr.test \
> -        06_vtpm-susp_res_pcrs.test \
> -        07_vtpm-mig_pcrs.test \
> -        08_vtpm-mig_pcrs.test \
> -        09_vtpm-xapi.test
> -
> -XFAIL_TESTS =
> -
> -EXTRA_DIST = $(TESTS) $(XFAIL_TESTS) vtpm_utils.py
> -TESTS_ENVIRONMENT=@TENV@
> -
> -%.test: %.py
> -       cp $< $@
> -       chmod +x $@
> -
> -clean-local: am_config_clean-local
> -
> -am_config_clean-local:
> -       rm -f *test
> -       rm -f *log
> -       rm -f *~
> diff --git a/tools/xm-test/tests/vtpm/vtpm_utils.py b/tools/xm-test/tests/vtpm/vtpm_utils.py
> deleted file mode 100644
> index 4e5b281..0000000
> --- a/tools/xm-test/tests/vtpm/vtpm_utils.py
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -from XmTestLib import *
> -
> -if ENABLE_HVM_SUPPORT:
> -    SKIP("vtpm tests not supported for HVM domains")
> -
> -status, output = traceCommand("COLUMNS=200 ; "
> -                              "ps aux | grep vtpm_manager | grep -v grep")
> -if output == "":
> -    SKIP("virtual TPM manager must be started to run this test; might "
> -         "need /dev/tpm0")
> -
> -def vtpm_cleanup(domName):
> -    traceCommand("/etc/xen/scripts/vtpm-delete "
> -                 "`xenstore-read /local/domain/0/backend/vtpm/%s/0/uuid`" %
> -                 str(domid(domName)))
> -
> -def vtpm_cleanup(uuid):
> -    from xen.xm import main
> -    if main.serverType != main.SERVER_XEN_API:
> -        traceCommand("/etc/xen/scripts/vtpm-delete %s" % uuid)
> -
> -def vtpm_get_uuid(domainid):
> -    s, o = traceCommand("xenstore-read "
> -                        "/local/domain/0/backend/vtpm/%s/0/uuid" % domainid)
> -    return o
> --
> 1.7.10.4
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:16:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:16:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYFPs-0000Dh-Kp; Tue, 13 Nov 2012 12:16:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TYFPr-0000Db-Bv
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 12:16:31 +0000
Received: from [85.158.139.83:5439] by server-4.bemta-5.messagelabs.com id
	69/29-15011-E1A32A05; Tue, 13 Nov 2012 12:16:30 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352808988!29344601!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17916 invoked from network); 13 Nov 2012 12:16:29 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 12:16:29 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="214309935"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 12:16:27 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 07:16:27 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TYFPn-00054e-9x	for
	xen-devel@lists.xen.org; Tue, 13 Nov 2012 12:16:27 +0000
Message-ID: <50A23A1B.6030404@citrix.com>
Date: Tue, 13 Nov 2012 12:16:27 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel@lists.xen.org
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
In-Reply-To: <20121113120555.GC44675@ocelot.phlegethon.org>
X-Enigmail-Version: 1.4.5
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 13/11/12 12:05, Tim Deegan wrote:
> At 11:47 +0000 on 13 Nov (1352807234), Tim Deegan wrote:
>> At 11:38 +0000 on 13 Nov (1352806689), Jan Beulich wrote:
>>>> diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
>>>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>>>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>>>> @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
>>>>                   (X86_EVENTTYPE_NMI << 8) )
>>>>                  goto exit_and_crash;
>>>>              HVMTRACE_0D(NMI);
>>>> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>>>> +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
>>> In any case - why can't you call do_nmi() directly from here?
>> ... this is my doing.  There used to be a call to do_nmi() here, but
>> do_nmi() doesn't block NMIs, so you can't just call it here in case you
>> get _another_ NMI while you're in the NMI handler.
> Oh wait, I see -- you're saying that this (20059:76a65bf2aa4d) is wrong
> because NMIs are indeed blocked, and have been since the VMEXIT.
>
> In that case, I agree that we should just run the NMI handler, but first
> I would really like to know what _unblocks_ NMIs in this case.  Any of
> the things I can think of (the next vmenter, the next iret, ??) will
> need some handling to make sure they actually happen before, say, we
> take this CPU into the idle loop...
>
> Tim.

The first experiment was to have self_nmi() wait until the NMI count for
the current processor changed.  This prevented the thousands of bounces
in and out of non-root mode, but the enter delays fairly consistently in
the millions of TSC ticks (a few milliseconds on the test box), which is
a noticeable chunk of time.

~Andrew

>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:16:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:16:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYFPs-0000Dh-Kp; Tue, 13 Nov 2012 12:16:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TYFPr-0000Db-Bv
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 12:16:31 +0000
Received: from [85.158.139.83:5439] by server-4.bemta-5.messagelabs.com id
	69/29-15011-E1A32A05; Tue, 13 Nov 2012 12:16:30 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352808988!29344601!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17916 invoked from network); 13 Nov 2012 12:16:29 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 12:16:29 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="214309935"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 12:16:27 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 07:16:27 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TYFPn-00054e-9x	for
	xen-devel@lists.xen.org; Tue, 13 Nov 2012 12:16:27 +0000
Message-ID: <50A23A1B.6030404@citrix.com>
Date: Tue, 13 Nov 2012 12:16:27 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel@lists.xen.org
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
In-Reply-To: <20121113120555.GC44675@ocelot.phlegethon.org>
X-Enigmail-Version: 1.4.5
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 13/11/12 12:05, Tim Deegan wrote:
> At 11:47 +0000 on 13 Nov (1352807234), Tim Deegan wrote:
>> At 11:38 +0000 on 13 Nov (1352806689), Jan Beulich wrote:
>>>> diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
>>>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>>>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>>>> @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
>>>>                   (X86_EVENTTYPE_NMI << 8) )
>>>>                  goto exit_and_crash;
>>>>              HVMTRACE_0D(NMI);
>>>> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>>>> +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
>>> In any case - why can't you call do_nmi() directly from here?
>> ... this is my doing.  There used to be a call to do_nmi() here, but
>> do_nmi() doesn't block NMIs, so you can't just call it here in case you
>> get _another_ NMI while you're in the NMI handler.
> Oh wait, I see -- you're saying that this (20059:76a65bf2aa4d) is wrong
> because NMIs are indeed blocked, and have been since the VMEXIT.
>
> In that case, I agree that we should just run the NMI handler, but first
> I would really like to know what _unblocks_ NMIs in this case.  Any of
> the things I can think of (the next vmenter, the next iret, ??) will
> need some handling to make sure they actually happen before, say, we
> take this CPU into the idle loop...
>
> Tim.

The first experiment was to have self_nmi() wait until the NMI count for
the current processor changed.  This prevented the thousands of bounces
in and out of non-root mode, but the enter delays fairly consistently in
the millions of TSC ticks (a few milliseconds on the test box), which is
a noticeable chunk of time.

~Andrew

>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:17:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:17:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYFQq-0000Hn-3T; Tue, 13 Nov 2012 12:17:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYFQo-0000HY-FY
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 12:17:30 +0000
Received: from [193.109.254.147:49414] by server-14.bemta-14.messagelabs.com
	id 76/BF-14517-95A32A05; Tue, 13 Nov 2012 12:17:29 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1352808950!8923504!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26058 invoked from network); 13 Nov 2012 12:15:55 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-9.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 12:15:55 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYFPB-000C8b-2T; Tue, 13 Nov 2012 12:15:49 +0000
Date: Tue, 13 Nov 2012 12:15:49 +0000
From: Tim Deegan <tim@xen.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121113121549.GD44675@ocelot.phlegethon.org>
References: <20121024155945.GD39126@ocelot.phlegethon.org>
	<alpine.DEB.2.02.1210241706160.2689@kaball.uk.xensource.com>
	<20121026090141.GB76080@ocelot.phlegethon.org>
	<alpine.DEB.2.02.1210261646490.2689@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1210261654590.2689@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1210261700310.2689@kaball.uk.xensource.com>
	<20121026165549.GF76080@ocelot.phlegethon.org>
	<alpine.DEB.2.02.1210261937180.2689@kaball.uk.xensource.com>
	<20121027104428.GB89901@ocelot.phlegethon.org>
	<alpine.DEB.2.02.1211131159060.28049@kaball.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1211131159060.28049@kaball.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH 6/7] xen/arm: flush D-cache and I-cache when
	appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 12:01 +0000 on 13 Nov (1352808094), Stefano Stabellini wrote:
> > I think we should have two functions.  One should look almost like that
> > and be for flushing large ranges, and one much simpler for flushing
> > small items.  Like this (totally untested, uncompiled even):
> > 
> >  #define MIN_CACHELINE_BYTES 32 // or whatever
> > 
> >  /* In setup.c somewhere. */
> >  if ( READ_CP32(CCSIDR) < MIN_CACHELINE_BYTES )
> >      panic("CPU has preposterously small cache lines");
> > 
> >  /* Function for flushing medium-sized areas.
> >   * if 'range' is large enough we might want to use model-specific
> >   * full-cache flushes. */
> >  static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
> >  {
> >      void *end;
> >      unsigned long cacheline_bytes = READ_CP32(CCSIDR);
> >      barrier();       /* So the compiler issues all writes to the range */
> >      dsb();           /* So the CPU issues all writes to the range */ 
> >      for ( end = p + size; p < end; p += cacheline_bytes )
> >          WRITE_CP32(DCCMVAC, p);
> >      dsb();           /* So we know the flushes happen before continuing */
> >  }
> > 
> >  /* Macro for flushing a single small item.  The predicate is always 
> >   * compile-time constant so this will compile down to 3 instructions in
> >   * the common case.  Make sure to call it with the correct type of
> >   * pointer! */
> >  #define flush_xen_dcache_va(p) do {                       \
> >      typeof(p) _p = (p);                                   \
> >      if ( (sizeof *_p) > MIN_CACHELINE_BYTES )             \
> >          flush_xen_dcache_va_range(_p, sizeof *_p);        \
> >      else                                                  \
> >          asm volatile (                                    \
> >              "dsb;"   /* Finish all earlier writes */      \
> >              STORE_CP32(0, DCCMVAC)                        \
> >              "dsb;"   /* Finish flush before continuing */ \
> >              : : "r" (_p), "m" (*_p));                     \
> >  } while (0)
> > 
> > What do you think?
> 
> I think that is OK, but I would like to avoid reading CCSIDR every
> single time we need to do a dcache flush

The code above only reads it once for each large dcache flush.  When I
was writing it I did think of just stashing cacheline_bytes in a
read_mostly somewhere, but I had the opposite concern -- wouldn't
reading this constant from on-chip be quicker than going to the memory
bus for it? :)

I'm happy either way.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:17:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:17:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYFQq-0000Hn-3T; Tue, 13 Nov 2012 12:17:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYFQo-0000HY-FY
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 12:17:30 +0000
Received: from [193.109.254.147:49414] by server-14.bemta-14.messagelabs.com
	id 76/BF-14517-95A32A05; Tue, 13 Nov 2012 12:17:29 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1352808950!8923504!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26058 invoked from network); 13 Nov 2012 12:15:55 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-9.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 12:15:55 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYFPB-000C8b-2T; Tue, 13 Nov 2012 12:15:49 +0000
Date: Tue, 13 Nov 2012 12:15:49 +0000
From: Tim Deegan <tim@xen.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121113121549.GD44675@ocelot.phlegethon.org>
References: <20121024155945.GD39126@ocelot.phlegethon.org>
	<alpine.DEB.2.02.1210241706160.2689@kaball.uk.xensource.com>
	<20121026090141.GB76080@ocelot.phlegethon.org>
	<alpine.DEB.2.02.1210261646490.2689@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1210261654590.2689@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1210261700310.2689@kaball.uk.xensource.com>
	<20121026165549.GF76080@ocelot.phlegethon.org>
	<alpine.DEB.2.02.1210261937180.2689@kaball.uk.xensource.com>
	<20121027104428.GB89901@ocelot.phlegethon.org>
	<alpine.DEB.2.02.1211131159060.28049@kaball.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1211131159060.28049@kaball.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH 6/7] xen/arm: flush D-cache and I-cache when
	appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 12:01 +0000 on 13 Nov (1352808094), Stefano Stabellini wrote:
> > I think we should have two functions.  One should look almost like that
> > and be for flushing large ranges, and one much simpler for flushing
> > small items.  Like this (totally untested, uncompiled even):
> > 
> >  #define MIN_CACHELINE_BYTES 32 // or whatever
> > 
> >  /* In setup.c somewhere. */
> >  if ( READ_CP32(CCSIDR) < MIN_CACHELINE_BYTES )
> >      panic("CPU has preposterously small cache lines");
> > 
> >  /* Function for flushing medium-sized areas.
> >   * if 'range' is large enough we might want to use model-specific
> >   * full-cache flushes. */
> >  static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
> >  {
> >      void *end;
> >      unsigned long cacheline_bytes = READ_CP32(CCSIDR);
> >      barrier();       /* So the compiler issues all writes to the range */
> >      dsb();           /* So the CPU issues all writes to the range */ 
> >      for ( end = p + size; p < end; p += cacheline_bytes )
> >          WRITE_CP32(DCCMVAC, p);
> >      dsb();           /* So we know the flushes happen before continuing */
> >  }
> > 
> >  /* Macro for flushing a single small item.  The predicate is always 
> >   * compile-time constant so this will compile down to 3 instructions in
> >   * the common case.  Make sure to call it with the correct type of
> >   * pointer! */
> >  #define flush_xen_dcache_va(p) do {                       \
> >      typeof(p) _p = (p);                                   \
> >      if ( (sizeof *_p) > MIN_CACHELINE_BYTES )             \
> >          flush_xen_dcache_va_range(_p, sizeof *_p);        \
> >      else                                                  \
> >          asm volatile (                                    \
> >              "dsb;"   /* Finish all earlier writes */      \
> >              STORE_CP32(0, DCCMVAC)                        \
> >              "dsb;"   /* Finish flush before continuing */ \
> >              : : "r" (_p), "m" (*_p));                     \
> >  } while (0)
> > 
> > What do you think?
> 
> I think that is OK, but I would like to avoid reading CCSIDR every
> single time we need to do a dcache flush

The code above only reads it once for each large dcache flush.  When I
was writing it I did think of just stashing cacheline_bytes in a
read_mostly somewhere, but I had the opposite concern -- wouldn't
reading this constant from on-chip be quicker than going to the memory
bus for it? :)

I'm happy either way.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:18:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:18:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYFR8-0000KF-Ge; Tue, 13 Nov 2012 12:17:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYFR7-0000Jt-7o
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 12:17:49 +0000
Received: from [85.158.139.211:54347] by server-14.bemta-5.messagelabs.com id
	8D/6B-21768-C6A32A05; Tue, 13 Nov 2012 12:17:48 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1352809067!19932461!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16696 invoked from network); 13 Nov 2012 12:17:47 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 12:17:47 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15776236"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 12:17:31 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 12:17:30 +0000
Message-ID: <1352809049.7491.70.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Tue, 13 Nov 2012 12:17:29 +0000
In-Reply-To: <20121113120555.GC44675@ocelot.phlegethon.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 12:05 +0000, Tim Deegan wrote:
> At 11:47 +0000 on 13 Nov (1352807234), Tim Deegan wrote:
> > At 11:38 +0000 on 13 Nov (1352806689), Jan Beulich wrote:
> > > > diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
> > > > --- a/xen/arch/x86/hvm/vmx/vmx.c
> > > > +++ b/xen/arch/x86/hvm/vmx/vmx.c
> > > > @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
> > > >                   (X86_EVENTTYPE_NMI << 8) )
> > > >                  goto exit_and_crash;
> > > >              HVMTRACE_0D(NMI);
> > > > -            self_nmi(); /* Real NMI, vector 2: normal processing. */
> > > > +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
> > > 
> > > In any case - why can't you call do_nmi() directly from here?
> > 
> > ... this is my doing.  There used to be a call to do_nmi() here, but
> > do_nmi() doesn't block NMIs, so you can't just call it here in case you
> > get _another_ NMI while you're in the NMI handler.
> 
> Oh wait, I see -- you're saying that this (20059:76a65bf2aa4d) is wrong
> because NMIs are indeed blocked, and have been since the VMEXIT.
> 
> In that case, I agree that we should just run the NMI handler, but first
> I would really like to know what _unblocks_ NMIs in this case.  Any of
> the things I can think of (the next vmenter, the next iret, ??) will
> need some handling to make sure they actually happen before, say, we
> take this CPU into the idle loop...

What about a little stub-asm return_from_nmi / reenable_nmis with
something like:
	pushf
        pushq $__HYPERVISOR_CS
	pushq 1f
	iret
1: ...

That should re-enable NMIs at whichever point we think is appropriate?
Perhaps a little more work is needed to create a suitable frame under
this one too, not sure what a vmexit frame looks like.

I hope we aren't going to get into the NMI nesting problem described
here: http://lwn.net/Articles/484932/ (I don't think so, no page-faults
or break points in our NMI handlers)

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:18:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:18:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYFR8-0000KF-Ge; Tue, 13 Nov 2012 12:17:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYFR7-0000Jt-7o
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 12:17:49 +0000
Received: from [85.158.139.211:54347] by server-14.bemta-5.messagelabs.com id
	8D/6B-21768-C6A32A05; Tue, 13 Nov 2012 12:17:48 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1352809067!19932461!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16696 invoked from network); 13 Nov 2012 12:17:47 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 12:17:47 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="15776236"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 12:17:31 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 12:17:30 +0000
Message-ID: <1352809049.7491.70.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Tue, 13 Nov 2012 12:17:29 +0000
In-Reply-To: <20121113120555.GC44675@ocelot.phlegethon.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 12:05 +0000, Tim Deegan wrote:
> At 11:47 +0000 on 13 Nov (1352807234), Tim Deegan wrote:
> > At 11:38 +0000 on 13 Nov (1352806689), Jan Beulich wrote:
> > > > diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
> > > > --- a/xen/arch/x86/hvm/vmx/vmx.c
> > > > +++ b/xen/arch/x86/hvm/vmx/vmx.c
> > > > @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
> > > >                   (X86_EVENTTYPE_NMI << 8) )
> > > >                  goto exit_and_crash;
> > > >              HVMTRACE_0D(NMI);
> > > > -            self_nmi(); /* Real NMI, vector 2: normal processing. */
> > > > +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
> > > 
> > > In any case - why can't you call do_nmi() directly from here?
> > 
> > ... this is my doing.  There used to be a call to do_nmi() here, but
> > do_nmi() doesn't block NMIs, so you can't just call it here in case you
> > get _another_ NMI while you're in the NMI handler.
> 
> Oh wait, I see -- you're saying that this (20059:76a65bf2aa4d) is wrong
> because NMIs are indeed blocked, and have been since the VMEXIT.
> 
> In that case, I agree that we should just run the NMI handler, but first
> I would really like to know what _unblocks_ NMIs in this case.  Any of
> the things I can think of (the next vmenter, the next iret, ??) will
> need some handling to make sure they actually happen before, say, we
> take this CPU into the idle loop...

What about a little stub-asm return_from_nmi / reenable_nmis with
something like:
	pushf
        pushq $__HYPERVISOR_CS
	pushq 1f
	iret
1: ...

That should re-enable NMIs at whichever point we think is appropriate?
Perhaps a little more work is needed to create a suitable frame under
this one too, not sure what a vmexit frame looks like.

I hope we aren't going to get into the NMI nesting problem described
here: http://lwn.net/Articles/484932/ (I don't think so, no page-faults
or break points in our NMI handlers)

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:24:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:24:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYFXC-0000ja-B6; Tue, 13 Nov 2012 12:24:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYFXA-0000jV-5v
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 12:24:04 +0000
Received: from [85.158.139.211:8954] by server-14.bemta-5.messagelabs.com id
	AB/9B-21768-3EB32A05; Tue, 13 Nov 2012 12:24:03 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1352809441!20027359!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10655 invoked from network); 13 Nov 2012 12:24:02 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 12:24:02 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="44390847"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 12:24:01 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 07:24:00 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYFX6-0005CZ-De;
	Tue, 13 Nov 2012 12:24:00 +0000
Date: Tue, 13 Nov 2012 12:23:28 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1352808054.7491.66.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211131222410.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1210241455080.2689@kaball.uk.xensource.com>
	<1351091027-20740-1-git-send-email-stefano.stabellini@eu.citrix.com>
	<1351157246.18035.129.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1210261732000.2689@kaball.uk.xensource.com>
	<1351269622.15162.105.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1210261940300.2689@kaball.uk.xensource.com>
	<1351284440.12176.9.camel@dagon.hellion.org.uk>
	<20121027100929.GA89901@ocelot.phlegethon.org>
	<alpine.DEB.2.02.1211131156270.28049@kaball.uk.xensource.com>
	<1352808054.7491.66.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/7] xen/arm: fix rank calculation in
 vgic_vcpu_inject_irq
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 13 Nov 2012, Ian Campbell wrote:
> On Tue, 2012-11-13 at 11:57 +0000, Stefano Stabellini wrote:
> > On Sat, 27 Oct 2012, Tim Deegan wrote:
> > > At 21:47 +0100 on 26 Oct (1351288040), Ian Campbell wrote:
> > > > On Fri, 2012-10-26 at 19:42 +0100, Stefano Stabellini wrote:
> > > > > I think that the problem is the usage of vgic_irq_rank with registers
> > > > > that have 1 bit per interrupt.
> > > > 
> > > > That's very plausible indeed.
> > > > 
> > > > > diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
> > > > > index 3c3983f..92731b6 100644
> > > > > --- a/xen/arch/arm/vgic.c
> > > > > +++ b/xen/arch/arm/vgic.c
> > > > > @@ -42,13 +42,7 @@
> > > > >   */
> > > > >  static inline int REG_RANK_NR(int b, uint32_t n)
> > > > >  {
> > > > > -    switch ( b )
> > > > > -    {
> > > > > -    case 8: return n >> 3;
> > > > > -    case 4: return n >> 2;
> > > > > -    case 2: return n >> 1;
> > > > > -    default: BUG();
> > > > > -    }
> > > > > +    return n / b;
> > > > 
> > > > All the infrastructure will fall apart if b isn't a power of two, that's
> > > > why I used the switch. Can you just add the appropriate case 1 instead?
> > > > Probably the bug should be a call to an undefined function to make this
> > > > a compile time rather than runtime failure too.
> > > 
> > > BUILD_BUG_ON((b & -b) != b); ?
> > 
> > I can't do that:
> > 
> > error: expression in static assertion is not constant
> 
> I suppose you could make REG_RANK_NR a macro (as it's name implies it
> ought to be, oops!).
> 

REG_RANK_NR is called by vgic_irq_rank, so that would need to become a
macro too


> If not then given that b must be in {1,2,4,8} maybe the switch is
> ok/tolerable? If we end up supporting b=16 or 32 then more thought is
> probably required around the place anyway.

yeah I think is OK

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:24:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:24:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYFXC-0000ja-B6; Tue, 13 Nov 2012 12:24:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYFXA-0000jV-5v
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 12:24:04 +0000
Received: from [85.158.139.211:8954] by server-14.bemta-5.messagelabs.com id
	AB/9B-21768-3EB32A05; Tue, 13 Nov 2012 12:24:03 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1352809441!20027359!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10655 invoked from network); 13 Nov 2012 12:24:02 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 12:24:02 -0000
X-IronPort-AV: E=Sophos;i="4.80,765,1344211200"; d="scan'208";a="44390847"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 12:24:01 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 07:24:00 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYFX6-0005CZ-De;
	Tue, 13 Nov 2012 12:24:00 +0000
Date: Tue, 13 Nov 2012 12:23:28 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1352808054.7491.66.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211131222410.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1210241455080.2689@kaball.uk.xensource.com>
	<1351091027-20740-1-git-send-email-stefano.stabellini@eu.citrix.com>
	<1351157246.18035.129.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1210261732000.2689@kaball.uk.xensource.com>
	<1351269622.15162.105.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1210261940300.2689@kaball.uk.xensource.com>
	<1351284440.12176.9.camel@dagon.hellion.org.uk>
	<20121027100929.GA89901@ocelot.phlegethon.org>
	<alpine.DEB.2.02.1211131156270.28049@kaball.uk.xensource.com>
	<1352808054.7491.66.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/7] xen/arm: fix rank calculation in
 vgic_vcpu_inject_irq
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 13 Nov 2012, Ian Campbell wrote:
> On Tue, 2012-11-13 at 11:57 +0000, Stefano Stabellini wrote:
> > On Sat, 27 Oct 2012, Tim Deegan wrote:
> > > At 21:47 +0100 on 26 Oct (1351288040), Ian Campbell wrote:
> > > > On Fri, 2012-10-26 at 19:42 +0100, Stefano Stabellini wrote:
> > > > > I think that the problem is the usage of vgic_irq_rank with registers
> > > > > that have 1 bit per interrupt.
> > > > 
> > > > That's very plausible indeed.
> > > > 
> > > > > diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
> > > > > index 3c3983f..92731b6 100644
> > > > > --- a/xen/arch/arm/vgic.c
> > > > > +++ b/xen/arch/arm/vgic.c
> > > > > @@ -42,13 +42,7 @@
> > > > >   */
> > > > >  static inline int REG_RANK_NR(int b, uint32_t n)
> > > > >  {
> > > > > -    switch ( b )
> > > > > -    {
> > > > > -    case 8: return n >> 3;
> > > > > -    case 4: return n >> 2;
> > > > > -    case 2: return n >> 1;
> > > > > -    default: BUG();
> > > > > -    }
> > > > > +    return n / b;
> > > > 
> > > > All the infrastructure will fall apart if b isn't a power of two, that's
> > > > why I used the switch. Can you just add the appropriate case 1 instead?
> > > > Probably the bug should be a call to an undefined function to make this
> > > > a compile time rather than runtime failure too.
> > > 
> > > BUILD_BUG_ON((b & -b) != b); ?
> > 
> > I can't do that:
> > 
> > error: expression in static assertion is not constant
> 
> I suppose you could make REG_RANK_NR a macro (as it's name implies it
> ought to be, oops!).
> 

REG_RANK_NR is called by vgic_irq_rank, so that would need to become a
macro too


> If not then given that b must be in {1,2,4,8} maybe the switch is
> ok/tolerable? If we end up supporting b=16 or 32 then more thought is
> probably required around the place anyway.

yeah I think is OK

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:39:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:39:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYFlu-0000yU-O8; Tue, 13 Nov 2012 12:39:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYFlt-0000yP-UM
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 12:39:18 +0000
Received: from [85.158.139.211:13284] by server-16.bemta-5.messagelabs.com id
	0C/E6-04786-57F32A05; Tue, 13 Nov 2012 12:39:17 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1352810355!20004639!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1354 invoked from network); 13 Nov 2012 12:39:16 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-4.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 12:39:16 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYFlm-000CCx-VF; Tue, 13 Nov 2012 12:39:10 +0000
Date: Tue, 13 Nov 2012 12:39:10 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121113123910.GE44675@ocelot.phlegethon.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
	<1352809049.7491.70.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352809049.7491.70.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	Jan Beulich <JBeulich@suse.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
	process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 12:17 +0000 on 13 Nov (1352809049), Ian Campbell wrote:
> On Tue, 2012-11-13 at 12:05 +0000, Tim Deegan wrote:
> > At 11:47 +0000 on 13 Nov (1352807234), Tim Deegan wrote:
> > > At 11:38 +0000 on 13 Nov (1352806689), Jan Beulich wrote:
> > > > > diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
> > > > > --- a/xen/arch/x86/hvm/vmx/vmx.c
> > > > > +++ b/xen/arch/x86/hvm/vmx/vmx.c
> > > > > @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
> > > > >                   (X86_EVENTTYPE_NMI << 8) )
> > > > >                  goto exit_and_crash;
> > > > >              HVMTRACE_0D(NMI);
> > > > > -            self_nmi(); /* Real NMI, vector 2: normal processing. */
> > > > > +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
> > > > 
> > > > In any case - why can't you call do_nmi() directly from here?
> > > 
> > > ... this is my doing.  There used to be a call to do_nmi() here, but
> > > do_nmi() doesn't block NMIs, so you can't just call it here in case you
> > > get _another_ NMI while you're in the NMI handler.
> > 
> > Oh wait, I see -- you're saying that this (20059:76a65bf2aa4d) is wrong
> > because NMIs are indeed blocked, and have been since the VMEXIT.
> > 
> > In that case, I agree that we should just run the NMI handler, but first
> > I would really like to know what _unblocks_ NMIs in this case.  Any of
> > the things I can think of (the next vmenter, the next iret, ??) will
> > need some handling to make sure they actually happen before, say, we
> > take this CPU into the idle loop...
> 
> What about a little stub-asm return_from_nmi / reenable_nmis with
> something like:
> 	pushf
>         pushq $__HYPERVISOR_CS
> 	pushq 1f
> 	iret
> 1: ...
> 
> That should re-enable NMIs at whichever point we think is appropriate?

If an iret is what's needed then replacing self_nmi() with 'int $2'
(i.e. the proposed patch) seems like a neater fix.  And section 6.7.1 of
the manual suggests that iret is indeed what we want, so:

Acked-by: Tim Deegan <tim@xen.org>

Cheers,

Tim

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:39:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:39:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYFlu-0000yU-O8; Tue, 13 Nov 2012 12:39:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYFlt-0000yP-UM
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 12:39:18 +0000
Received: from [85.158.139.211:13284] by server-16.bemta-5.messagelabs.com id
	0C/E6-04786-57F32A05; Tue, 13 Nov 2012 12:39:17 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1352810355!20004639!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1354 invoked from network); 13 Nov 2012 12:39:16 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-4.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 12:39:16 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYFlm-000CCx-VF; Tue, 13 Nov 2012 12:39:10 +0000
Date: Tue, 13 Nov 2012 12:39:10 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121113123910.GE44675@ocelot.phlegethon.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
	<1352809049.7491.70.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352809049.7491.70.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	Jan Beulich <JBeulich@suse.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
	process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 12:17 +0000 on 13 Nov (1352809049), Ian Campbell wrote:
> On Tue, 2012-11-13 at 12:05 +0000, Tim Deegan wrote:
> > At 11:47 +0000 on 13 Nov (1352807234), Tim Deegan wrote:
> > > At 11:38 +0000 on 13 Nov (1352806689), Jan Beulich wrote:
> > > > > diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
> > > > > --- a/xen/arch/x86/hvm/vmx/vmx.c
> > > > > +++ b/xen/arch/x86/hvm/vmx/vmx.c
> > > > > @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
> > > > >                   (X86_EVENTTYPE_NMI << 8) )
> > > > >                  goto exit_and_crash;
> > > > >              HVMTRACE_0D(NMI);
> > > > > -            self_nmi(); /* Real NMI, vector 2: normal processing. */
> > > > > +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
> > > > 
> > > > In any case - why can't you call do_nmi() directly from here?
> > > 
> > > ... this is my doing.  There used to be a call to do_nmi() here, but
> > > do_nmi() doesn't block NMIs, so you can't just call it here in case you
> > > get _another_ NMI while you're in the NMI handler.
> > 
> > Oh wait, I see -- you're saying that this (20059:76a65bf2aa4d) is wrong
> > because NMIs are indeed blocked, and have been since the VMEXIT.
> > 
> > In that case, I agree that we should just run the NMI handler, but first
> > I would really like to know what _unblocks_ NMIs in this case.  Any of
> > the things I can think of (the next vmenter, the next iret, ??) will
> > need some handling to make sure they actually happen before, say, we
> > take this CPU into the idle loop...
> 
> What about a little stub-asm return_from_nmi / reenable_nmis with
> something like:
> 	pushf
>         pushq $__HYPERVISOR_CS
> 	pushq 1f
> 	iret
> 1: ...
> 
> That should re-enable NMIs at whichever point we think is appropriate?

If an iret is what's needed then replacing self_nmi() with 'int $2'
(i.e. the proposed patch) seems like a neater fix.  And section 6.7.1 of
the manual suggests that iret is indeed what we want, so:

Acked-by: Tim Deegan <tim@xen.org>

Cheers,

Tim

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 12:56:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:56:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYG2P-0001IA-BU; Tue, 13 Nov 2012 12:56:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2O-0001Hx-2h; Tue, 13 Nov 2012 12:56:20 +0000
Received: from [85.158.143.99:57901] by server-3.bemta-4.messagelabs.com id
	CD/54-06841-17342A05; Tue, 13 Nov 2012 12:56:17 +0000
X-Env-Sender: iwj@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1352811375!18805688!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3583 invoked from network); 13 Nov 2012 12:56:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Nov 2012 12:56:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2B-0008Tx-Gv; Tue, 13 Nov 2012 12:56:07 +0000
Received: from iwj by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2A-0000z4-Uh; Tue, 13 Nov 2012 12:56:06 +0000
Date: Tue, 13 Nov 2012 12:56:06 +0000
Message-Id: <E1TYG2A-0000z4-Uh@xenbits.xen.org>
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.428 (Entity 5.428)
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
	xen-users@lists.xen.org, oss-security@lists.openwall.com
From: Xen.org security team <security@xen.org>
Cc: "Xen.org security team" <security@xen.org>
Subject: [Xen-devel] Xen Security Advisory 20 (CVE-2012-4535) - Timer
 overflow DoS vulnerability
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--=separator
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

                 Xen Security Advisory CVE-2012-4535 / XSA-20
                                version 2

                       Timer overflow DoS vulnerability

UPDATES IN VERSION 2
====================

Public release.

ISSUE DESCRIPTION
=================

A guest which sets a VCPU with an inappropriate deadline can cause an
infinite loop in Xen, blocking the affected physical CPU
indefinitely.

IMPACT
======

A malicious guest administrator can trigger the bug.  If the Xen
watchdog is enabled, the whole system will crash.  Otherwise the guest
can cause the system to become completely unresponsive.

VULNERABLE SYSTEMS
==================

All versions of Xen from at least 3.4 onwards are vulnerable, to every
kind of guest.

Systems with only trusted guest kernels are not vulnerable.

MITIGATION
==========

There is no mitigation available other than to use a trusted guest
kernel.

RESOLUTION
==========

The attached patch resolves this issue.  The same patch is applicable
to all affected versions.

$ sha256sum xsa20.patch
954f43a3b912d551b6534d3962d0bab3db820222a3bff211b545e526f9161c71  xsa20.patch
$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJQokGkAAoJEIP+FMlX6CvZzB0H/2H7Z/zxYOQtC2QLT77voNvI
/dCGnO+tUxcn9zsPOTkQjTmd7XrSaCdV9IoKmssZCwTBlHzRiwvFWQBinqrU8SZb
8UCv4O1zxg4Ygv/9nlJVxI8Xq9+uyxc/RaMeKlMCsW2rSKut9zmHI9HU+FT5kqG9
0vEXhZW4/MwOFbH+03LoHgjXqW8LOLNZtBg9u5rF5iCDLnltdAC//3kFXA5UG391
JAzAdBUOOaf2OAnL4tEpEV6ksmeaxjckg63P5T61MUqiFJo/5AL5tu0kEKGHF7jH
X4tDkSoV7Rbma4kNN3SbYjAkYGtsrGDeVS7HlhPbyZpKQVUJN+bSMYto3r8lVMM=
=nj9Z
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa20.patch"
Content-Disposition: attachment; filename="xsa20.patch"
Content-Transfer-Encoding: base64

VkNQVS90aW1lcnM6IFByZXZlbnQgb3ZlcmZsb3cgaW4gY2FsY3VsYXRpb25z
LCBsZWFkaW5nIHRvIERvUyB2dWxuZXJhYmlsaXR5CgpUaGUgdGltZXIgYWN0
aW9uIGZvciBhIHZjcHUgcGVyaW9kaWMgdGltZXIgaXMgdG8gY2FsY3VsYXRl
IHRoZSBuZXh0CmV4cGlyeSB0aW1lLCBhbmQgdG8gcmVpbnNlcnQgaXRzZWxm
IGludG8gdGhlIHRpbWVyIHF1ZXVlLiAgSWYgdGhlCmRlYWRsaW5lIGVuZHMg
dXAgaW4gdGhlIHBhc3QsIFhlbiBuZXZlciBsZWF2ZXMgX19kb19zb2Z0aXJx
KCkuICBUaGUKYWZmZWN0ZWQgUENQVSB3aWxsIHN0YXkgaW4gYW4gaW5maW5p
dGUgbG9vcCB1bnRpbCBYZW4gaXMga2lsbGVkIGJ5IHRoZQp3YXRjaGRvZyAo
aWYgZW5hYmxlZCkuCgpUaGlzIGlzIGEgc2VjdXJpdHkgcHJvYmxlbSwgWFNB
LTIwIC8gQ1ZFLTIwMTItNDUzNS4KClNpZ25lZC1vZmYtYnk6IEFuZHJldyBD
b29wZXIgPGFuZHJldy5jb29wZXIzQGNpdHJpeC5jb20+CkFja2VkLWJ5OiBJ
YW4gQ2FtcGJlbGwgPGlhbi5jYW1wYmVsbEBjaXRyaXguY29tPgoKZGlmZiAt
ciA0NzhiYTNmMTQ2ZGYgeGVuL2NvbW1vbi9kb21haW4uYwotLS0gYS94ZW4v
Y29tbW9uL2RvbWFpbi5jCisrKyBiL3hlbi9jb21tb24vZG9tYWluLmMKQEAg
LTkwMyw2ICs5MDMsOSBAQCBsb25nIGRvX3ZjcHVfb3AoaW50IGNtZCwgaW50
IHZjcHVpZCwgWEVOCiAgICAgICA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cg==

--=separator
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.xen.org
http://lists.xen.org/xen-devel

--=separator--


From xen-devel-bounces@lists.xen.org Tue Nov 13 12:56:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:56:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYG2P-0001IA-BU; Tue, 13 Nov 2012 12:56:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2O-0001Hx-2h; Tue, 13 Nov 2012 12:56:20 +0000
Received: from [85.158.143.99:57901] by server-3.bemta-4.messagelabs.com id
	CD/54-06841-17342A05; Tue, 13 Nov 2012 12:56:17 +0000
X-Env-Sender: iwj@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1352811375!18805688!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3583 invoked from network); 13 Nov 2012 12:56:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Nov 2012 12:56:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2B-0008Tx-Gv; Tue, 13 Nov 2012 12:56:07 +0000
Received: from iwj by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2A-0000z4-Uh; Tue, 13 Nov 2012 12:56:06 +0000
Date: Tue, 13 Nov 2012 12:56:06 +0000
Message-Id: <E1TYG2A-0000z4-Uh@xenbits.xen.org>
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.428 (Entity 5.428)
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
	xen-users@lists.xen.org, oss-security@lists.openwall.com
From: Xen.org security team <security@xen.org>
Cc: "Xen.org security team" <security@xen.org>
Subject: [Xen-devel] Xen Security Advisory 20 (CVE-2012-4535) - Timer
 overflow DoS vulnerability
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--=separator
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

                 Xen Security Advisory CVE-2012-4535 / XSA-20
                                version 2

                       Timer overflow DoS vulnerability

UPDATES IN VERSION 2
====================

Public release.

ISSUE DESCRIPTION
=================

A guest which sets a VCPU with an inappropriate deadline can cause an
infinite loop in Xen, blocking the affected physical CPU
indefinitely.

IMPACT
======

A malicious guest administrator can trigger the bug.  If the Xen
watchdog is enabled, the whole system will crash.  Otherwise the guest
can cause the system to become completely unresponsive.

VULNERABLE SYSTEMS
==================

All versions of Xen from at least 3.4 onwards are vulnerable, to every
kind of guest.

Systems with only trusted guest kernels are not vulnerable.

MITIGATION
==========

There is no mitigation available other than to use a trusted guest
kernel.

RESOLUTION
==========

The attached patch resolves this issue.  The same patch is applicable
to all affected versions.

$ sha256sum xsa20.patch
954f43a3b912d551b6534d3962d0bab3db820222a3bff211b545e526f9161c71  xsa20.patch
$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJQokGkAAoJEIP+FMlX6CvZzB0H/2H7Z/zxYOQtC2QLT77voNvI
/dCGnO+tUxcn9zsPOTkQjTmd7XrSaCdV9IoKmssZCwTBlHzRiwvFWQBinqrU8SZb
8UCv4O1zxg4Ygv/9nlJVxI8Xq9+uyxc/RaMeKlMCsW2rSKut9zmHI9HU+FT5kqG9
0vEXhZW4/MwOFbH+03LoHgjXqW8LOLNZtBg9u5rF5iCDLnltdAC//3kFXA5UG391
JAzAdBUOOaf2OAnL4tEpEV6ksmeaxjckg63P5T61MUqiFJo/5AL5tu0kEKGHF7jH
X4tDkSoV7Rbma4kNN3SbYjAkYGtsrGDeVS7HlhPbyZpKQVUJN+bSMYto3r8lVMM=
=nj9Z
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa20.patch"
Content-Disposition: attachment; filename="xsa20.patch"
Content-Transfer-Encoding: base64

VkNQVS90aW1lcnM6IFByZXZlbnQgb3ZlcmZsb3cgaW4gY2FsY3VsYXRpb25z
LCBsZWFkaW5nIHRvIERvUyB2dWxuZXJhYmlsaXR5CgpUaGUgdGltZXIgYWN0
aW9uIGZvciBhIHZjcHUgcGVyaW9kaWMgdGltZXIgaXMgdG8gY2FsY3VsYXRl
IHRoZSBuZXh0CmV4cGlyeSB0aW1lLCBhbmQgdG8gcmVpbnNlcnQgaXRzZWxm
IGludG8gdGhlIHRpbWVyIHF1ZXVlLiAgSWYgdGhlCmRlYWRsaW5lIGVuZHMg
dXAgaW4gdGhlIHBhc3QsIFhlbiBuZXZlciBsZWF2ZXMgX19kb19zb2Z0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odW5zaWduZWQgbG9uZyB0KTsK
ICNkZWZpbmUgTUlMTElTRUNTKF9tcykgICgoc190aW1lX3QpKChfbXMpICog
MTAwMDAwMFVMTCkpCiAjZGVmaW5lIE1JQ1JPU0VDUyhfdXMpICAoKHNfdGlt
ZV90KSgoX3VzKSAqIDEwMDBVTEwpKQogI2RlZmluZSBTVElNRV9NQVggKChz
X3RpbWVfdCkoKHVpbnQ2NF90KX4wdWxsPj4xKSkKKy8qIENob3NlbiBzbyAo
Tk9XKCkgKyBkZWx0YSkgd29udCBvdmVyZmxvdyB3aXRob3V0IGFuIHVwdGlt
ZSBvZiAyMDAgeWVhcnMgKi8KKyNkZWZpbmUgU1RJTUVfREVMVEFfTUFYICgo
c190aW1lX3QpKCh1aW50NjRfdCl+MHVsbD4+MikpCiAKIGV4dGVybiB2b2lk
IHVwZGF0ZV92Y3B1X3N5c3RlbV90aW1lKHN0cnVjdCB2Y3B1ICp2KTsKIGV4
dGVybiB2b2lkIHVwZGF0ZV9kb21haW5fd2FsbGNsb2NrX3RpbWUoc3RydWN0
IGRvbWFpbiAqZCk7Cg==

--=separator
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.xen.org
http://lists.xen.org/xen-devel

--=separator--


From xen-devel-bounces@lists.xen.org Tue Nov 13 12:56:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:56:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYG2W-0001L2-Rh; Tue, 13 Nov 2012 12:56:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2V-0001KB-3Q; Tue, 13 Nov 2012 12:56:27 +0000
Received: from [85.158.138.51:16995] by server-13.bemta-3.messagelabs.com id
	A6/38-24887-A7342A05; Tue, 13 Nov 2012 12:56:26 +0000
X-Env-Sender: iwj@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1352811384!21908767!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29012 invoked from network); 13 Nov 2012 12:56:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Nov 2012 12:56:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2K-0008Ud-76; Tue, 13 Nov 2012 12:56:16 +0000
Received: from iwj by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2K-0000zq-49; Tue, 13 Nov 2012 12:56:16 +0000
Date: Tue, 13 Nov 2012 12:56:16 +0000
Message-Id: <E1TYG2K-0000zq-49@xenbits.xen.org>
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.428 (Entity 5.428)
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
	xen-users@lists.xen.org, oss-security@lists.openwall.com
From: Xen.org security team <security@xen.org>
Cc: "Xen.org security team" <security@xen.org>
Subject: [Xen-devel] Xen Security Advisory 23 (CVE-2012-4538) - Unhooking
 empty PAE entries DoS vulnerability
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--=separator
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

                 Xen Security Advisory CVE-2012-4538 / XSA-23
                                version 2

                Unhooking empty PAE entries DoS vulnerability

UPDATES IN VERSION 2
====================

Public release.

ISSUE DESCRIPTION
=================

The HVMOP_pagetable_dying hypercall does not correctly check the
caller's pagetable state, leading to a hypervisor crash.

IMPACT
======

An HVM guest running on shadow pagetables (that is, not HAP) can
cause the hypervisor to crash.

VULNERABLE SYSTEMS
==================

All Xen versions from 4.0 onwards are vulnerable, except that:
 - systems that run only PV guests are not vulnerable
 - systems that run all HVM guests using HAP (which is the default on
   hardware that supports it) are not vulnerable.

MITIGATION
==========

This issue can be avoided by running only PV guests or by running
all HVM guests using hardware-assisited paging (HAP, also called
NPT, RVI and EPT).

Xen will run guests using HAP by default on hardware that
supports it, unless it is disbled by putting 'hap=0' either on
the xen hypervisor command-line or in the VM's configuration.

You can check whether a particular machine supports HAP by looking at
xen's boot messages.  On Xen 4.1, 4.2 and unstable, Xen will print
"HVM: Hardware Assisted Paging (HAP) detected" during boot; on xen 4.0
the message is "HVM: Hardware Assisted Paging detected".

RESOLUTION
==========

Applying the appropriate attached patch resolves this issue.

xsa23-4.0-4.1.patch         Xen 4.0.x, 4.1.x
xsa23-4.2-unstable.patch    Xen 4.2.x, xen-unstable

$ sha256sum xsa23*.patch
f696d597481595b14ac9577d1dad05fc97da68568f52db74d62f2e3dcb2c7a6e  xsa23-4.0-4.1.patch
70ffea07e58e4a747bf3ec103f656ba2cd0d8986722e6a72023c57d802c65964  xsa23-4.2-unstable.patch
$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJQokGsAAoJEIP+FMlX6CvZTagH/iyB7+Y5Ug2+3o0minW/xYe5
sVoRIxYhOuKIoRZFVHn3WvXc2PkL/sVCg8PoQnxCs1v4etALl6TTwE9CuJYVgbR7
9OiN6l/NAg2Qbcg3W1j5Har0syOFL5ZkrvIZ3xvER1lsSINKFJ/HBYf9Oe3KUAaD
ffzgRupB/AcETIClv9qwhmSVgjDyNWEae4TS5MzvdUM5dDcCObg/OpyvCGx2MbA8
SF/s9bSwmUcEboy1wOm4wkTWfEJUCsE/ftpQRsEZPESOOXG5u2QB+EI1pbZ1SObx
yhbDGE1Ex3T9u88t+7bSiFn2CwNS7eWQwg7nKQ6P/8PlSwm8BFg7KBC+HUxHNW4=
=stq6
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa23-4.0-4.1.patch"
Content-Disposition: attachment; filename="xsa23-4.0-4.1.patch"
Content-Transfer-Encoding: base64

eGVuL21tL3NoYWRvdzogY2hlY2sgdG9wbGV2ZWwgcGFnZXRhYmxlcyBhcmUg
cHJlc2VudCBiZWZvcmUgdW5ob29raW5nIHRoZW0uCgpJZiB0aGUgZ3Vlc3Qg
aGFzIG5vdCBmdWxseSBwb3B1bGF0ZWQgaXRzIHRvcC1sZXZlbCBQQUUgZW50
cmllcyB3aGVuIGl0IGNhbGxzCkhWTU9QX3BhZ2V0YWJsZV9keWluZywgdGhl
IHNoYWRvdyBjb2RlIGNvdWxkIHRyeSB0byB1bmhvb2sgZW50cmllcyBmcm9t
Ck1GTiAwLiAgQWRkIGEgY2hlY2sgdG8gYXZvaWQgdGhhdCBjYXNlLgoKVGhp
cyBpc3N1ZSB3YXMgaW50cm9kdWNlZCBieSBjL3MgMjEyMzk6YjlkMmRiMTA5
Y2Y1LgoKVGhpcyBpcyBhIHNlY3VyaXR5IHByb2JsZW0sIFhTQS0yMyAvIENW
RS0yMDEyLTQ1MzguCgpTaWduZWQtb2ZmLWJ5OiBUaW0gRGVlZ2FuIDx0aW1A
eGVuLm9yZz4KVGVzdGVkLWJ5OiBBbmRyZXcgQ29vcGVyIDxhbmRyZXcuY29v
cGVyM0BjaXRyaXguY29tPgpBY2tlZC1ieTogSWFuIENhbXBiZWxsIDxpYW4u
Y2FtcGJlbGxAY2l0cml4LmNvbT4KCmRpZmYgLXIgYmZkMjJkNDBkYjA2IHhl
bi9hcmNoL3g4Ni9tbS9zaGFkb3cvbXVsdGkuYwotLS0gYS94ZW4vYXJjaC94
ODYvbW0vc2hhZG93L211bHRpLmMKKysrIGIveGVuL2FyY2gveDg2L21tL3No
YWRvdy9tdWx0aS5jCkBAIC00NzM3LDggKzQ3MzcsMTIgQEAgc3RhdGljIHZv
aWQgc2hfcGFnZXRhYmxlX2R5aW5nKHN0cnVjdCB2YwogICAgIH0KICAgICBm
b3IgKCBpID0gMDsgaSA8IDQ7IGkrKyApCiAgICAgewotICAgICAgICBpZiAo
IGZhc3RfcGF0aCApCi0gICAgICAgICAgICBzbWZuID0gX21mbihwYWdldGFi
bGVfZ2V0X3Bmbih2LT5hcmNoLnNoYWRvd190YWJsZVtpXSkpOworICAgICAg
ICBpZiAoIGZhc3RfcGF0aCApIHsKKyAgICAgICAgICAgIGlmICggcGFnZXRh
YmxlX2lzX251bGwodi0+YXJjaC5zaGFkb3dfdGFibGVbaV0pICkKKyAgICAg
ICAgICAgICAgICBzbWZuID0gX21mbihJTlZBTElEX01GTik7CisgICAgICAg
ICAgICBlbHNlCisgICAgICAgICAgICAgICAgc21mbiA9IF9tZm4ocGFnZXRh
YmxlX2dldF9wZm4odi0+YXJjaC5zaGFkb3dfdGFibGVbaV0pKTsKKyAgICAg
ICAgfQogICAgICAgICBlbHNlCiAgICAgICAgIHsKICAgICAgICAgICAgIC8q
IHJldHJpZXZpbmcgdGhlIGwycyAqLwo=

--=separator
Content-Type: application/octet-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25lZCBsb25nIGdmbjsKICAgICAgICAgbWZuX3Qgc21mbiwgZ21mbjsKIAot
ICAgICAgICBpZiAoIGZhc3RfcGF0aCApCi0gICAgICAgICAgICBzbWZuID0g
X21mbihwYWdldGFibGVfZ2V0X3Bmbih2LT5hcmNoLnNoYWRvd190YWJsZVtp
XSkpOworICAgICAgICBpZiAoIGZhc3RfcGF0aCApIHsKKyAgICAgICAgICAg
IGlmICggcGFnZXRhYmxlX2lzX251bGwodi0+YXJjaC5zaGFkb3dfdGFibGVb
aV0pICkKKyAgICAgICAgICAgICAgICBzbWZuID0gX21mbihJTlZBTElEX01G
Tik7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgc21mbiA9
IF9tZm4ocGFnZXRhYmxlX2dldF9wZm4odi0+YXJjaC5zaGFkb3dfdGFibGVb
aV0pKTsKKyAgICAgICAgfQogICAgICAgICBlbHNlCiAgICAgICAgIHsKICAg
ICAgICAgICAgIC8qIHJldHJpZXZpbmcgdGhlIGwycyAqLwo=

--=separator
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.xen.org
http://lists.xen.org/xen-devel

--=separator--


From xen-devel-bounces@lists.xen.org Tue Nov 13 12:56:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:56:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYG2W-0001L2-Rh; Tue, 13 Nov 2012 12:56:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2V-0001KB-3Q; Tue, 13 Nov 2012 12:56:27 +0000
Received: from [85.158.138.51:16995] by server-13.bemta-3.messagelabs.com id
	A6/38-24887-A7342A05; Tue, 13 Nov 2012 12:56:26 +0000
X-Env-Sender: iwj@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1352811384!21908767!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29012 invoked from network); 13 Nov 2012 12:56:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Nov 2012 12:56:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2K-0008Ud-76; Tue, 13 Nov 2012 12:56:16 +0000
Received: from iwj by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2K-0000zq-49; Tue, 13 Nov 2012 12:56:16 +0000
Date: Tue, 13 Nov 2012 12:56:16 +0000
Message-Id: <E1TYG2K-0000zq-49@xenbits.xen.org>
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.428 (Entity 5.428)
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
	xen-users@lists.xen.org, oss-security@lists.openwall.com
From: Xen.org security team <security@xen.org>
Cc: "Xen.org security team" <security@xen.org>
Subject: [Xen-devel] Xen Security Advisory 23 (CVE-2012-4538) - Unhooking
 empty PAE entries DoS vulnerability
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--=separator
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

                 Xen Security Advisory CVE-2012-4538 / XSA-23
                                version 2

                Unhooking empty PAE entries DoS vulnerability

UPDATES IN VERSION 2
====================

Public release.

ISSUE DESCRIPTION
=================

The HVMOP_pagetable_dying hypercall does not correctly check the
caller's pagetable state, leading to a hypervisor crash.

IMPACT
======

An HVM guest running on shadow pagetables (that is, not HAP) can
cause the hypervisor to crash.

VULNERABLE SYSTEMS
==================

All Xen versions from 4.0 onwards are vulnerable, except that:
 - systems that run only PV guests are not vulnerable
 - systems that run all HVM guests using HAP (which is the default on
   hardware that supports it) are not vulnerable.

MITIGATION
==========

This issue can be avoided by running only PV guests or by running
all HVM guests using hardware-assisited paging (HAP, also called
NPT, RVI and EPT).

Xen will run guests using HAP by default on hardware that
supports it, unless it is disbled by putting 'hap=0' either on
the xen hypervisor command-line or in the VM's configuration.

You can check whether a particular machine supports HAP by looking at
xen's boot messages.  On Xen 4.1, 4.2 and unstable, Xen will print
"HVM: Hardware Assisted Paging (HAP) detected" during boot; on xen 4.0
the message is "HVM: Hardware Assisted Paging detected".

RESOLUTION
==========

Applying the appropriate attached patch resolves this issue.

xsa23-4.0-4.1.patch         Xen 4.0.x, 4.1.x
xsa23-4.2-unstable.patch    Xen 4.2.x, xen-unstable

$ sha256sum xsa23*.patch
f696d597481595b14ac9577d1dad05fc97da68568f52db74d62f2e3dcb2c7a6e  xsa23-4.0-4.1.patch
70ffea07e58e4a747bf3ec103f656ba2cd0d8986722e6a72023c57d802c65964  xsa23-4.2-unstable.patch
$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJQokGsAAoJEIP+FMlX6CvZTagH/iyB7+Y5Ug2+3o0minW/xYe5
sVoRIxYhOuKIoRZFVHn3WvXc2PkL/sVCg8PoQnxCs1v4etALl6TTwE9CuJYVgbR7
9OiN6l/NAg2Qbcg3W1j5Har0syOFL5ZkrvIZ3xvER1lsSINKFJ/HBYf9Oe3KUAaD
ffzgRupB/AcETIClv9qwhmSVgjDyNWEae4TS5MzvdUM5dDcCObg/OpyvCGx2MbA8
SF/s9bSwmUcEboy1wOm4wkTWfEJUCsE/ftpQRsEZPESOOXG5u2QB+EI1pbZ1SObx
yhbDGE1Ex3T9u88t+7bSiFn2CwNS7eWQwg7nKQ6P/8PlSwm8BFg7KBC+HUxHNW4=
=stq6
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa23-4.0-4.1.patch"
Content-Disposition: attachment; filename="xsa23-4.0-4.1.patch"
Content-Transfer-Encoding: base64

eGVuL21tL3NoYWRvdzogY2hlY2sgdG9wbGV2ZWwgcGFnZXRhYmxlcyBhcmUg
cHJlc2VudCBiZWZvcmUgdW5ob29raW5nIHRoZW0uCgpJZiB0aGUgZ3Vlc3Qg
aGFzIG5vdCBmdWxseSBwb3B1bGF0ZWQgaXRzIHRvcC1sZXZlbCBQQUUgZW50
cmllcyB3aGVuIGl0IGNhbGxzCkhWTU9QX3BhZ2V0YWJsZV9keWluZywgdGhl
IHNoYWRvdyBjb2RlIGNvdWxkIHRyeSB0byB1bmhvb2sgZW50cmllcyBmcm9t
Ck1GTiAwLiAgQWRkIGEgY2hlY2sgdG8gYXZvaWQgdGhhdCBjYXNlLgoKVGhp
cyBpc3N1ZSB3YXMgaW50cm9kdWNlZCBieSBjL3MgMjEyMzk6YjlkMmRiMTA5
Y2Y1LgoKVGhpcyBpcyBhIHNlY3VyaXR5IHByb2JsZW0sIFhTQS0yMyAvIENW
RS0yMDEyLTQ1MzguCgpTaWduZWQtb2ZmLWJ5OiBUaW0gRGVlZ2FuIDx0aW1A
eGVuLm9yZz4KVGVzdGVkLWJ5OiBBbmRyZXcgQ29vcGVyIDxhbmRyZXcuY29v
cGVyM0BjaXRyaXguY29tPgpBY2tlZC1ieTogSWFuIENhbXBiZWxsIDxpYW4u
Y2FtcGJlbGxAY2l0cml4LmNvbT4KCmRpZmYgLXIgYmZkMjJkNDBkYjA2IHhl
bi9hcmNoL3g4Ni9tbS9zaGFkb3cvbXVsdGkuYwotLS0gYS94ZW4vYXJjaC94
ODYvbW0vc2hhZG93L211bHRpLmMKKysrIGIveGVuL2FyY2gveDg2L21tL3No
YWRvdy9tdWx0aS5jCkBAIC00NzM3LDggKzQ3MzcsMTIgQEAgc3RhdGljIHZv
aWQgc2hfcGFnZXRhYmxlX2R5aW5nKHN0cnVjdCB2YwogICAgIH0KICAgICBm
b3IgKCBpID0gMDsgaSA8IDQ7IGkrKyApCiAgICAgewotICAgICAgICBpZiAo
IGZhc3RfcGF0aCApCi0gICAgICAgICAgICBzbWZuID0gX21mbihwYWdldGFi
bGVfZ2V0X3Bmbih2LT5hcmNoLnNoYWRvd190YWJsZVtpXSkpOworICAgICAg
ICBpZiAoIGZhc3RfcGF0aCApIHsKKyAgICAgICAgICAgIGlmICggcGFnZXRh
YmxlX2lzX251bGwodi0+YXJjaC5zaGFkb3dfdGFibGVbaV0pICkKKyAgICAg
ICAgICAgICAgICBzbWZuID0gX21mbihJTlZBTElEX01GTik7CisgICAgICAg
ICAgICBlbHNlCisgICAgICAgICAgICAgICAgc21mbiA9IF9tZm4ocGFnZXRh
YmxlX2dldF9wZm4odi0+YXJjaC5zaGFkb3dfdGFibGVbaV0pKTsKKyAgICAg
ICAgfQogICAgICAgICBlbHNlCiAgICAgICAgIHsKICAgICAgICAgICAgIC8q
IHJldHJpZXZpbmcgdGhlIGwycyAqLwo=

--=separator
Content-Type: application/octet-stream; name="xsa23-4.2-unstable.patch"
Content-Disposition: attachment; filename="xsa23-4.2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mbjsKIAot
ICAgICAgICBpZiAoIGZhc3RfcGF0aCApCi0gICAgICAgICAgICBzbWZuID0g
X21mbihwYWdldGFibGVfZ2V0X3Bmbih2LT5hcmNoLnNoYWRvd190YWJsZVtp
XSkpOworICAgICAgICBpZiAoIGZhc3RfcGF0aCApIHsKKyAgICAgICAgICAg
IGlmICggcGFnZXRhYmxlX2lzX251bGwodi0+YXJjaC5zaGFkb3dfdGFibGVb
aV0pICkKKyAgICAgICAgICAgICAgICBzbWZuID0gX21mbihJTlZBTElEX01G
Tik7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgc21mbiA9
IF9tZm4ocGFnZXRhYmxlX2dldF9wZm4odi0+YXJjaC5zaGFkb3dfdGFibGVb
aV0pKTsKKyAgICAgICAgfQogICAgICAgICBlbHNlCiAgICAgICAgIHsKICAg
ICAgICAgICAgIC8qIHJldHJpZXZpbmcgdGhlIGwycyAqLwo=

--=separator
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.xen.org
http://lists.xen.org/xen-devel

--=separator--


From xen-devel-bounces@lists.xen.org Tue Nov 13 12:56:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:56:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYG2Q-0001Io-Is; Tue, 13 Nov 2012 12:56:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2P-0001I8-HV; Tue, 13 Nov 2012 12:56:21 +0000
Received: from [85.158.137.99:57042] by server-6.bemta-3.messagelabs.com id
	A2/CA-28265-47342A05; Tue, 13 Nov 2012 12:56:20 +0000
X-Env-Sender: iwj@xenbits.xen.org
X-Msg-Ref: server-11.tower-217.messagelabs.com!1352811378!18030909!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15563 invoked from network); 13 Nov 2012 12:56:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Nov 2012 12:56:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2F-0008U6-4A; Tue, 13 Nov 2012 12:56:11 +0000
Received: from iwj by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2E-0000zH-Ug; Tue, 13 Nov 2012 12:56:10 +0000
Date: Tue, 13 Nov 2012 12:56:10 +0000
Message-Id: <E1TYG2E-0000zH-Ug@xenbits.xen.org>
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.428 (Entity 5.428)
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
	xen-users@lists.xen.org, oss-security@lists.openwall.com
From: Xen.org security team <security@xen.org>
Cc: "Xen.org security team" <security@xen.org>
Subject: [Xen-devel] Xen Security Advisory 21 (CVE-2012-4536) - pirq range
 check DoS vulnerability
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--=separator
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

                 Xen Security Advisory CVE-2012-4536 / XSA-21
                                version 2

                    pirq range check DoS vulnerability

UPDATES IN VERSION 2
====================

Public release.

ISSUE DESCRIPTION
=================

domain_pirq_to_emuirq() uses the guest provided pirq value before
range checking it, and physdev_unmap_pirq uses domain_pirq_to_emuirq
without checking the pirq value either.  Invalid pirq values can cause
Xen to read out of array bounds, usually resulting in a fatal page
fault.

IMPACT
======

A malicious guest administrator can cause Xen to crash.  If the out of
array bounds access does not crash, the arbitrary value read will be
ignored due to later error checking, so there is no privilege
escalation and no exploitable information leak.

VULNERABLE SYSTEMS
==================

Only Xen version 4.1 is vulnerable.  Other released versions, and
xen-unstable, are not vulnerable.

The vulnerability is only exposed to HVM guests.

MITIGATION
==========

Running only PV guests, or ensuring that HVM guests only use trusted
kernels, will avoid this vulnerability.

RESOLUTION
==========

The attached patch resolves this issue.

$ sha256sum xsa21.patch
34c4bef71d0ad08ee7c337c77af47aa77bb19081a13fc13beaff7d4b37b6b35a  xsa21.patch
$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJQokGnAAoJEIP+FMlX6CvZ1lQH/jdovmPuphnocdrkWGR8FE3+
OqM3JIpOZTDPFfLO7pen/P5e/0fCBs7cF7FGvM1Uua54/M0HrVS93E1m9baornkh
vEIV5c9TRTfUR3IGmVFs1l+ddJcfULOuhfE2IOrbcYaWBL89D9sQYrL/A1j4LTEh
umsz6fh4XgINkt/tpneEcE4ckYd0YkkOm3zUK3HaGshNXoOGVyGeaNqKr/YuhEfc
XWOkCUoZTxKz50Tg12pdtjX8CX0njJaKeAs0MLkyTL1cj+Sf89YzNuXLwx5ffpMu
//VEe2tbyRzPj2JYzUOrV8E5W1fPZmfCSgMvJEtwmMbMXMb7sIUPMBh3yBcXQQU=
=yPnD
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa21.patch"
Content-Disposition: attachment; filename="xsa21.patch"
Content-Transfer-Encoding: base64

eDg2L3BoeXNkZXY6IFJhbmdlIGNoZWNrIHBpcnEgcGFyYW1ldGVyIGZyb20g
Z3Vlc3RzCgpPdGhlcndpc2UgWGVuIHdpbGwgcmVhZCBiZXlvbmQgZWl0aGVy
IGVuZCBvZiB0aGUgc3RydWN0CmRvbWFpbi5hcmNoLnBpcnFfZW11aXJxIGFy
cmF5LCB1c3VhbGx5IHJlc3VsdGluZyBpbiBhIGZhdGFsIHBhZ2UgZmF1bHQu
CgpUaGlzIHZ1bG5lcmFiaWxpdHkgd2FzIGludHJvZHVjZWQgYnkgYy9zIDIz
MjQxOmQyMTEwMGYxZDAwZSwgd2hpY2ggYWRkcwphIGNhbGwgdG8gZG9tYWlu
X3BpcnFfdG9fZW11aXJxKCkgd2hpY2ggdXNlcyB0aGUgZ3Vlc3QgcHJvdmlk
ZWQgcGlycQp2YWx1ZSBiZWZvcmUgcmFuZ2UgY2hlY2tpbmcgaXQsIGFuZCB3
YXMgZml4ZWQgYnkgYy9zIDIzNTczOjU4NGMyZTVlMDNkOQp3aGljaCBjaGFu
Z2VkIHRoZSBiZWhhdmlvdXIgb2YgdGhlIGRvbWFpbl9waXJxX3RvX2VtdWly
cSgpIG1hY3JvIHRvIHVzZQpyYWRpeCB0cmVlcyBpbnN0ZWFkIG9mIGEgZmxh
dCBhcnJheS4KClRoaXMgaXMgWFNBLTIxIC8gQ1ZFLTIwMTItNDUzNi4KClNp
Z25lZC1vZmYtYnk6IEFuZHJldyBDb29wZXIgPGFuZHJldy5jb29wZXIzQGNp
dHJpeC5jb20+CkFja2VkLWJ5OiBKYW4gQmV1bGljaCA8amJldWxpY2hAc3Vz
ZS5jb20+CkFja2VkLWJ5OiBJYW4gQ2FtcGJlbGwgPGlhbi5jYW1wYmVsbEBj
aXRyaXguY29tPgoKZGlmZiAtciA3YTQwMWE3M2Q4NmQgeGVuL2FyY2gveDg2
L3BoeXNkZXYuYwotLS0gYS94ZW4vYXJjaC94ODYvcGh5c2Rldi5jCisrKyBi
L3hlbi9hcmNoL3g4Ni9waHlzZGV2LmMKQEAgLTIzNCw2ICsyMzQsMTAgQEAg
c3RhdGljIGludCBwaHlzZGV2X3VubWFwX3BpcnEoc3RydWN0IHBoeQogICAg
IGlmICggcmV0ICkKICAgICAgICAgcmV0dXJuIHJldDsKIAorICAgIHJldCA9
IC1FSU5WQUw7CisgICAgaWYgKCB1bm1hcC0+cGlycSA8IDAgfHwgdW5tYXAt
PnBpcnEgPj0gZC0+bnJfcGlycXMgKQorICAgICAgICBnb3RvIGZyZWVfZG9t
YWluOworCiAgICAgaWYgKCBpc19odm1fZG9tYWluKGQpICkKICAgICB7CiAg
ICAgICAgIHNwaW5fbG9jaygmZC0+ZXZlbnRfbG9jayk7Cg==

--=separator
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.xen.org
http://lists.xen.org/xen-devel

--=separator--


From xen-devel-bounces@lists.xen.org Tue Nov 13 12:56:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:56:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYG2Q-0001Io-Is; Tue, 13 Nov 2012 12:56:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2P-0001I8-HV; Tue, 13 Nov 2012 12:56:21 +0000
Received: from [85.158.137.99:57042] by server-6.bemta-3.messagelabs.com id
	A2/CA-28265-47342A05; Tue, 13 Nov 2012 12:56:20 +0000
X-Env-Sender: iwj@xenbits.xen.org
X-Msg-Ref: server-11.tower-217.messagelabs.com!1352811378!18030909!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15563 invoked from network); 13 Nov 2012 12:56:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Nov 2012 12:56:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2F-0008U6-4A; Tue, 13 Nov 2012 12:56:11 +0000
Received: from iwj by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2E-0000zH-Ug; Tue, 13 Nov 2012 12:56:10 +0000
Date: Tue, 13 Nov 2012 12:56:10 +0000
Message-Id: <E1TYG2E-0000zH-Ug@xenbits.xen.org>
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.428 (Entity 5.428)
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
	xen-users@lists.xen.org, oss-security@lists.openwall.com
From: Xen.org security team <security@xen.org>
Cc: "Xen.org security team" <security@xen.org>
Subject: [Xen-devel] Xen Security Advisory 21 (CVE-2012-4536) - pirq range
 check DoS vulnerability
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--=separator
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

                 Xen Security Advisory CVE-2012-4536 / XSA-21
                                version 2

                    pirq range check DoS vulnerability

UPDATES IN VERSION 2
====================

Public release.

ISSUE DESCRIPTION
=================

domain_pirq_to_emuirq() uses the guest provided pirq value before
range checking it, and physdev_unmap_pirq uses domain_pirq_to_emuirq
without checking the pirq value either.  Invalid pirq values can cause
Xen to read out of array bounds, usually resulting in a fatal page
fault.

IMPACT
======

A malicious guest administrator can cause Xen to crash.  If the out of
array bounds access does not crash, the arbitrary value read will be
ignored due to later error checking, so there is no privilege
escalation and no exploitable information leak.

VULNERABLE SYSTEMS
==================

Only Xen version 4.1 is vulnerable.  Other released versions, and
xen-unstable, are not vulnerable.

The vulnerability is only exposed to HVM guests.

MITIGATION
==========

Running only PV guests, or ensuring that HVM guests only use trusted
kernels, will avoid this vulnerability.

RESOLUTION
==========

The attached patch resolves this issue.

$ sha256sum xsa21.patch
34c4bef71d0ad08ee7c337c77af47aa77bb19081a13fc13beaff7d4b37b6b35a  xsa21.patch
$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJQokGnAAoJEIP+FMlX6CvZ1lQH/jdovmPuphnocdrkWGR8FE3+
OqM3JIpOZTDPFfLO7pen/P5e/0fCBs7cF7FGvM1Uua54/M0HrVS93E1m9baornkh
vEIV5c9TRTfUR3IGmVFs1l+ddJcfULOuhfE2IOrbcYaWBL89D9sQYrL/A1j4LTEh
umsz6fh4XgINkt/tpneEcE4ckYd0YkkOm3zUK3HaGshNXoOGVyGeaNqKr/YuhEfc
XWOkCUoZTxKz50Tg12pdtjX8CX0njJaKeAs0MLkyTL1cj+Sf89YzNuXLwx5ffpMu
//VEe2tbyRzPj2JYzUOrV8E5W1fPZmfCSgMvJEtwmMbMXMb7sIUPMBh3yBcXQQU=
=yPnD
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa21.patch"
Content-Disposition: attachment; filename="xsa21.patch"
Content-Transfer-Encoding: base64

eDg2L3BoeXNkZXY6IFJhbmdlIGNoZWNrIHBpcnEgcGFyYW1ldGVyIGZyb20g
Z3Vlc3RzCgpPdGhlcndpc2UgWGVuIHdpbGwgcmVhZCBiZXlvbmQgZWl0aGVy
IGVuZCBvZiB0aGUgc3RydWN0CmRvbWFpbi5hcmNoLnBpcnFfZW11aXJxIGFy
cmF5LCB1c3VhbGx5IHJlc3VsdGluZyBpbiBhIGZhdGFsIHBhZ2UgZmF1bHQu
CgpUaGlzIHZ1bG5lcmFiaWxpdHkgd2FzIGludHJvZHVjZWQgYnkgYy9zIDIz
MjQxOmQyMTEwMGYxZDAwZSwgd2hpY2ggYWRkcwphIGNhbGwgdG8gZG9tYWlu
X3BpcnFfdG9fZW11aXJxKCkgd2hpY2ggdXNlcyB0aGUgZ3Vlc3QgcHJvdmlk
ZWQgcGlycQp2YWx1ZSBiZWZvcmUgcmFuZ2UgY2hlY2tpbmcgaXQsIGFuZCB3
YXMgZml4ZWQgYnkgYy9zIDIzNTczOjU4NGMyZTVlMDNkOQp3aGljaCBjaGFu
Z2VkIHRoZSBiZWhhdmlvdXIgb2YgdGhlIGRvbWFpbl9waXJxX3RvX2VtdWly
cSgpIG1hY3JvIHRvIHVzZQpyYWRpeCB0cmVlcyBpbnN0ZWFkIG9mIGEgZmxh
dCBhcnJheS4KClRoaXMgaXMgWFNBLTIxIC8gQ1ZFLTIwMTItNDUzNi4KClNp
Z25lZC1vZmYtYnk6IEFuZHJldyBDb29wZXIgPGFuZHJldy5jb29wZXIzQGNp
dHJpeC5jb20+CkFja2VkLWJ5OiBKYW4gQmV1bGljaCA8amJldWxpY2hAc3Vz
ZS5jb20+CkFja2VkLWJ5OiBJYW4gQ2FtcGJlbGwgPGlhbi5jYW1wYmVsbEBj
aXRyaXguY29tPgoKZGlmZiAtciA3YTQwMWE3M2Q4NmQgeGVuL2FyY2gveDg2
L3BoeXNkZXYuYwotLS0gYS94ZW4vYXJjaC94ODYvcGh5c2Rldi5jCisrKyBi
L3hlbi9hcmNoL3g4Ni9waHlzZGV2LmMKQEAgLTIzNCw2ICsyMzQsMTAgQEAg
c3RhdGljIGludCBwaHlzZGV2X3VubWFwX3BpcnEoc3RydWN0IHBoeQogICAg
IGlmICggcmV0ICkKICAgICAgICAgcmV0dXJuIHJldDsKIAorICAgIHJldCA9
IC1FSU5WQUw7CisgICAgaWYgKCB1bm1hcC0+cGlycSA8IDAgfHwgdW5tYXAt
PnBpcnEgPj0gZC0+bnJfcGlycXMgKQorICAgICAgICBnb3RvIGZyZWVfZG9t
YWluOworCiAgICAgaWYgKCBpc19odm1fZG9tYWluKGQpICkKICAgICB7CiAg
ICAgICAgIHNwaW5fbG9jaygmZC0+ZXZlbnRfbG9jayk7Cg==

--=separator
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.xen.org
http://lists.xen.org/xen-devel

--=separator--


From xen-devel-bounces@lists.xen.org Tue Nov 13 12:56:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:56:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYG2c-0001Mz-0i; Tue, 13 Nov 2012 12:56:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2a-0001LY-AX; Tue, 13 Nov 2012 12:56:32 +0000
Received: from [85.158.137.99:35613] by server-10.bemta-3.messagelabs.com id
	7C/58-19806-D7342A05; Tue, 13 Nov 2012 12:56:29 +0000
X-Env-Sender: iwj@xenbits.xen.org
X-Msg-Ref: server-2.tower-217.messagelabs.com!1352811387!18804571!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6375 invoked from network); 13 Nov 2012 12:56:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Nov 2012 12:56:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2O-0008V2-S8; Tue, 13 Nov 2012 12:56:20 +0000
Received: from iwj by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2O-000103-Oo; Tue, 13 Nov 2012 12:56:20 +0000
Date: Tue, 13 Nov 2012 12:56:20 +0000
Message-Id: <E1TYG2O-000103-Oo@xenbits.xen.org>
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.428 (Entity 5.428)
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
	xen-users@lists.xen.org, oss-security@lists.openwall.com
From: Xen.org security team <security@xen.org>
Cc: "Xen.org security team" <security@xen.org>
Subject: [Xen-devel] Xen Security Advisory 24 (CVE-2012-4539) - Grant table
 hypercall infinite loop DoS vulnerability
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--=separator
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

                 Xen Security Advisory CVE-2012-4539 / XSA-24
                                version 2

              Grant table hypercall infinite loop DoS vulnerability

UPDATES IN VERSION 2
====================

Public release.

ISSUE DESCRIPTION
=================

Due to inappropriate duplicate use of the same loop control variable,
passing bad arguments to GNTTABOP_get_status_frames can cause an
infinite loop in the compat hypercall handler.

IMPACT
======

A malicious guest administrator can trigger the bug.  If the Xen
watchdog is enabled, the whole system will crash.  Otherwise the guest
can cause the system to become completely unresponsive.

VULNERABLE SYSTEMS
==================

Xen versions 4.0 and onwards are vulnerable.  Earlier released Xen
versions are not vulnerable.

Only 32-bit x86 PV guests, running on 64-bit Xen hypervisors,
introduce the vulnerability.

MITIGATION
==========

Running only 64-bit guests, or (in previous Xen versions) running a
32-bit hypervisor (which supports only 32-bit guests), will avoid this
vulnerability.

Note however that if in a 64-bit Xen system the guest kernel image
file is under the control of the guest administrator, the guest
administrator will normally be able to control whether the guest is
32-bit or 64-bit by supplying a different kernel image.

Running only HVM guests will avoid this vulnerability.

RESOLUTION
==========

The attached patch resolves this issue.  The same patch is applicable
to all affected versions.

$ sha256sum xsa24.patch
2963dff4dbc08aab4278215d74c2cce365972f213453bb7c513d097a838de196  xsa24.patch
$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJQokGvAAoJEIP+FMlX6CvZ0HAH/jy7Id9Ai1ZJSou6xu6USdQP
QyaT6BnWzIA8ziatcnRzq5YHW+Occ4g4+9fU92zHpVsFGF5mAN9/aq83xLHoFHkb
TPH/+xNCRz50zfQ21VTejr6jFlfiO6S1y/4bxVYfohtoevijo5tpRo+OYdFZXMM8
psagcYXHgOsUy95pFsPBbwg6bh0S/ffDfZnyK3LZCP3J/Xx82kj7Du/HgKcM9lDx
gk/q0VjFM6M/utxyn2gQlFGbX8YFfoytb9WzcrQdcPf4Ubu/jGUykm1BS/+IrXHs
C9BtBa6w+k2T6dZgRmseeOjy0PgiEYKrqYhwAG1VC8F+RMLpAmtNGJS3gatwFHE=
=IoWx
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa24.patch"
Content-Disposition: attachment; filename="xsa24.patch"
Content-Transfer-Encoding: base64

Y29tcGF0L2dudHRhYjogUHJldmVudCBpbmZpbml0ZSBsb29wIGluIGNvbXBh
dCBjb2RlCgpjL3MgMjAyODE6OTVlYTIwNTJiNDFiLCB3aGljaCBpbnRyb2R1
Y2VzIEdyYW50IFRhYmxlIHZlcnNpb24gMgpoeXBlcmNhbGxzIGludHJvZHVj
ZXMgYSB2dWxuZXJhYmlsaXR5IHdoZXJlYnkgdGhlIGNvbXBhdCBoeXBlcmNh
bGwKaGFuZGxlciBjYW4gZmFsbCBpbnRvIGFuIGluZmluaXRlIGxvb3AuCgpJ
ZiB0aGUgd2F0Y2hkb2cgaXMgZW5hYmxlZCwgWGVuIHdpbGwgZGllIGFmdGVy
IHRoZSB0aW1lb3V0LgoKVGhpcyBpcyBhIHNlY3VyaXR5IHByb2JsZW0sIFhT
QS0yNCAvIENWRS0yMDEyLTQ1MzkuCgpTaWduZWQtb2ZmLWJ5OiBBbmRyZXcg
Q29vcGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPgpBY2tlZC1ieTog
SmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpBY2tlZC1ieTogSWFu
IEphY2tzb24gPGlhbi5qYWNrc29uQGV1LmNpdHJpeC5jb20+CgpkaWZmIC1y
IGJhYzg4M2NmODA1YSB4ZW4vY29tbW9uL2NvbXBhdC9ncmFudF90YWJsZS5j
Ci0tLSBhL3hlbi9jb21tb24vY29tcGF0L2dyYW50X3RhYmxlLmMKKysrIGIv
eGVuL2NvbW1vbi9jb21wYXQvZ3JhbnRfdGFibGUuYwpAQCAtMzE4LDYgKzMx
OCw4IEBAIGludCBjb21wYXRfZ3JhbnRfdGFibGVfb3AodW5zaWduZWQgaW50
IGMKICN1bmRlZiBYTEFUX2dudHRhYl9nZXRfc3RhdHVzX2ZyYW1lc19ITkRM
X2ZyYW1lX2xpc3QKICAgICAgICAgICAgICAgICBpZiAoIHVubGlrZWx5KF9f
Y29weV90b19ndWVzdChjbXBfdW9wLCAmY21wLmdldF9zdGF0dXMsIDEpKSAp
CiAgICAgICAgICAgICAgICAgICAgIHJjID0gLUVGQVVMVDsKKyAgICAgICAg
ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIGkgPSAxOwogICAg
ICAgICAgICAgfQogICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIH0K

--=separator
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.xen.org
http://lists.xen.org/xen-devel

--=separator--


From xen-devel-bounces@lists.xen.org Tue Nov 13 12:56:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:56:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYG2c-0001Mz-0i; Tue, 13 Nov 2012 12:56:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2a-0001LY-AX; Tue, 13 Nov 2012 12:56:32 +0000
Received: from [85.158.137.99:35613] by server-10.bemta-3.messagelabs.com id
	7C/58-19806-D7342A05; Tue, 13 Nov 2012 12:56:29 +0000
X-Env-Sender: iwj@xenbits.xen.org
X-Msg-Ref: server-2.tower-217.messagelabs.com!1352811387!18804571!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6375 invoked from network); 13 Nov 2012 12:56:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Nov 2012 12:56:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2O-0008V2-S8; Tue, 13 Nov 2012 12:56:20 +0000
Received: from iwj by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2O-000103-Oo; Tue, 13 Nov 2012 12:56:20 +0000
Date: Tue, 13 Nov 2012 12:56:20 +0000
Message-Id: <E1TYG2O-000103-Oo@xenbits.xen.org>
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.428 (Entity 5.428)
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
	xen-users@lists.xen.org, oss-security@lists.openwall.com
From: Xen.org security team <security@xen.org>
Cc: "Xen.org security team" <security@xen.org>
Subject: [Xen-devel] Xen Security Advisory 24 (CVE-2012-4539) - Grant table
 hypercall infinite loop DoS vulnerability
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--=separator
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

                 Xen Security Advisory CVE-2012-4539 / XSA-24
                                version 2

              Grant table hypercall infinite loop DoS vulnerability

UPDATES IN VERSION 2
====================

Public release.

ISSUE DESCRIPTION
=================

Due to inappropriate duplicate use of the same loop control variable,
passing bad arguments to GNTTABOP_get_status_frames can cause an
infinite loop in the compat hypercall handler.

IMPACT
======

A malicious guest administrator can trigger the bug.  If the Xen
watchdog is enabled, the whole system will crash.  Otherwise the guest
can cause the system to become completely unresponsive.

VULNERABLE SYSTEMS
==================

Xen versions 4.0 and onwards are vulnerable.  Earlier released Xen
versions are not vulnerable.

Only 32-bit x86 PV guests, running on 64-bit Xen hypervisors,
introduce the vulnerability.

MITIGATION
==========

Running only 64-bit guests, or (in previous Xen versions) running a
32-bit hypervisor (which supports only 32-bit guests), will avoid this
vulnerability.

Note however that if in a 64-bit Xen system the guest kernel image
file is under the control of the guest administrator, the guest
administrator will normally be able to control whether the guest is
32-bit or 64-bit by supplying a different kernel image.

Running only HVM guests will avoid this vulnerability.

RESOLUTION
==========

The attached patch resolves this issue.  The same patch is applicable
to all affected versions.

$ sha256sum xsa24.patch
2963dff4dbc08aab4278215d74c2cce365972f213453bb7c513d097a838de196  xsa24.patch
$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJQokGvAAoJEIP+FMlX6CvZ0HAH/jy7Id9Ai1ZJSou6xu6USdQP
QyaT6BnWzIA8ziatcnRzq5YHW+Occ4g4+9fU92zHpVsFGF5mAN9/aq83xLHoFHkb
TPH/+xNCRz50zfQ21VTejr6jFlfiO6S1y/4bxVYfohtoevijo5tpRo+OYdFZXMM8
psagcYXHgOsUy95pFsPBbwg6bh0S/ffDfZnyK3LZCP3J/Xx82kj7Du/HgKcM9lDx
gk/q0VjFM6M/utxyn2gQlFGbX8YFfoytb9WzcrQdcPf4Ubu/jGUykm1BS/+IrXHs
C9BtBa6w+k2T6dZgRmseeOjy0PgiEYKrqYhwAG1VC8F+RMLpAmtNGJS3gatwFHE=
=IoWx
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa24.patch"
Content-Disposition: attachment; filename="xsa24.patch"
Content-Transfer-Encoding: base64

Y29tcGF0L2dudHRhYjogUHJldmVudCBpbmZpbml0ZSBsb29wIGluIGNvbXBh
dCBjb2RlCgpjL3MgMjAyODE6OTVlYTIwNTJiNDFiLCB3aGljaCBpbnRyb2R1
Y2VzIEdyYW50IFRhYmxlIHZlcnNpb24gMgpoeXBlcmNhbGxzIGludHJvZHVj
ZXMgYSB2dWxuZXJhYmlsaXR5IHdoZXJlYnkgdGhlIGNvbXBhdCBoeXBlcmNh
bGwKaGFuZGxlciBjYW4gZmFsbCBpbnRvIGFuIGluZmluaXRlIGxvb3AuCgpJ
ZiB0aGUgd2F0Y2hkb2cgaXMgZW5hYmxlZCwgWGVuIHdpbGwgZGllIGFmdGVy
IHRoZSB0aW1lb3V0LgoKVGhpcyBpcyBhIHNlY3VyaXR5IHByb2JsZW0sIFhT
QS0yNCAvIENWRS0yMDEyLTQ1MzkuCgpTaWduZWQtb2ZmLWJ5OiBBbmRyZXcg
Q29vcGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPgpBY2tlZC1ieTog
SmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpBY2tlZC1ieTogSWFu
IEphY2tzb24gPGlhbi5qYWNrc29uQGV1LmNpdHJpeC5jb20+CgpkaWZmIC1y
IGJhYzg4M2NmODA1YSB4ZW4vY29tbW9uL2NvbXBhdC9ncmFudF90YWJsZS5j
Ci0tLSBhL3hlbi9jb21tb24vY29tcGF0L2dyYW50X3RhYmxlLmMKKysrIGIv
eGVuL2NvbW1vbi9jb21wYXQvZ3JhbnRfdGFibGUuYwpAQCAtMzE4LDYgKzMx
OCw4IEBAIGludCBjb21wYXRfZ3JhbnRfdGFibGVfb3AodW5zaWduZWQgaW50
IGMKICN1bmRlZiBYTEFUX2dudHRhYl9nZXRfc3RhdHVzX2ZyYW1lc19ITkRM
X2ZyYW1lX2xpc3QKICAgICAgICAgICAgICAgICBpZiAoIHVubGlrZWx5KF9f
Y29weV90b19ndWVzdChjbXBfdW9wLCAmY21wLmdldF9zdGF0dXMsIDEpKSAp
CiAgICAgICAgICAgICAgICAgICAgIHJjID0gLUVGQVVMVDsKKyAgICAgICAg
ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIGkgPSAxOwogICAg
ICAgICAgICAgfQogICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIH0K

--=separator
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.xen.org
http://lists.xen.org/xen-devel

--=separator--


From xen-devel-bounces@lists.xen.org Tue Nov 13 12:56:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:56:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYG2f-0001Pl-Ho; Tue, 13 Nov 2012 12:56:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2d-0001NS-S4; Tue, 13 Nov 2012 12:56:36 +0000
Received: from [85.158.138.51:17606] by server-3.bemta-3.messagelabs.com id
	F8/84-31566-28342A05; Tue, 13 Nov 2012 12:56:34 +0000
X-Env-Sender: iwj@xenbits.xen.org
X-Msg-Ref: server-6.tower-174.messagelabs.com!1352811391!21808416!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30348 invoked from network); 13 Nov 2012 12:56:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Nov 2012 12:56:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2R-0008VH-9g; Tue, 13 Nov 2012 12:56:23 +0000
Received: from iwj by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2R-00010J-89; Tue, 13 Nov 2012 12:56:23 +0000
Date: Tue, 13 Nov 2012 12:56:23 +0000
Message-Id: <E1TYG2R-00010J-89@xenbits.xen.org>
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.428 (Entity 5.428)
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
	xen-users@lists.xen.org, oss-security@lists.openwall.com
From: Xen.org security team <security@xen.org>
Cc: "Xen.org security team" <security@xen.org>
Subject: [Xen-devel] Xen Security Advisory 25 (CVE-2012-4544,
 CVE-2012-2625) - Xen domain builder Out-of-memory due to malicious
 kernel/ramdisk
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--=separator
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

       Xen Security Advisory CVE-2012-4544,CVE-2012-2625 / XSA-25
                            version 2

   Xen domain builder Out-of-memory due to malicious kernel/ramdisk

UPDATES IN VERSION 2
====================

Clarify that XSA-25 is reporting, via the Xen.org security process,
both CVE-2012-4544 and CVE-2012-2625.

Also we would like to apologise for the fact that xen-announce's copy
of version 1 of this advisory was delayed in mailing list moderation.

ISSUE DESCRIPTION
=================

The Xen PV domain builder contained no validation of the size of the
supplied kernel or ramdisk either before or after decompression. This
could cause the toolstack to consume all available RAM in the domain
running the domain builder.  (CVE-2012-4544)

Additionally, under similar circumstances pygrub consume excessive
amount of memory under similar circumstances to the above.
(CVE-2012-2625)

IMPACT
======

A malicious guest administrator who can supply a kernel or ramdisk can
exhaust memory in domain 0 leading to a denial of service attack.

VULNERABLE SYSTEMS
==================

All versions of Xen are vulnerable.

MITIGATION
==========

Running only trusted kernels and ramdisks will avoid these
vulnerabilities.

Using pvgrub also avoids these vulnerabilities since the builder will
run in guest context. (nb: use of pygrub *is* vulnerable).

Running only HVM guests will avoid these vulnerabilities.

RESOLUTION
==========

Applying the appropriate attached patch resolves these issues.

The pygrub problem (CVE-2012-2625) was fixed in xen-unstable (and the
fix inherited by Xen 4.2.x) in revision 25589:60f09d1ab1fe but not
called out as a security problem.  This fix is also included, where
necessary, in the patches below.

xsa25-unstable.patch        Xen unstable
xsa25-4.2.patch             Xen 4.2.x
xsa25-4.1.patch             Xen 4.1.x

$ sha256sum xsa25*.patch
613e4b82cdc9cabf9cbd52076118887b298c47e680c2066a28a77f12e9f90606  xsa25-4.1.patch
135bc089d003f9b97991764c37b1ab8d37e9cbcfa1b9bd7429b4503abe00c8f5  xsa25-4.2.patch
534495b7eef6e599f5814f0a67fc84fbe2e8eee9d223a09ad178ff63bdcda3dd  xsa25-unstable.patch

Note that these patches impose a new size limit of 1Gby on both the
compressed and uncompressed sizes of ramdisks.  On some systems it may
be desirable to relax these limits and risk virtual address or memory
exhaustion in the toolstack.  This can be achieved by setting
XC_DOM_DECOMPRESS_MAX to the desired limit (in bytes). This can be
done by building with "APPEND_CFLAGS=-DXC_DOM_DECOMPRESS_MAX=<limit>"
or by editing tools/libxc/xc_dom.h directly.

NOTE REGARDING LACK OF EMBARGO
==============================

These issues have already been discussed in public in various places,
including https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2012-2625
and http://bugs.debian.org/688125.  This advisory is therefore not
subject to an embargo.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJQokGyAAoJEIP+FMlX6CvZl7wH/RdoQHGDcbgVEh5fuS5VzPpw
RZ0sm6bpI7eclqaN6+thX9SA5qeycvyj2zq769yUGSiHR+BUNw6HRJZ+XAAF0IIx
nb4VEdS2+Hz1kyTUAeZu3z/5HyfFamKY9Lhhj/47DBTtO5Xl1pjOCA0bC4ZDtIm1
ffFVhOmTcmQEWXW1z27Vj9hSgQeGsqHTcOys6H0nYpLITDIZqBkGv8MZl4X0/Wtl
zs2prG8HEWsysKel5Q/dt7De84OV3LgP1/2a+aMkLi+RgKWP+naKAXfYqVAS4mLw
K+mv2MrmhgNxzEWp/sZX0q1QNvnJf+xKYHOBcP+hUlQIQwD/NQejdAdmNVPem7s=
=Pfj+
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa25-4.1.patch"
Content-Disposition: attachment; filename="xsa25-4.1.patch"
Content-Transfer-Encoding: base64

bGlieGM6IGJ1aWxkZXI6IGxpbWl0IG1heGltdW0gc2l6ZSBvZiBrZXJuZWwv
cmFtZGlzay4KCkFsbG93aW5nIHVzZXIgc3VwcGxpZWQga2VybmVscyBvZiBh
cmJpdHJhcnkgc2l6ZXMsIGVzcGVjaWFsbHkgZHVyaW5nCmRlY29tcHJlc3Np
b24sIGNhbiBzd2FsbG93IHVwIGRvbTAgbWVtb3J5IGxlYWRpbmcgdG8gZWl0
aGVyIHZpcnR1YWwKYWRkcmVzcyBzcGFjZSBleGhhdXN0aW9uIGluIHRoZSBi
dWlsZGVyIHByb2Nlc3Mgb3IgYWxsb2NhdGlvbgpmYWlsdXJlcy9PT00ga2ls
bGluZyBvZiBib3RoIHRvb2xzdGFjayBhbmQgdW5yZWxhdGVkIHByb2Nlc3Nl
cy4KCldlIGRpc2FibGUgdGhlc2UgY2hlY2tzIHdoZW4gYnVpbGRpbmcgaW4g
YSBzdHViIGRvbWFpbiBmb3IgcHZncnViCnNpbmNlIHRoaXMgdXNlcyB0aGUg
Z3Vlc3QncyBvd24gbWVtb3J5IGFuZCBpcyBpc29sYXRlZC4KCkRlY29tcHJl
c3Npb24gb2YgZ3ppcCBjb21wcmVzc2VkIGtlcm5lbHMgYW5kIHJhbWRpc2tz
IGhhcyBiZWVuIHNhZmUKc2luY2UgMTQ5NTQ6NTgyMDUyNTc1MTdkIChYZW4g
My4xLjAgb253YXJkcykuCgpUaGlzIGlzIFhTQS0yNSAvIENWRS0yMDEyLTQ1
NDQuCgpBbHNvIG1ha2UgZXhwbGljaXQgY2hlY2tzIGZvciBidWZmZXIgb3Zl
cmZsb3dzIGluIHZhcmlvdXMKZGVjb21wcmVzc2lvbiByb3V0aW5lcy4gVGhl
c2Ugd2VyZSBhbHJlYWR5IHJ1bGVkIG91dCB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Bp
bnQgeGNfdHJ5X2J6aXAyX2RlY29kZSgKICAgICAgICAgaWYgKCBzdHJlYW0u
YXZhaWxfb3V0ID09IDAgKQogICAgICAgICB7CiAgICAgICAgICAgICAvKiBQ
cm90ZWN0IGFnYWluc3Qgb3V0cHV0IGJ1ZmZlciBvdmVyZmxvdyAqLwotICAg
ICAgICAgICAgaWYgKCBvdXRzaXplID4gSU5UX01BWCAvIDIgKQorICAgICAg
ICAgICAgaWYgKCBvdXRzaXplID4gVUlOVF9NQVggLyAyICkKICAgICAgICAg
ICAgIHsKICAgICAgICAgICAgICAgICBET01QUklOVEYoIkJaSVAyOiBvdXRw
dXQgYnVmZmVyIG92ZXJmbG93Iik7CiAgICAgICAgICAgICAgICAgZnJlZShv
dXRfYnVmKTsKICAgICAgICAgICAgICAgICBnb3RvIGJ6aXAyX2NsZWFudXA7
CiAgICAgICAgICAgICB9CiAKKyAgICAgICAgICAgIGlmICggeGNfZG9tX2tl
cm5lbF9jaGVja19zaXplKGRvbSwgb3V0c2l6ZSAqIDIpICkKKyAgICAgICAg
ICAgIHsKKyAgICAgICAgICAgICAgICBET01QUklOVEYoIkJaSVAyOiBvdXRw
dXQgdG9vIGxhcmdlIik7CisgICAgICAgICAgICAgICAgZnJlZShvdXRfYnVm
KTsKKyAgICAgICAgICAgICAgICBnb3RvIGJ6aXAyX2NsZWFudXA7CisgICAg
ICAgICAgICB9CisKICAgICAgICAgICAgIHRtcF9idWYgPSByZWFsbG9jKG91
dF9idWYsIG91dHNpemUgKiAyKTsKICAgICAgICAgICAgIGlmICggdG1wX2J1
ZiA9PSBOVUxMICkKICAgICAgICAgICAgIHsKQEAgLTE3Miw5ICsxOTYsMTUg
QEAgc3RhdGljIGludCB4Y190cnlfbHptYV9kZWNvZGUoCiAgICAgdW5zaWdu
ZWQgY2hhciAqb3V0X2J1ZjsKICAgICB1bnNpZ25lZCBjaGFyICp0bXBfYnVm
OwogICAgIGludCByZXR2YWwgPSAtMTsKLSAgICBpbnQgb3V0c2l6ZTsKKyAg
ICBzaXplX3Qgb3V0c2l6ZTsKICAgICBjb25zdCBjaGFyICptc2c7CiAKKyAg
ICBpZiAoIGRvbS0+a2VybmVsX3NpemUgPT0gMCkKKyAgICB7CisgICAgICAg
IERPTVBSSU5URigiTFpNQTogSW5wdXQgaXMgMCBzaXplIik7CisgICAgICAg
IHJldHVybiAtMTsKKyAgICB9CisKICAgICByZXQgPSBsem1hX2Fsb25lX2Rl
Y29kZXIoJnN0cmVhbSwgMTI4KjEwMjQqMTAyNCk7CiAgICAgaWYgKCByZXQg
IT0gTFpNQV9PSyApCiAgICAgewpAQCAtMjUxLDEzICsyODEsMjAgQEAgc3Rh
dGljIGludCB4Y190cnlfbHptYV9kZWNvZGUoCiAgICAgICAgIGlmICggc3Ry
ZWFtLmF2YWlsX291dCA9PSAwICkKICAgICAgICAgewogICAgICAgICAgICAg
LyogUHJvdGVjdCBhZ2FpbnN0IG91dHB1dCBidWZmZXIgb3ZlcmZsb3cgKi8K
LSAgICAgICAgICAgIGlmICggb3V0c2l6ZSA+IElOVF9NQVggLyAyICkKKyAg
ICAgICAgICAgIGlmICggb3V0c2l6ZSA+IFNJWkVfTUFYIC8gMiApCiAgICAg
ICAgICAgICB7CiAgICAgICAgICAgICAgICAgRE9NUFJJTlRGKCJMWk1BOiBv
dXRwdXQgYnVmZmVyIG92ZXJmbG93Iik7CiAgICAgICAgICAgICAgICAgZnJl
ZShvdXRfYnVmKTsKICAgICAgICAgICAgICAgICBnb3RvIGx6bWFfY2xlYW51
cDsKICAgICAgICAgICAgIH0KIAorICAgICAgICAgICAgaWYgKCB4Y19kb21f
a2VybmVsX2NoZWNrX3NpemUoZG9tLCBvdXRzaXplICogMikgKQorICAgICAg
ICAgICAgeworICAgICAgICAgICAgICAgIERPTVBSSU5URigiTFpNQTogb3V0
cHV0IHRvbyBsYXJnZSIpOworICAgICAgICAgICAgICAgIGZyZWUob3V0X2J1
Zik7CisgICAgICAgICAgICAgICAgZ290byBsem1hX2NsZWFudXA7CisgICAg
ICAgICAgICB9CisKICAgICAgICAgICAgIHRtcF9idWYgPSByZWFsbG9jKG91
dF9idWYsIG91dHNpemUgKiAyKTsKICAgICAgICAgICAgIGlmICggdG1wX2J1
ZiA9PSBOVUxMICkKICAgICAgICAgICAgIHsKQEAgLTMyNyw2ICszNjQsMTIg
QEAgc3RhdGljIGludCB4Y190cnlfbHpvMXhfZGVjb2RlKAogICAgICAgICAw
eDg5LCAweDRjLCAweDVhLCAweDRmLCAweDAwLCAweDBkLCAweDBhLCAweDFh
LCAweDBhCiAgICAgfTsKIAorICAgIC8qCisgICAgICogbHpvX3VpbnQgc2hv
dWxkIG1hdGNoIHNpemVfdC4gQ2hlY2sgdGhhdCB0aGlzIGlzIHRoZSBjYXNl
IHRvIGJlCisgICAgICogc3VyZSB3ZSB3b24ndCBvdmVyZmxvdyB2YXJpb3Vz
IGx6b191aW50IGZpZWxkcy4KKyAgICAgKi8KKyAgICBYQ19CVUlMRF9CVUdf
T04oc2l6ZW9mKGx6b191aW50KSAhPSBzaXplb2Yoc2l6ZV90KSk7CisKICAg
ICByZXQgPSBsem9faW5pdCgpOwogICAgIGlmICggcmV0ICE9IExaT19FX09L
ICkKICAgICB7CkBAIC00MDYsNiArNDQ5LDE0IEBAIHN0YXRpYyBpbnQgeGNf
dHJ5X2x6bzF4X2RlY29kZSgKICAgICAgICAgaWYgKCBzcmNfbGVuIDw9IDAg
fHwgc3JjX2xlbiA+IGRzdF9sZW4gfHwgc3JjX2xlbiA+IGxlZnQgKQogICAg
ICAgICAgICAgYnJlYWs7CiAKKyAgICAgICAgbXNnID0gIk91dHB1dCBidWZm
ZXIgb3ZlcmZsb3ciOworICAgICAgICBpZiAoICpzaXplID4gU0laRV9NQVgg
LSBkc3RfbGVuICkKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIG1z
ZyA9ICJEZWNvbXByZXNzZWQgaW1hZ2UgdG9vIGxhcmdlIjsKKyAgICAgICAg
aWYgKCB4Y19kb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G9tX2ltYWdlICpkb20sCiAgICAgbHNlZWsoZmQsIDAs
IFNFRUtfU0VUKTsKICAgICAqc2l6ZSA9IGxzZWVrKGZkLCAwLCBTRUVLX0VO
RCk7CiAKKyAgICBpZiAoIG1heF9zaXplICYmICpzaXplID4gbWF4X3NpemUg
KQorICAgIHsKKyAgICAgICAgeGNfZG9tX3BhbmljKGRvbS0+eGNoLCBYQ19P
VVRfT0ZfTUVNT1JZLAorICAgICAgICAgICAgICAgICAgICAgInRyaWVkIHRv
IG1hcCBmaWxlIHdoaWNoIGlzIHRvbyBsYXJnZSIpOworICAgICAgICBnb3Rv
IGVycjsKKyAgICB9CisKICAgICBibG9jayA9IG1hbGxvYyhzaXplb2YoKmJs
b2NrKSk7CiAgICAgaWYgKCBibG9jayA9PSBOVUxMICkKICAgICAgICAgZ290
byBlcnI7CkBAIC0yMjIsNiArMjMwLDQwIEBAIGNoYXIgKnhjX2RvbV9zdHJk
dXAoc3RydWN0IHhjX2RvbV9pbWFnZSAqZG9tLCBjb25zdCBjaGFyICpzdHIp
CiB9CiAKIC8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog
ZGVjb21wcmVzc2lvbiBidWZmZXIgc2l6aW5nICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCitpbnQgeGNfZG9tX2tl
cm5lbF9jaGVja19zaXplKHN0cnVjdCB4Y19kb21faW1hZ2UgKmRvbSwgc2l6
ZV90IHN6KQoreworICAgIC8qIE5vIGxpbWl0ICovCisgICAgaWYgKCAhZG9t
LT5tYXhfa2VybmVsX3NpemUgKQorICAgICAgICByZXR1cm4gMDsKKworICAg
IGlmICggc3ogPiBkb20tPm1heF9rZXJuZWxfc2l6ZSApCisgICAgeworICAg
ICAgICB4Y19kb21fcGFuaWMoZG9tLT54Y2gsIFhDX0lOVk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ICUgKGZpbGVfdHlwZSwgZmlsZV90b19yZWFkKQorICAg
ICAgICAgICAgZWxzZToKKyAgICAgICAgICAgICAgICBzeXMuZXhpdCgiVGhl
IHJlcXVlc3RlZCAlcyBmaWxlIGRvZXMgbm90IGV4aXN0IiAlIGZpbGVfdHlw
ZSkKKyAgICAgICAgdHJ5OgorICAgICAgICAgICAgZGF0YWZpbGUgPSBmcy5v
cGVuX2ZpbGUoZmlsZV90b19yZWFkKQorICAgICAgICBleGNlcHQgRXhjZXB0
aW9uLCBlOgorICAgICAgICAgICAgcHJpbnQgPj5zeXMuc3RkZXJyLCBlCisg
ICAgICAgICAgICBzeXMuZXhpdCgiRXJyb3Igb3BlbmluZyAlcyBpbiBndWVz
dCIgJSBmaWxlX3RvX3JlYWQpCisgICAgICAgICh0ZmQsIHJldCkgPSB0ZW1w
ZmlsZS5ta3N0ZW1wKHByZWZpeD0iYm9vdF8iK2ZpbGVfdHlwZSsiLiIsCisg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpcj1vdXRw
dXRfZGlyZWN0b3J5KQorICAgICAgICBkYXRhb2ZmID0gMAorICAgICAgICB3
aGlsZSBUcnVlOgorICAgICAgICAgICAgZGF0YSA9IGRhdGFmaWxlLnJlYWQo
RlNfUkVBRF9NQVgsIGRhdGFvZmYpCisgICAgICAgICAgICBpZiBsZW4oZGF0
YSkgPT0gMDoKKyAgICAgICAgICAgICAgICBvcy5jbG9zZSh0ZmQpCisgICAg
ICAgICAgICAgICAgZGVsIGRhdGFmaWxlCisgICAgICAgICAgICAgICAgcmV0
dXJuIHJldAorICAgICAgICAgICAgdHJ5OgorICAgICAgICAgICAgICAgIG9z
LndyaXRlKHRmZCwgZGF0YSkKKyAgICAgICAgICAgIGV4Y2VwdCBFeGNlcHRp
b24sIGU6CisgICAgICAgICAgICAgICAgcHJpbnQgPj5zeXMuc3RkZXJyLCBl
CisgICAgICAgICAgICAgICAgb3MuY2xvc2UodGZkKQorICAgICAgICAgICAg
ICAgIG9zLnVubGluayhyZXQpCisgICAgICAgICAgICAgICAgZGVsIGRhdGFm
aWxlCisgICAgICAgICAgICAgICAgc3lzLmV4aXQoIkVycm9yIHdyaXRpbmcg
dGVtcG9yYXJ5IGNvcHkgb2YgIitmaWxlX3R5cGUpCisgICAgICAgICAgICBk
YXRhb2ZmICs9IGxlbihkYXRhKQorCiAgICAgdHJ5OgogICAgICAgICBvcHRz
LCBhcmdzID0gZ2V0b3B0LmdudV9nZXRvcHQoc3lzLmFyZ3ZbMTpdLCAncWlu
aDo6JywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWyJx
dWlldCIsICJpbnRlcmFjdGl2ZSIsICJub3QtcmVhbGx5IiwgImhlbHAiLCAK
QEAgLTc4NiwyNCArODE5LDE4IEBAIGlmIF9fbmFtZV9fID09ICJfX21haW5f
XyI6CiAgICAgaWYgbm90IGZzOgogICAgICAgICByYWlzZSBSdW50aW1lRXJy
b3IsICJVbmFibGUgdG8gZmluZCBwYXJ0aXRpb24gY29udGFpbmluZyBrZXJu
ZWwiCiAKLSAgICBpZiBub3RfcmVhbGx5OgotICAgICAgICBib290Y2ZnWyJr
ZXJuZWwiXSA9ICI8a2VybmVsOiVzPiIgJSBjaG9zZW5jZmdbImtlcm5lbCJd
Ci0gICAgZWxzZToKLSAgICAgICAgZGF0YSA9IGZzLm9wZW5fZmlsZShjaG9z
ZW5jZmdbImtlcm5lbCJdKS5yZWFkKCkKLSAgICAgICAgKHRmZCwgYm9vdGNm
Z1sia2VybmVsIl0pID0gdGVtcGZpbGUubWtzdGVtcChwcmVmaXg9ImJvb3Rf
a2VybmVsLiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgZGlyPW91dHB1dF9kaXJlY3RvcnkpCi0gICAg
ICAgIG9zLndyaXRlKHRmZCwgZGF0YSkKLSAgICAgICAgb3MuY2xvc2UodGZk
KQorICAgIGJvb3RjZmdbImtlcm5lbCJdID0gY29weV9mcm9tX2ltYWdlKGZz
LCBjaG9zZW5jZmdbImtlcm5lbCJdLCAia2VybmVsIiwKKyAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRwdXRfZGlyZWN0b3J5
LCBub3RfcmVhbGx5KQogCiAgICAgaWYgY2hvc2VuY2ZnWyJyYW1kaXNrIl06
Ci0gICAgICAgIGlmIG5vdF9yZWFsbHk6Ci0gICAgICAgICAgICBib290Y2Zn
WyJyYW1kaXNrIl0gPSAiPHJhbWRpc2s6JXM+IiAlIGNob3NlbmNmZ1sicmFt
ZGlzayJdCi0gICAgICAgIGVsc2U6Ci0gICAgICAgICAgICBkYXRhID0gZnMu
b3Blbl9maWxlKGNob3NlbmNmZ1sicmFtZGlzayJdLCkucmVhZCgpCi0gICAg
ICAgICAgICAodGZkLCBib290Y2ZnWyJyYW1kaXNrIl0pID0gdGVtcGZpbGUu
bWtzdGVtcCgKLSAgICAgICAgICAgICAgICBwcmVmaXg9ImJvb3RfcmFtZGlz
ay4iLCBkaXI9b3V0cHV0X2RpcmVjdG9yeSkKLSAgICAgICAgICAgIG9zLndy
aXRlKHRmZCwgZGF0YSkKLSAgICAgICAgICAgIG9zLmNsb3NlKHRmZCkKKyAg
ICAgICAgdHJ5OgorICAgICAgICAgICAgYm9vdGNmZ1sicmFtZGlzayJdID0g
Y29weV9mcm9tX2ltYWdlKGZzLCBjaG9zZW5jZmdbInJhbWRpc2siXSwKKyAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAicmFtZGlzayIsIG91dHB1dF9kaXJlY3RvcnksCisgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm90X3JlYWxs
eSkKKyAgICAgICAgZXhjZXB0OgorICAgICAgICAgICAgaWYgbm90IG5vdF9y
ZWFsbHk6CisgICAgICAgICAgICAgICAgb3MudW5saW5rKGJvb3RjZmdbImtl
cm5lbCJdKQorICAgICAgICAgICAgcmFpc2UKICAgICBlbHNlOgogICAgICAg
ICBpbml0cmQgPSBOb25lCiAK

--=separator
Content-Type: application/octet-stream; name="xsa25-4.2.patch"
Content-Disposition: attachment; filename="xsa25-4.2.patch"
Content-Transfer-Encoding: base64

bGlieGM6IGJ1aWxkZXI6IGxpbWl0IG1heGltdW0gc2l6ZSBvZiBrZXJuZWwv
cmFtZGlzay4KCkFsbG93aW5nIHVzZXIgc3VwcGxpZWQga2VybmVscyBvZiBh
cmJpdHJhcnkgc2l6ZXMsIGVzcGVjaWFsbHkgZHVyaW5nCmRlY29tcHJlc3Np
b24sIGNhbiBzd2FsbG93IHVwIGRvbTAgbWVtb3J5IGxlYWRpbmcgdG8gZWl0
aGVyIHZpcnR1YWwKYWRkcmVzcyBzcGFjZSBleGhhdXN0aW9uIGluIHRoZSBi
dWlsZGVyIHByb2Nlc3Mgb3IgYWxsb2NhdGlvbgpmYWlsdXJlcy9PT00ga2ls
bGluZyBvZiBib3RoIHRvb2xzdGFjayBhbmQgdW5yZWxhdGVkIHByb2Nlc3Nl
cy4KCldlIGRpc2FibGUgdGhlc2UgY2hlY2tzIHdoZW4gYnVpbGRpbmcgaW4g
YSBzdHViIGRvbWFpbiBmb3IgcHZncnViCnNpbmNlIHRoaXMgdXNlcyB0aGUg
Z3Vlc3QncyBvd24gbWVtb3J5IGFuZCBpcyBpc29sYXRlZC4KCkRlY29tcHJl
c3Npb24gb2YgZ3ppcCBjb21wcmVzc2VkIGtlcm5lbHMgYW5kIHJhbWRpc2tz
IGhhcyBiZWVuIHNhZmUKc2luY2UgMTQ5NTQ6NTgyMDUyNTc1MTdkIChYZW4g
My4xLjAgb253YXJkcykuCgpUaGlzIGlzIFhTQS0yNSAvIENWRS0yMDEyLTQ1
NDQuCgpBbHNvIG1ha2UgZXhwbGljaXQgY2hlY2tzIGZvciBidWZmZXIgb3Zl
cmZsb3dzIGluIHZhcmlvdXMKZGVjb21wcmVzc2lvbiByb3V0aW5lcy4g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vdGFsOwog
CiAgICAgc3RyZWFtLmJ6YWxsb2MgPSBOVUxMOwogICAgIHN0cmVhbS5iemZy
ZWUgPSBOVUxMOwogICAgIHN0cmVhbS5vcGFxdWUgPSBOVUxMOwogCisgICAg
aWYgKCBkb20tPmtlcm5lbF9zaXplID09IDApCisgICAgeworICAgICAgICBE
T01QUklOVEYoIkJaSVAyOiBJbnB1dCBpcyAwIHNpemUiKTsKKyAgICAgICAg
cmV0dXJuIC0xOworICAgIH0KKwogICAgIHJldCA9IEJaMl9iekRlY29tcHJl
c3NJbml0KCZzdHJlYW0sIDAsIDApOwogICAgIGlmICggcmV0ICE9IEJaX09L
ICkKICAgICB7CkBAIC02Niw2ICs3MiwxNyBAQCBzdGF0aWMgaW50IHhjX3Ry
eV9iemlwMl9kZWNvZGUoCiAgICAgICogdGhlIGlucHV0IGJ1ZmZlciB0byBz
dGFydCwgYW5kIHdlJ2xsIHJlYWxsb2MgYXMgbmVlZGVkLgogICAgICAqLwog
ICAgIG91dHNpemUgPSBkb20tPmtlcm5lbF9zaXplOworCisgICAgLyoKKyAg
ICAgKiBzdHJlYW0uYXZhaWxfaW4gYW5kIG91dHNpemUgYXJlIHVuc2lnbmVk
IGludCwgd2hpbGUga2VybmVsX3NpemUKKyAgICAgKiBpcyBhIHNpemVfdC4g
Q2hlY2sgd2UgYXJlbid0IG92ZXJmbG93aW5nLgorICAgICAqLworICAgIGlm
ICggb3V0c2l6ZSAhPSBkb20tPmtlcm5lbF9zaXplICkKKyAgICB7CisgICAg
ICAgIERPTVBSSU5URigiQlpJUDI6IElucHV0IHRvbyBsYXJnZSIpOworICAg
ICAgICBnb3RvIGJ6aXAyX2NsZWFudXA7CisgICAgfQorCiAgICAgb3V0X2J1
ZiA9IG1hbGxvYyhvdXRzaXplKTsKICAgICBpZiAoIG91dF9idWYgPT0gTlVM
TCApCiAgICAgewpAQCAtOTgsMTMgKzExNSwyMCBAQCBzdGF0aWMgaW50IHhj
X3RyeV9iemlwMl9kZWNvZGUoCiAgICAgICAgIGlmICggc3RyZWFtLmF2YWls
X291dCA9PSAwICkKICAgICAgICAgewogICAgICAgICAgICAgLyogUHJvdGVj
dCBhZ2FpbnN0IG91dHB1dCBidWZmZXIgb3ZlcmZsb3cgKi8KLSAgICAgICAg
ICAgIGlmICggb3V0c2l6ZSA+IElOVF9NQVggLyAyICkKKyAgICAgICAgICAg
IGlmICggb3V0c2l6ZSA+IFVJTlRfTUFYIC8gMiApCiAgICAgICAgICAgICB7
CiAgICAgICAgICAgICAgICAgRE9NUFJJTlRGKCJCWklQMjogb3V0cHV0IGJ1
ZmZlciBvdmVyZmxvdyIpOwogICAgICAgICAgICAgICAgIGZyZWUob3V0X2J1
Zik7CiAgICAgICAgICAgICAgICAgZ290byBiemlwMl9jbGVhbnVwOwogICAg
ICAgICAgICAgfQogCisgICAgICAgICAgICBpZiAoIHhjX2RvbV9rZXJuZWxf
Y2hlY2tfc2l6ZShkb20sIG91dHNpemUgKiAyKSApCisgICAgICAgICAgICB7
CisgICAgICAgICAgICAgICAgRE9NUFJJTlRGKCJCWklQMjogb3V0cHV0IHRv
byBsYXJnZSIpOworICAgICAgICAgICAgICAgIGZyZWUob3V0X2J1Zik7Cisg
ICAgICAgICAgICAgICAgZ290byBiemlwMl9jbGVhbnVwOworICAgICAgICAg
ICAgfQorCiAgICAgICAgICAgICB0bXBfYnVmID0gcmVhbGxvYyhvdXRfYnVm
LCBvdXRzaXplICogMik7CiAgICAgICAgICAgICBpZiAoIHRtcF9idWYgPT0g
TlVMTCApCiAgICAgICAgICAgICB7CkBAIC0xNzIsOSArMTk2LDE1IEBAIHN0
YXRpYyBpbnQgX3hjX3RyeV9sem1hX2RlY29kZSgKICAgICB1bnNpZ25lZCBj
aGFyICpvdXRfYnVmOwogICAgIHVuc2lnbmVkIGNoYXIgKnRtcF9idWY7CiAg
ICAgaW50IHJldHZhbCA9IC0xOwotICAgIGludCBvdXRzaXplOworICAgIHNp
emVfdCBvdXRzaXplOwogICAgIGNvbn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1h
eF9rZXJuZWxfc2l6ZSApCisgICAgICAgIHJldHVybiAwOworCisgICAgaWYg
KCBzeiA+IGRvbS0+bWF4X2tlcm5lbF9zaXplICkKKyAgICB7CisgICAgICAg
IHhjX2RvbV9wYW5pYyhkb20tPnhjaCwgWENfSU5WQUxJRF9LRVJORUwsCisg
ICAgICAgICAgICAgICAgICAgICAia2VybmVsIGltYWdlIHRvbyBsYXJnZSIp
OworICAgICAgICByZXR1cm4gMTsKKyAgICB9CisKKyAgICByZXR1cm4gMDsK
K30KKworaW50IHhjX2RvbV9yYW1kaXNrX2NoZWNrX3NpemUoc3RydWN0IHhj
X2RvbV9pbWFnZSAqZG9tLCBzaXplX3Qgc3opCit7CisgICAgLyogTm8gbGlt
aXQgKi8KKyAgICBpZiAoICFkb20tPm1heF9yYW1kaXNrX3NpemUgKQorICAg
ICAgICByZXR1cm4gMDsKKworICAgIGlmICggc3ogPiBkb20tPm1heF9yYW1k
aXNrX3NpemUgKQorICAgIHsKKyAgICAgICAgeGNfZG9tX3BhbmljKGRvbS0+
eGNoLCBYQ19JTlZBTElEX0tFUk5FTCwKKyAgICAgICAgICAgICAgICAgICAg
ICJyYW1kaXNrIGltYWdlIHRvbyBsYXJnZSIpOworICAgICAgICByZXR1cm4g
MTsKKyAgICB9CisKKyAgICByZXR1cm4gMDsKK30KKworLyogLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tICovCiAvKiByZWFkIGZpbGVzLCBjb3B5IG1l
bW9yeSBibG9ja3MsIHdpdGggdHJhbnNwYXJlbnQgZ3VuemlwICAgICAgICAg
ICAgICAgICAgKi8KIAogc2l6ZV90IHhjX2RvbV9jaGVja19nemlwKHhjX2lu
dGVyZmFjZSAqeGNoLCB2b2lkICpibG9iLCBzaXplX3QgemlwbGVuKQpAQCAt
MjM1LDcgKzI3Nyw3IEBAIHNpemVfdCB4Y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tZGlza19zaXplKTsKQEAgLTc4MSw3ICs4NDYsMTEgQEAg
aW50IHhjX2RvbV9idWlsZF9pbWFnZShzdHJ1Y3QgeGNfZG9tX2ltYWdlICpk
b20pCiAgICAgICAgIHZvaWQgKnJhbWRpc2ttYXA7CiAKICAgICAgICAgdW56
aXBsZW4gPSB4Y19kb21fY2hlY2tfZ3ppcChkb20tPnhjaCwgZG9tLT5yYW1k
aXNrX2Jsb2IsIGRvbS0+cmFtZGlza19zaXplKTsKKyAgICAgICAgaWYgKCB4
Y19kb21fcmFtZGlza19jaGVja19zaXplKGRvbSwgdW56aXBsZW4pICE9IDAg
KQorICAgICAgICAgICAgdW56aXBsZW4gPSAwOworCiAgICAgICAgIHJhbWRp
c2tsZW4gPSB1bnppcGxlbiA/IHVuemlwbGVuIDogZG9tLT5yYW1kaXNrX3Np
emU7CisKICAgICAgICAgaWYgKCB4Y19kb21fYWxsb2Nfc2VnbWVudChkb20s
ICZkb20tPnJhbWRpc2tfc2VnLCAicmFtZGlzayIsIDAsCiAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgcmFtZGlza2xlbikgIT0gMCApCiAg
ICAgICAgICAgICBnb3RvIGVycjsK

--=separator
Content-Type: application/octet-stream; name="xsa25-unstable.patch"
Content-Disposition: attachment; filename="xsa25-unstable.patch"
Content-Transfer-Encoding: base64

bGlieGM6IGJ1aWxkZXI6IGxpbWl0IG1heGltdW0gc2l6ZSBvZiBrZXJuZWwv
cmFtZGlzay4KCkFsbG93aW5nIHVzZXIgc3VwcGxpZWQga2VybmVscyBvZiBh
cmJpdHJhcnkgc2l6ZXMsIGVzcGVjaWFsbHkgZHVyaW5nCmRlY29tcHJlc3Np
b24sIGNhbiBzd2FsbG93IHVwIGRvbTAgbWVtb3J5IGxlYWRpbmcgdG8gZWl0
aGVyIHZpcnR1YWwKYWRkcmVzcyBzcGFjZSBleGhhdXN0aW9uIGluIHRoZSBi
dWlsZGVyIHByb2Nlc3Mgb3IgYWxsb2Nh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p
bnB1dCBidWZmZXIgdG8gc3RhcnQsIGFuZCB3ZSdsbCByZWFsbG9jIGFzIG5l
ZWRlZC4KICAgICAgKi8KICAgICBvdXRzaXplID0gZG9tLT5rZXJuZWxfc2l6
ZTsKKworICAgIC8qCisgICAgICogc3RyZWFtLmF2YWlsX2luIGFuZCBvdXRz
aXplIGFyZSB1bnNpZ25lZCBpbnQsIHdoaWxlIGtlcm5lbF9zaXplCisgICAg
ICogaXMgYSBzaXplX3QuIENoZWNrIHdlIGFyZW4ndCBvdmVyZmxvd2luZy4K
KyAgICAgKi8KKyAgICBpZiAoIG91dHNpemUgIT0gZG9tLT5rZXJuZWxfc2l6
ZSApCisgICAgeworICAgICAgICBET01QUklOVEYoIkJaSVAyOiBJbnB1dCB0
b28gbGFyZ2UiKTsKKyAgICAgICAgZ290byBiemlwMl9jbGVhbnVwOworICAg
IH0KKwogICAgIG91dF9idWYgPSBtYWxsb2Mob3V0c2l6ZSk7CiAgICAgaWYg
KCBvdXRfYnVmID09IE5VTEwgKQogICAgIHsKQEAgLTk4LDEzICsxMTUsMjAg
QEAgc3RhdGljIGludCB4Y190cnlfYnppcDJfZGVjb2RlKAogICAgICAgICBp
ZiAoIHN0cmVhbS5hdmFpbF9vdXQgPT0gMCApCiAgICAgICAgIHsKICAgICAg
ICAgICAgIC8qIFByb3RlY3QgYWdhaW5zdCBvdXRwdXQgYnVmZmVyIG92ZXJm
bG93ICovCi0gICAgICAgICAgICBpZiAoIG91dHNpemUgPiBJTlRfTUFYIC8g
MiApCisgICAgICAgICAgICBpZiAoIG91dHNpemUgPiBVSU5UX01BWCAvIDIg
KQogICAgICAgICAgICAgewogICAgICAgICAgICAgICAgIERPTVBSSU5URigi
QlpJUDI6IG91dHB1dCBidWZmZXIgb3ZlcmZsb3ciKTsKICAgICAgICAgICAg
ICAgICBmcmVlKG91dF9idWYpOwogICAgICAgICAgICAgICAgIGdvdG8gYnpp
cDJfY2xlYW51cDsKICAgICAgICAgICAgIH0KIAorICAgICAgICAgICAgaWYg
KCB4Y19kb21fa2VybmVsX2NoZWNrX3NpemUoZG9tLCBvdXRzaXplICogMikg
KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIERPTVBSSU5URigi
QlpJUDI6IG91dHB1dCB0b28gbGFyZ2UiKTsKKyAgICAgICAgICAgICAgICBm
cmVlKG91dF9idWYpOworICAgICAgICAgICAgICAgIGdvdG8gYnppcDJfY2xl
YW51cDsKKyAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgdG1wX2J1ZiA9
IHJlYWxsb2Mob3V0X2J1Ziwgb3V0c2l6ZSAqIDIpOwogICAgICAgICAgICAg
aWYgKCB0bXBfYnVmID09IE5VTEwgKQogICAgICAgICAgICAgewpAQCAtMTcy
LDkgKzE5NiwxNSBAQCBzdGF0aWMgaW50IF94Y190cnlfbHptYV9kZWNvZGUo
CiAgICAgdW5zaWduZWQgY2hhciAqb3V0X2J1ZjsKICAgICB1bnNpZ25lZCBj
aGFyICp0bXBfYnVmOwogICAgIGludCByZXR2YWwgPSAtMTsKLSAgICBpbnQg
b3V0c2l6ZTsKKyAgICBzaXplX3Qgb3V0c2l6ZTsKICAgICBjb25zdCBjaGFy
ICptc2c7CiAKKyAgICBpZiAoIGRvbS0+a2VybmVsX3NpemUgPT0gMCkKKyAg
ICB7CisgICAgICAgIERPTVBSSU5URigiJXM6IElucHV0IGlzIDAgc2l6ZSIs
IHdoYXQpOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCiAgICAgLyog
c2lnaC4gIFdlIGRvbid0IGtub3cgdXAtZnJvbnQgaG93IG11Y2ggbWVtb3J5
IHdlIGFyZSBnb2luZyB0byBuZWVkCiAgICAgICogZm9yIHRoZSBvdXRwdXQg
YnVmZmVyLiAgQWxsb2NhdGUgdGhlIG91dHB1dCBidWZmZXIgdG8gYmUgZXF1
YWwKICAgICAgKiB0aGUgaW5wdXQgYnVmZmVyIHRvIHN0YXJ0LCBhbmQgd2Un
bGwgcmVhbGxvYyBhcyBuZWVkZWQuCkBAIC0yNDQsMTMgKzI3NCwyMCBAQCBz
dGF0aWMgaW50IF94Y190cnlfbHptYV9kZWNvZGUoCiAgICAgICAgIGlmICgg
c3RyZWFtLT5hdmFpbF9vdXQgPT0gMCApCiAgICAgICAgIHsKICAgICAgICAg
ICAgIC8qIFByb3RlY3QgYWdhaW5zdCBvdXRwdXQgYnVmZmVyIG92ZXJmbG93
ICovCi0gICAgICAgICAgICBpZiAoIG91dHNpemUgPiBJTlRfTUFYIC8gMiAp
CisgICAgICAgICAgICBpZiAoIG91dHNpemUgPiBTSVpFX01BWCAvIDIgKQog
ICAgICAgICAgICAgewogICAgICAgICAgICAgICAgIERPTVBSSU5URigiJXM6
IG91dHB1dCBidWZmZXIgb3ZlcmZsb3ciLCB3aGF0KTsKICAgICAgICAgICAg
ICAgICBmcmVlKG91dF9idWYpOwogICAgICAgICAgICAgICAgIGdvdG8gbHpt
YV9jbGVhbnVwOwogICAgICAgICAgICAgfQogCisgICAgICAgICAgICBpZiAo
IHhjX2RvbV9rZXJuZWxfY2hlY2tfc2l6ZShkb20sIG91dHNpemUgKiAyKSAp
CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRE9NUFJJTlRGKCIl
czogb3V0cHV0IHRvbyBsYXJnZSIsIHdoYXQpOworICAgICAgICAgICAgICAg
IGZyZWUob3V0X2J1Zik7CisgICAgICAgICAgICAgICAgZ290byBsem1hX2Ns
ZWFudXA7CisgICAgICAgICAgICB9CisKICAgICAgICAgICAgIHRtcF9idWYg
PSByZWFsbG9jKG91dF9idWYsIG91dHNpemUgKiAyKTsKICAgICAgICAgICAg
IGlmICggdG1wX2J1ZiA9PSBOVUxMICkKICAgICAgICAgICAgIHsKQEAgLTM1
OSw2ICszOTYsMTIgQEAgc3RhdGljIGludCB4Y190cnlfbHpvMXhfZGVjb2Rl
KAogICAgICAgICAweDg5LCAweDRjLCAweDVhLCAweDRmLCAweDAwLCAweDBk
LCAweDBhLCAweDFhLCAweDBhCiAg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fZG9tX21hbGxvY19maWxlbWFwKGRvbSwgZmlsZW5hbWUs
ICZkb20tPnJhbWRpc2tfc2l6ZSk7CisgICAgICAgIHhjX2RvbV9tYWxsb2Nf
ZmlsZW1hcChkb20sIGZpbGVuYW1lLCAmZG9tLT5yYW1kaXNrX3NpemUsCisg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb20tPm1heF9yYW1kaXNr
X3NpemUpOworCiAgICAgaWYgKCBkb20tPnJhbWRpc2tfYmxvYiA9PSBOVUxM
ICkKICAgICAgICAgcmV0dXJuIC0xOwogLy8gICAgcmV0dXJuIHhjX2RvbV90
cnlfZ3VuemlwKGRvbSwgJmRvbS0+cmFtZGlza19ibG9iLCAmZG9tLT5yYW1k
aXNrX3NpemUpOwpAQCAtNzgzLDcgKzg0OCwxMSBAQCBpbnQgeGNfZG9tX2J1
aWxkX2ltYWdlKHN0cnVjdCB4Y19kb21faW1hCiAgICAgICAgIHZvaWQgKnJh
bWRpc2ttYXA7CiAKICAgICAgICAgdW56aXBsZW4gPSB4Y19kb21fY2hlY2tf
Z3ppcChkb20tPnhjaCwgZG9tLT5yYW1kaXNrX2Jsb2IsIGRvbS0+cmFtZGlz
a19zaXplKTsKKyAgICAgICAgaWYgKCB4Y19kb21fcmFtZGlza19jaGVja19z
aXplKGRvbSwgdW56aXBsZW4pICE9IDAgKQorICAgICAgICAgICAgdW56aXBs
ZW4gPSAwOworCiAgICAgICAgIHJhbWRpc2tsZW4gPSB1bnppcGxlbiA/IHVu
emlwbGVuIDogZG9tLT5yYW1kaXNrX3NpemU7CisKICAgICAgICAgaWYgKCB4
Y19kb21fYWxsb2Nfc2VnbWVudChkb20sICZkb20tPnJhbWRpc2tfc2VnLCAi
cmFtZGlzayIsIDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgcmFtZGlza2xlbikgIT0gMCApCiAgICAgICAgICAgICBnb3RvIGVycjsK

--=separator
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.xen.org
http://lists.xen.org/xen-devel

--=separator--


From xen-devel-bounces@lists.xen.org Tue Nov 13 12:56:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:56:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYG2f-0001Pl-Ho; Tue, 13 Nov 2012 12:56:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2d-0001NS-S4; Tue, 13 Nov 2012 12:56:36 +0000
Received: from [85.158.138.51:17606] by server-3.bemta-3.messagelabs.com id
	F8/84-31566-28342A05; Tue, 13 Nov 2012 12:56:34 +0000
X-Env-Sender: iwj@xenbits.xen.org
X-Msg-Ref: server-6.tower-174.messagelabs.com!1352811391!21808416!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30348 invoked from network); 13 Nov 2012 12:56:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Nov 2012 12:56:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2R-0008VH-9g; Tue, 13 Nov 2012 12:56:23 +0000
Received: from iwj by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2R-00010J-89; Tue, 13 Nov 2012 12:56:23 +0000
Date: Tue, 13 Nov 2012 12:56:23 +0000
Message-Id: <E1TYG2R-00010J-89@xenbits.xen.org>
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.428 (Entity 5.428)
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
	xen-users@lists.xen.org, oss-security@lists.openwall.com
From: Xen.org security team <security@xen.org>
Cc: "Xen.org security team" <security@xen.org>
Subject: [Xen-devel] Xen Security Advisory 25 (CVE-2012-4544,
 CVE-2012-2625) - Xen domain builder Out-of-memory due to malicious
 kernel/ramdisk
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--=separator
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

       Xen Security Advisory CVE-2012-4544,CVE-2012-2625 / XSA-25
                            version 2

   Xen domain builder Out-of-memory due to malicious kernel/ramdisk

UPDATES IN VERSION 2
====================

Clarify that XSA-25 is reporting, via the Xen.org security process,
both CVE-2012-4544 and CVE-2012-2625.

Also we would like to apologise for the fact that xen-announce's copy
of version 1 of this advisory was delayed in mailing list moderation.

ISSUE DESCRIPTION
=================

The Xen PV domain builder contained no validation of the size of the
supplied kernel or ramdisk either before or after decompression. This
could cause the toolstack to consume all available RAM in the domain
running the domain builder.  (CVE-2012-4544)

Additionally, under similar circumstances pygrub consume excessive
amount of memory under similar circumstances to the above.
(CVE-2012-2625)

IMPACT
======

A malicious guest administrator who can supply a kernel or ramdisk can
exhaust memory in domain 0 leading to a denial of service attack.

VULNERABLE SYSTEMS
==================

All versions of Xen are vulnerable.

MITIGATION
==========

Running only trusted kernels and ramdisks will avoid these
vulnerabilities.

Using pvgrub also avoids these vulnerabilities since the builder will
run in guest context. (nb: use of pygrub *is* vulnerable).

Running only HVM guests will avoid these vulnerabilities.

RESOLUTION
==========

Applying the appropriate attached patch resolves these issues.

The pygrub problem (CVE-2012-2625) was fixed in xen-unstable (and the
fix inherited by Xen 4.2.x) in revision 25589:60f09d1ab1fe but not
called out as a security problem.  This fix is also included, where
necessary, in the patches below.

xsa25-unstable.patch        Xen unstable
xsa25-4.2.patch             Xen 4.2.x
xsa25-4.1.patch             Xen 4.1.x

$ sha256sum xsa25*.patch
613e4b82cdc9cabf9cbd52076118887b298c47e680c2066a28a77f12e9f90606  xsa25-4.1.patch
135bc089d003f9b97991764c37b1ab8d37e9cbcfa1b9bd7429b4503abe00c8f5  xsa25-4.2.patch
534495b7eef6e599f5814f0a67fc84fbe2e8eee9d223a09ad178ff63bdcda3dd  xsa25-unstable.patch

Note that these patches impose a new size limit of 1Gby on both the
compressed and uncompressed sizes of ramdisks.  On some systems it may
be desirable to relax these limits and risk virtual address or memory
exhaustion in the toolstack.  This can be achieved by setting
XC_DOM_DECOMPRESS_MAX to the desired limit (in bytes). This can be
done by building with "APPEND_CFLAGS=-DXC_DOM_DECOMPRESS_MAX=<limit>"
or by editing tools/libxc/xc_dom.h directly.

NOTE REGARDING LACK OF EMBARGO
==============================

These issues have already been discussed in public in various places,
including https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2012-2625
and http://bugs.debian.org/688125.  This advisory is therefore not
subject to an embargo.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJQokGyAAoJEIP+FMlX6CvZl7wH/RdoQHGDcbgVEh5fuS5VzPpw
RZ0sm6bpI7eclqaN6+thX9SA5qeycvyj2zq769yUGSiHR+BUNw6HRJZ+XAAF0IIx
nb4VEdS2+Hz1kyTUAeZu3z/5HyfFamKY9Lhhj/47DBTtO5Xl1pjOCA0bC4ZDtIm1
ffFVhOmTcmQEWXW1z27Vj9hSgQeGsqHTcOys6H0nYpLITDIZqBkGv8MZl4X0/Wtl
zs2prG8HEWsysKel5Q/dt7De84OV3LgP1/2a+aMkLi+RgKWP+naKAXfYqVAS4mLw
K+mv2MrmhgNxzEWp/sZX0q1QNvnJf+xKYHOBcP+hUlQIQwD/NQejdAdmNVPem7s=
=Pfj+
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa25-4.1.patch"
Content-Disposition: attachment; filename="xsa25-4.1.patch"
Content-Transfer-Encoding: base64

bGlieGM6IGJ1aWxkZXI6IGxpbWl0IG1heGltdW0gc2l6ZSBvZiBrZXJuZWwv
cmFtZGlzay4KCkFsbG93aW5nIHVzZXIgc3VwcGxpZWQga2VybmVscyBvZiBh
cmJpdHJhcnkgc2l6ZXMsIGVzcGVjaWFsbHkgZHVyaW5nCmRlY29tcHJlc3Np
b24sIGNhbiBzd2FsbG93IHVwIGRvbTAgbWVtb3J5IGxlYWRpbmcgdG8gZWl0
aGVyIHZpcnR1YWwKYWRkcmVzcyBzcGFjZSBleGhhdXN0aW9uIGluIHRoZSBi
dWlsZGVyIHByb2Nlc3Mgb3IgYWxsb2NhdGlvbgpmYWlsdXJlcy9PT00ga2ls
bGluZyBvZiBib3RoIHRvb2xzdGFjayBhbmQgdW5yZWxhdGVkIHByb2Nlc3Nl
cy4KCldlIGRpc2FibGUgdGhlc2UgY2hlY2tzIHdoZW4gYnVpbGRpbmcgaW4g
YSBzdHViIGRvbWFpbiBmb3IgcHZncnViCnNpbmNlIHRoaXMgdXNlcyB0aGUg
Z3Vlc3QncyBvd24gbWVtb3J5IGFuZCBpcyBpc29sYXRlZC4KCk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lzIGEgc2l6
ZV90LiBDaGVjayB3ZSBhcmVuJ3Qgb3ZlcmZsb3dpbmcuCisgICAgICovCisg
ICAgaWYgKCBvdXRzaXplICE9IGRvbS0+a2VybmVsX3NpemUgKQorICAgIHsK
KyAgICAgICAgRE9NUFJJTlRGKCJCWklQMjogSW5wdXQgdG9vIGxhcmdlIik7
CisgICAgICAgIGdvdG8gYnppcDJfY2xlYW51cDsKKyAgICB9CisKICAgICBv
dXRfYnVmID0gbWFsbG9jKG91dHNpemUpOwogICAgIGlmICggb3V0X2J1ZiA9
PSBOVUxMICkKICAgICB7CkBAIC05OCwxMyArMTE1LDIwIEBAIHN0YXRpYyBp
bnQgeGNfdHJ5X2J6aXAyX2RlY29kZSgKICAgICAgICAgaWYgKCBzdHJlYW0u
YXZhaWxfb3V0ID09IDAgKQogICAgICAgICB7CiAgICAgICAgICAgICAvKiBQ
cm90ZWN0IGFnYWluc3Qgb3V0cHV0IGJ1ZmZlciBvdmVyZmxvdyAqLwotICAg
ICAgICAgICAgaWYgKCBvdXRzaXplID4gSU5UX01BWCAvIDIgKQorICAgICAg
ICAgICAgaWYgKCBvdXRzaXplID4gVUlOVF9NQVggLyAyICkKICAgICAgICAg
ICAgIHsKICAgICAgICAgICAgICAgICBET01QUklOVEYoIkJaSVAyOiBvdXRw
dXQgYnVmZmVyIG92ZXJmbG93Iik7CiAgICAgICAgICAgICAgICAgZnJlZShv
dXRfYnVmKTsKICAgICAgICAgICAgICAgICBnb3RvIGJ6aXAyX2NsZWFudXA7
CiAgICAgICAgICAgICB9CiAKKyAgICAgICAgICAgIGlmICggeGNfZG9tX2tl
cm5lbF9jaGVja19zaXplKGRvbSwgb3V0c2l6ZSAqIDIpICkKKyAgICAgICAg
ICAgIHsKKyAgICAgICAgICAgICAgICBET01QUklOVEYoIkJaSVAyOiBvdXRw
dXQgdG9vIGxhcmdlIik7CisgICAgICAgICAgICAgICAgZnJlZShvdXRfYnVm
KTsKKyAgICAgICAgICAgICAgICBnb3RvIGJ6aXAyX2NsZWFudXA7CisgICAg
ICAgICAgICB9CisKICAgICAgICAgICAgIHRtcF9idWYgPSByZWFsbG9jKG91
dF9idWYsIG91dHNpemUgKiAyKTsKICAgICAgICAgICAgIGlmICggdG1wX2J1
ZiA9PSBOVUxMICkKICAgICAgICAgICAgIHsKQEAgLTE3Miw5ICsxOTYsMTUg
QEAgc3RhdGljIGludCB4Y190cnlfbHptYV9kZWNvZGUoCiAgICAgdW5zaWdu
ZWQgY2hhciAqb3V0X2J1ZjsKICAgICB1bnNpZ25lZCBjaGFyICp0bXBfYnVm
OwogICAgIGludCByZXR2YWwgPSAtMTsKLSAgICBpbnQgb3V0c2l6ZTsKKyAg
ICBzaXplX3Qgb3V0c2l6ZTsKICAgICBjb25zdCBjaGFyICptc2c7CiAKKyAg
ICBpZiAoIGRvbS0+a2VybmVsX3NpemUgPT0gMCkKKyAgICB7CisgICAgICAg
IERPTVBSSU5URigiTFpNQTogSW5wdXQgaXMgMCBzaXplIik7CisgICAgICAg
IHJldHVybiAtMTsKKyAgICB9CisKICAgICByZXQgPSBsem1hX2Fsb25lX2Rl
Y29kZXIoJnN0cmVhbSwgMTI4KjEwMjQqMTAyNCk7CiAgICAgaWYgKCByZXQg
IT0gTFpNQV9PSyApCiAgICAgewpAQCAtMjUxLDEzICsyODEsMjAgQEAgc3Rh
dGljIGludCB4Y190cnlfbHptYV9kZWNvZGUoCiAgICAgICAgIGlmICggc3Ry
ZWFtLmF2YWlsX291dCA9PSAwICkKICAgICAgICAgewogICAgICAgICAgICAg
LyogUHJvdGVjdCBhZ2FpbnN0IG91dHB1dCBidWZmZXIgb3ZlcmZsb3cgKi8K
LSAgICAgICAgICAgIGlmICggb3V0c2l6ZSA+IElOVF9NQVggLyAyICkKKyAg
ICAgICAgICAgIGlmICggb3V0c2l6ZSA+IFNJWkVfTUFYIC8gMiApCiAgICAg
ICAgICAgICB7CiAgICAgICAgICAgICAgICAgRE9NUFJJTlRGKCJMWk1BOiBv
dXRwdXQgYnVmZmVyIG92ZXJmbG93Iik7CiAgICAgICAgICAgICAgICAgZnJl
ZShvdXRfYnVmKTsKICAgICAgICAgICAgICAgICBnb3RvIGx6bWFfY2xlYW51
cDsKICAgICAgICAgICAgIH0KIAorICAgICAgICAgICAgaWYgKCB4Y19kb21f
a2VybmVsX2NoZWNrX3NpemUoZG9tLCBvdXRzaXplICogMikgKQorICAgICAg
ICAgICAgeworICAgICAgICAgICAgICAgIERPTVBSSU5URigiTFpNQTogb3V0
cHV0IHRvbyBsYXJnZSIpOworICAgICAgICAgICAgICAgIGZyZWUob3V0X2J1
Zik7CisgICAgICAgICAgICAgICAgZ290byBsem1hX2NsZWFudXA7CisgICAg
ICAgICAgICB9CisKICAgICAgICAgICAgIHRtcF9idWYgPSByZWFsbG9jKG91
dF9idWYsIG91dHNpemUgKiAyKTsKICAgICAgICAgICAgIGlmICggdG1wX2J1
ZiA9PSBOVUxMICkKICAgICAgICAgICAgIHsKQEAgLTMyNyw2ICszNjQsMTIg
QEAgc3RhdGljIGludCB4Y190cnlfbHpvMXhfZGVjb2RlKAogICAgICAgICAw
eDg5LCAweDRjLCAweDVhLCAweDRmLCAweDAwLCAweDBkLCAweDBhLCAweDFh
LCAweDBhCiAgICAgfTsKIAorICAgIC8qCisgICAgICogbHpvX3VpbnQgc2hv
dWxkIG1hdGNoIHNpemVfdC4gQ2hlY2sgdGhhdCB0aGlzIGlzIHRoZSBjYXNl
IHRvIGJlCisgICAgICogc3VyZSB3ZSB3b24ndCBvdmVyZmxvdyB2YXJpb3Vz
IGx6b191aW50IGZpZWxkcy4KKyAgICAgKi8KKyAgICBYQ19CVUlMRF9CVUdf
T04oc2l6ZW9mKGx6b191aW50KSAhPSBzaXplb2Yoc2l6ZV90KSk7CisKICAg
ICByZXQgPSBsem9faW5pdCgpOwogICAgIGlmICggcmV0ICE9IExaT19FX09L
ICkKICAgICB7CkBAIC00MDYsNiArNDQ5LDE0IEBAIHN0YXRpYyBpbnQgeGNf
dHJ5X2x6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ZmZXIgc2l6aW5nICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCitpbnQgeGNfZG9tX2tl
cm5lbF9jaGVja19zaXplKHN0cnVjdCB4Y19kb21faW1hZ2UgKmRvbSwgc2l6
ZV90IHN6KQoreworICAgIC8qIE5vIGxpbWl0ICovCisgICAgaWYgKCAhZG9t
LT5tYXhfa2VybmVsX3NpemUgKQorICAgICAgICByZXR1cm4gMDsKKworICAg
IGlmICggc3ogPiBkb20tPm1heF9rZXJuZWxfc2l6ZSApCisgICAgeworICAg
ICAgICB4Y19kb21fcGFuaWMoZG9tLT54Y2gsIFhDX0lOVkFMSURfS0VSTkVM
LAorICAgICAgICAgICAgICAgICAgICAgImtlcm5lbCBpbWFnZSB0b28gbGFy
Z2UiKTsKKyAgICAgICAgcmV0dXJuIDE7CisgICAgfQorCisgICAgcmV0dXJu
IDA7Cit9CisKK2ludCB4Y19kb21fcmFtZGlza19jaGVja19zaXplKHN0cnVj
dCB4Y19kb21faW1hZ2UgKmRvbSwgc2l6ZV90IHN6KQoreworICAgIC8qIE5v
IGxpbWl0ICovCisgICAgaWYgKCAhZG9tLT5tYXhfcmFtZGlza19zaXplICkK
KyAgICAgICAgcmV0dXJuIDA7CisKKyAgICBpZiAoIHN6ID4gZG9tLT5tYXhf
cmFtZGlza19zaXplICkKKyAgICB7CisgICAgICAgIHhjX2RvbV9wYW5pYyhk
b20tPnhjaCwgWENfSU5WQUxJRF9LRVJORUwsCisgICAgICAgICAgICAgICAg
ICAgICAicmFtZGlzayBpbWFnZSB0b28gbGFyZ2UiKTsKKyAgICAgICAgcmV0
dXJuIDE7CisgICAgfQorCisgICAgcmV0dXJuIDA7Cit9CisKKy8qIC0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwogLyogcmVhZCBmaWxlcywgY29w
eSBtZW1vc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isgICAgICAgICAgICBpZiBsZW4oZGF0
YSkgPT0gMDoKKyAgICAgICAgICAgICAgICBvcy5jbG9zZSh0ZmQpCisgICAg
ICAgICAgICAgICAgZGVsIGRhdGFmaWxlCisgICAgICAgICAgICAgICAgcmV0
dXJuIHJldAorICAgICAgICAgICAgdHJ5OgorICAgICAgICAgICAgICAgIG9z
LndyaXRlKHRmZCwgZGF0YSkKKyAgICAgICAgICAgIGV4Y2VwdCBFeGNlcHRp
b24sIGU6CisgICAgICAgICAgICAgICAgcHJpbnQgPj5zeXMuc3RkZXJyLCBl
CisgICAgICAgICAgICAgICAgb3MuY2xvc2UodGZkKQorICAgICAgICAgICAg
ICAgIG9zLnVubGluayhyZXQpCisgICAgICAgICAgICAgICAgZGVsIGRhdGFm
aWxlCisgICAgICAgICAgICAgICAgc3lzLmV4aXQoIkVycm9yIHdyaXRpbmcg
dGVtcG9yYXJ5IGNvcHkgb2YgIitmaWxlX3R5cGUpCisgICAgICAgICAgICBk
YXRhb2ZmICs9IGxlbihkYXRhKQorCiAgICAgdHJ5OgogICAgICAgICBvcHRz
LCBhcmdzID0gZ2V0b3B0LmdudV9nZXRvcHQoc3lzLmFyZ3ZbMTpdLCAncWlu
aDo6JywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWyJx
dWlldCIsICJpbnRlcmFjdGl2ZSIsICJub3QtcmVhbGx5IiwgImhlbHAiLCAK
QEAgLTc4NiwyNCArODE5LDE4IEBAIGlmIF9fbmFtZV9fID09ICJfX21haW5f
XyI6CiAgICAgaWYgbm90IGZzOgogICAgICAgICByYWlzZSBSdW50aW1lRXJy
b3IsICJVbmFibGUgdG8gZmluZCBwYXJ0aXRpb24gY29udGFpbmluZyBrZXJu
ZWwiCiAKLSAgICBpZiBub3RfcmVhbGx5OgotICAgICAgICBib290Y2ZnWyJr
ZXJuZWwiXSA9ICI8a2VybmVsOiVzPiIgJSBjaG9zZW5jZmdbImtlcm5lbCJd
Ci0gICAgZWxzZToKLSA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mZ1sicmFtZGlzayJdID0g
Y29weV9mcm9tX2ltYWdlKGZzLCBjaG9zZW5jZmdbInJhbWRpc2siXSwKKyAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAicmFtZGlzayIsIG91dHB1dF9kaXJlY3RvcnksCisgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm90X3JlYWxs
eSkKKyAgICAgICAgZXhjZXB0OgorICAgICAgICAgICAgaWYgbm90IG5vdF9y
ZWFsbHk6CisgICAgICAgICAgICAgICAgb3MudW5saW5rKGJvb3RjZmdbImtl
cm5lbCJdKQorICAgICAgICAgICAgcmFpc2UKICAgICBlbHNlOgogICAgICAg
ICBpbml0cmQgPSBOb25lCiAK

--=separator
Content-Type: application/octet-stream; name="xsa25-4.2.patch"
Content-Disposition: attachment; filename="xsa25-4.2.patch"
Content-Transfer-Encoding: base64

bGlieGM6IGJ1aWxkZXI6IGxpbWl0IG1heGltdW0gc2l6ZSBvZiBrZXJuZWwv
cmFtZGlzay4KCkFsbG93aW5nIHVzZXIgc3VwcGxpZWQga2VybmVscyBvZiBh
cmJpdHJhcnkgc2l6ZXMsIGVzcGVjaWFsbHkgZHVyaW5nCmRlY29tcHJlc3Np
b24sIGNhbiBzd2FsbG93IHVwIGRvbTAgbWVtb3J5IGxlYWRpbmcgdG8gZWl0
aGVyIHZpcnR1YWwKYWRkcmVzcyBzcGFjZSBleGhhdXN0aW9uIGluIHRoZSBi
dWlsZGVyIHByb2Nlc3Mgb3IgYWxsb2NhdGlvbgpmYWlsdXJlcy9PT00ga2ls
bGluZyBvZiBib3RoIHRvb2xzdGFjayBhbmQgdW5yZWxhdGVkIHByb2Nlc3Nl
cy4KCldlIGRpc2FibGUgdGhlc2UgY2hlY2tzIHdoZW4gYnVpbGRpbmcgaW4g
YSBzdHViIGRvbWFpbiBmb3IgcHZncnViCnNpbmNlIHRoaXMgdXNlcyB0aGUg
Z3Vlc3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2UgYXJlbid0IG92ZXJmbG93aW5nLgorICAgICAqLworICAgIGlm
ICggb3V0c2l6ZSAhPSBkb20tPmtlcm5lbF9zaXplICkKKyAgICB7CisgICAg
ICAgIERPTVBSSU5URigiQlpJUDI6IElucHV0IHRvbyBsYXJnZSIpOworICAg
ICAgICBnb3RvIGJ6aXAyX2NsZWFudXA7CisgICAgfQorCiAgICAgb3V0X2J1
ZiA9IG1hbGxvYyhvdXRzaXplKTsKICAgICBpZiAoIG91dF9idWYgPT0gTlVM
TCApCiAgICAgewpAQCAtOTgsMTMgKzExNSwyMCBAQCBzdGF0aWMgaW50IHhj
X3RyeV9iemlwMl9kZWNvZGUoCiAgICAgICAgIGlmICggc3RyZWFtLmF2YWls
X291dCA9PSAwICkKICAgICAgICAgewogICAgICAgICAgICAgLyogUHJvdGVj
dCBhZ2FpbnN0IG91dHB1dCBidWZmZXIgb3ZlcmZsb3cgKi8KLSAgICAgICAg
ICAgIGlmICggb3V0c2l6ZSA+IElOVF9NQVggLyAyICkKKyAgICAgICAgICAg
IGlmICggb3V0c2l6ZSA+IFVJTlRfTUFYIC8gMiApCiAgICAgICAgICAgICB7
CiAgICAgICAgICAgICAgICAgRE9NUFJJTlRGKCJCWklQMjogb3V0cHV0IGJ1
ZmZlciBvdmVyZmxvdyIpOwogICAgICAgICAgICAgICAgIGZyZWUob3V0X2J1
Zik7CiAgICAgICAgICAgICAgICAgZ290byBiemlwMl9jbGVhbnVwOwogICAg
ICAgICAgICAgfQogCisgICAgICAgICAgICBpZiAoIHhjX2RvbV9rZXJuZWxf
Y2hlY2tfc2l6ZShkb20sIG91dHNpemUgKiAyKSApCisgICAgICAgICAgICB7
CisgICAgICAgICAgICAgICAgRE9NUFJJTlRGKCJCWklQMjogb3V0cHV0IHRv
byBsYXJnZSIpOworICAgICAgICAgICAgICAgIGZyZWUob3V0X2J1Zik7Cisg
ICAgICAgICAgICAgICAgZ290byBiemlwMl9jbGVhbnVwOworICAgICAgICAg
ICAgfQorCiAgIC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ggLyAyICkKKyAgICAgICAgICAgIGlm
ICggb3V0c2l6ZSA+IFNJWkVfTUFYIC8gMiApCiAgICAgICAgICAgICB7CiAg
ICAgICAgICAgICAgICAgRE9NUFJJTlRGKCIlczogb3V0cHV0IGJ1ZmZlciBv
dmVyZmxvdyIsIHdoYXQpOwogICAgICAgICAgICAgICAgIGZyZWUob3V0X2J1
Zik7CiAgICAgICAgICAgICAgICAgZ290byBsem1hX2NsZWFudXA7CiAgICAg
ICAgICAgICB9CiAKKyAgICAgICAgICAgIGlmICggeGNfZG9tX2tlcm5lbF9j
aGVja19zaXplKGRvbSwgb3V0c2l6ZSAqIDIpICkKKyAgICAgICAgICAgIHsK
KyAgICAgICAgICAgICAgICBET01QUklOVEYoIiVzOiBvdXRwdXQgdG9vIGxh
cmdlIiwgd2hhdCk7CisgICAgICAgICAgICAgICAgZnJlZShvdXRfYnVmKTsK
KyAgICAgICAgICAgICAgICBnb3RvIGx6bWFfY2xlYW51cDsKKyAgICAgICAg
ICAgIH0KKwogICAgICAgICAgICAgdG1wX2J1ZiA9IHJlYWxsb2Mob3V0X2J1
Ziwgb3V0c2l6ZSAqIDIpOwogICAgICAgICAgICAgaWYgKCB0bXBfYnVmID09
IE5VTEwgKQogICAgICAgICAgICAgewpAQCAtMzU5LDYgKzM5NiwxMiBAQCBz
dGF0aWMgaW50IHhjX3RyeV9sem8xeF9kZWNvZGUoCiAgICAgICAgIDB4ODks
IDB4NGMsIDB4NWEsIDB4NGYsIDB4MDAsIDB4MGQsIDB4MGEsIDB4MWEsIDB4
MGEKICAgICB9OwogCisgICAgLyoKKyAgICAgKiBsem9fdWludCBzaG91bGQg
bWF0Y2ggc2l6ZV90LiBDaGVjayB0aGF0IHRoaXMgaXMgdGhlIGNhc2UgdG8g
YmUKKyAgICAgKiBzdXJlIHdlIHdvbid0IG92ZXJmbG93IHZhcmlvdXMgbHpv
X3VpbnQgZmllbGRzLgorICAgICAqLworICAgIFhDX0JVSUxEX0JVR19PTihz
aXplb2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KnN0cikKIH0K
IAogLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiBkZWNv
bXByZXNzaW9uIGJ1ZmZlciBzaXppbmcgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgKi8KK2ludCB4Y19kb21fa2VybmVs
X2NoZWNrX3NpemUoc3RydWN0IHhjX2RvbV9pbWFnZSAqZG9tLCBzaXplX3Qg
c3opCit7CisgICAgLyogTm8gbGltaXQgKi8KKyAgICBpZiAoICFkb20tPm1h
eF9rZXJuZWxfc2l6ZSApCisgICAgICAgIHJldHVybiAwOworCisgICAgaWYg
KCBzeiA+IGRvbS0+bWF4X2tlcm5lbF9zaXplICkKKyAgICB7CisgICAgICAg
IHhjX2RvbV9wYW5pYyhkb20tPnhjaCwgWENfSU5WQUxJRF9LRVJORUwsCisg
ICAgICAgICAgICAgICAgICAgICAia2VybmVsIGltYWdlIHRvbyBsYXJnZSIp
OworICAgICAgICByZXR1cm4gMTsKKyAgICB9CisKKyAgICByZXR1cm4gMDsK
K30KKworaW50IHhjX2RvbV9yYW1kaXNrX2NoZWNrX3NpemUoc3RydWN0IHhj
X2RvbV9pbWFnZSAqZG9tLCBzaXplX3Qgc3opCit7CisgICAgLyogTm8gbGlt
aXQgKi8KKyAgICBpZiAoICFkb20tPm1heF9yYW1kaXNrX3NpemUgKQorICAg
ICAgICByZXR1cm4gMDsKKworICAgIGlmICggc3ogPiBkb20tPm1heF9yYW1k
aXNrX3NpemUgKQorICAgIHsKKyAgICAgICAgeGNfZG9tX3BhbmljKGRvbS0+
eGNoLCBYQ19JTlZBTElEX0tFUk5FTCwKKyAgICAgICAgICAgICAgICAgICAg
ICJyYW1kaXNrIGltYWdlIHRvbyBsYXJnZSIpOworICAgICAgICByZXR1cm4g
MTsKKyAgICB9CisKKyAgICByZXR1cm4gMDsKK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sIGZpbGVuYW1lLCAmZG9tLT5yYW1kaXNrX3NpemUpOworICAgICAgICB4
Y19kb21fbWFsbG9jX2ZpbGVtYXAoZG9tLCBmaWxlbmFtZSwgJmRvbS0+cmFt
ZGlza19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9t
LT5tYXhfcmFtZGlza19zaXplKTsKKwogICAgIGlmICggZG9tLT5yYW1kaXNr
X2Jsb2IgPT0gTlVMTCApCiAgICAgICAgIHJldHVybiAtMTsKIC8vICAgIHJl
dHVybiB4Y19kb21fdHJ5X2d1bnppcChkb20sICZkb20tPnJhbWRpc2tfYmxv
YiwgJmRvbS0+cmFtZGlza19zaXplKTsKQEAgLTc4MSw3ICs4NDYsMTEgQEAg
aW50IHhjX2RvbV9idWlsZF9pbWFnZShzdHJ1Y3QgeGNfZG9tX2ltYWdlICpk
b20pCiAgICAgICAgIHZvaWQgKnJhbWRpc2ttYXA7CiAKICAgICAgICAgdW56
aXBsZW4gPSB4Y19kb21fY2hlY2tfZ3ppcChkb20tPnhjaCwgZG9tLT5yYW1k
aXNrX2Jsb2IsIGRvbS0+cmFtZGlza19zaXplKTsKKyAgICAgICAgaWYgKCB4
Y19kb21fcmFtZGlza19jaGVja19zaXplKGRvbSwgdW56aXBsZW4pICE9IDAg
KQorICAgICAgICAgICAgdW56aXBsZW4gPSAwOworCiAgICAgICAgIHJhbWRp
c2tsZW4gPSB1bnppcGxlbiA/IHVuemlwbGVuIDogZG9tLT5yYW1kaXNrX3Np
emU7CisKICAgICAgICAgaWYgKCB4Y19kb21fYWxsb2Nfc2VnbWVudChkb20s
ICZkb20tPnJhbWRpc2tfc2VnLCAicmFtZGlzayIsIDAsCiAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgcmFtZGlza2xlbikgIT0gMCApCiAg
ICAgICAgICAgICBnb3RvIGVycjsK

--=separator
Content-Type: application/octet-stream; name="xsa25-unstable.patch"
Content-Disposition: attachment; filename="xsa25-unstable.patch"
Content-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b3RlY3QgYWdhaW5zdCBvdXRwdXQgYnVmZmVyIG92ZXJm
bG93ICovCi0gICAgICAgICAgICBpZiAoIG91dHNpemUgPiBJTlRfTUFYIC8g
MiApCisgICAgICAgICAgICBpZiAoIG91dHNpemUgPiBVSU5UX01BWCAvIDIg
KQogICAgICAgICAgICAgewogICAgICAgICAgICAgICAgIERPTVBSSU5URigi
QlpJUDI6IG91dHB1dCBidWZmZXIgb3ZlcmZsb3ciKTsKICAgICAgICAgICAg
ICAgICBmcmVlKG91dF9idWYpOwogICAgICAgICAgICAgICAgIGdvdG8gYnpp
cDJfY2xlYW51cDsKICAgICAgICAgICAgIH0KIAorICAgICAgICAgICAgaWYg
KCB4Y19kb21fa2VybmVsX2NoZWNrX3NpemUoZG9tLCBvdXRzaXplICogMikg
KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIERPTVBSSU5URigi
QlpJUDI6IG91dHB1dCB0b28gbGFyZ2UiKTsKKyAgICAgICAgICAgICAgICBm
cmVlKG91dF9idWYpOworICAgICAgICAgICAgICAgIGdvdG8gYnppcDJfY2xl
YW51cDsKKyAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgdG1wX2J1ZiA9
IHJlYWxsb2Mob3V0X2J1Ziwgb3V0c2l6ZSAqIDIpOwogICAgICAgICAgICAg
aWYgKCB0bXBfYnVmID09IE5VTEwgKQogICAgICAgICAgICAgewpAQCAtMTcy
LDkgKzE5NiwxNSBAQCBzdGF0aWMgaW50IF94Y190cnlfbHptYV9kZWNvZGUo
CiAgICAgdW5zaWduZWQgY2hhciAqb3V0X2J1ZjsKICAgICB1bnNpZ25lZCBj
aGFyICp0bXBfYnVmOwogICAgIGludCByZXR2YWwgPSAtMTsKLSAgICBpbnQg
b3V0c2l6ZTsKKyAgICBzaXplX3Qgb3V0c2l6ZTsKICAgICBjb25zdCBjaGFy
ICptc2c7CiAKKyAgICBpZiAoIGRvbS0+a2VybmVsX3NpemUgPT0gMCkKKyAg
ICB7CisgICAgICAgIERPTVBSSU5URigiJXM6IElucHV0IGlzIDAgc2l6ZSIs
IHdoYXQpOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCiAgICAgLyog
c2lnaC4gIFdlIGRvbid0IGtub3cgdXAtZnJvbnQgaG93IG11Y2ggbWVtb3J5
IHdlIGFyZSBnb2luZyB0byBuZWVkCiAgICAgICogZm9yIHRoZSBvdXRwdXQg
YnVmZmVyLiAgQWxsb2NhdGUgdGhlIG91dHB1dCBidWZmZXIgdG8gYmUgZXF1
YWwKICAgICAgKiB0aGUgaW5wdXQgYnVmZmVyIHRvIHN0YXJ0LCBhbmQgd2Un
bGwgcmVhbGxvYyBhcyBuZWVkZWQuCkBAIC0yNDQsMTMgKzI3NCwyMCBAQCBz
dGF0aWMgaW50IF94Y190cnlfbHptYV9kZWNvZGUoCiAgICAgICAgIGlmICgg
c3RyZWFtLT5hdmFpbF9vdXQgPT0gMCApCiAgICAgICAgIHsKICAgICAgICAg
ICAgIC8qIFByb3RlY3QgYWdhaW5zdCBvdXRwdXQgYnVmZmVyIG92ZXJmbG93
ICovCi0gICAgICAgICAgICBpZiAoIG91dHNpemUgPiBJTlRfTUFYIC8gMiAp
CisgICAgICAgICAgICBpZiAoIG91dHNpemUgPiBTSVpFX01BWCAvIDIgKQog
ICAgICAgICAgICAgewogICAgICAgICAgICAgICAgIERPTVBSSU5URigiJXM6
IG91dHB1dCBidWZmZXIgb3ZlcmZsb3ciLCB3aGF0KTsKICAgICAgICAgICAg
ICAgICBmcmVlKG91dF9idWYpOwogICAgICAgICAgICAgICAgIGdvdG8gbHpt
YV9jbGVhbnVwOwogICAgICAgICAgICAgfQogCisgICAgICAgICAgICBpZiAo
IHhjX2RvbV9rZXJuZWxfY2hlY2tfc2l6ZShkb20sIG91dHNpemUgKiAyKSAp
CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRE9NUFJJTlRGKCIl
czogb3V0cHV0IHRvbyBsYXJnZSIsIHdoYXQpOworICAgICAgICAgICAgICAg
IGZyZWUob3V0X2J1Zik7CisgICAgICAgICAgICAgICAgZ290byBsem1hX2Ns
ZWFudXA7CisgICAgICAgICAgICB9CisKICAgICAgICAgICAgIHRtcF9idWYg
PSByZWFsbG9jKG91dF9idWYsIG91dHNpemUgKiAyKTsKICAgICAgICAgICAg
IGlmICggdG1wX2J1ZiA9PSBOVUxMICkKICAgICAgICAgICAgIHsKQEAgLTM1
OSw2ICszOTYsMTIgQEAgc3RhdGljIGludCB4Y190cnlfbHpvMXhfZGVjb2Rl
KAogICAgICAgICAweDg5LCAweDRjLCAweDVhLCAweDRmLCAweDAwLCAweDBk
LCAweDBhLCAweDFhLCAweDBhCiAgICAgfTsKIAorICAgIC8qCisgICAgICog
bHpvX3VpbnQgc2hvdWxkIG1hdGNoIHNpemVfdC4gQ2hlY2sgdGhhdCB0aGlz
IGlzIHRoZSBjYXNlIHRvIGJlCisgICAgICogc3VyZSB3ZSB3b24ndCBvdmVy
ZmxvdyB2YXJpb3VzIGx6b191aW50IGZpZWxkcy4KKyAgICAgKi8KKyAgICBY
Q19CVUlMRF9CVUdfT04oc2l6ZW9mKGx6b191aW50KSAhPSBzaXplb2Yoc2l6
ZV90KSk7CisKICAgICByZXQgPSBsem9faW5pdCgpOwogICAgIGlmICggcmV0
ICE9IExaT19FX09LICkKICAgICB7CkBAIC00MzgsNiArNDgxLDE0IEBAIHN0
YXRpYyBpbnQgeGNfdHJ5X2x6bzF4X2RlY29kZSgKICAgICAgICAgaWYgKCBz
cmNfbGVuIDw9IDAgfHwgc3JjX2xlbiA+IGRzdF9sZW4gfHwgc3JjX2xlbiA+
IGxlZnQgKQogICAgICAgICAgICAgYnJlYWs7CiAKKyAgICAgICAgbXNnID0g
Ik91dHB1dCBidWZmZXIgb3ZlcmZsb3ciOworICAgICAgICBpZiAoICpzaXpl
ID4gU0laRV9NQVggLSBkc3RfbGVuICkKKyAgICAgICAgICAgIGJyZWFrOwor
CisgICAgICAgIG1zZyA9ICJEZWNvbXByZXNzZWQgaW1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ICs2NTgsMjUgQEAg
c3RydWN0IHhjX2RvbV9pbWFnZSAqeGNfZG9tX2FsbG9jYXRlKHhjXwogICAg
IHJldHVybiBOVUxMOwogfQogCitpbnQgeGNfZG9tX2tlcm5lbF9tYXhfc2l6
ZShzdHJ1Y3QgeGNfZG9tX2ltYWdlICpkb20sIHNpemVfdCBzeikKK3sKKyAg
ICBET01QUklOVEYoIiVzOiBrZXJuZWxfbWF4X3NpemU9JXp4IiwgX19GVU5D
VElPTl9fLCBzeik7CisgICAgZG9tLT5tYXhfa2VybmVsX3NpemUgPSBzejsK
KyAgICByZXR1cm4gMDsKK30KKworaW50IHhjX2RvbV9yYW1kaXNrX21heF9z
aXplKHN0cnVjdCB4Y19kb21faW1hZ2UgKmRvbSwgc2l6ZV90IHN6KQorewor
ICAgIERPTVBSSU5URigiJXM6IHJhbWRpc2tfbWF4X3NpemU9JXp4IiwgX19G
VU5DVElPTl9fLCBzeik7CisgICAgZG9tLT5tYXhfcmFtZGlza19zaXplID0g
c3o7CisgICAgcmV0dXJuIDA7Cit9CisKIGludCB4Y19kb21fa2VybmVsX2Zp
bGUoc3RydWN0IHhjX2RvbV9pbWFnZSAqZG9tLCBjb25zdCBjaGFyICpmaWxl
bmFtZSkKIHsKICAgICBET01QUklOVEYoIiVzOiBmaWxlbmFtZT1cIiVzXCIi
LCBfX0ZVTkNUSU9OX18sIGZpbGVuYW1lKTsKLSAgICBkb20tPmtlcm5lbF9i
bG9iID0geGNfZG9tX21hbGxvY19maWxlbWFwKGRvbSwgZmlsZW5hbWUsICZk
b20tPmtlcm5lbF9zaXplKTsKKyAgICBkb20tPmtlcm5lbF9ibG9iID0geGNf
ZG9tX21hbGxvY19maWxlbWFwKGRvbSwgZmlsZW5hbWUsICZkb20tPmtlcm5l
bF9zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgZG9tLT5tYXhfa2VybmVsX3NpemUpOwogICAgIGlmICggZG9t
LT5rZXJuZWxf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sZW4pICE9IDAgKQorICAgICAgICAgICAgdW56aXBs
ZW4gPSAwOworCiAgICAgICAgIHJhbWRpc2tsZW4gPSB1bnppcGxlbiA/IHVu
emlwbGVuIDogZG9tLT5yYW1kaXNrX3NpemU7CisKICAgICAgICAgaWYgKCB4
Y19kb21fYWxsb2Nfc2VnbWVudChkb20sICZkb20tPnJhbWRpc2tfc2VnLCAi
cmFtZGlzayIsIDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgcmFtZGlza2xlbikgIT0gMCApCiAgICAgICAgICAgICBnb3RvIGVycjsK

--=separator
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.xen.org
http://lists.xen.org/xen-devel

--=separator--


From xen-devel-bounces@lists.xen.org Tue Nov 13 12:56:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:56:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYG2d-0001Na-71; Tue, 13 Nov 2012 12:56:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2a-0001M3-RT; Tue, 13 Nov 2012 12:56:33 +0000
Received: from [85.158.139.83:49729] by server-14.bemta-5.messagelabs.com id
	6B/EC-21768-F7342A05; Tue, 13 Nov 2012 12:56:31 +0000
X-Env-Sender: iwj@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1352811383!30047820!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28709 invoked from network); 13 Nov 2012 12:56:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Nov 2012 12:56:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2H-0008UJ-Od; Tue, 13 Nov 2012 12:56:13 +0000
Received: from iwj by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2H-0000zc-Mt; Tue, 13 Nov 2012 12:56:13 +0000
Date: Tue, 13 Nov 2012 12:56:13 +0000
Message-Id: <E1TYG2H-0000zc-Mt@xenbits.xen.org>
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.428 (Entity 5.428)
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
	xen-users@lists.xen.org, oss-security@lists.openwall.com
From: Xen.org security team <security@xen.org>
Cc: "Xen.org security team" <security@xen.org>
Subject: [Xen-devel] Xen Security Advisory 22 (CVE-2012-4537) - Memory
 mapping failure DoS vulnerability
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--=separator
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

                 Xen Security Advisory CVE-2012-4537 / XSA-22
			      version 4

                  Memory mapping failure DoS vulnerability

UPDATES IN VERSION 4
====================

Public release.

ISSUE DESCRIPTION
=================

When set_p2m_entry fails, Xen's internal data structures (the p2m and
m2p tables) can get out of sync.  This failure can be triggered by
unusual guest behaviour exhausting the memory reserved for the p2m
table.  If it happens, subsequent guest-invoked memory operations can
cause Xen to fail an assertion and crash.

IMPACT
======

A malicious guest administrator might be able to cause Xen to crash.

VULNERABLE SYSTEMS
==================

All versions of Xen since at least 3.4 are vulnerable.

The vulnerability is only exposed to HVM guests.

MITIGATION
==========

There is no mitigation available other than to use a trusted guest
kernel.

RESOLUTION
==========

The attached patch resolves this issue.

Applying the appropriate attached patch resolves this issue.

xsa22-4.2-unstable.patch    Xen 4.2.x, xen-unstable
xsa22-4.1.patch             Xen 4.1.x
xsa22-4.0.patch             Xen 4.0.x
xsa22-3.4.patch             Xen 3.4.x

$ sha256sum xsa22*.patch
fe21558f098340451a275c468a7b2209915676f4f41ec394970c6aa0df3d93d3  xsa22-3.4.patch
b7e635ae07f31ac8ecb8732152ba66897ea6d0f5e30468e35d7c37379c7369bb  xsa22-4.0.patch
e699e7af6b90e60531d98f04197141c4caf5eb4cdb312a43e736830eb17d32e1  xsa22-4.1.patch
8dbf850b903179807257febe12a15cb131968e65d2e90dbd3a5f72b83d2f931a  xsa22-4.2-unstable.patch
$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJQokGpAAoJEIP+FMlX6CvZUsEIAIL7FtUpAgYTG73BXIpIoJ1h
L85yaAhizzuwWAHMwLBD/oMs+OPzIXsCp4rBHI8XPQ0rf3YeHSj8uI+ta17Th1Gb
KuFFlDPujh5EiE0yel8u21hgsJ7rUpA04jPeYDbVbHPVC6bywf7pkChCEPos/Ze9
gAlRVptdBXH2nGmSyMFDfoby60lDXa7ZP0KoJUyuUG69zDMzlANLiEvk/+mN4YKB
W4uiaYlCeDfrCn4T8Pk9rTMdDWmCsbQpZQRqwwNXdUa/EX0Ccv/QdcppPHoylYeK
DQ9GPZOtDsm4s1M/J1oPVXZI7X/vLuBwje4/hhisFFiO4kLffcKCSopSizgLlO0=
=82B5
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa22-3.4.patch"
Content-Disposition: attachment; filename="xsa22-3.4.patch"
Content-Transfer-Encoding: base64

eDg2L3BoeXNtYXA6IFByZXZlbnQgaW5jb3JyZWN0IHVwZGF0ZXMgb2YgbTJw
IG1hcHBpbmdzCgpJbiBjZXJ0YWluIGNvbmRpdGlvbnMsIHN1Y2ggYXMgbG93
IG1lbW9yeSwgc2V0X3AybV9lbnRyeSgpIGNhbiBmYWlsLgpDdXJyZW50bHks
IHRoZSBwMm0gYW5kIG0ycCB0YWJsZXMgd2lsbCBnZXQgb3V0IG9mIHN5bmMg
YmVjYXVzZSB3ZSBzdGlsbAp1cGRhdGUgdGhlIG0ycCB0YWJsZSBhZnRlciB0
aGUgcDJtIHVwZGF0ZSBoYXMgZmFpbGVkLgoKSWYgdGhhdCBoYXBwZW5zLCBz
dWJzZXF1ZW50IGd1ZXN0LWludm9rZWQgbWVtb3J5IG9wZXJhdGlvbnMgY2Fu
IGNhdXNlCkJVRygpcyBhbmQgQVNTRVJUKClzIHRvIGtpbGwgWGVuLgoKVGhp
cyBpcyBmaXhlZCBieSBvbmx5IHVwZGF0aW5nIHRoZSBtMnAgdGFibGUgaWZm
IHRoZSBwMm0gd2FzCnN1Y2Nlc3NmdWxseSB1cGRhdGVkLgoKVGhpcyBpcyBh
IHNlY3VyaXR5IHByb2JsZW0sIFhTQS0yMiAvIENWRS0yMDEyLTQ1MzcuCgpT
aWduZWQtb2ZmLWJ5OiBBbmRyZXcgQ29vcGVyIDxhbmRyZXcuY29vcGVyM0Bj
aXRyaXguY29tPgpBY2tlZC1ieTogSWFuIENhbXBiZWxsIDxpYW4uY2FtcGJl
bGxAY2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wgb3JkZXI7CiAgICAgICAgIGlmICggbWZuX3gobWZuKSAhPSBJTlZBTElE
X01GTiApCiAgICAgICAgICAgICBtZm4gPSBfbWZuKG1mbl94KG1mbikgKyAo
MXVsIDw8IG9yZGVyKSk7CkBAIC0yMDU0LDcgKzIwNTUsMTAgQEAgZ3Vlc3Rf
cGh5c21hcF9hZGRfZW50cnkoc3RydWN0IGRvbWFpbiAqZAogICAgIGlmICgg
bWZuX3ZhbGlkKF9tZm4obWZuKSkgKSAKICAgICB7CiAgICAgICAgIGlmICgg
IXNldF9wMm1fZW50cnkoZCwgZ2ZuLCBfbWZuKG1mbiksIHBhZ2Vfb3JkZXIs
IHQpICkKKyAgICAgICAgewogICAgICAgICAgICAgcmMgPSAtRUlOVkFMOwor
ICAgICAgICAgICAgZ290byBvdXQ7IC8qIEZhaWxlZCB0byB1cGRhdGUgcDJt
LCBiYWlsIHdpdGhvdXQgdXBkYXRpbmcgbTJwLiAqLworICAgICAgICB9CiAg
ICAgICAgIGZvciAoIGkgPSAwOyBpIDwgKDFVTCA8PCBwYWdlX29yZGVyKTsg
aSsrICkKICAgICAgICAgICAgIHNldF9ncGZuX2Zyb21fbWZuKG1mbitpLCBn
Zm4raSk7CiAgICAgfQpAQCAtMjA3Miw2ICsyMDc2LDcgQEAgZ3Vlc3RfcGh5
c21hcF9hZGRfZW50cnkoc3RydWN0IGRvbWFpbiAqZAogICAgICAgICB9CiAg
ICAgfQogCitvdXQ6CiAgICAgYXVkaXRfcDJtKGQpOwogICAgIHAybV91bmxv
Y2soZC0+YXJjaC5wMm0pOwogCg==

--=separator
Content-Type: application/octet-stream; name="xsa22-4.0.patch"
Content-Disposition: attachment; filename="xsa22-4.0.patch"
Content-Transfer-Encoding: base64

eDg2L3BoeXNtYXA6IFByZXZlbnQgaW5jb3JyZWN0IHVwZGF0ZXMgb2YgbTJw
IG1hcHBpbmdzCgpJbiBjZXJ0YWluIGNvbmRpdGlvbnMsIHN1Y2ggYXMgbG93
IG1lbW9y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lbnRyeShkLCBnZm4sIF9tZm4obWZu
KSwgcGFnZV9vcmRlciwgdCkgKQorICAgICAgICB7CiAgICAgICAgICAgICBy
YyA9IC1FSU5WQUw7CisgICAgICAgICAgICBnb3RvIG91dDsgLyogRmFpbGVk
IHRvIHVwZGF0ZSBwMm0sIGJhaWwgd2l0aG91dCB1cGRhdGluZyBtMnAuICov
CisgICAgICAgIH0KICAgICAgICAgaWYgKCAhcDJtX2lzX2dyYW50KHQpICkK
ICAgICAgICAgewogICAgICAgICAgICAgZm9yICggaSA9IDA7IGkgPCAoMVVM
IDw8IHBhZ2Vfb3JkZXIpOyBpKysgKQpAQCAtMjIyOCw2ICsyMjMxLDcgQEAg
Z3Vlc3RfcGh5c21hcF9hZGRfZW50cnkoc3RydWN0IGRvbWFpbiAqZAogICAg
ICAgICB9CiAgICAgfQogCitvdXQ6CiAgICAgYXVkaXRfcDJtKGQpOwogICAg
IHAybV91bmxvY2soZC0+YXJjaC5wMm0pOwogCg==

--=separator
Content-Type: application/octet-stream; name="xsa22-4.1.patch"
Content-Disposition: attachment; filename="xsa22-4.1.patch"
Content-Transfer-Encoding: base64

eDg2L3BoeXNtYXA6IFByZXZlbnQgaW5jb3JyZWN0IHVwZGF0ZXMgb2YgbTJw
IG1hcHBpbmdzCgpJbiBjZXJ0YWluIGNvbmRpdGlvbnMsIHN1Y2ggYXMgbG93
IG1lbW9yeSwgc2V0X3AybV9lbnRyeSgpIGNhbiBmYWlsLgpDdXJyZW50bHks
IHRoZSBwMm0gYW5kIG0ycCB0YWJsZXMgd2lsbCBnZXQgb3V0IG9mIHN5bmMg
YmVjYXVzZSB3ZSBzdGlsbAp1cGRhdGUgdGhlIG0ycCB0YWJsZSBhZnRlciB0
aGUgcDJtIHVwZGF0ZSBoYXMgZmFpbGVkLgoKSWYgdGhhdCBoYXBwZW5zLCBz
dWJzZXF1ZW50IGd1ZXN0LWludm9rZWQgbWVtb3J5IG9wZXJhdGlvbnMgY2Fu
IGNhdXNlCkJVRyg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
ICBmb3IgKCBpID0gMDsgaSA8ICgxVUwgPDwgcGFnZV9vcmRlcik7IGkrKyAp
CkBAIC0yNTc5LDYgKzI1ODIsNyBAQCBndWVzdF9waHlzbWFwX2FkZF9lbnRy
eShzdHJ1Y3QgcDJtX2RvbWFpCiAgICAgICAgIH0KICAgICB9CiAKK291dDoK
ICAgICBhdWRpdF9wMm0ocDJtLCAxKTsKICAgICBwMm1fdW5sb2NrKHAybSk7
CiAK

--=separator
Content-Type: application/octet-stream; name="xsa22-4.2-unstable.patch"
Content-Disposition: attachment; filename="xsa22-4.2-unstable.patch"
Content-Transfer-Encoding: base64

eDg2L3BoeXNtYXA6IFByZXZlbnQgaW5jb3JyZWN0IHVwZGF0ZXMgb2YgbTJw
IG1hcHBpbmdzCgpJbiBjZXJ0YWluIGNvbmRpdGlvbnMsIHN1Y2ggYXMgbG93
IG1lbW9yeSwgc2V0X3AybV9lbnRyeSgpIGNhbiBmYWlsLgpDdXJyZW50bHks
IHRoZSBwMm0gYW5kIG0ycCB0YWJsZXMgd2lsbCBnZXQgb3V0IG9mIHN5bmMg
YmVjYXVzZSB3ZSBzdGlsbAp1cGRhdGUgdGhlIG0ycCB0YWJsZSBhZnRlciB0
aGUgcDJtIHVwZGF0ZSBoYXMgZmFpbGVkLgoKSWYgdGhhdCBoYXBwZW5zLCBz
dWJzZXF1ZW50IGd1ZXN0LWludm9rZWQgbWVtb3J5IG9wZXJhdGlvbnMgY2Fu
IGNhdXNlCkJVRygpcyBhbmQgQVNTRVJUKClzIHRvIGtpbGwgWGVuLgoKVGhp
cyBpcyBmaXhlZCBieSBvbmx5IHVwZGF0aW5nIHRoZSBtMnAgdGFibGUgaWZm
IHRoZSBwMm0gd2FzCnN1Y2Nlc3NmdWxseSB1cGRhdGVkLgoKVGhpcyBpcyBh
IHNlY3VyaXR5IHByb2JsZW0sIFhTQS0yMiAvIENWRS0yMDEyLTQ1MzcuCgpT
aWduZWQtb2ZmLWJ5OiBBbmRyZXcgQ29vcGVyIDxhbmRyZXcuY29vcGVyM0Bj
aXRyaXguY29tPgpBY2tlZC1ieTogSWFuIENhbXBiZWxsIDxpYW4uY2FtcGJl
bGxAY2l0cml4LmNvbT4KQWNrZWQtYnk6IElhbiBKYWNrc29uIDxpYW4uamFj
a3NvbkBldS5jaXRyaXguY29tPgoKZGlmZiAtciBmNTNiOWY5MTVjM2QgeGVu
L2FyY2gveDg2L21tL3AybS5jCi0tLSBhL3hlbi9hcmNoL3g4Ni9tbS9wMm0u
YworKysgYi94ZW4vYXJjaC94ODYvbW0vcDJtLmMKQEAgLTYzMyw3ICs2MzMs
MTAgQEAgZ3Vlc3RfcGh5c21hcF9hZGRfZW50cnkoc3RydWN0IGRvbWFpbiAq
ZAogICAgIGlmICggbWZuX3ZhbGlkKF9tZm4obWZuKSkgKSAKICAgICB7CiAg
ICAgICAgIGlmICggIXNldF9wMm1fZW50cnkocDJtLCBnZm4sIF9tZm4obWZu
KSwgcGFnZV9vcmRlciwgdCwgcDJtLT5kZWZhdWx0X2FjY2VzcykgKQorICAg
ICAgICB7CiAgICAgICAgICAgICByYyA9IC1FSU5WQUw7CisgICAgICAgICAg
ICBnb3RvIG91dDsgLyogRmFpbGVkIHRvIHVwZGF0ZSBwMm0sIGJhaWwgd2l0
aG91dCB1cGRhdGluZyBtMnAuICovCisgICAgICAgIH0KICAgICAgICAgaWYg
KCAhcDJtX2lzX2dyYW50KHQpICkKICAgICAgICAgewogICAgICAgICAgICAg
Zm9yICggaSA9IDA7IGkgPCAoMVVMIDw8IHBhZ2Vfb3JkZXIpOyBpKysgKQpA
QCAtNjU2LDYgKzY1OSw3IEBAIGd1ZXN0X3BoeXNtYXBfYWRkX2VudHJ5KHN0
cnVjdCBkb21haW4gKmQKICAgICAgICAgfQogICAgIH0KIAorb3V0OgogICAg
IHAybV91bmxvY2socDJtKTsKIAogICAgIHJldHVybiByYzsK

--=separator
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.xen.org
http://lists.xen.org/xen-devel

--=separator--


From xen-devel-bounces@lists.xen.org Tue Nov 13 12:56:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 12:56:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYG2d-0001Na-71; Tue, 13 Nov 2012 12:56:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2a-0001M3-RT; Tue, 13 Nov 2012 12:56:33 +0000
Received: from [85.158.139.83:49729] by server-14.bemta-5.messagelabs.com id
	6B/EC-21768-F7342A05; Tue, 13 Nov 2012 12:56:31 +0000
X-Env-Sender: iwj@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1352811383!30047820!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28709 invoked from network); 13 Nov 2012 12:56:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Nov 2012 12:56:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2H-0008UJ-Od; Tue, 13 Nov 2012 12:56:13 +0000
Received: from iwj by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <iwj@xenbits.xen.org>)
	id 1TYG2H-0000zc-Mt; Tue, 13 Nov 2012 12:56:13 +0000
Date: Tue, 13 Nov 2012 12:56:13 +0000
Message-Id: <E1TYG2H-0000zc-Mt@xenbits.xen.org>
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.428 (Entity 5.428)
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
	xen-users@lists.xen.org, oss-security@lists.openwall.com
From: Xen.org security team <security@xen.org>
Cc: "Xen.org security team" <security@xen.org>
Subject: [Xen-devel] Xen Security Advisory 22 (CVE-2012-4537) - Memory
 mapping failure DoS vulnerability
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--=separator
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

                 Xen Security Advisory CVE-2012-4537 / XSA-22
			      version 4

                  Memory mapping failure DoS vulnerability

UPDATES IN VERSION 4
====================

Public release.

ISSUE DESCRIPTION
=================

When set_p2m_entry fails, Xen's internal data structures (the p2m and
m2p tables) can get out of sync.  This failure can be triggered by
unusual guest behaviour exhausting the memory reserved for the p2m
table.  If it happens, subsequent guest-invoked memory operations can
cause Xen to fail an assertion and crash.

IMPACT
======

A malicious guest administrator might be able to cause Xen to crash.

VULNERABLE SYSTEMS
==================

All versions of Xen since at least 3.4 are vulnerable.

The vulnerability is only exposed to HVM guests.

MITIGATION
==========

There is no mitigation available other than to use a trusted guest
kernel.

RESOLUTION
==========

The attached patch resolves this issue.

Applying the appropriate attached patch resolves this issue.

xsa22-4.2-unstable.patch    Xen 4.2.x, xen-unstable
xsa22-4.1.patch             Xen 4.1.x
xsa22-4.0.patch             Xen 4.0.x
xsa22-3.4.patch             Xen 3.4.x

$ sha256sum xsa22*.patch
fe21558f098340451a275c468a7b2209915676f4f41ec394970c6aa0df3d93d3  xsa22-3.4.patch
b7e635ae07f31ac8ecb8732152ba66897ea6d0f5e30468e35d7c37379c7369bb  xsa22-4.0.patch
e699e7af6b90e60531d98f04197141c4caf5eb4cdb312a43e736830eb17d32e1  xsa22-4.1.patch
8dbf850b903179807257febe12a15cb131968e65d2e90dbd3a5f72b83d2f931a  xsa22-4.2-unstable.patch
$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJQokGpAAoJEIP+FMlX6CvZUsEIAIL7FtUpAgYTG73BXIpIoJ1h
L85yaAhizzuwWAHMwLBD/oMs+OPzIXsCp4rBHI8XPQ0rf3YeHSj8uI+ta17Th1Gb
KuFFlDPujh5EiE0yel8u21hgsJ7rUpA04jPeYDbVbHPVC6bywf7pkChCEPos/Ze9
gAlRVptdBXH2nGmSyMFDfoby60lDXa7ZP0KoJUyuUG69zDMzlANLiEvk/+mN4YKB
W4uiaYlCeDfrCn4T8Pk9rTMdDWmCsbQpZQRqwwNXdUa/EX0Ccv/QdcppPHoylYeK
DQ9GPZOtDsm4s1M/J1oPVXZI7X/vLuBwje4/hhisFFiO4kLffcKCSopSizgLlO0=
=82B5
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa22-3.4.patch"
Content-Disposition: attachment; filename="xsa22-3.4.patch"
Content-Transfer-Encoding: base64

eDg2L3BoeXNtYXA6IFByZXZlbnQgaW5jb3JyZWN0IHVwZGF0ZXMgb2YgbTJw
IG1hcHBpbmdzCgpJbiBjZXJ0YWluIGNvbmRpdGlvbnMsIHN1Y2ggYXMgbG93
IG1lbW9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AgICAgICAgICAgcmMgPSAtRUlOVkFMOwor
ICAgICAgICAgICAgZ290byBvdXQ7IC8qIEZhaWxlZCB0byB1cGRhdGUgcDJt
LCBiYWlsIHdpdGhvdXQgdXBkYXRpbmcgbTJwLiAqLworICAgICAgICB9CiAg
ICAgICAgIGZvciAoIGkgPSAwOyBpIDwgKDFVTCA8PCBwYWdlX29yZGVyKTsg
aSsrICkKICAgICAgICAgICAgIHNldF9ncGZuX2Zyb21fbWZuKG1mbitpLCBn
Zm4raSk7CiAgICAgfQpAQCAtMjA3Miw2ICsyMDc2LDcgQEAgZ3Vlc3RfcGh5
c21hcF9hZGRfZW50cnkoc3RydWN0IGRvbWFpbiAqZAogICAgICAgICB9CiAg
ICAgfQogCitvdXQ6CiAgICAgYXVkaXRfcDJtKGQpOwogICAgIHAybV91bmxv
Y2soZC0+YXJjaC5wMm0pOwogCg==

--=separator
Content-Type: application/octet-stream; name="xsa22-4.0.patch"
Content-Disposition: attachment; filename="xsa22-4.0.patch"
Content-Transfer-Encoding: base64

eDg2L3BoeXNtYXA6IFByZXZlbnQgaW5jb3JyZWN0IHVwZGF0ZXMgb2YgbTJw
IG1hcHBpbmdzCgpJbiBjZXJ0YWluIGNvbmRpdGlvbnMsIHN1Y2ggYXMgbG93
IG1lbW9yeSwgc2V0X3AybV9lbnRyeSgpIGNhbiBmYWlsLgpDdXJyZW50bHks
IHRoZSBwMm0gYW5kIG0ycCB0YWJsZXMgd2lsbCBnZXQgb3V0IG9mIHN5bmMg
YmVjYXVzZSB3ZSBzdGlsbAp1cGRhdGUgdGhlIG0ycCB0YWJsZSBhZnRlciB0
aGUgcDJtIHVwZGF0ZSBoYXMgZmFpbGVkLgoKSWYgdGhhdCBoYXBwZW5zLCBz
dWJzZXF1ZW50IGd1ZXN0LWludm9rZWQgbWVtb3J5IG9wZXJhdGlvbnMgY2Fu
IGNhdXNlCkJVRygpcyBhbmQgQVNTRVJUKClzIHRvIGtpbGwgWGVuLgoKVGhp
cyBpcyBma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lc3RfcGh5c21hcF9hZGRfZW50cnkoc3RydWN0IGRvbWFpbiAqZAogICAg
ICAgICB9CiAgICAgfQogCitvdXQ6CiAgICAgYXVkaXRfcDJtKGQpOwogICAg
IHAybV91bmxvY2soZC0+YXJjaC5wMm0pOwogCg==

--=separator
Content-Type: application/octet-stream; name="xsa22-4.1.patch"
Content-Disposition: attachment; filename="xsa22-4.1.patch"
Content-Transfer-Encoding: base64

eDg2L3BoeXNtYXA6IFByZXZlbnQgaW5jb3JyZWN0IHVwZGF0ZXMgb2YgbTJw
IG1hcHBpbmdzCgpJbiBjZXJ0YWluIGNvbmRpdGlvbnMsIHN1Y2ggYXMgbG93
IG1lbW9yeSwgc2V0X3AybV9lbnRyeSgpIGNhbiBmYWlsLgpDdXJyZW50bHks
IHRoZSBwMm0gYW5kIG0ycCB0YWJsZXMgd2lsbCBnZXQgb3V0IG9mIHN5bmMg
YmVjYXVzZSB3ZSBzdGlsbAp1cGRhdGUgdGhlIG0ycCB0YWJsZSBhZnRlciB0
aGUgcDJtIHVwZGF0ZSBoYXMgZmFpbGVkLgoKSWYgdGhhdCBoYXBwZW5zLCBz
dWJzZXF1ZW50IGd1ZXN0LWludm9rZWQgbWVtb3J5IG9wZXJhdGlvbnMgY2Fu
IGNhdXNlCkJVRygpcyBhbmQgQVNTRVJUKClzIHRvIGtpbGwgWGVuLgoKVGhp
cyBpcyBmaXhlZCBieSBvbmx5IHVwZGF0aW5nIHRoZSBtMnAgdGFibGUgaWZm
IHRoZSBwMm0gd2FzCnN1Y2Nlc3NmdWxseSB1cGRhdGVkLgoKVGhpcyBpcyBh
IHNlY3VyaXR5IHByb2JsZW0sIFhTQS0yMiAvIENWRS0yMDEyLTQ1MzcuCgpT
aWduZWQtb2ZmLWJ5OiBBbmRyZXcgQ29vcGVyIDxhbmRyZXcuY29vcGVyM0Bj
aXRyaXguY29tPgpBY2tlZC1ieTogSWFuIENhbXBiZWxsIDxpYW4uY2FtcGJl
bGxAY2l0cml4LmNvbT4KQWNrZWQtYnk6IElhbiBKYWNrc29uIDxpYW4uamFj
a3NvbkBldS5jaXRyaXguY29tPgoKZGlmZiAtciAzYTI3ZjRlNDRiNmEgeGVu
L2FyY2gveDg2L21tL3AybS5jCi0tLSBhL3hlbi9hcmNoL3g4Ni9tbS9wMm0u
YworKysgYi94ZW4vYXJjaC94ODYvbW0vcDJtLmMKQEAgLTI1NTgsNyArMjU1
OCwxMCBAQCBndWVzdF9waHlzbWFwX2FkZF9lbnRyeShzdHJ1Y3QgcDJtX2Rv
bWFpCiAgICAgaWYgKCBtZm5fdmFsaWQoX21mbihtZm4pKSApIAogICAgIHsK
ICAgICAgICAgaWYgKCAhc2V0X3AybV9lbnRyeShwMm0sIGdmbiwgX21mbiht
Zm4pLCBwYWdlX29yZGVyLCB0LCBwMm0tPmRlZmF1bHRfYWNjZXNzKSApCisg
ICAgICAgIHsKICAgICAgICAgICAgIHJjID0gLUVJTlZBTDsKKyAgICAgICAg
ICAgIGdvdG8gb3V0OyAvKiBGYWlsZWQgdG8gdXBkYXRlIHAybSwgYmFpbCB3
aXRob3V0IHVwZGF0aW5nIG0ycC4gKi8KKyAgICAgICAgfQogICAgICAgICBp
ZiAoICFwMm1faXNfZ3JhbnQodCkgKQogICAgICAgICB7CiAgICAgICAgICAg
ICBmb3IgKCBpID0gMDsgaSA8ICgxVUwgPDwgcGFnZV9vcmRlcik7IGkrKyAp
CkBAIC0yNTc5LDYgKzI1ODIsNyBAQCBndWVzdF9waHlzbWFwX2FkZF9lbnRy
eShzdHJ1Y3QgcDJtX2RvbWFpCiAgICAgICAgIH0KICAgICB9CiAKK291dDoK
ICAgICBhdWRpdF9wMm0ocDJtLCAxKTsKICAgICBwMm1fdW5sb2NrKHAybSk7
CiAK

--=separator
Content-Type: application/octet-stream; name="xsa22-4.2-unstable.patch"
Content-Disposition: attachment; filename="xsa22-4.2-unstable.patch"
Content-Transfer-Encoding: base64

eDg2L3BoeXNtYXA6IFByZXZlbnQgaW5jb3JyZWN0I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vbWFpbiAq
ZAogICAgIGlmICggbWZuX3ZhbGlkKF9tZm4obWZuKSkgKSAKICAgICB7CiAg
ICAgICAgIGlmICggIXNldF9wMm1fZW50cnkocDJtLCBnZm4sIF9tZm4obWZu
KSwgcGFnZV9vcmRlciwgdCwgcDJtLT5kZWZhdWx0X2FjY2VzcykgKQorICAg
ICAgICB7CiAgICAgICAgICAgICByYyA9IC1FSU5WQUw7CisgICAgICAgICAg
ICBnb3RvIG91dDsgLyogRmFpbGVkIHRvIHVwZGF0ZSBwMm0sIGJhaWwgd2l0
aG91dCB1cGRhdGluZyBtMnAuICovCisgICAgICAgIH0KICAgICAgICAgaWYg
KCAhcDJtX2lzX2dyYW50KHQpICkKICAgICAgICAgewogICAgICAgICAgICAg
Zm9yICggaSA9IDA7IGkgPCAoMVVMIDw8IHBhZ2Vfb3JkZXIpOyBpKysgKQpA
QCAtNjU2LDYgKzY1OSw3IEBAIGd1ZXN0X3BoeXNtYXBfYWRkX2VudHJ5KHN0
cnVjdCBkb21haW4gKmQKICAgICAgICAgfQogICAgIH0KIAorb3V0OgogICAg
IHAybV91bmxvY2socDJtKTsKIAogICAgIHJldHVybiByYzsK

--=separator
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.xen.org
http://lists.xen.org/xen-devel

--=separator--


From xen-devel-bounces@lists.xen.org Tue Nov 13 13:13:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 13:13:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYGId-0007XV-6Y; Tue, 13 Nov 2012 13:13:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TYGIb-0007X7-8Q
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 13:13:05 +0000
Received: from [193.109.254.147:2293] by server-2.bemta-14.messagelabs.com id
	6B/6F-20829-06742A05; Tue, 13 Nov 2012 13:13:04 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352812382!3930915!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28977 invoked from network); 13 Nov 2012 13:13:03 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 13:13:03 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44396184"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 13:12:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 08:12:56 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TYGIR-0005vq-UQ;
	Tue, 13 Nov 2012 13:12:55 +0000
Message-ID: <50A24757.30402@citrix.com>
Date: Tue, 13 Nov 2012 13:12:55 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <E1TYG2A-0000z4-Uh@xenbits.xen.org>
In-Reply-To: <E1TYG2A-0000z4-Uh@xenbits.xen.org>
X-Enigmail-Version: 1.4.5
Content-Type: multipart/mixed; boundary="------------030408070200090609040107"
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>
Subject: Re: [Xen-devel] Xen Security Advisory 20 (CVE-2012-4535) - Timer
 overflow DoS vulnerability - Further bugfixes
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--------------030408070200090609040107
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit

Now this vulnerability has been publicly disclosed, here are 3 further
related bugfixes which are not security problems themselves.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


--------------030408070200090609040107
Content-Type: text/x-patch; name="validate-timers.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="validate-timers.patch"

# HG changeset patch
# Parent e0361d2401bbfc454794ad477c4848e6134c5c31
common/timers: Prevent guests timeouts which would overflow timer calculations

None of these have security implications, but will cause the timers to
expire instantly, rather than a long time into the future.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r e0361d2401bb xen/common/domain.c
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -896,6 +896,9 @@ long do_vcpu_op(int cmd, int vcpuid, XEN
         if ( copy_from_guest(&set, arg, 1) )
             return -EFAULT;
 
+        if ( set.timeout_abs_ns > STIME_MAX )
+            return -EINVAL;
+
         if ( (set.flags & VCPU_SSHOTTMR_future) &&
              (set.timeout_abs_ns < NOW()) )
             return -ETIME;
diff -r e0361d2401bb xen/common/schedule.c
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -739,6 +739,9 @@ static long do_poll(struct sched_poll *s
     if ( sched_poll->nr_ports > 128 )
         return -EINVAL;
 
+    if ( sched_poll->timeout > STIME_MAX )
+        return -EINVAL;
+
     if ( !guest_handle_okay(sched_poll->ports, sched_poll->nr_ports) )
         return -EFAULT;
 
@@ -829,6 +832,9 @@ static long domain_watchdog(struct domai
     if ( id > NR_DOMAIN_WATCHDOG_TIMERS )
         return -EINVAL;
 
+    if ( SECONDS(timeout) > STIME_DELTA_MAX )
+        return -EINVAL;
+
     spin_lock(&d->watchdog_lock);
 
     if ( id == 0 )

--------------030408070200090609040107
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.xen.org
http://lists.xen.org/xen-devel

--------------030408070200090609040107--


From xen-devel-bounces@lists.xen.org Tue Nov 13 13:13:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 13:13:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYGId-0007XV-6Y; Tue, 13 Nov 2012 13:13:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TYGIb-0007X7-8Q
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 13:13:05 +0000
Received: from [193.109.254.147:2293] by server-2.bemta-14.messagelabs.com id
	6B/6F-20829-06742A05; Tue, 13 Nov 2012 13:13:04 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352812382!3930915!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28977 invoked from network); 13 Nov 2012 13:13:03 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 13:13:03 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44396184"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 13:12:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 08:12:56 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TYGIR-0005vq-UQ;
	Tue, 13 Nov 2012 13:12:55 +0000
Message-ID: <50A24757.30402@citrix.com>
Date: Tue, 13 Nov 2012 13:12:55 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <E1TYG2A-0000z4-Uh@xenbits.xen.org>
In-Reply-To: <E1TYG2A-0000z4-Uh@xenbits.xen.org>
X-Enigmail-Version: 1.4.5
Content-Type: multipart/mixed; boundary="------------030408070200090609040107"
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>
Subject: Re: [Xen-devel] Xen Security Advisory 20 (CVE-2012-4535) - Timer
 overflow DoS vulnerability - Further bugfixes
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--------------030408070200090609040107
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit

Now this vulnerability has been publicly disclosed, here are 3 further
related bugfixes which are not security problems themselves.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


--------------030408070200090609040107
Content-Type: text/x-patch; name="validate-timers.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="validate-timers.patch"

# HG changeset patch
# Parent e0361d2401bbfc454794ad477c4848e6134c5c31
common/timers: Prevent guests timeouts which would overflow timer calculations

None of these have security implications, but will cause the timers to
expire instantly, rather than a long time into the future.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r e0361d2401bb xen/common/domain.c
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -896,6 +896,9 @@ long do_vcpu_op(int cmd, int vcpuid, XEN
         if ( copy_from_guest(&set, arg, 1) )
             return -EFAULT;
 
+        if ( set.timeout_abs_ns > STIME_MAX )
+            return -EINVAL;
+
         if ( (set.flags & VCPU_SSHOTTMR_future) &&
              (set.timeout_abs_ns < NOW()) )
             return -ETIME;
diff -r e0361d2401bb xen/common/schedule.c
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -739,6 +739,9 @@ static long do_poll(struct sched_poll *s
     if ( sched_poll->nr_ports > 128 )
         return -EINVAL;
 
+    if ( sched_poll->timeout > STIME_MAX )
+        return -EINVAL;
+
     if ( !guest_handle_okay(sched_poll->ports, sched_poll->nr_ports) )
         return -EFAULT;
 
@@ -829,6 +832,9 @@ static long domain_watchdog(struct domai
     if ( id > NR_DOMAIN_WATCHDOG_TIMERS )
         return -EINVAL;
 
+    if ( SECONDS(timeout) > STIME_DELTA_MAX )
+        return -EINVAL;
+
     spin_lock(&d->watchdog_lock);
 
     if ( id == 0 )

--------------030408070200090609040107
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.xen.org
http://lists.xen.org/xen-devel

--------------030408070200090609040107--


From xen-devel-bounces@lists.xen.org Tue Nov 13 13:17:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 13:17:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYGMX-0007vA-Ut; Tue, 13 Nov 2012 13:17:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <peter.maloney@brockmann-consult.de>)
	id 1TYGMW-0007uw-9I
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 13:17:08 +0000
Received: from [85.158.139.211:41897] by server-1.bemta-5.messagelabs.com id
	62/87-05877-35842A05; Tue, 13 Nov 2012 13:17:07 +0000
X-Env-Sender: peter.maloney@brockmann-consult.de
X-Msg-Ref: server-7.tower-206.messagelabs.com!1352812626!19557163!1
X-Originating-IP: [212.227.126.187]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xODcgPT4gNzMzOTc=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xODcgPT4gNzMzOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4573 invoked from network); 13 Nov 2012 13:17:06 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.126.187)
	by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 13:17:06 -0000
Received: from [10.3.0.26] ([141.4.215.32])
	by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis)
	id 0LqYLt-1T3tcs1TTV-00dhSz; Tue, 13 Nov 2012 14:17:03 +0100
Message-ID: <50A2484D.309@brockmann-consult.de>
Date: Tue, 13 Nov 2012 14:17:01 +0100
From: Peter Maloney <peter.maloney@brockmann-consult.de>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120825 Thunderbird/15.0
MIME-Version: 1.0
To: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
References: <5082DD8C.2030608@brockmann-consult.de>
	<20121022135920.GE12577@ocelot.phlegethon.org>
	<20121101170016.GD61948@ocelot.phlegethon.org>
	<E9577EEC-5F2E-4DFB-913F-C470D77CCF5C@gridcentric.ca>
In-Reply-To: <E9577EEC-5F2E-4DFB-913F-C470D77CCF5C@gridcentric.ca>
X-Enigmail-Version: 1.4.4
X-Provags-ID: V02:K0:s1gPjLx/4M3uDgd/+BiB8qYdFhkw0Aye5SW7PZxtTFp
	AynNS842TSY9ge4+ItliaFqh+FsNp7F4OiBDHslR772ibc/pVX
	MgraXKluC8l8rDCxwH3gZ5jyv11L7K5MZeN2jtYqmcD7LSWWLu
	/m2Ogv3b/mL3UgWDTdNjerEqm+a0PZ1lFgyFGrFoiAdo+KY+nd
	zbYe9RZqWdfyRGm5sfR9O8Tu3Q37wSVICAvsJNJhYsN9DUYue6
	anm5u+Mj53DGGJo+FRUZBiv5HFgzETEeQI6vSEal/5rcO5ok5i
	1SNQctgvh9P1+oRGbW7fV5+avj7mjFpRTll4j59ctTR9cpnmrh
	kMrvyfsvr2mgd/n9GRkeIUSzLyMtq/N3Ycmpq55F8
Cc: Tim Deegan <tim@xen.org>, Andres Lagar-Cavilla <andres@lagarcavilla.org>,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] xen-unstable,
 winxp32 very poor performance on AMD FX-8150,
 I bisected and changeset is 24770:7f79475d3de7
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 2012-11-01 18:28, Andres Lagar-Cavilla wrote:
> On Nov 1, 2012, at 1:00 PM, Tim Deegan <tim@xen.org> wrote:
>
>> Hi,
>>
>> At 14:59 +0100 on 22 Oct (1350917960), Tim Deegan wrote:
>>> At 19:21 +0200 on 20 Oct (1350760876), Peter Maloney wrote:
>>>> The change was 8 months ago
>>>>
>>>> changeset:   24770:7f79475d3de7
>>>> user:        Andres Lagar-Cavilla <andres@lagarcavilla.org>
>>>> date:        Fri Feb 10 16:07:07 2012 +0000
>>>> summary:     x86/mm: Make p2m lookups fully synchronized wrt modifications
>>> This change was bad for performnace across the board and most of it has
>>> since been either reverted or amended, but clearly we missed something
>>> here. 
>>>
>>> It's interesting that Win8 isn't slowed down.  I wonder whether that's to
>>> do with the way it drives the VGA card -- IIRC it uses a generic VESA
>>> driver rather than a Cirrus one. 
>> In fact this is to do with the APIC.  On my test system, a busy 2-vcpu
>> VM is making about 300k/s accesses to the APIC TPR.  These accesses are
>> all trapped and emulated by Xen, and that emulation has got more
>> expensive as part of this change.
>>
>> Later Windows OSes have a feature called 'lazy IRQL' which makes those
>> accesses go away, but sadly that's not been done for WinXP.  On modern
>> Intel CPUs, the hardware acceleration for TPR accesses works for XP; on
>> AMD it requires the OS to use 'MOV reg32, CR8' to access the TPR instead
>> of MMIO, which XP is clearly not doing. :(
>>
>> Peter: if you have the option, you might find that installing the PV
>> drivers that ship with Citrix XenServer 6.0 makes things work better.
>>
>> Andres: even though this load of APIC emulations is pretty extreme, it's
>> surprising that the VM runs faster on shadow pagetables!  Any ideas for
>> where this slowdown is coming from?
> Not any immediate ideas without profiling.
>
> However, most callers of hvmemul_do_io pass a stub zero ram_gpa address. We might be madly hitting the p2m locks for no reason there.
>
> How about the following patch, Peter, Tim?

Thanks,
I'll give it a try sometime this week I guess.

> diff -r 5171750d133e xen/arch/x86/hvm/emulate.c
> --- a/xen/arch/x86/hvm/emulate.c
> +++ b/xen/arch/x86/hvm/emulate.c
> @@ -60,24 +60,28 @@ static int hvmemul_do_io(
>      ioreq_t *p = get_ioreq(curr);
>      unsigned long ram_gfn = paddr_to_pfn(ram_gpa);
>      p2m_type_t p2mt;
> -    struct page_info *ram_page;
> +    struct page_info *ram_page = NULL;
>      int rc;
>  
>      /* Check for paged out page */
> -    ram_page = get_page_from_gfn(curr->domain, ram_gfn, &p2mt, P2M_UNSHARE);
> -    if ( p2m_is_paging(p2mt) )
> +    if ( ram_gpa != INVALID_MFN )
>      {
> -        if ( ram_page )
> -            put_page(ram_page);
> -        p2m_mem_paging_populate(curr->domain, ram_gfn);
> -        return X86EMUL_RETRY;
> -    }
> -    if ( p2m_is_shared(p2mt) )
> -    {
> -        if ( ram_page )
> -            put_page(ram_page);
> -        return X86EMUL_RETRY;
> -    }
> +        ram_page = get_page_from_gfn(curr->domain, ram_gfn, &p2mt, P2M_UNSHARE);
> +        if ( p2m_is_paging(p2mt) )
> +        {
> +            if ( ram_page )
> +                put_page(ram_page);
> +            p2m_mem_paging_populate(curr->domain, ram_gfn);
> +            return X86EMUL_RETRY;
> +        }
> +        if ( p2m_is_shared(p2mt) )
> +        {
> +            if ( ram_page )
> +                put_page(ram_page);
> +            return X86EMUL_RETRY;
> +        }
> +    } else
> +        value = 0; /* for pvalue */
>  
>      /*
>       * Weird-sized accesses have undefined behaviour: we discard writes
> @@ -455,7 +459,7 @@ static int __hvmemul_read(
>              return X86EMUL_UNHANDLEABLE;
>          gpa = (((paddr_t)vio->mmio_gpfn << PAGE_SHIFT) | off);
>          if ( (off + bytes) <= PAGE_SIZE )
> -            return hvmemul_do_mmio(gpa, &reps, bytes, 0,
> +            return hvmemul_do_mmio(gpa, &reps, bytes, INVALID_MFN,
>                                     IOREQ_READ, 0, p_data);
>      }
>  
> @@ -480,7 +484,8 @@ static int __hvmemul_read(
>              addr, &gpa, bytes, &reps, pfec, hvmemul_ctxt);
>          if ( rc != X86EMUL_OKAY )
>              return rc;
> -        return hvmemul_do_mmio(gpa, &reps, bytes, 0, IOREQ_READ, 0, p_data);
> +        return hvmemul_do_mmio(gpa, &reps, bytes, INVALID_MFN,
> +                                IOREQ_READ, 0, p_data);
>      case HVMCOPY_gfn_paged_out:
>          return X86EMUL_RETRY;
>      case HVMCOPY_gfn_shared:
> @@ -552,7 +557,7 @@ static int hvmemul_write(
>          unsigned int off = addr & (PAGE_SIZE - 1);
>          gpa = (((paddr_t)vio->mmio_gpfn << PAGE_SHIFT) | off);
>          if ( (off + bytes) <= PAGE_SIZE )
> -            return hvmemul_do_mmio(gpa, &reps, bytes, 0,
> +            return hvmemul_do_mmio(gpa, &reps, bytes, INVALID_MFN,
>                                     IOREQ_WRITE, 0, p_data);
>      }
>  
> @@ -573,7 +578,7 @@ static int hvmemul_write(
>              addr, &gpa, bytes, &reps, pfec, hvmemul_ctxt);
>          if ( rc != X86EMUL_OKAY )
>              return rc;
> -        return hvmemul_do_mmio(gpa, &reps, bytes, 0,
> +        return hvmemul_do_mmio(gpa, &reps, bytes, INVALID_MFN,
>                                 IOREQ_WRITE, 0, p_data);
>      case HVMCOPY_gfn_paged_out:
>          return X86EMUL_RETRY;
> @@ -804,7 +809,7 @@ static int hvmemul_read_io(
>  {
>      unsigned long reps = 1;
>      *val = 0;
> -    return hvmemul_do_pio(port, &reps, bytes, 0, IOREQ_READ, 0, val);
> +    return hvmemul_do_pio(port, &reps, bytes, INVALID_MFN, IOREQ_READ, 0, val);
>  }
>  
>  static int hvmemul_write_io(
> @@ -814,7 +819,7 @@ static int hvmemul_write_io(
>      struct x86_emulate_ctxt *ctxt)
>  {
>      unsigned long reps = 1;
> -    return hvmemul_do_pio(port, &reps, bytes, 0, IOREQ_WRITE, 0, &val);
> +    return hvmemul_do_pio(port, &reps, bytes, INVALID_MFN, IOREQ_WRITE, 0, &val);
>  }
>  
>  static int hvmemul_read_cr(
> diff -r 5171750d133e xen/arch/x86/hvm/io.c
> --- a/xen/arch/x86/hvm/io.c
> +++ b/xen/arch/x86/hvm/io.c
> @@ -231,7 +231,7 @@ int handle_pio(uint16_t port, int size, 
>      if ( dir == IOREQ_WRITE )
>          data = guest_cpu_user_regs()->eax;
>  
> -    rc = hvmemul_do_pio(port, &reps, size, 0, dir, 0, &data);
> +    rc = hvmemul_do_pio(port, &reps, size, INVALID_MFN, dir, 0, &data);
>  
>      switch ( rc )
>      {
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 13:17:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 13:17:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYGMX-0007vA-Ut; Tue, 13 Nov 2012 13:17:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <peter.maloney@brockmann-consult.de>)
	id 1TYGMW-0007uw-9I
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 13:17:08 +0000
Received: from [85.158.139.211:41897] by server-1.bemta-5.messagelabs.com id
	62/87-05877-35842A05; Tue, 13 Nov 2012 13:17:07 +0000
X-Env-Sender: peter.maloney@brockmann-consult.de
X-Msg-Ref: server-7.tower-206.messagelabs.com!1352812626!19557163!1
X-Originating-IP: [212.227.126.187]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xODcgPT4gNzMzOTc=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xODcgPT4gNzMzOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4573 invoked from network); 13 Nov 2012 13:17:06 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.126.187)
	by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 13:17:06 -0000
Received: from [10.3.0.26] ([141.4.215.32])
	by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis)
	id 0LqYLt-1T3tcs1TTV-00dhSz; Tue, 13 Nov 2012 14:17:03 +0100
Message-ID: <50A2484D.309@brockmann-consult.de>
Date: Tue, 13 Nov 2012 14:17:01 +0100
From: Peter Maloney <peter.maloney@brockmann-consult.de>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120825 Thunderbird/15.0
MIME-Version: 1.0
To: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
References: <5082DD8C.2030608@brockmann-consult.de>
	<20121022135920.GE12577@ocelot.phlegethon.org>
	<20121101170016.GD61948@ocelot.phlegethon.org>
	<E9577EEC-5F2E-4DFB-913F-C470D77CCF5C@gridcentric.ca>
In-Reply-To: <E9577EEC-5F2E-4DFB-913F-C470D77CCF5C@gridcentric.ca>
X-Enigmail-Version: 1.4.4
X-Provags-ID: V02:K0:s1gPjLx/4M3uDgd/+BiB8qYdFhkw0Aye5SW7PZxtTFp
	AynNS842TSY9ge4+ItliaFqh+FsNp7F4OiBDHslR772ibc/pVX
	MgraXKluC8l8rDCxwH3gZ5jyv11L7K5MZeN2jtYqmcD7LSWWLu
	/m2Ogv3b/mL3UgWDTdNjerEqm+a0PZ1lFgyFGrFoiAdo+KY+nd
	zbYe9RZqWdfyRGm5sfR9O8Tu3Q37wSVICAvsJNJhYsN9DUYue6
	anm5u+Mj53DGGJo+FRUZBiv5HFgzETEeQI6vSEal/5rcO5ok5i
	1SNQctgvh9P1+oRGbW7fV5+avj7mjFpRTll4j59ctTR9cpnmrh
	kMrvyfsvr2mgd/n9GRkeIUSzLyMtq/N3Ycmpq55F8
Cc: Tim Deegan <tim@xen.org>, Andres Lagar-Cavilla <andres@lagarcavilla.org>,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] xen-unstable,
 winxp32 very poor performance on AMD FX-8150,
 I bisected and changeset is 24770:7f79475d3de7
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 2012-11-01 18:28, Andres Lagar-Cavilla wrote:
> On Nov 1, 2012, at 1:00 PM, Tim Deegan <tim@xen.org> wrote:
>
>> Hi,
>>
>> At 14:59 +0100 on 22 Oct (1350917960), Tim Deegan wrote:
>>> At 19:21 +0200 on 20 Oct (1350760876), Peter Maloney wrote:
>>>> The change was 8 months ago
>>>>
>>>> changeset:   24770:7f79475d3de7
>>>> user:        Andres Lagar-Cavilla <andres@lagarcavilla.org>
>>>> date:        Fri Feb 10 16:07:07 2012 +0000
>>>> summary:     x86/mm: Make p2m lookups fully synchronized wrt modifications
>>> This change was bad for performnace across the board and most of it has
>>> since been either reverted or amended, but clearly we missed something
>>> here. 
>>>
>>> It's interesting that Win8 isn't slowed down.  I wonder whether that's to
>>> do with the way it drives the VGA card -- IIRC it uses a generic VESA
>>> driver rather than a Cirrus one. 
>> In fact this is to do with the APIC.  On my test system, a busy 2-vcpu
>> VM is making about 300k/s accesses to the APIC TPR.  These accesses are
>> all trapped and emulated by Xen, and that emulation has got more
>> expensive as part of this change.
>>
>> Later Windows OSes have a feature called 'lazy IRQL' which makes those
>> accesses go away, but sadly that's not been done for WinXP.  On modern
>> Intel CPUs, the hardware acceleration for TPR accesses works for XP; on
>> AMD it requires the OS to use 'MOV reg32, CR8' to access the TPR instead
>> of MMIO, which XP is clearly not doing. :(
>>
>> Peter: if you have the option, you might find that installing the PV
>> drivers that ship with Citrix XenServer 6.0 makes things work better.
>>
>> Andres: even though this load of APIC emulations is pretty extreme, it's
>> surprising that the VM runs faster on shadow pagetables!  Any ideas for
>> where this slowdown is coming from?
> Not any immediate ideas without profiling.
>
> However, most callers of hvmemul_do_io pass a stub zero ram_gpa address. We might be madly hitting the p2m locks for no reason there.
>
> How about the following patch, Peter, Tim?

Thanks,
I'll give it a try sometime this week I guess.

> diff -r 5171750d133e xen/arch/x86/hvm/emulate.c
> --- a/xen/arch/x86/hvm/emulate.c
> +++ b/xen/arch/x86/hvm/emulate.c
> @@ -60,24 +60,28 @@ static int hvmemul_do_io(
>      ioreq_t *p = get_ioreq(curr);
>      unsigned long ram_gfn = paddr_to_pfn(ram_gpa);
>      p2m_type_t p2mt;
> -    struct page_info *ram_page;
> +    struct page_info *ram_page = NULL;
>      int rc;
>  
>      /* Check for paged out page */
> -    ram_page = get_page_from_gfn(curr->domain, ram_gfn, &p2mt, P2M_UNSHARE);
> -    if ( p2m_is_paging(p2mt) )
> +    if ( ram_gpa != INVALID_MFN )
>      {
> -        if ( ram_page )
> -            put_page(ram_page);
> -        p2m_mem_paging_populate(curr->domain, ram_gfn);
> -        return X86EMUL_RETRY;
> -    }
> -    if ( p2m_is_shared(p2mt) )
> -    {
> -        if ( ram_page )
> -            put_page(ram_page);
> -        return X86EMUL_RETRY;
> -    }
> +        ram_page = get_page_from_gfn(curr->domain, ram_gfn, &p2mt, P2M_UNSHARE);
> +        if ( p2m_is_paging(p2mt) )
> +        {
> +            if ( ram_page )
> +                put_page(ram_page);
> +            p2m_mem_paging_populate(curr->domain, ram_gfn);
> +            return X86EMUL_RETRY;
> +        }
> +        if ( p2m_is_shared(p2mt) )
> +        {
> +            if ( ram_page )
> +                put_page(ram_page);
> +            return X86EMUL_RETRY;
> +        }
> +    } else
> +        value = 0; /* for pvalue */
>  
>      /*
>       * Weird-sized accesses have undefined behaviour: we discard writes
> @@ -455,7 +459,7 @@ static int __hvmemul_read(
>              return X86EMUL_UNHANDLEABLE;
>          gpa = (((paddr_t)vio->mmio_gpfn << PAGE_SHIFT) | off);
>          if ( (off + bytes) <= PAGE_SIZE )
> -            return hvmemul_do_mmio(gpa, &reps, bytes, 0,
> +            return hvmemul_do_mmio(gpa, &reps, bytes, INVALID_MFN,
>                                     IOREQ_READ, 0, p_data);
>      }
>  
> @@ -480,7 +484,8 @@ static int __hvmemul_read(
>              addr, &gpa, bytes, &reps, pfec, hvmemul_ctxt);
>          if ( rc != X86EMUL_OKAY )
>              return rc;
> -        return hvmemul_do_mmio(gpa, &reps, bytes, 0, IOREQ_READ, 0, p_data);
> +        return hvmemul_do_mmio(gpa, &reps, bytes, INVALID_MFN,
> +                                IOREQ_READ, 0, p_data);
>      case HVMCOPY_gfn_paged_out:
>          return X86EMUL_RETRY;
>      case HVMCOPY_gfn_shared:
> @@ -552,7 +557,7 @@ static int hvmemul_write(
>          unsigned int off = addr & (PAGE_SIZE - 1);
>          gpa = (((paddr_t)vio->mmio_gpfn << PAGE_SHIFT) | off);
>          if ( (off + bytes) <= PAGE_SIZE )
> -            return hvmemul_do_mmio(gpa, &reps, bytes, 0,
> +            return hvmemul_do_mmio(gpa, &reps, bytes, INVALID_MFN,
>                                     IOREQ_WRITE, 0, p_data);
>      }
>  
> @@ -573,7 +578,7 @@ static int hvmemul_write(
>              addr, &gpa, bytes, &reps, pfec, hvmemul_ctxt);
>          if ( rc != X86EMUL_OKAY )
>              return rc;
> -        return hvmemul_do_mmio(gpa, &reps, bytes, 0,
> +        return hvmemul_do_mmio(gpa, &reps, bytes, INVALID_MFN,
>                                 IOREQ_WRITE, 0, p_data);
>      case HVMCOPY_gfn_paged_out:
>          return X86EMUL_RETRY;
> @@ -804,7 +809,7 @@ static int hvmemul_read_io(
>  {
>      unsigned long reps = 1;
>      *val = 0;
> -    return hvmemul_do_pio(port, &reps, bytes, 0, IOREQ_READ, 0, val);
> +    return hvmemul_do_pio(port, &reps, bytes, INVALID_MFN, IOREQ_READ, 0, val);
>  }
>  
>  static int hvmemul_write_io(
> @@ -814,7 +819,7 @@ static int hvmemul_write_io(
>      struct x86_emulate_ctxt *ctxt)
>  {
>      unsigned long reps = 1;
> -    return hvmemul_do_pio(port, &reps, bytes, 0, IOREQ_WRITE, 0, &val);
> +    return hvmemul_do_pio(port, &reps, bytes, INVALID_MFN, IOREQ_WRITE, 0, &val);
>  }
>  
>  static int hvmemul_read_cr(
> diff -r 5171750d133e xen/arch/x86/hvm/io.c
> --- a/xen/arch/x86/hvm/io.c
> +++ b/xen/arch/x86/hvm/io.c
> @@ -231,7 +231,7 @@ int handle_pio(uint16_t port, int size, 
>      if ( dir == IOREQ_WRITE )
>          data = guest_cpu_user_regs()->eax;
>  
> -    rc = hvmemul_do_pio(port, &reps, size, 0, dir, 0, &data);
> +    rc = hvmemul_do_pio(port, &reps, size, INVALID_MFN, dir, 0, &data);
>  
>      switch ( rc )
>      {
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 13:22:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 13:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYGRG-0008Mr-TH; Tue, 13 Nov 2012 13:22:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <malcolm.crossley@citrix.com>) id 1TYGRF-0008Mh-3Y
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 13:22:01 +0000
Received: from [85.158.139.211:54563] by server-11.bemta-5.messagelabs.com id
	41/B6-03409-87942A05; Tue, 13 Nov 2012 13:22:00 +0000
X-Env-Sender: malcolm.crossley@citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1352812919!19944570!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5822 invoked from network); 13 Nov 2012 13:21:59 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 13:21:59 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15778884"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 13:21:58 +0000
Received: from [127.0.1.1] (10.80.3.206) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 13:21:58 +0000
MIME-Version: 1.0
X-Mercurial-Node: e1fbee58b25c4a1886e6bef1c9b1535ff81290d5
Message-ID: <e1fbee58b25c4a1886e6.1352812898@malcolmc-Dell>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Tue, 13 Nov 2012 13:21:38 +0000
From: Malcolm Crossley <malcolm.crossley@citrix.com>
To: xen-devel@lists.xensource.com
Cc: tim@xen.org, eddie.dong@intel.com, JBeulich@suse.com,
	jun.nakajima@intel.com, Ian.Campbell@citrix.com
Subject: [Xen-devel] [PATCH] xen: vmx: Use an INT 2 call to process real
 NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The self_nmi() code cause's an NMI to be triggered by sending an APIC message
to the local processor. Unfortunately there is a delay in the delivery of the
APIC message and we may already have re-entered the HVM guest by the time the
NMI is taken. This results in the VMEXIT code calling the self_nmi() function
again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop before
the HVM guest resumes normal operation.

Volume 3 Chapter 27 Section 1 of the Intel SDM states:

An NMI causes subsequent NMIs to be blocked, but only after the VM exit
completes.

So we believe it is safe to directly invoke the INT call as NMI's should
already be blocked.

The INT 2 call will perform an IRET which will unblock later calls to the NMI
handler, according to Intel SDM Volume 3 Chapter 6.7.1.

Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>

diff -r 62885b3c34c8 -r e1fbee58b25c xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
                  (X86_EVENTTYPE_NMI << 8) )
                 goto exit_and_crash;
             HVMTRACE_0D(NMI);
-            self_nmi(); /* Real NMI, vector 2: normal processing. */
+            asm("int $2"); /* Real NMI, vector 2: normal processing. */
             break;
         case TRAP_machine_check:
             HVMTRACE_0D(MCE);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 13:22:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 13:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYGRG-0008Mr-TH; Tue, 13 Nov 2012 13:22:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <malcolm.crossley@citrix.com>) id 1TYGRF-0008Mh-3Y
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 13:22:01 +0000
Received: from [85.158.139.211:54563] by server-11.bemta-5.messagelabs.com id
	41/B6-03409-87942A05; Tue, 13 Nov 2012 13:22:00 +0000
X-Env-Sender: malcolm.crossley@citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1352812919!19944570!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5822 invoked from network); 13 Nov 2012 13:21:59 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 13:21:59 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15778884"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 13:21:58 +0000
Received: from [127.0.1.1] (10.80.3.206) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 13:21:58 +0000
MIME-Version: 1.0
X-Mercurial-Node: e1fbee58b25c4a1886e6bef1c9b1535ff81290d5
Message-ID: <e1fbee58b25c4a1886e6.1352812898@malcolmc-Dell>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Tue, 13 Nov 2012 13:21:38 +0000
From: Malcolm Crossley <malcolm.crossley@citrix.com>
To: xen-devel@lists.xensource.com
Cc: tim@xen.org, eddie.dong@intel.com, JBeulich@suse.com,
	jun.nakajima@intel.com, Ian.Campbell@citrix.com
Subject: [Xen-devel] [PATCH] xen: vmx: Use an INT 2 call to process real
 NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The self_nmi() code cause's an NMI to be triggered by sending an APIC message
to the local processor. Unfortunately there is a delay in the delivery of the
APIC message and we may already have re-entered the HVM guest by the time the
NMI is taken. This results in the VMEXIT code calling the self_nmi() function
again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop before
the HVM guest resumes normal operation.

Volume 3 Chapter 27 Section 1 of the Intel SDM states:

An NMI causes subsequent NMIs to be blocked, but only after the VM exit
completes.

So we believe it is safe to directly invoke the INT call as NMI's should
already be blocked.

The INT 2 call will perform an IRET which will unblock later calls to the NMI
handler, according to Intel SDM Volume 3 Chapter 6.7.1.

Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>

diff -r 62885b3c34c8 -r e1fbee58b25c xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
                  (X86_EVENTTYPE_NMI << 8) )
                 goto exit_and_crash;
             HVMTRACE_0D(NMI);
-            self_nmi(); /* Real NMI, vector 2: normal processing. */
+            asm("int $2"); /* Real NMI, vector 2: normal processing. */
             break;
         case TRAP_machine_check:
             HVMTRACE_0D(MCE);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 13:27:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 13:27:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYGWm-00006S-MR; Tue, 13 Nov 2012 13:27:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jajcus@jajcus.net>) id 1TYGWk-00006K-Od
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 13:27:43 +0000
Received: from [193.109.254.147:28467] by server-14.bemta-14.messagelabs.com
	id B7/6B-14517-ECA42A05; Tue, 13 Nov 2012 13:27:42 +0000
X-Env-Sender: jajcus@jajcus.net
X-Msg-Ref: server-3.tower-27.messagelabs.com!1352813259!10779763!1
X-Originating-IP: [84.205.176.49]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13092 invoked from network); 13 Nov 2012 13:27:40 -0000
Received: from tropek.jajcus.net (HELO tropek.jajcus.net) (84.205.176.49)
	by server-3.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 13:27:40 -0000
Received: from localhost (jajo.ipv6.eggsoft.pl [IPv6:2001:6a0:117::1])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by tropek.jajcus.net (Postfix) with ESMTPSA id E9D245002;
	Tue, 13 Nov 2012 14:27:37 +0100 (CET)
Date: Tue, 13 Nov 2012 14:27:35 +0100
From: Jacek Konieczny <jajcus@jajcus.net>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121113132735.GD7561@jajo.eggsoft>
Mail-Followup-To: Ian Campbell <Ian.Campbell@citrix.com>,
	Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
	<1352738557.27833.302.camel@zakaz.uk.xensource.com>
	<20121112180738.GA26672@aepfle.de>
	<20121112183457.GB2114@lolek.nigdzie>
	<20121112184047.GA28988@aepfle.de>
	<1352804909.7491.55.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352804909.7491.55.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] Fix locking in
	tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVHVlLCBOb3YgMTMsIDIwMTIgYXQgMTE6MDg6MjlBTSArMDAwMCwgSWFuIENhbXBiZWxsIHdy
b3RlOgo+IE9uIE1vbiwgMjAxMi0xMS0xMiBhdCAxODo0MCArMDAwMCwgT2xhZiBIZXJpbmcgd3Jv
dGU6Cj4gPiBPbiB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M2QwMH0sIHtTSUdfREZMLCBbXSwg
MH0sIDgpID0gMApicmsoMCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAweDFj
MDEwMDAKYnJrKDB4MWMyMzAwMCkgICAgICAgICAgICAgICAgICAgICAgICAgID0gMHgxYzIzMDAw
CmdldHVpZCgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IDAKZ2V0ZXVpZCgpICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gMApnZXRnaWQoKSAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgPSAwCmdldGVnaWQoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICA9IDAKb3BlbigiL3Vzci9saWI2NC9sb2NhbGUvbG9jYWxlLWFyY2hpdmUiLCBPX1JET05MWXxP
X0NMT0VYRUMpID0gMwpmc3RhdCgzLCB7c3RfbW9kZT1TX0lGUkVHfDA2NDQsIHN0X3NpemU9MjIy
MzcxMiwgLi4ufSkgPSAwCm1tYXAoTlVMTCwgMjIyMzcxMiwgUFJPVF9SRUFELCBNQVBfUFJJVkFU
RSwgMywgMCkgPSAweDdmMjE3OTlkNjAwMApjbG9zZSgzKSAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgPSAwCm1tYXAoTlVMTCwgMTM1MTY4LCBQUk9UX1JFQUR8UFJPVF9XUklURSwgTUFQ
X1BSSVZBVEV8TUFQX0FOT05ZTU9VUywgLTEsIDApID0gMHg3ZjIxN2FlNDAwMDAKb3BlbigiL2Rl
di91cmFuZG9tIiwgT19SRE9OTFkpICAgICAgICAgID0gMwpyZWFkKDMsICJebmJjIiwgNCkgICAg
ICAgICAgICAgICAgICAgICAgPSA0CmNsb3NlKDMpICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICA9IDAKb3BlbigiL2Rldi9udWxsIiwgT19SRE9OTFkpICAgICAgICAgICAgID0gMwpmY250
bCgzLCBGX1NFVEZELCBGRF9DTE9FWEVDKSAgICAgIC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
ICAgICAgICAgICAgPSAweDg0MDEgKGZsYWdzIE9fV1JPTkxZfE9fQVBQRU5EfE9fTEFSR0VGSUxF
KQpjbG9zZSgzKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAwCndyaXRlKDIsICJJ
bnZhbGlkIGFyZ3VtZW50IGF0IC1lIGxpbmUgMi5cbiIsIDMxSW52YWxpZCBhcmd1bWVudCBhdCAt
ZSBsaW5lIDIuCikgPSAzMQpleGl0X2dyb3VwKDIyKSAgICAgICAgICAgICAgICAgICAgICAgICAg
PSA/CisgcmlnaHRmaWxlPQoKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxpc3RzLnhlbi5vcmcK
aHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Tue Nov 13 13:27:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 13:27:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYGWm-00006S-MR; Tue, 13 Nov 2012 13:27:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jajcus@jajcus.net>) id 1TYGWk-00006K-Od
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 13:27:43 +0000
Received: from [193.109.254.147:28467] by server-14.bemta-14.messagelabs.com
	id B7/6B-14517-ECA42A05; Tue, 13 Nov 2012 13:27:42 +0000
X-Env-Sender: jajcus@jajcus.net
X-Msg-Ref: server-3.tower-27.messagelabs.com!1352813259!10779763!1
X-Originating-IP: [84.205.176.49]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13092 invoked from network); 13 Nov 2012 13:27:40 -0000
Received: from tropek.jajcus.net (HELO tropek.jajcus.net) (84.205.176.49)
	by server-3.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 13:27:40 -0000
Received: from localhost (jajo.ipv6.eggsoft.pl [IPv6:2001:6a0:117::1])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by tropek.jajcus.net (Postfix) with ESMTPSA id E9D245002;
	Tue, 13 Nov 2012 14:27:37 +0100 (CET)
Date: Tue, 13 Nov 2012 14:27:35 +0100
From: Jacek Konieczny <jajcus@jajcus.net>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121113132735.GD7561@jajo.eggsoft>
Mail-Followup-To: Ian Campbell <Ian.Campbell@citrix.com>,
	Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
	<1352738557.27833.302.camel@zakaz.uk.xensource.com>
	<20121112180738.GA26672@aepfle.de>
	<20121112183457.GB2114@lolek.nigdzie>
	<20121112184047.GA28988@aepfle.de>
	<1352804909.7491.55.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352804909.7491.55.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] Fix locking in
	tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVHVlLCBOb3YgMTMsIDIwMTIgYXQgMTE6MDg6MjlBTSArMDAwMCwgSWFuIENhbXBiZWxsIHdy
b3RlOgo+IE9uIE1vbiwgMjAxMi0xMS0xMiBhdCAxODo0MCArMDAwMCwgT2xhZiBIZXJpbmcgd3Jv
dGU6Cj4gPiBPbiBNb24sIE5vdiAxMiwgSmFjZWsgS29uaWVjem55IHdyb3RlOgo+ID4gCj4gPiA+
ICMgcGVybCAtLXZlcnNpb24KPiA+ID4gVGhpcyBpcyBwZXJsLCB2NS44LjggYnVpbHQgZm9yIHg4
Nl82NC1wbGQtbGludXgtdGhyZWFkLW11bHRpCj4gPiAKPiA+IHNsZXMxMXNwMiBoYXMgcGVybCA1
LjEwLjAsIG1heWJlIHRoZXJlIGlzIGRpZmZlcmVudCBiZWhhdmlvdXIgaW4KPiA+IGRpZmZlcmVu
dCBwZXJsIHZlcnNpb25zLgo+IAo+IE1vcmUgbGlrZWx5IHRvIGJlIHRoZSBrZXJuZWwsIHNpbmNl
IFBlcmwgd291bGQgaGF2ZSB0byBqdW1wIHRocm91Z2gKPiBob29wcyB0byBmaWd1cmUgb3V0IGlm
IGEgcmFuZG9tIGZkIHdoaWNoIGl0IGdvdCBwYXNzZWQgd2FzIHIvbyBvciByL3csIEkKPiB0aGlu
ay4KCkkgc3VzcGVjdGVkIG15IHBlcmwganVzdCBjaGVja3MgdGhlIGZpbGUgZGVzY3JpcHRvciB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KSA9IDAKcnRfc2lnYWN0aW9uKFNJR0ZQRSwge1NJR19JR04sIFtGUEVd
LCBTQV9SRVNUT1JFUnxTQV9SRVNUQVJULCAweDdmMjE3OWU2M2QwMH0sIHtTSUdfREZMLCBbXSwg
MH0sIDgpID0gMApicmsoMCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAweDFj
MDEwMDAKYnJrKDB4MWMyMzAwMCkgICAgICAgICAgICAgICAgICAgICAgICAgID0gMHgxYzIzMDAw
CmdldHVpZCgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IDAKZ2V0ZXVpZCgpICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gMApnZXRnaWQoKSAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgPSAwCmdldGVnaWQoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICA9IDAKb3BlbigiL3Vzci9saWI2NC9sb2NhbGUvbG9jYWxlLWFyY2hpdmUiLCBPX1JET05MWXxP
X0NMT0VYRUMpID0gMwpmc3RhdCgzLCB7c3RfbW9kZT1TX0lGUkVHfDA2NDQsIHN0X3NpemU9MjIy
MzcxMiwgLi4ufSkgPSAwCm1tYXAoTlVMTCwgMjIyMzcxMiwgUFJPVF9SRUFELCBNQVBfUFJJVkFU
RSwgMywgMCkgPSAweDdmMjE3OTlkNjAwMApjbG9zZSgzKSAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgPSAwCm1tYXAoTlVMTCwgMTM1MTY4LCBQUk9UX1JFQUR8UFJPVF9XUklURSwgTUFQ
X1BSSVZBVEV8TUFQX0FOT05ZTU9VUywgLTEsIDApID0gMHg3ZjIxN2FlNDAwMDAKb3BlbigiL2Rl
di91cmFuZG9tIiwgT19SRE9OTFkpICAgICAgICAgID0gMwpyZWFkKDMsICJebmJjIiwgNCkgICAg
ICAgICAgICAgICAgICAgICAgPSA0CmNsb3NlKDMpICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAg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NikgICAgICAgICAgICA9IDAKZHVwKDQyKSAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgID0gMwpmY250bCgzLCBGX0dFVEZMKSAgICAgICAgICAg
ICAgICAgICAgICAgPSAweDg0MDEgKGZsYWdzIE9fV1JPTkxZfE9fQVBQRU5EfE9fTEFSR0VGSUxF
KQpjbG9zZSgzKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAwCndyaXRlKDIsICJJ
bnZhbGlkIGFyZ3VtZW50IGF0IC1lIGxpbmUgMi5cbiIsIDMxSW52YWxpZCBhcmd1bWVudCBhdCAt
ZSBsaW5lIDIuCikgPSAzMQpleGl0X2dyb3VwKDIyKSAgICAgICAgICAgICAgICAgICAgICAgICAg
PSA/CisgcmlnaHRmaWxlPQoKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxpc3RzLnhlbi5vcmcK
aHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Tue Nov 13 13:30:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 13:30:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYGYt-0000FH-Ei; Tue, 13 Nov 2012 13:29:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYGYs-0000FB-2Q
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 13:29:54 +0000
Received: from [85.158.137.99:57386] by server-15.bemta-3.messagelabs.com id
	6D/6A-09445-15B42A05; Tue, 13 Nov 2012 13:29:53 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1352813392!15758328!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29189 invoked from network); 13 Nov 2012 13:29:52 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 13:29:52 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15779040"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 13:29:12 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 13:29:11 +0000
Message-ID: <1352813350.7491.74.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Malcolm Crossley <malcolm.crossley@citrix.com>
Date: Tue, 13 Nov 2012 13:29:10 +0000
In-Reply-To: <e1fbee58b25c4a1886e6.1352812898@malcolmc-Dell>
References: <e1fbee58b25c4a1886e6.1352812898@malcolmc-Dell>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>
Subject: Re: [Xen-devel] [PATCH] xen: vmx: Use an INT 2 call to process real
 NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 13:21 +0000, Malcolm Crossley wrote:
> The self_nmi() code cause's an NMI to be triggered by sending an APIC message
> to the local processor. Unfortunately there is a delay in the delivery of the
> APIC message and we may already have re-entered the HVM guest by the time the
> NMI is taken. This results in the VMEXIT code calling the self_nmi() function
> again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop before
> the HVM guest resumes normal operation.
> 
> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
> 
> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
> completes.
> 
> So we believe it is safe to directly invoke the INT call as NMI's should
> already be blocked.
> 
> The INT 2 call will perform an IRET which will unblock later calls to the NMI
> handler, according to Intel SDM Volume 3 Chapter 6.7.1.
> 
> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
> Acked-by: Tim Deegan <tim@xen.org>
> 
> diff -r 62885b3c34c8 -r e1fbee58b25c xen/arch/x86/hvm/vmx/vmx.c
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
>                   (X86_EVENTTYPE_NMI << 8) )
>                  goto exit_and_crash;
>              HVMTRACE_0D(NMI);
> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
> +            asm("int $2"); /* Real NMI, vector 2: normal processing. */

               asm volatile("...")

I think? Otherwise this could potentially get hoisted up

Do we need any clobbers? Specifically I'm thinking of memory since
taking an int2 ought to preserve register state.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 13:30:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 13:30:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYGYt-0000FH-Ei; Tue, 13 Nov 2012 13:29:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYGYs-0000FB-2Q
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 13:29:54 +0000
Received: from [85.158.137.99:57386] by server-15.bemta-3.messagelabs.com id
	6D/6A-09445-15B42A05; Tue, 13 Nov 2012 13:29:53 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1352813392!15758328!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29189 invoked from network); 13 Nov 2012 13:29:52 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 13:29:52 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15779040"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 13:29:12 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 13:29:11 +0000
Message-ID: <1352813350.7491.74.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Malcolm Crossley <malcolm.crossley@citrix.com>
Date: Tue, 13 Nov 2012 13:29:10 +0000
In-Reply-To: <e1fbee58b25c4a1886e6.1352812898@malcolmc-Dell>
References: <e1fbee58b25c4a1886e6.1352812898@malcolmc-Dell>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>
Subject: Re: [Xen-devel] [PATCH] xen: vmx: Use an INT 2 call to process real
 NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 13:21 +0000, Malcolm Crossley wrote:
> The self_nmi() code cause's an NMI to be triggered by sending an APIC message
> to the local processor. Unfortunately there is a delay in the delivery of the
> APIC message and we may already have re-entered the HVM guest by the time the
> NMI is taken. This results in the VMEXIT code calling the self_nmi() function
> again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop before
> the HVM guest resumes normal operation.
> 
> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
> 
> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
> completes.
> 
> So we believe it is safe to directly invoke the INT call as NMI's should
> already be blocked.
> 
> The INT 2 call will perform an IRET which will unblock later calls to the NMI
> handler, according to Intel SDM Volume 3 Chapter 6.7.1.
> 
> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
> Acked-by: Tim Deegan <tim@xen.org>
> 
> diff -r 62885b3c34c8 -r e1fbee58b25c xen/arch/x86/hvm/vmx/vmx.c
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
>                   (X86_EVENTTYPE_NMI << 8) )
>                  goto exit_and_crash;
>              HVMTRACE_0D(NMI);
> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
> +            asm("int $2"); /* Real NMI, vector 2: normal processing. */

               asm volatile("...")

I think? Otherwise this could potentially get hoisted up

Do we need any clobbers? Specifically I'm thinking of memory since
taking an int2 ought to preserve register state.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 13:40:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 13:40:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYGic-0000jK-QE; Tue, 13 Nov 2012 13:39:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYGib-0000j8-2s
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 13:39:57 +0000
Received: from [85.158.139.83:26623] by server-14.bemta-5.messagelabs.com id
	5E/A7-21768-CAD42A05; Tue, 13 Nov 2012 13:39:56 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1352813995!29782047!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 702 invoked from network); 13 Nov 2012 13:39:55 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-15.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 13:39:55 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYGiX-000CVL-C4; Tue, 13 Nov 2012 13:39:53 +0000
Date: Tue, 13 Nov 2012 13:39:53 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121113133953.GF44675@ocelot.phlegethon.org>
References: <e1fbee58b25c4a1886e6.1352812898@malcolmc-Dell>
	<1352813350.7491.74.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352813350.7491.74.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] xen: vmx: Use an INT 2 call to process real
	NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 13:29 +0000 on 13 Nov (1352813350), Ian Campbell wrote:
> On Tue, 2012-11-13 at 13:21 +0000, Malcolm Crossley wrote:
> > The self_nmi() code cause's an NMI to be triggered by sending an APIC message
> > to the local processor. Unfortunately there is a delay in the delivery of the
> > APIC message and we may already have re-entered the HVM guest by the time the
> > NMI is taken. This results in the VMEXIT code calling the self_nmi() function
> > again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop before
> > the HVM guest resumes normal operation.
> > 
> > Volume 3 Chapter 27 Section 1 of the Intel SDM states:
> > 
> > An NMI causes subsequent NMIs to be blocked, but only after the VM exit
> > completes.
> > 
> > So we believe it is safe to directly invoke the INT call as NMI's should
> > already be blocked.
> > 
> > The INT 2 call will perform an IRET which will unblock later calls to the NMI
> > handler, according to Intel SDM Volume 3 Chapter 6.7.1.
> > 
> > Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
> > Acked-by: Tim Deegan <tim@xen.org>
> > 
> > diff -r 62885b3c34c8 -r e1fbee58b25c xen/arch/x86/hvm/vmx/vmx.c
> > --- a/xen/arch/x86/hvm/vmx/vmx.c
> > +++ b/xen/arch/x86/hvm/vmx/vmx.c
> > @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
> >                   (X86_EVENTTYPE_NMI << 8) )
> >                  goto exit_and_crash;
> >              HVMTRACE_0D(NMI);
> > -            self_nmi(); /* Real NMI, vector 2: normal processing. */
> > +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
> 
>                asm volatile("...")
> 
> I think? Otherwise this could potentially get hoisted up

Good catch.  Hoisted would be fine, but it could also be entirely
discarded. :)

> Do we need any clobbers? Specifically I'm thinking of memory since
> taking an int2 ought to preserve register state.

I don't think so - nothing on this path depends on the actual behaviour
of the NMI handler.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 13:40:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 13:40:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYGic-0000jK-QE; Tue, 13 Nov 2012 13:39:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYGib-0000j8-2s
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 13:39:57 +0000
Received: from [85.158.139.83:26623] by server-14.bemta-5.messagelabs.com id
	5E/A7-21768-CAD42A05; Tue, 13 Nov 2012 13:39:56 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1352813995!29782047!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 702 invoked from network); 13 Nov 2012 13:39:55 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-15.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 13:39:55 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYGiX-000CVL-C4; Tue, 13 Nov 2012 13:39:53 +0000
Date: Tue, 13 Nov 2012 13:39:53 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121113133953.GF44675@ocelot.phlegethon.org>
References: <e1fbee58b25c4a1886e6.1352812898@malcolmc-Dell>
	<1352813350.7491.74.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352813350.7491.74.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] xen: vmx: Use an INT 2 call to process real
	NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 13:29 +0000 on 13 Nov (1352813350), Ian Campbell wrote:
> On Tue, 2012-11-13 at 13:21 +0000, Malcolm Crossley wrote:
> > The self_nmi() code cause's an NMI to be triggered by sending an APIC message
> > to the local processor. Unfortunately there is a delay in the delivery of the
> > APIC message and we may already have re-entered the HVM guest by the time the
> > NMI is taken. This results in the VMEXIT code calling the self_nmi() function
> > again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop before
> > the HVM guest resumes normal operation.
> > 
> > Volume 3 Chapter 27 Section 1 of the Intel SDM states:
> > 
> > An NMI causes subsequent NMIs to be blocked, but only after the VM exit
> > completes.
> > 
> > So we believe it is safe to directly invoke the INT call as NMI's should
> > already be blocked.
> > 
> > The INT 2 call will perform an IRET which will unblock later calls to the NMI
> > handler, according to Intel SDM Volume 3 Chapter 6.7.1.
> > 
> > Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
> > Acked-by: Tim Deegan <tim@xen.org>
> > 
> > diff -r 62885b3c34c8 -r e1fbee58b25c xen/arch/x86/hvm/vmx/vmx.c
> > --- a/xen/arch/x86/hvm/vmx/vmx.c
> > +++ b/xen/arch/x86/hvm/vmx/vmx.c
> > @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
> >                   (X86_EVENTTYPE_NMI << 8) )
> >                  goto exit_and_crash;
> >              HVMTRACE_0D(NMI);
> > -            self_nmi(); /* Real NMI, vector 2: normal processing. */
> > +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
> 
>                asm volatile("...")
> 
> I think? Otherwise this could potentially get hoisted up

Good catch.  Hoisted would be fine, but it could also be entirely
discarded. :)

> Do we need any clobbers? Specifically I'm thinking of memory since
> taking an int2 ought to preserve register state.

I don't think so - nothing on this path depends on the actual behaviour
of the NMI handler.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 14:16:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 14:16:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYHHq-0002hu-FS; Tue, 13 Nov 2012 14:16:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYHHo-0002hp-QV
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 14:16:21 +0000
Received: from [85.158.139.211:14500] by server-8.bemta-5.messagelabs.com id
	78/D0-06050-33652A05; Tue, 13 Nov 2012 14:16:19 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1352816179!19953215!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26996 invoked from network); 13 Nov 2012 14:16:19 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-206.messagelabs.com with SMTP;
	13 Nov 2012 14:16:19 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 14:16:22 +0000
Message-Id: <50A2644102000078000A82C8@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 14:16:17 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>,
 "Tim Deegan" <tim@xen.org>
References: <e1fbee58b25c4a1886e6.1352812898@malcolmc-Dell>
	<1352813350.7491.74.camel@zakaz.uk.xensource.com>
	<20121113133953.GF44675@ocelot.phlegethon.org>
In-Reply-To: <20121113133953.GF44675@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>
Subject: Re: [Xen-devel] [PATCH] xen: vmx: Use an INT 2 call to process real
 NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 14:39, Tim Deegan <tim@xen.org> wrote:
> At 13:29 +0000 on 13 Nov (1352813350), Ian Campbell wrote:
>> On Tue, 2012-11-13 at 13:21 +0000, Malcolm Crossley wrote:
>> > --- a/xen/arch/x86/hvm/vmx/vmx.c
>> > +++ b/xen/arch/x86/hvm/vmx/vmx.c
>> > @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
>> >                   (X86_EVENTTYPE_NMI << 8) )
>> >                  goto exit_and_crash;
>> >              HVMTRACE_0D(NMI);
>> > -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>> > +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
>> 
>>                asm volatile("...")
>> 
>> I think? Otherwise this could potentially get hoisted up
> 
> Good catch.  Hoisted would be fine, but it could also be entirely
> discarded. :)
> 
>> Do we need any clobbers? Specifically I'm thinking of memory since
>> taking an int2 ought to preserve register state.
> 
> I don't think so - nothing on this path depends on the actual behaviour
> of the NMI handler.

We should still add it, as the NMI handler does modify global
memory. Even if you can't spot any dependency now, it would
be a rather hard to debug problem if there was, or if there ever
gets something added to that effect.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 14:16:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 14:16:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYHHq-0002hu-FS; Tue, 13 Nov 2012 14:16:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYHHo-0002hp-QV
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 14:16:21 +0000
Received: from [85.158.139.211:14500] by server-8.bemta-5.messagelabs.com id
	78/D0-06050-33652A05; Tue, 13 Nov 2012 14:16:19 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1352816179!19953215!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26996 invoked from network); 13 Nov 2012 14:16:19 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-206.messagelabs.com with SMTP;
	13 Nov 2012 14:16:19 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 14:16:22 +0000
Message-Id: <50A2644102000078000A82C8@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 14:16:17 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>,
 "Tim Deegan" <tim@xen.org>
References: <e1fbee58b25c4a1886e6.1352812898@malcolmc-Dell>
	<1352813350.7491.74.camel@zakaz.uk.xensource.com>
	<20121113133953.GF44675@ocelot.phlegethon.org>
In-Reply-To: <20121113133953.GF44675@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>
Subject: Re: [Xen-devel] [PATCH] xen: vmx: Use an INT 2 call to process real
 NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 14:39, Tim Deegan <tim@xen.org> wrote:
> At 13:29 +0000 on 13 Nov (1352813350), Ian Campbell wrote:
>> On Tue, 2012-11-13 at 13:21 +0000, Malcolm Crossley wrote:
>> > --- a/xen/arch/x86/hvm/vmx/vmx.c
>> > +++ b/xen/arch/x86/hvm/vmx/vmx.c
>> > @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
>> >                   (X86_EVENTTYPE_NMI << 8) )
>> >                  goto exit_and_crash;
>> >              HVMTRACE_0D(NMI);
>> > -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>> > +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
>> 
>>                asm volatile("...")
>> 
>> I think? Otherwise this could potentially get hoisted up
> 
> Good catch.  Hoisted would be fine, but it could also be entirely
> discarded. :)
> 
>> Do we need any clobbers? Specifically I'm thinking of memory since
>> taking an int2 ought to preserve register state.
> 
> I don't think so - nothing on this path depends on the actual behaviour
> of the NMI handler.

We should still add it, as the NMI handler does modify global
memory. Even if you can't spot any dependency now, it would
be a rather hard to debug problem if there was, or if there ever
gets something added to that effect.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 14:21:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 14:21:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYHMf-00035S-6D; Tue, 13 Nov 2012 14:21:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYHMd-00035M-Ql
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 14:21:20 +0000
Received: from [85.158.139.211:46858] by server-12.bemta-5.messagelabs.com id
	03/92-02886-E5752A05; Tue, 13 Nov 2012 14:21:18 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1352816478!18505470!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30718 invoked from network); 13 Nov 2012 14:21:18 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-206.messagelabs.com with SMTP;
	13 Nov 2012 14:21:18 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 14:21:23 +0000
Message-Id: <50A2656C02000078000A82D4@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 14:21:16 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
	<1352809049.7491.70.camel@zakaz.uk.xensource.com>
	<20121113123910.GE44675@ocelot.phlegethon.org>
In-Reply-To: <20121113123910.GE44675@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 13:39, Tim Deegan <tim@xen.org> wrote:
> At 12:17 +0000 on 13 Nov (1352809049), Ian Campbell wrote:
>> On Tue, 2012-11-13 at 12:05 +0000, Tim Deegan wrote:
>> > At 11:47 +0000 on 13 Nov (1352807234), Tim Deegan wrote:
>> > > At 11:38 +0000 on 13 Nov (1352806689), Jan Beulich wrote:
>> > > > > diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
>> > > > > --- a/xen/arch/x86/hvm/vmx/vmx.c
>> > > > > +++ b/xen/arch/x86/hvm/vmx/vmx.c
>> > > > > @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
>> > > > >                   (X86_EVENTTYPE_NMI << 8) )
>> > > > >                  goto exit_and_crash;
>> > > > >              HVMTRACE_0D(NMI);
>> > > > > -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>> > > > > +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
>> > > > 
>> > > > In any case - why can't you call do_nmi() directly from here?
>> > > 
>> > > ... this is my doing.  There used to be a call to do_nmi() here, but
>> > > do_nmi() doesn't block NMIs, so you can't just call it here in case you
>> > > get _another_ NMI while you're in the NMI handler.
>> > 
>> > Oh wait, I see -- you're saying that this (20059:76a65bf2aa4d) is wrong
>> > because NMIs are indeed blocked, and have been since the VMEXIT.
>> > 
>> > In that case, I agree that we should just run the NMI handler, but first
>> > I would really like to know what _unblocks_ NMIs in this case.  Any of
>> > the things I can think of (the next vmenter, the next iret, ??) will
>> > need some handling to make sure they actually happen before, say, we
>> > take this CPU into the idle loop...
>> 
>> What about a little stub-asm return_from_nmi / reenable_nmis with
>> something like:
>> 	pushf
>>         pushq $__HYPERVISOR_CS
>> 	pushq 1f
>> 	iret
>> 1: ...
>> 
>> That should re-enable NMIs at whichever point we think is appropriate?
> 
> If an iret is what's needed then replacing self_nmi() with 'int $2'
> (i.e. the proposed patch) seems like a neater fix.  And section 6.7.1 of
> the manual suggests that iret is indeed what we want, so:

An IRET just cannot be the only thing that ends the NMI masked
window. At least some forms of #VMENTER should have that
effect too, as otherwise NMIs would remain masked for arbitrary
periods of time.

Further, under the assumption that the self_nmi() worked at least
in some cases (since you likely tested it), there would also be room
for the NMI not being masked when getting here. Which would get
us into the stack trouble that Andrew mentioned in his reply.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 14:21:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 14:21:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYHMf-00035S-6D; Tue, 13 Nov 2012 14:21:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYHMd-00035M-Ql
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 14:21:20 +0000
Received: from [85.158.139.211:46858] by server-12.bemta-5.messagelabs.com id
	03/92-02886-E5752A05; Tue, 13 Nov 2012 14:21:18 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1352816478!18505470!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30718 invoked from network); 13 Nov 2012 14:21:18 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-206.messagelabs.com with SMTP;
	13 Nov 2012 14:21:18 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 14:21:23 +0000
Message-Id: <50A2656C02000078000A82D4@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 14:21:16 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
	<1352809049.7491.70.camel@zakaz.uk.xensource.com>
	<20121113123910.GE44675@ocelot.phlegethon.org>
In-Reply-To: <20121113123910.GE44675@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 13:39, Tim Deegan <tim@xen.org> wrote:
> At 12:17 +0000 on 13 Nov (1352809049), Ian Campbell wrote:
>> On Tue, 2012-11-13 at 12:05 +0000, Tim Deegan wrote:
>> > At 11:47 +0000 on 13 Nov (1352807234), Tim Deegan wrote:
>> > > At 11:38 +0000 on 13 Nov (1352806689), Jan Beulich wrote:
>> > > > > diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
>> > > > > --- a/xen/arch/x86/hvm/vmx/vmx.c
>> > > > > +++ b/xen/arch/x86/hvm/vmx/vmx.c
>> > > > > @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
>> > > > >                   (X86_EVENTTYPE_NMI << 8) )
>> > > > >                  goto exit_and_crash;
>> > > > >              HVMTRACE_0D(NMI);
>> > > > > -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>> > > > > +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
>> > > > 
>> > > > In any case - why can't you call do_nmi() directly from here?
>> > > 
>> > > ... this is my doing.  There used to be a call to do_nmi() here, but
>> > > do_nmi() doesn't block NMIs, so you can't just call it here in case you
>> > > get _another_ NMI while you're in the NMI handler.
>> > 
>> > Oh wait, I see -- you're saying that this (20059:76a65bf2aa4d) is wrong
>> > because NMIs are indeed blocked, and have been since the VMEXIT.
>> > 
>> > In that case, I agree that we should just run the NMI handler, but first
>> > I would really like to know what _unblocks_ NMIs in this case.  Any of
>> > the things I can think of (the next vmenter, the next iret, ??) will
>> > need some handling to make sure they actually happen before, say, we
>> > take this CPU into the idle loop...
>> 
>> What about a little stub-asm return_from_nmi / reenable_nmis with
>> something like:
>> 	pushf
>>         pushq $__HYPERVISOR_CS
>> 	pushq 1f
>> 	iret
>> 1: ...
>> 
>> That should re-enable NMIs at whichever point we think is appropriate?
> 
> If an iret is what's needed then replacing self_nmi() with 'int $2'
> (i.e. the proposed patch) seems like a neater fix.  And section 6.7.1 of
> the manual suggests that iret is indeed what we want, so:

An IRET just cannot be the only thing that ends the NMI masked
window. At least some forms of #VMENTER should have that
effect too, as otherwise NMIs would remain masked for arbitrary
periods of time.

Further, under the assumption that the self_nmi() worked at least
in some cases (since you likely tested it), there would also be room
for the NMI not being masked when getting here. Which would get
us into the stack trouble that Andrew mentioned in his reply.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 14:23:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 14:23:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYHOb-0003Kr-N4; Tue, 13 Nov 2012 14:23:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <killian.de.volder@scarlet.be>) id 1TYHOa-0003Kj-J3
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 14:23:20 +0000
Received: from [85.158.138.51:33717] by server-15.bemta-3.messagelabs.com id
	F5/C3-09445-7D752A05; Tue, 13 Nov 2012 14:23:19 +0000
X-Env-Sender: killian.de.volder@scarlet.be
X-Msg-Ref: server-13.tower-174.messagelabs.com!1352816597!10131135!1
X-Originating-IP: [217.70.183.196]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjE3LjcwLjE4My4xOTYgPT4gNDQ3NzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19140 invoked from network); 13 Nov 2012 14:23:17 -0000
Received: from relay4-d.mail.gandi.net (HELO relay4-d.mail.gandi.net)
	(217.70.183.196) by server-13.tower-174.messagelabs.com with SMTP;
	13 Nov 2012 14:23:17 -0000
X-Originating-IP: 217.70.178.135
Received: from mfilter6-d.gandi.net (mfilter6-d.gandi.net [217.70.178.135])
	by relay4-d.mail.gandi.net (Postfix) with ESMTP id 67F41172080
	for <xen-devel@lists.xen.org>; Tue, 13 Nov 2012 15:23:17 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at mfilter6-d.gandi.net
Received: from relay4-d.mail.gandi.net ([217.70.183.196])
	by mfilter6-d.gandi.net (mfilter6-d.gandi.net [10.0.15.180])
	(amavisd-new, port 10024)
	with ESMTP id hKHGbiJ3nM+v for <xen-devel@lists.xen.org>;
	Tue, 13 Nov 2012 15:23:16 +0100 (CET)
X-Originating-IP: 78.20.80.220
Received: from [172.17.0.70] (78-20-80-220.access.telenet.be [78.20.80.220])
	(Authenticated sender: killian.de.volder@megasoft.be)
	by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id EF1961720B7
	for <xen-devel@lists.xen.org>; Tue, 13 Nov 2012 15:23:15 +0100 (CET)
Message-ID: <50A25798.90100@scarlet.be>
Date: Tue, 13 Nov 2012 15:22:16 +0100
From: Killian De Volder <killian.de.volder@scarlet.be>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.4) Gecko/20120522 Thunderbird/10.0.4
MIME-Version: 1.0
To: xen-devel@lists.xen.org
Subject: [Xen-devel] TCP Segment offloading + DF
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

I don't know if TCO is supported for XEN_NETDEV_FRONTED in kernel 3.1.6,
however I found an issue.

I had to track down an issue today:
Packet from a local machine didn't get routed to the internet.
After long searching I found the issue:

The TCP-Segmentation-offloading assembles fragments with Do Not Fragment set.
This introduces issues when the packet is to be rerouted trough a router.

Situation:

DOM0
  |->Bridge 1 - MTU 1500
  |    |-> PHY - eth0
  |    |-> VIF - Dom1
  |    \-> VIF - Dom2 (router)
  |
  \->Bridge 2 - MTU 1500
       |-> PHY - eth1
       \-> VIF - Dom2 (router)

Dom 1 <-> VIF <--(bridge 1)--> VIF <-> dom2 <-> VIF <--(bridge 2)-->

Practical example:
Dom1 generate 2 packet to be routed to bridge 2 from bridge 1.
Packet 1: 1300 bytes DF (TCP)
Packet 2: 400 bytes DF (TCP)

The TCP-offloading throws them together and passes 1 packet: 1700 bytes DF (TCP).
Smart thing to do, reduces load etc.

HOWEVER
Then it arrives at dom2, it looks at the packets, sees a 1700 byte packet, and sees the DF.
Dom2 would put it on the bridge 2 network, fragmented, but it's not allowed, so instead it drops the packet.

I'm not sure if it's "working as designed" or if this is an unfortunate side effect.

Feedback welcome,
(even "You are an idiot, of course it's  going to fail !" :) )
Killian De Volder



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 14:23:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 14:23:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYHOb-0003Kr-N4; Tue, 13 Nov 2012 14:23:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <killian.de.volder@scarlet.be>) id 1TYHOa-0003Kj-J3
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 14:23:20 +0000
Received: from [85.158.138.51:33717] by server-15.bemta-3.messagelabs.com id
	F5/C3-09445-7D752A05; Tue, 13 Nov 2012 14:23:19 +0000
X-Env-Sender: killian.de.volder@scarlet.be
X-Msg-Ref: server-13.tower-174.messagelabs.com!1352816597!10131135!1
X-Originating-IP: [217.70.183.196]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjE3LjcwLjE4My4xOTYgPT4gNDQ3NzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19140 invoked from network); 13 Nov 2012 14:23:17 -0000
Received: from relay4-d.mail.gandi.net (HELO relay4-d.mail.gandi.net)
	(217.70.183.196) by server-13.tower-174.messagelabs.com with SMTP;
	13 Nov 2012 14:23:17 -0000
X-Originating-IP: 217.70.178.135
Received: from mfilter6-d.gandi.net (mfilter6-d.gandi.net [217.70.178.135])
	by relay4-d.mail.gandi.net (Postfix) with ESMTP id 67F41172080
	for <xen-devel@lists.xen.org>; Tue, 13 Nov 2012 15:23:17 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at mfilter6-d.gandi.net
Received: from relay4-d.mail.gandi.net ([217.70.183.196])
	by mfilter6-d.gandi.net (mfilter6-d.gandi.net [10.0.15.180])
	(amavisd-new, port 10024)
	with ESMTP id hKHGbiJ3nM+v for <xen-devel@lists.xen.org>;
	Tue, 13 Nov 2012 15:23:16 +0100 (CET)
X-Originating-IP: 78.20.80.220
Received: from [172.17.0.70] (78-20-80-220.access.telenet.be [78.20.80.220])
	(Authenticated sender: killian.de.volder@megasoft.be)
	by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id EF1961720B7
	for <xen-devel@lists.xen.org>; Tue, 13 Nov 2012 15:23:15 +0100 (CET)
Message-ID: <50A25798.90100@scarlet.be>
Date: Tue, 13 Nov 2012 15:22:16 +0100
From: Killian De Volder <killian.de.volder@scarlet.be>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.4) Gecko/20120522 Thunderbird/10.0.4
MIME-Version: 1.0
To: xen-devel@lists.xen.org
Subject: [Xen-devel] TCP Segment offloading + DF
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

I don't know if TCO is supported for XEN_NETDEV_FRONTED in kernel 3.1.6,
however I found an issue.

I had to track down an issue today:
Packet from a local machine didn't get routed to the internet.
After long searching I found the issue:

The TCP-Segmentation-offloading assembles fragments with Do Not Fragment set.
This introduces issues when the packet is to be rerouted trough a router.

Situation:

DOM0
  |->Bridge 1 - MTU 1500
  |    |-> PHY - eth0
  |    |-> VIF - Dom1
  |    \-> VIF - Dom2 (router)
  |
  \->Bridge 2 - MTU 1500
       |-> PHY - eth1
       \-> VIF - Dom2 (router)

Dom 1 <-> VIF <--(bridge 1)--> VIF <-> dom2 <-> VIF <--(bridge 2)-->

Practical example:
Dom1 generate 2 packet to be routed to bridge 2 from bridge 1.
Packet 1: 1300 bytes DF (TCP)
Packet 2: 400 bytes DF (TCP)

The TCP-offloading throws them together and passes 1 packet: 1700 bytes DF (TCP).
Smart thing to do, reduces load etc.

HOWEVER
Then it arrives at dom2, it looks at the packets, sees a 1700 byte packet, and sees the DF.
Dom2 would put it on the bridge 2 network, fragmented, but it's not allowed, so instead it drops the packet.

I'm not sure if it's "working as designed" or if this is an unfortunate side effect.

Feedback welcome,
(even "You are an idiot, of course it's  going to fail !" :) )
Killian De Volder



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 14:29:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 14:29:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYHUC-0003jT-G1; Tue, 13 Nov 2012 14:29:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TYHUB-0003jO-1D
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 14:29:07 +0000
Received: from [85.158.137.99:28012] by server-1.bemta-3.messagelabs.com id
	9D/73-12169-03952A05; Tue, 13 Nov 2012 14:29:04 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1352816944!14122975!1
X-Originating-IP: [74.125.82.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30508 invoked from network); 13 Nov 2012 14:29:04 -0000
Received: from mail-wg0-f43.google.com (HELO mail-wg0-f43.google.com)
	(74.125.82.43)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 14:29:04 -0000
Received: by mail-wg0-f43.google.com with SMTP id dq11so4476254wgb.24
	for <xen-devel@lists.xensource.com>;
	Tue, 13 Nov 2012 06:29:04 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=V1mgn0Dpz2G5SFxgonPLs1ThCApSr5+UVgiS5vyTLbM=;
	b=ip4hLppfsNI6KhFDh3b6hm50slRv4kieYYQh7NizTYEO0+/+gsYBURtYb6tV2Dvoul
	cpGBNldu/gbpxE0JaKslPLwtYluhXKX2FKrkULN4NU2rIwi3HvtKqa0Gmb6CaGUt+SsU
	1X/2sK92GhTmhT/WxYB+7U+XVfjpXgM39rd5L4Hz2lNabqYevUOVGwLjD0DB0PC887EN
	Rl3daDK2hVph/nMI7SDskmSq3MomFX/ACKBkRzWvsxto1iBVAekf+p1zbYEssjpBqhYB
	Uaf1112kough/l6CSWRz48VWHQaKfMDsPTse5XKM1zX7v6kVEgFdEc2zzhcuYck6NuFE
	ABZA==
Received: by 10.180.107.136 with SMTP id hc8mr20654547wib.9.1352816943920;
	Tue, 13 Nov 2012 06:29:03 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id gk9sm19064711wib.4.2012.11.13.06.29.00
	(version=SSLv3 cipher=OTHER); Tue, 13 Nov 2012 06:29:03 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Tue, 13 Nov 2012 14:28:48 +0000
From: Keir Fraser <keir@xen.org>
To: Tim Deegan <tim@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <CCC809A0.520FE%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] xen: vmx: Use an INT 2 call to process real
	NMI's instead of self_nmi() in VMEXIT handler
Thread-Index: Ac3BqzGjou9bS4lI3kS0VSuVI/5+6A==
In-Reply-To: <20121113133953.GF44675@ocelot.phlegethon.org>
Mime-version: 1.0
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>, "Nakajima,
	Jun" <jun.nakajima@intel.com>
Subject: Re: [Xen-devel] [PATCH] xen: vmx: Use an INT 2 call to process real
 NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 13/11/2012 13:39, "Tim Deegan" <tim@xen.org> wrote:

>>> diff -r 62885b3c34c8 -r e1fbee58b25c xen/arch/x86/hvm/vmx/vmx.c
>>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>>> @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
>>>                   (X86_EVENTTYPE_NMI << 8) )
>>>                  goto exit_and_crash;
>>>              HVMTRACE_0D(NMI);
>>> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>>> +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
>> 
>>                asm volatile("...")
>> 
>> I think? Otherwise this could potentially get hoisted up
> 
> Good catch.  Hoisted would be fine, but it could also be entirely
> discarded. :)

Parameter-less asm blocks are a special case that will never be considered
side-effect free I believe. Still 'asm volatile' would be our stylistic
choice in this case anyway.

And with that:
Acked-by: Keir Fraser <keir@xen.org>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 14:29:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 14:29:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYHUC-0003jT-G1; Tue, 13 Nov 2012 14:29:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TYHUB-0003jO-1D
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 14:29:07 +0000
Received: from [85.158.137.99:28012] by server-1.bemta-3.messagelabs.com id
	9D/73-12169-03952A05; Tue, 13 Nov 2012 14:29:04 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1352816944!14122975!1
X-Originating-IP: [74.125.82.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30508 invoked from network); 13 Nov 2012 14:29:04 -0000
Received: from mail-wg0-f43.google.com (HELO mail-wg0-f43.google.com)
	(74.125.82.43)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 14:29:04 -0000
Received: by mail-wg0-f43.google.com with SMTP id dq11so4476254wgb.24
	for <xen-devel@lists.xensource.com>;
	Tue, 13 Nov 2012 06:29:04 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=V1mgn0Dpz2G5SFxgonPLs1ThCApSr5+UVgiS5vyTLbM=;
	b=ip4hLppfsNI6KhFDh3b6hm50slRv4kieYYQh7NizTYEO0+/+gsYBURtYb6tV2Dvoul
	cpGBNldu/gbpxE0JaKslPLwtYluhXKX2FKrkULN4NU2rIwi3HvtKqa0Gmb6CaGUt+SsU
	1X/2sK92GhTmhT/WxYB+7U+XVfjpXgM39rd5L4Hz2lNabqYevUOVGwLjD0DB0PC887EN
	Rl3daDK2hVph/nMI7SDskmSq3MomFX/ACKBkRzWvsxto1iBVAekf+p1zbYEssjpBqhYB
	Uaf1112kough/l6CSWRz48VWHQaKfMDsPTse5XKM1zX7v6kVEgFdEc2zzhcuYck6NuFE
	ABZA==
Received: by 10.180.107.136 with SMTP id hc8mr20654547wib.9.1352816943920;
	Tue, 13 Nov 2012 06:29:03 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id gk9sm19064711wib.4.2012.11.13.06.29.00
	(version=SSLv3 cipher=OTHER); Tue, 13 Nov 2012 06:29:03 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Tue, 13 Nov 2012 14:28:48 +0000
From: Keir Fraser <keir@xen.org>
To: Tim Deegan <tim@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <CCC809A0.520FE%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] xen: vmx: Use an INT 2 call to process real
	NMI's instead of self_nmi() in VMEXIT handler
Thread-Index: Ac3BqzGjou9bS4lI3kS0VSuVI/5+6A==
In-Reply-To: <20121113133953.GF44675@ocelot.phlegethon.org>
Mime-version: 1.0
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>, "Nakajima,
	Jun" <jun.nakajima@intel.com>
Subject: Re: [Xen-devel] [PATCH] xen: vmx: Use an INT 2 call to process real
 NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 13/11/2012 13:39, "Tim Deegan" <tim@xen.org> wrote:

>>> diff -r 62885b3c34c8 -r e1fbee58b25c xen/arch/x86/hvm/vmx/vmx.c
>>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>>> @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
>>>                   (X86_EVENTTYPE_NMI << 8) )
>>>                  goto exit_and_crash;
>>>              HVMTRACE_0D(NMI);
>>> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>>> +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
>> 
>>                asm volatile("...")
>> 
>> I think? Otherwise this could potentially get hoisted up
> 
> Good catch.  Hoisted would be fine, but it could also be entirely
> discarded. :)

Parameter-less asm blocks are a special case that will never be considered
side-effect free I believe. Still 'asm volatile' would be our stylistic
choice in this case anyway.

And with that:
Acked-by: Keir Fraser <keir@xen.org>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 14:32:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 14:32:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYHXW-00043E-Od; Tue, 13 Nov 2012 14:32:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TYHXV-000431-OS
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 14:32:33 +0000
Received: from [85.158.137.99:7231] by server-7.bemta-3.messagelabs.com id
	6B/CE-01713-CF952A05; Tue, 13 Nov 2012 14:32:28 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-8.tower-217.messagelabs.com!1352817145!12085653!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19547 invoked from network); 13 Nov 2012 14:32:26 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-8.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 14:32:26 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157222085;
	Tue, 13 Nov 2012 09:32:00 -0500
Message-ID: <50A259DE.1030801@jhuapl.edu>
Date: Tue, 13 Nov 2012 09:31:58 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1351802150-19258-4-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803854.7491.48.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352803854.7491.48.camel@zakaz.uk.xensource.com>
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 9/9] vtpm/vtpmmgr and required libs to
	stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6074478228704430946=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============6074478228704430946==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms000806030208030703070805"

This is a cryptographically signed message in MIME format.

--------------ms000806030208030703070805
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/13/2012 05:50 AM, Ian Campbell wrote:
> On Thu, 2012-11-01 at 20:35 +0000, Matthew Fioravante wrote:
>> Add 3 new libraries to stubdom:
>> libgmp
>> polarssl
>> Berlios TPM Emulator 0.7.4
>>
>> Also adds makefile structure for vtpm-stubdom and vtpmmgrdom
>>
>> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> Patch 7, 8 & 9 all:
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
>
> (I must confess I did not review in detail, but it is all self containe=
d
> and has an active maintainer...)
>
> However rather than apply straight away I have downloaded these three
> files:
> ftp://ftp.gmplib.org/pub/gmp-4.3.2/gmp-4.3.2.tar.bz2
> http://polarssl.org/code/releases/polarssl-1.1.4-gpl.tgz
> http://download.berlios.de/tpm-emulator/tpm_emulator-0.7.4.tar.gz
> with checksums:
> $ sha256sum gmp-4.3.2.tar.bz2 polarssl-1.1.4-gpl.tgz tpm_emulator-0.7.4=
=2Etar.gz
> 936162c0312886c21581002b79932829aa048cfaf9937c6265aeaa14f1cd1775  gmp-4=
=2E3.2.tar.bz2
> 2d29fd04a0d0ba29dae6bd29fb418944c08d3916665dcca74afb297ef37584b6  polar=
ssl-1.1.4-gpl.tgz
> 4e48ea0d83dd9441cc1af04ab18cd6c961b9fa54d5cbf2c2feee038988dea459  tpm_e=
mulator-0.7.4.tar.gz
> $
> and placed them at the $(XEN_EXTFILES_URL).
>
> Please could you confirm that these are correct and respin to use
> XEN_EXTFILES_URL?
Changed it to use extfiles and the files you added work. Will be in next =

round of patches.
>
>> diff --git a/stubdom/Makefile b/stubdom/Makefile
>> index 50ba360..96801b2 100644
>> --- a/stubdom/Makefile
>> +++ b/stubdom/Makefile
>> @@ -31,6 +31,18 @@ GRUB_VERSION=3D0.97
>>   OCAML_URL?=3Dhttp://caml.inria.fr/pub/distrib/ocaml-3.11
>>   OCAML_VERSION=3D3.11.0
>>  =20
>> +GMP_VERSION=3D4.3.2
>> +#GMP_URL?=3D$(XEN_EXTFILES_URL)
>> +GMP_URL?=3Dftp://ftp.gmplib.org/pub/gmp-$(GMP_VERSION)
> This is a 2010 release -- any plans to upgrade to the more recent 5.x
> stream?
I didn't have any plans to as its working as intended with the current=20
version. Actually I'd really like to switch vtpm-stubdom to using=20
polarssl's bignum library and get rid of the large gmp dependency=20
entirely. The vtpm only uses a very small part of gmp, namely bignum=20
integer math for doing rsa. I don't have a whole lot of time to do this=20
switch right now though.
>
>



--------------ms000806030208030703070805
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCG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R0OBBYEFO6LYxg6r9wHZ+zdQtBHn1dZ/YTNMAkGA1UdEwQCMAAwGQYJKoZIhvZ9B0EABAww
ChsEVjcuMQMCBLAwDQYJKoZIhvcNAQEFBQADgYEAJO9HQh4YNChVLzuZqK5ARJARD8JoujGZ
fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTExMzE0MzE1OFowIwYJKoZIhvcNAQkEMRYEFJFHHI/iiTgBZNkq
aQQggNnV9TyWMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYBPppgXYIINFBHne/u+76S5XXgS896qqbJc
+lbzphBYeww3v6VILeteH/tZgoDpeSmTD+2jNDDvsM3dgyGJyYskPP4mHRnHqB6b8HNZQWvH
un8UcWeDTbrjQTXHyVCSvgZrVY4k2+2mijMCVdWJjkFTxlg0iHxHR2cWtcrKbq4o8AAAAAAA
AA==
--------------ms000806030208030703070805--


--===============6074478228704430946==
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.xen.org
http://lists.xen.org/xen-devel

--===============6074478228704430946==--


From xen-devel-bounces@lists.xen.org Tue Nov 13 14:32:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 14:32:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYHXW-00043E-Od; Tue, 13 Nov 2012 14:32:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TYHXV-000431-OS
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 14:32:33 +0000
Received: from [85.158.137.99:7231] by server-7.bemta-3.messagelabs.com id
	6B/CE-01713-CF952A05; Tue, 13 Nov 2012 14:32:28 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-8.tower-217.messagelabs.com!1352817145!12085653!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19547 invoked from network); 13 Nov 2012 14:32:26 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-8.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 14:32:26 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157222085;
	Tue, 13 Nov 2012 09:32:00 -0500
Message-ID: <50A259DE.1030801@jhuapl.edu>
Date: Tue, 13 Nov 2012 09:31:58 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1351802150-19258-4-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803854.7491.48.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352803854.7491.48.camel@zakaz.uk.xensource.com>
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 9/9] vtpm/vtpmmgr and required libs to
	stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6074478228704430946=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============6074478228704430946==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms000806030208030703070805"

This is a cryptographically signed message in MIME format.

--------------ms000806030208030703070805
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/13/2012 05:50 AM, Ian Campbell wrote:
> On Thu, 2012-11-01 at 20:35 +0000, Matthew Fioravante wrote:
>> Add 3 new libraries to stubdom:
>> libgmp
>> polarssl
>> Berlios TPM Emulator 0.7.4
>>
>> Also adds makefile structure for vtpm-stubdom and vtpmmgrdom
>>
>> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> Patch 7, 8 & 9 all:
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
>
> (I must confess I did not review in detail, but it is all self containe=
d
> and has an active maintainer...)
>
> However rather than apply straight away I have downloaded these three
> files:
> ftp://ftp.gmplib.org/pub/gmp-4.3.2/gmp-4.3.2.tar.bz2
> http://polarssl.org/code/releases/polarssl-1.1.4-gpl.tgz
> http://download.berlios.de/tpm-emulator/tpm_emulator-0.7.4.tar.gz
> with checksums:
> $ sha256sum gmp-4.3.2.tar.bz2 polarssl-1.1.4-gpl.tgz tpm_emulator-0.7.4=
=2Etar.gz
> 936162c0312886c21581002b79932829aa048cfaf9937c6265aeaa14f1cd1775  gmp-4=
=2E3.2.tar.bz2
> 2d29fd04a0d0ba29dae6bd29fb418944c08d3916665dcca74afb297ef37584b6  polar=
ssl-1.1.4-gpl.tgz
> 4e48ea0d83dd9441cc1af04ab18cd6c961b9fa54d5cbf2c2feee038988dea459  tpm_e=
mulator-0.7.4.tar.gz
> $
> and placed them at the $(XEN_EXTFILES_URL).
>
> Please could you confirm that these are correct and respin to use
> XEN_EXTFILES_URL?
Changed it to use extfiles and the files you added work. Will be in next =

round of patches.
>
>> diff --git a/stubdom/Makefile b/stubdom/Makefile
>> index 50ba360..96801b2 100644
>> --- a/stubdom/Makefile
>> +++ b/stubdom/Makefile
>> @@ -31,6 +31,18 @@ GRUB_VERSION=3D0.97
>>   OCAML_URL?=3Dhttp://caml.inria.fr/pub/distrib/ocaml-3.11
>>   OCAML_VERSION=3D3.11.0
>>  =20
>> +GMP_VERSION=3D4.3.2
>> +#GMP_URL?=3D$(XEN_EXTFILES_URL)
>> +GMP_URL?=3Dftp://ftp.gmplib.org/pub/gmp-$(GMP_VERSION)
> This is a 2010 release -- any plans to upgrade to the more recent 5.x
> stream?
I didn't have any plans to as its working as intended with the current=20
version. Actually I'd really like to switch vtpm-stubdom to using=20
polarssl's bignum library and get rid of the large gmp dependency=20
entirely. The vtpm only uses a very small part of gmp, namely bignum=20
integer math for doing rsa. I don't have a whole lot of time to do this=20
switch right now though.
>
>



--------------ms000806030208030703070805
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlCwMBAQEBBAoWCGZpb3JhbWUxMBsGDSsGAQQBsyUL
AwEBAQIEChIIMDAxMDQyNjEwWAYJYIZIAYb6ax4BBEsMSVRoZSBwcml2YXRlIGtleSBjb3Jy
ZXNwb25kaW5nIHRvIHRoaXMgY2VydGlmaWNhdGUgbWF5IGhhdmUgYmVlbiBleHBvcnRlZC4w
KAYDVR0RBCEwH4EdTWF0dGhldy5GaW9yYXZhbnRlQGpodWFwbC5lZHUwUgYDVR0fBEswSTBH
oEWgQ6RBMD8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJU0RD
QTEOMAwGA1UEAxMFQ1JMNTYwHwYDVR0jBBgwFoAUCDUpmxH52EU2CyWmF2EJMB1yqeswHQYD
VR0OBBYEFO6LYxg6r9wHZ+zdQtBHn1dZ/YTNMAkGA1UdEwQCMAAwGQYJKoZIhvZ9B0EABAww
ChsEVjcuMQMCBLAwDQYJKoZIhvcNAQEFBQADgYEAJO9HQh4YNChVLzuZqK5ARJARD8JoujGZ
fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTExMzE0MzE1OFowIwYJKoZIhvcNAQkEMRYEFJFHHI/iiTgBZNkq
aQQggNnV9TyWMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYBPppgXYIINFBHne/u+76S5XXgS896qqbJc
+lbzphBYeww3v6VILeteH/tZgoDpeSmTD+2jNDDvsM3dgyGJyYskPP4mHRnHqB6b8HNZQWvH
un8UcWeDTbrjQTXHyVCSvgZrVY4k2+2mijMCVdWJjkFTxlg0iHxHR2cWtcrKbq4o8AAAAAAA
AA==
--------------ms000806030208030703070805--


--===============6074478228704430946==
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.xen.org
http://lists.xen.org/xen-devel

--===============6074478228704430946==--


From xen-devel-bounces@lists.xen.org Tue Nov 13 14:44:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 14:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYHig-0004lp-5T; Tue, 13 Nov 2012 14:44:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYHie-0004lj-M6
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 14:44:04 +0000
Received: from [85.158.138.51:31524] by server-1.bemta-3.messagelabs.com id
	6E/6D-12169-3BC52A05; Tue, 13 Nov 2012 14:44:03 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1352817842!23512090!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13199 invoked from network); 13 Nov 2012 14:44:03 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 14:44:03 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYHiW-000CiE-Ti; Tue, 13 Nov 2012 14:43:56 +0000
Date: Tue, 13 Nov 2012 14:43:56 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121113144356.GG44675@ocelot.phlegethon.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
	<1352809049.7491.70.camel@zakaz.uk.xensource.com>
	<20121113123910.GE44675@ocelot.phlegethon.org>
	<50A2656C02000078000A82D4@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A2656C02000078000A82D4@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
	process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 14:21 +0000 on 13 Nov (1352816476), Jan Beulich wrote:
> >>> On 13.11.12 at 13:39, Tim Deegan <tim@xen.org> wrote:
> > At 12:17 +0000 on 13 Nov (1352809049), Ian Campbell wrote:
> >> On Tue, 2012-11-13 at 12:05 +0000, Tim Deegan wrote:
> >> > At 11:47 +0000 on 13 Nov (1352807234), Tim Deegan wrote:
> >> > > At 11:38 +0000 on 13 Nov (1352806689), Jan Beulich wrote:
> >> > > > > diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
> >> > > > > --- a/xen/arch/x86/hvm/vmx/vmx.c
> >> > > > > +++ b/xen/arch/x86/hvm/vmx/vmx.c
> >> > > > > @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
> >> > > > >                   (X86_EVENTTYPE_NMI << 8) )
> >> > > > >                  goto exit_and_crash;
> >> > > > >              HVMTRACE_0D(NMI);
> >> > > > > -            self_nmi(); /* Real NMI, vector 2: normal processing. */
> >> > > > > +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
> >> > > > 
> >> > > > In any case - why can't you call do_nmi() directly from here?
> >> > > 
> >> > > ... this is my doing.  There used to be a call to do_nmi() here, but
> >> > > do_nmi() doesn't block NMIs, so you can't just call it here in case you
> >> > > get _another_ NMI while you're in the NMI handler.
> >> > 
> >> > Oh wait, I see -- you're saying that this (20059:76a65bf2aa4d) is wrong
> >> > because NMIs are indeed blocked, and have been since the VMEXIT.
> >> > 
> >> > In that case, I agree that we should just run the NMI handler, but first
> >> > I would really like to know what _unblocks_ NMIs in this case.  Any of
> >> > the things I can think of (the next vmenter, the next iret, ??) will
> >> > need some handling to make sure they actually happen before, say, we
> >> > take this CPU into the idle loop...
> >> 
> >> What about a little stub-asm return_from_nmi / reenable_nmis with
> >> something like:
> >> 	pushf
> >>         pushq $__HYPERVISOR_CS
> >> 	pushq 1f
> >> 	iret
> >> 1: ...
> >> 
> >> That should re-enable NMIs at whichever point we think is appropriate?
> > 
> > If an iret is what's needed then replacing self_nmi() with 'int $2'
> > (i.e. the proposed patch) seems like a neater fix.  And section 6.7.1 of
> > the manual suggests that iret is indeed what we want, so:
> 
> An IRET just cannot be the only thing that ends the NMI masked
> window.  At least some forms of #VMENTER should have that
> effect too, as otherwise NMIs would remain masked for arbitrary
> periods of time.
> 
> Further, under the assumption that the self_nmi() worked at least
> in some cases (since you likely tested it), there would also be room
> for the NMI not being masked when getting here. Which would get
> us into the stack trouble that Andrew mentioned in his reply.

I got the impression that Andrew and Malcolm were seeing a long loop of
exit/self_nmi()/enter/NMI/exit/..., eventually broken by a real
interrupt or an IPI causing (by its iret) the NMI to get delivered in
root mode.  So the NMI does get handled, just not immediately.

The fact that there was a loop and not just a delay in the NMI handling
suggests that VMENTER does indeed re-enable NMIs (or at least
NMI-exiting) but I couldn't find that in the manual.  In any case, I
think the int $2 version is correcter than the direct call as it also
disables normal interrupts.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 14:44:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 14:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYHig-0004lp-5T; Tue, 13 Nov 2012 14:44:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYHie-0004lj-M6
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 14:44:04 +0000
Received: from [85.158.138.51:31524] by server-1.bemta-3.messagelabs.com id
	6E/6D-12169-3BC52A05; Tue, 13 Nov 2012 14:44:03 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1352817842!23512090!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13199 invoked from network); 13 Nov 2012 14:44:03 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 14:44:03 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYHiW-000CiE-Ti; Tue, 13 Nov 2012 14:43:56 +0000
Date: Tue, 13 Nov 2012 14:43:56 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121113144356.GG44675@ocelot.phlegethon.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
	<1352809049.7491.70.camel@zakaz.uk.xensource.com>
	<20121113123910.GE44675@ocelot.phlegethon.org>
	<50A2656C02000078000A82D4@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A2656C02000078000A82D4@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
	process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 14:21 +0000 on 13 Nov (1352816476), Jan Beulich wrote:
> >>> On 13.11.12 at 13:39, Tim Deegan <tim@xen.org> wrote:
> > At 12:17 +0000 on 13 Nov (1352809049), Ian Campbell wrote:
> >> On Tue, 2012-11-13 at 12:05 +0000, Tim Deegan wrote:
> >> > At 11:47 +0000 on 13 Nov (1352807234), Tim Deegan wrote:
> >> > > At 11:38 +0000 on 13 Nov (1352806689), Jan Beulich wrote:
> >> > > > > diff -r 62885b3c34c8 -r ea756059a8da xen/arch/x86/hvm/vmx/vmx.c
> >> > > > > --- a/xen/arch/x86/hvm/vmx/vmx.c
> >> > > > > +++ b/xen/arch/x86/hvm/vmx/vmx.c
> >> > > > > @@ -2442,7 +2442,7 @@ void vmx_vmexit_handler(struct cpu_user_
> >> > > > >                   (X86_EVENTTYPE_NMI << 8) )
> >> > > > >                  goto exit_and_crash;
> >> > > > >              HVMTRACE_0D(NMI);
> >> > > > > -            self_nmi(); /* Real NMI, vector 2: normal processing. */
> >> > > > > +            asm("int $2"); /* Real NMI, vector 2: normal processing. */
> >> > > > 
> >> > > > In any case - why can't you call do_nmi() directly from here?
> >> > > 
> >> > > ... this is my doing.  There used to be a call to do_nmi() here, but
> >> > > do_nmi() doesn't block NMIs, so you can't just call it here in case you
> >> > > get _another_ NMI while you're in the NMI handler.
> >> > 
> >> > Oh wait, I see -- you're saying that this (20059:76a65bf2aa4d) is wrong
> >> > because NMIs are indeed blocked, and have been since the VMEXIT.
> >> > 
> >> > In that case, I agree that we should just run the NMI handler, but first
> >> > I would really like to know what _unblocks_ NMIs in this case.  Any of
> >> > the things I can think of (the next vmenter, the next iret, ??) will
> >> > need some handling to make sure they actually happen before, say, we
> >> > take this CPU into the idle loop...
> >> 
> >> What about a little stub-asm return_from_nmi / reenable_nmis with
> >> something like:
> >> 	pushf
> >>         pushq $__HYPERVISOR_CS
> >> 	pushq 1f
> >> 	iret
> >> 1: ...
> >> 
> >> That should re-enable NMIs at whichever point we think is appropriate?
> > 
> > If an iret is what's needed then replacing self_nmi() with 'int $2'
> > (i.e. the proposed patch) seems like a neater fix.  And section 6.7.1 of
> > the manual suggests that iret is indeed what we want, so:
> 
> An IRET just cannot be the only thing that ends the NMI masked
> window.  At least some forms of #VMENTER should have that
> effect too, as otherwise NMIs would remain masked for arbitrary
> periods of time.
> 
> Further, under the assumption that the self_nmi() worked at least
> in some cases (since you likely tested it), there would also be room
> for the NMI not being masked when getting here. Which would get
> us into the stack trouble that Andrew mentioned in his reply.

I got the impression that Andrew and Malcolm were seeing a long loop of
exit/self_nmi()/enter/NMI/exit/..., eventually broken by a real
interrupt or an IPI causing (by its iret) the NMI to get delivered in
root mode.  So the NMI does get handled, just not immediately.

The fact that there was a loop and not just a delay in the NMI handling
suggests that VMENTER does indeed re-enable NMIs (or at least
NMI-exiting) but I couldn't find that in the manual.  In any case, I
think the int $2 version is correcter than the direct call as it also
disables normal interrupts.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 14:47:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 14:47:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYHlv-0004xJ-Pb; Tue, 13 Nov 2012 14:47:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYHlt-0004x3-Mo
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 14:47:25 +0000
Received: from [85.158.143.35:55738] by server-1.bemta-4.messagelabs.com id
	13/BB-27934-C7D52A05; Tue, 13 Nov 2012 14:47:24 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1352818037!13838494!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5521 invoked from network); 13 Nov 2012 14:47:19 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-21.messagelabs.com with SMTP;
	13 Nov 2012 14:47:19 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 14:47:25 +0000
Message-Id: <50A26B7F02000078000A8309@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 14:47:11 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
In-Reply-To: <20121113120555.GC44675@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>, eddie.dong@intel.com,
	jun.nakajima@intel.com, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 13:05, Tim Deegan <tim@xen.org> wrote:
> In that case, I agree that we should just run the NMI handler, but first
> I would really like to know what _unblocks_ NMIs in this case.  Any of
> the things I can think of (the next vmenter, the next iret, ??) will
> need some handling to make sure they actually happen before, say, we
> take this CPU into the idle loop...

Wouldn't we have that exact same problem on the "normal" NMI
path? We do switch away from the NMI stack when it arrived
while in guest context, but I don't think we do anything to end the
NMI masking window before going into the scheduler (or handling
other softirqs).

If so, rather than doing this potentially dangerous "int $2" (in
terms of IST stack usage), we might be better off dealing with
the ending of the mask window in a uniform way.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 14:47:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 14:47:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYHlv-0004xJ-Pb; Tue, 13 Nov 2012 14:47:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYHlt-0004x3-Mo
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 14:47:25 +0000
Received: from [85.158.143.35:55738] by server-1.bemta-4.messagelabs.com id
	13/BB-27934-C7D52A05; Tue, 13 Nov 2012 14:47:24 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1352818037!13838494!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5521 invoked from network); 13 Nov 2012 14:47:19 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-21.messagelabs.com with SMTP;
	13 Nov 2012 14:47:19 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 14:47:25 +0000
Message-Id: <50A26B7F02000078000A8309@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 14:47:11 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
In-Reply-To: <20121113120555.GC44675@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>, eddie.dong@intel.com,
	jun.nakajima@intel.com, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 13:05, Tim Deegan <tim@xen.org> wrote:
> In that case, I agree that we should just run the NMI handler, but first
> I would really like to know what _unblocks_ NMIs in this case.  Any of
> the things I can think of (the next vmenter, the next iret, ??) will
> need some handling to make sure they actually happen before, say, we
> take this CPU into the idle loop...

Wouldn't we have that exact same problem on the "normal" NMI
path? We do switch away from the NMI stack when it arrived
while in guest context, but I don't think we do anything to end the
NMI masking window before going into the scheduler (or handling
other softirqs).

If so, rather than doing this potentially dangerous "int $2" (in
terms of IST stack usage), we might be better off dealing with
the ending of the mask window in a uniform way.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 14:56:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 14:56:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYHuX-0005Ms-QX; Tue, 13 Nov 2012 14:56:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYHuW-0005Mn-LP
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 14:56:20 +0000
Received: from [85.158.139.211:41586] by server-14.bemta-5.messagelabs.com id
	0A/90-21768-39F52A05; Tue, 13 Nov 2012 14:56:19 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1352818574!20052651!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12170 invoked from network); 13 Nov 2012 14:56:14 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-206.messagelabs.com with SMTP;
	13 Nov 2012 14:56:14 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 14:56:28 +0000
Message-Id: <50A26D9C02000078000A8322@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 14:56:12 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
	<1352809049.7491.70.camel@zakaz.uk.xensource.com>
	<20121113123910.GE44675@ocelot.phlegethon.org>
	<50A2656C02000078000A82D4@nat28.tlf.novell.com>
	<20121113144356.GG44675@ocelot.phlegethon.org>
In-Reply-To: <20121113144356.GG44675@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 15:43, Tim Deegan <tim@xen.org> wrote:
> The fact that there was a loop and not just a delay in the NMI handling
> suggests that VMENTER does indeed re-enable NMIs (or at least
> NMI-exiting) but I couldn't find that in the manual.  In any case, I
> think the int $2 version is correcter than the direct call as it also
> disables normal interrupts.

You're not commenting on the stack aspect and previous approach
at all: Assuming your self_nmi() approach at least worked
somewhere, that somewhere would be the place where the "int $2"
approach would break. In other words - are you confident that
NMI is _always_ masked when we get there (and hence your
earlier approach _never_ worked)?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 14:56:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 14:56:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYHuX-0005Ms-QX; Tue, 13 Nov 2012 14:56:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYHuW-0005Mn-LP
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 14:56:20 +0000
Received: from [85.158.139.211:41586] by server-14.bemta-5.messagelabs.com id
	0A/90-21768-39F52A05; Tue, 13 Nov 2012 14:56:19 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1352818574!20052651!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12170 invoked from network); 13 Nov 2012 14:56:14 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-206.messagelabs.com with SMTP;
	13 Nov 2012 14:56:14 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 14:56:28 +0000
Message-Id: <50A26D9C02000078000A8322@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 14:56:12 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
	<1352809049.7491.70.camel@zakaz.uk.xensource.com>
	<20121113123910.GE44675@ocelot.phlegethon.org>
	<50A2656C02000078000A82D4@nat28.tlf.novell.com>
	<20121113144356.GG44675@ocelot.phlegethon.org>
In-Reply-To: <20121113144356.GG44675@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 15:43, Tim Deegan <tim@xen.org> wrote:
> The fact that there was a loop and not just a delay in the NMI handling
> suggests that VMENTER does indeed re-enable NMIs (or at least
> NMI-exiting) but I couldn't find that in the manual.  In any case, I
> think the int $2 version is correcter than the direct call as it also
> disables normal interrupts.

You're not commenting on the stack aspect and previous approach
at all: Assuming your self_nmi() approach at least worked
somewhere, that somewhere would be the place where the "int $2"
approach would break. In other words - are you confident that
NMI is _always_ masked when we get there (and hence your
earlier approach _never_ worked)?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 14:57:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 14:57:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYHvM-0005RI-H2; Tue, 13 Nov 2012 14:57:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1TYHvK-0005Qj-LI; Tue, 13 Nov 2012 14:57:10 +0000
Received: from [85.158.138.51:5653] by server-11.bemta-3.messagelabs.com id
	3D/D0-19361-5CF52A05; Tue, 13 Nov 2012 14:57:09 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1352818625!27954197!1
X-Originating-IP: [209.85.217.173]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10193 invoked from network); 13 Nov 2012 14:57:06 -0000
Received: from mail-lb0-f173.google.com (HELO mail-lb0-f173.google.com)
	(209.85.217.173)
	by server-15.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 14:57:06 -0000
Received: by mail-lb0-f173.google.com with SMTP id gj3so6543077lbb.32
	for <multiple recipients>; Tue, 13 Nov 2012 06:57:05 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:date:from:reply-to:user-agent:mime-version:to
	:subject:content-type;
	bh=BbAEHisWirs2G7e6bAtp6BSTPP5hqPHYnObJoDM2uPM=;
	b=Xweg0d3i5lWzo0TU8wLsUee3fEp1YNMzzGVhPFTjmr1iOqeUP2j9cfmG6YSRiAYbku
	uUmjBsurdwDur9/zmX0pnMsB4PbAo926872kWfSDNL/ZhsnS0JNqnY3BBwGDBiN4XAR0
	fw7vDUbGDyc76lseXHO9pIloiRI7a+EUdWDqiMlQtkf9VUd+GXywiGp+ocWi5p49z381
	cLLz1nvqquslBYgs+yg8VTfQMIzQCHB8zGOXzb+h+0l1lkU1UswPOn5RzsGyk+jd80xU
	Mq9NC2jXt/nKGOrUoX/YES3u7ua9+k9OQqyZxIThsaykhUOTCBgrWvyO1QQJHByMTK/d
	i4Uw==
Received: by 10.112.38.70 with SMTP id e6mr3005096lbk.64.1352818625096;
	Tue, 13 Nov 2012 06:57:05 -0800 (PST)
Received: from [172.16.26.11] (b0fb37e5.bb.sky.com. [176.251.55.229])
	by mx.google.com with ESMTPS id m6sm3895315lbh.10.2012.11.13.06.56.55
	(version=SSLv3 cipher=OTHER); Tue, 13 Nov 2012 06:57:04 -0800 (PST)
Message-ID: <50A25FA4.10308@xen.org>
Date: Tue, 13 Nov 2012 14:56:36 +0000
From: Lars Kurth <lars.kurth@xen.org>
User-Agent: Mozilla/5.0 (Windows NT 6.1;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, 
	"xen-api@lists.xen.org" <xen-api@lists.xen.org>,
	xen-users@lists.xen.org, xen-arm@lists.xen.org
Subject: [Xen-devel] Changes to the xen.org site
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: lars.kurth@xen.org
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5621166146042010238=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.
--===============5621166146042010238==
Content-Type: multipart/alternative;
 boundary="------------030203000801050700050209"

This is a multi-part message in MIME format.
--------------030203000801050700050209
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi everybody,

I spent a bit of time cleaning up some lose ends on the xen.org site. If 
you notice any broken links, typos, etc. do let me know. I did the 
following

  * Archived XCI
  * Clearly marked HXEN and Satori project pages to show that these
    projects are also archived
  * Replaced the "Products > Projects" menu and pages with a "Products >
    Governance" menu and page (linking to anything related to
    governance). The reason is that "Products > Products" and "Products
     > Projects" were nearly identical and that I kept on getting
    questions on where to find governance related info.
  * Minor fixes on various pages

You may have to clear your browser cache such that the javascript files 
reload. The site will still work correctly if you don't, but the 
"Products > Projects" menu won't rename and point to the new location 
until the js files have been reloaded by your browser.

Regards
Lars

--------------030203000801050700050209
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi everybody,<br>
    <br>
    I spent a bit of time cleaning up some lose ends on the xen.org
    site. If you notice any broken links, typos, etc. do let me know. I
    did the following <br>
    <ul>
      <li>Archived XCI</li>
      <li>Clearly marked HXEN and Satori project pages to show that
        these projects are also archived <br>
      </li>
      <li>Replaced the "Products &gt; Projects" menu and pages with a
        "Products &gt; Governance" menu and page (linking to anything
        related to governance). The reason is that "Products &gt;
        Products" and "Products &gt; Projects" were nearly identical and
        that I kept on getting questions on where to find governance
        related info.<br>
      </li>
      <li>Minor fixes on various pages</li>
    </ul>
    You may have to clear your browser cache such that the javascript
    files reload. The site will still work correctly if you don't, but
    the "Products &gt; Projects" menu won't rename and point to the new
    location until the js files have been reloaded by your browser.<br>
    <br>
    Regards<br>
    Lars<br>
  </body>
</html>

--------------030203000801050700050209--


--===============5621166146042010238==
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.xen.org
http://lists.xen.org/xen-devel

--===============5621166146042010238==--


From xen-devel-bounces@lists.xen.org Tue Nov 13 14:57:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 14:57:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYHvM-0005RI-H2; Tue, 13 Nov 2012 14:57:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1TYHvK-0005Qj-LI; Tue, 13 Nov 2012 14:57:10 +0000
Received: from [85.158.138.51:5653] by server-11.bemta-3.messagelabs.com id
	3D/D0-19361-5CF52A05; Tue, 13 Nov 2012 14:57:09 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1352818625!27954197!1
X-Originating-IP: [209.85.217.173]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10193 invoked from network); 13 Nov 2012 14:57:06 -0000
Received: from mail-lb0-f173.google.com (HELO mail-lb0-f173.google.com)
	(209.85.217.173)
	by server-15.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 14:57:06 -0000
Received: by mail-lb0-f173.google.com with SMTP id gj3so6543077lbb.32
	for <multiple recipients>; Tue, 13 Nov 2012 06:57:05 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:date:from:reply-to:user-agent:mime-version:to
	:subject:content-type;
	bh=BbAEHisWirs2G7e6bAtp6BSTPP5hqPHYnObJoDM2uPM=;
	b=Xweg0d3i5lWzo0TU8wLsUee3fEp1YNMzzGVhPFTjmr1iOqeUP2j9cfmG6YSRiAYbku
	uUmjBsurdwDur9/zmX0pnMsB4PbAo926872kWfSDNL/ZhsnS0JNqnY3BBwGDBiN4XAR0
	fw7vDUbGDyc76lseXHO9pIloiRI7a+EUdWDqiMlQtkf9VUd+GXywiGp+ocWi5p49z381
	cLLz1nvqquslBYgs+yg8VTfQMIzQCHB8zGOXzb+h+0l1lkU1UswPOn5RzsGyk+jd80xU
	Mq9NC2jXt/nKGOrUoX/YES3u7ua9+k9OQqyZxIThsaykhUOTCBgrWvyO1QQJHByMTK/d
	i4Uw==
Received: by 10.112.38.70 with SMTP id e6mr3005096lbk.64.1352818625096;
	Tue, 13 Nov 2012 06:57:05 -0800 (PST)
Received: from [172.16.26.11] (b0fb37e5.bb.sky.com. [176.251.55.229])
	by mx.google.com with ESMTPS id m6sm3895315lbh.10.2012.11.13.06.56.55
	(version=SSLv3 cipher=OTHER); Tue, 13 Nov 2012 06:57:04 -0800 (PST)
Message-ID: <50A25FA4.10308@xen.org>
Date: Tue, 13 Nov 2012 14:56:36 +0000
From: Lars Kurth <lars.kurth@xen.org>
User-Agent: Mozilla/5.0 (Windows NT 6.1;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, 
	"xen-api@lists.xen.org" <xen-api@lists.xen.org>,
	xen-users@lists.xen.org, xen-arm@lists.xen.org
Subject: [Xen-devel] Changes to the xen.org site
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: lars.kurth@xen.org
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5621166146042010238=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.
--===============5621166146042010238==
Content-Type: multipart/alternative;
 boundary="------------030203000801050700050209"

This is a multi-part message in MIME format.
--------------030203000801050700050209
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi everybody,

I spent a bit of time cleaning up some lose ends on the xen.org site. If 
you notice any broken links, typos, etc. do let me know. I did the 
following

  * Archived XCI
  * Clearly marked HXEN and Satori project pages to show that these
    projects are also archived
  * Replaced the "Products > Projects" menu and pages with a "Products >
    Governance" menu and page (linking to anything related to
    governance). The reason is that "Products > Products" and "Products
     > Projects" were nearly identical and that I kept on getting
    questions on where to find governance related info.
  * Minor fixes on various pages

You may have to clear your browser cache such that the javascript files 
reload. The site will still work correctly if you don't, but the 
"Products > Projects" menu won't rename and point to the new location 
until the js files have been reloaded by your browser.

Regards
Lars

--------------030203000801050700050209
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi everybody,<br>
    <br>
    I spent a bit of time cleaning up some lose ends on the xen.org
    site. If you notice any broken links, typos, etc. do let me know. I
    did the following <br>
    <ul>
      <li>Archived XCI</li>
      <li>Clearly marked HXEN and Satori project pages to show that
        these projects are also archived <br>
      </li>
      <li>Replaced the "Products &gt; Projects" menu and pages with a
        "Products &gt; Governance" menu and page (linking to anything
        related to governance). The reason is that "Products &gt;
        Products" and "Products &gt; Projects" were nearly identical and
        that I kept on getting questions on where to find governance
        related info.<br>
      </li>
      <li>Minor fixes on various pages</li>
    </ul>
    You may have to clear your browser cache such that the javascript
    files reload. The site will still work correctly if you don't, but
    the "Products &gt; Projects" menu won't rename and point to the new
    location until the js files have been reloaded by your browser.<br>
    <br>
    Regards<br>
    Lars<br>
  </body>
</html>

--------------030203000801050700050209--


--===============5621166146042010238==
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.xen.org
http://lists.xen.org/xen-devel

--===============5621166146042010238==--


From xen-devel-bounces@lists.xen.org Tue Nov 13 15:02:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:02:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYI0a-00066X-J3; Tue, 13 Nov 2012 15:02:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TYI0Y-00065n-OI
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 15:02:34 +0000
Received: from [85.158.143.99:35934] by server-2.bemta-4.messagelabs.com id
	82/C0-28922-A0162A05; Tue, 13 Nov 2012 15:02:34 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1352818952!28849125!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI3ODY1OQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31064 invoked from network); 13 Nov 2012 15:02:33 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-13.tower-216.messagelabs.com with SMTP;
	13 Nov 2012 15:02:33 -0000
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
	by fmsmga102.fm.intel.com with ESMTP; 13 Nov 2012 07:02:32 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,767,1344236400"; d="scan'208";a="248412728"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by fmsmga002.fm.intel.com with ESMTP; 13 Nov 2012 07:02:32 -0800
Received: from fmsmsx102.amr.corp.intel.com (10.19.9.53) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 13 Nov 2012 07:02:31 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX102.amr.corp.intel.com (10.19.9.53) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 13 Nov 2012 07:02:31 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Tue, 13 Nov 2012 23:02:29 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, "Zhang, Yang Z" <yang.z.zhang@intel.com>
Thread-Topic: [Xen-devel] iommu=dom0-passthrough behavior
Thread-Index: AQHNwXYJqLF+2AjHBkK5l/uG97/aIZfnbfFggAAyLdWAADp0YA==
Date: Tue, 13 Nov 2012 15:02:29 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
In-Reply-To: <50A23C0C02000078000A8085@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>, "Zhang,
	Xiantao" <xiantao.zhang@intel.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Tuesday, November 13, 2012 7:25 PM
> To: Zhang, Xiantao; Zhang, Yang Z
> Cc: wei.huang2@amd.com; weiwang.dd@gmail.com; xen-devel
> Subject: RE: [Xen-devel] iommu=dom0-passthrough behavior
> 
> >>> On 13.11.12 at 12:13, "Zhang, Yang Z" <yang.z.zhang@intel.com> wrote:
> > Jan Beulich wrote on 2012-11-13:
> >>>>> On 13.11.12 at 09:50, "Zhang, Xiantao" <xiantao.zhang@intel.com>
> wrote:
> >>>> From: Jan Beulich [mailto:JBeulich@suse.com] Bottom line - I'm
> >>>> seeking advice as to whether working around this problem in the
> >>>> IOMMU code is desirable/necessary, or whether this is a design flaw
> >>>> on the device's side that just cannot be tolerated with an IOMMU in
> >>>> the picture (which would need good reasoning, so that a customer
> >>>> expecting such a device to work regardless of IOMMU usage can
> >>>> understand that this cannot reasonably be made work).
> >
> > Why not just disable the IOMMU in this case ?
> 
> Because that disables (secure) pass through of other devices.
> 
> >>> The issue is why the non-zero functions don't claim themselves
> >>> during PCI bus scan.
> >>
> >> As said - I can't tell whether there is a secondary function in the
> >> first place (and I didn't try to find out because it doesn't really
> >> matter for the purpose of finding a solution/workaround).
> >
> > If software cannot see it, then how to use it? If there still have an
> > approach to detect it, then xen can do it too and setup the context
> > entry as passthrough.
> 
> We see it the latest at the point the fault occurs. So there are multiple
> options:
> a) if the device is "real" as in having a valid config space despite
>     func 0 not advertising itself as multi-function, we have ways to
>     discover the device (at boot time)

I think current Xen logic also covers multi-function devices case.  When Xen boots up, it will scan all functions of devices on each bus, through reads their vendor ID.  If the vendor ID is valid, Xen deems this BDF has a real device/function existed there


> b) we could insert the context entry in the fault handler, assuming
>     the device is able to recover
At least current VT-d doesn't have recovery fault supported, so each triggered faults are fatal. 

> c) we could provide a command line option to allow fake devices to
>     be create

Agree, this maybe a feasible solution I can figure out, so far. 

> d) we could create context entries for all BDFs, whether or not a
>     device exists there

As I said,  this maybe bring security issue. Even for the iommu-passthrough option,  it is also not suggested to be used if security is considered. 

> Does any of these have obvious downsides?
> 
> Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:02:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:02:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYI0a-00066X-J3; Tue, 13 Nov 2012 15:02:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TYI0Y-00065n-OI
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 15:02:34 +0000
Received: from [85.158.143.99:35934] by server-2.bemta-4.messagelabs.com id
	82/C0-28922-A0162A05; Tue, 13 Nov 2012 15:02:34 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1352818952!28849125!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI3ODY1OQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31064 invoked from network); 13 Nov 2012 15:02:33 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-13.tower-216.messagelabs.com with SMTP;
	13 Nov 2012 15:02:33 -0000
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
	by fmsmga102.fm.intel.com with ESMTP; 13 Nov 2012 07:02:32 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.80,767,1344236400"; d="scan'208";a="248412728"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by fmsmga002.fm.intel.com with ESMTP; 13 Nov 2012 07:02:32 -0800
Received: from fmsmsx102.amr.corp.intel.com (10.19.9.53) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 13 Nov 2012 07:02:31 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX102.amr.corp.intel.com (10.19.9.53) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 13 Nov 2012 07:02:31 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Tue, 13 Nov 2012 23:02:29 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, "Zhang, Yang Z" <yang.z.zhang@intel.com>
Thread-Topic: [Xen-devel] iommu=dom0-passthrough behavior
Thread-Index: AQHNwXYJqLF+2AjHBkK5l/uG97/aIZfnbfFggAAyLdWAADp0YA==
Date: Tue, 13 Nov 2012 15:02:29 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
In-Reply-To: <50A23C0C02000078000A8085@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>, "Zhang,
	Xiantao" <xiantao.zhang@intel.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Tuesday, November 13, 2012 7:25 PM
> To: Zhang, Xiantao; Zhang, Yang Z
> Cc: wei.huang2@amd.com; weiwang.dd@gmail.com; xen-devel
> Subject: RE: [Xen-devel] iommu=dom0-passthrough behavior
> 
> >>> On 13.11.12 at 12:13, "Zhang, Yang Z" <yang.z.zhang@intel.com> wrote:
> > Jan Beulich wrote on 2012-11-13:
> >>>>> On 13.11.12 at 09:50, "Zhang, Xiantao" <xiantao.zhang@intel.com>
> wrote:
> >>>> From: Jan Beulich [mailto:JBeulich@suse.com] Bottom line - I'm
> >>>> seeking advice as to whether working around this problem in the
> >>>> IOMMU code is desirable/necessary, or whether this is a design flaw
> >>>> on the device's side that just cannot be tolerated with an IOMMU in
> >>>> the picture (which would need good reasoning, so that a customer
> >>>> expecting such a device to work regardless of IOMMU usage can
> >>>> understand that this cannot reasonably be made work).
> >
> > Why not just disable the IOMMU in this case ?
> 
> Because that disables (secure) pass through of other devices.
> 
> >>> The issue is why the non-zero functions don't claim themselves
> >>> during PCI bus scan.
> >>
> >> As said - I can't tell whether there is a secondary function in the
> >> first place (and I didn't try to find out because it doesn't really
> >> matter for the purpose of finding a solution/workaround).
> >
> > If software cannot see it, then how to use it? If there still have an
> > approach to detect it, then xen can do it too and setup the context
> > entry as passthrough.
> 
> We see it the latest at the point the fault occurs. So there are multiple
> options:
> a) if the device is "real" as in having a valid config space despite
>     func 0 not advertising itself as multi-function, we have ways to
>     discover the device (at boot time)

I think current Xen logic also covers multi-function devices case.  When Xen boots up, it will scan all functions of devices on each bus, through reads their vendor ID.  If the vendor ID is valid, Xen deems this BDF has a real device/function existed there


> b) we could insert the context entry in the fault handler, assuming
>     the device is able to recover
At least current VT-d doesn't have recovery fault supported, so each triggered faults are fatal. 

> c) we could provide a command line option to allow fake devices to
>     be create

Agree, this maybe a feasible solution I can figure out, so far. 

> d) we could create context entries for all BDFs, whether or not a
>     device exists there

As I said,  this maybe bring security issue. Even for the iommu-passthrough option,  it is also not suggested to be used if security is considered. 

> Does any of these have obvious downsides?
> 
> Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:05:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:05:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYI3O-0006O2-FS; Tue, 13 Nov 2012 15:05:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYI1i-0006FD-LG
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 15:03:52 +0000
Received: from [85.158.137.99:17630] by server-10.bemta-3.messagelabs.com id
	20/74-19806-15162A05; Tue, 13 Nov 2012 15:03:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1352819022!12090297!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=Mail larger than max spam size
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10352 invoked from network); 13 Nov 2012 15:03:43 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:03:43 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15781742"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:03:39 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 15:03:38 +0000
Message-ID: <1352819016.7491.84.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
Date: Tue, 13 Nov 2012 15:03:36 +0000
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48A229F471@aplesstripe.dom1.jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
	<068F06DC4D106941B297C0C5F9F446EA48A229F471@aplesstripe.dom1.jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
X-Mailman-Approved-At: Tue, 13 Nov 2012 15:05:28 +0000
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 14:58 +0000, Fioravante, Matthew E. wrote:
> Should I have removed vtpm from xm also? I left it alone because xm is depcrecated.

Is xend broken by this change when not using the vtpm features?

Or just some functionality (which never worked right) went away?

I'm happy to leave xend alone so long as it works as well as it ever did
for people not using vtpm.

> 
> -----Original Message-----
> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> Sent: Tuesday, November 13, 2012 5:49 AM
> To: Fioravante, Matthew E.
> Cc: xen-devel@lists.xen.org; Stefano Stabellini
> Subject: Re: [PATCH VTPM 6/9] Remove the vtpm process model
> 
> On Thu, 2012-11-01 at 20:35 +0000, Matthew Fioravante wrote:
> > Remove the old vtpm process model. It doesn't work very
> > well and is no longer supported.
> >
> > Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> 
> >
> > diff --git a/tools/Makefile b/tools/Makefile
> > index d8c8cc0..2ca43b9 100644
> > --- a/tools/Makefile
> > +++ b/tools/Makefile
> > @@ -18,8 +18,6 @@ SUBDIRS-$(CONFIG_XCUTILS) += xcutils
> >  SUBDIRS-$(CONFIG_X86) += firmware
> >  SUBDIRS-y += console
> >  SUBDIRS-y += xenmon
> > -SUBDIRS-$(VTPM_TOOLS) += vtpm_manager
> > -SUBDIRS-$(VTPM_TOOLS) += vtpm
> >  SUBDIRS-y += xenstat
> >  SUBDIRS-$(CONFIG_Linux) += $(SUBDIRS-libaio)
> >  SUBDIRS-$(CONFIG_Linux) += memshr
> > diff --git a/tools/blktap2/drivers/hashtable.c b/tools/blktap2/drivers/hashtable.c
> > index 631306b..90a6b85 100644
> > --- a/tools/blktap2/drivers/hashtable.c
> > +++ b/tools/blktap2/drivers/hashtable.c
> > @@ -3,7 +3,6 @@
> >  /*
> >   * There are duplicates of this code in:
> >   *  - tools/xenstore/hashtable.c
> > - *  - tools/vtpm_manager/util/hashtable.c
> >   */
> >
> >  #include "hashtable.h"
> > diff --git a/tools/blktap2/drivers/hashtable.h b/tools/blktap2/drivers/hashtable.h
> > index 89aa3dc..56ca053 100644
> > --- a/tools/blktap2/drivers/hashtable.h
> > +++ b/tools/blktap2/drivers/hashtable.h
> > @@ -3,7 +3,6 @@
> >  /*
> >   * There are duplicates of this code in:
> >   *  - tools/xenstore/hashtable.h
> > - *  - tools/vtpm_manager/util/hashtable.h
> >   */
> >
> >  #ifndef __HASHTABLE_CWC22_H__
> > diff --git a/tools/blktap2/drivers/hashtable_itr.c b/tools/blktap2/drivers/hashtable_itr.c
> > index 402e06b..731917c 100644
> > --- a/tools/blktap2/drivers/hashtable_itr.c
> > +++ b/tools/blktap2/drivers/hashtable_itr.c
> > @@ -1,10 +1,5 @@
> >  /* Copyright (C) 2002, 2004 Christopher Clark  <firstname.lastname@cl.cam.ac.uk> */
> >
> > -/*
> > - * There are duplicates of this code in:
> > - *  - tools/vtpm_manager/util/hashtable_itr.c
> > - */
> > -
> >  #include "hashtable.h"
> >  #include "hashtable_private.h"
> >  #include "hashtable_itr.h"
> > diff --git a/tools/blktap2/drivers/hashtable_itr.h b/tools/blktap2/drivers/hashtable_itr.h
> > index 3d80638..81da838 100644
> > --- a/tools/blktap2/drivers/hashtable_itr.h
> > +++ b/tools/blktap2/drivers/hashtable_itr.h
> > @@ -1,10 +1,5 @@
> >  /* Copyright (C) 2002, 2004 Christopher Clark <firstname.lastname@cl.cam.ac.uk> */
> >
> > -/*
> > - * There are duplicates of this code in:
> > - *  - tools/vtpm_manager/util/hashtable_itr.h
> > - */
> > -
> >  #ifndef __HASHTABLE_ITR_CWC22__
> >  #define __HASHTABLE_ITR_CWC22__
> >  #include "hashtable.h"
> > diff --git a/tools/blktap2/drivers/hashtable_private.h b/tools/blktap2/drivers/hashtable_private.h
> > index 5a13a65..954ecc3 100644
> > --- a/tools/blktap2/drivers/hashtable_private.h
> > +++ b/tools/blktap2/drivers/hashtable_private.h
> > @@ -3,7 +3,6 @@
> >  /*
> >   * There are duplicates of this code in:
> >   *  - tools/xenstore/hashtable_private.h
> > - *  - tools/vtpm_manager/util/hashtable_private.h
> >   */
> >
> >  #ifndef __HASHTABLE_PRIVATE_CWC22_H__
> > diff --git a/tools/configure.ac b/tools/configure.ac
> > index e708f01..586313d 100644
> > --- a/tools/configure.ac
> > +++ b/tools/configure.ac
> > @@ -40,7 +40,6 @@ m4_include([m4/fetcher.m4])
> >  # Enable/disable options
> >  AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
> >  AX_ARG_DEFAULT_ENABLE([monitors], [Disable xenstat and xentop monitoring tools])
> > -AX_ARG_DEFAULT_DISABLE([vtpm], [Enable Virtual Trusted Platform Module])
> >  AX_ARG_DEFAULT_DISABLE([xenapi], [Enable Xen API Bindings])
> >  AX_ARG_DEFAULT_ENABLE([ocamltools], [Disable Ocaml tools])
> >  AX_ARG_DEFAULT_DISABLE([miniterm], [Enable miniterm])
> > diff --git a/tools/examples/README b/tools/examples/README
> > index 5b0314e..2225d5c 100644
> > --- a/tools/examples/README
> > +++ b/tools/examples/README
> > @@ -25,13 +25,7 @@ vif-bridge          - virtual network start/stop script in bridged mode
> >  vif-common.sh       - sourced by vif-bridge
> >  vif-nat             - xen virtual network start/stop script in NAT mode
> >  vif-route           - xen virtual network start/stop script in routed mode
> > -vtpm                - called by xen-backend.agent to bind/unbind vTPM devices
> > -vtpm-common.sh      - common code for vTPM handling
> > -vtpm-delete         - remove an entry from the vTPM table given the
> > -                      domain's name
> > -vtpm-hotplug-common.sh - sourced by vtpm
> > -vtpm-migration.sh   - sourced by external-device-migrate
> > -xen-backend.agent   - calls block, vif-*, vtpm scripts to add, remove, hotplug
> > +xen-backend.agent   - calls block, vif-* scripts to add, remove, hotplug
> >                        devices
> >  xen-backend.rules   - hotplug script rules
> >  xend-config.sxp     - default xend configuration file
> > diff --git a/tools/examples/xmexample.pv-grub b/tools/examples/xmexample.pv-grub
> > index 85f847c..e04e6c1 100644
> > --- a/tools/examples/xmexample.pv-grub
> > +++ b/tools/examples/xmexample.pv-grub
> > @@ -105,20 +105,6 @@ disk = [ 'phy:hda1,hda1,w' ]
> >  # configured in xend-config.sxp.
> >
> >  #----------------------------------------------------------------------------
> > -# Define to which TPM instance the user domain should communicate.
> > -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> > -# where INSTANCE indicates the instance number of the TPM the VM
> > -# should be talking to and DOM provides the domain where the backend
> > -# is located.
> > -# Note that no two virtual machines should try to connect to the same
> > -# TPM instance. The handling of all TPM instances does require
> > -# some management effort in so far that VM configration files (and thus
> > -# a VM) should be associated with a TPM instance throughout the lifetime
> > -# of the VM / VM configuration file. The instance number must be
> > -# greater or equal to 1.
> > -#vtpm = [ 'instance=1,backend=0' ]
> > -
> > -#----------------------------------------------------------------------------
> >  # Configure the behaviour when a domain exits.  There are three 'reasons'
> >  # for a domain to stop: poweroff, reboot, and crash.  For each of these you
> >  # may specify:
> > diff --git a/tools/examples/xmexample1 b/tools/examples/xmexample1
> > index 330aaf0..c951200 100644
> > --- a/tools/examples/xmexample1
> > +++ b/tools/examples/xmexample1
> > @@ -101,20 +101,6 @@ disk = [ 'phy:hda1,hda1,w' ]
> >  # configured in xend-config.sxp.
> >
> >  #----------------------------------------------------------------------------
> > -# Define to which TPM instance the user domain should communicate.
> > -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> > -# where INSTANCE indicates the instance number of the TPM the VM
> > -# should be talking to and DOM provides the domain where the backend
> > -# is located.
> > -# Note that no two virtual machines should try to connect to the same
> > -# TPM instance. The handling of all TPM instances does require
> > -# some management effort in so far that VM configration files (and thus
> > -# a VM) should be associated with a TPM instance throughout the lifetime
> > -# of the VM / VM configuration file. The instance number must be
> > -# greater or equal to 1.
> > -#vtpm = [ 'instance=1,backend=0' ]
> > -
> > -#----------------------------------------------------------------------------
> >  # Set the kernel command line for the new domain.
> >  # You only need to define the IP parameters and hostname if the domain's
> >  # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
> > diff --git a/tools/examples/xmexample2 b/tools/examples/xmexample2
> > index 4e5eb3d..8c5137e 100644
> > --- a/tools/examples/xmexample2
> > +++ b/tools/examples/xmexample2
> > @@ -137,20 +137,6 @@ disk = [ 'phy:sda%d,sda1,w' % (7+vmid),
> >  # configured in xend-config.sxp.
> >
> >  #----------------------------------------------------------------------------
> > -# Define to which TPM instance the user domain should communicate.
> > -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> > -# where INSTANCE indicates the instance number of the TPM the VM
> > -# should be talking to and DOM provides the domain where the backend
> > -# is located.
> > -# Note that no two virtual machines should try to connect to the same
> > -# TPM instance. The handling of all TPM instances does require
> > -# some management effort in so far that VM configration files (and thus
> > -# a VM) should be associated with a TPM instance throughout the lifetime
> > -# of the VM / VM configuration file. The instance number must be
> > -# greater or equal to 1.
> > -#vtpm = ['instance=%d,backend=0' % (vmid) ]
> > -
> > -#----------------------------------------------------------------------------
> >  # Set the kernel command line for the new domain.
> >  # You only need to define the IP parameters and hostname if the domain's
> >  # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
> > diff --git a/tools/examples/xmexample3 b/tools/examples/xmexample3
> > index dc22ce1..ae799f9 100644
> > --- a/tools/examples/xmexample3
> > +++ b/tools/examples/xmexample3
> > @@ -122,20 +122,6 @@ disk = [ 'phy:hda%d,hda1,w' % (vmid)]
> >  # configured in xend-config.sxp.
> >
> >  #----------------------------------------------------------------------------
> > -# Define to which TPM instance the user domain should communicate.
> > -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> > -# where INSTANCE indicates the instance number of the TPM the VM
> > -# should be talking to and DOM provides the domain where the backend
> > -# is located.
> > -# Note that no two virtual machines should try to connect to the same
> > -# TPM instance. The handling of all TPM instances does require
> > -# some management effort in so far that VM configration files (and thus
> > -# a VM) should be associated with a TPM instance throughout the lifetime
> > -# of the VM / VM configuration file. The instance number must be
> > -# greater or equal to 1.
> > -#vtpm = ['instance=%d,backend=0' % (vmid) ]
> > -
> > -#----------------------------------------------------------------------------
> >  # Set the kernel command line for the new domain.
> >  # You only need to define the IP parameters and hostname if the domain's
> >  # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
> > diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
> > index 0166790..0605559 100644
> > --- a/tools/hotplug/Linux/Makefile
> > +++ b/tools/hotplug/Linux/Makefile
> > @@ -18,14 +18,12 @@ XEN_SCRIPTS += vif-setup
> >  XEN_SCRIPTS += block
> >  XEN_SCRIPTS += block-enbd block-nbd
> >  XEN_SCRIPTS += blktap
> > -XEN_SCRIPTS += vtpm vtpm-delete
> >  XEN_SCRIPTS += xen-hotplug-cleanup
> >  XEN_SCRIPTS += external-device-migrate
> >  XEN_SCRIPTS += vscsi
> >  XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
> >  XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
> > -XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
> > -XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
> > +XEN_SCRIPT_DATA += block-common.sh
> >
> >  UDEV_RULES_DIR = $(CONFIG_DIR)/udev
> >  UDEV_RULES = xen-backend.rules xend.rules
> > diff --git a/tools/hotplug/Linux/vtpm b/tools/hotplug/Linux/vtpm
> > deleted file mode 100644
> > index 38a4532..0000000
> > --- a/tools/hotplug/Linux/vtpm
> > +++ /dev/null
> > @@ -1,22 +0,0 @@
> > -#!/bin/bash
> > -
> > -dir=$(dirname "$0")
> > -. "$dir/vtpm-hotplug-common.sh"
> > -
> > -vtpm_fatal_error=0
> > -
> > -case "$command" in
> > -  add)
> > -    vtpm_create_instance
> > -  ;;
> > -  remove)
> > -    vtpm_remove_instance
> > -  ;;
> > -esac
> > -
> > -if [ $vtpm_fatal_error -eq 0 ]; then
> > -       log debug "Successful vTPM operation '$command'."
> > -       success
> > -else
> > -       fatal "Error while executing vTPM operation '$command'."
> > -fi
> > diff --git a/tools/hotplug/Linux/vtpm-common.sh b/tools/hotplug/Linux/vtpm-common.sh
> > deleted file mode 100644
> > index d0d7935..0000000
> > --- a/tools/hotplug/Linux/vtpm-common.sh
> > +++ /dev/null
> > @@ -1,448 +0,0 @@
> > -#
> > -# Copyright (c) 2005 IBM Corporation
> > -# Copyright (c) 2005 XenSource Ltd.
> > -#
> > -# 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
> > -#
> > -
> > -dir=$(dirname "$0")
> > -. "$dir/logging.sh"
> > -. "$dir/locking.sh"
> > -
> > -VTPMDB="/var/vtpm/vtpm.db"
> > -
> > -#In the vtpm-impl file some commands should be defined:
> > -#      vtpm_create, vtpm_setup, vtpm_start, etc. (see below)
> > -if [ -r "$dir/vtpm-impl.alt" ]; then
> > -       . "$dir/vtpm-impl.alt"
> > -elif [ -r "$dir/vtpm-impl" ]; then
> > -       . "$dir/vtpm-impl"
> > -else
> > -       function vtpm_create () {
> > -               true
> > -       }
> > -       function vtpm_setup() {
> > -               true
> > -       }
> > -       function vtpm_start() {
> > -               true
> > -       }
> > -       function vtpm_suspend() {
> > -               true
> > -       }
> > -       function vtpm_resume() {
> > -               true
> > -       }
> > -       function vtpm_delete() {
> > -               true
> > -       }
> > -       function vtpm_migrate() {
> > -               echo "Error: vTPM migration accross machines not implemented."
> > -       }
> > -       function vtpm_migrate_local() {
> > -               echo "Error: local vTPM migration not supported"
> > -       }
> > -       function vtpm_migrate_recover() {
> > -               true
> > -       }
> > -fi
> > -
> > -
> > -#Find the instance number for the vtpm given the name of the domain
> > -# Parameters
> > -# - vmname : the name of the vm
> > -# Return value
> > -#  Returns '0' if instance number could not be found, otherwise
> > -#  it returns the instance number in the variable 'instance'
> > -function vtpmdb_find_instance () {
> > -       local vmname ret instance
> > -       vmname=$1
> > -       ret=0
> > -
> > -       instance=$(cat $VTPMDB |                   \
> > -                 awk -vvmname=$vmname             \
> > -                 '{                               \
> > -                    if ( 1 != index($1,"#")) {    \
> > -                      if ( $1 == vmname ) {       \
> > -                        print $2;                 \
> > -                        exit;                     \
> > -                      }                           \
> > -                    }                             \
> > -                  }')
> > -       if [ "$instance" != "" ]; then
> > -               ret=$instance
> > -       fi
> > -       echo "$ret"
> > -}
> > -
> > -
> > -# Check whether a particular instance number is still available
> > -# returns "0" if it is not available, "1" otherwise.
> > -function vtpmdb_is_free_instancenum () {
> > -       local instance instances avail i
> > -       instance=$1
> > -       avail=1
> > -       #Allowed instance number range: 1-255
> > -       if [ $instance -eq 0 -o $instance -gt 255 ]; then
> > -               avail=0
> > -       else
> > -               instances=$(cat $VTPMDB |                \
> > -                          awk                          \
> > -                          '{                            \
> > -                              if (1 != index($1,"#")) { \
> > -                                printf("%s ",$2);       \
> > -                              }                         \
> > -                           }')
> > -               for i in $instances; do
> > -                       if [ $i -eq $instance ]; then
> > -                               avail=0
> > -                               break
> > -                       fi
> > -               done
> > -       fi
> > -       echo "$avail"
> > -}
> > -
> > -
> > -# Get an available instance number given the database
> > -# Returns an unused instance number
> > -function vtpmdb_get_free_instancenum () {
> > -       local ctr instances don found
> > -       instances=$(cat $VTPMDB |                \
> > -                  awk                          \
> > -                  '{                            \
> > -                      if (1 != index($1,"#")) { \
> > -                        printf("%s ",$2);       \
> > -                      }                         \
> > -                   }')
> > -       ctr=1
> > -       don=0
> > -       while [ $don -eq 0 ]; do
> > -               found=0
> > -               for i in $instances; do
> > -                       if [ $i -eq $ctr ]; then
> > -                               found=1;
> > -                               break;
> > -                       fi
> > -               done
> > -
> > -               if [ $found -eq 0 ]; then
> > -                       don=1
> > -                       break
> > -               fi
> > -               let ctr=ctr+1
> > -       done
> > -       echo "$ctr"
> > -}
> > -
> > -
> > -# Add a domain name and instance number to the DB file
> > -function vtpmdb_add_instance () {
> > -       local res vmname inst
> > -       vmname=$1
> > -       inst=$2
> > -
> > -       if [ ! -f $VTPMDB ]; then
> > -               echo "#Database for VM to vTPM association" > $VTPMDB
> > -               echo "#1st column: domain name" >> $VTPMDB
> > -               echo "#2nd column: TPM instance number" >> $VTPMDB
> > -       fi
> > -       res=$(vtpmdb_validate_entry $vmname $inst)
> > -       if [ $res -eq 0 ]; then
> > -               echo "$vmname $inst" >> $VTPMDB
> > -       fi
> > -}
> > -
> > -
> > -#Validate whether an entry is the same as passed to this
> > -#function
> > -function vtpmdb_validate_entry () {
> > -       local res rc vmname inst
> > -       rc=0
> > -       vmname=$1
> > -       inst=$2
> > -
> > -       res=$(cat $VTPMDB |            \
> > -            awk -vvmname=$vmname     \
> > -                 -vinst=$inst         \
> > -            '{                        \
> > -                if ( 1 == index($1,"#")) {\
> > -                } else                \
> > -                if ( $1 == vmname &&  \
> > -                     $2 == inst) {    \
> > -                   printf("1");       \
> > -                   exit;              \
> > -                } else                \
> > -                if ( $1 == vmname ||  \
> > -                     $2 == inst) {    \
> > -                   printf("2");       \
> > -                   exit;              \
> > -                }                     \
> > -            }')
> > -
> > -       if [ "$res" == "1" ]; then
> > -               rc=1
> > -       elif [ "$res" == "2" ]; then
> > -               rc=2
> > -       fi
> > -       echo "$rc"
> > -}
> > -
> > -
> > -#Remove an entry from the vTPM database given its domain name
> > -#and instance number
> > -function vtpmdb_remove_entry () {
> > -       local vmname instance VTPMDB_TMP
> > -       vmname=$1
> > -       instance=$2
> > -       VTPMDB_TMP="$VTPMDB".tmp
> > -
> > -       $(cat $VTPMDB |            \
> > -        awk -vvmname=$vmname     \
> > -        '{                        \
> > -           if ( $1 != vmname ) {  \
> > -             print $0;            \
> > -           }                      \
> > -        '} > $VTPMDB_TMP)
> > -       if [ -e $VTPMDB_TMP ]; then
> > -               mv -f $VTPMDB_TMP $VTPMDB
> > -               vtpm_delete $instance
> > -       else
> > -               log err "Error creating temporary file '$VTPMDB_TMP'."
> > -       fi
> > -}
> > -
> > -
> > -# Find the reason for the creation of this device:
> > -# Returns 'resume' or 'create'
> > -function vtpm_get_create_reason () {
> > -       local resume
> > -       resume=$(xenstore_read $XENBUS_PATH/resume)
> > -       if [ "$resume" == "True" ]; then
> > -               echo "resume"
> > -       else
> > -               echo "create"
> > -       fi
> > -}
> > -
> > -
> > -#Create a vTPM instance
> > -# If no entry in the TPM database is found, the instance is
> > -# created and an entry added to the database.
> > -function vtpm_create_instance () {
> > -       local res instance domname reason uuid
> > -       uuid=$(xenstore_read "$XENBUS_PATH"/uuid)
> > -       reason=$(vtpm_get_create_reason)
> > -
> > -       claim_lock vtpmdb
> > -
> > -       instance="0"
> > -
> > -       if [ "$uuid" != "" ]; then
> > -               instance=$(vtpmdb_find_instance $uuid)
> > -       fi
> > -       if [ "$instance" == "0" ]; then
> > -               domname=$(xenstore_read "$XENBUS_PATH"/domain)
> > -               instance=$(vtpmdb_find_instance $domname)
> > -       fi
> > -
> > -       if [ "$instance" == "0" -a "$reason" != "create" ]; then
> > -               release_lock vtpmdb
> > -               return
> > -       fi
> > -
> > -       if [ "$instance" == "0" ]; then
> > -               #Try to give the preferred instance to the domain
> > -               instance=$(xenstore_read "$XENBUS_PATH"/pref_instance)
> > -               if [ "$instance" != "" ]; then
> > -                       res=$(vtpmdb_is_free_instancenum $instance)
> > -                       if [ $res -eq 0 ]; then
> > -                               instance=$(vtpmdb_get_free_instancenum)
> > -                       fi
> > -               else
> > -                       instance=$(vtpmdb_get_free_instancenum)
> > -               fi
> > -
> > -               vtpm_create $instance
> > -
> > -               if [ $vtpm_fatal_error -eq 0 ]; then
> > -                       if [ "$uuid" != "" ]; then
> > -                               vtpmdb_add_instance $uuid $instance
> > -                       else
> > -                               vtpmdb_add_instance $domname $instance
> > -                       fi
> > -               fi
> > -       else
> > -               if [ "$reason" == "resume" ]; then
> > -                       vtpm_resume $instance
> > -               else
> > -                       vtpm_start $instance
> > -               fi
> > -       fi
> > -
> > -       release_lock vtpmdb
> > -
> > -       xenstore_write $XENBUS_PATH/instance $instance
> > -}
> > -
> > -
> > -#Remove an instance when a VM is terminating or suspending.
> > -#Since it is assumed that the VM will appear again, the
> > -#entry is kept in the VTPMDB file.
> > -function vtpm_remove_instance () {
> > -       local instance reason domname uuid
> > -       #Stop script execution quietly if path does not exist (anymore)
> > -       xenstore-exists "$XENBUS_PATH"/domain
> > -       uuid=$(xenstore_read "$XENBUS_PATH"/uuid)
> > -
> > -       claim_lock vtpmdb
> > -
> > -       instance="0"
> > -
> > -       if [ "$uuid" != "" ]; then
> > -               instance=$(vtpmdb_find_instance $uuid)
> > -       fi
> > -
> > -       if [ "$instance" == "0" ]; then
> > -               domname=$(xenstore_read "$XENBUS_PATH"/domain)
> > -               instance=$(vtpmdb_find_instance $domname)
> > -       fi
> > -
> > -       if [ "$instance" != "0" ]; then
> > -               vtpm_suspend $instance
> > -       fi
> > -
> > -       release_lock vtpmdb
> > -}
> > -
> > -
> > -#Remove an entry in the VTPMDB file given the domain's name
> > -#1st parameter: The name of the domain
> > -function vtpm_delete_instance () {
> > -       local instance
> > -
> > -       claim_lock vtpmdb
> > -
> > -       instance=$(vtpmdb_find_instance $1)
> > -       if [ "$instance" != "0" ]; then
> > -               vtpmdb_remove_entry $1 $instance
> > -       fi
> > -
> > -       release_lock vtpmdb
> > -}
> > -
> > -# Determine whether the given address is local to this machine
> > -# Return values:
> > -#  "-1" : the given machine name is invalid
> > -#  "0"  : this is not an address of this machine
> > -#  "1"  : this is an address local to this machine
> > -function vtpm_isLocalAddress() {
> > -       local addr res
> > -       addr=$(ping $1 -c 1 |  \
> > -              awk '{ print substr($3,2,length($3)-2); exit }')
> > -       if [ "$addr" == "" ]; then
> > -               echo "-1"
> > -               return
> > -       fi
> > -       res=$(ifconfig | grep "inet addr" |  \
> > -            awk -vaddr=$addr               \
> > -            '{                              \
> > -               if ( addr == substr($2, 6)) {\
> > -                 print "1";                 \
> > -               }                            \
> > -            }'                              \
> > -           )
> > -       if [ "$res" == "" ]; then
> > -               echo "0"
> > -               return
> > -       fi
> > -       echo "1"
> > -}
> > -
> > -# Perform a migration step. This function differentiates between migration
> > -# to the local host or to a remote machine.
> > -# Parameters:
> > -# 1st: destination host to migrate to
> > -# 2nd: name of the domain to migrate
> > -# 3rd: the migration step to perform
> > -function vtpm_migration_step() {
> > -       local res=$(vtpm_isLocalAddress $1)
> > -       if [ "$res" == "0" ]; then
> > -               vtpm_migrate $1 $2 $3
> > -       else
> > -               vtpm_migrate_local
> > -       fi
> > -}
> > -
> > -# Recover from migration due to an error. This function differentiates
> > -# between migration to the local host or to a remote machine.
> > -# Parameters:
> > -# 1st: destination host the migration was going to
> > -# 2nd: name of the domain that was to be migrated
> > -# 3rd: the last successful migration step that was done
> > -function vtpm_recover() {
> > -       local res
> > -       res=$(vtpm_isLocalAddress $1)
> > -       if [ "$res" == "0" ]; then
> > -               vtpm_migrate_recover $1 $2 $3
> > -       fi
> > -}
> > -
> > -
> > -#Determine the domain id given a domain's name.
> > -#1st parameter: name of the domain
> > -#return value: domain id  or -1 if domain id could not be determined
> > -function vtpm_domid_from_name () {
> > -       local id name ids
> > -       ids=$(xenstore-list /local/domain)
> > -       for id in $ids; do
> > -               name=$(xenstore-read /local/domain/$id/name)
> > -               if [ "$name" == "$1" ]; then
> > -                       echo "$id"
> > -                       return
> > -               fi
> > -       done
> > -       echo "-1"
> > -}
> > -
> > -#Determine the virtual TPM's instance number using the domain ID.
> > -#1st parm: domain ID
> > -function vtpm_uuid_by_domid() {
> > -       echo $(xenstore-read /local/domain/0/backend/vtpm/$1/0/uuid)
> > -}
> > -
> > -
> > -# Determine the vTPM's UUID by the name of the VM
> > -function vtpm_uuid_from_vmname() {
> > -       local domid=$(vtpm_domid_from_name $1)
> > -       if [ "$domid" != "-1" ]; then
> > -               echo $(vtpm_uuid_by_domid $domid)
> > -               return
> > -       fi
> > -       echo ""
> > -}
> > -
> > -#Add a virtual TPM instance number and its associated domain name
> > -#to the VTPMDB file and activate usage of this virtual TPM instance
> > -#by writing the instance number into the xenstore
> > -#1st parm: name of virtual machine
> > -#2nd parm: instance of associated virtual TPM
> > -function vtpm_add_and_activate() {
> > -       local domid=$(vtpm_domid_from_name $1)
> > -       local vtpm_uuid=$(vtpm_uuid_from_vmname $1)
> > -       if [ "$vtpm_uuid" != "" -a "$domid" != "-1" ]; then
> > -               vtpmdb_add_instance $vtpm_uuid $2
> > -               xenstore-write backend/vtpm/$domid/0/instance $2
> > -       fi
> > -}
> > diff --git a/tools/hotplug/Linux/vtpm-delete b/tools/hotplug/Linux/vtpm-delete
> > deleted file mode 100644
> > index b75b95b..0000000
> > --- a/tools/hotplug/Linux/vtpm-delete
> > +++ /dev/null
> > @@ -1,18 +0,0 @@
> > -#!/bin/bash
> > -
> > -# This scripts must be called the following way:
> > -# vtpm-delete <vtpm uuid>
> > -# or
> > -# vtpm-delete --vmname <vm name>
> > -
> > -dir=$(dirname "$0")
> > -. "$dir/vtpm-common.sh"
> > -
> > -if [ "$1" == "--vmname" ]; then
> > -       vtpm_uuid=$(vtpm_uuid_from_vmname $2)
> > -       if [ "$vtpm_uuid" != "" ];then
> > -               vtpm_delete_instance $vtpm_uuid
> > -       fi
> > -else
> > -       vtpm_delete_instance $1
> > -fi
> > diff --git a/tools/hotplug/Linux/vtpm-hotplug-common.sh b/tools/hotplug/Linux/vtpm-hotplug-common.sh
> > deleted file mode 100644
> > index 9fd35e7..0000000
> > --- a/tools/hotplug/Linux/vtpm-hotplug-common.sh
> > +++ /dev/null
> > @@ -1,35 +0,0 @@
> > -#
> > -# Copyright (c) 2005 IBM Corporation
> > -# Copyright (c) 2005 XenSource Ltd.
> > -#
> > -# 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
> > -#
> > -
> > -dir=$(dirname "$0")
> > -. "$dir/xen-hotplug-common.sh"
> > -
> > -findCommand "$@"
> > -if [ "$command" != "online" ]  &&
> > -   [ "$command" != "offline" ] &&
> > -   [ "$command" != "add" ]     &&
> > -   [ "$command" != "remove" ]
> > -then
> > -       log err "Invalid command: $command"
> > -       exit 1
> > -fi
> > -
> > -
> > -XENBUS_PATH="${XENBUS_PATH:?}"
> > -
> > -. "$dir/vtpm-common.sh"
> > diff --git a/tools/hotplug/Linux/vtpm-impl b/tools/hotplug/Linux/vtpm-impl
> > deleted file mode 100644
> > index 4f9a1fd..0000000
> > --- a/tools/hotplug/Linux/vtpm-impl
> > +++ /dev/null
> > @@ -1,208 +0,0 @@
> > -#!/bin/bash
> > -# ===================================================================
> > -#
> > -# Copyright (c) 2005, Intel Corp.
> > -# All rights reserved.
> > -#
> > -# Redistribution and use in source and binary forms, with or without
> > -# modification, are permitted provided that the following conditions
> > -# are met:
> > -#
> > -#   * Redistributions of source code must retain the above copyright
> > -#     notice, this list of conditions and the following disclaimer.
> > -#   * Redistributions in binary form must reproduce the above
> > -#     copyright notice, this list of conditions and the following
> > -#     disclaimer in the documentation and/or other materials provided
> > -#     with the distribution.
> > -#   * Neither the name of Intel Corporation nor the names of its
> > -#     contributors may be used to endorse or promote products derived
> > -#     from this software without specific prior written permission.
> > -#
> > -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -# OF THE POSSIBILITY OF SUCH DAMAGE.
> > -# ===================================================================
> > -
> > -#            |        SRC        |    TAG  |      CMD SIZE     |        ORD       |mtype|strt
> > -TPM_CMD_OPEN=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x11\\x01\\x00\\x00\\x01\\x01\\x01
> > -TPM_CMD_RESM=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x11\\x01\\x00\\x00\\x01\\x01\\x02
> > -TPM_CMD_CLOS=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x0e\\x01\\x00\\x00\\x02
> > -TPM_CMD_DELE=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x0e\\x01\\x00\\x00\\x03
> > -
> > -TPM_TYPE_PVM=\\x01
> > -TPM_TYPE_HVM=\\x02
> > -
> > -TPM_SUCCESS=00000000
> > -
> > -TX_VTPM_MANAGER=/var/vtpm/fifos/from_console.fifo
> > -RX_VTPM_MANAGER=/var/vtpm/fifos/to_console.fifo
> > -
> > -VTPM_MIG=/usr/bin/vtpm_migrator
> > -
> > -# -------------------- Helpers for binary streams -----------
> > -
> > -function str_to_hex32() {
> > - printf "%0.8x" $1
> > -}
> > -
> > -function hex32_to_bin() {
> > - local inst=$(str_to_hex32 $1);
> > -
> > - local n1=`echo $inst | sed 's/\(..\)....../\\\\x\1/'`
> > - local n2=`echo $inst | sed 's/..\(..\)..../\\\\x\1/'`
> > - local n3=`echo $inst | sed 's/....\(..\)../\\\\x\1/'`
> > - local n4=`echo $inst | sed 's/......\(..\)/\\\\x\1/'`
> > -
> > - echo "$n1$n2$n3$n4"
> > -}
> > -
> > -function vtpm_manager_cmd() {
> > - local cmd=$1;
> > - local inst=$2;
> > - local inst_bin=$(hex32_to_bin $inst);
> > -
> > - claim_lock vtpm_mgr
> > -
> > - #send cmd to vtpm_manager
> > - printf "$cmd$inst_bin" > $TX_VTPM_MANAGER
> > -
> > - #recv response
> > - set +e
> > - local resp_hex=`dd skip=10 bs=1 count=4 if=$RX_VTPM_MANAGER 2> /dev/null | xxd -ps`
> > - set -e
> > -
> > - release_lock vtpm_mgr
> > -
> > - #return whether the command was successful
> > - if [ $resp_hex -ne $TPM_SUCCESS ]; then
> > -   vtpm_fatal_error=1
> > -   false
> > -  else
> > -   true
> > - fi
> > -}
> > -
> > -# Helper to get vm type to pass to vtpm_manager open/resume
> > -function vtpm_get_type() {
> > - local inst=$(xenstore_read $XENBUS_PATH/frontend-id)
> > - local vm=$(xenstore_read /local/domain/$inst/vm)
> > - if [ "$vm" != "" ]; then
> > -  local ostype=$(xenstore-read $vm/image/ostype)
> > -  if [ "$ostype" == "hvm" ]; then
> > -   echo $TPM_TYPE_HVM;
> > -  else
> > -   echo $TPM_TYPE_PVM;
> > -  fi
> > - fi
> > -}
> > -
> > -# ------------------ Command handlers -----------------
> > -
> > -# Create new vtpm instance & set it up for use
> > -function vtpm_create () {
> > - # Creation is handled implicitly by the manager on first setup
> > - # so just set it up for use
> > - $(vtpm_start $1)
> > -}
> > -
> > -# Setup vtpm instance for use.
> > -function vtpm_start() {
> > - local vmtype=$(vtpm_get_type);
> > - $(vtpm_manager_cmd $TPM_CMD_OPEN$vmtype $1)
> > -}
> > -
> > -function vtpm_resume() {
> > - local vmtype=$(vtpm_get_type);
> > - $(vtpm_manager_cmd $TPM_CMD_RESM$vmtype $1)
> > -}
> > -
> > -# Reset the vtpm AKA clear PCRs
> > -function vtpm_reset() {
> > - #not used by current implemenation
> > - true
> > -}
> > -
> > -# Shutdown the vtpm while the vm is down
> > -# This could be a suspend of shutdown
> > -# we cannot distinquish, so save the state
> > -# and decide on startup if we should keep is
> > -function vtpm_suspend() {
> > - $(vtpm_manager_cmd $TPM_CMD_CLOS $1)
> > -}
> > -
> > -
> > -function vtpm_delete() {
> > - local inst=$1
> > - if $(vtpm_manager_cmd $TPM_CMD_DELE $inst); then
> > -   rm -f /var/vtpm/vtpm_dm_$1.data
> > -   true
> > - else
> > -   vtpm_fatal_error=1
> > -   false
> > - fi
> > -}
> > -
> > -# Perform a migration step. This function differentiates between migration
> > -# to the local host or to a remote machine.
> > -# Parameters:
> > -# 1st: destination host to migrate to
> > -# 2nd: name of the domain to migrate
> > -# 3rd: the migration step to perform
> > -function vtpm_migrate() {
> > - local instance res
> > -
> > - instance=$(vtpmdb_find_instance $2)
> > - if [ "$instance" == "" ]; then
> > -  log err "VTPM Migratoin failed. Unable to translation of domain name"
> > -  echo "Error: VTPM Migration failed while looking up instance number"
> > - fi
> > -
> > - case "$3" in
> > -  0)
> > -   #Incicate migration supported
> > -   echo "0"
> > -  ;;
> > -
> > -  1)
> > -   # Get Public Key from Destination
> > -   # Call vtpm_manager's migration part 1
> > -   claim_lock vtpm_mgr
> > -   $VTPM_MIG $1 $2 $instance $3
> > -   release_lock vtpm_mgr
> > -  ;;
> > -
> > -  2)
> > -   # Call manager's migration step 2 and send result to destination
> > -   # If successful remove from db
> > -   claim_lock vtpm_mgr
> > -   $VTPM_MIG $1 $2 $instance $3
> > -   release_lock vtpm_mgr
> > -  ;;
> > -
> > -  3)
> > -   if `ps x | grep "$VTPM_MIG $1"`; then
> > -    log err "VTPM Migration failed to complete."
> > -    echo "Error: VTPM Migration failed to complete."
> > -   fi
> > -  ;;
> > - esac
> > -
> > -}
> > -
> > -
> > -function vtpm_migrate_recover() {
> > - echo "Error: Recovery not supported yet"
> > -}
> > -
> > -function vtpm_migrate_local() {
> > - echo "Error: local vTPM migration not supported"
> > -}
> > diff --git a/tools/hotplug/Linux/vtpm-migration.sh b/tools/hotplug/Linux/vtpm-migration.sh
> > deleted file mode 100644
> > index 7e38ae2..0000000
> > --- a/tools/hotplug/Linux/vtpm-migration.sh
> > +++ /dev/null
> > @@ -1,19 +0,0 @@
> > -#
> > -# Copyright (c) 2005 IBM Corporation
> > -#
> > -# 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
> > -#
> > -
> > -dir=$(dirname "$0")
> > -. "$dir/vtpm-common.sh"
> > diff --git a/tools/hotplug/Linux/xen-backend.rules b/tools/hotplug/Linux/xen-backend.rules
> > index c591a3f..a0d409e 100644
> > --- a/tools/hotplug/Linux/xen-backend.rules
> > +++ b/tools/hotplug/Linux/xen-backend.rules
> > @@ -1,6 +1,5 @@
> >  SUBSYSTEM=="xen-backend", KERNEL=="tap*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/blktap $env{ACTION}"
> >  SUBSYSTEM=="xen-backend", KERNEL=="vbd*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/block $env{ACTION}"
> > -SUBSYSTEM=="xen-backend", KERNEL=="vtpm*", RUN+="/etc/xen/scripts/vtpm $env{ACTION}"
> >  SUBSYSTEM=="xen-backend", KERNEL=="vif2-*", RUN+="/etc/xen/scripts/vif2 $env{ACTION}"
> >  SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="online", RUN+="/etc/xen/scripts/vif-setup online type_if=vif"
> >  SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="offline", RUN+="/etc/xen/scripts/vif-setup offline type_if=vif"
> > diff --git a/tools/vtpm/Makefile b/tools/vtpm/Makefile
> > deleted file mode 100644
> > index 7b3efa5..0000000
> > --- a/tools/vtpm/Makefile
> > +++ /dev/null
> > @@ -1,74 +0,0 @@
> > -XEN_ROOT = $(CURDIR)/../..
> > -
> > -# Base definitions and rules
> > -include $(XEN_ROOT)/tools/vtpm/Rules.mk
> > -
> > -# Dir name for emulator (as dom0 tpm driver)
> > -TPM_EMULATOR_DIR = tpm_emulator
> > -# Dir name for vtpm instance
> > -VTPM_DIR = vtpm
> > -ORIG_DIR = orig
> > -
> > -# Emulator tarball name
> > -TPM_EMULATOR_NAME = tpm_emulator-0.5.1
> > -TPM_EMULATOR_TARFILE = $(TPM_EMULATOR_NAME).tar.gz
> > -
> > -GMP_HEADER = /usr/include/gmp.h
> > -
> > -.PHONY: all
> > -all: build
> > -
> > -.PHONY: build
> > -build: build_sub
> > -
> > -.PHONY: install
> > -install: build
> > -       $(MAKE) -C $(VTPM_DIR) install-recursive
> > -
> > -.PHONY: clean
> > -clean:
> > -       @if [ -d $(TPM_EMULATOR_DIR) ]; \
> > -               then $(MAKE) -C $(TPM_EMULATOR_DIR) clean; \
> > -       fi
> > -       @if [ -d $(VTPM_DIR) ]; \
> > -               then $(MAKE) -C $(VTPM_DIR) clean; \
> > -       fi
> > -
> > -.PHONY: mrproper
> > -mrproper:
> > -       rm -f $(TPM_EMULATOR_TARFILE) tpm_emulator.patch.old vtpm.patch.old
> > -       rm -rf $(TPM_EMULATOR_DIR) $(VTPM_DIR) $(ORIG_DIR)
> > -
> > -# Download Swiss emulator
> > -$(TPM_EMULATOR_TARFILE):
> > -       wget http://download.berlios.de/tpm-emulator/$(TPM_EMULATOR_TARFILE)
> > -
> > -# Create vtpm dirs
> > -$(VTPM_DIR)/tpmd/tpmd: $(TPM_EMULATOR_TARFILE) vtpm-0.5.1.patch
> > -       rm -rf $(VTPM_DIR)
> > -       tar -xzf $(TPM_EMULATOR_TARFILE)
> > -       mv $(TPM_EMULATOR_NAME) $(VTPM_DIR)
> > -
> > -       set -e; cd $(VTPM_DIR); \
> > -       patch -p1 < ../vtpm-0.5.1.patch; \
> > -       patch -p1 < ../vtpm-0.5.1-LDLIBS.patch
> > -
> > -orig: $(TPM_EMULATOR_TARFILE)
> > -       mkdir $(ORIG_DIR);
> > -       set -e; cd $(ORIG_DIR); \
> > -       tar -xzf ../$(TPM_EMULATOR_TARFILE);
> > -
> > -updatepatches: clean orig
> > -       find $(VTPM_DIR) -name "*.orig" -print | xargs rm -f;
> > -       mv vtpm.patch vtpm.patch.old;
> > -       diff -uprN $(TPM_EMULATOR_DIR) $(VTPM_DIR) > vtpm.patch || true;
> > -
> > -.PHONY: build_sub
> > -build_sub: $(VTPM_DIR)/tpmd/tpmd
> > -       set -e; if [ -e $(GMP_HEADER) ]; then \
> > -               $(MAKE) -C $(VTPM_DIR) version; \
> > -               $(MAKE) -C $(VTPM_DIR) all-recursive; \
> > -       else \
> > -               echo "=== Unable to build VTPMs. libgmp could not be found."; \
> > -       fi
> > -
> > diff --git a/tools/vtpm/README b/tools/vtpm/README
> > deleted file mode 100644
> > index 2008cbd..0000000
> > --- a/tools/vtpm/README
> > +++ /dev/null
> > @@ -1,45 +0,0 @@
> > -
> > -Directory Structure
> > -===================
> > -tools/vtpm/tpm_emulator-0.2b.tar.gz    -> TPM Emulator downloaded at build time that will
> > -                                          be patched and used for our vtpms
> > -tools/vtpm/vtpm.patch                  -> patch applied to tpm_emulator to make vtpm
> > -tools/vtpm/vtpm/                       -> (created on build) tpm_emulator moved to ring 3,
> > -                                          listens on a pair of fifos for TPM commands,
> > -                                          persistent state is sent via named fifo to vtpm
> > -                                            manager, which encrypts it and protects it.
> > -tools/vtpm/tpm_emulator.patch          -> To allow for debugging and testing on non-TPM
> > -                                          platforms, this patches the emulator to allow
> > -                                          it to be inserted into the dom0 kernel
> > -tools/vtpm/tpm_emulator-0.2            -> (created on build) directory containing patched emulator
> > -
> > -Compile Flags
> > -===================
> > -VTPM_MULTI_VM                -> Defined (not finished): VTPMs run in their own VMs
> > -                                Not Defined (default): VTPMs are processes
> > -
> > -Requirements
> > -============
> > -- xen-unstable
> > -- IBM frontend/backend vtpm driver patch
> > -- vtpm_managerd
> > -- GNU MP Big number library (GMP)
> > -
> > -vtpmd Flow (for vtpm_manager. vtpmd never run by default)
> > -============================
> > -- Launch the VTPM manager (vtpm_managerd) which which begins listening to the BE with one thread
> > -  and listens to a named fifo that is shared by the vtpms to commuincate with the manager.
> > -- VTPM Manager listens to TPM BE.
> > -- When xend launches a tpm frontend equipped VM it contacts the manager over the vtpm backend.
> > -- When the manager receives the open message from the BE, it launches a vtpm
> > -- Xend allows the VM to continue booting.
> > -- When a TPM request is issued to the front end, the front end transmits the TPM request to the backend.
> > -- The manager receives the TPM requests and uses a named fifo to forward the request to the vtpm.
> > -- The fifo listener begins listening for the reply from vtpm for the request.
> > -- Vtpm processes request and replies to manager over shared named fifo.
> > -- If needed, the vtpm may send a request to the vtpm_manager at any time to save it's secrets to disk.
> > -- Manager receives response from vtpm and passes it back to backend for forwarding to guest.
> > -
> > -tpm_emulator flow
> > -==================
> > -Read documentation in tpm_emulator-0.2 directory
> > diff --git a/tools/vtpm/Rules.mk b/tools/vtpm/Rules.mk
> > deleted file mode 100644
> > index 548cff0..0000000
> > --- a/tools/vtpm/Rules.mk
> > +++ /dev/null
> > @@ -1,26 +0,0 @@
> > -# Base definitions and rules (XEN_ROOT must be defined in including Makefile)
> > -include $(XEN_ROOT)/tools/Rules.mk
> > -
> > -#
> > -# Tool definitions
> > -#
> > -
> > -# General compiler flags
> > -CFLAGS   = -Werror -g3
> > -
> > -# Generic project files
> > -HDRS   = $(wildcard *.h)
> > -SRCS   = $(wildcard *.c)
> > -OBJS   = $(patsubst %.c,%.o,$(SRCS))
> > -
> > -# Generic (non-header) dependencies
> > -$(SRCS): Makefile $(XEN_ROOT)/tools/Rules.mk $(XEN_ROOT)/tools/vtpm/Rules.mk
> > -
> > -$(OBJS): $(SRCS)
> > -
> > --include $(DEPS)
> > -
> > -BUILD_EMULATOR = y
> > -
> > -# Make sure these are just rules
> > -.PHONY : all build install clean
> > diff --git a/tools/vtpm/tpm_emulator.patch b/tools/vtpm/tpm_emulator.patch
> > deleted file mode 100644
> > index c34c665..0000000
> > --- a/tools/vtpm/tpm_emulator.patch
> > +++ /dev/null
> > @@ -1,1919 +0,0 @@
> > -diff -uprN orig/tpm_emulator-0.4/AUTHORS tpm_emulator/AUTHORS
> > ---- orig/tpm_emulator-0.4/AUTHORS      2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/AUTHORS       2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,2 +1,3 @@
> > - Mario Strasser <mast@gmx.net>
> > - Heiko Stamer <stamer@gaos.org> [DAA]
> > -+INTEL Corp <> [Dropped to Ring3]
> > -diff -uprN orig/tpm_emulator-0.4/ChangeLog tpm_emulator/ChangeLog
> > ---- orig/tpm_emulator-0.4/ChangeLog    2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/ChangeLog     2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,3 +1,6 @@
> > -+????-??-?? Intel Corp
> > -+      * Moved module out of kernel to run as a ring 3 app
> > -+
> > - 2006-06-23  Mario Strasser <mast@gmx.net>
> > -       * tpm_startup.c: behaviour of ST_CLEAR and storage of
> > -               persistent data adapted
> > -diff -uprN orig/tpm_emulator-0.4/crypto/gmp_kernel_wrapper.c tpm_emulator/crypto/gmp_kernel_wrapper.c
> > ---- orig/tpm_emulator-0.4/crypto/gmp_kernel_wrapper.c  2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/crypto/gmp_kernel_wrapper.c   2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,5 +1,6 @@
> > - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> > -+ * Copyright (C) 2005 INTEL Corp
> > -  *
> > -  * This module is free software; you can redistribute it and/or modify
> > -  * it under the terms of the GNU General Public License as published
> > -@@ -24,15 +25,10 @@ int __gmp_junk;
> > - void __attribute__ ((regparm(0))) __gmp_assert_fail(const char *filename,
> > -   int linenum, const char *expr)
> > - {
> > --  panic(KERN_CRIT TPM_MODULE_NAME "%s:%d: GNU MP assertion failed: %s\n",
> > -+  error("%s:%d: GNU MP assertion failed: %s\n",
> > -     filename, linenum, expr);
> > - }
> > -
> > --void __attribute__ ((regparm(0))) abort(void)
> > --{
> > --  panic(KERN_CRIT TPM_MODULE_NAME "GNU MP abort() was called\n");
> > --}
> > --
> > - /* overwrite GNU MP random functions (used by mpz/millerrabin.c) */
> > -
> > - void __attribute__ ((regparm(0))) gmp_randinit(gmp_randstate_t rstate,
> > -@@ -77,20 +73,19 @@ void __attribute__ ((regparm(0))) mpz_ur
> > -
> > - void __attribute__ ((regparm(0))) *kernel_allocate(size_t size)
> > - {
> > --  void *ret  = (void*)kmalloc(size, GFP_KERNEL);
> > --  if (!ret) panic(KERN_CRIT TPM_MODULE_NAME
> > --    "GMP: cannot allocate memory (size=%u)\n", size);
> > -+  void *ret  = (void*)malloc(size);
> > -+  if (!ret) error("GMP: cannot allocate memory (size=%Zu)\n", size);
> > -   return ret;
> > - }
> > -
> > - void __attribute__ ((regparm(0))) *kernel_reallocate(void *oldptr,
> > -   size_t old_size, size_t new_size)
> > - {
> > --  void *ret = (void*)kmalloc(new_size, GFP_KERNEL);
> > --  if (!ret) panic(KERN_CRIT TPM_MODULE_NAME "GMP: Cannot reallocate memory "
> > --    "(old_size=%u new_size=%u)\n", old_size, new_size);
> > -+  void *ret = (void*)malloc(new_size);
> > -+  if (!ret) error("GMP: Cannot reallocate memory "
> > -+    "(old_size=%Zu new_size=%Zu)\n", old_size, new_size);
> > -   memcpy(ret, oldptr, old_size);
> > --  kfree(oldptr);
> > -+  free(oldptr);
> > -   return ret;
> > - }
> > -
> > -@@ -99,7 +94,7 @@ void __attribute__ ((regparm(0))) kernel
> > -   /* overwrite used memory */
> > -   if (blk_ptr != NULL) {
> > -     memset(blk_ptr, 0, blk_size);
> > --    kfree(blk_ptr);
> > -+    free(blk_ptr);
> > -   }
> > - }
> > -
> > -diff -uprN orig/tpm_emulator-0.4/crypto/rsa.c tpm_emulator/crypto/rsa.c
> > ---- orig/tpm_emulator-0.4/crypto/rsa.c 2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/crypto/rsa.c  2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,5 +1,6 @@
> > - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> > -+ * Copyright (C) 2005 INTEL Corp
> > -  *
> > -  * This module is free software; you can redistribute it and/or modify
> > -  * it under the terms of the GNU General Public License as published
> > -@@ -381,7 +382,7 @@ static int encode_message(int type, uint
> > -       msg[0] = 0x00;
> > -       get_random_bytes(&msg[1], SHA1_DIGEST_LENGTH);
> > -       sha1_init(&ctx);
> > --      sha1_update(&ctx, "TCPA", 4);
> > -+      sha1_update(&ctx, (uint8_t *) "TCPA", 4);
> > -       sha1_final(&ctx, &msg[1 + SHA1_DIGEST_LENGTH]);
> > -       memset(&msg[1 + 2 * SHA1_DIGEST_LENGTH], 0x00,
> > -         msg_len - data_len - 2 * SHA1_DIGEST_LENGTH - 2);
> > -@@ -429,7 +430,7 @@ static int decode_message(int type, uint
> > -       mask_generation(&msg[1], SHA1_DIGEST_LENGTH,
> > -         &msg[1 + SHA1_DIGEST_LENGTH], msg_len - SHA1_DIGEST_LENGTH - 1);
> > -       sha1_init(&ctx);
> > --      sha1_update(&ctx, "TCPA", 4);
> > -+      sha1_update(&ctx, (uint8_t *) "TCPA", 4);
> > -       sha1_final(&ctx, &msg[1]);
> > -       if (memcmp(&msg[1], &msg[1 + SHA1_DIGEST_LENGTH],
> > -           SHA1_DIGEST_LENGTH) != 0) return -1;
> > -diff -uprN orig/tpm_emulator-0.4/linux_module.c tpm_emulator/linux_module.c
> > ---- orig/tpm_emulator-0.4/linux_module.c       2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/linux_module.c        1969-12-31 16:00:00.000000000 -0800
> > -@@ -1,195 +0,0 @@
> > --/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -- * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> > -- *
> > -- * This module is free software; you can redistribute it and/or modify
> > -- * it under the terms of the GNU General Public License as published
> > -- * by the Free Software Foundation; either version 2 of the License,
> > -- * or (at your option) any later version.
> > -- *
> > -- * This module 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.
> > -- *
> > -- * $Id: linux_module.c 91 2006-03-13 13:51:41Z mast $
> > -- */
> > --
> > --#include <linux/module.h>
> > --#include <linux/kernel.h>
> > --#include <linux/init.h>
> > --#include <linux/miscdevice.h>
> > --#include <linux/poll.h>
> > --#include "linux_module.h"
> > --#include "tpm/tpm_emulator.h"
> > --
> > --MODULE_LICENSE("GPL");
> > --MODULE_AUTHOR("Mario Strasser <mast@gmx.net>");
> > --MODULE_DESCRIPTION("Trusted Platform Module (TPM) Emulator");
> > --MODULE_SUPPORTED_DEVICE(TPM_DEVICE_NAME);
> > --
> > --/* module startup parameters */
> > --char *startup = "save";
> > --module_param(startup, charp, 0444);
> > --MODULE_PARM_DESC(startup, " Sets the startup mode of the TPM. "
> > --  "Possible values are 'clear', 'save' (default) and 'deactivated.");
> > --char *storage_file = "/var/tpm/tpm_emulator-1.2.0.2";
> > --module_param(storage_file, charp, 0644);
> > --MODULE_PARM_DESC(storage_file, " Sets the persistent-data storage "
> > --  "file of the TPM.");
> > --
> > --/* TPM lock */
> > --static struct semaphore tpm_mutex;
> > --
> > --/* TPM command response */
> > --static struct {
> > --  uint8_t *data;
> > --  uint32_t size;
> > --} tpm_response;
> > --
> > --/* module state */
> > --#define STATE_IS_OPEN 0
> > --static uint32_t module_state;
> > --static struct timespec old_time;
> > --
> > --static int tpm_open(struct inode *inode, struct file *file)
> > --{
> > --  debug("%s()", __FUNCTION__);
> > --  if (test_and_set_bit(STATE_IS_OPEN, (void*)&module_state)) return -EBUSY;
> > --  return 0;
> > --}
> > --
> > --static int tpm_release(struct inode *inode, struct file *file)
> > --{
> > --  debug("%s()", __FUNCTION__);
> > --  clear_bit(STATE_IS_OPEN, (void*)&module_state);
> > --  down(&tpm_mutex);
> > --  if (tpm_response.data != NULL) {
> > --    kfree(tpm_response.data);
> > --    tpm_response.data = NULL;
> > --  }
> > --  up(&tpm_mutex);
> > --  return 0;
> > --}
> > --
> > --static ssize_t tpm_read(struct file *file, char *buf, size_t count, loff_t *ppos)
> > --{
> > --  debug("%s(%d)", __FUNCTION__, count);
> > --  down(&tpm_mutex);
> > --  if (tpm_response.data != NULL) {
> > --    count = min(count, (size_t)tpm_response.size - (size_t)*ppos);
> > --    count -= copy_to_user(buf, &tpm_response.data[*ppos], count);
> > --    *ppos += count;
> > --    if ((size_t)tpm_response.size == (size_t)*ppos) {
> > --      kfree(tpm_response.data);
> > --      tpm_response.data = NULL;
> > --    }
> > --  } else {
> > --    count = 0;
> > --  }
> > --  up(&tpm_mutex);
> > --  return count;
> > --}
> > --
> > --static ssize_t tpm_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
> > --{
> > --  debug("%s(%d)", __FUNCTION__, count);
> > --  down(&tpm_mutex);
> > --  *ppos = 0;
> > --  if (tpm_response.data != NULL) kfree(tpm_response.data);
> > --  if (tpm_handle_command(buf, count, &tpm_response.data,
> > --                         &tpm_response.size) != 0) {
> > --    count = -EILSEQ;
> > --    tpm_response.data = NULL;
> > --  }
> > --  up(&tpm_mutex);
> > --  return count;
> > --}
> > --
> > --#define TPMIOC_CANCEL   _IO('T', 0x00)
> > --#define TPMIOC_TRANSMIT _IO('T', 0x01)
> > --
> > --static int tpm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
> > --{
> > --  debug("%s(%d, %p)", __FUNCTION__, cmd, (char*)arg);
> > --  if (cmd == TPMIOC_TRANSMIT) {
> > --    uint32_t count = ntohl(*(uint32_t*)(arg + 2));
> > --    down(&tpm_mutex);
> > --    if (tpm_response.data != NULL) kfree(tpm_response.data);
> > --    if (tpm_handle_command((char*)arg, count, &tpm_response.data,
> > --                           &tpm_response.size) == 0) {
> > --      tpm_response.size -= copy_to_user((char*)arg, tpm_response.data,
> > --                            tpm_response.size);
> > --      kfree(tpm_response.data);
> > --      tpm_response.data = NULL;
> > --    } else {
> > --      tpm_response.size = 0;
> > --      tpm_response.data = NULL;
> > --    }
> > --    up(&tpm_mutex);
> > --    return tpm_response.size;
> > --  }
> > --  return -1;
> > --}
> > --
> > --struct file_operations fops = {
> > --  .owner   = THIS_MODULE,
> > --  .open    = tpm_open,
> > --  .release = tpm_release,
> > --  .read    = tpm_read,
> > --  .write   = tpm_write,
> > --  .ioctl   = tpm_ioctl,
> > --};
> > --
> > --static struct miscdevice tpm_dev = {
> > --  .minor      = TPM_DEVICE_MINOR,
> > --  .name       = TPM_DEVICE_NAME,
> > --  .fops       = &fops,
> > --};
> > --
> > --int __init init_tpm_module(void)
> > --{
> > --  int res = misc_register(&tpm_dev);
> > --  if (res != 0) {
> > --    error("misc_register() failed for minor %d\n", TPM_DEVICE_MINOR);
> > --    return res;
> > --  }
> > --  /* initialize variables */
> > --  sema_init(&tpm_mutex, 1);
> > --  module_state = 0;
> > --  tpm_response.data = NULL;
> > --  old_time = current_kernel_time();
> > --  /* initialize TPM emulator */
> > --  if (!strcmp(startup, "clear")) {
> > --    tpm_emulator_init(1);
> > --  } else if (!strcmp(startup, "save")) {
> > --    tpm_emulator_init(2);
> > --  } else if (!strcmp(startup, "deactivated")) {
> > --    tpm_emulator_init(3);
> > --  } else {
> > --    error("invalid startup mode '%s'; must be 'clear', "
> > --      "'save' (default) or 'deactivated", startup);
> > --    misc_deregister(&tpm_dev);
> > --    return -EINVAL;
> > --  }
> > --  return 0;
> > --}
> > --
> > --void __exit cleanup_tpm_module(void)
> > --{
> > --  tpm_emulator_shutdown();
> > --  misc_deregister(&tpm_dev);
> > --  if (tpm_response.data != NULL) kfree(tpm_response.data);
> > --}
> > --
> > --module_init(init_tpm_module);
> > --module_exit(cleanup_tpm_module);
> > --
> > --uint64_t tpm_get_ticks(void)
> > --{
> > --  struct timespec new_time = current_kernel_time();
> > --  uint64_t ticks = (uint64_t)(new_time.tv_sec - old_time.tv_sec) * 1000000
> > --                   + (new_time.tv_nsec - old_time.tv_nsec) / 1000;
> > --  old_time = new_time;
> > --  return (ticks > 0) ? ticks : 1;
> > --}
> > --
> > -diff -uprN orig/tpm_emulator-0.4/linux_module.h tpm_emulator/linux_module.h
> > ---- orig/tpm_emulator-0.4/linux_module.h       2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/linux_module.h        2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,5 +1,6 @@
> > - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> > -+ * Copyright (C) 2005 INTEL Corp
> > -  *
> > -  * This module is free software; you can redistribute it and/or modify
> > -  * it under the terms of the GNU General Public License as published
> > -@@ -17,54 +18,62 @@
> > - #ifndef _LINUX_MODULE_H_
> > - #define _LINUX_MODULE_H_
> > -
> > --#include <linux/version.h>
> > --#include <linux/kernel.h>
> > --#include <linux/slab.h>
> > -+#include <malloc.h>
> > -+#include <stdint.h>
> > -+#include <stdio.h>
> > -+#include <string.h>
> > - #include <linux/types.h>
> > --#include <linux/string.h>
> > --#include <linux/random.h>
> > --#include <linux/time.h>
> > --#include <asm/byteorder.h>
> > -
> > --/* module settings */
> > -+#include <endian.h>
> > -+#define __BYTEORDER_HAS_U64__
> > -+#ifdef LITTLE_ENDIAN
> > -+ #include <linux/byteorder/little_endian.h>
> > -+#else
> > -+ #include <linux/byteorder/big_endian.h>
> > -+#endif
> > -
> > -+/* module settings */
> > -+#define min(A,B) ((A)<(B)?(A):(B))
> > -+#ifndef STR
> > - #define STR(s) __STR__(s)
> > - #define __STR__(s) #s
> > -+#endif
> > - #include "tpm_version.h"
> > -
> > - #define TPM_DEVICE_MINOR  224
> > - #define TPM_DEVICE_NAME   "tpm"
> > - #define TPM_MODULE_NAME   "tpm_emulator"
> > -
> > --/* debug and log output functions */
> > --
> > - #ifdef DEBUG
> > --#define debug(fmt, ...) printk(KERN_DEBUG "%s %s:%d: Debug: " fmt "\n", \
> > --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define debug(fmt, ...) printf("TPMD: %s:%d: Debug: " fmt "\n", \
> > -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> > - #else
> > - #define debug(fmt, ...)
> > - #endif
> > --#define info(fmt, ...)  printk(KERN_INFO "%s %s:%d: Info: " fmt "\n", \
> > --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> > --#define error(fmt, ...) printk(KERN_ERR "%s %s:%d: Error: " fmt "\n", \
> > --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> > --#define alert(fmt, ...) printk(KERN_ALERT "%s %s:%d: Alert: " fmt "\n", \
> > --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define info(fmt, ...)  printf("TPMD: %s:%d: Info: " fmt "\n", \
> > -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define error(fmt, ...) printf("TPMD: %s:%d: Error: " fmt "\n", \
> > -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define alert(fmt, ...) printf("TPMD: %s:%d: Alert: " fmt "\n", \
> > -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> > -
> > - /* memory allocation */
> > -
> > - static inline void *tpm_malloc(size_t size)
> > - {
> > --  return kmalloc(size, GFP_KERNEL);
> > -+  return malloc(size);
> > - }
> > -
> > - static inline void tpm_free(const void *ptr)
> > - {
> > --  if (ptr != NULL) kfree(ptr);
> > -+  if (ptr != NULL) free( (void *) ptr);
> > - }
> > -
> > - /* random numbers */
> > -
> > -+//FIXME;
> > -+void get_random_bytes(void *buf, int nbytes);
> > -+
> > - static inline void tpm_get_random_bytes(void *buf, int nbytes)
> > - {
> > -   get_random_bytes(buf, nbytes);
> > -@@ -84,9 +93,9 @@ uint64_t tpm_get_ticks(void);
> > - #define CPU_TO_LE16(x) __cpu_to_le16(x)
> > -
> > - #define BE64_TO_CPU(x) __be64_to_cpu(x)
> > --#define LE64_TO_CPU(x) __be64_to_cpu(x)
> > -+#define LE64_TO_CPU(x) __le64_to_cpu(x)
> > - #define BE32_TO_CPU(x) __be32_to_cpu(x)
> > --#define LE32_TO_CPU(x) __be32_to_cpu(x)
> > -+#define LE32_TO_CPU(x) __le32_to_cpu(x)
> > - #define BE16_TO_CPU(x) __be16_to_cpu(x)
> > - #define LE16_TO_CPU(x) __le16_to_cpu(x)
> > -
> > -diff -uprN orig/tpm_emulator-0.4/Makefile tpm_emulator/Makefile
> > ---- orig/tpm_emulator-0.4/Makefile     2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/Makefile      2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,24 +1,40 @@
> > - # Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > - # Copyright (C) 2004 Mario Strasser <mast@gmx.net>
> > -+# Copyright (C) 2006 INTEL Corp.
> > - #
> > - # $Id: Makefile 115 2006-06-23 10:36:44Z mast $
> > -
> > --# kernel settings
> > --KERNEL_RELEASE := $(shell uname -r)
> > --KERNEL_BUILD   := /lib/modules/$(KERNEL_RELEASE)/build
> > --MOD_SUBDIR     := misc
> > -+COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
> > -
> > - # module settings
> > --MODULE_NAME    := tpm_emulator
> > -+BIN            := tpm_emulator
> > - VERSION_MAJOR  := 0
> > - VERSION_MINOR  := 4
> > - VERSION_BUILD  := $(shell date +"%s")
> > -
> > --# enable/disable DEBUG messages
> > --EXTRA_CFLAGS   += -Wall -DDEBUG -g
> > -+# Installation program and options
> > -+INSTALL         = install
> > -+INSTALL_PROG    = $(INSTALL) -m0755
> > -+INSTALL_DIR     = $(INSTALL) -d -m0755
> > -+
> > -+# Xen tools installation directory
> > -+TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin
> > -+
> > -+CC      := gcc
> > -+CFLAGS  += -g -Wall $(INCLUDE) -DDEBUG
> > -+CFLAGS  += -I. -Itpm
> > -+
> > -+# Is the simulator running in it's own vm?
> > -+#CFLAGS += -DVTPM_MULTI_VM
> > -+
> > -+ifeq ($(COMPILE_ARCH),x86_64)
> > -+LIBDIR = lib64
> > -+else
> > -+LIBDIR = lib
> > -+endif
> > -
> > - # GNU MP configuration
> > --GMP_LIB        := /usr/lib/libgmp.a
> > -+GMP_LIB        := /usr/$(LIBDIR)/libgmp.a
> > - GMP_HEADER     := /usr/include/gmp.h
> > -
> > - # sources and objects
> > -@@ -27,38 +43,32 @@ DIRS           := . crypto tpm
> > - SRCS           := $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.c))
> > - OBJS           := $(patsubst %.c, %.o, $(SRCS))
> > - SRCS           += $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.h))
> > --DISTSRC        := ./README ./AUTHORS ./ChangeLog ./Makefile $(SRCS)
> > --DISTDIR        := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)
> > -
> > --obj-m               := $(MODULE_NAME).o
> > --$(MODULE_NAME)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
> > -+obj-m               := $(BIN)
> > -+$(BIN)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
> > -
> > - EXTRA_CFLAGS   += -I$(src) -I$(src)/crypto -I$(src)/tpm
> > -
> > - # do not print "Entering directory ..."
> > - MAKEFLAGS      += --no-print-directory
> > -
> > --all:  $(src)/crypto/gmp.h $(src)/crypto/libgmp.a version
> > --      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules
> > -+all: $(BIN)
> > -
> > --install:
> > --      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules_install
> > --      test -d /var/tpm || mkdir /var/tpm
> > --      test -c /dev/tpm || mknod /dev/tpm c 10 224
> > --      chmod 666 /dev/tpm
> > --      depmod -a
> > -+$(BIN):       $(src)/crypto/gmp.h $(src)/crypto/libgmp.a version $(SRCS) $(OBJS)
> > -+      $(CC) $(CFLAGS) $(OBJS) $(src)/crypto/libgmp.a -o $(BIN)
> > -+
> > -+%.o: %.c
> > -+      $(CC) $(CFLAGS) -c $< -o $@
> > -+
> > -+install: $(BIN)
> > -+      $(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)
> > -+      @if [ ! -d "/var/tpm" ]; then mkdir /var/tpm; fi
> > -
> > - clean:
> > --      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) clean
> > --      rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a
> > -+      rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a $(OBJS)
> > -
> > --dist: $(DISTSRC)
> > --      rm -rf $(DISTDIR)
> > --      mkdir $(DISTDIR)
> > --      cp --parents $(DISTSRC) $(DISTDIR)/
> > --      rm -f $(DISTDIR)/crypto/gmp.h
> > --      tar -chzf $(DISTDIR).tar.gz $(DISTDIR)
> > --      rm -rf $(DISTDIR)
> > -+mrproper: clean
> > -+      rm -f $(BIN) tpm_version.h
> > -
> > - $(src)/crypto/libgmp.a:
> > -       test -f $(src)/crypto/libgmp.a || ln -s $(GMP_LIB) $(src)/crypto/libgmp.a
> > -@@ -88,4 +98,3 @@ version:
> > -       @echo "#endif /* _TPM_VERSION_H_ */" >> $(src)/tpm_version.h
> > -
> > - .PHONY: all install clean dist gmp version
> > --
> > -diff -uprN orig/tpm_emulator-0.4/README tpm_emulator/README
> > ---- orig/tpm_emulator-0.4/README       2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/README        2006-07-24 14:35:35.000000000 -0700
> > -@@ -13,7 +13,8 @@ $Id: README 113 2006-06-18 12:38:13Z hst
> > - Copyright
> > - --------------------------------------------------------------------------
> > - Copyright (C) 2004 Mario Strasser <mast@gmx.net> and Swiss Federal
> > --Institute of Technology (ETH) Zurich.
> > -+                   Institute of Technology (ETH) Zurich.
> > -+Copyright (C) 2005 INTEL Corp
> > -
> > - This program is free software; you can redistribute it and/or modify
> > - it under the terms of the GNU General Public License as published by
> > -@@ -43,6 +44,12 @@ Example:
> > - GMP_LIB        := /usr/lib/libgmp.a
> > - GMP_HEADER     := /usr/include/gmp.h
> > -
> > -+GNU MP Library on 64 bit Systems
> > -+--------------------------------------------------------------------------
> > -+Some 64-bit kernels have problems with importing the user-space gmp
> > -+library (/usr/lib*/libgmp.a) into kernel space.  These kernels will require
> > -+that the gmp library be recompiled for kernel space with -mcmodel=kernel.
> > -+
> > - Installation
> > - --------------------------------------------------------------------------
> > - The compilation and installation process uses the build environment for
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_capability.c tpm_emulator/tpm/tpm_capability.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_capability.c 2006-06-23 19:37:07.000000000 +0900
> > -+++ tpm_emulator/tpm/tpm_capability.c  2007-12-28 22:50:19.000000000 +0900
> > -@@ -701,7 +701,10 @@ TPM_RESULT TPM_GetCapabilityOwner(TPM_VE
> > -   TPM_RESULT res;
> > -
> > -   info("TPM_GetCapabilityOwner()");
> > --
> > -+
> > -+  if (!tpmData.permanent.flags.owned) {
> > -+    return TPM_NOSRK;
> > -+  }
> > -   /* Verify owner authorization */
> > -   res = tpm_verify_auth(auth1, tpmData.permanent.data.ownerAuth, TPM_KH_OWNER);
> > -   if (res != TPM_SUCCESS) return res;
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c tpm_emulator/tpm/tpm_cmd_handler.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c        2006-06-23 19:37:07.000000000 +0900
> > -+++ tpm_emulator/tpm/tpm_cmd_handler.c 2007-09-12 20:23:00.000000000 +0900
> > -@@ -565,7 +565,7 @@ static TPM_RESULT execute_TPM_Seal(TPM_R
> > -   if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle)
> > -       || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth)
> > -       || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize)
> > --      || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)
> > -+      || (pcrInfoSize >0 && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo))
> > -       || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize)
> > -       || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize)
> > -       || len != 0) return TPM_BAD_PARAMETER;
> > -@@ -798,7 +798,7 @@ static TPM_RESULT execute_TPM_Sealx(TPM_
> > -   if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle)
> > -       || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth)
> > -       || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize)
> > --      || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)
> > -+      || (pcrInfoSize > 0 && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo))
> > -       || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize)
> > -       || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize)
> > -       || len != 0) return TPM_BAD_PARAMETER;
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_credentials.c tpm_emulator/tpm/tpm_credentials.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_credentials.c        2006-06-23 19:37:07.000000000 +0900
> > -+++ tpm_emulator/tpm/tpm_credentials.c 2007-09-12 20:23:30.000000000 +0900
> > -@@ -47,20 +47,20 @@ int tpm_compute_pubkey_checksum(TPM_NONC
> > -
> > - TPM_RESULT tpm_get_pubek(TPM_PUBKEY *pubEndorsementKey)
> > - {
> > --  UINT32 key_length;
> > -+  size_t key_length;
> > -   if (!tpmData.permanent.data.endorsementKey.size) return TPM_NO_ENDORSEMENT;
> > -   /* setup TPM_PUBKEY structure */
> > --  key_length = tpmData.permanent.data.endorsementKey.size;
> > --  pubEndorsementKey->pubKey.keyLength = key_length >> 3;
> > -+  pubEndorsementKey->pubKey.keyLength = tpmData.permanent.data.endorsementKey.size >> 3;
> > -   pubEndorsementKey->pubKey.key = tpm_malloc(pubEndorsementKey->pubKey.keyLength);
> > -   if (pubEndorsementKey->pubKey.key == NULL) return TPM_FAIL;
> > -   rsa_export_modulus(&tpmData.permanent.data.endorsementKey,
> > --    pubEndorsementKey->pubKey.key,
> > --    &pubEndorsementKey->pubKey.keyLength);
> > -+                   pubEndorsementKey->pubKey.key,
> > -+                   &key_length);
> > -+  pubEndorsementKey->pubKey.keyLength = key_length;
> > -   pubEndorsementKey->algorithmParms.algorithmID = TPM_ALG_RSA;
> > -   pubEndorsementKey->algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
> > -   pubEndorsementKey->algorithmParms.sigScheme = TPM_SS_NONE;
> > --  pubEndorsementKey->algorithmParms.parms.rsa.keyLength = key_length;
> > -+  pubEndorsementKey->algorithmParms.parms.rsa.keyLength = key_length << 3;
> > -   pubEndorsementKey->algorithmParms.parms.rsa.numPrimes = 2;
> > -   pubEndorsementKey->algorithmParms.parms.rsa.exponentSize = 0;
> > -   pubEndorsementKey->algorithmParms.parms.rsa.exponent = NULL;
> > -@@ -175,6 +175,7 @@ TPM_RESULT TPM_OwnerReadInternalPub(TPM_
> > - {
> > -   TPM_RESULT res;
> > -   TPM_KEY_DATA *srk = &tpmData.permanent.data.srk;
> > -+  size_t key_length;
> > -   info("TPM_OwnerReadInternalPub()");
> > -   /* verify authorization */
> > -   res = tpm_verify_auth(auth1, tpmData.permanent.data.ownerAuth, TPM_KH_OWNER);
> > -@@ -186,7 +187,8 @@ TPM_RESULT TPM_OwnerReadInternalPub(TPM_
> > -     publicPortion->pubKey.key = tpm_malloc(publicPortion->pubKey.keyLength);
> > -     if (publicPortion->pubKey.key == NULL) return TPM_FAIL;
> > -     rsa_export_modulus(&srk->key, publicPortion->pubKey.key,
> > --      &publicPortion->pubKey.keyLength);
> > -+      &key_length);
> > -+    publicPortion->pubKey.keyLength = key_length;
> > -     publicPortion->algorithmParms.algorithmID = TPM_ALG_RSA;
> > -     publicPortion->algorithmParms.encScheme = srk->encScheme;
> > -     publicPortion->algorithmParms.sigScheme = srk->sigScheme;
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_crypto.c tpm_emulator/tpm/tpm_crypto.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_crypto.c     2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_crypto.c      2006-07-24 14:35:35.000000000 -0700
> > -@@ -182,7 +182,8 @@ TPM_RESULT TPM_CertifyKey(TPM_KEY_HANDLE
> > -   TPM_KEY_DATA *cert, *key;
> > -   sha1_ctx_t sha1_ctx;
> > -   BYTE *buf, *p;
> > --  UINT32 length;
> > -+  UINT32 length32;
> > -+  size_t length;
> > -   info("TPM_CertifyKey()");
> > -   /* get keys */
> > -   cert = tpm_get_key(certHandle);
> > -@@ -264,14 +265,15 @@ TPM_RESULT TPM_CertifyKey(TPM_KEY_HANDLE
> > -   /* compute the digest of the CERTIFY_INFO[2] structure and sign it */
> > -   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
> > -   p = buf = tpm_malloc(length);
> > -+  length32=(UINT32) length;
> > -   if (buf == NULL
> > --      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length, certifyInfo)) {
> > -+      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length32, certifyInfo)) {
> > -     free_TPM_KEY_PARMS(certifyInfo->algorithmParms);
> > -     return TPM_FAIL;
> > -   }
> > -   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
> > -   sha1_init(&sha1_ctx);
> > --  sha1_update(&sha1_ctx, buf, length);
> > -+  sha1_update(&sha1_ctx, buf, (size_t) length);
> > -   sha1_final(&sha1_ctx, buf);
> > -   res = tpm_sign(cert, auth1, FALSE, buf, SHA1_DIGEST_LENGTH, outData, outDataSize);
> > -   tpm_free(buf);
> > -@@ -292,7 +294,8 @@ TPM_RESULT TPM_CertifyKey2(TPM_KEY_HANDL
> > -   TPM_KEY_DATA *cert, *key;
> > -   sha1_ctx_t sha1_ctx;
> > -   BYTE *buf, *p;
> > --  UINT32 length;
> > -+  size_t length;
> > -+  UINT32 length32;
> > -   info("TPM_CertifyKey2()");
> > -   /* get keys */
> > -   cert = tpm_get_key(certHandle);
> > -@@ -362,8 +365,9 @@ TPM_RESULT TPM_CertifyKey2(TPM_KEY_HANDL
> > -   /* compute the digest of the CERTIFY_INFO[2] structure and sign it */
> > -   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
> > -   p = buf = tpm_malloc(length);
> > -+  length32 = (UINT32) length;
> > -   if (buf == NULL
> > --      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length, certifyInfo)) {
> > -+      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length32, certifyInfo)) {
> > -     free_TPM_KEY_PARMS(certifyInfo->algorithmParms);
> > -     return TPM_FAIL;
> > -   }
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_daa.c tpm_emulator/tpm/tpm_daa.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_daa.c        2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_daa.c 2006-07-24 14:35:35.000000000 -0700
> > -@@ -716,14 +716,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x00", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> > -       sha1_final(&sha1, scratch);
> > -       sha1_init(&sha1);
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x01", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> > -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> > -       mpz_init(f), mpz_init(q);
> > -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> > -@@ -805,14 +805,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x00", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> > -       sha1_final(&sha1, scratch);
> > -       sha1_init(&sha1);
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x01", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> > -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> > -       mpz_init(f), mpz_init(q);
> > -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> > -@@ -1489,14 +1489,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x00", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> > -       sha1_final(&sha1, scratch);
> > -       sha1_init(&sha1);
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x01", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> > -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> > -       mpz_init(f), mpz_init(q);
> > -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> > -@@ -1712,14 +1712,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x00", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> > -       sha1_final(&sha1, scratch);
> > -       sha1_init(&sha1);
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x01", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> > -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> > -       mpz_init(f), mpz_init(q);
> > -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> > -@@ -1793,14 +1793,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x00", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> > -       sha1_final(&sha1, scratch);
> > -       sha1_init(&sha1);
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x01", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> > -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> > -       mpz_init(f), mpz_init(q);
> > -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> > -@@ -2918,14 +2918,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x00", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> > -       sha1_final(&sha1, scratch);
> > -       sha1_init(&sha1);
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x01", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> > -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> > -       mpz_init(f), mpz_init(q);
> > -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> > -@@ -3143,7 +3143,7 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> > -         sha1_init(&sha1);
> > -         sha1_update(&sha1, (BYTE*) &session->DAA_session.DAA_digest,
> > -           sizeof(session->DAA_session.DAA_digest));
> > --        sha1_update(&sha1, "\x01", 1);
> > -+        sha1_update(&sha1, (BYTE *) "\x01", 1);
> > -         sha1_update(&sha1, inputData1, inputSize1);
> > -         sha1_final(&sha1, (BYTE*) &session->DAA_session.DAA_digest);
> > -       }
> > -@@ -3172,7 +3172,7 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> > -         sha1_init(&sha1);
> > -         sha1_update(&sha1, (BYTE*) &session->DAA_session.DAA_digest,
> > -           sizeof(session->DAA_session.DAA_digest));
> > --        sha1_update(&sha1, "\x00", 1);
> > -+        sha1_update(&sha1, (BYTE*) "\x00", 1);
> > -         rsa_export_modulus(&aikData->key, scratch, &size);
> > -         sha1_update(&sha1, scratch, size);
> > -         sha1_final(&sha1, (BYTE*) &session->DAA_session.DAA_digest);
> > -@@ -3229,14 +3229,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x00", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> > -       sha1_final(&sha1, scratch);
> > -       sha1_init(&sha1);
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x01", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> > -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> > -       mpz_init(f), mpz_init(q);
> > -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> > -@@ -3309,14 +3309,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x00", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> > -       sha1_final(&sha1, scratch);
> > -       sha1_init(&sha1);
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x01", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> > -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> > -       mpz_init(f), mpz_init(q);
> > -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_data.c tpm_emulator/tpm/tpm_data.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_data.c       2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_data.c        2006-07-24 14:35:35.000000000 -0700
> > -@@ -40,6 +40,7 @@ static inline void init_pcr_attr(int pcr
> > - void tpm_init_data(void)
> > - {
> > -   /* endorsement key */
> > -+#ifndef TPM_GENERATE_EK
> > -   uint8_t ek_n[] =  "\xa8\xdb\xa9\x42\xa8\xf3\xb8\x06\x85\x90\x76\x93\xad\xf7"
> > -     "\x74\xec\x3f\xd3\x3d\x9d\xe8\x2e\xff\x15\xed\x0e\xce\x5f\x93"
> > -     "\x92\xeb\xd1\x96\x2b\x72\x18\x81\x79\x12\x9d\x9c\x40\xd7\x1a"
> > -@@ -77,6 +78,8 @@ void tpm_init_data(void)
> > -     "\xd1\xc0\x8b\x5b\xa2\x2e\xa7\x15\xca\x50\x75\x10\x48\x9c\x2b"
> > -     "\x18\xb9\x67\x8f\x5d\x64\xc3\x28\x9f\x2f\x16\x2f\x08\xda\x47"
> > -     "\xec\x86\x43\x0c\x80\x99\x07\x34\x0f";
> > -+#endif
> > -+
> > -   int i;
> > -   /* reset all data to NULL, FALSE or 0 */
> > -   memset(&tpmData, 0, sizeof(tpmData));
> > -@@ -152,44 +155,43 @@ void tpm_release_data(void)
> > -
> > - #ifdef TPM_STORE_TO_FILE
> > -
> > --#include <linux/fs.h>
> > --#include <linux/unistd.h>
> > --#include <asm/uaccess.h>
> > -+#include <sys/types.h>
> > -+#include <sys/stat.h>
> > -+#include <fcntl.h>
> > -+#include <unistd.h>
> > -
> > - #define TPM_STORAGE_FILE "/var/tpm/tpm_emulator-1.2." STR(VERSION_MAJOR) "." STR(VERSION_MINOR)
> > -
> > - static int write_to_file(uint8_t *data, size_t data_length)
> > - {
> > -   int res;
> > --  struct file *fp;
> > --  mm_segment_t old_fs = get_fs();
> > --  fp = filp_open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> > --  if (IS_ERR(fp)) return -1;
> > --  set_fs(get_ds());
> > --  res = fp->f_op->write(fp, data, data_length, &fp->f_pos);
> > --  set_fs(old_fs);
> > --  filp_close(fp, NULL);
> > -+  int fp;
> > -+  fp = open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> > -+  res = write(fp, data, data_length);
> > -+  close(fp);
> > -   return (res == data_length) ? 0 : -1;
> > - }
> > -
> > - static int read_from_file(uint8_t **data, size_t *data_length)
> > - {
> > -   int res;
> > --  struct file *fp;
> > --  mm_segment_t old_fs = get_fs();
> > --  fp = filp_open(TPM_STORAGE_FILE, O_RDONLY, 0);
> > --  if (IS_ERR(fp)) return -1;
> > --  *data_length = (size_t)fp->f_dentry->d_inode->i_size;
> > --  /* *data_length = i_size_read(fp->f_dentry->d_inode); */
> > -+  int fp, file_status;
> > -+  struct stat file_info;
> > -+  fp = open(TPM_STORAGE_FILE, O_RDONLY, 0);
> > -+  file_status = fstat(fp, &file_info);
> > -+  if (file_status < 0) {
> > -+    close(fp);
> > -+    return -1;
> > -+  }
> > -+
> > -+  *data_length = file_info.st_size;
> > -   *data = tpm_malloc(*data_length);
> > -   if (*data == NULL) {
> > --    filp_close(fp, NULL);
> > -+    close(fp);
> > -     return -1;
> > -   }
> > --  set_fs(get_ds());
> > --  res = fp->f_op->read(fp, *data, *data_length, &fp->f_pos);
> > --  set_fs(old_fs);
> > --  filp_close(fp, NULL);
> > -+  res = read(fp, *data, *data_length);
> > -+  close(fp);
> > -   if (res != *data_length) {
> > -     tpm_free(*data);
> > -     return -1;
> > -@@ -216,23 +218,30 @@ static int read_from_file(uint8_t **data
> > - int tpm_store_permanent_data(void)
> > - {
> > -   uint8_t *buf, *ptr;
> > --  size_t buf_length, len;
> > -+  UINT32 buf_length, len;
> > -
> > -   /* marshal data */
> > --  buf_length = len = sizeof_TPM_STCLEAR_FLAGS(tpmData.stclear.flags)
> > --    + sizeof_TPM_PERMANENT_FLAGS(tpmData.permanent.flags) + 2
> > --    + sizeof_TPM_PERMANENT_DATA(tpmData.permanent.data);
> > -+  buf_length = len = 4 + sizeof_TPM_STCLEAR_FLAGS(tpmData.stclear.flags)
> > -+    + sizeof_TPM_PERMANENT_FLAGS(tpmData.permanent.flags)
> > -+    + sizeof_TPM_STANY_FLAGS(tpmData.stany.flags) + 2
> > -+    + sizeof_TPM_STCLEAR_DATA(tpmData.stclear.data)
> > -+    + sizeof_TPM_PERMANENT_DATA(tpmData.permanent.data)
> > -+    + sizeof_TPM_STANY_DATA(tpmData.stany.data);
> > -   buf = ptr = tpm_malloc(buf_length);
> > -   if (buf == NULL
> > -       || tpm_marshal_TPM_VERSION(&ptr, &len, &tpmData.permanent.data.version)
> > -       || tpm_marshal_TPM_STCLEAR_FLAGS(&ptr, &len, &tpmData.stclear.flags)
> > -       || tpm_marshal_TPM_PERMANENT_FLAGS(&ptr, &len, &tpmData.permanent.flags)
> > -+      || tpm_marshal_TPM_STANY_FLAGS(&ptr, &len, &tpmData.stany.flags)
> > -       || tpm_marshal_BOOL(&ptr, &len, tpmData.permanent.flags.selfTestSucceeded)
> > -       || tpm_marshal_BOOL(&ptr, &len, tpmData.permanent.flags.owned)
> > --      || tpm_marshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)) {
> > -+      || tpm_marshal_TPM_STCLEAR_DATA(&ptr, &len, &tpmData.stclear.data)
> > -+      || tpm_marshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)
> > -+      || tpm_marshal_TPM_STANY_DATA(&ptr, &len, &tpmData.stany.data)) {
> > -     tpm_free(buf);
> > -     return -1;
> > -   }
> > -+
> > -   if (write_to_file(buf, buf_length - len)) {
> > -     tpm_free(buf);
> > -     return -1;
> > -@@ -244,31 +253,36 @@ int tpm_store_permanent_data(void)
> > - int tpm_restore_permanent_data(void)
> > - {
> > -   uint8_t *buf, *ptr;
> > --  size_t buf_length, len;
> > -+  size_t buf_length;
> > -+  UINT32 len;
> > -   TPM_VERSION ver;
> > -
> > -   /* read data */
> > -   if (read_from_file(&buf, &buf_length)) return -1;
> > -   ptr = buf;
> > --  len = buf_length;
> > -+  len = (uint32_t) buf_length;
> > -   /* unmarshal data */
> > -   if (tpm_unmarshal_TPM_VERSION(&ptr, &len, &ver)
> > -       || memcmp(&ver, &tpmData.permanent.data.version, sizeof(TPM_VERSION))
> > -       || tpm_unmarshal_TPM_STCLEAR_FLAGS(&ptr, &len, &tpmData.stclear.flags)
> > -       || tpm_unmarshal_TPM_PERMANENT_FLAGS(&ptr, &len, &tpmData.permanent.flags)
> > -+      || tpm_unmarshal_TPM_STANY_FLAGS(&ptr, &len, &tpmData.stany.flags)
> > -       || tpm_unmarshal_BOOL(&ptr, &len, &tpmData.permanent.flags.selfTestSucceeded)
> > -       || tpm_unmarshal_BOOL(&ptr, &len, &tpmData.permanent.flags.owned)
> > --      || tpm_unmarshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)) {
> > -+      || tpm_unmarshal_TPM_STCLEAR_DATA(&ptr, &len, &tpmData.stclear.data)
> > -+      || tpm_unmarshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)
> > -+      || tpm_unmarshal_TPM_STANY_DATA(&ptr, &len, &tpmData.stany.data)) {
> > -     tpm_free(buf);
> > -     return -1;
> > -   }
> > -+
> > -   tpm_free(buf);
> > -   return 0;
> > - }
> > -
> > - int tpm_erase_permanent_data(void)
> > - {
> > --  int res = write_to_file("", 0);
> > -+  int res = write_to_file((uint8_t *) "", 0);
> > -   return res;
> > - }
> > -
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_deprecated.c tpm_emulator/tpm/tpm_deprecated.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_deprecated.c 2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_deprecated.c  2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,6 +1,7 @@
> > - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> > -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> > -+ * Copyright (C) 2005 INTEL Corp
> > -  *
> > -  * This module is free software; you can redistribute it and/or modify
> > -  * it under the terms of the GNU General Public License as published
> > -@@ -50,7 +51,7 @@ TPM_RESULT TPM_SaveKeyContext(TPM_KEY_HA
> > -   BYTE *ptr;
> > -   UINT32 len;
> > -   info("TPM_SaveKeyContext()");
> > --  res = TPM_SaveContext(keyHandle, TPM_RT_KEY, "SaveKeyContext..",
> > -+  res = TPM_SaveContext(keyHandle, TPM_RT_KEY, (BYTE*)"SaveKeyContext..",
> > -                         keyContextSize, &contextBlob);
> > -   if (res != TPM_SUCCESS) return res;
> > -   len = *keyContextSize;
> > -@@ -82,7 +83,7 @@ TPM_RESULT TPM_SaveAuthContext(TPM_AUTHH
> > -   BYTE *ptr;
> > -   UINT32 len;
> > -   info("TPM_SaveAuthContext()");
> > --  res = TPM_SaveContext(authHandle, TPM_RT_KEY, "SaveAuthContext.",
> > -+  res = TPM_SaveContext(authHandle, TPM_RT_KEY, (BYTE*)"SaveAuthContext.",
> > -                         authContextSize, &contextBlob);
> > -   if (res != TPM_SUCCESS) return res;
> > -   len = *authContextSize;
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_emulator.h tpm_emulator/tpm/tpm_emulator.h
> > ---- orig/tpm_emulator-0.4/tpm/tpm_emulator.h   2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_emulator.h    2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,5 +1,6 @@
> > - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> > -+ * Copyright (C) 2005 INTEL Corp
> > -  *
> > -  * This module is free software; you can redistribute it and/or modify
> > -  * it under the terms of the GNU General Public License as published
> > -@@ -22,7 +23,8 @@
> > - /* TPM configuration */
> > - #define TPM_STORE_TO_FILE       1
> > - #undef  TPM_STRONG_PERSISTENCE
> > --#undef  TPM_GENERATE_EK
> > -+//#undef  TPM_GENERATE_EK
> > -+#define  TPM_GENERATE_EK
> > - #undef  TPM_GENERATE_SEED_DAA
> > -
> > - #define TPM_MANUFACTURER 0x4554485A /* 'ETHZ' */
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_marshalling.c tpm_emulator/tpm/tpm_marshalling.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_marshalling.c        2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_marshalling.c 2006-07-24 14:35:35.000000000 -0700
> > -@@ -1312,7 +1312,7 @@ int tpm_unmarshal_TPM_STANY_FLAGS(BYTE *
> > -
> > - int tpm_marshal_RSA(BYTE **ptr, UINT32 *length, rsa_private_key_t *v)
> > - {
> > --  UINT32 m_len, e_len, q_len;
> > -+  size_t m_len, e_len, q_len;
> > -   if (*length < sizeof_RSA((*v))) return -1;
> > -   if (v->size > 0) {
> > -     rsa_export_modulus(v, &(*ptr)[6], &m_len);
> > -@@ -1460,6 +1460,66 @@ int tpm_unmarshal_TPM_PERMANENT_DATA(BYT
> > -   return 0;
> > - }
> > -
> > -+int tpm_marshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v)
> > -+{
> > -+  if (tpm_marshal_TPM_STRUCTURE_TAG(ptr, length, v->tag)
> > -+    || tpm_marshal_TPM_NONCE(ptr, length, &v->contextNonceKey)
> > -+    || tpm_marshal_TPM_COUNT_ID(ptr, length, v->countID) ) return -1;
> > -+
> > -+  return 0;
> > -+}
> > -+
> > -+int tpm_unmarshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v)
> > -+{
> > -+  if (tpm_unmarshal_TPM_STRUCTURE_TAG(ptr, length, &v->tag)
> > -+    || tpm_unmarshal_TPM_NONCE(ptr, length, &v->contextNonceKey)
> > -+    || tpm_unmarshal_TPM_COUNT_ID(ptr, length, &v->countID) ) return -1;
> > -+
> > -+  return 0;
> > -+}
> > -+
> > -+int tpm_marshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v)
> > -+{
> > -+  UINT32 i;
> > -+  if (tpm_marshal_TPM_STRUCTURE_TAG(ptr, length, v->tag)
> > -+    || tpm_marshal_TPM_NONCE(ptr, length, &v->contextNonceSession)
> > -+    || tpm_marshal_TPM_DIGEST(ptr, length, &v->auditDigest)
> > -+    || tpm_marshal_BOOL(ptr, length, v->auditSession)
> > -+    || tpm_marshal_TPM_CURRENT_TICKS(ptr, length, &v->currentTicks)
> > -+    || tpm_marshal_UINT32(ptr, length, v->contextCount)
> > -+    || tpm_marshal_UINT32_ARRAY(ptr, length, v->contextList, TPM_MAX_SESSION_LIST)) return -1;
> > -+  for (i = 0; i < TPM_MAX_SESSIONS; i++) {
> > -+    if (tpm_marshal_TPM_SESSION_DATA(ptr, length, &v->sessions[i])) return -1;
> > -+  }
> > -+  for (i = 0; i < TPM_MAX_SESSIONS_DAA; i++) {
> > -+    if (tpm_marshal_TPM_DAA_SESSION_DATA(ptr, length, &v->sessionsDAA[i])) return -1;
> > -+  }
> > -+  if (tpm_marshal_TPM_TRANSHANDLE(ptr, length, v->transExclusive)) return -1;
> > -+
> > -+  return 0;
> > -+}
> > -+
> > -+int tpm_unmarshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v)
> > -+{
> > -+  UINT32 i;
> > -+  if (tpm_unmarshal_TPM_STRUCTURE_TAG(ptr, length, &v->tag)
> > -+    || tpm_unmarshal_TPM_NONCE(ptr, length, &v->contextNonceSession)
> > -+    || tpm_unmarshal_TPM_DIGEST(ptr, length, &v->auditDigest)
> > -+    || tpm_unmarshal_BOOL(ptr, length, &v->auditSession)
> > -+    || tpm_unmarshal_TPM_CURRENT_TICKS(ptr, length, &v->currentTicks)
> > -+    || tpm_unmarshal_UINT32(ptr, length, &v->contextCount)
> > -+    || tpm_unmarshal_UINT32_ARRAY(ptr, length, v->contextList, TPM_MAX_SESSION_LIST)) return -1;
> > -+  for (i = 0; i < TPM_MAX_SESSIONS; i++) {
> > -+    if (tpm_unmarshal_TPM_SESSION_DATA(ptr, length, &v->sessions[i])) return -1;
> > -+  }
> > -+  for (i = 0; i < TPM_MAX_SESSIONS_DAA; i++) {
> > -+    if (tpm_unmarshal_TPM_DAA_SESSION_DATA(ptr, length, &v->sessionsDAA[i])) return -1;
> > -+  }
> > -+  if (tpm_unmarshal_TPM_TRANSHANDLE(ptr, length, &v->transExclusive)) return -1;
> > -+
> > -+  return 0;
> > -+}
> > -+
> > - int tpm_marshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v)
> > - {
> > -   if (tpm_marshal_BYTE(ptr, length, v->type)
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_marshalling.h tpm_emulator/tpm/tpm_marshalling.h
> > ---- orig/tpm_emulator-0.4/tpm/tpm_marshalling.h        2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_marshalling.h 2006-07-24 14:35:35.000000000 -0700
> > -@@ -432,6 +432,12 @@ int tpm_unmarshal_TPM_KEY_DATA(BYTE **pt
> > - int tpm_marshal_TPM_PERMANENT_DATA(BYTE **ptr, UINT32 *length, TPM_PERMANENT_DATA *);
> > - int tpm_unmarshal_TPM_PERMANENT_DATA(BYTE **ptr, UINT32 *length, TPM_PERMANENT_DATA *);
> > -
> > -+int tpm_marshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v);
> > -+int tpm_unmarshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v);
> > -+
> > -+int tpm_marshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v);
> > -+int tpm_unmarshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v);
> > -+
> > - int tpm_marshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v);
> > - int tpm_unmarshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v);
> > -
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_owner.c tpm_emulator/tpm/tpm_owner.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_owner.c      2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_owner.c       2006-07-24 14:35:35.000000000 -0700
> > -@@ -108,7 +108,7 @@ TPM_RESULT TPM_TakeOwnership(TPM_PROTOCO
> > -   TPM_RESULT res;
> > -   rsa_private_key_t *ek = &tpmData.permanent.data.endorsementKey;
> > -   TPM_KEY_DATA *srk = &tpmData.permanent.data.srk;
> > --  UINT32 buf_size = ek->size >> 3;
> > -+  size_t buf_size = ek->size >> 3, key_length;
> > -   BYTE buf[buf_size];
> > -
> > -   info("TPM_TakeOwnership()");
> > -@@ -173,7 +173,8 @@ TPM_RESULT TPM_TakeOwnership(TPM_PROTOCO
> > -     return TPM_FAIL;
> > -   }
> > -   rsa_export_modulus(&srk->key, srkPub->pubKey.key,
> > --    &srkPub->pubKey.keyLength);
> > -+                   &key_length);
> > -+  srkPub->pubKey.keyLength = (UINT32) key_length;
> > -   /* setup tpmProof and set state to owned */
> > -   tpm_get_random_bytes(tpmData.permanent.data.tpmProof.nonce,
> > -     sizeof(tpmData.permanent.data.tpmProof.nonce));
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_startup.c tpm_emulator/tpm/tpm_startup.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_startup.c    2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_startup.c     2006-07-24 14:35:35.000000000 -0700
> > -@@ -41,26 +41,29 @@ void TPM_Init(TPM_STARTUP_TYPE startupTy
> > - TPM_RESULT TPM_Startup(TPM_STARTUP_TYPE startupType)
> > - {
> > -   int i;
> > -+  int restore_fail;
> > -   info("TPM_Startup(%d)", startupType);
> > -   if (tpmData.stany.flags.postInitialise == FALSE) return TPM_INVALID_POSTINIT;
> > --  /* reset STANY_FLAGS */
> > --  SET_TO_ZERO(&tpmData.stany.flags);
> > --  tpmData.stany.flags.tag = TPM_TAG_STANY_FLAGS;
> > --  /* reset STANY_DATA (invalidates ALL sessions) */
> > --  SET_TO_ZERO(&tpmData.stany.data);
> > --  tpmData.stany.data.tag = TPM_TAG_STANY_DATA;
> > --  /* init session-context nonce */
> > --  SET_TO_RAND(&tpmData.stany.data.contextNonceSession);
> > -+
> > -+  /* try and restore state to get EK, SRK, etc */
> > -+  restore_fail = tpm_restore_permanent_data();
> > -+
> > -   /* set data and flags according to the given startup type */
> > -   if (startupType == TPM_ST_CLEAR) {
> > --    /* if available, restore permanent data */
> > --    tpm_restore_permanent_data();
> > -+    /* reset STANY_FLAGS */
> > -+    SET_TO_ZERO(&tpmData.stany.flags);
> > -+    tpmData.stany.flags.tag = TPM_TAG_STANY_FLAGS;
> > -+    /* reset STANY_DATA (invalidates ALL sessions) */
> > -+    SET_TO_ZERO(&tpmData.stany.data);
> > -+    tpmData.stany.data.tag = TPM_TAG_STANY_DATA;
> > -+    /* init session-context nonce */
> > -+    SET_TO_RAND(&tpmData.stany.data.contextNonceSession);
> > -     /* reset PCR values */
> > -     for (i = 0; i < TPM_NUM_PCR; i++) {
> > --      if (tpmData.permanent.data.pcrAttrib[i].pcrReset)
> > --        SET_TO_ZERO(tpmData.permanent.data.pcrValue[i].digest);
> > -+      if (!tpmData.permanent.data.pcrAttrib[i].pcrReset)
> > -+        SET_TO_ZERO(&tpmData.permanent.data.pcrValue[i].digest);
> > -       else
> > --        SET_TO_0xFF(tpmData.permanent.data.pcrValue[i].digest);
> > -+        SET_TO_0xFF(&tpmData.permanent.data.pcrValue[i].digest);
> > -     }
> > -     /* reset STCLEAR_FLAGS */
> > -     SET_TO_ZERO(&tpmData.stclear.flags);
> > -@@ -79,7 +82,8 @@ TPM_RESULT TPM_Startup(TPM_STARTUP_TYPE
> > -     /* init key-context nonce */
> > -     SET_TO_RAND(&tpmData.stclear.data.contextNonceKey);
> > -   } else if (startupType == TPM_ST_STATE) {
> > --    if (tpm_restore_permanent_data()) {
> > -+    /* restore must have been successful for TPM_ST_STATE */
> > -+    if (restore_fail) {
> > -       error("restoring permanent data failed");
> > -       tpmData.permanent.data.testResult = "tpm_restore_permanent_data() failed";
> > -       tpmData.permanent.flags.selfTestSucceeded = FALSE;
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_storage.c tpm_emulator/tpm/tpm_storage.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_storage.c    2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_storage.c     2006-07-24 14:35:35.000000000 -0700
> > -@@ -58,6 +58,7 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
> > -                         BYTE *enc, UINT32 *enc_size)
> > - {
> > -   UINT32 len;
> > -+  size_t enc_size32 = *enc_size;
> > -   BYTE *buf, *ptr;
> > -   rsa_public_key_t pub_key;
> > -   int scheme;
> > -@@ -72,7 +73,7 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
> > -   if (buf == NULL
> > -       || tpm_marshal_TPM_SEALED_DATA(&ptr, &len, seal)
> > -       || rsa_encrypt(&pub_key, scheme, buf, sizeof_TPM_SEALED_DATA((*seal)),
> > --                     enc, enc_size)) {
> > -+                     enc, &enc_size32)) {
> > -     tpm_free(buf);
> > -     rsa_release_public_key(&pub_key);
> > -     return -1;
> > -@@ -85,7 +86,8 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
> > - int decrypt_sealed_data(TPM_KEY_DATA *key, BYTE *enc, UINT32 enc_size,
> > -                         TPM_SEALED_DATA *seal, BYTE **buf)
> > - {
> > --  UINT32 len;
> > -+  size_t len;
> > -+  UINT32 len32;
> > -   BYTE *ptr;
> > -   int scheme;
> > -   switch (key->encScheme) {
> > -@@ -96,8 +98,12 @@ int decrypt_sealed_data(TPM_KEY_DATA *ke
> > -   len = enc_size;
> > -   *buf = ptr = tpm_malloc(len);
> > -   if (*buf == NULL
> > --      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len)
> > --      || tpm_unmarshal_TPM_SEALED_DATA(&ptr, &len, seal)) {
> > -+      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len) ){
> > -+    tpm_free(*buf);
> > -+    return -1;
> > -+  }
> > -+  len32 = len;
> > -+  if (tpm_unmarshal_TPM_SEALED_DATA(&ptr, &len32, seal)) {
> > -     tpm_free(*buf);
> > -     return -1;
> > -   }
> > -@@ -240,11 +246,12 @@ TPM_RESULT TPM_Unseal(TPM_KEY_HANDLE par
> > -
> > - TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE keyHandle, UINT32 inDataSize,
> > -                       BYTE *inData, TPM_AUTH *auth1,
> > --                      UINT32 *outDataSize, BYTE **outData)
> > -+                      UINT32 *outDataSize32, BYTE **outData)
> > - {
> > -   TPM_RESULT res;
> > -   TPM_KEY_DATA *key;
> > -   int scheme;
> > -+  size_t outDataSize;
> > -
> > -   info("TPM_UnBind()");
> > -   /* get key */
> > -@@ -262,8 +269,8 @@ TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE key
> > -   /* the size of the input data muss be greater than zero */
> > -   if (inDataSize == 0) return TPM_BAD_PARAMETER;
> > -   /* decrypt data */
> > --  *outDataSize = inDataSize;
> > --  *outData = tpm_malloc(*outDataSize);
> > -+  outDataSize = inDataSize;
> > -+  *outData = tpm_malloc(outDataSize);
> > -   if (*outData == NULL) return TPM_NOSPACE;
> > -   switch (key->encScheme) {
> > -     case TPM_ES_RSAESOAEP_SHA1_MGF1: scheme = RSA_ES_OAEP_SHA1; break;
> > -@@ -271,20 +278,21 @@ TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE key
> > -     default: tpm_free(*outData); return TPM_DECRYPT_ERROR;
> > -   }
> > -   if (rsa_decrypt(&key->key, scheme, inData, inDataSize,
> > --      *outData, outDataSize)) {
> > -+      *outData, &outDataSize)) {
> > -     tpm_free(*outData);
> > -     return TPM_DECRYPT_ERROR;
> > -   }
> > -   /* verify data if it is of type TPM_BOUND_DATA */
> > -   if (key->encScheme == TPM_ES_RSAESOAEP_SHA1_MGF1
> > -       || key->keyUsage != TPM_KEY_LEGACY) {
> > --    if (*outDataSize < 5 || memcmp(*outData, "\x01\x01\00\x00\x02", 5) != 0) {
> > -+    if (outDataSize < 5 || memcmp(*outData, "\x01\x01\00\x00\x02", 5) != 0) {
> > -       tpm_free(*outData);
> > -       return TPM_DECRYPT_ERROR;
> > -     }
> > --    *outDataSize -= 5;
> > --    memmove(*outData, &(*outData)[5], *outDataSize);
> > -+    outDataSize -= 5;
> > -+    memmove(*outData, &(*outData)[5], outDataSize);
> > -   }
> > -+  *outDataSize32 = (UINT32) outDataSize;
> > -   return TPM_SUCCESS;
> > - }
> > -
> > -@@ -334,12 +342,13 @@ int compute_pubkey_digest(TPM_PUBKEY *ke
> > - }
> > -
> > - int encrypt_private_key(TPM_KEY_DATA *key, TPM_STORE_ASYMKEY *store,
> > --                        BYTE *enc, UINT32 *enc_size)
> > -+                        BYTE *enc, UINT32 *enc_size32)
> > - {
> > -   UINT32 len;
> > -   BYTE *buf, *ptr;
> > -   rsa_public_key_t pub_key;
> > -   int scheme;
> > -+  size_t enc_size;
> > -   switch (key->encScheme) {
> > -     case TPM_ES_RSAESOAEP_SHA1_MGF1: scheme = RSA_ES_OAEP_SHA1; break;
> > -     case TPM_ES_RSAESPKCSv15: scheme = RSA_ES_PKCSV15; break;
> > -@@ -351,11 +360,12 @@ int encrypt_private_key(TPM_KEY_DATA *ke
> > -   if (buf == NULL
> > -       || tpm_marshal_TPM_STORE_ASYMKEY(&ptr, &len, store)
> > -       || rsa_encrypt(&pub_key, scheme, buf, sizeof_TPM_STORE_ASYMKEY((*store)),
> > --                     enc, enc_size)) {
> > -+                     enc, &enc_size)) {
> > -     tpm_free(buf);
> > -     rsa_release_public_key(&pub_key);
> > -     return -1;
> > -   }
> > -+  *enc_size32 = (UINT32) enc_size;
> > -   tpm_free(buf);
> > -   rsa_release_public_key(&pub_key);
> > -   return 0;
> > -@@ -364,7 +374,8 @@ int encrypt_private_key(TPM_KEY_DATA *ke
> > - int decrypt_private_key(TPM_KEY_DATA *key, BYTE *enc, UINT32 enc_size,
> > -                         TPM_STORE_ASYMKEY *store, BYTE **buf)
> > - {
> > --  UINT32 len;
> > -+  UINT32 len32;
> > -+  size_t len;
> > -   BYTE *ptr;
> > -   int scheme;
> > -   switch (key->encScheme) {
> > -@@ -375,8 +386,12 @@ int decrypt_private_key(TPM_KEY_DATA *ke
> > -   len = enc_size;
> > -   *buf = ptr = tpm_malloc(len);
> > -   if (*buf == NULL
> > --      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len)
> > --      || tpm_unmarshal_TPM_STORE_ASYMKEY(&ptr, &len, store)) {
> > -+      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len) ) {
> > -+    tpm_free(*buf);
> > -+    return -1;
> > -+  }
> > -+  len32 = (UINT32) len;
> > -+  if (tpm_unmarshal_TPM_STORE_ASYMKEY(&ptr, &len32, store)) {
> > -     tpm_free(*buf);
> > -     return -1;
> > -   }
> > -@@ -394,7 +409,7 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
> > -   TPM_SESSION_DATA *session;
> > -   TPM_STORE_ASYMKEY store;
> > -   rsa_private_key_t rsa;
> > --  UINT32 key_length;
> > -+  size_t key_length;
> > -
> > -   info("TPM_CreateWrapKey()");
> > -   /* get parent key */
> > -@@ -450,11 +465,11 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
> > -     }
> > -   }
> > -   /* generate key and store it */
> > --  key_length = keyInfo->algorithmParms.parms.rsa.keyLength;
> > --  if (rsa_generate_key(&rsa, key_length)) return TPM_FAIL;
> > --  wrappedKey->pubKey.keyLength = key_length >> 3;
> > -+  if (rsa_generate_key(&rsa, keyInfo->algorithmParms.parms.rsa.keyLength))
> > -+    return TPM_FAIL;
> > -+  wrappedKey->pubKey.keyLength = keyInfo->algorithmParms.parms.rsa.keyLength >> 3;
> > -   wrappedKey->pubKey.key = tpm_malloc(wrappedKey->pubKey.keyLength);
> > --  store.privKey.keyLength = key_length >> 4;
> > -+  store.privKey.keyLength = keyInfo->algorithmParms.parms.rsa.keyLength >> 4;
> > -   store.privKey.key = tpm_malloc(store.privKey.keyLength);
> > -   wrappedKey->encDataSize = parent->key.size >> 3;
> > -   wrappedKey->encData = tpm_malloc(wrappedKey->encDataSize);
> > -@@ -466,9 +481,11 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
> > -     tpm_free(wrappedKey->encData);
> > -     return TPM_NOSPACE;
> > -   }
> > --  rsa_export_modulus(&rsa, wrappedKey->pubKey.key,
> > --    &wrappedKey->pubKey.keyLength);
> > --  rsa_export_prime1(&rsa, store.privKey.key, &store.privKey.keyLength);
> > -+  rsa_export_modulus(&rsa, wrappedKey->pubKey.key,
> > -+                   &key_length);
> > -+  wrappedKey->pubKey.keyLength = (UINT32) key_length;
> > -+  rsa_export_prime1(&rsa, store.privKey.key, &key_length);
> > -+  store.privKey.keyLength = (UINT32) key_length;
> > -   rsa_release_private_key(&rsa);
> > -   /* compute the digest of the wrapped key (without encData) */
> > -   if (compute_key_digest(wrappedKey, &store.pubDataDigest)) {
> > -@@ -602,6 +619,7 @@ TPM_RESULT TPM_LoadKey2(TPM_KEY_HANDLE p
> > -
> > - int tpm_setup_key_parms(TPM_KEY_DATA *key, TPM_KEY_PARMS *parms)
> > - {
> > -+  size_t key_length;
> > -   parms->algorithmID = TPM_ALG_RSA;
> > -   parms->encScheme = key->encScheme;
> > -   parms->sigScheme = key->sigScheme;
> > -@@ -611,7 +629,8 @@ int tpm_setup_key_parms(TPM_KEY_DATA *ke
> > -   parms->parms.rsa.exponent = tpm_malloc(parms->parms.rsa.exponentSize);
> > -   if (parms->parms.rsa.exponent == NULL) return -1;
> > -   rsa_export_exponent(&key->key, parms->parms.rsa.exponent,
> > --    &parms->parms.rsa.exponentSize);
> > -+    &key_length);
> > -+  parms->parms.rsa.exponentSize = (UINT32) key_length;
> > -   parms->parmSize = 12 + parms->parms.rsa.exponentSize;
> > -   return 0;
> > - }
> > -@@ -622,6 +641,7 @@ TPM_RESULT TPM_GetPubKey(TPM_KEY_HANDLE
> > -   TPM_RESULT res;
> > -   TPM_KEY_DATA *key;
> > -   TPM_DIGEST digest;
> > -+  size_t key_length;
> > -   info("TPM_GetPubKey()");
> > -   /* get key */
> > -   if (keyHandle == TPM_KH_SRK
> > -@@ -650,8 +670,8 @@ TPM_RESULT TPM_GetPubKey(TPM_KEY_HANDLE
> > -   pubKey->pubKey.keyLength = key->key.size >> 3;
> > -   pubKey->pubKey.key = tpm_malloc(pubKey->pubKey.keyLength);
> > -   if (pubKey->pubKey.key == NULL) return TPM_NOSPACE;
> > --  rsa_export_modulus(&key->key, pubKey->pubKey.key,
> > --    &pubKey->pubKey.keyLength);
> > -+  rsa_export_modulus(&key->key, pubKey->pubKey.key, &key_length);
> > -+  pubKey->pubKey.keyLength = (UINT32) key_length;
> > -   if (tpm_setup_key_parms(key, &pubKey->algorithmParms) != 0) {
> > -     error("TPM_GetPubKey(): tpm_setup_key_parms() failed.");
> > -     tpm_free(pubKey->pubKey.key);
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_structures.h tpm_emulator/tpm/tpm_structures.h
> > ---- orig/tpm_emulator-0.4/tpm/tpm_structures.h 2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_structures.h  2006-07-24 14:35:35.000000000 -0700
> > -@@ -1958,6 +1958,7 @@ typedef struct tdTPM_DAA_ISSUER {
> > -   TPM_DIGEST DAA_digest_gamma;
> > -   BYTE DAA_generic_q[26];
> > - } TPM_DAA_ISSUER;
> > -+#define sizeof_TPM_DAA_ISSUER(s) (2 + (20 * 6) + 26 )
> > -
> > - /*
> > -  * TPM_DAA_TPM ([TPM_Part2], Section 22.4)
> > -@@ -1973,6 +1974,7 @@ typedef struct tdTPM_DAA_TPM {
> > -   TPM_DIGEST DAA_rekey;
> > -   UINT32 DAA_count;
> > - } TPM_DAA_TPM;
> > -+#define sizeof_TPM_DAA_TPM(s) (2 + (4 * 20) + 4)
> > -
> > - /*
> > -  * TPM_DAA_CONTEXT ([TPM_Part2], Section 22.5)
> > -@@ -1987,6 +1989,7 @@ typedef struct tdTPM_DAA_CONTEXT {
> > -   BYTE DAA_scratch[256];
> > -   BYTE DAA_stage;
> > - } TPM_DAA_CONTEXT;
> > -+#define sizeof_TPM_DAA_CONTEXT(s) (2 + (3 * 20) + 256 + 1)
> > -
> > - /*
> > -  * TPM_DAA_JOINDATA ([TPM_Part2], Section 22.6)
> > -@@ -1998,6 +2001,7 @@ typedef struct tdTPM_DAA_JOINDATA {
> > -   BYTE DAA_join_u1[138];
> > -   TPM_DIGEST DAA_digest_n0;
> > - } TPM_DAA_JOINDATA;
> > -+#define sizeof_TPM_DAA_JOINDATA(s) (1 + 1 + 20)
> > -
> > - /*
> > -  * TPM_DAA_BLOB ([TPM_Part2], Section 22.8)
> > -@@ -2202,6 +2206,7 @@ typedef struct tdTPM_STCLEAR_DATA {
> > -   //UINT32 ownerReference;
> > -   //BOOL disableResetLock;
> > - } TPM_STCLEAR_DATA;
> > -+#define sizeof_TPM_STCLEAR_DATA(s) (2 + 20 + 4)
> > -
> > - /*
> > -  * TPM_SESSION_DATA
> > -@@ -2238,6 +2243,11 @@ typedef struct tdTPM_DAA_SESSION_DATA {
> > -   TPM_DAA_JOINDATA DAA_joinSession;
> > -   TPM_HANDLE handle;
> > - } TPM_DAA_SESSION_DATA;
> > -+#define sizeof_TPM_DAA_SESSION_DATA(s) ( 1 \
> > -+  + sizeof_TPM_DAA_ISSUER(s.DAA_issuerSettings) \
> > -+  + sizeof_TPM_DAA_TPM(s.DAA_tpmSpecific) \
> > -+  + sizeof_TPM_DAA_CONTEXT(s.DAA_session) \
> > -+  + sizeof_TPM_DAA_JOINDATA(s.DAA_joinSession) + 4)
> > -
> > - /*
> > -  * TPM_STANY_DATA ([TPM_Part2], Section 7.6)
> > -@@ -2262,6 +2272,11 @@ typedef struct tdTPM_STANY_DATA {
> > -   TPM_DAAHANDLE currentDAA;
> > -   TPM_TRANSHANDLE transExclusive;
> > - } TPM_STANY_DATA;
> > -+#define sizeof_TPM_STANY_DATA(s) (2 + 20 + 20 + 1 \
> > -+  + sizeof_TPM_CURRENT_TICKS(s.currentTicks) \
> > -+  + 4 + (4 * TPM_MAX_SESSION_LIST) \
> > -+  + (sizeof_TPM_SESSION_DATA(s.sessions[0]) * TPM_MAX_SESSION_LIST) \
> > -+  + (sizeof_TPM_DAA_SESSION_DATA(s.sessionsDAA[0]) * TPM_MAX_SESSIONS_DAA) + 4)
> > -
> > - /*
> > -  * TPM_DATA
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_testing.c tpm_emulator/tpm/tpm_testing.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_testing.c    2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_testing.c     2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,6 +1,7 @@
> > - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> > -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> > -+ * Copyright (C) 2005 INTEL Corp
> > -  *
> > -  * This module is free software; you can redistribute it and/or modify
> > -  * it under the terms of the GNU General Public License as published
> > -@@ -95,24 +96,24 @@ static int tpm_test_sha1(void)
> > -   struct {
> > -     uint8_t *data; uint32_t repetitions; uint8_t *digest;
> > -   } test_cases[] =  {{
> > --    "abc", 1,
> > --    "\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D"
> > -+      (uint8_t*)"abc", 1,
> > -+    (uint8_t*)"\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D"
> > -   }, {
> > --    "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 1,
> > --    "\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29\xE5\xE5\x46\x70\xF1"
> > -+    (uint8_t*)"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 1,
> > -+    (uint8_t*)"\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29\xE5\xE5\x46\x70\xF1"
> > -   }, {
> > --    "a", 1000000,
> > --    "\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F"
> > -+    (uint8_t*)"a", 1000000,
> > -+    (uint8_t*)"\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F"
> > -   }, {
> > --    "0123456701234567012345670123456701234567012345670123456701234567", 10,
> > --    "\xDE\xA3\x56\xA2\xCD\xDD\x90\xC7\xA7\xEC\xED\xC5\xEB\xB5\x63\x93\x4F\x46\x04\x52"
> > -+    (uint8_t*)"0123456701234567012345670123456701234567012345670123456701234567", 10,
> > -+    (uint8_t*)"\xDE\xA3\x56\xA2\xCD\xDD\x90\xC7\xA7\xEC\xED\xC5\xEB\xB5\x63\x93\x4F\x46\x04\x52"
> > -   }};
> > -
> > -   debug("tpm_test_sha1()");
> > -   for (i = 0; i < sizeof(test_cases) / sizeof(test_cases[0]); i++) {
> > -     sha1_init(&ctx);
> > -     for (j = 0; j < test_cases[i].repetitions; j++)
> > --      sha1_update(&ctx, test_cases[i].data, strlen(test_cases[i].data));
> > -+      sha1_update(&ctx, test_cases[i].data, strlen((char*)test_cases[i].data));
> > -     sha1_final(&ctx, digest);
> > -     if (memcmp(digest, test_cases[i].digest, SHA1_DIGEST_LENGTH) != 0) return -1;
> > -   }
> > -@@ -128,41 +129,41 @@ static int tpm_test_hmac(void)
> > -   struct {
> > -     uint8_t *key, key_len, *data, data_len, *digest;
> > -   } test_cases[] = {{
> > --    "\x0b", 20, "Hi There", 8,
> > --    "\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"
> > -+    (uint8_t*)"\x0b", 20, (uint8_t*)"Hi There", 8,
> > -+    (uint8_t*)"\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"
> > -   }, {
> > --    "Jefe", 4, "what do ya want for nothing?", 28,
> > --    "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79"
> > -+    (uint8_t*)"Jefe", 4, (uint8_t*)"what do ya want for nothing?", 28,
> > -+    (uint8_t*)"\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79"
> > -   }, {
> > --    "\xaa", 20, "\xdd", 50,
> > --    "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3"
> > -+    (uint8_t*)"\xaa", 20, (uint8_t*)"\xdd", 50,
> > -+    (uint8_t*)"\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3"
> > -   }, {
> > --    "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
> > --    "\x15\x16\x17\x18\x19", 25, "\xcd", 50,
> > --    "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda"
> > -+    (uint8_t*)"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
> > -+    "\x15\x16\x17\x18\x19", 25, (uint8_t*)"\xcd", 50,
> > -+    (uint8_t*)"\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda"
> > -   }, {
> > --    "\x0c", 20, "Test With Truncation", 20,
> > --    "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04"
> > -+    (uint8_t*)"\x0c", 20, (uint8_t*)"Test With Truncation", 20,
> > -+    (uint8_t*)"\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04"
> > -   }, {
> > --    "\xaa", 80, "Test Using Larger Than Block-Size Key - Hash Key First", 54,
> > --    "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12"
> > -+    (uint8_t*)"\xaa", 80, (uint8_t*)"Test Using Larger Than Block-Size Key - Hash Key First", 54,
> > -+    (uint8_t*)"\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12"
> > -   }, {
> > --    "\xaa", 80,
> > --    "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", 73,
> > --    "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91"
> > -+    (uint8_t*)"\xaa", 80,
> > -+    (uint8_t*)"Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", 73,
> > -+    (uint8_t*)"\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91"
> > -   }};
> > -
> > -   debug("tpm_test_hmac()");
> > -   for (i = 0; i < sizeof(test_cases) / sizeof(test_cases[0]); i++) {
> > --    if (strlen(test_cases[i].key) < test_cases[i].key_len) {
> > -+    if (strlen((char*)test_cases[i].key) < test_cases[i].key_len) {
> > -       uint8_t key[test_cases[i].key_len];
> > -       memset(key, test_cases[i].key[0], test_cases[i].key_len);
> > -       hmac_init(&ctx, key, test_cases[i].key_len);
> > -     } else {
> > -       hmac_init(&ctx, test_cases[i].key, test_cases[i].key_len);
> > -     }
> > --    for (j = 0; j < test_cases[i].data_len; j += strlen(test_cases[i].data)) {
> > --      hmac_update(&ctx, test_cases[i].data, strlen(test_cases[i].data));
> > -+    for (j = 0; j < test_cases[i].data_len; j += strlen((char*)test_cases[i].data)) {
> > -+      hmac_update(&ctx, test_cases[i].data, strlen((char*)test_cases[i].data));
> > -     }
> > -     hmac_final(&ctx, digest);
> > -     if (memcmp(digest, test_cases[i].digest, SHA1_DIGEST_LENGTH) != 0) return -1;
> > -@@ -173,9 +174,9 @@ static int tpm_test_hmac(void)
> > - static int tpm_test_rsa_EK(void)
> > - {
> > -   int res = 0;
> > --  char *data = "RSA PKCS #1 v1.5 Test-String";
> > -+  uint8_t *data = (uint8_t*)"RSA PKCS #1 v1.5 Test-String";
> > -   uint8_t buf[256];
> > --  size_t buf_len, data_len = strlen(data);
> > -+  size_t buf_len, data_len = strlen((char*)data);
> > -   rsa_private_key_t priv_key;
> > -   rsa_public_key_t pub_key;
> > -
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_ticks.c tpm_emulator/tpm/tpm_ticks.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_ticks.c      2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_ticks.c       2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,6 +1,7 @@
> > - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> > -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> > -+ * Copyright (C) 2005 INTEL Corp
> > -  *
> > -  * This module is free software; you can redistribute it and/or modify
> > -  * it under the terms of the GNU General Public License as published
> > -@@ -39,9 +40,7 @@ TPM_RESULT TPM_SetTickType(TPM_TICKTYPE
> > - TPM_RESULT TPM_GetTicks(TPM_CURRENT_TICKS *currentTime)
> > - {
> > -   info("TPM_GetTicks()");
> > --  memcpy(currentTime, &tpmData.stany.data.currentTicks,
> > --    sizeof(TPM_CURRENT_TICKS));
> > --  return TPM_SUCCESS;
> > -+  return TPM_DISABLED_CMD;
> > - }
> > -
> > - TPM_RESULT TPM_TickStampBlob(TPM_KEY_HANDLE keyHandle, TPM_NONCE *antiReplay,
> > -@@ -49,64 +48,11 @@ TPM_RESULT TPM_TickStampBlob(TPM_KEY_HAN
> > -                              TPM_CURRENT_TICKS *currentTicks,
> > -                              UINT32 *sigSize, BYTE **sig)
> > - {
> > --  TPM_RESULT res;
> > --  TPM_KEY_DATA *key;
> > --  BYTE *info, *p;
> > --  UINT32 info_length, length;
> > -   info("TPM_TickStampBlob()");
> > --  /* get key */
> > --  key = tpm_get_key(keyHandle);
> > --  if (key == NULL) return TPM_INVALID_KEYHANDLE;
> > --  /* verify authorization */
> > --  res = tpm_verify_auth(auth1, key->usageAuth, keyHandle);
> > --  if (res != TPM_SUCCESS) return res;
> > --  if (key->keyUsage != TPM_KEY_SIGNING && key->keyUsage != TPM_KEY_LEGACY
> > --      && key->keyUsage != TPM_KEY_IDENTITY) return TPM_INVALID_KEYUSAGE;
> > --  /* get current ticks */
> > --  TPM_GetTicks(currentTicks);
> > --  /* sign data using signature scheme PKCS1_SHA1 and TPM_SIGN_INFO container */
> > --  *sigSize = key->key.size >> 3;
> > --  *sig = tpm_malloc(*sigSize);
> > --  if (*sig == NULL) return TPM_FAIL;
> > --  /* setup TPM_SIGN_INFO structure */
> > --  info_length = 30 + sizeof(TPM_DIGEST) + sizeof_TPM_CURRENT_TICKS(currentTicks);
> > --  info = tpm_malloc(info_length);
> > --  if (info == NULL) {
> > --    tpm_free(*sig);
> > --    return TPM_FAIL;
> > --  }
> > --  memcpy(&info[0], "\x05\x00TSTP", 6);
> > --  memcpy(&info[6], antiReplay->nonce, 20);
> > --  *(UINT32*)&info[26] = CPU_TO_BE32(20
> > --                        + sizeof_TPM_CURRENT_TICKS(currentTicks));
> > --  memcpy(&info[30], digestToStamp->digest, sizeof(TPM_DIGEST));
> > --  p = &info[30 + sizeof(TPM_DIGEST)];
> > --  length = sizeof_TPM_CURRENT_TICKS(currentTicks);
> > --  if (tpm_marshal_TPM_CURRENT_TICKS(&p, &length, currentTicks)
> > --      || rsa_sign(&key->key, RSA_SSA_PKCS1_SHA1, info, info_length, *sig)) {
> > --    tpm_free(*sig);
> > --    tpm_free(info);
> > --    return TPM_FAIL;
> > --  }
> > --  return TPM_SUCCESS;
> > -+  return TPM_DISABLED_CMD;
> > - }
> > -
> > - void tpm_update_ticks(void)
> > - {
> > --  if (tpmData.stany.data.currentTicks.tag == 0) {
> > --    tpmData.stany.data.currentTicks.tag = TPM_TAG_CURRENT_TICKS;
> > --    tpmData.stany.data.currentTicks.currentTicks += tpm_get_ticks();
> > --/* removed since v1.2 rev 94
> > --    tpmData.stany.data.currentTicks.tickType = tpmData.permanent.data.tickType;
> > --*/
> > --    tpm_get_random_bytes(tpmData.stany.data.currentTicks.tickNonce.nonce,
> > --      sizeof(TPM_NONCE));
> > --    tpmData.stany.data.currentTicks.tickRate = 1;
> > --/* removed since v1.2 rev 94
> > --    tpmData.stany.data.currentTicks.tickSecurity = TICK_SEC_NO_CHECK;
> > --*/
> > --  } else {
> > --    tpmData.stany.data.currentTicks.currentTicks += tpm_get_ticks();
> > --  }
> > - }
> > -
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_transport.c tpm_emulator/tpm/tpm_transport.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_transport.c  2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_transport.c   2006-07-24 14:35:35.000000000 -0700
> > -@@ -189,7 +189,7 @@ static void decrypt_wrapped_command(BYTE
> > -     sha1_init(&sha1);
> > -     sha1_update(&sha1, auth->nonceEven.nonce, sizeof(auth->nonceEven.nonce));
> > -     sha1_update(&sha1, auth->nonceOdd.nonce, sizeof(auth->nonceOdd.nonce));
> > --    sha1_update(&sha1, "in", 2);
> > -+    sha1_update(&sha1, (BYTE*)"in", 2);
> > -     sha1_update(&sha1, secret, sizeof(TPM_SECRET));
> > -     j = CPU_TO_BE32(i);
> > -     sha1_update(&sha1, (BYTE*)&j, 4);
> > -@@ -211,7 +211,7 @@ static void encrypt_wrapped_command(BYTE
> > -     sha1_init(&sha1);
> > -     sha1_update(&sha1, auth->nonceEven.nonce, sizeof(auth->nonceEven.nonce));
> > -     sha1_update(&sha1, auth->nonceOdd.nonce, sizeof(auth->nonceOdd.nonce));
> > --    sha1_update(&sha1, "out", 3);
> > -+    sha1_update(&sha1, (BYTE*)"out", 3);
> > -     sha1_update(&sha1, secret, sizeof(TPM_SECRET));
> > -     j = CPU_TO_BE32(i);
> > -     sha1_update(&sha1, (BYTE*)&j, 4);
> > -diff -uprN orig/tpm_emulator-0.4/tpmd.c tpm_emulator/tpmd.c
> > ---- orig/tpm_emulator-0.4/tpmd.c       1969-12-31 16:00:00.000000000 -0800
> > -+++ tpm_emulator/tpmd.c        2006-07-24 14:35:35.000000000 -0700
> > -@@ -0,0 +1,156 @@
> > -+/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -+ * Copyright (C) 2005 INTEL Corp
> > -+ *
> > -+ * This module is free software; you can redistribute it and/or modify
> > -+ * it under the terms of the GNU General Public License as published
> > -+ * by the Free Software Foundation; either version 2 of the License,
> > -+ * or (at your option) any later version.
> > -+ *
> > -+ * This module 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.
> > -+ *
> > -+ */
> > -+
> > -+#include <stdio.h>
> > -+#include <stdlib.h>
> > -+#include <unistd.h>
> > -+#include <string.h>
> > -+#include <sys/types.h>
> > -+#include <sys/stat.h>
> > -+#include <fcntl.h>
> > -+#include <sys/time.h>
> > -+
> > -+#include "tpm_emulator.h"
> > -+
> > -+#define TPM_RX_FNAME "/var/tpm/tpm_in.fifo"
> > -+#define TPM_TX_FNAME "/var/tpm/tpm_out.fifo"
> > -+
> > -+#define BUFFER_SIZE 2048
> > -+
> > -+static int devurandom=0;
> > -+
> > -+void get_random_bytes(void *buf, int nbytes) {
> > -+
> > -+  if (devurandom == 0) {
> > -+    devurandom = open("/dev/urandom", O_RDONLY);
> > -+  }
> > -+
> > -+  if (read(devurandom, buf, nbytes) != nbytes) {
> > -+      printf("Can't get random number.\n");
> > -+      exit(-1);
> > -+  }
> > -+}
> > -+
> > -+uint64_t tpm_get_ticks(void)
> > -+{
> > -+  //struct timeval tv;
> > -+  //int gettimeofday(&tv, struct timezone *tz);
> > -+  return 0;
> > -+}
> > -+
> > -+int main(int argc, char **argv)
> > -+{
> > -+  uint8_t in[BUFFER_SIZE], *out;
> > -+  uint32_t out_size;
> > -+  int in_size, written;
> > -+  int i;
> > -+  struct stat file_info;
> > -+
> > -+  int tpm_tx_fh=-1, tpm_rx_fh=-1;
> > -+  if (argc < 2) {
> > -+    printf("Usage: tpmd clear|save|deactivated\n" );
> > -+        return -1;
> > -+  }
> > -+
> > -+  /* initialize TPM emulator */
> > -+  if (!strcmp(argv[1], "clear")) {
> > -+    printf("Initializing tpm: %s\n", argv[1]);
> > -+    tpm_emulator_init(1);
> > -+  } else if (!strcmp(argv[1], "save")) {
> > -+    printf("Initializing tpm: %s\n", argv[1]);
> > -+    tpm_emulator_init(2);
> > -+  } else if (!strcmp(argv[1], "deactivated")) {
> > -+    printf("Initializing tpm: %s\n", argv[1]);
> > -+    tpm_emulator_init(3);
> > -+  } else {
> > -+    printf("invalid startup mode '%s'; must be 'clear', "
> > -+      "'save' (default) or 'deactivated", argv[1]);
> > -+    return -1;
> > -+  }
> > -+
> > -+  if ( stat(TPM_RX_FNAME, &file_info) == -1) {
> > -+    if ( mkfifo(TPM_RX_FNAME, S_IWUSR | S_IRUSR ) ) {
> > -+      printf("Failed to create fifo %s.\n", TPM_RX_FNAME);
> > -+      return -1;
> > -+    }
> > -+  }
> > -+
> > -+  if ( stat(TPM_TX_FNAME, &file_info) == -1) {
> > -+    if ( mkfifo(TPM_TX_FNAME, S_IWUSR | S_IRUSR ) ) {
> > -+      printf("Failed to create fifo %s.\n", TPM_TX_FNAME);
> > -+      return -1;
> > -+    }
> > -+  }
> > -+
> > -+  while (1) {
> > -+abort_command:
> > -+    if (tpm_rx_fh < 0) {
> > -+      tpm_rx_fh = open(TPM_RX_FNAME, O_RDONLY);
> > -+    }
> > -+
> > -+    if (tpm_rx_fh < 0) {
> > -+      printf("ERROR: failed to open devices to listen to guest.\n");
> > -+      return -1;
> > -+    }
> > -+
> > -+    if (tpm_tx_fh < 0) {
> > -+      tpm_tx_fh = open(TPM_TX_FNAME, O_WRONLY);
> > -+    }
> > -+
> > -+    if (tpm_tx_fh < 0) {
> > -+      printf("ERROR: failed to open devices to respond to guest.\n");
> > -+      return -1;
> > -+    }
> > -+
> > -+    in_size = read(tpm_rx_fh, in, BUFFER_SIZE);
> > -+    if (in_size < 6) { // Magic size of minium TPM command
> > -+      printf("Recv[%d] to small: 0x", in_size);
> > -+      if (in_size <= 0) {
> > -+          close(tpm_rx_fh);
> > -+          tpm_rx_fh = -1;
> > -+          goto abort_command;
> > -+      }
> > -+    } else {
> > -+      printf("Recv[%d]: 0x", in_size);
> > -+      for (i=0; i< in_size; i++)
> > -+        printf("%x ", in[i]);
> > -+      printf("\n");
> > -+    }
> > -+
> > -+
> > -+    if (tpm_handle_command(in, in_size, &out, &out_size) != 0) {
> > -+        printf("ERROR: Handler Failed.\n");
> > -+    }
> > -+
> > -+    written = write(tpm_tx_fh, out, out_size);
> > -+
> > -+    if (written != out_size ) {
> > -+      printf("ERROR: Part of response not written %d/%d.\nAttempt: ", written, out_size);
> > -+    } else {
> > -+      printf("Sent[%Zu]: ", out_size);
> > -+    }
> > -+    for (i=0; i< out_size; i++)
> > -+      printf("%x ", out[i]);
> > -+    printf("\n");
> > -+    tpm_free(out);
> > -+
> > -+  } // loop
> > -+
> > -+  tpm_emulator_shutdown();
> > -+
> > -+  close(tpm_tx_fh);
> > -+  close(tpm_rx_fh);
> > -+
> > -+}
> > -Binary files orig/tpm_emulator-0.4/tpm_emulator and tpm_emulator/tpm_emulator differ
> > -diff -uprN orig/tpm_emulator-0.4/tpm_version.h tpm_emulator/tpm_version.h
> > ---- orig/tpm_emulator-0.4/tpm_version.h        2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm_version.h 2006-07-24 14:35:41.000000000 -0700
> > -@@ -2,5 +2,5 @@
> > - #define _TPM_VERSION_H_
> > - #define VERSION_MAJOR 0
> > - #define VERSION_MINOR 4
> > --#define VERSION_BUILD 1151058734
> > -+#define VERSION_BUILD 1153776940
> > - #endif /* _TPM_VERSION_H_ */
> > diff --git a/tools/vtpm/vtpm-0.5.1-LDLIBS.patch b/tools/vtpm/vtpm-0.5.1-LDLIBS.patch
> > deleted file mode 100644
> > index 95586c1..0000000
> > --- a/tools/vtpm/vtpm-0.5.1-LDLIBS.patch
> > +++ /dev/null
> > @@ -1,12 +0,0 @@
> > -diff -Naurp tpm_emulator-0.5.1/tpmd/Makefile tpm_emulator-0.5.1/tpmd/Makefile
> > ---- tpm_emulator-0.5.1/tpmd/Makefile
> > -+++ tpm_emulator-0.5.1/tpmd/Makefile
> > -@@ -8,7 +8,7 @@ WFLAGS  := -Wall -Wno-unused -Wpointer-a
> > -            #WFLAGS  += -Wextra -Wcast-qual -Wmissing-prototypes -Wmissing-declarations -Wstrict-aliasing
> > - CFLAGS  += $(WFLAGS) -g -I.. -I. -O2 -fno-strict-aliasing
> > - CFLAGS  += -I../../../../tools/vtpm_manager/manager
> > --LDFLAGS += -lgmp
> > -+LDLIBS  += -lgmp
> > -
> > - BINDIR  := /usr/bin/
> > -
> > diff --git a/tools/vtpm/vtpm-0.5.1.patch b/tools/vtpm/vtpm-0.5.1.patch
> > deleted file mode 100644
> > index 2aeb745..0000000
> > --- a/tools/vtpm/vtpm-0.5.1.patch
> > +++ /dev/null
> > @@ -1,766 +0,0 @@
> > -diff -Naurp tpm_emulator-0.5.1/Makefile tpm5-test/Makefile
> > ---- tpm_emulator-0.5.1/Makefile        2008-02-14 03:22:48.000000000 -0500
> > -+++ tpm5-test/Makefile 2009-07-15 09:45:28.000000000 -0400
> > -@@ -10,7 +10,7 @@ VERSION_MINOR  := 5
> > - VERSION_BUILD  := $(shell date +"%s")
> > - VERSION_SUFFIX := .1
> > -
> > --SUBDIRS := tpmd tpmd_dev tddl
> > -+SUBDIRS := tpmd
> > -
> > - all: version all-recursive
> > -
> > -@@ -48,12 +48,12 @@ user_install: user
> > - modules_install: modules
> > -       @$(MAKE) -C tpmd_dev install || exit -1
> > -
> > --DIRS    := . tpm crypto tpmd tpmd_dev tddl tpmd_dev_openbsd
> > -+DIRS    := . tpm crypto tpmd
> > - DISTSRC := $(foreach dir, $(DIRS), $(wildcard $(dir)/*.c))
> > - DISTSRC += $(foreach dir, $(DIRS), $(wildcard $(dir)/*.h))
> > --DIRS    := . tpmd tpmd_dev tddl tpmd_dev_openbsd
> > -+DIRS    := . tpmd
> > - DISTSRC += $(foreach dir, $(DIRS), $(dir)/Makefile)
> > --DISTSRC += ./README ./AUTHORS ./ChangeLog tpmd_dev/tpmd_dev.rules.in
> > -+DISTSRC += ./README ./AUTHORS ./ChangeLog
> > - DISTDIR := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_SUFFIX)
> > -
> > - dist: $(DISTSRC)
> > -diff -Naurp tpm_emulator-0.5.1/tpm/tpm_capability.c tpm5-test/tpm/tpm_capability.c
> > ---- tpm_emulator-0.5.1/tpm/tpm_capability.c    2008-02-14 03:22:48.000000000 -0500
> > -+++ tpm5-test/tpm/tpm_capability.c     2009-07-16 12:04:20.000000000 -0400
> > -@@ -136,8 +136,19 @@ static TPM_RESULT cap_property(UINT32 su
> > -
> > -     case TPM_CAP_PROP_TIS_TIMEOUT:
> > -       debug("[TPM_CAP_PROP_TIS_TIMEOUT]");
> > --      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT */
> > --      return TPM_FAIL;
> > -+      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT: Measure these values and determine correct ones */
> > -+      UINT32 len = *respSize = 16;
> > -+      BYTE *ptr = *resp = tpm_malloc(*respSize);
> > -+      if (ptr == NULL ||
> > -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> > -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> > -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> > -+          tpm_marshal_UINT32(&ptr, &len, 200000)) {
> > -+        tpm_free(*resp);
> > -+        return TPM_FAIL;
> > -+      }
> > -+      return TPM_SUCCESS;
> > -+
> > -
> > -     case TPM_CAP_PROP_STARTUP_EFFECT:
> > -       debug("[TPM_CAP_PROP_STARTUP_EFFECT]");
> > -@@ -189,8 +200,12 @@ static TPM_RESULT cap_property(UINT32 su
> > -
> > -     case TPM_CAP_PROP_DURATION:
> > -       debug("[TPM_CAP_PROP_DURATION]");
> > --      /* TODO: TPM_CAP_PROP_DURATION */
> > --      return TPM_FAIL;
> > -+      /* TODO: TPM_CAP_PROP_DURATION: Measure these values and return accurate ones */
> > -+      BYTE dur[]= {0x0,0x0,0x0,0xc,0x0,0x7,0xa1,0x20,0x0,0x1e,0x84,0x80,0x11,0xe1,0xa3,0x0};
> > -+      *respSize = 16;
> > -+      *resp = tpm_malloc(*respSize);
> > -+      memcpy(*resp,dur,16);
> > -+
> > -
> > -     case TPM_CAP_PROP_ACTIVE_COUNTER:
> > -       debug("[TPM_CAP_PROP_ACTIVE_COUNTER]");
> > -diff -Naurp tpm_emulator-0.5.1/tpmd/Makefile tpm5-test/tpmd/Makefile
> > ---- tpm_emulator-0.5.1/tpmd/Makefile   2008-02-14 03:22:48.000000000 -0500
> > -+++ tpm5-test/tpmd/Makefile    2009-07-16 12:08:26.000000000 -0400
> > -@@ -8,9 +8,10 @@ WFLAGS  := -Wall -Wno-unused -Wpointer-a
> > -            -Wwrite-strings -Wsign-compare -Wno-multichar
> > -            #WFLAGS  += -Wextra -Wcast-qual -Wmissing-prototypes -Wmissing-declarations -Wstrict-aliasing
> > - CFLAGS  += $(WFLAGS) -g -I.. -I. -O2 -fno-strict-aliasing
> > -+CFLAGS  += -I../../../../tools/vtpm_manager/manager
> > - LDFLAGS += -lgmp
> > -
> > --BINDIR  := /usr/sbin/
> > -+BINDIR  := /usr/bin/
> > -
> > - TPMD    := tpmd
> > - DIRS    := ../tpm ../crypto
> > -@@ -18,6 +19,8 @@ SRCS    := $(foreach dir, $(DIRS), $(wil
> > - OBJS    := $(patsubst %.c, %.o, $(SRCS))
> > - OBJS    := $(foreach dir, $(DIRS), $(patsubst $(dir)/%.o, %.o, $(filter $(dir)/%.o, $(OBJS))))
> > -
> > -+VTPM_BIN := vtpmd
> > -+
> > - vpath %.c $(strip $(DIRS))
> > -
> > - all: $(TPMD)
> > -@@ -32,10 +35,8 @@ TPMD_GROUP ?= tss
> > - INSTALL    ?= install
> > -
> > - install: $(TPMD)
> > --      $(INSTALL) -m 755 -o $(TPMD_USER) -g $(TPMD_GROUP) -d $(DESTDIR)/var/lib/tpm
> > --      $(INSTALL) -m 755 -o $(TPMD_USER) -g $(TPMD_GROUP) -d $(DESTDIR)/var/run/tpm
> > -       $(INSTALL) -D -d $(DESTDIR)/$(BINDIR)
> > --      $(INSTALL) -m 755 $(TPMD) $(DESTDIR)/$(BINDIR)
> > -+      $(INSTALL) -m 755 $(TPMD) $(DESTDIR)/$(BINDIR)/$(VTPM_BIN)
> > -
> > - .PHONY: all clean install
> > -
> > -diff -Naurp tpm_emulator-0.5.1/tpmd/tpmd.c tpm5-test/tpmd/tpmd.c
> > ---- tpm_emulator-0.5.1/tpmd/tpmd.c     2008-02-14 03:22:48.000000000 -0500
> > -+++ tpm5-test/tpmd/tpmd.c      2009-07-16 11:19:05.000000000 -0400
> > -@@ -32,6 +32,9 @@
> > - #include <grp.h>
> > - #include "tpm_emulator_config.h"
> > - #include "tpm/tpm_emulator.h"
> > -+#include "tpm/tpm_structures.h"
> > -+#include "tpm/tpm_marshalling.h"
> > -+#include "vtpm_manager.h"
> > -
> > - #define TPM_DAEMON_NAME     "tpmd"
> > - #define TPM_CMD_BUF_SIZE    4096
> > -@@ -39,6 +42,24 @@
> > - #define TPM_RANDOM_DEVICE   "/dev/urandom"
> > - #undef  TPM_MKDIRS
> > -
> > -+#ifdef VTPM_MULTI_VM
> > -+ #define DEV_BE "/dev/vtpm"
> > -+ #define DEV_FE "/dev/tpm"
> > -+#else
> > -+ #define PVM_RX_FIFO_D "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
> > -+ #define PVM_TX_FIFO "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
> > -+ #define HVM_RX_FIFO_D "/var/vtpm/socks/%d.socket"
> > -+
> > -+ #define VTPM_RX_FIFO_D "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
> > -+ #define VTPM_TX_FIFO "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
> > -+
> > -+ static char *vtpm_rx_name=NULL;
> > -+#endif
> > -+
> > -+ static int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> > -+
> > -+#define BUFFER_SIZE 2048
> > -+
> > - static volatile int stopflag = 0;
> > - static int is_daemon = 0;
> > - static int opt_debug = 0;
> > -@@ -49,6 +70,8 @@ static const char *opt_storage_file = "/
> > - static uid_t opt_uid = 0;
> > - static gid_t opt_gid = 0;
> > - static int tpm_startup = 2;
> > -+static int vtpm_type = VTPM_TYPE_PVM;
> > -+int dmi_id = 0;
> > - static int rand_fh;
> > -
> > - void tpm_log(int priority, const char *fmt, ...)
> > -@@ -90,56 +113,241 @@ uint64_t tpm_get_ticks(void)
> > -
> > - int tpm_write_to_file(uint8_t *data, size_t data_length)
> > - {
> > --    int fh;
> > --    ssize_t res;
> > --    fh = open(opt_storage_file, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> > --    if (fh < 0) return -1;
> > --    while (data_length > 0) {
> > --        res = write(fh, data, data_length);
> > --      if (res < 0) {
> > --          close(fh);
> > --          return -1;
> > --      }
> > --      data_length -= res;
> > --      data += res;
> > -+  int res, out_data_size, in_header_size;
> > -+  BYTE *ptr, *out_data, *in_header;
> > -+  UINT32 result, len, in_rsp_size;
> > -+  UINT16 tag = VTPM_TAG_REQ;
> > -+
> > -+  printf("Saving NVM\n");
> > -+  if (vtpm_tx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> > -+#else
> > -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> > -+#endif
> > -+  }
> > -+
> > -+  if (vtpm_tx_fh < 0) {
> > -+              return -1;
> > -+  }
> > -+
> > -+  // Send request to VTPM Manager to encrypt data
> > -+#ifdef VTPM_MUTLI_VM
> > -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT + data_length;
> > -+#else
> > -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV + data_length;
> > -+#endif
> > -+
> > -+  out_data = ptr = (BYTE *) malloc(len);
> > -+
> > -+  if (ptr == NULL
> > -+#ifndef VTPM_MUTLI_VM
> > -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> > -+#endif
> > -+        || tpm_marshal_UINT16(&ptr, &len, tag)
> > -+#ifdef VTPM_MUTLI_VM
> > -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> > -+#else
> > -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> > -+#endif
> > -+        || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_SAVENVM)
> > -+        || tpm_marshal_BYTE_ARRAY(&ptr, &len, data, data_length)) {
> > -+      free(out_data);
> > -+      return -1;
> > -+  }
> > -+
> > -+  printf("\tSending SaveNVM Command.\n");
> > -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> > -+  free(out_data);
> > -+  if (res != out_data_size) return -1;
> > -+
> > -+  if (vtpm_rx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+    vtpm_rx_fh = vtpm_tx_fh
> > -+#else
> > -+    if (vtpm_rx_name == NULL) {
> > -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> > -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> > -     }
> > --    close(fh);
> > --    return 0;
> > -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> > -+#endif
> > -+  }
> > -+
> > -+  if (vtpm_rx_fh < 0) {
> > -+              return -1;
> > -+  }
> > -+
> > -+  // Read Header of response so we can get the size & status
> > -+#ifdef VTPM_MUTLI_VM
> > -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> > -+#else
> > -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> > -+#endif
> > -+  in_header = ptr = malloc(in_header_size);
> > -+
> > -+  printf("\tReading SaveNVM header.\n");
> > -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> > -+
> > -+  if ( (res != in_header_size)
> > -+#ifndef VTPM_MUTLI_VM
> > -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> > -+#endif
> > -+         || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> > -+         || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> > -+         || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> > -+        free(in_header);
> > -+        return -1;
> > -+  }
> > -+  free(in_header);
> > -+
> > -+  if (result != VTPM_SUCCESS) {
> > -+      return -1;
> > -+  }
> > -+
> > -+#ifdef VTPM_MUTLI_VM
> > -+  close(vtpm_tx_fh); close(vtpm_rx_fh);
> > -+#endif
> > -+
> > -+  printf("\tFinishing up SaveNVM\n");
> > -+  return (0);
> > - }
> > -
> > - int tpm_read_from_file(uint8_t **data, size_t *data_length)
> > - {
> > --    int fh;
> > --    ssize_t res;
> > --    size_t total_length;
> > --    fh = open(opt_storage_file, O_RDONLY);
> > --    if (fh < 0) return -1;
> > --    total_length = lseek(fh, 0, SEEK_END);
> > --    lseek(fh, 0, SEEK_SET);
> > --    *data = tpm_malloc(total_length);
> > --    if (*data == NULL) {
> > --        close(fh);
> > --        return -1;
> > --    }
> > --    *data_length = 0;
> > --    while (total_length > 0) {
> > --        res = read(fh, &(*data)[*data_length], total_length);
> > --      if (res < 0) {
> > --          close(fh);
> > --          tpm_free(*data);
> > --          return -1;
> > --      }
> > --        *data_length += res;
> > --      total_length -= res;
> > -+  int res, out_data_size, in_header_size;
> > -+  uint8_t *ptr, *out_data, *in_header;
> > -+  UINT16 tag = VTPM_TAG_REQ;
> > -+  UINT32 len, in_rsp_size, result;
> > -+#ifdef VTPM_MUTLI_VM
> > -+      int vtpm_rx_fh, vtpm_tx_fh;
> > -+#endif
> > -+
> > -+  printf("Loading NVM.\n");
> > -+  if (vtpm_tx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> > -+#else
> > -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> > -+#endif
> > -+  }
> > -+
> > -+  if (vtpm_tx_fh < 0) {
> > -+      printf("Error in read_from_file:301\n");
> > -+              return -1;
> > -+  }
> > -+
> > -+  // Send request to VTPM Manager to encrypt data
> > -+#ifdef VTPM_MUTLI_VM
> > -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> > -+#else
> > -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> > -+#endif
> > -+  out_data = ptr = (BYTE *) malloc(len);
> > -+
> > -+  if (ptr == NULL
> > -+#ifndef VTPM_MUTLI_VM
> > -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> > -+#endif
> > -+      || tpm_marshal_UINT16(&ptr, &len, tag)
> > -+#ifdef VTPM_MUTLI_VM
> > -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> > -+#else
> > -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> > -+#endif
> > -+      || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_LOADNVM)) {
> > -+    free(out_data);
> > -+    printf("Error in read_from_file:325\n");
> > -+
> > -+    return -1;
> > -+  }
> > -+
> > -+  printf("\tSending LoadNVM command\n");
> > -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> > -+  free(out_data);
> > -+  if (res != out_data_size)
> > -+    {
> > -+      printf("Error in read_from_file:335\n");
> > -+      return -1;
> > -+    }
> > -+
> > -+    if (vtpm_rx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+    vtpm_rx_fh = vtpm_tx_fh;
> > -+#else
> > -+    if (vtpm_rx_name == NULL) {
> > -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> > -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> > -     }
> > --    close(fh);
> > --    return 0;
> > -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> > -+#endif
> > -+  }
> > -+
> > -+  if (vtpm_rx_fh < 0) {
> > -+      printf("Error in read_from_file:352\n");
> > -+      return -1;
> > -+  }
> > -+
> > -+  // Read Header of response so we can get the size & status
> > -+#ifdef VTPM_MUTLI_VM
> > -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> > -+#else
> > -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> > -+#endif
> > -+  in_header = ptr = malloc(in_header_size);
> > -+
> > -+  printf("\tReading LoadNVM header\n");
> > -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> > -+
> > -+  if ( (res != in_header_size)
> > -+#ifndef VTPM_MUTLI_VM
> > -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> > -+#endif
> > -+       || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> > -+       || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> > -+       || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> > -+      free(in_header);
> > -+      printf("Error in read_from_file:375\n");
> > -+      return -1;
> > -+  }
> > -+  free(in_header);
> > -+
> > -+  if (result != VTPM_SUCCESS) {
> > -+    printf("Error in read_from_file:381\n");
> > -+    return -1;
> > -+  }
> > -+
> > -+  // Read Encrypted data from VTPM Manager
> > -+  *data_length = in_rsp_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> > -+  *data = (uint8_t *) malloc(*data_length);
> > -+
> > -+  printf("\tReading clear data from LoadNVM.\n");
> > -+  res = read(vtpm_rx_fh, *data, *data_length);
> > -+#ifdef VTPM_MUTLI_VM
> > -+  close(vtpm_rx_fh);close(vtpm_tx_fh);
> > -+#endif
> > -+
> > -+  printf("\tReturing from loading NVM\n");
> > -+  if (res != (int)*data_length) {
> > -+      free(*data);
> > -+      printf("Error in read_from_file:398\n");
> > -+      return -1;
> > -+  } else {
> > -+      return 0;
> > -+  }
> > -+
> > -+
> > -+
> > - }
> > -
> > - static void print_usage(char *name)
> > - {
> > -     printf("usage: %s [-d] [-f] [-s storage file] [-u unix socket name] "
> > --           "[-o user name] [-g group name] [-h] [startup mode]\n", name);
> > -+           "[-o user name] [-g group name] [-h]"
> > -+#ifdef VTPM_MULTI_VM
> > -+         "clear|save|deactivated\n", name);
> > -+#else
> > -+         "clear|save|deactivated pvm|hvm vtpmid\n", name);
> > -+#endif
> > -     printf("  d : enable debug mode\n");
> > -     printf("  f : forces the application to run in the foreground\n");
> > -     printf("  s : storage file to use (default: %s)\n", opt_storage_file);
> > -@@ -205,7 +413,13 @@ static void parse_options(int argc, char
> > -                 exit(EXIT_SUCCESS);
> > -         }
> > -     }
> > --    if (optind < argc) {
> > -+    /*Make sure we have all required options*/
> > -+#ifdef VTPM_MULTI_VM
> > -+#define EXTRA_OPTS 0
> > -+#else
> > -+#define EXTRA_OPTS 2
> > -+#endif
> > -+    if (optind < argc - EXTRA_OPTS ) {
> > -         debug("startup mode = '%s'", argv[optind]);
> > -         if (!strcmp(argv[optind], "clear")) {
> > -             tpm_startup = 1;
> > -@@ -219,6 +433,25 @@ static void parse_options(int argc, char
> > -             print_usage(argv[0]);
> > -             exit(EXIT_SUCCESS);
> > -         }
> > -+#ifndef VTPM_MULTI_VM
> > -+        ++optind;
> > -+      if(!strcmp(argv[optind], "pvm")) {
> > -+              vtpm_type = VTPM_TYPE_PVM;      // Get commands from vTPM Manager through fifo
> > -+      } else if (!strcmp(argv[optind], "hvm")) {
> > -+              vtpm_type = VTPM_TYPE_HVM;      // Get commands from qemu via socket
> > -+        } else {
> > -+              error("Invalid vm mode '%s'; must be 'pvm', "
> > -+                      "or 'hvm' ", argv[optind]);
> > -+              print_usage(argv[0]);
> > -+              exit(EXIT_SUCCESS);
> > -+      }
> > -+        ++optind;
> > -+      dmi_id = atoi(argv[optind]);
> > -+#endif
> > -+    } else {
> > -+      error("Invalid number of arguments");
> > -+      print_usage(argv[0]);
> > -+      exit(EXIT_SUCCESS);
> > -     }
> > - }
> > -
> > -@@ -348,93 +581,180 @@ static int init_socket(const char *name)
> > -
> > - static void main_loop(void)
> > - {
> > --    int sock, fh, res;
> > --    int32_t in_len;
> > -+    int32_t in_len, written;
> > -     uint32_t out_len;
> > --    uint8_t in[TPM_CMD_BUF_SIZE], *out;
> > -+    uint8_t in[TPM_CMD_BUF_SIZE], *out, *addressed_out;
> > -+    int guest_id=-1;
> > -+    int i;
> > -+    char *vtpm_rx_file=NULL;
> > -+    int res;
> > -+
> > -+#ifndef VTPM_MULTI_VM
> > -+    int sockfd = -1;
> > -     struct sockaddr_un addr;
> > --    socklen_t addr_len;
> > --    fd_set rfds;
> > --    struct timeval tv;
> > -+    struct sockaddr_un client_addr;
> > -+    unsigned int client_length;
> > -+#endif
> > -+
> > -+    int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> > -+
> > -+#ifndef VTPM_MULTI_VM
> > -+  if (vtpm_type == VTPM_TYPE_PVM) {
> > -+    vtpm_rx_file = malloc(10 + strlen(PVM_RX_FIFO_D));
> > -+    sprintf(vtpm_rx_file, PVM_RX_FIFO_D, (uint32_t) dmi_id);
> > -+  } else {
> > -+    vtpm_rx_file = malloc(10 + strlen(HVM_RX_FIFO_D));
> > -+    sprintf(vtpm_rx_file, HVM_RX_FIFO_D, (uint32_t) dmi_id);
> > -+
> > -+    if ( (sockfd = socket(PF_UNIX,SOCK_STREAM,0)) < 0) {
> > -+          error("Unable to create socket. errno = %d\n", errno);
> > -+      exit (-1);
> > -+    }
> > -+
> > -+    memset(&addr, 0, sizeof(addr));
> > -+    addr.sun_family = AF_UNIX;
> > -+    strcpy(addr.sun_path,vtpm_rx_file );
> > -+    unlink(addr.sun_path);
> > -+  }
> > -+#endif
> > -
> > -     info("staring main loop");
> > --    /* open UNIX socket */
> > --    sock = init_socket(opt_socket_name);
> > --    if (sock < 0) exit(EXIT_FAILURE);
> > -     /* init tpm emulator */
> > --    debug("initializing TPM emulator: %d", tpm_startup);
> > -+#ifdef VTPM_MULTI_VM
> > -+    debug("initializing TPM emulator: state=%d", tpm_startup);
> > -+#else
> > -+    debug("initializing TPM emulator: state=%d, type=%d, id=%d", tpm_startup, vtpm_type, dmi_id);
> > -+#endif
> > -     tpm_emulator_init(tpm_startup);
> > -     /* start command processing */
> > -     while (!stopflag) {
> > -         /* wait for incomming connections */
> > -         debug("waiting for connections...");
> > --        FD_ZERO(&rfds);
> > --        FD_SET(sock, &rfds);
> > --        tv.tv_sec = 10;
> > --        tv.tv_usec = 0;
> > --        res = select(sock + 1, &rfds, NULL, NULL, &tv);
> > --        if (res < 0) {
> > --            error("select(sock) failed: %s", strerror(errno));
> > --            break;
> > --        } else if (res == 0) {
> > --            continue;
> > --        }
> > --        addr_len = sizeof(addr);
> > --        fh = accept(sock, (struct sockaddr*)&addr, &addr_len);
> > --        if (fh < 0) {
> > --            error("accept() failed: %s", strerror(errno));
> > --            continue;
> > --        }
> > -+      if (vtpm_rx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+          vtpm_rx_fh = open(DEV_BE, O_RDWR);
> > -+#else
> > -+          if (vtpm_type == VTPM_TYPE_PVM)
> > -+          {
> > -+              vtpm_rx_fh = open(vtpm_rx_file, O_RDONLY);
> > -+          } else {
> > -+              if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
> > -+                  error("Unable to bind(). errno = %d\n", errno);
> > -+                  exit (-1);
> > -+              }
> > -+
> > -+              if (listen(sockfd, 10) <0) {
> > -+                  error("Unable to listen(). errno = %d\n", errno);
> > -+                  exit (-1);
> > -+              }
> > -+
> > -+               memset(&client_addr, 0, sizeof(client_addr));
> > -+               client_length = sizeof(client_addr);
> > -+
> > -+               vtpm_rx_fh = vtpm_tx_fh = accept(sockfd, (struct sockaddr *)&client_addr, &client_length);
> > -+          }
> > -+#endif
> > -+      }
> > -+
> > -+      /*Error Checking*/
> > -+      if (vtpm_rx_fh < 0) {
> > -+        error("Failed to open devices to listen to guest.\n");
> > -+        exit(-1);
> > -+      }
> > -+
> > -         /* receive and handle commands */
> > -         in_len = 0;
> > -         do {
> > -             debug("waiting for commands...");
> > --            FD_ZERO(&rfds);
> > --            FD_SET(fh, &rfds);
> > --            tv.tv_sec = TPM_COMMAND_TIMEOUT;
> > --            tv.tv_usec = 0;
> > --            res = select(fh + 1, &rfds, NULL, NULL, &tv);
> > --            if (res < 0) {
> > --                error("select(fh) failed: %s", strerror(errno));
> > --                close(fh);
> > --                break;
> > --            } else if (res == 0) {
> > --#ifdef TPMD_DISCONNECT_IDLE_CLIENTS
> > --                info("connection closed due to inactivity");
> > --                close(fh);
> > --                break;
> > --#else
> > --                continue;
> > --#endif
> > --            }
> > --            in_len = read(fh, in, sizeof(in));
> > --            if (in_len > 0) {
> > -+
> > -+            in_len = read(vtpm_rx_fh, in, sizeof(in));
> > -+          /*Magic size of minimum TPM command is 6*/
> > -+              //FIXME Magic size check may not be required anymore
> > -+            if (in_len < 6) {
> > -+              info("Recv incomplete command of %d bytes.", in_len);
> > -+              if (in_len <= 0) {
> > -+                  close(vtpm_rx_fh);
> > -+                  vtpm_rx_fh = -1;
> > -+                  continue;
> > -+                 }
> > -+          } else {
> > -+              /*Debug Printouts*/
> > -                 debug("received %d bytes", in_len);
> > -+              debug_nostop("Recv[%d]: 0x", in_len);
> > -+              for (i=0; i< in_len; i++)
> > -+                  debug_more("%x ", in[i]);
> > -+              debug_more("\n");
> > -+              /*Multiple Guest check*/
> > -+              if (guest_id == -1) {
> > -+                  guest_id = *((int32_t *) in);
> > -+              } else {
> > -+                  if (guest_id != *((int32_t *) in) ) {
> > -+                      error("WARNING: More than one guest attached\n");
> > -+                  }
> > -+              }
> > -+
> > -+              /*Open tx handle now*/
> > -+              if (vtpm_tx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+                  vtpm_tx_fh = open(DEV_BE, O_RDWR);
> > -+                  vtpm_rx_fh = vtpm_tx_fh;
> > -+#else
> > -+                  if (vtpm_type == VTPM_TYPE_PVM) {
> > -+                      vtpm_tx_fh = open(PVM_TX_FIFO, O_WRONLY);
> > -+                  } // No need to open the other direction for HVM
> > -+#endif
> > -+              }
> > -+              if (vtpm_tx_fh < 0) {
> > -+                error("Failed to open devices to respond to guest.\n");
> > -+                exit(-1);
> > -+              }
> > -+
> > -+              /*Handle the TPM command now*/
> > -                 out = NULL;
> > --                res = tpm_handle_command(in, in_len, &out, &out_len);
> > -+                res = tpm_handle_command(in + sizeof(uint32_t), in_len - sizeof(uint32_t), &out, &out_len);
> > -                 if (res < 0) {
> > -                     error("tpm_handle_command() failed");
> > -                 } else {
> > -                     debug("sending %d bytes", out_len);
> > -+                  //FIXME this prepending may or may not be needed
> > -+                  /*Prepend the first 4 bytes of the in buffer.. why?*/
> > -+                  addressed_out = (uint8_t *) tpm_malloc(sizeof(uint32_t) + out_len);
> > -+                  *(uint32_t *) addressed_out = *(uint32_t *) in;
> > -+                  memcpy(addressed_out + sizeof(uint32_t), out, out_len);
> > -+                  out_len += sizeof(uint32_t);
> > -+                  /*End Prepend*/
> > -+
> > -+                  /*Perform write operation now*/
> > -                     while (out_len > 0) {
> > --                        res = write(fh, out, out_len);
> > -+                        res = write(vtpm_tx_fh, addressed_out, out_len);
> > -+
> > -                         if (res < 0) {
> > -                             error("write(%d) failed: %s", out_len, strerror(errno));
> > -                             break;
> > --                        }
> > -+                        } else {
> > -+                        debug_nostop("Sent[%Zu]: ", out_len);
> > -+                        for (i=0; (unsigned int)i< out_len; i++)
> > -+                          debug_more("%x ", addressed_out[i]);
> > -+                        debug_more("\n");
> > -+                      }
> > -                         out_len       -= res;
> > -                     }
> > -                     tpm_free(out);
> > -+                  tpm_free(addressed_out);
> > -                 }
> > -             }
> > -         } while (in_len > 0);
> > --        close(fh);
> > -+        //close(fh);
> > -     }
> > -+
> > -     /* shutdown tpm emulator */
> > -     tpm_emulator_shutdown();
> > --    /* close socket */
> > --    close(sock);
> > --    unlink(opt_socket_name);
> > -+    /* Close handles */
> > -+    close(vtpm_tx_fh);
> > -+#ifndef VTPM_MULTI_VM
> > -+    close(vtpm_rx_fh);
> > -+    free(vtpm_rx_file);
> > -+#endif
> > -     info("main loop stopped");
> > - }
> > -
> > -@@ -450,12 +770,13 @@ int main(int argc, char **argv)
> > -     /* open random device */
> > -     init_random();
> > -     /* init signal handlers */
> > --    init_signal_handler();
> > -+    //init_signal_handler();
> > -     /* unless requested otherwiese, fork and daemonize process */
> > --    if (!opt_foreground) daemonize();
> > -+    //if (!opt_foreground) daemonize();
> > -     /* start main processing loop */
> > -     main_loop();
> > -     info("stopping TPM Emulator daemon");
> > -     closelog();
> > -     return 0;
> > - }
> > -+
> > -diff -Naurp tpm_emulator-0.5.1/tpmd/tpm_emulator_config.h tpm5-test/tpmd/tpm_emulator_config.h
> > ---- tpm_emulator-0.5.1/tpmd/tpm_emulator_config.h      2008-02-14 03:22:48.000000000 -0500
> > -+++ tpm5-test/tpmd/tpm_emulator_config.h       2009-07-16 11:25:26.000000000 -0400
> > -@@ -29,23 +29,28 @@
> > -
> > - /* TPM emulator configuration */
> > -
> > --#undef  TPM_STRONG_PERSISTENCE
> > --#undef  TPM_GENERATE_EK
> > -+#define  TPM_STRONG_PERSISTENCE
> > -+#define  TPM_GENERATE_EK
> > - #undef  TPM_GENERATE_SEED_DAA
> > - #undef  TPM_MEMORY_ALIGNMENT_MANDATORY
> > -
> > -+extern int dmi_id;
> > -+
> > - /* log macros */
> > -
> > - void tpm_log(int priority, const char *fmt, ...);
> > -
> > --#define debug(fmt, ...) tpm_log(LOG_DEBUG, "%s:%d: Debug: " fmt "\n", \
> > --                                __FILE__, __LINE__, ## __VA_ARGS__)
> > --#define info(fmt, ...)  tpm_log(LOG_INFO, "%s:%d: Info: " fmt "\n", \
> > --                                __FILE__, __LINE__, ## __VA_ARGS__)
> > --#define error(fmt, ...) tpm_log(LOG_ERR, "%s:%d: Error: " fmt "\n", \
> > --                                __FILE__, __LINE__, ## __VA_ARGS__)
> > --#define alert(fmt, ...) tpm_log(LOG_ALERT, "%s:%d: Alert: " fmt "\n", \
> > --                                __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define debug(fmt, ...) tpm_log(LOG_DEBUG, "VTPMD[%d]: %s:%d: Debug: " fmt "\n", \
> > -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define info(fmt, ...)  tpm_log(LOG_INFO, "VTPMD[%d]: %s:%d: Info: " fmt "\n", \
> > -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define error(fmt, ...) tpm_log(LOG_ERR, "VTPMD[%d]: %s:%d: Error: " fmt "\n", \
> > -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define alert(fmt, ...) tpm_log(LOG_ALERT, "VTPMD[%d]: %s:%d: Alert: " fmt "\n", \
> > -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define debug_nostop(fmt, ...) tpm_log(LOG_DEBUG, "VTPMD[%d]: %s:%d: Debug: " fmt, \
> > -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define debug_more(fmt, ...) tpm_log(LOG_DEBUG, fmt, ## __VA_ARGS__)
> > -
> > - /*  min/max macros that also do strict type-checking */
> > -
> > diff --git a/tools/vtpm/vtpm.patch b/tools/vtpm/vtpm.patch
> > deleted file mode 100644
> > index e896b25..0000000
> > --- a/tools/vtpm/vtpm.patch
> > +++ /dev/null
> > @@ -1,716 +0,0 @@
> > -diff -uprN tpm_emulator/AUTHORS vtpm/AUTHORS
> > ---- tpm_emulator/AUTHORS       2006-12-08 12:51:29.000000000 -0800
> > -+++ vtpm/AUTHORS       2006-12-13 16:38:52.000000000 -0800
> > -@@ -1,3 +1,3 @@
> > - Mario Strasser <mast@gmx.net>
> > - Heiko Stamer <stamer@gaos.org> [DAA]
> > --INTEL Corp <> [Dropped to Ring3]
> > -+INTEL Corp <> [VTPM Extensions]
> > -diff -uprN tpm_emulator/ChangeLog vtpm/ChangeLog
> > ---- tpm_emulator/ChangeLog     2006-12-08 12:51:29.000000000 -0800
> > -+++ vtpm/ChangeLog     2006-12-13 16:38:52.000000000 -0800
> > -@@ -1,5 +1,6 @@
> > - ????-??-?? Intel Corp
> > -       * Moved module out of kernel to run as a ring 3 app
> > -+      * Modified save_to_file and load_from_file to call xen VTPM manager
> > -
> > - 2006-06-23  Mario Strasser <mast@gmx.net>
> > -       * tpm_startup.c: behaviour of ST_CLEAR and storage of
> > -diff -uprN tpm_emulator/linux_module.h vtpm/linux_module.h
> > ---- tpm_emulator/linux_module.h        2006-12-08 12:51:29.000000000 -0800
> > -+++ vtpm/linux_module.h        2007-01-09 14:49:06.000000000 -0800
> > -@@ -44,18 +44,26 @@
> > - #define TPM_DEVICE_NAME   "tpm"
> > - #define TPM_MODULE_NAME   "tpm_emulator"
> > -
> > -+/* debug and log output functions */
> > -+extern int dmi_id;
> > -+
> > - #ifdef DEBUG
> > --#define debug(fmt, ...) printf("TPMD: %s:%d: Debug: " fmt "\n", \
> > --                        __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define debug(fmt, ...) printf("TPMD[%d]: %s:%d: Debug: " fmt "\n", \
> > -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define debug_nostop(fmt, ...) printf("TPMD[%d]: %s:%d: Debug: " fmt, \
> > -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define debug_more(fmt, ...) printf( fmt, ## __VA_ARGS__ )
> > - #else
> > - #define debug(fmt, ...)
> > -+#define debug_nostop(fmt, ...)
> > -+#define debug_more(fmt, ...)
> > - #endif
> > --#define info(fmt, ...)  printf("TPMD: %s:%d: Info: " fmt "\n", \
> > --                        __FILE__, __LINE__, ## __VA_ARGS__)
> > --#define error(fmt, ...) printf("TPMD: %s:%d: Error: " fmt "\n", \
> > --                        __FILE__, __LINE__, ## __VA_ARGS__)
> > --#define alert(fmt, ...) printf("TPMD: %s:%d: Alert: " fmt "\n", \
> > --                        __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define info(fmt, ...)  printf("TPMD[%d]: %s:%d: Info: " fmt "\n", \
> > -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define error(fmt, ...) printf("TPMD[%d]: %s:%d: Error: " fmt "\n", \
> > -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define alert(fmt, ...) printf("TPMD[%d]: %s:%d: Alert: " fmt "\n", \
> > -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -
> > - /* memory allocation */
> > -
> > -diff -uprN tpm_emulator/Makefile vtpm/Makefile
> > ---- tpm_emulator/Makefile      2006-12-08 12:51:29.000000000 -0800
> > -+++ vtpm/Makefile      2006-12-13 16:38:52.000000000 -0800
> > -@@ -7,7 +7,7 @@
> > - COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
> > -
> > - # module settings
> > --BIN            := tpm_emulator
> > -+BIN            := vtpmd
> > - VERSION_MAJOR  := 0
> > - VERSION_MINOR  := 4
> > - VERSION_BUILD  := $(shell date +"%s")
> > -@@ -22,7 +22,7 @@ TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin
> > -
> > - CC      := gcc
> > - CFLAGS  += -g -Wall $(INCLUDE) -DDEBUG
> > --CFLAGS  += -I. -Itpm
> > -+CFLAGS  += -I. -Itpm -I../../vtpm_manager/manager
> > -
> > - # Is the simulator running in it's own vm?
> > - #CFLAGS += -DVTPM_MULTI_VM
> > -@@ -62,7 +62,6 @@ $(BIN):      $(src)/crypto/gmp.h $(src)/crypt
> > -
> > - install: $(BIN)
> > -       $(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)
> > --      @if [ ! -d "/var/tpm" ]; then mkdir /var/tpm; fi
> > -
> > - clean:
> > -       rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a $(OBJS)
> > -@@ -98,3 +97,4 @@ version:
> > -       @echo "#endif /* _TPM_VERSION_H_ */" >> $(src)/tpm_version.h
> > -
> > - .PHONY: all install clean dist gmp version
> > -+
> > -diff -uprN tpm_emulator/tpm/tpm_capability.c vtpm/tpm/tpm_capability.c
> > ---- tpm_emulator/tpm/tpm_capability.c  2006-06-23 03:37:07.000000000 -0700
> > -+++ vtpm/tpm/tpm_capability.c  2007-01-10 10:00:49.000000000 -0800
> > -@@ -136,8 +136,18 @@ static TPM_RESULT cap_property(UINT32 su
> > -
> > -     case TPM_CAP_PROP_TIS_TIMEOUT:
> > -       debug("[TPM_CAP_PROP_TIS_TIMEOUT]");
> > --      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT */
> > --      return TPM_FAIL;
> > -+      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT: Measure these values and determine correct ones */
> > -+      UINT32 len = *respSize = 16;
> > -+      BYTE *ptr = *resp = tpm_malloc(*respSize);
> > -+      if (ptr == NULL ||
> > -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> > -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> > -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> > -+          tpm_marshal_UINT32(&ptr, &len, 200000)) {
> > -+        tpm_free(*resp);
> > -+        return TPM_FAIL;
> > -+      }
> > -+      return TPM_SUCCESS;
> > -
> > -     case TPM_CAP_PROP_STARTUP_EFFECT:
> > -       debug("[TPM_CAP_PROP_STARTUP_EFFECT]");
> > -@@ -190,7 +200,11 @@ static TPM_RESULT cap_property(UINT32 su
> > -
> > -     case TPM_CAP_PROP_DURATION:
> > -       debug("[TPM_CAP_PROP_DURATION]");
> > --      /* TODO: TPM_CAP_PROP_DURATION */
> > -+      /* TODO: TPM_CAP_PROP_DURATION: Measure these values and return accurate ones */
> > -+      BYTE dur[]= {0x0,0x0,0x0,0xc,0x0,0x7,0xa1,0x20,0x0,0x1e,0x84,0x80,0x11,0xe1,0xa3,0x0};
> > -+      *respSize = 16;
> > -+      *resp = tpm_malloc(*respSize);
> > -+      memcpy(*resp,dur,16);
> > -       return TPM_FAIL;
> > -
> > -     case TPM_CAP_PROP_ACTIVE_COUNTER:
> > -diff -uprN tpm_emulator/tpm/tpm_cmd_handler.c vtpm/tpm/tpm_cmd_handler.c
> > ---- tpm_emulator/tpm/tpm_cmd_handler.c 2008-02-27 16:35:41.000000000 -0500
> > -+++ vtpm/tpm/tpm_cmd_handler.c 2008-02-28 14:43:28.000000000 -0500
> > -@@ -94,12 +94,18 @@ void tpm_compute_out_param_digest(TPM_CO
> > -   sha1_ctx_t sha1;
> > -   UINT32 res = CPU_TO_BE32(rsp->result);
> > -   UINT32 ord = CPU_TO_BE32(ordinal);
> > -+  UINT32 offset = 0;
> > -
> > -   /* compute SHA1 hash */
> > -   sha1_init(&sha1);
> > -   sha1_update(&sha1, (BYTE*)&res, 4);
> > -   sha1_update(&sha1, (BYTE*)&ord, 4);
> > --  sha1_update(&sha1, rsp->param, rsp->paramSize);
> > -+  if (ordinal == TPM_ORD_LoadKey2) {
> > -+      offset = 4;
> > -+  }
> > -+  if (rsp->paramSize - offset > 0) {
> > -+      sha1_update(&sha1, rsp->param + offset, rsp->paramSize - offset);
> > -+  }
> > -   sha1_final(&sha1, rsp->auth1->digest);
> > -   if (rsp->auth2 != NULL) memcpy(rsp->auth2->digest,
> > -     rsp->auth1->digest, sizeof(rsp->auth1->digest));
> > -diff -uprN tpm_emulator/tpm/tpm_data.c vtpm/tpm/tpm_data.c
> > ---- tpm_emulator/tpm/tpm_data.c        2008-02-27 16:35:41.000000000 -0500
> > -+++ vtpm/tpm/tpm_data.c        2008-02-27 16:35:40.000000000 -0500
> > -@@ -1,6 +1,7 @@
> > - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> > -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> > -+ * Copyright (C) 2005 INTEL Corp
> > -  *
> > -  * This module is free software; you can redistribute it and/or modify
> > -  * it under the terms of the GNU General Public License as published
> > -@@ -15,10 +16,15 @@
> > -  * $Id: tpm_data.c 98 2006-05-07 14:16:29Z hstamer $
> > -  */
> > -
> > -+#include <sys/types.h>
> > -+#include <sys/stat.h>
> > -+#include <fcntl.h>
> > -+#include <unistd.h>
> > -+
> > - #include "tpm_emulator.h"
> > - #include "tpm_structures.h"
> > - #include "tpm_marshalling.h"
> > --#include "linux_module.h"
> > -+#include "vtpm_manager.h"
> > -
> > - TPM_DATA tpmData;
> > -
> > -@@ -158,45 +164,232 @@ void tpm_release_data(void)
> > - #include <sys/types.h>
> > - #include <sys/stat.h>
> > - #include <fcntl.h>
> > --#include <unistd.h>
> > -
> > --#define TPM_STORAGE_FILE "/var/tpm/tpm_emulator-1.2." STR(VERSION_MAJOR) "." STR(VERSION_MINOR)
> > -+ static int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> > -+
> > -+#ifdef VTPM_MUTLI_VM
> > -+ #define DEV_FE "/dev/tpm"
> > -+#else
> > -+ #define VTPM_RX_FIFO_D  "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
> > -+ #define VTPM_TX_FIFO  "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
> > -+
> > -+ extern int dmi_id;
> > -+ static char *vtpm_rx_name=NULL;
> > -+#endif
> > -
> > - static int write_to_file(uint8_t *data, size_t data_length)
> > - {
> > --  int res;
> > --  int fp;
> > --  fp = open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> > --  res = write(fp, data, data_length);
> > --  close(fp);
> > --  return (res == data_length) ? 0 : -1;
> > -+  int res, out_data_size, in_header_size;
> > -+  BYTE *ptr, *out_data, *in_header;
> > -+  UINT32 result, len, in_rsp_size;
> > -+  UINT16 tag = VTPM_TAG_REQ;
> > -+
> > -+  printf("Saving NVM\n");
> > -+  if (vtpm_tx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> > -+#else
> > -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> > -+#endif
> > -+  }
> > -+
> > -+  if (vtpm_tx_fh < 0) {
> > -+              return -1;
> > -+  }
> > -+
> > -+  // Send request to VTPM Manager to encrypt data
> > -+#ifdef VTPM_MUTLI_VM
> > -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT + data_length;
> > -+#else
> > -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV + data_length;
> > -+#endif
> > -+
> > -+  out_data = ptr = (BYTE *) malloc(len);
> > -+
> > -+  if (ptr == NULL
> > -+#ifndef VTPM_MUTLI_VM
> > -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> > -+#endif
> > -+        || tpm_marshal_UINT16(&ptr, &len, tag)
> > -+#ifdef VTPM_MUTLI_VM
> > -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> > -+#else
> > -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> > -+#endif
> > -+        || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_SAVENVM)
> > -+        || tpm_marshal_BYTE_ARRAY(&ptr, &len, data, data_length)) {
> > -+      free(out_data);
> > -+      return -1;
> > -+  }
> > -+
> > -+  printf("\tSending SaveNVM Command.\n");
> > -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> > -+  free(out_data);
> > -+  if (res != out_data_size) return -1;
> > -+
> > -+  if (vtpm_rx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+    vtpm_rx_fh = vtpm_tx_fh
> > -+#else
> > -+    if (vtpm_rx_name == NULL) {
> > -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> > -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> > -+    }
> > -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> > -+#endif
> > -+  }
> > -+
> > -+  if (vtpm_rx_fh < 0) {
> > -+              return -1;
> > -+  }
> > -+
> > -+  // Read Header of response so we can get the size & status
> > -+#ifdef VTPM_MUTLI_VM
> > -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> > -+#else
> > -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> > -+#endif
> > -+  in_header = ptr = malloc(in_header_size);
> > -+
> > -+  printf("\tReading SaveNVM header.\n");
> > -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> > -+
> > -+  if ( (res != in_header_size)
> > -+#ifndef VTPM_MUTLI_VM
> > -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> > -+#endif
> > -+         || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> > -+         || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> > -+         || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> > -+        free(in_header);
> > -+        return -1;
> > -+  }
> > -+  free(in_header);
> > -+
> > -+  if (result != VTPM_SUCCESS) {
> > -+      return -1;
> > -+  }
> > -+
> > -+#ifdef VTPM_MUTLI_VM
> > -+  close(vtpm_tx_fh); close(vtpm_rx_fh);
> > -+#endif
> > -+
> > -+  printf("\tFinishing up SaveNVM\n");
> > -+  return (0);
> > - }
> > -
> > - static int read_from_file(uint8_t **data, size_t *data_length)
> > - {
> > --  int res;
> > --  int fp, file_status;
> > --  struct stat file_info;
> > --  fp = open(TPM_STORAGE_FILE, O_RDONLY, 0);
> > --  file_status = fstat(fp, &file_info);
> > --  if (file_status < 0) {
> > --    close(fp);
> > --    return -1;
> > --  }
> > -+  int res, out_data_size, in_header_size;
> > -+  uint8_t *ptr, *out_data, *in_header;
> > -+  UINT16 tag = VTPM_TAG_REQ;
> > -+  UINT32 len, in_rsp_size, result;
> > -+#ifdef VTPM_MUTLI_VM
> > -+      int vtpm_rx_fh, vtpm_tx_fh;
> > -+#endif
> > -+
> > -+  printf("Loading NVM.\n");
> > -+  if (vtpm_tx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> > -+#else
> > -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> > -+#endif
> > -+  }
> > -
> > --  *data_length = file_info.st_size;
> > --  *data = tpm_malloc(*data_length);
> > --  if (*data == NULL) {
> > --    close(fp);
> > -+  if (vtpm_tx_fh < 0) {
> > -+              return -1;
> > -+  }
> > -+
> > -+  // Send request to VTPM Manager to encrypt data
> > -+#ifdef VTPM_MUTLI_VM
> > -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> > -+#else
> > -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> > -+#endif
> > -+  out_data = ptr = (BYTE *) malloc(len);
> > -+
> > -+  if (ptr == NULL
> > -+#ifndef VTPM_MUTLI_VM
> > -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> > -+#endif
> > -+      || tpm_marshal_UINT16(&ptr, &len, tag)
> > -+#ifdef VTPM_MUTLI_VM
> > -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> > -+#else
> > -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> > -+#endif
> > -+      || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_LOADNVM)) {
> > -+    free(out_data);
> > -     return -1;
> > -   }
> > --  res = read(fp, *data, *data_length);
> > --  close(fp);
> > -+
> > -+  printf("\tSending LoadNVM command\n");
> > -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> > -+  free(out_data);
> > -+  if (res != out_data_size) return -1;
> > -+
> > -+    if (vtpm_rx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+    vtpm_rx_fh = vtpm_tx_fh;
> > -+#else
> > -+    if (vtpm_rx_name == NULL) {
> > -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> > -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> > -+    }
> > -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> > -+#endif
> > -+  }
> > -+
> > -+  if (vtpm_rx_fh < 0) {
> > -+              return -1;
> > -+  }
> > -+
> > -+  // Read Header of response so we can get the size & status
> > -+#ifdef VTPM_MUTLI_VM
> > -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> > -+#else
> > -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> > -+#endif
> > -+  in_header = ptr = malloc(in_header_size);
> > -+
> > -+  printf("\tReading LoadNVM header\n");
> > -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> > -+
> > -+  if ( (res != in_header_size)
> > -+#ifndef VTPM_MUTLI_VM
> > -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> > -+#endif
> > -+       || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> > -+       || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> > -+       || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> > -+      free(in_header);
> > -+      return -1;
> > -+  }
> > -+  free(in_header);
> > -+
> > -+  if (result != VTPM_SUCCESS) {
> > -+      return -1;
> > -+  }
> > -+
> > -+  // Read Encrypted data from VTPM Manager
> > -+  *data_length = in_rsp_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> > -+  *data = (uint8_t *) malloc(*data_length);
> > -+
> > -+  printf("\tReading clear data from LoadNVM.\n");
> > -+  res = read(vtpm_rx_fh, *data, *data_length);
> > -+#ifdef VTPM_MUTLI_VM
> > -+  close(vtpm_rx_fh);close(vtpm_tx_fh);
> > -+#endif
> > -+
> > -+  printf("\tReturing from loading NVM\n");
> > -   if (res != *data_length) {
> > --    tpm_free(*data);
> > --    return -1;
> > -+      free(*data);
> > -+      return -1;
> > -+  } else {
> > -+      return 0;
> > -   }
> > --  return 0;
> > -+
> > - }
> > -
> > - #else
> > -diff -uprN tpm_emulator/tpmd.c vtpm/tpmd.c
> > ---- tpm_emulator/tpmd.c        2006-12-08 12:51:29.000000000 -0800
> > -+++ vtpm/tpmd.c        2007-01-09 14:48:56.000000000 -0800
> > -@@ -21,12 +21,24 @@
> > - #include <sys/stat.h>
> > - #include <fcntl.h>
> > - #include <sys/time.h>
> > -+#include <sys/socket.h>
> > -+#include <sys/un.h>
> > -+#include <errno.h>
> > -
> > - #include "tpm_emulator.h"
> > -+#include "vtpm_manager.h"
> > -
> > --#define TPM_RX_FNAME "/var/tpm/tpm_in.fifo"
> > --#define TPM_TX_FNAME "/var/tpm/tpm_out.fifo"
> > -+#ifdef VTPM_MULTI_VM
> > -+ #define DEV_BE "/dev/vtpm"
> > -+#else
> > -+ #define PVM_RX_FIFO_D "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
> > -+ #define PVM_TX_FIFO "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
> > -
> > -+ #define HVM_RX_FIFO_D "/var/vtpm/socks/%d.socket"
> > -+#endif
> > -+
> > -+ int dmi_id;
> > -+
> > - #define BUFFER_SIZE 2048
> > -
> > - static int devurandom=0;
> > -@@ -38,7 +50,7 @@ void get_random_bytes(void *buf, int nby
> > -   }
> > -
> > -   if (read(devurandom, buf, nbytes) != nbytes) {
> > --      printf("Can't get random number.\n");
> > -+      error("Can't get random number.\n");
> > -       exit(-1);
> > -   }
> > - }
> > -@@ -52,105 +64,182 @@ uint64_t tpm_get_ticks(void)
> > -
> > - int main(int argc, char **argv)
> > - {
> > --  uint8_t in[BUFFER_SIZE], *out;
> > -+  uint8_t type, in[BUFFER_SIZE], *out, *addressed_out;
> > -+  char *vtpm_rx_file=NULL;
> > -   uint32_t out_size;
> > -   int in_size, written;
> > --  int i;
> > --  struct stat file_info;
> > -+  int i, guest_id=-1;
> > -
> > --  int tpm_tx_fh=-1, tpm_rx_fh=-1;
> > -+#ifndef VTPM_MULTI_VM
> > -+  int sockfd = -1;
> > -+  struct sockaddr_un addr;
> > -+  struct sockaddr_un client_addr;
> > -+  unsigned int client_length;
> > -+
> > -+#endif
> > -+
> > -+  int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> > -+#ifdef VTPM_MULTI_VM
> > -   if (argc < 2) {
> > --    printf("Usage: tpmd clear|save|deactivated\n" );
> > -+    error("Usage: tpmd clear|save|deactivated\n" );
> > -+#else
> > -+  if (argc < 4) {
> > -+    error("Usage: tpmd clear|save|deactivated pvm|hvm vtpmid\n" );
> > -+#endif
> > -         return -1;
> > -   }
> > -
> > -+#ifndef VTPM_MULTI_VM
> > -+  /* setup type of vm */
> > -+  if (!strcmp(argv[2], "pvm")) {
> > -+    type = VTPM_TYPE_PVM; // Get commands from vTPM Manager through fifo
> > -+  } else if (!strcmp(argv[2], "hvm")) {
> > -+    type = VTPM_TYPE_HVM; // Get commands from qemu via socket
> > -+  } else {
> > -+    error("invalid vTPM type '%s'.\n", argv[2]);
> > -+  }
> > -+
> > -+  dmi_id = atoi(argv[3]);
> > -+
> > -+  if (type == VTPM_TYPE_PVM) {
> > -+    vtpm_rx_file = malloc(10 + strlen(PVM_RX_FIFO_D));
> > -+    sprintf(vtpm_rx_file, PVM_RX_FIFO_D, (uint32_t) dmi_id);
> > -+  } else {
> > -+    vtpm_rx_file = malloc(10 + strlen(HVM_RX_FIFO_D));
> > -+    sprintf(vtpm_rx_file, HVM_RX_FIFO_D, (uint32_t) dmi_id);
> > -+
> > -+    if ( (sockfd = socket(PF_UNIX,SOCK_STREAM,0)) < 0) {
> > -+          error("Unable to create socket. errno = %d\n", errno);
> > -+      exit (-1);
> > -+    }
> > -+
> > -+    memset(&addr, 0, sizeof(addr));
> > -+    addr.sun_family = AF_UNIX;
> > -+    strcpy(addr.sun_path,vtpm_rx_file );
> > -+    unlink(addr.sun_path);
> > -+  }
> > -+#endif
> > -+
> > -+#ifdef VTPM_MULTI_VM
> > -+  info("Initializing tpm state: %s\n", argv[1]);
> > -+#else
> > -+  info("Initializing tpm state: %s, type: %s, id: %d\n", argv[1], argv[2], dmi_id);
> > -+#endif
> > -+
> > -   /* initialize TPM emulator */
> > -   if (!strcmp(argv[1], "clear")) {
> > --    printf("Initializing tpm: %s\n", argv[1]);
> > -     tpm_emulator_init(1);
> > --  } else if (!strcmp(argv[1], "save")) {
> > --    printf("Initializing tpm: %s\n", argv[1]);
> > -+  } else if (!strcmp(argv[1], "save")) {
> > -     tpm_emulator_init(2);
> > -   } else if (!strcmp(argv[1], "deactivated")) {
> > --    printf("Initializing tpm: %s\n", argv[1]);
> > -     tpm_emulator_init(3);
> > -   } else {
> > --    printf("invalid startup mode '%s'; must be 'clear', "
> > -+    error("invalid startup mode '%s'; must be 'clear', "
> > -       "'save' (default) or 'deactivated", argv[1]);
> > -     return -1;
> > -   }
> > --
> > --  if ( stat(TPM_RX_FNAME, &file_info) == -1) {
> > --    if ( mkfifo(TPM_RX_FNAME, S_IWUSR | S_IRUSR ) ) {
> > --      printf("Failed to create fifo %s.\n", TPM_RX_FNAME);
> > --      return -1;
> > --    }
> > --  }
> > --
> > --  if ( stat(TPM_TX_FNAME, &file_info) == -1) {
> > --    if ( mkfifo(TPM_TX_FNAME, S_IWUSR | S_IRUSR ) ) {
> > --      printf("Failed to create fifo %s.\n", TPM_TX_FNAME);
> > --      return -1;
> > --    }
> > --  }
> > --
> > -+
> > -   while (1) {
> > - abort_command:
> > --    if (tpm_rx_fh < 0) {
> > --      tpm_rx_fh = open(TPM_RX_FNAME, O_RDONLY);
> > -+    if (vtpm_rx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+      vtpm_rx_fh = open(DEV_BE, O_RDWR);
> > -+#else
> > -+      if (type == VTPM_TYPE_PVM) {
> > -+        vtpm_rx_fh = open(vtpm_rx_file, O_RDONLY);
> > -+      } else {
> > -+        if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
> > -+          error("Unable to bind(). errno = %d\n", errno);
> > -+          exit (-1);
> > -+        }
> > -+
> > -+        if (listen(sockfd, 10) <0) {
> > -+          error("Unable to listen(). errno = %d\n", errno);
> > -+          exit (-1);
> > -+        }
> > -+
> > -+        memset(&client_addr, 0, sizeof(client_addr));
> > -+        client_length = sizeof(client_addr);
> > -+
> > -+        vtpm_rx_fh = vtpm_tx_fh = accept(sockfd, (struct sockaddr *)&client_addr, &client_length);
> > -+      }
> > -+#endif
> > -     }
> > -
> > --    if (tpm_rx_fh < 0) {
> > --      printf("ERROR: failed to open devices to listen to guest.\n");
> > -+    if (vtpm_rx_fh < 0) {
> > -+      error("Failed to open devices to listen to guest.\n");
> > -       return -1;
> > -     }
> > -
> > --    if (tpm_tx_fh < 0) {
> > --      tpm_tx_fh = open(TPM_TX_FNAME, O_WRONLY);
> > --    }
> > --
> > --    if (tpm_tx_fh < 0) {
> > --      printf("ERROR: failed to open devices to respond to guest.\n");
> > --      return -1;
> > --    }
> > --
> > --    in_size = read(tpm_rx_fh, in, BUFFER_SIZE);
> > -+    in_size = read(vtpm_rx_fh, in, BUFFER_SIZE);
> > -     if (in_size < 6) { // Magic size of minium TPM command
> > --      printf("Recv[%d] to small: 0x", in_size);
> > -+      info("Recv incomplete command of %d bytes.", in_size);
> > -       if (in_size <= 0) {
> > --          close(tpm_rx_fh);
> > --          tpm_rx_fh = -1;
> > -+          close(vtpm_rx_fh);
> > -+          vtpm_rx_fh = -1;
> > -           goto abort_command;
> > -       }
> > -     } else {
> > --      printf("Recv[%d]: 0x", in_size);
> > -+      debug_nostop("Recv[%d]: 0x", in_size);
> > -       for (i=0; i< in_size; i++)
> > --        printf("%x ", in[i]);
> > --      printf("\n");
> > -+        debug_more("%x ", in[i]);
> > -+      debug_more("\n");
> > -     }
> > -
> > --
> > --    if (tpm_handle_command(in, in_size, &out, &out_size) != 0) {
> > --        printf("ERROR: Handler Failed.\n");
> > -+    if (guest_id == -1) {
> > -+        guest_id = *((uint32_t *) in);
> > -+    } else {
> > -+        if (guest_id != *((uint32_t *) in) ) {
> > -+            error("WARNING: More than one guest attached\n");
> > -+        }
> > -+    }
> > -+
> > -+    if (vtpm_tx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+      vtpm_tx_fh = open(DEV_BE, O_RDWR);
> > -+      vtpm_rx_fh = vtpm_tx_fh;
> > -+#else
> > -+      if (type == VTPM_TYPE_PVM) {
> > -+        vtpm_tx_fh = open(PVM_TX_FIFO, O_WRONLY);
> > -+      } // No need to open the other direction for HVM
> > -+#endif
> > -+    }
> > -+
> > -+    if (vtpm_tx_fh < 0) {
> > -+      error("Failed to open devices to respond to guest.\n");
> > -+      return -1;
> > -+    }
> > -+
> > -+    // Handle the command, but skip the domain id header
> > -+    if (tpm_handle_command(in + sizeof(uint32_t), in_size - sizeof(uint32_t), &out, &out_size) != 0) {
> > -+      error("Handler Failed.\n");
> > -     }
> > -
> > --    written = write(tpm_tx_fh, out, out_size);
> > -+    addressed_out = (uint8_t *) tpm_malloc(sizeof(uint32_t) + out_size);
> > -+    *(uint32_t *) addressed_out = *(uint32_t *) in;
> > -+    memcpy(addressed_out + sizeof(uint32_t), out, out_size);
> > -+
> > -+    written = write(vtpm_tx_fh, addressed_out, out_size + sizeof(uint32_t));
> > -
> > --    if (written != out_size ) {
> > --      printf("ERROR: Part of response not written %d/%d.\nAttempt: ", written, out_size);
> > -+    if (written != out_size + sizeof(uint32_t)) {
> > -+      error("Part of response not written %d/%d.\n", written, out_size);
> > -     } else {
> > --      printf("Sent[%Zu]: ", out_size);
> > -+      debug_nostop("Sent[%Zu]: ", out_size + sizeof(uint32_t));
> > -+      for (i=0; i< out_size+ sizeof(uint32_t); i++)
> > -+        debug_more("%x ", addressed_out[i]);
> > -+      debug_more("\n");
> > -     }
> > --    for (i=0; i< out_size; i++)
> > --      printf("%x ", out[i]);
> > --    printf("\n");
> > -     tpm_free(out);
> > -+    tpm_free(addressed_out);
> > -
> > -   } // loop
> > -
> > -   tpm_emulator_shutdown();
> > -
> > --  close(tpm_tx_fh);
> > --  close(tpm_rx_fh);
> > -+  close(vtpm_tx_fh);
> > -+#ifndef VTPM_MUTLI_VM
> > -+  close(vtpm_rx_fh);
> > -+  free (vtpm_rx_file);
> > -+#endif
> > -
> > - }
> > diff --git a/tools/vtpm_manager/COPYING b/tools/vtpm_manager/COPYING
> > deleted file mode 100644
> > index c4b86b7..0000000
> > --- a/tools/vtpm_manager/COPYING
> > +++ /dev/null
> > @@ -1,32 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > diff --git a/tools/vtpm_manager/Makefile b/tools/vtpm_manager/Makefile
> > deleted file mode 100644
> > index 632f41b..0000000
> > --- a/tools/vtpm_manager/Makefile
> > +++ /dev/null
> > @@ -1,18 +0,0 @@
> > -XEN_ROOT = $(CURDIR)/../..
> > -
> > -# Base definitions and rules
> > -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> > -
> > -SUBDIRS                = crypto tcs util manager migration
> > -OPENSSL_HEADER = /usr/include/openssl/crypto.h
> > -
> > -.PHONY: all clean install
> > -all clean install: %: subdirs-%
> > -
> > -.PHONY: mrproper
> > -mrproper:
> > -       @set -e; for subdir in $(SUBDIRS); do \
> > -               $(MAKE) -C $$subdir $@; \
> > -       done
> > -
> > -
> > diff --git a/tools/vtpm_manager/README b/tools/vtpm_manager/README
> > deleted file mode 100644
> > index f0d1e98..0000000
> > --- a/tools/vtpm_manager/README
> > +++ /dev/null
> > @@ -1,94 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -
> > -Directory Structure
> > -===================
> > -tools/vtpm_manager/crypto    -> crypto files
> > -tools/vtpm_manager/TCS       -> TCS implementation
> > -tools/vtpm_manager/util      -> Utility Library. Include disk-io and buffers.
> > -tools/vtpm_manager/manager   -> VTPM Manager
> > -
> > -Compile Flags
> > -===================
> > -LOGGING_MODULES              -> How extensive logging happens
> > -                                see util/log.h for more info
> > -
> > -VTPM_MULTI_VM                -> Defined: VTPMs run in their own VMs
> > -                                Not Defined (default): VTPMs are processes
> > -
> > -# Debugging flags that may disappear without notice in the future
> > -
> > -DUMMY_BACKEND                -> vtpm_manager listens on /tmp/in.fifo and
> > -                                /tmp/out.fifo rather than backend
> > -
> > -MANUAL_DM_LAUNCH             -> Must manually launch & kill VTPMs
> > -
> > -WELL_KNOWN_OWNER_AUTH        -> Rather than randomly generating the password for the owner,
> > -                                use a well known value. This is useful for debugging and for
> > -                                poor bios which do not support clearing TPM if OwnerAuth is
> > -                                lost. However this has no protection from malicious app
> > -                                issuing a TPM_OwnerClear to wipe the TPM
> > -
> > -Requirements
> > -============
> > -- xen-unstable
> > -- vtpm frontend/backend driver patch
> > -- OpenSSL Library
> > -
> > -Single-VM Flow
> > -============================
> > -- Launch the VTPM manager (vtpm_managerd) which which begins listening to the BE with one thread
> > -  and listens to a named fifo that is shared by the vtpms to commuincate with the manager.
> > -- VTPM Manager listens to TPM BE.
> > -- When xend launches a tpm frontend equipped VM it contacts the manager over the vtpm backend.
> > -- When the manager receives the open message from the BE, it launches a vtpm
> > -- Xend allows the VM to continue booting.
> > -- When a TPM request is issued to the front end, the front end transmits the TPM request to the backend.
> > -- The manager receives the TPM requests and uses a named fifo to forward the request to the vtpm.
> > -- The fifo listener begins listening for the reply from vtpm for the request.
> > -- Vtpm processes request and replies to manager over shared named fifo.
> > -- If needed, the vtpm may send a request to the vtpm_manager at any time to save it's secrets to disk.
> > -- Manager receives response from vtpm and passes it back to backend for forwarding to guest.
> > -
> > -NOTES:
> > -* SaveService SHOULD seal it's table before saving it to disk. However,
> > -  the current Xen infrastructure does not provide a mechanism for this to be
> > -  unsealed later. Specifically, the auth and wrapped key must be available ONLY
> > -  to the service, or it's not even worth encrypting
> > -
> > -  In the future the vtpm manager will be protected by an early boot mechanism
> > -  that will allow for better protection of it's data.
> > -
> > -TODO:
> > -- Timeout on crashed vtpms
> > -- create lock for shared fifo for talking to vtpms.
> > diff --git a/tools/vtpm_manager/Rules.mk b/tools/vtpm_manager/Rules.mk
> > deleted file mode 100644
> > index 651772b..0000000
> > --- a/tools/vtpm_manager/Rules.mk
> > +++ /dev/null
> > @@ -1,59 +0,0 @@
> > -# Base definitions and rules (XEN_ROOT must be defined in including Makefile)
> > -include $(XEN_ROOT)/tools/Rules.mk
> > -
> > -#
> > -# Tool definitions
> > -#
> > -
> > -# General compiler flags
> > -CFLAGS = -Werror -g3
> > -
> > -# Generic project files
> > -HDRS   = $(wildcard *.h)
> > -SRCS   = $(wildcard *.c)
> > -OBJS   = $(patsubst %.c,%.o,$(SRCS))
> > -
> > -# Generic (non-header) dependencies
> > -$(SRCS): Makefile $(XEN_ROOT)/tools/Rules.mk $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> > -
> > -$(OBJS): $(SRCS)
> > -
> > --include $(FILES)
> > -
> > -# Make sure these are just rules
> > -.PHONY : all build install clean
> > -
> > -#
> > -# Project-specific definitions
> > -#
> > -
> > -# Need UNIX98 spec for pthread rwlocks
> > -CFLAGS += -D_GNU_SOURCE
> > -
> > -# Logging Level. See utils/tools.h for usage
> > -CFLAGS += -DLOGGING_MODULES="(BITMASK(VTPM_LOG_TCS)|BITMASK(VTPM_LOG_VTSP)|BITMASK(VTPM_LOG_VTPM))"
> > -
> > -# Silent Mode
> > -#CFLAGS += -DLOGGING_MODULES=0x0
> > -#CFLAGS += -DLOGGING_MODULES=0xff
> > -
> > -# Use frontend/backend pairs between manager & DMs?
> > -#CFLAGS += -DVTPM_MULTI_VM
> > -
> > -# vtpm_manager listens on fifo's rather than backend
> > -#CFLAGS += -DDUMMY_BACKEND
> > -
> > -# TCS talks to fifo's rather than /dev/tpm. TPM Emulator assumed on fifos
> > -#CFLAGS += -DDUMMY_TPM
> > -
> > -# Do not have manager launch DMs.
> > -#CFLAGS += -DMANUAL_DM_LAUNCH
> > -
> > -# Fixed OwnerAuth
> > -#CFLAGS += -DWELL_KNOWN_OWNER_AUTH
> > -
> > -# Include
> > -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/crypto
> > -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/util
> > -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/tcs
> > -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/manager
> > diff --git a/tools/vtpm_manager/crypto/Makefile b/tools/vtpm_manager/crypto/Makefile
> > deleted file mode 100644
> > index 13b61c9..0000000
> > --- a/tools/vtpm_manager/crypto/Makefile
> > +++ /dev/null
> > @@ -1,24 +0,0 @@
> > -XEN_ROOT = $(CURDIR)/../../..
> > -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> > -
> > -BIN            = libtcpaCrypto.a
> > -
> > -.PHONY: all
> > -all: build
> > -
> > -.PHONY: build
> > -build: $(BIN)
> > -
> > -.PHONY: install
> > -install: build
> > -
> > -.PHONY: clean
> > -clean:
> > -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> > -
> > -.PHONY: mrproper
> > -mrproper: clean
> > -       rm -f *~
> > -
> > -$(BIN): $(OBJS)
> > -       $(AR) rcs $(BIN) $(OBJS)
> > diff --git a/tools/vtpm_manager/crypto/crypto.c b/tools/vtpm_manager/crypto/crypto.c
> > deleted file mode 100644
> > index 7dae655..0000000
> > --- a/tools/vtpm_manager/crypto/crypto.c
> > +++ /dev/null
> > @@ -1,88 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// crypto.c
> > -//
> > -//  This file will handle all the TPM Crypto functionality
> > -//
> > -// ==================================================================
> > -
> > -#include <string.h>
> > -#include <openssl/crypto.h>
> > -#include <openssl/err.h>
> > -#include <openssl/evp.h>
> > -#include <openssl/rand.h>
> > -#include "crypto.h"
> > -#include "log.h"
> > -
> > -/**
> > - * Initialize cryptography library
> > - * @rand: random seed
> > - * @size: size of @rand
> > - */
> > -void Crypto_Init(const BYTE* rand, int size) {
> > -       ERR_load_crypto_strings();
> > -  CRYPTO_malloc_init();
> > -  OpenSSL_add_all_algorithms();
> > -  SYM_CIPHER = EVP_aes_128_cbc();
> > -  RAND_poll();
> > -  if (rand == NULL)
> > -    return;
> > -
> > -  RAND_add(rand, size, size);
> > -}
> > -
> > -/**
> > - * Shutdown cryptography library
> > - */
> > -void Crypto_Exit() {
> > -  ERR_free_strings();
> > -  ERR_remove_state(0);
> > -  EVP_cleanup();
> > -}
> > -
> > -
> > -/**
> > - * Get random data
> > - * @data: (OUT) Random data
> > - * @size: Size of @data
> > - */
> > -void Crypto_GetRandom(void* data, int size) {
> > -  int result;
> > -
> > -  result = RAND_pseudo_bytes((BYTE*) data, size);
> > -
> > -  if (result <= 0)
> > -    vtpmlogerror (VTPM_LOG_CRYPTO, "RAND_pseudo_bytes failed: %s\n",
> > -            ERR_error_string (ERR_get_error(), NULL));
> > -}
> > diff --git a/tools/vtpm_manager/crypto/crypto.h b/tools/vtpm_manager/crypto/crypto.h
> > deleted file mode 100644
> > index 488d4d6..0000000
> > --- a/tools/vtpm_manager/crypto/crypto.h
> > +++ /dev/null
> > @@ -1,175 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// crypto.h
> > -//
> > -//  This file defines the TPM Crypto API
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __CRYPTO_H__
> > -#define __CRYPTO_H__
> > -
> > -#include <stddef.h>
> > -#include <stdint.h>
> > -#include <stdbool.h>
> > -
> > -#include "tcg.h"
> > -#include "sym_crypto.h"
> > -
> > -#define CRYPTO_MAX_SIG_SIZE (2048 / 8)
> > -#define CRYPTO_MAX_RSA_KEY_SIZE (4096 / 8) //in bytes
> > -
> > -#define OAEP_P "TCPA"
> > -#define OAEP_P_SIZE 4
> > -
> > -// Algorithms supported by crypto. Stored in CRYPTO_INFO.algorithmID
> > -#define CRYPTO_ALGORITH_RSA 0x01
> > -
> > -// Supported Encryption Schemes CRYPTO_INFO.encScheme
> > -#define CRYPTO_ES_NONE 0x0001
> > -#define CRYPTO_ES_RSAESPKCSv15 0x0002
> > -#define CRYPTO_ES_RSAESOAEP_SHA1_MGF1 0x0003
> > -
> > -// Supported Signature schemes CRYPTO_INFO.sigScheme
> > -#define CRYPTO_SS_NONE 0x0001
> > -#define CRYPTO_SS_RSASSAPKCS1v15_SHA1 0x0002
> > -#define CRYPTO_SS_RSASSAPKCS1v15_DER 0x0003
> > -
> > -typedef struct CRYPTO_INFO {
> > -  void *keyInfo;
> > -  UINT32 algorithmID;
> > -  UINT32 encScheme;
> > -  UINT32 sigScheme;
> > -} CRYPTO_INFO;
> > -
> > -
> > -void Crypto_Init(const BYTE* rand, int size);
> > -
> > -void Crypto_Exit();
> > -
> > -void Crypto_GetRandom(void* data, int size);
> > -
> > -void Crypto_HMAC(   const BYTE* text,
> > -                    int text_len,
> > -                    const BYTE* key,
> > -                    int key_len,
> > -                    BYTE* digest);
> > -
> > -TPM_RESULT Crypto_HMAC_buf (const buffer_t * text,
> > -                            const buffer_t * key,
> > -                            BYTE * o_digest); /* presumably of 20 bytes */
> > -
> > -void Crypto_SHA1Full(   const BYTE* text,
> > -                        UINT32 size,
> > -                        BYTE* hash); //Complete 3part SHA1
> > -
> > -// o_hash needs to be large enough to hold the digest, ie 20 bytes
> > -TPM_RESULT Crypto_SHA1Full_buf (const buffer_t * buf,
> > -                                BYTE * o_hash);
> > -
> > -void Crypto_SHA1Start(UINT32* maxNumBytes);
> > -void Crypto_SHA1Update(int numBytes, const BYTE* hashData);
> > -void Crypto_SHA1Complete(   int hashDataSize,
> > -                            const BYTE* hashData,
> > -                            BYTE* hashValue);
> > -
> > -void Crypto_RSACreateKey(   /*in*/ UINT32 keySize,
> > -                            /*in*/ UINT32 pubExpSize,
> > -                            /*in*/ BYTE *pubExp,
> > -                            /*out*/ UINT32 *privExpSize,
> > -                            /*out*/ BYTE *privExp,
> > -                            /*out*/ UINT32 *modulusSize,
> > -                            /*out*/ BYTE *modulus,
> > -                            /*out*/ CRYPTO_INFO *keys);
> > -
> > -void Crypto_RSABuildCryptoInfo( /*[IN]*/ UINT32 pubExpSize,
> > -                                /*[IN]*/ BYTE *pubExp,
> > -                                /*[IN]*/ UINT32 privExpSize,
> > -                                /*[IN]*/ BYTE *privExp,
> > -                                /*[IN]*/ UINT32 modulusSize,
> > -                                /*[IN]*/ BYTE *modulus,
> > -                                /*[OUT]*/ CRYPTO_INFO* cryptoInfo);
> > -
> > -void Crypto_RSABuildCryptoInfoPublic(   /*[IN]*/ UINT32 pubExpSize,
> > -                                        /*[IN]*/ BYTE *pubExp,
> > -                                        /*[IN]*/ UINT32 modulusSize,
> > -                                        /*[IN]*/ BYTE *modulus,
> > -                                        CRYPTO_INFO* cryptoInfo);
> > -
> > -//
> > -// symmetric pack and unpack operations
> > -//
> > -TPM_RESULT Crypto_RSAPackCryptoInfo (const CRYPTO_INFO* cryptoInfo,
> > -                                     BYTE ** io_buf, UINT32 * io_buflen);
> > -
> > -TPM_RESULT Crypto_RSAUnpackCryptoInfo (CRYPTO_INFO * ci,
> > -                                       BYTE * in, UINT32 len,
> > -                                       UINT32 * o_lenread);
> > -
> > -
> > -// return 0 on success, -1 on error
> > -int Crypto_RSAEnc(  CRYPTO_INFO *keys,
> > -                    UINT32 inDataSize,
> > -                    BYTE *inData,
> > -                    /*out*/ UINT32 *outDataSize,
> > -                    /*out*/ BYTE *outData);
> > -
> > -// return 0 on success, -1 on error
> > -int Crypto_RSADec(  CRYPTO_INFO *keys,
> > -                    UINT32 inDataSize,
> > -                    BYTE *inData,
> > -                    /*out*/ UINT32 *outDataSize,
> > -                    /*out*/ BYTE *outData);
> > -
> > -// return 0 on success, -1 on error
> > -int Crypto_RSASign( CRYPTO_INFO *keys,
> > -                    UINT32 inDataSize,
> > -                    BYTE *inData,
> > -                    /*out*/ UINT32 *sigSize,
> > -                    /*out*/ BYTE *sig);
> > -
> > -bool Crypto_RSAVerify(  CRYPTO_INFO *keys,
> > -                        UINT32 inDataSize,
> > -                        BYTE *inData,
> > -                        UINT32 sigSize,
> > -                        BYTE *sig);
> > -
> > -//private:
> > -int RSA_verify_DER(int dtype, unsigned char *m, unsigned int m_len,
> > -                   unsigned char *sigbuf, unsigned int siglen, CRYPTO_INFO *key);
> > -
> > -int RSA_sign_DER(int type, unsigned char *m, unsigned int m_len,
> > -              unsigned char *sigret, unsigned int *siglen, CRYPTO_INFO *key);
> > -
> > -#endif // __CRYPTO_H__
> > diff --git a/tools/vtpm_manager/crypto/hash.c b/tools/vtpm_manager/crypto/hash.c
> > deleted file mode 100644
> > index c73114a..0000000
> > --- a/tools/vtpm_manager/crypto/hash.c
> > +++ /dev/null
> > @@ -1,153 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// hash.c
> > -//
> > -//  This file will handle all the TPM Hash functionality
> > -//
> > -// ==================================================================
> > -
> > -#include <string.h>
> > -#include <openssl/crypto.h>
> > -#include <openssl/err.h>
> > -#include <openssl/evp.h>
> > -#include <openssl/rand.h>
> > -#include <openssl/hmac.h>
> > -#include <openssl/sha.h>
> > -#include <openssl/bn.h>
> > -#include <openssl/rsa.h>
> > -
> > -#include "tcg.h"         // for TPM_SUCCESS
> > -#include "crypto.h"
> > -
> > -static SHA_CTX g_shaContext;
> > -
> > -void Crypto_HMAC(   const BYTE* text,
> > -                    int text_len,
> > -                    const BYTE* key,
> > -                    int key_len,
> > -                    BYTE* digest) {
> > -  if (text == NULL || key == NULL || text_len == 0 || key_len == 0)
> > -    return;
> > -
> > -  HMAC(EVP_sha1(), key, key_len, text, text_len, digest, NULL);
> > -}
> > -
> > -TPM_RESULT Crypto_HMAC_buf (const buffer_t * text,
> > -                           const buffer_t * key,
> > -                           BYTE * o_digest) { /* presumably of 20 bytes */
> > -
> > -  Crypto_HMAC (text->bytes, text->size,
> > -              key->bytes, key->size,
> > -              o_digest);
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -
> > -/*
> > - * SHA1
> > - * (OUT) Create a SHA1 hash of text. Calls all three SHA1 steps internally
> > - */
> > -void Crypto_SHA1Full( const BYTE* text,
> > -      uint32_t size,
> > -      BYTE* hash) {
> > -
> > -  if (text == NULL || size == 0)
> > -    return;
> > -
> > -  // Run SHA1Start + SHAUpdate (if necessary) + SHAComplete
> > -  uint32_t maxBytes; // Not used for anything
> > -  Crypto_SHA1Start(&maxBytes);
> > -
> > -  while (size > 64){
> > -    Crypto_SHA1Update(64, text);
> > -    size -= 64;
> > -    text += 64;
> > -  }
> > -
> > -  Crypto_SHA1Complete(size, text, hash);
> > -}
> > -
> > -// same thing using buffer_t
> > -TPM_RESULT Crypto_SHA1Full_buf (const buffer_t * buf,
> > -                                 BYTE * o_digest) {
> > -
> > -  if (buf->bytes == NULL || buf->size == 0)
> > -    return TPM_BAD_PARAMETER;
> > -
> > -  Crypto_SHA1Full (buf->bytes, buf->size, o_digest);
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -
> > -/*
> > - * Initialize SHA1
> > - * (OUT) Maximum number of bytes that can be sent to SHA1Update.
> > - *   Must be a multiple of 64 bytes.
> > - */
> > -void Crypto_SHA1Start(uint32_t* maxNumBytes) {
> > -  int max = SHA_CBLOCK;
> > -  // Initialize the crypto library
> > -  SHA1_Init(&g_shaContext);
> > -  *maxNumBytes = max;
> > -}
> > -
> > -/*
> > - * Process SHA1
> > - * @numBytes: (IN) The number of bytes in hashData.
> > - *       Must be a multiple of 64 bytes.
> > - * @hashData: (IN) Bytes to be hashed.
> > - */
> > -void Crypto_SHA1Update(int numBytes, const BYTE* hashData) {
> > -
> > -  if (hashData == NULL || numBytes == 0 || numBytes%64 != 0)
> > -    return;
> > -
> > -  SHA1_Update(&g_shaContext, hashData, numBytes);
> > -}
> > -
> > -/*
> > - * Complete the SHA1 process
> > - * @hashDataSize: (IN) Number of bytes in hashData.
> > - *       Must be a multiple of 64 bytes.
> > - * @hashData: (IN) Final bytes to be hashed.
> > - * @hashValue: (OUT) The output of the SHA-1 hash.
> > - */
> > -void Crypto_SHA1Complete(int hashDataSize,
> > -                        const BYTE* hashData,
> > -                        BYTE* hashValue) {
> > -  SHA1_Update(&g_shaContext, hashData, hashDataSize);
> > -  SHA1_Final(hashValue, &g_shaContext);
> > -}
> > diff --git a/tools/vtpm_manager/crypto/rsa.c b/tools/vtpm_manager/crypto/rsa.c
> > deleted file mode 100644
> > index 7737dc6..0000000
> > --- a/tools/vtpm_manager/crypto/rsa.c
> > +++ /dev/null
> > @@ -1,434 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// rsa.c
> > -//
> > -//  This file will handle all the TPM RSA crypto functionality
> > -//
> > -// ==================================================================
> > -
> > -#include <string.h>
> > -#include <openssl/crypto.h>
> > -#include <openssl/evp.h>
> > -#include <openssl/bn.h>
> > -#include <openssl/rsa.h>
> > -#include <openssl/rand.h>
> > -#include <openssl/x509.h>
> > -
> > -#include <openssl/err.h>
> > -#include <stdio.h>
> > -
> > -#include "tcg.h"
> > -#include "buffer.h"
> > -#include "crypto.h"
> > -#include "log.h"
> > -
> > -void Crypto_RSACreateKey(   /*in*/ UINT32 keySize,
> > -                            /*in*/ UINT32 pubExpSize,
> > -                            /*in*/ BYTE *pubExp,
> > -                            /*out*/ UINT32 *privExpSize,
> > -                            /*out*/ BYTE *privExp,
> > -                            /*out*/ UINT32 *modulusSize,
> > -                            /*out*/ BYTE *modulus,
> > -                            /*out*/ CRYPTO_INFO *keys) {
> > -  unsigned long e_value;
> > -
> > -  if (pubExpSize == 0) // Default e = 2^16+1
> > -    e_value = (0x01 << 16) + 1;
> > -  else {
> > -    // This is not supported, but the following line MIGHT work
> > -    // under then assumption that the format is BigNum compatable
> > -    // Though it's not in the spec, so who knows what it is.
> > -    // Forcing the default.
> > -    //BN_bin2bn(pubExp, pubExpSize, NULL);
> > -    e_value = (0x01 << 16) + 1;
> > -  }
> > -
> > -  RSA *rsa = RSA_generate_key(keySize, e_value, NULL, NULL);
> > -
> > -  if (keys) {
> > -    keys->keyInfo = rsa;
> > -    keys->algorithmID = CRYPTO_ALGORITH_RSA;
> > -  }
> > -
> > -  if (modulus)   *modulusSize   = BN_bn2bin(rsa->n, modulus);
> > -  if (privExp)   *privExpSize   = BN_bn2bin(rsa->d, privExp);
> > -}
> > -
> > -// Create a CRYPTO_INFO struct from the BYTE * key parts.
> > -// If pubExp info is NULL, use TCG default.
> > -// If there is a remainder while calculating the privExp, return FALSE.
> > -
> > -void Crypto_RSABuildCryptoInfo( /*[IN]*/ UINT32 pubExpSize,
> > -                                /*[IN]*/ BYTE *pubExp,
> > -                                /*[IN]*/ UINT32 privExpSize,
> > -                                /*[IN]*/ BYTE *privExp,
> > -                                /*[IN]*/ UINT32 modulusSize,
> > -                                /*[IN]*/ BYTE *modulus,
> > -                                CRYPTO_INFO* cryptoInfo) {
> > -  cryptoInfo->keyInfo = RSA_new();
> > -  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
> > -
> > -  rsa->e = BN_new();
> > -
> > -  if (pubExpSize == 0) { // Default e = 2^16+1
> > -    BN_set_bit(rsa->e, 16);
> > -    BN_set_bit(rsa->e, 0);
> > -  } else {
> > -    // This is not supported, but the following line MIGHT work
> > -    // under then assumption that the format is BigNum compatable
> > -    // Though it's not in the spec, so who knows what it is.
> > -    // Forcing the default.
> > -    //BN_bin2bn(pubExp, pubExpSize, NULL);
> > -    BN_set_bit(rsa->e, 16);
> > -    BN_set_bit(rsa->e, 0);
> > -  }
> > -
> > -  rsa->n = BN_bin2bn(modulus, modulusSize, NULL);
> > -  rsa->d = BN_bin2bn(privExp, privExpSize, NULL);
> > -}
> > -
> > -// Create a CRYPTO_INFO struct from the BYTE * key parts.
> > -// If pubExp info is NULL, use TCG default.
> > -// If there is a remainder while calculating the privExp, return FALSE.
> > -
> > -void Crypto_RSABuildCryptoInfoPublic(   /*[IN]*/ UINT32 pubExpSize,
> > -                                        /*[IN]*/ BYTE *pubExp,
> > -                                        /*[IN]*/ UINT32 modulusSize,
> > -                                        /*[IN]*/ BYTE *modulus,
> > -                                        CRYPTO_INFO* cryptoInfo) {
> > -  cryptoInfo->keyInfo = RSA_new();
> > -  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
> > -
> > -  rsa->e = BN_new();
> > -
> > -  if (pubExpSize == 0) { // Default e = 2^16+1
> > -    BN_set_bit(rsa->e, 16);
> > -    BN_set_bit(rsa->e, 0);
> > -  } else {
> > -    // This is not supported, but the following line MIGHT work
> > -    // under then assumption that the format is BigNum compatable
> > -    // Though it's not in the spec, so who knows what it is.
> > -    // Forcing the default.
> > -    //BN_bin2bn(pubExp, pubExpSize, NULL);
> > -    BN_set_bit(rsa->e, 16);
> > -    BN_set_bit(rsa->e, 0);
> > -  }
> > -
> > -  rsa->n = BN_bin2bn(modulus, modulusSize, NULL);
> > -
> > -}
> > -
> > -int Crypto_RSAEnc(  CRYPTO_INFO *key,
> > -                   UINT32 inDataSize,
> > -                   BYTE *inData,
> > -                   /*out*/ UINT32 *outDataSize,
> > -                   /*out*/ BYTE *outData) {
> > -  RSA *rsa = (RSA *) key->keyInfo;
> > -  UINT32 paddedDataSize = RSA_size (rsa);
> > -  BYTE *paddedData = (BYTE *)malloc(sizeof(BYTE) * paddedDataSize);
> > -  int rc;
> > -
> > -  if (paddedData == NULL)
> > -    return -1;
> > -
> > -  *outDataSize = 0;
> > -
> > -  switch (key->encScheme) {
> > -  case CRYPTO_ES_RSAESPKCSv15:
> > -    if (RSA_padding_add_PKCS1_type_2(paddedData, paddedDataSize, inData, inDataSize) <= 0) {
> > -      rc = -1;
> > -      goto abort_egress;
> > -    }
> > -    break;
> > -  case CRYPTO_ES_RSAESOAEP_SHA1_MGF1:
> > -    if (RSA_padding_add_PKCS1_OAEP(paddedData,paddedDataSize,inData,inDataSize, (BYTE *) OAEP_P,OAEP_P_SIZE) <= 0 ) {
> > -      rc = -1;
> > -      goto abort_egress;
> > -    }
> > -    break;
> > -  default:
> > -    rc = -1;
> > -    goto abort_egress;
> > -  }
> > -
> > -  rc = RSA_public_encrypt(paddedDataSize, paddedData, outData, rsa, RSA_NO_PADDING);
> > -  if (rc == -1)
> > -    goto abort_egress;
> > -
> > -  *outDataSize = rc;
> > -
> > -  if (rc > 0) rc = 0;
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  if (paddedData)
> > -    free (paddedData);
> > -  return rc;
> > -
> > -}
> > -
> > -int Crypto_RSADec(  CRYPTO_INFO *key,
> > -                    UINT32 inDataSize,
> > -                    BYTE *inData,
> > -                    /*out*/ UINT32 *outDataSize,
> > -                    /*out*/ BYTE *outData) {
> > -
> > -  RSA *rsa = (RSA *) key->keyInfo;
> > -  UINT32 paddedDataSize = RSA_size (rsa);
> > -  BYTE *paddedData = (BYTE *)malloc(sizeof(BYTE) * paddedDataSize);
> > -  int rc;
> > -
> > -  if (paddedData == NULL)
> > -    goto abort_egress;
> > -
> > -  rc = RSA_private_decrypt(inDataSize, inData, paddedData, rsa, RSA_NO_PADDING);
> > -  if (rc == -1) {
> > -    vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_private_decrypt: %s\n", ERR_error_string(ERR_get_error(), NULL));
> > -    goto abort_egress;
> > -  }
> > -
> > -  paddedDataSize = rc;
> > -
> > -  switch (key->encScheme) {
> > -  case CRYPTO_ES_RSAESPKCSv15:
> > -    rc = RSA_padding_check_PKCS1_type_2 (outData, paddedDataSize,
> > -                                        paddedData + 1, paddedDataSize - 1,
> > -                                        RSA_size(rsa));
> > -    if (rc == -1) {
> > -      vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_padding_check_PKCS1_type_2: %s\n",
> > -             ERR_error_string(ERR_get_error(), NULL));
> > -      goto abort_egress;
> > -    }
> > -    *outDataSize = rc;
> > -    break;
> > -  case CRYPTO_ES_RSAESOAEP_SHA1_MGF1:
> > -    rc = RSA_padding_check_PKCS1_OAEP(outData, paddedDataSize,
> > -                                     paddedData + 1, paddedDataSize - 1,
> > -                                     RSA_size(rsa),
> > -                                     (BYTE *) OAEP_P, OAEP_P_SIZE);
> > -    if (rc == -1) {
> > -      vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_padding_check_PKCS1_OAEP: %s\n",
> > -             ERR_error_string(ERR_get_error(), NULL));
> > -      goto abort_egress;
> > -    }
> > -    *outDataSize = rc;
> > -    break;
> > -  default:
> > -    *outDataSize = 0;
> > -  }
> > -
> > -  free(paddedData); paddedData = NULL;
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > -  if (paddedData)
> > -    free (paddedData);
> > -  return -1;
> > -
> > - egress:
> > -  return 0;
> > -}
> > -
> > -// Signs either a SHA1 digest of a message or a DER encoding of a message
> > -// Textual messages MUST be encoded or Hashed before sending into this function
> > -// It will NOT SHA the message.
> > -int Crypto_RSASign( CRYPTO_INFO *key,
> > -                    UINT32 inDataSize,
> > -                    BYTE *inData,
> > -                    /*out*/ UINT32 *sigSize,
> > -                    /*out*/ BYTE *sig) {
> > -  int status;
> > -  unsigned int intSigSize;
> > -
> > -  switch(key->sigScheme) {
> > -  case CRYPTO_SS_RSASSAPKCS1v15_SHA1:
> > -    status = RSA_sign(NID_sha1, inData, inDataSize, sig, &intSigSize, (RSA *) key->keyInfo);
> > -    break;
> > -  case CRYPTO_SS_RSASSAPKCS1v15_DER:
> > -    //        status = Crypto_RSA_sign_DER(NID_md5_sha1, inData, inDataSize, sig, &intSigSize, key);
> > -    vtpmlogerror(VTPM_LOG_CRYPTO, "Crypto: Unimplemented sign type (%d)\n", key->sigScheme);
> > -    status = 0;
> > -    break;
> > -  default:
> > -    status = 0;
> > -  }
> > -
> > -  if (status == 0) {
> > -    *sigSize = 0;
> > -    vtpmlogerror(VTPM_LOG_CRYPTO, "%s\n", ERR_error_string(ERR_get_error(), NULL));
> > -    return -1;
> > -  }
> > -
> > -  *sigSize = (UINT32) intSigSize;
> > -  return 0;
> > -}
> > -
> > -bool Crypto_RSAVerify(  CRYPTO_INFO *key,
> > -                        UINT32 inDataSize,
> > -                        BYTE *inData,
> > -                        UINT32 sigSize,
> > -                        BYTE *sig) {
> > -  int status;
> > -
> > -  switch(key->sigScheme){
> > -  case CRYPTO_SS_RSASSAPKCS1v15_SHA1:
> > -    status = RSA_verify(NID_sha1, inData, inDataSize, sig, sigSize, (RSA *) key->keyInfo);
> > -    break;
> > -  case CRYPTO_SS_RSASSAPKCS1v15_DER:
> > -    //status = Crypto_RSA_verify_DER(NID_md5_sha1, inData, inDataSize, sig, sigSize, key);
> > -    vtpmlogerror(VTPM_LOG_CRYPTO, "Crypto: Unimplemented sign type (%d)\n", key->sigScheme);
> > -    status = 0;
> > -    break;
> > -  default:
> > -    status = 0;
> > -  }
> > -
> > -  if (status)
> > -    return(1);
> > -  else {
> > -    vtpmlogerror(VTPM_LOG_CRYPTO, "RSA verify: %s\n", ERR_error_string(ERR_get_error(), NULL));
> > -    return(0);
> > -  }
> > -
> > -}
> > -
> > -// helper which packs everything into a BIO!
> > -
> > -// packs the parameters first, then the private key, then the public key
> > -// if *io_buf is NULL, allocate it here as needed. otherwise its size is in
> > -// *io_buflen
> > -TPM_RESULT Crypto_RSAPackCryptoInfo (const CRYPTO_INFO* cryptoInfo,
> > -                                      BYTE ** io_buf, UINT32 * io_buflen) {
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  BYTE * buf;
> > -  long len, outlen = *io_buflen;
> > -
> > -  const long PARAMSLEN = 3*sizeof(UINT32);
> > -
> > -  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
> > -
> > -  BIO *mem = BIO_new(BIO_s_mem());
> > -
> > -
> > -  // write the openssl keys to the BIO
> > -  if ( i2d_RSAPrivateKey_bio (mem, rsa) == 0 ) {
> > -    ERR_print_errors_fp (stderr);
> > -    ERRORDIE (TPM_SIZE);
> > -  }
> > -  if ( i2d_RSAPublicKey_bio (mem, rsa) == 0 ) {
> > -    ERR_print_errors_fp (stderr);
> > -    ERRORDIE (TPM_SIZE);
> > -  }
> > -
> > -  // get the buffer out
> > -  len = BIO_get_mem_data (mem, &buf);
> > -
> > -  // see if we need to allocate a return buffer
> > -  if (*io_buf == NULL) {
> > -    *io_buf = (BYTE*) malloc (PARAMSLEN + len);
> > -    if (*io_buf == NULL)
> > -      ERRORDIE (TPM_SIZE);
> > -  } else {                      // *io_buf is already allocated
> > -    if (outlen < len + PARAMSLEN)
> > -      ERRORDIE (TPM_SIZE); // but not large enough!
> > -  }
> > -
> > -  // copy over the parameters (three UINT32's starting at algorithmID)
> > -  memcpy (*io_buf, &cryptoInfo->algorithmID, PARAMSLEN);
> > -
> > -  // copy over the DER keys
> > -  memcpy (*io_buf + PARAMSLEN, buf, len);
> > -
> > -  *io_buflen = len + PARAMSLEN;
> > -
> > -  goto egress;
> > -
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  BIO_free (mem);
> > -
> > -  return status;
> > -}
> > -
> > -
> > -
> > -// sets up ci, and returns the number of bytes read in o_lenread
> > -TPM_RESULT Crypto_RSAUnpackCryptoInfo (CRYPTO_INFO * ci,
> > -                                        BYTE * in, UINT32 len,
> > -                                        UINT32 * o_lenread) {
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  long l;
> > -  BIO *mem;
> > -  RSA *rsa;
> > -
> > -  // first load up the params
> > -  l = 3 * sizeof(UINT32);
> > -  memcpy (&ci->algorithmID, in, l);
> > -  len -= l;
> > -  in += l;
> > -
> > -  // and now the openssl keys, private first
> > -  mem = BIO_new_mem_buf (in, len);
> > -
> > -  if ( (rsa = d2i_RSAPrivateKey_bio (mem, NULL)) == NULL ) {
> > -    ERR_print_errors_fp (stderr);
> > -    ERRORDIE (TPM_BAD_PARAMETER);
> > -  }
> > -  // now use the same RSA object and fill in the private key
> > -  if ( d2i_RSAPublicKey_bio (mem, &rsa) == NULL ) {
> > -    ERR_print_errors_fp (stderr);
> > -    ERRORDIE (TPM_BAD_PARAMETER);
> > -  }
> > -
> > -  ci->keyInfo = rsa;          // needs to be freed somehow later
> > -
> > -  // FIXME: havent figured out yet how to tell how many bytes were read in the
> > -  // above oprations! so o_lenread is not set
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  BIO_free (mem);
> > -
> > -  return status;
> > -}
> > diff --git a/tools/vtpm_manager/crypto/sym_crypto.c b/tools/vtpm_manager/crypto/sym_crypto.c
> > deleted file mode 100644
> > index 3d86e19..0000000
> > --- a/tools/vtpm_manager/crypto/sym_crypto.c
> > +++ /dev/null
> > @@ -1,237 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// sym_crypto.c
> > -//
> > -//     Symmetric crypto portion of crypto
> > -//
> > -// ==================================================================
> > -
> > -#include <openssl/evp.h>
> > -#include <openssl/rand.h>
> > -
> > -#include "tcg.h"
> > -#include "sym_crypto.h"
> > -
> > -typedef enum crypt_op_type_t {
> > -  CRYPT_ENCRYPT,
> > -  CRYPT_DECRYPT
> > -} crypt_op_type_t;
> > -
> > -TPM_RESULT ossl_symcrypto_op (symkey_t* key,
> > -                              const buffer_t* in,
> > -                              const buffer_t* iv,
> > -                              buffer_t * out,
> > -                              crypt_op_type_t optype);
> > -
> > -
> > -// this is initialized in Crypto_Init()
> > -const EVP_CIPHER * SYM_CIPHER = NULL;
> > -
> > -const BYTE ZERO_IV[EVP_MAX_IV_LENGTH] = {0};
> > -
> > -
> > -TPM_RESULT Crypto_symcrypto_initkey (symkey_t * key, const buffer_t* keybits) {
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  EVP_CIPHER_CTX_init (&key->context);
> > -
> > -  key->cipher = SYM_CIPHER;
> > -
> > -  TPMTRYRETURN( buffer_init_copy (&key->key, keybits));
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -  EVP_CIPHER_CTX_cleanup (&key->context);
> > -
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -
> > -
> > -TPM_RESULT Crypto_symcrypto_genkey (symkey_t * key) {
> > -  int res;
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  // hmm, EVP_CIPHER_CTX_init does not return a value
> > -  EVP_CIPHER_CTX_init (&key->context);
> > -
> > -  key->cipher = SYM_CIPHER;
> > -
> > -  TPMTRYRETURN( buffer_init (&key->key, EVP_CIPHER_key_length(key->cipher), NULL)) ;
> > -
> > -  // and generate the key material
> > -  res = RAND_pseudo_bytes (key->key.bytes, key->key.size);
> > -  if (res < 0)
> > -    ERRORDIE (TPM_SHORTRANDOM);
> > -
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -  EVP_CIPHER_CTX_cleanup (&key->context);
> > -  buffer_free (&key->key);
> > -
> > - egress:
> > -  return status;
> > -}
> > -
> > -
> > -TPM_RESULT Crypto_symcrypto_encrypt (symkey_t* key,
> > -                              const buffer_t* clear,
> > -                              buffer_t* o_cipher) {
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  buffer_t iv, cipher_alias;
> > -
> > -  buffer_init_const (&iv, EVP_MAX_IV_LENGTH, ZERO_IV);
> > -
> > -  buffer_init (o_cipher,
> > -              clear->size +
> > -              EVP_CIPHER_iv_length(key->cipher) +
> > -              EVP_CIPHER_block_size (key->cipher),
> > -                                0);
> > -
> > -  // copy the IV into the front
> > -  buffer_copy (o_cipher, &iv);
> > -
> > -  // make an alias into which we'll put the ciphertext
> > -  buffer_init_alias (&cipher_alias, o_cipher, EVP_CIPHER_iv_length(key->cipher), 0);
> > -
> > -  TPMTRYRETURN( ossl_symcrypto_op (key, clear, &iv, &cipher_alias, CRYPT_ENCRYPT) );
> > -
> > -  // set the output size correctly
> > -  o_cipher->size += cipher_alias.size;
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  return status;
> > -
> > -}
> > -
> > -
> > -
> > -TPM_RESULT Crypto_symcrypto_decrypt (symkey_t* key,
> > -                              const buffer_t* cipher,
> > -                              buffer_t* o_clear) {
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  buffer_t iv, cipher_alias;
> > -
> > -  // alias for the IV
> > -  buffer_init_alias (&iv, cipher, 0, EVP_CIPHER_iv_length(key->cipher));
> > -
> > -  // make an alias to where the ciphertext is, after the IV
> > -  buffer_init_alias (&cipher_alias, cipher, EVP_CIPHER_iv_length(key->cipher), 0);
> > -
> > -  // prepare the output buffer
> > -  TPMTRYRETURN( buffer_init (o_clear,
> > -                       cipher->size
> > -                       - EVP_CIPHER_iv_length(key->cipher)
> > -                       + EVP_CIPHER_block_size(key->cipher),
> > -                       0) );
> > -
> > -  // and decrypt
> > -  TPMTRYRETURN ( ossl_symcrypto_op (key, &cipher_alias, &iv, o_clear, CRYPT_DECRYPT) );
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -  buffer_free (o_clear);
> > -
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -
> > -
> > -TPM_RESULT Crypto_symcrypto_freekey (symkey_t * key) {
> > -  buffer_memset (&key->key, 0);
> > -  buffer_free (&key->key);
> > -
> > -  EVP_CIPHER_CTX_cleanup (&key->context);
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -
> > -TPM_RESULT ossl_symcrypto_op (symkey_t* key,
> > -                              const buffer_t* in,
> > -                              const buffer_t* iv,
> > -                              buffer_t * out,
> > -                              crypt_op_type_t optype) {
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  int inlen, outlen;
> > -  tpm_size_t running;
> > -
> > -  if ( ! EVP_CipherInit_ex (&key->context,
> > -                           key->cipher, NULL, key->key.bytes, iv->bytes,
> > -                           optype == CRYPT_ENCRYPT ? 1 : 0) )
> > -    ERRORDIE (TPM_FAIL);
> > -
> > -
> > -
> > -  inlen = in->size;
> > -
> > -  outlen  = 0;
> > -  running = 0;
> > -
> > -
> > -  if ( ! EVP_CipherUpdate (&key->context, out->bytes, &outlen, in->bytes, inlen) )
> > -    ERRORDIE (TPM_FAIL);
> > -
> > -  running += outlen;
> > -
> > -  if ( ! EVP_CipherFinal_ex (&key->context, out->bytes + running, &outlen) )
> > -    ERRORDIE (TPM_FAIL);
> > -
> > -  running += outlen;
> > -
> > -  out->size = running;
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  return status;
> > -}
> > diff --git a/tools/vtpm_manager/crypto/sym_crypto.h b/tools/vtpm_manager/crypto/sym_crypto.h
> > deleted file mode 100644
> > index 7fb59a8..0000000
> > --- a/tools/vtpm_manager/crypto/sym_crypto.h
> > +++ /dev/null
> > @@ -1,72 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// sym_crypto.h
> > -//
> > -//     Symmetric Crypto
> > -//
> > -// ==================================================================
> > -
> > -#ifndef _SYM_CRYPTO_H
> > -#define _SYM_CRYPTO_H
> > -
> > -#include <openssl/evp.h>
> > -#include "buffer.h"
> > -
> > -typedef struct symkey_t {
> > -  buffer_t key;
> > -
> > -  EVP_CIPHER_CTX context;
> > -  const EVP_CIPHER * cipher;
> > -} symkey_t;
> > -
> > -extern const EVP_CIPHER * SYM_CIPHER;
> > -
> > -TPM_RESULT Crypto_symcrypto_genkey (symkey_t * key);
> > -
> > -TPM_RESULT Crypto_symcrypto_initkey (symkey_t * key, const buffer_t* keybits);
> > -
> > -
> > -// these functions will allocate their output buffers
> > -TPM_RESULT Crypto_symcrypto_encrypt (symkey_t* key,
> > -                              const buffer_t* clear,
> > -                              buffer_t* o_cipher);
> > -
> > -TPM_RESULT Crypto_symcrypto_decrypt (symkey_t* key,
> > -                              const buffer_t* cipher,
> > -                              buffer_t* o_clear);
> > -
> > -// only free the internal parts, not the 'key' ptr
> > -TPM_RESULT Crypto_symcrypto_freekey (symkey_t * key);
> > -
> > -#endif /* _SYM_CRYPTO_H */
> > diff --git a/tools/vtpm_manager/manager/Makefile b/tools/vtpm_manager/manager/Makefile
> > deleted file mode 100644
> > index a33c18a..0000000
> > --- a/tools/vtpm_manager/manager/Makefile
> > +++ /dev/null
> > @@ -1,38 +0,0 @@
> > -XEN_ROOT = $(CURDIR)/../../..
> > -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> > -
> > -BIN            = vtpm_managerd
> > -
> > -.PHONY: all
> > -all: build
> > -
> > -.PHONY: build
> > -build: $(BIN)
> > -
> > -.PHONY: install
> > -install: build
> > -       if [ ! -d "$(DESTDIR)/var/vtpm/fifos" ]; \
> > -               then mkdir -p $(DESTDIR)/var/vtpm/fifos; \
> > -       fi
> > -       if [ ! -d "$(DESTDIR)/var/vtpm/socks" ]; \
> > -               then mkdir -p $(DESTDIR)/var/vtpm/socks; \
> > -       fi
> > -       $(INSTALL_PROG) $(BIN) $(DESTDIR)$(BINDIR)
> > -
> > -.PHONY: clean
> > -clean:
> > -       rm -f $(BIN)
> > -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> > -
> > -.PHONY: mrproper
> > -mrproper: clean
> > -       rm -f *~
> > -
> > -$(BIN): $(OBJS)
> > -       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
> > -
> > -# libraries
> > -LIBS += ../tcs/libTCS.a ../util/libTCGUtils.a ../crypto/libtcpaCrypto.a
> > -LIBS += -lcrypto $(PTHREAD_LIBS) -lm
> > -CFLAGS += $(PTHREAD_CFLAGS)
> > -LDFLAGS += $(PTHREAD_LDFLAGS)
> > diff --git a/tools/vtpm_manager/manager/dmictl.c b/tools/vtpm_manager/manager/dmictl.c
> > deleted file mode 100644
> > index 5c3cf7e..0000000
> > --- a/tools/vtpm_manager/manager/dmictl.c
> > +++ /dev/null
> > @@ -1,266 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -//   dmictl.c
> > -//
> > -//     Functions for creating and destroying DMIs
> > -//
> > -// ==================================================================
> > -
> > -#include <stdio.h>
> > -#include <unistd.h>
> > -#include <string.h>
> > -
> > -#include "vtpmpriv.h"
> > -#include "bsg.h"
> > -#include "buffer.h"
> > -#include "log.h"
> > -#include "hashtable.h"
> > -#include "hashtable_itr.h"
> > -#include "vtpm_ipc.h"
> > -
> > -#define TPM_EMULATOR_PATH "/usr/bin/vtpmd"
> > -
> > -// if dmi_res is non-null, then return a pointer to new object.
> > -// Also, this does not fill in the measurements. They should be filled by
> > -// design dependent code or saveNVM
> > -TPM_RESULT init_dmi(UINT32 dmi_id, BYTE dmi_type, VTPM_DMI_RESOURCE **dmi_res) {
> > -
> > -  TPM_RESULT status=TPM_SUCCESS;
> > -  VTPM_DMI_RESOURCE *new_dmi=NULL;
> > -  UINT32 *dmi_id_key=NULL;
> > -
> > -  if ((new_dmi = (VTPM_DMI_RESOURCE *) malloc (sizeof(VTPM_DMI_RESOURCE))) == NULL) {
> > -      status = TPM_RESOURCES;
> > -      goto abort_egress;
> > -  }
> > -  memset(new_dmi, 0, sizeof(VTPM_DMI_RESOURCE));
> > -  new_dmi->dmi_id = dmi_id;
> > -  new_dmi->dmi_type = dmi_type;
> > -  new_dmi->connected = FALSE;
> > -  new_dmi->TCSContext = 0;
> > -
> > -  new_dmi->NVMLocation = (char *) malloc(11 + strlen(DMI_NVM_FILE));
> > -  sprintf(new_dmi->NVMLocation, DMI_NVM_FILE, (uint32_t) new_dmi->dmi_id);
> > -
> > -  if ((dmi_id_key = (UINT32 *) malloc (sizeof(UINT32))) == NULL) {
> > -    status = TPM_RESOURCES;
> > -    goto abort_egress;
> > -  }
> > -  *dmi_id_key = new_dmi->dmi_id;
> > -
> > -  // install into map
> > -  if (!hashtable_insert(vtpm_globals->dmi_map, dmi_id_key, new_dmi)){
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to insert instance into table. Aborting.\n", dmi_id);
> > -    status = TPM_FAIL;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if (dmi_res)
> > -    *dmi_res = new_dmi;
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -  if (new_dmi) {
> > -    free(new_dmi->NVMLocation);
> > -    free(new_dmi);
> > -  }
> > -  free(dmi_id_key);
> > -
> > - egress:
> > -  return status;
> > -}
> > -
> > -TPM_RESULT close_dmi(VTPM_DMI_RESOURCE *dmi_res) {
> > -  if (dmi_res == NULL)
> > -    return TPM_SUCCESS;
> > -
> > -  if (dmi_res->dmi_id == VTPM_CTL_DM)
> > -    return(TPM_BAD_PARAMETER);
> > -
> > -  TCS_CloseContext(dmi_res->TCSContext);
> > -  dmi_res->connected = FALSE;
> > -
> > -  vtpm_globals->connected_dmis--;
> > -
> > -  return (VTPM_Close_DMI_Extra(dmi_res) );
> > -}
> > -
> > -TPM_RESULT VTPM_Handle_New_DMI(const buffer_t *param_buf) {
> > -
> > -  VTPM_DMI_RESOURCE *new_dmi=NULL;
> > -  TPM_RESULT status=TPM_FAIL;
> > -  BYTE dmi_type, vm_type, startup_mode;
> > -  UINT32 dmi_id;
> > -
> > -  if (param_buf == NULL) { // Assume creation of Dom 0 control
> > -    dmi_type = VTPM_TYPE_NON_MIGRATABLE;
> > -    dmi_id = VTPM_CTL_DM;
> > -  } else if (buffer_len(param_buf) != sizeof(BYTE) * 3  + sizeof(UINT32)) {
> > -    vtpmloginfo(VTPM_LOG_VTPM, "New DMI command wrong length: %d.\n", buffer_len(param_buf));
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  } else {
> > -    vtpm_globals->connected_dmis++; // Put this here so we don't count Dom0
> > -    BSG_UnpackList( param_buf->bytes, 4,
> > -                   BSG_TYPE_BYTE, &dmi_type,
> > -                   BSG_TYPE_BYTE, &startup_mode,
> > -                   BSG_TYPE_BYTE, &vm_type,
> > -                   BSG_TYPE_UINT32,  &dmi_id);
> > -  }
> > -
> > -  if ((dmi_type != VTPM_TYPE_NON_MIGRATABLE) && (dmi_type != VTPM_TYPE_MIGRATABLE)) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Creation of VTPM with illegal type.\n");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  new_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> > -  if (new_dmi == NULL) {
> > -    vtpmloginfo(VTPM_LOG_VTPM, "Creating new DMI instance %d attached.\n", dmi_id );
> > -    // Brand New DMI. Initialize the persistent pieces
> > -    TPMTRYRETURN(init_dmi(dmi_id, dmi_type, &new_dmi) );
> > -  } else
> > -    vtpmloginfo(VTPM_LOG_VTPM, "Re-attaching DMI instance %d.\n", dmi_id);
> > -
> > -  if (new_dmi->connected) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Attempt to re-attach, currently attached instance %d. Ignoring\n", dmi_id);
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if (new_dmi->dmi_type == VTPM_TYPE_MIGRATED) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Attempt to re-attach previously migrated instance %d without recovering first. Ignoring\n", dmi_id);
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  // Initialize the Non-persistent pieces
> > -  TPMTRYRETURN( TCS_OpenContext(&new_dmi->TCSContext) );
> > -
> > -  new_dmi->connected = TRUE;
> > -
> > -  // Design specific new DMI code.
> > -  // Includes: create IPCs, Measuring DMI, and maybe launching DMI
> > -  TPMTRYRETURN(VTPM_New_DMI_Extra(new_dmi, vm_type, startup_mode) );
> > -  goto egress;
> > -
> > - abort_egress:
> > -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to create DMI id=%d due to status=%s. Cleaning.\n", dmi_id, tpm_get_error_name(status));
> > -  close_dmi(new_dmi );
> > -
> > - egress:
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTPM_Handle_Close_DMI( const buffer_t *param_buf) {
> > -
> > -  TPM_RESULT status=TPM_FAIL;
> > -  VTPM_DMI_RESOURCE *dmi_res=NULL;
> > -  UINT32 dmi_id;
> > -
> > -  if ((param_buf == NULL) || (buffer_len(param_buf) != sizeof(UINT32)) ) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Closing DMI has bad size.");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  BSG_UnpackList( param_buf->bytes, 1,
> > -                 BSG_TYPE_UINT32, &dmi_id);
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Closing DMI %d.\n", dmi_id);
> > -
> > -  dmi_res = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> > -  if (dmi_res == NULL ) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Trying to close nonexistent DMI.\n");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if (!dmi_res->connected) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Closing non-connected DMI.\n");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  // Close Dmi
> > -       TPMTRYRETURN(close_dmi( dmi_res ));
> > -
> > -  status=TPM_SUCCESS;
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTPM_Handle_Delete_DMI( const buffer_t *param_buf) {
> > -
> > -  TPM_RESULT status=TPM_FAIL;
> > -  VTPM_DMI_RESOURCE *dmi_res=NULL;
> > -  UINT32 dmi_id;
> > -
> > -  if ((param_buf == NULL) || (buffer_len(param_buf) != sizeof(UINT32)) ) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Closing DMI has bad size.\n");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  BSG_UnpackList( param_buf->bytes, 1,
> > -                 BSG_TYPE_UINT32, &dmi_id);
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Deleting DMI %d.\n", dmi_id);
> > -
> > -  dmi_res = (VTPM_DMI_RESOURCE *) hashtable_remove(vtpm_globals->dmi_map, &dmi_id);
> > -  if (dmi_res == NULL) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Closing non-existent DMI.\n");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  //vtpm scripts delete file dmi_res->NVMLocation for us
> > -
> > -  // Close DMI first
> > -  TPMTRYRETURN(close_dmi( dmi_res ));
> > -  free ( dmi_res );
> > -
> > -  status=TPM_SUCCESS;
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  return status;
> > -}
> > diff --git a/tools/vtpm_manager/manager/migration.c b/tools/vtpm_manager/manager/migration.c
> > deleted file mode 100644
> > index 54da708..0000000
> > --- a/tools/vtpm_manager/manager/migration.c
> > +++ /dev/null
> > @@ -1,307 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -//   dmictl.c
> > -//
> > -//     Functions for creating and destroying DMIs
> > -//
> > -// ==================================================================
> > -
> > -#include <stdio.h>
> > -#include <unistd.h>
> > -#include <string.h>
> > -
> > -#include "vtpmpriv.h"
> > -#include "bsg.h"
> > -#include "buffer.h"
> > -#include "log.h"
> > -#include "hashtable.h"
> > -
> > -TPM_RESULT VTPM_Handle_Migrate_In( const buffer_t *param_buf,
> > -                                   buffer_t *result_buf) {
> > -
> > -  TPM_RESULT status=TPM_FAIL;
> > -  VTPM_DMI_RESOURCE *mig_dmi=NULL;
> > -  UINT32 dmi_id;
> > -  buffer_t dmi_state_abuf = NULL_BUF, enc_dmi_abuf = NULL_BUF, clear_dmi_blob = NULL_BUF;
> > -
> > -  if (param_buf == NULL) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Migration Out Failed due to bad parameter.\n");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  struct pack_buf_t enc_dmi_state_pack;
> > -
> > -  BSG_UnpackList(param_buf->bytes, 2,
> > -                 BSG_TYPE_UINT32, &dmi_id,
> > -                 BSG_TPM_SIZE32_DATA, &enc_dmi_state_pack) ;
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Migrating VTPM in dmi %d.\n", dmi_id);
> > -
> > -  mig_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> > -  if (mig_dmi) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Incoming VTPM claims unavailable id: %d.\n", dmi_id);
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  /** UnBind Blob **/
> > -  TPMTRYRETURN( buffer_init_alias_convert( &enc_dmi_abuf,
> > -                                           enc_dmi_state_pack.size,
> > -                                           enc_dmi_state_pack.data) );
> > -
> > -  TPMTRYRETURN( envelope_decrypt( &enc_dmi_abuf,
> > -                                   vtpm_globals->manager_tcs_handle,
> > -                                   vtpm_globals->storageKeyHandle,
> > -                                   (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
> > -                                   &clear_dmi_blob) );
> > -
> > -  // Create new dmi
> > -  TPMTRYRETURN( init_dmi(dmi_id, VTPM_TYPE_MIGRATABLE, &mig_dmi ) );
> > -
> > -  /** Open Blob **/
> > -  struct pack_buf_t dmi_state_pack;
> > -
> > -  BSG_UnpackList(clear_dmi_blob.bytes, 2,
> > -                 BSG_TPM_DIGEST, &mig_dmi->DMI_measurement,
> > -                 BSG_TPM_SIZE32_DATA, &dmi_state_pack);
> > -
> > -  TPMTRYRETURN( buffer_init_alias_convert(&dmi_state_abuf,
> > -                                          dmi_state_pack.size,
> > -                                          dmi_state_pack.data) );
> > -
> > -  TPMTRYRETURN( VTPM_Handle_Save_NVM(mig_dmi, &dmi_state_abuf, NULL ) );
> > -
> > -  status=TPM_SUCCESS;
> > -  goto egress;
> > -
> > - abort_egress:
> > -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Migration IN of instance %d failed because of %s.\n", dmi_id, tpm_get_error_name(status) );
> > -
> > - egress:
> > -  buffer_free(&clear_dmi_blob);
> > -  buffer_free(&dmi_state_abuf);
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTPM_Handle_Migrate_Out( const buffer_t *param_buf,
> > -                                    buffer_t *result_buf) {
> > -
> > -  TPM_RESULT status=TPM_FAIL;
> > -  VTPM_DMI_RESOURCE *mig_dmi;
> > -  UINT32 dmi_id;
> > -  VTPM_MIGKEY_LIST *last_mig, *mig_key;
> > -  buffer_t dmi_state=NULL_BUF, clear_dmi_blob=NULL_BUF;
> > -
> > -  if (param_buf == NULL) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Migration Out Failed due to bad parameter.\n");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  struct pack_buf_t name_pack;
> > -
> > -  BSG_UnpackList( param_buf->bytes, 2,
> > -                  BSG_TYPE_UINT32, &dmi_id,
> > -                  BSG_TPM_SIZE32_DATA, &name_pack);
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Migrating out dmi %d.\n", dmi_id);
> > -
> > -  mig_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> > -  if (mig_dmi == NULL) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Non-existent VTPM instance (%d) in migration.\n", dmi_id );
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if (mig_dmi->dmi_type != VTPM_TYPE_MIGRATABLE) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Bad VTPM type (%d) in migration of instance (%d).\n", mig_dmi->dmi_type, dmi_id );
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  /** Find migration key for dest **/
> > -  last_mig = NULL;
> > -  mig_key = vtpm_globals->mig_keys;
> > -  while (mig_key != NULL) {
> > -    if (mig_key->name_size == name_pack.size)
> > -      if (memcmp(mig_key->name, name_pack.data, name_pack.size) == 0) {
> > -        break;
> > -      }
> > -
> > -    last_mig = mig_key;
> > -    mig_key = mig_key->next;
> > -  }
> > -
> > -  if (!mig_key) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Unknown Migration target host.\n");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  /** Mark vtpm as migrated **/
> > -  mig_dmi->dmi_type = VTPM_TYPE_MIGRATED;
> > -
> > -  /** Build Blob **/
> > -  TPMTRYRETURN( VTPM_Handle_Load_NVM(mig_dmi, NULL, &dmi_state) );
> > -
> > -  TPMTRYRETURN( buffer_init(&clear_dmi_blob, sizeof(TPM_DIGEST) + sizeof(UINT32) + buffer_len(&dmi_state), NULL ) );
> > -
> > -  struct pack_constbuf_t dmi_state_pack;
> > -
> > -  dmi_state_pack.size = buffer_len(&dmi_state);
> > -  dmi_state_pack.data = dmi_state.bytes;
> > -
> > -  BSG_PackList(clear_dmi_blob.bytes, 2,
> > -               BSG_TPM_DIGEST, &mig_dmi->DMI_measurement,
> > -               BSG_TPM_SIZE32_DATA, &dmi_state_pack);
> > -
> > -  /** Bind Blob **/
> > -  TPMTRYRETURN( envelope_encrypt( &clear_dmi_blob,
> > -                                  &mig_key->key,
> > -                                  result_buf) );
> > -
> > -  if (last_mig)
> > -    last_mig->next = mig_key->next;
> > -  else
> > -    vtpm_globals->mig_keys = mig_key->next;
> > -
> > -  free(mig_key->name);
> > -  free(mig_key);
> > -
> > -  status=TPM_SUCCESS;
> > -  goto egress;
> > -
> > - abort_egress:
> > -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Migration OUT of instance %d failed because of %s. Migratoin recovery may be needed.\n", dmi_id, tpm_get_error_name(status) );
> > -
> > -    //TODO: Create and implement a policy for what happens to mig_key on failed migrations.
> > -
> > - egress:
> > -
> > -  buffer_free(&clear_dmi_blob);
> > -  buffer_free(&dmi_state);
> > -
> > -  return status;
> > -}
> > -
> > -
> > -TPM_RESULT VTPM_Handle_Get_Migration_key( const buffer_t *param_buf,
> > -                                          buffer_t *result_buf) {
> > -
> > -  TPM_RESULT status=TPM_FAIL;
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Getting Migration Public Key.\n");
> > -
> > -  struct pack_buf_t pubkey_exp_pack, pubkey_mod_pack;
> > -  TPM_KEY mig_key;
> > -
> > -  // Unpack/return key structure
> > -  BSG_Unpack(BSG_TPM_KEY, vtpm_globals->storageKeyWrap.bytes , &mig_key);
> > -  TPM_RSA_KEY_PARMS rsaKeyParms;
> > -
> > -  BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
> > -               mig_key.algorithmParms.parms,
> > -               &rsaKeyParms);
> > -
> > -  pubkey_exp_pack.size = rsaKeyParms.exponentSize;
> > -  pubkey_exp_pack.data = rsaKeyParms.exponent;
> > -  pubkey_mod_pack.size = mig_key.pubKey.keyLength;
> > -  pubkey_mod_pack.data = mig_key.pubKey.key;
> > -
> > -  TPMTRYRETURN( buffer_init( result_buf, 2*sizeof(UINT32) +
> > -                                         pubkey_exp_pack.size +
> > -                                         pubkey_mod_pack.size, NULL ) );
> > -
> > -  BSG_PackList( result_buf->bytes, 2,
> > -                  BSG_TPM_SIZE32_DATA, &pubkey_exp_pack,
> > -                  BSG_TPM_SIZE32_DATA, &pubkey_mod_pack);
> > -
> > -
> > -  status=TPM_SUCCESS;
> > -  goto egress;
> > -
> > - abort_egress:
> > -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Get Migration Key failed because of %s.\n", tpm_get_error_name(status) );
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTPM_Handle_Load_Migration_key( const buffer_t *param_buf,
> > -                                           buffer_t *result_buf) {
> > -
> > -  TPM_RESULT status=TPM_FAIL;
> > -  VTPM_MIGKEY_LIST *mig_key;
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Loading Migration Public Key.\n");
> > -
> > -  //FIXME: Review all uses of unpacking pack_buf_t and ensure free.
> > -  //FIXME: Review all declarations/initializations of buffer_t that could have a goto that skips them and then tries to free them
> > -
> > -  struct pack_buf_t name_pack, pubkey_exp_pack, pubkey_mod_pack;
> > -
> > -  //FIXME: scan list and verify name is not already in the list
> > -
> > -  BSG_UnpackList( param_buf->bytes, 3,
> > -                  BSG_TPM_SIZE32_DATA, &name_pack,
> > -                  BSG_TPM_SIZE32_DATA, &pubkey_exp_pack,
> > -                  BSG_TPM_SIZE32_DATA, &pubkey_mod_pack);
> > -
> > -  //TODO: Maintain a persistent list for pub_keys.
> > -  //TODO: Verify pub_key is trusted
> > -
> > -  mig_key = (VTPM_MIGKEY_LIST *) malloc(sizeof(VTPM_MIGKEY_LIST));
> > -  memset(mig_key, 0, sizeof(VTPM_MIGKEY_LIST) );
> > -  mig_key->name_size = name_pack.size;
> > -  mig_key->name = name_pack.data;
> > -
> > -  mig_key->key.encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
> > -  Crypto_RSABuildCryptoInfoPublic( pubkey_exp_pack.size,
> > -                                   pubkey_exp_pack.data,
> > -                                   pubkey_mod_pack.size,
> > -                                   pubkey_mod_pack.data,
> > -                                   &mig_key->key);
> > -
> > -
> > -  mig_key->next = vtpm_globals->mig_keys;
> > -  vtpm_globals->mig_keys = mig_key;
> > -
> > -  // free(name_pack.data); Do not free. data is now part of mig_key.
> > -  free(pubkey_exp_pack.data);
> > -  free(pubkey_mod_pack.data);
> > -
> > -  return TPM_SUCCESS;
> > -}
> > diff --git a/tools/vtpm_manager/manager/securestorage.c b/tools/vtpm_manager/manager/securestorage.c
> > deleted file mode 100644
> > index d5e6ffd..0000000
> > --- a/tools/vtpm_manager/manager/securestorage.c
> > +++ /dev/null
> > @@ -1,512 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// securestorage.c
> > -//
> > -//  Functions regarding securely storing DMI secrets.
> > -//
> > -// ==================================================================
> > -
> > -#include <sys/types.h>
> > -#include <sys/stat.h>
> > -#include <fcntl.h>
> > -#include <unistd.h>
> > -#include <string.h>
> > -
> > -#include "tcg.h"
> > -#include "vtpm_manager.h"
> > -#include "vtpmpriv.h"
> > -#include "vtsp.h"
> > -#include "bsg.h"
> > -#include "crypto.h"
> > -#include "hashtable.h"
> > -#include "hashtable_itr.h"
> > -#include "buffer.h"
> > -#include "log.h"
> > -
> > -TPM_RESULT envelope_encrypt(const buffer_t     *inbuf,
> > -                            CRYPTO_INFO        *asymkey,
> > -                            buffer_t           *sealed_data) {
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  symkey_t    symkey;
> > -  buffer_t    data_cipher = NULL_BUF,
> > -              symkey_cipher = NULL_BUF;
> > -
> > -  UINT32 i;
> > -  struct pack_constbuf_t symkey_cipher32, data_cipher32;
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Enveloping Input[%d]: 0x", buffer_len(inbuf));
> > -  for (i=0; i< buffer_len(inbuf); i++)
> > -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", inbuf->bytes[i]);
> > -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -
> > -  // Generate a sym key and encrypt state with it
> > -  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_symcrypto_genkey (&symkey) );
> > -  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_symcrypto_encrypt (&symkey, inbuf, &data_cipher) );
> > -
> > -  // Encrypt symmetric key
> > -  TPMTRYRETURN( VTSP_Bind(    asymkey,
> > -                             &symkey.key,
> > -                             &symkey_cipher) );
> > -
> > -  // Create output blob: symkey_size + symkey_cipher + state_cipher_size + state_cipher
> > -
> > -  symkey_cipher32.size = buffer_len(&symkey_cipher);
> > -  symkey_cipher32.data = symkey_cipher.bytes;
> > -
> > -  data_cipher32.size = buffer_len(&data_cipher);
> > -  data_cipher32.data = data_cipher.bytes;
> > -
> > -  TPMTRYRETURN( buffer_init(sealed_data, 2 * sizeof(UINT32) + symkey_cipher32.size + data_cipher32.size, NULL));
> > -
> > -  BSG_PackList(sealed_data->bytes, 2,
> > -              BSG_TPM_SIZE32_DATA, &symkey_cipher32,
> > -              BSG_TPM_SIZE32_DATA, &data_cipher32);
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Saved %d bytes of E(symkey) + %d bytes of E(data)\n", buffer_len(&symkey_cipher), buffer_len(&data_cipher));
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Enveloping Output[%d]: 0x", buffer_len(sealed_data));
> > -  for (i=0; i< buffer_len(sealed_data); i++)
> > -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", sealed_data->bytes[i]);
> > -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to envelope encrypt\n.");
> > -
> > - egress:
> > -
> > -  buffer_free ( &data_cipher);
> > -  buffer_free ( &symkey_cipher);
> > -  Crypto_symcrypto_freekey (&symkey);
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT envelope_decrypt(const buffer_t     *cipher,
> > -                            TCS_CONTEXT_HANDLE TCSContext,
> > -                           TPM_HANDLE         keyHandle,
> > -                           const TPM_AUTHDATA *key_usage_auth,
> > -                            buffer_t           *unsealed_data) {
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  symkey_t    symkey;
> > -  buffer_t    data_cipher = NULL_BUF,
> > -              symkey_clear = NULL_BUF,
> > -              symkey_cipher = NULL_BUF;
> > -  struct pack_buf_t symkey_cipher32, data_cipher32;
> > -  int i;
> > -
> > -  memset(&symkey, 0, sizeof(symkey_t));
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Envelope Decrypt Input[%d]: 0x", buffer_len(cipher) );
> > -  for (i=0; i< buffer_len(cipher); i++)
> > -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cipher->bytes[i]);
> > -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -
> > -  BSG_UnpackList(cipher->bytes, 2,
> > -                BSG_TPM_SIZE32_DATA, &symkey_cipher32,
> > -                BSG_TPM_SIZE32_DATA, &data_cipher32);
> > -
> > -  TPMTRYRETURN( buffer_init_alias_convert (&symkey_cipher,
> > -                                          symkey_cipher32.size,
> > -                                          symkey_cipher32.data) );
> > -
> > -  TPMTRYRETURN( buffer_init_alias_convert (&data_cipher,
> > -                                          data_cipher32.size,
> > -                                          data_cipher32.data) );
> > -
> > -  // Decrypt Symmetric Key
> > -  TPMTRYRETURN( VTSP_Unbind(  TCSContext,
> > -                             keyHandle,
> > -                             &symkey_cipher,
> > -                             key_usage_auth,
> > -                             &symkey_clear,
> > -                             &(vtpm_globals->keyAuth) ) );
> > -
> > -  // create symmetric key using saved bits
> > -  Crypto_symcrypto_initkey (&symkey, &symkey_clear);
> > -
> > -  // Decrypt State
> > -  TPMTRY(TPM_DECRYPT_ERROR, Crypto_symcrypto_decrypt (&symkey, &data_cipher, unsealed_data) );
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Envelope Decrypte Output[%d]: 0x", buffer_len(unsealed_data));
> > -  for (i=0; i< buffer_len(unsealed_data); i++)
> > -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", unsealed_data->bytes[i]);
> > -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to envelope decrypt data\n.");
> > -
> > - egress:
> > -  buffer_free ( &data_cipher);
> > -  buffer_free ( &symkey_clear);
> > -  buffer_free ( &symkey_cipher);
> > -  Crypto_symcrypto_freekey (&symkey);
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTPM_Handle_Save_NVM(VTPM_DMI_RESOURCE *myDMI,
> > -                               const buffer_t *inbuf,
> > -                               buffer_t *outbuf) {
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  int fh;
> > -  long bytes_written;
> > -  buffer_t sealed_NVM = NULL_BUF;
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Saving %d bytes of NVM.\n", buffer_len(inbuf));
> > -
> > -  TPMTRYRETURN( envelope_encrypt(inbuf,
> > -                                 &vtpm_globals->storageKey,
> > -                                 &sealed_NVM) );
> > -
> > -  // Write sealed blob off disk from NVMLocation
> > -  // TODO: How to properly return from these. Do we care if we return failure
> > -  //       after writing the file? We can't get the old one back.
> > -  // TODO: Backup old file and try and recover that way.
> > -  fh = open(myDMI->NVMLocation, O_WRONLY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
> > -  if ( (bytes_written = write(fh, sealed_NVM.bytes, buffer_len(&sealed_NVM) ) != (long) buffer_len(&sealed_NVM))) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "We just overwrote a DMI_NVM and failed to finish. %ld/%ld bytes.\n", bytes_written, (long)buffer_len(&sealed_NVM));
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -  close(fh);
> > -
> > -  Crypto_SHA1Full (sealed_NVM.bytes, buffer_len(&sealed_NVM), (BYTE *) &myDMI->NVM_measurement);
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to save NVM\n.");
> > -
> > - egress:
> > -  buffer_free(&sealed_NVM);
> > -  return status;
> > -}
> > -
> > -
> > -/* Expected Params: inbuf = null, outbuf = sealed blob size, sealed blob.*/
> > -TPM_RESULT VTPM_Handle_Load_NVM(VTPM_DMI_RESOURCE *myDMI,
> > -                               const buffer_t    *inbuf,
> > -                               buffer_t          *outbuf) {
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  buffer_t sealed_NVM = NULL_BUF;
> > -  long fh_size;
> > -  int fh, stat_ret, i;
> > -  struct stat file_stat;
> > -  TPM_DIGEST sealedNVMHash;
> > -
> > -  if (myDMI->NVMLocation == NULL) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to load NVM because the file name NULL.\n");
> > -    status = TPM_AUTHFAIL;
> > -    goto abort_egress;
> > -  }
> > -
> > -  //Read sealed blob off disk from NVMLocation
> > -  fh = open(myDMI->NVMLocation, O_RDONLY);
> > -  stat_ret = fstat(fh, &file_stat);
> > -  if (stat_ret == 0)
> > -    fh_size = file_stat.st_size;
> > -  else {
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  TPMTRYRETURN( buffer_init( &sealed_NVM, fh_size, NULL) );
> > -  if (read(fh, sealed_NVM.bytes, buffer_len(&sealed_NVM)) != fh_size) {
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -  close(fh);
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Load_NVMing[%d],\n", buffer_len(&sealed_NVM));
> > -
> > -  Crypto_SHA1Full(sealed_NVM.bytes, buffer_len(&sealed_NVM), (BYTE *) &sealedNVMHash);
> > -
> > -  // Verify measurement of sealed blob.
> > -  if (memcmp(&sealedNVMHash, &myDMI->NVM_measurement, sizeof(TPM_DIGEST)) ) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM LoadNVM NVM measurement check failed.\n");
> > -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Correct hash: ");
> > -    for (i=0; i< sizeof(TPM_DIGEST); i++)
> > -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", ((BYTE*)&myDMI->NVM_measurement)[i]);
> > -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -
> > -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Measured hash: ");
> > -    for (i=0; i< sizeof(TPM_DIGEST); i++)
> > -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", ((BYTE*)&sealedNVMHash)[i]);
> > -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -
> > -    status = TPM_AUTHFAIL;
> > -    goto abort_egress;
> > -  }
> > -
> > -  TPMTRYRETURN( envelope_decrypt(&sealed_NVM,
> > -                                 myDMI->TCSContext,
> > -                                vtpm_globals->storageKeyHandle,
> > -                                (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
> > -                                 outbuf) );
> > -  goto egress;
> > -
> > - abort_egress:
> > -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to load NVM\n.");
> > -
> > - egress:
> > -  buffer_free( &sealed_NVM );
> > -
> > -  return status;
> > -}
> > -
> > -
> > -TPM_RESULT VTPM_SaveManagerData(void) {
> > -  TPM_RESULT status=TPM_SUCCESS;
> > -  int fh, dmis=-1;
> > -
> > -  BYTE *flat_boot_key=NULL, *flat_dmis=NULL, *flat_enc=NULL;
> > -  buffer_t clear_flat_global=NULL_BUF, enc_flat_global=NULL_BUF;
> > -  UINT32 storageKeySize = buffer_len(&vtpm_globals->storageKeyWrap);
> > -  UINT32 bootKeySize = buffer_len(&vtpm_globals->bootKeyWrap);
> > -  struct pack_buf_t storage_key_pack = {storageKeySize, vtpm_globals->storageKeyWrap.bytes};
> > -  struct pack_buf_t boot_key_pack = {bootKeySize, vtpm_globals->bootKeyWrap.bytes};
> > -  BYTE vtpm_manager_gen = VTPM_MANAGER_GEN;
> > -
> > -  struct hashtable_itr *dmi_itr;
> > -  VTPM_DMI_RESOURCE *dmi_res;
> > -
> > -  UINT32 boot_key_size = 0, flat_dmis_size = 0;
> > -
> > -  // Initially fill these with buffer sizes for each data type. Later fill
> > -  // in actual size, once flattened.
> > -  boot_key_size =  sizeof(UINT32) +       // bootkeysize
> > -                   bootKeySize;           // boot key
> > -
> > -  TPMTRYRETURN(buffer_init(&clear_flat_global,sizeof(BYTE) + // manager version
> > -                                              3*sizeof(TPM_DIGEST) + // Auths
> > -                                              sizeof(UINT32) +// storagekeysize
> > -                                              storageKeySize, NULL) ); // storage key
> > -
> > -
> > -  flat_boot_key = (BYTE *) malloc( boot_key_size );
> > -  flat_enc = (BYTE *) malloc( sizeof(UINT32) );
> > -
> > -  boot_key_size = BSG_PackList(flat_boot_key, 1,
> > -                               BSG_TPM_SIZE32_DATA, &boot_key_pack);
> > -
> > -  BSG_PackList(clear_flat_global.bytes, 4,
> > -                BSG_TYPE_BYTE,    &vtpm_manager_gen,
> > -                BSG_TPM_AUTHDATA, &vtpm_globals->owner_usage_auth,
> > -                BSG_TPM_SECRET,   &vtpm_globals->storage_key_usage_auth,
> > -                BSG_TPM_SIZE32_DATA, &storage_key_pack);
> > -
> > -  TPMTRYRETURN(envelope_encrypt(&clear_flat_global,
> > -                                &vtpm_globals->bootKey,
> > -                                &enc_flat_global) );
> > -
> > -  BSG_PackConst(buffer_len(&enc_flat_global), 4, flat_enc);
> > -
> > -  // Per DMI values to be saved (if any exit)
> > -  if (hashtable_count(vtpm_globals->dmi_map) > 1) {
> > -
> > -    flat_dmis = (BYTE *) malloc(
> > -                     (hashtable_count(vtpm_globals->dmi_map) - 1) * // num DMIS (-1 for Dom0)
> > -                     (sizeof(UINT32) +sizeof(BYTE) + 2*sizeof(TPM_DIGEST)) ); // Per DMI info
> > -
> > -    dmi_itr = hashtable_iterator(vtpm_globals->dmi_map);
> > -    do {
> > -      dmi_res = (VTPM_DMI_RESOURCE *) hashtable_iterator_value(dmi_itr);
> > -      dmis++;
> > -
> > -      // No need to save dmi0.
> > -      if (dmi_res->dmi_id == 0)
> > -        continue;
> > -
> > -
> > -      flat_dmis_size += BSG_PackList( flat_dmis + flat_dmis_size, 4,
> > -                                        BSG_TYPE_UINT32, &dmi_res->dmi_id,
> > -                                        BSG_TYPE_BYTE, &dmi_res->dmi_type,
> > -                                        BSG_TPM_DIGEST, &dmi_res->NVM_measurement,
> > -                                        BSG_TPM_DIGEST, &dmi_res->DMI_measurement);
> > -
> > -    } while (hashtable_iterator_advance(dmi_itr));
> > -  }
> > -
> > -  fh = open(STATE_FILE, O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
> > -  if (fh == -1) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to open %s file for write.\n", STATE_FILE);
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if ( ( write(fh, flat_boot_key, boot_key_size) != boot_key_size ) ||
> > -       ( write(fh, flat_enc, sizeof(UINT32)) != sizeof(UINT32) ) ||
> > -       ( write(fh, enc_flat_global.bytes, buffer_len(&enc_flat_global)) != buffer_len(&enc_flat_global) ) ||
> > -       ( write(fh, flat_dmis, flat_dmis_size) != flat_dmis_size ) ) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to completely write service data.\n");
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > - }
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  free(flat_boot_key);
> > -  free(flat_enc);
> > -  buffer_free(&enc_flat_global);
> > -  free(flat_dmis);
> > -  close(fh);
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Saved VTPM Manager state (status = %d, dmis = %d)\n", (int) status, dmis);
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTPM_LoadManagerData(void) {
> > -
> > -  TPM_RESULT status=TPM_SUCCESS;
> > -  int fh, stat_ret, dmis=0;
> > -  long fh_size = 0, step_size;
> > -  BYTE *flat_table=NULL;
> > -  buffer_t  unsealed_data, enc_table_abuf;
> > -  struct pack_buf_t storage_key_pack, boot_key_pack;
> > -  UINT32 *dmi_id_key, enc_size;
> > -  BYTE vtpm_manager_gen;
> > -
> > -  VTPM_DMI_RESOURCE *dmi_res;
> > -  UINT32 dmi_id;
> > -  BYTE dmi_type;
> > -  struct stat file_stat;
> > -
> > -  TPM_HANDLE boot_key_handle;
> > -  TPM_AUTHDATA boot_usage_auth;
> > -  memset(&boot_usage_auth, 0, sizeof(TPM_AUTHDATA));
> > -
> > -  fh = open(STATE_FILE, O_RDONLY );
> > -  stat_ret = fstat(fh, &file_stat);
> > -  if (stat_ret == 0)
> > -    fh_size = file_stat.st_size;
> > -  else {
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  flat_table = (BYTE *) malloc(fh_size);
> > -
> > -  if ((long) read(fh, flat_table, fh_size) != fh_size ) {
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  // Read Boot Key
> > -  step_size = BSG_UnpackList( flat_table, 2,
> > -                              BSG_TPM_SIZE32_DATA, &boot_key_pack,
> > -                              BSG_TYPE_UINT32, &enc_size);
> > -
> > -  TPMTRYRETURN(buffer_init(&vtpm_globals->bootKeyWrap, 0, 0) );
> > -  TPMTRYRETURN(buffer_init_alias_convert(&enc_table_abuf, enc_size, flat_table + step_size) );
> > -  TPMTRYRETURN(buffer_append_raw(&vtpm_globals->bootKeyWrap, boot_key_pack.size, boot_key_pack.data) );
> > -
> > -  //Load Boot Key
> > -  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
> > -                              TPM_SRK_KEYHANDLE,
> > -                              &vtpm_globals->bootKeyWrap,
> > -                              &SRK_AUTH,
> > -                              &boot_key_handle,
> > -                              &vtpm_globals->keyAuth,
> > -                              &vtpm_globals->bootKey,
> > -                              FALSE) );
> > -
> > -  TPMTRYRETURN( envelope_decrypt(&enc_table_abuf,
> > -                                 vtpm_globals->manager_tcs_handle,
> > -                                 boot_key_handle,
> > -                                 (const TPM_AUTHDATA*) &boot_usage_auth,
> > -                                 &unsealed_data) );
> > -  step_size += enc_size;
> > -
> > -  if (*unsealed_data.bytes != VTPM_MANAGER_GEN) {
> > -      // Once there is more than one gen, this will include some compatability stuff
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Warning: Manager Data file is gen %d, which this manager is gen %d.\n", vtpm_manager_gen, VTPM_MANAGER_GEN);
> > -  }
> > -
> > -  // Global Values needing to be saved
> > -  BSG_UnpackList( unsealed_data.bytes, 4,
> > -                  BSG_TYPE_BYTE,    &vtpm_manager_gen,
> > -                  BSG_TPM_AUTHDATA, &vtpm_globals->owner_usage_auth,
> > -                  BSG_TPM_SECRET,   &vtpm_globals->storage_key_usage_auth,
> > -                  BSG_TPM_SIZE32_DATA, &storage_key_pack);
> > -
> > -  TPMTRYRETURN(buffer_init(&vtpm_globals->storageKeyWrap, 0, 0) );
> > -  TPMTRYRETURN(buffer_append_raw(&vtpm_globals->storageKeyWrap, storage_key_pack.size, storage_key_pack.data) );
> > -
> > -  // Per DMI values to be saved
> > -  while ( step_size < fh_size ){
> > -    if (fh_size - step_size < (long) (sizeof(UINT32) + sizeof(BYTE) + 2*sizeof(TPM_DIGEST))) {
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Encountered %ld extra bytes at end of manager state.\n", fh_size-step_size);
> > -      step_size = fh_size;
> > -    } else {
> > -      step_size += BSG_UnpackList(flat_table + step_size, 2,
> > -                                 BSG_TYPE_UINT32, &dmi_id,
> > -                                 BSG_TYPE_BYTE, &dmi_type);
> > -
> > -      //TODO: Try and gracefully recover from problems.
> > -      TPMTRYRETURN(init_dmi(dmi_id, dmi_type, &dmi_res) );
> > -      dmis++;
> > -
> > -      step_size += BSG_UnpackList(flat_table + step_size, 2,
> > -                                 BSG_TPM_DIGEST, &dmi_res->NVM_measurement,
> > -                                 BSG_TPM_DIGEST, &dmi_res->DMI_measurement);
> > -    }
> > -
> > -  }
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Loaded saved state (dmis = %d).\n", dmis);
> > -  goto egress;
> > -
> > - abort_egress:
> > -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to load service data with error = %s\n", tpm_get_error_name(status));
> > - egress:
> > -
> > -  free(flat_table);
> > -  close(fh);
> > -
> > -  // TODO: Could be nice and evict BootKey. (Need to add EvictKey to VTSP.
> > -
> > -  return status;
> > -}
> > -
> > diff --git a/tools/vtpm_manager/manager/tpmpassthrough.c b/tools/vtpm_manager/manager/tpmpassthrough.c
> > deleted file mode 100644
> > index 9b1e5f8..0000000
> > --- a/tools/vtpm_manager/manager/tpmpassthrough.c
> > +++ /dev/null
> > @@ -1,110 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// tpmpassthrough.c
> > -//
> > -//  Functions regarding passing DMI requests to HWTPM
> > -//
> > -// ==================================================================
> > -
> > -#include "tcg.h"
> > -#include "vtpm_manager.h"
> > -#include "vtpmpriv.h"
> > -#include "vtsp.h"
> > -#include "log.h"
> > -
> > -TPM_RESULT VTPM_Handle_TPM_Command( VTPM_DMI_RESOURCE *dmi,
> > -                                   buffer_t *inbuf,
> > -                                   buffer_t *outbuf) {
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_COMMAND_CODE *ord;
> > -
> > -  ord = (TPM_COMMAND_CODE *) (inbuf->bytes + sizeof(TPM_TAG) + sizeof(UINT32));
> > -
> > -  switch (*ord) {
> > -
> > -    // Forbidden for DMI use
> > -  case TPM_ORD_TakeOwnership:
> > -  case TPM_ORD_ChangeAuthOwner:
> > -  case TPM_ORD_DirWriteAuth:
> > -  case TPM_ORD_DirRead:
> > -  case TPM_ORD_AuthorizeMigrationKey:
> > -  case TPM_ORD_CreateMaintenanceArchive:
> > -  case TPM_ORD_LoadMaintenanceArchive:
> > -  case TPM_ORD_KillMaintenanceFeature:
> > -  case TPM_ORD_LoadManuMaintPub:
> > -  case TPM_ORD_ReadManuMaintPub:
> > -  case TPM_ORD_SelfTestFull:
> > -  case TPM_ORD_SelfTestStartup:
> > -  case TPM_ORD_CertifySelfTest:
> > -  case TPM_ORD_ContinueSelfTest:
> > -  case TPM_ORD_GetTestResult:
> > -  case TPM_ORD_Reset:
> > -  case TPM_ORD_OwnerClear:
> > -  case TPM_ORD_DisableOwnerClear:
> > -  case TPM_ORD_ForceClear:
> > -  case TPM_ORD_DisableForceClear:
> > -  case TPM_ORD_GetCapabilityOwner:
> > -  case TPM_ORD_OwnerSetDisable:
> > -  case TPM_ORD_PhysicalEnable:
> > -  case TPM_ORD_PhysicalDisable:
> > -  case TPM_ORD_SetOwnerInstall:
> > -  case TPM_ORD_PhysicalSetDeactivated:
> > -  case TPM_ORD_SetTempDeactivated:
> > -  case TPM_ORD_CreateEndorsementKeyPair:
> > -  case TPM_ORD_GetAuditEvent:
> > -  case TPM_ORD_GetAuditEventSigned:
> > -  case TPM_ORD_GetOrdinalAuditStatus:
> > -  case TPM_ORD_SetOrdinalAuditStatus:
> > -  case TPM_ORD_SetRedirection:
> > -  case TPM_ORD_FieldUpgrade:
> > -  case TSC_ORD_PhysicalPresence:
> > -    status = TPM_DISABLED_CMD;
> > -    goto abort_egress;
> > -    break;
> > -
> > -  } // End ORD Switch
> > -
> > -  // Call TCS with command
> > -
> > -  TPMTRY(TPM_IOERROR, VTSP_RawTransmit( dmi->TCSContext,inbuf, outbuf) );
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -  vtpmloginfo(VTPM_LOG_VTPM, "TPM Command Failed in tpmpassthrough.\n");
> > - egress:
> > -
> > -  return status;
> > -}
> > diff --git a/tools/vtpm_manager/manager/vtpm_ipc.c b/tools/vtpm_manager/manager/vtpm_ipc.c
> > deleted file mode 100644
> > index 319dc83..0000000
> > --- a/tools/vtpm_manager/manager/vtpm_ipc.c
> > +++ /dev/null
> > @@ -1,141 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_ipc.c Implements ipc routines using file io. This file can
> > -// be replaced with other ipc types.
> > -//
> > -// ===================================================================
> > -
> > -#include <sys/stat.h>
> > -#include "vtpm_ipc.h"
> > -#include "vtpmpriv.h"
> > -#include "log.h"
> > -
> > -int vtpm_ipc_init(vtpm_ipc_handle_t *ipc_h, char* name, int flags, BOOL create) {
> > -  ipc_h->name = name;
> > -  ipc_h->flags = flags;
> > -  ipc_h->fh = VTPM_IPC_CLOSED;
> > -
> > -  if (create)
> > -    return(vtpm_ipc_create(ipc_h));
> > -  else
> > -    return 0;
> > -}
> > -
> > -// Create the file that needs opening. Used only for FIFOs
> > -// FYI: This may cause problems in other file IO schemes. We'll see.
> > -int vtpm_ipc_create(vtpm_ipc_handle_t *ipc_h) {
> > -  int fh;
> > -  struct stat file_info;
> > -
> > -  if ((!ipc_h) || (!ipc_h->name))
> > -    return -1;
> > -
> > -  if ( stat(ipc_h->name, &file_info) == -1) {
> > -    if ( mkfifo(ipc_h->name, S_IWUSR | S_IRUSR ) ) {
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Failed to create fifo %s.\n", ipc_h->name);
> > -      return -1;
> > -    }
> > -  }
> > -
> > -  ipc_h->fh = VTPM_IPC_CLOSED;
> > -
> > -  return 0;
> > -}
> > -
> > -
> > -// Read size bytes. If FH isn't open, open it.
> > -int vtpm_ipc_read(vtpm_ipc_handle_t *ipc_h, vtpm_ipc_handle_t *alt_ipc_h, BYTE *bytes, UINT32 size){
> > -  vtpm_ipc_handle_t *my_ipc_h;
> > -  int result;
> > -
> > -  if (ipc_h) {
> > -    my_ipc_h = ipc_h;
> > -  } else {
> > -    my_ipc_h = alt_ipc_h;
> > -  }
> > -
> > -  if (my_ipc_h->fh == VTPM_IPC_CLOSED) {
> > -    my_ipc_h->fh = open(my_ipc_h->name, my_ipc_h->flags);
> > -  }
> > -
> > -  if ( my_ipc_h->fh == VTPM_IPC_CLOSED ) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM ERROR: Can't open %s for reading.\n", my_ipc_h->name);
> > -    return -1;
> > -  }
> > -
> > -  result = read(my_ipc_h->fh, bytes, size);
> > -  if (result < 0) {
> > -    my_ipc_h->fh = VTPM_IPC_CLOSED;
> > -  }
> > -
> > -  return (result);
> > -}
> > -
> > -// Write size bytes. If FH isn't open, open it.
> > -int vtpm_ipc_write(vtpm_ipc_handle_t *ipc_h, vtpm_ipc_handle_t *alt_ipc_h, BYTE *bytes, UINT32 size) {
> > -  vtpm_ipc_handle_t *my_ipc_h;
> > -  int result;
> > -
> > -  if (ipc_h) {
> > -    my_ipc_h = ipc_h;
> > -  } else {
> > -    my_ipc_h = alt_ipc_h;
> > -  }
> > -
> > -  if (my_ipc_h->fh == VTPM_IPC_CLOSED) {
> > -    my_ipc_h->fh = open(my_ipc_h->name, my_ipc_h->flags);
> > -  }
> > -
> > -  if ( my_ipc_h->fh == VTPM_IPC_CLOSED ) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM ERROR: Can't open %s for writing.\n", my_ipc_h->name);
> > -    return -1;
> > -  }
> > -
> > -  result = write(my_ipc_h->fh, bytes, size);
> > -  if (result < 0) {
> > -    my_ipc_h->fh = VTPM_IPC_CLOSED;
> > -  }
> > -
> > -  return (result);
> > -}
> > -
> > -// Mark file as closed and try and close it. Errors not reported.
> > -void vtpm_ipc_close(vtpm_ipc_handle_t *ipc_h) {
> > -
> > -  if (ipc_h) {
> > -    close(ipc_h->fh);
> > -    ipc_h->fh = VTPM_IPC_CLOSED;
> > -  }
> > -
> > -}
> > diff --git a/tools/vtpm_manager/manager/vtpm_ipc.h b/tools/vtpm_manager/manager/vtpm_ipc.h
> > deleted file mode 100644
> > index 529c4a2..0000000
> > --- a/tools/vtpm_manager/manager/vtpm_ipc.h
> > +++ /dev/null
> > @@ -1,71 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_ipc.h Header for interprocess communication between VTPM manager
> > -// and Guests or VTPMs
> > -//
> > -// ===================================================================
> > -
> > -#ifndef __VTPM_IO_H__
> > -#define __VTPM_IO_H__
> > -
> > -#include "tcg.h"
> > -
> > -#define VTPM_IPC_CLOSED -1
> > -
> > -// Represents an (somewhat) abstracted io handle.
> > -typedef struct vtpm_ipc_handle_t {
> > -  int fh;              // IO handle.
> > -  int flags;           // Flags for opening. This may need to become
> > -                       // a void *, but for now files use an int.
> > -  char *name;          // Names for debugging as well as filenames
> > -                       // for file-based io.
> > -} vtpm_ipc_handle_t;
> > -
> > -
> > -int vtpm_ipc_init(vtpm_ipc_handle_t *ioh, char* name, int flags, BOOL create);
> > -
> > -// Create the file that needs opening. Used only for FIFOs
> > -// FYI: This may cause problems in other file IO schemes. We'll see.
> > -int vtpm_ipc_create(vtpm_ipc_handle_t *ioh);
> > -
> > -// Read size bytes. If FH isn't open, open it.
> > -int vtpm_ipc_read(vtpm_ipc_handle_t *ioh, vtpm_ipc_handle_t *alt_ioh, BYTE *bytes, UINT32 size);
> > -
> > -// Write size bytes. If FH isn't open, open it.
> > -int vtpm_ipc_write(vtpm_ipc_handle_t *ioh, vtpm_ipc_handle_t *alt_ioh, BYTE *bytes, UINT32 size);
> > -
> > -// Mark file as closed and try and close it. Errors not reported.
> > -void vtpm_ipc_close(vtpm_ipc_handle_t *ioh);
> > -
> > -#endif
> > diff --git a/tools/vtpm_manager/manager/vtpm_lock.c b/tools/vtpm_manager/manager/vtpm_lock.c
> > deleted file mode 100644
> > index e737d60..0000000
> > --- a/tools/vtpm_manager/manager/vtpm_lock.c
> > +++ /dev/null
> > @@ -1,63 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_lock.c Provided controlled sync around access to vtpm structures
> > -//
> > -// ===================================================================
> > -
> > -#include <pthread.h>
> > -#include "vtpm_lock.h"
> > -
> > -static pthread_rwlock_t vtpm_lock;
> > -
> > -void vtpm_lock_init() {
> > -
> > -  pthread_rwlock_init( &vtpm_lock, NULL);
> > -}
> > -
> > -void vtpm_lock_destroy(){
> > -  pthread_rwlock_destroy(&vtpm_lock);
> > -}
> > -
> > -void vtpm_lock_rdlock(){
> > -  pthread_rwlock_rdlock(&vtpm_lock);
> > -}
> > -
> > -void vtpm_lock_wrlock(){
> > -  pthread_rwlock_wrlock(&vtpm_lock);
> > -}
> > -
> > -void vtpm_lock_unlock(){
> > -  pthread_rwlock_unlock(&vtpm_lock);
> > -}
> > -
> > diff --git a/tools/vtpm_manager/manager/vtpm_lock.h b/tools/vtpm_manager/manager/vtpm_lock.h
> > deleted file mode 100644
> > index 53a339d..0000000
> > --- a/tools/vtpm_manager/manager/vtpm_lock.h
> > +++ /dev/null
> > @@ -1,48 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_lock.h Provided controlled sync around access to vtpm structures
> > -//
> > -// ===================================================================
> > -
> > -#ifndef __VTPM_LOCK_H__
> > -#define __VTPM_LOCK_H__
> > -
> > -void vtpm_lock_init();
> > -void vtpm_lock_destroy();
> > -
> > -void vtpm_lock_rdlock();
> > -void vtpm_lock_wrlock();
> > -void vtpm_lock_unlock();
> > -
> > -#endif
> > diff --git a/tools/vtpm_manager/manager/vtpm_manager.c b/tools/vtpm_manager/manager/vtpm_manager.c
> > deleted file mode 100644
> > index e089f78..0000000
> > --- a/tools/vtpm_manager/manager/vtpm_manager.c
> > +++ /dev/null
> > @@ -1,285 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_manager.c
> > -//
> > -//  This file will house the main logic of the VTPM Manager
> > -//
> > -// ==================================================================
> > -
> > -#include <stdio.h>
> > -#include <unistd.h>
> > -#include <string.h>
> > -
> > -#include "vtpm_manager.h"
> > -#include "vtpmpriv.h"
> > -#include "vtsp.h"
> > -#include "bsg.h"
> > -#include "hashtable.h"
> > -#include "hashtable_itr.h"
> > -
> > -#include "log.h"
> > -#include "buffer.h"
> > -
> > -VTPM_GLOBALS *vtpm_globals=NULL;
> > -
> > -// --------------------------- Well Known Auths --------------------------
> > -const TPM_AUTHDATA SRK_AUTH = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
> > -                                  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
> > -
> > -#ifdef WELL_KNOWN_OWNER_AUTH
> > -static BYTE FIXED_OWNER_AUTH[20] =  {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
> > -                                  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
> > -#endif
> > -
> > -
> > -// -------------------------- Hash table functions --------------------
> > -
> > -static unsigned int hashfunc32(void *ky) {
> > -  return (* (UINT32 *) ky);
> > -}
> > -
> > -static int equals32(void *k1, void *k2) {
> > -  return (*(UINT32 *) k1 == *(UINT32 *) k2);
> > -}
> > -
> > -// --------------------------- Functions ------------------------------
> > -
> > -TPM_RESULT VTPM_Create_Manager(){
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  // Generate Auth for Owner
> > -#ifdef WELL_KNOWN_OWNER_AUTH
> > -  memcpy(vtpm_globals->owner_usage_auth, FIXED_OWNER_AUTH, sizeof(TPM_AUTHDATA));
> > -#else
> > -  Crypto_GetRandom(vtpm_globals->owner_usage_auth, sizeof(TPM_AUTHDATA) );
> > -#endif
> > -
> > -  // Take Owership of TPM
> > -  CRYPTO_INFO ek_cryptoInfo;
> > -
> > -  status = VTSP_ReadPubek(vtpm_globals->manager_tcs_handle, &ek_cryptoInfo);
> > -
> > -  // If we can read PubEK then there is no owner and we should take it.
> > -  // We use the abilty to read the pubEK to flag that the TPM is owned.
> > -  // FIXME: Change to just trying to take ownership and react to the status
> > -  if (status == TPM_SUCCESS) {
> > -    TPMTRYRETURN(VTSP_TakeOwnership(vtpm_globals->manager_tcs_handle,
> > -                                   (const TPM_AUTHDATA*)&vtpm_globals->owner_usage_auth,
> > -                                   &SRK_AUTH,
> > -                                   &ek_cryptoInfo,
> > -                                   &vtpm_globals->keyAuth));
> > -
> > -    TPMTRYRETURN(VTSP_DisablePubekRead(vtpm_globals->manager_tcs_handle,
> > -                                       (const TPM_AUTHDATA*)&vtpm_globals->owner_usage_auth,
> > -                                       &vtpm_globals->keyAuth));
> > -  } else {
> > -    vtpmloginfo(VTPM_LOG_VTPM, "Failed to readEK meaning TPM has an owner. Creating Keys off existing SRK.\n");
> > -  }
> > -
> > -  // Generate storage key's auth
> > -  Crypto_GetRandom(  &vtpm_globals->storage_key_usage_auth,
> > -                    sizeof(TPM_AUTHDATA) );
> > -
> > -  TCS_AUTH osap;
> > -  TPM_AUTHDATA sharedsecret;
> > -
> > -  TPMTRYRETURN( VTSP_OSAP(vtpm_globals->manager_tcs_handle,
> > -                         TPM_ET_KEYHANDLE,
> > -                         TPM_SRK_KEYHANDLE,
> > -                         &SRK_AUTH,
> > -                         &sharedsecret,
> > -                         &osap) );
> > -
> > -  osap.fContinueAuthSession = FALSE;
> > -
> > -
> > -  TPMTRYRETURN( VTSP_CreateWrapKey( vtpm_globals->manager_tcs_handle,
> > -                                   TPM_KEY_BIND,
> > -                                   (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
> > -                                   TPM_SRK_KEYHANDLE,
> > -                                   (const TPM_AUTHDATA*)&sharedsecret,
> > -                                   &vtpm_globals->storageKeyWrap,
> > -                                   &osap) );
> > -
> > -  // Generate boot key's auth
> > -  TPM_AUTHDATA bootKeyWrapAuth;
> > -  memset(&bootKeyWrapAuth, 0, sizeof(bootKeyWrapAuth));
> > -
> > -  TPMTRYRETURN( VTSP_OSAP(vtpm_globals->manager_tcs_handle,
> > -                         TPM_ET_KEYHANDLE,
> > -                         TPM_SRK_KEYHANDLE,
> > -                         &SRK_AUTH,
> > -                         &sharedsecret,
> > -                         &osap) );
> > -
> > -  osap.fContinueAuthSession = FALSE;
> > -
> > -  // FIXME: This key protects the global secrets on disk. It should use TPM
> > -  //        PCR bindings to limit its use to legit configurations.
> > -  //        Current binds are open, implying a Trusted VM contains this code.
> > -  //        If this VM is not Trusted, use measurement and PCR bindings.
> > -  TPMTRYRETURN( VTSP_CreateWrapKey( vtpm_globals->manager_tcs_handle,
> > -                                   TPM_KEY_BIND,
> > -                                   (const TPM_AUTHDATA*)&bootKeyWrapAuth,
> > -                                   TPM_SRK_KEYHANDLE,
> > -                                   (const TPM_AUTHDATA*)&sharedsecret,
> > -                                   &vtpm_globals->bootKeyWrap,
> > -                                   &osap) );
> > -
> > -  // Populate CRYPTO_INFO vtpm_globals->bootKey. This does not load it into the TPM
> > -  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
> > -                              TPM_SRK_KEYHANDLE,
> > -                              &vtpm_globals->bootKeyWrap,
> > -                              NULL,
> > -                              NULL,
> > -                              NULL,
> > -                              &vtpm_globals->bootKey,
> > -                              TRUE ) );
> > -
> > -  TPMTRYRETURN( VTSP_SaveState(vtpm_globals->manager_tcs_handle) );
> > -  goto egress;
> > -
> > - abort_egress:
> > -  exit(1);
> > -
> > - egress:
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager (Status = %d).\n", status);
> > -  return status;
> > -
> > -}
> > -
> > -///////////////////////////////////////////////////////////////////////////////
> > -TPM_RESULT VTPM_Init_Manager() {
> > -  TPM_RESULT status = TPM_FAIL, serviceStatus;
> > -  BYTE *randomsead;
> > -  UINT32 randomsize=256;
> > -
> > -  if ((vtpm_globals = (VTPM_GLOBALS *) malloc(sizeof(VTPM_GLOBALS))) == NULL){
> > -    status = TPM_FAIL;
> > -    goto abort_egress;
> > -  }
> > -  memset(vtpm_globals, 0, sizeof(VTPM_GLOBALS));
> > -
> > -  vtpm_globals->connected_dmis = 0;
> > -
> > -  if ((vtpm_globals->dmi_map = create_hashtable(10, hashfunc32, equals32)) == NULL){
> > -    status = TPM_FAIL;
> > -    goto abort_egress;
> > -  }
> > -
> > -  // Create new TCS Object
> > -  vtpm_globals->manager_tcs_handle = 0;
> > -
> > -  TPMTRYRETURN(TCS_create());
> > -
> > -  // Create TCS Context for service
> > -  TPMTRYRETURN( TCS_OpenContext(&vtpm_globals->manager_tcs_handle ) );
> > -
> > -  TPMTRYRETURN( TCSP_GetRandom(vtpm_globals->manager_tcs_handle,
> > -                              &randomsize,
> > -                              &randomsead));
> > -
> > -  Crypto_Init(randomsead, randomsize);
> > -  TPMTRYRETURN( TCS_FreeMemory (vtpm_globals->manager_tcs_handle, randomsead));
> > -
> > -  // Create OIAP session for service's authorized commands
> > -  TPMTRYRETURN( VTSP_OIAP( vtpm_globals->manager_tcs_handle,
> > -                          &vtpm_globals->keyAuth) );
> > -  vtpm_globals->keyAuth.fContinueAuthSession = TRUE;
> > -
> > -  vtpm_globals->mig_keys = NULL;
> > -
> > -  // If fails, create new Manager.
> > -  serviceStatus = VTPM_LoadManagerData();
> > -  if (serviceStatus == TPM_IOERROR) {
> > -    vtpmloginfo(VTPM_LOG_VTPM, "Failed to read manager file. Assuming first time initialization.\n");
> > -    TPMTRYRETURN( VTPM_Create_Manager() );
> > -    TPMTRYRETURN( VTPM_SaveManagerData() );
> > -  } else if (serviceStatus != TPM_SUCCESS) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to read existing manager file");
> > -    exit(1);
> > -  }
> > -
> > -  //Load Storage Key
> > -  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
> > -                             TPM_SRK_KEYHANDLE,
> > -                             &vtpm_globals->storageKeyWrap,
> > -                             &SRK_AUTH,
> > -                             &vtpm_globals->storageKeyHandle,
> > -                             &vtpm_globals->keyAuth,
> > -                             &vtpm_globals->storageKey,
> > -                              FALSE ) );
> > -
> > -  // Create entry for Dom0 for control messages
> > -  TPMTRYRETURN( VTPM_Handle_New_DMI(NULL) );
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  return(status);
> > -}
> > -
> > -///////////////////////////////////////////////////////////////////////////////
> > -void VTPM_Stop_Manager() {
> > -  VTPM_DMI_RESOURCE *dmi_res;
> > -  struct hashtable_itr *dmi_itr;
> > -
> > -  // Close all the TCS contexts. TCS should evict keys based on this
> > -  if (hashtable_count(vtpm_globals->dmi_map) > 0) {
> > -    dmi_itr = hashtable_iterator(vtpm_globals->dmi_map);
> > -    do {
> > -      dmi_res = (VTPM_DMI_RESOURCE *) hashtable_iterator_value(dmi_itr);
> > -      if (dmi_res->connected)
> > -       close_dmi( dmi_res ); // Not really interested in return code
> > -
> > -    } while (hashtable_iterator_advance(dmi_itr));
> > -               free (dmi_itr);
> > -  }
> > -
> > -  if ( VTPM_SaveManagerData() != TPM_SUCCESS )
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to save manager data.\n");
> > -
> > -  TCS_CloseContext(vtpm_globals->manager_tcs_handle);
> > -  TCS_destroy();
> > -
> > -  hashtable_destroy(vtpm_globals->dmi_map, 1);
> > -  free(vtpm_globals);
> > -
> > -  Crypto_Exit();
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
> > -}
> > diff --git a/tools/vtpm_manager/manager/vtpm_manager.h b/tools/vtpm_manager/manager/vtpm_manager.h
> > deleted file mode 100644
> > index a324a8f..0000000
> > --- a/tools/vtpm_manager/manager/vtpm_manager.h
> > +++ /dev/null
> > @@ -1,150 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_manager.h
> > -//
> > -//  Public Interface header for VTPM Manager
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __VTPM_MANAGER_H__
> > -#define __VTPM_MANAGER_H__
> > -
> > -#define VTPM_TAG_REQ 0x01c1
> > -#define VTPM_TAG_RSP 0x01c4
> > -#define COMMAND_BUFFER_SIZE 4096
> > -
> > -// Header sizes. Note Header MAY include the DMI
> > -#define VTPM_COMMAND_HEADER_SIZE_CLT ( 2 + 4 + 4)
> > -//                    sizeof(TPM_TAG + UINT32 + TPM_COMMAND_CODE)
> > -#define VTPM_COMMAND_HEADER_SIZE_SRV ( 4 + VTPM_COMMAND_HEADER_SIZE_CLT )
> > -//                    sizeof( UINT32 + VTPM_COMMAND_HEADER_SIZE_CLT)
> > -
> > -//************************ Command Codes ****************************
> > -#define VTPM_ORD_BASE       0x0000
> > -#define VTPM_PRIV_MASK      0x01000000 // Priviledged VTPM Command
> > -#define VTPM_PRIV_BASE      (VTPM_ORD_BASE | VTPM_PRIV_MASK)
> > -
> > -// Non-priviledged VTPM Commands (From DMI's)
> > -#define VTPM_ORD_SAVENVM      (VTPM_ORD_BASE + 1) // DMI Saves Secrets
> > -#define VTPM_ORD_LOADNVM      (VTPM_ORD_BASE + 2) // DMI Loads Secrets
> > -#define VTPM_ORD_TPMCOMMAND   (VTPM_ORD_BASE + 3) // DMI issues HW TPM Command
> > -#define VTPM_ORD_GET_MIG_KEY  (VTPM_ORD_BASE + 4) // Get manager's migration key
> > -#define VTPM_ORD_LOAD_MIG_KEY (VTPM_ORD_BASE + 5) // load dest migration key
> > -
> > -// Priviledged VTPM Commands (From management console)
> > -#define VTPM_ORD_OPEN         (VTPM_PRIV_BASE + 1) // Creates/reopens DMI
> > -#define VTPM_ORD_CLOSE        (VTPM_PRIV_BASE + 2) // Closes a DMI
> > -#define VTPM_ORD_DELETE       (VTPM_PRIV_BASE + 3) // Permemently Deletes DMI
> > -#define VTPM_ORD_MIGRATE_IN   (VTPM_PRIV_BASE + 4) // Load migrated VTPM
> > -#define VTPM_ORD_MIGRATE_OUT  (VTPM_PRIV_BASE + 5) // migrate VTPM to dest
> > -
> > -//************************ Return Codes ****************************
> > -#define VTPM_TYPE_PVM 1 // Paravirtualized Domain
> > -#define VTPM_TYPE_HVM 2 // HVM Domain
> > -
> > -//************************ Return Codes ****************************
> > -#define VTPM_SUCCESS               0
> > -#define VTPM_FAIL                  1
> > -#define VTPM_UNSUPPORTED           2
> > -#define VTPM_FORBIDDEN             3
> > -#define VTPM_RESTORE_CONTEXT_FAILED    4
> > -#define VTPM_INVALID_REQUEST       5
> > -
> > -//*********************** Parameter Values *************************
> > -#define VTPM_TYPE_NON_MIGRATABLE  0x00
> > -#define VTPM_TYPE_MIGRATABLE      0x01
> > -#define VTPM_TYPE_MIGRATED        0xFF // VTPM has been migrated.
> > -                                       // VTPM can be recovered or deleted only
> > -
> > -/******************* Command Parameter API *************************
> > -
> > -VTPM Command Format
> > -  dmi: 4 bytes                  // Source of message.
> > -                                // WARNING: This is prepended by the channel.
> > -                                // Thus it is received by VTPM Manager,
> > -                                // but not sent by DMI
> > -  tpm tag: 2 bytes
> > -  command size: 4 bytes         // Size of command including header but not DMI
> > -  ord: 4 bytes                  // Command ordinal above
> > -  parameters: size - 10 bytes   // Command Parameter
> > -
> > -VTPM Response Format
> > -  tpm tag: 2 bytes
> > -  response_size: 4 bytes
> > -  status: 4 bytes
> > -  parameters: size - 10 bytes
> > -
> > -
> > -VTPM_Open:
> > -  Input Parameters:
> > -    mig_type: 1 byte
> > -    startup_mode: 1 byte // Cold Boot = 1, resume = 2, deactive = 3
> > -    domain type: 1 byte
> > -    instance_id: 4 bytes
> > -  Output Parameters:
> > -    None
> > -
> > -VTPM_Close
> > -  Input Parameters:
> > -    instance_id: 4 bytes
> > -  Output Parameters:
> > -    None
> > -
> > -VTPM_Delete
> > -  Input Parameters:
> > -    instance_id: 4 bytes
> > -  Output Parameters:
> > -    None
> > -
> > -VTPM_SaveNVM
> > -  Input Parameters:
> > -    data: n bytes (Header indicates size of data)
> > -  Output Parameters:
> > -    None
> > -
> > -VTPM_LoadNVM
> > -  Input Parameters:
> > -    None
> > -  Output Parameters:
> > -    data: n bytes (Header indicates size of data)
> > -
> > -VTPM_TPMCommand
> > -  Input Parameters:
> > -    TPM Command Byte Stream: n bytes
> > -  Output Parameters:
> > -    TPM Reponse Byte Stream: n bytes
> > -
> > -*********************************************************************/
> > -
> > -#endif //_VTPM_MANAGER_H_
> > diff --git a/tools/vtpm_manager/manager/vtpm_manager_handler.c b/tools/vtpm_manager/manager/vtpm_manager_handler.c
> > deleted file mode 100644
> > index 2001074..0000000
> > --- a/tools/vtpm_manager/manager/vtpm_manager_handler.c
> > +++ /dev/null
> > @@ -1,488 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_manager_handler.c
> > -//
> > -//  This file will house the main logic of the VTPM Manager
> > -//
> > -// ==================================================================
> > -
> > -#include <stdio.h>
> > -#include <unistd.h>
> > -#include <string.h>
> > -#include <errno.h>
> > -
> > -#include "vtpm_manager.h"
> > -#include "vtpmpriv.h"
> > -#include "vtsp.h"
> > -#include "bsg.h"
> > -#include "hashtable.h"
> > -#include "hashtable_itr.h"
> > -#include "log.h"
> > -#include "buffer.h"
> > -
> > -#define vtpmhandlerloginfo(module,fmt,args...) vtpmloginfo (module, "[%s]: " fmt, thread_name, ##args );
> > -#define vtpmhandlerloginfomore(module,fmt,args...) vtpmloginfomore (module, fmt, ##args );
> > -#define vtpmhandlerlogerror(module,fmt,args...) vtpmlogerror (module, "[%s]: " fmt, thread_name, ##args );
> > -
> > -// ---------------------- Prototypes -------------------
> > -TPM_RESULT vtpm_manager_handle_vtpm_cmd(VTPM_DMI_RESOURCE *dmi_res,
> > -                                       TPM_COMMAND_CODE ord,
> > -                                       buffer_t *command_buf,
> > -                                       buffer_t *result_buf,
> > -                                        BOOL is_priv,
> > -                                        char *thread_name);
> > -
> > -TPM_RESULT vtpm_manager_handle_tpm_cmd(vtpm_ipc_handle_t *tx_ipc_h,
> > -                                       vtpm_ipc_handle_t *rx_ipc_h,
> > -                                       VTPM_DMI_RESOURCE *dmi_res,
> > -                                       BYTE *cmd_header,
> > -                                       buffer_t *param_buf,
> > -                                       buffer_t *result_buf,
> > -                                       char *thread_name);
> > -
> > -TPM_RESULT VTPM_Manager_Handler( vtpm_ipc_handle_t *tx_ipc_h,
> > -                                 vtpm_ipc_handle_t *rx_ipc_h,
> > -                                 BOOL fw_tpm,   // Forward TPM cmds?
> > -                                 vtpm_ipc_handle_t *fw_tx_ipc_h,
> > -                                 vtpm_ipc_handle_t *fw_rx_ipc_h,
> > -                                 BOOL is_priv,
> > -                                 char *thread_name) {
> > -  TPM_RESULT      status =  TPM_FAIL; // Should never return
> > -  UINT32          dmi, in_param_size, cmd_size, out_param_size, out_message_size, reply_size;
> > -  BYTE            *cmd_header=NULL, *in_param=NULL, *out_message=NULL, *reply;
> > -  buffer_t        *command_buf=NULL, *result_buf=NULL;
> > -  TPM_TAG         tag;
> > -  TPM_COMMAND_CODE ord;
> > -  VTPM_DMI_RESOURCE *dmi_res;
> > -  int  size_read, size_write, i;
> > -  BOOL add_header=TRUE; // This indicates to prepend a header on result_buf before sending
> > -
> > -  cmd_header = (BYTE *) malloc(VTPM_COMMAND_HEADER_SIZE_SRV);
> > -  command_buf = (buffer_t *) malloc(sizeof(buffer_t));
> > -  result_buf = (buffer_t *) malloc(sizeof(buffer_t));
> > -
> > -  // ------------------------ Main Loop --------------------------------
> > -  while(1) {
> > -
> > -    vtpmhandlerloginfo(VTPM_LOG_VTPM, "%s waiting for messages.\n", thread_name);
> > -
> > -    // --------------------- Read Cmd from Sender ----------------
> > -
> > -    // Read command header
> > -    size_read = vtpm_ipc_read(rx_ipc_h, NULL, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> > -    if (size_read > 0) {
> > -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "RECV[%d]: 0x", size_read);
> > -      for (i=0; i<size_read; i++)
> > -       vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> > -    } else {
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s can't read from ipc. Errono = %d. Aborting... \n", thread_name, errno);
> > -      goto abort_command;
> > -    }
> > -
> > -    if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
> > -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "\n");
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command shorter than normal header (%d bytes). Aborting...\n", size_read);
> > -      goto abort_command;
> > -    }
> > -
> > -    // Unpack header
> > -    BSG_UnpackList(cmd_header, 4,
> > -                  BSG_TYPE_UINT32, &dmi,
> > -                  BSG_TPM_TAG, &tag,
> > -                  BSG_TYPE_UINT32, &in_param_size,
> > -                  BSG_TPM_COMMAND_CODE, &ord );
> > -
> > -    // Using the header info, read the parameters of the command
> > -    // Note that in_param_size is in the client's context
> > -    cmd_size = in_param_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> > -    if (cmd_size > 0) {
> > -      in_param = (BYTE *) malloc(cmd_size);
> > -      size_read = vtpm_ipc_read( rx_ipc_h, NULL, in_param, cmd_size);
> > -      if (size_read > 0) {
> > -       for (i=0; i<size_read; i++)
> > -         vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
> > -
> > -      } else {
> > -        vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s had error reading cmd from ipc. Aborting... \n", thread_name);
> > -       goto abort_command;
> > -      }
> > -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -
> > -      if (size_read < (int) cmd_size) {
> > -       vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -       vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d). Aborting...\n", size_read, cmd_size);
> > -       goto abort_command;
> > -      }
> > -    } else {
> > -      in_param = NULL;
> > -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -    }
> > -
> > -    // Init the buffers used to handle the command and the response
> > -    if ( (buffer_init_convert(command_buf, cmd_size, in_param) != TPM_SUCCESS) ||
> > -        (buffer_init(result_buf, 0, 0) != TPM_SUCCESS) ) {
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Failed to setup buffers. Aborting...\n");
> > -      goto abort_command;
> > -    }
> > -
> > -    // -------------- Dispatch Commands to Handlers -----------
> > -    if ((tag == VTPM_TAG_REQ) && (ord & VTPM_PRIV_MASK)) {
> > -      vtpm_lock_wrlock();
> > -    } else {
> > -      vtpm_lock_rdlock();
> > -    }
> > -
> > -    if ( !(dmi_res = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi)) ||
> > -         (!dmi_res->connected) ) {
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Attempted access to non-existent or disconnected DMI %d. Aborting...\n", dmi);
> > -      status = TPM_BAD_PARAMETER;
> > -      // We have no one to reply to, they don't exist.
> > -      goto abort_command;
> > -    }
> > -
> > -    if (tag == VTPM_TAG_REQ) {
> > -
> > -      status = vtpm_manager_handle_vtpm_cmd(dmi_res, ord, command_buf, result_buf, is_priv, thread_name);
> > -
> > -    } else { // This is not a VTPM Command at all.
> > -      if (fw_tpm) {
> > -        status = vtpm_manager_handle_tpm_cmd(fw_tx_ipc_h, fw_rx_ipc_h, dmi_res, cmd_header, command_buf, result_buf, thread_name);
> > -
> > -        // This means calling the DMI failed, not that the cmd failed in the DMI
> > -        // Since the return will be interpretted by a TPM app, all errors are IO_ERRORs to the app
> > -        if (status != TPM_SUCCESS) {
> > -          status = TPM_IOERROR;
> > -         goto abort_with_error;
> > -        }
> > -        // Unlike all other commands, forwarded commands yield a result_buf that includes the DMI's status. This
> > -        // should be forwarded to the caller VM
> > -        add_header = FALSE;
> > -      } else {
> > -        // We are not supposed to forward TPM commands at all.
> > -        int i;
> > -        vtpmhandlerlogerror(VTPM_LOG_VTPM, "Attempt to use unsupported direct access to TPM.\n");
> > -        vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "Bad Command. dmi:%d, tag:%d, size:%d, ord:%d, Params: ", dmi, tag, in_param_size, ord);
> > -        for (i=0; i<cmd_size; i++)
> > -          vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
> > -
> > -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -
> > -        status = TPM_FAIL;
> > -        goto abort_with_error;
> > -     }
> > -
> > -    } // end else for is VTPM Command
> > -
> > -    // ------------------- Respond to Sender ------------------
> > -
> > -    // Errors while handling responses jump here to reply with error messages
> > -    // NOTE: Currently there are no recoverable errors in multi-VM mode. If one
> > -    //       is added to the code, this ifdef should be removed.
> > -    //       Also note this is NOT referring to errors in commands, but rather
> > -    //       this is about I/O errors and such.
> > -#ifndef VTPM_MULTI_VM
> > - abort_with_error:
> > -#endif
> > -
> > -    if (add_header) {
> > -      // Prepend VTPM header with destination DM stamped
> > -      out_param_size = buffer_len(result_buf);
> > -      out_message_size = VTPM_COMMAND_HEADER_SIZE_CLT + out_param_size;
> > -      reply_size = VTPM_COMMAND_HEADER_SIZE_SRV + out_param_size;
> > -      out_message = (BYTE *) malloc (reply_size);
> > -      reply = out_message;
> > -
> > -      BSG_PackList(out_message, 4,
> > -                  BSG_TYPE_UINT32, (BYTE *) &dmi,
> > -                  BSG_TPM_TAG, (BYTE *) &tag,
> > -                  BSG_TYPE_UINT32, (BYTE *) &out_message_size,
> > -                  BSG_TPM_RESULT, (BYTE *) &status);
> > -
> > -      if (buffer_len(result_buf) > 0)
> > -        memcpy(out_message + VTPM_COMMAND_HEADER_SIZE_SRV, result_buf->bytes, out_param_size);
> > -      //Note: Send message + dmi_id
> > -    } else {
> > -      reply = result_buf->bytes;
> > -      reply_size = buffer_len(result_buf);
> > -    }
> > -    size_write = vtpm_ipc_write(tx_ipc_h, (dmi_res ? dmi_res->tx_vtpm_ipc_h : NULL), reply, reply_size );
> > -    if (size_write > 0) {
> > -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT: 0x");
> > -      for (i=0; i < reply_size; i++)
> > -       vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", reply[i]);
> > -
> > -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -    } else {
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s had error writing to ipc. Aborting... \n", thread_name);
> > -      goto abort_command;
> > -    }
> > -    free(out_message); out_message=NULL;
> > -
> > -    if (size_write < (int)reply_size) {
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s unable to write full command to ipc (%d/%d)\n", thread_name, size_write, reply_size);
> > -      goto abort_command;
> > -    }
> > -
> > -    // On certain failures an error message cannot be sent.
> > -    // This marks the beginning of cleanup in preperation for the next command.
> > -  abort_command:
> > -    //free buffers
> > -    bzero(cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> > -    //free(in_param); // This was converted to command_buf. No need to free
> > -    buffer_free(result_buf);
> > -    buffer_free(command_buf);
> > -
> > -    // If we have a write lock, save the manager table
> > -    if ((tag == VTPM_TAG_REQ) && (ord & VTPM_PRIV_MASK) &&
> > -        (VTPM_SaveManagerData() != TPM_SUCCESS) ) {
> > -       vtpmhandlerlogerror(VTPM_LOG_VTPM, "ERROR: Unable to save manager data.\n");
> > -    }
> > -
> > -    vtpm_lock_unlock();
> > -    add_header = TRUE; // Reset to the default
> > -  } // End while(1)
> > -
> > -}
> > -
> > -/////////////////////////////////////////////////////////////////////////
> > -TPM_RESULT vtpm_manager_handle_vtpm_cmd(VTPM_DMI_RESOURCE *dmi_res,
> > -                                       TPM_COMMAND_CODE ord,
> > -                                       buffer_t *command_buf,
> > -                                       buffer_t *result_buf,
> > -                                        BOOL is_priv,
> > -                                        char *thread_name) {
> > -
> > -  TPM_RESULT status = TPM_FAIL;
> > -
> > -  switch (ord) {
> > -  case VTPM_ORD_SAVENVM:
> > -    status= VTPM_Handle_Save_NVM(dmi_res,
> > -                                 command_buf,
> > -                                 result_buf);
> > -    break;
> > -
> > -  case VTPM_ORD_LOADNVM:
> > -    status= VTPM_Handle_Load_NVM(dmi_res,
> > -                                 command_buf,
> > -                                 result_buf);
> > -    break;
> > -
> > -  case VTPM_ORD_TPMCOMMAND:
> > -    status= VTPM_Handle_TPM_Command(dmi_res,
> > -                                    command_buf,
> > -                                    result_buf);
> > -    break;
> > -
> > -  case VTPM_ORD_GET_MIG_KEY:
> > -    status = VTPM_Handle_Get_Migration_key(command_buf,
> > -                                           result_buf);
> > -    break;
> > -
> > -  case VTPM_ORD_LOAD_MIG_KEY:
> > -    status = VTPM_Handle_Load_Migration_key(command_buf,
> > -                                           result_buf);
> > -    break;
> > -
> > -  default:
> > -    // Privileged handlers can do maintanance
> > -    if (is_priv) {
> > -      switch (ord) {
> > -      case VTPM_ORD_OPEN:
> > -        status = VTPM_Handle_New_DMI(command_buf);
> > -        break;
> > -
> > -      case VTPM_ORD_CLOSE:
> > -        status = VTPM_Handle_Close_DMI(command_buf);
> > -        break;
> > -
> > -      case VTPM_ORD_DELETE:
> > -        status = VTPM_Handle_Delete_DMI(command_buf);
> > -        break;
> > -
> > -      case VTPM_ORD_MIGRATE_IN:
> > -        status = VTPM_Handle_Migrate_In(command_buf, result_buf);
> > -        break;
> > -
> > -      case VTPM_ORD_MIGRATE_OUT:
> > -        status = VTPM_Handle_Migrate_Out(command_buf, result_buf);
> > -        break;
> > -
> > -      default:
> > -        status = TPM_BAD_ORDINAL;
> > -      } // switch
> > -    } else { // is priv command
> > -
> > -        status = TPM_BAD_ORDINAL;
> > -    } // inner switch
> > -  } // outer switch
> > -
> > -  return(status);
> > -}
> > -
> > -/////////////////////////////////////////////////////////////////////
> > -TPM_RESULT vtpm_manager_handle_tpm_cmd(vtpm_ipc_handle_t *tx_ipc_h,
> > -                                       vtpm_ipc_handle_t *rx_ipc_h,
> > -                                      VTPM_DMI_RESOURCE *dmi_res,
> > -                                      BYTE *cmd_header,
> > -                                      buffer_t *param_buf,
> > -                                      buffer_t *result_buf,
> > -                                       char *thread_name) {
> > -
> > -  TPM_RESULT status = TPM_FAIL;
> > -  UINT32 dmi_dst;
> > -  TPM_COMMAND_CODE ord;
> > -  TPM_TAG tag_out;
> > -  UINT32 dmi_cmd_size, in_param_size, adj_param_size;
> > -  BYTE *dmi_cmd, *in_param;
> > -  int  size_read, size_write, i;
> > -
> > -  //// Dom0 can't talk to the BE, so this must be a broken FE/BE or badness
> > -  if (dmi_res->dmi_id == VTPM_CTL_DM) {
> > -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Illegal use of TPM command from dom0\n");
> > -    status = TPM_FAIL;
> > -    goto abort_with_error;
> > -  }
> > -
> > -  vtpmhandlerloginfo(VTPM_LOG_VTPM, "Forwarding command to DMI.\n");
> > -
> > -  //Forward TPM CMD stamped with dmi_id to DMI for handling
> > -  if (buffer_len(param_buf)) {
> > -    dmi_cmd = (BYTE *) malloc(VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf));
> > -    dmi_cmd_size = VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf);
> > -    memcpy(dmi_cmd, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> > -    memcpy(dmi_cmd + VTPM_COMMAND_HEADER_SIZE_SRV, param_buf->bytes, buffer_len(param_buf));
> > -    size_write = vtpm_ipc_write(tx_ipc_h, dmi_res->tx_tpm_ipc_h, dmi_cmd, dmi_cmd_size);
> > -
> > -    if (size_write > 0) {
> > -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT (DMI): 0x");
> > -      for (i=0; i<VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf); i++) {
> > -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", dmi_cmd[i]);
> > -      }
> > -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -    } else {
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error writing to DMI. Aborting... \n");
> > -      status = TPM_IOERROR;
> > -      goto abort_with_error;
> > -    }
> > -    free(dmi_cmd);
> > -  } else {
> > -    dmi_cmd_size = VTPM_COMMAND_HEADER_SIZE_SRV;
> > -    size_write = vtpm_ipc_write(tx_ipc_h, dmi_res->tx_tpm_ipc_h, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV );
> > -    if (size_write > 0) {
> > -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT (DMI): 0x");
> > -      for (i=0; i<VTPM_COMMAND_HEADER_SIZE_SRV; i++)
> > -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> > -
> > -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -    } else {
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error writing to DMI. Aborting... \n");
> > -      status = TPM_IOERROR;
> > -      goto abort_with_error;
> > -    }
> > -  }
> > -
> > -  if (size_write != (int) dmi_cmd_size)
> > -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Could not write entire command to DMI (%d/%d)\n", size_write, dmi_cmd_size);
> > -
> > -  buffer_free(param_buf);
> > -
> > -  // Read header for response to TPM command from DMI
> > -  size_read = vtpm_ipc_read( rx_ipc_h, dmi_res->rx_tpm_ipc_h, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> > -  if (size_read > 0) {
> > -    vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "RECV (DMI): 0x");
> > -    for (i=0; i<size_read; i++)
> > -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> > -
> > -  } else {
> > -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error reading from DMI. Aborting... \n");
> > -    status = TPM_IOERROR;
> > -    goto abort_with_error;
> > -  }
> > -
> > -  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
> > -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command from DMI shorter than normal header. Aborting...\n");
> > -    status = TPM_IOERROR;
> > -    goto abort_with_error;
> > -  }
> > -
> > -  // Unpack response from DMI for TPM command
> > -  BSG_UnpackList(cmd_header, 4,
> > -                 BSG_TYPE_UINT32, &dmi_dst,
> > -                 BSG_TPM_TAG, &tag_out,
> > -                 BSG_TYPE_UINT32, &in_param_size,
> > -                 BSG_TPM_COMMAND_CODE, &status );
> > -
> > -  // If response has parameters, read them.
> > -  // Note that in_param_size is in the client's context
> > -  adj_param_size = in_param_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> > -  if (adj_param_size > 0) {
> > -    in_param = (BYTE *) malloc(adj_param_size);
> > -    size_read = vtpm_ipc_read(rx_ipc_h, dmi_res->rx_tpm_ipc_h, in_param, adj_param_size);
> > -    if (size_read > 0) {
> > -      for (i=0; i<size_read; i++)
> > -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
> > -
> > -    } else {
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error reading from BE. Aborting... \n");
> > -      goto abort_with_error;
> > -    }
> > -    vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
> > -
> > -    if (size_read < (int)adj_param_size) {
> > -      vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command read(%d) from DMI is shorter than header indicates(%d). Aborting...\n", size_read, adj_param_size);
> > -      status = TPM_IOERROR;
> > -      goto abort_with_error;
> > -    }
> > -  } else {
> > -    in_param = NULL;
> > -    vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
> > -  }
> > -
> > -  if ( (buffer_init(result_buf, VTPM_COMMAND_HEADER_SIZE_SRV, cmd_header) != TPM_SUCCESS) ||
> > -       (buffer_append_raw(result_buf, adj_param_size, in_param) != TPM_SUCCESS) ) {
> > -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Failed to setup buffers. Aborting...\n");
> > -    status = TPM_FAIL;
> > -    goto abort_with_error;
> > -  }
> > -
> > -  vtpmhandlerloginfo(VTPM_LOG_VTPM, "Sending DMI's response to guest.\n");
> > -
> > -  status = TPM_SUCCESS;
> > -
> > - abort_with_error:
> > -
> > -  return status;
> > -}
> > -
> > diff --git a/tools/vtpm_manager/manager/vtpmd.c b/tools/vtpm_manager/manager/vtpmd.c
> > deleted file mode 100644
> > index cf58ba3..0000000
> > --- a/tools/vtpm_manager/manager/vtpmd.c
> > +++ /dev/null
> > @@ -1,371 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpmd.c
> > -//
> > -//  Application
> > -//
> > -// ===================================================================
> > -
> > -#include <stdio.h>
> > -#include <unistd.h>
> > -#include <sys/types.h>
> > -#include <sys/stat.h>
> > -#include <fcntl.h>
> > -#include <signal.h>
> > -#include <string.h>
> > -#include <pthread.h>
> > -#include "vtpm_manager.h"
> > -#include "vtpmpriv.h"
> > -#include "tcg.h"
> > -#include "log.h"
> > -#include "vtpm_ipc.h"
> > -
> > -#define TPM_EMULATOR_PATH "/usr/bin/vtpmd"
> > -
> > -#define VTPM_BE_FNAME          "/dev/vtpm"
> > -#define VTPM_DUMMY_TX_BE_FNAME "/var/vtpm/fifos/dummy_out.fifo"
> > -#define VTPM_DUMMY_RX_BE_FNAME "/var/vtpm/fifos/dummy_in.fifo"
> > -#define VTPM_TX_TPM_FNAME      "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
> > -#define VTPM_RX_TPM_FNAME      "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
> > -#define VTPM_TX_VTPM_FNAME     "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
> > -#define VTPM_RX_VTPM_FNAME     "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
> > -#define VTPM_TX_HP_FNAME       "/var/vtpm/fifos/to_console.fifo"
> > -#define VTPM_RX_HP_FNAME       "/var/vtpm/fifos/from_console.fifo"
> > -
> > -#define VTPM_TYPE_PVM_STRING "pvm"
> > -#define VTPM_TYPE_HVM_STRING "hvm"
> > -
> > -struct vtpm_thread_params_s {
> > -  vtpm_ipc_handle_t *tx_ipc_h;
> > -  vtpm_ipc_handle_t *rx_ipc_h;
> > -  BOOL fw_tpm;
> > -  vtpm_ipc_handle_t *fw_tx_ipc_h;
> > -  vtpm_ipc_handle_t *fw_rx_ipc_h;
> > -  BOOL is_priv;
> > -  char *thread_name;
> > -};
> > -
> > -// This is needed to all extra_close_dmi to close this to prevent a
> > -// broken pipe when no DMIs are left.
> > -static vtpm_ipc_handle_t *g_rx_tpm_ipc_h;
> > -
> > -void *vtpm_manager_thread(void *arg_void) {
> > -  TPM_RESULT *status = (TPM_RESULT *) malloc(sizeof(TPM_RESULT) );
> > -  struct vtpm_thread_params_s *arg = (struct vtpm_thread_params_s *) arg_void;
> > -
> > -  *status = VTPM_Manager_Handler(arg->tx_ipc_h, arg->rx_ipc_h,
> > -                                 arg->fw_tpm, arg->fw_tx_ipc_h, arg->fw_rx_ipc_h,
> > -                                 arg->is_priv, arg->thread_name);
> > -
> > -  return (status);
> > -}
> > -
> > -
> > -void signal_handler(int reason) {
> > -  if (pthread_equal(pthread_self(), vtpm_globals->master_pid)) {
> > -    vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager shutting down for signal %d.\n", reason);
> > -  } else {
> > -    // For old Linux Thread machines, signals are delivered to each thread. Deal with them.
> > -    vtpmloginfo(VTPM_LOG_VTPM, "Child shutting down\n");
> > -    pthread_exit(NULL);
> > -  }
> > -
> > -  VTPM_Stop_Manager();
> > -  exit(-1);
> > -}
> > -
> > -struct sigaction ctl_c_handler;
> > -
> > -TPM_RESULT VTPM_New_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res, BYTE vm_type, BYTE startup_mode) {
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  int fh;
> > -  char dmi_id_str[11]; // UINT32s are up to 10 digits + NULL
> > -  char *tx_vtpm_name, *tx_tpm_name, *vm_type_string;
> > -  struct stat file_info;
> > -
> > -  if (dmi_res->dmi_id == VTPM_CTL_DM) {
> > -    dmi_res->tx_tpm_ipc_h = NULL;
> > -    dmi_res->rx_tpm_ipc_h = NULL;
> > -    dmi_res->tx_vtpm_ipc_h = NULL;
> > -    dmi_res->rx_vtpm_ipc_h = NULL;
> > -  } else {
> > -    // Create a pair of fifo pipes
> > -    dmi_res->rx_tpm_ipc_h = NULL;
> > -    dmi_res->rx_vtpm_ipc_h = NULL;
> > -
> > -    if ( ((dmi_res->tx_tpm_ipc_h = (vtpm_ipc_handle_t *) malloc (sizeof(vtpm_ipc_handle_t))) == NULL ) ||
> > -         ((dmi_res->tx_vtpm_ipc_h =(vtpm_ipc_handle_t *) malloc (sizeof(vtpm_ipc_handle_t))) == NULL ) ||
> > -         ((tx_tpm_name = (char *) malloc(11 + strlen(VTPM_TX_TPM_FNAME))) == NULL ) ||
> > -         ((tx_vtpm_name =(char *) malloc(11 + strlen(VTPM_TX_VTPM_FNAME))) == NULL) ) {
> > -      status =TPM_RESOURCES;
> > -      goto abort_egress;
> > -    }
> > -
> > -    sprintf(tx_tpm_name, VTPM_TX_TPM_FNAME, (uint32_t) dmi_res->dmi_id);
> > -    sprintf(tx_vtpm_name, VTPM_TX_VTPM_FNAME, (uint32_t) dmi_res->dmi_id);
> > -
> > -    if ( (vtpm_ipc_init(dmi_res->tx_tpm_ipc_h, tx_tpm_name, O_WRONLY | O_NONBLOCK, TRUE) != 0) ||
> > -         (vtpm_ipc_init(dmi_res->tx_vtpm_ipc_h, tx_vtpm_name, O_WRONLY, TRUE) != 0) ) { //FIXME: O_NONBLOCK?
> > -      status = TPM_IOERROR;
> > -      goto abort_egress;
> > -    }
> > -
> > -    // Measure DMI
> > -    // FIXME: This will measure DMI. Until then use a fixed DMI_Measurement value
> > -    // Also, this mechanism is specific to 1 VM architecture.
> > -    /*
> > -    fh = open(TPM_EMULATOR_PATH, O_RDONLY);
> > -    stat_ret = fstat(fh, &file_stat);
> > -    if (stat_ret == 0)
> > -      dmi_size = file_stat.st_size;
> > -    else {
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Could not open vtpmd!!\n");
> > -      status = TPM_IOERROR;
> > -      goto abort_egress;
> > -    }
> > -    dmi_buffer
> > -    */
> > -    memset(&dmi_res->DMI_measurement, 0xcc, sizeof(TPM_DIGEST));
> > -
> > -    if (vm_type == VTPM_TYPE_PVM)
> > -      vm_type_string = (BYTE *)&VTPM_TYPE_PVM_STRING;
> > -    else
> > -      vm_type_string = (BYTE *)&VTPM_TYPE_HVM_STRING;
> > -
> > -    // Launch DMI
> > -    sprintf(dmi_id_str, "%d", (int) dmi_res->dmi_id);
> > -#ifdef MANUAL_DM_LAUNCH
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Manually start VTPM with dmi=%s now.\n", dmi_id_str);
> > -    dmi_res->dmi_pid = 0;
> > -#else
> > -    pid_t pid = fork();
> > -
> > -    if (pid == -1) {
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Could not fork to launch vtpm\n");
> > -      status = TPM_RESOURCES;
> > -      goto abort_egress;
> > -    } else if (pid == 0) {
> > -      switch (startup_mode) {
> > -      case TPM_ST_CLEAR:
> > -        execl (TPM_EMULATOR_PATH, "vtpmd", "clear", vm_type_string, dmi_id_str, NULL);
> > -        break;
> > -      case TPM_ST_STATE:
> > -        execl (TPM_EMULATOR_PATH, "vtpmd", "save", vm_type_string, dmi_id_str, NULL);
> > -        break;
> > -      case TPM_ST_DEACTIVATED:
> > -        execl (TPM_EMULATOR_PATH, "vtpmd", "deactivated", vm_type_string, dmi_id_str, NULL);
> > -        break;
> > -      default:
> > -        status = TPM_BAD_PARAMETER;
> > -        goto abort_egress;
> > -      }
> > -
> > -      // Returning from these at all is an error.
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Could not exec to launch vtpm\n");
> > -    } else {
> > -      dmi_res->dmi_pid = pid;
> > -      vtpmloginfo(VTPM_LOG_VTPM, "Launching DMI on PID = %d\n", pid);
> > -    }
> > -#endif // MANUAL_DM_LAUNCH
> > -
> > -  } // If DMI = VTPM_CTL_DM
> > -    status = TPM_SUCCESS;
> > -
> > -abort_egress:
> > -  return (status);
> > -}
> > -
> > -TPM_RESULT VTPM_Close_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res) {
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  if (vtpm_globals->connected_dmis == 0) {
> > -    // No more DMI's connected. Close fifo to prevent a broken pipe.
> > -    // This is hackish. Need to think of another way.
> > -    vtpm_ipc_close(g_rx_tpm_ipc_h);
> > -  }
> > -
> > -
> > -  if (dmi_res->dmi_id != VTPM_CTL_DM) {
> > -    vtpm_ipc_close(dmi_res->tx_tpm_ipc_h);
> > -    vtpm_ipc_close(dmi_res->tx_vtpm_ipc_h);
> > -
> > -    free(dmi_res->tx_tpm_ipc_h->name);
> > -    free(dmi_res->tx_vtpm_ipc_h->name);
> > -
> > -#ifndef MANUAL_DM_LAUNCH
> > -    if (dmi_res->dmi_id != VTPM_CTL_DM) {
> > -      if (dmi_res->dmi_pid != 0) {
> > -        vtpmloginfo(VTPM_LOG_VTPM, "Killing dmi on pid %d.\n", dmi_res->dmi_pid);
> > -        if (kill(dmi_res->dmi_pid, SIGKILL) !=0) {
> > -          vtpmloginfo(VTPM_LOG_VTPM, "DMI on pid %d is already dead.\n", dmi_res->dmi_pid);
> > -        } else if (waitpid(dmi_res->dmi_pid, NULL, 0) != dmi_res->dmi_pid) {
> > -          vtpmlogerror(VTPM_LOG_VTPM, "DMI on pid %d failed to stop.\n", dmi_res->dmi_pid);
> > -          status = TPM_FAIL;
> > -        }
> > -      } else {
> > -        vtpmlogerror(VTPM_LOG_VTPM, "Could not kill dmi because it's pid was 0.\n");
> > -        status = TPM_FAIL;
> > -      }
> > -    }
> > -#endif
> > -
> > -  } //endif ! dom0
> > -  return status;
> > -}
> > -
> > -
> > -int main(int argc, char **argv) {
> > -  vtpm_ipc_handle_t *tx_be_ipc_h, *rx_be_ipc_h, rx_tpm_ipc_h, rx_vtpm_ipc_h, tx_hp_ipc_h, rx_hp_ipc_h;
> > -  struct vtpm_thread_params_s be_thread_params, dmi_thread_params, hp_thread_params;
> > -  pthread_t be_thread, dmi_thread, hp_thread;
> > -
> > -#ifdef DUMMY_BACKEND
> > -  vtpm_ipc_handle_t tx_dummy_ipc_h, rx_dummy_ipc_h;
> > -#else
> > -  vtpm_ipc_handle_t real_be_ipc_h;
> > -#endif
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Starting VTPM.\n");
> > -
> > -  // -------------------- Initialize Manager -----------------
> > -  if (VTPM_Init_Manager() != TPM_SUCCESS) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Closing vtpmd due to error during startup.\n");
> > -    return -1;
> > -  }
> > -
> > -  // -------------------- Setup Ctrl+C Handlers --------------
> > -  ctl_c_handler.sa_handler = signal_handler;
> > -  sigemptyset(&ctl_c_handler.sa_mask);
> > -  ctl_c_handler.sa_flags = 0;
> > -
> > -  if (sigaction(SIGINT, &ctl_c_handler, NULL) == -1)
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Could not install SIGINT handler. Ctl+break will not stop manager gently.\n");
> > -
> > -  // For easier debuggin with gdb
> > -  if (sigaction(SIGHUP, &ctl_c_handler, NULL) == -1)
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Could not install SIGHUP handler. Ctl+break will not stop manager gently.\n");
> > -
> > -  sigset_t sig_mask;
> > -  sigemptyset(&sig_mask);
> > -  sigaddset(&sig_mask, SIGPIPE);
> > -  sigprocmask(SIG_BLOCK, &sig_mask, NULL);
> > -
> > -  // ------------------- Set up file ipc structures ----------
> > -#ifdef DUMMY_BACKEND
> > -  if ( (vtpm_ipc_init(&tx_dummy_ipc_h, VTPM_DUMMY_TX_BE_FNAME, O_RDWR, TRUE) != 0) ||
> > -       (vtpm_ipc_init(&rx_dummy_ipc_h, VTPM_DUMMY_RX_BE_FNAME, O_RDWR, TRUE) != 0) ) {
> > -
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to create Dummy BE FIFOs.\n");
> > -    exit(-1);
> > -  }
> > -
> > -  tx_be_ipc_h = &tx_dummy_ipc_h;
> > -  rx_be_ipc_h = &rx_dummy_ipc_h;
> > -#else
> > -  vtpm_ipc_init(&real_be_ipc_h, VTPM_BE_FNAME, O_RDWR, FALSE);
> > -
> > -  tx_be_ipc_h = &real_be_ipc_h;
> > -  rx_be_ipc_h = &real_be_ipc_h;
> > -#endif
> > -
> > -  if ( (vtpm_ipc_init(&rx_tpm_ipc_h, VTPM_RX_TPM_FNAME, O_RDONLY, TRUE) != 0) ||
> > -       (vtpm_ipc_init(&rx_vtpm_ipc_h, VTPM_RX_VTPM_FNAME, O_RDWR, TRUE) != 0) || //FIXME: O_RDONLY?
> > -       (vtpm_ipc_init(&tx_hp_ipc_h,  VTPM_TX_HP_FNAME, O_RDWR, TRUE) != 0)    ||
> > -       (vtpm_ipc_init(&rx_hp_ipc_h,  VTPM_RX_HP_FNAME, O_RDWR, TRUE) != 0) ) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to create initial FIFOs.\n");
> > -    exit(-1);
> > -  }
> > -
> > -  g_rx_tpm_ipc_h = &rx_tpm_ipc_h;
> > -
> > -  // -------------------- Set up thread params -------------
> > -
> > -  be_thread_params.tx_ipc_h = tx_be_ipc_h;
> > -  be_thread_params.rx_ipc_h = rx_be_ipc_h;
> > -  be_thread_params.fw_tpm = TRUE;
> > -  be_thread_params.fw_tx_ipc_h = NULL;
> > -  be_thread_params.fw_rx_ipc_h = &rx_tpm_ipc_h;
> > -  be_thread_params.is_priv = FALSE;
> > -  be_thread_params.thread_name = "Backend Listener";
> > -
> > -  dmi_thread_params.tx_ipc_h = NULL;
> > -  dmi_thread_params.rx_ipc_h = &rx_vtpm_ipc_h;
> > -  dmi_thread_params.fw_tpm = FALSE;
> > -  dmi_thread_params.fw_tx_ipc_h = NULL;
> > -  dmi_thread_params.fw_rx_ipc_h = NULL;
> > -  dmi_thread_params.is_priv = FALSE;
> > -  dmi_thread_params.thread_name = "VTPM Listener";
> > -
> > -  hp_thread_params.tx_ipc_h = &tx_hp_ipc_h;
> > -  hp_thread_params.rx_ipc_h = &rx_hp_ipc_h;
> > -  hp_thread_params.fw_tpm = FALSE;
> > -  hp_thread_params.fw_tx_ipc_h = NULL;
> > -  hp_thread_params.fw_rx_ipc_h = NULL;
> > -  hp_thread_params.is_priv = TRUE;
> > -  hp_thread_params.thread_name = "Hotplug Listener";
> > -
> > -  // --------------------- Launch Threads -----------------
> > -
> > -  vtpm_lock_init();
> > -
> > -  vtpm_globals->master_pid = pthread_self();
> > -
> > -  if (pthread_create(&be_thread, NULL, vtpm_manager_thread, &be_thread_params) != 0) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch BE Thread.\n");
> > -    exit(-1);
> > -  }
> > -
> > -  if (pthread_create(&dmi_thread, NULL, vtpm_manager_thread, &dmi_thread_params) != 0) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch DMI Thread.\n");
> > -    exit(-1);
> > -  }
> > -
> > -
> > -  if (pthread_create(&hp_thread, NULL, vtpm_manager_thread, &hp_thread_params) != 0) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch HP Thread.\n");
> > -    exit(-1);
> > -  }
> > -
> > -  //Join the other threads until exit time.
> > -  pthread_join(be_thread, NULL);
> > -  pthread_join(dmi_thread, NULL);
> > -  pthread_join(hp_thread, NULL);
> > -
> > -  vtpmlogerror(VTPM_LOG_VTPM, "VTPM Manager shut down unexpectedly.\n");
> > -
> > -  VTPM_Stop_Manager();
> > -  vtpm_lock_destroy();
> > -  return 0;
> > -}
> > diff --git a/tools/vtpm_manager/manager/vtpmpriv.h b/tools/vtpm_manager/manager/vtpmpriv.h
> > deleted file mode 100644
> > index 41e8d2d..0000000
> > --- a/tools/vtpm_manager/manager/vtpmpriv.h
> > +++ /dev/null
> > @@ -1,186 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpmpriv.h
> > -//
> > -//  Structures and functions private to the manager
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __VTPMPRIV_H__
> > -#define __VTPMPRIV_H__
> > -
> > -#include "vtpm_manager.h"
> > -#include "tcg.h"
> > -#include "tcs.h"
> > -#include "buffer.h"
> > -#include "crypto.h"
> > -#include "vtpm_ipc.h"
> > -
> > -#define VTPM_MANAGER_GEN   2     // This is incremented when the manager's table
> > -                                 // is changed. It's used for backwards compatability
> > -
> > -#define STATE_FILE         "/var/vtpm/VTPM"
> > -#define DMI_NVM_FILE       "/var/vtpm/vtpm_dm_%d.data"
> > -#define VTPM_CTL_DM        0
> > -
> > -// ------------------------ Private Structures -----------------------
> > -typedef struct VTPM_DMI_RESOURCE_T {
> > -  // I/O info for Manager to talk to DMI's and controllers
> > -  vtpm_ipc_handle_t      *tx_vtpm_ipc_h;    // TX VTPM Results to DMI
> > -  vtpm_ipc_handle_t      *rx_vtpm_ipc_h;    // RX VTPM Commands from DMI
> > -  vtpm_ipc_handle_t      *tx_tpm_ipc_h;     // TX TPM Commands to DMI
> > -  vtpm_ipc_handle_t      *rx_tpm_ipc_h;     // RX TPM Results from DMI
> > -
> > -#ifndef VTPM_MULTI_VM
> > -  pid_t                 dmi_pid;
> > -#endif
> > -
> > -  // Non-persistent Information
> > -  bool                  connected;
> > -  UINT32                dmi_domain_id;
> > -  TCS_CONTEXT_HANDLE    TCSContext;     // TCS Handle
> > -  char                  *NVMLocation;   // NULL term string indicating location
> > -                                        // of NVM.
> > -  // Persistent Information about DMI
> > -  UINT32                dmi_id;
> > -  BYTE                  dmi_type;
> > -  TPM_DIGEST            NVM_measurement;  // Equal to the SHA1 of the blob
> > -  TPM_DIGEST            DMI_measurement;  // Correct measurement of the owning DMI
> > -} VTPM_DMI_RESOURCE;
> > -
> > -typedef struct tdVTPM_MIGKEY_LIST {
> > -  UINT32                name_size;
> > -  BYTE                  *name; // Name of destination (IP addr, domain name, etc)
> > -  CRYPTO_INFO           key;
> > -  struct tdVTPM_MIGKEY_LIST *next;
> > -} VTPM_MIGKEY_LIST;
> > -
> > -
> > -typedef struct tdVTPM_GLOBALS {
> > -  // Non-persistent data
> > -#ifndef VTPM_MULTI_VM
> > -  pid_t               master_pid;
> > -#endif
> > -
> > -  int                 connected_dmis;     // To close guest_rx when no dmis are connected
> > -
> > -  struct hashtable    *dmi_map;               // Table of all DMI's known indexed by persistent instance #
> > -  VTPM_MIGKEY_LIST    *mig_keys;              // Table of migration keys
> > -                      // Currently keys are loaded at migration time,
> > -                      // TODO: Make VTPM man store a keys persistently
> > -                      //       and update script to check if key is needed
> > -                      //       before fetching it.
> > -
> > -  TCS_CONTEXT_HANDLE  manager_tcs_handle;     // TCS Handle used by manager
> > -  TPM_HANDLE          storageKeyHandle;       // Key used by persistent store
> > -  CRYPTO_INFO         storageKey;             // For software encryption
> > -  CRYPTO_INFO         bootKey;                // For saving table
> > -  TCS_AUTH            keyAuth;                // OIAP session for storageKey
> > -
> > -  // Persistent Data
> > -  TPM_AUTHDATA        owner_usage_auth;       // OwnerAuth of real TPM
> > -  buffer_t            storageKeyWrap;         // Wrapped copy of storageKey
> > -  TPM_AUTHDATA        srk_usage_auth;
> > -  TPM_AUTHDATA        storage_key_usage_auth;
> > -
> > -  buffer_t            bootKeyWrap;            // Wrapped copy of boot key
> > -
> > -}VTPM_GLOBALS;
> > -
> > -// --------------------------- Global Values --------------------------
> > -extern VTPM_GLOBALS *vtpm_globals;   // Key info and DMI states
> > -extern const TPM_AUTHDATA SRK_AUTH;  // SRK Well Known Auth Value
> > -
> > -// ********************** VTPM Functions *************************
> > -TPM_RESULT VTPM_Init_Manager(); // Start VTPM Service
> > -void VTPM_Stop_Manager();  // Stop VTPM Service
> > -TPM_RESULT VTPM_Manager_Handler(vtpm_ipc_handle_t *tx_ipc_h,
> > -                                vtpm_ipc_handle_t *rx_ipc_h,
> > -                                BOOL fw_tpm,   // Should forward TPM cmds
> > -                                vtpm_ipc_handle_t *fw_tx_ipc_h,
> > -                                vtpm_ipc_handle_t *fw_rx_ipc_h,
> > -                                BOOL is_priv,
> > -                                char *client_name);
> > -
> > -// ********************** Command Handler Prototypes ***********************
> > -
> > -TPM_RESULT VTPM_Handle_Load_NVM(       VTPM_DMI_RESOURCE *myDMI,
> > -                                        const buffer_t *inbuf,
> > -                                        buffer_t *outbuf);
> > -
> > -TPM_RESULT VTPM_Handle_Save_NVM(       VTPM_DMI_RESOURCE *myDMI,
> > -                                        const buffer_t *inbuf,
> > -                                        buffer_t *outbuf);
> > -
> > -TPM_RESULT VTPM_Handle_TPM_Command(    VTPM_DMI_RESOURCE *dmi,
> > -                                        buffer_t *inbuf,
> > -                                        buffer_t *outbuf);
> > -
> > -TPM_RESULT VTPM_Handle_New_DMI(const buffer_t *param_buf);
> > -
> > -TPM_RESULT VTPM_Handle_Close_DMI(const buffer_t *param_buf);
> > -
> > -TPM_RESULT VTPM_Handle_Delete_DMI(const buffer_t *param_buf);
> > -
> > -TPM_RESULT VTPM_Handle_Migrate_In( const buffer_t *param_buf,
> > -                                   buffer_t *result_buf);
> > -
> > -TPM_RESULT VTPM_Handle_Migrate_Out ( const buffer_t *param_buf,
> > -                                     buffer_t *result_buf);
> > -
> > -TPM_RESULT VTPM_Handle_Get_Migration_key( const buffer_t *param_buf,
> > -                                          buffer_t *result_buf);
> > -
> > -TPM_RESULT VTPM_SaveManagerData(void);
> > -TPM_RESULT VTPM_LoadManagerData(void);
> > -
> > -TPM_RESULT VTPM_New_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res, BYTE vm_type, BYTE startup_mode);
> > -
> > -TPM_RESULT VTPM_Close_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res);
> > -
> > -// Helper functions
> > -TPM_RESULT close_dmi(VTPM_DMI_RESOURCE *dmi_res);
> > -TPM_RESULT init_dmi(UINT32 dmi_id, BYTE type,  VTPM_DMI_RESOURCE **dmi_res);
> > -
> > -TPM_RESULT envelope_encrypt(const buffer_t     *inbuf,
> > -                             CRYPTO_INFO        *asymkey,
> > -                             buffer_t           *sealed_data);
> > -
> > -TPM_RESULT envelope_decrypt(const buffer_t     *cipher,
> > -                            TCS_CONTEXT_HANDLE TCSContext,
> > -                            TPM_HANDLE         keyHandle,
> > -                            const TPM_AUTHDATA *key_usage_auth,
> > -                            buffer_t           *unsealed_data);
> > -
> > -#endif // __VTPMPRIV_H__
> > diff --git a/tools/vtpm_manager/manager/vtsp.c b/tools/vtpm_manager/manager/vtsp.c
> > deleted file mode 100644
> > index fc8a66f..0000000
> > --- a/tools/vtpm_manager/manager/vtsp.c
> > +++ /dev/null
> > @@ -1,1042 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtsp.c
> > -//
> > -//  Higher level interface to TCS for use in service.
> > -//
> > -// ==================================================================
> > -
> > -#include <string.h>
> > -#include "tcg.h"
> > -#include "tcs.h"
> > -#include "bsg.h"
> > -#include "log.h"
> > -#include "crypto.h"
> > -#include "vtsp.h"
> > -#include "buffer.h"
> > -
> > -#define  RSA_KEY_SIZE 0x0800
> > -
> > -/***********************************************************************************
> > - * GenerateAuth: Generate authorization info to be sent back to application
> > - *
> > - * Parameters: outParamDigestText  The concatenation of output parameters to be SHA1ed
> > - *    outParamDigestTextSize Size of inParamDigestText
> > - *    HMACkey     Key to be used for HMACing
> > - *          For OIAP use key.authUsage or PersistStore.ownerAuth
> > - *          For OSAP use shared secret
> > - *    pAuth     Authorization information from the application
> > - *
> > - * Return:  TPM_SUCCESS   Authorization data created
> > - *    TPM_AUTHFAIL   Invalid (NULL) HMACkey presented for OSAP
> > - *************************************************************************************/
> > -TPM_RESULT GenerateAuth( /*[IN]*/ const BYTE *inParamDigestText,
> > -                        /*[IN]*/ UINT32 inParamDigestTextSize,
> > -                        /*[IN]*/ const TPM_SECRET *HMACkey,
> > -                        /*[IN,OUT]*/ TCS_AUTH *auth) {
> > -
> > -  if (inParamDigestText == NULL || auth == NULL)
> > -    return (TPM_AUTHFAIL);
> > -  else {
> > -
> > -    //Generate new OddNonce
> > -    Crypto_GetRandom(auth->NonceOdd.nonce, sizeof(TPM_NONCE));
> > -
> > -    // Create SHA1 inParamDigest
> > -    TPM_DIGEST inParamDigest;
> > -    Crypto_SHA1Full(inParamDigestText, inParamDigestTextSize, (BYTE *) &inParamDigest);
> > -
> > -    // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
> > -    BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
> > -
> > -    BSG_PackList(   hmacText, 4,
> > -                   BSG_TPM_DIGEST, &inParamDigest,
> > -                   BSG_TPM_NONCE, &(auth->NonceEven),
> > -                   BSG_TPM_NONCE, &(auth->NonceOdd),
> > -                   BSG_TYPE_BOOL, &(auth->fContinueAuthSession) );
> > -
> > -    Crypto_HMAC((BYTE *) hmacText, sizeof(hmacText), (BYTE *) HMACkey, sizeof(TPM_DIGEST), (BYTE *) &(auth->HMAC));
> > -
> > -    return(TPM_SUCCESS);
> > -
> > -  }
> > -}
> > -
> > -/***********************************************************************************
> > - * VerifyAuth: Verify the authdata for a command requiring authorization
> > - *
> > - * Parameters: inParamDigestText  The concatenation of parameters to be SHA1ed
> > - *    inParamDigestTextSize Size of inParamDigestText
> > - *    authDataUsage   AuthDataUsage for the Entity being used
> > - *          Key->authDataUsage or TPM_AUTH_OWNER
> > - *    HMACkey     Key to be used for HMACing
> > - *          For OIAP use key.authUsage or PersistStore.ownerAuth
> > - *          For OSAP use NULL (It will be aquired from the Auth Session)
> > - *          If unknown (default), assume OIAP
> > - *    sessionAuth    A TCS_AUTH info for the session
> > - *    pAuth     Authorization information from the application
> > - *              hContext        If specified, on failed Auth, VerifyAuth will
> > - *                                      generate a new OIAP session in place of themselves
> > - *                                      destroyed session.
> > - *
> > - * Return:  TPM_SUCCESS   Authorization Verified
> > - *    TPM_AUTHFAIL   Authorization Failed
> > - *    TPM_FAIL    Failure during SHA1 routines
> > - *************************************************************************************/
> > -TPM_RESULT VerifyAuth( /*[IN]*/ const BYTE *outParamDigestText,
> > -                      /*[IN]*/ UINT32 outParamDigestTextSize,
> > -                      /*[IN]*/ const TPM_SECRET *HMACkey,
> > -                      /*[IN,OUT]*/ TCS_AUTH *auth,
> > -                      /*[IN]*/  TCS_CONTEXT_HANDLE hContext) {
> > -  if (outParamDigestText == NULL || auth == NULL)
> > -    return (TPM_AUTHFAIL);
> > -
> > -
> > -  // Create SHA1 inParamDigest
> > -  TPM_DIGEST outParamDigest;
> > -  Crypto_SHA1Full(outParamDigestText, outParamDigestTextSize, (BYTE *) &outParamDigest);
> > -
> > -  // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
> > -  TPM_DIGEST hm;
> > -  BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
> > -
> > -  BSG_PackList(   hmacText, 4,
> > -                 BSG_TPM_DIGEST, &outParamDigest,
> > -                 BSG_TPM_NONCE, &(auth->NonceEven),
> > -                 BSG_TPM_NONCE, &(auth->NonceOdd),
> > -                 BSG_TYPE_BOOL, &(auth->fContinueAuthSession) );
> > -
> > -  Crypto_HMAC((BYTE *) hmacText, sizeof(hmacText),
> > -             (BYTE *) HMACkey, sizeof(TPM_DIGEST), (BYTE *) &hm);
> > -
> > -  // Compare correct HMAC with provided one.
> > -  if (memcmp (&hm, &(auth->HMAC), sizeof(TPM_DIGEST)) == 0) { // 0 indicates equality
> > -    if (!auth->fContinueAuthSession)
> > -      vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM by fContinue=0.\n", auth->AuthHandle);
> > -
> > -    return (TPM_SUCCESS);
> > -  } else {
> > -    // If specified, reconnect the OIAP session.
> > -    // NOTE: This only works for TCS's that never have a 0 context.
> > -    if (hContext) {
> > -      vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM due to failure.\n", auth->AuthHandle);
> > -      VTSP_OIAP( hContext, auth);
> > -    }
> > -    return (TPM_AUTHFAIL);
> > -  }
> > -}
> > -
> > -TPM_RESULT VTSP_OIAP(const TCS_CONTEXT_HANDLE hContext,
> > -                    TCS_AUTH *auth) {
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "OIAP.\n");
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPMTRYRETURN( TCSP_OIAP(hContext,
> > -                         &auth->AuthHandle,
> > -                         &auth->NonceEven) );
> > -
> > -  memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
> > -  auth->fContinueAuthSession = FALSE;
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x opened by TPM_OIAP.\n", auth->AuthHandle);
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTSP_OSAP(const TCS_CONTEXT_HANDLE hContext,
> > -                    const TPM_ENTITY_TYPE entityType,
> > -                    const UINT32 entityValue,
> > -                    const TPM_AUTHDATA *usageAuth,
> > -                    TPM_SECRET *sharedSecret,
> > -                    TCS_AUTH *auth) {
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "OSAP.\n");
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_NONCE nonceEvenOSAP, nonceOddOSAP;
> > -
> > -  Crypto_GetRandom((BYTE *) &nonceOddOSAP, sizeof(TPM_NONCE) );
> > -
> > -  TPMTRYRETURN( TCSP_OSAP(    hContext,
> > -                             entityType,
> > -                             entityValue,
> > -                             nonceOddOSAP,
> > -                             &auth->AuthHandle,
> > -                             &auth->NonceEven,
> > -                             &nonceEvenOSAP) );
> > -
> > -  // Calculating Session Secret
> > -  BYTE sharedSecretText[TPM_DIGEST_SIZE * 2];
> > -
> > -  BSG_PackList(  sharedSecretText, 2,
> > -                BSG_TPM_NONCE, &nonceEvenOSAP,
> > -                BSG_TPM_NONCE, &nonceOddOSAP);
> > -
> > -  Crypto_HMAC(sharedSecretText, sizeof(sharedSecretText), (BYTE *) usageAuth, TPM_DIGEST_SIZE, (BYTE *) sharedSecret);
> > -
> > -  memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
> > -  auth->fContinueAuthSession = FALSE;
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x opened by TPM_OSAP.\n", auth->AuthHandle);
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -
> > -TPM_RESULT VTSP_TerminateHandle(const TCS_CONTEXT_HANDLE hContext,
> > -                                const TCS_AUTH *auth) {
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Terminate Handle.\n");
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPMTRYRETURN( TCSP_TerminateHandle(hContext, auth->AuthHandle) );
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM_TerminateHandle.\n", auth->AuthHandle);
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -
> > -TPM_RESULT VTSP_ReadPubek(   const TCS_CONTEXT_HANDLE hContext,
> > -                             CRYPTO_INFO *crypto_info) {
> > -
> > -  TPM_RESULT status;
> > -  TPM_NONCE antiReplay;
> > -  TPM_DIGEST   checksum;
> > -  BYTE *pubEKtext;
> > -  UINT32 pubEKtextsize;
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Reading Public EK.\n");
> > -
> > -  // GenerateAuth new nonceOdd
> > -  Crypto_GetRandom(&antiReplay, sizeof(TPM_NONCE) );
> > -
> > -
> > -  TPMTRYRETURN( TCSP_ReadPubek(  hContext,
> > -                                antiReplay,
> > -                                &pubEKtextsize,
> > -                                &pubEKtext,
> > -                                &checksum) );
> > -
> > -
> > -  // Extract the remaining output parameters
> > -  TPM_PUBKEY pubEK;
> > -
> > -  BSG_Unpack(BSG_TPM_PUBKEY, pubEKtext, (BYTE *) &pubEK);
> > -
> > -  // Build CryptoInfo for the bindingKey
> > -  TPM_RSA_KEY_PARMS rsaKeyParms;
> > -
> > -  BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
> > -            pubEK.algorithmParms.parms,
> > -            &rsaKeyParms);
> > -
> > -  Crypto_RSABuildCryptoInfoPublic(rsaKeyParms.exponentSize,
> > -                                 rsaKeyParms.exponent,
> > -                                 pubEK.pubKey.keyLength,
> > -                                 pubEK.pubKey.key,
> > -                                 crypto_info);
> > -
> > -  // Destroy rsaKeyParms
> > -  BSG_Destroy(BSG_TPM_RSA_KEY_PARMS, &rsaKeyParms);
> > -
> > -  // Set encryption scheme
> > -  crypto_info->encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
> > -  //crypto_info->encScheme = pubEK.algorithmParms.encScheme;
> > -  crypto_info->algorithmID = pubEK.algorithmParms.algorithmID;
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTSP_TakeOwnership(   const TCS_CONTEXT_HANDLE hContext,
> > -                                 const TPM_AUTHDATA *ownerAuth,
> > -                                 const TPM_AUTHDATA *srkAuth,
> > -                                 CRYPTO_INFO *ek_cryptoInfo,
> > -                                 TCS_AUTH *auth) {
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Taking Ownership of TPM.\n");
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_COMMAND_CODE command = TPM_ORD_TakeOwnership;
> > -  TPM_PROTOCOL_ID proto_id = TPM_PID_OWNER;
> > -  BYTE *new_srk;
> > -
> > -  BYTE *paramText;        // Digest to make Auth.
> > -  UINT32 paramTextSize;
> > -
> > -  // vars for srkpubkey parameter
> > -  TPM_KEY srkPub;
> > -  TPM_KEY_PARMS srkKeyInfo = {TPM_ALG_RSA, TPM_ES_RSAESOAEP_SHA1_MGF1, TPM_SS_NONE, 12, 0};
> > -  BYTE srkRSAkeyInfo[12] = { 0x00, 0x00, (RSA_KEY_SIZE >> 8), 0x00,   0x00, 0x00, 0x00, 0x02,   0x00, 0x00, 0x00, 0x00};
> > -  srkKeyInfo.parms = (BYTE *) &srkRSAkeyInfo;
> > -
> > -  struct pack_buf_t srkText;
> > -
> > -  //These values are accurate for an enc(AuthData).
> > -  struct pack_buf_t encOwnerAuth, encSrkAuth;
> > -
> > -  encOwnerAuth.data = (BYTE *)malloc(sizeof(BYTE) * 256);
> > -  encSrkAuth.data = (BYTE *)malloc(sizeof(BYTE) * 256);
> > -
> > -  if (encOwnerAuth.data == NULL || encSrkAuth.data == NULL) {
> > -    vtpmloginfo(VTPM_LOG_VTSP, "Could not malloc encrypted auths.\n");
> > -    status = TPM_RESOURCES;
> > -    goto abort_egress;
> > -  }
> > -
> > -  Crypto_RSAEnc(ek_cryptoInfo, sizeof(TPM_SECRET), (BYTE *) ownerAuth, &encOwnerAuth.size, encOwnerAuth.data);
> > -  Crypto_RSAEnc(ek_cryptoInfo, sizeof(TPM_SECRET), (BYTE *) srkAuth, &encSrkAuth.size, encSrkAuth.data);
> > -
> > -
> > -  // Build srk public key struct
> > -  srkPub.ver = TPM_STRUCT_VER_1_1;
> > -  srkPub.keyUsage = TPM_KEY_STORAGE;
> > -  srkPub.keyFlags = 0x00;
> > -  srkPub.authDataUsage = TPM_AUTH_ALWAYS;
> > -  memcpy(&srkPub.algorithmParms, &srkKeyInfo, sizeof(TPM_KEY_PARMS));
> > -  srkPub.PCRInfoSize = 0;
> > -  srkPub.PCRInfo = 0;
> > -  srkPub.pubKey.keyLength= 0;
> > -  srkPub.encDataSize = 0;
> > -
> > -  srkText.data = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> > -  srkText.size = BSG_Pack(BSG_TPM_KEY, (BYTE *) &srkPub, srkText.data);
> > -
> > -  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> > -
> > -  paramTextSize = BSG_PackList(paramText, 5,
> > -                              BSG_TPM_COMMAND_CODE,&command,
> > -                              BSG_TPM_PROTOCOL_ID, &proto_id,
> > -                              BSG_TPM_SIZE32_DATA, &encOwnerAuth,
> > -                              BSG_TPM_SIZE32_DATA, &encSrkAuth,
> > -                              BSG_TPM_KEY, &srkPub);
> > -
> > -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize, ownerAuth, auth) );
> > -
> > -  new_srk = srkText.data;
> > -  TPMTRYRETURN( TCSP_TakeOwnership ( hContext,
> > -                                    proto_id,
> > -                                    encOwnerAuth.size,
> > -                                    encOwnerAuth.data,
> > -                                    encSrkAuth.size,
> > -                                    encSrkAuth.data,
> > -                                    &srkText.size,
> > -                                    &new_srk,
> > -                                    auth ) );
> > -
> > -
> > -  paramTextSize = BSG_PackList(paramText, 2,
> > -                              BSG_TPM_RESULT, &status,
> > -                              BSG_TPM_COMMAND_CODE, &command);
> > -  memcpy(paramText + paramTextSize, new_srk, srkText.size);
> > -  paramTextSize += srkText.size;
> > -
> > -
> > -  TPMTRYRETURN( VerifyAuth(  paramText, paramTextSize,
> > -                            ownerAuth, auth,
> > -                            hContext) );
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  free(srkText.data);
> > -  free(encSrkAuth.data);
> > -  free(encOwnerAuth.data);
> > -  free(paramText);
> > -
> > -  TCS_FreeMemory(hContext, new_srk);
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTSP_DisablePubekRead( const TCS_CONTEXT_HANDLE    hContext,
> > -                                  const TPM_AUTHDATA          *ownerAuth,
> > -                                  TCS_AUTH                    *auth) {
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Disabling Pubek Read.\n");
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_COMMAND_CODE command = TPM_ORD_DisablePubekRead;
> > -
> > -  BYTE *paramText;        // Digest to make Auth.
> > -  UINT32 paramTextSize;
> > -
> > -  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> > -
> > -  paramTextSize = BSG_PackList(paramText, 1,
> > -                              BSG_TPM_COMMAND_CODE, &command);
> > -
> > -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> > -                             ownerAuth, auth) );
> > -
> > -  // Call TCS
> > -  TPMTRYRETURN( TCSP_DisablePubekRead ( hContext, // in
> > -                                        auth) );
> > -
> > -  // Verify Auth
> > -  paramTextSize = BSG_PackList(paramText, 2,
> > -                              BSG_TPM_RESULT, &status,
> > -                              BSG_TPM_COMMAND_CODE, &command);
> > -
> > -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> > -                           ownerAuth, auth,
> > -                           hContext) );
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -  free(paramText);
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTSP_CreateWrapKey(  const TCS_CONTEXT_HANDLE hContext,
> > -                                const TPM_KEY_USAGE      usage,
> > -                                const TPM_AUTHDATA       *newKeyAuth,
> > -                                const TCS_KEY_HANDLE     parentHandle,
> > -                                const TPM_AUTHDATA       *osapSharedSecret,
> > -                                buffer_t                 *pubKeyBuf,
> > -                                TCS_AUTH                 *auth) {
> > -
> > -  int i;
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_COMMAND_CODE command = TPM_ORD_CreateWrapKey;
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Creating new key of type %d.\n", usage);
> > -
> > -  // vars for Calculate encUsageAuth
> > -  BYTE *paramText;
> > -  UINT32 paramTextSize;
> > -
> > -  // vars for Calculate encUsageAuth
> > -  BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
> > -  TPM_DIGEST XORKey1;
> > -  UINT32 XORbufferSize;
> > -  TPM_SECRET encUsageAuth, encMigrationAuth;
> > -
> > -  // vars for Flatten newKey prototype
> > -  BYTE *flatKey = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> > -  UINT32 flatKeySize = TCPA_MAX_BUFFER_LENGTH;
> > -  struct pack_buf_t newKeyText;
> > -
> > -  // Fill in newKey
> > -  TPM_KEY newKey;
> > -
> > -  BYTE RSAkeyInfo[12] = { 0x00, 0x00, (RSA_KEY_SIZE >> 8), 0x00,   0x00, 0x00, 0x00, 0x02,   0x00, 0x00, 0x00, 0x00};
> > -  newKey.algorithmParms.algorithmID = TPM_ALG_RSA;
> > -  newKey.algorithmParms.parms = (BYTE *) &RSAkeyInfo;
> > -  newKey.algorithmParms.parmSize = 12;
> > -
> > -  switch (usage) {
> > -  case TPM_KEY_SIGNING:
> > -    vtpmloginfo(VTPM_LOG_VTSP, "Creating Signing Key...\n");
> > -    newKey.keyUsage = TPM_KEY_SIGNING;
> > -    newKey.algorithmParms.encScheme = TPM_ES_NONE;
> > -    newKey.algorithmParms.sigScheme = TPM_SS_RSASSAPKCS1v15_SHA1;
> > -    break;
> > -  case TPM_KEY_STORAGE:
> > -    vtpmloginfo(VTPM_LOG_VTSP, "Creating Storage Key...\n");
> > -    newKey.keyUsage = TPM_KEY_STORAGE;
> > -    newKey.algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
> > -    newKey.algorithmParms.sigScheme = TPM_SS_NONE;
> > -    break;
> > -  case TPM_KEY_BIND:
> > -    vtpmloginfo(VTPM_LOG_VTSP, "Creating Binding Key...\n");
> > -    newKey.keyUsage = TPM_KEY_BIND;
> > -    newKey.algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
> > -    newKey.algorithmParms.sigScheme = TPM_SS_NONE;
> > -    break;
> > -  default:
> > -    vtpmloginfo(VTPM_LOG_VTSP, "Cannot create key. Invalid Key Type.\n");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -
> > -  newKey.ver = TPM_STRUCT_VER_1_1;
> > -
> > -  newKey.keyFlags = 0;
> > -  newKey.authDataUsage = TPM_AUTH_ALWAYS;
> > -  newKey.pubKey.keyLength= 0;
> > -  newKey.encDataSize = 0;
> > -  newKey.encData = NULL;
> > -
> > -  // FIXME: Support PCR bindings
> > -  newKey.PCRInfoSize = 0;
> > -  newKey.PCRInfo = NULL;
> > -
> > -  // Calculate encUsageAuth
> > -  XORbufferSize = BSG_PackList(  XORbuffer, 2,
> > -                                BSG_TPM_SECRET, osapSharedSecret,
> > -                                BSG_TPM_NONCE, &auth->NonceEven);
> > -  Crypto_SHA1Full(XORbuffer, XORbufferSize, (BYTE *) &XORKey1);
> > -
> > -  // FIXME: No support for migratable keys.
> > -  for (i=0; i < TPM_DIGEST_SIZE; i++)
> > -    ((BYTE *) &encUsageAuth)[i] = ((BYTE *) &XORKey1)[i] ^ ((BYTE *) newKeyAuth)[i];
> > -
> > -  // Flatten newKey prototype
> > -  flatKeySize = BSG_Pack(BSG_TPM_KEY, (BYTE *) &newKey, flatKey);
> > -  newKeyText.data = flatKey;
> > -  newKeyText.size = flatKeySize;
> > -
> > -  // Generate HMAC
> > -  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> > -
> > -  paramTextSize = BSG_PackList(paramText, 3,
> > -                              BSG_TPM_COMMAND_CODE, &command,
> > -                              BSG_TPM_AUTHDATA, &encUsageAuth,
> > -                              BSG_TPM_AUTHDATA, &encMigrationAuth);
> > -  memcpy(paramText + paramTextSize, newKeyText.data, newKeyText.size);
> > -  paramTextSize += newKeyText.size;
> > -
> > -
> > -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> > -                             osapSharedSecret, auth) );
> > -
> > -  // Call TCS
> > -  TPMTRYRETURN( TCSP_CreateWrapKey(  hContext,
> > -                                    parentHandle,
> > -                                    encUsageAuth,
> > -                                    encMigrationAuth,
> > -                                    &newKeyText.size,
> > -                                    &newKeyText.data,
> > -                                    auth) );
> > -
> > -  // Verify Auth
> > -  paramTextSize = BSG_PackList(paramText, 2,
> > -                              BSG_TPM_RESULT, &status,
> > -                              BSG_TPM_COMMAND_CODE, &command);
> > -  memcpy(paramText + paramTextSize, newKeyText.data, newKeyText.size);
> > -  paramTextSize += newKeyText.size;
> > -
> > -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> > -                           osapSharedSecret, auth, 0) );
> > -
> > -  // Unpack/return key structure
> > -  TPMTRYRETURN(buffer_init(pubKeyBuf, 0, 0) );
> > -  TPMTRYRETURN(buffer_append_raw(pubKeyBuf, newKeyText.size, newKeyText.data) );
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  free(flatKey);
> > -  free(paramText);
> > -  TCS_FreeMemory(hContext, newKeyText.data);
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTSP_LoadKey(const TCS_CONTEXT_HANDLE    hContext,
> > -                        const TCS_KEY_HANDLE        hUnwrappingKey,
> > -                        const buffer_t              *rgbWrappedKeyBlob,
> > -                        const TPM_AUTHDATA          *parentAuth,
> > -                        TPM_HANDLE                  *newKeyHandle,
> > -                        TCS_AUTH                    *auth,
> > -                        CRYPTO_INFO                 *cryptoinfo,
> > -                        const BOOL                  skipTPMLoad) {
> > -
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Loading Key %s.\n", (!skipTPMLoad ? "into TPM" : "only into memory"));
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_COMMAND_CODE command = TPM_ORD_LoadKey;
> > -
> > -  BYTE *paramText=NULL;        // Digest to make Auth.
> > -  UINT32 paramTextSize;
> > -
> > -  // SkipTPMLoad stops key from being loaded into TPM, but still generates CRYPTO_INFO for it
> > -  if (! skipTPMLoad) {
> > -
> > -    if ((rgbWrappedKeyBlob == NULL) || (parentAuth == NULL) ||
> > -        (newKeyHandle==NULL) || (auth==NULL)) {
> > -      status = TPM_BAD_PARAMETER;
> > -      goto abort_egress;
> > -    }
> > -
> > -    // Generate Extra TCS Parameters
> > -    TPM_HANDLE phKeyHMAC;
> > -
> > -    paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> > -
> > -    paramTextSize = BSG_PackList(paramText, 1,
> > -                                BSG_TPM_COMMAND_CODE, &command);
> > -
> > -    memcpy(paramText + paramTextSize, rgbWrappedKeyBlob->bytes, buffer_len(rgbWrappedKeyBlob));
> > -    paramTextSize += buffer_len(rgbWrappedKeyBlob);
> > -
> > -    TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> > -                             parentAuth, auth) );
> > -
> > -    // Call TCS
> > -    TPMTRYRETURN( TCSP_LoadKeyByBlob(  hContext,
> > -                                      hUnwrappingKey,
> > -                                      buffer_len(rgbWrappedKeyBlob),
> > -                                      rgbWrappedKeyBlob->bytes,
> > -                                      auth,
> > -                                      newKeyHandle,
> > -                                      &phKeyHMAC) );
> > -
> > -    // Verify Auth
> > -    paramTextSize = BSG_PackList(paramText, 3,
> > -                                BSG_TPM_RESULT, &status,
> > -                                BSG_TPM_COMMAND_CODE, &command,
> > -                                BSG_TPM_HANDLE, newKeyHandle);
> > -
> > -    TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> > -                             parentAuth, auth,
> > -                             hContext) );
> > -  }
> > -
> > -  // Build cryptoinfo structure for software crypto function.
> > -  if (cryptoinfo != NULL) {
> > -    TPM_KEY newKey;
> > -
> > -    // Unpack/return key structure
> > -    BSG_Unpack(BSG_TPM_KEY, rgbWrappedKeyBlob->bytes , &newKey);
> > -    TPM_RSA_KEY_PARMS rsaKeyParms;
> > -
> > -    BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
> > -              newKey.algorithmParms.parms,
> > -              &rsaKeyParms);
> > -
> > -    Crypto_RSABuildCryptoInfoPublic(rsaKeyParms.exponentSize,
> > -                                   rsaKeyParms.exponent,
> > -                                   newKey.pubKey.keyLength,
> > -                                   newKey.pubKey.key,
> > -                                   cryptoinfo);
> > -
> > -    // Destroy rsaKeyParms
> > -    BSG_Destroy(BSG_TPM_RSA_KEY_PARMS, &rsaKeyParms);
> > -
> > -    // Set encryption scheme
> > -    cryptoinfo->encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
> > -  }
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  free(paramText);
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTSP_Unbind( const TCS_CONTEXT_HANDLE    hContext,
> > -                        const TPM_KEY_HANDLE        key_handle,
> > -                        const buffer_t              *bound_data,
> > -                        const TPM_AUTHDATA          *usage_auth,
> > -                        buffer_t                    *clear_data,
> > -                        TCS_AUTH                    *auth) {
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Unbinding %d bytes of data.\n", buffer_len(bound_data));
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_COMMAND_CODE command = TPM_ORD_UnBind;
> > -
> > -  BYTE *paramText;        // Digest to make Auth.
> > -  UINT32 paramTextSize;
> > -
> > -  // Generate Extra TCS Parameters
> > -  struct pack_buf_t clear_data32;
> > -  BYTE *clear_data_text;
> > -  UINT32 clear_data_size;
> > -
> > -  struct pack_buf_t bound_data32 = {bound_data->size, bound_data->bytes};
> > -
> > -  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> > -
> > -  paramTextSize = BSG_PackList(paramText, 2,
> > -                              BSG_TPM_COMMAND_CODE, &command,
> > -                              BSG_TPM_SIZE32_DATA, &bound_data32);
> > -
> > -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> > -                             usage_auth, auth) );
> > -
> > -  // Call TCS
> > -  TPMTRYRETURN( TCSP_UnBind( hContext,
> > -                            key_handle,
> > -                            buffer_len(bound_data),
> > -                            bound_data->bytes,
> > -                            auth,
> > -                            &clear_data_size,
> > -                            &clear_data_text) );
> > -
> > -
> > -  // Verify Auth
> > -  clear_data32.size = clear_data_size;
> > -  clear_data32.data = clear_data_text;
> > -  paramTextSize = BSG_PackList(paramText, 3,
> > -                              BSG_TPM_RESULT, &status,
> > -                              BSG_TPM_COMMAND_CODE, &command,
> > -                              BSG_TPM_SIZE32_DATA, &clear_data32);
> > -
> > -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> > -                           usage_auth, auth,
> > -                           hContext) );
> > -
> > -  // Unpack/return key structure
> > -  TPMTRYRETURN(buffer_init(clear_data, 0, 0));
> > -  TPMTRYRETURN(buffer_append_raw (clear_data, clear_data_size, clear_data_text) );
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  free(paramText);
> > -  TCS_FreeMemory(hContext, clear_data_text);
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTSP_Bind(   CRYPTO_INFO *cryptoInfo,
> > -                       const buffer_t *inData,
> > -                       buffer_t *outData)
> > -{
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Binding %d bytes of data.\n", buffer_len(inData));
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_BOUND_DATA boundData;
> > -  UINT32 i;
> > -
> > -  // Fill boundData's accessory information
> > -  boundData.ver = TPM_STRUCT_VER_1_1;
> > -  boundData.payload = TPM_PT_BIND;
> > -  boundData.payloadData = inData->bytes;
> > -
> > -  // Pack boundData before encryption
> > -  BYTE* flatBoundData = (BYTE *)malloc(sizeof(BYTE) *
> > -                                      (sizeof(TPM_VERSION) +
> > -                                       sizeof(TPM_PAYLOAD_TYPE) +
> > -                                       buffer_len(inData)));
> > -  if (flatBoundData == NULL) {
> > -    return TPM_NOSPACE;
> > -  }
> > -  UINT32 flatBoundDataSize = 0;
> > -  flatBoundDataSize = BSG_PackList(  flatBoundData, 2,
> > -                                    BSG_TPM_VERSION, &boundData.ver,
> > -                                    BSG_TYPE_BYTE, &boundData.payload);
> > -
> > -  memcpy(flatBoundData+flatBoundDataSize, inData->bytes, buffer_len(inData));
> > -  flatBoundDataSize += buffer_len(inData);
> > -
> > -  BYTE out_tmp[RSA_KEY_SIZE/8]; // RSAEnc does not do blocking, So this is what will come out.
> > -  UINT32 out_tmp_size;
> > -
> > -  // Encrypt flatBoundData
> > -  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_RSAEnc( cryptoInfo,
> > -                                           flatBoundDataSize,
> > -                                           flatBoundData,
> > -                                           &out_tmp_size,
> > -                                           out_tmp) );
> > -
> > -  if (out_tmp_size > RSA_KEY_SIZE/8) {
> > -    // The result of RSAEnc should be a fixed size based on key size.
> > -    vtpmlogerror(VTPM_LOG_VTSP, "Enc buffer just overflowed.\n");
> > -  }
> > -
> > -  buffer_init(outData, 0, NULL);
> > -  buffer_append_raw(outData, out_tmp_size, out_tmp);
> > -
> > -  vtpmloginfo(VTPM_LOG_TXDATA, "Bind Generated[%d] = 0x", out_tmp_size);
> > -  for(i = 0 ; i < out_tmp_size ; i++) {
> > -    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out_tmp[i]);
> > -  }
> > -  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> > -
> > -  goto egress;
> > -  abort_egress:
> > -  egress:
> > -
> > -  // Free flatBoundData
> > -  free(flatBoundData);
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -TPM_RESULT VTSP_Seal(const TCS_CONTEXT_HANDLE    hContext,
> > -                     const TPM_KEY_HANDLE        keyHandle,
> > -                     const TPM_AUTHDATA          *sealDataAuth,
> > -                     const TPM_PCR_COMPOSITE     *pcrComp,
> > -                     const buffer_t              *inData,
> > -                     TPM_STORED_DATA             *sealedData,
> > -                     const TPM_SECRET            *osapSharedSecret,
> > -                     TCS_AUTH                    *auth) {
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_COMMAND_CODE command = TPM_ORD_Seal;
> > -
> > -  BYTE *paramText;        // Digest to make Auth.
> > -  UINT32 paramTextSize;
> > -
> > -  // Generate PCR_Info Struct from Comp
> > -  TPM_PCR_INFO pcrInfo;
> > -  UINT32 pcrInfoSize, flatpcrSize;
> > -  BYTE flatpcr[3 +                          // PCR_Select = 3 1 byte banks
> > -               sizeof(UINT16) +             //              2 byte UINT16
> > -               sizeof(UINT32) +             // PCR_Comp   = 4 byte UINT32
> > -               24 * sizeof(TPM_PCRVALUE) ]; //              up to 24 PCRs
> > -
> > -  if (pcrComp != NULL) {
> > -      //printf("\n\tBinding to PCRs: ");
> > -      //for(int i = 0 ; i < pcrComp->select.sizeOfSelect ; i++)
> > -      //printf("%2.2x", pcrComp->select.pcrSelect[i]);
> > -
> > -      memcpy(&pcrInfo.pcrSelection, &pcrComp->select, sizeof(TPM_PCR_SELECTION));
> > -
> > -      flatpcrSize = BSG_Pack(BSG_TPM_PCR_COMPOSITE, (BYTE *) pcrComp, flatpcr);
> > -      Crypto_SHA1Full((BYTE *) flatpcr, flatpcrSize, (BYTE *) &(pcrInfo.digestAtRelease));
> > -      memset(&(pcrInfo.digestAtCreation), 0, sizeof(TPM_DIGEST));
> > -      pcrInfoSize = BSG_Pack(BSG_TPM_PCR_INFO, (BYTE *) &pcrInfo, flatpcr);
> > -  } else {
> > -      //printf("\n\tBinding to no PCRS.");
> > -      pcrInfoSize = 0;
> > -  }
> > -
> > -  // Calculate encUsageAuth
> > -  BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
> > -  UINT32 XORbufferSize = sizeof(XORbuffer);
> > -  TPM_DIGEST XORKey;
> > -  TPM_ENCAUTH encAuth;
> > -
> > -  BSG_PackList( XORbuffer, 2,
> > -                BSG_TPM_SECRET, osapSharedSecret,
> > -                BSG_TPM_NONCE, &auth->NonceEven );
> > -
> > -  Crypto_SHA1Full(XORbuffer, XORbufferSize, (BYTE *) &XORKey);
> > -
> > -  int i;
> > -  for (i=0; i < TPM_DIGEST_SIZE; i++)
> > -    ((BYTE *) &encAuth)[i] = ((BYTE *) &XORKey)[i] ^ ((BYTE *) sealDataAuth)[i];
> > -
> > -  // Generate Extra TCS Parameters
> > -  UINT32 inDataSize = buffer_len(inData);
> > -  struct pack_buf_t inData_pack = {inDataSize, inData->bytes};
> > -  struct pack_buf_t pcrInfo_pack = {pcrInfoSize, flatpcr};
> > -
> > -  UINT32 sealedDataSize;
> > -  BYTE *flatSealedData=NULL;
> > -
> > -  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> > -
> > -  paramTextSize = BSG_PackList(paramText, 4,
> > -                               BSG_TPM_COMMAND_CODE, &command,
> > -                               BSG_TPM_ENCAUTH, &encAuth,
> > -                               BSG_TPM_SIZE32_DATA, &pcrInfo_pack,
> > -                               BSG_TPM_SIZE32_DATA, &inData_pack);
> > -
> > -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> > -                              osapSharedSecret, auth) );
> > -
> > -  // Call TCS
> > -  TPMTRYRETURN( TCSP_Seal( hContext,
> > -                           keyHandle,
> > -                           encAuth,
> > -                           pcrInfoSize,
> > -                           flatpcr,
> > -                           inDataSize,
> > -                           inData->bytes,
> > -                           auth,
> > -                           &sealedDataSize,
> > -                           &flatSealedData) );
> > -
> > -  // Unpack/return key structure
> > -  BSG_Unpack( BSG_TPM_STORED_DATA, flatSealedData, sealedData );
> > -
> > -  paramTextSize = BSG_PackList(paramText, 3,
> > -                               BSG_TPM_RESULT, &status,
> > -                               BSG_TPM_COMMAND_CODE, &command,
> > -                               BSG_TPM_STORED_DATA, sealedData);
> > -
> > -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> > -                            osapSharedSecret, auth,
> > -                            0) );
> > -
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  if (flatSealedData)
> > -    TCS_FreeMemory( hContext, flatSealedData);
> > -
> > -  free(paramText);
> > -  return status;
> > -}
> > -
> > -
> > -TPM_RESULT VTSP_Unseal(const TCS_CONTEXT_HANDLE    hContext,
> > -                       const TPM_KEY_HANDLE        keyHandle,
> > -                       const TPM_STORED_DATA       *sealedData,
> > -                       const TPM_AUTHDATA          *key_usage_auth,
> > -                       const TPM_AUTHDATA          *data_usage_auth,
> > -                       buffer_t                    *outData,
> > -                       TCS_AUTH                    *auth,
> > -                       TCS_AUTH                    *dataAuth) {
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_COMMAND_CODE command = TPM_ORD_Unseal;
> > -
> > -  BYTE *paramText;        // Digest to make Auth.
> > -  UINT32 paramTextSize;
> > -
> > -  // Generate Extra TCS Parameters
> > -  UINT32 sealDataSize, clearDataSize;
> > -  BYTE *flatSealedData= (BYTE *) malloc(sizeof(TPM_VERSION) +
> > -                                        2 * sizeof(UINT32) +
> > -                                        sealedData->sealInfoSize +
> > -                                        sealedData->encDataSize),
> > -       *clearData=NULL;
> > -
> > -  sealDataSize = BSG_Pack(BSG_TPM_STORED_DATA, sealedData, flatSealedData );
> > -
> > -  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> > -
> > -  paramTextSize = BSG_PackList(paramText, 2,
> > -                               BSG_TPM_COMMAND_CODE, &command,
> > -                               BSG_TPM_STORED_DATA, sealedData);
> > -
> > -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> > -                              key_usage_auth, auth) );
> > -
> > -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> > -                              data_usage_auth, dataAuth) );
> > -  // Call TCS
> > -  TPMTRYRETURN( TCSP_Unseal(  hContext,
> > -                              keyHandle,
> > -                              sealDataSize,
> > -                              flatSealedData,
> > -                              auth,
> > -                              dataAuth,
> > -                              &clearDataSize,
> > -                              &clearData) );
> > -
> > -  // Verify Auth
> > -  struct pack_buf_t clearData_pack = {clearDataSize, clearData};
> > -
> > -  paramTextSize = BSG_PackList(paramText, 3,
> > -                               BSG_TPM_RESULT, &status,
> > -                               BSG_TPM_COMMAND_CODE, &command,
> > -                               BSG_TPM_SIZE32_DATA, &clearData_pack);
> > -
> > -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> > -                            key_usage_auth, auth,
> > -                            hContext) );
> > -
> > -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> > -                            data_usage_auth, dataAuth,
> > -                            hContext) );
> > -
> > -  // Unpack/return key structure
> > -  TPMTRYRETURN( buffer_init(outData, clearDataSize, clearData) );
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  if (flatSealedData)
> > -    TCS_FreeMemory( hContext, clearData);
> > -
> > -  free(paramText);
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTSP_SaveState( const TCS_CONTEXT_HANDLE    hContext) {
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Calling TPM_SaveState.\n");
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  // Call TCS
> > -  return ( TCSP_SaveState ( hContext ) );
> > -
> > -}
> > -
> > -
> > -// Function Reaches into unsupported TCS command, beware.
> > -TPM_RESULT VTSP_RawTransmit(const TCS_CONTEXT_HANDLE    hContext,
> > -                            const buffer_t *inbuf,
> > -                            buffer_t *outbuf ) {
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Passthrough in use.\n");
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  // Generate Extra TCS Parameters
> > -  BYTE *resultText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> > -  UINT32 resultTextSize =  TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // Call TCS
> > -  TPMTRYRETURN( TCSP_RawTransmitData(buffer_len(inbuf), inbuf->bytes,
> > -                                    &resultTextSize, resultText) );
> > -
> > -  // Unpack/return key structure
> > -  TPMTRYRETURN(buffer_init (outbuf, resultTextSize, resultText) );
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -  TCS_FreeMemory(hContext, resultText);
> > -  free(resultText);
> > -  return status;
> > -}
> > diff --git a/tools/vtpm_manager/manager/vtsp.h b/tools/vtpm_manager/manager/vtsp.h
> > deleted file mode 100644
> > index 2fb0440..0000000
> > --- a/tools/vtpm_manager/manager/vtsp.h
> > +++ /dev/null
> > @@ -1,126 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtsp.h
> > -//
> > -//  Higher level interface to TCS.
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __VTSP_H__
> > -#define __VTSP_H__
> > -
> > -#include "tcg.h"
> > -#include "tcs.h"
> > -
> > -#define KEY_BUFFER_SIZE 2048
> > -
> > -TPM_RESULT VTSP_RawTransmit(const TCS_CONTEXT_HANDLE    hContext,
> > -                            const buffer_t *inbuf,
> > -                            buffer_t *outbuf );
> > -
> > -TPM_RESULT VTSP_OIAP(  const TCS_CONTEXT_HANDLE hContext,
> > -                       TCS_AUTH *auth);
> > -
> > -TPM_RESULT VTSP_OSAP(  const TCS_CONTEXT_HANDLE hContext,
> > -                       const TPM_ENTITY_TYPE entityType,
> > -                       const UINT32 entityValue,
> > -                       const TPM_AUTHDATA *usageAuth,
> > -                       TPM_SECRET *sharedsecret,
> > -                       TCS_AUTH *auth);
> > -
> > -TPM_RESULT VTSP_TerminateHandle(const TCS_CONTEXT_HANDLE hContext,
> > -                                const TCS_AUTH *auth);
> > -
> > -TPM_RESULT VTSP_ReadPubek(   const TCS_CONTEXT_HANDLE hContext,
> > -                             CRYPTO_INFO *cypto_info);
> > -
> > -TPM_RESULT VTSP_TakeOwnership(   const TCS_CONTEXT_HANDLE hContext,
> > -                                 const TPM_AUTHDATA *ownerAuth,
> > -                                 const TPM_AUTHDATA *srkAuth,
> > -                                 CRYPTO_INFO *ek_cryptoInfo,
> > -                                 TCS_AUTH *auth);
> > -
> > -TPM_RESULT VTSP_DisablePubekRead( const TCS_CONTEXT_HANDLE    hContext,
> > -                                  const TPM_AUTHDATA *ownerAuth,
> > -                                  TCS_AUTH                    *auth);
> > -
> > -TPM_RESULT VTSP_CreateWrapKey(  const TCS_CONTEXT_HANDLE hContext,
> > -                                const TPM_KEY_USAGE      usage,
> > -                                const TPM_AUTHDATA       *newKeyAuth,
> > -                                const TCS_KEY_HANDLE     parentHandle,
> > -                                const TPM_AUTHDATA       *osapSharedSecret,
> > -                                buffer_t                 *pubKeyBuf,
> > -                                TCS_AUTH                 *auth);
> > -
> > -TPM_RESULT VTSP_LoadKey(const TCS_CONTEXT_HANDLE    hContext,
> > -                        const TCS_KEY_HANDLE        hUnwrappingKey,
> > -                        const buffer_t              *rgbWrappedKeyBlob,
> > -                        const TPM_AUTHDATA          *parentAuth,
> > -                        TPM_HANDLE                  *newKeyHandle,
> > -                        TCS_AUTH                    *pAuth,
> > -                        CRYPTO_INFO                 *cryptoinfo,
> > -                        const BOOL                  skipTPMLoad);
> > -
> > -TPM_RESULT VTSP_Unbind( const TCS_CONTEXT_HANDLE    hContext,
> > -                        const TPM_KEY_HANDLE        key_handle,
> > -                        const buffer_t              *bound_data,
> > -                        const TPM_AUTHDATA          *usage_auth,
> > -                        buffer_t                    *clear_data,
> > -                        TCS_AUTH                    *auth);
> > -
> > -TPM_RESULT VTSP_Bind(   CRYPTO_INFO *cryptoInfo,
> > -            const buffer_t *inData,
> > -            buffer_t *outData);
> > -
> > -TPM_RESULT VTSP_Seal(const TCS_CONTEXT_HANDLE    hContext,
> > -                     const TPM_KEY_HANDLE        keyHandle,
> > -                     const TPM_AUTHDATA          *sealDataAuth,
> > -                     const TPM_PCR_COMPOSITE     *pcrComp,
> > -                     const buffer_t              *inData,
> > -                     TPM_STORED_DATA             *sealedData,
> > -                     const TPM_SECRET            *osapSharedSecret,
> > -                     TCS_AUTH                    *auth);
> > -
> > -TPM_RESULT VTSP_Unseal(const TCS_CONTEXT_HANDLE    hContext,
> > -                       const TPM_KEY_HANDLE        keyHandle,
> > -                       const TPM_STORED_DATA       *sealedData,
> > -                       const TPM_AUTHDATA          *key_usage_auth,
> > -                       const TPM_AUTHDATA          *data_usage_auth,
> > -                       buffer_t                    *outData,
> > -                       TCS_AUTH                    *auth,
> > -                       TCS_AUTH                    *dataAuth);
> > -
> > -TPM_RESULT VTSP_SaveState( const TCS_CONTEXT_HANDLE    hContext);
> > -
> > -#endif //_VTSP_H_
> > diff --git a/tools/vtpm_manager/migration/Makefile b/tools/vtpm_manager/migration/Makefile
> > deleted file mode 100644
> > index e33ae95..0000000
> > --- a/tools/vtpm_manager/migration/Makefile
> > +++ /dev/null
> > @@ -1,42 +0,0 @@
> > -XEN_ROOT = $(CURDIR)/../../..
> > -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> > -
> > -VPATH = ../manager
> > -
> > -BIND           = vtpm_migratord
> > -BINC           = vtpm_migrator
> > -
> > -SRCSD    = vtpm_manager_if.c vtpm_migratord.c vtpm_migratord_handler.c vtpm_ipc.c
> > -SRCSC    = vtpm_manager_if.c vtpm_migrator_if.c vtpm_migratorc.c vtpm_ipc.c
> > -
> > -OBJSD    = $(patsubst %.c,%.o,$(SRCSD))
> > -OBJSC    = $(patsubst %.c,%.o,$(SRCSC))
> > -
> > -.PHONY: all
> > -all: build
> > -
> > -.PHONY: build
> > -build: $(BIND) $(BINC)
> > -
> > -.PHONY: install
> > -install: build
> > -       $(INSTALL_PROG) $(BIND) $(DESTDIR)$(BINDIR)
> > -       $(INSTALL_PROG) $(BINC) $(DESTDIR)$(BINDIR)
> > -
> > -.PHONY: clean
> > -clean:
> > -       rm -f $(BINC) $(BIND)
> > -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> > -
> > -.PHONY: mrproper
> > -mrproper: clean
> > -       rm -f *~
> > -
> > -$(BIND): $(OBJSD)
> > -       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
> > -
> > -$(BINC): $(OBJSC)
> > -       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
> > -
> > -# libraries
> > -LIBS += ../util/libTCGUtils.a
> > diff --git a/tools/vtpm_manager/migration/vtpm_manager_if.c b/tools/vtpm_manager/migration/vtpm_manager_if.c
> > deleted file mode 100644
> > index 08986f4..0000000
> > --- a/tools/vtpm_manager/migration/vtpm_manager_if.c
> > +++ /dev/null
> > @@ -1,186 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_manager_if.c
> > -//
> > -//  Provides functions to call local vtpm manager interface (Hotplug)
> > -//
> > -// ==================================================================
> > -
> > -#include <stdio.h>
> > -#include <fcntl.h>
> > -#include <malloc.h>
> > -#include <string.h>
> > -
> > -#include "tcg.h"
> > -#include "buffer.h"
> > -#include "log.h"
> > -#include "vtpm_ipc.h"
> > -#include "bsg.h"
> > -#include "vtpm_migrator.h"
> > -#include "vtpm_manager.h"
> > -
> > -#define VTPM_TX_HP_FNAME       "/var/vtpm/fifos/from_console.fifo"
> > -#define VTPM_RX_HP_FNAME       "/var/vtpm/fifos/to_console.fifo"
> > -
> > -static vtpm_ipc_handle_t tx_ipc_h, rx_ipc_h;
> > -
> > -TPM_RESULT vtpm_manager_open(){
> > -
> > -  if ( (vtpm_ipc_init(&tx_ipc_h,  VTPM_TX_HP_FNAME, O_RDWR, TRUE) != 0) ||  //FIXME: wronly
> > -       (vtpm_ipc_init(&rx_ipc_h,  VTPM_RX_HP_FNAME, O_RDWR, TRUE) != 0) ) { //FIXME: rdonly
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to connect to vtpm_manager.\n");
> > -    return TPM_IOERROR;
> > -  }
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -void vtpm_manager_close() {
> > -
> > -  vtpm_ipc_close(&tx_ipc_h);
> > -  vtpm_ipc_close(&rx_ipc_h);
> > -}
> > -
> > -
> > -TPM_RESULT vtpm_manager_command(TPM_COMMAND_CODE ord,
> > -                                buffer_t *command_param_buf,
> > -                                TPM_RESULT *cmd_status, /* out */
> > -                                buffer_t *result_param_buf) {
> > -
> > -  TPM_RESULT status = TPM_FAIL;
> > -  int  size_read, size_write, i;
> > -  BYTE *adj_command, response_header[VTPM_COMMAND_HEADER_SIZE_SRV];
> > -  UINT32 dmi_id=0, adj_command_size, out_param_size, adj_param_size;
> > -  TPM_TAG tag=VTPM_TAG_REQ;
> > -
> > -  if ( (!command_param_buf) || (!result_param_buf) || (!cmd_status) ) {
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  adj_command_size = VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(command_param_buf);
> > -  adj_command = (BYTE *) malloc( adj_command_size );
> > -  if (!adj_command) {
> > -    status = TPM_RESOURCES;
> > -    goto abort_egress;
> > -  }
> > -
> > -  out_param_size = VTPM_COMMAND_HEADER_SIZE + buffer_len(command_param_buf);
> > -  BSG_PackList(adj_command, 4,
> > -                 BSG_TYPE_UINT32, &dmi_id,
> > -                 BSG_TPM_TAG, &tag,
> > -                 BSG_TYPE_UINT32, &out_param_size,
> > -                 BSG_TPM_COMMAND_CODE, &ord );
> > -
> > -  memcpy(adj_command + VTPM_COMMAND_HEADER_SIZE_SRV, command_param_buf->bytes, buffer_len(command_param_buf));
> > -
> > -  size_write = vtpm_ipc_write(&tx_ipc_h, NULL, adj_command, adj_command_size);
> > -
> > -  if (size_write > 0) {
> > -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT (MGR): 0x");
> > -    for (i=0; i< adj_command_size; i++) {
> > -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", adj_command[i]);
> > -    }
> > -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -  } else {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Error writing VTPM Manager console.\n");
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if (size_write != (int) adj_command_size )
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Could not write entire command to mgr (%d/%d)\n", size_write, adj_command_size);
> > -
> > -  // Read header for response to manager command
> > -  size_read = vtpm_ipc_read(&rx_ipc_h, NULL, response_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> > -  if (size_read > 0) {
> > -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV (MGR): 0x");
> > -    for (i=0; i<size_read; i++)
> > -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", response_header[i]);
> > -
> > -  } else {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Error reading from vtpm manager.\n");
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Command from vtpm_manager shorter than std header.\n");
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  // Unpack response from DMI for TPM command
> > -  BSG_UnpackList(response_header, 4,
> > -                 BSG_TYPE_UINT32, &dmi_id,
> > -                 BSG_TPM_TAG, &tag,
> > -                 BSG_TYPE_UINT32, &out_param_size,
> > -                 BSG_TPM_COMMAND_CODE, cmd_status );
> > -
> > -  // If response has parameters, read them.
> > -  // Note that out_param_size is in the client's context
> > -  adj_param_size = out_param_size - VTPM_COMMAND_HEADER_SIZE;
> > -  if (adj_param_size > 0) {
> > -    TPMTRYRETURN( buffer_init( result_param_buf, adj_param_size, NULL) );
> > -    size_read = vtpm_ipc_read(&rx_ipc_h, NULL, result_param_buf->bytes, adj_param_size);
> > -    if (size_read > 0) {
> > -      for (i=0; i< size_read; i++)
> > -        vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_param_buf->bytes[i]);
> > -
> > -    } else {
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Error reading from vtpm manager.\n");
> > -      goto abort_egress;
> > -    }
> > -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> > -
> > -    if (size_read < (int)adj_param_size) {
> > -      vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
> > -      status = TPM_IOERROR;
> > -      goto abort_egress;
> > -    }
> > -  } else {
> > -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> > -  }
> > -
> > -  status=TPM_SUCCESS;
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -
> > diff --git a/tools/vtpm_manager/migration/vtpm_migrator.h b/tools/vtpm_manager/migration/vtpm_migrator.h
> > deleted file mode 100644
> > index 8d52e66..0000000
> > --- a/tools/vtpm_manager/migration/vtpm_migrator.h
> > +++ /dev/null
> > @@ -1,104 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_migrator.h
> > -//
> > -//  Public Interface header for VTPM Migrator
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __VTPM_MIGRATOR_H__
> > -#define __VTPM_MIGRATOR_H__
> > -
> > -#define VTPM_MTAG_REQ 0x02c1
> > -#define VTPM_MTAG_RSP 0x02c4
> > -
> > -// Header sizes.
> > -#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
> > -//               sizeof(TPM_TAG + UINT32 + TPM_COMMAND_CODE)
> > -
> > -//*********************** Connection Info **************************
> > -#define VTPM_MIG_PORT 48879
> > -
> > -//************************ Command Codes ***************************
> > -#define VTPM_MORD_MIG_STEP1     0x00
> > -#define VTPM_MORD_MIG_STEP2     0x01
> > -#define VTPM_MORD_MIG_STEP3     0x02
> > -#define VTPM_MORD_MIG_STEP4     0x03
> > -
> > -//************************ Return Codes ****************************
> > -#define VTPM_SUCCESS               0
> > -#define VTPM_FAIL                  1
> > -
> > -/******************* Command Parameter API *************************
> > -
> > -VTPM Command Format
> > -  tpm tag: 2 bytes
> > -  command size: 4 bytes         // Size of command including header but not DMI
> > -  ord: 4 bytes                  // Command ordinal above
> > -  parameters: size - 10 bytes   // Command Parameter
> > -
> > -VTPM Response Format
> > -  tpm tag: 2 bytes
> > -  response_size: 4 bytes
> > -  status: 4 bytes
> > -  parameters: size - 10 bytes
> > -
> > -
> > -VTPM_Mig_Phase1:
> > -    Unsupported: (Handled by scripts)
> > -
> > -VTPM_Mig_Phase2
> > -  Input Parameters:
> > -    domain_name_size: 4 bytes
> > -    domain_name : domain_name_size bytes
> > -  Output Parameters:
> > -    pub_exp_size: 4 bytes
> > -    pub_exp: pub_exp_size bytes
> > -    pub_mod_size: 4 bytes
> > -    pub_mod: pub_mod_size bytes
> > -
> > -VTPM_Mig_Phase3
> > -  Input Parameters:
> > -    vtpm_state_size: 4 bytes
> > -    vtpm_state: vtpm_state_size bytes
> > -  Output Parameters:
> > -    none
> > -
> > -VTPM_Mig_Phase4
> > -    Unsupported: (Handled by scripts)
> > -
> > -
> > -*********************************************************************/
> > -
> > -#endif //_VTPM_MANAGER_H_
> > diff --git a/tools/vtpm_manager/migration/vtpm_migrator_if.c b/tools/vtpm_manager/migration/vtpm_migrator_if.c
> > deleted file mode 100644
> > index de48b2d..0000000
> > --- a/tools/vtpm_manager/migration/vtpm_migrator_if.c
> > +++ /dev/null
> > @@ -1,219 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_migrator_if.c
> > -//
> > -//  Provides functions to call open network connection & call
> > -//  a function on the vtpm_migratord on the destination
> > -//
> > -// ==================================================================
> > -
> > -#include <stdio.h>
> > -#include <sys/types.h>
> > -#include <sys/socket.h>
> > -#include <netinet/in.h>
> > -#include <arpa/inet.h>
> > -#include <netdb.h>
> > -#include <string.h>
> > -#include <malloc.h>
> > -
> > -#include "tcg.h"
> > -#include "buffer.h"
> > -#include "log.h"
> > -#include "bsg.h"
> > -#include "vtpm_migrator.h"
> > -
> > -static int sock_desc;
> > -
> > -
> > -TPM_RESULT vtpm_migratord_open(char *server_address){
> > -
> > -  TPM_RESULT status = TPM_FAIL;
> > -
> > -  /* network variables */
> > -  struct in_addr ip_addr;
> > -  struct sockaddr_in server_addr;
> > -  int addr_len;
> > -  struct hostent *dns_info=NULL;
> > -
> > -  /* set up connection to server*/
> > -  dns_info = gethostbyname(server_address);
> > -  ip_addr.s_addr = *((unsigned long *) dns_info->h_addr_list[0]);
> > -
> > -  if(ip_addr.s_addr < 0) {
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  /* set up server variable */
> > -  memset((char *)&server_addr, 0, sizeof(server_addr));
> > -  server_addr.sin_family = AF_INET;
> > -  server_addr.sin_port = htons(VTPM_MIG_PORT);
> > -  server_addr.sin_addr.s_addr = ip_addr.s_addr;
> > -
> > -  /* open socket, make connection */
> > -  sock_desc = socket(AF_INET, SOCK_STREAM, 0);
> > -
> > -  if (sock_desc < 0 ) {
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if (connect(sock_desc,
> > -              (struct sockaddr *)&server_addr,
> > -              sizeof(server_addr)) < 0 ) {
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  status = TPM_SUCCESS;
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -void vtpm_migratord_close() {
> > -  close(sock_desc);
> > -}
> > -
> > -
> > -TPM_RESULT vtpm_migratord_command(TPM_COMMAND_CODE ord,
> > -                                buffer_t *command_param_buf,
> > -                                TPM_RESULT *cmd_status, /* out */
> > -                                buffer_t *result_param_buf) {
> > -
> > -  TPM_RESULT status = TPM_FAIL;
> > -  int  size_read, size_write, i;
> > -  BYTE *command, response_header[VTPM_COMMAND_HEADER_SIZE];
> > -  UINT32 dmi_id=0, command_size, out_param_size, adj_param_size;
> > -  TPM_TAG tag=VTPM_MTAG_REQ;
> > -
> > -  if ( (!command_param_buf) || (!result_param_buf) || (!cmd_status) ) {
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  command_size = VTPM_COMMAND_HEADER_SIZE + buffer_len(command_param_buf);
> > -  command = (BYTE *) malloc( command_size );
> > -  if (!command) {
> > -    status = TPM_RESOURCES;
> > -    goto abort_egress;
> > -  }
> > -
> > -  BSG_PackList(command, 3,
> > -                 BSG_TPM_TAG, &tag,
> > -                 BSG_TYPE_UINT32, &command_size,
> > -                 BSG_TPM_COMMAND_CODE, &ord );
> > -
> > -  memcpy(command + VTPM_COMMAND_HEADER_SIZE, command_param_buf->bytes, buffer_len(command_param_buf));
> > -
> > -  size_write = write(sock_desc, command, command_size);
> > -
> > -  if (size_write > 0) {
> > -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT (MIGd): 0x");
> > -    for (i=0; i< command_size; i++) {
> > -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", command[i]);
> > -    }
> > -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -  } else {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Error writing to migration server via network.\n");
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if (size_write != (int) command_size )
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Could not write entire command to migration server (%d/%d)\n", size_write, command_size);
> > -
> > -  // Read header for response
> > -  size_read = read(sock_desc, response_header, VTPM_COMMAND_HEADER_SIZE);
> > -  if (size_read > 0) {
> > -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV (MIGd): 0x");
> > -    for (i=0; i<size_read; i++)
> > -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", response_header[i]);
> > -
> > -  } else {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Error reading from Migration Server.\n");
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Command from migration server shorter than std header.\n");
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  // Unpack response from DMI for TPM command
> > -  BSG_UnpackList(response_header, 3,
> > -                 BSG_TPM_TAG, &tag,
> > -                 BSG_TYPE_UINT32, &out_param_size,
> > -                 BSG_TPM_COMMAND_CODE, cmd_status );
> > -
> > -  // If response has parameters, read them.
> > -  adj_param_size = out_param_size - VTPM_COMMAND_HEADER_SIZE;
> > -  if (adj_param_size > 0) {
> > -    TPMTRYRETURN( buffer_init( result_param_buf, adj_param_size, NULL) );
> > -    size_read = read(sock_desc, result_param_buf->bytes, adj_param_size);
> > -    if (size_read > 0) {
> > -      for (i=0; i< size_read; i++)
> > -        vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_param_buf->bytes[i]);
> > -
> > -    } else {
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Error reading from migration server.\n");
> > -      goto abort_egress;
> > -    }
> > -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> > -
> > -    if (size_read < (int)adj_param_size) {
> > -      vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
> > -      status = TPM_IOERROR;
> > -      goto abort_egress;
> > -    }
> > -  } else {
> > -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> > -  }
> > -
> > -  status=TPM_SUCCESS;
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -
> > diff --git a/tools/vtpm_manager/migration/vtpm_migratorc.c b/tools/vtpm_manager/migration/vtpm_migratorc.c
> > deleted file mode 100644
> > index 18b3bdb..0000000
> > --- a/tools/vtpm_manager/migration/vtpm_migratorc.c
> > +++ /dev/null
> > @@ -1,211 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -
> > -#include <stdio.h>
> > -#include <string.h>
> > -
> > -#include "tcg.h"
> > -#include "log.h"
> > -#include "bsg.h"
> > -#include "buffer.h"
> > -#include "vtpm_migrator.h"
> > -#include "vtpm_manager.h"
> > -
> > -TPM_RESULT handle_vtpm_mig_step2(char *server_addr,
> > -                                 char *name,
> > -                                 UINT32 instance) {
> > -  TPM_RESULT status, cmd_status;
> > -  buffer_t out_param_buf=NULL_BUF, mig_key_buf=NULL_BUF, empty_buf=NULL_BUF;
> > -  UINT32 offset;
> > -  struct pack_buf_t addr_data32;
> > -
> > -  //===== Get Destination's Public Migration Key ======
> > -  TPMTRYRETURN( vtpm_migratord_open(server_addr) );
> > -
> > -  TPMTRYRETURN( vtpm_migratord_command(VTPM_MORD_MIG_STEP2,
> > -                                     &out_param_buf,
> > -                                     &cmd_status,
> > -                                     &mig_key_buf) );
> > -  vtpm_migratord_close();
> > -
> > -  TPMTRYRETURN(cmd_status);
> > -
> > -  //===== Load migration key into vtpm_manager ========
> > -
> > -  addr_data32.data = (BYTE *)server_addr;
> > -  addr_data32.size = strlen(server_addr) + 1; // Include the null
> > -
> > -  TPMTRYRETURN ( buffer_init ( &out_param_buf,
> > -                               sizeof(UINT32) + addr_data32.size +buffer_len(&mig_key_buf),
> > -                               NULL ) ) ;
> > -
> > -  offset =  BSG_PackList(out_param_buf.bytes, 1,
> > -               BSG_TPM_SIZE32_DATA, &addr_data32);
> > -
> > -  memcpy(out_param_buf.bytes + offset , mig_key_buf.bytes, buffer_len(&mig_key_buf) );
> > -
> > -  TPMTRYRETURN ( vtpm_manager_open() );
> > -
> > -  TPMTRYRETURN ( vtpm_manager_command(VTPM_ORD_LOAD_MIG_KEY,
> > -                                      &out_param_buf,
> > -                                      &cmd_status,
> > -                                      &empty_buf) );
> > -
> > -  vtpm_manager_close();
> > -
> > -  TPMTRYRETURN(cmd_status);
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  buffer_free(&mig_key_buf);
> > -  buffer_free(&out_param_buf);
> > -
> > -  return status;
> > -}
> > -
> > -
> > -TPM_RESULT handle_vtpm_mig_step3(char *server_addr,
> > -                                 char *name,
> > -                                 UINT32 instance) {
> > -  TPM_RESULT status, cmd_status;
> > -  buffer_t out_param_buf=NULL_BUF, state_buf=NULL_BUF, empty_buf=NULL_BUF;
> > -  struct pack_buf_t addr_data32, name_data32, state_data32;
> > -
> > -  //===== Get vtpm state from vtpm_manager ========
> > -  addr_data32.data = (BYTE *)server_addr;
> > -  addr_data32.size = strlen(server_addr) + 1; // Include the null
> > -
> > -  TPMTRYRETURN ( buffer_init ( &out_param_buf,
> > -                               (2 * sizeof(UINT32)) + addr_data32.size,
> > -                               NULL ) ) ;
> > -
> > -  BSG_PackList(out_param_buf.bytes, 2,
> > -                 BSG_TYPE_UINT32, &instance,
> > -                 BSG_TPM_SIZE32_DATA, &addr_data32);
> > -
> > -  TPMTRYRETURN ( vtpm_manager_open() );
> > -
> > -  TPMTRYRETURN ( vtpm_manager_command(VTPM_ORD_MIGRATE_OUT,
> > -                                      &out_param_buf,
> > -                                      &cmd_status,
> > -                                      &state_buf) );
> > -
> > -  vtpm_manager_close();
> > -
> > -  TPMTRYRETURN(cmd_status);
> > -
> > -  TPMTRYRETURN( buffer_free( &out_param_buf ) );
> > -
> > -  //===== Send vtpm state to destination ======
> > -  name_data32.data = (BYTE *)name;
> > -  name_data32.size = strlen(name) + 1; // Include the null
> > -  state_data32.data = state_buf.bytes;
> > -  state_data32.size = buffer_len(&state_buf);
> > -
> > -  TPMTRYRETURN( buffer_init( &out_param_buf,
> > -                             2 * sizeof(UINT32) + name_data32.size + state_data32.size,
> > -                             NULL ) ) ;
> > -
> > -  BSG_PackList(out_param_buf.bytes, 2,
> > -                 BSG_TPM_SIZE32_DATA, &name_data32,
> > -                 BSG_TPM_SIZE32_DATA, &state_data32);
> > -
> > -  TPMTRYRETURN( vtpm_migratord_open(server_addr) );
> > -
> > -  TPMTRYRETURN( vtpm_migratord_command(VTPM_MORD_MIG_STEP3,
> > -                                     &out_param_buf,
> > -                                     &cmd_status,
> > -                                     &empty_buf) );
> > -  vtpm_migratord_close();
> > -
> > -  TPMTRYRETURN(cmd_status);
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  buffer_free( &out_param_buf);
> > -  buffer_free( &state_buf);
> > -  buffer_free( &empty_buf);
> > -
> > -  return status;
> > -}
> > -
> > -
> > -// Usage vtpm_migrator addr domain_name instance step
> > -
> > -int main(int argc, char **argv) {
> > -
> > -    /* variables for processing of command */
> > -    TPM_RESULT status = TPM_FAIL;
> > -    char *server_addr, *name;
> > -    UINT32 instance, step;
> > -
> > -    if (argc != 5) {
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Usage: vtpm_migrator addr vm_name instance step\n");
> > -      vtpmlogerror(VTPM_LOG_VTPM, "       params given %d\n", argc);
> > -      status= TPM_BAD_PARAMETER;
> > -      goto abort_egress;
> > -    }
> > -
> > -    server_addr = argv[1];
> > -    name = argv[2];
> > -    instance = atoi( argv[3] );
> > -    step = atoi( argv[4] );
> > -
> > -    switch (step) {
> > -    case VTPM_MORD_MIG_STEP2:
> > -      status = handle_vtpm_mig_step2(server_addr, name, instance);
> > -      break;
> > -
> > -    case VTPM_MORD_MIG_STEP3:
> > -      status = handle_vtpm_mig_step3(server_addr, name, instance);
> > -      break;
> > -
> > -    default:
> > -      status = TPM_BAD_PARAMETER;
> > -      goto abort_egress;
> > -      break;
> > -    }
> > -
> > -    goto egress;
> > - abort_egress:
> > - egress:
> > -
> > -    return status;
> > -}
> > -
> > diff --git a/tools/vtpm_manager/migration/vtpm_migratord.c b/tools/vtpm_manager/migration/vtpm_migratord.c
> > deleted file mode 100644
> > index ea18c8c..0000000
> > --- a/tools/vtpm_manager/migration/vtpm_migratord.c
> > +++ /dev/null
> > @@ -1,202 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -
> > -#include <stdio.h>
> > -#include <sys/types.h>
> > -#include <sys/socket.h>
> > -#include <netinet/in.h>
> > -#include <arpa/inet.h>
> > -#include <string.h>
> > -
> > -#include "tcg.h"
> > -#include "log.h"
> > -#include "bsg.h"
> > -#include "buffer.h"
> > -#include "vtpm_migrator.h"
> > -
> > -void build_error_msg( buffer_t *buf, TPM_RESULT status) {
> > -  TPM_TAG tag = VTPM_MTAG_RSP;
> > -  UINT32 out_param_size = VTPM_COMMAND_HEADER_SIZE;
> > -
> > -  buffer_init(buf, out_param_size, NULL);
> > -
> > -  BSG_PackList(buf->bytes, 3,
> > -                 BSG_TPM_TAG, &tag,
> > -                 BSG_TYPE_UINT32, &out_param_size,
> > -                 BSG_TPM_RESULT, &status );
> > -}
> > -
> > -int main() {
> > -
> > -    /* network variables */
> > -    int sock_descr, client_sock=-1, len;
> > -    struct sockaddr_in addr;
> > -    struct sockaddr_in client_addr;
> > -    unsigned int client_length;
> > -    int bytes;
> > -
> > -    /* variables for processing of command */
> > -    TPM_RESULT status = TPM_FAIL;
> > -    BYTE cmd_header[VTPM_COMMAND_HEADER_SIZE];
> > -    TPM_TAG tag;
> > -    TPM_COMMAND_CODE ord;
> > -    UINT32 in_param_size, adj_param_size;
> > -    int i, size_read, size_write;
> > -    buffer_t in_param_buf=NULL_BUF, result_buf=NULL_BUF;
> > -
> > -
> > -    /* setup socket */
> > -    sock_descr = socket(AF_INET, SOCK_STREAM, 0);
> > -
> > -    memset(&addr, 0, sizeof(addr));
> > -    addr.sin_family = AF_INET;
> > -    addr.sin_addr.s_addr = htonl(INADDR_ANY);
> > -    addr.sin_port = htons(VTPM_MIG_PORT);
> > -
> > -    if (bind(sock_descr, (struct sockaddr *)&addr, sizeof(addr)) == -1 ) {
> > -        vtpmlogerror(VTPM_LOG_VTPM, "Failed to bind to port %d.\n", VTPM_MIG_PORT);
> > -        return 1;
> > -    }
> > -
> > -    listen(sock_descr, 10);
> > -
> > -    for(;;) {
> > -        // ============ clear client info and wait for connection ==========
> > -        memset(&client_addr, 0, sizeof(client_addr));
> > -        client_length = sizeof(client_addr);
> > -
> > -        vtpmloginfo(VTPM_LOG_VTPM, "Waiting for incoming migrations...\n");
> > -        client_sock=accept(sock_descr, &client_addr, &client_length);
> > -        if (client_sock == -1) {
> > -            vtpmlogerror(VTPM_LOG_VTPM, "Incoming connectionn failed.\n");
> > -            goto abort_command;
> > -        } else {
> > -            vtpmloginfo(VTPM_LOG_VTPM, "Incoming connection accepted.\n");
> > -        }
> > -
> > -        // =================== Read incoming command ======================
> > -        size_read = read( client_sock, cmd_header, VTPM_COMMAND_HEADER_SIZE);
> > -        if (size_read > 0) {
> > -            vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV: 0x");
> > -            for (i=0; i<size_read; i++)
> > -                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> > -
> > -        } else {
> > -            vtpmlogerror(VTPM_LOG_VTPM, "Error reading from socket.\n");
> > -            build_error_msg(&result_buf, TPM_IOERROR);
> > -            goto abort_command_with_error;
> > -        }
> > -
> > -        if (size_read < (int) VTPM_COMMAND_HEADER_SIZE) {
> > -            vtpmlogerror(VTPM_LOG_VTPM, "Command from socket shorter than std header.\n");
> > -            build_error_msg(&result_buf, TPM_BAD_PARAMETER);
> > -            goto abort_command_with_error;
> > -        }
> > -
> > -        // Unpack response from client
> > -        BSG_UnpackList(cmd_header, 3,
> > -                       BSG_TPM_TAG, &tag,
> > -                       BSG_TYPE_UINT32, &in_param_size,
> > -                       BSG_TPM_COMMAND_CODE, &ord );
> > -
> > -
> > -        // If response has parameters, read them.
> > -        // Note that out_param_size is in the client's context
> > -        adj_param_size = in_param_size - VTPM_COMMAND_HEADER_SIZE;
> > -        if (adj_param_size > 0) {
> > -            buffer_init( &in_param_buf, adj_param_size, NULL);
> > -            size_read = read(client_sock, in_param_buf.bytes, adj_param_size);
> > -            if (size_read > 0) {
> > -                for (i=0; i< size_read; i++)
> > -                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param_buf.bytes[i]);
> > -
> > -            } else {
> > -                vtpmlogerror(VTPM_LOG_VTPM, "Error reading from socket.\n");
> > -                build_error_msg(&result_buf, TPM_IOERROR);
> > -                goto abort_command_with_error;
> > -            }
> > -            vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> > -
> > -            if (size_read < (int)adj_param_size) {
> > -                vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> > -                vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
> > -                build_error_msg(&result_buf, TPM_BAD_PARAMETER);
> > -                goto abort_command_with_error;
> > -            }
> > -        } else {
> > -            vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> > -        }
> > -
> > -        /* Handle Command */
> > -        switch (ord) {
> > -        case VTPM_MORD_MIG_STEP2:
> > -          handle_vtpm_mig_step2(&in_param_buf, &result_buf);
> > -          break;
> > -
> > -        case VTPM_MORD_MIG_STEP3:
> > -          handle_vtpm_mig_step3(&in_param_buf, &result_buf);
> > -          break;
> > -
> > -        default:
> > -            build_error_msg(&result_buf, TPM_BAD_PARAMETER);
> > -            goto abort_command_with_error;
> > -        }
> > -
> > -  abort_command_with_error:
> > -        /* Write Response */
> > -        size_write = write(client_sock, result_buf.bytes, buffer_len(&result_buf));
> > -
> > -        if (size_write > 0) {
> > -            vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT: 0x");
> > -            for (i=0; i< buffer_len(&result_buf); i++) {
> > -                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_buf.bytes[i]);
> > -            }
> > -            vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -        } else {
> > -            vtpmlogerror(VTPM_LOG_VTPM, "Error writing response to client.\n");
> > -            goto abort_command;
> > -        }
> > -
> > -        if (size_write != (int) buffer_len(&result_buf) )
> > -           vtpmlogerror(VTPM_LOG_VTPM, "Could not send entire response to client(%d/%d)\n", size_write, buffer_len(&result_buf));
> > -
> > -  abort_command:
> > -        close(client_sock);
> > -        buffer_free(&in_param_buf);
> > -        buffer_free(&result_buf);
> > -
> > -    } // For (;;)
> > -
> > -    return 0;
> > -}
> > -
> > diff --git a/tools/vtpm_manager/migration/vtpm_migratord_handler.c b/tools/vtpm_manager/migration/vtpm_migratord_handler.c
> > deleted file mode 100644
> > index 0a8a2d5..0000000
> > --- a/tools/vtpm_manager/migration/vtpm_migratord_handler.c
> > +++ /dev/null
> > @@ -1,177 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -
> > -#include <stdlib.h>
> > -#include <string.h>
> > -
> > -#include "tcg.h"
> > -#include "bsg.h"
> > -#include "log.h"
> > -#include "vtpm_migrator.h"
> > -#include "vtpm_manager.h"
> > -
> > -#define VTPM_SH_CMD_HDR  "bash -c \"cd /etc/xen/scripts; source /etc/xen/scripts/vtpm-common.sh;"
> > -#define VTPM_SH_CMD_FTR  "\""
> > -#define VTPM_SH_GETINST  "vtpmdb_get_free_instancenum"
> > -#define VTPM_SH_ADD      "vtpm_add_and_activate"
> > -#define VTPM_SH_RESUME   "vtpm_resume"
> > -
> > -// This must be updated to the longest command name. Currently GETINST
> > -#define VTPM_SH_CMD_SIZE (strlen(VTPM_SH_CMD_HDR) + strlen(VTPM_SH_CMD_FTR) + 1 + strlen(VTPM_SH_GETINST) + 2)
> > -
> > -void handle_vtpm_mig_step2(buffer_t *in_param_buf, buffer_t *result_buf)
> > -{
> > -  TPM_TAG tag = VTPM_TAG_RSP;
> > -  buffer_t out_param_buf= NULL_BUF, mig_key_buf=NULL_BUF;
> > -  TPM_RESULT status=TPM_SUCCESS, cmd_status;
> > -  UINT32 out_param_size;
> > -
> > -  if ( (!in_param_buf) || (!result_buf) ) {
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  // ================= Call manager and get mig key ===============
> > -  TPMTRYRETURN( vtpm_manager_open() );
> > -  TPMTRYRETURN( vtpm_manager_command(VTPM_ORD_GET_MIG_KEY,
> > -                                     &out_param_buf, // Empty
> > -                                     &cmd_status,
> > -                                     &mig_key_buf) );
> > -
> > -  vtpm_manager_close();
> > -
> > -  TPMTRYRETURN(cmd_status);
> > -
> > -  // ==================== return the  mig key =====================
> > -  out_param_size =  VTPM_COMMAND_HEADER_SIZE + buffer_len(&mig_key_buf);
> > -
> > -  TPMTRYRETURN( buffer_init(result_buf,
> > -                            out_param_size,
> > -                            NULL) );
> > -
> > -  BSG_PackList( result_buf->bytes, 3,
> > -                  BSG_TPM_TAG, &tag,
> > -                  BSG_TYPE_UINT32, &out_param_size,
> > -                  BSG_TPM_RESULT, &status);
> > -
> > -  memcpy(result_buf->bytes + VTPM_COMMAND_HEADER_SIZE,
> > -         mig_key_buf.bytes, buffer_len(&mig_key_buf));
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -  buffer_free(result_buf);
> > -  build_error_msg(result_buf, status);
> > -
> > - egress:
> > -  return;
> > -}
> > -
> > -void handle_vtpm_mig_step3(buffer_t *in_param_buf, buffer_t *result_buf)
> > -{
> > -  TPM_TAG tag = VTPM_TAG_RSP;
> > -  buffer_t out_param_buf= NULL_BUF, mig_key_buf=NULL_BUF, empty_buf=NULL_BUF;
> > -  TPM_RESULT status=TPM_SUCCESS, cmd_status;
> > -  UINT32 out_param_size, instance;
> > -  char *shell_cmd_str=NULL;
> > -  size_t shell_cmd_strlen;
> > -  FILE *shell_f=NULL;
> > -
> > -  if ( (!in_param_buf) || (!result_buf) ) {
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  // ================= Read Parameters ===============
> > -  struct pack_buf_t name_data32, state_data32;
> > -
> > -  BSG_UnpackList(in_param_buf->bytes, 2,
> > -                 BSG_TPM_SIZE32_DATA, &name_data32,
> > -                 BSG_TPM_SIZE32_DATA, &state_data32);
> > -
> > -  // Before using this string, protect us from a non-null term array.
> > -  if (name_data32.data[name_data32.size -1] != 0x00) {
> > -    name_data32.data[name_data32.size -1] = 0x00;
> > -  }
> > -
> > -  // ====== Call hotplug-script and get an instance ======
> > -  shell_cmd_strlen = VTPM_SH_CMD_SIZE + name_data32.size + 10;
> > -  shell_cmd_str = (char *) malloc(shell_cmd_strlen); // 10 is just padding for the UINT32
> > -
> > -  snprintf(shell_cmd_str, shell_cmd_strlen,
> > -       VTPM_SH_CMD_HDR VTPM_SH_GETINST VTPM_SH_CMD_FTR);
> > -
> > -  shell_f = popen(shell_cmd_str, "r");
> > -  fscanf(shell_f, "%d", &instance);
> > -  pclose(shell_f);
> > -
> > -  // ====== Call hotplug-script and add instance ======
> > -  snprintf(shell_cmd_str, shell_cmd_strlen,
> > -       VTPM_SH_CMD_HDR VTPM_SH_ADD " %s %d" VTPM_SH_CMD_FTR,
> > -       name_data32.data, instance);
> > -  system(shell_cmd_str);
> > -
> > -  // ========= Call vtpm_manager and load VTPM =======
> > -  TPMTRYRETURN( buffer_init( &out_param_buf,
> > -                             2*sizeof(UINT32) + state_data32.size,
> > -                             NULL) );
> > -
> > -  BSG_PackList(out_param_buf.bytes, 2,
> > -                 BSG_TYPE_UINT32, &instance,
> > -                 BSG_TPM_SIZE32_DATA, &state_data32);
> > -
> > -  TPMTRYRETURN( vtpm_manager_open() );
> > -  TPMTRYRETURN( vtpm_manager_command(VTPM_ORD_MIGRATE_IN,
> > -                                     &out_param_buf,
> > -                                     &cmd_status,
> > -                                     &empty_buf) );
> > -
> > -  vtpm_manager_close();
> > -
> > -  TPMTRYRETURN(cmd_status);
> > -
> > -  // ====== Call hotplug-script and resume instance ======
> > -  snprintf(shell_cmd_str, shell_cmd_strlen,
> > -       VTPM_SH_CMD_HDR VTPM_SH_RESUME " %d" VTPM_SH_CMD_FTR, instance);
> > -  system(shell_cmd_str);
> > -
> > -  goto egress;
> > - abort_egress:
> > - egress:
> > -  free(shell_cmd_str);
> > -
> > -  // In this case no params come back, so reuse build_error_msg even for succes.
> > -  build_error_msg(result_buf, status);
> > -  return;
> > -}
> > -
> > diff --git a/tools/vtpm_manager/tcs/Makefile b/tools/vtpm_manager/tcs/Makefile
> > deleted file mode 100644
> > index 11af91e..0000000
> > --- a/tools/vtpm_manager/tcs/Makefile
> > +++ /dev/null
> > @@ -1,24 +0,0 @@
> > -XEN_ROOT = $(CURDIR)/../../..
> > -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> > -
> > -BIN            = libTCS.a
> > -
> > -.PHONY: all
> > -all: build
> > -
> > -.PHONY: build
> > -build: $(BIN)
> > -
> > -.PHONY: install
> > -install: build
> > -
> > -.PHONY: clean
> > -clean:
> > -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> > -
> > -.PHONY: mrproper
> > -mrproper: clean
> > -       rm -f *~
> > -
> > -$(BIN): $(OBJS)
> > -       $(AR) rcs $(BIN) $(OBJS)
> > diff --git a/tools/vtpm_manager/tcs/contextmgr.c b/tools/vtpm_manager/tcs/contextmgr.c
> > deleted file mode 100644
> > index cf3803c..0000000
> > --- a/tools/vtpm_manager/tcs/contextmgr.c
> > +++ /dev/null
> > @@ -1,224 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// contextmgr.c
> > -//
> > -//  This file contains the context management functions for TCS.
> > -//
> > -// ==================================================================
> > -
> > -#include <stdio.h>
> > -#include <string.h>
> > -#include <malloc.h>
> > -#include "tcs.h"
> > -#include "contextmgr.h"
> > -#include "log.h"
> > -#include "hashtable.h"
> > -
> > -BYTE* AddMemBlock(CONTEXT_HANDLE* pContextHandle, // in
> > -                 int    BlockSize)  { // in
> > -
> > -  BLOCK* pCurrentBlock = NULL;
> > -  BLOCK* pBlock = NULL;
> > -
> > -  // check incoming params
> > -  if (pContextHandle == NULL || BlockSize == 0)
> > -    return NULL;
> > -
> > -  // Create New Block
> > -  pBlock = (BLOCK *)malloc(sizeof(BLOCK));
> > -  if (pBlock == NULL)
> > -    return (0);
> > -
> > -  pBlock->aMemory = (BYTE *)malloc(sizeof(BYTE) * BlockSize);
> > -  if (pBlock->aMemory == NULL)
> > -    return (0);
> > -
> > -  memset(pBlock->aMemory, 0, BlockSize);
> > -  pBlock->nBlockSize = BlockSize;
> > -  pBlock->pNextBlock = NULL;
> > -
> > -  // search for the last block created where to add the
> > -  // newly created block
> > -  if(pContextHandle->pTopBlock != NULL) {
> > -    pCurrentBlock = pContextHandle->pTopBlock;
> > -    while(pCurrentBlock->pNextBlock != NULL)
> > -      pCurrentBlock = pCurrentBlock->pNextBlock;
> > -
> > -
> > -    pCurrentBlock->pNextBlock= pBlock;
> > -  } else
> > -    pContextHandle->pTopBlock = pBlock;
> > -
> > -
> > -  pContextHandle->nBlockCount++;
> > -
> > -  return pBlock->aMemory;
> > -}
> > -
> > -
> > -BOOL DeleteMemBlock(CONTEXT_HANDLE* pContextHandle, // in
> > -                    BYTE*   pTCPA_BYTEs) { // in
> > -  BLOCK* pCurrentBlock = NULL;
> > -  BLOCK* pParentBlock = NULL;
> > -  BOOL bFound = FALSE;
> > -
> > -  if (pContextHandle == NULL)
> > -    return FALSE;
> > -
> > -
> > -  // Search for the Block in the context by aMemory pointer
> > -  pParentBlock = NULL;
> > -  pCurrentBlock = pContextHandle->pTopBlock;
> > -
> > -  while(pCurrentBlock != NULL) {
> > -    // If aMemory block is found, delete it
> > -    if(pCurrentBlock->aMemory == pTCPA_BYTEs || pTCPA_BYTEs == NULL) {
> > -      // if it is the top Block, remove it from the top,
> > -      // otherwise remove it from the ParentBlock and stitch
> > -      // the NextBlock to the ParentBlock
> > -      if(pParentBlock == NULL)
> > -       pContextHandle->pTopBlock = pContextHandle->pTopBlock->pNextBlock;
> > -      else
> > -       pParentBlock->pNextBlock = pCurrentBlock->pNextBlock;
> > -
> > -      // delete memory Block associated with pointer pTCPA_BYTEs
> > -      free(pCurrentBlock->aMemory);
> > -      pCurrentBlock->aMemory = NULL;
> > -
> > -      free(pCurrentBlock);
> > -      pCurrentBlock = pParentBlock;
> > -
> > -      pContextHandle->nBlockCount--;
> > -      bFound = TRUE;
> > -    }
> > -
> > -    if(pCurrentBlock != NULL) {
> > -      pParentBlock = pCurrentBlock;
> > -      pCurrentBlock = pCurrentBlock->pNextBlock;
> > -    }
> > -  }
> > -
> > -  return bFound;
> > -}
> > -
> > -BOOL AddHandleToList(TCS_CONTEXT_HANDLE hContext, // in
> > -                    TPM_RESOURCE_TYPE type, // in
> > -                    TPM_HANDLE    handle)  { // in
> > -  HANDLE_LIST* pNewHandle = NULL;
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Adding Handle to list\n");
> > -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> > -
> > -  if (pContextHandle == NULL)
> > -    return 0;
> > -
> > -  pNewHandle = (HANDLE_LIST *)malloc(sizeof(HANDLE_LIST));
> > -
> > -  if (pNewHandle == NULL)
> > -    return (0);
> > -
> > -  pNewHandle->handle = handle;
> > -  pNewHandle->type = type;
> > -  pNewHandle->pNextHandle = pContextHandle->pHandleList;
> > -
> > -  pContextHandle->pHandleList = pNewHandle;
> > -
> > -  return 1;
> > -}
> > -
> > -BOOL DeleteHandleFromList(   TCS_CONTEXT_HANDLE hContext, // in
> > -                             TPM_HANDLE          handle) { // in
> > -
> > -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> > -
> > -  HANDLE_LIST *pCurrentHandle = pContextHandle->pHandleList,
> > -              *pLastHandle = pCurrentHandle;
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Deleting Handle from list\n");
> > -
> > -  if (pContextHandle == NULL)
> > -    return 0;
> > -
> > -  while (1) {
> > -
> > -    if (pCurrentHandle->handle == handle) { // Found element
> > -      if (pCurrentHandle == pLastHandle) { // First element in list
> > -       pContextHandle->pHandleList = pCurrentHandle->pNextHandle;
> > -       free(pCurrentHandle);
> > -      } else { // Ordinary element
> > -       pLastHandle->pNextHandle = pCurrentHandle->pNextHandle;
> > -       free(pCurrentHandle);
> > -      }
> > -
> > -      return 1;
> > -
> > -    } else { // Not found yet;
> > -      pLastHandle = pCurrentHandle;
> > -      pCurrentHandle = pCurrentHandle->pNextHandle;
> > -      if (pCurrentHandle == NULL) // Found end of list
> > -       return 0;
> > -    }
> > -
> > -  }
> > -}
> > -
> > -BOOL FreeHandleList(    CONTEXT_HANDLE*     pContextHandle) { // in
> > -  HANDLE_LIST* pCurrentHandle;
> > -  BOOL returncode = TRUE;
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Freeing all handles for context\n");
> > -
> > -  if (pContextHandle == NULL)
> > -    return 1;
> > -
> > -  pCurrentHandle = pContextHandle->pHandleList;
> > -  while (pCurrentHandle != NULL) {
> > -
> > -    switch (pCurrentHandle->type) {
> > -    case TPM_RT_KEY:
> > -      returncode = returncode && !TCSP_EvictKey(pContextHandle->handle, pCurrentHandle->handle);
> > -      break;
> > -    case TPM_RT_AUTH:
> > -      returncode = returncode && !TCSP_TerminateHandle(pContextHandle->handle, pCurrentHandle->handle);
> > -      break;
> > -    default:
> > -      returncode = FALSE;
> > -    }
> > -
> > -    pCurrentHandle = pCurrentHandle->pNextHandle;
> > -
> > -  }
> > -
> > -  return 1;
> > -}
> > diff --git a/tools/vtpm_manager/tcs/contextmgr.h b/tools/vtpm_manager/tcs/contextmgr.h
> > deleted file mode 100644
> > index e3fdf0f..0000000
> > --- a/tools/vtpm_manager/tcs/contextmgr.h
> > +++ /dev/null
> > @@ -1,82 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// contextmgr.c
> > -//
> > -//  This file contains the context management functions for TCS.
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __CONTEXTMGR_H__
> > -#define __CONTEXTMGR_H__
> > -
> > -#include "tcg.h"
> > -
> > -#define BLOCK_SIZE 300
> > -
> > -typedef struct block {
> > -  int nBlockSize;
> > -  BYTE* aMemory;
> > -  struct block* pNextBlock;
> > -} BLOCK;
> > -
> > -typedef struct handle_List {
> > -  TPM_HANDLE handle;
> > -  TPM_RESOURCE_TYPE type;
> > -  struct handle_List* pNextHandle;
> > -} HANDLE_LIST;
> > -
> > -typedef struct context_handle {
> > -  TCS_CONTEXT_HANDLE handle;
> > -  int nBlockCount;
> > -  BLOCK* pTopBlock;
> > -  HANDLE_LIST* pHandleList;
> > -} CONTEXT_HANDLE;
> > -
> > -BYTE* AddMemBlock(  CONTEXT_HANDLE*     pContextHandle, // in
> > -                    int                 BlockSize);  // in
> > -
> > -BOOL DeleteMemBlock(CONTEXT_HANDLE* pContextHandle, // in
> > -                    BYTE*           pTCPA_BYTEs); // in
> > -
> > -
> > -BOOL AddHandleToList(   TCS_CONTEXT_HANDLE hContext, // in
> > -                        TPM_RESOURCE_TYPE   type, // in
> > -                        TPM_HANDLE          handle); // in
> > -
> > -BOOL DeleteHandleFromList(   TCS_CONTEXT_HANDLE hContext, // in
> > -                             TPM_HANDLE          handle); // in
> > -
> > -BOOL FreeHandleList(    CONTEXT_HANDLE*     pContextHandle); // in
> > -
> > -#endif //_CONTEXTMGR_H_
> > diff --git a/tools/vtpm_manager/tcs/tcs.c b/tools/vtpm_manager/tcs/tcs.c
> > deleted file mode 100644
> > index 7c1378c..0000000
> > --- a/tools/vtpm_manager/tcs/tcs.c
> > +++ /dev/null
> > @@ -1,1192 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// tcs.c
> > -//
> > -//  This file contains the functions that implement a TCS.
> > -//
> > -// ==================================================================
> > -
> > -#include <stdio.h>
> > -#include <string.h>
> > -#include <malloc.h>
> > -
> > -#include "tcg.h"
> > -#include "bsg.h"
> > -#include "tcs.h"
> > -#include "contextmgr.h"
> > -#include "tpmddl.h"
> > -#include "log.h"
> > -#include "hashtable.h"
> > -#include "hashtable_itr.h"
> > -
> > -// Static Global Vars for the TCS
> > -static int TCS_m_nCount = 0;
> > -
> > -#define TCPA_MAX_BUFFER_LENGTH 0x2000
> > -
> > -static BYTE InBuf [TCPA_MAX_BUFFER_LENGTH];
> > -static BYTE OutBuf[TCPA_MAX_BUFFER_LENGTH];
> > -
> > -struct hashtable *context_ht;
> > -
> > -// -------------------------- Hash table functions --------------------
> > -
> > -static unsigned int hashfunc32(void *ky) {
> > -  return (* (UINT32 *) ky);
> > -}
> > -
> > -static int equals32(void *k1, void *k2) {
> > -  return (*(UINT32 *) k1 == *(UINT32 *) k2);
> > -}
> > -
> > -CONTEXT_HANDLE *LookupContext( TCS_CONTEXT_HANDLE  hContext) {
> > -  return( (CONTEXT_HANDLE *) hashtable_search(context_ht, &hContext) );
> > -}
> > -
> > -// ---------------------------------------------------------------------------------
> > -// Initialization/Uninitialization SubComponent API
> > -// ---------------------------------------------------------------------------------
> > -TPM_RESULT TCS_create() {
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TPM_RESULT result = TPM_FAIL;
> > -
> > -  if (TCS_m_nCount == 0) {
> > -    vtpmloginfo(VTPM_LOG_TCS, "Constructing new TCS:\n");
> > -    hRes = TDDL_Open();
> > -
> > -    context_ht = create_hashtable(10, hashfunc32, equals32);
> > -
> > -    if ((hRes == TDDL_SUCCESS) && (context_ht != NULL)) {
> > -      result = TPM_SUCCESS;
> > -      TCS_m_nCount++;
> > -    } else {
> > -      result = TPM_IOERROR;
> > -      hashtable_destroy(context_ht, 1);
> > -    }
> > -  } else
> > -    TCS_m_nCount++;
> > -
> > -  return(result);
> > -}
> > -
> > -
> > -void TCS_destroy()
> > -{
> > -  TCS_m_nCount--;
> > -
> > -  if (TCS_m_nCount == 0) {
> > -    vtpmloginfo(VTPM_LOG_TCS, "Destructing TCS:\n");
> > -    TDDL_Close();
> > -
> > -    struct hashtable_itr *context_itr;
> > -    TCS_CONTEXT_HANDLE  *hContext;
> > -
> > -    // Close all the TCS contexts. TCS should evict keys based on this
> > -    if (hashtable_count(context_ht) > 0) {
> > -      context_itr = hashtable_iterator(context_ht);
> > -      do {
> > -        hContext = (TCS_CONTEXT_HANDLE *) hashtable_iterator_key(context_itr);
> > -       if (TCS_CloseContext(*hContext) != TPM_SUCCESS)
> > -           vtpmlogerror(VTPM_LOG_TCS, "Failed to close context %d properly.\n", *hContext);
> > -
> > -      } while (hashtable_iterator_advance(context_itr));
> > -      free(context_itr);
> > -    }
> > -    hashtable_destroy(context_ht, 1);
> > -  }
> > -
> > -}
> > -
> > -TPM_RESULT TCS_Malloc(  TCS_CONTEXT_HANDLE  hContext, // in
> > -                        UINT32              MemSize, // in
> > -                        BYTE**              ppMemPtr) {// out
> > -
> > -  TPM_RESULT returnCode = TPM_FAIL;
> > -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> > -
> > -  if (pContextHandle != NULL && ppMemPtr != NULL) {
> > -    *ppMemPtr = (BYTE *)AddMemBlock(pContextHandle, MemSize);
> > -    returnCode = TPM_SUCCESS;
> > -  }
> > -
> > -  return returnCode;
> > -}
> > -
> > -TPM_RESULT TCS_FreeMemory(  TCS_CONTEXT_HANDLE  hContext, // in
> > -                            BYTE*               pMemory) { // in
> > -  TPM_RESULT returnCode = TPM_FAIL;
> > -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> > -
> > -  if ( (pContextHandle != NULL && pMemory != NULL) &&
> > -       (DeleteMemBlock(pContextHandle, pMemory) == TRUE) )
> > -    returnCode = TPM_SUCCESS;
> > -
> > -
> > -  return returnCode;
> > -}
> > -
> > -TPM_RESULT TCS_OpenContext(TCS_CONTEXT_HANDLE* hContext) { // out
> > -  TPM_RESULT returnCode = TPM_FAIL;
> > -  TCS_CONTEXT_HANDLE *newContext;
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS, "Calling TCS_OpenContext:\n");
> > -
> > -  if (hContext) {
> > -    CONTEXT_HANDLE* pContextHandle = (CONTEXT_HANDLE *) malloc(sizeof(CONTEXT_HANDLE));
> > -    if (pContextHandle == NULL)
> > -      return TPM_SIZE;
> > -
> > -    // initialize to 0
> > -    pContextHandle->nBlockCount = 0;
> > -    pContextHandle->pTopBlock = NULL;
> > -    pContextHandle->pHandleList = NULL;
> > -
> > -    // Create New Block
> > -    AddMemBlock(pContextHandle, BLOCK_SIZE);
> > -
> > -    newContext = (TCS_CONTEXT_HANDLE *) malloc(sizeof(TCS_CONTEXT_HANDLE));
> > -    *newContext = (TCS_CONTEXT_HANDLE) (((uintptr_t) pContextHandle >> 2) & 0xffffffff);
> > -
> > -    if (hashtable_search(context_ht, &newContext) !=NULL)
> > -       *newContext += 1;
> > -
> > -    pContextHandle->handle = *newContext;
> > -    if (!hashtable_insert(context_ht, newContext, pContextHandle)) {
> > -        free(newContext);
> > -        free(pContextHandle);
> > -       returnCode = TPM_FAIL;
> > -    } else {
> > -       *hContext = *newContext;
> > -       returnCode = TPM_SUCCESS;
> > -    }
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCS_CloseContext(TCS_CONTEXT_HANDLE hContext) {// in
> > -  //FIXME: TCS SHOULD Track failed auths and make sure
> > -  //we don't try and re-free them here.
> > -  TPM_RESULT returnCode = TPM_FAIL;
> > -
> > -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> > -
> > -  if(pContextHandle != NULL) {
> > -    // Print test info
> > -    vtpmloginfo(VTPM_LOG_TCS, "Calling TCS_CloseContext.\n");
> > -
> > -    // free memory for all the blocks
> > -    DeleteMemBlock(pContextHandle, NULL );
> > -    pContextHandle->pTopBlock = NULL;
> > -
> > -    FreeHandleList(pContextHandle);
> > -    if (pContextHandle->pHandleList != NULL)
> > -      vtpmlogerror(VTPM_LOG_TCS, "Not all handles evicted from TPM.\n");
> > -
> > -    // Release the TPM's resources
> > -    if (hashtable_remove(context_ht, &hContext) == NULL)
> > -      vtpmlogerror(VTPM_LOG_TCS, "Not all handles evicted from TPM.\n");
> > -
> > -    free(pContextHandle);
> > -    returnCode = TPM_SUCCESS;
> > -  }
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Finished closing context\n");
> > -  return(returnCode);
> > -}
> > -
> > -// ------------------------------------------------------------------
> > -// Internal Functions
> > -// ------------------------------------------------------------------
> > -int packAuth(BYTE* dst, TCS_AUTH* auth) {
> > -  // CHECK: according to the command specs, the outgoing auth params are:
> > -  // nonceEven
> > -  // nonceOdd
> > -  // continueAuthSession
> > -  // auth digest for return params
> > -  //
> > -  // this is a bit different than this code...
> > -
> > -  return BSG_PackList(dst, 4,
> > -                     BSG_TYPE_UINT32, &(auth->AuthHandle),
> > -                     BSG_TPM_NONCE, &(auth->NonceOdd),
> > -                     BSG_TYPE_BOOL, &(auth->fContinueAuthSession),
> > -                     BSG_TPM_AUTHDATA, &(auth->HMAC));
> > -}
> > -
> > -int unpackAuth(TCS_AUTH* auth, BYTE* src) {
> > -  return BSG_UnpackList(src, 3,
> > -                       BSG_TPM_NONCE, &(auth->NonceEven),
> > -                       BSG_TYPE_BOOL, &(auth->fContinueAuthSession),
> > -                       BSG_TPM_AUTHDATA, &(auth->HMAC));
> > -}
> > -
> > -// ------------------------------------------------------------------
> > -// Authorization Commands
> > -// ------------------------------------------------------------------
> > -
> > -TPM_RESULT TCSP_OIAP(TCS_CONTEXT_HANDLE hContext, // in
> > -                    TCS_AUTHHANDLE*  authHandle, // out
> > -                    TPM_NONCE*   nonce0)  // out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_OIAP;
> > -  UINT32 paramSize = 0;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (authHandle == NULL || nonce0 == NULL)
> > -    return TPM_BAD_PARAMETER;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 3,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal);
> > -
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> > -      == TDDL_SUCCESS) {
> > -
> > -    // unpack to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList( OutBuf, 3,
> > -                           BSG_TPM_TAG, &tag,
> > -                           BSG_TYPE_UINT32, &paramSize,
> > -                           BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      BSG_UnpackList(OutBuf+i, 2,
> > -                    BSG_TYPE_UINT32, authHandle,
> > -                    BSG_TPM_NONCE, nonce0);
> > -
> > -      if (!AddHandleToList(hContext, TPM_RT_AUTH, *authHandle))
> > -        vtpmlogerror(VTPM_LOG_TCS, "New AuthHandle not recorded\n");
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCSP_OSAP(TCS_CONTEXT_HANDLE hContext,  // in
> > -                    TPM_ENTITY_TYPE  entityType,  // in
> > -                    UINT32    entityValue, // in
> > -                    TPM_NONCE   nonceOddOSAP, // in
> > -                    TCS_AUTHHANDLE*  authHandle,  // out
> > -                    TPM_NONCE*   nonceEven,  // out
> > -                    TPM_NONCE*   nonceEvenOSAP) // out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_OSAP;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (authHandle == NULL || nonceEven == NULL || nonceEvenOSAP == NULL)
> > -    return TPM_BAD_PARAMETER;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 6,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT16, &entityType,
> > -                         BSG_TYPE_UINT32, &entityValue,
> > -                         BSG_TPM_NONCE, &nonceOddOSAP);
> > -
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> > -            == TDDL_SUCCESS) {
> > -
> > -    // unpack to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      BSG_UnpackList(OutBuf+i, 3,
> > -                    BSG_TYPE_UINT32, authHandle,
> > -                    BSG_TPM_NONCE, nonceEven,
> > -                    BSG_TPM_NONCE, nonceEvenOSAP);
> > -
> > -      if (!AddHandleToList(hContext, TPM_RT_AUTH, *authHandle)) {
> > -           vtpmlogerror(VTPM_LOG_TCS, "New AuthHandle not recorded\n");
> > -      }
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCSP_TakeOwnership(TCS_CONTEXT_HANDLE hContext,   // in
> > -                             UINT16    protocolID,   // in
> > -                             UINT32    encOwnerAuthSize, // in
> > -                             BYTE*    encOwnerAuth,  // in
> > -                             UINT32    encSrkAuthSize,  // in
> > -                             BYTE*    encSrkAuth,   // in
> > -                             UINT32*    SrkSize,   // in, out
> > -                             BYTE**    Srk,    // in, out
> > -                             TCS_AUTH*   ownerAuth)   // in, out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_TakeOwnership;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (encOwnerAuth == NULL || encSrkAuth == NULL || SrkSize == NULL || *Srk == NULL)
> > -    return TPM_BAD_PARAMETER;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 5,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT16, &protocolID,
> > -                         BSG_TYPE_UINT32, &encOwnerAuthSize);
> > -
> > -  memcpy(InBuf+InLength, encOwnerAuth, encOwnerAuthSize);
> > -  InLength += encOwnerAuthSize;
> > -  InLength += BSG_Pack(   BSG_TYPE_UINT32,
> > -                         &encSrkAuthSize,
> > -                         InBuf+InLength);
> > -  memcpy(InBuf+InLength, encSrkAuth, encSrkAuthSize);
> > -  InLength += encSrkAuthSize;
> > -  memcpy(InBuf+InLength, *Srk, *SrkSize);
> > -  InLength += *SrkSize;
> > -  InLength += packAuth(InBuf+InLength, ownerAuth);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32,
> > -          &InLength,
> > -          InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> > -              == TDDL_SUCCESS){
> > -
> > -    // unpack to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList( OutBuf, 3,
> > -                           BSG_TPM_TAG, &tag,
> > -                           BSG_TYPE_UINT32, &paramSize,
> > -                           BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      TPM_KEY srkPub;
> > -      i += BSG_Unpack(BSG_TPM_KEY,  OutBuf+i,  &srkPub);
> > -      unpackAuth(ownerAuth, OutBuf+i);
> > -
> > -      // fill output params
> > -      BYTE tempBuf[1024];
> > -      *SrkSize = BSG_Pack(BSG_TPM_KEY,  &srkPub, tempBuf);
> > -      if (TCS_Malloc(hContext, *SrkSize, Srk) == TPM_FAIL) {
> > -       return(TPM_SIZE);
> > -      }
> > -      memcpy(*Srk, tempBuf, *SrkSize);
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d", paramSize);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_TakeOwnership Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -
> > -TPM_RESULT TCSP_DisablePubekRead (  TCS_CONTEXT_HANDLE hContext, // in
> > -                                    TCS_AUTH*   ownerAuth) { // in, out
> > -
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_DisablePubekRead;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 3,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal);
> > -
> > -  InLength += packAuth(InBuf+InLength, ownerAuth);
> > -
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> > -              == TDDL_SUCCESS){
> > -
> > -    // unpack to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList( OutBuf, 3,
> > -                           BSG_TPM_TAG, &tag,
> > -                           BSG_TYPE_UINT32, &paramSize,
> > -                           BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      unpackAuth(ownerAuth, OutBuf+i);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_DisablePubekRead Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -
> > -TPM_RESULT TCSP_TerminateHandle(TCS_CONTEXT_HANDLE hContext, // in
> > -                                TCS_AUTHHANDLE  handle)  // in
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_Terminate_Handle;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 4,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT32, &handle);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> > -              == TDDL_SUCCESS) {
> > -
> > -    // unpack to get the tag, paramSize, & returnCode
> > -    BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (!DeleteHandleFromList(hContext, handle))
> > -      vtpmlogerror(VTPM_LOG_TCS, "KeyHandle not removed from list\n");
> > -
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> > -      // Print debug info
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d", paramSize);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_TerminateHandle Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -// TPM Mandatory
> > -TPM_RESULT TCSP_Extend( TCS_CONTEXT_HANDLE hContext, // in
> > -                        TPM_PCRINDEX  pcrNum,  // in
> > -                        TPM_DIGEST  inDigest, // in
> > -                        TPM_PCRVALUE*  outDigest) // out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_Extend;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 5,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT32, &pcrNum,
> > -                         BSG_TPM_DIGEST, &inDigest);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> > -              == TDDL_SUCCESS) {
> > -
> > -    // unpack to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND){
> > -      // Extract the remaining output parameters
> > -      BSG_Unpack(BSG_TPM_PCRVALUE, OutBuf+i, outDigest);
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Extend Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCSP_Seal(   TCS_CONTEXT_HANDLE hContext,  // in
> > -                        TCS_KEY_HANDLE  keyHandle,  // in
> > -                        TPM_ENCAUTH   encAuth,  // in
> > -                        UINT32    pcrInfoSize, // in
> > -                        BYTE*    PcrInfo,  // in
> > -                        UINT32    inDataSize,  // in
> > -                        BYTE*    inData,   // in
> > -                        TCS_AUTH*   pubAuth,  // in, out
> > -                        UINT32*    SealedDataSize, // out
> > -                        BYTE**    SealedData)  // out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_Seal;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (inData == NULL || pubAuth == NULL || SealedDataSize == NULL || SealedData == NULL)
> > -    return TPM_BAD_PARAMETER;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 6,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT32, &keyHandle,
> > -                         BSG_TPM_ENCAUTH, encAuth,
> > -                         BSG_TYPE_UINT32, &pcrInfoSize);
> > -  memcpy(InBuf+InLength, PcrInfo, pcrInfoSize);
> > -  InLength += pcrInfoSize;
> > -  InLength += BSG_Pack(BSG_TYPE_UINT32, &inDataSize, InBuf+InLength);
> > -  memcpy(InBuf+InLength, inData, inDataSize);
> > -  InLength += inDataSize;
> > -  InLength += packAuth(InBuf+InLength, pubAuth);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> > -              == TDDL_SUCCESS) {
> > -    // unpack OutBuf to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      TPM_STORED_DATA sealedData;
> > -
> > -      i += BSG_Unpack(BSG_TPM_STORED_DATA, OutBuf+i, &sealedData);
> > -      unpackAuth(pubAuth, OutBuf+i);
> > -
> > -      // fill SealedData
> > -      BYTE tempBuf[1024];
> > -      *SealedDataSize = BSG_Pack(BSG_TPM_STORED_DATA, &sealedData, tempBuf);
> > -      if (TCS_Malloc(hContext, *SealedDataSize, SealedData) == TPM_FAIL) {
> > -       return TPM_SIZE;
> > -      }
> > -      memcpy(*SealedData, tempBuf, *SealedDataSize);
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Seal Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCSP_Unseal(TCS_CONTEXT_HANDLE hContext,  // in
> > -                      TCS_KEY_HANDLE  parentHandle, // in
> > -                      UINT32    SealedDataSize, // in
> > -                      BYTE*    SealedData,  // in
> > -                      TCS_AUTH*   parentAuth,  // in, out
> > -                      TCS_AUTH*   dataAuth,  // in, out
> > -                      UINT32*   DataSize,  // out
> > -                      BYTE**    Data)   // out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_AUTH2_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_Unseal;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (SealedData == NULL || parentAuth == NULL || dataAuth == NULL ||
> > -      DataSize == NULL || Data == NULL)
> > -    return TPM_BAD_PARAMETER;
> > -
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 4,
> > -                                     BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &ordinal,
> > -                          BSG_TYPE_UINT32, &parentHandle);
> > -  memcpy(InBuf+InLength, SealedData, SealedDataSize);
> > -  InLength += SealedDataSize;
> > -  InLength += packAuth(InBuf+InLength, parentAuth);
> > -  InLength += packAuth(InBuf+InLength, dataAuth);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> > -    // unpack OutBuf to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList( OutBuf, 3,
> > -                            BSG_TPM_TAG, &tag,
> > -                            BSG_TYPE_UINT32, &paramSize,
> > -                            BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH2_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      i += BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, DataSize);
> > -      if (TCS_Malloc(hContext, *DataSize, Data) == TPM_FAIL) {
> > -        return TPM_SIZE;
> > -      }
> > -      memcpy(*Data, OutBuf+i, *DataSize);
> > -      i += *DataSize;
> > -      i += unpackAuth(parentAuth, OutBuf+i);
> > -      unpackAuth(dataAuth, OutBuf+i);
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Unseal Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCSP_UnBind(TCS_CONTEXT_HANDLE hContext,  // in
> > -                      TCS_KEY_HANDLE  keyHandle,  // in
> > -                      UINT32    inDataSize,  // in
> > -                      BYTE*    inData,   // in
> > -                      TCS_AUTH*   privAuth,  // in, out
> > -                      UINT32*   outDataSize, // out
> > -                      BYTE**    outData)  // out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_UnBind;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (inData == NULL || privAuth == NULL || outDataSize == NULL || outData == NULL)
> > -    return TPM_BAD_PARAMETER;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 5,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT32, &keyHandle,
> > -                         BSG_TYPE_UINT32, &inDataSize);
> > -  memcpy(InBuf+InLength, inData, inDataSize);
> > -  InLength += inDataSize;
> > -  InLength += packAuth(InBuf+InLength, privAuth);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "\n\tSending paramSize = %d", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> > -    // unpack OutBuf to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      i += BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, outDataSize);
> > -      if (TCS_Malloc(hContext, *outDataSize, outData) == TPM_FAIL)
> > -        return TPM_SIZE;
> > -
> > -      memcpy(*outData, OutBuf+i, *outDataSize);
> > -      i += *outDataSize;
> > -      unpackAuth(privAuth, OutBuf+i);
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_UnBind Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCSP_CreateWrapKey(TCS_CONTEXT_HANDLE hContext,   // in
> > -                             TCS_KEY_HANDLE  hWrappingKey,  // in
> > -                             TPM_ENCAUTH  KeyUsageAuth,  // in
> > -                             TPM_ENCAUTH  KeyMigrationAuth, // in
> > -                             UINT32*    pcKeySize,   // in, out
> > -                             BYTE**    prgbKey,   // in, out
> > -                             TCS_AUTH*   pAuth)    // in, out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_CreateWrapKey;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (pcKeySize == NULL || *prgbKey == NULL || pAuth == NULL)
> > -    return TPM_BAD_PARAMETER;
> > -
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 6,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT32, &hWrappingKey,
> > -                         BSG_TPM_ENCAUTH, KeyUsageAuth,
> > -                         BSG_TPM_ENCAUTH, KeyMigrationAuth);
> > -  memcpy(InBuf+InLength, *prgbKey, *pcKeySize);
> > -  InLength += *pcKeySize;
> > -  InLength += packAuth(InBuf+InLength, pAuth);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> > -    // unpack OutBuf to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_RESULT, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      TPM_KEY wrappedKey;
> > -
> > -      i += BSG_Unpack(BSG_TPM_KEY, OutBuf+i, &wrappedKey);
> > -      unpackAuth(pAuth, OutBuf+i);
> > -
> > -      // Fill prgbKey
> > -      BYTE tempBuf[1024];
> > -      *pcKeySize = BSG_Pack(BSG_TPM_KEY, &wrappedKey, tempBuf);
> > -      if (TCS_Malloc(hContext, *pcKeySize, prgbKey) == TPM_FAIL)
> > -        return TPM_SIZE;
> > -
> > -      memcpy(*prgbKey, tempBuf, *pcKeySize);
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_CreateWrapKey Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCSP_LoadKeyByBlob(TCS_CONTEXT_HANDLE hContext,    // in
> > -                             TCS_KEY_HANDLE  hUnwrappingKey,   // in
> > -                             UINT32    cWrappedKeyBlobSize, // in
> > -                             BYTE*    rgbWrappedKeyBlob,  // in
> > -                             TCS_AUTH*   pAuth,     // in, out
> > -                             TCS_KEY_HANDLE*  phKeyTCSI,    // out
> > -                             TCS_KEY_HANDLE*  phKeyHMAC)    // out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_LoadKey;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (rgbWrappedKeyBlob == NULL || pAuth == NULL || phKeyTCSI == NULL || phKeyHMAC == NULL)
> > -    return TPM_BAD_PARAMETER;
> > -
> > -  *phKeyHMAC = hUnwrappingKey; // the parent key is the one that the TPM use to make the HMAC calc
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 4,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT32, &hUnwrappingKey);
> > -  memcpy(InBuf+InLength, rgbWrappedKeyBlob, cWrappedKeyBlobSize);
> > -  InLength += cWrappedKeyBlobSize;
> > -  InLength += packAuth(InBuf+InLength, pAuth);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> > -    // unpack OutBuf to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      i += BSG_Unpack(BSG_TYPE_UINT32,
> > -                     OutBuf+i,
> > -                     phKeyTCSI);
> > -      unpackAuth(pAuth, OutBuf+i);
> > -
> > -      if (!AddHandleToList(hContext, TPM_RT_KEY, *phKeyTCSI)) {
> > -        vtpmlogerror(VTPM_LOG_TCS, "New KeyHandle not recorded\n");
> > -      }
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -     } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_LoadKeyByBlob Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCSP_EvictKey(TCS_CONTEXT_HANDLE hContext, // in
> > -                        TCS_KEY_HANDLE  hKey)  // in
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_EvictKey;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 4,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT32, &hKey);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> > -    // unpack OutBuf to get the tag, paramSize, & returnCode
> > -    BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (!DeleteHandleFromList(hContext, hKey)) {
> > -      vtpmlogerror(VTPM_LOG_TCS, "KeyHandle not removed from list\n");
> > -    }
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else {
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_EvictKey Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -    }
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCSP_GetRandom(TCS_CONTEXT_HANDLE hContext,  // in
> > -                         UINT32*    bytesRequested, // in, out
> > -                         BYTE**    randomBytes) // out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_GetRandom;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (bytesRequested == NULL || *randomBytes == NULL){
> > -    return TPM_BAD_PARAMETER;
> > -  }
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 4,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT32, bytesRequested);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> > -    // unpack OutBuf to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, bytesRequested);
> > -      if (TCS_Malloc(hContext, *bytesRequested, randomBytes) == TPM_FAIL) {
> > -        return TPM_SIZE;
> > -      }
> > -      memcpy(*randomBytes, OutBuf+i+sizeof(UINT32), *bytesRequested);
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else {
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_GetRandom Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -    }
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -
> > -TPM_RESULT TCSP_ReadPubek(TCS_CONTEXT_HANDLE   hContext,               // in
> > -                         TPM_NONCE            antiReplay,             // in
> > -                         UINT32*              pubEndorsementKeySize,  // out
> > -                         BYTE**               pubEndorsementKey,      // out
> > -                         TPM_DIGEST*          checksum)               // out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_ReadPubek;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32   OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (pubEndorsementKeySize == NULL || pubEndorsementKey == NULL || checksum == NULL) {
> > -    return TPM_BAD_PARAMETER;
> > -  }
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 4,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TPM_NONCE, &antiReplay);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> > -    // unpack OutBuf to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      TPM_PUBKEY pubEK;
> > -      i += BSG_UnpackList(OutBuf+i, 2,
> > -                         BSG_TPM_PUBKEY, &pubEK,
> > -                         BSG_TPM_DIGEST, checksum);
> > -
> > -      // fill EndorsementKey
> > -      BYTE tempBuf[1024];
> > -      *pubEndorsementKeySize = BSG_Pack(BSG_TPM_PUBKEY, &pubEK, tempBuf);
> > -      if (TCS_Malloc(hContext, *pubEndorsementKeySize, pubEndorsementKey) == TPM_FAIL) {
> > -        return TPM_SIZE;
> > -      }
> > -      memcpy(*pubEndorsementKey, tempBuf, *pubEndorsementKeySize);
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else {
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_ReadPubek Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -    }
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -
> > -TPM_RESULT TCSP_SaveState(TCS_CONTEXT_HANDLE   hContext)  // in
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_SaveState;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &ordinal);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> > -    // unpack OutBuf to get the tag, paramSize, & returnCode
> > -    BSG_UnpackList(OutBuf, 3,
> > -                           BSG_TPM_TAG, &tag,
> > -                           BSG_TYPE_UINT32, &paramSize,
> > -                           BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else {
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_SaveState Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -    }
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -
> > -TPM_RESULT TCSP_RawTransmitData(   UINT32 inDataSize,  // in
> > -                                  BYTE *inData,       // in
> > -                                  UINT32 *outDataSize,// in/out
> > -                                  BYTE *outData) {    // out
> > -
> > -  TDDL_RESULT hRes;
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS, "Calling TransmitData directly.\n");
> > -  //FIXME: Add Context Management
> > -  hRes = TDDL_TransmitData( inData,
> > -                           inDataSize,
> > -                           outData,
> > -                           outDataSize);
> > -
> > -  if (hRes == TDDL_SUCCESS) {
> > -    return TPM_SUCCESS;
> > -  } else {
> > -    vtpmlogerror(VTPM_LOG_TCS, "TCSP_RawTransmitData Failed with return code %s\n", tpm_get_error_name(TPM_IOERROR));
> > -    return TPM_IOERROR;
> > -  }
> > -
> > -}
> > diff --git a/tools/vtpm_manager/tcs/tcs.h b/tools/vtpm_manager/tcs/tcs.h
> > deleted file mode 100644
> > index 83b9cd0..0000000
> > --- a/tools/vtpm_manager/tcs/tcs.h
> > +++ /dev/null
> > @@ -1,245 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// tcs.h
> > -//
> > -//  This file declares the TCS API
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __TCS_H__
> > -#define __TCS_H__
> > -
> > -#include "tcg.h"
> > -#include "contextmgr.h"
> > -#include "buffer.h"
> > -
> > -#define HANDLE_NULL 0
> > -
> > -// ------------------------------------------------------------------
> > -// Exposed API
> > -// ------------------------------------------------------------------
> > -
> > -TPM_RESULT TCS_create();
> > -void TCS_destroy();
> > -
> > -TPM_RESULT TCS_OpenContext( /* OUT */ TCS_CONTEXT_HANDLE* hContext );
> > -
> > -TPM_RESULT TCS_CloseContext ( /* IN */ TCS_CONTEXT_HANDLE hContext );
> > -
> > -TPM_RESULT TCS_Malloc ( TCS_CONTEXT_HANDLE hContext, // in
> > -                       UINT32   MemSize, // in
> > -                       BYTE**   ppMemPtr ); //out
> > -
> > -TPM_RESULT TCS_FreeMemory ( TCS_CONTEXT_HANDLE hContext, // in
> > -                           BYTE*    pMemory);  // in
> > -
> > -// ------------------------------------------------------------------
> > -// Exposed API
> > -// ------------------------------------------------------------------
> > -
> > -// TPM v1.1B Command Set
> > -
> > -// Authorzation
> > -TPM_RESULT TCSP_OIAP( TCS_CONTEXT_HANDLE hContext, // in
> > -                     TCS_AUTHHANDLE*  authHandle, // out
> > -                     TPM_NONCE*   nonce0  // out
> > -                     );
> > -
> > -TPM_RESULT TCSP_OSAP (  TCS_CONTEXT_HANDLE hContext,  // in
> > -                       TPM_ENTITY_TYPE entityType,  // in
> > -                       UINT32    entityValue, // in
> > -                       TPM_NONCE   nonceOddOSAP, // in
> > -                       TCS_AUTHHANDLE*  authHandle,  // out
> > -                       TPM_NONCE*   nonceEven,  // out
> > -                       TPM_NONCE*   nonceEvenOSAP // out
> > -                       );
> > -
> > -TPM_RESULT TCSP_TakeOwnership (  TCS_CONTEXT_HANDLE hContext,   // in
> > -                                UINT16    protocolID,   // in
> > -                                UINT32    encOwnerAuthSize, // in
> > -                                BYTE*    encOwnerAuth,  // in
> > -                                UINT32    encSrkAuthSize,  // in
> > -                                BYTE*    encSrkAuth,   // in
> > -                                UINT32*    SrkSize,   // in, out
> > -                                BYTE**    Srk,    // in, out
> > -                                TCS_AUTH*   ownerAuth   // in, out
> > -                                );
> > -
> > -TPM_RESULT TCSP_DisablePubekRead (  TCS_CONTEXT_HANDLE hContext, // in
> > -                                    TCS_AUTH*   ownerAuth // in, out
> > -                                    );
> > -
> > -TPM_RESULT TCSP_TerminateHandle (  TCS_CONTEXT_HANDLE hContext, // in
> > -                                  TCS_AUTHHANDLE  handle  // in
> > -                                  );
> > -
> > -TPM_RESULT TCSP_FlushSpecific (  TCS_CONTEXT_HANDLE hContext, // in
> > -                                TCS_AUTHHANDLE  handle,  // in
> > -                                TPM_RESOURCE_TYPE resourceType //in
> > -                                );
> > -
> > -// TPM Mandatory
> > -TPM_RESULT TCSP_Extend (  TCS_CONTEXT_HANDLE hContext, // in
> > -                         TPM_PCRINDEX  pcrNum,  // in
> > -                         TPM_DIGEST   inDigest, // in
> > -                         TPM_PCRVALUE*   outDigest // out
> > -                         );
> > -
> > -TPM_RESULT TCSP_PcrRead (  TCS_CONTEXT_HANDLE hContext, // in
> > -                          TPM_PCRINDEX  pcrNum,  // in
> > -                          TPM_PCRVALUE*  outDigest // out
> > -                          );
> > -
> > -TPM_RESULT TCSP_Quote (  TCS_CONTEXT_HANDLE hContext,  // in
> > -                        TCS_KEY_HANDLE  keyHandle,  // in
> > -                        TPM_NONCE   antiReplay,  // in
> > -                        UINT32*    PcrDataSize, // in, out
> > -                        BYTE**    PcrData,  // in, out
> > -                        TCS_AUTH*   privAuth,  // in, out
> > -                        UINT32*    sigSize,  // out
> > -                        BYTE**    sig    // out
> > -                        );
> > -
> > -TPM_RESULT TCSP_Seal (  TCS_CONTEXT_HANDLE hContext,  // in
> > -                       TCS_KEY_HANDLE  keyHandle,  // in
> > -                       TPM_ENCAUTH  encAuth,  // in
> > -                       UINT32    pcrInfoSize, // in
> > -                       BYTE*    PcrInfo,  // in
> > -                       UINT32    inDataSize,  // in
> > -                       BYTE*    inData,   // in
> > -                       TCS_AUTH*   pubAuth,  // in, out
> > -                       UINT32*    SealedDataSize, // out
> > -                       BYTE**    SealedData  // out
> > -                       );
> > -
> > -TPM_RESULT TCSP_Unseal (  TCS_CONTEXT_HANDLE hContext,  // in
> > -                         TCS_KEY_HANDLE  parentHandle, // in
> > -                         UINT32    SealedDataSize, // in
> > -                         BYTE*    SealedData,  // in
> > -                         TCS_AUTH*   parentAuth,  // in, out
> > -                         TCS_AUTH*   dataAuth,  // in, out
> > -                         UINT32*    DataSize,  // out
> > -                         BYTE**    Data   // out
> > -                         );
> > -
> > -TPM_RESULT TCSP_DirWriteAuth (  TCS_CONTEXT_HANDLE hContext,  // in
> > -                               TPM_DIRINDEX  dirIndex,  // in
> > -                               TPM_DIRVALUE  newContents, // in
> > -                               TCS_AUTH*   ownerAuth  // in, out
> > -                               );
> > -
> > -TPM_RESULT TCSP_DirRead (  TCS_CONTEXT_HANDLE hContext, // in
> > -                          TPM_DIRINDEX  dirIndex, // in
> > -                          TPM_DIRVALUE*  dirValue // out
> > -                          );
> > -
> > -TPM_RESULT TCSP_UnBind (  TCS_CONTEXT_HANDLE hContext,  // in
> > -                         TCS_KEY_HANDLE  keyHandle,  // in
> > -                         UINT32    inDataSize,  // in
> > -                         BYTE*    inData,   // in
> > -                         TCS_AUTH*   privAuth,  // in, out
> > -                         UINT32*    outDataSize, // out
> > -                         BYTE**    outData   // out
> > -                         );
> > -
> > -TPM_RESULT TCSP_CreateWrapKey (  TCS_CONTEXT_HANDLE hContext,   // in
> > -                                TCS_KEY_HANDLE  hWrappingKey,  // in
> > -                                TPM_ENCAUTH  KeyUsageAuth,  // in
> > -                                TPM_ENCAUTH  KeyMigrationAuth, // in
> > -                                UINT32*    pcKeySize,   // in, out
> > -                                BYTE**    prgbKey,   // in, out
> > -                                TCS_AUTH*   pAuth    // in, out
> > -                                );
> > -
> > -TPM_RESULT TCSP_LoadKeyByBlob (  TCS_CONTEXT_HANDLE hContext,    // in
> > -                                TCS_KEY_HANDLE  hUnwrappingKey,   // in
> > -                                UINT32    cWrappedKeyBlobSize, // in
> > -                                BYTE*    rgbWrappedKeyBlob,  // in
> > -                                TCS_AUTH*   pAuth,     // in, out
> > -                                TCS_KEY_HANDLE*  phKeyTCSI,    // out
> > -                                TCS_KEY_HANDLE*  phKeyHMAC    // out
> > -                                );
> > -
> > -TPM_RESULT TCSP_GetPubKey (  TCS_CONTEXT_HANDLE hContext,  // in
> > -                            TCS_KEY_HANDLE  hKey,   // in
> > -                            TCS_AUTH*   pAuth,   // in, out
> > -                            UINT32*    pcPubKeySize, // out
> > -                            BYTE**    prgbPubKey  // out
> > -                            );
> > -
> > -TPM_RESULT TCSP_EvictKey (  TCS_CONTEXT_HANDLE hContext, // in
> > -                           TCS_KEY_HANDLE  hKey  // in
> > -                           );
> > -
> > -TPM_RESULT TCSP_Sign (  TCS_CONTEXT_HANDLE hContext,  // in
> > -                       TCS_KEY_HANDLE  keyHandle,  // in
> > -                       UINT32    areaToSignSize, // in
> > -                       BYTE*    areaToSign,  // in
> > -                       TCS_AUTH*   privAuth,  // in, out
> > -                       UINT32*    sigSize,  // out
> > -                       BYTE**    sig    // out
> > -                       );
> > -
> > -TPM_RESULT TCSP_GetRandom (  TCS_CONTEXT_HANDLE hContext,  // in
> > -                            UINT32*    bytesRequested, // in, out
> > -                            BYTE**    randomBytes  // out
> > -                            );
> > -
> > -TPM_RESULT TCSP_StirRandom (  TCS_CONTEXT_HANDLE hContext, // in
> > -                             UINT32    inDataSize, // in
> > -                             BYTE*    inData  // in
> > -                             );
> > -
> > -TPM_RESULT TCSP_ReadPubek (  TCS_CONTEXT_HANDLE hContext,    // in
> > -                            TPM_NONCE   antiReplay,    // in
> > -                            UINT32*    pubEndorsementKeySize, // out
> > -                            BYTE**    pubEndorsementKey,  // out
> > -                            TPM_DIGEST*  checksum    // out
> > -                            );
> > -
> > -
> > -// Non-Standard TCSP calls
> > -TPM_RESULT TCSP_SaveState(TCS_CONTEXT_HANDLE   hContext);  // in
> > -
> > -//Give direct access to TransmitData.
> > -// Key and Auth Management is done before transfering command to TDDL.
> > -TPM_RESULT TCSP_RawTransmitData(UINT32 inDataSize,  // in
> > -                               BYTE *inData,       // in
> > -                               UINT32 *outDataSize,// in/out
> > -                               BYTE *outData);     // out
> > -
> > -///////////// Private Functions ////////////////////
> > -CONTEXT_HANDLE* LookupContext( TCS_CONTEXT_HANDLE hContext);
> > -
> > -#endif //TCS_H
> > diff --git a/tools/vtpm_manager/tcs/tpmddl.h b/tools/vtpm_manager/tcs/tpmddl.h
> > deleted file mode 100644
> > index e7e54f1..0000000
> > --- a/tools/vtpm_manager/tcs/tpmddl.h
> > +++ /dev/null
> > @@ -1,69 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// tpmddl.c
> > -//
> > -//  This file defines the TDDLI API
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __TPMDDL_H__
> > -#define __TPMDDL_H__
> > -
> > -#define TDDL_CAP_PROP_MANUFACTURER 0x0001
> > -
> > -#define TDDL_E_FAIL 1
> > -#define TDDL_E_SUCCESS 0
> > -#define TDDL_SUCCESS 0
> > -
> > -typedef unsigned int TDDL_UINT32;
> > -typedef TDDL_UINT32 TDDL_RESULT;
> > -typedef unsigned char TDDL_BYTE;
> > -
> > -TDDL_RESULT TDDL_Open();
> > -void TDDL_Close();
> > -TDDL_RESULT TDDL_TransmitData( TDDL_BYTE* in,
> > -                              TDDL_UINT32 insize,
> > -                              TDDL_BYTE* out,
> > -                              TDDL_UINT32* outsize);
> > -TDDL_RESULT TDDL_GetStatus();
> > -TDDL_RESULT TDDL_GetCapability( TDDL_UINT32 cap,
> > -                               TDDL_UINT32 sub,
> > -                               TDDL_BYTE* buffer,
> > -                               TDDL_UINT32* size);
> > -TDDL_RESULT TDDL_SetCapability( TDDL_UINT32 cap,
> > -                               TDDL_UINT32 sub,
> > -                               TDDL_BYTE* buffer,
> > -                               TDDL_UINT32* size);
> > -
> > -#endif // __TPMDDL_H__
> > diff --git a/tools/vtpm_manager/tcs/transmit.c b/tools/vtpm_manager/tcs/transmit.c
> > deleted file mode 100644
> > index 74bbdca..0000000
> > --- a/tools/vtpm_manager/tcs/transmit.c
> > +++ /dev/null
> > @@ -1,147 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -
> > -#include <unistd.h>
> > -#include <stdio.h>
> > -#include <errno.h>
> > -#include <fcntl.h>
> > -
> > -#include "tcg.h"
> > -#include "buffer.h"
> > -#include "log.h"
> > -#include "tpmddl.h"
> > -
> > -// flag to track whether TDDL has been opened
> > -static int g_TDDL_open = 0;
> > -static int g_tx_fd = -1;              // the fd to the TPM
> > -
> > -#ifndef DUMMY_TPM
> > - #define TPM_TX_FNAME "/dev/tpm0"
> > - static int *g_rx_fdp = &g_tx_fd;
> > -#else
> > - #define TPM_TX_FNAME "/var/tpm/tpm_in.fifo"
> > - #define TPM_RX_FNAME "/var/tpm/tpm_out.fifo"
> > - static int g_rx_fd = -1;
> > - static int *g_rx_fdp = &g_rx_fd;              // the fd to the TPM
> > -#endif
> > -
> > -TPM_RESULT
> > -TDDL_TransmitData( TDDL_BYTE* in,
> > -                  TDDL_UINT32 insize,
> > -                  TDDL_BYTE* out,
> > -                  TDDL_UINT32* outsize) {
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TDDL_UINT32 i;
> > -
> > -  vtpmloginfo(VTPM_LOG_TXDATA, "Sending buffer = 0x");
> > -  for(i = 0 ; i < insize ; i++)
> > -    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", in[i]);
> > -
> > -  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> > -
> > -  ssize_t size = 0;
> > -
> > -  // send the request
> > -  size = write (g_tx_fd, in, insize);
> > -  if (size < 0) {
> > -    vtpmlogerror(VTPM_LOG_TXDATA, "write() failed");
> > -    ERRORDIE (TPM_IOERROR);
> > -  }
> > -  else if ((TDDL_UINT32) size < insize) {
> > -    vtpmlogerror(VTPM_LOG_TXDATA, "Wrote %d instead of %d bytes!\n", (int) size, insize);
> > -    // ... ?
> > -  }
> > -
> > -  // read the response
> > -  size = read (*g_rx_fdp, out, TCPA_MAX_BUFFER_LENGTH);
> > -  if (size < 0) {
> > -    vtpmlogerror(VTPM_LOG_TXDATA, "read() failed");
> > -    ERRORDIE (TPM_IOERROR);
> > -  }
> > -
> > -  vtpmloginfo(VTPM_LOG_TXDATA, "Receiving buffer = 0x");
> > -  for(i = 0 ; i < size ; i++)
> > -    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out[i]);
> > -
> > -  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> > -
> > -  *outsize = size;
> > -  // close connection
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -  return status;
> > -}
> > -
> > -TPM_RESULT TDDL_Open() {
> > -
> > -  TDDL_RESULT status = TDDL_SUCCESS;
> > -
> > -  if (g_TDDL_open)
> > -    return TPM_FAIL;
> > -
> > -#ifdef DUMMY_TPM
> > -  *g_rx_fdp = open (TPM_RX_FNAME, O_RDWR);
> > -#endif
> > -
> > -  g_tx_fd = open (TPM_TX_FNAME, O_RDWR);
> > -  if (g_tx_fd < 0) {
> > -    vtpmlogerror(VTPM_LOG_TXDATA, "TPM open failed");
> > -    return TPM_IOERROR;
> > -  }
> > -
> > -  g_TDDL_open = 1;
> > -
> > -  return status;
> > -}
> > -
> > -void TDDL_Close() {
> > -  if (! g_TDDL_open)
> > -        return;
> > -
> > -  if (g_tx_fd>= 0) {
> > -    if (close(g_tx_fd) < 0)
> > -      vtpmlogerror(VTPM_LOG_TXDATA, "closeing tpm failed");
> > -    g_tx_fd = -1;
> > -  }
> > -
> > -  if (*g_rx_fdp>= 0) {
> > -    if (close(*g_rx_fdp) < 0)
> > -      vtpmlogerror(VTPM_LOG_TXDATA, "closeing tpm failed");
> > -    *g_rx_fdp = -1;
> > -  }
> > -
> > -  g_TDDL_open = 0;
> > -
> > -}
> > diff --git a/tools/vtpm_manager/util/Makefile b/tools/vtpm_manager/util/Makefile
> > deleted file mode 100644
> > index 36bc38f..0000000
> > --- a/tools/vtpm_manager/util/Makefile
> > +++ /dev/null
> > @@ -1,24 +0,0 @@
> > -XEN_ROOT = $(CURDIR)/../../..
> > -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> > -
> > -BIN            = libTCGUtils.a
> > -
> > -.PHONY: all
> > -all: build
> > -
> > -.PHONY: build
> > -build: $(BIN)
> > -
> > -.PHONY: install
> > -install: build
> > -
> > -.PHONY: clean
> > -clean:
> > -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> > -
> > -.PHONY: mrproper
> > -mrproper: clean
> > -       rm -f *~
> > -
> > -$(BIN): $(OBJS)
> > -       $(AR) rcs $(BIN) $(OBJS)
> > diff --git a/tools/vtpm_manager/util/bsg.c b/tools/vtpm_manager/util/bsg.c
> > deleted file mode 100644
> > index fa36ce7..0000000
> > --- a/tools/vtpm_manager/util/bsg.c
> > +++ /dev/null
> > @@ -1,829 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// bsg.cpp
> > -//
> > -//  This file will handle all the TPM Byte Stream functions
> > -//
> > -// ==================================================================
> > -
> > -#include <stdio.h>
> > -#include <string.h>
> > -#include <stdarg.h>
> > -#include <malloc.h>
> > -#include "tcg.h"
> > -#include "crypto.h"
> > -#include "bsg.h"
> > -#include "log.h"
> > -
> > -static int g_log_recursion_level = 0;
> > -
> > -// a largest buffer size. if we get a buf size bigger than this when unpacking,
> > -// will complain!
> > -#define BSG_MAX_BUF_SIZE (1<<18)
> > -
> > -#define bsglog(fmt, ...) do { \
> > -    int __i; \
> > -    for (__i=0; __i < g_log_recursion_level; __i++) {               \
> > -      vtpmloginfomore (VTPM_LOG_BSG, "%s", "  ");                           \
> > -    }                                                                 \
> > -    vtpmloginfomore (VTPM_LOG_BSG, fmt, __VA_ARGS__);                         \
> > -  } while (0)
> > -
> > -
> > -// FIXME:  trigger the selfcheck--need to use glibc hook to do this
> > -//BOOL dummy1 = BSG_static_selfcheck();
> > -
> > -
> > -// Interpretting Types
> > -// -------------------
> > -//
> > -// Incoming Types are composed of two parts {format, info} squished into a
> > -// BSG_UINT32.  The first 4 bits is a format spec indicating what type of
> > -// data it is.  If the first 4 bits are zero the info corresponds to a value in
> > -// BSG_s_fmt[]. This is a structure whose composition is described in
> > -// BSG_s_fmt[]. If the value is non-zero, info corresponds to the size of the
> > -// data (in bytes) being passed in. For example a UINT32 being passed in would
> > -// have a format of (__FMT_CONST | 4). If both, the format and info are zero,
> > -// this is interpretted as the end of the structure, and the result is returned.
> > -
> > -// these flags are mutually exclusive, so I'll just make them
> > -// format values which indicate the semantics of the 'info' part and the source
> > -// data. The above description has been accordingly adjusted.
> > -
> > -// format values for determining what type of data the incoming type is
> > -// it's a 4 bit value, occupying the high 4 bits
> > -#define __FMT_CONST (1UL << 28) // Constant sized value
> > -#define __FMT_DATA  (2UL << 28) // Believed to be raw data NOT {size,data}
> > -#define __FMT_SIZE  (3UL << 28) // A size. Used in FMT_SIZE??_DATA.
> > -#define __FMT_HSIZE (4UL << 28) // A number of handles
> > -#define __FMT_PACKED (5UL << 28) // 'info' is unused; the source data consists
> > -                                 // of {size32, data} but we're to pack only the
> > -                                 // data as that is already packed, and so
> > -                                 // can/must be unpacked without
> > -                                 // explicitly reading it size
> > -
> > -#define __FMT_MASK  0x0FFFFFFFUL // this masks out the 4-bit format
> > -#define __FMT_MASK_SIZE(type)   ((type) & __FMT_MASK)
> > -#define __FMT_MASK_FORMAT(type) ((type) & (~__FMT_MASK))
> > -
> > -// constant (8/16/32-bits)
> > -#define FMT_U8 (__FMT_CONST | 1UL)
> > -#define FMT_U16 (__FMT_CONST | 2UL)
> > -#define FMT_U32 (__FMT_CONST | 4UL)
> > -
> > -// const with a compiler-computed size
> > -#define FMT_SIZEOF(type) (__FMT_CONST | sizeof(type))
> > -
> > -// other data (size bytes)
> > -// Used primarily for DIGESTS -> FMT_DATA(20)
> > -#define FMT_DATA(size) (__FMT_DATA | ((BSG_UINT32) (size) & __FMT_MASK))
> > -
> > -// 16/32-bit size followed by N bytes of data
> > -#define FMT_SIZE16_DATA (__FMT_SIZE | 2UL)
> > -#define FMT_SIZE32_DATA (__FMT_SIZE | 4UL)
> > -
> > -// 16-bit size followed by N key handles
> > -#define FMT_SIZE16_HANDLES (__FMT_HSIZE | 2UL)
> > -
> > -#define DIGEST_SIZE 20
> > -typedef BSG_UINT32 BSG_HANDLE;
> > -
> > -// TCPA_AUTH has 11 fields!
> > -#define MAX_FIELDS 11
> > -typedef struct BSG_Format
> > -{
> > -  BSG_Type type;
> > -  const char* name;
> > -  BSG_UINT32 fields[MAX_FIELDS + 1];
> > -} BSG_Format;
> > -
> > -/*
> > - * TCPA structure data formats
> > - */
> > -// this has to be manually kept in sync with the
> > -// Type enum!! the static_selfcheck() function should be used regularly!
> > -static BSG_Format s_fmt[] =
> > -{
> > -  {BSG_TYPE_UINT32, "BSG_TYPE_UINT32", {FMT_U32, 0}},
> > -  {BSG_TYPE_UINT16, "BSG_TYPE_UINT16", {FMT_U16, 0}},
> > -  {BSG_TYPE_BYTE, "BSG_TYPE_BYTE", {FMT_U8, 0}},
> > -  {BSG_TYPE_BOOL, "BSG_TYPE_BOOL", {FMT_U8, 0}},
> > -  {BSG_TPM_SIZE32_DATA, "BSG_TPM_SIZE32_DATA", {FMT_SIZE32_DATA, 0}},
> > -  {BSG_TPM_TAG, "BSG_TPM_TAG", {FMT_SIZEOF(TPM_TAG), 0}},
> > -  {BSG_TPM_HANDLE, "BSG_TPM_HANDLE", {FMT_SIZEOF(TPM_HANDLE), 0}},
> > -  {BSG_TPM_RESULT, "BSG_TPM_RESULT", {FMT_SIZEOF(TPM_RESULT), 0}},
> > -  {BSG_TPM_RESOURCE_TYPE, "BSG_TPM_RESOURCE_TYPE", {FMT_SIZEOF(TPM_RESOURCE_TYPE), 0}},
> > -  {BSG_TPM_COMMAND_CODE, "BSG_TPM_COMMAND_CODE", {FMT_U32, 0}},
> > -  {BSG_TPM_AUTH_DATA_USAGE, "BSG_TPM_AUTH_DATA_USAGE", {FMT_U8, 0}},
> > -  {BSG_TPM_ALGORITHM_ID, "BSG_TPM_ALGORITHM_ID", {FMT_U32, 0}},
> > -  {BSG_TPM_PROTOCOL_ID, "BSG_TPM_PROTOCOL_ID", {FMT_SIZEOF(TPM_PROTOCOL_ID), 0}},
> > -  {BSG_TPM_KEY_USAGE, "BSG_TPM_KEY_USAGE", {FMT_U16, 0}},
> > -  {BSG_TPM_ENC_SCHEME, "BSG_TPM_ENC_SCHEME", {FMT_U16, 0}},
> > -  {BSG_TPM_SIG_SCHEME, "BSG_TPM_SIG_SCHEME", {FMT_U16, 0}},
> > -  {BSG_TPM_MIGRATE_SCHEME, "BSG_TPM_MIGRATE_SCHEME", {FMT_U16, 0}},
> > -  {BSG_TPM_KEY_FLAGS, "BSG_TPM_KEY_FLAGS", {FMT_U32, 0}},
> > -
> > -  {BSG_TPM_AUTHDATA, "BSG_TPM_AUTHDATA", {FMT_DATA(DIGEST_SIZE), 0}},
> > -  {BSG_TPM_SECRET, "BSG_TPM_SECRET", {BSG_TPM_AUTHDATA, 0}},
> > -  {BSG_TPM_ENCAUTH, "BSG_TPM_ENCAUTH", {BSG_TPM_AUTHDATA, 0}},
> > -  {BSG_TPM_PAYLOAD_TYPE, "BSG_TPM_PAYLOAD_TYPE", {FMT_SIZEOF(TPM_PAYLOAD_TYPE), 0}},
> > -
> > -  {BSG_TPM_VERSION, "BSG_TPM_VERSION", {FMT_DATA(4), 0}}, // vers 1.2
> > -  {BSG_TPM_DIGEST, "BSG_TPM_DIGEST", {FMT_DATA(DIGEST_SIZE), 0}},
> > -  {BSG_TPM_COMPOSITE_HASH, "BSG_TPM_COMPOSITE_HASH", {BSG_TPM_DIGEST, 0}},
> > -  {BSG_TPM_CHOSENID_HASH, "BSG_TPM_CHOSENID_HASH", {BSG_TPM_DIGEST, 0}},
> > -
> > -  {BSG_TPM_NONCE, "BSG_TPM_NONCE", {FMT_DATA(DIGEST_SIZE), 0}},
> > -  {BSG_TPM_KEY_HANDLE, "BSG_TPM_KEY_HANDLE", {FMT_SIZEOF(TPM_KEY_HANDLE), 0}},
> > -  {BSG_TPM_KEY_HANDLE_LIST, "BSG_TPM_KEY_HANDLE_LIST",
> > -   {FMT_SIZE16_HANDLES, 0}},
> > -
> > -  {BSG_TPM_KEY_PARMS, "BSG_TPM_KEY_PARMS", {
> > -      BSG_TPM_ALGORITHM_ID,
> > -      BSG_TPM_ENC_SCHEME,
> > -      BSG_TPM_SIG_SCHEME,
> > -      FMT_SIZE32_DATA,
> > -      0}},
> > -  {BSG_TPM_RSA_KEY_PARMS, "BSG_TPM_RSA_KEY_PARMS", {
> > -      FMT_U32, FMT_U32, FMT_SIZE32_DATA, 0}},
> > -  {BSG_TPM_STORE_PUBKEY, "BSG_TPM_STORE_PUBKEY", {FMT_SIZE32_DATA, 0}},
> > -  {BSG_TPM_PUBKEY, "BSG_TPM_PUBKEY", {BSG_TPM_KEY_PARMS, BSG_TPM_STORE_PUBKEY, 0}},
> > -  {BSG_TPM_KEY, "BSG_TPM_KEY", {
> > -      BSG_TPM_VERSION,
> > -      BSG_TPM_KEY_USAGE,
> > -      BSG_TPM_KEY_FLAGS,
> > -      BSG_TPM_AUTH_DATA_USAGE,
> > -      BSG_TPM_KEY_PARMS,
> > -      FMT_SIZE32_DATA,        // the PCR_INFO
> > -      BSG_TPM_STORE_PUBKEY,
> > -      FMT_SIZE32_DATA,        // the encrypted part
> > -      0}},
> > -
> > -  {BSG_TPM_MIGRATIONKEYAUTH, "BSG_TPM_MIGRATIONKEYAUTH", {
> > -      BSG_TPM_PUBKEY,
> > -      BSG_TPM_MIGRATE_SCHEME,
> > -      BSG_TPM_DIGEST, 0}},
> > -
> > -  {BSG_TCPA_AUDIT_EVENT, "TCPA_AUDIT_EVENT", {
> > -      BSG_TPM_COMMAND_CODE,
> > -      BSG_TPM_RESULT, 0 }},
> > -
> > -  {BSG_TCPA_EVENT_CERT, "TCPA_EVENT_CERT", {
> > -      BSG_TPM_DIGEST,
> > -      BSG_TPM_DIGEST,
> > -      FMT_DATA(2),
> > -      FMT_SIZE32_DATA, 0}},
> > -
> > -  {BSG_TPM_PCR_SELECTION, "BSG_TPM_PCR_SELECTION", {FMT_SIZE16_DATA, 0} },
> > -  {BSG_TPM_PCR_COMPOSITE, "BSG_TPM_PCR_COMPOSITE", { BSG_TPM_PCR_SELECTION,
> > -                                                    FMT_SIZE32_DATA,
> > -                                                    0} },
> > -
> > -  {BSG_TPM_PCR_INFO, "BSG_TPM_PCR_INFO", { BSG_TPM_PCR_SELECTION,
> > -                                          BSG_TPM_COMPOSITE_HASH,
> > -                                          BSG_TPM_COMPOSITE_HASH,
> > -                                          0} },
> > -
> > -
> > -  {BSG_TPM_STORED_DATA, "BSG_TPM_STORED_DATA", {
> > -      BSG_TPM_VERSION,
> > -      FMT_SIZE32_DATA,
> > -      FMT_SIZE32_DATA,
> > -      0}},
> > -  {BSG_TPM_SYMMETRIC_KEY, "BSG_TPM_SYMMETRIC_KEY", {
> > -      BSG_TPM_ALGORITHM_ID,
> > -      BSG_TPM_ENC_SCHEME,
> > -      FMT_SIZE16_DATA,
> > -      0}},
> > -  {BSG_TPM_STORE_PRIVKEY, "BSG_TPM_STORE_PRIVKEY", {FMT_SIZE32_DATA, 0}},
> > -  {BSG_TPM_STORE_ASYMKEY, "BSG_TPM_STORE_ASYMKEY", {
> > -      BSG_TPM_PAYLOAD_TYPE,
> > -      BSG_TPM_SECRET,
> > -      BSG_TPM_SECRET,
> > -      BSG_TPM_DIGEST,
> > -      BSG_TPM_STORE_PRIVKEY,
> > -      0}},
> > -  {BSG_TPM_MIGRATE_ASYMKEY, "BSG_TPM_MIGRATE_ASYMKEY", {
> > -      BSG_TPM_PAYLOAD_TYPE,
> > -      BSG_TPM_SECRET,
> > -      BSG_TPM_DIGEST,
> > -      FMT_U32,
> > -      BSG_TPM_STORE_PRIVKEY,
> > -      0}},
> > -
> > -  {BSG_TPM_QUOTE_INFO, "BSG_TPM_QUOTE_INFO", {
> > -      BSG_TPM_VERSION,
> > -      FMT_DATA(4),
> > -      BSG_TPM_COMPOSITE_HASH,
> > -      BSG_TPM_NONCE,
> > -      0}},
> > -
> > -  {BSG_TPM_IDENTITY_CONTENTS, "BSG_TPM_IDENTITY_CONTENTS", {
> > -      BSG_TPM_VERSION,
> > -      FMT_U32,
> > -      BSG_TPM_CHOSENID_HASH,
> > -      BSG_TPM_PUBKEY,
> > -      0}},
> > -
> > -  {BSG_TPM_PCRVALUE, "BSG_TPM_PCRVALUE", {FMT_DATA(DIGEST_SIZE), 0}},
> > -
> > -  {BSG_TCPA_PCR_FLAGS, "TCPA_PCR_FLAGS", {
> > -      FMT_U8,
> > -      FMT_U8,
> > -      0}},
> > -
> > -  {BSG_TCS_AUTH, "TCS_AUTH", {
> > -      BSG_TYPE_UINT32,
> > -      BSG_TPM_NONCE,
> > -      BSG_TPM_NONCE,
> > -      BSG_TYPE_BOOL,
> > -      BSG_TPM_AUTHDATA,
> > -      0}},
> > -
> > -  {BSG_TPM_KEY_NONSENSITIVE, "BSG_TPM_KEY_NONSENSITIVE", {
> > -      BSG_TPM_VERSION,
> > -      BSG_TPM_KEY_USAGE,
> > -      BSG_TPM_KEY_FLAGS,
> > -      BSG_TPM_AUTH_DATA_USAGE,
> > -      BSG_TPM_KEY_PARMS,
> > -      FMT_SIZE32_DATA,
> > -      BSG_TPM_STORE_PUBKEY,
> > -      0}},
> > -
> > -  {BSG_PACKED, "BSG_PACKED", {
> > -      __FMT_PACKED,
> > -      0 }},
> > -
> > -  {BSG_TYPE_MAX, "", {0}},
> > -};
> > -
> > -
> > -static const BSG_Format* find_format (BSG_Type t) {
> > -  BSG_Format * f = s_fmt;
> > -
> > -  if (t >= BSG_TYPE_MAX) {
> > -    return NULL;
> > -  }
> > -
> > -  // WARNING: this depends on the enum and s_fmt[] array being in sync! make
> > -  // sure to run the static_selfcheck() to make sure
> > -  f = s_fmt + (t - BSG_TYPE_FIRST);
> > -
> > -  return f;
> > -}
> > -
> > -//
> > -// a consistency-checking routine which can be run at compile time
> > -// (ie. immediately after compilation)
> > -//
> > -// tasks:
> > -// - verify that s_fmt has one entry per Type t, and that entry is at s_fmt[t]
> > -//
> > -// conditions:
> > -// - need that s_fmt[0] is the first type listed in the Type enum! ie the first
> > -//   Type has value 0, not 1
> > -//
> > -// FIXME: should have a function be passed in here which is called if the test
> > -// fails. Then the caller can decide what to do: abort, notify, whatever
> > -//
> > -BOOL BSG_static_selfcheck ()
> > -{
> > -  int i;
> > -
> > -  for (i=BSG_TYPE_FIRST; i <= BSG_TYPE_MAX; i++) {
> > -    if (s_fmt[i - BSG_TYPE_FIRST].type != i) {
> > -      bsglog ("%s\n", "BSG: static_selfcheck failed!\n");
> > -      bsglog ("failure at %i, allegedly %s\n",
> > -             i, s_fmt[i - BSG_TYPE_FIRST].name);
> > -      abort();
> > -      return FALSE;
> > -    }
> > -  }
> > -
> > -  bsglog ("%s\n", "BSG: static_selfcheck success!");
> > -  return TRUE;
> > -}
> > -
> > -
> > -/**
> > - * Flatten a TCPA structure into a buffer in big-endian format
> > - * @type: TCPA structure type
> > - * @src: (IN) TCPA structure (OUT) end of TCPA structure
> > - * @dst: (OUT) flattened data
> > - * Returns: Flattened size or -1 for unknown types
> > - */
> > -// make it so that it can just run through the whole process and return
> > -// the packed size, without packing anything. this will be done if dst is NULL.
> > -static int BSG_Pack_private(BSG_Type type, const BSG_BYTE** src, BSG_BYTE* dst)
> > -{
> > -  // check incoming parameters
> > -  if (*src == NULL)
> > -    return 0;
> > -
> > -  const BSG_BYTE* s = *src;
> > -  BSG_BYTE* d = dst;
> > -
> > -  BSG_UINT32 size   = __FMT_MASK_SIZE(type);
> > -  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
> > -
> > -  if (format == __FMT_CONST) // We are dealing with a fixed length value eg. UINT32
> > -    {
> > -      BSG_UINT32 val = 0;
> > -      switch (size) {
> > -      case 1: val = * (BYTE*) s; break;
> > -      case 2: val = * (unsigned short*) s; break;
> > -      case 4: val = * (BSG_UINT32*) s; break;
> > -      }
> > -      if (dst)
> > -       BSG_PackConst(val, size, d);
> > -
> > -      s += size;
> > -      d += size;
> > -    } else if (format == __FMT_DATA) { // We are dealing with raw data. Not sure when
> > -    // this is used.
> > -
> > -      if (dst) {
> > -        bsglog ("BSG: __FMT_DATA size %d, src %p, dst %p\n", size, s, d);
> > -        memcpy(d, s, size);
> > -      }
> > -
> > -      s += size;
> > -      d += size;
> > -  } else if (format == __FMT_SIZE || format == __FMT_HSIZE) { // It's a size, followed by that much data or handles
> > -
> > -    BSG_UINT32 psize = 0;
> > -    switch (size) {
> > -    case 1: psize = * (BYTE*) s; break;
> > -    case 2: psize = * (unsigned short*) s; break;
> > -    case 4: psize = * (BSG_UINT32*) s; break;
> > -    }
> > -
> > -    if (dst)
> > -      BSG_PackConst(psize, size, d);
> > -
> > -    s += size;
> > -    d += size;
> > -
> > -    // now 's' points to an address, so cast it to BSG_BYTE**
> > -    const BSG_BYTE* pdata = * ((BSG_BYTE**) s);
> > -    s += sizeof(BSG_BYTE*);
> > -
> > -    if (format == __FMT_HSIZE) {// This is a list of psize Handles
> > -      if (dst) {
> > -       BSG_HANDLE* d2 = (BSG_HANDLE*) d;
> > -       BSG_HANDLE* p2 = (BSG_HANDLE*) pdata;
> > -       BSG_UINT32 i;
> > -       for (i = 0; i < psize; i++)
> > -         d2[i] = BSG_UnpackConst((BSG_BYTE*)(p2 + i), 4);
> > -
> > -      }
> > -      d += psize * sizeof(BSG_HANDLE);
> > -    } else {// If it's not psize handles, it's psize data.
> > -      if (psize > 0) {
> > -       if (dst) {
> > -         bsglog ("BSG: __FMT_SIZE, size=%d, src=%p, dst=%p\n",
> > -                 psize, pdata, d);
> > -         memcpy(d, pdata, psize);
> > -       }
> > -      }
> > -      d += psize;
> > -    }
> > -  } else if (format == __FMT_PACKED) {
> > -    // the source buffer is a pack_constbuf_t, which has a size and a
> > -    // pointer. just copy the buffer value, the size is not included in the
> > -    // output stream.
> > -    pack_constbuf_t * buf = (pack_constbuf_t*) s;
> > -
> > -    if (dst) {
> > -      bsglog ("BSG: __FMT_PACKED, size=%d, src=%p, dst=%p\n",
> > -             buf->size, buf->data, d);
> > -      memcpy(d, buf->data, buf->size);
> > -    }
> > -
> > -    s += buf->size;
> > -    d += buf->size;
> > -  } else if (format == 0) {// No flags are set. This is a structure & it should
> > -                          // be looked up in the bsg_s_fmt[]
> > -
> > -    const BSG_Format* x = find_format (type);
> > -    if (x == NULL) {
> > -      vtpmloginfo(VTPM_LOG_BSG, "BSG_Pack: cannot find type %d\n", type);
> > -      return -1;
> > -    }
> > -
> > -    if (dst)
> > -      bsglog ("BSG_Pack type %s\n", x->name);
> > -
> > -
> > -    // iterate through the fields
> > -    const BSG_UINT32* f = x->fields;
> > -    for (; *f; f++) {
> > -      int fsize;
> > -
> > -      g_log_recursion_level++;
> > -      fsize = BSG_Pack_private((BSG_Type) *f, &s, dst ? d : NULL);
> > -      g_log_recursion_level--;
> > -
> > -      if (fsize <= 0)
> > -       return fsize;
> > -
> > -      d += fsize;
> > -    }
> > -  } else {
> > -    vtpmlogerror(VTPM_LOG_BSG, "BSG_Pack(): Unknown format %d\n", format);
> > -    return -1;
> > -  }
> > -
> > -  *src = s;
> > -  return (d - dst);
> > -}
> > -
> > -/**
> > - * Unflatten a TCPA structure from a buffer in big-endian format
> > - * @type: TCPA structure type
> > - * @src: flattened data
> > - * @dst: (IN) TCPA structure (OUT) end of TCPA structure
> > - * Returns: Flattened size
> > - * Note: Returns flattened size NOT the unpacked structure size
> > - */
> > -static int BSG_Unpack_private(BSG_Type type, const BSG_BYTE* src, BSG_BYTE** dst) {
> > -  // check incoming parameters
> > -  if (src == NULL)
> > -    return 0;
> > -
> > -
> > -  const BSG_BYTE* s = src;
> > -  BSG_BYTE* d = dst ? *dst:NULL;
> > -  if (dst && !d)
> > -    dst = NULL;
> > -
> > -  BSG_UINT32 size = __FMT_MASK_SIZE(type);
> > -  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
> > -
> > -  if (format == __FMT_CONST) {// We are dealing with a fixed length value ie. UINT32
> > -
> > -    BSG_UINT32 val = BSG_UnpackConst(s, size);
> > -
> > -    if (dst) {
> > -      switch (size) {
> > -      case 1: *(BYTE *) d = (BSG_BYTE) val; break;
> > -      case 2: *(unsigned short*) d = (unsigned short) val; break;
> > -      case 4: *(BSG_UINT32*) d = (BSG_UINT32) val; break;
> > -      }
> > -    }
> > -
> > -    s += size;
> > -    d += size;
> > -  } else if (format == __FMT_DATA) {// We are dealing with raw data. Not sure when this is used.
> > -    if (dst)
> > -      memcpy(d, s, size);
> > -
> > -    d += size;
> > -    s += size;
> > -  } else if (format == __FMT_SIZE || format == __FMT_HSIZE) {// It's a size, followed by that much data or handles
> > -
> > -    BSG_UINT32 psize = BSG_UnpackConst(s, size);
> > -
> > -    if (psize > BSG_MAX_BUF_SIZE) {
> > -      vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack runs into var-sized data bigger than %u bytes!!\n",
> > -              BSG_MAX_BUF_SIZE);
> > -      return -1;
> > -    }
> > -
> > -    if (dst) {
> > -      switch (size) {
> > -      case 1: *(BYTE *) d = (BSG_BYTE) psize; break;
> > -      case 2: *(unsigned short*) d = (unsigned short) psize; break;
> > -      case 4: *(BSG_UINT32*) d = (BSG_UINT32) psize; break;
> > -      }
> > -    }
> > -
> > -    s += size;
> > -    d += size;
> > -
> > -    BSG_BYTE* pdata = NULL;
> > -
> > -    if (psize) {
> > -      if (format == __FMT_HSIZE) { // This is a list of psize Handles
> > -       if (dst) {
> > -         BSG_HANDLE* s2 = (BSG_HANDLE*) s;
> > -         pdata = (BSG_BYTE *)malloc(psize * sizeof(BSG_HANDLE));
> > -          if (!pdata)
> > -            return -1;
> > -
> > -         BSG_HANDLE* p2 = (BSG_HANDLE*) pdata;
> > -         BSG_UINT32 i;
> > -         for (i = 0; i < psize; i++) {
> > -           BSG_PackConst(s2[i], 4, (BSG_BYTE*)(p2 + i));
> > -         }
> > -       }
> > -       s += psize * sizeof(BSG_HANDLE);
> > -      } else { // If it's not psize handles, it's psize data.
> > -       if (dst) {
> > -         pdata = (BSG_BYTE *)malloc(sizeof(BSG_BYTE) * psize);
> > -          if (!pdata)
> > -            return -1;
> > -         memcpy(pdata, s, psize);
> > -       }
> > -       s += psize;
> > -      }
> > -    }
> > -    if (dst)
> > -      *(void**) d = pdata;
> > -
> > -    d += sizeof(void*);
> > -  } else if (format == __FMT_PACKED) {
> > -
> > -    // this doesn't make sense for unpacking!
> > -    vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack() called with format __FMT_PACKED. "
> > -                                                          "This does not make sense\n");
> > -
> > -    return -1;
> > -  } else if (format == 0) {// No flags are set. This is a structure & it should
> > -                          // be looked up in the bsg_s_fmt[]
> > -
> > -    const BSG_Format* x = find_format (type);
> > -    if (x == NULL) {
> > -      vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack: cannot find type %d\n", type);
> > -      return -1;
> > -    }
> > -
> > -    const BSG_UINT32* f = x->fields;
> > -    for (; *f; f++) {
> > -      int fsize = BSG_Unpack_private((BSG_Type) *f, s, dst ? &d:NULL);
> > -      if (fsize <= 0)
> > -       return fsize;
> > -      s += fsize;
> > -    }
> > -  }
> > -
> > -  if (dst)
> > -    *dst = d;
> > -  return (s - src);
> > -}
> > -
> > -/**
> > - * Free memory associated with unpacked TCPA structure
> > - * @type: TCPA structure type
> > - * @src: (IN) TCPA structure (OUT) end of TCPA structure
> > - * Note: Destroy should be called on all structures created with Unpack
> > - *       to ensure that any allocated memory is freed
> > - */
> > -static void BSG_Destroy_private(BSG_Type type, BSG_BYTE** src) {
> > -  BSG_BYTE* s = *src;
> > -
> > -  BSG_UINT32 size = __FMT_MASK_SIZE(type);
> > -  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
> > -
> > -  if ((src == NULL) || (*src == NULL)) {
> > -        vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy() called with NULL src\n");
> > -    return;
> > -  }
> > -
> > -  if (format == __FMT_CONST || format == __FMT_DATA)
> > -    s += size;
> > -  else if (format == __FMT_SIZE || format == __FMT_HSIZE) {
> > -    s += size;
> > -    BSG_BYTE* ptr = *(BSG_BYTE**) s;
> > -    free(ptr);
> > -    s += sizeof(void*);
> > -  } else if (format == __FMT_PACKED) {
> > -
> > -    // this doesn't make sense for unpacking, hence also for Destroy()
> > -    vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy() called with format __FMT_PACKED. "
> > -                                                          "This does not make sense\n");
> > -
> > -    return;
> > -  } else if (format == 0) {
> > -    const BSG_Format* x = find_format (type);
> > -    if (x == NULL) {
> > -      vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy: cannot find type %d\n", type);
> > -      return;
> > -    }
> > -
> > -    const BSG_UINT32* f = x->fields;
> > -    for (; *f; f++)
> > -      BSG_Destroy_private((BSG_Type) *f, &s);
> > -  }
> > -
> > -  *src = s;
> > -}
> > -
> > -int BSG_Pack(BSG_Type type, const void* src, BSG_BYTE* dst)
> > -{
> > -  const BSG_BYTE* src2 = (const BSG_BYTE*) src;
> > -  return BSG_Pack_private(type, &src2, dst);
> > -}
> > -
> > -int BSG_Unpack(BSG_Type type, const BSG_BYTE* src, void* dst)
> > -{
> > -  BSG_BYTE* dst2 = (BSG_BYTE*) dst;
> > -  return BSG_Unpack_private(type, src, dst ? &dst2:NULL);
> > -}
> > -
> > -void BSG_Destroy(BSG_Type type, void* src)
> > -{
> > -  BSG_BYTE* src2 = (BSG_BYTE*) src;
> > -  BSG_Destroy_private(type, &src2);
> > -}
> > -
> > -/**
> > - * Pack a 8/16/32-bit constant into a buffer in big-endian format
> > - * @val: constant value
> > - * @size: constant size in bytes (1, 2, or 4)
> > - * @dst: (OUT) buffer
> > - */
> > -void BSG_PackConst(BSG_UINT32 val, int size, BSG_BYTE* dst) {
> > -  bsglog ("BSG: PackConst on %d of size %i into address %p\n", val, size, dst);
> > -
> > -  switch (size) {
> > -  case 4:
> > -    dst[0] = (BSG_BYTE)((val >> 24) & 0xff);
> > -    dst[1] = (BSG_BYTE)((val >> 16) & 0xff);
> > -    dst[2] = (BSG_BYTE)((val >> 8) & 0xff);
> > -    dst[3] = (BSG_BYTE)(val & 0xff);
> > -    break;
> > -  case 2:
> > -    dst[0] = (BSG_BYTE)((val >> 8) & 0xff);
> > -    dst[1] = (BSG_BYTE)(val & 0xff);
> > -    break;
> > -  case 1:
> > -    dst[0] = (BSG_BYTE)(val & 0xff);
> > -    break;
> > -  }
> > -}
> > -
> > -/**
> > - * Unpack a 8/16/32-bit constant from a buffer in big-endian format
> > - * @src: buffer
> > - * @size: constant size in bytes (1, 2, or 4)
> > - */
> > -BSG_UINT32 BSG_UnpackConst(const BSG_BYTE* src, int size) {
> > -  BSG_UINT32 val = 0;
> > -
> > -  if (src == NULL)
> > -    return 0;
> > -
> > -  switch (size) {
> > -  case 4:
> > -    val = (((BSG_UINT32) src[0]) << 24
> > -          | ((BSG_UINT32) src[1]) << 16
> > -          | ((BSG_UINT32) src[2]) << 8
> > -          | (BSG_UINT32) src[3]);
> > -    break;
> > -  case 2:
> > -    val = (((BSG_UINT32) src[0]) << 8 | (BSG_UINT32) src[1]);
> > -    break;
> > -  case 1:
> > -    val = (BSG_UINT32) src[0];
> > -    break;
> > -  }
> > -  return val;
> > -}
> > -
> > -// Pack a list of parameters. Beware not to send values, but rather you must
> > -// send a pointer to your values Instead. This includes UINT32's.
> > -int BSG_PackList( BSG_BYTE* dst, int ParamCount, ... ) {
> > -  int ParamNumber;
> > -  BSG_Type format;
> > -  BSG_BYTE* val = NULL;
> > -  int size=0;
> > -
> > -  va_list paramList;
> > -  va_start( paramList, ParamCount );
> > -
> > -  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
> > -    //Strangeness with int is because gcc wanted an int rather than a enum of ints.
> > -    format =  (BSG_Type) va_arg( paramList, int );
> > -    val = va_arg( paramList, BSG_BYTE* );
> > -    size += BSG_Pack(format, val, dst == NULL ? NULL : dst + size);
> > -  }
> > -
> > -  va_end (paramList);
> > -
> > -  return size;
> > -}
> > -
> > -// Unpack a list of parameters.
> > -int BSG_UnpackList( const BSG_BYTE* src, int ParamCount, ... ) {
> > -  int ParamNumber = 0;
> > -  BSG_Type format;
> > -  BSG_BYTE* val = NULL;
> > -  int size = 0;
> > -
> > -  va_list paramList;
> > -  va_start( paramList, ParamCount );
> > -
> > -  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
> > -    format = (BSG_Type) va_arg( paramList, int );
> > -    val  = va_arg( paramList, BSG_BYTE* );
> > -
> > -    size += BSG_Unpack(format, src + size, val);
> > -  }
> > -
> > -  va_end( paramList );
> > -
> > -  return size;
> > -}
> > -
> > -// Destroy any memory allocated by calls to unpack
> > -void BSG_DestroyList(int ParamCount, ... ) {
> > -  int ParamNumber = 0;
> > -  BSG_Type argType;
> > -  BSG_BYTE* paramValue = NULL;
> > -
> > -  va_list paramList;
> > -  va_start( paramList, ParamCount );
> > -
> > -  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
> > -    argType = (BSG_Type) va_arg( paramList, int );
> > -    paramValue  = va_arg( paramList, BSG_BYTE* );
> > -
> > -    BSG_Destroy(argType, paramValue);
> > -  }
> > -
> > -  va_end( paramList );
> > -
> > -  return;
> > -}
> > -
> > -
> > -// and a tuple version
> > -TPM_RESULT BSG_DestroyTuple (int numParams, pack_tuple_t params[]) {
> > -  int i;
> > -
> > -  for (i = 0; i < numParams; i++)
> > -    BSG_Destroy (params[i].type, params[i].addr);
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -
> > -//
> > -// wrappers of Pack and PackList which malloc the ouput buffer. to be freed
> > -// by the caller later
> > -//
> > -
> > -int BSG_PackMalloc (BSG_Type type, const void* src, BSG_BYTE** o_dst) {
> > -  int size = BSG_Pack (type, src, NULL);
> > -  BSG_BYTE * dest = (BSG_BYTE*) malloc (size);
> > -  if (dest == NULL)
> > -    return -1;
> > -
> > -  size = BSG_Pack(type, src, dest);
> > -  *o_dst = dest;
> > -  return size;
> > -}
> > -
> > -
> > -
> > -int BSG_PackListMalloc(BSG_BYTE** outBuffer, int ParamCount, ... ) {
> > -  va_list args;
> > -  int size;
> > -
> > -  va_start (args, ParamCount);
> > -  size = BSG_PackList (NULL, ParamCount, args);
> > -  va_end (args);
> > -
> > -  BSG_BYTE * dest = (BSG_BYTE*) malloc (size);
> > -  if (dest == NULL)
> > -    return -1;
> > -
> > -  va_start (args, ParamCount);
> > -  size = BSG_PackList (dest, ParamCount, args);
> > -  va_end (args);
> > -
> > -  *outBuffer = dest;
> > -  return size;
> > -}
> > diff --git a/tools/vtpm_manager/util/bsg.h b/tools/vtpm_manager/util/bsg.h
> > deleted file mode 100644
> > index 0896812..0000000
> > --- a/tools/vtpm_manager/util/bsg.h
> > +++ /dev/null
> > @@ -1,166 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// bsg.h
> > -//
> > -//  This file contains API's for the TPM Byte Stream functions
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __BSG_H__
> > -#define __BSG_H__
> > -
> > -#include <stdarg.h>
> > -#include "buffer.h"
> > -
> > -typedef unsigned int BSG_UINT32;
> > -typedef unsigned char BSG_BYTE;
> > -
> > -// forward decl
> > -struct pack_const_tuple_t;
> > -
> > -struct pack_tuple_t;
> > -
> > -
> > -/**
> > - * Byte stream generator
> > - */
> > -// this has to be manually kept in sync with the
> > -// s_fmt array!!
> > -// but now we have a self-check function which can make sure things are well
> > -// (if used!)
> > -typedef enum BSG_Type
> > -{
> > -  BSG_TYPE_FIRST = 1,
> > -  BSG_TYPE_UINT32 = 1, // start at 1 so that Type 0 only serves as an
> > -                       // unused/special value
> > -  BSG_TYPE_UINT16,
> > -  BSG_TYPE_BYTE,
> > -  BSG_TYPE_BOOL,
> > -  BSG_TPM_SIZE32_DATA,  // a 32 bit unsigned size, followed by
> > -                        // a pointer to that much data. can pass a
> > -                        // struct pack_buf_t as the param
> > -  BSG_TPM_TAG,
> > -  BSG_TPM_HANDLE,
> > -  BSG_TPM_RESULT,
> > -  BSG_TPM_RESOURCE_TYPE,
> > -  BSG_TPM_COMMAND_CODE,
> > -  BSG_TPM_AUTH_DATA_USAGE,
> > -  BSG_TPM_ALGORITHM_ID,
> > -  BSG_TPM_PROTOCOL_ID,
> > -  BSG_TPM_KEY_USAGE,
> > -  BSG_TPM_ENC_SCHEME,
> > -  BSG_TPM_SIG_SCHEME,
> > -  BSG_TPM_MIGRATE_SCHEME,
> > -  BSG_TPM_KEY_FLAGS,
> > -  BSG_TPM_AUTHDATA,
> > -  BSG_TPM_SECRET,
> > -  BSG_TPM_ENCAUTH,
> > -  BSG_TPM_PAYLOAD_TYPE,
> > -
> > -  BSG_TPM_VERSION,
> > -  BSG_TPM_DIGEST,
> > -  BSG_TPM_COMPOSITE_HASH,
> > -  BSG_TPM_CHOSENID_HASH,
> > -  BSG_TPM_NONCE,
> > -  BSG_TPM_KEY_HANDLE,
> > -  BSG_TPM_KEY_HANDLE_LIST,
> > -  BSG_TPM_KEY_PARMS,
> > -  BSG_TPM_RSA_KEY_PARMS,
> > -  BSG_TPM_STORE_PUBKEY,
> > -  BSG_TPM_PUBKEY,
> > -  BSG_TPM_KEY,
> > -
> > -  BSG_TPM_MIGRATIONKEYAUTH,
> > -  BSG_TCPA_AUDIT_EVENT,
> > -  BSG_TCPA_EVENT_CERT,
> > -  BSG_TPM_PCR_SELECTION,
> > -  BSG_TPM_PCR_COMPOSITE,
> > -  BSG_TPM_PCR_INFO,
> > -  BSG_TPM_STORED_DATA,
> > -  BSG_TPM_SYMMETRIC_KEY,
> > -  BSG_TPM_STORE_PRIVKEY,
> > -  BSG_TPM_STORE_ASYMKEY,
> > -  BSG_TPM_MIGRATE_ASYMKEY,
> > -  BSG_TPM_QUOTE_INFO,
> > -  BSG_TPM_IDENTITY_CONTENTS,
> > -  BSG_TPM_PCRVALUE,
> > -  BSG_TCPA_PCR_FLAGS,
> > -  BSG_TCS_AUTH,
> > -
> > -  // this is the BSG_TPM_KEY struct without the encData field
> > -  BSG_TPM_KEY_NONSENSITIVE,
> > -
> > -  BSG_PACKED,
> > -
> > -  BSG_TYPE_MAX
> > -} BSG_Type;
> > -
> > -struct pack_const_tuple_t {
> > -  BSG_Type type;
> > -  const void * addr;
> > -};
> > -
> > -
> > -typedef struct pack_tuple_t {
> > -  BSG_Type type;
> > -  void * addr;
> > -} pack_tuple_t;
> > -
> > -int BSG_Pack(BSG_Type type, const void* src, BSG_BYTE* dst);
> > -int BSG_Unpack(BSG_Type type, const BSG_BYTE* src, void* dst);
> > -void BSG_Destroy(BSG_Type type, void* src);
> > -
> > -// wrappers of Pack and PackList which malloc the ouput buffer. to be freed
> > -// by the caller later. returns size of allocated buffer, or -1 in case
> > -// allocation failed
> > -int BSG_PackMalloc (BSG_Type type, const void* src, BSG_BYTE** o_dst);
> > -int BSG_PackListMalloc (BSG_BYTE** outBuffer, int ParamCount, ... );
> > -
> > -// a va_list version of PackList
> > -int BSG_PackList(BSG_BYTE* outBuffer, int ParamCount, ... );
> > -int BSG_UnpackList(const BSG_BYTE* inBuffer, int ParamCount, ... );
> > -void BSG_DestroyList(int ParamCount, ... );
> > -
> > -// wrapper of PackList which uses a buffer_t
> > -TPM_RESULT BSG_PackListBuf (buffer_t * o_buf, int ParamCount, ...);
> > -
> > -// and a tuple version
> > -TPM_RESULT BSG_DestroyTuple (int numParams, pack_tuple_t params[]);
> > -
> > -void BSG_PackConst(BSG_UINT32 val, int size, BSG_BYTE* dst);
> > -BSG_UINT32 BSG_UnpackConst(const BSG_BYTE* src, int size);
> > -
> > -BOOL BSG_static_selfcheck ();
> > -
> > -#endif
> > diff --git a/tools/vtpm_manager/util/buffer.c b/tools/vtpm_manager/util/buffer.c
> > deleted file mode 100644
> > index df48bc2..0000000
> > --- a/tools/vtpm_manager/util/buffer.c
> > +++ /dev/null
> > @@ -1,226 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -
> > -
> > -#include <stdarg.h>
> > -#include <string.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <sys/param.h>
> > -
> > -#include "tcg.h"
> > -#include "bsg.h"
> > -#include "buffer.h"
> > -
> > -static TPM_RESULT buffer_priv_realloc (buffer_t * buf, tpm_size_t newsize);
> > -
> > -//
> > -// buffer functions!
> > -//
> > -
> > -TPM_RESULT buffer_init (buffer_t * buf, tpm_size_t initsize, const BYTE* initval) {
> > -  if (initsize == 0) {
> > -    memset(buf, 0, sizeof(*buf));
> > -    return TPM_SUCCESS;
> > -  }
> > -
> > -
> > -  buf->bytes = (BYTE*) malloc (initsize);
> > -  if (buf->bytes == NULL)
> > -    return TPM_RESOURCES;
> > -
> > -  buf->size = initsize;
> > -  buf->alloc_size = initsize;
> > -
> > -  if (initval)
> > -    memcpy (buf->bytes, initval, initsize);
> > -
> > -  buf->is_owner = TRUE;
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -TPM_RESULT buffer_init_convert (buffer_t * buf, tpm_size_t initsize, BYTE* initval) {
> > -
> > -  buf->size = initsize;
> > -  buf->alloc_size = initsize;
> > -  buf->bytes = initval;
> > -
> > -  buf->is_owner = TRUE;
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -TPM_RESULT buffer_init_copy (buffer_t * buf, const buffer_t * src) {
> > -  TPM_RESULT status = buffer_init (buf, src->size, src->bytes);
> > -  buf->is_owner = TRUE;
> > -
> > -  return status;
> > -}
> > -
> > -
> > -
> > -// make an alias to a constant array
> > -TPM_RESULT buffer_init_const (buffer_t * buf, tpm_size_t size, const BYTE* val) {
> > -  // TODO: try to enforce the const things somehow!
> > -  buf->bytes = (BYTE*) val;
> > -  buf->size = size;
> > -  buf->alloc_size = 0;        // this field is now unneeded
> > -
> > -  buf->is_owner = FALSE;
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -// make an alias into buf, with given offset and length
> > -// if len = 0, make the alias go to the end of buf
> > -TPM_RESULT buffer_init_alias (buffer_t * buf, const buffer_t * b,
> > -                              tpm_size_t offset, tpm_size_t len) {
> > -  if (offset + len > b->size) {
> > -    return TPM_NOSPACE;
> > -  }
> > -
> > -  buf->bytes = b->bytes + offset;
> > -  buf->size = len > 0 ? len : b->size - offset;
> > -
> > -  //VS/ buf->alloc_size = 0;
> > -  if (len ==0)
> > -    buf->alloc_size = b->alloc_size - offset;
> > -  else
> > -    buf->alloc_size = MIN(b->alloc_size - offset, len);
> > -
> > -
> > -  buf->is_owner = FALSE;
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -// make an alias buffer_t into bytestream, with given length
> > -TPM_RESULT buffer_init_alias_convert (buffer_t * buf, tpm_size_t size, BYTE* val) {
> > -
> > -  buf->size = size;
> > -  buf->alloc_size = size;
> > -  buf->bytes = val;
> > -
> > -  buf->is_owner = FALSE;
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -
> > -
> > -// copy into the start of dest
> > -TPM_RESULT buffer_copy (buffer_t * dest, const buffer_t* src)
> > -{
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  if (dest->alloc_size < src->size) {
> > -    TPMTRYRETURN( buffer_priv_realloc (dest, src->size) );
> > -  }
> > -
> > -  memcpy (dest->bytes, src->bytes, src->size);
> > -  dest->size = src->size;
> > -
> > -  //VS/ dest->is_owner = TRUE;
> > -
> > - abort_egress:
> > -
> > -  return status;
> > -}
> > -
> > -
> > -
> > -BOOL buffer_eq (const buffer_t * a, const buffer_t * b) {
> > -  return (a->size == b->size && memcmp (a->bytes, b->bytes, a->size) == 0);
> > -}
> > -
> > -
> > -void buffer_memset (buffer_t * buf, BYTE b) {
> > -  memset (buf->bytes, b, buf->size);
> > -}
> > -
> > -
> > -TPM_RESULT buffer_append_raw (buffer_t * buf, tpm_size_t len, const BYTE* bytes) {
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  if (buf->alloc_size < buf->size + len) {
> > -    TPMTRYRETURN( buffer_priv_realloc (buf, buf->size + len) );
> > -  }
> > -
> > -  memcpy (buf->bytes + buf->size, bytes, len);
> > -
> > -  buf->size += len;
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -tpm_size_t buffer_len (const buffer_t* buf) {
> > -  return buf->size;
> > -}
> > -
> > -TPM_RESULT buffer_free (buffer_t * buf) {
> > -  if (buf && buf->is_owner && buf->bytes != NULL) {
> > -    free (buf->bytes);
> > -    buf->bytes = NULL;
> > -    buf->size = buf->alloc_size = 0;
> > -
> > -  }
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -TPM_RESULT buffer_priv_realloc (buffer_t * buf, tpm_size_t newsize) {
> > -
> > -  // we want to realloc to twice the size, or the new size, whichever
> > -  // bigger
> > -
> > -  BYTE * tmpbuf = NULL;
> > -
> > -  newsize = MAX (buf->alloc_size * 2, newsize);
> > -
> > -  tmpbuf = (BYTE*) realloc (buf->bytes, newsize);
> > -  if (tmpbuf == NULL)
> > -    return TPM_SIZE;
> > -
> > -
> > -  buf->bytes = tmpbuf;
> > -  buf->alloc_size = newsize;
> > -
> > -  return TPM_SUCCESS;
> > -}
> > diff --git a/tools/vtpm_manager/util/buffer.h b/tools/vtpm_manager/util/buffer.h
> > deleted file mode 100644
> > index d8a9abc..0000000
> > --- a/tools/vtpm_manager/util/buffer.h
> > +++ /dev/null
> > @@ -1,95 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -
> > -#ifndef __VTPM_BUFFER_H__
> > -#define __VTPM_BUFFER_H__
> > -
> > -#include <stddef.h>             // for pointer NULL
> > -#include "tcg.h"
> > -
> > -typedef UINT32 tpm_size_t;
> > -
> > -// first version, probably will be expanded...
> > -
> > -#define NULL_BUF {0,0,0,0}
> > -
> > -typedef struct {
> > -  // private!!
> > -  tpm_size_t size, alloc_size;
> > -  BYTE * bytes;
> > -
> > -  BOOL is_owner;              // do we own this buffer, and need to free it?
> > -} buffer_t;
> > -
> > -// allocate the buffer if initsize > 0, copying over initval if provided
> > -TPM_RESULT buffer_init (buffer_t * buf,
> > -                        tpm_size_t initsize,
> > -                        const BYTE* initval);
> > -
> > -// Create a new buffer from a BYTE *. Use buffer_free to destroy original BYTE *
> > -TPM_RESULT buffer_init_convert (buffer_t * buf,
> > -                                tpm_size_t initsize,
> > -                                BYTE* initval);
> > -
> > -// make an alias to a constant array, no copying
> > -TPM_RESULT buffer_init_const (buffer_t * buf, tpm_size_t size, const BYTE* val);
> > -
> > -// make an alias into buf, with given offset and length
> > -// if len = 0, make the alias go to the end of buf
> > -TPM_RESULT buffer_init_alias (buffer_t * buf, const buffer_t * b,
> > -                              tpm_size_t offset, tpm_size_t);
> > -
> > -// make an alias buffer into a bytestream
> > -TPM_RESULT buffer_init_alias_convert (buffer_t * buf,
> > -                                      tpm_size_t size, BYTE* val);
> > -
> > -// "copy constructor"
> > -TPM_RESULT buffer_init_copy (buffer_t * buf, const buffer_t * src);
> > -
> > -
> > -// copy into the start of a
> > -TPM_RESULT buffer_copy (buffer_t * dest, const buffer_t* src);
> > -
> > -// are they equal?
> > -BOOL buffer_eq (const buffer_t * a, const buffer_t * b);
> > -
> > -// set the buffer to a constant byte
> > -void buffer_memset (buffer_t * buf, BYTE b);
> > -
> > -tpm_size_t buffer_len (const buffer_t* buf);
> > -
> > -TPM_RESULT buffer_free (buffer_t * buf);
> > -
> > -TPM_RESULT buffer_append_raw (buffer_t * buf, tpm_size_t len, const BYTE* bytes);
> > -
> > -#endif // _TOOLS_H_
> > diff --git a/tools/vtpm_manager/util/hashtable.c b/tools/vtpm_manager/util/hashtable.c
> > deleted file mode 100644
> > index aff0e2b..0000000
> > --- a/tools/vtpm_manager/util/hashtable.c
> > +++ /dev/null
> > @@ -1,316 +0,0 @@
> > -/*
> > - * Copyright (c) 2005, Intel Corp
> > - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> > - * All rights reserved.
> > - *
> > - * Redistribution and use in source and binary forms, with or without
> > - * modification, are permitted provided that the following conditions
> > - * are met:
> > - *
> > - * * Redistributions of source code must retain the above copyright
> > - * notice, this list of conditions and the following disclaimer.
> > - *
> > - * * Redistributions in binary form must reproduce the above copyright
> > - * notice, this list of conditions and the following disclaimer in the
> > - * documentation and/or other materials provided with the distribution.
> > - *
> > - * * Neither the name of the original author; nor the names of any contributors
> > - * may be used to endorse or promote products derived from this software
> > - * without specific prior written permission.
> > - *
> > - *
> > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> > - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> > - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> > - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> > - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> > - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> > - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> > - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> > - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > -*/
> > -
> > -/*
> > - * There are duplicates of this code in:
> > - *  - tools/xenstore/hashtable.c
> > - *  - tools/blktap2/drivers/hashtable.c
> > - */
> > -
> > -#include "hashtable.h"
> > -#include "hashtable_private.h"
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > -#include <math.h>
> > -
> > -/*
> > -Credit for primes table: Aaron Krowne
> > - http://br.endernet.org/~akrowne/
> > - http://planetmath.org/encyclopedia/GoodHashTablePrimes.html
> > -*/
> > -static const unsigned int primes[] = {
> > -53, 97, 193, 389,
> > -769, 1543, 3079, 6151,
> > -12289, 24593, 49157, 98317,
> > -196613, 393241, 786433, 1572869,
> > -3145739, 6291469, 12582917, 25165843,
> > -50331653, 100663319, 201326611, 402653189,
> > -805306457, 1610612741
> > -};
> > -const unsigned int prime_table_length = sizeof(primes)/sizeof(primes[0]);
> > -const float max_load_factor = 0.65;
> > -
> > -/*****************************************************************************/
> > -struct hashtable *
> > -create_hashtable(unsigned int minsize,
> > -                 unsigned int (*hashf) (void*),
> > -                 int (*eqf) (void*,void*))
> > -{
> > -    struct hashtable *h;
> > -    unsigned int pindex, size = primes[0];
> > -    /* Check requested hashtable isn't too large */
> > -    if (minsize > (1u << 30)) return NULL;
> > -    /* Enforce size as prime */
> > -    for (pindex=0; pindex < prime_table_length; pindex++) {
> > -        if (primes[pindex] > minsize) { size = primes[pindex]; break; }
> > -    }
> > -    h = (struct hashtable *)malloc(sizeof(struct hashtable));
> > -    if (NULL == h) return NULL; /*oom*/
> > -    h->table = (struct entry **)malloc(sizeof(struct entry*) * size);
> > -    if (NULL == h->table) { free(h); return NULL; } /*oom*/
> > -    memset(h->table, 0, size * sizeof(struct entry *));
> > -    h->tablelength  = size;
> > -    h->primeindex   = pindex;
> > -    h->entrycount   = 0;
> > -    h->hashfn       = hashf;
> > -    h->eqfn         = eqf;
> > -    h->loadlimit    = (unsigned int) ceil(size * max_load_factor);
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_init(&h->mutex, NULL);
> > -#endif
> > -    return h;
> > -}
> > -
> > -/*****************************************************************************/
> > -unsigned int
> > -hash(struct hashtable *h, void *k)
> > -{
> > -    unsigned int i = h->hashfn(k);
> > -    i += ~(i << 9);
> > -    i ^=  ((i >> 14) | (i << 18)); /* >>> */
> > -    i +=  (i << 4);
> > -    i ^=  ((i >> 10) | (i << 22)); /* >>> */
> > -    return i;
> > -}
> > -
> > -/*****************************************************************************/
> > -static int
> > -hashtable_expand(struct hashtable *h)
> > -{
> > -    /* Double the size of the table to accomodate more entries */
> > -    struct entry **newtable;
> > -    struct entry *e;
> > -    struct entry **pE;
> > -    unsigned int newsize, i, index;
> > -    /* Check we're not hitting max capacity */
> > -    if (h->primeindex == (prime_table_length - 1)) return 0;
> > -    newsize = primes[++(h->primeindex)];
> > -
> > -    newtable = (struct entry **)malloc(sizeof(struct entry*) * newsize);
> > -    if (NULL != newtable)
> > -    {
> > -        memset(newtable, 0, newsize * sizeof(struct entry *));
> > -        /* This algorithm is not 'stable'. ie. it reverses the list
> > -         * when it transfers entries between the tables */
> > -        for (i = 0; i < h->tablelength; i++) {
> > -            while (NULL != (e = h->table[i])) {
> > -                h->table[i] = e->next;
> > -                index = indexFor(newsize,e->h);
> > -                e->next = newtable[index];
> > -                newtable[index] = e;
> > -            }
> > -        }
> > -        free(h->table);
> > -        h->table = newtable;
> > -    }
> > -    /* Plan B: realloc instead */
> > -    else
> > -    {
> > -        newtable = (struct entry **)
> > -                   realloc(h->table, newsize * sizeof(struct entry *));
> > -        if (NULL == newtable) { (h->primeindex)--; return 0; }
> > -        h->table = newtable;
> > -        memset(newtable[h->tablelength], 0, newsize - h->tablelength);
> > -        for (i = 0; i < h->tablelength; i++) {
> > -            for (pE = &(newtable[i]), e = *pE; e != NULL; e = *pE) {
> > -                index = indexFor(newsize,e->h);
> > -                if (index == i)
> > -                {
> > -                    pE = &(e->next);
> > -                }
> > -                else
> > -                {
> > -                    *pE = e->next;
> > -                    e->next = newtable[index];
> > -                    newtable[index] = e;
> > -                }
> > -            }
> > -        }
> > -    }
> > -    h->tablelength = newsize;
> > -    h->loadlimit   = (unsigned int) ceil(newsize * max_load_factor);
> > -    return -1;
> > -}
> > -
> > -/*****************************************************************************/
> > -unsigned int
> > -hashtable_count(struct hashtable *h)
> > -{
> > -    unsigned int count;
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_lock(&h->mutex);
> > -#endif
> > -    count = h->entrycount;
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_unlock(&h->mutex);
> > -#endif
> > -    return count;
> > -}
> > -
> > -/*****************************************************************************/
> > -int
> > -hashtable_insert(struct hashtable *h, void *k, void *v)
> > -{
> > -    /* This method allows duplicate keys - but they shouldn't be used */
> > -    unsigned int index;
> > -    struct entry *e;
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_lock(&h->mutex);
> > -#endif
> > -    if (++(h->entrycount) > h->loadlimit)
> > -    {
> > -        /* Ignore the return value. If expand fails, we should
> > -         * still try cramming just this value into the existing table
> > -         * -- we may not have memory for a larger table, but one more
> > -         * element may be ok. Next time we insert, we'll try expanding again.*/
> > -        hashtable_expand(h);
> > -    }
> > -    e = (struct entry *)malloc(sizeof(struct entry));
> > -    if (NULL == e) { --(h->entrycount); return 0; } /*oom*/
> > -    e->h = hash(h,k);
> > -    index = indexFor(h->tablelength,e->h);
> > -    e->k = k;
> > -    e->v = v;
> > -    e->next = h->table[index];
> > -    h->table[index] = e;
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_unlock(&h->mutex);
> > -#endif
> > -    return -1;
> > -}
> > -
> > -/*****************************************************************************/
> > -void * /* returns value associated with key */
> > -hashtable_search(struct hashtable *h, void *k)
> > -{
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_lock(&h->mutex);
> > -#endif
> > -    struct entry *e;
> > -    unsigned int hashvalue, index;
> > -    hashvalue = hash(h,k);
> > -    index = indexFor(h->tablelength,hashvalue);
> > -    e = h->table[index];
> > -    while (NULL != e)
> > -    {
> > -        /* Check hash value to short circuit heavier comparison */
> > -        if ((hashvalue == e->h) && (h->eqfn(k, e->k))) {
> > -#ifdef HASHTABLE_THREADED
> > -          pthread_mutex_unlock(&h->mutex);
> > -#endif
> > -          return e->v;
> > -        }
> > -        e = e->next;
> > -    }
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_unlock(&h->mutex);
> > -#endif
> > -    return NULL;
> > -}
> > -
> > -/*****************************************************************************/
> > -void * /* returns value associated with key */
> > -hashtable_remove(struct hashtable *h, void *k)
> > -{
> > -    /* TODO: consider compacting the table when the load factor drops enough,
> > -     *       or provide a 'compact' method. */
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_lock(&h->mutex);
> > -#endif
> > -    struct entry *e;
> > -    struct entry **pE;
> > -    void *v;
> > -    unsigned int hashvalue, index;
> > -
> > -    hashvalue = hash(h,k);
> > -    index = indexFor(h->tablelength,hash(h,k));
> > -    pE = &(h->table[index]);
> > -    e = *pE;
> > -    while (NULL != e)
> > -    {
> > -        /* Check hash value to short circuit heavier comparison */
> > -        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
> > -        {
> > -            *pE = e->next;
> > -            h->entrycount--;
> > -            v = e->v;
> > -            freekey(e->k);
> > -            free(e);
> > -            return v;
> > -        }
> > -        pE = &(e->next);
> > -        e = e->next;
> > -    }
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_unlock(&h->mutex);
> > -#endif
> > -    return NULL;
> > -}
> > -
> > -/*****************************************************************************/
> > -/* destroy */
> > -void
> > -hashtable_destroy(struct hashtable *h, int free_values)
> > -{
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_lock(&h->mutex);
> > -#endif
> > -    unsigned int i;
> > -    struct entry *e, *f;
> > -    struct entry **table = h->table;
> > -    if (free_values)
> > -    {
> > -        for (i = 0; i < h->tablelength; i++)
> > -        {
> > -            e = table[i];
> > -            while (NULL != e)
> > -            { f = e; e = e->next; freekey(f->k); free(f->v); free(f); }
> > -        }
> > -    }
> > -    else
> > -    {
> > -        for (i = 0; i < h->tablelength; i++)
> > -        {
> > -            e = table[i];
> > -            while (NULL != e)
> > -            { f = e; e = e->next; freekey(f->k); free(f); }
> > -        }
> > -    }
> > -    free(h->table);
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_destroy(&h->mutex);
> > -#endif
> > -    free(h);
> > -}
> > diff --git a/tools/vtpm_manager/util/hashtable.h b/tools/vtpm_manager/util/hashtable.h
> > deleted file mode 100644
> > index dedc60a..0000000
> > --- a/tools/vtpm_manager/util/hashtable.h
> > +++ /dev/null
> > @@ -1,204 +0,0 @@
> > -/*
> > - * Copyright (c) 2005, Intel Corp
> > - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> > - * All rights reserved.
> > - *
> > - * Redistribution and use in source and binary forms, with or without
> > - * modification, are permitted provided that the following conditions
> > - * are met:
> > - *
> > - * * Redistributions of source code must retain the above copyright
> > - * notice, this list of conditions and the following disclaimer.
> > - *
> > - * * Redistributions in binary form must reproduce the above copyright
> > - * notice, this list of conditions and the following disclaimer in the
> > - * documentation and/or other materials provided with the distribution.
> > - *
> > - * * Neither the name of the original author; nor the names of any contributors
> > - * may be used to endorse or promote products derived from this software
> > - * without specific prior written permission.
> > - *
> > - *
> > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> > - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> > - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> > - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> > - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> > - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> > - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> > - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> > - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > -*/
> > -
> > -/*
> > - * There are duplicates of this code in:
> > - *  - tools/xenstore/hashtable.h
> > - *  - tools/blktap2/drivers/hashtable.h
> > - */
> > -
> > -#ifndef __HASHTABLE_CWC22_H__
> > -#define __HASHTABLE_CWC22_H__
> > -
> > -struct hashtable;
> > -
> > -/* Example of use:
> > - *
> > - *      struct hashtable  *h;
> > - *      struct some_key   *k;
> > - *      struct some_value *v;
> > - *
> > - *      static unsigned int         hash_from_key_fn( void *k );
> > - *      static int                  keys_equal_fn ( void *key1, void *key2 );
> > - *
> > - *      h = create_hashtable(16, hash_from_key_fn, keys_equal_fn);
> > - *      k = (struct some_key *)     malloc(sizeof(struct some_key));
> > - *      v = (struct some_value *)   malloc(sizeof(struct some_value));
> > - *
> > - *      (initialise k and v to suitable values)
> > - *
> > - *      if (! hashtable_insert(h,k,v) )
> > - *      {     exit(-1);               }
> > - *
> > - *      if (NULL == (found = hashtable_search(h,k) ))
> > - *      {    printf("not found!");                  }
> > - *
> > - *      if (NULL == (found = hashtable_remove(h,k) ))
> > - *      {    printf("Not found\n");                 }
> > - *
> > - */
> > -
> > -/* Macros may be used to define type-safe(r) hashtable access functions, with
> > - * methods specialized to take known key and value types as parameters.
> > - *
> > - * Example:
> > - *
> > - * Insert this at the start of your file:
> > - *
> > - * DEFINE_HASHTABLE_INSERT(insert_some, struct some_key, struct some_value);
> > - * DEFINE_HASHTABLE_SEARCH(search_some, struct some_key, struct some_value);
> > - * DEFINE_HASHTABLE_REMOVE(remove_some, struct some_key, struct some_value);
> > - *
> > - * This defines the functions 'insert_some', 'search_some' and 'remove_some'.
> > - * These operate just like hashtable_insert etc., with the same parameters,
> > - * but their function signatures have 'struct some_key *' rather than
> > - * 'void *', and hence can generate compile time errors if your program is
> > - * supplying incorrect data as a key (and similarly for value).
> > - *
> > - * Note that the hash and key equality functions passed to create_hashtable
> > - * still take 'void *' parameters instead of 'some key *'. This shouldn't be
> > - * a difficult issue as they're only defined and passed once, and the other
> > - * functions will ensure that only valid keys are supplied to them.
> > - *
> > - * The cost for this checking is increased code size and runtime overhead
> > - * - if performance is important, it may be worth switching back to the
> > - * unsafe methods once your program has been debugged with the safe methods.
> > - * This just requires switching to some simple alternative defines - eg:
> > - * #define insert_some hashtable_insert
> > - *
> > - */
> > -
> > -/*****************************************************************************
> > - * create_hashtable
> > -
> > - * @name                    create_hashtable
> > - * @param   minsize         minimum initial size of hashtable
> > - * @param   hashfunction    function for hashing keys
> > - * @param   key_eq_fn       function for determining key equality
> > - * @return                  newly created hashtable or NULL on failure
> > - */
> > -
> > -struct hashtable *
> > -create_hashtable(unsigned int minsize,
> > -                 unsigned int (*hashfunction) (void*),
> > -                 int (*key_eq_fn) (void*,void*));
> > -
> > -/*****************************************************************************
> > - * hashtable_insert
> > -
> > - * @name        hashtable_insert
> > - * @param   h   the hashtable to insert into
> > - * @param   k   the key - hashtable claims ownership and will free on removal
> > - * @param   v   the value - does not claim ownership
> > - * @return      non-zero for successful insertion
> > - *
> > - * This function will cause the table to expand if the insertion would take
> > - * the ratio of entries to table size over the maximum load factor.
> > - *
> > - * This function does not check for repeated insertions with a duplicate key.
> > - * The value returned when using a duplicate key is undefined -- when
> > - * the hashtable changes size, the order of retrieval of duplicate key
> > - * entries is reversed.
> > - * If in doubt, remove before insert.
> > - */
> > -
> > -int
> > -hashtable_insert(struct hashtable *h, void *k, void *v);
> > -
> > -#define DEFINE_HASHTABLE_INSERT(fnname, keytype, valuetype) \
> > -int fnname (struct hashtable *h, keytype *k, valuetype *v) \
> > -{ \
> > -    return hashtable_insert(h,k,v); \
> > -}
> > -
> > -/*****************************************************************************
> > - * hashtable_search
> > -
> > - * @name        hashtable_search
> > - * @param   h   the hashtable to search
> > - * @param   k   the key to search for  - does not claim ownership
> > - * @return      the value associated with the key, or NULL if none found
> > - */
> > -
> > -void *
> > -hashtable_search(struct hashtable *h, void *k);
> > -
> > -#define DEFINE_HASHTABLE_SEARCH(fnname, keytype, valuetype) \
> > -valuetype * fnname (struct hashtable *h, keytype *k) \
> > -{ \
> > -    return (valuetype *) (hashtable_search(h,k)); \
> > -}
> > -
> > -/*****************************************************************************
> > - * hashtable_remove
> > -
> > - * @name        hashtable_remove
> > - * @param   h   the hashtable to remove the item from
> > - * @param   k   the key to search for  - does not claim ownership
> > - * @return      the value associated with the key, or NULL if none found
> > - */
> > -
> > -void * /* returns value */
> > -hashtable_remove(struct hashtable *h, void *k);
> > -
> > -#define DEFINE_HASHTABLE_REMOVE(fnname, keytype, valuetype) \
> > -valuetype * fnname (struct hashtable *h, keytype *k) \
> > -{ \
> > -    return (valuetype *) (hashtable_remove(h,k)); \
> > -}
> > -
> > -
> > -/*****************************************************************************
> > - * hashtable_count
> > -
> > - * @name        hashtable_count
> > - * @param   h   the hashtable
> > - * @return      the number of items stored in the hashtable
> > - */
> > -unsigned int
> > -hashtable_count(struct hashtable *h);
> > -
> > -
> > -/*****************************************************************************
> > - * hashtable_destroy
> > -
> > - * @name        hashtable_destroy
> > - * @param   h   the hashtable
> > - * @param       free_values     whether to call 'free' on the remaining values
> > - */
> > -
> > -void
> > -hashtable_destroy(struct hashtable *h, int free_values);
> > -
> > -#endif /* __HASHTABLE_CWC22_H__ */
> > diff --git a/tools/vtpm_manager/util/hashtable_itr.c b/tools/vtpm_manager/util/hashtable_itr.c
> > deleted file mode 100644
> > index dcf42c8..0000000
> > --- a/tools/vtpm_manager/util/hashtable_itr.c
> > +++ /dev/null
> > @@ -1,236 +0,0 @@
> > -/*
> > - * Copyright (c) 2005, Intel Corp
> > - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> > - * All rights reserved.
> > - *
> > - * Redistribution and use in source and binary forms, with or without
> > - * modification, are permitted provided that the following conditions
> > - * are met:
> > - *
> > - * * Redistributions of source code must retain the above copyright
> > - * notice, this list of conditions and the following disclaimer.
> > - *
> > - * * Redistributions in binary form must reproduce the above copyright
> > - * notice, this list of conditions and the following disclaimer in the
> > - * documentation and/or other materials provided with the distribution.
> > - *
> > - * * Neither the name of the original author; nor the names of any contributors
> > - * may be used to endorse or promote products derived from this software
> > - * without specific prior written permission.
> > - *
> > - *
> > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> > - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> > - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> > - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> > - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> > - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> > - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> > - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> > - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > -*/
> > -
> > -/*
> > - * There are duplicates of this code in:
> > - *  - tools/blktap2/drivers/hashtable_itr.c
> > - */
> > -
> > -#include "hashtable.h"
> > -#include "hashtable_private.h"
> > -#include "hashtable_itr.h"
> > -#include <stdlib.h> /* defines NULL */
> > -
> > -/*****************************************************************************/
> > -/* hashtable_iterator    - iterator constructor */
> > -
> > -struct hashtable_itr *
> > -hashtable_iterator(struct hashtable *h)
> > -{
> > -    unsigned int i, tablelength;
> > -    struct hashtable_itr *itr = (struct hashtable_itr *)
> > -        malloc(sizeof(struct hashtable_itr));
> > -    if (NULL == itr) return NULL;
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_lock(&h->mutex);
> > -#endif
> > -    itr->h = h;
> > -    itr->e = NULL;
> > -    itr->parent = NULL;
> > -    tablelength = h->tablelength;
> > -    itr->index = tablelength;
> > -    if (0 == h->entrycount) {
> > -#ifdef HASHTABLE_THREADED
> > -      pthread_mutex_unlock(&h->mutex);
> > -#endif
> > -      return itr;
> > -    }
> > -
> > -    for (i = 0; i < tablelength; i++)
> > -    {
> > -        if (NULL != h->table[i])
> > -        {
> > -            itr->e = h->table[i];
> > -            itr->index = i;
> > -            break;
> > -        }
> > -    }
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_unlock(&h->mutex);
> > -#endif
> > -    return itr;
> > -}
> > -
> > -/*****************************************************************************/
> > -/* key      - return the key of the (key,value) pair at the current position */
> > -/* value    - return the value of the (key,value) pair at the current position */
> > -
> > -void *
> > -hashtable_iterator_key(struct hashtable_itr *i)
> > -{ return i->e->k; }
> > -
> > -void *
> > -hashtable_iterator_value(struct hashtable_itr *i)
> > -{ return i->e->v; }
> > -
> > -/*****************************************************************************/
> > -/* advance - advance the iterator to the next element
> > - *           returns zero if advanced to end of table */
> > -
> > -int
> > -hashtable_iterator_advance(struct hashtable_itr *itr)
> > -{
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_lock(&itr->h->mutex);
> > -#endif
> > -    unsigned int j,tablelength;
> > -    struct entry **table;
> > -    struct entry *next;
> > -    int ret;
> > -    if (NULL == itr->e) { /* stupidity check */
> > -      ret = 0;
> > -      goto egress;
> > -    }
> > -
> > -    next = itr->e->next;
> > -    if (NULL != next)
> > -    {
> > -        itr->parent = itr->e;
> > -        itr->e = next;
> > -        ret = -1;
> > -        goto egress;
> > -    }
> > -
> > -    tablelength = itr->h->tablelength;
> > -    itr->parent = NULL;
> > -    if (tablelength <= (j = ++(itr->index)))
> > -    {
> > -        itr->e = NULL;
> > -        ret = 0;
> > -        goto egress;
> > -    }
> > -    table = itr->h->table;
> > -    while (NULL == (next = table[j]))
> > -    {
> > -        if (++j >= tablelength)
> > -        {
> > -            itr->index = tablelength;
> > -            itr->e = NULL;
> > -            ret = 0;
> > -            goto egress;
> > -        }
> > -    }
> > -    itr->index = j;
> > -    itr->e = next;
> > -    ret = -1;
> > -
> > - egress:
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_unlock(&itr->h->mutex);
> > -#endif
> > -    return ret;
> > -}
> > -
> > -/*****************************************************************************/
> > -/* remove - remove the entry at the current iterator position
> > - *          and advance the iterator, if there is a successive
> > - *          element.
> > - *          If you want the value, read it before you remove:
> > - *          beware memory leaks if you don't.
> > - *          Returns zero if end of iteration. */
> > -
> > -int
> > -hashtable_iterator_remove(struct hashtable_itr *itr)
> > -{
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_lock(&itr->h->mutex);
> > -#endif
> > -    struct entry *remember_e, *remember_parent;
> > -    int ret;
> > -
> > -    /* Do the removal */
> > -    if (NULL == (itr->parent))
> > -    {
> > -        /* element is head of a chain */
> > -        itr->h->table[itr->index] = itr->e->next;
> > -    } else {
> > -        /* element is mid-chain */
> > -        itr->parent->next = itr->e->next;
> > -    }
> > -    /* itr->e is now outside the hashtable */
> > -    remember_e = itr->e;
> > -    itr->h->entrycount--;
> > -    freekey(remember_e->k);
> > -
> > -    /* Advance the iterator, correcting the parent */
> > -    remember_parent = itr->parent;
> > -    ret = hashtable_iterator_advance(itr);
> > -    if (itr->parent == remember_e) { itr->parent = remember_parent; }
> > -    free(remember_e);
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_unlock(&itr->h->mutex);
> > -#endif
> > -    return ret;
> > -}
> > -
> > -/*****************************************************************************/
> > -int /* returns zero if not found */
> > -hashtable_iterator_search(struct hashtable_itr *itr,
> > -                          struct hashtable *h, void *k)
> > -{
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_lock(&h->mutex);
> > -#endif
> > -    struct entry *e, *parent;
> > -    unsigned int hashvalue, index;
> > -    int ret;
> > -
> > -    hashvalue = hash(h,k);
> > -    index = indexFor(h->tablelength,hashvalue);
> > -
> > -    e = h->table[index];
> > -    parent = NULL;
> > -    while (NULL != e)
> > -    {
> > -        /* Check hash value to short circuit heavier comparison */
> > -        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
> > -        {
> > -            itr->index = index;
> > -            itr->e = e;
> > -            itr->parent = parent;
> > -            itr->h = h;
> > -            ret= -1;
> > -            goto egress;
> > -        }
> > -        parent = e;
> > -        e = e->next;
> > -    }
> > -  ret = 0;
> > -
> > -egress:
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_unlock(&h->mutex);
> > -#endif
> > -    return ret;
> > -}
> > diff --git a/tools/vtpm_manager/util/hashtable_itr.h b/tools/vtpm_manager/util/hashtable_itr.h
> > deleted file mode 100644
> > index 35654e0..0000000
> > --- a/tools/vtpm_manager/util/hashtable_itr.h
> > +++ /dev/null
> > @@ -1,109 +0,0 @@
> > -/*
> > - * Copyright (c) 2005, Intel Corp
> > - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> > - * All rights reserved.
> > - *
> > - * Redistribution and use in source and binary forms, with or without
> > - * modification, are permitted provided that the following conditions
> > - * are met:
> > - *
> > - * * Redistributions of source code must retain the above copyright
> > - * notice, this list of conditions and the following disclaimer.
> > - *
> > - * * Redistributions in binary form must reproduce the above copyright
> > - * notice, this list of conditions and the following disclaimer in the
> > - * documentation and/or other materials provided with the distribution.
> > - *
> > - * * Neither the name of the original author; nor the names of any contributors
> > - * may be used to endorse or promote products derived from this software
> > - * without specific prior written permission.
> > - *
> > - *
> > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> > - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> > - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> > - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> > - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> > - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> > - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> > - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> > - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > -*/
> > -
> > -/*
> > - * There are duplicates of this code in:
> > - *  - tools/blktap2/drivers/hashtable_itr.h
> > - */
> > -
> > -
> > -#ifndef __HASHTABLE_ITR_CWC22__
> > -#define __HASHTABLE_ITR_CWC22__
> > -#include "hashtable.h"
> > -#include "hashtable_private.h" /* needed to enable inlining */
> > -
> > -/*****************************************************************************/
> > -/* This struct is only concrete here to allow the inlining of two of the
> > - * accessor functions. */
> > -struct hashtable_itr
> > -{
> > -    struct hashtable *h;
> > -    struct entry *e;
> > -    struct entry *parent;
> > -    unsigned int index;
> > -};
> > -
> > -
> > -/*****************************************************************************/
> > -/* hashtable_iterator
> > - */
> > -
> > -struct hashtable_itr *
> > -hashtable_iterator(struct hashtable *h);
> > -
> > -/*****************************************************************************/
> > -/* hashtable_iterator_key
> > - * - return the value of the (key,value) pair at the current position */
> > -
> > -void *hashtable_iterator_key(struct hashtable_itr *i);
> > -
> > -/*****************************************************************************/
> > -/* value - return the value of the (key,value) pair at the current position */
> > -
> > -void *hashtable_iterator_value(struct hashtable_itr *i);
> > -
> > -/*****************************************************************************/
> > -/* advance - advance the iterator to the next element
> > - *           returns zero if advanced to end of table */
> > -
> > -int
> > -hashtable_iterator_advance(struct hashtable_itr *itr);
> > -
> > -/*****************************************************************************/
> > -/* remove - remove current element and advance the iterator to the next element
> > - *          NB: if you need the value to free it, read it before
> > - *          removing. ie: beware memory leaks!
> > - *          returns zero if advanced to end of table */
> > -
> > -int
> > -hashtable_iterator_remove(struct hashtable_itr *itr);
> > -
> > -/*****************************************************************************/
> > -/* search - overwrite the supplied iterator, to point to the entry
> > - *          matching the supplied key.
> > -            h points to the hashtable to be searched.
> > - *          returns zero if not found. */
> > -int
> > -hashtable_iterator_search(struct hashtable_itr *itr,
> > -                          struct hashtable *h, void *k);
> > -
> > -#define DEFINE_HASHTABLE_ITERATOR_SEARCH(fnname, keytype) \
> > -int fnname (struct hashtable_itr *i, struct hashtable *h, keytype *k) \
> > -{ \
> > -    return (hashtable_iterator_search(i,h,k)); \
> > -}
> > -
> > -
> > -
> > -#endif /* __HASHTABLE_ITR_CWC22__*/
> > diff --git a/tools/vtpm_manager/util/hashtable_private.h b/tools/vtpm_manager/util/hashtable_private.h
> > deleted file mode 100644
> > index d87a7f9..0000000
> > --- a/tools/vtpm_manager/util/hashtable_private.h
> > +++ /dev/null
> > @@ -1,96 +0,0 @@
> > -/*
> > - * Copyright (c) 2005, Intel Corp
> > - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> > - * All rights reserved.
> > - *
> > - * Redistribution and use in source and binary forms, with or without
> > - * modification, are permitted provided that the following conditions
> > - * are met:
> > - *
> > - * * Redistributions of source code must retain the above copyright
> > - * notice, this list of conditions and the following disclaimer.
> > - *
> > - * * Redistributions in binary form must reproduce the above copyright
> > - * notice, this list of conditions and the following disclaimer in the
> > - * documentation and/or other materials provided with the distribution.
> > - *
> > - * * Neither the name of the original author; nor the names of any contributors
> > - * may be used to endorse or promote products derived from this software
> > - * without specific prior written permission.
> > - *
> > - *
> > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> > - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> > - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> > - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> > - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> > - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> > - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> > - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> > - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > -*/
> > -
> > -/*
> > - * There are duplicates of this code in:
> > - *  - tools/xenstore/hashtable_private.h
> > - *  - tools/blktap2/drivers/hashtable_private.h
> > - */
> > -
> > -#ifndef __HASHTABLE_PRIVATE_CWC22_H__
> > -#define __HASHTABLE_PRIVATE_CWC22_H__
> > -
> > -#include "hashtable.h"
> > -#ifdef HASHTABLE_THREADED
> > -#include <pthread.h>
> > -#endif
> > -
> > -/*****************************************************************************/
> > -struct entry
> > -{
> > -    void *k, *v;
> > -    unsigned int h;
> > -    struct entry *next;
> > -};
> > -
> > -struct hashtable {
> > -    unsigned int tablelength;
> > -    struct entry **table;
> > -    unsigned int entrycount;
> > -    unsigned int loadlimit;
> > -    unsigned int primeindex;
> > -    unsigned int (*hashfn) (void *k);
> > -    int (*eqfn) (void *k1, void *k2);
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_t mutex;
> > -#endif
> > -};
> > -
> > -/*****************************************************************************/
> > -unsigned int
> > -hash(struct hashtable *h, void *k);
> > -
> > -/*****************************************************************************/
> > -/* indexFor */
> > -static inline unsigned int
> > -indexFor(unsigned int tablelength, unsigned int hashvalue) {
> > -    return (hashvalue % tablelength);
> > -};
> > -
> > -/* Only works if tablelength == 2^N */
> > -/*static inline unsigned int
> > -indexFor(unsigned int tablelength, unsigned int hashvalue)
> > -{
> > -    return (hashvalue & (tablelength - 1u));
> > -}
> > -*/
> > -
> > -/*****************************************************************************/
> > -#define freekey(X) free(X)
> > -/*define freekey(X) ; */
> > -
> > -
> > -/*****************************************************************************/
> > -
> > -#endif /* __HASHTABLE_PRIVATE_CWC22_H__*/
> > diff --git a/tools/vtpm_manager/util/log.c b/tools/vtpm_manager/util/log.c
> > deleted file mode 100644
> > index 75fe91a..0000000
> > --- a/tools/vtpm_manager/util/log.c
> > +++ /dev/null
> > @@ -1,142 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -
> > -#include <stdlib.h>
> > -#include <string.h>
> > -#include <stdio.h>
> > -
> > -#include "buffer.h"
> > -#include "tcg.h"
> > -
> > -// Helper code for the consts, eg. to produce messages for error codes.
> > -
> > -typedef struct error_code_entry_t {
> > -  TPM_RESULT code;
> > -  char * code_name;
> > -  char * msg;
> > -} error_code_entry_t;
> > -
> > -static const error_code_entry_t error_msgs [] = {
> > -  { TPM_SUCCESS, "TPM_SUCCESS", "Successful completion of the operation" },
> > -  { TPM_AUTHFAIL, "TPM_AUTHFAIL", "Authentication failed" },
> > -  { TPM_BADINDEX, "TPM_BADINDEX", "The index to a PCR, DIR or other register is incorrect" },
> > -  { TPM_BAD_PARAMETER, "TPM_BAD_PARAMETER", "One or more parameter is bad" },
> > -  { TPM_AUDITFAILURE, "TPM_AUDITFAILURE", "An operation completed successfully but the auditing of that operation failed." },
> > -  { TPM_CLEAR_DISABLED, "TPM_CLEAR_DISABLED", "The clear disable flag is set and all clear operations now require physical access" },
> > -  { TPM_DEACTIVATED, "TPM_DEACTIVATED", "The TPM is deactivated" },
> > -  { TPM_DISABLED, "TPM_DISABLED", "The TPM is disabled" },
> > -  { TPM_DISABLED_CMD, "TPM_DISABLED_CMD", "The target command has been disabled" },
> > -  { TPM_FAIL, "TPM_FAIL", "The operation failed" },
> > -  { TPM_BAD_ORDINAL, "TPM_BAD_ORDINAL", "The ordinal was unknown or inconsistent" },
> > -  { TPM_INSTALL_DISABLED, "TPM_INSTALL_DISABLED", "The ability to install an owner is disabled" },
> > -  { TPM_INVALID_KEYHANDLE, "TPM_INVALID_KEYHANDLE", "The key handle presented was invalid" },
> > -  { TPM_KEYNOTFOUND, "TPM_KEYNOTFOUND", "The target key was not found" },
> > -  { TPM_INAPPROPRIATE_ENC, "TPM_INAPPROPRIATE_ENC", "Unacceptable encryption scheme" },
> > -  { TPM_MIGRATEFAIL, "TPM_MIGRATEFAIL", "Migration authorization failed" },
> > -  { TPM_INVALID_PCR_INFO, "TPM_INVALID_PCR_INFO", "PCR information could not be interpreted" },
> > -  { TPM_NOSPACE, "TPM_NOSPACE", "No room to load key." },
> > -  { TPM_NOSRK, "TPM_NOSRK", "There is no SRK set" },
> > -  { TPM_NOTSEALED_BLOB, "TPM_NOTSEALED_BLOB", "An encrypted blob is invalid or was not created by this TPM" },
> > -  { TPM_OWNER_SET, "TPM_OWNER_SET", "There is already an Owner" },
> > -  { TPM_RESOURCES, "TPM_RESOURCES", "The TPM has insufficient internal resources to perform the requested action." },
> > -  { TPM_SHORTRANDOM, "TPM_SHORTRANDOM", "A random string was too short" },
> > -  { TPM_SIZE, "TPM_SIZE", "The TPM does not have the space to perform the operation." },
> > -  { TPM_WRONGPCRVAL, "TPM_WRONGPCRVAL", "The named PCR value does not match the current PCR value." },
> > -  { TPM_BAD_PARAM_SIZE, "TPM_BAD_PARAM_SIZE", "The paramSize argument to the command has the incorrect value" },
> > -  { TPM_SHA_THREAD, "TPM_SHA_THREAD", "There is no existing SHA-1 thread." },
> > -  { TPM_SHA_ERROR, "TPM_SHA_ERROR", "The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error." },
> > -  { TPM_FAILEDSELFTEST, "TPM_FAILEDSELFTEST", "Self-test has failed and the TPM has shutdown." },
> > -  { TPM_AUTH2FAIL, "TPM_AUTH2FAIL", "The authorization for the second key in a 2 key function failed authorization" },
> > -  { TPM_BADTAG, "TPM_BADTAG", "The tag value sent to for a command is invalid" },
> > -  { TPM_IOERROR, "TPM_IOERROR", "An IO error occurred transmitting information to the TPM" },
> > -  { TPM_ENCRYPT_ERROR, "TPM_ENCRYPT_ERROR", "The encryption process had a problem." },
> > -  { TPM_DECRYPT_ERROR, "TPM_DECRYPT_ERROR", "The decryption process did not complete." },
> > -  { TPM_INVALID_AUTHHANDLE, "TPM_INVALID_AUTHHANDLE", "An invalid handle was used." },
> > -  { TPM_NO_ENDORSEMENT, "TPM_NO_ENDORSEMENT", "The TPM does not a EK installed" },
> > -  { TPM_INVALID_KEYUSAGE, "TPM_INVALID_KEYUSAGE", "The usage of a key is not allowed" },
> > -  { TPM_WRONG_ENTITYTYPE, "TPM_WRONG_ENTITYTYPE", "The submitted entity type is not allowed" },
> > -  { TPM_INVALID_POSTINIT, "TPM_INVALID_POSTINIT", "The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup" },
> > -  { TPM_INAPPROPRIATE_SIG, "TPM_INAPPROPRIATE_SIG", "Signed data cannot include additional DER information" },
> > -  { TPM_BAD_KEY_PROPERTY, "TPM_BAD_KEY_PROPERTY", "The key properties in TPM_KEY_PARMs are not supported by this TPM" },
> > -
> > -  { TPM_BAD_MIGRATION, "TPM_BAD_MIGRATION", "The migration properties of this key are incorrect." },
> > -  { TPM_BAD_SCHEME, "TPM_BAD_SCHEME", "The signature or encryption scheme for this key is incorrect or not permitted in this situation." },
> > -  { TPM_BAD_DATASIZE, "TPM_BAD_DATASIZE", "The size of the data (or blob) parameter is bad or inconsistent with the referenced key" },
> > -  { TPM_BAD_MODE, "TPM_BAD_MODE", "A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob." },
> > -  { TPM_BAD_PRESENCE, "TPM_BAD_PRESENCE", "Either the physicalPresence or physicalPresenceLock bits have the wrong value" },
> > -  { TPM_BAD_VERSION, "TPM_BAD_VERSION", "The TPM cannot perform this version of the capability" },
> > -  { TPM_NO_WRAP_TRANSPORT, "TPM_NO_WRAP_TRANSPORT", "The TPM does not allow for wrapped transport sessions" },
> > -  { TPM_AUDITFAIL_UNSUCCESSFUL, "TPM_AUDITFAIL_UNSUCCESSFUL", "TPM audit construction failed and the underlying command was returning a failure code also" },
> > -  { TPM_AUDITFAIL_SUCCESSFUL, "TPM_AUDITFAIL_SUCCESSFUL", "TPM audit construction failed and the underlying command was returning success" },
> > -  { TPM_NOTRESETABLE, "TPM_NOTRESETABLE", "Attempt to reset a PCR register that does not have the resettable attribute" },
> > -  { TPM_NOTLOCAL, "TPM_NOTLOCAL", "Attempt to reset a PCR register that requires locality and locality modifier not part of command transport" },
> > -  { TPM_BAD_TYPE, "TPM_BAD_TYPE", "Make identity blob not properly typed" },
> > -  { TPM_INVALID_RESOURCE, "TPM_INVALID_RESOURCE", "When saving context identified resource type does not match actual resource" },
> > -  { TPM_NOTFIPS, "TPM_NOTFIPS", "The TPM is attempting to execute a command only available when in FIPS mode" },
> > -  { TPM_INVALID_FAMILY, "TPM_INVALID_FAMILY", "The command is attempting to use an invalid family ID" },
> > -  { TPM_NO_NV_PERMISSION, "TPM_NO_NV_PERMISSION", "The permission to manipulate the NV storage is not available" },
> > -  { TPM_REQUIRES_SIGN, "TPM_REQUIRES_SIGN", "The operation requires a signed command" },
> > -  { TPM_KEY_NOTSUPPORTED, "TPM_KEY_NOTSUPPORTED", "Wrong operation to load an NV key" },
> > -  { TPM_AUTH_CONFLICT, "TPM_AUTH_CONFLICT", "NV_LoadKey blob requires both owner and blob authorization" },
> > -  { TPM_AREA_LOCKED, "TPM_AREA_LOCKED", "The NV area is locked and not writtable" },
> > -  { TPM_BAD_LOCALITY, "TPM_BAD_LOCALITY", "The locality is incorrect for the attempted operation" },
> > -  { TPM_READ_ONLY, "TPM_READ_ONLY", "The NV area is read only and can't be written to" },
> > -  { TPM_PER_NOWRITE, "TPM_PER_NOWRITE", "There is no protection on the write to the NV area" },
> > -  { TPM_FAMILYCOUNT, "TPM_FAMILYCOUNT", "The family count value does not match" },
> > -  { TPM_WRITE_LOCKED, "TPM_WRITE_LOCKED", "The NV area has already been written to" },
> > -  { TPM_BAD_ATTRIBUTES, "TPM_BAD_ATTRIBUTES", "The NV area attributes conflict" },
> > -  { TPM_INVALID_STRUCTURE, "TPM_INVALID_STRUCTURE", "The structure tag and version are invalid or inconsistent" },
> > -  { TPM_KEY_OWNER_CONTROL, "TPM_KEY_OWNER_CONTROL", "The key is under control of the TPM Owner and can only be evicted by the TPM Owner." },
> > -  { TPM_BAD_COUNTER, "TPM_BAD_COUNTER", "The counter handle is incorrect" },
> > -  { TPM_NOT_FULLWRITE, "TPM_NOT_FULLWRITE", "The write is not a complete write of the area" },
> > -  { TPM_CONTEXT_GAP, "TPM_CONTEXT_GAP", "The gap between saved context counts is too large" },
> > -  { TPM_MAXNVWRITES, "TPM_MAXNVWRITES", "The maximum number of NV writes without an owner has been exceeded" },
> > -  { TPM_NOOPERATOR, "TPM_NOOPERATOR", "No operator authorization value is set" },
> > -  { TPM_RESOURCEMISSING, "TPM_RESOURCEMISSING", "The resource pointed to by context is not loaded" },
> > -  { TPM_DELEGATE_LOCK, "TPM_DELEGATE_LOCK", "The delegate administration is locked" },
> > -  { TPM_DELEGATE_FAMILY, "TPM_DELEGATE_FAMILY", "Attempt to manage a family other then the delegated family" },
> > -  { TPM_DELEGATE_ADMIN, "TPM_DELEGATE_ADMIN", "Delegation table management not enabled" },
> > -  { TPM_TRANSPORT_EXCLUSIVE, "TPM_TRANSPORT_EXCLUSIVE", "There was a command executed outside of an exclusive transport session" },
> > -};
> > -
> > -
> > -// helper function for the error codes:
> > -const char* tpm_get_error_name (TPM_RESULT code) {
> > -  // just do a linear scan for now
> > -  unsigned i;
> > -  for (i = 0; i < sizeof(error_msgs)/sizeof(error_msgs[0]); i++)
> > -    if (code == error_msgs[i].code)
> > -      return error_msgs[i].code_name;
> > -
> > -    return("Unknown Error Code");
> > -}
> > diff --git a/tools/vtpm_manager/util/log.h b/tools/vtpm_manager/util/log.h
> > deleted file mode 100644
> > index 1f15f5b..0000000
> > --- a/tools/vtpm_manager/util/log.h
> > +++ /dev/null
> > @@ -1,94 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -
> > -#ifndef __VTPM_LOG_H__
> > -#define __VTPM_LOG_H__
> > -
> > -#include <stdint.h>             // for uint32_t
> > -#include <stddef.h>             // for pointer NULL
> > -
> > -// =========================== LOGGING ==============================
> > -
> > -// the logging module numbers
> > -#define VTPM_LOG_CRYPTO      1
> > -#define VTPM_LOG_BSG         2
> > -#define VTPM_LOG_TXDATA      3
> > -#define VTPM_LOG_TCS         4
> > -#define VTPM_LOG_TCS_DEEP    5
> > -#define VTPM_LOG_VTSP        6
> > -#define VTPM_LOG_VTPM        7
> > -#define VTPM_LOG_VTPM_DEEP   8
> > -#define VTPM_LOG_VTSP_DEEP   9
> > -
> > -static char *module_names[] = { "",
> > -                                "CRYPTO",
> > -                                "BSG",
> > -                                "TXDATA",
> > -                                "TCS",
> > -                                "TCS",
> > -                                "VTSP",
> > -                                "VTPM",
> > -                                "VTPM",
> > -                                "VTSP"
> > -                              };
> > -
> > -// Default to standard logging
> > -#ifndef LOGGING_MODULES
> > -#define LOGGING_MODULES (BITMASK(VTPM_LOG_VTPM))
> > -#endif
> > -
> > -// bit-access macros
> > -#define BITMASK(idx)      ( 1U << (idx) )
> > -#define GETBIT(num,idx)   ( ((num) & BITMASK(idx)) >> idx )
> > -#define SETBIT(num,idx)   (num) |= BITMASK(idx)
> > -#define CLEARBIT(num,idx) (num) &= ( ~ BITMASK(idx) )
> > -
> > -#define vtpmloginfo(module, fmt, args...) \
> > -  if (GETBIT (LOGGING_MODULES, module) == 1) {                         \
> > -    fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); \
> > -  }
> > -
> > -#define vtpmloginfomore(module, fmt, args...) \
> > -  if (GETBIT (LOGGING_MODULES, module) == 1) {                       \
> > -    fprintf (stdout, fmt,##args);                                    \
> > -  }
> > -
> > -#define vtpmlogerror(module, fmt, args...) \
> > -  fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
> > -
> > -//typedef UINT32 tpm_size_t;
> > -
> > -// helper function for the error codes:
> > -const char* tpm_get_error_name (TPM_RESULT code);
> > -
> > -#endif // _VTPM_LOG_H_
> > diff --git a/tools/vtpm_manager/util/tcg.h b/tools/vtpm_manager/util/tcg.h
> > deleted file mode 100644
> > index 5c42913..0000000
> > --- a/tools/vtpm_manager/util/tcg.h
> > +++ /dev/null
> > @@ -1,503 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// tcg.h
> > -//
> > -//  This file contains all the structure and type definitions
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __TCG_H__
> > -#define __TCG_H__
> > -
> > -// This pragma is used to disallow structure padding
> > -#pragma pack(push, 1)
> > -
> > -// *************************** TYPEDEFS *********************************
> > -typedef unsigned char BYTE;
> > -typedef unsigned char BOOL;
> > -typedef unsigned short UINT16;
> > -typedef unsigned int UINT32;
> > -typedef unsigned long long UINT64;
> > -
> > -typedef UINT32 TPM_RESULT;
> > -typedef UINT32 TPM_PCRINDEX;
> > -typedef UINT32 TPM_DIRINDEX;
> > -typedef UINT32 TPM_HANDLE;
> > -typedef TPM_HANDLE TPM_AUTHHANDLE;
> > -typedef TPM_HANDLE TCPA_HASHHANDLE;
> > -typedef TPM_HANDLE TCPA_HMACHANDLE;
> > -typedef TPM_HANDLE TCPA_ENCHANDLE;
> > -typedef TPM_HANDLE TPM_KEY_HANDLE;
> > -typedef TPM_HANDLE TCPA_ENTITYHANDLE;
> > -typedef UINT32 TPM_RESOURCE_TYPE;
> > -typedef UINT32 TPM_COMMAND_CODE;
> > -typedef UINT16 TPM_PROTOCOL_ID;
> > -typedef BYTE TPM_AUTH_DATA_USAGE;
> > -typedef UINT16 TPM_ENTITY_TYPE;
> > -typedef UINT32 TPM_ALGORITHM_ID;
> > -typedef UINT16 TPM_KEY_USAGE;
> > -typedef UINT16 TPM_STARTUP_TYPE;
> > -typedef UINT32 TPM_CAPABILITY_AREA;
> > -typedef UINT16 TPM_ENC_SCHEME;
> > -typedef UINT16 TPM_SIG_SCHEME;
> > -typedef UINT16 TPM_MIGRATE_SCHEME;
> > -typedef UINT16 TPM_PHYSICAL_PRESENCE;
> > -typedef UINT32 TPM_KEY_FLAGS;
> > -
> > -#define TPM_DIGEST_SIZE 20  // Don't change this
> > -typedef BYTE TPM_AUTHDATA[TPM_DIGEST_SIZE];
> > -typedef TPM_AUTHDATA TPM_SECRET;
> > -typedef TPM_AUTHDATA TPM_ENCAUTH;
> > -typedef BYTE TPM_PAYLOAD_TYPE;
> > -typedef UINT16 TPM_TAG;
> > -
> > -// Data Types of the TCS
> > -typedef UINT32 TCS_AUTHHANDLE;  // Handle addressing a authorization session
> > -typedef UINT32 TCS_CONTEXT_HANDLE; // Basic context handle
> > -typedef UINT32 TCS_KEY_HANDLE;  // Basic key handle
> > -
> > -// ************************* STRUCTURES **********************************
> > -
> > -typedef struct TPM_VERSION {
> > -  BYTE major;
> > -  BYTE minor;
> > -  BYTE revMajor;
> > -  BYTE revMinor;
> > -} TPM_VERSION;
> > -
> > -static const TPM_VERSION TPM_STRUCT_VER_1_1 = { 1,1,0,0 };
> > -
> > -typedef struct TPM_DIGEST {
> > -  BYTE digest[TPM_DIGEST_SIZE];
> > -} TPM_DIGEST;
> > -
> > -typedef TPM_DIGEST TPM_PCRVALUE;
> > -typedef TPM_DIGEST TPM_COMPOSITE_HASH;
> > -typedef TPM_DIGEST TPM_DIRVALUE;
> > -typedef TPM_DIGEST TPM_HMAC;
> > -typedef TPM_DIGEST TPM_CHOSENID_HASH;
> > -
> > -typedef struct TPM_NONCE {
> > -  BYTE nonce[TPM_DIGEST_SIZE];
> > -} TPM_NONCE;
> > -
> > -typedef struct TPM_KEY_PARMS {
> > -  TPM_ALGORITHM_ID algorithmID;
> > -  TPM_ENC_SCHEME encScheme;
> > -  TPM_SIG_SCHEME sigScheme;
> > -  UINT32 parmSize;
> > -  BYTE* parms;
> > -} TPM_KEY_PARMS;
> > -
> > -typedef struct TPM_RSA_KEY_PARMS {
> > -  UINT32 keyLength;
> > -  UINT32 numPrimes;
> > -  UINT32 exponentSize;
> > -  BYTE* exponent;
> > -} TPM_RSA_KEY_PARMS;
> > -
> > -typedef struct TPM_STORE_PUBKEY {
> > -  UINT32 keyLength;
> > -  BYTE* key;
> > -} TPM_STORE_PUBKEY;
> > -
> > -typedef struct TPM_PUBKEY {
> > -  TPM_KEY_PARMS algorithmParms;
> > -  TPM_STORE_PUBKEY pubKey;
> > -} TPM_PUBKEY;
> > -
> > -typedef struct TPM_KEY {
> > -  TPM_VERSION         ver;
> > -  TPM_KEY_USAGE       keyUsage;
> > -  TPM_KEY_FLAGS       keyFlags;
> > -  TPM_AUTH_DATA_USAGE authDataUsage;
> > -  TPM_KEY_PARMS       algorithmParms;
> > -  UINT32              PCRInfoSize;
> > -  BYTE*               PCRInfo; // this should be a TPM_PCR_INFO, or NULL
> > -  TPM_STORE_PUBKEY    pubKey;
> > -  UINT32              encDataSize;
> > -  BYTE*               encData;
> > -} TPM_KEY;
> > -
> > -typedef struct TPM_PCR_SELECTION {
> > -  UINT16 sizeOfSelect;        /// in bytes
> > -  BYTE* pcrSelect;
> > -} TPM_PCR_SELECTION;
> > -
> > -typedef struct TPM_PCR_COMPOSITE {
> > -  TPM_PCR_SELECTION select;
> > -  UINT32 valueSize;
> > -  TPM_PCRVALUE* pcrValue;
> > -} TPM_PCR_COMPOSITE;
> > -
> > -
> > -typedef struct TPM_PCR_INFO {
> > -  TPM_PCR_SELECTION pcrSelection;
> > -  TPM_COMPOSITE_HASH digestAtRelease;
> > -  TPM_COMPOSITE_HASH digestAtCreation;
> > -} TPM_PCR_INFO;
> > -
> > -
> > -typedef struct TPM_BOUND_DATA {
> > -  TPM_VERSION ver;
> > -  TPM_PAYLOAD_TYPE payload;
> > -  BYTE* payloadData;
> > -} TPM_BOUND_DATA;
> > -
> > -typedef struct TPM_STORED_DATA {
> > -  TPM_VERSION ver;
> > -  UINT32 sealInfoSize;
> > -  BYTE* sealInfo;
> > -  UINT32 encDataSize;
> > -  BYTE* encData;
> > -} TPM_STORED_DATA;
> > -
> > -typedef struct TCS_AUTH {
> > -  TCS_AUTHHANDLE  AuthHandle;
> > -  TPM_NONCE   NonceOdd;   // system
> > -  TPM_NONCE   NonceEven;   // TPM
> > -  BOOL   fContinueAuthSession;
> > -  TPM_AUTHDATA  HMAC;
> > -} TCS_AUTH;
> > -
> > -// structures for dealing with sizes followed by buffers in all the
> > -// TCG structure.
> > -typedef struct pack_buf_t {
> > -  UINT32 size;
> > -  BYTE * data;
> > -} pack_buf_t;
> > -
> > -typedef struct pack_constbuf_t {
> > -  UINT32 size;
> > -  const BYTE* data;
> > -} pack_constbuf_t;
> > -
> > -
> > -
> > -// **************************** CONSTANTS *********************************
> > -
> > -// BOOL values
> > -#define TRUE 0x01
> > -#define FALSE 0x00
> > -
> > -#define TCPA_MAX_BUFFER_LENGTH 0x2000
> > -
> > -//
> > -// TPM_COMMAND_CODE values
> > -#define TPM_PROTECTED_ORDINAL 0x00000000UL
> > -#define TPM_UNPROTECTED_ORDINAL 0x80000000UL
> > -#define TPM_CONNECTION_ORDINAL 0x40000000UL
> > -#define TPM_VENDOR_ORDINAL 0x20000000UL
> > -
> > -#define TPM_ORD_OIAP                     (10UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_OSAP                     (11UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ChangeAuth               (12UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_TakeOwnership            (13UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ChangeAuthAsymStart      (14UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ChangeAuthAsymFinish     (15UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ChangeAuthOwner          (16UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_Extend                   (20UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_PcrRead                  (21UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_Quote                    (22UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_Seal                     (23UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_Unseal                   (24UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_DirWriteAuth             (25UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_DirRead                  (26UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_UnBind                   (30UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_CreateWrapKey            (31UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_LoadKey                  (32UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_GetPubKey                (33UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_EvictKey                 (34UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_CreateMigrationBlob      (40UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ReWrapKey                (41UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ConvertMigrationBlob     (42UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_AuthorizeMigrationKey    (43UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_CreateMaintenanceArchive (44UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_LoadMaintenanceArchive   (45UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_KillMaintenanceFeature   (46UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_LoadManuMaintPub         (47UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ReadManuMaintPub         (48UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_CertifyKey               (50UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_Sign                     (60UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_GetRandom                (70UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_StirRandom               (71UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SelfTestFull             (80UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SelfTestStartup          (81UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_CertifySelfTest          (82UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ContinueSelfTest         (83UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_GetTestResult            (84UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_Reset                    (90UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_OwnerClear               (91UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_DisableOwnerClear        (92UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ForceClear               (93UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_DisableForceClear        (94UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_GetCapabilitySigned      (100UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_GetCapability            (101UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_GetCapabilityOwner       (102UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_OwnerSetDisable          (110UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_PhysicalEnable           (111UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_PhysicalDisable          (112UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SetOwnerInstall          (113UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_PhysicalSetDeactivated   (114UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SetTempDeactivated       (115UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_CreateEndorsementKeyPair (120UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_MakeIdentity             (121UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ActivateIdentity         (122UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ReadPubek                (124UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_OwnerReadPubek           (125UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_DisablePubekRead         (126UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_GetAuditEvent            (130UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_GetAuditEventSigned      (131UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_GetOrdinalAuditStatus    (140UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SetOrdinalAuditStatus    (141UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_Terminate_Handle         (150UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_Init                     (151UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SaveState                (152UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_Startup                  (153UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SetRedirection           (154UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SHA1Start                (160UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SHA1Update               (161UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SHA1Complete             (162UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SHA1CompleteExtend       (163UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_FieldUpgrade             (170UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SaveKeyContext           (180UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_LoadKeyContext           (181UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SaveAuthContext          (182UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_LoadAuthContext          (183UL + TPM_PROTECTED_ORDINAL)
> > -#define TSC_ORD_PhysicalPresence         (10UL + TPM_CONNECTION_ORDINAL)
> > -
> > -
> > -
> > -//
> > -// TPM_RESULT values
> > -//
> > -// just put in the whole table from spec 1.2
> > -
> > -#define TPM_BASE   0x0 // The start of TPM return codes
> > -#define TPM_VENDOR_ERROR 0x00000400 // Mask to indicate that the error code is vendor specific for vendor specific commands
> > -#define TPM_NON_FATAL  0x00000800 // Mask to indicate that the error code is a non-fatal failure.
> > -
> > -#define TPM_SUCCESS   TPM_BASE // Successful completion of the operation
> > -#define TPM_AUTHFAIL      TPM_BASE + 1 // Authentication failed
> > -#define TPM_BADINDEX      TPM_BASE + 2 // The index to a PCR, DIR or other register is incorrect
> > -#define TPM_BAD_PARAMETER     TPM_BASE + 3 // One or more parameter is bad
> > -#define TPM_AUDITFAILURE     TPM_BASE + 4 // An operation completed successfully but the auditing of that operation failed.
> > -#define TPM_CLEAR_DISABLED     TPM_BASE + 5 // The clear disable flag is set and all clear operations now require physical access
> > -#define TPM_DEACTIVATED     TPM_BASE + 6 // The TPM is deactivated
> > -#define TPM_DISABLED      TPM_BASE + 7 // The TPM is disabled
> > -#define TPM_DISABLED_CMD     TPM_BASE + 8 // The target command has been disabled
> > -#define TPM_FAIL       TPM_BASE + 9 // The operation failed
> > -#define TPM_BAD_ORDINAL     TPM_BASE + 10 // The ordinal was unknown or inconsistent
> > -#define TPM_INSTALL_DISABLED   TPM_BASE + 11 // The ability to install an owner is disabled
> > -#define TPM_INVALID_KEYHANDLE  TPM_BASE + 12 // The key handle presented was invalid
> > -#define TPM_KEYNOTFOUND     TPM_BASE + 13 // The target key was not found
> > -#define TPM_INAPPROPRIATE_ENC  TPM_BASE + 14 // Unacceptable encryption scheme
> > -#define TPM_MIGRATEFAIL     TPM_BASE + 15 // Migration authorization failed
> > -#define TPM_INVALID_PCR_INFO   TPM_BASE + 16 // PCR information could not be interpreted
> > -#define TPM_NOSPACE      TPM_BASE + 17 // No room to load key.
> > -#define TPM_NOSRK       TPM_BASE + 18 // There is no SRK set
> > -#define TPM_NOTSEALED_BLOB     TPM_BASE + 19 // An encrypted blob is invalid or was not created by this TPM
> > -#define TPM_OWNER_SET      TPM_BASE + 20 // There is already an Owner
> > -#define TPM_RESOURCES      TPM_BASE + 21 // The TPM has insufficient internal resources to perform the requested action.
> > -#define TPM_SHORTRANDOM     TPM_BASE + 22 // A random string was too short
> > -#define TPM_SIZE       TPM_BASE + 23 // The TPM does not have the space to perform the operation.
> > -#define TPM_WRONGPCRVAL     TPM_BASE + 24 // The named PCR value does not match the current PCR value.
> > -#define TPM_BAD_PARAM_SIZE     TPM_BASE + 25 // The paramSize argument to the command has the incorrect value
> > -#define TPM_SHA_THREAD      TPM_BASE + 26 // There is no existing SHA-1 thread.
> > -#define TPM_SHA_ERROR      TPM_BASE + 27 // The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error.
> > -#define TPM_FAILEDSELFTEST     TPM_BASE + 28 // Self-test has failed and the TPM has shutdown.
> > -#define TPM_AUTH2FAIL      TPM_BASE + 29 // The authorization for the second key in a 2 key function failed authorization
> > -#define TPM_BADTAG       TPM_BASE + 30 // The tag value sent to for a command is invalid
> > -#define TPM_IOERROR      TPM_BASE + 31 // An IO error occurred transmitting information to the TPM
> > -#define TPM_ENCRYPT_ERROR     TPM_BASE + 32 // The encryption process had a problem.
> > -#define TPM_DECRYPT_ERROR     TPM_BASE + 33 // The decryption process did not complete.
> > -#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 // An invalid handle was used.
> > -#define TPM_NO_ENDORSEMENT     TPM_BASE + 35 // The TPM does not a EK installed
> > -#define TPM_INVALID_KEYUSAGE   TPM_BASE + 36 // The usage of a key is not allowed
> > -#define TPM_WRONG_ENTITYTYPE   TPM_BASE + 37 // The submitted entity type is not allowed
> > -#define TPM_INVALID_POSTINIT   TPM_BASE + 38 // The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup
> > -#define TPM_INAPPROPRIATE_SIG  TPM_BASE + 39 // Signed data cannot include additional DER information
> > -#define TPM_BAD_KEY_PROPERTY   TPM_BASE + 40 // The key properties in TPM_KEY_PARMs are not supported by this TPM
> > -
> > -#define TPM_BAD_MIGRATION      TPM_BASE + 41 // The migration properties of this key are incorrect.
> > -#define TPM_BAD_SCHEME       TPM_BASE + 42 // The signature or encryption scheme for this key is incorrect or not permitted in this situation.
> > -#define TPM_BAD_DATASIZE      TPM_BASE + 43 // The size of the data (or blob) parameter is bad or inconsistent with the referenced key
> > -#define TPM_BAD_MODE       TPM_BASE + 44 // A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob.
> > -#define TPM_BAD_PRESENCE      TPM_BASE + 45 // Either the physicalPresence or physicalPresenceLock bits have the wrong value
> > -#define TPM_BAD_VERSION      TPM_BASE + 46 // The TPM cannot perform this version of the capability
> > -#define TPM_NO_WRAP_TRANSPORT     TPM_BASE + 47 // The TPM does not allow for wrapped transport sessions
> > -#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 // TPM audit construction failed and the underlying command was returning a failure code also
> > -#define TPM_AUDITFAIL_SUCCESSFUL   TPM_BASE + 49 // TPM audit construction failed and the underlying command was returning success
> > -#define TPM_NOTRESETABLE      TPM_BASE + 50 // Attempt to reset a PCR register that does not have the resettable attribute
> > -#define TPM_NOTLOCAL       TPM_BASE + 51 // Attempt to reset a PCR register that requires locality and locality modifier not part of command transport
> > -#define TPM_BAD_TYPE       TPM_BASE + 52 // Make identity blob not properly typed
> > -#define TPM_INVALID_RESOURCE     TPM_BASE + 53 // When saving context identified resource type does not match actual resource
> > -#define TPM_NOTFIPS       TPM_BASE + 54 // The TPM is attempting to execute a command only available when in FIPS mode
> > -#define TPM_INVALID_FAMILY      TPM_BASE + 55 // The command is attempting to use an invalid family ID
> > -#define TPM_NO_NV_PERMISSION     TPM_BASE + 56 // The permission to manipulate the NV storage is not available
> > -#define TPM_REQUIRES_SIGN      TPM_BASE + 57 // The operation requires a signed command
> > -#define TPM_KEY_NOTSUPPORTED     TPM_BASE + 58 // Wrong operation to load an NV key
> > -#define TPM_AUTH_CONFLICT      TPM_BASE + 59 // NV_LoadKey blob requires both owner and blob authorization
> > -#define TPM_AREA_LOCKED      TPM_BASE + 60 // The NV area is locked and not writtable
> > -#define TPM_BAD_LOCALITY      TPM_BASE + 61 // The locality is incorrect for the attempted operation
> > -#define TPM_READ_ONLY       TPM_BASE + 62 // The NV area is read only and can't be written to
> > -#define TPM_PER_NOWRITE      TPM_BASE + 63 // There is no protection on the write to the NV area
> > -#define TPM_FAMILYCOUNT      TPM_BASE + 64 // The family count value does not match
> > -#define TPM_WRITE_LOCKED      TPM_BASE + 65 // The NV area has already been written to
> > -#define TPM_BAD_ATTRIBUTES      TPM_BASE + 66 // The NV area attributes conflict
> > -#define TPM_INVALID_STRUCTURE     TPM_BASE + 67 // The structure tag and version are invalid or inconsistent
> > -#define TPM_KEY_OWNER_CONTROL     TPM_BASE + 68 // The key is under control of the TPM Owner and can only be evicted by the TPM Owner.
> > -#define TPM_BAD_COUNTER      TPM_BASE + 69 // The counter handle is incorrect
> > -#define TPM_NOT_FULLWRITE      TPM_BASE + 70 // The write is not a complete write of the area
> > -#define TPM_CONTEXT_GAP      TPM_BASE + 71 // The gap between saved context counts is too large
> > -#define TPM_MAXNVWRITES      TPM_BASE + 72 // The maximum number of NV writes without an owner has been exceeded
> > -#define TPM_NOOPERATOR       TPM_BASE + 73 // No operator authorization value is set
> > -#define TPM_RESOURCEMISSING     TPM_BASE + 74 // The resource pointed to by context is not loaded
> > -#define TPM_DELEGATE_LOCK      TPM_BASE + 75 // The delegate administration is locked
> > -#define TPM_DELEGATE_FAMILY     TPM_BASE + 76 // Attempt to manage a family other then the delegated family
> > -#define TPM_DELEGATE_ADMIN      TPM_BASE + 77 // Delegation table management not enabled
> > -#define TPM_TRANSPORT_EXCLUSIVE    TPM_BASE + 78 // There was a command executed outside of an exclusive transport session
> > -
> > -// TPM_STARTUP_TYPE values
> > -#define TPM_ST_CLEAR 0x0001
> > -#define TPM_ST_STATE 0x0002
> > -#define TPM_ST_DEACTIVATED 0x003
> > -
> > -// TPM_TAG values
> > -#define TPM_TAG_RQU_COMMAND 0x00c1
> > -#define TPM_TAG_RQU_AUTH1_COMMAND 0x00c2
> > -#define TPM_TAG_RQU_AUTH2_COMMAND 0x00c3
> > -#define TPM_TAG_RSP_COMMAND 0x00c4
> > -#define TPM_TAG_RSP_AUTH1_COMMAND 0x00c5
> > -#define TPM_TAG_RSP_AUTH2_COMMAND 0x00c6
> > -
> > -// TPM_PAYLOAD_TYPE values
> > -#define TPM_PT_ASYM 0x01
> > -#define TPM_PT_BIND 0x02
> > -#define TPM_PT_MIGRATE 0x03
> > -#define TPM_PT_MAINT 0x04
> > -#define TPM_PT_SEAL 0x05
> > -
> > -// TPM_ENTITY_TYPE values
> > -#define TPM_ET_KEYHANDLE 0x0001
> > -#define TPM_ET_OWNER 0x0002
> > -#define TPM_ET_DATA 0x0003
> > -#define TPM_ET_SRK 0x0004
> > -#define TPM_ET_KEY 0x0005
> > -
> > -/// TPM_ResourceTypes
> > -#define TPM_RT_KEY      0x00000001
> > -#define TPM_RT_AUTH     0x00000002
> > -#define TPM_RT_TRANS    0x00000004
> > -#define TPM_RT_CONTEXT  0x00000005
> > -
> > -// TPM_PROTOCOL_ID values
> > -#define TPM_PID_OIAP 0x0001
> > -#define TPM_PID_OSAP 0x0002
> > -#define TPM_PID_ADIP 0x0003
> > -#define TPM_PID_ADCP 0x0004
> > -#define TPM_PID_OWNER 0x0005
> > -
> > -// TPM_ALGORITHM_ID values
> > -#define TPM_ALG_RSA 0x00000001
> > -#define TPM_ALG_DES 0x00000002
> > -#define TPM_ALG_3DES 0X00000003
> > -#define TPM_ALG_SHA 0x00000004
> > -#define TPM_ALG_HMAC 0x00000005
> > -#define TCPA_ALG_AES 0x00000006
> > -
> > -// TPM_ENC_SCHEME values
> > -#define TPM_ES_NONE 0x0001
> > -#define TPM_ES_RSAESPKCSv15 0x0002
> > -#define TPM_ES_RSAESOAEP_SHA1_MGF1 0x0003
> > -
> > -// TPM_SIG_SCHEME values
> > -#define TPM_SS_NONE 0x0001
> > -#define TPM_SS_RSASSAPKCS1v15_SHA1 0x0002
> > -#define TPM_SS_RSASSAPKCS1v15_DER 0x0003
> > -
> > -// TPM_KEY_USAGE values
> > -#define TPM_KEY_EK 0x0000
> > -#define TPM_KEY_SIGNING 0x0010
> > -#define TPM_KEY_STORAGE 0x0011
> > -#define TPM_KEY_IDENTITY 0x0012
> > -#define TPM_KEY_AUTHCHANGE 0X0013
> > -#define TPM_KEY_BIND 0x0014
> > -#define TPM_KEY_LEGACY 0x0015
> > -
> > -// TPM_AUTH_DATA_USAGE values
> > -#define TPM_AUTH_NEVER 0x00
> > -#define TPM_AUTH_ALWAYS 0x01
> > -
> > -// Key Handle of owner and srk
> > -#define TPM_OWNER_KEYHANDLE 0x40000001
> > -#define TPM_SRK_KEYHANDLE 0x40000000
> > -
> > -// ---------------------- Functions for checking TPM_RESULTs -----------------
> > -
> > -#include <stdio.h>
> > -
> > -// FIXME: Review use of these and delete unneeded ones.
> > -
> > -// these are really badly dependent on local structure:
> > -// DEPENDS: local var 'status' of type TPM_RESULT
> > -// DEPENDS: label 'abort_egress' which cleans up and returns the status
> > -#define ERRORDIE(s) do { status = s; \
> > -                         fprintf (stderr, "*** ERRORDIE in %s at %s: %i\n", __func__, __FILE__, __LINE__); \
> > -                         goto abort_egress; } \
> > -                    while (0)
> > -
> > -// DEPENDS: local var 'status' of type TPM_RESULT
> > -// DEPENDS: label 'abort_egress' which cleans up and returns the status
> > -// Try command c. If it fails, set status to s and goto abort.
> > -#define TPMTRY(s,c) if (c != TPM_SUCCESS) { \
> > -                       status = s; \
> > -                       printf("ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
> > -                       goto abort_egress; \
> > -                    } else {\
> > -                       status = c; \
> > -                    }
> > -
> > -// Try command c. If it fails, print error message, set status to actual return code. Goto abort
> > -#define TPMTRYRETURN(c) do { status = c; \
> > -                             if (status != TPM_SUCCESS) { \
> > -                               fprintf(stderr, "ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
> > -                               goto abort_egress; \
> > -                             } \
> > -                        } while(0)
> > -
> > -
> > -#pragma pack(pop)
> > -
> > -#endif //__TCPA_H__
> > diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c
> > index 3b89223..0ba1d55 100644
> > --- a/tools/xenstore/hashtable.c
> > +++ b/tools/xenstore/hashtable.c
> > @@ -3,7 +3,6 @@
> >  /*
> >   * There are duplicates of this code in:
> >   *  - tools/blktap2/drivers/hashtable.c
> > - *  - tools/vtpm_manager/util/hashtable.c
> >   */
> >
> >  #include "hashtable.h"
> > diff --git a/tools/xenstore/hashtable.h b/tools/xenstore/hashtable.h
> > index 8e6bb5b..4d68223 100644
> > --- a/tools/xenstore/hashtable.h
> > +++ b/tools/xenstore/hashtable.h
> > @@ -3,7 +3,6 @@
> >  /*
> >   * There are duplicates of this code in:
> >   *  - tools/blktap2/drivers/hashtable.h
> > - *  - tools/vtpm_manager/util/hashtable.h
> >   */
> >
> >  #ifndef __HASHTABLE_CWC22_H__
> > diff --git a/tools/xenstore/hashtable_private.h b/tools/xenstore/hashtable_private.h
> > index cabaffe..a08559d 100644
> > --- a/tools/xenstore/hashtable_private.h
> > +++ b/tools/xenstore/hashtable_private.h
> > @@ -3,7 +3,6 @@
> >  /*
> >   * There are duplicates of this code in:
> >   *  - tools/blktap2/drivers/hashtable_private.h
> > - *  - tools/vtpm_manager/util/hashtable_private.h
> >   */
> >
> >  #ifndef __HASHTABLE_PRIVATE_CWC22_H__
> > diff --git a/tools/xm-test/configure.ac b/tools/xm-test/configure.ac
> > index ad1eb78..c142140 100644
> > --- a/tools/xm-test/configure.ac
> > +++ b/tools/xm-test/configure.ac
> > @@ -143,7 +143,6 @@ AC_CONFIG_FILES([
> >      tests/unpause/Makefile
> >      tests/vcpu-pin/Makefile
> >      tests/vcpu-disable/Makefile
> > -    tests/vtpm/Makefile
> >      tests/xapi/Makefile
> >      tests/enforce_dom0_cpus/Makefile
> >      tests/cpupool/Makefile
> > diff --git a/tools/xm-test/grouptest/default b/tools/xm-test/grouptest/default
> > index f0516b2..e04591b 100644
> > --- a/tools/xm-test/grouptest/default
> > +++ b/tools/xm-test/grouptest/default
> > @@ -27,5 +27,4 @@ sysrq
> >  unpause
> >  vcpu-disable
> >  vcpu-pin
> > -vtpm
> >  xapi
> > diff --git a/tools/xm-test/grouptest/medium b/tools/xm-test/grouptest/medium
> > index bafc988..5c3e1b1 100644
> > --- a/tools/xm-test/grouptest/medium
> > +++ b/tools/xm-test/grouptest/medium
> > @@ -22,4 +22,3 @@ sysrq 01_sysrq_basic_neg.test 02_sysrq_sync_pos.test
> >  unpause
> >  vcpu-disable
> >  vcpu-pin
> > -vtpm
> > diff --git a/tools/xm-test/grouptest/xapi b/tools/xm-test/grouptest/xapi
> > index 3b04921..7a08b77 100644
> > --- a/tools/xm-test/grouptest/xapi
> > +++ b/tools/xm-test/grouptest/xapi
> > @@ -1,2 +1 @@
> >  xapi
> > -vtpm 09_vtpm-xapi.test
> > diff --git a/tools/xm-test/lib/XmTestLib/XenDomain.py b/tools/xm-test/lib/XmTestLib/XenDomain.py
> > index ae8c550..3ba7433 100644
> > --- a/tools/xm-test/lib/XmTestLib/XenDomain.py
> > +++ b/tools/xm-test/lib/XmTestLib/XenDomain.py
> > @@ -59,7 +59,6 @@ class XenConfig:
> >          # These options need to be lists
> >          self.defaultOpts["disk"] = []
> >          self.defaultOpts["vif"]  = []
> > -        self.defaultOpts["vtpm"] = []
> >
> >          self.opts = self.defaultOpts
> >
> > diff --git a/tools/xm-test/tests/Makefile.am b/tools/xm-test/tests/Makefile.am
> > index 8d673ed..455f50c 100644
> > --- a/tools/xm-test/tests/Makefile.am
> > +++ b/tools/xm-test/tests/Makefile.am
> > @@ -25,7 +25,6 @@ SUBDIRS =                     \
> >                 unpause         \
> >                 vcpu-disable    \
> >                 vcpu-pin        \
> > -               vtpm            \
> >                 enforce_dom0_cpus       \
> >                 save restore migrate    \
> >                 cpupool
> > diff --git a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py b/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
> > deleted file mode 100644
> > index dfd1227..0000000
> > --- a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
> > +++ /dev/null
> > @@ -1,40 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -# Positive Test: create domain with virtual TPM attached at build time,
> > -#                verify list
> > -
> > -
> > -from XmTestLib import *
> > -from vtpm_utils import *
> > -import commands
> > -import os
> > -import atexit
> > -
> > -config = {"vtpm":"instance=1,backend=0"}
> > -domain = XmTestDomain(extraConfig=config)
> > -
> > -try:
> > -    domain.start(noConsole=True)
> > -except DomainError, e:
> > -    if verbose:
> > -        print e.extra
> > -    vtpm_cleanup(domain.getName())
> > -    FAIL("Unable to create domain")
> > -
> > -
> > -domName = domain.getName()
> > -
> > -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> > -
> > -status, output = traceCommand("xm vtpm-list %s" % domain.getId())
> > -eyecatcher = "/local/domain/0/backend/vtpm"
> > -where = output.find(eyecatcher)
> > -if status != 0:
> > -    FAIL("xm vtpm-list returned bad status, expected 0, status is %i" % status)
> > -elif where < 0:
> > -    FAIL("Fail to list virtual TPM device")
> > -
> > -domain.stop()
> > diff --git a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py b/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
> > deleted file mode 100644
> > index a18cbab..0000000
> > --- a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
> > +++ /dev/null
> > @@ -1,49 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -# Positive Test: create domain with virtual TPM attached at build time,
> > -#                check list of pcrs
> > -
> > -from XmTestLib import *
> > -from vtpm_utils import *
> > -import commands
> > -import os
> > -import os.path
> > -import atexit
> > -
> > -config = {"vtpm":"instance=1,backend=0"}
> > -domain = XmTestDomain(extraConfig=config)
> > -domName = domain.getName()
> > -
> > -try:
> > -    console = domain.start()
> > -except DomainError, e:
> > -    if verbose:
> > -        print e.extra
> > -    FAIL("Unable to create domain (%s)" % domName)
> > -
> > -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> > -
> > -try:
> > -    console.sendInput("input")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL(str(e))
> > -
> > -try:
> > -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("No result from dumping the PCRs")
> > -
> > -if re.search("No such file",run["output"]):
> > -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> > -
> > -domain.closeConsole()
> > -
> > -domain.stop()
> > -
> > -if not re.search("PCR-00:",run["output"]):
> > -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> > diff --git a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py b/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
> > deleted file mode 100644
> > index b863f27..0000000
> > --- a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
> > +++ /dev/null
> > @@ -1,99 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -# Positive Test: create domain with virtual TPM attached at build time,
> > -#                check list of pcrs; suspend and resume the domain and
> > -#                check list of pcrs again
> > -
> > -from XmTestLib import *
> > -from vtpm_utils import *
> > -import commands
> > -import os
> > -import os.path
> > -import atexit
> > -
> > -config = {"vtpm":"instance=1,backend=0"}
> > -domain = XmTestDomain(extraConfig=config)
> > -domName = domain.getName()
> > -consoleHistory = ""
> > -
> > -try:
> > -    console = domain.start()
> > -except DomainError, e:
> > -    if verbose:
> > -        print e.extra
> > -    FAIL("Unable to create domain (%s)" % domName)
> > -
> > -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> > -
> > -try:
> > -    console.sendInput("input")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL(str(e))
> > -
> > -try:
> > -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("No result from dumping the PCRs")
> > -
> > -if re.search("No such file",run["output"]):
> > -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> > -
> > -consoleHistory = console.getHistory()
> > -domain.closeConsole()
> > -
> > -loop = 0
> > -while loop < 3:
> > -    try:
> > -        status, ouptut = traceCommand("xm save %s %s.save" %
> > -                                      (domName, domName),
> > -                                      timeout=30)
> > -
> > -    except TimeoutError, e:
> > -        saveLog(consoleHistory)
> > -        FAIL(str(e))
> > -
> > -    if status != 0:
> > -        saveLog(consoleHistory)
> > -        FAIL("xm save did not succeed")
> > -
> > -    try:
> > -        status, ouptut = traceCommand("xm restore %s.save" %
> > -                                      (domName),
> > -                                      timeout=30)
> > -    except TimeoutError, e:
> > -        os.remove("%s.save" % domName)
> > -        saveLog(consoleHistory)
> > -        FAIL(str(e))
> > -
> > -    os.remove("%s.save" % domName)
> > -
> > -    if status != 0:
> > -        saveLog(consoleHistory)
> > -        FAIL("xm restore did not succeed")
> > -
> > -    try:
> > -        console = domain.getConsole()
> > -    except ConsoleError, e:
> > -        FAIL(str(e))
> > -
> > -    try:
> > -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -    except ConsoleError, e:
> > -        saveLog(console.getHistory())
> > -        FAIL(str(e))
> > -
> > -    if not re.search("PCR-00:",run["output"]):
> > -        saveLog(console.getHistory())
> > -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> > -
> > -    loop += 1
> > -
> > -domain.closeConsole()
> > -
> > -domain.stop()
> > -
> > diff --git a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py b/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
> > deleted file mode 100644
> > index ccc8b73..0000000
> > --- a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
> > +++ /dev/null
> > @@ -1,93 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -# Positive Test: create domain with virtual TPM attached at build time,
> > -#                check list of pcrs; locally migrate the domain and
> > -#                check list of pcrs again
> > -#                This test does local live migration.
> > -
> > -from XmTestLib import *
> > -from vtpm_utils import *
> > -import commands
> > -import os
> > -import os.path
> > -import atexit
> > -
> > -config = {"vtpm":"instance=1,backend=0"}
> > -domain = XmTestDomain(extraConfig=config)
> > -domName = domain.getName()
> > -consoleHistory = ""
> > -
> > -try:
> > -    console = domain.start()
> > -except DomainError, e:
> > -    if verbose:
> > -        print e.extra
> > -    FAIL("Unable to create domain (%s)" % domName)
> > -
> > -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> > -
> > -try:
> > -    console.sendInput("input")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL(str(e))
> > -
> > -try:
> > -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("No result from dumping the PCRs")
> > -
> > -if re.search("No such file",run["output"]):
> > -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> > -
> > -consoleHistory = console.getHistory()
> > -domain.closeConsole()
> > -
> > -old_domid = domid(domName)
> > -
> > -loop = 0
> > -while loop < 3:
> > -    try:
> > -        status, ouptut = traceCommand("xm migrate -l %s localhost" %
> > -                                      domName,
> > -                                      timeout=90)
> > -    except TimeoutError, e:
> > -        saveLog(consoleHistory)
> > -        FAIL(str(e))
> > -
> > -    if status != 0:
> > -        saveLog(consoleHistory)
> > -        FAIL("xm migrate did not succeed. External device migration activated?")
> > -
> > -
> > -    domName = domain.getName()
> > -    new_domid = domid(domName)
> > -
> > -    if (old_domid == new_domid):
> > -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> > -             (old_domid,loop))
> > -
> > -    try:
> > -        console = domain.getConsole()
> > -    except ConsoleError, e:
> > -        FAIL(str(e))
> > -
> > -    try:
> > -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -    except ConsoleError, e:
> > -        saveLog(console.getHistory())
> > -        FAIL("No result from dumping the PCRs")
> > -
> > -    if not re.search("PCR-00:",run["output"]):
> > -        saveLog(console.getHistory())
> > -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> > -
> > -    loop += 1
> > -
> > -domain.closeConsole()
> > -
> > -domain.stop()
> > diff --git a/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py b/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py
> > deleted file mode 100644
> > index 57b87df..0000000
> > --- a/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py
> > +++ /dev/null
> > @@ -1,93 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -# Positive Test: create domain with virtual TPM attached at build time,
> > -#                check list of pcrs; locally migrate the domain and
> > -#                check list of pcrs again
> > -#                This test does local (non-live) migration.
> > -
> > -from XmTestLib import *
> > -from vtpm_utils import *
> > -import commands
> > -import os
> > -import os.path
> > -import atexit
> > -
> > -config = {"vtpm":"instance=1,backend=0"}
> > -domain = XmTestDomain(extraConfig=config)
> > -domName = domain.getName()
> > -consoleHistory = ""
> > -
> > -try:
> > -    console = domain.start()
> > -except DomainError, e:
> > -    if verbose:
> > -        print e.extra
> > -    FAIL("Unable to create domain (%s)" % domName)
> > -
> > -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> > -
> > -try:
> > -    console.sendInput("input")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL(str(e))
> > -
> > -try:
> > -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("No result from dumping the PCRs")
> > -
> > -if re.search("No such file",run["output"]):
> > -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> > -
> > -consoleHistory = console.getHistory()
> > -domain.closeConsole()
> > -
> > -old_domid = domid(domName)
> > -
> > -loop = 0
> > -while loop < 3:
> > -    try:
> > -        status, ouptut = traceCommand("xm migrate %s localhost" %
> > -                                      domName,
> > -                                      timeout=90)
> > -    except TimeoutError, e:
> > -        saveLog(consoleHistory)
> > -        FAIL(str(e))
> > -
> > -    if status != 0:
> > -        saveLog(consoleHistory)
> > -        FAIL("xm migrate did not succeed. External device migration activated?")
> > -
> > -
> > -    domName = domain.getName()
> > -    new_domid = domid(domName)
> > -
> > -    if (old_domid == new_domid):
> > -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> > -             (old_domid,loop))
> > -
> > -    try:
> > -        console = domain.getConsole()
> > -    except ConsoleError, e:
> > -        FAIL(str(e))
> > -
> > -    try:
> > -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -    except ConsoleError, e:
> > -        saveLog(console.getHistory())
> > -        FAIL("No result from dumping the PCRs")
> > -
> > -    if not re.search("PCR-00:",run["output"]):
> > -        saveLog(console.getHistory())
> > -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> > -
> > -    loop += 1
> > -
> > -domain.closeConsole()
> > -
> > -domain.stop()
> > diff --git a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py b/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
> > deleted file mode 100644
> > index c70691d..0000000
> > --- a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
> > +++ /dev/null
> > @@ -1,125 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -# Positive Test: create domain with virtual TPM attached at build time,
> > -#                extend a pcr
> > -#                check list of pcrs; suspend and resume the domain and
> > -#                check list of pcrs again and validate extended pcr
> > -
> > -from XmTestLib import *
> > -from vtpm_utils import *
> > -import commands
> > -import os
> > -import os.path
> > -import atexit
> > -
> > -config = {"vtpm":"instance=1,backend=0"}
> > -domain = XmTestDomain(extraConfig=config)
> > -domName = domain.getName()
> > -consoleHistory = ""
> > -
> > -try:
> > -    console = domain.start()
> > -except DomainError, e:
> > -    if verbose:
> > -        print e.extra
> > -    FAIL("Unable to create domain (%s)" % domName)
> > -
> > -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> > -
> > -try:
> > -    console.sendInput("input")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL(str(e))
> > -
> > -try:
> > -    run = console.runCmd("mknod /dev/tpm0 c 10 224")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("Error while creating /dev/tpm0")
> > -
> > -try:
> > -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("Error while extending PCR 0")
> > -
> > -try:
> > -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("No result from dumping the PCRs")
> > -
> > -
> > -if re.search("No such file",run["output"]):
> > -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> > -
> > -if not re.search("PCR-00:",run["output"]):
> > -    saveLog(console.getHistory())
> > -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> > -
> > -if not re.search("PCR-00: 1E A7 BD",run["output"]):
> > -    saveLog(console.getHistory())
> > -    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
> > -
> > -consoleHistory = console.getHistory()
> > -domain.closeConsole()
> > -
> > -loop = 0
> > -while loop < 3:
> > -    try:
> > -        status, ouptut = traceCommand("xm save %s %s.save" %
> > -                                      (domName, domName),
> > -                                      timeout=30)
> > -
> > -    except TimeoutError, e:
> > -        saveLog(consoleHistory)
> > -        FAIL(str(e))
> > -
> > -    if status != 0:
> > -        saveLog(consoleHistory)
> > -        FAIL("xm save did not succeed")
> > -
> > -    try:
> > -        status, ouptut = traceCommand("xm restore %s.save" %
> > -                                      (domName),
> > -                                      timeout=30)
> > -    except TimeoutError, e:
> > -        os.remove("%s.save" % domName)
> > -        saveLog(consoleHistory)
> > -        FAIL(str(e))
> > -
> > -    os.remove("%s.save" % domName)
> > -
> > -    if status != 0:
> > -        saveLog(consoleHistory)
> > -        FAIL("xm restore did not succeed")
> > -
> > -    try:
> > -        console = domain.getConsole()
> > -    except ConsoleError, e:
> > -        FAIL(str(e))
> > -
> > -    try:
> > -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -    except ConsoleError, e:
> > -        saveLog(console.getHistory())
> > -        FAIL(str(e))
> > -
> > -    if not re.search("PCR-00:",run["output"]):
> > -        saveLog(console.getHistory())
> > -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> > -
> > -    if not re.search("PCR-00: 1E A7 BD",run["output"]):
> > -        saveLog(console.getHistory())
> > -        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
> > -
> > -    loop += 1
> > -
> > -domain.closeConsole()
> > -
> > -domain.stop()
> > -
> > diff --git a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py b/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
> > deleted file mode 100644
> > index 4ff3360..0000000
> > --- a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
> > +++ /dev/null
> > @@ -1,119 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -# Positive Test: create domain with virtual TPM attached at build time,
> > -#                extend a pcr
> > -#                check list of pcrs; locally migrate the domain and
> > -#                check list of pcrs again and validate extended pcr
> > -#                This test does local live migration.
> > -
> > -from XmTestLib import *
> > -from vtpm_utils import *
> > -import commands
> > -import os
> > -import os.path
> > -import atexit
> > -
> > -config = {"vtpm":"instance=1,backend=0"}
> > -domain = XmTestDomain(extraConfig=config)
> > -domName = domain.getName()
> > -consoleHistory = ""
> > -
> > -try:
> > -    console = domain.start()
> > -except DomainError, e:
> > -    if verbose:
> > -        print e.extra
> > -    FAIL("Unable to create domain (%s)" % domName)
> > -
> > -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> > -
> > -try:
> > -    console.sendInput("input")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL(str(e))
> > -
> > -try:
> > -    run = console.runCmd("mknod /dev/tpm0 c 10 224")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("Error while creating /dev/tpm0")
> > -
> > -try:
> > -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("Error while extending PCR 0")
> > -
> > -try:
> > -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("No result from dumping the PCRs")
> > -
> > -
> > -if re.search("No such file",run["output"]):
> > -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> > -
> > -if not re.search("PCR-00:",run["output"]):
> > -    saveLog(console.getHistory())
> > -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> > -
> > -if not re.search("PCR-00: 1E A7 BD",run["output"]):
> > -    saveLog(console.getHistory())
> > -    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
> > -
> > -consoleHistory = console.getHistory()
> > -domain.closeConsole()
> > -
> > -old_domid = domid(domName)
> > -
> > -loop = 0
> > -while loop < 3:
> > -    try:
> > -        status, ouptut = traceCommand("xm migrate -l %s localhost" %
> > -                                      domName,
> > -                                      timeout=90)
> > -    except TimeoutError, e:
> > -        saveLog(consoleHistory)
> > -        FAIL(str(e))
> > -
> > -    if status != 0:
> > -        saveLog(consoleHistory)
> > -        FAIL("xm migrate did not succeed. External device migration activated?")
> > -
> > -
> > -    domName = domain.getName()
> > -    new_domid = domid(domName)
> > -
> > -    if (old_domid == new_domid):
> > -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> > -             (old_domid,loop))
> > -
> > -    try:
> > -        console = domain.getConsole()
> > -    except ConsoleError, e:
> > -        FAIL(str(e))
> > -
> > -    try:
> > -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -    except ConsoleError, e:
> > -        saveLog(console.getHistory())
> > -        FAIL("No result from dumping the PCRs")
> > -
> > -    if not re.search("PCR-00:",run["output"]):
> > -        saveLog(console.getHistory())
> > -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> > -
> > -    if not re.search("PCR-00: 1E A7 BD",run["output"]):
> > -        saveLog(console.getHistory())
> > -        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
> > -
> > -    loop += 1
> > -
> > -domain.closeConsole()
> > -
> > -domain.stop()
> > diff --git a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py b/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
> > deleted file mode 100644
> > index 27125fc..0000000
> > --- a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
> > +++ /dev/null
> > @@ -1,119 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -# Positive Test: create domain with virtual TPM attached at build time,
> > -#                extend a pcr
> > -#                check list of pcrs; locally migrate the domain and
> > -#                check list of pcrs again and validate extended pcr
> > -#                This test does local (non-live) migration.
> > -
> > -from XmTestLib import *
> > -from vtpm_utils import *
> > -import commands
> > -import os
> > -import os.path
> > -import atexit
> > -
> > -config = {"vtpm":"instance=1,backend=0"}
> > -domain = XmTestDomain(extraConfig=config)
> > -domName = domain.getName()
> > -consoleHistory = ""
> > -
> > -try:
> > -    console = domain.start()
> > -except DomainError, e:
> > -    if verbose:
> > -        print e.extra
> > -    FAIL("Unable to create domain (%s)" % domName)
> > -
> > -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> > -
> > -try:
> > -    console.sendInput("input")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL(str(e))
> > -
> > -try:
> > -    run = console.runCmd("mknod /dev/tpm0 c 10 224")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("Error while creating /dev/tpm0")
> > -
> > -try:
> > -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("Error while extending PCR 0")
> > -
> > -try:
> > -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("No result from dumping the PCRs")
> > -
> > -
> > -if re.search("No such file",run["output"]):
> > -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> > -
> > -if not re.search("PCR-00:",run["output"]):
> > -    saveLog(console.getHistory())
> > -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> > -
> > -if not re.search("PCR-00: 1E A7 BD",run["output"]):
> > -    saveLog(console.getHistory())
> > -    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
> > -
> > -consoleHistory = console.getHistory()
> > -domain.closeConsole()
> > -
> > -old_domid = domid(domName)
> > -
> > -loop = 0
> > -while loop < 3:
> > -    try:
> > -        status, ouptut = traceCommand("xm migrate %s localhost" %
> > -                                      domName,
> > -                                      timeout=90)
> > -    except TimeoutError, e:
> > -        saveLog(consoleHistory)
> > -        FAIL(str(e))
> > -
> > -    if status != 0:
> > -        saveLog(consoleHistory)
> > -        FAIL("xm migrate did not succeed. External device migration activated?")
> > -
> > -
> > -    domName = domain.getName()
> > -    new_domid = domid(domName)
> > -
> > -    if (old_domid == new_domid):
> > -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> > -             (old_domid,loop))
> > -
> > -    try:
> > -        console = domain.getConsole()
> > -    except ConsoleError, e:
> > -        FAIL(str(e))
> > -
> > -    try:
> > -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -    except ConsoleError, e:
> > -        saveLog(console.getHistory())
> > -        FAIL("No result from dumping the PCRs")
> > -
> > -    if not re.search("PCR-00:",run["output"]):
> > -        saveLog(console.getHistory())
> > -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> > -
> > -    if not re.search("PCR-00: 1E A7 BD",run["output"]):
> > -        saveLog(console.getHistory())
> > -        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
> > -
> > -    loop += 1
> > -
> > -domain.closeConsole()
> > -
> > -domain.stop()
> > diff --git a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py b/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
> > deleted file mode 100644
> > index a1aa8b3..0000000
> > --- a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
> > +++ /dev/null
> > @@ -1,158 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -# Test to test the vtpm class through the Xen-API
> > -#
> > -# Tested methods:
> > -#  VTPM: get_uuid, get_backend, get_by_uuid, get_record
> > -#        create, destroy, get_VM
> > -#  VM: get_VTPMS
> > -
> > -from XmTestLib import xapi
> > -from XmTestLib.XenAPIDomain import XmTestAPIDomain
> > -from XmTestLib import *
> > -from vtpm_utils import *
> > -import commands
> > -import os
> > -
> > -VTPM_RECORD_KEYS = [ 'backend', 'VM', 'uuid', 'other_config' ]
> > -
> > -try:
> > -    # XmTestAPIDomain tries to establish a connection to XenD
> > -    domain = XmTestAPIDomain()
> > -except Exception, e:
> > -    SKIP("Skipping test. Error: %s" % str(e))
> > -vm_uuid = domain.get_uuid()
> > -
> > -vtpmcfg = {}
> > -vtpmcfg['backend'] = DOM0_UUID
> > -vtpmcfg['VM'] = vm_uuid
> > -
> > -session = xapi.connect()
> > -
> > -vtpm_uuid = session.xenapi.VTPM.create(vtpmcfg)
> > -
> > -vtpm_be = session.xenapi.VTPM.get_backend(vtpm_uuid)
> > -if vtpm_be != vtpmcfg['backend']:
> > -    FAIL("vTPM's backend is in '%s', expected: '%s'" %
> > -         (vtpm_be, vtpmcfg['backend']))
> > -
> > -vtpm_rec = session.xenapi.VTPM.get_record(vtpm_uuid)
> > -
> > -miss_keys = []
> > -for k in VTPM_RECORD_KEYS:
> > -    if k not in vtpm_rec.keys():
> > -        miss_keys.append(k)
> > -if len(miss_keys) > 0:
> > -    FAIL("vTPM record is missing key(s): %s" % miss_keys)
> > -
> > -if vtpm_rec['uuid']  != vtpm_uuid:
> > -    FAIL("vTPM record shows vtpm uuid '%s', expected: '%s'" %
> > -         (vtpm_rec['uuid'], vtpm_uuid))
> > -if vtpm_rec['VM']  != vm_uuid:
> > -    FAIL("vTPM record shows VM uuid '%s', expected: '%s'" %
> > -         (vtpm_rec['VM'], vm_uuid))
> > -if vtpm_rec['backend'] != vtpmcfg['backend']:
> > -    FAIL("vTPM record shows VM bakcned '%s', expected: '%s'" %
> > -         (vtpm_rev['backend'], vtpmcfg['backend']))
> > -
> > -badkeys = []
> > -keys = vtpm_rec.keys()
> > -for k in keys:
> > -    if k not in VTPM_RECORD_KEYS:
> > -        badkeys.append(k)
> > -if len(badkeys) > 0:
> > -    FAIL("Unexpected attributes in result: %s" % badkeys)
> > -
> > -if vm_uuid != session.xenapi.VTPM.get_VM(vtpm_uuid):
> > -    FAIL("VM uuid from VTPM.get_VM different (%s) than expected (%s)." %
> > -         (vm_ref, vm_uuid))
> > -
> > -uuid = session.xenapi.VTPM.get_uuid(vtpm_uuid)
> > -if uuid != vtpm_uuid:
> > -    FAIL("vTPM from VTPM.get_uuid different (%s) than expected (%s)." %
> > -         (uuid, vtpm_uuid))
> > -
> > -vtpm_ref = session.xenapi.VTPM.get_by_uuid(vtpm_uuid)
> > -if vtpm_ref != vtpm_uuid:
> > -    FAIL("vTPM from VTPM.get_by_uuid different (%s) than expected (%s)." %
> > -         (vtpm_ref, vtpm_uuid))
> > -
> > -vm_vtpms = session.xenapi.VM.get_VTPMs(vm_uuid)
> > -if len(vm_vtpms) != 1:
> > -    FAIL("Number of vTPMs from get_VTPMs is (%d) not what was expected (%d)" %
> > -         (len(vm_vtpms), 1))
> > -if vtpm_uuid not in vm_vtpms:
> > -    FAIL("Other vTPM uuid (%s) returned from VM.get_VTPMs than expected (%s)" %
> > -         (vm_vtpms[0], vtpm_uuid))
> > -
> > -try:
> > -    console = domain.start()
> > -except DomainError, e:
> > -    FAIL("Unable to create domain.")
> > -
> > -try:
> > -    console.sendInput("input")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL(str(e))
> > -
> > -try:
> > -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("1. No result from dumping the PCRs")
> > -
> > -if re.search("No such file",run["output"]):
> > -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> > -
> > -if not re.search("PCR-00:",run["output"]):
> > -    saveLog(console.getHistory())
> > -    FAIL("1. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> > -
> > -try:
> > -    session.xenapi.VTPM.destroy(vtpm_uuid)
> > -    #Should never get here
> > -    FAIL("Could destroy vTPM while VM is running")
> > -except:
> > -    pass
> > -
> > -rc = session.xenapi.VM.suspend(vm_uuid)
> > -if rc:
> > -    FAIL("Could not suspend VM")
> > -
> > -try:
> > -    session.xenapi.VTPM.destroy(vtpm_uuid)
> > -    #May not throw an exception in 'suspend' state
> > -except:
> > -    pass
> > -
> > -rc = session.xenapi.VM.resume(vm_uuid, False)
> > -if rc:
> > -    FAIL("Could not resume VM")
> > -
> > -try:
> > -    console = domain.getConsole()
> > -except ConsoleError, e:
> > -    FAIL(str(e))
> > -
> > -try:
> > -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("2. No result from dumping the PCRs. vTPM has been removed?")
> > -
> > -if not re.search("PCR-00:",run["output"]):
> > -    saveLog(console.getHistory())
> > -    FAIL("2. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> > -
> > -domain.stop()
> > -
> > -try:
> > -    session.xenapi.VTPM.destroy(vtpm_uuid)
> > -except:
> > -    FAIL("Could NOT destroy vTPM while domain is halted.")
> > -
> > -domain.destroy()
> > diff --git a/tools/xm-test/tests/vtpm/Makefile.am b/tools/xm-test/tests/vtpm/Makefile.am
> > deleted file mode 100644
> > index dd67e45..0000000
> > --- a/tools/xm-test/tests/vtpm/Makefile.am
> > +++ /dev/null
> > @@ -1,27 +0,0 @@
> > -SUBDIRS =
> > -
> > -TESTS = 01_vtpm-list_pos.test \
> > -        02_vtpm-cat_pcrs.test \
> > -        03_vtpm-susp_res.test \
> > -        04_vtpm-loc_migr.test \
> > -        05_vtpm-loc_migr.test \
> > -        06_vtpm-susp_res_pcrs.test \
> > -        07_vtpm-mig_pcrs.test \
> > -        08_vtpm-mig_pcrs.test \
> > -        09_vtpm-xapi.test
> > -
> > -XFAIL_TESTS =
> > -
> > -EXTRA_DIST = $(TESTS) $(XFAIL_TESTS) vtpm_utils.py
> > -TESTS_ENVIRONMENT=@TENV@
> > -
> > -%.test: %.py
> > -       cp $< $@
> > -       chmod +x $@
> > -
> > -clean-local: am_config_clean-local
> > -
> > -am_config_clean-local:
> > -       rm -f *test
> > -       rm -f *log
> > -       rm -f *~
> > diff --git a/tools/xm-test/tests/vtpm/vtpm_utils.py b/tools/xm-test/tests/vtpm/vtpm_utils.py
> > deleted file mode 100644
> > index 4e5b281..0000000
> > --- a/tools/xm-test/tests/vtpm/vtpm_utils.py
> > +++ /dev/null
> > @@ -1,30 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -from XmTestLib import *
> > -
> > -if ENABLE_HVM_SUPPORT:
> > -    SKIP("vtpm tests not supported for HVM domains")
> > -
> > -status, output = traceCommand("COLUMNS=200 ; "
> > -                              "ps aux | grep vtpm_manager | grep -v grep")
> > -if output == "":
> > -    SKIP("virtual TPM manager must be started to run this test; might "
> > -         "need /dev/tpm0")
> > -
> > -def vtpm_cleanup(domName):
> > -    traceCommand("/etc/xen/scripts/vtpm-delete "
> > -                 "`xenstore-read /local/domain/0/backend/vtpm/%s/0/uuid`" %
> > -                 str(domid(domName)))
> > -
> > -def vtpm_cleanup(uuid):
> > -    from xen.xm import main
> > -    if main.serverType != main.SERVER_XEN_API:
> > -        traceCommand("/etc/xen/scripts/vtpm-delete %s" % uuid)
> > -
> > -def vtpm_get_uuid(domainid):
> > -    s, o = traceCommand("xenstore-read "
> > -                        "/local/domain/0/backend/vtpm/%s/0/uuid" % domainid)
> > -    return o
> > --
> > 1.7.10.4
> >
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:05:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:05:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYI3O-0006O2-FS; Tue, 13 Nov 2012 15:05:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYI1i-0006FD-LG
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 15:03:52 +0000
Received: from [85.158.137.99:17630] by server-10.bemta-3.messagelabs.com id
	20/74-19806-15162A05; Tue, 13 Nov 2012 15:03:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1352819022!12090297!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=Mail larger than max spam size
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10352 invoked from network); 13 Nov 2012 15:03:43 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:03:43 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15781742"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:03:39 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 15:03:38 +0000
Message-ID: <1352819016.7491.84.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
Date: Tue, 13 Nov 2012 15:03:36 +0000
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48A229F471@aplesstripe.dom1.jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
	<068F06DC4D106941B297C0C5F9F446EA48A229F471@aplesstripe.dom1.jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
X-Mailman-Approved-At: Tue, 13 Nov 2012 15:05:28 +0000
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 14:58 +0000, Fioravante, Matthew E. wrote:
> Should I have removed vtpm from xm also? I left it alone because xm is depcrecated.

Is xend broken by this change when not using the vtpm features?

Or just some functionality (which never worked right) went away?

I'm happy to leave xend alone so long as it works as well as it ever did
for people not using vtpm.

> 
> -----Original Message-----
> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> Sent: Tuesday, November 13, 2012 5:49 AM
> To: Fioravante, Matthew E.
> Cc: xen-devel@lists.xen.org; Stefano Stabellini
> Subject: Re: [PATCH VTPM 6/9] Remove the vtpm process model
> 
> On Thu, 2012-11-01 at 20:35 +0000, Matthew Fioravante wrote:
> > Remove the old vtpm process model. It doesn't work very
> > well and is no longer supported.
> >
> > Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> 
> >
> > diff --git a/tools/Makefile b/tools/Makefile
> > index d8c8cc0..2ca43b9 100644
> > --- a/tools/Makefile
> > +++ b/tools/Makefile
> > @@ -18,8 +18,6 @@ SUBDIRS-$(CONFIG_XCUTILS) += xcutils
> >  SUBDIRS-$(CONFIG_X86) += firmware
> >  SUBDIRS-y += console
> >  SUBDIRS-y += xenmon
> > -SUBDIRS-$(VTPM_TOOLS) += vtpm_manager
> > -SUBDIRS-$(VTPM_TOOLS) += vtpm
> >  SUBDIRS-y += xenstat
> >  SUBDIRS-$(CONFIG_Linux) += $(SUBDIRS-libaio)
> >  SUBDIRS-$(CONFIG_Linux) += memshr
> > diff --git a/tools/blktap2/drivers/hashtable.c b/tools/blktap2/drivers/hashtable.c
> > index 631306b..90a6b85 100644
> > --- a/tools/blktap2/drivers/hashtable.c
> > +++ b/tools/blktap2/drivers/hashtable.c
> > @@ -3,7 +3,6 @@
> >  /*
> >   * There are duplicates of this code in:
> >   *  - tools/xenstore/hashtable.c
> > - *  - tools/vtpm_manager/util/hashtable.c
> >   */
> >
> >  #include "hashtable.h"
> > diff --git a/tools/blktap2/drivers/hashtable.h b/tools/blktap2/drivers/hashtable.h
> > index 89aa3dc..56ca053 100644
> > --- a/tools/blktap2/drivers/hashtable.h
> > +++ b/tools/blktap2/drivers/hashtable.h
> > @@ -3,7 +3,6 @@
> >  /*
> >   * There are duplicates of this code in:
> >   *  - tools/xenstore/hashtable.h
> > - *  - tools/vtpm_manager/util/hashtable.h
> >   */
> >
> >  #ifndef __HASHTABLE_CWC22_H__
> > diff --git a/tools/blktap2/drivers/hashtable_itr.c b/tools/blktap2/drivers/hashtable_itr.c
> > index 402e06b..731917c 100644
> > --- a/tools/blktap2/drivers/hashtable_itr.c
> > +++ b/tools/blktap2/drivers/hashtable_itr.c
> > @@ -1,10 +1,5 @@
> >  /* Copyright (C) 2002, 2004 Christopher Clark  <firstname.lastname@cl.cam.ac.uk> */
> >
> > -/*
> > - * There are duplicates of this code in:
> > - *  - tools/vtpm_manager/util/hashtable_itr.c
> > - */
> > -
> >  #include "hashtable.h"
> >  #include "hashtable_private.h"
> >  #include "hashtable_itr.h"
> > diff --git a/tools/blktap2/drivers/hashtable_itr.h b/tools/blktap2/drivers/hashtable_itr.h
> > index 3d80638..81da838 100644
> > --- a/tools/blktap2/drivers/hashtable_itr.h
> > +++ b/tools/blktap2/drivers/hashtable_itr.h
> > @@ -1,10 +1,5 @@
> >  /* Copyright (C) 2002, 2004 Christopher Clark <firstname.lastname@cl.cam.ac.uk> */
> >
> > -/*
> > - * There are duplicates of this code in:
> > - *  - tools/vtpm_manager/util/hashtable_itr.h
> > - */
> > -
> >  #ifndef __HASHTABLE_ITR_CWC22__
> >  #define __HASHTABLE_ITR_CWC22__
> >  #include "hashtable.h"
> > diff --git a/tools/blktap2/drivers/hashtable_private.h b/tools/blktap2/drivers/hashtable_private.h
> > index 5a13a65..954ecc3 100644
> > --- a/tools/blktap2/drivers/hashtable_private.h
> > +++ b/tools/blktap2/drivers/hashtable_private.h
> > @@ -3,7 +3,6 @@
> >  /*
> >   * There are duplicates of this code in:
> >   *  - tools/xenstore/hashtable_private.h
> > - *  - tools/vtpm_manager/util/hashtable_private.h
> >   */
> >
> >  #ifndef __HASHTABLE_PRIVATE_CWC22_H__
> > diff --git a/tools/configure.ac b/tools/configure.ac
> > index e708f01..586313d 100644
> > --- a/tools/configure.ac
> > +++ b/tools/configure.ac
> > @@ -40,7 +40,6 @@ m4_include([m4/fetcher.m4])
> >  # Enable/disable options
> >  AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
> >  AX_ARG_DEFAULT_ENABLE([monitors], [Disable xenstat and xentop monitoring tools])
> > -AX_ARG_DEFAULT_DISABLE([vtpm], [Enable Virtual Trusted Platform Module])
> >  AX_ARG_DEFAULT_DISABLE([xenapi], [Enable Xen API Bindings])
> >  AX_ARG_DEFAULT_ENABLE([ocamltools], [Disable Ocaml tools])
> >  AX_ARG_DEFAULT_DISABLE([miniterm], [Enable miniterm])
> > diff --git a/tools/examples/README b/tools/examples/README
> > index 5b0314e..2225d5c 100644
> > --- a/tools/examples/README
> > +++ b/tools/examples/README
> > @@ -25,13 +25,7 @@ vif-bridge          - virtual network start/stop script in bridged mode
> >  vif-common.sh       - sourced by vif-bridge
> >  vif-nat             - xen virtual network start/stop script in NAT mode
> >  vif-route           - xen virtual network start/stop script in routed mode
> > -vtpm                - called by xen-backend.agent to bind/unbind vTPM devices
> > -vtpm-common.sh      - common code for vTPM handling
> > -vtpm-delete         - remove an entry from the vTPM table given the
> > -                      domain's name
> > -vtpm-hotplug-common.sh - sourced by vtpm
> > -vtpm-migration.sh   - sourced by external-device-migrate
> > -xen-backend.agent   - calls block, vif-*, vtpm scripts to add, remove, hotplug
> > +xen-backend.agent   - calls block, vif-* scripts to add, remove, hotplug
> >                        devices
> >  xen-backend.rules   - hotplug script rules
> >  xend-config.sxp     - default xend configuration file
> > diff --git a/tools/examples/xmexample.pv-grub b/tools/examples/xmexample.pv-grub
> > index 85f847c..e04e6c1 100644
> > --- a/tools/examples/xmexample.pv-grub
> > +++ b/tools/examples/xmexample.pv-grub
> > @@ -105,20 +105,6 @@ disk = [ 'phy:hda1,hda1,w' ]
> >  # configured in xend-config.sxp.
> >
> >  #----------------------------------------------------------------------------
> > -# Define to which TPM instance the user domain should communicate.
> > -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> > -# where INSTANCE indicates the instance number of the TPM the VM
> > -# should be talking to and DOM provides the domain where the backend
> > -# is located.
> > -# Note that no two virtual machines should try to connect to the same
> > -# TPM instance. The handling of all TPM instances does require
> > -# some management effort in so far that VM configration files (and thus
> > -# a VM) should be associated with a TPM instance throughout the lifetime
> > -# of the VM / VM configuration file. The instance number must be
> > -# greater or equal to 1.
> > -#vtpm = [ 'instance=1,backend=0' ]
> > -
> > -#----------------------------------------------------------------------------
> >  # Configure the behaviour when a domain exits.  There are three 'reasons'
> >  # for a domain to stop: poweroff, reboot, and crash.  For each of these you
> >  # may specify:
> > diff --git a/tools/examples/xmexample1 b/tools/examples/xmexample1
> > index 330aaf0..c951200 100644
> > --- a/tools/examples/xmexample1
> > +++ b/tools/examples/xmexample1
> > @@ -101,20 +101,6 @@ disk = [ 'phy:hda1,hda1,w' ]
> >  # configured in xend-config.sxp.
> >
> >  #----------------------------------------------------------------------------
> > -# Define to which TPM instance the user domain should communicate.
> > -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> > -# where INSTANCE indicates the instance number of the TPM the VM
> > -# should be talking to and DOM provides the domain where the backend
> > -# is located.
> > -# Note that no two virtual machines should try to connect to the same
> > -# TPM instance. The handling of all TPM instances does require
> > -# some management effort in so far that VM configration files (and thus
> > -# a VM) should be associated with a TPM instance throughout the lifetime
> > -# of the VM / VM configuration file. The instance number must be
> > -# greater or equal to 1.
> > -#vtpm = [ 'instance=1,backend=0' ]
> > -
> > -#----------------------------------------------------------------------------
> >  # Set the kernel command line for the new domain.
> >  # You only need to define the IP parameters and hostname if the domain's
> >  # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
> > diff --git a/tools/examples/xmexample2 b/tools/examples/xmexample2
> > index 4e5eb3d..8c5137e 100644
> > --- a/tools/examples/xmexample2
> > +++ b/tools/examples/xmexample2
> > @@ -137,20 +137,6 @@ disk = [ 'phy:sda%d,sda1,w' % (7+vmid),
> >  # configured in xend-config.sxp.
> >
> >  #----------------------------------------------------------------------------
> > -# Define to which TPM instance the user domain should communicate.
> > -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> > -# where INSTANCE indicates the instance number of the TPM the VM
> > -# should be talking to and DOM provides the domain where the backend
> > -# is located.
> > -# Note that no two virtual machines should try to connect to the same
> > -# TPM instance. The handling of all TPM instances does require
> > -# some management effort in so far that VM configration files (and thus
> > -# a VM) should be associated with a TPM instance throughout the lifetime
> > -# of the VM / VM configuration file. The instance number must be
> > -# greater or equal to 1.
> > -#vtpm = ['instance=%d,backend=0' % (vmid) ]
> > -
> > -#----------------------------------------------------------------------------
> >  # Set the kernel command line for the new domain.
> >  # You only need to define the IP parameters and hostname if the domain's
> >  # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
> > diff --git a/tools/examples/xmexample3 b/tools/examples/xmexample3
> > index dc22ce1..ae799f9 100644
> > --- a/tools/examples/xmexample3
> > +++ b/tools/examples/xmexample3
> > @@ -122,20 +122,6 @@ disk = [ 'phy:hda%d,hda1,w' % (vmid)]
> >  # configured in xend-config.sxp.
> >
> >  #----------------------------------------------------------------------------
> > -# Define to which TPM instance the user domain should communicate.
> > -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> > -# where INSTANCE indicates the instance number of the TPM the VM
> > -# should be talking to and DOM provides the domain where the backend
> > -# is located.
> > -# Note that no two virtual machines should try to connect to the same
> > -# TPM instance. The handling of all TPM instances does require
> > -# some management effort in so far that VM configration files (and thus
> > -# a VM) should be associated with a TPM instance throughout the lifetime
> > -# of the VM / VM configuration file. The instance number must be
> > -# greater or equal to 1.
> > -#vtpm = ['instance=%d,backend=0' % (vmid) ]
> > -
> > -#----------------------------------------------------------------------------
> >  # Set the kernel command line for the new domain.
> >  # You only need to define the IP parameters and hostname if the domain's
> >  # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
> > diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
> > index 0166790..0605559 100644
> > --- a/tools/hotplug/Linux/Makefile
> > +++ b/tools/hotplug/Linux/Makefile
> > @@ -18,14 +18,12 @@ XEN_SCRIPTS += vif-setup
> >  XEN_SCRIPTS += block
> >  XEN_SCRIPTS += block-enbd block-nbd
> >  XEN_SCRIPTS += blktap
> > -XEN_SCRIPTS += vtpm vtpm-delete
> >  XEN_SCRIPTS += xen-hotplug-cleanup
> >  XEN_SCRIPTS += external-device-migrate
> >  XEN_SCRIPTS += vscsi
> >  XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
> >  XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
> > -XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
> > -XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
> > +XEN_SCRIPT_DATA += block-common.sh
> >
> >  UDEV_RULES_DIR = $(CONFIG_DIR)/udev
> >  UDEV_RULES = xen-backend.rules xend.rules
> > diff --git a/tools/hotplug/Linux/vtpm b/tools/hotplug/Linux/vtpm
> > deleted file mode 100644
> > index 38a4532..0000000
> > --- a/tools/hotplug/Linux/vtpm
> > +++ /dev/null
> > @@ -1,22 +0,0 @@
> > -#!/bin/bash
> > -
> > -dir=$(dirname "$0")
> > -. "$dir/vtpm-hotplug-common.sh"
> > -
> > -vtpm_fatal_error=0
> > -
> > -case "$command" in
> > -  add)
> > -    vtpm_create_instance
> > -  ;;
> > -  remove)
> > -    vtpm_remove_instance
> > -  ;;
> > -esac
> > -
> > -if [ $vtpm_fatal_error -eq 0 ]; then
> > -       log debug "Successful vTPM operation '$command'."
> > -       success
> > -else
> > -       fatal "Error while executing vTPM operation '$command'."
> > -fi
> > diff --git a/tools/hotplug/Linux/vtpm-common.sh b/tools/hotplug/Linux/vtpm-common.sh
> > deleted file mode 100644
> > index d0d7935..0000000
> > --- a/tools/hotplug/Linux/vtpm-common.sh
> > +++ /dev/null
> > @@ -1,448 +0,0 @@
> > -#
> > -# Copyright (c) 2005 IBM Corporation
> > -# Copyright (c) 2005 XenSource Ltd.
> > -#
> > -# 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
> > -#
> > -
> > -dir=$(dirname "$0")
> > -. "$dir/logging.sh"
> > -. "$dir/locking.sh"
> > -
> > -VTPMDB="/var/vtpm/vtpm.db"
> > -
> > -#In the vtpm-impl file some commands should be defined:
> > -#      vtpm_create, vtpm_setup, vtpm_start, etc. (see below)
> > -if [ -r "$dir/vtpm-impl.alt" ]; then
> > -       . "$dir/vtpm-impl.alt"
> > -elif [ -r "$dir/vtpm-impl" ]; then
> > -       . "$dir/vtpm-impl"
> > -else
> > -       function vtpm_create () {
> > -               true
> > -       }
> > -       function vtpm_setup() {
> > -               true
> > -       }
> > -       function vtpm_start() {
> > -               true
> > -       }
> > -       function vtpm_suspend() {
> > -               true
> > -       }
> > -       function vtpm_resume() {
> > -               true
> > -       }
> > -       function vtpm_delete() {
> > -               true
> > -       }
> > -       function vtpm_migrate() {
> > -               echo "Error: vTPM migration accross machines not implemented."
> > -       }
> > -       function vtpm_migrate_local() {
> > -               echo "Error: local vTPM migration not supported"
> > -       }
> > -       function vtpm_migrate_recover() {
> > -               true
> > -       }
> > -fi
> > -
> > -
> > -#Find the instance number for the vtpm given the name of the domain
> > -# Parameters
> > -# - vmname : the name of the vm
> > -# Return value
> > -#  Returns '0' if instance number could not be found, otherwise
> > -#  it returns the instance number in the variable 'instance'
> > -function vtpmdb_find_instance () {
> > -       local vmname ret instance
> > -       vmname=$1
> > -       ret=0
> > -
> > -       instance=$(cat $VTPMDB |                   \
> > -                 awk -vvmname=$vmname             \
> > -                 '{                               \
> > -                    if ( 1 != index($1,"#")) {    \
> > -                      if ( $1 == vmname ) {       \
> > -                        print $2;                 \
> > -                        exit;                     \
> > -                      }                           \
> > -                    }                             \
> > -                  }')
> > -       if [ "$instance" != "" ]; then
> > -               ret=$instance
> > -       fi
> > -       echo "$ret"
> > -}
> > -
> > -
> > -# Check whether a particular instance number is still available
> > -# returns "0" if it is not available, "1" otherwise.
> > -function vtpmdb_is_free_instancenum () {
> > -       local instance instances avail i
> > -       instance=$1
> > -       avail=1
> > -       #Allowed instance number range: 1-255
> > -       if [ $instance -eq 0 -o $instance -gt 255 ]; then
> > -               avail=0
> > -       else
> > -               instances=$(cat $VTPMDB |                \
> > -                          awk                          \
> > -                          '{                            \
> > -                              if (1 != index($1,"#")) { \
> > -                                printf("%s ",$2);       \
> > -                              }                         \
> > -                           }')
> > -               for i in $instances; do
> > -                       if [ $i -eq $instance ]; then
> > -                               avail=0
> > -                               break
> > -                       fi
> > -               done
> > -       fi
> > -       echo "$avail"
> > -}
> > -
> > -
> > -# Get an available instance number given the database
> > -# Returns an unused instance number
> > -function vtpmdb_get_free_instancenum () {
> > -       local ctr instances don found
> > -       instances=$(cat $VTPMDB |                \
> > -                  awk                          \
> > -                  '{                            \
> > -                      if (1 != index($1,"#")) { \
> > -                        printf("%s ",$2);       \
> > -                      }                         \
> > -                   }')
> > -       ctr=1
> > -       don=0
> > -       while [ $don -eq 0 ]; do
> > -               found=0
> > -               for i in $instances; do
> > -                       if [ $i -eq $ctr ]; then
> > -                               found=1;
> > -                               break;
> > -                       fi
> > -               done
> > -
> > -               if [ $found -eq 0 ]; then
> > -                       don=1
> > -                       break
> > -               fi
> > -               let ctr=ctr+1
> > -       done
> > -       echo "$ctr"
> > -}
> > -
> > -
> > -# Add a domain name and instance number to the DB file
> > -function vtpmdb_add_instance () {
> > -       local res vmname inst
> > -       vmname=$1
> > -       inst=$2
> > -
> > -       if [ ! -f $VTPMDB ]; then
> > -               echo "#Database for VM to vTPM association" > $VTPMDB
> > -               echo "#1st column: domain name" >> $VTPMDB
> > -               echo "#2nd column: TPM instance number" >> $VTPMDB
> > -       fi
> > -       res=$(vtpmdb_validate_entry $vmname $inst)
> > -       if [ $res -eq 0 ]; then
> > -               echo "$vmname $inst" >> $VTPMDB
> > -       fi
> > -}
> > -
> > -
> > -#Validate whether an entry is the same as passed to this
> > -#function
> > -function vtpmdb_validate_entry () {
> > -       local res rc vmname inst
> > -       rc=0
> > -       vmname=$1
> > -       inst=$2
> > -
> > -       res=$(cat $VTPMDB |            \
> > -            awk -vvmname=$vmname     \
> > -                 -vinst=$inst         \
> > -            '{                        \
> > -                if ( 1 == index($1,"#")) {\
> > -                } else                \
> > -                if ( $1 == vmname &&  \
> > -                     $2 == inst) {    \
> > -                   printf("1");       \
> > -                   exit;              \
> > -                } else                \
> > -                if ( $1 == vmname ||  \
> > -                     $2 == inst) {    \
> > -                   printf("2");       \
> > -                   exit;              \
> > -                }                     \
> > -            }')
> > -
> > -       if [ "$res" == "1" ]; then
> > -               rc=1
> > -       elif [ "$res" == "2" ]; then
> > -               rc=2
> > -       fi
> > -       echo "$rc"
> > -}
> > -
> > -
> > -#Remove an entry from the vTPM database given its domain name
> > -#and instance number
> > -function vtpmdb_remove_entry () {
> > -       local vmname instance VTPMDB_TMP
> > -       vmname=$1
> > -       instance=$2
> > -       VTPMDB_TMP="$VTPMDB".tmp
> > -
> > -       $(cat $VTPMDB |            \
> > -        awk -vvmname=$vmname     \
> > -        '{                        \
> > -           if ( $1 != vmname ) {  \
> > -             print $0;            \
> > -           }                      \
> > -        '} > $VTPMDB_TMP)
> > -       if [ -e $VTPMDB_TMP ]; then
> > -               mv -f $VTPMDB_TMP $VTPMDB
> > -               vtpm_delete $instance
> > -       else
> > -               log err "Error creating temporary file '$VTPMDB_TMP'."
> > -       fi
> > -}
> > -
> > -
> > -# Find the reason for the creation of this device:
> > -# Returns 'resume' or 'create'
> > -function vtpm_get_create_reason () {
> > -       local resume
> > -       resume=$(xenstore_read $XENBUS_PATH/resume)
> > -       if [ "$resume" == "True" ]; then
> > -               echo "resume"
> > -       else
> > -               echo "create"
> > -       fi
> > -}
> > -
> > -
> > -#Create a vTPM instance
> > -# If no entry in the TPM database is found, the instance is
> > -# created and an entry added to the database.
> > -function vtpm_create_instance () {
> > -       local res instance domname reason uuid
> > -       uuid=$(xenstore_read "$XENBUS_PATH"/uuid)
> > -       reason=$(vtpm_get_create_reason)
> > -
> > -       claim_lock vtpmdb
> > -
> > -       instance="0"
> > -
> > -       if [ "$uuid" != "" ]; then
> > -               instance=$(vtpmdb_find_instance $uuid)
> > -       fi
> > -       if [ "$instance" == "0" ]; then
> > -               domname=$(xenstore_read "$XENBUS_PATH"/domain)
> > -               instance=$(vtpmdb_find_instance $domname)
> > -       fi
> > -
> > -       if [ "$instance" == "0" -a "$reason" != "create" ]; then
> > -               release_lock vtpmdb
> > -               return
> > -       fi
> > -
> > -       if [ "$instance" == "0" ]; then
> > -               #Try to give the preferred instance to the domain
> > -               instance=$(xenstore_read "$XENBUS_PATH"/pref_instance)
> > -               if [ "$instance" != "" ]; then
> > -                       res=$(vtpmdb_is_free_instancenum $instance)
> > -                       if [ $res -eq 0 ]; then
> > -                               instance=$(vtpmdb_get_free_instancenum)
> > -                       fi
> > -               else
> > -                       instance=$(vtpmdb_get_free_instancenum)
> > -               fi
> > -
> > -               vtpm_create $instance
> > -
> > -               if [ $vtpm_fatal_error -eq 0 ]; then
> > -                       if [ "$uuid" != "" ]; then
> > -                               vtpmdb_add_instance $uuid $instance
> > -                       else
> > -                               vtpmdb_add_instance $domname $instance
> > -                       fi
> > -               fi
> > -       else
> > -               if [ "$reason" == "resume" ]; then
> > -                       vtpm_resume $instance
> > -               else
> > -                       vtpm_start $instance
> > -               fi
> > -       fi
> > -
> > -       release_lock vtpmdb
> > -
> > -       xenstore_write $XENBUS_PATH/instance $instance
> > -}
> > -
> > -
> > -#Remove an instance when a VM is terminating or suspending.
> > -#Since it is assumed that the VM will appear again, the
> > -#entry is kept in the VTPMDB file.
> > -function vtpm_remove_instance () {
> > -       local instance reason domname uuid
> > -       #Stop script execution quietly if path does not exist (anymore)
> > -       xenstore-exists "$XENBUS_PATH"/domain
> > -       uuid=$(xenstore_read "$XENBUS_PATH"/uuid)
> > -
> > -       claim_lock vtpmdb
> > -
> > -       instance="0"
> > -
> > -       if [ "$uuid" != "" ]; then
> > -               instance=$(vtpmdb_find_instance $uuid)
> > -       fi
> > -
> > -       if [ "$instance" == "0" ]; then
> > -               domname=$(xenstore_read "$XENBUS_PATH"/domain)
> > -               instance=$(vtpmdb_find_instance $domname)
> > -       fi
> > -
> > -       if [ "$instance" != "0" ]; then
> > -               vtpm_suspend $instance
> > -       fi
> > -
> > -       release_lock vtpmdb
> > -}
> > -
> > -
> > -#Remove an entry in the VTPMDB file given the domain's name
> > -#1st parameter: The name of the domain
> > -function vtpm_delete_instance () {
> > -       local instance
> > -
> > -       claim_lock vtpmdb
> > -
> > -       instance=$(vtpmdb_find_instance $1)
> > -       if [ "$instance" != "0" ]; then
> > -               vtpmdb_remove_entry $1 $instance
> > -       fi
> > -
> > -       release_lock vtpmdb
> > -}
> > -
> > -# Determine whether the given address is local to this machine
> > -# Return values:
> > -#  "-1" : the given machine name is invalid
> > -#  "0"  : this is not an address of this machine
> > -#  "1"  : this is an address local to this machine
> > -function vtpm_isLocalAddress() {
> > -       local addr res
> > -       addr=$(ping $1 -c 1 |  \
> > -              awk '{ print substr($3,2,length($3)-2); exit }')
> > -       if [ "$addr" == "" ]; then
> > -               echo "-1"
> > -               return
> > -       fi
> > -       res=$(ifconfig | grep "inet addr" |  \
> > -            awk -vaddr=$addr               \
> > -            '{                              \
> > -               if ( addr == substr($2, 6)) {\
> > -                 print "1";                 \
> > -               }                            \
> > -            }'                              \
> > -           )
> > -       if [ "$res" == "" ]; then
> > -               echo "0"
> > -               return
> > -       fi
> > -       echo "1"
> > -}
> > -
> > -# Perform a migration step. This function differentiates between migration
> > -# to the local host or to a remote machine.
> > -# Parameters:
> > -# 1st: destination host to migrate to
> > -# 2nd: name of the domain to migrate
> > -# 3rd: the migration step to perform
> > -function vtpm_migration_step() {
> > -       local res=$(vtpm_isLocalAddress $1)
> > -       if [ "$res" == "0" ]; then
> > -               vtpm_migrate $1 $2 $3
> > -       else
> > -               vtpm_migrate_local
> > -       fi
> > -}
> > -
> > -# Recover from migration due to an error. This function differentiates
> > -# between migration to the local host or to a remote machine.
> > -# Parameters:
> > -# 1st: destination host the migration was going to
> > -# 2nd: name of the domain that was to be migrated
> > -# 3rd: the last successful migration step that was done
> > -function vtpm_recover() {
> > -       local res
> > -       res=$(vtpm_isLocalAddress $1)
> > -       if [ "$res" == "0" ]; then
> > -               vtpm_migrate_recover $1 $2 $3
> > -       fi
> > -}
> > -
> > -
> > -#Determine the domain id given a domain's name.
> > -#1st parameter: name of the domain
> > -#return value: domain id  or -1 if domain id could not be determined
> > -function vtpm_domid_from_name () {
> > -       local id name ids
> > -       ids=$(xenstore-list /local/domain)
> > -       for id in $ids; do
> > -               name=$(xenstore-read /local/domain/$id/name)
> > -               if [ "$name" == "$1" ]; then
> > -                       echo "$id"
> > -                       return
> > -               fi
> > -       done
> > -       echo "-1"
> > -}
> > -
> > -#Determine the virtual TPM's instance number using the domain ID.
> > -#1st parm: domain ID
> > -function vtpm_uuid_by_domid() {
> > -       echo $(xenstore-read /local/domain/0/backend/vtpm/$1/0/uuid)
> > -}
> > -
> > -
> > -# Determine the vTPM's UUID by the name of the VM
> > -function vtpm_uuid_from_vmname() {
> > -       local domid=$(vtpm_domid_from_name $1)
> > -       if [ "$domid" != "-1" ]; then
> > -               echo $(vtpm_uuid_by_domid $domid)
> > -               return
> > -       fi
> > -       echo ""
> > -}
> > -
> > -#Add a virtual TPM instance number and its associated domain name
> > -#to the VTPMDB file and activate usage of this virtual TPM instance
> > -#by writing the instance number into the xenstore
> > -#1st parm: name of virtual machine
> > -#2nd parm: instance of associated virtual TPM
> > -function vtpm_add_and_activate() {
> > -       local domid=$(vtpm_domid_from_name $1)
> > -       local vtpm_uuid=$(vtpm_uuid_from_vmname $1)
> > -       if [ "$vtpm_uuid" != "" -a "$domid" != "-1" ]; then
> > -               vtpmdb_add_instance $vtpm_uuid $2
> > -               xenstore-write backend/vtpm/$domid/0/instance $2
> > -       fi
> > -}
> > diff --git a/tools/hotplug/Linux/vtpm-delete b/tools/hotplug/Linux/vtpm-delete
> > deleted file mode 100644
> > index b75b95b..0000000
> > --- a/tools/hotplug/Linux/vtpm-delete
> > +++ /dev/null
> > @@ -1,18 +0,0 @@
> > -#!/bin/bash
> > -
> > -# This scripts must be called the following way:
> > -# vtpm-delete <vtpm uuid>
> > -# or
> > -# vtpm-delete --vmname <vm name>
> > -
> > -dir=$(dirname "$0")
> > -. "$dir/vtpm-common.sh"
> > -
> > -if [ "$1" == "--vmname" ]; then
> > -       vtpm_uuid=$(vtpm_uuid_from_vmname $2)
> > -       if [ "$vtpm_uuid" != "" ];then
> > -               vtpm_delete_instance $vtpm_uuid
> > -       fi
> > -else
> > -       vtpm_delete_instance $1
> > -fi
> > diff --git a/tools/hotplug/Linux/vtpm-hotplug-common.sh b/tools/hotplug/Linux/vtpm-hotplug-common.sh
> > deleted file mode 100644
> > index 9fd35e7..0000000
> > --- a/tools/hotplug/Linux/vtpm-hotplug-common.sh
> > +++ /dev/null
> > @@ -1,35 +0,0 @@
> > -#
> > -# Copyright (c) 2005 IBM Corporation
> > -# Copyright (c) 2005 XenSource Ltd.
> > -#
> > -# 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
> > -#
> > -
> > -dir=$(dirname "$0")
> > -. "$dir/xen-hotplug-common.sh"
> > -
> > -findCommand "$@"
> > -if [ "$command" != "online" ]  &&
> > -   [ "$command" != "offline" ] &&
> > -   [ "$command" != "add" ]     &&
> > -   [ "$command" != "remove" ]
> > -then
> > -       log err "Invalid command: $command"
> > -       exit 1
> > -fi
> > -
> > -
> > -XENBUS_PATH="${XENBUS_PATH:?}"
> > -
> > -. "$dir/vtpm-common.sh"
> > diff --git a/tools/hotplug/Linux/vtpm-impl b/tools/hotplug/Linux/vtpm-impl
> > deleted file mode 100644
> > index 4f9a1fd..0000000
> > --- a/tools/hotplug/Linux/vtpm-impl
> > +++ /dev/null
> > @@ -1,208 +0,0 @@
> > -#!/bin/bash
> > -# ===================================================================
> > -#
> > -# Copyright (c) 2005, Intel Corp.
> > -# All rights reserved.
> > -#
> > -# Redistribution and use in source and binary forms, with or without
> > -# modification, are permitted provided that the following conditions
> > -# are met:
> > -#
> > -#   * Redistributions of source code must retain the above copyright
> > -#     notice, this list of conditions and the following disclaimer.
> > -#   * Redistributions in binary form must reproduce the above
> > -#     copyright notice, this list of conditions and the following
> > -#     disclaimer in the documentation and/or other materials provided
> > -#     with the distribution.
> > -#   * Neither the name of Intel Corporation nor the names of its
> > -#     contributors may be used to endorse or promote products derived
> > -#     from this software without specific prior written permission.
> > -#
> > -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -# OF THE POSSIBILITY OF SUCH DAMAGE.
> > -# ===================================================================
> > -
> > -#            |        SRC        |    TAG  |      CMD SIZE     |        ORD       |mtype|strt
> > -TPM_CMD_OPEN=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x11\\x01\\x00\\x00\\x01\\x01\\x01
> > -TPM_CMD_RESM=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x11\\x01\\x00\\x00\\x01\\x01\\x02
> > -TPM_CMD_CLOS=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x0e\\x01\\x00\\x00\\x02
> > -TPM_CMD_DELE=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x0e\\x01\\x00\\x00\\x03
> > -
> > -TPM_TYPE_PVM=\\x01
> > -TPM_TYPE_HVM=\\x02
> > -
> > -TPM_SUCCESS=00000000
> > -
> > -TX_VTPM_MANAGER=/var/vtpm/fifos/from_console.fifo
> > -RX_VTPM_MANAGER=/var/vtpm/fifos/to_console.fifo
> > -
> > -VTPM_MIG=/usr/bin/vtpm_migrator
> > -
> > -# -------------------- Helpers for binary streams -----------
> > -
> > -function str_to_hex32() {
> > - printf "%0.8x" $1
> > -}
> > -
> > -function hex32_to_bin() {
> > - local inst=$(str_to_hex32 $1);
> > -
> > - local n1=`echo $inst | sed 's/\(..\)....../\\\\x\1/'`
> > - local n2=`echo $inst | sed 's/..\(..\)..../\\\\x\1/'`
> > - local n3=`echo $inst | sed 's/....\(..\)../\\\\x\1/'`
> > - local n4=`echo $inst | sed 's/......\(..\)/\\\\x\1/'`
> > -
> > - echo "$n1$n2$n3$n4"
> > -}
> > -
> > -function vtpm_manager_cmd() {
> > - local cmd=$1;
> > - local inst=$2;
> > - local inst_bin=$(hex32_to_bin $inst);
> > -
> > - claim_lock vtpm_mgr
> > -
> > - #send cmd to vtpm_manager
> > - printf "$cmd$inst_bin" > $TX_VTPM_MANAGER
> > -
> > - #recv response
> > - set +e
> > - local resp_hex=`dd skip=10 bs=1 count=4 if=$RX_VTPM_MANAGER 2> /dev/null | xxd -ps`
> > - set -e
> > -
> > - release_lock vtpm_mgr
> > -
> > - #return whether the command was successful
> > - if [ $resp_hex -ne $TPM_SUCCESS ]; then
> > -   vtpm_fatal_error=1
> > -   false
> > -  else
> > -   true
> > - fi
> > -}
> > -
> > -# Helper to get vm type to pass to vtpm_manager open/resume
> > -function vtpm_get_type() {
> > - local inst=$(xenstore_read $XENBUS_PATH/frontend-id)
> > - local vm=$(xenstore_read /local/domain/$inst/vm)
> > - if [ "$vm" != "" ]; then
> > -  local ostype=$(xenstore-read $vm/image/ostype)
> > -  if [ "$ostype" == "hvm" ]; then
> > -   echo $TPM_TYPE_HVM;
> > -  else
> > -   echo $TPM_TYPE_PVM;
> > -  fi
> > - fi
> > -}
> > -
> > -# ------------------ Command handlers -----------------
> > -
> > -# Create new vtpm instance & set it up for use
> > -function vtpm_create () {
> > - # Creation is handled implicitly by the manager on first setup
> > - # so just set it up for use
> > - $(vtpm_start $1)
> > -}
> > -
> > -# Setup vtpm instance for use.
> > -function vtpm_start() {
> > - local vmtype=$(vtpm_get_type);
> > - $(vtpm_manager_cmd $TPM_CMD_OPEN$vmtype $1)
> > -}
> > -
> > -function vtpm_resume() {
> > - local vmtype=$(vtpm_get_type);
> > - $(vtpm_manager_cmd $TPM_CMD_RESM$vmtype $1)
> > -}
> > -
> > -# Reset the vtpm AKA clear PCRs
> > -function vtpm_reset() {
> > - #not used by current implemenation
> > - true
> > -}
> > -
> > -# Shutdown the vtpm while the vm is down
> > -# This could be a suspend of shutdown
> > -# we cannot distinquish, so save the state
> > -# and decide on startup if we should keep is
> > -function vtpm_suspend() {
> > - $(vtpm_manager_cmd $TPM_CMD_CLOS $1)
> > -}
> > -
> > -
> > -function vtpm_delete() {
> > - local inst=$1
> > - if $(vtpm_manager_cmd $TPM_CMD_DELE $inst); then
> > -   rm -f /var/vtpm/vtpm_dm_$1.data
> > -   true
> > - else
> > -   vtpm_fatal_error=1
> > -   false
> > - fi
> > -}
> > -
> > -# Perform a migration step. This function differentiates between migration
> > -# to the local host or to a remote machine.
> > -# Parameters:
> > -# 1st: destination host to migrate to
> > -# 2nd: name of the domain to migrate
> > -# 3rd: the migration step to perform
> > -function vtpm_migrate() {
> > - local instance res
> > -
> > - instance=$(vtpmdb_find_instance $2)
> > - if [ "$instance" == "" ]; then
> > -  log err "VTPM Migratoin failed. Unable to translation of domain name"
> > -  echo "Error: VTPM Migration failed while looking up instance number"
> > - fi
> > -
> > - case "$3" in
> > -  0)
> > -   #Incicate migration supported
> > -   echo "0"
> > -  ;;
> > -
> > -  1)
> > -   # Get Public Key from Destination
> > -   # Call vtpm_manager's migration part 1
> > -   claim_lock vtpm_mgr
> > -   $VTPM_MIG $1 $2 $instance $3
> > -   release_lock vtpm_mgr
> > -  ;;
> > -
> > -  2)
> > -   # Call manager's migration step 2 and send result to destination
> > -   # If successful remove from db
> > -   claim_lock vtpm_mgr
> > -   $VTPM_MIG $1 $2 $instance $3
> > -   release_lock vtpm_mgr
> > -  ;;
> > -
> > -  3)
> > -   if `ps x | grep "$VTPM_MIG $1"`; then
> > -    log err "VTPM Migration failed to complete."
> > -    echo "Error: VTPM Migration failed to complete."
> > -   fi
> > -  ;;
> > - esac
> > -
> > -}
> > -
> > -
> > -function vtpm_migrate_recover() {
> > - echo "Error: Recovery not supported yet"
> > -}
> > -
> > -function vtpm_migrate_local() {
> > - echo "Error: local vTPM migration not supported"
> > -}
> > diff --git a/tools/hotplug/Linux/vtpm-migration.sh b/tools/hotplug/Linux/vtpm-migration.sh
> > deleted file mode 100644
> > index 7e38ae2..0000000
> > --- a/tools/hotplug/Linux/vtpm-migration.sh
> > +++ /dev/null
> > @@ -1,19 +0,0 @@
> > -#
> > -# Copyright (c) 2005 IBM Corporation
> > -#
> > -# 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
> > -#
> > -
> > -dir=$(dirname "$0")
> > -. "$dir/vtpm-common.sh"
> > diff --git a/tools/hotplug/Linux/xen-backend.rules b/tools/hotplug/Linux/xen-backend.rules
> > index c591a3f..a0d409e 100644
> > --- a/tools/hotplug/Linux/xen-backend.rules
> > +++ b/tools/hotplug/Linux/xen-backend.rules
> > @@ -1,6 +1,5 @@
> >  SUBSYSTEM=="xen-backend", KERNEL=="tap*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/blktap $env{ACTION}"
> >  SUBSYSTEM=="xen-backend", KERNEL=="vbd*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/block $env{ACTION}"
> > -SUBSYSTEM=="xen-backend", KERNEL=="vtpm*", RUN+="/etc/xen/scripts/vtpm $env{ACTION}"
> >  SUBSYSTEM=="xen-backend", KERNEL=="vif2-*", RUN+="/etc/xen/scripts/vif2 $env{ACTION}"
> >  SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="online", RUN+="/etc/xen/scripts/vif-setup online type_if=vif"
> >  SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="offline", RUN+="/etc/xen/scripts/vif-setup offline type_if=vif"
> > diff --git a/tools/vtpm/Makefile b/tools/vtpm/Makefile
> > deleted file mode 100644
> > index 7b3efa5..0000000
> > --- a/tools/vtpm/Makefile
> > +++ /dev/null
> > @@ -1,74 +0,0 @@
> > -XEN_ROOT = $(CURDIR)/../..
> > -
> > -# Base definitions and rules
> > -include $(XEN_ROOT)/tools/vtpm/Rules.mk
> > -
> > -# Dir name for emulator (as dom0 tpm driver)
> > -TPM_EMULATOR_DIR = tpm_emulator
> > -# Dir name for vtpm instance
> > -VTPM_DIR = vtpm
> > -ORIG_DIR = orig
> > -
> > -# Emulator tarball name
> > -TPM_EMULATOR_NAME = tpm_emulator-0.5.1
> > -TPM_EMULATOR_TARFILE = $(TPM_EMULATOR_NAME).tar.gz
> > -
> > -GMP_HEADER = /usr/include/gmp.h
> > -
> > -.PHONY: all
> > -all: build
> > -
> > -.PHONY: build
> > -build: build_sub
> > -
> > -.PHONY: install
> > -install: build
> > -       $(MAKE) -C $(VTPM_DIR) install-recursive
> > -
> > -.PHONY: clean
> > -clean:
> > -       @if [ -d $(TPM_EMULATOR_DIR) ]; \
> > -               then $(MAKE) -C $(TPM_EMULATOR_DIR) clean; \
> > -       fi
> > -       @if [ -d $(VTPM_DIR) ]; \
> > -               then $(MAKE) -C $(VTPM_DIR) clean; \
> > -       fi
> > -
> > -.PHONY: mrproper
> > -mrproper:
> > -       rm -f $(TPM_EMULATOR_TARFILE) tpm_emulator.patch.old vtpm.patch.old
> > -       rm -rf $(TPM_EMULATOR_DIR) $(VTPM_DIR) $(ORIG_DIR)
> > -
> > -# Download Swiss emulator
> > -$(TPM_EMULATOR_TARFILE):
> > -       wget http://download.berlios.de/tpm-emulator/$(TPM_EMULATOR_TARFILE)
> > -
> > -# Create vtpm dirs
> > -$(VTPM_DIR)/tpmd/tpmd: $(TPM_EMULATOR_TARFILE) vtpm-0.5.1.patch
> > -       rm -rf $(VTPM_DIR)
> > -       tar -xzf $(TPM_EMULATOR_TARFILE)
> > -       mv $(TPM_EMULATOR_NAME) $(VTPM_DIR)
> > -
> > -       set -e; cd $(VTPM_DIR); \
> > -       patch -p1 < ../vtpm-0.5.1.patch; \
> > -       patch -p1 < ../vtpm-0.5.1-LDLIBS.patch
> > -
> > -orig: $(TPM_EMULATOR_TARFILE)
> > -       mkdir $(ORIG_DIR);
> > -       set -e; cd $(ORIG_DIR); \
> > -       tar -xzf ../$(TPM_EMULATOR_TARFILE);
> > -
> > -updatepatches: clean orig
> > -       find $(VTPM_DIR) -name "*.orig" -print | xargs rm -f;
> > -       mv vtpm.patch vtpm.patch.old;
> > -       diff -uprN $(TPM_EMULATOR_DIR) $(VTPM_DIR) > vtpm.patch || true;
> > -
> > -.PHONY: build_sub
> > -build_sub: $(VTPM_DIR)/tpmd/tpmd
> > -       set -e; if [ -e $(GMP_HEADER) ]; then \
> > -               $(MAKE) -C $(VTPM_DIR) version; \
> > -               $(MAKE) -C $(VTPM_DIR) all-recursive; \
> > -       else \
> > -               echo "=== Unable to build VTPMs. libgmp could not be found."; \
> > -       fi
> > -
> > diff --git a/tools/vtpm/README b/tools/vtpm/README
> > deleted file mode 100644
> > index 2008cbd..0000000
> > --- a/tools/vtpm/README
> > +++ /dev/null
> > @@ -1,45 +0,0 @@
> > -
> > -Directory Structure
> > -===================
> > -tools/vtpm/tpm_emulator-0.2b.tar.gz    -> TPM Emulator downloaded at build time that will
> > -                                          be patched and used for our vtpms
> > -tools/vtpm/vtpm.patch                  -> patch applied to tpm_emulator to make vtpm
> > -tools/vtpm/vtpm/                       -> (created on build) tpm_emulator moved to ring 3,
> > -                                          listens on a pair of fifos for TPM commands,
> > -                                          persistent state is sent via named fifo to vtpm
> > -                                            manager, which encrypts it and protects it.
> > -tools/vtpm/tpm_emulator.patch          -> To allow for debugging and testing on non-TPM
> > -                                          platforms, this patches the emulator to allow
> > -                                          it to be inserted into the dom0 kernel
> > -tools/vtpm/tpm_emulator-0.2            -> (created on build) directory containing patched emulator
> > -
> > -Compile Flags
> > -===================
> > -VTPM_MULTI_VM                -> Defined (not finished): VTPMs run in their own VMs
> > -                                Not Defined (default): VTPMs are processes
> > -
> > -Requirements
> > -============
> > -- xen-unstable
> > -- IBM frontend/backend vtpm driver patch
> > -- vtpm_managerd
> > -- GNU MP Big number library (GMP)
> > -
> > -vtpmd Flow (for vtpm_manager. vtpmd never run by default)
> > -============================
> > -- Launch the VTPM manager (vtpm_managerd) which which begins listening to the BE with one thread
> > -  and listens to a named fifo that is shared by the vtpms to commuincate with the manager.
> > -- VTPM Manager listens to TPM BE.
> > -- When xend launches a tpm frontend equipped VM it contacts the manager over the vtpm backend.
> > -- When the manager receives the open message from the BE, it launches a vtpm
> > -- Xend allows the VM to continue booting.
> > -- When a TPM request is issued to the front end, the front end transmits the TPM request to the backend.
> > -- The manager receives the TPM requests and uses a named fifo to forward the request to the vtpm.
> > -- The fifo listener begins listening for the reply from vtpm for the request.
> > -- Vtpm processes request and replies to manager over shared named fifo.
> > -- If needed, the vtpm may send a request to the vtpm_manager at any time to save it's secrets to disk.
> > -- Manager receives response from vtpm and passes it back to backend for forwarding to guest.
> > -
> > -tpm_emulator flow
> > -==================
> > -Read documentation in tpm_emulator-0.2 directory
> > diff --git a/tools/vtpm/Rules.mk b/tools/vtpm/Rules.mk
> > deleted file mode 100644
> > index 548cff0..0000000
> > --- a/tools/vtpm/Rules.mk
> > +++ /dev/null
> > @@ -1,26 +0,0 @@
> > -# Base definitions and rules (XEN_ROOT must be defined in including Makefile)
> > -include $(XEN_ROOT)/tools/Rules.mk
> > -
> > -#
> > -# Tool definitions
> > -#
> > -
> > -# General compiler flags
> > -CFLAGS   = -Werror -g3
> > -
> > -# Generic project files
> > -HDRS   = $(wildcard *.h)
> > -SRCS   = $(wildcard *.c)
> > -OBJS   = $(patsubst %.c,%.o,$(SRCS))
> > -
> > -# Generic (non-header) dependencies
> > -$(SRCS): Makefile $(XEN_ROOT)/tools/Rules.mk $(XEN_ROOT)/tools/vtpm/Rules.mk
> > -
> > -$(OBJS): $(SRCS)
> > -
> > --include $(DEPS)
> > -
> > -BUILD_EMULATOR = y
> > -
> > -# Make sure these are just rules
> > -.PHONY : all build install clean
> > diff --git a/tools/vtpm/tpm_emulator.patch b/tools/vtpm/tpm_emulator.patch
> > deleted file mode 100644
> > index c34c665..0000000
> > --- a/tools/vtpm/tpm_emulator.patch
> > +++ /dev/null
> > @@ -1,1919 +0,0 @@
> > -diff -uprN orig/tpm_emulator-0.4/AUTHORS tpm_emulator/AUTHORS
> > ---- orig/tpm_emulator-0.4/AUTHORS      2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/AUTHORS       2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,2 +1,3 @@
> > - Mario Strasser <mast@gmx.net>
> > - Heiko Stamer <stamer@gaos.org> [DAA]
> > -+INTEL Corp <> [Dropped to Ring3]
> > -diff -uprN orig/tpm_emulator-0.4/ChangeLog tpm_emulator/ChangeLog
> > ---- orig/tpm_emulator-0.4/ChangeLog    2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/ChangeLog     2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,3 +1,6 @@
> > -+????-??-?? Intel Corp
> > -+      * Moved module out of kernel to run as a ring 3 app
> > -+
> > - 2006-06-23  Mario Strasser <mast@gmx.net>
> > -       * tpm_startup.c: behaviour of ST_CLEAR and storage of
> > -               persistent data adapted
> > -diff -uprN orig/tpm_emulator-0.4/crypto/gmp_kernel_wrapper.c tpm_emulator/crypto/gmp_kernel_wrapper.c
> > ---- orig/tpm_emulator-0.4/crypto/gmp_kernel_wrapper.c  2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/crypto/gmp_kernel_wrapper.c   2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,5 +1,6 @@
> > - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> > -+ * Copyright (C) 2005 INTEL Corp
> > -  *
> > -  * This module is free software; you can redistribute it and/or modify
> > -  * it under the terms of the GNU General Public License as published
> > -@@ -24,15 +25,10 @@ int __gmp_junk;
> > - void __attribute__ ((regparm(0))) __gmp_assert_fail(const char *filename,
> > -   int linenum, const char *expr)
> > - {
> > --  panic(KERN_CRIT TPM_MODULE_NAME "%s:%d: GNU MP assertion failed: %s\n",
> > -+  error("%s:%d: GNU MP assertion failed: %s\n",
> > -     filename, linenum, expr);
> > - }
> > -
> > --void __attribute__ ((regparm(0))) abort(void)
> > --{
> > --  panic(KERN_CRIT TPM_MODULE_NAME "GNU MP abort() was called\n");
> > --}
> > --
> > - /* overwrite GNU MP random functions (used by mpz/millerrabin.c) */
> > -
> > - void __attribute__ ((regparm(0))) gmp_randinit(gmp_randstate_t rstate,
> > -@@ -77,20 +73,19 @@ void __attribute__ ((regparm(0))) mpz_ur
> > -
> > - void __attribute__ ((regparm(0))) *kernel_allocate(size_t size)
> > - {
> > --  void *ret  = (void*)kmalloc(size, GFP_KERNEL);
> > --  if (!ret) panic(KERN_CRIT TPM_MODULE_NAME
> > --    "GMP: cannot allocate memory (size=%u)\n", size);
> > -+  void *ret  = (void*)malloc(size);
> > -+  if (!ret) error("GMP: cannot allocate memory (size=%Zu)\n", size);
> > -   return ret;
> > - }
> > -
> > - void __attribute__ ((regparm(0))) *kernel_reallocate(void *oldptr,
> > -   size_t old_size, size_t new_size)
> > - {
> > --  void *ret = (void*)kmalloc(new_size, GFP_KERNEL);
> > --  if (!ret) panic(KERN_CRIT TPM_MODULE_NAME "GMP: Cannot reallocate memory "
> > --    "(old_size=%u new_size=%u)\n", old_size, new_size);
> > -+  void *ret = (void*)malloc(new_size);
> > -+  if (!ret) error("GMP: Cannot reallocate memory "
> > -+    "(old_size=%Zu new_size=%Zu)\n", old_size, new_size);
> > -   memcpy(ret, oldptr, old_size);
> > --  kfree(oldptr);
> > -+  free(oldptr);
> > -   return ret;
> > - }
> > -
> > -@@ -99,7 +94,7 @@ void __attribute__ ((regparm(0))) kernel
> > -   /* overwrite used memory */
> > -   if (blk_ptr != NULL) {
> > -     memset(blk_ptr, 0, blk_size);
> > --    kfree(blk_ptr);
> > -+    free(blk_ptr);
> > -   }
> > - }
> > -
> > -diff -uprN orig/tpm_emulator-0.4/crypto/rsa.c tpm_emulator/crypto/rsa.c
> > ---- orig/tpm_emulator-0.4/crypto/rsa.c 2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/crypto/rsa.c  2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,5 +1,6 @@
> > - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> > -+ * Copyright (C) 2005 INTEL Corp
> > -  *
> > -  * This module is free software; you can redistribute it and/or modify
> > -  * it under the terms of the GNU General Public License as published
> > -@@ -381,7 +382,7 @@ static int encode_message(int type, uint
> > -       msg[0] = 0x00;
> > -       get_random_bytes(&msg[1], SHA1_DIGEST_LENGTH);
> > -       sha1_init(&ctx);
> > --      sha1_update(&ctx, "TCPA", 4);
> > -+      sha1_update(&ctx, (uint8_t *) "TCPA", 4);
> > -       sha1_final(&ctx, &msg[1 + SHA1_DIGEST_LENGTH]);
> > -       memset(&msg[1 + 2 * SHA1_DIGEST_LENGTH], 0x00,
> > -         msg_len - data_len - 2 * SHA1_DIGEST_LENGTH - 2);
> > -@@ -429,7 +430,7 @@ static int decode_message(int type, uint
> > -       mask_generation(&msg[1], SHA1_DIGEST_LENGTH,
> > -         &msg[1 + SHA1_DIGEST_LENGTH], msg_len - SHA1_DIGEST_LENGTH - 1);
> > -       sha1_init(&ctx);
> > --      sha1_update(&ctx, "TCPA", 4);
> > -+      sha1_update(&ctx, (uint8_t *) "TCPA", 4);
> > -       sha1_final(&ctx, &msg[1]);
> > -       if (memcmp(&msg[1], &msg[1 + SHA1_DIGEST_LENGTH],
> > -           SHA1_DIGEST_LENGTH) != 0) return -1;
> > -diff -uprN orig/tpm_emulator-0.4/linux_module.c tpm_emulator/linux_module.c
> > ---- orig/tpm_emulator-0.4/linux_module.c       2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/linux_module.c        1969-12-31 16:00:00.000000000 -0800
> > -@@ -1,195 +0,0 @@
> > --/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -- * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> > -- *
> > -- * This module is free software; you can redistribute it and/or modify
> > -- * it under the terms of the GNU General Public License as published
> > -- * by the Free Software Foundation; either version 2 of the License,
> > -- * or (at your option) any later version.
> > -- *
> > -- * This module 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.
> > -- *
> > -- * $Id: linux_module.c 91 2006-03-13 13:51:41Z mast $
> > -- */
> > --
> > --#include <linux/module.h>
> > --#include <linux/kernel.h>
> > --#include <linux/init.h>
> > --#include <linux/miscdevice.h>
> > --#include <linux/poll.h>
> > --#include "linux_module.h"
> > --#include "tpm/tpm_emulator.h"
> > --
> > --MODULE_LICENSE("GPL");
> > --MODULE_AUTHOR("Mario Strasser <mast@gmx.net>");
> > --MODULE_DESCRIPTION("Trusted Platform Module (TPM) Emulator");
> > --MODULE_SUPPORTED_DEVICE(TPM_DEVICE_NAME);
> > --
> > --/* module startup parameters */
> > --char *startup = "save";
> > --module_param(startup, charp, 0444);
> > --MODULE_PARM_DESC(startup, " Sets the startup mode of the TPM. "
> > --  "Possible values are 'clear', 'save' (default) and 'deactivated.");
> > --char *storage_file = "/var/tpm/tpm_emulator-1.2.0.2";
> > --module_param(storage_file, charp, 0644);
> > --MODULE_PARM_DESC(storage_file, " Sets the persistent-data storage "
> > --  "file of the TPM.");
> > --
> > --/* TPM lock */
> > --static struct semaphore tpm_mutex;
> > --
> > --/* TPM command response */
> > --static struct {
> > --  uint8_t *data;
> > --  uint32_t size;
> > --} tpm_response;
> > --
> > --/* module state */
> > --#define STATE_IS_OPEN 0
> > --static uint32_t module_state;
> > --static struct timespec old_time;
> > --
> > --static int tpm_open(struct inode *inode, struct file *file)
> > --{
> > --  debug("%s()", __FUNCTION__);
> > --  if (test_and_set_bit(STATE_IS_OPEN, (void*)&module_state)) return -EBUSY;
> > --  return 0;
> > --}
> > --
> > --static int tpm_release(struct inode *inode, struct file *file)
> > --{
> > --  debug("%s()", __FUNCTION__);
> > --  clear_bit(STATE_IS_OPEN, (void*)&module_state);
> > --  down(&tpm_mutex);
> > --  if (tpm_response.data != NULL) {
> > --    kfree(tpm_response.data);
> > --    tpm_response.data = NULL;
> > --  }
> > --  up(&tpm_mutex);
> > --  return 0;
> > --}
> > --
> > --static ssize_t tpm_read(struct file *file, char *buf, size_t count, loff_t *ppos)
> > --{
> > --  debug("%s(%d)", __FUNCTION__, count);
> > --  down(&tpm_mutex);
> > --  if (tpm_response.data != NULL) {
> > --    count = min(count, (size_t)tpm_response.size - (size_t)*ppos);
> > --    count -= copy_to_user(buf, &tpm_response.data[*ppos], count);
> > --    *ppos += count;
> > --    if ((size_t)tpm_response.size == (size_t)*ppos) {
> > --      kfree(tpm_response.data);
> > --      tpm_response.data = NULL;
> > --    }
> > --  } else {
> > --    count = 0;
> > --  }
> > --  up(&tpm_mutex);
> > --  return count;
> > --}
> > --
> > --static ssize_t tpm_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
> > --{
> > --  debug("%s(%d)", __FUNCTION__, count);
> > --  down(&tpm_mutex);
> > --  *ppos = 0;
> > --  if (tpm_response.data != NULL) kfree(tpm_response.data);
> > --  if (tpm_handle_command(buf, count, &tpm_response.data,
> > --                         &tpm_response.size) != 0) {
> > --    count = -EILSEQ;
> > --    tpm_response.data = NULL;
> > --  }
> > --  up(&tpm_mutex);
> > --  return count;
> > --}
> > --
> > --#define TPMIOC_CANCEL   _IO('T', 0x00)
> > --#define TPMIOC_TRANSMIT _IO('T', 0x01)
> > --
> > --static int tpm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
> > --{
> > --  debug("%s(%d, %p)", __FUNCTION__, cmd, (char*)arg);
> > --  if (cmd == TPMIOC_TRANSMIT) {
> > --    uint32_t count = ntohl(*(uint32_t*)(arg + 2));
> > --    down(&tpm_mutex);
> > --    if (tpm_response.data != NULL) kfree(tpm_response.data);
> > --    if (tpm_handle_command((char*)arg, count, &tpm_response.data,
> > --                           &tpm_response.size) == 0) {
> > --      tpm_response.size -= copy_to_user((char*)arg, tpm_response.data,
> > --                            tpm_response.size);
> > --      kfree(tpm_response.data);
> > --      tpm_response.data = NULL;
> > --    } else {
> > --      tpm_response.size = 0;
> > --      tpm_response.data = NULL;
> > --    }
> > --    up(&tpm_mutex);
> > --    return tpm_response.size;
> > --  }
> > --  return -1;
> > --}
> > --
> > --struct file_operations fops = {
> > --  .owner   = THIS_MODULE,
> > --  .open    = tpm_open,
> > --  .release = tpm_release,
> > --  .read    = tpm_read,
> > --  .write   = tpm_write,
> > --  .ioctl   = tpm_ioctl,
> > --};
> > --
> > --static struct miscdevice tpm_dev = {
> > --  .minor      = TPM_DEVICE_MINOR,
> > --  .name       = TPM_DEVICE_NAME,
> > --  .fops       = &fops,
> > --};
> > --
> > --int __init init_tpm_module(void)
> > --{
> > --  int res = misc_register(&tpm_dev);
> > --  if (res != 0) {
> > --    error("misc_register() failed for minor %d\n", TPM_DEVICE_MINOR);
> > --    return res;
> > --  }
> > --  /* initialize variables */
> > --  sema_init(&tpm_mutex, 1);
> > --  module_state = 0;
> > --  tpm_response.data = NULL;
> > --  old_time = current_kernel_time();
> > --  /* initialize TPM emulator */
> > --  if (!strcmp(startup, "clear")) {
> > --    tpm_emulator_init(1);
> > --  } else if (!strcmp(startup, "save")) {
> > --    tpm_emulator_init(2);
> > --  } else if (!strcmp(startup, "deactivated")) {
> > --    tpm_emulator_init(3);
> > --  } else {
> > --    error("invalid startup mode '%s'; must be 'clear', "
> > --      "'save' (default) or 'deactivated", startup);
> > --    misc_deregister(&tpm_dev);
> > --    return -EINVAL;
> > --  }
> > --  return 0;
> > --}
> > --
> > --void __exit cleanup_tpm_module(void)
> > --{
> > --  tpm_emulator_shutdown();
> > --  misc_deregister(&tpm_dev);
> > --  if (tpm_response.data != NULL) kfree(tpm_response.data);
> > --}
> > --
> > --module_init(init_tpm_module);
> > --module_exit(cleanup_tpm_module);
> > --
> > --uint64_t tpm_get_ticks(void)
> > --{
> > --  struct timespec new_time = current_kernel_time();
> > --  uint64_t ticks = (uint64_t)(new_time.tv_sec - old_time.tv_sec) * 1000000
> > --                   + (new_time.tv_nsec - old_time.tv_nsec) / 1000;
> > --  old_time = new_time;
> > --  return (ticks > 0) ? ticks : 1;
> > --}
> > --
> > -diff -uprN orig/tpm_emulator-0.4/linux_module.h tpm_emulator/linux_module.h
> > ---- orig/tpm_emulator-0.4/linux_module.h       2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/linux_module.h        2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,5 +1,6 @@
> > - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> > -+ * Copyright (C) 2005 INTEL Corp
> > -  *
> > -  * This module is free software; you can redistribute it and/or modify
> > -  * it under the terms of the GNU General Public License as published
> > -@@ -17,54 +18,62 @@
> > - #ifndef _LINUX_MODULE_H_
> > - #define _LINUX_MODULE_H_
> > -
> > --#include <linux/version.h>
> > --#include <linux/kernel.h>
> > --#include <linux/slab.h>
> > -+#include <malloc.h>
> > -+#include <stdint.h>
> > -+#include <stdio.h>
> > -+#include <string.h>
> > - #include <linux/types.h>
> > --#include <linux/string.h>
> > --#include <linux/random.h>
> > --#include <linux/time.h>
> > --#include <asm/byteorder.h>
> > -
> > --/* module settings */
> > -+#include <endian.h>
> > -+#define __BYTEORDER_HAS_U64__
> > -+#ifdef LITTLE_ENDIAN
> > -+ #include <linux/byteorder/little_endian.h>
> > -+#else
> > -+ #include <linux/byteorder/big_endian.h>
> > -+#endif
> > -
> > -+/* module settings */
> > -+#define min(A,B) ((A)<(B)?(A):(B))
> > -+#ifndef STR
> > - #define STR(s) __STR__(s)
> > - #define __STR__(s) #s
> > -+#endif
> > - #include "tpm_version.h"
> > -
> > - #define TPM_DEVICE_MINOR  224
> > - #define TPM_DEVICE_NAME   "tpm"
> > - #define TPM_MODULE_NAME   "tpm_emulator"
> > -
> > --/* debug and log output functions */
> > --
> > - #ifdef DEBUG
> > --#define debug(fmt, ...) printk(KERN_DEBUG "%s %s:%d: Debug: " fmt "\n", \
> > --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define debug(fmt, ...) printf("TPMD: %s:%d: Debug: " fmt "\n", \
> > -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> > - #else
> > - #define debug(fmt, ...)
> > - #endif
> > --#define info(fmt, ...)  printk(KERN_INFO "%s %s:%d: Info: " fmt "\n", \
> > --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> > --#define error(fmt, ...) printk(KERN_ERR "%s %s:%d: Error: " fmt "\n", \
> > --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> > --#define alert(fmt, ...) printk(KERN_ALERT "%s %s:%d: Alert: " fmt "\n", \
> > --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define info(fmt, ...)  printf("TPMD: %s:%d: Info: " fmt "\n", \
> > -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define error(fmt, ...) printf("TPMD: %s:%d: Error: " fmt "\n", \
> > -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define alert(fmt, ...) printf("TPMD: %s:%d: Alert: " fmt "\n", \
> > -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> > -
> > - /* memory allocation */
> > -
> > - static inline void *tpm_malloc(size_t size)
> > - {
> > --  return kmalloc(size, GFP_KERNEL);
> > -+  return malloc(size);
> > - }
> > -
> > - static inline void tpm_free(const void *ptr)
> > - {
> > --  if (ptr != NULL) kfree(ptr);
> > -+  if (ptr != NULL) free( (void *) ptr);
> > - }
> > -
> > - /* random numbers */
> > -
> > -+//FIXME;
> > -+void get_random_bytes(void *buf, int nbytes);
> > -+
> > - static inline void tpm_get_random_bytes(void *buf, int nbytes)
> > - {
> > -   get_random_bytes(buf, nbytes);
> > -@@ -84,9 +93,9 @@ uint64_t tpm_get_ticks(void);
> > - #define CPU_TO_LE16(x) __cpu_to_le16(x)
> > -
> > - #define BE64_TO_CPU(x) __be64_to_cpu(x)
> > --#define LE64_TO_CPU(x) __be64_to_cpu(x)
> > -+#define LE64_TO_CPU(x) __le64_to_cpu(x)
> > - #define BE32_TO_CPU(x) __be32_to_cpu(x)
> > --#define LE32_TO_CPU(x) __be32_to_cpu(x)
> > -+#define LE32_TO_CPU(x) __le32_to_cpu(x)
> > - #define BE16_TO_CPU(x) __be16_to_cpu(x)
> > - #define LE16_TO_CPU(x) __le16_to_cpu(x)
> > -
> > -diff -uprN orig/tpm_emulator-0.4/Makefile tpm_emulator/Makefile
> > ---- orig/tpm_emulator-0.4/Makefile     2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/Makefile      2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,24 +1,40 @@
> > - # Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > - # Copyright (C) 2004 Mario Strasser <mast@gmx.net>
> > -+# Copyright (C) 2006 INTEL Corp.
> > - #
> > - # $Id: Makefile 115 2006-06-23 10:36:44Z mast $
> > -
> > --# kernel settings
> > --KERNEL_RELEASE := $(shell uname -r)
> > --KERNEL_BUILD   := /lib/modules/$(KERNEL_RELEASE)/build
> > --MOD_SUBDIR     := misc
> > -+COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
> > -
> > - # module settings
> > --MODULE_NAME    := tpm_emulator
> > -+BIN            := tpm_emulator
> > - VERSION_MAJOR  := 0
> > - VERSION_MINOR  := 4
> > - VERSION_BUILD  := $(shell date +"%s")
> > -
> > --# enable/disable DEBUG messages
> > --EXTRA_CFLAGS   += -Wall -DDEBUG -g
> > -+# Installation program and options
> > -+INSTALL         = install
> > -+INSTALL_PROG    = $(INSTALL) -m0755
> > -+INSTALL_DIR     = $(INSTALL) -d -m0755
> > -+
> > -+# Xen tools installation directory
> > -+TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin
> > -+
> > -+CC      := gcc
> > -+CFLAGS  += -g -Wall $(INCLUDE) -DDEBUG
> > -+CFLAGS  += -I. -Itpm
> > -+
> > -+# Is the simulator running in it's own vm?
> > -+#CFLAGS += -DVTPM_MULTI_VM
> > -+
> > -+ifeq ($(COMPILE_ARCH),x86_64)
> > -+LIBDIR = lib64
> > -+else
> > -+LIBDIR = lib
> > -+endif
> > -
> > - # GNU MP configuration
> > --GMP_LIB        := /usr/lib/libgmp.a
> > -+GMP_LIB        := /usr/$(LIBDIR)/libgmp.a
> > - GMP_HEADER     := /usr/include/gmp.h
> > -
> > - # sources and objects
> > -@@ -27,38 +43,32 @@ DIRS           := . crypto tpm
> > - SRCS           := $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.c))
> > - OBJS           := $(patsubst %.c, %.o, $(SRCS))
> > - SRCS           += $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.h))
> > --DISTSRC        := ./README ./AUTHORS ./ChangeLog ./Makefile $(SRCS)
> > --DISTDIR        := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)
> > -
> > --obj-m               := $(MODULE_NAME).o
> > --$(MODULE_NAME)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
> > -+obj-m               := $(BIN)
> > -+$(BIN)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
> > -
> > - EXTRA_CFLAGS   += -I$(src) -I$(src)/crypto -I$(src)/tpm
> > -
> > - # do not print "Entering directory ..."
> > - MAKEFLAGS      += --no-print-directory
> > -
> > --all:  $(src)/crypto/gmp.h $(src)/crypto/libgmp.a version
> > --      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules
> > -+all: $(BIN)
> > -
> > --install:
> > --      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules_install
> > --      test -d /var/tpm || mkdir /var/tpm
> > --      test -c /dev/tpm || mknod /dev/tpm c 10 224
> > --      chmod 666 /dev/tpm
> > --      depmod -a
> > -+$(BIN):       $(src)/crypto/gmp.h $(src)/crypto/libgmp.a version $(SRCS) $(OBJS)
> > -+      $(CC) $(CFLAGS) $(OBJS) $(src)/crypto/libgmp.a -o $(BIN)
> > -+
> > -+%.o: %.c
> > -+      $(CC) $(CFLAGS) -c $< -o $@
> > -+
> > -+install: $(BIN)
> > -+      $(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)
> > -+      @if [ ! -d "/var/tpm" ]; then mkdir /var/tpm; fi
> > -
> > - clean:
> > --      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) clean
> > --      rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a
> > -+      rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a $(OBJS)
> > -
> > --dist: $(DISTSRC)
> > --      rm -rf $(DISTDIR)
> > --      mkdir $(DISTDIR)
> > --      cp --parents $(DISTSRC) $(DISTDIR)/
> > --      rm -f $(DISTDIR)/crypto/gmp.h
> > --      tar -chzf $(DISTDIR).tar.gz $(DISTDIR)
> > --      rm -rf $(DISTDIR)
> > -+mrproper: clean
> > -+      rm -f $(BIN) tpm_version.h
> > -
> > - $(src)/crypto/libgmp.a:
> > -       test -f $(src)/crypto/libgmp.a || ln -s $(GMP_LIB) $(src)/crypto/libgmp.a
> > -@@ -88,4 +98,3 @@ version:
> > -       @echo "#endif /* _TPM_VERSION_H_ */" >> $(src)/tpm_version.h
> > -
> > - .PHONY: all install clean dist gmp version
> > --
> > -diff -uprN orig/tpm_emulator-0.4/README tpm_emulator/README
> > ---- orig/tpm_emulator-0.4/README       2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/README        2006-07-24 14:35:35.000000000 -0700
> > -@@ -13,7 +13,8 @@ $Id: README 113 2006-06-18 12:38:13Z hst
> > - Copyright
> > - --------------------------------------------------------------------------
> > - Copyright (C) 2004 Mario Strasser <mast@gmx.net> and Swiss Federal
> > --Institute of Technology (ETH) Zurich.
> > -+                   Institute of Technology (ETH) Zurich.
> > -+Copyright (C) 2005 INTEL Corp
> > -
> > - This program is free software; you can redistribute it and/or modify
> > - it under the terms of the GNU General Public License as published by
> > -@@ -43,6 +44,12 @@ Example:
> > - GMP_LIB        := /usr/lib/libgmp.a
> > - GMP_HEADER     := /usr/include/gmp.h
> > -
> > -+GNU MP Library on 64 bit Systems
> > -+--------------------------------------------------------------------------
> > -+Some 64-bit kernels have problems with importing the user-space gmp
> > -+library (/usr/lib*/libgmp.a) into kernel space.  These kernels will require
> > -+that the gmp library be recompiled for kernel space with -mcmodel=kernel.
> > -+
> > - Installation
> > - --------------------------------------------------------------------------
> > - The compilation and installation process uses the build environment for
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_capability.c tpm_emulator/tpm/tpm_capability.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_capability.c 2006-06-23 19:37:07.000000000 +0900
> > -+++ tpm_emulator/tpm/tpm_capability.c  2007-12-28 22:50:19.000000000 +0900
> > -@@ -701,7 +701,10 @@ TPM_RESULT TPM_GetCapabilityOwner(TPM_VE
> > -   TPM_RESULT res;
> > -
> > -   info("TPM_GetCapabilityOwner()");
> > --
> > -+
> > -+  if (!tpmData.permanent.flags.owned) {
> > -+    return TPM_NOSRK;
> > -+  }
> > -   /* Verify owner authorization */
> > -   res = tpm_verify_auth(auth1, tpmData.permanent.data.ownerAuth, TPM_KH_OWNER);
> > -   if (res != TPM_SUCCESS) return res;
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c tpm_emulator/tpm/tpm_cmd_handler.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c        2006-06-23 19:37:07.000000000 +0900
> > -+++ tpm_emulator/tpm/tpm_cmd_handler.c 2007-09-12 20:23:00.000000000 +0900
> > -@@ -565,7 +565,7 @@ static TPM_RESULT execute_TPM_Seal(TPM_R
> > -   if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle)
> > -       || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth)
> > -       || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize)
> > --      || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)
> > -+      || (pcrInfoSize >0 && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo))
> > -       || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize)
> > -       || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize)
> > -       || len != 0) return TPM_BAD_PARAMETER;
> > -@@ -798,7 +798,7 @@ static TPM_RESULT execute_TPM_Sealx(TPM_
> > -   if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle)
> > -       || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth)
> > -       || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize)
> > --      || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)
> > -+      || (pcrInfoSize > 0 && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo))
> > -       || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize)
> > -       || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize)
> > -       || len != 0) return TPM_BAD_PARAMETER;
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_credentials.c tpm_emulator/tpm/tpm_credentials.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_credentials.c        2006-06-23 19:37:07.000000000 +0900
> > -+++ tpm_emulator/tpm/tpm_credentials.c 2007-09-12 20:23:30.000000000 +0900
> > -@@ -47,20 +47,20 @@ int tpm_compute_pubkey_checksum(TPM_NONC
> > -
> > - TPM_RESULT tpm_get_pubek(TPM_PUBKEY *pubEndorsementKey)
> > - {
> > --  UINT32 key_length;
> > -+  size_t key_length;
> > -   if (!tpmData.permanent.data.endorsementKey.size) return TPM_NO_ENDORSEMENT;
> > -   /* setup TPM_PUBKEY structure */
> > --  key_length = tpmData.permanent.data.endorsementKey.size;
> > --  pubEndorsementKey->pubKey.keyLength = key_length >> 3;
> > -+  pubEndorsementKey->pubKey.keyLength = tpmData.permanent.data.endorsementKey.size >> 3;
> > -   pubEndorsementKey->pubKey.key = tpm_malloc(pubEndorsementKey->pubKey.keyLength);
> > -   if (pubEndorsementKey->pubKey.key == NULL) return TPM_FAIL;
> > -   rsa_export_modulus(&tpmData.permanent.data.endorsementKey,
> > --    pubEndorsementKey->pubKey.key,
> > --    &pubEndorsementKey->pubKey.keyLength);
> > -+                   pubEndorsementKey->pubKey.key,
> > -+                   &key_length);
> > -+  pubEndorsementKey->pubKey.keyLength = key_length;
> > -   pubEndorsementKey->algorithmParms.algorithmID = TPM_ALG_RSA;
> > -   pubEndorsementKey->algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
> > -   pubEndorsementKey->algorithmParms.sigScheme = TPM_SS_NONE;
> > --  pubEndorsementKey->algorithmParms.parms.rsa.keyLength = key_length;
> > -+  pubEndorsementKey->algorithmParms.parms.rsa.keyLength = key_length << 3;
> > -   pubEndorsementKey->algorithmParms.parms.rsa.numPrimes = 2;
> > -   pubEndorsementKey->algorithmParms.parms.rsa.exponentSize = 0;
> > -   pubEndorsementKey->algorithmParms.parms.rsa.exponent = NULL;
> > -@@ -175,6 +175,7 @@ TPM_RESULT TPM_OwnerReadInternalPub(TPM_
> > - {
> > -   TPM_RESULT res;
> > -   TPM_KEY_DATA *srk = &tpmData.permanent.data.srk;
> > -+  size_t key_length;
> > -   info("TPM_OwnerReadInternalPub()");
> > -   /* verify authorization */
> > -   res = tpm_verify_auth(auth1, tpmData.permanent.data.ownerAuth, TPM_KH_OWNER);
> > -@@ -186,7 +187,8 @@ TPM_RESULT TPM_OwnerReadInternalPub(TPM_
> > -     publicPortion->pubKey.key = tpm_malloc(publicPortion->pubKey.keyLength);
> > -     if (publicPortion->pubKey.key == NULL) return TPM_FAIL;
> > -     rsa_export_modulus(&srk->key, publicPortion->pubKey.key,
> > --      &publicPortion->pubKey.keyLength);
> > -+      &key_length);
> > -+    publicPortion->pubKey.keyLength = key_length;
> > -     publicPortion->algorithmParms.algorithmID = TPM_ALG_RSA;
> > -     publicPortion->algorithmParms.encScheme = srk->encScheme;
> > -     publicPortion->algorithmParms.sigScheme = srk->sigScheme;
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_crypto.c tpm_emulator/tpm/tpm_crypto.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_crypto.c     2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_crypto.c      2006-07-24 14:35:35.000000000 -0700
> > -@@ -182,7 +182,8 @@ TPM_RESULT TPM_CertifyKey(TPM_KEY_HANDLE
> > -   TPM_KEY_DATA *cert, *key;
> > -   sha1_ctx_t sha1_ctx;
> > -   BYTE *buf, *p;
> > --  UINT32 length;
> > -+  UINT32 length32;
> > -+  size_t length;
> > -   info("TPM_CertifyKey()");
> > -   /* get keys */
> > -   cert = tpm_get_key(certHandle);
> > -@@ -264,14 +265,15 @@ TPM_RESULT TPM_CertifyKey(TPM_KEY_HANDLE
> > -   /* compute the digest of the CERTIFY_INFO[2] structure and sign it */
> > -   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
> > -   p = buf = tpm_malloc(length);
> > -+  length32=(UINT32) length;
> > -   if (buf == NULL
> > --      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length, certifyInfo)) {
> > -+      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length32, certifyInfo)) {
> > -     free_TPM_KEY_PARMS(certifyInfo->algorithmParms);
> > -     return TPM_FAIL;
> > -   }
> > -   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
> > -   sha1_init(&sha1_ctx);
> > --  sha1_update(&sha1_ctx, buf, length);
> > -+  sha1_update(&sha1_ctx, buf, (size_t) length);
> > -   sha1_final(&sha1_ctx, buf);
> > -   res = tpm_sign(cert, auth1, FALSE, buf, SHA1_DIGEST_LENGTH, outData, outDataSize);
> > -   tpm_free(buf);
> > -@@ -292,7 +294,8 @@ TPM_RESULT TPM_CertifyKey2(TPM_KEY_HANDL
> > -   TPM_KEY_DATA *cert, *key;
> > -   sha1_ctx_t sha1_ctx;
> > -   BYTE *buf, *p;
> > --  UINT32 length;
> > -+  size_t length;
> > -+  UINT32 length32;
> > -   info("TPM_CertifyKey2()");
> > -   /* get keys */
> > -   cert = tpm_get_key(certHandle);
> > -@@ -362,8 +365,9 @@ TPM_RESULT TPM_CertifyKey2(TPM_KEY_HANDL
> > -   /* compute the digest of the CERTIFY_INFO[2] structure and sign it */
> > -   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
> > -   p = buf = tpm_malloc(length);
> > -+  length32 = (UINT32) length;
> > -   if (buf == NULL
> > --      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length, certifyInfo)) {
> > -+      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length32, certifyInfo)) {
> > -     free_TPM_KEY_PARMS(certifyInfo->algorithmParms);
> > -     return TPM_FAIL;
> > -   }
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_daa.c tpm_emulator/tpm/tpm_daa.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_daa.c        2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_daa.c 2006-07-24 14:35:35.000000000 -0700
> > -@@ -716,14 +716,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x00", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> > -       sha1_final(&sha1, scratch);
> > -       sha1_init(&sha1);
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x01", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> > -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> > -       mpz_init(f), mpz_init(q);
> > -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> > -@@ -805,14 +805,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x00", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> > -       sha1_final(&sha1, scratch);
> > -       sha1_init(&sha1);
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x01", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> > -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> > -       mpz_init(f), mpz_init(q);
> > -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> > -@@ -1489,14 +1489,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x00", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> > -       sha1_final(&sha1, scratch);
> > -       sha1_init(&sha1);
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x01", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> > -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> > -       mpz_init(f), mpz_init(q);
> > -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> > -@@ -1712,14 +1712,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x00", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> > -       sha1_final(&sha1, scratch);
> > -       sha1_init(&sha1);
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x01", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> > -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> > -       mpz_init(f), mpz_init(q);
> > -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> > -@@ -1793,14 +1793,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x00", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> > -       sha1_final(&sha1, scratch);
> > -       sha1_init(&sha1);
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x01", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> > -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> > -       mpz_init(f), mpz_init(q);
> > -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> > -@@ -2918,14 +2918,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x00", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> > -       sha1_final(&sha1, scratch);
> > -       sha1_init(&sha1);
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x01", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> > -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> > -       mpz_init(f), mpz_init(q);
> > -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> > -@@ -3143,7 +3143,7 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> > -         sha1_init(&sha1);
> > -         sha1_update(&sha1, (BYTE*) &session->DAA_session.DAA_digest,
> > -           sizeof(session->DAA_session.DAA_digest));
> > --        sha1_update(&sha1, "\x01", 1);
> > -+        sha1_update(&sha1, (BYTE *) "\x01", 1);
> > -         sha1_update(&sha1, inputData1, inputSize1);
> > -         sha1_final(&sha1, (BYTE*) &session->DAA_session.DAA_digest);
> > -       }
> > -@@ -3172,7 +3172,7 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> > -         sha1_init(&sha1);
> > -         sha1_update(&sha1, (BYTE*) &session->DAA_session.DAA_digest,
> > -           sizeof(session->DAA_session.DAA_digest));
> > --        sha1_update(&sha1, "\x00", 1);
> > -+        sha1_update(&sha1, (BYTE*) "\x00", 1);
> > -         rsa_export_modulus(&aikData->key, scratch, &size);
> > -         sha1_update(&sha1, scratch, size);
> > -         sha1_final(&sha1, (BYTE*) &session->DAA_session.DAA_digest);
> > -@@ -3229,14 +3229,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x00", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> > -       sha1_final(&sha1, scratch);
> > -       sha1_init(&sha1);
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x01", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> > -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> > -       mpz_init(f), mpz_init(q);
> > -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> > -@@ -3309,14 +3309,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x00", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> > -       sha1_final(&sha1, scratch);
> > -       sha1_init(&sha1);
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> > -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> > -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> > -           sizeof(session->DAA_tpmSpecific.DAA_count));
> > --      sha1_update(&sha1, "\x01", 1);
> > -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> > -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> > -       mpz_init(f), mpz_init(q);
> > -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_data.c tpm_emulator/tpm/tpm_data.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_data.c       2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_data.c        2006-07-24 14:35:35.000000000 -0700
> > -@@ -40,6 +40,7 @@ static inline void init_pcr_attr(int pcr
> > - void tpm_init_data(void)
> > - {
> > -   /* endorsement key */
> > -+#ifndef TPM_GENERATE_EK
> > -   uint8_t ek_n[] =  "\xa8\xdb\xa9\x42\xa8\xf3\xb8\x06\x85\x90\x76\x93\xad\xf7"
> > -     "\x74\xec\x3f\xd3\x3d\x9d\xe8\x2e\xff\x15\xed\x0e\xce\x5f\x93"
> > -     "\x92\xeb\xd1\x96\x2b\x72\x18\x81\x79\x12\x9d\x9c\x40\xd7\x1a"
> > -@@ -77,6 +78,8 @@ void tpm_init_data(void)
> > -     "\xd1\xc0\x8b\x5b\xa2\x2e\xa7\x15\xca\x50\x75\x10\x48\x9c\x2b"
> > -     "\x18\xb9\x67\x8f\x5d\x64\xc3\x28\x9f\x2f\x16\x2f\x08\xda\x47"
> > -     "\xec\x86\x43\x0c\x80\x99\x07\x34\x0f";
> > -+#endif
> > -+
> > -   int i;
> > -   /* reset all data to NULL, FALSE or 0 */
> > -   memset(&tpmData, 0, sizeof(tpmData));
> > -@@ -152,44 +155,43 @@ void tpm_release_data(void)
> > -
> > - #ifdef TPM_STORE_TO_FILE
> > -
> > --#include <linux/fs.h>
> > --#include <linux/unistd.h>
> > --#include <asm/uaccess.h>
> > -+#include <sys/types.h>
> > -+#include <sys/stat.h>
> > -+#include <fcntl.h>
> > -+#include <unistd.h>
> > -
> > - #define TPM_STORAGE_FILE "/var/tpm/tpm_emulator-1.2." STR(VERSION_MAJOR) "." STR(VERSION_MINOR)
> > -
> > - static int write_to_file(uint8_t *data, size_t data_length)
> > - {
> > -   int res;
> > --  struct file *fp;
> > --  mm_segment_t old_fs = get_fs();
> > --  fp = filp_open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> > --  if (IS_ERR(fp)) return -1;
> > --  set_fs(get_ds());
> > --  res = fp->f_op->write(fp, data, data_length, &fp->f_pos);
> > --  set_fs(old_fs);
> > --  filp_close(fp, NULL);
> > -+  int fp;
> > -+  fp = open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> > -+  res = write(fp, data, data_length);
> > -+  close(fp);
> > -   return (res == data_length) ? 0 : -1;
> > - }
> > -
> > - static int read_from_file(uint8_t **data, size_t *data_length)
> > - {
> > -   int res;
> > --  struct file *fp;
> > --  mm_segment_t old_fs = get_fs();
> > --  fp = filp_open(TPM_STORAGE_FILE, O_RDONLY, 0);
> > --  if (IS_ERR(fp)) return -1;
> > --  *data_length = (size_t)fp->f_dentry->d_inode->i_size;
> > --  /* *data_length = i_size_read(fp->f_dentry->d_inode); */
> > -+  int fp, file_status;
> > -+  struct stat file_info;
> > -+  fp = open(TPM_STORAGE_FILE, O_RDONLY, 0);
> > -+  file_status = fstat(fp, &file_info);
> > -+  if (file_status < 0) {
> > -+    close(fp);
> > -+    return -1;
> > -+  }
> > -+
> > -+  *data_length = file_info.st_size;
> > -   *data = tpm_malloc(*data_length);
> > -   if (*data == NULL) {
> > --    filp_close(fp, NULL);
> > -+    close(fp);
> > -     return -1;
> > -   }
> > --  set_fs(get_ds());
> > --  res = fp->f_op->read(fp, *data, *data_length, &fp->f_pos);
> > --  set_fs(old_fs);
> > --  filp_close(fp, NULL);
> > -+  res = read(fp, *data, *data_length);
> > -+  close(fp);
> > -   if (res != *data_length) {
> > -     tpm_free(*data);
> > -     return -1;
> > -@@ -216,23 +218,30 @@ static int read_from_file(uint8_t **data
> > - int tpm_store_permanent_data(void)
> > - {
> > -   uint8_t *buf, *ptr;
> > --  size_t buf_length, len;
> > -+  UINT32 buf_length, len;
> > -
> > -   /* marshal data */
> > --  buf_length = len = sizeof_TPM_STCLEAR_FLAGS(tpmData.stclear.flags)
> > --    + sizeof_TPM_PERMANENT_FLAGS(tpmData.permanent.flags) + 2
> > --    + sizeof_TPM_PERMANENT_DATA(tpmData.permanent.data);
> > -+  buf_length = len = 4 + sizeof_TPM_STCLEAR_FLAGS(tpmData.stclear.flags)
> > -+    + sizeof_TPM_PERMANENT_FLAGS(tpmData.permanent.flags)
> > -+    + sizeof_TPM_STANY_FLAGS(tpmData.stany.flags) + 2
> > -+    + sizeof_TPM_STCLEAR_DATA(tpmData.stclear.data)
> > -+    + sizeof_TPM_PERMANENT_DATA(tpmData.permanent.data)
> > -+    + sizeof_TPM_STANY_DATA(tpmData.stany.data);
> > -   buf = ptr = tpm_malloc(buf_length);
> > -   if (buf == NULL
> > -       || tpm_marshal_TPM_VERSION(&ptr, &len, &tpmData.permanent.data.version)
> > -       || tpm_marshal_TPM_STCLEAR_FLAGS(&ptr, &len, &tpmData.stclear.flags)
> > -       || tpm_marshal_TPM_PERMANENT_FLAGS(&ptr, &len, &tpmData.permanent.flags)
> > -+      || tpm_marshal_TPM_STANY_FLAGS(&ptr, &len, &tpmData.stany.flags)
> > -       || tpm_marshal_BOOL(&ptr, &len, tpmData.permanent.flags.selfTestSucceeded)
> > -       || tpm_marshal_BOOL(&ptr, &len, tpmData.permanent.flags.owned)
> > --      || tpm_marshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)) {
> > -+      || tpm_marshal_TPM_STCLEAR_DATA(&ptr, &len, &tpmData.stclear.data)
> > -+      || tpm_marshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)
> > -+      || tpm_marshal_TPM_STANY_DATA(&ptr, &len, &tpmData.stany.data)) {
> > -     tpm_free(buf);
> > -     return -1;
> > -   }
> > -+
> > -   if (write_to_file(buf, buf_length - len)) {
> > -     tpm_free(buf);
> > -     return -1;
> > -@@ -244,31 +253,36 @@ int tpm_store_permanent_data(void)
> > - int tpm_restore_permanent_data(void)
> > - {
> > -   uint8_t *buf, *ptr;
> > --  size_t buf_length, len;
> > -+  size_t buf_length;
> > -+  UINT32 len;
> > -   TPM_VERSION ver;
> > -
> > -   /* read data */
> > -   if (read_from_file(&buf, &buf_length)) return -1;
> > -   ptr = buf;
> > --  len = buf_length;
> > -+  len = (uint32_t) buf_length;
> > -   /* unmarshal data */
> > -   if (tpm_unmarshal_TPM_VERSION(&ptr, &len, &ver)
> > -       || memcmp(&ver, &tpmData.permanent.data.version, sizeof(TPM_VERSION))
> > -       || tpm_unmarshal_TPM_STCLEAR_FLAGS(&ptr, &len, &tpmData.stclear.flags)
> > -       || tpm_unmarshal_TPM_PERMANENT_FLAGS(&ptr, &len, &tpmData.permanent.flags)
> > -+      || tpm_unmarshal_TPM_STANY_FLAGS(&ptr, &len, &tpmData.stany.flags)
> > -       || tpm_unmarshal_BOOL(&ptr, &len, &tpmData.permanent.flags.selfTestSucceeded)
> > -       || tpm_unmarshal_BOOL(&ptr, &len, &tpmData.permanent.flags.owned)
> > --      || tpm_unmarshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)) {
> > -+      || tpm_unmarshal_TPM_STCLEAR_DATA(&ptr, &len, &tpmData.stclear.data)
> > -+      || tpm_unmarshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)
> > -+      || tpm_unmarshal_TPM_STANY_DATA(&ptr, &len, &tpmData.stany.data)) {
> > -     tpm_free(buf);
> > -     return -1;
> > -   }
> > -+
> > -   tpm_free(buf);
> > -   return 0;
> > - }
> > -
> > - int tpm_erase_permanent_data(void)
> > - {
> > --  int res = write_to_file("", 0);
> > -+  int res = write_to_file((uint8_t *) "", 0);
> > -   return res;
> > - }
> > -
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_deprecated.c tpm_emulator/tpm/tpm_deprecated.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_deprecated.c 2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_deprecated.c  2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,6 +1,7 @@
> > - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> > -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> > -+ * Copyright (C) 2005 INTEL Corp
> > -  *
> > -  * This module is free software; you can redistribute it and/or modify
> > -  * it under the terms of the GNU General Public License as published
> > -@@ -50,7 +51,7 @@ TPM_RESULT TPM_SaveKeyContext(TPM_KEY_HA
> > -   BYTE *ptr;
> > -   UINT32 len;
> > -   info("TPM_SaveKeyContext()");
> > --  res = TPM_SaveContext(keyHandle, TPM_RT_KEY, "SaveKeyContext..",
> > -+  res = TPM_SaveContext(keyHandle, TPM_RT_KEY, (BYTE*)"SaveKeyContext..",
> > -                         keyContextSize, &contextBlob);
> > -   if (res != TPM_SUCCESS) return res;
> > -   len = *keyContextSize;
> > -@@ -82,7 +83,7 @@ TPM_RESULT TPM_SaveAuthContext(TPM_AUTHH
> > -   BYTE *ptr;
> > -   UINT32 len;
> > -   info("TPM_SaveAuthContext()");
> > --  res = TPM_SaveContext(authHandle, TPM_RT_KEY, "SaveAuthContext.",
> > -+  res = TPM_SaveContext(authHandle, TPM_RT_KEY, (BYTE*)"SaveAuthContext.",
> > -                         authContextSize, &contextBlob);
> > -   if (res != TPM_SUCCESS) return res;
> > -   len = *authContextSize;
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_emulator.h tpm_emulator/tpm/tpm_emulator.h
> > ---- orig/tpm_emulator-0.4/tpm/tpm_emulator.h   2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_emulator.h    2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,5 +1,6 @@
> > - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> > -+ * Copyright (C) 2005 INTEL Corp
> > -  *
> > -  * This module is free software; you can redistribute it and/or modify
> > -  * it under the terms of the GNU General Public License as published
> > -@@ -22,7 +23,8 @@
> > - /* TPM configuration */
> > - #define TPM_STORE_TO_FILE       1
> > - #undef  TPM_STRONG_PERSISTENCE
> > --#undef  TPM_GENERATE_EK
> > -+//#undef  TPM_GENERATE_EK
> > -+#define  TPM_GENERATE_EK
> > - #undef  TPM_GENERATE_SEED_DAA
> > -
> > - #define TPM_MANUFACTURER 0x4554485A /* 'ETHZ' */
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_marshalling.c tpm_emulator/tpm/tpm_marshalling.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_marshalling.c        2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_marshalling.c 2006-07-24 14:35:35.000000000 -0700
> > -@@ -1312,7 +1312,7 @@ int tpm_unmarshal_TPM_STANY_FLAGS(BYTE *
> > -
> > - int tpm_marshal_RSA(BYTE **ptr, UINT32 *length, rsa_private_key_t *v)
> > - {
> > --  UINT32 m_len, e_len, q_len;
> > -+  size_t m_len, e_len, q_len;
> > -   if (*length < sizeof_RSA((*v))) return -1;
> > -   if (v->size > 0) {
> > -     rsa_export_modulus(v, &(*ptr)[6], &m_len);
> > -@@ -1460,6 +1460,66 @@ int tpm_unmarshal_TPM_PERMANENT_DATA(BYT
> > -   return 0;
> > - }
> > -
> > -+int tpm_marshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v)
> > -+{
> > -+  if (tpm_marshal_TPM_STRUCTURE_TAG(ptr, length, v->tag)
> > -+    || tpm_marshal_TPM_NONCE(ptr, length, &v->contextNonceKey)
> > -+    || tpm_marshal_TPM_COUNT_ID(ptr, length, v->countID) ) return -1;
> > -+
> > -+  return 0;
> > -+}
> > -+
> > -+int tpm_unmarshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v)
> > -+{
> > -+  if (tpm_unmarshal_TPM_STRUCTURE_TAG(ptr, length, &v->tag)
> > -+    || tpm_unmarshal_TPM_NONCE(ptr, length, &v->contextNonceKey)
> > -+    || tpm_unmarshal_TPM_COUNT_ID(ptr, length, &v->countID) ) return -1;
> > -+
> > -+  return 0;
> > -+}
> > -+
> > -+int tpm_marshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v)
> > -+{
> > -+  UINT32 i;
> > -+  if (tpm_marshal_TPM_STRUCTURE_TAG(ptr, length, v->tag)
> > -+    || tpm_marshal_TPM_NONCE(ptr, length, &v->contextNonceSession)
> > -+    || tpm_marshal_TPM_DIGEST(ptr, length, &v->auditDigest)
> > -+    || tpm_marshal_BOOL(ptr, length, v->auditSession)
> > -+    || tpm_marshal_TPM_CURRENT_TICKS(ptr, length, &v->currentTicks)
> > -+    || tpm_marshal_UINT32(ptr, length, v->contextCount)
> > -+    || tpm_marshal_UINT32_ARRAY(ptr, length, v->contextList, TPM_MAX_SESSION_LIST)) return -1;
> > -+  for (i = 0; i < TPM_MAX_SESSIONS; i++) {
> > -+    if (tpm_marshal_TPM_SESSION_DATA(ptr, length, &v->sessions[i])) return -1;
> > -+  }
> > -+  for (i = 0; i < TPM_MAX_SESSIONS_DAA; i++) {
> > -+    if (tpm_marshal_TPM_DAA_SESSION_DATA(ptr, length, &v->sessionsDAA[i])) return -1;
> > -+  }
> > -+  if (tpm_marshal_TPM_TRANSHANDLE(ptr, length, v->transExclusive)) return -1;
> > -+
> > -+  return 0;
> > -+}
> > -+
> > -+int tpm_unmarshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v)
> > -+{
> > -+  UINT32 i;
> > -+  if (tpm_unmarshal_TPM_STRUCTURE_TAG(ptr, length, &v->tag)
> > -+    || tpm_unmarshal_TPM_NONCE(ptr, length, &v->contextNonceSession)
> > -+    || tpm_unmarshal_TPM_DIGEST(ptr, length, &v->auditDigest)
> > -+    || tpm_unmarshal_BOOL(ptr, length, &v->auditSession)
> > -+    || tpm_unmarshal_TPM_CURRENT_TICKS(ptr, length, &v->currentTicks)
> > -+    || tpm_unmarshal_UINT32(ptr, length, &v->contextCount)
> > -+    || tpm_unmarshal_UINT32_ARRAY(ptr, length, v->contextList, TPM_MAX_SESSION_LIST)) return -1;
> > -+  for (i = 0; i < TPM_MAX_SESSIONS; i++) {
> > -+    if (tpm_unmarshal_TPM_SESSION_DATA(ptr, length, &v->sessions[i])) return -1;
> > -+  }
> > -+  for (i = 0; i < TPM_MAX_SESSIONS_DAA; i++) {
> > -+    if (tpm_unmarshal_TPM_DAA_SESSION_DATA(ptr, length, &v->sessionsDAA[i])) return -1;
> > -+  }
> > -+  if (tpm_unmarshal_TPM_TRANSHANDLE(ptr, length, &v->transExclusive)) return -1;
> > -+
> > -+  return 0;
> > -+}
> > -+
> > - int tpm_marshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v)
> > - {
> > -   if (tpm_marshal_BYTE(ptr, length, v->type)
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_marshalling.h tpm_emulator/tpm/tpm_marshalling.h
> > ---- orig/tpm_emulator-0.4/tpm/tpm_marshalling.h        2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_marshalling.h 2006-07-24 14:35:35.000000000 -0700
> > -@@ -432,6 +432,12 @@ int tpm_unmarshal_TPM_KEY_DATA(BYTE **pt
> > - int tpm_marshal_TPM_PERMANENT_DATA(BYTE **ptr, UINT32 *length, TPM_PERMANENT_DATA *);
> > - int tpm_unmarshal_TPM_PERMANENT_DATA(BYTE **ptr, UINT32 *length, TPM_PERMANENT_DATA *);
> > -
> > -+int tpm_marshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v);
> > -+int tpm_unmarshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v);
> > -+
> > -+int tpm_marshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v);
> > -+int tpm_unmarshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v);
> > -+
> > - int tpm_marshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v);
> > - int tpm_unmarshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v);
> > -
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_owner.c tpm_emulator/tpm/tpm_owner.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_owner.c      2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_owner.c       2006-07-24 14:35:35.000000000 -0700
> > -@@ -108,7 +108,7 @@ TPM_RESULT TPM_TakeOwnership(TPM_PROTOCO
> > -   TPM_RESULT res;
> > -   rsa_private_key_t *ek = &tpmData.permanent.data.endorsementKey;
> > -   TPM_KEY_DATA *srk = &tpmData.permanent.data.srk;
> > --  UINT32 buf_size = ek->size >> 3;
> > -+  size_t buf_size = ek->size >> 3, key_length;
> > -   BYTE buf[buf_size];
> > -
> > -   info("TPM_TakeOwnership()");
> > -@@ -173,7 +173,8 @@ TPM_RESULT TPM_TakeOwnership(TPM_PROTOCO
> > -     return TPM_FAIL;
> > -   }
> > -   rsa_export_modulus(&srk->key, srkPub->pubKey.key,
> > --    &srkPub->pubKey.keyLength);
> > -+                   &key_length);
> > -+  srkPub->pubKey.keyLength = (UINT32) key_length;
> > -   /* setup tpmProof and set state to owned */
> > -   tpm_get_random_bytes(tpmData.permanent.data.tpmProof.nonce,
> > -     sizeof(tpmData.permanent.data.tpmProof.nonce));
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_startup.c tpm_emulator/tpm/tpm_startup.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_startup.c    2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_startup.c     2006-07-24 14:35:35.000000000 -0700
> > -@@ -41,26 +41,29 @@ void TPM_Init(TPM_STARTUP_TYPE startupTy
> > - TPM_RESULT TPM_Startup(TPM_STARTUP_TYPE startupType)
> > - {
> > -   int i;
> > -+  int restore_fail;
> > -   info("TPM_Startup(%d)", startupType);
> > -   if (tpmData.stany.flags.postInitialise == FALSE) return TPM_INVALID_POSTINIT;
> > --  /* reset STANY_FLAGS */
> > --  SET_TO_ZERO(&tpmData.stany.flags);
> > --  tpmData.stany.flags.tag = TPM_TAG_STANY_FLAGS;
> > --  /* reset STANY_DATA (invalidates ALL sessions) */
> > --  SET_TO_ZERO(&tpmData.stany.data);
> > --  tpmData.stany.data.tag = TPM_TAG_STANY_DATA;
> > --  /* init session-context nonce */
> > --  SET_TO_RAND(&tpmData.stany.data.contextNonceSession);
> > -+
> > -+  /* try and restore state to get EK, SRK, etc */
> > -+  restore_fail = tpm_restore_permanent_data();
> > -+
> > -   /* set data and flags according to the given startup type */
> > -   if (startupType == TPM_ST_CLEAR) {
> > --    /* if available, restore permanent data */
> > --    tpm_restore_permanent_data();
> > -+    /* reset STANY_FLAGS */
> > -+    SET_TO_ZERO(&tpmData.stany.flags);
> > -+    tpmData.stany.flags.tag = TPM_TAG_STANY_FLAGS;
> > -+    /* reset STANY_DATA (invalidates ALL sessions) */
> > -+    SET_TO_ZERO(&tpmData.stany.data);
> > -+    tpmData.stany.data.tag = TPM_TAG_STANY_DATA;
> > -+    /* init session-context nonce */
> > -+    SET_TO_RAND(&tpmData.stany.data.contextNonceSession);
> > -     /* reset PCR values */
> > -     for (i = 0; i < TPM_NUM_PCR; i++) {
> > --      if (tpmData.permanent.data.pcrAttrib[i].pcrReset)
> > --        SET_TO_ZERO(tpmData.permanent.data.pcrValue[i].digest);
> > -+      if (!tpmData.permanent.data.pcrAttrib[i].pcrReset)
> > -+        SET_TO_ZERO(&tpmData.permanent.data.pcrValue[i].digest);
> > -       else
> > --        SET_TO_0xFF(tpmData.permanent.data.pcrValue[i].digest);
> > -+        SET_TO_0xFF(&tpmData.permanent.data.pcrValue[i].digest);
> > -     }
> > -     /* reset STCLEAR_FLAGS */
> > -     SET_TO_ZERO(&tpmData.stclear.flags);
> > -@@ -79,7 +82,8 @@ TPM_RESULT TPM_Startup(TPM_STARTUP_TYPE
> > -     /* init key-context nonce */
> > -     SET_TO_RAND(&tpmData.stclear.data.contextNonceKey);
> > -   } else if (startupType == TPM_ST_STATE) {
> > --    if (tpm_restore_permanent_data()) {
> > -+    /* restore must have been successful for TPM_ST_STATE */
> > -+    if (restore_fail) {
> > -       error("restoring permanent data failed");
> > -       tpmData.permanent.data.testResult = "tpm_restore_permanent_data() failed";
> > -       tpmData.permanent.flags.selfTestSucceeded = FALSE;
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_storage.c tpm_emulator/tpm/tpm_storage.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_storage.c    2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_storage.c     2006-07-24 14:35:35.000000000 -0700
> > -@@ -58,6 +58,7 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
> > -                         BYTE *enc, UINT32 *enc_size)
> > - {
> > -   UINT32 len;
> > -+  size_t enc_size32 = *enc_size;
> > -   BYTE *buf, *ptr;
> > -   rsa_public_key_t pub_key;
> > -   int scheme;
> > -@@ -72,7 +73,7 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
> > -   if (buf == NULL
> > -       || tpm_marshal_TPM_SEALED_DATA(&ptr, &len, seal)
> > -       || rsa_encrypt(&pub_key, scheme, buf, sizeof_TPM_SEALED_DATA((*seal)),
> > --                     enc, enc_size)) {
> > -+                     enc, &enc_size32)) {
> > -     tpm_free(buf);
> > -     rsa_release_public_key(&pub_key);
> > -     return -1;
> > -@@ -85,7 +86,8 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
> > - int decrypt_sealed_data(TPM_KEY_DATA *key, BYTE *enc, UINT32 enc_size,
> > -                         TPM_SEALED_DATA *seal, BYTE **buf)
> > - {
> > --  UINT32 len;
> > -+  size_t len;
> > -+  UINT32 len32;
> > -   BYTE *ptr;
> > -   int scheme;
> > -   switch (key->encScheme) {
> > -@@ -96,8 +98,12 @@ int decrypt_sealed_data(TPM_KEY_DATA *ke
> > -   len = enc_size;
> > -   *buf = ptr = tpm_malloc(len);
> > -   if (*buf == NULL
> > --      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len)
> > --      || tpm_unmarshal_TPM_SEALED_DATA(&ptr, &len, seal)) {
> > -+      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len) ){
> > -+    tpm_free(*buf);
> > -+    return -1;
> > -+  }
> > -+  len32 = len;
> > -+  if (tpm_unmarshal_TPM_SEALED_DATA(&ptr, &len32, seal)) {
> > -     tpm_free(*buf);
> > -     return -1;
> > -   }
> > -@@ -240,11 +246,12 @@ TPM_RESULT TPM_Unseal(TPM_KEY_HANDLE par
> > -
> > - TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE keyHandle, UINT32 inDataSize,
> > -                       BYTE *inData, TPM_AUTH *auth1,
> > --                      UINT32 *outDataSize, BYTE **outData)
> > -+                      UINT32 *outDataSize32, BYTE **outData)
> > - {
> > -   TPM_RESULT res;
> > -   TPM_KEY_DATA *key;
> > -   int scheme;
> > -+  size_t outDataSize;
> > -
> > -   info("TPM_UnBind()");
> > -   /* get key */
> > -@@ -262,8 +269,8 @@ TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE key
> > -   /* the size of the input data muss be greater than zero */
> > -   if (inDataSize == 0) return TPM_BAD_PARAMETER;
> > -   /* decrypt data */
> > --  *outDataSize = inDataSize;
> > --  *outData = tpm_malloc(*outDataSize);
> > -+  outDataSize = inDataSize;
> > -+  *outData = tpm_malloc(outDataSize);
> > -   if (*outData == NULL) return TPM_NOSPACE;
> > -   switch (key->encScheme) {
> > -     case TPM_ES_RSAESOAEP_SHA1_MGF1: scheme = RSA_ES_OAEP_SHA1; break;
> > -@@ -271,20 +278,21 @@ TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE key
> > -     default: tpm_free(*outData); return TPM_DECRYPT_ERROR;
> > -   }
> > -   if (rsa_decrypt(&key->key, scheme, inData, inDataSize,
> > --      *outData, outDataSize)) {
> > -+      *outData, &outDataSize)) {
> > -     tpm_free(*outData);
> > -     return TPM_DECRYPT_ERROR;
> > -   }
> > -   /* verify data if it is of type TPM_BOUND_DATA */
> > -   if (key->encScheme == TPM_ES_RSAESOAEP_SHA1_MGF1
> > -       || key->keyUsage != TPM_KEY_LEGACY) {
> > --    if (*outDataSize < 5 || memcmp(*outData, "\x01\x01\00\x00\x02", 5) != 0) {
> > -+    if (outDataSize < 5 || memcmp(*outData, "\x01\x01\00\x00\x02", 5) != 0) {
> > -       tpm_free(*outData);
> > -       return TPM_DECRYPT_ERROR;
> > -     }
> > --    *outDataSize -= 5;
> > --    memmove(*outData, &(*outData)[5], *outDataSize);
> > -+    outDataSize -= 5;
> > -+    memmove(*outData, &(*outData)[5], outDataSize);
> > -   }
> > -+  *outDataSize32 = (UINT32) outDataSize;
> > -   return TPM_SUCCESS;
> > - }
> > -
> > -@@ -334,12 +342,13 @@ int compute_pubkey_digest(TPM_PUBKEY *ke
> > - }
> > -
> > - int encrypt_private_key(TPM_KEY_DATA *key, TPM_STORE_ASYMKEY *store,
> > --                        BYTE *enc, UINT32 *enc_size)
> > -+                        BYTE *enc, UINT32 *enc_size32)
> > - {
> > -   UINT32 len;
> > -   BYTE *buf, *ptr;
> > -   rsa_public_key_t pub_key;
> > -   int scheme;
> > -+  size_t enc_size;
> > -   switch (key->encScheme) {
> > -     case TPM_ES_RSAESOAEP_SHA1_MGF1: scheme = RSA_ES_OAEP_SHA1; break;
> > -     case TPM_ES_RSAESPKCSv15: scheme = RSA_ES_PKCSV15; break;
> > -@@ -351,11 +360,12 @@ int encrypt_private_key(TPM_KEY_DATA *ke
> > -   if (buf == NULL
> > -       || tpm_marshal_TPM_STORE_ASYMKEY(&ptr, &len, store)
> > -       || rsa_encrypt(&pub_key, scheme, buf, sizeof_TPM_STORE_ASYMKEY((*store)),
> > --                     enc, enc_size)) {
> > -+                     enc, &enc_size)) {
> > -     tpm_free(buf);
> > -     rsa_release_public_key(&pub_key);
> > -     return -1;
> > -   }
> > -+  *enc_size32 = (UINT32) enc_size;
> > -   tpm_free(buf);
> > -   rsa_release_public_key(&pub_key);
> > -   return 0;
> > -@@ -364,7 +374,8 @@ int encrypt_private_key(TPM_KEY_DATA *ke
> > - int decrypt_private_key(TPM_KEY_DATA *key, BYTE *enc, UINT32 enc_size,
> > -                         TPM_STORE_ASYMKEY *store, BYTE **buf)
> > - {
> > --  UINT32 len;
> > -+  UINT32 len32;
> > -+  size_t len;
> > -   BYTE *ptr;
> > -   int scheme;
> > -   switch (key->encScheme) {
> > -@@ -375,8 +386,12 @@ int decrypt_private_key(TPM_KEY_DATA *ke
> > -   len = enc_size;
> > -   *buf = ptr = tpm_malloc(len);
> > -   if (*buf == NULL
> > --      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len)
> > --      || tpm_unmarshal_TPM_STORE_ASYMKEY(&ptr, &len, store)) {
> > -+      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len) ) {
> > -+    tpm_free(*buf);
> > -+    return -1;
> > -+  }
> > -+  len32 = (UINT32) len;
> > -+  if (tpm_unmarshal_TPM_STORE_ASYMKEY(&ptr, &len32, store)) {
> > -     tpm_free(*buf);
> > -     return -1;
> > -   }
> > -@@ -394,7 +409,7 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
> > -   TPM_SESSION_DATA *session;
> > -   TPM_STORE_ASYMKEY store;
> > -   rsa_private_key_t rsa;
> > --  UINT32 key_length;
> > -+  size_t key_length;
> > -
> > -   info("TPM_CreateWrapKey()");
> > -   /* get parent key */
> > -@@ -450,11 +465,11 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
> > -     }
> > -   }
> > -   /* generate key and store it */
> > --  key_length = keyInfo->algorithmParms.parms.rsa.keyLength;
> > --  if (rsa_generate_key(&rsa, key_length)) return TPM_FAIL;
> > --  wrappedKey->pubKey.keyLength = key_length >> 3;
> > -+  if (rsa_generate_key(&rsa, keyInfo->algorithmParms.parms.rsa.keyLength))
> > -+    return TPM_FAIL;
> > -+  wrappedKey->pubKey.keyLength = keyInfo->algorithmParms.parms.rsa.keyLength >> 3;
> > -   wrappedKey->pubKey.key = tpm_malloc(wrappedKey->pubKey.keyLength);
> > --  store.privKey.keyLength = key_length >> 4;
> > -+  store.privKey.keyLength = keyInfo->algorithmParms.parms.rsa.keyLength >> 4;
> > -   store.privKey.key = tpm_malloc(store.privKey.keyLength);
> > -   wrappedKey->encDataSize = parent->key.size >> 3;
> > -   wrappedKey->encData = tpm_malloc(wrappedKey->encDataSize);
> > -@@ -466,9 +481,11 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
> > -     tpm_free(wrappedKey->encData);
> > -     return TPM_NOSPACE;
> > -   }
> > --  rsa_export_modulus(&rsa, wrappedKey->pubKey.key,
> > --    &wrappedKey->pubKey.keyLength);
> > --  rsa_export_prime1(&rsa, store.privKey.key, &store.privKey.keyLength);
> > -+  rsa_export_modulus(&rsa, wrappedKey->pubKey.key,
> > -+                   &key_length);
> > -+  wrappedKey->pubKey.keyLength = (UINT32) key_length;
> > -+  rsa_export_prime1(&rsa, store.privKey.key, &key_length);
> > -+  store.privKey.keyLength = (UINT32) key_length;
> > -   rsa_release_private_key(&rsa);
> > -   /* compute the digest of the wrapped key (without encData) */
> > -   if (compute_key_digest(wrappedKey, &store.pubDataDigest)) {
> > -@@ -602,6 +619,7 @@ TPM_RESULT TPM_LoadKey2(TPM_KEY_HANDLE p
> > -
> > - int tpm_setup_key_parms(TPM_KEY_DATA *key, TPM_KEY_PARMS *parms)
> > - {
> > -+  size_t key_length;
> > -   parms->algorithmID = TPM_ALG_RSA;
> > -   parms->encScheme = key->encScheme;
> > -   parms->sigScheme = key->sigScheme;
> > -@@ -611,7 +629,8 @@ int tpm_setup_key_parms(TPM_KEY_DATA *ke
> > -   parms->parms.rsa.exponent = tpm_malloc(parms->parms.rsa.exponentSize);
> > -   if (parms->parms.rsa.exponent == NULL) return -1;
> > -   rsa_export_exponent(&key->key, parms->parms.rsa.exponent,
> > --    &parms->parms.rsa.exponentSize);
> > -+    &key_length);
> > -+  parms->parms.rsa.exponentSize = (UINT32) key_length;
> > -   parms->parmSize = 12 + parms->parms.rsa.exponentSize;
> > -   return 0;
> > - }
> > -@@ -622,6 +641,7 @@ TPM_RESULT TPM_GetPubKey(TPM_KEY_HANDLE
> > -   TPM_RESULT res;
> > -   TPM_KEY_DATA *key;
> > -   TPM_DIGEST digest;
> > -+  size_t key_length;
> > -   info("TPM_GetPubKey()");
> > -   /* get key */
> > -   if (keyHandle == TPM_KH_SRK
> > -@@ -650,8 +670,8 @@ TPM_RESULT TPM_GetPubKey(TPM_KEY_HANDLE
> > -   pubKey->pubKey.keyLength = key->key.size >> 3;
> > -   pubKey->pubKey.key = tpm_malloc(pubKey->pubKey.keyLength);
> > -   if (pubKey->pubKey.key == NULL) return TPM_NOSPACE;
> > --  rsa_export_modulus(&key->key, pubKey->pubKey.key,
> > --    &pubKey->pubKey.keyLength);
> > -+  rsa_export_modulus(&key->key, pubKey->pubKey.key, &key_length);
> > -+  pubKey->pubKey.keyLength = (UINT32) key_length;
> > -   if (tpm_setup_key_parms(key, &pubKey->algorithmParms) != 0) {
> > -     error("TPM_GetPubKey(): tpm_setup_key_parms() failed.");
> > -     tpm_free(pubKey->pubKey.key);
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_structures.h tpm_emulator/tpm/tpm_structures.h
> > ---- orig/tpm_emulator-0.4/tpm/tpm_structures.h 2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_structures.h  2006-07-24 14:35:35.000000000 -0700
> > -@@ -1958,6 +1958,7 @@ typedef struct tdTPM_DAA_ISSUER {
> > -   TPM_DIGEST DAA_digest_gamma;
> > -   BYTE DAA_generic_q[26];
> > - } TPM_DAA_ISSUER;
> > -+#define sizeof_TPM_DAA_ISSUER(s) (2 + (20 * 6) + 26 )
> > -
> > - /*
> > -  * TPM_DAA_TPM ([TPM_Part2], Section 22.4)
> > -@@ -1973,6 +1974,7 @@ typedef struct tdTPM_DAA_TPM {
> > -   TPM_DIGEST DAA_rekey;
> > -   UINT32 DAA_count;
> > - } TPM_DAA_TPM;
> > -+#define sizeof_TPM_DAA_TPM(s) (2 + (4 * 20) + 4)
> > -
> > - /*
> > -  * TPM_DAA_CONTEXT ([TPM_Part2], Section 22.5)
> > -@@ -1987,6 +1989,7 @@ typedef struct tdTPM_DAA_CONTEXT {
> > -   BYTE DAA_scratch[256];
> > -   BYTE DAA_stage;
> > - } TPM_DAA_CONTEXT;
> > -+#define sizeof_TPM_DAA_CONTEXT(s) (2 + (3 * 20) + 256 + 1)
> > -
> > - /*
> > -  * TPM_DAA_JOINDATA ([TPM_Part2], Section 22.6)
> > -@@ -1998,6 +2001,7 @@ typedef struct tdTPM_DAA_JOINDATA {
> > -   BYTE DAA_join_u1[138];
> > -   TPM_DIGEST DAA_digest_n0;
> > - } TPM_DAA_JOINDATA;
> > -+#define sizeof_TPM_DAA_JOINDATA(s) (1 + 1 + 20)
> > -
> > - /*
> > -  * TPM_DAA_BLOB ([TPM_Part2], Section 22.8)
> > -@@ -2202,6 +2206,7 @@ typedef struct tdTPM_STCLEAR_DATA {
> > -   //UINT32 ownerReference;
> > -   //BOOL disableResetLock;
> > - } TPM_STCLEAR_DATA;
> > -+#define sizeof_TPM_STCLEAR_DATA(s) (2 + 20 + 4)
> > -
> > - /*
> > -  * TPM_SESSION_DATA
> > -@@ -2238,6 +2243,11 @@ typedef struct tdTPM_DAA_SESSION_DATA {
> > -   TPM_DAA_JOINDATA DAA_joinSession;
> > -   TPM_HANDLE handle;
> > - } TPM_DAA_SESSION_DATA;
> > -+#define sizeof_TPM_DAA_SESSION_DATA(s) ( 1 \
> > -+  + sizeof_TPM_DAA_ISSUER(s.DAA_issuerSettings) \
> > -+  + sizeof_TPM_DAA_TPM(s.DAA_tpmSpecific) \
> > -+  + sizeof_TPM_DAA_CONTEXT(s.DAA_session) \
> > -+  + sizeof_TPM_DAA_JOINDATA(s.DAA_joinSession) + 4)
> > -
> > - /*
> > -  * TPM_STANY_DATA ([TPM_Part2], Section 7.6)
> > -@@ -2262,6 +2272,11 @@ typedef struct tdTPM_STANY_DATA {
> > -   TPM_DAAHANDLE currentDAA;
> > -   TPM_TRANSHANDLE transExclusive;
> > - } TPM_STANY_DATA;
> > -+#define sizeof_TPM_STANY_DATA(s) (2 + 20 + 20 + 1 \
> > -+  + sizeof_TPM_CURRENT_TICKS(s.currentTicks) \
> > -+  + 4 + (4 * TPM_MAX_SESSION_LIST) \
> > -+  + (sizeof_TPM_SESSION_DATA(s.sessions[0]) * TPM_MAX_SESSION_LIST) \
> > -+  + (sizeof_TPM_DAA_SESSION_DATA(s.sessionsDAA[0]) * TPM_MAX_SESSIONS_DAA) + 4)
> > -
> > - /*
> > -  * TPM_DATA
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_testing.c tpm_emulator/tpm/tpm_testing.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_testing.c    2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_testing.c     2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,6 +1,7 @@
> > - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> > -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> > -+ * Copyright (C) 2005 INTEL Corp
> > -  *
> > -  * This module is free software; you can redistribute it and/or modify
> > -  * it under the terms of the GNU General Public License as published
> > -@@ -95,24 +96,24 @@ static int tpm_test_sha1(void)
> > -   struct {
> > -     uint8_t *data; uint32_t repetitions; uint8_t *digest;
> > -   } test_cases[] =  {{
> > --    "abc", 1,
> > --    "\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D"
> > -+      (uint8_t*)"abc", 1,
> > -+    (uint8_t*)"\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D"
> > -   }, {
> > --    "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 1,
> > --    "\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29\xE5\xE5\x46\x70\xF1"
> > -+    (uint8_t*)"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 1,
> > -+    (uint8_t*)"\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29\xE5\xE5\x46\x70\xF1"
> > -   }, {
> > --    "a", 1000000,
> > --    "\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F"
> > -+    (uint8_t*)"a", 1000000,
> > -+    (uint8_t*)"\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F"
> > -   }, {
> > --    "0123456701234567012345670123456701234567012345670123456701234567", 10,
> > --    "\xDE\xA3\x56\xA2\xCD\xDD\x90\xC7\xA7\xEC\xED\xC5\xEB\xB5\x63\x93\x4F\x46\x04\x52"
> > -+    (uint8_t*)"0123456701234567012345670123456701234567012345670123456701234567", 10,
> > -+    (uint8_t*)"\xDE\xA3\x56\xA2\xCD\xDD\x90\xC7\xA7\xEC\xED\xC5\xEB\xB5\x63\x93\x4F\x46\x04\x52"
> > -   }};
> > -
> > -   debug("tpm_test_sha1()");
> > -   for (i = 0; i < sizeof(test_cases) / sizeof(test_cases[0]); i++) {
> > -     sha1_init(&ctx);
> > -     for (j = 0; j < test_cases[i].repetitions; j++)
> > --      sha1_update(&ctx, test_cases[i].data, strlen(test_cases[i].data));
> > -+      sha1_update(&ctx, test_cases[i].data, strlen((char*)test_cases[i].data));
> > -     sha1_final(&ctx, digest);
> > -     if (memcmp(digest, test_cases[i].digest, SHA1_DIGEST_LENGTH) != 0) return -1;
> > -   }
> > -@@ -128,41 +129,41 @@ static int tpm_test_hmac(void)
> > -   struct {
> > -     uint8_t *key, key_len, *data, data_len, *digest;
> > -   } test_cases[] = {{
> > --    "\x0b", 20, "Hi There", 8,
> > --    "\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"
> > -+    (uint8_t*)"\x0b", 20, (uint8_t*)"Hi There", 8,
> > -+    (uint8_t*)"\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"
> > -   }, {
> > --    "Jefe", 4, "what do ya want for nothing?", 28,
> > --    "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79"
> > -+    (uint8_t*)"Jefe", 4, (uint8_t*)"what do ya want for nothing?", 28,
> > -+    (uint8_t*)"\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79"
> > -   }, {
> > --    "\xaa", 20, "\xdd", 50,
> > --    "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3"
> > -+    (uint8_t*)"\xaa", 20, (uint8_t*)"\xdd", 50,
> > -+    (uint8_t*)"\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3"
> > -   }, {
> > --    "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
> > --    "\x15\x16\x17\x18\x19", 25, "\xcd", 50,
> > --    "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda"
> > -+    (uint8_t*)"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
> > -+    "\x15\x16\x17\x18\x19", 25, (uint8_t*)"\xcd", 50,
> > -+    (uint8_t*)"\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda"
> > -   }, {
> > --    "\x0c", 20, "Test With Truncation", 20,
> > --    "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04"
> > -+    (uint8_t*)"\x0c", 20, (uint8_t*)"Test With Truncation", 20,
> > -+    (uint8_t*)"\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04"
> > -   }, {
> > --    "\xaa", 80, "Test Using Larger Than Block-Size Key - Hash Key First", 54,
> > --    "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12"
> > -+    (uint8_t*)"\xaa", 80, (uint8_t*)"Test Using Larger Than Block-Size Key - Hash Key First", 54,
> > -+    (uint8_t*)"\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12"
> > -   }, {
> > --    "\xaa", 80,
> > --    "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", 73,
> > --    "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91"
> > -+    (uint8_t*)"\xaa", 80,
> > -+    (uint8_t*)"Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", 73,
> > -+    (uint8_t*)"\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91"
> > -   }};
> > -
> > -   debug("tpm_test_hmac()");
> > -   for (i = 0; i < sizeof(test_cases) / sizeof(test_cases[0]); i++) {
> > --    if (strlen(test_cases[i].key) < test_cases[i].key_len) {
> > -+    if (strlen((char*)test_cases[i].key) < test_cases[i].key_len) {
> > -       uint8_t key[test_cases[i].key_len];
> > -       memset(key, test_cases[i].key[0], test_cases[i].key_len);
> > -       hmac_init(&ctx, key, test_cases[i].key_len);
> > -     } else {
> > -       hmac_init(&ctx, test_cases[i].key, test_cases[i].key_len);
> > -     }
> > --    for (j = 0; j < test_cases[i].data_len; j += strlen(test_cases[i].data)) {
> > --      hmac_update(&ctx, test_cases[i].data, strlen(test_cases[i].data));
> > -+    for (j = 0; j < test_cases[i].data_len; j += strlen((char*)test_cases[i].data)) {
> > -+      hmac_update(&ctx, test_cases[i].data, strlen((char*)test_cases[i].data));
> > -     }
> > -     hmac_final(&ctx, digest);
> > -     if (memcmp(digest, test_cases[i].digest, SHA1_DIGEST_LENGTH) != 0) return -1;
> > -@@ -173,9 +174,9 @@ static int tpm_test_hmac(void)
> > - static int tpm_test_rsa_EK(void)
> > - {
> > -   int res = 0;
> > --  char *data = "RSA PKCS #1 v1.5 Test-String";
> > -+  uint8_t *data = (uint8_t*)"RSA PKCS #1 v1.5 Test-String";
> > -   uint8_t buf[256];
> > --  size_t buf_len, data_len = strlen(data);
> > -+  size_t buf_len, data_len = strlen((char*)data);
> > -   rsa_private_key_t priv_key;
> > -   rsa_public_key_t pub_key;
> > -
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_ticks.c tpm_emulator/tpm/tpm_ticks.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_ticks.c      2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_ticks.c       2006-07-24 14:35:35.000000000 -0700
> > -@@ -1,6 +1,7 @@
> > - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> > -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> > -+ * Copyright (C) 2005 INTEL Corp
> > -  *
> > -  * This module is free software; you can redistribute it and/or modify
> > -  * it under the terms of the GNU General Public License as published
> > -@@ -39,9 +40,7 @@ TPM_RESULT TPM_SetTickType(TPM_TICKTYPE
> > - TPM_RESULT TPM_GetTicks(TPM_CURRENT_TICKS *currentTime)
> > - {
> > -   info("TPM_GetTicks()");
> > --  memcpy(currentTime, &tpmData.stany.data.currentTicks,
> > --    sizeof(TPM_CURRENT_TICKS));
> > --  return TPM_SUCCESS;
> > -+  return TPM_DISABLED_CMD;
> > - }
> > -
> > - TPM_RESULT TPM_TickStampBlob(TPM_KEY_HANDLE keyHandle, TPM_NONCE *antiReplay,
> > -@@ -49,64 +48,11 @@ TPM_RESULT TPM_TickStampBlob(TPM_KEY_HAN
> > -                              TPM_CURRENT_TICKS *currentTicks,
> > -                              UINT32 *sigSize, BYTE **sig)
> > - {
> > --  TPM_RESULT res;
> > --  TPM_KEY_DATA *key;
> > --  BYTE *info, *p;
> > --  UINT32 info_length, length;
> > -   info("TPM_TickStampBlob()");
> > --  /* get key */
> > --  key = tpm_get_key(keyHandle);
> > --  if (key == NULL) return TPM_INVALID_KEYHANDLE;
> > --  /* verify authorization */
> > --  res = tpm_verify_auth(auth1, key->usageAuth, keyHandle);
> > --  if (res != TPM_SUCCESS) return res;
> > --  if (key->keyUsage != TPM_KEY_SIGNING && key->keyUsage != TPM_KEY_LEGACY
> > --      && key->keyUsage != TPM_KEY_IDENTITY) return TPM_INVALID_KEYUSAGE;
> > --  /* get current ticks */
> > --  TPM_GetTicks(currentTicks);
> > --  /* sign data using signature scheme PKCS1_SHA1 and TPM_SIGN_INFO container */
> > --  *sigSize = key->key.size >> 3;
> > --  *sig = tpm_malloc(*sigSize);
> > --  if (*sig == NULL) return TPM_FAIL;
> > --  /* setup TPM_SIGN_INFO structure */
> > --  info_length = 30 + sizeof(TPM_DIGEST) + sizeof_TPM_CURRENT_TICKS(currentTicks);
> > --  info = tpm_malloc(info_length);
> > --  if (info == NULL) {
> > --    tpm_free(*sig);
> > --    return TPM_FAIL;
> > --  }
> > --  memcpy(&info[0], "\x05\x00TSTP", 6);
> > --  memcpy(&info[6], antiReplay->nonce, 20);
> > --  *(UINT32*)&info[26] = CPU_TO_BE32(20
> > --                        + sizeof_TPM_CURRENT_TICKS(currentTicks));
> > --  memcpy(&info[30], digestToStamp->digest, sizeof(TPM_DIGEST));
> > --  p = &info[30 + sizeof(TPM_DIGEST)];
> > --  length = sizeof_TPM_CURRENT_TICKS(currentTicks);
> > --  if (tpm_marshal_TPM_CURRENT_TICKS(&p, &length, currentTicks)
> > --      || rsa_sign(&key->key, RSA_SSA_PKCS1_SHA1, info, info_length, *sig)) {
> > --    tpm_free(*sig);
> > --    tpm_free(info);
> > --    return TPM_FAIL;
> > --  }
> > --  return TPM_SUCCESS;
> > -+  return TPM_DISABLED_CMD;
> > - }
> > -
> > - void tpm_update_ticks(void)
> > - {
> > --  if (tpmData.stany.data.currentTicks.tag == 0) {
> > --    tpmData.stany.data.currentTicks.tag = TPM_TAG_CURRENT_TICKS;
> > --    tpmData.stany.data.currentTicks.currentTicks += tpm_get_ticks();
> > --/* removed since v1.2 rev 94
> > --    tpmData.stany.data.currentTicks.tickType = tpmData.permanent.data.tickType;
> > --*/
> > --    tpm_get_random_bytes(tpmData.stany.data.currentTicks.tickNonce.nonce,
> > --      sizeof(TPM_NONCE));
> > --    tpmData.stany.data.currentTicks.tickRate = 1;
> > --/* removed since v1.2 rev 94
> > --    tpmData.stany.data.currentTicks.tickSecurity = TICK_SEC_NO_CHECK;
> > --*/
> > --  } else {
> > --    tpmData.stany.data.currentTicks.currentTicks += tpm_get_ticks();
> > --  }
> > - }
> > -
> > -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_transport.c tpm_emulator/tpm/tpm_transport.c
> > ---- orig/tpm_emulator-0.4/tpm/tpm_transport.c  2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm/tpm_transport.c   2006-07-24 14:35:35.000000000 -0700
> > -@@ -189,7 +189,7 @@ static void decrypt_wrapped_command(BYTE
> > -     sha1_init(&sha1);
> > -     sha1_update(&sha1, auth->nonceEven.nonce, sizeof(auth->nonceEven.nonce));
> > -     sha1_update(&sha1, auth->nonceOdd.nonce, sizeof(auth->nonceOdd.nonce));
> > --    sha1_update(&sha1, "in", 2);
> > -+    sha1_update(&sha1, (BYTE*)"in", 2);
> > -     sha1_update(&sha1, secret, sizeof(TPM_SECRET));
> > -     j = CPU_TO_BE32(i);
> > -     sha1_update(&sha1, (BYTE*)&j, 4);
> > -@@ -211,7 +211,7 @@ static void encrypt_wrapped_command(BYTE
> > -     sha1_init(&sha1);
> > -     sha1_update(&sha1, auth->nonceEven.nonce, sizeof(auth->nonceEven.nonce));
> > -     sha1_update(&sha1, auth->nonceOdd.nonce, sizeof(auth->nonceOdd.nonce));
> > --    sha1_update(&sha1, "out", 3);
> > -+    sha1_update(&sha1, (BYTE*)"out", 3);
> > -     sha1_update(&sha1, secret, sizeof(TPM_SECRET));
> > -     j = CPU_TO_BE32(i);
> > -     sha1_update(&sha1, (BYTE*)&j, 4);
> > -diff -uprN orig/tpm_emulator-0.4/tpmd.c tpm_emulator/tpmd.c
> > ---- orig/tpm_emulator-0.4/tpmd.c       1969-12-31 16:00:00.000000000 -0800
> > -+++ tpm_emulator/tpmd.c        2006-07-24 14:35:35.000000000 -0700
> > -@@ -0,0 +1,156 @@
> > -+/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -+ * Copyright (C) 2005 INTEL Corp
> > -+ *
> > -+ * This module is free software; you can redistribute it and/or modify
> > -+ * it under the terms of the GNU General Public License as published
> > -+ * by the Free Software Foundation; either version 2 of the License,
> > -+ * or (at your option) any later version.
> > -+ *
> > -+ * This module 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.
> > -+ *
> > -+ */
> > -+
> > -+#include <stdio.h>
> > -+#include <stdlib.h>
> > -+#include <unistd.h>
> > -+#include <string.h>
> > -+#include <sys/types.h>
> > -+#include <sys/stat.h>
> > -+#include <fcntl.h>
> > -+#include <sys/time.h>
> > -+
> > -+#include "tpm_emulator.h"
> > -+
> > -+#define TPM_RX_FNAME "/var/tpm/tpm_in.fifo"
> > -+#define TPM_TX_FNAME "/var/tpm/tpm_out.fifo"
> > -+
> > -+#define BUFFER_SIZE 2048
> > -+
> > -+static int devurandom=0;
> > -+
> > -+void get_random_bytes(void *buf, int nbytes) {
> > -+
> > -+  if (devurandom == 0) {
> > -+    devurandom = open("/dev/urandom", O_RDONLY);
> > -+  }
> > -+
> > -+  if (read(devurandom, buf, nbytes) != nbytes) {
> > -+      printf("Can't get random number.\n");
> > -+      exit(-1);
> > -+  }
> > -+}
> > -+
> > -+uint64_t tpm_get_ticks(void)
> > -+{
> > -+  //struct timeval tv;
> > -+  //int gettimeofday(&tv, struct timezone *tz);
> > -+  return 0;
> > -+}
> > -+
> > -+int main(int argc, char **argv)
> > -+{
> > -+  uint8_t in[BUFFER_SIZE], *out;
> > -+  uint32_t out_size;
> > -+  int in_size, written;
> > -+  int i;
> > -+  struct stat file_info;
> > -+
> > -+  int tpm_tx_fh=-1, tpm_rx_fh=-1;
> > -+  if (argc < 2) {
> > -+    printf("Usage: tpmd clear|save|deactivated\n" );
> > -+        return -1;
> > -+  }
> > -+
> > -+  /* initialize TPM emulator */
> > -+  if (!strcmp(argv[1], "clear")) {
> > -+    printf("Initializing tpm: %s\n", argv[1]);
> > -+    tpm_emulator_init(1);
> > -+  } else if (!strcmp(argv[1], "save")) {
> > -+    printf("Initializing tpm: %s\n", argv[1]);
> > -+    tpm_emulator_init(2);
> > -+  } else if (!strcmp(argv[1], "deactivated")) {
> > -+    printf("Initializing tpm: %s\n", argv[1]);
> > -+    tpm_emulator_init(3);
> > -+  } else {
> > -+    printf("invalid startup mode '%s'; must be 'clear', "
> > -+      "'save' (default) or 'deactivated", argv[1]);
> > -+    return -1;
> > -+  }
> > -+
> > -+  if ( stat(TPM_RX_FNAME, &file_info) == -1) {
> > -+    if ( mkfifo(TPM_RX_FNAME, S_IWUSR | S_IRUSR ) ) {
> > -+      printf("Failed to create fifo %s.\n", TPM_RX_FNAME);
> > -+      return -1;
> > -+    }
> > -+  }
> > -+
> > -+  if ( stat(TPM_TX_FNAME, &file_info) == -1) {
> > -+    if ( mkfifo(TPM_TX_FNAME, S_IWUSR | S_IRUSR ) ) {
> > -+      printf("Failed to create fifo %s.\n", TPM_TX_FNAME);
> > -+      return -1;
> > -+    }
> > -+  }
> > -+
> > -+  while (1) {
> > -+abort_command:
> > -+    if (tpm_rx_fh < 0) {
> > -+      tpm_rx_fh = open(TPM_RX_FNAME, O_RDONLY);
> > -+    }
> > -+
> > -+    if (tpm_rx_fh < 0) {
> > -+      printf("ERROR: failed to open devices to listen to guest.\n");
> > -+      return -1;
> > -+    }
> > -+
> > -+    if (tpm_tx_fh < 0) {
> > -+      tpm_tx_fh = open(TPM_TX_FNAME, O_WRONLY);
> > -+    }
> > -+
> > -+    if (tpm_tx_fh < 0) {
> > -+      printf("ERROR: failed to open devices to respond to guest.\n");
> > -+      return -1;
> > -+    }
> > -+
> > -+    in_size = read(tpm_rx_fh, in, BUFFER_SIZE);
> > -+    if (in_size < 6) { // Magic size of minium TPM command
> > -+      printf("Recv[%d] to small: 0x", in_size);
> > -+      if (in_size <= 0) {
> > -+          close(tpm_rx_fh);
> > -+          tpm_rx_fh = -1;
> > -+          goto abort_command;
> > -+      }
> > -+    } else {
> > -+      printf("Recv[%d]: 0x", in_size);
> > -+      for (i=0; i< in_size; i++)
> > -+        printf("%x ", in[i]);
> > -+      printf("\n");
> > -+    }
> > -+
> > -+
> > -+    if (tpm_handle_command(in, in_size, &out, &out_size) != 0) {
> > -+        printf("ERROR: Handler Failed.\n");
> > -+    }
> > -+
> > -+    written = write(tpm_tx_fh, out, out_size);
> > -+
> > -+    if (written != out_size ) {
> > -+      printf("ERROR: Part of response not written %d/%d.\nAttempt: ", written, out_size);
> > -+    } else {
> > -+      printf("Sent[%Zu]: ", out_size);
> > -+    }
> > -+    for (i=0; i< out_size; i++)
> > -+      printf("%x ", out[i]);
> > -+    printf("\n");
> > -+    tpm_free(out);
> > -+
> > -+  } // loop
> > -+
> > -+  tpm_emulator_shutdown();
> > -+
> > -+  close(tpm_tx_fh);
> > -+  close(tpm_rx_fh);
> > -+
> > -+}
> > -Binary files orig/tpm_emulator-0.4/tpm_emulator and tpm_emulator/tpm_emulator differ
> > -diff -uprN orig/tpm_emulator-0.4/tpm_version.h tpm_emulator/tpm_version.h
> > ---- orig/tpm_emulator-0.4/tpm_version.h        2006-06-23 03:37:07.000000000 -0700
> > -+++ tpm_emulator/tpm_version.h 2006-07-24 14:35:41.000000000 -0700
> > -@@ -2,5 +2,5 @@
> > - #define _TPM_VERSION_H_
> > - #define VERSION_MAJOR 0
> > - #define VERSION_MINOR 4
> > --#define VERSION_BUILD 1151058734
> > -+#define VERSION_BUILD 1153776940
> > - #endif /* _TPM_VERSION_H_ */
> > diff --git a/tools/vtpm/vtpm-0.5.1-LDLIBS.patch b/tools/vtpm/vtpm-0.5.1-LDLIBS.patch
> > deleted file mode 100644
> > index 95586c1..0000000
> > --- a/tools/vtpm/vtpm-0.5.1-LDLIBS.patch
> > +++ /dev/null
> > @@ -1,12 +0,0 @@
> > -diff -Naurp tpm_emulator-0.5.1/tpmd/Makefile tpm_emulator-0.5.1/tpmd/Makefile
> > ---- tpm_emulator-0.5.1/tpmd/Makefile
> > -+++ tpm_emulator-0.5.1/tpmd/Makefile
> > -@@ -8,7 +8,7 @@ WFLAGS  := -Wall -Wno-unused -Wpointer-a
> > -            #WFLAGS  += -Wextra -Wcast-qual -Wmissing-prototypes -Wmissing-declarations -Wstrict-aliasing
> > - CFLAGS  += $(WFLAGS) -g -I.. -I. -O2 -fno-strict-aliasing
> > - CFLAGS  += -I../../../../tools/vtpm_manager/manager
> > --LDFLAGS += -lgmp
> > -+LDLIBS  += -lgmp
> > -
> > - BINDIR  := /usr/bin/
> > -
> > diff --git a/tools/vtpm/vtpm-0.5.1.patch b/tools/vtpm/vtpm-0.5.1.patch
> > deleted file mode 100644
> > index 2aeb745..0000000
> > --- a/tools/vtpm/vtpm-0.5.1.patch
> > +++ /dev/null
> > @@ -1,766 +0,0 @@
> > -diff -Naurp tpm_emulator-0.5.1/Makefile tpm5-test/Makefile
> > ---- tpm_emulator-0.5.1/Makefile        2008-02-14 03:22:48.000000000 -0500
> > -+++ tpm5-test/Makefile 2009-07-15 09:45:28.000000000 -0400
> > -@@ -10,7 +10,7 @@ VERSION_MINOR  := 5
> > - VERSION_BUILD  := $(shell date +"%s")
> > - VERSION_SUFFIX := .1
> > -
> > --SUBDIRS := tpmd tpmd_dev tddl
> > -+SUBDIRS := tpmd
> > -
> > - all: version all-recursive
> > -
> > -@@ -48,12 +48,12 @@ user_install: user
> > - modules_install: modules
> > -       @$(MAKE) -C tpmd_dev install || exit -1
> > -
> > --DIRS    := . tpm crypto tpmd tpmd_dev tddl tpmd_dev_openbsd
> > -+DIRS    := . tpm crypto tpmd
> > - DISTSRC := $(foreach dir, $(DIRS), $(wildcard $(dir)/*.c))
> > - DISTSRC += $(foreach dir, $(DIRS), $(wildcard $(dir)/*.h))
> > --DIRS    := . tpmd tpmd_dev tddl tpmd_dev_openbsd
> > -+DIRS    := . tpmd
> > - DISTSRC += $(foreach dir, $(DIRS), $(dir)/Makefile)
> > --DISTSRC += ./README ./AUTHORS ./ChangeLog tpmd_dev/tpmd_dev.rules.in
> > -+DISTSRC += ./README ./AUTHORS ./ChangeLog
> > - DISTDIR := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_SUFFIX)
> > -
> > - dist: $(DISTSRC)
> > -diff -Naurp tpm_emulator-0.5.1/tpm/tpm_capability.c tpm5-test/tpm/tpm_capability.c
> > ---- tpm_emulator-0.5.1/tpm/tpm_capability.c    2008-02-14 03:22:48.000000000 -0500
> > -+++ tpm5-test/tpm/tpm_capability.c     2009-07-16 12:04:20.000000000 -0400
> > -@@ -136,8 +136,19 @@ static TPM_RESULT cap_property(UINT32 su
> > -
> > -     case TPM_CAP_PROP_TIS_TIMEOUT:
> > -       debug("[TPM_CAP_PROP_TIS_TIMEOUT]");
> > --      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT */
> > --      return TPM_FAIL;
> > -+      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT: Measure these values and determine correct ones */
> > -+      UINT32 len = *respSize = 16;
> > -+      BYTE *ptr = *resp = tpm_malloc(*respSize);
> > -+      if (ptr == NULL ||
> > -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> > -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> > -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> > -+          tpm_marshal_UINT32(&ptr, &len, 200000)) {
> > -+        tpm_free(*resp);
> > -+        return TPM_FAIL;
> > -+      }
> > -+      return TPM_SUCCESS;
> > -+
> > -
> > -     case TPM_CAP_PROP_STARTUP_EFFECT:
> > -       debug("[TPM_CAP_PROP_STARTUP_EFFECT]");
> > -@@ -189,8 +200,12 @@ static TPM_RESULT cap_property(UINT32 su
> > -
> > -     case TPM_CAP_PROP_DURATION:
> > -       debug("[TPM_CAP_PROP_DURATION]");
> > --      /* TODO: TPM_CAP_PROP_DURATION */
> > --      return TPM_FAIL;
> > -+      /* TODO: TPM_CAP_PROP_DURATION: Measure these values and return accurate ones */
> > -+      BYTE dur[]= {0x0,0x0,0x0,0xc,0x0,0x7,0xa1,0x20,0x0,0x1e,0x84,0x80,0x11,0xe1,0xa3,0x0};
> > -+      *respSize = 16;
> > -+      *resp = tpm_malloc(*respSize);
> > -+      memcpy(*resp,dur,16);
> > -+
> > -
> > -     case TPM_CAP_PROP_ACTIVE_COUNTER:
> > -       debug("[TPM_CAP_PROP_ACTIVE_COUNTER]");
> > -diff -Naurp tpm_emulator-0.5.1/tpmd/Makefile tpm5-test/tpmd/Makefile
> > ---- tpm_emulator-0.5.1/tpmd/Makefile   2008-02-14 03:22:48.000000000 -0500
> > -+++ tpm5-test/tpmd/Makefile    2009-07-16 12:08:26.000000000 -0400
> > -@@ -8,9 +8,10 @@ WFLAGS  := -Wall -Wno-unused -Wpointer-a
> > -            -Wwrite-strings -Wsign-compare -Wno-multichar
> > -            #WFLAGS  += -Wextra -Wcast-qual -Wmissing-prototypes -Wmissing-declarations -Wstrict-aliasing
> > - CFLAGS  += $(WFLAGS) -g -I.. -I. -O2 -fno-strict-aliasing
> > -+CFLAGS  += -I../../../../tools/vtpm_manager/manager
> > - LDFLAGS += -lgmp
> > -
> > --BINDIR  := /usr/sbin/
> > -+BINDIR  := /usr/bin/
> > -
> > - TPMD    := tpmd
> > - DIRS    := ../tpm ../crypto
> > -@@ -18,6 +19,8 @@ SRCS    := $(foreach dir, $(DIRS), $(wil
> > - OBJS    := $(patsubst %.c, %.o, $(SRCS))
> > - OBJS    := $(foreach dir, $(DIRS), $(patsubst $(dir)/%.o, %.o, $(filter $(dir)/%.o, $(OBJS))))
> > -
> > -+VTPM_BIN := vtpmd
> > -+
> > - vpath %.c $(strip $(DIRS))
> > -
> > - all: $(TPMD)
> > -@@ -32,10 +35,8 @@ TPMD_GROUP ?= tss
> > - INSTALL    ?= install
> > -
> > - install: $(TPMD)
> > --      $(INSTALL) -m 755 -o $(TPMD_USER) -g $(TPMD_GROUP) -d $(DESTDIR)/var/lib/tpm
> > --      $(INSTALL) -m 755 -o $(TPMD_USER) -g $(TPMD_GROUP) -d $(DESTDIR)/var/run/tpm
> > -       $(INSTALL) -D -d $(DESTDIR)/$(BINDIR)
> > --      $(INSTALL) -m 755 $(TPMD) $(DESTDIR)/$(BINDIR)
> > -+      $(INSTALL) -m 755 $(TPMD) $(DESTDIR)/$(BINDIR)/$(VTPM_BIN)
> > -
> > - .PHONY: all clean install
> > -
> > -diff -Naurp tpm_emulator-0.5.1/tpmd/tpmd.c tpm5-test/tpmd/tpmd.c
> > ---- tpm_emulator-0.5.1/tpmd/tpmd.c     2008-02-14 03:22:48.000000000 -0500
> > -+++ tpm5-test/tpmd/tpmd.c      2009-07-16 11:19:05.000000000 -0400
> > -@@ -32,6 +32,9 @@
> > - #include <grp.h>
> > - #include "tpm_emulator_config.h"
> > - #include "tpm/tpm_emulator.h"
> > -+#include "tpm/tpm_structures.h"
> > -+#include "tpm/tpm_marshalling.h"
> > -+#include "vtpm_manager.h"
> > -
> > - #define TPM_DAEMON_NAME     "tpmd"
> > - #define TPM_CMD_BUF_SIZE    4096
> > -@@ -39,6 +42,24 @@
> > - #define TPM_RANDOM_DEVICE   "/dev/urandom"
> > - #undef  TPM_MKDIRS
> > -
> > -+#ifdef VTPM_MULTI_VM
> > -+ #define DEV_BE "/dev/vtpm"
> > -+ #define DEV_FE "/dev/tpm"
> > -+#else
> > -+ #define PVM_RX_FIFO_D "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
> > -+ #define PVM_TX_FIFO "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
> > -+ #define HVM_RX_FIFO_D "/var/vtpm/socks/%d.socket"
> > -+
> > -+ #define VTPM_RX_FIFO_D "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
> > -+ #define VTPM_TX_FIFO "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
> > -+
> > -+ static char *vtpm_rx_name=NULL;
> > -+#endif
> > -+
> > -+ static int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> > -+
> > -+#define BUFFER_SIZE 2048
> > -+
> > - static volatile int stopflag = 0;
> > - static int is_daemon = 0;
> > - static int opt_debug = 0;
> > -@@ -49,6 +70,8 @@ static const char *opt_storage_file = "/
> > - static uid_t opt_uid = 0;
> > - static gid_t opt_gid = 0;
> > - static int tpm_startup = 2;
> > -+static int vtpm_type = VTPM_TYPE_PVM;
> > -+int dmi_id = 0;
> > - static int rand_fh;
> > -
> > - void tpm_log(int priority, const char *fmt, ...)
> > -@@ -90,56 +113,241 @@ uint64_t tpm_get_ticks(void)
> > -
> > - int tpm_write_to_file(uint8_t *data, size_t data_length)
> > - {
> > --    int fh;
> > --    ssize_t res;
> > --    fh = open(opt_storage_file, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> > --    if (fh < 0) return -1;
> > --    while (data_length > 0) {
> > --        res = write(fh, data, data_length);
> > --      if (res < 0) {
> > --          close(fh);
> > --          return -1;
> > --      }
> > --      data_length -= res;
> > --      data += res;
> > -+  int res, out_data_size, in_header_size;
> > -+  BYTE *ptr, *out_data, *in_header;
> > -+  UINT32 result, len, in_rsp_size;
> > -+  UINT16 tag = VTPM_TAG_REQ;
> > -+
> > -+  printf("Saving NVM\n");
> > -+  if (vtpm_tx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> > -+#else
> > -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> > -+#endif
> > -+  }
> > -+
> > -+  if (vtpm_tx_fh < 0) {
> > -+              return -1;
> > -+  }
> > -+
> > -+  // Send request to VTPM Manager to encrypt data
> > -+#ifdef VTPM_MUTLI_VM
> > -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT + data_length;
> > -+#else
> > -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV + data_length;
> > -+#endif
> > -+
> > -+  out_data = ptr = (BYTE *) malloc(len);
> > -+
> > -+  if (ptr == NULL
> > -+#ifndef VTPM_MUTLI_VM
> > -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> > -+#endif
> > -+        || tpm_marshal_UINT16(&ptr, &len, tag)
> > -+#ifdef VTPM_MUTLI_VM
> > -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> > -+#else
> > -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> > -+#endif
> > -+        || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_SAVENVM)
> > -+        || tpm_marshal_BYTE_ARRAY(&ptr, &len, data, data_length)) {
> > -+      free(out_data);
> > -+      return -1;
> > -+  }
> > -+
> > -+  printf("\tSending SaveNVM Command.\n");
> > -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> > -+  free(out_data);
> > -+  if (res != out_data_size) return -1;
> > -+
> > -+  if (vtpm_rx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+    vtpm_rx_fh = vtpm_tx_fh
> > -+#else
> > -+    if (vtpm_rx_name == NULL) {
> > -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> > -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> > -     }
> > --    close(fh);
> > --    return 0;
> > -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> > -+#endif
> > -+  }
> > -+
> > -+  if (vtpm_rx_fh < 0) {
> > -+              return -1;
> > -+  }
> > -+
> > -+  // Read Header of response so we can get the size & status
> > -+#ifdef VTPM_MUTLI_VM
> > -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> > -+#else
> > -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> > -+#endif
> > -+  in_header = ptr = malloc(in_header_size);
> > -+
> > -+  printf("\tReading SaveNVM header.\n");
> > -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> > -+
> > -+  if ( (res != in_header_size)
> > -+#ifndef VTPM_MUTLI_VM
> > -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> > -+#endif
> > -+         || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> > -+         || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> > -+         || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> > -+        free(in_header);
> > -+        return -1;
> > -+  }
> > -+  free(in_header);
> > -+
> > -+  if (result != VTPM_SUCCESS) {
> > -+      return -1;
> > -+  }
> > -+
> > -+#ifdef VTPM_MUTLI_VM
> > -+  close(vtpm_tx_fh); close(vtpm_rx_fh);
> > -+#endif
> > -+
> > -+  printf("\tFinishing up SaveNVM\n");
> > -+  return (0);
> > - }
> > -
> > - int tpm_read_from_file(uint8_t **data, size_t *data_length)
> > - {
> > --    int fh;
> > --    ssize_t res;
> > --    size_t total_length;
> > --    fh = open(opt_storage_file, O_RDONLY);
> > --    if (fh < 0) return -1;
> > --    total_length = lseek(fh, 0, SEEK_END);
> > --    lseek(fh, 0, SEEK_SET);
> > --    *data = tpm_malloc(total_length);
> > --    if (*data == NULL) {
> > --        close(fh);
> > --        return -1;
> > --    }
> > --    *data_length = 0;
> > --    while (total_length > 0) {
> > --        res = read(fh, &(*data)[*data_length], total_length);
> > --      if (res < 0) {
> > --          close(fh);
> > --          tpm_free(*data);
> > --          return -1;
> > --      }
> > --        *data_length += res;
> > --      total_length -= res;
> > -+  int res, out_data_size, in_header_size;
> > -+  uint8_t *ptr, *out_data, *in_header;
> > -+  UINT16 tag = VTPM_TAG_REQ;
> > -+  UINT32 len, in_rsp_size, result;
> > -+#ifdef VTPM_MUTLI_VM
> > -+      int vtpm_rx_fh, vtpm_tx_fh;
> > -+#endif
> > -+
> > -+  printf("Loading NVM.\n");
> > -+  if (vtpm_tx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> > -+#else
> > -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> > -+#endif
> > -+  }
> > -+
> > -+  if (vtpm_tx_fh < 0) {
> > -+      printf("Error in read_from_file:301\n");
> > -+              return -1;
> > -+  }
> > -+
> > -+  // Send request to VTPM Manager to encrypt data
> > -+#ifdef VTPM_MUTLI_VM
> > -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> > -+#else
> > -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> > -+#endif
> > -+  out_data = ptr = (BYTE *) malloc(len);
> > -+
> > -+  if (ptr == NULL
> > -+#ifndef VTPM_MUTLI_VM
> > -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> > -+#endif
> > -+      || tpm_marshal_UINT16(&ptr, &len, tag)
> > -+#ifdef VTPM_MUTLI_VM
> > -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> > -+#else
> > -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> > -+#endif
> > -+      || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_LOADNVM)) {
> > -+    free(out_data);
> > -+    printf("Error in read_from_file:325\n");
> > -+
> > -+    return -1;
> > -+  }
> > -+
> > -+  printf("\tSending LoadNVM command\n");
> > -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> > -+  free(out_data);
> > -+  if (res != out_data_size)
> > -+    {
> > -+      printf("Error in read_from_file:335\n");
> > -+      return -1;
> > -+    }
> > -+
> > -+    if (vtpm_rx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+    vtpm_rx_fh = vtpm_tx_fh;
> > -+#else
> > -+    if (vtpm_rx_name == NULL) {
> > -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> > -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> > -     }
> > --    close(fh);
> > --    return 0;
> > -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> > -+#endif
> > -+  }
> > -+
> > -+  if (vtpm_rx_fh < 0) {
> > -+      printf("Error in read_from_file:352\n");
> > -+      return -1;
> > -+  }
> > -+
> > -+  // Read Header of response so we can get the size & status
> > -+#ifdef VTPM_MUTLI_VM
> > -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> > -+#else
> > -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> > -+#endif
> > -+  in_header = ptr = malloc(in_header_size);
> > -+
> > -+  printf("\tReading LoadNVM header\n");
> > -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> > -+
> > -+  if ( (res != in_header_size)
> > -+#ifndef VTPM_MUTLI_VM
> > -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> > -+#endif
> > -+       || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> > -+       || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> > -+       || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> > -+      free(in_header);
> > -+      printf("Error in read_from_file:375\n");
> > -+      return -1;
> > -+  }
> > -+  free(in_header);
> > -+
> > -+  if (result != VTPM_SUCCESS) {
> > -+    printf("Error in read_from_file:381\n");
> > -+    return -1;
> > -+  }
> > -+
> > -+  // Read Encrypted data from VTPM Manager
> > -+  *data_length = in_rsp_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> > -+  *data = (uint8_t *) malloc(*data_length);
> > -+
> > -+  printf("\tReading clear data from LoadNVM.\n");
> > -+  res = read(vtpm_rx_fh, *data, *data_length);
> > -+#ifdef VTPM_MUTLI_VM
> > -+  close(vtpm_rx_fh);close(vtpm_tx_fh);
> > -+#endif
> > -+
> > -+  printf("\tReturing from loading NVM\n");
> > -+  if (res != (int)*data_length) {
> > -+      free(*data);
> > -+      printf("Error in read_from_file:398\n");
> > -+      return -1;
> > -+  } else {
> > -+      return 0;
> > -+  }
> > -+
> > -+
> > -+
> > - }
> > -
> > - static void print_usage(char *name)
> > - {
> > -     printf("usage: %s [-d] [-f] [-s storage file] [-u unix socket name] "
> > --           "[-o user name] [-g group name] [-h] [startup mode]\n", name);
> > -+           "[-o user name] [-g group name] [-h]"
> > -+#ifdef VTPM_MULTI_VM
> > -+         "clear|save|deactivated\n", name);
> > -+#else
> > -+         "clear|save|deactivated pvm|hvm vtpmid\n", name);
> > -+#endif
> > -     printf("  d : enable debug mode\n");
> > -     printf("  f : forces the application to run in the foreground\n");
> > -     printf("  s : storage file to use (default: %s)\n", opt_storage_file);
> > -@@ -205,7 +413,13 @@ static void parse_options(int argc, char
> > -                 exit(EXIT_SUCCESS);
> > -         }
> > -     }
> > --    if (optind < argc) {
> > -+    /*Make sure we have all required options*/
> > -+#ifdef VTPM_MULTI_VM
> > -+#define EXTRA_OPTS 0
> > -+#else
> > -+#define EXTRA_OPTS 2
> > -+#endif
> > -+    if (optind < argc - EXTRA_OPTS ) {
> > -         debug("startup mode = '%s'", argv[optind]);
> > -         if (!strcmp(argv[optind], "clear")) {
> > -             tpm_startup = 1;
> > -@@ -219,6 +433,25 @@ static void parse_options(int argc, char
> > -             print_usage(argv[0]);
> > -             exit(EXIT_SUCCESS);
> > -         }
> > -+#ifndef VTPM_MULTI_VM
> > -+        ++optind;
> > -+      if(!strcmp(argv[optind], "pvm")) {
> > -+              vtpm_type = VTPM_TYPE_PVM;      // Get commands from vTPM Manager through fifo
> > -+      } else if (!strcmp(argv[optind], "hvm")) {
> > -+              vtpm_type = VTPM_TYPE_HVM;      // Get commands from qemu via socket
> > -+        } else {
> > -+              error("Invalid vm mode '%s'; must be 'pvm', "
> > -+                      "or 'hvm' ", argv[optind]);
> > -+              print_usage(argv[0]);
> > -+              exit(EXIT_SUCCESS);
> > -+      }
> > -+        ++optind;
> > -+      dmi_id = atoi(argv[optind]);
> > -+#endif
> > -+    } else {
> > -+      error("Invalid number of arguments");
> > -+      print_usage(argv[0]);
> > -+      exit(EXIT_SUCCESS);
> > -     }
> > - }
> > -
> > -@@ -348,93 +581,180 @@ static int init_socket(const char *name)
> > -
> > - static void main_loop(void)
> > - {
> > --    int sock, fh, res;
> > --    int32_t in_len;
> > -+    int32_t in_len, written;
> > -     uint32_t out_len;
> > --    uint8_t in[TPM_CMD_BUF_SIZE], *out;
> > -+    uint8_t in[TPM_CMD_BUF_SIZE], *out, *addressed_out;
> > -+    int guest_id=-1;
> > -+    int i;
> > -+    char *vtpm_rx_file=NULL;
> > -+    int res;
> > -+
> > -+#ifndef VTPM_MULTI_VM
> > -+    int sockfd = -1;
> > -     struct sockaddr_un addr;
> > --    socklen_t addr_len;
> > --    fd_set rfds;
> > --    struct timeval tv;
> > -+    struct sockaddr_un client_addr;
> > -+    unsigned int client_length;
> > -+#endif
> > -+
> > -+    int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> > -+
> > -+#ifndef VTPM_MULTI_VM
> > -+  if (vtpm_type == VTPM_TYPE_PVM) {
> > -+    vtpm_rx_file = malloc(10 + strlen(PVM_RX_FIFO_D));
> > -+    sprintf(vtpm_rx_file, PVM_RX_FIFO_D, (uint32_t) dmi_id);
> > -+  } else {
> > -+    vtpm_rx_file = malloc(10 + strlen(HVM_RX_FIFO_D));
> > -+    sprintf(vtpm_rx_file, HVM_RX_FIFO_D, (uint32_t) dmi_id);
> > -+
> > -+    if ( (sockfd = socket(PF_UNIX,SOCK_STREAM,0)) < 0) {
> > -+          error("Unable to create socket. errno = %d\n", errno);
> > -+      exit (-1);
> > -+    }
> > -+
> > -+    memset(&addr, 0, sizeof(addr));
> > -+    addr.sun_family = AF_UNIX;
> > -+    strcpy(addr.sun_path,vtpm_rx_file );
> > -+    unlink(addr.sun_path);
> > -+  }
> > -+#endif
> > -
> > -     info("staring main loop");
> > --    /* open UNIX socket */
> > --    sock = init_socket(opt_socket_name);
> > --    if (sock < 0) exit(EXIT_FAILURE);
> > -     /* init tpm emulator */
> > --    debug("initializing TPM emulator: %d", tpm_startup);
> > -+#ifdef VTPM_MULTI_VM
> > -+    debug("initializing TPM emulator: state=%d", tpm_startup);
> > -+#else
> > -+    debug("initializing TPM emulator: state=%d, type=%d, id=%d", tpm_startup, vtpm_type, dmi_id);
> > -+#endif
> > -     tpm_emulator_init(tpm_startup);
> > -     /* start command processing */
> > -     while (!stopflag) {
> > -         /* wait for incomming connections */
> > -         debug("waiting for connections...");
> > --        FD_ZERO(&rfds);
> > --        FD_SET(sock, &rfds);
> > --        tv.tv_sec = 10;
> > --        tv.tv_usec = 0;
> > --        res = select(sock + 1, &rfds, NULL, NULL, &tv);
> > --        if (res < 0) {
> > --            error("select(sock) failed: %s", strerror(errno));
> > --            break;
> > --        } else if (res == 0) {
> > --            continue;
> > --        }
> > --        addr_len = sizeof(addr);
> > --        fh = accept(sock, (struct sockaddr*)&addr, &addr_len);
> > --        if (fh < 0) {
> > --            error("accept() failed: %s", strerror(errno));
> > --            continue;
> > --        }
> > -+      if (vtpm_rx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+          vtpm_rx_fh = open(DEV_BE, O_RDWR);
> > -+#else
> > -+          if (vtpm_type == VTPM_TYPE_PVM)
> > -+          {
> > -+              vtpm_rx_fh = open(vtpm_rx_file, O_RDONLY);
> > -+          } else {
> > -+              if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
> > -+                  error("Unable to bind(). errno = %d\n", errno);
> > -+                  exit (-1);
> > -+              }
> > -+
> > -+              if (listen(sockfd, 10) <0) {
> > -+                  error("Unable to listen(). errno = %d\n", errno);
> > -+                  exit (-1);
> > -+              }
> > -+
> > -+               memset(&client_addr, 0, sizeof(client_addr));
> > -+               client_length = sizeof(client_addr);
> > -+
> > -+               vtpm_rx_fh = vtpm_tx_fh = accept(sockfd, (struct sockaddr *)&client_addr, &client_length);
> > -+          }
> > -+#endif
> > -+      }
> > -+
> > -+      /*Error Checking*/
> > -+      if (vtpm_rx_fh < 0) {
> > -+        error("Failed to open devices to listen to guest.\n");
> > -+        exit(-1);
> > -+      }
> > -+
> > -         /* receive and handle commands */
> > -         in_len = 0;
> > -         do {
> > -             debug("waiting for commands...");
> > --            FD_ZERO(&rfds);
> > --            FD_SET(fh, &rfds);
> > --            tv.tv_sec = TPM_COMMAND_TIMEOUT;
> > --            tv.tv_usec = 0;
> > --            res = select(fh + 1, &rfds, NULL, NULL, &tv);
> > --            if (res < 0) {
> > --                error("select(fh) failed: %s", strerror(errno));
> > --                close(fh);
> > --                break;
> > --            } else if (res == 0) {
> > --#ifdef TPMD_DISCONNECT_IDLE_CLIENTS
> > --                info("connection closed due to inactivity");
> > --                close(fh);
> > --                break;
> > --#else
> > --                continue;
> > --#endif
> > --            }
> > --            in_len = read(fh, in, sizeof(in));
> > --            if (in_len > 0) {
> > -+
> > -+            in_len = read(vtpm_rx_fh, in, sizeof(in));
> > -+          /*Magic size of minimum TPM command is 6*/
> > -+              //FIXME Magic size check may not be required anymore
> > -+            if (in_len < 6) {
> > -+              info("Recv incomplete command of %d bytes.", in_len);
> > -+              if (in_len <= 0) {
> > -+                  close(vtpm_rx_fh);
> > -+                  vtpm_rx_fh = -1;
> > -+                  continue;
> > -+                 }
> > -+          } else {
> > -+              /*Debug Printouts*/
> > -                 debug("received %d bytes", in_len);
> > -+              debug_nostop("Recv[%d]: 0x", in_len);
> > -+              for (i=0; i< in_len; i++)
> > -+                  debug_more("%x ", in[i]);
> > -+              debug_more("\n");
> > -+              /*Multiple Guest check*/
> > -+              if (guest_id == -1) {
> > -+                  guest_id = *((int32_t *) in);
> > -+              } else {
> > -+                  if (guest_id != *((int32_t *) in) ) {
> > -+                      error("WARNING: More than one guest attached\n");
> > -+                  }
> > -+              }
> > -+
> > -+              /*Open tx handle now*/
> > -+              if (vtpm_tx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+                  vtpm_tx_fh = open(DEV_BE, O_RDWR);
> > -+                  vtpm_rx_fh = vtpm_tx_fh;
> > -+#else
> > -+                  if (vtpm_type == VTPM_TYPE_PVM) {
> > -+                      vtpm_tx_fh = open(PVM_TX_FIFO, O_WRONLY);
> > -+                  } // No need to open the other direction for HVM
> > -+#endif
> > -+              }
> > -+              if (vtpm_tx_fh < 0) {
> > -+                error("Failed to open devices to respond to guest.\n");
> > -+                exit(-1);
> > -+              }
> > -+
> > -+              /*Handle the TPM command now*/
> > -                 out = NULL;
> > --                res = tpm_handle_command(in, in_len, &out, &out_len);
> > -+                res = tpm_handle_command(in + sizeof(uint32_t), in_len - sizeof(uint32_t), &out, &out_len);
> > -                 if (res < 0) {
> > -                     error("tpm_handle_command() failed");
> > -                 } else {
> > -                     debug("sending %d bytes", out_len);
> > -+                  //FIXME this prepending may or may not be needed
> > -+                  /*Prepend the first 4 bytes of the in buffer.. why?*/
> > -+                  addressed_out = (uint8_t *) tpm_malloc(sizeof(uint32_t) + out_len);
> > -+                  *(uint32_t *) addressed_out = *(uint32_t *) in;
> > -+                  memcpy(addressed_out + sizeof(uint32_t), out, out_len);
> > -+                  out_len += sizeof(uint32_t);
> > -+                  /*End Prepend*/
> > -+
> > -+                  /*Perform write operation now*/
> > -                     while (out_len > 0) {
> > --                        res = write(fh, out, out_len);
> > -+                        res = write(vtpm_tx_fh, addressed_out, out_len);
> > -+
> > -                         if (res < 0) {
> > -                             error("write(%d) failed: %s", out_len, strerror(errno));
> > -                             break;
> > --                        }
> > -+                        } else {
> > -+                        debug_nostop("Sent[%Zu]: ", out_len);
> > -+                        for (i=0; (unsigned int)i< out_len; i++)
> > -+                          debug_more("%x ", addressed_out[i]);
> > -+                        debug_more("\n");
> > -+                      }
> > -                         out_len       -= res;
> > -                     }
> > -                     tpm_free(out);
> > -+                  tpm_free(addressed_out);
> > -                 }
> > -             }
> > -         } while (in_len > 0);
> > --        close(fh);
> > -+        //close(fh);
> > -     }
> > -+
> > -     /* shutdown tpm emulator */
> > -     tpm_emulator_shutdown();
> > --    /* close socket */
> > --    close(sock);
> > --    unlink(opt_socket_name);
> > -+    /* Close handles */
> > -+    close(vtpm_tx_fh);
> > -+#ifndef VTPM_MULTI_VM
> > -+    close(vtpm_rx_fh);
> > -+    free(vtpm_rx_file);
> > -+#endif
> > -     info("main loop stopped");
> > - }
> > -
> > -@@ -450,12 +770,13 @@ int main(int argc, char **argv)
> > -     /* open random device */
> > -     init_random();
> > -     /* init signal handlers */
> > --    init_signal_handler();
> > -+    //init_signal_handler();
> > -     /* unless requested otherwiese, fork and daemonize process */
> > --    if (!opt_foreground) daemonize();
> > -+    //if (!opt_foreground) daemonize();
> > -     /* start main processing loop */
> > -     main_loop();
> > -     info("stopping TPM Emulator daemon");
> > -     closelog();
> > -     return 0;
> > - }
> > -+
> > -diff -Naurp tpm_emulator-0.5.1/tpmd/tpm_emulator_config.h tpm5-test/tpmd/tpm_emulator_config.h
> > ---- tpm_emulator-0.5.1/tpmd/tpm_emulator_config.h      2008-02-14 03:22:48.000000000 -0500
> > -+++ tpm5-test/tpmd/tpm_emulator_config.h       2009-07-16 11:25:26.000000000 -0400
> > -@@ -29,23 +29,28 @@
> > -
> > - /* TPM emulator configuration */
> > -
> > --#undef  TPM_STRONG_PERSISTENCE
> > --#undef  TPM_GENERATE_EK
> > -+#define  TPM_STRONG_PERSISTENCE
> > -+#define  TPM_GENERATE_EK
> > - #undef  TPM_GENERATE_SEED_DAA
> > - #undef  TPM_MEMORY_ALIGNMENT_MANDATORY
> > -
> > -+extern int dmi_id;
> > -+
> > - /* log macros */
> > -
> > - void tpm_log(int priority, const char *fmt, ...);
> > -
> > --#define debug(fmt, ...) tpm_log(LOG_DEBUG, "%s:%d: Debug: " fmt "\n", \
> > --                                __FILE__, __LINE__, ## __VA_ARGS__)
> > --#define info(fmt, ...)  tpm_log(LOG_INFO, "%s:%d: Info: " fmt "\n", \
> > --                                __FILE__, __LINE__, ## __VA_ARGS__)
> > --#define error(fmt, ...) tpm_log(LOG_ERR, "%s:%d: Error: " fmt "\n", \
> > --                                __FILE__, __LINE__, ## __VA_ARGS__)
> > --#define alert(fmt, ...) tpm_log(LOG_ALERT, "%s:%d: Alert: " fmt "\n", \
> > --                                __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define debug(fmt, ...) tpm_log(LOG_DEBUG, "VTPMD[%d]: %s:%d: Debug: " fmt "\n", \
> > -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define info(fmt, ...)  tpm_log(LOG_INFO, "VTPMD[%d]: %s:%d: Info: " fmt "\n", \
> > -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define error(fmt, ...) tpm_log(LOG_ERR, "VTPMD[%d]: %s:%d: Error: " fmt "\n", \
> > -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define alert(fmt, ...) tpm_log(LOG_ALERT, "VTPMD[%d]: %s:%d: Alert: " fmt "\n", \
> > -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define debug_nostop(fmt, ...) tpm_log(LOG_DEBUG, "VTPMD[%d]: %s:%d: Debug: " fmt, \
> > -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define debug_more(fmt, ...) tpm_log(LOG_DEBUG, fmt, ## __VA_ARGS__)
> > -
> > - /*  min/max macros that also do strict type-checking */
> > -
> > diff --git a/tools/vtpm/vtpm.patch b/tools/vtpm/vtpm.patch
> > deleted file mode 100644
> > index e896b25..0000000
> > --- a/tools/vtpm/vtpm.patch
> > +++ /dev/null
> > @@ -1,716 +0,0 @@
> > -diff -uprN tpm_emulator/AUTHORS vtpm/AUTHORS
> > ---- tpm_emulator/AUTHORS       2006-12-08 12:51:29.000000000 -0800
> > -+++ vtpm/AUTHORS       2006-12-13 16:38:52.000000000 -0800
> > -@@ -1,3 +1,3 @@
> > - Mario Strasser <mast@gmx.net>
> > - Heiko Stamer <stamer@gaos.org> [DAA]
> > --INTEL Corp <> [Dropped to Ring3]
> > -+INTEL Corp <> [VTPM Extensions]
> > -diff -uprN tpm_emulator/ChangeLog vtpm/ChangeLog
> > ---- tpm_emulator/ChangeLog     2006-12-08 12:51:29.000000000 -0800
> > -+++ vtpm/ChangeLog     2006-12-13 16:38:52.000000000 -0800
> > -@@ -1,5 +1,6 @@
> > - ????-??-?? Intel Corp
> > -       * Moved module out of kernel to run as a ring 3 app
> > -+      * Modified save_to_file and load_from_file to call xen VTPM manager
> > -
> > - 2006-06-23  Mario Strasser <mast@gmx.net>
> > -       * tpm_startup.c: behaviour of ST_CLEAR and storage of
> > -diff -uprN tpm_emulator/linux_module.h vtpm/linux_module.h
> > ---- tpm_emulator/linux_module.h        2006-12-08 12:51:29.000000000 -0800
> > -+++ vtpm/linux_module.h        2007-01-09 14:49:06.000000000 -0800
> > -@@ -44,18 +44,26 @@
> > - #define TPM_DEVICE_NAME   "tpm"
> > - #define TPM_MODULE_NAME   "tpm_emulator"
> > -
> > -+/* debug and log output functions */
> > -+extern int dmi_id;
> > -+
> > - #ifdef DEBUG
> > --#define debug(fmt, ...) printf("TPMD: %s:%d: Debug: " fmt "\n", \
> > --                        __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define debug(fmt, ...) printf("TPMD[%d]: %s:%d: Debug: " fmt "\n", \
> > -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define debug_nostop(fmt, ...) printf("TPMD[%d]: %s:%d: Debug: " fmt, \
> > -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define debug_more(fmt, ...) printf( fmt, ## __VA_ARGS__ )
> > - #else
> > - #define debug(fmt, ...)
> > -+#define debug_nostop(fmt, ...)
> > -+#define debug_more(fmt, ...)
> > - #endif
> > --#define info(fmt, ...)  printf("TPMD: %s:%d: Info: " fmt "\n", \
> > --                        __FILE__, __LINE__, ## __VA_ARGS__)
> > --#define error(fmt, ...) printf("TPMD: %s:%d: Error: " fmt "\n", \
> > --                        __FILE__, __LINE__, ## __VA_ARGS__)
> > --#define alert(fmt, ...) printf("TPMD: %s:%d: Alert: " fmt "\n", \
> > --                        __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define info(fmt, ...)  printf("TPMD[%d]: %s:%d: Info: " fmt "\n", \
> > -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define error(fmt, ...) printf("TPMD[%d]: %s:%d: Error: " fmt "\n", \
> > -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -+#define alert(fmt, ...) printf("TPMD[%d]: %s:%d: Alert: " fmt "\n", \
> > -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> > -
> > - /* memory allocation */
> > -
> > -diff -uprN tpm_emulator/Makefile vtpm/Makefile
> > ---- tpm_emulator/Makefile      2006-12-08 12:51:29.000000000 -0800
> > -+++ vtpm/Makefile      2006-12-13 16:38:52.000000000 -0800
> > -@@ -7,7 +7,7 @@
> > - COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
> > -
> > - # module settings
> > --BIN            := tpm_emulator
> > -+BIN            := vtpmd
> > - VERSION_MAJOR  := 0
> > - VERSION_MINOR  := 4
> > - VERSION_BUILD  := $(shell date +"%s")
> > -@@ -22,7 +22,7 @@ TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin
> > -
> > - CC      := gcc
> > - CFLAGS  += -g -Wall $(INCLUDE) -DDEBUG
> > --CFLAGS  += -I. -Itpm
> > -+CFLAGS  += -I. -Itpm -I../../vtpm_manager/manager
> > -
> > - # Is the simulator running in it's own vm?
> > - #CFLAGS += -DVTPM_MULTI_VM
> > -@@ -62,7 +62,6 @@ $(BIN):      $(src)/crypto/gmp.h $(src)/crypt
> > -
> > - install: $(BIN)
> > -       $(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)
> > --      @if [ ! -d "/var/tpm" ]; then mkdir /var/tpm; fi
> > -
> > - clean:
> > -       rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a $(OBJS)
> > -@@ -98,3 +97,4 @@ version:
> > -       @echo "#endif /* _TPM_VERSION_H_ */" >> $(src)/tpm_version.h
> > -
> > - .PHONY: all install clean dist gmp version
> > -+
> > -diff -uprN tpm_emulator/tpm/tpm_capability.c vtpm/tpm/tpm_capability.c
> > ---- tpm_emulator/tpm/tpm_capability.c  2006-06-23 03:37:07.000000000 -0700
> > -+++ vtpm/tpm/tpm_capability.c  2007-01-10 10:00:49.000000000 -0800
> > -@@ -136,8 +136,18 @@ static TPM_RESULT cap_property(UINT32 su
> > -
> > -     case TPM_CAP_PROP_TIS_TIMEOUT:
> > -       debug("[TPM_CAP_PROP_TIS_TIMEOUT]");
> > --      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT */
> > --      return TPM_FAIL;
> > -+      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT: Measure these values and determine correct ones */
> > -+      UINT32 len = *respSize = 16;
> > -+      BYTE *ptr = *resp = tpm_malloc(*respSize);
> > -+      if (ptr == NULL ||
> > -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> > -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> > -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> > -+          tpm_marshal_UINT32(&ptr, &len, 200000)) {
> > -+        tpm_free(*resp);
> > -+        return TPM_FAIL;
> > -+      }
> > -+      return TPM_SUCCESS;
> > -
> > -     case TPM_CAP_PROP_STARTUP_EFFECT:
> > -       debug("[TPM_CAP_PROP_STARTUP_EFFECT]");
> > -@@ -190,7 +200,11 @@ static TPM_RESULT cap_property(UINT32 su
> > -
> > -     case TPM_CAP_PROP_DURATION:
> > -       debug("[TPM_CAP_PROP_DURATION]");
> > --      /* TODO: TPM_CAP_PROP_DURATION */
> > -+      /* TODO: TPM_CAP_PROP_DURATION: Measure these values and return accurate ones */
> > -+      BYTE dur[]= {0x0,0x0,0x0,0xc,0x0,0x7,0xa1,0x20,0x0,0x1e,0x84,0x80,0x11,0xe1,0xa3,0x0};
> > -+      *respSize = 16;
> > -+      *resp = tpm_malloc(*respSize);
> > -+      memcpy(*resp,dur,16);
> > -       return TPM_FAIL;
> > -
> > -     case TPM_CAP_PROP_ACTIVE_COUNTER:
> > -diff -uprN tpm_emulator/tpm/tpm_cmd_handler.c vtpm/tpm/tpm_cmd_handler.c
> > ---- tpm_emulator/tpm/tpm_cmd_handler.c 2008-02-27 16:35:41.000000000 -0500
> > -+++ vtpm/tpm/tpm_cmd_handler.c 2008-02-28 14:43:28.000000000 -0500
> > -@@ -94,12 +94,18 @@ void tpm_compute_out_param_digest(TPM_CO
> > -   sha1_ctx_t sha1;
> > -   UINT32 res = CPU_TO_BE32(rsp->result);
> > -   UINT32 ord = CPU_TO_BE32(ordinal);
> > -+  UINT32 offset = 0;
> > -
> > -   /* compute SHA1 hash */
> > -   sha1_init(&sha1);
> > -   sha1_update(&sha1, (BYTE*)&res, 4);
> > -   sha1_update(&sha1, (BYTE*)&ord, 4);
> > --  sha1_update(&sha1, rsp->param, rsp->paramSize);
> > -+  if (ordinal == TPM_ORD_LoadKey2) {
> > -+      offset = 4;
> > -+  }
> > -+  if (rsp->paramSize - offset > 0) {
> > -+      sha1_update(&sha1, rsp->param + offset, rsp->paramSize - offset);
> > -+  }
> > -   sha1_final(&sha1, rsp->auth1->digest);
> > -   if (rsp->auth2 != NULL) memcpy(rsp->auth2->digest,
> > -     rsp->auth1->digest, sizeof(rsp->auth1->digest));
> > -diff -uprN tpm_emulator/tpm/tpm_data.c vtpm/tpm/tpm_data.c
> > ---- tpm_emulator/tpm/tpm_data.c        2008-02-27 16:35:41.000000000 -0500
> > -+++ vtpm/tpm/tpm_data.c        2008-02-27 16:35:40.000000000 -0500
> > -@@ -1,6 +1,7 @@
> > - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> > -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> > -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> > -+ * Copyright (C) 2005 INTEL Corp
> > -  *
> > -  * This module is free software; you can redistribute it and/or modify
> > -  * it under the terms of the GNU General Public License as published
> > -@@ -15,10 +16,15 @@
> > -  * $Id: tpm_data.c 98 2006-05-07 14:16:29Z hstamer $
> > -  */
> > -
> > -+#include <sys/types.h>
> > -+#include <sys/stat.h>
> > -+#include <fcntl.h>
> > -+#include <unistd.h>
> > -+
> > - #include "tpm_emulator.h"
> > - #include "tpm_structures.h"
> > - #include "tpm_marshalling.h"
> > --#include "linux_module.h"
> > -+#include "vtpm_manager.h"
> > -
> > - TPM_DATA tpmData;
> > -
> > -@@ -158,45 +164,232 @@ void tpm_release_data(void)
> > - #include <sys/types.h>
> > - #include <sys/stat.h>
> > - #include <fcntl.h>
> > --#include <unistd.h>
> > -
> > --#define TPM_STORAGE_FILE "/var/tpm/tpm_emulator-1.2." STR(VERSION_MAJOR) "." STR(VERSION_MINOR)
> > -+ static int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> > -+
> > -+#ifdef VTPM_MUTLI_VM
> > -+ #define DEV_FE "/dev/tpm"
> > -+#else
> > -+ #define VTPM_RX_FIFO_D  "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
> > -+ #define VTPM_TX_FIFO  "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
> > -+
> > -+ extern int dmi_id;
> > -+ static char *vtpm_rx_name=NULL;
> > -+#endif
> > -
> > - static int write_to_file(uint8_t *data, size_t data_length)
> > - {
> > --  int res;
> > --  int fp;
> > --  fp = open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> > --  res = write(fp, data, data_length);
> > --  close(fp);
> > --  return (res == data_length) ? 0 : -1;
> > -+  int res, out_data_size, in_header_size;
> > -+  BYTE *ptr, *out_data, *in_header;
> > -+  UINT32 result, len, in_rsp_size;
> > -+  UINT16 tag = VTPM_TAG_REQ;
> > -+
> > -+  printf("Saving NVM\n");
> > -+  if (vtpm_tx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> > -+#else
> > -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> > -+#endif
> > -+  }
> > -+
> > -+  if (vtpm_tx_fh < 0) {
> > -+              return -1;
> > -+  }
> > -+
> > -+  // Send request to VTPM Manager to encrypt data
> > -+#ifdef VTPM_MUTLI_VM
> > -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT + data_length;
> > -+#else
> > -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV + data_length;
> > -+#endif
> > -+
> > -+  out_data = ptr = (BYTE *) malloc(len);
> > -+
> > -+  if (ptr == NULL
> > -+#ifndef VTPM_MUTLI_VM
> > -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> > -+#endif
> > -+        || tpm_marshal_UINT16(&ptr, &len, tag)
> > -+#ifdef VTPM_MUTLI_VM
> > -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> > -+#else
> > -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> > -+#endif
> > -+        || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_SAVENVM)
> > -+        || tpm_marshal_BYTE_ARRAY(&ptr, &len, data, data_length)) {
> > -+      free(out_data);
> > -+      return -1;
> > -+  }
> > -+
> > -+  printf("\tSending SaveNVM Command.\n");
> > -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> > -+  free(out_data);
> > -+  if (res != out_data_size) return -1;
> > -+
> > -+  if (vtpm_rx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+    vtpm_rx_fh = vtpm_tx_fh
> > -+#else
> > -+    if (vtpm_rx_name == NULL) {
> > -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> > -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> > -+    }
> > -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> > -+#endif
> > -+  }
> > -+
> > -+  if (vtpm_rx_fh < 0) {
> > -+              return -1;
> > -+  }
> > -+
> > -+  // Read Header of response so we can get the size & status
> > -+#ifdef VTPM_MUTLI_VM
> > -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> > -+#else
> > -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> > -+#endif
> > -+  in_header = ptr = malloc(in_header_size);
> > -+
> > -+  printf("\tReading SaveNVM header.\n");
> > -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> > -+
> > -+  if ( (res != in_header_size)
> > -+#ifndef VTPM_MUTLI_VM
> > -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> > -+#endif
> > -+         || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> > -+         || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> > -+         || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> > -+        free(in_header);
> > -+        return -1;
> > -+  }
> > -+  free(in_header);
> > -+
> > -+  if (result != VTPM_SUCCESS) {
> > -+      return -1;
> > -+  }
> > -+
> > -+#ifdef VTPM_MUTLI_VM
> > -+  close(vtpm_tx_fh); close(vtpm_rx_fh);
> > -+#endif
> > -+
> > -+  printf("\tFinishing up SaveNVM\n");
> > -+  return (0);
> > - }
> > -
> > - static int read_from_file(uint8_t **data, size_t *data_length)
> > - {
> > --  int res;
> > --  int fp, file_status;
> > --  struct stat file_info;
> > --  fp = open(TPM_STORAGE_FILE, O_RDONLY, 0);
> > --  file_status = fstat(fp, &file_info);
> > --  if (file_status < 0) {
> > --    close(fp);
> > --    return -1;
> > --  }
> > -+  int res, out_data_size, in_header_size;
> > -+  uint8_t *ptr, *out_data, *in_header;
> > -+  UINT16 tag = VTPM_TAG_REQ;
> > -+  UINT32 len, in_rsp_size, result;
> > -+#ifdef VTPM_MUTLI_VM
> > -+      int vtpm_rx_fh, vtpm_tx_fh;
> > -+#endif
> > -+
> > -+  printf("Loading NVM.\n");
> > -+  if (vtpm_tx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> > -+#else
> > -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> > -+#endif
> > -+  }
> > -
> > --  *data_length = file_info.st_size;
> > --  *data = tpm_malloc(*data_length);
> > --  if (*data == NULL) {
> > --    close(fp);
> > -+  if (vtpm_tx_fh < 0) {
> > -+              return -1;
> > -+  }
> > -+
> > -+  // Send request to VTPM Manager to encrypt data
> > -+#ifdef VTPM_MUTLI_VM
> > -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> > -+#else
> > -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> > -+#endif
> > -+  out_data = ptr = (BYTE *) malloc(len);
> > -+
> > -+  if (ptr == NULL
> > -+#ifndef VTPM_MUTLI_VM
> > -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> > -+#endif
> > -+      || tpm_marshal_UINT16(&ptr, &len, tag)
> > -+#ifdef VTPM_MUTLI_VM
> > -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> > -+#else
> > -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> > -+#endif
> > -+      || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_LOADNVM)) {
> > -+    free(out_data);
> > -     return -1;
> > -   }
> > --  res = read(fp, *data, *data_length);
> > --  close(fp);
> > -+
> > -+  printf("\tSending LoadNVM command\n");
> > -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> > -+  free(out_data);
> > -+  if (res != out_data_size) return -1;
> > -+
> > -+    if (vtpm_rx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+    vtpm_rx_fh = vtpm_tx_fh;
> > -+#else
> > -+    if (vtpm_rx_name == NULL) {
> > -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> > -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> > -+    }
> > -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> > -+#endif
> > -+  }
> > -+
> > -+  if (vtpm_rx_fh < 0) {
> > -+              return -1;
> > -+  }
> > -+
> > -+  // Read Header of response so we can get the size & status
> > -+#ifdef VTPM_MUTLI_VM
> > -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> > -+#else
> > -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> > -+#endif
> > -+  in_header = ptr = malloc(in_header_size);
> > -+
> > -+  printf("\tReading LoadNVM header\n");
> > -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> > -+
> > -+  if ( (res != in_header_size)
> > -+#ifndef VTPM_MUTLI_VM
> > -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> > -+#endif
> > -+       || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> > -+       || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> > -+       || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> > -+      free(in_header);
> > -+      return -1;
> > -+  }
> > -+  free(in_header);
> > -+
> > -+  if (result != VTPM_SUCCESS) {
> > -+      return -1;
> > -+  }
> > -+
> > -+  // Read Encrypted data from VTPM Manager
> > -+  *data_length = in_rsp_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> > -+  *data = (uint8_t *) malloc(*data_length);
> > -+
> > -+  printf("\tReading clear data from LoadNVM.\n");
> > -+  res = read(vtpm_rx_fh, *data, *data_length);
> > -+#ifdef VTPM_MUTLI_VM
> > -+  close(vtpm_rx_fh);close(vtpm_tx_fh);
> > -+#endif
> > -+
> > -+  printf("\tReturing from loading NVM\n");
> > -   if (res != *data_length) {
> > --    tpm_free(*data);
> > --    return -1;
> > -+      free(*data);
> > -+      return -1;
> > -+  } else {
> > -+      return 0;
> > -   }
> > --  return 0;
> > -+
> > - }
> > -
> > - #else
> > -diff -uprN tpm_emulator/tpmd.c vtpm/tpmd.c
> > ---- tpm_emulator/tpmd.c        2006-12-08 12:51:29.000000000 -0800
> > -+++ vtpm/tpmd.c        2007-01-09 14:48:56.000000000 -0800
> > -@@ -21,12 +21,24 @@
> > - #include <sys/stat.h>
> > - #include <fcntl.h>
> > - #include <sys/time.h>
> > -+#include <sys/socket.h>
> > -+#include <sys/un.h>
> > -+#include <errno.h>
> > -
> > - #include "tpm_emulator.h"
> > -+#include "vtpm_manager.h"
> > -
> > --#define TPM_RX_FNAME "/var/tpm/tpm_in.fifo"
> > --#define TPM_TX_FNAME "/var/tpm/tpm_out.fifo"
> > -+#ifdef VTPM_MULTI_VM
> > -+ #define DEV_BE "/dev/vtpm"
> > -+#else
> > -+ #define PVM_RX_FIFO_D "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
> > -+ #define PVM_TX_FIFO "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
> > -
> > -+ #define HVM_RX_FIFO_D "/var/vtpm/socks/%d.socket"
> > -+#endif
> > -+
> > -+ int dmi_id;
> > -+
> > - #define BUFFER_SIZE 2048
> > -
> > - static int devurandom=0;
> > -@@ -38,7 +50,7 @@ void get_random_bytes(void *buf, int nby
> > -   }
> > -
> > -   if (read(devurandom, buf, nbytes) != nbytes) {
> > --      printf("Can't get random number.\n");
> > -+      error("Can't get random number.\n");
> > -       exit(-1);
> > -   }
> > - }
> > -@@ -52,105 +64,182 @@ uint64_t tpm_get_ticks(void)
> > -
> > - int main(int argc, char **argv)
> > - {
> > --  uint8_t in[BUFFER_SIZE], *out;
> > -+  uint8_t type, in[BUFFER_SIZE], *out, *addressed_out;
> > -+  char *vtpm_rx_file=NULL;
> > -   uint32_t out_size;
> > -   int in_size, written;
> > --  int i;
> > --  struct stat file_info;
> > -+  int i, guest_id=-1;
> > -
> > --  int tpm_tx_fh=-1, tpm_rx_fh=-1;
> > -+#ifndef VTPM_MULTI_VM
> > -+  int sockfd = -1;
> > -+  struct sockaddr_un addr;
> > -+  struct sockaddr_un client_addr;
> > -+  unsigned int client_length;
> > -+
> > -+#endif
> > -+
> > -+  int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> > -+#ifdef VTPM_MULTI_VM
> > -   if (argc < 2) {
> > --    printf("Usage: tpmd clear|save|deactivated\n" );
> > -+    error("Usage: tpmd clear|save|deactivated\n" );
> > -+#else
> > -+  if (argc < 4) {
> > -+    error("Usage: tpmd clear|save|deactivated pvm|hvm vtpmid\n" );
> > -+#endif
> > -         return -1;
> > -   }
> > -
> > -+#ifndef VTPM_MULTI_VM
> > -+  /* setup type of vm */
> > -+  if (!strcmp(argv[2], "pvm")) {
> > -+    type = VTPM_TYPE_PVM; // Get commands from vTPM Manager through fifo
> > -+  } else if (!strcmp(argv[2], "hvm")) {
> > -+    type = VTPM_TYPE_HVM; // Get commands from qemu via socket
> > -+  } else {
> > -+    error("invalid vTPM type '%s'.\n", argv[2]);
> > -+  }
> > -+
> > -+  dmi_id = atoi(argv[3]);
> > -+
> > -+  if (type == VTPM_TYPE_PVM) {
> > -+    vtpm_rx_file = malloc(10 + strlen(PVM_RX_FIFO_D));
> > -+    sprintf(vtpm_rx_file, PVM_RX_FIFO_D, (uint32_t) dmi_id);
> > -+  } else {
> > -+    vtpm_rx_file = malloc(10 + strlen(HVM_RX_FIFO_D));
> > -+    sprintf(vtpm_rx_file, HVM_RX_FIFO_D, (uint32_t) dmi_id);
> > -+
> > -+    if ( (sockfd = socket(PF_UNIX,SOCK_STREAM,0)) < 0) {
> > -+          error("Unable to create socket. errno = %d\n", errno);
> > -+      exit (-1);
> > -+    }
> > -+
> > -+    memset(&addr, 0, sizeof(addr));
> > -+    addr.sun_family = AF_UNIX;
> > -+    strcpy(addr.sun_path,vtpm_rx_file );
> > -+    unlink(addr.sun_path);
> > -+  }
> > -+#endif
> > -+
> > -+#ifdef VTPM_MULTI_VM
> > -+  info("Initializing tpm state: %s\n", argv[1]);
> > -+#else
> > -+  info("Initializing tpm state: %s, type: %s, id: %d\n", argv[1], argv[2], dmi_id);
> > -+#endif
> > -+
> > -   /* initialize TPM emulator */
> > -   if (!strcmp(argv[1], "clear")) {
> > --    printf("Initializing tpm: %s\n", argv[1]);
> > -     tpm_emulator_init(1);
> > --  } else if (!strcmp(argv[1], "save")) {
> > --    printf("Initializing tpm: %s\n", argv[1]);
> > -+  } else if (!strcmp(argv[1], "save")) {
> > -     tpm_emulator_init(2);
> > -   } else if (!strcmp(argv[1], "deactivated")) {
> > --    printf("Initializing tpm: %s\n", argv[1]);
> > -     tpm_emulator_init(3);
> > -   } else {
> > --    printf("invalid startup mode '%s'; must be 'clear', "
> > -+    error("invalid startup mode '%s'; must be 'clear', "
> > -       "'save' (default) or 'deactivated", argv[1]);
> > -     return -1;
> > -   }
> > --
> > --  if ( stat(TPM_RX_FNAME, &file_info) == -1) {
> > --    if ( mkfifo(TPM_RX_FNAME, S_IWUSR | S_IRUSR ) ) {
> > --      printf("Failed to create fifo %s.\n", TPM_RX_FNAME);
> > --      return -1;
> > --    }
> > --  }
> > --
> > --  if ( stat(TPM_TX_FNAME, &file_info) == -1) {
> > --    if ( mkfifo(TPM_TX_FNAME, S_IWUSR | S_IRUSR ) ) {
> > --      printf("Failed to create fifo %s.\n", TPM_TX_FNAME);
> > --      return -1;
> > --    }
> > --  }
> > --
> > -+
> > -   while (1) {
> > - abort_command:
> > --    if (tpm_rx_fh < 0) {
> > --      tpm_rx_fh = open(TPM_RX_FNAME, O_RDONLY);
> > -+    if (vtpm_rx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+      vtpm_rx_fh = open(DEV_BE, O_RDWR);
> > -+#else
> > -+      if (type == VTPM_TYPE_PVM) {
> > -+        vtpm_rx_fh = open(vtpm_rx_file, O_RDONLY);
> > -+      } else {
> > -+        if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
> > -+          error("Unable to bind(). errno = %d\n", errno);
> > -+          exit (-1);
> > -+        }
> > -+
> > -+        if (listen(sockfd, 10) <0) {
> > -+          error("Unable to listen(). errno = %d\n", errno);
> > -+          exit (-1);
> > -+        }
> > -+
> > -+        memset(&client_addr, 0, sizeof(client_addr));
> > -+        client_length = sizeof(client_addr);
> > -+
> > -+        vtpm_rx_fh = vtpm_tx_fh = accept(sockfd, (struct sockaddr *)&client_addr, &client_length);
> > -+      }
> > -+#endif
> > -     }
> > -
> > --    if (tpm_rx_fh < 0) {
> > --      printf("ERROR: failed to open devices to listen to guest.\n");
> > -+    if (vtpm_rx_fh < 0) {
> > -+      error("Failed to open devices to listen to guest.\n");
> > -       return -1;
> > -     }
> > -
> > --    if (tpm_tx_fh < 0) {
> > --      tpm_tx_fh = open(TPM_TX_FNAME, O_WRONLY);
> > --    }
> > --
> > --    if (tpm_tx_fh < 0) {
> > --      printf("ERROR: failed to open devices to respond to guest.\n");
> > --      return -1;
> > --    }
> > --
> > --    in_size = read(tpm_rx_fh, in, BUFFER_SIZE);
> > -+    in_size = read(vtpm_rx_fh, in, BUFFER_SIZE);
> > -     if (in_size < 6) { // Magic size of minium TPM command
> > --      printf("Recv[%d] to small: 0x", in_size);
> > -+      info("Recv incomplete command of %d bytes.", in_size);
> > -       if (in_size <= 0) {
> > --          close(tpm_rx_fh);
> > --          tpm_rx_fh = -1;
> > -+          close(vtpm_rx_fh);
> > -+          vtpm_rx_fh = -1;
> > -           goto abort_command;
> > -       }
> > -     } else {
> > --      printf("Recv[%d]: 0x", in_size);
> > -+      debug_nostop("Recv[%d]: 0x", in_size);
> > -       for (i=0; i< in_size; i++)
> > --        printf("%x ", in[i]);
> > --      printf("\n");
> > -+        debug_more("%x ", in[i]);
> > -+      debug_more("\n");
> > -     }
> > -
> > --
> > --    if (tpm_handle_command(in, in_size, &out, &out_size) != 0) {
> > --        printf("ERROR: Handler Failed.\n");
> > -+    if (guest_id == -1) {
> > -+        guest_id = *((uint32_t *) in);
> > -+    } else {
> > -+        if (guest_id != *((uint32_t *) in) ) {
> > -+            error("WARNING: More than one guest attached\n");
> > -+        }
> > -+    }
> > -+
> > -+    if (vtpm_tx_fh < 0) {
> > -+#ifdef VTPM_MUTLI_VM
> > -+      vtpm_tx_fh = open(DEV_BE, O_RDWR);
> > -+      vtpm_rx_fh = vtpm_tx_fh;
> > -+#else
> > -+      if (type == VTPM_TYPE_PVM) {
> > -+        vtpm_tx_fh = open(PVM_TX_FIFO, O_WRONLY);
> > -+      } // No need to open the other direction for HVM
> > -+#endif
> > -+    }
> > -+
> > -+    if (vtpm_tx_fh < 0) {
> > -+      error("Failed to open devices to respond to guest.\n");
> > -+      return -1;
> > -+    }
> > -+
> > -+    // Handle the command, but skip the domain id header
> > -+    if (tpm_handle_command(in + sizeof(uint32_t), in_size - sizeof(uint32_t), &out, &out_size) != 0) {
> > -+      error("Handler Failed.\n");
> > -     }
> > -
> > --    written = write(tpm_tx_fh, out, out_size);
> > -+    addressed_out = (uint8_t *) tpm_malloc(sizeof(uint32_t) + out_size);
> > -+    *(uint32_t *) addressed_out = *(uint32_t *) in;
> > -+    memcpy(addressed_out + sizeof(uint32_t), out, out_size);
> > -+
> > -+    written = write(vtpm_tx_fh, addressed_out, out_size + sizeof(uint32_t));
> > -
> > --    if (written != out_size ) {
> > --      printf("ERROR: Part of response not written %d/%d.\nAttempt: ", written, out_size);
> > -+    if (written != out_size + sizeof(uint32_t)) {
> > -+      error("Part of response not written %d/%d.\n", written, out_size);
> > -     } else {
> > --      printf("Sent[%Zu]: ", out_size);
> > -+      debug_nostop("Sent[%Zu]: ", out_size + sizeof(uint32_t));
> > -+      for (i=0; i< out_size+ sizeof(uint32_t); i++)
> > -+        debug_more("%x ", addressed_out[i]);
> > -+      debug_more("\n");
> > -     }
> > --    for (i=0; i< out_size; i++)
> > --      printf("%x ", out[i]);
> > --    printf("\n");
> > -     tpm_free(out);
> > -+    tpm_free(addressed_out);
> > -
> > -   } // loop
> > -
> > -   tpm_emulator_shutdown();
> > -
> > --  close(tpm_tx_fh);
> > --  close(tpm_rx_fh);
> > -+  close(vtpm_tx_fh);
> > -+#ifndef VTPM_MUTLI_VM
> > -+  close(vtpm_rx_fh);
> > -+  free (vtpm_rx_file);
> > -+#endif
> > -
> > - }
> > diff --git a/tools/vtpm_manager/COPYING b/tools/vtpm_manager/COPYING
> > deleted file mode 100644
> > index c4b86b7..0000000
> > --- a/tools/vtpm_manager/COPYING
> > +++ /dev/null
> > @@ -1,32 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > diff --git a/tools/vtpm_manager/Makefile b/tools/vtpm_manager/Makefile
> > deleted file mode 100644
> > index 632f41b..0000000
> > --- a/tools/vtpm_manager/Makefile
> > +++ /dev/null
> > @@ -1,18 +0,0 @@
> > -XEN_ROOT = $(CURDIR)/../..
> > -
> > -# Base definitions and rules
> > -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> > -
> > -SUBDIRS                = crypto tcs util manager migration
> > -OPENSSL_HEADER = /usr/include/openssl/crypto.h
> > -
> > -.PHONY: all clean install
> > -all clean install: %: subdirs-%
> > -
> > -.PHONY: mrproper
> > -mrproper:
> > -       @set -e; for subdir in $(SUBDIRS); do \
> > -               $(MAKE) -C $$subdir $@; \
> > -       done
> > -
> > -
> > diff --git a/tools/vtpm_manager/README b/tools/vtpm_manager/README
> > deleted file mode 100644
> > index f0d1e98..0000000
> > --- a/tools/vtpm_manager/README
> > +++ /dev/null
> > @@ -1,94 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -
> > -Directory Structure
> > -===================
> > -tools/vtpm_manager/crypto    -> crypto files
> > -tools/vtpm_manager/TCS       -> TCS implementation
> > -tools/vtpm_manager/util      -> Utility Library. Include disk-io and buffers.
> > -tools/vtpm_manager/manager   -> VTPM Manager
> > -
> > -Compile Flags
> > -===================
> > -LOGGING_MODULES              -> How extensive logging happens
> > -                                see util/log.h for more info
> > -
> > -VTPM_MULTI_VM                -> Defined: VTPMs run in their own VMs
> > -                                Not Defined (default): VTPMs are processes
> > -
> > -# Debugging flags that may disappear without notice in the future
> > -
> > -DUMMY_BACKEND                -> vtpm_manager listens on /tmp/in.fifo and
> > -                                /tmp/out.fifo rather than backend
> > -
> > -MANUAL_DM_LAUNCH             -> Must manually launch & kill VTPMs
> > -
> > -WELL_KNOWN_OWNER_AUTH        -> Rather than randomly generating the password for the owner,
> > -                                use a well known value. This is useful for debugging and for
> > -                                poor bios which do not support clearing TPM if OwnerAuth is
> > -                                lost. However this has no protection from malicious app
> > -                                issuing a TPM_OwnerClear to wipe the TPM
> > -
> > -Requirements
> > -============
> > -- xen-unstable
> > -- vtpm frontend/backend driver patch
> > -- OpenSSL Library
> > -
> > -Single-VM Flow
> > -============================
> > -- Launch the VTPM manager (vtpm_managerd) which which begins listening to the BE with one thread
> > -  and listens to a named fifo that is shared by the vtpms to commuincate with the manager.
> > -- VTPM Manager listens to TPM BE.
> > -- When xend launches a tpm frontend equipped VM it contacts the manager over the vtpm backend.
> > -- When the manager receives the open message from the BE, it launches a vtpm
> > -- Xend allows the VM to continue booting.
> > -- When a TPM request is issued to the front end, the front end transmits the TPM request to the backend.
> > -- The manager receives the TPM requests and uses a named fifo to forward the request to the vtpm.
> > -- The fifo listener begins listening for the reply from vtpm for the request.
> > -- Vtpm processes request and replies to manager over shared named fifo.
> > -- If needed, the vtpm may send a request to the vtpm_manager at any time to save it's secrets to disk.
> > -- Manager receives response from vtpm and passes it back to backend for forwarding to guest.
> > -
> > -NOTES:
> > -* SaveService SHOULD seal it's table before saving it to disk. However,
> > -  the current Xen infrastructure does not provide a mechanism for this to be
> > -  unsealed later. Specifically, the auth and wrapped key must be available ONLY
> > -  to the service, or it's not even worth encrypting
> > -
> > -  In the future the vtpm manager will be protected by an early boot mechanism
> > -  that will allow for better protection of it's data.
> > -
> > -TODO:
> > -- Timeout on crashed vtpms
> > -- create lock for shared fifo for talking to vtpms.
> > diff --git a/tools/vtpm_manager/Rules.mk b/tools/vtpm_manager/Rules.mk
> > deleted file mode 100644
> > index 651772b..0000000
> > --- a/tools/vtpm_manager/Rules.mk
> > +++ /dev/null
> > @@ -1,59 +0,0 @@
> > -# Base definitions and rules (XEN_ROOT must be defined in including Makefile)
> > -include $(XEN_ROOT)/tools/Rules.mk
> > -
> > -#
> > -# Tool definitions
> > -#
> > -
> > -# General compiler flags
> > -CFLAGS = -Werror -g3
> > -
> > -# Generic project files
> > -HDRS   = $(wildcard *.h)
> > -SRCS   = $(wildcard *.c)
> > -OBJS   = $(patsubst %.c,%.o,$(SRCS))
> > -
> > -# Generic (non-header) dependencies
> > -$(SRCS): Makefile $(XEN_ROOT)/tools/Rules.mk $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> > -
> > -$(OBJS): $(SRCS)
> > -
> > --include $(FILES)
> > -
> > -# Make sure these are just rules
> > -.PHONY : all build install clean
> > -
> > -#
> > -# Project-specific definitions
> > -#
> > -
> > -# Need UNIX98 spec for pthread rwlocks
> > -CFLAGS += -D_GNU_SOURCE
> > -
> > -# Logging Level. See utils/tools.h for usage
> > -CFLAGS += -DLOGGING_MODULES="(BITMASK(VTPM_LOG_TCS)|BITMASK(VTPM_LOG_VTSP)|BITMASK(VTPM_LOG_VTPM))"
> > -
> > -# Silent Mode
> > -#CFLAGS += -DLOGGING_MODULES=0x0
> > -#CFLAGS += -DLOGGING_MODULES=0xff
> > -
> > -# Use frontend/backend pairs between manager & DMs?
> > -#CFLAGS += -DVTPM_MULTI_VM
> > -
> > -# vtpm_manager listens on fifo's rather than backend
> > -#CFLAGS += -DDUMMY_BACKEND
> > -
> > -# TCS talks to fifo's rather than /dev/tpm. TPM Emulator assumed on fifos
> > -#CFLAGS += -DDUMMY_TPM
> > -
> > -# Do not have manager launch DMs.
> > -#CFLAGS += -DMANUAL_DM_LAUNCH
> > -
> > -# Fixed OwnerAuth
> > -#CFLAGS += -DWELL_KNOWN_OWNER_AUTH
> > -
> > -# Include
> > -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/crypto
> > -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/util
> > -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/tcs
> > -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/manager
> > diff --git a/tools/vtpm_manager/crypto/Makefile b/tools/vtpm_manager/crypto/Makefile
> > deleted file mode 100644
> > index 13b61c9..0000000
> > --- a/tools/vtpm_manager/crypto/Makefile
> > +++ /dev/null
> > @@ -1,24 +0,0 @@
> > -XEN_ROOT = $(CURDIR)/../../..
> > -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> > -
> > -BIN            = libtcpaCrypto.a
> > -
> > -.PHONY: all
> > -all: build
> > -
> > -.PHONY: build
> > -build: $(BIN)
> > -
> > -.PHONY: install
> > -install: build
> > -
> > -.PHONY: clean
> > -clean:
> > -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> > -
> > -.PHONY: mrproper
> > -mrproper: clean
> > -       rm -f *~
> > -
> > -$(BIN): $(OBJS)
> > -       $(AR) rcs $(BIN) $(OBJS)
> > diff --git a/tools/vtpm_manager/crypto/crypto.c b/tools/vtpm_manager/crypto/crypto.c
> > deleted file mode 100644
> > index 7dae655..0000000
> > --- a/tools/vtpm_manager/crypto/crypto.c
> > +++ /dev/null
> > @@ -1,88 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// crypto.c
> > -//
> > -//  This file will handle all the TPM Crypto functionality
> > -//
> > -// ==================================================================
> > -
> > -#include <string.h>
> > -#include <openssl/crypto.h>
> > -#include <openssl/err.h>
> > -#include <openssl/evp.h>
> > -#include <openssl/rand.h>
> > -#include "crypto.h"
> > -#include "log.h"
> > -
> > -/**
> > - * Initialize cryptography library
> > - * @rand: random seed
> > - * @size: size of @rand
> > - */
> > -void Crypto_Init(const BYTE* rand, int size) {
> > -       ERR_load_crypto_strings();
> > -  CRYPTO_malloc_init();
> > -  OpenSSL_add_all_algorithms();
> > -  SYM_CIPHER = EVP_aes_128_cbc();
> > -  RAND_poll();
> > -  if (rand == NULL)
> > -    return;
> > -
> > -  RAND_add(rand, size, size);
> > -}
> > -
> > -/**
> > - * Shutdown cryptography library
> > - */
> > -void Crypto_Exit() {
> > -  ERR_free_strings();
> > -  ERR_remove_state(0);
> > -  EVP_cleanup();
> > -}
> > -
> > -
> > -/**
> > - * Get random data
> > - * @data: (OUT) Random data
> > - * @size: Size of @data
> > - */
> > -void Crypto_GetRandom(void* data, int size) {
> > -  int result;
> > -
> > -  result = RAND_pseudo_bytes((BYTE*) data, size);
> > -
> > -  if (result <= 0)
> > -    vtpmlogerror (VTPM_LOG_CRYPTO, "RAND_pseudo_bytes failed: %s\n",
> > -            ERR_error_string (ERR_get_error(), NULL));
> > -}
> > diff --git a/tools/vtpm_manager/crypto/crypto.h b/tools/vtpm_manager/crypto/crypto.h
> > deleted file mode 100644
> > index 488d4d6..0000000
> > --- a/tools/vtpm_manager/crypto/crypto.h
> > +++ /dev/null
> > @@ -1,175 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// crypto.h
> > -//
> > -//  This file defines the TPM Crypto API
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __CRYPTO_H__
> > -#define __CRYPTO_H__
> > -
> > -#include <stddef.h>
> > -#include <stdint.h>
> > -#include <stdbool.h>
> > -
> > -#include "tcg.h"
> > -#include "sym_crypto.h"
> > -
> > -#define CRYPTO_MAX_SIG_SIZE (2048 / 8)
> > -#define CRYPTO_MAX_RSA_KEY_SIZE (4096 / 8) //in bytes
> > -
> > -#define OAEP_P "TCPA"
> > -#define OAEP_P_SIZE 4
> > -
> > -// Algorithms supported by crypto. Stored in CRYPTO_INFO.algorithmID
> > -#define CRYPTO_ALGORITH_RSA 0x01
> > -
> > -// Supported Encryption Schemes CRYPTO_INFO.encScheme
> > -#define CRYPTO_ES_NONE 0x0001
> > -#define CRYPTO_ES_RSAESPKCSv15 0x0002
> > -#define CRYPTO_ES_RSAESOAEP_SHA1_MGF1 0x0003
> > -
> > -// Supported Signature schemes CRYPTO_INFO.sigScheme
> > -#define CRYPTO_SS_NONE 0x0001
> > -#define CRYPTO_SS_RSASSAPKCS1v15_SHA1 0x0002
> > -#define CRYPTO_SS_RSASSAPKCS1v15_DER 0x0003
> > -
> > -typedef struct CRYPTO_INFO {
> > -  void *keyInfo;
> > -  UINT32 algorithmID;
> > -  UINT32 encScheme;
> > -  UINT32 sigScheme;
> > -} CRYPTO_INFO;
> > -
> > -
> > -void Crypto_Init(const BYTE* rand, int size);
> > -
> > -void Crypto_Exit();
> > -
> > -void Crypto_GetRandom(void* data, int size);
> > -
> > -void Crypto_HMAC(   const BYTE* text,
> > -                    int text_len,
> > -                    const BYTE* key,
> > -                    int key_len,
> > -                    BYTE* digest);
> > -
> > -TPM_RESULT Crypto_HMAC_buf (const buffer_t * text,
> > -                            const buffer_t * key,
> > -                            BYTE * o_digest); /* presumably of 20 bytes */
> > -
> > -void Crypto_SHA1Full(   const BYTE* text,
> > -                        UINT32 size,
> > -                        BYTE* hash); //Complete 3part SHA1
> > -
> > -// o_hash needs to be large enough to hold the digest, ie 20 bytes
> > -TPM_RESULT Crypto_SHA1Full_buf (const buffer_t * buf,
> > -                                BYTE * o_hash);
> > -
> > -void Crypto_SHA1Start(UINT32* maxNumBytes);
> > -void Crypto_SHA1Update(int numBytes, const BYTE* hashData);
> > -void Crypto_SHA1Complete(   int hashDataSize,
> > -                            const BYTE* hashData,
> > -                            BYTE* hashValue);
> > -
> > -void Crypto_RSACreateKey(   /*in*/ UINT32 keySize,
> > -                            /*in*/ UINT32 pubExpSize,
> > -                            /*in*/ BYTE *pubExp,
> > -                            /*out*/ UINT32 *privExpSize,
> > -                            /*out*/ BYTE *privExp,
> > -                            /*out*/ UINT32 *modulusSize,
> > -                            /*out*/ BYTE *modulus,
> > -                            /*out*/ CRYPTO_INFO *keys);
> > -
> > -void Crypto_RSABuildCryptoInfo( /*[IN]*/ UINT32 pubExpSize,
> > -                                /*[IN]*/ BYTE *pubExp,
> > -                                /*[IN]*/ UINT32 privExpSize,
> > -                                /*[IN]*/ BYTE *privExp,
> > -                                /*[IN]*/ UINT32 modulusSize,
> > -                                /*[IN]*/ BYTE *modulus,
> > -                                /*[OUT]*/ CRYPTO_INFO* cryptoInfo);
> > -
> > -void Crypto_RSABuildCryptoInfoPublic(   /*[IN]*/ UINT32 pubExpSize,
> > -                                        /*[IN]*/ BYTE *pubExp,
> > -                                        /*[IN]*/ UINT32 modulusSize,
> > -                                        /*[IN]*/ BYTE *modulus,
> > -                                        CRYPTO_INFO* cryptoInfo);
> > -
> > -//
> > -// symmetric pack and unpack operations
> > -//
> > -TPM_RESULT Crypto_RSAPackCryptoInfo (const CRYPTO_INFO* cryptoInfo,
> > -                                     BYTE ** io_buf, UINT32 * io_buflen);
> > -
> > -TPM_RESULT Crypto_RSAUnpackCryptoInfo (CRYPTO_INFO * ci,
> > -                                       BYTE * in, UINT32 len,
> > -                                       UINT32 * o_lenread);
> > -
> > -
> > -// return 0 on success, -1 on error
> > -int Crypto_RSAEnc(  CRYPTO_INFO *keys,
> > -                    UINT32 inDataSize,
> > -                    BYTE *inData,
> > -                    /*out*/ UINT32 *outDataSize,
> > -                    /*out*/ BYTE *outData);
> > -
> > -// return 0 on success, -1 on error
> > -int Crypto_RSADec(  CRYPTO_INFO *keys,
> > -                    UINT32 inDataSize,
> > -                    BYTE *inData,
> > -                    /*out*/ UINT32 *outDataSize,
> > -                    /*out*/ BYTE *outData);
> > -
> > -// return 0 on success, -1 on error
> > -int Crypto_RSASign( CRYPTO_INFO *keys,
> > -                    UINT32 inDataSize,
> > -                    BYTE *inData,
> > -                    /*out*/ UINT32 *sigSize,
> > -                    /*out*/ BYTE *sig);
> > -
> > -bool Crypto_RSAVerify(  CRYPTO_INFO *keys,
> > -                        UINT32 inDataSize,
> > -                        BYTE *inData,
> > -                        UINT32 sigSize,
> > -                        BYTE *sig);
> > -
> > -//private:
> > -int RSA_verify_DER(int dtype, unsigned char *m, unsigned int m_len,
> > -                   unsigned char *sigbuf, unsigned int siglen, CRYPTO_INFO *key);
> > -
> > -int RSA_sign_DER(int type, unsigned char *m, unsigned int m_len,
> > -              unsigned char *sigret, unsigned int *siglen, CRYPTO_INFO *key);
> > -
> > -#endif // __CRYPTO_H__
> > diff --git a/tools/vtpm_manager/crypto/hash.c b/tools/vtpm_manager/crypto/hash.c
> > deleted file mode 100644
> > index c73114a..0000000
> > --- a/tools/vtpm_manager/crypto/hash.c
> > +++ /dev/null
> > @@ -1,153 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// hash.c
> > -//
> > -//  This file will handle all the TPM Hash functionality
> > -//
> > -// ==================================================================
> > -
> > -#include <string.h>
> > -#include <openssl/crypto.h>
> > -#include <openssl/err.h>
> > -#include <openssl/evp.h>
> > -#include <openssl/rand.h>
> > -#include <openssl/hmac.h>
> > -#include <openssl/sha.h>
> > -#include <openssl/bn.h>
> > -#include <openssl/rsa.h>
> > -
> > -#include "tcg.h"         // for TPM_SUCCESS
> > -#include "crypto.h"
> > -
> > -static SHA_CTX g_shaContext;
> > -
> > -void Crypto_HMAC(   const BYTE* text,
> > -                    int text_len,
> > -                    const BYTE* key,
> > -                    int key_len,
> > -                    BYTE* digest) {
> > -  if (text == NULL || key == NULL || text_len == 0 || key_len == 0)
> > -    return;
> > -
> > -  HMAC(EVP_sha1(), key, key_len, text, text_len, digest, NULL);
> > -}
> > -
> > -TPM_RESULT Crypto_HMAC_buf (const buffer_t * text,
> > -                           const buffer_t * key,
> > -                           BYTE * o_digest) { /* presumably of 20 bytes */
> > -
> > -  Crypto_HMAC (text->bytes, text->size,
> > -              key->bytes, key->size,
> > -              o_digest);
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -
> > -/*
> > - * SHA1
> > - * (OUT) Create a SHA1 hash of text. Calls all three SHA1 steps internally
> > - */
> > -void Crypto_SHA1Full( const BYTE* text,
> > -      uint32_t size,
> > -      BYTE* hash) {
> > -
> > -  if (text == NULL || size == 0)
> > -    return;
> > -
> > -  // Run SHA1Start + SHAUpdate (if necessary) + SHAComplete
> > -  uint32_t maxBytes; // Not used for anything
> > -  Crypto_SHA1Start(&maxBytes);
> > -
> > -  while (size > 64){
> > -    Crypto_SHA1Update(64, text);
> > -    size -= 64;
> > -    text += 64;
> > -  }
> > -
> > -  Crypto_SHA1Complete(size, text, hash);
> > -}
> > -
> > -// same thing using buffer_t
> > -TPM_RESULT Crypto_SHA1Full_buf (const buffer_t * buf,
> > -                                 BYTE * o_digest) {
> > -
> > -  if (buf->bytes == NULL || buf->size == 0)
> > -    return TPM_BAD_PARAMETER;
> > -
> > -  Crypto_SHA1Full (buf->bytes, buf->size, o_digest);
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -
> > -/*
> > - * Initialize SHA1
> > - * (OUT) Maximum number of bytes that can be sent to SHA1Update.
> > - *   Must be a multiple of 64 bytes.
> > - */
> > -void Crypto_SHA1Start(uint32_t* maxNumBytes) {
> > -  int max = SHA_CBLOCK;
> > -  // Initialize the crypto library
> > -  SHA1_Init(&g_shaContext);
> > -  *maxNumBytes = max;
> > -}
> > -
> > -/*
> > - * Process SHA1
> > - * @numBytes: (IN) The number of bytes in hashData.
> > - *       Must be a multiple of 64 bytes.
> > - * @hashData: (IN) Bytes to be hashed.
> > - */
> > -void Crypto_SHA1Update(int numBytes, const BYTE* hashData) {
> > -
> > -  if (hashData == NULL || numBytes == 0 || numBytes%64 != 0)
> > -    return;
> > -
> > -  SHA1_Update(&g_shaContext, hashData, numBytes);
> > -}
> > -
> > -/*
> > - * Complete the SHA1 process
> > - * @hashDataSize: (IN) Number of bytes in hashData.
> > - *       Must be a multiple of 64 bytes.
> > - * @hashData: (IN) Final bytes to be hashed.
> > - * @hashValue: (OUT) The output of the SHA-1 hash.
> > - */
> > -void Crypto_SHA1Complete(int hashDataSize,
> > -                        const BYTE* hashData,
> > -                        BYTE* hashValue) {
> > -  SHA1_Update(&g_shaContext, hashData, hashDataSize);
> > -  SHA1_Final(hashValue, &g_shaContext);
> > -}
> > diff --git a/tools/vtpm_manager/crypto/rsa.c b/tools/vtpm_manager/crypto/rsa.c
> > deleted file mode 100644
> > index 7737dc6..0000000
> > --- a/tools/vtpm_manager/crypto/rsa.c
> > +++ /dev/null
> > @@ -1,434 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// rsa.c
> > -//
> > -//  This file will handle all the TPM RSA crypto functionality
> > -//
> > -// ==================================================================
> > -
> > -#include <string.h>
> > -#include <openssl/crypto.h>
> > -#include <openssl/evp.h>
> > -#include <openssl/bn.h>
> > -#include <openssl/rsa.h>
> > -#include <openssl/rand.h>
> > -#include <openssl/x509.h>
> > -
> > -#include <openssl/err.h>
> > -#include <stdio.h>
> > -
> > -#include "tcg.h"
> > -#include "buffer.h"
> > -#include "crypto.h"
> > -#include "log.h"
> > -
> > -void Crypto_RSACreateKey(   /*in*/ UINT32 keySize,
> > -                            /*in*/ UINT32 pubExpSize,
> > -                            /*in*/ BYTE *pubExp,
> > -                            /*out*/ UINT32 *privExpSize,
> > -                            /*out*/ BYTE *privExp,
> > -                            /*out*/ UINT32 *modulusSize,
> > -                            /*out*/ BYTE *modulus,
> > -                            /*out*/ CRYPTO_INFO *keys) {
> > -  unsigned long e_value;
> > -
> > -  if (pubExpSize == 0) // Default e = 2^16+1
> > -    e_value = (0x01 << 16) + 1;
> > -  else {
> > -    // This is not supported, but the following line MIGHT work
> > -    // under then assumption that the format is BigNum compatable
> > -    // Though it's not in the spec, so who knows what it is.
> > -    // Forcing the default.
> > -    //BN_bin2bn(pubExp, pubExpSize, NULL);
> > -    e_value = (0x01 << 16) + 1;
> > -  }
> > -
> > -  RSA *rsa = RSA_generate_key(keySize, e_value, NULL, NULL);
> > -
> > -  if (keys) {
> > -    keys->keyInfo = rsa;
> > -    keys->algorithmID = CRYPTO_ALGORITH_RSA;
> > -  }
> > -
> > -  if (modulus)   *modulusSize   = BN_bn2bin(rsa->n, modulus);
> > -  if (privExp)   *privExpSize   = BN_bn2bin(rsa->d, privExp);
> > -}
> > -
> > -// Create a CRYPTO_INFO struct from the BYTE * key parts.
> > -// If pubExp info is NULL, use TCG default.
> > -// If there is a remainder while calculating the privExp, return FALSE.
> > -
> > -void Crypto_RSABuildCryptoInfo( /*[IN]*/ UINT32 pubExpSize,
> > -                                /*[IN]*/ BYTE *pubExp,
> > -                                /*[IN]*/ UINT32 privExpSize,
> > -                                /*[IN]*/ BYTE *privExp,
> > -                                /*[IN]*/ UINT32 modulusSize,
> > -                                /*[IN]*/ BYTE *modulus,
> > -                                CRYPTO_INFO* cryptoInfo) {
> > -  cryptoInfo->keyInfo = RSA_new();
> > -  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
> > -
> > -  rsa->e = BN_new();
> > -
> > -  if (pubExpSize == 0) { // Default e = 2^16+1
> > -    BN_set_bit(rsa->e, 16);
> > -    BN_set_bit(rsa->e, 0);
> > -  } else {
> > -    // This is not supported, but the following line MIGHT work
> > -    // under then assumption that the format is BigNum compatable
> > -    // Though it's not in the spec, so who knows what it is.
> > -    // Forcing the default.
> > -    //BN_bin2bn(pubExp, pubExpSize, NULL);
> > -    BN_set_bit(rsa->e, 16);
> > -    BN_set_bit(rsa->e, 0);
> > -  }
> > -
> > -  rsa->n = BN_bin2bn(modulus, modulusSize, NULL);
> > -  rsa->d = BN_bin2bn(privExp, privExpSize, NULL);
> > -}
> > -
> > -// Create a CRYPTO_INFO struct from the BYTE * key parts.
> > -// If pubExp info is NULL, use TCG default.
> > -// If there is a remainder while calculating the privExp, return FALSE.
> > -
> > -void Crypto_RSABuildCryptoInfoPublic(   /*[IN]*/ UINT32 pubExpSize,
> > -                                        /*[IN]*/ BYTE *pubExp,
> > -                                        /*[IN]*/ UINT32 modulusSize,
> > -                                        /*[IN]*/ BYTE *modulus,
> > -                                        CRYPTO_INFO* cryptoInfo) {
> > -  cryptoInfo->keyInfo = RSA_new();
> > -  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
> > -
> > -  rsa->e = BN_new();
> > -
> > -  if (pubExpSize == 0) { // Default e = 2^16+1
> > -    BN_set_bit(rsa->e, 16);
> > -    BN_set_bit(rsa->e, 0);
> > -  } else {
> > -    // This is not supported, but the following line MIGHT work
> > -    // under then assumption that the format is BigNum compatable
> > -    // Though it's not in the spec, so who knows what it is.
> > -    // Forcing the default.
> > -    //BN_bin2bn(pubExp, pubExpSize, NULL);
> > -    BN_set_bit(rsa->e, 16);
> > -    BN_set_bit(rsa->e, 0);
> > -  }
> > -
> > -  rsa->n = BN_bin2bn(modulus, modulusSize, NULL);
> > -
> > -}
> > -
> > -int Crypto_RSAEnc(  CRYPTO_INFO *key,
> > -                   UINT32 inDataSize,
> > -                   BYTE *inData,
> > -                   /*out*/ UINT32 *outDataSize,
> > -                   /*out*/ BYTE *outData) {
> > -  RSA *rsa = (RSA *) key->keyInfo;
> > -  UINT32 paddedDataSize = RSA_size (rsa);
> > -  BYTE *paddedData = (BYTE *)malloc(sizeof(BYTE) * paddedDataSize);
> > -  int rc;
> > -
> > -  if (paddedData == NULL)
> > -    return -1;
> > -
> > -  *outDataSize = 0;
> > -
> > -  switch (key->encScheme) {
> > -  case CRYPTO_ES_RSAESPKCSv15:
> > -    if (RSA_padding_add_PKCS1_type_2(paddedData, paddedDataSize, inData, inDataSize) <= 0) {
> > -      rc = -1;
> > -      goto abort_egress;
> > -    }
> > -    break;
> > -  case CRYPTO_ES_RSAESOAEP_SHA1_MGF1:
> > -    if (RSA_padding_add_PKCS1_OAEP(paddedData,paddedDataSize,inData,inDataSize, (BYTE *) OAEP_P,OAEP_P_SIZE) <= 0 ) {
> > -      rc = -1;
> > -      goto abort_egress;
> > -    }
> > -    break;
> > -  default:
> > -    rc = -1;
> > -    goto abort_egress;
> > -  }
> > -
> > -  rc = RSA_public_encrypt(paddedDataSize, paddedData, outData, rsa, RSA_NO_PADDING);
> > -  if (rc == -1)
> > -    goto abort_egress;
> > -
> > -  *outDataSize = rc;
> > -
> > -  if (rc > 0) rc = 0;
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  if (paddedData)
> > -    free (paddedData);
> > -  return rc;
> > -
> > -}
> > -
> > -int Crypto_RSADec(  CRYPTO_INFO *key,
> > -                    UINT32 inDataSize,
> > -                    BYTE *inData,
> > -                    /*out*/ UINT32 *outDataSize,
> > -                    /*out*/ BYTE *outData) {
> > -
> > -  RSA *rsa = (RSA *) key->keyInfo;
> > -  UINT32 paddedDataSize = RSA_size (rsa);
> > -  BYTE *paddedData = (BYTE *)malloc(sizeof(BYTE) * paddedDataSize);
> > -  int rc;
> > -
> > -  if (paddedData == NULL)
> > -    goto abort_egress;
> > -
> > -  rc = RSA_private_decrypt(inDataSize, inData, paddedData, rsa, RSA_NO_PADDING);
> > -  if (rc == -1) {
> > -    vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_private_decrypt: %s\n", ERR_error_string(ERR_get_error(), NULL));
> > -    goto abort_egress;
> > -  }
> > -
> > -  paddedDataSize = rc;
> > -
> > -  switch (key->encScheme) {
> > -  case CRYPTO_ES_RSAESPKCSv15:
> > -    rc = RSA_padding_check_PKCS1_type_2 (outData, paddedDataSize,
> > -                                        paddedData + 1, paddedDataSize - 1,
> > -                                        RSA_size(rsa));
> > -    if (rc == -1) {
> > -      vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_padding_check_PKCS1_type_2: %s\n",
> > -             ERR_error_string(ERR_get_error(), NULL));
> > -      goto abort_egress;
> > -    }
> > -    *outDataSize = rc;
> > -    break;
> > -  case CRYPTO_ES_RSAESOAEP_SHA1_MGF1:
> > -    rc = RSA_padding_check_PKCS1_OAEP(outData, paddedDataSize,
> > -                                     paddedData + 1, paddedDataSize - 1,
> > -                                     RSA_size(rsa),
> > -                                     (BYTE *) OAEP_P, OAEP_P_SIZE);
> > -    if (rc == -1) {
> > -      vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_padding_check_PKCS1_OAEP: %s\n",
> > -             ERR_error_string(ERR_get_error(), NULL));
> > -      goto abort_egress;
> > -    }
> > -    *outDataSize = rc;
> > -    break;
> > -  default:
> > -    *outDataSize = 0;
> > -  }
> > -
> > -  free(paddedData); paddedData = NULL;
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > -  if (paddedData)
> > -    free (paddedData);
> > -  return -1;
> > -
> > - egress:
> > -  return 0;
> > -}
> > -
> > -// Signs either a SHA1 digest of a message or a DER encoding of a message
> > -// Textual messages MUST be encoded or Hashed before sending into this function
> > -// It will NOT SHA the message.
> > -int Crypto_RSASign( CRYPTO_INFO *key,
> > -                    UINT32 inDataSize,
> > -                    BYTE *inData,
> > -                    /*out*/ UINT32 *sigSize,
> > -                    /*out*/ BYTE *sig) {
> > -  int status;
> > -  unsigned int intSigSize;
> > -
> > -  switch(key->sigScheme) {
> > -  case CRYPTO_SS_RSASSAPKCS1v15_SHA1:
> > -    status = RSA_sign(NID_sha1, inData, inDataSize, sig, &intSigSize, (RSA *) key->keyInfo);
> > -    break;
> > -  case CRYPTO_SS_RSASSAPKCS1v15_DER:
> > -    //        status = Crypto_RSA_sign_DER(NID_md5_sha1, inData, inDataSize, sig, &intSigSize, key);
> > -    vtpmlogerror(VTPM_LOG_CRYPTO, "Crypto: Unimplemented sign type (%d)\n", key->sigScheme);
> > -    status = 0;
> > -    break;
> > -  default:
> > -    status = 0;
> > -  }
> > -
> > -  if (status == 0) {
> > -    *sigSize = 0;
> > -    vtpmlogerror(VTPM_LOG_CRYPTO, "%s\n", ERR_error_string(ERR_get_error(), NULL));
> > -    return -1;
> > -  }
> > -
> > -  *sigSize = (UINT32) intSigSize;
> > -  return 0;
> > -}
> > -
> > -bool Crypto_RSAVerify(  CRYPTO_INFO *key,
> > -                        UINT32 inDataSize,
> > -                        BYTE *inData,
> > -                        UINT32 sigSize,
> > -                        BYTE *sig) {
> > -  int status;
> > -
> > -  switch(key->sigScheme){
> > -  case CRYPTO_SS_RSASSAPKCS1v15_SHA1:
> > -    status = RSA_verify(NID_sha1, inData, inDataSize, sig, sigSize, (RSA *) key->keyInfo);
> > -    break;
> > -  case CRYPTO_SS_RSASSAPKCS1v15_DER:
> > -    //status = Crypto_RSA_verify_DER(NID_md5_sha1, inData, inDataSize, sig, sigSize, key);
> > -    vtpmlogerror(VTPM_LOG_CRYPTO, "Crypto: Unimplemented sign type (%d)\n", key->sigScheme);
> > -    status = 0;
> > -    break;
> > -  default:
> > -    status = 0;
> > -  }
> > -
> > -  if (status)
> > -    return(1);
> > -  else {
> > -    vtpmlogerror(VTPM_LOG_CRYPTO, "RSA verify: %s\n", ERR_error_string(ERR_get_error(), NULL));
> > -    return(0);
> > -  }
> > -
> > -}
> > -
> > -// helper which packs everything into a BIO!
> > -
> > -// packs the parameters first, then the private key, then the public key
> > -// if *io_buf is NULL, allocate it here as needed. otherwise its size is in
> > -// *io_buflen
> > -TPM_RESULT Crypto_RSAPackCryptoInfo (const CRYPTO_INFO* cryptoInfo,
> > -                                      BYTE ** io_buf, UINT32 * io_buflen) {
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  BYTE * buf;
> > -  long len, outlen = *io_buflen;
> > -
> > -  const long PARAMSLEN = 3*sizeof(UINT32);
> > -
> > -  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
> > -
> > -  BIO *mem = BIO_new(BIO_s_mem());
> > -
> > -
> > -  // write the openssl keys to the BIO
> > -  if ( i2d_RSAPrivateKey_bio (mem, rsa) == 0 ) {
> > -    ERR_print_errors_fp (stderr);
> > -    ERRORDIE (TPM_SIZE);
> > -  }
> > -  if ( i2d_RSAPublicKey_bio (mem, rsa) == 0 ) {
> > -    ERR_print_errors_fp (stderr);
> > -    ERRORDIE (TPM_SIZE);
> > -  }
> > -
> > -  // get the buffer out
> > -  len = BIO_get_mem_data (mem, &buf);
> > -
> > -  // see if we need to allocate a return buffer
> > -  if (*io_buf == NULL) {
> > -    *io_buf = (BYTE*) malloc (PARAMSLEN + len);
> > -    if (*io_buf == NULL)
> > -      ERRORDIE (TPM_SIZE);
> > -  } else {                      // *io_buf is already allocated
> > -    if (outlen < len + PARAMSLEN)
> > -      ERRORDIE (TPM_SIZE); // but not large enough!
> > -  }
> > -
> > -  // copy over the parameters (three UINT32's starting at algorithmID)
> > -  memcpy (*io_buf, &cryptoInfo->algorithmID, PARAMSLEN);
> > -
> > -  // copy over the DER keys
> > -  memcpy (*io_buf + PARAMSLEN, buf, len);
> > -
> > -  *io_buflen = len + PARAMSLEN;
> > -
> > -  goto egress;
> > -
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  BIO_free (mem);
> > -
> > -  return status;
> > -}
> > -
> > -
> > -
> > -// sets up ci, and returns the number of bytes read in o_lenread
> > -TPM_RESULT Crypto_RSAUnpackCryptoInfo (CRYPTO_INFO * ci,
> > -                                        BYTE * in, UINT32 len,
> > -                                        UINT32 * o_lenread) {
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  long l;
> > -  BIO *mem;
> > -  RSA *rsa;
> > -
> > -  // first load up the params
> > -  l = 3 * sizeof(UINT32);
> > -  memcpy (&ci->algorithmID, in, l);
> > -  len -= l;
> > -  in += l;
> > -
> > -  // and now the openssl keys, private first
> > -  mem = BIO_new_mem_buf (in, len);
> > -
> > -  if ( (rsa = d2i_RSAPrivateKey_bio (mem, NULL)) == NULL ) {
> > -    ERR_print_errors_fp (stderr);
> > -    ERRORDIE (TPM_BAD_PARAMETER);
> > -  }
> > -  // now use the same RSA object and fill in the private key
> > -  if ( d2i_RSAPublicKey_bio (mem, &rsa) == NULL ) {
> > -    ERR_print_errors_fp (stderr);
> > -    ERRORDIE (TPM_BAD_PARAMETER);
> > -  }
> > -
> > -  ci->keyInfo = rsa;          // needs to be freed somehow later
> > -
> > -  // FIXME: havent figured out yet how to tell how many bytes were read in the
> > -  // above oprations! so o_lenread is not set
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  BIO_free (mem);
> > -
> > -  return status;
> > -}
> > diff --git a/tools/vtpm_manager/crypto/sym_crypto.c b/tools/vtpm_manager/crypto/sym_crypto.c
> > deleted file mode 100644
> > index 3d86e19..0000000
> > --- a/tools/vtpm_manager/crypto/sym_crypto.c
> > +++ /dev/null
> > @@ -1,237 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// sym_crypto.c
> > -//
> > -//     Symmetric crypto portion of crypto
> > -//
> > -// ==================================================================
> > -
> > -#include <openssl/evp.h>
> > -#include <openssl/rand.h>
> > -
> > -#include "tcg.h"
> > -#include "sym_crypto.h"
> > -
> > -typedef enum crypt_op_type_t {
> > -  CRYPT_ENCRYPT,
> > -  CRYPT_DECRYPT
> > -} crypt_op_type_t;
> > -
> > -TPM_RESULT ossl_symcrypto_op (symkey_t* key,
> > -                              const buffer_t* in,
> > -                              const buffer_t* iv,
> > -                              buffer_t * out,
> > -                              crypt_op_type_t optype);
> > -
> > -
> > -// this is initialized in Crypto_Init()
> > -const EVP_CIPHER * SYM_CIPHER = NULL;
> > -
> > -const BYTE ZERO_IV[EVP_MAX_IV_LENGTH] = {0};
> > -
> > -
> > -TPM_RESULT Crypto_symcrypto_initkey (symkey_t * key, const buffer_t* keybits) {
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  EVP_CIPHER_CTX_init (&key->context);
> > -
> > -  key->cipher = SYM_CIPHER;
> > -
> > -  TPMTRYRETURN( buffer_init_copy (&key->key, keybits));
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -  EVP_CIPHER_CTX_cleanup (&key->context);
> > -
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -
> > -
> > -TPM_RESULT Crypto_symcrypto_genkey (symkey_t * key) {
> > -  int res;
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  // hmm, EVP_CIPHER_CTX_init does not return a value
> > -  EVP_CIPHER_CTX_init (&key->context);
> > -
> > -  key->cipher = SYM_CIPHER;
> > -
> > -  TPMTRYRETURN( buffer_init (&key->key, EVP_CIPHER_key_length(key->cipher), NULL)) ;
> > -
> > -  // and generate the key material
> > -  res = RAND_pseudo_bytes (key->key.bytes, key->key.size);
> > -  if (res < 0)
> > -    ERRORDIE (TPM_SHORTRANDOM);
> > -
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -  EVP_CIPHER_CTX_cleanup (&key->context);
> > -  buffer_free (&key->key);
> > -
> > - egress:
> > -  return status;
> > -}
> > -
> > -
> > -TPM_RESULT Crypto_symcrypto_encrypt (symkey_t* key,
> > -                              const buffer_t* clear,
> > -                              buffer_t* o_cipher) {
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  buffer_t iv, cipher_alias;
> > -
> > -  buffer_init_const (&iv, EVP_MAX_IV_LENGTH, ZERO_IV);
> > -
> > -  buffer_init (o_cipher,
> > -              clear->size +
> > -              EVP_CIPHER_iv_length(key->cipher) +
> > -              EVP_CIPHER_block_size (key->cipher),
> > -                                0);
> > -
> > -  // copy the IV into the front
> > -  buffer_copy (o_cipher, &iv);
> > -
> > -  // make an alias into which we'll put the ciphertext
> > -  buffer_init_alias (&cipher_alias, o_cipher, EVP_CIPHER_iv_length(key->cipher), 0);
> > -
> > -  TPMTRYRETURN( ossl_symcrypto_op (key, clear, &iv, &cipher_alias, CRYPT_ENCRYPT) );
> > -
> > -  // set the output size correctly
> > -  o_cipher->size += cipher_alias.size;
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  return status;
> > -
> > -}
> > -
> > -
> > -
> > -TPM_RESULT Crypto_symcrypto_decrypt (symkey_t* key,
> > -                              const buffer_t* cipher,
> > -                              buffer_t* o_clear) {
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  buffer_t iv, cipher_alias;
> > -
> > -  // alias for the IV
> > -  buffer_init_alias (&iv, cipher, 0, EVP_CIPHER_iv_length(key->cipher));
> > -
> > -  // make an alias to where the ciphertext is, after the IV
> > -  buffer_init_alias (&cipher_alias, cipher, EVP_CIPHER_iv_length(key->cipher), 0);
> > -
> > -  // prepare the output buffer
> > -  TPMTRYRETURN( buffer_init (o_clear,
> > -                       cipher->size
> > -                       - EVP_CIPHER_iv_length(key->cipher)
> > -                       + EVP_CIPHER_block_size(key->cipher),
> > -                       0) );
> > -
> > -  // and decrypt
> > -  TPMTRYRETURN ( ossl_symcrypto_op (key, &cipher_alias, &iv, o_clear, CRYPT_DECRYPT) );
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -  buffer_free (o_clear);
> > -
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -
> > -
> > -TPM_RESULT Crypto_symcrypto_freekey (symkey_t * key) {
> > -  buffer_memset (&key->key, 0);
> > -  buffer_free (&key->key);
> > -
> > -  EVP_CIPHER_CTX_cleanup (&key->context);
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -
> > -TPM_RESULT ossl_symcrypto_op (symkey_t* key,
> > -                              const buffer_t* in,
> > -                              const buffer_t* iv,
> > -                              buffer_t * out,
> > -                              crypt_op_type_t optype) {
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  int inlen, outlen;
> > -  tpm_size_t running;
> > -
> > -  if ( ! EVP_CipherInit_ex (&key->context,
> > -                           key->cipher, NULL, key->key.bytes, iv->bytes,
> > -                           optype == CRYPT_ENCRYPT ? 1 : 0) )
> > -    ERRORDIE (TPM_FAIL);
> > -
> > -
> > -
> > -  inlen = in->size;
> > -
> > -  outlen  = 0;
> > -  running = 0;
> > -
> > -
> > -  if ( ! EVP_CipherUpdate (&key->context, out->bytes, &outlen, in->bytes, inlen) )
> > -    ERRORDIE (TPM_FAIL);
> > -
> > -  running += outlen;
> > -
> > -  if ( ! EVP_CipherFinal_ex (&key->context, out->bytes + running, &outlen) )
> > -    ERRORDIE (TPM_FAIL);
> > -
> > -  running += outlen;
> > -
> > -  out->size = running;
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  return status;
> > -}
> > diff --git a/tools/vtpm_manager/crypto/sym_crypto.h b/tools/vtpm_manager/crypto/sym_crypto.h
> > deleted file mode 100644
> > index 7fb59a8..0000000
> > --- a/tools/vtpm_manager/crypto/sym_crypto.h
> > +++ /dev/null
> > @@ -1,72 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// sym_crypto.h
> > -//
> > -//     Symmetric Crypto
> > -//
> > -// ==================================================================
> > -
> > -#ifndef _SYM_CRYPTO_H
> > -#define _SYM_CRYPTO_H
> > -
> > -#include <openssl/evp.h>
> > -#include "buffer.h"
> > -
> > -typedef struct symkey_t {
> > -  buffer_t key;
> > -
> > -  EVP_CIPHER_CTX context;
> > -  const EVP_CIPHER * cipher;
> > -} symkey_t;
> > -
> > -extern const EVP_CIPHER * SYM_CIPHER;
> > -
> > -TPM_RESULT Crypto_symcrypto_genkey (symkey_t * key);
> > -
> > -TPM_RESULT Crypto_symcrypto_initkey (symkey_t * key, const buffer_t* keybits);
> > -
> > -
> > -// these functions will allocate their output buffers
> > -TPM_RESULT Crypto_symcrypto_encrypt (symkey_t* key,
> > -                              const buffer_t* clear,
> > -                              buffer_t* o_cipher);
> > -
> > -TPM_RESULT Crypto_symcrypto_decrypt (symkey_t* key,
> > -                              const buffer_t* cipher,
> > -                              buffer_t* o_clear);
> > -
> > -// only free the internal parts, not the 'key' ptr
> > -TPM_RESULT Crypto_symcrypto_freekey (symkey_t * key);
> > -
> > -#endif /* _SYM_CRYPTO_H */
> > diff --git a/tools/vtpm_manager/manager/Makefile b/tools/vtpm_manager/manager/Makefile
> > deleted file mode 100644
> > index a33c18a..0000000
> > --- a/tools/vtpm_manager/manager/Makefile
> > +++ /dev/null
> > @@ -1,38 +0,0 @@
> > -XEN_ROOT = $(CURDIR)/../../..
> > -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> > -
> > -BIN            = vtpm_managerd
> > -
> > -.PHONY: all
> > -all: build
> > -
> > -.PHONY: build
> > -build: $(BIN)
> > -
> > -.PHONY: install
> > -install: build
> > -       if [ ! -d "$(DESTDIR)/var/vtpm/fifos" ]; \
> > -               then mkdir -p $(DESTDIR)/var/vtpm/fifos; \
> > -       fi
> > -       if [ ! -d "$(DESTDIR)/var/vtpm/socks" ]; \
> > -               then mkdir -p $(DESTDIR)/var/vtpm/socks; \
> > -       fi
> > -       $(INSTALL_PROG) $(BIN) $(DESTDIR)$(BINDIR)
> > -
> > -.PHONY: clean
> > -clean:
> > -       rm -f $(BIN)
> > -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> > -
> > -.PHONY: mrproper
> > -mrproper: clean
> > -       rm -f *~
> > -
> > -$(BIN): $(OBJS)
> > -       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
> > -
> > -# libraries
> > -LIBS += ../tcs/libTCS.a ../util/libTCGUtils.a ../crypto/libtcpaCrypto.a
> > -LIBS += -lcrypto $(PTHREAD_LIBS) -lm
> > -CFLAGS += $(PTHREAD_CFLAGS)
> > -LDFLAGS += $(PTHREAD_LDFLAGS)
> > diff --git a/tools/vtpm_manager/manager/dmictl.c b/tools/vtpm_manager/manager/dmictl.c
> > deleted file mode 100644
> > index 5c3cf7e..0000000
> > --- a/tools/vtpm_manager/manager/dmictl.c
> > +++ /dev/null
> > @@ -1,266 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -//   dmictl.c
> > -//
> > -//     Functions for creating and destroying DMIs
> > -//
> > -// ==================================================================
> > -
> > -#include <stdio.h>
> > -#include <unistd.h>
> > -#include <string.h>
> > -
> > -#include "vtpmpriv.h"
> > -#include "bsg.h"
> > -#include "buffer.h"
> > -#include "log.h"
> > -#include "hashtable.h"
> > -#include "hashtable_itr.h"
> > -#include "vtpm_ipc.h"
> > -
> > -#define TPM_EMULATOR_PATH "/usr/bin/vtpmd"
> > -
> > -// if dmi_res is non-null, then return a pointer to new object.
> > -// Also, this does not fill in the measurements. They should be filled by
> > -// design dependent code or saveNVM
> > -TPM_RESULT init_dmi(UINT32 dmi_id, BYTE dmi_type, VTPM_DMI_RESOURCE **dmi_res) {
> > -
> > -  TPM_RESULT status=TPM_SUCCESS;
> > -  VTPM_DMI_RESOURCE *new_dmi=NULL;
> > -  UINT32 *dmi_id_key=NULL;
> > -
> > -  if ((new_dmi = (VTPM_DMI_RESOURCE *) malloc (sizeof(VTPM_DMI_RESOURCE))) == NULL) {
> > -      status = TPM_RESOURCES;
> > -      goto abort_egress;
> > -  }
> > -  memset(new_dmi, 0, sizeof(VTPM_DMI_RESOURCE));
> > -  new_dmi->dmi_id = dmi_id;
> > -  new_dmi->dmi_type = dmi_type;
> > -  new_dmi->connected = FALSE;
> > -  new_dmi->TCSContext = 0;
> > -
> > -  new_dmi->NVMLocation = (char *) malloc(11 + strlen(DMI_NVM_FILE));
> > -  sprintf(new_dmi->NVMLocation, DMI_NVM_FILE, (uint32_t) new_dmi->dmi_id);
> > -
> > -  if ((dmi_id_key = (UINT32 *) malloc (sizeof(UINT32))) == NULL) {
> > -    status = TPM_RESOURCES;
> > -    goto abort_egress;
> > -  }
> > -  *dmi_id_key = new_dmi->dmi_id;
> > -
> > -  // install into map
> > -  if (!hashtable_insert(vtpm_globals->dmi_map, dmi_id_key, new_dmi)){
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to insert instance into table. Aborting.\n", dmi_id);
> > -    status = TPM_FAIL;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if (dmi_res)
> > -    *dmi_res = new_dmi;
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -  if (new_dmi) {
> > -    free(new_dmi->NVMLocation);
> > -    free(new_dmi);
> > -  }
> > -  free(dmi_id_key);
> > -
> > - egress:
> > -  return status;
> > -}
> > -
> > -TPM_RESULT close_dmi(VTPM_DMI_RESOURCE *dmi_res) {
> > -  if (dmi_res == NULL)
> > -    return TPM_SUCCESS;
> > -
> > -  if (dmi_res->dmi_id == VTPM_CTL_DM)
> > -    return(TPM_BAD_PARAMETER);
> > -
> > -  TCS_CloseContext(dmi_res->TCSContext);
> > -  dmi_res->connected = FALSE;
> > -
> > -  vtpm_globals->connected_dmis--;
> > -
> > -  return (VTPM_Close_DMI_Extra(dmi_res) );
> > -}
> > -
> > -TPM_RESULT VTPM_Handle_New_DMI(const buffer_t *param_buf) {
> > -
> > -  VTPM_DMI_RESOURCE *new_dmi=NULL;
> > -  TPM_RESULT status=TPM_FAIL;
> > -  BYTE dmi_type, vm_type, startup_mode;
> > -  UINT32 dmi_id;
> > -
> > -  if (param_buf == NULL) { // Assume creation of Dom 0 control
> > -    dmi_type = VTPM_TYPE_NON_MIGRATABLE;
> > -    dmi_id = VTPM_CTL_DM;
> > -  } else if (buffer_len(param_buf) != sizeof(BYTE) * 3  + sizeof(UINT32)) {
> > -    vtpmloginfo(VTPM_LOG_VTPM, "New DMI command wrong length: %d.\n", buffer_len(param_buf));
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  } else {
> > -    vtpm_globals->connected_dmis++; // Put this here so we don't count Dom0
> > -    BSG_UnpackList( param_buf->bytes, 4,
> > -                   BSG_TYPE_BYTE, &dmi_type,
> > -                   BSG_TYPE_BYTE, &startup_mode,
> > -                   BSG_TYPE_BYTE, &vm_type,
> > -                   BSG_TYPE_UINT32,  &dmi_id);
> > -  }
> > -
> > -  if ((dmi_type != VTPM_TYPE_NON_MIGRATABLE) && (dmi_type != VTPM_TYPE_MIGRATABLE)) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Creation of VTPM with illegal type.\n");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  new_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> > -  if (new_dmi == NULL) {
> > -    vtpmloginfo(VTPM_LOG_VTPM, "Creating new DMI instance %d attached.\n", dmi_id );
> > -    // Brand New DMI. Initialize the persistent pieces
> > -    TPMTRYRETURN(init_dmi(dmi_id, dmi_type, &new_dmi) );
> > -  } else
> > -    vtpmloginfo(VTPM_LOG_VTPM, "Re-attaching DMI instance %d.\n", dmi_id);
> > -
> > -  if (new_dmi->connected) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Attempt to re-attach, currently attached instance %d. Ignoring\n", dmi_id);
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if (new_dmi->dmi_type == VTPM_TYPE_MIGRATED) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Attempt to re-attach previously migrated instance %d without recovering first. Ignoring\n", dmi_id);
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  // Initialize the Non-persistent pieces
> > -  TPMTRYRETURN( TCS_OpenContext(&new_dmi->TCSContext) );
> > -
> > -  new_dmi->connected = TRUE;
> > -
> > -  // Design specific new DMI code.
> > -  // Includes: create IPCs, Measuring DMI, and maybe launching DMI
> > -  TPMTRYRETURN(VTPM_New_DMI_Extra(new_dmi, vm_type, startup_mode) );
> > -  goto egress;
> > -
> > - abort_egress:
> > -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to create DMI id=%d due to status=%s. Cleaning.\n", dmi_id, tpm_get_error_name(status));
> > -  close_dmi(new_dmi );
> > -
> > - egress:
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTPM_Handle_Close_DMI( const buffer_t *param_buf) {
> > -
> > -  TPM_RESULT status=TPM_FAIL;
> > -  VTPM_DMI_RESOURCE *dmi_res=NULL;
> > -  UINT32 dmi_id;
> > -
> > -  if ((param_buf == NULL) || (buffer_len(param_buf) != sizeof(UINT32)) ) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Closing DMI has bad size.");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  BSG_UnpackList( param_buf->bytes, 1,
> > -                 BSG_TYPE_UINT32, &dmi_id);
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Closing DMI %d.\n", dmi_id);
> > -
> > -  dmi_res = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> > -  if (dmi_res == NULL ) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Trying to close nonexistent DMI.\n");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if (!dmi_res->connected) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Closing non-connected DMI.\n");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  // Close Dmi
> > -       TPMTRYRETURN(close_dmi( dmi_res ));
> > -
> > -  status=TPM_SUCCESS;
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTPM_Handle_Delete_DMI( const buffer_t *param_buf) {
> > -
> > -  TPM_RESULT status=TPM_FAIL;
> > -  VTPM_DMI_RESOURCE *dmi_res=NULL;
> > -  UINT32 dmi_id;
> > -
> > -  if ((param_buf == NULL) || (buffer_len(param_buf) != sizeof(UINT32)) ) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Closing DMI has bad size.\n");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  BSG_UnpackList( param_buf->bytes, 1,
> > -                 BSG_TYPE_UINT32, &dmi_id);
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Deleting DMI %d.\n", dmi_id);
> > -
> > -  dmi_res = (VTPM_DMI_RESOURCE *) hashtable_remove(vtpm_globals->dmi_map, &dmi_id);
> > -  if (dmi_res == NULL) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Closing non-existent DMI.\n");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  //vtpm scripts delete file dmi_res->NVMLocation for us
> > -
> > -  // Close DMI first
> > -  TPMTRYRETURN(close_dmi( dmi_res ));
> > -  free ( dmi_res );
> > -
> > -  status=TPM_SUCCESS;
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  return status;
> > -}
> > diff --git a/tools/vtpm_manager/manager/migration.c b/tools/vtpm_manager/manager/migration.c
> > deleted file mode 100644
> > index 54da708..0000000
> > --- a/tools/vtpm_manager/manager/migration.c
> > +++ /dev/null
> > @@ -1,307 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -//   dmictl.c
> > -//
> > -//     Functions for creating and destroying DMIs
> > -//
> > -// ==================================================================
> > -
> > -#include <stdio.h>
> > -#include <unistd.h>
> > -#include <string.h>
> > -
> > -#include "vtpmpriv.h"
> > -#include "bsg.h"
> > -#include "buffer.h"
> > -#include "log.h"
> > -#include "hashtable.h"
> > -
> > -TPM_RESULT VTPM_Handle_Migrate_In( const buffer_t *param_buf,
> > -                                   buffer_t *result_buf) {
> > -
> > -  TPM_RESULT status=TPM_FAIL;
> > -  VTPM_DMI_RESOURCE *mig_dmi=NULL;
> > -  UINT32 dmi_id;
> > -  buffer_t dmi_state_abuf = NULL_BUF, enc_dmi_abuf = NULL_BUF, clear_dmi_blob = NULL_BUF;
> > -
> > -  if (param_buf == NULL) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Migration Out Failed due to bad parameter.\n");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  struct pack_buf_t enc_dmi_state_pack;
> > -
> > -  BSG_UnpackList(param_buf->bytes, 2,
> > -                 BSG_TYPE_UINT32, &dmi_id,
> > -                 BSG_TPM_SIZE32_DATA, &enc_dmi_state_pack) ;
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Migrating VTPM in dmi %d.\n", dmi_id);
> > -
> > -  mig_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> > -  if (mig_dmi) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Incoming VTPM claims unavailable id: %d.\n", dmi_id);
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  /** UnBind Blob **/
> > -  TPMTRYRETURN( buffer_init_alias_convert( &enc_dmi_abuf,
> > -                                           enc_dmi_state_pack.size,
> > -                                           enc_dmi_state_pack.data) );
> > -
> > -  TPMTRYRETURN( envelope_decrypt( &enc_dmi_abuf,
> > -                                   vtpm_globals->manager_tcs_handle,
> > -                                   vtpm_globals->storageKeyHandle,
> > -                                   (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
> > -                                   &clear_dmi_blob) );
> > -
> > -  // Create new dmi
> > -  TPMTRYRETURN( init_dmi(dmi_id, VTPM_TYPE_MIGRATABLE, &mig_dmi ) );
> > -
> > -  /** Open Blob **/
> > -  struct pack_buf_t dmi_state_pack;
> > -
> > -  BSG_UnpackList(clear_dmi_blob.bytes, 2,
> > -                 BSG_TPM_DIGEST, &mig_dmi->DMI_measurement,
> > -                 BSG_TPM_SIZE32_DATA, &dmi_state_pack);
> > -
> > -  TPMTRYRETURN( buffer_init_alias_convert(&dmi_state_abuf,
> > -                                          dmi_state_pack.size,
> > -                                          dmi_state_pack.data) );
> > -
> > -  TPMTRYRETURN( VTPM_Handle_Save_NVM(mig_dmi, &dmi_state_abuf, NULL ) );
> > -
> > -  status=TPM_SUCCESS;
> > -  goto egress;
> > -
> > - abort_egress:
> > -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Migration IN of instance %d failed because of %s.\n", dmi_id, tpm_get_error_name(status) );
> > -
> > - egress:
> > -  buffer_free(&clear_dmi_blob);
> > -  buffer_free(&dmi_state_abuf);
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTPM_Handle_Migrate_Out( const buffer_t *param_buf,
> > -                                    buffer_t *result_buf) {
> > -
> > -  TPM_RESULT status=TPM_FAIL;
> > -  VTPM_DMI_RESOURCE *mig_dmi;
> > -  UINT32 dmi_id;
> > -  VTPM_MIGKEY_LIST *last_mig, *mig_key;
> > -  buffer_t dmi_state=NULL_BUF, clear_dmi_blob=NULL_BUF;
> > -
> > -  if (param_buf == NULL) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Migration Out Failed due to bad parameter.\n");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  struct pack_buf_t name_pack;
> > -
> > -  BSG_UnpackList( param_buf->bytes, 2,
> > -                  BSG_TYPE_UINT32, &dmi_id,
> > -                  BSG_TPM_SIZE32_DATA, &name_pack);
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Migrating out dmi %d.\n", dmi_id);
> > -
> > -  mig_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> > -  if (mig_dmi == NULL) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Non-existent VTPM instance (%d) in migration.\n", dmi_id );
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if (mig_dmi->dmi_type != VTPM_TYPE_MIGRATABLE) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Bad VTPM type (%d) in migration of instance (%d).\n", mig_dmi->dmi_type, dmi_id );
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  /** Find migration key for dest **/
> > -  last_mig = NULL;
> > -  mig_key = vtpm_globals->mig_keys;
> > -  while (mig_key != NULL) {
> > -    if (mig_key->name_size == name_pack.size)
> > -      if (memcmp(mig_key->name, name_pack.data, name_pack.size) == 0) {
> > -        break;
> > -      }
> > -
> > -    last_mig = mig_key;
> > -    mig_key = mig_key->next;
> > -  }
> > -
> > -  if (!mig_key) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Unknown Migration target host.\n");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  /** Mark vtpm as migrated **/
> > -  mig_dmi->dmi_type = VTPM_TYPE_MIGRATED;
> > -
> > -  /** Build Blob **/
> > -  TPMTRYRETURN( VTPM_Handle_Load_NVM(mig_dmi, NULL, &dmi_state) );
> > -
> > -  TPMTRYRETURN( buffer_init(&clear_dmi_blob, sizeof(TPM_DIGEST) + sizeof(UINT32) + buffer_len(&dmi_state), NULL ) );
> > -
> > -  struct pack_constbuf_t dmi_state_pack;
> > -
> > -  dmi_state_pack.size = buffer_len(&dmi_state);
> > -  dmi_state_pack.data = dmi_state.bytes;
> > -
> > -  BSG_PackList(clear_dmi_blob.bytes, 2,
> > -               BSG_TPM_DIGEST, &mig_dmi->DMI_measurement,
> > -               BSG_TPM_SIZE32_DATA, &dmi_state_pack);
> > -
> > -  /** Bind Blob **/
> > -  TPMTRYRETURN( envelope_encrypt( &clear_dmi_blob,
> > -                                  &mig_key->key,
> > -                                  result_buf) );
> > -
> > -  if (last_mig)
> > -    last_mig->next = mig_key->next;
> > -  else
> > -    vtpm_globals->mig_keys = mig_key->next;
> > -
> > -  free(mig_key->name);
> > -  free(mig_key);
> > -
> > -  status=TPM_SUCCESS;
> > -  goto egress;
> > -
> > - abort_egress:
> > -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Migration OUT of instance %d failed because of %s. Migratoin recovery may be needed.\n", dmi_id, tpm_get_error_name(status) );
> > -
> > -    //TODO: Create and implement a policy for what happens to mig_key on failed migrations.
> > -
> > - egress:
> > -
> > -  buffer_free(&clear_dmi_blob);
> > -  buffer_free(&dmi_state);
> > -
> > -  return status;
> > -}
> > -
> > -
> > -TPM_RESULT VTPM_Handle_Get_Migration_key( const buffer_t *param_buf,
> > -                                          buffer_t *result_buf) {
> > -
> > -  TPM_RESULT status=TPM_FAIL;
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Getting Migration Public Key.\n");
> > -
> > -  struct pack_buf_t pubkey_exp_pack, pubkey_mod_pack;
> > -  TPM_KEY mig_key;
> > -
> > -  // Unpack/return key structure
> > -  BSG_Unpack(BSG_TPM_KEY, vtpm_globals->storageKeyWrap.bytes , &mig_key);
> > -  TPM_RSA_KEY_PARMS rsaKeyParms;
> > -
> > -  BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
> > -               mig_key.algorithmParms.parms,
> > -               &rsaKeyParms);
> > -
> > -  pubkey_exp_pack.size = rsaKeyParms.exponentSize;
> > -  pubkey_exp_pack.data = rsaKeyParms.exponent;
> > -  pubkey_mod_pack.size = mig_key.pubKey.keyLength;
> > -  pubkey_mod_pack.data = mig_key.pubKey.key;
> > -
> > -  TPMTRYRETURN( buffer_init( result_buf, 2*sizeof(UINT32) +
> > -                                         pubkey_exp_pack.size +
> > -                                         pubkey_mod_pack.size, NULL ) );
> > -
> > -  BSG_PackList( result_buf->bytes, 2,
> > -                  BSG_TPM_SIZE32_DATA, &pubkey_exp_pack,
> > -                  BSG_TPM_SIZE32_DATA, &pubkey_mod_pack);
> > -
> > -
> > -  status=TPM_SUCCESS;
> > -  goto egress;
> > -
> > - abort_egress:
> > -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Get Migration Key failed because of %s.\n", tpm_get_error_name(status) );
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTPM_Handle_Load_Migration_key( const buffer_t *param_buf,
> > -                                           buffer_t *result_buf) {
> > -
> > -  TPM_RESULT status=TPM_FAIL;
> > -  VTPM_MIGKEY_LIST *mig_key;
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Loading Migration Public Key.\n");
> > -
> > -  //FIXME: Review all uses of unpacking pack_buf_t and ensure free.
> > -  //FIXME: Review all declarations/initializations of buffer_t that could have a goto that skips them and then tries to free them
> > -
> > -  struct pack_buf_t name_pack, pubkey_exp_pack, pubkey_mod_pack;
> > -
> > -  //FIXME: scan list and verify name is not already in the list
> > -
> > -  BSG_UnpackList( param_buf->bytes, 3,
> > -                  BSG_TPM_SIZE32_DATA, &name_pack,
> > -                  BSG_TPM_SIZE32_DATA, &pubkey_exp_pack,
> > -                  BSG_TPM_SIZE32_DATA, &pubkey_mod_pack);
> > -
> > -  //TODO: Maintain a persistent list for pub_keys.
> > -  //TODO: Verify pub_key is trusted
> > -
> > -  mig_key = (VTPM_MIGKEY_LIST *) malloc(sizeof(VTPM_MIGKEY_LIST));
> > -  memset(mig_key, 0, sizeof(VTPM_MIGKEY_LIST) );
> > -  mig_key->name_size = name_pack.size;
> > -  mig_key->name = name_pack.data;
> > -
> > -  mig_key->key.encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
> > -  Crypto_RSABuildCryptoInfoPublic( pubkey_exp_pack.size,
> > -                                   pubkey_exp_pack.data,
> > -                                   pubkey_mod_pack.size,
> > -                                   pubkey_mod_pack.data,
> > -                                   &mig_key->key);
> > -
> > -
> > -  mig_key->next = vtpm_globals->mig_keys;
> > -  vtpm_globals->mig_keys = mig_key;
> > -
> > -  // free(name_pack.data); Do not free. data is now part of mig_key.
> > -  free(pubkey_exp_pack.data);
> > -  free(pubkey_mod_pack.data);
> > -
> > -  return TPM_SUCCESS;
> > -}
> > diff --git a/tools/vtpm_manager/manager/securestorage.c b/tools/vtpm_manager/manager/securestorage.c
> > deleted file mode 100644
> > index d5e6ffd..0000000
> > --- a/tools/vtpm_manager/manager/securestorage.c
> > +++ /dev/null
> > @@ -1,512 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// securestorage.c
> > -//
> > -//  Functions regarding securely storing DMI secrets.
> > -//
> > -// ==================================================================
> > -
> > -#include <sys/types.h>
> > -#include <sys/stat.h>
> > -#include <fcntl.h>
> > -#include <unistd.h>
> > -#include <string.h>
> > -
> > -#include "tcg.h"
> > -#include "vtpm_manager.h"
> > -#include "vtpmpriv.h"
> > -#include "vtsp.h"
> > -#include "bsg.h"
> > -#include "crypto.h"
> > -#include "hashtable.h"
> > -#include "hashtable_itr.h"
> > -#include "buffer.h"
> > -#include "log.h"
> > -
> > -TPM_RESULT envelope_encrypt(const buffer_t     *inbuf,
> > -                            CRYPTO_INFO        *asymkey,
> > -                            buffer_t           *sealed_data) {
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  symkey_t    symkey;
> > -  buffer_t    data_cipher = NULL_BUF,
> > -              symkey_cipher = NULL_BUF;
> > -
> > -  UINT32 i;
> > -  struct pack_constbuf_t symkey_cipher32, data_cipher32;
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Enveloping Input[%d]: 0x", buffer_len(inbuf));
> > -  for (i=0; i< buffer_len(inbuf); i++)
> > -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", inbuf->bytes[i]);
> > -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -
> > -  // Generate a sym key and encrypt state with it
> > -  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_symcrypto_genkey (&symkey) );
> > -  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_symcrypto_encrypt (&symkey, inbuf, &data_cipher) );
> > -
> > -  // Encrypt symmetric key
> > -  TPMTRYRETURN( VTSP_Bind(    asymkey,
> > -                             &symkey.key,
> > -                             &symkey_cipher) );
> > -
> > -  // Create output blob: symkey_size + symkey_cipher + state_cipher_size + state_cipher
> > -
> > -  symkey_cipher32.size = buffer_len(&symkey_cipher);
> > -  symkey_cipher32.data = symkey_cipher.bytes;
> > -
> > -  data_cipher32.size = buffer_len(&data_cipher);
> > -  data_cipher32.data = data_cipher.bytes;
> > -
> > -  TPMTRYRETURN( buffer_init(sealed_data, 2 * sizeof(UINT32) + symkey_cipher32.size + data_cipher32.size, NULL));
> > -
> > -  BSG_PackList(sealed_data->bytes, 2,
> > -              BSG_TPM_SIZE32_DATA, &symkey_cipher32,
> > -              BSG_TPM_SIZE32_DATA, &data_cipher32);
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Saved %d bytes of E(symkey) + %d bytes of E(data)\n", buffer_len(&symkey_cipher), buffer_len(&data_cipher));
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Enveloping Output[%d]: 0x", buffer_len(sealed_data));
> > -  for (i=0; i< buffer_len(sealed_data); i++)
> > -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", sealed_data->bytes[i]);
> > -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to envelope encrypt\n.");
> > -
> > - egress:
> > -
> > -  buffer_free ( &data_cipher);
> > -  buffer_free ( &symkey_cipher);
> > -  Crypto_symcrypto_freekey (&symkey);
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT envelope_decrypt(const buffer_t     *cipher,
> > -                            TCS_CONTEXT_HANDLE TCSContext,
> > -                           TPM_HANDLE         keyHandle,
> > -                           const TPM_AUTHDATA *key_usage_auth,
> > -                            buffer_t           *unsealed_data) {
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  symkey_t    symkey;
> > -  buffer_t    data_cipher = NULL_BUF,
> > -              symkey_clear = NULL_BUF,
> > -              symkey_cipher = NULL_BUF;
> > -  struct pack_buf_t symkey_cipher32, data_cipher32;
> > -  int i;
> > -
> > -  memset(&symkey, 0, sizeof(symkey_t));
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Envelope Decrypt Input[%d]: 0x", buffer_len(cipher) );
> > -  for (i=0; i< buffer_len(cipher); i++)
> > -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cipher->bytes[i]);
> > -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -
> > -  BSG_UnpackList(cipher->bytes, 2,
> > -                BSG_TPM_SIZE32_DATA, &symkey_cipher32,
> > -                BSG_TPM_SIZE32_DATA, &data_cipher32);
> > -
> > -  TPMTRYRETURN( buffer_init_alias_convert (&symkey_cipher,
> > -                                          symkey_cipher32.size,
> > -                                          symkey_cipher32.data) );
> > -
> > -  TPMTRYRETURN( buffer_init_alias_convert (&data_cipher,
> > -                                          data_cipher32.size,
> > -                                          data_cipher32.data) );
> > -
> > -  // Decrypt Symmetric Key
> > -  TPMTRYRETURN( VTSP_Unbind(  TCSContext,
> > -                             keyHandle,
> > -                             &symkey_cipher,
> > -                             key_usage_auth,
> > -                             &symkey_clear,
> > -                             &(vtpm_globals->keyAuth) ) );
> > -
> > -  // create symmetric key using saved bits
> > -  Crypto_symcrypto_initkey (&symkey, &symkey_clear);
> > -
> > -  // Decrypt State
> > -  TPMTRY(TPM_DECRYPT_ERROR, Crypto_symcrypto_decrypt (&symkey, &data_cipher, unsealed_data) );
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Envelope Decrypte Output[%d]: 0x", buffer_len(unsealed_data));
> > -  for (i=0; i< buffer_len(unsealed_data); i++)
> > -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", unsealed_data->bytes[i]);
> > -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to envelope decrypt data\n.");
> > -
> > - egress:
> > -  buffer_free ( &data_cipher);
> > -  buffer_free ( &symkey_clear);
> > -  buffer_free ( &symkey_cipher);
> > -  Crypto_symcrypto_freekey (&symkey);
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTPM_Handle_Save_NVM(VTPM_DMI_RESOURCE *myDMI,
> > -                               const buffer_t *inbuf,
> > -                               buffer_t *outbuf) {
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  int fh;
> > -  long bytes_written;
> > -  buffer_t sealed_NVM = NULL_BUF;
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Saving %d bytes of NVM.\n", buffer_len(inbuf));
> > -
> > -  TPMTRYRETURN( envelope_encrypt(inbuf,
> > -                                 &vtpm_globals->storageKey,
> > -                                 &sealed_NVM) );
> > -
> > -  // Write sealed blob off disk from NVMLocation
> > -  // TODO: How to properly return from these. Do we care if we return failure
> > -  //       after writing the file? We can't get the old one back.
> > -  // TODO: Backup old file and try and recover that way.
> > -  fh = open(myDMI->NVMLocation, O_WRONLY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
> > -  if ( (bytes_written = write(fh, sealed_NVM.bytes, buffer_len(&sealed_NVM) ) != (long) buffer_len(&sealed_NVM))) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "We just overwrote a DMI_NVM and failed to finish. %ld/%ld bytes.\n", bytes_written, (long)buffer_len(&sealed_NVM));
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -  close(fh);
> > -
> > -  Crypto_SHA1Full (sealed_NVM.bytes, buffer_len(&sealed_NVM), (BYTE *) &myDMI->NVM_measurement);
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to save NVM\n.");
> > -
> > - egress:
> > -  buffer_free(&sealed_NVM);
> > -  return status;
> > -}
> > -
> > -
> > -/* Expected Params: inbuf = null, outbuf = sealed blob size, sealed blob.*/
> > -TPM_RESULT VTPM_Handle_Load_NVM(VTPM_DMI_RESOURCE *myDMI,
> > -                               const buffer_t    *inbuf,
> > -                               buffer_t          *outbuf) {
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  buffer_t sealed_NVM = NULL_BUF;
> > -  long fh_size;
> > -  int fh, stat_ret, i;
> > -  struct stat file_stat;
> > -  TPM_DIGEST sealedNVMHash;
> > -
> > -  if (myDMI->NVMLocation == NULL) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to load NVM because the file name NULL.\n");
> > -    status = TPM_AUTHFAIL;
> > -    goto abort_egress;
> > -  }
> > -
> > -  //Read sealed blob off disk from NVMLocation
> > -  fh = open(myDMI->NVMLocation, O_RDONLY);
> > -  stat_ret = fstat(fh, &file_stat);
> > -  if (stat_ret == 0)
> > -    fh_size = file_stat.st_size;
> > -  else {
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  TPMTRYRETURN( buffer_init( &sealed_NVM, fh_size, NULL) );
> > -  if (read(fh, sealed_NVM.bytes, buffer_len(&sealed_NVM)) != fh_size) {
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -  close(fh);
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Load_NVMing[%d],\n", buffer_len(&sealed_NVM));
> > -
> > -  Crypto_SHA1Full(sealed_NVM.bytes, buffer_len(&sealed_NVM), (BYTE *) &sealedNVMHash);
> > -
> > -  // Verify measurement of sealed blob.
> > -  if (memcmp(&sealedNVMHash, &myDMI->NVM_measurement, sizeof(TPM_DIGEST)) ) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM LoadNVM NVM measurement check failed.\n");
> > -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Correct hash: ");
> > -    for (i=0; i< sizeof(TPM_DIGEST); i++)
> > -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", ((BYTE*)&myDMI->NVM_measurement)[i]);
> > -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -
> > -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Measured hash: ");
> > -    for (i=0; i< sizeof(TPM_DIGEST); i++)
> > -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", ((BYTE*)&sealedNVMHash)[i]);
> > -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -
> > -    status = TPM_AUTHFAIL;
> > -    goto abort_egress;
> > -  }
> > -
> > -  TPMTRYRETURN( envelope_decrypt(&sealed_NVM,
> > -                                 myDMI->TCSContext,
> > -                                vtpm_globals->storageKeyHandle,
> > -                                (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
> > -                                 outbuf) );
> > -  goto egress;
> > -
> > - abort_egress:
> > -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to load NVM\n.");
> > -
> > - egress:
> > -  buffer_free( &sealed_NVM );
> > -
> > -  return status;
> > -}
> > -
> > -
> > -TPM_RESULT VTPM_SaveManagerData(void) {
> > -  TPM_RESULT status=TPM_SUCCESS;
> > -  int fh, dmis=-1;
> > -
> > -  BYTE *flat_boot_key=NULL, *flat_dmis=NULL, *flat_enc=NULL;
> > -  buffer_t clear_flat_global=NULL_BUF, enc_flat_global=NULL_BUF;
> > -  UINT32 storageKeySize = buffer_len(&vtpm_globals->storageKeyWrap);
> > -  UINT32 bootKeySize = buffer_len(&vtpm_globals->bootKeyWrap);
> > -  struct pack_buf_t storage_key_pack = {storageKeySize, vtpm_globals->storageKeyWrap.bytes};
> > -  struct pack_buf_t boot_key_pack = {bootKeySize, vtpm_globals->bootKeyWrap.bytes};
> > -  BYTE vtpm_manager_gen = VTPM_MANAGER_GEN;
> > -
> > -  struct hashtable_itr *dmi_itr;
> > -  VTPM_DMI_RESOURCE *dmi_res;
> > -
> > -  UINT32 boot_key_size = 0, flat_dmis_size = 0;
> > -
> > -  // Initially fill these with buffer sizes for each data type. Later fill
> > -  // in actual size, once flattened.
> > -  boot_key_size =  sizeof(UINT32) +       // bootkeysize
> > -                   bootKeySize;           // boot key
> > -
> > -  TPMTRYRETURN(buffer_init(&clear_flat_global,sizeof(BYTE) + // manager version
> > -                                              3*sizeof(TPM_DIGEST) + // Auths
> > -                                              sizeof(UINT32) +// storagekeysize
> > -                                              storageKeySize, NULL) ); // storage key
> > -
> > -
> > -  flat_boot_key = (BYTE *) malloc( boot_key_size );
> > -  flat_enc = (BYTE *) malloc( sizeof(UINT32) );
> > -
> > -  boot_key_size = BSG_PackList(flat_boot_key, 1,
> > -                               BSG_TPM_SIZE32_DATA, &boot_key_pack);
> > -
> > -  BSG_PackList(clear_flat_global.bytes, 4,
> > -                BSG_TYPE_BYTE,    &vtpm_manager_gen,
> > -                BSG_TPM_AUTHDATA, &vtpm_globals->owner_usage_auth,
> > -                BSG_TPM_SECRET,   &vtpm_globals->storage_key_usage_auth,
> > -                BSG_TPM_SIZE32_DATA, &storage_key_pack);
> > -
> > -  TPMTRYRETURN(envelope_encrypt(&clear_flat_global,
> > -                                &vtpm_globals->bootKey,
> > -                                &enc_flat_global) );
> > -
> > -  BSG_PackConst(buffer_len(&enc_flat_global), 4, flat_enc);
> > -
> > -  // Per DMI values to be saved (if any exit)
> > -  if (hashtable_count(vtpm_globals->dmi_map) > 1) {
> > -
> > -    flat_dmis = (BYTE *) malloc(
> > -                     (hashtable_count(vtpm_globals->dmi_map) - 1) * // num DMIS (-1 for Dom0)
> > -                     (sizeof(UINT32) +sizeof(BYTE) + 2*sizeof(TPM_DIGEST)) ); // Per DMI info
> > -
> > -    dmi_itr = hashtable_iterator(vtpm_globals->dmi_map);
> > -    do {
> > -      dmi_res = (VTPM_DMI_RESOURCE *) hashtable_iterator_value(dmi_itr);
> > -      dmis++;
> > -
> > -      // No need to save dmi0.
> > -      if (dmi_res->dmi_id == 0)
> > -        continue;
> > -
> > -
> > -      flat_dmis_size += BSG_PackList( flat_dmis + flat_dmis_size, 4,
> > -                                        BSG_TYPE_UINT32, &dmi_res->dmi_id,
> > -                                        BSG_TYPE_BYTE, &dmi_res->dmi_type,
> > -                                        BSG_TPM_DIGEST, &dmi_res->NVM_measurement,
> > -                                        BSG_TPM_DIGEST, &dmi_res->DMI_measurement);
> > -
> > -    } while (hashtable_iterator_advance(dmi_itr));
> > -  }
> > -
> > -  fh = open(STATE_FILE, O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
> > -  if (fh == -1) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to open %s file for write.\n", STATE_FILE);
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if ( ( write(fh, flat_boot_key, boot_key_size) != boot_key_size ) ||
> > -       ( write(fh, flat_enc, sizeof(UINT32)) != sizeof(UINT32) ) ||
> > -       ( write(fh, enc_flat_global.bytes, buffer_len(&enc_flat_global)) != buffer_len(&enc_flat_global) ) ||
> > -       ( write(fh, flat_dmis, flat_dmis_size) != flat_dmis_size ) ) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to completely write service data.\n");
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > - }
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  free(flat_boot_key);
> > -  free(flat_enc);
> > -  buffer_free(&enc_flat_global);
> > -  free(flat_dmis);
> > -  close(fh);
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Saved VTPM Manager state (status = %d, dmis = %d)\n", (int) status, dmis);
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTPM_LoadManagerData(void) {
> > -
> > -  TPM_RESULT status=TPM_SUCCESS;
> > -  int fh, stat_ret, dmis=0;
> > -  long fh_size = 0, step_size;
> > -  BYTE *flat_table=NULL;
> > -  buffer_t  unsealed_data, enc_table_abuf;
> > -  struct pack_buf_t storage_key_pack, boot_key_pack;
> > -  UINT32 *dmi_id_key, enc_size;
> > -  BYTE vtpm_manager_gen;
> > -
> > -  VTPM_DMI_RESOURCE *dmi_res;
> > -  UINT32 dmi_id;
> > -  BYTE dmi_type;
> > -  struct stat file_stat;
> > -
> > -  TPM_HANDLE boot_key_handle;
> > -  TPM_AUTHDATA boot_usage_auth;
> > -  memset(&boot_usage_auth, 0, sizeof(TPM_AUTHDATA));
> > -
> > -  fh = open(STATE_FILE, O_RDONLY );
> > -  stat_ret = fstat(fh, &file_stat);
> > -  if (stat_ret == 0)
> > -    fh_size = file_stat.st_size;
> > -  else {
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  flat_table = (BYTE *) malloc(fh_size);
> > -
> > -  if ((long) read(fh, flat_table, fh_size) != fh_size ) {
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  // Read Boot Key
> > -  step_size = BSG_UnpackList( flat_table, 2,
> > -                              BSG_TPM_SIZE32_DATA, &boot_key_pack,
> > -                              BSG_TYPE_UINT32, &enc_size);
> > -
> > -  TPMTRYRETURN(buffer_init(&vtpm_globals->bootKeyWrap, 0, 0) );
> > -  TPMTRYRETURN(buffer_init_alias_convert(&enc_table_abuf, enc_size, flat_table + step_size) );
> > -  TPMTRYRETURN(buffer_append_raw(&vtpm_globals->bootKeyWrap, boot_key_pack.size, boot_key_pack.data) );
> > -
> > -  //Load Boot Key
> > -  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
> > -                              TPM_SRK_KEYHANDLE,
> > -                              &vtpm_globals->bootKeyWrap,
> > -                              &SRK_AUTH,
> > -                              &boot_key_handle,
> > -                              &vtpm_globals->keyAuth,
> > -                              &vtpm_globals->bootKey,
> > -                              FALSE) );
> > -
> > -  TPMTRYRETURN( envelope_decrypt(&enc_table_abuf,
> > -                                 vtpm_globals->manager_tcs_handle,
> > -                                 boot_key_handle,
> > -                                 (const TPM_AUTHDATA*) &boot_usage_auth,
> > -                                 &unsealed_data) );
> > -  step_size += enc_size;
> > -
> > -  if (*unsealed_data.bytes != VTPM_MANAGER_GEN) {
> > -      // Once there is more than one gen, this will include some compatability stuff
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Warning: Manager Data file is gen %d, which this manager is gen %d.\n", vtpm_manager_gen, VTPM_MANAGER_GEN);
> > -  }
> > -
> > -  // Global Values needing to be saved
> > -  BSG_UnpackList( unsealed_data.bytes, 4,
> > -                  BSG_TYPE_BYTE,    &vtpm_manager_gen,
> > -                  BSG_TPM_AUTHDATA, &vtpm_globals->owner_usage_auth,
> > -                  BSG_TPM_SECRET,   &vtpm_globals->storage_key_usage_auth,
> > -                  BSG_TPM_SIZE32_DATA, &storage_key_pack);
> > -
> > -  TPMTRYRETURN(buffer_init(&vtpm_globals->storageKeyWrap, 0, 0) );
> > -  TPMTRYRETURN(buffer_append_raw(&vtpm_globals->storageKeyWrap, storage_key_pack.size, storage_key_pack.data) );
> > -
> > -  // Per DMI values to be saved
> > -  while ( step_size < fh_size ){
> > -    if (fh_size - step_size < (long) (sizeof(UINT32) + sizeof(BYTE) + 2*sizeof(TPM_DIGEST))) {
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Encountered %ld extra bytes at end of manager state.\n", fh_size-step_size);
> > -      step_size = fh_size;
> > -    } else {
> > -      step_size += BSG_UnpackList(flat_table + step_size, 2,
> > -                                 BSG_TYPE_UINT32, &dmi_id,
> > -                                 BSG_TYPE_BYTE, &dmi_type);
> > -
> > -      //TODO: Try and gracefully recover from problems.
> > -      TPMTRYRETURN(init_dmi(dmi_id, dmi_type, &dmi_res) );
> > -      dmis++;
> > -
> > -      step_size += BSG_UnpackList(flat_table + step_size, 2,
> > -                                 BSG_TPM_DIGEST, &dmi_res->NVM_measurement,
> > -                                 BSG_TPM_DIGEST, &dmi_res->DMI_measurement);
> > -    }
> > -
> > -  }
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Loaded saved state (dmis = %d).\n", dmis);
> > -  goto egress;
> > -
> > - abort_egress:
> > -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to load service data with error = %s\n", tpm_get_error_name(status));
> > - egress:
> > -
> > -  free(flat_table);
> > -  close(fh);
> > -
> > -  // TODO: Could be nice and evict BootKey. (Need to add EvictKey to VTSP.
> > -
> > -  return status;
> > -}
> > -
> > diff --git a/tools/vtpm_manager/manager/tpmpassthrough.c b/tools/vtpm_manager/manager/tpmpassthrough.c
> > deleted file mode 100644
> > index 9b1e5f8..0000000
> > --- a/tools/vtpm_manager/manager/tpmpassthrough.c
> > +++ /dev/null
> > @@ -1,110 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// tpmpassthrough.c
> > -//
> > -//  Functions regarding passing DMI requests to HWTPM
> > -//
> > -// ==================================================================
> > -
> > -#include "tcg.h"
> > -#include "vtpm_manager.h"
> > -#include "vtpmpriv.h"
> > -#include "vtsp.h"
> > -#include "log.h"
> > -
> > -TPM_RESULT VTPM_Handle_TPM_Command( VTPM_DMI_RESOURCE *dmi,
> > -                                   buffer_t *inbuf,
> > -                                   buffer_t *outbuf) {
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_COMMAND_CODE *ord;
> > -
> > -  ord = (TPM_COMMAND_CODE *) (inbuf->bytes + sizeof(TPM_TAG) + sizeof(UINT32));
> > -
> > -  switch (*ord) {
> > -
> > -    // Forbidden for DMI use
> > -  case TPM_ORD_TakeOwnership:
> > -  case TPM_ORD_ChangeAuthOwner:
> > -  case TPM_ORD_DirWriteAuth:
> > -  case TPM_ORD_DirRead:
> > -  case TPM_ORD_AuthorizeMigrationKey:
> > -  case TPM_ORD_CreateMaintenanceArchive:
> > -  case TPM_ORD_LoadMaintenanceArchive:
> > -  case TPM_ORD_KillMaintenanceFeature:
> > -  case TPM_ORD_LoadManuMaintPub:
> > -  case TPM_ORD_ReadManuMaintPub:
> > -  case TPM_ORD_SelfTestFull:
> > -  case TPM_ORD_SelfTestStartup:
> > -  case TPM_ORD_CertifySelfTest:
> > -  case TPM_ORD_ContinueSelfTest:
> > -  case TPM_ORD_GetTestResult:
> > -  case TPM_ORD_Reset:
> > -  case TPM_ORD_OwnerClear:
> > -  case TPM_ORD_DisableOwnerClear:
> > -  case TPM_ORD_ForceClear:
> > -  case TPM_ORD_DisableForceClear:
> > -  case TPM_ORD_GetCapabilityOwner:
> > -  case TPM_ORD_OwnerSetDisable:
> > -  case TPM_ORD_PhysicalEnable:
> > -  case TPM_ORD_PhysicalDisable:
> > -  case TPM_ORD_SetOwnerInstall:
> > -  case TPM_ORD_PhysicalSetDeactivated:
> > -  case TPM_ORD_SetTempDeactivated:
> > -  case TPM_ORD_CreateEndorsementKeyPair:
> > -  case TPM_ORD_GetAuditEvent:
> > -  case TPM_ORD_GetAuditEventSigned:
> > -  case TPM_ORD_GetOrdinalAuditStatus:
> > -  case TPM_ORD_SetOrdinalAuditStatus:
> > -  case TPM_ORD_SetRedirection:
> > -  case TPM_ORD_FieldUpgrade:
> > -  case TSC_ORD_PhysicalPresence:
> > -    status = TPM_DISABLED_CMD;
> > -    goto abort_egress;
> > -    break;
> > -
> > -  } // End ORD Switch
> > -
> > -  // Call TCS with command
> > -
> > -  TPMTRY(TPM_IOERROR, VTSP_RawTransmit( dmi->TCSContext,inbuf, outbuf) );
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -  vtpmloginfo(VTPM_LOG_VTPM, "TPM Command Failed in tpmpassthrough.\n");
> > - egress:
> > -
> > -  return status;
> > -}
> > diff --git a/tools/vtpm_manager/manager/vtpm_ipc.c b/tools/vtpm_manager/manager/vtpm_ipc.c
> > deleted file mode 100644
> > index 319dc83..0000000
> > --- a/tools/vtpm_manager/manager/vtpm_ipc.c
> > +++ /dev/null
> > @@ -1,141 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_ipc.c Implements ipc routines using file io. This file can
> > -// be replaced with other ipc types.
> > -//
> > -// ===================================================================
> > -
> > -#include <sys/stat.h>
> > -#include "vtpm_ipc.h"
> > -#include "vtpmpriv.h"
> > -#include "log.h"
> > -
> > -int vtpm_ipc_init(vtpm_ipc_handle_t *ipc_h, char* name, int flags, BOOL create) {
> > -  ipc_h->name = name;
> > -  ipc_h->flags = flags;
> > -  ipc_h->fh = VTPM_IPC_CLOSED;
> > -
> > -  if (create)
> > -    return(vtpm_ipc_create(ipc_h));
> > -  else
> > -    return 0;
> > -}
> > -
> > -// Create the file that needs opening. Used only for FIFOs
> > -// FYI: This may cause problems in other file IO schemes. We'll see.
> > -int vtpm_ipc_create(vtpm_ipc_handle_t *ipc_h) {
> > -  int fh;
> > -  struct stat file_info;
> > -
> > -  if ((!ipc_h) || (!ipc_h->name))
> > -    return -1;
> > -
> > -  if ( stat(ipc_h->name, &file_info) == -1) {
> > -    if ( mkfifo(ipc_h->name, S_IWUSR | S_IRUSR ) ) {
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Failed to create fifo %s.\n", ipc_h->name);
> > -      return -1;
> > -    }
> > -  }
> > -
> > -  ipc_h->fh = VTPM_IPC_CLOSED;
> > -
> > -  return 0;
> > -}
> > -
> > -
> > -// Read size bytes. If FH isn't open, open it.
> > -int vtpm_ipc_read(vtpm_ipc_handle_t *ipc_h, vtpm_ipc_handle_t *alt_ipc_h, BYTE *bytes, UINT32 size){
> > -  vtpm_ipc_handle_t *my_ipc_h;
> > -  int result;
> > -
> > -  if (ipc_h) {
> > -    my_ipc_h = ipc_h;
> > -  } else {
> > -    my_ipc_h = alt_ipc_h;
> > -  }
> > -
> > -  if (my_ipc_h->fh == VTPM_IPC_CLOSED) {
> > -    my_ipc_h->fh = open(my_ipc_h->name, my_ipc_h->flags);
> > -  }
> > -
> > -  if ( my_ipc_h->fh == VTPM_IPC_CLOSED ) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM ERROR: Can't open %s for reading.\n", my_ipc_h->name);
> > -    return -1;
> > -  }
> > -
> > -  result = read(my_ipc_h->fh, bytes, size);
> > -  if (result < 0) {
> > -    my_ipc_h->fh = VTPM_IPC_CLOSED;
> > -  }
> > -
> > -  return (result);
> > -}
> > -
> > -// Write size bytes. If FH isn't open, open it.
> > -int vtpm_ipc_write(vtpm_ipc_handle_t *ipc_h, vtpm_ipc_handle_t *alt_ipc_h, BYTE *bytes, UINT32 size) {
> > -  vtpm_ipc_handle_t *my_ipc_h;
> > -  int result;
> > -
> > -  if (ipc_h) {
> > -    my_ipc_h = ipc_h;
> > -  } else {
> > -    my_ipc_h = alt_ipc_h;
> > -  }
> > -
> > -  if (my_ipc_h->fh == VTPM_IPC_CLOSED) {
> > -    my_ipc_h->fh = open(my_ipc_h->name, my_ipc_h->flags);
> > -  }
> > -
> > -  if ( my_ipc_h->fh == VTPM_IPC_CLOSED ) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM ERROR: Can't open %s for writing.\n", my_ipc_h->name);
> > -    return -1;
> > -  }
> > -
> > -  result = write(my_ipc_h->fh, bytes, size);
> > -  if (result < 0) {
> > -    my_ipc_h->fh = VTPM_IPC_CLOSED;
> > -  }
> > -
> > -  return (result);
> > -}
> > -
> > -// Mark file as closed and try and close it. Errors not reported.
> > -void vtpm_ipc_close(vtpm_ipc_handle_t *ipc_h) {
> > -
> > -  if (ipc_h) {
> > -    close(ipc_h->fh);
> > -    ipc_h->fh = VTPM_IPC_CLOSED;
> > -  }
> > -
> > -}
> > diff --git a/tools/vtpm_manager/manager/vtpm_ipc.h b/tools/vtpm_manager/manager/vtpm_ipc.h
> > deleted file mode 100644
> > index 529c4a2..0000000
> > --- a/tools/vtpm_manager/manager/vtpm_ipc.h
> > +++ /dev/null
> > @@ -1,71 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_ipc.h Header for interprocess communication between VTPM manager
> > -// and Guests or VTPMs
> > -//
> > -// ===================================================================
> > -
> > -#ifndef __VTPM_IO_H__
> > -#define __VTPM_IO_H__
> > -
> > -#include "tcg.h"
> > -
> > -#define VTPM_IPC_CLOSED -1
> > -
> > -// Represents an (somewhat) abstracted io handle.
> > -typedef struct vtpm_ipc_handle_t {
> > -  int fh;              // IO handle.
> > -  int flags;           // Flags for opening. This may need to become
> > -                       // a void *, but for now files use an int.
> > -  char *name;          // Names for debugging as well as filenames
> > -                       // for file-based io.
> > -} vtpm_ipc_handle_t;
> > -
> > -
> > -int vtpm_ipc_init(vtpm_ipc_handle_t *ioh, char* name, int flags, BOOL create);
> > -
> > -// Create the file that needs opening. Used only for FIFOs
> > -// FYI: This may cause problems in other file IO schemes. We'll see.
> > -int vtpm_ipc_create(vtpm_ipc_handle_t *ioh);
> > -
> > -// Read size bytes. If FH isn't open, open it.
> > -int vtpm_ipc_read(vtpm_ipc_handle_t *ioh, vtpm_ipc_handle_t *alt_ioh, BYTE *bytes, UINT32 size);
> > -
> > -// Write size bytes. If FH isn't open, open it.
> > -int vtpm_ipc_write(vtpm_ipc_handle_t *ioh, vtpm_ipc_handle_t *alt_ioh, BYTE *bytes, UINT32 size);
> > -
> > -// Mark file as closed and try and close it. Errors not reported.
> > -void vtpm_ipc_close(vtpm_ipc_handle_t *ioh);
> > -
> > -#endif
> > diff --git a/tools/vtpm_manager/manager/vtpm_lock.c b/tools/vtpm_manager/manager/vtpm_lock.c
> > deleted file mode 100644
> > index e737d60..0000000
> > --- a/tools/vtpm_manager/manager/vtpm_lock.c
> > +++ /dev/null
> > @@ -1,63 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_lock.c Provided controlled sync around access to vtpm structures
> > -//
> > -// ===================================================================
> > -
> > -#include <pthread.h>
> > -#include "vtpm_lock.h"
> > -
> > -static pthread_rwlock_t vtpm_lock;
> > -
> > -void vtpm_lock_init() {
> > -
> > -  pthread_rwlock_init( &vtpm_lock, NULL);
> > -}
> > -
> > -void vtpm_lock_destroy(){
> > -  pthread_rwlock_destroy(&vtpm_lock);
> > -}
> > -
> > -void vtpm_lock_rdlock(){
> > -  pthread_rwlock_rdlock(&vtpm_lock);
> > -}
> > -
> > -void vtpm_lock_wrlock(){
> > -  pthread_rwlock_wrlock(&vtpm_lock);
> > -}
> > -
> > -void vtpm_lock_unlock(){
> > -  pthread_rwlock_unlock(&vtpm_lock);
> > -}
> > -
> > diff --git a/tools/vtpm_manager/manager/vtpm_lock.h b/tools/vtpm_manager/manager/vtpm_lock.h
> > deleted file mode 100644
> > index 53a339d..0000000
> > --- a/tools/vtpm_manager/manager/vtpm_lock.h
> > +++ /dev/null
> > @@ -1,48 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_lock.h Provided controlled sync around access to vtpm structures
> > -//
> > -// ===================================================================
> > -
> > -#ifndef __VTPM_LOCK_H__
> > -#define __VTPM_LOCK_H__
> > -
> > -void vtpm_lock_init();
> > -void vtpm_lock_destroy();
> > -
> > -void vtpm_lock_rdlock();
> > -void vtpm_lock_wrlock();
> > -void vtpm_lock_unlock();
> > -
> > -#endif
> > diff --git a/tools/vtpm_manager/manager/vtpm_manager.c b/tools/vtpm_manager/manager/vtpm_manager.c
> > deleted file mode 100644
> > index e089f78..0000000
> > --- a/tools/vtpm_manager/manager/vtpm_manager.c
> > +++ /dev/null
> > @@ -1,285 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_manager.c
> > -//
> > -//  This file will house the main logic of the VTPM Manager
> > -//
> > -// ==================================================================
> > -
> > -#include <stdio.h>
> > -#include <unistd.h>
> > -#include <string.h>
> > -
> > -#include "vtpm_manager.h"
> > -#include "vtpmpriv.h"
> > -#include "vtsp.h"
> > -#include "bsg.h"
> > -#include "hashtable.h"
> > -#include "hashtable_itr.h"
> > -
> > -#include "log.h"
> > -#include "buffer.h"
> > -
> > -VTPM_GLOBALS *vtpm_globals=NULL;
> > -
> > -// --------------------------- Well Known Auths --------------------------
> > -const TPM_AUTHDATA SRK_AUTH = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
> > -                                  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
> > -
> > -#ifdef WELL_KNOWN_OWNER_AUTH
> > -static BYTE FIXED_OWNER_AUTH[20] =  {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
> > -                                  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
> > -#endif
> > -
> > -
> > -// -------------------------- Hash table functions --------------------
> > -
> > -static unsigned int hashfunc32(void *ky) {
> > -  return (* (UINT32 *) ky);
> > -}
> > -
> > -static int equals32(void *k1, void *k2) {
> > -  return (*(UINT32 *) k1 == *(UINT32 *) k2);
> > -}
> > -
> > -// --------------------------- Functions ------------------------------
> > -
> > -TPM_RESULT VTPM_Create_Manager(){
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  // Generate Auth for Owner
> > -#ifdef WELL_KNOWN_OWNER_AUTH
> > -  memcpy(vtpm_globals->owner_usage_auth, FIXED_OWNER_AUTH, sizeof(TPM_AUTHDATA));
> > -#else
> > -  Crypto_GetRandom(vtpm_globals->owner_usage_auth, sizeof(TPM_AUTHDATA) );
> > -#endif
> > -
> > -  // Take Owership of TPM
> > -  CRYPTO_INFO ek_cryptoInfo;
> > -
> > -  status = VTSP_ReadPubek(vtpm_globals->manager_tcs_handle, &ek_cryptoInfo);
> > -
> > -  // If we can read PubEK then there is no owner and we should take it.
> > -  // We use the abilty to read the pubEK to flag that the TPM is owned.
> > -  // FIXME: Change to just trying to take ownership and react to the status
> > -  if (status == TPM_SUCCESS) {
> > -    TPMTRYRETURN(VTSP_TakeOwnership(vtpm_globals->manager_tcs_handle,
> > -                                   (const TPM_AUTHDATA*)&vtpm_globals->owner_usage_auth,
> > -                                   &SRK_AUTH,
> > -                                   &ek_cryptoInfo,
> > -                                   &vtpm_globals->keyAuth));
> > -
> > -    TPMTRYRETURN(VTSP_DisablePubekRead(vtpm_globals->manager_tcs_handle,
> > -                                       (const TPM_AUTHDATA*)&vtpm_globals->owner_usage_auth,
> > -                                       &vtpm_globals->keyAuth));
> > -  } else {
> > -    vtpmloginfo(VTPM_LOG_VTPM, "Failed to readEK meaning TPM has an owner. Creating Keys off existing SRK.\n");
> > -  }
> > -
> > -  // Generate storage key's auth
> > -  Crypto_GetRandom(  &vtpm_globals->storage_key_usage_auth,
> > -                    sizeof(TPM_AUTHDATA) );
> > -
> > -  TCS_AUTH osap;
> > -  TPM_AUTHDATA sharedsecret;
> > -
> > -  TPMTRYRETURN( VTSP_OSAP(vtpm_globals->manager_tcs_handle,
> > -                         TPM_ET_KEYHANDLE,
> > -                         TPM_SRK_KEYHANDLE,
> > -                         &SRK_AUTH,
> > -                         &sharedsecret,
> > -                         &osap) );
> > -
> > -  osap.fContinueAuthSession = FALSE;
> > -
> > -
> > -  TPMTRYRETURN( VTSP_CreateWrapKey( vtpm_globals->manager_tcs_handle,
> > -                                   TPM_KEY_BIND,
> > -                                   (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
> > -                                   TPM_SRK_KEYHANDLE,
> > -                                   (const TPM_AUTHDATA*)&sharedsecret,
> > -                                   &vtpm_globals->storageKeyWrap,
> > -                                   &osap) );
> > -
> > -  // Generate boot key's auth
> > -  TPM_AUTHDATA bootKeyWrapAuth;
> > -  memset(&bootKeyWrapAuth, 0, sizeof(bootKeyWrapAuth));
> > -
> > -  TPMTRYRETURN( VTSP_OSAP(vtpm_globals->manager_tcs_handle,
> > -                         TPM_ET_KEYHANDLE,
> > -                         TPM_SRK_KEYHANDLE,
> > -                         &SRK_AUTH,
> > -                         &sharedsecret,
> > -                         &osap) );
> > -
> > -  osap.fContinueAuthSession = FALSE;
> > -
> > -  // FIXME: This key protects the global secrets on disk. It should use TPM
> > -  //        PCR bindings to limit its use to legit configurations.
> > -  //        Current binds are open, implying a Trusted VM contains this code.
> > -  //        If this VM is not Trusted, use measurement and PCR bindings.
> > -  TPMTRYRETURN( VTSP_CreateWrapKey( vtpm_globals->manager_tcs_handle,
> > -                                   TPM_KEY_BIND,
> > -                                   (const TPM_AUTHDATA*)&bootKeyWrapAuth,
> > -                                   TPM_SRK_KEYHANDLE,
> > -                                   (const TPM_AUTHDATA*)&sharedsecret,
> > -                                   &vtpm_globals->bootKeyWrap,
> > -                                   &osap) );
> > -
> > -  // Populate CRYPTO_INFO vtpm_globals->bootKey. This does not load it into the TPM
> > -  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
> > -                              TPM_SRK_KEYHANDLE,
> > -                              &vtpm_globals->bootKeyWrap,
> > -                              NULL,
> > -                              NULL,
> > -                              NULL,
> > -                              &vtpm_globals->bootKey,
> > -                              TRUE ) );
> > -
> > -  TPMTRYRETURN( VTSP_SaveState(vtpm_globals->manager_tcs_handle) );
> > -  goto egress;
> > -
> > - abort_egress:
> > -  exit(1);
> > -
> > - egress:
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager (Status = %d).\n", status);
> > -  return status;
> > -
> > -}
> > -
> > -///////////////////////////////////////////////////////////////////////////////
> > -TPM_RESULT VTPM_Init_Manager() {
> > -  TPM_RESULT status = TPM_FAIL, serviceStatus;
> > -  BYTE *randomsead;
> > -  UINT32 randomsize=256;
> > -
> > -  if ((vtpm_globals = (VTPM_GLOBALS *) malloc(sizeof(VTPM_GLOBALS))) == NULL){
> > -    status = TPM_FAIL;
> > -    goto abort_egress;
> > -  }
> > -  memset(vtpm_globals, 0, sizeof(VTPM_GLOBALS));
> > -
> > -  vtpm_globals->connected_dmis = 0;
> > -
> > -  if ((vtpm_globals->dmi_map = create_hashtable(10, hashfunc32, equals32)) == NULL){
> > -    status = TPM_FAIL;
> > -    goto abort_egress;
> > -  }
> > -
> > -  // Create new TCS Object
> > -  vtpm_globals->manager_tcs_handle = 0;
> > -
> > -  TPMTRYRETURN(TCS_create());
> > -
> > -  // Create TCS Context for service
> > -  TPMTRYRETURN( TCS_OpenContext(&vtpm_globals->manager_tcs_handle ) );
> > -
> > -  TPMTRYRETURN( TCSP_GetRandom(vtpm_globals->manager_tcs_handle,
> > -                              &randomsize,
> > -                              &randomsead));
> > -
> > -  Crypto_Init(randomsead, randomsize);
> > -  TPMTRYRETURN( TCS_FreeMemory (vtpm_globals->manager_tcs_handle, randomsead));
> > -
> > -  // Create OIAP session for service's authorized commands
> > -  TPMTRYRETURN( VTSP_OIAP( vtpm_globals->manager_tcs_handle,
> > -                          &vtpm_globals->keyAuth) );
> > -  vtpm_globals->keyAuth.fContinueAuthSession = TRUE;
> > -
> > -  vtpm_globals->mig_keys = NULL;
> > -
> > -  // If fails, create new Manager.
> > -  serviceStatus = VTPM_LoadManagerData();
> > -  if (serviceStatus == TPM_IOERROR) {
> > -    vtpmloginfo(VTPM_LOG_VTPM, "Failed to read manager file. Assuming first time initialization.\n");
> > -    TPMTRYRETURN( VTPM_Create_Manager() );
> > -    TPMTRYRETURN( VTPM_SaveManagerData() );
> > -  } else if (serviceStatus != TPM_SUCCESS) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to read existing manager file");
> > -    exit(1);
> > -  }
> > -
> > -  //Load Storage Key
> > -  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
> > -                             TPM_SRK_KEYHANDLE,
> > -                             &vtpm_globals->storageKeyWrap,
> > -                             &SRK_AUTH,
> > -                             &vtpm_globals->storageKeyHandle,
> > -                             &vtpm_globals->keyAuth,
> > -                             &vtpm_globals->storageKey,
> > -                              FALSE ) );
> > -
> > -  // Create entry for Dom0 for control messages
> > -  TPMTRYRETURN( VTPM_Handle_New_DMI(NULL) );
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  return(status);
> > -}
> > -
> > -///////////////////////////////////////////////////////////////////////////////
> > -void VTPM_Stop_Manager() {
> > -  VTPM_DMI_RESOURCE *dmi_res;
> > -  struct hashtable_itr *dmi_itr;
> > -
> > -  // Close all the TCS contexts. TCS should evict keys based on this
> > -  if (hashtable_count(vtpm_globals->dmi_map) > 0) {
> > -    dmi_itr = hashtable_iterator(vtpm_globals->dmi_map);
> > -    do {
> > -      dmi_res = (VTPM_DMI_RESOURCE *) hashtable_iterator_value(dmi_itr);
> > -      if (dmi_res->connected)
> > -       close_dmi( dmi_res ); // Not really interested in return code
> > -
> > -    } while (hashtable_iterator_advance(dmi_itr));
> > -               free (dmi_itr);
> > -  }
> > -
> > -  if ( VTPM_SaveManagerData() != TPM_SUCCESS )
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to save manager data.\n");
> > -
> > -  TCS_CloseContext(vtpm_globals->manager_tcs_handle);
> > -  TCS_destroy();
> > -
> > -  hashtable_destroy(vtpm_globals->dmi_map, 1);
> > -  free(vtpm_globals);
> > -
> > -  Crypto_Exit();
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
> > -}
> > diff --git a/tools/vtpm_manager/manager/vtpm_manager.h b/tools/vtpm_manager/manager/vtpm_manager.h
> > deleted file mode 100644
> > index a324a8f..0000000
> > --- a/tools/vtpm_manager/manager/vtpm_manager.h
> > +++ /dev/null
> > @@ -1,150 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_manager.h
> > -//
> > -//  Public Interface header for VTPM Manager
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __VTPM_MANAGER_H__
> > -#define __VTPM_MANAGER_H__
> > -
> > -#define VTPM_TAG_REQ 0x01c1
> > -#define VTPM_TAG_RSP 0x01c4
> > -#define COMMAND_BUFFER_SIZE 4096
> > -
> > -// Header sizes. Note Header MAY include the DMI
> > -#define VTPM_COMMAND_HEADER_SIZE_CLT ( 2 + 4 + 4)
> > -//                    sizeof(TPM_TAG + UINT32 + TPM_COMMAND_CODE)
> > -#define VTPM_COMMAND_HEADER_SIZE_SRV ( 4 + VTPM_COMMAND_HEADER_SIZE_CLT )
> > -//                    sizeof( UINT32 + VTPM_COMMAND_HEADER_SIZE_CLT)
> > -
> > -//************************ Command Codes ****************************
> > -#define VTPM_ORD_BASE       0x0000
> > -#define VTPM_PRIV_MASK      0x01000000 // Priviledged VTPM Command
> > -#define VTPM_PRIV_BASE      (VTPM_ORD_BASE | VTPM_PRIV_MASK)
> > -
> > -// Non-priviledged VTPM Commands (From DMI's)
> > -#define VTPM_ORD_SAVENVM      (VTPM_ORD_BASE + 1) // DMI Saves Secrets
> > -#define VTPM_ORD_LOADNVM      (VTPM_ORD_BASE + 2) // DMI Loads Secrets
> > -#define VTPM_ORD_TPMCOMMAND   (VTPM_ORD_BASE + 3) // DMI issues HW TPM Command
> > -#define VTPM_ORD_GET_MIG_KEY  (VTPM_ORD_BASE + 4) // Get manager's migration key
> > -#define VTPM_ORD_LOAD_MIG_KEY (VTPM_ORD_BASE + 5) // load dest migration key
> > -
> > -// Priviledged VTPM Commands (From management console)
> > -#define VTPM_ORD_OPEN         (VTPM_PRIV_BASE + 1) // Creates/reopens DMI
> > -#define VTPM_ORD_CLOSE        (VTPM_PRIV_BASE + 2) // Closes a DMI
> > -#define VTPM_ORD_DELETE       (VTPM_PRIV_BASE + 3) // Permemently Deletes DMI
> > -#define VTPM_ORD_MIGRATE_IN   (VTPM_PRIV_BASE + 4) // Load migrated VTPM
> > -#define VTPM_ORD_MIGRATE_OUT  (VTPM_PRIV_BASE + 5) // migrate VTPM to dest
> > -
> > -//************************ Return Codes ****************************
> > -#define VTPM_TYPE_PVM 1 // Paravirtualized Domain
> > -#define VTPM_TYPE_HVM 2 // HVM Domain
> > -
> > -//************************ Return Codes ****************************
> > -#define VTPM_SUCCESS               0
> > -#define VTPM_FAIL                  1
> > -#define VTPM_UNSUPPORTED           2
> > -#define VTPM_FORBIDDEN             3
> > -#define VTPM_RESTORE_CONTEXT_FAILED    4
> > -#define VTPM_INVALID_REQUEST       5
> > -
> > -//*********************** Parameter Values *************************
> > -#define VTPM_TYPE_NON_MIGRATABLE  0x00
> > -#define VTPM_TYPE_MIGRATABLE      0x01
> > -#define VTPM_TYPE_MIGRATED        0xFF // VTPM has been migrated.
> > -                                       // VTPM can be recovered or deleted only
> > -
> > -/******************* Command Parameter API *************************
> > -
> > -VTPM Command Format
> > -  dmi: 4 bytes                  // Source of message.
> > -                                // WARNING: This is prepended by the channel.
> > -                                // Thus it is received by VTPM Manager,
> > -                                // but not sent by DMI
> > -  tpm tag: 2 bytes
> > -  command size: 4 bytes         // Size of command including header but not DMI
> > -  ord: 4 bytes                  // Command ordinal above
> > -  parameters: size - 10 bytes   // Command Parameter
> > -
> > -VTPM Response Format
> > -  tpm tag: 2 bytes
> > -  response_size: 4 bytes
> > -  status: 4 bytes
> > -  parameters: size - 10 bytes
> > -
> > -
> > -VTPM_Open:
> > -  Input Parameters:
> > -    mig_type: 1 byte
> > -    startup_mode: 1 byte // Cold Boot = 1, resume = 2, deactive = 3
> > -    domain type: 1 byte
> > -    instance_id: 4 bytes
> > -  Output Parameters:
> > -    None
> > -
> > -VTPM_Close
> > -  Input Parameters:
> > -    instance_id: 4 bytes
> > -  Output Parameters:
> > -    None
> > -
> > -VTPM_Delete
> > -  Input Parameters:
> > -    instance_id: 4 bytes
> > -  Output Parameters:
> > -    None
> > -
> > -VTPM_SaveNVM
> > -  Input Parameters:
> > -    data: n bytes (Header indicates size of data)
> > -  Output Parameters:
> > -    None
> > -
> > -VTPM_LoadNVM
> > -  Input Parameters:
> > -    None
> > -  Output Parameters:
> > -    data: n bytes (Header indicates size of data)
> > -
> > -VTPM_TPMCommand
> > -  Input Parameters:
> > -    TPM Command Byte Stream: n bytes
> > -  Output Parameters:
> > -    TPM Reponse Byte Stream: n bytes
> > -
> > -*********************************************************************/
> > -
> > -#endif //_VTPM_MANAGER_H_
> > diff --git a/tools/vtpm_manager/manager/vtpm_manager_handler.c b/tools/vtpm_manager/manager/vtpm_manager_handler.c
> > deleted file mode 100644
> > index 2001074..0000000
> > --- a/tools/vtpm_manager/manager/vtpm_manager_handler.c
> > +++ /dev/null
> > @@ -1,488 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_manager_handler.c
> > -//
> > -//  This file will house the main logic of the VTPM Manager
> > -//
> > -// ==================================================================
> > -
> > -#include <stdio.h>
> > -#include <unistd.h>
> > -#include <string.h>
> > -#include <errno.h>
> > -
> > -#include "vtpm_manager.h"
> > -#include "vtpmpriv.h"
> > -#include "vtsp.h"
> > -#include "bsg.h"
> > -#include "hashtable.h"
> > -#include "hashtable_itr.h"
> > -#include "log.h"
> > -#include "buffer.h"
> > -
> > -#define vtpmhandlerloginfo(module,fmt,args...) vtpmloginfo (module, "[%s]: " fmt, thread_name, ##args );
> > -#define vtpmhandlerloginfomore(module,fmt,args...) vtpmloginfomore (module, fmt, ##args );
> > -#define vtpmhandlerlogerror(module,fmt,args...) vtpmlogerror (module, "[%s]: " fmt, thread_name, ##args );
> > -
> > -// ---------------------- Prototypes -------------------
> > -TPM_RESULT vtpm_manager_handle_vtpm_cmd(VTPM_DMI_RESOURCE *dmi_res,
> > -                                       TPM_COMMAND_CODE ord,
> > -                                       buffer_t *command_buf,
> > -                                       buffer_t *result_buf,
> > -                                        BOOL is_priv,
> > -                                        char *thread_name);
> > -
> > -TPM_RESULT vtpm_manager_handle_tpm_cmd(vtpm_ipc_handle_t *tx_ipc_h,
> > -                                       vtpm_ipc_handle_t *rx_ipc_h,
> > -                                       VTPM_DMI_RESOURCE *dmi_res,
> > -                                       BYTE *cmd_header,
> > -                                       buffer_t *param_buf,
> > -                                       buffer_t *result_buf,
> > -                                       char *thread_name);
> > -
> > -TPM_RESULT VTPM_Manager_Handler( vtpm_ipc_handle_t *tx_ipc_h,
> > -                                 vtpm_ipc_handle_t *rx_ipc_h,
> > -                                 BOOL fw_tpm,   // Forward TPM cmds?
> > -                                 vtpm_ipc_handle_t *fw_tx_ipc_h,
> > -                                 vtpm_ipc_handle_t *fw_rx_ipc_h,
> > -                                 BOOL is_priv,
> > -                                 char *thread_name) {
> > -  TPM_RESULT      status =  TPM_FAIL; // Should never return
> > -  UINT32          dmi, in_param_size, cmd_size, out_param_size, out_message_size, reply_size;
> > -  BYTE            *cmd_header=NULL, *in_param=NULL, *out_message=NULL, *reply;
> > -  buffer_t        *command_buf=NULL, *result_buf=NULL;
> > -  TPM_TAG         tag;
> > -  TPM_COMMAND_CODE ord;
> > -  VTPM_DMI_RESOURCE *dmi_res;
> > -  int  size_read, size_write, i;
> > -  BOOL add_header=TRUE; // This indicates to prepend a header on result_buf before sending
> > -
> > -  cmd_header = (BYTE *) malloc(VTPM_COMMAND_HEADER_SIZE_SRV);
> > -  command_buf = (buffer_t *) malloc(sizeof(buffer_t));
> > -  result_buf = (buffer_t *) malloc(sizeof(buffer_t));
> > -
> > -  // ------------------------ Main Loop --------------------------------
> > -  while(1) {
> > -
> > -    vtpmhandlerloginfo(VTPM_LOG_VTPM, "%s waiting for messages.\n", thread_name);
> > -
> > -    // --------------------- Read Cmd from Sender ----------------
> > -
> > -    // Read command header
> > -    size_read = vtpm_ipc_read(rx_ipc_h, NULL, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> > -    if (size_read > 0) {
> > -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "RECV[%d]: 0x", size_read);
> > -      for (i=0; i<size_read; i++)
> > -       vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> > -    } else {
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s can't read from ipc. Errono = %d. Aborting... \n", thread_name, errno);
> > -      goto abort_command;
> > -    }
> > -
> > -    if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
> > -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "\n");
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command shorter than normal header (%d bytes). Aborting...\n", size_read);
> > -      goto abort_command;
> > -    }
> > -
> > -    // Unpack header
> > -    BSG_UnpackList(cmd_header, 4,
> > -                  BSG_TYPE_UINT32, &dmi,
> > -                  BSG_TPM_TAG, &tag,
> > -                  BSG_TYPE_UINT32, &in_param_size,
> > -                  BSG_TPM_COMMAND_CODE, &ord );
> > -
> > -    // Using the header info, read the parameters of the command
> > -    // Note that in_param_size is in the client's context
> > -    cmd_size = in_param_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> > -    if (cmd_size > 0) {
> > -      in_param = (BYTE *) malloc(cmd_size);
> > -      size_read = vtpm_ipc_read( rx_ipc_h, NULL, in_param, cmd_size);
> > -      if (size_read > 0) {
> > -       for (i=0; i<size_read; i++)
> > -         vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
> > -
> > -      } else {
> > -        vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s had error reading cmd from ipc. Aborting... \n", thread_name);
> > -       goto abort_command;
> > -      }
> > -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -
> > -      if (size_read < (int) cmd_size) {
> > -       vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -       vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d). Aborting...\n", size_read, cmd_size);
> > -       goto abort_command;
> > -      }
> > -    } else {
> > -      in_param = NULL;
> > -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -    }
> > -
> > -    // Init the buffers used to handle the command and the response
> > -    if ( (buffer_init_convert(command_buf, cmd_size, in_param) != TPM_SUCCESS) ||
> > -        (buffer_init(result_buf, 0, 0) != TPM_SUCCESS) ) {
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Failed to setup buffers. Aborting...\n");
> > -      goto abort_command;
> > -    }
> > -
> > -    // -------------- Dispatch Commands to Handlers -----------
> > -    if ((tag == VTPM_TAG_REQ) && (ord & VTPM_PRIV_MASK)) {
> > -      vtpm_lock_wrlock();
> > -    } else {
> > -      vtpm_lock_rdlock();
> > -    }
> > -
> > -    if ( !(dmi_res = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi)) ||
> > -         (!dmi_res->connected) ) {
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Attempted access to non-existent or disconnected DMI %d. Aborting...\n", dmi);
> > -      status = TPM_BAD_PARAMETER;
> > -      // We have no one to reply to, they don't exist.
> > -      goto abort_command;
> > -    }
> > -
> > -    if (tag == VTPM_TAG_REQ) {
> > -
> > -      status = vtpm_manager_handle_vtpm_cmd(dmi_res, ord, command_buf, result_buf, is_priv, thread_name);
> > -
> > -    } else { // This is not a VTPM Command at all.
> > -      if (fw_tpm) {
> > -        status = vtpm_manager_handle_tpm_cmd(fw_tx_ipc_h, fw_rx_ipc_h, dmi_res, cmd_header, command_buf, result_buf, thread_name);
> > -
> > -        // This means calling the DMI failed, not that the cmd failed in the DMI
> > -        // Since the return will be interpretted by a TPM app, all errors are IO_ERRORs to the app
> > -        if (status != TPM_SUCCESS) {
> > -          status = TPM_IOERROR;
> > -         goto abort_with_error;
> > -        }
> > -        // Unlike all other commands, forwarded commands yield a result_buf that includes the DMI's status. This
> > -        // should be forwarded to the caller VM
> > -        add_header = FALSE;
> > -      } else {
> > -        // We are not supposed to forward TPM commands at all.
> > -        int i;
> > -        vtpmhandlerlogerror(VTPM_LOG_VTPM, "Attempt to use unsupported direct access to TPM.\n");
> > -        vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "Bad Command. dmi:%d, tag:%d, size:%d, ord:%d, Params: ", dmi, tag, in_param_size, ord);
> > -        for (i=0; i<cmd_size; i++)
> > -          vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
> > -
> > -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -
> > -        status = TPM_FAIL;
> > -        goto abort_with_error;
> > -     }
> > -
> > -    } // end else for is VTPM Command
> > -
> > -    // ------------------- Respond to Sender ------------------
> > -
> > -    // Errors while handling responses jump here to reply with error messages
> > -    // NOTE: Currently there are no recoverable errors in multi-VM mode. If one
> > -    //       is added to the code, this ifdef should be removed.
> > -    //       Also note this is NOT referring to errors in commands, but rather
> > -    //       this is about I/O errors and such.
> > -#ifndef VTPM_MULTI_VM
> > - abort_with_error:
> > -#endif
> > -
> > -    if (add_header) {
> > -      // Prepend VTPM header with destination DM stamped
> > -      out_param_size = buffer_len(result_buf);
> > -      out_message_size = VTPM_COMMAND_HEADER_SIZE_CLT + out_param_size;
> > -      reply_size = VTPM_COMMAND_HEADER_SIZE_SRV + out_param_size;
> > -      out_message = (BYTE *) malloc (reply_size);
> > -      reply = out_message;
> > -
> > -      BSG_PackList(out_message, 4,
> > -                  BSG_TYPE_UINT32, (BYTE *) &dmi,
> > -                  BSG_TPM_TAG, (BYTE *) &tag,
> > -                  BSG_TYPE_UINT32, (BYTE *) &out_message_size,
> > -                  BSG_TPM_RESULT, (BYTE *) &status);
> > -
> > -      if (buffer_len(result_buf) > 0)
> > -        memcpy(out_message + VTPM_COMMAND_HEADER_SIZE_SRV, result_buf->bytes, out_param_size);
> > -      //Note: Send message + dmi_id
> > -    } else {
> > -      reply = result_buf->bytes;
> > -      reply_size = buffer_len(result_buf);
> > -    }
> > -    size_write = vtpm_ipc_write(tx_ipc_h, (dmi_res ? dmi_res->tx_vtpm_ipc_h : NULL), reply, reply_size );
> > -    if (size_write > 0) {
> > -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT: 0x");
> > -      for (i=0; i < reply_size; i++)
> > -       vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", reply[i]);
> > -
> > -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -    } else {
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s had error writing to ipc. Aborting... \n", thread_name);
> > -      goto abort_command;
> > -    }
> > -    free(out_message); out_message=NULL;
> > -
> > -    if (size_write < (int)reply_size) {
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s unable to write full command to ipc (%d/%d)\n", thread_name, size_write, reply_size);
> > -      goto abort_command;
> > -    }
> > -
> > -    // On certain failures an error message cannot be sent.
> > -    // This marks the beginning of cleanup in preperation for the next command.
> > -  abort_command:
> > -    //free buffers
> > -    bzero(cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> > -    //free(in_param); // This was converted to command_buf. No need to free
> > -    buffer_free(result_buf);
> > -    buffer_free(command_buf);
> > -
> > -    // If we have a write lock, save the manager table
> > -    if ((tag == VTPM_TAG_REQ) && (ord & VTPM_PRIV_MASK) &&
> > -        (VTPM_SaveManagerData() != TPM_SUCCESS) ) {
> > -       vtpmhandlerlogerror(VTPM_LOG_VTPM, "ERROR: Unable to save manager data.\n");
> > -    }
> > -
> > -    vtpm_lock_unlock();
> > -    add_header = TRUE; // Reset to the default
> > -  } // End while(1)
> > -
> > -}
> > -
> > -/////////////////////////////////////////////////////////////////////////
> > -TPM_RESULT vtpm_manager_handle_vtpm_cmd(VTPM_DMI_RESOURCE *dmi_res,
> > -                                       TPM_COMMAND_CODE ord,
> > -                                       buffer_t *command_buf,
> > -                                       buffer_t *result_buf,
> > -                                        BOOL is_priv,
> > -                                        char *thread_name) {
> > -
> > -  TPM_RESULT status = TPM_FAIL;
> > -
> > -  switch (ord) {
> > -  case VTPM_ORD_SAVENVM:
> > -    status= VTPM_Handle_Save_NVM(dmi_res,
> > -                                 command_buf,
> > -                                 result_buf);
> > -    break;
> > -
> > -  case VTPM_ORD_LOADNVM:
> > -    status= VTPM_Handle_Load_NVM(dmi_res,
> > -                                 command_buf,
> > -                                 result_buf);
> > -    break;
> > -
> > -  case VTPM_ORD_TPMCOMMAND:
> > -    status= VTPM_Handle_TPM_Command(dmi_res,
> > -                                    command_buf,
> > -                                    result_buf);
> > -    break;
> > -
> > -  case VTPM_ORD_GET_MIG_KEY:
> > -    status = VTPM_Handle_Get_Migration_key(command_buf,
> > -                                           result_buf);
> > -    break;
> > -
> > -  case VTPM_ORD_LOAD_MIG_KEY:
> > -    status = VTPM_Handle_Load_Migration_key(command_buf,
> > -                                           result_buf);
> > -    break;
> > -
> > -  default:
> > -    // Privileged handlers can do maintanance
> > -    if (is_priv) {
> > -      switch (ord) {
> > -      case VTPM_ORD_OPEN:
> > -        status = VTPM_Handle_New_DMI(command_buf);
> > -        break;
> > -
> > -      case VTPM_ORD_CLOSE:
> > -        status = VTPM_Handle_Close_DMI(command_buf);
> > -        break;
> > -
> > -      case VTPM_ORD_DELETE:
> > -        status = VTPM_Handle_Delete_DMI(command_buf);
> > -        break;
> > -
> > -      case VTPM_ORD_MIGRATE_IN:
> > -        status = VTPM_Handle_Migrate_In(command_buf, result_buf);
> > -        break;
> > -
> > -      case VTPM_ORD_MIGRATE_OUT:
> > -        status = VTPM_Handle_Migrate_Out(command_buf, result_buf);
> > -        break;
> > -
> > -      default:
> > -        status = TPM_BAD_ORDINAL;
> > -      } // switch
> > -    } else { // is priv command
> > -
> > -        status = TPM_BAD_ORDINAL;
> > -    } // inner switch
> > -  } // outer switch
> > -
> > -  return(status);
> > -}
> > -
> > -/////////////////////////////////////////////////////////////////////
> > -TPM_RESULT vtpm_manager_handle_tpm_cmd(vtpm_ipc_handle_t *tx_ipc_h,
> > -                                       vtpm_ipc_handle_t *rx_ipc_h,
> > -                                      VTPM_DMI_RESOURCE *dmi_res,
> > -                                      BYTE *cmd_header,
> > -                                      buffer_t *param_buf,
> > -                                      buffer_t *result_buf,
> > -                                       char *thread_name) {
> > -
> > -  TPM_RESULT status = TPM_FAIL;
> > -  UINT32 dmi_dst;
> > -  TPM_COMMAND_CODE ord;
> > -  TPM_TAG tag_out;
> > -  UINT32 dmi_cmd_size, in_param_size, adj_param_size;
> > -  BYTE *dmi_cmd, *in_param;
> > -  int  size_read, size_write, i;
> > -
> > -  //// Dom0 can't talk to the BE, so this must be a broken FE/BE or badness
> > -  if (dmi_res->dmi_id == VTPM_CTL_DM) {
> > -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Illegal use of TPM command from dom0\n");
> > -    status = TPM_FAIL;
> > -    goto abort_with_error;
> > -  }
> > -
> > -  vtpmhandlerloginfo(VTPM_LOG_VTPM, "Forwarding command to DMI.\n");
> > -
> > -  //Forward TPM CMD stamped with dmi_id to DMI for handling
> > -  if (buffer_len(param_buf)) {
> > -    dmi_cmd = (BYTE *) malloc(VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf));
> > -    dmi_cmd_size = VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf);
> > -    memcpy(dmi_cmd, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> > -    memcpy(dmi_cmd + VTPM_COMMAND_HEADER_SIZE_SRV, param_buf->bytes, buffer_len(param_buf));
> > -    size_write = vtpm_ipc_write(tx_ipc_h, dmi_res->tx_tpm_ipc_h, dmi_cmd, dmi_cmd_size);
> > -
> > -    if (size_write > 0) {
> > -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT (DMI): 0x");
> > -      for (i=0; i<VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf); i++) {
> > -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", dmi_cmd[i]);
> > -      }
> > -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -    } else {
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error writing to DMI. Aborting... \n");
> > -      status = TPM_IOERROR;
> > -      goto abort_with_error;
> > -    }
> > -    free(dmi_cmd);
> > -  } else {
> > -    dmi_cmd_size = VTPM_COMMAND_HEADER_SIZE_SRV;
> > -    size_write = vtpm_ipc_write(tx_ipc_h, dmi_res->tx_tpm_ipc_h, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV );
> > -    if (size_write > 0) {
> > -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT (DMI): 0x");
> > -      for (i=0; i<VTPM_COMMAND_HEADER_SIZE_SRV; i++)
> > -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> > -
> > -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -    } else {
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error writing to DMI. Aborting... \n");
> > -      status = TPM_IOERROR;
> > -      goto abort_with_error;
> > -    }
> > -  }
> > -
> > -  if (size_write != (int) dmi_cmd_size)
> > -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Could not write entire command to DMI (%d/%d)\n", size_write, dmi_cmd_size);
> > -
> > -  buffer_free(param_buf);
> > -
> > -  // Read header for response to TPM command from DMI
> > -  size_read = vtpm_ipc_read( rx_ipc_h, dmi_res->rx_tpm_ipc_h, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> > -  if (size_read > 0) {
> > -    vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "RECV (DMI): 0x");
> > -    for (i=0; i<size_read; i++)
> > -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> > -
> > -  } else {
> > -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error reading from DMI. Aborting... \n");
> > -    status = TPM_IOERROR;
> > -    goto abort_with_error;
> > -  }
> > -
> > -  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
> > -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command from DMI shorter than normal header. Aborting...\n");
> > -    status = TPM_IOERROR;
> > -    goto abort_with_error;
> > -  }
> > -
> > -  // Unpack response from DMI for TPM command
> > -  BSG_UnpackList(cmd_header, 4,
> > -                 BSG_TYPE_UINT32, &dmi_dst,
> > -                 BSG_TPM_TAG, &tag_out,
> > -                 BSG_TYPE_UINT32, &in_param_size,
> > -                 BSG_TPM_COMMAND_CODE, &status );
> > -
> > -  // If response has parameters, read them.
> > -  // Note that in_param_size is in the client's context
> > -  adj_param_size = in_param_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> > -  if (adj_param_size > 0) {
> > -    in_param = (BYTE *) malloc(adj_param_size);
> > -    size_read = vtpm_ipc_read(rx_ipc_h, dmi_res->rx_tpm_ipc_h, in_param, adj_param_size);
> > -    if (size_read > 0) {
> > -      for (i=0; i<size_read; i++)
> > -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
> > -
> > -    } else {
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error reading from BE. Aborting... \n");
> > -      goto abort_with_error;
> > -    }
> > -    vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
> > -
> > -    if (size_read < (int)adj_param_size) {
> > -      vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
> > -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command read(%d) from DMI is shorter than header indicates(%d). Aborting...\n", size_read, adj_param_size);
> > -      status = TPM_IOERROR;
> > -      goto abort_with_error;
> > -    }
> > -  } else {
> > -    in_param = NULL;
> > -    vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
> > -  }
> > -
> > -  if ( (buffer_init(result_buf, VTPM_COMMAND_HEADER_SIZE_SRV, cmd_header) != TPM_SUCCESS) ||
> > -       (buffer_append_raw(result_buf, adj_param_size, in_param) != TPM_SUCCESS) ) {
> > -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Failed to setup buffers. Aborting...\n");
> > -    status = TPM_FAIL;
> > -    goto abort_with_error;
> > -  }
> > -
> > -  vtpmhandlerloginfo(VTPM_LOG_VTPM, "Sending DMI's response to guest.\n");
> > -
> > -  status = TPM_SUCCESS;
> > -
> > - abort_with_error:
> > -
> > -  return status;
> > -}
> > -
> > diff --git a/tools/vtpm_manager/manager/vtpmd.c b/tools/vtpm_manager/manager/vtpmd.c
> > deleted file mode 100644
> > index cf58ba3..0000000
> > --- a/tools/vtpm_manager/manager/vtpmd.c
> > +++ /dev/null
> > @@ -1,371 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpmd.c
> > -//
> > -//  Application
> > -//
> > -// ===================================================================
> > -
> > -#include <stdio.h>
> > -#include <unistd.h>
> > -#include <sys/types.h>
> > -#include <sys/stat.h>
> > -#include <fcntl.h>
> > -#include <signal.h>
> > -#include <string.h>
> > -#include <pthread.h>
> > -#include "vtpm_manager.h"
> > -#include "vtpmpriv.h"
> > -#include "tcg.h"
> > -#include "log.h"
> > -#include "vtpm_ipc.h"
> > -
> > -#define TPM_EMULATOR_PATH "/usr/bin/vtpmd"
> > -
> > -#define VTPM_BE_FNAME          "/dev/vtpm"
> > -#define VTPM_DUMMY_TX_BE_FNAME "/var/vtpm/fifos/dummy_out.fifo"
> > -#define VTPM_DUMMY_RX_BE_FNAME "/var/vtpm/fifos/dummy_in.fifo"
> > -#define VTPM_TX_TPM_FNAME      "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
> > -#define VTPM_RX_TPM_FNAME      "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
> > -#define VTPM_TX_VTPM_FNAME     "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
> > -#define VTPM_RX_VTPM_FNAME     "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
> > -#define VTPM_TX_HP_FNAME       "/var/vtpm/fifos/to_console.fifo"
> > -#define VTPM_RX_HP_FNAME       "/var/vtpm/fifos/from_console.fifo"
> > -
> > -#define VTPM_TYPE_PVM_STRING "pvm"
> > -#define VTPM_TYPE_HVM_STRING "hvm"
> > -
> > -struct vtpm_thread_params_s {
> > -  vtpm_ipc_handle_t *tx_ipc_h;
> > -  vtpm_ipc_handle_t *rx_ipc_h;
> > -  BOOL fw_tpm;
> > -  vtpm_ipc_handle_t *fw_tx_ipc_h;
> > -  vtpm_ipc_handle_t *fw_rx_ipc_h;
> > -  BOOL is_priv;
> > -  char *thread_name;
> > -};
> > -
> > -// This is needed to all extra_close_dmi to close this to prevent a
> > -// broken pipe when no DMIs are left.
> > -static vtpm_ipc_handle_t *g_rx_tpm_ipc_h;
> > -
> > -void *vtpm_manager_thread(void *arg_void) {
> > -  TPM_RESULT *status = (TPM_RESULT *) malloc(sizeof(TPM_RESULT) );
> > -  struct vtpm_thread_params_s *arg = (struct vtpm_thread_params_s *) arg_void;
> > -
> > -  *status = VTPM_Manager_Handler(arg->tx_ipc_h, arg->rx_ipc_h,
> > -                                 arg->fw_tpm, arg->fw_tx_ipc_h, arg->fw_rx_ipc_h,
> > -                                 arg->is_priv, arg->thread_name);
> > -
> > -  return (status);
> > -}
> > -
> > -
> > -void signal_handler(int reason) {
> > -  if (pthread_equal(pthread_self(), vtpm_globals->master_pid)) {
> > -    vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager shutting down for signal %d.\n", reason);
> > -  } else {
> > -    // For old Linux Thread machines, signals are delivered to each thread. Deal with them.
> > -    vtpmloginfo(VTPM_LOG_VTPM, "Child shutting down\n");
> > -    pthread_exit(NULL);
> > -  }
> > -
> > -  VTPM_Stop_Manager();
> > -  exit(-1);
> > -}
> > -
> > -struct sigaction ctl_c_handler;
> > -
> > -TPM_RESULT VTPM_New_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res, BYTE vm_type, BYTE startup_mode) {
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  int fh;
> > -  char dmi_id_str[11]; // UINT32s are up to 10 digits + NULL
> > -  char *tx_vtpm_name, *tx_tpm_name, *vm_type_string;
> > -  struct stat file_info;
> > -
> > -  if (dmi_res->dmi_id == VTPM_CTL_DM) {
> > -    dmi_res->tx_tpm_ipc_h = NULL;
> > -    dmi_res->rx_tpm_ipc_h = NULL;
> > -    dmi_res->tx_vtpm_ipc_h = NULL;
> > -    dmi_res->rx_vtpm_ipc_h = NULL;
> > -  } else {
> > -    // Create a pair of fifo pipes
> > -    dmi_res->rx_tpm_ipc_h = NULL;
> > -    dmi_res->rx_vtpm_ipc_h = NULL;
> > -
> > -    if ( ((dmi_res->tx_tpm_ipc_h = (vtpm_ipc_handle_t *) malloc (sizeof(vtpm_ipc_handle_t))) == NULL ) ||
> > -         ((dmi_res->tx_vtpm_ipc_h =(vtpm_ipc_handle_t *) malloc (sizeof(vtpm_ipc_handle_t))) == NULL ) ||
> > -         ((tx_tpm_name = (char *) malloc(11 + strlen(VTPM_TX_TPM_FNAME))) == NULL ) ||
> > -         ((tx_vtpm_name =(char *) malloc(11 + strlen(VTPM_TX_VTPM_FNAME))) == NULL) ) {
> > -      status =TPM_RESOURCES;
> > -      goto abort_egress;
> > -    }
> > -
> > -    sprintf(tx_tpm_name, VTPM_TX_TPM_FNAME, (uint32_t) dmi_res->dmi_id);
> > -    sprintf(tx_vtpm_name, VTPM_TX_VTPM_FNAME, (uint32_t) dmi_res->dmi_id);
> > -
> > -    if ( (vtpm_ipc_init(dmi_res->tx_tpm_ipc_h, tx_tpm_name, O_WRONLY | O_NONBLOCK, TRUE) != 0) ||
> > -         (vtpm_ipc_init(dmi_res->tx_vtpm_ipc_h, tx_vtpm_name, O_WRONLY, TRUE) != 0) ) { //FIXME: O_NONBLOCK?
> > -      status = TPM_IOERROR;
> > -      goto abort_egress;
> > -    }
> > -
> > -    // Measure DMI
> > -    // FIXME: This will measure DMI. Until then use a fixed DMI_Measurement value
> > -    // Also, this mechanism is specific to 1 VM architecture.
> > -    /*
> > -    fh = open(TPM_EMULATOR_PATH, O_RDONLY);
> > -    stat_ret = fstat(fh, &file_stat);
> > -    if (stat_ret == 0)
> > -      dmi_size = file_stat.st_size;
> > -    else {
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Could not open vtpmd!!\n");
> > -      status = TPM_IOERROR;
> > -      goto abort_egress;
> > -    }
> > -    dmi_buffer
> > -    */
> > -    memset(&dmi_res->DMI_measurement, 0xcc, sizeof(TPM_DIGEST));
> > -
> > -    if (vm_type == VTPM_TYPE_PVM)
> > -      vm_type_string = (BYTE *)&VTPM_TYPE_PVM_STRING;
> > -    else
> > -      vm_type_string = (BYTE *)&VTPM_TYPE_HVM_STRING;
> > -
> > -    // Launch DMI
> > -    sprintf(dmi_id_str, "%d", (int) dmi_res->dmi_id);
> > -#ifdef MANUAL_DM_LAUNCH
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Manually start VTPM with dmi=%s now.\n", dmi_id_str);
> > -    dmi_res->dmi_pid = 0;
> > -#else
> > -    pid_t pid = fork();
> > -
> > -    if (pid == -1) {
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Could not fork to launch vtpm\n");
> > -      status = TPM_RESOURCES;
> > -      goto abort_egress;
> > -    } else if (pid == 0) {
> > -      switch (startup_mode) {
> > -      case TPM_ST_CLEAR:
> > -        execl (TPM_EMULATOR_PATH, "vtpmd", "clear", vm_type_string, dmi_id_str, NULL);
> > -        break;
> > -      case TPM_ST_STATE:
> > -        execl (TPM_EMULATOR_PATH, "vtpmd", "save", vm_type_string, dmi_id_str, NULL);
> > -        break;
> > -      case TPM_ST_DEACTIVATED:
> > -        execl (TPM_EMULATOR_PATH, "vtpmd", "deactivated", vm_type_string, dmi_id_str, NULL);
> > -        break;
> > -      default:
> > -        status = TPM_BAD_PARAMETER;
> > -        goto abort_egress;
> > -      }
> > -
> > -      // Returning from these at all is an error.
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Could not exec to launch vtpm\n");
> > -    } else {
> > -      dmi_res->dmi_pid = pid;
> > -      vtpmloginfo(VTPM_LOG_VTPM, "Launching DMI on PID = %d\n", pid);
> > -    }
> > -#endif // MANUAL_DM_LAUNCH
> > -
> > -  } // If DMI = VTPM_CTL_DM
> > -    status = TPM_SUCCESS;
> > -
> > -abort_egress:
> > -  return (status);
> > -}
> > -
> > -TPM_RESULT VTPM_Close_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res) {
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  if (vtpm_globals->connected_dmis == 0) {
> > -    // No more DMI's connected. Close fifo to prevent a broken pipe.
> > -    // This is hackish. Need to think of another way.
> > -    vtpm_ipc_close(g_rx_tpm_ipc_h);
> > -  }
> > -
> > -
> > -  if (dmi_res->dmi_id != VTPM_CTL_DM) {
> > -    vtpm_ipc_close(dmi_res->tx_tpm_ipc_h);
> > -    vtpm_ipc_close(dmi_res->tx_vtpm_ipc_h);
> > -
> > -    free(dmi_res->tx_tpm_ipc_h->name);
> > -    free(dmi_res->tx_vtpm_ipc_h->name);
> > -
> > -#ifndef MANUAL_DM_LAUNCH
> > -    if (dmi_res->dmi_id != VTPM_CTL_DM) {
> > -      if (dmi_res->dmi_pid != 0) {
> > -        vtpmloginfo(VTPM_LOG_VTPM, "Killing dmi on pid %d.\n", dmi_res->dmi_pid);
> > -        if (kill(dmi_res->dmi_pid, SIGKILL) !=0) {
> > -          vtpmloginfo(VTPM_LOG_VTPM, "DMI on pid %d is already dead.\n", dmi_res->dmi_pid);
> > -        } else if (waitpid(dmi_res->dmi_pid, NULL, 0) != dmi_res->dmi_pid) {
> > -          vtpmlogerror(VTPM_LOG_VTPM, "DMI on pid %d failed to stop.\n", dmi_res->dmi_pid);
> > -          status = TPM_FAIL;
> > -        }
> > -      } else {
> > -        vtpmlogerror(VTPM_LOG_VTPM, "Could not kill dmi because it's pid was 0.\n");
> > -        status = TPM_FAIL;
> > -      }
> > -    }
> > -#endif
> > -
> > -  } //endif ! dom0
> > -  return status;
> > -}
> > -
> > -
> > -int main(int argc, char **argv) {
> > -  vtpm_ipc_handle_t *tx_be_ipc_h, *rx_be_ipc_h, rx_tpm_ipc_h, rx_vtpm_ipc_h, tx_hp_ipc_h, rx_hp_ipc_h;
> > -  struct vtpm_thread_params_s be_thread_params, dmi_thread_params, hp_thread_params;
> > -  pthread_t be_thread, dmi_thread, hp_thread;
> > -
> > -#ifdef DUMMY_BACKEND
> > -  vtpm_ipc_handle_t tx_dummy_ipc_h, rx_dummy_ipc_h;
> > -#else
> > -  vtpm_ipc_handle_t real_be_ipc_h;
> > -#endif
> > -
> > -  vtpmloginfo(VTPM_LOG_VTPM, "Starting VTPM.\n");
> > -
> > -  // -------------------- Initialize Manager -----------------
> > -  if (VTPM_Init_Manager() != TPM_SUCCESS) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Closing vtpmd due to error during startup.\n");
> > -    return -1;
> > -  }
> > -
> > -  // -------------------- Setup Ctrl+C Handlers --------------
> > -  ctl_c_handler.sa_handler = signal_handler;
> > -  sigemptyset(&ctl_c_handler.sa_mask);
> > -  ctl_c_handler.sa_flags = 0;
> > -
> > -  if (sigaction(SIGINT, &ctl_c_handler, NULL) == -1)
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Could not install SIGINT handler. Ctl+break will not stop manager gently.\n");
> > -
> > -  // For easier debuggin with gdb
> > -  if (sigaction(SIGHUP, &ctl_c_handler, NULL) == -1)
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Could not install SIGHUP handler. Ctl+break will not stop manager gently.\n");
> > -
> > -  sigset_t sig_mask;
> > -  sigemptyset(&sig_mask);
> > -  sigaddset(&sig_mask, SIGPIPE);
> > -  sigprocmask(SIG_BLOCK, &sig_mask, NULL);
> > -
> > -  // ------------------- Set up file ipc structures ----------
> > -#ifdef DUMMY_BACKEND
> > -  if ( (vtpm_ipc_init(&tx_dummy_ipc_h, VTPM_DUMMY_TX_BE_FNAME, O_RDWR, TRUE) != 0) ||
> > -       (vtpm_ipc_init(&rx_dummy_ipc_h, VTPM_DUMMY_RX_BE_FNAME, O_RDWR, TRUE) != 0) ) {
> > -
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to create Dummy BE FIFOs.\n");
> > -    exit(-1);
> > -  }
> > -
> > -  tx_be_ipc_h = &tx_dummy_ipc_h;
> > -  rx_be_ipc_h = &rx_dummy_ipc_h;
> > -#else
> > -  vtpm_ipc_init(&real_be_ipc_h, VTPM_BE_FNAME, O_RDWR, FALSE);
> > -
> > -  tx_be_ipc_h = &real_be_ipc_h;
> > -  rx_be_ipc_h = &real_be_ipc_h;
> > -#endif
> > -
> > -  if ( (vtpm_ipc_init(&rx_tpm_ipc_h, VTPM_RX_TPM_FNAME, O_RDONLY, TRUE) != 0) ||
> > -       (vtpm_ipc_init(&rx_vtpm_ipc_h, VTPM_RX_VTPM_FNAME, O_RDWR, TRUE) != 0) || //FIXME: O_RDONLY?
> > -       (vtpm_ipc_init(&tx_hp_ipc_h,  VTPM_TX_HP_FNAME, O_RDWR, TRUE) != 0)    ||
> > -       (vtpm_ipc_init(&rx_hp_ipc_h,  VTPM_RX_HP_FNAME, O_RDWR, TRUE) != 0) ) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to create initial FIFOs.\n");
> > -    exit(-1);
> > -  }
> > -
> > -  g_rx_tpm_ipc_h = &rx_tpm_ipc_h;
> > -
> > -  // -------------------- Set up thread params -------------
> > -
> > -  be_thread_params.tx_ipc_h = tx_be_ipc_h;
> > -  be_thread_params.rx_ipc_h = rx_be_ipc_h;
> > -  be_thread_params.fw_tpm = TRUE;
> > -  be_thread_params.fw_tx_ipc_h = NULL;
> > -  be_thread_params.fw_rx_ipc_h = &rx_tpm_ipc_h;
> > -  be_thread_params.is_priv = FALSE;
> > -  be_thread_params.thread_name = "Backend Listener";
> > -
> > -  dmi_thread_params.tx_ipc_h = NULL;
> > -  dmi_thread_params.rx_ipc_h = &rx_vtpm_ipc_h;
> > -  dmi_thread_params.fw_tpm = FALSE;
> > -  dmi_thread_params.fw_tx_ipc_h = NULL;
> > -  dmi_thread_params.fw_rx_ipc_h = NULL;
> > -  dmi_thread_params.is_priv = FALSE;
> > -  dmi_thread_params.thread_name = "VTPM Listener";
> > -
> > -  hp_thread_params.tx_ipc_h = &tx_hp_ipc_h;
> > -  hp_thread_params.rx_ipc_h = &rx_hp_ipc_h;
> > -  hp_thread_params.fw_tpm = FALSE;
> > -  hp_thread_params.fw_tx_ipc_h = NULL;
> > -  hp_thread_params.fw_rx_ipc_h = NULL;
> > -  hp_thread_params.is_priv = TRUE;
> > -  hp_thread_params.thread_name = "Hotplug Listener";
> > -
> > -  // --------------------- Launch Threads -----------------
> > -
> > -  vtpm_lock_init();
> > -
> > -  vtpm_globals->master_pid = pthread_self();
> > -
> > -  if (pthread_create(&be_thread, NULL, vtpm_manager_thread, &be_thread_params) != 0) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch BE Thread.\n");
> > -    exit(-1);
> > -  }
> > -
> > -  if (pthread_create(&dmi_thread, NULL, vtpm_manager_thread, &dmi_thread_params) != 0) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch DMI Thread.\n");
> > -    exit(-1);
> > -  }
> > -
> > -
> > -  if (pthread_create(&hp_thread, NULL, vtpm_manager_thread, &hp_thread_params) != 0) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch HP Thread.\n");
> > -    exit(-1);
> > -  }
> > -
> > -  //Join the other threads until exit time.
> > -  pthread_join(be_thread, NULL);
> > -  pthread_join(dmi_thread, NULL);
> > -  pthread_join(hp_thread, NULL);
> > -
> > -  vtpmlogerror(VTPM_LOG_VTPM, "VTPM Manager shut down unexpectedly.\n");
> > -
> > -  VTPM_Stop_Manager();
> > -  vtpm_lock_destroy();
> > -  return 0;
> > -}
> > diff --git a/tools/vtpm_manager/manager/vtpmpriv.h b/tools/vtpm_manager/manager/vtpmpriv.h
> > deleted file mode 100644
> > index 41e8d2d..0000000
> > --- a/tools/vtpm_manager/manager/vtpmpriv.h
> > +++ /dev/null
> > @@ -1,186 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpmpriv.h
> > -//
> > -//  Structures and functions private to the manager
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __VTPMPRIV_H__
> > -#define __VTPMPRIV_H__
> > -
> > -#include "vtpm_manager.h"
> > -#include "tcg.h"
> > -#include "tcs.h"
> > -#include "buffer.h"
> > -#include "crypto.h"
> > -#include "vtpm_ipc.h"
> > -
> > -#define VTPM_MANAGER_GEN   2     // This is incremented when the manager's table
> > -                                 // is changed. It's used for backwards compatability
> > -
> > -#define STATE_FILE         "/var/vtpm/VTPM"
> > -#define DMI_NVM_FILE       "/var/vtpm/vtpm_dm_%d.data"
> > -#define VTPM_CTL_DM        0
> > -
> > -// ------------------------ Private Structures -----------------------
> > -typedef struct VTPM_DMI_RESOURCE_T {
> > -  // I/O info for Manager to talk to DMI's and controllers
> > -  vtpm_ipc_handle_t      *tx_vtpm_ipc_h;    // TX VTPM Results to DMI
> > -  vtpm_ipc_handle_t      *rx_vtpm_ipc_h;    // RX VTPM Commands from DMI
> > -  vtpm_ipc_handle_t      *tx_tpm_ipc_h;     // TX TPM Commands to DMI
> > -  vtpm_ipc_handle_t      *rx_tpm_ipc_h;     // RX TPM Results from DMI
> > -
> > -#ifndef VTPM_MULTI_VM
> > -  pid_t                 dmi_pid;
> > -#endif
> > -
> > -  // Non-persistent Information
> > -  bool                  connected;
> > -  UINT32                dmi_domain_id;
> > -  TCS_CONTEXT_HANDLE    TCSContext;     // TCS Handle
> > -  char                  *NVMLocation;   // NULL term string indicating location
> > -                                        // of NVM.
> > -  // Persistent Information about DMI
> > -  UINT32                dmi_id;
> > -  BYTE                  dmi_type;
> > -  TPM_DIGEST            NVM_measurement;  // Equal to the SHA1 of the blob
> > -  TPM_DIGEST            DMI_measurement;  // Correct measurement of the owning DMI
> > -} VTPM_DMI_RESOURCE;
> > -
> > -typedef struct tdVTPM_MIGKEY_LIST {
> > -  UINT32                name_size;
> > -  BYTE                  *name; // Name of destination (IP addr, domain name, etc)
> > -  CRYPTO_INFO           key;
> > -  struct tdVTPM_MIGKEY_LIST *next;
> > -} VTPM_MIGKEY_LIST;
> > -
> > -
> > -typedef struct tdVTPM_GLOBALS {
> > -  // Non-persistent data
> > -#ifndef VTPM_MULTI_VM
> > -  pid_t               master_pid;
> > -#endif
> > -
> > -  int                 connected_dmis;     // To close guest_rx when no dmis are connected
> > -
> > -  struct hashtable    *dmi_map;               // Table of all DMI's known indexed by persistent instance #
> > -  VTPM_MIGKEY_LIST    *mig_keys;              // Table of migration keys
> > -                      // Currently keys are loaded at migration time,
> > -                      // TODO: Make VTPM man store a keys persistently
> > -                      //       and update script to check if key is needed
> > -                      //       before fetching it.
> > -
> > -  TCS_CONTEXT_HANDLE  manager_tcs_handle;     // TCS Handle used by manager
> > -  TPM_HANDLE          storageKeyHandle;       // Key used by persistent store
> > -  CRYPTO_INFO         storageKey;             // For software encryption
> > -  CRYPTO_INFO         bootKey;                // For saving table
> > -  TCS_AUTH            keyAuth;                // OIAP session for storageKey
> > -
> > -  // Persistent Data
> > -  TPM_AUTHDATA        owner_usage_auth;       // OwnerAuth of real TPM
> > -  buffer_t            storageKeyWrap;         // Wrapped copy of storageKey
> > -  TPM_AUTHDATA        srk_usage_auth;
> > -  TPM_AUTHDATA        storage_key_usage_auth;
> > -
> > -  buffer_t            bootKeyWrap;            // Wrapped copy of boot key
> > -
> > -}VTPM_GLOBALS;
> > -
> > -// --------------------------- Global Values --------------------------
> > -extern VTPM_GLOBALS *vtpm_globals;   // Key info and DMI states
> > -extern const TPM_AUTHDATA SRK_AUTH;  // SRK Well Known Auth Value
> > -
> > -// ********************** VTPM Functions *************************
> > -TPM_RESULT VTPM_Init_Manager(); // Start VTPM Service
> > -void VTPM_Stop_Manager();  // Stop VTPM Service
> > -TPM_RESULT VTPM_Manager_Handler(vtpm_ipc_handle_t *tx_ipc_h,
> > -                                vtpm_ipc_handle_t *rx_ipc_h,
> > -                                BOOL fw_tpm,   // Should forward TPM cmds
> > -                                vtpm_ipc_handle_t *fw_tx_ipc_h,
> > -                                vtpm_ipc_handle_t *fw_rx_ipc_h,
> > -                                BOOL is_priv,
> > -                                char *client_name);
> > -
> > -// ********************** Command Handler Prototypes ***********************
> > -
> > -TPM_RESULT VTPM_Handle_Load_NVM(       VTPM_DMI_RESOURCE *myDMI,
> > -                                        const buffer_t *inbuf,
> > -                                        buffer_t *outbuf);
> > -
> > -TPM_RESULT VTPM_Handle_Save_NVM(       VTPM_DMI_RESOURCE *myDMI,
> > -                                        const buffer_t *inbuf,
> > -                                        buffer_t *outbuf);
> > -
> > -TPM_RESULT VTPM_Handle_TPM_Command(    VTPM_DMI_RESOURCE *dmi,
> > -                                        buffer_t *inbuf,
> > -                                        buffer_t *outbuf);
> > -
> > -TPM_RESULT VTPM_Handle_New_DMI(const buffer_t *param_buf);
> > -
> > -TPM_RESULT VTPM_Handle_Close_DMI(const buffer_t *param_buf);
> > -
> > -TPM_RESULT VTPM_Handle_Delete_DMI(const buffer_t *param_buf);
> > -
> > -TPM_RESULT VTPM_Handle_Migrate_In( const buffer_t *param_buf,
> > -                                   buffer_t *result_buf);
> > -
> > -TPM_RESULT VTPM_Handle_Migrate_Out ( const buffer_t *param_buf,
> > -                                     buffer_t *result_buf);
> > -
> > -TPM_RESULT VTPM_Handle_Get_Migration_key( const buffer_t *param_buf,
> > -                                          buffer_t *result_buf);
> > -
> > -TPM_RESULT VTPM_SaveManagerData(void);
> > -TPM_RESULT VTPM_LoadManagerData(void);
> > -
> > -TPM_RESULT VTPM_New_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res, BYTE vm_type, BYTE startup_mode);
> > -
> > -TPM_RESULT VTPM_Close_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res);
> > -
> > -// Helper functions
> > -TPM_RESULT close_dmi(VTPM_DMI_RESOURCE *dmi_res);
> > -TPM_RESULT init_dmi(UINT32 dmi_id, BYTE type,  VTPM_DMI_RESOURCE **dmi_res);
> > -
> > -TPM_RESULT envelope_encrypt(const buffer_t     *inbuf,
> > -                             CRYPTO_INFO        *asymkey,
> > -                             buffer_t           *sealed_data);
> > -
> > -TPM_RESULT envelope_decrypt(const buffer_t     *cipher,
> > -                            TCS_CONTEXT_HANDLE TCSContext,
> > -                            TPM_HANDLE         keyHandle,
> > -                            const TPM_AUTHDATA *key_usage_auth,
> > -                            buffer_t           *unsealed_data);
> > -
> > -#endif // __VTPMPRIV_H__
> > diff --git a/tools/vtpm_manager/manager/vtsp.c b/tools/vtpm_manager/manager/vtsp.c
> > deleted file mode 100644
> > index fc8a66f..0000000
> > --- a/tools/vtpm_manager/manager/vtsp.c
> > +++ /dev/null
> > @@ -1,1042 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtsp.c
> > -//
> > -//  Higher level interface to TCS for use in service.
> > -//
> > -// ==================================================================
> > -
> > -#include <string.h>
> > -#include "tcg.h"
> > -#include "tcs.h"
> > -#include "bsg.h"
> > -#include "log.h"
> > -#include "crypto.h"
> > -#include "vtsp.h"
> > -#include "buffer.h"
> > -
> > -#define  RSA_KEY_SIZE 0x0800
> > -
> > -/***********************************************************************************
> > - * GenerateAuth: Generate authorization info to be sent back to application
> > - *
> > - * Parameters: outParamDigestText  The concatenation of output parameters to be SHA1ed
> > - *    outParamDigestTextSize Size of inParamDigestText
> > - *    HMACkey     Key to be used for HMACing
> > - *          For OIAP use key.authUsage or PersistStore.ownerAuth
> > - *          For OSAP use shared secret
> > - *    pAuth     Authorization information from the application
> > - *
> > - * Return:  TPM_SUCCESS   Authorization data created
> > - *    TPM_AUTHFAIL   Invalid (NULL) HMACkey presented for OSAP
> > - *************************************************************************************/
> > -TPM_RESULT GenerateAuth( /*[IN]*/ const BYTE *inParamDigestText,
> > -                        /*[IN]*/ UINT32 inParamDigestTextSize,
> > -                        /*[IN]*/ const TPM_SECRET *HMACkey,
> > -                        /*[IN,OUT]*/ TCS_AUTH *auth) {
> > -
> > -  if (inParamDigestText == NULL || auth == NULL)
> > -    return (TPM_AUTHFAIL);
> > -  else {
> > -
> > -    //Generate new OddNonce
> > -    Crypto_GetRandom(auth->NonceOdd.nonce, sizeof(TPM_NONCE));
> > -
> > -    // Create SHA1 inParamDigest
> > -    TPM_DIGEST inParamDigest;
> > -    Crypto_SHA1Full(inParamDigestText, inParamDigestTextSize, (BYTE *) &inParamDigest);
> > -
> > -    // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
> > -    BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
> > -
> > -    BSG_PackList(   hmacText, 4,
> > -                   BSG_TPM_DIGEST, &inParamDigest,
> > -                   BSG_TPM_NONCE, &(auth->NonceEven),
> > -                   BSG_TPM_NONCE, &(auth->NonceOdd),
> > -                   BSG_TYPE_BOOL, &(auth->fContinueAuthSession) );
> > -
> > -    Crypto_HMAC((BYTE *) hmacText, sizeof(hmacText), (BYTE *) HMACkey, sizeof(TPM_DIGEST), (BYTE *) &(auth->HMAC));
> > -
> > -    return(TPM_SUCCESS);
> > -
> > -  }
> > -}
> > -
> > -/***********************************************************************************
> > - * VerifyAuth: Verify the authdata for a command requiring authorization
> > - *
> > - * Parameters: inParamDigestText  The concatenation of parameters to be SHA1ed
> > - *    inParamDigestTextSize Size of inParamDigestText
> > - *    authDataUsage   AuthDataUsage for the Entity being used
> > - *          Key->authDataUsage or TPM_AUTH_OWNER
> > - *    HMACkey     Key to be used for HMACing
> > - *          For OIAP use key.authUsage or PersistStore.ownerAuth
> > - *          For OSAP use NULL (It will be aquired from the Auth Session)
> > - *          If unknown (default), assume OIAP
> > - *    sessionAuth    A TCS_AUTH info for the session
> > - *    pAuth     Authorization information from the application
> > - *              hContext        If specified, on failed Auth, VerifyAuth will
> > - *                                      generate a new OIAP session in place of themselves
> > - *                                      destroyed session.
> > - *
> > - * Return:  TPM_SUCCESS   Authorization Verified
> > - *    TPM_AUTHFAIL   Authorization Failed
> > - *    TPM_FAIL    Failure during SHA1 routines
> > - *************************************************************************************/
> > -TPM_RESULT VerifyAuth( /*[IN]*/ const BYTE *outParamDigestText,
> > -                      /*[IN]*/ UINT32 outParamDigestTextSize,
> > -                      /*[IN]*/ const TPM_SECRET *HMACkey,
> > -                      /*[IN,OUT]*/ TCS_AUTH *auth,
> > -                      /*[IN]*/  TCS_CONTEXT_HANDLE hContext) {
> > -  if (outParamDigestText == NULL || auth == NULL)
> > -    return (TPM_AUTHFAIL);
> > -
> > -
> > -  // Create SHA1 inParamDigest
> > -  TPM_DIGEST outParamDigest;
> > -  Crypto_SHA1Full(outParamDigestText, outParamDigestTextSize, (BYTE *) &outParamDigest);
> > -
> > -  // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
> > -  TPM_DIGEST hm;
> > -  BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
> > -
> > -  BSG_PackList(   hmacText, 4,
> > -                 BSG_TPM_DIGEST, &outParamDigest,
> > -                 BSG_TPM_NONCE, &(auth->NonceEven),
> > -                 BSG_TPM_NONCE, &(auth->NonceOdd),
> > -                 BSG_TYPE_BOOL, &(auth->fContinueAuthSession) );
> > -
> > -  Crypto_HMAC((BYTE *) hmacText, sizeof(hmacText),
> > -             (BYTE *) HMACkey, sizeof(TPM_DIGEST), (BYTE *) &hm);
> > -
> > -  // Compare correct HMAC with provided one.
> > -  if (memcmp (&hm, &(auth->HMAC), sizeof(TPM_DIGEST)) == 0) { // 0 indicates equality
> > -    if (!auth->fContinueAuthSession)
> > -      vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM by fContinue=0.\n", auth->AuthHandle);
> > -
> > -    return (TPM_SUCCESS);
> > -  } else {
> > -    // If specified, reconnect the OIAP session.
> > -    // NOTE: This only works for TCS's that never have a 0 context.
> > -    if (hContext) {
> > -      vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM due to failure.\n", auth->AuthHandle);
> > -      VTSP_OIAP( hContext, auth);
> > -    }
> > -    return (TPM_AUTHFAIL);
> > -  }
> > -}
> > -
> > -TPM_RESULT VTSP_OIAP(const TCS_CONTEXT_HANDLE hContext,
> > -                    TCS_AUTH *auth) {
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "OIAP.\n");
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPMTRYRETURN( TCSP_OIAP(hContext,
> > -                         &auth->AuthHandle,
> > -                         &auth->NonceEven) );
> > -
> > -  memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
> > -  auth->fContinueAuthSession = FALSE;
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x opened by TPM_OIAP.\n", auth->AuthHandle);
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTSP_OSAP(const TCS_CONTEXT_HANDLE hContext,
> > -                    const TPM_ENTITY_TYPE entityType,
> > -                    const UINT32 entityValue,
> > -                    const TPM_AUTHDATA *usageAuth,
> > -                    TPM_SECRET *sharedSecret,
> > -                    TCS_AUTH *auth) {
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "OSAP.\n");
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_NONCE nonceEvenOSAP, nonceOddOSAP;
> > -
> > -  Crypto_GetRandom((BYTE *) &nonceOddOSAP, sizeof(TPM_NONCE) );
> > -
> > -  TPMTRYRETURN( TCSP_OSAP(    hContext,
> > -                             entityType,
> > -                             entityValue,
> > -                             nonceOddOSAP,
> > -                             &auth->AuthHandle,
> > -                             &auth->NonceEven,
> > -                             &nonceEvenOSAP) );
> > -
> > -  // Calculating Session Secret
> > -  BYTE sharedSecretText[TPM_DIGEST_SIZE * 2];
> > -
> > -  BSG_PackList(  sharedSecretText, 2,
> > -                BSG_TPM_NONCE, &nonceEvenOSAP,
> > -                BSG_TPM_NONCE, &nonceOddOSAP);
> > -
> > -  Crypto_HMAC(sharedSecretText, sizeof(sharedSecretText), (BYTE *) usageAuth, TPM_DIGEST_SIZE, (BYTE *) sharedSecret);
> > -
> > -  memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
> > -  auth->fContinueAuthSession = FALSE;
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x opened by TPM_OSAP.\n", auth->AuthHandle);
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -
> > -TPM_RESULT VTSP_TerminateHandle(const TCS_CONTEXT_HANDLE hContext,
> > -                                const TCS_AUTH *auth) {
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Terminate Handle.\n");
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPMTRYRETURN( TCSP_TerminateHandle(hContext, auth->AuthHandle) );
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM_TerminateHandle.\n", auth->AuthHandle);
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -
> > -TPM_RESULT VTSP_ReadPubek(   const TCS_CONTEXT_HANDLE hContext,
> > -                             CRYPTO_INFO *crypto_info) {
> > -
> > -  TPM_RESULT status;
> > -  TPM_NONCE antiReplay;
> > -  TPM_DIGEST   checksum;
> > -  BYTE *pubEKtext;
> > -  UINT32 pubEKtextsize;
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Reading Public EK.\n");
> > -
> > -  // GenerateAuth new nonceOdd
> > -  Crypto_GetRandom(&antiReplay, sizeof(TPM_NONCE) );
> > -
> > -
> > -  TPMTRYRETURN( TCSP_ReadPubek(  hContext,
> > -                                antiReplay,
> > -                                &pubEKtextsize,
> > -                                &pubEKtext,
> > -                                &checksum) );
> > -
> > -
> > -  // Extract the remaining output parameters
> > -  TPM_PUBKEY pubEK;
> > -
> > -  BSG_Unpack(BSG_TPM_PUBKEY, pubEKtext, (BYTE *) &pubEK);
> > -
> > -  // Build CryptoInfo for the bindingKey
> > -  TPM_RSA_KEY_PARMS rsaKeyParms;
> > -
> > -  BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
> > -            pubEK.algorithmParms.parms,
> > -            &rsaKeyParms);
> > -
> > -  Crypto_RSABuildCryptoInfoPublic(rsaKeyParms.exponentSize,
> > -                                 rsaKeyParms.exponent,
> > -                                 pubEK.pubKey.keyLength,
> > -                                 pubEK.pubKey.key,
> > -                                 crypto_info);
> > -
> > -  // Destroy rsaKeyParms
> > -  BSG_Destroy(BSG_TPM_RSA_KEY_PARMS, &rsaKeyParms);
> > -
> > -  // Set encryption scheme
> > -  crypto_info->encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
> > -  //crypto_info->encScheme = pubEK.algorithmParms.encScheme;
> > -  crypto_info->algorithmID = pubEK.algorithmParms.algorithmID;
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTSP_TakeOwnership(   const TCS_CONTEXT_HANDLE hContext,
> > -                                 const TPM_AUTHDATA *ownerAuth,
> > -                                 const TPM_AUTHDATA *srkAuth,
> > -                                 CRYPTO_INFO *ek_cryptoInfo,
> > -                                 TCS_AUTH *auth) {
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Taking Ownership of TPM.\n");
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_COMMAND_CODE command = TPM_ORD_TakeOwnership;
> > -  TPM_PROTOCOL_ID proto_id = TPM_PID_OWNER;
> > -  BYTE *new_srk;
> > -
> > -  BYTE *paramText;        // Digest to make Auth.
> > -  UINT32 paramTextSize;
> > -
> > -  // vars for srkpubkey parameter
> > -  TPM_KEY srkPub;
> > -  TPM_KEY_PARMS srkKeyInfo = {TPM_ALG_RSA, TPM_ES_RSAESOAEP_SHA1_MGF1, TPM_SS_NONE, 12, 0};
> > -  BYTE srkRSAkeyInfo[12] = { 0x00, 0x00, (RSA_KEY_SIZE >> 8), 0x00,   0x00, 0x00, 0x00, 0x02,   0x00, 0x00, 0x00, 0x00};
> > -  srkKeyInfo.parms = (BYTE *) &srkRSAkeyInfo;
> > -
> > -  struct pack_buf_t srkText;
> > -
> > -  //These values are accurate for an enc(AuthData).
> > -  struct pack_buf_t encOwnerAuth, encSrkAuth;
> > -
> > -  encOwnerAuth.data = (BYTE *)malloc(sizeof(BYTE) * 256);
> > -  encSrkAuth.data = (BYTE *)malloc(sizeof(BYTE) * 256);
> > -
> > -  if (encOwnerAuth.data == NULL || encSrkAuth.data == NULL) {
> > -    vtpmloginfo(VTPM_LOG_VTSP, "Could not malloc encrypted auths.\n");
> > -    status = TPM_RESOURCES;
> > -    goto abort_egress;
> > -  }
> > -
> > -  Crypto_RSAEnc(ek_cryptoInfo, sizeof(TPM_SECRET), (BYTE *) ownerAuth, &encOwnerAuth.size, encOwnerAuth.data);
> > -  Crypto_RSAEnc(ek_cryptoInfo, sizeof(TPM_SECRET), (BYTE *) srkAuth, &encSrkAuth.size, encSrkAuth.data);
> > -
> > -
> > -  // Build srk public key struct
> > -  srkPub.ver = TPM_STRUCT_VER_1_1;
> > -  srkPub.keyUsage = TPM_KEY_STORAGE;
> > -  srkPub.keyFlags = 0x00;
> > -  srkPub.authDataUsage = TPM_AUTH_ALWAYS;
> > -  memcpy(&srkPub.algorithmParms, &srkKeyInfo, sizeof(TPM_KEY_PARMS));
> > -  srkPub.PCRInfoSize = 0;
> > -  srkPub.PCRInfo = 0;
> > -  srkPub.pubKey.keyLength= 0;
> > -  srkPub.encDataSize = 0;
> > -
> > -  srkText.data = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> > -  srkText.size = BSG_Pack(BSG_TPM_KEY, (BYTE *) &srkPub, srkText.data);
> > -
> > -  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> > -
> > -  paramTextSize = BSG_PackList(paramText, 5,
> > -                              BSG_TPM_COMMAND_CODE,&command,
> > -                              BSG_TPM_PROTOCOL_ID, &proto_id,
> > -                              BSG_TPM_SIZE32_DATA, &encOwnerAuth,
> > -                              BSG_TPM_SIZE32_DATA, &encSrkAuth,
> > -                              BSG_TPM_KEY, &srkPub);
> > -
> > -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize, ownerAuth, auth) );
> > -
> > -  new_srk = srkText.data;
> > -  TPMTRYRETURN( TCSP_TakeOwnership ( hContext,
> > -                                    proto_id,
> > -                                    encOwnerAuth.size,
> > -                                    encOwnerAuth.data,
> > -                                    encSrkAuth.size,
> > -                                    encSrkAuth.data,
> > -                                    &srkText.size,
> > -                                    &new_srk,
> > -                                    auth ) );
> > -
> > -
> > -  paramTextSize = BSG_PackList(paramText, 2,
> > -                              BSG_TPM_RESULT, &status,
> > -                              BSG_TPM_COMMAND_CODE, &command);
> > -  memcpy(paramText + paramTextSize, new_srk, srkText.size);
> > -  paramTextSize += srkText.size;
> > -
> > -
> > -  TPMTRYRETURN( VerifyAuth(  paramText, paramTextSize,
> > -                            ownerAuth, auth,
> > -                            hContext) );
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  free(srkText.data);
> > -  free(encSrkAuth.data);
> > -  free(encOwnerAuth.data);
> > -  free(paramText);
> > -
> > -  TCS_FreeMemory(hContext, new_srk);
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTSP_DisablePubekRead( const TCS_CONTEXT_HANDLE    hContext,
> > -                                  const TPM_AUTHDATA          *ownerAuth,
> > -                                  TCS_AUTH                    *auth) {
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Disabling Pubek Read.\n");
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_COMMAND_CODE command = TPM_ORD_DisablePubekRead;
> > -
> > -  BYTE *paramText;        // Digest to make Auth.
> > -  UINT32 paramTextSize;
> > -
> > -  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> > -
> > -  paramTextSize = BSG_PackList(paramText, 1,
> > -                              BSG_TPM_COMMAND_CODE, &command);
> > -
> > -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> > -                             ownerAuth, auth) );
> > -
> > -  // Call TCS
> > -  TPMTRYRETURN( TCSP_DisablePubekRead ( hContext, // in
> > -                                        auth) );
> > -
> > -  // Verify Auth
> > -  paramTextSize = BSG_PackList(paramText, 2,
> > -                              BSG_TPM_RESULT, &status,
> > -                              BSG_TPM_COMMAND_CODE, &command);
> > -
> > -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> > -                           ownerAuth, auth,
> > -                           hContext) );
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -  free(paramText);
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTSP_CreateWrapKey(  const TCS_CONTEXT_HANDLE hContext,
> > -                                const TPM_KEY_USAGE      usage,
> > -                                const TPM_AUTHDATA       *newKeyAuth,
> > -                                const TCS_KEY_HANDLE     parentHandle,
> > -                                const TPM_AUTHDATA       *osapSharedSecret,
> > -                                buffer_t                 *pubKeyBuf,
> > -                                TCS_AUTH                 *auth) {
> > -
> > -  int i;
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_COMMAND_CODE command = TPM_ORD_CreateWrapKey;
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Creating new key of type %d.\n", usage);
> > -
> > -  // vars for Calculate encUsageAuth
> > -  BYTE *paramText;
> > -  UINT32 paramTextSize;
> > -
> > -  // vars for Calculate encUsageAuth
> > -  BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
> > -  TPM_DIGEST XORKey1;
> > -  UINT32 XORbufferSize;
> > -  TPM_SECRET encUsageAuth, encMigrationAuth;
> > -
> > -  // vars for Flatten newKey prototype
> > -  BYTE *flatKey = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> > -  UINT32 flatKeySize = TCPA_MAX_BUFFER_LENGTH;
> > -  struct pack_buf_t newKeyText;
> > -
> > -  // Fill in newKey
> > -  TPM_KEY newKey;
> > -
> > -  BYTE RSAkeyInfo[12] = { 0x00, 0x00, (RSA_KEY_SIZE >> 8), 0x00,   0x00, 0x00, 0x00, 0x02,   0x00, 0x00, 0x00, 0x00};
> > -  newKey.algorithmParms.algorithmID = TPM_ALG_RSA;
> > -  newKey.algorithmParms.parms = (BYTE *) &RSAkeyInfo;
> > -  newKey.algorithmParms.parmSize = 12;
> > -
> > -  switch (usage) {
> > -  case TPM_KEY_SIGNING:
> > -    vtpmloginfo(VTPM_LOG_VTSP, "Creating Signing Key...\n");
> > -    newKey.keyUsage = TPM_KEY_SIGNING;
> > -    newKey.algorithmParms.encScheme = TPM_ES_NONE;
> > -    newKey.algorithmParms.sigScheme = TPM_SS_RSASSAPKCS1v15_SHA1;
> > -    break;
> > -  case TPM_KEY_STORAGE:
> > -    vtpmloginfo(VTPM_LOG_VTSP, "Creating Storage Key...\n");
> > -    newKey.keyUsage = TPM_KEY_STORAGE;
> > -    newKey.algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
> > -    newKey.algorithmParms.sigScheme = TPM_SS_NONE;
> > -    break;
> > -  case TPM_KEY_BIND:
> > -    vtpmloginfo(VTPM_LOG_VTSP, "Creating Binding Key...\n");
> > -    newKey.keyUsage = TPM_KEY_BIND;
> > -    newKey.algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
> > -    newKey.algorithmParms.sigScheme = TPM_SS_NONE;
> > -    break;
> > -  default:
> > -    vtpmloginfo(VTPM_LOG_VTSP, "Cannot create key. Invalid Key Type.\n");
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -
> > -  newKey.ver = TPM_STRUCT_VER_1_1;
> > -
> > -  newKey.keyFlags = 0;
> > -  newKey.authDataUsage = TPM_AUTH_ALWAYS;
> > -  newKey.pubKey.keyLength= 0;
> > -  newKey.encDataSize = 0;
> > -  newKey.encData = NULL;
> > -
> > -  // FIXME: Support PCR bindings
> > -  newKey.PCRInfoSize = 0;
> > -  newKey.PCRInfo = NULL;
> > -
> > -  // Calculate encUsageAuth
> > -  XORbufferSize = BSG_PackList(  XORbuffer, 2,
> > -                                BSG_TPM_SECRET, osapSharedSecret,
> > -                                BSG_TPM_NONCE, &auth->NonceEven);
> > -  Crypto_SHA1Full(XORbuffer, XORbufferSize, (BYTE *) &XORKey1);
> > -
> > -  // FIXME: No support for migratable keys.
> > -  for (i=0; i < TPM_DIGEST_SIZE; i++)
> > -    ((BYTE *) &encUsageAuth)[i] = ((BYTE *) &XORKey1)[i] ^ ((BYTE *) newKeyAuth)[i];
> > -
> > -  // Flatten newKey prototype
> > -  flatKeySize = BSG_Pack(BSG_TPM_KEY, (BYTE *) &newKey, flatKey);
> > -  newKeyText.data = flatKey;
> > -  newKeyText.size = flatKeySize;
> > -
> > -  // Generate HMAC
> > -  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> > -
> > -  paramTextSize = BSG_PackList(paramText, 3,
> > -                              BSG_TPM_COMMAND_CODE, &command,
> > -                              BSG_TPM_AUTHDATA, &encUsageAuth,
> > -                              BSG_TPM_AUTHDATA, &encMigrationAuth);
> > -  memcpy(paramText + paramTextSize, newKeyText.data, newKeyText.size);
> > -  paramTextSize += newKeyText.size;
> > -
> > -
> > -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> > -                             osapSharedSecret, auth) );
> > -
> > -  // Call TCS
> > -  TPMTRYRETURN( TCSP_CreateWrapKey(  hContext,
> > -                                    parentHandle,
> > -                                    encUsageAuth,
> > -                                    encMigrationAuth,
> > -                                    &newKeyText.size,
> > -                                    &newKeyText.data,
> > -                                    auth) );
> > -
> > -  // Verify Auth
> > -  paramTextSize = BSG_PackList(paramText, 2,
> > -                              BSG_TPM_RESULT, &status,
> > -                              BSG_TPM_COMMAND_CODE, &command);
> > -  memcpy(paramText + paramTextSize, newKeyText.data, newKeyText.size);
> > -  paramTextSize += newKeyText.size;
> > -
> > -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> > -                           osapSharedSecret, auth, 0) );
> > -
> > -  // Unpack/return key structure
> > -  TPMTRYRETURN(buffer_init(pubKeyBuf, 0, 0) );
> > -  TPMTRYRETURN(buffer_append_raw(pubKeyBuf, newKeyText.size, newKeyText.data) );
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  free(flatKey);
> > -  free(paramText);
> > -  TCS_FreeMemory(hContext, newKeyText.data);
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTSP_LoadKey(const TCS_CONTEXT_HANDLE    hContext,
> > -                        const TCS_KEY_HANDLE        hUnwrappingKey,
> > -                        const buffer_t              *rgbWrappedKeyBlob,
> > -                        const TPM_AUTHDATA          *parentAuth,
> > -                        TPM_HANDLE                  *newKeyHandle,
> > -                        TCS_AUTH                    *auth,
> > -                        CRYPTO_INFO                 *cryptoinfo,
> > -                        const BOOL                  skipTPMLoad) {
> > -
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Loading Key %s.\n", (!skipTPMLoad ? "into TPM" : "only into memory"));
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_COMMAND_CODE command = TPM_ORD_LoadKey;
> > -
> > -  BYTE *paramText=NULL;        // Digest to make Auth.
> > -  UINT32 paramTextSize;
> > -
> > -  // SkipTPMLoad stops key from being loaded into TPM, but still generates CRYPTO_INFO for it
> > -  if (! skipTPMLoad) {
> > -
> > -    if ((rgbWrappedKeyBlob == NULL) || (parentAuth == NULL) ||
> > -        (newKeyHandle==NULL) || (auth==NULL)) {
> > -      status = TPM_BAD_PARAMETER;
> > -      goto abort_egress;
> > -    }
> > -
> > -    // Generate Extra TCS Parameters
> > -    TPM_HANDLE phKeyHMAC;
> > -
> > -    paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> > -
> > -    paramTextSize = BSG_PackList(paramText, 1,
> > -                                BSG_TPM_COMMAND_CODE, &command);
> > -
> > -    memcpy(paramText + paramTextSize, rgbWrappedKeyBlob->bytes, buffer_len(rgbWrappedKeyBlob));
> > -    paramTextSize += buffer_len(rgbWrappedKeyBlob);
> > -
> > -    TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> > -                             parentAuth, auth) );
> > -
> > -    // Call TCS
> > -    TPMTRYRETURN( TCSP_LoadKeyByBlob(  hContext,
> > -                                      hUnwrappingKey,
> > -                                      buffer_len(rgbWrappedKeyBlob),
> > -                                      rgbWrappedKeyBlob->bytes,
> > -                                      auth,
> > -                                      newKeyHandle,
> > -                                      &phKeyHMAC) );
> > -
> > -    // Verify Auth
> > -    paramTextSize = BSG_PackList(paramText, 3,
> > -                                BSG_TPM_RESULT, &status,
> > -                                BSG_TPM_COMMAND_CODE, &command,
> > -                                BSG_TPM_HANDLE, newKeyHandle);
> > -
> > -    TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> > -                             parentAuth, auth,
> > -                             hContext) );
> > -  }
> > -
> > -  // Build cryptoinfo structure for software crypto function.
> > -  if (cryptoinfo != NULL) {
> > -    TPM_KEY newKey;
> > -
> > -    // Unpack/return key structure
> > -    BSG_Unpack(BSG_TPM_KEY, rgbWrappedKeyBlob->bytes , &newKey);
> > -    TPM_RSA_KEY_PARMS rsaKeyParms;
> > -
> > -    BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
> > -              newKey.algorithmParms.parms,
> > -              &rsaKeyParms);
> > -
> > -    Crypto_RSABuildCryptoInfoPublic(rsaKeyParms.exponentSize,
> > -                                   rsaKeyParms.exponent,
> > -                                   newKey.pubKey.keyLength,
> > -                                   newKey.pubKey.key,
> > -                                   cryptoinfo);
> > -
> > -    // Destroy rsaKeyParms
> > -    BSG_Destroy(BSG_TPM_RSA_KEY_PARMS, &rsaKeyParms);
> > -
> > -    // Set encryption scheme
> > -    cryptoinfo->encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
> > -  }
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  free(paramText);
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTSP_Unbind( const TCS_CONTEXT_HANDLE    hContext,
> > -                        const TPM_KEY_HANDLE        key_handle,
> > -                        const buffer_t              *bound_data,
> > -                        const TPM_AUTHDATA          *usage_auth,
> > -                        buffer_t                    *clear_data,
> > -                        TCS_AUTH                    *auth) {
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Unbinding %d bytes of data.\n", buffer_len(bound_data));
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_COMMAND_CODE command = TPM_ORD_UnBind;
> > -
> > -  BYTE *paramText;        // Digest to make Auth.
> > -  UINT32 paramTextSize;
> > -
> > -  // Generate Extra TCS Parameters
> > -  struct pack_buf_t clear_data32;
> > -  BYTE *clear_data_text;
> > -  UINT32 clear_data_size;
> > -
> > -  struct pack_buf_t bound_data32 = {bound_data->size, bound_data->bytes};
> > -
> > -  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> > -
> > -  paramTextSize = BSG_PackList(paramText, 2,
> > -                              BSG_TPM_COMMAND_CODE, &command,
> > -                              BSG_TPM_SIZE32_DATA, &bound_data32);
> > -
> > -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> > -                             usage_auth, auth) );
> > -
> > -  // Call TCS
> > -  TPMTRYRETURN( TCSP_UnBind( hContext,
> > -                            key_handle,
> > -                            buffer_len(bound_data),
> > -                            bound_data->bytes,
> > -                            auth,
> > -                            &clear_data_size,
> > -                            &clear_data_text) );
> > -
> > -
> > -  // Verify Auth
> > -  clear_data32.size = clear_data_size;
> > -  clear_data32.data = clear_data_text;
> > -  paramTextSize = BSG_PackList(paramText, 3,
> > -                              BSG_TPM_RESULT, &status,
> > -                              BSG_TPM_COMMAND_CODE, &command,
> > -                              BSG_TPM_SIZE32_DATA, &clear_data32);
> > -
> > -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> > -                           usage_auth, auth,
> > -                           hContext) );
> > -
> > -  // Unpack/return key structure
> > -  TPMTRYRETURN(buffer_init(clear_data, 0, 0));
> > -  TPMTRYRETURN(buffer_append_raw (clear_data, clear_data_size, clear_data_text) );
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  free(paramText);
> > -  TCS_FreeMemory(hContext, clear_data_text);
> > -
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTSP_Bind(   CRYPTO_INFO *cryptoInfo,
> > -                       const buffer_t *inData,
> > -                       buffer_t *outData)
> > -{
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Binding %d bytes of data.\n", buffer_len(inData));
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_BOUND_DATA boundData;
> > -  UINT32 i;
> > -
> > -  // Fill boundData's accessory information
> > -  boundData.ver = TPM_STRUCT_VER_1_1;
> > -  boundData.payload = TPM_PT_BIND;
> > -  boundData.payloadData = inData->bytes;
> > -
> > -  // Pack boundData before encryption
> > -  BYTE* flatBoundData = (BYTE *)malloc(sizeof(BYTE) *
> > -                                      (sizeof(TPM_VERSION) +
> > -                                       sizeof(TPM_PAYLOAD_TYPE) +
> > -                                       buffer_len(inData)));
> > -  if (flatBoundData == NULL) {
> > -    return TPM_NOSPACE;
> > -  }
> > -  UINT32 flatBoundDataSize = 0;
> > -  flatBoundDataSize = BSG_PackList(  flatBoundData, 2,
> > -                                    BSG_TPM_VERSION, &boundData.ver,
> > -                                    BSG_TYPE_BYTE, &boundData.payload);
> > -
> > -  memcpy(flatBoundData+flatBoundDataSize, inData->bytes, buffer_len(inData));
> > -  flatBoundDataSize += buffer_len(inData);
> > -
> > -  BYTE out_tmp[RSA_KEY_SIZE/8]; // RSAEnc does not do blocking, So this is what will come out.
> > -  UINT32 out_tmp_size;
> > -
> > -  // Encrypt flatBoundData
> > -  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_RSAEnc( cryptoInfo,
> > -                                           flatBoundDataSize,
> > -                                           flatBoundData,
> > -                                           &out_tmp_size,
> > -                                           out_tmp) );
> > -
> > -  if (out_tmp_size > RSA_KEY_SIZE/8) {
> > -    // The result of RSAEnc should be a fixed size based on key size.
> > -    vtpmlogerror(VTPM_LOG_VTSP, "Enc buffer just overflowed.\n");
> > -  }
> > -
> > -  buffer_init(outData, 0, NULL);
> > -  buffer_append_raw(outData, out_tmp_size, out_tmp);
> > -
> > -  vtpmloginfo(VTPM_LOG_TXDATA, "Bind Generated[%d] = 0x", out_tmp_size);
> > -  for(i = 0 ; i < out_tmp_size ; i++) {
> > -    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out_tmp[i]);
> > -  }
> > -  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> > -
> > -  goto egress;
> > -  abort_egress:
> > -  egress:
> > -
> > -  // Free flatBoundData
> > -  free(flatBoundData);
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -TPM_RESULT VTSP_Seal(const TCS_CONTEXT_HANDLE    hContext,
> > -                     const TPM_KEY_HANDLE        keyHandle,
> > -                     const TPM_AUTHDATA          *sealDataAuth,
> > -                     const TPM_PCR_COMPOSITE     *pcrComp,
> > -                     const buffer_t              *inData,
> > -                     TPM_STORED_DATA             *sealedData,
> > -                     const TPM_SECRET            *osapSharedSecret,
> > -                     TCS_AUTH                    *auth) {
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_COMMAND_CODE command = TPM_ORD_Seal;
> > -
> > -  BYTE *paramText;        // Digest to make Auth.
> > -  UINT32 paramTextSize;
> > -
> > -  // Generate PCR_Info Struct from Comp
> > -  TPM_PCR_INFO pcrInfo;
> > -  UINT32 pcrInfoSize, flatpcrSize;
> > -  BYTE flatpcr[3 +                          // PCR_Select = 3 1 byte banks
> > -               sizeof(UINT16) +             //              2 byte UINT16
> > -               sizeof(UINT32) +             // PCR_Comp   = 4 byte UINT32
> > -               24 * sizeof(TPM_PCRVALUE) ]; //              up to 24 PCRs
> > -
> > -  if (pcrComp != NULL) {
> > -      //printf("\n\tBinding to PCRs: ");
> > -      //for(int i = 0 ; i < pcrComp->select.sizeOfSelect ; i++)
> > -      //printf("%2.2x", pcrComp->select.pcrSelect[i]);
> > -
> > -      memcpy(&pcrInfo.pcrSelection, &pcrComp->select, sizeof(TPM_PCR_SELECTION));
> > -
> > -      flatpcrSize = BSG_Pack(BSG_TPM_PCR_COMPOSITE, (BYTE *) pcrComp, flatpcr);
> > -      Crypto_SHA1Full((BYTE *) flatpcr, flatpcrSize, (BYTE *) &(pcrInfo.digestAtRelease));
> > -      memset(&(pcrInfo.digestAtCreation), 0, sizeof(TPM_DIGEST));
> > -      pcrInfoSize = BSG_Pack(BSG_TPM_PCR_INFO, (BYTE *) &pcrInfo, flatpcr);
> > -  } else {
> > -      //printf("\n\tBinding to no PCRS.");
> > -      pcrInfoSize = 0;
> > -  }
> > -
> > -  // Calculate encUsageAuth
> > -  BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
> > -  UINT32 XORbufferSize = sizeof(XORbuffer);
> > -  TPM_DIGEST XORKey;
> > -  TPM_ENCAUTH encAuth;
> > -
> > -  BSG_PackList( XORbuffer, 2,
> > -                BSG_TPM_SECRET, osapSharedSecret,
> > -                BSG_TPM_NONCE, &auth->NonceEven );
> > -
> > -  Crypto_SHA1Full(XORbuffer, XORbufferSize, (BYTE *) &XORKey);
> > -
> > -  int i;
> > -  for (i=0; i < TPM_DIGEST_SIZE; i++)
> > -    ((BYTE *) &encAuth)[i] = ((BYTE *) &XORKey)[i] ^ ((BYTE *) sealDataAuth)[i];
> > -
> > -  // Generate Extra TCS Parameters
> > -  UINT32 inDataSize = buffer_len(inData);
> > -  struct pack_buf_t inData_pack = {inDataSize, inData->bytes};
> > -  struct pack_buf_t pcrInfo_pack = {pcrInfoSize, flatpcr};
> > -
> > -  UINT32 sealedDataSize;
> > -  BYTE *flatSealedData=NULL;
> > -
> > -  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> > -
> > -  paramTextSize = BSG_PackList(paramText, 4,
> > -                               BSG_TPM_COMMAND_CODE, &command,
> > -                               BSG_TPM_ENCAUTH, &encAuth,
> > -                               BSG_TPM_SIZE32_DATA, &pcrInfo_pack,
> > -                               BSG_TPM_SIZE32_DATA, &inData_pack);
> > -
> > -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> > -                              osapSharedSecret, auth) );
> > -
> > -  // Call TCS
> > -  TPMTRYRETURN( TCSP_Seal( hContext,
> > -                           keyHandle,
> > -                           encAuth,
> > -                           pcrInfoSize,
> > -                           flatpcr,
> > -                           inDataSize,
> > -                           inData->bytes,
> > -                           auth,
> > -                           &sealedDataSize,
> > -                           &flatSealedData) );
> > -
> > -  // Unpack/return key structure
> > -  BSG_Unpack( BSG_TPM_STORED_DATA, flatSealedData, sealedData );
> > -
> > -  paramTextSize = BSG_PackList(paramText, 3,
> > -                               BSG_TPM_RESULT, &status,
> > -                               BSG_TPM_COMMAND_CODE, &command,
> > -                               BSG_TPM_STORED_DATA, sealedData);
> > -
> > -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> > -                            osapSharedSecret, auth,
> > -                            0) );
> > -
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  if (flatSealedData)
> > -    TCS_FreeMemory( hContext, flatSealedData);
> > -
> > -  free(paramText);
> > -  return status;
> > -}
> > -
> > -
> > -TPM_RESULT VTSP_Unseal(const TCS_CONTEXT_HANDLE    hContext,
> > -                       const TPM_KEY_HANDLE        keyHandle,
> > -                       const TPM_STORED_DATA       *sealedData,
> > -                       const TPM_AUTHDATA          *key_usage_auth,
> > -                       const TPM_AUTHDATA          *data_usage_auth,
> > -                       buffer_t                    *outData,
> > -                       TCS_AUTH                    *auth,
> > -                       TCS_AUTH                    *dataAuth) {
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TPM_COMMAND_CODE command = TPM_ORD_Unseal;
> > -
> > -  BYTE *paramText;        // Digest to make Auth.
> > -  UINT32 paramTextSize;
> > -
> > -  // Generate Extra TCS Parameters
> > -  UINT32 sealDataSize, clearDataSize;
> > -  BYTE *flatSealedData= (BYTE *) malloc(sizeof(TPM_VERSION) +
> > -                                        2 * sizeof(UINT32) +
> > -                                        sealedData->sealInfoSize +
> > -                                        sealedData->encDataSize),
> > -       *clearData=NULL;
> > -
> > -  sealDataSize = BSG_Pack(BSG_TPM_STORED_DATA, sealedData, flatSealedData );
> > -
> > -  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> > -
> > -  paramTextSize = BSG_PackList(paramText, 2,
> > -                               BSG_TPM_COMMAND_CODE, &command,
> > -                               BSG_TPM_STORED_DATA, sealedData);
> > -
> > -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> > -                              key_usage_auth, auth) );
> > -
> > -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> > -                              data_usage_auth, dataAuth) );
> > -  // Call TCS
> > -  TPMTRYRETURN( TCSP_Unseal(  hContext,
> > -                              keyHandle,
> > -                              sealDataSize,
> > -                              flatSealedData,
> > -                              auth,
> > -                              dataAuth,
> > -                              &clearDataSize,
> > -                              &clearData) );
> > -
> > -  // Verify Auth
> > -  struct pack_buf_t clearData_pack = {clearDataSize, clearData};
> > -
> > -  paramTextSize = BSG_PackList(paramText, 3,
> > -                               BSG_TPM_RESULT, &status,
> > -                               BSG_TPM_COMMAND_CODE, &command,
> > -                               BSG_TPM_SIZE32_DATA, &clearData_pack);
> > -
> > -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> > -                            key_usage_auth, auth,
> > -                            hContext) );
> > -
> > -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> > -                            data_usage_auth, dataAuth,
> > -                            hContext) );
> > -
> > -  // Unpack/return key structure
> > -  TPMTRYRETURN( buffer_init(outData, clearDataSize, clearData) );
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  if (flatSealedData)
> > -    TCS_FreeMemory( hContext, clearData);
> > -
> > -  free(paramText);
> > -  return status;
> > -}
> > -
> > -TPM_RESULT VTSP_SaveState( const TCS_CONTEXT_HANDLE    hContext) {
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Calling TPM_SaveState.\n");
> > -
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  // Call TCS
> > -  return ( TCSP_SaveState ( hContext ) );
> > -
> > -}
> > -
> > -
> > -// Function Reaches into unsupported TCS command, beware.
> > -TPM_RESULT VTSP_RawTransmit(const TCS_CONTEXT_HANDLE    hContext,
> > -                            const buffer_t *inbuf,
> > -                            buffer_t *outbuf ) {
> > -
> > -  vtpmloginfo(VTPM_LOG_VTSP, "Passthrough in use.\n");
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  // Generate Extra TCS Parameters
> > -  BYTE *resultText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> > -  UINT32 resultTextSize =  TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // Call TCS
> > -  TPMTRYRETURN( TCSP_RawTransmitData(buffer_len(inbuf), inbuf->bytes,
> > -                                    &resultTextSize, resultText) );
> > -
> > -  // Unpack/return key structure
> > -  TPMTRYRETURN(buffer_init (outbuf, resultTextSize, resultText) );
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -  TCS_FreeMemory(hContext, resultText);
> > -  free(resultText);
> > -  return status;
> > -}
> > diff --git a/tools/vtpm_manager/manager/vtsp.h b/tools/vtpm_manager/manager/vtsp.h
> > deleted file mode 100644
> > index 2fb0440..0000000
> > --- a/tools/vtpm_manager/manager/vtsp.h
> > +++ /dev/null
> > @@ -1,126 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtsp.h
> > -//
> > -//  Higher level interface to TCS.
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __VTSP_H__
> > -#define __VTSP_H__
> > -
> > -#include "tcg.h"
> > -#include "tcs.h"
> > -
> > -#define KEY_BUFFER_SIZE 2048
> > -
> > -TPM_RESULT VTSP_RawTransmit(const TCS_CONTEXT_HANDLE    hContext,
> > -                            const buffer_t *inbuf,
> > -                            buffer_t *outbuf );
> > -
> > -TPM_RESULT VTSP_OIAP(  const TCS_CONTEXT_HANDLE hContext,
> > -                       TCS_AUTH *auth);
> > -
> > -TPM_RESULT VTSP_OSAP(  const TCS_CONTEXT_HANDLE hContext,
> > -                       const TPM_ENTITY_TYPE entityType,
> > -                       const UINT32 entityValue,
> > -                       const TPM_AUTHDATA *usageAuth,
> > -                       TPM_SECRET *sharedsecret,
> > -                       TCS_AUTH *auth);
> > -
> > -TPM_RESULT VTSP_TerminateHandle(const TCS_CONTEXT_HANDLE hContext,
> > -                                const TCS_AUTH *auth);
> > -
> > -TPM_RESULT VTSP_ReadPubek(   const TCS_CONTEXT_HANDLE hContext,
> > -                             CRYPTO_INFO *cypto_info);
> > -
> > -TPM_RESULT VTSP_TakeOwnership(   const TCS_CONTEXT_HANDLE hContext,
> > -                                 const TPM_AUTHDATA *ownerAuth,
> > -                                 const TPM_AUTHDATA *srkAuth,
> > -                                 CRYPTO_INFO *ek_cryptoInfo,
> > -                                 TCS_AUTH *auth);
> > -
> > -TPM_RESULT VTSP_DisablePubekRead( const TCS_CONTEXT_HANDLE    hContext,
> > -                                  const TPM_AUTHDATA *ownerAuth,
> > -                                  TCS_AUTH                    *auth);
> > -
> > -TPM_RESULT VTSP_CreateWrapKey(  const TCS_CONTEXT_HANDLE hContext,
> > -                                const TPM_KEY_USAGE      usage,
> > -                                const TPM_AUTHDATA       *newKeyAuth,
> > -                                const TCS_KEY_HANDLE     parentHandle,
> > -                                const TPM_AUTHDATA       *osapSharedSecret,
> > -                                buffer_t                 *pubKeyBuf,
> > -                                TCS_AUTH                 *auth);
> > -
> > -TPM_RESULT VTSP_LoadKey(const TCS_CONTEXT_HANDLE    hContext,
> > -                        const TCS_KEY_HANDLE        hUnwrappingKey,
> > -                        const buffer_t              *rgbWrappedKeyBlob,
> > -                        const TPM_AUTHDATA          *parentAuth,
> > -                        TPM_HANDLE                  *newKeyHandle,
> > -                        TCS_AUTH                    *pAuth,
> > -                        CRYPTO_INFO                 *cryptoinfo,
> > -                        const BOOL                  skipTPMLoad);
> > -
> > -TPM_RESULT VTSP_Unbind( const TCS_CONTEXT_HANDLE    hContext,
> > -                        const TPM_KEY_HANDLE        key_handle,
> > -                        const buffer_t              *bound_data,
> > -                        const TPM_AUTHDATA          *usage_auth,
> > -                        buffer_t                    *clear_data,
> > -                        TCS_AUTH                    *auth);
> > -
> > -TPM_RESULT VTSP_Bind(   CRYPTO_INFO *cryptoInfo,
> > -            const buffer_t *inData,
> > -            buffer_t *outData);
> > -
> > -TPM_RESULT VTSP_Seal(const TCS_CONTEXT_HANDLE    hContext,
> > -                     const TPM_KEY_HANDLE        keyHandle,
> > -                     const TPM_AUTHDATA          *sealDataAuth,
> > -                     const TPM_PCR_COMPOSITE     *pcrComp,
> > -                     const buffer_t              *inData,
> > -                     TPM_STORED_DATA             *sealedData,
> > -                     const TPM_SECRET            *osapSharedSecret,
> > -                     TCS_AUTH                    *auth);
> > -
> > -TPM_RESULT VTSP_Unseal(const TCS_CONTEXT_HANDLE    hContext,
> > -                       const TPM_KEY_HANDLE        keyHandle,
> > -                       const TPM_STORED_DATA       *sealedData,
> > -                       const TPM_AUTHDATA          *key_usage_auth,
> > -                       const TPM_AUTHDATA          *data_usage_auth,
> > -                       buffer_t                    *outData,
> > -                       TCS_AUTH                    *auth,
> > -                       TCS_AUTH                    *dataAuth);
> > -
> > -TPM_RESULT VTSP_SaveState( const TCS_CONTEXT_HANDLE    hContext);
> > -
> > -#endif //_VTSP_H_
> > diff --git a/tools/vtpm_manager/migration/Makefile b/tools/vtpm_manager/migration/Makefile
> > deleted file mode 100644
> > index e33ae95..0000000
> > --- a/tools/vtpm_manager/migration/Makefile
> > +++ /dev/null
> > @@ -1,42 +0,0 @@
> > -XEN_ROOT = $(CURDIR)/../../..
> > -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> > -
> > -VPATH = ../manager
> > -
> > -BIND           = vtpm_migratord
> > -BINC           = vtpm_migrator
> > -
> > -SRCSD    = vtpm_manager_if.c vtpm_migratord.c vtpm_migratord_handler.c vtpm_ipc.c
> > -SRCSC    = vtpm_manager_if.c vtpm_migrator_if.c vtpm_migratorc.c vtpm_ipc.c
> > -
> > -OBJSD    = $(patsubst %.c,%.o,$(SRCSD))
> > -OBJSC    = $(patsubst %.c,%.o,$(SRCSC))
> > -
> > -.PHONY: all
> > -all: build
> > -
> > -.PHONY: build
> > -build: $(BIND) $(BINC)
> > -
> > -.PHONY: install
> > -install: build
> > -       $(INSTALL_PROG) $(BIND) $(DESTDIR)$(BINDIR)
> > -       $(INSTALL_PROG) $(BINC) $(DESTDIR)$(BINDIR)
> > -
> > -.PHONY: clean
> > -clean:
> > -       rm -f $(BINC) $(BIND)
> > -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> > -
> > -.PHONY: mrproper
> > -mrproper: clean
> > -       rm -f *~
> > -
> > -$(BIND): $(OBJSD)
> > -       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
> > -
> > -$(BINC): $(OBJSC)
> > -       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
> > -
> > -# libraries
> > -LIBS += ../util/libTCGUtils.a
> > diff --git a/tools/vtpm_manager/migration/vtpm_manager_if.c b/tools/vtpm_manager/migration/vtpm_manager_if.c
> > deleted file mode 100644
> > index 08986f4..0000000
> > --- a/tools/vtpm_manager/migration/vtpm_manager_if.c
> > +++ /dev/null
> > @@ -1,186 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_manager_if.c
> > -//
> > -//  Provides functions to call local vtpm manager interface (Hotplug)
> > -//
> > -// ==================================================================
> > -
> > -#include <stdio.h>
> > -#include <fcntl.h>
> > -#include <malloc.h>
> > -#include <string.h>
> > -
> > -#include "tcg.h"
> > -#include "buffer.h"
> > -#include "log.h"
> > -#include "vtpm_ipc.h"
> > -#include "bsg.h"
> > -#include "vtpm_migrator.h"
> > -#include "vtpm_manager.h"
> > -
> > -#define VTPM_TX_HP_FNAME       "/var/vtpm/fifos/from_console.fifo"
> > -#define VTPM_RX_HP_FNAME       "/var/vtpm/fifos/to_console.fifo"
> > -
> > -static vtpm_ipc_handle_t tx_ipc_h, rx_ipc_h;
> > -
> > -TPM_RESULT vtpm_manager_open(){
> > -
> > -  if ( (vtpm_ipc_init(&tx_ipc_h,  VTPM_TX_HP_FNAME, O_RDWR, TRUE) != 0) ||  //FIXME: wronly
> > -       (vtpm_ipc_init(&rx_ipc_h,  VTPM_RX_HP_FNAME, O_RDWR, TRUE) != 0) ) { //FIXME: rdonly
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to connect to vtpm_manager.\n");
> > -    return TPM_IOERROR;
> > -  }
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -void vtpm_manager_close() {
> > -
> > -  vtpm_ipc_close(&tx_ipc_h);
> > -  vtpm_ipc_close(&rx_ipc_h);
> > -}
> > -
> > -
> > -TPM_RESULT vtpm_manager_command(TPM_COMMAND_CODE ord,
> > -                                buffer_t *command_param_buf,
> > -                                TPM_RESULT *cmd_status, /* out */
> > -                                buffer_t *result_param_buf) {
> > -
> > -  TPM_RESULT status = TPM_FAIL;
> > -  int  size_read, size_write, i;
> > -  BYTE *adj_command, response_header[VTPM_COMMAND_HEADER_SIZE_SRV];
> > -  UINT32 dmi_id=0, adj_command_size, out_param_size, adj_param_size;
> > -  TPM_TAG tag=VTPM_TAG_REQ;
> > -
> > -  if ( (!command_param_buf) || (!result_param_buf) || (!cmd_status) ) {
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  adj_command_size = VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(command_param_buf);
> > -  adj_command = (BYTE *) malloc( adj_command_size );
> > -  if (!adj_command) {
> > -    status = TPM_RESOURCES;
> > -    goto abort_egress;
> > -  }
> > -
> > -  out_param_size = VTPM_COMMAND_HEADER_SIZE + buffer_len(command_param_buf);
> > -  BSG_PackList(adj_command, 4,
> > -                 BSG_TYPE_UINT32, &dmi_id,
> > -                 BSG_TPM_TAG, &tag,
> > -                 BSG_TYPE_UINT32, &out_param_size,
> > -                 BSG_TPM_COMMAND_CODE, &ord );
> > -
> > -  memcpy(adj_command + VTPM_COMMAND_HEADER_SIZE_SRV, command_param_buf->bytes, buffer_len(command_param_buf));
> > -
> > -  size_write = vtpm_ipc_write(&tx_ipc_h, NULL, adj_command, adj_command_size);
> > -
> > -  if (size_write > 0) {
> > -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT (MGR): 0x");
> > -    for (i=0; i< adj_command_size; i++) {
> > -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", adj_command[i]);
> > -    }
> > -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -  } else {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Error writing VTPM Manager console.\n");
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if (size_write != (int) adj_command_size )
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Could not write entire command to mgr (%d/%d)\n", size_write, adj_command_size);
> > -
> > -  // Read header for response to manager command
> > -  size_read = vtpm_ipc_read(&rx_ipc_h, NULL, response_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> > -  if (size_read > 0) {
> > -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV (MGR): 0x");
> > -    for (i=0; i<size_read; i++)
> > -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", response_header[i]);
> > -
> > -  } else {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Error reading from vtpm manager.\n");
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Command from vtpm_manager shorter than std header.\n");
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  // Unpack response from DMI for TPM command
> > -  BSG_UnpackList(response_header, 4,
> > -                 BSG_TYPE_UINT32, &dmi_id,
> > -                 BSG_TPM_TAG, &tag,
> > -                 BSG_TYPE_UINT32, &out_param_size,
> > -                 BSG_TPM_COMMAND_CODE, cmd_status );
> > -
> > -  // If response has parameters, read them.
> > -  // Note that out_param_size is in the client's context
> > -  adj_param_size = out_param_size - VTPM_COMMAND_HEADER_SIZE;
> > -  if (adj_param_size > 0) {
> > -    TPMTRYRETURN( buffer_init( result_param_buf, adj_param_size, NULL) );
> > -    size_read = vtpm_ipc_read(&rx_ipc_h, NULL, result_param_buf->bytes, adj_param_size);
> > -    if (size_read > 0) {
> > -      for (i=0; i< size_read; i++)
> > -        vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_param_buf->bytes[i]);
> > -
> > -    } else {
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Error reading from vtpm manager.\n");
> > -      goto abort_egress;
> > -    }
> > -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> > -
> > -    if (size_read < (int)adj_param_size) {
> > -      vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
> > -      status = TPM_IOERROR;
> > -      goto abort_egress;
> > -    }
> > -  } else {
> > -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> > -  }
> > -
> > -  status=TPM_SUCCESS;
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -
> > diff --git a/tools/vtpm_manager/migration/vtpm_migrator.h b/tools/vtpm_manager/migration/vtpm_migrator.h
> > deleted file mode 100644
> > index 8d52e66..0000000
> > --- a/tools/vtpm_manager/migration/vtpm_migrator.h
> > +++ /dev/null
> > @@ -1,104 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_migrator.h
> > -//
> > -//  Public Interface header for VTPM Migrator
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __VTPM_MIGRATOR_H__
> > -#define __VTPM_MIGRATOR_H__
> > -
> > -#define VTPM_MTAG_REQ 0x02c1
> > -#define VTPM_MTAG_RSP 0x02c4
> > -
> > -// Header sizes.
> > -#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
> > -//               sizeof(TPM_TAG + UINT32 + TPM_COMMAND_CODE)
> > -
> > -//*********************** Connection Info **************************
> > -#define VTPM_MIG_PORT 48879
> > -
> > -//************************ Command Codes ***************************
> > -#define VTPM_MORD_MIG_STEP1     0x00
> > -#define VTPM_MORD_MIG_STEP2     0x01
> > -#define VTPM_MORD_MIG_STEP3     0x02
> > -#define VTPM_MORD_MIG_STEP4     0x03
> > -
> > -//************************ Return Codes ****************************
> > -#define VTPM_SUCCESS               0
> > -#define VTPM_FAIL                  1
> > -
> > -/******************* Command Parameter API *************************
> > -
> > -VTPM Command Format
> > -  tpm tag: 2 bytes
> > -  command size: 4 bytes         // Size of command including header but not DMI
> > -  ord: 4 bytes                  // Command ordinal above
> > -  parameters: size - 10 bytes   // Command Parameter
> > -
> > -VTPM Response Format
> > -  tpm tag: 2 bytes
> > -  response_size: 4 bytes
> > -  status: 4 bytes
> > -  parameters: size - 10 bytes
> > -
> > -
> > -VTPM_Mig_Phase1:
> > -    Unsupported: (Handled by scripts)
> > -
> > -VTPM_Mig_Phase2
> > -  Input Parameters:
> > -    domain_name_size: 4 bytes
> > -    domain_name : domain_name_size bytes
> > -  Output Parameters:
> > -    pub_exp_size: 4 bytes
> > -    pub_exp: pub_exp_size bytes
> > -    pub_mod_size: 4 bytes
> > -    pub_mod: pub_mod_size bytes
> > -
> > -VTPM_Mig_Phase3
> > -  Input Parameters:
> > -    vtpm_state_size: 4 bytes
> > -    vtpm_state: vtpm_state_size bytes
> > -  Output Parameters:
> > -    none
> > -
> > -VTPM_Mig_Phase4
> > -    Unsupported: (Handled by scripts)
> > -
> > -
> > -*********************************************************************/
> > -
> > -#endif //_VTPM_MANAGER_H_
> > diff --git a/tools/vtpm_manager/migration/vtpm_migrator_if.c b/tools/vtpm_manager/migration/vtpm_migrator_if.c
> > deleted file mode 100644
> > index de48b2d..0000000
> > --- a/tools/vtpm_manager/migration/vtpm_migrator_if.c
> > +++ /dev/null
> > @@ -1,219 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// vtpm_migrator_if.c
> > -//
> > -//  Provides functions to call open network connection & call
> > -//  a function on the vtpm_migratord on the destination
> > -//
> > -// ==================================================================
> > -
> > -#include <stdio.h>
> > -#include <sys/types.h>
> > -#include <sys/socket.h>
> > -#include <netinet/in.h>
> > -#include <arpa/inet.h>
> > -#include <netdb.h>
> > -#include <string.h>
> > -#include <malloc.h>
> > -
> > -#include "tcg.h"
> > -#include "buffer.h"
> > -#include "log.h"
> > -#include "bsg.h"
> > -#include "vtpm_migrator.h"
> > -
> > -static int sock_desc;
> > -
> > -
> > -TPM_RESULT vtpm_migratord_open(char *server_address){
> > -
> > -  TPM_RESULT status = TPM_FAIL;
> > -
> > -  /* network variables */
> > -  struct in_addr ip_addr;
> > -  struct sockaddr_in server_addr;
> > -  int addr_len;
> > -  struct hostent *dns_info=NULL;
> > -
> > -  /* set up connection to server*/
> > -  dns_info = gethostbyname(server_address);
> > -  ip_addr.s_addr = *((unsigned long *) dns_info->h_addr_list[0]);
> > -
> > -  if(ip_addr.s_addr < 0) {
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  /* set up server variable */
> > -  memset((char *)&server_addr, 0, sizeof(server_addr));
> > -  server_addr.sin_family = AF_INET;
> > -  server_addr.sin_port = htons(VTPM_MIG_PORT);
> > -  server_addr.sin_addr.s_addr = ip_addr.s_addr;
> > -
> > -  /* open socket, make connection */
> > -  sock_desc = socket(AF_INET, SOCK_STREAM, 0);
> > -
> > -  if (sock_desc < 0 ) {
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if (connect(sock_desc,
> > -              (struct sockaddr *)&server_addr,
> > -              sizeof(server_addr)) < 0 ) {
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  status = TPM_SUCCESS;
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -void vtpm_migratord_close() {
> > -  close(sock_desc);
> > -}
> > -
> > -
> > -TPM_RESULT vtpm_migratord_command(TPM_COMMAND_CODE ord,
> > -                                buffer_t *command_param_buf,
> > -                                TPM_RESULT *cmd_status, /* out */
> > -                                buffer_t *result_param_buf) {
> > -
> > -  TPM_RESULT status = TPM_FAIL;
> > -  int  size_read, size_write, i;
> > -  BYTE *command, response_header[VTPM_COMMAND_HEADER_SIZE];
> > -  UINT32 dmi_id=0, command_size, out_param_size, adj_param_size;
> > -  TPM_TAG tag=VTPM_MTAG_REQ;
> > -
> > -  if ( (!command_param_buf) || (!result_param_buf) || (!cmd_status) ) {
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  command_size = VTPM_COMMAND_HEADER_SIZE + buffer_len(command_param_buf);
> > -  command = (BYTE *) malloc( command_size );
> > -  if (!command) {
> > -    status = TPM_RESOURCES;
> > -    goto abort_egress;
> > -  }
> > -
> > -  BSG_PackList(command, 3,
> > -                 BSG_TPM_TAG, &tag,
> > -                 BSG_TYPE_UINT32, &command_size,
> > -                 BSG_TPM_COMMAND_CODE, &ord );
> > -
> > -  memcpy(command + VTPM_COMMAND_HEADER_SIZE, command_param_buf->bytes, buffer_len(command_param_buf));
> > -
> > -  size_write = write(sock_desc, command, command_size);
> > -
> > -  if (size_write > 0) {
> > -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT (MIGd): 0x");
> > -    for (i=0; i< command_size; i++) {
> > -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", command[i]);
> > -    }
> > -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -  } else {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Error writing to migration server via network.\n");
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if (size_write != (int) command_size )
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Could not write entire command to migration server (%d/%d)\n", size_write, command_size);
> > -
> > -  // Read header for response
> > -  size_read = read(sock_desc, response_header, VTPM_COMMAND_HEADER_SIZE);
> > -  if (size_read > 0) {
> > -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV (MIGd): 0x");
> > -    for (i=0; i<size_read; i++)
> > -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", response_header[i]);
> > -
> > -  } else {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Error reading from Migration Server.\n");
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE) {
> > -    vtpmlogerror(VTPM_LOG_VTPM, "Command from migration server shorter than std header.\n");
> > -    status = TPM_IOERROR;
> > -    goto abort_egress;
> > -  }
> > -
> > -  // Unpack response from DMI for TPM command
> > -  BSG_UnpackList(response_header, 3,
> > -                 BSG_TPM_TAG, &tag,
> > -                 BSG_TYPE_UINT32, &out_param_size,
> > -                 BSG_TPM_COMMAND_CODE, cmd_status );
> > -
> > -  // If response has parameters, read them.
> > -  adj_param_size = out_param_size - VTPM_COMMAND_HEADER_SIZE;
> > -  if (adj_param_size > 0) {
> > -    TPMTRYRETURN( buffer_init( result_param_buf, adj_param_size, NULL) );
> > -    size_read = read(sock_desc, result_param_buf->bytes, adj_param_size);
> > -    if (size_read > 0) {
> > -      for (i=0; i< size_read; i++)
> > -        vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_param_buf->bytes[i]);
> > -
> > -    } else {
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Error reading from migration server.\n");
> > -      goto abort_egress;
> > -    }
> > -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> > -
> > -    if (size_read < (int)adj_param_size) {
> > -      vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
> > -      status = TPM_IOERROR;
> > -      goto abort_egress;
> > -    }
> > -  } else {
> > -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> > -  }
> > -
> > -  status=TPM_SUCCESS;
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -
> > diff --git a/tools/vtpm_manager/migration/vtpm_migratorc.c b/tools/vtpm_manager/migration/vtpm_migratorc.c
> > deleted file mode 100644
> > index 18b3bdb..0000000
> > --- a/tools/vtpm_manager/migration/vtpm_migratorc.c
> > +++ /dev/null
> > @@ -1,211 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -
> > -#include <stdio.h>
> > -#include <string.h>
> > -
> > -#include "tcg.h"
> > -#include "log.h"
> > -#include "bsg.h"
> > -#include "buffer.h"
> > -#include "vtpm_migrator.h"
> > -#include "vtpm_manager.h"
> > -
> > -TPM_RESULT handle_vtpm_mig_step2(char *server_addr,
> > -                                 char *name,
> > -                                 UINT32 instance) {
> > -  TPM_RESULT status, cmd_status;
> > -  buffer_t out_param_buf=NULL_BUF, mig_key_buf=NULL_BUF, empty_buf=NULL_BUF;
> > -  UINT32 offset;
> > -  struct pack_buf_t addr_data32;
> > -
> > -  //===== Get Destination's Public Migration Key ======
> > -  TPMTRYRETURN( vtpm_migratord_open(server_addr) );
> > -
> > -  TPMTRYRETURN( vtpm_migratord_command(VTPM_MORD_MIG_STEP2,
> > -                                     &out_param_buf,
> > -                                     &cmd_status,
> > -                                     &mig_key_buf) );
> > -  vtpm_migratord_close();
> > -
> > -  TPMTRYRETURN(cmd_status);
> > -
> > -  //===== Load migration key into vtpm_manager ========
> > -
> > -  addr_data32.data = (BYTE *)server_addr;
> > -  addr_data32.size = strlen(server_addr) + 1; // Include the null
> > -
> > -  TPMTRYRETURN ( buffer_init ( &out_param_buf,
> > -                               sizeof(UINT32) + addr_data32.size +buffer_len(&mig_key_buf),
> > -                               NULL ) ) ;
> > -
> > -  offset =  BSG_PackList(out_param_buf.bytes, 1,
> > -               BSG_TPM_SIZE32_DATA, &addr_data32);
> > -
> > -  memcpy(out_param_buf.bytes + offset , mig_key_buf.bytes, buffer_len(&mig_key_buf) );
> > -
> > -  TPMTRYRETURN ( vtpm_manager_open() );
> > -
> > -  TPMTRYRETURN ( vtpm_manager_command(VTPM_ORD_LOAD_MIG_KEY,
> > -                                      &out_param_buf,
> > -                                      &cmd_status,
> > -                                      &empty_buf) );
> > -
> > -  vtpm_manager_close();
> > -
> > -  TPMTRYRETURN(cmd_status);
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  buffer_free(&mig_key_buf);
> > -  buffer_free(&out_param_buf);
> > -
> > -  return status;
> > -}
> > -
> > -
> > -TPM_RESULT handle_vtpm_mig_step3(char *server_addr,
> > -                                 char *name,
> > -                                 UINT32 instance) {
> > -  TPM_RESULT status, cmd_status;
> > -  buffer_t out_param_buf=NULL_BUF, state_buf=NULL_BUF, empty_buf=NULL_BUF;
> > -  struct pack_buf_t addr_data32, name_data32, state_data32;
> > -
> > -  //===== Get vtpm state from vtpm_manager ========
> > -  addr_data32.data = (BYTE *)server_addr;
> > -  addr_data32.size = strlen(server_addr) + 1; // Include the null
> > -
> > -  TPMTRYRETURN ( buffer_init ( &out_param_buf,
> > -                               (2 * sizeof(UINT32)) + addr_data32.size,
> > -                               NULL ) ) ;
> > -
> > -  BSG_PackList(out_param_buf.bytes, 2,
> > -                 BSG_TYPE_UINT32, &instance,
> > -                 BSG_TPM_SIZE32_DATA, &addr_data32);
> > -
> > -  TPMTRYRETURN ( vtpm_manager_open() );
> > -
> > -  TPMTRYRETURN ( vtpm_manager_command(VTPM_ORD_MIGRATE_OUT,
> > -                                      &out_param_buf,
> > -                                      &cmd_status,
> > -                                      &state_buf) );
> > -
> > -  vtpm_manager_close();
> > -
> > -  TPMTRYRETURN(cmd_status);
> > -
> > -  TPMTRYRETURN( buffer_free( &out_param_buf ) );
> > -
> > -  //===== Send vtpm state to destination ======
> > -  name_data32.data = (BYTE *)name;
> > -  name_data32.size = strlen(name) + 1; // Include the null
> > -  state_data32.data = state_buf.bytes;
> > -  state_data32.size = buffer_len(&state_buf);
> > -
> > -  TPMTRYRETURN( buffer_init( &out_param_buf,
> > -                             2 * sizeof(UINT32) + name_data32.size + state_data32.size,
> > -                             NULL ) ) ;
> > -
> > -  BSG_PackList(out_param_buf.bytes, 2,
> > -                 BSG_TPM_SIZE32_DATA, &name_data32,
> > -                 BSG_TPM_SIZE32_DATA, &state_data32);
> > -
> > -  TPMTRYRETURN( vtpm_migratord_open(server_addr) );
> > -
> > -  TPMTRYRETURN( vtpm_migratord_command(VTPM_MORD_MIG_STEP3,
> > -                                     &out_param_buf,
> > -                                     &cmd_status,
> > -                                     &empty_buf) );
> > -  vtpm_migratord_close();
> > -
> > -  TPMTRYRETURN(cmd_status);
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -
> > -  buffer_free( &out_param_buf);
> > -  buffer_free( &state_buf);
> > -  buffer_free( &empty_buf);
> > -
> > -  return status;
> > -}
> > -
> > -
> > -// Usage vtpm_migrator addr domain_name instance step
> > -
> > -int main(int argc, char **argv) {
> > -
> > -    /* variables for processing of command */
> > -    TPM_RESULT status = TPM_FAIL;
> > -    char *server_addr, *name;
> > -    UINT32 instance, step;
> > -
> > -    if (argc != 5) {
> > -      vtpmlogerror(VTPM_LOG_VTPM, "Usage: vtpm_migrator addr vm_name instance step\n");
> > -      vtpmlogerror(VTPM_LOG_VTPM, "       params given %d\n", argc);
> > -      status= TPM_BAD_PARAMETER;
> > -      goto abort_egress;
> > -    }
> > -
> > -    server_addr = argv[1];
> > -    name = argv[2];
> > -    instance = atoi( argv[3] );
> > -    step = atoi( argv[4] );
> > -
> > -    switch (step) {
> > -    case VTPM_MORD_MIG_STEP2:
> > -      status = handle_vtpm_mig_step2(server_addr, name, instance);
> > -      break;
> > -
> > -    case VTPM_MORD_MIG_STEP3:
> > -      status = handle_vtpm_mig_step3(server_addr, name, instance);
> > -      break;
> > -
> > -    default:
> > -      status = TPM_BAD_PARAMETER;
> > -      goto abort_egress;
> > -      break;
> > -    }
> > -
> > -    goto egress;
> > - abort_egress:
> > - egress:
> > -
> > -    return status;
> > -}
> > -
> > diff --git a/tools/vtpm_manager/migration/vtpm_migratord.c b/tools/vtpm_manager/migration/vtpm_migratord.c
> > deleted file mode 100644
> > index ea18c8c..0000000
> > --- a/tools/vtpm_manager/migration/vtpm_migratord.c
> > +++ /dev/null
> > @@ -1,202 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -
> > -#include <stdio.h>
> > -#include <sys/types.h>
> > -#include <sys/socket.h>
> > -#include <netinet/in.h>
> > -#include <arpa/inet.h>
> > -#include <string.h>
> > -
> > -#include "tcg.h"
> > -#include "log.h"
> > -#include "bsg.h"
> > -#include "buffer.h"
> > -#include "vtpm_migrator.h"
> > -
> > -void build_error_msg( buffer_t *buf, TPM_RESULT status) {
> > -  TPM_TAG tag = VTPM_MTAG_RSP;
> > -  UINT32 out_param_size = VTPM_COMMAND_HEADER_SIZE;
> > -
> > -  buffer_init(buf, out_param_size, NULL);
> > -
> > -  BSG_PackList(buf->bytes, 3,
> > -                 BSG_TPM_TAG, &tag,
> > -                 BSG_TYPE_UINT32, &out_param_size,
> > -                 BSG_TPM_RESULT, &status );
> > -}
> > -
> > -int main() {
> > -
> > -    /* network variables */
> > -    int sock_descr, client_sock=-1, len;
> > -    struct sockaddr_in addr;
> > -    struct sockaddr_in client_addr;
> > -    unsigned int client_length;
> > -    int bytes;
> > -
> > -    /* variables for processing of command */
> > -    TPM_RESULT status = TPM_FAIL;
> > -    BYTE cmd_header[VTPM_COMMAND_HEADER_SIZE];
> > -    TPM_TAG tag;
> > -    TPM_COMMAND_CODE ord;
> > -    UINT32 in_param_size, adj_param_size;
> > -    int i, size_read, size_write;
> > -    buffer_t in_param_buf=NULL_BUF, result_buf=NULL_BUF;
> > -
> > -
> > -    /* setup socket */
> > -    sock_descr = socket(AF_INET, SOCK_STREAM, 0);
> > -
> > -    memset(&addr, 0, sizeof(addr));
> > -    addr.sin_family = AF_INET;
> > -    addr.sin_addr.s_addr = htonl(INADDR_ANY);
> > -    addr.sin_port = htons(VTPM_MIG_PORT);
> > -
> > -    if (bind(sock_descr, (struct sockaddr *)&addr, sizeof(addr)) == -1 ) {
> > -        vtpmlogerror(VTPM_LOG_VTPM, "Failed to bind to port %d.\n", VTPM_MIG_PORT);
> > -        return 1;
> > -    }
> > -
> > -    listen(sock_descr, 10);
> > -
> > -    for(;;) {
> > -        // ============ clear client info and wait for connection ==========
> > -        memset(&client_addr, 0, sizeof(client_addr));
> > -        client_length = sizeof(client_addr);
> > -
> > -        vtpmloginfo(VTPM_LOG_VTPM, "Waiting for incoming migrations...\n");
> > -        client_sock=accept(sock_descr, &client_addr, &client_length);
> > -        if (client_sock == -1) {
> > -            vtpmlogerror(VTPM_LOG_VTPM, "Incoming connectionn failed.\n");
> > -            goto abort_command;
> > -        } else {
> > -            vtpmloginfo(VTPM_LOG_VTPM, "Incoming connection accepted.\n");
> > -        }
> > -
> > -        // =================== Read incoming command ======================
> > -        size_read = read( client_sock, cmd_header, VTPM_COMMAND_HEADER_SIZE);
> > -        if (size_read > 0) {
> > -            vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV: 0x");
> > -            for (i=0; i<size_read; i++)
> > -                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> > -
> > -        } else {
> > -            vtpmlogerror(VTPM_LOG_VTPM, "Error reading from socket.\n");
> > -            build_error_msg(&result_buf, TPM_IOERROR);
> > -            goto abort_command_with_error;
> > -        }
> > -
> > -        if (size_read < (int) VTPM_COMMAND_HEADER_SIZE) {
> > -            vtpmlogerror(VTPM_LOG_VTPM, "Command from socket shorter than std header.\n");
> > -            build_error_msg(&result_buf, TPM_BAD_PARAMETER);
> > -            goto abort_command_with_error;
> > -        }
> > -
> > -        // Unpack response from client
> > -        BSG_UnpackList(cmd_header, 3,
> > -                       BSG_TPM_TAG, &tag,
> > -                       BSG_TYPE_UINT32, &in_param_size,
> > -                       BSG_TPM_COMMAND_CODE, &ord );
> > -
> > -
> > -        // If response has parameters, read them.
> > -        // Note that out_param_size is in the client's context
> > -        adj_param_size = in_param_size - VTPM_COMMAND_HEADER_SIZE;
> > -        if (adj_param_size > 0) {
> > -            buffer_init( &in_param_buf, adj_param_size, NULL);
> > -            size_read = read(client_sock, in_param_buf.bytes, adj_param_size);
> > -            if (size_read > 0) {
> > -                for (i=0; i< size_read; i++)
> > -                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param_buf.bytes[i]);
> > -
> > -            } else {
> > -                vtpmlogerror(VTPM_LOG_VTPM, "Error reading from socket.\n");
> > -                build_error_msg(&result_buf, TPM_IOERROR);
> > -                goto abort_command_with_error;
> > -            }
> > -            vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> > -
> > -            if (size_read < (int)adj_param_size) {
> > -                vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> > -                vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
> > -                build_error_msg(&result_buf, TPM_BAD_PARAMETER);
> > -                goto abort_command_with_error;
> > -            }
> > -        } else {
> > -            vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> > -        }
> > -
> > -        /* Handle Command */
> > -        switch (ord) {
> > -        case VTPM_MORD_MIG_STEP2:
> > -          handle_vtpm_mig_step2(&in_param_buf, &result_buf);
> > -          break;
> > -
> > -        case VTPM_MORD_MIG_STEP3:
> > -          handle_vtpm_mig_step3(&in_param_buf, &result_buf);
> > -          break;
> > -
> > -        default:
> > -            build_error_msg(&result_buf, TPM_BAD_PARAMETER);
> > -            goto abort_command_with_error;
> > -        }
> > -
> > -  abort_command_with_error:
> > -        /* Write Response */
> > -        size_write = write(client_sock, result_buf.bytes, buffer_len(&result_buf));
> > -
> > -        if (size_write > 0) {
> > -            vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT: 0x");
> > -            for (i=0; i< buffer_len(&result_buf); i++) {
> > -                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_buf.bytes[i]);
> > -            }
> > -            vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> > -        } else {
> > -            vtpmlogerror(VTPM_LOG_VTPM, "Error writing response to client.\n");
> > -            goto abort_command;
> > -        }
> > -
> > -        if (size_write != (int) buffer_len(&result_buf) )
> > -           vtpmlogerror(VTPM_LOG_VTPM, "Could not send entire response to client(%d/%d)\n", size_write, buffer_len(&result_buf));
> > -
> > -  abort_command:
> > -        close(client_sock);
> > -        buffer_free(&in_param_buf);
> > -        buffer_free(&result_buf);
> > -
> > -    } // For (;;)
> > -
> > -    return 0;
> > -}
> > -
> > diff --git a/tools/vtpm_manager/migration/vtpm_migratord_handler.c b/tools/vtpm_manager/migration/vtpm_migratord_handler.c
> > deleted file mode 100644
> > index 0a8a2d5..0000000
> > --- a/tools/vtpm_manager/migration/vtpm_migratord_handler.c
> > +++ /dev/null
> > @@ -1,177 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -
> > -#include <stdlib.h>
> > -#include <string.h>
> > -
> > -#include "tcg.h"
> > -#include "bsg.h"
> > -#include "log.h"
> > -#include "vtpm_migrator.h"
> > -#include "vtpm_manager.h"
> > -
> > -#define VTPM_SH_CMD_HDR  "bash -c \"cd /etc/xen/scripts; source /etc/xen/scripts/vtpm-common.sh;"
> > -#define VTPM_SH_CMD_FTR  "\""
> > -#define VTPM_SH_GETINST  "vtpmdb_get_free_instancenum"
> > -#define VTPM_SH_ADD      "vtpm_add_and_activate"
> > -#define VTPM_SH_RESUME   "vtpm_resume"
> > -
> > -// This must be updated to the longest command name. Currently GETINST
> > -#define VTPM_SH_CMD_SIZE (strlen(VTPM_SH_CMD_HDR) + strlen(VTPM_SH_CMD_FTR) + 1 + strlen(VTPM_SH_GETINST) + 2)
> > -
> > -void handle_vtpm_mig_step2(buffer_t *in_param_buf, buffer_t *result_buf)
> > -{
> > -  TPM_TAG tag = VTPM_TAG_RSP;
> > -  buffer_t out_param_buf= NULL_BUF, mig_key_buf=NULL_BUF;
> > -  TPM_RESULT status=TPM_SUCCESS, cmd_status;
> > -  UINT32 out_param_size;
> > -
> > -  if ( (!in_param_buf) || (!result_buf) ) {
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  // ================= Call manager and get mig key ===============
> > -  TPMTRYRETURN( vtpm_manager_open() );
> > -  TPMTRYRETURN( vtpm_manager_command(VTPM_ORD_GET_MIG_KEY,
> > -                                     &out_param_buf, // Empty
> > -                                     &cmd_status,
> > -                                     &mig_key_buf) );
> > -
> > -  vtpm_manager_close();
> > -
> > -  TPMTRYRETURN(cmd_status);
> > -
> > -  // ==================== return the  mig key =====================
> > -  out_param_size =  VTPM_COMMAND_HEADER_SIZE + buffer_len(&mig_key_buf);
> > -
> > -  TPMTRYRETURN( buffer_init(result_buf,
> > -                            out_param_size,
> > -                            NULL) );
> > -
> > -  BSG_PackList( result_buf->bytes, 3,
> > -                  BSG_TPM_TAG, &tag,
> > -                  BSG_TYPE_UINT32, &out_param_size,
> > -                  BSG_TPM_RESULT, &status);
> > -
> > -  memcpy(result_buf->bytes + VTPM_COMMAND_HEADER_SIZE,
> > -         mig_key_buf.bytes, buffer_len(&mig_key_buf));
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -  buffer_free(result_buf);
> > -  build_error_msg(result_buf, status);
> > -
> > - egress:
> > -  return;
> > -}
> > -
> > -void handle_vtpm_mig_step3(buffer_t *in_param_buf, buffer_t *result_buf)
> > -{
> > -  TPM_TAG tag = VTPM_TAG_RSP;
> > -  buffer_t out_param_buf= NULL_BUF, mig_key_buf=NULL_BUF, empty_buf=NULL_BUF;
> > -  TPM_RESULT status=TPM_SUCCESS, cmd_status;
> > -  UINT32 out_param_size, instance;
> > -  char *shell_cmd_str=NULL;
> > -  size_t shell_cmd_strlen;
> > -  FILE *shell_f=NULL;
> > -
> > -  if ( (!in_param_buf) || (!result_buf) ) {
> > -    status = TPM_BAD_PARAMETER;
> > -    goto abort_egress;
> > -  }
> > -
> > -  // ================= Read Parameters ===============
> > -  struct pack_buf_t name_data32, state_data32;
> > -
> > -  BSG_UnpackList(in_param_buf->bytes, 2,
> > -                 BSG_TPM_SIZE32_DATA, &name_data32,
> > -                 BSG_TPM_SIZE32_DATA, &state_data32);
> > -
> > -  // Before using this string, protect us from a non-null term array.
> > -  if (name_data32.data[name_data32.size -1] != 0x00) {
> > -    name_data32.data[name_data32.size -1] = 0x00;
> > -  }
> > -
> > -  // ====== Call hotplug-script and get an instance ======
> > -  shell_cmd_strlen = VTPM_SH_CMD_SIZE + name_data32.size + 10;
> > -  shell_cmd_str = (char *) malloc(shell_cmd_strlen); // 10 is just padding for the UINT32
> > -
> > -  snprintf(shell_cmd_str, shell_cmd_strlen,
> > -       VTPM_SH_CMD_HDR VTPM_SH_GETINST VTPM_SH_CMD_FTR);
> > -
> > -  shell_f = popen(shell_cmd_str, "r");
> > -  fscanf(shell_f, "%d", &instance);
> > -  pclose(shell_f);
> > -
> > -  // ====== Call hotplug-script and add instance ======
> > -  snprintf(shell_cmd_str, shell_cmd_strlen,
> > -       VTPM_SH_CMD_HDR VTPM_SH_ADD " %s %d" VTPM_SH_CMD_FTR,
> > -       name_data32.data, instance);
> > -  system(shell_cmd_str);
> > -
> > -  // ========= Call vtpm_manager and load VTPM =======
> > -  TPMTRYRETURN( buffer_init( &out_param_buf,
> > -                             2*sizeof(UINT32) + state_data32.size,
> > -                             NULL) );
> > -
> > -  BSG_PackList(out_param_buf.bytes, 2,
> > -                 BSG_TYPE_UINT32, &instance,
> > -                 BSG_TPM_SIZE32_DATA, &state_data32);
> > -
> > -  TPMTRYRETURN( vtpm_manager_open() );
> > -  TPMTRYRETURN( vtpm_manager_command(VTPM_ORD_MIGRATE_IN,
> > -                                     &out_param_buf,
> > -                                     &cmd_status,
> > -                                     &empty_buf) );
> > -
> > -  vtpm_manager_close();
> > -
> > -  TPMTRYRETURN(cmd_status);
> > -
> > -  // ====== Call hotplug-script and resume instance ======
> > -  snprintf(shell_cmd_str, shell_cmd_strlen,
> > -       VTPM_SH_CMD_HDR VTPM_SH_RESUME " %d" VTPM_SH_CMD_FTR, instance);
> > -  system(shell_cmd_str);
> > -
> > -  goto egress;
> > - abort_egress:
> > - egress:
> > -  free(shell_cmd_str);
> > -
> > -  // In this case no params come back, so reuse build_error_msg even for succes.
> > -  build_error_msg(result_buf, status);
> > -  return;
> > -}
> > -
> > diff --git a/tools/vtpm_manager/tcs/Makefile b/tools/vtpm_manager/tcs/Makefile
> > deleted file mode 100644
> > index 11af91e..0000000
> > --- a/tools/vtpm_manager/tcs/Makefile
> > +++ /dev/null
> > @@ -1,24 +0,0 @@
> > -XEN_ROOT = $(CURDIR)/../../..
> > -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> > -
> > -BIN            = libTCS.a
> > -
> > -.PHONY: all
> > -all: build
> > -
> > -.PHONY: build
> > -build: $(BIN)
> > -
> > -.PHONY: install
> > -install: build
> > -
> > -.PHONY: clean
> > -clean:
> > -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> > -
> > -.PHONY: mrproper
> > -mrproper: clean
> > -       rm -f *~
> > -
> > -$(BIN): $(OBJS)
> > -       $(AR) rcs $(BIN) $(OBJS)
> > diff --git a/tools/vtpm_manager/tcs/contextmgr.c b/tools/vtpm_manager/tcs/contextmgr.c
> > deleted file mode 100644
> > index cf3803c..0000000
> > --- a/tools/vtpm_manager/tcs/contextmgr.c
> > +++ /dev/null
> > @@ -1,224 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// contextmgr.c
> > -//
> > -//  This file contains the context management functions for TCS.
> > -//
> > -// ==================================================================
> > -
> > -#include <stdio.h>
> > -#include <string.h>
> > -#include <malloc.h>
> > -#include "tcs.h"
> > -#include "contextmgr.h"
> > -#include "log.h"
> > -#include "hashtable.h"
> > -
> > -BYTE* AddMemBlock(CONTEXT_HANDLE* pContextHandle, // in
> > -                 int    BlockSize)  { // in
> > -
> > -  BLOCK* pCurrentBlock = NULL;
> > -  BLOCK* pBlock = NULL;
> > -
> > -  // check incoming params
> > -  if (pContextHandle == NULL || BlockSize == 0)
> > -    return NULL;
> > -
> > -  // Create New Block
> > -  pBlock = (BLOCK *)malloc(sizeof(BLOCK));
> > -  if (pBlock == NULL)
> > -    return (0);
> > -
> > -  pBlock->aMemory = (BYTE *)malloc(sizeof(BYTE) * BlockSize);
> > -  if (pBlock->aMemory == NULL)
> > -    return (0);
> > -
> > -  memset(pBlock->aMemory, 0, BlockSize);
> > -  pBlock->nBlockSize = BlockSize;
> > -  pBlock->pNextBlock = NULL;
> > -
> > -  // search for the last block created where to add the
> > -  // newly created block
> > -  if(pContextHandle->pTopBlock != NULL) {
> > -    pCurrentBlock = pContextHandle->pTopBlock;
> > -    while(pCurrentBlock->pNextBlock != NULL)
> > -      pCurrentBlock = pCurrentBlock->pNextBlock;
> > -
> > -
> > -    pCurrentBlock->pNextBlock= pBlock;
> > -  } else
> > -    pContextHandle->pTopBlock = pBlock;
> > -
> > -
> > -  pContextHandle->nBlockCount++;
> > -
> > -  return pBlock->aMemory;
> > -}
> > -
> > -
> > -BOOL DeleteMemBlock(CONTEXT_HANDLE* pContextHandle, // in
> > -                    BYTE*   pTCPA_BYTEs) { // in
> > -  BLOCK* pCurrentBlock = NULL;
> > -  BLOCK* pParentBlock = NULL;
> > -  BOOL bFound = FALSE;
> > -
> > -  if (pContextHandle == NULL)
> > -    return FALSE;
> > -
> > -
> > -  // Search for the Block in the context by aMemory pointer
> > -  pParentBlock = NULL;
> > -  pCurrentBlock = pContextHandle->pTopBlock;
> > -
> > -  while(pCurrentBlock != NULL) {
> > -    // If aMemory block is found, delete it
> > -    if(pCurrentBlock->aMemory == pTCPA_BYTEs || pTCPA_BYTEs == NULL) {
> > -      // if it is the top Block, remove it from the top,
> > -      // otherwise remove it from the ParentBlock and stitch
> > -      // the NextBlock to the ParentBlock
> > -      if(pParentBlock == NULL)
> > -       pContextHandle->pTopBlock = pContextHandle->pTopBlock->pNextBlock;
> > -      else
> > -       pParentBlock->pNextBlock = pCurrentBlock->pNextBlock;
> > -
> > -      // delete memory Block associated with pointer pTCPA_BYTEs
> > -      free(pCurrentBlock->aMemory);
> > -      pCurrentBlock->aMemory = NULL;
> > -
> > -      free(pCurrentBlock);
> > -      pCurrentBlock = pParentBlock;
> > -
> > -      pContextHandle->nBlockCount--;
> > -      bFound = TRUE;
> > -    }
> > -
> > -    if(pCurrentBlock != NULL) {
> > -      pParentBlock = pCurrentBlock;
> > -      pCurrentBlock = pCurrentBlock->pNextBlock;
> > -    }
> > -  }
> > -
> > -  return bFound;
> > -}
> > -
> > -BOOL AddHandleToList(TCS_CONTEXT_HANDLE hContext, // in
> > -                    TPM_RESOURCE_TYPE type, // in
> > -                    TPM_HANDLE    handle)  { // in
> > -  HANDLE_LIST* pNewHandle = NULL;
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Adding Handle to list\n");
> > -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> > -
> > -  if (pContextHandle == NULL)
> > -    return 0;
> > -
> > -  pNewHandle = (HANDLE_LIST *)malloc(sizeof(HANDLE_LIST));
> > -
> > -  if (pNewHandle == NULL)
> > -    return (0);
> > -
> > -  pNewHandle->handle = handle;
> > -  pNewHandle->type = type;
> > -  pNewHandle->pNextHandle = pContextHandle->pHandleList;
> > -
> > -  pContextHandle->pHandleList = pNewHandle;
> > -
> > -  return 1;
> > -}
> > -
> > -BOOL DeleteHandleFromList(   TCS_CONTEXT_HANDLE hContext, // in
> > -                             TPM_HANDLE          handle) { // in
> > -
> > -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> > -
> > -  HANDLE_LIST *pCurrentHandle = pContextHandle->pHandleList,
> > -              *pLastHandle = pCurrentHandle;
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Deleting Handle from list\n");
> > -
> > -  if (pContextHandle == NULL)
> > -    return 0;
> > -
> > -  while (1) {
> > -
> > -    if (pCurrentHandle->handle == handle) { // Found element
> > -      if (pCurrentHandle == pLastHandle) { // First element in list
> > -       pContextHandle->pHandleList = pCurrentHandle->pNextHandle;
> > -       free(pCurrentHandle);
> > -      } else { // Ordinary element
> > -       pLastHandle->pNextHandle = pCurrentHandle->pNextHandle;
> > -       free(pCurrentHandle);
> > -      }
> > -
> > -      return 1;
> > -
> > -    } else { // Not found yet;
> > -      pLastHandle = pCurrentHandle;
> > -      pCurrentHandle = pCurrentHandle->pNextHandle;
> > -      if (pCurrentHandle == NULL) // Found end of list
> > -       return 0;
> > -    }
> > -
> > -  }
> > -}
> > -
> > -BOOL FreeHandleList(    CONTEXT_HANDLE*     pContextHandle) { // in
> > -  HANDLE_LIST* pCurrentHandle;
> > -  BOOL returncode = TRUE;
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Freeing all handles for context\n");
> > -
> > -  if (pContextHandle == NULL)
> > -    return 1;
> > -
> > -  pCurrentHandle = pContextHandle->pHandleList;
> > -  while (pCurrentHandle != NULL) {
> > -
> > -    switch (pCurrentHandle->type) {
> > -    case TPM_RT_KEY:
> > -      returncode = returncode && !TCSP_EvictKey(pContextHandle->handle, pCurrentHandle->handle);
> > -      break;
> > -    case TPM_RT_AUTH:
> > -      returncode = returncode && !TCSP_TerminateHandle(pContextHandle->handle, pCurrentHandle->handle);
> > -      break;
> > -    default:
> > -      returncode = FALSE;
> > -    }
> > -
> > -    pCurrentHandle = pCurrentHandle->pNextHandle;
> > -
> > -  }
> > -
> > -  return 1;
> > -}
> > diff --git a/tools/vtpm_manager/tcs/contextmgr.h b/tools/vtpm_manager/tcs/contextmgr.h
> > deleted file mode 100644
> > index e3fdf0f..0000000
> > --- a/tools/vtpm_manager/tcs/contextmgr.h
> > +++ /dev/null
> > @@ -1,82 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// contextmgr.c
> > -//
> > -//  This file contains the context management functions for TCS.
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __CONTEXTMGR_H__
> > -#define __CONTEXTMGR_H__
> > -
> > -#include "tcg.h"
> > -
> > -#define BLOCK_SIZE 300
> > -
> > -typedef struct block {
> > -  int nBlockSize;
> > -  BYTE* aMemory;
> > -  struct block* pNextBlock;
> > -} BLOCK;
> > -
> > -typedef struct handle_List {
> > -  TPM_HANDLE handle;
> > -  TPM_RESOURCE_TYPE type;
> > -  struct handle_List* pNextHandle;
> > -} HANDLE_LIST;
> > -
> > -typedef struct context_handle {
> > -  TCS_CONTEXT_HANDLE handle;
> > -  int nBlockCount;
> > -  BLOCK* pTopBlock;
> > -  HANDLE_LIST* pHandleList;
> > -} CONTEXT_HANDLE;
> > -
> > -BYTE* AddMemBlock(  CONTEXT_HANDLE*     pContextHandle, // in
> > -                    int                 BlockSize);  // in
> > -
> > -BOOL DeleteMemBlock(CONTEXT_HANDLE* pContextHandle, // in
> > -                    BYTE*           pTCPA_BYTEs); // in
> > -
> > -
> > -BOOL AddHandleToList(   TCS_CONTEXT_HANDLE hContext, // in
> > -                        TPM_RESOURCE_TYPE   type, // in
> > -                        TPM_HANDLE          handle); // in
> > -
> > -BOOL DeleteHandleFromList(   TCS_CONTEXT_HANDLE hContext, // in
> > -                             TPM_HANDLE          handle); // in
> > -
> > -BOOL FreeHandleList(    CONTEXT_HANDLE*     pContextHandle); // in
> > -
> > -#endif //_CONTEXTMGR_H_
> > diff --git a/tools/vtpm_manager/tcs/tcs.c b/tools/vtpm_manager/tcs/tcs.c
> > deleted file mode 100644
> > index 7c1378c..0000000
> > --- a/tools/vtpm_manager/tcs/tcs.c
> > +++ /dev/null
> > @@ -1,1192 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// tcs.c
> > -//
> > -//  This file contains the functions that implement a TCS.
> > -//
> > -// ==================================================================
> > -
> > -#include <stdio.h>
> > -#include <string.h>
> > -#include <malloc.h>
> > -
> > -#include "tcg.h"
> > -#include "bsg.h"
> > -#include "tcs.h"
> > -#include "contextmgr.h"
> > -#include "tpmddl.h"
> > -#include "log.h"
> > -#include "hashtable.h"
> > -#include "hashtable_itr.h"
> > -
> > -// Static Global Vars for the TCS
> > -static int TCS_m_nCount = 0;
> > -
> > -#define TCPA_MAX_BUFFER_LENGTH 0x2000
> > -
> > -static BYTE InBuf [TCPA_MAX_BUFFER_LENGTH];
> > -static BYTE OutBuf[TCPA_MAX_BUFFER_LENGTH];
> > -
> > -struct hashtable *context_ht;
> > -
> > -// -------------------------- Hash table functions --------------------
> > -
> > -static unsigned int hashfunc32(void *ky) {
> > -  return (* (UINT32 *) ky);
> > -}
> > -
> > -static int equals32(void *k1, void *k2) {
> > -  return (*(UINT32 *) k1 == *(UINT32 *) k2);
> > -}
> > -
> > -CONTEXT_HANDLE *LookupContext( TCS_CONTEXT_HANDLE  hContext) {
> > -  return( (CONTEXT_HANDLE *) hashtable_search(context_ht, &hContext) );
> > -}
> > -
> > -// ---------------------------------------------------------------------------------
> > -// Initialization/Uninitialization SubComponent API
> > -// ---------------------------------------------------------------------------------
> > -TPM_RESULT TCS_create() {
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TPM_RESULT result = TPM_FAIL;
> > -
> > -  if (TCS_m_nCount == 0) {
> > -    vtpmloginfo(VTPM_LOG_TCS, "Constructing new TCS:\n");
> > -    hRes = TDDL_Open();
> > -
> > -    context_ht = create_hashtable(10, hashfunc32, equals32);
> > -
> > -    if ((hRes == TDDL_SUCCESS) && (context_ht != NULL)) {
> > -      result = TPM_SUCCESS;
> > -      TCS_m_nCount++;
> > -    } else {
> > -      result = TPM_IOERROR;
> > -      hashtable_destroy(context_ht, 1);
> > -    }
> > -  } else
> > -    TCS_m_nCount++;
> > -
> > -  return(result);
> > -}
> > -
> > -
> > -void TCS_destroy()
> > -{
> > -  TCS_m_nCount--;
> > -
> > -  if (TCS_m_nCount == 0) {
> > -    vtpmloginfo(VTPM_LOG_TCS, "Destructing TCS:\n");
> > -    TDDL_Close();
> > -
> > -    struct hashtable_itr *context_itr;
> > -    TCS_CONTEXT_HANDLE  *hContext;
> > -
> > -    // Close all the TCS contexts. TCS should evict keys based on this
> > -    if (hashtable_count(context_ht) > 0) {
> > -      context_itr = hashtable_iterator(context_ht);
> > -      do {
> > -        hContext = (TCS_CONTEXT_HANDLE *) hashtable_iterator_key(context_itr);
> > -       if (TCS_CloseContext(*hContext) != TPM_SUCCESS)
> > -           vtpmlogerror(VTPM_LOG_TCS, "Failed to close context %d properly.\n", *hContext);
> > -
> > -      } while (hashtable_iterator_advance(context_itr));
> > -      free(context_itr);
> > -    }
> > -    hashtable_destroy(context_ht, 1);
> > -  }
> > -
> > -}
> > -
> > -TPM_RESULT TCS_Malloc(  TCS_CONTEXT_HANDLE  hContext, // in
> > -                        UINT32              MemSize, // in
> > -                        BYTE**              ppMemPtr) {// out
> > -
> > -  TPM_RESULT returnCode = TPM_FAIL;
> > -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> > -
> > -  if (pContextHandle != NULL && ppMemPtr != NULL) {
> > -    *ppMemPtr = (BYTE *)AddMemBlock(pContextHandle, MemSize);
> > -    returnCode = TPM_SUCCESS;
> > -  }
> > -
> > -  return returnCode;
> > -}
> > -
> > -TPM_RESULT TCS_FreeMemory(  TCS_CONTEXT_HANDLE  hContext, // in
> > -                            BYTE*               pMemory) { // in
> > -  TPM_RESULT returnCode = TPM_FAIL;
> > -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> > -
> > -  if ( (pContextHandle != NULL && pMemory != NULL) &&
> > -       (DeleteMemBlock(pContextHandle, pMemory) == TRUE) )
> > -    returnCode = TPM_SUCCESS;
> > -
> > -
> > -  return returnCode;
> > -}
> > -
> > -TPM_RESULT TCS_OpenContext(TCS_CONTEXT_HANDLE* hContext) { // out
> > -  TPM_RESULT returnCode = TPM_FAIL;
> > -  TCS_CONTEXT_HANDLE *newContext;
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS, "Calling TCS_OpenContext:\n");
> > -
> > -  if (hContext) {
> > -    CONTEXT_HANDLE* pContextHandle = (CONTEXT_HANDLE *) malloc(sizeof(CONTEXT_HANDLE));
> > -    if (pContextHandle == NULL)
> > -      return TPM_SIZE;
> > -
> > -    // initialize to 0
> > -    pContextHandle->nBlockCount = 0;
> > -    pContextHandle->pTopBlock = NULL;
> > -    pContextHandle->pHandleList = NULL;
> > -
> > -    // Create New Block
> > -    AddMemBlock(pContextHandle, BLOCK_SIZE);
> > -
> > -    newContext = (TCS_CONTEXT_HANDLE *) malloc(sizeof(TCS_CONTEXT_HANDLE));
> > -    *newContext = (TCS_CONTEXT_HANDLE) (((uintptr_t) pContextHandle >> 2) & 0xffffffff);
> > -
> > -    if (hashtable_search(context_ht, &newContext) !=NULL)
> > -       *newContext += 1;
> > -
> > -    pContextHandle->handle = *newContext;
> > -    if (!hashtable_insert(context_ht, newContext, pContextHandle)) {
> > -        free(newContext);
> > -        free(pContextHandle);
> > -       returnCode = TPM_FAIL;
> > -    } else {
> > -       *hContext = *newContext;
> > -       returnCode = TPM_SUCCESS;
> > -    }
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCS_CloseContext(TCS_CONTEXT_HANDLE hContext) {// in
> > -  //FIXME: TCS SHOULD Track failed auths and make sure
> > -  //we don't try and re-free them here.
> > -  TPM_RESULT returnCode = TPM_FAIL;
> > -
> > -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> > -
> > -  if(pContextHandle != NULL) {
> > -    // Print test info
> > -    vtpmloginfo(VTPM_LOG_TCS, "Calling TCS_CloseContext.\n");
> > -
> > -    // free memory for all the blocks
> > -    DeleteMemBlock(pContextHandle, NULL );
> > -    pContextHandle->pTopBlock = NULL;
> > -
> > -    FreeHandleList(pContextHandle);
> > -    if (pContextHandle->pHandleList != NULL)
> > -      vtpmlogerror(VTPM_LOG_TCS, "Not all handles evicted from TPM.\n");
> > -
> > -    // Release the TPM's resources
> > -    if (hashtable_remove(context_ht, &hContext) == NULL)
> > -      vtpmlogerror(VTPM_LOG_TCS, "Not all handles evicted from TPM.\n");
> > -
> > -    free(pContextHandle);
> > -    returnCode = TPM_SUCCESS;
> > -  }
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Finished closing context\n");
> > -  return(returnCode);
> > -}
> > -
> > -// ------------------------------------------------------------------
> > -// Internal Functions
> > -// ------------------------------------------------------------------
> > -int packAuth(BYTE* dst, TCS_AUTH* auth) {
> > -  // CHECK: according to the command specs, the outgoing auth params are:
> > -  // nonceEven
> > -  // nonceOdd
> > -  // continueAuthSession
> > -  // auth digest for return params
> > -  //
> > -  // this is a bit different than this code...
> > -
> > -  return BSG_PackList(dst, 4,
> > -                     BSG_TYPE_UINT32, &(auth->AuthHandle),
> > -                     BSG_TPM_NONCE, &(auth->NonceOdd),
> > -                     BSG_TYPE_BOOL, &(auth->fContinueAuthSession),
> > -                     BSG_TPM_AUTHDATA, &(auth->HMAC));
> > -}
> > -
> > -int unpackAuth(TCS_AUTH* auth, BYTE* src) {
> > -  return BSG_UnpackList(src, 3,
> > -                       BSG_TPM_NONCE, &(auth->NonceEven),
> > -                       BSG_TYPE_BOOL, &(auth->fContinueAuthSession),
> > -                       BSG_TPM_AUTHDATA, &(auth->HMAC));
> > -}
> > -
> > -// ------------------------------------------------------------------
> > -// Authorization Commands
> > -// ------------------------------------------------------------------
> > -
> > -TPM_RESULT TCSP_OIAP(TCS_CONTEXT_HANDLE hContext, // in
> > -                    TCS_AUTHHANDLE*  authHandle, // out
> > -                    TPM_NONCE*   nonce0)  // out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_OIAP;
> > -  UINT32 paramSize = 0;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (authHandle == NULL || nonce0 == NULL)
> > -    return TPM_BAD_PARAMETER;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 3,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal);
> > -
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> > -      == TDDL_SUCCESS) {
> > -
> > -    // unpack to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList( OutBuf, 3,
> > -                           BSG_TPM_TAG, &tag,
> > -                           BSG_TYPE_UINT32, &paramSize,
> > -                           BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      BSG_UnpackList(OutBuf+i, 2,
> > -                    BSG_TYPE_UINT32, authHandle,
> > -                    BSG_TPM_NONCE, nonce0);
> > -
> > -      if (!AddHandleToList(hContext, TPM_RT_AUTH, *authHandle))
> > -        vtpmlogerror(VTPM_LOG_TCS, "New AuthHandle not recorded\n");
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCSP_OSAP(TCS_CONTEXT_HANDLE hContext,  // in
> > -                    TPM_ENTITY_TYPE  entityType,  // in
> > -                    UINT32    entityValue, // in
> > -                    TPM_NONCE   nonceOddOSAP, // in
> > -                    TCS_AUTHHANDLE*  authHandle,  // out
> > -                    TPM_NONCE*   nonceEven,  // out
> > -                    TPM_NONCE*   nonceEvenOSAP) // out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_OSAP;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (authHandle == NULL || nonceEven == NULL || nonceEvenOSAP == NULL)
> > -    return TPM_BAD_PARAMETER;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 6,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT16, &entityType,
> > -                         BSG_TYPE_UINT32, &entityValue,
> > -                         BSG_TPM_NONCE, &nonceOddOSAP);
> > -
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> > -            == TDDL_SUCCESS) {
> > -
> > -    // unpack to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      BSG_UnpackList(OutBuf+i, 3,
> > -                    BSG_TYPE_UINT32, authHandle,
> > -                    BSG_TPM_NONCE, nonceEven,
> > -                    BSG_TPM_NONCE, nonceEvenOSAP);
> > -
> > -      if (!AddHandleToList(hContext, TPM_RT_AUTH, *authHandle)) {
> > -           vtpmlogerror(VTPM_LOG_TCS, "New AuthHandle not recorded\n");
> > -      }
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCSP_TakeOwnership(TCS_CONTEXT_HANDLE hContext,   // in
> > -                             UINT16    protocolID,   // in
> > -                             UINT32    encOwnerAuthSize, // in
> > -                             BYTE*    encOwnerAuth,  // in
> > -                             UINT32    encSrkAuthSize,  // in
> > -                             BYTE*    encSrkAuth,   // in
> > -                             UINT32*    SrkSize,   // in, out
> > -                             BYTE**    Srk,    // in, out
> > -                             TCS_AUTH*   ownerAuth)   // in, out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_TakeOwnership;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (encOwnerAuth == NULL || encSrkAuth == NULL || SrkSize == NULL || *Srk == NULL)
> > -    return TPM_BAD_PARAMETER;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 5,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT16, &protocolID,
> > -                         BSG_TYPE_UINT32, &encOwnerAuthSize);
> > -
> > -  memcpy(InBuf+InLength, encOwnerAuth, encOwnerAuthSize);
> > -  InLength += encOwnerAuthSize;
> > -  InLength += BSG_Pack(   BSG_TYPE_UINT32,
> > -                         &encSrkAuthSize,
> > -                         InBuf+InLength);
> > -  memcpy(InBuf+InLength, encSrkAuth, encSrkAuthSize);
> > -  InLength += encSrkAuthSize;
> > -  memcpy(InBuf+InLength, *Srk, *SrkSize);
> > -  InLength += *SrkSize;
> > -  InLength += packAuth(InBuf+InLength, ownerAuth);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32,
> > -          &InLength,
> > -          InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> > -              == TDDL_SUCCESS){
> > -
> > -    // unpack to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList( OutBuf, 3,
> > -                           BSG_TPM_TAG, &tag,
> > -                           BSG_TYPE_UINT32, &paramSize,
> > -                           BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      TPM_KEY srkPub;
> > -      i += BSG_Unpack(BSG_TPM_KEY,  OutBuf+i,  &srkPub);
> > -      unpackAuth(ownerAuth, OutBuf+i);
> > -
> > -      // fill output params
> > -      BYTE tempBuf[1024];
> > -      *SrkSize = BSG_Pack(BSG_TPM_KEY,  &srkPub, tempBuf);
> > -      if (TCS_Malloc(hContext, *SrkSize, Srk) == TPM_FAIL) {
> > -       return(TPM_SIZE);
> > -      }
> > -      memcpy(*Srk, tempBuf, *SrkSize);
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d", paramSize);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_TakeOwnership Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -
> > -TPM_RESULT TCSP_DisablePubekRead (  TCS_CONTEXT_HANDLE hContext, // in
> > -                                    TCS_AUTH*   ownerAuth) { // in, out
> > -
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_DisablePubekRead;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 3,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal);
> > -
> > -  InLength += packAuth(InBuf+InLength, ownerAuth);
> > -
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> > -              == TDDL_SUCCESS){
> > -
> > -    // unpack to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList( OutBuf, 3,
> > -                           BSG_TPM_TAG, &tag,
> > -                           BSG_TYPE_UINT32, &paramSize,
> > -                           BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      unpackAuth(ownerAuth, OutBuf+i);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_DisablePubekRead Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -
> > -TPM_RESULT TCSP_TerminateHandle(TCS_CONTEXT_HANDLE hContext, // in
> > -                                TCS_AUTHHANDLE  handle)  // in
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_Terminate_Handle;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 4,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT32, &handle);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> > -              == TDDL_SUCCESS) {
> > -
> > -    // unpack to get the tag, paramSize, & returnCode
> > -    BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (!DeleteHandleFromList(hContext, handle))
> > -      vtpmlogerror(VTPM_LOG_TCS, "KeyHandle not removed from list\n");
> > -
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> > -      // Print debug info
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d", paramSize);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_TerminateHandle Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -// TPM Mandatory
> > -TPM_RESULT TCSP_Extend( TCS_CONTEXT_HANDLE hContext, // in
> > -                        TPM_PCRINDEX  pcrNum,  // in
> > -                        TPM_DIGEST  inDigest, // in
> > -                        TPM_PCRVALUE*  outDigest) // out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_Extend;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 5,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT32, &pcrNum,
> > -                         BSG_TPM_DIGEST, &inDigest);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> > -              == TDDL_SUCCESS) {
> > -
> > -    // unpack to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND){
> > -      // Extract the remaining output parameters
> > -      BSG_Unpack(BSG_TPM_PCRVALUE, OutBuf+i, outDigest);
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Extend Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCSP_Seal(   TCS_CONTEXT_HANDLE hContext,  // in
> > -                        TCS_KEY_HANDLE  keyHandle,  // in
> > -                        TPM_ENCAUTH   encAuth,  // in
> > -                        UINT32    pcrInfoSize, // in
> > -                        BYTE*    PcrInfo,  // in
> > -                        UINT32    inDataSize,  // in
> > -                        BYTE*    inData,   // in
> > -                        TCS_AUTH*   pubAuth,  // in, out
> > -                        UINT32*    SealedDataSize, // out
> > -                        BYTE**    SealedData)  // out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_Seal;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (inData == NULL || pubAuth == NULL || SealedDataSize == NULL || SealedData == NULL)
> > -    return TPM_BAD_PARAMETER;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 6,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT32, &keyHandle,
> > -                         BSG_TPM_ENCAUTH, encAuth,
> > -                         BSG_TYPE_UINT32, &pcrInfoSize);
> > -  memcpy(InBuf+InLength, PcrInfo, pcrInfoSize);
> > -  InLength += pcrInfoSize;
> > -  InLength += BSG_Pack(BSG_TYPE_UINT32, &inDataSize, InBuf+InLength);
> > -  memcpy(InBuf+InLength, inData, inDataSize);
> > -  InLength += inDataSize;
> > -  InLength += packAuth(InBuf+InLength, pubAuth);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> > -              == TDDL_SUCCESS) {
> > -    // unpack OutBuf to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      TPM_STORED_DATA sealedData;
> > -
> > -      i += BSG_Unpack(BSG_TPM_STORED_DATA, OutBuf+i, &sealedData);
> > -      unpackAuth(pubAuth, OutBuf+i);
> > -
> > -      // fill SealedData
> > -      BYTE tempBuf[1024];
> > -      *SealedDataSize = BSG_Pack(BSG_TPM_STORED_DATA, &sealedData, tempBuf);
> > -      if (TCS_Malloc(hContext, *SealedDataSize, SealedData) == TPM_FAIL) {
> > -       return TPM_SIZE;
> > -      }
> > -      memcpy(*SealedData, tempBuf, *SealedDataSize);
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Seal Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCSP_Unseal(TCS_CONTEXT_HANDLE hContext,  // in
> > -                      TCS_KEY_HANDLE  parentHandle, // in
> > -                      UINT32    SealedDataSize, // in
> > -                      BYTE*    SealedData,  // in
> > -                      TCS_AUTH*   parentAuth,  // in, out
> > -                      TCS_AUTH*   dataAuth,  // in, out
> > -                      UINT32*   DataSize,  // out
> > -                      BYTE**    Data)   // out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_AUTH2_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_Unseal;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (SealedData == NULL || parentAuth == NULL || dataAuth == NULL ||
> > -      DataSize == NULL || Data == NULL)
> > -    return TPM_BAD_PARAMETER;
> > -
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 4,
> > -                                     BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &ordinal,
> > -                          BSG_TYPE_UINT32, &parentHandle);
> > -  memcpy(InBuf+InLength, SealedData, SealedDataSize);
> > -  InLength += SealedDataSize;
> > -  InLength += packAuth(InBuf+InLength, parentAuth);
> > -  InLength += packAuth(InBuf+InLength, dataAuth);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> > -    // unpack OutBuf to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList( OutBuf, 3,
> > -                            BSG_TPM_TAG, &tag,
> > -                            BSG_TYPE_UINT32, &paramSize,
> > -                            BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH2_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      i += BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, DataSize);
> > -      if (TCS_Malloc(hContext, *DataSize, Data) == TPM_FAIL) {
> > -        return TPM_SIZE;
> > -      }
> > -      memcpy(*Data, OutBuf+i, *DataSize);
> > -      i += *DataSize;
> > -      i += unpackAuth(parentAuth, OutBuf+i);
> > -      unpackAuth(dataAuth, OutBuf+i);
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Unseal Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCSP_UnBind(TCS_CONTEXT_HANDLE hContext,  // in
> > -                      TCS_KEY_HANDLE  keyHandle,  // in
> > -                      UINT32    inDataSize,  // in
> > -                      BYTE*    inData,   // in
> > -                      TCS_AUTH*   privAuth,  // in, out
> > -                      UINT32*   outDataSize, // out
> > -                      BYTE**    outData)  // out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_UnBind;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (inData == NULL || privAuth == NULL || outDataSize == NULL || outData == NULL)
> > -    return TPM_BAD_PARAMETER;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 5,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT32, &keyHandle,
> > -                         BSG_TYPE_UINT32, &inDataSize);
> > -  memcpy(InBuf+InLength, inData, inDataSize);
> > -  InLength += inDataSize;
> > -  InLength += packAuth(InBuf+InLength, privAuth);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "\n\tSending paramSize = %d", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> > -    // unpack OutBuf to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      i += BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, outDataSize);
> > -      if (TCS_Malloc(hContext, *outDataSize, outData) == TPM_FAIL)
> > -        return TPM_SIZE;
> > -
> > -      memcpy(*outData, OutBuf+i, *outDataSize);
> > -      i += *outDataSize;
> > -      unpackAuth(privAuth, OutBuf+i);
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_UnBind Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCSP_CreateWrapKey(TCS_CONTEXT_HANDLE hContext,   // in
> > -                             TCS_KEY_HANDLE  hWrappingKey,  // in
> > -                             TPM_ENCAUTH  KeyUsageAuth,  // in
> > -                             TPM_ENCAUTH  KeyMigrationAuth, // in
> > -                             UINT32*    pcKeySize,   // in, out
> > -                             BYTE**    prgbKey,   // in, out
> > -                             TCS_AUTH*   pAuth)    // in, out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_CreateWrapKey;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (pcKeySize == NULL || *prgbKey == NULL || pAuth == NULL)
> > -    return TPM_BAD_PARAMETER;
> > -
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 6,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT32, &hWrappingKey,
> > -                         BSG_TPM_ENCAUTH, KeyUsageAuth,
> > -                         BSG_TPM_ENCAUTH, KeyMigrationAuth);
> > -  memcpy(InBuf+InLength, *prgbKey, *pcKeySize);
> > -  InLength += *pcKeySize;
> > -  InLength += packAuth(InBuf+InLength, pAuth);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> > -    // unpack OutBuf to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_RESULT, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      TPM_KEY wrappedKey;
> > -
> > -      i += BSG_Unpack(BSG_TPM_KEY, OutBuf+i, &wrappedKey);
> > -      unpackAuth(pAuth, OutBuf+i);
> > -
> > -      // Fill prgbKey
> > -      BYTE tempBuf[1024];
> > -      *pcKeySize = BSG_Pack(BSG_TPM_KEY, &wrappedKey, tempBuf);
> > -      if (TCS_Malloc(hContext, *pcKeySize, prgbKey) == TPM_FAIL)
> > -        return TPM_SIZE;
> > -
> > -      memcpy(*prgbKey, tempBuf, *pcKeySize);
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_CreateWrapKey Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCSP_LoadKeyByBlob(TCS_CONTEXT_HANDLE hContext,    // in
> > -                             TCS_KEY_HANDLE  hUnwrappingKey,   // in
> > -                             UINT32    cWrappedKeyBlobSize, // in
> > -                             BYTE*    rgbWrappedKeyBlob,  // in
> > -                             TCS_AUTH*   pAuth,     // in, out
> > -                             TCS_KEY_HANDLE*  phKeyTCSI,    // out
> > -                             TCS_KEY_HANDLE*  phKeyHMAC)    // out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_LoadKey;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (rgbWrappedKeyBlob == NULL || pAuth == NULL || phKeyTCSI == NULL || phKeyHMAC == NULL)
> > -    return TPM_BAD_PARAMETER;
> > -
> > -  *phKeyHMAC = hUnwrappingKey; // the parent key is the one that the TPM use to make the HMAC calc
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 4,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT32, &hUnwrappingKey);
> > -  memcpy(InBuf+InLength, rgbWrappedKeyBlob, cWrappedKeyBlobSize);
> > -  InLength += cWrappedKeyBlobSize;
> > -  InLength += packAuth(InBuf+InLength, pAuth);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> > -    // unpack OutBuf to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      i += BSG_Unpack(BSG_TYPE_UINT32,
> > -                     OutBuf+i,
> > -                     phKeyTCSI);
> > -      unpackAuth(pAuth, OutBuf+i);
> > -
> > -      if (!AddHandleToList(hContext, TPM_RT_KEY, *phKeyTCSI)) {
> > -        vtpmlogerror(VTPM_LOG_TCS, "New KeyHandle not recorded\n");
> > -      }
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -     } else
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_LoadKeyByBlob Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCSP_EvictKey(TCS_CONTEXT_HANDLE hContext, // in
> > -                        TCS_KEY_HANDLE  hKey)  // in
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_EvictKey;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 4,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT32, &hKey);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> > -    // unpack OutBuf to get the tag, paramSize, & returnCode
> > -    BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (!DeleteHandleFromList(hContext, hKey)) {
> > -      vtpmlogerror(VTPM_LOG_TCS, "KeyHandle not removed from list\n");
> > -    }
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else {
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_EvictKey Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -    }
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -TPM_RESULT TCSP_GetRandom(TCS_CONTEXT_HANDLE hContext,  // in
> > -                         UINT32*    bytesRequested, // in, out
> > -                         BYTE**    randomBytes) // out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_GetRandom;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (bytesRequested == NULL || *randomBytes == NULL){
> > -    return TPM_BAD_PARAMETER;
> > -  }
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 4,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TYPE_UINT32, bytesRequested);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> > -    // unpack OutBuf to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, bytesRequested);
> > -      if (TCS_Malloc(hContext, *bytesRequested, randomBytes) == TPM_FAIL) {
> > -        return TPM_SIZE;
> > -      }
> > -      memcpy(*randomBytes, OutBuf+i+sizeof(UINT32), *bytesRequested);
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else {
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_GetRandom Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -    }
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -
> > -TPM_RESULT TCSP_ReadPubek(TCS_CONTEXT_HANDLE   hContext,               // in
> > -                         TPM_NONCE            antiReplay,             // in
> > -                         UINT32*              pubEndorsementKeySize,  // out
> > -                         BYTE**               pubEndorsementKey,      // out
> > -                         TPM_DIGEST*          checksum)               // out
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_ReadPubek;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32   OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // check input params
> > -  if (pubEndorsementKeySize == NULL || pubEndorsementKey == NULL || checksum == NULL) {
> > -    return TPM_BAD_PARAMETER;
> > -  }
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 4,
> > -                         BSG_TPM_TAG, &tag,
> > -                         BSG_TYPE_UINT32, &paramSize,
> > -                         BSG_TPM_COMMAND_CODE, &ordinal,
> > -                         BSG_TPM_NONCE, &antiReplay);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> > -    // unpack OutBuf to get the tag, paramSize, & returnCode
> > -    int i = BSG_UnpackList(OutBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> > -      // Extract the remaining output parameters
> > -      TPM_PUBKEY pubEK;
> > -      i += BSG_UnpackList(OutBuf+i, 2,
> > -                         BSG_TPM_PUBKEY, &pubEK,
> > -                         BSG_TPM_DIGEST, checksum);
> > -
> > -      // fill EndorsementKey
> > -      BYTE tempBuf[1024];
> > -      *pubEndorsementKeySize = BSG_Pack(BSG_TPM_PUBKEY, &pubEK, tempBuf);
> > -      if (TCS_Malloc(hContext, *pubEndorsementKeySize, pubEndorsementKey) == TPM_FAIL) {
> > -        return TPM_SIZE;
> > -      }
> > -      memcpy(*pubEndorsementKey, tempBuf, *pubEndorsementKeySize);
> > -
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else {
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_ReadPubek Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -    }
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -
> > -TPM_RESULT TCSP_SaveState(TCS_CONTEXT_HANDLE   hContext)  // in
> > -{
> > -  // setup input/output parameters block
> > -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> > -  UINT32 paramSize = 0;
> > -  TPM_COMMAND_CODE ordinal = TPM_ORD_SaveState;
> > -  TPM_RESULT returnCode = TPM_SUCCESS;
> > -
> > -  // setup the TPM driver input and output buffers
> > -  TDDL_RESULT hRes = TDDL_E_FAIL;
> > -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> > -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> > -
> > -  // Convert Byte Input parameter in the input byte stream InBuf
> > -  InLength = BSG_PackList(InBuf, 3,
> > -                          BSG_TPM_TAG, &tag,
> > -                          BSG_TYPE_UINT32, &paramSize,
> > -                          BSG_TPM_COMMAND_CODE, &ordinal);
> > -  // fill paramSize again as we now have the correct size
> > -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> > -
> > -  // call the TPM driver
> > -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> > -    // unpack OutBuf to get the tag, paramSize, & returnCode
> > -    BSG_UnpackList(OutBuf, 3,
> > -                           BSG_TPM_TAG, &tag,
> > -                           BSG_TYPE_UINT32, &paramSize,
> > -                           BSG_TPM_COMMAND_CODE, &returnCode);
> > -
> > -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> > -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> > -    } else {
> > -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_SaveState Failed with return code %s\n", tpm_get_error_name(returnCode));
> > -    }
> > -  }
> > -
> > -  return(returnCode);
> > -}
> > -
> > -
> > -TPM_RESULT TCSP_RawTransmitData(   UINT32 inDataSize,  // in
> > -                                  BYTE *inData,       // in
> > -                                  UINT32 *outDataSize,// in/out
> > -                                  BYTE *outData) {    // out
> > -
> > -  TDDL_RESULT hRes;
> > -
> > -  vtpmloginfo(VTPM_LOG_TCS, "Calling TransmitData directly.\n");
> > -  //FIXME: Add Context Management
> > -  hRes = TDDL_TransmitData( inData,
> > -                           inDataSize,
> > -                           outData,
> > -                           outDataSize);
> > -
> > -  if (hRes == TDDL_SUCCESS) {
> > -    return TPM_SUCCESS;
> > -  } else {
> > -    vtpmlogerror(VTPM_LOG_TCS, "TCSP_RawTransmitData Failed with return code %s\n", tpm_get_error_name(TPM_IOERROR));
> > -    return TPM_IOERROR;
> > -  }
> > -
> > -}
> > diff --git a/tools/vtpm_manager/tcs/tcs.h b/tools/vtpm_manager/tcs/tcs.h
> > deleted file mode 100644
> > index 83b9cd0..0000000
> > --- a/tools/vtpm_manager/tcs/tcs.h
> > +++ /dev/null
> > @@ -1,245 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// tcs.h
> > -//
> > -//  This file declares the TCS API
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __TCS_H__
> > -#define __TCS_H__
> > -
> > -#include "tcg.h"
> > -#include "contextmgr.h"
> > -#include "buffer.h"
> > -
> > -#define HANDLE_NULL 0
> > -
> > -// ------------------------------------------------------------------
> > -// Exposed API
> > -// ------------------------------------------------------------------
> > -
> > -TPM_RESULT TCS_create();
> > -void TCS_destroy();
> > -
> > -TPM_RESULT TCS_OpenContext( /* OUT */ TCS_CONTEXT_HANDLE* hContext );
> > -
> > -TPM_RESULT TCS_CloseContext ( /* IN */ TCS_CONTEXT_HANDLE hContext );
> > -
> > -TPM_RESULT TCS_Malloc ( TCS_CONTEXT_HANDLE hContext, // in
> > -                       UINT32   MemSize, // in
> > -                       BYTE**   ppMemPtr ); //out
> > -
> > -TPM_RESULT TCS_FreeMemory ( TCS_CONTEXT_HANDLE hContext, // in
> > -                           BYTE*    pMemory);  // in
> > -
> > -// ------------------------------------------------------------------
> > -// Exposed API
> > -// ------------------------------------------------------------------
> > -
> > -// TPM v1.1B Command Set
> > -
> > -// Authorzation
> > -TPM_RESULT TCSP_OIAP( TCS_CONTEXT_HANDLE hContext, // in
> > -                     TCS_AUTHHANDLE*  authHandle, // out
> > -                     TPM_NONCE*   nonce0  // out
> > -                     );
> > -
> > -TPM_RESULT TCSP_OSAP (  TCS_CONTEXT_HANDLE hContext,  // in
> > -                       TPM_ENTITY_TYPE entityType,  // in
> > -                       UINT32    entityValue, // in
> > -                       TPM_NONCE   nonceOddOSAP, // in
> > -                       TCS_AUTHHANDLE*  authHandle,  // out
> > -                       TPM_NONCE*   nonceEven,  // out
> > -                       TPM_NONCE*   nonceEvenOSAP // out
> > -                       );
> > -
> > -TPM_RESULT TCSP_TakeOwnership (  TCS_CONTEXT_HANDLE hContext,   // in
> > -                                UINT16    protocolID,   // in
> > -                                UINT32    encOwnerAuthSize, // in
> > -                                BYTE*    encOwnerAuth,  // in
> > -                                UINT32    encSrkAuthSize,  // in
> > -                                BYTE*    encSrkAuth,   // in
> > -                                UINT32*    SrkSize,   // in, out
> > -                                BYTE**    Srk,    // in, out
> > -                                TCS_AUTH*   ownerAuth   // in, out
> > -                                );
> > -
> > -TPM_RESULT TCSP_DisablePubekRead (  TCS_CONTEXT_HANDLE hContext, // in
> > -                                    TCS_AUTH*   ownerAuth // in, out
> > -                                    );
> > -
> > -TPM_RESULT TCSP_TerminateHandle (  TCS_CONTEXT_HANDLE hContext, // in
> > -                                  TCS_AUTHHANDLE  handle  // in
> > -                                  );
> > -
> > -TPM_RESULT TCSP_FlushSpecific (  TCS_CONTEXT_HANDLE hContext, // in
> > -                                TCS_AUTHHANDLE  handle,  // in
> > -                                TPM_RESOURCE_TYPE resourceType //in
> > -                                );
> > -
> > -// TPM Mandatory
> > -TPM_RESULT TCSP_Extend (  TCS_CONTEXT_HANDLE hContext, // in
> > -                         TPM_PCRINDEX  pcrNum,  // in
> > -                         TPM_DIGEST   inDigest, // in
> > -                         TPM_PCRVALUE*   outDigest // out
> > -                         );
> > -
> > -TPM_RESULT TCSP_PcrRead (  TCS_CONTEXT_HANDLE hContext, // in
> > -                          TPM_PCRINDEX  pcrNum,  // in
> > -                          TPM_PCRVALUE*  outDigest // out
> > -                          );
> > -
> > -TPM_RESULT TCSP_Quote (  TCS_CONTEXT_HANDLE hContext,  // in
> > -                        TCS_KEY_HANDLE  keyHandle,  // in
> > -                        TPM_NONCE   antiReplay,  // in
> > -                        UINT32*    PcrDataSize, // in, out
> > -                        BYTE**    PcrData,  // in, out
> > -                        TCS_AUTH*   privAuth,  // in, out
> > -                        UINT32*    sigSize,  // out
> > -                        BYTE**    sig    // out
> > -                        );
> > -
> > -TPM_RESULT TCSP_Seal (  TCS_CONTEXT_HANDLE hContext,  // in
> > -                       TCS_KEY_HANDLE  keyHandle,  // in
> > -                       TPM_ENCAUTH  encAuth,  // in
> > -                       UINT32    pcrInfoSize, // in
> > -                       BYTE*    PcrInfo,  // in
> > -                       UINT32    inDataSize,  // in
> > -                       BYTE*    inData,   // in
> > -                       TCS_AUTH*   pubAuth,  // in, out
> > -                       UINT32*    SealedDataSize, // out
> > -                       BYTE**    SealedData  // out
> > -                       );
> > -
> > -TPM_RESULT TCSP_Unseal (  TCS_CONTEXT_HANDLE hContext,  // in
> > -                         TCS_KEY_HANDLE  parentHandle, // in
> > -                         UINT32    SealedDataSize, // in
> > -                         BYTE*    SealedData,  // in
> > -                         TCS_AUTH*   parentAuth,  // in, out
> > -                         TCS_AUTH*   dataAuth,  // in, out
> > -                         UINT32*    DataSize,  // out
> > -                         BYTE**    Data   // out
> > -                         );
> > -
> > -TPM_RESULT TCSP_DirWriteAuth (  TCS_CONTEXT_HANDLE hContext,  // in
> > -                               TPM_DIRINDEX  dirIndex,  // in
> > -                               TPM_DIRVALUE  newContents, // in
> > -                               TCS_AUTH*   ownerAuth  // in, out
> > -                               );
> > -
> > -TPM_RESULT TCSP_DirRead (  TCS_CONTEXT_HANDLE hContext, // in
> > -                          TPM_DIRINDEX  dirIndex, // in
> > -                          TPM_DIRVALUE*  dirValue // out
> > -                          );
> > -
> > -TPM_RESULT TCSP_UnBind (  TCS_CONTEXT_HANDLE hContext,  // in
> > -                         TCS_KEY_HANDLE  keyHandle,  // in
> > -                         UINT32    inDataSize,  // in
> > -                         BYTE*    inData,   // in
> > -                         TCS_AUTH*   privAuth,  // in, out
> > -                         UINT32*    outDataSize, // out
> > -                         BYTE**    outData   // out
> > -                         );
> > -
> > -TPM_RESULT TCSP_CreateWrapKey (  TCS_CONTEXT_HANDLE hContext,   // in
> > -                                TCS_KEY_HANDLE  hWrappingKey,  // in
> > -                                TPM_ENCAUTH  KeyUsageAuth,  // in
> > -                                TPM_ENCAUTH  KeyMigrationAuth, // in
> > -                                UINT32*    pcKeySize,   // in, out
> > -                                BYTE**    prgbKey,   // in, out
> > -                                TCS_AUTH*   pAuth    // in, out
> > -                                );
> > -
> > -TPM_RESULT TCSP_LoadKeyByBlob (  TCS_CONTEXT_HANDLE hContext,    // in
> > -                                TCS_KEY_HANDLE  hUnwrappingKey,   // in
> > -                                UINT32    cWrappedKeyBlobSize, // in
> > -                                BYTE*    rgbWrappedKeyBlob,  // in
> > -                                TCS_AUTH*   pAuth,     // in, out
> > -                                TCS_KEY_HANDLE*  phKeyTCSI,    // out
> > -                                TCS_KEY_HANDLE*  phKeyHMAC    // out
> > -                                );
> > -
> > -TPM_RESULT TCSP_GetPubKey (  TCS_CONTEXT_HANDLE hContext,  // in
> > -                            TCS_KEY_HANDLE  hKey,   // in
> > -                            TCS_AUTH*   pAuth,   // in, out
> > -                            UINT32*    pcPubKeySize, // out
> > -                            BYTE**    prgbPubKey  // out
> > -                            );
> > -
> > -TPM_RESULT TCSP_EvictKey (  TCS_CONTEXT_HANDLE hContext, // in
> > -                           TCS_KEY_HANDLE  hKey  // in
> > -                           );
> > -
> > -TPM_RESULT TCSP_Sign (  TCS_CONTEXT_HANDLE hContext,  // in
> > -                       TCS_KEY_HANDLE  keyHandle,  // in
> > -                       UINT32    areaToSignSize, // in
> > -                       BYTE*    areaToSign,  // in
> > -                       TCS_AUTH*   privAuth,  // in, out
> > -                       UINT32*    sigSize,  // out
> > -                       BYTE**    sig    // out
> > -                       );
> > -
> > -TPM_RESULT TCSP_GetRandom (  TCS_CONTEXT_HANDLE hContext,  // in
> > -                            UINT32*    bytesRequested, // in, out
> > -                            BYTE**    randomBytes  // out
> > -                            );
> > -
> > -TPM_RESULT TCSP_StirRandom (  TCS_CONTEXT_HANDLE hContext, // in
> > -                             UINT32    inDataSize, // in
> > -                             BYTE*    inData  // in
> > -                             );
> > -
> > -TPM_RESULT TCSP_ReadPubek (  TCS_CONTEXT_HANDLE hContext,    // in
> > -                            TPM_NONCE   antiReplay,    // in
> > -                            UINT32*    pubEndorsementKeySize, // out
> > -                            BYTE**    pubEndorsementKey,  // out
> > -                            TPM_DIGEST*  checksum    // out
> > -                            );
> > -
> > -
> > -// Non-Standard TCSP calls
> > -TPM_RESULT TCSP_SaveState(TCS_CONTEXT_HANDLE   hContext);  // in
> > -
> > -//Give direct access to TransmitData.
> > -// Key and Auth Management is done before transfering command to TDDL.
> > -TPM_RESULT TCSP_RawTransmitData(UINT32 inDataSize,  // in
> > -                               BYTE *inData,       // in
> > -                               UINT32 *outDataSize,// in/out
> > -                               BYTE *outData);     // out
> > -
> > -///////////// Private Functions ////////////////////
> > -CONTEXT_HANDLE* LookupContext( TCS_CONTEXT_HANDLE hContext);
> > -
> > -#endif //TCS_H
> > diff --git a/tools/vtpm_manager/tcs/tpmddl.h b/tools/vtpm_manager/tcs/tpmddl.h
> > deleted file mode 100644
> > index e7e54f1..0000000
> > --- a/tools/vtpm_manager/tcs/tpmddl.h
> > +++ /dev/null
> > @@ -1,69 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// tpmddl.c
> > -//
> > -//  This file defines the TDDLI API
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __TPMDDL_H__
> > -#define __TPMDDL_H__
> > -
> > -#define TDDL_CAP_PROP_MANUFACTURER 0x0001
> > -
> > -#define TDDL_E_FAIL 1
> > -#define TDDL_E_SUCCESS 0
> > -#define TDDL_SUCCESS 0
> > -
> > -typedef unsigned int TDDL_UINT32;
> > -typedef TDDL_UINT32 TDDL_RESULT;
> > -typedef unsigned char TDDL_BYTE;
> > -
> > -TDDL_RESULT TDDL_Open();
> > -void TDDL_Close();
> > -TDDL_RESULT TDDL_TransmitData( TDDL_BYTE* in,
> > -                              TDDL_UINT32 insize,
> > -                              TDDL_BYTE* out,
> > -                              TDDL_UINT32* outsize);
> > -TDDL_RESULT TDDL_GetStatus();
> > -TDDL_RESULT TDDL_GetCapability( TDDL_UINT32 cap,
> > -                               TDDL_UINT32 sub,
> > -                               TDDL_BYTE* buffer,
> > -                               TDDL_UINT32* size);
> > -TDDL_RESULT TDDL_SetCapability( TDDL_UINT32 cap,
> > -                               TDDL_UINT32 sub,
> > -                               TDDL_BYTE* buffer,
> > -                               TDDL_UINT32* size);
> > -
> > -#endif // __TPMDDL_H__
> > diff --git a/tools/vtpm_manager/tcs/transmit.c b/tools/vtpm_manager/tcs/transmit.c
> > deleted file mode 100644
> > index 74bbdca..0000000
> > --- a/tools/vtpm_manager/tcs/transmit.c
> > +++ /dev/null
> > @@ -1,147 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -
> > -#include <unistd.h>
> > -#include <stdio.h>
> > -#include <errno.h>
> > -#include <fcntl.h>
> > -
> > -#include "tcg.h"
> > -#include "buffer.h"
> > -#include "log.h"
> > -#include "tpmddl.h"
> > -
> > -// flag to track whether TDDL has been opened
> > -static int g_TDDL_open = 0;
> > -static int g_tx_fd = -1;              // the fd to the TPM
> > -
> > -#ifndef DUMMY_TPM
> > - #define TPM_TX_FNAME "/dev/tpm0"
> > - static int *g_rx_fdp = &g_tx_fd;
> > -#else
> > - #define TPM_TX_FNAME "/var/tpm/tpm_in.fifo"
> > - #define TPM_RX_FNAME "/var/tpm/tpm_out.fifo"
> > - static int g_rx_fd = -1;
> > - static int *g_rx_fdp = &g_rx_fd;              // the fd to the TPM
> > -#endif
> > -
> > -TPM_RESULT
> > -TDDL_TransmitData( TDDL_BYTE* in,
> > -                  TDDL_UINT32 insize,
> > -                  TDDL_BYTE* out,
> > -                  TDDL_UINT32* outsize) {
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -  TDDL_UINT32 i;
> > -
> > -  vtpmloginfo(VTPM_LOG_TXDATA, "Sending buffer = 0x");
> > -  for(i = 0 ; i < insize ; i++)
> > -    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", in[i]);
> > -
> > -  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> > -
> > -  ssize_t size = 0;
> > -
> > -  // send the request
> > -  size = write (g_tx_fd, in, insize);
> > -  if (size < 0) {
> > -    vtpmlogerror(VTPM_LOG_TXDATA, "write() failed");
> > -    ERRORDIE (TPM_IOERROR);
> > -  }
> > -  else if ((TDDL_UINT32) size < insize) {
> > -    vtpmlogerror(VTPM_LOG_TXDATA, "Wrote %d instead of %d bytes!\n", (int) size, insize);
> > -    // ... ?
> > -  }
> > -
> > -  // read the response
> > -  size = read (*g_rx_fdp, out, TCPA_MAX_BUFFER_LENGTH);
> > -  if (size < 0) {
> > -    vtpmlogerror(VTPM_LOG_TXDATA, "read() failed");
> > -    ERRORDIE (TPM_IOERROR);
> > -  }
> > -
> > -  vtpmloginfo(VTPM_LOG_TXDATA, "Receiving buffer = 0x");
> > -  for(i = 0 ; i < size ; i++)
> > -    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out[i]);
> > -
> > -  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> > -
> > -  *outsize = size;
> > -  // close connection
> > -  goto egress;
> > -
> > - abort_egress:
> > - egress:
> > -  return status;
> > -}
> > -
> > -TPM_RESULT TDDL_Open() {
> > -
> > -  TDDL_RESULT status = TDDL_SUCCESS;
> > -
> > -  if (g_TDDL_open)
> > -    return TPM_FAIL;
> > -
> > -#ifdef DUMMY_TPM
> > -  *g_rx_fdp = open (TPM_RX_FNAME, O_RDWR);
> > -#endif
> > -
> > -  g_tx_fd = open (TPM_TX_FNAME, O_RDWR);
> > -  if (g_tx_fd < 0) {
> > -    vtpmlogerror(VTPM_LOG_TXDATA, "TPM open failed");
> > -    return TPM_IOERROR;
> > -  }
> > -
> > -  g_TDDL_open = 1;
> > -
> > -  return status;
> > -}
> > -
> > -void TDDL_Close() {
> > -  if (! g_TDDL_open)
> > -        return;
> > -
> > -  if (g_tx_fd>= 0) {
> > -    if (close(g_tx_fd) < 0)
> > -      vtpmlogerror(VTPM_LOG_TXDATA, "closeing tpm failed");
> > -    g_tx_fd = -1;
> > -  }
> > -
> > -  if (*g_rx_fdp>= 0) {
> > -    if (close(*g_rx_fdp) < 0)
> > -      vtpmlogerror(VTPM_LOG_TXDATA, "closeing tpm failed");
> > -    *g_rx_fdp = -1;
> > -  }
> > -
> > -  g_TDDL_open = 0;
> > -
> > -}
> > diff --git a/tools/vtpm_manager/util/Makefile b/tools/vtpm_manager/util/Makefile
> > deleted file mode 100644
> > index 36bc38f..0000000
> > --- a/tools/vtpm_manager/util/Makefile
> > +++ /dev/null
> > @@ -1,24 +0,0 @@
> > -XEN_ROOT = $(CURDIR)/../../..
> > -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> > -
> > -BIN            = libTCGUtils.a
> > -
> > -.PHONY: all
> > -all: build
> > -
> > -.PHONY: build
> > -build: $(BIN)
> > -
> > -.PHONY: install
> > -install: build
> > -
> > -.PHONY: clean
> > -clean:
> > -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> > -
> > -.PHONY: mrproper
> > -mrproper: clean
> > -       rm -f *~
> > -
> > -$(BIN): $(OBJS)
> > -       $(AR) rcs $(BIN) $(OBJS)
> > diff --git a/tools/vtpm_manager/util/bsg.c b/tools/vtpm_manager/util/bsg.c
> > deleted file mode 100644
> > index fa36ce7..0000000
> > --- a/tools/vtpm_manager/util/bsg.c
> > +++ /dev/null
> > @@ -1,829 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// bsg.cpp
> > -//
> > -//  This file will handle all the TPM Byte Stream functions
> > -//
> > -// ==================================================================
> > -
> > -#include <stdio.h>
> > -#include <string.h>
> > -#include <stdarg.h>
> > -#include <malloc.h>
> > -#include "tcg.h"
> > -#include "crypto.h"
> > -#include "bsg.h"
> > -#include "log.h"
> > -
> > -static int g_log_recursion_level = 0;
> > -
> > -// a largest buffer size. if we get a buf size bigger than this when unpacking,
> > -// will complain!
> > -#define BSG_MAX_BUF_SIZE (1<<18)
> > -
> > -#define bsglog(fmt, ...) do { \
> > -    int __i; \
> > -    for (__i=0; __i < g_log_recursion_level; __i++) {               \
> > -      vtpmloginfomore (VTPM_LOG_BSG, "%s", "  ");                           \
> > -    }                                                                 \
> > -    vtpmloginfomore (VTPM_LOG_BSG, fmt, __VA_ARGS__);                         \
> > -  } while (0)
> > -
> > -
> > -// FIXME:  trigger the selfcheck--need to use glibc hook to do this
> > -//BOOL dummy1 = BSG_static_selfcheck();
> > -
> > -
> > -// Interpretting Types
> > -// -------------------
> > -//
> > -// Incoming Types are composed of two parts {format, info} squished into a
> > -// BSG_UINT32.  The first 4 bits is a format spec indicating what type of
> > -// data it is.  If the first 4 bits are zero the info corresponds to a value in
> > -// BSG_s_fmt[]. This is a structure whose composition is described in
> > -// BSG_s_fmt[]. If the value is non-zero, info corresponds to the size of the
> > -// data (in bytes) being passed in. For example a UINT32 being passed in would
> > -// have a format of (__FMT_CONST | 4). If both, the format and info are zero,
> > -// this is interpretted as the end of the structure, and the result is returned.
> > -
> > -// these flags are mutually exclusive, so I'll just make them
> > -// format values which indicate the semantics of the 'info' part and the source
> > -// data. The above description has been accordingly adjusted.
> > -
> > -// format values for determining what type of data the incoming type is
> > -// it's a 4 bit value, occupying the high 4 bits
> > -#define __FMT_CONST (1UL << 28) // Constant sized value
> > -#define __FMT_DATA  (2UL << 28) // Believed to be raw data NOT {size,data}
> > -#define __FMT_SIZE  (3UL << 28) // A size. Used in FMT_SIZE??_DATA.
> > -#define __FMT_HSIZE (4UL << 28) // A number of handles
> > -#define __FMT_PACKED (5UL << 28) // 'info' is unused; the source data consists
> > -                                 // of {size32, data} but we're to pack only the
> > -                                 // data as that is already packed, and so
> > -                                 // can/must be unpacked without
> > -                                 // explicitly reading it size
> > -
> > -#define __FMT_MASK  0x0FFFFFFFUL // this masks out the 4-bit format
> > -#define __FMT_MASK_SIZE(type)   ((type) & __FMT_MASK)
> > -#define __FMT_MASK_FORMAT(type) ((type) & (~__FMT_MASK))
> > -
> > -// constant (8/16/32-bits)
> > -#define FMT_U8 (__FMT_CONST | 1UL)
> > -#define FMT_U16 (__FMT_CONST | 2UL)
> > -#define FMT_U32 (__FMT_CONST | 4UL)
> > -
> > -// const with a compiler-computed size
> > -#define FMT_SIZEOF(type) (__FMT_CONST | sizeof(type))
> > -
> > -// other data (size bytes)
> > -// Used primarily for DIGESTS -> FMT_DATA(20)
> > -#define FMT_DATA(size) (__FMT_DATA | ((BSG_UINT32) (size) & __FMT_MASK))
> > -
> > -// 16/32-bit size followed by N bytes of data
> > -#define FMT_SIZE16_DATA (__FMT_SIZE | 2UL)
> > -#define FMT_SIZE32_DATA (__FMT_SIZE | 4UL)
> > -
> > -// 16-bit size followed by N key handles
> > -#define FMT_SIZE16_HANDLES (__FMT_HSIZE | 2UL)
> > -
> > -#define DIGEST_SIZE 20
> > -typedef BSG_UINT32 BSG_HANDLE;
> > -
> > -// TCPA_AUTH has 11 fields!
> > -#define MAX_FIELDS 11
> > -typedef struct BSG_Format
> > -{
> > -  BSG_Type type;
> > -  const char* name;
> > -  BSG_UINT32 fields[MAX_FIELDS + 1];
> > -} BSG_Format;
> > -
> > -/*
> > - * TCPA structure data formats
> > - */
> > -// this has to be manually kept in sync with the
> > -// Type enum!! the static_selfcheck() function should be used regularly!
> > -static BSG_Format s_fmt[] =
> > -{
> > -  {BSG_TYPE_UINT32, "BSG_TYPE_UINT32", {FMT_U32, 0}},
> > -  {BSG_TYPE_UINT16, "BSG_TYPE_UINT16", {FMT_U16, 0}},
> > -  {BSG_TYPE_BYTE, "BSG_TYPE_BYTE", {FMT_U8, 0}},
> > -  {BSG_TYPE_BOOL, "BSG_TYPE_BOOL", {FMT_U8, 0}},
> > -  {BSG_TPM_SIZE32_DATA, "BSG_TPM_SIZE32_DATA", {FMT_SIZE32_DATA, 0}},
> > -  {BSG_TPM_TAG, "BSG_TPM_TAG", {FMT_SIZEOF(TPM_TAG), 0}},
> > -  {BSG_TPM_HANDLE, "BSG_TPM_HANDLE", {FMT_SIZEOF(TPM_HANDLE), 0}},
> > -  {BSG_TPM_RESULT, "BSG_TPM_RESULT", {FMT_SIZEOF(TPM_RESULT), 0}},
> > -  {BSG_TPM_RESOURCE_TYPE, "BSG_TPM_RESOURCE_TYPE", {FMT_SIZEOF(TPM_RESOURCE_TYPE), 0}},
> > -  {BSG_TPM_COMMAND_CODE, "BSG_TPM_COMMAND_CODE", {FMT_U32, 0}},
> > -  {BSG_TPM_AUTH_DATA_USAGE, "BSG_TPM_AUTH_DATA_USAGE", {FMT_U8, 0}},
> > -  {BSG_TPM_ALGORITHM_ID, "BSG_TPM_ALGORITHM_ID", {FMT_U32, 0}},
> > -  {BSG_TPM_PROTOCOL_ID, "BSG_TPM_PROTOCOL_ID", {FMT_SIZEOF(TPM_PROTOCOL_ID), 0}},
> > -  {BSG_TPM_KEY_USAGE, "BSG_TPM_KEY_USAGE", {FMT_U16, 0}},
> > -  {BSG_TPM_ENC_SCHEME, "BSG_TPM_ENC_SCHEME", {FMT_U16, 0}},
> > -  {BSG_TPM_SIG_SCHEME, "BSG_TPM_SIG_SCHEME", {FMT_U16, 0}},
> > -  {BSG_TPM_MIGRATE_SCHEME, "BSG_TPM_MIGRATE_SCHEME", {FMT_U16, 0}},
> > -  {BSG_TPM_KEY_FLAGS, "BSG_TPM_KEY_FLAGS", {FMT_U32, 0}},
> > -
> > -  {BSG_TPM_AUTHDATA, "BSG_TPM_AUTHDATA", {FMT_DATA(DIGEST_SIZE), 0}},
> > -  {BSG_TPM_SECRET, "BSG_TPM_SECRET", {BSG_TPM_AUTHDATA, 0}},
> > -  {BSG_TPM_ENCAUTH, "BSG_TPM_ENCAUTH", {BSG_TPM_AUTHDATA, 0}},
> > -  {BSG_TPM_PAYLOAD_TYPE, "BSG_TPM_PAYLOAD_TYPE", {FMT_SIZEOF(TPM_PAYLOAD_TYPE), 0}},
> > -
> > -  {BSG_TPM_VERSION, "BSG_TPM_VERSION", {FMT_DATA(4), 0}}, // vers 1.2
> > -  {BSG_TPM_DIGEST, "BSG_TPM_DIGEST", {FMT_DATA(DIGEST_SIZE), 0}},
> > -  {BSG_TPM_COMPOSITE_HASH, "BSG_TPM_COMPOSITE_HASH", {BSG_TPM_DIGEST, 0}},
> > -  {BSG_TPM_CHOSENID_HASH, "BSG_TPM_CHOSENID_HASH", {BSG_TPM_DIGEST, 0}},
> > -
> > -  {BSG_TPM_NONCE, "BSG_TPM_NONCE", {FMT_DATA(DIGEST_SIZE), 0}},
> > -  {BSG_TPM_KEY_HANDLE, "BSG_TPM_KEY_HANDLE", {FMT_SIZEOF(TPM_KEY_HANDLE), 0}},
> > -  {BSG_TPM_KEY_HANDLE_LIST, "BSG_TPM_KEY_HANDLE_LIST",
> > -   {FMT_SIZE16_HANDLES, 0}},
> > -
> > -  {BSG_TPM_KEY_PARMS, "BSG_TPM_KEY_PARMS", {
> > -      BSG_TPM_ALGORITHM_ID,
> > -      BSG_TPM_ENC_SCHEME,
> > -      BSG_TPM_SIG_SCHEME,
> > -      FMT_SIZE32_DATA,
> > -      0}},
> > -  {BSG_TPM_RSA_KEY_PARMS, "BSG_TPM_RSA_KEY_PARMS", {
> > -      FMT_U32, FMT_U32, FMT_SIZE32_DATA, 0}},
> > -  {BSG_TPM_STORE_PUBKEY, "BSG_TPM_STORE_PUBKEY", {FMT_SIZE32_DATA, 0}},
> > -  {BSG_TPM_PUBKEY, "BSG_TPM_PUBKEY", {BSG_TPM_KEY_PARMS, BSG_TPM_STORE_PUBKEY, 0}},
> > -  {BSG_TPM_KEY, "BSG_TPM_KEY", {
> > -      BSG_TPM_VERSION,
> > -      BSG_TPM_KEY_USAGE,
> > -      BSG_TPM_KEY_FLAGS,
> > -      BSG_TPM_AUTH_DATA_USAGE,
> > -      BSG_TPM_KEY_PARMS,
> > -      FMT_SIZE32_DATA,        // the PCR_INFO
> > -      BSG_TPM_STORE_PUBKEY,
> > -      FMT_SIZE32_DATA,        // the encrypted part
> > -      0}},
> > -
> > -  {BSG_TPM_MIGRATIONKEYAUTH, "BSG_TPM_MIGRATIONKEYAUTH", {
> > -      BSG_TPM_PUBKEY,
> > -      BSG_TPM_MIGRATE_SCHEME,
> > -      BSG_TPM_DIGEST, 0}},
> > -
> > -  {BSG_TCPA_AUDIT_EVENT, "TCPA_AUDIT_EVENT", {
> > -      BSG_TPM_COMMAND_CODE,
> > -      BSG_TPM_RESULT, 0 }},
> > -
> > -  {BSG_TCPA_EVENT_CERT, "TCPA_EVENT_CERT", {
> > -      BSG_TPM_DIGEST,
> > -      BSG_TPM_DIGEST,
> > -      FMT_DATA(2),
> > -      FMT_SIZE32_DATA, 0}},
> > -
> > -  {BSG_TPM_PCR_SELECTION, "BSG_TPM_PCR_SELECTION", {FMT_SIZE16_DATA, 0} },
> > -  {BSG_TPM_PCR_COMPOSITE, "BSG_TPM_PCR_COMPOSITE", { BSG_TPM_PCR_SELECTION,
> > -                                                    FMT_SIZE32_DATA,
> > -                                                    0} },
> > -
> > -  {BSG_TPM_PCR_INFO, "BSG_TPM_PCR_INFO", { BSG_TPM_PCR_SELECTION,
> > -                                          BSG_TPM_COMPOSITE_HASH,
> > -                                          BSG_TPM_COMPOSITE_HASH,
> > -                                          0} },
> > -
> > -
> > -  {BSG_TPM_STORED_DATA, "BSG_TPM_STORED_DATA", {
> > -      BSG_TPM_VERSION,
> > -      FMT_SIZE32_DATA,
> > -      FMT_SIZE32_DATA,
> > -      0}},
> > -  {BSG_TPM_SYMMETRIC_KEY, "BSG_TPM_SYMMETRIC_KEY", {
> > -      BSG_TPM_ALGORITHM_ID,
> > -      BSG_TPM_ENC_SCHEME,
> > -      FMT_SIZE16_DATA,
> > -      0}},
> > -  {BSG_TPM_STORE_PRIVKEY, "BSG_TPM_STORE_PRIVKEY", {FMT_SIZE32_DATA, 0}},
> > -  {BSG_TPM_STORE_ASYMKEY, "BSG_TPM_STORE_ASYMKEY", {
> > -      BSG_TPM_PAYLOAD_TYPE,
> > -      BSG_TPM_SECRET,
> > -      BSG_TPM_SECRET,
> > -      BSG_TPM_DIGEST,
> > -      BSG_TPM_STORE_PRIVKEY,
> > -      0}},
> > -  {BSG_TPM_MIGRATE_ASYMKEY, "BSG_TPM_MIGRATE_ASYMKEY", {
> > -      BSG_TPM_PAYLOAD_TYPE,
> > -      BSG_TPM_SECRET,
> > -      BSG_TPM_DIGEST,
> > -      FMT_U32,
> > -      BSG_TPM_STORE_PRIVKEY,
> > -      0}},
> > -
> > -  {BSG_TPM_QUOTE_INFO, "BSG_TPM_QUOTE_INFO", {
> > -      BSG_TPM_VERSION,
> > -      FMT_DATA(4),
> > -      BSG_TPM_COMPOSITE_HASH,
> > -      BSG_TPM_NONCE,
> > -      0}},
> > -
> > -  {BSG_TPM_IDENTITY_CONTENTS, "BSG_TPM_IDENTITY_CONTENTS", {
> > -      BSG_TPM_VERSION,
> > -      FMT_U32,
> > -      BSG_TPM_CHOSENID_HASH,
> > -      BSG_TPM_PUBKEY,
> > -      0}},
> > -
> > -  {BSG_TPM_PCRVALUE, "BSG_TPM_PCRVALUE", {FMT_DATA(DIGEST_SIZE), 0}},
> > -
> > -  {BSG_TCPA_PCR_FLAGS, "TCPA_PCR_FLAGS", {
> > -      FMT_U8,
> > -      FMT_U8,
> > -      0}},
> > -
> > -  {BSG_TCS_AUTH, "TCS_AUTH", {
> > -      BSG_TYPE_UINT32,
> > -      BSG_TPM_NONCE,
> > -      BSG_TPM_NONCE,
> > -      BSG_TYPE_BOOL,
> > -      BSG_TPM_AUTHDATA,
> > -      0}},
> > -
> > -  {BSG_TPM_KEY_NONSENSITIVE, "BSG_TPM_KEY_NONSENSITIVE", {
> > -      BSG_TPM_VERSION,
> > -      BSG_TPM_KEY_USAGE,
> > -      BSG_TPM_KEY_FLAGS,
> > -      BSG_TPM_AUTH_DATA_USAGE,
> > -      BSG_TPM_KEY_PARMS,
> > -      FMT_SIZE32_DATA,
> > -      BSG_TPM_STORE_PUBKEY,
> > -      0}},
> > -
> > -  {BSG_PACKED, "BSG_PACKED", {
> > -      __FMT_PACKED,
> > -      0 }},
> > -
> > -  {BSG_TYPE_MAX, "", {0}},
> > -};
> > -
> > -
> > -static const BSG_Format* find_format (BSG_Type t) {
> > -  BSG_Format * f = s_fmt;
> > -
> > -  if (t >= BSG_TYPE_MAX) {
> > -    return NULL;
> > -  }
> > -
> > -  // WARNING: this depends on the enum and s_fmt[] array being in sync! make
> > -  // sure to run the static_selfcheck() to make sure
> > -  f = s_fmt + (t - BSG_TYPE_FIRST);
> > -
> > -  return f;
> > -}
> > -
> > -//
> > -// a consistency-checking routine which can be run at compile time
> > -// (ie. immediately after compilation)
> > -//
> > -// tasks:
> > -// - verify that s_fmt has one entry per Type t, and that entry is at s_fmt[t]
> > -//
> > -// conditions:
> > -// - need that s_fmt[0] is the first type listed in the Type enum! ie the first
> > -//   Type has value 0, not 1
> > -//
> > -// FIXME: should have a function be passed in here which is called if the test
> > -// fails. Then the caller can decide what to do: abort, notify, whatever
> > -//
> > -BOOL BSG_static_selfcheck ()
> > -{
> > -  int i;
> > -
> > -  for (i=BSG_TYPE_FIRST; i <= BSG_TYPE_MAX; i++) {
> > -    if (s_fmt[i - BSG_TYPE_FIRST].type != i) {
> > -      bsglog ("%s\n", "BSG: static_selfcheck failed!\n");
> > -      bsglog ("failure at %i, allegedly %s\n",
> > -             i, s_fmt[i - BSG_TYPE_FIRST].name);
> > -      abort();
> > -      return FALSE;
> > -    }
> > -  }
> > -
> > -  bsglog ("%s\n", "BSG: static_selfcheck success!");
> > -  return TRUE;
> > -}
> > -
> > -
> > -/**
> > - * Flatten a TCPA structure into a buffer in big-endian format
> > - * @type: TCPA structure type
> > - * @src: (IN) TCPA structure (OUT) end of TCPA structure
> > - * @dst: (OUT) flattened data
> > - * Returns: Flattened size or -1 for unknown types
> > - */
> > -// make it so that it can just run through the whole process and return
> > -// the packed size, without packing anything. this will be done if dst is NULL.
> > -static int BSG_Pack_private(BSG_Type type, const BSG_BYTE** src, BSG_BYTE* dst)
> > -{
> > -  // check incoming parameters
> > -  if (*src == NULL)
> > -    return 0;
> > -
> > -  const BSG_BYTE* s = *src;
> > -  BSG_BYTE* d = dst;
> > -
> > -  BSG_UINT32 size   = __FMT_MASK_SIZE(type);
> > -  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
> > -
> > -  if (format == __FMT_CONST) // We are dealing with a fixed length value eg. UINT32
> > -    {
> > -      BSG_UINT32 val = 0;
> > -      switch (size) {
> > -      case 1: val = * (BYTE*) s; break;
> > -      case 2: val = * (unsigned short*) s; break;
> > -      case 4: val = * (BSG_UINT32*) s; break;
> > -      }
> > -      if (dst)
> > -       BSG_PackConst(val, size, d);
> > -
> > -      s += size;
> > -      d += size;
> > -    } else if (format == __FMT_DATA) { // We are dealing with raw data. Not sure when
> > -    // this is used.
> > -
> > -      if (dst) {
> > -        bsglog ("BSG: __FMT_DATA size %d, src %p, dst %p\n", size, s, d);
> > -        memcpy(d, s, size);
> > -      }
> > -
> > -      s += size;
> > -      d += size;
> > -  } else if (format == __FMT_SIZE || format == __FMT_HSIZE) { // It's a size, followed by that much data or handles
> > -
> > -    BSG_UINT32 psize = 0;
> > -    switch (size) {
> > -    case 1: psize = * (BYTE*) s; break;
> > -    case 2: psize = * (unsigned short*) s; break;
> > -    case 4: psize = * (BSG_UINT32*) s; break;
> > -    }
> > -
> > -    if (dst)
> > -      BSG_PackConst(psize, size, d);
> > -
> > -    s += size;
> > -    d += size;
> > -
> > -    // now 's' points to an address, so cast it to BSG_BYTE**
> > -    const BSG_BYTE* pdata = * ((BSG_BYTE**) s);
> > -    s += sizeof(BSG_BYTE*);
> > -
> > -    if (format == __FMT_HSIZE) {// This is a list of psize Handles
> > -      if (dst) {
> > -       BSG_HANDLE* d2 = (BSG_HANDLE*) d;
> > -       BSG_HANDLE* p2 = (BSG_HANDLE*) pdata;
> > -       BSG_UINT32 i;
> > -       for (i = 0; i < psize; i++)
> > -         d2[i] = BSG_UnpackConst((BSG_BYTE*)(p2 + i), 4);
> > -
> > -      }
> > -      d += psize * sizeof(BSG_HANDLE);
> > -    } else {// If it's not psize handles, it's psize data.
> > -      if (psize > 0) {
> > -       if (dst) {
> > -         bsglog ("BSG: __FMT_SIZE, size=%d, src=%p, dst=%p\n",
> > -                 psize, pdata, d);
> > -         memcpy(d, pdata, psize);
> > -       }
> > -      }
> > -      d += psize;
> > -    }
> > -  } else if (format == __FMT_PACKED) {
> > -    // the source buffer is a pack_constbuf_t, which has a size and a
> > -    // pointer. just copy the buffer value, the size is not included in the
> > -    // output stream.
> > -    pack_constbuf_t * buf = (pack_constbuf_t*) s;
> > -
> > -    if (dst) {
> > -      bsglog ("BSG: __FMT_PACKED, size=%d, src=%p, dst=%p\n",
> > -             buf->size, buf->data, d);
> > -      memcpy(d, buf->data, buf->size);
> > -    }
> > -
> > -    s += buf->size;
> > -    d += buf->size;
> > -  } else if (format == 0) {// No flags are set. This is a structure & it should
> > -                          // be looked up in the bsg_s_fmt[]
> > -
> > -    const BSG_Format* x = find_format (type);
> > -    if (x == NULL) {
> > -      vtpmloginfo(VTPM_LOG_BSG, "BSG_Pack: cannot find type %d\n", type);
> > -      return -1;
> > -    }
> > -
> > -    if (dst)
> > -      bsglog ("BSG_Pack type %s\n", x->name);
> > -
> > -
> > -    // iterate through the fields
> > -    const BSG_UINT32* f = x->fields;
> > -    for (; *f; f++) {
> > -      int fsize;
> > -
> > -      g_log_recursion_level++;
> > -      fsize = BSG_Pack_private((BSG_Type) *f, &s, dst ? d : NULL);
> > -      g_log_recursion_level--;
> > -
> > -      if (fsize <= 0)
> > -       return fsize;
> > -
> > -      d += fsize;
> > -    }
> > -  } else {
> > -    vtpmlogerror(VTPM_LOG_BSG, "BSG_Pack(): Unknown format %d\n", format);
> > -    return -1;
> > -  }
> > -
> > -  *src = s;
> > -  return (d - dst);
> > -}
> > -
> > -/**
> > - * Unflatten a TCPA structure from a buffer in big-endian format
> > - * @type: TCPA structure type
> > - * @src: flattened data
> > - * @dst: (IN) TCPA structure (OUT) end of TCPA structure
> > - * Returns: Flattened size
> > - * Note: Returns flattened size NOT the unpacked structure size
> > - */
> > -static int BSG_Unpack_private(BSG_Type type, const BSG_BYTE* src, BSG_BYTE** dst) {
> > -  // check incoming parameters
> > -  if (src == NULL)
> > -    return 0;
> > -
> > -
> > -  const BSG_BYTE* s = src;
> > -  BSG_BYTE* d = dst ? *dst:NULL;
> > -  if (dst && !d)
> > -    dst = NULL;
> > -
> > -  BSG_UINT32 size = __FMT_MASK_SIZE(type);
> > -  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
> > -
> > -  if (format == __FMT_CONST) {// We are dealing with a fixed length value ie. UINT32
> > -
> > -    BSG_UINT32 val = BSG_UnpackConst(s, size);
> > -
> > -    if (dst) {
> > -      switch (size) {
> > -      case 1: *(BYTE *) d = (BSG_BYTE) val; break;
> > -      case 2: *(unsigned short*) d = (unsigned short) val; break;
> > -      case 4: *(BSG_UINT32*) d = (BSG_UINT32) val; break;
> > -      }
> > -    }
> > -
> > -    s += size;
> > -    d += size;
> > -  } else if (format == __FMT_DATA) {// We are dealing with raw data. Not sure when this is used.
> > -    if (dst)
> > -      memcpy(d, s, size);
> > -
> > -    d += size;
> > -    s += size;
> > -  } else if (format == __FMT_SIZE || format == __FMT_HSIZE) {// It's a size, followed by that much data or handles
> > -
> > -    BSG_UINT32 psize = BSG_UnpackConst(s, size);
> > -
> > -    if (psize > BSG_MAX_BUF_SIZE) {
> > -      vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack runs into var-sized data bigger than %u bytes!!\n",
> > -              BSG_MAX_BUF_SIZE);
> > -      return -1;
> > -    }
> > -
> > -    if (dst) {
> > -      switch (size) {
> > -      case 1: *(BYTE *) d = (BSG_BYTE) psize; break;
> > -      case 2: *(unsigned short*) d = (unsigned short) psize; break;
> > -      case 4: *(BSG_UINT32*) d = (BSG_UINT32) psize; break;
> > -      }
> > -    }
> > -
> > -    s += size;
> > -    d += size;
> > -
> > -    BSG_BYTE* pdata = NULL;
> > -
> > -    if (psize) {
> > -      if (format == __FMT_HSIZE) { // This is a list of psize Handles
> > -       if (dst) {
> > -         BSG_HANDLE* s2 = (BSG_HANDLE*) s;
> > -         pdata = (BSG_BYTE *)malloc(psize * sizeof(BSG_HANDLE));
> > -          if (!pdata)
> > -            return -1;
> > -
> > -         BSG_HANDLE* p2 = (BSG_HANDLE*) pdata;
> > -         BSG_UINT32 i;
> > -         for (i = 0; i < psize; i++) {
> > -           BSG_PackConst(s2[i], 4, (BSG_BYTE*)(p2 + i));
> > -         }
> > -       }
> > -       s += psize * sizeof(BSG_HANDLE);
> > -      } else { // If it's not psize handles, it's psize data.
> > -       if (dst) {
> > -         pdata = (BSG_BYTE *)malloc(sizeof(BSG_BYTE) * psize);
> > -          if (!pdata)
> > -            return -1;
> > -         memcpy(pdata, s, psize);
> > -       }
> > -       s += psize;
> > -      }
> > -    }
> > -    if (dst)
> > -      *(void**) d = pdata;
> > -
> > -    d += sizeof(void*);
> > -  } else if (format == __FMT_PACKED) {
> > -
> > -    // this doesn't make sense for unpacking!
> > -    vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack() called with format __FMT_PACKED. "
> > -                                                          "This does not make sense\n");
> > -
> > -    return -1;
> > -  } else if (format == 0) {// No flags are set. This is a structure & it should
> > -                          // be looked up in the bsg_s_fmt[]
> > -
> > -    const BSG_Format* x = find_format (type);
> > -    if (x == NULL) {
> > -      vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack: cannot find type %d\n", type);
> > -      return -1;
> > -    }
> > -
> > -    const BSG_UINT32* f = x->fields;
> > -    for (; *f; f++) {
> > -      int fsize = BSG_Unpack_private((BSG_Type) *f, s, dst ? &d:NULL);
> > -      if (fsize <= 0)
> > -       return fsize;
> > -      s += fsize;
> > -    }
> > -  }
> > -
> > -  if (dst)
> > -    *dst = d;
> > -  return (s - src);
> > -}
> > -
> > -/**
> > - * Free memory associated with unpacked TCPA structure
> > - * @type: TCPA structure type
> > - * @src: (IN) TCPA structure (OUT) end of TCPA structure
> > - * Note: Destroy should be called on all structures created with Unpack
> > - *       to ensure that any allocated memory is freed
> > - */
> > -static void BSG_Destroy_private(BSG_Type type, BSG_BYTE** src) {
> > -  BSG_BYTE* s = *src;
> > -
> > -  BSG_UINT32 size = __FMT_MASK_SIZE(type);
> > -  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
> > -
> > -  if ((src == NULL) || (*src == NULL)) {
> > -        vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy() called with NULL src\n");
> > -    return;
> > -  }
> > -
> > -  if (format == __FMT_CONST || format == __FMT_DATA)
> > -    s += size;
> > -  else if (format == __FMT_SIZE || format == __FMT_HSIZE) {
> > -    s += size;
> > -    BSG_BYTE* ptr = *(BSG_BYTE**) s;
> > -    free(ptr);
> > -    s += sizeof(void*);
> > -  } else if (format == __FMT_PACKED) {
> > -
> > -    // this doesn't make sense for unpacking, hence also for Destroy()
> > -    vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy() called with format __FMT_PACKED. "
> > -                                                          "This does not make sense\n");
> > -
> > -    return;
> > -  } else if (format == 0) {
> > -    const BSG_Format* x = find_format (type);
> > -    if (x == NULL) {
> > -      vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy: cannot find type %d\n", type);
> > -      return;
> > -    }
> > -
> > -    const BSG_UINT32* f = x->fields;
> > -    for (; *f; f++)
> > -      BSG_Destroy_private((BSG_Type) *f, &s);
> > -  }
> > -
> > -  *src = s;
> > -}
> > -
> > -int BSG_Pack(BSG_Type type, const void* src, BSG_BYTE* dst)
> > -{
> > -  const BSG_BYTE* src2 = (const BSG_BYTE*) src;
> > -  return BSG_Pack_private(type, &src2, dst);
> > -}
> > -
> > -int BSG_Unpack(BSG_Type type, const BSG_BYTE* src, void* dst)
> > -{
> > -  BSG_BYTE* dst2 = (BSG_BYTE*) dst;
> > -  return BSG_Unpack_private(type, src, dst ? &dst2:NULL);
> > -}
> > -
> > -void BSG_Destroy(BSG_Type type, void* src)
> > -{
> > -  BSG_BYTE* src2 = (BSG_BYTE*) src;
> > -  BSG_Destroy_private(type, &src2);
> > -}
> > -
> > -/**
> > - * Pack a 8/16/32-bit constant into a buffer in big-endian format
> > - * @val: constant value
> > - * @size: constant size in bytes (1, 2, or 4)
> > - * @dst: (OUT) buffer
> > - */
> > -void BSG_PackConst(BSG_UINT32 val, int size, BSG_BYTE* dst) {
> > -  bsglog ("BSG: PackConst on %d of size %i into address %p\n", val, size, dst);
> > -
> > -  switch (size) {
> > -  case 4:
> > -    dst[0] = (BSG_BYTE)((val >> 24) & 0xff);
> > -    dst[1] = (BSG_BYTE)((val >> 16) & 0xff);
> > -    dst[2] = (BSG_BYTE)((val >> 8) & 0xff);
> > -    dst[3] = (BSG_BYTE)(val & 0xff);
> > -    break;
> > -  case 2:
> > -    dst[0] = (BSG_BYTE)((val >> 8) & 0xff);
> > -    dst[1] = (BSG_BYTE)(val & 0xff);
> > -    break;
> > -  case 1:
> > -    dst[0] = (BSG_BYTE)(val & 0xff);
> > -    break;
> > -  }
> > -}
> > -
> > -/**
> > - * Unpack a 8/16/32-bit constant from a buffer in big-endian format
> > - * @src: buffer
> > - * @size: constant size in bytes (1, 2, or 4)
> > - */
> > -BSG_UINT32 BSG_UnpackConst(const BSG_BYTE* src, int size) {
> > -  BSG_UINT32 val = 0;
> > -
> > -  if (src == NULL)
> > -    return 0;
> > -
> > -  switch (size) {
> > -  case 4:
> > -    val = (((BSG_UINT32) src[0]) << 24
> > -          | ((BSG_UINT32) src[1]) << 16
> > -          | ((BSG_UINT32) src[2]) << 8
> > -          | (BSG_UINT32) src[3]);
> > -    break;
> > -  case 2:
> > -    val = (((BSG_UINT32) src[0]) << 8 | (BSG_UINT32) src[1]);
> > -    break;
> > -  case 1:
> > -    val = (BSG_UINT32) src[0];
> > -    break;
> > -  }
> > -  return val;
> > -}
> > -
> > -// Pack a list of parameters. Beware not to send values, but rather you must
> > -// send a pointer to your values Instead. This includes UINT32's.
> > -int BSG_PackList( BSG_BYTE* dst, int ParamCount, ... ) {
> > -  int ParamNumber;
> > -  BSG_Type format;
> > -  BSG_BYTE* val = NULL;
> > -  int size=0;
> > -
> > -  va_list paramList;
> > -  va_start( paramList, ParamCount );
> > -
> > -  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
> > -    //Strangeness with int is because gcc wanted an int rather than a enum of ints.
> > -    format =  (BSG_Type) va_arg( paramList, int );
> > -    val = va_arg( paramList, BSG_BYTE* );
> > -    size += BSG_Pack(format, val, dst == NULL ? NULL : dst + size);
> > -  }
> > -
> > -  va_end (paramList);
> > -
> > -  return size;
> > -}
> > -
> > -// Unpack a list of parameters.
> > -int BSG_UnpackList( const BSG_BYTE* src, int ParamCount, ... ) {
> > -  int ParamNumber = 0;
> > -  BSG_Type format;
> > -  BSG_BYTE* val = NULL;
> > -  int size = 0;
> > -
> > -  va_list paramList;
> > -  va_start( paramList, ParamCount );
> > -
> > -  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
> > -    format = (BSG_Type) va_arg( paramList, int );
> > -    val  = va_arg( paramList, BSG_BYTE* );
> > -
> > -    size += BSG_Unpack(format, src + size, val);
> > -  }
> > -
> > -  va_end( paramList );
> > -
> > -  return size;
> > -}
> > -
> > -// Destroy any memory allocated by calls to unpack
> > -void BSG_DestroyList(int ParamCount, ... ) {
> > -  int ParamNumber = 0;
> > -  BSG_Type argType;
> > -  BSG_BYTE* paramValue = NULL;
> > -
> > -  va_list paramList;
> > -  va_start( paramList, ParamCount );
> > -
> > -  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
> > -    argType = (BSG_Type) va_arg( paramList, int );
> > -    paramValue  = va_arg( paramList, BSG_BYTE* );
> > -
> > -    BSG_Destroy(argType, paramValue);
> > -  }
> > -
> > -  va_end( paramList );
> > -
> > -  return;
> > -}
> > -
> > -
> > -// and a tuple version
> > -TPM_RESULT BSG_DestroyTuple (int numParams, pack_tuple_t params[]) {
> > -  int i;
> > -
> > -  for (i = 0; i < numParams; i++)
> > -    BSG_Destroy (params[i].type, params[i].addr);
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -
> > -//
> > -// wrappers of Pack and PackList which malloc the ouput buffer. to be freed
> > -// by the caller later
> > -//
> > -
> > -int BSG_PackMalloc (BSG_Type type, const void* src, BSG_BYTE** o_dst) {
> > -  int size = BSG_Pack (type, src, NULL);
> > -  BSG_BYTE * dest = (BSG_BYTE*) malloc (size);
> > -  if (dest == NULL)
> > -    return -1;
> > -
> > -  size = BSG_Pack(type, src, dest);
> > -  *o_dst = dest;
> > -  return size;
> > -}
> > -
> > -
> > -
> > -int BSG_PackListMalloc(BSG_BYTE** outBuffer, int ParamCount, ... ) {
> > -  va_list args;
> > -  int size;
> > -
> > -  va_start (args, ParamCount);
> > -  size = BSG_PackList (NULL, ParamCount, args);
> > -  va_end (args);
> > -
> > -  BSG_BYTE * dest = (BSG_BYTE*) malloc (size);
> > -  if (dest == NULL)
> > -    return -1;
> > -
> > -  va_start (args, ParamCount);
> > -  size = BSG_PackList (dest, ParamCount, args);
> > -  va_end (args);
> > -
> > -  *outBuffer = dest;
> > -  return size;
> > -}
> > diff --git a/tools/vtpm_manager/util/bsg.h b/tools/vtpm_manager/util/bsg.h
> > deleted file mode 100644
> > index 0896812..0000000
> > --- a/tools/vtpm_manager/util/bsg.h
> > +++ /dev/null
> > @@ -1,166 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// bsg.h
> > -//
> > -//  This file contains API's for the TPM Byte Stream functions
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __BSG_H__
> > -#define __BSG_H__
> > -
> > -#include <stdarg.h>
> > -#include "buffer.h"
> > -
> > -typedef unsigned int BSG_UINT32;
> > -typedef unsigned char BSG_BYTE;
> > -
> > -// forward decl
> > -struct pack_const_tuple_t;
> > -
> > -struct pack_tuple_t;
> > -
> > -
> > -/**
> > - * Byte stream generator
> > - */
> > -// this has to be manually kept in sync with the
> > -// s_fmt array!!
> > -// but now we have a self-check function which can make sure things are well
> > -// (if used!)
> > -typedef enum BSG_Type
> > -{
> > -  BSG_TYPE_FIRST = 1,
> > -  BSG_TYPE_UINT32 = 1, // start at 1 so that Type 0 only serves as an
> > -                       // unused/special value
> > -  BSG_TYPE_UINT16,
> > -  BSG_TYPE_BYTE,
> > -  BSG_TYPE_BOOL,
> > -  BSG_TPM_SIZE32_DATA,  // a 32 bit unsigned size, followed by
> > -                        // a pointer to that much data. can pass a
> > -                        // struct pack_buf_t as the param
> > -  BSG_TPM_TAG,
> > -  BSG_TPM_HANDLE,
> > -  BSG_TPM_RESULT,
> > -  BSG_TPM_RESOURCE_TYPE,
> > -  BSG_TPM_COMMAND_CODE,
> > -  BSG_TPM_AUTH_DATA_USAGE,
> > -  BSG_TPM_ALGORITHM_ID,
> > -  BSG_TPM_PROTOCOL_ID,
> > -  BSG_TPM_KEY_USAGE,
> > -  BSG_TPM_ENC_SCHEME,
> > -  BSG_TPM_SIG_SCHEME,
> > -  BSG_TPM_MIGRATE_SCHEME,
> > -  BSG_TPM_KEY_FLAGS,
> > -  BSG_TPM_AUTHDATA,
> > -  BSG_TPM_SECRET,
> > -  BSG_TPM_ENCAUTH,
> > -  BSG_TPM_PAYLOAD_TYPE,
> > -
> > -  BSG_TPM_VERSION,
> > -  BSG_TPM_DIGEST,
> > -  BSG_TPM_COMPOSITE_HASH,
> > -  BSG_TPM_CHOSENID_HASH,
> > -  BSG_TPM_NONCE,
> > -  BSG_TPM_KEY_HANDLE,
> > -  BSG_TPM_KEY_HANDLE_LIST,
> > -  BSG_TPM_KEY_PARMS,
> > -  BSG_TPM_RSA_KEY_PARMS,
> > -  BSG_TPM_STORE_PUBKEY,
> > -  BSG_TPM_PUBKEY,
> > -  BSG_TPM_KEY,
> > -
> > -  BSG_TPM_MIGRATIONKEYAUTH,
> > -  BSG_TCPA_AUDIT_EVENT,
> > -  BSG_TCPA_EVENT_CERT,
> > -  BSG_TPM_PCR_SELECTION,
> > -  BSG_TPM_PCR_COMPOSITE,
> > -  BSG_TPM_PCR_INFO,
> > -  BSG_TPM_STORED_DATA,
> > -  BSG_TPM_SYMMETRIC_KEY,
> > -  BSG_TPM_STORE_PRIVKEY,
> > -  BSG_TPM_STORE_ASYMKEY,
> > -  BSG_TPM_MIGRATE_ASYMKEY,
> > -  BSG_TPM_QUOTE_INFO,
> > -  BSG_TPM_IDENTITY_CONTENTS,
> > -  BSG_TPM_PCRVALUE,
> > -  BSG_TCPA_PCR_FLAGS,
> > -  BSG_TCS_AUTH,
> > -
> > -  // this is the BSG_TPM_KEY struct without the encData field
> > -  BSG_TPM_KEY_NONSENSITIVE,
> > -
> > -  BSG_PACKED,
> > -
> > -  BSG_TYPE_MAX
> > -} BSG_Type;
> > -
> > -struct pack_const_tuple_t {
> > -  BSG_Type type;
> > -  const void * addr;
> > -};
> > -
> > -
> > -typedef struct pack_tuple_t {
> > -  BSG_Type type;
> > -  void * addr;
> > -} pack_tuple_t;
> > -
> > -int BSG_Pack(BSG_Type type, const void* src, BSG_BYTE* dst);
> > -int BSG_Unpack(BSG_Type type, const BSG_BYTE* src, void* dst);
> > -void BSG_Destroy(BSG_Type type, void* src);
> > -
> > -// wrappers of Pack and PackList which malloc the ouput buffer. to be freed
> > -// by the caller later. returns size of allocated buffer, or -1 in case
> > -// allocation failed
> > -int BSG_PackMalloc (BSG_Type type, const void* src, BSG_BYTE** o_dst);
> > -int BSG_PackListMalloc (BSG_BYTE** outBuffer, int ParamCount, ... );
> > -
> > -// a va_list version of PackList
> > -int BSG_PackList(BSG_BYTE* outBuffer, int ParamCount, ... );
> > -int BSG_UnpackList(const BSG_BYTE* inBuffer, int ParamCount, ... );
> > -void BSG_DestroyList(int ParamCount, ... );
> > -
> > -// wrapper of PackList which uses a buffer_t
> > -TPM_RESULT BSG_PackListBuf (buffer_t * o_buf, int ParamCount, ...);
> > -
> > -// and a tuple version
> > -TPM_RESULT BSG_DestroyTuple (int numParams, pack_tuple_t params[]);
> > -
> > -void BSG_PackConst(BSG_UINT32 val, int size, BSG_BYTE* dst);
> > -BSG_UINT32 BSG_UnpackConst(const BSG_BYTE* src, int size);
> > -
> > -BOOL BSG_static_selfcheck ();
> > -
> > -#endif
> > diff --git a/tools/vtpm_manager/util/buffer.c b/tools/vtpm_manager/util/buffer.c
> > deleted file mode 100644
> > index df48bc2..0000000
> > --- a/tools/vtpm_manager/util/buffer.c
> > +++ /dev/null
> > @@ -1,226 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -
> > -
> > -#include <stdarg.h>
> > -#include <string.h>
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <sys/param.h>
> > -
> > -#include "tcg.h"
> > -#include "bsg.h"
> > -#include "buffer.h"
> > -
> > -static TPM_RESULT buffer_priv_realloc (buffer_t * buf, tpm_size_t newsize);
> > -
> > -//
> > -// buffer functions!
> > -//
> > -
> > -TPM_RESULT buffer_init (buffer_t * buf, tpm_size_t initsize, const BYTE* initval) {
> > -  if (initsize == 0) {
> > -    memset(buf, 0, sizeof(*buf));
> > -    return TPM_SUCCESS;
> > -  }
> > -
> > -
> > -  buf->bytes = (BYTE*) malloc (initsize);
> > -  if (buf->bytes == NULL)
> > -    return TPM_RESOURCES;
> > -
> > -  buf->size = initsize;
> > -  buf->alloc_size = initsize;
> > -
> > -  if (initval)
> > -    memcpy (buf->bytes, initval, initsize);
> > -
> > -  buf->is_owner = TRUE;
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -TPM_RESULT buffer_init_convert (buffer_t * buf, tpm_size_t initsize, BYTE* initval) {
> > -
> > -  buf->size = initsize;
> > -  buf->alloc_size = initsize;
> > -  buf->bytes = initval;
> > -
> > -  buf->is_owner = TRUE;
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -TPM_RESULT buffer_init_copy (buffer_t * buf, const buffer_t * src) {
> > -  TPM_RESULT status = buffer_init (buf, src->size, src->bytes);
> > -  buf->is_owner = TRUE;
> > -
> > -  return status;
> > -}
> > -
> > -
> > -
> > -// make an alias to a constant array
> > -TPM_RESULT buffer_init_const (buffer_t * buf, tpm_size_t size, const BYTE* val) {
> > -  // TODO: try to enforce the const things somehow!
> > -  buf->bytes = (BYTE*) val;
> > -  buf->size = size;
> > -  buf->alloc_size = 0;        // this field is now unneeded
> > -
> > -  buf->is_owner = FALSE;
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -// make an alias into buf, with given offset and length
> > -// if len = 0, make the alias go to the end of buf
> > -TPM_RESULT buffer_init_alias (buffer_t * buf, const buffer_t * b,
> > -                              tpm_size_t offset, tpm_size_t len) {
> > -  if (offset + len > b->size) {
> > -    return TPM_NOSPACE;
> > -  }
> > -
> > -  buf->bytes = b->bytes + offset;
> > -  buf->size = len > 0 ? len : b->size - offset;
> > -
> > -  //VS/ buf->alloc_size = 0;
> > -  if (len ==0)
> > -    buf->alloc_size = b->alloc_size - offset;
> > -  else
> > -    buf->alloc_size = MIN(b->alloc_size - offset, len);
> > -
> > -
> > -  buf->is_owner = FALSE;
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -// make an alias buffer_t into bytestream, with given length
> > -TPM_RESULT buffer_init_alias_convert (buffer_t * buf, tpm_size_t size, BYTE* val) {
> > -
> > -  buf->size = size;
> > -  buf->alloc_size = size;
> > -  buf->bytes = val;
> > -
> > -  buf->is_owner = FALSE;
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -
> > -
> > -// copy into the start of dest
> > -TPM_RESULT buffer_copy (buffer_t * dest, const buffer_t* src)
> > -{
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  if (dest->alloc_size < src->size) {
> > -    TPMTRYRETURN( buffer_priv_realloc (dest, src->size) );
> > -  }
> > -
> > -  memcpy (dest->bytes, src->bytes, src->size);
> > -  dest->size = src->size;
> > -
> > -  //VS/ dest->is_owner = TRUE;
> > -
> > - abort_egress:
> > -
> > -  return status;
> > -}
> > -
> > -
> > -
> > -BOOL buffer_eq (const buffer_t * a, const buffer_t * b) {
> > -  return (a->size == b->size && memcmp (a->bytes, b->bytes, a->size) == 0);
> > -}
> > -
> > -
> > -void buffer_memset (buffer_t * buf, BYTE b) {
> > -  memset (buf->bytes, b, buf->size);
> > -}
> > -
> > -
> > -TPM_RESULT buffer_append_raw (buffer_t * buf, tpm_size_t len, const BYTE* bytes) {
> > -  TPM_RESULT status = TPM_SUCCESS;
> > -
> > -  if (buf->alloc_size < buf->size + len) {
> > -    TPMTRYRETURN( buffer_priv_realloc (buf, buf->size + len) );
> > -  }
> > -
> > -  memcpy (buf->bytes + buf->size, bytes, len);
> > -
> > -  buf->size += len;
> > -
> > -  goto egress;
> > -
> > - abort_egress:
> > -
> > - egress:
> > -
> > -  return status;
> > -}
> > -
> > -tpm_size_t buffer_len (const buffer_t* buf) {
> > -  return buf->size;
> > -}
> > -
> > -TPM_RESULT buffer_free (buffer_t * buf) {
> > -  if (buf && buf->is_owner && buf->bytes != NULL) {
> > -    free (buf->bytes);
> > -    buf->bytes = NULL;
> > -    buf->size = buf->alloc_size = 0;
> > -
> > -  }
> > -
> > -  return TPM_SUCCESS;
> > -}
> > -
> > -TPM_RESULT buffer_priv_realloc (buffer_t * buf, tpm_size_t newsize) {
> > -
> > -  // we want to realloc to twice the size, or the new size, whichever
> > -  // bigger
> > -
> > -  BYTE * tmpbuf = NULL;
> > -
> > -  newsize = MAX (buf->alloc_size * 2, newsize);
> > -
> > -  tmpbuf = (BYTE*) realloc (buf->bytes, newsize);
> > -  if (tmpbuf == NULL)
> > -    return TPM_SIZE;
> > -
> > -
> > -  buf->bytes = tmpbuf;
> > -  buf->alloc_size = newsize;
> > -
> > -  return TPM_SUCCESS;
> > -}
> > diff --git a/tools/vtpm_manager/util/buffer.h b/tools/vtpm_manager/util/buffer.h
> > deleted file mode 100644
> > index d8a9abc..0000000
> > --- a/tools/vtpm_manager/util/buffer.h
> > +++ /dev/null
> > @@ -1,95 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -
> > -#ifndef __VTPM_BUFFER_H__
> > -#define __VTPM_BUFFER_H__
> > -
> > -#include <stddef.h>             // for pointer NULL
> > -#include "tcg.h"
> > -
> > -typedef UINT32 tpm_size_t;
> > -
> > -// first version, probably will be expanded...
> > -
> > -#define NULL_BUF {0,0,0,0}
> > -
> > -typedef struct {
> > -  // private!!
> > -  tpm_size_t size, alloc_size;
> > -  BYTE * bytes;
> > -
> > -  BOOL is_owner;              // do we own this buffer, and need to free it?
> > -} buffer_t;
> > -
> > -// allocate the buffer if initsize > 0, copying over initval if provided
> > -TPM_RESULT buffer_init (buffer_t * buf,
> > -                        tpm_size_t initsize,
> > -                        const BYTE* initval);
> > -
> > -// Create a new buffer from a BYTE *. Use buffer_free to destroy original BYTE *
> > -TPM_RESULT buffer_init_convert (buffer_t * buf,
> > -                                tpm_size_t initsize,
> > -                                BYTE* initval);
> > -
> > -// make an alias to a constant array, no copying
> > -TPM_RESULT buffer_init_const (buffer_t * buf, tpm_size_t size, const BYTE* val);
> > -
> > -// make an alias into buf, with given offset and length
> > -// if len = 0, make the alias go to the end of buf
> > -TPM_RESULT buffer_init_alias (buffer_t * buf, const buffer_t * b,
> > -                              tpm_size_t offset, tpm_size_t);
> > -
> > -// make an alias buffer into a bytestream
> > -TPM_RESULT buffer_init_alias_convert (buffer_t * buf,
> > -                                      tpm_size_t size, BYTE* val);
> > -
> > -// "copy constructor"
> > -TPM_RESULT buffer_init_copy (buffer_t * buf, const buffer_t * src);
> > -
> > -
> > -// copy into the start of a
> > -TPM_RESULT buffer_copy (buffer_t * dest, const buffer_t* src);
> > -
> > -// are they equal?
> > -BOOL buffer_eq (const buffer_t * a, const buffer_t * b);
> > -
> > -// set the buffer to a constant byte
> > -void buffer_memset (buffer_t * buf, BYTE b);
> > -
> > -tpm_size_t buffer_len (const buffer_t* buf);
> > -
> > -TPM_RESULT buffer_free (buffer_t * buf);
> > -
> > -TPM_RESULT buffer_append_raw (buffer_t * buf, tpm_size_t len, const BYTE* bytes);
> > -
> > -#endif // _TOOLS_H_
> > diff --git a/tools/vtpm_manager/util/hashtable.c b/tools/vtpm_manager/util/hashtable.c
> > deleted file mode 100644
> > index aff0e2b..0000000
> > --- a/tools/vtpm_manager/util/hashtable.c
> > +++ /dev/null
> > @@ -1,316 +0,0 @@
> > -/*
> > - * Copyright (c) 2005, Intel Corp
> > - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> > - * All rights reserved.
> > - *
> > - * Redistribution and use in source and binary forms, with or without
> > - * modification, are permitted provided that the following conditions
> > - * are met:
> > - *
> > - * * Redistributions of source code must retain the above copyright
> > - * notice, this list of conditions and the following disclaimer.
> > - *
> > - * * Redistributions in binary form must reproduce the above copyright
> > - * notice, this list of conditions and the following disclaimer in the
> > - * documentation and/or other materials provided with the distribution.
> > - *
> > - * * Neither the name of the original author; nor the names of any contributors
> > - * may be used to endorse or promote products derived from this software
> > - * without specific prior written permission.
> > - *
> > - *
> > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> > - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> > - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> > - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> > - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> > - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> > - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> > - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> > - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > -*/
> > -
> > -/*
> > - * There are duplicates of this code in:
> > - *  - tools/xenstore/hashtable.c
> > - *  - tools/blktap2/drivers/hashtable.c
> > - */
> > -
> > -#include "hashtable.h"
> > -#include "hashtable_private.h"
> > -#include <stdlib.h>
> > -#include <stdio.h>
> > -#include <string.h>
> > -#include <math.h>
> > -
> > -/*
> > -Credit for primes table: Aaron Krowne
> > - http://br.endernet.org/~akrowne/
> > - http://planetmath.org/encyclopedia/GoodHashTablePrimes.html
> > -*/
> > -static const unsigned int primes[] = {
> > -53, 97, 193, 389,
> > -769, 1543, 3079, 6151,
> > -12289, 24593, 49157, 98317,
> > -196613, 393241, 786433, 1572869,
> > -3145739, 6291469, 12582917, 25165843,
> > -50331653, 100663319, 201326611, 402653189,
> > -805306457, 1610612741
> > -};
> > -const unsigned int prime_table_length = sizeof(primes)/sizeof(primes[0]);
> > -const float max_load_factor = 0.65;
> > -
> > -/*****************************************************************************/
> > -struct hashtable *
> > -create_hashtable(unsigned int minsize,
> > -                 unsigned int (*hashf) (void*),
> > -                 int (*eqf) (void*,void*))
> > -{
> > -    struct hashtable *h;
> > -    unsigned int pindex, size = primes[0];
> > -    /* Check requested hashtable isn't too large */
> > -    if (minsize > (1u << 30)) return NULL;
> > -    /* Enforce size as prime */
> > -    for (pindex=0; pindex < prime_table_length; pindex++) {
> > -        if (primes[pindex] > minsize) { size = primes[pindex]; break; }
> > -    }
> > -    h = (struct hashtable *)malloc(sizeof(struct hashtable));
> > -    if (NULL == h) return NULL; /*oom*/
> > -    h->table = (struct entry **)malloc(sizeof(struct entry*) * size);
> > -    if (NULL == h->table) { free(h); return NULL; } /*oom*/
> > -    memset(h->table, 0, size * sizeof(struct entry *));
> > -    h->tablelength  = size;
> > -    h->primeindex   = pindex;
> > -    h->entrycount   = 0;
> > -    h->hashfn       = hashf;
> > -    h->eqfn         = eqf;
> > -    h->loadlimit    = (unsigned int) ceil(size * max_load_factor);
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_init(&h->mutex, NULL);
> > -#endif
> > -    return h;
> > -}
> > -
> > -/*****************************************************************************/
> > -unsigned int
> > -hash(struct hashtable *h, void *k)
> > -{
> > -    unsigned int i = h->hashfn(k);
> > -    i += ~(i << 9);
> > -    i ^=  ((i >> 14) | (i << 18)); /* >>> */
> > -    i +=  (i << 4);
> > -    i ^=  ((i >> 10) | (i << 22)); /* >>> */
> > -    return i;
> > -}
> > -
> > -/*****************************************************************************/
> > -static int
> > -hashtable_expand(struct hashtable *h)
> > -{
> > -    /* Double the size of the table to accomodate more entries */
> > -    struct entry **newtable;
> > -    struct entry *e;
> > -    struct entry **pE;
> > -    unsigned int newsize, i, index;
> > -    /* Check we're not hitting max capacity */
> > -    if (h->primeindex == (prime_table_length - 1)) return 0;
> > -    newsize = primes[++(h->primeindex)];
> > -
> > -    newtable = (struct entry **)malloc(sizeof(struct entry*) * newsize);
> > -    if (NULL != newtable)
> > -    {
> > -        memset(newtable, 0, newsize * sizeof(struct entry *));
> > -        /* This algorithm is not 'stable'. ie. it reverses the list
> > -         * when it transfers entries between the tables */
> > -        for (i = 0; i < h->tablelength; i++) {
> > -            while (NULL != (e = h->table[i])) {
> > -                h->table[i] = e->next;
> > -                index = indexFor(newsize,e->h);
> > -                e->next = newtable[index];
> > -                newtable[index] = e;
> > -            }
> > -        }
> > -        free(h->table);
> > -        h->table = newtable;
> > -    }
> > -    /* Plan B: realloc instead */
> > -    else
> > -    {
> > -        newtable = (struct entry **)
> > -                   realloc(h->table, newsize * sizeof(struct entry *));
> > -        if (NULL == newtable) { (h->primeindex)--; return 0; }
> > -        h->table = newtable;
> > -        memset(newtable[h->tablelength], 0, newsize - h->tablelength);
> > -        for (i = 0; i < h->tablelength; i++) {
> > -            for (pE = &(newtable[i]), e = *pE; e != NULL; e = *pE) {
> > -                index = indexFor(newsize,e->h);
> > -                if (index == i)
> > -                {
> > -                    pE = &(e->next);
> > -                }
> > -                else
> > -                {
> > -                    *pE = e->next;
> > -                    e->next = newtable[index];
> > -                    newtable[index] = e;
> > -                }
> > -            }
> > -        }
> > -    }
> > -    h->tablelength = newsize;
> > -    h->loadlimit   = (unsigned int) ceil(newsize * max_load_factor);
> > -    return -1;
> > -}
> > -
> > -/*****************************************************************************/
> > -unsigned int
> > -hashtable_count(struct hashtable *h)
> > -{
> > -    unsigned int count;
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_lock(&h->mutex);
> > -#endif
> > -    count = h->entrycount;
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_unlock(&h->mutex);
> > -#endif
> > -    return count;
> > -}
> > -
> > -/*****************************************************************************/
> > -int
> > -hashtable_insert(struct hashtable *h, void *k, void *v)
> > -{
> > -    /* This method allows duplicate keys - but they shouldn't be used */
> > -    unsigned int index;
> > -    struct entry *e;
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_lock(&h->mutex);
> > -#endif
> > -    if (++(h->entrycount) > h->loadlimit)
> > -    {
> > -        /* Ignore the return value. If expand fails, we should
> > -         * still try cramming just this value into the existing table
> > -         * -- we may not have memory for a larger table, but one more
> > -         * element may be ok. Next time we insert, we'll try expanding again.*/
> > -        hashtable_expand(h);
> > -    }
> > -    e = (struct entry *)malloc(sizeof(struct entry));
> > -    if (NULL == e) { --(h->entrycount); return 0; } /*oom*/
> > -    e->h = hash(h,k);
> > -    index = indexFor(h->tablelength,e->h);
> > -    e->k = k;
> > -    e->v = v;
> > -    e->next = h->table[index];
> > -    h->table[index] = e;
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_unlock(&h->mutex);
> > -#endif
> > -    return -1;
> > -}
> > -
> > -/*****************************************************************************/
> > -void * /* returns value associated with key */
> > -hashtable_search(struct hashtable *h, void *k)
> > -{
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_lock(&h->mutex);
> > -#endif
> > -    struct entry *e;
> > -    unsigned int hashvalue, index;
> > -    hashvalue = hash(h,k);
> > -    index = indexFor(h->tablelength,hashvalue);
> > -    e = h->table[index];
> > -    while (NULL != e)
> > -    {
> > -        /* Check hash value to short circuit heavier comparison */
> > -        if ((hashvalue == e->h) && (h->eqfn(k, e->k))) {
> > -#ifdef HASHTABLE_THREADED
> > -          pthread_mutex_unlock(&h->mutex);
> > -#endif
> > -          return e->v;
> > -        }
> > -        e = e->next;
> > -    }
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_unlock(&h->mutex);
> > -#endif
> > -    return NULL;
> > -}
> > -
> > -/*****************************************************************************/
> > -void * /* returns value associated with key */
> > -hashtable_remove(struct hashtable *h, void *k)
> > -{
> > -    /* TODO: consider compacting the table when the load factor drops enough,
> > -     *       or provide a 'compact' method. */
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_lock(&h->mutex);
> > -#endif
> > -    struct entry *e;
> > -    struct entry **pE;
> > -    void *v;
> > -    unsigned int hashvalue, index;
> > -
> > -    hashvalue = hash(h,k);
> > -    index = indexFor(h->tablelength,hash(h,k));
> > -    pE = &(h->table[index]);
> > -    e = *pE;
> > -    while (NULL != e)
> > -    {
> > -        /* Check hash value to short circuit heavier comparison */
> > -        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
> > -        {
> > -            *pE = e->next;
> > -            h->entrycount--;
> > -            v = e->v;
> > -            freekey(e->k);
> > -            free(e);
> > -            return v;
> > -        }
> > -        pE = &(e->next);
> > -        e = e->next;
> > -    }
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_unlock(&h->mutex);
> > -#endif
> > -    return NULL;
> > -}
> > -
> > -/*****************************************************************************/
> > -/* destroy */
> > -void
> > -hashtable_destroy(struct hashtable *h, int free_values)
> > -{
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_lock(&h->mutex);
> > -#endif
> > -    unsigned int i;
> > -    struct entry *e, *f;
> > -    struct entry **table = h->table;
> > -    if (free_values)
> > -    {
> > -        for (i = 0; i < h->tablelength; i++)
> > -        {
> > -            e = table[i];
> > -            while (NULL != e)
> > -            { f = e; e = e->next; freekey(f->k); free(f->v); free(f); }
> > -        }
> > -    }
> > -    else
> > -    {
> > -        for (i = 0; i < h->tablelength; i++)
> > -        {
> > -            e = table[i];
> > -            while (NULL != e)
> > -            { f = e; e = e->next; freekey(f->k); free(f); }
> > -        }
> > -    }
> > -    free(h->table);
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_destroy(&h->mutex);
> > -#endif
> > -    free(h);
> > -}
> > diff --git a/tools/vtpm_manager/util/hashtable.h b/tools/vtpm_manager/util/hashtable.h
> > deleted file mode 100644
> > index dedc60a..0000000
> > --- a/tools/vtpm_manager/util/hashtable.h
> > +++ /dev/null
> > @@ -1,204 +0,0 @@
> > -/*
> > - * Copyright (c) 2005, Intel Corp
> > - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> > - * All rights reserved.
> > - *
> > - * Redistribution and use in source and binary forms, with or without
> > - * modification, are permitted provided that the following conditions
> > - * are met:
> > - *
> > - * * Redistributions of source code must retain the above copyright
> > - * notice, this list of conditions and the following disclaimer.
> > - *
> > - * * Redistributions in binary form must reproduce the above copyright
> > - * notice, this list of conditions and the following disclaimer in the
> > - * documentation and/or other materials provided with the distribution.
> > - *
> > - * * Neither the name of the original author; nor the names of any contributors
> > - * may be used to endorse or promote products derived from this software
> > - * without specific prior written permission.
> > - *
> > - *
> > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> > - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> > - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> > - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> > - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> > - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> > - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> > - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> > - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > -*/
> > -
> > -/*
> > - * There are duplicates of this code in:
> > - *  - tools/xenstore/hashtable.h
> > - *  - tools/blktap2/drivers/hashtable.h
> > - */
> > -
> > -#ifndef __HASHTABLE_CWC22_H__
> > -#define __HASHTABLE_CWC22_H__
> > -
> > -struct hashtable;
> > -
> > -/* Example of use:
> > - *
> > - *      struct hashtable  *h;
> > - *      struct some_key   *k;
> > - *      struct some_value *v;
> > - *
> > - *      static unsigned int         hash_from_key_fn( void *k );
> > - *      static int                  keys_equal_fn ( void *key1, void *key2 );
> > - *
> > - *      h = create_hashtable(16, hash_from_key_fn, keys_equal_fn);
> > - *      k = (struct some_key *)     malloc(sizeof(struct some_key));
> > - *      v = (struct some_value *)   malloc(sizeof(struct some_value));
> > - *
> > - *      (initialise k and v to suitable values)
> > - *
> > - *      if (! hashtable_insert(h,k,v) )
> > - *      {     exit(-1);               }
> > - *
> > - *      if (NULL == (found = hashtable_search(h,k) ))
> > - *      {    printf("not found!");                  }
> > - *
> > - *      if (NULL == (found = hashtable_remove(h,k) ))
> > - *      {    printf("Not found\n");                 }
> > - *
> > - */
> > -
> > -/* Macros may be used to define type-safe(r) hashtable access functions, with
> > - * methods specialized to take known key and value types as parameters.
> > - *
> > - * Example:
> > - *
> > - * Insert this at the start of your file:
> > - *
> > - * DEFINE_HASHTABLE_INSERT(insert_some, struct some_key, struct some_value);
> > - * DEFINE_HASHTABLE_SEARCH(search_some, struct some_key, struct some_value);
> > - * DEFINE_HASHTABLE_REMOVE(remove_some, struct some_key, struct some_value);
> > - *
> > - * This defines the functions 'insert_some', 'search_some' and 'remove_some'.
> > - * These operate just like hashtable_insert etc., with the same parameters,
> > - * but their function signatures have 'struct some_key *' rather than
> > - * 'void *', and hence can generate compile time errors if your program is
> > - * supplying incorrect data as a key (and similarly for value).
> > - *
> > - * Note that the hash and key equality functions passed to create_hashtable
> > - * still take 'void *' parameters instead of 'some key *'. This shouldn't be
> > - * a difficult issue as they're only defined and passed once, and the other
> > - * functions will ensure that only valid keys are supplied to them.
> > - *
> > - * The cost for this checking is increased code size and runtime overhead
> > - * - if performance is important, it may be worth switching back to the
> > - * unsafe methods once your program has been debugged with the safe methods.
> > - * This just requires switching to some simple alternative defines - eg:
> > - * #define insert_some hashtable_insert
> > - *
> > - */
> > -
> > -/*****************************************************************************
> > - * create_hashtable
> > -
> > - * @name                    create_hashtable
> > - * @param   minsize         minimum initial size of hashtable
> > - * @param   hashfunction    function for hashing keys
> > - * @param   key_eq_fn       function for determining key equality
> > - * @return                  newly created hashtable or NULL on failure
> > - */
> > -
> > -struct hashtable *
> > -create_hashtable(unsigned int minsize,
> > -                 unsigned int (*hashfunction) (void*),
> > -                 int (*key_eq_fn) (void*,void*));
> > -
> > -/*****************************************************************************
> > - * hashtable_insert
> > -
> > - * @name        hashtable_insert
> > - * @param   h   the hashtable to insert into
> > - * @param   k   the key - hashtable claims ownership and will free on removal
> > - * @param   v   the value - does not claim ownership
> > - * @return      non-zero for successful insertion
> > - *
> > - * This function will cause the table to expand if the insertion would take
> > - * the ratio of entries to table size over the maximum load factor.
> > - *
> > - * This function does not check for repeated insertions with a duplicate key.
> > - * The value returned when using a duplicate key is undefined -- when
> > - * the hashtable changes size, the order of retrieval of duplicate key
> > - * entries is reversed.
> > - * If in doubt, remove before insert.
> > - */
> > -
> > -int
> > -hashtable_insert(struct hashtable *h, void *k, void *v);
> > -
> > -#define DEFINE_HASHTABLE_INSERT(fnname, keytype, valuetype) \
> > -int fnname (struct hashtable *h, keytype *k, valuetype *v) \
> > -{ \
> > -    return hashtable_insert(h,k,v); \
> > -}
> > -
> > -/*****************************************************************************
> > - * hashtable_search
> > -
> > - * @name        hashtable_search
> > - * @param   h   the hashtable to search
> > - * @param   k   the key to search for  - does not claim ownership
> > - * @return      the value associated with the key, or NULL if none found
> > - */
> > -
> > -void *
> > -hashtable_search(struct hashtable *h, void *k);
> > -
> > -#define DEFINE_HASHTABLE_SEARCH(fnname, keytype, valuetype) \
> > -valuetype * fnname (struct hashtable *h, keytype *k) \
> > -{ \
> > -    return (valuetype *) (hashtable_search(h,k)); \
> > -}
> > -
> > -/*****************************************************************************
> > - * hashtable_remove
> > -
> > - * @name        hashtable_remove
> > - * @param   h   the hashtable to remove the item from
> > - * @param   k   the key to search for  - does not claim ownership
> > - * @return      the value associated with the key, or NULL if none found
> > - */
> > -
> > -void * /* returns value */
> > -hashtable_remove(struct hashtable *h, void *k);
> > -
> > -#define DEFINE_HASHTABLE_REMOVE(fnname, keytype, valuetype) \
> > -valuetype * fnname (struct hashtable *h, keytype *k) \
> > -{ \
> > -    return (valuetype *) (hashtable_remove(h,k)); \
> > -}
> > -
> > -
> > -/*****************************************************************************
> > - * hashtable_count
> > -
> > - * @name        hashtable_count
> > - * @param   h   the hashtable
> > - * @return      the number of items stored in the hashtable
> > - */
> > -unsigned int
> > -hashtable_count(struct hashtable *h);
> > -
> > -
> > -/*****************************************************************************
> > - * hashtable_destroy
> > -
> > - * @name        hashtable_destroy
> > - * @param   h   the hashtable
> > - * @param       free_values     whether to call 'free' on the remaining values
> > - */
> > -
> > -void
> > -hashtable_destroy(struct hashtable *h, int free_values);
> > -
> > -#endif /* __HASHTABLE_CWC22_H__ */
> > diff --git a/tools/vtpm_manager/util/hashtable_itr.c b/tools/vtpm_manager/util/hashtable_itr.c
> > deleted file mode 100644
> > index dcf42c8..0000000
> > --- a/tools/vtpm_manager/util/hashtable_itr.c
> > +++ /dev/null
> > @@ -1,236 +0,0 @@
> > -/*
> > - * Copyright (c) 2005, Intel Corp
> > - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> > - * All rights reserved.
> > - *
> > - * Redistribution and use in source and binary forms, with or without
> > - * modification, are permitted provided that the following conditions
> > - * are met:
> > - *
> > - * * Redistributions of source code must retain the above copyright
> > - * notice, this list of conditions and the following disclaimer.
> > - *
> > - * * Redistributions in binary form must reproduce the above copyright
> > - * notice, this list of conditions and the following disclaimer in the
> > - * documentation and/or other materials provided with the distribution.
> > - *
> > - * * Neither the name of the original author; nor the names of any contributors
> > - * may be used to endorse or promote products derived from this software
> > - * without specific prior written permission.
> > - *
> > - *
> > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> > - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> > - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> > - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> > - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> > - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> > - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> > - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> > - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > -*/
> > -
> > -/*
> > - * There are duplicates of this code in:
> > - *  - tools/blktap2/drivers/hashtable_itr.c
> > - */
> > -
> > -#include "hashtable.h"
> > -#include "hashtable_private.h"
> > -#include "hashtable_itr.h"
> > -#include <stdlib.h> /* defines NULL */
> > -
> > -/*****************************************************************************/
> > -/* hashtable_iterator    - iterator constructor */
> > -
> > -struct hashtable_itr *
> > -hashtable_iterator(struct hashtable *h)
> > -{
> > -    unsigned int i, tablelength;
> > -    struct hashtable_itr *itr = (struct hashtable_itr *)
> > -        malloc(sizeof(struct hashtable_itr));
> > -    if (NULL == itr) return NULL;
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_lock(&h->mutex);
> > -#endif
> > -    itr->h = h;
> > -    itr->e = NULL;
> > -    itr->parent = NULL;
> > -    tablelength = h->tablelength;
> > -    itr->index = tablelength;
> > -    if (0 == h->entrycount) {
> > -#ifdef HASHTABLE_THREADED
> > -      pthread_mutex_unlock(&h->mutex);
> > -#endif
> > -      return itr;
> > -    }
> > -
> > -    for (i = 0; i < tablelength; i++)
> > -    {
> > -        if (NULL != h->table[i])
> > -        {
> > -            itr->e = h->table[i];
> > -            itr->index = i;
> > -            break;
> > -        }
> > -    }
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_unlock(&h->mutex);
> > -#endif
> > -    return itr;
> > -}
> > -
> > -/*****************************************************************************/
> > -/* key      - return the key of the (key,value) pair at the current position */
> > -/* value    - return the value of the (key,value) pair at the current position */
> > -
> > -void *
> > -hashtable_iterator_key(struct hashtable_itr *i)
> > -{ return i->e->k; }
> > -
> > -void *
> > -hashtable_iterator_value(struct hashtable_itr *i)
> > -{ return i->e->v; }
> > -
> > -/*****************************************************************************/
> > -/* advance - advance the iterator to the next element
> > - *           returns zero if advanced to end of table */
> > -
> > -int
> > -hashtable_iterator_advance(struct hashtable_itr *itr)
> > -{
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_lock(&itr->h->mutex);
> > -#endif
> > -    unsigned int j,tablelength;
> > -    struct entry **table;
> > -    struct entry *next;
> > -    int ret;
> > -    if (NULL == itr->e) { /* stupidity check */
> > -      ret = 0;
> > -      goto egress;
> > -    }
> > -
> > -    next = itr->e->next;
> > -    if (NULL != next)
> > -    {
> > -        itr->parent = itr->e;
> > -        itr->e = next;
> > -        ret = -1;
> > -        goto egress;
> > -    }
> > -
> > -    tablelength = itr->h->tablelength;
> > -    itr->parent = NULL;
> > -    if (tablelength <= (j = ++(itr->index)))
> > -    {
> > -        itr->e = NULL;
> > -        ret = 0;
> > -        goto egress;
> > -    }
> > -    table = itr->h->table;
> > -    while (NULL == (next = table[j]))
> > -    {
> > -        if (++j >= tablelength)
> > -        {
> > -            itr->index = tablelength;
> > -            itr->e = NULL;
> > -            ret = 0;
> > -            goto egress;
> > -        }
> > -    }
> > -    itr->index = j;
> > -    itr->e = next;
> > -    ret = -1;
> > -
> > - egress:
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_unlock(&itr->h->mutex);
> > -#endif
> > -    return ret;
> > -}
> > -
> > -/*****************************************************************************/
> > -/* remove - remove the entry at the current iterator position
> > - *          and advance the iterator, if there is a successive
> > - *          element.
> > - *          If you want the value, read it before you remove:
> > - *          beware memory leaks if you don't.
> > - *          Returns zero if end of iteration. */
> > -
> > -int
> > -hashtable_iterator_remove(struct hashtable_itr *itr)
> > -{
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_lock(&itr->h->mutex);
> > -#endif
> > -    struct entry *remember_e, *remember_parent;
> > -    int ret;
> > -
> > -    /* Do the removal */
> > -    if (NULL == (itr->parent))
> > -    {
> > -        /* element is head of a chain */
> > -        itr->h->table[itr->index] = itr->e->next;
> > -    } else {
> > -        /* element is mid-chain */
> > -        itr->parent->next = itr->e->next;
> > -    }
> > -    /* itr->e is now outside the hashtable */
> > -    remember_e = itr->e;
> > -    itr->h->entrycount--;
> > -    freekey(remember_e->k);
> > -
> > -    /* Advance the iterator, correcting the parent */
> > -    remember_parent = itr->parent;
> > -    ret = hashtable_iterator_advance(itr);
> > -    if (itr->parent == remember_e) { itr->parent = remember_parent; }
> > -    free(remember_e);
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_unlock(&itr->h->mutex);
> > -#endif
> > -    return ret;
> > -}
> > -
> > -/*****************************************************************************/
> > -int /* returns zero if not found */
> > -hashtable_iterator_search(struct hashtable_itr *itr,
> > -                          struct hashtable *h, void *k)
> > -{
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_lock(&h->mutex);
> > -#endif
> > -    struct entry *e, *parent;
> > -    unsigned int hashvalue, index;
> > -    int ret;
> > -
> > -    hashvalue = hash(h,k);
> > -    index = indexFor(h->tablelength,hashvalue);
> > -
> > -    e = h->table[index];
> > -    parent = NULL;
> > -    while (NULL != e)
> > -    {
> > -        /* Check hash value to short circuit heavier comparison */
> > -        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
> > -        {
> > -            itr->index = index;
> > -            itr->e = e;
> > -            itr->parent = parent;
> > -            itr->h = h;
> > -            ret= -1;
> > -            goto egress;
> > -        }
> > -        parent = e;
> > -        e = e->next;
> > -    }
> > -  ret = 0;
> > -
> > -egress:
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_unlock(&h->mutex);
> > -#endif
> > -    return ret;
> > -}
> > diff --git a/tools/vtpm_manager/util/hashtable_itr.h b/tools/vtpm_manager/util/hashtable_itr.h
> > deleted file mode 100644
> > index 35654e0..0000000
> > --- a/tools/vtpm_manager/util/hashtable_itr.h
> > +++ /dev/null
> > @@ -1,109 +0,0 @@
> > -/*
> > - * Copyright (c) 2005, Intel Corp
> > - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> > - * All rights reserved.
> > - *
> > - * Redistribution and use in source and binary forms, with or without
> > - * modification, are permitted provided that the following conditions
> > - * are met:
> > - *
> > - * * Redistributions of source code must retain the above copyright
> > - * notice, this list of conditions and the following disclaimer.
> > - *
> > - * * Redistributions in binary form must reproduce the above copyright
> > - * notice, this list of conditions and the following disclaimer in the
> > - * documentation and/or other materials provided with the distribution.
> > - *
> > - * * Neither the name of the original author; nor the names of any contributors
> > - * may be used to endorse or promote products derived from this software
> > - * without specific prior written permission.
> > - *
> > - *
> > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> > - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> > - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> > - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> > - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> > - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> > - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> > - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> > - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > -*/
> > -
> > -/*
> > - * There are duplicates of this code in:
> > - *  - tools/blktap2/drivers/hashtable_itr.h
> > - */
> > -
> > -
> > -#ifndef __HASHTABLE_ITR_CWC22__
> > -#define __HASHTABLE_ITR_CWC22__
> > -#include "hashtable.h"
> > -#include "hashtable_private.h" /* needed to enable inlining */
> > -
> > -/*****************************************************************************/
> > -/* This struct is only concrete here to allow the inlining of two of the
> > - * accessor functions. */
> > -struct hashtable_itr
> > -{
> > -    struct hashtable *h;
> > -    struct entry *e;
> > -    struct entry *parent;
> > -    unsigned int index;
> > -};
> > -
> > -
> > -/*****************************************************************************/
> > -/* hashtable_iterator
> > - */
> > -
> > -struct hashtable_itr *
> > -hashtable_iterator(struct hashtable *h);
> > -
> > -/*****************************************************************************/
> > -/* hashtable_iterator_key
> > - * - return the value of the (key,value) pair at the current position */
> > -
> > -void *hashtable_iterator_key(struct hashtable_itr *i);
> > -
> > -/*****************************************************************************/
> > -/* value - return the value of the (key,value) pair at the current position */
> > -
> > -void *hashtable_iterator_value(struct hashtable_itr *i);
> > -
> > -/*****************************************************************************/
> > -/* advance - advance the iterator to the next element
> > - *           returns zero if advanced to end of table */
> > -
> > -int
> > -hashtable_iterator_advance(struct hashtable_itr *itr);
> > -
> > -/*****************************************************************************/
> > -/* remove - remove current element and advance the iterator to the next element
> > - *          NB: if you need the value to free it, read it before
> > - *          removing. ie: beware memory leaks!
> > - *          returns zero if advanced to end of table */
> > -
> > -int
> > -hashtable_iterator_remove(struct hashtable_itr *itr);
> > -
> > -/*****************************************************************************/
> > -/* search - overwrite the supplied iterator, to point to the entry
> > - *          matching the supplied key.
> > -            h points to the hashtable to be searched.
> > - *          returns zero if not found. */
> > -int
> > -hashtable_iterator_search(struct hashtable_itr *itr,
> > -                          struct hashtable *h, void *k);
> > -
> > -#define DEFINE_HASHTABLE_ITERATOR_SEARCH(fnname, keytype) \
> > -int fnname (struct hashtable_itr *i, struct hashtable *h, keytype *k) \
> > -{ \
> > -    return (hashtable_iterator_search(i,h,k)); \
> > -}
> > -
> > -
> > -
> > -#endif /* __HASHTABLE_ITR_CWC22__*/
> > diff --git a/tools/vtpm_manager/util/hashtable_private.h b/tools/vtpm_manager/util/hashtable_private.h
> > deleted file mode 100644
> > index d87a7f9..0000000
> > --- a/tools/vtpm_manager/util/hashtable_private.h
> > +++ /dev/null
> > @@ -1,96 +0,0 @@
> > -/*
> > - * Copyright (c) 2005, Intel Corp
> > - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> > - * All rights reserved.
> > - *
> > - * Redistribution and use in source and binary forms, with or without
> > - * modification, are permitted provided that the following conditions
> > - * are met:
> > - *
> > - * * Redistributions of source code must retain the above copyright
> > - * notice, this list of conditions and the following disclaimer.
> > - *
> > - * * Redistributions in binary form must reproduce the above copyright
> > - * notice, this list of conditions and the following disclaimer in the
> > - * documentation and/or other materials provided with the distribution.
> > - *
> > - * * Neither the name of the original author; nor the names of any contributors
> > - * may be used to endorse or promote products derived from this software
> > - * without specific prior written permission.
> > - *
> > - *
> > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> > - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> > - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> > - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> > - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> > - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> > - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> > - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> > - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > -*/
> > -
> > -/*
> > - * There are duplicates of this code in:
> > - *  - tools/xenstore/hashtable_private.h
> > - *  - tools/blktap2/drivers/hashtable_private.h
> > - */
> > -
> > -#ifndef __HASHTABLE_PRIVATE_CWC22_H__
> > -#define __HASHTABLE_PRIVATE_CWC22_H__
> > -
> > -#include "hashtable.h"
> > -#ifdef HASHTABLE_THREADED
> > -#include <pthread.h>
> > -#endif
> > -
> > -/*****************************************************************************/
> > -struct entry
> > -{
> > -    void *k, *v;
> > -    unsigned int h;
> > -    struct entry *next;
> > -};
> > -
> > -struct hashtable {
> > -    unsigned int tablelength;
> > -    struct entry **table;
> > -    unsigned int entrycount;
> > -    unsigned int loadlimit;
> > -    unsigned int primeindex;
> > -    unsigned int (*hashfn) (void *k);
> > -    int (*eqfn) (void *k1, void *k2);
> > -#ifdef HASHTABLE_THREADED
> > -    pthread_mutex_t mutex;
> > -#endif
> > -};
> > -
> > -/*****************************************************************************/
> > -unsigned int
> > -hash(struct hashtable *h, void *k);
> > -
> > -/*****************************************************************************/
> > -/* indexFor */
> > -static inline unsigned int
> > -indexFor(unsigned int tablelength, unsigned int hashvalue) {
> > -    return (hashvalue % tablelength);
> > -};
> > -
> > -/* Only works if tablelength == 2^N */
> > -/*static inline unsigned int
> > -indexFor(unsigned int tablelength, unsigned int hashvalue)
> > -{
> > -    return (hashvalue & (tablelength - 1u));
> > -}
> > -*/
> > -
> > -/*****************************************************************************/
> > -#define freekey(X) free(X)
> > -/*define freekey(X) ; */
> > -
> > -
> > -/*****************************************************************************/
> > -
> > -#endif /* __HASHTABLE_PRIVATE_CWC22_H__*/
> > diff --git a/tools/vtpm_manager/util/log.c b/tools/vtpm_manager/util/log.c
> > deleted file mode 100644
> > index 75fe91a..0000000
> > --- a/tools/vtpm_manager/util/log.c
> > +++ /dev/null
> > @@ -1,142 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -
> > -#include <stdlib.h>
> > -#include <string.h>
> > -#include <stdio.h>
> > -
> > -#include "buffer.h"
> > -#include "tcg.h"
> > -
> > -// Helper code for the consts, eg. to produce messages for error codes.
> > -
> > -typedef struct error_code_entry_t {
> > -  TPM_RESULT code;
> > -  char * code_name;
> > -  char * msg;
> > -} error_code_entry_t;
> > -
> > -static const error_code_entry_t error_msgs [] = {
> > -  { TPM_SUCCESS, "TPM_SUCCESS", "Successful completion of the operation" },
> > -  { TPM_AUTHFAIL, "TPM_AUTHFAIL", "Authentication failed" },
> > -  { TPM_BADINDEX, "TPM_BADINDEX", "The index to a PCR, DIR or other register is incorrect" },
> > -  { TPM_BAD_PARAMETER, "TPM_BAD_PARAMETER", "One or more parameter is bad" },
> > -  { TPM_AUDITFAILURE, "TPM_AUDITFAILURE", "An operation completed successfully but the auditing of that operation failed." },
> > -  { TPM_CLEAR_DISABLED, "TPM_CLEAR_DISABLED", "The clear disable flag is set and all clear operations now require physical access" },
> > -  { TPM_DEACTIVATED, "TPM_DEACTIVATED", "The TPM is deactivated" },
> > -  { TPM_DISABLED, "TPM_DISABLED", "The TPM is disabled" },
> > -  { TPM_DISABLED_CMD, "TPM_DISABLED_CMD", "The target command has been disabled" },
> > -  { TPM_FAIL, "TPM_FAIL", "The operation failed" },
> > -  { TPM_BAD_ORDINAL, "TPM_BAD_ORDINAL", "The ordinal was unknown or inconsistent" },
> > -  { TPM_INSTALL_DISABLED, "TPM_INSTALL_DISABLED", "The ability to install an owner is disabled" },
> > -  { TPM_INVALID_KEYHANDLE, "TPM_INVALID_KEYHANDLE", "The key handle presented was invalid" },
> > -  { TPM_KEYNOTFOUND, "TPM_KEYNOTFOUND", "The target key was not found" },
> > -  { TPM_INAPPROPRIATE_ENC, "TPM_INAPPROPRIATE_ENC", "Unacceptable encryption scheme" },
> > -  { TPM_MIGRATEFAIL, "TPM_MIGRATEFAIL", "Migration authorization failed" },
> > -  { TPM_INVALID_PCR_INFO, "TPM_INVALID_PCR_INFO", "PCR information could not be interpreted" },
> > -  { TPM_NOSPACE, "TPM_NOSPACE", "No room to load key." },
> > -  { TPM_NOSRK, "TPM_NOSRK", "There is no SRK set" },
> > -  { TPM_NOTSEALED_BLOB, "TPM_NOTSEALED_BLOB", "An encrypted blob is invalid or was not created by this TPM" },
> > -  { TPM_OWNER_SET, "TPM_OWNER_SET", "There is already an Owner" },
> > -  { TPM_RESOURCES, "TPM_RESOURCES", "The TPM has insufficient internal resources to perform the requested action." },
> > -  { TPM_SHORTRANDOM, "TPM_SHORTRANDOM", "A random string was too short" },
> > -  { TPM_SIZE, "TPM_SIZE", "The TPM does not have the space to perform the operation." },
> > -  { TPM_WRONGPCRVAL, "TPM_WRONGPCRVAL", "The named PCR value does not match the current PCR value." },
> > -  { TPM_BAD_PARAM_SIZE, "TPM_BAD_PARAM_SIZE", "The paramSize argument to the command has the incorrect value" },
> > -  { TPM_SHA_THREAD, "TPM_SHA_THREAD", "There is no existing SHA-1 thread." },
> > -  { TPM_SHA_ERROR, "TPM_SHA_ERROR", "The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error." },
> > -  { TPM_FAILEDSELFTEST, "TPM_FAILEDSELFTEST", "Self-test has failed and the TPM has shutdown." },
> > -  { TPM_AUTH2FAIL, "TPM_AUTH2FAIL", "The authorization for the second key in a 2 key function failed authorization" },
> > -  { TPM_BADTAG, "TPM_BADTAG", "The tag value sent to for a command is invalid" },
> > -  { TPM_IOERROR, "TPM_IOERROR", "An IO error occurred transmitting information to the TPM" },
> > -  { TPM_ENCRYPT_ERROR, "TPM_ENCRYPT_ERROR", "The encryption process had a problem." },
> > -  { TPM_DECRYPT_ERROR, "TPM_DECRYPT_ERROR", "The decryption process did not complete." },
> > -  { TPM_INVALID_AUTHHANDLE, "TPM_INVALID_AUTHHANDLE", "An invalid handle was used." },
> > -  { TPM_NO_ENDORSEMENT, "TPM_NO_ENDORSEMENT", "The TPM does not a EK installed" },
> > -  { TPM_INVALID_KEYUSAGE, "TPM_INVALID_KEYUSAGE", "The usage of a key is not allowed" },
> > -  { TPM_WRONG_ENTITYTYPE, "TPM_WRONG_ENTITYTYPE", "The submitted entity type is not allowed" },
> > -  { TPM_INVALID_POSTINIT, "TPM_INVALID_POSTINIT", "The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup" },
> > -  { TPM_INAPPROPRIATE_SIG, "TPM_INAPPROPRIATE_SIG", "Signed data cannot include additional DER information" },
> > -  { TPM_BAD_KEY_PROPERTY, "TPM_BAD_KEY_PROPERTY", "The key properties in TPM_KEY_PARMs are not supported by this TPM" },
> > -
> > -  { TPM_BAD_MIGRATION, "TPM_BAD_MIGRATION", "The migration properties of this key are incorrect." },
> > -  { TPM_BAD_SCHEME, "TPM_BAD_SCHEME", "The signature or encryption scheme for this key is incorrect or not permitted in this situation." },
> > -  { TPM_BAD_DATASIZE, "TPM_BAD_DATASIZE", "The size of the data (or blob) parameter is bad or inconsistent with the referenced key" },
> > -  { TPM_BAD_MODE, "TPM_BAD_MODE", "A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob." },
> > -  { TPM_BAD_PRESENCE, "TPM_BAD_PRESENCE", "Either the physicalPresence or physicalPresenceLock bits have the wrong value" },
> > -  { TPM_BAD_VERSION, "TPM_BAD_VERSION", "The TPM cannot perform this version of the capability" },
> > -  { TPM_NO_WRAP_TRANSPORT, "TPM_NO_WRAP_TRANSPORT", "The TPM does not allow for wrapped transport sessions" },
> > -  { TPM_AUDITFAIL_UNSUCCESSFUL, "TPM_AUDITFAIL_UNSUCCESSFUL", "TPM audit construction failed and the underlying command was returning a failure code also" },
> > -  { TPM_AUDITFAIL_SUCCESSFUL, "TPM_AUDITFAIL_SUCCESSFUL", "TPM audit construction failed and the underlying command was returning success" },
> > -  { TPM_NOTRESETABLE, "TPM_NOTRESETABLE", "Attempt to reset a PCR register that does not have the resettable attribute" },
> > -  { TPM_NOTLOCAL, "TPM_NOTLOCAL", "Attempt to reset a PCR register that requires locality and locality modifier not part of command transport" },
> > -  { TPM_BAD_TYPE, "TPM_BAD_TYPE", "Make identity blob not properly typed" },
> > -  { TPM_INVALID_RESOURCE, "TPM_INVALID_RESOURCE", "When saving context identified resource type does not match actual resource" },
> > -  { TPM_NOTFIPS, "TPM_NOTFIPS", "The TPM is attempting to execute a command only available when in FIPS mode" },
> > -  { TPM_INVALID_FAMILY, "TPM_INVALID_FAMILY", "The command is attempting to use an invalid family ID" },
> > -  { TPM_NO_NV_PERMISSION, "TPM_NO_NV_PERMISSION", "The permission to manipulate the NV storage is not available" },
> > -  { TPM_REQUIRES_SIGN, "TPM_REQUIRES_SIGN", "The operation requires a signed command" },
> > -  { TPM_KEY_NOTSUPPORTED, "TPM_KEY_NOTSUPPORTED", "Wrong operation to load an NV key" },
> > -  { TPM_AUTH_CONFLICT, "TPM_AUTH_CONFLICT", "NV_LoadKey blob requires both owner and blob authorization" },
> > -  { TPM_AREA_LOCKED, "TPM_AREA_LOCKED", "The NV area is locked and not writtable" },
> > -  { TPM_BAD_LOCALITY, "TPM_BAD_LOCALITY", "The locality is incorrect for the attempted operation" },
> > -  { TPM_READ_ONLY, "TPM_READ_ONLY", "The NV area is read only and can't be written to" },
> > -  { TPM_PER_NOWRITE, "TPM_PER_NOWRITE", "There is no protection on the write to the NV area" },
> > -  { TPM_FAMILYCOUNT, "TPM_FAMILYCOUNT", "The family count value does not match" },
> > -  { TPM_WRITE_LOCKED, "TPM_WRITE_LOCKED", "The NV area has already been written to" },
> > -  { TPM_BAD_ATTRIBUTES, "TPM_BAD_ATTRIBUTES", "The NV area attributes conflict" },
> > -  { TPM_INVALID_STRUCTURE, "TPM_INVALID_STRUCTURE", "The structure tag and version are invalid or inconsistent" },
> > -  { TPM_KEY_OWNER_CONTROL, "TPM_KEY_OWNER_CONTROL", "The key is under control of the TPM Owner and can only be evicted by the TPM Owner." },
> > -  { TPM_BAD_COUNTER, "TPM_BAD_COUNTER", "The counter handle is incorrect" },
> > -  { TPM_NOT_FULLWRITE, "TPM_NOT_FULLWRITE", "The write is not a complete write of the area" },
> > -  { TPM_CONTEXT_GAP, "TPM_CONTEXT_GAP", "The gap between saved context counts is too large" },
> > -  { TPM_MAXNVWRITES, "TPM_MAXNVWRITES", "The maximum number of NV writes without an owner has been exceeded" },
> > -  { TPM_NOOPERATOR, "TPM_NOOPERATOR", "No operator authorization value is set" },
> > -  { TPM_RESOURCEMISSING, "TPM_RESOURCEMISSING", "The resource pointed to by context is not loaded" },
> > -  { TPM_DELEGATE_LOCK, "TPM_DELEGATE_LOCK", "The delegate administration is locked" },
> > -  { TPM_DELEGATE_FAMILY, "TPM_DELEGATE_FAMILY", "Attempt to manage a family other then the delegated family" },
> > -  { TPM_DELEGATE_ADMIN, "TPM_DELEGATE_ADMIN", "Delegation table management not enabled" },
> > -  { TPM_TRANSPORT_EXCLUSIVE, "TPM_TRANSPORT_EXCLUSIVE", "There was a command executed outside of an exclusive transport session" },
> > -};
> > -
> > -
> > -// helper function for the error codes:
> > -const char* tpm_get_error_name (TPM_RESULT code) {
> > -  // just do a linear scan for now
> > -  unsigned i;
> > -  for (i = 0; i < sizeof(error_msgs)/sizeof(error_msgs[0]); i++)
> > -    if (code == error_msgs[i].code)
> > -      return error_msgs[i].code_name;
> > -
> > -    return("Unknown Error Code");
> > -}
> > diff --git a/tools/vtpm_manager/util/log.h b/tools/vtpm_manager/util/log.h
> > deleted file mode 100644
> > index 1f15f5b..0000000
> > --- a/tools/vtpm_manager/util/log.h
> > +++ /dev/null
> > @@ -1,94 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -
> > -#ifndef __VTPM_LOG_H__
> > -#define __VTPM_LOG_H__
> > -
> > -#include <stdint.h>             // for uint32_t
> > -#include <stddef.h>             // for pointer NULL
> > -
> > -// =========================== LOGGING ==============================
> > -
> > -// the logging module numbers
> > -#define VTPM_LOG_CRYPTO      1
> > -#define VTPM_LOG_BSG         2
> > -#define VTPM_LOG_TXDATA      3
> > -#define VTPM_LOG_TCS         4
> > -#define VTPM_LOG_TCS_DEEP    5
> > -#define VTPM_LOG_VTSP        6
> > -#define VTPM_LOG_VTPM        7
> > -#define VTPM_LOG_VTPM_DEEP   8
> > -#define VTPM_LOG_VTSP_DEEP   9
> > -
> > -static char *module_names[] = { "",
> > -                                "CRYPTO",
> > -                                "BSG",
> > -                                "TXDATA",
> > -                                "TCS",
> > -                                "TCS",
> > -                                "VTSP",
> > -                                "VTPM",
> > -                                "VTPM",
> > -                                "VTSP"
> > -                              };
> > -
> > -// Default to standard logging
> > -#ifndef LOGGING_MODULES
> > -#define LOGGING_MODULES (BITMASK(VTPM_LOG_VTPM))
> > -#endif
> > -
> > -// bit-access macros
> > -#define BITMASK(idx)      ( 1U << (idx) )
> > -#define GETBIT(num,idx)   ( ((num) & BITMASK(idx)) >> idx )
> > -#define SETBIT(num,idx)   (num) |= BITMASK(idx)
> > -#define CLEARBIT(num,idx) (num) &= ( ~ BITMASK(idx) )
> > -
> > -#define vtpmloginfo(module, fmt, args...) \
> > -  if (GETBIT (LOGGING_MODULES, module) == 1) {                         \
> > -    fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); \
> > -  }
> > -
> > -#define vtpmloginfomore(module, fmt, args...) \
> > -  if (GETBIT (LOGGING_MODULES, module) == 1) {                       \
> > -    fprintf (stdout, fmt,##args);                                    \
> > -  }
> > -
> > -#define vtpmlogerror(module, fmt, args...) \
> > -  fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
> > -
> > -//typedef UINT32 tpm_size_t;
> > -
> > -// helper function for the error codes:
> > -const char* tpm_get_error_name (TPM_RESULT code);
> > -
> > -#endif // _VTPM_LOG_H_
> > diff --git a/tools/vtpm_manager/util/tcg.h b/tools/vtpm_manager/util/tcg.h
> > deleted file mode 100644
> > index 5c42913..0000000
> > --- a/tools/vtpm_manager/util/tcg.h
> > +++ /dev/null
> > @@ -1,503 +0,0 @@
> > -// ===================================================================
> > -//
> > -// Copyright (c) 2005, Intel Corp.
> > -// All rights reserved.
> > -//
> > -// Redistribution and use in source and binary forms, with or without
> > -// modification, are permitted provided that the following conditions
> > -// are met:
> > -//
> > -//   * Redistributions of source code must retain the above copyright
> > -//     notice, this list of conditions and the following disclaimer.
> > -//   * Redistributions in binary form must reproduce the above
> > -//     copyright notice, this list of conditions and the following
> > -//     disclaimer in the documentation and/or other materials provided
> > -//     with the distribution.
> > -//   * Neither the name of Intel Corporation nor the names of its
> > -//     contributors may be used to endorse or promote products derived
> > -//     from this software without specific prior written permission.
> > -//
> > -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > -// OF THE POSSIBILITY OF SUCH DAMAGE.
> > -// ===================================================================
> > -//
> > -// tcg.h
> > -//
> > -//  This file contains all the structure and type definitions
> > -//
> > -// ==================================================================
> > -
> > -#ifndef __TCG_H__
> > -#define __TCG_H__
> > -
> > -// This pragma is used to disallow structure padding
> > -#pragma pack(push, 1)
> > -
> > -// *************************** TYPEDEFS *********************************
> > -typedef unsigned char BYTE;
> > -typedef unsigned char BOOL;
> > -typedef unsigned short UINT16;
> > -typedef unsigned int UINT32;
> > -typedef unsigned long long UINT64;
> > -
> > -typedef UINT32 TPM_RESULT;
> > -typedef UINT32 TPM_PCRINDEX;
> > -typedef UINT32 TPM_DIRINDEX;
> > -typedef UINT32 TPM_HANDLE;
> > -typedef TPM_HANDLE TPM_AUTHHANDLE;
> > -typedef TPM_HANDLE TCPA_HASHHANDLE;
> > -typedef TPM_HANDLE TCPA_HMACHANDLE;
> > -typedef TPM_HANDLE TCPA_ENCHANDLE;
> > -typedef TPM_HANDLE TPM_KEY_HANDLE;
> > -typedef TPM_HANDLE TCPA_ENTITYHANDLE;
> > -typedef UINT32 TPM_RESOURCE_TYPE;
> > -typedef UINT32 TPM_COMMAND_CODE;
> > -typedef UINT16 TPM_PROTOCOL_ID;
> > -typedef BYTE TPM_AUTH_DATA_USAGE;
> > -typedef UINT16 TPM_ENTITY_TYPE;
> > -typedef UINT32 TPM_ALGORITHM_ID;
> > -typedef UINT16 TPM_KEY_USAGE;
> > -typedef UINT16 TPM_STARTUP_TYPE;
> > -typedef UINT32 TPM_CAPABILITY_AREA;
> > -typedef UINT16 TPM_ENC_SCHEME;
> > -typedef UINT16 TPM_SIG_SCHEME;
> > -typedef UINT16 TPM_MIGRATE_SCHEME;
> > -typedef UINT16 TPM_PHYSICAL_PRESENCE;
> > -typedef UINT32 TPM_KEY_FLAGS;
> > -
> > -#define TPM_DIGEST_SIZE 20  // Don't change this
> > -typedef BYTE TPM_AUTHDATA[TPM_DIGEST_SIZE];
> > -typedef TPM_AUTHDATA TPM_SECRET;
> > -typedef TPM_AUTHDATA TPM_ENCAUTH;
> > -typedef BYTE TPM_PAYLOAD_TYPE;
> > -typedef UINT16 TPM_TAG;
> > -
> > -// Data Types of the TCS
> > -typedef UINT32 TCS_AUTHHANDLE;  // Handle addressing a authorization session
> > -typedef UINT32 TCS_CONTEXT_HANDLE; // Basic context handle
> > -typedef UINT32 TCS_KEY_HANDLE;  // Basic key handle
> > -
> > -// ************************* STRUCTURES **********************************
> > -
> > -typedef struct TPM_VERSION {
> > -  BYTE major;
> > -  BYTE minor;
> > -  BYTE revMajor;
> > -  BYTE revMinor;
> > -} TPM_VERSION;
> > -
> > -static const TPM_VERSION TPM_STRUCT_VER_1_1 = { 1,1,0,0 };
> > -
> > -typedef struct TPM_DIGEST {
> > -  BYTE digest[TPM_DIGEST_SIZE];
> > -} TPM_DIGEST;
> > -
> > -typedef TPM_DIGEST TPM_PCRVALUE;
> > -typedef TPM_DIGEST TPM_COMPOSITE_HASH;
> > -typedef TPM_DIGEST TPM_DIRVALUE;
> > -typedef TPM_DIGEST TPM_HMAC;
> > -typedef TPM_DIGEST TPM_CHOSENID_HASH;
> > -
> > -typedef struct TPM_NONCE {
> > -  BYTE nonce[TPM_DIGEST_SIZE];
> > -} TPM_NONCE;
> > -
> > -typedef struct TPM_KEY_PARMS {
> > -  TPM_ALGORITHM_ID algorithmID;
> > -  TPM_ENC_SCHEME encScheme;
> > -  TPM_SIG_SCHEME sigScheme;
> > -  UINT32 parmSize;
> > -  BYTE* parms;
> > -} TPM_KEY_PARMS;
> > -
> > -typedef struct TPM_RSA_KEY_PARMS {
> > -  UINT32 keyLength;
> > -  UINT32 numPrimes;
> > -  UINT32 exponentSize;
> > -  BYTE* exponent;
> > -} TPM_RSA_KEY_PARMS;
> > -
> > -typedef struct TPM_STORE_PUBKEY {
> > -  UINT32 keyLength;
> > -  BYTE* key;
> > -} TPM_STORE_PUBKEY;
> > -
> > -typedef struct TPM_PUBKEY {
> > -  TPM_KEY_PARMS algorithmParms;
> > -  TPM_STORE_PUBKEY pubKey;
> > -} TPM_PUBKEY;
> > -
> > -typedef struct TPM_KEY {
> > -  TPM_VERSION         ver;
> > -  TPM_KEY_USAGE       keyUsage;
> > -  TPM_KEY_FLAGS       keyFlags;
> > -  TPM_AUTH_DATA_USAGE authDataUsage;
> > -  TPM_KEY_PARMS       algorithmParms;
> > -  UINT32              PCRInfoSize;
> > -  BYTE*               PCRInfo; // this should be a TPM_PCR_INFO, or NULL
> > -  TPM_STORE_PUBKEY    pubKey;
> > -  UINT32              encDataSize;
> > -  BYTE*               encData;
> > -} TPM_KEY;
> > -
> > -typedef struct TPM_PCR_SELECTION {
> > -  UINT16 sizeOfSelect;        /// in bytes
> > -  BYTE* pcrSelect;
> > -} TPM_PCR_SELECTION;
> > -
> > -typedef struct TPM_PCR_COMPOSITE {
> > -  TPM_PCR_SELECTION select;
> > -  UINT32 valueSize;
> > -  TPM_PCRVALUE* pcrValue;
> > -} TPM_PCR_COMPOSITE;
> > -
> > -
> > -typedef struct TPM_PCR_INFO {
> > -  TPM_PCR_SELECTION pcrSelection;
> > -  TPM_COMPOSITE_HASH digestAtRelease;
> > -  TPM_COMPOSITE_HASH digestAtCreation;
> > -} TPM_PCR_INFO;
> > -
> > -
> > -typedef struct TPM_BOUND_DATA {
> > -  TPM_VERSION ver;
> > -  TPM_PAYLOAD_TYPE payload;
> > -  BYTE* payloadData;
> > -} TPM_BOUND_DATA;
> > -
> > -typedef struct TPM_STORED_DATA {
> > -  TPM_VERSION ver;
> > -  UINT32 sealInfoSize;
> > -  BYTE* sealInfo;
> > -  UINT32 encDataSize;
> > -  BYTE* encData;
> > -} TPM_STORED_DATA;
> > -
> > -typedef struct TCS_AUTH {
> > -  TCS_AUTHHANDLE  AuthHandle;
> > -  TPM_NONCE   NonceOdd;   // system
> > -  TPM_NONCE   NonceEven;   // TPM
> > -  BOOL   fContinueAuthSession;
> > -  TPM_AUTHDATA  HMAC;
> > -} TCS_AUTH;
> > -
> > -// structures for dealing with sizes followed by buffers in all the
> > -// TCG structure.
> > -typedef struct pack_buf_t {
> > -  UINT32 size;
> > -  BYTE * data;
> > -} pack_buf_t;
> > -
> > -typedef struct pack_constbuf_t {
> > -  UINT32 size;
> > -  const BYTE* data;
> > -} pack_constbuf_t;
> > -
> > -
> > -
> > -// **************************** CONSTANTS *********************************
> > -
> > -// BOOL values
> > -#define TRUE 0x01
> > -#define FALSE 0x00
> > -
> > -#define TCPA_MAX_BUFFER_LENGTH 0x2000
> > -
> > -//
> > -// TPM_COMMAND_CODE values
> > -#define TPM_PROTECTED_ORDINAL 0x00000000UL
> > -#define TPM_UNPROTECTED_ORDINAL 0x80000000UL
> > -#define TPM_CONNECTION_ORDINAL 0x40000000UL
> > -#define TPM_VENDOR_ORDINAL 0x20000000UL
> > -
> > -#define TPM_ORD_OIAP                     (10UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_OSAP                     (11UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ChangeAuth               (12UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_TakeOwnership            (13UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ChangeAuthAsymStart      (14UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ChangeAuthAsymFinish     (15UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ChangeAuthOwner          (16UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_Extend                   (20UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_PcrRead                  (21UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_Quote                    (22UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_Seal                     (23UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_Unseal                   (24UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_DirWriteAuth             (25UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_DirRead                  (26UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_UnBind                   (30UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_CreateWrapKey            (31UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_LoadKey                  (32UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_GetPubKey                (33UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_EvictKey                 (34UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_CreateMigrationBlob      (40UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ReWrapKey                (41UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ConvertMigrationBlob     (42UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_AuthorizeMigrationKey    (43UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_CreateMaintenanceArchive (44UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_LoadMaintenanceArchive   (45UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_KillMaintenanceFeature   (46UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_LoadManuMaintPub         (47UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ReadManuMaintPub         (48UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_CertifyKey               (50UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_Sign                     (60UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_GetRandom                (70UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_StirRandom               (71UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SelfTestFull             (80UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SelfTestStartup          (81UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_CertifySelfTest          (82UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ContinueSelfTest         (83UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_GetTestResult            (84UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_Reset                    (90UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_OwnerClear               (91UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_DisableOwnerClear        (92UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ForceClear               (93UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_DisableForceClear        (94UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_GetCapabilitySigned      (100UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_GetCapability            (101UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_GetCapabilityOwner       (102UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_OwnerSetDisable          (110UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_PhysicalEnable           (111UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_PhysicalDisable          (112UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SetOwnerInstall          (113UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_PhysicalSetDeactivated   (114UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SetTempDeactivated       (115UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_CreateEndorsementKeyPair (120UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_MakeIdentity             (121UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ActivateIdentity         (122UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_ReadPubek                (124UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_OwnerReadPubek           (125UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_DisablePubekRead         (126UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_GetAuditEvent            (130UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_GetAuditEventSigned      (131UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_GetOrdinalAuditStatus    (140UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SetOrdinalAuditStatus    (141UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_Terminate_Handle         (150UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_Init                     (151UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SaveState                (152UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_Startup                  (153UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SetRedirection           (154UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SHA1Start                (160UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SHA1Update               (161UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SHA1Complete             (162UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SHA1CompleteExtend       (163UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_FieldUpgrade             (170UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SaveKeyContext           (180UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_LoadKeyContext           (181UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_SaveAuthContext          (182UL + TPM_PROTECTED_ORDINAL)
> > -#define TPM_ORD_LoadAuthContext          (183UL + TPM_PROTECTED_ORDINAL)
> > -#define TSC_ORD_PhysicalPresence         (10UL + TPM_CONNECTION_ORDINAL)
> > -
> > -
> > -
> > -//
> > -// TPM_RESULT values
> > -//
> > -// just put in the whole table from spec 1.2
> > -
> > -#define TPM_BASE   0x0 // The start of TPM return codes
> > -#define TPM_VENDOR_ERROR 0x00000400 // Mask to indicate that the error code is vendor specific for vendor specific commands
> > -#define TPM_NON_FATAL  0x00000800 // Mask to indicate that the error code is a non-fatal failure.
> > -
> > -#define TPM_SUCCESS   TPM_BASE // Successful completion of the operation
> > -#define TPM_AUTHFAIL      TPM_BASE + 1 // Authentication failed
> > -#define TPM_BADINDEX      TPM_BASE + 2 // The index to a PCR, DIR or other register is incorrect
> > -#define TPM_BAD_PARAMETER     TPM_BASE + 3 // One or more parameter is bad
> > -#define TPM_AUDITFAILURE     TPM_BASE + 4 // An operation completed successfully but the auditing of that operation failed.
> > -#define TPM_CLEAR_DISABLED     TPM_BASE + 5 // The clear disable flag is set and all clear operations now require physical access
> > -#define TPM_DEACTIVATED     TPM_BASE + 6 // The TPM is deactivated
> > -#define TPM_DISABLED      TPM_BASE + 7 // The TPM is disabled
> > -#define TPM_DISABLED_CMD     TPM_BASE + 8 // The target command has been disabled
> > -#define TPM_FAIL       TPM_BASE + 9 // The operation failed
> > -#define TPM_BAD_ORDINAL     TPM_BASE + 10 // The ordinal was unknown or inconsistent
> > -#define TPM_INSTALL_DISABLED   TPM_BASE + 11 // The ability to install an owner is disabled
> > -#define TPM_INVALID_KEYHANDLE  TPM_BASE + 12 // The key handle presented was invalid
> > -#define TPM_KEYNOTFOUND     TPM_BASE + 13 // The target key was not found
> > -#define TPM_INAPPROPRIATE_ENC  TPM_BASE + 14 // Unacceptable encryption scheme
> > -#define TPM_MIGRATEFAIL     TPM_BASE + 15 // Migration authorization failed
> > -#define TPM_INVALID_PCR_INFO   TPM_BASE + 16 // PCR information could not be interpreted
> > -#define TPM_NOSPACE      TPM_BASE + 17 // No room to load key.
> > -#define TPM_NOSRK       TPM_BASE + 18 // There is no SRK set
> > -#define TPM_NOTSEALED_BLOB     TPM_BASE + 19 // An encrypted blob is invalid or was not created by this TPM
> > -#define TPM_OWNER_SET      TPM_BASE + 20 // There is already an Owner
> > -#define TPM_RESOURCES      TPM_BASE + 21 // The TPM has insufficient internal resources to perform the requested action.
> > -#define TPM_SHORTRANDOM     TPM_BASE + 22 // A random string was too short
> > -#define TPM_SIZE       TPM_BASE + 23 // The TPM does not have the space to perform the operation.
> > -#define TPM_WRONGPCRVAL     TPM_BASE + 24 // The named PCR value does not match the current PCR value.
> > -#define TPM_BAD_PARAM_SIZE     TPM_BASE + 25 // The paramSize argument to the command has the incorrect value
> > -#define TPM_SHA_THREAD      TPM_BASE + 26 // There is no existing SHA-1 thread.
> > -#define TPM_SHA_ERROR      TPM_BASE + 27 // The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error.
> > -#define TPM_FAILEDSELFTEST     TPM_BASE + 28 // Self-test has failed and the TPM has shutdown.
> > -#define TPM_AUTH2FAIL      TPM_BASE + 29 // The authorization for the second key in a 2 key function failed authorization
> > -#define TPM_BADTAG       TPM_BASE + 30 // The tag value sent to for a command is invalid
> > -#define TPM_IOERROR      TPM_BASE + 31 // An IO error occurred transmitting information to the TPM
> > -#define TPM_ENCRYPT_ERROR     TPM_BASE + 32 // The encryption process had a problem.
> > -#define TPM_DECRYPT_ERROR     TPM_BASE + 33 // The decryption process did not complete.
> > -#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 // An invalid handle was used.
> > -#define TPM_NO_ENDORSEMENT     TPM_BASE + 35 // The TPM does not a EK installed
> > -#define TPM_INVALID_KEYUSAGE   TPM_BASE + 36 // The usage of a key is not allowed
> > -#define TPM_WRONG_ENTITYTYPE   TPM_BASE + 37 // The submitted entity type is not allowed
> > -#define TPM_INVALID_POSTINIT   TPM_BASE + 38 // The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup
> > -#define TPM_INAPPROPRIATE_SIG  TPM_BASE + 39 // Signed data cannot include additional DER information
> > -#define TPM_BAD_KEY_PROPERTY   TPM_BASE + 40 // The key properties in TPM_KEY_PARMs are not supported by this TPM
> > -
> > -#define TPM_BAD_MIGRATION      TPM_BASE + 41 // The migration properties of this key are incorrect.
> > -#define TPM_BAD_SCHEME       TPM_BASE + 42 // The signature or encryption scheme for this key is incorrect or not permitted in this situation.
> > -#define TPM_BAD_DATASIZE      TPM_BASE + 43 // The size of the data (or blob) parameter is bad or inconsistent with the referenced key
> > -#define TPM_BAD_MODE       TPM_BASE + 44 // A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob.
> > -#define TPM_BAD_PRESENCE      TPM_BASE + 45 // Either the physicalPresence or physicalPresenceLock bits have the wrong value
> > -#define TPM_BAD_VERSION      TPM_BASE + 46 // The TPM cannot perform this version of the capability
> > -#define TPM_NO_WRAP_TRANSPORT     TPM_BASE + 47 // The TPM does not allow for wrapped transport sessions
> > -#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 // TPM audit construction failed and the underlying command was returning a failure code also
> > -#define TPM_AUDITFAIL_SUCCESSFUL   TPM_BASE + 49 // TPM audit construction failed and the underlying command was returning success
> > -#define TPM_NOTRESETABLE      TPM_BASE + 50 // Attempt to reset a PCR register that does not have the resettable attribute
> > -#define TPM_NOTLOCAL       TPM_BASE + 51 // Attempt to reset a PCR register that requires locality and locality modifier not part of command transport
> > -#define TPM_BAD_TYPE       TPM_BASE + 52 // Make identity blob not properly typed
> > -#define TPM_INVALID_RESOURCE     TPM_BASE + 53 // When saving context identified resource type does not match actual resource
> > -#define TPM_NOTFIPS       TPM_BASE + 54 // The TPM is attempting to execute a command only available when in FIPS mode
> > -#define TPM_INVALID_FAMILY      TPM_BASE + 55 // The command is attempting to use an invalid family ID
> > -#define TPM_NO_NV_PERMISSION     TPM_BASE + 56 // The permission to manipulate the NV storage is not available
> > -#define TPM_REQUIRES_SIGN      TPM_BASE + 57 // The operation requires a signed command
> > -#define TPM_KEY_NOTSUPPORTED     TPM_BASE + 58 // Wrong operation to load an NV key
> > -#define TPM_AUTH_CONFLICT      TPM_BASE + 59 // NV_LoadKey blob requires both owner and blob authorization
> > -#define TPM_AREA_LOCKED      TPM_BASE + 60 // The NV area is locked and not writtable
> > -#define TPM_BAD_LOCALITY      TPM_BASE + 61 // The locality is incorrect for the attempted operation
> > -#define TPM_READ_ONLY       TPM_BASE + 62 // The NV area is read only and can't be written to
> > -#define TPM_PER_NOWRITE      TPM_BASE + 63 // There is no protection on the write to the NV area
> > -#define TPM_FAMILYCOUNT      TPM_BASE + 64 // The family count value does not match
> > -#define TPM_WRITE_LOCKED      TPM_BASE + 65 // The NV area has already been written to
> > -#define TPM_BAD_ATTRIBUTES      TPM_BASE + 66 // The NV area attributes conflict
> > -#define TPM_INVALID_STRUCTURE     TPM_BASE + 67 // The structure tag and version are invalid or inconsistent
> > -#define TPM_KEY_OWNER_CONTROL     TPM_BASE + 68 // The key is under control of the TPM Owner and can only be evicted by the TPM Owner.
> > -#define TPM_BAD_COUNTER      TPM_BASE + 69 // The counter handle is incorrect
> > -#define TPM_NOT_FULLWRITE      TPM_BASE + 70 // The write is not a complete write of the area
> > -#define TPM_CONTEXT_GAP      TPM_BASE + 71 // The gap between saved context counts is too large
> > -#define TPM_MAXNVWRITES      TPM_BASE + 72 // The maximum number of NV writes without an owner has been exceeded
> > -#define TPM_NOOPERATOR       TPM_BASE + 73 // No operator authorization value is set
> > -#define TPM_RESOURCEMISSING     TPM_BASE + 74 // The resource pointed to by context is not loaded
> > -#define TPM_DELEGATE_LOCK      TPM_BASE + 75 // The delegate administration is locked
> > -#define TPM_DELEGATE_FAMILY     TPM_BASE + 76 // Attempt to manage a family other then the delegated family
> > -#define TPM_DELEGATE_ADMIN      TPM_BASE + 77 // Delegation table management not enabled
> > -#define TPM_TRANSPORT_EXCLUSIVE    TPM_BASE + 78 // There was a command executed outside of an exclusive transport session
> > -
> > -// TPM_STARTUP_TYPE values
> > -#define TPM_ST_CLEAR 0x0001
> > -#define TPM_ST_STATE 0x0002
> > -#define TPM_ST_DEACTIVATED 0x003
> > -
> > -// TPM_TAG values
> > -#define TPM_TAG_RQU_COMMAND 0x00c1
> > -#define TPM_TAG_RQU_AUTH1_COMMAND 0x00c2
> > -#define TPM_TAG_RQU_AUTH2_COMMAND 0x00c3
> > -#define TPM_TAG_RSP_COMMAND 0x00c4
> > -#define TPM_TAG_RSP_AUTH1_COMMAND 0x00c5
> > -#define TPM_TAG_RSP_AUTH2_COMMAND 0x00c6
> > -
> > -// TPM_PAYLOAD_TYPE values
> > -#define TPM_PT_ASYM 0x01
> > -#define TPM_PT_BIND 0x02
> > -#define TPM_PT_MIGRATE 0x03
> > -#define TPM_PT_MAINT 0x04
> > -#define TPM_PT_SEAL 0x05
> > -
> > -// TPM_ENTITY_TYPE values
> > -#define TPM_ET_KEYHANDLE 0x0001
> > -#define TPM_ET_OWNER 0x0002
> > -#define TPM_ET_DATA 0x0003
> > -#define TPM_ET_SRK 0x0004
> > -#define TPM_ET_KEY 0x0005
> > -
> > -/// TPM_ResourceTypes
> > -#define TPM_RT_KEY      0x00000001
> > -#define TPM_RT_AUTH     0x00000002
> > -#define TPM_RT_TRANS    0x00000004
> > -#define TPM_RT_CONTEXT  0x00000005
> > -
> > -// TPM_PROTOCOL_ID values
> > -#define TPM_PID_OIAP 0x0001
> > -#define TPM_PID_OSAP 0x0002
> > -#define TPM_PID_ADIP 0x0003
> > -#define TPM_PID_ADCP 0x0004
> > -#define TPM_PID_OWNER 0x0005
> > -
> > -// TPM_ALGORITHM_ID values
> > -#define TPM_ALG_RSA 0x00000001
> > -#define TPM_ALG_DES 0x00000002
> > -#define TPM_ALG_3DES 0X00000003
> > -#define TPM_ALG_SHA 0x00000004
> > -#define TPM_ALG_HMAC 0x00000005
> > -#define TCPA_ALG_AES 0x00000006
> > -
> > -// TPM_ENC_SCHEME values
> > -#define TPM_ES_NONE 0x0001
> > -#define TPM_ES_RSAESPKCSv15 0x0002
> > -#define TPM_ES_RSAESOAEP_SHA1_MGF1 0x0003
> > -
> > -// TPM_SIG_SCHEME values
> > -#define TPM_SS_NONE 0x0001
> > -#define TPM_SS_RSASSAPKCS1v15_SHA1 0x0002
> > -#define TPM_SS_RSASSAPKCS1v15_DER 0x0003
> > -
> > -// TPM_KEY_USAGE values
> > -#define TPM_KEY_EK 0x0000
> > -#define TPM_KEY_SIGNING 0x0010
> > -#define TPM_KEY_STORAGE 0x0011
> > -#define TPM_KEY_IDENTITY 0x0012
> > -#define TPM_KEY_AUTHCHANGE 0X0013
> > -#define TPM_KEY_BIND 0x0014
> > -#define TPM_KEY_LEGACY 0x0015
> > -
> > -// TPM_AUTH_DATA_USAGE values
> > -#define TPM_AUTH_NEVER 0x00
> > -#define TPM_AUTH_ALWAYS 0x01
> > -
> > -// Key Handle of owner and srk
> > -#define TPM_OWNER_KEYHANDLE 0x40000001
> > -#define TPM_SRK_KEYHANDLE 0x40000000
> > -
> > -// ---------------------- Functions for checking TPM_RESULTs -----------------
> > -
> > -#include <stdio.h>
> > -
> > -// FIXME: Review use of these and delete unneeded ones.
> > -
> > -// these are really badly dependent on local structure:
> > -// DEPENDS: local var 'status' of type TPM_RESULT
> > -// DEPENDS: label 'abort_egress' which cleans up and returns the status
> > -#define ERRORDIE(s) do { status = s; \
> > -                         fprintf (stderr, "*** ERRORDIE in %s at %s: %i\n", __func__, __FILE__, __LINE__); \
> > -                         goto abort_egress; } \
> > -                    while (0)
> > -
> > -// DEPENDS: local var 'status' of type TPM_RESULT
> > -// DEPENDS: label 'abort_egress' which cleans up and returns the status
> > -// Try command c. If it fails, set status to s and goto abort.
> > -#define TPMTRY(s,c) if (c != TPM_SUCCESS) { \
> > -                       status = s; \
> > -                       printf("ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
> > -                       goto abort_egress; \
> > -                    } else {\
> > -                       status = c; \
> > -                    }
> > -
> > -// Try command c. If it fails, print error message, set status to actual return code. Goto abort
> > -#define TPMTRYRETURN(c) do { status = c; \
> > -                             if (status != TPM_SUCCESS) { \
> > -                               fprintf(stderr, "ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
> > -                               goto abort_egress; \
> > -                             } \
> > -                        } while(0)
> > -
> > -
> > -#pragma pack(pop)
> > -
> > -#endif //__TCPA_H__
> > diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c
> > index 3b89223..0ba1d55 100644
> > --- a/tools/xenstore/hashtable.c
> > +++ b/tools/xenstore/hashtable.c
> > @@ -3,7 +3,6 @@
> >  /*
> >   * There are duplicates of this code in:
> >   *  - tools/blktap2/drivers/hashtable.c
> > - *  - tools/vtpm_manager/util/hashtable.c
> >   */
> >
> >  #include "hashtable.h"
> > diff --git a/tools/xenstore/hashtable.h b/tools/xenstore/hashtable.h
> > index 8e6bb5b..4d68223 100644
> > --- a/tools/xenstore/hashtable.h
> > +++ b/tools/xenstore/hashtable.h
> > @@ -3,7 +3,6 @@
> >  /*
> >   * There are duplicates of this code in:
> >   *  - tools/blktap2/drivers/hashtable.h
> > - *  - tools/vtpm_manager/util/hashtable.h
> >   */
> >
> >  #ifndef __HASHTABLE_CWC22_H__
> > diff --git a/tools/xenstore/hashtable_private.h b/tools/xenstore/hashtable_private.h
> > index cabaffe..a08559d 100644
> > --- a/tools/xenstore/hashtable_private.h
> > +++ b/tools/xenstore/hashtable_private.h
> > @@ -3,7 +3,6 @@
> >  /*
> >   * There are duplicates of this code in:
> >   *  - tools/blktap2/drivers/hashtable_private.h
> > - *  - tools/vtpm_manager/util/hashtable_private.h
> >   */
> >
> >  #ifndef __HASHTABLE_PRIVATE_CWC22_H__
> > diff --git a/tools/xm-test/configure.ac b/tools/xm-test/configure.ac
> > index ad1eb78..c142140 100644
> > --- a/tools/xm-test/configure.ac
> > +++ b/tools/xm-test/configure.ac
> > @@ -143,7 +143,6 @@ AC_CONFIG_FILES([
> >      tests/unpause/Makefile
> >      tests/vcpu-pin/Makefile
> >      tests/vcpu-disable/Makefile
> > -    tests/vtpm/Makefile
> >      tests/xapi/Makefile
> >      tests/enforce_dom0_cpus/Makefile
> >      tests/cpupool/Makefile
> > diff --git a/tools/xm-test/grouptest/default b/tools/xm-test/grouptest/default
> > index f0516b2..e04591b 100644
> > --- a/tools/xm-test/grouptest/default
> > +++ b/tools/xm-test/grouptest/default
> > @@ -27,5 +27,4 @@ sysrq
> >  unpause
> >  vcpu-disable
> >  vcpu-pin
> > -vtpm
> >  xapi
> > diff --git a/tools/xm-test/grouptest/medium b/tools/xm-test/grouptest/medium
> > index bafc988..5c3e1b1 100644
> > --- a/tools/xm-test/grouptest/medium
> > +++ b/tools/xm-test/grouptest/medium
> > @@ -22,4 +22,3 @@ sysrq 01_sysrq_basic_neg.test 02_sysrq_sync_pos.test
> >  unpause
> >  vcpu-disable
> >  vcpu-pin
> > -vtpm
> > diff --git a/tools/xm-test/grouptest/xapi b/tools/xm-test/grouptest/xapi
> > index 3b04921..7a08b77 100644
> > --- a/tools/xm-test/grouptest/xapi
> > +++ b/tools/xm-test/grouptest/xapi
> > @@ -1,2 +1 @@
> >  xapi
> > -vtpm 09_vtpm-xapi.test
> > diff --git a/tools/xm-test/lib/XmTestLib/XenDomain.py b/tools/xm-test/lib/XmTestLib/XenDomain.py
> > index ae8c550..3ba7433 100644
> > --- a/tools/xm-test/lib/XmTestLib/XenDomain.py
> > +++ b/tools/xm-test/lib/XmTestLib/XenDomain.py
> > @@ -59,7 +59,6 @@ class XenConfig:
> >          # These options need to be lists
> >          self.defaultOpts["disk"] = []
> >          self.defaultOpts["vif"]  = []
> > -        self.defaultOpts["vtpm"] = []
> >
> >          self.opts = self.defaultOpts
> >
> > diff --git a/tools/xm-test/tests/Makefile.am b/tools/xm-test/tests/Makefile.am
> > index 8d673ed..455f50c 100644
> > --- a/tools/xm-test/tests/Makefile.am
> > +++ b/tools/xm-test/tests/Makefile.am
> > @@ -25,7 +25,6 @@ SUBDIRS =                     \
> >                 unpause         \
> >                 vcpu-disable    \
> >                 vcpu-pin        \
> > -               vtpm            \
> >                 enforce_dom0_cpus       \
> >                 save restore migrate    \
> >                 cpupool
> > diff --git a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py b/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
> > deleted file mode 100644
> > index dfd1227..0000000
> > --- a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
> > +++ /dev/null
> > @@ -1,40 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -# Positive Test: create domain with virtual TPM attached at build time,
> > -#                verify list
> > -
> > -
> > -from XmTestLib import *
> > -from vtpm_utils import *
> > -import commands
> > -import os
> > -import atexit
> > -
> > -config = {"vtpm":"instance=1,backend=0"}
> > -domain = XmTestDomain(extraConfig=config)
> > -
> > -try:
> > -    domain.start(noConsole=True)
> > -except DomainError, e:
> > -    if verbose:
> > -        print e.extra
> > -    vtpm_cleanup(domain.getName())
> > -    FAIL("Unable to create domain")
> > -
> > -
> > -domName = domain.getName()
> > -
> > -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> > -
> > -status, output = traceCommand("xm vtpm-list %s" % domain.getId())
> > -eyecatcher = "/local/domain/0/backend/vtpm"
> > -where = output.find(eyecatcher)
> > -if status != 0:
> > -    FAIL("xm vtpm-list returned bad status, expected 0, status is %i" % status)
> > -elif where < 0:
> > -    FAIL("Fail to list virtual TPM device")
> > -
> > -domain.stop()
> > diff --git a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py b/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
> > deleted file mode 100644
> > index a18cbab..0000000
> > --- a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
> > +++ /dev/null
> > @@ -1,49 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -# Positive Test: create domain with virtual TPM attached at build time,
> > -#                check list of pcrs
> > -
> > -from XmTestLib import *
> > -from vtpm_utils import *
> > -import commands
> > -import os
> > -import os.path
> > -import atexit
> > -
> > -config = {"vtpm":"instance=1,backend=0"}
> > -domain = XmTestDomain(extraConfig=config)
> > -domName = domain.getName()
> > -
> > -try:
> > -    console = domain.start()
> > -except DomainError, e:
> > -    if verbose:
> > -        print e.extra
> > -    FAIL("Unable to create domain (%s)" % domName)
> > -
> > -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> > -
> > -try:
> > -    console.sendInput("input")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL(str(e))
> > -
> > -try:
> > -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("No result from dumping the PCRs")
> > -
> > -if re.search("No such file",run["output"]):
> > -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> > -
> > -domain.closeConsole()
> > -
> > -domain.stop()
> > -
> > -if not re.search("PCR-00:",run["output"]):
> > -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> > diff --git a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py b/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
> > deleted file mode 100644
> > index b863f27..0000000
> > --- a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
> > +++ /dev/null
> > @@ -1,99 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -# Positive Test: create domain with virtual TPM attached at build time,
> > -#                check list of pcrs; suspend and resume the domain and
> > -#                check list of pcrs again
> > -
> > -from XmTestLib import *
> > -from vtpm_utils import *
> > -import commands
> > -import os
> > -import os.path
> > -import atexit
> > -
> > -config = {"vtpm":"instance=1,backend=0"}
> > -domain = XmTestDomain(extraConfig=config)
> > -domName = domain.getName()
> > -consoleHistory = ""
> > -
> > -try:
> > -    console = domain.start()
> > -except DomainError, e:
> > -    if verbose:
> > -        print e.extra
> > -    FAIL("Unable to create domain (%s)" % domName)
> > -
> > -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> > -
> > -try:
> > -    console.sendInput("input")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL(str(e))
> > -
> > -try:
> > -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("No result from dumping the PCRs")
> > -
> > -if re.search("No such file",run["output"]):
> > -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> > -
> > -consoleHistory = console.getHistory()
> > -domain.closeConsole()
> > -
> > -loop = 0
> > -while loop < 3:
> > -    try:
> > -        status, ouptut = traceCommand("xm save %s %s.save" %
> > -                                      (domName, domName),
> > -                                      timeout=30)
> > -
> > -    except TimeoutError, e:
> > -        saveLog(consoleHistory)
> > -        FAIL(str(e))
> > -
> > -    if status != 0:
> > -        saveLog(consoleHistory)
> > -        FAIL("xm save did not succeed")
> > -
> > -    try:
> > -        status, ouptut = traceCommand("xm restore %s.save" %
> > -                                      (domName),
> > -                                      timeout=30)
> > -    except TimeoutError, e:
> > -        os.remove("%s.save" % domName)
> > -        saveLog(consoleHistory)
> > -        FAIL(str(e))
> > -
> > -    os.remove("%s.save" % domName)
> > -
> > -    if status != 0:
> > -        saveLog(consoleHistory)
> > -        FAIL("xm restore did not succeed")
> > -
> > -    try:
> > -        console = domain.getConsole()
> > -    except ConsoleError, e:
> > -        FAIL(str(e))
> > -
> > -    try:
> > -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -    except ConsoleError, e:
> > -        saveLog(console.getHistory())
> > -        FAIL(str(e))
> > -
> > -    if not re.search("PCR-00:",run["output"]):
> > -        saveLog(console.getHistory())
> > -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> > -
> > -    loop += 1
> > -
> > -domain.closeConsole()
> > -
> > -domain.stop()
> > -
> > diff --git a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py b/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
> > deleted file mode 100644
> > index ccc8b73..0000000
> > --- a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
> > +++ /dev/null
> > @@ -1,93 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -# Positive Test: create domain with virtual TPM attached at build time,
> > -#                check list of pcrs; locally migrate the domain and
> > -#                check list of pcrs again
> > -#                This test does local live migration.
> > -
> > -from XmTestLib import *
> > -from vtpm_utils import *
> > -import commands
> > -import os
> > -import os.path
> > -import atexit
> > -
> > -config = {"vtpm":"instance=1,backend=0"}
> > -domain = XmTestDomain(extraConfig=config)
> > -domName = domain.getName()
> > -consoleHistory = ""
> > -
> > -try:
> > -    console = domain.start()
> > -except DomainError, e:
> > -    if verbose:
> > -        print e.extra
> > -    FAIL("Unable to create domain (%s)" % domName)
> > -
> > -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> > -
> > -try:
> > -    console.sendInput("input")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL(str(e))
> > -
> > -try:
> > -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("No result from dumping the PCRs")
> > -
> > -if re.search("No such file",run["output"]):
> > -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> > -
> > -consoleHistory = console.getHistory()
> > -domain.closeConsole()
> > -
> > -old_domid = domid(domName)
> > -
> > -loop = 0
> > -while loop < 3:
> > -    try:
> > -        status, ouptut = traceCommand("xm migrate -l %s localhost" %
> > -                                      domName,
> > -                                      timeout=90)
> > -    except TimeoutError, e:
> > -        saveLog(consoleHistory)
> > -        FAIL(str(e))
> > -
> > -    if status != 0:
> > -        saveLog(consoleHistory)
> > -        FAIL("xm migrate did not succeed. External device migration activated?")
> > -
> > -
> > -    domName = domain.getName()
> > -    new_domid = domid(domName)
> > -
> > -    if (old_domid == new_domid):
> > -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> > -             (old_domid,loop))
> > -
> > -    try:
> > -        console = domain.getConsole()
> > -    except ConsoleError, e:
> > -        FAIL(str(e))
> > -
> > -    try:
> > -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -    except ConsoleError, e:
> > -        saveLog(console.getHistory())
> > -        FAIL("No result from dumping the PCRs")
> > -
> > -    if not re.search("PCR-00:",run["output"]):
> > -        saveLog(console.getHistory())
> > -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> > -
> > -    loop += 1
> > -
> > -domain.closeConsole()
> > -
> > -domain.stop()
> > diff --git a/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py b/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py
> > deleted file mode 100644
> > index 57b87df..0000000
> > --- a/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py
> > +++ /dev/null
> > @@ -1,93 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -# Positive Test: create domain with virtual TPM attached at build time,
> > -#                check list of pcrs; locally migrate the domain and
> > -#                check list of pcrs again
> > -#                This test does local (non-live) migration.
> > -
> > -from XmTestLib import *
> > -from vtpm_utils import *
> > -import commands
> > -import os
> > -import os.path
> > -import atexit
> > -
> > -config = {"vtpm":"instance=1,backend=0"}
> > -domain = XmTestDomain(extraConfig=config)
> > -domName = domain.getName()
> > -consoleHistory = ""
> > -
> > -try:
> > -    console = domain.start()
> > -except DomainError, e:
> > -    if verbose:
> > -        print e.extra
> > -    FAIL("Unable to create domain (%s)" % domName)
> > -
> > -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> > -
> > -try:
> > -    console.sendInput("input")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL(str(e))
> > -
> > -try:
> > -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("No result from dumping the PCRs")
> > -
> > -if re.search("No such file",run["output"]):
> > -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> > -
> > -consoleHistory = console.getHistory()
> > -domain.closeConsole()
> > -
> > -old_domid = domid(domName)
> > -
> > -loop = 0
> > -while loop < 3:
> > -    try:
> > -        status, ouptut = traceCommand("xm migrate %s localhost" %
> > -                                      domName,
> > -                                      timeout=90)
> > -    except TimeoutError, e:
> > -        saveLog(consoleHistory)
> > -        FAIL(str(e))
> > -
> > -    if status != 0:
> > -        saveLog(consoleHistory)
> > -        FAIL("xm migrate did not succeed. External device migration activated?")
> > -
> > -
> > -    domName = domain.getName()
> > -    new_domid = domid(domName)
> > -
> > -    if (old_domid == new_domid):
> > -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> > -             (old_domid,loop))
> > -
> > -    try:
> > -        console = domain.getConsole()
> > -    except ConsoleError, e:
> > -        FAIL(str(e))
> > -
> > -    try:
> > -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -    except ConsoleError, e:
> > -        saveLog(console.getHistory())
> > -        FAIL("No result from dumping the PCRs")
> > -
> > -    if not re.search("PCR-00:",run["output"]):
> > -        saveLog(console.getHistory())
> > -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> > -
> > -    loop += 1
> > -
> > -domain.closeConsole()
> > -
> > -domain.stop()
> > diff --git a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py b/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
> > deleted file mode 100644
> > index c70691d..0000000
> > --- a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
> > +++ /dev/null
> > @@ -1,125 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -# Positive Test: create domain with virtual TPM attached at build time,
> > -#                extend a pcr
> > -#                check list of pcrs; suspend and resume the domain and
> > -#                check list of pcrs again and validate extended pcr
> > -
> > -from XmTestLib import *
> > -from vtpm_utils import *
> > -import commands
> > -import os
> > -import os.path
> > -import atexit
> > -
> > -config = {"vtpm":"instance=1,backend=0"}
> > -domain = XmTestDomain(extraConfig=config)
> > -domName = domain.getName()
> > -consoleHistory = ""
> > -
> > -try:
> > -    console = domain.start()
> > -except DomainError, e:
> > -    if verbose:
> > -        print e.extra
> > -    FAIL("Unable to create domain (%s)" % domName)
> > -
> > -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> > -
> > -try:
> > -    console.sendInput("input")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL(str(e))
> > -
> > -try:
> > -    run = console.runCmd("mknod /dev/tpm0 c 10 224")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("Error while creating /dev/tpm0")
> > -
> > -try:
> > -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("Error while extending PCR 0")
> > -
> > -try:
> > -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("No result from dumping the PCRs")
> > -
> > -
> > -if re.search("No such file",run["output"]):
> > -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> > -
> > -if not re.search("PCR-00:",run["output"]):
> > -    saveLog(console.getHistory())
> > -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> > -
> > -if not re.search("PCR-00: 1E A7 BD",run["output"]):
> > -    saveLog(console.getHistory())
> > -    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
> > -
> > -consoleHistory = console.getHistory()
> > -domain.closeConsole()
> > -
> > -loop = 0
> > -while loop < 3:
> > -    try:
> > -        status, ouptut = traceCommand("xm save %s %s.save" %
> > -                                      (domName, domName),
> > -                                      timeout=30)
> > -
> > -    except TimeoutError, e:
> > -        saveLog(consoleHistory)
> > -        FAIL(str(e))
> > -
> > -    if status != 0:
> > -        saveLog(consoleHistory)
> > -        FAIL("xm save did not succeed")
> > -
> > -    try:
> > -        status, ouptut = traceCommand("xm restore %s.save" %
> > -                                      (domName),
> > -                                      timeout=30)
> > -    except TimeoutError, e:
> > -        os.remove("%s.save" % domName)
> > -        saveLog(consoleHistory)
> > -        FAIL(str(e))
> > -
> > -    os.remove("%s.save" % domName)
> > -
> > -    if status != 0:
> > -        saveLog(consoleHistory)
> > -        FAIL("xm restore did not succeed")
> > -
> > -    try:
> > -        console = domain.getConsole()
> > -    except ConsoleError, e:
> > -        FAIL(str(e))
> > -
> > -    try:
> > -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -    except ConsoleError, e:
> > -        saveLog(console.getHistory())
> > -        FAIL(str(e))
> > -
> > -    if not re.search("PCR-00:",run["output"]):
> > -        saveLog(console.getHistory())
> > -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> > -
> > -    if not re.search("PCR-00: 1E A7 BD",run["output"]):
> > -        saveLog(console.getHistory())
> > -        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
> > -
> > -    loop += 1
> > -
> > -domain.closeConsole()
> > -
> > -domain.stop()
> > -
> > diff --git a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py b/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
> > deleted file mode 100644
> > index 4ff3360..0000000
> > --- a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
> > +++ /dev/null
> > @@ -1,119 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -# Positive Test: create domain with virtual TPM attached at build time,
> > -#                extend a pcr
> > -#                check list of pcrs; locally migrate the domain and
> > -#                check list of pcrs again and validate extended pcr
> > -#                This test does local live migration.
> > -
> > -from XmTestLib import *
> > -from vtpm_utils import *
> > -import commands
> > -import os
> > -import os.path
> > -import atexit
> > -
> > -config = {"vtpm":"instance=1,backend=0"}
> > -domain = XmTestDomain(extraConfig=config)
> > -domName = domain.getName()
> > -consoleHistory = ""
> > -
> > -try:
> > -    console = domain.start()
> > -except DomainError, e:
> > -    if verbose:
> > -        print e.extra
> > -    FAIL("Unable to create domain (%s)" % domName)
> > -
> > -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> > -
> > -try:
> > -    console.sendInput("input")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL(str(e))
> > -
> > -try:
> > -    run = console.runCmd("mknod /dev/tpm0 c 10 224")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("Error while creating /dev/tpm0")
> > -
> > -try:
> > -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("Error while extending PCR 0")
> > -
> > -try:
> > -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("No result from dumping the PCRs")
> > -
> > -
> > -if re.search("No such file",run["output"]):
> > -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> > -
> > -if not re.search("PCR-00:",run["output"]):
> > -    saveLog(console.getHistory())
> > -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> > -
> > -if not re.search("PCR-00: 1E A7 BD",run["output"]):
> > -    saveLog(console.getHistory())
> > -    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
> > -
> > -consoleHistory = console.getHistory()
> > -domain.closeConsole()
> > -
> > -old_domid = domid(domName)
> > -
> > -loop = 0
> > -while loop < 3:
> > -    try:
> > -        status, ouptut = traceCommand("xm migrate -l %s localhost" %
> > -                                      domName,
> > -                                      timeout=90)
> > -    except TimeoutError, e:
> > -        saveLog(consoleHistory)
> > -        FAIL(str(e))
> > -
> > -    if status != 0:
> > -        saveLog(consoleHistory)
> > -        FAIL("xm migrate did not succeed. External device migration activated?")
> > -
> > -
> > -    domName = domain.getName()
> > -    new_domid = domid(domName)
> > -
> > -    if (old_domid == new_domid):
> > -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> > -             (old_domid,loop))
> > -
> > -    try:
> > -        console = domain.getConsole()
> > -    except ConsoleError, e:
> > -        FAIL(str(e))
> > -
> > -    try:
> > -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -    except ConsoleError, e:
> > -        saveLog(console.getHistory())
> > -        FAIL("No result from dumping the PCRs")
> > -
> > -    if not re.search("PCR-00:",run["output"]):
> > -        saveLog(console.getHistory())
> > -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> > -
> > -    if not re.search("PCR-00: 1E A7 BD",run["output"]):
> > -        saveLog(console.getHistory())
> > -        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
> > -
> > -    loop += 1
> > -
> > -domain.closeConsole()
> > -
> > -domain.stop()
> > diff --git a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py b/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
> > deleted file mode 100644
> > index 27125fc..0000000
> > --- a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
> > +++ /dev/null
> > @@ -1,119 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -# Positive Test: create domain with virtual TPM attached at build time,
> > -#                extend a pcr
> > -#                check list of pcrs; locally migrate the domain and
> > -#                check list of pcrs again and validate extended pcr
> > -#                This test does local (non-live) migration.
> > -
> > -from XmTestLib import *
> > -from vtpm_utils import *
> > -import commands
> > -import os
> > -import os.path
> > -import atexit
> > -
> > -config = {"vtpm":"instance=1,backend=0"}
> > -domain = XmTestDomain(extraConfig=config)
> > -domName = domain.getName()
> > -consoleHistory = ""
> > -
> > -try:
> > -    console = domain.start()
> > -except DomainError, e:
> > -    if verbose:
> > -        print e.extra
> > -    FAIL("Unable to create domain (%s)" % domName)
> > -
> > -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> > -
> > -try:
> > -    console.sendInput("input")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL(str(e))
> > -
> > -try:
> > -    run = console.runCmd("mknod /dev/tpm0 c 10 224")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("Error while creating /dev/tpm0")
> > -
> > -try:
> > -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("Error while extending PCR 0")
> > -
> > -try:
> > -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("No result from dumping the PCRs")
> > -
> > -
> > -if re.search("No such file",run["output"]):
> > -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> > -
> > -if not re.search("PCR-00:",run["output"]):
> > -    saveLog(console.getHistory())
> > -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> > -
> > -if not re.search("PCR-00: 1E A7 BD",run["output"]):
> > -    saveLog(console.getHistory())
> > -    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
> > -
> > -consoleHistory = console.getHistory()
> > -domain.closeConsole()
> > -
> > -old_domid = domid(domName)
> > -
> > -loop = 0
> > -while loop < 3:
> > -    try:
> > -        status, ouptut = traceCommand("xm migrate %s localhost" %
> > -                                      domName,
> > -                                      timeout=90)
> > -    except TimeoutError, e:
> > -        saveLog(consoleHistory)
> > -        FAIL(str(e))
> > -
> > -    if status != 0:
> > -        saveLog(consoleHistory)
> > -        FAIL("xm migrate did not succeed. External device migration activated?")
> > -
> > -
> > -    domName = domain.getName()
> > -    new_domid = domid(domName)
> > -
> > -    if (old_domid == new_domid):
> > -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> > -             (old_domid,loop))
> > -
> > -    try:
> > -        console = domain.getConsole()
> > -    except ConsoleError, e:
> > -        FAIL(str(e))
> > -
> > -    try:
> > -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -    except ConsoleError, e:
> > -        saveLog(console.getHistory())
> > -        FAIL("No result from dumping the PCRs")
> > -
> > -    if not re.search("PCR-00:",run["output"]):
> > -        saveLog(console.getHistory())
> > -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> > -
> > -    if not re.search("PCR-00: 1E A7 BD",run["output"]):
> > -        saveLog(console.getHistory())
> > -        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
> > -
> > -    loop += 1
> > -
> > -domain.closeConsole()
> > -
> > -domain.stop()
> > diff --git a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py b/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
> > deleted file mode 100644
> > index a1aa8b3..0000000
> > --- a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
> > +++ /dev/null
> > @@ -1,158 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -# Test to test the vtpm class through the Xen-API
> > -#
> > -# Tested methods:
> > -#  VTPM: get_uuid, get_backend, get_by_uuid, get_record
> > -#        create, destroy, get_VM
> > -#  VM: get_VTPMS
> > -
> > -from XmTestLib import xapi
> > -from XmTestLib.XenAPIDomain import XmTestAPIDomain
> > -from XmTestLib import *
> > -from vtpm_utils import *
> > -import commands
> > -import os
> > -
> > -VTPM_RECORD_KEYS = [ 'backend', 'VM', 'uuid', 'other_config' ]
> > -
> > -try:
> > -    # XmTestAPIDomain tries to establish a connection to XenD
> > -    domain = XmTestAPIDomain()
> > -except Exception, e:
> > -    SKIP("Skipping test. Error: %s" % str(e))
> > -vm_uuid = domain.get_uuid()
> > -
> > -vtpmcfg = {}
> > -vtpmcfg['backend'] = DOM0_UUID
> > -vtpmcfg['VM'] = vm_uuid
> > -
> > -session = xapi.connect()
> > -
> > -vtpm_uuid = session.xenapi.VTPM.create(vtpmcfg)
> > -
> > -vtpm_be = session.xenapi.VTPM.get_backend(vtpm_uuid)
> > -if vtpm_be != vtpmcfg['backend']:
> > -    FAIL("vTPM's backend is in '%s', expected: '%s'" %
> > -         (vtpm_be, vtpmcfg['backend']))
> > -
> > -vtpm_rec = session.xenapi.VTPM.get_record(vtpm_uuid)
> > -
> > -miss_keys = []
> > -for k in VTPM_RECORD_KEYS:
> > -    if k not in vtpm_rec.keys():
> > -        miss_keys.append(k)
> > -if len(miss_keys) > 0:
> > -    FAIL("vTPM record is missing key(s): %s" % miss_keys)
> > -
> > -if vtpm_rec['uuid']  != vtpm_uuid:
> > -    FAIL("vTPM record shows vtpm uuid '%s', expected: '%s'" %
> > -         (vtpm_rec['uuid'], vtpm_uuid))
> > -if vtpm_rec['VM']  != vm_uuid:
> > -    FAIL("vTPM record shows VM uuid '%s', expected: '%s'" %
> > -         (vtpm_rec['VM'], vm_uuid))
> > -if vtpm_rec['backend'] != vtpmcfg['backend']:
> > -    FAIL("vTPM record shows VM bakcned '%s', expected: '%s'" %
> > -         (vtpm_rev['backend'], vtpmcfg['backend']))
> > -
> > -badkeys = []
> > -keys = vtpm_rec.keys()
> > -for k in keys:
> > -    if k not in VTPM_RECORD_KEYS:
> > -        badkeys.append(k)
> > -if len(badkeys) > 0:
> > -    FAIL("Unexpected attributes in result: %s" % badkeys)
> > -
> > -if vm_uuid != session.xenapi.VTPM.get_VM(vtpm_uuid):
> > -    FAIL("VM uuid from VTPM.get_VM different (%s) than expected (%s)." %
> > -         (vm_ref, vm_uuid))
> > -
> > -uuid = session.xenapi.VTPM.get_uuid(vtpm_uuid)
> > -if uuid != vtpm_uuid:
> > -    FAIL("vTPM from VTPM.get_uuid different (%s) than expected (%s)." %
> > -         (uuid, vtpm_uuid))
> > -
> > -vtpm_ref = session.xenapi.VTPM.get_by_uuid(vtpm_uuid)
> > -if vtpm_ref != vtpm_uuid:
> > -    FAIL("vTPM from VTPM.get_by_uuid different (%s) than expected (%s)." %
> > -         (vtpm_ref, vtpm_uuid))
> > -
> > -vm_vtpms = session.xenapi.VM.get_VTPMs(vm_uuid)
> > -if len(vm_vtpms) != 1:
> > -    FAIL("Number of vTPMs from get_VTPMs is (%d) not what was expected (%d)" %
> > -         (len(vm_vtpms), 1))
> > -if vtpm_uuid not in vm_vtpms:
> > -    FAIL("Other vTPM uuid (%s) returned from VM.get_VTPMs than expected (%s)" %
> > -         (vm_vtpms[0], vtpm_uuid))
> > -
> > -try:
> > -    console = domain.start()
> > -except DomainError, e:
> > -    FAIL("Unable to create domain.")
> > -
> > -try:
> > -    console.sendInput("input")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL(str(e))
> > -
> > -try:
> > -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("1. No result from dumping the PCRs")
> > -
> > -if re.search("No such file",run["output"]):
> > -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> > -
> > -if not re.search("PCR-00:",run["output"]):
> > -    saveLog(console.getHistory())
> > -    FAIL("1. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> > -
> > -try:
> > -    session.xenapi.VTPM.destroy(vtpm_uuid)
> > -    #Should never get here
> > -    FAIL("Could destroy vTPM while VM is running")
> > -except:
> > -    pass
> > -
> > -rc = session.xenapi.VM.suspend(vm_uuid)
> > -if rc:
> > -    FAIL("Could not suspend VM")
> > -
> > -try:
> > -    session.xenapi.VTPM.destroy(vtpm_uuid)
> > -    #May not throw an exception in 'suspend' state
> > -except:
> > -    pass
> > -
> > -rc = session.xenapi.VM.resume(vm_uuid, False)
> > -if rc:
> > -    FAIL("Could not resume VM")
> > -
> > -try:
> > -    console = domain.getConsole()
> > -except ConsoleError, e:
> > -    FAIL(str(e))
> > -
> > -try:
> > -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> > -except ConsoleError, e:
> > -    saveLog(console.getHistory())
> > -    FAIL("2. No result from dumping the PCRs. vTPM has been removed?")
> > -
> > -if not re.search("PCR-00:",run["output"]):
> > -    saveLog(console.getHistory())
> > -    FAIL("2. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> > -
> > -domain.stop()
> > -
> > -try:
> > -    session.xenapi.VTPM.destroy(vtpm_uuid)
> > -except:
> > -    FAIL("Could NOT destroy vTPM while domain is halted.")
> > -
> > -domain.destroy()
> > diff --git a/tools/xm-test/tests/vtpm/Makefile.am b/tools/xm-test/tests/vtpm/Makefile.am
> > deleted file mode 100644
> > index dd67e45..0000000
> > --- a/tools/xm-test/tests/vtpm/Makefile.am
> > +++ /dev/null
> > @@ -1,27 +0,0 @@
> > -SUBDIRS =
> > -
> > -TESTS = 01_vtpm-list_pos.test \
> > -        02_vtpm-cat_pcrs.test \
> > -        03_vtpm-susp_res.test \
> > -        04_vtpm-loc_migr.test \
> > -        05_vtpm-loc_migr.test \
> > -        06_vtpm-susp_res_pcrs.test \
> > -        07_vtpm-mig_pcrs.test \
> > -        08_vtpm-mig_pcrs.test \
> > -        09_vtpm-xapi.test
> > -
> > -XFAIL_TESTS =
> > -
> > -EXTRA_DIST = $(TESTS) $(XFAIL_TESTS) vtpm_utils.py
> > -TESTS_ENVIRONMENT=@TENV@
> > -
> > -%.test: %.py
> > -       cp $< $@
> > -       chmod +x $@
> > -
> > -clean-local: am_config_clean-local
> > -
> > -am_config_clean-local:
> > -       rm -f *test
> > -       rm -f *log
> > -       rm -f *~
> > diff --git a/tools/xm-test/tests/vtpm/vtpm_utils.py b/tools/xm-test/tests/vtpm/vtpm_utils.py
> > deleted file mode 100644
> > index 4e5b281..0000000
> > --- a/tools/xm-test/tests/vtpm/vtpm_utils.py
> > +++ /dev/null
> > @@ -1,30 +0,0 @@
> > -#!/usr/bin/python
> > -
> > -# Copyright (C) International Business Machines Corp., 2006
> > -# Author: Stefan Berger <stefanb@us.ibm.com>
> > -
> > -from XmTestLib import *
> > -
> > -if ENABLE_HVM_SUPPORT:
> > -    SKIP("vtpm tests not supported for HVM domains")
> > -
> > -status, output = traceCommand("COLUMNS=200 ; "
> > -                              "ps aux | grep vtpm_manager | grep -v grep")
> > -if output == "":
> > -    SKIP("virtual TPM manager must be started to run this test; might "
> > -         "need /dev/tpm0")
> > -
> > -def vtpm_cleanup(domName):
> > -    traceCommand("/etc/xen/scripts/vtpm-delete "
> > -                 "`xenstore-read /local/domain/0/backend/vtpm/%s/0/uuid`" %
> > -                 str(domid(domName)))
> > -
> > -def vtpm_cleanup(uuid):
> > -    from xen.xm import main
> > -    if main.serverType != main.SERVER_XEN_API:
> > -        traceCommand("/etc/xen/scripts/vtpm-delete %s" % uuid)
> > -
> > -def vtpm_get_uuid(domainid):
> > -    s, o = traceCommand("xenstore-read "
> > -                        "/local/domain/0/backend/vtpm/%s/0/uuid" % domainid)
> > -    return o
> > --
> > 1.7.10.4
> >
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:05:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:05:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYI3N-0006Nu-Od; Tue, 13 Nov 2012 15:05:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TYHxC-0005lh-Ty
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 14:59:08 +0000
Received: from [85.158.143.35:25878] by server-3.bemta-4.messagelabs.com id
	91/14-06841-A3062A05; Tue, 13 Nov 2012 14:59:06 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-10.tower-21.messagelabs.com!1352818741!10180088!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=Mail larger than max spam size
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18927 invoked from network); 13 Nov 2012 14:59:02 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-10.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 14:59:02 -0000
Received: from ([128.244.198.91])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157225253;
	Tue, 13 Nov 2012 09:58:46 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas2.dom1.jhuapl.edu ([128.244.198.91]) with mapi; Tue, 13 Nov 2012
	09:58:45 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Ian Campbell <Ian.Campbell@citrix.com>
Date: Tue, 13 Nov 2012 09:58:44 -0500
Thread-Topic: [PATCH VTPM 6/9] Remove the vtpm process model
Thread-Index: Ac3BjIxWUEqURI64SYK1F0IkeLy95AAIq4wg
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48A229F471@aplesstripe.dom1.jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352803755.7491.47.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
X-Mailman-Approved-At: Tue, 13 Nov 2012 15:05:28 +0000
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Should I have removed vtpm from xm also? I left it alone because xm is depcrecated.

-----Original Message-----
From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
Sent: Tuesday, November 13, 2012 5:49 AM
To: Fioravante, Matthew E.
Cc: xen-devel@lists.xen.org; Stefano Stabellini
Subject: Re: [PATCH VTPM 6/9] Remove the vtpm process model

On Thu, 2012-11-01 at 20:35 +0000, Matthew Fioravante wrote:
> Remove the old vtpm process model. It doesn't work very
> well and is no longer supported.
>
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

>
> diff --git a/tools/Makefile b/tools/Makefile
> index d8c8cc0..2ca43b9 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -18,8 +18,6 @@ SUBDIRS-$(CONFIG_XCUTILS) += xcutils
>  SUBDIRS-$(CONFIG_X86) += firmware
>  SUBDIRS-y += console
>  SUBDIRS-y += xenmon
> -SUBDIRS-$(VTPM_TOOLS) += vtpm_manager
> -SUBDIRS-$(VTPM_TOOLS) += vtpm
>  SUBDIRS-y += xenstat
>  SUBDIRS-$(CONFIG_Linux) += $(SUBDIRS-libaio)
>  SUBDIRS-$(CONFIG_Linux) += memshr
> diff --git a/tools/blktap2/drivers/hashtable.c b/tools/blktap2/drivers/hashtable.c
> index 631306b..90a6b85 100644
> --- a/tools/blktap2/drivers/hashtable.c
> +++ b/tools/blktap2/drivers/hashtable.c
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/xenstore/hashtable.c
> - *  - tools/vtpm_manager/util/hashtable.c
>   */
>
>  #include "hashtable.h"
> diff --git a/tools/blktap2/drivers/hashtable.h b/tools/blktap2/drivers/hashtable.h
> index 89aa3dc..56ca053 100644
> --- a/tools/blktap2/drivers/hashtable.h
> +++ b/tools/blktap2/drivers/hashtable.h
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/xenstore/hashtable.h
> - *  - tools/vtpm_manager/util/hashtable.h
>   */
>
>  #ifndef __HASHTABLE_CWC22_H__
> diff --git a/tools/blktap2/drivers/hashtable_itr.c b/tools/blktap2/drivers/hashtable_itr.c
> index 402e06b..731917c 100644
> --- a/tools/blktap2/drivers/hashtable_itr.c
> +++ b/tools/blktap2/drivers/hashtable_itr.c
> @@ -1,10 +1,5 @@
>  /* Copyright (C) 2002, 2004 Christopher Clark  <firstname.lastname@cl.cam.ac.uk> */
>
> -/*
> - * There are duplicates of this code in:
> - *  - tools/vtpm_manager/util/hashtable_itr.c
> - */
> -
>  #include "hashtable.h"
>  #include "hashtable_private.h"
>  #include "hashtable_itr.h"
> diff --git a/tools/blktap2/drivers/hashtable_itr.h b/tools/blktap2/drivers/hashtable_itr.h
> index 3d80638..81da838 100644
> --- a/tools/blktap2/drivers/hashtable_itr.h
> +++ b/tools/blktap2/drivers/hashtable_itr.h
> @@ -1,10 +1,5 @@
>  /* Copyright (C) 2002, 2004 Christopher Clark <firstname.lastname@cl.cam.ac.uk> */
>
> -/*
> - * There are duplicates of this code in:
> - *  - tools/vtpm_manager/util/hashtable_itr.h
> - */
> -
>  #ifndef __HASHTABLE_ITR_CWC22__
>  #define __HASHTABLE_ITR_CWC22__
>  #include "hashtable.h"
> diff --git a/tools/blktap2/drivers/hashtable_private.h b/tools/blktap2/drivers/hashtable_private.h
> index 5a13a65..954ecc3 100644
> --- a/tools/blktap2/drivers/hashtable_private.h
> +++ b/tools/blktap2/drivers/hashtable_private.h
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/xenstore/hashtable_private.h
> - *  - tools/vtpm_manager/util/hashtable_private.h
>   */
>
>  #ifndef __HASHTABLE_PRIVATE_CWC22_H__
> diff --git a/tools/configure.ac b/tools/configure.ac
> index e708f01..586313d 100644
> --- a/tools/configure.ac
> +++ b/tools/configure.ac
> @@ -40,7 +40,6 @@ m4_include([m4/fetcher.m4])
>  # Enable/disable options
>  AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
>  AX_ARG_DEFAULT_ENABLE([monitors], [Disable xenstat and xentop monitoring tools])
> -AX_ARG_DEFAULT_DISABLE([vtpm], [Enable Virtual Trusted Platform Module])
>  AX_ARG_DEFAULT_DISABLE([xenapi], [Enable Xen API Bindings])
>  AX_ARG_DEFAULT_ENABLE([ocamltools], [Disable Ocaml tools])
>  AX_ARG_DEFAULT_DISABLE([miniterm], [Enable miniterm])
> diff --git a/tools/examples/README b/tools/examples/README
> index 5b0314e..2225d5c 100644
> --- a/tools/examples/README
> +++ b/tools/examples/README
> @@ -25,13 +25,7 @@ vif-bridge          - virtual network start/stop script in bridged mode
>  vif-common.sh       - sourced by vif-bridge
>  vif-nat             - xen virtual network start/stop script in NAT mode
>  vif-route           - xen virtual network start/stop script in routed mode
> -vtpm                - called by xen-backend.agent to bind/unbind vTPM devices
> -vtpm-common.sh      - common code for vTPM handling
> -vtpm-delete         - remove an entry from the vTPM table given the
> -                      domain's name
> -vtpm-hotplug-common.sh - sourced by vtpm
> -vtpm-migration.sh   - sourced by external-device-migrate
> -xen-backend.agent   - calls block, vif-*, vtpm scripts to add, remove, hotplug
> +xen-backend.agent   - calls block, vif-* scripts to add, remove, hotplug
>                        devices
>  xen-backend.rules   - hotplug script rules
>  xend-config.sxp     - default xend configuration file
> diff --git a/tools/examples/xmexample.pv-grub b/tools/examples/xmexample.pv-grub
> index 85f847c..e04e6c1 100644
> --- a/tools/examples/xmexample.pv-grub
> +++ b/tools/examples/xmexample.pv-grub
> @@ -105,20 +105,6 @@ disk = [ 'phy:hda1,hda1,w' ]
>  # configured in xend-config.sxp.
>
>  #----------------------------------------------------------------------------
> -# Define to which TPM instance the user domain should communicate.
> -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> -# where INSTANCE indicates the instance number of the TPM the VM
> -# should be talking to and DOM provides the domain where the backend
> -# is located.
> -# Note that no two virtual machines should try to connect to the same
> -# TPM instance. The handling of all TPM instances does require
> -# some management effort in so far that VM configration files (and thus
> -# a VM) should be associated with a TPM instance throughout the lifetime
> -# of the VM / VM configuration file. The instance number must be
> -# greater or equal to 1.
> -#vtpm = [ 'instance=1,backend=0' ]
> -
> -#----------------------------------------------------------------------------
>  # Configure the behaviour when a domain exits.  There are three 'reasons'
>  # for a domain to stop: poweroff, reboot, and crash.  For each of these you
>  # may specify:
> diff --git a/tools/examples/xmexample1 b/tools/examples/xmexample1
> index 330aaf0..c951200 100644
> --- a/tools/examples/xmexample1
> +++ b/tools/examples/xmexample1
> @@ -101,20 +101,6 @@ disk = [ 'phy:hda1,hda1,w' ]
>  # configured in xend-config.sxp.
>
>  #----------------------------------------------------------------------------
> -# Define to which TPM instance the user domain should communicate.
> -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> -# where INSTANCE indicates the instance number of the TPM the VM
> -# should be talking to and DOM provides the domain where the backend
> -# is located.
> -# Note that no two virtual machines should try to connect to the same
> -# TPM instance. The handling of all TPM instances does require
> -# some management effort in so far that VM configration files (and thus
> -# a VM) should be associated with a TPM instance throughout the lifetime
> -# of the VM / VM configuration file. The instance number must be
> -# greater or equal to 1.
> -#vtpm = [ 'instance=1,backend=0' ]
> -
> -#----------------------------------------------------------------------------
>  # Set the kernel command line for the new domain.
>  # You only need to define the IP parameters and hostname if the domain's
>  # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
> diff --git a/tools/examples/xmexample2 b/tools/examples/xmexample2
> index 4e5eb3d..8c5137e 100644
> --- a/tools/examples/xmexample2
> +++ b/tools/examples/xmexample2
> @@ -137,20 +137,6 @@ disk = [ 'phy:sda%d,sda1,w' % (7+vmid),
>  # configured in xend-config.sxp.
>
>  #----------------------------------------------------------------------------
> -# Define to which TPM instance the user domain should communicate.
> -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> -# where INSTANCE indicates the instance number of the TPM the VM
> -# should be talking to and DOM provides the domain where the backend
> -# is located.
> -# Note that no two virtual machines should try to connect to the same
> -# TPM instance. The handling of all TPM instances does require
> -# some management effort in so far that VM configration files (and thus
> -# a VM) should be associated with a TPM instance throughout the lifetime
> -# of the VM / VM configuration file. The instance number must be
> -# greater or equal to 1.
> -#vtpm = ['instance=%d,backend=0' % (vmid) ]
> -
> -#----------------------------------------------------------------------------
>  # Set the kernel command line for the new domain.
>  # You only need to define the IP parameters and hostname if the domain's
>  # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
> diff --git a/tools/examples/xmexample3 b/tools/examples/xmexample3
> index dc22ce1..ae799f9 100644
> --- a/tools/examples/xmexample3
> +++ b/tools/examples/xmexample3
> @@ -122,20 +122,6 @@ disk = [ 'phy:hda%d,hda1,w' % (vmid)]
>  # configured in xend-config.sxp.
>
>  #----------------------------------------------------------------------------
> -# Define to which TPM instance the user domain should communicate.
> -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> -# where INSTANCE indicates the instance number of the TPM the VM
> -# should be talking to and DOM provides the domain where the backend
> -# is located.
> -# Note that no two virtual machines should try to connect to the same
> -# TPM instance. The handling of all TPM instances does require
> -# some management effort in so far that VM configration files (and thus
> -# a VM) should be associated with a TPM instance throughout the lifetime
> -# of the VM / VM configuration file. The instance number must be
> -# greater or equal to 1.
> -#vtpm = ['instance=%d,backend=0' % (vmid) ]
> -
> -#----------------------------------------------------------------------------
>  # Set the kernel command line for the new domain.
>  # You only need to define the IP parameters and hostname if the domain's
>  # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
> diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
> index 0166790..0605559 100644
> --- a/tools/hotplug/Linux/Makefile
> +++ b/tools/hotplug/Linux/Makefile
> @@ -18,14 +18,12 @@ XEN_SCRIPTS += vif-setup
>  XEN_SCRIPTS += block
>  XEN_SCRIPTS += block-enbd block-nbd
>  XEN_SCRIPTS += blktap
> -XEN_SCRIPTS += vtpm vtpm-delete
>  XEN_SCRIPTS += xen-hotplug-cleanup
>  XEN_SCRIPTS += external-device-migrate
>  XEN_SCRIPTS += vscsi
>  XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
>  XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
> -XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
> -XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
> +XEN_SCRIPT_DATA += block-common.sh
>
>  UDEV_RULES_DIR = $(CONFIG_DIR)/udev
>  UDEV_RULES = xen-backend.rules xend.rules
> diff --git a/tools/hotplug/Linux/vtpm b/tools/hotplug/Linux/vtpm
> deleted file mode 100644
> index 38a4532..0000000
> --- a/tools/hotplug/Linux/vtpm
> +++ /dev/null
> @@ -1,22 +0,0 @@
> -#!/bin/bash
> -
> -dir=$(dirname "$0")
> -. "$dir/vtpm-hotplug-common.sh"
> -
> -vtpm_fatal_error=0
> -
> -case "$command" in
> -  add)
> -    vtpm_create_instance
> -  ;;
> -  remove)
> -    vtpm_remove_instance
> -  ;;
> -esac
> -
> -if [ $vtpm_fatal_error -eq 0 ]; then
> -       log debug "Successful vTPM operation '$command'."
> -       success
> -else
> -       fatal "Error while executing vTPM operation '$command'."
> -fi
> diff --git a/tools/hotplug/Linux/vtpm-common.sh b/tools/hotplug/Linux/vtpm-common.sh
> deleted file mode 100644
> index d0d7935..0000000
> --- a/tools/hotplug/Linux/vtpm-common.sh
> +++ /dev/null
> @@ -1,448 +0,0 @@
> -#
> -# Copyright (c) 2005 IBM Corporation
> -# Copyright (c) 2005 XenSource Ltd.
> -#
> -# 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
> -#
> -
> -dir=$(dirname "$0")
> -. "$dir/logging.sh"
> -. "$dir/locking.sh"
> -
> -VTPMDB="/var/vtpm/vtpm.db"
> -
> -#In the vtpm-impl file some commands should be defined:
> -#      vtpm_create, vtpm_setup, vtpm_start, etc. (see below)
> -if [ -r "$dir/vtpm-impl.alt" ]; then
> -       . "$dir/vtpm-impl.alt"
> -elif [ -r "$dir/vtpm-impl" ]; then
> -       . "$dir/vtpm-impl"
> -else
> -       function vtpm_create () {
> -               true
> -       }
> -       function vtpm_setup() {
> -               true
> -       }
> -       function vtpm_start() {
> -               true
> -       }
> -       function vtpm_suspend() {
> -               true
> -       }
> -       function vtpm_resume() {
> -               true
> -       }
> -       function vtpm_delete() {
> -               true
> -       }
> -       function vtpm_migrate() {
> -               echo "Error: vTPM migration accross machines not implemented."
> -       }
> -       function vtpm_migrate_local() {
> -               echo "Error: local vTPM migration not supported"
> -       }
> -       function vtpm_migrate_recover() {
> -               true
> -       }
> -fi
> -
> -
> -#Find the instance number for the vtpm given the name of the domain
> -# Parameters
> -# - vmname : the name of the vm
> -# Return value
> -#  Returns '0' if instance number could not be found, otherwise
> -#  it returns the instance number in the variable 'instance'
> -function vtpmdb_find_instance () {
> -       local vmname ret instance
> -       vmname=$1
> -       ret=0
> -
> -       instance=$(cat $VTPMDB |                   \
> -                 awk -vvmname=$vmname             \
> -                 '{                               \
> -                    if ( 1 != index($1,"#")) {    \
> -                      if ( $1 == vmname ) {       \
> -                        print $2;                 \
> -                        exit;                     \
> -                      }                           \
> -                    }                             \
> -                  }')
> -       if [ "$instance" != "" ]; then
> -               ret=$instance
> -       fi
> -       echo "$ret"
> -}
> -
> -
> -# Check whether a particular instance number is still available
> -# returns "0" if it is not available, "1" otherwise.
> -function vtpmdb_is_free_instancenum () {
> -       local instance instances avail i
> -       instance=$1
> -       avail=1
> -       #Allowed instance number range: 1-255
> -       if [ $instance -eq 0 -o $instance -gt 255 ]; then
> -               avail=0
> -       else
> -               instances=$(cat $VTPMDB |                \
> -                          awk                          \
> -                          '{                            \
> -                              if (1 != index($1,"#")) { \
> -                                printf("%s ",$2);       \
> -                              }                         \
> -                           }')
> -               for i in $instances; do
> -                       if [ $i -eq $instance ]; then
> -                               avail=0
> -                               break
> -                       fi
> -               done
> -       fi
> -       echo "$avail"
> -}
> -
> -
> -# Get an available instance number given the database
> -# Returns an unused instance number
> -function vtpmdb_get_free_instancenum () {
> -       local ctr instances don found
> -       instances=$(cat $VTPMDB |                \
> -                  awk                          \
> -                  '{                            \
> -                      if (1 != index($1,"#")) { \
> -                        printf("%s ",$2);       \
> -                      }                         \
> -                   }')
> -       ctr=1
> -       don=0
> -       while [ $don -eq 0 ]; do
> -               found=0
> -               for i in $instances; do
> -                       if [ $i -eq $ctr ]; then
> -                               found=1;
> -                               break;
> -                       fi
> -               done
> -
> -               if [ $found -eq 0 ]; then
> -                       don=1
> -                       break
> -               fi
> -               let ctr=ctr+1
> -       done
> -       echo "$ctr"
> -}
> -
> -
> -# Add a domain name and instance number to the DB file
> -function vtpmdb_add_instance () {
> -       local res vmname inst
> -       vmname=$1
> -       inst=$2
> -
> -       if [ ! -f $VTPMDB ]; then
> -               echo "#Database for VM to vTPM association" > $VTPMDB
> -               echo "#1st column: domain name" >> $VTPMDB
> -               echo "#2nd column: TPM instance number" >> $VTPMDB
> -       fi
> -       res=$(vtpmdb_validate_entry $vmname $inst)
> -       if [ $res -eq 0 ]; then
> -               echo "$vmname $inst" >> $VTPMDB
> -       fi
> -}
> -
> -
> -#Validate whether an entry is the same as passed to this
> -#function
> -function vtpmdb_validate_entry () {
> -       local res rc vmname inst
> -       rc=0
> -       vmname=$1
> -       inst=$2
> -
> -       res=$(cat $VTPMDB |            \
> -            awk -vvmname=$vmname     \
> -                 -vinst=$inst         \
> -            '{                        \
> -                if ( 1 == index($1,"#")) {\
> -                } else                \
> -                if ( $1 == vmname &&  \
> -                     $2 == inst) {    \
> -                   printf("1");       \
> -                   exit;              \
> -                } else                \
> -                if ( $1 == vmname ||  \
> -                     $2 == inst) {    \
> -                   printf("2");       \
> -                   exit;              \
> -                }                     \
> -            }')
> -
> -       if [ "$res" == "1" ]; then
> -               rc=1
> -       elif [ "$res" == "2" ]; then
> -               rc=2
> -       fi
> -       echo "$rc"
> -}
> -
> -
> -#Remove an entry from the vTPM database given its domain name
> -#and instance number
> -function vtpmdb_remove_entry () {
> -       local vmname instance VTPMDB_TMP
> -       vmname=$1
> -       instance=$2
> -       VTPMDB_TMP="$VTPMDB".tmp
> -
> -       $(cat $VTPMDB |            \
> -        awk -vvmname=$vmname     \
> -        '{                        \
> -           if ( $1 != vmname ) {  \
> -             print $0;            \
> -           }                      \
> -        '} > $VTPMDB_TMP)
> -       if [ -e $VTPMDB_TMP ]; then
> -               mv -f $VTPMDB_TMP $VTPMDB
> -               vtpm_delete $instance
> -       else
> -               log err "Error creating temporary file '$VTPMDB_TMP'."
> -       fi
> -}
> -
> -
> -# Find the reason for the creation of this device:
> -# Returns 'resume' or 'create'
> -function vtpm_get_create_reason () {
> -       local resume
> -       resume=$(xenstore_read $XENBUS_PATH/resume)
> -       if [ "$resume" == "True" ]; then
> -               echo "resume"
> -       else
> -               echo "create"
> -       fi
> -}
> -
> -
> -#Create a vTPM instance
> -# If no entry in the TPM database is found, the instance is
> -# created and an entry added to the database.
> -function vtpm_create_instance () {
> -       local res instance domname reason uuid
> -       uuid=$(xenstore_read "$XENBUS_PATH"/uuid)
> -       reason=$(vtpm_get_create_reason)
> -
> -       claim_lock vtpmdb
> -
> -       instance="0"
> -
> -       if [ "$uuid" != "" ]; then
> -               instance=$(vtpmdb_find_instance $uuid)
> -       fi
> -       if [ "$instance" == "0" ]; then
> -               domname=$(xenstore_read "$XENBUS_PATH"/domain)
> -               instance=$(vtpmdb_find_instance $domname)
> -       fi
> -
> -       if [ "$instance" == "0" -a "$reason" != "create" ]; then
> -               release_lock vtpmdb
> -               return
> -       fi
> -
> -       if [ "$instance" == "0" ]; then
> -               #Try to give the preferred instance to the domain
> -               instance=$(xenstore_read "$XENBUS_PATH"/pref_instance)
> -               if [ "$instance" != "" ]; then
> -                       res=$(vtpmdb_is_free_instancenum $instance)
> -                       if [ $res -eq 0 ]; then
> -                               instance=$(vtpmdb_get_free_instancenum)
> -                       fi
> -               else
> -                       instance=$(vtpmdb_get_free_instancenum)
> -               fi
> -
> -               vtpm_create $instance
> -
> -               if [ $vtpm_fatal_error -eq 0 ]; then
> -                       if [ "$uuid" != "" ]; then
> -                               vtpmdb_add_instance $uuid $instance
> -                       else
> -                               vtpmdb_add_instance $domname $instance
> -                       fi
> -               fi
> -       else
> -               if [ "$reason" == "resume" ]; then
> -                       vtpm_resume $instance
> -               else
> -                       vtpm_start $instance
> -               fi
> -       fi
> -
> -       release_lock vtpmdb
> -
> -       xenstore_write $XENBUS_PATH/instance $instance
> -}
> -
> -
> -#Remove an instance when a VM is terminating or suspending.
> -#Since it is assumed that the VM will appear again, the
> -#entry is kept in the VTPMDB file.
> -function vtpm_remove_instance () {
> -       local instance reason domname uuid
> -       #Stop script execution quietly if path does not exist (anymore)
> -       xenstore-exists "$XENBUS_PATH"/domain
> -       uuid=$(xenstore_read "$XENBUS_PATH"/uuid)
> -
> -       claim_lock vtpmdb
> -
> -       instance="0"
> -
> -       if [ "$uuid" != "" ]; then
> -               instance=$(vtpmdb_find_instance $uuid)
> -       fi
> -
> -       if [ "$instance" == "0" ]; then
> -               domname=$(xenstore_read "$XENBUS_PATH"/domain)
> -               instance=$(vtpmdb_find_instance $domname)
> -       fi
> -
> -       if [ "$instance" != "0" ]; then
> -               vtpm_suspend $instance
> -       fi
> -
> -       release_lock vtpmdb
> -}
> -
> -
> -#Remove an entry in the VTPMDB file given the domain's name
> -#1st parameter: The name of the domain
> -function vtpm_delete_instance () {
> -       local instance
> -
> -       claim_lock vtpmdb
> -
> -       instance=$(vtpmdb_find_instance $1)
> -       if [ "$instance" != "0" ]; then
> -               vtpmdb_remove_entry $1 $instance
> -       fi
> -
> -       release_lock vtpmdb
> -}
> -
> -# Determine whether the given address is local to this machine
> -# Return values:
> -#  "-1" : the given machine name is invalid
> -#  "0"  : this is not an address of this machine
> -#  "1"  : this is an address local to this machine
> -function vtpm_isLocalAddress() {
> -       local addr res
> -       addr=$(ping $1 -c 1 |  \
> -              awk '{ print substr($3,2,length($3)-2); exit }')
> -       if [ "$addr" == "" ]; then
> -               echo "-1"
> -               return
> -       fi
> -       res=$(ifconfig | grep "inet addr" |  \
> -            awk -vaddr=$addr               \
> -            '{                              \
> -               if ( addr == substr($2, 6)) {\
> -                 print "1";                 \
> -               }                            \
> -            }'                              \
> -           )
> -       if [ "$res" == "" ]; then
> -               echo "0"
> -               return
> -       fi
> -       echo "1"
> -}
> -
> -# Perform a migration step. This function differentiates between migration
> -# to the local host or to a remote machine.
> -# Parameters:
> -# 1st: destination host to migrate to
> -# 2nd: name of the domain to migrate
> -# 3rd: the migration step to perform
> -function vtpm_migration_step() {
> -       local res=$(vtpm_isLocalAddress $1)
> -       if [ "$res" == "0" ]; then
> -               vtpm_migrate $1 $2 $3
> -       else
> -               vtpm_migrate_local
> -       fi
> -}
> -
> -# Recover from migration due to an error. This function differentiates
> -# between migration to the local host or to a remote machine.
> -# Parameters:
> -# 1st: destination host the migration was going to
> -# 2nd: name of the domain that was to be migrated
> -# 3rd: the last successful migration step that was done
> -function vtpm_recover() {
> -       local res
> -       res=$(vtpm_isLocalAddress $1)
> -       if [ "$res" == "0" ]; then
> -               vtpm_migrate_recover $1 $2 $3
> -       fi
> -}
> -
> -
> -#Determine the domain id given a domain's name.
> -#1st parameter: name of the domain
> -#return value: domain id  or -1 if domain id could not be determined
> -function vtpm_domid_from_name () {
> -       local id name ids
> -       ids=$(xenstore-list /local/domain)
> -       for id in $ids; do
> -               name=$(xenstore-read /local/domain/$id/name)
> -               if [ "$name" == "$1" ]; then
> -                       echo "$id"
> -                       return
> -               fi
> -       done
> -       echo "-1"
> -}
> -
> -#Determine the virtual TPM's instance number using the domain ID.
> -#1st parm: domain ID
> -function vtpm_uuid_by_domid() {
> -       echo $(xenstore-read /local/domain/0/backend/vtpm/$1/0/uuid)
> -}
> -
> -
> -# Determine the vTPM's UUID by the name of the VM
> -function vtpm_uuid_from_vmname() {
> -       local domid=$(vtpm_domid_from_name $1)
> -       if [ "$domid" != "-1" ]; then
> -               echo $(vtpm_uuid_by_domid $domid)
> -               return
> -       fi
> -       echo ""
> -}
> -
> -#Add a virtual TPM instance number and its associated domain name
> -#to the VTPMDB file and activate usage of this virtual TPM instance
> -#by writing the instance number into the xenstore
> -#1st parm: name of virtual machine
> -#2nd parm: instance of associated virtual TPM
> -function vtpm_add_and_activate() {
> -       local domid=$(vtpm_domid_from_name $1)
> -       local vtpm_uuid=$(vtpm_uuid_from_vmname $1)
> -       if [ "$vtpm_uuid" != "" -a "$domid" != "-1" ]; then
> -               vtpmdb_add_instance $vtpm_uuid $2
> -               xenstore-write backend/vtpm/$domid/0/instance $2
> -       fi
> -}
> diff --git a/tools/hotplug/Linux/vtpm-delete b/tools/hotplug/Linux/vtpm-delete
> deleted file mode 100644
> index b75b95b..0000000
> --- a/tools/hotplug/Linux/vtpm-delete
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -#!/bin/bash
> -
> -# This scripts must be called the following way:
> -# vtpm-delete <vtpm uuid>
> -# or
> -# vtpm-delete --vmname <vm name>
> -
> -dir=$(dirname "$0")
> -. "$dir/vtpm-common.sh"
> -
> -if [ "$1" == "--vmname" ]; then
> -       vtpm_uuid=$(vtpm_uuid_from_vmname $2)
> -       if [ "$vtpm_uuid" != "" ];then
> -               vtpm_delete_instance $vtpm_uuid
> -       fi
> -else
> -       vtpm_delete_instance $1
> -fi
> diff --git a/tools/hotplug/Linux/vtpm-hotplug-common.sh b/tools/hotplug/Linux/vtpm-hotplug-common.sh
> deleted file mode 100644
> index 9fd35e7..0000000
> --- a/tools/hotplug/Linux/vtpm-hotplug-common.sh
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -#
> -# Copyright (c) 2005 IBM Corporation
> -# Copyright (c) 2005 XenSource Ltd.
> -#
> -# 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
> -#
> -
> -dir=$(dirname "$0")
> -. "$dir/xen-hotplug-common.sh"
> -
> -findCommand "$@"
> -if [ "$command" != "online" ]  &&
> -   [ "$command" != "offline" ] &&
> -   [ "$command" != "add" ]     &&
> -   [ "$command" != "remove" ]
> -then
> -       log err "Invalid command: $command"
> -       exit 1
> -fi
> -
> -
> -XENBUS_PATH="${XENBUS_PATH:?}"
> -
> -. "$dir/vtpm-common.sh"
> diff --git a/tools/hotplug/Linux/vtpm-impl b/tools/hotplug/Linux/vtpm-impl
> deleted file mode 100644
> index 4f9a1fd..0000000
> --- a/tools/hotplug/Linux/vtpm-impl
> +++ /dev/null
> @@ -1,208 +0,0 @@
> -#!/bin/bash
> -# ===================================================================
> -#
> -# Copyright (c) 2005, Intel Corp.
> -# All rights reserved.
> -#
> -# Redistribution and use in source and binary forms, with or without
> -# modification, are permitted provided that the following conditions
> -# are met:
> -#
> -#   * Redistributions of source code must retain the above copyright
> -#     notice, this list of conditions and the following disclaimer.
> -#   * Redistributions in binary form must reproduce the above
> -#     copyright notice, this list of conditions and the following
> -#     disclaimer in the documentation and/or other materials provided
> -#     with the distribution.
> -#   * Neither the name of Intel Corporation nor the names of its
> -#     contributors may be used to endorse or promote products derived
> -#     from this software without specific prior written permission.
> -#
> -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -# OF THE POSSIBILITY OF SUCH DAMAGE.
> -# ===================================================================
> -
> -#            |        SRC        |    TAG  |      CMD SIZE     |        ORD       |mtype|strt
> -TPM_CMD_OPEN=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x11\\x01\\x00\\x00\\x01\\x01\\x01
> -TPM_CMD_RESM=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x11\\x01\\x00\\x00\\x01\\x01\\x02
> -TPM_CMD_CLOS=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x0e\\x01\\x00\\x00\\x02
> -TPM_CMD_DELE=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x0e\\x01\\x00\\x00\\x03
> -
> -TPM_TYPE_PVM=\\x01
> -TPM_TYPE_HVM=\\x02
> -
> -TPM_SUCCESS=00000000
> -
> -TX_VTPM_MANAGER=/var/vtpm/fifos/from_console.fifo
> -RX_VTPM_MANAGER=/var/vtpm/fifos/to_console.fifo
> -
> -VTPM_MIG=/usr/bin/vtpm_migrator
> -
> -# -------------------- Helpers for binary streams -----------
> -
> -function str_to_hex32() {
> - printf "%0.8x" $1
> -}
> -
> -function hex32_to_bin() {
> - local inst=$(str_to_hex32 $1);
> -
> - local n1=`echo $inst | sed 's/\(..\)....../\\\\x\1/'`
> - local n2=`echo $inst | sed 's/..\(..\)..../\\\\x\1/'`
> - local n3=`echo $inst | sed 's/....\(..\)../\\\\x\1/'`
> - local n4=`echo $inst | sed 's/......\(..\)/\\\\x\1/'`
> -
> - echo "$n1$n2$n3$n4"
> -}
> -
> -function vtpm_manager_cmd() {
> - local cmd=$1;
> - local inst=$2;
> - local inst_bin=$(hex32_to_bin $inst);
> -
> - claim_lock vtpm_mgr
> -
> - #send cmd to vtpm_manager
> - printf "$cmd$inst_bin" > $TX_VTPM_MANAGER
> -
> - #recv response
> - set +e
> - local resp_hex=`dd skip=10 bs=1 count=4 if=$RX_VTPM_MANAGER 2> /dev/null | xxd -ps`
> - set -e
> -
> - release_lock vtpm_mgr
> -
> - #return whether the command was successful
> - if [ $resp_hex -ne $TPM_SUCCESS ]; then
> -   vtpm_fatal_error=1
> -   false
> -  else
> -   true
> - fi
> -}
> -
> -# Helper to get vm type to pass to vtpm_manager open/resume
> -function vtpm_get_type() {
> - local inst=$(xenstore_read $XENBUS_PATH/frontend-id)
> - local vm=$(xenstore_read /local/domain/$inst/vm)
> - if [ "$vm" != "" ]; then
> -  local ostype=$(xenstore-read $vm/image/ostype)
> -  if [ "$ostype" == "hvm" ]; then
> -   echo $TPM_TYPE_HVM;
> -  else
> -   echo $TPM_TYPE_PVM;
> -  fi
> - fi
> -}
> -
> -# ------------------ Command handlers -----------------
> -
> -# Create new vtpm instance & set it up for use
> -function vtpm_create () {
> - # Creation is handled implicitly by the manager on first setup
> - # so just set it up for use
> - $(vtpm_start $1)
> -}
> -
> -# Setup vtpm instance for use.
> -function vtpm_start() {
> - local vmtype=$(vtpm_get_type);
> - $(vtpm_manager_cmd $TPM_CMD_OPEN$vmtype $1)
> -}
> -
> -function vtpm_resume() {
> - local vmtype=$(vtpm_get_type);
> - $(vtpm_manager_cmd $TPM_CMD_RESM$vmtype $1)
> -}
> -
> -# Reset the vtpm AKA clear PCRs
> -function vtpm_reset() {
> - #not used by current implemenation
> - true
> -}
> -
> -# Shutdown the vtpm while the vm is down
> -# This could be a suspend of shutdown
> -# we cannot distinquish, so save the state
> -# and decide on startup if we should keep is
> -function vtpm_suspend() {
> - $(vtpm_manager_cmd $TPM_CMD_CLOS $1)
> -}
> -
> -
> -function vtpm_delete() {
> - local inst=$1
> - if $(vtpm_manager_cmd $TPM_CMD_DELE $inst); then
> -   rm -f /var/vtpm/vtpm_dm_$1.data
> -   true
> - else
> -   vtpm_fatal_error=1
> -   false
> - fi
> -}
> -
> -# Perform a migration step. This function differentiates between migration
> -# to the local host or to a remote machine.
> -# Parameters:
> -# 1st: destination host to migrate to
> -# 2nd: name of the domain to migrate
> -# 3rd: the migration step to perform
> -function vtpm_migrate() {
> - local instance res
> -
> - instance=$(vtpmdb_find_instance $2)
> - if [ "$instance" == "" ]; then
> -  log err "VTPM Migratoin failed. Unable to translation of domain name"
> -  echo "Error: VTPM Migration failed while looking up instance number"
> - fi
> -
> - case "$3" in
> -  0)
> -   #Incicate migration supported
> -   echo "0"
> -  ;;
> -
> -  1)
> -   # Get Public Key from Destination
> -   # Call vtpm_manager's migration part 1
> -   claim_lock vtpm_mgr
> -   $VTPM_MIG $1 $2 $instance $3
> -   release_lock vtpm_mgr
> -  ;;
> -
> -  2)
> -   # Call manager's migration step 2 and send result to destination
> -   # If successful remove from db
> -   claim_lock vtpm_mgr
> -   $VTPM_MIG $1 $2 $instance $3
> -   release_lock vtpm_mgr
> -  ;;
> -
> -  3)
> -   if `ps x | grep "$VTPM_MIG $1"`; then
> -    log err "VTPM Migration failed to complete."
> -    echo "Error: VTPM Migration failed to complete."
> -   fi
> -  ;;
> - esac
> -
> -}
> -
> -
> -function vtpm_migrate_recover() {
> - echo "Error: Recovery not supported yet"
> -}
> -
> -function vtpm_migrate_local() {
> - echo "Error: local vTPM migration not supported"
> -}
> diff --git a/tools/hotplug/Linux/vtpm-migration.sh b/tools/hotplug/Linux/vtpm-migration.sh
> deleted file mode 100644
> index 7e38ae2..0000000
> --- a/tools/hotplug/Linux/vtpm-migration.sh
> +++ /dev/null
> @@ -1,19 +0,0 @@
> -#
> -# Copyright (c) 2005 IBM Corporation
> -#
> -# 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
> -#
> -
> -dir=$(dirname "$0")
> -. "$dir/vtpm-common.sh"
> diff --git a/tools/hotplug/Linux/xen-backend.rules b/tools/hotplug/Linux/xen-backend.rules
> index c591a3f..a0d409e 100644
> --- a/tools/hotplug/Linux/xen-backend.rules
> +++ b/tools/hotplug/Linux/xen-backend.rules
> @@ -1,6 +1,5 @@
>  SUBSYSTEM=="xen-backend", KERNEL=="tap*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/blktap $env{ACTION}"
>  SUBSYSTEM=="xen-backend", KERNEL=="vbd*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/block $env{ACTION}"
> -SUBSYSTEM=="xen-backend", KERNEL=="vtpm*", RUN+="/etc/xen/scripts/vtpm $env{ACTION}"
>  SUBSYSTEM=="xen-backend", KERNEL=="vif2-*", RUN+="/etc/xen/scripts/vif2 $env{ACTION}"
>  SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="online", RUN+="/etc/xen/scripts/vif-setup online type_if=vif"
>  SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="offline", RUN+="/etc/xen/scripts/vif-setup offline type_if=vif"
> diff --git a/tools/vtpm/Makefile b/tools/vtpm/Makefile
> deleted file mode 100644
> index 7b3efa5..0000000
> --- a/tools/vtpm/Makefile
> +++ /dev/null
> @@ -1,74 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../..
> -
> -# Base definitions and rules
> -include $(XEN_ROOT)/tools/vtpm/Rules.mk
> -
> -# Dir name for emulator (as dom0 tpm driver)
> -TPM_EMULATOR_DIR = tpm_emulator
> -# Dir name for vtpm instance
> -VTPM_DIR = vtpm
> -ORIG_DIR = orig
> -
> -# Emulator tarball name
> -TPM_EMULATOR_NAME = tpm_emulator-0.5.1
> -TPM_EMULATOR_TARFILE = $(TPM_EMULATOR_NAME).tar.gz
> -
> -GMP_HEADER = /usr/include/gmp.h
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: build_sub
> -
> -.PHONY: install
> -install: build
> -       $(MAKE) -C $(VTPM_DIR) install-recursive
> -
> -.PHONY: clean
> -clean:
> -       @if [ -d $(TPM_EMULATOR_DIR) ]; \
> -               then $(MAKE) -C $(TPM_EMULATOR_DIR) clean; \
> -       fi
> -       @if [ -d $(VTPM_DIR) ]; \
> -               then $(MAKE) -C $(VTPM_DIR) clean; \
> -       fi
> -
> -.PHONY: mrproper
> -mrproper:
> -       rm -f $(TPM_EMULATOR_TARFILE) tpm_emulator.patch.old vtpm.patch.old
> -       rm -rf $(TPM_EMULATOR_DIR) $(VTPM_DIR) $(ORIG_DIR)
> -
> -# Download Swiss emulator
> -$(TPM_EMULATOR_TARFILE):
> -       wget http://download.berlios.de/tpm-emulator/$(TPM_EMULATOR_TARFILE)
> -
> -# Create vtpm dirs
> -$(VTPM_DIR)/tpmd/tpmd: $(TPM_EMULATOR_TARFILE) vtpm-0.5.1.patch
> -       rm -rf $(VTPM_DIR)
> -       tar -xzf $(TPM_EMULATOR_TARFILE)
> -       mv $(TPM_EMULATOR_NAME) $(VTPM_DIR)
> -
> -       set -e; cd $(VTPM_DIR); \
> -       patch -p1 < ../vtpm-0.5.1.patch; \
> -       patch -p1 < ../vtpm-0.5.1-LDLIBS.patch
> -
> -orig: $(TPM_EMULATOR_TARFILE)
> -       mkdir $(ORIG_DIR);
> -       set -e; cd $(ORIG_DIR); \
> -       tar -xzf ../$(TPM_EMULATOR_TARFILE);
> -
> -updatepatches: clean orig
> -       find $(VTPM_DIR) -name "*.orig" -print | xargs rm -f;
> -       mv vtpm.patch vtpm.patch.old;
> -       diff -uprN $(TPM_EMULATOR_DIR) $(VTPM_DIR) > vtpm.patch || true;
> -
> -.PHONY: build_sub
> -build_sub: $(VTPM_DIR)/tpmd/tpmd
> -       set -e; if [ -e $(GMP_HEADER) ]; then \
> -               $(MAKE) -C $(VTPM_DIR) version; \
> -               $(MAKE) -C $(VTPM_DIR) all-recursive; \
> -       else \
> -               echo "=== Unable to build VTPMs. libgmp could not be found."; \
> -       fi
> -
> diff --git a/tools/vtpm/README b/tools/vtpm/README
> deleted file mode 100644
> index 2008cbd..0000000
> --- a/tools/vtpm/README
> +++ /dev/null
> @@ -1,45 +0,0 @@
> -
> -Directory Structure
> -===================
> -tools/vtpm/tpm_emulator-0.2b.tar.gz    -> TPM Emulator downloaded at build time that will
> -                                          be patched and used for our vtpms
> -tools/vtpm/vtpm.patch                  -> patch applied to tpm_emulator to make vtpm
> -tools/vtpm/vtpm/                       -> (created on build) tpm_emulator moved to ring 3,
> -                                          listens on a pair of fifos for TPM commands,
> -                                          persistent state is sent via named fifo to vtpm
> -                                            manager, which encrypts it and protects it.
> -tools/vtpm/tpm_emulator.patch          -> To allow for debugging and testing on non-TPM
> -                                          platforms, this patches the emulator to allow
> -                                          it to be inserted into the dom0 kernel
> -tools/vtpm/tpm_emulator-0.2            -> (created on build) directory containing patched emulator
> -
> -Compile Flags
> -===================
> -VTPM_MULTI_VM                -> Defined (not finished): VTPMs run in their own VMs
> -                                Not Defined (default): VTPMs are processes
> -
> -Requirements
> -============
> -- xen-unstable
> -- IBM frontend/backend vtpm driver patch
> -- vtpm_managerd
> -- GNU MP Big number library (GMP)
> -
> -vtpmd Flow (for vtpm_manager. vtpmd never run by default)
> -============================
> -- Launch the VTPM manager (vtpm_managerd) which which begins listening to the BE with one thread
> -  and listens to a named fifo that is shared by the vtpms to commuincate with the manager.
> -- VTPM Manager listens to TPM BE.
> -- When xend launches a tpm frontend equipped VM it contacts the manager over the vtpm backend.
> -- When the manager receives the open message from the BE, it launches a vtpm
> -- Xend allows the VM to continue booting.
> -- When a TPM request is issued to the front end, the front end transmits the TPM request to the backend.
> -- The manager receives the TPM requests and uses a named fifo to forward the request to the vtpm.
> -- The fifo listener begins listening for the reply from vtpm for the request.
> -- Vtpm processes request and replies to manager over shared named fifo.
> -- If needed, the vtpm may send a request to the vtpm_manager at any time to save it's secrets to disk.
> -- Manager receives response from vtpm and passes it back to backend for forwarding to guest.
> -
> -tpm_emulator flow
> -==================
> -Read documentation in tpm_emulator-0.2 directory
> diff --git a/tools/vtpm/Rules.mk b/tools/vtpm/Rules.mk
> deleted file mode 100644
> index 548cff0..0000000
> --- a/tools/vtpm/Rules.mk
> +++ /dev/null
> @@ -1,26 +0,0 @@
> -# Base definitions and rules (XEN_ROOT must be defined in including Makefile)
> -include $(XEN_ROOT)/tools/Rules.mk
> -
> -#
> -# Tool definitions
> -#
> -
> -# General compiler flags
> -CFLAGS   = -Werror -g3
> -
> -# Generic project files
> -HDRS   = $(wildcard *.h)
> -SRCS   = $(wildcard *.c)
> -OBJS   = $(patsubst %.c,%.o,$(SRCS))
> -
> -# Generic (non-header) dependencies
> -$(SRCS): Makefile $(XEN_ROOT)/tools/Rules.mk $(XEN_ROOT)/tools/vtpm/Rules.mk
> -
> -$(OBJS): $(SRCS)
> -
> --include $(DEPS)
> -
> -BUILD_EMULATOR = y
> -
> -# Make sure these are just rules
> -.PHONY : all build install clean
> diff --git a/tools/vtpm/tpm_emulator.patch b/tools/vtpm/tpm_emulator.patch
> deleted file mode 100644
> index c34c665..0000000
> --- a/tools/vtpm/tpm_emulator.patch
> +++ /dev/null
> @@ -1,1919 +0,0 @@
> -diff -uprN orig/tpm_emulator-0.4/AUTHORS tpm_emulator/AUTHORS
> ---- orig/tpm_emulator-0.4/AUTHORS      2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/AUTHORS       2006-07-24 14:35:35.000000000 -0700
> -@@ -1,2 +1,3 @@
> - Mario Strasser <mast@gmx.net>
> - Heiko Stamer <stamer@gaos.org> [DAA]
> -+INTEL Corp <> [Dropped to Ring3]
> -diff -uprN orig/tpm_emulator-0.4/ChangeLog tpm_emulator/ChangeLog
> ---- orig/tpm_emulator-0.4/ChangeLog    2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/ChangeLog     2006-07-24 14:35:35.000000000 -0700
> -@@ -1,3 +1,6 @@
> -+????-??-?? Intel Corp
> -+      * Moved module out of kernel to run as a ring 3 app
> -+
> - 2006-06-23  Mario Strasser <mast@gmx.net>
> -       * tpm_startup.c: behaviour of ST_CLEAR and storage of
> -               persistent data adapted
> -diff -uprN orig/tpm_emulator-0.4/crypto/gmp_kernel_wrapper.c tpm_emulator/crypto/gmp_kernel_wrapper.c
> ---- orig/tpm_emulator-0.4/crypto/gmp_kernel_wrapper.c  2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/crypto/gmp_kernel_wrapper.c   2006-07-24 14:35:35.000000000 -0700
> -@@ -1,5 +1,6 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -24,15 +25,10 @@ int __gmp_junk;
> - void __attribute__ ((regparm(0))) __gmp_assert_fail(const char *filename,
> -   int linenum, const char *expr)
> - {
> --  panic(KERN_CRIT TPM_MODULE_NAME "%s:%d: GNU MP assertion failed: %s\n",
> -+  error("%s:%d: GNU MP assertion failed: %s\n",
> -     filename, linenum, expr);
> - }
> -
> --void __attribute__ ((regparm(0))) abort(void)
> --{
> --  panic(KERN_CRIT TPM_MODULE_NAME "GNU MP abort() was called\n");
> --}
> --
> - /* overwrite GNU MP random functions (used by mpz/millerrabin.c) */
> -
> - void __attribute__ ((regparm(0))) gmp_randinit(gmp_randstate_t rstate,
> -@@ -77,20 +73,19 @@ void __attribute__ ((regparm(0))) mpz_ur
> -
> - void __attribute__ ((regparm(0))) *kernel_allocate(size_t size)
> - {
> --  void *ret  = (void*)kmalloc(size, GFP_KERNEL);
> --  if (!ret) panic(KERN_CRIT TPM_MODULE_NAME
> --    "GMP: cannot allocate memory (size=%u)\n", size);
> -+  void *ret  = (void*)malloc(size);
> -+  if (!ret) error("GMP: cannot allocate memory (size=%Zu)\n", size);
> -   return ret;
> - }
> -
> - void __attribute__ ((regparm(0))) *kernel_reallocate(void *oldptr,
> -   size_t old_size, size_t new_size)
> - {
> --  void *ret = (void*)kmalloc(new_size, GFP_KERNEL);
> --  if (!ret) panic(KERN_CRIT TPM_MODULE_NAME "GMP: Cannot reallocate memory "
> --    "(old_size=%u new_size=%u)\n", old_size, new_size);
> -+  void *ret = (void*)malloc(new_size);
> -+  if (!ret) error("GMP: Cannot reallocate memory "
> -+    "(old_size=%Zu new_size=%Zu)\n", old_size, new_size);
> -   memcpy(ret, oldptr, old_size);
> --  kfree(oldptr);
> -+  free(oldptr);
> -   return ret;
> - }
> -
> -@@ -99,7 +94,7 @@ void __attribute__ ((regparm(0))) kernel
> -   /* overwrite used memory */
> -   if (blk_ptr != NULL) {
> -     memset(blk_ptr, 0, blk_size);
> --    kfree(blk_ptr);
> -+    free(blk_ptr);
> -   }
> - }
> -
> -diff -uprN orig/tpm_emulator-0.4/crypto/rsa.c tpm_emulator/crypto/rsa.c
> ---- orig/tpm_emulator-0.4/crypto/rsa.c 2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/crypto/rsa.c  2006-07-24 14:35:35.000000000 -0700
> -@@ -1,5 +1,6 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -381,7 +382,7 @@ static int encode_message(int type, uint
> -       msg[0] = 0x00;
> -       get_random_bytes(&msg[1], SHA1_DIGEST_LENGTH);
> -       sha1_init(&ctx);
> --      sha1_update(&ctx, "TCPA", 4);
> -+      sha1_update(&ctx, (uint8_t *) "TCPA", 4);
> -       sha1_final(&ctx, &msg[1 + SHA1_DIGEST_LENGTH]);
> -       memset(&msg[1 + 2 * SHA1_DIGEST_LENGTH], 0x00,
> -         msg_len - data_len - 2 * SHA1_DIGEST_LENGTH - 2);
> -@@ -429,7 +430,7 @@ static int decode_message(int type, uint
> -       mask_generation(&msg[1], SHA1_DIGEST_LENGTH,
> -         &msg[1 + SHA1_DIGEST_LENGTH], msg_len - SHA1_DIGEST_LENGTH - 1);
> -       sha1_init(&ctx);
> --      sha1_update(&ctx, "TCPA", 4);
> -+      sha1_update(&ctx, (uint8_t *) "TCPA", 4);
> -       sha1_final(&ctx, &msg[1]);
> -       if (memcmp(&msg[1], &msg[1 + SHA1_DIGEST_LENGTH],
> -           SHA1_DIGEST_LENGTH) != 0) return -1;
> -diff -uprN orig/tpm_emulator-0.4/linux_module.c tpm_emulator/linux_module.c
> ---- orig/tpm_emulator-0.4/linux_module.c       2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/linux_module.c        1969-12-31 16:00:00.000000000 -0800
> -@@ -1,195 +0,0 @@
> --/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -- * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -- *
> -- * This module is free software; you can redistribute it and/or modify
> -- * it under the terms of the GNU General Public License as published
> -- * by the Free Software Foundation; either version 2 of the License,
> -- * or (at your option) any later version.
> -- *
> -- * This module 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.
> -- *
> -- * $Id: linux_module.c 91 2006-03-13 13:51:41Z mast $
> -- */
> --
> --#include <linux/module.h>
> --#include <linux/kernel.h>
> --#include <linux/init.h>
> --#include <linux/miscdevice.h>
> --#include <linux/poll.h>
> --#include "linux_module.h"
> --#include "tpm/tpm_emulator.h"
> --
> --MODULE_LICENSE("GPL");
> --MODULE_AUTHOR("Mario Strasser <mast@gmx.net>");
> --MODULE_DESCRIPTION("Trusted Platform Module (TPM) Emulator");
> --MODULE_SUPPORTED_DEVICE(TPM_DEVICE_NAME);
> --
> --/* module startup parameters */
> --char *startup = "save";
> --module_param(startup, charp, 0444);
> --MODULE_PARM_DESC(startup, " Sets the startup mode of the TPM. "
> --  "Possible values are 'clear', 'save' (default) and 'deactivated.");
> --char *storage_file = "/var/tpm/tpm_emulator-1.2.0.2";
> --module_param(storage_file, charp, 0644);
> --MODULE_PARM_DESC(storage_file, " Sets the persistent-data storage "
> --  "file of the TPM.");
> --
> --/* TPM lock */
> --static struct semaphore tpm_mutex;
> --
> --/* TPM command response */
> --static struct {
> --  uint8_t *data;
> --  uint32_t size;
> --} tpm_response;
> --
> --/* module state */
> --#define STATE_IS_OPEN 0
> --static uint32_t module_state;
> --static struct timespec old_time;
> --
> --static int tpm_open(struct inode *inode, struct file *file)
> --{
> --  debug("%s()", __FUNCTION__);
> --  if (test_and_set_bit(STATE_IS_OPEN, (void*)&module_state)) return -EBUSY;
> --  return 0;
> --}
> --
> --static int tpm_release(struct inode *inode, struct file *file)
> --{
> --  debug("%s()", __FUNCTION__);
> --  clear_bit(STATE_IS_OPEN, (void*)&module_state);
> --  down(&tpm_mutex);
> --  if (tpm_response.data != NULL) {
> --    kfree(tpm_response.data);
> --    tpm_response.data = NULL;
> --  }
> --  up(&tpm_mutex);
> --  return 0;
> --}
> --
> --static ssize_t tpm_read(struct file *file, char *buf, size_t count, loff_t *ppos)
> --{
> --  debug("%s(%d)", __FUNCTION__, count);
> --  down(&tpm_mutex);
> --  if (tpm_response.data != NULL) {
> --    count = min(count, (size_t)tpm_response.size - (size_t)*ppos);
> --    count -= copy_to_user(buf, &tpm_response.data[*ppos], count);
> --    *ppos += count;
> --    if ((size_t)tpm_response.size == (size_t)*ppos) {
> --      kfree(tpm_response.data);
> --      tpm_response.data = NULL;
> --    }
> --  } else {
> --    count = 0;
> --  }
> --  up(&tpm_mutex);
> --  return count;
> --}
> --
> --static ssize_t tpm_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
> --{
> --  debug("%s(%d)", __FUNCTION__, count);
> --  down(&tpm_mutex);
> --  *ppos = 0;
> --  if (tpm_response.data != NULL) kfree(tpm_response.data);
> --  if (tpm_handle_command(buf, count, &tpm_response.data,
> --                         &tpm_response.size) != 0) {
> --    count = -EILSEQ;
> --    tpm_response.data = NULL;
> --  }
> --  up(&tpm_mutex);
> --  return count;
> --}
> --
> --#define TPMIOC_CANCEL   _IO('T', 0x00)
> --#define TPMIOC_TRANSMIT _IO('T', 0x01)
> --
> --static int tpm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
> --{
> --  debug("%s(%d, %p)", __FUNCTION__, cmd, (char*)arg);
> --  if (cmd == TPMIOC_TRANSMIT) {
> --    uint32_t count = ntohl(*(uint32_t*)(arg + 2));
> --    down(&tpm_mutex);
> --    if (tpm_response.data != NULL) kfree(tpm_response.data);
> --    if (tpm_handle_command((char*)arg, count, &tpm_response.data,
> --                           &tpm_response.size) == 0) {
> --      tpm_response.size -= copy_to_user((char*)arg, tpm_response.data,
> --                            tpm_response.size);
> --      kfree(tpm_response.data);
> --      tpm_response.data = NULL;
> --    } else {
> --      tpm_response.size = 0;
> --      tpm_response.data = NULL;
> --    }
> --    up(&tpm_mutex);
> --    return tpm_response.size;
> --  }
> --  return -1;
> --}
> --
> --struct file_operations fops = {
> --  .owner   = THIS_MODULE,
> --  .open    = tpm_open,
> --  .release = tpm_release,
> --  .read    = tpm_read,
> --  .write   = tpm_write,
> --  .ioctl   = tpm_ioctl,
> --};
> --
> --static struct miscdevice tpm_dev = {
> --  .minor      = TPM_DEVICE_MINOR,
> --  .name       = TPM_DEVICE_NAME,
> --  .fops       = &fops,
> --};
> --
> --int __init init_tpm_module(void)
> --{
> --  int res = misc_register(&tpm_dev);
> --  if (res != 0) {
> --    error("misc_register() failed for minor %d\n", TPM_DEVICE_MINOR);
> --    return res;
> --  }
> --  /* initialize variables */
> --  sema_init(&tpm_mutex, 1);
> --  module_state = 0;
> --  tpm_response.data = NULL;
> --  old_time = current_kernel_time();
> --  /* initialize TPM emulator */
> --  if (!strcmp(startup, "clear")) {
> --    tpm_emulator_init(1);
> --  } else if (!strcmp(startup, "save")) {
> --    tpm_emulator_init(2);
> --  } else if (!strcmp(startup, "deactivated")) {
> --    tpm_emulator_init(3);
> --  } else {
> --    error("invalid startup mode '%s'; must be 'clear', "
> --      "'save' (default) or 'deactivated", startup);
> --    misc_deregister(&tpm_dev);
> --    return -EINVAL;
> --  }
> --  return 0;
> --}
> --
> --void __exit cleanup_tpm_module(void)
> --{
> --  tpm_emulator_shutdown();
> --  misc_deregister(&tpm_dev);
> --  if (tpm_response.data != NULL) kfree(tpm_response.data);
> --}
> --
> --module_init(init_tpm_module);
> --module_exit(cleanup_tpm_module);
> --
> --uint64_t tpm_get_ticks(void)
> --{
> --  struct timespec new_time = current_kernel_time();
> --  uint64_t ticks = (uint64_t)(new_time.tv_sec - old_time.tv_sec) * 1000000
> --                   + (new_time.tv_nsec - old_time.tv_nsec) / 1000;
> --  old_time = new_time;
> --  return (ticks > 0) ? ticks : 1;
> --}
> --
> -diff -uprN orig/tpm_emulator-0.4/linux_module.h tpm_emulator/linux_module.h
> ---- orig/tpm_emulator-0.4/linux_module.h       2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/linux_module.h        2006-07-24 14:35:35.000000000 -0700
> -@@ -1,5 +1,6 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -17,54 +18,62 @@
> - #ifndef _LINUX_MODULE_H_
> - #define _LINUX_MODULE_H_
> -
> --#include <linux/version.h>
> --#include <linux/kernel.h>
> --#include <linux/slab.h>
> -+#include <malloc.h>
> -+#include <stdint.h>
> -+#include <stdio.h>
> -+#include <string.h>
> - #include <linux/types.h>
> --#include <linux/string.h>
> --#include <linux/random.h>
> --#include <linux/time.h>
> --#include <asm/byteorder.h>
> -
> --/* module settings */
> -+#include <endian.h>
> -+#define __BYTEORDER_HAS_U64__
> -+#ifdef LITTLE_ENDIAN
> -+ #include <linux/byteorder/little_endian.h>
> -+#else
> -+ #include <linux/byteorder/big_endian.h>
> -+#endif
> -
> -+/* module settings */
> -+#define min(A,B) ((A)<(B)?(A):(B))
> -+#ifndef STR
> - #define STR(s) __STR__(s)
> - #define __STR__(s) #s
> -+#endif
> - #include "tpm_version.h"
> -
> - #define TPM_DEVICE_MINOR  224
> - #define TPM_DEVICE_NAME   "tpm"
> - #define TPM_MODULE_NAME   "tpm_emulator"
> -
> --/* debug and log output functions */
> --
> - #ifdef DEBUG
> --#define debug(fmt, ...) printk(KERN_DEBUG "%s %s:%d: Debug: " fmt "\n", \
> --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug(fmt, ...) printf("TPMD: %s:%d: Debug: " fmt "\n", \
> -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> - #else
> - #define debug(fmt, ...)
> - #endif
> --#define info(fmt, ...)  printk(KERN_INFO "%s %s:%d: Info: " fmt "\n", \
> --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> --#define error(fmt, ...) printk(KERN_ERR "%s %s:%d: Error: " fmt "\n", \
> --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> --#define alert(fmt, ...) printk(KERN_ALERT "%s %s:%d: Alert: " fmt "\n", \
> --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define info(fmt, ...)  printf("TPMD: %s:%d: Info: " fmt "\n", \
> -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define error(fmt, ...) printf("TPMD: %s:%d: Error: " fmt "\n", \
> -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define alert(fmt, ...) printf("TPMD: %s:%d: Alert: " fmt "\n", \
> -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> -
> - /* memory allocation */
> -
> - static inline void *tpm_malloc(size_t size)
> - {
> --  return kmalloc(size, GFP_KERNEL);
> -+  return malloc(size);
> - }
> -
> - static inline void tpm_free(const void *ptr)
> - {
> --  if (ptr != NULL) kfree(ptr);
> -+  if (ptr != NULL) free( (void *) ptr);
> - }
> -
> - /* random numbers */
> -
> -+//FIXME;
> -+void get_random_bytes(void *buf, int nbytes);
> -+
> - static inline void tpm_get_random_bytes(void *buf, int nbytes)
> - {
> -   get_random_bytes(buf, nbytes);
> -@@ -84,9 +93,9 @@ uint64_t tpm_get_ticks(void);
> - #define CPU_TO_LE16(x) __cpu_to_le16(x)
> -
> - #define BE64_TO_CPU(x) __be64_to_cpu(x)
> --#define LE64_TO_CPU(x) __be64_to_cpu(x)
> -+#define LE64_TO_CPU(x) __le64_to_cpu(x)
> - #define BE32_TO_CPU(x) __be32_to_cpu(x)
> --#define LE32_TO_CPU(x) __be32_to_cpu(x)
> -+#define LE32_TO_CPU(x) __le32_to_cpu(x)
> - #define BE16_TO_CPU(x) __be16_to_cpu(x)
> - #define LE16_TO_CPU(x) __le16_to_cpu(x)
> -
> -diff -uprN orig/tpm_emulator-0.4/Makefile tpm_emulator/Makefile
> ---- orig/tpm_emulator-0.4/Makefile     2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/Makefile      2006-07-24 14:35:35.000000000 -0700
> -@@ -1,24 +1,40 @@
> - # Software-Based Trusted Platform Module (TPM) Emulator for Linux
> - # Copyright (C) 2004 Mario Strasser <mast@gmx.net>
> -+# Copyright (C) 2006 INTEL Corp.
> - #
> - # $Id: Makefile 115 2006-06-23 10:36:44Z mast $
> -
> --# kernel settings
> --KERNEL_RELEASE := $(shell uname -r)
> --KERNEL_BUILD   := /lib/modules/$(KERNEL_RELEASE)/build
> --MOD_SUBDIR     := misc
> -+COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
> -
> - # module settings
> --MODULE_NAME    := tpm_emulator
> -+BIN            := tpm_emulator
> - VERSION_MAJOR  := 0
> - VERSION_MINOR  := 4
> - VERSION_BUILD  := $(shell date +"%s")
> -
> --# enable/disable DEBUG messages
> --EXTRA_CFLAGS   += -Wall -DDEBUG -g
> -+# Installation program and options
> -+INSTALL         = install
> -+INSTALL_PROG    = $(INSTALL) -m0755
> -+INSTALL_DIR     = $(INSTALL) -d -m0755
> -+
> -+# Xen tools installation directory
> -+TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin
> -+
> -+CC      := gcc
> -+CFLAGS  += -g -Wall $(INCLUDE) -DDEBUG
> -+CFLAGS  += -I. -Itpm
> -+
> -+# Is the simulator running in it's own vm?
> -+#CFLAGS += -DVTPM_MULTI_VM
> -+
> -+ifeq ($(COMPILE_ARCH),x86_64)
> -+LIBDIR = lib64
> -+else
> -+LIBDIR = lib
> -+endif
> -
> - # GNU MP configuration
> --GMP_LIB        := /usr/lib/libgmp.a
> -+GMP_LIB        := /usr/$(LIBDIR)/libgmp.a
> - GMP_HEADER     := /usr/include/gmp.h
> -
> - # sources and objects
> -@@ -27,38 +43,32 @@ DIRS           := . crypto tpm
> - SRCS           := $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.c))
> - OBJS           := $(patsubst %.c, %.o, $(SRCS))
> - SRCS           += $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.h))
> --DISTSRC        := ./README ./AUTHORS ./ChangeLog ./Makefile $(SRCS)
> --DISTDIR        := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)
> -
> --obj-m               := $(MODULE_NAME).o
> --$(MODULE_NAME)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
> -+obj-m               := $(BIN)
> -+$(BIN)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
> -
> - EXTRA_CFLAGS   += -I$(src) -I$(src)/crypto -I$(src)/tpm
> -
> - # do not print "Entering directory ..."
> - MAKEFLAGS      += --no-print-directory
> -
> --all:  $(src)/crypto/gmp.h $(src)/crypto/libgmp.a version
> --      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules
> -+all: $(BIN)
> -
> --install:
> --      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules_install
> --      test -d /var/tpm || mkdir /var/tpm
> --      test -c /dev/tpm || mknod /dev/tpm c 10 224
> --      chmod 666 /dev/tpm
> --      depmod -a
> -+$(BIN):       $(src)/crypto/gmp.h $(src)/crypto/libgmp.a version $(SRCS) $(OBJS)
> -+      $(CC) $(CFLAGS) $(OBJS) $(src)/crypto/libgmp.a -o $(BIN)
> -+
> -+%.o: %.c
> -+      $(CC) $(CFLAGS) -c $< -o $@
> -+
> -+install: $(BIN)
> -+      $(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)
> -+      @if [ ! -d "/var/tpm" ]; then mkdir /var/tpm; fi
> -
> - clean:
> --      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) clean
> --      rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a
> -+      rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a $(OBJS)
> -
> --dist: $(DISTSRC)
> --      rm -rf $(DISTDIR)
> --      mkdir $(DISTDIR)
> --      cp --parents $(DISTSRC) $(DISTDIR)/
> --      rm -f $(DISTDIR)/crypto/gmp.h
> --      tar -chzf $(DISTDIR).tar.gz $(DISTDIR)
> --      rm -rf $(DISTDIR)
> -+mrproper: clean
> -+      rm -f $(BIN) tpm_version.h
> -
> - $(src)/crypto/libgmp.a:
> -       test -f $(src)/crypto/libgmp.a || ln -s $(GMP_LIB) $(src)/crypto/libgmp.a
> -@@ -88,4 +98,3 @@ version:
> -       @echo "#endif /* _TPM_VERSION_H_ */" >> $(src)/tpm_version.h
> -
> - .PHONY: all install clean dist gmp version
> --
> -diff -uprN orig/tpm_emulator-0.4/README tpm_emulator/README
> ---- orig/tpm_emulator-0.4/README       2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/README        2006-07-24 14:35:35.000000000 -0700
> -@@ -13,7 +13,8 @@ $Id: README 113 2006-06-18 12:38:13Z hst
> - Copyright
> - --------------------------------------------------------------------------
> - Copyright (C) 2004 Mario Strasser <mast@gmx.net> and Swiss Federal
> --Institute of Technology (ETH) Zurich.
> -+                   Institute of Technology (ETH) Zurich.
> -+Copyright (C) 2005 INTEL Corp
> -
> - This program is free software; you can redistribute it and/or modify
> - it under the terms of the GNU General Public License as published by
> -@@ -43,6 +44,12 @@ Example:
> - GMP_LIB        := /usr/lib/libgmp.a
> - GMP_HEADER     := /usr/include/gmp.h
> -
> -+GNU MP Library on 64 bit Systems
> -+--------------------------------------------------------------------------
> -+Some 64-bit kernels have problems with importing the user-space gmp
> -+library (/usr/lib*/libgmp.a) into kernel space.  These kernels will require
> -+that the gmp library be recompiled for kernel space with -mcmodel=kernel.
> -+
> - Installation
> - --------------------------------------------------------------------------
> - The compilation and installation process uses the build environment for
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_capability.c tpm_emulator/tpm/tpm_capability.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_capability.c 2006-06-23 19:37:07.000000000 +0900
> -+++ tpm_emulator/tpm/tpm_capability.c  2007-12-28 22:50:19.000000000 +0900
> -@@ -701,7 +701,10 @@ TPM_RESULT TPM_GetCapabilityOwner(TPM_VE
> -   TPM_RESULT res;
> -
> -   info("TPM_GetCapabilityOwner()");
> --
> -+
> -+  if (!tpmData.permanent.flags.owned) {
> -+    return TPM_NOSRK;
> -+  }
> -   /* Verify owner authorization */
> -   res = tpm_verify_auth(auth1, tpmData.permanent.data.ownerAuth, TPM_KH_OWNER);
> -   if (res != TPM_SUCCESS) return res;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c tpm_emulator/tpm/tpm_cmd_handler.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c        2006-06-23 19:37:07.000000000 +0900
> -+++ tpm_emulator/tpm/tpm_cmd_handler.c 2007-09-12 20:23:00.000000000 +0900
> -@@ -565,7 +565,7 @@ static TPM_RESULT execute_TPM_Seal(TPM_R
> -   if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle)
> -       || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth)
> -       || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize)
> --      || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)
> -+      || (pcrInfoSize >0 && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo))
> -       || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize)
> -       || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize)
> -       || len != 0) return TPM_BAD_PARAMETER;
> -@@ -798,7 +798,7 @@ static TPM_RESULT execute_TPM_Sealx(TPM_
> -   if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle)
> -       || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth)
> -       || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize)
> --      || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)
> -+      || (pcrInfoSize > 0 && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo))
> -       || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize)
> -       || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize)
> -       || len != 0) return TPM_BAD_PARAMETER;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_credentials.c tpm_emulator/tpm/tpm_credentials.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_credentials.c        2006-06-23 19:37:07.000000000 +0900
> -+++ tpm_emulator/tpm/tpm_credentials.c 2007-09-12 20:23:30.000000000 +0900
> -@@ -47,20 +47,20 @@ int tpm_compute_pubkey_checksum(TPM_NONC
> -
> - TPM_RESULT tpm_get_pubek(TPM_PUBKEY *pubEndorsementKey)
> - {
> --  UINT32 key_length;
> -+  size_t key_length;
> -   if (!tpmData.permanent.data.endorsementKey.size) return TPM_NO_ENDORSEMENT;
> -   /* setup TPM_PUBKEY structure */
> --  key_length = tpmData.permanent.data.endorsementKey.size;
> --  pubEndorsementKey->pubKey.keyLength = key_length >> 3;
> -+  pubEndorsementKey->pubKey.keyLength = tpmData.permanent.data.endorsementKey.size >> 3;
> -   pubEndorsementKey->pubKey.key = tpm_malloc(pubEndorsementKey->pubKey.keyLength);
> -   if (pubEndorsementKey->pubKey.key == NULL) return TPM_FAIL;
> -   rsa_export_modulus(&tpmData.permanent.data.endorsementKey,
> --    pubEndorsementKey->pubKey.key,
> --    &pubEndorsementKey->pubKey.keyLength);
> -+                   pubEndorsementKey->pubKey.key,
> -+                   &key_length);
> -+  pubEndorsementKey->pubKey.keyLength = key_length;
> -   pubEndorsementKey->algorithmParms.algorithmID = TPM_ALG_RSA;
> -   pubEndorsementKey->algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
> -   pubEndorsementKey->algorithmParms.sigScheme = TPM_SS_NONE;
> --  pubEndorsementKey->algorithmParms.parms.rsa.keyLength = key_length;
> -+  pubEndorsementKey->algorithmParms.parms.rsa.keyLength = key_length << 3;
> -   pubEndorsementKey->algorithmParms.parms.rsa.numPrimes = 2;
> -   pubEndorsementKey->algorithmParms.parms.rsa.exponentSize = 0;
> -   pubEndorsementKey->algorithmParms.parms.rsa.exponent = NULL;
> -@@ -175,6 +175,7 @@ TPM_RESULT TPM_OwnerReadInternalPub(TPM_
> - {
> -   TPM_RESULT res;
> -   TPM_KEY_DATA *srk = &tpmData.permanent.data.srk;
> -+  size_t key_length;
> -   info("TPM_OwnerReadInternalPub()");
> -   /* verify authorization */
> -   res = tpm_verify_auth(auth1, tpmData.permanent.data.ownerAuth, TPM_KH_OWNER);
> -@@ -186,7 +187,8 @@ TPM_RESULT TPM_OwnerReadInternalPub(TPM_
> -     publicPortion->pubKey.key = tpm_malloc(publicPortion->pubKey.keyLength);
> -     if (publicPortion->pubKey.key == NULL) return TPM_FAIL;
> -     rsa_export_modulus(&srk->key, publicPortion->pubKey.key,
> --      &publicPortion->pubKey.keyLength);
> -+      &key_length);
> -+    publicPortion->pubKey.keyLength = key_length;
> -     publicPortion->algorithmParms.algorithmID = TPM_ALG_RSA;
> -     publicPortion->algorithmParms.encScheme = srk->encScheme;
> -     publicPortion->algorithmParms.sigScheme = srk->sigScheme;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_crypto.c tpm_emulator/tpm/tpm_crypto.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_crypto.c     2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_crypto.c      2006-07-24 14:35:35.000000000 -0700
> -@@ -182,7 +182,8 @@ TPM_RESULT TPM_CertifyKey(TPM_KEY_HANDLE
> -   TPM_KEY_DATA *cert, *key;
> -   sha1_ctx_t sha1_ctx;
> -   BYTE *buf, *p;
> --  UINT32 length;
> -+  UINT32 length32;
> -+  size_t length;
> -   info("TPM_CertifyKey()");
> -   /* get keys */
> -   cert = tpm_get_key(certHandle);
> -@@ -264,14 +265,15 @@ TPM_RESULT TPM_CertifyKey(TPM_KEY_HANDLE
> -   /* compute the digest of the CERTIFY_INFO[2] structure and sign it */
> -   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
> -   p = buf = tpm_malloc(length);
> -+  length32=(UINT32) length;
> -   if (buf == NULL
> --      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length, certifyInfo)) {
> -+      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length32, certifyInfo)) {
> -     free_TPM_KEY_PARMS(certifyInfo->algorithmParms);
> -     return TPM_FAIL;
> -   }
> -   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
> -   sha1_init(&sha1_ctx);
> --  sha1_update(&sha1_ctx, buf, length);
> -+  sha1_update(&sha1_ctx, buf, (size_t) length);
> -   sha1_final(&sha1_ctx, buf);
> -   res = tpm_sign(cert, auth1, FALSE, buf, SHA1_DIGEST_LENGTH, outData, outDataSize);
> -   tpm_free(buf);
> -@@ -292,7 +294,8 @@ TPM_RESULT TPM_CertifyKey2(TPM_KEY_HANDL
> -   TPM_KEY_DATA *cert, *key;
> -   sha1_ctx_t sha1_ctx;
> -   BYTE *buf, *p;
> --  UINT32 length;
> -+  size_t length;
> -+  UINT32 length32;
> -   info("TPM_CertifyKey2()");
> -   /* get keys */
> -   cert = tpm_get_key(certHandle);
> -@@ -362,8 +365,9 @@ TPM_RESULT TPM_CertifyKey2(TPM_KEY_HANDL
> -   /* compute the digest of the CERTIFY_INFO[2] structure and sign it */
> -   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
> -   p = buf = tpm_malloc(length);
> -+  length32 = (UINT32) length;
> -   if (buf == NULL
> --      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length, certifyInfo)) {
> -+      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length32, certifyInfo)) {
> -     free_TPM_KEY_PARMS(certifyInfo->algorithmParms);
> -     return TPM_FAIL;
> -   }
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_daa.c tpm_emulator/tpm/tpm_daa.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_daa.c        2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_daa.c 2006-07-24 14:35:35.000000000 -0700
> -@@ -716,14 +716,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -805,14 +805,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -1489,14 +1489,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -1712,14 +1712,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -1793,14 +1793,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -2918,14 +2918,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -3143,7 +3143,7 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -         sha1_init(&sha1);
> -         sha1_update(&sha1, (BYTE*) &session->DAA_session.DAA_digest,
> -           sizeof(session->DAA_session.DAA_digest));
> --        sha1_update(&sha1, "\x01", 1);
> -+        sha1_update(&sha1, (BYTE *) "\x01", 1);
> -         sha1_update(&sha1, inputData1, inputSize1);
> -         sha1_final(&sha1, (BYTE*) &session->DAA_session.DAA_digest);
> -       }
> -@@ -3172,7 +3172,7 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -         sha1_init(&sha1);
> -         sha1_update(&sha1, (BYTE*) &session->DAA_session.DAA_digest,
> -           sizeof(session->DAA_session.DAA_digest));
> --        sha1_update(&sha1, "\x00", 1);
> -+        sha1_update(&sha1, (BYTE*) "\x00", 1);
> -         rsa_export_modulus(&aikData->key, scratch, &size);
> -         sha1_update(&sha1, scratch, size);
> -         sha1_final(&sha1, (BYTE*) &session->DAA_session.DAA_digest);
> -@@ -3229,14 +3229,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -3309,14 +3309,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_data.c tpm_emulator/tpm/tpm_data.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_data.c       2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_data.c        2006-07-24 14:35:35.000000000 -0700
> -@@ -40,6 +40,7 @@ static inline void init_pcr_attr(int pcr
> - void tpm_init_data(void)
> - {
> -   /* endorsement key */
> -+#ifndef TPM_GENERATE_EK
> -   uint8_t ek_n[] =  "\xa8\xdb\xa9\x42\xa8\xf3\xb8\x06\x85\x90\x76\x93\xad\xf7"
> -     "\x74\xec\x3f\xd3\x3d\x9d\xe8\x2e\xff\x15\xed\x0e\xce\x5f\x93"
> -     "\x92\xeb\xd1\x96\x2b\x72\x18\x81\x79\x12\x9d\x9c\x40\xd7\x1a"
> -@@ -77,6 +78,8 @@ void tpm_init_data(void)
> -     "\xd1\xc0\x8b\x5b\xa2\x2e\xa7\x15\xca\x50\x75\x10\x48\x9c\x2b"
> -     "\x18\xb9\x67\x8f\x5d\x64\xc3\x28\x9f\x2f\x16\x2f\x08\xda\x47"
> -     "\xec\x86\x43\x0c\x80\x99\x07\x34\x0f";
> -+#endif
> -+
> -   int i;
> -   /* reset all data to NULL, FALSE or 0 */
> -   memset(&tpmData, 0, sizeof(tpmData));
> -@@ -152,44 +155,43 @@ void tpm_release_data(void)
> -
> - #ifdef TPM_STORE_TO_FILE
> -
> --#include <linux/fs.h>
> --#include <linux/unistd.h>
> --#include <asm/uaccess.h>
> -+#include <sys/types.h>
> -+#include <sys/stat.h>
> -+#include <fcntl.h>
> -+#include <unistd.h>
> -
> - #define TPM_STORAGE_FILE "/var/tpm/tpm_emulator-1.2." STR(VERSION_MAJOR) "." STR(VERSION_MINOR)
> -
> - static int write_to_file(uint8_t *data, size_t data_length)
> - {
> -   int res;
> --  struct file *fp;
> --  mm_segment_t old_fs = get_fs();
> --  fp = filp_open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> --  if (IS_ERR(fp)) return -1;
> --  set_fs(get_ds());
> --  res = fp->f_op->write(fp, data, data_length, &fp->f_pos);
> --  set_fs(old_fs);
> --  filp_close(fp, NULL);
> -+  int fp;
> -+  fp = open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> -+  res = write(fp, data, data_length);
> -+  close(fp);
> -   return (res == data_length) ? 0 : -1;
> - }
> -
> - static int read_from_file(uint8_t **data, size_t *data_length)
> - {
> -   int res;
> --  struct file *fp;
> --  mm_segment_t old_fs = get_fs();
> --  fp = filp_open(TPM_STORAGE_FILE, O_RDONLY, 0);
> --  if (IS_ERR(fp)) return -1;
> --  *data_length = (size_t)fp->f_dentry->d_inode->i_size;
> --  /* *data_length = i_size_read(fp->f_dentry->d_inode); */
> -+  int fp, file_status;
> -+  struct stat file_info;
> -+  fp = open(TPM_STORAGE_FILE, O_RDONLY, 0);
> -+  file_status = fstat(fp, &file_info);
> -+  if (file_status < 0) {
> -+    close(fp);
> -+    return -1;
> -+  }
> -+
> -+  *data_length = file_info.st_size;
> -   *data = tpm_malloc(*data_length);
> -   if (*data == NULL) {
> --    filp_close(fp, NULL);
> -+    close(fp);
> -     return -1;
> -   }
> --  set_fs(get_ds());
> --  res = fp->f_op->read(fp, *data, *data_length, &fp->f_pos);
> --  set_fs(old_fs);
> --  filp_close(fp, NULL);
> -+  res = read(fp, *data, *data_length);
> -+  close(fp);
> -   if (res != *data_length) {
> -     tpm_free(*data);
> -     return -1;
> -@@ -216,23 +218,30 @@ static int read_from_file(uint8_t **data
> - int tpm_store_permanent_data(void)
> - {
> -   uint8_t *buf, *ptr;
> --  size_t buf_length, len;
> -+  UINT32 buf_length, len;
> -
> -   /* marshal data */
> --  buf_length = len = sizeof_TPM_STCLEAR_FLAGS(tpmData.stclear.flags)
> --    + sizeof_TPM_PERMANENT_FLAGS(tpmData.permanent.flags) + 2
> --    + sizeof_TPM_PERMANENT_DATA(tpmData.permanent.data);
> -+  buf_length = len = 4 + sizeof_TPM_STCLEAR_FLAGS(tpmData.stclear.flags)
> -+    + sizeof_TPM_PERMANENT_FLAGS(tpmData.permanent.flags)
> -+    + sizeof_TPM_STANY_FLAGS(tpmData.stany.flags) + 2
> -+    + sizeof_TPM_STCLEAR_DATA(tpmData.stclear.data)
> -+    + sizeof_TPM_PERMANENT_DATA(tpmData.permanent.data)
> -+    + sizeof_TPM_STANY_DATA(tpmData.stany.data);
> -   buf = ptr = tpm_malloc(buf_length);
> -   if (buf == NULL
> -       || tpm_marshal_TPM_VERSION(&ptr, &len, &tpmData.permanent.data.version)
> -       || tpm_marshal_TPM_STCLEAR_FLAGS(&ptr, &len, &tpmData.stclear.flags)
> -       || tpm_marshal_TPM_PERMANENT_FLAGS(&ptr, &len, &tpmData.permanent.flags)
> -+      || tpm_marshal_TPM_STANY_FLAGS(&ptr, &len, &tpmData.stany.flags)
> -       || tpm_marshal_BOOL(&ptr, &len, tpmData.permanent.flags.selfTestSucceeded)
> -       || tpm_marshal_BOOL(&ptr, &len, tpmData.permanent.flags.owned)
> --      || tpm_marshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)) {
> -+      || tpm_marshal_TPM_STCLEAR_DATA(&ptr, &len, &tpmData.stclear.data)
> -+      || tpm_marshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)
> -+      || tpm_marshal_TPM_STANY_DATA(&ptr, &len, &tpmData.stany.data)) {
> -     tpm_free(buf);
> -     return -1;
> -   }
> -+
> -   if (write_to_file(buf, buf_length - len)) {
> -     tpm_free(buf);
> -     return -1;
> -@@ -244,31 +253,36 @@ int tpm_store_permanent_data(void)
> - int tpm_restore_permanent_data(void)
> - {
> -   uint8_t *buf, *ptr;
> --  size_t buf_length, len;
> -+  size_t buf_length;
> -+  UINT32 len;
> -   TPM_VERSION ver;
> -
> -   /* read data */
> -   if (read_from_file(&buf, &buf_length)) return -1;
> -   ptr = buf;
> --  len = buf_length;
> -+  len = (uint32_t) buf_length;
> -   /* unmarshal data */
> -   if (tpm_unmarshal_TPM_VERSION(&ptr, &len, &ver)
> -       || memcmp(&ver, &tpmData.permanent.data.version, sizeof(TPM_VERSION))
> -       || tpm_unmarshal_TPM_STCLEAR_FLAGS(&ptr, &len, &tpmData.stclear.flags)
> -       || tpm_unmarshal_TPM_PERMANENT_FLAGS(&ptr, &len, &tpmData.permanent.flags)
> -+      || tpm_unmarshal_TPM_STANY_FLAGS(&ptr, &len, &tpmData.stany.flags)
> -       || tpm_unmarshal_BOOL(&ptr, &len, &tpmData.permanent.flags.selfTestSucceeded)
> -       || tpm_unmarshal_BOOL(&ptr, &len, &tpmData.permanent.flags.owned)
> --      || tpm_unmarshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)) {
> -+      || tpm_unmarshal_TPM_STCLEAR_DATA(&ptr, &len, &tpmData.stclear.data)
> -+      || tpm_unmarshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)
> -+      || tpm_unmarshal_TPM_STANY_DATA(&ptr, &len, &tpmData.stany.data)) {
> -     tpm_free(buf);
> -     return -1;
> -   }
> -+
> -   tpm_free(buf);
> -   return 0;
> - }
> -
> - int tpm_erase_permanent_data(void)
> - {
> --  int res = write_to_file("", 0);
> -+  int res = write_to_file((uint8_t *) "", 0);
> -   return res;
> - }
> -
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_deprecated.c tpm_emulator/tpm/tpm_deprecated.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_deprecated.c 2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_deprecated.c  2006-07-24 14:35:35.000000000 -0700
> -@@ -1,6 +1,7 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -50,7 +51,7 @@ TPM_RESULT TPM_SaveKeyContext(TPM_KEY_HA
> -   BYTE *ptr;
> -   UINT32 len;
> -   info("TPM_SaveKeyContext()");
> --  res = TPM_SaveContext(keyHandle, TPM_RT_KEY, "SaveKeyContext..",
> -+  res = TPM_SaveContext(keyHandle, TPM_RT_KEY, (BYTE*)"SaveKeyContext..",
> -                         keyContextSize, &contextBlob);
> -   if (res != TPM_SUCCESS) return res;
> -   len = *keyContextSize;
> -@@ -82,7 +83,7 @@ TPM_RESULT TPM_SaveAuthContext(TPM_AUTHH
> -   BYTE *ptr;
> -   UINT32 len;
> -   info("TPM_SaveAuthContext()");
> --  res = TPM_SaveContext(authHandle, TPM_RT_KEY, "SaveAuthContext.",
> -+  res = TPM_SaveContext(authHandle, TPM_RT_KEY, (BYTE*)"SaveAuthContext.",
> -                         authContextSize, &contextBlob);
> -   if (res != TPM_SUCCESS) return res;
> -   len = *authContextSize;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_emulator.h tpm_emulator/tpm/tpm_emulator.h
> ---- orig/tpm_emulator-0.4/tpm/tpm_emulator.h   2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_emulator.h    2006-07-24 14:35:35.000000000 -0700
> -@@ -1,5 +1,6 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -22,7 +23,8 @@
> - /* TPM configuration */
> - #define TPM_STORE_TO_FILE       1
> - #undef  TPM_STRONG_PERSISTENCE
> --#undef  TPM_GENERATE_EK
> -+//#undef  TPM_GENERATE_EK
> -+#define  TPM_GENERATE_EK
> - #undef  TPM_GENERATE_SEED_DAA
> -
> - #define TPM_MANUFACTURER 0x4554485A /* 'ETHZ' */
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_marshalling.c tpm_emulator/tpm/tpm_marshalling.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_marshalling.c        2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_marshalling.c 2006-07-24 14:35:35.000000000 -0700
> -@@ -1312,7 +1312,7 @@ int tpm_unmarshal_TPM_STANY_FLAGS(BYTE *
> -
> - int tpm_marshal_RSA(BYTE **ptr, UINT32 *length, rsa_private_key_t *v)
> - {
> --  UINT32 m_len, e_len, q_len;
> -+  size_t m_len, e_len, q_len;
> -   if (*length < sizeof_RSA((*v))) return -1;
> -   if (v->size > 0) {
> -     rsa_export_modulus(v, &(*ptr)[6], &m_len);
> -@@ -1460,6 +1460,66 @@ int tpm_unmarshal_TPM_PERMANENT_DATA(BYT
> -   return 0;
> - }
> -
> -+int tpm_marshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v)
> -+{
> -+  if (tpm_marshal_TPM_STRUCTURE_TAG(ptr, length, v->tag)
> -+    || tpm_marshal_TPM_NONCE(ptr, length, &v->contextNonceKey)
> -+    || tpm_marshal_TPM_COUNT_ID(ptr, length, v->countID) ) return -1;
> -+
> -+  return 0;
> -+}
> -+
> -+int tpm_unmarshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v)
> -+{
> -+  if (tpm_unmarshal_TPM_STRUCTURE_TAG(ptr, length, &v->tag)
> -+    || tpm_unmarshal_TPM_NONCE(ptr, length, &v->contextNonceKey)
> -+    || tpm_unmarshal_TPM_COUNT_ID(ptr, length, &v->countID) ) return -1;
> -+
> -+  return 0;
> -+}
> -+
> -+int tpm_marshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v)
> -+{
> -+  UINT32 i;
> -+  if (tpm_marshal_TPM_STRUCTURE_TAG(ptr, length, v->tag)
> -+    || tpm_marshal_TPM_NONCE(ptr, length, &v->contextNonceSession)
> -+    || tpm_marshal_TPM_DIGEST(ptr, length, &v->auditDigest)
> -+    || tpm_marshal_BOOL(ptr, length, v->auditSession)
> -+    || tpm_marshal_TPM_CURRENT_TICKS(ptr, length, &v->currentTicks)
> -+    || tpm_marshal_UINT32(ptr, length, v->contextCount)
> -+    || tpm_marshal_UINT32_ARRAY(ptr, length, v->contextList, TPM_MAX_SESSION_LIST)) return -1;
> -+  for (i = 0; i < TPM_MAX_SESSIONS; i++) {
> -+    if (tpm_marshal_TPM_SESSION_DATA(ptr, length, &v->sessions[i])) return -1;
> -+  }
> -+  for (i = 0; i < TPM_MAX_SESSIONS_DAA; i++) {
> -+    if (tpm_marshal_TPM_DAA_SESSION_DATA(ptr, length, &v->sessionsDAA[i])) return -1;
> -+  }
> -+  if (tpm_marshal_TPM_TRANSHANDLE(ptr, length, v->transExclusive)) return -1;
> -+
> -+  return 0;
> -+}
> -+
> -+int tpm_unmarshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v)
> -+{
> -+  UINT32 i;
> -+  if (tpm_unmarshal_TPM_STRUCTURE_TAG(ptr, length, &v->tag)
> -+    || tpm_unmarshal_TPM_NONCE(ptr, length, &v->contextNonceSession)
> -+    || tpm_unmarshal_TPM_DIGEST(ptr, length, &v->auditDigest)
> -+    || tpm_unmarshal_BOOL(ptr, length, &v->auditSession)
> -+    || tpm_unmarshal_TPM_CURRENT_TICKS(ptr, length, &v->currentTicks)
> -+    || tpm_unmarshal_UINT32(ptr, length, &v->contextCount)
> -+    || tpm_unmarshal_UINT32_ARRAY(ptr, length, v->contextList, TPM_MAX_SESSION_LIST)) return -1;
> -+  for (i = 0; i < TPM_MAX_SESSIONS; i++) {
> -+    if (tpm_unmarshal_TPM_SESSION_DATA(ptr, length, &v->sessions[i])) return -1;
> -+  }
> -+  for (i = 0; i < TPM_MAX_SESSIONS_DAA; i++) {
> -+    if (tpm_unmarshal_TPM_DAA_SESSION_DATA(ptr, length, &v->sessionsDAA[i])) return -1;
> -+  }
> -+  if (tpm_unmarshal_TPM_TRANSHANDLE(ptr, length, &v->transExclusive)) return -1;
> -+
> -+  return 0;
> -+}
> -+
> - int tpm_marshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v)
> - {
> -   if (tpm_marshal_BYTE(ptr, length, v->type)
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_marshalling.h tpm_emulator/tpm/tpm_marshalling.h
> ---- orig/tpm_emulator-0.4/tpm/tpm_marshalling.h        2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_marshalling.h 2006-07-24 14:35:35.000000000 -0700
> -@@ -432,6 +432,12 @@ int tpm_unmarshal_TPM_KEY_DATA(BYTE **pt
> - int tpm_marshal_TPM_PERMANENT_DATA(BYTE **ptr, UINT32 *length, TPM_PERMANENT_DATA *);
> - int tpm_unmarshal_TPM_PERMANENT_DATA(BYTE **ptr, UINT32 *length, TPM_PERMANENT_DATA *);
> -
> -+int tpm_marshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v);
> -+int tpm_unmarshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v);
> -+
> -+int tpm_marshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v);
> -+int tpm_unmarshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v);
> -+
> - int tpm_marshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v);
> - int tpm_unmarshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v);
> -
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_owner.c tpm_emulator/tpm/tpm_owner.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_owner.c      2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_owner.c       2006-07-24 14:35:35.000000000 -0700
> -@@ -108,7 +108,7 @@ TPM_RESULT TPM_TakeOwnership(TPM_PROTOCO
> -   TPM_RESULT res;
> -   rsa_private_key_t *ek = &tpmData.permanent.data.endorsementKey;
> -   TPM_KEY_DATA *srk = &tpmData.permanent.data.srk;
> --  UINT32 buf_size = ek->size >> 3;
> -+  size_t buf_size = ek->size >> 3, key_length;
> -   BYTE buf[buf_size];
> -
> -   info("TPM_TakeOwnership()");
> -@@ -173,7 +173,8 @@ TPM_RESULT TPM_TakeOwnership(TPM_PROTOCO
> -     return TPM_FAIL;
> -   }
> -   rsa_export_modulus(&srk->key, srkPub->pubKey.key,
> --    &srkPub->pubKey.keyLength);
> -+                   &key_length);
> -+  srkPub->pubKey.keyLength = (UINT32) key_length;
> -   /* setup tpmProof and set state to owned */
> -   tpm_get_random_bytes(tpmData.permanent.data.tpmProof.nonce,
> -     sizeof(tpmData.permanent.data.tpmProof.nonce));
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_startup.c tpm_emulator/tpm/tpm_startup.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_startup.c    2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_startup.c     2006-07-24 14:35:35.000000000 -0700
> -@@ -41,26 +41,29 @@ void TPM_Init(TPM_STARTUP_TYPE startupTy
> - TPM_RESULT TPM_Startup(TPM_STARTUP_TYPE startupType)
> - {
> -   int i;
> -+  int restore_fail;
> -   info("TPM_Startup(%d)", startupType);
> -   if (tpmData.stany.flags.postInitialise == FALSE) return TPM_INVALID_POSTINIT;
> --  /* reset STANY_FLAGS */
> --  SET_TO_ZERO(&tpmData.stany.flags);
> --  tpmData.stany.flags.tag = TPM_TAG_STANY_FLAGS;
> --  /* reset STANY_DATA (invalidates ALL sessions) */
> --  SET_TO_ZERO(&tpmData.stany.data);
> --  tpmData.stany.data.tag = TPM_TAG_STANY_DATA;
> --  /* init session-context nonce */
> --  SET_TO_RAND(&tpmData.stany.data.contextNonceSession);
> -+
> -+  /* try and restore state to get EK, SRK, etc */
> -+  restore_fail = tpm_restore_permanent_data();
> -+
> -   /* set data and flags according to the given startup type */
> -   if (startupType == TPM_ST_CLEAR) {
> --    /* if available, restore permanent data */
> --    tpm_restore_permanent_data();
> -+    /* reset STANY_FLAGS */
> -+    SET_TO_ZERO(&tpmData.stany.flags);
> -+    tpmData.stany.flags.tag = TPM_TAG_STANY_FLAGS;
> -+    /* reset STANY_DATA (invalidates ALL sessions) */
> -+    SET_TO_ZERO(&tpmData.stany.data);
> -+    tpmData.stany.data.tag = TPM_TAG_STANY_DATA;
> -+    /* init session-context nonce */
> -+    SET_TO_RAND(&tpmData.stany.data.contextNonceSession);
> -     /* reset PCR values */
> -     for (i = 0; i < TPM_NUM_PCR; i++) {
> --      if (tpmData.permanent.data.pcrAttrib[i].pcrReset)
> --        SET_TO_ZERO(tpmData.permanent.data.pcrValue[i].digest);
> -+      if (!tpmData.permanent.data.pcrAttrib[i].pcrReset)
> -+        SET_TO_ZERO(&tpmData.permanent.data.pcrValue[i].digest);
> -       else
> --        SET_TO_0xFF(tpmData.permanent.data.pcrValue[i].digest);
> -+        SET_TO_0xFF(&tpmData.permanent.data.pcrValue[i].digest);
> -     }
> -     /* reset STCLEAR_FLAGS */
> -     SET_TO_ZERO(&tpmData.stclear.flags);
> -@@ -79,7 +82,8 @@ TPM_RESULT TPM_Startup(TPM_STARTUP_TYPE
> -     /* init key-context nonce */
> -     SET_TO_RAND(&tpmData.stclear.data.contextNonceKey);
> -   } else if (startupType == TPM_ST_STATE) {
> --    if (tpm_restore_permanent_data()) {
> -+    /* restore must have been successful for TPM_ST_STATE */
> -+    if (restore_fail) {
> -       error("restoring permanent data failed");
> -       tpmData.permanent.data.testResult = "tpm_restore_permanent_data() failed";
> -       tpmData.permanent.flags.selfTestSucceeded = FALSE;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_storage.c tpm_emulator/tpm/tpm_storage.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_storage.c    2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_storage.c     2006-07-24 14:35:35.000000000 -0700
> -@@ -58,6 +58,7 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
> -                         BYTE *enc, UINT32 *enc_size)
> - {
> -   UINT32 len;
> -+  size_t enc_size32 = *enc_size;
> -   BYTE *buf, *ptr;
> -   rsa_public_key_t pub_key;
> -   int scheme;
> -@@ -72,7 +73,7 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
> -   if (buf == NULL
> -       || tpm_marshal_TPM_SEALED_DATA(&ptr, &len, seal)
> -       || rsa_encrypt(&pub_key, scheme, buf, sizeof_TPM_SEALED_DATA((*seal)),
> --                     enc, enc_size)) {
> -+                     enc, &enc_size32)) {
> -     tpm_free(buf);
> -     rsa_release_public_key(&pub_key);
> -     return -1;
> -@@ -85,7 +86,8 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
> - int decrypt_sealed_data(TPM_KEY_DATA *key, BYTE *enc, UINT32 enc_size,
> -                         TPM_SEALED_DATA *seal, BYTE **buf)
> - {
> --  UINT32 len;
> -+  size_t len;
> -+  UINT32 len32;
> -   BYTE *ptr;
> -   int scheme;
> -   switch (key->encScheme) {
> -@@ -96,8 +98,12 @@ int decrypt_sealed_data(TPM_KEY_DATA *ke
> -   len = enc_size;
> -   *buf = ptr = tpm_malloc(len);
> -   if (*buf == NULL
> --      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len)
> --      || tpm_unmarshal_TPM_SEALED_DATA(&ptr, &len, seal)) {
> -+      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len) ){
> -+    tpm_free(*buf);
> -+    return -1;
> -+  }
> -+  len32 = len;
> -+  if (tpm_unmarshal_TPM_SEALED_DATA(&ptr, &len32, seal)) {
> -     tpm_free(*buf);
> -     return -1;
> -   }
> -@@ -240,11 +246,12 @@ TPM_RESULT TPM_Unseal(TPM_KEY_HANDLE par
> -
> - TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE keyHandle, UINT32 inDataSize,
> -                       BYTE *inData, TPM_AUTH *auth1,
> --                      UINT32 *outDataSize, BYTE **outData)
> -+                      UINT32 *outDataSize32, BYTE **outData)
> - {
> -   TPM_RESULT res;
> -   TPM_KEY_DATA *key;
> -   int scheme;
> -+  size_t outDataSize;
> -
> -   info("TPM_UnBind()");
> -   /* get key */
> -@@ -262,8 +269,8 @@ TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE key
> -   /* the size of the input data muss be greater than zero */
> -   if (inDataSize == 0) return TPM_BAD_PARAMETER;
> -   /* decrypt data */
> --  *outDataSize = inDataSize;
> --  *outData = tpm_malloc(*outDataSize);
> -+  outDataSize = inDataSize;
> -+  *outData = tpm_malloc(outDataSize);
> -   if (*outData == NULL) return TPM_NOSPACE;
> -   switch (key->encScheme) {
> -     case TPM_ES_RSAESOAEP_SHA1_MGF1: scheme = RSA_ES_OAEP_SHA1; break;
> -@@ -271,20 +278,21 @@ TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE key
> -     default: tpm_free(*outData); return TPM_DECRYPT_ERROR;
> -   }
> -   if (rsa_decrypt(&key->key, scheme, inData, inDataSize,
> --      *outData, outDataSize)) {
> -+      *outData, &outDataSize)) {
> -     tpm_free(*outData);
> -     return TPM_DECRYPT_ERROR;
> -   }
> -   /* verify data if it is of type TPM_BOUND_DATA */
> -   if (key->encScheme == TPM_ES_RSAESOAEP_SHA1_MGF1
> -       || key->keyUsage != TPM_KEY_LEGACY) {
> --    if (*outDataSize < 5 || memcmp(*outData, "\x01\x01\00\x00\x02", 5) != 0) {
> -+    if (outDataSize < 5 || memcmp(*outData, "\x01\x01\00\x00\x02", 5) != 0) {
> -       tpm_free(*outData);
> -       return TPM_DECRYPT_ERROR;
> -     }
> --    *outDataSize -= 5;
> --    memmove(*outData, &(*outData)[5], *outDataSize);
> -+    outDataSize -= 5;
> -+    memmove(*outData, &(*outData)[5], outDataSize);
> -   }
> -+  *outDataSize32 = (UINT32) outDataSize;
> -   return TPM_SUCCESS;
> - }
> -
> -@@ -334,12 +342,13 @@ int compute_pubkey_digest(TPM_PUBKEY *ke
> - }
> -
> - int encrypt_private_key(TPM_KEY_DATA *key, TPM_STORE_ASYMKEY *store,
> --                        BYTE *enc, UINT32 *enc_size)
> -+                        BYTE *enc, UINT32 *enc_size32)
> - {
> -   UINT32 len;
> -   BYTE *buf, *ptr;
> -   rsa_public_key_t pub_key;
> -   int scheme;
> -+  size_t enc_size;
> -   switch (key->encScheme) {
> -     case TPM_ES_RSAESOAEP_SHA1_MGF1: scheme = RSA_ES_OAEP_SHA1; break;
> -     case TPM_ES_RSAESPKCSv15: scheme = RSA_ES_PKCSV15; break;
> -@@ -351,11 +360,12 @@ int encrypt_private_key(TPM_KEY_DATA *ke
> -   if (buf == NULL
> -       || tpm_marshal_TPM_STORE_ASYMKEY(&ptr, &len, store)
> -       || rsa_encrypt(&pub_key, scheme, buf, sizeof_TPM_STORE_ASYMKEY((*store)),
> --                     enc, enc_size)) {
> -+                     enc, &enc_size)) {
> -     tpm_free(buf);
> -     rsa_release_public_key(&pub_key);
> -     return -1;
> -   }
> -+  *enc_size32 = (UINT32) enc_size;
> -   tpm_free(buf);
> -   rsa_release_public_key(&pub_key);
> -   return 0;
> -@@ -364,7 +374,8 @@ int encrypt_private_key(TPM_KEY_DATA *ke
> - int decrypt_private_key(TPM_KEY_DATA *key, BYTE *enc, UINT32 enc_size,
> -                         TPM_STORE_ASYMKEY *store, BYTE **buf)
> - {
> --  UINT32 len;
> -+  UINT32 len32;
> -+  size_t len;
> -   BYTE *ptr;
> -   int scheme;
> -   switch (key->encScheme) {
> -@@ -375,8 +386,12 @@ int decrypt_private_key(TPM_KEY_DATA *ke
> -   len = enc_size;
> -   *buf = ptr = tpm_malloc(len);
> -   if (*buf == NULL
> --      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len)
> --      || tpm_unmarshal_TPM_STORE_ASYMKEY(&ptr, &len, store)) {
> -+      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len) ) {
> -+    tpm_free(*buf);
> -+    return -1;
> -+  }
> -+  len32 = (UINT32) len;
> -+  if (tpm_unmarshal_TPM_STORE_ASYMKEY(&ptr, &len32, store)) {
> -     tpm_free(*buf);
> -     return -1;
> -   }
> -@@ -394,7 +409,7 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
> -   TPM_SESSION_DATA *session;
> -   TPM_STORE_ASYMKEY store;
> -   rsa_private_key_t rsa;
> --  UINT32 key_length;
> -+  size_t key_length;
> -
> -   info("TPM_CreateWrapKey()");
> -   /* get parent key */
> -@@ -450,11 +465,11 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
> -     }
> -   }
> -   /* generate key and store it */
> --  key_length = keyInfo->algorithmParms.parms.rsa.keyLength;
> --  if (rsa_generate_key(&rsa, key_length)) return TPM_FAIL;
> --  wrappedKey->pubKey.keyLength = key_length >> 3;
> -+  if (rsa_generate_key(&rsa, keyInfo->algorithmParms.parms.rsa.keyLength))
> -+    return TPM_FAIL;
> -+  wrappedKey->pubKey.keyLength = keyInfo->algorithmParms.parms.rsa.keyLength >> 3;
> -   wrappedKey->pubKey.key = tpm_malloc(wrappedKey->pubKey.keyLength);
> --  store.privKey.keyLength = key_length >> 4;
> -+  store.privKey.keyLength = keyInfo->algorithmParms.parms.rsa.keyLength >> 4;
> -   store.privKey.key = tpm_malloc(store.privKey.keyLength);
> -   wrappedKey->encDataSize = parent->key.size >> 3;
> -   wrappedKey->encData = tpm_malloc(wrappedKey->encDataSize);
> -@@ -466,9 +481,11 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
> -     tpm_free(wrappedKey->encData);
> -     return TPM_NOSPACE;
> -   }
> --  rsa_export_modulus(&rsa, wrappedKey->pubKey.key,
> --    &wrappedKey->pubKey.keyLength);
> --  rsa_export_prime1(&rsa, store.privKey.key, &store.privKey.keyLength);
> -+  rsa_export_modulus(&rsa, wrappedKey->pubKey.key,
> -+                   &key_length);
> -+  wrappedKey->pubKey.keyLength = (UINT32) key_length;
> -+  rsa_export_prime1(&rsa, store.privKey.key, &key_length);
> -+  store.privKey.keyLength = (UINT32) key_length;
> -   rsa_release_private_key(&rsa);
> -   /* compute the digest of the wrapped key (without encData) */
> -   if (compute_key_digest(wrappedKey, &store.pubDataDigest)) {
> -@@ -602,6 +619,7 @@ TPM_RESULT TPM_LoadKey2(TPM_KEY_HANDLE p
> -
> - int tpm_setup_key_parms(TPM_KEY_DATA *key, TPM_KEY_PARMS *parms)
> - {
> -+  size_t key_length;
> -   parms->algorithmID = TPM_ALG_RSA;
> -   parms->encScheme = key->encScheme;
> -   parms->sigScheme = key->sigScheme;
> -@@ -611,7 +629,8 @@ int tpm_setup_key_parms(TPM_KEY_DATA *ke
> -   parms->parms.rsa.exponent = tpm_malloc(parms->parms.rsa.exponentSize);
> -   if (parms->parms.rsa.exponent == NULL) return -1;
> -   rsa_export_exponent(&key->key, parms->parms.rsa.exponent,
> --    &parms->parms.rsa.exponentSize);
> -+    &key_length);
> -+  parms->parms.rsa.exponentSize = (UINT32) key_length;
> -   parms->parmSize = 12 + parms->parms.rsa.exponentSize;
> -   return 0;
> - }
> -@@ -622,6 +641,7 @@ TPM_RESULT TPM_GetPubKey(TPM_KEY_HANDLE
> -   TPM_RESULT res;
> -   TPM_KEY_DATA *key;
> -   TPM_DIGEST digest;
> -+  size_t key_length;
> -   info("TPM_GetPubKey()");
> -   /* get key */
> -   if (keyHandle == TPM_KH_SRK
> -@@ -650,8 +670,8 @@ TPM_RESULT TPM_GetPubKey(TPM_KEY_HANDLE
> -   pubKey->pubKey.keyLength = key->key.size >> 3;
> -   pubKey->pubKey.key = tpm_malloc(pubKey->pubKey.keyLength);
> -   if (pubKey->pubKey.key == NULL) return TPM_NOSPACE;
> --  rsa_export_modulus(&key->key, pubKey->pubKey.key,
> --    &pubKey->pubKey.keyLength);
> -+  rsa_export_modulus(&key->key, pubKey->pubKey.key, &key_length);
> -+  pubKey->pubKey.keyLength = (UINT32) key_length;
> -   if (tpm_setup_key_parms(key, &pubKey->algorithmParms) != 0) {
> -     error("TPM_GetPubKey(): tpm_setup_key_parms() failed.");
> -     tpm_free(pubKey->pubKey.key);
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_structures.h tpm_emulator/tpm/tpm_structures.h
> ---- orig/tpm_emulator-0.4/tpm/tpm_structures.h 2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_structures.h  2006-07-24 14:35:35.000000000 -0700
> -@@ -1958,6 +1958,7 @@ typedef struct tdTPM_DAA_ISSUER {
> -   TPM_DIGEST DAA_digest_gamma;
> -   BYTE DAA_generic_q[26];
> - } TPM_DAA_ISSUER;
> -+#define sizeof_TPM_DAA_ISSUER(s) (2 + (20 * 6) + 26 )
> -
> - /*
> -  * TPM_DAA_TPM ([TPM_Part2], Section 22.4)
> -@@ -1973,6 +1974,7 @@ typedef struct tdTPM_DAA_TPM {
> -   TPM_DIGEST DAA_rekey;
> -   UINT32 DAA_count;
> - } TPM_DAA_TPM;
> -+#define sizeof_TPM_DAA_TPM(s) (2 + (4 * 20) + 4)
> -
> - /*
> -  * TPM_DAA_CONTEXT ([TPM_Part2], Section 22.5)
> -@@ -1987,6 +1989,7 @@ typedef struct tdTPM_DAA_CONTEXT {
> -   BYTE DAA_scratch[256];
> -   BYTE DAA_stage;
> - } TPM_DAA_CONTEXT;
> -+#define sizeof_TPM_DAA_CONTEXT(s) (2 + (3 * 20) + 256 + 1)
> -
> - /*
> -  * TPM_DAA_JOINDATA ([TPM_Part2], Section 22.6)
> -@@ -1998,6 +2001,7 @@ typedef struct tdTPM_DAA_JOINDATA {
> -   BYTE DAA_join_u1[138];
> -   TPM_DIGEST DAA_digest_n0;
> - } TPM_DAA_JOINDATA;
> -+#define sizeof_TPM_DAA_JOINDATA(s) (1 + 1 + 20)
> -
> - /*
> -  * TPM_DAA_BLOB ([TPM_Part2], Section 22.8)
> -@@ -2202,6 +2206,7 @@ typedef struct tdTPM_STCLEAR_DATA {
> -   //UINT32 ownerReference;
> -   //BOOL disableResetLock;
> - } TPM_STCLEAR_DATA;
> -+#define sizeof_TPM_STCLEAR_DATA(s) (2 + 20 + 4)
> -
> - /*
> -  * TPM_SESSION_DATA
> -@@ -2238,6 +2243,11 @@ typedef struct tdTPM_DAA_SESSION_DATA {
> -   TPM_DAA_JOINDATA DAA_joinSession;
> -   TPM_HANDLE handle;
> - } TPM_DAA_SESSION_DATA;
> -+#define sizeof_TPM_DAA_SESSION_DATA(s) ( 1 \
> -+  + sizeof_TPM_DAA_ISSUER(s.DAA_issuerSettings) \
> -+  + sizeof_TPM_DAA_TPM(s.DAA_tpmSpecific) \
> -+  + sizeof_TPM_DAA_CONTEXT(s.DAA_session) \
> -+  + sizeof_TPM_DAA_JOINDATA(s.DAA_joinSession) + 4)
> -
> - /*
> -  * TPM_STANY_DATA ([TPM_Part2], Section 7.6)
> -@@ -2262,6 +2272,11 @@ typedef struct tdTPM_STANY_DATA {
> -   TPM_DAAHANDLE currentDAA;
> -   TPM_TRANSHANDLE transExclusive;
> - } TPM_STANY_DATA;
> -+#define sizeof_TPM_STANY_DATA(s) (2 + 20 + 20 + 1 \
> -+  + sizeof_TPM_CURRENT_TICKS(s.currentTicks) \
> -+  + 4 + (4 * TPM_MAX_SESSION_LIST) \
> -+  + (sizeof_TPM_SESSION_DATA(s.sessions[0]) * TPM_MAX_SESSION_LIST) \
> -+  + (sizeof_TPM_DAA_SESSION_DATA(s.sessionsDAA[0]) * TPM_MAX_SESSIONS_DAA) + 4)
> -
> - /*
> -  * TPM_DATA
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_testing.c tpm_emulator/tpm/tpm_testing.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_testing.c    2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_testing.c     2006-07-24 14:35:35.000000000 -0700
> -@@ -1,6 +1,7 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -95,24 +96,24 @@ static int tpm_test_sha1(void)
> -   struct {
> -     uint8_t *data; uint32_t repetitions; uint8_t *digest;
> -   } test_cases[] =  {{
> --    "abc", 1,
> --    "\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D"
> -+      (uint8_t*)"abc", 1,
> -+    (uint8_t*)"\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D"
> -   }, {
> --    "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 1,
> --    "\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29\xE5\xE5\x46\x70\xF1"
> -+    (uint8_t*)"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 1,
> -+    (uint8_t*)"\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29\xE5\xE5\x46\x70\xF1"
> -   }, {
> --    "a", 1000000,
> --    "\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F"
> -+    (uint8_t*)"a", 1000000,
> -+    (uint8_t*)"\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F"
> -   }, {
> --    "0123456701234567012345670123456701234567012345670123456701234567", 10,
> --    "\xDE\xA3\x56\xA2\xCD\xDD\x90\xC7\xA7\xEC\xED\xC5\xEB\xB5\x63\x93\x4F\x46\x04\x52"
> -+    (uint8_t*)"0123456701234567012345670123456701234567012345670123456701234567", 10,
> -+    (uint8_t*)"\xDE\xA3\x56\xA2\xCD\xDD\x90\xC7\xA7\xEC\xED\xC5\xEB\xB5\x63\x93\x4F\x46\x04\x52"
> -   }};
> -
> -   debug("tpm_test_sha1()");
> -   for (i = 0; i < sizeof(test_cases) / sizeof(test_cases[0]); i++) {
> -     sha1_init(&ctx);
> -     for (j = 0; j < test_cases[i].repetitions; j++)
> --      sha1_update(&ctx, test_cases[i].data, strlen(test_cases[i].data));
> -+      sha1_update(&ctx, test_cases[i].data, strlen((char*)test_cases[i].data));
> -     sha1_final(&ctx, digest);
> -     if (memcmp(digest, test_cases[i].digest, SHA1_DIGEST_LENGTH) != 0) return -1;
> -   }
> -@@ -128,41 +129,41 @@ static int tpm_test_hmac(void)
> -   struct {
> -     uint8_t *key, key_len, *data, data_len, *digest;
> -   } test_cases[] = {{
> --    "\x0b", 20, "Hi There", 8,
> --    "\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"
> -+    (uint8_t*)"\x0b", 20, (uint8_t*)"Hi There", 8,
> -+    (uint8_t*)"\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"
> -   }, {
> --    "Jefe", 4, "what do ya want for nothing?", 28,
> --    "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79"
> -+    (uint8_t*)"Jefe", 4, (uint8_t*)"what do ya want for nothing?", 28,
> -+    (uint8_t*)"\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79"
> -   }, {
> --    "\xaa", 20, "\xdd", 50,
> --    "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3"
> -+    (uint8_t*)"\xaa", 20, (uint8_t*)"\xdd", 50,
> -+    (uint8_t*)"\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3"
> -   }, {
> --    "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
> --    "\x15\x16\x17\x18\x19", 25, "\xcd", 50,
> --    "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda"
> -+    (uint8_t*)"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
> -+    "\x15\x16\x17\x18\x19", 25, (uint8_t*)"\xcd", 50,
> -+    (uint8_t*)"\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda"
> -   }, {
> --    "\x0c", 20, "Test With Truncation", 20,
> --    "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04"
> -+    (uint8_t*)"\x0c", 20, (uint8_t*)"Test With Truncation", 20,
> -+    (uint8_t*)"\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04"
> -   }, {
> --    "\xaa", 80, "Test Using Larger Than Block-Size Key - Hash Key First", 54,
> --    "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12"
> -+    (uint8_t*)"\xaa", 80, (uint8_t*)"Test Using Larger Than Block-Size Key - Hash Key First", 54,
> -+    (uint8_t*)"\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12"
> -   }, {
> --    "\xaa", 80,
> --    "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", 73,
> --    "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91"
> -+    (uint8_t*)"\xaa", 80,
> -+    (uint8_t*)"Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", 73,
> -+    (uint8_t*)"\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91"
> -   }};
> -
> -   debug("tpm_test_hmac()");
> -   for (i = 0; i < sizeof(test_cases) / sizeof(test_cases[0]); i++) {
> --    if (strlen(test_cases[i].key) < test_cases[i].key_len) {
> -+    if (strlen((char*)test_cases[i].key) < test_cases[i].key_len) {
> -       uint8_t key[test_cases[i].key_len];
> -       memset(key, test_cases[i].key[0], test_cases[i].key_len);
> -       hmac_init(&ctx, key, test_cases[i].key_len);
> -     } else {
> -       hmac_init(&ctx, test_cases[i].key, test_cases[i].key_len);
> -     }
> --    for (j = 0; j < test_cases[i].data_len; j += strlen(test_cases[i].data)) {
> --      hmac_update(&ctx, test_cases[i].data, strlen(test_cases[i].data));
> -+    for (j = 0; j < test_cases[i].data_len; j += strlen((char*)test_cases[i].data)) {
> -+      hmac_update(&ctx, test_cases[i].data, strlen((char*)test_cases[i].data));
> -     }
> -     hmac_final(&ctx, digest);
> -     if (memcmp(digest, test_cases[i].digest, SHA1_DIGEST_LENGTH) != 0) return -1;
> -@@ -173,9 +174,9 @@ static int tpm_test_hmac(void)
> - static int tpm_test_rsa_EK(void)
> - {
> -   int res = 0;
> --  char *data = "RSA PKCS #1 v1.5 Test-String";
> -+  uint8_t *data = (uint8_t*)"RSA PKCS #1 v1.5 Test-String";
> -   uint8_t buf[256];
> --  size_t buf_len, data_len = strlen(data);
> -+  size_t buf_len, data_len = strlen((char*)data);
> -   rsa_private_key_t priv_key;
> -   rsa_public_key_t pub_key;
> -
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_ticks.c tpm_emulator/tpm/tpm_ticks.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_ticks.c      2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_ticks.c       2006-07-24 14:35:35.000000000 -0700
> -@@ -1,6 +1,7 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -39,9 +40,7 @@ TPM_RESULT TPM_SetTickType(TPM_TICKTYPE
> - TPM_RESULT TPM_GetTicks(TPM_CURRENT_TICKS *currentTime)
> - {
> -   info("TPM_GetTicks()");
> --  memcpy(currentTime, &tpmData.stany.data.currentTicks,
> --    sizeof(TPM_CURRENT_TICKS));
> --  return TPM_SUCCESS;
> -+  return TPM_DISABLED_CMD;
> - }
> -
> - TPM_RESULT TPM_TickStampBlob(TPM_KEY_HANDLE keyHandle, TPM_NONCE *antiReplay,
> -@@ -49,64 +48,11 @@ TPM_RESULT TPM_TickStampBlob(TPM_KEY_HAN
> -                              TPM_CURRENT_TICKS *currentTicks,
> -                              UINT32 *sigSize, BYTE **sig)
> - {
> --  TPM_RESULT res;
> --  TPM_KEY_DATA *key;
> --  BYTE *info, *p;
> --  UINT32 info_length, length;
> -   info("TPM_TickStampBlob()");
> --  /* get key */
> --  key = tpm_get_key(keyHandle);
> --  if (key == NULL) return TPM_INVALID_KEYHANDLE;
> --  /* verify authorization */
> --  res = tpm_verify_auth(auth1, key->usageAuth, keyHandle);
> --  if (res != TPM_SUCCESS) return res;
> --  if (key->keyUsage != TPM_KEY_SIGNING && key->keyUsage != TPM_KEY_LEGACY
> --      && key->keyUsage != TPM_KEY_IDENTITY) return TPM_INVALID_KEYUSAGE;
> --  /* get current ticks */
> --  TPM_GetTicks(currentTicks);
> --  /* sign data using signature scheme PKCS1_SHA1 and TPM_SIGN_INFO container */
> --  *sigSize = key->key.size >> 3;
> --  *sig = tpm_malloc(*sigSize);
> --  if (*sig == NULL) return TPM_FAIL;
> --  /* setup TPM_SIGN_INFO structure */
> --  info_length = 30 + sizeof(TPM_DIGEST) + sizeof_TPM_CURRENT_TICKS(currentTicks);
> --  info = tpm_malloc(info_length);
> --  if (info == NULL) {
> --    tpm_free(*sig);
> --    return TPM_FAIL;
> --  }
> --  memcpy(&info[0], "\x05\x00TSTP", 6);
> --  memcpy(&info[6], antiReplay->nonce, 20);
> --  *(UINT32*)&info[26] = CPU_TO_BE32(20
> --                        + sizeof_TPM_CURRENT_TICKS(currentTicks));
> --  memcpy(&info[30], digestToStamp->digest, sizeof(TPM_DIGEST));
> --  p = &info[30 + sizeof(TPM_DIGEST)];
> --  length = sizeof_TPM_CURRENT_TICKS(currentTicks);
> --  if (tpm_marshal_TPM_CURRENT_TICKS(&p, &length, currentTicks)
> --      || rsa_sign(&key->key, RSA_SSA_PKCS1_SHA1, info, info_length, *sig)) {
> --    tpm_free(*sig);
> --    tpm_free(info);
> --    return TPM_FAIL;
> --  }
> --  return TPM_SUCCESS;
> -+  return TPM_DISABLED_CMD;
> - }
> -
> - void tpm_update_ticks(void)
> - {
> --  if (tpmData.stany.data.currentTicks.tag == 0) {
> --    tpmData.stany.data.currentTicks.tag = TPM_TAG_CURRENT_TICKS;
> --    tpmData.stany.data.currentTicks.currentTicks += tpm_get_ticks();
> --/* removed since v1.2 rev 94
> --    tpmData.stany.data.currentTicks.tickType = tpmData.permanent.data.tickType;
> --*/
> --    tpm_get_random_bytes(tpmData.stany.data.currentTicks.tickNonce.nonce,
> --      sizeof(TPM_NONCE));
> --    tpmData.stany.data.currentTicks.tickRate = 1;
> --/* removed since v1.2 rev 94
> --    tpmData.stany.data.currentTicks.tickSecurity = TICK_SEC_NO_CHECK;
> --*/
> --  } else {
> --    tpmData.stany.data.currentTicks.currentTicks += tpm_get_ticks();
> --  }
> - }
> -
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_transport.c tpm_emulator/tpm/tpm_transport.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_transport.c  2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_transport.c   2006-07-24 14:35:35.000000000 -0700
> -@@ -189,7 +189,7 @@ static void decrypt_wrapped_command(BYTE
> -     sha1_init(&sha1);
> -     sha1_update(&sha1, auth->nonceEven.nonce, sizeof(auth->nonceEven.nonce));
> -     sha1_update(&sha1, auth->nonceOdd.nonce, sizeof(auth->nonceOdd.nonce));
> --    sha1_update(&sha1, "in", 2);
> -+    sha1_update(&sha1, (BYTE*)"in", 2);
> -     sha1_update(&sha1, secret, sizeof(TPM_SECRET));
> -     j = CPU_TO_BE32(i);
> -     sha1_update(&sha1, (BYTE*)&j, 4);
> -@@ -211,7 +211,7 @@ static void encrypt_wrapped_command(BYTE
> -     sha1_init(&sha1);
> -     sha1_update(&sha1, auth->nonceEven.nonce, sizeof(auth->nonceEven.nonce));
> -     sha1_update(&sha1, auth->nonceOdd.nonce, sizeof(auth->nonceOdd.nonce));
> --    sha1_update(&sha1, "out", 3);
> -+    sha1_update(&sha1, (BYTE*)"out", 3);
> -     sha1_update(&sha1, secret, sizeof(TPM_SECRET));
> -     j = CPU_TO_BE32(i);
> -     sha1_update(&sha1, (BYTE*)&j, 4);
> -diff -uprN orig/tpm_emulator-0.4/tpmd.c tpm_emulator/tpmd.c
> ---- orig/tpm_emulator-0.4/tpmd.c       1969-12-31 16:00:00.000000000 -0800
> -+++ tpm_emulator/tpmd.c        2006-07-24 14:35:35.000000000 -0700
> -@@ -0,0 +1,156 @@
> -+/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -+ * Copyright (C) 2005 INTEL Corp
> -+ *
> -+ * This module is free software; you can redistribute it and/or modify
> -+ * it under the terms of the GNU General Public License as published
> -+ * by the Free Software Foundation; either version 2 of the License,
> -+ * or (at your option) any later version.
> -+ *
> -+ * This module 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.
> -+ *
> -+ */
> -+
> -+#include <stdio.h>
> -+#include <stdlib.h>
> -+#include <unistd.h>
> -+#include <string.h>
> -+#include <sys/types.h>
> -+#include <sys/stat.h>
> -+#include <fcntl.h>
> -+#include <sys/time.h>
> -+
> -+#include "tpm_emulator.h"
> -+
> -+#define TPM_RX_FNAME "/var/tpm/tpm_in.fifo"
> -+#define TPM_TX_FNAME "/var/tpm/tpm_out.fifo"
> -+
> -+#define BUFFER_SIZE 2048
> -+
> -+static int devurandom=0;
> -+
> -+void get_random_bytes(void *buf, int nbytes) {
> -+
> -+  if (devurandom == 0) {
> -+    devurandom = open("/dev/urandom", O_RDONLY);
> -+  }
> -+
> -+  if (read(devurandom, buf, nbytes) != nbytes) {
> -+      printf("Can't get random number.\n");
> -+      exit(-1);
> -+  }
> -+}
> -+
> -+uint64_t tpm_get_ticks(void)
> -+{
> -+  //struct timeval tv;
> -+  //int gettimeofday(&tv, struct timezone *tz);
> -+  return 0;
> -+}
> -+
> -+int main(int argc, char **argv)
> -+{
> -+  uint8_t in[BUFFER_SIZE], *out;
> -+  uint32_t out_size;
> -+  int in_size, written;
> -+  int i;
> -+  struct stat file_info;
> -+
> -+  int tpm_tx_fh=-1, tpm_rx_fh=-1;
> -+  if (argc < 2) {
> -+    printf("Usage: tpmd clear|save|deactivated\n" );
> -+        return -1;
> -+  }
> -+
> -+  /* initialize TPM emulator */
> -+  if (!strcmp(argv[1], "clear")) {
> -+    printf("Initializing tpm: %s\n", argv[1]);
> -+    tpm_emulator_init(1);
> -+  } else if (!strcmp(argv[1], "save")) {
> -+    printf("Initializing tpm: %s\n", argv[1]);
> -+    tpm_emulator_init(2);
> -+  } else if (!strcmp(argv[1], "deactivated")) {
> -+    printf("Initializing tpm: %s\n", argv[1]);
> -+    tpm_emulator_init(3);
> -+  } else {
> -+    printf("invalid startup mode '%s'; must be 'clear', "
> -+      "'save' (default) or 'deactivated", argv[1]);
> -+    return -1;
> -+  }
> -+
> -+  if ( stat(TPM_RX_FNAME, &file_info) == -1) {
> -+    if ( mkfifo(TPM_RX_FNAME, S_IWUSR | S_IRUSR ) ) {
> -+      printf("Failed to create fifo %s.\n", TPM_RX_FNAME);
> -+      return -1;
> -+    }
> -+  }
> -+
> -+  if ( stat(TPM_TX_FNAME, &file_info) == -1) {
> -+    if ( mkfifo(TPM_TX_FNAME, S_IWUSR | S_IRUSR ) ) {
> -+      printf("Failed to create fifo %s.\n", TPM_TX_FNAME);
> -+      return -1;
> -+    }
> -+  }
> -+
> -+  while (1) {
> -+abort_command:
> -+    if (tpm_rx_fh < 0) {
> -+      tpm_rx_fh = open(TPM_RX_FNAME, O_RDONLY);
> -+    }
> -+
> -+    if (tpm_rx_fh < 0) {
> -+      printf("ERROR: failed to open devices to listen to guest.\n");
> -+      return -1;
> -+    }
> -+
> -+    if (tpm_tx_fh < 0) {
> -+      tpm_tx_fh = open(TPM_TX_FNAME, O_WRONLY);
> -+    }
> -+
> -+    if (tpm_tx_fh < 0) {
> -+      printf("ERROR: failed to open devices to respond to guest.\n");
> -+      return -1;
> -+    }
> -+
> -+    in_size = read(tpm_rx_fh, in, BUFFER_SIZE);
> -+    if (in_size < 6) { // Magic size of minium TPM command
> -+      printf("Recv[%d] to small: 0x", in_size);
> -+      if (in_size <= 0) {
> -+          close(tpm_rx_fh);
> -+          tpm_rx_fh = -1;
> -+          goto abort_command;
> -+      }
> -+    } else {
> -+      printf("Recv[%d]: 0x", in_size);
> -+      for (i=0; i< in_size; i++)
> -+        printf("%x ", in[i]);
> -+      printf("\n");
> -+    }
> -+
> -+
> -+    if (tpm_handle_command(in, in_size, &out, &out_size) != 0) {
> -+        printf("ERROR: Handler Failed.\n");
> -+    }
> -+
> -+    written = write(tpm_tx_fh, out, out_size);
> -+
> -+    if (written != out_size ) {
> -+      printf("ERROR: Part of response not written %d/%d.\nAttempt: ", written, out_size);
> -+    } else {
> -+      printf("Sent[%Zu]: ", out_size);
> -+    }
> -+    for (i=0; i< out_size; i++)
> -+      printf("%x ", out[i]);
> -+    printf("\n");
> -+    tpm_free(out);
> -+
> -+  } // loop
> -+
> -+  tpm_emulator_shutdown();
> -+
> -+  close(tpm_tx_fh);
> -+  close(tpm_rx_fh);
> -+
> -+}
> -Binary files orig/tpm_emulator-0.4/tpm_emulator and tpm_emulator/tpm_emulator differ
> -diff -uprN orig/tpm_emulator-0.4/tpm_version.h tpm_emulator/tpm_version.h
> ---- orig/tpm_emulator-0.4/tpm_version.h        2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm_version.h 2006-07-24 14:35:41.000000000 -0700
> -@@ -2,5 +2,5 @@
> - #define _TPM_VERSION_H_
> - #define VERSION_MAJOR 0
> - #define VERSION_MINOR 4
> --#define VERSION_BUILD 1151058734
> -+#define VERSION_BUILD 1153776940
> - #endif /* _TPM_VERSION_H_ */
> diff --git a/tools/vtpm/vtpm-0.5.1-LDLIBS.patch b/tools/vtpm/vtpm-0.5.1-LDLIBS.patch
> deleted file mode 100644
> index 95586c1..0000000
> --- a/tools/vtpm/vtpm-0.5.1-LDLIBS.patch
> +++ /dev/null
> @@ -1,12 +0,0 @@
> -diff -Naurp tpm_emulator-0.5.1/tpmd/Makefile tpm_emulator-0.5.1/tpmd/Makefile
> ---- tpm_emulator-0.5.1/tpmd/Makefile
> -+++ tpm_emulator-0.5.1/tpmd/Makefile
> -@@ -8,7 +8,7 @@ WFLAGS  := -Wall -Wno-unused -Wpointer-a
> -            #WFLAGS  += -Wextra -Wcast-qual -Wmissing-prototypes -Wmissing-declarations -Wstrict-aliasing
> - CFLAGS  += $(WFLAGS) -g -I.. -I. -O2 -fno-strict-aliasing
> - CFLAGS  += -I../../../../tools/vtpm_manager/manager
> --LDFLAGS += -lgmp
> -+LDLIBS  += -lgmp
> -
> - BINDIR  := /usr/bin/
> -
> diff --git a/tools/vtpm/vtpm-0.5.1.patch b/tools/vtpm/vtpm-0.5.1.patch
> deleted file mode 100644
> index 2aeb745..0000000
> --- a/tools/vtpm/vtpm-0.5.1.patch
> +++ /dev/null
> @@ -1,766 +0,0 @@
> -diff -Naurp tpm_emulator-0.5.1/Makefile tpm5-test/Makefile
> ---- tpm_emulator-0.5.1/Makefile        2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/Makefile 2009-07-15 09:45:28.000000000 -0400
> -@@ -10,7 +10,7 @@ VERSION_MINOR  := 5
> - VERSION_BUILD  := $(shell date +"%s")
> - VERSION_SUFFIX := .1
> -
> --SUBDIRS := tpmd tpmd_dev tddl
> -+SUBDIRS := tpmd
> -
> - all: version all-recursive
> -
> -@@ -48,12 +48,12 @@ user_install: user
> - modules_install: modules
> -       @$(MAKE) -C tpmd_dev install || exit -1
> -
> --DIRS    := . tpm crypto tpmd tpmd_dev tddl tpmd_dev_openbsd
> -+DIRS    := . tpm crypto tpmd
> - DISTSRC := $(foreach dir, $(DIRS), $(wildcard $(dir)/*.c))
> - DISTSRC += $(foreach dir, $(DIRS), $(wildcard $(dir)/*.h))
> --DIRS    := . tpmd tpmd_dev tddl tpmd_dev_openbsd
> -+DIRS    := . tpmd
> - DISTSRC += $(foreach dir, $(DIRS), $(dir)/Makefile)
> --DISTSRC += ./README ./AUTHORS ./ChangeLog tpmd_dev/tpmd_dev.rules.in
> -+DISTSRC += ./README ./AUTHORS ./ChangeLog
> - DISTDIR := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_SUFFIX)
> -
> - dist: $(DISTSRC)
> -diff -Naurp tpm_emulator-0.5.1/tpm/tpm_capability.c tpm5-test/tpm/tpm_capability.c
> ---- tpm_emulator-0.5.1/tpm/tpm_capability.c    2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/tpm/tpm_capability.c     2009-07-16 12:04:20.000000000 -0400
> -@@ -136,8 +136,19 @@ static TPM_RESULT cap_property(UINT32 su
> -
> -     case TPM_CAP_PROP_TIS_TIMEOUT:
> -       debug("[TPM_CAP_PROP_TIS_TIMEOUT]");
> --      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT */
> --      return TPM_FAIL;
> -+      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT: Measure these values and determine correct ones */
> -+      UINT32 len = *respSize = 16;
> -+      BYTE *ptr = *resp = tpm_malloc(*respSize);
> -+      if (ptr == NULL ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000)) {
> -+        tpm_free(*resp);
> -+        return TPM_FAIL;
> -+      }
> -+      return TPM_SUCCESS;
> -+
> -
> -     case TPM_CAP_PROP_STARTUP_EFFECT:
> -       debug("[TPM_CAP_PROP_STARTUP_EFFECT]");
> -@@ -189,8 +200,12 @@ static TPM_RESULT cap_property(UINT32 su
> -
> -     case TPM_CAP_PROP_DURATION:
> -       debug("[TPM_CAP_PROP_DURATION]");
> --      /* TODO: TPM_CAP_PROP_DURATION */
> --      return TPM_FAIL;
> -+      /* TODO: TPM_CAP_PROP_DURATION: Measure these values and return accurate ones */
> -+      BYTE dur[]= {0x0,0x0,0x0,0xc,0x0,0x7,0xa1,0x20,0x0,0x1e,0x84,0x80,0x11,0xe1,0xa3,0x0};
> -+      *respSize = 16;
> -+      *resp = tpm_malloc(*respSize);
> -+      memcpy(*resp,dur,16);
> -+
> -
> -     case TPM_CAP_PROP_ACTIVE_COUNTER:
> -       debug("[TPM_CAP_PROP_ACTIVE_COUNTER]");
> -diff -Naurp tpm_emulator-0.5.1/tpmd/Makefile tpm5-test/tpmd/Makefile
> ---- tpm_emulator-0.5.1/tpmd/Makefile   2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/tpmd/Makefile    2009-07-16 12:08:26.000000000 -0400
> -@@ -8,9 +8,10 @@ WFLAGS  := -Wall -Wno-unused -Wpointer-a
> -            -Wwrite-strings -Wsign-compare -Wno-multichar
> -            #WFLAGS  += -Wextra -Wcast-qual -Wmissing-prototypes -Wmissing-declarations -Wstrict-aliasing
> - CFLAGS  += $(WFLAGS) -g -I.. -I. -O2 -fno-strict-aliasing
> -+CFLAGS  += -I../../../../tools/vtpm_manager/manager
> - LDFLAGS += -lgmp
> -
> --BINDIR  := /usr/sbin/
> -+BINDIR  := /usr/bin/
> -
> - TPMD    := tpmd
> - DIRS    := ../tpm ../crypto
> -@@ -18,6 +19,8 @@ SRCS    := $(foreach dir, $(DIRS), $(wil
> - OBJS    := $(patsubst %.c, %.o, $(SRCS))
> - OBJS    := $(foreach dir, $(DIRS), $(patsubst $(dir)/%.o, %.o, $(filter $(dir)/%.o, $(OBJS))))
> -
> -+VTPM_BIN := vtpmd
> -+
> - vpath %.c $(strip $(DIRS))
> -
> - all: $(TPMD)
> -@@ -32,10 +35,8 @@ TPMD_GROUP ?= tss
> - INSTALL    ?= install
> -
> - install: $(TPMD)
> --      $(INSTALL) -m 755 -o $(TPMD_USER) -g $(TPMD_GROUP) -d $(DESTDIR)/var/lib/tpm
> --      $(INSTALL) -m 755 -o $(TPMD_USER) -g $(TPMD_GROUP) -d $(DESTDIR)/var/run/tpm
> -       $(INSTALL) -D -d $(DESTDIR)/$(BINDIR)
> --      $(INSTALL) -m 755 $(TPMD) $(DESTDIR)/$(BINDIR)
> -+      $(INSTALL) -m 755 $(TPMD) $(DESTDIR)/$(BINDIR)/$(VTPM_BIN)
> -
> - .PHONY: all clean install
> -
> -diff -Naurp tpm_emulator-0.5.1/tpmd/tpmd.c tpm5-test/tpmd/tpmd.c
> ---- tpm_emulator-0.5.1/tpmd/tpmd.c     2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/tpmd/tpmd.c      2009-07-16 11:19:05.000000000 -0400
> -@@ -32,6 +32,9 @@
> - #include <grp.h>
> - #include "tpm_emulator_config.h"
> - #include "tpm/tpm_emulator.h"
> -+#include "tpm/tpm_structures.h"
> -+#include "tpm/tpm_marshalling.h"
> -+#include "vtpm_manager.h"
> -
> - #define TPM_DAEMON_NAME     "tpmd"
> - #define TPM_CMD_BUF_SIZE    4096
> -@@ -39,6 +42,24 @@
> - #define TPM_RANDOM_DEVICE   "/dev/urandom"
> - #undef  TPM_MKDIRS
> -
> -+#ifdef VTPM_MULTI_VM
> -+ #define DEV_BE "/dev/vtpm"
> -+ #define DEV_FE "/dev/tpm"
> -+#else
> -+ #define PVM_RX_FIFO_D "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
> -+ #define PVM_TX_FIFO "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
> -+ #define HVM_RX_FIFO_D "/var/vtpm/socks/%d.socket"
> -+
> -+ #define VTPM_RX_FIFO_D "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
> -+ #define VTPM_TX_FIFO "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
> -+
> -+ static char *vtpm_rx_name=NULL;
> -+#endif
> -+
> -+ static int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> -+
> -+#define BUFFER_SIZE 2048
> -+
> - static volatile int stopflag = 0;
> - static int is_daemon = 0;
> - static int opt_debug = 0;
> -@@ -49,6 +70,8 @@ static const char *opt_storage_file = "/
> - static uid_t opt_uid = 0;
> - static gid_t opt_gid = 0;
> - static int tpm_startup = 2;
> -+static int vtpm_type = VTPM_TYPE_PVM;
> -+int dmi_id = 0;
> - static int rand_fh;
> -
> - void tpm_log(int priority, const char *fmt, ...)
> -@@ -90,56 +113,241 @@ uint64_t tpm_get_ticks(void)
> -
> - int tpm_write_to_file(uint8_t *data, size_t data_length)
> - {
> --    int fh;
> --    ssize_t res;
> --    fh = open(opt_storage_file, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> --    if (fh < 0) return -1;
> --    while (data_length > 0) {
> --        res = write(fh, data, data_length);
> --      if (res < 0) {
> --          close(fh);
> --          return -1;
> --      }
> --      data_length -= res;
> --      data += res;
> -+  int res, out_data_size, in_header_size;
> -+  BYTE *ptr, *out_data, *in_header;
> -+  UINT32 result, len, in_rsp_size;
> -+  UINT16 tag = VTPM_TAG_REQ;
> -+
> -+  printf("Saving NVM\n");
> -+  if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> -+#else
> -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_tx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Send request to VTPM Manager to encrypt data
> -+#ifdef VTPM_MUTLI_VM
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT + data_length;
> -+#else
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV + data_length;
> -+#endif
> -+
> -+  out_data = ptr = (BYTE *) malloc(len);
> -+
> -+  if (ptr == NULL
> -+#ifndef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> -+#endif
> -+        || tpm_marshal_UINT16(&ptr, &len, tag)
> -+#ifdef VTPM_MUTLI_VM
> -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> -+#else
> -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> -+#endif
> -+        || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_SAVENVM)
> -+        || tpm_marshal_BYTE_ARRAY(&ptr, &len, data, data_length)) {
> -+      free(out_data);
> -+      return -1;
> -+  }
> -+
> -+  printf("\tSending SaveNVM Command.\n");
> -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> -+  free(out_data);
> -+  if (res != out_data_size) return -1;
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_rx_fh = vtpm_tx_fh
> -+#else
> -+    if (vtpm_rx_name == NULL) {
> -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> -     }
> --    close(fh);
> --    return 0;
> -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Read Header of response so we can get the size & status
> -+#ifdef VTPM_MUTLI_VM
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  in_header = ptr = malloc(in_header_size);
> -+
> -+  printf("\tReading SaveNVM header.\n");
> -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> -+
> -+  if ( (res != in_header_size)
> -+#ifndef VTPM_MUTLI_VM
> -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> -+#endif
> -+         || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> -+         || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> -+         || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> -+        free(in_header);
> -+        return -1;
> -+  }
> -+  free(in_header);
> -+
> -+  if (result != VTPM_SUCCESS) {
> -+      return -1;
> -+  }
> -+
> -+#ifdef VTPM_MUTLI_VM
> -+  close(vtpm_tx_fh); close(vtpm_rx_fh);
> -+#endif
> -+
> -+  printf("\tFinishing up SaveNVM\n");
> -+  return (0);
> - }
> -
> - int tpm_read_from_file(uint8_t **data, size_t *data_length)
> - {
> --    int fh;
> --    ssize_t res;
> --    size_t total_length;
> --    fh = open(opt_storage_file, O_RDONLY);
> --    if (fh < 0) return -1;
> --    total_length = lseek(fh, 0, SEEK_END);
> --    lseek(fh, 0, SEEK_SET);
> --    *data = tpm_malloc(total_length);
> --    if (*data == NULL) {
> --        close(fh);
> --        return -1;
> --    }
> --    *data_length = 0;
> --    while (total_length > 0) {
> --        res = read(fh, &(*data)[*data_length], total_length);
> --      if (res < 0) {
> --          close(fh);
> --          tpm_free(*data);
> --          return -1;
> --      }
> --        *data_length += res;
> --      total_length -= res;
> -+  int res, out_data_size, in_header_size;
> -+  uint8_t *ptr, *out_data, *in_header;
> -+  UINT16 tag = VTPM_TAG_REQ;
> -+  UINT32 len, in_rsp_size, result;
> -+#ifdef VTPM_MUTLI_VM
> -+      int vtpm_rx_fh, vtpm_tx_fh;
> -+#endif
> -+
> -+  printf("Loading NVM.\n");
> -+  if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> -+#else
> -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_tx_fh < 0) {
> -+      printf("Error in read_from_file:301\n");
> -+              return -1;
> -+  }
> -+
> -+  // Send request to VTPM Manager to encrypt data
> -+#ifdef VTPM_MUTLI_VM
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  out_data = ptr = (BYTE *) malloc(len);
> -+
> -+  if (ptr == NULL
> -+#ifndef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> -+#endif
> -+      || tpm_marshal_UINT16(&ptr, &len, tag)
> -+#ifdef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> -+#else
> -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> -+#endif
> -+      || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_LOADNVM)) {
> -+    free(out_data);
> -+    printf("Error in read_from_file:325\n");
> -+
> -+    return -1;
> -+  }
> -+
> -+  printf("\tSending LoadNVM command\n");
> -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> -+  free(out_data);
> -+  if (res != out_data_size)
> -+    {
> -+      printf("Error in read_from_file:335\n");
> -+      return -1;
> -+    }
> -+
> -+    if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_rx_fh = vtpm_tx_fh;
> -+#else
> -+    if (vtpm_rx_name == NULL) {
> -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> -     }
> --    close(fh);
> --    return 0;
> -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+      printf("Error in read_from_file:352\n");
> -+      return -1;
> -+  }
> -+
> -+  // Read Header of response so we can get the size & status
> -+#ifdef VTPM_MUTLI_VM
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  in_header = ptr = malloc(in_header_size);
> -+
> -+  printf("\tReading LoadNVM header\n");
> -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> -+
> -+  if ( (res != in_header_size)
> -+#ifndef VTPM_MUTLI_VM
> -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> -+#endif
> -+       || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> -+       || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> -+       || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> -+      free(in_header);
> -+      printf("Error in read_from_file:375\n");
> -+      return -1;
> -+  }
> -+  free(in_header);
> -+
> -+  if (result != VTPM_SUCCESS) {
> -+    printf("Error in read_from_file:381\n");
> -+    return -1;
> -+  }
> -+
> -+  // Read Encrypted data from VTPM Manager
> -+  *data_length = in_rsp_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> -+  *data = (uint8_t *) malloc(*data_length);
> -+
> -+  printf("\tReading clear data from LoadNVM.\n");
> -+  res = read(vtpm_rx_fh, *data, *data_length);
> -+#ifdef VTPM_MUTLI_VM
> -+  close(vtpm_rx_fh);close(vtpm_tx_fh);
> -+#endif
> -+
> -+  printf("\tReturing from loading NVM\n");
> -+  if (res != (int)*data_length) {
> -+      free(*data);
> -+      printf("Error in read_from_file:398\n");
> -+      return -1;
> -+  } else {
> -+      return 0;
> -+  }
> -+
> -+
> -+
> - }
> -
> - static void print_usage(char *name)
> - {
> -     printf("usage: %s [-d] [-f] [-s storage file] [-u unix socket name] "
> --           "[-o user name] [-g group name] [-h] [startup mode]\n", name);
> -+           "[-o user name] [-g group name] [-h]"
> -+#ifdef VTPM_MULTI_VM
> -+         "clear|save|deactivated\n", name);
> -+#else
> -+         "clear|save|deactivated pvm|hvm vtpmid\n", name);
> -+#endif
> -     printf("  d : enable debug mode\n");
> -     printf("  f : forces the application to run in the foreground\n");
> -     printf("  s : storage file to use (default: %s)\n", opt_storage_file);
> -@@ -205,7 +413,13 @@ static void parse_options(int argc, char
> -                 exit(EXIT_SUCCESS);
> -         }
> -     }
> --    if (optind < argc) {
> -+    /*Make sure we have all required options*/
> -+#ifdef VTPM_MULTI_VM
> -+#define EXTRA_OPTS 0
> -+#else
> -+#define EXTRA_OPTS 2
> -+#endif
> -+    if (optind < argc - EXTRA_OPTS ) {
> -         debug("startup mode = '%s'", argv[optind]);
> -         if (!strcmp(argv[optind], "clear")) {
> -             tpm_startup = 1;
> -@@ -219,6 +433,25 @@ static void parse_options(int argc, char
> -             print_usage(argv[0]);
> -             exit(EXIT_SUCCESS);
> -         }
> -+#ifndef VTPM_MULTI_VM
> -+        ++optind;
> -+      if(!strcmp(argv[optind], "pvm")) {
> -+              vtpm_type = VTPM_TYPE_PVM;      // Get commands from vTPM Manager through fifo
> -+      } else if (!strcmp(argv[optind], "hvm")) {
> -+              vtpm_type = VTPM_TYPE_HVM;      // Get commands from qemu via socket
> -+        } else {
> -+              error("Invalid vm mode '%s'; must be 'pvm', "
> -+                      "or 'hvm' ", argv[optind]);
> -+              print_usage(argv[0]);
> -+              exit(EXIT_SUCCESS);
> -+      }
> -+        ++optind;
> -+      dmi_id = atoi(argv[optind]);
> -+#endif
> -+    } else {
> -+      error("Invalid number of arguments");
> -+      print_usage(argv[0]);
> -+      exit(EXIT_SUCCESS);
> -     }
> - }
> -
> -@@ -348,93 +581,180 @@ static int init_socket(const char *name)
> -
> - static void main_loop(void)
> - {
> --    int sock, fh, res;
> --    int32_t in_len;
> -+    int32_t in_len, written;
> -     uint32_t out_len;
> --    uint8_t in[TPM_CMD_BUF_SIZE], *out;
> -+    uint8_t in[TPM_CMD_BUF_SIZE], *out, *addressed_out;
> -+    int guest_id=-1;
> -+    int i;
> -+    char *vtpm_rx_file=NULL;
> -+    int res;
> -+
> -+#ifndef VTPM_MULTI_VM
> -+    int sockfd = -1;
> -     struct sockaddr_un addr;
> --    socklen_t addr_len;
> --    fd_set rfds;
> --    struct timeval tv;
> -+    struct sockaddr_un client_addr;
> -+    unsigned int client_length;
> -+#endif
> -+
> -+    int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> -+
> -+#ifndef VTPM_MULTI_VM
> -+  if (vtpm_type == VTPM_TYPE_PVM) {
> -+    vtpm_rx_file = malloc(10 + strlen(PVM_RX_FIFO_D));
> -+    sprintf(vtpm_rx_file, PVM_RX_FIFO_D, (uint32_t) dmi_id);
> -+  } else {
> -+    vtpm_rx_file = malloc(10 + strlen(HVM_RX_FIFO_D));
> -+    sprintf(vtpm_rx_file, HVM_RX_FIFO_D, (uint32_t) dmi_id);
> -+
> -+    if ( (sockfd = socket(PF_UNIX,SOCK_STREAM,0)) < 0) {
> -+          error("Unable to create socket. errno = %d\n", errno);
> -+      exit (-1);
> -+    }
> -+
> -+    memset(&addr, 0, sizeof(addr));
> -+    addr.sun_family = AF_UNIX;
> -+    strcpy(addr.sun_path,vtpm_rx_file );
> -+    unlink(addr.sun_path);
> -+  }
> -+#endif
> -
> -     info("staring main loop");
> --    /* open UNIX socket */
> --    sock = init_socket(opt_socket_name);
> --    if (sock < 0) exit(EXIT_FAILURE);
> -     /* init tpm emulator */
> --    debug("initializing TPM emulator: %d", tpm_startup);
> -+#ifdef VTPM_MULTI_VM
> -+    debug("initializing TPM emulator: state=%d", tpm_startup);
> -+#else
> -+    debug("initializing TPM emulator: state=%d, type=%d, id=%d", tpm_startup, vtpm_type, dmi_id);
> -+#endif
> -     tpm_emulator_init(tpm_startup);
> -     /* start command processing */
> -     while (!stopflag) {
> -         /* wait for incomming connections */
> -         debug("waiting for connections...");
> --        FD_ZERO(&rfds);
> --        FD_SET(sock, &rfds);
> --        tv.tv_sec = 10;
> --        tv.tv_usec = 0;
> --        res = select(sock + 1, &rfds, NULL, NULL, &tv);
> --        if (res < 0) {
> --            error("select(sock) failed: %s", strerror(errno));
> --            break;
> --        } else if (res == 0) {
> --            continue;
> --        }
> --        addr_len = sizeof(addr);
> --        fh = accept(sock, (struct sockaddr*)&addr, &addr_len);
> --        if (fh < 0) {
> --            error("accept() failed: %s", strerror(errno));
> --            continue;
> --        }
> -+      if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+          vtpm_rx_fh = open(DEV_BE, O_RDWR);
> -+#else
> -+          if (vtpm_type == VTPM_TYPE_PVM)
> -+          {
> -+              vtpm_rx_fh = open(vtpm_rx_file, O_RDONLY);
> -+          } else {
> -+              if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
> -+                  error("Unable to bind(). errno = %d\n", errno);
> -+                  exit (-1);
> -+              }
> -+
> -+              if (listen(sockfd, 10) <0) {
> -+                  error("Unable to listen(). errno = %d\n", errno);
> -+                  exit (-1);
> -+              }
> -+
> -+               memset(&client_addr, 0, sizeof(client_addr));
> -+               client_length = sizeof(client_addr);
> -+
> -+               vtpm_rx_fh = vtpm_tx_fh = accept(sockfd, (struct sockaddr *)&client_addr, &client_length);
> -+          }
> -+#endif
> -+      }
> -+
> -+      /*Error Checking*/
> -+      if (vtpm_rx_fh < 0) {
> -+        error("Failed to open devices to listen to guest.\n");
> -+        exit(-1);
> -+      }
> -+
> -         /* receive and handle commands */
> -         in_len = 0;
> -         do {
> -             debug("waiting for commands...");
> --            FD_ZERO(&rfds);
> --            FD_SET(fh, &rfds);
> --            tv.tv_sec = TPM_COMMAND_TIMEOUT;
> --            tv.tv_usec = 0;
> --            res = select(fh + 1, &rfds, NULL, NULL, &tv);
> --            if (res < 0) {
> --                error("select(fh) failed: %s", strerror(errno));
> --                close(fh);
> --                break;
> --            } else if (res == 0) {
> --#ifdef TPMD_DISCONNECT_IDLE_CLIENTS
> --                info("connection closed due to inactivity");
> --                close(fh);
> --                break;
> --#else
> --                continue;
> --#endif
> --            }
> --            in_len = read(fh, in, sizeof(in));
> --            if (in_len > 0) {
> -+
> -+            in_len = read(vtpm_rx_fh, in, sizeof(in));
> -+          /*Magic size of minimum TPM command is 6*/
> -+              //FIXME Magic size check may not be required anymore
> -+            if (in_len < 6) {
> -+              info("Recv incomplete command of %d bytes.", in_len);
> -+              if (in_len <= 0) {
> -+                  close(vtpm_rx_fh);
> -+                  vtpm_rx_fh = -1;
> -+                  continue;
> -+                 }
> -+          } else {
> -+              /*Debug Printouts*/
> -                 debug("received %d bytes", in_len);
> -+              debug_nostop("Recv[%d]: 0x", in_len);
> -+              for (i=0; i< in_len; i++)
> -+                  debug_more("%x ", in[i]);
> -+              debug_more("\n");
> -+              /*Multiple Guest check*/
> -+              if (guest_id == -1) {
> -+                  guest_id = *((int32_t *) in);
> -+              } else {
> -+                  if (guest_id != *((int32_t *) in) ) {
> -+                      error("WARNING: More than one guest attached\n");
> -+                  }
> -+              }
> -+
> -+              /*Open tx handle now*/
> -+              if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+                  vtpm_tx_fh = open(DEV_BE, O_RDWR);
> -+                  vtpm_rx_fh = vtpm_tx_fh;
> -+#else
> -+                  if (vtpm_type == VTPM_TYPE_PVM) {
> -+                      vtpm_tx_fh = open(PVM_TX_FIFO, O_WRONLY);
> -+                  } // No need to open the other direction for HVM
> -+#endif
> -+              }
> -+              if (vtpm_tx_fh < 0) {
> -+                error("Failed to open devices to respond to guest.\n");
> -+                exit(-1);
> -+              }
> -+
> -+              /*Handle the TPM command now*/
> -                 out = NULL;
> --                res = tpm_handle_command(in, in_len, &out, &out_len);
> -+                res = tpm_handle_command(in + sizeof(uint32_t), in_len - sizeof(uint32_t), &out, &out_len);
> -                 if (res < 0) {
> -                     error("tpm_handle_command() failed");
> -                 } else {
> -                     debug("sending %d bytes", out_len);
> -+                  //FIXME this prepending may or may not be needed
> -+                  /*Prepend the first 4 bytes of the in buffer.. why?*/
> -+                  addressed_out = (uint8_t *) tpm_malloc(sizeof(uint32_t) + out_len);
> -+                  *(uint32_t *) addressed_out = *(uint32_t *) in;
> -+                  memcpy(addressed_out + sizeof(uint32_t), out, out_len);
> -+                  out_len += sizeof(uint32_t);
> -+                  /*End Prepend*/
> -+
> -+                  /*Perform write operation now*/
> -                     while (out_len > 0) {
> --                        res = write(fh, out, out_len);
> -+                        res = write(vtpm_tx_fh, addressed_out, out_len);
> -+
> -                         if (res < 0) {
> -                             error("write(%d) failed: %s", out_len, strerror(errno));
> -                             break;
> --                        }
> -+                        } else {
> -+                        debug_nostop("Sent[%Zu]: ", out_len);
> -+                        for (i=0; (unsigned int)i< out_len; i++)
> -+                          debug_more("%x ", addressed_out[i]);
> -+                        debug_more("\n");
> -+                      }
> -                         out_len       -= res;
> -                     }
> -                     tpm_free(out);
> -+                  tpm_free(addressed_out);
> -                 }
> -             }
> -         } while (in_len > 0);
> --        close(fh);
> -+        //close(fh);
> -     }
> -+
> -     /* shutdown tpm emulator */
> -     tpm_emulator_shutdown();
> --    /* close socket */
> --    close(sock);
> --    unlink(opt_socket_name);
> -+    /* Close handles */
> -+    close(vtpm_tx_fh);
> -+#ifndef VTPM_MULTI_VM
> -+    close(vtpm_rx_fh);
> -+    free(vtpm_rx_file);
> -+#endif
> -     info("main loop stopped");
> - }
> -
> -@@ -450,12 +770,13 @@ int main(int argc, char **argv)
> -     /* open random device */
> -     init_random();
> -     /* init signal handlers */
> --    init_signal_handler();
> -+    //init_signal_handler();
> -     /* unless requested otherwiese, fork and daemonize process */
> --    if (!opt_foreground) daemonize();
> -+    //if (!opt_foreground) daemonize();
> -     /* start main processing loop */
> -     main_loop();
> -     info("stopping TPM Emulator daemon");
> -     closelog();
> -     return 0;
> - }
> -+
> -diff -Naurp tpm_emulator-0.5.1/tpmd/tpm_emulator_config.h tpm5-test/tpmd/tpm_emulator_config.h
> ---- tpm_emulator-0.5.1/tpmd/tpm_emulator_config.h      2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/tpmd/tpm_emulator_config.h       2009-07-16 11:25:26.000000000 -0400
> -@@ -29,23 +29,28 @@
> -
> - /* TPM emulator configuration */
> -
> --#undef  TPM_STRONG_PERSISTENCE
> --#undef  TPM_GENERATE_EK
> -+#define  TPM_STRONG_PERSISTENCE
> -+#define  TPM_GENERATE_EK
> - #undef  TPM_GENERATE_SEED_DAA
> - #undef  TPM_MEMORY_ALIGNMENT_MANDATORY
> -
> -+extern int dmi_id;
> -+
> - /* log macros */
> -
> - void tpm_log(int priority, const char *fmt, ...);
> -
> --#define debug(fmt, ...) tpm_log(LOG_DEBUG, "%s:%d: Debug: " fmt "\n", \
> --                                __FILE__, __LINE__, ## __VA_ARGS__)
> --#define info(fmt, ...)  tpm_log(LOG_INFO, "%s:%d: Info: " fmt "\n", \
> --                                __FILE__, __LINE__, ## __VA_ARGS__)
> --#define error(fmt, ...) tpm_log(LOG_ERR, "%s:%d: Error: " fmt "\n", \
> --                                __FILE__, __LINE__, ## __VA_ARGS__)
> --#define alert(fmt, ...) tpm_log(LOG_ALERT, "%s:%d: Alert: " fmt "\n", \
> --                                __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug(fmt, ...) tpm_log(LOG_DEBUG, "VTPMD[%d]: %s:%d: Debug: " fmt "\n", \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define info(fmt, ...)  tpm_log(LOG_INFO, "VTPMD[%d]: %s:%d: Info: " fmt "\n", \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define error(fmt, ...) tpm_log(LOG_ERR, "VTPMD[%d]: %s:%d: Error: " fmt "\n", \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define alert(fmt, ...) tpm_log(LOG_ALERT, "VTPMD[%d]: %s:%d: Alert: " fmt "\n", \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug_nostop(fmt, ...) tpm_log(LOG_DEBUG, "VTPMD[%d]: %s:%d: Debug: " fmt, \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug_more(fmt, ...) tpm_log(LOG_DEBUG, fmt, ## __VA_ARGS__)
> -
> - /*  min/max macros that also do strict type-checking */
> -
> diff --git a/tools/vtpm/vtpm.patch b/tools/vtpm/vtpm.patch
> deleted file mode 100644
> index e896b25..0000000
> --- a/tools/vtpm/vtpm.patch
> +++ /dev/null
> @@ -1,716 +0,0 @@
> -diff -uprN tpm_emulator/AUTHORS vtpm/AUTHORS
> ---- tpm_emulator/AUTHORS       2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/AUTHORS       2006-12-13 16:38:52.000000000 -0800
> -@@ -1,3 +1,3 @@
> - Mario Strasser <mast@gmx.net>
> - Heiko Stamer <stamer@gaos.org> [DAA]
> --INTEL Corp <> [Dropped to Ring3]
> -+INTEL Corp <> [VTPM Extensions]
> -diff -uprN tpm_emulator/ChangeLog vtpm/ChangeLog
> ---- tpm_emulator/ChangeLog     2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/ChangeLog     2006-12-13 16:38:52.000000000 -0800
> -@@ -1,5 +1,6 @@
> - ????-??-?? Intel Corp
> -       * Moved module out of kernel to run as a ring 3 app
> -+      * Modified save_to_file and load_from_file to call xen VTPM manager
> -
> - 2006-06-23  Mario Strasser <mast@gmx.net>
> -       * tpm_startup.c: behaviour of ST_CLEAR and storage of
> -diff -uprN tpm_emulator/linux_module.h vtpm/linux_module.h
> ---- tpm_emulator/linux_module.h        2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/linux_module.h        2007-01-09 14:49:06.000000000 -0800
> -@@ -44,18 +44,26 @@
> - #define TPM_DEVICE_NAME   "tpm"
> - #define TPM_MODULE_NAME   "tpm_emulator"
> -
> -+/* debug and log output functions */
> -+extern int dmi_id;
> -+
> - #ifdef DEBUG
> --#define debug(fmt, ...) printf("TPMD: %s:%d: Debug: " fmt "\n", \
> --                        __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug(fmt, ...) printf("TPMD[%d]: %s:%d: Debug: " fmt "\n", \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug_nostop(fmt, ...) printf("TPMD[%d]: %s:%d: Debug: " fmt, \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug_more(fmt, ...) printf( fmt, ## __VA_ARGS__ )
> - #else
> - #define debug(fmt, ...)
> -+#define debug_nostop(fmt, ...)
> -+#define debug_more(fmt, ...)
> - #endif
> --#define info(fmt, ...)  printf("TPMD: %s:%d: Info: " fmt "\n", \
> --                        __FILE__, __LINE__, ## __VA_ARGS__)
> --#define error(fmt, ...) printf("TPMD: %s:%d: Error: " fmt "\n", \
> --                        __FILE__, __LINE__, ## __VA_ARGS__)
> --#define alert(fmt, ...) printf("TPMD: %s:%d: Alert: " fmt "\n", \
> --                        __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define info(fmt, ...)  printf("TPMD[%d]: %s:%d: Info: " fmt "\n", \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define error(fmt, ...) printf("TPMD[%d]: %s:%d: Error: " fmt "\n", \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define alert(fmt, ...) printf("TPMD[%d]: %s:%d: Alert: " fmt "\n", \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -
> - /* memory allocation */
> -
> -diff -uprN tpm_emulator/Makefile vtpm/Makefile
> ---- tpm_emulator/Makefile      2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/Makefile      2006-12-13 16:38:52.000000000 -0800
> -@@ -7,7 +7,7 @@
> - COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
> -
> - # module settings
> --BIN            := tpm_emulator
> -+BIN            := vtpmd
> - VERSION_MAJOR  := 0
> - VERSION_MINOR  := 4
> - VERSION_BUILD  := $(shell date +"%s")
> -@@ -22,7 +22,7 @@ TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin
> -
> - CC      := gcc
> - CFLAGS  += -g -Wall $(INCLUDE) -DDEBUG
> --CFLAGS  += -I. -Itpm
> -+CFLAGS  += -I. -Itpm -I../../vtpm_manager/manager
> -
> - # Is the simulator running in it's own vm?
> - #CFLAGS += -DVTPM_MULTI_VM
> -@@ -62,7 +62,6 @@ $(BIN):      $(src)/crypto/gmp.h $(src)/crypt
> -
> - install: $(BIN)
> -       $(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)
> --      @if [ ! -d "/var/tpm" ]; then mkdir /var/tpm; fi
> -
> - clean:
> -       rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a $(OBJS)
> -@@ -98,3 +97,4 @@ version:
> -       @echo "#endif /* _TPM_VERSION_H_ */" >> $(src)/tpm_version.h
> -
> - .PHONY: all install clean dist gmp version
> -+
> -diff -uprN tpm_emulator/tpm/tpm_capability.c vtpm/tpm/tpm_capability.c
> ---- tpm_emulator/tpm/tpm_capability.c  2006-06-23 03:37:07.000000000 -0700
> -+++ vtpm/tpm/tpm_capability.c  2007-01-10 10:00:49.000000000 -0800
> -@@ -136,8 +136,18 @@ static TPM_RESULT cap_property(UINT32 su
> -
> -     case TPM_CAP_PROP_TIS_TIMEOUT:
> -       debug("[TPM_CAP_PROP_TIS_TIMEOUT]");
> --      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT */
> --      return TPM_FAIL;
> -+      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT: Measure these values and determine correct ones */
> -+      UINT32 len = *respSize = 16;
> -+      BYTE *ptr = *resp = tpm_malloc(*respSize);
> -+      if (ptr == NULL ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000)) {
> -+        tpm_free(*resp);
> -+        return TPM_FAIL;
> -+      }
> -+      return TPM_SUCCESS;
> -
> -     case TPM_CAP_PROP_STARTUP_EFFECT:
> -       debug("[TPM_CAP_PROP_STARTUP_EFFECT]");
> -@@ -190,7 +200,11 @@ static TPM_RESULT cap_property(UINT32 su
> -
> -     case TPM_CAP_PROP_DURATION:
> -       debug("[TPM_CAP_PROP_DURATION]");
> --      /* TODO: TPM_CAP_PROP_DURATION */
> -+      /* TODO: TPM_CAP_PROP_DURATION: Measure these values and return accurate ones */
> -+      BYTE dur[]= {0x0,0x0,0x0,0xc,0x0,0x7,0xa1,0x20,0x0,0x1e,0x84,0x80,0x11,0xe1,0xa3,0x0};
> -+      *respSize = 16;
> -+      *resp = tpm_malloc(*respSize);
> -+      memcpy(*resp,dur,16);
> -       return TPM_FAIL;
> -
> -     case TPM_CAP_PROP_ACTIVE_COUNTER:
> -diff -uprN tpm_emulator/tpm/tpm_cmd_handler.c vtpm/tpm/tpm_cmd_handler.c
> ---- tpm_emulator/tpm/tpm_cmd_handler.c 2008-02-27 16:35:41.000000000 -0500
> -+++ vtpm/tpm/tpm_cmd_handler.c 2008-02-28 14:43:28.000000000 -0500
> -@@ -94,12 +94,18 @@ void tpm_compute_out_param_digest(TPM_CO
> -   sha1_ctx_t sha1;
> -   UINT32 res = CPU_TO_BE32(rsp->result);
> -   UINT32 ord = CPU_TO_BE32(ordinal);
> -+  UINT32 offset = 0;
> -
> -   /* compute SHA1 hash */
> -   sha1_init(&sha1);
> -   sha1_update(&sha1, (BYTE*)&res, 4);
> -   sha1_update(&sha1, (BYTE*)&ord, 4);
> --  sha1_update(&sha1, rsp->param, rsp->paramSize);
> -+  if (ordinal == TPM_ORD_LoadKey2) {
> -+      offset = 4;
> -+  }
> -+  if (rsp->paramSize - offset > 0) {
> -+      sha1_update(&sha1, rsp->param + offset, rsp->paramSize - offset);
> -+  }
> -   sha1_final(&sha1, rsp->auth1->digest);
> -   if (rsp->auth2 != NULL) memcpy(rsp->auth2->digest,
> -     rsp->auth1->digest, sizeof(rsp->auth1->digest));
> -diff -uprN tpm_emulator/tpm/tpm_data.c vtpm/tpm/tpm_data.c
> ---- tpm_emulator/tpm/tpm_data.c        2008-02-27 16:35:41.000000000 -0500
> -+++ vtpm/tpm/tpm_data.c        2008-02-27 16:35:40.000000000 -0500
> -@@ -1,6 +1,7 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -15,10 +16,15 @@
> -  * $Id: tpm_data.c 98 2006-05-07 14:16:29Z hstamer $
> -  */
> -
> -+#include <sys/types.h>
> -+#include <sys/stat.h>
> -+#include <fcntl.h>
> -+#include <unistd.h>
> -+
> - #include "tpm_emulator.h"
> - #include "tpm_structures.h"
> - #include "tpm_marshalling.h"
> --#include "linux_module.h"
> -+#include "vtpm_manager.h"
> -
> - TPM_DATA tpmData;
> -
> -@@ -158,45 +164,232 @@ void tpm_release_data(void)
> - #include <sys/types.h>
> - #include <sys/stat.h>
> - #include <fcntl.h>
> --#include <unistd.h>
> -
> --#define TPM_STORAGE_FILE "/var/tpm/tpm_emulator-1.2." STR(VERSION_MAJOR) "." STR(VERSION_MINOR)
> -+ static int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> -+
> -+#ifdef VTPM_MUTLI_VM
> -+ #define DEV_FE "/dev/tpm"
> -+#else
> -+ #define VTPM_RX_FIFO_D  "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
> -+ #define VTPM_TX_FIFO  "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
> -+
> -+ extern int dmi_id;
> -+ static char *vtpm_rx_name=NULL;
> -+#endif
> -
> - static int write_to_file(uint8_t *data, size_t data_length)
> - {
> --  int res;
> --  int fp;
> --  fp = open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> --  res = write(fp, data, data_length);
> --  close(fp);
> --  return (res == data_length) ? 0 : -1;
> -+  int res, out_data_size, in_header_size;
> -+  BYTE *ptr, *out_data, *in_header;
> -+  UINT32 result, len, in_rsp_size;
> -+  UINT16 tag = VTPM_TAG_REQ;
> -+
> -+  printf("Saving NVM\n");
> -+  if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> -+#else
> -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_tx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Send request to VTPM Manager to encrypt data
> -+#ifdef VTPM_MUTLI_VM
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT + data_length;
> -+#else
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV + data_length;
> -+#endif
> -+
> -+  out_data = ptr = (BYTE *) malloc(len);
> -+
> -+  if (ptr == NULL
> -+#ifndef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> -+#endif
> -+        || tpm_marshal_UINT16(&ptr, &len, tag)
> -+#ifdef VTPM_MUTLI_VM
> -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> -+#else
> -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> -+#endif
> -+        || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_SAVENVM)
> -+        || tpm_marshal_BYTE_ARRAY(&ptr, &len, data, data_length)) {
> -+      free(out_data);
> -+      return -1;
> -+  }
> -+
> -+  printf("\tSending SaveNVM Command.\n");
> -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> -+  free(out_data);
> -+  if (res != out_data_size) return -1;
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_rx_fh = vtpm_tx_fh
> -+#else
> -+    if (vtpm_rx_name == NULL) {
> -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> -+    }
> -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Read Header of response so we can get the size & status
> -+#ifdef VTPM_MUTLI_VM
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  in_header = ptr = malloc(in_header_size);
> -+
> -+  printf("\tReading SaveNVM header.\n");
> -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> -+
> -+  if ( (res != in_header_size)
> -+#ifndef VTPM_MUTLI_VM
> -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> -+#endif
> -+         || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> -+         || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> -+         || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> -+        free(in_header);
> -+        return -1;
> -+  }
> -+  free(in_header);
> -+
> -+  if (result != VTPM_SUCCESS) {
> -+      return -1;
> -+  }
> -+
> -+#ifdef VTPM_MUTLI_VM
> -+  close(vtpm_tx_fh); close(vtpm_rx_fh);
> -+#endif
> -+
> -+  printf("\tFinishing up SaveNVM\n");
> -+  return (0);
> - }
> -
> - static int read_from_file(uint8_t **data, size_t *data_length)
> - {
> --  int res;
> --  int fp, file_status;
> --  struct stat file_info;
> --  fp = open(TPM_STORAGE_FILE, O_RDONLY, 0);
> --  file_status = fstat(fp, &file_info);
> --  if (file_status < 0) {
> --    close(fp);
> --    return -1;
> --  }
> -+  int res, out_data_size, in_header_size;
> -+  uint8_t *ptr, *out_data, *in_header;
> -+  UINT16 tag = VTPM_TAG_REQ;
> -+  UINT32 len, in_rsp_size, result;
> -+#ifdef VTPM_MUTLI_VM
> -+      int vtpm_rx_fh, vtpm_tx_fh;
> -+#endif
> -+
> -+  printf("Loading NVM.\n");
> -+  if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> -+#else
> -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> -+#endif
> -+  }
> -
> --  *data_length = file_info.st_size;
> --  *data = tpm_malloc(*data_length);
> --  if (*data == NULL) {
> --    close(fp);
> -+  if (vtpm_tx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Send request to VTPM Manager to encrypt data
> -+#ifdef VTPM_MUTLI_VM
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  out_data = ptr = (BYTE *) malloc(len);
> -+
> -+  if (ptr == NULL
> -+#ifndef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> -+#endif
> -+      || tpm_marshal_UINT16(&ptr, &len, tag)
> -+#ifdef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> -+#else
> -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> -+#endif
> -+      || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_LOADNVM)) {
> -+    free(out_data);
> -     return -1;
> -   }
> --  res = read(fp, *data, *data_length);
> --  close(fp);
> -+
> -+  printf("\tSending LoadNVM command\n");
> -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> -+  free(out_data);
> -+  if (res != out_data_size) return -1;
> -+
> -+    if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_rx_fh = vtpm_tx_fh;
> -+#else
> -+    if (vtpm_rx_name == NULL) {
> -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> -+    }
> -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Read Header of response so we can get the size & status
> -+#ifdef VTPM_MUTLI_VM
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  in_header = ptr = malloc(in_header_size);
> -+
> -+  printf("\tReading LoadNVM header\n");
> -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> -+
> -+  if ( (res != in_header_size)
> -+#ifndef VTPM_MUTLI_VM
> -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> -+#endif
> -+       || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> -+       || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> -+       || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> -+      free(in_header);
> -+      return -1;
> -+  }
> -+  free(in_header);
> -+
> -+  if (result != VTPM_SUCCESS) {
> -+      return -1;
> -+  }
> -+
> -+  // Read Encrypted data from VTPM Manager
> -+  *data_length = in_rsp_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> -+  *data = (uint8_t *) malloc(*data_length);
> -+
> -+  printf("\tReading clear data from LoadNVM.\n");
> -+  res = read(vtpm_rx_fh, *data, *data_length);
> -+#ifdef VTPM_MUTLI_VM
> -+  close(vtpm_rx_fh);close(vtpm_tx_fh);
> -+#endif
> -+
> -+  printf("\tReturing from loading NVM\n");
> -   if (res != *data_length) {
> --    tpm_free(*data);
> --    return -1;
> -+      free(*data);
> -+      return -1;
> -+  } else {
> -+      return 0;
> -   }
> --  return 0;
> -+
> - }
> -
> - #else
> -diff -uprN tpm_emulator/tpmd.c vtpm/tpmd.c
> ---- tpm_emulator/tpmd.c        2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/tpmd.c        2007-01-09 14:48:56.000000000 -0800
> -@@ -21,12 +21,24 @@
> - #include <sys/stat.h>
> - #include <fcntl.h>
> - #include <sys/time.h>
> -+#include <sys/socket.h>
> -+#include <sys/un.h>
> -+#include <errno.h>
> -
> - #include "tpm_emulator.h"
> -+#include "vtpm_manager.h"
> -
> --#define TPM_RX_FNAME "/var/tpm/tpm_in.fifo"
> --#define TPM_TX_FNAME "/var/tpm/tpm_out.fifo"
> -+#ifdef VTPM_MULTI_VM
> -+ #define DEV_BE "/dev/vtpm"
> -+#else
> -+ #define PVM_RX_FIFO_D "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
> -+ #define PVM_TX_FIFO "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
> -
> -+ #define HVM_RX_FIFO_D "/var/vtpm/socks/%d.socket"
> -+#endif
> -+
> -+ int dmi_id;
> -+
> - #define BUFFER_SIZE 2048
> -
> - static int devurandom=0;
> -@@ -38,7 +50,7 @@ void get_random_bytes(void *buf, int nby
> -   }
> -
> -   if (read(devurandom, buf, nbytes) != nbytes) {
> --      printf("Can't get random number.\n");
> -+      error("Can't get random number.\n");
> -       exit(-1);
> -   }
> - }
> -@@ -52,105 +64,182 @@ uint64_t tpm_get_ticks(void)
> -
> - int main(int argc, char **argv)
> - {
> --  uint8_t in[BUFFER_SIZE], *out;
> -+  uint8_t type, in[BUFFER_SIZE], *out, *addressed_out;
> -+  char *vtpm_rx_file=NULL;
> -   uint32_t out_size;
> -   int in_size, written;
> --  int i;
> --  struct stat file_info;
> -+  int i, guest_id=-1;
> -
> --  int tpm_tx_fh=-1, tpm_rx_fh=-1;
> -+#ifndef VTPM_MULTI_VM
> -+  int sockfd = -1;
> -+  struct sockaddr_un addr;
> -+  struct sockaddr_un client_addr;
> -+  unsigned int client_length;
> -+
> -+#endif
> -+
> -+  int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> -+#ifdef VTPM_MULTI_VM
> -   if (argc < 2) {
> --    printf("Usage: tpmd clear|save|deactivated\n" );
> -+    error("Usage: tpmd clear|save|deactivated\n" );
> -+#else
> -+  if (argc < 4) {
> -+    error("Usage: tpmd clear|save|deactivated pvm|hvm vtpmid\n" );
> -+#endif
> -         return -1;
> -   }
> -
> -+#ifndef VTPM_MULTI_VM
> -+  /* setup type of vm */
> -+  if (!strcmp(argv[2], "pvm")) {
> -+    type = VTPM_TYPE_PVM; // Get commands from vTPM Manager through fifo
> -+  } else if (!strcmp(argv[2], "hvm")) {
> -+    type = VTPM_TYPE_HVM; // Get commands from qemu via socket
> -+  } else {
> -+    error("invalid vTPM type '%s'.\n", argv[2]);
> -+  }
> -+
> -+  dmi_id = atoi(argv[3]);
> -+
> -+  if (type == VTPM_TYPE_PVM) {
> -+    vtpm_rx_file = malloc(10 + strlen(PVM_RX_FIFO_D));
> -+    sprintf(vtpm_rx_file, PVM_RX_FIFO_D, (uint32_t) dmi_id);
> -+  } else {
> -+    vtpm_rx_file = malloc(10 + strlen(HVM_RX_FIFO_D));
> -+    sprintf(vtpm_rx_file, HVM_RX_FIFO_D, (uint32_t) dmi_id);
> -+
> -+    if ( (sockfd = socket(PF_UNIX,SOCK_STREAM,0)) < 0) {
> -+          error("Unable to create socket. errno = %d\n", errno);
> -+      exit (-1);
> -+    }
> -+
> -+    memset(&addr, 0, sizeof(addr));
> -+    addr.sun_family = AF_UNIX;
> -+    strcpy(addr.sun_path,vtpm_rx_file );
> -+    unlink(addr.sun_path);
> -+  }
> -+#endif
> -+
> -+#ifdef VTPM_MULTI_VM
> -+  info("Initializing tpm state: %s\n", argv[1]);
> -+#else
> -+  info("Initializing tpm state: %s, type: %s, id: %d\n", argv[1], argv[2], dmi_id);
> -+#endif
> -+
> -   /* initialize TPM emulator */
> -   if (!strcmp(argv[1], "clear")) {
> --    printf("Initializing tpm: %s\n", argv[1]);
> -     tpm_emulator_init(1);
> --  } else if (!strcmp(argv[1], "save")) {
> --    printf("Initializing tpm: %s\n", argv[1]);
> -+  } else if (!strcmp(argv[1], "save")) {
> -     tpm_emulator_init(2);
> -   } else if (!strcmp(argv[1], "deactivated")) {
> --    printf("Initializing tpm: %s\n", argv[1]);
> -     tpm_emulator_init(3);
> -   } else {
> --    printf("invalid startup mode '%s'; must be 'clear', "
> -+    error("invalid startup mode '%s'; must be 'clear', "
> -       "'save' (default) or 'deactivated", argv[1]);
> -     return -1;
> -   }
> --
> --  if ( stat(TPM_RX_FNAME, &file_info) == -1) {
> --    if ( mkfifo(TPM_RX_FNAME, S_IWUSR | S_IRUSR ) ) {
> --      printf("Failed to create fifo %s.\n", TPM_RX_FNAME);
> --      return -1;
> --    }
> --  }
> --
> --  if ( stat(TPM_TX_FNAME, &file_info) == -1) {
> --    if ( mkfifo(TPM_TX_FNAME, S_IWUSR | S_IRUSR ) ) {
> --      printf("Failed to create fifo %s.\n", TPM_TX_FNAME);
> --      return -1;
> --    }
> --  }
> --
> -+
> -   while (1) {
> - abort_command:
> --    if (tpm_rx_fh < 0) {
> --      tpm_rx_fh = open(TPM_RX_FNAME, O_RDONLY);
> -+    if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+      vtpm_rx_fh = open(DEV_BE, O_RDWR);
> -+#else
> -+      if (type == VTPM_TYPE_PVM) {
> -+        vtpm_rx_fh = open(vtpm_rx_file, O_RDONLY);
> -+      } else {
> -+        if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
> -+          error("Unable to bind(). errno = %d\n", errno);
> -+          exit (-1);
> -+        }
> -+
> -+        if (listen(sockfd, 10) <0) {
> -+          error("Unable to listen(). errno = %d\n", errno);
> -+          exit (-1);
> -+        }
> -+
> -+        memset(&client_addr, 0, sizeof(client_addr));
> -+        client_length = sizeof(client_addr);
> -+
> -+        vtpm_rx_fh = vtpm_tx_fh = accept(sockfd, (struct sockaddr *)&client_addr, &client_length);
> -+      }
> -+#endif
> -     }
> -
> --    if (tpm_rx_fh < 0) {
> --      printf("ERROR: failed to open devices to listen to guest.\n");
> -+    if (vtpm_rx_fh < 0) {
> -+      error("Failed to open devices to listen to guest.\n");
> -       return -1;
> -     }
> -
> --    if (tpm_tx_fh < 0) {
> --      tpm_tx_fh = open(TPM_TX_FNAME, O_WRONLY);
> --    }
> --
> --    if (tpm_tx_fh < 0) {
> --      printf("ERROR: failed to open devices to respond to guest.\n");
> --      return -1;
> --    }
> --
> --    in_size = read(tpm_rx_fh, in, BUFFER_SIZE);
> -+    in_size = read(vtpm_rx_fh, in, BUFFER_SIZE);
> -     if (in_size < 6) { // Magic size of minium TPM command
> --      printf("Recv[%d] to small: 0x", in_size);
> -+      info("Recv incomplete command of %d bytes.", in_size);
> -       if (in_size <= 0) {
> --          close(tpm_rx_fh);
> --          tpm_rx_fh = -1;
> -+          close(vtpm_rx_fh);
> -+          vtpm_rx_fh = -1;
> -           goto abort_command;
> -       }
> -     } else {
> --      printf("Recv[%d]: 0x", in_size);
> -+      debug_nostop("Recv[%d]: 0x", in_size);
> -       for (i=0; i< in_size; i++)
> --        printf("%x ", in[i]);
> --      printf("\n");
> -+        debug_more("%x ", in[i]);
> -+      debug_more("\n");
> -     }
> -
> --
> --    if (tpm_handle_command(in, in_size, &out, &out_size) != 0) {
> --        printf("ERROR: Handler Failed.\n");
> -+    if (guest_id == -1) {
> -+        guest_id = *((uint32_t *) in);
> -+    } else {
> -+        if (guest_id != *((uint32_t *) in) ) {
> -+            error("WARNING: More than one guest attached\n");
> -+        }
> -+    }
> -+
> -+    if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+      vtpm_tx_fh = open(DEV_BE, O_RDWR);
> -+      vtpm_rx_fh = vtpm_tx_fh;
> -+#else
> -+      if (type == VTPM_TYPE_PVM) {
> -+        vtpm_tx_fh = open(PVM_TX_FIFO, O_WRONLY);
> -+      } // No need to open the other direction for HVM
> -+#endif
> -+    }
> -+
> -+    if (vtpm_tx_fh < 0) {
> -+      error("Failed to open devices to respond to guest.\n");
> -+      return -1;
> -+    }
> -+
> -+    // Handle the command, but skip the domain id header
> -+    if (tpm_handle_command(in + sizeof(uint32_t), in_size - sizeof(uint32_t), &out, &out_size) != 0) {
> -+      error("Handler Failed.\n");
> -     }
> -
> --    written = write(tpm_tx_fh, out, out_size);
> -+    addressed_out = (uint8_t *) tpm_malloc(sizeof(uint32_t) + out_size);
> -+    *(uint32_t *) addressed_out = *(uint32_t *) in;
> -+    memcpy(addressed_out + sizeof(uint32_t), out, out_size);
> -+
> -+    written = write(vtpm_tx_fh, addressed_out, out_size + sizeof(uint32_t));
> -
> --    if (written != out_size ) {
> --      printf("ERROR: Part of response not written %d/%d.\nAttempt: ", written, out_size);
> -+    if (written != out_size + sizeof(uint32_t)) {
> -+      error("Part of response not written %d/%d.\n", written, out_size);
> -     } else {
> --      printf("Sent[%Zu]: ", out_size);
> -+      debug_nostop("Sent[%Zu]: ", out_size + sizeof(uint32_t));
> -+      for (i=0; i< out_size+ sizeof(uint32_t); i++)
> -+        debug_more("%x ", addressed_out[i]);
> -+      debug_more("\n");
> -     }
> --    for (i=0; i< out_size; i++)
> --      printf("%x ", out[i]);
> --    printf("\n");
> -     tpm_free(out);
> -+    tpm_free(addressed_out);
> -
> -   } // loop
> -
> -   tpm_emulator_shutdown();
> -
> --  close(tpm_tx_fh);
> --  close(tpm_rx_fh);
> -+  close(vtpm_tx_fh);
> -+#ifndef VTPM_MUTLI_VM
> -+  close(vtpm_rx_fh);
> -+  free (vtpm_rx_file);
> -+#endif
> -
> - }
> diff --git a/tools/vtpm_manager/COPYING b/tools/vtpm_manager/COPYING
> deleted file mode 100644
> index c4b86b7..0000000
> --- a/tools/vtpm_manager/COPYING
> +++ /dev/null
> @@ -1,32 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> diff --git a/tools/vtpm_manager/Makefile b/tools/vtpm_manager/Makefile
> deleted file mode 100644
> index 632f41b..0000000
> --- a/tools/vtpm_manager/Makefile
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../..
> -
> -# Base definitions and rules
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -SUBDIRS                = crypto tcs util manager migration
> -OPENSSL_HEADER = /usr/include/openssl/crypto.h
> -
> -.PHONY: all clean install
> -all clean install: %: subdirs-%
> -
> -.PHONY: mrproper
> -mrproper:
> -       @set -e; for subdir in $(SUBDIRS); do \
> -               $(MAKE) -C $$subdir $@; \
> -       done
> -
> -
> diff --git a/tools/vtpm_manager/README b/tools/vtpm_manager/README
> deleted file mode 100644
> index f0d1e98..0000000
> --- a/tools/vtpm_manager/README
> +++ /dev/null
> @@ -1,94 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -Directory Structure
> -===================
> -tools/vtpm_manager/crypto    -> crypto files
> -tools/vtpm_manager/TCS       -> TCS implementation
> -tools/vtpm_manager/util      -> Utility Library. Include disk-io and buffers.
> -tools/vtpm_manager/manager   -> VTPM Manager
> -
> -Compile Flags
> -===================
> -LOGGING_MODULES              -> How extensive logging happens
> -                                see util/log.h for more info
> -
> -VTPM_MULTI_VM                -> Defined: VTPMs run in their own VMs
> -                                Not Defined (default): VTPMs are processes
> -
> -# Debugging flags that may disappear without notice in the future
> -
> -DUMMY_BACKEND                -> vtpm_manager listens on /tmp/in.fifo and
> -                                /tmp/out.fifo rather than backend
> -
> -MANUAL_DM_LAUNCH             -> Must manually launch & kill VTPMs
> -
> -WELL_KNOWN_OWNER_AUTH        -> Rather than randomly generating the password for the owner,
> -                                use a well known value. This is useful for debugging and for
> -                                poor bios which do not support clearing TPM if OwnerAuth is
> -                                lost. However this has no protection from malicious app
> -                                issuing a TPM_OwnerClear to wipe the TPM
> -
> -Requirements
> -============
> -- xen-unstable
> -- vtpm frontend/backend driver patch
> -- OpenSSL Library
> -
> -Single-VM Flow
> -============================
> -- Launch the VTPM manager (vtpm_managerd) which which begins listening to the BE with one thread
> -  and listens to a named fifo that is shared by the vtpms to commuincate with the manager.
> -- VTPM Manager listens to TPM BE.
> -- When xend launches a tpm frontend equipped VM it contacts the manager over the vtpm backend.
> -- When the manager receives the open message from the BE, it launches a vtpm
> -- Xend allows the VM to continue booting.
> -- When a TPM request is issued to the front end, the front end transmits the TPM request to the backend.
> -- The manager receives the TPM requests and uses a named fifo to forward the request to the vtpm.
> -- The fifo listener begins listening for the reply from vtpm for the request.
> -- Vtpm processes request and replies to manager over shared named fifo.
> -- If needed, the vtpm may send a request to the vtpm_manager at any time to save it's secrets to disk.
> -- Manager receives response from vtpm and passes it back to backend for forwarding to guest.
> -
> -NOTES:
> -* SaveService SHOULD seal it's table before saving it to disk. However,
> -  the current Xen infrastructure does not provide a mechanism for this to be
> -  unsealed later. Specifically, the auth and wrapped key must be available ONLY
> -  to the service, or it's not even worth encrypting
> -
> -  In the future the vtpm manager will be protected by an early boot mechanism
> -  that will allow for better protection of it's data.
> -
> -TODO:
> -- Timeout on crashed vtpms
> -- create lock for shared fifo for talking to vtpms.
> diff --git a/tools/vtpm_manager/Rules.mk b/tools/vtpm_manager/Rules.mk
> deleted file mode 100644
> index 651772b..0000000
> --- a/tools/vtpm_manager/Rules.mk
> +++ /dev/null
> @@ -1,59 +0,0 @@
> -# Base definitions and rules (XEN_ROOT must be defined in including Makefile)
> -include $(XEN_ROOT)/tools/Rules.mk
> -
> -#
> -# Tool definitions
> -#
> -
> -# General compiler flags
> -CFLAGS = -Werror -g3
> -
> -# Generic project files
> -HDRS   = $(wildcard *.h)
> -SRCS   = $(wildcard *.c)
> -OBJS   = $(patsubst %.c,%.o,$(SRCS))
> -
> -# Generic (non-header) dependencies
> -$(SRCS): Makefile $(XEN_ROOT)/tools/Rules.mk $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -$(OBJS): $(SRCS)
> -
> --include $(FILES)
> -
> -# Make sure these are just rules
> -.PHONY : all build install clean
> -
> -#
> -# Project-specific definitions
> -#
> -
> -# Need UNIX98 spec for pthread rwlocks
> -CFLAGS += -D_GNU_SOURCE
> -
> -# Logging Level. See utils/tools.h for usage
> -CFLAGS += -DLOGGING_MODULES="(BITMASK(VTPM_LOG_TCS)|BITMASK(VTPM_LOG_VTSP)|BITMASK(VTPM_LOG_VTPM))"
> -
> -# Silent Mode
> -#CFLAGS += -DLOGGING_MODULES=0x0
> -#CFLAGS += -DLOGGING_MODULES=0xff
> -
> -# Use frontend/backend pairs between manager & DMs?
> -#CFLAGS += -DVTPM_MULTI_VM
> -
> -# vtpm_manager listens on fifo's rather than backend
> -#CFLAGS += -DDUMMY_BACKEND
> -
> -# TCS talks to fifo's rather than /dev/tpm. TPM Emulator assumed on fifos
> -#CFLAGS += -DDUMMY_TPM
> -
> -# Do not have manager launch DMs.
> -#CFLAGS += -DMANUAL_DM_LAUNCH
> -
> -# Fixed OwnerAuth
> -#CFLAGS += -DWELL_KNOWN_OWNER_AUTH
> -
> -# Include
> -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/crypto
> -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/util
> -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/tcs
> -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/manager
> diff --git a/tools/vtpm_manager/crypto/Makefile b/tools/vtpm_manager/crypto/Makefile
> deleted file mode 100644
> index 13b61c9..0000000
> --- a/tools/vtpm_manager/crypto/Makefile
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -BIN            = libtcpaCrypto.a
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIN)
> -
> -.PHONY: install
> -install: build
> -
> -.PHONY: clean
> -clean:
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIN): $(OBJS)
> -       $(AR) rcs $(BIN) $(OBJS)
> diff --git a/tools/vtpm_manager/crypto/crypto.c b/tools/vtpm_manager/crypto/crypto.c
> deleted file mode 100644
> index 7dae655..0000000
> --- a/tools/vtpm_manager/crypto/crypto.c
> +++ /dev/null
> @@ -1,88 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// crypto.c
> -//
> -//  This file will handle all the TPM Crypto functionality
> -//
> -// ==================================================================
> -
> -#include <string.h>
> -#include <openssl/crypto.h>
> -#include <openssl/err.h>
> -#include <openssl/evp.h>
> -#include <openssl/rand.h>
> -#include "crypto.h"
> -#include "log.h"
> -
> -/**
> - * Initialize cryptography library
> - * @rand: random seed
> - * @size: size of @rand
> - */
> -void Crypto_Init(const BYTE* rand, int size) {
> -       ERR_load_crypto_strings();
> -  CRYPTO_malloc_init();
> -  OpenSSL_add_all_algorithms();
> -  SYM_CIPHER = EVP_aes_128_cbc();
> -  RAND_poll();
> -  if (rand == NULL)
> -    return;
> -
> -  RAND_add(rand, size, size);
> -}
> -
> -/**
> - * Shutdown cryptography library
> - */
> -void Crypto_Exit() {
> -  ERR_free_strings();
> -  ERR_remove_state(0);
> -  EVP_cleanup();
> -}
> -
> -
> -/**
> - * Get random data
> - * @data: (OUT) Random data
> - * @size: Size of @data
> - */
> -void Crypto_GetRandom(void* data, int size) {
> -  int result;
> -
> -  result = RAND_pseudo_bytes((BYTE*) data, size);
> -
> -  if (result <= 0)
> -    vtpmlogerror (VTPM_LOG_CRYPTO, "RAND_pseudo_bytes failed: %s\n",
> -            ERR_error_string (ERR_get_error(), NULL));
> -}
> diff --git a/tools/vtpm_manager/crypto/crypto.h b/tools/vtpm_manager/crypto/crypto.h
> deleted file mode 100644
> index 488d4d6..0000000
> --- a/tools/vtpm_manager/crypto/crypto.h
> +++ /dev/null
> @@ -1,175 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// crypto.h
> -//
> -//  This file defines the TPM Crypto API
> -//
> -// ==================================================================
> -
> -#ifndef __CRYPTO_H__
> -#define __CRYPTO_H__
> -
> -#include <stddef.h>
> -#include <stdint.h>
> -#include <stdbool.h>
> -
> -#include "tcg.h"
> -#include "sym_crypto.h"
> -
> -#define CRYPTO_MAX_SIG_SIZE (2048 / 8)
> -#define CRYPTO_MAX_RSA_KEY_SIZE (4096 / 8) //in bytes
> -
> -#define OAEP_P "TCPA"
> -#define OAEP_P_SIZE 4
> -
> -// Algorithms supported by crypto. Stored in CRYPTO_INFO.algorithmID
> -#define CRYPTO_ALGORITH_RSA 0x01
> -
> -// Supported Encryption Schemes CRYPTO_INFO.encScheme
> -#define CRYPTO_ES_NONE 0x0001
> -#define CRYPTO_ES_RSAESPKCSv15 0x0002
> -#define CRYPTO_ES_RSAESOAEP_SHA1_MGF1 0x0003
> -
> -// Supported Signature schemes CRYPTO_INFO.sigScheme
> -#define CRYPTO_SS_NONE 0x0001
> -#define CRYPTO_SS_RSASSAPKCS1v15_SHA1 0x0002
> -#define CRYPTO_SS_RSASSAPKCS1v15_DER 0x0003
> -
> -typedef struct CRYPTO_INFO {
> -  void *keyInfo;
> -  UINT32 algorithmID;
> -  UINT32 encScheme;
> -  UINT32 sigScheme;
> -} CRYPTO_INFO;
> -
> -
> -void Crypto_Init(const BYTE* rand, int size);
> -
> -void Crypto_Exit();
> -
> -void Crypto_GetRandom(void* data, int size);
> -
> -void Crypto_HMAC(   const BYTE* text,
> -                    int text_len,
> -                    const BYTE* key,
> -                    int key_len,
> -                    BYTE* digest);
> -
> -TPM_RESULT Crypto_HMAC_buf (const buffer_t * text,
> -                            const buffer_t * key,
> -                            BYTE * o_digest); /* presumably of 20 bytes */
> -
> -void Crypto_SHA1Full(   const BYTE* text,
> -                        UINT32 size,
> -                        BYTE* hash); //Complete 3part SHA1
> -
> -// o_hash needs to be large enough to hold the digest, ie 20 bytes
> -TPM_RESULT Crypto_SHA1Full_buf (const buffer_t * buf,
> -                                BYTE * o_hash);
> -
> -void Crypto_SHA1Start(UINT32* maxNumBytes);
> -void Crypto_SHA1Update(int numBytes, const BYTE* hashData);
> -void Crypto_SHA1Complete(   int hashDataSize,
> -                            const BYTE* hashData,
> -                            BYTE* hashValue);
> -
> -void Crypto_RSACreateKey(   /*in*/ UINT32 keySize,
> -                            /*in*/ UINT32 pubExpSize,
> -                            /*in*/ BYTE *pubExp,
> -                            /*out*/ UINT32 *privExpSize,
> -                            /*out*/ BYTE *privExp,
> -                            /*out*/ UINT32 *modulusSize,
> -                            /*out*/ BYTE *modulus,
> -                            /*out*/ CRYPTO_INFO *keys);
> -
> -void Crypto_RSABuildCryptoInfo( /*[IN]*/ UINT32 pubExpSize,
> -                                /*[IN]*/ BYTE *pubExp,
> -                                /*[IN]*/ UINT32 privExpSize,
> -                                /*[IN]*/ BYTE *privExp,
> -                                /*[IN]*/ UINT32 modulusSize,
> -                                /*[IN]*/ BYTE *modulus,
> -                                /*[OUT]*/ CRYPTO_INFO* cryptoInfo);
> -
> -void Crypto_RSABuildCryptoInfoPublic(   /*[IN]*/ UINT32 pubExpSize,
> -                                        /*[IN]*/ BYTE *pubExp,
> -                                        /*[IN]*/ UINT32 modulusSize,
> -                                        /*[IN]*/ BYTE *modulus,
> -                                        CRYPTO_INFO* cryptoInfo);
> -
> -//
> -// symmetric pack and unpack operations
> -//
> -TPM_RESULT Crypto_RSAPackCryptoInfo (const CRYPTO_INFO* cryptoInfo,
> -                                     BYTE ** io_buf, UINT32 * io_buflen);
> -
> -TPM_RESULT Crypto_RSAUnpackCryptoInfo (CRYPTO_INFO * ci,
> -                                       BYTE * in, UINT32 len,
> -                                       UINT32 * o_lenread);
> -
> -
> -// return 0 on success, -1 on error
> -int Crypto_RSAEnc(  CRYPTO_INFO *keys,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *outDataSize,
> -                    /*out*/ BYTE *outData);
> -
> -// return 0 on success, -1 on error
> -int Crypto_RSADec(  CRYPTO_INFO *keys,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *outDataSize,
> -                    /*out*/ BYTE *outData);
> -
> -// return 0 on success, -1 on error
> -int Crypto_RSASign( CRYPTO_INFO *keys,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *sigSize,
> -                    /*out*/ BYTE *sig);
> -
> -bool Crypto_RSAVerify(  CRYPTO_INFO *keys,
> -                        UINT32 inDataSize,
> -                        BYTE *inData,
> -                        UINT32 sigSize,
> -                        BYTE *sig);
> -
> -//private:
> -int RSA_verify_DER(int dtype, unsigned char *m, unsigned int m_len,
> -                   unsigned char *sigbuf, unsigned int siglen, CRYPTO_INFO *key);
> -
> -int RSA_sign_DER(int type, unsigned char *m, unsigned int m_len,
> -              unsigned char *sigret, unsigned int *siglen, CRYPTO_INFO *key);
> -
> -#endif // __CRYPTO_H__
> diff --git a/tools/vtpm_manager/crypto/hash.c b/tools/vtpm_manager/crypto/hash.c
> deleted file mode 100644
> index c73114a..0000000
> --- a/tools/vtpm_manager/crypto/hash.c
> +++ /dev/null
> @@ -1,153 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// hash.c
> -//
> -//  This file will handle all the TPM Hash functionality
> -//
> -// ==================================================================
> -
> -#include <string.h>
> -#include <openssl/crypto.h>
> -#include <openssl/err.h>
> -#include <openssl/evp.h>
> -#include <openssl/rand.h>
> -#include <openssl/hmac.h>
> -#include <openssl/sha.h>
> -#include <openssl/bn.h>
> -#include <openssl/rsa.h>
> -
> -#include "tcg.h"         // for TPM_SUCCESS
> -#include "crypto.h"
> -
> -static SHA_CTX g_shaContext;
> -
> -void Crypto_HMAC(   const BYTE* text,
> -                    int text_len,
> -                    const BYTE* key,
> -                    int key_len,
> -                    BYTE* digest) {
> -  if (text == NULL || key == NULL || text_len == 0 || key_len == 0)
> -    return;
> -
> -  HMAC(EVP_sha1(), key, key_len, text, text_len, digest, NULL);
> -}
> -
> -TPM_RESULT Crypto_HMAC_buf (const buffer_t * text,
> -                           const buffer_t * key,
> -                           BYTE * o_digest) { /* presumably of 20 bytes */
> -
> -  Crypto_HMAC (text->bytes, text->size,
> -              key->bytes, key->size,
> -              o_digest);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -/*
> - * SHA1
> - * (OUT) Create a SHA1 hash of text. Calls all three SHA1 steps internally
> - */
> -void Crypto_SHA1Full( const BYTE* text,
> -      uint32_t size,
> -      BYTE* hash) {
> -
> -  if (text == NULL || size == 0)
> -    return;
> -
> -  // Run SHA1Start + SHAUpdate (if necessary) + SHAComplete
> -  uint32_t maxBytes; // Not used for anything
> -  Crypto_SHA1Start(&maxBytes);
> -
> -  while (size > 64){
> -    Crypto_SHA1Update(64, text);
> -    size -= 64;
> -    text += 64;
> -  }
> -
> -  Crypto_SHA1Complete(size, text, hash);
> -}
> -
> -// same thing using buffer_t
> -TPM_RESULT Crypto_SHA1Full_buf (const buffer_t * buf,
> -                                 BYTE * o_digest) {
> -
> -  if (buf->bytes == NULL || buf->size == 0)
> -    return TPM_BAD_PARAMETER;
> -
> -  Crypto_SHA1Full (buf->bytes, buf->size, o_digest);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -/*
> - * Initialize SHA1
> - * (OUT) Maximum number of bytes that can be sent to SHA1Update.
> - *   Must be a multiple of 64 bytes.
> - */
> -void Crypto_SHA1Start(uint32_t* maxNumBytes) {
> -  int max = SHA_CBLOCK;
> -  // Initialize the crypto library
> -  SHA1_Init(&g_shaContext);
> -  *maxNumBytes = max;
> -}
> -
> -/*
> - * Process SHA1
> - * @numBytes: (IN) The number of bytes in hashData.
> - *       Must be a multiple of 64 bytes.
> - * @hashData: (IN) Bytes to be hashed.
> - */
> -void Crypto_SHA1Update(int numBytes, const BYTE* hashData) {
> -
> -  if (hashData == NULL || numBytes == 0 || numBytes%64 != 0)
> -    return;
> -
> -  SHA1_Update(&g_shaContext, hashData, numBytes);
> -}
> -
> -/*
> - * Complete the SHA1 process
> - * @hashDataSize: (IN) Number of bytes in hashData.
> - *       Must be a multiple of 64 bytes.
> - * @hashData: (IN) Final bytes to be hashed.
> - * @hashValue: (OUT) The output of the SHA-1 hash.
> - */
> -void Crypto_SHA1Complete(int hashDataSize,
> -                        const BYTE* hashData,
> -                        BYTE* hashValue) {
> -  SHA1_Update(&g_shaContext, hashData, hashDataSize);
> -  SHA1_Final(hashValue, &g_shaContext);
> -}
> diff --git a/tools/vtpm_manager/crypto/rsa.c b/tools/vtpm_manager/crypto/rsa.c
> deleted file mode 100644
> index 7737dc6..0000000
> --- a/tools/vtpm_manager/crypto/rsa.c
> +++ /dev/null
> @@ -1,434 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// rsa.c
> -//
> -//  This file will handle all the TPM RSA crypto functionality
> -//
> -// ==================================================================
> -
> -#include <string.h>
> -#include <openssl/crypto.h>
> -#include <openssl/evp.h>
> -#include <openssl/bn.h>
> -#include <openssl/rsa.h>
> -#include <openssl/rand.h>
> -#include <openssl/x509.h>
> -
> -#include <openssl/err.h>
> -#include <stdio.h>
> -
> -#include "tcg.h"
> -#include "buffer.h"
> -#include "crypto.h"
> -#include "log.h"
> -
> -void Crypto_RSACreateKey(   /*in*/ UINT32 keySize,
> -                            /*in*/ UINT32 pubExpSize,
> -                            /*in*/ BYTE *pubExp,
> -                            /*out*/ UINT32 *privExpSize,
> -                            /*out*/ BYTE *privExp,
> -                            /*out*/ UINT32 *modulusSize,
> -                            /*out*/ BYTE *modulus,
> -                            /*out*/ CRYPTO_INFO *keys) {
> -  unsigned long e_value;
> -
> -  if (pubExpSize == 0) // Default e = 2^16+1
> -    e_value = (0x01 << 16) + 1;
> -  else {
> -    // This is not supported, but the following line MIGHT work
> -    // under then assumption that the format is BigNum compatable
> -    // Though it's not in the spec, so who knows what it is.
> -    // Forcing the default.
> -    //BN_bin2bn(pubExp, pubExpSize, NULL);
> -    e_value = (0x01 << 16) + 1;
> -  }
> -
> -  RSA *rsa = RSA_generate_key(keySize, e_value, NULL, NULL);
> -
> -  if (keys) {
> -    keys->keyInfo = rsa;
> -    keys->algorithmID = CRYPTO_ALGORITH_RSA;
> -  }
> -
> -  if (modulus)   *modulusSize   = BN_bn2bin(rsa->n, modulus);
> -  if (privExp)   *privExpSize   = BN_bn2bin(rsa->d, privExp);
> -}
> -
> -// Create a CRYPTO_INFO struct from the BYTE * key parts.
> -// If pubExp info is NULL, use TCG default.
> -// If there is a remainder while calculating the privExp, return FALSE.
> -
> -void Crypto_RSABuildCryptoInfo( /*[IN]*/ UINT32 pubExpSize,
> -                                /*[IN]*/ BYTE *pubExp,
> -                                /*[IN]*/ UINT32 privExpSize,
> -                                /*[IN]*/ BYTE *privExp,
> -                                /*[IN]*/ UINT32 modulusSize,
> -                                /*[IN]*/ BYTE *modulus,
> -                                CRYPTO_INFO* cryptoInfo) {
> -  cryptoInfo->keyInfo = RSA_new();
> -  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
> -
> -  rsa->e = BN_new();
> -
> -  if (pubExpSize == 0) { // Default e = 2^16+1
> -    BN_set_bit(rsa->e, 16);
> -    BN_set_bit(rsa->e, 0);
> -  } else {
> -    // This is not supported, but the following line MIGHT work
> -    // under then assumption that the format is BigNum compatable
> -    // Though it's not in the spec, so who knows what it is.
> -    // Forcing the default.
> -    //BN_bin2bn(pubExp, pubExpSize, NULL);
> -    BN_set_bit(rsa->e, 16);
> -    BN_set_bit(rsa->e, 0);
> -  }
> -
> -  rsa->n = BN_bin2bn(modulus, modulusSize, NULL);
> -  rsa->d = BN_bin2bn(privExp, privExpSize, NULL);
> -}
> -
> -// Create a CRYPTO_INFO struct from the BYTE * key parts.
> -// If pubExp info is NULL, use TCG default.
> -// If there is a remainder while calculating the privExp, return FALSE.
> -
> -void Crypto_RSABuildCryptoInfoPublic(   /*[IN]*/ UINT32 pubExpSize,
> -                                        /*[IN]*/ BYTE *pubExp,
> -                                        /*[IN]*/ UINT32 modulusSize,
> -                                        /*[IN]*/ BYTE *modulus,
> -                                        CRYPTO_INFO* cryptoInfo) {
> -  cryptoInfo->keyInfo = RSA_new();
> -  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
> -
> -  rsa->e = BN_new();
> -
> -  if (pubExpSize == 0) { // Default e = 2^16+1
> -    BN_set_bit(rsa->e, 16);
> -    BN_set_bit(rsa->e, 0);
> -  } else {
> -    // This is not supported, but the following line MIGHT work
> -    // under then assumption that the format is BigNum compatable
> -    // Though it's not in the spec, so who knows what it is.
> -    // Forcing the default.
> -    //BN_bin2bn(pubExp, pubExpSize, NULL);
> -    BN_set_bit(rsa->e, 16);
> -    BN_set_bit(rsa->e, 0);
> -  }
> -
> -  rsa->n = BN_bin2bn(modulus, modulusSize, NULL);
> -
> -}
> -
> -int Crypto_RSAEnc(  CRYPTO_INFO *key,
> -                   UINT32 inDataSize,
> -                   BYTE *inData,
> -                   /*out*/ UINT32 *outDataSize,
> -                   /*out*/ BYTE *outData) {
> -  RSA *rsa = (RSA *) key->keyInfo;
> -  UINT32 paddedDataSize = RSA_size (rsa);
> -  BYTE *paddedData = (BYTE *)malloc(sizeof(BYTE) * paddedDataSize);
> -  int rc;
> -
> -  if (paddedData == NULL)
> -    return -1;
> -
> -  *outDataSize = 0;
> -
> -  switch (key->encScheme) {
> -  case CRYPTO_ES_RSAESPKCSv15:
> -    if (RSA_padding_add_PKCS1_type_2(paddedData, paddedDataSize, inData, inDataSize) <= 0) {
> -      rc = -1;
> -      goto abort_egress;
> -    }
> -    break;
> -  case CRYPTO_ES_RSAESOAEP_SHA1_MGF1:
> -    if (RSA_padding_add_PKCS1_OAEP(paddedData,paddedDataSize,inData,inDataSize, (BYTE *) OAEP_P,OAEP_P_SIZE) <= 0 ) {
> -      rc = -1;
> -      goto abort_egress;
> -    }
> -    break;
> -  default:
> -    rc = -1;
> -    goto abort_egress;
> -  }
> -
> -  rc = RSA_public_encrypt(paddedDataSize, paddedData, outData, rsa, RSA_NO_PADDING);
> -  if (rc == -1)
> -    goto abort_egress;
> -
> -  *outDataSize = rc;
> -
> -  if (rc > 0) rc = 0;
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  if (paddedData)
> -    free (paddedData);
> -  return rc;
> -
> -}
> -
> -int Crypto_RSADec(  CRYPTO_INFO *key,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *outDataSize,
> -                    /*out*/ BYTE *outData) {
> -
> -  RSA *rsa = (RSA *) key->keyInfo;
> -  UINT32 paddedDataSize = RSA_size (rsa);
> -  BYTE *paddedData = (BYTE *)malloc(sizeof(BYTE) * paddedDataSize);
> -  int rc;
> -
> -  if (paddedData == NULL)
> -    goto abort_egress;
> -
> -  rc = RSA_private_decrypt(inDataSize, inData, paddedData, rsa, RSA_NO_PADDING);
> -  if (rc == -1) {
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_private_decrypt: %s\n", ERR_error_string(ERR_get_error(), NULL));
> -    goto abort_egress;
> -  }
> -
> -  paddedDataSize = rc;
> -
> -  switch (key->encScheme) {
> -  case CRYPTO_ES_RSAESPKCSv15:
> -    rc = RSA_padding_check_PKCS1_type_2 (outData, paddedDataSize,
> -                                        paddedData + 1, paddedDataSize - 1,
> -                                        RSA_size(rsa));
> -    if (rc == -1) {
> -      vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_padding_check_PKCS1_type_2: %s\n",
> -             ERR_error_string(ERR_get_error(), NULL));
> -      goto abort_egress;
> -    }
> -    *outDataSize = rc;
> -    break;
> -  case CRYPTO_ES_RSAESOAEP_SHA1_MGF1:
> -    rc = RSA_padding_check_PKCS1_OAEP(outData, paddedDataSize,
> -                                     paddedData + 1, paddedDataSize - 1,
> -                                     RSA_size(rsa),
> -                                     (BYTE *) OAEP_P, OAEP_P_SIZE);
> -    if (rc == -1) {
> -      vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_padding_check_PKCS1_OAEP: %s\n",
> -             ERR_error_string(ERR_get_error(), NULL));
> -      goto abort_egress;
> -    }
> -    *outDataSize = rc;
> -    break;
> -  default:
> -    *outDataSize = 0;
> -  }
> -
> -  free(paddedData); paddedData = NULL;
> -  goto egress;
> -
> - abort_egress:
> -
> -  if (paddedData)
> -    free (paddedData);
> -  return -1;
> -
> - egress:
> -  return 0;
> -}
> -
> -// Signs either a SHA1 digest of a message or a DER encoding of a message
> -// Textual messages MUST be encoded or Hashed before sending into this function
> -// It will NOT SHA the message.
> -int Crypto_RSASign( CRYPTO_INFO *key,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *sigSize,
> -                    /*out*/ BYTE *sig) {
> -  int status;
> -  unsigned int intSigSize;
> -
> -  switch(key->sigScheme) {
> -  case CRYPTO_SS_RSASSAPKCS1v15_SHA1:
> -    status = RSA_sign(NID_sha1, inData, inDataSize, sig, &intSigSize, (RSA *) key->keyInfo);
> -    break;
> -  case CRYPTO_SS_RSASSAPKCS1v15_DER:
> -    //        status = Crypto_RSA_sign_DER(NID_md5_sha1, inData, inDataSize, sig, &intSigSize, key);
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "Crypto: Unimplemented sign type (%d)\n", key->sigScheme);
> -    status = 0;
> -    break;
> -  default:
> -    status = 0;
> -  }
> -
> -  if (status == 0) {
> -    *sigSize = 0;
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "%s\n", ERR_error_string(ERR_get_error(), NULL));
> -    return -1;
> -  }
> -
> -  *sigSize = (UINT32) intSigSize;
> -  return 0;
> -}
> -
> -bool Crypto_RSAVerify(  CRYPTO_INFO *key,
> -                        UINT32 inDataSize,
> -                        BYTE *inData,
> -                        UINT32 sigSize,
> -                        BYTE *sig) {
> -  int status;
> -
> -  switch(key->sigScheme){
> -  case CRYPTO_SS_RSASSAPKCS1v15_SHA1:
> -    status = RSA_verify(NID_sha1, inData, inDataSize, sig, sigSize, (RSA *) key->keyInfo);
> -    break;
> -  case CRYPTO_SS_RSASSAPKCS1v15_DER:
> -    //status = Crypto_RSA_verify_DER(NID_md5_sha1, inData, inDataSize, sig, sigSize, key);
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "Crypto: Unimplemented sign type (%d)\n", key->sigScheme);
> -    status = 0;
> -    break;
> -  default:
> -    status = 0;
> -  }
> -
> -  if (status)
> -    return(1);
> -  else {
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "RSA verify: %s\n", ERR_error_string(ERR_get_error(), NULL));
> -    return(0);
> -  }
> -
> -}
> -
> -// helper which packs everything into a BIO!
> -
> -// packs the parameters first, then the private key, then the public key
> -// if *io_buf is NULL, allocate it here as needed. otherwise its size is in
> -// *io_buflen
> -TPM_RESULT Crypto_RSAPackCryptoInfo (const CRYPTO_INFO* cryptoInfo,
> -                                      BYTE ** io_buf, UINT32 * io_buflen) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -  BYTE * buf;
> -  long len, outlen = *io_buflen;
> -
> -  const long PARAMSLEN = 3*sizeof(UINT32);
> -
> -  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
> -
> -  BIO *mem = BIO_new(BIO_s_mem());
> -
> -
> -  // write the openssl keys to the BIO
> -  if ( i2d_RSAPrivateKey_bio (mem, rsa) == 0 ) {
> -    ERR_print_errors_fp (stderr);
> -    ERRORDIE (TPM_SIZE);
> -  }
> -  if ( i2d_RSAPublicKey_bio (mem, rsa) == 0 ) {
> -    ERR_print_errors_fp (stderr);
> -    ERRORDIE (TPM_SIZE);
> -  }
> -
> -  // get the buffer out
> -  len = BIO_get_mem_data (mem, &buf);
> -
> -  // see if we need to allocate a return buffer
> -  if (*io_buf == NULL) {
> -    *io_buf = (BYTE*) malloc (PARAMSLEN + len);
> -    if (*io_buf == NULL)
> -      ERRORDIE (TPM_SIZE);
> -  } else {                      // *io_buf is already allocated
> -    if (outlen < len + PARAMSLEN)
> -      ERRORDIE (TPM_SIZE); // but not large enough!
> -  }
> -
> -  // copy over the parameters (three UINT32's starting at algorithmID)
> -  memcpy (*io_buf, &cryptoInfo->algorithmID, PARAMSLEN);
> -
> -  // copy over the DER keys
> -  memcpy (*io_buf + PARAMSLEN, buf, len);
> -
> -  *io_buflen = len + PARAMSLEN;
> -
> -  goto egress;
> -
> -
> - abort_egress:
> - egress:
> -
> -  BIO_free (mem);
> -
> -  return status;
> -}
> -
> -
> -
> -// sets up ci, and returns the number of bytes read in o_lenread
> -TPM_RESULT Crypto_RSAUnpackCryptoInfo (CRYPTO_INFO * ci,
> -                                        BYTE * in, UINT32 len,
> -                                        UINT32 * o_lenread) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  long l;
> -  BIO *mem;
> -  RSA *rsa;
> -
> -  // first load up the params
> -  l = 3 * sizeof(UINT32);
> -  memcpy (&ci->algorithmID, in, l);
> -  len -= l;
> -  in += l;
> -
> -  // and now the openssl keys, private first
> -  mem = BIO_new_mem_buf (in, len);
> -
> -  if ( (rsa = d2i_RSAPrivateKey_bio (mem, NULL)) == NULL ) {
> -    ERR_print_errors_fp (stderr);
> -    ERRORDIE (TPM_BAD_PARAMETER);
> -  }
> -  // now use the same RSA object and fill in the private key
> -  if ( d2i_RSAPublicKey_bio (mem, &rsa) == NULL ) {
> -    ERR_print_errors_fp (stderr);
> -    ERRORDIE (TPM_BAD_PARAMETER);
> -  }
> -
> -  ci->keyInfo = rsa;          // needs to be freed somehow later
> -
> -  // FIXME: havent figured out yet how to tell how many bytes were read in the
> -  // above oprations! so o_lenread is not set
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  BIO_free (mem);
> -
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/crypto/sym_crypto.c b/tools/vtpm_manager/crypto/sym_crypto.c
> deleted file mode 100644
> index 3d86e19..0000000
> --- a/tools/vtpm_manager/crypto/sym_crypto.c
> +++ /dev/null
> @@ -1,237 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// sym_crypto.c
> -//
> -//     Symmetric crypto portion of crypto
> -//
> -// ==================================================================
> -
> -#include <openssl/evp.h>
> -#include <openssl/rand.h>
> -
> -#include "tcg.h"
> -#include "sym_crypto.h"
> -
> -typedef enum crypt_op_type_t {
> -  CRYPT_ENCRYPT,
> -  CRYPT_DECRYPT
> -} crypt_op_type_t;
> -
> -TPM_RESULT ossl_symcrypto_op (symkey_t* key,
> -                              const buffer_t* in,
> -                              const buffer_t* iv,
> -                              buffer_t * out,
> -                              crypt_op_type_t optype);
> -
> -
> -// this is initialized in Crypto_Init()
> -const EVP_CIPHER * SYM_CIPHER = NULL;
> -
> -const BYTE ZERO_IV[EVP_MAX_IV_LENGTH] = {0};
> -
> -
> -TPM_RESULT Crypto_symcrypto_initkey (symkey_t * key, const buffer_t* keybits) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  EVP_CIPHER_CTX_init (&key->context);
> -
> -  key->cipher = SYM_CIPHER;
> -
> -  TPMTRYRETURN( buffer_init_copy (&key->key, keybits));
> -
> -  goto egress;
> -
> - abort_egress:
> -  EVP_CIPHER_CTX_cleanup (&key->context);
> -
> - egress:
> -
> -  return status;
> -}
> -
> -
> -
> -TPM_RESULT Crypto_symcrypto_genkey (symkey_t * key) {
> -  int res;
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  // hmm, EVP_CIPHER_CTX_init does not return a value
> -  EVP_CIPHER_CTX_init (&key->context);
> -
> -  key->cipher = SYM_CIPHER;
> -
> -  TPMTRYRETURN( buffer_init (&key->key, EVP_CIPHER_key_length(key->cipher), NULL)) ;
> -
> -  // and generate the key material
> -  res = RAND_pseudo_bytes (key->key.bytes, key->key.size);
> -  if (res < 0)
> -    ERRORDIE (TPM_SHORTRANDOM);
> -
> -
> -  goto egress;
> -
> - abort_egress:
> -  EVP_CIPHER_CTX_cleanup (&key->context);
> -  buffer_free (&key->key);
> -
> - egress:
> -  return status;
> -}
> -
> -
> -TPM_RESULT Crypto_symcrypto_encrypt (symkey_t* key,
> -                              const buffer_t* clear,
> -                              buffer_t* o_cipher) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  buffer_t iv, cipher_alias;
> -
> -  buffer_init_const (&iv, EVP_MAX_IV_LENGTH, ZERO_IV);
> -
> -  buffer_init (o_cipher,
> -              clear->size +
> -              EVP_CIPHER_iv_length(key->cipher) +
> -              EVP_CIPHER_block_size (key->cipher),
> -                                0);
> -
> -  // copy the IV into the front
> -  buffer_copy (o_cipher, &iv);
> -
> -  // make an alias into which we'll put the ciphertext
> -  buffer_init_alias (&cipher_alias, o_cipher, EVP_CIPHER_iv_length(key->cipher), 0);
> -
> -  TPMTRYRETURN( ossl_symcrypto_op (key, clear, &iv, &cipher_alias, CRYPT_ENCRYPT) );
> -
> -  // set the output size correctly
> -  o_cipher->size += cipher_alias.size;
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -
> -}
> -
> -
> -
> -TPM_RESULT Crypto_symcrypto_decrypt (symkey_t* key,
> -                              const buffer_t* cipher,
> -                              buffer_t* o_clear) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  buffer_t iv, cipher_alias;
> -
> -  // alias for the IV
> -  buffer_init_alias (&iv, cipher, 0, EVP_CIPHER_iv_length(key->cipher));
> -
> -  // make an alias to where the ciphertext is, after the IV
> -  buffer_init_alias (&cipher_alias, cipher, EVP_CIPHER_iv_length(key->cipher), 0);
> -
> -  // prepare the output buffer
> -  TPMTRYRETURN( buffer_init (o_clear,
> -                       cipher->size
> -                       - EVP_CIPHER_iv_length(key->cipher)
> -                       + EVP_CIPHER_block_size(key->cipher),
> -                       0) );
> -
> -  // and decrypt
> -  TPMTRYRETURN ( ossl_symcrypto_op (key, &cipher_alias, &iv, o_clear, CRYPT_DECRYPT) );
> -
> -  goto egress;
> -
> - abort_egress:
> -  buffer_free (o_clear);
> -
> - egress:
> -
> -  return status;
> -}
> -
> -
> -
> -TPM_RESULT Crypto_symcrypto_freekey (symkey_t * key) {
> -  buffer_memset (&key->key, 0);
> -  buffer_free (&key->key);
> -
> -  EVP_CIPHER_CTX_cleanup (&key->context);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -TPM_RESULT ossl_symcrypto_op (symkey_t* key,
> -                              const buffer_t* in,
> -                              const buffer_t* iv,
> -                              buffer_t * out,
> -                              crypt_op_type_t optype) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  int inlen, outlen;
> -  tpm_size_t running;
> -
> -  if ( ! EVP_CipherInit_ex (&key->context,
> -                           key->cipher, NULL, key->key.bytes, iv->bytes,
> -                           optype == CRYPT_ENCRYPT ? 1 : 0) )
> -    ERRORDIE (TPM_FAIL);
> -
> -
> -
> -  inlen = in->size;
> -
> -  outlen  = 0;
> -  running = 0;
> -
> -
> -  if ( ! EVP_CipherUpdate (&key->context, out->bytes, &outlen, in->bytes, inlen) )
> -    ERRORDIE (TPM_FAIL);
> -
> -  running += outlen;
> -
> -  if ( ! EVP_CipherFinal_ex (&key->context, out->bytes + running, &outlen) )
> -    ERRORDIE (TPM_FAIL);
> -
> -  running += outlen;
> -
> -  out->size = running;
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/crypto/sym_crypto.h b/tools/vtpm_manager/crypto/sym_crypto.h
> deleted file mode 100644
> index 7fb59a8..0000000
> --- a/tools/vtpm_manager/crypto/sym_crypto.h
> +++ /dev/null
> @@ -1,72 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// sym_crypto.h
> -//
> -//     Symmetric Crypto
> -//
> -// ==================================================================
> -
> -#ifndef _SYM_CRYPTO_H
> -#define _SYM_CRYPTO_H
> -
> -#include <openssl/evp.h>
> -#include "buffer.h"
> -
> -typedef struct symkey_t {
> -  buffer_t key;
> -
> -  EVP_CIPHER_CTX context;
> -  const EVP_CIPHER * cipher;
> -} symkey_t;
> -
> -extern const EVP_CIPHER * SYM_CIPHER;
> -
> -TPM_RESULT Crypto_symcrypto_genkey (symkey_t * key);
> -
> -TPM_RESULT Crypto_symcrypto_initkey (symkey_t * key, const buffer_t* keybits);
> -
> -
> -// these functions will allocate their output buffers
> -TPM_RESULT Crypto_symcrypto_encrypt (symkey_t* key,
> -                              const buffer_t* clear,
> -                              buffer_t* o_cipher);
> -
> -TPM_RESULT Crypto_symcrypto_decrypt (symkey_t* key,
> -                              const buffer_t* cipher,
> -                              buffer_t* o_clear);
> -
> -// only free the internal parts, not the 'key' ptr
> -TPM_RESULT Crypto_symcrypto_freekey (symkey_t * key);
> -
> -#endif /* _SYM_CRYPTO_H */
> diff --git a/tools/vtpm_manager/manager/Makefile b/tools/vtpm_manager/manager/Makefile
> deleted file mode 100644
> index a33c18a..0000000
> --- a/tools/vtpm_manager/manager/Makefile
> +++ /dev/null
> @@ -1,38 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -BIN            = vtpm_managerd
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIN)
> -
> -.PHONY: install
> -install: build
> -       if [ ! -d "$(DESTDIR)/var/vtpm/fifos" ]; \
> -               then mkdir -p $(DESTDIR)/var/vtpm/fifos; \
> -       fi
> -       if [ ! -d "$(DESTDIR)/var/vtpm/socks" ]; \
> -               then mkdir -p $(DESTDIR)/var/vtpm/socks; \
> -       fi
> -       $(INSTALL_PROG) $(BIN) $(DESTDIR)$(BINDIR)
> -
> -.PHONY: clean
> -clean:
> -       rm -f $(BIN)
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIN): $(OBJS)
> -       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
> -
> -# libraries
> -LIBS += ../tcs/libTCS.a ../util/libTCGUtils.a ../crypto/libtcpaCrypto.a
> -LIBS += -lcrypto $(PTHREAD_LIBS) -lm
> -CFLAGS += $(PTHREAD_CFLAGS)
> -LDFLAGS += $(PTHREAD_LDFLAGS)
> diff --git a/tools/vtpm_manager/manager/dmictl.c b/tools/vtpm_manager/manager/dmictl.c
> deleted file mode 100644
> index 5c3cf7e..0000000
> --- a/tools/vtpm_manager/manager/dmictl.c
> +++ /dev/null
> @@ -1,266 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -//   dmictl.c
> -//
> -//     Functions for creating and destroying DMIs
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <string.h>
> -
> -#include "vtpmpriv.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -#include "vtpm_ipc.h"
> -
> -#define TPM_EMULATOR_PATH "/usr/bin/vtpmd"
> -
> -// if dmi_res is non-null, then return a pointer to new object.
> -// Also, this does not fill in the measurements. They should be filled by
> -// design dependent code or saveNVM
> -TPM_RESULT init_dmi(UINT32 dmi_id, BYTE dmi_type, VTPM_DMI_RESOURCE **dmi_res) {
> -
> -  TPM_RESULT status=TPM_SUCCESS;
> -  VTPM_DMI_RESOURCE *new_dmi=NULL;
> -  UINT32 *dmi_id_key=NULL;
> -
> -  if ((new_dmi = (VTPM_DMI_RESOURCE *) malloc (sizeof(VTPM_DMI_RESOURCE))) == NULL) {
> -      status = TPM_RESOURCES;
> -      goto abort_egress;
> -  }
> -  memset(new_dmi, 0, sizeof(VTPM_DMI_RESOURCE));
> -  new_dmi->dmi_id = dmi_id;
> -  new_dmi->dmi_type = dmi_type;
> -  new_dmi->connected = FALSE;
> -  new_dmi->TCSContext = 0;
> -
> -  new_dmi->NVMLocation = (char *) malloc(11 + strlen(DMI_NVM_FILE));
> -  sprintf(new_dmi->NVMLocation, DMI_NVM_FILE, (uint32_t) new_dmi->dmi_id);
> -
> -  if ((dmi_id_key = (UINT32 *) malloc (sizeof(UINT32))) == NULL) {
> -    status = TPM_RESOURCES;
> -    goto abort_egress;
> -  }
> -  *dmi_id_key = new_dmi->dmi_id;
> -
> -  // install into map
> -  if (!hashtable_insert(vtpm_globals->dmi_map, dmi_id_key, new_dmi)){
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to insert instance into table. Aborting.\n", dmi_id);
> -    status = TPM_FAIL;
> -    goto abort_egress;
> -  }
> -
> -  if (dmi_res)
> -    *dmi_res = new_dmi;
> -
> -  goto egress;
> -
> - abort_egress:
> -  if (new_dmi) {
> -    free(new_dmi->NVMLocation);
> -    free(new_dmi);
> -  }
> -  free(dmi_id_key);
> -
> - egress:
> -  return status;
> -}
> -
> -TPM_RESULT close_dmi(VTPM_DMI_RESOURCE *dmi_res) {
> -  if (dmi_res == NULL)
> -    return TPM_SUCCESS;
> -
> -  if (dmi_res->dmi_id == VTPM_CTL_DM)
> -    return(TPM_BAD_PARAMETER);
> -
> -  TCS_CloseContext(dmi_res->TCSContext);
> -  dmi_res->connected = FALSE;
> -
> -  vtpm_globals->connected_dmis--;
> -
> -  return (VTPM_Close_DMI_Extra(dmi_res) );
> -}
> -
> -TPM_RESULT VTPM_Handle_New_DMI(const buffer_t *param_buf) {
> -
> -  VTPM_DMI_RESOURCE *new_dmi=NULL;
> -  TPM_RESULT status=TPM_FAIL;
> -  BYTE dmi_type, vm_type, startup_mode;
> -  UINT32 dmi_id;
> -
> -  if (param_buf == NULL) { // Assume creation of Dom 0 control
> -    dmi_type = VTPM_TYPE_NON_MIGRATABLE;
> -    dmi_id = VTPM_CTL_DM;
> -  } else if (buffer_len(param_buf) != sizeof(BYTE) * 3  + sizeof(UINT32)) {
> -    vtpmloginfo(VTPM_LOG_VTPM, "New DMI command wrong length: %d.\n", buffer_len(param_buf));
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  } else {
> -    vtpm_globals->connected_dmis++; // Put this here so we don't count Dom0
> -    BSG_UnpackList( param_buf->bytes, 4,
> -                   BSG_TYPE_BYTE, &dmi_type,
> -                   BSG_TYPE_BYTE, &startup_mode,
> -                   BSG_TYPE_BYTE, &vm_type,
> -                   BSG_TYPE_UINT32,  &dmi_id);
> -  }
> -
> -  if ((dmi_type != VTPM_TYPE_NON_MIGRATABLE) && (dmi_type != VTPM_TYPE_MIGRATABLE)) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Creation of VTPM with illegal type.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  new_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> -  if (new_dmi == NULL) {
> -    vtpmloginfo(VTPM_LOG_VTPM, "Creating new DMI instance %d attached.\n", dmi_id );
> -    // Brand New DMI. Initialize the persistent pieces
> -    TPMTRYRETURN(init_dmi(dmi_id, dmi_type, &new_dmi) );
> -  } else
> -    vtpmloginfo(VTPM_LOG_VTPM, "Re-attaching DMI instance %d.\n", dmi_id);
> -
> -  if (new_dmi->connected) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Attempt to re-attach, currently attached instance %d. Ignoring\n", dmi_id);
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  if (new_dmi->dmi_type == VTPM_TYPE_MIGRATED) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Attempt to re-attach previously migrated instance %d without recovering first. Ignoring\n", dmi_id);
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  // Initialize the Non-persistent pieces
> -  TPMTRYRETURN( TCS_OpenContext(&new_dmi->TCSContext) );
> -
> -  new_dmi->connected = TRUE;
> -
> -  // Design specific new DMI code.
> -  // Includes: create IPCs, Measuring DMI, and maybe launching DMI
> -  TPMTRYRETURN(VTPM_New_DMI_Extra(new_dmi, vm_type, startup_mode) );
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to create DMI id=%d due to status=%s. Cleaning.\n", dmi_id, tpm_get_error_name(status));
> -  close_dmi(new_dmi );
> -
> - egress:
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Close_DMI( const buffer_t *param_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_DMI_RESOURCE *dmi_res=NULL;
> -  UINT32 dmi_id;
> -
> -  if ((param_buf == NULL) || (buffer_len(param_buf) != sizeof(UINT32)) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing DMI has bad size.");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  BSG_UnpackList( param_buf->bytes, 1,
> -                 BSG_TYPE_UINT32, &dmi_id);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Closing DMI %d.\n", dmi_id);
> -
> -  dmi_res = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> -  if (dmi_res == NULL ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Trying to close nonexistent DMI.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  if (!dmi_res->connected) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing non-connected DMI.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  // Close Dmi
> -       TPMTRYRETURN(close_dmi( dmi_res ));
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Delete_DMI( const buffer_t *param_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_DMI_RESOURCE *dmi_res=NULL;
> -  UINT32 dmi_id;
> -
> -  if ((param_buf == NULL) || (buffer_len(param_buf) != sizeof(UINT32)) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing DMI has bad size.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  BSG_UnpackList( param_buf->bytes, 1,
> -                 BSG_TYPE_UINT32, &dmi_id);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Deleting DMI %d.\n", dmi_id);
> -
> -  dmi_res = (VTPM_DMI_RESOURCE *) hashtable_remove(vtpm_globals->dmi_map, &dmi_id);
> -  if (dmi_res == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing non-existent DMI.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  //vtpm scripts delete file dmi_res->NVMLocation for us
> -
> -  // Close DMI first
> -  TPMTRYRETURN(close_dmi( dmi_res ));
> -  free ( dmi_res );
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/manager/migration.c b/tools/vtpm_manager/manager/migration.c
> deleted file mode 100644
> index 54da708..0000000
> --- a/tools/vtpm_manager/manager/migration.c
> +++ /dev/null
> @@ -1,307 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -//   dmictl.c
> -//
> -//     Functions for creating and destroying DMIs
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <string.h>
> -
> -#include "vtpmpriv.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "hashtable.h"
> -
> -TPM_RESULT VTPM_Handle_Migrate_In( const buffer_t *param_buf,
> -                                   buffer_t *result_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_DMI_RESOURCE *mig_dmi=NULL;
> -  UINT32 dmi_id;
> -  buffer_t dmi_state_abuf = NULL_BUF, enc_dmi_abuf = NULL_BUF, clear_dmi_blob = NULL_BUF;
> -
> -  if (param_buf == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Migration Out Failed due to bad parameter.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  struct pack_buf_t enc_dmi_state_pack;
> -
> -  BSG_UnpackList(param_buf->bytes, 2,
> -                 BSG_TYPE_UINT32, &dmi_id,
> -                 BSG_TPM_SIZE32_DATA, &enc_dmi_state_pack) ;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Migrating VTPM in dmi %d.\n", dmi_id);
> -
> -  mig_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> -  if (mig_dmi) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Incoming VTPM claims unavailable id: %d.\n", dmi_id);
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  /** UnBind Blob **/
> -  TPMTRYRETURN( buffer_init_alias_convert( &enc_dmi_abuf,
> -                                           enc_dmi_state_pack.size,
> -                                           enc_dmi_state_pack.data) );
> -
> -  TPMTRYRETURN( envelope_decrypt( &enc_dmi_abuf,
> -                                   vtpm_globals->manager_tcs_handle,
> -                                   vtpm_globals->storageKeyHandle,
> -                                   (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
> -                                   &clear_dmi_blob) );
> -
> -  // Create new dmi
> -  TPMTRYRETURN( init_dmi(dmi_id, VTPM_TYPE_MIGRATABLE, &mig_dmi ) );
> -
> -  /** Open Blob **/
> -  struct pack_buf_t dmi_state_pack;
> -
> -  BSG_UnpackList(clear_dmi_blob.bytes, 2,
> -                 BSG_TPM_DIGEST, &mig_dmi->DMI_measurement,
> -                 BSG_TPM_SIZE32_DATA, &dmi_state_pack);
> -
> -  TPMTRYRETURN( buffer_init_alias_convert(&dmi_state_abuf,
> -                                          dmi_state_pack.size,
> -                                          dmi_state_pack.data) );
> -
> -  TPMTRYRETURN( VTPM_Handle_Save_NVM(mig_dmi, &dmi_state_abuf, NULL ) );
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Migration IN of instance %d failed because of %s.\n", dmi_id, tpm_get_error_name(status) );
> -
> - egress:
> -  buffer_free(&clear_dmi_blob);
> -  buffer_free(&dmi_state_abuf);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Migrate_Out( const buffer_t *param_buf,
> -                                    buffer_t *result_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_DMI_RESOURCE *mig_dmi;
> -  UINT32 dmi_id;
> -  VTPM_MIGKEY_LIST *last_mig, *mig_key;
> -  buffer_t dmi_state=NULL_BUF, clear_dmi_blob=NULL_BUF;
> -
> -  if (param_buf == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Migration Out Failed due to bad parameter.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  struct pack_buf_t name_pack;
> -
> -  BSG_UnpackList( param_buf->bytes, 2,
> -                  BSG_TYPE_UINT32, &dmi_id,
> -                  BSG_TPM_SIZE32_DATA, &name_pack);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Migrating out dmi %d.\n", dmi_id);
> -
> -  mig_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> -  if (mig_dmi == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Non-existent VTPM instance (%d) in migration.\n", dmi_id );
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  if (mig_dmi->dmi_type != VTPM_TYPE_MIGRATABLE) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Bad VTPM type (%d) in migration of instance (%d).\n", mig_dmi->dmi_type, dmi_id );
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  /** Find migration key for dest **/
> -  last_mig = NULL;
> -  mig_key = vtpm_globals->mig_keys;
> -  while (mig_key != NULL) {
> -    if (mig_key->name_size == name_pack.size)
> -      if (memcmp(mig_key->name, name_pack.data, name_pack.size) == 0) {
> -        break;
> -      }
> -
> -    last_mig = mig_key;
> -    mig_key = mig_key->next;
> -  }
> -
> -  if (!mig_key) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unknown Migration target host.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  /** Mark vtpm as migrated **/
> -  mig_dmi->dmi_type = VTPM_TYPE_MIGRATED;
> -
> -  /** Build Blob **/
> -  TPMTRYRETURN( VTPM_Handle_Load_NVM(mig_dmi, NULL, &dmi_state) );
> -
> -  TPMTRYRETURN( buffer_init(&clear_dmi_blob, sizeof(TPM_DIGEST) + sizeof(UINT32) + buffer_len(&dmi_state), NULL ) );
> -
> -  struct pack_constbuf_t dmi_state_pack;
> -
> -  dmi_state_pack.size = buffer_len(&dmi_state);
> -  dmi_state_pack.data = dmi_state.bytes;
> -
> -  BSG_PackList(clear_dmi_blob.bytes, 2,
> -               BSG_TPM_DIGEST, &mig_dmi->DMI_measurement,
> -               BSG_TPM_SIZE32_DATA, &dmi_state_pack);
> -
> -  /** Bind Blob **/
> -  TPMTRYRETURN( envelope_encrypt( &clear_dmi_blob,
> -                                  &mig_key->key,
> -                                  result_buf) );
> -
> -  if (last_mig)
> -    last_mig->next = mig_key->next;
> -  else
> -    vtpm_globals->mig_keys = mig_key->next;
> -
> -  free(mig_key->name);
> -  free(mig_key);
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Migration OUT of instance %d failed because of %s. Migratoin recovery may be needed.\n", dmi_id, tpm_get_error_name(status) );
> -
> -    //TODO: Create and implement a policy for what happens to mig_key on failed migrations.
> -
> - egress:
> -
> -  buffer_free(&clear_dmi_blob);
> -  buffer_free(&dmi_state);
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTPM_Handle_Get_Migration_key( const buffer_t *param_buf,
> -                                          buffer_t *result_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Getting Migration Public Key.\n");
> -
> -  struct pack_buf_t pubkey_exp_pack, pubkey_mod_pack;
> -  TPM_KEY mig_key;
> -
> -  // Unpack/return key structure
> -  BSG_Unpack(BSG_TPM_KEY, vtpm_globals->storageKeyWrap.bytes , &mig_key);
> -  TPM_RSA_KEY_PARMS rsaKeyParms;
> -
> -  BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
> -               mig_key.algorithmParms.parms,
> -               &rsaKeyParms);
> -
> -  pubkey_exp_pack.size = rsaKeyParms.exponentSize;
> -  pubkey_exp_pack.data = rsaKeyParms.exponent;
> -  pubkey_mod_pack.size = mig_key.pubKey.keyLength;
> -  pubkey_mod_pack.data = mig_key.pubKey.key;
> -
> -  TPMTRYRETURN( buffer_init( result_buf, 2*sizeof(UINT32) +
> -                                         pubkey_exp_pack.size +
> -                                         pubkey_mod_pack.size, NULL ) );
> -
> -  BSG_PackList( result_buf->bytes, 2,
> -                  BSG_TPM_SIZE32_DATA, &pubkey_exp_pack,
> -                  BSG_TPM_SIZE32_DATA, &pubkey_mod_pack);
> -
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Get Migration Key failed because of %s.\n", tpm_get_error_name(status) );
> - egress:
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Load_Migration_key( const buffer_t *param_buf,
> -                                           buffer_t *result_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_MIGKEY_LIST *mig_key;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Loading Migration Public Key.\n");
> -
> -  //FIXME: Review all uses of unpacking pack_buf_t and ensure free.
> -  //FIXME: Review all declarations/initializations of buffer_t that could have a goto that skips them and then tries to free them
> -
> -  struct pack_buf_t name_pack, pubkey_exp_pack, pubkey_mod_pack;
> -
> -  //FIXME: scan list and verify name is not already in the list
> -
> -  BSG_UnpackList( param_buf->bytes, 3,
> -                  BSG_TPM_SIZE32_DATA, &name_pack,
> -                  BSG_TPM_SIZE32_DATA, &pubkey_exp_pack,
> -                  BSG_TPM_SIZE32_DATA, &pubkey_mod_pack);
> -
> -  //TODO: Maintain a persistent list for pub_keys.
> -  //TODO: Verify pub_key is trusted
> -
> -  mig_key = (VTPM_MIGKEY_LIST *) malloc(sizeof(VTPM_MIGKEY_LIST));
> -  memset(mig_key, 0, sizeof(VTPM_MIGKEY_LIST) );
> -  mig_key->name_size = name_pack.size;
> -  mig_key->name = name_pack.data;
> -
> -  mig_key->key.encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
> -  Crypto_RSABuildCryptoInfoPublic( pubkey_exp_pack.size,
> -                                   pubkey_exp_pack.data,
> -                                   pubkey_mod_pack.size,
> -                                   pubkey_mod_pack.data,
> -                                   &mig_key->key);
> -
> -
> -  mig_key->next = vtpm_globals->mig_keys;
> -  vtpm_globals->mig_keys = mig_key;
> -
> -  // free(name_pack.data); Do not free. data is now part of mig_key.
> -  free(pubkey_exp_pack.data);
> -  free(pubkey_mod_pack.data);
> -
> -  return TPM_SUCCESS;
> -}
> diff --git a/tools/vtpm_manager/manager/securestorage.c b/tools/vtpm_manager/manager/securestorage.c
> deleted file mode 100644
> index d5e6ffd..0000000
> --- a/tools/vtpm_manager/manager/securestorage.c
> +++ /dev/null
> @@ -1,512 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// securestorage.c
> -//
> -//  Functions regarding securely storing DMI secrets.
> -//
> -// ==================================================================
> -
> -#include <sys/types.h>
> -#include <sys/stat.h>
> -#include <fcntl.h>
> -#include <unistd.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "vtsp.h"
> -#include "bsg.h"
> -#include "crypto.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -#include "buffer.h"
> -#include "log.h"
> -
> -TPM_RESULT envelope_encrypt(const buffer_t     *inbuf,
> -                            CRYPTO_INFO        *asymkey,
> -                            buffer_t           *sealed_data) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -  symkey_t    symkey;
> -  buffer_t    data_cipher = NULL_BUF,
> -              symkey_cipher = NULL_BUF;
> -
> -  UINT32 i;
> -  struct pack_constbuf_t symkey_cipher32, data_cipher32;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Enveloping Input[%d]: 0x", buffer_len(inbuf));
> -  for (i=0; i< buffer_len(inbuf); i++)
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", inbuf->bytes[i]);
> -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -  // Generate a sym key and encrypt state with it
> -  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_symcrypto_genkey (&symkey) );
> -  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_symcrypto_encrypt (&symkey, inbuf, &data_cipher) );
> -
> -  // Encrypt symmetric key
> -  TPMTRYRETURN( VTSP_Bind(    asymkey,
> -                             &symkey.key,
> -                             &symkey_cipher) );
> -
> -  // Create output blob: symkey_size + symkey_cipher + state_cipher_size + state_cipher
> -
> -  symkey_cipher32.size = buffer_len(&symkey_cipher);
> -  symkey_cipher32.data = symkey_cipher.bytes;
> -
> -  data_cipher32.size = buffer_len(&data_cipher);
> -  data_cipher32.data = data_cipher.bytes;
> -
> -  TPMTRYRETURN( buffer_init(sealed_data, 2 * sizeof(UINT32) + symkey_cipher32.size + data_cipher32.size, NULL));
> -
> -  BSG_PackList(sealed_data->bytes, 2,
> -              BSG_TPM_SIZE32_DATA, &symkey_cipher32,
> -              BSG_TPM_SIZE32_DATA, &data_cipher32);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Saved %d bytes of E(symkey) + %d bytes of E(data)\n", buffer_len(&symkey_cipher), buffer_len(&data_cipher));
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Enveloping Output[%d]: 0x", buffer_len(sealed_data));
> -  for (i=0; i< buffer_len(sealed_data); i++)
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", sealed_data->bytes[i]);
> -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to envelope encrypt\n.");
> -
> - egress:
> -
> -  buffer_free ( &data_cipher);
> -  buffer_free ( &symkey_cipher);
> -  Crypto_symcrypto_freekey (&symkey);
> -
> -  return status;
> -}
> -
> -TPM_RESULT envelope_decrypt(const buffer_t     *cipher,
> -                            TCS_CONTEXT_HANDLE TCSContext,
> -                           TPM_HANDLE         keyHandle,
> -                           const TPM_AUTHDATA *key_usage_auth,
> -                            buffer_t           *unsealed_data) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  symkey_t    symkey;
> -  buffer_t    data_cipher = NULL_BUF,
> -              symkey_clear = NULL_BUF,
> -              symkey_cipher = NULL_BUF;
> -  struct pack_buf_t symkey_cipher32, data_cipher32;
> -  int i;
> -
> -  memset(&symkey, 0, sizeof(symkey_t));
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Envelope Decrypt Input[%d]: 0x", buffer_len(cipher) );
> -  for (i=0; i< buffer_len(cipher); i++)
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cipher->bytes[i]);
> -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -  BSG_UnpackList(cipher->bytes, 2,
> -                BSG_TPM_SIZE32_DATA, &symkey_cipher32,
> -                BSG_TPM_SIZE32_DATA, &data_cipher32);
> -
> -  TPMTRYRETURN( buffer_init_alias_convert (&symkey_cipher,
> -                                          symkey_cipher32.size,
> -                                          symkey_cipher32.data) );
> -
> -  TPMTRYRETURN( buffer_init_alias_convert (&data_cipher,
> -                                          data_cipher32.size,
> -                                          data_cipher32.data) );
> -
> -  // Decrypt Symmetric Key
> -  TPMTRYRETURN( VTSP_Unbind(  TCSContext,
> -                             keyHandle,
> -                             &symkey_cipher,
> -                             key_usage_auth,
> -                             &symkey_clear,
> -                             &(vtpm_globals->keyAuth) ) );
> -
> -  // create symmetric key using saved bits
> -  Crypto_symcrypto_initkey (&symkey, &symkey_clear);
> -
> -  // Decrypt State
> -  TPMTRY(TPM_DECRYPT_ERROR, Crypto_symcrypto_decrypt (&symkey, &data_cipher, unsealed_data) );
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Envelope Decrypte Output[%d]: 0x", buffer_len(unsealed_data));
> -  for (i=0; i< buffer_len(unsealed_data); i++)
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", unsealed_data->bytes[i]);
> -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to envelope decrypt data\n.");
> -
> - egress:
> -  buffer_free ( &data_cipher);
> -  buffer_free ( &symkey_clear);
> -  buffer_free ( &symkey_cipher);
> -  Crypto_symcrypto_freekey (&symkey);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Save_NVM(VTPM_DMI_RESOURCE *myDMI,
> -                               const buffer_t *inbuf,
> -                               buffer_t *outbuf) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  int fh;
> -  long bytes_written;
> -  buffer_t sealed_NVM = NULL_BUF;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Saving %d bytes of NVM.\n", buffer_len(inbuf));
> -
> -  TPMTRYRETURN( envelope_encrypt(inbuf,
> -                                 &vtpm_globals->storageKey,
> -                                 &sealed_NVM) );
> -
> -  // Write sealed blob off disk from NVMLocation
> -  // TODO: How to properly return from these. Do we care if we return failure
> -  //       after writing the file? We can't get the old one back.
> -  // TODO: Backup old file and try and recover that way.
> -  fh = open(myDMI->NVMLocation, O_WRONLY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
> -  if ( (bytes_written = write(fh, sealed_NVM.bytes, buffer_len(&sealed_NVM) ) != (long) buffer_len(&sealed_NVM))) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "We just overwrote a DMI_NVM and failed to finish. %ld/%ld bytes.\n", bytes_written, (long)buffer_len(&sealed_NVM));
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -  close(fh);
> -
> -  Crypto_SHA1Full (sealed_NVM.bytes, buffer_len(&sealed_NVM), (BYTE *) &myDMI->NVM_measurement);
> -
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to save NVM\n.");
> -
> - egress:
> -  buffer_free(&sealed_NVM);
> -  return status;
> -}
> -
> -
> -/* Expected Params: inbuf = null, outbuf = sealed blob size, sealed blob.*/
> -TPM_RESULT VTPM_Handle_Load_NVM(VTPM_DMI_RESOURCE *myDMI,
> -                               const buffer_t    *inbuf,
> -                               buffer_t          *outbuf) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  buffer_t sealed_NVM = NULL_BUF;
> -  long fh_size;
> -  int fh, stat_ret, i;
> -  struct stat file_stat;
> -  TPM_DIGEST sealedNVMHash;
> -
> -  if (myDMI->NVMLocation == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to load NVM because the file name NULL.\n");
> -    status = TPM_AUTHFAIL;
> -    goto abort_egress;
> -  }
> -
> -  //Read sealed blob off disk from NVMLocation
> -  fh = open(myDMI->NVMLocation, O_RDONLY);
> -  stat_ret = fstat(fh, &file_stat);
> -  if (stat_ret == 0)
> -    fh_size = file_stat.st_size;
> -  else {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  TPMTRYRETURN( buffer_init( &sealed_NVM, fh_size, NULL) );
> -  if (read(fh, sealed_NVM.bytes, buffer_len(&sealed_NVM)) != fh_size) {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -  close(fh);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Load_NVMing[%d],\n", buffer_len(&sealed_NVM));
> -
> -  Crypto_SHA1Full(sealed_NVM.bytes, buffer_len(&sealed_NVM), (BYTE *) &sealedNVMHash);
> -
> -  // Verify measurement of sealed blob.
> -  if (memcmp(&sealedNVMHash, &myDMI->NVM_measurement, sizeof(TPM_DIGEST)) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM LoadNVM NVM measurement check failed.\n");
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Correct hash: ");
> -    for (i=0; i< sizeof(TPM_DIGEST); i++)
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", ((BYTE*)&myDMI->NVM_measurement)[i]);
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Measured hash: ");
> -    for (i=0; i< sizeof(TPM_DIGEST); i++)
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", ((BYTE*)&sealedNVMHash)[i]);
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -    status = TPM_AUTHFAIL;
> -    goto abort_egress;
> -  }
> -
> -  TPMTRYRETURN( envelope_decrypt(&sealed_NVM,
> -                                 myDMI->TCSContext,
> -                                vtpm_globals->storageKeyHandle,
> -                                (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
> -                                 outbuf) );
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to load NVM\n.");
> -
> - egress:
> -  buffer_free( &sealed_NVM );
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTPM_SaveManagerData(void) {
> -  TPM_RESULT status=TPM_SUCCESS;
> -  int fh, dmis=-1;
> -
> -  BYTE *flat_boot_key=NULL, *flat_dmis=NULL, *flat_enc=NULL;
> -  buffer_t clear_flat_global=NULL_BUF, enc_flat_global=NULL_BUF;
> -  UINT32 storageKeySize = buffer_len(&vtpm_globals->storageKeyWrap);
> -  UINT32 bootKeySize = buffer_len(&vtpm_globals->bootKeyWrap);
> -  struct pack_buf_t storage_key_pack = {storageKeySize, vtpm_globals->storageKeyWrap.bytes};
> -  struct pack_buf_t boot_key_pack = {bootKeySize, vtpm_globals->bootKeyWrap.bytes};
> -  BYTE vtpm_manager_gen = VTPM_MANAGER_GEN;
> -
> -  struct hashtable_itr *dmi_itr;
> -  VTPM_DMI_RESOURCE *dmi_res;
> -
> -  UINT32 boot_key_size = 0, flat_dmis_size = 0;
> -
> -  // Initially fill these with buffer sizes for each data type. Later fill
> -  // in actual size, once flattened.
> -  boot_key_size =  sizeof(UINT32) +       // bootkeysize
> -                   bootKeySize;           // boot key
> -
> -  TPMTRYRETURN(buffer_init(&clear_flat_global,sizeof(BYTE) + // manager version
> -                                              3*sizeof(TPM_DIGEST) + // Auths
> -                                              sizeof(UINT32) +// storagekeysize
> -                                              storageKeySize, NULL) ); // storage key
> -
> -
> -  flat_boot_key = (BYTE *) malloc( boot_key_size );
> -  flat_enc = (BYTE *) malloc( sizeof(UINT32) );
> -
> -  boot_key_size = BSG_PackList(flat_boot_key, 1,
> -                               BSG_TPM_SIZE32_DATA, &boot_key_pack);
> -
> -  BSG_PackList(clear_flat_global.bytes, 4,
> -                BSG_TYPE_BYTE,    &vtpm_manager_gen,
> -                BSG_TPM_AUTHDATA, &vtpm_globals->owner_usage_auth,
> -                BSG_TPM_SECRET,   &vtpm_globals->storage_key_usage_auth,
> -                BSG_TPM_SIZE32_DATA, &storage_key_pack);
> -
> -  TPMTRYRETURN(envelope_encrypt(&clear_flat_global,
> -                                &vtpm_globals->bootKey,
> -                                &enc_flat_global) );
> -
> -  BSG_PackConst(buffer_len(&enc_flat_global), 4, flat_enc);
> -
> -  // Per DMI values to be saved (if any exit)
> -  if (hashtable_count(vtpm_globals->dmi_map) > 1) {
> -
> -    flat_dmis = (BYTE *) malloc(
> -                     (hashtable_count(vtpm_globals->dmi_map) - 1) * // num DMIS (-1 for Dom0)
> -                     (sizeof(UINT32) +sizeof(BYTE) + 2*sizeof(TPM_DIGEST)) ); // Per DMI info
> -
> -    dmi_itr = hashtable_iterator(vtpm_globals->dmi_map);
> -    do {
> -      dmi_res = (VTPM_DMI_RESOURCE *) hashtable_iterator_value(dmi_itr);
> -      dmis++;
> -
> -      // No need to save dmi0.
> -      if (dmi_res->dmi_id == 0)
> -        continue;
> -
> -
> -      flat_dmis_size += BSG_PackList( flat_dmis + flat_dmis_size, 4,
> -                                        BSG_TYPE_UINT32, &dmi_res->dmi_id,
> -                                        BSG_TYPE_BYTE, &dmi_res->dmi_type,
> -                                        BSG_TPM_DIGEST, &dmi_res->NVM_measurement,
> -                                        BSG_TPM_DIGEST, &dmi_res->DMI_measurement);
> -
> -    } while (hashtable_iterator_advance(dmi_itr));
> -  }
> -
> -  fh = open(STATE_FILE, O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
> -  if (fh == -1) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to open %s file for write.\n", STATE_FILE);
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if ( ( write(fh, flat_boot_key, boot_key_size) != boot_key_size ) ||
> -       ( write(fh, flat_enc, sizeof(UINT32)) != sizeof(UINT32) ) ||
> -       ( write(fh, enc_flat_global.bytes, buffer_len(&enc_flat_global)) != buffer_len(&enc_flat_global) ) ||
> -       ( write(fh, flat_dmis, flat_dmis_size) != flat_dmis_size ) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to completely write service data.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> - }
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  free(flat_boot_key);
> -  free(flat_enc);
> -  buffer_free(&enc_flat_global);
> -  free(flat_dmis);
> -  close(fh);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Saved VTPM Manager state (status = %d, dmis = %d)\n", (int) status, dmis);
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_LoadManagerData(void) {
> -
> -  TPM_RESULT status=TPM_SUCCESS;
> -  int fh, stat_ret, dmis=0;
> -  long fh_size = 0, step_size;
> -  BYTE *flat_table=NULL;
> -  buffer_t  unsealed_data, enc_table_abuf;
> -  struct pack_buf_t storage_key_pack, boot_key_pack;
> -  UINT32 *dmi_id_key, enc_size;
> -  BYTE vtpm_manager_gen;
> -
> -  VTPM_DMI_RESOURCE *dmi_res;
> -  UINT32 dmi_id;
> -  BYTE dmi_type;
> -  struct stat file_stat;
> -
> -  TPM_HANDLE boot_key_handle;
> -  TPM_AUTHDATA boot_usage_auth;
> -  memset(&boot_usage_auth, 0, sizeof(TPM_AUTHDATA));
> -
> -  fh = open(STATE_FILE, O_RDONLY );
> -  stat_ret = fstat(fh, &file_stat);
> -  if (stat_ret == 0)
> -    fh_size = file_stat.st_size;
> -  else {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  flat_table = (BYTE *) malloc(fh_size);
> -
> -  if ((long) read(fh, flat_table, fh_size) != fh_size ) {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  // Read Boot Key
> -  step_size = BSG_UnpackList( flat_table, 2,
> -                              BSG_TPM_SIZE32_DATA, &boot_key_pack,
> -                              BSG_TYPE_UINT32, &enc_size);
> -
> -  TPMTRYRETURN(buffer_init(&vtpm_globals->bootKeyWrap, 0, 0) );
> -  TPMTRYRETURN(buffer_init_alias_convert(&enc_table_abuf, enc_size, flat_table + step_size) );
> -  TPMTRYRETURN(buffer_append_raw(&vtpm_globals->bootKeyWrap, boot_key_pack.size, boot_key_pack.data) );
> -
> -  //Load Boot Key
> -  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
> -                              TPM_SRK_KEYHANDLE,
> -                              &vtpm_globals->bootKeyWrap,
> -                              &SRK_AUTH,
> -                              &boot_key_handle,
> -                              &vtpm_globals->keyAuth,
> -                              &vtpm_globals->bootKey,
> -                              FALSE) );
> -
> -  TPMTRYRETURN( envelope_decrypt(&enc_table_abuf,
> -                                 vtpm_globals->manager_tcs_handle,
> -                                 boot_key_handle,
> -                                 (const TPM_AUTHDATA*) &boot_usage_auth,
> -                                 &unsealed_data) );
> -  step_size += enc_size;
> -
> -  if (*unsealed_data.bytes != VTPM_MANAGER_GEN) {
> -      // Once there is more than one gen, this will include some compatability stuff
> -      vtpmlogerror(VTPM_LOG_VTPM, "Warning: Manager Data file is gen %d, which this manager is gen %d.\n", vtpm_manager_gen, VTPM_MANAGER_GEN);
> -  }
> -
> -  // Global Values needing to be saved
> -  BSG_UnpackList( unsealed_data.bytes, 4,
> -                  BSG_TYPE_BYTE,    &vtpm_manager_gen,
> -                  BSG_TPM_AUTHDATA, &vtpm_globals->owner_usage_auth,
> -                  BSG_TPM_SECRET,   &vtpm_globals->storage_key_usage_auth,
> -                  BSG_TPM_SIZE32_DATA, &storage_key_pack);
> -
> -  TPMTRYRETURN(buffer_init(&vtpm_globals->storageKeyWrap, 0, 0) );
> -  TPMTRYRETURN(buffer_append_raw(&vtpm_globals->storageKeyWrap, storage_key_pack.size, storage_key_pack.data) );
> -
> -  // Per DMI values to be saved
> -  while ( step_size < fh_size ){
> -    if (fh_size - step_size < (long) (sizeof(UINT32) + sizeof(BYTE) + 2*sizeof(TPM_DIGEST))) {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Encountered %ld extra bytes at end of manager state.\n", fh_size-step_size);
> -      step_size = fh_size;
> -    } else {
> -      step_size += BSG_UnpackList(flat_table + step_size, 2,
> -                                 BSG_TYPE_UINT32, &dmi_id,
> -                                 BSG_TYPE_BYTE, &dmi_type);
> -
> -      //TODO: Try and gracefully recover from problems.
> -      TPMTRYRETURN(init_dmi(dmi_id, dmi_type, &dmi_res) );
> -      dmis++;
> -
> -      step_size += BSG_UnpackList(flat_table + step_size, 2,
> -                                 BSG_TPM_DIGEST, &dmi_res->NVM_measurement,
> -                                 BSG_TPM_DIGEST, &dmi_res->DMI_measurement);
> -    }
> -
> -  }
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Loaded saved state (dmis = %d).\n", dmis);
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to load service data with error = %s\n", tpm_get_error_name(status));
> - egress:
> -
> -  free(flat_table);
> -  close(fh);
> -
> -  // TODO: Could be nice and evict BootKey. (Need to add EvictKey to VTSP.
> -
> -  return status;
> -}
> -
> diff --git a/tools/vtpm_manager/manager/tpmpassthrough.c b/tools/vtpm_manager/manager/tpmpassthrough.c
> deleted file mode 100644
> index 9b1e5f8..0000000
> --- a/tools/vtpm_manager/manager/tpmpassthrough.c
> +++ /dev/null
> @@ -1,110 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tpmpassthrough.c
> -//
> -//  Functions regarding passing DMI requests to HWTPM
> -//
> -// ==================================================================
> -
> -#include "tcg.h"
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "vtsp.h"
> -#include "log.h"
> -
> -TPM_RESULT VTPM_Handle_TPM_Command( VTPM_DMI_RESOURCE *dmi,
> -                                   buffer_t *inbuf,
> -                                   buffer_t *outbuf) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE *ord;
> -
> -  ord = (TPM_COMMAND_CODE *) (inbuf->bytes + sizeof(TPM_TAG) + sizeof(UINT32));
> -
> -  switch (*ord) {
> -
> -    // Forbidden for DMI use
> -  case TPM_ORD_TakeOwnership:
> -  case TPM_ORD_ChangeAuthOwner:
> -  case TPM_ORD_DirWriteAuth:
> -  case TPM_ORD_DirRead:
> -  case TPM_ORD_AuthorizeMigrationKey:
> -  case TPM_ORD_CreateMaintenanceArchive:
> -  case TPM_ORD_LoadMaintenanceArchive:
> -  case TPM_ORD_KillMaintenanceFeature:
> -  case TPM_ORD_LoadManuMaintPub:
> -  case TPM_ORD_ReadManuMaintPub:
> -  case TPM_ORD_SelfTestFull:
> -  case TPM_ORD_SelfTestStartup:
> -  case TPM_ORD_CertifySelfTest:
> -  case TPM_ORD_ContinueSelfTest:
> -  case TPM_ORD_GetTestResult:
> -  case TPM_ORD_Reset:
> -  case TPM_ORD_OwnerClear:
> -  case TPM_ORD_DisableOwnerClear:
> -  case TPM_ORD_ForceClear:
> -  case TPM_ORD_DisableForceClear:
> -  case TPM_ORD_GetCapabilityOwner:
> -  case TPM_ORD_OwnerSetDisable:
> -  case TPM_ORD_PhysicalEnable:
> -  case TPM_ORD_PhysicalDisable:
> -  case TPM_ORD_SetOwnerInstall:
> -  case TPM_ORD_PhysicalSetDeactivated:
> -  case TPM_ORD_SetTempDeactivated:
> -  case TPM_ORD_CreateEndorsementKeyPair:
> -  case TPM_ORD_GetAuditEvent:
> -  case TPM_ORD_GetAuditEventSigned:
> -  case TPM_ORD_GetOrdinalAuditStatus:
> -  case TPM_ORD_SetOrdinalAuditStatus:
> -  case TPM_ORD_SetRedirection:
> -  case TPM_ORD_FieldUpgrade:
> -  case TSC_ORD_PhysicalPresence:
> -    status = TPM_DISABLED_CMD;
> -    goto abort_egress;
> -    break;
> -
> -  } // End ORD Switch
> -
> -  // Call TCS with command
> -
> -  TPMTRY(TPM_IOERROR, VTSP_RawTransmit( dmi->TCSContext,inbuf, outbuf) );
> -
> -  goto egress;
> -
> - abort_egress:
> -  vtpmloginfo(VTPM_LOG_VTPM, "TPM Command Failed in tpmpassthrough.\n");
> - egress:
> -
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/manager/vtpm_ipc.c b/tools/vtpm_manager/manager/vtpm_ipc.c
> deleted file mode 100644
> index 319dc83..0000000
> --- a/tools/vtpm_manager/manager/vtpm_ipc.c
> +++ /dev/null
> @@ -1,141 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_ipc.c Implements ipc routines using file io. This file can
> -// be replaced with other ipc types.
> -//
> -// ===================================================================
> -
> -#include <sys/stat.h>
> -#include "vtpm_ipc.h"
> -#include "vtpmpriv.h"
> -#include "log.h"
> -
> -int vtpm_ipc_init(vtpm_ipc_handle_t *ipc_h, char* name, int flags, BOOL create) {
> -  ipc_h->name = name;
> -  ipc_h->flags = flags;
> -  ipc_h->fh = VTPM_IPC_CLOSED;
> -
> -  if (create)
> -    return(vtpm_ipc_create(ipc_h));
> -  else
> -    return 0;
> -}
> -
> -// Create the file that needs opening. Used only for FIFOs
> -// FYI: This may cause problems in other file IO schemes. We'll see.
> -int vtpm_ipc_create(vtpm_ipc_handle_t *ipc_h) {
> -  int fh;
> -  struct stat file_info;
> -
> -  if ((!ipc_h) || (!ipc_h->name))
> -    return -1;
> -
> -  if ( stat(ipc_h->name, &file_info) == -1) {
> -    if ( mkfifo(ipc_h->name, S_IWUSR | S_IRUSR ) ) {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Failed to create fifo %s.\n", ipc_h->name);
> -      return -1;
> -    }
> -  }
> -
> -  ipc_h->fh = VTPM_IPC_CLOSED;
> -
> -  return 0;
> -}
> -
> -
> -// Read size bytes. If FH isn't open, open it.
> -int vtpm_ipc_read(vtpm_ipc_handle_t *ipc_h, vtpm_ipc_handle_t *alt_ipc_h, BYTE *bytes, UINT32 size){
> -  vtpm_ipc_handle_t *my_ipc_h;
> -  int result;
> -
> -  if (ipc_h) {
> -    my_ipc_h = ipc_h;
> -  } else {
> -    my_ipc_h = alt_ipc_h;
> -  }
> -
> -  if (my_ipc_h->fh == VTPM_IPC_CLOSED) {
> -    my_ipc_h->fh = open(my_ipc_h->name, my_ipc_h->flags);
> -  }
> -
> -  if ( my_ipc_h->fh == VTPM_IPC_CLOSED ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM ERROR: Can't open %s for reading.\n", my_ipc_h->name);
> -    return -1;
> -  }
> -
> -  result = read(my_ipc_h->fh, bytes, size);
> -  if (result < 0) {
> -    my_ipc_h->fh = VTPM_IPC_CLOSED;
> -  }
> -
> -  return (result);
> -}
> -
> -// Write size bytes. If FH isn't open, open it.
> -int vtpm_ipc_write(vtpm_ipc_handle_t *ipc_h, vtpm_ipc_handle_t *alt_ipc_h, BYTE *bytes, UINT32 size) {
> -  vtpm_ipc_handle_t *my_ipc_h;
> -  int result;
> -
> -  if (ipc_h) {
> -    my_ipc_h = ipc_h;
> -  } else {
> -    my_ipc_h = alt_ipc_h;
> -  }
> -
> -  if (my_ipc_h->fh == VTPM_IPC_CLOSED) {
> -    my_ipc_h->fh = open(my_ipc_h->name, my_ipc_h->flags);
> -  }
> -
> -  if ( my_ipc_h->fh == VTPM_IPC_CLOSED ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM ERROR: Can't open %s for writing.\n", my_ipc_h->name);
> -    return -1;
> -  }
> -
> -  result = write(my_ipc_h->fh, bytes, size);
> -  if (result < 0) {
> -    my_ipc_h->fh = VTPM_IPC_CLOSED;
> -  }
> -
> -  return (result);
> -}
> -
> -// Mark file as closed and try and close it. Errors not reported.
> -void vtpm_ipc_close(vtpm_ipc_handle_t *ipc_h) {
> -
> -  if (ipc_h) {
> -    close(ipc_h->fh);
> -    ipc_h->fh = VTPM_IPC_CLOSED;
> -  }
> -
> -}
> diff --git a/tools/vtpm_manager/manager/vtpm_ipc.h b/tools/vtpm_manager/manager/vtpm_ipc.h
> deleted file mode 100644
> index 529c4a2..0000000
> --- a/tools/vtpm_manager/manager/vtpm_ipc.h
> +++ /dev/null
> @@ -1,71 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_ipc.h Header for interprocess communication between VTPM manager
> -// and Guests or VTPMs
> -//
> -// ===================================================================
> -
> -#ifndef __VTPM_IO_H__
> -#define __VTPM_IO_H__
> -
> -#include "tcg.h"
> -
> -#define VTPM_IPC_CLOSED -1
> -
> -// Represents an (somewhat) abstracted io handle.
> -typedef struct vtpm_ipc_handle_t {
> -  int fh;              // IO handle.
> -  int flags;           // Flags for opening. This may need to become
> -                       // a void *, but for now files use an int.
> -  char *name;          // Names for debugging as well as filenames
> -                       // for file-based io.
> -} vtpm_ipc_handle_t;
> -
> -
> -int vtpm_ipc_init(vtpm_ipc_handle_t *ioh, char* name, int flags, BOOL create);
> -
> -// Create the file that needs opening. Used only for FIFOs
> -// FYI: This may cause problems in other file IO schemes. We'll see.
> -int vtpm_ipc_create(vtpm_ipc_handle_t *ioh);
> -
> -// Read size bytes. If FH isn't open, open it.
> -int vtpm_ipc_read(vtpm_ipc_handle_t *ioh, vtpm_ipc_handle_t *alt_ioh, BYTE *bytes, UINT32 size);
> -
> -// Write size bytes. If FH isn't open, open it.
> -int vtpm_ipc_write(vtpm_ipc_handle_t *ioh, vtpm_ipc_handle_t *alt_ioh, BYTE *bytes, UINT32 size);
> -
> -// Mark file as closed and try and close it. Errors not reported.
> -void vtpm_ipc_close(vtpm_ipc_handle_t *ioh);
> -
> -#endif
> diff --git a/tools/vtpm_manager/manager/vtpm_lock.c b/tools/vtpm_manager/manager/vtpm_lock.c
> deleted file mode 100644
> index e737d60..0000000
> --- a/tools/vtpm_manager/manager/vtpm_lock.c
> +++ /dev/null
> @@ -1,63 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_lock.c Provided controlled sync around access to vtpm structures
> -//
> -// ===================================================================
> -
> -#include <pthread.h>
> -#include "vtpm_lock.h"
> -
> -static pthread_rwlock_t vtpm_lock;
> -
> -void vtpm_lock_init() {
> -
> -  pthread_rwlock_init( &vtpm_lock, NULL);
> -}
> -
> -void vtpm_lock_destroy(){
> -  pthread_rwlock_destroy(&vtpm_lock);
> -}
> -
> -void vtpm_lock_rdlock(){
> -  pthread_rwlock_rdlock(&vtpm_lock);
> -}
> -
> -void vtpm_lock_wrlock(){
> -  pthread_rwlock_wrlock(&vtpm_lock);
> -}
> -
> -void vtpm_lock_unlock(){
> -  pthread_rwlock_unlock(&vtpm_lock);
> -}
> -
> diff --git a/tools/vtpm_manager/manager/vtpm_lock.h b/tools/vtpm_manager/manager/vtpm_lock.h
> deleted file mode 100644
> index 53a339d..0000000
> --- a/tools/vtpm_manager/manager/vtpm_lock.h
> +++ /dev/null
> @@ -1,48 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_lock.h Provided controlled sync around access to vtpm structures
> -//
> -// ===================================================================
> -
> -#ifndef __VTPM_LOCK_H__
> -#define __VTPM_LOCK_H__
> -
> -void vtpm_lock_init();
> -void vtpm_lock_destroy();
> -
> -void vtpm_lock_rdlock();
> -void vtpm_lock_wrlock();
> -void vtpm_lock_unlock();
> -
> -#endif
> diff --git a/tools/vtpm_manager/manager/vtpm_manager.c b/tools/vtpm_manager/manager/vtpm_manager.c
> deleted file mode 100644
> index e089f78..0000000
> --- a/tools/vtpm_manager/manager/vtpm_manager.c
> +++ /dev/null
> @@ -1,285 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_manager.c
> -//
> -//  This file will house the main logic of the VTPM Manager
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <string.h>
> -
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "vtsp.h"
> -#include "bsg.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -
> -#include "log.h"
> -#include "buffer.h"
> -
> -VTPM_GLOBALS *vtpm_globals=NULL;
> -
> -// --------------------------- Well Known Auths --------------------------
> -const TPM_AUTHDATA SRK_AUTH = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
> -                                  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
> -
> -#ifdef WELL_KNOWN_OWNER_AUTH
> -static BYTE FIXED_OWNER_AUTH[20] =  {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
> -                                  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
> -#endif
> -
> -
> -// -------------------------- Hash table functions --------------------
> -
> -static unsigned int hashfunc32(void *ky) {
> -  return (* (UINT32 *) ky);
> -}
> -
> -static int equals32(void *k1, void *k2) {
> -  return (*(UINT32 *) k1 == *(UINT32 *) k2);
> -}
> -
> -// --------------------------- Functions ------------------------------
> -
> -TPM_RESULT VTPM_Create_Manager(){
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  // Generate Auth for Owner
> -#ifdef WELL_KNOWN_OWNER_AUTH
> -  memcpy(vtpm_globals->owner_usage_auth, FIXED_OWNER_AUTH, sizeof(TPM_AUTHDATA));
> -#else
> -  Crypto_GetRandom(vtpm_globals->owner_usage_auth, sizeof(TPM_AUTHDATA) );
> -#endif
> -
> -  // Take Owership of TPM
> -  CRYPTO_INFO ek_cryptoInfo;
> -
> -  status = VTSP_ReadPubek(vtpm_globals->manager_tcs_handle, &ek_cryptoInfo);
> -
> -  // If we can read PubEK then there is no owner and we should take it.
> -  // We use the abilty to read the pubEK to flag that the TPM is owned.
> -  // FIXME: Change to just trying to take ownership and react to the status
> -  if (status == TPM_SUCCESS) {
> -    TPMTRYRETURN(VTSP_TakeOwnership(vtpm_globals->manager_tcs_handle,
> -                                   (const TPM_AUTHDATA*)&vtpm_globals->owner_usage_auth,
> -                                   &SRK_AUTH,
> -                                   &ek_cryptoInfo,
> -                                   &vtpm_globals->keyAuth));
> -
> -    TPMTRYRETURN(VTSP_DisablePubekRead(vtpm_globals->manager_tcs_handle,
> -                                       (const TPM_AUTHDATA*)&vtpm_globals->owner_usage_auth,
> -                                       &vtpm_globals->keyAuth));
> -  } else {
> -    vtpmloginfo(VTPM_LOG_VTPM, "Failed to readEK meaning TPM has an owner. Creating Keys off existing SRK.\n");
> -  }
> -
> -  // Generate storage key's auth
> -  Crypto_GetRandom(  &vtpm_globals->storage_key_usage_auth,
> -                    sizeof(TPM_AUTHDATA) );
> -
> -  TCS_AUTH osap;
> -  TPM_AUTHDATA sharedsecret;
> -
> -  TPMTRYRETURN( VTSP_OSAP(vtpm_globals->manager_tcs_handle,
> -                         TPM_ET_KEYHANDLE,
> -                         TPM_SRK_KEYHANDLE,
> -                         &SRK_AUTH,
> -                         &sharedsecret,
> -                         &osap) );
> -
> -  osap.fContinueAuthSession = FALSE;
> -
> -
> -  TPMTRYRETURN( VTSP_CreateWrapKey( vtpm_globals->manager_tcs_handle,
> -                                   TPM_KEY_BIND,
> -                                   (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
> -                                   TPM_SRK_KEYHANDLE,
> -                                   (const TPM_AUTHDATA*)&sharedsecret,
> -                                   &vtpm_globals->storageKeyWrap,
> -                                   &osap) );
> -
> -  // Generate boot key's auth
> -  TPM_AUTHDATA bootKeyWrapAuth;
> -  memset(&bootKeyWrapAuth, 0, sizeof(bootKeyWrapAuth));
> -
> -  TPMTRYRETURN( VTSP_OSAP(vtpm_globals->manager_tcs_handle,
> -                         TPM_ET_KEYHANDLE,
> -                         TPM_SRK_KEYHANDLE,
> -                         &SRK_AUTH,
> -                         &sharedsecret,
> -                         &osap) );
> -
> -  osap.fContinueAuthSession = FALSE;
> -
> -  // FIXME: This key protects the global secrets on disk. It should use TPM
> -  //        PCR bindings to limit its use to legit configurations.
> -  //        Current binds are open, implying a Trusted VM contains this code.
> -  //        If this VM is not Trusted, use measurement and PCR bindings.
> -  TPMTRYRETURN( VTSP_CreateWrapKey( vtpm_globals->manager_tcs_handle,
> -                                   TPM_KEY_BIND,
> -                                   (const TPM_AUTHDATA*)&bootKeyWrapAuth,
> -                                   TPM_SRK_KEYHANDLE,
> -                                   (const TPM_AUTHDATA*)&sharedsecret,
> -                                   &vtpm_globals->bootKeyWrap,
> -                                   &osap) );
> -
> -  // Populate CRYPTO_INFO vtpm_globals->bootKey. This does not load it into the TPM
> -  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
> -                              TPM_SRK_KEYHANDLE,
> -                              &vtpm_globals->bootKeyWrap,
> -                              NULL,
> -                              NULL,
> -                              NULL,
> -                              &vtpm_globals->bootKey,
> -                              TRUE ) );
> -
> -  TPMTRYRETURN( VTSP_SaveState(vtpm_globals->manager_tcs_handle) );
> -  goto egress;
> -
> - abort_egress:
> -  exit(1);
> -
> - egress:
> -  vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager (Status = %d).\n", status);
> -  return status;
> -
> -}
> -
> -///////////////////////////////////////////////////////////////////////////////
> -TPM_RESULT VTPM_Init_Manager() {
> -  TPM_RESULT status = TPM_FAIL, serviceStatus;
> -  BYTE *randomsead;
> -  UINT32 randomsize=256;
> -
> -  if ((vtpm_globals = (VTPM_GLOBALS *) malloc(sizeof(VTPM_GLOBALS))) == NULL){
> -    status = TPM_FAIL;
> -    goto abort_egress;
> -  }
> -  memset(vtpm_globals, 0, sizeof(VTPM_GLOBALS));
> -
> -  vtpm_globals->connected_dmis = 0;
> -
> -  if ((vtpm_globals->dmi_map = create_hashtable(10, hashfunc32, equals32)) == NULL){
> -    status = TPM_FAIL;
> -    goto abort_egress;
> -  }
> -
> -  // Create new TCS Object
> -  vtpm_globals->manager_tcs_handle = 0;
> -
> -  TPMTRYRETURN(TCS_create());
> -
> -  // Create TCS Context for service
> -  TPMTRYRETURN( TCS_OpenContext(&vtpm_globals->manager_tcs_handle ) );
> -
> -  TPMTRYRETURN( TCSP_GetRandom(vtpm_globals->manager_tcs_handle,
> -                              &randomsize,
> -                              &randomsead));
> -
> -  Crypto_Init(randomsead, randomsize);
> -  TPMTRYRETURN( TCS_FreeMemory (vtpm_globals->manager_tcs_handle, randomsead));
> -
> -  // Create OIAP session for service's authorized commands
> -  TPMTRYRETURN( VTSP_OIAP( vtpm_globals->manager_tcs_handle,
> -                          &vtpm_globals->keyAuth) );
> -  vtpm_globals->keyAuth.fContinueAuthSession = TRUE;
> -
> -  vtpm_globals->mig_keys = NULL;
> -
> -  // If fails, create new Manager.
> -  serviceStatus = VTPM_LoadManagerData();
> -  if (serviceStatus == TPM_IOERROR) {
> -    vtpmloginfo(VTPM_LOG_VTPM, "Failed to read manager file. Assuming first time initialization.\n");
> -    TPMTRYRETURN( VTPM_Create_Manager() );
> -    TPMTRYRETURN( VTPM_SaveManagerData() );
> -  } else if (serviceStatus != TPM_SUCCESS) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to read existing manager file");
> -    exit(1);
> -  }
> -
> -  //Load Storage Key
> -  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
> -                             TPM_SRK_KEYHANDLE,
> -                             &vtpm_globals->storageKeyWrap,
> -                             &SRK_AUTH,
> -                             &vtpm_globals->storageKeyHandle,
> -                             &vtpm_globals->keyAuth,
> -                             &vtpm_globals->storageKey,
> -                              FALSE ) );
> -
> -  // Create entry for Dom0 for control messages
> -  TPMTRYRETURN( VTPM_Handle_New_DMI(NULL) );
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return(status);
> -}
> -
> -///////////////////////////////////////////////////////////////////////////////
> -void VTPM_Stop_Manager() {
> -  VTPM_DMI_RESOURCE *dmi_res;
> -  struct hashtable_itr *dmi_itr;
> -
> -  // Close all the TCS contexts. TCS should evict keys based on this
> -  if (hashtable_count(vtpm_globals->dmi_map) > 0) {
> -    dmi_itr = hashtable_iterator(vtpm_globals->dmi_map);
> -    do {
> -      dmi_res = (VTPM_DMI_RESOURCE *) hashtable_iterator_value(dmi_itr);
> -      if (dmi_res->connected)
> -       close_dmi( dmi_res ); // Not really interested in return code
> -
> -    } while (hashtable_iterator_advance(dmi_itr));
> -               free (dmi_itr);
> -  }
> -
> -  if ( VTPM_SaveManagerData() != TPM_SUCCESS )
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to save manager data.\n");
> -
> -  TCS_CloseContext(vtpm_globals->manager_tcs_handle);
> -  TCS_destroy();
> -
> -  hashtable_destroy(vtpm_globals->dmi_map, 1);
> -  free(vtpm_globals);
> -
> -  Crypto_Exit();
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
> -}
> diff --git a/tools/vtpm_manager/manager/vtpm_manager.h b/tools/vtpm_manager/manager/vtpm_manager.h
> deleted file mode 100644
> index a324a8f..0000000
> --- a/tools/vtpm_manager/manager/vtpm_manager.h
> +++ /dev/null
> @@ -1,150 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_manager.h
> -//
> -//  Public Interface header for VTPM Manager
> -//
> -// ==================================================================
> -
> -#ifndef __VTPM_MANAGER_H__
> -#define __VTPM_MANAGER_H__
> -
> -#define VTPM_TAG_REQ 0x01c1
> -#define VTPM_TAG_RSP 0x01c4
> -#define COMMAND_BUFFER_SIZE 4096
> -
> -// Header sizes. Note Header MAY include the DMI
> -#define VTPM_COMMAND_HEADER_SIZE_CLT ( 2 + 4 + 4)
> -//                    sizeof(TPM_TAG + UINT32 + TPM_COMMAND_CODE)
> -#define VTPM_COMMAND_HEADER_SIZE_SRV ( 4 + VTPM_COMMAND_HEADER_SIZE_CLT )
> -//                    sizeof( UINT32 + VTPM_COMMAND_HEADER_SIZE_CLT)
> -
> -//************************ Command Codes ****************************
> -#define VTPM_ORD_BASE       0x0000
> -#define VTPM_PRIV_MASK      0x01000000 // Priviledged VTPM Command
> -#define VTPM_PRIV_BASE      (VTPM_ORD_BASE | VTPM_PRIV_MASK)
> -
> -// Non-priviledged VTPM Commands (From DMI's)
> -#define VTPM_ORD_SAVENVM      (VTPM_ORD_BASE + 1) // DMI Saves Secrets
> -#define VTPM_ORD_LOADNVM      (VTPM_ORD_BASE + 2) // DMI Loads Secrets
> -#define VTPM_ORD_TPMCOMMAND   (VTPM_ORD_BASE + 3) // DMI issues HW TPM Command
> -#define VTPM_ORD_GET_MIG_KEY  (VTPM_ORD_BASE + 4) // Get manager's migration key
> -#define VTPM_ORD_LOAD_MIG_KEY (VTPM_ORD_BASE + 5) // load dest migration key
> -
> -// Priviledged VTPM Commands (From management console)
> -#define VTPM_ORD_OPEN         (VTPM_PRIV_BASE + 1) // Creates/reopens DMI
> -#define VTPM_ORD_CLOSE        (VTPM_PRIV_BASE + 2) // Closes a DMI
> -#define VTPM_ORD_DELETE       (VTPM_PRIV_BASE + 3) // Permemently Deletes DMI
> -#define VTPM_ORD_MIGRATE_IN   (VTPM_PRIV_BASE + 4) // Load migrated VTPM
> -#define VTPM_ORD_MIGRATE_OUT  (VTPM_PRIV_BASE + 5) // migrate VTPM to dest
> -
> -//************************ Return Codes ****************************
> -#define VTPM_TYPE_PVM 1 // Paravirtualized Domain
> -#define VTPM_TYPE_HVM 2 // HVM Domain
> -
> -//************************ Return Codes ****************************
> -#define VTPM_SUCCESS               0
> -#define VTPM_FAIL                  1
> -#define VTPM_UNSUPPORTED           2
> -#define VTPM_FORBIDDEN             3
> -#define VTPM_RESTORE_CONTEXT_FAILED    4
> -#define VTPM_INVALID_REQUEST       5
> -
> -//*********************** Parameter Values *************************
> -#define VTPM_TYPE_NON_MIGRATABLE  0x00
> -#define VTPM_TYPE_MIGRATABLE      0x01
> -#define VTPM_TYPE_MIGRATED        0xFF // VTPM has been migrated.
> -                                       // VTPM can be recovered or deleted only
> -
> -/******************* Command Parameter API *************************
> -
> -VTPM Command Format
> -  dmi: 4 bytes                  // Source of message.
> -                                // WARNING: This is prepended by the channel.
> -                                // Thus it is received by VTPM Manager,
> -                                // but not sent by DMI
> -  tpm tag: 2 bytes
> -  command size: 4 bytes         // Size of command including header but not DMI
> -  ord: 4 bytes                  // Command ordinal above
> -  parameters: size - 10 bytes   // Command Parameter
> -
> -VTPM Response Format
> -  tpm tag: 2 bytes
> -  response_size: 4 bytes
> -  status: 4 bytes
> -  parameters: size - 10 bytes
> -
> -
> -VTPM_Open:
> -  Input Parameters:
> -    mig_type: 1 byte
> -    startup_mode: 1 byte // Cold Boot = 1, resume = 2, deactive = 3
> -    domain type: 1 byte
> -    instance_id: 4 bytes
> -  Output Parameters:
> -    None
> -
> -VTPM_Close
> -  Input Parameters:
> -    instance_id: 4 bytes
> -  Output Parameters:
> -    None
> -
> -VTPM_Delete
> -  Input Parameters:
> -    instance_id: 4 bytes
> -  Output Parameters:
> -    None
> -
> -VTPM_SaveNVM
> -  Input Parameters:
> -    data: n bytes (Header indicates size of data)
> -  Output Parameters:
> -    None
> -
> -VTPM_LoadNVM
> -  Input Parameters:
> -    None
> -  Output Parameters:
> -    data: n bytes (Header indicates size of data)
> -
> -VTPM_TPMCommand
> -  Input Parameters:
> -    TPM Command Byte Stream: n bytes
> -  Output Parameters:
> -    TPM Reponse Byte Stream: n bytes
> -
> -*********************************************************************/
> -
> -#endif //_VTPM_MANAGER_H_
> diff --git a/tools/vtpm_manager/manager/vtpm_manager_handler.c b/tools/vtpm_manager/manager/vtpm_manager_handler.c
> deleted file mode 100644
> index 2001074..0000000
> --- a/tools/vtpm_manager/manager/vtpm_manager_handler.c
> +++ /dev/null
> @@ -1,488 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_manager_handler.c
> -//
> -//  This file will house the main logic of the VTPM Manager
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <string.h>
> -#include <errno.h>
> -
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "vtsp.h"
> -#include "bsg.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -#include "log.h"
> -#include "buffer.h"
> -
> -#define vtpmhandlerloginfo(module,fmt,args...) vtpmloginfo (module, "[%s]: " fmt, thread_name, ##args );
> -#define vtpmhandlerloginfomore(module,fmt,args...) vtpmloginfomore (module, fmt, ##args );
> -#define vtpmhandlerlogerror(module,fmt,args...) vtpmlogerror (module, "[%s]: " fmt, thread_name, ##args );
> -
> -// ---------------------- Prototypes -------------------
> -TPM_RESULT vtpm_manager_handle_vtpm_cmd(VTPM_DMI_RESOURCE *dmi_res,
> -                                       TPM_COMMAND_CODE ord,
> -                                       buffer_t *command_buf,
> -                                       buffer_t *result_buf,
> -                                        BOOL is_priv,
> -                                        char *thread_name);
> -
> -TPM_RESULT vtpm_manager_handle_tpm_cmd(vtpm_ipc_handle_t *tx_ipc_h,
> -                                       vtpm_ipc_handle_t *rx_ipc_h,
> -                                       VTPM_DMI_RESOURCE *dmi_res,
> -                                       BYTE *cmd_header,
> -                                       buffer_t *param_buf,
> -                                       buffer_t *result_buf,
> -                                       char *thread_name);
> -
> -TPM_RESULT VTPM_Manager_Handler( vtpm_ipc_handle_t *tx_ipc_h,
> -                                 vtpm_ipc_handle_t *rx_ipc_h,
> -                                 BOOL fw_tpm,   // Forward TPM cmds?
> -                                 vtpm_ipc_handle_t *fw_tx_ipc_h,
> -                                 vtpm_ipc_handle_t *fw_rx_ipc_h,
> -                                 BOOL is_priv,
> -                                 char *thread_name) {
> -  TPM_RESULT      status =  TPM_FAIL; // Should never return
> -  UINT32          dmi, in_param_size, cmd_size, out_param_size, out_message_size, reply_size;
> -  BYTE            *cmd_header=NULL, *in_param=NULL, *out_message=NULL, *reply;
> -  buffer_t        *command_buf=NULL, *result_buf=NULL;
> -  TPM_TAG         tag;
> -  TPM_COMMAND_CODE ord;
> -  VTPM_DMI_RESOURCE *dmi_res;
> -  int  size_read, size_write, i;
> -  BOOL add_header=TRUE; // This indicates to prepend a header on result_buf before sending
> -
> -  cmd_header = (BYTE *) malloc(VTPM_COMMAND_HEADER_SIZE_SRV);
> -  command_buf = (buffer_t *) malloc(sizeof(buffer_t));
> -  result_buf = (buffer_t *) malloc(sizeof(buffer_t));
> -
> -  // ------------------------ Main Loop --------------------------------
> -  while(1) {
> -
> -    vtpmhandlerloginfo(VTPM_LOG_VTPM, "%s waiting for messages.\n", thread_name);
> -
> -    // --------------------- Read Cmd from Sender ----------------
> -
> -    // Read command header
> -    size_read = vtpm_ipc_read(rx_ipc_h, NULL, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -    if (size_read > 0) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "RECV[%d]: 0x", size_read);
> -      for (i=0; i<size_read; i++)
> -       vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s can't read from ipc. Errono = %d. Aborting... \n", thread_name, errno);
> -      goto abort_command;
> -    }
> -
> -    if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "\n");
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command shorter than normal header (%d bytes). Aborting...\n", size_read);
> -      goto abort_command;
> -    }
> -
> -    // Unpack header
> -    BSG_UnpackList(cmd_header, 4,
> -                  BSG_TYPE_UINT32, &dmi,
> -                  BSG_TPM_TAG, &tag,
> -                  BSG_TYPE_UINT32, &in_param_size,
> -                  BSG_TPM_COMMAND_CODE, &ord );
> -
> -    // Using the header info, read the parameters of the command
> -    // Note that in_param_size is in the client's context
> -    cmd_size = in_param_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> -    if (cmd_size > 0) {
> -      in_param = (BYTE *) malloc(cmd_size);
> -      size_read = vtpm_ipc_read( rx_ipc_h, NULL, in_param, cmd_size);
> -      if (size_read > 0) {
> -       for (i=0; i<size_read; i++)
> -         vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
> -
> -      } else {
> -        vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s had error reading cmd from ipc. Aborting... \n", thread_name);
> -       goto abort_command;
> -      }
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -      if (size_read < (int) cmd_size) {
> -       vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -       vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d). Aborting...\n", size_read, cmd_size);
> -       goto abort_command;
> -      }
> -    } else {
> -      in_param = NULL;
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -    }
> -
> -    // Init the buffers used to handle the command and the response
> -    if ( (buffer_init_convert(command_buf, cmd_size, in_param) != TPM_SUCCESS) ||
> -        (buffer_init(result_buf, 0, 0) != TPM_SUCCESS) ) {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Failed to setup buffers. Aborting...\n");
> -      goto abort_command;
> -    }
> -
> -    // -------------- Dispatch Commands to Handlers -----------
> -    if ((tag == VTPM_TAG_REQ) && (ord & VTPM_PRIV_MASK)) {
> -      vtpm_lock_wrlock();
> -    } else {
> -      vtpm_lock_rdlock();
> -    }
> -
> -    if ( !(dmi_res = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi)) ||
> -         (!dmi_res->connected) ) {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Attempted access to non-existent or disconnected DMI %d. Aborting...\n", dmi);
> -      status = TPM_BAD_PARAMETER;
> -      // We have no one to reply to, they don't exist.
> -      goto abort_command;
> -    }
> -
> -    if (tag == VTPM_TAG_REQ) {
> -
> -      status = vtpm_manager_handle_vtpm_cmd(dmi_res, ord, command_buf, result_buf, is_priv, thread_name);
> -
> -    } else { // This is not a VTPM Command at all.
> -      if (fw_tpm) {
> -        status = vtpm_manager_handle_tpm_cmd(fw_tx_ipc_h, fw_rx_ipc_h, dmi_res, cmd_header, command_buf, result_buf, thread_name);
> -
> -        // This means calling the DMI failed, not that the cmd failed in the DMI
> -        // Since the return will be interpretted by a TPM app, all errors are IO_ERRORs to the app
> -        if (status != TPM_SUCCESS) {
> -          status = TPM_IOERROR;
> -         goto abort_with_error;
> -        }
> -        // Unlike all other commands, forwarded commands yield a result_buf that includes the DMI's status. This
> -        // should be forwarded to the caller VM
> -        add_header = FALSE;
> -      } else {
> -        // We are not supposed to forward TPM commands at all.
> -        int i;
> -        vtpmhandlerlogerror(VTPM_LOG_VTPM, "Attempt to use unsupported direct access to TPM.\n");
> -        vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "Bad Command. dmi:%d, tag:%d, size:%d, ord:%d, Params: ", dmi, tag, in_param_size, ord);
> -        for (i=0; i<cmd_size; i++)
> -          vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
> -
> -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -        status = TPM_FAIL;
> -        goto abort_with_error;
> -     }
> -
> -    } // end else for is VTPM Command
> -
> -    // ------------------- Respond to Sender ------------------
> -
> -    // Errors while handling responses jump here to reply with error messages
> -    // NOTE: Currently there are no recoverable errors in multi-VM mode. If one
> -    //       is added to the code, this ifdef should be removed.
> -    //       Also note this is NOT referring to errors in commands, but rather
> -    //       this is about I/O errors and such.
> -#ifndef VTPM_MULTI_VM
> - abort_with_error:
> -#endif
> -
> -    if (add_header) {
> -      // Prepend VTPM header with destination DM stamped
> -      out_param_size = buffer_len(result_buf);
> -      out_message_size = VTPM_COMMAND_HEADER_SIZE_CLT + out_param_size;
> -      reply_size = VTPM_COMMAND_HEADER_SIZE_SRV + out_param_size;
> -      out_message = (BYTE *) malloc (reply_size);
> -      reply = out_message;
> -
> -      BSG_PackList(out_message, 4,
> -                  BSG_TYPE_UINT32, (BYTE *) &dmi,
> -                  BSG_TPM_TAG, (BYTE *) &tag,
> -                  BSG_TYPE_UINT32, (BYTE *) &out_message_size,
> -                  BSG_TPM_RESULT, (BYTE *) &status);
> -
> -      if (buffer_len(result_buf) > 0)
> -        memcpy(out_message + VTPM_COMMAND_HEADER_SIZE_SRV, result_buf->bytes, out_param_size);
> -      //Note: Send message + dmi_id
> -    } else {
> -      reply = result_buf->bytes;
> -      reply_size = buffer_len(result_buf);
> -    }
> -    size_write = vtpm_ipc_write(tx_ipc_h, (dmi_res ? dmi_res->tx_vtpm_ipc_h : NULL), reply, reply_size );
> -    if (size_write > 0) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT: 0x");
> -      for (i=0; i < reply_size; i++)
> -       vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", reply[i]);
> -
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s had error writing to ipc. Aborting... \n", thread_name);
> -      goto abort_command;
> -    }
> -    free(out_message); out_message=NULL;
> -
> -    if (size_write < (int)reply_size) {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s unable to write full command to ipc (%d/%d)\n", thread_name, size_write, reply_size);
> -      goto abort_command;
> -    }
> -
> -    // On certain failures an error message cannot be sent.
> -    // This marks the beginning of cleanup in preperation for the next command.
> -  abort_command:
> -    //free buffers
> -    bzero(cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -    //free(in_param); // This was converted to command_buf. No need to free
> -    buffer_free(result_buf);
> -    buffer_free(command_buf);
> -
> -    // If we have a write lock, save the manager table
> -    if ((tag == VTPM_TAG_REQ) && (ord & VTPM_PRIV_MASK) &&
> -        (VTPM_SaveManagerData() != TPM_SUCCESS) ) {
> -       vtpmhandlerlogerror(VTPM_LOG_VTPM, "ERROR: Unable to save manager data.\n");
> -    }
> -
> -    vtpm_lock_unlock();
> -    add_header = TRUE; // Reset to the default
> -  } // End while(1)
> -
> -}
> -
> -/////////////////////////////////////////////////////////////////////////
> -TPM_RESULT vtpm_manager_handle_vtpm_cmd(VTPM_DMI_RESOURCE *dmi_res,
> -                                       TPM_COMMAND_CODE ord,
> -                                       buffer_t *command_buf,
> -                                       buffer_t *result_buf,
> -                                        BOOL is_priv,
> -                                        char *thread_name) {
> -
> -  TPM_RESULT status = TPM_FAIL;
> -
> -  switch (ord) {
> -  case VTPM_ORD_SAVENVM:
> -    status= VTPM_Handle_Save_NVM(dmi_res,
> -                                 command_buf,
> -                                 result_buf);
> -    break;
> -
> -  case VTPM_ORD_LOADNVM:
> -    status= VTPM_Handle_Load_NVM(dmi_res,
> -                                 command_buf,
> -                                 result_buf);
> -    break;
> -
> -  case VTPM_ORD_TPMCOMMAND:
> -    status= VTPM_Handle_TPM_Command(dmi_res,
> -                                    command_buf,
> -                                    result_buf);
> -    break;
> -
> -  case VTPM_ORD_GET_MIG_KEY:
> -    status = VTPM_Handle_Get_Migration_key(command_buf,
> -                                           result_buf);
> -    break;
> -
> -  case VTPM_ORD_LOAD_MIG_KEY:
> -    status = VTPM_Handle_Load_Migration_key(command_buf,
> -                                           result_buf);
> -    break;
> -
> -  default:
> -    // Privileged handlers can do maintanance
> -    if (is_priv) {
> -      switch (ord) {
> -      case VTPM_ORD_OPEN:
> -        status = VTPM_Handle_New_DMI(command_buf);
> -        break;
> -
> -      case VTPM_ORD_CLOSE:
> -        status = VTPM_Handle_Close_DMI(command_buf);
> -        break;
> -
> -      case VTPM_ORD_DELETE:
> -        status = VTPM_Handle_Delete_DMI(command_buf);
> -        break;
> -
> -      case VTPM_ORD_MIGRATE_IN:
> -        status = VTPM_Handle_Migrate_In(command_buf, result_buf);
> -        break;
> -
> -      case VTPM_ORD_MIGRATE_OUT:
> -        status = VTPM_Handle_Migrate_Out(command_buf, result_buf);
> -        break;
> -
> -      default:
> -        status = TPM_BAD_ORDINAL;
> -      } // switch
> -    } else { // is priv command
> -
> -        status = TPM_BAD_ORDINAL;
> -    } // inner switch
> -  } // outer switch
> -
> -  return(status);
> -}
> -
> -/////////////////////////////////////////////////////////////////////
> -TPM_RESULT vtpm_manager_handle_tpm_cmd(vtpm_ipc_handle_t *tx_ipc_h,
> -                                       vtpm_ipc_handle_t *rx_ipc_h,
> -                                      VTPM_DMI_RESOURCE *dmi_res,
> -                                      BYTE *cmd_header,
> -                                      buffer_t *param_buf,
> -                                      buffer_t *result_buf,
> -                                       char *thread_name) {
> -
> -  TPM_RESULT status = TPM_FAIL;
> -  UINT32 dmi_dst;
> -  TPM_COMMAND_CODE ord;
> -  TPM_TAG tag_out;
> -  UINT32 dmi_cmd_size, in_param_size, adj_param_size;
> -  BYTE *dmi_cmd, *in_param;
> -  int  size_read, size_write, i;
> -
> -  //// Dom0 can't talk to the BE, so this must be a broken FE/BE or badness
> -  if (dmi_res->dmi_id == VTPM_CTL_DM) {
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Illegal use of TPM command from dom0\n");
> -    status = TPM_FAIL;
> -    goto abort_with_error;
> -  }
> -
> -  vtpmhandlerloginfo(VTPM_LOG_VTPM, "Forwarding command to DMI.\n");
> -
> -  //Forward TPM CMD stamped with dmi_id to DMI for handling
> -  if (buffer_len(param_buf)) {
> -    dmi_cmd = (BYTE *) malloc(VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf));
> -    dmi_cmd_size = VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf);
> -    memcpy(dmi_cmd, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -    memcpy(dmi_cmd + VTPM_COMMAND_HEADER_SIZE_SRV, param_buf->bytes, buffer_len(param_buf));
> -    size_write = vtpm_ipc_write(tx_ipc_h, dmi_res->tx_tpm_ipc_h, dmi_cmd, dmi_cmd_size);
> -
> -    if (size_write > 0) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT (DMI): 0x");
> -      for (i=0; i<VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf); i++) {
> -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", dmi_cmd[i]);
> -      }
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error writing to DMI. Aborting... \n");
> -      status = TPM_IOERROR;
> -      goto abort_with_error;
> -    }
> -    free(dmi_cmd);
> -  } else {
> -    dmi_cmd_size = VTPM_COMMAND_HEADER_SIZE_SRV;
> -    size_write = vtpm_ipc_write(tx_ipc_h, dmi_res->tx_tpm_ipc_h, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV );
> -    if (size_write > 0) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT (DMI): 0x");
> -      for (i=0; i<VTPM_COMMAND_HEADER_SIZE_SRV; i++)
> -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> -
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error writing to DMI. Aborting... \n");
> -      status = TPM_IOERROR;
> -      goto abort_with_error;
> -    }
> -  }
> -
> -  if (size_write != (int) dmi_cmd_size)
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Could not write entire command to DMI (%d/%d)\n", size_write, dmi_cmd_size);
> -
> -  buffer_free(param_buf);
> -
> -  // Read header for response to TPM command from DMI
> -  size_read = vtpm_ipc_read( rx_ipc_h, dmi_res->rx_tpm_ipc_h, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -  if (size_read > 0) {
> -    vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "RECV (DMI): 0x");
> -    for (i=0; i<size_read; i++)
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> -
> -  } else {
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error reading from DMI. Aborting... \n");
> -    status = TPM_IOERROR;
> -    goto abort_with_error;
> -  }
> -
> -  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command from DMI shorter than normal header. Aborting...\n");
> -    status = TPM_IOERROR;
> -    goto abort_with_error;
> -  }
> -
> -  // Unpack response from DMI for TPM command
> -  BSG_UnpackList(cmd_header, 4,
> -                 BSG_TYPE_UINT32, &dmi_dst,
> -                 BSG_TPM_TAG, &tag_out,
> -                 BSG_TYPE_UINT32, &in_param_size,
> -                 BSG_TPM_COMMAND_CODE, &status );
> -
> -  // If response has parameters, read them.
> -  // Note that in_param_size is in the client's context
> -  adj_param_size = in_param_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> -  if (adj_param_size > 0) {
> -    in_param = (BYTE *) malloc(adj_param_size);
> -    size_read = vtpm_ipc_read(rx_ipc_h, dmi_res->rx_tpm_ipc_h, in_param, adj_param_size);
> -    if (size_read > 0) {
> -      for (i=0; i<size_read; i++)
> -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
> -
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error reading from BE. Aborting... \n");
> -      goto abort_with_error;
> -    }
> -    vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
> -
> -    if (size_read < (int)adj_param_size) {
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command read(%d) from DMI is shorter than header indicates(%d). Aborting...\n", size_read, adj_param_size);
> -      status = TPM_IOERROR;
> -      goto abort_with_error;
> -    }
> -  } else {
> -    in_param = NULL;
> -    vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
> -  }
> -
> -  if ( (buffer_init(result_buf, VTPM_COMMAND_HEADER_SIZE_SRV, cmd_header) != TPM_SUCCESS) ||
> -       (buffer_append_raw(result_buf, adj_param_size, in_param) != TPM_SUCCESS) ) {
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Failed to setup buffers. Aborting...\n");
> -    status = TPM_FAIL;
> -    goto abort_with_error;
> -  }
> -
> -  vtpmhandlerloginfo(VTPM_LOG_VTPM, "Sending DMI's response to guest.\n");
> -
> -  status = TPM_SUCCESS;
> -
> - abort_with_error:
> -
> -  return status;
> -}
> -
> diff --git a/tools/vtpm_manager/manager/vtpmd.c b/tools/vtpm_manager/manager/vtpmd.c
> deleted file mode 100644
> index cf58ba3..0000000
> --- a/tools/vtpm_manager/manager/vtpmd.c
> +++ /dev/null
> @@ -1,371 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpmd.c
> -//
> -//  Application
> -//
> -// ===================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <sys/types.h>
> -#include <sys/stat.h>
> -#include <fcntl.h>
> -#include <signal.h>
> -#include <string.h>
> -#include <pthread.h>
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "tcg.h"
> -#include "log.h"
> -#include "vtpm_ipc.h"
> -
> -#define TPM_EMULATOR_PATH "/usr/bin/vtpmd"
> -
> -#define VTPM_BE_FNAME          "/dev/vtpm"
> -#define VTPM_DUMMY_TX_BE_FNAME "/var/vtpm/fifos/dummy_out.fifo"
> -#define VTPM_DUMMY_RX_BE_FNAME "/var/vtpm/fifos/dummy_in.fifo"
> -#define VTPM_TX_TPM_FNAME      "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
> -#define VTPM_RX_TPM_FNAME      "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
> -#define VTPM_TX_VTPM_FNAME     "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
> -#define VTPM_RX_VTPM_FNAME     "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
> -#define VTPM_TX_HP_FNAME       "/var/vtpm/fifos/to_console.fifo"
> -#define VTPM_RX_HP_FNAME       "/var/vtpm/fifos/from_console.fifo"
> -
> -#define VTPM_TYPE_PVM_STRING "pvm"
> -#define VTPM_TYPE_HVM_STRING "hvm"
> -
> -struct vtpm_thread_params_s {
> -  vtpm_ipc_handle_t *tx_ipc_h;
> -  vtpm_ipc_handle_t *rx_ipc_h;
> -  BOOL fw_tpm;
> -  vtpm_ipc_handle_t *fw_tx_ipc_h;
> -  vtpm_ipc_handle_t *fw_rx_ipc_h;
> -  BOOL is_priv;
> -  char *thread_name;
> -};
> -
> -// This is needed to all extra_close_dmi to close this to prevent a
> -// broken pipe when no DMIs are left.
> -static vtpm_ipc_handle_t *g_rx_tpm_ipc_h;
> -
> -void *vtpm_manager_thread(void *arg_void) {
> -  TPM_RESULT *status = (TPM_RESULT *) malloc(sizeof(TPM_RESULT) );
> -  struct vtpm_thread_params_s *arg = (struct vtpm_thread_params_s *) arg_void;
> -
> -  *status = VTPM_Manager_Handler(arg->tx_ipc_h, arg->rx_ipc_h,
> -                                 arg->fw_tpm, arg->fw_tx_ipc_h, arg->fw_rx_ipc_h,
> -                                 arg->is_priv, arg->thread_name);
> -
> -  return (status);
> -}
> -
> -
> -void signal_handler(int reason) {
> -  if (pthread_equal(pthread_self(), vtpm_globals->master_pid)) {
> -    vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager shutting down for signal %d.\n", reason);
> -  } else {
> -    // For old Linux Thread machines, signals are delivered to each thread. Deal with them.
> -    vtpmloginfo(VTPM_LOG_VTPM, "Child shutting down\n");
> -    pthread_exit(NULL);
> -  }
> -
> -  VTPM_Stop_Manager();
> -  exit(-1);
> -}
> -
> -struct sigaction ctl_c_handler;
> -
> -TPM_RESULT VTPM_New_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res, BYTE vm_type, BYTE startup_mode) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  int fh;
> -  char dmi_id_str[11]; // UINT32s are up to 10 digits + NULL
> -  char *tx_vtpm_name, *tx_tpm_name, *vm_type_string;
> -  struct stat file_info;
> -
> -  if (dmi_res->dmi_id == VTPM_CTL_DM) {
> -    dmi_res->tx_tpm_ipc_h = NULL;
> -    dmi_res->rx_tpm_ipc_h = NULL;
> -    dmi_res->tx_vtpm_ipc_h = NULL;
> -    dmi_res->rx_vtpm_ipc_h = NULL;
> -  } else {
> -    // Create a pair of fifo pipes
> -    dmi_res->rx_tpm_ipc_h = NULL;
> -    dmi_res->rx_vtpm_ipc_h = NULL;
> -
> -    if ( ((dmi_res->tx_tpm_ipc_h = (vtpm_ipc_handle_t *) malloc (sizeof(vtpm_ipc_handle_t))) == NULL ) ||
> -         ((dmi_res->tx_vtpm_ipc_h =(vtpm_ipc_handle_t *) malloc (sizeof(vtpm_ipc_handle_t))) == NULL ) ||
> -         ((tx_tpm_name = (char *) malloc(11 + strlen(VTPM_TX_TPM_FNAME))) == NULL ) ||
> -         ((tx_vtpm_name =(char *) malloc(11 + strlen(VTPM_TX_VTPM_FNAME))) == NULL) ) {
> -      status =TPM_RESOURCES;
> -      goto abort_egress;
> -    }
> -
> -    sprintf(tx_tpm_name, VTPM_TX_TPM_FNAME, (uint32_t) dmi_res->dmi_id);
> -    sprintf(tx_vtpm_name, VTPM_TX_VTPM_FNAME, (uint32_t) dmi_res->dmi_id);
> -
> -    if ( (vtpm_ipc_init(dmi_res->tx_tpm_ipc_h, tx_tpm_name, O_WRONLY | O_NONBLOCK, TRUE) != 0) ||
> -         (vtpm_ipc_init(dmi_res->tx_vtpm_ipc_h, tx_vtpm_name, O_WRONLY, TRUE) != 0) ) { //FIXME: O_NONBLOCK?
> -      status = TPM_IOERROR;
> -      goto abort_egress;
> -    }
> -
> -    // Measure DMI
> -    // FIXME: This will measure DMI. Until then use a fixed DMI_Measurement value
> -    // Also, this mechanism is specific to 1 VM architecture.
> -    /*
> -    fh = open(TPM_EMULATOR_PATH, O_RDONLY);
> -    stat_ret = fstat(fh, &file_stat);
> -    if (stat_ret == 0)
> -      dmi_size = file_stat.st_size;
> -    else {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Could not open vtpmd!!\n");
> -      status = TPM_IOERROR;
> -      goto abort_egress;
> -    }
> -    dmi_buffer
> -    */
> -    memset(&dmi_res->DMI_measurement, 0xcc, sizeof(TPM_DIGEST));
> -
> -    if (vm_type == VTPM_TYPE_PVM)
> -      vm_type_string = (BYTE *)&VTPM_TYPE_PVM_STRING;
> -    else
> -      vm_type_string = (BYTE *)&VTPM_TYPE_HVM_STRING;
> -
> -    // Launch DMI
> -    sprintf(dmi_id_str, "%d", (int) dmi_res->dmi_id);
> -#ifdef MANUAL_DM_LAUNCH
> -    vtpmlogerror(VTPM_LOG_VTPM, "Manually start VTPM with dmi=%s now.\n", dmi_id_str);
> -    dmi_res->dmi_pid = 0;
> -#else
> -    pid_t pid = fork();
> -
> -    if (pid == -1) {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Could not fork to launch vtpm\n");
> -      status = TPM_RESOURCES;
> -      goto abort_egress;
> -    } else if (pid == 0) {
> -      switch (startup_mode) {
> -      case TPM_ST_CLEAR:
> -        execl (TPM_EMULATOR_PATH, "vtpmd", "clear", vm_type_string, dmi_id_str, NULL);
> -        break;
> -      case TPM_ST_STATE:
> -        execl (TPM_EMULATOR_PATH, "vtpmd", "save", vm_type_string, dmi_id_str, NULL);
> -        break;
> -      case TPM_ST_DEACTIVATED:
> -        execl (TPM_EMULATOR_PATH, "vtpmd", "deactivated", vm_type_string, dmi_id_str, NULL);
> -        break;
> -      default:
> -        status = TPM_BAD_PARAMETER;
> -        goto abort_egress;
> -      }
> -
> -      // Returning from these at all is an error.
> -      vtpmlogerror(VTPM_LOG_VTPM, "Could not exec to launch vtpm\n");
> -    } else {
> -      dmi_res->dmi_pid = pid;
> -      vtpmloginfo(VTPM_LOG_VTPM, "Launching DMI on PID = %d\n", pid);
> -    }
> -#endif // MANUAL_DM_LAUNCH
> -
> -  } // If DMI = VTPM_CTL_DM
> -    status = TPM_SUCCESS;
> -
> -abort_egress:
> -  return (status);
> -}
> -
> -TPM_RESULT VTPM_Close_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  if (vtpm_globals->connected_dmis == 0) {
> -    // No more DMI's connected. Close fifo to prevent a broken pipe.
> -    // This is hackish. Need to think of another way.
> -    vtpm_ipc_close(g_rx_tpm_ipc_h);
> -  }
> -
> -
> -  if (dmi_res->dmi_id != VTPM_CTL_DM) {
> -    vtpm_ipc_close(dmi_res->tx_tpm_ipc_h);
> -    vtpm_ipc_close(dmi_res->tx_vtpm_ipc_h);
> -
> -    free(dmi_res->tx_tpm_ipc_h->name);
> -    free(dmi_res->tx_vtpm_ipc_h->name);
> -
> -#ifndef MANUAL_DM_LAUNCH
> -    if (dmi_res->dmi_id != VTPM_CTL_DM) {
> -      if (dmi_res->dmi_pid != 0) {
> -        vtpmloginfo(VTPM_LOG_VTPM, "Killing dmi on pid %d.\n", dmi_res->dmi_pid);
> -        if (kill(dmi_res->dmi_pid, SIGKILL) !=0) {
> -          vtpmloginfo(VTPM_LOG_VTPM, "DMI on pid %d is already dead.\n", dmi_res->dmi_pid);
> -        } else if (waitpid(dmi_res->dmi_pid, NULL, 0) != dmi_res->dmi_pid) {
> -          vtpmlogerror(VTPM_LOG_VTPM, "DMI on pid %d failed to stop.\n", dmi_res->dmi_pid);
> -          status = TPM_FAIL;
> -        }
> -      } else {
> -        vtpmlogerror(VTPM_LOG_VTPM, "Could not kill dmi because it's pid was 0.\n");
> -        status = TPM_FAIL;
> -      }
> -    }
> -#endif
> -
> -  } //endif ! dom0
> -  return status;
> -}
> -
> -
> -int main(int argc, char **argv) {
> -  vtpm_ipc_handle_t *tx_be_ipc_h, *rx_be_ipc_h, rx_tpm_ipc_h, rx_vtpm_ipc_h, tx_hp_ipc_h, rx_hp_ipc_h;
> -  struct vtpm_thread_params_s be_thread_params, dmi_thread_params, hp_thread_params;
> -  pthread_t be_thread, dmi_thread, hp_thread;
> -
> -#ifdef DUMMY_BACKEND
> -  vtpm_ipc_handle_t tx_dummy_ipc_h, rx_dummy_ipc_h;
> -#else
> -  vtpm_ipc_handle_t real_be_ipc_h;
> -#endif
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Starting VTPM.\n");
> -
> -  // -------------------- Initialize Manager -----------------
> -  if (VTPM_Init_Manager() != TPM_SUCCESS) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing vtpmd due to error during startup.\n");
> -    return -1;
> -  }
> -
> -  // -------------------- Setup Ctrl+C Handlers --------------
> -  ctl_c_handler.sa_handler = signal_handler;
> -  sigemptyset(&ctl_c_handler.sa_mask);
> -  ctl_c_handler.sa_flags = 0;
> -
> -  if (sigaction(SIGINT, &ctl_c_handler, NULL) == -1)
> -    vtpmlogerror(VTPM_LOG_VTPM, "Could not install SIGINT handler. Ctl+break will not stop manager gently.\n");
> -
> -  // For easier debuggin with gdb
> -  if (sigaction(SIGHUP, &ctl_c_handler, NULL) == -1)
> -    vtpmlogerror(VTPM_LOG_VTPM, "Could not install SIGHUP handler. Ctl+break will not stop manager gently.\n");
> -
> -  sigset_t sig_mask;
> -  sigemptyset(&sig_mask);
> -  sigaddset(&sig_mask, SIGPIPE);
> -  sigprocmask(SIG_BLOCK, &sig_mask, NULL);
> -
> -  // ------------------- Set up file ipc structures ----------
> -#ifdef DUMMY_BACKEND
> -  if ( (vtpm_ipc_init(&tx_dummy_ipc_h, VTPM_DUMMY_TX_BE_FNAME, O_RDWR, TRUE) != 0) ||
> -       (vtpm_ipc_init(&rx_dummy_ipc_h, VTPM_DUMMY_RX_BE_FNAME, O_RDWR, TRUE) != 0) ) {
> -
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to create Dummy BE FIFOs.\n");
> -    exit(-1);
> -  }
> -
> -  tx_be_ipc_h = &tx_dummy_ipc_h;
> -  rx_be_ipc_h = &rx_dummy_ipc_h;
> -#else
> -  vtpm_ipc_init(&real_be_ipc_h, VTPM_BE_FNAME, O_RDWR, FALSE);
> -
> -  tx_be_ipc_h = &real_be_ipc_h;
> -  rx_be_ipc_h = &real_be_ipc_h;
> -#endif
> -
> -  if ( (vtpm_ipc_init(&rx_tpm_ipc_h, VTPM_RX_TPM_FNAME, O_RDONLY, TRUE) != 0) ||
> -       (vtpm_ipc_init(&rx_vtpm_ipc_h, VTPM_RX_VTPM_FNAME, O_RDWR, TRUE) != 0) || //FIXME: O_RDONLY?
> -       (vtpm_ipc_init(&tx_hp_ipc_h,  VTPM_TX_HP_FNAME, O_RDWR, TRUE) != 0)    ||
> -       (vtpm_ipc_init(&rx_hp_ipc_h,  VTPM_RX_HP_FNAME, O_RDWR, TRUE) != 0) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to create initial FIFOs.\n");
> -    exit(-1);
> -  }
> -
> -  g_rx_tpm_ipc_h = &rx_tpm_ipc_h;
> -
> -  // -------------------- Set up thread params -------------
> -
> -  be_thread_params.tx_ipc_h = tx_be_ipc_h;
> -  be_thread_params.rx_ipc_h = rx_be_ipc_h;
> -  be_thread_params.fw_tpm = TRUE;
> -  be_thread_params.fw_tx_ipc_h = NULL;
> -  be_thread_params.fw_rx_ipc_h = &rx_tpm_ipc_h;
> -  be_thread_params.is_priv = FALSE;
> -  be_thread_params.thread_name = "Backend Listener";
> -
> -  dmi_thread_params.tx_ipc_h = NULL;
> -  dmi_thread_params.rx_ipc_h = &rx_vtpm_ipc_h;
> -  dmi_thread_params.fw_tpm = FALSE;
> -  dmi_thread_params.fw_tx_ipc_h = NULL;
> -  dmi_thread_params.fw_rx_ipc_h = NULL;
> -  dmi_thread_params.is_priv = FALSE;
> -  dmi_thread_params.thread_name = "VTPM Listener";
> -
> -  hp_thread_params.tx_ipc_h = &tx_hp_ipc_h;
> -  hp_thread_params.rx_ipc_h = &rx_hp_ipc_h;
> -  hp_thread_params.fw_tpm = FALSE;
> -  hp_thread_params.fw_tx_ipc_h = NULL;
> -  hp_thread_params.fw_rx_ipc_h = NULL;
> -  hp_thread_params.is_priv = TRUE;
> -  hp_thread_params.thread_name = "Hotplug Listener";
> -
> -  // --------------------- Launch Threads -----------------
> -
> -  vtpm_lock_init();
> -
> -  vtpm_globals->master_pid = pthread_self();
> -
> -  if (pthread_create(&be_thread, NULL, vtpm_manager_thread, &be_thread_params) != 0) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch BE Thread.\n");
> -    exit(-1);
> -  }
> -
> -  if (pthread_create(&dmi_thread, NULL, vtpm_manager_thread, &dmi_thread_params) != 0) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch DMI Thread.\n");
> -    exit(-1);
> -  }
> -
> -
> -  if (pthread_create(&hp_thread, NULL, vtpm_manager_thread, &hp_thread_params) != 0) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch HP Thread.\n");
> -    exit(-1);
> -  }
> -
> -  //Join the other threads until exit time.
> -  pthread_join(be_thread, NULL);
> -  pthread_join(dmi_thread, NULL);
> -  pthread_join(hp_thread, NULL);
> -
> -  vtpmlogerror(VTPM_LOG_VTPM, "VTPM Manager shut down unexpectedly.\n");
> -
> -  VTPM_Stop_Manager();
> -  vtpm_lock_destroy();
> -  return 0;
> -}
> diff --git a/tools/vtpm_manager/manager/vtpmpriv.h b/tools/vtpm_manager/manager/vtpmpriv.h
> deleted file mode 100644
> index 41e8d2d..0000000
> --- a/tools/vtpm_manager/manager/vtpmpriv.h
> +++ /dev/null
> @@ -1,186 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpmpriv.h
> -//
> -//  Structures and functions private to the manager
> -//
> -// ==================================================================
> -
> -#ifndef __VTPMPRIV_H__
> -#define __VTPMPRIV_H__
> -
> -#include "vtpm_manager.h"
> -#include "tcg.h"
> -#include "tcs.h"
> -#include "buffer.h"
> -#include "crypto.h"
> -#include "vtpm_ipc.h"
> -
> -#define VTPM_MANAGER_GEN   2     // This is incremented when the manager's table
> -                                 // is changed. It's used for backwards compatability
> -
> -#define STATE_FILE         "/var/vtpm/VTPM"
> -#define DMI_NVM_FILE       "/var/vtpm/vtpm_dm_%d.data"
> -#define VTPM_CTL_DM        0
> -
> -// ------------------------ Private Structures -----------------------
> -typedef struct VTPM_DMI_RESOURCE_T {
> -  // I/O info for Manager to talk to DMI's and controllers
> -  vtpm_ipc_handle_t      *tx_vtpm_ipc_h;    // TX VTPM Results to DMI
> -  vtpm_ipc_handle_t      *rx_vtpm_ipc_h;    // RX VTPM Commands from DMI
> -  vtpm_ipc_handle_t      *tx_tpm_ipc_h;     // TX TPM Commands to DMI
> -  vtpm_ipc_handle_t      *rx_tpm_ipc_h;     // RX TPM Results from DMI
> -
> -#ifndef VTPM_MULTI_VM
> -  pid_t                 dmi_pid;
> -#endif
> -
> -  // Non-persistent Information
> -  bool                  connected;
> -  UINT32                dmi_domain_id;
> -  TCS_CONTEXT_HANDLE    TCSContext;     // TCS Handle
> -  char                  *NVMLocation;   // NULL term string indicating location
> -                                        // of NVM.
> -  // Persistent Information about DMI
> -  UINT32                dmi_id;
> -  BYTE                  dmi_type;
> -  TPM_DIGEST            NVM_measurement;  // Equal to the SHA1 of the blob
> -  TPM_DIGEST            DMI_measurement;  // Correct measurement of the owning DMI
> -} VTPM_DMI_RESOURCE;
> -
> -typedef struct tdVTPM_MIGKEY_LIST {
> -  UINT32                name_size;
> -  BYTE                  *name; // Name of destination (IP addr, domain name, etc)
> -  CRYPTO_INFO           key;
> -  struct tdVTPM_MIGKEY_LIST *next;
> -} VTPM_MIGKEY_LIST;
> -
> -
> -typedef struct tdVTPM_GLOBALS {
> -  // Non-persistent data
> -#ifndef VTPM_MULTI_VM
> -  pid_t               master_pid;
> -#endif
> -
> -  int                 connected_dmis;     // To close guest_rx when no dmis are connected
> -
> -  struct hashtable    *dmi_map;               // Table of all DMI's known indexed by persistent instance #
> -  VTPM_MIGKEY_LIST    *mig_keys;              // Table of migration keys
> -                      // Currently keys are loaded at migration time,
> -                      // TODO: Make VTPM man store a keys persistently
> -                      //       and update script to check if key is needed
> -                      //       before fetching it.
> -
> -  TCS_CONTEXT_HANDLE  manager_tcs_handle;     // TCS Handle used by manager
> -  TPM_HANDLE          storageKeyHandle;       // Key used by persistent store
> -  CRYPTO_INFO         storageKey;             // For software encryption
> -  CRYPTO_INFO         bootKey;                // For saving table
> -  TCS_AUTH            keyAuth;                // OIAP session for storageKey
> -
> -  // Persistent Data
> -  TPM_AUTHDATA        owner_usage_auth;       // OwnerAuth of real TPM
> -  buffer_t            storageKeyWrap;         // Wrapped copy of storageKey
> -  TPM_AUTHDATA        srk_usage_auth;
> -  TPM_AUTHDATA        storage_key_usage_auth;
> -
> -  buffer_t            bootKeyWrap;            // Wrapped copy of boot key
> -
> -}VTPM_GLOBALS;
> -
> -// --------------------------- Global Values --------------------------
> -extern VTPM_GLOBALS *vtpm_globals;   // Key info and DMI states
> -extern const TPM_AUTHDATA SRK_AUTH;  // SRK Well Known Auth Value
> -
> -// ********************** VTPM Functions *************************
> -TPM_RESULT VTPM_Init_Manager(); // Start VTPM Service
> -void VTPM_Stop_Manager();  // Stop VTPM Service
> -TPM_RESULT VTPM_Manager_Handler(vtpm_ipc_handle_t *tx_ipc_h,
> -                                vtpm_ipc_handle_t *rx_ipc_h,
> -                                BOOL fw_tpm,   // Should forward TPM cmds
> -                                vtpm_ipc_handle_t *fw_tx_ipc_h,
> -                                vtpm_ipc_handle_t *fw_rx_ipc_h,
> -                                BOOL is_priv,
> -                                char *client_name);
> -
> -// ********************** Command Handler Prototypes ***********************
> -
> -TPM_RESULT VTPM_Handle_Load_NVM(       VTPM_DMI_RESOURCE *myDMI,
> -                                        const buffer_t *inbuf,
> -                                        buffer_t *outbuf);
> -
> -TPM_RESULT VTPM_Handle_Save_NVM(       VTPM_DMI_RESOURCE *myDMI,
> -                                        const buffer_t *inbuf,
> -                                        buffer_t *outbuf);
> -
> -TPM_RESULT VTPM_Handle_TPM_Command(    VTPM_DMI_RESOURCE *dmi,
> -                                        buffer_t *inbuf,
> -                                        buffer_t *outbuf);
> -
> -TPM_RESULT VTPM_Handle_New_DMI(const buffer_t *param_buf);
> -
> -TPM_RESULT VTPM_Handle_Close_DMI(const buffer_t *param_buf);
> -
> -TPM_RESULT VTPM_Handle_Delete_DMI(const buffer_t *param_buf);
> -
> -TPM_RESULT VTPM_Handle_Migrate_In( const buffer_t *param_buf,
> -                                   buffer_t *result_buf);
> -
> -TPM_RESULT VTPM_Handle_Migrate_Out ( const buffer_t *param_buf,
> -                                     buffer_t *result_buf);
> -
> -TPM_RESULT VTPM_Handle_Get_Migration_key( const buffer_t *param_buf,
> -                                          buffer_t *result_buf);
> -
> -TPM_RESULT VTPM_SaveManagerData(void);
> -TPM_RESULT VTPM_LoadManagerData(void);
> -
> -TPM_RESULT VTPM_New_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res, BYTE vm_type, BYTE startup_mode);
> -
> -TPM_RESULT VTPM_Close_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res);
> -
> -// Helper functions
> -TPM_RESULT close_dmi(VTPM_DMI_RESOURCE *dmi_res);
> -TPM_RESULT init_dmi(UINT32 dmi_id, BYTE type,  VTPM_DMI_RESOURCE **dmi_res);
> -
> -TPM_RESULT envelope_encrypt(const buffer_t     *inbuf,
> -                             CRYPTO_INFO        *asymkey,
> -                             buffer_t           *sealed_data);
> -
> -TPM_RESULT envelope_decrypt(const buffer_t     *cipher,
> -                            TCS_CONTEXT_HANDLE TCSContext,
> -                            TPM_HANDLE         keyHandle,
> -                            const TPM_AUTHDATA *key_usage_auth,
> -                            buffer_t           *unsealed_data);
> -
> -#endif // __VTPMPRIV_H__
> diff --git a/tools/vtpm_manager/manager/vtsp.c b/tools/vtpm_manager/manager/vtsp.c
> deleted file mode 100644
> index fc8a66f..0000000
> --- a/tools/vtpm_manager/manager/vtsp.c
> +++ /dev/null
> @@ -1,1042 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtsp.c
> -//
> -//  Higher level interface to TCS for use in service.
> -//
> -// ==================================================================
> -
> -#include <string.h>
> -#include "tcg.h"
> -#include "tcs.h"
> -#include "bsg.h"
> -#include "log.h"
> -#include "crypto.h"
> -#include "vtsp.h"
> -#include "buffer.h"
> -
> -#define  RSA_KEY_SIZE 0x0800
> -
> -/***********************************************************************************
> - * GenerateAuth: Generate authorization info to be sent back to application
> - *
> - * Parameters: outParamDigestText  The concatenation of output parameters to be SHA1ed
> - *    outParamDigestTextSize Size of inParamDigestText
> - *    HMACkey     Key to be used for HMACing
> - *          For OIAP use key.authUsage or PersistStore.ownerAuth
> - *          For OSAP use shared secret
> - *    pAuth     Authorization information from the application
> - *
> - * Return:  TPM_SUCCESS   Authorization data created
> - *    TPM_AUTHFAIL   Invalid (NULL) HMACkey presented for OSAP
> - *************************************************************************************/
> -TPM_RESULT GenerateAuth( /*[IN]*/ const BYTE *inParamDigestText,
> -                        /*[IN]*/ UINT32 inParamDigestTextSize,
> -                        /*[IN]*/ const TPM_SECRET *HMACkey,
> -                        /*[IN,OUT]*/ TCS_AUTH *auth) {
> -
> -  if (inParamDigestText == NULL || auth == NULL)
> -    return (TPM_AUTHFAIL);
> -  else {
> -
> -    //Generate new OddNonce
> -    Crypto_GetRandom(auth->NonceOdd.nonce, sizeof(TPM_NONCE));
> -
> -    // Create SHA1 inParamDigest
> -    TPM_DIGEST inParamDigest;
> -    Crypto_SHA1Full(inParamDigestText, inParamDigestTextSize, (BYTE *) &inParamDigest);
> -
> -    // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
> -    BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
> -
> -    BSG_PackList(   hmacText, 4,
> -                   BSG_TPM_DIGEST, &inParamDigest,
> -                   BSG_TPM_NONCE, &(auth->NonceEven),
> -                   BSG_TPM_NONCE, &(auth->NonceOdd),
> -                   BSG_TYPE_BOOL, &(auth->fContinueAuthSession) );
> -
> -    Crypto_HMAC((BYTE *) hmacText, sizeof(hmacText), (BYTE *) HMACkey, sizeof(TPM_DIGEST), (BYTE *) &(auth->HMAC));
> -
> -    return(TPM_SUCCESS);
> -
> -  }
> -}
> -
> -/***********************************************************************************
> - * VerifyAuth: Verify the authdata for a command requiring authorization
> - *
> - * Parameters: inParamDigestText  The concatenation of parameters to be SHA1ed
> - *    inParamDigestTextSize Size of inParamDigestText
> - *    authDataUsage   AuthDataUsage for the Entity being used
> - *          Key->authDataUsage or TPM_AUTH_OWNER
> - *    HMACkey     Key to be used for HMACing
> - *          For OIAP use key.authUsage or PersistStore.ownerAuth
> - *          For OSAP use NULL (It will be aquired from the Auth Session)
> - *          If unknown (default), assume OIAP
> - *    sessionAuth    A TCS_AUTH info for the session
> - *    pAuth     Authorization information from the application
> - *              hContext        If specified, on failed Auth, VerifyAuth will
> - *                                      generate a new OIAP session in place of themselves
> - *                                      destroyed session.
> - *
> - * Return:  TPM_SUCCESS   Authorization Verified
> - *    TPM_AUTHFAIL   Authorization Failed
> - *    TPM_FAIL    Failure during SHA1 routines
> - *************************************************************************************/
> -TPM_RESULT VerifyAuth( /*[IN]*/ const BYTE *outParamDigestText,
> -                      /*[IN]*/ UINT32 outParamDigestTextSize,
> -                      /*[IN]*/ const TPM_SECRET *HMACkey,
> -                      /*[IN,OUT]*/ TCS_AUTH *auth,
> -                      /*[IN]*/  TCS_CONTEXT_HANDLE hContext) {
> -  if (outParamDigestText == NULL || auth == NULL)
> -    return (TPM_AUTHFAIL);
> -
> -
> -  // Create SHA1 inParamDigest
> -  TPM_DIGEST outParamDigest;
> -  Crypto_SHA1Full(outParamDigestText, outParamDigestTextSize, (BYTE *) &outParamDigest);
> -
> -  // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
> -  TPM_DIGEST hm;
> -  BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
> -
> -  BSG_PackList(   hmacText, 4,
> -                 BSG_TPM_DIGEST, &outParamDigest,
> -                 BSG_TPM_NONCE, &(auth->NonceEven),
> -                 BSG_TPM_NONCE, &(auth->NonceOdd),
> -                 BSG_TYPE_BOOL, &(auth->fContinueAuthSession) );
> -
> -  Crypto_HMAC((BYTE *) hmacText, sizeof(hmacText),
> -             (BYTE *) HMACkey, sizeof(TPM_DIGEST), (BYTE *) &hm);
> -
> -  // Compare correct HMAC with provided one.
> -  if (memcmp (&hm, &(auth->HMAC), sizeof(TPM_DIGEST)) == 0) { // 0 indicates equality
> -    if (!auth->fContinueAuthSession)
> -      vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM by fContinue=0.\n", auth->AuthHandle);
> -
> -    return (TPM_SUCCESS);
> -  } else {
> -    // If specified, reconnect the OIAP session.
> -    // NOTE: This only works for TCS's that never have a 0 context.
> -    if (hContext) {
> -      vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM due to failure.\n", auth->AuthHandle);
> -      VTSP_OIAP( hContext, auth);
> -    }
> -    return (TPM_AUTHFAIL);
> -  }
> -}
> -
> -TPM_RESULT VTSP_OIAP(const TCS_CONTEXT_HANDLE hContext,
> -                    TCS_AUTH *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "OIAP.\n");
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPMTRYRETURN( TCSP_OIAP(hContext,
> -                         &auth->AuthHandle,
> -                         &auth->NonceEven) );
> -
> -  memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
> -  auth->fContinueAuthSession = FALSE;
> -
> -  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x opened by TPM_OIAP.\n", auth->AuthHandle);
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_OSAP(const TCS_CONTEXT_HANDLE hContext,
> -                    const TPM_ENTITY_TYPE entityType,
> -                    const UINT32 entityValue,
> -                    const TPM_AUTHDATA *usageAuth,
> -                    TPM_SECRET *sharedSecret,
> -                    TCS_AUTH *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "OSAP.\n");
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_NONCE nonceEvenOSAP, nonceOddOSAP;
> -
> -  Crypto_GetRandom((BYTE *) &nonceOddOSAP, sizeof(TPM_NONCE) );
> -
> -  TPMTRYRETURN( TCSP_OSAP(    hContext,
> -                             entityType,
> -                             entityValue,
> -                             nonceOddOSAP,
> -                             &auth->AuthHandle,
> -                             &auth->NonceEven,
> -                             &nonceEvenOSAP) );
> -
> -  // Calculating Session Secret
> -  BYTE sharedSecretText[TPM_DIGEST_SIZE * 2];
> -
> -  BSG_PackList(  sharedSecretText, 2,
> -                BSG_TPM_NONCE, &nonceEvenOSAP,
> -                BSG_TPM_NONCE, &nonceOddOSAP);
> -
> -  Crypto_HMAC(sharedSecretText, sizeof(sharedSecretText), (BYTE *) usageAuth, TPM_DIGEST_SIZE, (BYTE *) sharedSecret);
> -
> -  memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
> -  auth->fContinueAuthSession = FALSE;
> -
> -  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x opened by TPM_OSAP.\n", auth->AuthHandle);
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTSP_TerminateHandle(const TCS_CONTEXT_HANDLE hContext,
> -                                const TCS_AUTH *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Terminate Handle.\n");
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPMTRYRETURN( TCSP_TerminateHandle(hContext, auth->AuthHandle) );
> -
> -  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM_TerminateHandle.\n", auth->AuthHandle);
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTSP_ReadPubek(   const TCS_CONTEXT_HANDLE hContext,
> -                             CRYPTO_INFO *crypto_info) {
> -
> -  TPM_RESULT status;
> -  TPM_NONCE antiReplay;
> -  TPM_DIGEST   checksum;
> -  BYTE *pubEKtext;
> -  UINT32 pubEKtextsize;
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Reading Public EK.\n");
> -
> -  // GenerateAuth new nonceOdd
> -  Crypto_GetRandom(&antiReplay, sizeof(TPM_NONCE) );
> -
> -
> -  TPMTRYRETURN( TCSP_ReadPubek(  hContext,
> -                                antiReplay,
> -                                &pubEKtextsize,
> -                                &pubEKtext,
> -                                &checksum) );
> -
> -
> -  // Extract the remaining output parameters
> -  TPM_PUBKEY pubEK;
> -
> -  BSG_Unpack(BSG_TPM_PUBKEY, pubEKtext, (BYTE *) &pubEK);
> -
> -  // Build CryptoInfo for the bindingKey
> -  TPM_RSA_KEY_PARMS rsaKeyParms;
> -
> -  BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
> -            pubEK.algorithmParms.parms,
> -            &rsaKeyParms);
> -
> -  Crypto_RSABuildCryptoInfoPublic(rsaKeyParms.exponentSize,
> -                                 rsaKeyParms.exponent,
> -                                 pubEK.pubKey.keyLength,
> -                                 pubEK.pubKey.key,
> -                                 crypto_info);
> -
> -  // Destroy rsaKeyParms
> -  BSG_Destroy(BSG_TPM_RSA_KEY_PARMS, &rsaKeyParms);
> -
> -  // Set encryption scheme
> -  crypto_info->encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
> -  //crypto_info->encScheme = pubEK.algorithmParms.encScheme;
> -  crypto_info->algorithmID = pubEK.algorithmParms.algorithmID;
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_TakeOwnership(   const TCS_CONTEXT_HANDLE hContext,
> -                                 const TPM_AUTHDATA *ownerAuth,
> -                                 const TPM_AUTHDATA *srkAuth,
> -                                 CRYPTO_INFO *ek_cryptoInfo,
> -                                 TCS_AUTH *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Taking Ownership of TPM.\n");
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_TakeOwnership;
> -  TPM_PROTOCOL_ID proto_id = TPM_PID_OWNER;
> -  BYTE *new_srk;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // vars for srkpubkey parameter
> -  TPM_KEY srkPub;
> -  TPM_KEY_PARMS srkKeyInfo = {TPM_ALG_RSA, TPM_ES_RSAESOAEP_SHA1_MGF1, TPM_SS_NONE, 12, 0};
> -  BYTE srkRSAkeyInfo[12] = { 0x00, 0x00, (RSA_KEY_SIZE >> 8), 0x00,   0x00, 0x00, 0x00, 0x02,   0x00, 0x00, 0x00, 0x00};
> -  srkKeyInfo.parms = (BYTE *) &srkRSAkeyInfo;
> -
> -  struct pack_buf_t srkText;
> -
> -  //These values are accurate for an enc(AuthData).
> -  struct pack_buf_t encOwnerAuth, encSrkAuth;
> -
> -  encOwnerAuth.data = (BYTE *)malloc(sizeof(BYTE) * 256);
> -  encSrkAuth.data = (BYTE *)malloc(sizeof(BYTE) * 256);
> -
> -  if (encOwnerAuth.data == NULL || encSrkAuth.data == NULL) {
> -    vtpmloginfo(VTPM_LOG_VTSP, "Could not malloc encrypted auths.\n");
> -    status = TPM_RESOURCES;
> -    goto abort_egress;
> -  }
> -
> -  Crypto_RSAEnc(ek_cryptoInfo, sizeof(TPM_SECRET), (BYTE *) ownerAuth, &encOwnerAuth.size, encOwnerAuth.data);
> -  Crypto_RSAEnc(ek_cryptoInfo, sizeof(TPM_SECRET), (BYTE *) srkAuth, &encSrkAuth.size, encSrkAuth.data);
> -
> -
> -  // Build srk public key struct
> -  srkPub.ver = TPM_STRUCT_VER_1_1;
> -  srkPub.keyUsage = TPM_KEY_STORAGE;
> -  srkPub.keyFlags = 0x00;
> -  srkPub.authDataUsage = TPM_AUTH_ALWAYS;
> -  memcpy(&srkPub.algorithmParms, &srkKeyInfo, sizeof(TPM_KEY_PARMS));
> -  srkPub.PCRInfoSize = 0;
> -  srkPub.PCRInfo = 0;
> -  srkPub.pubKey.keyLength= 0;
> -  srkPub.encDataSize = 0;
> -
> -  srkText.data = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -  srkText.size = BSG_Pack(BSG_TPM_KEY, (BYTE *) &srkPub, srkText.data);
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 5,
> -                              BSG_TPM_COMMAND_CODE,&command,
> -                              BSG_TPM_PROTOCOL_ID, &proto_id,
> -                              BSG_TPM_SIZE32_DATA, &encOwnerAuth,
> -                              BSG_TPM_SIZE32_DATA, &encSrkAuth,
> -                              BSG_TPM_KEY, &srkPub);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize, ownerAuth, auth) );
> -
> -  new_srk = srkText.data;
> -  TPMTRYRETURN( TCSP_TakeOwnership ( hContext,
> -                                    proto_id,
> -                                    encOwnerAuth.size,
> -                                    encOwnerAuth.data,
> -                                    encSrkAuth.size,
> -                                    encSrkAuth.data,
> -                                    &srkText.size,
> -                                    &new_srk,
> -                                    auth ) );
> -
> -
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                              BSG_TPM_RESULT, &status,
> -                              BSG_TPM_COMMAND_CODE, &command);
> -  memcpy(paramText + paramTextSize, new_srk, srkText.size);
> -  paramTextSize += srkText.size;
> -
> -
> -  TPMTRYRETURN( VerifyAuth(  paramText, paramTextSize,
> -                            ownerAuth, auth,
> -                            hContext) );
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  free(srkText.data);
> -  free(encSrkAuth.data);
> -  free(encOwnerAuth.data);
> -  free(paramText);
> -
> -  TCS_FreeMemory(hContext, new_srk);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_DisablePubekRead( const TCS_CONTEXT_HANDLE    hContext,
> -                                  const TPM_AUTHDATA          *ownerAuth,
> -                                  TCS_AUTH                    *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Disabling Pubek Read.\n");
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_DisablePubekRead;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 1,
> -                              BSG_TPM_COMMAND_CODE, &command);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                             ownerAuth, auth) );
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_DisablePubekRead ( hContext, // in
> -                                        auth) );
> -
> -  // Verify Auth
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                              BSG_TPM_RESULT, &status,
> -                              BSG_TPM_COMMAND_CODE, &command);
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                           ownerAuth, auth,
> -                           hContext) );
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -  free(paramText);
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_CreateWrapKey(  const TCS_CONTEXT_HANDLE hContext,
> -                                const TPM_KEY_USAGE      usage,
> -                                const TPM_AUTHDATA       *newKeyAuth,
> -                                const TCS_KEY_HANDLE     parentHandle,
> -                                const TPM_AUTHDATA       *osapSharedSecret,
> -                                buffer_t                 *pubKeyBuf,
> -                                TCS_AUTH                 *auth) {
> -
> -  int i;
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_CreateWrapKey;
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Creating new key of type %d.\n", usage);
> -
> -  // vars for Calculate encUsageAuth
> -  BYTE *paramText;
> -  UINT32 paramTextSize;
> -
> -  // vars for Calculate encUsageAuth
> -  BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
> -  TPM_DIGEST XORKey1;
> -  UINT32 XORbufferSize;
> -  TPM_SECRET encUsageAuth, encMigrationAuth;
> -
> -  // vars for Flatten newKey prototype
> -  BYTE *flatKey = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -  UINT32 flatKeySize = TCPA_MAX_BUFFER_LENGTH;
> -  struct pack_buf_t newKeyText;
> -
> -  // Fill in newKey
> -  TPM_KEY newKey;
> -
> -  BYTE RSAkeyInfo[12] = { 0x00, 0x00, (RSA_KEY_SIZE >> 8), 0x00,   0x00, 0x00, 0x00, 0x02,   0x00, 0x00, 0x00, 0x00};
> -  newKey.algorithmParms.algorithmID = TPM_ALG_RSA;
> -  newKey.algorithmParms.parms = (BYTE *) &RSAkeyInfo;
> -  newKey.algorithmParms.parmSize = 12;
> -
> -  switch (usage) {
> -  case TPM_KEY_SIGNING:
> -    vtpmloginfo(VTPM_LOG_VTSP, "Creating Signing Key...\n");
> -    newKey.keyUsage = TPM_KEY_SIGNING;
> -    newKey.algorithmParms.encScheme = TPM_ES_NONE;
> -    newKey.algorithmParms.sigScheme = TPM_SS_RSASSAPKCS1v15_SHA1;
> -    break;
> -  case TPM_KEY_STORAGE:
> -    vtpmloginfo(VTPM_LOG_VTSP, "Creating Storage Key...\n");
> -    newKey.keyUsage = TPM_KEY_STORAGE;
> -    newKey.algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
> -    newKey.algorithmParms.sigScheme = TPM_SS_NONE;
> -    break;
> -  case TPM_KEY_BIND:
> -    vtpmloginfo(VTPM_LOG_VTSP, "Creating Binding Key...\n");
> -    newKey.keyUsage = TPM_KEY_BIND;
> -    newKey.algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
> -    newKey.algorithmParms.sigScheme = TPM_SS_NONE;
> -    break;
> -  default:
> -    vtpmloginfo(VTPM_LOG_VTSP, "Cannot create key. Invalid Key Type.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -
> -  newKey.ver = TPM_STRUCT_VER_1_1;
> -
> -  newKey.keyFlags = 0;
> -  newKey.authDataUsage = TPM_AUTH_ALWAYS;
> -  newKey.pubKey.keyLength= 0;
> -  newKey.encDataSize = 0;
> -  newKey.encData = NULL;
> -
> -  // FIXME: Support PCR bindings
> -  newKey.PCRInfoSize = 0;
> -  newKey.PCRInfo = NULL;
> -
> -  // Calculate encUsageAuth
> -  XORbufferSize = BSG_PackList(  XORbuffer, 2,
> -                                BSG_TPM_SECRET, osapSharedSecret,
> -                                BSG_TPM_NONCE, &auth->NonceEven);
> -  Crypto_SHA1Full(XORbuffer, XORbufferSize, (BYTE *) &XORKey1);
> -
> -  // FIXME: No support for migratable keys.
> -  for (i=0; i < TPM_DIGEST_SIZE; i++)
> -    ((BYTE *) &encUsageAuth)[i] = ((BYTE *) &XORKey1)[i] ^ ((BYTE *) newKeyAuth)[i];
> -
> -  // Flatten newKey prototype
> -  flatKeySize = BSG_Pack(BSG_TPM_KEY, (BYTE *) &newKey, flatKey);
> -  newKeyText.data = flatKey;
> -  newKeyText.size = flatKeySize;
> -
> -  // Generate HMAC
> -  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 3,
> -                              BSG_TPM_COMMAND_CODE, &command,
> -                              BSG_TPM_AUTHDATA, &encUsageAuth,
> -                              BSG_TPM_AUTHDATA, &encMigrationAuth);
> -  memcpy(paramText + paramTextSize, newKeyText.data, newKeyText.size);
> -  paramTextSize += newKeyText.size;
> -
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                             osapSharedSecret, auth) );
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_CreateWrapKey(  hContext,
> -                                    parentHandle,
> -                                    encUsageAuth,
> -                                    encMigrationAuth,
> -                                    &newKeyText.size,
> -                                    &newKeyText.data,
> -                                    auth) );
> -
> -  // Verify Auth
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                              BSG_TPM_RESULT, &status,
> -                              BSG_TPM_COMMAND_CODE, &command);
> -  memcpy(paramText + paramTextSize, newKeyText.data, newKeyText.size);
> -  paramTextSize += newKeyText.size;
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                           osapSharedSecret, auth, 0) );
> -
> -  // Unpack/return key structure
> -  TPMTRYRETURN(buffer_init(pubKeyBuf, 0, 0) );
> -  TPMTRYRETURN(buffer_append_raw(pubKeyBuf, newKeyText.size, newKeyText.data) );
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  free(flatKey);
> -  free(paramText);
> -  TCS_FreeMemory(hContext, newKeyText.data);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_LoadKey(const TCS_CONTEXT_HANDLE    hContext,
> -                        const TCS_KEY_HANDLE        hUnwrappingKey,
> -                        const buffer_t              *rgbWrappedKeyBlob,
> -                        const TPM_AUTHDATA          *parentAuth,
> -                        TPM_HANDLE                  *newKeyHandle,
> -                        TCS_AUTH                    *auth,
> -                        CRYPTO_INFO                 *cryptoinfo,
> -                        const BOOL                  skipTPMLoad) {
> -
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Loading Key %s.\n", (!skipTPMLoad ? "into TPM" : "only into memory"));
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_LoadKey;
> -
> -  BYTE *paramText=NULL;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // SkipTPMLoad stops key from being loaded into TPM, but still generates CRYPTO_INFO for it
> -  if (! skipTPMLoad) {
> -
> -    if ((rgbWrappedKeyBlob == NULL) || (parentAuth == NULL) ||
> -        (newKeyHandle==NULL) || (auth==NULL)) {
> -      status = TPM_BAD_PARAMETER;
> -      goto abort_egress;
> -    }
> -
> -    // Generate Extra TCS Parameters
> -    TPM_HANDLE phKeyHMAC;
> -
> -    paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -
> -    paramTextSize = BSG_PackList(paramText, 1,
> -                                BSG_TPM_COMMAND_CODE, &command);
> -
> -    memcpy(paramText + paramTextSize, rgbWrappedKeyBlob->bytes, buffer_len(rgbWrappedKeyBlob));
> -    paramTextSize += buffer_len(rgbWrappedKeyBlob);
> -
> -    TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                             parentAuth, auth) );
> -
> -    // Call TCS
> -    TPMTRYRETURN( TCSP_LoadKeyByBlob(  hContext,
> -                                      hUnwrappingKey,
> -                                      buffer_len(rgbWrappedKeyBlob),
> -                                      rgbWrappedKeyBlob->bytes,
> -                                      auth,
> -                                      newKeyHandle,
> -                                      &phKeyHMAC) );
> -
> -    // Verify Auth
> -    paramTextSize = BSG_PackList(paramText, 3,
> -                                BSG_TPM_RESULT, &status,
> -                                BSG_TPM_COMMAND_CODE, &command,
> -                                BSG_TPM_HANDLE, newKeyHandle);
> -
> -    TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                             parentAuth, auth,
> -                             hContext) );
> -  }
> -
> -  // Build cryptoinfo structure for software crypto function.
> -  if (cryptoinfo != NULL) {
> -    TPM_KEY newKey;
> -
> -    // Unpack/return key structure
> -    BSG_Unpack(BSG_TPM_KEY, rgbWrappedKeyBlob->bytes , &newKey);
> -    TPM_RSA_KEY_PARMS rsaKeyParms;
> -
> -    BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
> -              newKey.algorithmParms.parms,
> -              &rsaKeyParms);
> -
> -    Crypto_RSABuildCryptoInfoPublic(rsaKeyParms.exponentSize,
> -                                   rsaKeyParms.exponent,
> -                                   newKey.pubKey.keyLength,
> -                                   newKey.pubKey.key,
> -                                   cryptoinfo);
> -
> -    // Destroy rsaKeyParms
> -    BSG_Destroy(BSG_TPM_RSA_KEY_PARMS, &rsaKeyParms);
> -
> -    // Set encryption scheme
> -    cryptoinfo->encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
> -  }
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  free(paramText);
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_Unbind( const TCS_CONTEXT_HANDLE    hContext,
> -                        const TPM_KEY_HANDLE        key_handle,
> -                        const buffer_t              *bound_data,
> -                        const TPM_AUTHDATA          *usage_auth,
> -                        buffer_t                    *clear_data,
> -                        TCS_AUTH                    *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Unbinding %d bytes of data.\n", buffer_len(bound_data));
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_UnBind;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // Generate Extra TCS Parameters
> -  struct pack_buf_t clear_data32;
> -  BYTE *clear_data_text;
> -  UINT32 clear_data_size;
> -
> -  struct pack_buf_t bound_data32 = {bound_data->size, bound_data->bytes};
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                              BSG_TPM_COMMAND_CODE, &command,
> -                              BSG_TPM_SIZE32_DATA, &bound_data32);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                             usage_auth, auth) );
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_UnBind( hContext,
> -                            key_handle,
> -                            buffer_len(bound_data),
> -                            bound_data->bytes,
> -                            auth,
> -                            &clear_data_size,
> -                            &clear_data_text) );
> -
> -
> -  // Verify Auth
> -  clear_data32.size = clear_data_size;
> -  clear_data32.data = clear_data_text;
> -  paramTextSize = BSG_PackList(paramText, 3,
> -                              BSG_TPM_RESULT, &status,
> -                              BSG_TPM_COMMAND_CODE, &command,
> -                              BSG_TPM_SIZE32_DATA, &clear_data32);
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                           usage_auth, auth,
> -                           hContext) );
> -
> -  // Unpack/return key structure
> -  TPMTRYRETURN(buffer_init(clear_data, 0, 0));
> -  TPMTRYRETURN(buffer_append_raw (clear_data, clear_data_size, clear_data_text) );
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  free(paramText);
> -  TCS_FreeMemory(hContext, clear_data_text);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_Bind(   CRYPTO_INFO *cryptoInfo,
> -                       const buffer_t *inData,
> -                       buffer_t *outData)
> -{
> -  vtpmloginfo(VTPM_LOG_VTSP, "Binding %d bytes of data.\n", buffer_len(inData));
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_BOUND_DATA boundData;
> -  UINT32 i;
> -
> -  // Fill boundData's accessory information
> -  boundData.ver = TPM_STRUCT_VER_1_1;
> -  boundData.payload = TPM_PT_BIND;
> -  boundData.payloadData = inData->bytes;
> -
> -  // Pack boundData before encryption
> -  BYTE* flatBoundData = (BYTE *)malloc(sizeof(BYTE) *
> -                                      (sizeof(TPM_VERSION) +
> -                                       sizeof(TPM_PAYLOAD_TYPE) +
> -                                       buffer_len(inData)));
> -  if (flatBoundData == NULL) {
> -    return TPM_NOSPACE;
> -  }
> -  UINT32 flatBoundDataSize = 0;
> -  flatBoundDataSize = BSG_PackList(  flatBoundData, 2,
> -                                    BSG_TPM_VERSION, &boundData.ver,
> -                                    BSG_TYPE_BYTE, &boundData.payload);
> -
> -  memcpy(flatBoundData+flatBoundDataSize, inData->bytes, buffer_len(inData));
> -  flatBoundDataSize += buffer_len(inData);
> -
> -  BYTE out_tmp[RSA_KEY_SIZE/8]; // RSAEnc does not do blocking, So this is what will come out.
> -  UINT32 out_tmp_size;
> -
> -  // Encrypt flatBoundData
> -  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_RSAEnc( cryptoInfo,
> -                                           flatBoundDataSize,
> -                                           flatBoundData,
> -                                           &out_tmp_size,
> -                                           out_tmp) );
> -
> -  if (out_tmp_size > RSA_KEY_SIZE/8) {
> -    // The result of RSAEnc should be a fixed size based on key size.
> -    vtpmlogerror(VTPM_LOG_VTSP, "Enc buffer just overflowed.\n");
> -  }
> -
> -  buffer_init(outData, 0, NULL);
> -  buffer_append_raw(outData, out_tmp_size, out_tmp);
> -
> -  vtpmloginfo(VTPM_LOG_TXDATA, "Bind Generated[%d] = 0x", out_tmp_size);
> -  for(i = 0 ; i < out_tmp_size ; i++) {
> -    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out_tmp[i]);
> -  }
> -  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> -
> -  goto egress;
> -  abort_egress:
> -  egress:
> -
> -  // Free flatBoundData
> -  free(flatBoundData);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -TPM_RESULT VTSP_Seal(const TCS_CONTEXT_HANDLE    hContext,
> -                     const TPM_KEY_HANDLE        keyHandle,
> -                     const TPM_AUTHDATA          *sealDataAuth,
> -                     const TPM_PCR_COMPOSITE     *pcrComp,
> -                     const buffer_t              *inData,
> -                     TPM_STORED_DATA             *sealedData,
> -                     const TPM_SECRET            *osapSharedSecret,
> -                     TCS_AUTH                    *auth) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_Seal;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // Generate PCR_Info Struct from Comp
> -  TPM_PCR_INFO pcrInfo;
> -  UINT32 pcrInfoSize, flatpcrSize;
> -  BYTE flatpcr[3 +                          // PCR_Select = 3 1 byte banks
> -               sizeof(UINT16) +             //              2 byte UINT16
> -               sizeof(UINT32) +             // PCR_Comp   = 4 byte UINT32
> -               24 * sizeof(TPM_PCRVALUE) ]; //              up to 24 PCRs
> -
> -  if (pcrComp != NULL) {
> -      //printf("\n\tBinding to PCRs: ");
> -      //for(int i = 0 ; i < pcrComp->select.sizeOfSelect ; i++)
> -      //printf("%2.2x", pcrComp->select.pcrSelect[i]);
> -
> -      memcpy(&pcrInfo.pcrSelection, &pcrComp->select, sizeof(TPM_PCR_SELECTION));
> -
> -      flatpcrSize = BSG_Pack(BSG_TPM_PCR_COMPOSITE, (BYTE *) pcrComp, flatpcr);
> -      Crypto_SHA1Full((BYTE *) flatpcr, flatpcrSize, (BYTE *) &(pcrInfo.digestAtRelease));
> -      memset(&(pcrInfo.digestAtCreation), 0, sizeof(TPM_DIGEST));
> -      pcrInfoSize = BSG_Pack(BSG_TPM_PCR_INFO, (BYTE *) &pcrInfo, flatpcr);
> -  } else {
> -      //printf("\n\tBinding to no PCRS.");
> -      pcrInfoSize = 0;
> -  }
> -
> -  // Calculate encUsageAuth
> -  BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
> -  UINT32 XORbufferSize = sizeof(XORbuffer);
> -  TPM_DIGEST XORKey;
> -  TPM_ENCAUTH encAuth;
> -
> -  BSG_PackList( XORbuffer, 2,
> -                BSG_TPM_SECRET, osapSharedSecret,
> -                BSG_TPM_NONCE, &auth->NonceEven );
> -
> -  Crypto_SHA1Full(XORbuffer, XORbufferSize, (BYTE *) &XORKey);
> -
> -  int i;
> -  for (i=0; i < TPM_DIGEST_SIZE; i++)
> -    ((BYTE *) &encAuth)[i] = ((BYTE *) &XORKey)[i] ^ ((BYTE *) sealDataAuth)[i];
> -
> -  // Generate Extra TCS Parameters
> -  UINT32 inDataSize = buffer_len(inData);
> -  struct pack_buf_t inData_pack = {inDataSize, inData->bytes};
> -  struct pack_buf_t pcrInfo_pack = {pcrInfoSize, flatpcr};
> -
> -  UINT32 sealedDataSize;
> -  BYTE *flatSealedData=NULL;
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 4,
> -                               BSG_TPM_COMMAND_CODE, &command,
> -                               BSG_TPM_ENCAUTH, &encAuth,
> -                               BSG_TPM_SIZE32_DATA, &pcrInfo_pack,
> -                               BSG_TPM_SIZE32_DATA, &inData_pack);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                              osapSharedSecret, auth) );
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_Seal( hContext,
> -                           keyHandle,
> -                           encAuth,
> -                           pcrInfoSize,
> -                           flatpcr,
> -                           inDataSize,
> -                           inData->bytes,
> -                           auth,
> -                           &sealedDataSize,
> -                           &flatSealedData) );
> -
> -  // Unpack/return key structure
> -  BSG_Unpack( BSG_TPM_STORED_DATA, flatSealedData, sealedData );
> -
> -  paramTextSize = BSG_PackList(paramText, 3,
> -                               BSG_TPM_RESULT, &status,
> -                               BSG_TPM_COMMAND_CODE, &command,
> -                               BSG_TPM_STORED_DATA, sealedData);
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                            osapSharedSecret, auth,
> -                            0) );
> -
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  if (flatSealedData)
> -    TCS_FreeMemory( hContext, flatSealedData);
> -
> -  free(paramText);
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTSP_Unseal(const TCS_CONTEXT_HANDLE    hContext,
> -                       const TPM_KEY_HANDLE        keyHandle,
> -                       const TPM_STORED_DATA       *sealedData,
> -                       const TPM_AUTHDATA          *key_usage_auth,
> -                       const TPM_AUTHDATA          *data_usage_auth,
> -                       buffer_t                    *outData,
> -                       TCS_AUTH                    *auth,
> -                       TCS_AUTH                    *dataAuth) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_Unseal;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // Generate Extra TCS Parameters
> -  UINT32 sealDataSize, clearDataSize;
> -  BYTE *flatSealedData= (BYTE *) malloc(sizeof(TPM_VERSION) +
> -                                        2 * sizeof(UINT32) +
> -                                        sealedData->sealInfoSize +
> -                                        sealedData->encDataSize),
> -       *clearData=NULL;
> -
> -  sealDataSize = BSG_Pack(BSG_TPM_STORED_DATA, sealedData, flatSealedData );
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                               BSG_TPM_COMMAND_CODE, &command,
> -                               BSG_TPM_STORED_DATA, sealedData);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                              key_usage_auth, auth) );
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                              data_usage_auth, dataAuth) );
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_Unseal(  hContext,
> -                              keyHandle,
> -                              sealDataSize,
> -                              flatSealedData,
> -                              auth,
> -                              dataAuth,
> -                              &clearDataSize,
> -                              &clearData) );
> -
> -  // Verify Auth
> -  struct pack_buf_t clearData_pack = {clearDataSize, clearData};
> -
> -  paramTextSize = BSG_PackList(paramText, 3,
> -                               BSG_TPM_RESULT, &status,
> -                               BSG_TPM_COMMAND_CODE, &command,
> -                               BSG_TPM_SIZE32_DATA, &clearData_pack);
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                            key_usage_auth, auth,
> -                            hContext) );
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                            data_usage_auth, dataAuth,
> -                            hContext) );
> -
> -  // Unpack/return key structure
> -  TPMTRYRETURN( buffer_init(outData, clearDataSize, clearData) );
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  if (flatSealedData)
> -    TCS_FreeMemory( hContext, clearData);
> -
> -  free(paramText);
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_SaveState( const TCS_CONTEXT_HANDLE    hContext) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Calling TPM_SaveState.\n");
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  // Call TCS
> -  return ( TCSP_SaveState ( hContext ) );
> -
> -}
> -
> -
> -// Function Reaches into unsupported TCS command, beware.
> -TPM_RESULT VTSP_RawTransmit(const TCS_CONTEXT_HANDLE    hContext,
> -                            const buffer_t *inbuf,
> -                            buffer_t *outbuf ) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Passthrough in use.\n");
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  // Generate Extra TCS Parameters
> -  BYTE *resultText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -  UINT32 resultTextSize =  TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_RawTransmitData(buffer_len(inbuf), inbuf->bytes,
> -                                    &resultTextSize, resultText) );
> -
> -  // Unpack/return key structure
> -  TPMTRYRETURN(buffer_init (outbuf, resultTextSize, resultText) );
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -  TCS_FreeMemory(hContext, resultText);
> -  free(resultText);
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/manager/vtsp.h b/tools/vtpm_manager/manager/vtsp.h
> deleted file mode 100644
> index 2fb0440..0000000
> --- a/tools/vtpm_manager/manager/vtsp.h
> +++ /dev/null
> @@ -1,126 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtsp.h
> -//
> -//  Higher level interface to TCS.
> -//
> -// ==================================================================
> -
> -#ifndef __VTSP_H__
> -#define __VTSP_H__
> -
> -#include "tcg.h"
> -#include "tcs.h"
> -
> -#define KEY_BUFFER_SIZE 2048
> -
> -TPM_RESULT VTSP_RawTransmit(const TCS_CONTEXT_HANDLE    hContext,
> -                            const buffer_t *inbuf,
> -                            buffer_t *outbuf );
> -
> -TPM_RESULT VTSP_OIAP(  const TCS_CONTEXT_HANDLE hContext,
> -                       TCS_AUTH *auth);
> -
> -TPM_RESULT VTSP_OSAP(  const TCS_CONTEXT_HANDLE hContext,
> -                       const TPM_ENTITY_TYPE entityType,
> -                       const UINT32 entityValue,
> -                       const TPM_AUTHDATA *usageAuth,
> -                       TPM_SECRET *sharedsecret,
> -                       TCS_AUTH *auth);
> -
> -TPM_RESULT VTSP_TerminateHandle(const TCS_CONTEXT_HANDLE hContext,
> -                                const TCS_AUTH *auth);
> -
> -TPM_RESULT VTSP_ReadPubek(   const TCS_CONTEXT_HANDLE hContext,
> -                             CRYPTO_INFO *cypto_info);
> -
> -TPM_RESULT VTSP_TakeOwnership(   const TCS_CONTEXT_HANDLE hContext,
> -                                 const TPM_AUTHDATA *ownerAuth,
> -                                 const TPM_AUTHDATA *srkAuth,
> -                                 CRYPTO_INFO *ek_cryptoInfo,
> -                                 TCS_AUTH *auth);
> -
> -TPM_RESULT VTSP_DisablePubekRead( const TCS_CONTEXT_HANDLE    hContext,
> -                                  const TPM_AUTHDATA *ownerAuth,
> -                                  TCS_AUTH                    *auth);
> -
> -TPM_RESULT VTSP_CreateWrapKey(  const TCS_CONTEXT_HANDLE hContext,
> -                                const TPM_KEY_USAGE      usage,
> -                                const TPM_AUTHDATA       *newKeyAuth,
> -                                const TCS_KEY_HANDLE     parentHandle,
> -                                const TPM_AUTHDATA       *osapSharedSecret,
> -                                buffer_t                 *pubKeyBuf,
> -                                TCS_AUTH                 *auth);
> -
> -TPM_RESULT VTSP_LoadKey(const TCS_CONTEXT_HANDLE    hContext,
> -                        const TCS_KEY_HANDLE        hUnwrappingKey,
> -                        const buffer_t              *rgbWrappedKeyBlob,
> -                        const TPM_AUTHDATA          *parentAuth,
> -                        TPM_HANDLE                  *newKeyHandle,
> -                        TCS_AUTH                    *pAuth,
> -                        CRYPTO_INFO                 *cryptoinfo,
> -                        const BOOL                  skipTPMLoad);
> -
> -TPM_RESULT VTSP_Unbind( const TCS_CONTEXT_HANDLE    hContext,
> -                        const TPM_KEY_HANDLE        key_handle,
> -                        const buffer_t              *bound_data,
> -                        const TPM_AUTHDATA          *usage_auth,
> -                        buffer_t                    *clear_data,
> -                        TCS_AUTH                    *auth);
> -
> -TPM_RESULT VTSP_Bind(   CRYPTO_INFO *cryptoInfo,
> -            const buffer_t *inData,
> -            buffer_t *outData);
> -
> -TPM_RESULT VTSP_Seal(const TCS_CONTEXT_HANDLE    hContext,
> -                     const TPM_KEY_HANDLE        keyHandle,
> -                     const TPM_AUTHDATA          *sealDataAuth,
> -                     const TPM_PCR_COMPOSITE     *pcrComp,
> -                     const buffer_t              *inData,
> -                     TPM_STORED_DATA             *sealedData,
> -                     const TPM_SECRET            *osapSharedSecret,
> -                     TCS_AUTH                    *auth);
> -
> -TPM_RESULT VTSP_Unseal(const TCS_CONTEXT_HANDLE    hContext,
> -                       const TPM_KEY_HANDLE        keyHandle,
> -                       const TPM_STORED_DATA       *sealedData,
> -                       const TPM_AUTHDATA          *key_usage_auth,
> -                       const TPM_AUTHDATA          *data_usage_auth,
> -                       buffer_t                    *outData,
> -                       TCS_AUTH                    *auth,
> -                       TCS_AUTH                    *dataAuth);
> -
> -TPM_RESULT VTSP_SaveState( const TCS_CONTEXT_HANDLE    hContext);
> -
> -#endif //_VTSP_H_
> diff --git a/tools/vtpm_manager/migration/Makefile b/tools/vtpm_manager/migration/Makefile
> deleted file mode 100644
> index e33ae95..0000000
> --- a/tools/vtpm_manager/migration/Makefile
> +++ /dev/null
> @@ -1,42 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -VPATH = ../manager
> -
> -BIND           = vtpm_migratord
> -BINC           = vtpm_migrator
> -
> -SRCSD    = vtpm_manager_if.c vtpm_migratord.c vtpm_migratord_handler.c vtpm_ipc.c
> -SRCSC    = vtpm_manager_if.c vtpm_migrator_if.c vtpm_migratorc.c vtpm_ipc.c
> -
> -OBJSD    = $(patsubst %.c,%.o,$(SRCSD))
> -OBJSC    = $(patsubst %.c,%.o,$(SRCSC))
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIND) $(BINC)
> -
> -.PHONY: install
> -install: build
> -       $(INSTALL_PROG) $(BIND) $(DESTDIR)$(BINDIR)
> -       $(INSTALL_PROG) $(BINC) $(DESTDIR)$(BINDIR)
> -
> -.PHONY: clean
> -clean:
> -       rm -f $(BINC) $(BIND)
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIND): $(OBJSD)
> -       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
> -
> -$(BINC): $(OBJSC)
> -       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
> -
> -# libraries
> -LIBS += ../util/libTCGUtils.a
> diff --git a/tools/vtpm_manager/migration/vtpm_manager_if.c b/tools/vtpm_manager/migration/vtpm_manager_if.c
> deleted file mode 100644
> index 08986f4..0000000
> --- a/tools/vtpm_manager/migration/vtpm_manager_if.c
> +++ /dev/null
> @@ -1,186 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_manager_if.c
> -//
> -//  Provides functions to call local vtpm manager interface (Hotplug)
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <fcntl.h>
> -#include <malloc.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "vtpm_ipc.h"
> -#include "bsg.h"
> -#include "vtpm_migrator.h"
> -#include "vtpm_manager.h"
> -
> -#define VTPM_TX_HP_FNAME       "/var/vtpm/fifos/from_console.fifo"
> -#define VTPM_RX_HP_FNAME       "/var/vtpm/fifos/to_console.fifo"
> -
> -static vtpm_ipc_handle_t tx_ipc_h, rx_ipc_h;
> -
> -TPM_RESULT vtpm_manager_open(){
> -
> -  if ( (vtpm_ipc_init(&tx_ipc_h,  VTPM_TX_HP_FNAME, O_RDWR, TRUE) != 0) ||  //FIXME: wronly
> -       (vtpm_ipc_init(&rx_ipc_h,  VTPM_RX_HP_FNAME, O_RDWR, TRUE) != 0) ) { //FIXME: rdonly
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to connect to vtpm_manager.\n");
> -    return TPM_IOERROR;
> -  }
> -
> -  return TPM_SUCCESS;
> -}
> -
> -void vtpm_manager_close() {
> -
> -  vtpm_ipc_close(&tx_ipc_h);
> -  vtpm_ipc_close(&rx_ipc_h);
> -}
> -
> -
> -TPM_RESULT vtpm_manager_command(TPM_COMMAND_CODE ord,
> -                                buffer_t *command_param_buf,
> -                                TPM_RESULT *cmd_status, /* out */
> -                                buffer_t *result_param_buf) {
> -
> -  TPM_RESULT status = TPM_FAIL;
> -  int  size_read, size_write, i;
> -  BYTE *adj_command, response_header[VTPM_COMMAND_HEADER_SIZE_SRV];
> -  UINT32 dmi_id=0, adj_command_size, out_param_size, adj_param_size;
> -  TPM_TAG tag=VTPM_TAG_REQ;
> -
> -  if ( (!command_param_buf) || (!result_param_buf) || (!cmd_status) ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  adj_command_size = VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(command_param_buf);
> -  adj_command = (BYTE *) malloc( adj_command_size );
> -  if (!adj_command) {
> -    status = TPM_RESOURCES;
> -    goto abort_egress;
> -  }
> -
> -  out_param_size = VTPM_COMMAND_HEADER_SIZE + buffer_len(command_param_buf);
> -  BSG_PackList(adj_command, 4,
> -                 BSG_TYPE_UINT32, &dmi_id,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &out_param_size,
> -                 BSG_TPM_COMMAND_CODE, &ord );
> -
> -  memcpy(adj_command + VTPM_COMMAND_HEADER_SIZE_SRV, command_param_buf->bytes, buffer_len(command_param_buf));
> -
> -  size_write = vtpm_ipc_write(&tx_ipc_h, NULL, adj_command, adj_command_size);
> -
> -  if (size_write > 0) {
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT (MGR): 0x");
> -    for (i=0; i< adj_command_size; i++) {
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", adj_command[i]);
> -    }
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -  } else {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Error writing VTPM Manager console.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (size_write != (int) adj_command_size )
> -    vtpmlogerror(VTPM_LOG_VTPM, "Could not write entire command to mgr (%d/%d)\n", size_write, adj_command_size);
> -
> -  // Read header for response to manager command
> -  size_read = vtpm_ipc_read(&rx_ipc_h, NULL, response_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -  if (size_read > 0) {
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV (MGR): 0x");
> -    for (i=0; i<size_read; i++)
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", response_header[i]);
> -
> -  } else {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Error reading from vtpm manager.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Command from vtpm_manager shorter than std header.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  // Unpack response from DMI for TPM command
> -  BSG_UnpackList(response_header, 4,
> -                 BSG_TYPE_UINT32, &dmi_id,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &out_param_size,
> -                 BSG_TPM_COMMAND_CODE, cmd_status );
> -
> -  // If response has parameters, read them.
> -  // Note that out_param_size is in the client's context
> -  adj_param_size = out_param_size - VTPM_COMMAND_HEADER_SIZE;
> -  if (adj_param_size > 0) {
> -    TPMTRYRETURN( buffer_init( result_param_buf, adj_param_size, NULL) );
> -    size_read = vtpm_ipc_read(&rx_ipc_h, NULL, result_param_buf->bytes, adj_param_size);
> -    if (size_read > 0) {
> -      for (i=0; i< size_read; i++)
> -        vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_param_buf->bytes[i]);
> -
> -    } else {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Error reading from vtpm manager.\n");
> -      goto abort_egress;
> -    }
> -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -
> -    if (size_read < (int)adj_param_size) {
> -      vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -      vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
> -      status = TPM_IOERROR;
> -      goto abort_egress;
> -    }
> -  } else {
> -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -  }
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> -
> -
> diff --git a/tools/vtpm_manager/migration/vtpm_migrator.h b/tools/vtpm_manager/migration/vtpm_migrator.h
> deleted file mode 100644
> index 8d52e66..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migrator.h
> +++ /dev/null
> @@ -1,104 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_migrator.h
> -//
> -//  Public Interface header for VTPM Migrator
> -//
> -// ==================================================================
> -
> -#ifndef __VTPM_MIGRATOR_H__
> -#define __VTPM_MIGRATOR_H__
> -
> -#define VTPM_MTAG_REQ 0x02c1
> -#define VTPM_MTAG_RSP 0x02c4
> -
> -// Header sizes.
> -#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
> -//               sizeof(TPM_TAG + UINT32 + TPM_COMMAND_CODE)
> -
> -//*********************** Connection Info **************************
> -#define VTPM_MIG_PORT 48879
> -
> -//************************ Command Codes ***************************
> -#define VTPM_MORD_MIG_STEP1     0x00
> -#define VTPM_MORD_MIG_STEP2     0x01
> -#define VTPM_MORD_MIG_STEP3     0x02
> -#define VTPM_MORD_MIG_STEP4     0x03
> -
> -//************************ Return Codes ****************************
> -#define VTPM_SUCCESS               0
> -#define VTPM_FAIL                  1
> -
> -/******************* Command Parameter API *************************
> -
> -VTPM Command Format
> -  tpm tag: 2 bytes
> -  command size: 4 bytes         // Size of command including header but not DMI
> -  ord: 4 bytes                  // Command ordinal above
> -  parameters: size - 10 bytes   // Command Parameter
> -
> -VTPM Response Format
> -  tpm tag: 2 bytes
> -  response_size: 4 bytes
> -  status: 4 bytes
> -  parameters: size - 10 bytes
> -
> -
> -VTPM_Mig_Phase1:
> -    Unsupported: (Handled by scripts)
> -
> -VTPM_Mig_Phase2
> -  Input Parameters:
> -    domain_name_size: 4 bytes
> -    domain_name : domain_name_size bytes
> -  Output Parameters:
> -    pub_exp_size: 4 bytes
> -    pub_exp: pub_exp_size bytes
> -    pub_mod_size: 4 bytes
> -    pub_mod: pub_mod_size bytes
> -
> -VTPM_Mig_Phase3
> -  Input Parameters:
> -    vtpm_state_size: 4 bytes
> -    vtpm_state: vtpm_state_size bytes
> -  Output Parameters:
> -    none
> -
> -VTPM_Mig_Phase4
> -    Unsupported: (Handled by scripts)
> -
> -
> -*********************************************************************/
> -
> -#endif //_VTPM_MANAGER_H_
> diff --git a/tools/vtpm_manager/migration/vtpm_migrator_if.c b/tools/vtpm_manager/migration/vtpm_migrator_if.c
> deleted file mode 100644
> index de48b2d..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migrator_if.c
> +++ /dev/null
> @@ -1,219 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_migrator_if.c
> -//
> -//  Provides functions to call open network connection & call
> -//  a function on the vtpm_migratord on the destination
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <sys/types.h>
> -#include <sys/socket.h>
> -#include <netinet/in.h>
> -#include <arpa/inet.h>
> -#include <netdb.h>
> -#include <string.h>
> -#include <malloc.h>
> -
> -#include "tcg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "bsg.h"
> -#include "vtpm_migrator.h"
> -
> -static int sock_desc;
> -
> -
> -TPM_RESULT vtpm_migratord_open(char *server_address){
> -
> -  TPM_RESULT status = TPM_FAIL;
> -
> -  /* network variables */
> -  struct in_addr ip_addr;
> -  struct sockaddr_in server_addr;
> -  int addr_len;
> -  struct hostent *dns_info=NULL;
> -
> -  /* set up connection to server*/
> -  dns_info = gethostbyname(server_address);
> -  ip_addr.s_addr = *((unsigned long *) dns_info->h_addr_list[0]);
> -
> -  if(ip_addr.s_addr < 0) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  /* set up server variable */
> -  memset((char *)&server_addr, 0, sizeof(server_addr));
> -  server_addr.sin_family = AF_INET;
> -  server_addr.sin_port = htons(VTPM_MIG_PORT);
> -  server_addr.sin_addr.s_addr = ip_addr.s_addr;
> -
> -  /* open socket, make connection */
> -  sock_desc = socket(AF_INET, SOCK_STREAM, 0);
> -
> -  if (sock_desc < 0 ) {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (connect(sock_desc,
> -              (struct sockaddr *)&server_addr,
> -              sizeof(server_addr)) < 0 ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  status = TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> -
> -void vtpm_migratord_close() {
> -  close(sock_desc);
> -}
> -
> -
> -TPM_RESULT vtpm_migratord_command(TPM_COMMAND_CODE ord,
> -                                buffer_t *command_param_buf,
> -                                TPM_RESULT *cmd_status, /* out */
> -                                buffer_t *result_param_buf) {
> -
> -  TPM_RESULT status = TPM_FAIL;
> -  int  size_read, size_write, i;
> -  BYTE *command, response_header[VTPM_COMMAND_HEADER_SIZE];
> -  UINT32 dmi_id=0, command_size, out_param_size, adj_param_size;
> -  TPM_TAG tag=VTPM_MTAG_REQ;
> -
> -  if ( (!command_param_buf) || (!result_param_buf) || (!cmd_status) ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  command_size = VTPM_COMMAND_HEADER_SIZE + buffer_len(command_param_buf);
> -  command = (BYTE *) malloc( command_size );
> -  if (!command) {
> -    status = TPM_RESOURCES;
> -    goto abort_egress;
> -  }
> -
> -  BSG_PackList(command, 3,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &command_size,
> -                 BSG_TPM_COMMAND_CODE, &ord );
> -
> -  memcpy(command + VTPM_COMMAND_HEADER_SIZE, command_param_buf->bytes, buffer_len(command_param_buf));
> -
> -  size_write = write(sock_desc, command, command_size);
> -
> -  if (size_write > 0) {
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT (MIGd): 0x");
> -    for (i=0; i< command_size; i++) {
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", command[i]);
> -    }
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -  } else {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Error writing to migration server via network.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (size_write != (int) command_size )
> -    vtpmlogerror(VTPM_LOG_VTPM, "Could not write entire command to migration server (%d/%d)\n", size_write, command_size);
> -
> -  // Read header for response
> -  size_read = read(sock_desc, response_header, VTPM_COMMAND_HEADER_SIZE);
> -  if (size_read > 0) {
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV (MIGd): 0x");
> -    for (i=0; i<size_read; i++)
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", response_header[i]);
> -
> -  } else {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Error reading from Migration Server.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Command from migration server shorter than std header.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  // Unpack response from DMI for TPM command
> -  BSG_UnpackList(response_header, 3,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &out_param_size,
> -                 BSG_TPM_COMMAND_CODE, cmd_status );
> -
> -  // If response has parameters, read them.
> -  adj_param_size = out_param_size - VTPM_COMMAND_HEADER_SIZE;
> -  if (adj_param_size > 0) {
> -    TPMTRYRETURN( buffer_init( result_param_buf, adj_param_size, NULL) );
> -    size_read = read(sock_desc, result_param_buf->bytes, adj_param_size);
> -    if (size_read > 0) {
> -      for (i=0; i< size_read; i++)
> -        vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_param_buf->bytes[i]);
> -
> -    } else {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Error reading from migration server.\n");
> -      goto abort_egress;
> -    }
> -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -
> -    if (size_read < (int)adj_param_size) {
> -      vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -      vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
> -      status = TPM_IOERROR;
> -      goto abort_egress;
> -    }
> -  } else {
> -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -  }
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> -
> -
> diff --git a/tools/vtpm_manager/migration/vtpm_migratorc.c b/tools/vtpm_manager/migration/vtpm_migratorc.c
> deleted file mode 100644
> index 18b3bdb..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migratorc.c
> +++ /dev/null
> @@ -1,211 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <stdio.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "log.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -#include "vtpm_migrator.h"
> -#include "vtpm_manager.h"
> -
> -TPM_RESULT handle_vtpm_mig_step2(char *server_addr,
> -                                 char *name,
> -                                 UINT32 instance) {
> -  TPM_RESULT status, cmd_status;
> -  buffer_t out_param_buf=NULL_BUF, mig_key_buf=NULL_BUF, empty_buf=NULL_BUF;
> -  UINT32 offset;
> -  struct pack_buf_t addr_data32;
> -
> -  //===== Get Destination's Public Migration Key ======
> -  TPMTRYRETURN( vtpm_migratord_open(server_addr) );
> -
> -  TPMTRYRETURN( vtpm_migratord_command(VTPM_MORD_MIG_STEP2,
> -                                     &out_param_buf,
> -                                     &cmd_status,
> -                                     &mig_key_buf) );
> -  vtpm_migratord_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  //===== Load migration key into vtpm_manager ========
> -
> -  addr_data32.data = (BYTE *)server_addr;
> -  addr_data32.size = strlen(server_addr) + 1; // Include the null
> -
> -  TPMTRYRETURN ( buffer_init ( &out_param_buf,
> -                               sizeof(UINT32) + addr_data32.size +buffer_len(&mig_key_buf),
> -                               NULL ) ) ;
> -
> -  offset =  BSG_PackList(out_param_buf.bytes, 1,
> -               BSG_TPM_SIZE32_DATA, &addr_data32);
> -
> -  memcpy(out_param_buf.bytes + offset , mig_key_buf.bytes, buffer_len(&mig_key_buf) );
> -
> -  TPMTRYRETURN ( vtpm_manager_open() );
> -
> -  TPMTRYRETURN ( vtpm_manager_command(VTPM_ORD_LOAD_MIG_KEY,
> -                                      &out_param_buf,
> -                                      &cmd_status,
> -                                      &empty_buf) );
> -
> -  vtpm_manager_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  buffer_free(&mig_key_buf);
> -  buffer_free(&out_param_buf);
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT handle_vtpm_mig_step3(char *server_addr,
> -                                 char *name,
> -                                 UINT32 instance) {
> -  TPM_RESULT status, cmd_status;
> -  buffer_t out_param_buf=NULL_BUF, state_buf=NULL_BUF, empty_buf=NULL_BUF;
> -  struct pack_buf_t addr_data32, name_data32, state_data32;
> -
> -  //===== Get vtpm state from vtpm_manager ========
> -  addr_data32.data = (BYTE *)server_addr;
> -  addr_data32.size = strlen(server_addr) + 1; // Include the null
> -
> -  TPMTRYRETURN ( buffer_init ( &out_param_buf,
> -                               (2 * sizeof(UINT32)) + addr_data32.size,
> -                               NULL ) ) ;
> -
> -  BSG_PackList(out_param_buf.bytes, 2,
> -                 BSG_TYPE_UINT32, &instance,
> -                 BSG_TPM_SIZE32_DATA, &addr_data32);
> -
> -  TPMTRYRETURN ( vtpm_manager_open() );
> -
> -  TPMTRYRETURN ( vtpm_manager_command(VTPM_ORD_MIGRATE_OUT,
> -                                      &out_param_buf,
> -                                      &cmd_status,
> -                                      &state_buf) );
> -
> -  vtpm_manager_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  TPMTRYRETURN( buffer_free( &out_param_buf ) );
> -
> -  //===== Send vtpm state to destination ======
> -  name_data32.data = (BYTE *)name;
> -  name_data32.size = strlen(name) + 1; // Include the null
> -  state_data32.data = state_buf.bytes;
> -  state_data32.size = buffer_len(&state_buf);
> -
> -  TPMTRYRETURN( buffer_init( &out_param_buf,
> -                             2 * sizeof(UINT32) + name_data32.size + state_data32.size,
> -                             NULL ) ) ;
> -
> -  BSG_PackList(out_param_buf.bytes, 2,
> -                 BSG_TPM_SIZE32_DATA, &name_data32,
> -                 BSG_TPM_SIZE32_DATA, &state_data32);
> -
> -  TPMTRYRETURN( vtpm_migratord_open(server_addr) );
> -
> -  TPMTRYRETURN( vtpm_migratord_command(VTPM_MORD_MIG_STEP3,
> -                                     &out_param_buf,
> -                                     &cmd_status,
> -                                     &empty_buf) );
> -  vtpm_migratord_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  buffer_free( &out_param_buf);
> -  buffer_free( &state_buf);
> -  buffer_free( &empty_buf);
> -
> -  return status;
> -}
> -
> -
> -// Usage vtpm_migrator addr domain_name instance step
> -
> -int main(int argc, char **argv) {
> -
> -    /* variables for processing of command */
> -    TPM_RESULT status = TPM_FAIL;
> -    char *server_addr, *name;
> -    UINT32 instance, step;
> -
> -    if (argc != 5) {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Usage: vtpm_migrator addr vm_name instance step\n");
> -      vtpmlogerror(VTPM_LOG_VTPM, "       params given %d\n", argc);
> -      status= TPM_BAD_PARAMETER;
> -      goto abort_egress;
> -    }
> -
> -    server_addr = argv[1];
> -    name = argv[2];
> -    instance = atoi( argv[3] );
> -    step = atoi( argv[4] );
> -
> -    switch (step) {
> -    case VTPM_MORD_MIG_STEP2:
> -      status = handle_vtpm_mig_step2(server_addr, name, instance);
> -      break;
> -
> -    case VTPM_MORD_MIG_STEP3:
> -      status = handle_vtpm_mig_step3(server_addr, name, instance);
> -      break;
> -
> -    default:
> -      status = TPM_BAD_PARAMETER;
> -      goto abort_egress;
> -      break;
> -    }
> -
> -    goto egress;
> - abort_egress:
> - egress:
> -
> -    return status;
> -}
> -
> diff --git a/tools/vtpm_manager/migration/vtpm_migratord.c b/tools/vtpm_manager/migration/vtpm_migratord.c
> deleted file mode 100644
> index ea18c8c..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migratord.c
> +++ /dev/null
> @@ -1,202 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <stdio.h>
> -#include <sys/types.h>
> -#include <sys/socket.h>
> -#include <netinet/in.h>
> -#include <arpa/inet.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "log.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -#include "vtpm_migrator.h"
> -
> -void build_error_msg( buffer_t *buf, TPM_RESULT status) {
> -  TPM_TAG tag = VTPM_MTAG_RSP;
> -  UINT32 out_param_size = VTPM_COMMAND_HEADER_SIZE;
> -
> -  buffer_init(buf, out_param_size, NULL);
> -
> -  BSG_PackList(buf->bytes, 3,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &out_param_size,
> -                 BSG_TPM_RESULT, &status );
> -}
> -
> -int main() {
> -
> -    /* network variables */
> -    int sock_descr, client_sock=-1, len;
> -    struct sockaddr_in addr;
> -    struct sockaddr_in client_addr;
> -    unsigned int client_length;
> -    int bytes;
> -
> -    /* variables for processing of command */
> -    TPM_RESULT status = TPM_FAIL;
> -    BYTE cmd_header[VTPM_COMMAND_HEADER_SIZE];
> -    TPM_TAG tag;
> -    TPM_COMMAND_CODE ord;
> -    UINT32 in_param_size, adj_param_size;
> -    int i, size_read, size_write;
> -    buffer_t in_param_buf=NULL_BUF, result_buf=NULL_BUF;
> -
> -
> -    /* setup socket */
> -    sock_descr = socket(AF_INET, SOCK_STREAM, 0);
> -
> -    memset(&addr, 0, sizeof(addr));
> -    addr.sin_family = AF_INET;
> -    addr.sin_addr.s_addr = htonl(INADDR_ANY);
> -    addr.sin_port = htons(VTPM_MIG_PORT);
> -
> -    if (bind(sock_descr, (struct sockaddr *)&addr, sizeof(addr)) == -1 ) {
> -        vtpmlogerror(VTPM_LOG_VTPM, "Failed to bind to port %d.\n", VTPM_MIG_PORT);
> -        return 1;
> -    }
> -
> -    listen(sock_descr, 10);
> -
> -    for(;;) {
> -        // ============ clear client info and wait for connection ==========
> -        memset(&client_addr, 0, sizeof(client_addr));
> -        client_length = sizeof(client_addr);
> -
> -        vtpmloginfo(VTPM_LOG_VTPM, "Waiting for incoming migrations...\n");
> -        client_sock=accept(sock_descr, &client_addr, &client_length);
> -        if (client_sock == -1) {
> -            vtpmlogerror(VTPM_LOG_VTPM, "Incoming connectionn failed.\n");
> -            goto abort_command;
> -        } else {
> -            vtpmloginfo(VTPM_LOG_VTPM, "Incoming connection accepted.\n");
> -        }
> -
> -        // =================== Read incoming command ======================
> -        size_read = read( client_sock, cmd_header, VTPM_COMMAND_HEADER_SIZE);
> -        if (size_read > 0) {
> -            vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV: 0x");
> -            for (i=0; i<size_read; i++)
> -                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> -
> -        } else {
> -            vtpmlogerror(VTPM_LOG_VTPM, "Error reading from socket.\n");
> -            build_error_msg(&result_buf, TPM_IOERROR);
> -            goto abort_command_with_error;
> -        }
> -
> -        if (size_read < (int) VTPM_COMMAND_HEADER_SIZE) {
> -            vtpmlogerror(VTPM_LOG_VTPM, "Command from socket shorter than std header.\n");
> -            build_error_msg(&result_buf, TPM_BAD_PARAMETER);
> -            goto abort_command_with_error;
> -        }
> -
> -        // Unpack response from client
> -        BSG_UnpackList(cmd_header, 3,
> -                       BSG_TPM_TAG, &tag,
> -                       BSG_TYPE_UINT32, &in_param_size,
> -                       BSG_TPM_COMMAND_CODE, &ord );
> -
> -
> -        // If response has parameters, read them.
> -        // Note that out_param_size is in the client's context
> -        adj_param_size = in_param_size - VTPM_COMMAND_HEADER_SIZE;
> -        if (adj_param_size > 0) {
> -            buffer_init( &in_param_buf, adj_param_size, NULL);
> -            size_read = read(client_sock, in_param_buf.bytes, adj_param_size);
> -            if (size_read > 0) {
> -                for (i=0; i< size_read; i++)
> -                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param_buf.bytes[i]);
> -
> -            } else {
> -                vtpmlogerror(VTPM_LOG_VTPM, "Error reading from socket.\n");
> -                build_error_msg(&result_buf, TPM_IOERROR);
> -                goto abort_command_with_error;
> -            }
> -            vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -
> -            if (size_read < (int)adj_param_size) {
> -                vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -                vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
> -                build_error_msg(&result_buf, TPM_BAD_PARAMETER);
> -                goto abort_command_with_error;
> -            }
> -        } else {
> -            vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -        }
> -
> -        /* Handle Command */
> -        switch (ord) {
> -        case VTPM_MORD_MIG_STEP2:
> -          handle_vtpm_mig_step2(&in_param_buf, &result_buf);
> -          break;
> -
> -        case VTPM_MORD_MIG_STEP3:
> -          handle_vtpm_mig_step3(&in_param_buf, &result_buf);
> -          break;
> -
> -        default:
> -            build_error_msg(&result_buf, TPM_BAD_PARAMETER);
> -            goto abort_command_with_error;
> -        }
> -
> -  abort_command_with_error:
> -        /* Write Response */
> -        size_write = write(client_sock, result_buf.bytes, buffer_len(&result_buf));
> -
> -        if (size_write > 0) {
> -            vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT: 0x");
> -            for (i=0; i< buffer_len(&result_buf); i++) {
> -                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_buf.bytes[i]);
> -            }
> -            vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -        } else {
> -            vtpmlogerror(VTPM_LOG_VTPM, "Error writing response to client.\n");
> -            goto abort_command;
> -        }
> -
> -        if (size_write != (int) buffer_len(&result_buf) )
> -           vtpmlogerror(VTPM_LOG_VTPM, "Could not send entire response to client(%d/%d)\n", size_write, buffer_len(&result_buf));
> -
> -  abort_command:
> -        close(client_sock);
> -        buffer_free(&in_param_buf);
> -        buffer_free(&result_buf);
> -
> -    } // For (;;)
> -
> -    return 0;
> -}
> -
> diff --git a/tools/vtpm_manager/migration/vtpm_migratord_handler.c b/tools/vtpm_manager/migration/vtpm_migratord_handler.c
> deleted file mode 100644
> index 0a8a2d5..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migratord_handler.c
> +++ /dev/null
> @@ -1,177 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <stdlib.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "bsg.h"
> -#include "log.h"
> -#include "vtpm_migrator.h"
> -#include "vtpm_manager.h"
> -
> -#define VTPM_SH_CMD_HDR  "bash -c \"cd /etc/xen/scripts; source /etc/xen/scripts/vtpm-common.sh;"
> -#define VTPM_SH_CMD_FTR  "\""
> -#define VTPM_SH_GETINST  "vtpmdb_get_free_instancenum"
> -#define VTPM_SH_ADD      "vtpm_add_and_activate"
> -#define VTPM_SH_RESUME   "vtpm_resume"
> -
> -// This must be updated to the longest command name. Currently GETINST
> -#define VTPM_SH_CMD_SIZE (strlen(VTPM_SH_CMD_HDR) + strlen(VTPM_SH_CMD_FTR) + 1 + strlen(VTPM_SH_GETINST) + 2)
> -
> -void handle_vtpm_mig_step2(buffer_t *in_param_buf, buffer_t *result_buf)
> -{
> -  TPM_TAG tag = VTPM_TAG_RSP;
> -  buffer_t out_param_buf= NULL_BUF, mig_key_buf=NULL_BUF;
> -  TPM_RESULT status=TPM_SUCCESS, cmd_status;
> -  UINT32 out_param_size;
> -
> -  if ( (!in_param_buf) || (!result_buf) ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  // ================= Call manager and get mig key ===============
> -  TPMTRYRETURN( vtpm_manager_open() );
> -  TPMTRYRETURN( vtpm_manager_command(VTPM_ORD_GET_MIG_KEY,
> -                                     &out_param_buf, // Empty
> -                                     &cmd_status,
> -                                     &mig_key_buf) );
> -
> -  vtpm_manager_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  // ==================== return the  mig key =====================
> -  out_param_size =  VTPM_COMMAND_HEADER_SIZE + buffer_len(&mig_key_buf);
> -
> -  TPMTRYRETURN( buffer_init(result_buf,
> -                            out_param_size,
> -                            NULL) );
> -
> -  BSG_PackList( result_buf->bytes, 3,
> -                  BSG_TPM_TAG, &tag,
> -                  BSG_TYPE_UINT32, &out_param_size,
> -                  BSG_TPM_RESULT, &status);
> -
> -  memcpy(result_buf->bytes + VTPM_COMMAND_HEADER_SIZE,
> -         mig_key_buf.bytes, buffer_len(&mig_key_buf));
> -
> -  goto egress;
> -
> - abort_egress:
> -  buffer_free(result_buf);
> -  build_error_msg(result_buf, status);
> -
> - egress:
> -  return;
> -}
> -
> -void handle_vtpm_mig_step3(buffer_t *in_param_buf, buffer_t *result_buf)
> -{
> -  TPM_TAG tag = VTPM_TAG_RSP;
> -  buffer_t out_param_buf= NULL_BUF, mig_key_buf=NULL_BUF, empty_buf=NULL_BUF;
> -  TPM_RESULT status=TPM_SUCCESS, cmd_status;
> -  UINT32 out_param_size, instance;
> -  char *shell_cmd_str=NULL;
> -  size_t shell_cmd_strlen;
> -  FILE *shell_f=NULL;
> -
> -  if ( (!in_param_buf) || (!result_buf) ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  // ================= Read Parameters ===============
> -  struct pack_buf_t name_data32, state_data32;
> -
> -  BSG_UnpackList(in_param_buf->bytes, 2,
> -                 BSG_TPM_SIZE32_DATA, &name_data32,
> -                 BSG_TPM_SIZE32_DATA, &state_data32);
> -
> -  // Before using this string, protect us from a non-null term array.
> -  if (name_data32.data[name_data32.size -1] != 0x00) {
> -    name_data32.data[name_data32.size -1] = 0x00;
> -  }
> -
> -  // ====== Call hotplug-script and get an instance ======
> -  shell_cmd_strlen = VTPM_SH_CMD_SIZE + name_data32.size + 10;
> -  shell_cmd_str = (char *) malloc(shell_cmd_strlen); // 10 is just padding for the UINT32
> -
> -  snprintf(shell_cmd_str, shell_cmd_strlen,
> -       VTPM_SH_CMD_HDR VTPM_SH_GETINST VTPM_SH_CMD_FTR);
> -
> -  shell_f = popen(shell_cmd_str, "r");
> -  fscanf(shell_f, "%d", &instance);
> -  pclose(shell_f);
> -
> -  // ====== Call hotplug-script and add instance ======
> -  snprintf(shell_cmd_str, shell_cmd_strlen,
> -       VTPM_SH_CMD_HDR VTPM_SH_ADD " %s %d" VTPM_SH_CMD_FTR,
> -       name_data32.data, instance);
> -  system(shell_cmd_str);
> -
> -  // ========= Call vtpm_manager and load VTPM =======
> -  TPMTRYRETURN( buffer_init( &out_param_buf,
> -                             2*sizeof(UINT32) + state_data32.size,
> -                             NULL) );
> -
> -  BSG_PackList(out_param_buf.bytes, 2,
> -                 BSG_TYPE_UINT32, &instance,
> -                 BSG_TPM_SIZE32_DATA, &state_data32);
> -
> -  TPMTRYRETURN( vtpm_manager_open() );
> -  TPMTRYRETURN( vtpm_manager_command(VTPM_ORD_MIGRATE_IN,
> -                                     &out_param_buf,
> -                                     &cmd_status,
> -                                     &empty_buf) );
> -
> -  vtpm_manager_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  // ====== Call hotplug-script and resume instance ======
> -  snprintf(shell_cmd_str, shell_cmd_strlen,
> -       VTPM_SH_CMD_HDR VTPM_SH_RESUME " %d" VTPM_SH_CMD_FTR, instance);
> -  system(shell_cmd_str);
> -
> -  goto egress;
> - abort_egress:
> - egress:
> -  free(shell_cmd_str);
> -
> -  // In this case no params come back, so reuse build_error_msg even for succes.
> -  build_error_msg(result_buf, status);
> -  return;
> -}
> -
> diff --git a/tools/vtpm_manager/tcs/Makefile b/tools/vtpm_manager/tcs/Makefile
> deleted file mode 100644
> index 11af91e..0000000
> --- a/tools/vtpm_manager/tcs/Makefile
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -BIN            = libTCS.a
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIN)
> -
> -.PHONY: install
> -install: build
> -
> -.PHONY: clean
> -clean:
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIN): $(OBJS)
> -       $(AR) rcs $(BIN) $(OBJS)
> diff --git a/tools/vtpm_manager/tcs/contextmgr.c b/tools/vtpm_manager/tcs/contextmgr.c
> deleted file mode 100644
> index cf3803c..0000000
> --- a/tools/vtpm_manager/tcs/contextmgr.c
> +++ /dev/null
> @@ -1,224 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// contextmgr.c
> -//
> -//  This file contains the context management functions for TCS.
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <string.h>
> -#include <malloc.h>
> -#include "tcs.h"
> -#include "contextmgr.h"
> -#include "log.h"
> -#include "hashtable.h"
> -
> -BYTE* AddMemBlock(CONTEXT_HANDLE* pContextHandle, // in
> -                 int    BlockSize)  { // in
> -
> -  BLOCK* pCurrentBlock = NULL;
> -  BLOCK* pBlock = NULL;
> -
> -  // check incoming params
> -  if (pContextHandle == NULL || BlockSize == 0)
> -    return NULL;
> -
> -  // Create New Block
> -  pBlock = (BLOCK *)malloc(sizeof(BLOCK));
> -  if (pBlock == NULL)
> -    return (0);
> -
> -  pBlock->aMemory = (BYTE *)malloc(sizeof(BYTE) * BlockSize);
> -  if (pBlock->aMemory == NULL)
> -    return (0);
> -
> -  memset(pBlock->aMemory, 0, BlockSize);
> -  pBlock->nBlockSize = BlockSize;
> -  pBlock->pNextBlock = NULL;
> -
> -  // search for the last block created where to add the
> -  // newly created block
> -  if(pContextHandle->pTopBlock != NULL) {
> -    pCurrentBlock = pContextHandle->pTopBlock;
> -    while(pCurrentBlock->pNextBlock != NULL)
> -      pCurrentBlock = pCurrentBlock->pNextBlock;
> -
> -
> -    pCurrentBlock->pNextBlock= pBlock;
> -  } else
> -    pContextHandle->pTopBlock = pBlock;
> -
> -
> -  pContextHandle->nBlockCount++;
> -
> -  return pBlock->aMemory;
> -}
> -
> -
> -BOOL DeleteMemBlock(CONTEXT_HANDLE* pContextHandle, // in
> -                    BYTE*   pTCPA_BYTEs) { // in
> -  BLOCK* pCurrentBlock = NULL;
> -  BLOCK* pParentBlock = NULL;
> -  BOOL bFound = FALSE;
> -
> -  if (pContextHandle == NULL)
> -    return FALSE;
> -
> -
> -  // Search for the Block in the context by aMemory pointer
> -  pParentBlock = NULL;
> -  pCurrentBlock = pContextHandle->pTopBlock;
> -
> -  while(pCurrentBlock != NULL) {
> -    // If aMemory block is found, delete it
> -    if(pCurrentBlock->aMemory == pTCPA_BYTEs || pTCPA_BYTEs == NULL) {
> -      // if it is the top Block, remove it from the top,
> -      // otherwise remove it from the ParentBlock and stitch
> -      // the NextBlock to the ParentBlock
> -      if(pParentBlock == NULL)
> -       pContextHandle->pTopBlock = pContextHandle->pTopBlock->pNextBlock;
> -      else
> -       pParentBlock->pNextBlock = pCurrentBlock->pNextBlock;
> -
> -      // delete memory Block associated with pointer pTCPA_BYTEs
> -      free(pCurrentBlock->aMemory);
> -      pCurrentBlock->aMemory = NULL;
> -
> -      free(pCurrentBlock);
> -      pCurrentBlock = pParentBlock;
> -
> -      pContextHandle->nBlockCount--;
> -      bFound = TRUE;
> -    }
> -
> -    if(pCurrentBlock != NULL) {
> -      pParentBlock = pCurrentBlock;
> -      pCurrentBlock = pCurrentBlock->pNextBlock;
> -    }
> -  }
> -
> -  return bFound;
> -}
> -
> -BOOL AddHandleToList(TCS_CONTEXT_HANDLE hContext, // in
> -                    TPM_RESOURCE_TYPE type, // in
> -                    TPM_HANDLE    handle)  { // in
> -  HANDLE_LIST* pNewHandle = NULL;
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Adding Handle to list\n");
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  if (pContextHandle == NULL)
> -    return 0;
> -
> -  pNewHandle = (HANDLE_LIST *)malloc(sizeof(HANDLE_LIST));
> -
> -  if (pNewHandle == NULL)
> -    return (0);
> -
> -  pNewHandle->handle = handle;
> -  pNewHandle->type = type;
> -  pNewHandle->pNextHandle = pContextHandle->pHandleList;
> -
> -  pContextHandle->pHandleList = pNewHandle;
> -
> -  return 1;
> -}
> -
> -BOOL DeleteHandleFromList(   TCS_CONTEXT_HANDLE hContext, // in
> -                             TPM_HANDLE          handle) { // in
> -
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  HANDLE_LIST *pCurrentHandle = pContextHandle->pHandleList,
> -              *pLastHandle = pCurrentHandle;
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Deleting Handle from list\n");
> -
> -  if (pContextHandle == NULL)
> -    return 0;
> -
> -  while (1) {
> -
> -    if (pCurrentHandle->handle == handle) { // Found element
> -      if (pCurrentHandle == pLastHandle) { // First element in list
> -       pContextHandle->pHandleList = pCurrentHandle->pNextHandle;
> -       free(pCurrentHandle);
> -      } else { // Ordinary element
> -       pLastHandle->pNextHandle = pCurrentHandle->pNextHandle;
> -       free(pCurrentHandle);
> -      }
> -
> -      return 1;
> -
> -    } else { // Not found yet;
> -      pLastHandle = pCurrentHandle;
> -      pCurrentHandle = pCurrentHandle->pNextHandle;
> -      if (pCurrentHandle == NULL) // Found end of list
> -       return 0;
> -    }
> -
> -  }
> -}
> -
> -BOOL FreeHandleList(    CONTEXT_HANDLE*     pContextHandle) { // in
> -  HANDLE_LIST* pCurrentHandle;
> -  BOOL returncode = TRUE;
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Freeing all handles for context\n");
> -
> -  if (pContextHandle == NULL)
> -    return 1;
> -
> -  pCurrentHandle = pContextHandle->pHandleList;
> -  while (pCurrentHandle != NULL) {
> -
> -    switch (pCurrentHandle->type) {
> -    case TPM_RT_KEY:
> -      returncode = returncode && !TCSP_EvictKey(pContextHandle->handle, pCurrentHandle->handle);
> -      break;
> -    case TPM_RT_AUTH:
> -      returncode = returncode && !TCSP_TerminateHandle(pContextHandle->handle, pCurrentHandle->handle);
> -      break;
> -    default:
> -      returncode = FALSE;
> -    }
> -
> -    pCurrentHandle = pCurrentHandle->pNextHandle;
> -
> -  }
> -
> -  return 1;
> -}
> diff --git a/tools/vtpm_manager/tcs/contextmgr.h b/tools/vtpm_manager/tcs/contextmgr.h
> deleted file mode 100644
> index e3fdf0f..0000000
> --- a/tools/vtpm_manager/tcs/contextmgr.h
> +++ /dev/null
> @@ -1,82 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// contextmgr.c
> -//
> -//  This file contains the context management functions for TCS.
> -//
> -// ==================================================================
> -
> -#ifndef __CONTEXTMGR_H__
> -#define __CONTEXTMGR_H__
> -
> -#include "tcg.h"
> -
> -#define BLOCK_SIZE 300
> -
> -typedef struct block {
> -  int nBlockSize;
> -  BYTE* aMemory;
> -  struct block* pNextBlock;
> -} BLOCK;
> -
> -typedef struct handle_List {
> -  TPM_HANDLE handle;
> -  TPM_RESOURCE_TYPE type;
> -  struct handle_List* pNextHandle;
> -} HANDLE_LIST;
> -
> -typedef struct context_handle {
> -  TCS_CONTEXT_HANDLE handle;
> -  int nBlockCount;
> -  BLOCK* pTopBlock;
> -  HANDLE_LIST* pHandleList;
> -} CONTEXT_HANDLE;
> -
> -BYTE* AddMemBlock(  CONTEXT_HANDLE*     pContextHandle, // in
> -                    int                 BlockSize);  // in
> -
> -BOOL DeleteMemBlock(CONTEXT_HANDLE* pContextHandle, // in
> -                    BYTE*           pTCPA_BYTEs); // in
> -
> -
> -BOOL AddHandleToList(   TCS_CONTEXT_HANDLE hContext, // in
> -                        TPM_RESOURCE_TYPE   type, // in
> -                        TPM_HANDLE          handle); // in
> -
> -BOOL DeleteHandleFromList(   TCS_CONTEXT_HANDLE hContext, // in
> -                             TPM_HANDLE          handle); // in
> -
> -BOOL FreeHandleList(    CONTEXT_HANDLE*     pContextHandle); // in
> -
> -#endif //_CONTEXTMGR_H_
> diff --git a/tools/vtpm_manager/tcs/tcs.c b/tools/vtpm_manager/tcs/tcs.c
> deleted file mode 100644
> index 7c1378c..0000000
> --- a/tools/vtpm_manager/tcs/tcs.c
> +++ /dev/null
> @@ -1,1192 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tcs.c
> -//
> -//  This file contains the functions that implement a TCS.
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <string.h>
> -#include <malloc.h>
> -
> -#include "tcg.h"
> -#include "bsg.h"
> -#include "tcs.h"
> -#include "contextmgr.h"
> -#include "tpmddl.h"
> -#include "log.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -
> -// Static Global Vars for the TCS
> -static int TCS_m_nCount = 0;
> -
> -#define TCPA_MAX_BUFFER_LENGTH 0x2000
> -
> -static BYTE InBuf [TCPA_MAX_BUFFER_LENGTH];
> -static BYTE OutBuf[TCPA_MAX_BUFFER_LENGTH];
> -
> -struct hashtable *context_ht;
> -
> -// -------------------------- Hash table functions --------------------
> -
> -static unsigned int hashfunc32(void *ky) {
> -  return (* (UINT32 *) ky);
> -}
> -
> -static int equals32(void *k1, void *k2) {
> -  return (*(UINT32 *) k1 == *(UINT32 *) k2);
> -}
> -
> -CONTEXT_HANDLE *LookupContext( TCS_CONTEXT_HANDLE  hContext) {
> -  return( (CONTEXT_HANDLE *) hashtable_search(context_ht, &hContext) );
> -}
> -
> -// ---------------------------------------------------------------------------------
> -// Initialization/Uninitialization SubComponent API
> -// ---------------------------------------------------------------------------------
> -TPM_RESULT TCS_create() {
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TPM_RESULT result = TPM_FAIL;
> -
> -  if (TCS_m_nCount == 0) {
> -    vtpmloginfo(VTPM_LOG_TCS, "Constructing new TCS:\n");
> -    hRes = TDDL_Open();
> -
> -    context_ht = create_hashtable(10, hashfunc32, equals32);
> -
> -    if ((hRes == TDDL_SUCCESS) && (context_ht != NULL)) {
> -      result = TPM_SUCCESS;
> -      TCS_m_nCount++;
> -    } else {
> -      result = TPM_IOERROR;
> -      hashtable_destroy(context_ht, 1);
> -    }
> -  } else
> -    TCS_m_nCount++;
> -
> -  return(result);
> -}
> -
> -
> -void TCS_destroy()
> -{
> -  TCS_m_nCount--;
> -
> -  if (TCS_m_nCount == 0) {
> -    vtpmloginfo(VTPM_LOG_TCS, "Destructing TCS:\n");
> -    TDDL_Close();
> -
> -    struct hashtable_itr *context_itr;
> -    TCS_CONTEXT_HANDLE  *hContext;
> -
> -    // Close all the TCS contexts. TCS should evict keys based on this
> -    if (hashtable_count(context_ht) > 0) {
> -      context_itr = hashtable_iterator(context_ht);
> -      do {
> -        hContext = (TCS_CONTEXT_HANDLE *) hashtable_iterator_key(context_itr);
> -       if (TCS_CloseContext(*hContext) != TPM_SUCCESS)
> -           vtpmlogerror(VTPM_LOG_TCS, "Failed to close context %d properly.\n", *hContext);
> -
> -      } while (hashtable_iterator_advance(context_itr));
> -      free(context_itr);
> -    }
> -    hashtable_destroy(context_ht, 1);
> -  }
> -
> -}
> -
> -TPM_RESULT TCS_Malloc(  TCS_CONTEXT_HANDLE  hContext, // in
> -                        UINT32              MemSize, // in
> -                        BYTE**              ppMemPtr) {// out
> -
> -  TPM_RESULT returnCode = TPM_FAIL;
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  if (pContextHandle != NULL && ppMemPtr != NULL) {
> -    *ppMemPtr = (BYTE *)AddMemBlock(pContextHandle, MemSize);
> -    returnCode = TPM_SUCCESS;
> -  }
> -
> -  return returnCode;
> -}
> -
> -TPM_RESULT TCS_FreeMemory(  TCS_CONTEXT_HANDLE  hContext, // in
> -                            BYTE*               pMemory) { // in
> -  TPM_RESULT returnCode = TPM_FAIL;
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  if ( (pContextHandle != NULL && pMemory != NULL) &&
> -       (DeleteMemBlock(pContextHandle, pMemory) == TRUE) )
> -    returnCode = TPM_SUCCESS;
> -
> -
> -  return returnCode;
> -}
> -
> -TPM_RESULT TCS_OpenContext(TCS_CONTEXT_HANDLE* hContext) { // out
> -  TPM_RESULT returnCode = TPM_FAIL;
> -  TCS_CONTEXT_HANDLE *newContext;
> -
> -  vtpmloginfo(VTPM_LOG_TCS, "Calling TCS_OpenContext:\n");
> -
> -  if (hContext) {
> -    CONTEXT_HANDLE* pContextHandle = (CONTEXT_HANDLE *) malloc(sizeof(CONTEXT_HANDLE));
> -    if (pContextHandle == NULL)
> -      return TPM_SIZE;
> -
> -    // initialize to 0
> -    pContextHandle->nBlockCount = 0;
> -    pContextHandle->pTopBlock = NULL;
> -    pContextHandle->pHandleList = NULL;
> -
> -    // Create New Block
> -    AddMemBlock(pContextHandle, BLOCK_SIZE);
> -
> -    newContext = (TCS_CONTEXT_HANDLE *) malloc(sizeof(TCS_CONTEXT_HANDLE));
> -    *newContext = (TCS_CONTEXT_HANDLE) (((uintptr_t) pContextHandle >> 2) & 0xffffffff);
> -
> -    if (hashtable_search(context_ht, &newContext) !=NULL)
> -       *newContext += 1;
> -
> -    pContextHandle->handle = *newContext;
> -    if (!hashtable_insert(context_ht, newContext, pContextHandle)) {
> -        free(newContext);
> -        free(pContextHandle);
> -       returnCode = TPM_FAIL;
> -    } else {
> -       *hContext = *newContext;
> -       returnCode = TPM_SUCCESS;
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCS_CloseContext(TCS_CONTEXT_HANDLE hContext) {// in
> -  //FIXME: TCS SHOULD Track failed auths and make sure
> -  //we don't try and re-free them here.
> -  TPM_RESULT returnCode = TPM_FAIL;
> -
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  if(pContextHandle != NULL) {
> -    // Print test info
> -    vtpmloginfo(VTPM_LOG_TCS, "Calling TCS_CloseContext.\n");
> -
> -    // free memory for all the blocks
> -    DeleteMemBlock(pContextHandle, NULL );
> -    pContextHandle->pTopBlock = NULL;
> -
> -    FreeHandleList(pContextHandle);
> -    if (pContextHandle->pHandleList != NULL)
> -      vtpmlogerror(VTPM_LOG_TCS, "Not all handles evicted from TPM.\n");
> -
> -    // Release the TPM's resources
> -    if (hashtable_remove(context_ht, &hContext) == NULL)
> -      vtpmlogerror(VTPM_LOG_TCS, "Not all handles evicted from TPM.\n");
> -
> -    free(pContextHandle);
> -    returnCode = TPM_SUCCESS;
> -  }
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Finished closing context\n");
> -  return(returnCode);
> -}
> -
> -// ------------------------------------------------------------------
> -// Internal Functions
> -// ------------------------------------------------------------------
> -int packAuth(BYTE* dst, TCS_AUTH* auth) {
> -  // CHECK: according to the command specs, the outgoing auth params are:
> -  // nonceEven
> -  // nonceOdd
> -  // continueAuthSession
> -  // auth digest for return params
> -  //
> -  // this is a bit different than this code...
> -
> -  return BSG_PackList(dst, 4,
> -                     BSG_TYPE_UINT32, &(auth->AuthHandle),
> -                     BSG_TPM_NONCE, &(auth->NonceOdd),
> -                     BSG_TYPE_BOOL, &(auth->fContinueAuthSession),
> -                     BSG_TPM_AUTHDATA, &(auth->HMAC));
> -}
> -
> -int unpackAuth(TCS_AUTH* auth, BYTE* src) {
> -  return BSG_UnpackList(src, 3,
> -                       BSG_TPM_NONCE, &(auth->NonceEven),
> -                       BSG_TYPE_BOOL, &(auth->fContinueAuthSession),
> -                       BSG_TPM_AUTHDATA, &(auth->HMAC));
> -}
> -
> -// ------------------------------------------------------------------
> -// Authorization Commands
> -// ------------------------------------------------------------------
> -
> -TPM_RESULT TCSP_OIAP(TCS_CONTEXT_HANDLE hContext, // in
> -                    TCS_AUTHHANDLE*  authHandle, // out
> -                    TPM_NONCE*   nonce0)  // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_OIAP;
> -  UINT32 paramSize = 0;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (authHandle == NULL || nonce0 == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 3,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal);
> -
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -      == TDDL_SUCCESS) {
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList( OutBuf, 3,
> -                           BSG_TPM_TAG, &tag,
> -                           BSG_TYPE_UINT32, &paramSize,
> -                           BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Extract the remaining output parameters
> -      BSG_UnpackList(OutBuf+i, 2,
> -                    BSG_TYPE_UINT32, authHandle,
> -                    BSG_TPM_NONCE, nonce0);
> -
> -      if (!AddHandleToList(hContext, TPM_RT_AUTH, *authHandle))
> -        vtpmlogerror(VTPM_LOG_TCS, "New AuthHandle not recorded\n");
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "Failed with return code %s\n", tpm_get_error_name(returnCode));
> -
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_OSAP(TCS_CONTEXT_HANDLE hContext,  // in
> -                    TPM_ENTITY_TYPE  entityType,  // in
> -                    UINT32    entityValue, // in
> -                    TPM_NONCE   nonceOddOSAP, // in
> -                    TCS_AUTHHANDLE*  authHandle,  // out
> -                    TPM_NONCE*   nonceEven,  // out
> -                    TPM_NONCE*   nonceEvenOSAP) // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_OSAP;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (authHandle == NULL || nonceEven == NULL || nonceEvenOSAP == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 6,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT16, &entityType,
> -                         BSG_TYPE_UINT32, &entityValue,
> -                         BSG_TPM_NONCE, &nonceOddOSAP);
> -
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -            == TDDL_SUCCESS) {
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Extract the remaining output parameters
> -      BSG_UnpackList(OutBuf+i, 3,
> -                    BSG_TYPE_UINT32, authHandle,
> -                    BSG_TPM_NONCE, nonceEven,
> -                    BSG_TPM_NONCE, nonceEvenOSAP);
> -
> -      if (!AddHandleToList(hContext, TPM_RT_AUTH, *authHandle)) {
> -           vtpmlogerror(VTPM_LOG_TCS, "New AuthHandle not recorded\n");
> -      }
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "Failed with return code %s\n", tpm_get_error_name(returnCode));
> -
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_TakeOwnership(TCS_CONTEXT_HANDLE hContext,   // in
> -                             UINT16    protocolID,   // in
> -                             UINT32    encOwnerAuthSize, // in
> -                             BYTE*    encOwnerAuth,  // in
> -                             UINT32    encSrkAuthSize,  // in
> -                             BYTE*    encSrkAuth,   // in
> -                             UINT32*    SrkSize,   // in, out
> -                             BYTE**    Srk,    // in, out
> -                             TCS_AUTH*   ownerAuth)   // in, out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_TakeOwnership;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (encOwnerAuth == NULL || encSrkAuth == NULL || SrkSize == NULL || *Srk == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 5,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT16, &protocolID,
> -                         BSG_TYPE_UINT32, &encOwnerAuthSize);
> -
> -  memcpy(InBuf+InLength, encOwnerAuth, encOwnerAuthSize);
> -  InLength += encOwnerAuthSize;
> -  InLength += BSG_Pack(   BSG_TYPE_UINT32,
> -                         &encSrkAuthSize,
> -                         InBuf+InLength);
> -  memcpy(InBuf+InLength, encSrkAuth, encSrkAuthSize);
> -  InLength += encSrkAuthSize;
> -  memcpy(InBuf+InLength, *Srk, *SrkSize);
> -  InLength += *SrkSize;
> -  InLength += packAuth(InBuf+InLength, ownerAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32,
> -          &InLength,
> -          InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS){
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList( OutBuf, 3,
> -                           BSG_TPM_TAG, &tag,
> -                           BSG_TYPE_UINT32, &paramSize,
> -                           BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      TPM_KEY srkPub;
> -      i += BSG_Unpack(BSG_TPM_KEY,  OutBuf+i,  &srkPub);
> -      unpackAuth(ownerAuth, OutBuf+i);
> -
> -      // fill output params
> -      BYTE tempBuf[1024];
> -      *SrkSize = BSG_Pack(BSG_TPM_KEY,  &srkPub, tempBuf);
> -      if (TCS_Malloc(hContext, *SrkSize, Srk) == TPM_FAIL) {
> -       return(TPM_SIZE);
> -      }
> -      memcpy(*Srk, tempBuf, *SrkSize);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_TakeOwnership Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_DisablePubekRead (  TCS_CONTEXT_HANDLE hContext, // in
> -                                    TCS_AUTH*   ownerAuth) { // in, out
> -
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_DisablePubekRead;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 3,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal);
> -
> -  InLength += packAuth(InBuf+InLength, ownerAuth);
> -
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS){
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList( OutBuf, 3,
> -                           BSG_TPM_TAG, &tag,
> -                           BSG_TYPE_UINT32, &paramSize,
> -                           BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      unpackAuth(ownerAuth, OutBuf+i);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_DisablePubekRead Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_TerminateHandle(TCS_CONTEXT_HANDLE hContext, // in
> -                                TCS_AUTHHANDLE  handle)  // in
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_Terminate_Handle;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &handle);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS) {
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (!DeleteHandleFromList(hContext, handle))
> -      vtpmlogerror(VTPM_LOG_TCS, "KeyHandle not removed from list\n");
> -
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Print debug info
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_TerminateHandle Failed with return code %s\n", tpm_get_error_name(returnCode));
> -
> -  }
> -
> -  return(returnCode);
> -}
> -
> -// TPM Mandatory
> -TPM_RESULT TCSP_Extend( TCS_CONTEXT_HANDLE hContext, // in
> -                        TPM_PCRINDEX  pcrNum,  // in
> -                        TPM_DIGEST  inDigest, // in
> -                        TPM_PCRVALUE*  outDigest) // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_Extend;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 5,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &pcrNum,
> -                         BSG_TPM_DIGEST, &inDigest);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS) {
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND){
> -      // Extract the remaining output parameters
> -      BSG_Unpack(BSG_TPM_PCRVALUE, OutBuf+i, outDigest);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Extend Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_Seal(   TCS_CONTEXT_HANDLE hContext,  // in
> -                        TCS_KEY_HANDLE  keyHandle,  // in
> -                        TPM_ENCAUTH   encAuth,  // in
> -                        UINT32    pcrInfoSize, // in
> -                        BYTE*    PcrInfo,  // in
> -                        UINT32    inDataSize,  // in
> -                        BYTE*    inData,   // in
> -                        TCS_AUTH*   pubAuth,  // in, out
> -                        UINT32*    SealedDataSize, // out
> -                        BYTE**    SealedData)  // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_Seal;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (inData == NULL || pubAuth == NULL || SealedDataSize == NULL || SealedData == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 6,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &keyHandle,
> -                         BSG_TPM_ENCAUTH, encAuth,
> -                         BSG_TYPE_UINT32, &pcrInfoSize);
> -  memcpy(InBuf+InLength, PcrInfo, pcrInfoSize);
> -  InLength += pcrInfoSize;
> -  InLength += BSG_Pack(BSG_TYPE_UINT32, &inDataSize, InBuf+InLength);
> -  memcpy(InBuf+InLength, inData, inDataSize);
> -  InLength += inDataSize;
> -  InLength += packAuth(InBuf+InLength, pubAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      TPM_STORED_DATA sealedData;
> -
> -      i += BSG_Unpack(BSG_TPM_STORED_DATA, OutBuf+i, &sealedData);
> -      unpackAuth(pubAuth, OutBuf+i);
> -
> -      // fill SealedData
> -      BYTE tempBuf[1024];
> -      *SealedDataSize = BSG_Pack(BSG_TPM_STORED_DATA, &sealedData, tempBuf);
> -      if (TCS_Malloc(hContext, *SealedDataSize, SealedData) == TPM_FAIL) {
> -       return TPM_SIZE;
> -      }
> -      memcpy(*SealedData, tempBuf, *SealedDataSize);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Seal Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_Unseal(TCS_CONTEXT_HANDLE hContext,  // in
> -                      TCS_KEY_HANDLE  parentHandle, // in
> -                      UINT32    SealedDataSize, // in
> -                      BYTE*    SealedData,  // in
> -                      TCS_AUTH*   parentAuth,  // in, out
> -                      TCS_AUTH*   dataAuth,  // in, out
> -                      UINT32*   DataSize,  // out
> -                      BYTE**    Data)   // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH2_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_Unseal;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (SealedData == NULL || parentAuth == NULL || dataAuth == NULL ||
> -      DataSize == NULL || Data == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                                     BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &ordinal,
> -                          BSG_TYPE_UINT32, &parentHandle);
> -  memcpy(InBuf+InLength, SealedData, SealedDataSize);
> -  InLength += SealedDataSize;
> -  InLength += packAuth(InBuf+InLength, parentAuth);
> -  InLength += packAuth(InBuf+InLength, dataAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList( OutBuf, 3,
> -                            BSG_TPM_TAG, &tag,
> -                            BSG_TYPE_UINT32, &paramSize,
> -                            BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH2_COMMAND) {
> -      // Extract the remaining output parameters
> -      i += BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, DataSize);
> -      if (TCS_Malloc(hContext, *DataSize, Data) == TPM_FAIL) {
> -        return TPM_SIZE;
> -      }
> -      memcpy(*Data, OutBuf+i, *DataSize);
> -      i += *DataSize;
> -      i += unpackAuth(parentAuth, OutBuf+i);
> -      unpackAuth(dataAuth, OutBuf+i);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Unseal Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_UnBind(TCS_CONTEXT_HANDLE hContext,  // in
> -                      TCS_KEY_HANDLE  keyHandle,  // in
> -                      UINT32    inDataSize,  // in
> -                      BYTE*    inData,   // in
> -                      TCS_AUTH*   privAuth,  // in, out
> -                      UINT32*   outDataSize, // out
> -                      BYTE**    outData)  // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_UnBind;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (inData == NULL || privAuth == NULL || outDataSize == NULL || outData == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 5,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &keyHandle,
> -                         BSG_TYPE_UINT32, &inDataSize);
> -  memcpy(InBuf+InLength, inData, inDataSize);
> -  InLength += inDataSize;
> -  InLength += packAuth(InBuf+InLength, privAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "\n\tSending paramSize = %d", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      i += BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, outDataSize);
> -      if (TCS_Malloc(hContext, *outDataSize, outData) == TPM_FAIL)
> -        return TPM_SIZE;
> -
> -      memcpy(*outData, OutBuf+i, *outDataSize);
> -      i += *outDataSize;
> -      unpackAuth(privAuth, OutBuf+i);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_UnBind Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_CreateWrapKey(TCS_CONTEXT_HANDLE hContext,   // in
> -                             TCS_KEY_HANDLE  hWrappingKey,  // in
> -                             TPM_ENCAUTH  KeyUsageAuth,  // in
> -                             TPM_ENCAUTH  KeyMigrationAuth, // in
> -                             UINT32*    pcKeySize,   // in, out
> -                             BYTE**    prgbKey,   // in, out
> -                             TCS_AUTH*   pAuth)    // in, out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_CreateWrapKey;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (pcKeySize == NULL || *prgbKey == NULL || pAuth == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 6,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &hWrappingKey,
> -                         BSG_TPM_ENCAUTH, KeyUsageAuth,
> -                         BSG_TPM_ENCAUTH, KeyMigrationAuth);
> -  memcpy(InBuf+InLength, *prgbKey, *pcKeySize);
> -  InLength += *pcKeySize;
> -  InLength += packAuth(InBuf+InLength, pAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_RESULT, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      TPM_KEY wrappedKey;
> -
> -      i += BSG_Unpack(BSG_TPM_KEY, OutBuf+i, &wrappedKey);
> -      unpackAuth(pAuth, OutBuf+i);
> -
> -      // Fill prgbKey
> -      BYTE tempBuf[1024];
> -      *pcKeySize = BSG_Pack(BSG_TPM_KEY, &wrappedKey, tempBuf);
> -      if (TCS_Malloc(hContext, *pcKeySize, prgbKey) == TPM_FAIL)
> -        return TPM_SIZE;
> -
> -      memcpy(*prgbKey, tempBuf, *pcKeySize);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_CreateWrapKey Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_LoadKeyByBlob(TCS_CONTEXT_HANDLE hContext,    // in
> -                             TCS_KEY_HANDLE  hUnwrappingKey,   // in
> -                             UINT32    cWrappedKeyBlobSize, // in
> -                             BYTE*    rgbWrappedKeyBlob,  // in
> -                             TCS_AUTH*   pAuth,     // in, out
> -                             TCS_KEY_HANDLE*  phKeyTCSI,    // out
> -                             TCS_KEY_HANDLE*  phKeyHMAC)    // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_LoadKey;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (rgbWrappedKeyBlob == NULL || pAuth == NULL || phKeyTCSI == NULL || phKeyHMAC == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  *phKeyHMAC = hUnwrappingKey; // the parent key is the one that the TPM use to make the HMAC calc
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &hUnwrappingKey);
> -  memcpy(InBuf+InLength, rgbWrappedKeyBlob, cWrappedKeyBlobSize);
> -  InLength += cWrappedKeyBlobSize;
> -  InLength += packAuth(InBuf+InLength, pAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      i += BSG_Unpack(BSG_TYPE_UINT32,
> -                     OutBuf+i,
> -                     phKeyTCSI);
> -      unpackAuth(pAuth, OutBuf+i);
> -
> -      if (!AddHandleToList(hContext, TPM_RT_KEY, *phKeyTCSI)) {
> -        vtpmlogerror(VTPM_LOG_TCS, "New KeyHandle not recorded\n");
> -      }
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -     } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_LoadKeyByBlob Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_EvictKey(TCS_CONTEXT_HANDLE hContext, // in
> -                        TCS_KEY_HANDLE  hKey)  // in
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_EvictKey;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &hKey);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (!DeleteHandleFromList(hContext, hKey)) {
> -      vtpmlogerror(VTPM_LOG_TCS, "KeyHandle not removed from list\n");
> -    }
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else {
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_EvictKey Failed with return code %s\n", tpm_get_error_name(returnCode));
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_GetRandom(TCS_CONTEXT_HANDLE hContext,  // in
> -                         UINT32*    bytesRequested, // in, out
> -                         BYTE**    randomBytes) // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_GetRandom;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (bytesRequested == NULL || *randomBytes == NULL){
> -    return TPM_BAD_PARAMETER;
> -  }
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, bytesRequested);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Extract the remaining output parameters
> -      BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, bytesRequested);
> -      if (TCS_Malloc(hContext, *bytesRequested, randomBytes) == TPM_FAIL) {
> -        return TPM_SIZE;
> -      }
> -      memcpy(*randomBytes, OutBuf+i+sizeof(UINT32), *bytesRequested);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else {
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_GetRandom Failed with return code %s\n", tpm_get_error_name(returnCode));
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_ReadPubek(TCS_CONTEXT_HANDLE   hContext,               // in
> -                         TPM_NONCE            antiReplay,             // in
> -                         UINT32*              pubEndorsementKeySize,  // out
> -                         BYTE**               pubEndorsementKey,      // out
> -                         TPM_DIGEST*          checksum)               // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_ReadPubek;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32   OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (pubEndorsementKeySize == NULL || pubEndorsementKey == NULL || checksum == NULL) {
> -    return TPM_BAD_PARAMETER;
> -  }
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TPM_NONCE, &antiReplay);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Extract the remaining output parameters
> -      TPM_PUBKEY pubEK;
> -      i += BSG_UnpackList(OutBuf+i, 2,
> -                         BSG_TPM_PUBKEY, &pubEK,
> -                         BSG_TPM_DIGEST, checksum);
> -
> -      // fill EndorsementKey
> -      BYTE tempBuf[1024];
> -      *pubEndorsementKeySize = BSG_Pack(BSG_TPM_PUBKEY, &pubEK, tempBuf);
> -      if (TCS_Malloc(hContext, *pubEndorsementKeySize, pubEndorsementKey) == TPM_FAIL) {
> -        return TPM_SIZE;
> -      }
> -      memcpy(*pubEndorsementKey, tempBuf, *pubEndorsementKeySize);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else {
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_ReadPubek Failed with return code %s\n", tpm_get_error_name(returnCode));
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_SaveState(TCS_CONTEXT_HANDLE   hContext)  // in
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_SaveState;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &ordinal);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    BSG_UnpackList(OutBuf, 3,
> -                           BSG_TPM_TAG, &tag,
> -                           BSG_TYPE_UINT32, &paramSize,
> -                           BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else {
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_SaveState Failed with return code %s\n", tpm_get_error_name(returnCode));
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_RawTransmitData(   UINT32 inDataSize,  // in
> -                                  BYTE *inData,       // in
> -                                  UINT32 *outDataSize,// in/out
> -                                  BYTE *outData) {    // out
> -
> -  TDDL_RESULT hRes;
> -
> -  vtpmloginfo(VTPM_LOG_TCS, "Calling TransmitData directly.\n");
> -  //FIXME: Add Context Management
> -  hRes = TDDL_TransmitData( inData,
> -                           inDataSize,
> -                           outData,
> -                           outDataSize);
> -
> -  if (hRes == TDDL_SUCCESS) {
> -    return TPM_SUCCESS;
> -  } else {
> -    vtpmlogerror(VTPM_LOG_TCS, "TCSP_RawTransmitData Failed with return code %s\n", tpm_get_error_name(TPM_IOERROR));
> -    return TPM_IOERROR;
> -  }
> -
> -}
> diff --git a/tools/vtpm_manager/tcs/tcs.h b/tools/vtpm_manager/tcs/tcs.h
> deleted file mode 100644
> index 83b9cd0..0000000
> --- a/tools/vtpm_manager/tcs/tcs.h
> +++ /dev/null
> @@ -1,245 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tcs.h
> -//
> -//  This file declares the TCS API
> -//
> -// ==================================================================
> -
> -#ifndef __TCS_H__
> -#define __TCS_H__
> -
> -#include "tcg.h"
> -#include "contextmgr.h"
> -#include "buffer.h"
> -
> -#define HANDLE_NULL 0
> -
> -// ------------------------------------------------------------------
> -// Exposed API
> -// ------------------------------------------------------------------
> -
> -TPM_RESULT TCS_create();
> -void TCS_destroy();
> -
> -TPM_RESULT TCS_OpenContext( /* OUT */ TCS_CONTEXT_HANDLE* hContext );
> -
> -TPM_RESULT TCS_CloseContext ( /* IN */ TCS_CONTEXT_HANDLE hContext );
> -
> -TPM_RESULT TCS_Malloc ( TCS_CONTEXT_HANDLE hContext, // in
> -                       UINT32   MemSize, // in
> -                       BYTE**   ppMemPtr ); //out
> -
> -TPM_RESULT TCS_FreeMemory ( TCS_CONTEXT_HANDLE hContext, // in
> -                           BYTE*    pMemory);  // in
> -
> -// ------------------------------------------------------------------
> -// Exposed API
> -// ------------------------------------------------------------------
> -
> -// TPM v1.1B Command Set
> -
> -// Authorzation
> -TPM_RESULT TCSP_OIAP( TCS_CONTEXT_HANDLE hContext, // in
> -                     TCS_AUTHHANDLE*  authHandle, // out
> -                     TPM_NONCE*   nonce0  // out
> -                     );
> -
> -TPM_RESULT TCSP_OSAP (  TCS_CONTEXT_HANDLE hContext,  // in
> -                       TPM_ENTITY_TYPE entityType,  // in
> -                       UINT32    entityValue, // in
> -                       TPM_NONCE   nonceOddOSAP, // in
> -                       TCS_AUTHHANDLE*  authHandle,  // out
> -                       TPM_NONCE*   nonceEven,  // out
> -                       TPM_NONCE*   nonceEvenOSAP // out
> -                       );
> -
> -TPM_RESULT TCSP_TakeOwnership (  TCS_CONTEXT_HANDLE hContext,   // in
> -                                UINT16    protocolID,   // in
> -                                UINT32    encOwnerAuthSize, // in
> -                                BYTE*    encOwnerAuth,  // in
> -                                UINT32    encSrkAuthSize,  // in
> -                                BYTE*    encSrkAuth,   // in
> -                                UINT32*    SrkSize,   // in, out
> -                                BYTE**    Srk,    // in, out
> -                                TCS_AUTH*   ownerAuth   // in, out
> -                                );
> -
> -TPM_RESULT TCSP_DisablePubekRead (  TCS_CONTEXT_HANDLE hContext, // in
> -                                    TCS_AUTH*   ownerAuth // in, out
> -                                    );
> -
> -TPM_RESULT TCSP_TerminateHandle (  TCS_CONTEXT_HANDLE hContext, // in
> -                                  TCS_AUTHHANDLE  handle  // in
> -                                  );
> -
> -TPM_RESULT TCSP_FlushSpecific (  TCS_CONTEXT_HANDLE hContext, // in
> -                                TCS_AUTHHANDLE  handle,  // in
> -                                TPM_RESOURCE_TYPE resourceType //in
> -                                );
> -
> -// TPM Mandatory
> -TPM_RESULT TCSP_Extend (  TCS_CONTEXT_HANDLE hContext, // in
> -                         TPM_PCRINDEX  pcrNum,  // in
> -                         TPM_DIGEST   inDigest, // in
> -                         TPM_PCRVALUE*   outDigest // out
> -                         );
> -
> -TPM_RESULT TCSP_PcrRead (  TCS_CONTEXT_HANDLE hContext, // in
> -                          TPM_PCRINDEX  pcrNum,  // in
> -                          TPM_PCRVALUE*  outDigest // out
> -                          );
> -
> -TPM_RESULT TCSP_Quote (  TCS_CONTEXT_HANDLE hContext,  // in
> -                        TCS_KEY_HANDLE  keyHandle,  // in
> -                        TPM_NONCE   antiReplay,  // in
> -                        UINT32*    PcrDataSize, // in, out
> -                        BYTE**    PcrData,  // in, out
> -                        TCS_AUTH*   privAuth,  // in, out
> -                        UINT32*    sigSize,  // out
> -                        BYTE**    sig    // out
> -                        );
> -
> -TPM_RESULT TCSP_Seal (  TCS_CONTEXT_HANDLE hContext,  // in
> -                       TCS_KEY_HANDLE  keyHandle,  // in
> -                       TPM_ENCAUTH  encAuth,  // in
> -                       UINT32    pcrInfoSize, // in
> -                       BYTE*    PcrInfo,  // in
> -                       UINT32    inDataSize,  // in
> -                       BYTE*    inData,   // in
> -                       TCS_AUTH*   pubAuth,  // in, out
> -                       UINT32*    SealedDataSize, // out
> -                       BYTE**    SealedData  // out
> -                       );
> -
> -TPM_RESULT TCSP_Unseal (  TCS_CONTEXT_HANDLE hContext,  // in
> -                         TCS_KEY_HANDLE  parentHandle, // in
> -                         UINT32    SealedDataSize, // in
> -                         BYTE*    SealedData,  // in
> -                         TCS_AUTH*   parentAuth,  // in, out
> -                         TCS_AUTH*   dataAuth,  // in, out
> -                         UINT32*    DataSize,  // out
> -                         BYTE**    Data   // out
> -                         );
> -
> -TPM_RESULT TCSP_DirWriteAuth (  TCS_CONTEXT_HANDLE hContext,  // in
> -                               TPM_DIRINDEX  dirIndex,  // in
> -                               TPM_DIRVALUE  newContents, // in
> -                               TCS_AUTH*   ownerAuth  // in, out
> -                               );
> -
> -TPM_RESULT TCSP_DirRead (  TCS_CONTEXT_HANDLE hContext, // in
> -                          TPM_DIRINDEX  dirIndex, // in
> -                          TPM_DIRVALUE*  dirValue // out
> -                          );
> -
> -TPM_RESULT TCSP_UnBind (  TCS_CONTEXT_HANDLE hContext,  // in
> -                         TCS_KEY_HANDLE  keyHandle,  // in
> -                         UINT32    inDataSize,  // in
> -                         BYTE*    inData,   // in
> -                         TCS_AUTH*   privAuth,  // in, out
> -                         UINT32*    outDataSize, // out
> -                         BYTE**    outData   // out
> -                         );
> -
> -TPM_RESULT TCSP_CreateWrapKey (  TCS_CONTEXT_HANDLE hContext,   // in
> -                                TCS_KEY_HANDLE  hWrappingKey,  // in
> -                                TPM_ENCAUTH  KeyUsageAuth,  // in
> -                                TPM_ENCAUTH  KeyMigrationAuth, // in
> -                                UINT32*    pcKeySize,   // in, out
> -                                BYTE**    prgbKey,   // in, out
> -                                TCS_AUTH*   pAuth    // in, out
> -                                );
> -
> -TPM_RESULT TCSP_LoadKeyByBlob (  TCS_CONTEXT_HANDLE hContext,    // in
> -                                TCS_KEY_HANDLE  hUnwrappingKey,   // in
> -                                UINT32    cWrappedKeyBlobSize, // in
> -                                BYTE*    rgbWrappedKeyBlob,  // in
> -                                TCS_AUTH*   pAuth,     // in, out
> -                                TCS_KEY_HANDLE*  phKeyTCSI,    // out
> -                                TCS_KEY_HANDLE*  phKeyHMAC    // out
> -                                );
> -
> -TPM_RESULT TCSP_GetPubKey (  TCS_CONTEXT_HANDLE hContext,  // in
> -                            TCS_KEY_HANDLE  hKey,   // in
> -                            TCS_AUTH*   pAuth,   // in, out
> -                            UINT32*    pcPubKeySize, // out
> -                            BYTE**    prgbPubKey  // out
> -                            );
> -
> -TPM_RESULT TCSP_EvictKey (  TCS_CONTEXT_HANDLE hContext, // in
> -                           TCS_KEY_HANDLE  hKey  // in
> -                           );
> -
> -TPM_RESULT TCSP_Sign (  TCS_CONTEXT_HANDLE hContext,  // in
> -                       TCS_KEY_HANDLE  keyHandle,  // in
> -                       UINT32    areaToSignSize, // in
> -                       BYTE*    areaToSign,  // in
> -                       TCS_AUTH*   privAuth,  // in, out
> -                       UINT32*    sigSize,  // out
> -                       BYTE**    sig    // out
> -                       );
> -
> -TPM_RESULT TCSP_GetRandom (  TCS_CONTEXT_HANDLE hContext,  // in
> -                            UINT32*    bytesRequested, // in, out
> -                            BYTE**    randomBytes  // out
> -                            );
> -
> -TPM_RESULT TCSP_StirRandom (  TCS_CONTEXT_HANDLE hContext, // in
> -                             UINT32    inDataSize, // in
> -                             BYTE*    inData  // in
> -                             );
> -
> -TPM_RESULT TCSP_ReadPubek (  TCS_CONTEXT_HANDLE hContext,    // in
> -                            TPM_NONCE   antiReplay,    // in
> -                            UINT32*    pubEndorsementKeySize, // out
> -                            BYTE**    pubEndorsementKey,  // out
> -                            TPM_DIGEST*  checksum    // out
> -                            );
> -
> -
> -// Non-Standard TCSP calls
> -TPM_RESULT TCSP_SaveState(TCS_CONTEXT_HANDLE   hContext);  // in
> -
> -//Give direct access to TransmitData.
> -// Key and Auth Management is done before transfering command to TDDL.
> -TPM_RESULT TCSP_RawTransmitData(UINT32 inDataSize,  // in
> -                               BYTE *inData,       // in
> -                               UINT32 *outDataSize,// in/out
> -                               BYTE *outData);     // out
> -
> -///////////// Private Functions ////////////////////
> -CONTEXT_HANDLE* LookupContext( TCS_CONTEXT_HANDLE hContext);
> -
> -#endif //TCS_H
> diff --git a/tools/vtpm_manager/tcs/tpmddl.h b/tools/vtpm_manager/tcs/tpmddl.h
> deleted file mode 100644
> index e7e54f1..0000000
> --- a/tools/vtpm_manager/tcs/tpmddl.h
> +++ /dev/null
> @@ -1,69 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tpmddl.c
> -//
> -//  This file defines the TDDLI API
> -//
> -// ==================================================================
> -
> -#ifndef __TPMDDL_H__
> -#define __TPMDDL_H__
> -
> -#define TDDL_CAP_PROP_MANUFACTURER 0x0001
> -
> -#define TDDL_E_FAIL 1
> -#define TDDL_E_SUCCESS 0
> -#define TDDL_SUCCESS 0
> -
> -typedef unsigned int TDDL_UINT32;
> -typedef TDDL_UINT32 TDDL_RESULT;
> -typedef unsigned char TDDL_BYTE;
> -
> -TDDL_RESULT TDDL_Open();
> -void TDDL_Close();
> -TDDL_RESULT TDDL_TransmitData( TDDL_BYTE* in,
> -                              TDDL_UINT32 insize,
> -                              TDDL_BYTE* out,
> -                              TDDL_UINT32* outsize);
> -TDDL_RESULT TDDL_GetStatus();
> -TDDL_RESULT TDDL_GetCapability( TDDL_UINT32 cap,
> -                               TDDL_UINT32 sub,
> -                               TDDL_BYTE* buffer,
> -                               TDDL_UINT32* size);
> -TDDL_RESULT TDDL_SetCapability( TDDL_UINT32 cap,
> -                               TDDL_UINT32 sub,
> -                               TDDL_BYTE* buffer,
> -                               TDDL_UINT32* size);
> -
> -#endif // __TPMDDL_H__
> diff --git a/tools/vtpm_manager/tcs/transmit.c b/tools/vtpm_manager/tcs/transmit.c
> deleted file mode 100644
> index 74bbdca..0000000
> --- a/tools/vtpm_manager/tcs/transmit.c
> +++ /dev/null
> @@ -1,147 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <unistd.h>
> -#include <stdio.h>
> -#include <errno.h>
> -#include <fcntl.h>
> -
> -#include "tcg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "tpmddl.h"
> -
> -// flag to track whether TDDL has been opened
> -static int g_TDDL_open = 0;
> -static int g_tx_fd = -1;              // the fd to the TPM
> -
> -#ifndef DUMMY_TPM
> - #define TPM_TX_FNAME "/dev/tpm0"
> - static int *g_rx_fdp = &g_tx_fd;
> -#else
> - #define TPM_TX_FNAME "/var/tpm/tpm_in.fifo"
> - #define TPM_RX_FNAME "/var/tpm/tpm_out.fifo"
> - static int g_rx_fd = -1;
> - static int *g_rx_fdp = &g_rx_fd;              // the fd to the TPM
> -#endif
> -
> -TPM_RESULT
> -TDDL_TransmitData( TDDL_BYTE* in,
> -                  TDDL_UINT32 insize,
> -                  TDDL_BYTE* out,
> -                  TDDL_UINT32* outsize) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TDDL_UINT32 i;
> -
> -  vtpmloginfo(VTPM_LOG_TXDATA, "Sending buffer = 0x");
> -  for(i = 0 ; i < insize ; i++)
> -    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", in[i]);
> -
> -  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> -
> -  ssize_t size = 0;
> -
> -  // send the request
> -  size = write (g_tx_fd, in, insize);
> -  if (size < 0) {
> -    vtpmlogerror(VTPM_LOG_TXDATA, "write() failed");
> -    ERRORDIE (TPM_IOERROR);
> -  }
> -  else if ((TDDL_UINT32) size < insize) {
> -    vtpmlogerror(VTPM_LOG_TXDATA, "Wrote %d instead of %d bytes!\n", (int) size, insize);
> -    // ... ?
> -  }
> -
> -  // read the response
> -  size = read (*g_rx_fdp, out, TCPA_MAX_BUFFER_LENGTH);
> -  if (size < 0) {
> -    vtpmlogerror(VTPM_LOG_TXDATA, "read() failed");
> -    ERRORDIE (TPM_IOERROR);
> -  }
> -
> -  vtpmloginfo(VTPM_LOG_TXDATA, "Receiving buffer = 0x");
> -  for(i = 0 ; i < size ; i++)
> -    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out[i]);
> -
> -  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> -
> -  *outsize = size;
> -  // close connection
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -  return status;
> -}
> -
> -TPM_RESULT TDDL_Open() {
> -
> -  TDDL_RESULT status = TDDL_SUCCESS;
> -
> -  if (g_TDDL_open)
> -    return TPM_FAIL;
> -
> -#ifdef DUMMY_TPM
> -  *g_rx_fdp = open (TPM_RX_FNAME, O_RDWR);
> -#endif
> -
> -  g_tx_fd = open (TPM_TX_FNAME, O_RDWR);
> -  if (g_tx_fd < 0) {
> -    vtpmlogerror(VTPM_LOG_TXDATA, "TPM open failed");
> -    return TPM_IOERROR;
> -  }
> -
> -  g_TDDL_open = 1;
> -
> -  return status;
> -}
> -
> -void TDDL_Close() {
> -  if (! g_TDDL_open)
> -        return;
> -
> -  if (g_tx_fd>= 0) {
> -    if (close(g_tx_fd) < 0)
> -      vtpmlogerror(VTPM_LOG_TXDATA, "closeing tpm failed");
> -    g_tx_fd = -1;
> -  }
> -
> -  if (*g_rx_fdp>= 0) {
> -    if (close(*g_rx_fdp) < 0)
> -      vtpmlogerror(VTPM_LOG_TXDATA, "closeing tpm failed");
> -    *g_rx_fdp = -1;
> -  }
> -
> -  g_TDDL_open = 0;
> -
> -}
> diff --git a/tools/vtpm_manager/util/Makefile b/tools/vtpm_manager/util/Makefile
> deleted file mode 100644
> index 36bc38f..0000000
> --- a/tools/vtpm_manager/util/Makefile
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -BIN            = libTCGUtils.a
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIN)
> -
> -.PHONY: install
> -install: build
> -
> -.PHONY: clean
> -clean:
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIN): $(OBJS)
> -       $(AR) rcs $(BIN) $(OBJS)
> diff --git a/tools/vtpm_manager/util/bsg.c b/tools/vtpm_manager/util/bsg.c
> deleted file mode 100644
> index fa36ce7..0000000
> --- a/tools/vtpm_manager/util/bsg.c
> +++ /dev/null
> @@ -1,829 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// bsg.cpp
> -//
> -//  This file will handle all the TPM Byte Stream functions
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <string.h>
> -#include <stdarg.h>
> -#include <malloc.h>
> -#include "tcg.h"
> -#include "crypto.h"
> -#include "bsg.h"
> -#include "log.h"
> -
> -static int g_log_recursion_level = 0;
> -
> -// a largest buffer size. if we get a buf size bigger than this when unpacking,
> -// will complain!
> -#define BSG_MAX_BUF_SIZE (1<<18)
> -
> -#define bsglog(fmt, ...) do { \
> -    int __i; \
> -    for (__i=0; __i < g_log_recursion_level; __i++) {               \
> -      vtpmloginfomore (VTPM_LOG_BSG, "%s", "  ");                           \
> -    }                                                                 \
> -    vtpmloginfomore (VTPM_LOG_BSG, fmt, __VA_ARGS__);                         \
> -  } while (0)
> -
> -
> -// FIXME:  trigger the selfcheck--need to use glibc hook to do this
> -//BOOL dummy1 = BSG_static_selfcheck();
> -
> -
> -// Interpretting Types
> -// -------------------
> -//
> -// Incoming Types are composed of two parts {format, info} squished into a
> -// BSG_UINT32.  The first 4 bits is a format spec indicating what type of
> -// data it is.  If the first 4 bits are zero the info corresponds to a value in
> -// BSG_s_fmt[]. This is a structure whose composition is described in
> -// BSG_s_fmt[]. If the value is non-zero, info corresponds to the size of the
> -// data (in bytes) being passed in. For example a UINT32 being passed in would
> -// have a format of (__FMT_CONST | 4). If both, the format and info are zero,
> -// this is interpretted as the end of the structure, and the result is returned.
> -
> -// these flags are mutually exclusive, so I'll just make them
> -// format values which indicate the semantics of the 'info' part and the source
> -// data. The above description has been accordingly adjusted.
> -
> -// format values for determining what type of data the incoming type is
> -// it's a 4 bit value, occupying the high 4 bits
> -#define __FMT_CONST (1UL << 28) // Constant sized value
> -#define __FMT_DATA  (2UL << 28) // Believed to be raw data NOT {size,data}
> -#define __FMT_SIZE  (3UL << 28) // A size. Used in FMT_SIZE??_DATA.
> -#define __FMT_HSIZE (4UL << 28) // A number of handles
> -#define __FMT_PACKED (5UL << 28) // 'info' is unused; the source data consists
> -                                 // of {size32, data} but we're to pack only the
> -                                 // data as that is already packed, and so
> -                                 // can/must be unpacked without
> -                                 // explicitly reading it size
> -
> -#define __FMT_MASK  0x0FFFFFFFUL // this masks out the 4-bit format
> -#define __FMT_MASK_SIZE(type)   ((type) & __FMT_MASK)
> -#define __FMT_MASK_FORMAT(type) ((type) & (~__FMT_MASK))
> -
> -// constant (8/16/32-bits)
> -#define FMT_U8 (__FMT_CONST | 1UL)
> -#define FMT_U16 (__FMT_CONST | 2UL)
> -#define FMT_U32 (__FMT_CONST | 4UL)
> -
> -// const with a compiler-computed size
> -#define FMT_SIZEOF(type) (__FMT_CONST | sizeof(type))
> -
> -// other data (size bytes)
> -// Used primarily for DIGESTS -> FMT_DATA(20)
> -#define FMT_DATA(size) (__FMT_DATA | ((BSG_UINT32) (size) & __FMT_MASK))
> -
> -// 16/32-bit size followed by N bytes of data
> -#define FMT_SIZE16_DATA (__FMT_SIZE | 2UL)
> -#define FMT_SIZE32_DATA (__FMT_SIZE | 4UL)
> -
> -// 16-bit size followed by N key handles
> -#define FMT_SIZE16_HANDLES (__FMT_HSIZE | 2UL)
> -
> -#define DIGEST_SIZE 20
> -typedef BSG_UINT32 BSG_HANDLE;
> -
> -// TCPA_AUTH has 11 fields!
> -#define MAX_FIELDS 11
> -typedef struct BSG_Format
> -{
> -  BSG_Type type;
> -  const char* name;
> -  BSG_UINT32 fields[MAX_FIELDS + 1];
> -} BSG_Format;
> -
> -/*
> - * TCPA structure data formats
> - */
> -// this has to be manually kept in sync with the
> -// Type enum!! the static_selfcheck() function should be used regularly!
> -static BSG_Format s_fmt[] =
> -{
> -  {BSG_TYPE_UINT32, "BSG_TYPE_UINT32", {FMT_U32, 0}},
> -  {BSG_TYPE_UINT16, "BSG_TYPE_UINT16", {FMT_U16, 0}},
> -  {BSG_TYPE_BYTE, "BSG_TYPE_BYTE", {FMT_U8, 0}},
> -  {BSG_TYPE_BOOL, "BSG_TYPE_BOOL", {FMT_U8, 0}},
> -  {BSG_TPM_SIZE32_DATA, "BSG_TPM_SIZE32_DATA", {FMT_SIZE32_DATA, 0}},
> -  {BSG_TPM_TAG, "BSG_TPM_TAG", {FMT_SIZEOF(TPM_TAG), 0}},
> -  {BSG_TPM_HANDLE, "BSG_TPM_HANDLE", {FMT_SIZEOF(TPM_HANDLE), 0}},
> -  {BSG_TPM_RESULT, "BSG_TPM_RESULT", {FMT_SIZEOF(TPM_RESULT), 0}},
> -  {BSG_TPM_RESOURCE_TYPE, "BSG_TPM_RESOURCE_TYPE", {FMT_SIZEOF(TPM_RESOURCE_TYPE), 0}},
> -  {BSG_TPM_COMMAND_CODE, "BSG_TPM_COMMAND_CODE", {FMT_U32, 0}},
> -  {BSG_TPM_AUTH_DATA_USAGE, "BSG_TPM_AUTH_DATA_USAGE", {FMT_U8, 0}},
> -  {BSG_TPM_ALGORITHM_ID, "BSG_TPM_ALGORITHM_ID", {FMT_U32, 0}},
> -  {BSG_TPM_PROTOCOL_ID, "BSG_TPM_PROTOCOL_ID", {FMT_SIZEOF(TPM_PROTOCOL_ID), 0}},
> -  {BSG_TPM_KEY_USAGE, "BSG_TPM_KEY_USAGE", {FMT_U16, 0}},
> -  {BSG_TPM_ENC_SCHEME, "BSG_TPM_ENC_SCHEME", {FMT_U16, 0}},
> -  {BSG_TPM_SIG_SCHEME, "BSG_TPM_SIG_SCHEME", {FMT_U16, 0}},
> -  {BSG_TPM_MIGRATE_SCHEME, "BSG_TPM_MIGRATE_SCHEME", {FMT_U16, 0}},
> -  {BSG_TPM_KEY_FLAGS, "BSG_TPM_KEY_FLAGS", {FMT_U32, 0}},
> -
> -  {BSG_TPM_AUTHDATA, "BSG_TPM_AUTHDATA", {FMT_DATA(DIGEST_SIZE), 0}},
> -  {BSG_TPM_SECRET, "BSG_TPM_SECRET", {BSG_TPM_AUTHDATA, 0}},
> -  {BSG_TPM_ENCAUTH, "BSG_TPM_ENCAUTH", {BSG_TPM_AUTHDATA, 0}},
> -  {BSG_TPM_PAYLOAD_TYPE, "BSG_TPM_PAYLOAD_TYPE", {FMT_SIZEOF(TPM_PAYLOAD_TYPE), 0}},
> -
> -  {BSG_TPM_VERSION, "BSG_TPM_VERSION", {FMT_DATA(4), 0}}, // vers 1.2
> -  {BSG_TPM_DIGEST, "BSG_TPM_DIGEST", {FMT_DATA(DIGEST_SIZE), 0}},
> -  {BSG_TPM_COMPOSITE_HASH, "BSG_TPM_COMPOSITE_HASH", {BSG_TPM_DIGEST, 0}},
> -  {BSG_TPM_CHOSENID_HASH, "BSG_TPM_CHOSENID_HASH", {BSG_TPM_DIGEST, 0}},
> -
> -  {BSG_TPM_NONCE, "BSG_TPM_NONCE", {FMT_DATA(DIGEST_SIZE), 0}},
> -  {BSG_TPM_KEY_HANDLE, "BSG_TPM_KEY_HANDLE", {FMT_SIZEOF(TPM_KEY_HANDLE), 0}},
> -  {BSG_TPM_KEY_HANDLE_LIST, "BSG_TPM_KEY_HANDLE_LIST",
> -   {FMT_SIZE16_HANDLES, 0}},
> -
> -  {BSG_TPM_KEY_PARMS, "BSG_TPM_KEY_PARMS", {
> -      BSG_TPM_ALGORITHM_ID,
> -      BSG_TPM_ENC_SCHEME,
> -      BSG_TPM_SIG_SCHEME,
> -      FMT_SIZE32_DATA,
> -      0}},
> -  {BSG_TPM_RSA_KEY_PARMS, "BSG_TPM_RSA_KEY_PARMS", {
> -      FMT_U32, FMT_U32, FMT_SIZE32_DATA, 0}},
> -  {BSG_TPM_STORE_PUBKEY, "BSG_TPM_STORE_PUBKEY", {FMT_SIZE32_DATA, 0}},
> -  {BSG_TPM_PUBKEY, "BSG_TPM_PUBKEY", {BSG_TPM_KEY_PARMS, BSG_TPM_STORE_PUBKEY, 0}},
> -  {BSG_TPM_KEY, "BSG_TPM_KEY", {
> -      BSG_TPM_VERSION,
> -      BSG_TPM_KEY_USAGE,
> -      BSG_TPM_KEY_FLAGS,
> -      BSG_TPM_AUTH_DATA_USAGE,
> -      BSG_TPM_KEY_PARMS,
> -      FMT_SIZE32_DATA,        // the PCR_INFO
> -      BSG_TPM_STORE_PUBKEY,
> -      FMT_SIZE32_DATA,        // the encrypted part
> -      0}},
> -
> -  {BSG_TPM_MIGRATIONKEYAUTH, "BSG_TPM_MIGRATIONKEYAUTH", {
> -      BSG_TPM_PUBKEY,
> -      BSG_TPM_MIGRATE_SCHEME,
> -      BSG_TPM_DIGEST, 0}},
> -
> -  {BSG_TCPA_AUDIT_EVENT, "TCPA_AUDIT_EVENT", {
> -      BSG_TPM_COMMAND_CODE,
> -      BSG_TPM_RESULT, 0 }},
> -
> -  {BSG_TCPA_EVENT_CERT, "TCPA_EVENT_CERT", {
> -      BSG_TPM_DIGEST,
> -      BSG_TPM_DIGEST,
> -      FMT_DATA(2),
> -      FMT_SIZE32_DATA, 0}},
> -
> -  {BSG_TPM_PCR_SELECTION, "BSG_TPM_PCR_SELECTION", {FMT_SIZE16_DATA, 0} },
> -  {BSG_TPM_PCR_COMPOSITE, "BSG_TPM_PCR_COMPOSITE", { BSG_TPM_PCR_SELECTION,
> -                                                    FMT_SIZE32_DATA,
> -                                                    0} },
> -
> -  {BSG_TPM_PCR_INFO, "BSG_TPM_PCR_INFO", { BSG_TPM_PCR_SELECTION,
> -                                          BSG_TPM_COMPOSITE_HASH,
> -                                          BSG_TPM_COMPOSITE_HASH,
> -                                          0} },
> -
> -
> -  {BSG_TPM_STORED_DATA, "BSG_TPM_STORED_DATA", {
> -      BSG_TPM_VERSION,
> -      FMT_SIZE32_DATA,
> -      FMT_SIZE32_DATA,
> -      0}},
> -  {BSG_TPM_SYMMETRIC_KEY, "BSG_TPM_SYMMETRIC_KEY", {
> -      BSG_TPM_ALGORITHM_ID,
> -      BSG_TPM_ENC_SCHEME,
> -      FMT_SIZE16_DATA,
> -      0}},
> -  {BSG_TPM_STORE_PRIVKEY, "BSG_TPM_STORE_PRIVKEY", {FMT_SIZE32_DATA, 0}},
> -  {BSG_TPM_STORE_ASYMKEY, "BSG_TPM_STORE_ASYMKEY", {
> -      BSG_TPM_PAYLOAD_TYPE,
> -      BSG_TPM_SECRET,
> -      BSG_TPM_SECRET,
> -      BSG_TPM_DIGEST,
> -      BSG_TPM_STORE_PRIVKEY,
> -      0}},
> -  {BSG_TPM_MIGRATE_ASYMKEY, "BSG_TPM_MIGRATE_ASYMKEY", {
> -      BSG_TPM_PAYLOAD_TYPE,
> -      BSG_TPM_SECRET,
> -      BSG_TPM_DIGEST,
> -      FMT_U32,
> -      BSG_TPM_STORE_PRIVKEY,
> -      0}},
> -
> -  {BSG_TPM_QUOTE_INFO, "BSG_TPM_QUOTE_INFO", {
> -      BSG_TPM_VERSION,
> -      FMT_DATA(4),
> -      BSG_TPM_COMPOSITE_HASH,
> -      BSG_TPM_NONCE,
> -      0}},
> -
> -  {BSG_TPM_IDENTITY_CONTENTS, "BSG_TPM_IDENTITY_CONTENTS", {
> -      BSG_TPM_VERSION,
> -      FMT_U32,
> -      BSG_TPM_CHOSENID_HASH,
> -      BSG_TPM_PUBKEY,
> -      0}},
> -
> -  {BSG_TPM_PCRVALUE, "BSG_TPM_PCRVALUE", {FMT_DATA(DIGEST_SIZE), 0}},
> -
> -  {BSG_TCPA_PCR_FLAGS, "TCPA_PCR_FLAGS", {
> -      FMT_U8,
> -      FMT_U8,
> -      0}},
> -
> -  {BSG_TCS_AUTH, "TCS_AUTH", {
> -      BSG_TYPE_UINT32,
> -      BSG_TPM_NONCE,
> -      BSG_TPM_NONCE,
> -      BSG_TYPE_BOOL,
> -      BSG_TPM_AUTHDATA,
> -      0}},
> -
> -  {BSG_TPM_KEY_NONSENSITIVE, "BSG_TPM_KEY_NONSENSITIVE", {
> -      BSG_TPM_VERSION,
> -      BSG_TPM_KEY_USAGE,
> -      BSG_TPM_KEY_FLAGS,
> -      BSG_TPM_AUTH_DATA_USAGE,
> -      BSG_TPM_KEY_PARMS,
> -      FMT_SIZE32_DATA,
> -      BSG_TPM_STORE_PUBKEY,
> -      0}},
> -
> -  {BSG_PACKED, "BSG_PACKED", {
> -      __FMT_PACKED,
> -      0 }},
> -
> -  {BSG_TYPE_MAX, "", {0}},
> -};
> -
> -
> -static const BSG_Format* find_format (BSG_Type t) {
> -  BSG_Format * f = s_fmt;
> -
> -  if (t >= BSG_TYPE_MAX) {
> -    return NULL;
> -  }
> -
> -  // WARNING: this depends on the enum and s_fmt[] array being in sync! make
> -  // sure to run the static_selfcheck() to make sure
> -  f = s_fmt + (t - BSG_TYPE_FIRST);
> -
> -  return f;
> -}
> -
> -//
> -// a consistency-checking routine which can be run at compile time
> -// (ie. immediately after compilation)
> -//
> -// tasks:
> -// - verify that s_fmt has one entry per Type t, and that entry is at s_fmt[t]
> -//
> -// conditions:
> -// - need that s_fmt[0] is the first type listed in the Type enum! ie the first
> -//   Type has value 0, not 1
> -//
> -// FIXME: should have a function be passed in here which is called if the test
> -// fails. Then the caller can decide what to do: abort, notify, whatever
> -//
> -BOOL BSG_static_selfcheck ()
> -{
> -  int i;
> -
> -  for (i=BSG_TYPE_FIRST; i <= BSG_TYPE_MAX; i++) {
> -    if (s_fmt[i - BSG_TYPE_FIRST].type != i) {
> -      bsglog ("%s\n", "BSG: static_selfcheck failed!\n");
> -      bsglog ("failure at %i, allegedly %s\n",
> -             i, s_fmt[i - BSG_TYPE_FIRST].name);
> -      abort();
> -      return FALSE;
> -    }
> -  }
> -
> -  bsglog ("%s\n", "BSG: static_selfcheck success!");
> -  return TRUE;
> -}
> -
> -
> -/**
> - * Flatten a TCPA structure into a buffer in big-endian format
> - * @type: TCPA structure type
> - * @src: (IN) TCPA structure (OUT) end of TCPA structure
> - * @dst: (OUT) flattened data
> - * Returns: Flattened size or -1 for unknown types
> - */
> -// make it so that it can just run through the whole process and return
> -// the packed size, without packing anything. this will be done if dst is NULL.
> -static int BSG_Pack_private(BSG_Type type, const BSG_BYTE** src, BSG_BYTE* dst)
> -{
> -  // check incoming parameters
> -  if (*src == NULL)
> -    return 0;
> -
> -  const BSG_BYTE* s = *src;
> -  BSG_BYTE* d = dst;
> -
> -  BSG_UINT32 size   = __FMT_MASK_SIZE(type);
> -  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
> -
> -  if (format == __FMT_CONST) // We are dealing with a fixed length value eg. UINT32
> -    {
> -      BSG_UINT32 val = 0;
> -      switch (size) {
> -      case 1: val = * (BYTE*) s; break;
> -      case 2: val = * (unsigned short*) s; break;
> -      case 4: val = * (BSG_UINT32*) s; break;
> -      }
> -      if (dst)
> -       BSG_PackConst(val, size, d);
> -
> -      s += size;
> -      d += size;
> -    } else if (format == __FMT_DATA) { // We are dealing with raw data. Not sure when
> -    // this is used.
> -
> -      if (dst) {
> -        bsglog ("BSG: __FMT_DATA size %d, src %p, dst %p\n", size, s, d);
> -        memcpy(d, s, size);
> -      }
> -
> -      s += size;
> -      d += size;
> -  } else if (format == __FMT_SIZE || format == __FMT_HSIZE) { // It's a size, followed by that much data or handles
> -
> -    BSG_UINT32 psize = 0;
> -    switch (size) {
> -    case 1: psize = * (BYTE*) s; break;
> -    case 2: psize = * (unsigned short*) s; break;
> -    case 4: psize = * (BSG_UINT32*) s; break;
> -    }
> -
> -    if (dst)
> -      BSG_PackConst(psize, size, d);
> -
> -    s += size;
> -    d += size;
> -
> -    // now 's' points to an address, so cast it to BSG_BYTE**
> -    const BSG_BYTE* pdata = * ((BSG_BYTE**) s);
> -    s += sizeof(BSG_BYTE*);
> -
> -    if (format == __FMT_HSIZE) {// This is a list of psize Handles
> -      if (dst) {
> -       BSG_HANDLE* d2 = (BSG_HANDLE*) d;
> -       BSG_HANDLE* p2 = (BSG_HANDLE*) pdata;
> -       BSG_UINT32 i;
> -       for (i = 0; i < psize; i++)
> -         d2[i] = BSG_UnpackConst((BSG_BYTE*)(p2 + i), 4);
> -
> -      }
> -      d += psize * sizeof(BSG_HANDLE);
> -    } else {// If it's not psize handles, it's psize data.
> -      if (psize > 0) {
> -       if (dst) {
> -         bsglog ("BSG: __FMT_SIZE, size=%d, src=%p, dst=%p\n",
> -                 psize, pdata, d);
> -         memcpy(d, pdata, psize);
> -       }
> -      }
> -      d += psize;
> -    }
> -  } else if (format == __FMT_PACKED) {
> -    // the source buffer is a pack_constbuf_t, which has a size and a
> -    // pointer. just copy the buffer value, the size is not included in the
> -    // output stream.
> -    pack_constbuf_t * buf = (pack_constbuf_t*) s;
> -
> -    if (dst) {
> -      bsglog ("BSG: __FMT_PACKED, size=%d, src=%p, dst=%p\n",
> -             buf->size, buf->data, d);
> -      memcpy(d, buf->data, buf->size);
> -    }
> -
> -    s += buf->size;
> -    d += buf->size;
> -  } else if (format == 0) {// No flags are set. This is a structure & it should
> -                          // be looked up in the bsg_s_fmt[]
> -
> -    const BSG_Format* x = find_format (type);
> -    if (x == NULL) {
> -      vtpmloginfo(VTPM_LOG_BSG, "BSG_Pack: cannot find type %d\n", type);
> -      return -1;
> -    }
> -
> -    if (dst)
> -      bsglog ("BSG_Pack type %s\n", x->name);
> -
> -
> -    // iterate through the fields
> -    const BSG_UINT32* f = x->fields;
> -    for (; *f; f++) {
> -      int fsize;
> -
> -      g_log_recursion_level++;
> -      fsize = BSG_Pack_private((BSG_Type) *f, &s, dst ? d : NULL);
> -      g_log_recursion_level--;
> -
> -      if (fsize <= 0)
> -       return fsize;
> -
> -      d += fsize;
> -    }
> -  } else {
> -    vtpmlogerror(VTPM_LOG_BSG, "BSG_Pack(): Unknown format %d\n", format);
> -    return -1;
> -  }
> -
> -  *src = s;
> -  return (d - dst);
> -}
> -
> -/**
> - * Unflatten a TCPA structure from a buffer in big-endian format
> - * @type: TCPA structure type
> - * @src: flattened data
> - * @dst: (IN) TCPA structure (OUT) end of TCPA structure
> - * Returns: Flattened size
> - * Note: Returns flattened size NOT the unpacked structure size
> - */
> -static int BSG_Unpack_private(BSG_Type type, const BSG_BYTE* src, BSG_BYTE** dst) {
> -  // check incoming parameters
> -  if (src == NULL)
> -    return 0;
> -
> -
> -  const BSG_BYTE* s = src;
> -  BSG_BYTE* d = dst ? *dst:NULL;
> -  if (dst && !d)
> -    dst = NULL;
> -
> -  BSG_UINT32 size = __FMT_MASK_SIZE(type);
> -  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
> -
> -  if (format == __FMT_CONST) {// We are dealing with a fixed length value ie. UINT32
> -
> -    BSG_UINT32 val = BSG_UnpackConst(s, size);
> -
> -    if (dst) {
> -      switch (size) {
> -      case 1: *(BYTE *) d = (BSG_BYTE) val; break;
> -      case 2: *(unsigned short*) d = (unsigned short) val; break;
> -      case 4: *(BSG_UINT32*) d = (BSG_UINT32) val; break;
> -      }
> -    }
> -
> -    s += size;
> -    d += size;
> -  } else if (format == __FMT_DATA) {// We are dealing with raw data. Not sure when this is used.
> -    if (dst)
> -      memcpy(d, s, size);
> -
> -    d += size;
> -    s += size;
> -  } else if (format == __FMT_SIZE || format == __FMT_HSIZE) {// It's a size, followed by that much data or handles
> -
> -    BSG_UINT32 psize = BSG_UnpackConst(s, size);
> -
> -    if (psize > BSG_MAX_BUF_SIZE) {
> -      vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack runs into var-sized data bigger than %u bytes!!\n",
> -              BSG_MAX_BUF_SIZE);
> -      return -1;
> -    }
> -
> -    if (dst) {
> -      switch (size) {
> -      case 1: *(BYTE *) d = (BSG_BYTE) psize; break;
> -      case 2: *(unsigned short*) d = (unsigned short) psize; break;
> -      case 4: *(BSG_UINT32*) d = (BSG_UINT32) psize; break;
> -      }
> -    }
> -
> -    s += size;
> -    d += size;
> -
> -    BSG_BYTE* pdata = NULL;
> -
> -    if (psize) {
> -      if (format == __FMT_HSIZE) { // This is a list of psize Handles
> -       if (dst) {
> -         BSG_HANDLE* s2 = (BSG_HANDLE*) s;
> -         pdata = (BSG_BYTE *)malloc(psize * sizeof(BSG_HANDLE));
> -          if (!pdata)
> -            return -1;
> -
> -         BSG_HANDLE* p2 = (BSG_HANDLE*) pdata;
> -         BSG_UINT32 i;
> -         for (i = 0; i < psize; i++) {
> -           BSG_PackConst(s2[i], 4, (BSG_BYTE*)(p2 + i));
> -         }
> -       }
> -       s += psize * sizeof(BSG_HANDLE);
> -      } else { // If it's not psize handles, it's psize data.
> -       if (dst) {
> -         pdata = (BSG_BYTE *)malloc(sizeof(BSG_BYTE) * psize);
> -          if (!pdata)
> -            return -1;
> -         memcpy(pdata, s, psize);
> -       }
> -       s += psize;
> -      }
> -    }
> -    if (dst)
> -      *(void**) d = pdata;
> -
> -    d += sizeof(void*);
> -  } else if (format == __FMT_PACKED) {
> -
> -    // this doesn't make sense for unpacking!
> -    vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack() called with format __FMT_PACKED. "
> -                                                          "This does not make sense\n");
> -
> -    return -1;
> -  } else if (format == 0) {// No flags are set. This is a structure & it should
> -                          // be looked up in the bsg_s_fmt[]
> -
> -    const BSG_Format* x = find_format (type);
> -    if (x == NULL) {
> -      vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack: cannot find type %d\n", type);
> -      return -1;
> -    }
> -
> -    const BSG_UINT32* f = x->fields;
> -    for (; *f; f++) {
> -      int fsize = BSG_Unpack_private((BSG_Type) *f, s, dst ? &d:NULL);
> -      if (fsize <= 0)
> -       return fsize;
> -      s += fsize;
> -    }
> -  }
> -
> -  if (dst)
> -    *dst = d;
> -  return (s - src);
> -}
> -
> -/**
> - * Free memory associated with unpacked TCPA structure
> - * @type: TCPA structure type
> - * @src: (IN) TCPA structure (OUT) end of TCPA structure
> - * Note: Destroy should be called on all structures created with Unpack
> - *       to ensure that any allocated memory is freed
> - */
> -static void BSG_Destroy_private(BSG_Type type, BSG_BYTE** src) {
> -  BSG_BYTE* s = *src;
> -
> -  BSG_UINT32 size = __FMT_MASK_SIZE(type);
> -  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
> -
> -  if ((src == NULL) || (*src == NULL)) {
> -        vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy() called with NULL src\n");
> -    return;
> -  }
> -
> -  if (format == __FMT_CONST || format == __FMT_DATA)
> -    s += size;
> -  else if (format == __FMT_SIZE || format == __FMT_HSIZE) {
> -    s += size;
> -    BSG_BYTE* ptr = *(BSG_BYTE**) s;
> -    free(ptr);
> -    s += sizeof(void*);
> -  } else if (format == __FMT_PACKED) {
> -
> -    // this doesn't make sense for unpacking, hence also for Destroy()
> -    vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy() called with format __FMT_PACKED. "
> -                                                          "This does not make sense\n");
> -
> -    return;
> -  } else if (format == 0) {
> -    const BSG_Format* x = find_format (type);
> -    if (x == NULL) {
> -      vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy: cannot find type %d\n", type);
> -      return;
> -    }
> -
> -    const BSG_UINT32* f = x->fields;
> -    for (; *f; f++)
> -      BSG_Destroy_private((BSG_Type) *f, &s);
> -  }
> -
> -  *src = s;
> -}
> -
> -int BSG_Pack(BSG_Type type, const void* src, BSG_BYTE* dst)
> -{
> -  const BSG_BYTE* src2 = (const BSG_BYTE*) src;
> -  return BSG_Pack_private(type, &src2, dst);
> -}
> -
> -int BSG_Unpack(BSG_Type type, const BSG_BYTE* src, void* dst)
> -{
> -  BSG_BYTE* dst2 = (BSG_BYTE*) dst;
> -  return BSG_Unpack_private(type, src, dst ? &dst2:NULL);
> -}
> -
> -void BSG_Destroy(BSG_Type type, void* src)
> -{
> -  BSG_BYTE* src2 = (BSG_BYTE*) src;
> -  BSG_Destroy_private(type, &src2);
> -}
> -
> -/**
> - * Pack a 8/16/32-bit constant into a buffer in big-endian format
> - * @val: constant value
> - * @size: constant size in bytes (1, 2, or 4)
> - * @dst: (OUT) buffer
> - */
> -void BSG_PackConst(BSG_UINT32 val, int size, BSG_BYTE* dst) {
> -  bsglog ("BSG: PackConst on %d of size %i into address %p\n", val, size, dst);
> -
> -  switch (size) {
> -  case 4:
> -    dst[0] = (BSG_BYTE)((val >> 24) & 0xff);
> -    dst[1] = (BSG_BYTE)((val >> 16) & 0xff);
> -    dst[2] = (BSG_BYTE)((val >> 8) & 0xff);
> -    dst[3] = (BSG_BYTE)(val & 0xff);
> -    break;
> -  case 2:
> -    dst[0] = (BSG_BYTE)((val >> 8) & 0xff);
> -    dst[1] = (BSG_BYTE)(val & 0xff);
> -    break;
> -  case 1:
> -    dst[0] = (BSG_BYTE)(val & 0xff);
> -    break;
> -  }
> -}
> -
> -/**
> - * Unpack a 8/16/32-bit constant from a buffer in big-endian format
> - * @src: buffer
> - * @size: constant size in bytes (1, 2, or 4)
> - */
> -BSG_UINT32 BSG_UnpackConst(const BSG_BYTE* src, int size) {
> -  BSG_UINT32 val = 0;
> -
> -  if (src == NULL)
> -    return 0;
> -
> -  switch (size) {
> -  case 4:
> -    val = (((BSG_UINT32) src[0]) << 24
> -          | ((BSG_UINT32) src[1]) << 16
> -          | ((BSG_UINT32) src[2]) << 8
> -          | (BSG_UINT32) src[3]);
> -    break;
> -  case 2:
> -    val = (((BSG_UINT32) src[0]) << 8 | (BSG_UINT32) src[1]);
> -    break;
> -  case 1:
> -    val = (BSG_UINT32) src[0];
> -    break;
> -  }
> -  return val;
> -}
> -
> -// Pack a list of parameters. Beware not to send values, but rather you must
> -// send a pointer to your values Instead. This includes UINT32's.
> -int BSG_PackList( BSG_BYTE* dst, int ParamCount, ... ) {
> -  int ParamNumber;
> -  BSG_Type format;
> -  BSG_BYTE* val = NULL;
> -  int size=0;
> -
> -  va_list paramList;
> -  va_start( paramList, ParamCount );
> -
> -  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
> -    //Strangeness with int is because gcc wanted an int rather than a enum of ints.
> -    format =  (BSG_Type) va_arg( paramList, int );
> -    val = va_arg( paramList, BSG_BYTE* );
> -    size += BSG_Pack(format, val, dst == NULL ? NULL : dst + size);
> -  }
> -
> -  va_end (paramList);
> -
> -  return size;
> -}
> -
> -// Unpack a list of parameters.
> -int BSG_UnpackList( const BSG_BYTE* src, int ParamCount, ... ) {
> -  int ParamNumber = 0;
> -  BSG_Type format;
> -  BSG_BYTE* val = NULL;
> -  int size = 0;
> -
> -  va_list paramList;
> -  va_start( paramList, ParamCount );
> -
> -  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
> -    format = (BSG_Type) va_arg( paramList, int );
> -    val  = va_arg( paramList, BSG_BYTE* );
> -
> -    size += BSG_Unpack(format, src + size, val);
> -  }
> -
> -  va_end( paramList );
> -
> -  return size;
> -}
> -
> -// Destroy any memory allocated by calls to unpack
> -void BSG_DestroyList(int ParamCount, ... ) {
> -  int ParamNumber = 0;
> -  BSG_Type argType;
> -  BSG_BYTE* paramValue = NULL;
> -
> -  va_list paramList;
> -  va_start( paramList, ParamCount );
> -
> -  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
> -    argType = (BSG_Type) va_arg( paramList, int );
> -    paramValue  = va_arg( paramList, BSG_BYTE* );
> -
> -    BSG_Destroy(argType, paramValue);
> -  }
> -
> -  va_end( paramList );
> -
> -  return;
> -}
> -
> -
> -// and a tuple version
> -TPM_RESULT BSG_DestroyTuple (int numParams, pack_tuple_t params[]) {
> -  int i;
> -
> -  for (i = 0; i < numParams; i++)
> -    BSG_Destroy (params[i].type, params[i].addr);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -//
> -// wrappers of Pack and PackList which malloc the ouput buffer. to be freed
> -// by the caller later
> -//
> -
> -int BSG_PackMalloc (BSG_Type type, const void* src, BSG_BYTE** o_dst) {
> -  int size = BSG_Pack (type, src, NULL);
> -  BSG_BYTE * dest = (BSG_BYTE*) malloc (size);
> -  if (dest == NULL)
> -    return -1;
> -
> -  size = BSG_Pack(type, src, dest);
> -  *o_dst = dest;
> -  return size;
> -}
> -
> -
> -
> -int BSG_PackListMalloc(BSG_BYTE** outBuffer, int ParamCount, ... ) {
> -  va_list args;
> -  int size;
> -
> -  va_start (args, ParamCount);
> -  size = BSG_PackList (NULL, ParamCount, args);
> -  va_end (args);
> -
> -  BSG_BYTE * dest = (BSG_BYTE*) malloc (size);
> -  if (dest == NULL)
> -    return -1;
> -
> -  va_start (args, ParamCount);
> -  size = BSG_PackList (dest, ParamCount, args);
> -  va_end (args);
> -
> -  *outBuffer = dest;
> -  return size;
> -}
> diff --git a/tools/vtpm_manager/util/bsg.h b/tools/vtpm_manager/util/bsg.h
> deleted file mode 100644
> index 0896812..0000000
> --- a/tools/vtpm_manager/util/bsg.h
> +++ /dev/null
> @@ -1,166 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// bsg.h
> -//
> -//  This file contains API's for the TPM Byte Stream functions
> -//
> -// ==================================================================
> -
> -#ifndef __BSG_H__
> -#define __BSG_H__
> -
> -#include <stdarg.h>
> -#include "buffer.h"
> -
> -typedef unsigned int BSG_UINT32;
> -typedef unsigned char BSG_BYTE;
> -
> -// forward decl
> -struct pack_const_tuple_t;
> -
> -struct pack_tuple_t;
> -
> -
> -/**
> - * Byte stream generator
> - */
> -// this has to be manually kept in sync with the
> -// s_fmt array!!
> -// but now we have a self-check function which can make sure things are well
> -// (if used!)
> -typedef enum BSG_Type
> -{
> -  BSG_TYPE_FIRST = 1,
> -  BSG_TYPE_UINT32 = 1, // start at 1 so that Type 0 only serves as an
> -                       // unused/special value
> -  BSG_TYPE_UINT16,
> -  BSG_TYPE_BYTE,
> -  BSG_TYPE_BOOL,
> -  BSG_TPM_SIZE32_DATA,  // a 32 bit unsigned size, followed by
> -                        // a pointer to that much data. can pass a
> -                        // struct pack_buf_t as the param
> -  BSG_TPM_TAG,
> -  BSG_TPM_HANDLE,
> -  BSG_TPM_RESULT,
> -  BSG_TPM_RESOURCE_TYPE,
> -  BSG_TPM_COMMAND_CODE,
> -  BSG_TPM_AUTH_DATA_USAGE,
> -  BSG_TPM_ALGORITHM_ID,
> -  BSG_TPM_PROTOCOL_ID,
> -  BSG_TPM_KEY_USAGE,
> -  BSG_TPM_ENC_SCHEME,
> -  BSG_TPM_SIG_SCHEME,
> -  BSG_TPM_MIGRATE_SCHEME,
> -  BSG_TPM_KEY_FLAGS,
> -  BSG_TPM_AUTHDATA,
> -  BSG_TPM_SECRET,
> -  BSG_TPM_ENCAUTH,
> -  BSG_TPM_PAYLOAD_TYPE,
> -
> -  BSG_TPM_VERSION,
> -  BSG_TPM_DIGEST,
> -  BSG_TPM_COMPOSITE_HASH,
> -  BSG_TPM_CHOSENID_HASH,
> -  BSG_TPM_NONCE,
> -  BSG_TPM_KEY_HANDLE,
> -  BSG_TPM_KEY_HANDLE_LIST,
> -  BSG_TPM_KEY_PARMS,
> -  BSG_TPM_RSA_KEY_PARMS,
> -  BSG_TPM_STORE_PUBKEY,
> -  BSG_TPM_PUBKEY,
> -  BSG_TPM_KEY,
> -
> -  BSG_TPM_MIGRATIONKEYAUTH,
> -  BSG_TCPA_AUDIT_EVENT,
> -  BSG_TCPA_EVENT_CERT,
> -  BSG_TPM_PCR_SELECTION,
> -  BSG_TPM_PCR_COMPOSITE,
> -  BSG_TPM_PCR_INFO,
> -  BSG_TPM_STORED_DATA,
> -  BSG_TPM_SYMMETRIC_KEY,
> -  BSG_TPM_STORE_PRIVKEY,
> -  BSG_TPM_STORE_ASYMKEY,
> -  BSG_TPM_MIGRATE_ASYMKEY,
> -  BSG_TPM_QUOTE_INFO,
> -  BSG_TPM_IDENTITY_CONTENTS,
> -  BSG_TPM_PCRVALUE,
> -  BSG_TCPA_PCR_FLAGS,
> -  BSG_TCS_AUTH,
> -
> -  // this is the BSG_TPM_KEY struct without the encData field
> -  BSG_TPM_KEY_NONSENSITIVE,
> -
> -  BSG_PACKED,
> -
> -  BSG_TYPE_MAX
> -} BSG_Type;
> -
> -struct pack_const_tuple_t {
> -  BSG_Type type;
> -  const void * addr;
> -};
> -
> -
> -typedef struct pack_tuple_t {
> -  BSG_Type type;
> -  void * addr;
> -} pack_tuple_t;
> -
> -int BSG_Pack(BSG_Type type, const void* src, BSG_BYTE* dst);
> -int BSG_Unpack(BSG_Type type, const BSG_BYTE* src, void* dst);
> -void BSG_Destroy(BSG_Type type, void* src);
> -
> -// wrappers of Pack and PackList which malloc the ouput buffer. to be freed
> -// by the caller later. returns size of allocated buffer, or -1 in case
> -// allocation failed
> -int BSG_PackMalloc (BSG_Type type, const void* src, BSG_BYTE** o_dst);
> -int BSG_PackListMalloc (BSG_BYTE** outBuffer, int ParamCount, ... );
> -
> -// a va_list version of PackList
> -int BSG_PackList(BSG_BYTE* outBuffer, int ParamCount, ... );
> -int BSG_UnpackList(const BSG_BYTE* inBuffer, int ParamCount, ... );
> -void BSG_DestroyList(int ParamCount, ... );
> -
> -// wrapper of PackList which uses a buffer_t
> -TPM_RESULT BSG_PackListBuf (buffer_t * o_buf, int ParamCount, ...);
> -
> -// and a tuple version
> -TPM_RESULT BSG_DestroyTuple (int numParams, pack_tuple_t params[]);
> -
> -void BSG_PackConst(BSG_UINT32 val, int size, BSG_BYTE* dst);
> -BSG_UINT32 BSG_UnpackConst(const BSG_BYTE* src, int size);
> -
> -BOOL BSG_static_selfcheck ();
> -
> -#endif
> diff --git a/tools/vtpm_manager/util/buffer.c b/tools/vtpm_manager/util/buffer.c
> deleted file mode 100644
> index df48bc2..0000000
> --- a/tools/vtpm_manager/util/buffer.c
> +++ /dev/null
> @@ -1,226 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -
> -#include <stdarg.h>
> -#include <string.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <sys/param.h>
> -
> -#include "tcg.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -
> -static TPM_RESULT buffer_priv_realloc (buffer_t * buf, tpm_size_t newsize);
> -
> -//
> -// buffer functions!
> -//
> -
> -TPM_RESULT buffer_init (buffer_t * buf, tpm_size_t initsize, const BYTE* initval) {
> -  if (initsize == 0) {
> -    memset(buf, 0, sizeof(*buf));
> -    return TPM_SUCCESS;
> -  }
> -
> -
> -  buf->bytes = (BYTE*) malloc (initsize);
> -  if (buf->bytes == NULL)
> -    return TPM_RESOURCES;
> -
> -  buf->size = initsize;
> -  buf->alloc_size = initsize;
> -
> -  if (initval)
> -    memcpy (buf->bytes, initval, initsize);
> -
> -  buf->is_owner = TRUE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -TPM_RESULT buffer_init_convert (buffer_t * buf, tpm_size_t initsize, BYTE* initval) {
> -
> -  buf->size = initsize;
> -  buf->alloc_size = initsize;
> -  buf->bytes = initval;
> -
> -  buf->is_owner = TRUE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -TPM_RESULT buffer_init_copy (buffer_t * buf, const buffer_t * src) {
> -  TPM_RESULT status = buffer_init (buf, src->size, src->bytes);
> -  buf->is_owner = TRUE;
> -
> -  return status;
> -}
> -
> -
> -
> -// make an alias to a constant array
> -TPM_RESULT buffer_init_const (buffer_t * buf, tpm_size_t size, const BYTE* val) {
> -  // TODO: try to enforce the const things somehow!
> -  buf->bytes = (BYTE*) val;
> -  buf->size = size;
> -  buf->alloc_size = 0;        // this field is now unneeded
> -
> -  buf->is_owner = FALSE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -// make an alias into buf, with given offset and length
> -// if len = 0, make the alias go to the end of buf
> -TPM_RESULT buffer_init_alias (buffer_t * buf, const buffer_t * b,
> -                              tpm_size_t offset, tpm_size_t len) {
> -  if (offset + len > b->size) {
> -    return TPM_NOSPACE;
> -  }
> -
> -  buf->bytes = b->bytes + offset;
> -  buf->size = len > 0 ? len : b->size - offset;
> -
> -  //VS/ buf->alloc_size = 0;
> -  if (len ==0)
> -    buf->alloc_size = b->alloc_size - offset;
> -  else
> -    buf->alloc_size = MIN(b->alloc_size - offset, len);
> -
> -
> -  buf->is_owner = FALSE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -// make an alias buffer_t into bytestream, with given length
> -TPM_RESULT buffer_init_alias_convert (buffer_t * buf, tpm_size_t size, BYTE* val) {
> -
> -  buf->size = size;
> -  buf->alloc_size = size;
> -  buf->bytes = val;
> -
> -  buf->is_owner = FALSE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -
> -// copy into the start of dest
> -TPM_RESULT buffer_copy (buffer_t * dest, const buffer_t* src)
> -{
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  if (dest->alloc_size < src->size) {
> -    TPMTRYRETURN( buffer_priv_realloc (dest, src->size) );
> -  }
> -
> -  memcpy (dest->bytes, src->bytes, src->size);
> -  dest->size = src->size;
> -
> -  //VS/ dest->is_owner = TRUE;
> -
> - abort_egress:
> -
> -  return status;
> -}
> -
> -
> -
> -BOOL buffer_eq (const buffer_t * a, const buffer_t * b) {
> -  return (a->size == b->size && memcmp (a->bytes, b->bytes, a->size) == 0);
> -}
> -
> -
> -void buffer_memset (buffer_t * buf, BYTE b) {
> -  memset (buf->bytes, b, buf->size);
> -}
> -
> -
> -TPM_RESULT buffer_append_raw (buffer_t * buf, tpm_size_t len, const BYTE* bytes) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  if (buf->alloc_size < buf->size + len) {
> -    TPMTRYRETURN( buffer_priv_realloc (buf, buf->size + len) );
> -  }
> -
> -  memcpy (buf->bytes + buf->size, bytes, len);
> -
> -  buf->size += len;
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -tpm_size_t buffer_len (const buffer_t* buf) {
> -  return buf->size;
> -}
> -
> -TPM_RESULT buffer_free (buffer_t * buf) {
> -  if (buf && buf->is_owner && buf->bytes != NULL) {
> -    free (buf->bytes);
> -    buf->bytes = NULL;
> -    buf->size = buf->alloc_size = 0;
> -
> -  }
> -
> -  return TPM_SUCCESS;
> -}
> -
> -TPM_RESULT buffer_priv_realloc (buffer_t * buf, tpm_size_t newsize) {
> -
> -  // we want to realloc to twice the size, or the new size, whichever
> -  // bigger
> -
> -  BYTE * tmpbuf = NULL;
> -
> -  newsize = MAX (buf->alloc_size * 2, newsize);
> -
> -  tmpbuf = (BYTE*) realloc (buf->bytes, newsize);
> -  if (tmpbuf == NULL)
> -    return TPM_SIZE;
> -
> -
> -  buf->bytes = tmpbuf;
> -  buf->alloc_size = newsize;
> -
> -  return TPM_SUCCESS;
> -}
> diff --git a/tools/vtpm_manager/util/buffer.h b/tools/vtpm_manager/util/buffer.h
> deleted file mode 100644
> index d8a9abc..0000000
> --- a/tools/vtpm_manager/util/buffer.h
> +++ /dev/null
> @@ -1,95 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#ifndef __VTPM_BUFFER_H__
> -#define __VTPM_BUFFER_H__
> -
> -#include <stddef.h>             // for pointer NULL
> -#include "tcg.h"
> -
> -typedef UINT32 tpm_size_t;
> -
> -// first version, probably will be expanded...
> -
> -#define NULL_BUF {0,0,0,0}
> -
> -typedef struct {
> -  // private!!
> -  tpm_size_t size, alloc_size;
> -  BYTE * bytes;
> -
> -  BOOL is_owner;              // do we own this buffer, and need to free it?
> -} buffer_t;
> -
> -// allocate the buffer if initsize > 0, copying over initval if provided
> -TPM_RESULT buffer_init (buffer_t * buf,
> -                        tpm_size_t initsize,
> -                        const BYTE* initval);
> -
> -// Create a new buffer from a BYTE *. Use buffer_free to destroy original BYTE *
> -TPM_RESULT buffer_init_convert (buffer_t * buf,
> -                                tpm_size_t initsize,
> -                                BYTE* initval);
> -
> -// make an alias to a constant array, no copying
> -TPM_RESULT buffer_init_const (buffer_t * buf, tpm_size_t size, const BYTE* val);
> -
> -// make an alias into buf, with given offset and length
> -// if len = 0, make the alias go to the end of buf
> -TPM_RESULT buffer_init_alias (buffer_t * buf, const buffer_t * b,
> -                              tpm_size_t offset, tpm_size_t);
> -
> -// make an alias buffer into a bytestream
> -TPM_RESULT buffer_init_alias_convert (buffer_t * buf,
> -                                      tpm_size_t size, BYTE* val);
> -
> -// "copy constructor"
> -TPM_RESULT buffer_init_copy (buffer_t * buf, const buffer_t * src);
> -
> -
> -// copy into the start of a
> -TPM_RESULT buffer_copy (buffer_t * dest, const buffer_t* src);
> -
> -// are they equal?
> -BOOL buffer_eq (const buffer_t * a, const buffer_t * b);
> -
> -// set the buffer to a constant byte
> -void buffer_memset (buffer_t * buf, BYTE b);
> -
> -tpm_size_t buffer_len (const buffer_t* buf);
> -
> -TPM_RESULT buffer_free (buffer_t * buf);
> -
> -TPM_RESULT buffer_append_raw (buffer_t * buf, tpm_size_t len, const BYTE* bytes);
> -
> -#endif // _TOOLS_H_
> diff --git a/tools/vtpm_manager/util/hashtable.c b/tools/vtpm_manager/util/hashtable.c
> deleted file mode 100644
> index aff0e2b..0000000
> --- a/tools/vtpm_manager/util/hashtable.c
> +++ /dev/null
> @@ -1,316 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/xenstore/hashtable.c
> - *  - tools/blktap2/drivers/hashtable.c
> - */
> -
> -#include "hashtable.h"
> -#include "hashtable_private.h"
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> -#include <math.h>
> -
> -/*
> -Credit for primes table: Aaron Krowne
> - http://br.endernet.org/~akrowne/
> - http://planetmath.org/encyclopedia/GoodHashTablePrimes.html
> -*/
> -static const unsigned int primes[] = {
> -53, 97, 193, 389,
> -769, 1543, 3079, 6151,
> -12289, 24593, 49157, 98317,
> -196613, 393241, 786433, 1572869,
> -3145739, 6291469, 12582917, 25165843,
> -50331653, 100663319, 201326611, 402653189,
> -805306457, 1610612741
> -};
> -const unsigned int prime_table_length = sizeof(primes)/sizeof(primes[0]);
> -const float max_load_factor = 0.65;
> -
> -/*****************************************************************************/
> -struct hashtable *
> -create_hashtable(unsigned int minsize,
> -                 unsigned int (*hashf) (void*),
> -                 int (*eqf) (void*,void*))
> -{
> -    struct hashtable *h;
> -    unsigned int pindex, size = primes[0];
> -    /* Check requested hashtable isn't too large */
> -    if (minsize > (1u << 30)) return NULL;
> -    /* Enforce size as prime */
> -    for (pindex=0; pindex < prime_table_length; pindex++) {
> -        if (primes[pindex] > minsize) { size = primes[pindex]; break; }
> -    }
> -    h = (struct hashtable *)malloc(sizeof(struct hashtable));
> -    if (NULL == h) return NULL; /*oom*/
> -    h->table = (struct entry **)malloc(sizeof(struct entry*) * size);
> -    if (NULL == h->table) { free(h); return NULL; } /*oom*/
> -    memset(h->table, 0, size * sizeof(struct entry *));
> -    h->tablelength  = size;
> -    h->primeindex   = pindex;
> -    h->entrycount   = 0;
> -    h->hashfn       = hashf;
> -    h->eqfn         = eqf;
> -    h->loadlimit    = (unsigned int) ceil(size * max_load_factor);
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_init(&h->mutex, NULL);
> -#endif
> -    return h;
> -}
> -
> -/*****************************************************************************/
> -unsigned int
> -hash(struct hashtable *h, void *k)
> -{
> -    unsigned int i = h->hashfn(k);
> -    i += ~(i << 9);
> -    i ^=  ((i >> 14) | (i << 18)); /* >>> */
> -    i +=  (i << 4);
> -    i ^=  ((i >> 10) | (i << 22)); /* >>> */
> -    return i;
> -}
> -
> -/*****************************************************************************/
> -static int
> -hashtable_expand(struct hashtable *h)
> -{
> -    /* Double the size of the table to accomodate more entries */
> -    struct entry **newtable;
> -    struct entry *e;
> -    struct entry **pE;
> -    unsigned int newsize, i, index;
> -    /* Check we're not hitting max capacity */
> -    if (h->primeindex == (prime_table_length - 1)) return 0;
> -    newsize = primes[++(h->primeindex)];
> -
> -    newtable = (struct entry **)malloc(sizeof(struct entry*) * newsize);
> -    if (NULL != newtable)
> -    {
> -        memset(newtable, 0, newsize * sizeof(struct entry *));
> -        /* This algorithm is not 'stable'. ie. it reverses the list
> -         * when it transfers entries between the tables */
> -        for (i = 0; i < h->tablelength; i++) {
> -            while (NULL != (e = h->table[i])) {
> -                h->table[i] = e->next;
> -                index = indexFor(newsize,e->h);
> -                e->next = newtable[index];
> -                newtable[index] = e;
> -            }
> -        }
> -        free(h->table);
> -        h->table = newtable;
> -    }
> -    /* Plan B: realloc instead */
> -    else
> -    {
> -        newtable = (struct entry **)
> -                   realloc(h->table, newsize * sizeof(struct entry *));
> -        if (NULL == newtable) { (h->primeindex)--; return 0; }
> -        h->table = newtable;
> -        memset(newtable[h->tablelength], 0, newsize - h->tablelength);
> -        for (i = 0; i < h->tablelength; i++) {
> -            for (pE = &(newtable[i]), e = *pE; e != NULL; e = *pE) {
> -                index = indexFor(newsize,e->h);
> -                if (index == i)
> -                {
> -                    pE = &(e->next);
> -                }
> -                else
> -                {
> -                    *pE = e->next;
> -                    e->next = newtable[index];
> -                    newtable[index] = e;
> -                }
> -            }
> -        }
> -    }
> -    h->tablelength = newsize;
> -    h->loadlimit   = (unsigned int) ceil(newsize * max_load_factor);
> -    return -1;
> -}
> -
> -/*****************************************************************************/
> -unsigned int
> -hashtable_count(struct hashtable *h)
> -{
> -    unsigned int count;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    count = h->entrycount;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return count;
> -}
> -
> -/*****************************************************************************/
> -int
> -hashtable_insert(struct hashtable *h, void *k, void *v)
> -{
> -    /* This method allows duplicate keys - but they shouldn't be used */
> -    unsigned int index;
> -    struct entry *e;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    if (++(h->entrycount) > h->loadlimit)
> -    {
> -        /* Ignore the return value. If expand fails, we should
> -         * still try cramming just this value into the existing table
> -         * -- we may not have memory for a larger table, but one more
> -         * element may be ok. Next time we insert, we'll try expanding again.*/
> -        hashtable_expand(h);
> -    }
> -    e = (struct entry *)malloc(sizeof(struct entry));
> -    if (NULL == e) { --(h->entrycount); return 0; } /*oom*/
> -    e->h = hash(h,k);
> -    index = indexFor(h->tablelength,e->h);
> -    e->k = k;
> -    e->v = v;
> -    e->next = h->table[index];
> -    h->table[index] = e;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return -1;
> -}
> -
> -/*****************************************************************************/
> -void * /* returns value associated with key */
> -hashtable_search(struct hashtable *h, void *k)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    struct entry *e;
> -    unsigned int hashvalue, index;
> -    hashvalue = hash(h,k);
> -    index = indexFor(h->tablelength,hashvalue);
> -    e = h->table[index];
> -    while (NULL != e)
> -    {
> -        /* Check hash value to short circuit heavier comparison */
> -        if ((hashvalue == e->h) && (h->eqfn(k, e->k))) {
> -#ifdef HASHTABLE_THREADED
> -          pthread_mutex_unlock(&h->mutex);
> -#endif
> -          return e->v;
> -        }
> -        e = e->next;
> -    }
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return NULL;
> -}
> -
> -/*****************************************************************************/
> -void * /* returns value associated with key */
> -hashtable_remove(struct hashtable *h, void *k)
> -{
> -    /* TODO: consider compacting the table when the load factor drops enough,
> -     *       or provide a 'compact' method. */
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    struct entry *e;
> -    struct entry **pE;
> -    void *v;
> -    unsigned int hashvalue, index;
> -
> -    hashvalue = hash(h,k);
> -    index = indexFor(h->tablelength,hash(h,k));
> -    pE = &(h->table[index]);
> -    e = *pE;
> -    while (NULL != e)
> -    {
> -        /* Check hash value to short circuit heavier comparison */
> -        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
> -        {
> -            *pE = e->next;
> -            h->entrycount--;
> -            v = e->v;
> -            freekey(e->k);
> -            free(e);
> -            return v;
> -        }
> -        pE = &(e->next);
> -        e = e->next;
> -    }
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return NULL;
> -}
> -
> -/*****************************************************************************/
> -/* destroy */
> -void
> -hashtable_destroy(struct hashtable *h, int free_values)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    unsigned int i;
> -    struct entry *e, *f;
> -    struct entry **table = h->table;
> -    if (free_values)
> -    {
> -        for (i = 0; i < h->tablelength; i++)
> -        {
> -            e = table[i];
> -            while (NULL != e)
> -            { f = e; e = e->next; freekey(f->k); free(f->v); free(f); }
> -        }
> -    }
> -    else
> -    {
> -        for (i = 0; i < h->tablelength; i++)
> -        {
> -            e = table[i];
> -            while (NULL != e)
> -            { f = e; e = e->next; freekey(f->k); free(f); }
> -        }
> -    }
> -    free(h->table);
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_destroy(&h->mutex);
> -#endif
> -    free(h);
> -}
> diff --git a/tools/vtpm_manager/util/hashtable.h b/tools/vtpm_manager/util/hashtable.h
> deleted file mode 100644
> index dedc60a..0000000
> --- a/tools/vtpm_manager/util/hashtable.h
> +++ /dev/null
> @@ -1,204 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/xenstore/hashtable.h
> - *  - tools/blktap2/drivers/hashtable.h
> - */
> -
> -#ifndef __HASHTABLE_CWC22_H__
> -#define __HASHTABLE_CWC22_H__
> -
> -struct hashtable;
> -
> -/* Example of use:
> - *
> - *      struct hashtable  *h;
> - *      struct some_key   *k;
> - *      struct some_value *v;
> - *
> - *      static unsigned int         hash_from_key_fn( void *k );
> - *      static int                  keys_equal_fn ( void *key1, void *key2 );
> - *
> - *      h = create_hashtable(16, hash_from_key_fn, keys_equal_fn);
> - *      k = (struct some_key *)     malloc(sizeof(struct some_key));
> - *      v = (struct some_value *)   malloc(sizeof(struct some_value));
> - *
> - *      (initialise k and v to suitable values)
> - *
> - *      if (! hashtable_insert(h,k,v) )
> - *      {     exit(-1);               }
> - *
> - *      if (NULL == (found = hashtable_search(h,k) ))
> - *      {    printf("not found!");                  }
> - *
> - *      if (NULL == (found = hashtable_remove(h,k) ))
> - *      {    printf("Not found\n");                 }
> - *
> - */
> -
> -/* Macros may be used to define type-safe(r) hashtable access functions, with
> - * methods specialized to take known key and value types as parameters.
> - *
> - * Example:
> - *
> - * Insert this at the start of your file:
> - *
> - * DEFINE_HASHTABLE_INSERT(insert_some, struct some_key, struct some_value);
> - * DEFINE_HASHTABLE_SEARCH(search_some, struct some_key, struct some_value);
> - * DEFINE_HASHTABLE_REMOVE(remove_some, struct some_key, struct some_value);
> - *
> - * This defines the functions 'insert_some', 'search_some' and 'remove_some'.
> - * These operate just like hashtable_insert etc., with the same parameters,
> - * but their function signatures have 'struct some_key *' rather than
> - * 'void *', and hence can generate compile time errors if your program is
> - * supplying incorrect data as a key (and similarly for value).
> - *
> - * Note that the hash and key equality functions passed to create_hashtable
> - * still take 'void *' parameters instead of 'some key *'. This shouldn't be
> - * a difficult issue as they're only defined and passed once, and the other
> - * functions will ensure that only valid keys are supplied to them.
> - *
> - * The cost for this checking is increased code size and runtime overhead
> - * - if performance is important, it may be worth switching back to the
> - * unsafe methods once your program has been debugged with the safe methods.
> - * This just requires switching to some simple alternative defines - eg:
> - * #define insert_some hashtable_insert
> - *
> - */
> -
> -/*****************************************************************************
> - * create_hashtable
> -
> - * @name                    create_hashtable
> - * @param   minsize         minimum initial size of hashtable
> - * @param   hashfunction    function for hashing keys
> - * @param   key_eq_fn       function for determining key equality
> - * @return                  newly created hashtable or NULL on failure
> - */
> -
> -struct hashtable *
> -create_hashtable(unsigned int minsize,
> -                 unsigned int (*hashfunction) (void*),
> -                 int (*key_eq_fn) (void*,void*));
> -
> -/*****************************************************************************
> - * hashtable_insert
> -
> - * @name        hashtable_insert
> - * @param   h   the hashtable to insert into
> - * @param   k   the key - hashtable claims ownership and will free on removal
> - * @param   v   the value - does not claim ownership
> - * @return      non-zero for successful insertion
> - *
> - * This function will cause the table to expand if the insertion would take
> - * the ratio of entries to table size over the maximum load factor.
> - *
> - * This function does not check for repeated insertions with a duplicate key.
> - * The value returned when using a duplicate key is undefined -- when
> - * the hashtable changes size, the order of retrieval of duplicate key
> - * entries is reversed.
> - * If in doubt, remove before insert.
> - */
> -
> -int
> -hashtable_insert(struct hashtable *h, void *k, void *v);
> -
> -#define DEFINE_HASHTABLE_INSERT(fnname, keytype, valuetype) \
> -int fnname (struct hashtable *h, keytype *k, valuetype *v) \
> -{ \
> -    return hashtable_insert(h,k,v); \
> -}
> -
> -/*****************************************************************************
> - * hashtable_search
> -
> - * @name        hashtable_search
> - * @param   h   the hashtable to search
> - * @param   k   the key to search for  - does not claim ownership
> - * @return      the value associated with the key, or NULL if none found
> - */
> -
> -void *
> -hashtable_search(struct hashtable *h, void *k);
> -
> -#define DEFINE_HASHTABLE_SEARCH(fnname, keytype, valuetype) \
> -valuetype * fnname (struct hashtable *h, keytype *k) \
> -{ \
> -    return (valuetype *) (hashtable_search(h,k)); \
> -}
> -
> -/*****************************************************************************
> - * hashtable_remove
> -
> - * @name        hashtable_remove
> - * @param   h   the hashtable to remove the item from
> - * @param   k   the key to search for  - does not claim ownership
> - * @return      the value associated with the key, or NULL if none found
> - */
> -
> -void * /* returns value */
> -hashtable_remove(struct hashtable *h, void *k);
> -
> -#define DEFINE_HASHTABLE_REMOVE(fnname, keytype, valuetype) \
> -valuetype * fnname (struct hashtable *h, keytype *k) \
> -{ \
> -    return (valuetype *) (hashtable_remove(h,k)); \
> -}
> -
> -
> -/*****************************************************************************
> - * hashtable_count
> -
> - * @name        hashtable_count
> - * @param   h   the hashtable
> - * @return      the number of items stored in the hashtable
> - */
> -unsigned int
> -hashtable_count(struct hashtable *h);
> -
> -
> -/*****************************************************************************
> - * hashtable_destroy
> -
> - * @name        hashtable_destroy
> - * @param   h   the hashtable
> - * @param       free_values     whether to call 'free' on the remaining values
> - */
> -
> -void
> -hashtable_destroy(struct hashtable *h, int free_values);
> -
> -#endif /* __HASHTABLE_CWC22_H__ */
> diff --git a/tools/vtpm_manager/util/hashtable_itr.c b/tools/vtpm_manager/util/hashtable_itr.c
> deleted file mode 100644
> index dcf42c8..0000000
> --- a/tools/vtpm_manager/util/hashtable_itr.c
> +++ /dev/null
> @@ -1,236 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/blktap2/drivers/hashtable_itr.c
> - */
> -
> -#include "hashtable.h"
> -#include "hashtable_private.h"
> -#include "hashtable_itr.h"
> -#include <stdlib.h> /* defines NULL */
> -
> -/*****************************************************************************/
> -/* hashtable_iterator    - iterator constructor */
> -
> -struct hashtable_itr *
> -hashtable_iterator(struct hashtable *h)
> -{
> -    unsigned int i, tablelength;
> -    struct hashtable_itr *itr = (struct hashtable_itr *)
> -        malloc(sizeof(struct hashtable_itr));
> -    if (NULL == itr) return NULL;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    itr->h = h;
> -    itr->e = NULL;
> -    itr->parent = NULL;
> -    tablelength = h->tablelength;
> -    itr->index = tablelength;
> -    if (0 == h->entrycount) {
> -#ifdef HASHTABLE_THREADED
> -      pthread_mutex_unlock(&h->mutex);
> -#endif
> -      return itr;
> -    }
> -
> -    for (i = 0; i < tablelength; i++)
> -    {
> -        if (NULL != h->table[i])
> -        {
> -            itr->e = h->table[i];
> -            itr->index = i;
> -            break;
> -        }
> -    }
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return itr;
> -}
> -
> -/*****************************************************************************/
> -/* key      - return the key of the (key,value) pair at the current position */
> -/* value    - return the value of the (key,value) pair at the current position */
> -
> -void *
> -hashtable_iterator_key(struct hashtable_itr *i)
> -{ return i->e->k; }
> -
> -void *
> -hashtable_iterator_value(struct hashtable_itr *i)
> -{ return i->e->v; }
> -
> -/*****************************************************************************/
> -/* advance - advance the iterator to the next element
> - *           returns zero if advanced to end of table */
> -
> -int
> -hashtable_iterator_advance(struct hashtable_itr *itr)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&itr->h->mutex);
> -#endif
> -    unsigned int j,tablelength;
> -    struct entry **table;
> -    struct entry *next;
> -    int ret;
> -    if (NULL == itr->e) { /* stupidity check */
> -      ret = 0;
> -      goto egress;
> -    }
> -
> -    next = itr->e->next;
> -    if (NULL != next)
> -    {
> -        itr->parent = itr->e;
> -        itr->e = next;
> -        ret = -1;
> -        goto egress;
> -    }
> -
> -    tablelength = itr->h->tablelength;
> -    itr->parent = NULL;
> -    if (tablelength <= (j = ++(itr->index)))
> -    {
> -        itr->e = NULL;
> -        ret = 0;
> -        goto egress;
> -    }
> -    table = itr->h->table;
> -    while (NULL == (next = table[j]))
> -    {
> -        if (++j >= tablelength)
> -        {
> -            itr->index = tablelength;
> -            itr->e = NULL;
> -            ret = 0;
> -            goto egress;
> -        }
> -    }
> -    itr->index = j;
> -    itr->e = next;
> -    ret = -1;
> -
> - egress:
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&itr->h->mutex);
> -#endif
> -    return ret;
> -}
> -
> -/*****************************************************************************/
> -/* remove - remove the entry at the current iterator position
> - *          and advance the iterator, if there is a successive
> - *          element.
> - *          If you want the value, read it before you remove:
> - *          beware memory leaks if you don't.
> - *          Returns zero if end of iteration. */
> -
> -int
> -hashtable_iterator_remove(struct hashtable_itr *itr)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&itr->h->mutex);
> -#endif
> -    struct entry *remember_e, *remember_parent;
> -    int ret;
> -
> -    /* Do the removal */
> -    if (NULL == (itr->parent))
> -    {
> -        /* element is head of a chain */
> -        itr->h->table[itr->index] = itr->e->next;
> -    } else {
> -        /* element is mid-chain */
> -        itr->parent->next = itr->e->next;
> -    }
> -    /* itr->e is now outside the hashtable */
> -    remember_e = itr->e;
> -    itr->h->entrycount--;
> -    freekey(remember_e->k);
> -
> -    /* Advance the iterator, correcting the parent */
> -    remember_parent = itr->parent;
> -    ret = hashtable_iterator_advance(itr);
> -    if (itr->parent == remember_e) { itr->parent = remember_parent; }
> -    free(remember_e);
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&itr->h->mutex);
> -#endif
> -    return ret;
> -}
> -
> -/*****************************************************************************/
> -int /* returns zero if not found */
> -hashtable_iterator_search(struct hashtable_itr *itr,
> -                          struct hashtable *h, void *k)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    struct entry *e, *parent;
> -    unsigned int hashvalue, index;
> -    int ret;
> -
> -    hashvalue = hash(h,k);
> -    index = indexFor(h->tablelength,hashvalue);
> -
> -    e = h->table[index];
> -    parent = NULL;
> -    while (NULL != e)
> -    {
> -        /* Check hash value to short circuit heavier comparison */
> -        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
> -        {
> -            itr->index = index;
> -            itr->e = e;
> -            itr->parent = parent;
> -            itr->h = h;
> -            ret= -1;
> -            goto egress;
> -        }
> -        parent = e;
> -        e = e->next;
> -    }
> -  ret = 0;
> -
> -egress:
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return ret;
> -}
> diff --git a/tools/vtpm_manager/util/hashtable_itr.h b/tools/vtpm_manager/util/hashtable_itr.h
> deleted file mode 100644
> index 35654e0..0000000
> --- a/tools/vtpm_manager/util/hashtable_itr.h
> +++ /dev/null
> @@ -1,109 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/blktap2/drivers/hashtable_itr.h
> - */
> -
> -
> -#ifndef __HASHTABLE_ITR_CWC22__
> -#define __HASHTABLE_ITR_CWC22__
> -#include "hashtable.h"
> -#include "hashtable_private.h" /* needed to enable inlining */
> -
> -/*****************************************************************************/
> -/* This struct is only concrete here to allow the inlining of two of the
> - * accessor functions. */
> -struct hashtable_itr
> -{
> -    struct hashtable *h;
> -    struct entry *e;
> -    struct entry *parent;
> -    unsigned int index;
> -};
> -
> -
> -/*****************************************************************************/
> -/* hashtable_iterator
> - */
> -
> -struct hashtable_itr *
> -hashtable_iterator(struct hashtable *h);
> -
> -/*****************************************************************************/
> -/* hashtable_iterator_key
> - * - return the value of the (key,value) pair at the current position */
> -
> -void *hashtable_iterator_key(struct hashtable_itr *i);
> -
> -/*****************************************************************************/
> -/* value - return the value of the (key,value) pair at the current position */
> -
> -void *hashtable_iterator_value(struct hashtable_itr *i);
> -
> -/*****************************************************************************/
> -/* advance - advance the iterator to the next element
> - *           returns zero if advanced to end of table */
> -
> -int
> -hashtable_iterator_advance(struct hashtable_itr *itr);
> -
> -/*****************************************************************************/
> -/* remove - remove current element and advance the iterator to the next element
> - *          NB: if you need the value to free it, read it before
> - *          removing. ie: beware memory leaks!
> - *          returns zero if advanced to end of table */
> -
> -int
> -hashtable_iterator_remove(struct hashtable_itr *itr);
> -
> -/*****************************************************************************/
> -/* search - overwrite the supplied iterator, to point to the entry
> - *          matching the supplied key.
> -            h points to the hashtable to be searched.
> - *          returns zero if not found. */
> -int
> -hashtable_iterator_search(struct hashtable_itr *itr,
> -                          struct hashtable *h, void *k);
> -
> -#define DEFINE_HASHTABLE_ITERATOR_SEARCH(fnname, keytype) \
> -int fnname (struct hashtable_itr *i, struct hashtable *h, keytype *k) \
> -{ \
> -    return (hashtable_iterator_search(i,h,k)); \
> -}
> -
> -
> -
> -#endif /* __HASHTABLE_ITR_CWC22__*/
> diff --git a/tools/vtpm_manager/util/hashtable_private.h b/tools/vtpm_manager/util/hashtable_private.h
> deleted file mode 100644
> index d87a7f9..0000000
> --- a/tools/vtpm_manager/util/hashtable_private.h
> +++ /dev/null
> @@ -1,96 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/xenstore/hashtable_private.h
> - *  - tools/blktap2/drivers/hashtable_private.h
> - */
> -
> -#ifndef __HASHTABLE_PRIVATE_CWC22_H__
> -#define __HASHTABLE_PRIVATE_CWC22_H__
> -
> -#include "hashtable.h"
> -#ifdef HASHTABLE_THREADED
> -#include <pthread.h>
> -#endif
> -
> -/*****************************************************************************/
> -struct entry
> -{
> -    void *k, *v;
> -    unsigned int h;
> -    struct entry *next;
> -};
> -
> -struct hashtable {
> -    unsigned int tablelength;
> -    struct entry **table;
> -    unsigned int entrycount;
> -    unsigned int loadlimit;
> -    unsigned int primeindex;
> -    unsigned int (*hashfn) (void *k);
> -    int (*eqfn) (void *k1, void *k2);
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_t mutex;
> -#endif
> -};
> -
> -/*****************************************************************************/
> -unsigned int
> -hash(struct hashtable *h, void *k);
> -
> -/*****************************************************************************/
> -/* indexFor */
> -static inline unsigned int
> -indexFor(unsigned int tablelength, unsigned int hashvalue) {
> -    return (hashvalue % tablelength);
> -};
> -
> -/* Only works if tablelength == 2^N */
> -/*static inline unsigned int
> -indexFor(unsigned int tablelength, unsigned int hashvalue)
> -{
> -    return (hashvalue & (tablelength - 1u));
> -}
> -*/
> -
> -/*****************************************************************************/
> -#define freekey(X) free(X)
> -/*define freekey(X) ; */
> -
> -
> -/*****************************************************************************/
> -
> -#endif /* __HASHTABLE_PRIVATE_CWC22_H__*/
> diff --git a/tools/vtpm_manager/util/log.c b/tools/vtpm_manager/util/log.c
> deleted file mode 100644
> index 75fe91a..0000000
> --- a/tools/vtpm_manager/util/log.c
> +++ /dev/null
> @@ -1,142 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <stdlib.h>
> -#include <string.h>
> -#include <stdio.h>
> -
> -#include "buffer.h"
> -#include "tcg.h"
> -
> -// Helper code for the consts, eg. to produce messages for error codes.
> -
> -typedef struct error_code_entry_t {
> -  TPM_RESULT code;
> -  char * code_name;
> -  char * msg;
> -} error_code_entry_t;
> -
> -static const error_code_entry_t error_msgs [] = {
> -  { TPM_SUCCESS, "TPM_SUCCESS", "Successful completion of the operation" },
> -  { TPM_AUTHFAIL, "TPM_AUTHFAIL", "Authentication failed" },
> -  { TPM_BADINDEX, "TPM_BADINDEX", "The index to a PCR, DIR or other register is incorrect" },
> -  { TPM_BAD_PARAMETER, "TPM_BAD_PARAMETER", "One or more parameter is bad" },
> -  { TPM_AUDITFAILURE, "TPM_AUDITFAILURE", "An operation completed successfully but the auditing of that operation failed." },
> -  { TPM_CLEAR_DISABLED, "TPM_CLEAR_DISABLED", "The clear disable flag is set and all clear operations now require physical access" },
> -  { TPM_DEACTIVATED, "TPM_DEACTIVATED", "The TPM is deactivated" },
> -  { TPM_DISABLED, "TPM_DISABLED", "The TPM is disabled" },
> -  { TPM_DISABLED_CMD, "TPM_DISABLED_CMD", "The target command has been disabled" },
> -  { TPM_FAIL, "TPM_FAIL", "The operation failed" },
> -  { TPM_BAD_ORDINAL, "TPM_BAD_ORDINAL", "The ordinal was unknown or inconsistent" },
> -  { TPM_INSTALL_DISABLED, "TPM_INSTALL_DISABLED", "The ability to install an owner is disabled" },
> -  { TPM_INVALID_KEYHANDLE, "TPM_INVALID_KEYHANDLE", "The key handle presented was invalid" },
> -  { TPM_KEYNOTFOUND, "TPM_KEYNOTFOUND", "The target key was not found" },
> -  { TPM_INAPPROPRIATE_ENC, "TPM_INAPPROPRIATE_ENC", "Unacceptable encryption scheme" },
> -  { TPM_MIGRATEFAIL, "TPM_MIGRATEFAIL", "Migration authorization failed" },
> -  { TPM_INVALID_PCR_INFO, "TPM_INVALID_PCR_INFO", "PCR information could not be interpreted" },
> -  { TPM_NOSPACE, "TPM_NOSPACE", "No room to load key." },
> -  { TPM_NOSRK, "TPM_NOSRK", "There is no SRK set" },
> -  { TPM_NOTSEALED_BLOB, "TPM_NOTSEALED_BLOB", "An encrypted blob is invalid or was not created by this TPM" },
> -  { TPM_OWNER_SET, "TPM_OWNER_SET", "There is already an Owner" },
> -  { TPM_RESOURCES, "TPM_RESOURCES", "The TPM has insufficient internal resources to perform the requested action." },
> -  { TPM_SHORTRANDOM, "TPM_SHORTRANDOM", "A random string was too short" },
> -  { TPM_SIZE, "TPM_SIZE", "The TPM does not have the space to perform the operation." },
> -  { TPM_WRONGPCRVAL, "TPM_WRONGPCRVAL", "The named PCR value does not match the current PCR value." },
> -  { TPM_BAD_PARAM_SIZE, "TPM_BAD_PARAM_SIZE", "The paramSize argument to the command has the incorrect value" },
> -  { TPM_SHA_THREAD, "TPM_SHA_THREAD", "There is no existing SHA-1 thread." },
> -  { TPM_SHA_ERROR, "TPM_SHA_ERROR", "The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error." },
> -  { TPM_FAILEDSELFTEST, "TPM_FAILEDSELFTEST", "Self-test has failed and the TPM has shutdown." },
> -  { TPM_AUTH2FAIL, "TPM_AUTH2FAIL", "The authorization for the second key in a 2 key function failed authorization" },
> -  { TPM_BADTAG, "TPM_BADTAG", "The tag value sent to for a command is invalid" },
> -  { TPM_IOERROR, "TPM_IOERROR", "An IO error occurred transmitting information to the TPM" },
> -  { TPM_ENCRYPT_ERROR, "TPM_ENCRYPT_ERROR", "The encryption process had a problem." },
> -  { TPM_DECRYPT_ERROR, "TPM_DECRYPT_ERROR", "The decryption process did not complete." },
> -  { TPM_INVALID_AUTHHANDLE, "TPM_INVALID_AUTHHANDLE", "An invalid handle was used." },
> -  { TPM_NO_ENDORSEMENT, "TPM_NO_ENDORSEMENT", "The TPM does not a EK installed" },
> -  { TPM_INVALID_KEYUSAGE, "TPM_INVALID_KEYUSAGE", "The usage of a key is not allowed" },
> -  { TPM_WRONG_ENTITYTYPE, "TPM_WRONG_ENTITYTYPE", "The submitted entity type is not allowed" },
> -  { TPM_INVALID_POSTINIT, "TPM_INVALID_POSTINIT", "The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup" },
> -  { TPM_INAPPROPRIATE_SIG, "TPM_INAPPROPRIATE_SIG", "Signed data cannot include additional DER information" },
> -  { TPM_BAD_KEY_PROPERTY, "TPM_BAD_KEY_PROPERTY", "The key properties in TPM_KEY_PARMs are not supported by this TPM" },
> -
> -  { TPM_BAD_MIGRATION, "TPM_BAD_MIGRATION", "The migration properties of this key are incorrect." },
> -  { TPM_BAD_SCHEME, "TPM_BAD_SCHEME", "The signature or encryption scheme for this key is incorrect or not permitted in this situation." },
> -  { TPM_BAD_DATASIZE, "TPM_BAD_DATASIZE", "The size of the data (or blob) parameter is bad or inconsistent with the referenced key" },
> -  { TPM_BAD_MODE, "TPM_BAD_MODE", "A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob." },
> -  { TPM_BAD_PRESENCE, "TPM_BAD_PRESENCE", "Either the physicalPresence or physicalPresenceLock bits have the wrong value" },
> -  { TPM_BAD_VERSION, "TPM_BAD_VERSION", "The TPM cannot perform this version of the capability" },
> -  { TPM_NO_WRAP_TRANSPORT, "TPM_NO_WRAP_TRANSPORT", "The TPM does not allow for wrapped transport sessions" },
> -  { TPM_AUDITFAIL_UNSUCCESSFUL, "TPM_AUDITFAIL_UNSUCCESSFUL", "TPM audit construction failed and the underlying command was returning a failure code also" },
> -  { TPM_AUDITFAIL_SUCCESSFUL, "TPM_AUDITFAIL_SUCCESSFUL", "TPM audit construction failed and the underlying command was returning success" },
> -  { TPM_NOTRESETABLE, "TPM_NOTRESETABLE", "Attempt to reset a PCR register that does not have the resettable attribute" },
> -  { TPM_NOTLOCAL, "TPM_NOTLOCAL", "Attempt to reset a PCR register that requires locality and locality modifier not part of command transport" },
> -  { TPM_BAD_TYPE, "TPM_BAD_TYPE", "Make identity blob not properly typed" },
> -  { TPM_INVALID_RESOURCE, "TPM_INVALID_RESOURCE", "When saving context identified resource type does not match actual resource" },
> -  { TPM_NOTFIPS, "TPM_NOTFIPS", "The TPM is attempting to execute a command only available when in FIPS mode" },
> -  { TPM_INVALID_FAMILY, "TPM_INVALID_FAMILY", "The command is attempting to use an invalid family ID" },
> -  { TPM_NO_NV_PERMISSION, "TPM_NO_NV_PERMISSION", "The permission to manipulate the NV storage is not available" },
> -  { TPM_REQUIRES_SIGN, "TPM_REQUIRES_SIGN", "The operation requires a signed command" },
> -  { TPM_KEY_NOTSUPPORTED, "TPM_KEY_NOTSUPPORTED", "Wrong operation to load an NV key" },
> -  { TPM_AUTH_CONFLICT, "TPM_AUTH_CONFLICT", "NV_LoadKey blob requires both owner and blob authorization" },
> -  { TPM_AREA_LOCKED, "TPM_AREA_LOCKED", "The NV area is locked and not writtable" },
> -  { TPM_BAD_LOCALITY, "TPM_BAD_LOCALITY", "The locality is incorrect for the attempted operation" },
> -  { TPM_READ_ONLY, "TPM_READ_ONLY", "The NV area is read only and can't be written to" },
> -  { TPM_PER_NOWRITE, "TPM_PER_NOWRITE", "There is no protection on the write to the NV area" },
> -  { TPM_FAMILYCOUNT, "TPM_FAMILYCOUNT", "The family count value does not match" },
> -  { TPM_WRITE_LOCKED, "TPM_WRITE_LOCKED", "The NV area has already been written to" },
> -  { TPM_BAD_ATTRIBUTES, "TPM_BAD_ATTRIBUTES", "The NV area attributes conflict" },
> -  { TPM_INVALID_STRUCTURE, "TPM_INVALID_STRUCTURE", "The structure tag and version are invalid or inconsistent" },
> -  { TPM_KEY_OWNER_CONTROL, "TPM_KEY_OWNER_CONTROL", "The key is under control of the TPM Owner and can only be evicted by the TPM Owner." },
> -  { TPM_BAD_COUNTER, "TPM_BAD_COUNTER", "The counter handle is incorrect" },
> -  { TPM_NOT_FULLWRITE, "TPM_NOT_FULLWRITE", "The write is not a complete write of the area" },
> -  { TPM_CONTEXT_GAP, "TPM_CONTEXT_GAP", "The gap between saved context counts is too large" },
> -  { TPM_MAXNVWRITES, "TPM_MAXNVWRITES", "The maximum number of NV writes without an owner has been exceeded" },
> -  { TPM_NOOPERATOR, "TPM_NOOPERATOR", "No operator authorization value is set" },
> -  { TPM_RESOURCEMISSING, "TPM_RESOURCEMISSING", "The resource pointed to by context is not loaded" },
> -  { TPM_DELEGATE_LOCK, "TPM_DELEGATE_LOCK", "The delegate administration is locked" },
> -  { TPM_DELEGATE_FAMILY, "TPM_DELEGATE_FAMILY", "Attempt to manage a family other then the delegated family" },
> -  { TPM_DELEGATE_ADMIN, "TPM_DELEGATE_ADMIN", "Delegation table management not enabled" },
> -  { TPM_TRANSPORT_EXCLUSIVE, "TPM_TRANSPORT_EXCLUSIVE", "There was a command executed outside of an exclusive transport session" },
> -};
> -
> -
> -// helper function for the error codes:
> -const char* tpm_get_error_name (TPM_RESULT code) {
> -  // just do a linear scan for now
> -  unsigned i;
> -  for (i = 0; i < sizeof(error_msgs)/sizeof(error_msgs[0]); i++)
> -    if (code == error_msgs[i].code)
> -      return error_msgs[i].code_name;
> -
> -    return("Unknown Error Code");
> -}
> diff --git a/tools/vtpm_manager/util/log.h b/tools/vtpm_manager/util/log.h
> deleted file mode 100644
> index 1f15f5b..0000000
> --- a/tools/vtpm_manager/util/log.h
> +++ /dev/null
> @@ -1,94 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#ifndef __VTPM_LOG_H__
> -#define __VTPM_LOG_H__
> -
> -#include <stdint.h>             // for uint32_t
> -#include <stddef.h>             // for pointer NULL
> -
> -// =========================== LOGGING ==============================
> -
> -// the logging module numbers
> -#define VTPM_LOG_CRYPTO      1
> -#define VTPM_LOG_BSG         2
> -#define VTPM_LOG_TXDATA      3
> -#define VTPM_LOG_TCS         4
> -#define VTPM_LOG_TCS_DEEP    5
> -#define VTPM_LOG_VTSP        6
> -#define VTPM_LOG_VTPM        7
> -#define VTPM_LOG_VTPM_DEEP   8
> -#define VTPM_LOG_VTSP_DEEP   9
> -
> -static char *module_names[] = { "",
> -                                "CRYPTO",
> -                                "BSG",
> -                                "TXDATA",
> -                                "TCS",
> -                                "TCS",
> -                                "VTSP",
> -                                "VTPM",
> -                                "VTPM",
> -                                "VTSP"
> -                              };
> -
> -// Default to standard logging
> -#ifndef LOGGING_MODULES
> -#define LOGGING_MODULES (BITMASK(VTPM_LOG_VTPM))
> -#endif
> -
> -// bit-access macros
> -#define BITMASK(idx)      ( 1U << (idx) )
> -#define GETBIT(num,idx)   ( ((num) & BITMASK(idx)) >> idx )
> -#define SETBIT(num,idx)   (num) |= BITMASK(idx)
> -#define CLEARBIT(num,idx) (num) &= ( ~ BITMASK(idx) )
> -
> -#define vtpmloginfo(module, fmt, args...) \
> -  if (GETBIT (LOGGING_MODULES, module) == 1) {                         \
> -    fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); \
> -  }
> -
> -#define vtpmloginfomore(module, fmt, args...) \
> -  if (GETBIT (LOGGING_MODULES, module) == 1) {                       \
> -    fprintf (stdout, fmt,##args);                                    \
> -  }
> -
> -#define vtpmlogerror(module, fmt, args...) \
> -  fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
> -
> -//typedef UINT32 tpm_size_t;
> -
> -// helper function for the error codes:
> -const char* tpm_get_error_name (TPM_RESULT code);
> -
> -#endif // _VTPM_LOG_H_
> diff --git a/tools/vtpm_manager/util/tcg.h b/tools/vtpm_manager/util/tcg.h
> deleted file mode 100644
> index 5c42913..0000000
> --- a/tools/vtpm_manager/util/tcg.h
> +++ /dev/null
> @@ -1,503 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tcg.h
> -//
> -//  This file contains all the structure and type definitions
> -//
> -// ==================================================================
> -
> -#ifndef __TCG_H__
> -#define __TCG_H__
> -
> -// This pragma is used to disallow structure padding
> -#pragma pack(push, 1)
> -
> -// *************************** TYPEDEFS *********************************
> -typedef unsigned char BYTE;
> -typedef unsigned char BOOL;
> -typedef unsigned short UINT16;
> -typedef unsigned int UINT32;
> -typedef unsigned long long UINT64;
> -
> -typedef UINT32 TPM_RESULT;
> -typedef UINT32 TPM_PCRINDEX;
> -typedef UINT32 TPM_DIRINDEX;
> -typedef UINT32 TPM_HANDLE;
> -typedef TPM_HANDLE TPM_AUTHHANDLE;
> -typedef TPM_HANDLE TCPA_HASHHANDLE;
> -typedef TPM_HANDLE TCPA_HMACHANDLE;
> -typedef TPM_HANDLE TCPA_ENCHANDLE;
> -typedef TPM_HANDLE TPM_KEY_HANDLE;
> -typedef TPM_HANDLE TCPA_ENTITYHANDLE;
> -typedef UINT32 TPM_RESOURCE_TYPE;
> -typedef UINT32 TPM_COMMAND_CODE;
> -typedef UINT16 TPM_PROTOCOL_ID;
> -typedef BYTE TPM_AUTH_DATA_USAGE;
> -typedef UINT16 TPM_ENTITY_TYPE;
> -typedef UINT32 TPM_ALGORITHM_ID;
> -typedef UINT16 TPM_KEY_USAGE;
> -typedef UINT16 TPM_STARTUP_TYPE;
> -typedef UINT32 TPM_CAPABILITY_AREA;
> -typedef UINT16 TPM_ENC_SCHEME;
> -typedef UINT16 TPM_SIG_SCHEME;
> -typedef UINT16 TPM_MIGRATE_SCHEME;
> -typedef UINT16 TPM_PHYSICAL_PRESENCE;
> -typedef UINT32 TPM_KEY_FLAGS;
> -
> -#define TPM_DIGEST_SIZE 20  // Don't change this
> -typedef BYTE TPM_AUTHDATA[TPM_DIGEST_SIZE];
> -typedef TPM_AUTHDATA TPM_SECRET;
> -typedef TPM_AUTHDATA TPM_ENCAUTH;
> -typedef BYTE TPM_PAYLOAD_TYPE;
> -typedef UINT16 TPM_TAG;
> -
> -// Data Types of the TCS
> -typedef UINT32 TCS_AUTHHANDLE;  // Handle addressing a authorization session
> -typedef UINT32 TCS_CONTEXT_HANDLE; // Basic context handle
> -typedef UINT32 TCS_KEY_HANDLE;  // Basic key handle
> -
> -// ************************* STRUCTURES **********************************
> -
> -typedef struct TPM_VERSION {
> -  BYTE major;
> -  BYTE minor;
> -  BYTE revMajor;
> -  BYTE revMinor;
> -} TPM_VERSION;
> -
> -static const TPM_VERSION TPM_STRUCT_VER_1_1 = { 1,1,0,0 };
> -
> -typedef struct TPM_DIGEST {
> -  BYTE digest[TPM_DIGEST_SIZE];
> -} TPM_DIGEST;
> -
> -typedef TPM_DIGEST TPM_PCRVALUE;
> -typedef TPM_DIGEST TPM_COMPOSITE_HASH;
> -typedef TPM_DIGEST TPM_DIRVALUE;
> -typedef TPM_DIGEST TPM_HMAC;
> -typedef TPM_DIGEST TPM_CHOSENID_HASH;
> -
> -typedef struct TPM_NONCE {
> -  BYTE nonce[TPM_DIGEST_SIZE];
> -} TPM_NONCE;
> -
> -typedef struct TPM_KEY_PARMS {
> -  TPM_ALGORITHM_ID algorithmID;
> -  TPM_ENC_SCHEME encScheme;
> -  TPM_SIG_SCHEME sigScheme;
> -  UINT32 parmSize;
> -  BYTE* parms;
> -} TPM_KEY_PARMS;
> -
> -typedef struct TPM_RSA_KEY_PARMS {
> -  UINT32 keyLength;
> -  UINT32 numPrimes;
> -  UINT32 exponentSize;
> -  BYTE* exponent;
> -} TPM_RSA_KEY_PARMS;
> -
> -typedef struct TPM_STORE_PUBKEY {
> -  UINT32 keyLength;
> -  BYTE* key;
> -} TPM_STORE_PUBKEY;
> -
> -typedef struct TPM_PUBKEY {
> -  TPM_KEY_PARMS algorithmParms;
> -  TPM_STORE_PUBKEY pubKey;
> -} TPM_PUBKEY;
> -
> -typedef struct TPM_KEY {
> -  TPM_VERSION         ver;
> -  TPM_KEY_USAGE       keyUsage;
> -  TPM_KEY_FLAGS       keyFlags;
> -  TPM_AUTH_DATA_USAGE authDataUsage;
> -  TPM_KEY_PARMS       algorithmParms;
> -  UINT32              PCRInfoSize;
> -  BYTE*               PCRInfo; // this should be a TPM_PCR_INFO, or NULL
> -  TPM_STORE_PUBKEY    pubKey;
> -  UINT32              encDataSize;
> -  BYTE*               encData;
> -} TPM_KEY;
> -
> -typedef struct TPM_PCR_SELECTION {
> -  UINT16 sizeOfSelect;        /// in bytes
> -  BYTE* pcrSelect;
> -} TPM_PCR_SELECTION;
> -
> -typedef struct TPM_PCR_COMPOSITE {
> -  TPM_PCR_SELECTION select;
> -  UINT32 valueSize;
> -  TPM_PCRVALUE* pcrValue;
> -} TPM_PCR_COMPOSITE;
> -
> -
> -typedef struct TPM_PCR_INFO {
> -  TPM_PCR_SELECTION pcrSelection;
> -  TPM_COMPOSITE_HASH digestAtRelease;
> -  TPM_COMPOSITE_HASH digestAtCreation;
> -} TPM_PCR_INFO;
> -
> -
> -typedef struct TPM_BOUND_DATA {
> -  TPM_VERSION ver;
> -  TPM_PAYLOAD_TYPE payload;
> -  BYTE* payloadData;
> -} TPM_BOUND_DATA;
> -
> -typedef struct TPM_STORED_DATA {
> -  TPM_VERSION ver;
> -  UINT32 sealInfoSize;
> -  BYTE* sealInfo;
> -  UINT32 encDataSize;
> -  BYTE* encData;
> -} TPM_STORED_DATA;
> -
> -typedef struct TCS_AUTH {
> -  TCS_AUTHHANDLE  AuthHandle;
> -  TPM_NONCE   NonceOdd;   // system
> -  TPM_NONCE   NonceEven;   // TPM
> -  BOOL   fContinueAuthSession;
> -  TPM_AUTHDATA  HMAC;
> -} TCS_AUTH;
> -
> -// structures for dealing with sizes followed by buffers in all the
> -// TCG structure.
> -typedef struct pack_buf_t {
> -  UINT32 size;
> -  BYTE * data;
> -} pack_buf_t;
> -
> -typedef struct pack_constbuf_t {
> -  UINT32 size;
> -  const BYTE* data;
> -} pack_constbuf_t;
> -
> -
> -
> -// **************************** CONSTANTS *********************************
> -
> -// BOOL values
> -#define TRUE 0x01
> -#define FALSE 0x00
> -
> -#define TCPA_MAX_BUFFER_LENGTH 0x2000
> -
> -//
> -// TPM_COMMAND_CODE values
> -#define TPM_PROTECTED_ORDINAL 0x00000000UL
> -#define TPM_UNPROTECTED_ORDINAL 0x80000000UL
> -#define TPM_CONNECTION_ORDINAL 0x40000000UL
> -#define TPM_VENDOR_ORDINAL 0x20000000UL
> -
> -#define TPM_ORD_OIAP                     (10UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_OSAP                     (11UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ChangeAuth               (12UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_TakeOwnership            (13UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ChangeAuthAsymStart      (14UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ChangeAuthAsymFinish     (15UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ChangeAuthOwner          (16UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Extend                   (20UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_PcrRead                  (21UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Quote                    (22UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Seal                     (23UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Unseal                   (24UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DirWriteAuth             (25UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DirRead                  (26UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_UnBind                   (30UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CreateWrapKey            (31UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadKey                  (32UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetPubKey                (33UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_EvictKey                 (34UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CreateMigrationBlob      (40UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ReWrapKey                (41UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ConvertMigrationBlob     (42UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_AuthorizeMigrationKey    (43UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CreateMaintenanceArchive (44UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadMaintenanceArchive   (45UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_KillMaintenanceFeature   (46UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadManuMaintPub         (47UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ReadManuMaintPub         (48UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CertifyKey               (50UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Sign                     (60UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetRandom                (70UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_StirRandom               (71UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SelfTestFull             (80UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SelfTestStartup          (81UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CertifySelfTest          (82UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ContinueSelfTest         (83UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetTestResult            (84UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Reset                    (90UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_OwnerClear               (91UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DisableOwnerClear        (92UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ForceClear               (93UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DisableForceClear        (94UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetCapabilitySigned      (100UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetCapability            (101UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetCapabilityOwner       (102UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_OwnerSetDisable          (110UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_PhysicalEnable           (111UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_PhysicalDisable          (112UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SetOwnerInstall          (113UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_PhysicalSetDeactivated   (114UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SetTempDeactivated       (115UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CreateEndorsementKeyPair (120UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_MakeIdentity             (121UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ActivateIdentity         (122UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ReadPubek                (124UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_OwnerReadPubek           (125UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DisablePubekRead         (126UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetAuditEvent            (130UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetAuditEventSigned      (131UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetOrdinalAuditStatus    (140UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SetOrdinalAuditStatus    (141UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Terminate_Handle         (150UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Init                     (151UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SaveState                (152UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Startup                  (153UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SetRedirection           (154UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SHA1Start                (160UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SHA1Update               (161UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SHA1Complete             (162UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SHA1CompleteExtend       (163UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_FieldUpgrade             (170UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SaveKeyContext           (180UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadKeyContext           (181UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SaveAuthContext          (182UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadAuthContext          (183UL + TPM_PROTECTED_ORDINAL)
> -#define TSC_ORD_PhysicalPresence         (10UL + TPM_CONNECTION_ORDINAL)
> -
> -
> -
> -//
> -// TPM_RESULT values
> -//
> -// just put in the whole table from spec 1.2
> -
> -#define TPM_BASE   0x0 // The start of TPM return codes
> -#define TPM_VENDOR_ERROR 0x00000400 // Mask to indicate that the error code is vendor specific for vendor specific commands
> -#define TPM_NON_FATAL  0x00000800 // Mask to indicate that the error code is a non-fatal failure.
> -
> -#define TPM_SUCCESS   TPM_BASE // Successful completion of the operation
> -#define TPM_AUTHFAIL      TPM_BASE + 1 // Authentication failed
> -#define TPM_BADINDEX      TPM_BASE + 2 // The index to a PCR, DIR or other register is incorrect
> -#define TPM_BAD_PARAMETER     TPM_BASE + 3 // One or more parameter is bad
> -#define TPM_AUDITFAILURE     TPM_BASE + 4 // An operation completed successfully but the auditing of that operation failed.
> -#define TPM_CLEAR_DISABLED     TPM_BASE + 5 // The clear disable flag is set and all clear operations now require physical access
> -#define TPM_DEACTIVATED     TPM_BASE + 6 // The TPM is deactivated
> -#define TPM_DISABLED      TPM_BASE + 7 // The TPM is disabled
> -#define TPM_DISABLED_CMD     TPM_BASE + 8 // The target command has been disabled
> -#define TPM_FAIL       TPM_BASE + 9 // The operation failed
> -#define TPM_BAD_ORDINAL     TPM_BASE + 10 // The ordinal was unknown or inconsistent
> -#define TPM_INSTALL_DISABLED   TPM_BASE + 11 // The ability to install an owner is disabled
> -#define TPM_INVALID_KEYHANDLE  TPM_BASE + 12 // The key handle presented was invalid
> -#define TPM_KEYNOTFOUND     TPM_BASE + 13 // The target key was not found
> -#define TPM_INAPPROPRIATE_ENC  TPM_BASE + 14 // Unacceptable encryption scheme
> -#define TPM_MIGRATEFAIL     TPM_BASE + 15 // Migration authorization failed
> -#define TPM_INVALID_PCR_INFO   TPM_BASE + 16 // PCR information could not be interpreted
> -#define TPM_NOSPACE      TPM_BASE + 17 // No room to load key.
> -#define TPM_NOSRK       TPM_BASE + 18 // There is no SRK set
> -#define TPM_NOTSEALED_BLOB     TPM_BASE + 19 // An encrypted blob is invalid or was not created by this TPM
> -#define TPM_OWNER_SET      TPM_BASE + 20 // There is already an Owner
> -#define TPM_RESOURCES      TPM_BASE + 21 // The TPM has insufficient internal resources to perform the requested action.
> -#define TPM_SHORTRANDOM     TPM_BASE + 22 // A random string was too short
> -#define TPM_SIZE       TPM_BASE + 23 // The TPM does not have the space to perform the operation.
> -#define TPM_WRONGPCRVAL     TPM_BASE + 24 // The named PCR value does not match the current PCR value.
> -#define TPM_BAD_PARAM_SIZE     TPM_BASE + 25 // The paramSize argument to the command has the incorrect value
> -#define TPM_SHA_THREAD      TPM_BASE + 26 // There is no existing SHA-1 thread.
> -#define TPM_SHA_ERROR      TPM_BASE + 27 // The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error.
> -#define TPM_FAILEDSELFTEST     TPM_BASE + 28 // Self-test has failed and the TPM has shutdown.
> -#define TPM_AUTH2FAIL      TPM_BASE + 29 // The authorization for the second key in a 2 key function failed authorization
> -#define TPM_BADTAG       TPM_BASE + 30 // The tag value sent to for a command is invalid
> -#define TPM_IOERROR      TPM_BASE + 31 // An IO error occurred transmitting information to the TPM
> -#define TPM_ENCRYPT_ERROR     TPM_BASE + 32 // The encryption process had a problem.
> -#define TPM_DECRYPT_ERROR     TPM_BASE + 33 // The decryption process did not complete.
> -#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 // An invalid handle was used.
> -#define TPM_NO_ENDORSEMENT     TPM_BASE + 35 // The TPM does not a EK installed
> -#define TPM_INVALID_KEYUSAGE   TPM_BASE + 36 // The usage of a key is not allowed
> -#define TPM_WRONG_ENTITYTYPE   TPM_BASE + 37 // The submitted entity type is not allowed
> -#define TPM_INVALID_POSTINIT   TPM_BASE + 38 // The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup
> -#define TPM_INAPPROPRIATE_SIG  TPM_BASE + 39 // Signed data cannot include additional DER information
> -#define TPM_BAD_KEY_PROPERTY   TPM_BASE + 40 // The key properties in TPM_KEY_PARMs are not supported by this TPM
> -
> -#define TPM_BAD_MIGRATION      TPM_BASE + 41 // The migration properties of this key are incorrect.
> -#define TPM_BAD_SCHEME       TPM_BASE + 42 // The signature or encryption scheme for this key is incorrect or not permitted in this situation.
> -#define TPM_BAD_DATASIZE      TPM_BASE + 43 // The size of the data (or blob) parameter is bad or inconsistent with the referenced key
> -#define TPM_BAD_MODE       TPM_BASE + 44 // A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob.
> -#define TPM_BAD_PRESENCE      TPM_BASE + 45 // Either the physicalPresence or physicalPresenceLock bits have the wrong value
> -#define TPM_BAD_VERSION      TPM_BASE + 46 // The TPM cannot perform this version of the capability
> -#define TPM_NO_WRAP_TRANSPORT     TPM_BASE + 47 // The TPM does not allow for wrapped transport sessions
> -#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 // TPM audit construction failed and the underlying command was returning a failure code also
> -#define TPM_AUDITFAIL_SUCCESSFUL   TPM_BASE + 49 // TPM audit construction failed and the underlying command was returning success
> -#define TPM_NOTRESETABLE      TPM_BASE + 50 // Attempt to reset a PCR register that does not have the resettable attribute
> -#define TPM_NOTLOCAL       TPM_BASE + 51 // Attempt to reset a PCR register that requires locality and locality modifier not part of command transport
> -#define TPM_BAD_TYPE       TPM_BASE + 52 // Make identity blob not properly typed
> -#define TPM_INVALID_RESOURCE     TPM_BASE + 53 // When saving context identified resource type does not match actual resource
> -#define TPM_NOTFIPS       TPM_BASE + 54 // The TPM is attempting to execute a command only available when in FIPS mode
> -#define TPM_INVALID_FAMILY      TPM_BASE + 55 // The command is attempting to use an invalid family ID
> -#define TPM_NO_NV_PERMISSION     TPM_BASE + 56 // The permission to manipulate the NV storage is not available
> -#define TPM_REQUIRES_SIGN      TPM_BASE + 57 // The operation requires a signed command
> -#define TPM_KEY_NOTSUPPORTED     TPM_BASE + 58 // Wrong operation to load an NV key
> -#define TPM_AUTH_CONFLICT      TPM_BASE + 59 // NV_LoadKey blob requires both owner and blob authorization
> -#define TPM_AREA_LOCKED      TPM_BASE + 60 // The NV area is locked and not writtable
> -#define TPM_BAD_LOCALITY      TPM_BASE + 61 // The locality is incorrect for the attempted operation
> -#define TPM_READ_ONLY       TPM_BASE + 62 // The NV area is read only and can't be written to
> -#define TPM_PER_NOWRITE      TPM_BASE + 63 // There is no protection on the write to the NV area
> -#define TPM_FAMILYCOUNT      TPM_BASE + 64 // The family count value does not match
> -#define TPM_WRITE_LOCKED      TPM_BASE + 65 // The NV area has already been written to
> -#define TPM_BAD_ATTRIBUTES      TPM_BASE + 66 // The NV area attributes conflict
> -#define TPM_INVALID_STRUCTURE     TPM_BASE + 67 // The structure tag and version are invalid or inconsistent
> -#define TPM_KEY_OWNER_CONTROL     TPM_BASE + 68 // The key is under control of the TPM Owner and can only be evicted by the TPM Owner.
> -#define TPM_BAD_COUNTER      TPM_BASE + 69 // The counter handle is incorrect
> -#define TPM_NOT_FULLWRITE      TPM_BASE + 70 // The write is not a complete write of the area
> -#define TPM_CONTEXT_GAP      TPM_BASE + 71 // The gap between saved context counts is too large
> -#define TPM_MAXNVWRITES      TPM_BASE + 72 // The maximum number of NV writes without an owner has been exceeded
> -#define TPM_NOOPERATOR       TPM_BASE + 73 // No operator authorization value is set
> -#define TPM_RESOURCEMISSING     TPM_BASE + 74 // The resource pointed to by context is not loaded
> -#define TPM_DELEGATE_LOCK      TPM_BASE + 75 // The delegate administration is locked
> -#define TPM_DELEGATE_FAMILY     TPM_BASE + 76 // Attempt to manage a family other then the delegated family
> -#define TPM_DELEGATE_ADMIN      TPM_BASE + 77 // Delegation table management not enabled
> -#define TPM_TRANSPORT_EXCLUSIVE    TPM_BASE + 78 // There was a command executed outside of an exclusive transport session
> -
> -// TPM_STARTUP_TYPE values
> -#define TPM_ST_CLEAR 0x0001
> -#define TPM_ST_STATE 0x0002
> -#define TPM_ST_DEACTIVATED 0x003
> -
> -// TPM_TAG values
> -#define TPM_TAG_RQU_COMMAND 0x00c1
> -#define TPM_TAG_RQU_AUTH1_COMMAND 0x00c2
> -#define TPM_TAG_RQU_AUTH2_COMMAND 0x00c3
> -#define TPM_TAG_RSP_COMMAND 0x00c4
> -#define TPM_TAG_RSP_AUTH1_COMMAND 0x00c5
> -#define TPM_TAG_RSP_AUTH2_COMMAND 0x00c6
> -
> -// TPM_PAYLOAD_TYPE values
> -#define TPM_PT_ASYM 0x01
> -#define TPM_PT_BIND 0x02
> -#define TPM_PT_MIGRATE 0x03
> -#define TPM_PT_MAINT 0x04
> -#define TPM_PT_SEAL 0x05
> -
> -// TPM_ENTITY_TYPE values
> -#define TPM_ET_KEYHANDLE 0x0001
> -#define TPM_ET_OWNER 0x0002
> -#define TPM_ET_DATA 0x0003
> -#define TPM_ET_SRK 0x0004
> -#define TPM_ET_KEY 0x0005
> -
> -/// TPM_ResourceTypes
> -#define TPM_RT_KEY      0x00000001
> -#define TPM_RT_AUTH     0x00000002
> -#define TPM_RT_TRANS    0x00000004
> -#define TPM_RT_CONTEXT  0x00000005
> -
> -// TPM_PROTOCOL_ID values
> -#define TPM_PID_OIAP 0x0001
> -#define TPM_PID_OSAP 0x0002
> -#define TPM_PID_ADIP 0x0003
> -#define TPM_PID_ADCP 0x0004
> -#define TPM_PID_OWNER 0x0005
> -
> -// TPM_ALGORITHM_ID values
> -#define TPM_ALG_RSA 0x00000001
> -#define TPM_ALG_DES 0x00000002
> -#define TPM_ALG_3DES 0X00000003
> -#define TPM_ALG_SHA 0x00000004
> -#define TPM_ALG_HMAC 0x00000005
> -#define TCPA_ALG_AES 0x00000006
> -
> -// TPM_ENC_SCHEME values
> -#define TPM_ES_NONE 0x0001
> -#define TPM_ES_RSAESPKCSv15 0x0002
> -#define TPM_ES_RSAESOAEP_SHA1_MGF1 0x0003
> -
> -// TPM_SIG_SCHEME values
> -#define TPM_SS_NONE 0x0001
> -#define TPM_SS_RSASSAPKCS1v15_SHA1 0x0002
> -#define TPM_SS_RSASSAPKCS1v15_DER 0x0003
> -
> -// TPM_KEY_USAGE values
> -#define TPM_KEY_EK 0x0000
> -#define TPM_KEY_SIGNING 0x0010
> -#define TPM_KEY_STORAGE 0x0011
> -#define TPM_KEY_IDENTITY 0x0012
> -#define TPM_KEY_AUTHCHANGE 0X0013
> -#define TPM_KEY_BIND 0x0014
> -#define TPM_KEY_LEGACY 0x0015
> -
> -// TPM_AUTH_DATA_USAGE values
> -#define TPM_AUTH_NEVER 0x00
> -#define TPM_AUTH_ALWAYS 0x01
> -
> -// Key Handle of owner and srk
> -#define TPM_OWNER_KEYHANDLE 0x40000001
> -#define TPM_SRK_KEYHANDLE 0x40000000
> -
> -// ---------------------- Functions for checking TPM_RESULTs -----------------
> -
> -#include <stdio.h>
> -
> -// FIXME: Review use of these and delete unneeded ones.
> -
> -// these are really badly dependent on local structure:
> -// DEPENDS: local var 'status' of type TPM_RESULT
> -// DEPENDS: label 'abort_egress' which cleans up and returns the status
> -#define ERRORDIE(s) do { status = s; \
> -                         fprintf (stderr, "*** ERRORDIE in %s at %s: %i\n", __func__, __FILE__, __LINE__); \
> -                         goto abort_egress; } \
> -                    while (0)
> -
> -// DEPENDS: local var 'status' of type TPM_RESULT
> -// DEPENDS: label 'abort_egress' which cleans up and returns the status
> -// Try command c. If it fails, set status to s and goto abort.
> -#define TPMTRY(s,c) if (c != TPM_SUCCESS) { \
> -                       status = s; \
> -                       printf("ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
> -                       goto abort_egress; \
> -                    } else {\
> -                       status = c; \
> -                    }
> -
> -// Try command c. If it fails, print error message, set status to actual return code. Goto abort
> -#define TPMTRYRETURN(c) do { status = c; \
> -                             if (status != TPM_SUCCESS) { \
> -                               fprintf(stderr, "ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
> -                               goto abort_egress; \
> -                             } \
> -                        } while(0)
> -
> -
> -#pragma pack(pop)
> -
> -#endif //__TCPA_H__
> diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c
> index 3b89223..0ba1d55 100644
> --- a/tools/xenstore/hashtable.c
> +++ b/tools/xenstore/hashtable.c
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/blktap2/drivers/hashtable.c
> - *  - tools/vtpm_manager/util/hashtable.c
>   */
>
>  #include "hashtable.h"
> diff --git a/tools/xenstore/hashtable.h b/tools/xenstore/hashtable.h
> index 8e6bb5b..4d68223 100644
> --- a/tools/xenstore/hashtable.h
> +++ b/tools/xenstore/hashtable.h
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/blktap2/drivers/hashtable.h
> - *  - tools/vtpm_manager/util/hashtable.h
>   */
>
>  #ifndef __HASHTABLE_CWC22_H__
> diff --git a/tools/xenstore/hashtable_private.h b/tools/xenstore/hashtable_private.h
> index cabaffe..a08559d 100644
> --- a/tools/xenstore/hashtable_private.h
> +++ b/tools/xenstore/hashtable_private.h
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/blktap2/drivers/hashtable_private.h
> - *  - tools/vtpm_manager/util/hashtable_private.h
>   */
>
>  #ifndef __HASHTABLE_PRIVATE_CWC22_H__
> diff --git a/tools/xm-test/configure.ac b/tools/xm-test/configure.ac
> index ad1eb78..c142140 100644
> --- a/tools/xm-test/configure.ac
> +++ b/tools/xm-test/configure.ac
> @@ -143,7 +143,6 @@ AC_CONFIG_FILES([
>      tests/unpause/Makefile
>      tests/vcpu-pin/Makefile
>      tests/vcpu-disable/Makefile
> -    tests/vtpm/Makefile
>      tests/xapi/Makefile
>      tests/enforce_dom0_cpus/Makefile
>      tests/cpupool/Makefile
> diff --git a/tools/xm-test/grouptest/default b/tools/xm-test/grouptest/default
> index f0516b2..e04591b 100644
> --- a/tools/xm-test/grouptest/default
> +++ b/tools/xm-test/grouptest/default
> @@ -27,5 +27,4 @@ sysrq
>  unpause
>  vcpu-disable
>  vcpu-pin
> -vtpm
>  xapi
> diff --git a/tools/xm-test/grouptest/medium b/tools/xm-test/grouptest/medium
> index bafc988..5c3e1b1 100644
> --- a/tools/xm-test/grouptest/medium
> +++ b/tools/xm-test/grouptest/medium
> @@ -22,4 +22,3 @@ sysrq 01_sysrq_basic_neg.test 02_sysrq_sync_pos.test
>  unpause
>  vcpu-disable
>  vcpu-pin
> -vtpm
> diff --git a/tools/xm-test/grouptest/xapi b/tools/xm-test/grouptest/xapi
> index 3b04921..7a08b77 100644
> --- a/tools/xm-test/grouptest/xapi
> +++ b/tools/xm-test/grouptest/xapi
> @@ -1,2 +1 @@
>  xapi
> -vtpm 09_vtpm-xapi.test
> diff --git a/tools/xm-test/lib/XmTestLib/XenDomain.py b/tools/xm-test/lib/XmTestLib/XenDomain.py
> index ae8c550..3ba7433 100644
> --- a/tools/xm-test/lib/XmTestLib/XenDomain.py
> +++ b/tools/xm-test/lib/XmTestLib/XenDomain.py
> @@ -59,7 +59,6 @@ class XenConfig:
>          # These options need to be lists
>          self.defaultOpts["disk"] = []
>          self.defaultOpts["vif"]  = []
> -        self.defaultOpts["vtpm"] = []
>
>          self.opts = self.defaultOpts
>
> diff --git a/tools/xm-test/tests/Makefile.am b/tools/xm-test/tests/Makefile.am
> index 8d673ed..455f50c 100644
> --- a/tools/xm-test/tests/Makefile.am
> +++ b/tools/xm-test/tests/Makefile.am
> @@ -25,7 +25,6 @@ SUBDIRS =                     \
>                 unpause         \
>                 vcpu-disable    \
>                 vcpu-pin        \
> -               vtpm            \
>                 enforce_dom0_cpus       \
>                 save restore migrate    \
>                 cpupool
> diff --git a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py b/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
> deleted file mode 100644
> index dfd1227..0000000
> --- a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
> +++ /dev/null
> @@ -1,40 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                verify list
> -
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -
> -try:
> -    domain.start(noConsole=True)
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    vtpm_cleanup(domain.getName())
> -    FAIL("Unable to create domain")
> -
> -
> -domName = domain.getName()
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -status, output = traceCommand("xm vtpm-list %s" % domain.getId())
> -eyecatcher = "/local/domain/0/backend/vtpm"
> -where = output.find(eyecatcher)
> -if status != 0:
> -    FAIL("xm vtpm-list returned bad status, expected 0, status is %i" % status)
> -elif where < 0:
> -    FAIL("Fail to list virtual TPM device")
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py b/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
> deleted file mode 100644
> index a18cbab..0000000
> --- a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
> +++ /dev/null
> @@ -1,49 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                check list of pcrs
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -domain.closeConsole()
> -
> -domain.stop()
> -
> -if not re.search("PCR-00:",run["output"]):
> -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> diff --git a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py b/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
> deleted file mode 100644
> index b863f27..0000000
> --- a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
> +++ /dev/null
> @@ -1,99 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                check list of pcrs; suspend and resume the domain and
> -#                check list of pcrs again
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm save %s %s.save" %
> -                                      (domName, domName),
> -                                      timeout=30)
> -
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm save did not succeed")
> -
> -    try:
> -        status, ouptut = traceCommand("xm restore %s.save" %
> -                                      (domName),
> -                                      timeout=30)
> -    except TimeoutError, e:
> -        os.remove("%s.save" % domName)
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    os.remove("%s.save" % domName)
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm restore did not succeed")
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL(str(e))
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> -
> diff --git a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py b/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
> deleted file mode 100644
> index ccc8b73..0000000
> --- a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
> +++ /dev/null
> @@ -1,93 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                check list of pcrs; locally migrate the domain and
> -#                check list of pcrs again
> -#                This test does local live migration.
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -old_domid = domid(domName)
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm migrate -l %s localhost" %
> -                                      domName,
> -                                      timeout=90)
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm migrate did not succeed. External device migration activated?")
> -
> -
> -    domName = domain.getName()
> -    new_domid = domid(domName)
> -
> -    if (old_domid == new_domid):
> -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> -             (old_domid,loop))
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL("No result from dumping the PCRs")
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py b/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py
> deleted file mode 100644
> index 57b87df..0000000
> --- a/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py
> +++ /dev/null
> @@ -1,93 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                check list of pcrs; locally migrate the domain and
> -#                check list of pcrs again
> -#                This test does local (non-live) migration.
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -old_domid = domid(domName)
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm migrate %s localhost" %
> -                                      domName,
> -                                      timeout=90)
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm migrate did not succeed. External device migration activated?")
> -
> -
> -    domName = domain.getName()
> -    new_domid = domid(domName)
> -
> -    if (old_domid == new_domid):
> -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> -             (old_domid,loop))
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL("No result from dumping the PCRs")
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py b/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
> deleted file mode 100644
> index c70691d..0000000
> --- a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
> +++ /dev/null
> @@ -1,125 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                extend a pcr
> -#                check list of pcrs; suspend and resume the domain and
> -#                check list of pcrs again and validate extended pcr
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("mknod /dev/tpm0 c 10 224")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while creating /dev/tpm0")
> -
> -try:
> -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while extending PCR 0")
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm save %s %s.save" %
> -                                      (domName, domName),
> -                                      timeout=30)
> -
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm save did not succeed")
> -
> -    try:
> -        status, ouptut = traceCommand("xm restore %s.save" %
> -                                      (domName),
> -                                      timeout=30)
> -    except TimeoutError, e:
> -        os.remove("%s.save" % domName)
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    os.remove("%s.save" % domName)
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm restore did not succeed")
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL(str(e))
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> -
> diff --git a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py b/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
> deleted file mode 100644
> index 4ff3360..0000000
> --- a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
> +++ /dev/null
> @@ -1,119 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                extend a pcr
> -#                check list of pcrs; locally migrate the domain and
> -#                check list of pcrs again and validate extended pcr
> -#                This test does local live migration.
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("mknod /dev/tpm0 c 10 224")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while creating /dev/tpm0")
> -
> -try:
> -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while extending PCR 0")
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -old_domid = domid(domName)
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm migrate -l %s localhost" %
> -                                      domName,
> -                                      timeout=90)
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm migrate did not succeed. External device migration activated?")
> -
> -
> -    domName = domain.getName()
> -    new_domid = domid(domName)
> -
> -    if (old_domid == new_domid):
> -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> -             (old_domid,loop))
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL("No result from dumping the PCRs")
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py b/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
> deleted file mode 100644
> index 27125fc..0000000
> --- a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
> +++ /dev/null
> @@ -1,119 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                extend a pcr
> -#                check list of pcrs; locally migrate the domain and
> -#                check list of pcrs again and validate extended pcr
> -#                This test does local (non-live) migration.
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("mknod /dev/tpm0 c 10 224")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while creating /dev/tpm0")
> -
> -try:
> -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while extending PCR 0")
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -old_domid = domid(domName)
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm migrate %s localhost" %
> -                                      domName,
> -                                      timeout=90)
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm migrate did not succeed. External device migration activated?")
> -
> -
> -    domName = domain.getName()
> -    new_domid = domid(domName)
> -
> -    if (old_domid == new_domid):
> -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> -             (old_domid,loop))
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL("No result from dumping the PCRs")
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py b/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
> deleted file mode 100644
> index a1aa8b3..0000000
> --- a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
> +++ /dev/null
> @@ -1,158 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Test to test the vtpm class through the Xen-API
> -#
> -# Tested methods:
> -#  VTPM: get_uuid, get_backend, get_by_uuid, get_record
> -#        create, destroy, get_VM
> -#  VM: get_VTPMS
> -
> -from XmTestLib import xapi
> -from XmTestLib.XenAPIDomain import XmTestAPIDomain
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -
> -VTPM_RECORD_KEYS = [ 'backend', 'VM', 'uuid', 'other_config' ]
> -
> -try:
> -    # XmTestAPIDomain tries to establish a connection to XenD
> -    domain = XmTestAPIDomain()
> -except Exception, e:
> -    SKIP("Skipping test. Error: %s" % str(e))
> -vm_uuid = domain.get_uuid()
> -
> -vtpmcfg = {}
> -vtpmcfg['backend'] = DOM0_UUID
> -vtpmcfg['VM'] = vm_uuid
> -
> -session = xapi.connect()
> -
> -vtpm_uuid = session.xenapi.VTPM.create(vtpmcfg)
> -
> -vtpm_be = session.xenapi.VTPM.get_backend(vtpm_uuid)
> -if vtpm_be != vtpmcfg['backend']:
> -    FAIL("vTPM's backend is in '%s', expected: '%s'" %
> -         (vtpm_be, vtpmcfg['backend']))
> -
> -vtpm_rec = session.xenapi.VTPM.get_record(vtpm_uuid)
> -
> -miss_keys = []
> -for k in VTPM_RECORD_KEYS:
> -    if k not in vtpm_rec.keys():
> -        miss_keys.append(k)
> -if len(miss_keys) > 0:
> -    FAIL("vTPM record is missing key(s): %s" % miss_keys)
> -
> -if vtpm_rec['uuid']  != vtpm_uuid:
> -    FAIL("vTPM record shows vtpm uuid '%s', expected: '%s'" %
> -         (vtpm_rec['uuid'], vtpm_uuid))
> -if vtpm_rec['VM']  != vm_uuid:
> -    FAIL("vTPM record shows VM uuid '%s', expected: '%s'" %
> -         (vtpm_rec['VM'], vm_uuid))
> -if vtpm_rec['backend'] != vtpmcfg['backend']:
> -    FAIL("vTPM record shows VM bakcned '%s', expected: '%s'" %
> -         (vtpm_rev['backend'], vtpmcfg['backend']))
> -
> -badkeys = []
> -keys = vtpm_rec.keys()
> -for k in keys:
> -    if k not in VTPM_RECORD_KEYS:
> -        badkeys.append(k)
> -if len(badkeys) > 0:
> -    FAIL("Unexpected attributes in result: %s" % badkeys)
> -
> -if vm_uuid != session.xenapi.VTPM.get_VM(vtpm_uuid):
> -    FAIL("VM uuid from VTPM.get_VM different (%s) than expected (%s)." %
> -         (vm_ref, vm_uuid))
> -
> -uuid = session.xenapi.VTPM.get_uuid(vtpm_uuid)
> -if uuid != vtpm_uuid:
> -    FAIL("vTPM from VTPM.get_uuid different (%s) than expected (%s)." %
> -         (uuid, vtpm_uuid))
> -
> -vtpm_ref = session.xenapi.VTPM.get_by_uuid(vtpm_uuid)
> -if vtpm_ref != vtpm_uuid:
> -    FAIL("vTPM from VTPM.get_by_uuid different (%s) than expected (%s)." %
> -         (vtpm_ref, vtpm_uuid))
> -
> -vm_vtpms = session.xenapi.VM.get_VTPMs(vm_uuid)
> -if len(vm_vtpms) != 1:
> -    FAIL("Number of vTPMs from get_VTPMs is (%d) not what was expected (%d)" %
> -         (len(vm_vtpms), 1))
> -if vtpm_uuid not in vm_vtpms:
> -    FAIL("Other vTPM uuid (%s) returned from VM.get_VTPMs than expected (%s)" %
> -         (vm_vtpms[0], vtpm_uuid))
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    FAIL("Unable to create domain.")
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("1. No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("1. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -try:
> -    session.xenapi.VTPM.destroy(vtpm_uuid)
> -    #Should never get here
> -    FAIL("Could destroy vTPM while VM is running")
> -except:
> -    pass
> -
> -rc = session.xenapi.VM.suspend(vm_uuid)
> -if rc:
> -    FAIL("Could not suspend VM")
> -
> -try:
> -    session.xenapi.VTPM.destroy(vtpm_uuid)
> -    #May not throw an exception in 'suspend' state
> -except:
> -    pass
> -
> -rc = session.xenapi.VM.resume(vm_uuid, False)
> -if rc:
> -    FAIL("Could not resume VM")
> -
> -try:
> -    console = domain.getConsole()
> -except ConsoleError, e:
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("2. No result from dumping the PCRs. vTPM has been removed?")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("2. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -domain.stop()
> -
> -try:
> -    session.xenapi.VTPM.destroy(vtpm_uuid)
> -except:
> -    FAIL("Could NOT destroy vTPM while domain is halted.")
> -
> -domain.destroy()
> diff --git a/tools/xm-test/tests/vtpm/Makefile.am b/tools/xm-test/tests/vtpm/Makefile.am
> deleted file mode 100644
> index dd67e45..0000000
> --- a/tools/xm-test/tests/vtpm/Makefile.am
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -SUBDIRS =
> -
> -TESTS = 01_vtpm-list_pos.test \
> -        02_vtpm-cat_pcrs.test \
> -        03_vtpm-susp_res.test \
> -        04_vtpm-loc_migr.test \
> -        05_vtpm-loc_migr.test \
> -        06_vtpm-susp_res_pcrs.test \
> -        07_vtpm-mig_pcrs.test \
> -        08_vtpm-mig_pcrs.test \
> -        09_vtpm-xapi.test
> -
> -XFAIL_TESTS =
> -
> -EXTRA_DIST = $(TESTS) $(XFAIL_TESTS) vtpm_utils.py
> -TESTS_ENVIRONMENT=@TENV@
> -
> -%.test: %.py
> -       cp $< $@
> -       chmod +x $@
> -
> -clean-local: am_config_clean-local
> -
> -am_config_clean-local:
> -       rm -f *test
> -       rm -f *log
> -       rm -f *~
> diff --git a/tools/xm-test/tests/vtpm/vtpm_utils.py b/tools/xm-test/tests/vtpm/vtpm_utils.py
> deleted file mode 100644
> index 4e5b281..0000000
> --- a/tools/xm-test/tests/vtpm/vtpm_utils.py
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -from XmTestLib import *
> -
> -if ENABLE_HVM_SUPPORT:
> -    SKIP("vtpm tests not supported for HVM domains")
> -
> -status, output = traceCommand("COLUMNS=200 ; "
> -                              "ps aux | grep vtpm_manager | grep -v grep")
> -if output == "":
> -    SKIP("virtual TPM manager must be started to run this test; might "
> -         "need /dev/tpm0")
> -
> -def vtpm_cleanup(domName):
> -    traceCommand("/etc/xen/scripts/vtpm-delete "
> -                 "`xenstore-read /local/domain/0/backend/vtpm/%s/0/uuid`" %
> -                 str(domid(domName)))
> -
> -def vtpm_cleanup(uuid):
> -    from xen.xm import main
> -    if main.serverType != main.SERVER_XEN_API:
> -        traceCommand("/etc/xen/scripts/vtpm-delete %s" % uuid)
> -
> -def vtpm_get_uuid(domainid):
> -    s, o = traceCommand("xenstore-read "
> -                        "/local/domain/0/backend/vtpm/%s/0/uuid" % domainid)
> -    return o
> --
> 1.7.10.4
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:05:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:05:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYI3N-0006Nu-Od; Tue, 13 Nov 2012 15:05:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TYHxC-0005lh-Ty
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 14:59:08 +0000
Received: from [85.158.143.35:25878] by server-3.bemta-4.messagelabs.com id
	91/14-06841-A3062A05; Tue, 13 Nov 2012 14:59:06 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-10.tower-21.messagelabs.com!1352818741!10180088!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=Mail larger than max spam size
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18927 invoked from network); 13 Nov 2012 14:59:02 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-10.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 14:59:02 -0000
Received: from ([128.244.198.91])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157225253;
	Tue, 13 Nov 2012 09:58:46 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas2.dom1.jhuapl.edu ([128.244.198.91]) with mapi; Tue, 13 Nov 2012
	09:58:45 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Ian Campbell <Ian.Campbell@citrix.com>
Date: Tue, 13 Nov 2012 09:58:44 -0500
Thread-Topic: [PATCH VTPM 6/9] Remove the vtpm process model
Thread-Index: Ac3BjIxWUEqURI64SYK1F0IkeLy95AAIq4wg
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48A229F471@aplesstripe.dom1.jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352803755.7491.47.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
X-Mailman-Approved-At: Tue, 13 Nov 2012 15:05:28 +0000
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Should I have removed vtpm from xm also? I left it alone because xm is depcrecated.

-----Original Message-----
From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
Sent: Tuesday, November 13, 2012 5:49 AM
To: Fioravante, Matthew E.
Cc: xen-devel@lists.xen.org; Stefano Stabellini
Subject: Re: [PATCH VTPM 6/9] Remove the vtpm process model

On Thu, 2012-11-01 at 20:35 +0000, Matthew Fioravante wrote:
> Remove the old vtpm process model. It doesn't work very
> well and is no longer supported.
>
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

>
> diff --git a/tools/Makefile b/tools/Makefile
> index d8c8cc0..2ca43b9 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -18,8 +18,6 @@ SUBDIRS-$(CONFIG_XCUTILS) += xcutils
>  SUBDIRS-$(CONFIG_X86) += firmware
>  SUBDIRS-y += console
>  SUBDIRS-y += xenmon
> -SUBDIRS-$(VTPM_TOOLS) += vtpm_manager
> -SUBDIRS-$(VTPM_TOOLS) += vtpm
>  SUBDIRS-y += xenstat
>  SUBDIRS-$(CONFIG_Linux) += $(SUBDIRS-libaio)
>  SUBDIRS-$(CONFIG_Linux) += memshr
> diff --git a/tools/blktap2/drivers/hashtable.c b/tools/blktap2/drivers/hashtable.c
> index 631306b..90a6b85 100644
> --- a/tools/blktap2/drivers/hashtable.c
> +++ b/tools/blktap2/drivers/hashtable.c
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/xenstore/hashtable.c
> - *  - tools/vtpm_manager/util/hashtable.c
>   */
>
>  #include "hashtable.h"
> diff --git a/tools/blktap2/drivers/hashtable.h b/tools/blktap2/drivers/hashtable.h
> index 89aa3dc..56ca053 100644
> --- a/tools/blktap2/drivers/hashtable.h
> +++ b/tools/blktap2/drivers/hashtable.h
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/xenstore/hashtable.h
> - *  - tools/vtpm_manager/util/hashtable.h
>   */
>
>  #ifndef __HASHTABLE_CWC22_H__
> diff --git a/tools/blktap2/drivers/hashtable_itr.c b/tools/blktap2/drivers/hashtable_itr.c
> index 402e06b..731917c 100644
> --- a/tools/blktap2/drivers/hashtable_itr.c
> +++ b/tools/blktap2/drivers/hashtable_itr.c
> @@ -1,10 +1,5 @@
>  /* Copyright (C) 2002, 2004 Christopher Clark  <firstname.lastname@cl.cam.ac.uk> */
>
> -/*
> - * There are duplicates of this code in:
> - *  - tools/vtpm_manager/util/hashtable_itr.c
> - */
> -
>  #include "hashtable.h"
>  #include "hashtable_private.h"
>  #include "hashtable_itr.h"
> diff --git a/tools/blktap2/drivers/hashtable_itr.h b/tools/blktap2/drivers/hashtable_itr.h
> index 3d80638..81da838 100644
> --- a/tools/blktap2/drivers/hashtable_itr.h
> +++ b/tools/blktap2/drivers/hashtable_itr.h
> @@ -1,10 +1,5 @@
>  /* Copyright (C) 2002, 2004 Christopher Clark <firstname.lastname@cl.cam.ac.uk> */
>
> -/*
> - * There are duplicates of this code in:
> - *  - tools/vtpm_manager/util/hashtable_itr.h
> - */
> -
>  #ifndef __HASHTABLE_ITR_CWC22__
>  #define __HASHTABLE_ITR_CWC22__
>  #include "hashtable.h"
> diff --git a/tools/blktap2/drivers/hashtable_private.h b/tools/blktap2/drivers/hashtable_private.h
> index 5a13a65..954ecc3 100644
> --- a/tools/blktap2/drivers/hashtable_private.h
> +++ b/tools/blktap2/drivers/hashtable_private.h
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/xenstore/hashtable_private.h
> - *  - tools/vtpm_manager/util/hashtable_private.h
>   */
>
>  #ifndef __HASHTABLE_PRIVATE_CWC22_H__
> diff --git a/tools/configure.ac b/tools/configure.ac
> index e708f01..586313d 100644
> --- a/tools/configure.ac
> +++ b/tools/configure.ac
> @@ -40,7 +40,6 @@ m4_include([m4/fetcher.m4])
>  # Enable/disable options
>  AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
>  AX_ARG_DEFAULT_ENABLE([monitors], [Disable xenstat and xentop monitoring tools])
> -AX_ARG_DEFAULT_DISABLE([vtpm], [Enable Virtual Trusted Platform Module])
>  AX_ARG_DEFAULT_DISABLE([xenapi], [Enable Xen API Bindings])
>  AX_ARG_DEFAULT_ENABLE([ocamltools], [Disable Ocaml tools])
>  AX_ARG_DEFAULT_DISABLE([miniterm], [Enable miniterm])
> diff --git a/tools/examples/README b/tools/examples/README
> index 5b0314e..2225d5c 100644
> --- a/tools/examples/README
> +++ b/tools/examples/README
> @@ -25,13 +25,7 @@ vif-bridge          - virtual network start/stop script in bridged mode
>  vif-common.sh       - sourced by vif-bridge
>  vif-nat             - xen virtual network start/stop script in NAT mode
>  vif-route           - xen virtual network start/stop script in routed mode
> -vtpm                - called by xen-backend.agent to bind/unbind vTPM devices
> -vtpm-common.sh      - common code for vTPM handling
> -vtpm-delete         - remove an entry from the vTPM table given the
> -                      domain's name
> -vtpm-hotplug-common.sh - sourced by vtpm
> -vtpm-migration.sh   - sourced by external-device-migrate
> -xen-backend.agent   - calls block, vif-*, vtpm scripts to add, remove, hotplug
> +xen-backend.agent   - calls block, vif-* scripts to add, remove, hotplug
>                        devices
>  xen-backend.rules   - hotplug script rules
>  xend-config.sxp     - default xend configuration file
> diff --git a/tools/examples/xmexample.pv-grub b/tools/examples/xmexample.pv-grub
> index 85f847c..e04e6c1 100644
> --- a/tools/examples/xmexample.pv-grub
> +++ b/tools/examples/xmexample.pv-grub
> @@ -105,20 +105,6 @@ disk = [ 'phy:hda1,hda1,w' ]
>  # configured in xend-config.sxp.
>
>  #----------------------------------------------------------------------------
> -# Define to which TPM instance the user domain should communicate.
> -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> -# where INSTANCE indicates the instance number of the TPM the VM
> -# should be talking to and DOM provides the domain where the backend
> -# is located.
> -# Note that no two virtual machines should try to connect to the same
> -# TPM instance. The handling of all TPM instances does require
> -# some management effort in so far that VM configration files (and thus
> -# a VM) should be associated with a TPM instance throughout the lifetime
> -# of the VM / VM configuration file. The instance number must be
> -# greater or equal to 1.
> -#vtpm = [ 'instance=1,backend=0' ]
> -
> -#----------------------------------------------------------------------------
>  # Configure the behaviour when a domain exits.  There are three 'reasons'
>  # for a domain to stop: poweroff, reboot, and crash.  For each of these you
>  # may specify:
> diff --git a/tools/examples/xmexample1 b/tools/examples/xmexample1
> index 330aaf0..c951200 100644
> --- a/tools/examples/xmexample1
> +++ b/tools/examples/xmexample1
> @@ -101,20 +101,6 @@ disk = [ 'phy:hda1,hda1,w' ]
>  # configured in xend-config.sxp.
>
>  #----------------------------------------------------------------------------
> -# Define to which TPM instance the user domain should communicate.
> -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> -# where INSTANCE indicates the instance number of the TPM the VM
> -# should be talking to and DOM provides the domain where the backend
> -# is located.
> -# Note that no two virtual machines should try to connect to the same
> -# TPM instance. The handling of all TPM instances does require
> -# some management effort in so far that VM configration files (and thus
> -# a VM) should be associated with a TPM instance throughout the lifetime
> -# of the VM / VM configuration file. The instance number must be
> -# greater or equal to 1.
> -#vtpm = [ 'instance=1,backend=0' ]
> -
> -#----------------------------------------------------------------------------
>  # Set the kernel command line for the new domain.
>  # You only need to define the IP parameters and hostname if the domain's
>  # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
> diff --git a/tools/examples/xmexample2 b/tools/examples/xmexample2
> index 4e5eb3d..8c5137e 100644
> --- a/tools/examples/xmexample2
> +++ b/tools/examples/xmexample2
> @@ -137,20 +137,6 @@ disk = [ 'phy:sda%d,sda1,w' % (7+vmid),
>  # configured in xend-config.sxp.
>
>  #----------------------------------------------------------------------------
> -# Define to which TPM instance the user domain should communicate.
> -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> -# where INSTANCE indicates the instance number of the TPM the VM
> -# should be talking to and DOM provides the domain where the backend
> -# is located.
> -# Note that no two virtual machines should try to connect to the same
> -# TPM instance. The handling of all TPM instances does require
> -# some management effort in so far that VM configration files (and thus
> -# a VM) should be associated with a TPM instance throughout the lifetime
> -# of the VM / VM configuration file. The instance number must be
> -# greater or equal to 1.
> -#vtpm = ['instance=%d,backend=0' % (vmid) ]
> -
> -#----------------------------------------------------------------------------
>  # Set the kernel command line for the new domain.
>  # You only need to define the IP parameters and hostname if the domain's
>  # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
> diff --git a/tools/examples/xmexample3 b/tools/examples/xmexample3
> index dc22ce1..ae799f9 100644
> --- a/tools/examples/xmexample3
> +++ b/tools/examples/xmexample3
> @@ -122,20 +122,6 @@ disk = [ 'phy:hda%d,hda1,w' % (vmid)]
>  # configured in xend-config.sxp.
>
>  #----------------------------------------------------------------------------
> -# Define to which TPM instance the user domain should communicate.
> -# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM'
> -# where INSTANCE indicates the instance number of the TPM the VM
> -# should be talking to and DOM provides the domain where the backend
> -# is located.
> -# Note that no two virtual machines should try to connect to the same
> -# TPM instance. The handling of all TPM instances does require
> -# some management effort in so far that VM configration files (and thus
> -# a VM) should be associated with a TPM instance throughout the lifetime
> -# of the VM / VM configuration file. The instance number must be
> -# greater or equal to 1.
> -#vtpm = ['instance=%d,backend=0' % (vmid) ]
> -
> -#----------------------------------------------------------------------------
>  # Set the kernel command line for the new domain.
>  # You only need to define the IP parameters and hostname if the domain's
>  # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
> diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
> index 0166790..0605559 100644
> --- a/tools/hotplug/Linux/Makefile
> +++ b/tools/hotplug/Linux/Makefile
> @@ -18,14 +18,12 @@ XEN_SCRIPTS += vif-setup
>  XEN_SCRIPTS += block
>  XEN_SCRIPTS += block-enbd block-nbd
>  XEN_SCRIPTS += blktap
> -XEN_SCRIPTS += vtpm vtpm-delete
>  XEN_SCRIPTS += xen-hotplug-cleanup
>  XEN_SCRIPTS += external-device-migrate
>  XEN_SCRIPTS += vscsi
>  XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
>  XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
> -XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
> -XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
> +XEN_SCRIPT_DATA += block-common.sh
>
>  UDEV_RULES_DIR = $(CONFIG_DIR)/udev
>  UDEV_RULES = xen-backend.rules xend.rules
> diff --git a/tools/hotplug/Linux/vtpm b/tools/hotplug/Linux/vtpm
> deleted file mode 100644
> index 38a4532..0000000
> --- a/tools/hotplug/Linux/vtpm
> +++ /dev/null
> @@ -1,22 +0,0 @@
> -#!/bin/bash
> -
> -dir=$(dirname "$0")
> -. "$dir/vtpm-hotplug-common.sh"
> -
> -vtpm_fatal_error=0
> -
> -case "$command" in
> -  add)
> -    vtpm_create_instance
> -  ;;
> -  remove)
> -    vtpm_remove_instance
> -  ;;
> -esac
> -
> -if [ $vtpm_fatal_error -eq 0 ]; then
> -       log debug "Successful vTPM operation '$command'."
> -       success
> -else
> -       fatal "Error while executing vTPM operation '$command'."
> -fi
> diff --git a/tools/hotplug/Linux/vtpm-common.sh b/tools/hotplug/Linux/vtpm-common.sh
> deleted file mode 100644
> index d0d7935..0000000
> --- a/tools/hotplug/Linux/vtpm-common.sh
> +++ /dev/null
> @@ -1,448 +0,0 @@
> -#
> -# Copyright (c) 2005 IBM Corporation
> -# Copyright (c) 2005 XenSource Ltd.
> -#
> -# 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
> -#
> -
> -dir=$(dirname "$0")
> -. "$dir/logging.sh"
> -. "$dir/locking.sh"
> -
> -VTPMDB="/var/vtpm/vtpm.db"
> -
> -#In the vtpm-impl file some commands should be defined:
> -#      vtpm_create, vtpm_setup, vtpm_start, etc. (see below)
> -if [ -r "$dir/vtpm-impl.alt" ]; then
> -       . "$dir/vtpm-impl.alt"
> -elif [ -r "$dir/vtpm-impl" ]; then
> -       . "$dir/vtpm-impl"
> -else
> -       function vtpm_create () {
> -               true
> -       }
> -       function vtpm_setup() {
> -               true
> -       }
> -       function vtpm_start() {
> -               true
> -       }
> -       function vtpm_suspend() {
> -               true
> -       }
> -       function vtpm_resume() {
> -               true
> -       }
> -       function vtpm_delete() {
> -               true
> -       }
> -       function vtpm_migrate() {
> -               echo "Error: vTPM migration accross machines not implemented."
> -       }
> -       function vtpm_migrate_local() {
> -               echo "Error: local vTPM migration not supported"
> -       }
> -       function vtpm_migrate_recover() {
> -               true
> -       }
> -fi
> -
> -
> -#Find the instance number for the vtpm given the name of the domain
> -# Parameters
> -# - vmname : the name of the vm
> -# Return value
> -#  Returns '0' if instance number could not be found, otherwise
> -#  it returns the instance number in the variable 'instance'
> -function vtpmdb_find_instance () {
> -       local vmname ret instance
> -       vmname=$1
> -       ret=0
> -
> -       instance=$(cat $VTPMDB |                   \
> -                 awk -vvmname=$vmname             \
> -                 '{                               \
> -                    if ( 1 != index($1,"#")) {    \
> -                      if ( $1 == vmname ) {       \
> -                        print $2;                 \
> -                        exit;                     \
> -                      }                           \
> -                    }                             \
> -                  }')
> -       if [ "$instance" != "" ]; then
> -               ret=$instance
> -       fi
> -       echo "$ret"
> -}
> -
> -
> -# Check whether a particular instance number is still available
> -# returns "0" if it is not available, "1" otherwise.
> -function vtpmdb_is_free_instancenum () {
> -       local instance instances avail i
> -       instance=$1
> -       avail=1
> -       #Allowed instance number range: 1-255
> -       if [ $instance -eq 0 -o $instance -gt 255 ]; then
> -               avail=0
> -       else
> -               instances=$(cat $VTPMDB |                \
> -                          awk                          \
> -                          '{                            \
> -                              if (1 != index($1,"#")) { \
> -                                printf("%s ",$2);       \
> -                              }                         \
> -                           }')
> -               for i in $instances; do
> -                       if [ $i -eq $instance ]; then
> -                               avail=0
> -                               break
> -                       fi
> -               done
> -       fi
> -       echo "$avail"
> -}
> -
> -
> -# Get an available instance number given the database
> -# Returns an unused instance number
> -function vtpmdb_get_free_instancenum () {
> -       local ctr instances don found
> -       instances=$(cat $VTPMDB |                \
> -                  awk                          \
> -                  '{                            \
> -                      if (1 != index($1,"#")) { \
> -                        printf("%s ",$2);       \
> -                      }                         \
> -                   }')
> -       ctr=1
> -       don=0
> -       while [ $don -eq 0 ]; do
> -               found=0
> -               for i in $instances; do
> -                       if [ $i -eq $ctr ]; then
> -                               found=1;
> -                               break;
> -                       fi
> -               done
> -
> -               if [ $found -eq 0 ]; then
> -                       don=1
> -                       break
> -               fi
> -               let ctr=ctr+1
> -       done
> -       echo "$ctr"
> -}
> -
> -
> -# Add a domain name and instance number to the DB file
> -function vtpmdb_add_instance () {
> -       local res vmname inst
> -       vmname=$1
> -       inst=$2
> -
> -       if [ ! -f $VTPMDB ]; then
> -               echo "#Database for VM to vTPM association" > $VTPMDB
> -               echo "#1st column: domain name" >> $VTPMDB
> -               echo "#2nd column: TPM instance number" >> $VTPMDB
> -       fi
> -       res=$(vtpmdb_validate_entry $vmname $inst)
> -       if [ $res -eq 0 ]; then
> -               echo "$vmname $inst" >> $VTPMDB
> -       fi
> -}
> -
> -
> -#Validate whether an entry is the same as passed to this
> -#function
> -function vtpmdb_validate_entry () {
> -       local res rc vmname inst
> -       rc=0
> -       vmname=$1
> -       inst=$2
> -
> -       res=$(cat $VTPMDB |            \
> -            awk -vvmname=$vmname     \
> -                 -vinst=$inst         \
> -            '{                        \
> -                if ( 1 == index($1,"#")) {\
> -                } else                \
> -                if ( $1 == vmname &&  \
> -                     $2 == inst) {    \
> -                   printf("1");       \
> -                   exit;              \
> -                } else                \
> -                if ( $1 == vmname ||  \
> -                     $2 == inst) {    \
> -                   printf("2");       \
> -                   exit;              \
> -                }                     \
> -            }')
> -
> -       if [ "$res" == "1" ]; then
> -               rc=1
> -       elif [ "$res" == "2" ]; then
> -               rc=2
> -       fi
> -       echo "$rc"
> -}
> -
> -
> -#Remove an entry from the vTPM database given its domain name
> -#and instance number
> -function vtpmdb_remove_entry () {
> -       local vmname instance VTPMDB_TMP
> -       vmname=$1
> -       instance=$2
> -       VTPMDB_TMP="$VTPMDB".tmp
> -
> -       $(cat $VTPMDB |            \
> -        awk -vvmname=$vmname     \
> -        '{                        \
> -           if ( $1 != vmname ) {  \
> -             print $0;            \
> -           }                      \
> -        '} > $VTPMDB_TMP)
> -       if [ -e $VTPMDB_TMP ]; then
> -               mv -f $VTPMDB_TMP $VTPMDB
> -               vtpm_delete $instance
> -       else
> -               log err "Error creating temporary file '$VTPMDB_TMP'."
> -       fi
> -}
> -
> -
> -# Find the reason for the creation of this device:
> -# Returns 'resume' or 'create'
> -function vtpm_get_create_reason () {
> -       local resume
> -       resume=$(xenstore_read $XENBUS_PATH/resume)
> -       if [ "$resume" == "True" ]; then
> -               echo "resume"
> -       else
> -               echo "create"
> -       fi
> -}
> -
> -
> -#Create a vTPM instance
> -# If no entry in the TPM database is found, the instance is
> -# created and an entry added to the database.
> -function vtpm_create_instance () {
> -       local res instance domname reason uuid
> -       uuid=$(xenstore_read "$XENBUS_PATH"/uuid)
> -       reason=$(vtpm_get_create_reason)
> -
> -       claim_lock vtpmdb
> -
> -       instance="0"
> -
> -       if [ "$uuid" != "" ]; then
> -               instance=$(vtpmdb_find_instance $uuid)
> -       fi
> -       if [ "$instance" == "0" ]; then
> -               domname=$(xenstore_read "$XENBUS_PATH"/domain)
> -               instance=$(vtpmdb_find_instance $domname)
> -       fi
> -
> -       if [ "$instance" == "0" -a "$reason" != "create" ]; then
> -               release_lock vtpmdb
> -               return
> -       fi
> -
> -       if [ "$instance" == "0" ]; then
> -               #Try to give the preferred instance to the domain
> -               instance=$(xenstore_read "$XENBUS_PATH"/pref_instance)
> -               if [ "$instance" != "" ]; then
> -                       res=$(vtpmdb_is_free_instancenum $instance)
> -                       if [ $res -eq 0 ]; then
> -                               instance=$(vtpmdb_get_free_instancenum)
> -                       fi
> -               else
> -                       instance=$(vtpmdb_get_free_instancenum)
> -               fi
> -
> -               vtpm_create $instance
> -
> -               if [ $vtpm_fatal_error -eq 0 ]; then
> -                       if [ "$uuid" != "" ]; then
> -                               vtpmdb_add_instance $uuid $instance
> -                       else
> -                               vtpmdb_add_instance $domname $instance
> -                       fi
> -               fi
> -       else
> -               if [ "$reason" == "resume" ]; then
> -                       vtpm_resume $instance
> -               else
> -                       vtpm_start $instance
> -               fi
> -       fi
> -
> -       release_lock vtpmdb
> -
> -       xenstore_write $XENBUS_PATH/instance $instance
> -}
> -
> -
> -#Remove an instance when a VM is terminating or suspending.
> -#Since it is assumed that the VM will appear again, the
> -#entry is kept in the VTPMDB file.
> -function vtpm_remove_instance () {
> -       local instance reason domname uuid
> -       #Stop script execution quietly if path does not exist (anymore)
> -       xenstore-exists "$XENBUS_PATH"/domain
> -       uuid=$(xenstore_read "$XENBUS_PATH"/uuid)
> -
> -       claim_lock vtpmdb
> -
> -       instance="0"
> -
> -       if [ "$uuid" != "" ]; then
> -               instance=$(vtpmdb_find_instance $uuid)
> -       fi
> -
> -       if [ "$instance" == "0" ]; then
> -               domname=$(xenstore_read "$XENBUS_PATH"/domain)
> -               instance=$(vtpmdb_find_instance $domname)
> -       fi
> -
> -       if [ "$instance" != "0" ]; then
> -               vtpm_suspend $instance
> -       fi
> -
> -       release_lock vtpmdb
> -}
> -
> -
> -#Remove an entry in the VTPMDB file given the domain's name
> -#1st parameter: The name of the domain
> -function vtpm_delete_instance () {
> -       local instance
> -
> -       claim_lock vtpmdb
> -
> -       instance=$(vtpmdb_find_instance $1)
> -       if [ "$instance" != "0" ]; then
> -               vtpmdb_remove_entry $1 $instance
> -       fi
> -
> -       release_lock vtpmdb
> -}
> -
> -# Determine whether the given address is local to this machine
> -# Return values:
> -#  "-1" : the given machine name is invalid
> -#  "0"  : this is not an address of this machine
> -#  "1"  : this is an address local to this machine
> -function vtpm_isLocalAddress() {
> -       local addr res
> -       addr=$(ping $1 -c 1 |  \
> -              awk '{ print substr($3,2,length($3)-2); exit }')
> -       if [ "$addr" == "" ]; then
> -               echo "-1"
> -               return
> -       fi
> -       res=$(ifconfig | grep "inet addr" |  \
> -            awk -vaddr=$addr               \
> -            '{                              \
> -               if ( addr == substr($2, 6)) {\
> -                 print "1";                 \
> -               }                            \
> -            }'                              \
> -           )
> -       if [ "$res" == "" ]; then
> -               echo "0"
> -               return
> -       fi
> -       echo "1"
> -}
> -
> -# Perform a migration step. This function differentiates between migration
> -# to the local host or to a remote machine.
> -# Parameters:
> -# 1st: destination host to migrate to
> -# 2nd: name of the domain to migrate
> -# 3rd: the migration step to perform
> -function vtpm_migration_step() {
> -       local res=$(vtpm_isLocalAddress $1)
> -       if [ "$res" == "0" ]; then
> -               vtpm_migrate $1 $2 $3
> -       else
> -               vtpm_migrate_local
> -       fi
> -}
> -
> -# Recover from migration due to an error. This function differentiates
> -# between migration to the local host or to a remote machine.
> -# Parameters:
> -# 1st: destination host the migration was going to
> -# 2nd: name of the domain that was to be migrated
> -# 3rd: the last successful migration step that was done
> -function vtpm_recover() {
> -       local res
> -       res=$(vtpm_isLocalAddress $1)
> -       if [ "$res" == "0" ]; then
> -               vtpm_migrate_recover $1 $2 $3
> -       fi
> -}
> -
> -
> -#Determine the domain id given a domain's name.
> -#1st parameter: name of the domain
> -#return value: domain id  or -1 if domain id could not be determined
> -function vtpm_domid_from_name () {
> -       local id name ids
> -       ids=$(xenstore-list /local/domain)
> -       for id in $ids; do
> -               name=$(xenstore-read /local/domain/$id/name)
> -               if [ "$name" == "$1" ]; then
> -                       echo "$id"
> -                       return
> -               fi
> -       done
> -       echo "-1"
> -}
> -
> -#Determine the virtual TPM's instance number using the domain ID.
> -#1st parm: domain ID
> -function vtpm_uuid_by_domid() {
> -       echo $(xenstore-read /local/domain/0/backend/vtpm/$1/0/uuid)
> -}
> -
> -
> -# Determine the vTPM's UUID by the name of the VM
> -function vtpm_uuid_from_vmname() {
> -       local domid=$(vtpm_domid_from_name $1)
> -       if [ "$domid" != "-1" ]; then
> -               echo $(vtpm_uuid_by_domid $domid)
> -               return
> -       fi
> -       echo ""
> -}
> -
> -#Add a virtual TPM instance number and its associated domain name
> -#to the VTPMDB file and activate usage of this virtual TPM instance
> -#by writing the instance number into the xenstore
> -#1st parm: name of virtual machine
> -#2nd parm: instance of associated virtual TPM
> -function vtpm_add_and_activate() {
> -       local domid=$(vtpm_domid_from_name $1)
> -       local vtpm_uuid=$(vtpm_uuid_from_vmname $1)
> -       if [ "$vtpm_uuid" != "" -a "$domid" != "-1" ]; then
> -               vtpmdb_add_instance $vtpm_uuid $2
> -               xenstore-write backend/vtpm/$domid/0/instance $2
> -       fi
> -}
> diff --git a/tools/hotplug/Linux/vtpm-delete b/tools/hotplug/Linux/vtpm-delete
> deleted file mode 100644
> index b75b95b..0000000
> --- a/tools/hotplug/Linux/vtpm-delete
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -#!/bin/bash
> -
> -# This scripts must be called the following way:
> -# vtpm-delete <vtpm uuid>
> -# or
> -# vtpm-delete --vmname <vm name>
> -
> -dir=$(dirname "$0")
> -. "$dir/vtpm-common.sh"
> -
> -if [ "$1" == "--vmname" ]; then
> -       vtpm_uuid=$(vtpm_uuid_from_vmname $2)
> -       if [ "$vtpm_uuid" != "" ];then
> -               vtpm_delete_instance $vtpm_uuid
> -       fi
> -else
> -       vtpm_delete_instance $1
> -fi
> diff --git a/tools/hotplug/Linux/vtpm-hotplug-common.sh b/tools/hotplug/Linux/vtpm-hotplug-common.sh
> deleted file mode 100644
> index 9fd35e7..0000000
> --- a/tools/hotplug/Linux/vtpm-hotplug-common.sh
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -#
> -# Copyright (c) 2005 IBM Corporation
> -# Copyright (c) 2005 XenSource Ltd.
> -#
> -# 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
> -#
> -
> -dir=$(dirname "$0")
> -. "$dir/xen-hotplug-common.sh"
> -
> -findCommand "$@"
> -if [ "$command" != "online" ]  &&
> -   [ "$command" != "offline" ] &&
> -   [ "$command" != "add" ]     &&
> -   [ "$command" != "remove" ]
> -then
> -       log err "Invalid command: $command"
> -       exit 1
> -fi
> -
> -
> -XENBUS_PATH="${XENBUS_PATH:?}"
> -
> -. "$dir/vtpm-common.sh"
> diff --git a/tools/hotplug/Linux/vtpm-impl b/tools/hotplug/Linux/vtpm-impl
> deleted file mode 100644
> index 4f9a1fd..0000000
> --- a/tools/hotplug/Linux/vtpm-impl
> +++ /dev/null
> @@ -1,208 +0,0 @@
> -#!/bin/bash
> -# ===================================================================
> -#
> -# Copyright (c) 2005, Intel Corp.
> -# All rights reserved.
> -#
> -# Redistribution and use in source and binary forms, with or without
> -# modification, are permitted provided that the following conditions
> -# are met:
> -#
> -#   * Redistributions of source code must retain the above copyright
> -#     notice, this list of conditions and the following disclaimer.
> -#   * Redistributions in binary form must reproduce the above
> -#     copyright notice, this list of conditions and the following
> -#     disclaimer in the documentation and/or other materials provided
> -#     with the distribution.
> -#   * Neither the name of Intel Corporation nor the names of its
> -#     contributors may be used to endorse or promote products derived
> -#     from this software without specific prior written permission.
> -#
> -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -# OF THE POSSIBILITY OF SUCH DAMAGE.
> -# ===================================================================
> -
> -#            |        SRC        |    TAG  |      CMD SIZE     |        ORD       |mtype|strt
> -TPM_CMD_OPEN=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x11\\x01\\x00\\x00\\x01\\x01\\x01
> -TPM_CMD_RESM=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x11\\x01\\x00\\x00\\x01\\x01\\x02
> -TPM_CMD_CLOS=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x0e\\x01\\x00\\x00\\x02
> -TPM_CMD_DELE=\\x00\\x00\\x00\\x00\\x01\\xc1\\x00\\x00\\x00\\x0e\\x01\\x00\\x00\\x03
> -
> -TPM_TYPE_PVM=\\x01
> -TPM_TYPE_HVM=\\x02
> -
> -TPM_SUCCESS=00000000
> -
> -TX_VTPM_MANAGER=/var/vtpm/fifos/from_console.fifo
> -RX_VTPM_MANAGER=/var/vtpm/fifos/to_console.fifo
> -
> -VTPM_MIG=/usr/bin/vtpm_migrator
> -
> -# -------------------- Helpers for binary streams -----------
> -
> -function str_to_hex32() {
> - printf "%0.8x" $1
> -}
> -
> -function hex32_to_bin() {
> - local inst=$(str_to_hex32 $1);
> -
> - local n1=`echo $inst | sed 's/\(..\)....../\\\\x\1/'`
> - local n2=`echo $inst | sed 's/..\(..\)..../\\\\x\1/'`
> - local n3=`echo $inst | sed 's/....\(..\)../\\\\x\1/'`
> - local n4=`echo $inst | sed 's/......\(..\)/\\\\x\1/'`
> -
> - echo "$n1$n2$n3$n4"
> -}
> -
> -function vtpm_manager_cmd() {
> - local cmd=$1;
> - local inst=$2;
> - local inst_bin=$(hex32_to_bin $inst);
> -
> - claim_lock vtpm_mgr
> -
> - #send cmd to vtpm_manager
> - printf "$cmd$inst_bin" > $TX_VTPM_MANAGER
> -
> - #recv response
> - set +e
> - local resp_hex=`dd skip=10 bs=1 count=4 if=$RX_VTPM_MANAGER 2> /dev/null | xxd -ps`
> - set -e
> -
> - release_lock vtpm_mgr
> -
> - #return whether the command was successful
> - if [ $resp_hex -ne $TPM_SUCCESS ]; then
> -   vtpm_fatal_error=1
> -   false
> -  else
> -   true
> - fi
> -}
> -
> -# Helper to get vm type to pass to vtpm_manager open/resume
> -function vtpm_get_type() {
> - local inst=$(xenstore_read $XENBUS_PATH/frontend-id)
> - local vm=$(xenstore_read /local/domain/$inst/vm)
> - if [ "$vm" != "" ]; then
> -  local ostype=$(xenstore-read $vm/image/ostype)
> -  if [ "$ostype" == "hvm" ]; then
> -   echo $TPM_TYPE_HVM;
> -  else
> -   echo $TPM_TYPE_PVM;
> -  fi
> - fi
> -}
> -
> -# ------------------ Command handlers -----------------
> -
> -# Create new vtpm instance & set it up for use
> -function vtpm_create () {
> - # Creation is handled implicitly by the manager on first setup
> - # so just set it up for use
> - $(vtpm_start $1)
> -}
> -
> -# Setup vtpm instance for use.
> -function vtpm_start() {
> - local vmtype=$(vtpm_get_type);
> - $(vtpm_manager_cmd $TPM_CMD_OPEN$vmtype $1)
> -}
> -
> -function vtpm_resume() {
> - local vmtype=$(vtpm_get_type);
> - $(vtpm_manager_cmd $TPM_CMD_RESM$vmtype $1)
> -}
> -
> -# Reset the vtpm AKA clear PCRs
> -function vtpm_reset() {
> - #not used by current implemenation
> - true
> -}
> -
> -# Shutdown the vtpm while the vm is down
> -# This could be a suspend of shutdown
> -# we cannot distinquish, so save the state
> -# and decide on startup if we should keep is
> -function vtpm_suspend() {
> - $(vtpm_manager_cmd $TPM_CMD_CLOS $1)
> -}
> -
> -
> -function vtpm_delete() {
> - local inst=$1
> - if $(vtpm_manager_cmd $TPM_CMD_DELE $inst); then
> -   rm -f /var/vtpm/vtpm_dm_$1.data
> -   true
> - else
> -   vtpm_fatal_error=1
> -   false
> - fi
> -}
> -
> -# Perform a migration step. This function differentiates between migration
> -# to the local host or to a remote machine.
> -# Parameters:
> -# 1st: destination host to migrate to
> -# 2nd: name of the domain to migrate
> -# 3rd: the migration step to perform
> -function vtpm_migrate() {
> - local instance res
> -
> - instance=$(vtpmdb_find_instance $2)
> - if [ "$instance" == "" ]; then
> -  log err "VTPM Migratoin failed. Unable to translation of domain name"
> -  echo "Error: VTPM Migration failed while looking up instance number"
> - fi
> -
> - case "$3" in
> -  0)
> -   #Incicate migration supported
> -   echo "0"
> -  ;;
> -
> -  1)
> -   # Get Public Key from Destination
> -   # Call vtpm_manager's migration part 1
> -   claim_lock vtpm_mgr
> -   $VTPM_MIG $1 $2 $instance $3
> -   release_lock vtpm_mgr
> -  ;;
> -
> -  2)
> -   # Call manager's migration step 2 and send result to destination
> -   # If successful remove from db
> -   claim_lock vtpm_mgr
> -   $VTPM_MIG $1 $2 $instance $3
> -   release_lock vtpm_mgr
> -  ;;
> -
> -  3)
> -   if `ps x | grep "$VTPM_MIG $1"`; then
> -    log err "VTPM Migration failed to complete."
> -    echo "Error: VTPM Migration failed to complete."
> -   fi
> -  ;;
> - esac
> -
> -}
> -
> -
> -function vtpm_migrate_recover() {
> - echo "Error: Recovery not supported yet"
> -}
> -
> -function vtpm_migrate_local() {
> - echo "Error: local vTPM migration not supported"
> -}
> diff --git a/tools/hotplug/Linux/vtpm-migration.sh b/tools/hotplug/Linux/vtpm-migration.sh
> deleted file mode 100644
> index 7e38ae2..0000000
> --- a/tools/hotplug/Linux/vtpm-migration.sh
> +++ /dev/null
> @@ -1,19 +0,0 @@
> -#
> -# Copyright (c) 2005 IBM Corporation
> -#
> -# 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
> -#
> -
> -dir=$(dirname "$0")
> -. "$dir/vtpm-common.sh"
> diff --git a/tools/hotplug/Linux/xen-backend.rules b/tools/hotplug/Linux/xen-backend.rules
> index c591a3f..a0d409e 100644
> --- a/tools/hotplug/Linux/xen-backend.rules
> +++ b/tools/hotplug/Linux/xen-backend.rules
> @@ -1,6 +1,5 @@
>  SUBSYSTEM=="xen-backend", KERNEL=="tap*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/blktap $env{ACTION}"
>  SUBSYSTEM=="xen-backend", KERNEL=="vbd*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/block $env{ACTION}"
> -SUBSYSTEM=="xen-backend", KERNEL=="vtpm*", RUN+="/etc/xen/scripts/vtpm $env{ACTION}"
>  SUBSYSTEM=="xen-backend", KERNEL=="vif2-*", RUN+="/etc/xen/scripts/vif2 $env{ACTION}"
>  SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="online", RUN+="/etc/xen/scripts/vif-setup online type_if=vif"
>  SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="offline", RUN+="/etc/xen/scripts/vif-setup offline type_if=vif"
> diff --git a/tools/vtpm/Makefile b/tools/vtpm/Makefile
> deleted file mode 100644
> index 7b3efa5..0000000
> --- a/tools/vtpm/Makefile
> +++ /dev/null
> @@ -1,74 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../..
> -
> -# Base definitions and rules
> -include $(XEN_ROOT)/tools/vtpm/Rules.mk
> -
> -# Dir name for emulator (as dom0 tpm driver)
> -TPM_EMULATOR_DIR = tpm_emulator
> -# Dir name for vtpm instance
> -VTPM_DIR = vtpm
> -ORIG_DIR = orig
> -
> -# Emulator tarball name
> -TPM_EMULATOR_NAME = tpm_emulator-0.5.1
> -TPM_EMULATOR_TARFILE = $(TPM_EMULATOR_NAME).tar.gz
> -
> -GMP_HEADER = /usr/include/gmp.h
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: build_sub
> -
> -.PHONY: install
> -install: build
> -       $(MAKE) -C $(VTPM_DIR) install-recursive
> -
> -.PHONY: clean
> -clean:
> -       @if [ -d $(TPM_EMULATOR_DIR) ]; \
> -               then $(MAKE) -C $(TPM_EMULATOR_DIR) clean; \
> -       fi
> -       @if [ -d $(VTPM_DIR) ]; \
> -               then $(MAKE) -C $(VTPM_DIR) clean; \
> -       fi
> -
> -.PHONY: mrproper
> -mrproper:
> -       rm -f $(TPM_EMULATOR_TARFILE) tpm_emulator.patch.old vtpm.patch.old
> -       rm -rf $(TPM_EMULATOR_DIR) $(VTPM_DIR) $(ORIG_DIR)
> -
> -# Download Swiss emulator
> -$(TPM_EMULATOR_TARFILE):
> -       wget http://download.berlios.de/tpm-emulator/$(TPM_EMULATOR_TARFILE)
> -
> -# Create vtpm dirs
> -$(VTPM_DIR)/tpmd/tpmd: $(TPM_EMULATOR_TARFILE) vtpm-0.5.1.patch
> -       rm -rf $(VTPM_DIR)
> -       tar -xzf $(TPM_EMULATOR_TARFILE)
> -       mv $(TPM_EMULATOR_NAME) $(VTPM_DIR)
> -
> -       set -e; cd $(VTPM_DIR); \
> -       patch -p1 < ../vtpm-0.5.1.patch; \
> -       patch -p1 < ../vtpm-0.5.1-LDLIBS.patch
> -
> -orig: $(TPM_EMULATOR_TARFILE)
> -       mkdir $(ORIG_DIR);
> -       set -e; cd $(ORIG_DIR); \
> -       tar -xzf ../$(TPM_EMULATOR_TARFILE);
> -
> -updatepatches: clean orig
> -       find $(VTPM_DIR) -name "*.orig" -print | xargs rm -f;
> -       mv vtpm.patch vtpm.patch.old;
> -       diff -uprN $(TPM_EMULATOR_DIR) $(VTPM_DIR) > vtpm.patch || true;
> -
> -.PHONY: build_sub
> -build_sub: $(VTPM_DIR)/tpmd/tpmd
> -       set -e; if [ -e $(GMP_HEADER) ]; then \
> -               $(MAKE) -C $(VTPM_DIR) version; \
> -               $(MAKE) -C $(VTPM_DIR) all-recursive; \
> -       else \
> -               echo "=== Unable to build VTPMs. libgmp could not be found."; \
> -       fi
> -
> diff --git a/tools/vtpm/README b/tools/vtpm/README
> deleted file mode 100644
> index 2008cbd..0000000
> --- a/tools/vtpm/README
> +++ /dev/null
> @@ -1,45 +0,0 @@
> -
> -Directory Structure
> -===================
> -tools/vtpm/tpm_emulator-0.2b.tar.gz    -> TPM Emulator downloaded at build time that will
> -                                          be patched and used for our vtpms
> -tools/vtpm/vtpm.patch                  -> patch applied to tpm_emulator to make vtpm
> -tools/vtpm/vtpm/                       -> (created on build) tpm_emulator moved to ring 3,
> -                                          listens on a pair of fifos for TPM commands,
> -                                          persistent state is sent via named fifo to vtpm
> -                                            manager, which encrypts it and protects it.
> -tools/vtpm/tpm_emulator.patch          -> To allow for debugging and testing on non-TPM
> -                                          platforms, this patches the emulator to allow
> -                                          it to be inserted into the dom0 kernel
> -tools/vtpm/tpm_emulator-0.2            -> (created on build) directory containing patched emulator
> -
> -Compile Flags
> -===================
> -VTPM_MULTI_VM                -> Defined (not finished): VTPMs run in their own VMs
> -                                Not Defined (default): VTPMs are processes
> -
> -Requirements
> -============
> -- xen-unstable
> -- IBM frontend/backend vtpm driver patch
> -- vtpm_managerd
> -- GNU MP Big number library (GMP)
> -
> -vtpmd Flow (for vtpm_manager. vtpmd never run by default)
> -============================
> -- Launch the VTPM manager (vtpm_managerd) which which begins listening to the BE with one thread
> -  and listens to a named fifo that is shared by the vtpms to commuincate with the manager.
> -- VTPM Manager listens to TPM BE.
> -- When xend launches a tpm frontend equipped VM it contacts the manager over the vtpm backend.
> -- When the manager receives the open message from the BE, it launches a vtpm
> -- Xend allows the VM to continue booting.
> -- When a TPM request is issued to the front end, the front end transmits the TPM request to the backend.
> -- The manager receives the TPM requests and uses a named fifo to forward the request to the vtpm.
> -- The fifo listener begins listening for the reply from vtpm for the request.
> -- Vtpm processes request and replies to manager over shared named fifo.
> -- If needed, the vtpm may send a request to the vtpm_manager at any time to save it's secrets to disk.
> -- Manager receives response from vtpm and passes it back to backend for forwarding to guest.
> -
> -tpm_emulator flow
> -==================
> -Read documentation in tpm_emulator-0.2 directory
> diff --git a/tools/vtpm/Rules.mk b/tools/vtpm/Rules.mk
> deleted file mode 100644
> index 548cff0..0000000
> --- a/tools/vtpm/Rules.mk
> +++ /dev/null
> @@ -1,26 +0,0 @@
> -# Base definitions and rules (XEN_ROOT must be defined in including Makefile)
> -include $(XEN_ROOT)/tools/Rules.mk
> -
> -#
> -# Tool definitions
> -#
> -
> -# General compiler flags
> -CFLAGS   = -Werror -g3
> -
> -# Generic project files
> -HDRS   = $(wildcard *.h)
> -SRCS   = $(wildcard *.c)
> -OBJS   = $(patsubst %.c,%.o,$(SRCS))
> -
> -# Generic (non-header) dependencies
> -$(SRCS): Makefile $(XEN_ROOT)/tools/Rules.mk $(XEN_ROOT)/tools/vtpm/Rules.mk
> -
> -$(OBJS): $(SRCS)
> -
> --include $(DEPS)
> -
> -BUILD_EMULATOR = y
> -
> -# Make sure these are just rules
> -.PHONY : all build install clean
> diff --git a/tools/vtpm/tpm_emulator.patch b/tools/vtpm/tpm_emulator.patch
> deleted file mode 100644
> index c34c665..0000000
> --- a/tools/vtpm/tpm_emulator.patch
> +++ /dev/null
> @@ -1,1919 +0,0 @@
> -diff -uprN orig/tpm_emulator-0.4/AUTHORS tpm_emulator/AUTHORS
> ---- orig/tpm_emulator-0.4/AUTHORS      2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/AUTHORS       2006-07-24 14:35:35.000000000 -0700
> -@@ -1,2 +1,3 @@
> - Mario Strasser <mast@gmx.net>
> - Heiko Stamer <stamer@gaos.org> [DAA]
> -+INTEL Corp <> [Dropped to Ring3]
> -diff -uprN orig/tpm_emulator-0.4/ChangeLog tpm_emulator/ChangeLog
> ---- orig/tpm_emulator-0.4/ChangeLog    2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/ChangeLog     2006-07-24 14:35:35.000000000 -0700
> -@@ -1,3 +1,6 @@
> -+????-??-?? Intel Corp
> -+      * Moved module out of kernel to run as a ring 3 app
> -+
> - 2006-06-23  Mario Strasser <mast@gmx.net>
> -       * tpm_startup.c: behaviour of ST_CLEAR and storage of
> -               persistent data adapted
> -diff -uprN orig/tpm_emulator-0.4/crypto/gmp_kernel_wrapper.c tpm_emulator/crypto/gmp_kernel_wrapper.c
> ---- orig/tpm_emulator-0.4/crypto/gmp_kernel_wrapper.c  2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/crypto/gmp_kernel_wrapper.c   2006-07-24 14:35:35.000000000 -0700
> -@@ -1,5 +1,6 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -24,15 +25,10 @@ int __gmp_junk;
> - void __attribute__ ((regparm(0))) __gmp_assert_fail(const char *filename,
> -   int linenum, const char *expr)
> - {
> --  panic(KERN_CRIT TPM_MODULE_NAME "%s:%d: GNU MP assertion failed: %s\n",
> -+  error("%s:%d: GNU MP assertion failed: %s\n",
> -     filename, linenum, expr);
> - }
> -
> --void __attribute__ ((regparm(0))) abort(void)
> --{
> --  panic(KERN_CRIT TPM_MODULE_NAME "GNU MP abort() was called\n");
> --}
> --
> - /* overwrite GNU MP random functions (used by mpz/millerrabin.c) */
> -
> - void __attribute__ ((regparm(0))) gmp_randinit(gmp_randstate_t rstate,
> -@@ -77,20 +73,19 @@ void __attribute__ ((regparm(0))) mpz_ur
> -
> - void __attribute__ ((regparm(0))) *kernel_allocate(size_t size)
> - {
> --  void *ret  = (void*)kmalloc(size, GFP_KERNEL);
> --  if (!ret) panic(KERN_CRIT TPM_MODULE_NAME
> --    "GMP: cannot allocate memory (size=%u)\n", size);
> -+  void *ret  = (void*)malloc(size);
> -+  if (!ret) error("GMP: cannot allocate memory (size=%Zu)\n", size);
> -   return ret;
> - }
> -
> - void __attribute__ ((regparm(0))) *kernel_reallocate(void *oldptr,
> -   size_t old_size, size_t new_size)
> - {
> --  void *ret = (void*)kmalloc(new_size, GFP_KERNEL);
> --  if (!ret) panic(KERN_CRIT TPM_MODULE_NAME "GMP: Cannot reallocate memory "
> --    "(old_size=%u new_size=%u)\n", old_size, new_size);
> -+  void *ret = (void*)malloc(new_size);
> -+  if (!ret) error("GMP: Cannot reallocate memory "
> -+    "(old_size=%Zu new_size=%Zu)\n", old_size, new_size);
> -   memcpy(ret, oldptr, old_size);
> --  kfree(oldptr);
> -+  free(oldptr);
> -   return ret;
> - }
> -
> -@@ -99,7 +94,7 @@ void __attribute__ ((regparm(0))) kernel
> -   /* overwrite used memory */
> -   if (blk_ptr != NULL) {
> -     memset(blk_ptr, 0, blk_size);
> --    kfree(blk_ptr);
> -+    free(blk_ptr);
> -   }
> - }
> -
> -diff -uprN orig/tpm_emulator-0.4/crypto/rsa.c tpm_emulator/crypto/rsa.c
> ---- orig/tpm_emulator-0.4/crypto/rsa.c 2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/crypto/rsa.c  2006-07-24 14:35:35.000000000 -0700
> -@@ -1,5 +1,6 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -381,7 +382,7 @@ static int encode_message(int type, uint
> -       msg[0] = 0x00;
> -       get_random_bytes(&msg[1], SHA1_DIGEST_LENGTH);
> -       sha1_init(&ctx);
> --      sha1_update(&ctx, "TCPA", 4);
> -+      sha1_update(&ctx, (uint8_t *) "TCPA", 4);
> -       sha1_final(&ctx, &msg[1 + SHA1_DIGEST_LENGTH]);
> -       memset(&msg[1 + 2 * SHA1_DIGEST_LENGTH], 0x00,
> -         msg_len - data_len - 2 * SHA1_DIGEST_LENGTH - 2);
> -@@ -429,7 +430,7 @@ static int decode_message(int type, uint
> -       mask_generation(&msg[1], SHA1_DIGEST_LENGTH,
> -         &msg[1 + SHA1_DIGEST_LENGTH], msg_len - SHA1_DIGEST_LENGTH - 1);
> -       sha1_init(&ctx);
> --      sha1_update(&ctx, "TCPA", 4);
> -+      sha1_update(&ctx, (uint8_t *) "TCPA", 4);
> -       sha1_final(&ctx, &msg[1]);
> -       if (memcmp(&msg[1], &msg[1 + SHA1_DIGEST_LENGTH],
> -           SHA1_DIGEST_LENGTH) != 0) return -1;
> -diff -uprN orig/tpm_emulator-0.4/linux_module.c tpm_emulator/linux_module.c
> ---- orig/tpm_emulator-0.4/linux_module.c       2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/linux_module.c        1969-12-31 16:00:00.000000000 -0800
> -@@ -1,195 +0,0 @@
> --/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -- * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -- *
> -- * This module is free software; you can redistribute it and/or modify
> -- * it under the terms of the GNU General Public License as published
> -- * by the Free Software Foundation; either version 2 of the License,
> -- * or (at your option) any later version.
> -- *
> -- * This module 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.
> -- *
> -- * $Id: linux_module.c 91 2006-03-13 13:51:41Z mast $
> -- */
> --
> --#include <linux/module.h>
> --#include <linux/kernel.h>
> --#include <linux/init.h>
> --#include <linux/miscdevice.h>
> --#include <linux/poll.h>
> --#include "linux_module.h"
> --#include "tpm/tpm_emulator.h"
> --
> --MODULE_LICENSE("GPL");
> --MODULE_AUTHOR("Mario Strasser <mast@gmx.net>");
> --MODULE_DESCRIPTION("Trusted Platform Module (TPM) Emulator");
> --MODULE_SUPPORTED_DEVICE(TPM_DEVICE_NAME);
> --
> --/* module startup parameters */
> --char *startup = "save";
> --module_param(startup, charp, 0444);
> --MODULE_PARM_DESC(startup, " Sets the startup mode of the TPM. "
> --  "Possible values are 'clear', 'save' (default) and 'deactivated.");
> --char *storage_file = "/var/tpm/tpm_emulator-1.2.0.2";
> --module_param(storage_file, charp, 0644);
> --MODULE_PARM_DESC(storage_file, " Sets the persistent-data storage "
> --  "file of the TPM.");
> --
> --/* TPM lock */
> --static struct semaphore tpm_mutex;
> --
> --/* TPM command response */
> --static struct {
> --  uint8_t *data;
> --  uint32_t size;
> --} tpm_response;
> --
> --/* module state */
> --#define STATE_IS_OPEN 0
> --static uint32_t module_state;
> --static struct timespec old_time;
> --
> --static int tpm_open(struct inode *inode, struct file *file)
> --{
> --  debug("%s()", __FUNCTION__);
> --  if (test_and_set_bit(STATE_IS_OPEN, (void*)&module_state)) return -EBUSY;
> --  return 0;
> --}
> --
> --static int tpm_release(struct inode *inode, struct file *file)
> --{
> --  debug("%s()", __FUNCTION__);
> --  clear_bit(STATE_IS_OPEN, (void*)&module_state);
> --  down(&tpm_mutex);
> --  if (tpm_response.data != NULL) {
> --    kfree(tpm_response.data);
> --    tpm_response.data = NULL;
> --  }
> --  up(&tpm_mutex);
> --  return 0;
> --}
> --
> --static ssize_t tpm_read(struct file *file, char *buf, size_t count, loff_t *ppos)
> --{
> --  debug("%s(%d)", __FUNCTION__, count);
> --  down(&tpm_mutex);
> --  if (tpm_response.data != NULL) {
> --    count = min(count, (size_t)tpm_response.size - (size_t)*ppos);
> --    count -= copy_to_user(buf, &tpm_response.data[*ppos], count);
> --    *ppos += count;
> --    if ((size_t)tpm_response.size == (size_t)*ppos) {
> --      kfree(tpm_response.data);
> --      tpm_response.data = NULL;
> --    }
> --  } else {
> --    count = 0;
> --  }
> --  up(&tpm_mutex);
> --  return count;
> --}
> --
> --static ssize_t tpm_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
> --{
> --  debug("%s(%d)", __FUNCTION__, count);
> --  down(&tpm_mutex);
> --  *ppos = 0;
> --  if (tpm_response.data != NULL) kfree(tpm_response.data);
> --  if (tpm_handle_command(buf, count, &tpm_response.data,
> --                         &tpm_response.size) != 0) {
> --    count = -EILSEQ;
> --    tpm_response.data = NULL;
> --  }
> --  up(&tpm_mutex);
> --  return count;
> --}
> --
> --#define TPMIOC_CANCEL   _IO('T', 0x00)
> --#define TPMIOC_TRANSMIT _IO('T', 0x01)
> --
> --static int tpm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
> --{
> --  debug("%s(%d, %p)", __FUNCTION__, cmd, (char*)arg);
> --  if (cmd == TPMIOC_TRANSMIT) {
> --    uint32_t count = ntohl(*(uint32_t*)(arg + 2));
> --    down(&tpm_mutex);
> --    if (tpm_response.data != NULL) kfree(tpm_response.data);
> --    if (tpm_handle_command((char*)arg, count, &tpm_response.data,
> --                           &tpm_response.size) == 0) {
> --      tpm_response.size -= copy_to_user((char*)arg, tpm_response.data,
> --                            tpm_response.size);
> --      kfree(tpm_response.data);
> --      tpm_response.data = NULL;
> --    } else {
> --      tpm_response.size = 0;
> --      tpm_response.data = NULL;
> --    }
> --    up(&tpm_mutex);
> --    return tpm_response.size;
> --  }
> --  return -1;
> --}
> --
> --struct file_operations fops = {
> --  .owner   = THIS_MODULE,
> --  .open    = tpm_open,
> --  .release = tpm_release,
> --  .read    = tpm_read,
> --  .write   = tpm_write,
> --  .ioctl   = tpm_ioctl,
> --};
> --
> --static struct miscdevice tpm_dev = {
> --  .minor      = TPM_DEVICE_MINOR,
> --  .name       = TPM_DEVICE_NAME,
> --  .fops       = &fops,
> --};
> --
> --int __init init_tpm_module(void)
> --{
> --  int res = misc_register(&tpm_dev);
> --  if (res != 0) {
> --    error("misc_register() failed for minor %d\n", TPM_DEVICE_MINOR);
> --    return res;
> --  }
> --  /* initialize variables */
> --  sema_init(&tpm_mutex, 1);
> --  module_state = 0;
> --  tpm_response.data = NULL;
> --  old_time = current_kernel_time();
> --  /* initialize TPM emulator */
> --  if (!strcmp(startup, "clear")) {
> --    tpm_emulator_init(1);
> --  } else if (!strcmp(startup, "save")) {
> --    tpm_emulator_init(2);
> --  } else if (!strcmp(startup, "deactivated")) {
> --    tpm_emulator_init(3);
> --  } else {
> --    error("invalid startup mode '%s'; must be 'clear', "
> --      "'save' (default) or 'deactivated", startup);
> --    misc_deregister(&tpm_dev);
> --    return -EINVAL;
> --  }
> --  return 0;
> --}
> --
> --void __exit cleanup_tpm_module(void)
> --{
> --  tpm_emulator_shutdown();
> --  misc_deregister(&tpm_dev);
> --  if (tpm_response.data != NULL) kfree(tpm_response.data);
> --}
> --
> --module_init(init_tpm_module);
> --module_exit(cleanup_tpm_module);
> --
> --uint64_t tpm_get_ticks(void)
> --{
> --  struct timespec new_time = current_kernel_time();
> --  uint64_t ticks = (uint64_t)(new_time.tv_sec - old_time.tv_sec) * 1000000
> --                   + (new_time.tv_nsec - old_time.tv_nsec) / 1000;
> --  old_time = new_time;
> --  return (ticks > 0) ? ticks : 1;
> --}
> --
> -diff -uprN orig/tpm_emulator-0.4/linux_module.h tpm_emulator/linux_module.h
> ---- orig/tpm_emulator-0.4/linux_module.h       2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/linux_module.h        2006-07-24 14:35:35.000000000 -0700
> -@@ -1,5 +1,6 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -17,54 +18,62 @@
> - #ifndef _LINUX_MODULE_H_
> - #define _LINUX_MODULE_H_
> -
> --#include <linux/version.h>
> --#include <linux/kernel.h>
> --#include <linux/slab.h>
> -+#include <malloc.h>
> -+#include <stdint.h>
> -+#include <stdio.h>
> -+#include <string.h>
> - #include <linux/types.h>
> --#include <linux/string.h>
> --#include <linux/random.h>
> --#include <linux/time.h>
> --#include <asm/byteorder.h>
> -
> --/* module settings */
> -+#include <endian.h>
> -+#define __BYTEORDER_HAS_U64__
> -+#ifdef LITTLE_ENDIAN
> -+ #include <linux/byteorder/little_endian.h>
> -+#else
> -+ #include <linux/byteorder/big_endian.h>
> -+#endif
> -
> -+/* module settings */
> -+#define min(A,B) ((A)<(B)?(A):(B))
> -+#ifndef STR
> - #define STR(s) __STR__(s)
> - #define __STR__(s) #s
> -+#endif
> - #include "tpm_version.h"
> -
> - #define TPM_DEVICE_MINOR  224
> - #define TPM_DEVICE_NAME   "tpm"
> - #define TPM_MODULE_NAME   "tpm_emulator"
> -
> --/* debug and log output functions */
> --
> - #ifdef DEBUG
> --#define debug(fmt, ...) printk(KERN_DEBUG "%s %s:%d: Debug: " fmt "\n", \
> --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug(fmt, ...) printf("TPMD: %s:%d: Debug: " fmt "\n", \
> -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> - #else
> - #define debug(fmt, ...)
> - #endif
> --#define info(fmt, ...)  printk(KERN_INFO "%s %s:%d: Info: " fmt "\n", \
> --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> --#define error(fmt, ...) printk(KERN_ERR "%s %s:%d: Error: " fmt "\n", \
> --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> --#define alert(fmt, ...) printk(KERN_ALERT "%s %s:%d: Alert: " fmt "\n", \
> --                        TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define info(fmt, ...)  printf("TPMD: %s:%d: Info: " fmt "\n", \
> -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define error(fmt, ...) printf("TPMD: %s:%d: Error: " fmt "\n", \
> -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define alert(fmt, ...) printf("TPMD: %s:%d: Alert: " fmt "\n", \
> -+                        __FILE__, __LINE__, ## __VA_ARGS__)
> -
> - /* memory allocation */
> -
> - static inline void *tpm_malloc(size_t size)
> - {
> --  return kmalloc(size, GFP_KERNEL);
> -+  return malloc(size);
> - }
> -
> - static inline void tpm_free(const void *ptr)
> - {
> --  if (ptr != NULL) kfree(ptr);
> -+  if (ptr != NULL) free( (void *) ptr);
> - }
> -
> - /* random numbers */
> -
> -+//FIXME;
> -+void get_random_bytes(void *buf, int nbytes);
> -+
> - static inline void tpm_get_random_bytes(void *buf, int nbytes)
> - {
> -   get_random_bytes(buf, nbytes);
> -@@ -84,9 +93,9 @@ uint64_t tpm_get_ticks(void);
> - #define CPU_TO_LE16(x) __cpu_to_le16(x)
> -
> - #define BE64_TO_CPU(x) __be64_to_cpu(x)
> --#define LE64_TO_CPU(x) __be64_to_cpu(x)
> -+#define LE64_TO_CPU(x) __le64_to_cpu(x)
> - #define BE32_TO_CPU(x) __be32_to_cpu(x)
> --#define LE32_TO_CPU(x) __be32_to_cpu(x)
> -+#define LE32_TO_CPU(x) __le32_to_cpu(x)
> - #define BE16_TO_CPU(x) __be16_to_cpu(x)
> - #define LE16_TO_CPU(x) __le16_to_cpu(x)
> -
> -diff -uprN orig/tpm_emulator-0.4/Makefile tpm_emulator/Makefile
> ---- orig/tpm_emulator-0.4/Makefile     2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/Makefile      2006-07-24 14:35:35.000000000 -0700
> -@@ -1,24 +1,40 @@
> - # Software-Based Trusted Platform Module (TPM) Emulator for Linux
> - # Copyright (C) 2004 Mario Strasser <mast@gmx.net>
> -+# Copyright (C) 2006 INTEL Corp.
> - #
> - # $Id: Makefile 115 2006-06-23 10:36:44Z mast $
> -
> --# kernel settings
> --KERNEL_RELEASE := $(shell uname -r)
> --KERNEL_BUILD   := /lib/modules/$(KERNEL_RELEASE)/build
> --MOD_SUBDIR     := misc
> -+COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
> -
> - # module settings
> --MODULE_NAME    := tpm_emulator
> -+BIN            := tpm_emulator
> - VERSION_MAJOR  := 0
> - VERSION_MINOR  := 4
> - VERSION_BUILD  := $(shell date +"%s")
> -
> --# enable/disable DEBUG messages
> --EXTRA_CFLAGS   += -Wall -DDEBUG -g
> -+# Installation program and options
> -+INSTALL         = install
> -+INSTALL_PROG    = $(INSTALL) -m0755
> -+INSTALL_DIR     = $(INSTALL) -d -m0755
> -+
> -+# Xen tools installation directory
> -+TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin
> -+
> -+CC      := gcc
> -+CFLAGS  += -g -Wall $(INCLUDE) -DDEBUG
> -+CFLAGS  += -I. -Itpm
> -+
> -+# Is the simulator running in it's own vm?
> -+#CFLAGS += -DVTPM_MULTI_VM
> -+
> -+ifeq ($(COMPILE_ARCH),x86_64)
> -+LIBDIR = lib64
> -+else
> -+LIBDIR = lib
> -+endif
> -
> - # GNU MP configuration
> --GMP_LIB        := /usr/lib/libgmp.a
> -+GMP_LIB        := /usr/$(LIBDIR)/libgmp.a
> - GMP_HEADER     := /usr/include/gmp.h
> -
> - # sources and objects
> -@@ -27,38 +43,32 @@ DIRS           := . crypto tpm
> - SRCS           := $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.c))
> - OBJS           := $(patsubst %.c, %.o, $(SRCS))
> - SRCS           += $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.h))
> --DISTSRC        := ./README ./AUTHORS ./ChangeLog ./Makefile $(SRCS)
> --DISTDIR        := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)
> -
> --obj-m               := $(MODULE_NAME).o
> --$(MODULE_NAME)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
> -+obj-m               := $(BIN)
> -+$(BIN)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
> -
> - EXTRA_CFLAGS   += -I$(src) -I$(src)/crypto -I$(src)/tpm
> -
> - # do not print "Entering directory ..."
> - MAKEFLAGS      += --no-print-directory
> -
> --all:  $(src)/crypto/gmp.h $(src)/crypto/libgmp.a version
> --      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules
> -+all: $(BIN)
> -
> --install:
> --      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules_install
> --      test -d /var/tpm || mkdir /var/tpm
> --      test -c /dev/tpm || mknod /dev/tpm c 10 224
> --      chmod 666 /dev/tpm
> --      depmod -a
> -+$(BIN):       $(src)/crypto/gmp.h $(src)/crypto/libgmp.a version $(SRCS) $(OBJS)
> -+      $(CC) $(CFLAGS) $(OBJS) $(src)/crypto/libgmp.a -o $(BIN)
> -+
> -+%.o: %.c
> -+      $(CC) $(CFLAGS) -c $< -o $@
> -+
> -+install: $(BIN)
> -+      $(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)
> -+      @if [ ! -d "/var/tpm" ]; then mkdir /var/tpm; fi
> -
> - clean:
> --      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) clean
> --      rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a
> -+      rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a $(OBJS)
> -
> --dist: $(DISTSRC)
> --      rm -rf $(DISTDIR)
> --      mkdir $(DISTDIR)
> --      cp --parents $(DISTSRC) $(DISTDIR)/
> --      rm -f $(DISTDIR)/crypto/gmp.h
> --      tar -chzf $(DISTDIR).tar.gz $(DISTDIR)
> --      rm -rf $(DISTDIR)
> -+mrproper: clean
> -+      rm -f $(BIN) tpm_version.h
> -
> - $(src)/crypto/libgmp.a:
> -       test -f $(src)/crypto/libgmp.a || ln -s $(GMP_LIB) $(src)/crypto/libgmp.a
> -@@ -88,4 +98,3 @@ version:
> -       @echo "#endif /* _TPM_VERSION_H_ */" >> $(src)/tpm_version.h
> -
> - .PHONY: all install clean dist gmp version
> --
> -diff -uprN orig/tpm_emulator-0.4/README tpm_emulator/README
> ---- orig/tpm_emulator-0.4/README       2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/README        2006-07-24 14:35:35.000000000 -0700
> -@@ -13,7 +13,8 @@ $Id: README 113 2006-06-18 12:38:13Z hst
> - Copyright
> - --------------------------------------------------------------------------
> - Copyright (C) 2004 Mario Strasser <mast@gmx.net> and Swiss Federal
> --Institute of Technology (ETH) Zurich.
> -+                   Institute of Technology (ETH) Zurich.
> -+Copyright (C) 2005 INTEL Corp
> -
> - This program is free software; you can redistribute it and/or modify
> - it under the terms of the GNU General Public License as published by
> -@@ -43,6 +44,12 @@ Example:
> - GMP_LIB        := /usr/lib/libgmp.a
> - GMP_HEADER     := /usr/include/gmp.h
> -
> -+GNU MP Library on 64 bit Systems
> -+--------------------------------------------------------------------------
> -+Some 64-bit kernels have problems with importing the user-space gmp
> -+library (/usr/lib*/libgmp.a) into kernel space.  These kernels will require
> -+that the gmp library be recompiled for kernel space with -mcmodel=kernel.
> -+
> - Installation
> - --------------------------------------------------------------------------
> - The compilation and installation process uses the build environment for
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_capability.c tpm_emulator/tpm/tpm_capability.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_capability.c 2006-06-23 19:37:07.000000000 +0900
> -+++ tpm_emulator/tpm/tpm_capability.c  2007-12-28 22:50:19.000000000 +0900
> -@@ -701,7 +701,10 @@ TPM_RESULT TPM_GetCapabilityOwner(TPM_VE
> -   TPM_RESULT res;
> -
> -   info("TPM_GetCapabilityOwner()");
> --
> -+
> -+  if (!tpmData.permanent.flags.owned) {
> -+    return TPM_NOSRK;
> -+  }
> -   /* Verify owner authorization */
> -   res = tpm_verify_auth(auth1, tpmData.permanent.data.ownerAuth, TPM_KH_OWNER);
> -   if (res != TPM_SUCCESS) return res;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c tpm_emulator/tpm/tpm_cmd_handler.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c        2006-06-23 19:37:07.000000000 +0900
> -+++ tpm_emulator/tpm/tpm_cmd_handler.c 2007-09-12 20:23:00.000000000 +0900
> -@@ -565,7 +565,7 @@ static TPM_RESULT execute_TPM_Seal(TPM_R
> -   if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle)
> -       || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth)
> -       || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize)
> --      || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)
> -+      || (pcrInfoSize >0 && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo))
> -       || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize)
> -       || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize)
> -       || len != 0) return TPM_BAD_PARAMETER;
> -@@ -798,7 +798,7 @@ static TPM_RESULT execute_TPM_Sealx(TPM_
> -   if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle)
> -       || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth)
> -       || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize)
> --      || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)
> -+      || (pcrInfoSize > 0 && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo))
> -       || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize)
> -       || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize)
> -       || len != 0) return TPM_BAD_PARAMETER;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_credentials.c tpm_emulator/tpm/tpm_credentials.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_credentials.c        2006-06-23 19:37:07.000000000 +0900
> -+++ tpm_emulator/tpm/tpm_credentials.c 2007-09-12 20:23:30.000000000 +0900
> -@@ -47,20 +47,20 @@ int tpm_compute_pubkey_checksum(TPM_NONC
> -
> - TPM_RESULT tpm_get_pubek(TPM_PUBKEY *pubEndorsementKey)
> - {
> --  UINT32 key_length;
> -+  size_t key_length;
> -   if (!tpmData.permanent.data.endorsementKey.size) return TPM_NO_ENDORSEMENT;
> -   /* setup TPM_PUBKEY structure */
> --  key_length = tpmData.permanent.data.endorsementKey.size;
> --  pubEndorsementKey->pubKey.keyLength = key_length >> 3;
> -+  pubEndorsementKey->pubKey.keyLength = tpmData.permanent.data.endorsementKey.size >> 3;
> -   pubEndorsementKey->pubKey.key = tpm_malloc(pubEndorsementKey->pubKey.keyLength);
> -   if (pubEndorsementKey->pubKey.key == NULL) return TPM_FAIL;
> -   rsa_export_modulus(&tpmData.permanent.data.endorsementKey,
> --    pubEndorsementKey->pubKey.key,
> --    &pubEndorsementKey->pubKey.keyLength);
> -+                   pubEndorsementKey->pubKey.key,
> -+                   &key_length);
> -+  pubEndorsementKey->pubKey.keyLength = key_length;
> -   pubEndorsementKey->algorithmParms.algorithmID = TPM_ALG_RSA;
> -   pubEndorsementKey->algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
> -   pubEndorsementKey->algorithmParms.sigScheme = TPM_SS_NONE;
> --  pubEndorsementKey->algorithmParms.parms.rsa.keyLength = key_length;
> -+  pubEndorsementKey->algorithmParms.parms.rsa.keyLength = key_length << 3;
> -   pubEndorsementKey->algorithmParms.parms.rsa.numPrimes = 2;
> -   pubEndorsementKey->algorithmParms.parms.rsa.exponentSize = 0;
> -   pubEndorsementKey->algorithmParms.parms.rsa.exponent = NULL;
> -@@ -175,6 +175,7 @@ TPM_RESULT TPM_OwnerReadInternalPub(TPM_
> - {
> -   TPM_RESULT res;
> -   TPM_KEY_DATA *srk = &tpmData.permanent.data.srk;
> -+  size_t key_length;
> -   info("TPM_OwnerReadInternalPub()");
> -   /* verify authorization */
> -   res = tpm_verify_auth(auth1, tpmData.permanent.data.ownerAuth, TPM_KH_OWNER);
> -@@ -186,7 +187,8 @@ TPM_RESULT TPM_OwnerReadInternalPub(TPM_
> -     publicPortion->pubKey.key = tpm_malloc(publicPortion->pubKey.keyLength);
> -     if (publicPortion->pubKey.key == NULL) return TPM_FAIL;
> -     rsa_export_modulus(&srk->key, publicPortion->pubKey.key,
> --      &publicPortion->pubKey.keyLength);
> -+      &key_length);
> -+    publicPortion->pubKey.keyLength = key_length;
> -     publicPortion->algorithmParms.algorithmID = TPM_ALG_RSA;
> -     publicPortion->algorithmParms.encScheme = srk->encScheme;
> -     publicPortion->algorithmParms.sigScheme = srk->sigScheme;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_crypto.c tpm_emulator/tpm/tpm_crypto.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_crypto.c     2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_crypto.c      2006-07-24 14:35:35.000000000 -0700
> -@@ -182,7 +182,8 @@ TPM_RESULT TPM_CertifyKey(TPM_KEY_HANDLE
> -   TPM_KEY_DATA *cert, *key;
> -   sha1_ctx_t sha1_ctx;
> -   BYTE *buf, *p;
> --  UINT32 length;
> -+  UINT32 length32;
> -+  size_t length;
> -   info("TPM_CertifyKey()");
> -   /* get keys */
> -   cert = tpm_get_key(certHandle);
> -@@ -264,14 +265,15 @@ TPM_RESULT TPM_CertifyKey(TPM_KEY_HANDLE
> -   /* compute the digest of the CERTIFY_INFO[2] structure and sign it */
> -   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
> -   p = buf = tpm_malloc(length);
> -+  length32=(UINT32) length;
> -   if (buf == NULL
> --      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length, certifyInfo)) {
> -+      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length32, certifyInfo)) {
> -     free_TPM_KEY_PARMS(certifyInfo->algorithmParms);
> -     return TPM_FAIL;
> -   }
> -   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
> -   sha1_init(&sha1_ctx);
> --  sha1_update(&sha1_ctx, buf, length);
> -+  sha1_update(&sha1_ctx, buf, (size_t) length);
> -   sha1_final(&sha1_ctx, buf);
> -   res = tpm_sign(cert, auth1, FALSE, buf, SHA1_DIGEST_LENGTH, outData, outDataSize);
> -   tpm_free(buf);
> -@@ -292,7 +294,8 @@ TPM_RESULT TPM_CertifyKey2(TPM_KEY_HANDL
> -   TPM_KEY_DATA *cert, *key;
> -   sha1_ctx_t sha1_ctx;
> -   BYTE *buf, *p;
> --  UINT32 length;
> -+  size_t length;
> -+  UINT32 length32;
> -   info("TPM_CertifyKey2()");
> -   /* get keys */
> -   cert = tpm_get_key(certHandle);
> -@@ -362,8 +365,9 @@ TPM_RESULT TPM_CertifyKey2(TPM_KEY_HANDL
> -   /* compute the digest of the CERTIFY_INFO[2] structure and sign it */
> -   length = sizeof_TPM_CERTIFY_INFO((*certifyInfo));
> -   p = buf = tpm_malloc(length);
> -+  length32 = (UINT32) length;
> -   if (buf == NULL
> --      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length, certifyInfo)) {
> -+      || tpm_marshal_TPM_CERTIFY_INFO(&p, &length32, certifyInfo)) {
> -     free_TPM_KEY_PARMS(certifyInfo->algorithmParms);
> -     return TPM_FAIL;
> -   }
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_daa.c tpm_emulator/tpm/tpm_daa.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_daa.c        2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_daa.c 2006-07-24 14:35:35.000000000 -0700
> -@@ -716,14 +716,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -805,14 +805,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -1489,14 +1489,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -1712,14 +1712,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -1793,14 +1793,14 @@ TPM_RESULT TPM_DAA_Join(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -2918,14 +2918,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -3143,7 +3143,7 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -         sha1_init(&sha1);
> -         sha1_update(&sha1, (BYTE*) &session->DAA_session.DAA_digest,
> -           sizeof(session->DAA_session.DAA_digest));
> --        sha1_update(&sha1, "\x01", 1);
> -+        sha1_update(&sha1, (BYTE *) "\x01", 1);
> -         sha1_update(&sha1, inputData1, inputSize1);
> -         sha1_final(&sha1, (BYTE*) &session->DAA_session.DAA_digest);
> -       }
> -@@ -3172,7 +3172,7 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -         sha1_init(&sha1);
> -         sha1_update(&sha1, (BYTE*) &session->DAA_session.DAA_digest,
> -           sizeof(session->DAA_session.DAA_digest));
> --        sha1_update(&sha1, "\x00", 1);
> -+        sha1_update(&sha1, (BYTE*) "\x00", 1);
> -         rsa_export_modulus(&aikData->key, scratch, &size);
> -         sha1_update(&sha1, scratch, size);
> -         sha1_final(&sha1, (BYTE*) &session->DAA_session.DAA_digest);
> -@@ -3229,14 +3229,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -@@ -3309,14 +3309,14 @@ TPM_RESULT TPM_DAA_Sign(TPM_HANDLE handl
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x00", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x00", 1);
> -       sha1_final(&sha1, scratch);
> -       sha1_init(&sha1);
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_rekey,
> -           sizeof(session->DAA_tpmSpecific.DAA_rekey));
> -       sha1_update(&sha1, (BYTE*) &session->DAA_tpmSpecific.DAA_count,
> -           sizeof(session->DAA_tpmSpecific.DAA_count));
> --      sha1_update(&sha1, "\x01", 1);
> -+      sha1_update(&sha1, (BYTE *) "\x01", 1);
> -       sha1_final(&sha1, scratch + SHA1_DIGEST_LENGTH);
> -       mpz_init(f), mpz_init(q);
> -       mpz_import(f, 2 * SHA1_DIGEST_LENGTH, 1, 1, 0, 0, scratch);
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_data.c tpm_emulator/tpm/tpm_data.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_data.c       2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_data.c        2006-07-24 14:35:35.000000000 -0700
> -@@ -40,6 +40,7 @@ static inline void init_pcr_attr(int pcr
> - void tpm_init_data(void)
> - {
> -   /* endorsement key */
> -+#ifndef TPM_GENERATE_EK
> -   uint8_t ek_n[] =  "\xa8\xdb\xa9\x42\xa8\xf3\xb8\x06\x85\x90\x76\x93\xad\xf7"
> -     "\x74\xec\x3f\xd3\x3d\x9d\xe8\x2e\xff\x15\xed\x0e\xce\x5f\x93"
> -     "\x92\xeb\xd1\x96\x2b\x72\x18\x81\x79\x12\x9d\x9c\x40\xd7\x1a"
> -@@ -77,6 +78,8 @@ void tpm_init_data(void)
> -     "\xd1\xc0\x8b\x5b\xa2\x2e\xa7\x15\xca\x50\x75\x10\x48\x9c\x2b"
> -     "\x18\xb9\x67\x8f\x5d\x64\xc3\x28\x9f\x2f\x16\x2f\x08\xda\x47"
> -     "\xec\x86\x43\x0c\x80\x99\x07\x34\x0f";
> -+#endif
> -+
> -   int i;
> -   /* reset all data to NULL, FALSE or 0 */
> -   memset(&tpmData, 0, sizeof(tpmData));
> -@@ -152,44 +155,43 @@ void tpm_release_data(void)
> -
> - #ifdef TPM_STORE_TO_FILE
> -
> --#include <linux/fs.h>
> --#include <linux/unistd.h>
> --#include <asm/uaccess.h>
> -+#include <sys/types.h>
> -+#include <sys/stat.h>
> -+#include <fcntl.h>
> -+#include <unistd.h>
> -
> - #define TPM_STORAGE_FILE "/var/tpm/tpm_emulator-1.2." STR(VERSION_MAJOR) "." STR(VERSION_MINOR)
> -
> - static int write_to_file(uint8_t *data, size_t data_length)
> - {
> -   int res;
> --  struct file *fp;
> --  mm_segment_t old_fs = get_fs();
> --  fp = filp_open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> --  if (IS_ERR(fp)) return -1;
> --  set_fs(get_ds());
> --  res = fp->f_op->write(fp, data, data_length, &fp->f_pos);
> --  set_fs(old_fs);
> --  filp_close(fp, NULL);
> -+  int fp;
> -+  fp = open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> -+  res = write(fp, data, data_length);
> -+  close(fp);
> -   return (res == data_length) ? 0 : -1;
> - }
> -
> - static int read_from_file(uint8_t **data, size_t *data_length)
> - {
> -   int res;
> --  struct file *fp;
> --  mm_segment_t old_fs = get_fs();
> --  fp = filp_open(TPM_STORAGE_FILE, O_RDONLY, 0);
> --  if (IS_ERR(fp)) return -1;
> --  *data_length = (size_t)fp->f_dentry->d_inode->i_size;
> --  /* *data_length = i_size_read(fp->f_dentry->d_inode); */
> -+  int fp, file_status;
> -+  struct stat file_info;
> -+  fp = open(TPM_STORAGE_FILE, O_RDONLY, 0);
> -+  file_status = fstat(fp, &file_info);
> -+  if (file_status < 0) {
> -+    close(fp);
> -+    return -1;
> -+  }
> -+
> -+  *data_length = file_info.st_size;
> -   *data = tpm_malloc(*data_length);
> -   if (*data == NULL) {
> --    filp_close(fp, NULL);
> -+    close(fp);
> -     return -1;
> -   }
> --  set_fs(get_ds());
> --  res = fp->f_op->read(fp, *data, *data_length, &fp->f_pos);
> --  set_fs(old_fs);
> --  filp_close(fp, NULL);
> -+  res = read(fp, *data, *data_length);
> -+  close(fp);
> -   if (res != *data_length) {
> -     tpm_free(*data);
> -     return -1;
> -@@ -216,23 +218,30 @@ static int read_from_file(uint8_t **data
> - int tpm_store_permanent_data(void)
> - {
> -   uint8_t *buf, *ptr;
> --  size_t buf_length, len;
> -+  UINT32 buf_length, len;
> -
> -   /* marshal data */
> --  buf_length = len = sizeof_TPM_STCLEAR_FLAGS(tpmData.stclear.flags)
> --    + sizeof_TPM_PERMANENT_FLAGS(tpmData.permanent.flags) + 2
> --    + sizeof_TPM_PERMANENT_DATA(tpmData.permanent.data);
> -+  buf_length = len = 4 + sizeof_TPM_STCLEAR_FLAGS(tpmData.stclear.flags)
> -+    + sizeof_TPM_PERMANENT_FLAGS(tpmData.permanent.flags)
> -+    + sizeof_TPM_STANY_FLAGS(tpmData.stany.flags) + 2
> -+    + sizeof_TPM_STCLEAR_DATA(tpmData.stclear.data)
> -+    + sizeof_TPM_PERMANENT_DATA(tpmData.permanent.data)
> -+    + sizeof_TPM_STANY_DATA(tpmData.stany.data);
> -   buf = ptr = tpm_malloc(buf_length);
> -   if (buf == NULL
> -       || tpm_marshal_TPM_VERSION(&ptr, &len, &tpmData.permanent.data.version)
> -       || tpm_marshal_TPM_STCLEAR_FLAGS(&ptr, &len, &tpmData.stclear.flags)
> -       || tpm_marshal_TPM_PERMANENT_FLAGS(&ptr, &len, &tpmData.permanent.flags)
> -+      || tpm_marshal_TPM_STANY_FLAGS(&ptr, &len, &tpmData.stany.flags)
> -       || tpm_marshal_BOOL(&ptr, &len, tpmData.permanent.flags.selfTestSucceeded)
> -       || tpm_marshal_BOOL(&ptr, &len, tpmData.permanent.flags.owned)
> --      || tpm_marshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)) {
> -+      || tpm_marshal_TPM_STCLEAR_DATA(&ptr, &len, &tpmData.stclear.data)
> -+      || tpm_marshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)
> -+      || tpm_marshal_TPM_STANY_DATA(&ptr, &len, &tpmData.stany.data)) {
> -     tpm_free(buf);
> -     return -1;
> -   }
> -+
> -   if (write_to_file(buf, buf_length - len)) {
> -     tpm_free(buf);
> -     return -1;
> -@@ -244,31 +253,36 @@ int tpm_store_permanent_data(void)
> - int tpm_restore_permanent_data(void)
> - {
> -   uint8_t *buf, *ptr;
> --  size_t buf_length, len;
> -+  size_t buf_length;
> -+  UINT32 len;
> -   TPM_VERSION ver;
> -
> -   /* read data */
> -   if (read_from_file(&buf, &buf_length)) return -1;
> -   ptr = buf;
> --  len = buf_length;
> -+  len = (uint32_t) buf_length;
> -   /* unmarshal data */
> -   if (tpm_unmarshal_TPM_VERSION(&ptr, &len, &ver)
> -       || memcmp(&ver, &tpmData.permanent.data.version, sizeof(TPM_VERSION))
> -       || tpm_unmarshal_TPM_STCLEAR_FLAGS(&ptr, &len, &tpmData.stclear.flags)
> -       || tpm_unmarshal_TPM_PERMANENT_FLAGS(&ptr, &len, &tpmData.permanent.flags)
> -+      || tpm_unmarshal_TPM_STANY_FLAGS(&ptr, &len, &tpmData.stany.flags)
> -       || tpm_unmarshal_BOOL(&ptr, &len, &tpmData.permanent.flags.selfTestSucceeded)
> -       || tpm_unmarshal_BOOL(&ptr, &len, &tpmData.permanent.flags.owned)
> --      || tpm_unmarshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)) {
> -+      || tpm_unmarshal_TPM_STCLEAR_DATA(&ptr, &len, &tpmData.stclear.data)
> -+      || tpm_unmarshal_TPM_PERMANENT_DATA(&ptr, &len, &tpmData.permanent.data)
> -+      || tpm_unmarshal_TPM_STANY_DATA(&ptr, &len, &tpmData.stany.data)) {
> -     tpm_free(buf);
> -     return -1;
> -   }
> -+
> -   tpm_free(buf);
> -   return 0;
> - }
> -
> - int tpm_erase_permanent_data(void)
> - {
> --  int res = write_to_file("", 0);
> -+  int res = write_to_file((uint8_t *) "", 0);
> -   return res;
> - }
> -
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_deprecated.c tpm_emulator/tpm/tpm_deprecated.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_deprecated.c 2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_deprecated.c  2006-07-24 14:35:35.000000000 -0700
> -@@ -1,6 +1,7 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -50,7 +51,7 @@ TPM_RESULT TPM_SaveKeyContext(TPM_KEY_HA
> -   BYTE *ptr;
> -   UINT32 len;
> -   info("TPM_SaveKeyContext()");
> --  res = TPM_SaveContext(keyHandle, TPM_RT_KEY, "SaveKeyContext..",
> -+  res = TPM_SaveContext(keyHandle, TPM_RT_KEY, (BYTE*)"SaveKeyContext..",
> -                         keyContextSize, &contextBlob);
> -   if (res != TPM_SUCCESS) return res;
> -   len = *keyContextSize;
> -@@ -82,7 +83,7 @@ TPM_RESULT TPM_SaveAuthContext(TPM_AUTHH
> -   BYTE *ptr;
> -   UINT32 len;
> -   info("TPM_SaveAuthContext()");
> --  res = TPM_SaveContext(authHandle, TPM_RT_KEY, "SaveAuthContext.",
> -+  res = TPM_SaveContext(authHandle, TPM_RT_KEY, (BYTE*)"SaveAuthContext.",
> -                         authContextSize, &contextBlob);
> -   if (res != TPM_SUCCESS) return res;
> -   len = *authContextSize;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_emulator.h tpm_emulator/tpm/tpm_emulator.h
> ---- orig/tpm_emulator-0.4/tpm/tpm_emulator.h   2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_emulator.h    2006-07-24 14:35:35.000000000 -0700
> -@@ -1,5 +1,6 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -22,7 +23,8 @@
> - /* TPM configuration */
> - #define TPM_STORE_TO_FILE       1
> - #undef  TPM_STRONG_PERSISTENCE
> --#undef  TPM_GENERATE_EK
> -+//#undef  TPM_GENERATE_EK
> -+#define  TPM_GENERATE_EK
> - #undef  TPM_GENERATE_SEED_DAA
> -
> - #define TPM_MANUFACTURER 0x4554485A /* 'ETHZ' */
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_marshalling.c tpm_emulator/tpm/tpm_marshalling.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_marshalling.c        2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_marshalling.c 2006-07-24 14:35:35.000000000 -0700
> -@@ -1312,7 +1312,7 @@ int tpm_unmarshal_TPM_STANY_FLAGS(BYTE *
> -
> - int tpm_marshal_RSA(BYTE **ptr, UINT32 *length, rsa_private_key_t *v)
> - {
> --  UINT32 m_len, e_len, q_len;
> -+  size_t m_len, e_len, q_len;
> -   if (*length < sizeof_RSA((*v))) return -1;
> -   if (v->size > 0) {
> -     rsa_export_modulus(v, &(*ptr)[6], &m_len);
> -@@ -1460,6 +1460,66 @@ int tpm_unmarshal_TPM_PERMANENT_DATA(BYT
> -   return 0;
> - }
> -
> -+int tpm_marshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v)
> -+{
> -+  if (tpm_marshal_TPM_STRUCTURE_TAG(ptr, length, v->tag)
> -+    || tpm_marshal_TPM_NONCE(ptr, length, &v->contextNonceKey)
> -+    || tpm_marshal_TPM_COUNT_ID(ptr, length, v->countID) ) return -1;
> -+
> -+  return 0;
> -+}
> -+
> -+int tpm_unmarshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v)
> -+{
> -+  if (tpm_unmarshal_TPM_STRUCTURE_TAG(ptr, length, &v->tag)
> -+    || tpm_unmarshal_TPM_NONCE(ptr, length, &v->contextNonceKey)
> -+    || tpm_unmarshal_TPM_COUNT_ID(ptr, length, &v->countID) ) return -1;
> -+
> -+  return 0;
> -+}
> -+
> -+int tpm_marshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v)
> -+{
> -+  UINT32 i;
> -+  if (tpm_marshal_TPM_STRUCTURE_TAG(ptr, length, v->tag)
> -+    || tpm_marshal_TPM_NONCE(ptr, length, &v->contextNonceSession)
> -+    || tpm_marshal_TPM_DIGEST(ptr, length, &v->auditDigest)
> -+    || tpm_marshal_BOOL(ptr, length, v->auditSession)
> -+    || tpm_marshal_TPM_CURRENT_TICKS(ptr, length, &v->currentTicks)
> -+    || tpm_marshal_UINT32(ptr, length, v->contextCount)
> -+    || tpm_marshal_UINT32_ARRAY(ptr, length, v->contextList, TPM_MAX_SESSION_LIST)) return -1;
> -+  for (i = 0; i < TPM_MAX_SESSIONS; i++) {
> -+    if (tpm_marshal_TPM_SESSION_DATA(ptr, length, &v->sessions[i])) return -1;
> -+  }
> -+  for (i = 0; i < TPM_MAX_SESSIONS_DAA; i++) {
> -+    if (tpm_marshal_TPM_DAA_SESSION_DATA(ptr, length, &v->sessionsDAA[i])) return -1;
> -+  }
> -+  if (tpm_marshal_TPM_TRANSHANDLE(ptr, length, v->transExclusive)) return -1;
> -+
> -+  return 0;
> -+}
> -+
> -+int tpm_unmarshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v)
> -+{
> -+  UINT32 i;
> -+  if (tpm_unmarshal_TPM_STRUCTURE_TAG(ptr, length, &v->tag)
> -+    || tpm_unmarshal_TPM_NONCE(ptr, length, &v->contextNonceSession)
> -+    || tpm_unmarshal_TPM_DIGEST(ptr, length, &v->auditDigest)
> -+    || tpm_unmarshal_BOOL(ptr, length, &v->auditSession)
> -+    || tpm_unmarshal_TPM_CURRENT_TICKS(ptr, length, &v->currentTicks)
> -+    || tpm_unmarshal_UINT32(ptr, length, &v->contextCount)
> -+    || tpm_unmarshal_UINT32_ARRAY(ptr, length, v->contextList, TPM_MAX_SESSION_LIST)) return -1;
> -+  for (i = 0; i < TPM_MAX_SESSIONS; i++) {
> -+    if (tpm_unmarshal_TPM_SESSION_DATA(ptr, length, &v->sessions[i])) return -1;
> -+  }
> -+  for (i = 0; i < TPM_MAX_SESSIONS_DAA; i++) {
> -+    if (tpm_unmarshal_TPM_DAA_SESSION_DATA(ptr, length, &v->sessionsDAA[i])) return -1;
> -+  }
> -+  if (tpm_unmarshal_TPM_TRANSHANDLE(ptr, length, &v->transExclusive)) return -1;
> -+
> -+  return 0;
> -+}
> -+
> - int tpm_marshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v)
> - {
> -   if (tpm_marshal_BYTE(ptr, length, v->type)
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_marshalling.h tpm_emulator/tpm/tpm_marshalling.h
> ---- orig/tpm_emulator-0.4/tpm/tpm_marshalling.h        2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_marshalling.h 2006-07-24 14:35:35.000000000 -0700
> -@@ -432,6 +432,12 @@ int tpm_unmarshal_TPM_KEY_DATA(BYTE **pt
> - int tpm_marshal_TPM_PERMANENT_DATA(BYTE **ptr, UINT32 *length, TPM_PERMANENT_DATA *);
> - int tpm_unmarshal_TPM_PERMANENT_DATA(BYTE **ptr, UINT32 *length, TPM_PERMANENT_DATA *);
> -
> -+int tpm_marshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v);
> -+int tpm_unmarshal_TPM_STCLEAR_DATA(BYTE **ptr, UINT32 *length, TPM_STCLEAR_DATA *v);
> -+
> -+int tpm_marshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v);
> -+int tpm_unmarshal_TPM_STANY_DATA(BYTE **ptr, UINT32 *length, TPM_STANY_DATA *v);
> -+
> - int tpm_marshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v);
> - int tpm_unmarshal_TPM_SESSION_DATA(BYTE **ptr, UINT32 *length, TPM_SESSION_DATA *v);
> -
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_owner.c tpm_emulator/tpm/tpm_owner.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_owner.c      2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_owner.c       2006-07-24 14:35:35.000000000 -0700
> -@@ -108,7 +108,7 @@ TPM_RESULT TPM_TakeOwnership(TPM_PROTOCO
> -   TPM_RESULT res;
> -   rsa_private_key_t *ek = &tpmData.permanent.data.endorsementKey;
> -   TPM_KEY_DATA *srk = &tpmData.permanent.data.srk;
> --  UINT32 buf_size = ek->size >> 3;
> -+  size_t buf_size = ek->size >> 3, key_length;
> -   BYTE buf[buf_size];
> -
> -   info("TPM_TakeOwnership()");
> -@@ -173,7 +173,8 @@ TPM_RESULT TPM_TakeOwnership(TPM_PROTOCO
> -     return TPM_FAIL;
> -   }
> -   rsa_export_modulus(&srk->key, srkPub->pubKey.key,
> --    &srkPub->pubKey.keyLength);
> -+                   &key_length);
> -+  srkPub->pubKey.keyLength = (UINT32) key_length;
> -   /* setup tpmProof and set state to owned */
> -   tpm_get_random_bytes(tpmData.permanent.data.tpmProof.nonce,
> -     sizeof(tpmData.permanent.data.tpmProof.nonce));
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_startup.c tpm_emulator/tpm/tpm_startup.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_startup.c    2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_startup.c     2006-07-24 14:35:35.000000000 -0700
> -@@ -41,26 +41,29 @@ void TPM_Init(TPM_STARTUP_TYPE startupTy
> - TPM_RESULT TPM_Startup(TPM_STARTUP_TYPE startupType)
> - {
> -   int i;
> -+  int restore_fail;
> -   info("TPM_Startup(%d)", startupType);
> -   if (tpmData.stany.flags.postInitialise == FALSE) return TPM_INVALID_POSTINIT;
> --  /* reset STANY_FLAGS */
> --  SET_TO_ZERO(&tpmData.stany.flags);
> --  tpmData.stany.flags.tag = TPM_TAG_STANY_FLAGS;
> --  /* reset STANY_DATA (invalidates ALL sessions) */
> --  SET_TO_ZERO(&tpmData.stany.data);
> --  tpmData.stany.data.tag = TPM_TAG_STANY_DATA;
> --  /* init session-context nonce */
> --  SET_TO_RAND(&tpmData.stany.data.contextNonceSession);
> -+
> -+  /* try and restore state to get EK, SRK, etc */
> -+  restore_fail = tpm_restore_permanent_data();
> -+
> -   /* set data and flags according to the given startup type */
> -   if (startupType == TPM_ST_CLEAR) {
> --    /* if available, restore permanent data */
> --    tpm_restore_permanent_data();
> -+    /* reset STANY_FLAGS */
> -+    SET_TO_ZERO(&tpmData.stany.flags);
> -+    tpmData.stany.flags.tag = TPM_TAG_STANY_FLAGS;
> -+    /* reset STANY_DATA (invalidates ALL sessions) */
> -+    SET_TO_ZERO(&tpmData.stany.data);
> -+    tpmData.stany.data.tag = TPM_TAG_STANY_DATA;
> -+    /* init session-context nonce */
> -+    SET_TO_RAND(&tpmData.stany.data.contextNonceSession);
> -     /* reset PCR values */
> -     for (i = 0; i < TPM_NUM_PCR; i++) {
> --      if (tpmData.permanent.data.pcrAttrib[i].pcrReset)
> --        SET_TO_ZERO(tpmData.permanent.data.pcrValue[i].digest);
> -+      if (!tpmData.permanent.data.pcrAttrib[i].pcrReset)
> -+        SET_TO_ZERO(&tpmData.permanent.data.pcrValue[i].digest);
> -       else
> --        SET_TO_0xFF(tpmData.permanent.data.pcrValue[i].digest);
> -+        SET_TO_0xFF(&tpmData.permanent.data.pcrValue[i].digest);
> -     }
> -     /* reset STCLEAR_FLAGS */
> -     SET_TO_ZERO(&tpmData.stclear.flags);
> -@@ -79,7 +82,8 @@ TPM_RESULT TPM_Startup(TPM_STARTUP_TYPE
> -     /* init key-context nonce */
> -     SET_TO_RAND(&tpmData.stclear.data.contextNonceKey);
> -   } else if (startupType == TPM_ST_STATE) {
> --    if (tpm_restore_permanent_data()) {
> -+    /* restore must have been successful for TPM_ST_STATE */
> -+    if (restore_fail) {
> -       error("restoring permanent data failed");
> -       tpmData.permanent.data.testResult = "tpm_restore_permanent_data() failed";
> -       tpmData.permanent.flags.selfTestSucceeded = FALSE;
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_storage.c tpm_emulator/tpm/tpm_storage.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_storage.c    2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_storage.c     2006-07-24 14:35:35.000000000 -0700
> -@@ -58,6 +58,7 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
> -                         BYTE *enc, UINT32 *enc_size)
> - {
> -   UINT32 len;
> -+  size_t enc_size32 = *enc_size;
> -   BYTE *buf, *ptr;
> -   rsa_public_key_t pub_key;
> -   int scheme;
> -@@ -72,7 +73,7 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
> -   if (buf == NULL
> -       || tpm_marshal_TPM_SEALED_DATA(&ptr, &len, seal)
> -       || rsa_encrypt(&pub_key, scheme, buf, sizeof_TPM_SEALED_DATA((*seal)),
> --                     enc, enc_size)) {
> -+                     enc, &enc_size32)) {
> -     tpm_free(buf);
> -     rsa_release_public_key(&pub_key);
> -     return -1;
> -@@ -85,7 +86,8 @@ int encrypt_sealed_data(TPM_KEY_DATA *ke
> - int decrypt_sealed_data(TPM_KEY_DATA *key, BYTE *enc, UINT32 enc_size,
> -                         TPM_SEALED_DATA *seal, BYTE **buf)
> - {
> --  UINT32 len;
> -+  size_t len;
> -+  UINT32 len32;
> -   BYTE *ptr;
> -   int scheme;
> -   switch (key->encScheme) {
> -@@ -96,8 +98,12 @@ int decrypt_sealed_data(TPM_KEY_DATA *ke
> -   len = enc_size;
> -   *buf = ptr = tpm_malloc(len);
> -   if (*buf == NULL
> --      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len)
> --      || tpm_unmarshal_TPM_SEALED_DATA(&ptr, &len, seal)) {
> -+      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len) ){
> -+    tpm_free(*buf);
> -+    return -1;
> -+  }
> -+  len32 = len;
> -+  if (tpm_unmarshal_TPM_SEALED_DATA(&ptr, &len32, seal)) {
> -     tpm_free(*buf);
> -     return -1;
> -   }
> -@@ -240,11 +246,12 @@ TPM_RESULT TPM_Unseal(TPM_KEY_HANDLE par
> -
> - TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE keyHandle, UINT32 inDataSize,
> -                       BYTE *inData, TPM_AUTH *auth1,
> --                      UINT32 *outDataSize, BYTE **outData)
> -+                      UINT32 *outDataSize32, BYTE **outData)
> - {
> -   TPM_RESULT res;
> -   TPM_KEY_DATA *key;
> -   int scheme;
> -+  size_t outDataSize;
> -
> -   info("TPM_UnBind()");
> -   /* get key */
> -@@ -262,8 +269,8 @@ TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE key
> -   /* the size of the input data muss be greater than zero */
> -   if (inDataSize == 0) return TPM_BAD_PARAMETER;
> -   /* decrypt data */
> --  *outDataSize = inDataSize;
> --  *outData = tpm_malloc(*outDataSize);
> -+  outDataSize = inDataSize;
> -+  *outData = tpm_malloc(outDataSize);
> -   if (*outData == NULL) return TPM_NOSPACE;
> -   switch (key->encScheme) {
> -     case TPM_ES_RSAESOAEP_SHA1_MGF1: scheme = RSA_ES_OAEP_SHA1; break;
> -@@ -271,20 +278,21 @@ TPM_RESULT TPM_UnBind(TPM_KEY_HANDLE key
> -     default: tpm_free(*outData); return TPM_DECRYPT_ERROR;
> -   }
> -   if (rsa_decrypt(&key->key, scheme, inData, inDataSize,
> --      *outData, outDataSize)) {
> -+      *outData, &outDataSize)) {
> -     tpm_free(*outData);
> -     return TPM_DECRYPT_ERROR;
> -   }
> -   /* verify data if it is of type TPM_BOUND_DATA */
> -   if (key->encScheme == TPM_ES_RSAESOAEP_SHA1_MGF1
> -       || key->keyUsage != TPM_KEY_LEGACY) {
> --    if (*outDataSize < 5 || memcmp(*outData, "\x01\x01\00\x00\x02", 5) != 0) {
> -+    if (outDataSize < 5 || memcmp(*outData, "\x01\x01\00\x00\x02", 5) != 0) {
> -       tpm_free(*outData);
> -       return TPM_DECRYPT_ERROR;
> -     }
> --    *outDataSize -= 5;
> --    memmove(*outData, &(*outData)[5], *outDataSize);
> -+    outDataSize -= 5;
> -+    memmove(*outData, &(*outData)[5], outDataSize);
> -   }
> -+  *outDataSize32 = (UINT32) outDataSize;
> -   return TPM_SUCCESS;
> - }
> -
> -@@ -334,12 +342,13 @@ int compute_pubkey_digest(TPM_PUBKEY *ke
> - }
> -
> - int encrypt_private_key(TPM_KEY_DATA *key, TPM_STORE_ASYMKEY *store,
> --                        BYTE *enc, UINT32 *enc_size)
> -+                        BYTE *enc, UINT32 *enc_size32)
> - {
> -   UINT32 len;
> -   BYTE *buf, *ptr;
> -   rsa_public_key_t pub_key;
> -   int scheme;
> -+  size_t enc_size;
> -   switch (key->encScheme) {
> -     case TPM_ES_RSAESOAEP_SHA1_MGF1: scheme = RSA_ES_OAEP_SHA1; break;
> -     case TPM_ES_RSAESPKCSv15: scheme = RSA_ES_PKCSV15; break;
> -@@ -351,11 +360,12 @@ int encrypt_private_key(TPM_KEY_DATA *ke
> -   if (buf == NULL
> -       || tpm_marshal_TPM_STORE_ASYMKEY(&ptr, &len, store)
> -       || rsa_encrypt(&pub_key, scheme, buf, sizeof_TPM_STORE_ASYMKEY((*store)),
> --                     enc, enc_size)) {
> -+                     enc, &enc_size)) {
> -     tpm_free(buf);
> -     rsa_release_public_key(&pub_key);
> -     return -1;
> -   }
> -+  *enc_size32 = (UINT32) enc_size;
> -   tpm_free(buf);
> -   rsa_release_public_key(&pub_key);
> -   return 0;
> -@@ -364,7 +374,8 @@ int encrypt_private_key(TPM_KEY_DATA *ke
> - int decrypt_private_key(TPM_KEY_DATA *key, BYTE *enc, UINT32 enc_size,
> -                         TPM_STORE_ASYMKEY *store, BYTE **buf)
> - {
> --  UINT32 len;
> -+  UINT32 len32;
> -+  size_t len;
> -   BYTE *ptr;
> -   int scheme;
> -   switch (key->encScheme) {
> -@@ -375,8 +386,12 @@ int decrypt_private_key(TPM_KEY_DATA *ke
> -   len = enc_size;
> -   *buf = ptr = tpm_malloc(len);
> -   if (*buf == NULL
> --      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len)
> --      || tpm_unmarshal_TPM_STORE_ASYMKEY(&ptr, &len, store)) {
> -+      || rsa_decrypt(&key->key, scheme, enc, enc_size, *buf, &len) ) {
> -+    tpm_free(*buf);
> -+    return -1;
> -+  }
> -+  len32 = (UINT32) len;
> -+  if (tpm_unmarshal_TPM_STORE_ASYMKEY(&ptr, &len32, store)) {
> -     tpm_free(*buf);
> -     return -1;
> -   }
> -@@ -394,7 +409,7 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
> -   TPM_SESSION_DATA *session;
> -   TPM_STORE_ASYMKEY store;
> -   rsa_private_key_t rsa;
> --  UINT32 key_length;
> -+  size_t key_length;
> -
> -   info("TPM_CreateWrapKey()");
> -   /* get parent key */
> -@@ -450,11 +465,11 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
> -     }
> -   }
> -   /* generate key and store it */
> --  key_length = keyInfo->algorithmParms.parms.rsa.keyLength;
> --  if (rsa_generate_key(&rsa, key_length)) return TPM_FAIL;
> --  wrappedKey->pubKey.keyLength = key_length >> 3;
> -+  if (rsa_generate_key(&rsa, keyInfo->algorithmParms.parms.rsa.keyLength))
> -+    return TPM_FAIL;
> -+  wrappedKey->pubKey.keyLength = keyInfo->algorithmParms.parms.rsa.keyLength >> 3;
> -   wrappedKey->pubKey.key = tpm_malloc(wrappedKey->pubKey.keyLength);
> --  store.privKey.keyLength = key_length >> 4;
> -+  store.privKey.keyLength = keyInfo->algorithmParms.parms.rsa.keyLength >> 4;
> -   store.privKey.key = tpm_malloc(store.privKey.keyLength);
> -   wrappedKey->encDataSize = parent->key.size >> 3;
> -   wrappedKey->encData = tpm_malloc(wrappedKey->encDataSize);
> -@@ -466,9 +481,11 @@ TPM_RESULT TPM_CreateWrapKey(TPM_KEY_HAN
> -     tpm_free(wrappedKey->encData);
> -     return TPM_NOSPACE;
> -   }
> --  rsa_export_modulus(&rsa, wrappedKey->pubKey.key,
> --    &wrappedKey->pubKey.keyLength);
> --  rsa_export_prime1(&rsa, store.privKey.key, &store.privKey.keyLength);
> -+  rsa_export_modulus(&rsa, wrappedKey->pubKey.key,
> -+                   &key_length);
> -+  wrappedKey->pubKey.keyLength = (UINT32) key_length;
> -+  rsa_export_prime1(&rsa, store.privKey.key, &key_length);
> -+  store.privKey.keyLength = (UINT32) key_length;
> -   rsa_release_private_key(&rsa);
> -   /* compute the digest of the wrapped key (without encData) */
> -   if (compute_key_digest(wrappedKey, &store.pubDataDigest)) {
> -@@ -602,6 +619,7 @@ TPM_RESULT TPM_LoadKey2(TPM_KEY_HANDLE p
> -
> - int tpm_setup_key_parms(TPM_KEY_DATA *key, TPM_KEY_PARMS *parms)
> - {
> -+  size_t key_length;
> -   parms->algorithmID = TPM_ALG_RSA;
> -   parms->encScheme = key->encScheme;
> -   parms->sigScheme = key->sigScheme;
> -@@ -611,7 +629,8 @@ int tpm_setup_key_parms(TPM_KEY_DATA *ke
> -   parms->parms.rsa.exponent = tpm_malloc(parms->parms.rsa.exponentSize);
> -   if (parms->parms.rsa.exponent == NULL) return -1;
> -   rsa_export_exponent(&key->key, parms->parms.rsa.exponent,
> --    &parms->parms.rsa.exponentSize);
> -+    &key_length);
> -+  parms->parms.rsa.exponentSize = (UINT32) key_length;
> -   parms->parmSize = 12 + parms->parms.rsa.exponentSize;
> -   return 0;
> - }
> -@@ -622,6 +641,7 @@ TPM_RESULT TPM_GetPubKey(TPM_KEY_HANDLE
> -   TPM_RESULT res;
> -   TPM_KEY_DATA *key;
> -   TPM_DIGEST digest;
> -+  size_t key_length;
> -   info("TPM_GetPubKey()");
> -   /* get key */
> -   if (keyHandle == TPM_KH_SRK
> -@@ -650,8 +670,8 @@ TPM_RESULT TPM_GetPubKey(TPM_KEY_HANDLE
> -   pubKey->pubKey.keyLength = key->key.size >> 3;
> -   pubKey->pubKey.key = tpm_malloc(pubKey->pubKey.keyLength);
> -   if (pubKey->pubKey.key == NULL) return TPM_NOSPACE;
> --  rsa_export_modulus(&key->key, pubKey->pubKey.key,
> --    &pubKey->pubKey.keyLength);
> -+  rsa_export_modulus(&key->key, pubKey->pubKey.key, &key_length);
> -+  pubKey->pubKey.keyLength = (UINT32) key_length;
> -   if (tpm_setup_key_parms(key, &pubKey->algorithmParms) != 0) {
> -     error("TPM_GetPubKey(): tpm_setup_key_parms() failed.");
> -     tpm_free(pubKey->pubKey.key);
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_structures.h tpm_emulator/tpm/tpm_structures.h
> ---- orig/tpm_emulator-0.4/tpm/tpm_structures.h 2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_structures.h  2006-07-24 14:35:35.000000000 -0700
> -@@ -1958,6 +1958,7 @@ typedef struct tdTPM_DAA_ISSUER {
> -   TPM_DIGEST DAA_digest_gamma;
> -   BYTE DAA_generic_q[26];
> - } TPM_DAA_ISSUER;
> -+#define sizeof_TPM_DAA_ISSUER(s) (2 + (20 * 6) + 26 )
> -
> - /*
> -  * TPM_DAA_TPM ([TPM_Part2], Section 22.4)
> -@@ -1973,6 +1974,7 @@ typedef struct tdTPM_DAA_TPM {
> -   TPM_DIGEST DAA_rekey;
> -   UINT32 DAA_count;
> - } TPM_DAA_TPM;
> -+#define sizeof_TPM_DAA_TPM(s) (2 + (4 * 20) + 4)
> -
> - /*
> -  * TPM_DAA_CONTEXT ([TPM_Part2], Section 22.5)
> -@@ -1987,6 +1989,7 @@ typedef struct tdTPM_DAA_CONTEXT {
> -   BYTE DAA_scratch[256];
> -   BYTE DAA_stage;
> - } TPM_DAA_CONTEXT;
> -+#define sizeof_TPM_DAA_CONTEXT(s) (2 + (3 * 20) + 256 + 1)
> -
> - /*
> -  * TPM_DAA_JOINDATA ([TPM_Part2], Section 22.6)
> -@@ -1998,6 +2001,7 @@ typedef struct tdTPM_DAA_JOINDATA {
> -   BYTE DAA_join_u1[138];
> -   TPM_DIGEST DAA_digest_n0;
> - } TPM_DAA_JOINDATA;
> -+#define sizeof_TPM_DAA_JOINDATA(s) (1 + 1 + 20)
> -
> - /*
> -  * TPM_DAA_BLOB ([TPM_Part2], Section 22.8)
> -@@ -2202,6 +2206,7 @@ typedef struct tdTPM_STCLEAR_DATA {
> -   //UINT32 ownerReference;
> -   //BOOL disableResetLock;
> - } TPM_STCLEAR_DATA;
> -+#define sizeof_TPM_STCLEAR_DATA(s) (2 + 20 + 4)
> -
> - /*
> -  * TPM_SESSION_DATA
> -@@ -2238,6 +2243,11 @@ typedef struct tdTPM_DAA_SESSION_DATA {
> -   TPM_DAA_JOINDATA DAA_joinSession;
> -   TPM_HANDLE handle;
> - } TPM_DAA_SESSION_DATA;
> -+#define sizeof_TPM_DAA_SESSION_DATA(s) ( 1 \
> -+  + sizeof_TPM_DAA_ISSUER(s.DAA_issuerSettings) \
> -+  + sizeof_TPM_DAA_TPM(s.DAA_tpmSpecific) \
> -+  + sizeof_TPM_DAA_CONTEXT(s.DAA_session) \
> -+  + sizeof_TPM_DAA_JOINDATA(s.DAA_joinSession) + 4)
> -
> - /*
> -  * TPM_STANY_DATA ([TPM_Part2], Section 7.6)
> -@@ -2262,6 +2272,11 @@ typedef struct tdTPM_STANY_DATA {
> -   TPM_DAAHANDLE currentDAA;
> -   TPM_TRANSHANDLE transExclusive;
> - } TPM_STANY_DATA;
> -+#define sizeof_TPM_STANY_DATA(s) (2 + 20 + 20 + 1 \
> -+  + sizeof_TPM_CURRENT_TICKS(s.currentTicks) \
> -+  + 4 + (4 * TPM_MAX_SESSION_LIST) \
> -+  + (sizeof_TPM_SESSION_DATA(s.sessions[0]) * TPM_MAX_SESSION_LIST) \
> -+  + (sizeof_TPM_DAA_SESSION_DATA(s.sessionsDAA[0]) * TPM_MAX_SESSIONS_DAA) + 4)
> -
> - /*
> -  * TPM_DATA
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_testing.c tpm_emulator/tpm/tpm_testing.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_testing.c    2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_testing.c     2006-07-24 14:35:35.000000000 -0700
> -@@ -1,6 +1,7 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -95,24 +96,24 @@ static int tpm_test_sha1(void)
> -   struct {
> -     uint8_t *data; uint32_t repetitions; uint8_t *digest;
> -   } test_cases[] =  {{
> --    "abc", 1,
> --    "\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D"
> -+      (uint8_t*)"abc", 1,
> -+    (uint8_t*)"\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D"
> -   }, {
> --    "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 1,
> --    "\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29\xE5\xE5\x46\x70\xF1"
> -+    (uint8_t*)"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 1,
> -+    (uint8_t*)"\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29\xE5\xE5\x46\x70\xF1"
> -   }, {
> --    "a", 1000000,
> --    "\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F"
> -+    (uint8_t*)"a", 1000000,
> -+    (uint8_t*)"\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F"
> -   }, {
> --    "0123456701234567012345670123456701234567012345670123456701234567", 10,
> --    "\xDE\xA3\x56\xA2\xCD\xDD\x90\xC7\xA7\xEC\xED\xC5\xEB\xB5\x63\x93\x4F\x46\x04\x52"
> -+    (uint8_t*)"0123456701234567012345670123456701234567012345670123456701234567", 10,
> -+    (uint8_t*)"\xDE\xA3\x56\xA2\xCD\xDD\x90\xC7\xA7\xEC\xED\xC5\xEB\xB5\x63\x93\x4F\x46\x04\x52"
> -   }};
> -
> -   debug("tpm_test_sha1()");
> -   for (i = 0; i < sizeof(test_cases) / sizeof(test_cases[0]); i++) {
> -     sha1_init(&ctx);
> -     for (j = 0; j < test_cases[i].repetitions; j++)
> --      sha1_update(&ctx, test_cases[i].data, strlen(test_cases[i].data));
> -+      sha1_update(&ctx, test_cases[i].data, strlen((char*)test_cases[i].data));
> -     sha1_final(&ctx, digest);
> -     if (memcmp(digest, test_cases[i].digest, SHA1_DIGEST_LENGTH) != 0) return -1;
> -   }
> -@@ -128,41 +129,41 @@ static int tpm_test_hmac(void)
> -   struct {
> -     uint8_t *key, key_len, *data, data_len, *digest;
> -   } test_cases[] = {{
> --    "\x0b", 20, "Hi There", 8,
> --    "\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"
> -+    (uint8_t*)"\x0b", 20, (uint8_t*)"Hi There", 8,
> -+    (uint8_t*)"\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"
> -   }, {
> --    "Jefe", 4, "what do ya want for nothing?", 28,
> --    "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79"
> -+    (uint8_t*)"Jefe", 4, (uint8_t*)"what do ya want for nothing?", 28,
> -+    (uint8_t*)"\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79"
> -   }, {
> --    "\xaa", 20, "\xdd", 50,
> --    "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3"
> -+    (uint8_t*)"\xaa", 20, (uint8_t*)"\xdd", 50,
> -+    (uint8_t*)"\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3"
> -   }, {
> --    "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
> --    "\x15\x16\x17\x18\x19", 25, "\xcd", 50,
> --    "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda"
> -+    (uint8_t*)"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
> -+    "\x15\x16\x17\x18\x19", 25, (uint8_t*)"\xcd", 50,
> -+    (uint8_t*)"\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda"
> -   }, {
> --    "\x0c", 20, "Test With Truncation", 20,
> --    "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04"
> -+    (uint8_t*)"\x0c", 20, (uint8_t*)"Test With Truncation", 20,
> -+    (uint8_t*)"\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04"
> -   }, {
> --    "\xaa", 80, "Test Using Larger Than Block-Size Key - Hash Key First", 54,
> --    "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12"
> -+    (uint8_t*)"\xaa", 80, (uint8_t*)"Test Using Larger Than Block-Size Key - Hash Key First", 54,
> -+    (uint8_t*)"\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12"
> -   }, {
> --    "\xaa", 80,
> --    "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", 73,
> --    "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91"
> -+    (uint8_t*)"\xaa", 80,
> -+    (uint8_t*)"Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", 73,
> -+    (uint8_t*)"\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91"
> -   }};
> -
> -   debug("tpm_test_hmac()");
> -   for (i = 0; i < sizeof(test_cases) / sizeof(test_cases[0]); i++) {
> --    if (strlen(test_cases[i].key) < test_cases[i].key_len) {
> -+    if (strlen((char*)test_cases[i].key) < test_cases[i].key_len) {
> -       uint8_t key[test_cases[i].key_len];
> -       memset(key, test_cases[i].key[0], test_cases[i].key_len);
> -       hmac_init(&ctx, key, test_cases[i].key_len);
> -     } else {
> -       hmac_init(&ctx, test_cases[i].key, test_cases[i].key_len);
> -     }
> --    for (j = 0; j < test_cases[i].data_len; j += strlen(test_cases[i].data)) {
> --      hmac_update(&ctx, test_cases[i].data, strlen(test_cases[i].data));
> -+    for (j = 0; j < test_cases[i].data_len; j += strlen((char*)test_cases[i].data)) {
> -+      hmac_update(&ctx, test_cases[i].data, strlen((char*)test_cases[i].data));
> -     }
> -     hmac_final(&ctx, digest);
> -     if (memcmp(digest, test_cases[i].digest, SHA1_DIGEST_LENGTH) != 0) return -1;
> -@@ -173,9 +174,9 @@ static int tpm_test_hmac(void)
> - static int tpm_test_rsa_EK(void)
> - {
> -   int res = 0;
> --  char *data = "RSA PKCS #1 v1.5 Test-String";
> -+  uint8_t *data = (uint8_t*)"RSA PKCS #1 v1.5 Test-String";
> -   uint8_t buf[256];
> --  size_t buf_len, data_len = strlen(data);
> -+  size_t buf_len, data_len = strlen((char*)data);
> -   rsa_private_key_t priv_key;
> -   rsa_public_key_t pub_key;
> -
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_ticks.c tpm_emulator/tpm/tpm_ticks.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_ticks.c      2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_ticks.c       2006-07-24 14:35:35.000000000 -0700
> -@@ -1,6 +1,7 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -39,9 +40,7 @@ TPM_RESULT TPM_SetTickType(TPM_TICKTYPE
> - TPM_RESULT TPM_GetTicks(TPM_CURRENT_TICKS *currentTime)
> - {
> -   info("TPM_GetTicks()");
> --  memcpy(currentTime, &tpmData.stany.data.currentTicks,
> --    sizeof(TPM_CURRENT_TICKS));
> --  return TPM_SUCCESS;
> -+  return TPM_DISABLED_CMD;
> - }
> -
> - TPM_RESULT TPM_TickStampBlob(TPM_KEY_HANDLE keyHandle, TPM_NONCE *antiReplay,
> -@@ -49,64 +48,11 @@ TPM_RESULT TPM_TickStampBlob(TPM_KEY_HAN
> -                              TPM_CURRENT_TICKS *currentTicks,
> -                              UINT32 *sigSize, BYTE **sig)
> - {
> --  TPM_RESULT res;
> --  TPM_KEY_DATA *key;
> --  BYTE *info, *p;
> --  UINT32 info_length, length;
> -   info("TPM_TickStampBlob()");
> --  /* get key */
> --  key = tpm_get_key(keyHandle);
> --  if (key == NULL) return TPM_INVALID_KEYHANDLE;
> --  /* verify authorization */
> --  res = tpm_verify_auth(auth1, key->usageAuth, keyHandle);
> --  if (res != TPM_SUCCESS) return res;
> --  if (key->keyUsage != TPM_KEY_SIGNING && key->keyUsage != TPM_KEY_LEGACY
> --      && key->keyUsage != TPM_KEY_IDENTITY) return TPM_INVALID_KEYUSAGE;
> --  /* get current ticks */
> --  TPM_GetTicks(currentTicks);
> --  /* sign data using signature scheme PKCS1_SHA1 and TPM_SIGN_INFO container */
> --  *sigSize = key->key.size >> 3;
> --  *sig = tpm_malloc(*sigSize);
> --  if (*sig == NULL) return TPM_FAIL;
> --  /* setup TPM_SIGN_INFO structure */
> --  info_length = 30 + sizeof(TPM_DIGEST) + sizeof_TPM_CURRENT_TICKS(currentTicks);
> --  info = tpm_malloc(info_length);
> --  if (info == NULL) {
> --    tpm_free(*sig);
> --    return TPM_FAIL;
> --  }
> --  memcpy(&info[0], "\x05\x00TSTP", 6);
> --  memcpy(&info[6], antiReplay->nonce, 20);
> --  *(UINT32*)&info[26] = CPU_TO_BE32(20
> --                        + sizeof_TPM_CURRENT_TICKS(currentTicks));
> --  memcpy(&info[30], digestToStamp->digest, sizeof(TPM_DIGEST));
> --  p = &info[30 + sizeof(TPM_DIGEST)];
> --  length = sizeof_TPM_CURRENT_TICKS(currentTicks);
> --  if (tpm_marshal_TPM_CURRENT_TICKS(&p, &length, currentTicks)
> --      || rsa_sign(&key->key, RSA_SSA_PKCS1_SHA1, info, info_length, *sig)) {
> --    tpm_free(*sig);
> --    tpm_free(info);
> --    return TPM_FAIL;
> --  }
> --  return TPM_SUCCESS;
> -+  return TPM_DISABLED_CMD;
> - }
> -
> - void tpm_update_ticks(void)
> - {
> --  if (tpmData.stany.data.currentTicks.tag == 0) {
> --    tpmData.stany.data.currentTicks.tag = TPM_TAG_CURRENT_TICKS;
> --    tpmData.stany.data.currentTicks.currentTicks += tpm_get_ticks();
> --/* removed since v1.2 rev 94
> --    tpmData.stany.data.currentTicks.tickType = tpmData.permanent.data.tickType;
> --*/
> --    tpm_get_random_bytes(tpmData.stany.data.currentTicks.tickNonce.nonce,
> --      sizeof(TPM_NONCE));
> --    tpmData.stany.data.currentTicks.tickRate = 1;
> --/* removed since v1.2 rev 94
> --    tpmData.stany.data.currentTicks.tickSecurity = TICK_SEC_NO_CHECK;
> --*/
> --  } else {
> --    tpmData.stany.data.currentTicks.currentTicks += tpm_get_ticks();
> --  }
> - }
> -
> -diff -uprN orig/tpm_emulator-0.4/tpm/tpm_transport.c tpm_emulator/tpm/tpm_transport.c
> ---- orig/tpm_emulator-0.4/tpm/tpm_transport.c  2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm/tpm_transport.c   2006-07-24 14:35:35.000000000 -0700
> -@@ -189,7 +189,7 @@ static void decrypt_wrapped_command(BYTE
> -     sha1_init(&sha1);
> -     sha1_update(&sha1, auth->nonceEven.nonce, sizeof(auth->nonceEven.nonce));
> -     sha1_update(&sha1, auth->nonceOdd.nonce, sizeof(auth->nonceOdd.nonce));
> --    sha1_update(&sha1, "in", 2);
> -+    sha1_update(&sha1, (BYTE*)"in", 2);
> -     sha1_update(&sha1, secret, sizeof(TPM_SECRET));
> -     j = CPU_TO_BE32(i);
> -     sha1_update(&sha1, (BYTE*)&j, 4);
> -@@ -211,7 +211,7 @@ static void encrypt_wrapped_command(BYTE
> -     sha1_init(&sha1);
> -     sha1_update(&sha1, auth->nonceEven.nonce, sizeof(auth->nonceEven.nonce));
> -     sha1_update(&sha1, auth->nonceOdd.nonce, sizeof(auth->nonceOdd.nonce));
> --    sha1_update(&sha1, "out", 3);
> -+    sha1_update(&sha1, (BYTE*)"out", 3);
> -     sha1_update(&sha1, secret, sizeof(TPM_SECRET));
> -     j = CPU_TO_BE32(i);
> -     sha1_update(&sha1, (BYTE*)&j, 4);
> -diff -uprN orig/tpm_emulator-0.4/tpmd.c tpm_emulator/tpmd.c
> ---- orig/tpm_emulator-0.4/tpmd.c       1969-12-31 16:00:00.000000000 -0800
> -+++ tpm_emulator/tpmd.c        2006-07-24 14:35:35.000000000 -0700
> -@@ -0,0 +1,156 @@
> -+/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -+ * Copyright (C) 2005 INTEL Corp
> -+ *
> -+ * This module is free software; you can redistribute it and/or modify
> -+ * it under the terms of the GNU General Public License as published
> -+ * by the Free Software Foundation; either version 2 of the License,
> -+ * or (at your option) any later version.
> -+ *
> -+ * This module 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.
> -+ *
> -+ */
> -+
> -+#include <stdio.h>
> -+#include <stdlib.h>
> -+#include <unistd.h>
> -+#include <string.h>
> -+#include <sys/types.h>
> -+#include <sys/stat.h>
> -+#include <fcntl.h>
> -+#include <sys/time.h>
> -+
> -+#include "tpm_emulator.h"
> -+
> -+#define TPM_RX_FNAME "/var/tpm/tpm_in.fifo"
> -+#define TPM_TX_FNAME "/var/tpm/tpm_out.fifo"
> -+
> -+#define BUFFER_SIZE 2048
> -+
> -+static int devurandom=0;
> -+
> -+void get_random_bytes(void *buf, int nbytes) {
> -+
> -+  if (devurandom == 0) {
> -+    devurandom = open("/dev/urandom", O_RDONLY);
> -+  }
> -+
> -+  if (read(devurandom, buf, nbytes) != nbytes) {
> -+      printf("Can't get random number.\n");
> -+      exit(-1);
> -+  }
> -+}
> -+
> -+uint64_t tpm_get_ticks(void)
> -+{
> -+  //struct timeval tv;
> -+  //int gettimeofday(&tv, struct timezone *tz);
> -+  return 0;
> -+}
> -+
> -+int main(int argc, char **argv)
> -+{
> -+  uint8_t in[BUFFER_SIZE], *out;
> -+  uint32_t out_size;
> -+  int in_size, written;
> -+  int i;
> -+  struct stat file_info;
> -+
> -+  int tpm_tx_fh=-1, tpm_rx_fh=-1;
> -+  if (argc < 2) {
> -+    printf("Usage: tpmd clear|save|deactivated\n" );
> -+        return -1;
> -+  }
> -+
> -+  /* initialize TPM emulator */
> -+  if (!strcmp(argv[1], "clear")) {
> -+    printf("Initializing tpm: %s\n", argv[1]);
> -+    tpm_emulator_init(1);
> -+  } else if (!strcmp(argv[1], "save")) {
> -+    printf("Initializing tpm: %s\n", argv[1]);
> -+    tpm_emulator_init(2);
> -+  } else if (!strcmp(argv[1], "deactivated")) {
> -+    printf("Initializing tpm: %s\n", argv[1]);
> -+    tpm_emulator_init(3);
> -+  } else {
> -+    printf("invalid startup mode '%s'; must be 'clear', "
> -+      "'save' (default) or 'deactivated", argv[1]);
> -+    return -1;
> -+  }
> -+
> -+  if ( stat(TPM_RX_FNAME, &file_info) == -1) {
> -+    if ( mkfifo(TPM_RX_FNAME, S_IWUSR | S_IRUSR ) ) {
> -+      printf("Failed to create fifo %s.\n", TPM_RX_FNAME);
> -+      return -1;
> -+    }
> -+  }
> -+
> -+  if ( stat(TPM_TX_FNAME, &file_info) == -1) {
> -+    if ( mkfifo(TPM_TX_FNAME, S_IWUSR | S_IRUSR ) ) {
> -+      printf("Failed to create fifo %s.\n", TPM_TX_FNAME);
> -+      return -1;
> -+    }
> -+  }
> -+
> -+  while (1) {
> -+abort_command:
> -+    if (tpm_rx_fh < 0) {
> -+      tpm_rx_fh = open(TPM_RX_FNAME, O_RDONLY);
> -+    }
> -+
> -+    if (tpm_rx_fh < 0) {
> -+      printf("ERROR: failed to open devices to listen to guest.\n");
> -+      return -1;
> -+    }
> -+
> -+    if (tpm_tx_fh < 0) {
> -+      tpm_tx_fh = open(TPM_TX_FNAME, O_WRONLY);
> -+    }
> -+
> -+    if (tpm_tx_fh < 0) {
> -+      printf("ERROR: failed to open devices to respond to guest.\n");
> -+      return -1;
> -+    }
> -+
> -+    in_size = read(tpm_rx_fh, in, BUFFER_SIZE);
> -+    if (in_size < 6) { // Magic size of minium TPM command
> -+      printf("Recv[%d] to small: 0x", in_size);
> -+      if (in_size <= 0) {
> -+          close(tpm_rx_fh);
> -+          tpm_rx_fh = -1;
> -+          goto abort_command;
> -+      }
> -+    } else {
> -+      printf("Recv[%d]: 0x", in_size);
> -+      for (i=0; i< in_size; i++)
> -+        printf("%x ", in[i]);
> -+      printf("\n");
> -+    }
> -+
> -+
> -+    if (tpm_handle_command(in, in_size, &out, &out_size) != 0) {
> -+        printf("ERROR: Handler Failed.\n");
> -+    }
> -+
> -+    written = write(tpm_tx_fh, out, out_size);
> -+
> -+    if (written != out_size ) {
> -+      printf("ERROR: Part of response not written %d/%d.\nAttempt: ", written, out_size);
> -+    } else {
> -+      printf("Sent[%Zu]: ", out_size);
> -+    }
> -+    for (i=0; i< out_size; i++)
> -+      printf("%x ", out[i]);
> -+    printf("\n");
> -+    tpm_free(out);
> -+
> -+  } // loop
> -+
> -+  tpm_emulator_shutdown();
> -+
> -+  close(tpm_tx_fh);
> -+  close(tpm_rx_fh);
> -+
> -+}
> -Binary files orig/tpm_emulator-0.4/tpm_emulator and tpm_emulator/tpm_emulator differ
> -diff -uprN orig/tpm_emulator-0.4/tpm_version.h tpm_emulator/tpm_version.h
> ---- orig/tpm_emulator-0.4/tpm_version.h        2006-06-23 03:37:07.000000000 -0700
> -+++ tpm_emulator/tpm_version.h 2006-07-24 14:35:41.000000000 -0700
> -@@ -2,5 +2,5 @@
> - #define _TPM_VERSION_H_
> - #define VERSION_MAJOR 0
> - #define VERSION_MINOR 4
> --#define VERSION_BUILD 1151058734
> -+#define VERSION_BUILD 1153776940
> - #endif /* _TPM_VERSION_H_ */
> diff --git a/tools/vtpm/vtpm-0.5.1-LDLIBS.patch b/tools/vtpm/vtpm-0.5.1-LDLIBS.patch
> deleted file mode 100644
> index 95586c1..0000000
> --- a/tools/vtpm/vtpm-0.5.1-LDLIBS.patch
> +++ /dev/null
> @@ -1,12 +0,0 @@
> -diff -Naurp tpm_emulator-0.5.1/tpmd/Makefile tpm_emulator-0.5.1/tpmd/Makefile
> ---- tpm_emulator-0.5.1/tpmd/Makefile
> -+++ tpm_emulator-0.5.1/tpmd/Makefile
> -@@ -8,7 +8,7 @@ WFLAGS  := -Wall -Wno-unused -Wpointer-a
> -            #WFLAGS  += -Wextra -Wcast-qual -Wmissing-prototypes -Wmissing-declarations -Wstrict-aliasing
> - CFLAGS  += $(WFLAGS) -g -I.. -I. -O2 -fno-strict-aliasing
> - CFLAGS  += -I../../../../tools/vtpm_manager/manager
> --LDFLAGS += -lgmp
> -+LDLIBS  += -lgmp
> -
> - BINDIR  := /usr/bin/
> -
> diff --git a/tools/vtpm/vtpm-0.5.1.patch b/tools/vtpm/vtpm-0.5.1.patch
> deleted file mode 100644
> index 2aeb745..0000000
> --- a/tools/vtpm/vtpm-0.5.1.patch
> +++ /dev/null
> @@ -1,766 +0,0 @@
> -diff -Naurp tpm_emulator-0.5.1/Makefile tpm5-test/Makefile
> ---- tpm_emulator-0.5.1/Makefile        2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/Makefile 2009-07-15 09:45:28.000000000 -0400
> -@@ -10,7 +10,7 @@ VERSION_MINOR  := 5
> - VERSION_BUILD  := $(shell date +"%s")
> - VERSION_SUFFIX := .1
> -
> --SUBDIRS := tpmd tpmd_dev tddl
> -+SUBDIRS := tpmd
> -
> - all: version all-recursive
> -
> -@@ -48,12 +48,12 @@ user_install: user
> - modules_install: modules
> -       @$(MAKE) -C tpmd_dev install || exit -1
> -
> --DIRS    := . tpm crypto tpmd tpmd_dev tddl tpmd_dev_openbsd
> -+DIRS    := . tpm crypto tpmd
> - DISTSRC := $(foreach dir, $(DIRS), $(wildcard $(dir)/*.c))
> - DISTSRC += $(foreach dir, $(DIRS), $(wildcard $(dir)/*.h))
> --DIRS    := . tpmd tpmd_dev tddl tpmd_dev_openbsd
> -+DIRS    := . tpmd
> - DISTSRC += $(foreach dir, $(DIRS), $(dir)/Makefile)
> --DISTSRC += ./README ./AUTHORS ./ChangeLog tpmd_dev/tpmd_dev.rules.in
> -+DISTSRC += ./README ./AUTHORS ./ChangeLog
> - DISTDIR := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_SUFFIX)
> -
> - dist: $(DISTSRC)
> -diff -Naurp tpm_emulator-0.5.1/tpm/tpm_capability.c tpm5-test/tpm/tpm_capability.c
> ---- tpm_emulator-0.5.1/tpm/tpm_capability.c    2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/tpm/tpm_capability.c     2009-07-16 12:04:20.000000000 -0400
> -@@ -136,8 +136,19 @@ static TPM_RESULT cap_property(UINT32 su
> -
> -     case TPM_CAP_PROP_TIS_TIMEOUT:
> -       debug("[TPM_CAP_PROP_TIS_TIMEOUT]");
> --      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT */
> --      return TPM_FAIL;
> -+      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT: Measure these values and determine correct ones */
> -+      UINT32 len = *respSize = 16;
> -+      BYTE *ptr = *resp = tpm_malloc(*respSize);
> -+      if (ptr == NULL ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000)) {
> -+        tpm_free(*resp);
> -+        return TPM_FAIL;
> -+      }
> -+      return TPM_SUCCESS;
> -+
> -
> -     case TPM_CAP_PROP_STARTUP_EFFECT:
> -       debug("[TPM_CAP_PROP_STARTUP_EFFECT]");
> -@@ -189,8 +200,12 @@ static TPM_RESULT cap_property(UINT32 su
> -
> -     case TPM_CAP_PROP_DURATION:
> -       debug("[TPM_CAP_PROP_DURATION]");
> --      /* TODO: TPM_CAP_PROP_DURATION */
> --      return TPM_FAIL;
> -+      /* TODO: TPM_CAP_PROP_DURATION: Measure these values and return accurate ones */
> -+      BYTE dur[]= {0x0,0x0,0x0,0xc,0x0,0x7,0xa1,0x20,0x0,0x1e,0x84,0x80,0x11,0xe1,0xa3,0x0};
> -+      *respSize = 16;
> -+      *resp = tpm_malloc(*respSize);
> -+      memcpy(*resp,dur,16);
> -+
> -
> -     case TPM_CAP_PROP_ACTIVE_COUNTER:
> -       debug("[TPM_CAP_PROP_ACTIVE_COUNTER]");
> -diff -Naurp tpm_emulator-0.5.1/tpmd/Makefile tpm5-test/tpmd/Makefile
> ---- tpm_emulator-0.5.1/tpmd/Makefile   2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/tpmd/Makefile    2009-07-16 12:08:26.000000000 -0400
> -@@ -8,9 +8,10 @@ WFLAGS  := -Wall -Wno-unused -Wpointer-a
> -            -Wwrite-strings -Wsign-compare -Wno-multichar
> -            #WFLAGS  += -Wextra -Wcast-qual -Wmissing-prototypes -Wmissing-declarations -Wstrict-aliasing
> - CFLAGS  += $(WFLAGS) -g -I.. -I. -O2 -fno-strict-aliasing
> -+CFLAGS  += -I../../../../tools/vtpm_manager/manager
> - LDFLAGS += -lgmp
> -
> --BINDIR  := /usr/sbin/
> -+BINDIR  := /usr/bin/
> -
> - TPMD    := tpmd
> - DIRS    := ../tpm ../crypto
> -@@ -18,6 +19,8 @@ SRCS    := $(foreach dir, $(DIRS), $(wil
> - OBJS    := $(patsubst %.c, %.o, $(SRCS))
> - OBJS    := $(foreach dir, $(DIRS), $(patsubst $(dir)/%.o, %.o, $(filter $(dir)/%.o, $(OBJS))))
> -
> -+VTPM_BIN := vtpmd
> -+
> - vpath %.c $(strip $(DIRS))
> -
> - all: $(TPMD)
> -@@ -32,10 +35,8 @@ TPMD_GROUP ?= tss
> - INSTALL    ?= install
> -
> - install: $(TPMD)
> --      $(INSTALL) -m 755 -o $(TPMD_USER) -g $(TPMD_GROUP) -d $(DESTDIR)/var/lib/tpm
> --      $(INSTALL) -m 755 -o $(TPMD_USER) -g $(TPMD_GROUP) -d $(DESTDIR)/var/run/tpm
> -       $(INSTALL) -D -d $(DESTDIR)/$(BINDIR)
> --      $(INSTALL) -m 755 $(TPMD) $(DESTDIR)/$(BINDIR)
> -+      $(INSTALL) -m 755 $(TPMD) $(DESTDIR)/$(BINDIR)/$(VTPM_BIN)
> -
> - .PHONY: all clean install
> -
> -diff -Naurp tpm_emulator-0.5.1/tpmd/tpmd.c tpm5-test/tpmd/tpmd.c
> ---- tpm_emulator-0.5.1/tpmd/tpmd.c     2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/tpmd/tpmd.c      2009-07-16 11:19:05.000000000 -0400
> -@@ -32,6 +32,9 @@
> - #include <grp.h>
> - #include "tpm_emulator_config.h"
> - #include "tpm/tpm_emulator.h"
> -+#include "tpm/tpm_structures.h"
> -+#include "tpm/tpm_marshalling.h"
> -+#include "vtpm_manager.h"
> -
> - #define TPM_DAEMON_NAME     "tpmd"
> - #define TPM_CMD_BUF_SIZE    4096
> -@@ -39,6 +42,24 @@
> - #define TPM_RANDOM_DEVICE   "/dev/urandom"
> - #undef  TPM_MKDIRS
> -
> -+#ifdef VTPM_MULTI_VM
> -+ #define DEV_BE "/dev/vtpm"
> -+ #define DEV_FE "/dev/tpm"
> -+#else
> -+ #define PVM_RX_FIFO_D "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
> -+ #define PVM_TX_FIFO "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
> -+ #define HVM_RX_FIFO_D "/var/vtpm/socks/%d.socket"
> -+
> -+ #define VTPM_RX_FIFO_D "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
> -+ #define VTPM_TX_FIFO "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
> -+
> -+ static char *vtpm_rx_name=NULL;
> -+#endif
> -+
> -+ static int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> -+
> -+#define BUFFER_SIZE 2048
> -+
> - static volatile int stopflag = 0;
> - static int is_daemon = 0;
> - static int opt_debug = 0;
> -@@ -49,6 +70,8 @@ static const char *opt_storage_file = "/
> - static uid_t opt_uid = 0;
> - static gid_t opt_gid = 0;
> - static int tpm_startup = 2;
> -+static int vtpm_type = VTPM_TYPE_PVM;
> -+int dmi_id = 0;
> - static int rand_fh;
> -
> - void tpm_log(int priority, const char *fmt, ...)
> -@@ -90,56 +113,241 @@ uint64_t tpm_get_ticks(void)
> -
> - int tpm_write_to_file(uint8_t *data, size_t data_length)
> - {
> --    int fh;
> --    ssize_t res;
> --    fh = open(opt_storage_file, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> --    if (fh < 0) return -1;
> --    while (data_length > 0) {
> --        res = write(fh, data, data_length);
> --      if (res < 0) {
> --          close(fh);
> --          return -1;
> --      }
> --      data_length -= res;
> --      data += res;
> -+  int res, out_data_size, in_header_size;
> -+  BYTE *ptr, *out_data, *in_header;
> -+  UINT32 result, len, in_rsp_size;
> -+  UINT16 tag = VTPM_TAG_REQ;
> -+
> -+  printf("Saving NVM\n");
> -+  if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> -+#else
> -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_tx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Send request to VTPM Manager to encrypt data
> -+#ifdef VTPM_MUTLI_VM
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT + data_length;
> -+#else
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV + data_length;
> -+#endif
> -+
> -+  out_data = ptr = (BYTE *) malloc(len);
> -+
> -+  if (ptr == NULL
> -+#ifndef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> -+#endif
> -+        || tpm_marshal_UINT16(&ptr, &len, tag)
> -+#ifdef VTPM_MUTLI_VM
> -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> -+#else
> -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> -+#endif
> -+        || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_SAVENVM)
> -+        || tpm_marshal_BYTE_ARRAY(&ptr, &len, data, data_length)) {
> -+      free(out_data);
> -+      return -1;
> -+  }
> -+
> -+  printf("\tSending SaveNVM Command.\n");
> -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> -+  free(out_data);
> -+  if (res != out_data_size) return -1;
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_rx_fh = vtpm_tx_fh
> -+#else
> -+    if (vtpm_rx_name == NULL) {
> -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> -     }
> --    close(fh);
> --    return 0;
> -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Read Header of response so we can get the size & status
> -+#ifdef VTPM_MUTLI_VM
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  in_header = ptr = malloc(in_header_size);
> -+
> -+  printf("\tReading SaveNVM header.\n");
> -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> -+
> -+  if ( (res != in_header_size)
> -+#ifndef VTPM_MUTLI_VM
> -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> -+#endif
> -+         || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> -+         || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> -+         || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> -+        free(in_header);
> -+        return -1;
> -+  }
> -+  free(in_header);
> -+
> -+  if (result != VTPM_SUCCESS) {
> -+      return -1;
> -+  }
> -+
> -+#ifdef VTPM_MUTLI_VM
> -+  close(vtpm_tx_fh); close(vtpm_rx_fh);
> -+#endif
> -+
> -+  printf("\tFinishing up SaveNVM\n");
> -+  return (0);
> - }
> -
> - int tpm_read_from_file(uint8_t **data, size_t *data_length)
> - {
> --    int fh;
> --    ssize_t res;
> --    size_t total_length;
> --    fh = open(opt_storage_file, O_RDONLY);
> --    if (fh < 0) return -1;
> --    total_length = lseek(fh, 0, SEEK_END);
> --    lseek(fh, 0, SEEK_SET);
> --    *data = tpm_malloc(total_length);
> --    if (*data == NULL) {
> --        close(fh);
> --        return -1;
> --    }
> --    *data_length = 0;
> --    while (total_length > 0) {
> --        res = read(fh, &(*data)[*data_length], total_length);
> --      if (res < 0) {
> --          close(fh);
> --          tpm_free(*data);
> --          return -1;
> --      }
> --        *data_length += res;
> --      total_length -= res;
> -+  int res, out_data_size, in_header_size;
> -+  uint8_t *ptr, *out_data, *in_header;
> -+  UINT16 tag = VTPM_TAG_REQ;
> -+  UINT32 len, in_rsp_size, result;
> -+#ifdef VTPM_MUTLI_VM
> -+      int vtpm_rx_fh, vtpm_tx_fh;
> -+#endif
> -+
> -+  printf("Loading NVM.\n");
> -+  if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> -+#else
> -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_tx_fh < 0) {
> -+      printf("Error in read_from_file:301\n");
> -+              return -1;
> -+  }
> -+
> -+  // Send request to VTPM Manager to encrypt data
> -+#ifdef VTPM_MUTLI_VM
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  out_data = ptr = (BYTE *) malloc(len);
> -+
> -+  if (ptr == NULL
> -+#ifndef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> -+#endif
> -+      || tpm_marshal_UINT16(&ptr, &len, tag)
> -+#ifdef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> -+#else
> -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> -+#endif
> -+      || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_LOADNVM)) {
> -+    free(out_data);
> -+    printf("Error in read_from_file:325\n");
> -+
> -+    return -1;
> -+  }
> -+
> -+  printf("\tSending LoadNVM command\n");
> -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> -+  free(out_data);
> -+  if (res != out_data_size)
> -+    {
> -+      printf("Error in read_from_file:335\n");
> -+      return -1;
> -+    }
> -+
> -+    if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_rx_fh = vtpm_tx_fh;
> -+#else
> -+    if (vtpm_rx_name == NULL) {
> -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> -     }
> --    close(fh);
> --    return 0;
> -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+      printf("Error in read_from_file:352\n");
> -+      return -1;
> -+  }
> -+
> -+  // Read Header of response so we can get the size & status
> -+#ifdef VTPM_MUTLI_VM
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  in_header = ptr = malloc(in_header_size);
> -+
> -+  printf("\tReading LoadNVM header\n");
> -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> -+
> -+  if ( (res != in_header_size)
> -+#ifndef VTPM_MUTLI_VM
> -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> -+#endif
> -+       || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> -+       || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> -+       || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> -+      free(in_header);
> -+      printf("Error in read_from_file:375\n");
> -+      return -1;
> -+  }
> -+  free(in_header);
> -+
> -+  if (result != VTPM_SUCCESS) {
> -+    printf("Error in read_from_file:381\n");
> -+    return -1;
> -+  }
> -+
> -+  // Read Encrypted data from VTPM Manager
> -+  *data_length = in_rsp_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> -+  *data = (uint8_t *) malloc(*data_length);
> -+
> -+  printf("\tReading clear data from LoadNVM.\n");
> -+  res = read(vtpm_rx_fh, *data, *data_length);
> -+#ifdef VTPM_MUTLI_VM
> -+  close(vtpm_rx_fh);close(vtpm_tx_fh);
> -+#endif
> -+
> -+  printf("\tReturing from loading NVM\n");
> -+  if (res != (int)*data_length) {
> -+      free(*data);
> -+      printf("Error in read_from_file:398\n");
> -+      return -1;
> -+  } else {
> -+      return 0;
> -+  }
> -+
> -+
> -+
> - }
> -
> - static void print_usage(char *name)
> - {
> -     printf("usage: %s [-d] [-f] [-s storage file] [-u unix socket name] "
> --           "[-o user name] [-g group name] [-h] [startup mode]\n", name);
> -+           "[-o user name] [-g group name] [-h]"
> -+#ifdef VTPM_MULTI_VM
> -+         "clear|save|deactivated\n", name);
> -+#else
> -+         "clear|save|deactivated pvm|hvm vtpmid\n", name);
> -+#endif
> -     printf("  d : enable debug mode\n");
> -     printf("  f : forces the application to run in the foreground\n");
> -     printf("  s : storage file to use (default: %s)\n", opt_storage_file);
> -@@ -205,7 +413,13 @@ static void parse_options(int argc, char
> -                 exit(EXIT_SUCCESS);
> -         }
> -     }
> --    if (optind < argc) {
> -+    /*Make sure we have all required options*/
> -+#ifdef VTPM_MULTI_VM
> -+#define EXTRA_OPTS 0
> -+#else
> -+#define EXTRA_OPTS 2
> -+#endif
> -+    if (optind < argc - EXTRA_OPTS ) {
> -         debug("startup mode = '%s'", argv[optind]);
> -         if (!strcmp(argv[optind], "clear")) {
> -             tpm_startup = 1;
> -@@ -219,6 +433,25 @@ static void parse_options(int argc, char
> -             print_usage(argv[0]);
> -             exit(EXIT_SUCCESS);
> -         }
> -+#ifndef VTPM_MULTI_VM
> -+        ++optind;
> -+      if(!strcmp(argv[optind], "pvm")) {
> -+              vtpm_type = VTPM_TYPE_PVM;      // Get commands from vTPM Manager through fifo
> -+      } else if (!strcmp(argv[optind], "hvm")) {
> -+              vtpm_type = VTPM_TYPE_HVM;      // Get commands from qemu via socket
> -+        } else {
> -+              error("Invalid vm mode '%s'; must be 'pvm', "
> -+                      "or 'hvm' ", argv[optind]);
> -+              print_usage(argv[0]);
> -+              exit(EXIT_SUCCESS);
> -+      }
> -+        ++optind;
> -+      dmi_id = atoi(argv[optind]);
> -+#endif
> -+    } else {
> -+      error("Invalid number of arguments");
> -+      print_usage(argv[0]);
> -+      exit(EXIT_SUCCESS);
> -     }
> - }
> -
> -@@ -348,93 +581,180 @@ static int init_socket(const char *name)
> -
> - static void main_loop(void)
> - {
> --    int sock, fh, res;
> --    int32_t in_len;
> -+    int32_t in_len, written;
> -     uint32_t out_len;
> --    uint8_t in[TPM_CMD_BUF_SIZE], *out;
> -+    uint8_t in[TPM_CMD_BUF_SIZE], *out, *addressed_out;
> -+    int guest_id=-1;
> -+    int i;
> -+    char *vtpm_rx_file=NULL;
> -+    int res;
> -+
> -+#ifndef VTPM_MULTI_VM
> -+    int sockfd = -1;
> -     struct sockaddr_un addr;
> --    socklen_t addr_len;
> --    fd_set rfds;
> --    struct timeval tv;
> -+    struct sockaddr_un client_addr;
> -+    unsigned int client_length;
> -+#endif
> -+
> -+    int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> -+
> -+#ifndef VTPM_MULTI_VM
> -+  if (vtpm_type == VTPM_TYPE_PVM) {
> -+    vtpm_rx_file = malloc(10 + strlen(PVM_RX_FIFO_D));
> -+    sprintf(vtpm_rx_file, PVM_RX_FIFO_D, (uint32_t) dmi_id);
> -+  } else {
> -+    vtpm_rx_file = malloc(10 + strlen(HVM_RX_FIFO_D));
> -+    sprintf(vtpm_rx_file, HVM_RX_FIFO_D, (uint32_t) dmi_id);
> -+
> -+    if ( (sockfd = socket(PF_UNIX,SOCK_STREAM,0)) < 0) {
> -+          error("Unable to create socket. errno = %d\n", errno);
> -+      exit (-1);
> -+    }
> -+
> -+    memset(&addr, 0, sizeof(addr));
> -+    addr.sun_family = AF_UNIX;
> -+    strcpy(addr.sun_path,vtpm_rx_file );
> -+    unlink(addr.sun_path);
> -+  }
> -+#endif
> -
> -     info("staring main loop");
> --    /* open UNIX socket */
> --    sock = init_socket(opt_socket_name);
> --    if (sock < 0) exit(EXIT_FAILURE);
> -     /* init tpm emulator */
> --    debug("initializing TPM emulator: %d", tpm_startup);
> -+#ifdef VTPM_MULTI_VM
> -+    debug("initializing TPM emulator: state=%d", tpm_startup);
> -+#else
> -+    debug("initializing TPM emulator: state=%d, type=%d, id=%d", tpm_startup, vtpm_type, dmi_id);
> -+#endif
> -     tpm_emulator_init(tpm_startup);
> -     /* start command processing */
> -     while (!stopflag) {
> -         /* wait for incomming connections */
> -         debug("waiting for connections...");
> --        FD_ZERO(&rfds);
> --        FD_SET(sock, &rfds);
> --        tv.tv_sec = 10;
> --        tv.tv_usec = 0;
> --        res = select(sock + 1, &rfds, NULL, NULL, &tv);
> --        if (res < 0) {
> --            error("select(sock) failed: %s", strerror(errno));
> --            break;
> --        } else if (res == 0) {
> --            continue;
> --        }
> --        addr_len = sizeof(addr);
> --        fh = accept(sock, (struct sockaddr*)&addr, &addr_len);
> --        if (fh < 0) {
> --            error("accept() failed: %s", strerror(errno));
> --            continue;
> --        }
> -+      if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+          vtpm_rx_fh = open(DEV_BE, O_RDWR);
> -+#else
> -+          if (vtpm_type == VTPM_TYPE_PVM)
> -+          {
> -+              vtpm_rx_fh = open(vtpm_rx_file, O_RDONLY);
> -+          } else {
> -+              if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
> -+                  error("Unable to bind(). errno = %d\n", errno);
> -+                  exit (-1);
> -+              }
> -+
> -+              if (listen(sockfd, 10) <0) {
> -+                  error("Unable to listen(). errno = %d\n", errno);
> -+                  exit (-1);
> -+              }
> -+
> -+               memset(&client_addr, 0, sizeof(client_addr));
> -+               client_length = sizeof(client_addr);
> -+
> -+               vtpm_rx_fh = vtpm_tx_fh = accept(sockfd, (struct sockaddr *)&client_addr, &client_length);
> -+          }
> -+#endif
> -+      }
> -+
> -+      /*Error Checking*/
> -+      if (vtpm_rx_fh < 0) {
> -+        error("Failed to open devices to listen to guest.\n");
> -+        exit(-1);
> -+      }
> -+
> -         /* receive and handle commands */
> -         in_len = 0;
> -         do {
> -             debug("waiting for commands...");
> --            FD_ZERO(&rfds);
> --            FD_SET(fh, &rfds);
> --            tv.tv_sec = TPM_COMMAND_TIMEOUT;
> --            tv.tv_usec = 0;
> --            res = select(fh + 1, &rfds, NULL, NULL, &tv);
> --            if (res < 0) {
> --                error("select(fh) failed: %s", strerror(errno));
> --                close(fh);
> --                break;
> --            } else if (res == 0) {
> --#ifdef TPMD_DISCONNECT_IDLE_CLIENTS
> --                info("connection closed due to inactivity");
> --                close(fh);
> --                break;
> --#else
> --                continue;
> --#endif
> --            }
> --            in_len = read(fh, in, sizeof(in));
> --            if (in_len > 0) {
> -+
> -+            in_len = read(vtpm_rx_fh, in, sizeof(in));
> -+          /*Magic size of minimum TPM command is 6*/
> -+              //FIXME Magic size check may not be required anymore
> -+            if (in_len < 6) {
> -+              info("Recv incomplete command of %d bytes.", in_len);
> -+              if (in_len <= 0) {
> -+                  close(vtpm_rx_fh);
> -+                  vtpm_rx_fh = -1;
> -+                  continue;
> -+                 }
> -+          } else {
> -+              /*Debug Printouts*/
> -                 debug("received %d bytes", in_len);
> -+              debug_nostop("Recv[%d]: 0x", in_len);
> -+              for (i=0; i< in_len; i++)
> -+                  debug_more("%x ", in[i]);
> -+              debug_more("\n");
> -+              /*Multiple Guest check*/
> -+              if (guest_id == -1) {
> -+                  guest_id = *((int32_t *) in);
> -+              } else {
> -+                  if (guest_id != *((int32_t *) in) ) {
> -+                      error("WARNING: More than one guest attached\n");
> -+                  }
> -+              }
> -+
> -+              /*Open tx handle now*/
> -+              if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+                  vtpm_tx_fh = open(DEV_BE, O_RDWR);
> -+                  vtpm_rx_fh = vtpm_tx_fh;
> -+#else
> -+                  if (vtpm_type == VTPM_TYPE_PVM) {
> -+                      vtpm_tx_fh = open(PVM_TX_FIFO, O_WRONLY);
> -+                  } // No need to open the other direction for HVM
> -+#endif
> -+              }
> -+              if (vtpm_tx_fh < 0) {
> -+                error("Failed to open devices to respond to guest.\n");
> -+                exit(-1);
> -+              }
> -+
> -+              /*Handle the TPM command now*/
> -                 out = NULL;
> --                res = tpm_handle_command(in, in_len, &out, &out_len);
> -+                res = tpm_handle_command(in + sizeof(uint32_t), in_len - sizeof(uint32_t), &out, &out_len);
> -                 if (res < 0) {
> -                     error("tpm_handle_command() failed");
> -                 } else {
> -                     debug("sending %d bytes", out_len);
> -+                  //FIXME this prepending may or may not be needed
> -+                  /*Prepend the first 4 bytes of the in buffer.. why?*/
> -+                  addressed_out = (uint8_t *) tpm_malloc(sizeof(uint32_t) + out_len);
> -+                  *(uint32_t *) addressed_out = *(uint32_t *) in;
> -+                  memcpy(addressed_out + sizeof(uint32_t), out, out_len);
> -+                  out_len += sizeof(uint32_t);
> -+                  /*End Prepend*/
> -+
> -+                  /*Perform write operation now*/
> -                     while (out_len > 0) {
> --                        res = write(fh, out, out_len);
> -+                        res = write(vtpm_tx_fh, addressed_out, out_len);
> -+
> -                         if (res < 0) {
> -                             error("write(%d) failed: %s", out_len, strerror(errno));
> -                             break;
> --                        }
> -+                        } else {
> -+                        debug_nostop("Sent[%Zu]: ", out_len);
> -+                        for (i=0; (unsigned int)i< out_len; i++)
> -+                          debug_more("%x ", addressed_out[i]);
> -+                        debug_more("\n");
> -+                      }
> -                         out_len       -= res;
> -                     }
> -                     tpm_free(out);
> -+                  tpm_free(addressed_out);
> -                 }
> -             }
> -         } while (in_len > 0);
> --        close(fh);
> -+        //close(fh);
> -     }
> -+
> -     /* shutdown tpm emulator */
> -     tpm_emulator_shutdown();
> --    /* close socket */
> --    close(sock);
> --    unlink(opt_socket_name);
> -+    /* Close handles */
> -+    close(vtpm_tx_fh);
> -+#ifndef VTPM_MULTI_VM
> -+    close(vtpm_rx_fh);
> -+    free(vtpm_rx_file);
> -+#endif
> -     info("main loop stopped");
> - }
> -
> -@@ -450,12 +770,13 @@ int main(int argc, char **argv)
> -     /* open random device */
> -     init_random();
> -     /* init signal handlers */
> --    init_signal_handler();
> -+    //init_signal_handler();
> -     /* unless requested otherwiese, fork and daemonize process */
> --    if (!opt_foreground) daemonize();
> -+    //if (!opt_foreground) daemonize();
> -     /* start main processing loop */
> -     main_loop();
> -     info("stopping TPM Emulator daemon");
> -     closelog();
> -     return 0;
> - }
> -+
> -diff -Naurp tpm_emulator-0.5.1/tpmd/tpm_emulator_config.h tpm5-test/tpmd/tpm_emulator_config.h
> ---- tpm_emulator-0.5.1/tpmd/tpm_emulator_config.h      2008-02-14 03:22:48.000000000 -0500
> -+++ tpm5-test/tpmd/tpm_emulator_config.h       2009-07-16 11:25:26.000000000 -0400
> -@@ -29,23 +29,28 @@
> -
> - /* TPM emulator configuration */
> -
> --#undef  TPM_STRONG_PERSISTENCE
> --#undef  TPM_GENERATE_EK
> -+#define  TPM_STRONG_PERSISTENCE
> -+#define  TPM_GENERATE_EK
> - #undef  TPM_GENERATE_SEED_DAA
> - #undef  TPM_MEMORY_ALIGNMENT_MANDATORY
> -
> -+extern int dmi_id;
> -+
> - /* log macros */
> -
> - void tpm_log(int priority, const char *fmt, ...);
> -
> --#define debug(fmt, ...) tpm_log(LOG_DEBUG, "%s:%d: Debug: " fmt "\n", \
> --                                __FILE__, __LINE__, ## __VA_ARGS__)
> --#define info(fmt, ...)  tpm_log(LOG_INFO, "%s:%d: Info: " fmt "\n", \
> --                                __FILE__, __LINE__, ## __VA_ARGS__)
> --#define error(fmt, ...) tpm_log(LOG_ERR, "%s:%d: Error: " fmt "\n", \
> --                                __FILE__, __LINE__, ## __VA_ARGS__)
> --#define alert(fmt, ...) tpm_log(LOG_ALERT, "%s:%d: Alert: " fmt "\n", \
> --                                __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug(fmt, ...) tpm_log(LOG_DEBUG, "VTPMD[%d]: %s:%d: Debug: " fmt "\n", \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define info(fmt, ...)  tpm_log(LOG_INFO, "VTPMD[%d]: %s:%d: Info: " fmt "\n", \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define error(fmt, ...) tpm_log(LOG_ERR, "VTPMD[%d]: %s:%d: Error: " fmt "\n", \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define alert(fmt, ...) tpm_log(LOG_ALERT, "VTPMD[%d]: %s:%d: Alert: " fmt "\n", \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug_nostop(fmt, ...) tpm_log(LOG_DEBUG, "VTPMD[%d]: %s:%d: Debug: " fmt, \
> -+                                dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug_more(fmt, ...) tpm_log(LOG_DEBUG, fmt, ## __VA_ARGS__)
> -
> - /*  min/max macros that also do strict type-checking */
> -
> diff --git a/tools/vtpm/vtpm.patch b/tools/vtpm/vtpm.patch
> deleted file mode 100644
> index e896b25..0000000
> --- a/tools/vtpm/vtpm.patch
> +++ /dev/null
> @@ -1,716 +0,0 @@
> -diff -uprN tpm_emulator/AUTHORS vtpm/AUTHORS
> ---- tpm_emulator/AUTHORS       2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/AUTHORS       2006-12-13 16:38:52.000000000 -0800
> -@@ -1,3 +1,3 @@
> - Mario Strasser <mast@gmx.net>
> - Heiko Stamer <stamer@gaos.org> [DAA]
> --INTEL Corp <> [Dropped to Ring3]
> -+INTEL Corp <> [VTPM Extensions]
> -diff -uprN tpm_emulator/ChangeLog vtpm/ChangeLog
> ---- tpm_emulator/ChangeLog     2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/ChangeLog     2006-12-13 16:38:52.000000000 -0800
> -@@ -1,5 +1,6 @@
> - ????-??-?? Intel Corp
> -       * Moved module out of kernel to run as a ring 3 app
> -+      * Modified save_to_file and load_from_file to call xen VTPM manager
> -
> - 2006-06-23  Mario Strasser <mast@gmx.net>
> -       * tpm_startup.c: behaviour of ST_CLEAR and storage of
> -diff -uprN tpm_emulator/linux_module.h vtpm/linux_module.h
> ---- tpm_emulator/linux_module.h        2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/linux_module.h        2007-01-09 14:49:06.000000000 -0800
> -@@ -44,18 +44,26 @@
> - #define TPM_DEVICE_NAME   "tpm"
> - #define TPM_MODULE_NAME   "tpm_emulator"
> -
> -+/* debug and log output functions */
> -+extern int dmi_id;
> -+
> - #ifdef DEBUG
> --#define debug(fmt, ...) printf("TPMD: %s:%d: Debug: " fmt "\n", \
> --                        __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug(fmt, ...) printf("TPMD[%d]: %s:%d: Debug: " fmt "\n", \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug_nostop(fmt, ...) printf("TPMD[%d]: %s:%d: Debug: " fmt, \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define debug_more(fmt, ...) printf( fmt, ## __VA_ARGS__ )
> - #else
> - #define debug(fmt, ...)
> -+#define debug_nostop(fmt, ...)
> -+#define debug_more(fmt, ...)
> - #endif
> --#define info(fmt, ...)  printf("TPMD: %s:%d: Info: " fmt "\n", \
> --                        __FILE__, __LINE__, ## __VA_ARGS__)
> --#define error(fmt, ...) printf("TPMD: %s:%d: Error: " fmt "\n", \
> --                        __FILE__, __LINE__, ## __VA_ARGS__)
> --#define alert(fmt, ...) printf("TPMD: %s:%d: Alert: " fmt "\n", \
> --                        __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define info(fmt, ...)  printf("TPMD[%d]: %s:%d: Info: " fmt "\n", \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define error(fmt, ...) printf("TPMD[%d]: %s:%d: Error: " fmt "\n", \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -+#define alert(fmt, ...) printf("TPMD[%d]: %s:%d: Alert: " fmt "\n", \
> -+                        dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
> -
> - /* memory allocation */
> -
> -diff -uprN tpm_emulator/Makefile vtpm/Makefile
> ---- tpm_emulator/Makefile      2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/Makefile      2006-12-13 16:38:52.000000000 -0800
> -@@ -7,7 +7,7 @@
> - COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
> -
> - # module settings
> --BIN            := tpm_emulator
> -+BIN            := vtpmd
> - VERSION_MAJOR  := 0
> - VERSION_MINOR  := 4
> - VERSION_BUILD  := $(shell date +"%s")
> -@@ -22,7 +22,7 @@ TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin
> -
> - CC      := gcc
> - CFLAGS  += -g -Wall $(INCLUDE) -DDEBUG
> --CFLAGS  += -I. -Itpm
> -+CFLAGS  += -I. -Itpm -I../../vtpm_manager/manager
> -
> - # Is the simulator running in it's own vm?
> - #CFLAGS += -DVTPM_MULTI_VM
> -@@ -62,7 +62,6 @@ $(BIN):      $(src)/crypto/gmp.h $(src)/crypt
> -
> - install: $(BIN)
> -       $(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)
> --      @if [ ! -d "/var/tpm" ]; then mkdir /var/tpm; fi
> -
> - clean:
> -       rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a $(OBJS)
> -@@ -98,3 +97,4 @@ version:
> -       @echo "#endif /* _TPM_VERSION_H_ */" >> $(src)/tpm_version.h
> -
> - .PHONY: all install clean dist gmp version
> -+
> -diff -uprN tpm_emulator/tpm/tpm_capability.c vtpm/tpm/tpm_capability.c
> ---- tpm_emulator/tpm/tpm_capability.c  2006-06-23 03:37:07.000000000 -0700
> -+++ vtpm/tpm/tpm_capability.c  2007-01-10 10:00:49.000000000 -0800
> -@@ -136,8 +136,18 @@ static TPM_RESULT cap_property(UINT32 su
> -
> -     case TPM_CAP_PROP_TIS_TIMEOUT:
> -       debug("[TPM_CAP_PROP_TIS_TIMEOUT]");
> --      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT */
> --      return TPM_FAIL;
> -+      /* TODO: TPM_CAP_PROP_TIS_TIMEOUT: Measure these values and determine correct ones */
> -+      UINT32 len = *respSize = 16;
> -+      BYTE *ptr = *resp = tpm_malloc(*respSize);
> -+      if (ptr == NULL ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000) ||
> -+          tpm_marshal_UINT32(&ptr, &len, 200000)) {
> -+        tpm_free(*resp);
> -+        return TPM_FAIL;
> -+      }
> -+      return TPM_SUCCESS;
> -
> -     case TPM_CAP_PROP_STARTUP_EFFECT:
> -       debug("[TPM_CAP_PROP_STARTUP_EFFECT]");
> -@@ -190,7 +200,11 @@ static TPM_RESULT cap_property(UINT32 su
> -
> -     case TPM_CAP_PROP_DURATION:
> -       debug("[TPM_CAP_PROP_DURATION]");
> --      /* TODO: TPM_CAP_PROP_DURATION */
> -+      /* TODO: TPM_CAP_PROP_DURATION: Measure these values and return accurate ones */
> -+      BYTE dur[]= {0x0,0x0,0x0,0xc,0x0,0x7,0xa1,0x20,0x0,0x1e,0x84,0x80,0x11,0xe1,0xa3,0x0};
> -+      *respSize = 16;
> -+      *resp = tpm_malloc(*respSize);
> -+      memcpy(*resp,dur,16);
> -       return TPM_FAIL;
> -
> -     case TPM_CAP_PROP_ACTIVE_COUNTER:
> -diff -uprN tpm_emulator/tpm/tpm_cmd_handler.c vtpm/tpm/tpm_cmd_handler.c
> ---- tpm_emulator/tpm/tpm_cmd_handler.c 2008-02-27 16:35:41.000000000 -0500
> -+++ vtpm/tpm/tpm_cmd_handler.c 2008-02-28 14:43:28.000000000 -0500
> -@@ -94,12 +94,18 @@ void tpm_compute_out_param_digest(TPM_CO
> -   sha1_ctx_t sha1;
> -   UINT32 res = CPU_TO_BE32(rsp->result);
> -   UINT32 ord = CPU_TO_BE32(ordinal);
> -+  UINT32 offset = 0;
> -
> -   /* compute SHA1 hash */
> -   sha1_init(&sha1);
> -   sha1_update(&sha1, (BYTE*)&res, 4);
> -   sha1_update(&sha1, (BYTE*)&ord, 4);
> --  sha1_update(&sha1, rsp->param, rsp->paramSize);
> -+  if (ordinal == TPM_ORD_LoadKey2) {
> -+      offset = 4;
> -+  }
> -+  if (rsp->paramSize - offset > 0) {
> -+      sha1_update(&sha1, rsp->param + offset, rsp->paramSize - offset);
> -+  }
> -   sha1_final(&sha1, rsp->auth1->digest);
> -   if (rsp->auth2 != NULL) memcpy(rsp->auth2->digest,
> -     rsp->auth1->digest, sizeof(rsp->auth1->digest));
> -diff -uprN tpm_emulator/tpm/tpm_data.c vtpm/tpm/tpm_data.c
> ---- tpm_emulator/tpm/tpm_data.c        2008-02-27 16:35:41.000000000 -0500
> -+++ vtpm/tpm/tpm_data.c        2008-02-27 16:35:40.000000000 -0500
> -@@ -1,6 +1,7 @@
> - /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
> -  * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
> -  *                    Swiss Federal Institute of Technology (ETH) Zurich
> -+ * Copyright (C) 2005 INTEL Corp
> -  *
> -  * This module is free software; you can redistribute it and/or modify
> -  * it under the terms of the GNU General Public License as published
> -@@ -15,10 +16,15 @@
> -  * $Id: tpm_data.c 98 2006-05-07 14:16:29Z hstamer $
> -  */
> -
> -+#include <sys/types.h>
> -+#include <sys/stat.h>
> -+#include <fcntl.h>
> -+#include <unistd.h>
> -+
> - #include "tpm_emulator.h"
> - #include "tpm_structures.h"
> - #include "tpm_marshalling.h"
> --#include "linux_module.h"
> -+#include "vtpm_manager.h"
> -
> - TPM_DATA tpmData;
> -
> -@@ -158,45 +164,232 @@ void tpm_release_data(void)
> - #include <sys/types.h>
> - #include <sys/stat.h>
> - #include <fcntl.h>
> --#include <unistd.h>
> -
> --#define TPM_STORAGE_FILE "/var/tpm/tpm_emulator-1.2." STR(VERSION_MAJOR) "." STR(VERSION_MINOR)
> -+ static int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> -+
> -+#ifdef VTPM_MUTLI_VM
> -+ #define DEV_FE "/dev/tpm"
> -+#else
> -+ #define VTPM_RX_FIFO_D  "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
> -+ #define VTPM_TX_FIFO  "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
> -+
> -+ extern int dmi_id;
> -+ static char *vtpm_rx_name=NULL;
> -+#endif
> -
> - static int write_to_file(uint8_t *data, size_t data_length)
> - {
> --  int res;
> --  int fp;
> --  fp = open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
> --  res = write(fp, data, data_length);
> --  close(fp);
> --  return (res == data_length) ? 0 : -1;
> -+  int res, out_data_size, in_header_size;
> -+  BYTE *ptr, *out_data, *in_header;
> -+  UINT32 result, len, in_rsp_size;
> -+  UINT16 tag = VTPM_TAG_REQ;
> -+
> -+  printf("Saving NVM\n");
> -+  if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> -+#else
> -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_tx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Send request to VTPM Manager to encrypt data
> -+#ifdef VTPM_MUTLI_VM
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT + data_length;
> -+#else
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV + data_length;
> -+#endif
> -+
> -+  out_data = ptr = (BYTE *) malloc(len);
> -+
> -+  if (ptr == NULL
> -+#ifndef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> -+#endif
> -+        || tpm_marshal_UINT16(&ptr, &len, tag)
> -+#ifdef VTPM_MUTLI_VM
> -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> -+#else
> -+        || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> -+#endif
> -+        || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_SAVENVM)
> -+        || tpm_marshal_BYTE_ARRAY(&ptr, &len, data, data_length)) {
> -+      free(out_data);
> -+      return -1;
> -+  }
> -+
> -+  printf("\tSending SaveNVM Command.\n");
> -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> -+  free(out_data);
> -+  if (res != out_data_size) return -1;
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_rx_fh = vtpm_tx_fh
> -+#else
> -+    if (vtpm_rx_name == NULL) {
> -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> -+    }
> -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Read Header of response so we can get the size & status
> -+#ifdef VTPM_MUTLI_VM
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  in_header = ptr = malloc(in_header_size);
> -+
> -+  printf("\tReading SaveNVM header.\n");
> -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> -+
> -+  if ( (res != in_header_size)
> -+#ifndef VTPM_MUTLI_VM
> -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> -+#endif
> -+         || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> -+         || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> -+         || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> -+        free(in_header);
> -+        return -1;
> -+  }
> -+  free(in_header);
> -+
> -+  if (result != VTPM_SUCCESS) {
> -+      return -1;
> -+  }
> -+
> -+#ifdef VTPM_MUTLI_VM
> -+  close(vtpm_tx_fh); close(vtpm_rx_fh);
> -+#endif
> -+
> -+  printf("\tFinishing up SaveNVM\n");
> -+  return (0);
> - }
> -
> - static int read_from_file(uint8_t **data, size_t *data_length)
> - {
> --  int res;
> --  int fp, file_status;
> --  struct stat file_info;
> --  fp = open(TPM_STORAGE_FILE, O_RDONLY, 0);
> --  file_status = fstat(fp, &file_info);
> --  if (file_status < 0) {
> --    close(fp);
> --    return -1;
> --  }
> -+  int res, out_data_size, in_header_size;
> -+  uint8_t *ptr, *out_data, *in_header;
> -+  UINT16 tag = VTPM_TAG_REQ;
> -+  UINT32 len, in_rsp_size, result;
> -+#ifdef VTPM_MUTLI_VM
> -+      int vtpm_rx_fh, vtpm_tx_fh;
> -+#endif
> -+
> -+  printf("Loading NVM.\n");
> -+  if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_tx_fh = open(DEV_FE, O_RDWR);
> -+#else
> -+      vtpm_tx_fh = open(VTPM_TX_FIFO, O_WRONLY);
> -+#endif
> -+  }
> -
> --  *data_length = file_info.st_size;
> --  *data = tpm_malloc(*data_length);
> --  if (*data == NULL) {
> --    close(fp);
> -+  if (vtpm_tx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Send request to VTPM Manager to encrypt data
> -+#ifdef VTPM_MUTLI_VM
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  out_data_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  out_data = ptr = (BYTE *) malloc(len);
> -+
> -+  if (ptr == NULL
> -+#ifndef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, dmi_id)
> -+#endif
> -+      || tpm_marshal_UINT16(&ptr, &len, tag)
> -+#ifdef VTPM_MUTLI_VM
> -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size)
> -+#else
> -+      || tpm_marshal_UINT32(&ptr, &len, out_data_size - sizeof(uint32_t))
> -+#endif
> -+      || tpm_marshal_UINT32(&ptr, &len, VTPM_ORD_LOADNVM)) {
> -+    free(out_data);
> -     return -1;
> -   }
> --  res = read(fp, *data, *data_length);
> --  close(fp);
> -+
> -+  printf("\tSending LoadNVM command\n");
> -+  res = write(vtpm_tx_fh, out_data, out_data_size);
> -+  free(out_data);
> -+  if (res != out_data_size) return -1;
> -+
> -+    if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+    vtpm_rx_fh = vtpm_tx_fh;
> -+#else
> -+    if (vtpm_rx_name == NULL) {
> -+      vtpm_rx_name = malloc(10 + strlen(VTPM_RX_FIFO_D));
> -+      sprintf(vtpm_rx_name, VTPM_RX_FIFO_D, (uint32_t) dmi_id);
> -+    }
> -+      vtpm_rx_fh = open(vtpm_rx_name, O_RDONLY);
> -+#endif
> -+  }
> -+
> -+  if (vtpm_rx_fh < 0) {
> -+              return -1;
> -+  }
> -+
> -+  // Read Header of response so we can get the size & status
> -+#ifdef VTPM_MUTLI_VM
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_CLT;
> -+#else
> -+  in_header_size = len = VTPM_COMMAND_HEADER_SIZE_SRV;
> -+#endif
> -+  in_header = ptr = malloc(in_header_size);
> -+
> -+  printf("\tReading LoadNVM header\n");
> -+  res = read(vtpm_rx_fh, in_header, in_header_size);
> -+
> -+  if ( (res != in_header_size)
> -+#ifndef VTPM_MUTLI_VM
> -+       || tpm_unmarshal_UINT32(&ptr, &len, (UINT32*)&dmi_id)
> -+#endif
> -+       || tpm_unmarshal_UINT16(&ptr, &len, &tag)
> -+       || tpm_unmarshal_UINT32(&ptr, &len, &in_rsp_size)
> -+       || tpm_unmarshal_UINT32(&ptr, &len, &result) ) {
> -+      free(in_header);
> -+      return -1;
> -+  }
> -+  free(in_header);
> -+
> -+  if (result != VTPM_SUCCESS) {
> -+      return -1;
> -+  }
> -+
> -+  // Read Encrypted data from VTPM Manager
> -+  *data_length = in_rsp_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> -+  *data = (uint8_t *) malloc(*data_length);
> -+
> -+  printf("\tReading clear data from LoadNVM.\n");
> -+  res = read(vtpm_rx_fh, *data, *data_length);
> -+#ifdef VTPM_MUTLI_VM
> -+  close(vtpm_rx_fh);close(vtpm_tx_fh);
> -+#endif
> -+
> -+  printf("\tReturing from loading NVM\n");
> -   if (res != *data_length) {
> --    tpm_free(*data);
> --    return -1;
> -+      free(*data);
> -+      return -1;
> -+  } else {
> -+      return 0;
> -   }
> --  return 0;
> -+
> - }
> -
> - #else
> -diff -uprN tpm_emulator/tpmd.c vtpm/tpmd.c
> ---- tpm_emulator/tpmd.c        2006-12-08 12:51:29.000000000 -0800
> -+++ vtpm/tpmd.c        2007-01-09 14:48:56.000000000 -0800
> -@@ -21,12 +21,24 @@
> - #include <sys/stat.h>
> - #include <fcntl.h>
> - #include <sys/time.h>
> -+#include <sys/socket.h>
> -+#include <sys/un.h>
> -+#include <errno.h>
> -
> - #include "tpm_emulator.h"
> -+#include "vtpm_manager.h"
> -
> --#define TPM_RX_FNAME "/var/tpm/tpm_in.fifo"
> --#define TPM_TX_FNAME "/var/tpm/tpm_out.fifo"
> -+#ifdef VTPM_MULTI_VM
> -+ #define DEV_BE "/dev/vtpm"
> -+#else
> -+ #define PVM_RX_FIFO_D "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
> -+ #define PVM_TX_FIFO "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
> -
> -+ #define HVM_RX_FIFO_D "/var/vtpm/socks/%d.socket"
> -+#endif
> -+
> -+ int dmi_id;
> -+
> - #define BUFFER_SIZE 2048
> -
> - static int devurandom=0;
> -@@ -38,7 +50,7 @@ void get_random_bytes(void *buf, int nby
> -   }
> -
> -   if (read(devurandom, buf, nbytes) != nbytes) {
> --      printf("Can't get random number.\n");
> -+      error("Can't get random number.\n");
> -       exit(-1);
> -   }
> - }
> -@@ -52,105 +64,182 @@ uint64_t tpm_get_ticks(void)
> -
> - int main(int argc, char **argv)
> - {
> --  uint8_t in[BUFFER_SIZE], *out;
> -+  uint8_t type, in[BUFFER_SIZE], *out, *addressed_out;
> -+  char *vtpm_rx_file=NULL;
> -   uint32_t out_size;
> -   int in_size, written;
> --  int i;
> --  struct stat file_info;
> -+  int i, guest_id=-1;
> -
> --  int tpm_tx_fh=-1, tpm_rx_fh=-1;
> -+#ifndef VTPM_MULTI_VM
> -+  int sockfd = -1;
> -+  struct sockaddr_un addr;
> -+  struct sockaddr_un client_addr;
> -+  unsigned int client_length;
> -+
> -+#endif
> -+
> -+  int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
> -+#ifdef VTPM_MULTI_VM
> -   if (argc < 2) {
> --    printf("Usage: tpmd clear|save|deactivated\n" );
> -+    error("Usage: tpmd clear|save|deactivated\n" );
> -+#else
> -+  if (argc < 4) {
> -+    error("Usage: tpmd clear|save|deactivated pvm|hvm vtpmid\n" );
> -+#endif
> -         return -1;
> -   }
> -
> -+#ifndef VTPM_MULTI_VM
> -+  /* setup type of vm */
> -+  if (!strcmp(argv[2], "pvm")) {
> -+    type = VTPM_TYPE_PVM; // Get commands from vTPM Manager through fifo
> -+  } else if (!strcmp(argv[2], "hvm")) {
> -+    type = VTPM_TYPE_HVM; // Get commands from qemu via socket
> -+  } else {
> -+    error("invalid vTPM type '%s'.\n", argv[2]);
> -+  }
> -+
> -+  dmi_id = atoi(argv[3]);
> -+
> -+  if (type == VTPM_TYPE_PVM) {
> -+    vtpm_rx_file = malloc(10 + strlen(PVM_RX_FIFO_D));
> -+    sprintf(vtpm_rx_file, PVM_RX_FIFO_D, (uint32_t) dmi_id);
> -+  } else {
> -+    vtpm_rx_file = malloc(10 + strlen(HVM_RX_FIFO_D));
> -+    sprintf(vtpm_rx_file, HVM_RX_FIFO_D, (uint32_t) dmi_id);
> -+
> -+    if ( (sockfd = socket(PF_UNIX,SOCK_STREAM,0)) < 0) {
> -+          error("Unable to create socket. errno = %d\n", errno);
> -+      exit (-1);
> -+    }
> -+
> -+    memset(&addr, 0, sizeof(addr));
> -+    addr.sun_family = AF_UNIX;
> -+    strcpy(addr.sun_path,vtpm_rx_file );
> -+    unlink(addr.sun_path);
> -+  }
> -+#endif
> -+
> -+#ifdef VTPM_MULTI_VM
> -+  info("Initializing tpm state: %s\n", argv[1]);
> -+#else
> -+  info("Initializing tpm state: %s, type: %s, id: %d\n", argv[1], argv[2], dmi_id);
> -+#endif
> -+
> -   /* initialize TPM emulator */
> -   if (!strcmp(argv[1], "clear")) {
> --    printf("Initializing tpm: %s\n", argv[1]);
> -     tpm_emulator_init(1);
> --  } else if (!strcmp(argv[1], "save")) {
> --    printf("Initializing tpm: %s\n", argv[1]);
> -+  } else if (!strcmp(argv[1], "save")) {
> -     tpm_emulator_init(2);
> -   } else if (!strcmp(argv[1], "deactivated")) {
> --    printf("Initializing tpm: %s\n", argv[1]);
> -     tpm_emulator_init(3);
> -   } else {
> --    printf("invalid startup mode '%s'; must be 'clear', "
> -+    error("invalid startup mode '%s'; must be 'clear', "
> -       "'save' (default) or 'deactivated", argv[1]);
> -     return -1;
> -   }
> --
> --  if ( stat(TPM_RX_FNAME, &file_info) == -1) {
> --    if ( mkfifo(TPM_RX_FNAME, S_IWUSR | S_IRUSR ) ) {
> --      printf("Failed to create fifo %s.\n", TPM_RX_FNAME);
> --      return -1;
> --    }
> --  }
> --
> --  if ( stat(TPM_TX_FNAME, &file_info) == -1) {
> --    if ( mkfifo(TPM_TX_FNAME, S_IWUSR | S_IRUSR ) ) {
> --      printf("Failed to create fifo %s.\n", TPM_TX_FNAME);
> --      return -1;
> --    }
> --  }
> --
> -+
> -   while (1) {
> - abort_command:
> --    if (tpm_rx_fh < 0) {
> --      tpm_rx_fh = open(TPM_RX_FNAME, O_RDONLY);
> -+    if (vtpm_rx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+      vtpm_rx_fh = open(DEV_BE, O_RDWR);
> -+#else
> -+      if (type == VTPM_TYPE_PVM) {
> -+        vtpm_rx_fh = open(vtpm_rx_file, O_RDONLY);
> -+      } else {
> -+        if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
> -+          error("Unable to bind(). errno = %d\n", errno);
> -+          exit (-1);
> -+        }
> -+
> -+        if (listen(sockfd, 10) <0) {
> -+          error("Unable to listen(). errno = %d\n", errno);
> -+          exit (-1);
> -+        }
> -+
> -+        memset(&client_addr, 0, sizeof(client_addr));
> -+        client_length = sizeof(client_addr);
> -+
> -+        vtpm_rx_fh = vtpm_tx_fh = accept(sockfd, (struct sockaddr *)&client_addr, &client_length);
> -+      }
> -+#endif
> -     }
> -
> --    if (tpm_rx_fh < 0) {
> --      printf("ERROR: failed to open devices to listen to guest.\n");
> -+    if (vtpm_rx_fh < 0) {
> -+      error("Failed to open devices to listen to guest.\n");
> -       return -1;
> -     }
> -
> --    if (tpm_tx_fh < 0) {
> --      tpm_tx_fh = open(TPM_TX_FNAME, O_WRONLY);
> --    }
> --
> --    if (tpm_tx_fh < 0) {
> --      printf("ERROR: failed to open devices to respond to guest.\n");
> --      return -1;
> --    }
> --
> --    in_size = read(tpm_rx_fh, in, BUFFER_SIZE);
> -+    in_size = read(vtpm_rx_fh, in, BUFFER_SIZE);
> -     if (in_size < 6) { // Magic size of minium TPM command
> --      printf("Recv[%d] to small: 0x", in_size);
> -+      info("Recv incomplete command of %d bytes.", in_size);
> -       if (in_size <= 0) {
> --          close(tpm_rx_fh);
> --          tpm_rx_fh = -1;
> -+          close(vtpm_rx_fh);
> -+          vtpm_rx_fh = -1;
> -           goto abort_command;
> -       }
> -     } else {
> --      printf("Recv[%d]: 0x", in_size);
> -+      debug_nostop("Recv[%d]: 0x", in_size);
> -       for (i=0; i< in_size; i++)
> --        printf("%x ", in[i]);
> --      printf("\n");
> -+        debug_more("%x ", in[i]);
> -+      debug_more("\n");
> -     }
> -
> --
> --    if (tpm_handle_command(in, in_size, &out, &out_size) != 0) {
> --        printf("ERROR: Handler Failed.\n");
> -+    if (guest_id == -1) {
> -+        guest_id = *((uint32_t *) in);
> -+    } else {
> -+        if (guest_id != *((uint32_t *) in) ) {
> -+            error("WARNING: More than one guest attached\n");
> -+        }
> -+    }
> -+
> -+    if (vtpm_tx_fh < 0) {
> -+#ifdef VTPM_MUTLI_VM
> -+      vtpm_tx_fh = open(DEV_BE, O_RDWR);
> -+      vtpm_rx_fh = vtpm_tx_fh;
> -+#else
> -+      if (type == VTPM_TYPE_PVM) {
> -+        vtpm_tx_fh = open(PVM_TX_FIFO, O_WRONLY);
> -+      } // No need to open the other direction for HVM
> -+#endif
> -+    }
> -+
> -+    if (vtpm_tx_fh < 0) {
> -+      error("Failed to open devices to respond to guest.\n");
> -+      return -1;
> -+    }
> -+
> -+    // Handle the command, but skip the domain id header
> -+    if (tpm_handle_command(in + sizeof(uint32_t), in_size - sizeof(uint32_t), &out, &out_size) != 0) {
> -+      error("Handler Failed.\n");
> -     }
> -
> --    written = write(tpm_tx_fh, out, out_size);
> -+    addressed_out = (uint8_t *) tpm_malloc(sizeof(uint32_t) + out_size);
> -+    *(uint32_t *) addressed_out = *(uint32_t *) in;
> -+    memcpy(addressed_out + sizeof(uint32_t), out, out_size);
> -+
> -+    written = write(vtpm_tx_fh, addressed_out, out_size + sizeof(uint32_t));
> -
> --    if (written != out_size ) {
> --      printf("ERROR: Part of response not written %d/%d.\nAttempt: ", written, out_size);
> -+    if (written != out_size + sizeof(uint32_t)) {
> -+      error("Part of response not written %d/%d.\n", written, out_size);
> -     } else {
> --      printf("Sent[%Zu]: ", out_size);
> -+      debug_nostop("Sent[%Zu]: ", out_size + sizeof(uint32_t));
> -+      for (i=0; i< out_size+ sizeof(uint32_t); i++)
> -+        debug_more("%x ", addressed_out[i]);
> -+      debug_more("\n");
> -     }
> --    for (i=0; i< out_size; i++)
> --      printf("%x ", out[i]);
> --    printf("\n");
> -     tpm_free(out);
> -+    tpm_free(addressed_out);
> -
> -   } // loop
> -
> -   tpm_emulator_shutdown();
> -
> --  close(tpm_tx_fh);
> --  close(tpm_rx_fh);
> -+  close(vtpm_tx_fh);
> -+#ifndef VTPM_MUTLI_VM
> -+  close(vtpm_rx_fh);
> -+  free (vtpm_rx_file);
> -+#endif
> -
> - }
> diff --git a/tools/vtpm_manager/COPYING b/tools/vtpm_manager/COPYING
> deleted file mode 100644
> index c4b86b7..0000000
> --- a/tools/vtpm_manager/COPYING
> +++ /dev/null
> @@ -1,32 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> diff --git a/tools/vtpm_manager/Makefile b/tools/vtpm_manager/Makefile
> deleted file mode 100644
> index 632f41b..0000000
> --- a/tools/vtpm_manager/Makefile
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../..
> -
> -# Base definitions and rules
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -SUBDIRS                = crypto tcs util manager migration
> -OPENSSL_HEADER = /usr/include/openssl/crypto.h
> -
> -.PHONY: all clean install
> -all clean install: %: subdirs-%
> -
> -.PHONY: mrproper
> -mrproper:
> -       @set -e; for subdir in $(SUBDIRS); do \
> -               $(MAKE) -C $$subdir $@; \
> -       done
> -
> -
> diff --git a/tools/vtpm_manager/README b/tools/vtpm_manager/README
> deleted file mode 100644
> index f0d1e98..0000000
> --- a/tools/vtpm_manager/README
> +++ /dev/null
> @@ -1,94 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -Directory Structure
> -===================
> -tools/vtpm_manager/crypto    -> crypto files
> -tools/vtpm_manager/TCS       -> TCS implementation
> -tools/vtpm_manager/util      -> Utility Library. Include disk-io and buffers.
> -tools/vtpm_manager/manager   -> VTPM Manager
> -
> -Compile Flags
> -===================
> -LOGGING_MODULES              -> How extensive logging happens
> -                                see util/log.h for more info
> -
> -VTPM_MULTI_VM                -> Defined: VTPMs run in their own VMs
> -                                Not Defined (default): VTPMs are processes
> -
> -# Debugging flags that may disappear without notice in the future
> -
> -DUMMY_BACKEND                -> vtpm_manager listens on /tmp/in.fifo and
> -                                /tmp/out.fifo rather than backend
> -
> -MANUAL_DM_LAUNCH             -> Must manually launch & kill VTPMs
> -
> -WELL_KNOWN_OWNER_AUTH        -> Rather than randomly generating the password for the owner,
> -                                use a well known value. This is useful for debugging and for
> -                                poor bios which do not support clearing TPM if OwnerAuth is
> -                                lost. However this has no protection from malicious app
> -                                issuing a TPM_OwnerClear to wipe the TPM
> -
> -Requirements
> -============
> -- xen-unstable
> -- vtpm frontend/backend driver patch
> -- OpenSSL Library
> -
> -Single-VM Flow
> -============================
> -- Launch the VTPM manager (vtpm_managerd) which which begins listening to the BE with one thread
> -  and listens to a named fifo that is shared by the vtpms to commuincate with the manager.
> -- VTPM Manager listens to TPM BE.
> -- When xend launches a tpm frontend equipped VM it contacts the manager over the vtpm backend.
> -- When the manager receives the open message from the BE, it launches a vtpm
> -- Xend allows the VM to continue booting.
> -- When a TPM request is issued to the front end, the front end transmits the TPM request to the backend.
> -- The manager receives the TPM requests and uses a named fifo to forward the request to the vtpm.
> -- The fifo listener begins listening for the reply from vtpm for the request.
> -- Vtpm processes request and replies to manager over shared named fifo.
> -- If needed, the vtpm may send a request to the vtpm_manager at any time to save it's secrets to disk.
> -- Manager receives response from vtpm and passes it back to backend for forwarding to guest.
> -
> -NOTES:
> -* SaveService SHOULD seal it's table before saving it to disk. However,
> -  the current Xen infrastructure does not provide a mechanism for this to be
> -  unsealed later. Specifically, the auth and wrapped key must be available ONLY
> -  to the service, or it's not even worth encrypting
> -
> -  In the future the vtpm manager will be protected by an early boot mechanism
> -  that will allow for better protection of it's data.
> -
> -TODO:
> -- Timeout on crashed vtpms
> -- create lock for shared fifo for talking to vtpms.
> diff --git a/tools/vtpm_manager/Rules.mk b/tools/vtpm_manager/Rules.mk
> deleted file mode 100644
> index 651772b..0000000
> --- a/tools/vtpm_manager/Rules.mk
> +++ /dev/null
> @@ -1,59 +0,0 @@
> -# Base definitions and rules (XEN_ROOT must be defined in including Makefile)
> -include $(XEN_ROOT)/tools/Rules.mk
> -
> -#
> -# Tool definitions
> -#
> -
> -# General compiler flags
> -CFLAGS = -Werror -g3
> -
> -# Generic project files
> -HDRS   = $(wildcard *.h)
> -SRCS   = $(wildcard *.c)
> -OBJS   = $(patsubst %.c,%.o,$(SRCS))
> -
> -# Generic (non-header) dependencies
> -$(SRCS): Makefile $(XEN_ROOT)/tools/Rules.mk $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -$(OBJS): $(SRCS)
> -
> --include $(FILES)
> -
> -# Make sure these are just rules
> -.PHONY : all build install clean
> -
> -#
> -# Project-specific definitions
> -#
> -
> -# Need UNIX98 spec for pthread rwlocks
> -CFLAGS += -D_GNU_SOURCE
> -
> -# Logging Level. See utils/tools.h for usage
> -CFLAGS += -DLOGGING_MODULES="(BITMASK(VTPM_LOG_TCS)|BITMASK(VTPM_LOG_VTSP)|BITMASK(VTPM_LOG_VTPM))"
> -
> -# Silent Mode
> -#CFLAGS += -DLOGGING_MODULES=0x0
> -#CFLAGS += -DLOGGING_MODULES=0xff
> -
> -# Use frontend/backend pairs between manager & DMs?
> -#CFLAGS += -DVTPM_MULTI_VM
> -
> -# vtpm_manager listens on fifo's rather than backend
> -#CFLAGS += -DDUMMY_BACKEND
> -
> -# TCS talks to fifo's rather than /dev/tpm. TPM Emulator assumed on fifos
> -#CFLAGS += -DDUMMY_TPM
> -
> -# Do not have manager launch DMs.
> -#CFLAGS += -DMANUAL_DM_LAUNCH
> -
> -# Fixed OwnerAuth
> -#CFLAGS += -DWELL_KNOWN_OWNER_AUTH
> -
> -# Include
> -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/crypto
> -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/util
> -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/tcs
> -CFLAGS += -I$(XEN_ROOT)/tools/vtpm_manager/manager
> diff --git a/tools/vtpm_manager/crypto/Makefile b/tools/vtpm_manager/crypto/Makefile
> deleted file mode 100644
> index 13b61c9..0000000
> --- a/tools/vtpm_manager/crypto/Makefile
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -BIN            = libtcpaCrypto.a
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIN)
> -
> -.PHONY: install
> -install: build
> -
> -.PHONY: clean
> -clean:
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIN): $(OBJS)
> -       $(AR) rcs $(BIN) $(OBJS)
> diff --git a/tools/vtpm_manager/crypto/crypto.c b/tools/vtpm_manager/crypto/crypto.c
> deleted file mode 100644
> index 7dae655..0000000
> --- a/tools/vtpm_manager/crypto/crypto.c
> +++ /dev/null
> @@ -1,88 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// crypto.c
> -//
> -//  This file will handle all the TPM Crypto functionality
> -//
> -// ==================================================================
> -
> -#include <string.h>
> -#include <openssl/crypto.h>
> -#include <openssl/err.h>
> -#include <openssl/evp.h>
> -#include <openssl/rand.h>
> -#include "crypto.h"
> -#include "log.h"
> -
> -/**
> - * Initialize cryptography library
> - * @rand: random seed
> - * @size: size of @rand
> - */
> -void Crypto_Init(const BYTE* rand, int size) {
> -       ERR_load_crypto_strings();
> -  CRYPTO_malloc_init();
> -  OpenSSL_add_all_algorithms();
> -  SYM_CIPHER = EVP_aes_128_cbc();
> -  RAND_poll();
> -  if (rand == NULL)
> -    return;
> -
> -  RAND_add(rand, size, size);
> -}
> -
> -/**
> - * Shutdown cryptography library
> - */
> -void Crypto_Exit() {
> -  ERR_free_strings();
> -  ERR_remove_state(0);
> -  EVP_cleanup();
> -}
> -
> -
> -/**
> - * Get random data
> - * @data: (OUT) Random data
> - * @size: Size of @data
> - */
> -void Crypto_GetRandom(void* data, int size) {
> -  int result;
> -
> -  result = RAND_pseudo_bytes((BYTE*) data, size);
> -
> -  if (result <= 0)
> -    vtpmlogerror (VTPM_LOG_CRYPTO, "RAND_pseudo_bytes failed: %s\n",
> -            ERR_error_string (ERR_get_error(), NULL));
> -}
> diff --git a/tools/vtpm_manager/crypto/crypto.h b/tools/vtpm_manager/crypto/crypto.h
> deleted file mode 100644
> index 488d4d6..0000000
> --- a/tools/vtpm_manager/crypto/crypto.h
> +++ /dev/null
> @@ -1,175 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// crypto.h
> -//
> -//  This file defines the TPM Crypto API
> -//
> -// ==================================================================
> -
> -#ifndef __CRYPTO_H__
> -#define __CRYPTO_H__
> -
> -#include <stddef.h>
> -#include <stdint.h>
> -#include <stdbool.h>
> -
> -#include "tcg.h"
> -#include "sym_crypto.h"
> -
> -#define CRYPTO_MAX_SIG_SIZE (2048 / 8)
> -#define CRYPTO_MAX_RSA_KEY_SIZE (4096 / 8) //in bytes
> -
> -#define OAEP_P "TCPA"
> -#define OAEP_P_SIZE 4
> -
> -// Algorithms supported by crypto. Stored in CRYPTO_INFO.algorithmID
> -#define CRYPTO_ALGORITH_RSA 0x01
> -
> -// Supported Encryption Schemes CRYPTO_INFO.encScheme
> -#define CRYPTO_ES_NONE 0x0001
> -#define CRYPTO_ES_RSAESPKCSv15 0x0002
> -#define CRYPTO_ES_RSAESOAEP_SHA1_MGF1 0x0003
> -
> -// Supported Signature schemes CRYPTO_INFO.sigScheme
> -#define CRYPTO_SS_NONE 0x0001
> -#define CRYPTO_SS_RSASSAPKCS1v15_SHA1 0x0002
> -#define CRYPTO_SS_RSASSAPKCS1v15_DER 0x0003
> -
> -typedef struct CRYPTO_INFO {
> -  void *keyInfo;
> -  UINT32 algorithmID;
> -  UINT32 encScheme;
> -  UINT32 sigScheme;
> -} CRYPTO_INFO;
> -
> -
> -void Crypto_Init(const BYTE* rand, int size);
> -
> -void Crypto_Exit();
> -
> -void Crypto_GetRandom(void* data, int size);
> -
> -void Crypto_HMAC(   const BYTE* text,
> -                    int text_len,
> -                    const BYTE* key,
> -                    int key_len,
> -                    BYTE* digest);
> -
> -TPM_RESULT Crypto_HMAC_buf (const buffer_t * text,
> -                            const buffer_t * key,
> -                            BYTE * o_digest); /* presumably of 20 bytes */
> -
> -void Crypto_SHA1Full(   const BYTE* text,
> -                        UINT32 size,
> -                        BYTE* hash); //Complete 3part SHA1
> -
> -// o_hash needs to be large enough to hold the digest, ie 20 bytes
> -TPM_RESULT Crypto_SHA1Full_buf (const buffer_t * buf,
> -                                BYTE * o_hash);
> -
> -void Crypto_SHA1Start(UINT32* maxNumBytes);
> -void Crypto_SHA1Update(int numBytes, const BYTE* hashData);
> -void Crypto_SHA1Complete(   int hashDataSize,
> -                            const BYTE* hashData,
> -                            BYTE* hashValue);
> -
> -void Crypto_RSACreateKey(   /*in*/ UINT32 keySize,
> -                            /*in*/ UINT32 pubExpSize,
> -                            /*in*/ BYTE *pubExp,
> -                            /*out*/ UINT32 *privExpSize,
> -                            /*out*/ BYTE *privExp,
> -                            /*out*/ UINT32 *modulusSize,
> -                            /*out*/ BYTE *modulus,
> -                            /*out*/ CRYPTO_INFO *keys);
> -
> -void Crypto_RSABuildCryptoInfo( /*[IN]*/ UINT32 pubExpSize,
> -                                /*[IN]*/ BYTE *pubExp,
> -                                /*[IN]*/ UINT32 privExpSize,
> -                                /*[IN]*/ BYTE *privExp,
> -                                /*[IN]*/ UINT32 modulusSize,
> -                                /*[IN]*/ BYTE *modulus,
> -                                /*[OUT]*/ CRYPTO_INFO* cryptoInfo);
> -
> -void Crypto_RSABuildCryptoInfoPublic(   /*[IN]*/ UINT32 pubExpSize,
> -                                        /*[IN]*/ BYTE *pubExp,
> -                                        /*[IN]*/ UINT32 modulusSize,
> -                                        /*[IN]*/ BYTE *modulus,
> -                                        CRYPTO_INFO* cryptoInfo);
> -
> -//
> -// symmetric pack and unpack operations
> -//
> -TPM_RESULT Crypto_RSAPackCryptoInfo (const CRYPTO_INFO* cryptoInfo,
> -                                     BYTE ** io_buf, UINT32 * io_buflen);
> -
> -TPM_RESULT Crypto_RSAUnpackCryptoInfo (CRYPTO_INFO * ci,
> -                                       BYTE * in, UINT32 len,
> -                                       UINT32 * o_lenread);
> -
> -
> -// return 0 on success, -1 on error
> -int Crypto_RSAEnc(  CRYPTO_INFO *keys,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *outDataSize,
> -                    /*out*/ BYTE *outData);
> -
> -// return 0 on success, -1 on error
> -int Crypto_RSADec(  CRYPTO_INFO *keys,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *outDataSize,
> -                    /*out*/ BYTE *outData);
> -
> -// return 0 on success, -1 on error
> -int Crypto_RSASign( CRYPTO_INFO *keys,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *sigSize,
> -                    /*out*/ BYTE *sig);
> -
> -bool Crypto_RSAVerify(  CRYPTO_INFO *keys,
> -                        UINT32 inDataSize,
> -                        BYTE *inData,
> -                        UINT32 sigSize,
> -                        BYTE *sig);
> -
> -//private:
> -int RSA_verify_DER(int dtype, unsigned char *m, unsigned int m_len,
> -                   unsigned char *sigbuf, unsigned int siglen, CRYPTO_INFO *key);
> -
> -int RSA_sign_DER(int type, unsigned char *m, unsigned int m_len,
> -              unsigned char *sigret, unsigned int *siglen, CRYPTO_INFO *key);
> -
> -#endif // __CRYPTO_H__
> diff --git a/tools/vtpm_manager/crypto/hash.c b/tools/vtpm_manager/crypto/hash.c
> deleted file mode 100644
> index c73114a..0000000
> --- a/tools/vtpm_manager/crypto/hash.c
> +++ /dev/null
> @@ -1,153 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// hash.c
> -//
> -//  This file will handle all the TPM Hash functionality
> -//
> -// ==================================================================
> -
> -#include <string.h>
> -#include <openssl/crypto.h>
> -#include <openssl/err.h>
> -#include <openssl/evp.h>
> -#include <openssl/rand.h>
> -#include <openssl/hmac.h>
> -#include <openssl/sha.h>
> -#include <openssl/bn.h>
> -#include <openssl/rsa.h>
> -
> -#include "tcg.h"         // for TPM_SUCCESS
> -#include "crypto.h"
> -
> -static SHA_CTX g_shaContext;
> -
> -void Crypto_HMAC(   const BYTE* text,
> -                    int text_len,
> -                    const BYTE* key,
> -                    int key_len,
> -                    BYTE* digest) {
> -  if (text == NULL || key == NULL || text_len == 0 || key_len == 0)
> -    return;
> -
> -  HMAC(EVP_sha1(), key, key_len, text, text_len, digest, NULL);
> -}
> -
> -TPM_RESULT Crypto_HMAC_buf (const buffer_t * text,
> -                           const buffer_t * key,
> -                           BYTE * o_digest) { /* presumably of 20 bytes */
> -
> -  Crypto_HMAC (text->bytes, text->size,
> -              key->bytes, key->size,
> -              o_digest);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -/*
> - * SHA1
> - * (OUT) Create a SHA1 hash of text. Calls all three SHA1 steps internally
> - */
> -void Crypto_SHA1Full( const BYTE* text,
> -      uint32_t size,
> -      BYTE* hash) {
> -
> -  if (text == NULL || size == 0)
> -    return;
> -
> -  // Run SHA1Start + SHAUpdate (if necessary) + SHAComplete
> -  uint32_t maxBytes; // Not used for anything
> -  Crypto_SHA1Start(&maxBytes);
> -
> -  while (size > 64){
> -    Crypto_SHA1Update(64, text);
> -    size -= 64;
> -    text += 64;
> -  }
> -
> -  Crypto_SHA1Complete(size, text, hash);
> -}
> -
> -// same thing using buffer_t
> -TPM_RESULT Crypto_SHA1Full_buf (const buffer_t * buf,
> -                                 BYTE * o_digest) {
> -
> -  if (buf->bytes == NULL || buf->size == 0)
> -    return TPM_BAD_PARAMETER;
> -
> -  Crypto_SHA1Full (buf->bytes, buf->size, o_digest);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -/*
> - * Initialize SHA1
> - * (OUT) Maximum number of bytes that can be sent to SHA1Update.
> - *   Must be a multiple of 64 bytes.
> - */
> -void Crypto_SHA1Start(uint32_t* maxNumBytes) {
> -  int max = SHA_CBLOCK;
> -  // Initialize the crypto library
> -  SHA1_Init(&g_shaContext);
> -  *maxNumBytes = max;
> -}
> -
> -/*
> - * Process SHA1
> - * @numBytes: (IN) The number of bytes in hashData.
> - *       Must be a multiple of 64 bytes.
> - * @hashData: (IN) Bytes to be hashed.
> - */
> -void Crypto_SHA1Update(int numBytes, const BYTE* hashData) {
> -
> -  if (hashData == NULL || numBytes == 0 || numBytes%64 != 0)
> -    return;
> -
> -  SHA1_Update(&g_shaContext, hashData, numBytes);
> -}
> -
> -/*
> - * Complete the SHA1 process
> - * @hashDataSize: (IN) Number of bytes in hashData.
> - *       Must be a multiple of 64 bytes.
> - * @hashData: (IN) Final bytes to be hashed.
> - * @hashValue: (OUT) The output of the SHA-1 hash.
> - */
> -void Crypto_SHA1Complete(int hashDataSize,
> -                        const BYTE* hashData,
> -                        BYTE* hashValue) {
> -  SHA1_Update(&g_shaContext, hashData, hashDataSize);
> -  SHA1_Final(hashValue, &g_shaContext);
> -}
> diff --git a/tools/vtpm_manager/crypto/rsa.c b/tools/vtpm_manager/crypto/rsa.c
> deleted file mode 100644
> index 7737dc6..0000000
> --- a/tools/vtpm_manager/crypto/rsa.c
> +++ /dev/null
> @@ -1,434 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// rsa.c
> -//
> -//  This file will handle all the TPM RSA crypto functionality
> -//
> -// ==================================================================
> -
> -#include <string.h>
> -#include <openssl/crypto.h>
> -#include <openssl/evp.h>
> -#include <openssl/bn.h>
> -#include <openssl/rsa.h>
> -#include <openssl/rand.h>
> -#include <openssl/x509.h>
> -
> -#include <openssl/err.h>
> -#include <stdio.h>
> -
> -#include "tcg.h"
> -#include "buffer.h"
> -#include "crypto.h"
> -#include "log.h"
> -
> -void Crypto_RSACreateKey(   /*in*/ UINT32 keySize,
> -                            /*in*/ UINT32 pubExpSize,
> -                            /*in*/ BYTE *pubExp,
> -                            /*out*/ UINT32 *privExpSize,
> -                            /*out*/ BYTE *privExp,
> -                            /*out*/ UINT32 *modulusSize,
> -                            /*out*/ BYTE *modulus,
> -                            /*out*/ CRYPTO_INFO *keys) {
> -  unsigned long e_value;
> -
> -  if (pubExpSize == 0) // Default e = 2^16+1
> -    e_value = (0x01 << 16) + 1;
> -  else {
> -    // This is not supported, but the following line MIGHT work
> -    // under then assumption that the format is BigNum compatable
> -    // Though it's not in the spec, so who knows what it is.
> -    // Forcing the default.
> -    //BN_bin2bn(pubExp, pubExpSize, NULL);
> -    e_value = (0x01 << 16) + 1;
> -  }
> -
> -  RSA *rsa = RSA_generate_key(keySize, e_value, NULL, NULL);
> -
> -  if (keys) {
> -    keys->keyInfo = rsa;
> -    keys->algorithmID = CRYPTO_ALGORITH_RSA;
> -  }
> -
> -  if (modulus)   *modulusSize   = BN_bn2bin(rsa->n, modulus);
> -  if (privExp)   *privExpSize   = BN_bn2bin(rsa->d, privExp);
> -}
> -
> -// Create a CRYPTO_INFO struct from the BYTE * key parts.
> -// If pubExp info is NULL, use TCG default.
> -// If there is a remainder while calculating the privExp, return FALSE.
> -
> -void Crypto_RSABuildCryptoInfo( /*[IN]*/ UINT32 pubExpSize,
> -                                /*[IN]*/ BYTE *pubExp,
> -                                /*[IN]*/ UINT32 privExpSize,
> -                                /*[IN]*/ BYTE *privExp,
> -                                /*[IN]*/ UINT32 modulusSize,
> -                                /*[IN]*/ BYTE *modulus,
> -                                CRYPTO_INFO* cryptoInfo) {
> -  cryptoInfo->keyInfo = RSA_new();
> -  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
> -
> -  rsa->e = BN_new();
> -
> -  if (pubExpSize == 0) { // Default e = 2^16+1
> -    BN_set_bit(rsa->e, 16);
> -    BN_set_bit(rsa->e, 0);
> -  } else {
> -    // This is not supported, but the following line MIGHT work
> -    // under then assumption that the format is BigNum compatable
> -    // Though it's not in the spec, so who knows what it is.
> -    // Forcing the default.
> -    //BN_bin2bn(pubExp, pubExpSize, NULL);
> -    BN_set_bit(rsa->e, 16);
> -    BN_set_bit(rsa->e, 0);
> -  }
> -
> -  rsa->n = BN_bin2bn(modulus, modulusSize, NULL);
> -  rsa->d = BN_bin2bn(privExp, privExpSize, NULL);
> -}
> -
> -// Create a CRYPTO_INFO struct from the BYTE * key parts.
> -// If pubExp info is NULL, use TCG default.
> -// If there is a remainder while calculating the privExp, return FALSE.
> -
> -void Crypto_RSABuildCryptoInfoPublic(   /*[IN]*/ UINT32 pubExpSize,
> -                                        /*[IN]*/ BYTE *pubExp,
> -                                        /*[IN]*/ UINT32 modulusSize,
> -                                        /*[IN]*/ BYTE *modulus,
> -                                        CRYPTO_INFO* cryptoInfo) {
> -  cryptoInfo->keyInfo = RSA_new();
> -  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
> -
> -  rsa->e = BN_new();
> -
> -  if (pubExpSize == 0) { // Default e = 2^16+1
> -    BN_set_bit(rsa->e, 16);
> -    BN_set_bit(rsa->e, 0);
> -  } else {
> -    // This is not supported, but the following line MIGHT work
> -    // under then assumption that the format is BigNum compatable
> -    // Though it's not in the spec, so who knows what it is.
> -    // Forcing the default.
> -    //BN_bin2bn(pubExp, pubExpSize, NULL);
> -    BN_set_bit(rsa->e, 16);
> -    BN_set_bit(rsa->e, 0);
> -  }
> -
> -  rsa->n = BN_bin2bn(modulus, modulusSize, NULL);
> -
> -}
> -
> -int Crypto_RSAEnc(  CRYPTO_INFO *key,
> -                   UINT32 inDataSize,
> -                   BYTE *inData,
> -                   /*out*/ UINT32 *outDataSize,
> -                   /*out*/ BYTE *outData) {
> -  RSA *rsa = (RSA *) key->keyInfo;
> -  UINT32 paddedDataSize = RSA_size (rsa);
> -  BYTE *paddedData = (BYTE *)malloc(sizeof(BYTE) * paddedDataSize);
> -  int rc;
> -
> -  if (paddedData == NULL)
> -    return -1;
> -
> -  *outDataSize = 0;
> -
> -  switch (key->encScheme) {
> -  case CRYPTO_ES_RSAESPKCSv15:
> -    if (RSA_padding_add_PKCS1_type_2(paddedData, paddedDataSize, inData, inDataSize) <= 0) {
> -      rc = -1;
> -      goto abort_egress;
> -    }
> -    break;
> -  case CRYPTO_ES_RSAESOAEP_SHA1_MGF1:
> -    if (RSA_padding_add_PKCS1_OAEP(paddedData,paddedDataSize,inData,inDataSize, (BYTE *) OAEP_P,OAEP_P_SIZE) <= 0 ) {
> -      rc = -1;
> -      goto abort_egress;
> -    }
> -    break;
> -  default:
> -    rc = -1;
> -    goto abort_egress;
> -  }
> -
> -  rc = RSA_public_encrypt(paddedDataSize, paddedData, outData, rsa, RSA_NO_PADDING);
> -  if (rc == -1)
> -    goto abort_egress;
> -
> -  *outDataSize = rc;
> -
> -  if (rc > 0) rc = 0;
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  if (paddedData)
> -    free (paddedData);
> -  return rc;
> -
> -}
> -
> -int Crypto_RSADec(  CRYPTO_INFO *key,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *outDataSize,
> -                    /*out*/ BYTE *outData) {
> -
> -  RSA *rsa = (RSA *) key->keyInfo;
> -  UINT32 paddedDataSize = RSA_size (rsa);
> -  BYTE *paddedData = (BYTE *)malloc(sizeof(BYTE) * paddedDataSize);
> -  int rc;
> -
> -  if (paddedData == NULL)
> -    goto abort_egress;
> -
> -  rc = RSA_private_decrypt(inDataSize, inData, paddedData, rsa, RSA_NO_PADDING);
> -  if (rc == -1) {
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_private_decrypt: %s\n", ERR_error_string(ERR_get_error(), NULL));
> -    goto abort_egress;
> -  }
> -
> -  paddedDataSize = rc;
> -
> -  switch (key->encScheme) {
> -  case CRYPTO_ES_RSAESPKCSv15:
> -    rc = RSA_padding_check_PKCS1_type_2 (outData, paddedDataSize,
> -                                        paddedData + 1, paddedDataSize - 1,
> -                                        RSA_size(rsa));
> -    if (rc == -1) {
> -      vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_padding_check_PKCS1_type_2: %s\n",
> -             ERR_error_string(ERR_get_error(), NULL));
> -      goto abort_egress;
> -    }
> -    *outDataSize = rc;
> -    break;
> -  case CRYPTO_ES_RSAESOAEP_SHA1_MGF1:
> -    rc = RSA_padding_check_PKCS1_OAEP(outData, paddedDataSize,
> -                                     paddedData + 1, paddedDataSize - 1,
> -                                     RSA_size(rsa),
> -                                     (BYTE *) OAEP_P, OAEP_P_SIZE);
> -    if (rc == -1) {
> -      vtpmlogerror(VTPM_LOG_CRYPTO, "RSA_padding_check_PKCS1_OAEP: %s\n",
> -             ERR_error_string(ERR_get_error(), NULL));
> -      goto abort_egress;
> -    }
> -    *outDataSize = rc;
> -    break;
> -  default:
> -    *outDataSize = 0;
> -  }
> -
> -  free(paddedData); paddedData = NULL;
> -  goto egress;
> -
> - abort_egress:
> -
> -  if (paddedData)
> -    free (paddedData);
> -  return -1;
> -
> - egress:
> -  return 0;
> -}
> -
> -// Signs either a SHA1 digest of a message or a DER encoding of a message
> -// Textual messages MUST be encoded or Hashed before sending into this function
> -// It will NOT SHA the message.
> -int Crypto_RSASign( CRYPTO_INFO *key,
> -                    UINT32 inDataSize,
> -                    BYTE *inData,
> -                    /*out*/ UINT32 *sigSize,
> -                    /*out*/ BYTE *sig) {
> -  int status;
> -  unsigned int intSigSize;
> -
> -  switch(key->sigScheme) {
> -  case CRYPTO_SS_RSASSAPKCS1v15_SHA1:
> -    status = RSA_sign(NID_sha1, inData, inDataSize, sig, &intSigSize, (RSA *) key->keyInfo);
> -    break;
> -  case CRYPTO_SS_RSASSAPKCS1v15_DER:
> -    //        status = Crypto_RSA_sign_DER(NID_md5_sha1, inData, inDataSize, sig, &intSigSize, key);
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "Crypto: Unimplemented sign type (%d)\n", key->sigScheme);
> -    status = 0;
> -    break;
> -  default:
> -    status = 0;
> -  }
> -
> -  if (status == 0) {
> -    *sigSize = 0;
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "%s\n", ERR_error_string(ERR_get_error(), NULL));
> -    return -1;
> -  }
> -
> -  *sigSize = (UINT32) intSigSize;
> -  return 0;
> -}
> -
> -bool Crypto_RSAVerify(  CRYPTO_INFO *key,
> -                        UINT32 inDataSize,
> -                        BYTE *inData,
> -                        UINT32 sigSize,
> -                        BYTE *sig) {
> -  int status;
> -
> -  switch(key->sigScheme){
> -  case CRYPTO_SS_RSASSAPKCS1v15_SHA1:
> -    status = RSA_verify(NID_sha1, inData, inDataSize, sig, sigSize, (RSA *) key->keyInfo);
> -    break;
> -  case CRYPTO_SS_RSASSAPKCS1v15_DER:
> -    //status = Crypto_RSA_verify_DER(NID_md5_sha1, inData, inDataSize, sig, sigSize, key);
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "Crypto: Unimplemented sign type (%d)\n", key->sigScheme);
> -    status = 0;
> -    break;
> -  default:
> -    status = 0;
> -  }
> -
> -  if (status)
> -    return(1);
> -  else {
> -    vtpmlogerror(VTPM_LOG_CRYPTO, "RSA verify: %s\n", ERR_error_string(ERR_get_error(), NULL));
> -    return(0);
> -  }
> -
> -}
> -
> -// helper which packs everything into a BIO!
> -
> -// packs the parameters first, then the private key, then the public key
> -// if *io_buf is NULL, allocate it here as needed. otherwise its size is in
> -// *io_buflen
> -TPM_RESULT Crypto_RSAPackCryptoInfo (const CRYPTO_INFO* cryptoInfo,
> -                                      BYTE ** io_buf, UINT32 * io_buflen) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -  BYTE * buf;
> -  long len, outlen = *io_buflen;
> -
> -  const long PARAMSLEN = 3*sizeof(UINT32);
> -
> -  RSA *rsa = (RSA *) cryptoInfo->keyInfo;
> -
> -  BIO *mem = BIO_new(BIO_s_mem());
> -
> -
> -  // write the openssl keys to the BIO
> -  if ( i2d_RSAPrivateKey_bio (mem, rsa) == 0 ) {
> -    ERR_print_errors_fp (stderr);
> -    ERRORDIE (TPM_SIZE);
> -  }
> -  if ( i2d_RSAPublicKey_bio (mem, rsa) == 0 ) {
> -    ERR_print_errors_fp (stderr);
> -    ERRORDIE (TPM_SIZE);
> -  }
> -
> -  // get the buffer out
> -  len = BIO_get_mem_data (mem, &buf);
> -
> -  // see if we need to allocate a return buffer
> -  if (*io_buf == NULL) {
> -    *io_buf = (BYTE*) malloc (PARAMSLEN + len);
> -    if (*io_buf == NULL)
> -      ERRORDIE (TPM_SIZE);
> -  } else {                      // *io_buf is already allocated
> -    if (outlen < len + PARAMSLEN)
> -      ERRORDIE (TPM_SIZE); // but not large enough!
> -  }
> -
> -  // copy over the parameters (three UINT32's starting at algorithmID)
> -  memcpy (*io_buf, &cryptoInfo->algorithmID, PARAMSLEN);
> -
> -  // copy over the DER keys
> -  memcpy (*io_buf + PARAMSLEN, buf, len);
> -
> -  *io_buflen = len + PARAMSLEN;
> -
> -  goto egress;
> -
> -
> - abort_egress:
> - egress:
> -
> -  BIO_free (mem);
> -
> -  return status;
> -}
> -
> -
> -
> -// sets up ci, and returns the number of bytes read in o_lenread
> -TPM_RESULT Crypto_RSAUnpackCryptoInfo (CRYPTO_INFO * ci,
> -                                        BYTE * in, UINT32 len,
> -                                        UINT32 * o_lenread) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  long l;
> -  BIO *mem;
> -  RSA *rsa;
> -
> -  // first load up the params
> -  l = 3 * sizeof(UINT32);
> -  memcpy (&ci->algorithmID, in, l);
> -  len -= l;
> -  in += l;
> -
> -  // and now the openssl keys, private first
> -  mem = BIO_new_mem_buf (in, len);
> -
> -  if ( (rsa = d2i_RSAPrivateKey_bio (mem, NULL)) == NULL ) {
> -    ERR_print_errors_fp (stderr);
> -    ERRORDIE (TPM_BAD_PARAMETER);
> -  }
> -  // now use the same RSA object and fill in the private key
> -  if ( d2i_RSAPublicKey_bio (mem, &rsa) == NULL ) {
> -    ERR_print_errors_fp (stderr);
> -    ERRORDIE (TPM_BAD_PARAMETER);
> -  }
> -
> -  ci->keyInfo = rsa;          // needs to be freed somehow later
> -
> -  // FIXME: havent figured out yet how to tell how many bytes were read in the
> -  // above oprations! so o_lenread is not set
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  BIO_free (mem);
> -
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/crypto/sym_crypto.c b/tools/vtpm_manager/crypto/sym_crypto.c
> deleted file mode 100644
> index 3d86e19..0000000
> --- a/tools/vtpm_manager/crypto/sym_crypto.c
> +++ /dev/null
> @@ -1,237 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// sym_crypto.c
> -//
> -//     Symmetric crypto portion of crypto
> -//
> -// ==================================================================
> -
> -#include <openssl/evp.h>
> -#include <openssl/rand.h>
> -
> -#include "tcg.h"
> -#include "sym_crypto.h"
> -
> -typedef enum crypt_op_type_t {
> -  CRYPT_ENCRYPT,
> -  CRYPT_DECRYPT
> -} crypt_op_type_t;
> -
> -TPM_RESULT ossl_symcrypto_op (symkey_t* key,
> -                              const buffer_t* in,
> -                              const buffer_t* iv,
> -                              buffer_t * out,
> -                              crypt_op_type_t optype);
> -
> -
> -// this is initialized in Crypto_Init()
> -const EVP_CIPHER * SYM_CIPHER = NULL;
> -
> -const BYTE ZERO_IV[EVP_MAX_IV_LENGTH] = {0};
> -
> -
> -TPM_RESULT Crypto_symcrypto_initkey (symkey_t * key, const buffer_t* keybits) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  EVP_CIPHER_CTX_init (&key->context);
> -
> -  key->cipher = SYM_CIPHER;
> -
> -  TPMTRYRETURN( buffer_init_copy (&key->key, keybits));
> -
> -  goto egress;
> -
> - abort_egress:
> -  EVP_CIPHER_CTX_cleanup (&key->context);
> -
> - egress:
> -
> -  return status;
> -}
> -
> -
> -
> -TPM_RESULT Crypto_symcrypto_genkey (symkey_t * key) {
> -  int res;
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  // hmm, EVP_CIPHER_CTX_init does not return a value
> -  EVP_CIPHER_CTX_init (&key->context);
> -
> -  key->cipher = SYM_CIPHER;
> -
> -  TPMTRYRETURN( buffer_init (&key->key, EVP_CIPHER_key_length(key->cipher), NULL)) ;
> -
> -  // and generate the key material
> -  res = RAND_pseudo_bytes (key->key.bytes, key->key.size);
> -  if (res < 0)
> -    ERRORDIE (TPM_SHORTRANDOM);
> -
> -
> -  goto egress;
> -
> - abort_egress:
> -  EVP_CIPHER_CTX_cleanup (&key->context);
> -  buffer_free (&key->key);
> -
> - egress:
> -  return status;
> -}
> -
> -
> -TPM_RESULT Crypto_symcrypto_encrypt (symkey_t* key,
> -                              const buffer_t* clear,
> -                              buffer_t* o_cipher) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  buffer_t iv, cipher_alias;
> -
> -  buffer_init_const (&iv, EVP_MAX_IV_LENGTH, ZERO_IV);
> -
> -  buffer_init (o_cipher,
> -              clear->size +
> -              EVP_CIPHER_iv_length(key->cipher) +
> -              EVP_CIPHER_block_size (key->cipher),
> -                                0);
> -
> -  // copy the IV into the front
> -  buffer_copy (o_cipher, &iv);
> -
> -  // make an alias into which we'll put the ciphertext
> -  buffer_init_alias (&cipher_alias, o_cipher, EVP_CIPHER_iv_length(key->cipher), 0);
> -
> -  TPMTRYRETURN( ossl_symcrypto_op (key, clear, &iv, &cipher_alias, CRYPT_ENCRYPT) );
> -
> -  // set the output size correctly
> -  o_cipher->size += cipher_alias.size;
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -
> -}
> -
> -
> -
> -TPM_RESULT Crypto_symcrypto_decrypt (symkey_t* key,
> -                              const buffer_t* cipher,
> -                              buffer_t* o_clear) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  buffer_t iv, cipher_alias;
> -
> -  // alias for the IV
> -  buffer_init_alias (&iv, cipher, 0, EVP_CIPHER_iv_length(key->cipher));
> -
> -  // make an alias to where the ciphertext is, after the IV
> -  buffer_init_alias (&cipher_alias, cipher, EVP_CIPHER_iv_length(key->cipher), 0);
> -
> -  // prepare the output buffer
> -  TPMTRYRETURN( buffer_init (o_clear,
> -                       cipher->size
> -                       - EVP_CIPHER_iv_length(key->cipher)
> -                       + EVP_CIPHER_block_size(key->cipher),
> -                       0) );
> -
> -  // and decrypt
> -  TPMTRYRETURN ( ossl_symcrypto_op (key, &cipher_alias, &iv, o_clear, CRYPT_DECRYPT) );
> -
> -  goto egress;
> -
> - abort_egress:
> -  buffer_free (o_clear);
> -
> - egress:
> -
> -  return status;
> -}
> -
> -
> -
> -TPM_RESULT Crypto_symcrypto_freekey (symkey_t * key) {
> -  buffer_memset (&key->key, 0);
> -  buffer_free (&key->key);
> -
> -  EVP_CIPHER_CTX_cleanup (&key->context);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -TPM_RESULT ossl_symcrypto_op (symkey_t* key,
> -                              const buffer_t* in,
> -                              const buffer_t* iv,
> -                              buffer_t * out,
> -                              crypt_op_type_t optype) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  int inlen, outlen;
> -  tpm_size_t running;
> -
> -  if ( ! EVP_CipherInit_ex (&key->context,
> -                           key->cipher, NULL, key->key.bytes, iv->bytes,
> -                           optype == CRYPT_ENCRYPT ? 1 : 0) )
> -    ERRORDIE (TPM_FAIL);
> -
> -
> -
> -  inlen = in->size;
> -
> -  outlen  = 0;
> -  running = 0;
> -
> -
> -  if ( ! EVP_CipherUpdate (&key->context, out->bytes, &outlen, in->bytes, inlen) )
> -    ERRORDIE (TPM_FAIL);
> -
> -  running += outlen;
> -
> -  if ( ! EVP_CipherFinal_ex (&key->context, out->bytes + running, &outlen) )
> -    ERRORDIE (TPM_FAIL);
> -
> -  running += outlen;
> -
> -  out->size = running;
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/crypto/sym_crypto.h b/tools/vtpm_manager/crypto/sym_crypto.h
> deleted file mode 100644
> index 7fb59a8..0000000
> --- a/tools/vtpm_manager/crypto/sym_crypto.h
> +++ /dev/null
> @@ -1,72 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// sym_crypto.h
> -//
> -//     Symmetric Crypto
> -//
> -// ==================================================================
> -
> -#ifndef _SYM_CRYPTO_H
> -#define _SYM_CRYPTO_H
> -
> -#include <openssl/evp.h>
> -#include "buffer.h"
> -
> -typedef struct symkey_t {
> -  buffer_t key;
> -
> -  EVP_CIPHER_CTX context;
> -  const EVP_CIPHER * cipher;
> -} symkey_t;
> -
> -extern const EVP_CIPHER * SYM_CIPHER;
> -
> -TPM_RESULT Crypto_symcrypto_genkey (symkey_t * key);
> -
> -TPM_RESULT Crypto_symcrypto_initkey (symkey_t * key, const buffer_t* keybits);
> -
> -
> -// these functions will allocate their output buffers
> -TPM_RESULT Crypto_symcrypto_encrypt (symkey_t* key,
> -                              const buffer_t* clear,
> -                              buffer_t* o_cipher);
> -
> -TPM_RESULT Crypto_symcrypto_decrypt (symkey_t* key,
> -                              const buffer_t* cipher,
> -                              buffer_t* o_clear);
> -
> -// only free the internal parts, not the 'key' ptr
> -TPM_RESULT Crypto_symcrypto_freekey (symkey_t * key);
> -
> -#endif /* _SYM_CRYPTO_H */
> diff --git a/tools/vtpm_manager/manager/Makefile b/tools/vtpm_manager/manager/Makefile
> deleted file mode 100644
> index a33c18a..0000000
> --- a/tools/vtpm_manager/manager/Makefile
> +++ /dev/null
> @@ -1,38 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -BIN            = vtpm_managerd
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIN)
> -
> -.PHONY: install
> -install: build
> -       if [ ! -d "$(DESTDIR)/var/vtpm/fifos" ]; \
> -               then mkdir -p $(DESTDIR)/var/vtpm/fifos; \
> -       fi
> -       if [ ! -d "$(DESTDIR)/var/vtpm/socks" ]; \
> -               then mkdir -p $(DESTDIR)/var/vtpm/socks; \
> -       fi
> -       $(INSTALL_PROG) $(BIN) $(DESTDIR)$(BINDIR)
> -
> -.PHONY: clean
> -clean:
> -       rm -f $(BIN)
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIN): $(OBJS)
> -       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
> -
> -# libraries
> -LIBS += ../tcs/libTCS.a ../util/libTCGUtils.a ../crypto/libtcpaCrypto.a
> -LIBS += -lcrypto $(PTHREAD_LIBS) -lm
> -CFLAGS += $(PTHREAD_CFLAGS)
> -LDFLAGS += $(PTHREAD_LDFLAGS)
> diff --git a/tools/vtpm_manager/manager/dmictl.c b/tools/vtpm_manager/manager/dmictl.c
> deleted file mode 100644
> index 5c3cf7e..0000000
> --- a/tools/vtpm_manager/manager/dmictl.c
> +++ /dev/null
> @@ -1,266 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -//   dmictl.c
> -//
> -//     Functions for creating and destroying DMIs
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <string.h>
> -
> -#include "vtpmpriv.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -#include "vtpm_ipc.h"
> -
> -#define TPM_EMULATOR_PATH "/usr/bin/vtpmd"
> -
> -// if dmi_res is non-null, then return a pointer to new object.
> -// Also, this does not fill in the measurements. They should be filled by
> -// design dependent code or saveNVM
> -TPM_RESULT init_dmi(UINT32 dmi_id, BYTE dmi_type, VTPM_DMI_RESOURCE **dmi_res) {
> -
> -  TPM_RESULT status=TPM_SUCCESS;
> -  VTPM_DMI_RESOURCE *new_dmi=NULL;
> -  UINT32 *dmi_id_key=NULL;
> -
> -  if ((new_dmi = (VTPM_DMI_RESOURCE *) malloc (sizeof(VTPM_DMI_RESOURCE))) == NULL) {
> -      status = TPM_RESOURCES;
> -      goto abort_egress;
> -  }
> -  memset(new_dmi, 0, sizeof(VTPM_DMI_RESOURCE));
> -  new_dmi->dmi_id = dmi_id;
> -  new_dmi->dmi_type = dmi_type;
> -  new_dmi->connected = FALSE;
> -  new_dmi->TCSContext = 0;
> -
> -  new_dmi->NVMLocation = (char *) malloc(11 + strlen(DMI_NVM_FILE));
> -  sprintf(new_dmi->NVMLocation, DMI_NVM_FILE, (uint32_t) new_dmi->dmi_id);
> -
> -  if ((dmi_id_key = (UINT32 *) malloc (sizeof(UINT32))) == NULL) {
> -    status = TPM_RESOURCES;
> -    goto abort_egress;
> -  }
> -  *dmi_id_key = new_dmi->dmi_id;
> -
> -  // install into map
> -  if (!hashtable_insert(vtpm_globals->dmi_map, dmi_id_key, new_dmi)){
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to insert instance into table. Aborting.\n", dmi_id);
> -    status = TPM_FAIL;
> -    goto abort_egress;
> -  }
> -
> -  if (dmi_res)
> -    *dmi_res = new_dmi;
> -
> -  goto egress;
> -
> - abort_egress:
> -  if (new_dmi) {
> -    free(new_dmi->NVMLocation);
> -    free(new_dmi);
> -  }
> -  free(dmi_id_key);
> -
> - egress:
> -  return status;
> -}
> -
> -TPM_RESULT close_dmi(VTPM_DMI_RESOURCE *dmi_res) {
> -  if (dmi_res == NULL)
> -    return TPM_SUCCESS;
> -
> -  if (dmi_res->dmi_id == VTPM_CTL_DM)
> -    return(TPM_BAD_PARAMETER);
> -
> -  TCS_CloseContext(dmi_res->TCSContext);
> -  dmi_res->connected = FALSE;
> -
> -  vtpm_globals->connected_dmis--;
> -
> -  return (VTPM_Close_DMI_Extra(dmi_res) );
> -}
> -
> -TPM_RESULT VTPM_Handle_New_DMI(const buffer_t *param_buf) {
> -
> -  VTPM_DMI_RESOURCE *new_dmi=NULL;
> -  TPM_RESULT status=TPM_FAIL;
> -  BYTE dmi_type, vm_type, startup_mode;
> -  UINT32 dmi_id;
> -
> -  if (param_buf == NULL) { // Assume creation of Dom 0 control
> -    dmi_type = VTPM_TYPE_NON_MIGRATABLE;
> -    dmi_id = VTPM_CTL_DM;
> -  } else if (buffer_len(param_buf) != sizeof(BYTE) * 3  + sizeof(UINT32)) {
> -    vtpmloginfo(VTPM_LOG_VTPM, "New DMI command wrong length: %d.\n", buffer_len(param_buf));
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  } else {
> -    vtpm_globals->connected_dmis++; // Put this here so we don't count Dom0
> -    BSG_UnpackList( param_buf->bytes, 4,
> -                   BSG_TYPE_BYTE, &dmi_type,
> -                   BSG_TYPE_BYTE, &startup_mode,
> -                   BSG_TYPE_BYTE, &vm_type,
> -                   BSG_TYPE_UINT32,  &dmi_id);
> -  }
> -
> -  if ((dmi_type != VTPM_TYPE_NON_MIGRATABLE) && (dmi_type != VTPM_TYPE_MIGRATABLE)) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Creation of VTPM with illegal type.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  new_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> -  if (new_dmi == NULL) {
> -    vtpmloginfo(VTPM_LOG_VTPM, "Creating new DMI instance %d attached.\n", dmi_id );
> -    // Brand New DMI. Initialize the persistent pieces
> -    TPMTRYRETURN(init_dmi(dmi_id, dmi_type, &new_dmi) );
> -  } else
> -    vtpmloginfo(VTPM_LOG_VTPM, "Re-attaching DMI instance %d.\n", dmi_id);
> -
> -  if (new_dmi->connected) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Attempt to re-attach, currently attached instance %d. Ignoring\n", dmi_id);
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  if (new_dmi->dmi_type == VTPM_TYPE_MIGRATED) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Attempt to re-attach previously migrated instance %d without recovering first. Ignoring\n", dmi_id);
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  // Initialize the Non-persistent pieces
> -  TPMTRYRETURN( TCS_OpenContext(&new_dmi->TCSContext) );
> -
> -  new_dmi->connected = TRUE;
> -
> -  // Design specific new DMI code.
> -  // Includes: create IPCs, Measuring DMI, and maybe launching DMI
> -  TPMTRYRETURN(VTPM_New_DMI_Extra(new_dmi, vm_type, startup_mode) );
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to create DMI id=%d due to status=%s. Cleaning.\n", dmi_id, tpm_get_error_name(status));
> -  close_dmi(new_dmi );
> -
> - egress:
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Close_DMI( const buffer_t *param_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_DMI_RESOURCE *dmi_res=NULL;
> -  UINT32 dmi_id;
> -
> -  if ((param_buf == NULL) || (buffer_len(param_buf) != sizeof(UINT32)) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing DMI has bad size.");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  BSG_UnpackList( param_buf->bytes, 1,
> -                 BSG_TYPE_UINT32, &dmi_id);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Closing DMI %d.\n", dmi_id);
> -
> -  dmi_res = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> -  if (dmi_res == NULL ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Trying to close nonexistent DMI.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  if (!dmi_res->connected) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing non-connected DMI.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  // Close Dmi
> -       TPMTRYRETURN(close_dmi( dmi_res ));
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Delete_DMI( const buffer_t *param_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_DMI_RESOURCE *dmi_res=NULL;
> -  UINT32 dmi_id;
> -
> -  if ((param_buf == NULL) || (buffer_len(param_buf) != sizeof(UINT32)) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing DMI has bad size.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  BSG_UnpackList( param_buf->bytes, 1,
> -                 BSG_TYPE_UINT32, &dmi_id);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Deleting DMI %d.\n", dmi_id);
> -
> -  dmi_res = (VTPM_DMI_RESOURCE *) hashtable_remove(vtpm_globals->dmi_map, &dmi_id);
> -  if (dmi_res == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing non-existent DMI.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  //vtpm scripts delete file dmi_res->NVMLocation for us
> -
> -  // Close DMI first
> -  TPMTRYRETURN(close_dmi( dmi_res ));
> -  free ( dmi_res );
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/manager/migration.c b/tools/vtpm_manager/manager/migration.c
> deleted file mode 100644
> index 54da708..0000000
> --- a/tools/vtpm_manager/manager/migration.c
> +++ /dev/null
> @@ -1,307 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -//   dmictl.c
> -//
> -//     Functions for creating and destroying DMIs
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <string.h>
> -
> -#include "vtpmpriv.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "hashtable.h"
> -
> -TPM_RESULT VTPM_Handle_Migrate_In( const buffer_t *param_buf,
> -                                   buffer_t *result_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_DMI_RESOURCE *mig_dmi=NULL;
> -  UINT32 dmi_id;
> -  buffer_t dmi_state_abuf = NULL_BUF, enc_dmi_abuf = NULL_BUF, clear_dmi_blob = NULL_BUF;
> -
> -  if (param_buf == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Migration Out Failed due to bad parameter.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  struct pack_buf_t enc_dmi_state_pack;
> -
> -  BSG_UnpackList(param_buf->bytes, 2,
> -                 BSG_TYPE_UINT32, &dmi_id,
> -                 BSG_TPM_SIZE32_DATA, &enc_dmi_state_pack) ;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Migrating VTPM in dmi %d.\n", dmi_id);
> -
> -  mig_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> -  if (mig_dmi) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Incoming VTPM claims unavailable id: %d.\n", dmi_id);
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  /** UnBind Blob **/
> -  TPMTRYRETURN( buffer_init_alias_convert( &enc_dmi_abuf,
> -                                           enc_dmi_state_pack.size,
> -                                           enc_dmi_state_pack.data) );
> -
> -  TPMTRYRETURN( envelope_decrypt( &enc_dmi_abuf,
> -                                   vtpm_globals->manager_tcs_handle,
> -                                   vtpm_globals->storageKeyHandle,
> -                                   (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
> -                                   &clear_dmi_blob) );
> -
> -  // Create new dmi
> -  TPMTRYRETURN( init_dmi(dmi_id, VTPM_TYPE_MIGRATABLE, &mig_dmi ) );
> -
> -  /** Open Blob **/
> -  struct pack_buf_t dmi_state_pack;
> -
> -  BSG_UnpackList(clear_dmi_blob.bytes, 2,
> -                 BSG_TPM_DIGEST, &mig_dmi->DMI_measurement,
> -                 BSG_TPM_SIZE32_DATA, &dmi_state_pack);
> -
> -  TPMTRYRETURN( buffer_init_alias_convert(&dmi_state_abuf,
> -                                          dmi_state_pack.size,
> -                                          dmi_state_pack.data) );
> -
> -  TPMTRYRETURN( VTPM_Handle_Save_NVM(mig_dmi, &dmi_state_abuf, NULL ) );
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Migration IN of instance %d failed because of %s.\n", dmi_id, tpm_get_error_name(status) );
> -
> - egress:
> -  buffer_free(&clear_dmi_blob);
> -  buffer_free(&dmi_state_abuf);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Migrate_Out( const buffer_t *param_buf,
> -                                    buffer_t *result_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_DMI_RESOURCE *mig_dmi;
> -  UINT32 dmi_id;
> -  VTPM_MIGKEY_LIST *last_mig, *mig_key;
> -  buffer_t dmi_state=NULL_BUF, clear_dmi_blob=NULL_BUF;
> -
> -  if (param_buf == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Migration Out Failed due to bad parameter.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  struct pack_buf_t name_pack;
> -
> -  BSG_UnpackList( param_buf->bytes, 2,
> -                  BSG_TYPE_UINT32, &dmi_id,
> -                  BSG_TPM_SIZE32_DATA, &name_pack);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Migrating out dmi %d.\n", dmi_id);
> -
> -  mig_dmi = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi_id);
> -  if (mig_dmi == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Non-existent VTPM instance (%d) in migration.\n", dmi_id );
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  if (mig_dmi->dmi_type != VTPM_TYPE_MIGRATABLE) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Bad VTPM type (%d) in migration of instance (%d).\n", mig_dmi->dmi_type, dmi_id );
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  /** Find migration key for dest **/
> -  last_mig = NULL;
> -  mig_key = vtpm_globals->mig_keys;
> -  while (mig_key != NULL) {
> -    if (mig_key->name_size == name_pack.size)
> -      if (memcmp(mig_key->name, name_pack.data, name_pack.size) == 0) {
> -        break;
> -      }
> -
> -    last_mig = mig_key;
> -    mig_key = mig_key->next;
> -  }
> -
> -  if (!mig_key) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unknown Migration target host.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  /** Mark vtpm as migrated **/
> -  mig_dmi->dmi_type = VTPM_TYPE_MIGRATED;
> -
> -  /** Build Blob **/
> -  TPMTRYRETURN( VTPM_Handle_Load_NVM(mig_dmi, NULL, &dmi_state) );
> -
> -  TPMTRYRETURN( buffer_init(&clear_dmi_blob, sizeof(TPM_DIGEST) + sizeof(UINT32) + buffer_len(&dmi_state), NULL ) );
> -
> -  struct pack_constbuf_t dmi_state_pack;
> -
> -  dmi_state_pack.size = buffer_len(&dmi_state);
> -  dmi_state_pack.data = dmi_state.bytes;
> -
> -  BSG_PackList(clear_dmi_blob.bytes, 2,
> -               BSG_TPM_DIGEST, &mig_dmi->DMI_measurement,
> -               BSG_TPM_SIZE32_DATA, &dmi_state_pack);
> -
> -  /** Bind Blob **/
> -  TPMTRYRETURN( envelope_encrypt( &clear_dmi_blob,
> -                                  &mig_key->key,
> -                                  result_buf) );
> -
> -  if (last_mig)
> -    last_mig->next = mig_key->next;
> -  else
> -    vtpm_globals->mig_keys = mig_key->next;
> -
> -  free(mig_key->name);
> -  free(mig_key);
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Migration OUT of instance %d failed because of %s. Migratoin recovery may be needed.\n", dmi_id, tpm_get_error_name(status) );
> -
> -    //TODO: Create and implement a policy for what happens to mig_key on failed migrations.
> -
> - egress:
> -
> -  buffer_free(&clear_dmi_blob);
> -  buffer_free(&dmi_state);
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTPM_Handle_Get_Migration_key( const buffer_t *param_buf,
> -                                          buffer_t *result_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Getting Migration Public Key.\n");
> -
> -  struct pack_buf_t pubkey_exp_pack, pubkey_mod_pack;
> -  TPM_KEY mig_key;
> -
> -  // Unpack/return key structure
> -  BSG_Unpack(BSG_TPM_KEY, vtpm_globals->storageKeyWrap.bytes , &mig_key);
> -  TPM_RSA_KEY_PARMS rsaKeyParms;
> -
> -  BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
> -               mig_key.algorithmParms.parms,
> -               &rsaKeyParms);
> -
> -  pubkey_exp_pack.size = rsaKeyParms.exponentSize;
> -  pubkey_exp_pack.data = rsaKeyParms.exponent;
> -  pubkey_mod_pack.size = mig_key.pubKey.keyLength;
> -  pubkey_mod_pack.data = mig_key.pubKey.key;
> -
> -  TPMTRYRETURN( buffer_init( result_buf, 2*sizeof(UINT32) +
> -                                         pubkey_exp_pack.size +
> -                                         pubkey_mod_pack.size, NULL ) );
> -
> -  BSG_PackList( result_buf->bytes, 2,
> -                  BSG_TPM_SIZE32_DATA, &pubkey_exp_pack,
> -                  BSG_TPM_SIZE32_DATA, &pubkey_mod_pack);
> -
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM Get Migration Key failed because of %s.\n", tpm_get_error_name(status) );
> - egress:
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Load_Migration_key( const buffer_t *param_buf,
> -                                           buffer_t *result_buf) {
> -
> -  TPM_RESULT status=TPM_FAIL;
> -  VTPM_MIGKEY_LIST *mig_key;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Loading Migration Public Key.\n");
> -
> -  //FIXME: Review all uses of unpacking pack_buf_t and ensure free.
> -  //FIXME: Review all declarations/initializations of buffer_t that could have a goto that skips them and then tries to free them
> -
> -  struct pack_buf_t name_pack, pubkey_exp_pack, pubkey_mod_pack;
> -
> -  //FIXME: scan list and verify name is not already in the list
> -
> -  BSG_UnpackList( param_buf->bytes, 3,
> -                  BSG_TPM_SIZE32_DATA, &name_pack,
> -                  BSG_TPM_SIZE32_DATA, &pubkey_exp_pack,
> -                  BSG_TPM_SIZE32_DATA, &pubkey_mod_pack);
> -
> -  //TODO: Maintain a persistent list for pub_keys.
> -  //TODO: Verify pub_key is trusted
> -
> -  mig_key = (VTPM_MIGKEY_LIST *) malloc(sizeof(VTPM_MIGKEY_LIST));
> -  memset(mig_key, 0, sizeof(VTPM_MIGKEY_LIST) );
> -  mig_key->name_size = name_pack.size;
> -  mig_key->name = name_pack.data;
> -
> -  mig_key->key.encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
> -  Crypto_RSABuildCryptoInfoPublic( pubkey_exp_pack.size,
> -                                   pubkey_exp_pack.data,
> -                                   pubkey_mod_pack.size,
> -                                   pubkey_mod_pack.data,
> -                                   &mig_key->key);
> -
> -
> -  mig_key->next = vtpm_globals->mig_keys;
> -  vtpm_globals->mig_keys = mig_key;
> -
> -  // free(name_pack.data); Do not free. data is now part of mig_key.
> -  free(pubkey_exp_pack.data);
> -  free(pubkey_mod_pack.data);
> -
> -  return TPM_SUCCESS;
> -}
> diff --git a/tools/vtpm_manager/manager/securestorage.c b/tools/vtpm_manager/manager/securestorage.c
> deleted file mode 100644
> index d5e6ffd..0000000
> --- a/tools/vtpm_manager/manager/securestorage.c
> +++ /dev/null
> @@ -1,512 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// securestorage.c
> -//
> -//  Functions regarding securely storing DMI secrets.
> -//
> -// ==================================================================
> -
> -#include <sys/types.h>
> -#include <sys/stat.h>
> -#include <fcntl.h>
> -#include <unistd.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "vtsp.h"
> -#include "bsg.h"
> -#include "crypto.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -#include "buffer.h"
> -#include "log.h"
> -
> -TPM_RESULT envelope_encrypt(const buffer_t     *inbuf,
> -                            CRYPTO_INFO        *asymkey,
> -                            buffer_t           *sealed_data) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -  symkey_t    symkey;
> -  buffer_t    data_cipher = NULL_BUF,
> -              symkey_cipher = NULL_BUF;
> -
> -  UINT32 i;
> -  struct pack_constbuf_t symkey_cipher32, data_cipher32;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Enveloping Input[%d]: 0x", buffer_len(inbuf));
> -  for (i=0; i< buffer_len(inbuf); i++)
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", inbuf->bytes[i]);
> -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -  // Generate a sym key and encrypt state with it
> -  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_symcrypto_genkey (&symkey) );
> -  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_symcrypto_encrypt (&symkey, inbuf, &data_cipher) );
> -
> -  // Encrypt symmetric key
> -  TPMTRYRETURN( VTSP_Bind(    asymkey,
> -                             &symkey.key,
> -                             &symkey_cipher) );
> -
> -  // Create output blob: symkey_size + symkey_cipher + state_cipher_size + state_cipher
> -
> -  symkey_cipher32.size = buffer_len(&symkey_cipher);
> -  symkey_cipher32.data = symkey_cipher.bytes;
> -
> -  data_cipher32.size = buffer_len(&data_cipher);
> -  data_cipher32.data = data_cipher.bytes;
> -
> -  TPMTRYRETURN( buffer_init(sealed_data, 2 * sizeof(UINT32) + symkey_cipher32.size + data_cipher32.size, NULL));
> -
> -  BSG_PackList(sealed_data->bytes, 2,
> -              BSG_TPM_SIZE32_DATA, &symkey_cipher32,
> -              BSG_TPM_SIZE32_DATA, &data_cipher32);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Saved %d bytes of E(symkey) + %d bytes of E(data)\n", buffer_len(&symkey_cipher), buffer_len(&data_cipher));
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Enveloping Output[%d]: 0x", buffer_len(sealed_data));
> -  for (i=0; i< buffer_len(sealed_data); i++)
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", sealed_data->bytes[i]);
> -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to envelope encrypt\n.");
> -
> - egress:
> -
> -  buffer_free ( &data_cipher);
> -  buffer_free ( &symkey_cipher);
> -  Crypto_symcrypto_freekey (&symkey);
> -
> -  return status;
> -}
> -
> -TPM_RESULT envelope_decrypt(const buffer_t     *cipher,
> -                            TCS_CONTEXT_HANDLE TCSContext,
> -                           TPM_HANDLE         keyHandle,
> -                           const TPM_AUTHDATA *key_usage_auth,
> -                            buffer_t           *unsealed_data) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  symkey_t    symkey;
> -  buffer_t    data_cipher = NULL_BUF,
> -              symkey_clear = NULL_BUF,
> -              symkey_cipher = NULL_BUF;
> -  struct pack_buf_t symkey_cipher32, data_cipher32;
> -  int i;
> -
> -  memset(&symkey, 0, sizeof(symkey_t));
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Envelope Decrypt Input[%d]: 0x", buffer_len(cipher) );
> -  for (i=0; i< buffer_len(cipher); i++)
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cipher->bytes[i]);
> -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -  BSG_UnpackList(cipher->bytes, 2,
> -                BSG_TPM_SIZE32_DATA, &symkey_cipher32,
> -                BSG_TPM_SIZE32_DATA, &data_cipher32);
> -
> -  TPMTRYRETURN( buffer_init_alias_convert (&symkey_cipher,
> -                                          symkey_cipher32.size,
> -                                          symkey_cipher32.data) );
> -
> -  TPMTRYRETURN( buffer_init_alias_convert (&data_cipher,
> -                                          data_cipher32.size,
> -                                          data_cipher32.data) );
> -
> -  // Decrypt Symmetric Key
> -  TPMTRYRETURN( VTSP_Unbind(  TCSContext,
> -                             keyHandle,
> -                             &symkey_cipher,
> -                             key_usage_auth,
> -                             &symkey_clear,
> -                             &(vtpm_globals->keyAuth) ) );
> -
> -  // create symmetric key using saved bits
> -  Crypto_symcrypto_initkey (&symkey, &symkey_clear);
> -
> -  // Decrypt State
> -  TPMTRY(TPM_DECRYPT_ERROR, Crypto_symcrypto_decrypt (&symkey, &data_cipher, unsealed_data) );
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Envelope Decrypte Output[%d]: 0x", buffer_len(unsealed_data));
> -  for (i=0; i< buffer_len(unsealed_data); i++)
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", unsealed_data->bytes[i]);
> -  vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to envelope decrypt data\n.");
> -
> - egress:
> -  buffer_free ( &data_cipher);
> -  buffer_free ( &symkey_clear);
> -  buffer_free ( &symkey_cipher);
> -  Crypto_symcrypto_freekey (&symkey);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_Handle_Save_NVM(VTPM_DMI_RESOURCE *myDMI,
> -                               const buffer_t *inbuf,
> -                               buffer_t *outbuf) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  int fh;
> -  long bytes_written;
> -  buffer_t sealed_NVM = NULL_BUF;
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Saving %d bytes of NVM.\n", buffer_len(inbuf));
> -
> -  TPMTRYRETURN( envelope_encrypt(inbuf,
> -                                 &vtpm_globals->storageKey,
> -                                 &sealed_NVM) );
> -
> -  // Write sealed blob off disk from NVMLocation
> -  // TODO: How to properly return from these. Do we care if we return failure
> -  //       after writing the file? We can't get the old one back.
> -  // TODO: Backup old file and try and recover that way.
> -  fh = open(myDMI->NVMLocation, O_WRONLY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
> -  if ( (bytes_written = write(fh, sealed_NVM.bytes, buffer_len(&sealed_NVM) ) != (long) buffer_len(&sealed_NVM))) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "We just overwrote a DMI_NVM and failed to finish. %ld/%ld bytes.\n", bytes_written, (long)buffer_len(&sealed_NVM));
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -  close(fh);
> -
> -  Crypto_SHA1Full (sealed_NVM.bytes, buffer_len(&sealed_NVM), (BYTE *) &myDMI->NVM_measurement);
> -
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to save NVM\n.");
> -
> - egress:
> -  buffer_free(&sealed_NVM);
> -  return status;
> -}
> -
> -
> -/* Expected Params: inbuf = null, outbuf = sealed blob size, sealed blob.*/
> -TPM_RESULT VTPM_Handle_Load_NVM(VTPM_DMI_RESOURCE *myDMI,
> -                               const buffer_t    *inbuf,
> -                               buffer_t          *outbuf) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  buffer_t sealed_NVM = NULL_BUF;
> -  long fh_size;
> -  int fh, stat_ret, i;
> -  struct stat file_stat;
> -  TPM_DIGEST sealedNVMHash;
> -
> -  if (myDMI->NVMLocation == NULL) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to load NVM because the file name NULL.\n");
> -    status = TPM_AUTHFAIL;
> -    goto abort_egress;
> -  }
> -
> -  //Read sealed blob off disk from NVMLocation
> -  fh = open(myDMI->NVMLocation, O_RDONLY);
> -  stat_ret = fstat(fh, &file_stat);
> -  if (stat_ret == 0)
> -    fh_size = file_stat.st_size;
> -  else {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  TPMTRYRETURN( buffer_init( &sealed_NVM, fh_size, NULL) );
> -  if (read(fh, sealed_NVM.bytes, buffer_len(&sealed_NVM)) != fh_size) {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -  close(fh);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Load_NVMing[%d],\n", buffer_len(&sealed_NVM));
> -
> -  Crypto_SHA1Full(sealed_NVM.bytes, buffer_len(&sealed_NVM), (BYTE *) &sealedNVMHash);
> -
> -  // Verify measurement of sealed blob.
> -  if (memcmp(&sealedNVMHash, &myDMI->NVM_measurement, sizeof(TPM_DIGEST)) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM LoadNVM NVM measurement check failed.\n");
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Correct hash: ");
> -    for (i=0; i< sizeof(TPM_DIGEST); i++)
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", ((BYTE*)&myDMI->NVM_measurement)[i]);
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "Measured hash: ");
> -    for (i=0; i< sizeof(TPM_DIGEST); i++)
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", ((BYTE*)&sealedNVMHash)[i]);
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -    status = TPM_AUTHFAIL;
> -    goto abort_egress;
> -  }
> -
> -  TPMTRYRETURN( envelope_decrypt(&sealed_NVM,
> -                                 myDMI->TCSContext,
> -                                vtpm_globals->storageKeyHandle,
> -                                (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
> -                                 outbuf) );
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to load NVM\n.");
> -
> - egress:
> -  buffer_free( &sealed_NVM );
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTPM_SaveManagerData(void) {
> -  TPM_RESULT status=TPM_SUCCESS;
> -  int fh, dmis=-1;
> -
> -  BYTE *flat_boot_key=NULL, *flat_dmis=NULL, *flat_enc=NULL;
> -  buffer_t clear_flat_global=NULL_BUF, enc_flat_global=NULL_BUF;
> -  UINT32 storageKeySize = buffer_len(&vtpm_globals->storageKeyWrap);
> -  UINT32 bootKeySize = buffer_len(&vtpm_globals->bootKeyWrap);
> -  struct pack_buf_t storage_key_pack = {storageKeySize, vtpm_globals->storageKeyWrap.bytes};
> -  struct pack_buf_t boot_key_pack = {bootKeySize, vtpm_globals->bootKeyWrap.bytes};
> -  BYTE vtpm_manager_gen = VTPM_MANAGER_GEN;
> -
> -  struct hashtable_itr *dmi_itr;
> -  VTPM_DMI_RESOURCE *dmi_res;
> -
> -  UINT32 boot_key_size = 0, flat_dmis_size = 0;
> -
> -  // Initially fill these with buffer sizes for each data type. Later fill
> -  // in actual size, once flattened.
> -  boot_key_size =  sizeof(UINT32) +       // bootkeysize
> -                   bootKeySize;           // boot key
> -
> -  TPMTRYRETURN(buffer_init(&clear_flat_global,sizeof(BYTE) + // manager version
> -                                              3*sizeof(TPM_DIGEST) + // Auths
> -                                              sizeof(UINT32) +// storagekeysize
> -                                              storageKeySize, NULL) ); // storage key
> -
> -
> -  flat_boot_key = (BYTE *) malloc( boot_key_size );
> -  flat_enc = (BYTE *) malloc( sizeof(UINT32) );
> -
> -  boot_key_size = BSG_PackList(flat_boot_key, 1,
> -                               BSG_TPM_SIZE32_DATA, &boot_key_pack);
> -
> -  BSG_PackList(clear_flat_global.bytes, 4,
> -                BSG_TYPE_BYTE,    &vtpm_manager_gen,
> -                BSG_TPM_AUTHDATA, &vtpm_globals->owner_usage_auth,
> -                BSG_TPM_SECRET,   &vtpm_globals->storage_key_usage_auth,
> -                BSG_TPM_SIZE32_DATA, &storage_key_pack);
> -
> -  TPMTRYRETURN(envelope_encrypt(&clear_flat_global,
> -                                &vtpm_globals->bootKey,
> -                                &enc_flat_global) );
> -
> -  BSG_PackConst(buffer_len(&enc_flat_global), 4, flat_enc);
> -
> -  // Per DMI values to be saved (if any exit)
> -  if (hashtable_count(vtpm_globals->dmi_map) > 1) {
> -
> -    flat_dmis = (BYTE *) malloc(
> -                     (hashtable_count(vtpm_globals->dmi_map) - 1) * // num DMIS (-1 for Dom0)
> -                     (sizeof(UINT32) +sizeof(BYTE) + 2*sizeof(TPM_DIGEST)) ); // Per DMI info
> -
> -    dmi_itr = hashtable_iterator(vtpm_globals->dmi_map);
> -    do {
> -      dmi_res = (VTPM_DMI_RESOURCE *) hashtable_iterator_value(dmi_itr);
> -      dmis++;
> -
> -      // No need to save dmi0.
> -      if (dmi_res->dmi_id == 0)
> -        continue;
> -
> -
> -      flat_dmis_size += BSG_PackList( flat_dmis + flat_dmis_size, 4,
> -                                        BSG_TYPE_UINT32, &dmi_res->dmi_id,
> -                                        BSG_TYPE_BYTE, &dmi_res->dmi_type,
> -                                        BSG_TPM_DIGEST, &dmi_res->NVM_measurement,
> -                                        BSG_TPM_DIGEST, &dmi_res->DMI_measurement);
> -
> -    } while (hashtable_iterator_advance(dmi_itr));
> -  }
> -
> -  fh = open(STATE_FILE, O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
> -  if (fh == -1) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to open %s file for write.\n", STATE_FILE);
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if ( ( write(fh, flat_boot_key, boot_key_size) != boot_key_size ) ||
> -       ( write(fh, flat_enc, sizeof(UINT32)) != sizeof(UINT32) ) ||
> -       ( write(fh, enc_flat_global.bytes, buffer_len(&enc_flat_global)) != buffer_len(&enc_flat_global) ) ||
> -       ( write(fh, flat_dmis, flat_dmis_size) != flat_dmis_size ) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to completely write service data.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> - }
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  free(flat_boot_key);
> -  free(flat_enc);
> -  buffer_free(&enc_flat_global);
> -  free(flat_dmis);
> -  close(fh);
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Saved VTPM Manager state (status = %d, dmis = %d)\n", (int) status, dmis);
> -  return status;
> -}
> -
> -TPM_RESULT VTPM_LoadManagerData(void) {
> -
> -  TPM_RESULT status=TPM_SUCCESS;
> -  int fh, stat_ret, dmis=0;
> -  long fh_size = 0, step_size;
> -  BYTE *flat_table=NULL;
> -  buffer_t  unsealed_data, enc_table_abuf;
> -  struct pack_buf_t storage_key_pack, boot_key_pack;
> -  UINT32 *dmi_id_key, enc_size;
> -  BYTE vtpm_manager_gen;
> -
> -  VTPM_DMI_RESOURCE *dmi_res;
> -  UINT32 dmi_id;
> -  BYTE dmi_type;
> -  struct stat file_stat;
> -
> -  TPM_HANDLE boot_key_handle;
> -  TPM_AUTHDATA boot_usage_auth;
> -  memset(&boot_usage_auth, 0, sizeof(TPM_AUTHDATA));
> -
> -  fh = open(STATE_FILE, O_RDONLY );
> -  stat_ret = fstat(fh, &file_stat);
> -  if (stat_ret == 0)
> -    fh_size = file_stat.st_size;
> -  else {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  flat_table = (BYTE *) malloc(fh_size);
> -
> -  if ((long) read(fh, flat_table, fh_size) != fh_size ) {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  // Read Boot Key
> -  step_size = BSG_UnpackList( flat_table, 2,
> -                              BSG_TPM_SIZE32_DATA, &boot_key_pack,
> -                              BSG_TYPE_UINT32, &enc_size);
> -
> -  TPMTRYRETURN(buffer_init(&vtpm_globals->bootKeyWrap, 0, 0) );
> -  TPMTRYRETURN(buffer_init_alias_convert(&enc_table_abuf, enc_size, flat_table + step_size) );
> -  TPMTRYRETURN(buffer_append_raw(&vtpm_globals->bootKeyWrap, boot_key_pack.size, boot_key_pack.data) );
> -
> -  //Load Boot Key
> -  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
> -                              TPM_SRK_KEYHANDLE,
> -                              &vtpm_globals->bootKeyWrap,
> -                              &SRK_AUTH,
> -                              &boot_key_handle,
> -                              &vtpm_globals->keyAuth,
> -                              &vtpm_globals->bootKey,
> -                              FALSE) );
> -
> -  TPMTRYRETURN( envelope_decrypt(&enc_table_abuf,
> -                                 vtpm_globals->manager_tcs_handle,
> -                                 boot_key_handle,
> -                                 (const TPM_AUTHDATA*) &boot_usage_auth,
> -                                 &unsealed_data) );
> -  step_size += enc_size;
> -
> -  if (*unsealed_data.bytes != VTPM_MANAGER_GEN) {
> -      // Once there is more than one gen, this will include some compatability stuff
> -      vtpmlogerror(VTPM_LOG_VTPM, "Warning: Manager Data file is gen %d, which this manager is gen %d.\n", vtpm_manager_gen, VTPM_MANAGER_GEN);
> -  }
> -
> -  // Global Values needing to be saved
> -  BSG_UnpackList( unsealed_data.bytes, 4,
> -                  BSG_TYPE_BYTE,    &vtpm_manager_gen,
> -                  BSG_TPM_AUTHDATA, &vtpm_globals->owner_usage_auth,
> -                  BSG_TPM_SECRET,   &vtpm_globals->storage_key_usage_auth,
> -                  BSG_TPM_SIZE32_DATA, &storage_key_pack);
> -
> -  TPMTRYRETURN(buffer_init(&vtpm_globals->storageKeyWrap, 0, 0) );
> -  TPMTRYRETURN(buffer_append_raw(&vtpm_globals->storageKeyWrap, storage_key_pack.size, storage_key_pack.data) );
> -
> -  // Per DMI values to be saved
> -  while ( step_size < fh_size ){
> -    if (fh_size - step_size < (long) (sizeof(UINT32) + sizeof(BYTE) + 2*sizeof(TPM_DIGEST))) {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Encountered %ld extra bytes at end of manager state.\n", fh_size-step_size);
> -      step_size = fh_size;
> -    } else {
> -      step_size += BSG_UnpackList(flat_table + step_size, 2,
> -                                 BSG_TYPE_UINT32, &dmi_id,
> -                                 BSG_TYPE_BYTE, &dmi_type);
> -
> -      //TODO: Try and gracefully recover from problems.
> -      TPMTRYRETURN(init_dmi(dmi_id, dmi_type, &dmi_res) );
> -      dmis++;
> -
> -      step_size += BSG_UnpackList(flat_table + step_size, 2,
> -                                 BSG_TPM_DIGEST, &dmi_res->NVM_measurement,
> -                                 BSG_TPM_DIGEST, &dmi_res->DMI_measurement);
> -    }
> -
> -  }
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Loaded saved state (dmis = %d).\n", dmis);
> -  goto egress;
> -
> - abort_egress:
> -  vtpmlogerror(VTPM_LOG_VTPM, "Failed to load service data with error = %s\n", tpm_get_error_name(status));
> - egress:
> -
> -  free(flat_table);
> -  close(fh);
> -
> -  // TODO: Could be nice and evict BootKey. (Need to add EvictKey to VTSP.
> -
> -  return status;
> -}
> -
> diff --git a/tools/vtpm_manager/manager/tpmpassthrough.c b/tools/vtpm_manager/manager/tpmpassthrough.c
> deleted file mode 100644
> index 9b1e5f8..0000000
> --- a/tools/vtpm_manager/manager/tpmpassthrough.c
> +++ /dev/null
> @@ -1,110 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tpmpassthrough.c
> -//
> -//  Functions regarding passing DMI requests to HWTPM
> -//
> -// ==================================================================
> -
> -#include "tcg.h"
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "vtsp.h"
> -#include "log.h"
> -
> -TPM_RESULT VTPM_Handle_TPM_Command( VTPM_DMI_RESOURCE *dmi,
> -                                   buffer_t *inbuf,
> -                                   buffer_t *outbuf) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE *ord;
> -
> -  ord = (TPM_COMMAND_CODE *) (inbuf->bytes + sizeof(TPM_TAG) + sizeof(UINT32));
> -
> -  switch (*ord) {
> -
> -    // Forbidden for DMI use
> -  case TPM_ORD_TakeOwnership:
> -  case TPM_ORD_ChangeAuthOwner:
> -  case TPM_ORD_DirWriteAuth:
> -  case TPM_ORD_DirRead:
> -  case TPM_ORD_AuthorizeMigrationKey:
> -  case TPM_ORD_CreateMaintenanceArchive:
> -  case TPM_ORD_LoadMaintenanceArchive:
> -  case TPM_ORD_KillMaintenanceFeature:
> -  case TPM_ORD_LoadManuMaintPub:
> -  case TPM_ORD_ReadManuMaintPub:
> -  case TPM_ORD_SelfTestFull:
> -  case TPM_ORD_SelfTestStartup:
> -  case TPM_ORD_CertifySelfTest:
> -  case TPM_ORD_ContinueSelfTest:
> -  case TPM_ORD_GetTestResult:
> -  case TPM_ORD_Reset:
> -  case TPM_ORD_OwnerClear:
> -  case TPM_ORD_DisableOwnerClear:
> -  case TPM_ORD_ForceClear:
> -  case TPM_ORD_DisableForceClear:
> -  case TPM_ORD_GetCapabilityOwner:
> -  case TPM_ORD_OwnerSetDisable:
> -  case TPM_ORD_PhysicalEnable:
> -  case TPM_ORD_PhysicalDisable:
> -  case TPM_ORD_SetOwnerInstall:
> -  case TPM_ORD_PhysicalSetDeactivated:
> -  case TPM_ORD_SetTempDeactivated:
> -  case TPM_ORD_CreateEndorsementKeyPair:
> -  case TPM_ORD_GetAuditEvent:
> -  case TPM_ORD_GetAuditEventSigned:
> -  case TPM_ORD_GetOrdinalAuditStatus:
> -  case TPM_ORD_SetOrdinalAuditStatus:
> -  case TPM_ORD_SetRedirection:
> -  case TPM_ORD_FieldUpgrade:
> -  case TSC_ORD_PhysicalPresence:
> -    status = TPM_DISABLED_CMD;
> -    goto abort_egress;
> -    break;
> -
> -  } // End ORD Switch
> -
> -  // Call TCS with command
> -
> -  TPMTRY(TPM_IOERROR, VTSP_RawTransmit( dmi->TCSContext,inbuf, outbuf) );
> -
> -  goto egress;
> -
> - abort_egress:
> -  vtpmloginfo(VTPM_LOG_VTPM, "TPM Command Failed in tpmpassthrough.\n");
> - egress:
> -
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/manager/vtpm_ipc.c b/tools/vtpm_manager/manager/vtpm_ipc.c
> deleted file mode 100644
> index 319dc83..0000000
> --- a/tools/vtpm_manager/manager/vtpm_ipc.c
> +++ /dev/null
> @@ -1,141 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_ipc.c Implements ipc routines using file io. This file can
> -// be replaced with other ipc types.
> -//
> -// ===================================================================
> -
> -#include <sys/stat.h>
> -#include "vtpm_ipc.h"
> -#include "vtpmpriv.h"
> -#include "log.h"
> -
> -int vtpm_ipc_init(vtpm_ipc_handle_t *ipc_h, char* name, int flags, BOOL create) {
> -  ipc_h->name = name;
> -  ipc_h->flags = flags;
> -  ipc_h->fh = VTPM_IPC_CLOSED;
> -
> -  if (create)
> -    return(vtpm_ipc_create(ipc_h));
> -  else
> -    return 0;
> -}
> -
> -// Create the file that needs opening. Used only for FIFOs
> -// FYI: This may cause problems in other file IO schemes. We'll see.
> -int vtpm_ipc_create(vtpm_ipc_handle_t *ipc_h) {
> -  int fh;
> -  struct stat file_info;
> -
> -  if ((!ipc_h) || (!ipc_h->name))
> -    return -1;
> -
> -  if ( stat(ipc_h->name, &file_info) == -1) {
> -    if ( mkfifo(ipc_h->name, S_IWUSR | S_IRUSR ) ) {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Failed to create fifo %s.\n", ipc_h->name);
> -      return -1;
> -    }
> -  }
> -
> -  ipc_h->fh = VTPM_IPC_CLOSED;
> -
> -  return 0;
> -}
> -
> -
> -// Read size bytes. If FH isn't open, open it.
> -int vtpm_ipc_read(vtpm_ipc_handle_t *ipc_h, vtpm_ipc_handle_t *alt_ipc_h, BYTE *bytes, UINT32 size){
> -  vtpm_ipc_handle_t *my_ipc_h;
> -  int result;
> -
> -  if (ipc_h) {
> -    my_ipc_h = ipc_h;
> -  } else {
> -    my_ipc_h = alt_ipc_h;
> -  }
> -
> -  if (my_ipc_h->fh == VTPM_IPC_CLOSED) {
> -    my_ipc_h->fh = open(my_ipc_h->name, my_ipc_h->flags);
> -  }
> -
> -  if ( my_ipc_h->fh == VTPM_IPC_CLOSED ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM ERROR: Can't open %s for reading.\n", my_ipc_h->name);
> -    return -1;
> -  }
> -
> -  result = read(my_ipc_h->fh, bytes, size);
> -  if (result < 0) {
> -    my_ipc_h->fh = VTPM_IPC_CLOSED;
> -  }
> -
> -  return (result);
> -}
> -
> -// Write size bytes. If FH isn't open, open it.
> -int vtpm_ipc_write(vtpm_ipc_handle_t *ipc_h, vtpm_ipc_handle_t *alt_ipc_h, BYTE *bytes, UINT32 size) {
> -  vtpm_ipc_handle_t *my_ipc_h;
> -  int result;
> -
> -  if (ipc_h) {
> -    my_ipc_h = ipc_h;
> -  } else {
> -    my_ipc_h = alt_ipc_h;
> -  }
> -
> -  if (my_ipc_h->fh == VTPM_IPC_CLOSED) {
> -    my_ipc_h->fh = open(my_ipc_h->name, my_ipc_h->flags);
> -  }
> -
> -  if ( my_ipc_h->fh == VTPM_IPC_CLOSED ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "VTPM ERROR: Can't open %s for writing.\n", my_ipc_h->name);
> -    return -1;
> -  }
> -
> -  result = write(my_ipc_h->fh, bytes, size);
> -  if (result < 0) {
> -    my_ipc_h->fh = VTPM_IPC_CLOSED;
> -  }
> -
> -  return (result);
> -}
> -
> -// Mark file as closed and try and close it. Errors not reported.
> -void vtpm_ipc_close(vtpm_ipc_handle_t *ipc_h) {
> -
> -  if (ipc_h) {
> -    close(ipc_h->fh);
> -    ipc_h->fh = VTPM_IPC_CLOSED;
> -  }
> -
> -}
> diff --git a/tools/vtpm_manager/manager/vtpm_ipc.h b/tools/vtpm_manager/manager/vtpm_ipc.h
> deleted file mode 100644
> index 529c4a2..0000000
> --- a/tools/vtpm_manager/manager/vtpm_ipc.h
> +++ /dev/null
> @@ -1,71 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_ipc.h Header for interprocess communication between VTPM manager
> -// and Guests or VTPMs
> -//
> -// ===================================================================
> -
> -#ifndef __VTPM_IO_H__
> -#define __VTPM_IO_H__
> -
> -#include "tcg.h"
> -
> -#define VTPM_IPC_CLOSED -1
> -
> -// Represents an (somewhat) abstracted io handle.
> -typedef struct vtpm_ipc_handle_t {
> -  int fh;              // IO handle.
> -  int flags;           // Flags for opening. This may need to become
> -                       // a void *, but for now files use an int.
> -  char *name;          // Names for debugging as well as filenames
> -                       // for file-based io.
> -} vtpm_ipc_handle_t;
> -
> -
> -int vtpm_ipc_init(vtpm_ipc_handle_t *ioh, char* name, int flags, BOOL create);
> -
> -// Create the file that needs opening. Used only for FIFOs
> -// FYI: This may cause problems in other file IO schemes. We'll see.
> -int vtpm_ipc_create(vtpm_ipc_handle_t *ioh);
> -
> -// Read size bytes. If FH isn't open, open it.
> -int vtpm_ipc_read(vtpm_ipc_handle_t *ioh, vtpm_ipc_handle_t *alt_ioh, BYTE *bytes, UINT32 size);
> -
> -// Write size bytes. If FH isn't open, open it.
> -int vtpm_ipc_write(vtpm_ipc_handle_t *ioh, vtpm_ipc_handle_t *alt_ioh, BYTE *bytes, UINT32 size);
> -
> -// Mark file as closed and try and close it. Errors not reported.
> -void vtpm_ipc_close(vtpm_ipc_handle_t *ioh);
> -
> -#endif
> diff --git a/tools/vtpm_manager/manager/vtpm_lock.c b/tools/vtpm_manager/manager/vtpm_lock.c
> deleted file mode 100644
> index e737d60..0000000
> --- a/tools/vtpm_manager/manager/vtpm_lock.c
> +++ /dev/null
> @@ -1,63 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_lock.c Provided controlled sync around access to vtpm structures
> -//
> -// ===================================================================
> -
> -#include <pthread.h>
> -#include "vtpm_lock.h"
> -
> -static pthread_rwlock_t vtpm_lock;
> -
> -void vtpm_lock_init() {
> -
> -  pthread_rwlock_init( &vtpm_lock, NULL);
> -}
> -
> -void vtpm_lock_destroy(){
> -  pthread_rwlock_destroy(&vtpm_lock);
> -}
> -
> -void vtpm_lock_rdlock(){
> -  pthread_rwlock_rdlock(&vtpm_lock);
> -}
> -
> -void vtpm_lock_wrlock(){
> -  pthread_rwlock_wrlock(&vtpm_lock);
> -}
> -
> -void vtpm_lock_unlock(){
> -  pthread_rwlock_unlock(&vtpm_lock);
> -}
> -
> diff --git a/tools/vtpm_manager/manager/vtpm_lock.h b/tools/vtpm_manager/manager/vtpm_lock.h
> deleted file mode 100644
> index 53a339d..0000000
> --- a/tools/vtpm_manager/manager/vtpm_lock.h
> +++ /dev/null
> @@ -1,48 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_lock.h Provided controlled sync around access to vtpm structures
> -//
> -// ===================================================================
> -
> -#ifndef __VTPM_LOCK_H__
> -#define __VTPM_LOCK_H__
> -
> -void vtpm_lock_init();
> -void vtpm_lock_destroy();
> -
> -void vtpm_lock_rdlock();
> -void vtpm_lock_wrlock();
> -void vtpm_lock_unlock();
> -
> -#endif
> diff --git a/tools/vtpm_manager/manager/vtpm_manager.c b/tools/vtpm_manager/manager/vtpm_manager.c
> deleted file mode 100644
> index e089f78..0000000
> --- a/tools/vtpm_manager/manager/vtpm_manager.c
> +++ /dev/null
> @@ -1,285 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_manager.c
> -//
> -//  This file will house the main logic of the VTPM Manager
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <string.h>
> -
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "vtsp.h"
> -#include "bsg.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -
> -#include "log.h"
> -#include "buffer.h"
> -
> -VTPM_GLOBALS *vtpm_globals=NULL;
> -
> -// --------------------------- Well Known Auths --------------------------
> -const TPM_AUTHDATA SRK_AUTH = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
> -                                  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
> -
> -#ifdef WELL_KNOWN_OWNER_AUTH
> -static BYTE FIXED_OWNER_AUTH[20] =  {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
> -                                  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
> -#endif
> -
> -
> -// -------------------------- Hash table functions --------------------
> -
> -static unsigned int hashfunc32(void *ky) {
> -  return (* (UINT32 *) ky);
> -}
> -
> -static int equals32(void *k1, void *k2) {
> -  return (*(UINT32 *) k1 == *(UINT32 *) k2);
> -}
> -
> -// --------------------------- Functions ------------------------------
> -
> -TPM_RESULT VTPM_Create_Manager(){
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  // Generate Auth for Owner
> -#ifdef WELL_KNOWN_OWNER_AUTH
> -  memcpy(vtpm_globals->owner_usage_auth, FIXED_OWNER_AUTH, sizeof(TPM_AUTHDATA));
> -#else
> -  Crypto_GetRandom(vtpm_globals->owner_usage_auth, sizeof(TPM_AUTHDATA) );
> -#endif
> -
> -  // Take Owership of TPM
> -  CRYPTO_INFO ek_cryptoInfo;
> -
> -  status = VTSP_ReadPubek(vtpm_globals->manager_tcs_handle, &ek_cryptoInfo);
> -
> -  // If we can read PubEK then there is no owner and we should take it.
> -  // We use the abilty to read the pubEK to flag that the TPM is owned.
> -  // FIXME: Change to just trying to take ownership and react to the status
> -  if (status == TPM_SUCCESS) {
> -    TPMTRYRETURN(VTSP_TakeOwnership(vtpm_globals->manager_tcs_handle,
> -                                   (const TPM_AUTHDATA*)&vtpm_globals->owner_usage_auth,
> -                                   &SRK_AUTH,
> -                                   &ek_cryptoInfo,
> -                                   &vtpm_globals->keyAuth));
> -
> -    TPMTRYRETURN(VTSP_DisablePubekRead(vtpm_globals->manager_tcs_handle,
> -                                       (const TPM_AUTHDATA*)&vtpm_globals->owner_usage_auth,
> -                                       &vtpm_globals->keyAuth));
> -  } else {
> -    vtpmloginfo(VTPM_LOG_VTPM, "Failed to readEK meaning TPM has an owner. Creating Keys off existing SRK.\n");
> -  }
> -
> -  // Generate storage key's auth
> -  Crypto_GetRandom(  &vtpm_globals->storage_key_usage_auth,
> -                    sizeof(TPM_AUTHDATA) );
> -
> -  TCS_AUTH osap;
> -  TPM_AUTHDATA sharedsecret;
> -
> -  TPMTRYRETURN( VTSP_OSAP(vtpm_globals->manager_tcs_handle,
> -                         TPM_ET_KEYHANDLE,
> -                         TPM_SRK_KEYHANDLE,
> -                         &SRK_AUTH,
> -                         &sharedsecret,
> -                         &osap) );
> -
> -  osap.fContinueAuthSession = FALSE;
> -
> -
> -  TPMTRYRETURN( VTSP_CreateWrapKey( vtpm_globals->manager_tcs_handle,
> -                                   TPM_KEY_BIND,
> -                                   (const TPM_AUTHDATA*)&vtpm_globals->storage_key_usage_auth,
> -                                   TPM_SRK_KEYHANDLE,
> -                                   (const TPM_AUTHDATA*)&sharedsecret,
> -                                   &vtpm_globals->storageKeyWrap,
> -                                   &osap) );
> -
> -  // Generate boot key's auth
> -  TPM_AUTHDATA bootKeyWrapAuth;
> -  memset(&bootKeyWrapAuth, 0, sizeof(bootKeyWrapAuth));
> -
> -  TPMTRYRETURN( VTSP_OSAP(vtpm_globals->manager_tcs_handle,
> -                         TPM_ET_KEYHANDLE,
> -                         TPM_SRK_KEYHANDLE,
> -                         &SRK_AUTH,
> -                         &sharedsecret,
> -                         &osap) );
> -
> -  osap.fContinueAuthSession = FALSE;
> -
> -  // FIXME: This key protects the global secrets on disk. It should use TPM
> -  //        PCR bindings to limit its use to legit configurations.
> -  //        Current binds are open, implying a Trusted VM contains this code.
> -  //        If this VM is not Trusted, use measurement and PCR bindings.
> -  TPMTRYRETURN( VTSP_CreateWrapKey( vtpm_globals->manager_tcs_handle,
> -                                   TPM_KEY_BIND,
> -                                   (const TPM_AUTHDATA*)&bootKeyWrapAuth,
> -                                   TPM_SRK_KEYHANDLE,
> -                                   (const TPM_AUTHDATA*)&sharedsecret,
> -                                   &vtpm_globals->bootKeyWrap,
> -                                   &osap) );
> -
> -  // Populate CRYPTO_INFO vtpm_globals->bootKey. This does not load it into the TPM
> -  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
> -                              TPM_SRK_KEYHANDLE,
> -                              &vtpm_globals->bootKeyWrap,
> -                              NULL,
> -                              NULL,
> -                              NULL,
> -                              &vtpm_globals->bootKey,
> -                              TRUE ) );
> -
> -  TPMTRYRETURN( VTSP_SaveState(vtpm_globals->manager_tcs_handle) );
> -  goto egress;
> -
> - abort_egress:
> -  exit(1);
> -
> - egress:
> -  vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager (Status = %d).\n", status);
> -  return status;
> -
> -}
> -
> -///////////////////////////////////////////////////////////////////////////////
> -TPM_RESULT VTPM_Init_Manager() {
> -  TPM_RESULT status = TPM_FAIL, serviceStatus;
> -  BYTE *randomsead;
> -  UINT32 randomsize=256;
> -
> -  if ((vtpm_globals = (VTPM_GLOBALS *) malloc(sizeof(VTPM_GLOBALS))) == NULL){
> -    status = TPM_FAIL;
> -    goto abort_egress;
> -  }
> -  memset(vtpm_globals, 0, sizeof(VTPM_GLOBALS));
> -
> -  vtpm_globals->connected_dmis = 0;
> -
> -  if ((vtpm_globals->dmi_map = create_hashtable(10, hashfunc32, equals32)) == NULL){
> -    status = TPM_FAIL;
> -    goto abort_egress;
> -  }
> -
> -  // Create new TCS Object
> -  vtpm_globals->manager_tcs_handle = 0;
> -
> -  TPMTRYRETURN(TCS_create());
> -
> -  // Create TCS Context for service
> -  TPMTRYRETURN( TCS_OpenContext(&vtpm_globals->manager_tcs_handle ) );
> -
> -  TPMTRYRETURN( TCSP_GetRandom(vtpm_globals->manager_tcs_handle,
> -                              &randomsize,
> -                              &randomsead));
> -
> -  Crypto_Init(randomsead, randomsize);
> -  TPMTRYRETURN( TCS_FreeMemory (vtpm_globals->manager_tcs_handle, randomsead));
> -
> -  // Create OIAP session for service's authorized commands
> -  TPMTRYRETURN( VTSP_OIAP( vtpm_globals->manager_tcs_handle,
> -                          &vtpm_globals->keyAuth) );
> -  vtpm_globals->keyAuth.fContinueAuthSession = TRUE;
> -
> -  vtpm_globals->mig_keys = NULL;
> -
> -  // If fails, create new Manager.
> -  serviceStatus = VTPM_LoadManagerData();
> -  if (serviceStatus == TPM_IOERROR) {
> -    vtpmloginfo(VTPM_LOG_VTPM, "Failed to read manager file. Assuming first time initialization.\n");
> -    TPMTRYRETURN( VTPM_Create_Manager() );
> -    TPMTRYRETURN( VTPM_SaveManagerData() );
> -  } else if (serviceStatus != TPM_SUCCESS) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to read existing manager file");
> -    exit(1);
> -  }
> -
> -  //Load Storage Key
> -  TPMTRYRETURN( VTSP_LoadKey( vtpm_globals->manager_tcs_handle,
> -                             TPM_SRK_KEYHANDLE,
> -                             &vtpm_globals->storageKeyWrap,
> -                             &SRK_AUTH,
> -                             &vtpm_globals->storageKeyHandle,
> -                             &vtpm_globals->keyAuth,
> -                             &vtpm_globals->storageKey,
> -                              FALSE ) );
> -
> -  // Create entry for Dom0 for control messages
> -  TPMTRYRETURN( VTPM_Handle_New_DMI(NULL) );
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return(status);
> -}
> -
> -///////////////////////////////////////////////////////////////////////////////
> -void VTPM_Stop_Manager() {
> -  VTPM_DMI_RESOURCE *dmi_res;
> -  struct hashtable_itr *dmi_itr;
> -
> -  // Close all the TCS contexts. TCS should evict keys based on this
> -  if (hashtable_count(vtpm_globals->dmi_map) > 0) {
> -    dmi_itr = hashtable_iterator(vtpm_globals->dmi_map);
> -    do {
> -      dmi_res = (VTPM_DMI_RESOURCE *) hashtable_iterator_value(dmi_itr);
> -      if (dmi_res->connected)
> -       close_dmi( dmi_res ); // Not really interested in return code
> -
> -    } while (hashtable_iterator_advance(dmi_itr));
> -               free (dmi_itr);
> -  }
> -
> -  if ( VTPM_SaveManagerData() != TPM_SUCCESS )
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to save manager data.\n");
> -
> -  TCS_CloseContext(vtpm_globals->manager_tcs_handle);
> -  TCS_destroy();
> -
> -  hashtable_destroy(vtpm_globals->dmi_map, 1);
> -  free(vtpm_globals);
> -
> -  Crypto_Exit();
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
> -}
> diff --git a/tools/vtpm_manager/manager/vtpm_manager.h b/tools/vtpm_manager/manager/vtpm_manager.h
> deleted file mode 100644
> index a324a8f..0000000
> --- a/tools/vtpm_manager/manager/vtpm_manager.h
> +++ /dev/null
> @@ -1,150 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_manager.h
> -//
> -//  Public Interface header for VTPM Manager
> -//
> -// ==================================================================
> -
> -#ifndef __VTPM_MANAGER_H__
> -#define __VTPM_MANAGER_H__
> -
> -#define VTPM_TAG_REQ 0x01c1
> -#define VTPM_TAG_RSP 0x01c4
> -#define COMMAND_BUFFER_SIZE 4096
> -
> -// Header sizes. Note Header MAY include the DMI
> -#define VTPM_COMMAND_HEADER_SIZE_CLT ( 2 + 4 + 4)
> -//                    sizeof(TPM_TAG + UINT32 + TPM_COMMAND_CODE)
> -#define VTPM_COMMAND_HEADER_SIZE_SRV ( 4 + VTPM_COMMAND_HEADER_SIZE_CLT )
> -//                    sizeof( UINT32 + VTPM_COMMAND_HEADER_SIZE_CLT)
> -
> -//************************ Command Codes ****************************
> -#define VTPM_ORD_BASE       0x0000
> -#define VTPM_PRIV_MASK      0x01000000 // Priviledged VTPM Command
> -#define VTPM_PRIV_BASE      (VTPM_ORD_BASE | VTPM_PRIV_MASK)
> -
> -// Non-priviledged VTPM Commands (From DMI's)
> -#define VTPM_ORD_SAVENVM      (VTPM_ORD_BASE + 1) // DMI Saves Secrets
> -#define VTPM_ORD_LOADNVM      (VTPM_ORD_BASE + 2) // DMI Loads Secrets
> -#define VTPM_ORD_TPMCOMMAND   (VTPM_ORD_BASE + 3) // DMI issues HW TPM Command
> -#define VTPM_ORD_GET_MIG_KEY  (VTPM_ORD_BASE + 4) // Get manager's migration key
> -#define VTPM_ORD_LOAD_MIG_KEY (VTPM_ORD_BASE + 5) // load dest migration key
> -
> -// Priviledged VTPM Commands (From management console)
> -#define VTPM_ORD_OPEN         (VTPM_PRIV_BASE + 1) // Creates/reopens DMI
> -#define VTPM_ORD_CLOSE        (VTPM_PRIV_BASE + 2) // Closes a DMI
> -#define VTPM_ORD_DELETE       (VTPM_PRIV_BASE + 3) // Permemently Deletes DMI
> -#define VTPM_ORD_MIGRATE_IN   (VTPM_PRIV_BASE + 4) // Load migrated VTPM
> -#define VTPM_ORD_MIGRATE_OUT  (VTPM_PRIV_BASE + 5) // migrate VTPM to dest
> -
> -//************************ Return Codes ****************************
> -#define VTPM_TYPE_PVM 1 // Paravirtualized Domain
> -#define VTPM_TYPE_HVM 2 // HVM Domain
> -
> -//************************ Return Codes ****************************
> -#define VTPM_SUCCESS               0
> -#define VTPM_FAIL                  1
> -#define VTPM_UNSUPPORTED           2
> -#define VTPM_FORBIDDEN             3
> -#define VTPM_RESTORE_CONTEXT_FAILED    4
> -#define VTPM_INVALID_REQUEST       5
> -
> -//*********************** Parameter Values *************************
> -#define VTPM_TYPE_NON_MIGRATABLE  0x00
> -#define VTPM_TYPE_MIGRATABLE      0x01
> -#define VTPM_TYPE_MIGRATED        0xFF // VTPM has been migrated.
> -                                       // VTPM can be recovered or deleted only
> -
> -/******************* Command Parameter API *************************
> -
> -VTPM Command Format
> -  dmi: 4 bytes                  // Source of message.
> -                                // WARNING: This is prepended by the channel.
> -                                // Thus it is received by VTPM Manager,
> -                                // but not sent by DMI
> -  tpm tag: 2 bytes
> -  command size: 4 bytes         // Size of command including header but not DMI
> -  ord: 4 bytes                  // Command ordinal above
> -  parameters: size - 10 bytes   // Command Parameter
> -
> -VTPM Response Format
> -  tpm tag: 2 bytes
> -  response_size: 4 bytes
> -  status: 4 bytes
> -  parameters: size - 10 bytes
> -
> -
> -VTPM_Open:
> -  Input Parameters:
> -    mig_type: 1 byte
> -    startup_mode: 1 byte // Cold Boot = 1, resume = 2, deactive = 3
> -    domain type: 1 byte
> -    instance_id: 4 bytes
> -  Output Parameters:
> -    None
> -
> -VTPM_Close
> -  Input Parameters:
> -    instance_id: 4 bytes
> -  Output Parameters:
> -    None
> -
> -VTPM_Delete
> -  Input Parameters:
> -    instance_id: 4 bytes
> -  Output Parameters:
> -    None
> -
> -VTPM_SaveNVM
> -  Input Parameters:
> -    data: n bytes (Header indicates size of data)
> -  Output Parameters:
> -    None
> -
> -VTPM_LoadNVM
> -  Input Parameters:
> -    None
> -  Output Parameters:
> -    data: n bytes (Header indicates size of data)
> -
> -VTPM_TPMCommand
> -  Input Parameters:
> -    TPM Command Byte Stream: n bytes
> -  Output Parameters:
> -    TPM Reponse Byte Stream: n bytes
> -
> -*********************************************************************/
> -
> -#endif //_VTPM_MANAGER_H_
> diff --git a/tools/vtpm_manager/manager/vtpm_manager_handler.c b/tools/vtpm_manager/manager/vtpm_manager_handler.c
> deleted file mode 100644
> index 2001074..0000000
> --- a/tools/vtpm_manager/manager/vtpm_manager_handler.c
> +++ /dev/null
> @@ -1,488 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_manager_handler.c
> -//
> -//  This file will house the main logic of the VTPM Manager
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <string.h>
> -#include <errno.h>
> -
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "vtsp.h"
> -#include "bsg.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -#include "log.h"
> -#include "buffer.h"
> -
> -#define vtpmhandlerloginfo(module,fmt,args...) vtpmloginfo (module, "[%s]: " fmt, thread_name, ##args );
> -#define vtpmhandlerloginfomore(module,fmt,args...) vtpmloginfomore (module, fmt, ##args );
> -#define vtpmhandlerlogerror(module,fmt,args...) vtpmlogerror (module, "[%s]: " fmt, thread_name, ##args );
> -
> -// ---------------------- Prototypes -------------------
> -TPM_RESULT vtpm_manager_handle_vtpm_cmd(VTPM_DMI_RESOURCE *dmi_res,
> -                                       TPM_COMMAND_CODE ord,
> -                                       buffer_t *command_buf,
> -                                       buffer_t *result_buf,
> -                                        BOOL is_priv,
> -                                        char *thread_name);
> -
> -TPM_RESULT vtpm_manager_handle_tpm_cmd(vtpm_ipc_handle_t *tx_ipc_h,
> -                                       vtpm_ipc_handle_t *rx_ipc_h,
> -                                       VTPM_DMI_RESOURCE *dmi_res,
> -                                       BYTE *cmd_header,
> -                                       buffer_t *param_buf,
> -                                       buffer_t *result_buf,
> -                                       char *thread_name);
> -
> -TPM_RESULT VTPM_Manager_Handler( vtpm_ipc_handle_t *tx_ipc_h,
> -                                 vtpm_ipc_handle_t *rx_ipc_h,
> -                                 BOOL fw_tpm,   // Forward TPM cmds?
> -                                 vtpm_ipc_handle_t *fw_tx_ipc_h,
> -                                 vtpm_ipc_handle_t *fw_rx_ipc_h,
> -                                 BOOL is_priv,
> -                                 char *thread_name) {
> -  TPM_RESULT      status =  TPM_FAIL; // Should never return
> -  UINT32          dmi, in_param_size, cmd_size, out_param_size, out_message_size, reply_size;
> -  BYTE            *cmd_header=NULL, *in_param=NULL, *out_message=NULL, *reply;
> -  buffer_t        *command_buf=NULL, *result_buf=NULL;
> -  TPM_TAG         tag;
> -  TPM_COMMAND_CODE ord;
> -  VTPM_DMI_RESOURCE *dmi_res;
> -  int  size_read, size_write, i;
> -  BOOL add_header=TRUE; // This indicates to prepend a header on result_buf before sending
> -
> -  cmd_header = (BYTE *) malloc(VTPM_COMMAND_HEADER_SIZE_SRV);
> -  command_buf = (buffer_t *) malloc(sizeof(buffer_t));
> -  result_buf = (buffer_t *) malloc(sizeof(buffer_t));
> -
> -  // ------------------------ Main Loop --------------------------------
> -  while(1) {
> -
> -    vtpmhandlerloginfo(VTPM_LOG_VTPM, "%s waiting for messages.\n", thread_name);
> -
> -    // --------------------- Read Cmd from Sender ----------------
> -
> -    // Read command header
> -    size_read = vtpm_ipc_read(rx_ipc_h, NULL, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -    if (size_read > 0) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "RECV[%d]: 0x", size_read);
> -      for (i=0; i<size_read; i++)
> -       vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s can't read from ipc. Errono = %d. Aborting... \n", thread_name, errno);
> -      goto abort_command;
> -    }
> -
> -    if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "\n");
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command shorter than normal header (%d bytes). Aborting...\n", size_read);
> -      goto abort_command;
> -    }
> -
> -    // Unpack header
> -    BSG_UnpackList(cmd_header, 4,
> -                  BSG_TYPE_UINT32, &dmi,
> -                  BSG_TPM_TAG, &tag,
> -                  BSG_TYPE_UINT32, &in_param_size,
> -                  BSG_TPM_COMMAND_CODE, &ord );
> -
> -    // Using the header info, read the parameters of the command
> -    // Note that in_param_size is in the client's context
> -    cmd_size = in_param_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> -    if (cmd_size > 0) {
> -      in_param = (BYTE *) malloc(cmd_size);
> -      size_read = vtpm_ipc_read( rx_ipc_h, NULL, in_param, cmd_size);
> -      if (size_read > 0) {
> -       for (i=0; i<size_read; i++)
> -         vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
> -
> -      } else {
> -        vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s had error reading cmd from ipc. Aborting... \n", thread_name);
> -       goto abort_command;
> -      }
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -      if (size_read < (int) cmd_size) {
> -       vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -       vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d). Aborting...\n", size_read, cmd_size);
> -       goto abort_command;
> -      }
> -    } else {
> -      in_param = NULL;
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -    }
> -
> -    // Init the buffers used to handle the command and the response
> -    if ( (buffer_init_convert(command_buf, cmd_size, in_param) != TPM_SUCCESS) ||
> -        (buffer_init(result_buf, 0, 0) != TPM_SUCCESS) ) {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Failed to setup buffers. Aborting...\n");
> -      goto abort_command;
> -    }
> -
> -    // -------------- Dispatch Commands to Handlers -----------
> -    if ((tag == VTPM_TAG_REQ) && (ord & VTPM_PRIV_MASK)) {
> -      vtpm_lock_wrlock();
> -    } else {
> -      vtpm_lock_rdlock();
> -    }
> -
> -    if ( !(dmi_res = (VTPM_DMI_RESOURCE *) hashtable_search(vtpm_globals->dmi_map, &dmi)) ||
> -         (!dmi_res->connected) ) {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Attempted access to non-existent or disconnected DMI %d. Aborting...\n", dmi);
> -      status = TPM_BAD_PARAMETER;
> -      // We have no one to reply to, they don't exist.
> -      goto abort_command;
> -    }
> -
> -    if (tag == VTPM_TAG_REQ) {
> -
> -      status = vtpm_manager_handle_vtpm_cmd(dmi_res, ord, command_buf, result_buf, is_priv, thread_name);
> -
> -    } else { // This is not a VTPM Command at all.
> -      if (fw_tpm) {
> -        status = vtpm_manager_handle_tpm_cmd(fw_tx_ipc_h, fw_rx_ipc_h, dmi_res, cmd_header, command_buf, result_buf, thread_name);
> -
> -        // This means calling the DMI failed, not that the cmd failed in the DMI
> -        // Since the return will be interpretted by a TPM app, all errors are IO_ERRORs to the app
> -        if (status != TPM_SUCCESS) {
> -          status = TPM_IOERROR;
> -         goto abort_with_error;
> -        }
> -        // Unlike all other commands, forwarded commands yield a result_buf that includes the DMI's status. This
> -        // should be forwarded to the caller VM
> -        add_header = FALSE;
> -      } else {
> -        // We are not supposed to forward TPM commands at all.
> -        int i;
> -        vtpmhandlerlogerror(VTPM_LOG_VTPM, "Attempt to use unsupported direct access to TPM.\n");
> -        vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "Bad Command. dmi:%d, tag:%d, size:%d, ord:%d, Params: ", dmi, tag, in_param_size, ord);
> -        for (i=0; i<cmd_size; i++)
> -          vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
> -
> -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -
> -        status = TPM_FAIL;
> -        goto abort_with_error;
> -     }
> -
> -    } // end else for is VTPM Command
> -
> -    // ------------------- Respond to Sender ------------------
> -
> -    // Errors while handling responses jump here to reply with error messages
> -    // NOTE: Currently there are no recoverable errors in multi-VM mode. If one
> -    //       is added to the code, this ifdef should be removed.
> -    //       Also note this is NOT referring to errors in commands, but rather
> -    //       this is about I/O errors and such.
> -#ifndef VTPM_MULTI_VM
> - abort_with_error:
> -#endif
> -
> -    if (add_header) {
> -      // Prepend VTPM header with destination DM stamped
> -      out_param_size = buffer_len(result_buf);
> -      out_message_size = VTPM_COMMAND_HEADER_SIZE_CLT + out_param_size;
> -      reply_size = VTPM_COMMAND_HEADER_SIZE_SRV + out_param_size;
> -      out_message = (BYTE *) malloc (reply_size);
> -      reply = out_message;
> -
> -      BSG_PackList(out_message, 4,
> -                  BSG_TYPE_UINT32, (BYTE *) &dmi,
> -                  BSG_TPM_TAG, (BYTE *) &tag,
> -                  BSG_TYPE_UINT32, (BYTE *) &out_message_size,
> -                  BSG_TPM_RESULT, (BYTE *) &status);
> -
> -      if (buffer_len(result_buf) > 0)
> -        memcpy(out_message + VTPM_COMMAND_HEADER_SIZE_SRV, result_buf->bytes, out_param_size);
> -      //Note: Send message + dmi_id
> -    } else {
> -      reply = result_buf->bytes;
> -      reply_size = buffer_len(result_buf);
> -    }
> -    size_write = vtpm_ipc_write(tx_ipc_h, (dmi_res ? dmi_res->tx_vtpm_ipc_h : NULL), reply, reply_size );
> -    if (size_write > 0) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT: 0x");
> -      for (i=0; i < reply_size; i++)
> -       vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", reply[i]);
> -
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s had error writing to ipc. Aborting... \n", thread_name);
> -      goto abort_command;
> -    }
> -    free(out_message); out_message=NULL;
> -
> -    if (size_write < (int)reply_size) {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "%s unable to write full command to ipc (%d/%d)\n", thread_name, size_write, reply_size);
> -      goto abort_command;
> -    }
> -
> -    // On certain failures an error message cannot be sent.
> -    // This marks the beginning of cleanup in preperation for the next command.
> -  abort_command:
> -    //free buffers
> -    bzero(cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -    //free(in_param); // This was converted to command_buf. No need to free
> -    buffer_free(result_buf);
> -    buffer_free(command_buf);
> -
> -    // If we have a write lock, save the manager table
> -    if ((tag == VTPM_TAG_REQ) && (ord & VTPM_PRIV_MASK) &&
> -        (VTPM_SaveManagerData() != TPM_SUCCESS) ) {
> -       vtpmhandlerlogerror(VTPM_LOG_VTPM, "ERROR: Unable to save manager data.\n");
> -    }
> -
> -    vtpm_lock_unlock();
> -    add_header = TRUE; // Reset to the default
> -  } // End while(1)
> -
> -}
> -
> -/////////////////////////////////////////////////////////////////////////
> -TPM_RESULT vtpm_manager_handle_vtpm_cmd(VTPM_DMI_RESOURCE *dmi_res,
> -                                       TPM_COMMAND_CODE ord,
> -                                       buffer_t *command_buf,
> -                                       buffer_t *result_buf,
> -                                        BOOL is_priv,
> -                                        char *thread_name) {
> -
> -  TPM_RESULT status = TPM_FAIL;
> -
> -  switch (ord) {
> -  case VTPM_ORD_SAVENVM:
> -    status= VTPM_Handle_Save_NVM(dmi_res,
> -                                 command_buf,
> -                                 result_buf);
> -    break;
> -
> -  case VTPM_ORD_LOADNVM:
> -    status= VTPM_Handle_Load_NVM(dmi_res,
> -                                 command_buf,
> -                                 result_buf);
> -    break;
> -
> -  case VTPM_ORD_TPMCOMMAND:
> -    status= VTPM_Handle_TPM_Command(dmi_res,
> -                                    command_buf,
> -                                    result_buf);
> -    break;
> -
> -  case VTPM_ORD_GET_MIG_KEY:
> -    status = VTPM_Handle_Get_Migration_key(command_buf,
> -                                           result_buf);
> -    break;
> -
> -  case VTPM_ORD_LOAD_MIG_KEY:
> -    status = VTPM_Handle_Load_Migration_key(command_buf,
> -                                           result_buf);
> -    break;
> -
> -  default:
> -    // Privileged handlers can do maintanance
> -    if (is_priv) {
> -      switch (ord) {
> -      case VTPM_ORD_OPEN:
> -        status = VTPM_Handle_New_DMI(command_buf);
> -        break;
> -
> -      case VTPM_ORD_CLOSE:
> -        status = VTPM_Handle_Close_DMI(command_buf);
> -        break;
> -
> -      case VTPM_ORD_DELETE:
> -        status = VTPM_Handle_Delete_DMI(command_buf);
> -        break;
> -
> -      case VTPM_ORD_MIGRATE_IN:
> -        status = VTPM_Handle_Migrate_In(command_buf, result_buf);
> -        break;
> -
> -      case VTPM_ORD_MIGRATE_OUT:
> -        status = VTPM_Handle_Migrate_Out(command_buf, result_buf);
> -        break;
> -
> -      default:
> -        status = TPM_BAD_ORDINAL;
> -      } // switch
> -    } else { // is priv command
> -
> -        status = TPM_BAD_ORDINAL;
> -    } // inner switch
> -  } // outer switch
> -
> -  return(status);
> -}
> -
> -/////////////////////////////////////////////////////////////////////
> -TPM_RESULT vtpm_manager_handle_tpm_cmd(vtpm_ipc_handle_t *tx_ipc_h,
> -                                       vtpm_ipc_handle_t *rx_ipc_h,
> -                                      VTPM_DMI_RESOURCE *dmi_res,
> -                                      BYTE *cmd_header,
> -                                      buffer_t *param_buf,
> -                                      buffer_t *result_buf,
> -                                       char *thread_name) {
> -
> -  TPM_RESULT status = TPM_FAIL;
> -  UINT32 dmi_dst;
> -  TPM_COMMAND_CODE ord;
> -  TPM_TAG tag_out;
> -  UINT32 dmi_cmd_size, in_param_size, adj_param_size;
> -  BYTE *dmi_cmd, *in_param;
> -  int  size_read, size_write, i;
> -
> -  //// Dom0 can't talk to the BE, so this must be a broken FE/BE or badness
> -  if (dmi_res->dmi_id == VTPM_CTL_DM) {
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Illegal use of TPM command from dom0\n");
> -    status = TPM_FAIL;
> -    goto abort_with_error;
> -  }
> -
> -  vtpmhandlerloginfo(VTPM_LOG_VTPM, "Forwarding command to DMI.\n");
> -
> -  //Forward TPM CMD stamped with dmi_id to DMI for handling
> -  if (buffer_len(param_buf)) {
> -    dmi_cmd = (BYTE *) malloc(VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf));
> -    dmi_cmd_size = VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf);
> -    memcpy(dmi_cmd, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -    memcpy(dmi_cmd + VTPM_COMMAND_HEADER_SIZE_SRV, param_buf->bytes, buffer_len(param_buf));
> -    size_write = vtpm_ipc_write(tx_ipc_h, dmi_res->tx_tpm_ipc_h, dmi_cmd, dmi_cmd_size);
> -
> -    if (size_write > 0) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT (DMI): 0x");
> -      for (i=0; i<VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(param_buf); i++) {
> -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", dmi_cmd[i]);
> -      }
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error writing to DMI. Aborting... \n");
> -      status = TPM_IOERROR;
> -      goto abort_with_error;
> -    }
> -    free(dmi_cmd);
> -  } else {
> -    dmi_cmd_size = VTPM_COMMAND_HEADER_SIZE_SRV;
> -    size_write = vtpm_ipc_write(tx_ipc_h, dmi_res->tx_tpm_ipc_h, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV );
> -    if (size_write > 0) {
> -      vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "SENT (DMI): 0x");
> -      for (i=0; i<VTPM_COMMAND_HEADER_SIZE_SRV; i++)
> -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> -
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error writing to DMI. Aborting... \n");
> -      status = TPM_IOERROR;
> -      goto abort_with_error;
> -    }
> -  }
> -
> -  if (size_write != (int) dmi_cmd_size)
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Could not write entire command to DMI (%d/%d)\n", size_write, dmi_cmd_size);
> -
> -  buffer_free(param_buf);
> -
> -  // Read header for response to TPM command from DMI
> -  size_read = vtpm_ipc_read( rx_ipc_h, dmi_res->rx_tpm_ipc_h, cmd_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -  if (size_read > 0) {
> -    vtpmhandlerloginfo(VTPM_LOG_VTPM_DEEP, "RECV (DMI): 0x");
> -    for (i=0; i<size_read; i++)
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> -
> -  } else {
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error reading from DMI. Aborting... \n");
> -    status = TPM_IOERROR;
> -    goto abort_with_error;
> -  }
> -
> -  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command from DMI shorter than normal header. Aborting...\n");
> -    status = TPM_IOERROR;
> -    goto abort_with_error;
> -  }
> -
> -  // Unpack response from DMI for TPM command
> -  BSG_UnpackList(cmd_header, 4,
> -                 BSG_TYPE_UINT32, &dmi_dst,
> -                 BSG_TPM_TAG, &tag_out,
> -                 BSG_TYPE_UINT32, &in_param_size,
> -                 BSG_TPM_COMMAND_CODE, &status );
> -
> -  // If response has parameters, read them.
> -  // Note that in_param_size is in the client's context
> -  adj_param_size = in_param_size - VTPM_COMMAND_HEADER_SIZE_CLT;
> -  if (adj_param_size > 0) {
> -    in_param = (BYTE *) malloc(adj_param_size);
> -    size_read = vtpm_ipc_read(rx_ipc_h, dmi_res->rx_tpm_ipc_h, in_param, adj_param_size);
> -    if (size_read > 0) {
> -      for (i=0; i<size_read; i++)
> -        vtpmhandlerloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param[i]);
> -
> -    } else {
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Error reading from BE. Aborting... \n");
> -      goto abort_with_error;
> -    }
> -    vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
> -
> -    if (size_read < (int)adj_param_size) {
> -      vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
> -      vtpmhandlerlogerror(VTPM_LOG_VTPM, "Command read(%d) from DMI is shorter than header indicates(%d). Aborting...\n", size_read, adj_param_size);
> -      status = TPM_IOERROR;
> -      goto abort_with_error;
> -    }
> -  } else {
> -    in_param = NULL;
> -    vtpmhandlerloginfomore(VTPM_LOG_VTPM, "\n");
> -  }
> -
> -  if ( (buffer_init(result_buf, VTPM_COMMAND_HEADER_SIZE_SRV, cmd_header) != TPM_SUCCESS) ||
> -       (buffer_append_raw(result_buf, adj_param_size, in_param) != TPM_SUCCESS) ) {
> -    vtpmhandlerlogerror(VTPM_LOG_VTPM, "Failed to setup buffers. Aborting...\n");
> -    status = TPM_FAIL;
> -    goto abort_with_error;
> -  }
> -
> -  vtpmhandlerloginfo(VTPM_LOG_VTPM, "Sending DMI's response to guest.\n");
> -
> -  status = TPM_SUCCESS;
> -
> - abort_with_error:
> -
> -  return status;
> -}
> -
> diff --git a/tools/vtpm_manager/manager/vtpmd.c b/tools/vtpm_manager/manager/vtpmd.c
> deleted file mode 100644
> index cf58ba3..0000000
> --- a/tools/vtpm_manager/manager/vtpmd.c
> +++ /dev/null
> @@ -1,371 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpmd.c
> -//
> -//  Application
> -//
> -// ===================================================================
> -
> -#include <stdio.h>
> -#include <unistd.h>
> -#include <sys/types.h>
> -#include <sys/stat.h>
> -#include <fcntl.h>
> -#include <signal.h>
> -#include <string.h>
> -#include <pthread.h>
> -#include "vtpm_manager.h"
> -#include "vtpmpriv.h"
> -#include "tcg.h"
> -#include "log.h"
> -#include "vtpm_ipc.h"
> -
> -#define TPM_EMULATOR_PATH "/usr/bin/vtpmd"
> -
> -#define VTPM_BE_FNAME          "/dev/vtpm"
> -#define VTPM_DUMMY_TX_BE_FNAME "/var/vtpm/fifos/dummy_out.fifo"
> -#define VTPM_DUMMY_RX_BE_FNAME "/var/vtpm/fifos/dummy_in.fifo"
> -#define VTPM_TX_TPM_FNAME      "/var/vtpm/fifos/tpm_cmd_to_%d.fifo"
> -#define VTPM_RX_TPM_FNAME      "/var/vtpm/fifos/tpm_rsp_from_all.fifo"
> -#define VTPM_TX_VTPM_FNAME     "/var/vtpm/fifos/vtpm_rsp_to_%d.fifo"
> -#define VTPM_RX_VTPM_FNAME     "/var/vtpm/fifos/vtpm_cmd_from_all.fifo"
> -#define VTPM_TX_HP_FNAME       "/var/vtpm/fifos/to_console.fifo"
> -#define VTPM_RX_HP_FNAME       "/var/vtpm/fifos/from_console.fifo"
> -
> -#define VTPM_TYPE_PVM_STRING "pvm"
> -#define VTPM_TYPE_HVM_STRING "hvm"
> -
> -struct vtpm_thread_params_s {
> -  vtpm_ipc_handle_t *tx_ipc_h;
> -  vtpm_ipc_handle_t *rx_ipc_h;
> -  BOOL fw_tpm;
> -  vtpm_ipc_handle_t *fw_tx_ipc_h;
> -  vtpm_ipc_handle_t *fw_rx_ipc_h;
> -  BOOL is_priv;
> -  char *thread_name;
> -};
> -
> -// This is needed to all extra_close_dmi to close this to prevent a
> -// broken pipe when no DMIs are left.
> -static vtpm_ipc_handle_t *g_rx_tpm_ipc_h;
> -
> -void *vtpm_manager_thread(void *arg_void) {
> -  TPM_RESULT *status = (TPM_RESULT *) malloc(sizeof(TPM_RESULT) );
> -  struct vtpm_thread_params_s *arg = (struct vtpm_thread_params_s *) arg_void;
> -
> -  *status = VTPM_Manager_Handler(arg->tx_ipc_h, arg->rx_ipc_h,
> -                                 arg->fw_tpm, arg->fw_tx_ipc_h, arg->fw_rx_ipc_h,
> -                                 arg->is_priv, arg->thread_name);
> -
> -  return (status);
> -}
> -
> -
> -void signal_handler(int reason) {
> -  if (pthread_equal(pthread_self(), vtpm_globals->master_pid)) {
> -    vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager shutting down for signal %d.\n", reason);
> -  } else {
> -    // For old Linux Thread machines, signals are delivered to each thread. Deal with them.
> -    vtpmloginfo(VTPM_LOG_VTPM, "Child shutting down\n");
> -    pthread_exit(NULL);
> -  }
> -
> -  VTPM_Stop_Manager();
> -  exit(-1);
> -}
> -
> -struct sigaction ctl_c_handler;
> -
> -TPM_RESULT VTPM_New_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res, BYTE vm_type, BYTE startup_mode) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  int fh;
> -  char dmi_id_str[11]; // UINT32s are up to 10 digits + NULL
> -  char *tx_vtpm_name, *tx_tpm_name, *vm_type_string;
> -  struct stat file_info;
> -
> -  if (dmi_res->dmi_id == VTPM_CTL_DM) {
> -    dmi_res->tx_tpm_ipc_h = NULL;
> -    dmi_res->rx_tpm_ipc_h = NULL;
> -    dmi_res->tx_vtpm_ipc_h = NULL;
> -    dmi_res->rx_vtpm_ipc_h = NULL;
> -  } else {
> -    // Create a pair of fifo pipes
> -    dmi_res->rx_tpm_ipc_h = NULL;
> -    dmi_res->rx_vtpm_ipc_h = NULL;
> -
> -    if ( ((dmi_res->tx_tpm_ipc_h = (vtpm_ipc_handle_t *) malloc (sizeof(vtpm_ipc_handle_t))) == NULL ) ||
> -         ((dmi_res->tx_vtpm_ipc_h =(vtpm_ipc_handle_t *) malloc (sizeof(vtpm_ipc_handle_t))) == NULL ) ||
> -         ((tx_tpm_name = (char *) malloc(11 + strlen(VTPM_TX_TPM_FNAME))) == NULL ) ||
> -         ((tx_vtpm_name =(char *) malloc(11 + strlen(VTPM_TX_VTPM_FNAME))) == NULL) ) {
> -      status =TPM_RESOURCES;
> -      goto abort_egress;
> -    }
> -
> -    sprintf(tx_tpm_name, VTPM_TX_TPM_FNAME, (uint32_t) dmi_res->dmi_id);
> -    sprintf(tx_vtpm_name, VTPM_TX_VTPM_FNAME, (uint32_t) dmi_res->dmi_id);
> -
> -    if ( (vtpm_ipc_init(dmi_res->tx_tpm_ipc_h, tx_tpm_name, O_WRONLY | O_NONBLOCK, TRUE) != 0) ||
> -         (vtpm_ipc_init(dmi_res->tx_vtpm_ipc_h, tx_vtpm_name, O_WRONLY, TRUE) != 0) ) { //FIXME: O_NONBLOCK?
> -      status = TPM_IOERROR;
> -      goto abort_egress;
> -    }
> -
> -    // Measure DMI
> -    // FIXME: This will measure DMI. Until then use a fixed DMI_Measurement value
> -    // Also, this mechanism is specific to 1 VM architecture.
> -    /*
> -    fh = open(TPM_EMULATOR_PATH, O_RDONLY);
> -    stat_ret = fstat(fh, &file_stat);
> -    if (stat_ret == 0)
> -      dmi_size = file_stat.st_size;
> -    else {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Could not open vtpmd!!\n");
> -      status = TPM_IOERROR;
> -      goto abort_egress;
> -    }
> -    dmi_buffer
> -    */
> -    memset(&dmi_res->DMI_measurement, 0xcc, sizeof(TPM_DIGEST));
> -
> -    if (vm_type == VTPM_TYPE_PVM)
> -      vm_type_string = (BYTE *)&VTPM_TYPE_PVM_STRING;
> -    else
> -      vm_type_string = (BYTE *)&VTPM_TYPE_HVM_STRING;
> -
> -    // Launch DMI
> -    sprintf(dmi_id_str, "%d", (int) dmi_res->dmi_id);
> -#ifdef MANUAL_DM_LAUNCH
> -    vtpmlogerror(VTPM_LOG_VTPM, "Manually start VTPM with dmi=%s now.\n", dmi_id_str);
> -    dmi_res->dmi_pid = 0;
> -#else
> -    pid_t pid = fork();
> -
> -    if (pid == -1) {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Could not fork to launch vtpm\n");
> -      status = TPM_RESOURCES;
> -      goto abort_egress;
> -    } else if (pid == 0) {
> -      switch (startup_mode) {
> -      case TPM_ST_CLEAR:
> -        execl (TPM_EMULATOR_PATH, "vtpmd", "clear", vm_type_string, dmi_id_str, NULL);
> -        break;
> -      case TPM_ST_STATE:
> -        execl (TPM_EMULATOR_PATH, "vtpmd", "save", vm_type_string, dmi_id_str, NULL);
> -        break;
> -      case TPM_ST_DEACTIVATED:
> -        execl (TPM_EMULATOR_PATH, "vtpmd", "deactivated", vm_type_string, dmi_id_str, NULL);
> -        break;
> -      default:
> -        status = TPM_BAD_PARAMETER;
> -        goto abort_egress;
> -      }
> -
> -      // Returning from these at all is an error.
> -      vtpmlogerror(VTPM_LOG_VTPM, "Could not exec to launch vtpm\n");
> -    } else {
> -      dmi_res->dmi_pid = pid;
> -      vtpmloginfo(VTPM_LOG_VTPM, "Launching DMI on PID = %d\n", pid);
> -    }
> -#endif // MANUAL_DM_LAUNCH
> -
> -  } // If DMI = VTPM_CTL_DM
> -    status = TPM_SUCCESS;
> -
> -abort_egress:
> -  return (status);
> -}
> -
> -TPM_RESULT VTPM_Close_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  if (vtpm_globals->connected_dmis == 0) {
> -    // No more DMI's connected. Close fifo to prevent a broken pipe.
> -    // This is hackish. Need to think of another way.
> -    vtpm_ipc_close(g_rx_tpm_ipc_h);
> -  }
> -
> -
> -  if (dmi_res->dmi_id != VTPM_CTL_DM) {
> -    vtpm_ipc_close(dmi_res->tx_tpm_ipc_h);
> -    vtpm_ipc_close(dmi_res->tx_vtpm_ipc_h);
> -
> -    free(dmi_res->tx_tpm_ipc_h->name);
> -    free(dmi_res->tx_vtpm_ipc_h->name);
> -
> -#ifndef MANUAL_DM_LAUNCH
> -    if (dmi_res->dmi_id != VTPM_CTL_DM) {
> -      if (dmi_res->dmi_pid != 0) {
> -        vtpmloginfo(VTPM_LOG_VTPM, "Killing dmi on pid %d.\n", dmi_res->dmi_pid);
> -        if (kill(dmi_res->dmi_pid, SIGKILL) !=0) {
> -          vtpmloginfo(VTPM_LOG_VTPM, "DMI on pid %d is already dead.\n", dmi_res->dmi_pid);
> -        } else if (waitpid(dmi_res->dmi_pid, NULL, 0) != dmi_res->dmi_pid) {
> -          vtpmlogerror(VTPM_LOG_VTPM, "DMI on pid %d failed to stop.\n", dmi_res->dmi_pid);
> -          status = TPM_FAIL;
> -        }
> -      } else {
> -        vtpmlogerror(VTPM_LOG_VTPM, "Could not kill dmi because it's pid was 0.\n");
> -        status = TPM_FAIL;
> -      }
> -    }
> -#endif
> -
> -  } //endif ! dom0
> -  return status;
> -}
> -
> -
> -int main(int argc, char **argv) {
> -  vtpm_ipc_handle_t *tx_be_ipc_h, *rx_be_ipc_h, rx_tpm_ipc_h, rx_vtpm_ipc_h, tx_hp_ipc_h, rx_hp_ipc_h;
> -  struct vtpm_thread_params_s be_thread_params, dmi_thread_params, hp_thread_params;
> -  pthread_t be_thread, dmi_thread, hp_thread;
> -
> -#ifdef DUMMY_BACKEND
> -  vtpm_ipc_handle_t tx_dummy_ipc_h, rx_dummy_ipc_h;
> -#else
> -  vtpm_ipc_handle_t real_be_ipc_h;
> -#endif
> -
> -  vtpmloginfo(VTPM_LOG_VTPM, "Starting VTPM.\n");
> -
> -  // -------------------- Initialize Manager -----------------
> -  if (VTPM_Init_Manager() != TPM_SUCCESS) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Closing vtpmd due to error during startup.\n");
> -    return -1;
> -  }
> -
> -  // -------------------- Setup Ctrl+C Handlers --------------
> -  ctl_c_handler.sa_handler = signal_handler;
> -  sigemptyset(&ctl_c_handler.sa_mask);
> -  ctl_c_handler.sa_flags = 0;
> -
> -  if (sigaction(SIGINT, &ctl_c_handler, NULL) == -1)
> -    vtpmlogerror(VTPM_LOG_VTPM, "Could not install SIGINT handler. Ctl+break will not stop manager gently.\n");
> -
> -  // For easier debuggin with gdb
> -  if (sigaction(SIGHUP, &ctl_c_handler, NULL) == -1)
> -    vtpmlogerror(VTPM_LOG_VTPM, "Could not install SIGHUP handler. Ctl+break will not stop manager gently.\n");
> -
> -  sigset_t sig_mask;
> -  sigemptyset(&sig_mask);
> -  sigaddset(&sig_mask, SIGPIPE);
> -  sigprocmask(SIG_BLOCK, &sig_mask, NULL);
> -
> -  // ------------------- Set up file ipc structures ----------
> -#ifdef DUMMY_BACKEND
> -  if ( (vtpm_ipc_init(&tx_dummy_ipc_h, VTPM_DUMMY_TX_BE_FNAME, O_RDWR, TRUE) != 0) ||
> -       (vtpm_ipc_init(&rx_dummy_ipc_h, VTPM_DUMMY_RX_BE_FNAME, O_RDWR, TRUE) != 0) ) {
> -
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to create Dummy BE FIFOs.\n");
> -    exit(-1);
> -  }
> -
> -  tx_be_ipc_h = &tx_dummy_ipc_h;
> -  rx_be_ipc_h = &rx_dummy_ipc_h;
> -#else
> -  vtpm_ipc_init(&real_be_ipc_h, VTPM_BE_FNAME, O_RDWR, FALSE);
> -
> -  tx_be_ipc_h = &real_be_ipc_h;
> -  rx_be_ipc_h = &real_be_ipc_h;
> -#endif
> -
> -  if ( (vtpm_ipc_init(&rx_tpm_ipc_h, VTPM_RX_TPM_FNAME, O_RDONLY, TRUE) != 0) ||
> -       (vtpm_ipc_init(&rx_vtpm_ipc_h, VTPM_RX_VTPM_FNAME, O_RDWR, TRUE) != 0) || //FIXME: O_RDONLY?
> -       (vtpm_ipc_init(&tx_hp_ipc_h,  VTPM_TX_HP_FNAME, O_RDWR, TRUE) != 0)    ||
> -       (vtpm_ipc_init(&rx_hp_ipc_h,  VTPM_RX_HP_FNAME, O_RDWR, TRUE) != 0) ) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to create initial FIFOs.\n");
> -    exit(-1);
> -  }
> -
> -  g_rx_tpm_ipc_h = &rx_tpm_ipc_h;
> -
> -  // -------------------- Set up thread params -------------
> -
> -  be_thread_params.tx_ipc_h = tx_be_ipc_h;
> -  be_thread_params.rx_ipc_h = rx_be_ipc_h;
> -  be_thread_params.fw_tpm = TRUE;
> -  be_thread_params.fw_tx_ipc_h = NULL;
> -  be_thread_params.fw_rx_ipc_h = &rx_tpm_ipc_h;
> -  be_thread_params.is_priv = FALSE;
> -  be_thread_params.thread_name = "Backend Listener";
> -
> -  dmi_thread_params.tx_ipc_h = NULL;
> -  dmi_thread_params.rx_ipc_h = &rx_vtpm_ipc_h;
> -  dmi_thread_params.fw_tpm = FALSE;
> -  dmi_thread_params.fw_tx_ipc_h = NULL;
> -  dmi_thread_params.fw_rx_ipc_h = NULL;
> -  dmi_thread_params.is_priv = FALSE;
> -  dmi_thread_params.thread_name = "VTPM Listener";
> -
> -  hp_thread_params.tx_ipc_h = &tx_hp_ipc_h;
> -  hp_thread_params.rx_ipc_h = &rx_hp_ipc_h;
> -  hp_thread_params.fw_tpm = FALSE;
> -  hp_thread_params.fw_tx_ipc_h = NULL;
> -  hp_thread_params.fw_rx_ipc_h = NULL;
> -  hp_thread_params.is_priv = TRUE;
> -  hp_thread_params.thread_name = "Hotplug Listener";
> -
> -  // --------------------- Launch Threads -----------------
> -
> -  vtpm_lock_init();
> -
> -  vtpm_globals->master_pid = pthread_self();
> -
> -  if (pthread_create(&be_thread, NULL, vtpm_manager_thread, &be_thread_params) != 0) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch BE Thread.\n");
> -    exit(-1);
> -  }
> -
> -  if (pthread_create(&dmi_thread, NULL, vtpm_manager_thread, &dmi_thread_params) != 0) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch DMI Thread.\n");
> -    exit(-1);
> -  }
> -
> -
> -  if (pthread_create(&hp_thread, NULL, vtpm_manager_thread, &hp_thread_params) != 0) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Failed to launch HP Thread.\n");
> -    exit(-1);
> -  }
> -
> -  //Join the other threads until exit time.
> -  pthread_join(be_thread, NULL);
> -  pthread_join(dmi_thread, NULL);
> -  pthread_join(hp_thread, NULL);
> -
> -  vtpmlogerror(VTPM_LOG_VTPM, "VTPM Manager shut down unexpectedly.\n");
> -
> -  VTPM_Stop_Manager();
> -  vtpm_lock_destroy();
> -  return 0;
> -}
> diff --git a/tools/vtpm_manager/manager/vtpmpriv.h b/tools/vtpm_manager/manager/vtpmpriv.h
> deleted file mode 100644
> index 41e8d2d..0000000
> --- a/tools/vtpm_manager/manager/vtpmpriv.h
> +++ /dev/null
> @@ -1,186 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpmpriv.h
> -//
> -//  Structures and functions private to the manager
> -//
> -// ==================================================================
> -
> -#ifndef __VTPMPRIV_H__
> -#define __VTPMPRIV_H__
> -
> -#include "vtpm_manager.h"
> -#include "tcg.h"
> -#include "tcs.h"
> -#include "buffer.h"
> -#include "crypto.h"
> -#include "vtpm_ipc.h"
> -
> -#define VTPM_MANAGER_GEN   2     // This is incremented when the manager's table
> -                                 // is changed. It's used for backwards compatability
> -
> -#define STATE_FILE         "/var/vtpm/VTPM"
> -#define DMI_NVM_FILE       "/var/vtpm/vtpm_dm_%d.data"
> -#define VTPM_CTL_DM        0
> -
> -// ------------------------ Private Structures -----------------------
> -typedef struct VTPM_DMI_RESOURCE_T {
> -  // I/O info for Manager to talk to DMI's and controllers
> -  vtpm_ipc_handle_t      *tx_vtpm_ipc_h;    // TX VTPM Results to DMI
> -  vtpm_ipc_handle_t      *rx_vtpm_ipc_h;    // RX VTPM Commands from DMI
> -  vtpm_ipc_handle_t      *tx_tpm_ipc_h;     // TX TPM Commands to DMI
> -  vtpm_ipc_handle_t      *rx_tpm_ipc_h;     // RX TPM Results from DMI
> -
> -#ifndef VTPM_MULTI_VM
> -  pid_t                 dmi_pid;
> -#endif
> -
> -  // Non-persistent Information
> -  bool                  connected;
> -  UINT32                dmi_domain_id;
> -  TCS_CONTEXT_HANDLE    TCSContext;     // TCS Handle
> -  char                  *NVMLocation;   // NULL term string indicating location
> -                                        // of NVM.
> -  // Persistent Information about DMI
> -  UINT32                dmi_id;
> -  BYTE                  dmi_type;
> -  TPM_DIGEST            NVM_measurement;  // Equal to the SHA1 of the blob
> -  TPM_DIGEST            DMI_measurement;  // Correct measurement of the owning DMI
> -} VTPM_DMI_RESOURCE;
> -
> -typedef struct tdVTPM_MIGKEY_LIST {
> -  UINT32                name_size;
> -  BYTE                  *name; // Name of destination (IP addr, domain name, etc)
> -  CRYPTO_INFO           key;
> -  struct tdVTPM_MIGKEY_LIST *next;
> -} VTPM_MIGKEY_LIST;
> -
> -
> -typedef struct tdVTPM_GLOBALS {
> -  // Non-persistent data
> -#ifndef VTPM_MULTI_VM
> -  pid_t               master_pid;
> -#endif
> -
> -  int                 connected_dmis;     // To close guest_rx when no dmis are connected
> -
> -  struct hashtable    *dmi_map;               // Table of all DMI's known indexed by persistent instance #
> -  VTPM_MIGKEY_LIST    *mig_keys;              // Table of migration keys
> -                      // Currently keys are loaded at migration time,
> -                      // TODO: Make VTPM man store a keys persistently
> -                      //       and update script to check if key is needed
> -                      //       before fetching it.
> -
> -  TCS_CONTEXT_HANDLE  manager_tcs_handle;     // TCS Handle used by manager
> -  TPM_HANDLE          storageKeyHandle;       // Key used by persistent store
> -  CRYPTO_INFO         storageKey;             // For software encryption
> -  CRYPTO_INFO         bootKey;                // For saving table
> -  TCS_AUTH            keyAuth;                // OIAP session for storageKey
> -
> -  // Persistent Data
> -  TPM_AUTHDATA        owner_usage_auth;       // OwnerAuth of real TPM
> -  buffer_t            storageKeyWrap;         // Wrapped copy of storageKey
> -  TPM_AUTHDATA        srk_usage_auth;
> -  TPM_AUTHDATA        storage_key_usage_auth;
> -
> -  buffer_t            bootKeyWrap;            // Wrapped copy of boot key
> -
> -}VTPM_GLOBALS;
> -
> -// --------------------------- Global Values --------------------------
> -extern VTPM_GLOBALS *vtpm_globals;   // Key info and DMI states
> -extern const TPM_AUTHDATA SRK_AUTH;  // SRK Well Known Auth Value
> -
> -// ********************** VTPM Functions *************************
> -TPM_RESULT VTPM_Init_Manager(); // Start VTPM Service
> -void VTPM_Stop_Manager();  // Stop VTPM Service
> -TPM_RESULT VTPM_Manager_Handler(vtpm_ipc_handle_t *tx_ipc_h,
> -                                vtpm_ipc_handle_t *rx_ipc_h,
> -                                BOOL fw_tpm,   // Should forward TPM cmds
> -                                vtpm_ipc_handle_t *fw_tx_ipc_h,
> -                                vtpm_ipc_handle_t *fw_rx_ipc_h,
> -                                BOOL is_priv,
> -                                char *client_name);
> -
> -// ********************** Command Handler Prototypes ***********************
> -
> -TPM_RESULT VTPM_Handle_Load_NVM(       VTPM_DMI_RESOURCE *myDMI,
> -                                        const buffer_t *inbuf,
> -                                        buffer_t *outbuf);
> -
> -TPM_RESULT VTPM_Handle_Save_NVM(       VTPM_DMI_RESOURCE *myDMI,
> -                                        const buffer_t *inbuf,
> -                                        buffer_t *outbuf);
> -
> -TPM_RESULT VTPM_Handle_TPM_Command(    VTPM_DMI_RESOURCE *dmi,
> -                                        buffer_t *inbuf,
> -                                        buffer_t *outbuf);
> -
> -TPM_RESULT VTPM_Handle_New_DMI(const buffer_t *param_buf);
> -
> -TPM_RESULT VTPM_Handle_Close_DMI(const buffer_t *param_buf);
> -
> -TPM_RESULT VTPM_Handle_Delete_DMI(const buffer_t *param_buf);
> -
> -TPM_RESULT VTPM_Handle_Migrate_In( const buffer_t *param_buf,
> -                                   buffer_t *result_buf);
> -
> -TPM_RESULT VTPM_Handle_Migrate_Out ( const buffer_t *param_buf,
> -                                     buffer_t *result_buf);
> -
> -TPM_RESULT VTPM_Handle_Get_Migration_key( const buffer_t *param_buf,
> -                                          buffer_t *result_buf);
> -
> -TPM_RESULT VTPM_SaveManagerData(void);
> -TPM_RESULT VTPM_LoadManagerData(void);
> -
> -TPM_RESULT VTPM_New_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res, BYTE vm_type, BYTE startup_mode);
> -
> -TPM_RESULT VTPM_Close_DMI_Extra(VTPM_DMI_RESOURCE *dmi_res);
> -
> -// Helper functions
> -TPM_RESULT close_dmi(VTPM_DMI_RESOURCE *dmi_res);
> -TPM_RESULT init_dmi(UINT32 dmi_id, BYTE type,  VTPM_DMI_RESOURCE **dmi_res);
> -
> -TPM_RESULT envelope_encrypt(const buffer_t     *inbuf,
> -                             CRYPTO_INFO        *asymkey,
> -                             buffer_t           *sealed_data);
> -
> -TPM_RESULT envelope_decrypt(const buffer_t     *cipher,
> -                            TCS_CONTEXT_HANDLE TCSContext,
> -                            TPM_HANDLE         keyHandle,
> -                            const TPM_AUTHDATA *key_usage_auth,
> -                            buffer_t           *unsealed_data);
> -
> -#endif // __VTPMPRIV_H__
> diff --git a/tools/vtpm_manager/manager/vtsp.c b/tools/vtpm_manager/manager/vtsp.c
> deleted file mode 100644
> index fc8a66f..0000000
> --- a/tools/vtpm_manager/manager/vtsp.c
> +++ /dev/null
> @@ -1,1042 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtsp.c
> -//
> -//  Higher level interface to TCS for use in service.
> -//
> -// ==================================================================
> -
> -#include <string.h>
> -#include "tcg.h"
> -#include "tcs.h"
> -#include "bsg.h"
> -#include "log.h"
> -#include "crypto.h"
> -#include "vtsp.h"
> -#include "buffer.h"
> -
> -#define  RSA_KEY_SIZE 0x0800
> -
> -/***********************************************************************************
> - * GenerateAuth: Generate authorization info to be sent back to application
> - *
> - * Parameters: outParamDigestText  The concatenation of output parameters to be SHA1ed
> - *    outParamDigestTextSize Size of inParamDigestText
> - *    HMACkey     Key to be used for HMACing
> - *          For OIAP use key.authUsage or PersistStore.ownerAuth
> - *          For OSAP use shared secret
> - *    pAuth     Authorization information from the application
> - *
> - * Return:  TPM_SUCCESS   Authorization data created
> - *    TPM_AUTHFAIL   Invalid (NULL) HMACkey presented for OSAP
> - *************************************************************************************/
> -TPM_RESULT GenerateAuth( /*[IN]*/ const BYTE *inParamDigestText,
> -                        /*[IN]*/ UINT32 inParamDigestTextSize,
> -                        /*[IN]*/ const TPM_SECRET *HMACkey,
> -                        /*[IN,OUT]*/ TCS_AUTH *auth) {
> -
> -  if (inParamDigestText == NULL || auth == NULL)
> -    return (TPM_AUTHFAIL);
> -  else {
> -
> -    //Generate new OddNonce
> -    Crypto_GetRandom(auth->NonceOdd.nonce, sizeof(TPM_NONCE));
> -
> -    // Create SHA1 inParamDigest
> -    TPM_DIGEST inParamDigest;
> -    Crypto_SHA1Full(inParamDigestText, inParamDigestTextSize, (BYTE *) &inParamDigest);
> -
> -    // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
> -    BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
> -
> -    BSG_PackList(   hmacText, 4,
> -                   BSG_TPM_DIGEST, &inParamDigest,
> -                   BSG_TPM_NONCE, &(auth->NonceEven),
> -                   BSG_TPM_NONCE, &(auth->NonceOdd),
> -                   BSG_TYPE_BOOL, &(auth->fContinueAuthSession) );
> -
> -    Crypto_HMAC((BYTE *) hmacText, sizeof(hmacText), (BYTE *) HMACkey, sizeof(TPM_DIGEST), (BYTE *) &(auth->HMAC));
> -
> -    return(TPM_SUCCESS);
> -
> -  }
> -}
> -
> -/***********************************************************************************
> - * VerifyAuth: Verify the authdata for a command requiring authorization
> - *
> - * Parameters: inParamDigestText  The concatenation of parameters to be SHA1ed
> - *    inParamDigestTextSize Size of inParamDigestText
> - *    authDataUsage   AuthDataUsage for the Entity being used
> - *          Key->authDataUsage or TPM_AUTH_OWNER
> - *    HMACkey     Key to be used for HMACing
> - *          For OIAP use key.authUsage or PersistStore.ownerAuth
> - *          For OSAP use NULL (It will be aquired from the Auth Session)
> - *          If unknown (default), assume OIAP
> - *    sessionAuth    A TCS_AUTH info for the session
> - *    pAuth     Authorization information from the application
> - *              hContext        If specified, on failed Auth, VerifyAuth will
> - *                                      generate a new OIAP session in place of themselves
> - *                                      destroyed session.
> - *
> - * Return:  TPM_SUCCESS   Authorization Verified
> - *    TPM_AUTHFAIL   Authorization Failed
> - *    TPM_FAIL    Failure during SHA1 routines
> - *************************************************************************************/
> -TPM_RESULT VerifyAuth( /*[IN]*/ const BYTE *outParamDigestText,
> -                      /*[IN]*/ UINT32 outParamDigestTextSize,
> -                      /*[IN]*/ const TPM_SECRET *HMACkey,
> -                      /*[IN,OUT]*/ TCS_AUTH *auth,
> -                      /*[IN]*/  TCS_CONTEXT_HANDLE hContext) {
> -  if (outParamDigestText == NULL || auth == NULL)
> -    return (TPM_AUTHFAIL);
> -
> -
> -  // Create SHA1 inParamDigest
> -  TPM_DIGEST outParamDigest;
> -  Crypto_SHA1Full(outParamDigestText, outParamDigestTextSize, (BYTE *) &outParamDigest);
> -
> -  // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
> -  TPM_DIGEST hm;
> -  BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
> -
> -  BSG_PackList(   hmacText, 4,
> -                 BSG_TPM_DIGEST, &outParamDigest,
> -                 BSG_TPM_NONCE, &(auth->NonceEven),
> -                 BSG_TPM_NONCE, &(auth->NonceOdd),
> -                 BSG_TYPE_BOOL, &(auth->fContinueAuthSession) );
> -
> -  Crypto_HMAC((BYTE *) hmacText, sizeof(hmacText),
> -             (BYTE *) HMACkey, sizeof(TPM_DIGEST), (BYTE *) &hm);
> -
> -  // Compare correct HMAC with provided one.
> -  if (memcmp (&hm, &(auth->HMAC), sizeof(TPM_DIGEST)) == 0) { // 0 indicates equality
> -    if (!auth->fContinueAuthSession)
> -      vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM by fContinue=0.\n", auth->AuthHandle);
> -
> -    return (TPM_SUCCESS);
> -  } else {
> -    // If specified, reconnect the OIAP session.
> -    // NOTE: This only works for TCS's that never have a 0 context.
> -    if (hContext) {
> -      vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM due to failure.\n", auth->AuthHandle);
> -      VTSP_OIAP( hContext, auth);
> -    }
> -    return (TPM_AUTHFAIL);
> -  }
> -}
> -
> -TPM_RESULT VTSP_OIAP(const TCS_CONTEXT_HANDLE hContext,
> -                    TCS_AUTH *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "OIAP.\n");
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPMTRYRETURN( TCSP_OIAP(hContext,
> -                         &auth->AuthHandle,
> -                         &auth->NonceEven) );
> -
> -  memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
> -  auth->fContinueAuthSession = FALSE;
> -
> -  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x opened by TPM_OIAP.\n", auth->AuthHandle);
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_OSAP(const TCS_CONTEXT_HANDLE hContext,
> -                    const TPM_ENTITY_TYPE entityType,
> -                    const UINT32 entityValue,
> -                    const TPM_AUTHDATA *usageAuth,
> -                    TPM_SECRET *sharedSecret,
> -                    TCS_AUTH *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "OSAP.\n");
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_NONCE nonceEvenOSAP, nonceOddOSAP;
> -
> -  Crypto_GetRandom((BYTE *) &nonceOddOSAP, sizeof(TPM_NONCE) );
> -
> -  TPMTRYRETURN( TCSP_OSAP(    hContext,
> -                             entityType,
> -                             entityValue,
> -                             nonceOddOSAP,
> -                             &auth->AuthHandle,
> -                             &auth->NonceEven,
> -                             &nonceEvenOSAP) );
> -
> -  // Calculating Session Secret
> -  BYTE sharedSecretText[TPM_DIGEST_SIZE * 2];
> -
> -  BSG_PackList(  sharedSecretText, 2,
> -                BSG_TPM_NONCE, &nonceEvenOSAP,
> -                BSG_TPM_NONCE, &nonceOddOSAP);
> -
> -  Crypto_HMAC(sharedSecretText, sizeof(sharedSecretText), (BYTE *) usageAuth, TPM_DIGEST_SIZE, (BYTE *) sharedSecret);
> -
> -  memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
> -  auth->fContinueAuthSession = FALSE;
> -
> -  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x opened by TPM_OSAP.\n", auth->AuthHandle);
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTSP_TerminateHandle(const TCS_CONTEXT_HANDLE hContext,
> -                                const TCS_AUTH *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Terminate Handle.\n");
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPMTRYRETURN( TCSP_TerminateHandle(hContext, auth->AuthHandle) );
> -
> -  vtpmloginfo(VTPM_LOG_VTSP_DEEP, "Auth Session: 0x%x closed by TPM_TerminateHandle.\n", auth->AuthHandle);
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTSP_ReadPubek(   const TCS_CONTEXT_HANDLE hContext,
> -                             CRYPTO_INFO *crypto_info) {
> -
> -  TPM_RESULT status;
> -  TPM_NONCE antiReplay;
> -  TPM_DIGEST   checksum;
> -  BYTE *pubEKtext;
> -  UINT32 pubEKtextsize;
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Reading Public EK.\n");
> -
> -  // GenerateAuth new nonceOdd
> -  Crypto_GetRandom(&antiReplay, sizeof(TPM_NONCE) );
> -
> -
> -  TPMTRYRETURN( TCSP_ReadPubek(  hContext,
> -                                antiReplay,
> -                                &pubEKtextsize,
> -                                &pubEKtext,
> -                                &checksum) );
> -
> -
> -  // Extract the remaining output parameters
> -  TPM_PUBKEY pubEK;
> -
> -  BSG_Unpack(BSG_TPM_PUBKEY, pubEKtext, (BYTE *) &pubEK);
> -
> -  // Build CryptoInfo for the bindingKey
> -  TPM_RSA_KEY_PARMS rsaKeyParms;
> -
> -  BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
> -            pubEK.algorithmParms.parms,
> -            &rsaKeyParms);
> -
> -  Crypto_RSABuildCryptoInfoPublic(rsaKeyParms.exponentSize,
> -                                 rsaKeyParms.exponent,
> -                                 pubEK.pubKey.keyLength,
> -                                 pubEK.pubKey.key,
> -                                 crypto_info);
> -
> -  // Destroy rsaKeyParms
> -  BSG_Destroy(BSG_TPM_RSA_KEY_PARMS, &rsaKeyParms);
> -
> -  // Set encryption scheme
> -  crypto_info->encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
> -  //crypto_info->encScheme = pubEK.algorithmParms.encScheme;
> -  crypto_info->algorithmID = pubEK.algorithmParms.algorithmID;
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_TakeOwnership(   const TCS_CONTEXT_HANDLE hContext,
> -                                 const TPM_AUTHDATA *ownerAuth,
> -                                 const TPM_AUTHDATA *srkAuth,
> -                                 CRYPTO_INFO *ek_cryptoInfo,
> -                                 TCS_AUTH *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Taking Ownership of TPM.\n");
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_TakeOwnership;
> -  TPM_PROTOCOL_ID proto_id = TPM_PID_OWNER;
> -  BYTE *new_srk;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // vars for srkpubkey parameter
> -  TPM_KEY srkPub;
> -  TPM_KEY_PARMS srkKeyInfo = {TPM_ALG_RSA, TPM_ES_RSAESOAEP_SHA1_MGF1, TPM_SS_NONE, 12, 0};
> -  BYTE srkRSAkeyInfo[12] = { 0x00, 0x00, (RSA_KEY_SIZE >> 8), 0x00,   0x00, 0x00, 0x00, 0x02,   0x00, 0x00, 0x00, 0x00};
> -  srkKeyInfo.parms = (BYTE *) &srkRSAkeyInfo;
> -
> -  struct pack_buf_t srkText;
> -
> -  //These values are accurate for an enc(AuthData).
> -  struct pack_buf_t encOwnerAuth, encSrkAuth;
> -
> -  encOwnerAuth.data = (BYTE *)malloc(sizeof(BYTE) * 256);
> -  encSrkAuth.data = (BYTE *)malloc(sizeof(BYTE) * 256);
> -
> -  if (encOwnerAuth.data == NULL || encSrkAuth.data == NULL) {
> -    vtpmloginfo(VTPM_LOG_VTSP, "Could not malloc encrypted auths.\n");
> -    status = TPM_RESOURCES;
> -    goto abort_egress;
> -  }
> -
> -  Crypto_RSAEnc(ek_cryptoInfo, sizeof(TPM_SECRET), (BYTE *) ownerAuth, &encOwnerAuth.size, encOwnerAuth.data);
> -  Crypto_RSAEnc(ek_cryptoInfo, sizeof(TPM_SECRET), (BYTE *) srkAuth, &encSrkAuth.size, encSrkAuth.data);
> -
> -
> -  // Build srk public key struct
> -  srkPub.ver = TPM_STRUCT_VER_1_1;
> -  srkPub.keyUsage = TPM_KEY_STORAGE;
> -  srkPub.keyFlags = 0x00;
> -  srkPub.authDataUsage = TPM_AUTH_ALWAYS;
> -  memcpy(&srkPub.algorithmParms, &srkKeyInfo, sizeof(TPM_KEY_PARMS));
> -  srkPub.PCRInfoSize = 0;
> -  srkPub.PCRInfo = 0;
> -  srkPub.pubKey.keyLength= 0;
> -  srkPub.encDataSize = 0;
> -
> -  srkText.data = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -  srkText.size = BSG_Pack(BSG_TPM_KEY, (BYTE *) &srkPub, srkText.data);
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 5,
> -                              BSG_TPM_COMMAND_CODE,&command,
> -                              BSG_TPM_PROTOCOL_ID, &proto_id,
> -                              BSG_TPM_SIZE32_DATA, &encOwnerAuth,
> -                              BSG_TPM_SIZE32_DATA, &encSrkAuth,
> -                              BSG_TPM_KEY, &srkPub);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize, ownerAuth, auth) );
> -
> -  new_srk = srkText.data;
> -  TPMTRYRETURN( TCSP_TakeOwnership ( hContext,
> -                                    proto_id,
> -                                    encOwnerAuth.size,
> -                                    encOwnerAuth.data,
> -                                    encSrkAuth.size,
> -                                    encSrkAuth.data,
> -                                    &srkText.size,
> -                                    &new_srk,
> -                                    auth ) );
> -
> -
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                              BSG_TPM_RESULT, &status,
> -                              BSG_TPM_COMMAND_CODE, &command);
> -  memcpy(paramText + paramTextSize, new_srk, srkText.size);
> -  paramTextSize += srkText.size;
> -
> -
> -  TPMTRYRETURN( VerifyAuth(  paramText, paramTextSize,
> -                            ownerAuth, auth,
> -                            hContext) );
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  free(srkText.data);
> -  free(encSrkAuth.data);
> -  free(encOwnerAuth.data);
> -  free(paramText);
> -
> -  TCS_FreeMemory(hContext, new_srk);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_DisablePubekRead( const TCS_CONTEXT_HANDLE    hContext,
> -                                  const TPM_AUTHDATA          *ownerAuth,
> -                                  TCS_AUTH                    *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Disabling Pubek Read.\n");
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_DisablePubekRead;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 1,
> -                              BSG_TPM_COMMAND_CODE, &command);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                             ownerAuth, auth) );
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_DisablePubekRead ( hContext, // in
> -                                        auth) );
> -
> -  // Verify Auth
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                              BSG_TPM_RESULT, &status,
> -                              BSG_TPM_COMMAND_CODE, &command);
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                           ownerAuth, auth,
> -                           hContext) );
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -  free(paramText);
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_CreateWrapKey(  const TCS_CONTEXT_HANDLE hContext,
> -                                const TPM_KEY_USAGE      usage,
> -                                const TPM_AUTHDATA       *newKeyAuth,
> -                                const TCS_KEY_HANDLE     parentHandle,
> -                                const TPM_AUTHDATA       *osapSharedSecret,
> -                                buffer_t                 *pubKeyBuf,
> -                                TCS_AUTH                 *auth) {
> -
> -  int i;
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_CreateWrapKey;
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Creating new key of type %d.\n", usage);
> -
> -  // vars for Calculate encUsageAuth
> -  BYTE *paramText;
> -  UINT32 paramTextSize;
> -
> -  // vars for Calculate encUsageAuth
> -  BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
> -  TPM_DIGEST XORKey1;
> -  UINT32 XORbufferSize;
> -  TPM_SECRET encUsageAuth, encMigrationAuth;
> -
> -  // vars for Flatten newKey prototype
> -  BYTE *flatKey = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -  UINT32 flatKeySize = TCPA_MAX_BUFFER_LENGTH;
> -  struct pack_buf_t newKeyText;
> -
> -  // Fill in newKey
> -  TPM_KEY newKey;
> -
> -  BYTE RSAkeyInfo[12] = { 0x00, 0x00, (RSA_KEY_SIZE >> 8), 0x00,   0x00, 0x00, 0x00, 0x02,   0x00, 0x00, 0x00, 0x00};
> -  newKey.algorithmParms.algorithmID = TPM_ALG_RSA;
> -  newKey.algorithmParms.parms = (BYTE *) &RSAkeyInfo;
> -  newKey.algorithmParms.parmSize = 12;
> -
> -  switch (usage) {
> -  case TPM_KEY_SIGNING:
> -    vtpmloginfo(VTPM_LOG_VTSP, "Creating Signing Key...\n");
> -    newKey.keyUsage = TPM_KEY_SIGNING;
> -    newKey.algorithmParms.encScheme = TPM_ES_NONE;
> -    newKey.algorithmParms.sigScheme = TPM_SS_RSASSAPKCS1v15_SHA1;
> -    break;
> -  case TPM_KEY_STORAGE:
> -    vtpmloginfo(VTPM_LOG_VTSP, "Creating Storage Key...\n");
> -    newKey.keyUsage = TPM_KEY_STORAGE;
> -    newKey.algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
> -    newKey.algorithmParms.sigScheme = TPM_SS_NONE;
> -    break;
> -  case TPM_KEY_BIND:
> -    vtpmloginfo(VTPM_LOG_VTSP, "Creating Binding Key...\n");
> -    newKey.keyUsage = TPM_KEY_BIND;
> -    newKey.algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
> -    newKey.algorithmParms.sigScheme = TPM_SS_NONE;
> -    break;
> -  default:
> -    vtpmloginfo(VTPM_LOG_VTSP, "Cannot create key. Invalid Key Type.\n");
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -
> -  newKey.ver = TPM_STRUCT_VER_1_1;
> -
> -  newKey.keyFlags = 0;
> -  newKey.authDataUsage = TPM_AUTH_ALWAYS;
> -  newKey.pubKey.keyLength= 0;
> -  newKey.encDataSize = 0;
> -  newKey.encData = NULL;
> -
> -  // FIXME: Support PCR bindings
> -  newKey.PCRInfoSize = 0;
> -  newKey.PCRInfo = NULL;
> -
> -  // Calculate encUsageAuth
> -  XORbufferSize = BSG_PackList(  XORbuffer, 2,
> -                                BSG_TPM_SECRET, osapSharedSecret,
> -                                BSG_TPM_NONCE, &auth->NonceEven);
> -  Crypto_SHA1Full(XORbuffer, XORbufferSize, (BYTE *) &XORKey1);
> -
> -  // FIXME: No support for migratable keys.
> -  for (i=0; i < TPM_DIGEST_SIZE; i++)
> -    ((BYTE *) &encUsageAuth)[i] = ((BYTE *) &XORKey1)[i] ^ ((BYTE *) newKeyAuth)[i];
> -
> -  // Flatten newKey prototype
> -  flatKeySize = BSG_Pack(BSG_TPM_KEY, (BYTE *) &newKey, flatKey);
> -  newKeyText.data = flatKey;
> -  newKeyText.size = flatKeySize;
> -
> -  // Generate HMAC
> -  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 3,
> -                              BSG_TPM_COMMAND_CODE, &command,
> -                              BSG_TPM_AUTHDATA, &encUsageAuth,
> -                              BSG_TPM_AUTHDATA, &encMigrationAuth);
> -  memcpy(paramText + paramTextSize, newKeyText.data, newKeyText.size);
> -  paramTextSize += newKeyText.size;
> -
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                             osapSharedSecret, auth) );
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_CreateWrapKey(  hContext,
> -                                    parentHandle,
> -                                    encUsageAuth,
> -                                    encMigrationAuth,
> -                                    &newKeyText.size,
> -                                    &newKeyText.data,
> -                                    auth) );
> -
> -  // Verify Auth
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                              BSG_TPM_RESULT, &status,
> -                              BSG_TPM_COMMAND_CODE, &command);
> -  memcpy(paramText + paramTextSize, newKeyText.data, newKeyText.size);
> -  paramTextSize += newKeyText.size;
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                           osapSharedSecret, auth, 0) );
> -
> -  // Unpack/return key structure
> -  TPMTRYRETURN(buffer_init(pubKeyBuf, 0, 0) );
> -  TPMTRYRETURN(buffer_append_raw(pubKeyBuf, newKeyText.size, newKeyText.data) );
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  free(flatKey);
> -  free(paramText);
> -  TCS_FreeMemory(hContext, newKeyText.data);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_LoadKey(const TCS_CONTEXT_HANDLE    hContext,
> -                        const TCS_KEY_HANDLE        hUnwrappingKey,
> -                        const buffer_t              *rgbWrappedKeyBlob,
> -                        const TPM_AUTHDATA          *parentAuth,
> -                        TPM_HANDLE                  *newKeyHandle,
> -                        TCS_AUTH                    *auth,
> -                        CRYPTO_INFO                 *cryptoinfo,
> -                        const BOOL                  skipTPMLoad) {
> -
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Loading Key %s.\n", (!skipTPMLoad ? "into TPM" : "only into memory"));
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_LoadKey;
> -
> -  BYTE *paramText=NULL;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // SkipTPMLoad stops key from being loaded into TPM, but still generates CRYPTO_INFO for it
> -  if (! skipTPMLoad) {
> -
> -    if ((rgbWrappedKeyBlob == NULL) || (parentAuth == NULL) ||
> -        (newKeyHandle==NULL) || (auth==NULL)) {
> -      status = TPM_BAD_PARAMETER;
> -      goto abort_egress;
> -    }
> -
> -    // Generate Extra TCS Parameters
> -    TPM_HANDLE phKeyHMAC;
> -
> -    paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -
> -    paramTextSize = BSG_PackList(paramText, 1,
> -                                BSG_TPM_COMMAND_CODE, &command);
> -
> -    memcpy(paramText + paramTextSize, rgbWrappedKeyBlob->bytes, buffer_len(rgbWrappedKeyBlob));
> -    paramTextSize += buffer_len(rgbWrappedKeyBlob);
> -
> -    TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                             parentAuth, auth) );
> -
> -    // Call TCS
> -    TPMTRYRETURN( TCSP_LoadKeyByBlob(  hContext,
> -                                      hUnwrappingKey,
> -                                      buffer_len(rgbWrappedKeyBlob),
> -                                      rgbWrappedKeyBlob->bytes,
> -                                      auth,
> -                                      newKeyHandle,
> -                                      &phKeyHMAC) );
> -
> -    // Verify Auth
> -    paramTextSize = BSG_PackList(paramText, 3,
> -                                BSG_TPM_RESULT, &status,
> -                                BSG_TPM_COMMAND_CODE, &command,
> -                                BSG_TPM_HANDLE, newKeyHandle);
> -
> -    TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                             parentAuth, auth,
> -                             hContext) );
> -  }
> -
> -  // Build cryptoinfo structure for software crypto function.
> -  if (cryptoinfo != NULL) {
> -    TPM_KEY newKey;
> -
> -    // Unpack/return key structure
> -    BSG_Unpack(BSG_TPM_KEY, rgbWrappedKeyBlob->bytes , &newKey);
> -    TPM_RSA_KEY_PARMS rsaKeyParms;
> -
> -    BSG_Unpack(BSG_TPM_RSA_KEY_PARMS,
> -              newKey.algorithmParms.parms,
> -              &rsaKeyParms);
> -
> -    Crypto_RSABuildCryptoInfoPublic(rsaKeyParms.exponentSize,
> -                                   rsaKeyParms.exponent,
> -                                   newKey.pubKey.keyLength,
> -                                   newKey.pubKey.key,
> -                                   cryptoinfo);
> -
> -    // Destroy rsaKeyParms
> -    BSG_Destroy(BSG_TPM_RSA_KEY_PARMS, &rsaKeyParms);
> -
> -    // Set encryption scheme
> -    cryptoinfo->encScheme = CRYPTO_ES_RSAESOAEP_SHA1_MGF1;
> -  }
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  free(paramText);
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_Unbind( const TCS_CONTEXT_HANDLE    hContext,
> -                        const TPM_KEY_HANDLE        key_handle,
> -                        const buffer_t              *bound_data,
> -                        const TPM_AUTHDATA          *usage_auth,
> -                        buffer_t                    *clear_data,
> -                        TCS_AUTH                    *auth) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Unbinding %d bytes of data.\n", buffer_len(bound_data));
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_UnBind;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // Generate Extra TCS Parameters
> -  struct pack_buf_t clear_data32;
> -  BYTE *clear_data_text;
> -  UINT32 clear_data_size;
> -
> -  struct pack_buf_t bound_data32 = {bound_data->size, bound_data->bytes};
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                              BSG_TPM_COMMAND_CODE, &command,
> -                              BSG_TPM_SIZE32_DATA, &bound_data32);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                             usage_auth, auth) );
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_UnBind( hContext,
> -                            key_handle,
> -                            buffer_len(bound_data),
> -                            bound_data->bytes,
> -                            auth,
> -                            &clear_data_size,
> -                            &clear_data_text) );
> -
> -
> -  // Verify Auth
> -  clear_data32.size = clear_data_size;
> -  clear_data32.data = clear_data_text;
> -  paramTextSize = BSG_PackList(paramText, 3,
> -                              BSG_TPM_RESULT, &status,
> -                              BSG_TPM_COMMAND_CODE, &command,
> -                              BSG_TPM_SIZE32_DATA, &clear_data32);
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                           usage_auth, auth,
> -                           hContext) );
> -
> -  // Unpack/return key structure
> -  TPMTRYRETURN(buffer_init(clear_data, 0, 0));
> -  TPMTRYRETURN(buffer_append_raw (clear_data, clear_data_size, clear_data_text) );
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  free(paramText);
> -  TCS_FreeMemory(hContext, clear_data_text);
> -
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_Bind(   CRYPTO_INFO *cryptoInfo,
> -                       const buffer_t *inData,
> -                       buffer_t *outData)
> -{
> -  vtpmloginfo(VTPM_LOG_VTSP, "Binding %d bytes of data.\n", buffer_len(inData));
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_BOUND_DATA boundData;
> -  UINT32 i;
> -
> -  // Fill boundData's accessory information
> -  boundData.ver = TPM_STRUCT_VER_1_1;
> -  boundData.payload = TPM_PT_BIND;
> -  boundData.payloadData = inData->bytes;
> -
> -  // Pack boundData before encryption
> -  BYTE* flatBoundData = (BYTE *)malloc(sizeof(BYTE) *
> -                                      (sizeof(TPM_VERSION) +
> -                                       sizeof(TPM_PAYLOAD_TYPE) +
> -                                       buffer_len(inData)));
> -  if (flatBoundData == NULL) {
> -    return TPM_NOSPACE;
> -  }
> -  UINT32 flatBoundDataSize = 0;
> -  flatBoundDataSize = BSG_PackList(  flatBoundData, 2,
> -                                    BSG_TPM_VERSION, &boundData.ver,
> -                                    BSG_TYPE_BYTE, &boundData.payload);
> -
> -  memcpy(flatBoundData+flatBoundDataSize, inData->bytes, buffer_len(inData));
> -  flatBoundDataSize += buffer_len(inData);
> -
> -  BYTE out_tmp[RSA_KEY_SIZE/8]; // RSAEnc does not do blocking, So this is what will come out.
> -  UINT32 out_tmp_size;
> -
> -  // Encrypt flatBoundData
> -  TPMTRY(TPM_ENCRYPT_ERROR, Crypto_RSAEnc( cryptoInfo,
> -                                           flatBoundDataSize,
> -                                           flatBoundData,
> -                                           &out_tmp_size,
> -                                           out_tmp) );
> -
> -  if (out_tmp_size > RSA_KEY_SIZE/8) {
> -    // The result of RSAEnc should be a fixed size based on key size.
> -    vtpmlogerror(VTPM_LOG_VTSP, "Enc buffer just overflowed.\n");
> -  }
> -
> -  buffer_init(outData, 0, NULL);
> -  buffer_append_raw(outData, out_tmp_size, out_tmp);
> -
> -  vtpmloginfo(VTPM_LOG_TXDATA, "Bind Generated[%d] = 0x", out_tmp_size);
> -  for(i = 0 ; i < out_tmp_size ; i++) {
> -    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out_tmp[i]);
> -  }
> -  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> -
> -  goto egress;
> -  abort_egress:
> -  egress:
> -
> -  // Free flatBoundData
> -  free(flatBoundData);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -TPM_RESULT VTSP_Seal(const TCS_CONTEXT_HANDLE    hContext,
> -                     const TPM_KEY_HANDLE        keyHandle,
> -                     const TPM_AUTHDATA          *sealDataAuth,
> -                     const TPM_PCR_COMPOSITE     *pcrComp,
> -                     const buffer_t              *inData,
> -                     TPM_STORED_DATA             *sealedData,
> -                     const TPM_SECRET            *osapSharedSecret,
> -                     TCS_AUTH                    *auth) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_Seal;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // Generate PCR_Info Struct from Comp
> -  TPM_PCR_INFO pcrInfo;
> -  UINT32 pcrInfoSize, flatpcrSize;
> -  BYTE flatpcr[3 +                          // PCR_Select = 3 1 byte banks
> -               sizeof(UINT16) +             //              2 byte UINT16
> -               sizeof(UINT32) +             // PCR_Comp   = 4 byte UINT32
> -               24 * sizeof(TPM_PCRVALUE) ]; //              up to 24 PCRs
> -
> -  if (pcrComp != NULL) {
> -      //printf("\n\tBinding to PCRs: ");
> -      //for(int i = 0 ; i < pcrComp->select.sizeOfSelect ; i++)
> -      //printf("%2.2x", pcrComp->select.pcrSelect[i]);
> -
> -      memcpy(&pcrInfo.pcrSelection, &pcrComp->select, sizeof(TPM_PCR_SELECTION));
> -
> -      flatpcrSize = BSG_Pack(BSG_TPM_PCR_COMPOSITE, (BYTE *) pcrComp, flatpcr);
> -      Crypto_SHA1Full((BYTE *) flatpcr, flatpcrSize, (BYTE *) &(pcrInfo.digestAtRelease));
> -      memset(&(pcrInfo.digestAtCreation), 0, sizeof(TPM_DIGEST));
> -      pcrInfoSize = BSG_Pack(BSG_TPM_PCR_INFO, (BYTE *) &pcrInfo, flatpcr);
> -  } else {
> -      //printf("\n\tBinding to no PCRS.");
> -      pcrInfoSize = 0;
> -  }
> -
> -  // Calculate encUsageAuth
> -  BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
> -  UINT32 XORbufferSize = sizeof(XORbuffer);
> -  TPM_DIGEST XORKey;
> -  TPM_ENCAUTH encAuth;
> -
> -  BSG_PackList( XORbuffer, 2,
> -                BSG_TPM_SECRET, osapSharedSecret,
> -                BSG_TPM_NONCE, &auth->NonceEven );
> -
> -  Crypto_SHA1Full(XORbuffer, XORbufferSize, (BYTE *) &XORKey);
> -
> -  int i;
> -  for (i=0; i < TPM_DIGEST_SIZE; i++)
> -    ((BYTE *) &encAuth)[i] = ((BYTE *) &XORKey)[i] ^ ((BYTE *) sealDataAuth)[i];
> -
> -  // Generate Extra TCS Parameters
> -  UINT32 inDataSize = buffer_len(inData);
> -  struct pack_buf_t inData_pack = {inDataSize, inData->bytes};
> -  struct pack_buf_t pcrInfo_pack = {pcrInfoSize, flatpcr};
> -
> -  UINT32 sealedDataSize;
> -  BYTE *flatSealedData=NULL;
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 4,
> -                               BSG_TPM_COMMAND_CODE, &command,
> -                               BSG_TPM_ENCAUTH, &encAuth,
> -                               BSG_TPM_SIZE32_DATA, &pcrInfo_pack,
> -                               BSG_TPM_SIZE32_DATA, &inData_pack);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                              osapSharedSecret, auth) );
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_Seal( hContext,
> -                           keyHandle,
> -                           encAuth,
> -                           pcrInfoSize,
> -                           flatpcr,
> -                           inDataSize,
> -                           inData->bytes,
> -                           auth,
> -                           &sealedDataSize,
> -                           &flatSealedData) );
> -
> -  // Unpack/return key structure
> -  BSG_Unpack( BSG_TPM_STORED_DATA, flatSealedData, sealedData );
> -
> -  paramTextSize = BSG_PackList(paramText, 3,
> -                               BSG_TPM_RESULT, &status,
> -                               BSG_TPM_COMMAND_CODE, &command,
> -                               BSG_TPM_STORED_DATA, sealedData);
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                            osapSharedSecret, auth,
> -                            0) );
> -
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  if (flatSealedData)
> -    TCS_FreeMemory( hContext, flatSealedData);
> -
> -  free(paramText);
> -  return status;
> -}
> -
> -
> -TPM_RESULT VTSP_Unseal(const TCS_CONTEXT_HANDLE    hContext,
> -                       const TPM_KEY_HANDLE        keyHandle,
> -                       const TPM_STORED_DATA       *sealedData,
> -                       const TPM_AUTHDATA          *key_usage_auth,
> -                       const TPM_AUTHDATA          *data_usage_auth,
> -                       buffer_t                    *outData,
> -                       TCS_AUTH                    *auth,
> -                       TCS_AUTH                    *dataAuth) {
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TPM_COMMAND_CODE command = TPM_ORD_Unseal;
> -
> -  BYTE *paramText;        // Digest to make Auth.
> -  UINT32 paramTextSize;
> -
> -  // Generate Extra TCS Parameters
> -  UINT32 sealDataSize, clearDataSize;
> -  BYTE *flatSealedData= (BYTE *) malloc(sizeof(TPM_VERSION) +
> -                                        2 * sizeof(UINT32) +
> -                                        sealedData->sealInfoSize +
> -                                        sealedData->encDataSize),
> -       *clearData=NULL;
> -
> -  sealDataSize = BSG_Pack(BSG_TPM_STORED_DATA, sealedData, flatSealedData );
> -
> -  paramText = (BYTE *) malloc(sizeof(BYTE) *  TCPA_MAX_BUFFER_LENGTH);
> -
> -  paramTextSize = BSG_PackList(paramText, 2,
> -                               BSG_TPM_COMMAND_CODE, &command,
> -                               BSG_TPM_STORED_DATA, sealedData);
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                              key_usage_auth, auth) );
> -
> -  TPMTRYRETURN( GenerateAuth( paramText, paramTextSize,
> -                              data_usage_auth, dataAuth) );
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_Unseal(  hContext,
> -                              keyHandle,
> -                              sealDataSize,
> -                              flatSealedData,
> -                              auth,
> -                              dataAuth,
> -                              &clearDataSize,
> -                              &clearData) );
> -
> -  // Verify Auth
> -  struct pack_buf_t clearData_pack = {clearDataSize, clearData};
> -
> -  paramTextSize = BSG_PackList(paramText, 3,
> -                               BSG_TPM_RESULT, &status,
> -                               BSG_TPM_COMMAND_CODE, &command,
> -                               BSG_TPM_SIZE32_DATA, &clearData_pack);
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                            key_usage_auth, auth,
> -                            hContext) );
> -
> -  TPMTRYRETURN( VerifyAuth( paramText, paramTextSize,
> -                            data_usage_auth, dataAuth,
> -                            hContext) );
> -
> -  // Unpack/return key structure
> -  TPMTRYRETURN( buffer_init(outData, clearDataSize, clearData) );
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  if (flatSealedData)
> -    TCS_FreeMemory( hContext, clearData);
> -
> -  free(paramText);
> -  return status;
> -}
> -
> -TPM_RESULT VTSP_SaveState( const TCS_CONTEXT_HANDLE    hContext) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Calling TPM_SaveState.\n");
> -
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  // Call TCS
> -  return ( TCSP_SaveState ( hContext ) );
> -
> -}
> -
> -
> -// Function Reaches into unsupported TCS command, beware.
> -TPM_RESULT VTSP_RawTransmit(const TCS_CONTEXT_HANDLE    hContext,
> -                            const buffer_t *inbuf,
> -                            buffer_t *outbuf ) {
> -
> -  vtpmloginfo(VTPM_LOG_VTSP, "Passthrough in use.\n");
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  // Generate Extra TCS Parameters
> -  BYTE *resultText = (BYTE *) malloc(sizeof(BYTE) * TCPA_MAX_BUFFER_LENGTH);
> -  UINT32 resultTextSize =  TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Call TCS
> -  TPMTRYRETURN( TCSP_RawTransmitData(buffer_len(inbuf), inbuf->bytes,
> -                                    &resultTextSize, resultText) );
> -
> -  // Unpack/return key structure
> -  TPMTRYRETURN(buffer_init (outbuf, resultTextSize, resultText) );
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -  TCS_FreeMemory(hContext, resultText);
> -  free(resultText);
> -  return status;
> -}
> diff --git a/tools/vtpm_manager/manager/vtsp.h b/tools/vtpm_manager/manager/vtsp.h
> deleted file mode 100644
> index 2fb0440..0000000
> --- a/tools/vtpm_manager/manager/vtsp.h
> +++ /dev/null
> @@ -1,126 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtsp.h
> -//
> -//  Higher level interface to TCS.
> -//
> -// ==================================================================
> -
> -#ifndef __VTSP_H__
> -#define __VTSP_H__
> -
> -#include "tcg.h"
> -#include "tcs.h"
> -
> -#define KEY_BUFFER_SIZE 2048
> -
> -TPM_RESULT VTSP_RawTransmit(const TCS_CONTEXT_HANDLE    hContext,
> -                            const buffer_t *inbuf,
> -                            buffer_t *outbuf );
> -
> -TPM_RESULT VTSP_OIAP(  const TCS_CONTEXT_HANDLE hContext,
> -                       TCS_AUTH *auth);
> -
> -TPM_RESULT VTSP_OSAP(  const TCS_CONTEXT_HANDLE hContext,
> -                       const TPM_ENTITY_TYPE entityType,
> -                       const UINT32 entityValue,
> -                       const TPM_AUTHDATA *usageAuth,
> -                       TPM_SECRET *sharedsecret,
> -                       TCS_AUTH *auth);
> -
> -TPM_RESULT VTSP_TerminateHandle(const TCS_CONTEXT_HANDLE hContext,
> -                                const TCS_AUTH *auth);
> -
> -TPM_RESULT VTSP_ReadPubek(   const TCS_CONTEXT_HANDLE hContext,
> -                             CRYPTO_INFO *cypto_info);
> -
> -TPM_RESULT VTSP_TakeOwnership(   const TCS_CONTEXT_HANDLE hContext,
> -                                 const TPM_AUTHDATA *ownerAuth,
> -                                 const TPM_AUTHDATA *srkAuth,
> -                                 CRYPTO_INFO *ek_cryptoInfo,
> -                                 TCS_AUTH *auth);
> -
> -TPM_RESULT VTSP_DisablePubekRead( const TCS_CONTEXT_HANDLE    hContext,
> -                                  const TPM_AUTHDATA *ownerAuth,
> -                                  TCS_AUTH                    *auth);
> -
> -TPM_RESULT VTSP_CreateWrapKey(  const TCS_CONTEXT_HANDLE hContext,
> -                                const TPM_KEY_USAGE      usage,
> -                                const TPM_AUTHDATA       *newKeyAuth,
> -                                const TCS_KEY_HANDLE     parentHandle,
> -                                const TPM_AUTHDATA       *osapSharedSecret,
> -                                buffer_t                 *pubKeyBuf,
> -                                TCS_AUTH                 *auth);
> -
> -TPM_RESULT VTSP_LoadKey(const TCS_CONTEXT_HANDLE    hContext,
> -                        const TCS_KEY_HANDLE        hUnwrappingKey,
> -                        const buffer_t              *rgbWrappedKeyBlob,
> -                        const TPM_AUTHDATA          *parentAuth,
> -                        TPM_HANDLE                  *newKeyHandle,
> -                        TCS_AUTH                    *pAuth,
> -                        CRYPTO_INFO                 *cryptoinfo,
> -                        const BOOL                  skipTPMLoad);
> -
> -TPM_RESULT VTSP_Unbind( const TCS_CONTEXT_HANDLE    hContext,
> -                        const TPM_KEY_HANDLE        key_handle,
> -                        const buffer_t              *bound_data,
> -                        const TPM_AUTHDATA          *usage_auth,
> -                        buffer_t                    *clear_data,
> -                        TCS_AUTH                    *auth);
> -
> -TPM_RESULT VTSP_Bind(   CRYPTO_INFO *cryptoInfo,
> -            const buffer_t *inData,
> -            buffer_t *outData);
> -
> -TPM_RESULT VTSP_Seal(const TCS_CONTEXT_HANDLE    hContext,
> -                     const TPM_KEY_HANDLE        keyHandle,
> -                     const TPM_AUTHDATA          *sealDataAuth,
> -                     const TPM_PCR_COMPOSITE     *pcrComp,
> -                     const buffer_t              *inData,
> -                     TPM_STORED_DATA             *sealedData,
> -                     const TPM_SECRET            *osapSharedSecret,
> -                     TCS_AUTH                    *auth);
> -
> -TPM_RESULT VTSP_Unseal(const TCS_CONTEXT_HANDLE    hContext,
> -                       const TPM_KEY_HANDLE        keyHandle,
> -                       const TPM_STORED_DATA       *sealedData,
> -                       const TPM_AUTHDATA          *key_usage_auth,
> -                       const TPM_AUTHDATA          *data_usage_auth,
> -                       buffer_t                    *outData,
> -                       TCS_AUTH                    *auth,
> -                       TCS_AUTH                    *dataAuth);
> -
> -TPM_RESULT VTSP_SaveState( const TCS_CONTEXT_HANDLE    hContext);
> -
> -#endif //_VTSP_H_
> diff --git a/tools/vtpm_manager/migration/Makefile b/tools/vtpm_manager/migration/Makefile
> deleted file mode 100644
> index e33ae95..0000000
> --- a/tools/vtpm_manager/migration/Makefile
> +++ /dev/null
> @@ -1,42 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -VPATH = ../manager
> -
> -BIND           = vtpm_migratord
> -BINC           = vtpm_migrator
> -
> -SRCSD    = vtpm_manager_if.c vtpm_migratord.c vtpm_migratord_handler.c vtpm_ipc.c
> -SRCSC    = vtpm_manager_if.c vtpm_migrator_if.c vtpm_migratorc.c vtpm_ipc.c
> -
> -OBJSD    = $(patsubst %.c,%.o,$(SRCSD))
> -OBJSC    = $(patsubst %.c,%.o,$(SRCSC))
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIND) $(BINC)
> -
> -.PHONY: install
> -install: build
> -       $(INSTALL_PROG) $(BIND) $(DESTDIR)$(BINDIR)
> -       $(INSTALL_PROG) $(BINC) $(DESTDIR)$(BINDIR)
> -
> -.PHONY: clean
> -clean:
> -       rm -f $(BINC) $(BIND)
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIND): $(OBJSD)
> -       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
> -
> -$(BINC): $(OBJSC)
> -       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
> -
> -# libraries
> -LIBS += ../util/libTCGUtils.a
> diff --git a/tools/vtpm_manager/migration/vtpm_manager_if.c b/tools/vtpm_manager/migration/vtpm_manager_if.c
> deleted file mode 100644
> index 08986f4..0000000
> --- a/tools/vtpm_manager/migration/vtpm_manager_if.c
> +++ /dev/null
> @@ -1,186 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_manager_if.c
> -//
> -//  Provides functions to call local vtpm manager interface (Hotplug)
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <fcntl.h>
> -#include <malloc.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "vtpm_ipc.h"
> -#include "bsg.h"
> -#include "vtpm_migrator.h"
> -#include "vtpm_manager.h"
> -
> -#define VTPM_TX_HP_FNAME       "/var/vtpm/fifos/from_console.fifo"
> -#define VTPM_RX_HP_FNAME       "/var/vtpm/fifos/to_console.fifo"
> -
> -static vtpm_ipc_handle_t tx_ipc_h, rx_ipc_h;
> -
> -TPM_RESULT vtpm_manager_open(){
> -
> -  if ( (vtpm_ipc_init(&tx_ipc_h,  VTPM_TX_HP_FNAME, O_RDWR, TRUE) != 0) ||  //FIXME: wronly
> -       (vtpm_ipc_init(&rx_ipc_h,  VTPM_RX_HP_FNAME, O_RDWR, TRUE) != 0) ) { //FIXME: rdonly
> -    vtpmlogerror(VTPM_LOG_VTPM, "Unable to connect to vtpm_manager.\n");
> -    return TPM_IOERROR;
> -  }
> -
> -  return TPM_SUCCESS;
> -}
> -
> -void vtpm_manager_close() {
> -
> -  vtpm_ipc_close(&tx_ipc_h);
> -  vtpm_ipc_close(&rx_ipc_h);
> -}
> -
> -
> -TPM_RESULT vtpm_manager_command(TPM_COMMAND_CODE ord,
> -                                buffer_t *command_param_buf,
> -                                TPM_RESULT *cmd_status, /* out */
> -                                buffer_t *result_param_buf) {
> -
> -  TPM_RESULT status = TPM_FAIL;
> -  int  size_read, size_write, i;
> -  BYTE *adj_command, response_header[VTPM_COMMAND_HEADER_SIZE_SRV];
> -  UINT32 dmi_id=0, adj_command_size, out_param_size, adj_param_size;
> -  TPM_TAG tag=VTPM_TAG_REQ;
> -
> -  if ( (!command_param_buf) || (!result_param_buf) || (!cmd_status) ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  adj_command_size = VTPM_COMMAND_HEADER_SIZE_SRV + buffer_len(command_param_buf);
> -  adj_command = (BYTE *) malloc( adj_command_size );
> -  if (!adj_command) {
> -    status = TPM_RESOURCES;
> -    goto abort_egress;
> -  }
> -
> -  out_param_size = VTPM_COMMAND_HEADER_SIZE + buffer_len(command_param_buf);
> -  BSG_PackList(adj_command, 4,
> -                 BSG_TYPE_UINT32, &dmi_id,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &out_param_size,
> -                 BSG_TPM_COMMAND_CODE, &ord );
> -
> -  memcpy(adj_command + VTPM_COMMAND_HEADER_SIZE_SRV, command_param_buf->bytes, buffer_len(command_param_buf));
> -
> -  size_write = vtpm_ipc_write(&tx_ipc_h, NULL, adj_command, adj_command_size);
> -
> -  if (size_write > 0) {
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT (MGR): 0x");
> -    for (i=0; i< adj_command_size; i++) {
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", adj_command[i]);
> -    }
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -  } else {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Error writing VTPM Manager console.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (size_write != (int) adj_command_size )
> -    vtpmlogerror(VTPM_LOG_VTPM, "Could not write entire command to mgr (%d/%d)\n", size_write, adj_command_size);
> -
> -  // Read header for response to manager command
> -  size_read = vtpm_ipc_read(&rx_ipc_h, NULL, response_header, VTPM_COMMAND_HEADER_SIZE_SRV);
> -  if (size_read > 0) {
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV (MGR): 0x");
> -    for (i=0; i<size_read; i++)
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", response_header[i]);
> -
> -  } else {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Error reading from vtpm manager.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE_SRV) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Command from vtpm_manager shorter than std header.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  // Unpack response from DMI for TPM command
> -  BSG_UnpackList(response_header, 4,
> -                 BSG_TYPE_UINT32, &dmi_id,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &out_param_size,
> -                 BSG_TPM_COMMAND_CODE, cmd_status );
> -
> -  // If response has parameters, read them.
> -  // Note that out_param_size is in the client's context
> -  adj_param_size = out_param_size - VTPM_COMMAND_HEADER_SIZE;
> -  if (adj_param_size > 0) {
> -    TPMTRYRETURN( buffer_init( result_param_buf, adj_param_size, NULL) );
> -    size_read = vtpm_ipc_read(&rx_ipc_h, NULL, result_param_buf->bytes, adj_param_size);
> -    if (size_read > 0) {
> -      for (i=0; i< size_read; i++)
> -        vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_param_buf->bytes[i]);
> -
> -    } else {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Error reading from vtpm manager.\n");
> -      goto abort_egress;
> -    }
> -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -
> -    if (size_read < (int)adj_param_size) {
> -      vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -      vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
> -      status = TPM_IOERROR;
> -      goto abort_egress;
> -    }
> -  } else {
> -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -  }
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> -
> -
> diff --git a/tools/vtpm_manager/migration/vtpm_migrator.h b/tools/vtpm_manager/migration/vtpm_migrator.h
> deleted file mode 100644
> index 8d52e66..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migrator.h
> +++ /dev/null
> @@ -1,104 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_migrator.h
> -//
> -//  Public Interface header for VTPM Migrator
> -//
> -// ==================================================================
> -
> -#ifndef __VTPM_MIGRATOR_H__
> -#define __VTPM_MIGRATOR_H__
> -
> -#define VTPM_MTAG_REQ 0x02c1
> -#define VTPM_MTAG_RSP 0x02c4
> -
> -// Header sizes.
> -#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
> -//               sizeof(TPM_TAG + UINT32 + TPM_COMMAND_CODE)
> -
> -//*********************** Connection Info **************************
> -#define VTPM_MIG_PORT 48879
> -
> -//************************ Command Codes ***************************
> -#define VTPM_MORD_MIG_STEP1     0x00
> -#define VTPM_MORD_MIG_STEP2     0x01
> -#define VTPM_MORD_MIG_STEP3     0x02
> -#define VTPM_MORD_MIG_STEP4     0x03
> -
> -//************************ Return Codes ****************************
> -#define VTPM_SUCCESS               0
> -#define VTPM_FAIL                  1
> -
> -/******************* Command Parameter API *************************
> -
> -VTPM Command Format
> -  tpm tag: 2 bytes
> -  command size: 4 bytes         // Size of command including header but not DMI
> -  ord: 4 bytes                  // Command ordinal above
> -  parameters: size - 10 bytes   // Command Parameter
> -
> -VTPM Response Format
> -  tpm tag: 2 bytes
> -  response_size: 4 bytes
> -  status: 4 bytes
> -  parameters: size - 10 bytes
> -
> -
> -VTPM_Mig_Phase1:
> -    Unsupported: (Handled by scripts)
> -
> -VTPM_Mig_Phase2
> -  Input Parameters:
> -    domain_name_size: 4 bytes
> -    domain_name : domain_name_size bytes
> -  Output Parameters:
> -    pub_exp_size: 4 bytes
> -    pub_exp: pub_exp_size bytes
> -    pub_mod_size: 4 bytes
> -    pub_mod: pub_mod_size bytes
> -
> -VTPM_Mig_Phase3
> -  Input Parameters:
> -    vtpm_state_size: 4 bytes
> -    vtpm_state: vtpm_state_size bytes
> -  Output Parameters:
> -    none
> -
> -VTPM_Mig_Phase4
> -    Unsupported: (Handled by scripts)
> -
> -
> -*********************************************************************/
> -
> -#endif //_VTPM_MANAGER_H_
> diff --git a/tools/vtpm_manager/migration/vtpm_migrator_if.c b/tools/vtpm_manager/migration/vtpm_migrator_if.c
> deleted file mode 100644
> index de48b2d..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migrator_if.c
> +++ /dev/null
> @@ -1,219 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// vtpm_migrator_if.c
> -//
> -//  Provides functions to call open network connection & call
> -//  a function on the vtpm_migratord on the destination
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <sys/types.h>
> -#include <sys/socket.h>
> -#include <netinet/in.h>
> -#include <arpa/inet.h>
> -#include <netdb.h>
> -#include <string.h>
> -#include <malloc.h>
> -
> -#include "tcg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "bsg.h"
> -#include "vtpm_migrator.h"
> -
> -static int sock_desc;
> -
> -
> -TPM_RESULT vtpm_migratord_open(char *server_address){
> -
> -  TPM_RESULT status = TPM_FAIL;
> -
> -  /* network variables */
> -  struct in_addr ip_addr;
> -  struct sockaddr_in server_addr;
> -  int addr_len;
> -  struct hostent *dns_info=NULL;
> -
> -  /* set up connection to server*/
> -  dns_info = gethostbyname(server_address);
> -  ip_addr.s_addr = *((unsigned long *) dns_info->h_addr_list[0]);
> -
> -  if(ip_addr.s_addr < 0) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  /* set up server variable */
> -  memset((char *)&server_addr, 0, sizeof(server_addr));
> -  server_addr.sin_family = AF_INET;
> -  server_addr.sin_port = htons(VTPM_MIG_PORT);
> -  server_addr.sin_addr.s_addr = ip_addr.s_addr;
> -
> -  /* open socket, make connection */
> -  sock_desc = socket(AF_INET, SOCK_STREAM, 0);
> -
> -  if (sock_desc < 0 ) {
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (connect(sock_desc,
> -              (struct sockaddr *)&server_addr,
> -              sizeof(server_addr)) < 0 ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  status = TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> -
> -void vtpm_migratord_close() {
> -  close(sock_desc);
> -}
> -
> -
> -TPM_RESULT vtpm_migratord_command(TPM_COMMAND_CODE ord,
> -                                buffer_t *command_param_buf,
> -                                TPM_RESULT *cmd_status, /* out */
> -                                buffer_t *result_param_buf) {
> -
> -  TPM_RESULT status = TPM_FAIL;
> -  int  size_read, size_write, i;
> -  BYTE *command, response_header[VTPM_COMMAND_HEADER_SIZE];
> -  UINT32 dmi_id=0, command_size, out_param_size, adj_param_size;
> -  TPM_TAG tag=VTPM_MTAG_REQ;
> -
> -  if ( (!command_param_buf) || (!result_param_buf) || (!cmd_status) ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  command_size = VTPM_COMMAND_HEADER_SIZE + buffer_len(command_param_buf);
> -  command = (BYTE *) malloc( command_size );
> -  if (!command) {
> -    status = TPM_RESOURCES;
> -    goto abort_egress;
> -  }
> -
> -  BSG_PackList(command, 3,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &command_size,
> -                 BSG_TPM_COMMAND_CODE, &ord );
> -
> -  memcpy(command + VTPM_COMMAND_HEADER_SIZE, command_param_buf->bytes, buffer_len(command_param_buf));
> -
> -  size_write = write(sock_desc, command, command_size);
> -
> -  if (size_write > 0) {
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT (MIGd): 0x");
> -    for (i=0; i< command_size; i++) {
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", command[i]);
> -    }
> -    vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -  } else {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Error writing to migration server via network.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (size_write != (int) command_size )
> -    vtpmlogerror(VTPM_LOG_VTPM, "Could not write entire command to migration server (%d/%d)\n", size_write, command_size);
> -
> -  // Read header for response
> -  size_read = read(sock_desc, response_header, VTPM_COMMAND_HEADER_SIZE);
> -  if (size_read > 0) {
> -    vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV (MIGd): 0x");
> -    for (i=0; i<size_read; i++)
> -      vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", response_header[i]);
> -
> -  } else {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Error reading from Migration Server.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  if (size_read < (int) VTPM_COMMAND_HEADER_SIZE) {
> -    vtpmlogerror(VTPM_LOG_VTPM, "Command from migration server shorter than std header.\n");
> -    status = TPM_IOERROR;
> -    goto abort_egress;
> -  }
> -
> -  // Unpack response from DMI for TPM command
> -  BSG_UnpackList(response_header, 3,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &out_param_size,
> -                 BSG_TPM_COMMAND_CODE, cmd_status );
> -
> -  // If response has parameters, read them.
> -  adj_param_size = out_param_size - VTPM_COMMAND_HEADER_SIZE;
> -  if (adj_param_size > 0) {
> -    TPMTRYRETURN( buffer_init( result_param_buf, adj_param_size, NULL) );
> -    size_read = read(sock_desc, result_param_buf->bytes, adj_param_size);
> -    if (size_read > 0) {
> -      for (i=0; i< size_read; i++)
> -        vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_param_buf->bytes[i]);
> -
> -    } else {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Error reading from migration server.\n");
> -      goto abort_egress;
> -    }
> -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -
> -    if (size_read < (int)adj_param_size) {
> -      vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -      vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
> -      status = TPM_IOERROR;
> -      goto abort_egress;
> -    }
> -  } else {
> -    vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -  }
> -
> -  status=TPM_SUCCESS;
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  return status;
> -}
> -
> -
> diff --git a/tools/vtpm_manager/migration/vtpm_migratorc.c b/tools/vtpm_manager/migration/vtpm_migratorc.c
> deleted file mode 100644
> index 18b3bdb..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migratorc.c
> +++ /dev/null
> @@ -1,211 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <stdio.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "log.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -#include "vtpm_migrator.h"
> -#include "vtpm_manager.h"
> -
> -TPM_RESULT handle_vtpm_mig_step2(char *server_addr,
> -                                 char *name,
> -                                 UINT32 instance) {
> -  TPM_RESULT status, cmd_status;
> -  buffer_t out_param_buf=NULL_BUF, mig_key_buf=NULL_BUF, empty_buf=NULL_BUF;
> -  UINT32 offset;
> -  struct pack_buf_t addr_data32;
> -
> -  //===== Get Destination's Public Migration Key ======
> -  TPMTRYRETURN( vtpm_migratord_open(server_addr) );
> -
> -  TPMTRYRETURN( vtpm_migratord_command(VTPM_MORD_MIG_STEP2,
> -                                     &out_param_buf,
> -                                     &cmd_status,
> -                                     &mig_key_buf) );
> -  vtpm_migratord_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  //===== Load migration key into vtpm_manager ========
> -
> -  addr_data32.data = (BYTE *)server_addr;
> -  addr_data32.size = strlen(server_addr) + 1; // Include the null
> -
> -  TPMTRYRETURN ( buffer_init ( &out_param_buf,
> -                               sizeof(UINT32) + addr_data32.size +buffer_len(&mig_key_buf),
> -                               NULL ) ) ;
> -
> -  offset =  BSG_PackList(out_param_buf.bytes, 1,
> -               BSG_TPM_SIZE32_DATA, &addr_data32);
> -
> -  memcpy(out_param_buf.bytes + offset , mig_key_buf.bytes, buffer_len(&mig_key_buf) );
> -
> -  TPMTRYRETURN ( vtpm_manager_open() );
> -
> -  TPMTRYRETURN ( vtpm_manager_command(VTPM_ORD_LOAD_MIG_KEY,
> -                                      &out_param_buf,
> -                                      &cmd_status,
> -                                      &empty_buf) );
> -
> -  vtpm_manager_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  buffer_free(&mig_key_buf);
> -  buffer_free(&out_param_buf);
> -
> -  return status;
> -}
> -
> -
> -TPM_RESULT handle_vtpm_mig_step3(char *server_addr,
> -                                 char *name,
> -                                 UINT32 instance) {
> -  TPM_RESULT status, cmd_status;
> -  buffer_t out_param_buf=NULL_BUF, state_buf=NULL_BUF, empty_buf=NULL_BUF;
> -  struct pack_buf_t addr_data32, name_data32, state_data32;
> -
> -  //===== Get vtpm state from vtpm_manager ========
> -  addr_data32.data = (BYTE *)server_addr;
> -  addr_data32.size = strlen(server_addr) + 1; // Include the null
> -
> -  TPMTRYRETURN ( buffer_init ( &out_param_buf,
> -                               (2 * sizeof(UINT32)) + addr_data32.size,
> -                               NULL ) ) ;
> -
> -  BSG_PackList(out_param_buf.bytes, 2,
> -                 BSG_TYPE_UINT32, &instance,
> -                 BSG_TPM_SIZE32_DATA, &addr_data32);
> -
> -  TPMTRYRETURN ( vtpm_manager_open() );
> -
> -  TPMTRYRETURN ( vtpm_manager_command(VTPM_ORD_MIGRATE_OUT,
> -                                      &out_param_buf,
> -                                      &cmd_status,
> -                                      &state_buf) );
> -
> -  vtpm_manager_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  TPMTRYRETURN( buffer_free( &out_param_buf ) );
> -
> -  //===== Send vtpm state to destination ======
> -  name_data32.data = (BYTE *)name;
> -  name_data32.size = strlen(name) + 1; // Include the null
> -  state_data32.data = state_buf.bytes;
> -  state_data32.size = buffer_len(&state_buf);
> -
> -  TPMTRYRETURN( buffer_init( &out_param_buf,
> -                             2 * sizeof(UINT32) + name_data32.size + state_data32.size,
> -                             NULL ) ) ;
> -
> -  BSG_PackList(out_param_buf.bytes, 2,
> -                 BSG_TPM_SIZE32_DATA, &name_data32,
> -                 BSG_TPM_SIZE32_DATA, &state_data32);
> -
> -  TPMTRYRETURN( vtpm_migratord_open(server_addr) );
> -
> -  TPMTRYRETURN( vtpm_migratord_command(VTPM_MORD_MIG_STEP3,
> -                                     &out_param_buf,
> -                                     &cmd_status,
> -                                     &empty_buf) );
> -  vtpm_migratord_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -
> -  buffer_free( &out_param_buf);
> -  buffer_free( &state_buf);
> -  buffer_free( &empty_buf);
> -
> -  return status;
> -}
> -
> -
> -// Usage vtpm_migrator addr domain_name instance step
> -
> -int main(int argc, char **argv) {
> -
> -    /* variables for processing of command */
> -    TPM_RESULT status = TPM_FAIL;
> -    char *server_addr, *name;
> -    UINT32 instance, step;
> -
> -    if (argc != 5) {
> -      vtpmlogerror(VTPM_LOG_VTPM, "Usage: vtpm_migrator addr vm_name instance step\n");
> -      vtpmlogerror(VTPM_LOG_VTPM, "       params given %d\n", argc);
> -      status= TPM_BAD_PARAMETER;
> -      goto abort_egress;
> -    }
> -
> -    server_addr = argv[1];
> -    name = argv[2];
> -    instance = atoi( argv[3] );
> -    step = atoi( argv[4] );
> -
> -    switch (step) {
> -    case VTPM_MORD_MIG_STEP2:
> -      status = handle_vtpm_mig_step2(server_addr, name, instance);
> -      break;
> -
> -    case VTPM_MORD_MIG_STEP3:
> -      status = handle_vtpm_mig_step3(server_addr, name, instance);
> -      break;
> -
> -    default:
> -      status = TPM_BAD_PARAMETER;
> -      goto abort_egress;
> -      break;
> -    }
> -
> -    goto egress;
> - abort_egress:
> - egress:
> -
> -    return status;
> -}
> -
> diff --git a/tools/vtpm_manager/migration/vtpm_migratord.c b/tools/vtpm_manager/migration/vtpm_migratord.c
> deleted file mode 100644
> index ea18c8c..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migratord.c
> +++ /dev/null
> @@ -1,202 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <stdio.h>
> -#include <sys/types.h>
> -#include <sys/socket.h>
> -#include <netinet/in.h>
> -#include <arpa/inet.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "log.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -#include "vtpm_migrator.h"
> -
> -void build_error_msg( buffer_t *buf, TPM_RESULT status) {
> -  TPM_TAG tag = VTPM_MTAG_RSP;
> -  UINT32 out_param_size = VTPM_COMMAND_HEADER_SIZE;
> -
> -  buffer_init(buf, out_param_size, NULL);
> -
> -  BSG_PackList(buf->bytes, 3,
> -                 BSG_TPM_TAG, &tag,
> -                 BSG_TYPE_UINT32, &out_param_size,
> -                 BSG_TPM_RESULT, &status );
> -}
> -
> -int main() {
> -
> -    /* network variables */
> -    int sock_descr, client_sock=-1, len;
> -    struct sockaddr_in addr;
> -    struct sockaddr_in client_addr;
> -    unsigned int client_length;
> -    int bytes;
> -
> -    /* variables for processing of command */
> -    TPM_RESULT status = TPM_FAIL;
> -    BYTE cmd_header[VTPM_COMMAND_HEADER_SIZE];
> -    TPM_TAG tag;
> -    TPM_COMMAND_CODE ord;
> -    UINT32 in_param_size, adj_param_size;
> -    int i, size_read, size_write;
> -    buffer_t in_param_buf=NULL_BUF, result_buf=NULL_BUF;
> -
> -
> -    /* setup socket */
> -    sock_descr = socket(AF_INET, SOCK_STREAM, 0);
> -
> -    memset(&addr, 0, sizeof(addr));
> -    addr.sin_family = AF_INET;
> -    addr.sin_addr.s_addr = htonl(INADDR_ANY);
> -    addr.sin_port = htons(VTPM_MIG_PORT);
> -
> -    if (bind(sock_descr, (struct sockaddr *)&addr, sizeof(addr)) == -1 ) {
> -        vtpmlogerror(VTPM_LOG_VTPM, "Failed to bind to port %d.\n", VTPM_MIG_PORT);
> -        return 1;
> -    }
> -
> -    listen(sock_descr, 10);
> -
> -    for(;;) {
> -        // ============ clear client info and wait for connection ==========
> -        memset(&client_addr, 0, sizeof(client_addr));
> -        client_length = sizeof(client_addr);
> -
> -        vtpmloginfo(VTPM_LOG_VTPM, "Waiting for incoming migrations...\n");
> -        client_sock=accept(sock_descr, &client_addr, &client_length);
> -        if (client_sock == -1) {
> -            vtpmlogerror(VTPM_LOG_VTPM, "Incoming connectionn failed.\n");
> -            goto abort_command;
> -        } else {
> -            vtpmloginfo(VTPM_LOG_VTPM, "Incoming connection accepted.\n");
> -        }
> -
> -        // =================== Read incoming command ======================
> -        size_read = read( client_sock, cmd_header, VTPM_COMMAND_HEADER_SIZE);
> -        if (size_read > 0) {
> -            vtpmloginfo(VTPM_LOG_VTPM_DEEP, "RECV: 0x");
> -            for (i=0; i<size_read; i++)
> -                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", cmd_header[i]);
> -
> -        } else {
> -            vtpmlogerror(VTPM_LOG_VTPM, "Error reading from socket.\n");
> -            build_error_msg(&result_buf, TPM_IOERROR);
> -            goto abort_command_with_error;
> -        }
> -
> -        if (size_read < (int) VTPM_COMMAND_HEADER_SIZE) {
> -            vtpmlogerror(VTPM_LOG_VTPM, "Command from socket shorter than std header.\n");
> -            build_error_msg(&result_buf, TPM_BAD_PARAMETER);
> -            goto abort_command_with_error;
> -        }
> -
> -        // Unpack response from client
> -        BSG_UnpackList(cmd_header, 3,
> -                       BSG_TPM_TAG, &tag,
> -                       BSG_TYPE_UINT32, &in_param_size,
> -                       BSG_TPM_COMMAND_CODE, &ord );
> -
> -
> -        // If response has parameters, read them.
> -        // Note that out_param_size is in the client's context
> -        adj_param_size = in_param_size - VTPM_COMMAND_HEADER_SIZE;
> -        if (adj_param_size > 0) {
> -            buffer_init( &in_param_buf, adj_param_size, NULL);
> -            size_read = read(client_sock, in_param_buf.bytes, adj_param_size);
> -            if (size_read > 0) {
> -                for (i=0; i< size_read; i++)
> -                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", in_param_buf.bytes[i]);
> -
> -            } else {
> -                vtpmlogerror(VTPM_LOG_VTPM, "Error reading from socket.\n");
> -                build_error_msg(&result_buf, TPM_IOERROR);
> -                goto abort_command_with_error;
> -            }
> -            vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -
> -            if (size_read < (int)adj_param_size) {
> -                vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -                vtpmlogerror(VTPM_LOG_VTPM, "Command read(%d) is shorter than header indicates(%d).\n", size_read, adj_param_size);
> -                build_error_msg(&result_buf, TPM_BAD_PARAMETER);
> -                goto abort_command_with_error;
> -            }
> -        } else {
> -            vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> -        }
> -
> -        /* Handle Command */
> -        switch (ord) {
> -        case VTPM_MORD_MIG_STEP2:
> -          handle_vtpm_mig_step2(&in_param_buf, &result_buf);
> -          break;
> -
> -        case VTPM_MORD_MIG_STEP3:
> -          handle_vtpm_mig_step3(&in_param_buf, &result_buf);
> -          break;
> -
> -        default:
> -            build_error_msg(&result_buf, TPM_BAD_PARAMETER);
> -            goto abort_command_with_error;
> -        }
> -
> -  abort_command_with_error:
> -        /* Write Response */
> -        size_write = write(client_sock, result_buf.bytes, buffer_len(&result_buf));
> -
> -        if (size_write > 0) {
> -            vtpmloginfo(VTPM_LOG_VTPM_DEEP, "SENT: 0x");
> -            for (i=0; i< buffer_len(&result_buf); i++) {
> -                vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "%x ", result_buf.bytes[i]);
> -            }
> -            vtpmloginfomore(VTPM_LOG_VTPM_DEEP, "\n");
> -        } else {
> -            vtpmlogerror(VTPM_LOG_VTPM, "Error writing response to client.\n");
> -            goto abort_command;
> -        }
> -
> -        if (size_write != (int) buffer_len(&result_buf) )
> -           vtpmlogerror(VTPM_LOG_VTPM, "Could not send entire response to client(%d/%d)\n", size_write, buffer_len(&result_buf));
> -
> -  abort_command:
> -        close(client_sock);
> -        buffer_free(&in_param_buf);
> -        buffer_free(&result_buf);
> -
> -    } // For (;;)
> -
> -    return 0;
> -}
> -
> diff --git a/tools/vtpm_manager/migration/vtpm_migratord_handler.c b/tools/vtpm_manager/migration/vtpm_migratord_handler.c
> deleted file mode 100644
> index 0a8a2d5..0000000
> --- a/tools/vtpm_manager/migration/vtpm_migratord_handler.c
> +++ /dev/null
> @@ -1,177 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <stdlib.h>
> -#include <string.h>
> -
> -#include "tcg.h"
> -#include "bsg.h"
> -#include "log.h"
> -#include "vtpm_migrator.h"
> -#include "vtpm_manager.h"
> -
> -#define VTPM_SH_CMD_HDR  "bash -c \"cd /etc/xen/scripts; source /etc/xen/scripts/vtpm-common.sh;"
> -#define VTPM_SH_CMD_FTR  "\""
> -#define VTPM_SH_GETINST  "vtpmdb_get_free_instancenum"
> -#define VTPM_SH_ADD      "vtpm_add_and_activate"
> -#define VTPM_SH_RESUME   "vtpm_resume"
> -
> -// This must be updated to the longest command name. Currently GETINST
> -#define VTPM_SH_CMD_SIZE (strlen(VTPM_SH_CMD_HDR) + strlen(VTPM_SH_CMD_FTR) + 1 + strlen(VTPM_SH_GETINST) + 2)
> -
> -void handle_vtpm_mig_step2(buffer_t *in_param_buf, buffer_t *result_buf)
> -{
> -  TPM_TAG tag = VTPM_TAG_RSP;
> -  buffer_t out_param_buf= NULL_BUF, mig_key_buf=NULL_BUF;
> -  TPM_RESULT status=TPM_SUCCESS, cmd_status;
> -  UINT32 out_param_size;
> -
> -  if ( (!in_param_buf) || (!result_buf) ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  // ================= Call manager and get mig key ===============
> -  TPMTRYRETURN( vtpm_manager_open() );
> -  TPMTRYRETURN( vtpm_manager_command(VTPM_ORD_GET_MIG_KEY,
> -                                     &out_param_buf, // Empty
> -                                     &cmd_status,
> -                                     &mig_key_buf) );
> -
> -  vtpm_manager_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  // ==================== return the  mig key =====================
> -  out_param_size =  VTPM_COMMAND_HEADER_SIZE + buffer_len(&mig_key_buf);
> -
> -  TPMTRYRETURN( buffer_init(result_buf,
> -                            out_param_size,
> -                            NULL) );
> -
> -  BSG_PackList( result_buf->bytes, 3,
> -                  BSG_TPM_TAG, &tag,
> -                  BSG_TYPE_UINT32, &out_param_size,
> -                  BSG_TPM_RESULT, &status);
> -
> -  memcpy(result_buf->bytes + VTPM_COMMAND_HEADER_SIZE,
> -         mig_key_buf.bytes, buffer_len(&mig_key_buf));
> -
> -  goto egress;
> -
> - abort_egress:
> -  buffer_free(result_buf);
> -  build_error_msg(result_buf, status);
> -
> - egress:
> -  return;
> -}
> -
> -void handle_vtpm_mig_step3(buffer_t *in_param_buf, buffer_t *result_buf)
> -{
> -  TPM_TAG tag = VTPM_TAG_RSP;
> -  buffer_t out_param_buf= NULL_BUF, mig_key_buf=NULL_BUF, empty_buf=NULL_BUF;
> -  TPM_RESULT status=TPM_SUCCESS, cmd_status;
> -  UINT32 out_param_size, instance;
> -  char *shell_cmd_str=NULL;
> -  size_t shell_cmd_strlen;
> -  FILE *shell_f=NULL;
> -
> -  if ( (!in_param_buf) || (!result_buf) ) {
> -    status = TPM_BAD_PARAMETER;
> -    goto abort_egress;
> -  }
> -
> -  // ================= Read Parameters ===============
> -  struct pack_buf_t name_data32, state_data32;
> -
> -  BSG_UnpackList(in_param_buf->bytes, 2,
> -                 BSG_TPM_SIZE32_DATA, &name_data32,
> -                 BSG_TPM_SIZE32_DATA, &state_data32);
> -
> -  // Before using this string, protect us from a non-null term array.
> -  if (name_data32.data[name_data32.size -1] != 0x00) {
> -    name_data32.data[name_data32.size -1] = 0x00;
> -  }
> -
> -  // ====== Call hotplug-script and get an instance ======
> -  shell_cmd_strlen = VTPM_SH_CMD_SIZE + name_data32.size + 10;
> -  shell_cmd_str = (char *) malloc(shell_cmd_strlen); // 10 is just padding for the UINT32
> -
> -  snprintf(shell_cmd_str, shell_cmd_strlen,
> -       VTPM_SH_CMD_HDR VTPM_SH_GETINST VTPM_SH_CMD_FTR);
> -
> -  shell_f = popen(shell_cmd_str, "r");
> -  fscanf(shell_f, "%d", &instance);
> -  pclose(shell_f);
> -
> -  // ====== Call hotplug-script and add instance ======
> -  snprintf(shell_cmd_str, shell_cmd_strlen,
> -       VTPM_SH_CMD_HDR VTPM_SH_ADD " %s %d" VTPM_SH_CMD_FTR,
> -       name_data32.data, instance);
> -  system(shell_cmd_str);
> -
> -  // ========= Call vtpm_manager and load VTPM =======
> -  TPMTRYRETURN( buffer_init( &out_param_buf,
> -                             2*sizeof(UINT32) + state_data32.size,
> -                             NULL) );
> -
> -  BSG_PackList(out_param_buf.bytes, 2,
> -                 BSG_TYPE_UINT32, &instance,
> -                 BSG_TPM_SIZE32_DATA, &state_data32);
> -
> -  TPMTRYRETURN( vtpm_manager_open() );
> -  TPMTRYRETURN( vtpm_manager_command(VTPM_ORD_MIGRATE_IN,
> -                                     &out_param_buf,
> -                                     &cmd_status,
> -                                     &empty_buf) );
> -
> -  vtpm_manager_close();
> -
> -  TPMTRYRETURN(cmd_status);
> -
> -  // ====== Call hotplug-script and resume instance ======
> -  snprintf(shell_cmd_str, shell_cmd_strlen,
> -       VTPM_SH_CMD_HDR VTPM_SH_RESUME " %d" VTPM_SH_CMD_FTR, instance);
> -  system(shell_cmd_str);
> -
> -  goto egress;
> - abort_egress:
> - egress:
> -  free(shell_cmd_str);
> -
> -  // In this case no params come back, so reuse build_error_msg even for succes.
> -  build_error_msg(result_buf, status);
> -  return;
> -}
> -
> diff --git a/tools/vtpm_manager/tcs/Makefile b/tools/vtpm_manager/tcs/Makefile
> deleted file mode 100644
> index 11af91e..0000000
> --- a/tools/vtpm_manager/tcs/Makefile
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -BIN            = libTCS.a
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIN)
> -
> -.PHONY: install
> -install: build
> -
> -.PHONY: clean
> -clean:
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIN): $(OBJS)
> -       $(AR) rcs $(BIN) $(OBJS)
> diff --git a/tools/vtpm_manager/tcs/contextmgr.c b/tools/vtpm_manager/tcs/contextmgr.c
> deleted file mode 100644
> index cf3803c..0000000
> --- a/tools/vtpm_manager/tcs/contextmgr.c
> +++ /dev/null
> @@ -1,224 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// contextmgr.c
> -//
> -//  This file contains the context management functions for TCS.
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <string.h>
> -#include <malloc.h>
> -#include "tcs.h"
> -#include "contextmgr.h"
> -#include "log.h"
> -#include "hashtable.h"
> -
> -BYTE* AddMemBlock(CONTEXT_HANDLE* pContextHandle, // in
> -                 int    BlockSize)  { // in
> -
> -  BLOCK* pCurrentBlock = NULL;
> -  BLOCK* pBlock = NULL;
> -
> -  // check incoming params
> -  if (pContextHandle == NULL || BlockSize == 0)
> -    return NULL;
> -
> -  // Create New Block
> -  pBlock = (BLOCK *)malloc(sizeof(BLOCK));
> -  if (pBlock == NULL)
> -    return (0);
> -
> -  pBlock->aMemory = (BYTE *)malloc(sizeof(BYTE) * BlockSize);
> -  if (pBlock->aMemory == NULL)
> -    return (0);
> -
> -  memset(pBlock->aMemory, 0, BlockSize);
> -  pBlock->nBlockSize = BlockSize;
> -  pBlock->pNextBlock = NULL;
> -
> -  // search for the last block created where to add the
> -  // newly created block
> -  if(pContextHandle->pTopBlock != NULL) {
> -    pCurrentBlock = pContextHandle->pTopBlock;
> -    while(pCurrentBlock->pNextBlock != NULL)
> -      pCurrentBlock = pCurrentBlock->pNextBlock;
> -
> -
> -    pCurrentBlock->pNextBlock= pBlock;
> -  } else
> -    pContextHandle->pTopBlock = pBlock;
> -
> -
> -  pContextHandle->nBlockCount++;
> -
> -  return pBlock->aMemory;
> -}
> -
> -
> -BOOL DeleteMemBlock(CONTEXT_HANDLE* pContextHandle, // in
> -                    BYTE*   pTCPA_BYTEs) { // in
> -  BLOCK* pCurrentBlock = NULL;
> -  BLOCK* pParentBlock = NULL;
> -  BOOL bFound = FALSE;
> -
> -  if (pContextHandle == NULL)
> -    return FALSE;
> -
> -
> -  // Search for the Block in the context by aMemory pointer
> -  pParentBlock = NULL;
> -  pCurrentBlock = pContextHandle->pTopBlock;
> -
> -  while(pCurrentBlock != NULL) {
> -    // If aMemory block is found, delete it
> -    if(pCurrentBlock->aMemory == pTCPA_BYTEs || pTCPA_BYTEs == NULL) {
> -      // if it is the top Block, remove it from the top,
> -      // otherwise remove it from the ParentBlock and stitch
> -      // the NextBlock to the ParentBlock
> -      if(pParentBlock == NULL)
> -       pContextHandle->pTopBlock = pContextHandle->pTopBlock->pNextBlock;
> -      else
> -       pParentBlock->pNextBlock = pCurrentBlock->pNextBlock;
> -
> -      // delete memory Block associated with pointer pTCPA_BYTEs
> -      free(pCurrentBlock->aMemory);
> -      pCurrentBlock->aMemory = NULL;
> -
> -      free(pCurrentBlock);
> -      pCurrentBlock = pParentBlock;
> -
> -      pContextHandle->nBlockCount--;
> -      bFound = TRUE;
> -    }
> -
> -    if(pCurrentBlock != NULL) {
> -      pParentBlock = pCurrentBlock;
> -      pCurrentBlock = pCurrentBlock->pNextBlock;
> -    }
> -  }
> -
> -  return bFound;
> -}
> -
> -BOOL AddHandleToList(TCS_CONTEXT_HANDLE hContext, // in
> -                    TPM_RESOURCE_TYPE type, // in
> -                    TPM_HANDLE    handle)  { // in
> -  HANDLE_LIST* pNewHandle = NULL;
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Adding Handle to list\n");
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  if (pContextHandle == NULL)
> -    return 0;
> -
> -  pNewHandle = (HANDLE_LIST *)malloc(sizeof(HANDLE_LIST));
> -
> -  if (pNewHandle == NULL)
> -    return (0);
> -
> -  pNewHandle->handle = handle;
> -  pNewHandle->type = type;
> -  pNewHandle->pNextHandle = pContextHandle->pHandleList;
> -
> -  pContextHandle->pHandleList = pNewHandle;
> -
> -  return 1;
> -}
> -
> -BOOL DeleteHandleFromList(   TCS_CONTEXT_HANDLE hContext, // in
> -                             TPM_HANDLE          handle) { // in
> -
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  HANDLE_LIST *pCurrentHandle = pContextHandle->pHandleList,
> -              *pLastHandle = pCurrentHandle;
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Deleting Handle from list\n");
> -
> -  if (pContextHandle == NULL)
> -    return 0;
> -
> -  while (1) {
> -
> -    if (pCurrentHandle->handle == handle) { // Found element
> -      if (pCurrentHandle == pLastHandle) { // First element in list
> -       pContextHandle->pHandleList = pCurrentHandle->pNextHandle;
> -       free(pCurrentHandle);
> -      } else { // Ordinary element
> -       pLastHandle->pNextHandle = pCurrentHandle->pNextHandle;
> -       free(pCurrentHandle);
> -      }
> -
> -      return 1;
> -
> -    } else { // Not found yet;
> -      pLastHandle = pCurrentHandle;
> -      pCurrentHandle = pCurrentHandle->pNextHandle;
> -      if (pCurrentHandle == NULL) // Found end of list
> -       return 0;
> -    }
> -
> -  }
> -}
> -
> -BOOL FreeHandleList(    CONTEXT_HANDLE*     pContextHandle) { // in
> -  HANDLE_LIST* pCurrentHandle;
> -  BOOL returncode = TRUE;
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Freeing all handles for context\n");
> -
> -  if (pContextHandle == NULL)
> -    return 1;
> -
> -  pCurrentHandle = pContextHandle->pHandleList;
> -  while (pCurrentHandle != NULL) {
> -
> -    switch (pCurrentHandle->type) {
> -    case TPM_RT_KEY:
> -      returncode = returncode && !TCSP_EvictKey(pContextHandle->handle, pCurrentHandle->handle);
> -      break;
> -    case TPM_RT_AUTH:
> -      returncode = returncode && !TCSP_TerminateHandle(pContextHandle->handle, pCurrentHandle->handle);
> -      break;
> -    default:
> -      returncode = FALSE;
> -    }
> -
> -    pCurrentHandle = pCurrentHandle->pNextHandle;
> -
> -  }
> -
> -  return 1;
> -}
> diff --git a/tools/vtpm_manager/tcs/contextmgr.h b/tools/vtpm_manager/tcs/contextmgr.h
> deleted file mode 100644
> index e3fdf0f..0000000
> --- a/tools/vtpm_manager/tcs/contextmgr.h
> +++ /dev/null
> @@ -1,82 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// contextmgr.c
> -//
> -//  This file contains the context management functions for TCS.
> -//
> -// ==================================================================
> -
> -#ifndef __CONTEXTMGR_H__
> -#define __CONTEXTMGR_H__
> -
> -#include "tcg.h"
> -
> -#define BLOCK_SIZE 300
> -
> -typedef struct block {
> -  int nBlockSize;
> -  BYTE* aMemory;
> -  struct block* pNextBlock;
> -} BLOCK;
> -
> -typedef struct handle_List {
> -  TPM_HANDLE handle;
> -  TPM_RESOURCE_TYPE type;
> -  struct handle_List* pNextHandle;
> -} HANDLE_LIST;
> -
> -typedef struct context_handle {
> -  TCS_CONTEXT_HANDLE handle;
> -  int nBlockCount;
> -  BLOCK* pTopBlock;
> -  HANDLE_LIST* pHandleList;
> -} CONTEXT_HANDLE;
> -
> -BYTE* AddMemBlock(  CONTEXT_HANDLE*     pContextHandle, // in
> -                    int                 BlockSize);  // in
> -
> -BOOL DeleteMemBlock(CONTEXT_HANDLE* pContextHandle, // in
> -                    BYTE*           pTCPA_BYTEs); // in
> -
> -
> -BOOL AddHandleToList(   TCS_CONTEXT_HANDLE hContext, // in
> -                        TPM_RESOURCE_TYPE   type, // in
> -                        TPM_HANDLE          handle); // in
> -
> -BOOL DeleteHandleFromList(   TCS_CONTEXT_HANDLE hContext, // in
> -                             TPM_HANDLE          handle); // in
> -
> -BOOL FreeHandleList(    CONTEXT_HANDLE*     pContextHandle); // in
> -
> -#endif //_CONTEXTMGR_H_
> diff --git a/tools/vtpm_manager/tcs/tcs.c b/tools/vtpm_manager/tcs/tcs.c
> deleted file mode 100644
> index 7c1378c..0000000
> --- a/tools/vtpm_manager/tcs/tcs.c
> +++ /dev/null
> @@ -1,1192 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tcs.c
> -//
> -//  This file contains the functions that implement a TCS.
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <string.h>
> -#include <malloc.h>
> -
> -#include "tcg.h"
> -#include "bsg.h"
> -#include "tcs.h"
> -#include "contextmgr.h"
> -#include "tpmddl.h"
> -#include "log.h"
> -#include "hashtable.h"
> -#include "hashtable_itr.h"
> -
> -// Static Global Vars for the TCS
> -static int TCS_m_nCount = 0;
> -
> -#define TCPA_MAX_BUFFER_LENGTH 0x2000
> -
> -static BYTE InBuf [TCPA_MAX_BUFFER_LENGTH];
> -static BYTE OutBuf[TCPA_MAX_BUFFER_LENGTH];
> -
> -struct hashtable *context_ht;
> -
> -// -------------------------- Hash table functions --------------------
> -
> -static unsigned int hashfunc32(void *ky) {
> -  return (* (UINT32 *) ky);
> -}
> -
> -static int equals32(void *k1, void *k2) {
> -  return (*(UINT32 *) k1 == *(UINT32 *) k2);
> -}
> -
> -CONTEXT_HANDLE *LookupContext( TCS_CONTEXT_HANDLE  hContext) {
> -  return( (CONTEXT_HANDLE *) hashtable_search(context_ht, &hContext) );
> -}
> -
> -// ---------------------------------------------------------------------------------
> -// Initialization/Uninitialization SubComponent API
> -// ---------------------------------------------------------------------------------
> -TPM_RESULT TCS_create() {
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TPM_RESULT result = TPM_FAIL;
> -
> -  if (TCS_m_nCount == 0) {
> -    vtpmloginfo(VTPM_LOG_TCS, "Constructing new TCS:\n");
> -    hRes = TDDL_Open();
> -
> -    context_ht = create_hashtable(10, hashfunc32, equals32);
> -
> -    if ((hRes == TDDL_SUCCESS) && (context_ht != NULL)) {
> -      result = TPM_SUCCESS;
> -      TCS_m_nCount++;
> -    } else {
> -      result = TPM_IOERROR;
> -      hashtable_destroy(context_ht, 1);
> -    }
> -  } else
> -    TCS_m_nCount++;
> -
> -  return(result);
> -}
> -
> -
> -void TCS_destroy()
> -{
> -  TCS_m_nCount--;
> -
> -  if (TCS_m_nCount == 0) {
> -    vtpmloginfo(VTPM_LOG_TCS, "Destructing TCS:\n");
> -    TDDL_Close();
> -
> -    struct hashtable_itr *context_itr;
> -    TCS_CONTEXT_HANDLE  *hContext;
> -
> -    // Close all the TCS contexts. TCS should evict keys based on this
> -    if (hashtable_count(context_ht) > 0) {
> -      context_itr = hashtable_iterator(context_ht);
> -      do {
> -        hContext = (TCS_CONTEXT_HANDLE *) hashtable_iterator_key(context_itr);
> -       if (TCS_CloseContext(*hContext) != TPM_SUCCESS)
> -           vtpmlogerror(VTPM_LOG_TCS, "Failed to close context %d properly.\n", *hContext);
> -
> -      } while (hashtable_iterator_advance(context_itr));
> -      free(context_itr);
> -    }
> -    hashtable_destroy(context_ht, 1);
> -  }
> -
> -}
> -
> -TPM_RESULT TCS_Malloc(  TCS_CONTEXT_HANDLE  hContext, // in
> -                        UINT32              MemSize, // in
> -                        BYTE**              ppMemPtr) {// out
> -
> -  TPM_RESULT returnCode = TPM_FAIL;
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  if (pContextHandle != NULL && ppMemPtr != NULL) {
> -    *ppMemPtr = (BYTE *)AddMemBlock(pContextHandle, MemSize);
> -    returnCode = TPM_SUCCESS;
> -  }
> -
> -  return returnCode;
> -}
> -
> -TPM_RESULT TCS_FreeMemory(  TCS_CONTEXT_HANDLE  hContext, // in
> -                            BYTE*               pMemory) { // in
> -  TPM_RESULT returnCode = TPM_FAIL;
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  if ( (pContextHandle != NULL && pMemory != NULL) &&
> -       (DeleteMemBlock(pContextHandle, pMemory) == TRUE) )
> -    returnCode = TPM_SUCCESS;
> -
> -
> -  return returnCode;
> -}
> -
> -TPM_RESULT TCS_OpenContext(TCS_CONTEXT_HANDLE* hContext) { // out
> -  TPM_RESULT returnCode = TPM_FAIL;
> -  TCS_CONTEXT_HANDLE *newContext;
> -
> -  vtpmloginfo(VTPM_LOG_TCS, "Calling TCS_OpenContext:\n");
> -
> -  if (hContext) {
> -    CONTEXT_HANDLE* pContextHandle = (CONTEXT_HANDLE *) malloc(sizeof(CONTEXT_HANDLE));
> -    if (pContextHandle == NULL)
> -      return TPM_SIZE;
> -
> -    // initialize to 0
> -    pContextHandle->nBlockCount = 0;
> -    pContextHandle->pTopBlock = NULL;
> -    pContextHandle->pHandleList = NULL;
> -
> -    // Create New Block
> -    AddMemBlock(pContextHandle, BLOCK_SIZE);
> -
> -    newContext = (TCS_CONTEXT_HANDLE *) malloc(sizeof(TCS_CONTEXT_HANDLE));
> -    *newContext = (TCS_CONTEXT_HANDLE) (((uintptr_t) pContextHandle >> 2) & 0xffffffff);
> -
> -    if (hashtable_search(context_ht, &newContext) !=NULL)
> -       *newContext += 1;
> -
> -    pContextHandle->handle = *newContext;
> -    if (!hashtable_insert(context_ht, newContext, pContextHandle)) {
> -        free(newContext);
> -        free(pContextHandle);
> -       returnCode = TPM_FAIL;
> -    } else {
> -       *hContext = *newContext;
> -       returnCode = TPM_SUCCESS;
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCS_CloseContext(TCS_CONTEXT_HANDLE hContext) {// in
> -  //FIXME: TCS SHOULD Track failed auths and make sure
> -  //we don't try and re-free them here.
> -  TPM_RESULT returnCode = TPM_FAIL;
> -
> -  CONTEXT_HANDLE* pContextHandle = LookupContext(hContext);
> -
> -  if(pContextHandle != NULL) {
> -    // Print test info
> -    vtpmloginfo(VTPM_LOG_TCS, "Calling TCS_CloseContext.\n");
> -
> -    // free memory for all the blocks
> -    DeleteMemBlock(pContextHandle, NULL );
> -    pContextHandle->pTopBlock = NULL;
> -
> -    FreeHandleList(pContextHandle);
> -    if (pContextHandle->pHandleList != NULL)
> -      vtpmlogerror(VTPM_LOG_TCS, "Not all handles evicted from TPM.\n");
> -
> -    // Release the TPM's resources
> -    if (hashtable_remove(context_ht, &hContext) == NULL)
> -      vtpmlogerror(VTPM_LOG_TCS, "Not all handles evicted from TPM.\n");
> -
> -    free(pContextHandle);
> -    returnCode = TPM_SUCCESS;
> -  }
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Finished closing context\n");
> -  return(returnCode);
> -}
> -
> -// ------------------------------------------------------------------
> -// Internal Functions
> -// ------------------------------------------------------------------
> -int packAuth(BYTE* dst, TCS_AUTH* auth) {
> -  // CHECK: according to the command specs, the outgoing auth params are:
> -  // nonceEven
> -  // nonceOdd
> -  // continueAuthSession
> -  // auth digest for return params
> -  //
> -  // this is a bit different than this code...
> -
> -  return BSG_PackList(dst, 4,
> -                     BSG_TYPE_UINT32, &(auth->AuthHandle),
> -                     BSG_TPM_NONCE, &(auth->NonceOdd),
> -                     BSG_TYPE_BOOL, &(auth->fContinueAuthSession),
> -                     BSG_TPM_AUTHDATA, &(auth->HMAC));
> -}
> -
> -int unpackAuth(TCS_AUTH* auth, BYTE* src) {
> -  return BSG_UnpackList(src, 3,
> -                       BSG_TPM_NONCE, &(auth->NonceEven),
> -                       BSG_TYPE_BOOL, &(auth->fContinueAuthSession),
> -                       BSG_TPM_AUTHDATA, &(auth->HMAC));
> -}
> -
> -// ------------------------------------------------------------------
> -// Authorization Commands
> -// ------------------------------------------------------------------
> -
> -TPM_RESULT TCSP_OIAP(TCS_CONTEXT_HANDLE hContext, // in
> -                    TCS_AUTHHANDLE*  authHandle, // out
> -                    TPM_NONCE*   nonce0)  // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_OIAP;
> -  UINT32 paramSize = 0;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (authHandle == NULL || nonce0 == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 3,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal);
> -
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -      == TDDL_SUCCESS) {
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList( OutBuf, 3,
> -                           BSG_TPM_TAG, &tag,
> -                           BSG_TYPE_UINT32, &paramSize,
> -                           BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Extract the remaining output parameters
> -      BSG_UnpackList(OutBuf+i, 2,
> -                    BSG_TYPE_UINT32, authHandle,
> -                    BSG_TPM_NONCE, nonce0);
> -
> -      if (!AddHandleToList(hContext, TPM_RT_AUTH, *authHandle))
> -        vtpmlogerror(VTPM_LOG_TCS, "New AuthHandle not recorded\n");
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "Failed with return code %s\n", tpm_get_error_name(returnCode));
> -
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_OSAP(TCS_CONTEXT_HANDLE hContext,  // in
> -                    TPM_ENTITY_TYPE  entityType,  // in
> -                    UINT32    entityValue, // in
> -                    TPM_NONCE   nonceOddOSAP, // in
> -                    TCS_AUTHHANDLE*  authHandle,  // out
> -                    TPM_NONCE*   nonceEven,  // out
> -                    TPM_NONCE*   nonceEvenOSAP) // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_OSAP;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (authHandle == NULL || nonceEven == NULL || nonceEvenOSAP == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 6,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT16, &entityType,
> -                         BSG_TYPE_UINT32, &entityValue,
> -                         BSG_TPM_NONCE, &nonceOddOSAP);
> -
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -            == TDDL_SUCCESS) {
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Extract the remaining output parameters
> -      BSG_UnpackList(OutBuf+i, 3,
> -                    BSG_TYPE_UINT32, authHandle,
> -                    BSG_TPM_NONCE, nonceEven,
> -                    BSG_TPM_NONCE, nonceEvenOSAP);
> -
> -      if (!AddHandleToList(hContext, TPM_RT_AUTH, *authHandle)) {
> -           vtpmlogerror(VTPM_LOG_TCS, "New AuthHandle not recorded\n");
> -      }
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "Failed with return code %s\n", tpm_get_error_name(returnCode));
> -
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_TakeOwnership(TCS_CONTEXT_HANDLE hContext,   // in
> -                             UINT16    protocolID,   // in
> -                             UINT32    encOwnerAuthSize, // in
> -                             BYTE*    encOwnerAuth,  // in
> -                             UINT32    encSrkAuthSize,  // in
> -                             BYTE*    encSrkAuth,   // in
> -                             UINT32*    SrkSize,   // in, out
> -                             BYTE**    Srk,    // in, out
> -                             TCS_AUTH*   ownerAuth)   // in, out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_TakeOwnership;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (encOwnerAuth == NULL || encSrkAuth == NULL || SrkSize == NULL || *Srk == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 5,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT16, &protocolID,
> -                         BSG_TYPE_UINT32, &encOwnerAuthSize);
> -
> -  memcpy(InBuf+InLength, encOwnerAuth, encOwnerAuthSize);
> -  InLength += encOwnerAuthSize;
> -  InLength += BSG_Pack(   BSG_TYPE_UINT32,
> -                         &encSrkAuthSize,
> -                         InBuf+InLength);
> -  memcpy(InBuf+InLength, encSrkAuth, encSrkAuthSize);
> -  InLength += encSrkAuthSize;
> -  memcpy(InBuf+InLength, *Srk, *SrkSize);
> -  InLength += *SrkSize;
> -  InLength += packAuth(InBuf+InLength, ownerAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32,
> -          &InLength,
> -          InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS){
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList( OutBuf, 3,
> -                           BSG_TPM_TAG, &tag,
> -                           BSG_TYPE_UINT32, &paramSize,
> -                           BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      TPM_KEY srkPub;
> -      i += BSG_Unpack(BSG_TPM_KEY,  OutBuf+i,  &srkPub);
> -      unpackAuth(ownerAuth, OutBuf+i);
> -
> -      // fill output params
> -      BYTE tempBuf[1024];
> -      *SrkSize = BSG_Pack(BSG_TPM_KEY,  &srkPub, tempBuf);
> -      if (TCS_Malloc(hContext, *SrkSize, Srk) == TPM_FAIL) {
> -       return(TPM_SIZE);
> -      }
> -      memcpy(*Srk, tempBuf, *SrkSize);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_TakeOwnership Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_DisablePubekRead (  TCS_CONTEXT_HANDLE hContext, // in
> -                                    TCS_AUTH*   ownerAuth) { // in, out
> -
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_DisablePubekRead;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 3,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal);
> -
> -  InLength += packAuth(InBuf+InLength, ownerAuth);
> -
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS){
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList( OutBuf, 3,
> -                           BSG_TPM_TAG, &tag,
> -                           BSG_TYPE_UINT32, &paramSize,
> -                           BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      unpackAuth(ownerAuth, OutBuf+i);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_DisablePubekRead Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_TerminateHandle(TCS_CONTEXT_HANDLE hContext, // in
> -                                TCS_AUTHHANDLE  handle)  // in
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_Terminate_Handle;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &handle);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS) {
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (!DeleteHandleFromList(hContext, handle))
> -      vtpmlogerror(VTPM_LOG_TCS, "KeyHandle not removed from list\n");
> -
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Print debug info
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_TerminateHandle Failed with return code %s\n", tpm_get_error_name(returnCode));
> -
> -  }
> -
> -  return(returnCode);
> -}
> -
> -// TPM Mandatory
> -TPM_RESULT TCSP_Extend( TCS_CONTEXT_HANDLE hContext, // in
> -                        TPM_PCRINDEX  pcrNum,  // in
> -                        TPM_DIGEST  inDigest, // in
> -                        TPM_PCRVALUE*  outDigest) // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_Extend;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 5,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &pcrNum,
> -                         BSG_TPM_DIGEST, &inDigest);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS) {
> -
> -    // unpack to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND){
> -      // Extract the remaining output parameters
> -      BSG_Unpack(BSG_TPM_PCRVALUE, OutBuf+i, outDigest);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Extend Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_Seal(   TCS_CONTEXT_HANDLE hContext,  // in
> -                        TCS_KEY_HANDLE  keyHandle,  // in
> -                        TPM_ENCAUTH   encAuth,  // in
> -                        UINT32    pcrInfoSize, // in
> -                        BYTE*    PcrInfo,  // in
> -                        UINT32    inDataSize,  // in
> -                        BYTE*    inData,   // in
> -                        TCS_AUTH*   pubAuth,  // in, out
> -                        UINT32*    SealedDataSize, // out
> -                        BYTE**    SealedData)  // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_Seal;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (inData == NULL || pubAuth == NULL || SealedDataSize == NULL || SealedData == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 6,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &keyHandle,
> -                         BSG_TPM_ENCAUTH, encAuth,
> -                         BSG_TYPE_UINT32, &pcrInfoSize);
> -  memcpy(InBuf+InLength, PcrInfo, pcrInfoSize);
> -  InLength += pcrInfoSize;
> -  InLength += BSG_Pack(BSG_TYPE_UINT32, &inDataSize, InBuf+InLength);
> -  memcpy(InBuf+InLength, inData, inDataSize);
> -  InLength += inDataSize;
> -  InLength += packAuth(InBuf+InLength, pubAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength))
> -              == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      TPM_STORED_DATA sealedData;
> -
> -      i += BSG_Unpack(BSG_TPM_STORED_DATA, OutBuf+i, &sealedData);
> -      unpackAuth(pubAuth, OutBuf+i);
> -
> -      // fill SealedData
> -      BYTE tempBuf[1024];
> -      *SealedDataSize = BSG_Pack(BSG_TPM_STORED_DATA, &sealedData, tempBuf);
> -      if (TCS_Malloc(hContext, *SealedDataSize, SealedData) == TPM_FAIL) {
> -       return TPM_SIZE;
> -      }
> -      memcpy(*SealedData, tempBuf, *SealedDataSize);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Seal Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_Unseal(TCS_CONTEXT_HANDLE hContext,  // in
> -                      TCS_KEY_HANDLE  parentHandle, // in
> -                      UINT32    SealedDataSize, // in
> -                      BYTE*    SealedData,  // in
> -                      TCS_AUTH*   parentAuth,  // in, out
> -                      TCS_AUTH*   dataAuth,  // in, out
> -                      UINT32*   DataSize,  // out
> -                      BYTE**    Data)   // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH2_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_Unseal;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32 InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32 OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (SealedData == NULL || parentAuth == NULL || dataAuth == NULL ||
> -      DataSize == NULL || Data == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                                     BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &ordinal,
> -                          BSG_TYPE_UINT32, &parentHandle);
> -  memcpy(InBuf+InLength, SealedData, SealedDataSize);
> -  InLength += SealedDataSize;
> -  InLength += packAuth(InBuf+InLength, parentAuth);
> -  InLength += packAuth(InBuf+InLength, dataAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList( OutBuf, 3,
> -                            BSG_TPM_TAG, &tag,
> -                            BSG_TYPE_UINT32, &paramSize,
> -                            BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH2_COMMAND) {
> -      // Extract the remaining output parameters
> -      i += BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, DataSize);
> -      if (TCS_Malloc(hContext, *DataSize, Data) == TPM_FAIL) {
> -        return TPM_SIZE;
> -      }
> -      memcpy(*Data, OutBuf+i, *DataSize);
> -      i += *DataSize;
> -      i += unpackAuth(parentAuth, OutBuf+i);
> -      unpackAuth(dataAuth, OutBuf+i);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_Unseal Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_UnBind(TCS_CONTEXT_HANDLE hContext,  // in
> -                      TCS_KEY_HANDLE  keyHandle,  // in
> -                      UINT32    inDataSize,  // in
> -                      BYTE*    inData,   // in
> -                      TCS_AUTH*   privAuth,  // in, out
> -                      UINT32*   outDataSize, // out
> -                      BYTE**    outData)  // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_UnBind;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (inData == NULL || privAuth == NULL || outDataSize == NULL || outData == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 5,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &keyHandle,
> -                         BSG_TYPE_UINT32, &inDataSize);
> -  memcpy(InBuf+InLength, inData, inDataSize);
> -  InLength += inDataSize;
> -  InLength += packAuth(InBuf+InLength, privAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "\n\tSending paramSize = %d", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      i += BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, outDataSize);
> -      if (TCS_Malloc(hContext, *outDataSize, outData) == TPM_FAIL)
> -        return TPM_SIZE;
> -
> -      memcpy(*outData, OutBuf+i, *outDataSize);
> -      i += *outDataSize;
> -      unpackAuth(privAuth, OutBuf+i);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_UnBind Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_CreateWrapKey(TCS_CONTEXT_HANDLE hContext,   // in
> -                             TCS_KEY_HANDLE  hWrappingKey,  // in
> -                             TPM_ENCAUTH  KeyUsageAuth,  // in
> -                             TPM_ENCAUTH  KeyMigrationAuth, // in
> -                             UINT32*    pcKeySize,   // in, out
> -                             BYTE**    prgbKey,   // in, out
> -                             TCS_AUTH*   pAuth)    // in, out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_CreateWrapKey;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (pcKeySize == NULL || *prgbKey == NULL || pAuth == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 6,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &hWrappingKey,
> -                         BSG_TPM_ENCAUTH, KeyUsageAuth,
> -                         BSG_TPM_ENCAUTH, KeyMigrationAuth);
> -  memcpy(InBuf+InLength, *prgbKey, *pcKeySize);
> -  InLength += *pcKeySize;
> -  InLength += packAuth(InBuf+InLength, pAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_RESULT, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      TPM_KEY wrappedKey;
> -
> -      i += BSG_Unpack(BSG_TPM_KEY, OutBuf+i, &wrappedKey);
> -      unpackAuth(pAuth, OutBuf+i);
> -
> -      // Fill prgbKey
> -      BYTE tempBuf[1024];
> -      *pcKeySize = BSG_Pack(BSG_TPM_KEY, &wrappedKey, tempBuf);
> -      if (TCS_Malloc(hContext, *pcKeySize, prgbKey) == TPM_FAIL)
> -        return TPM_SIZE;
> -
> -      memcpy(*prgbKey, tempBuf, *pcKeySize);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_CreateWrapKey Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_LoadKeyByBlob(TCS_CONTEXT_HANDLE hContext,    // in
> -                             TCS_KEY_HANDLE  hUnwrappingKey,   // in
> -                             UINT32    cWrappedKeyBlobSize, // in
> -                             BYTE*    rgbWrappedKeyBlob,  // in
> -                             TCS_AUTH*   pAuth,     // in, out
> -                             TCS_KEY_HANDLE*  phKeyTCSI,    // out
> -                             TCS_KEY_HANDLE*  phKeyHMAC)    // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_AUTH1_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_LoadKey;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (rgbWrappedKeyBlob == NULL || pAuth == NULL || phKeyTCSI == NULL || phKeyHMAC == NULL)
> -    return TPM_BAD_PARAMETER;
> -
> -  *phKeyHMAC = hUnwrappingKey; // the parent key is the one that the TPM use to make the HMAC calc
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &hUnwrappingKey);
> -  memcpy(InBuf+InLength, rgbWrappedKeyBlob, cWrappedKeyBlobSize);
> -  InLength += cWrappedKeyBlobSize;
> -  InLength += packAuth(InBuf+InLength, pAuth);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_AUTH1_COMMAND) {
> -      // Extract the remaining output parameters
> -      i += BSG_Unpack(BSG_TYPE_UINT32,
> -                     OutBuf+i,
> -                     phKeyTCSI);
> -      unpackAuth(pAuth, OutBuf+i);
> -
> -      if (!AddHandleToList(hContext, TPM_RT_KEY, *phKeyTCSI)) {
> -        vtpmlogerror(VTPM_LOG_TCS, "New KeyHandle not recorded\n");
> -      }
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -     } else
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_LoadKeyByBlob Failed with return code %s\n", tpm_get_error_name(returnCode));
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_EvictKey(TCS_CONTEXT_HANDLE hContext, // in
> -                        TCS_KEY_HANDLE  hKey)  // in
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_EvictKey;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, &hKey);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (!DeleteHandleFromList(hContext, hKey)) {
> -      vtpmlogerror(VTPM_LOG_TCS, "KeyHandle not removed from list\n");
> -    }
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else {
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_EvictKey Failed with return code %s\n", tpm_get_error_name(returnCode));
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -TPM_RESULT TCSP_GetRandom(TCS_CONTEXT_HANDLE hContext,  // in
> -                         UINT32*    bytesRequested, // in, out
> -                         BYTE**    randomBytes) // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_GetRandom;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (bytesRequested == NULL || *randomBytes == NULL){
> -    return TPM_BAD_PARAMETER;
> -  }
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TYPE_UINT32, bytesRequested);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Extract the remaining output parameters
> -      BSG_Unpack(BSG_TYPE_UINT32, OutBuf+i, bytesRequested);
> -      if (TCS_Malloc(hContext, *bytesRequested, randomBytes) == TPM_FAIL) {
> -        return TPM_SIZE;
> -      }
> -      memcpy(*randomBytes, OutBuf+i+sizeof(UINT32), *bytesRequested);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else {
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_GetRandom Failed with return code %s\n", tpm_get_error_name(returnCode));
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_ReadPubek(TCS_CONTEXT_HANDLE   hContext,               // in
> -                         TPM_NONCE            antiReplay,             // in
> -                         UINT32*              pubEndorsementKeySize,  // out
> -                         BYTE**               pubEndorsementKey,      // out
> -                         TPM_DIGEST*          checksum)               // out
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_ReadPubek;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32   OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // check input params
> -  if (pubEndorsementKeySize == NULL || pubEndorsementKey == NULL || checksum == NULL) {
> -    return TPM_BAD_PARAMETER;
> -  }
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 4,
> -                         BSG_TPM_TAG, &tag,
> -                         BSG_TYPE_UINT32, &paramSize,
> -                         BSG_TPM_COMMAND_CODE, &ordinal,
> -                         BSG_TPM_NONCE, &antiReplay);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    int i = BSG_UnpackList(OutBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      // Extract the remaining output parameters
> -      TPM_PUBKEY pubEK;
> -      i += BSG_UnpackList(OutBuf+i, 2,
> -                         BSG_TPM_PUBKEY, &pubEK,
> -                         BSG_TPM_DIGEST, checksum);
> -
> -      // fill EndorsementKey
> -      BYTE tempBuf[1024];
> -      *pubEndorsementKeySize = BSG_Pack(BSG_TPM_PUBKEY, &pubEK, tempBuf);
> -      if (TCS_Malloc(hContext, *pubEndorsementKeySize, pubEndorsementKey) == TPM_FAIL) {
> -        return TPM_SIZE;
> -      }
> -      memcpy(*pubEndorsementKey, tempBuf, *pubEndorsementKeySize);
> -
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else {
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_ReadPubek Failed with return code %s\n", tpm_get_error_name(returnCode));
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_SaveState(TCS_CONTEXT_HANDLE   hContext)  // in
> -{
> -  // setup input/output parameters block
> -  TPM_TAG tag = TPM_TAG_RQU_COMMAND;
> -  UINT32 paramSize = 0;
> -  TPM_COMMAND_CODE ordinal = TPM_ORD_SaveState;
> -  TPM_RESULT returnCode = TPM_SUCCESS;
> -
> -  // setup the TPM driver input and output buffers
> -  TDDL_RESULT hRes = TDDL_E_FAIL;
> -  TDDL_UINT32  InLength = TCPA_MAX_BUFFER_LENGTH;
> -  TDDL_UINT32  OutLength = TCPA_MAX_BUFFER_LENGTH;
> -
> -  // Convert Byte Input parameter in the input byte stream InBuf
> -  InLength = BSG_PackList(InBuf, 3,
> -                          BSG_TPM_TAG, &tag,
> -                          BSG_TYPE_UINT32, &paramSize,
> -                          BSG_TPM_COMMAND_CODE, &ordinal);
> -  // fill paramSize again as we now have the correct size
> -  BSG_Pack(BSG_TYPE_UINT32, &InLength, InBuf+2);
> -
> -  vtpmloginfo(VTPM_LOG_TCS_DEEP, "Sending paramSize = %d\n", InLength);
> -
> -  // call the TPM driver
> -  if ((hRes = TDDL_TransmitData(InBuf, InLength, OutBuf, &OutLength)) == TDDL_SUCCESS) {
> -    // unpack OutBuf to get the tag, paramSize, & returnCode
> -    BSG_UnpackList(OutBuf, 3,
> -                           BSG_TPM_TAG, &tag,
> -                           BSG_TYPE_UINT32, &paramSize,
> -                           BSG_TPM_COMMAND_CODE, &returnCode);
> -
> -    if (returnCode == TPM_SUCCESS && tag == TPM_TAG_RSP_COMMAND) {
> -      vtpmloginfo(VTPM_LOG_TCS_DEEP, "Received paramSize : %d\n", paramSize);
> -    } else {
> -      vtpmlogerror(VTPM_LOG_TCS, "TCSP_SaveState Failed with return code %s\n", tpm_get_error_name(returnCode));
> -    }
> -  }
> -
> -  return(returnCode);
> -}
> -
> -
> -TPM_RESULT TCSP_RawTransmitData(   UINT32 inDataSize,  // in
> -                                  BYTE *inData,       // in
> -                                  UINT32 *outDataSize,// in/out
> -                                  BYTE *outData) {    // out
> -
> -  TDDL_RESULT hRes;
> -
> -  vtpmloginfo(VTPM_LOG_TCS, "Calling TransmitData directly.\n");
> -  //FIXME: Add Context Management
> -  hRes = TDDL_TransmitData( inData,
> -                           inDataSize,
> -                           outData,
> -                           outDataSize);
> -
> -  if (hRes == TDDL_SUCCESS) {
> -    return TPM_SUCCESS;
> -  } else {
> -    vtpmlogerror(VTPM_LOG_TCS, "TCSP_RawTransmitData Failed with return code %s\n", tpm_get_error_name(TPM_IOERROR));
> -    return TPM_IOERROR;
> -  }
> -
> -}
> diff --git a/tools/vtpm_manager/tcs/tcs.h b/tools/vtpm_manager/tcs/tcs.h
> deleted file mode 100644
> index 83b9cd0..0000000
> --- a/tools/vtpm_manager/tcs/tcs.h
> +++ /dev/null
> @@ -1,245 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tcs.h
> -//
> -//  This file declares the TCS API
> -//
> -// ==================================================================
> -
> -#ifndef __TCS_H__
> -#define __TCS_H__
> -
> -#include "tcg.h"
> -#include "contextmgr.h"
> -#include "buffer.h"
> -
> -#define HANDLE_NULL 0
> -
> -// ------------------------------------------------------------------
> -// Exposed API
> -// ------------------------------------------------------------------
> -
> -TPM_RESULT TCS_create();
> -void TCS_destroy();
> -
> -TPM_RESULT TCS_OpenContext( /* OUT */ TCS_CONTEXT_HANDLE* hContext );
> -
> -TPM_RESULT TCS_CloseContext ( /* IN */ TCS_CONTEXT_HANDLE hContext );
> -
> -TPM_RESULT TCS_Malloc ( TCS_CONTEXT_HANDLE hContext, // in
> -                       UINT32   MemSize, // in
> -                       BYTE**   ppMemPtr ); //out
> -
> -TPM_RESULT TCS_FreeMemory ( TCS_CONTEXT_HANDLE hContext, // in
> -                           BYTE*    pMemory);  // in
> -
> -// ------------------------------------------------------------------
> -// Exposed API
> -// ------------------------------------------------------------------
> -
> -// TPM v1.1B Command Set
> -
> -// Authorzation
> -TPM_RESULT TCSP_OIAP( TCS_CONTEXT_HANDLE hContext, // in
> -                     TCS_AUTHHANDLE*  authHandle, // out
> -                     TPM_NONCE*   nonce0  // out
> -                     );
> -
> -TPM_RESULT TCSP_OSAP (  TCS_CONTEXT_HANDLE hContext,  // in
> -                       TPM_ENTITY_TYPE entityType,  // in
> -                       UINT32    entityValue, // in
> -                       TPM_NONCE   nonceOddOSAP, // in
> -                       TCS_AUTHHANDLE*  authHandle,  // out
> -                       TPM_NONCE*   nonceEven,  // out
> -                       TPM_NONCE*   nonceEvenOSAP // out
> -                       );
> -
> -TPM_RESULT TCSP_TakeOwnership (  TCS_CONTEXT_HANDLE hContext,   // in
> -                                UINT16    protocolID,   // in
> -                                UINT32    encOwnerAuthSize, // in
> -                                BYTE*    encOwnerAuth,  // in
> -                                UINT32    encSrkAuthSize,  // in
> -                                BYTE*    encSrkAuth,   // in
> -                                UINT32*    SrkSize,   // in, out
> -                                BYTE**    Srk,    // in, out
> -                                TCS_AUTH*   ownerAuth   // in, out
> -                                );
> -
> -TPM_RESULT TCSP_DisablePubekRead (  TCS_CONTEXT_HANDLE hContext, // in
> -                                    TCS_AUTH*   ownerAuth // in, out
> -                                    );
> -
> -TPM_RESULT TCSP_TerminateHandle (  TCS_CONTEXT_HANDLE hContext, // in
> -                                  TCS_AUTHHANDLE  handle  // in
> -                                  );
> -
> -TPM_RESULT TCSP_FlushSpecific (  TCS_CONTEXT_HANDLE hContext, // in
> -                                TCS_AUTHHANDLE  handle,  // in
> -                                TPM_RESOURCE_TYPE resourceType //in
> -                                );
> -
> -// TPM Mandatory
> -TPM_RESULT TCSP_Extend (  TCS_CONTEXT_HANDLE hContext, // in
> -                         TPM_PCRINDEX  pcrNum,  // in
> -                         TPM_DIGEST   inDigest, // in
> -                         TPM_PCRVALUE*   outDigest // out
> -                         );
> -
> -TPM_RESULT TCSP_PcrRead (  TCS_CONTEXT_HANDLE hContext, // in
> -                          TPM_PCRINDEX  pcrNum,  // in
> -                          TPM_PCRVALUE*  outDigest // out
> -                          );
> -
> -TPM_RESULT TCSP_Quote (  TCS_CONTEXT_HANDLE hContext,  // in
> -                        TCS_KEY_HANDLE  keyHandle,  // in
> -                        TPM_NONCE   antiReplay,  // in
> -                        UINT32*    PcrDataSize, // in, out
> -                        BYTE**    PcrData,  // in, out
> -                        TCS_AUTH*   privAuth,  // in, out
> -                        UINT32*    sigSize,  // out
> -                        BYTE**    sig    // out
> -                        );
> -
> -TPM_RESULT TCSP_Seal (  TCS_CONTEXT_HANDLE hContext,  // in
> -                       TCS_KEY_HANDLE  keyHandle,  // in
> -                       TPM_ENCAUTH  encAuth,  // in
> -                       UINT32    pcrInfoSize, // in
> -                       BYTE*    PcrInfo,  // in
> -                       UINT32    inDataSize,  // in
> -                       BYTE*    inData,   // in
> -                       TCS_AUTH*   pubAuth,  // in, out
> -                       UINT32*    SealedDataSize, // out
> -                       BYTE**    SealedData  // out
> -                       );
> -
> -TPM_RESULT TCSP_Unseal (  TCS_CONTEXT_HANDLE hContext,  // in
> -                         TCS_KEY_HANDLE  parentHandle, // in
> -                         UINT32    SealedDataSize, // in
> -                         BYTE*    SealedData,  // in
> -                         TCS_AUTH*   parentAuth,  // in, out
> -                         TCS_AUTH*   dataAuth,  // in, out
> -                         UINT32*    DataSize,  // out
> -                         BYTE**    Data   // out
> -                         );
> -
> -TPM_RESULT TCSP_DirWriteAuth (  TCS_CONTEXT_HANDLE hContext,  // in
> -                               TPM_DIRINDEX  dirIndex,  // in
> -                               TPM_DIRVALUE  newContents, // in
> -                               TCS_AUTH*   ownerAuth  // in, out
> -                               );
> -
> -TPM_RESULT TCSP_DirRead (  TCS_CONTEXT_HANDLE hContext, // in
> -                          TPM_DIRINDEX  dirIndex, // in
> -                          TPM_DIRVALUE*  dirValue // out
> -                          );
> -
> -TPM_RESULT TCSP_UnBind (  TCS_CONTEXT_HANDLE hContext,  // in
> -                         TCS_KEY_HANDLE  keyHandle,  // in
> -                         UINT32    inDataSize,  // in
> -                         BYTE*    inData,   // in
> -                         TCS_AUTH*   privAuth,  // in, out
> -                         UINT32*    outDataSize, // out
> -                         BYTE**    outData   // out
> -                         );
> -
> -TPM_RESULT TCSP_CreateWrapKey (  TCS_CONTEXT_HANDLE hContext,   // in
> -                                TCS_KEY_HANDLE  hWrappingKey,  // in
> -                                TPM_ENCAUTH  KeyUsageAuth,  // in
> -                                TPM_ENCAUTH  KeyMigrationAuth, // in
> -                                UINT32*    pcKeySize,   // in, out
> -                                BYTE**    prgbKey,   // in, out
> -                                TCS_AUTH*   pAuth    // in, out
> -                                );
> -
> -TPM_RESULT TCSP_LoadKeyByBlob (  TCS_CONTEXT_HANDLE hContext,    // in
> -                                TCS_KEY_HANDLE  hUnwrappingKey,   // in
> -                                UINT32    cWrappedKeyBlobSize, // in
> -                                BYTE*    rgbWrappedKeyBlob,  // in
> -                                TCS_AUTH*   pAuth,     // in, out
> -                                TCS_KEY_HANDLE*  phKeyTCSI,    // out
> -                                TCS_KEY_HANDLE*  phKeyHMAC    // out
> -                                );
> -
> -TPM_RESULT TCSP_GetPubKey (  TCS_CONTEXT_HANDLE hContext,  // in
> -                            TCS_KEY_HANDLE  hKey,   // in
> -                            TCS_AUTH*   pAuth,   // in, out
> -                            UINT32*    pcPubKeySize, // out
> -                            BYTE**    prgbPubKey  // out
> -                            );
> -
> -TPM_RESULT TCSP_EvictKey (  TCS_CONTEXT_HANDLE hContext, // in
> -                           TCS_KEY_HANDLE  hKey  // in
> -                           );
> -
> -TPM_RESULT TCSP_Sign (  TCS_CONTEXT_HANDLE hContext,  // in
> -                       TCS_KEY_HANDLE  keyHandle,  // in
> -                       UINT32    areaToSignSize, // in
> -                       BYTE*    areaToSign,  // in
> -                       TCS_AUTH*   privAuth,  // in, out
> -                       UINT32*    sigSize,  // out
> -                       BYTE**    sig    // out
> -                       );
> -
> -TPM_RESULT TCSP_GetRandom (  TCS_CONTEXT_HANDLE hContext,  // in
> -                            UINT32*    bytesRequested, // in, out
> -                            BYTE**    randomBytes  // out
> -                            );
> -
> -TPM_RESULT TCSP_StirRandom (  TCS_CONTEXT_HANDLE hContext, // in
> -                             UINT32    inDataSize, // in
> -                             BYTE*    inData  // in
> -                             );
> -
> -TPM_RESULT TCSP_ReadPubek (  TCS_CONTEXT_HANDLE hContext,    // in
> -                            TPM_NONCE   antiReplay,    // in
> -                            UINT32*    pubEndorsementKeySize, // out
> -                            BYTE**    pubEndorsementKey,  // out
> -                            TPM_DIGEST*  checksum    // out
> -                            );
> -
> -
> -// Non-Standard TCSP calls
> -TPM_RESULT TCSP_SaveState(TCS_CONTEXT_HANDLE   hContext);  // in
> -
> -//Give direct access to TransmitData.
> -// Key and Auth Management is done before transfering command to TDDL.
> -TPM_RESULT TCSP_RawTransmitData(UINT32 inDataSize,  // in
> -                               BYTE *inData,       // in
> -                               UINT32 *outDataSize,// in/out
> -                               BYTE *outData);     // out
> -
> -///////////// Private Functions ////////////////////
> -CONTEXT_HANDLE* LookupContext( TCS_CONTEXT_HANDLE hContext);
> -
> -#endif //TCS_H
> diff --git a/tools/vtpm_manager/tcs/tpmddl.h b/tools/vtpm_manager/tcs/tpmddl.h
> deleted file mode 100644
> index e7e54f1..0000000
> --- a/tools/vtpm_manager/tcs/tpmddl.h
> +++ /dev/null
> @@ -1,69 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tpmddl.c
> -//
> -//  This file defines the TDDLI API
> -//
> -// ==================================================================
> -
> -#ifndef __TPMDDL_H__
> -#define __TPMDDL_H__
> -
> -#define TDDL_CAP_PROP_MANUFACTURER 0x0001
> -
> -#define TDDL_E_FAIL 1
> -#define TDDL_E_SUCCESS 0
> -#define TDDL_SUCCESS 0
> -
> -typedef unsigned int TDDL_UINT32;
> -typedef TDDL_UINT32 TDDL_RESULT;
> -typedef unsigned char TDDL_BYTE;
> -
> -TDDL_RESULT TDDL_Open();
> -void TDDL_Close();
> -TDDL_RESULT TDDL_TransmitData( TDDL_BYTE* in,
> -                              TDDL_UINT32 insize,
> -                              TDDL_BYTE* out,
> -                              TDDL_UINT32* outsize);
> -TDDL_RESULT TDDL_GetStatus();
> -TDDL_RESULT TDDL_GetCapability( TDDL_UINT32 cap,
> -                               TDDL_UINT32 sub,
> -                               TDDL_BYTE* buffer,
> -                               TDDL_UINT32* size);
> -TDDL_RESULT TDDL_SetCapability( TDDL_UINT32 cap,
> -                               TDDL_UINT32 sub,
> -                               TDDL_BYTE* buffer,
> -                               TDDL_UINT32* size);
> -
> -#endif // __TPMDDL_H__
> diff --git a/tools/vtpm_manager/tcs/transmit.c b/tools/vtpm_manager/tcs/transmit.c
> deleted file mode 100644
> index 74bbdca..0000000
> --- a/tools/vtpm_manager/tcs/transmit.c
> +++ /dev/null
> @@ -1,147 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <unistd.h>
> -#include <stdio.h>
> -#include <errno.h>
> -#include <fcntl.h>
> -
> -#include "tcg.h"
> -#include "buffer.h"
> -#include "log.h"
> -#include "tpmddl.h"
> -
> -// flag to track whether TDDL has been opened
> -static int g_TDDL_open = 0;
> -static int g_tx_fd = -1;              // the fd to the TPM
> -
> -#ifndef DUMMY_TPM
> - #define TPM_TX_FNAME "/dev/tpm0"
> - static int *g_rx_fdp = &g_tx_fd;
> -#else
> - #define TPM_TX_FNAME "/var/tpm/tpm_in.fifo"
> - #define TPM_RX_FNAME "/var/tpm/tpm_out.fifo"
> - static int g_rx_fd = -1;
> - static int *g_rx_fdp = &g_rx_fd;              // the fd to the TPM
> -#endif
> -
> -TPM_RESULT
> -TDDL_TransmitData( TDDL_BYTE* in,
> -                  TDDL_UINT32 insize,
> -                  TDDL_BYTE* out,
> -                  TDDL_UINT32* outsize) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -  TDDL_UINT32 i;
> -
> -  vtpmloginfo(VTPM_LOG_TXDATA, "Sending buffer = 0x");
> -  for(i = 0 ; i < insize ; i++)
> -    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", in[i]);
> -
> -  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> -
> -  ssize_t size = 0;
> -
> -  // send the request
> -  size = write (g_tx_fd, in, insize);
> -  if (size < 0) {
> -    vtpmlogerror(VTPM_LOG_TXDATA, "write() failed");
> -    ERRORDIE (TPM_IOERROR);
> -  }
> -  else if ((TDDL_UINT32) size < insize) {
> -    vtpmlogerror(VTPM_LOG_TXDATA, "Wrote %d instead of %d bytes!\n", (int) size, insize);
> -    // ... ?
> -  }
> -
> -  // read the response
> -  size = read (*g_rx_fdp, out, TCPA_MAX_BUFFER_LENGTH);
> -  if (size < 0) {
> -    vtpmlogerror(VTPM_LOG_TXDATA, "read() failed");
> -    ERRORDIE (TPM_IOERROR);
> -  }
> -
> -  vtpmloginfo(VTPM_LOG_TXDATA, "Receiving buffer = 0x");
> -  for(i = 0 ; i < size ; i++)
> -    vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out[i]);
> -
> -  vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> -
> -  *outsize = size;
> -  // close connection
> -  goto egress;
> -
> - abort_egress:
> - egress:
> -  return status;
> -}
> -
> -TPM_RESULT TDDL_Open() {
> -
> -  TDDL_RESULT status = TDDL_SUCCESS;
> -
> -  if (g_TDDL_open)
> -    return TPM_FAIL;
> -
> -#ifdef DUMMY_TPM
> -  *g_rx_fdp = open (TPM_RX_FNAME, O_RDWR);
> -#endif
> -
> -  g_tx_fd = open (TPM_TX_FNAME, O_RDWR);
> -  if (g_tx_fd < 0) {
> -    vtpmlogerror(VTPM_LOG_TXDATA, "TPM open failed");
> -    return TPM_IOERROR;
> -  }
> -
> -  g_TDDL_open = 1;
> -
> -  return status;
> -}
> -
> -void TDDL_Close() {
> -  if (! g_TDDL_open)
> -        return;
> -
> -  if (g_tx_fd>= 0) {
> -    if (close(g_tx_fd) < 0)
> -      vtpmlogerror(VTPM_LOG_TXDATA, "closeing tpm failed");
> -    g_tx_fd = -1;
> -  }
> -
> -  if (*g_rx_fdp>= 0) {
> -    if (close(*g_rx_fdp) < 0)
> -      vtpmlogerror(VTPM_LOG_TXDATA, "closeing tpm failed");
> -    *g_rx_fdp = -1;
> -  }
> -
> -  g_TDDL_open = 0;
> -
> -}
> diff --git a/tools/vtpm_manager/util/Makefile b/tools/vtpm_manager/util/Makefile
> deleted file mode 100644
> index 36bc38f..0000000
> --- a/tools/vtpm_manager/util/Makefile
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
> -
> -BIN            = libTCGUtils.a
> -
> -.PHONY: all
> -all: build
> -
> -.PHONY: build
> -build: $(BIN)
> -
> -.PHONY: install
> -install: build
> -
> -.PHONY: clean
> -clean:
> -       rm -f *.a *.so *.o *.rpm $(DEP_FILES)
> -
> -.PHONY: mrproper
> -mrproper: clean
> -       rm -f *~
> -
> -$(BIN): $(OBJS)
> -       $(AR) rcs $(BIN) $(OBJS)
> diff --git a/tools/vtpm_manager/util/bsg.c b/tools/vtpm_manager/util/bsg.c
> deleted file mode 100644
> index fa36ce7..0000000
> --- a/tools/vtpm_manager/util/bsg.c
> +++ /dev/null
> @@ -1,829 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// bsg.cpp
> -//
> -//  This file will handle all the TPM Byte Stream functions
> -//
> -// ==================================================================
> -
> -#include <stdio.h>
> -#include <string.h>
> -#include <stdarg.h>
> -#include <malloc.h>
> -#include "tcg.h"
> -#include "crypto.h"
> -#include "bsg.h"
> -#include "log.h"
> -
> -static int g_log_recursion_level = 0;
> -
> -// a largest buffer size. if we get a buf size bigger than this when unpacking,
> -// will complain!
> -#define BSG_MAX_BUF_SIZE (1<<18)
> -
> -#define bsglog(fmt, ...) do { \
> -    int __i; \
> -    for (__i=0; __i < g_log_recursion_level; __i++) {               \
> -      vtpmloginfomore (VTPM_LOG_BSG, "%s", "  ");                           \
> -    }                                                                 \
> -    vtpmloginfomore (VTPM_LOG_BSG, fmt, __VA_ARGS__);                         \
> -  } while (0)
> -
> -
> -// FIXME:  trigger the selfcheck--need to use glibc hook to do this
> -//BOOL dummy1 = BSG_static_selfcheck();
> -
> -
> -// Interpretting Types
> -// -------------------
> -//
> -// Incoming Types are composed of two parts {format, info} squished into a
> -// BSG_UINT32.  The first 4 bits is a format spec indicating what type of
> -// data it is.  If the first 4 bits are zero the info corresponds to a value in
> -// BSG_s_fmt[]. This is a structure whose composition is described in
> -// BSG_s_fmt[]. If the value is non-zero, info corresponds to the size of the
> -// data (in bytes) being passed in. For example a UINT32 being passed in would
> -// have a format of (__FMT_CONST | 4). If both, the format and info are zero,
> -// this is interpretted as the end of the structure, and the result is returned.
> -
> -// these flags are mutually exclusive, so I'll just make them
> -// format values which indicate the semantics of the 'info' part and the source
> -// data. The above description has been accordingly adjusted.
> -
> -// format values for determining what type of data the incoming type is
> -// it's a 4 bit value, occupying the high 4 bits
> -#define __FMT_CONST (1UL << 28) // Constant sized value
> -#define __FMT_DATA  (2UL << 28) // Believed to be raw data NOT {size,data}
> -#define __FMT_SIZE  (3UL << 28) // A size. Used in FMT_SIZE??_DATA.
> -#define __FMT_HSIZE (4UL << 28) // A number of handles
> -#define __FMT_PACKED (5UL << 28) // 'info' is unused; the source data consists
> -                                 // of {size32, data} but we're to pack only the
> -                                 // data as that is already packed, and so
> -                                 // can/must be unpacked without
> -                                 // explicitly reading it size
> -
> -#define __FMT_MASK  0x0FFFFFFFUL // this masks out the 4-bit format
> -#define __FMT_MASK_SIZE(type)   ((type) & __FMT_MASK)
> -#define __FMT_MASK_FORMAT(type) ((type) & (~__FMT_MASK))
> -
> -// constant (8/16/32-bits)
> -#define FMT_U8 (__FMT_CONST | 1UL)
> -#define FMT_U16 (__FMT_CONST | 2UL)
> -#define FMT_U32 (__FMT_CONST | 4UL)
> -
> -// const with a compiler-computed size
> -#define FMT_SIZEOF(type) (__FMT_CONST | sizeof(type))
> -
> -// other data (size bytes)
> -// Used primarily for DIGESTS -> FMT_DATA(20)
> -#define FMT_DATA(size) (__FMT_DATA | ((BSG_UINT32) (size) & __FMT_MASK))
> -
> -// 16/32-bit size followed by N bytes of data
> -#define FMT_SIZE16_DATA (__FMT_SIZE | 2UL)
> -#define FMT_SIZE32_DATA (__FMT_SIZE | 4UL)
> -
> -// 16-bit size followed by N key handles
> -#define FMT_SIZE16_HANDLES (__FMT_HSIZE | 2UL)
> -
> -#define DIGEST_SIZE 20
> -typedef BSG_UINT32 BSG_HANDLE;
> -
> -// TCPA_AUTH has 11 fields!
> -#define MAX_FIELDS 11
> -typedef struct BSG_Format
> -{
> -  BSG_Type type;
> -  const char* name;
> -  BSG_UINT32 fields[MAX_FIELDS + 1];
> -} BSG_Format;
> -
> -/*
> - * TCPA structure data formats
> - */
> -// this has to be manually kept in sync with the
> -// Type enum!! the static_selfcheck() function should be used regularly!
> -static BSG_Format s_fmt[] =
> -{
> -  {BSG_TYPE_UINT32, "BSG_TYPE_UINT32", {FMT_U32, 0}},
> -  {BSG_TYPE_UINT16, "BSG_TYPE_UINT16", {FMT_U16, 0}},
> -  {BSG_TYPE_BYTE, "BSG_TYPE_BYTE", {FMT_U8, 0}},
> -  {BSG_TYPE_BOOL, "BSG_TYPE_BOOL", {FMT_U8, 0}},
> -  {BSG_TPM_SIZE32_DATA, "BSG_TPM_SIZE32_DATA", {FMT_SIZE32_DATA, 0}},
> -  {BSG_TPM_TAG, "BSG_TPM_TAG", {FMT_SIZEOF(TPM_TAG), 0}},
> -  {BSG_TPM_HANDLE, "BSG_TPM_HANDLE", {FMT_SIZEOF(TPM_HANDLE), 0}},
> -  {BSG_TPM_RESULT, "BSG_TPM_RESULT", {FMT_SIZEOF(TPM_RESULT), 0}},
> -  {BSG_TPM_RESOURCE_TYPE, "BSG_TPM_RESOURCE_TYPE", {FMT_SIZEOF(TPM_RESOURCE_TYPE), 0}},
> -  {BSG_TPM_COMMAND_CODE, "BSG_TPM_COMMAND_CODE", {FMT_U32, 0}},
> -  {BSG_TPM_AUTH_DATA_USAGE, "BSG_TPM_AUTH_DATA_USAGE", {FMT_U8, 0}},
> -  {BSG_TPM_ALGORITHM_ID, "BSG_TPM_ALGORITHM_ID", {FMT_U32, 0}},
> -  {BSG_TPM_PROTOCOL_ID, "BSG_TPM_PROTOCOL_ID", {FMT_SIZEOF(TPM_PROTOCOL_ID), 0}},
> -  {BSG_TPM_KEY_USAGE, "BSG_TPM_KEY_USAGE", {FMT_U16, 0}},
> -  {BSG_TPM_ENC_SCHEME, "BSG_TPM_ENC_SCHEME", {FMT_U16, 0}},
> -  {BSG_TPM_SIG_SCHEME, "BSG_TPM_SIG_SCHEME", {FMT_U16, 0}},
> -  {BSG_TPM_MIGRATE_SCHEME, "BSG_TPM_MIGRATE_SCHEME", {FMT_U16, 0}},
> -  {BSG_TPM_KEY_FLAGS, "BSG_TPM_KEY_FLAGS", {FMT_U32, 0}},
> -
> -  {BSG_TPM_AUTHDATA, "BSG_TPM_AUTHDATA", {FMT_DATA(DIGEST_SIZE), 0}},
> -  {BSG_TPM_SECRET, "BSG_TPM_SECRET", {BSG_TPM_AUTHDATA, 0}},
> -  {BSG_TPM_ENCAUTH, "BSG_TPM_ENCAUTH", {BSG_TPM_AUTHDATA, 0}},
> -  {BSG_TPM_PAYLOAD_TYPE, "BSG_TPM_PAYLOAD_TYPE", {FMT_SIZEOF(TPM_PAYLOAD_TYPE), 0}},
> -
> -  {BSG_TPM_VERSION, "BSG_TPM_VERSION", {FMT_DATA(4), 0}}, // vers 1.2
> -  {BSG_TPM_DIGEST, "BSG_TPM_DIGEST", {FMT_DATA(DIGEST_SIZE), 0}},
> -  {BSG_TPM_COMPOSITE_HASH, "BSG_TPM_COMPOSITE_HASH", {BSG_TPM_DIGEST, 0}},
> -  {BSG_TPM_CHOSENID_HASH, "BSG_TPM_CHOSENID_HASH", {BSG_TPM_DIGEST, 0}},
> -
> -  {BSG_TPM_NONCE, "BSG_TPM_NONCE", {FMT_DATA(DIGEST_SIZE), 0}},
> -  {BSG_TPM_KEY_HANDLE, "BSG_TPM_KEY_HANDLE", {FMT_SIZEOF(TPM_KEY_HANDLE), 0}},
> -  {BSG_TPM_KEY_HANDLE_LIST, "BSG_TPM_KEY_HANDLE_LIST",
> -   {FMT_SIZE16_HANDLES, 0}},
> -
> -  {BSG_TPM_KEY_PARMS, "BSG_TPM_KEY_PARMS", {
> -      BSG_TPM_ALGORITHM_ID,
> -      BSG_TPM_ENC_SCHEME,
> -      BSG_TPM_SIG_SCHEME,
> -      FMT_SIZE32_DATA,
> -      0}},
> -  {BSG_TPM_RSA_KEY_PARMS, "BSG_TPM_RSA_KEY_PARMS", {
> -      FMT_U32, FMT_U32, FMT_SIZE32_DATA, 0}},
> -  {BSG_TPM_STORE_PUBKEY, "BSG_TPM_STORE_PUBKEY", {FMT_SIZE32_DATA, 0}},
> -  {BSG_TPM_PUBKEY, "BSG_TPM_PUBKEY", {BSG_TPM_KEY_PARMS, BSG_TPM_STORE_PUBKEY, 0}},
> -  {BSG_TPM_KEY, "BSG_TPM_KEY", {
> -      BSG_TPM_VERSION,
> -      BSG_TPM_KEY_USAGE,
> -      BSG_TPM_KEY_FLAGS,
> -      BSG_TPM_AUTH_DATA_USAGE,
> -      BSG_TPM_KEY_PARMS,
> -      FMT_SIZE32_DATA,        // the PCR_INFO
> -      BSG_TPM_STORE_PUBKEY,
> -      FMT_SIZE32_DATA,        // the encrypted part
> -      0}},
> -
> -  {BSG_TPM_MIGRATIONKEYAUTH, "BSG_TPM_MIGRATIONKEYAUTH", {
> -      BSG_TPM_PUBKEY,
> -      BSG_TPM_MIGRATE_SCHEME,
> -      BSG_TPM_DIGEST, 0}},
> -
> -  {BSG_TCPA_AUDIT_EVENT, "TCPA_AUDIT_EVENT", {
> -      BSG_TPM_COMMAND_CODE,
> -      BSG_TPM_RESULT, 0 }},
> -
> -  {BSG_TCPA_EVENT_CERT, "TCPA_EVENT_CERT", {
> -      BSG_TPM_DIGEST,
> -      BSG_TPM_DIGEST,
> -      FMT_DATA(2),
> -      FMT_SIZE32_DATA, 0}},
> -
> -  {BSG_TPM_PCR_SELECTION, "BSG_TPM_PCR_SELECTION", {FMT_SIZE16_DATA, 0} },
> -  {BSG_TPM_PCR_COMPOSITE, "BSG_TPM_PCR_COMPOSITE", { BSG_TPM_PCR_SELECTION,
> -                                                    FMT_SIZE32_DATA,
> -                                                    0} },
> -
> -  {BSG_TPM_PCR_INFO, "BSG_TPM_PCR_INFO", { BSG_TPM_PCR_SELECTION,
> -                                          BSG_TPM_COMPOSITE_HASH,
> -                                          BSG_TPM_COMPOSITE_HASH,
> -                                          0} },
> -
> -
> -  {BSG_TPM_STORED_DATA, "BSG_TPM_STORED_DATA", {
> -      BSG_TPM_VERSION,
> -      FMT_SIZE32_DATA,
> -      FMT_SIZE32_DATA,
> -      0}},
> -  {BSG_TPM_SYMMETRIC_KEY, "BSG_TPM_SYMMETRIC_KEY", {
> -      BSG_TPM_ALGORITHM_ID,
> -      BSG_TPM_ENC_SCHEME,
> -      FMT_SIZE16_DATA,
> -      0}},
> -  {BSG_TPM_STORE_PRIVKEY, "BSG_TPM_STORE_PRIVKEY", {FMT_SIZE32_DATA, 0}},
> -  {BSG_TPM_STORE_ASYMKEY, "BSG_TPM_STORE_ASYMKEY", {
> -      BSG_TPM_PAYLOAD_TYPE,
> -      BSG_TPM_SECRET,
> -      BSG_TPM_SECRET,
> -      BSG_TPM_DIGEST,
> -      BSG_TPM_STORE_PRIVKEY,
> -      0}},
> -  {BSG_TPM_MIGRATE_ASYMKEY, "BSG_TPM_MIGRATE_ASYMKEY", {
> -      BSG_TPM_PAYLOAD_TYPE,
> -      BSG_TPM_SECRET,
> -      BSG_TPM_DIGEST,
> -      FMT_U32,
> -      BSG_TPM_STORE_PRIVKEY,
> -      0}},
> -
> -  {BSG_TPM_QUOTE_INFO, "BSG_TPM_QUOTE_INFO", {
> -      BSG_TPM_VERSION,
> -      FMT_DATA(4),
> -      BSG_TPM_COMPOSITE_HASH,
> -      BSG_TPM_NONCE,
> -      0}},
> -
> -  {BSG_TPM_IDENTITY_CONTENTS, "BSG_TPM_IDENTITY_CONTENTS", {
> -      BSG_TPM_VERSION,
> -      FMT_U32,
> -      BSG_TPM_CHOSENID_HASH,
> -      BSG_TPM_PUBKEY,
> -      0}},
> -
> -  {BSG_TPM_PCRVALUE, "BSG_TPM_PCRVALUE", {FMT_DATA(DIGEST_SIZE), 0}},
> -
> -  {BSG_TCPA_PCR_FLAGS, "TCPA_PCR_FLAGS", {
> -      FMT_U8,
> -      FMT_U8,
> -      0}},
> -
> -  {BSG_TCS_AUTH, "TCS_AUTH", {
> -      BSG_TYPE_UINT32,
> -      BSG_TPM_NONCE,
> -      BSG_TPM_NONCE,
> -      BSG_TYPE_BOOL,
> -      BSG_TPM_AUTHDATA,
> -      0}},
> -
> -  {BSG_TPM_KEY_NONSENSITIVE, "BSG_TPM_KEY_NONSENSITIVE", {
> -      BSG_TPM_VERSION,
> -      BSG_TPM_KEY_USAGE,
> -      BSG_TPM_KEY_FLAGS,
> -      BSG_TPM_AUTH_DATA_USAGE,
> -      BSG_TPM_KEY_PARMS,
> -      FMT_SIZE32_DATA,
> -      BSG_TPM_STORE_PUBKEY,
> -      0}},
> -
> -  {BSG_PACKED, "BSG_PACKED", {
> -      __FMT_PACKED,
> -      0 }},
> -
> -  {BSG_TYPE_MAX, "", {0}},
> -};
> -
> -
> -static const BSG_Format* find_format (BSG_Type t) {
> -  BSG_Format * f = s_fmt;
> -
> -  if (t >= BSG_TYPE_MAX) {
> -    return NULL;
> -  }
> -
> -  // WARNING: this depends on the enum and s_fmt[] array being in sync! make
> -  // sure to run the static_selfcheck() to make sure
> -  f = s_fmt + (t - BSG_TYPE_FIRST);
> -
> -  return f;
> -}
> -
> -//
> -// a consistency-checking routine which can be run at compile time
> -// (ie. immediately after compilation)
> -//
> -// tasks:
> -// - verify that s_fmt has one entry per Type t, and that entry is at s_fmt[t]
> -//
> -// conditions:
> -// - need that s_fmt[0] is the first type listed in the Type enum! ie the first
> -//   Type has value 0, not 1
> -//
> -// FIXME: should have a function be passed in here which is called if the test
> -// fails. Then the caller can decide what to do: abort, notify, whatever
> -//
> -BOOL BSG_static_selfcheck ()
> -{
> -  int i;
> -
> -  for (i=BSG_TYPE_FIRST; i <= BSG_TYPE_MAX; i++) {
> -    if (s_fmt[i - BSG_TYPE_FIRST].type != i) {
> -      bsglog ("%s\n", "BSG: static_selfcheck failed!\n");
> -      bsglog ("failure at %i, allegedly %s\n",
> -             i, s_fmt[i - BSG_TYPE_FIRST].name);
> -      abort();
> -      return FALSE;
> -    }
> -  }
> -
> -  bsglog ("%s\n", "BSG: static_selfcheck success!");
> -  return TRUE;
> -}
> -
> -
> -/**
> - * Flatten a TCPA structure into a buffer in big-endian format
> - * @type: TCPA structure type
> - * @src: (IN) TCPA structure (OUT) end of TCPA structure
> - * @dst: (OUT) flattened data
> - * Returns: Flattened size or -1 for unknown types
> - */
> -// make it so that it can just run through the whole process and return
> -// the packed size, without packing anything. this will be done if dst is NULL.
> -static int BSG_Pack_private(BSG_Type type, const BSG_BYTE** src, BSG_BYTE* dst)
> -{
> -  // check incoming parameters
> -  if (*src == NULL)
> -    return 0;
> -
> -  const BSG_BYTE* s = *src;
> -  BSG_BYTE* d = dst;
> -
> -  BSG_UINT32 size   = __FMT_MASK_SIZE(type);
> -  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
> -
> -  if (format == __FMT_CONST) // We are dealing with a fixed length value eg. UINT32
> -    {
> -      BSG_UINT32 val = 0;
> -      switch (size) {
> -      case 1: val = * (BYTE*) s; break;
> -      case 2: val = * (unsigned short*) s; break;
> -      case 4: val = * (BSG_UINT32*) s; break;
> -      }
> -      if (dst)
> -       BSG_PackConst(val, size, d);
> -
> -      s += size;
> -      d += size;
> -    } else if (format == __FMT_DATA) { // We are dealing with raw data. Not sure when
> -    // this is used.
> -
> -      if (dst) {
> -        bsglog ("BSG: __FMT_DATA size %d, src %p, dst %p\n", size, s, d);
> -        memcpy(d, s, size);
> -      }
> -
> -      s += size;
> -      d += size;
> -  } else if (format == __FMT_SIZE || format == __FMT_HSIZE) { // It's a size, followed by that much data or handles
> -
> -    BSG_UINT32 psize = 0;
> -    switch (size) {
> -    case 1: psize = * (BYTE*) s; break;
> -    case 2: psize = * (unsigned short*) s; break;
> -    case 4: psize = * (BSG_UINT32*) s; break;
> -    }
> -
> -    if (dst)
> -      BSG_PackConst(psize, size, d);
> -
> -    s += size;
> -    d += size;
> -
> -    // now 's' points to an address, so cast it to BSG_BYTE**
> -    const BSG_BYTE* pdata = * ((BSG_BYTE**) s);
> -    s += sizeof(BSG_BYTE*);
> -
> -    if (format == __FMT_HSIZE) {// This is a list of psize Handles
> -      if (dst) {
> -       BSG_HANDLE* d2 = (BSG_HANDLE*) d;
> -       BSG_HANDLE* p2 = (BSG_HANDLE*) pdata;
> -       BSG_UINT32 i;
> -       for (i = 0; i < psize; i++)
> -         d2[i] = BSG_UnpackConst((BSG_BYTE*)(p2 + i), 4);
> -
> -      }
> -      d += psize * sizeof(BSG_HANDLE);
> -    } else {// If it's not psize handles, it's psize data.
> -      if (psize > 0) {
> -       if (dst) {
> -         bsglog ("BSG: __FMT_SIZE, size=%d, src=%p, dst=%p\n",
> -                 psize, pdata, d);
> -         memcpy(d, pdata, psize);
> -       }
> -      }
> -      d += psize;
> -    }
> -  } else if (format == __FMT_PACKED) {
> -    // the source buffer is a pack_constbuf_t, which has a size and a
> -    // pointer. just copy the buffer value, the size is not included in the
> -    // output stream.
> -    pack_constbuf_t * buf = (pack_constbuf_t*) s;
> -
> -    if (dst) {
> -      bsglog ("BSG: __FMT_PACKED, size=%d, src=%p, dst=%p\n",
> -             buf->size, buf->data, d);
> -      memcpy(d, buf->data, buf->size);
> -    }
> -
> -    s += buf->size;
> -    d += buf->size;
> -  } else if (format == 0) {// No flags are set. This is a structure & it should
> -                          // be looked up in the bsg_s_fmt[]
> -
> -    const BSG_Format* x = find_format (type);
> -    if (x == NULL) {
> -      vtpmloginfo(VTPM_LOG_BSG, "BSG_Pack: cannot find type %d\n", type);
> -      return -1;
> -    }
> -
> -    if (dst)
> -      bsglog ("BSG_Pack type %s\n", x->name);
> -
> -
> -    // iterate through the fields
> -    const BSG_UINT32* f = x->fields;
> -    for (; *f; f++) {
> -      int fsize;
> -
> -      g_log_recursion_level++;
> -      fsize = BSG_Pack_private((BSG_Type) *f, &s, dst ? d : NULL);
> -      g_log_recursion_level--;
> -
> -      if (fsize <= 0)
> -       return fsize;
> -
> -      d += fsize;
> -    }
> -  } else {
> -    vtpmlogerror(VTPM_LOG_BSG, "BSG_Pack(): Unknown format %d\n", format);
> -    return -1;
> -  }
> -
> -  *src = s;
> -  return (d - dst);
> -}
> -
> -/**
> - * Unflatten a TCPA structure from a buffer in big-endian format
> - * @type: TCPA structure type
> - * @src: flattened data
> - * @dst: (IN) TCPA structure (OUT) end of TCPA structure
> - * Returns: Flattened size
> - * Note: Returns flattened size NOT the unpacked structure size
> - */
> -static int BSG_Unpack_private(BSG_Type type, const BSG_BYTE* src, BSG_BYTE** dst) {
> -  // check incoming parameters
> -  if (src == NULL)
> -    return 0;
> -
> -
> -  const BSG_BYTE* s = src;
> -  BSG_BYTE* d = dst ? *dst:NULL;
> -  if (dst && !d)
> -    dst = NULL;
> -
> -  BSG_UINT32 size = __FMT_MASK_SIZE(type);
> -  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
> -
> -  if (format == __FMT_CONST) {// We are dealing with a fixed length value ie. UINT32
> -
> -    BSG_UINT32 val = BSG_UnpackConst(s, size);
> -
> -    if (dst) {
> -      switch (size) {
> -      case 1: *(BYTE *) d = (BSG_BYTE) val; break;
> -      case 2: *(unsigned short*) d = (unsigned short) val; break;
> -      case 4: *(BSG_UINT32*) d = (BSG_UINT32) val; break;
> -      }
> -    }
> -
> -    s += size;
> -    d += size;
> -  } else if (format == __FMT_DATA) {// We are dealing with raw data. Not sure when this is used.
> -    if (dst)
> -      memcpy(d, s, size);
> -
> -    d += size;
> -    s += size;
> -  } else if (format == __FMT_SIZE || format == __FMT_HSIZE) {// It's a size, followed by that much data or handles
> -
> -    BSG_UINT32 psize = BSG_UnpackConst(s, size);
> -
> -    if (psize > BSG_MAX_BUF_SIZE) {
> -      vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack runs into var-sized data bigger than %u bytes!!\n",
> -              BSG_MAX_BUF_SIZE);
> -      return -1;
> -    }
> -
> -    if (dst) {
> -      switch (size) {
> -      case 1: *(BYTE *) d = (BSG_BYTE) psize; break;
> -      case 2: *(unsigned short*) d = (unsigned short) psize; break;
> -      case 4: *(BSG_UINT32*) d = (BSG_UINT32) psize; break;
> -      }
> -    }
> -
> -    s += size;
> -    d += size;
> -
> -    BSG_BYTE* pdata = NULL;
> -
> -    if (psize) {
> -      if (format == __FMT_HSIZE) { // This is a list of psize Handles
> -       if (dst) {
> -         BSG_HANDLE* s2 = (BSG_HANDLE*) s;
> -         pdata = (BSG_BYTE *)malloc(psize * sizeof(BSG_HANDLE));
> -          if (!pdata)
> -            return -1;
> -
> -         BSG_HANDLE* p2 = (BSG_HANDLE*) pdata;
> -         BSG_UINT32 i;
> -         for (i = 0; i < psize; i++) {
> -           BSG_PackConst(s2[i], 4, (BSG_BYTE*)(p2 + i));
> -         }
> -       }
> -       s += psize * sizeof(BSG_HANDLE);
> -      } else { // If it's not psize handles, it's psize data.
> -       if (dst) {
> -         pdata = (BSG_BYTE *)malloc(sizeof(BSG_BYTE) * psize);
> -          if (!pdata)
> -            return -1;
> -         memcpy(pdata, s, psize);
> -       }
> -       s += psize;
> -      }
> -    }
> -    if (dst)
> -      *(void**) d = pdata;
> -
> -    d += sizeof(void*);
> -  } else if (format == __FMT_PACKED) {
> -
> -    // this doesn't make sense for unpacking!
> -    vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack() called with format __FMT_PACKED. "
> -                                                          "This does not make sense\n");
> -
> -    return -1;
> -  } else if (format == 0) {// No flags are set. This is a structure & it should
> -                          // be looked up in the bsg_s_fmt[]
> -
> -    const BSG_Format* x = find_format (type);
> -    if (x == NULL) {
> -      vtpmlogerror(VTPM_LOG_BSG, "BSG_Unpack: cannot find type %d\n", type);
> -      return -1;
> -    }
> -
> -    const BSG_UINT32* f = x->fields;
> -    for (; *f; f++) {
> -      int fsize = BSG_Unpack_private((BSG_Type) *f, s, dst ? &d:NULL);
> -      if (fsize <= 0)
> -       return fsize;
> -      s += fsize;
> -    }
> -  }
> -
> -  if (dst)
> -    *dst = d;
> -  return (s - src);
> -}
> -
> -/**
> - * Free memory associated with unpacked TCPA structure
> - * @type: TCPA structure type
> - * @src: (IN) TCPA structure (OUT) end of TCPA structure
> - * Note: Destroy should be called on all structures created with Unpack
> - *       to ensure that any allocated memory is freed
> - */
> -static void BSG_Destroy_private(BSG_Type type, BSG_BYTE** src) {
> -  BSG_BYTE* s = *src;
> -
> -  BSG_UINT32 size = __FMT_MASK_SIZE(type);
> -  BSG_UINT32 format = __FMT_MASK_FORMAT(type);
> -
> -  if ((src == NULL) || (*src == NULL)) {
> -        vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy() called with NULL src\n");
> -    return;
> -  }
> -
> -  if (format == __FMT_CONST || format == __FMT_DATA)
> -    s += size;
> -  else if (format == __FMT_SIZE || format == __FMT_HSIZE) {
> -    s += size;
> -    BSG_BYTE* ptr = *(BSG_BYTE**) s;
> -    free(ptr);
> -    s += sizeof(void*);
> -  } else if (format == __FMT_PACKED) {
> -
> -    // this doesn't make sense for unpacking, hence also for Destroy()
> -    vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy() called with format __FMT_PACKED. "
> -                                                          "This does not make sense\n");
> -
> -    return;
> -  } else if (format == 0) {
> -    const BSG_Format* x = find_format (type);
> -    if (x == NULL) {
> -      vtpmlogerror(VTPM_LOG_BSG, "BSG_Destroy: cannot find type %d\n", type);
> -      return;
> -    }
> -
> -    const BSG_UINT32* f = x->fields;
> -    for (; *f; f++)
> -      BSG_Destroy_private((BSG_Type) *f, &s);
> -  }
> -
> -  *src = s;
> -}
> -
> -int BSG_Pack(BSG_Type type, const void* src, BSG_BYTE* dst)
> -{
> -  const BSG_BYTE* src2 = (const BSG_BYTE*) src;
> -  return BSG_Pack_private(type, &src2, dst);
> -}
> -
> -int BSG_Unpack(BSG_Type type, const BSG_BYTE* src, void* dst)
> -{
> -  BSG_BYTE* dst2 = (BSG_BYTE*) dst;
> -  return BSG_Unpack_private(type, src, dst ? &dst2:NULL);
> -}
> -
> -void BSG_Destroy(BSG_Type type, void* src)
> -{
> -  BSG_BYTE* src2 = (BSG_BYTE*) src;
> -  BSG_Destroy_private(type, &src2);
> -}
> -
> -/**
> - * Pack a 8/16/32-bit constant into a buffer in big-endian format
> - * @val: constant value
> - * @size: constant size in bytes (1, 2, or 4)
> - * @dst: (OUT) buffer
> - */
> -void BSG_PackConst(BSG_UINT32 val, int size, BSG_BYTE* dst) {
> -  bsglog ("BSG: PackConst on %d of size %i into address %p\n", val, size, dst);
> -
> -  switch (size) {
> -  case 4:
> -    dst[0] = (BSG_BYTE)((val >> 24) & 0xff);
> -    dst[1] = (BSG_BYTE)((val >> 16) & 0xff);
> -    dst[2] = (BSG_BYTE)((val >> 8) & 0xff);
> -    dst[3] = (BSG_BYTE)(val & 0xff);
> -    break;
> -  case 2:
> -    dst[0] = (BSG_BYTE)((val >> 8) & 0xff);
> -    dst[1] = (BSG_BYTE)(val & 0xff);
> -    break;
> -  case 1:
> -    dst[0] = (BSG_BYTE)(val & 0xff);
> -    break;
> -  }
> -}
> -
> -/**
> - * Unpack a 8/16/32-bit constant from a buffer in big-endian format
> - * @src: buffer
> - * @size: constant size in bytes (1, 2, or 4)
> - */
> -BSG_UINT32 BSG_UnpackConst(const BSG_BYTE* src, int size) {
> -  BSG_UINT32 val = 0;
> -
> -  if (src == NULL)
> -    return 0;
> -
> -  switch (size) {
> -  case 4:
> -    val = (((BSG_UINT32) src[0]) << 24
> -          | ((BSG_UINT32) src[1]) << 16
> -          | ((BSG_UINT32) src[2]) << 8
> -          | (BSG_UINT32) src[3]);
> -    break;
> -  case 2:
> -    val = (((BSG_UINT32) src[0]) << 8 | (BSG_UINT32) src[1]);
> -    break;
> -  case 1:
> -    val = (BSG_UINT32) src[0];
> -    break;
> -  }
> -  return val;
> -}
> -
> -// Pack a list of parameters. Beware not to send values, but rather you must
> -// send a pointer to your values Instead. This includes UINT32's.
> -int BSG_PackList( BSG_BYTE* dst, int ParamCount, ... ) {
> -  int ParamNumber;
> -  BSG_Type format;
> -  BSG_BYTE* val = NULL;
> -  int size=0;
> -
> -  va_list paramList;
> -  va_start( paramList, ParamCount );
> -
> -  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
> -    //Strangeness with int is because gcc wanted an int rather than a enum of ints.
> -    format =  (BSG_Type) va_arg( paramList, int );
> -    val = va_arg( paramList, BSG_BYTE* );
> -    size += BSG_Pack(format, val, dst == NULL ? NULL : dst + size);
> -  }
> -
> -  va_end (paramList);
> -
> -  return size;
> -}
> -
> -// Unpack a list of parameters.
> -int BSG_UnpackList( const BSG_BYTE* src, int ParamCount, ... ) {
> -  int ParamNumber = 0;
> -  BSG_Type format;
> -  BSG_BYTE* val = NULL;
> -  int size = 0;
> -
> -  va_list paramList;
> -  va_start( paramList, ParamCount );
> -
> -  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
> -    format = (BSG_Type) va_arg( paramList, int );
> -    val  = va_arg( paramList, BSG_BYTE* );
> -
> -    size += BSG_Unpack(format, src + size, val);
> -  }
> -
> -  va_end( paramList );
> -
> -  return size;
> -}
> -
> -// Destroy any memory allocated by calls to unpack
> -void BSG_DestroyList(int ParamCount, ... ) {
> -  int ParamNumber = 0;
> -  BSG_Type argType;
> -  BSG_BYTE* paramValue = NULL;
> -
> -  va_list paramList;
> -  va_start( paramList, ParamCount );
> -
> -  for( ParamNumber = 1; ParamNumber <= ParamCount; ParamNumber++) {
> -    argType = (BSG_Type) va_arg( paramList, int );
> -    paramValue  = va_arg( paramList, BSG_BYTE* );
> -
> -    BSG_Destroy(argType, paramValue);
> -  }
> -
> -  va_end( paramList );
> -
> -  return;
> -}
> -
> -
> -// and a tuple version
> -TPM_RESULT BSG_DestroyTuple (int numParams, pack_tuple_t params[]) {
> -  int i;
> -
> -  for (i = 0; i < numParams; i++)
> -    BSG_Destroy (params[i].type, params[i].addr);
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -//
> -// wrappers of Pack and PackList which malloc the ouput buffer. to be freed
> -// by the caller later
> -//
> -
> -int BSG_PackMalloc (BSG_Type type, const void* src, BSG_BYTE** o_dst) {
> -  int size = BSG_Pack (type, src, NULL);
> -  BSG_BYTE * dest = (BSG_BYTE*) malloc (size);
> -  if (dest == NULL)
> -    return -1;
> -
> -  size = BSG_Pack(type, src, dest);
> -  *o_dst = dest;
> -  return size;
> -}
> -
> -
> -
> -int BSG_PackListMalloc(BSG_BYTE** outBuffer, int ParamCount, ... ) {
> -  va_list args;
> -  int size;
> -
> -  va_start (args, ParamCount);
> -  size = BSG_PackList (NULL, ParamCount, args);
> -  va_end (args);
> -
> -  BSG_BYTE * dest = (BSG_BYTE*) malloc (size);
> -  if (dest == NULL)
> -    return -1;
> -
> -  va_start (args, ParamCount);
> -  size = BSG_PackList (dest, ParamCount, args);
> -  va_end (args);
> -
> -  *outBuffer = dest;
> -  return size;
> -}
> diff --git a/tools/vtpm_manager/util/bsg.h b/tools/vtpm_manager/util/bsg.h
> deleted file mode 100644
> index 0896812..0000000
> --- a/tools/vtpm_manager/util/bsg.h
> +++ /dev/null
> @@ -1,166 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// bsg.h
> -//
> -//  This file contains API's for the TPM Byte Stream functions
> -//
> -// ==================================================================
> -
> -#ifndef __BSG_H__
> -#define __BSG_H__
> -
> -#include <stdarg.h>
> -#include "buffer.h"
> -
> -typedef unsigned int BSG_UINT32;
> -typedef unsigned char BSG_BYTE;
> -
> -// forward decl
> -struct pack_const_tuple_t;
> -
> -struct pack_tuple_t;
> -
> -
> -/**
> - * Byte stream generator
> - */
> -// this has to be manually kept in sync with the
> -// s_fmt array!!
> -// but now we have a self-check function which can make sure things are well
> -// (if used!)
> -typedef enum BSG_Type
> -{
> -  BSG_TYPE_FIRST = 1,
> -  BSG_TYPE_UINT32 = 1, // start at 1 so that Type 0 only serves as an
> -                       // unused/special value
> -  BSG_TYPE_UINT16,
> -  BSG_TYPE_BYTE,
> -  BSG_TYPE_BOOL,
> -  BSG_TPM_SIZE32_DATA,  // a 32 bit unsigned size, followed by
> -                        // a pointer to that much data. can pass a
> -                        // struct pack_buf_t as the param
> -  BSG_TPM_TAG,
> -  BSG_TPM_HANDLE,
> -  BSG_TPM_RESULT,
> -  BSG_TPM_RESOURCE_TYPE,
> -  BSG_TPM_COMMAND_CODE,
> -  BSG_TPM_AUTH_DATA_USAGE,
> -  BSG_TPM_ALGORITHM_ID,
> -  BSG_TPM_PROTOCOL_ID,
> -  BSG_TPM_KEY_USAGE,
> -  BSG_TPM_ENC_SCHEME,
> -  BSG_TPM_SIG_SCHEME,
> -  BSG_TPM_MIGRATE_SCHEME,
> -  BSG_TPM_KEY_FLAGS,
> -  BSG_TPM_AUTHDATA,
> -  BSG_TPM_SECRET,
> -  BSG_TPM_ENCAUTH,
> -  BSG_TPM_PAYLOAD_TYPE,
> -
> -  BSG_TPM_VERSION,
> -  BSG_TPM_DIGEST,
> -  BSG_TPM_COMPOSITE_HASH,
> -  BSG_TPM_CHOSENID_HASH,
> -  BSG_TPM_NONCE,
> -  BSG_TPM_KEY_HANDLE,
> -  BSG_TPM_KEY_HANDLE_LIST,
> -  BSG_TPM_KEY_PARMS,
> -  BSG_TPM_RSA_KEY_PARMS,
> -  BSG_TPM_STORE_PUBKEY,
> -  BSG_TPM_PUBKEY,
> -  BSG_TPM_KEY,
> -
> -  BSG_TPM_MIGRATIONKEYAUTH,
> -  BSG_TCPA_AUDIT_EVENT,
> -  BSG_TCPA_EVENT_CERT,
> -  BSG_TPM_PCR_SELECTION,
> -  BSG_TPM_PCR_COMPOSITE,
> -  BSG_TPM_PCR_INFO,
> -  BSG_TPM_STORED_DATA,
> -  BSG_TPM_SYMMETRIC_KEY,
> -  BSG_TPM_STORE_PRIVKEY,
> -  BSG_TPM_STORE_ASYMKEY,
> -  BSG_TPM_MIGRATE_ASYMKEY,
> -  BSG_TPM_QUOTE_INFO,
> -  BSG_TPM_IDENTITY_CONTENTS,
> -  BSG_TPM_PCRVALUE,
> -  BSG_TCPA_PCR_FLAGS,
> -  BSG_TCS_AUTH,
> -
> -  // this is the BSG_TPM_KEY struct without the encData field
> -  BSG_TPM_KEY_NONSENSITIVE,
> -
> -  BSG_PACKED,
> -
> -  BSG_TYPE_MAX
> -} BSG_Type;
> -
> -struct pack_const_tuple_t {
> -  BSG_Type type;
> -  const void * addr;
> -};
> -
> -
> -typedef struct pack_tuple_t {
> -  BSG_Type type;
> -  void * addr;
> -} pack_tuple_t;
> -
> -int BSG_Pack(BSG_Type type, const void* src, BSG_BYTE* dst);
> -int BSG_Unpack(BSG_Type type, const BSG_BYTE* src, void* dst);
> -void BSG_Destroy(BSG_Type type, void* src);
> -
> -// wrappers of Pack and PackList which malloc the ouput buffer. to be freed
> -// by the caller later. returns size of allocated buffer, or -1 in case
> -// allocation failed
> -int BSG_PackMalloc (BSG_Type type, const void* src, BSG_BYTE** o_dst);
> -int BSG_PackListMalloc (BSG_BYTE** outBuffer, int ParamCount, ... );
> -
> -// a va_list version of PackList
> -int BSG_PackList(BSG_BYTE* outBuffer, int ParamCount, ... );
> -int BSG_UnpackList(const BSG_BYTE* inBuffer, int ParamCount, ... );
> -void BSG_DestroyList(int ParamCount, ... );
> -
> -// wrapper of PackList which uses a buffer_t
> -TPM_RESULT BSG_PackListBuf (buffer_t * o_buf, int ParamCount, ...);
> -
> -// and a tuple version
> -TPM_RESULT BSG_DestroyTuple (int numParams, pack_tuple_t params[]);
> -
> -void BSG_PackConst(BSG_UINT32 val, int size, BSG_BYTE* dst);
> -BSG_UINT32 BSG_UnpackConst(const BSG_BYTE* src, int size);
> -
> -BOOL BSG_static_selfcheck ();
> -
> -#endif
> diff --git a/tools/vtpm_manager/util/buffer.c b/tools/vtpm_manager/util/buffer.c
> deleted file mode 100644
> index df48bc2..0000000
> --- a/tools/vtpm_manager/util/buffer.c
> +++ /dev/null
> @@ -1,226 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -
> -#include <stdarg.h>
> -#include <string.h>
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <sys/param.h>
> -
> -#include "tcg.h"
> -#include "bsg.h"
> -#include "buffer.h"
> -
> -static TPM_RESULT buffer_priv_realloc (buffer_t * buf, tpm_size_t newsize);
> -
> -//
> -// buffer functions!
> -//
> -
> -TPM_RESULT buffer_init (buffer_t * buf, tpm_size_t initsize, const BYTE* initval) {
> -  if (initsize == 0) {
> -    memset(buf, 0, sizeof(*buf));
> -    return TPM_SUCCESS;
> -  }
> -
> -
> -  buf->bytes = (BYTE*) malloc (initsize);
> -  if (buf->bytes == NULL)
> -    return TPM_RESOURCES;
> -
> -  buf->size = initsize;
> -  buf->alloc_size = initsize;
> -
> -  if (initval)
> -    memcpy (buf->bytes, initval, initsize);
> -
> -  buf->is_owner = TRUE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -TPM_RESULT buffer_init_convert (buffer_t * buf, tpm_size_t initsize, BYTE* initval) {
> -
> -  buf->size = initsize;
> -  buf->alloc_size = initsize;
> -  buf->bytes = initval;
> -
> -  buf->is_owner = TRUE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -TPM_RESULT buffer_init_copy (buffer_t * buf, const buffer_t * src) {
> -  TPM_RESULT status = buffer_init (buf, src->size, src->bytes);
> -  buf->is_owner = TRUE;
> -
> -  return status;
> -}
> -
> -
> -
> -// make an alias to a constant array
> -TPM_RESULT buffer_init_const (buffer_t * buf, tpm_size_t size, const BYTE* val) {
> -  // TODO: try to enforce the const things somehow!
> -  buf->bytes = (BYTE*) val;
> -  buf->size = size;
> -  buf->alloc_size = 0;        // this field is now unneeded
> -
> -  buf->is_owner = FALSE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -// make an alias into buf, with given offset and length
> -// if len = 0, make the alias go to the end of buf
> -TPM_RESULT buffer_init_alias (buffer_t * buf, const buffer_t * b,
> -                              tpm_size_t offset, tpm_size_t len) {
> -  if (offset + len > b->size) {
> -    return TPM_NOSPACE;
> -  }
> -
> -  buf->bytes = b->bytes + offset;
> -  buf->size = len > 0 ? len : b->size - offset;
> -
> -  //VS/ buf->alloc_size = 0;
> -  if (len ==0)
> -    buf->alloc_size = b->alloc_size - offset;
> -  else
> -    buf->alloc_size = MIN(b->alloc_size - offset, len);
> -
> -
> -  buf->is_owner = FALSE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -// make an alias buffer_t into bytestream, with given length
> -TPM_RESULT buffer_init_alias_convert (buffer_t * buf, tpm_size_t size, BYTE* val) {
> -
> -  buf->size = size;
> -  buf->alloc_size = size;
> -  buf->bytes = val;
> -
> -  buf->is_owner = FALSE;
> -
> -  return TPM_SUCCESS;
> -}
> -
> -
> -
> -// copy into the start of dest
> -TPM_RESULT buffer_copy (buffer_t * dest, const buffer_t* src)
> -{
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  if (dest->alloc_size < src->size) {
> -    TPMTRYRETURN( buffer_priv_realloc (dest, src->size) );
> -  }
> -
> -  memcpy (dest->bytes, src->bytes, src->size);
> -  dest->size = src->size;
> -
> -  //VS/ dest->is_owner = TRUE;
> -
> - abort_egress:
> -
> -  return status;
> -}
> -
> -
> -
> -BOOL buffer_eq (const buffer_t * a, const buffer_t * b) {
> -  return (a->size == b->size && memcmp (a->bytes, b->bytes, a->size) == 0);
> -}
> -
> -
> -void buffer_memset (buffer_t * buf, BYTE b) {
> -  memset (buf->bytes, b, buf->size);
> -}
> -
> -
> -TPM_RESULT buffer_append_raw (buffer_t * buf, tpm_size_t len, const BYTE* bytes) {
> -  TPM_RESULT status = TPM_SUCCESS;
> -
> -  if (buf->alloc_size < buf->size + len) {
> -    TPMTRYRETURN( buffer_priv_realloc (buf, buf->size + len) );
> -  }
> -
> -  memcpy (buf->bytes + buf->size, bytes, len);
> -
> -  buf->size += len;
> -
> -  goto egress;
> -
> - abort_egress:
> -
> - egress:
> -
> -  return status;
> -}
> -
> -tpm_size_t buffer_len (const buffer_t* buf) {
> -  return buf->size;
> -}
> -
> -TPM_RESULT buffer_free (buffer_t * buf) {
> -  if (buf && buf->is_owner && buf->bytes != NULL) {
> -    free (buf->bytes);
> -    buf->bytes = NULL;
> -    buf->size = buf->alloc_size = 0;
> -
> -  }
> -
> -  return TPM_SUCCESS;
> -}
> -
> -TPM_RESULT buffer_priv_realloc (buffer_t * buf, tpm_size_t newsize) {
> -
> -  // we want to realloc to twice the size, or the new size, whichever
> -  // bigger
> -
> -  BYTE * tmpbuf = NULL;
> -
> -  newsize = MAX (buf->alloc_size * 2, newsize);
> -
> -  tmpbuf = (BYTE*) realloc (buf->bytes, newsize);
> -  if (tmpbuf == NULL)
> -    return TPM_SIZE;
> -
> -
> -  buf->bytes = tmpbuf;
> -  buf->alloc_size = newsize;
> -
> -  return TPM_SUCCESS;
> -}
> diff --git a/tools/vtpm_manager/util/buffer.h b/tools/vtpm_manager/util/buffer.h
> deleted file mode 100644
> index d8a9abc..0000000
> --- a/tools/vtpm_manager/util/buffer.h
> +++ /dev/null
> @@ -1,95 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#ifndef __VTPM_BUFFER_H__
> -#define __VTPM_BUFFER_H__
> -
> -#include <stddef.h>             // for pointer NULL
> -#include "tcg.h"
> -
> -typedef UINT32 tpm_size_t;
> -
> -// first version, probably will be expanded...
> -
> -#define NULL_BUF {0,0,0,0}
> -
> -typedef struct {
> -  // private!!
> -  tpm_size_t size, alloc_size;
> -  BYTE * bytes;
> -
> -  BOOL is_owner;              // do we own this buffer, and need to free it?
> -} buffer_t;
> -
> -// allocate the buffer if initsize > 0, copying over initval if provided
> -TPM_RESULT buffer_init (buffer_t * buf,
> -                        tpm_size_t initsize,
> -                        const BYTE* initval);
> -
> -// Create a new buffer from a BYTE *. Use buffer_free to destroy original BYTE *
> -TPM_RESULT buffer_init_convert (buffer_t * buf,
> -                                tpm_size_t initsize,
> -                                BYTE* initval);
> -
> -// make an alias to a constant array, no copying
> -TPM_RESULT buffer_init_const (buffer_t * buf, tpm_size_t size, const BYTE* val);
> -
> -// make an alias into buf, with given offset and length
> -// if len = 0, make the alias go to the end of buf
> -TPM_RESULT buffer_init_alias (buffer_t * buf, const buffer_t * b,
> -                              tpm_size_t offset, tpm_size_t);
> -
> -// make an alias buffer into a bytestream
> -TPM_RESULT buffer_init_alias_convert (buffer_t * buf,
> -                                      tpm_size_t size, BYTE* val);
> -
> -// "copy constructor"
> -TPM_RESULT buffer_init_copy (buffer_t * buf, const buffer_t * src);
> -
> -
> -// copy into the start of a
> -TPM_RESULT buffer_copy (buffer_t * dest, const buffer_t* src);
> -
> -// are they equal?
> -BOOL buffer_eq (const buffer_t * a, const buffer_t * b);
> -
> -// set the buffer to a constant byte
> -void buffer_memset (buffer_t * buf, BYTE b);
> -
> -tpm_size_t buffer_len (const buffer_t* buf);
> -
> -TPM_RESULT buffer_free (buffer_t * buf);
> -
> -TPM_RESULT buffer_append_raw (buffer_t * buf, tpm_size_t len, const BYTE* bytes);
> -
> -#endif // _TOOLS_H_
> diff --git a/tools/vtpm_manager/util/hashtable.c b/tools/vtpm_manager/util/hashtable.c
> deleted file mode 100644
> index aff0e2b..0000000
> --- a/tools/vtpm_manager/util/hashtable.c
> +++ /dev/null
> @@ -1,316 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/xenstore/hashtable.c
> - *  - tools/blktap2/drivers/hashtable.c
> - */
> -
> -#include "hashtable.h"
> -#include "hashtable_private.h"
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <string.h>
> -#include <math.h>
> -
> -/*
> -Credit for primes table: Aaron Krowne
> - http://br.endernet.org/~akrowne/
> - http://planetmath.org/encyclopedia/GoodHashTablePrimes.html
> -*/
> -static const unsigned int primes[] = {
> -53, 97, 193, 389,
> -769, 1543, 3079, 6151,
> -12289, 24593, 49157, 98317,
> -196613, 393241, 786433, 1572869,
> -3145739, 6291469, 12582917, 25165843,
> -50331653, 100663319, 201326611, 402653189,
> -805306457, 1610612741
> -};
> -const unsigned int prime_table_length = sizeof(primes)/sizeof(primes[0]);
> -const float max_load_factor = 0.65;
> -
> -/*****************************************************************************/
> -struct hashtable *
> -create_hashtable(unsigned int minsize,
> -                 unsigned int (*hashf) (void*),
> -                 int (*eqf) (void*,void*))
> -{
> -    struct hashtable *h;
> -    unsigned int pindex, size = primes[0];
> -    /* Check requested hashtable isn't too large */
> -    if (minsize > (1u << 30)) return NULL;
> -    /* Enforce size as prime */
> -    for (pindex=0; pindex < prime_table_length; pindex++) {
> -        if (primes[pindex] > minsize) { size = primes[pindex]; break; }
> -    }
> -    h = (struct hashtable *)malloc(sizeof(struct hashtable));
> -    if (NULL == h) return NULL; /*oom*/
> -    h->table = (struct entry **)malloc(sizeof(struct entry*) * size);
> -    if (NULL == h->table) { free(h); return NULL; } /*oom*/
> -    memset(h->table, 0, size * sizeof(struct entry *));
> -    h->tablelength  = size;
> -    h->primeindex   = pindex;
> -    h->entrycount   = 0;
> -    h->hashfn       = hashf;
> -    h->eqfn         = eqf;
> -    h->loadlimit    = (unsigned int) ceil(size * max_load_factor);
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_init(&h->mutex, NULL);
> -#endif
> -    return h;
> -}
> -
> -/*****************************************************************************/
> -unsigned int
> -hash(struct hashtable *h, void *k)
> -{
> -    unsigned int i = h->hashfn(k);
> -    i += ~(i << 9);
> -    i ^=  ((i >> 14) | (i << 18)); /* >>> */
> -    i +=  (i << 4);
> -    i ^=  ((i >> 10) | (i << 22)); /* >>> */
> -    return i;
> -}
> -
> -/*****************************************************************************/
> -static int
> -hashtable_expand(struct hashtable *h)
> -{
> -    /* Double the size of the table to accomodate more entries */
> -    struct entry **newtable;
> -    struct entry *e;
> -    struct entry **pE;
> -    unsigned int newsize, i, index;
> -    /* Check we're not hitting max capacity */
> -    if (h->primeindex == (prime_table_length - 1)) return 0;
> -    newsize = primes[++(h->primeindex)];
> -
> -    newtable = (struct entry **)malloc(sizeof(struct entry*) * newsize);
> -    if (NULL != newtable)
> -    {
> -        memset(newtable, 0, newsize * sizeof(struct entry *));
> -        /* This algorithm is not 'stable'. ie. it reverses the list
> -         * when it transfers entries between the tables */
> -        for (i = 0; i < h->tablelength; i++) {
> -            while (NULL != (e = h->table[i])) {
> -                h->table[i] = e->next;
> -                index = indexFor(newsize,e->h);
> -                e->next = newtable[index];
> -                newtable[index] = e;
> -            }
> -        }
> -        free(h->table);
> -        h->table = newtable;
> -    }
> -    /* Plan B: realloc instead */
> -    else
> -    {
> -        newtable = (struct entry **)
> -                   realloc(h->table, newsize * sizeof(struct entry *));
> -        if (NULL == newtable) { (h->primeindex)--; return 0; }
> -        h->table = newtable;
> -        memset(newtable[h->tablelength], 0, newsize - h->tablelength);
> -        for (i = 0; i < h->tablelength; i++) {
> -            for (pE = &(newtable[i]), e = *pE; e != NULL; e = *pE) {
> -                index = indexFor(newsize,e->h);
> -                if (index == i)
> -                {
> -                    pE = &(e->next);
> -                }
> -                else
> -                {
> -                    *pE = e->next;
> -                    e->next = newtable[index];
> -                    newtable[index] = e;
> -                }
> -            }
> -        }
> -    }
> -    h->tablelength = newsize;
> -    h->loadlimit   = (unsigned int) ceil(newsize * max_load_factor);
> -    return -1;
> -}
> -
> -/*****************************************************************************/
> -unsigned int
> -hashtable_count(struct hashtable *h)
> -{
> -    unsigned int count;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    count = h->entrycount;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return count;
> -}
> -
> -/*****************************************************************************/
> -int
> -hashtable_insert(struct hashtable *h, void *k, void *v)
> -{
> -    /* This method allows duplicate keys - but they shouldn't be used */
> -    unsigned int index;
> -    struct entry *e;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    if (++(h->entrycount) > h->loadlimit)
> -    {
> -        /* Ignore the return value. If expand fails, we should
> -         * still try cramming just this value into the existing table
> -         * -- we may not have memory for a larger table, but one more
> -         * element may be ok. Next time we insert, we'll try expanding again.*/
> -        hashtable_expand(h);
> -    }
> -    e = (struct entry *)malloc(sizeof(struct entry));
> -    if (NULL == e) { --(h->entrycount); return 0; } /*oom*/
> -    e->h = hash(h,k);
> -    index = indexFor(h->tablelength,e->h);
> -    e->k = k;
> -    e->v = v;
> -    e->next = h->table[index];
> -    h->table[index] = e;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return -1;
> -}
> -
> -/*****************************************************************************/
> -void * /* returns value associated with key */
> -hashtable_search(struct hashtable *h, void *k)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    struct entry *e;
> -    unsigned int hashvalue, index;
> -    hashvalue = hash(h,k);
> -    index = indexFor(h->tablelength,hashvalue);
> -    e = h->table[index];
> -    while (NULL != e)
> -    {
> -        /* Check hash value to short circuit heavier comparison */
> -        if ((hashvalue == e->h) && (h->eqfn(k, e->k))) {
> -#ifdef HASHTABLE_THREADED
> -          pthread_mutex_unlock(&h->mutex);
> -#endif
> -          return e->v;
> -        }
> -        e = e->next;
> -    }
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return NULL;
> -}
> -
> -/*****************************************************************************/
> -void * /* returns value associated with key */
> -hashtable_remove(struct hashtable *h, void *k)
> -{
> -    /* TODO: consider compacting the table when the load factor drops enough,
> -     *       or provide a 'compact' method. */
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    struct entry *e;
> -    struct entry **pE;
> -    void *v;
> -    unsigned int hashvalue, index;
> -
> -    hashvalue = hash(h,k);
> -    index = indexFor(h->tablelength,hash(h,k));
> -    pE = &(h->table[index]);
> -    e = *pE;
> -    while (NULL != e)
> -    {
> -        /* Check hash value to short circuit heavier comparison */
> -        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
> -        {
> -            *pE = e->next;
> -            h->entrycount--;
> -            v = e->v;
> -            freekey(e->k);
> -            free(e);
> -            return v;
> -        }
> -        pE = &(e->next);
> -        e = e->next;
> -    }
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return NULL;
> -}
> -
> -/*****************************************************************************/
> -/* destroy */
> -void
> -hashtable_destroy(struct hashtable *h, int free_values)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    unsigned int i;
> -    struct entry *e, *f;
> -    struct entry **table = h->table;
> -    if (free_values)
> -    {
> -        for (i = 0; i < h->tablelength; i++)
> -        {
> -            e = table[i];
> -            while (NULL != e)
> -            { f = e; e = e->next; freekey(f->k); free(f->v); free(f); }
> -        }
> -    }
> -    else
> -    {
> -        for (i = 0; i < h->tablelength; i++)
> -        {
> -            e = table[i];
> -            while (NULL != e)
> -            { f = e; e = e->next; freekey(f->k); free(f); }
> -        }
> -    }
> -    free(h->table);
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_destroy(&h->mutex);
> -#endif
> -    free(h);
> -}
> diff --git a/tools/vtpm_manager/util/hashtable.h b/tools/vtpm_manager/util/hashtable.h
> deleted file mode 100644
> index dedc60a..0000000
> --- a/tools/vtpm_manager/util/hashtable.h
> +++ /dev/null
> @@ -1,204 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/xenstore/hashtable.h
> - *  - tools/blktap2/drivers/hashtable.h
> - */
> -
> -#ifndef __HASHTABLE_CWC22_H__
> -#define __HASHTABLE_CWC22_H__
> -
> -struct hashtable;
> -
> -/* Example of use:
> - *
> - *      struct hashtable  *h;
> - *      struct some_key   *k;
> - *      struct some_value *v;
> - *
> - *      static unsigned int         hash_from_key_fn( void *k );
> - *      static int                  keys_equal_fn ( void *key1, void *key2 );
> - *
> - *      h = create_hashtable(16, hash_from_key_fn, keys_equal_fn);
> - *      k = (struct some_key *)     malloc(sizeof(struct some_key));
> - *      v = (struct some_value *)   malloc(sizeof(struct some_value));
> - *
> - *      (initialise k and v to suitable values)
> - *
> - *      if (! hashtable_insert(h,k,v) )
> - *      {     exit(-1);               }
> - *
> - *      if (NULL == (found = hashtable_search(h,k) ))
> - *      {    printf("not found!");                  }
> - *
> - *      if (NULL == (found = hashtable_remove(h,k) ))
> - *      {    printf("Not found\n");                 }
> - *
> - */
> -
> -/* Macros may be used to define type-safe(r) hashtable access functions, with
> - * methods specialized to take known key and value types as parameters.
> - *
> - * Example:
> - *
> - * Insert this at the start of your file:
> - *
> - * DEFINE_HASHTABLE_INSERT(insert_some, struct some_key, struct some_value);
> - * DEFINE_HASHTABLE_SEARCH(search_some, struct some_key, struct some_value);
> - * DEFINE_HASHTABLE_REMOVE(remove_some, struct some_key, struct some_value);
> - *
> - * This defines the functions 'insert_some', 'search_some' and 'remove_some'.
> - * These operate just like hashtable_insert etc., with the same parameters,
> - * but their function signatures have 'struct some_key *' rather than
> - * 'void *', and hence can generate compile time errors if your program is
> - * supplying incorrect data as a key (and similarly for value).
> - *
> - * Note that the hash and key equality functions passed to create_hashtable
> - * still take 'void *' parameters instead of 'some key *'. This shouldn't be
> - * a difficult issue as they're only defined and passed once, and the other
> - * functions will ensure that only valid keys are supplied to them.
> - *
> - * The cost for this checking is increased code size and runtime overhead
> - * - if performance is important, it may be worth switching back to the
> - * unsafe methods once your program has been debugged with the safe methods.
> - * This just requires switching to some simple alternative defines - eg:
> - * #define insert_some hashtable_insert
> - *
> - */
> -
> -/*****************************************************************************
> - * create_hashtable
> -
> - * @name                    create_hashtable
> - * @param   minsize         minimum initial size of hashtable
> - * @param   hashfunction    function for hashing keys
> - * @param   key_eq_fn       function for determining key equality
> - * @return                  newly created hashtable or NULL on failure
> - */
> -
> -struct hashtable *
> -create_hashtable(unsigned int minsize,
> -                 unsigned int (*hashfunction) (void*),
> -                 int (*key_eq_fn) (void*,void*));
> -
> -/*****************************************************************************
> - * hashtable_insert
> -
> - * @name        hashtable_insert
> - * @param   h   the hashtable to insert into
> - * @param   k   the key - hashtable claims ownership and will free on removal
> - * @param   v   the value - does not claim ownership
> - * @return      non-zero for successful insertion
> - *
> - * This function will cause the table to expand if the insertion would take
> - * the ratio of entries to table size over the maximum load factor.
> - *
> - * This function does not check for repeated insertions with a duplicate key.
> - * The value returned when using a duplicate key is undefined -- when
> - * the hashtable changes size, the order of retrieval of duplicate key
> - * entries is reversed.
> - * If in doubt, remove before insert.
> - */
> -
> -int
> -hashtable_insert(struct hashtable *h, void *k, void *v);
> -
> -#define DEFINE_HASHTABLE_INSERT(fnname, keytype, valuetype) \
> -int fnname (struct hashtable *h, keytype *k, valuetype *v) \
> -{ \
> -    return hashtable_insert(h,k,v); \
> -}
> -
> -/*****************************************************************************
> - * hashtable_search
> -
> - * @name        hashtable_search
> - * @param   h   the hashtable to search
> - * @param   k   the key to search for  - does not claim ownership
> - * @return      the value associated with the key, or NULL if none found
> - */
> -
> -void *
> -hashtable_search(struct hashtable *h, void *k);
> -
> -#define DEFINE_HASHTABLE_SEARCH(fnname, keytype, valuetype) \
> -valuetype * fnname (struct hashtable *h, keytype *k) \
> -{ \
> -    return (valuetype *) (hashtable_search(h,k)); \
> -}
> -
> -/*****************************************************************************
> - * hashtable_remove
> -
> - * @name        hashtable_remove
> - * @param   h   the hashtable to remove the item from
> - * @param   k   the key to search for  - does not claim ownership
> - * @return      the value associated with the key, or NULL if none found
> - */
> -
> -void * /* returns value */
> -hashtable_remove(struct hashtable *h, void *k);
> -
> -#define DEFINE_HASHTABLE_REMOVE(fnname, keytype, valuetype) \
> -valuetype * fnname (struct hashtable *h, keytype *k) \
> -{ \
> -    return (valuetype *) (hashtable_remove(h,k)); \
> -}
> -
> -
> -/*****************************************************************************
> - * hashtable_count
> -
> - * @name        hashtable_count
> - * @param   h   the hashtable
> - * @return      the number of items stored in the hashtable
> - */
> -unsigned int
> -hashtable_count(struct hashtable *h);
> -
> -
> -/*****************************************************************************
> - * hashtable_destroy
> -
> - * @name        hashtable_destroy
> - * @param   h   the hashtable
> - * @param       free_values     whether to call 'free' on the remaining values
> - */
> -
> -void
> -hashtable_destroy(struct hashtable *h, int free_values);
> -
> -#endif /* __HASHTABLE_CWC22_H__ */
> diff --git a/tools/vtpm_manager/util/hashtable_itr.c b/tools/vtpm_manager/util/hashtable_itr.c
> deleted file mode 100644
> index dcf42c8..0000000
> --- a/tools/vtpm_manager/util/hashtable_itr.c
> +++ /dev/null
> @@ -1,236 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/blktap2/drivers/hashtable_itr.c
> - */
> -
> -#include "hashtable.h"
> -#include "hashtable_private.h"
> -#include "hashtable_itr.h"
> -#include <stdlib.h> /* defines NULL */
> -
> -/*****************************************************************************/
> -/* hashtable_iterator    - iterator constructor */
> -
> -struct hashtable_itr *
> -hashtable_iterator(struct hashtable *h)
> -{
> -    unsigned int i, tablelength;
> -    struct hashtable_itr *itr = (struct hashtable_itr *)
> -        malloc(sizeof(struct hashtable_itr));
> -    if (NULL == itr) return NULL;
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    itr->h = h;
> -    itr->e = NULL;
> -    itr->parent = NULL;
> -    tablelength = h->tablelength;
> -    itr->index = tablelength;
> -    if (0 == h->entrycount) {
> -#ifdef HASHTABLE_THREADED
> -      pthread_mutex_unlock(&h->mutex);
> -#endif
> -      return itr;
> -    }
> -
> -    for (i = 0; i < tablelength; i++)
> -    {
> -        if (NULL != h->table[i])
> -        {
> -            itr->e = h->table[i];
> -            itr->index = i;
> -            break;
> -        }
> -    }
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return itr;
> -}
> -
> -/*****************************************************************************/
> -/* key      - return the key of the (key,value) pair at the current position */
> -/* value    - return the value of the (key,value) pair at the current position */
> -
> -void *
> -hashtable_iterator_key(struct hashtable_itr *i)
> -{ return i->e->k; }
> -
> -void *
> -hashtable_iterator_value(struct hashtable_itr *i)
> -{ return i->e->v; }
> -
> -/*****************************************************************************/
> -/* advance - advance the iterator to the next element
> - *           returns zero if advanced to end of table */
> -
> -int
> -hashtable_iterator_advance(struct hashtable_itr *itr)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&itr->h->mutex);
> -#endif
> -    unsigned int j,tablelength;
> -    struct entry **table;
> -    struct entry *next;
> -    int ret;
> -    if (NULL == itr->e) { /* stupidity check */
> -      ret = 0;
> -      goto egress;
> -    }
> -
> -    next = itr->e->next;
> -    if (NULL != next)
> -    {
> -        itr->parent = itr->e;
> -        itr->e = next;
> -        ret = -1;
> -        goto egress;
> -    }
> -
> -    tablelength = itr->h->tablelength;
> -    itr->parent = NULL;
> -    if (tablelength <= (j = ++(itr->index)))
> -    {
> -        itr->e = NULL;
> -        ret = 0;
> -        goto egress;
> -    }
> -    table = itr->h->table;
> -    while (NULL == (next = table[j]))
> -    {
> -        if (++j >= tablelength)
> -        {
> -            itr->index = tablelength;
> -            itr->e = NULL;
> -            ret = 0;
> -            goto egress;
> -        }
> -    }
> -    itr->index = j;
> -    itr->e = next;
> -    ret = -1;
> -
> - egress:
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&itr->h->mutex);
> -#endif
> -    return ret;
> -}
> -
> -/*****************************************************************************/
> -/* remove - remove the entry at the current iterator position
> - *          and advance the iterator, if there is a successive
> - *          element.
> - *          If you want the value, read it before you remove:
> - *          beware memory leaks if you don't.
> - *          Returns zero if end of iteration. */
> -
> -int
> -hashtable_iterator_remove(struct hashtable_itr *itr)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&itr->h->mutex);
> -#endif
> -    struct entry *remember_e, *remember_parent;
> -    int ret;
> -
> -    /* Do the removal */
> -    if (NULL == (itr->parent))
> -    {
> -        /* element is head of a chain */
> -        itr->h->table[itr->index] = itr->e->next;
> -    } else {
> -        /* element is mid-chain */
> -        itr->parent->next = itr->e->next;
> -    }
> -    /* itr->e is now outside the hashtable */
> -    remember_e = itr->e;
> -    itr->h->entrycount--;
> -    freekey(remember_e->k);
> -
> -    /* Advance the iterator, correcting the parent */
> -    remember_parent = itr->parent;
> -    ret = hashtable_iterator_advance(itr);
> -    if (itr->parent == remember_e) { itr->parent = remember_parent; }
> -    free(remember_e);
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&itr->h->mutex);
> -#endif
> -    return ret;
> -}
> -
> -/*****************************************************************************/
> -int /* returns zero if not found */
> -hashtable_iterator_search(struct hashtable_itr *itr,
> -                          struct hashtable *h, void *k)
> -{
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_lock(&h->mutex);
> -#endif
> -    struct entry *e, *parent;
> -    unsigned int hashvalue, index;
> -    int ret;
> -
> -    hashvalue = hash(h,k);
> -    index = indexFor(h->tablelength,hashvalue);
> -
> -    e = h->table[index];
> -    parent = NULL;
> -    while (NULL != e)
> -    {
> -        /* Check hash value to short circuit heavier comparison */
> -        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
> -        {
> -            itr->index = index;
> -            itr->e = e;
> -            itr->parent = parent;
> -            itr->h = h;
> -            ret= -1;
> -            goto egress;
> -        }
> -        parent = e;
> -        e = e->next;
> -    }
> -  ret = 0;
> -
> -egress:
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_unlock(&h->mutex);
> -#endif
> -    return ret;
> -}
> diff --git a/tools/vtpm_manager/util/hashtable_itr.h b/tools/vtpm_manager/util/hashtable_itr.h
> deleted file mode 100644
> index 35654e0..0000000
> --- a/tools/vtpm_manager/util/hashtable_itr.h
> +++ /dev/null
> @@ -1,109 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/blktap2/drivers/hashtable_itr.h
> - */
> -
> -
> -#ifndef __HASHTABLE_ITR_CWC22__
> -#define __HASHTABLE_ITR_CWC22__
> -#include "hashtable.h"
> -#include "hashtable_private.h" /* needed to enable inlining */
> -
> -/*****************************************************************************/
> -/* This struct is only concrete here to allow the inlining of two of the
> - * accessor functions. */
> -struct hashtable_itr
> -{
> -    struct hashtable *h;
> -    struct entry *e;
> -    struct entry *parent;
> -    unsigned int index;
> -};
> -
> -
> -/*****************************************************************************/
> -/* hashtable_iterator
> - */
> -
> -struct hashtable_itr *
> -hashtable_iterator(struct hashtable *h);
> -
> -/*****************************************************************************/
> -/* hashtable_iterator_key
> - * - return the value of the (key,value) pair at the current position */
> -
> -void *hashtable_iterator_key(struct hashtable_itr *i);
> -
> -/*****************************************************************************/
> -/* value - return the value of the (key,value) pair at the current position */
> -
> -void *hashtable_iterator_value(struct hashtable_itr *i);
> -
> -/*****************************************************************************/
> -/* advance - advance the iterator to the next element
> - *           returns zero if advanced to end of table */
> -
> -int
> -hashtable_iterator_advance(struct hashtable_itr *itr);
> -
> -/*****************************************************************************/
> -/* remove - remove current element and advance the iterator to the next element
> - *          NB: if you need the value to free it, read it before
> - *          removing. ie: beware memory leaks!
> - *          returns zero if advanced to end of table */
> -
> -int
> -hashtable_iterator_remove(struct hashtable_itr *itr);
> -
> -/*****************************************************************************/
> -/* search - overwrite the supplied iterator, to point to the entry
> - *          matching the supplied key.
> -            h points to the hashtable to be searched.
> - *          returns zero if not found. */
> -int
> -hashtable_iterator_search(struct hashtable_itr *itr,
> -                          struct hashtable *h, void *k);
> -
> -#define DEFINE_HASHTABLE_ITERATOR_SEARCH(fnname, keytype) \
> -int fnname (struct hashtable_itr *i, struct hashtable *h, keytype *k) \
> -{ \
> -    return (hashtable_iterator_search(i,h,k)); \
> -}
> -
> -
> -
> -#endif /* __HASHTABLE_ITR_CWC22__*/
> diff --git a/tools/vtpm_manager/util/hashtable_private.h b/tools/vtpm_manager/util/hashtable_private.h
> deleted file mode 100644
> index d87a7f9..0000000
> --- a/tools/vtpm_manager/util/hashtable_private.h
> +++ /dev/null
> @@ -1,96 +0,0 @@
> -/*
> - * Copyright (c) 2005, Intel Corp
> - * Copyright (c) 2002, Christopher Clark <firstname.lastname@cl.cam.ac.uk>
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - *
> - * * Redistributions in binary form must reproduce the above copyright
> - * notice, this list of conditions and the following disclaimer in the
> - * documentation and/or other materials provided with the distribution.
> - *
> - * * Neither the name of the original author; nor the names of any contributors
> - * may be used to endorse or promote products derived from this software
> - * without specific prior written permission.
> - *
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
> - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
> - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -*/
> -
> -/*
> - * There are duplicates of this code in:
> - *  - tools/xenstore/hashtable_private.h
> - *  - tools/blktap2/drivers/hashtable_private.h
> - */
> -
> -#ifndef __HASHTABLE_PRIVATE_CWC22_H__
> -#define __HASHTABLE_PRIVATE_CWC22_H__
> -
> -#include "hashtable.h"
> -#ifdef HASHTABLE_THREADED
> -#include <pthread.h>
> -#endif
> -
> -/*****************************************************************************/
> -struct entry
> -{
> -    void *k, *v;
> -    unsigned int h;
> -    struct entry *next;
> -};
> -
> -struct hashtable {
> -    unsigned int tablelength;
> -    struct entry **table;
> -    unsigned int entrycount;
> -    unsigned int loadlimit;
> -    unsigned int primeindex;
> -    unsigned int (*hashfn) (void *k);
> -    int (*eqfn) (void *k1, void *k2);
> -#ifdef HASHTABLE_THREADED
> -    pthread_mutex_t mutex;
> -#endif
> -};
> -
> -/*****************************************************************************/
> -unsigned int
> -hash(struct hashtable *h, void *k);
> -
> -/*****************************************************************************/
> -/* indexFor */
> -static inline unsigned int
> -indexFor(unsigned int tablelength, unsigned int hashvalue) {
> -    return (hashvalue % tablelength);
> -};
> -
> -/* Only works if tablelength == 2^N */
> -/*static inline unsigned int
> -indexFor(unsigned int tablelength, unsigned int hashvalue)
> -{
> -    return (hashvalue & (tablelength - 1u));
> -}
> -*/
> -
> -/*****************************************************************************/
> -#define freekey(X) free(X)
> -/*define freekey(X) ; */
> -
> -
> -/*****************************************************************************/
> -
> -#endif /* __HASHTABLE_PRIVATE_CWC22_H__*/
> diff --git a/tools/vtpm_manager/util/log.c b/tools/vtpm_manager/util/log.c
> deleted file mode 100644
> index 75fe91a..0000000
> --- a/tools/vtpm_manager/util/log.c
> +++ /dev/null
> @@ -1,142 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#include <stdlib.h>
> -#include <string.h>
> -#include <stdio.h>
> -
> -#include "buffer.h"
> -#include "tcg.h"
> -
> -// Helper code for the consts, eg. to produce messages for error codes.
> -
> -typedef struct error_code_entry_t {
> -  TPM_RESULT code;
> -  char * code_name;
> -  char * msg;
> -} error_code_entry_t;
> -
> -static const error_code_entry_t error_msgs [] = {
> -  { TPM_SUCCESS, "TPM_SUCCESS", "Successful completion of the operation" },
> -  { TPM_AUTHFAIL, "TPM_AUTHFAIL", "Authentication failed" },
> -  { TPM_BADINDEX, "TPM_BADINDEX", "The index to a PCR, DIR or other register is incorrect" },
> -  { TPM_BAD_PARAMETER, "TPM_BAD_PARAMETER", "One or more parameter is bad" },
> -  { TPM_AUDITFAILURE, "TPM_AUDITFAILURE", "An operation completed successfully but the auditing of that operation failed." },
> -  { TPM_CLEAR_DISABLED, "TPM_CLEAR_DISABLED", "The clear disable flag is set and all clear operations now require physical access" },
> -  { TPM_DEACTIVATED, "TPM_DEACTIVATED", "The TPM is deactivated" },
> -  { TPM_DISABLED, "TPM_DISABLED", "The TPM is disabled" },
> -  { TPM_DISABLED_CMD, "TPM_DISABLED_CMD", "The target command has been disabled" },
> -  { TPM_FAIL, "TPM_FAIL", "The operation failed" },
> -  { TPM_BAD_ORDINAL, "TPM_BAD_ORDINAL", "The ordinal was unknown or inconsistent" },
> -  { TPM_INSTALL_DISABLED, "TPM_INSTALL_DISABLED", "The ability to install an owner is disabled" },
> -  { TPM_INVALID_KEYHANDLE, "TPM_INVALID_KEYHANDLE", "The key handle presented was invalid" },
> -  { TPM_KEYNOTFOUND, "TPM_KEYNOTFOUND", "The target key was not found" },
> -  { TPM_INAPPROPRIATE_ENC, "TPM_INAPPROPRIATE_ENC", "Unacceptable encryption scheme" },
> -  { TPM_MIGRATEFAIL, "TPM_MIGRATEFAIL", "Migration authorization failed" },
> -  { TPM_INVALID_PCR_INFO, "TPM_INVALID_PCR_INFO", "PCR information could not be interpreted" },
> -  { TPM_NOSPACE, "TPM_NOSPACE", "No room to load key." },
> -  { TPM_NOSRK, "TPM_NOSRK", "There is no SRK set" },
> -  { TPM_NOTSEALED_BLOB, "TPM_NOTSEALED_BLOB", "An encrypted blob is invalid or was not created by this TPM" },
> -  { TPM_OWNER_SET, "TPM_OWNER_SET", "There is already an Owner" },
> -  { TPM_RESOURCES, "TPM_RESOURCES", "The TPM has insufficient internal resources to perform the requested action." },
> -  { TPM_SHORTRANDOM, "TPM_SHORTRANDOM", "A random string was too short" },
> -  { TPM_SIZE, "TPM_SIZE", "The TPM does not have the space to perform the operation." },
> -  { TPM_WRONGPCRVAL, "TPM_WRONGPCRVAL", "The named PCR value does not match the current PCR value." },
> -  { TPM_BAD_PARAM_SIZE, "TPM_BAD_PARAM_SIZE", "The paramSize argument to the command has the incorrect value" },
> -  { TPM_SHA_THREAD, "TPM_SHA_THREAD", "There is no existing SHA-1 thread." },
> -  { TPM_SHA_ERROR, "TPM_SHA_ERROR", "The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error." },
> -  { TPM_FAILEDSELFTEST, "TPM_FAILEDSELFTEST", "Self-test has failed and the TPM has shutdown." },
> -  { TPM_AUTH2FAIL, "TPM_AUTH2FAIL", "The authorization for the second key in a 2 key function failed authorization" },
> -  { TPM_BADTAG, "TPM_BADTAG", "The tag value sent to for a command is invalid" },
> -  { TPM_IOERROR, "TPM_IOERROR", "An IO error occurred transmitting information to the TPM" },
> -  { TPM_ENCRYPT_ERROR, "TPM_ENCRYPT_ERROR", "The encryption process had a problem." },
> -  { TPM_DECRYPT_ERROR, "TPM_DECRYPT_ERROR", "The decryption process did not complete." },
> -  { TPM_INVALID_AUTHHANDLE, "TPM_INVALID_AUTHHANDLE", "An invalid handle was used." },
> -  { TPM_NO_ENDORSEMENT, "TPM_NO_ENDORSEMENT", "The TPM does not a EK installed" },
> -  { TPM_INVALID_KEYUSAGE, "TPM_INVALID_KEYUSAGE", "The usage of a key is not allowed" },
> -  { TPM_WRONG_ENTITYTYPE, "TPM_WRONG_ENTITYTYPE", "The submitted entity type is not allowed" },
> -  { TPM_INVALID_POSTINIT, "TPM_INVALID_POSTINIT", "The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup" },
> -  { TPM_INAPPROPRIATE_SIG, "TPM_INAPPROPRIATE_SIG", "Signed data cannot include additional DER information" },
> -  { TPM_BAD_KEY_PROPERTY, "TPM_BAD_KEY_PROPERTY", "The key properties in TPM_KEY_PARMs are not supported by this TPM" },
> -
> -  { TPM_BAD_MIGRATION, "TPM_BAD_MIGRATION", "The migration properties of this key are incorrect." },
> -  { TPM_BAD_SCHEME, "TPM_BAD_SCHEME", "The signature or encryption scheme for this key is incorrect or not permitted in this situation." },
> -  { TPM_BAD_DATASIZE, "TPM_BAD_DATASIZE", "The size of the data (or blob) parameter is bad or inconsistent with the referenced key" },
> -  { TPM_BAD_MODE, "TPM_BAD_MODE", "A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob." },
> -  { TPM_BAD_PRESENCE, "TPM_BAD_PRESENCE", "Either the physicalPresence or physicalPresenceLock bits have the wrong value" },
> -  { TPM_BAD_VERSION, "TPM_BAD_VERSION", "The TPM cannot perform this version of the capability" },
> -  { TPM_NO_WRAP_TRANSPORT, "TPM_NO_WRAP_TRANSPORT", "The TPM does not allow for wrapped transport sessions" },
> -  { TPM_AUDITFAIL_UNSUCCESSFUL, "TPM_AUDITFAIL_UNSUCCESSFUL", "TPM audit construction failed and the underlying command was returning a failure code also" },
> -  { TPM_AUDITFAIL_SUCCESSFUL, "TPM_AUDITFAIL_SUCCESSFUL", "TPM audit construction failed and the underlying command was returning success" },
> -  { TPM_NOTRESETABLE, "TPM_NOTRESETABLE", "Attempt to reset a PCR register that does not have the resettable attribute" },
> -  { TPM_NOTLOCAL, "TPM_NOTLOCAL", "Attempt to reset a PCR register that requires locality and locality modifier not part of command transport" },
> -  { TPM_BAD_TYPE, "TPM_BAD_TYPE", "Make identity blob not properly typed" },
> -  { TPM_INVALID_RESOURCE, "TPM_INVALID_RESOURCE", "When saving context identified resource type does not match actual resource" },
> -  { TPM_NOTFIPS, "TPM_NOTFIPS", "The TPM is attempting to execute a command only available when in FIPS mode" },
> -  { TPM_INVALID_FAMILY, "TPM_INVALID_FAMILY", "The command is attempting to use an invalid family ID" },
> -  { TPM_NO_NV_PERMISSION, "TPM_NO_NV_PERMISSION", "The permission to manipulate the NV storage is not available" },
> -  { TPM_REQUIRES_SIGN, "TPM_REQUIRES_SIGN", "The operation requires a signed command" },
> -  { TPM_KEY_NOTSUPPORTED, "TPM_KEY_NOTSUPPORTED", "Wrong operation to load an NV key" },
> -  { TPM_AUTH_CONFLICT, "TPM_AUTH_CONFLICT", "NV_LoadKey blob requires both owner and blob authorization" },
> -  { TPM_AREA_LOCKED, "TPM_AREA_LOCKED", "The NV area is locked and not writtable" },
> -  { TPM_BAD_LOCALITY, "TPM_BAD_LOCALITY", "The locality is incorrect for the attempted operation" },
> -  { TPM_READ_ONLY, "TPM_READ_ONLY", "The NV area is read only and can't be written to" },
> -  { TPM_PER_NOWRITE, "TPM_PER_NOWRITE", "There is no protection on the write to the NV area" },
> -  { TPM_FAMILYCOUNT, "TPM_FAMILYCOUNT", "The family count value does not match" },
> -  { TPM_WRITE_LOCKED, "TPM_WRITE_LOCKED", "The NV area has already been written to" },
> -  { TPM_BAD_ATTRIBUTES, "TPM_BAD_ATTRIBUTES", "The NV area attributes conflict" },
> -  { TPM_INVALID_STRUCTURE, "TPM_INVALID_STRUCTURE", "The structure tag and version are invalid or inconsistent" },
> -  { TPM_KEY_OWNER_CONTROL, "TPM_KEY_OWNER_CONTROL", "The key is under control of the TPM Owner and can only be evicted by the TPM Owner." },
> -  { TPM_BAD_COUNTER, "TPM_BAD_COUNTER", "The counter handle is incorrect" },
> -  { TPM_NOT_FULLWRITE, "TPM_NOT_FULLWRITE", "The write is not a complete write of the area" },
> -  { TPM_CONTEXT_GAP, "TPM_CONTEXT_GAP", "The gap between saved context counts is too large" },
> -  { TPM_MAXNVWRITES, "TPM_MAXNVWRITES", "The maximum number of NV writes without an owner has been exceeded" },
> -  { TPM_NOOPERATOR, "TPM_NOOPERATOR", "No operator authorization value is set" },
> -  { TPM_RESOURCEMISSING, "TPM_RESOURCEMISSING", "The resource pointed to by context is not loaded" },
> -  { TPM_DELEGATE_LOCK, "TPM_DELEGATE_LOCK", "The delegate administration is locked" },
> -  { TPM_DELEGATE_FAMILY, "TPM_DELEGATE_FAMILY", "Attempt to manage a family other then the delegated family" },
> -  { TPM_DELEGATE_ADMIN, "TPM_DELEGATE_ADMIN", "Delegation table management not enabled" },
> -  { TPM_TRANSPORT_EXCLUSIVE, "TPM_TRANSPORT_EXCLUSIVE", "There was a command executed outside of an exclusive transport session" },
> -};
> -
> -
> -// helper function for the error codes:
> -const char* tpm_get_error_name (TPM_RESULT code) {
> -  // just do a linear scan for now
> -  unsigned i;
> -  for (i = 0; i < sizeof(error_msgs)/sizeof(error_msgs[0]); i++)
> -    if (code == error_msgs[i].code)
> -      return error_msgs[i].code_name;
> -
> -    return("Unknown Error Code");
> -}
> diff --git a/tools/vtpm_manager/util/log.h b/tools/vtpm_manager/util/log.h
> deleted file mode 100644
> index 1f15f5b..0000000
> --- a/tools/vtpm_manager/util/log.h
> +++ /dev/null
> @@ -1,94 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -
> -#ifndef __VTPM_LOG_H__
> -#define __VTPM_LOG_H__
> -
> -#include <stdint.h>             // for uint32_t
> -#include <stddef.h>             // for pointer NULL
> -
> -// =========================== LOGGING ==============================
> -
> -// the logging module numbers
> -#define VTPM_LOG_CRYPTO      1
> -#define VTPM_LOG_BSG         2
> -#define VTPM_LOG_TXDATA      3
> -#define VTPM_LOG_TCS         4
> -#define VTPM_LOG_TCS_DEEP    5
> -#define VTPM_LOG_VTSP        6
> -#define VTPM_LOG_VTPM        7
> -#define VTPM_LOG_VTPM_DEEP   8
> -#define VTPM_LOG_VTSP_DEEP   9
> -
> -static char *module_names[] = { "",
> -                                "CRYPTO",
> -                                "BSG",
> -                                "TXDATA",
> -                                "TCS",
> -                                "TCS",
> -                                "VTSP",
> -                                "VTPM",
> -                                "VTPM",
> -                                "VTSP"
> -                              };
> -
> -// Default to standard logging
> -#ifndef LOGGING_MODULES
> -#define LOGGING_MODULES (BITMASK(VTPM_LOG_VTPM))
> -#endif
> -
> -// bit-access macros
> -#define BITMASK(idx)      ( 1U << (idx) )
> -#define GETBIT(num,idx)   ( ((num) & BITMASK(idx)) >> idx )
> -#define SETBIT(num,idx)   (num) |= BITMASK(idx)
> -#define CLEARBIT(num,idx) (num) &= ( ~ BITMASK(idx) )
> -
> -#define vtpmloginfo(module, fmt, args...) \
> -  if (GETBIT (LOGGING_MODULES, module) == 1) {                         \
> -    fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); \
> -  }
> -
> -#define vtpmloginfomore(module, fmt, args...) \
> -  if (GETBIT (LOGGING_MODULES, module) == 1) {                       \
> -    fprintf (stdout, fmt,##args);                                    \
> -  }
> -
> -#define vtpmlogerror(module, fmt, args...) \
> -  fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
> -
> -//typedef UINT32 tpm_size_t;
> -
> -// helper function for the error codes:
> -const char* tpm_get_error_name (TPM_RESULT code);
> -
> -#endif // _VTPM_LOG_H_
> diff --git a/tools/vtpm_manager/util/tcg.h b/tools/vtpm_manager/util/tcg.h
> deleted file mode 100644
> index 5c42913..0000000
> --- a/tools/vtpm_manager/util/tcg.h
> +++ /dev/null
> @@ -1,503 +0,0 @@
> -// ===================================================================
> -//
> -// Copyright (c) 2005, Intel Corp.
> -// All rights reserved.
> -//
> -// Redistribution and use in source and binary forms, with or without
> -// modification, are permitted provided that the following conditions
> -// are met:
> -//
> -//   * Redistributions of source code must retain the above copyright
> -//     notice, this list of conditions and the following disclaimer.
> -//   * Redistributions in binary form must reproduce the above
> -//     copyright notice, this list of conditions and the following
> -//     disclaimer in the documentation and/or other materials provided
> -//     with the distribution.
> -//   * Neither the name of Intel Corporation nor the names of its
> -//     contributors may be used to endorse or promote products derived
> -//     from this software without specific prior written permission.
> -//
> -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> -// OF THE POSSIBILITY OF SUCH DAMAGE.
> -// ===================================================================
> -//
> -// tcg.h
> -//
> -//  This file contains all the structure and type definitions
> -//
> -// ==================================================================
> -
> -#ifndef __TCG_H__
> -#define __TCG_H__
> -
> -// This pragma is used to disallow structure padding
> -#pragma pack(push, 1)
> -
> -// *************************** TYPEDEFS *********************************
> -typedef unsigned char BYTE;
> -typedef unsigned char BOOL;
> -typedef unsigned short UINT16;
> -typedef unsigned int UINT32;
> -typedef unsigned long long UINT64;
> -
> -typedef UINT32 TPM_RESULT;
> -typedef UINT32 TPM_PCRINDEX;
> -typedef UINT32 TPM_DIRINDEX;
> -typedef UINT32 TPM_HANDLE;
> -typedef TPM_HANDLE TPM_AUTHHANDLE;
> -typedef TPM_HANDLE TCPA_HASHHANDLE;
> -typedef TPM_HANDLE TCPA_HMACHANDLE;
> -typedef TPM_HANDLE TCPA_ENCHANDLE;
> -typedef TPM_HANDLE TPM_KEY_HANDLE;
> -typedef TPM_HANDLE TCPA_ENTITYHANDLE;
> -typedef UINT32 TPM_RESOURCE_TYPE;
> -typedef UINT32 TPM_COMMAND_CODE;
> -typedef UINT16 TPM_PROTOCOL_ID;
> -typedef BYTE TPM_AUTH_DATA_USAGE;
> -typedef UINT16 TPM_ENTITY_TYPE;
> -typedef UINT32 TPM_ALGORITHM_ID;
> -typedef UINT16 TPM_KEY_USAGE;
> -typedef UINT16 TPM_STARTUP_TYPE;
> -typedef UINT32 TPM_CAPABILITY_AREA;
> -typedef UINT16 TPM_ENC_SCHEME;
> -typedef UINT16 TPM_SIG_SCHEME;
> -typedef UINT16 TPM_MIGRATE_SCHEME;
> -typedef UINT16 TPM_PHYSICAL_PRESENCE;
> -typedef UINT32 TPM_KEY_FLAGS;
> -
> -#define TPM_DIGEST_SIZE 20  // Don't change this
> -typedef BYTE TPM_AUTHDATA[TPM_DIGEST_SIZE];
> -typedef TPM_AUTHDATA TPM_SECRET;
> -typedef TPM_AUTHDATA TPM_ENCAUTH;
> -typedef BYTE TPM_PAYLOAD_TYPE;
> -typedef UINT16 TPM_TAG;
> -
> -// Data Types of the TCS
> -typedef UINT32 TCS_AUTHHANDLE;  // Handle addressing a authorization session
> -typedef UINT32 TCS_CONTEXT_HANDLE; // Basic context handle
> -typedef UINT32 TCS_KEY_HANDLE;  // Basic key handle
> -
> -// ************************* STRUCTURES **********************************
> -
> -typedef struct TPM_VERSION {
> -  BYTE major;
> -  BYTE minor;
> -  BYTE revMajor;
> -  BYTE revMinor;
> -} TPM_VERSION;
> -
> -static const TPM_VERSION TPM_STRUCT_VER_1_1 = { 1,1,0,0 };
> -
> -typedef struct TPM_DIGEST {
> -  BYTE digest[TPM_DIGEST_SIZE];
> -} TPM_DIGEST;
> -
> -typedef TPM_DIGEST TPM_PCRVALUE;
> -typedef TPM_DIGEST TPM_COMPOSITE_HASH;
> -typedef TPM_DIGEST TPM_DIRVALUE;
> -typedef TPM_DIGEST TPM_HMAC;
> -typedef TPM_DIGEST TPM_CHOSENID_HASH;
> -
> -typedef struct TPM_NONCE {
> -  BYTE nonce[TPM_DIGEST_SIZE];
> -} TPM_NONCE;
> -
> -typedef struct TPM_KEY_PARMS {
> -  TPM_ALGORITHM_ID algorithmID;
> -  TPM_ENC_SCHEME encScheme;
> -  TPM_SIG_SCHEME sigScheme;
> -  UINT32 parmSize;
> -  BYTE* parms;
> -} TPM_KEY_PARMS;
> -
> -typedef struct TPM_RSA_KEY_PARMS {
> -  UINT32 keyLength;
> -  UINT32 numPrimes;
> -  UINT32 exponentSize;
> -  BYTE* exponent;
> -} TPM_RSA_KEY_PARMS;
> -
> -typedef struct TPM_STORE_PUBKEY {
> -  UINT32 keyLength;
> -  BYTE* key;
> -} TPM_STORE_PUBKEY;
> -
> -typedef struct TPM_PUBKEY {
> -  TPM_KEY_PARMS algorithmParms;
> -  TPM_STORE_PUBKEY pubKey;
> -} TPM_PUBKEY;
> -
> -typedef struct TPM_KEY {
> -  TPM_VERSION         ver;
> -  TPM_KEY_USAGE       keyUsage;
> -  TPM_KEY_FLAGS       keyFlags;
> -  TPM_AUTH_DATA_USAGE authDataUsage;
> -  TPM_KEY_PARMS       algorithmParms;
> -  UINT32              PCRInfoSize;
> -  BYTE*               PCRInfo; // this should be a TPM_PCR_INFO, or NULL
> -  TPM_STORE_PUBKEY    pubKey;
> -  UINT32              encDataSize;
> -  BYTE*               encData;
> -} TPM_KEY;
> -
> -typedef struct TPM_PCR_SELECTION {
> -  UINT16 sizeOfSelect;        /// in bytes
> -  BYTE* pcrSelect;
> -} TPM_PCR_SELECTION;
> -
> -typedef struct TPM_PCR_COMPOSITE {
> -  TPM_PCR_SELECTION select;
> -  UINT32 valueSize;
> -  TPM_PCRVALUE* pcrValue;
> -} TPM_PCR_COMPOSITE;
> -
> -
> -typedef struct TPM_PCR_INFO {
> -  TPM_PCR_SELECTION pcrSelection;
> -  TPM_COMPOSITE_HASH digestAtRelease;
> -  TPM_COMPOSITE_HASH digestAtCreation;
> -} TPM_PCR_INFO;
> -
> -
> -typedef struct TPM_BOUND_DATA {
> -  TPM_VERSION ver;
> -  TPM_PAYLOAD_TYPE payload;
> -  BYTE* payloadData;
> -} TPM_BOUND_DATA;
> -
> -typedef struct TPM_STORED_DATA {
> -  TPM_VERSION ver;
> -  UINT32 sealInfoSize;
> -  BYTE* sealInfo;
> -  UINT32 encDataSize;
> -  BYTE* encData;
> -} TPM_STORED_DATA;
> -
> -typedef struct TCS_AUTH {
> -  TCS_AUTHHANDLE  AuthHandle;
> -  TPM_NONCE   NonceOdd;   // system
> -  TPM_NONCE   NonceEven;   // TPM
> -  BOOL   fContinueAuthSession;
> -  TPM_AUTHDATA  HMAC;
> -} TCS_AUTH;
> -
> -// structures for dealing with sizes followed by buffers in all the
> -// TCG structure.
> -typedef struct pack_buf_t {
> -  UINT32 size;
> -  BYTE * data;
> -} pack_buf_t;
> -
> -typedef struct pack_constbuf_t {
> -  UINT32 size;
> -  const BYTE* data;
> -} pack_constbuf_t;
> -
> -
> -
> -// **************************** CONSTANTS *********************************
> -
> -// BOOL values
> -#define TRUE 0x01
> -#define FALSE 0x00
> -
> -#define TCPA_MAX_BUFFER_LENGTH 0x2000
> -
> -//
> -// TPM_COMMAND_CODE values
> -#define TPM_PROTECTED_ORDINAL 0x00000000UL
> -#define TPM_UNPROTECTED_ORDINAL 0x80000000UL
> -#define TPM_CONNECTION_ORDINAL 0x40000000UL
> -#define TPM_VENDOR_ORDINAL 0x20000000UL
> -
> -#define TPM_ORD_OIAP                     (10UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_OSAP                     (11UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ChangeAuth               (12UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_TakeOwnership            (13UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ChangeAuthAsymStart      (14UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ChangeAuthAsymFinish     (15UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ChangeAuthOwner          (16UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Extend                   (20UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_PcrRead                  (21UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Quote                    (22UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Seal                     (23UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Unseal                   (24UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DirWriteAuth             (25UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DirRead                  (26UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_UnBind                   (30UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CreateWrapKey            (31UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadKey                  (32UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetPubKey                (33UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_EvictKey                 (34UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CreateMigrationBlob      (40UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ReWrapKey                (41UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ConvertMigrationBlob     (42UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_AuthorizeMigrationKey    (43UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CreateMaintenanceArchive (44UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadMaintenanceArchive   (45UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_KillMaintenanceFeature   (46UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadManuMaintPub         (47UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ReadManuMaintPub         (48UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CertifyKey               (50UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Sign                     (60UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetRandom                (70UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_StirRandom               (71UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SelfTestFull             (80UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SelfTestStartup          (81UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CertifySelfTest          (82UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ContinueSelfTest         (83UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetTestResult            (84UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Reset                    (90UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_OwnerClear               (91UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DisableOwnerClear        (92UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ForceClear               (93UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DisableForceClear        (94UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetCapabilitySigned      (100UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetCapability            (101UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetCapabilityOwner       (102UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_OwnerSetDisable          (110UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_PhysicalEnable           (111UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_PhysicalDisable          (112UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SetOwnerInstall          (113UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_PhysicalSetDeactivated   (114UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SetTempDeactivated       (115UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_CreateEndorsementKeyPair (120UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_MakeIdentity             (121UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ActivateIdentity         (122UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_ReadPubek                (124UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_OwnerReadPubek           (125UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_DisablePubekRead         (126UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetAuditEvent            (130UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetAuditEventSigned      (131UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_GetOrdinalAuditStatus    (140UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SetOrdinalAuditStatus    (141UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Terminate_Handle         (150UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Init                     (151UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SaveState                (152UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_Startup                  (153UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SetRedirection           (154UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SHA1Start                (160UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SHA1Update               (161UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SHA1Complete             (162UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SHA1CompleteExtend       (163UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_FieldUpgrade             (170UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SaveKeyContext           (180UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadKeyContext           (181UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_SaveAuthContext          (182UL + TPM_PROTECTED_ORDINAL)
> -#define TPM_ORD_LoadAuthContext          (183UL + TPM_PROTECTED_ORDINAL)
> -#define TSC_ORD_PhysicalPresence         (10UL + TPM_CONNECTION_ORDINAL)
> -
> -
> -
> -//
> -// TPM_RESULT values
> -//
> -// just put in the whole table from spec 1.2
> -
> -#define TPM_BASE   0x0 // The start of TPM return codes
> -#define TPM_VENDOR_ERROR 0x00000400 // Mask to indicate that the error code is vendor specific for vendor specific commands
> -#define TPM_NON_FATAL  0x00000800 // Mask to indicate that the error code is a non-fatal failure.
> -
> -#define TPM_SUCCESS   TPM_BASE // Successful completion of the operation
> -#define TPM_AUTHFAIL      TPM_BASE + 1 // Authentication failed
> -#define TPM_BADINDEX      TPM_BASE + 2 // The index to a PCR, DIR or other register is incorrect
> -#define TPM_BAD_PARAMETER     TPM_BASE + 3 // One or more parameter is bad
> -#define TPM_AUDITFAILURE     TPM_BASE + 4 // An operation completed successfully but the auditing of that operation failed.
> -#define TPM_CLEAR_DISABLED     TPM_BASE + 5 // The clear disable flag is set and all clear operations now require physical access
> -#define TPM_DEACTIVATED     TPM_BASE + 6 // The TPM is deactivated
> -#define TPM_DISABLED      TPM_BASE + 7 // The TPM is disabled
> -#define TPM_DISABLED_CMD     TPM_BASE + 8 // The target command has been disabled
> -#define TPM_FAIL       TPM_BASE + 9 // The operation failed
> -#define TPM_BAD_ORDINAL     TPM_BASE + 10 // The ordinal was unknown or inconsistent
> -#define TPM_INSTALL_DISABLED   TPM_BASE + 11 // The ability to install an owner is disabled
> -#define TPM_INVALID_KEYHANDLE  TPM_BASE + 12 // The key handle presented was invalid
> -#define TPM_KEYNOTFOUND     TPM_BASE + 13 // The target key was not found
> -#define TPM_INAPPROPRIATE_ENC  TPM_BASE + 14 // Unacceptable encryption scheme
> -#define TPM_MIGRATEFAIL     TPM_BASE + 15 // Migration authorization failed
> -#define TPM_INVALID_PCR_INFO   TPM_BASE + 16 // PCR information could not be interpreted
> -#define TPM_NOSPACE      TPM_BASE + 17 // No room to load key.
> -#define TPM_NOSRK       TPM_BASE + 18 // There is no SRK set
> -#define TPM_NOTSEALED_BLOB     TPM_BASE + 19 // An encrypted blob is invalid or was not created by this TPM
> -#define TPM_OWNER_SET      TPM_BASE + 20 // There is already an Owner
> -#define TPM_RESOURCES      TPM_BASE + 21 // The TPM has insufficient internal resources to perform the requested action.
> -#define TPM_SHORTRANDOM     TPM_BASE + 22 // A random string was too short
> -#define TPM_SIZE       TPM_BASE + 23 // The TPM does not have the space to perform the operation.
> -#define TPM_WRONGPCRVAL     TPM_BASE + 24 // The named PCR value does not match the current PCR value.
> -#define TPM_BAD_PARAM_SIZE     TPM_BASE + 25 // The paramSize argument to the command has the incorrect value
> -#define TPM_SHA_THREAD      TPM_BASE + 26 // There is no existing SHA-1 thread.
> -#define TPM_SHA_ERROR      TPM_BASE + 27 // The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error.
> -#define TPM_FAILEDSELFTEST     TPM_BASE + 28 // Self-test has failed and the TPM has shutdown.
> -#define TPM_AUTH2FAIL      TPM_BASE + 29 // The authorization for the second key in a 2 key function failed authorization
> -#define TPM_BADTAG       TPM_BASE + 30 // The tag value sent to for a command is invalid
> -#define TPM_IOERROR      TPM_BASE + 31 // An IO error occurred transmitting information to the TPM
> -#define TPM_ENCRYPT_ERROR     TPM_BASE + 32 // The encryption process had a problem.
> -#define TPM_DECRYPT_ERROR     TPM_BASE + 33 // The decryption process did not complete.
> -#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 // An invalid handle was used.
> -#define TPM_NO_ENDORSEMENT     TPM_BASE + 35 // The TPM does not a EK installed
> -#define TPM_INVALID_KEYUSAGE   TPM_BASE + 36 // The usage of a key is not allowed
> -#define TPM_WRONG_ENTITYTYPE   TPM_BASE + 37 // The submitted entity type is not allowed
> -#define TPM_INVALID_POSTINIT   TPM_BASE + 38 // The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup
> -#define TPM_INAPPROPRIATE_SIG  TPM_BASE + 39 // Signed data cannot include additional DER information
> -#define TPM_BAD_KEY_PROPERTY   TPM_BASE + 40 // The key properties in TPM_KEY_PARMs are not supported by this TPM
> -
> -#define TPM_BAD_MIGRATION      TPM_BASE + 41 // The migration properties of this key are incorrect.
> -#define TPM_BAD_SCHEME       TPM_BASE + 42 // The signature or encryption scheme for this key is incorrect or not permitted in this situation.
> -#define TPM_BAD_DATASIZE      TPM_BASE + 43 // The size of the data (or blob) parameter is bad or inconsistent with the referenced key
> -#define TPM_BAD_MODE       TPM_BASE + 44 // A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob.
> -#define TPM_BAD_PRESENCE      TPM_BASE + 45 // Either the physicalPresence or physicalPresenceLock bits have the wrong value
> -#define TPM_BAD_VERSION      TPM_BASE + 46 // The TPM cannot perform this version of the capability
> -#define TPM_NO_WRAP_TRANSPORT     TPM_BASE + 47 // The TPM does not allow for wrapped transport sessions
> -#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 // TPM audit construction failed and the underlying command was returning a failure code also
> -#define TPM_AUDITFAIL_SUCCESSFUL   TPM_BASE + 49 // TPM audit construction failed and the underlying command was returning success
> -#define TPM_NOTRESETABLE      TPM_BASE + 50 // Attempt to reset a PCR register that does not have the resettable attribute
> -#define TPM_NOTLOCAL       TPM_BASE + 51 // Attempt to reset a PCR register that requires locality and locality modifier not part of command transport
> -#define TPM_BAD_TYPE       TPM_BASE + 52 // Make identity blob not properly typed
> -#define TPM_INVALID_RESOURCE     TPM_BASE + 53 // When saving context identified resource type does not match actual resource
> -#define TPM_NOTFIPS       TPM_BASE + 54 // The TPM is attempting to execute a command only available when in FIPS mode
> -#define TPM_INVALID_FAMILY      TPM_BASE + 55 // The command is attempting to use an invalid family ID
> -#define TPM_NO_NV_PERMISSION     TPM_BASE + 56 // The permission to manipulate the NV storage is not available
> -#define TPM_REQUIRES_SIGN      TPM_BASE + 57 // The operation requires a signed command
> -#define TPM_KEY_NOTSUPPORTED     TPM_BASE + 58 // Wrong operation to load an NV key
> -#define TPM_AUTH_CONFLICT      TPM_BASE + 59 // NV_LoadKey blob requires both owner and blob authorization
> -#define TPM_AREA_LOCKED      TPM_BASE + 60 // The NV area is locked and not writtable
> -#define TPM_BAD_LOCALITY      TPM_BASE + 61 // The locality is incorrect for the attempted operation
> -#define TPM_READ_ONLY       TPM_BASE + 62 // The NV area is read only and can't be written to
> -#define TPM_PER_NOWRITE      TPM_BASE + 63 // There is no protection on the write to the NV area
> -#define TPM_FAMILYCOUNT      TPM_BASE + 64 // The family count value does not match
> -#define TPM_WRITE_LOCKED      TPM_BASE + 65 // The NV area has already been written to
> -#define TPM_BAD_ATTRIBUTES      TPM_BASE + 66 // The NV area attributes conflict
> -#define TPM_INVALID_STRUCTURE     TPM_BASE + 67 // The structure tag and version are invalid or inconsistent
> -#define TPM_KEY_OWNER_CONTROL     TPM_BASE + 68 // The key is under control of the TPM Owner and can only be evicted by the TPM Owner.
> -#define TPM_BAD_COUNTER      TPM_BASE + 69 // The counter handle is incorrect
> -#define TPM_NOT_FULLWRITE      TPM_BASE + 70 // The write is not a complete write of the area
> -#define TPM_CONTEXT_GAP      TPM_BASE + 71 // The gap between saved context counts is too large
> -#define TPM_MAXNVWRITES      TPM_BASE + 72 // The maximum number of NV writes without an owner has been exceeded
> -#define TPM_NOOPERATOR       TPM_BASE + 73 // No operator authorization value is set
> -#define TPM_RESOURCEMISSING     TPM_BASE + 74 // The resource pointed to by context is not loaded
> -#define TPM_DELEGATE_LOCK      TPM_BASE + 75 // The delegate administration is locked
> -#define TPM_DELEGATE_FAMILY     TPM_BASE + 76 // Attempt to manage a family other then the delegated family
> -#define TPM_DELEGATE_ADMIN      TPM_BASE + 77 // Delegation table management not enabled
> -#define TPM_TRANSPORT_EXCLUSIVE    TPM_BASE + 78 // There was a command executed outside of an exclusive transport session
> -
> -// TPM_STARTUP_TYPE values
> -#define TPM_ST_CLEAR 0x0001
> -#define TPM_ST_STATE 0x0002
> -#define TPM_ST_DEACTIVATED 0x003
> -
> -// TPM_TAG values
> -#define TPM_TAG_RQU_COMMAND 0x00c1
> -#define TPM_TAG_RQU_AUTH1_COMMAND 0x00c2
> -#define TPM_TAG_RQU_AUTH2_COMMAND 0x00c3
> -#define TPM_TAG_RSP_COMMAND 0x00c4
> -#define TPM_TAG_RSP_AUTH1_COMMAND 0x00c5
> -#define TPM_TAG_RSP_AUTH2_COMMAND 0x00c6
> -
> -// TPM_PAYLOAD_TYPE values
> -#define TPM_PT_ASYM 0x01
> -#define TPM_PT_BIND 0x02
> -#define TPM_PT_MIGRATE 0x03
> -#define TPM_PT_MAINT 0x04
> -#define TPM_PT_SEAL 0x05
> -
> -// TPM_ENTITY_TYPE values
> -#define TPM_ET_KEYHANDLE 0x0001
> -#define TPM_ET_OWNER 0x0002
> -#define TPM_ET_DATA 0x0003
> -#define TPM_ET_SRK 0x0004
> -#define TPM_ET_KEY 0x0005
> -
> -/// TPM_ResourceTypes
> -#define TPM_RT_KEY      0x00000001
> -#define TPM_RT_AUTH     0x00000002
> -#define TPM_RT_TRANS    0x00000004
> -#define TPM_RT_CONTEXT  0x00000005
> -
> -// TPM_PROTOCOL_ID values
> -#define TPM_PID_OIAP 0x0001
> -#define TPM_PID_OSAP 0x0002
> -#define TPM_PID_ADIP 0x0003
> -#define TPM_PID_ADCP 0x0004
> -#define TPM_PID_OWNER 0x0005
> -
> -// TPM_ALGORITHM_ID values
> -#define TPM_ALG_RSA 0x00000001
> -#define TPM_ALG_DES 0x00000002
> -#define TPM_ALG_3DES 0X00000003
> -#define TPM_ALG_SHA 0x00000004
> -#define TPM_ALG_HMAC 0x00000005
> -#define TCPA_ALG_AES 0x00000006
> -
> -// TPM_ENC_SCHEME values
> -#define TPM_ES_NONE 0x0001
> -#define TPM_ES_RSAESPKCSv15 0x0002
> -#define TPM_ES_RSAESOAEP_SHA1_MGF1 0x0003
> -
> -// TPM_SIG_SCHEME values
> -#define TPM_SS_NONE 0x0001
> -#define TPM_SS_RSASSAPKCS1v15_SHA1 0x0002
> -#define TPM_SS_RSASSAPKCS1v15_DER 0x0003
> -
> -// TPM_KEY_USAGE values
> -#define TPM_KEY_EK 0x0000
> -#define TPM_KEY_SIGNING 0x0010
> -#define TPM_KEY_STORAGE 0x0011
> -#define TPM_KEY_IDENTITY 0x0012
> -#define TPM_KEY_AUTHCHANGE 0X0013
> -#define TPM_KEY_BIND 0x0014
> -#define TPM_KEY_LEGACY 0x0015
> -
> -// TPM_AUTH_DATA_USAGE values
> -#define TPM_AUTH_NEVER 0x00
> -#define TPM_AUTH_ALWAYS 0x01
> -
> -// Key Handle of owner and srk
> -#define TPM_OWNER_KEYHANDLE 0x40000001
> -#define TPM_SRK_KEYHANDLE 0x40000000
> -
> -// ---------------------- Functions for checking TPM_RESULTs -----------------
> -
> -#include <stdio.h>
> -
> -// FIXME: Review use of these and delete unneeded ones.
> -
> -// these are really badly dependent on local structure:
> -// DEPENDS: local var 'status' of type TPM_RESULT
> -// DEPENDS: label 'abort_egress' which cleans up and returns the status
> -#define ERRORDIE(s) do { status = s; \
> -                         fprintf (stderr, "*** ERRORDIE in %s at %s: %i\n", __func__, __FILE__, __LINE__); \
> -                         goto abort_egress; } \
> -                    while (0)
> -
> -// DEPENDS: local var 'status' of type TPM_RESULT
> -// DEPENDS: label 'abort_egress' which cleans up and returns the status
> -// Try command c. If it fails, set status to s and goto abort.
> -#define TPMTRY(s,c) if (c != TPM_SUCCESS) { \
> -                       status = s; \
> -                       printf("ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
> -                       goto abort_egress; \
> -                    } else {\
> -                       status = c; \
> -                    }
> -
> -// Try command c. If it fails, print error message, set status to actual return code. Goto abort
> -#define TPMTRYRETURN(c) do { status = c; \
> -                             if (status != TPM_SUCCESS) { \
> -                               fprintf(stderr, "ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
> -                               goto abort_egress; \
> -                             } \
> -                        } while(0)
> -
> -
> -#pragma pack(pop)
> -
> -#endif //__TCPA_H__
> diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c
> index 3b89223..0ba1d55 100644
> --- a/tools/xenstore/hashtable.c
> +++ b/tools/xenstore/hashtable.c
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/blktap2/drivers/hashtable.c
> - *  - tools/vtpm_manager/util/hashtable.c
>   */
>
>  #include "hashtable.h"
> diff --git a/tools/xenstore/hashtable.h b/tools/xenstore/hashtable.h
> index 8e6bb5b..4d68223 100644
> --- a/tools/xenstore/hashtable.h
> +++ b/tools/xenstore/hashtable.h
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/blktap2/drivers/hashtable.h
> - *  - tools/vtpm_manager/util/hashtable.h
>   */
>
>  #ifndef __HASHTABLE_CWC22_H__
> diff --git a/tools/xenstore/hashtable_private.h b/tools/xenstore/hashtable_private.h
> index cabaffe..a08559d 100644
> --- a/tools/xenstore/hashtable_private.h
> +++ b/tools/xenstore/hashtable_private.h
> @@ -3,7 +3,6 @@
>  /*
>   * There are duplicates of this code in:
>   *  - tools/blktap2/drivers/hashtable_private.h
> - *  - tools/vtpm_manager/util/hashtable_private.h
>   */
>
>  #ifndef __HASHTABLE_PRIVATE_CWC22_H__
> diff --git a/tools/xm-test/configure.ac b/tools/xm-test/configure.ac
> index ad1eb78..c142140 100644
> --- a/tools/xm-test/configure.ac
> +++ b/tools/xm-test/configure.ac
> @@ -143,7 +143,6 @@ AC_CONFIG_FILES([
>      tests/unpause/Makefile
>      tests/vcpu-pin/Makefile
>      tests/vcpu-disable/Makefile
> -    tests/vtpm/Makefile
>      tests/xapi/Makefile
>      tests/enforce_dom0_cpus/Makefile
>      tests/cpupool/Makefile
> diff --git a/tools/xm-test/grouptest/default b/tools/xm-test/grouptest/default
> index f0516b2..e04591b 100644
> --- a/tools/xm-test/grouptest/default
> +++ b/tools/xm-test/grouptest/default
> @@ -27,5 +27,4 @@ sysrq
>  unpause
>  vcpu-disable
>  vcpu-pin
> -vtpm
>  xapi
> diff --git a/tools/xm-test/grouptest/medium b/tools/xm-test/grouptest/medium
> index bafc988..5c3e1b1 100644
> --- a/tools/xm-test/grouptest/medium
> +++ b/tools/xm-test/grouptest/medium
> @@ -22,4 +22,3 @@ sysrq 01_sysrq_basic_neg.test 02_sysrq_sync_pos.test
>  unpause
>  vcpu-disable
>  vcpu-pin
> -vtpm
> diff --git a/tools/xm-test/grouptest/xapi b/tools/xm-test/grouptest/xapi
> index 3b04921..7a08b77 100644
> --- a/tools/xm-test/grouptest/xapi
> +++ b/tools/xm-test/grouptest/xapi
> @@ -1,2 +1 @@
>  xapi
> -vtpm 09_vtpm-xapi.test
> diff --git a/tools/xm-test/lib/XmTestLib/XenDomain.py b/tools/xm-test/lib/XmTestLib/XenDomain.py
> index ae8c550..3ba7433 100644
> --- a/tools/xm-test/lib/XmTestLib/XenDomain.py
> +++ b/tools/xm-test/lib/XmTestLib/XenDomain.py
> @@ -59,7 +59,6 @@ class XenConfig:
>          # These options need to be lists
>          self.defaultOpts["disk"] = []
>          self.defaultOpts["vif"]  = []
> -        self.defaultOpts["vtpm"] = []
>
>          self.opts = self.defaultOpts
>
> diff --git a/tools/xm-test/tests/Makefile.am b/tools/xm-test/tests/Makefile.am
> index 8d673ed..455f50c 100644
> --- a/tools/xm-test/tests/Makefile.am
> +++ b/tools/xm-test/tests/Makefile.am
> @@ -25,7 +25,6 @@ SUBDIRS =                     \
>                 unpause         \
>                 vcpu-disable    \
>                 vcpu-pin        \
> -               vtpm            \
>                 enforce_dom0_cpus       \
>                 save restore migrate    \
>                 cpupool
> diff --git a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py b/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
> deleted file mode 100644
> index dfd1227..0000000
> --- a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
> +++ /dev/null
> @@ -1,40 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                verify list
> -
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -
> -try:
> -    domain.start(noConsole=True)
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    vtpm_cleanup(domain.getName())
> -    FAIL("Unable to create domain")
> -
> -
> -domName = domain.getName()
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -status, output = traceCommand("xm vtpm-list %s" % domain.getId())
> -eyecatcher = "/local/domain/0/backend/vtpm"
> -where = output.find(eyecatcher)
> -if status != 0:
> -    FAIL("xm vtpm-list returned bad status, expected 0, status is %i" % status)
> -elif where < 0:
> -    FAIL("Fail to list virtual TPM device")
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py b/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
> deleted file mode 100644
> index a18cbab..0000000
> --- a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
> +++ /dev/null
> @@ -1,49 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                check list of pcrs
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -domain.closeConsole()
> -
> -domain.stop()
> -
> -if not re.search("PCR-00:",run["output"]):
> -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> diff --git a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py b/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
> deleted file mode 100644
> index b863f27..0000000
> --- a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
> +++ /dev/null
> @@ -1,99 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                check list of pcrs; suspend and resume the domain and
> -#                check list of pcrs again
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm save %s %s.save" %
> -                                      (domName, domName),
> -                                      timeout=30)
> -
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm save did not succeed")
> -
> -    try:
> -        status, ouptut = traceCommand("xm restore %s.save" %
> -                                      (domName),
> -                                      timeout=30)
> -    except TimeoutError, e:
> -        os.remove("%s.save" % domName)
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    os.remove("%s.save" % domName)
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm restore did not succeed")
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL(str(e))
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> -
> diff --git a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py b/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
> deleted file mode 100644
> index ccc8b73..0000000
> --- a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
> +++ /dev/null
> @@ -1,93 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                check list of pcrs; locally migrate the domain and
> -#                check list of pcrs again
> -#                This test does local live migration.
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -old_domid = domid(domName)
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm migrate -l %s localhost" %
> -                                      domName,
> -                                      timeout=90)
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm migrate did not succeed. External device migration activated?")
> -
> -
> -    domName = domain.getName()
> -    new_domid = domid(domName)
> -
> -    if (old_domid == new_domid):
> -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> -             (old_domid,loop))
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL("No result from dumping the PCRs")
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py b/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py
> deleted file mode 100644
> index 57b87df..0000000
> --- a/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py
> +++ /dev/null
> @@ -1,93 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                check list of pcrs; locally migrate the domain and
> -#                check list of pcrs again
> -#                This test does local (non-live) migration.
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -old_domid = domid(domName)
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm migrate %s localhost" %
> -                                      domName,
> -                                      timeout=90)
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm migrate did not succeed. External device migration activated?")
> -
> -
> -    domName = domain.getName()
> -    new_domid = domid(domName)
> -
> -    if (old_domid == new_domid):
> -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> -             (old_domid,loop))
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL("No result from dumping the PCRs")
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py b/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
> deleted file mode 100644
> index c70691d..0000000
> --- a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
> +++ /dev/null
> @@ -1,125 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                extend a pcr
> -#                check list of pcrs; suspend and resume the domain and
> -#                check list of pcrs again and validate extended pcr
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("mknod /dev/tpm0 c 10 224")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while creating /dev/tpm0")
> -
> -try:
> -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while extending PCR 0")
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm save %s %s.save" %
> -                                      (domName, domName),
> -                                      timeout=30)
> -
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm save did not succeed")
> -
> -    try:
> -        status, ouptut = traceCommand("xm restore %s.save" %
> -                                      (domName),
> -                                      timeout=30)
> -    except TimeoutError, e:
> -        os.remove("%s.save" % domName)
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    os.remove("%s.save" % domName)
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm restore did not succeed")
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL(str(e))
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> -
> diff --git a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py b/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
> deleted file mode 100644
> index 4ff3360..0000000
> --- a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
> +++ /dev/null
> @@ -1,119 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                extend a pcr
> -#                check list of pcrs; locally migrate the domain and
> -#                check list of pcrs again and validate extended pcr
> -#                This test does local live migration.
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("mknod /dev/tpm0 c 10 224")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while creating /dev/tpm0")
> -
> -try:
> -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while extending PCR 0")
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -old_domid = domid(domName)
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm migrate -l %s localhost" %
> -                                      domName,
> -                                      timeout=90)
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm migrate did not succeed. External device migration activated?")
> -
> -
> -    domName = domain.getName()
> -    new_domid = domid(domName)
> -
> -    if (old_domid == new_domid):
> -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> -             (old_domid,loop))
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL("No result from dumping the PCRs")
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py b/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
> deleted file mode 100644
> index 27125fc..0000000
> --- a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
> +++ /dev/null
> @@ -1,119 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Positive Test: create domain with virtual TPM attached at build time,
> -#                extend a pcr
> -#                check list of pcrs; locally migrate the domain and
> -#                check list of pcrs again and validate extended pcr
> -#                This test does local (non-live) migration.
> -
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -import os.path
> -import atexit
> -
> -config = {"vtpm":"instance=1,backend=0"}
> -domain = XmTestDomain(extraConfig=config)
> -domName = domain.getName()
> -consoleHistory = ""
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    if verbose:
> -        print e.extra
> -    FAIL("Unable to create domain (%s)" % domName)
> -
> -atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("mknod /dev/tpm0 c 10 224")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while creating /dev/tpm0")
> -
> -try:
> -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("Error while extending PCR 0")
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("No result from dumping the PCRs")
> -
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
> -
> -consoleHistory = console.getHistory()
> -domain.closeConsole()
> -
> -old_domid = domid(domName)
> -
> -loop = 0
> -while loop < 3:
> -    try:
> -        status, ouptut = traceCommand("xm migrate %s localhost" %
> -                                      domName,
> -                                      timeout=90)
> -    except TimeoutError, e:
> -        saveLog(consoleHistory)
> -        FAIL(str(e))
> -
> -    if status != 0:
> -        saveLog(consoleHistory)
> -        FAIL("xm migrate did not succeed. External device migration activated?")
> -
> -
> -    domName = domain.getName()
> -    new_domid = domid(domName)
> -
> -    if (old_domid == new_domid):
> -        FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
> -             (old_domid,loop))
> -
> -    try:
> -        console = domain.getConsole()
> -    except ConsoleError, e:
> -        FAIL(str(e))
> -
> -    try:
> -        run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -    except ConsoleError, e:
> -        saveLog(console.getHistory())
> -        FAIL("No result from dumping the PCRs")
> -
> -    if not re.search("PCR-00:",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
> -
> -    if not re.search("PCR-00: 1E A7 BD",run["output"]):
> -        saveLog(console.getHistory())
> -        FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
> -
> -    loop += 1
> -
> -domain.closeConsole()
> -
> -domain.stop()
> diff --git a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py b/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
> deleted file mode 100644
> index a1aa8b3..0000000
> --- a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
> +++ /dev/null
> @@ -1,158 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -# Test to test the vtpm class through the Xen-API
> -#
> -# Tested methods:
> -#  VTPM: get_uuid, get_backend, get_by_uuid, get_record
> -#        create, destroy, get_VM
> -#  VM: get_VTPMS
> -
> -from XmTestLib import xapi
> -from XmTestLib.XenAPIDomain import XmTestAPIDomain
> -from XmTestLib import *
> -from vtpm_utils import *
> -import commands
> -import os
> -
> -VTPM_RECORD_KEYS = [ 'backend', 'VM', 'uuid', 'other_config' ]
> -
> -try:
> -    # XmTestAPIDomain tries to establish a connection to XenD
> -    domain = XmTestAPIDomain()
> -except Exception, e:
> -    SKIP("Skipping test. Error: %s" % str(e))
> -vm_uuid = domain.get_uuid()
> -
> -vtpmcfg = {}
> -vtpmcfg['backend'] = DOM0_UUID
> -vtpmcfg['VM'] = vm_uuid
> -
> -session = xapi.connect()
> -
> -vtpm_uuid = session.xenapi.VTPM.create(vtpmcfg)
> -
> -vtpm_be = session.xenapi.VTPM.get_backend(vtpm_uuid)
> -if vtpm_be != vtpmcfg['backend']:
> -    FAIL("vTPM's backend is in '%s', expected: '%s'" %
> -         (vtpm_be, vtpmcfg['backend']))
> -
> -vtpm_rec = session.xenapi.VTPM.get_record(vtpm_uuid)
> -
> -miss_keys = []
> -for k in VTPM_RECORD_KEYS:
> -    if k not in vtpm_rec.keys():
> -        miss_keys.append(k)
> -if len(miss_keys) > 0:
> -    FAIL("vTPM record is missing key(s): %s" % miss_keys)
> -
> -if vtpm_rec['uuid']  != vtpm_uuid:
> -    FAIL("vTPM record shows vtpm uuid '%s', expected: '%s'" %
> -         (vtpm_rec['uuid'], vtpm_uuid))
> -if vtpm_rec['VM']  != vm_uuid:
> -    FAIL("vTPM record shows VM uuid '%s', expected: '%s'" %
> -         (vtpm_rec['VM'], vm_uuid))
> -if vtpm_rec['backend'] != vtpmcfg['backend']:
> -    FAIL("vTPM record shows VM bakcned '%s', expected: '%s'" %
> -         (vtpm_rev['backend'], vtpmcfg['backend']))
> -
> -badkeys = []
> -keys = vtpm_rec.keys()
> -for k in keys:
> -    if k not in VTPM_RECORD_KEYS:
> -        badkeys.append(k)
> -if len(badkeys) > 0:
> -    FAIL("Unexpected attributes in result: %s" % badkeys)
> -
> -if vm_uuid != session.xenapi.VTPM.get_VM(vtpm_uuid):
> -    FAIL("VM uuid from VTPM.get_VM different (%s) than expected (%s)." %
> -         (vm_ref, vm_uuid))
> -
> -uuid = session.xenapi.VTPM.get_uuid(vtpm_uuid)
> -if uuid != vtpm_uuid:
> -    FAIL("vTPM from VTPM.get_uuid different (%s) than expected (%s)." %
> -         (uuid, vtpm_uuid))
> -
> -vtpm_ref = session.xenapi.VTPM.get_by_uuid(vtpm_uuid)
> -if vtpm_ref != vtpm_uuid:
> -    FAIL("vTPM from VTPM.get_by_uuid different (%s) than expected (%s)." %
> -         (vtpm_ref, vtpm_uuid))
> -
> -vm_vtpms = session.xenapi.VM.get_VTPMs(vm_uuid)
> -if len(vm_vtpms) != 1:
> -    FAIL("Number of vTPMs from get_VTPMs is (%d) not what was expected (%d)" %
> -         (len(vm_vtpms), 1))
> -if vtpm_uuid not in vm_vtpms:
> -    FAIL("Other vTPM uuid (%s) returned from VM.get_VTPMs than expected (%s)" %
> -         (vm_vtpms[0], vtpm_uuid))
> -
> -try:
> -    console = domain.start()
> -except DomainError, e:
> -    FAIL("Unable to create domain.")
> -
> -try:
> -    console.sendInput("input")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("1. No result from dumping the PCRs")
> -
> -if re.search("No such file",run["output"]):
> -    FAIL("TPM frontend support not compiled into (domU?) kernel")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("1. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -try:
> -    session.xenapi.VTPM.destroy(vtpm_uuid)
> -    #Should never get here
> -    FAIL("Could destroy vTPM while VM is running")
> -except:
> -    pass
> -
> -rc = session.xenapi.VM.suspend(vm_uuid)
> -if rc:
> -    FAIL("Could not suspend VM")
> -
> -try:
> -    session.xenapi.VTPM.destroy(vtpm_uuid)
> -    #May not throw an exception in 'suspend' state
> -except:
> -    pass
> -
> -rc = session.xenapi.VM.resume(vm_uuid, False)
> -if rc:
> -    FAIL("Could not resume VM")
> -
> -try:
> -    console = domain.getConsole()
> -except ConsoleError, e:
> -    FAIL(str(e))
> -
> -try:
> -    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
> -except ConsoleError, e:
> -    saveLog(console.getHistory())
> -    FAIL("2. No result from dumping the PCRs. vTPM has been removed?")
> -
> -if not re.search("PCR-00:",run["output"]):
> -    saveLog(console.getHistory())
> -    FAIL("2. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
> -
> -domain.stop()
> -
> -try:
> -    session.xenapi.VTPM.destroy(vtpm_uuid)
> -except:
> -    FAIL("Could NOT destroy vTPM while domain is halted.")
> -
> -domain.destroy()
> diff --git a/tools/xm-test/tests/vtpm/Makefile.am b/tools/xm-test/tests/vtpm/Makefile.am
> deleted file mode 100644
> index dd67e45..0000000
> --- a/tools/xm-test/tests/vtpm/Makefile.am
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -SUBDIRS =
> -
> -TESTS = 01_vtpm-list_pos.test \
> -        02_vtpm-cat_pcrs.test \
> -        03_vtpm-susp_res.test \
> -        04_vtpm-loc_migr.test \
> -        05_vtpm-loc_migr.test \
> -        06_vtpm-susp_res_pcrs.test \
> -        07_vtpm-mig_pcrs.test \
> -        08_vtpm-mig_pcrs.test \
> -        09_vtpm-xapi.test
> -
> -XFAIL_TESTS =
> -
> -EXTRA_DIST = $(TESTS) $(XFAIL_TESTS) vtpm_utils.py
> -TESTS_ENVIRONMENT=@TENV@
> -
> -%.test: %.py
> -       cp $< $@
> -       chmod +x $@
> -
> -clean-local: am_config_clean-local
> -
> -am_config_clean-local:
> -       rm -f *test
> -       rm -f *log
> -       rm -f *~
> diff --git a/tools/xm-test/tests/vtpm/vtpm_utils.py b/tools/xm-test/tests/vtpm/vtpm_utils.py
> deleted file mode 100644
> index 4e5b281..0000000
> --- a/tools/xm-test/tests/vtpm/vtpm_utils.py
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -#!/usr/bin/python
> -
> -# Copyright (C) International Business Machines Corp., 2006
> -# Author: Stefan Berger <stefanb@us.ibm.com>
> -
> -from XmTestLib import *
> -
> -if ENABLE_HVM_SUPPORT:
> -    SKIP("vtpm tests not supported for HVM domains")
> -
> -status, output = traceCommand("COLUMNS=200 ; "
> -                              "ps aux | grep vtpm_manager | grep -v grep")
> -if output == "":
> -    SKIP("virtual TPM manager must be started to run this test; might "
> -         "need /dev/tpm0")
> -
> -def vtpm_cleanup(domName):
> -    traceCommand("/etc/xen/scripts/vtpm-delete "
> -                 "`xenstore-read /local/domain/0/backend/vtpm/%s/0/uuid`" %
> -                 str(domid(domName)))
> -
> -def vtpm_cleanup(uuid):
> -    from xen.xm import main
> -    if main.serverType != main.SERVER_XEN_API:
> -        traceCommand("/etc/xen/scripts/vtpm-delete %s" % uuid)
> -
> -def vtpm_get_uuid(domainid):
> -    s, o = traceCommand("xenstore-read "
> -                        "/local/domain/0/backend/vtpm/%s/0/uuid" % domainid)
> -    return o
> --
> 1.7.10.4
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:11:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:11:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYI9N-0006p5-2Y; Tue, 13 Nov 2012 15:11:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYI9L-0006oZ-Fi
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 15:11:39 +0000
Received: from [85.158.138.51:52868] by server-11.bemta-3.messagelabs.com id
	61/B1-19361-A2362A05; Tue, 13 Nov 2012 15:11:38 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352819498!21775298!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5819 invoked from network); 13 Nov 2012 15:11:38 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:11:38 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15781974"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:11:38 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 15:11:37 +0000
Message-ID: <1352819496.7491.89.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
Date: Tue, 13 Nov 2012 15:11:36 +0000
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48A23D7A30@aplesstripe.dom1.jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
	<068F06DC4D106941B297C0C5F9F446EA48A229F471@aplesstripe.dom1.jhuapl.edu>
	<1352819016.7491.84.camel@zakaz.uk.xensource.com>
	<068F06DC4D106941B297C0C5F9F446EA48A23D7A30@aplesstripe.dom1.jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On Tue, 2012-11-13 at 15:07 +0000, Fioravante, Matthew E. wrote:
> Xend/xm was not changed at all so it should work fine for people not
> using vtpm. However it still "supports" vtpm devices from the old
> process mode, which now will not work and possibly crash, hang, or
> cause an error. It may be confusing to users to see vtpm support in
> xm, thinking it will work with the new vtpm system.

Are there any xm/xend docs which could be updated to clearly state that
this stuff doesn't work?

I'd also be happy with a patch which added a check and error message at
the entry point (e.g. tools/python/xen/xm/create.py) without any attempt
to root out the support from the underlying code.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:11:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:11:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYI9N-0006p5-2Y; Tue, 13 Nov 2012 15:11:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYI9L-0006oZ-Fi
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 15:11:39 +0000
Received: from [85.158.138.51:52868] by server-11.bemta-3.messagelabs.com id
	61/B1-19361-A2362A05; Tue, 13 Nov 2012 15:11:38 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352819498!21775298!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5819 invoked from network); 13 Nov 2012 15:11:38 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:11:38 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15781974"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:11:38 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 15:11:37 +0000
Message-ID: <1352819496.7491.89.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
Date: Tue, 13 Nov 2012 15:11:36 +0000
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48A23D7A30@aplesstripe.dom1.jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
	<068F06DC4D106941B297C0C5F9F446EA48A229F471@aplesstripe.dom1.jhuapl.edu>
	<1352819016.7491.84.camel@zakaz.uk.xensource.com>
	<068F06DC4D106941B297C0C5F9F446EA48A23D7A30@aplesstripe.dom1.jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On Tue, 2012-11-13 at 15:07 +0000, Fioravante, Matthew E. wrote:
> Xend/xm was not changed at all so it should work fine for people not
> using vtpm. However it still "supports" vtpm devices from the old
> process mode, which now will not work and possibly crash, hang, or
> cause an error. It may be confusing to users to see vtpm support in
> xm, thinking it will work with the new vtpm system.

Are there any xm/xend docs which could be updated to clearly state that
this stuff doesn't work?

I'd also be happy with a patch which added a check and error message at
the entry point (e.g. tools/python/xen/xm/create.py) without any attempt
to root out the support from the underlying code.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:15:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:15:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYICb-00072H-QN; Tue, 13 Nov 2012 15:15:01 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TYICa-00072A-Fn
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 15:15:00 +0000
Received: from [193.109.254.147:3773] by server-5.bemta-14.messagelabs.com id
	9C/FD-10257-3F362A05; Tue, 13 Nov 2012 15:14:59 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1352819693!10797672!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11355 invoked from network); 13 Nov 2012 15:14:55 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:14:55 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44420510"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:14:14 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:14:11 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TYIBm-0007r7-K7	for
	xen-devel@lists.xen.org; Tue, 13 Nov 2012 15:14:10 +0000
Message-ID: <50A263C2.4050703@citrix.com>
Date: Tue, 13 Nov 2012 15:14:10 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel@lists.xen.org
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
	<1352809049.7491.70.camel@zakaz.uk.xensource.com>
	<20121113123910.GE44675@ocelot.phlegethon.org>
	<50A2656C02000078000A82D4@nat28.tlf.novell.com>
	<20121113144356.GG44675@ocelot.phlegethon.org>
In-Reply-To: <20121113144356.GG44675@ocelot.phlegethon.org>
X-Enigmail-Version: 1.4.5
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>>> What about a little stub-asm return_from_nmi / reenable_nmis with
>>>> something like:
>>>> 	pushf
>>>>         pushq $__HYPERVISOR_CS
>>>> 	pushq 1f
>>>> 	iret
>>>> 1: ...
>>>>
>>>> That should re-enable NMIs at whichever point we think is appropriate?
>>> If an iret is what's needed then replacing self_nmi() with 'int $2'
>>> (i.e. the proposed patch) seems like a neater fix.  And section 6.7.1 of
>>> the manual suggests that iret is indeed what we want, so:
>> An IRET just cannot be the only thing that ends the NMI masked
>> window.  At least some forms of #VMENTER should have that
>> effect too, as otherwise NMIs would remain masked for arbitrary
>> periods of time.
>>
>> Further, under the assumption that the self_nmi() worked at least
>> in some cases (since you likely tested it), there would also be room
>> for the NMI not being masked when getting here. Which would get
>> us into the stack trouble that Andrew mentioned in his reply.
> I got the impression that Andrew and Malcolm were seeing a long loop of
> exit/self_nmi()/enter/NMI/exit/...,

Yes - thousands of instantaneous exits from the VM (the eip of the guest
is always the same while this is going on), and this is trivial
behaviour to demonstrate with a CPU-bound VCPU task.

>  eventually broken by a real
> interrupt or an IPI causing (by its iret) the NMI to get delivered in
> root mode.  So the NMI does get handled, just not immediately.

We are still not certain exactly what breaks the PCPU out of this cycle,
but timer interrupts were seen as the first deviation from the above cycle.

My interpretation of the Intel SDM manual along with the observable
evidence, is that NMIs are disabled from the vmexit until the vmresume
(as there appear to be no other irets on that path).  The action of
receiving a vmexit with reason NMI means that an external NMI has
occurred and we should run the handler.

With the current code, we raise a self_nmi(), which queues up a brand
new NMI to interrupt us as soon as we vmresume and NMIs are re-enabled.

>
> The fact that there was a loop and not just a delay in the NMI handling
> suggests that VMENTER does indeed re-enable NMIs (or at least
> NMI-exiting) but I couldn't find that in the manual.  In any case, I
> think the int $2 version is correcter than the direct call as it also
> disables normal interrupts.
>
> Tim.

With the asm("int $2") solution, we jump into the NMI handler (on the
NMI stack) with NMIs disabled (due to the vmexit), run the handler for
the real NMI which caused the vmexit in the first place, then iret from
the NMI handler which re-enables NMIs.  We are then free to take NMIs
for the remainder of the codepath back to the vmresume.

The question then becomes whether we wish to enable NMIs or not, which
affects whether we issue "int $2" or "do_nmi()".  Can someone from Intel
weigh in and confirm the exact behaviour of NMIs around this code?

(Irrespective of this question at hand, having read that LWN article
about nested NMIs, I am not certain that we are immune to the issue, so
should think about implementing a similar fix)

~Andrew

>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:15:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:15:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYICb-00072H-QN; Tue, 13 Nov 2012 15:15:01 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TYICa-00072A-Fn
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 15:15:00 +0000
Received: from [193.109.254.147:3773] by server-5.bemta-14.messagelabs.com id
	9C/FD-10257-3F362A05; Tue, 13 Nov 2012 15:14:59 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1352819693!10797672!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11355 invoked from network); 13 Nov 2012 15:14:55 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:14:55 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44420510"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:14:14 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:14:11 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TYIBm-0007r7-K7	for
	xen-devel@lists.xen.org; Tue, 13 Nov 2012 15:14:10 +0000
Message-ID: <50A263C2.4050703@citrix.com>
Date: Tue, 13 Nov 2012 15:14:10 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel@lists.xen.org
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
	<1352809049.7491.70.camel@zakaz.uk.xensource.com>
	<20121113123910.GE44675@ocelot.phlegethon.org>
	<50A2656C02000078000A82D4@nat28.tlf.novell.com>
	<20121113144356.GG44675@ocelot.phlegethon.org>
In-Reply-To: <20121113144356.GG44675@ocelot.phlegethon.org>
X-Enigmail-Version: 1.4.5
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>>> What about a little stub-asm return_from_nmi / reenable_nmis with
>>>> something like:
>>>> 	pushf
>>>>         pushq $__HYPERVISOR_CS
>>>> 	pushq 1f
>>>> 	iret
>>>> 1: ...
>>>>
>>>> That should re-enable NMIs at whichever point we think is appropriate?
>>> If an iret is what's needed then replacing self_nmi() with 'int $2'
>>> (i.e. the proposed patch) seems like a neater fix.  And section 6.7.1 of
>>> the manual suggests that iret is indeed what we want, so:
>> An IRET just cannot be the only thing that ends the NMI masked
>> window.  At least some forms of #VMENTER should have that
>> effect too, as otherwise NMIs would remain masked for arbitrary
>> periods of time.
>>
>> Further, under the assumption that the self_nmi() worked at least
>> in some cases (since you likely tested it), there would also be room
>> for the NMI not being masked when getting here. Which would get
>> us into the stack trouble that Andrew mentioned in his reply.
> I got the impression that Andrew and Malcolm were seeing a long loop of
> exit/self_nmi()/enter/NMI/exit/...,

Yes - thousands of instantaneous exits from the VM (the eip of the guest
is always the same while this is going on), and this is trivial
behaviour to demonstrate with a CPU-bound VCPU task.

>  eventually broken by a real
> interrupt or an IPI causing (by its iret) the NMI to get delivered in
> root mode.  So the NMI does get handled, just not immediately.

We are still not certain exactly what breaks the PCPU out of this cycle,
but timer interrupts were seen as the first deviation from the above cycle.

My interpretation of the Intel SDM manual along with the observable
evidence, is that NMIs are disabled from the vmexit until the vmresume
(as there appear to be no other irets on that path).  The action of
receiving a vmexit with reason NMI means that an external NMI has
occurred and we should run the handler.

With the current code, we raise a self_nmi(), which queues up a brand
new NMI to interrupt us as soon as we vmresume and NMIs are re-enabled.

>
> The fact that there was a loop and not just a delay in the NMI handling
> suggests that VMENTER does indeed re-enable NMIs (or at least
> NMI-exiting) but I couldn't find that in the manual.  In any case, I
> think the int $2 version is correcter than the direct call as it also
> disables normal interrupts.
>
> Tim.

With the asm("int $2") solution, we jump into the NMI handler (on the
NMI stack) with NMIs disabled (due to the vmexit), run the handler for
the real NMI which caused the vmexit in the first place, then iret from
the NMI handler which re-enables NMIs.  We are then free to take NMIs
for the remainder of the codepath back to the vmresume.

The question then becomes whether we wish to enable NMIs or not, which
affects whether we issue "int $2" or "do_nmi()".  Can someone from Intel
weigh in and confirm the exact behaviour of NMIs around this code?

(Irrespective of this question at hand, having read that LWN article
about nested NMIs, I am not certain that we are immune to the issue, so
should think about implementing a similar fix)

~Andrew

>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:22:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:22:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIJ7-0007Q9-7w; Tue, 13 Nov 2012 15:21:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYIJ6-0007Q4-8C
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 15:21:44 +0000
Received: from [85.158.139.83:25064] by server-12.bemta-5.messagelabs.com id
	24/CA-02886-78562A05; Tue, 13 Nov 2012 15:21:43 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1352820102!18816432!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22217 invoked from network); 13 Nov 2012 15:21:42 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-8.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 15:21:42 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYIIw-000Crb-Kx; Tue, 13 Nov 2012 15:21:34 +0000
Date: Tue, 13 Nov 2012 15:21:34 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121113152134.GH44675@ocelot.phlegethon.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
	<1352809049.7491.70.camel@zakaz.uk.xensource.com>
	<20121113123910.GE44675@ocelot.phlegethon.org>
	<50A2656C02000078000A82D4@nat28.tlf.novell.com>
	<20121113144356.GG44675@ocelot.phlegethon.org>
	<50A26D9C02000078000A8322@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A26D9C02000078000A8322@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
	process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 14:56 +0000 on 13 Nov (1352818572), Jan Beulich wrote:
> >>> On 13.11.12 at 15:43, Tim Deegan <tim@xen.org> wrote:
> > The fact that there was a loop and not just a delay in the NMI handling
> > suggests that VMENTER does indeed re-enable NMIs (or at least
> > NMI-exiting) but I couldn't find that in the manual.  In any case, I
> > think the int $2 version is correcter than the direct call as it also
> > disables normal interrupts.
> 
> You're not commenting on the stack aspect and previous approach
> at all: Assuming your self_nmi() approach at least worked
> somewhere, that somewhere would be the place where the "int $2"
> approach would break. In other words - are you confident that
> NMI is _always_ masked when we get there (and hence your
> earlier approach _never_ worked)?

ISWYM.  No, having thought about it a bit more, I'm not confident of
that at all -- at this point in the exit handlers, interrupts are
enabled, so we may already have had an IRET.  So we'd be risking taking
one NMI while handling another (whether we do int $2 or a direct call;
it's bad in either case). :(

I think that the NMI case needs to move to the top of the vmexit
handler, beside the machine_check cases.  Once it's there, either the
direct call (+ artifical iret to clear the masking) or int $2 should be
fine.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:22:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:22:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIJ7-0007Q9-7w; Tue, 13 Nov 2012 15:21:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYIJ6-0007Q4-8C
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 15:21:44 +0000
Received: from [85.158.139.83:25064] by server-12.bemta-5.messagelabs.com id
	24/CA-02886-78562A05; Tue, 13 Nov 2012 15:21:43 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1352820102!18816432!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22217 invoked from network); 13 Nov 2012 15:21:42 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-8.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 15:21:42 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYIIw-000Crb-Kx; Tue, 13 Nov 2012 15:21:34 +0000
Date: Tue, 13 Nov 2012 15:21:34 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121113152134.GH44675@ocelot.phlegethon.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
	<1352809049.7491.70.camel@zakaz.uk.xensource.com>
	<20121113123910.GE44675@ocelot.phlegethon.org>
	<50A2656C02000078000A82D4@nat28.tlf.novell.com>
	<20121113144356.GG44675@ocelot.phlegethon.org>
	<50A26D9C02000078000A8322@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A26D9C02000078000A8322@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
	process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 14:56 +0000 on 13 Nov (1352818572), Jan Beulich wrote:
> >>> On 13.11.12 at 15:43, Tim Deegan <tim@xen.org> wrote:
> > The fact that there was a loop and not just a delay in the NMI handling
> > suggests that VMENTER does indeed re-enable NMIs (or at least
> > NMI-exiting) but I couldn't find that in the manual.  In any case, I
> > think the int $2 version is correcter than the direct call as it also
> > disables normal interrupts.
> 
> You're not commenting on the stack aspect and previous approach
> at all: Assuming your self_nmi() approach at least worked
> somewhere, that somewhere would be the place where the "int $2"
> approach would break. In other words - are you confident that
> NMI is _always_ masked when we get there (and hence your
> earlier approach _never_ worked)?

ISWYM.  No, having thought about it a bit more, I'm not confident of
that at all -- at this point in the exit handlers, interrupts are
enabled, so we may already have had an IRET.  So we'd be risking taking
one NMI while handling another (whether we do int $2 or a direct call;
it's bad in either case). :(

I think that the NMI case needs to move to the top of the vmexit
handler, beside the machine_check cases.  Once it's there, either the
direct call (+ artifical iret to clear the masking) or int $2 should be
fine.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:29:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:29:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIQL-0007rc-6g; Tue, 13 Nov 2012 15:29:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYIQJ-0007rX-Fq
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 15:29:11 +0000
Received: from [85.158.143.99:27691] by server-2.bemta-4.messagelabs.com id
	6E/0A-28922-64762A05; Tue, 13 Nov 2012 15:29:10 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1352820550!28853294!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6155 invoked from network); 13 Nov 2012 15:29:10 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-216.messagelabs.com with SMTP;
	13 Nov 2012 15:29:10 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 15:29:56 +0000
Message-Id: <50A2755402000078000A837D@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 15:29:08 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>,
	"Yang Z Zhang" <yang.z.zhang@intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 16:02, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
>> From: Jan Beulich [mailto:JBeulich@suse.com]
>> > If software cannot see it, then how to use it? If there still have an
>> > approach to detect it, then xen can do it too and setup the context
>> > entry as passthrough.
>> 
>> We see it the latest at the point the fault occurs. So there are multiple
>> options:
>> a) if the device is "real" as in having a valid config space despite
>>     func 0 not advertising itself as multi-function, we have ways to
>>     discover the device (at boot time)
> 
> I think current Xen logic also covers multi-function devices case.  When Xen 
> boots up, it will scan all functions of devices on each bus, through reads 
> their vendor ID.  If the vendor ID is valid, Xen deems this BDF has a real 
> device/function existed there

Not anymore - we're now honoring the multi-function flag in
_scan_pci_devices() (as Linux always did in its bus scan logic);
see c/s 22337:7afd8dd1d6cb (with a subsequent adjustment in
c/s 25869:59b3663316db).

>> b) we could insert the context entry in the fault handler, assuming
>>     the device is able to recover
> At least current VT-d doesn't have recovery fault supported, so each 
> triggered faults are fatal. 

Fatal in what sense? I would assume that if the driver retries the
operation, it would succeed if the first fault causes the context
entry to be inserted.

>> c) we could provide a command line option to allow fake devices to
>>     be create
> 
> Agree, this maybe a feasible solution I can figure out, so far. 
> 
>> d) we could create context entries for all BDFs, whether or not a
>>     device exists there
> 
> As I said,  this maybe bring security issue. Even for the iommu-passthrough 
> option,  it is also not suggested to be used if security is considered. 

As said - it is clear that the basic thing here (using
"iommu=dom0-passthrough") is already weakening security. So
security isn't the concern in this discussion, that's left to whoever
is intending to use that option.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:29:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:29:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIQL-0007rc-6g; Tue, 13 Nov 2012 15:29:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYIQJ-0007rX-Fq
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 15:29:11 +0000
Received: from [85.158.143.99:27691] by server-2.bemta-4.messagelabs.com id
	6E/0A-28922-64762A05; Tue, 13 Nov 2012 15:29:10 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1352820550!28853294!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6155 invoked from network); 13 Nov 2012 15:29:10 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-216.messagelabs.com with SMTP;
	13 Nov 2012 15:29:10 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 15:29:56 +0000
Message-Id: <50A2755402000078000A837D@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 15:29:08 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>,
	"Yang Z Zhang" <yang.z.zhang@intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 16:02, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
>> From: Jan Beulich [mailto:JBeulich@suse.com]
>> > If software cannot see it, then how to use it? If there still have an
>> > approach to detect it, then xen can do it too and setup the context
>> > entry as passthrough.
>> 
>> We see it the latest at the point the fault occurs. So there are multiple
>> options:
>> a) if the device is "real" as in having a valid config space despite
>>     func 0 not advertising itself as multi-function, we have ways to
>>     discover the device (at boot time)
> 
> I think current Xen logic also covers multi-function devices case.  When Xen 
> boots up, it will scan all functions of devices on each bus, through reads 
> their vendor ID.  If the vendor ID is valid, Xen deems this BDF has a real 
> device/function existed there

Not anymore - we're now honoring the multi-function flag in
_scan_pci_devices() (as Linux always did in its bus scan logic);
see c/s 22337:7afd8dd1d6cb (with a subsequent adjustment in
c/s 25869:59b3663316db).

>> b) we could insert the context entry in the fault handler, assuming
>>     the device is able to recover
> At least current VT-d doesn't have recovery fault supported, so each 
> triggered faults are fatal. 

Fatal in what sense? I would assume that if the driver retries the
operation, it would succeed if the first fault causes the context
entry to be inserted.

>> c) we could provide a command line option to allow fake devices to
>>     be create
> 
> Agree, this maybe a feasible solution I can figure out, so far. 
> 
>> d) we could create context entries for all BDFs, whether or not a
>>     device exists there
> 
> As I said,  this maybe bring security issue. Even for the iommu-passthrough 
> option,  it is also not suggested to be used if security is considered. 

As said - it is clear that the basic thing here (using
"iommu=dom0-passthrough") is already weakening security. So
security isn't the concern in this discussion, that's left to whoever
is intending to use that option.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:33:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIUD-00086r-RY; Tue, 13 Nov 2012 15:33:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYIUC-00086m-ND
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 15:33:12 +0000
Received: from [85.158.138.51:19043] by server-12.bemta-3.messagelabs.com id
	1D/66-22757-33862A05; Tue, 13 Nov 2012 15:33:07 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1352820784!29854699!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3352 invoked from network); 13 Nov 2012 15:33:04 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-174.messagelabs.com with SMTP;
	13 Nov 2012 15:33:04 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 15:34:02 +0000
Message-Id: <50A2763B02000078000A8384@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 15:32:59 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
	<1352809049.7491.70.camel@zakaz.uk.xensource.com>
	<20121113123910.GE44675@ocelot.phlegethon.org>
	<50A2656C02000078000A82D4@nat28.tlf.novell.com>
	<20121113144356.GG44675@ocelot.phlegethon.org>
	<50A26D9C02000078000A8322@nat28.tlf.novell.com>
	<20121113152134.GH44675@ocelot.phlegethon.org>
In-Reply-To: <20121113152134.GH44675@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 16:21, Tim Deegan <tim@xen.org> wrote:
> I think that the NMI case needs to move to the top of the vmexit
> handler, beside the machine_check cases.  Once it's there, either the
> direct call (+ artifical iret to clear the masking) or int $2 should be
> fine.

Yes, that sounds like a viable thing (whether the artificial iret is
going to be needed here [and not elsewhere] is a different thing,
see my other response regarding the PV case).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:33:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIUD-00086r-RY; Tue, 13 Nov 2012 15:33:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYIUC-00086m-ND
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 15:33:12 +0000
Received: from [85.158.138.51:19043] by server-12.bemta-3.messagelabs.com id
	1D/66-22757-33862A05; Tue, 13 Nov 2012 15:33:07 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1352820784!29854699!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3352 invoked from network); 13 Nov 2012 15:33:04 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-174.messagelabs.com with SMTP;
	13 Nov 2012 15:33:04 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 13 Nov 2012 15:34:02 +0000
Message-Id: <50A2763B02000078000A8384@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Tue, 13 Nov 2012 15:32:59 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <ea756059a8da1217e644.1352805805@malcolmc-Dell>
	<50A23F3102000078000A80BE@nat28.tlf.novell.com>
	<20121113114714.GB44675@ocelot.phlegethon.org>
	<20121113120555.GC44675@ocelot.phlegethon.org>
	<1352809049.7491.70.camel@zakaz.uk.xensource.com>
	<20121113123910.GE44675@ocelot.phlegethon.org>
	<50A2656C02000078000A82D4@nat28.tlf.novell.com>
	<20121113144356.GG44675@ocelot.phlegethon.org>
	<50A26D9C02000078000A8322@nat28.tlf.novell.com>
	<20121113152134.GH44675@ocelot.phlegethon.org>
In-Reply-To: <20121113152134.GH44675@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] [RFC PATCH] xen: vmx: Use an INT 2 call to
 process real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 16:21, Tim Deegan <tim@xen.org> wrote:
> I think that the NMI case needs to move to the top of the vmexit
> handler, beside the machine_check cases.  Once it's there, either the
> direct call (+ artifical iret to clear the masking) or int $2 should be
> fine.

Yes, that sounds like a viable thing (whether the artificial iret is
going to be needed here [and not elsewhere] is a different thing,
see my other response regarding the PV case).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:41:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:41:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIcD-0008NN-Qh; Tue, 13 Nov 2012 15:41:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYIcB-0008NI-Ou
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 15:41:27 +0000
Received: from [85.158.139.211:53548] by server-13.bemta-5.messagelabs.com id
	78/E7-27809-62A62A05; Tue, 13 Nov 2012 15:41:26 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1352821284!18518336!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9918 invoked from network); 13 Nov 2012 15:41:26 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:41:26 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="214346579"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:41:24 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:41:24 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<Stefano.Stabellini@eu.citrix.com>)	id 1TYIc7-0008FX-JB;
	Tue, 13 Nov 2012 15:41:23 +0000
Date: Tue, 13 Nov 2012 15:40:51 +0000
From: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Message-ID: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "Tim \(Xen.org\)" <tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH v2 0/7] xen/arm: run on real hardware
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi all,
this is a collection of fixes that I wrote trying to run Xen on a real
Versatile Express Cortex A15 machine.


Changes in v2:
- rework the first patch to fix vgic emulation;
- fix code style in head.S;
- more comments in head.S;
- always hook xen_fixmap in the pagetable but fill in the console fixmap
only if EARLY_UART_ADDRESS;
- detect the processor ID and call a processor specific initialization
function;
- move the ACTLR initialization to the CortexA15 initialization
function;
- move the ACTLR_* defines to processor-ca15.h;
- use preprocessor definitions in kick_cpus;
- do not manually increment the base address register, use an offset
instead;
- move kick_cpus to proc-ca15.S;
- add a comment to described why we need a DSB at the beginning of
write_pte;
- do not issue ISB within write_pte, call isb() afterwards whenever
appropriate;
- issue DSB after DCCMVAC in write_pte to make sure that the data flush
is completed before proceeding;
- make flush_xen_dcache_va take a void* as argument;
- introduce flush_xen_dcache_va_range;
- return always at least 1 cpu from device_tree_cpus;
- skip nodes with names that don't start with "cpu".



Stefano Stabellini (7):
      xen/arm: pass the correct bit-per-interrupt argument to vgic_irq_rank
      xen/arm: setup the fixmap in head.S
      pl011: set baud and clock_hz to the right defaults for Versatile Express
      xen/arm: set the SMP bit in the ACTLR register
      xen/arm: wake up secondary cpus
      xen/arm: flush D-cache and I-cache when appropriate
      xen/arm: get the number of cpus from device tree

 xen/arch/arm/Makefile                   |    1 +
 xen/arch/arm/early_printk.c             |    5 +-
 xen/arch/arm/gic.c                      |    4 +-
 xen/arch/arm/gic.h                      |    4 +-
 xen/arch/arm/head.S                     |   67 ++++++++++++++++++++++---------
 xen/arch/arm/mm.c                       |   20 ++++++++-
 xen/arch/arm/mode_switch.S              |   28 +++++++++++++
 xen/arch/arm/proc-ca15.S                |   28 +++++++++++++
 xen/arch/arm/setup.c                    |    9 +++-
 xen/arch/arm/smpboot.c                  |    2 +
 xen/arch/arm/vgic.c                     |   25 ++++++------
 xen/common/device_tree.c                |   19 +++++++++
 xen/drivers/char/pl011.c                |    4 +-
 xen/include/asm-arm/cpregs.h            |    1 +
 xen/include/asm-arm/page.h              |   51 ++++++++++++++++++++++-
 xen/include/asm-arm/platform_vexpress.h |   17 ++++++++
 xen/include/asm-arm/processor-ca15.h    |   45 +++++++++++++++++++++
 xen/include/asm-arm/processor.h         |    3 +
 xen/include/xen/device_tree.h           |    1 +
 19 files changed, 285 insertions(+), 49 deletions(-)


Cheers,

Stefano

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:41:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:41:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIcD-0008NN-Qh; Tue, 13 Nov 2012 15:41:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYIcB-0008NI-Ou
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 15:41:27 +0000
Received: from [85.158.139.211:53548] by server-13.bemta-5.messagelabs.com id
	78/E7-27809-62A62A05; Tue, 13 Nov 2012 15:41:26 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1352821284!18518336!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9918 invoked from network); 13 Nov 2012 15:41:26 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:41:26 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="214346579"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:41:24 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:41:24 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<Stefano.Stabellini@eu.citrix.com>)	id 1TYIc7-0008FX-JB;
	Tue, 13 Nov 2012 15:41:23 +0000
Date: Tue, 13 Nov 2012 15:40:51 +0000
From: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Message-ID: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "Tim \(Xen.org\)" <tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH v2 0/7] xen/arm: run on real hardware
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi all,
this is a collection of fixes that I wrote trying to run Xen on a real
Versatile Express Cortex A15 machine.


Changes in v2:
- rework the first patch to fix vgic emulation;
- fix code style in head.S;
- more comments in head.S;
- always hook xen_fixmap in the pagetable but fill in the console fixmap
only if EARLY_UART_ADDRESS;
- detect the processor ID and call a processor specific initialization
function;
- move the ACTLR initialization to the CortexA15 initialization
function;
- move the ACTLR_* defines to processor-ca15.h;
- use preprocessor definitions in kick_cpus;
- do not manually increment the base address register, use an offset
instead;
- move kick_cpus to proc-ca15.S;
- add a comment to described why we need a DSB at the beginning of
write_pte;
- do not issue ISB within write_pte, call isb() afterwards whenever
appropriate;
- issue DSB after DCCMVAC in write_pte to make sure that the data flush
is completed before proceeding;
- make flush_xen_dcache_va take a void* as argument;
- introduce flush_xen_dcache_va_range;
- return always at least 1 cpu from device_tree_cpus;
- skip nodes with names that don't start with "cpu".



Stefano Stabellini (7):
      xen/arm: pass the correct bit-per-interrupt argument to vgic_irq_rank
      xen/arm: setup the fixmap in head.S
      pl011: set baud and clock_hz to the right defaults for Versatile Express
      xen/arm: set the SMP bit in the ACTLR register
      xen/arm: wake up secondary cpus
      xen/arm: flush D-cache and I-cache when appropriate
      xen/arm: get the number of cpus from device tree

 xen/arch/arm/Makefile                   |    1 +
 xen/arch/arm/early_printk.c             |    5 +-
 xen/arch/arm/gic.c                      |    4 +-
 xen/arch/arm/gic.h                      |    4 +-
 xen/arch/arm/head.S                     |   67 ++++++++++++++++++++++---------
 xen/arch/arm/mm.c                       |   20 ++++++++-
 xen/arch/arm/mode_switch.S              |   28 +++++++++++++
 xen/arch/arm/proc-ca15.S                |   28 +++++++++++++
 xen/arch/arm/setup.c                    |    9 +++-
 xen/arch/arm/smpboot.c                  |    2 +
 xen/arch/arm/vgic.c                     |   25 ++++++------
 xen/common/device_tree.c                |   19 +++++++++
 xen/drivers/char/pl011.c                |    4 +-
 xen/include/asm-arm/cpregs.h            |    1 +
 xen/include/asm-arm/page.h              |   51 ++++++++++++++++++++++-
 xen/include/asm-arm/platform_vexpress.h |   17 ++++++++
 xen/include/asm-arm/processor-ca15.h    |   45 +++++++++++++++++++++
 xen/include/asm-arm/processor.h         |    3 +
 xen/include/xen/device_tree.h           |    1 +
 19 files changed, 285 insertions(+), 49 deletions(-)


Cheers,

Stefano

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:43:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:43:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIdk-0008W9-33; Tue, 13 Nov 2012 15:43:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYIdh-0008V1-Pp
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 15:43:02 +0000
Received: from [85.158.139.83:13859] by server-14.bemta-5.messagelabs.com id
	E9/AC-21768-48A62A05; Tue, 13 Nov 2012 15:43:00 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352821376!29383434!4
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27147 invoked from network); 13 Nov 2012 15:43:00 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:43:00 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44429021"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:42:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:42:56 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYIdW-0008Hy-FG;
	Tue, 13 Nov 2012 15:42:50 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <xen-devel@lists.xensource.com>
Date: Tue, 13 Nov 2012 15:42:15 +0000
Message-ID: <1352821336-25837-6-git-send-email-stefano.stabellini@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
MIME-Version: 1.0
Cc: tim@xen.org, Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH 6/7] xen/arm: flush D-cache and I-cache when
	appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

- invalidate tlb after setting WXN;
- flush D-cache and I-cache after relocation;
- flush D-cache after writing to smp_up_cpu;
- flush TLB before changing HTTBR;
- flush I-cache after changing HTTBR;
- flush I-cache and branch predictor after writing Xen text ptes.


Changes in v2:
- fix a wrong comment;
- add a comment to described why we need a DSB at the beginning of
write_pte;
- do not issue ISB within write_pte, call isb() afterwards whenever
appropriate;
- issue DSB after DCCMVAC in write_pte to make sure that the data flush
is completed before proceeding;
- make flush_xen_dcache_va take a void* as argument;
- introduce flush_xen_dcache_va_range.


Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/head.S        |    9 +++++++
 xen/arch/arm/mm.c          |   18 +++++++++++++-
 xen/arch/arm/setup.c       |    4 +++
 xen/arch/arm/smpboot.c     |    2 +
 xen/include/asm-arm/page.h |   51 +++++++++++++++++++++++++++++++++++++++++--
 5 files changed, 79 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 3fe6412..4de4d95 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -278,8 +278,15 @@ paging:
 	ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
 	add   r4, r4, r10            /* PA of it */
 	ldrd  r4, r5, [r4]           /* Actual value */
+	dsb
+	mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
+	dsb
+	isb
 	mcrr  CP64(r4, r5, HTTBR)
+	dsb
+	isb
 	mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
+	mcr   CP32(r0, ICIALLU)      /* Flush I-cache */
 	mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
 	dsb                          /* Ensure completion of TLB+BP flush */
 	isb
@@ -292,6 +299,8 @@ paging:
 	teq   r2, #0
 	bne   1b
 	dsb
+	mcr   CP32(r0, DCCMVAC)      /* flush D-Cache */
+	dsb
 
 	/* Here, the non-boot CPUs must wait again -- they're now running on
 	 * the boot CPU's pagetables so it's safe for the boot CPU to
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index d0cd2c9..3d25153 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -32,6 +32,7 @@
 #include <public/memory.h>
 #include <xen/sched.h>
 
+int __read_mostly cacheline_bytes = MIN_CACHELINE_BYTES;
 struct domain *dom_xen, *dom_io;
 
 /* Static start-of-day pagetables that we use before the allocators are up */
@@ -244,10 +245,17 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
 
     /* Change pagetables to the copy in the relocated Xen */
     boot_httbr = (unsigned long) xen_pgtable + phys_offset;
+    flush_xen_dcache_va(&boot_httbr);
+    flush_xen_dcache_va_range((void*)dest_va, _end - _start);
+    isb();
+    flush_xen_text_tlb();
+
     asm volatile (
         STORE_CP64(0, HTTBR)          /* Change translation base */
         "dsb;"                        /* Ensure visibility of HTTBR update */
+        "isb;"
         STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
+        STORE_CP32(0, ICIALLU)        /* Flush I-cache */
         STORE_CP32(0, BPIALL)         /* Flush branch predictor */
         "dsb;"                        /* Ensure completion of TLB+BP flush */
         "isb;"
@@ -256,6 +264,7 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
     /* Undo the temporary map */
     pte.bits = 0;
     write_pte(xen_second + second_table_offset(dest_va), pte);
+    isb();
     flush_xen_text_tlb();
 
     /* Link in the fixmap pagetable */
@@ -291,11 +300,14 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
                            >> PAGE_SHIFT);
     pte.pt.table = 1;
     write_pte(xen_second + second_linear_offset(XEN_VIRT_START), pte);
-    /* Have changed a mapping used for .text. Flush everything for safety. */
-    flush_xen_text_tlb();
+    /* ISB is needed because we changed the text mappings */
+    isb();
 
     /* From now on, no mapping may be both writable and executable. */
     WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
+    isb();
+    /* Flush everything after setting WXN bit. */
+    flush_xen_text_tlb();
 }
 
 /* MMU setup for secondary CPUS (which already have paging enabled) */
@@ -303,6 +315,8 @@ void __cpuinit mmu_init_secondary_cpu(void)
 {
     /* From now on, no mapping may be both writable and executable. */
     WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
+    isb();
+    flush_xen_text_tlb();
 }
 
 /* Create Xen's mappings of memory.
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 6fbcb81..a579a56 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -185,6 +185,10 @@ void __init start_xen(unsigned long boot_phys_offset,
     size_t fdt_size;
     int cpus, i;
 
+    cacheline_bytes = READ_CP32(CCSIDR);
+    if ( cacheline_bytes < MIN_CACHELINE_BYTES )
+        panic("CPU has preposterously small cache lines");
+
     fdt = (void *)BOOT_MISC_VIRT_START
         + (atag_paddr & ((1 << SECOND_SHIFT) - 1));
     fdt_size = device_tree_early_init(fdt);
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index c0750c0..f4fd512 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -105,6 +105,7 @@ make_cpus_ready(unsigned int max_cpus, unsigned long boot_phys_offset)
         /* Tell the next CPU to get ready */
         /* TODO: handle boards where CPUIDs are not contiguous */
         *gate = i;
+        flush_xen_dcache_va(gate);
         asm volatile("dsb; isb; sev");
         /* And wait for it to respond */
         while ( ready_cpus < i )
@@ -201,6 +202,7 @@ int __cpu_up(unsigned int cpu)
     /* Unblock the CPU.  It should be waiting in the loop in head.S
      * for an event to arrive when smp_up_cpu matches its cpuid. */
     smp_up_cpu = cpu;
+    flush_xen_dcache_va(&smp_up_cpu);
     asm volatile("dsb; isb; sev");
 
     while ( !cpu_online(cpu) )
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 9511c45..1b1d556 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -228,27 +228,72 @@ static inline lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr)
     return e;
 }
 
-/* Write a pagetable entry */
+/* Write a pagetable entry.
+ *
+ * If the table entry is changing a text mapping, it is responsibility
+ * of the caller to issue an ISB after write_pte.
+ */
 static inline void write_pte(lpae_t *p, lpae_t pte)
 {
     asm volatile (
+        /* Ensure any writes have completed with the old mappings. */
+        "dsb;"
         /* Safely write the entry (STRD is atomic on CPUs that support LPAE) */
         "strd %0, %H0, [%1];"
+        "dsb;"
         /* Push this cacheline to the PoC so the rest of the system sees it. */
         STORE_CP32(1, DCCMVAC)
+        /* Ensure that the data flush is completed before proceeding */
+        "dsb;"
         : : "r" (pte.bits), "r" (p) : "memory");
 }
 
+
+#define MIN_CACHELINE_BYTES 32
+extern int cacheline_bytes;
+
+/* Function for flushing medium-sized areas.
+ * if 'range' is large enough we might want to use model-specific
+ * full-cache flushes. */
+static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
+{
+    void *end;
+    dsb();           /* So the CPU issues all writes to the range */ 
+    for ( end = p + size; p < end; p += cacheline_bytes )
+        WRITE_CP32((uint32_t) p, DCCMVAC);
+    dsb();           /* So we know the flushes happen before continuing */
+}
+
+
+/* Macro for flushing a single small item.  The predicate is always 
+ * compile-time constant so this will compile down to 3 instructions in
+ * the common case.  Make sure to call it with the correct type of
+ * pointer! */
+#define flush_xen_dcache_va(p) do {                       \
+    typeof(p) _p = (p);                                   \
+    if ( (sizeof *_p) > MIN_CACHELINE_BYTES )             \
+        flush_xen_dcache_va_range(_p, sizeof *_p);        \
+    else                                                  \
+        asm volatile (                                    \
+            "dsb;"   /* Finish all earlier writes */      \
+            STORE_CP32(0, DCCMVAC)                        \
+            "dsb;"   /* Finish flush before continuing */ \
+            : : "r" (_p), "m" (*_p));                     \
+} while (0)
+
+
 /*
  * Flush all hypervisor mappings from the TLB and branch predictor.
- * This is needed after changing Xen code mappings. 
+ * This is needed after changing Xen code mappings.
+ *
+ * The caller needs to issue the necessary barriers before this functions.
  */
 static inline void flush_xen_text_tlb(void)
 {
     register unsigned long r0 asm ("r0");
     asm volatile (
-        "dsb;"                        /* Ensure visibility of PTE writes */
         STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
+        STORE_CP32(0, ICIALLU)        /* Flush I-cache */
         STORE_CP32(0, BPIALL)         /* Flush branch predictor */
         "dsb;"                        /* Ensure completion of TLB+BP flush */
         "isb;"
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:43:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:43:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIdg-0008Uh-A0; Tue, 13 Nov 2012 15:43:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYIdf-0008US-BL
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 15:42:59 +0000
Received: from [85.158.139.211:37782] by server-11.bemta-5.messagelabs.com id
	D8/6A-03409-28A62A05; Tue, 13 Nov 2012 15:42:58 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1352821376!19966884!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17150 invoked from network); 13 Nov 2012 15:42:58 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:42:58 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="214346974"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:42:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:42:56 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYIdW-0008Hy-BM;
	Tue, 13 Nov 2012 15:42:50 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <xen-devel@lists.xensource.com>
Date: Tue, 13 Nov 2012 15:42:12 +0000
Message-ID: <1352821336-25837-3-git-send-email-stefano.stabellini@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
MIME-Version: 1.0
Cc: tim@xen.org, Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH 3/7] pl011: set baud and clock_hz to the right
	defaults for Versatile Express
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
---
 xen/drivers/char/pl011.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
index 6af45aa..6ccb73a 100644
--- a/xen/drivers/char/pl011.c
+++ b/xen/drivers/char/pl011.c
@@ -241,8 +241,8 @@ void __init pl011_init(int index, unsigned long register_base_address)
 
     uart = &pl011_com[index];
 
-    uart->clock_hz  = 7372800;
-    uart->baud      = 115200;
+    uart->clock_hz  = 0x16e3600;
+    uart->baud      = 38400;
     uart->data_bits = 8;
     uart->parity    = PARITY_NONE;
     uart->stop_bits = 1;
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:43:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:43:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIdk-00004v-Rg; Tue, 13 Nov 2012 15:43:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYIdi-0008Ub-ON
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 15:43:03 +0000
Received: from [85.158.139.211:58313] by server-5.bemta-5.messagelabs.com id
	D6/CB-11353-68A62A05; Tue, 13 Nov 2012 15:43:02 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1352821376!19966884!2
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17293 invoked from network); 13 Nov 2012 15:43:01 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:43:01 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="214347008"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:43:01 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:43:01 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYIdW-0008Hy-H7;
	Tue, 13 Nov 2012 15:42:50 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <xen-devel@lists.xensource.com>
Date: Tue, 13 Nov 2012 15:42:16 +0000
Message-ID: <1352821336-25837-7-git-send-email-stefano.stabellini@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
MIME-Version: 1.0
Cc: tim@xen.org, Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH 7/7] xen/arm: get the number of cpus from device
	tree
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The system might have fewer cpus than the GIC supports.

Changes in v2:
- return always at least 1 cpu;
- skip nodes with names that don't start with "cpu".

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/gic.c            |    4 +---
 xen/arch/arm/gic.h            |    2 +-
 xen/arch/arm/setup.c          |    3 ++-
 xen/common/device_tree.c      |   19 +++++++++++++++++++
 xen/include/xen/device_tree.h |    1 +
 5 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 5f06e08..0c6fab9 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -304,7 +304,7 @@ static void __cpuinit gic_hyp_disable(void)
 }
 
 /* Set up the GIC */
-int __init gic_init(void)
+void __init gic_init(void)
 {
     /* XXX FIXME get this from devicetree */
     gic.dbase = GIC_BASE_ADDRESS + GIC_DR_OFFSET;
@@ -328,8 +328,6 @@ int __init gic_init(void)
     gic.lr_mask = 0ULL;
 
     spin_unlock(&gic.lock);
-
-    return gic.cpus;
 }
 
 /* Set up the per-CPU parts of the GIC for a secondary CPU */
diff --git a/xen/arch/arm/gic.h b/xen/arch/arm/gic.h
index b2e1d7f..1bf1b02 100644
--- a/xen/arch/arm/gic.h
+++ b/xen/arch/arm/gic.h
@@ -147,7 +147,7 @@ extern int gic_route_irq_to_guest(struct domain *d, unsigned int irq,
 /* Accept an interrupt from the GIC and dispatch its handler */
 extern void gic_interrupt(struct cpu_user_regs *regs, int is_fiq);
 /* Bring up the interrupt controller, and report # cpus attached */
-extern int gic_init(void);
+extern void gic_init(void);
 /* Bring up a secondary CPU's per-CPU GIC interface */
 extern void gic_init_secondary_cpu(void);
 /* Take down a CPU's per-CPU GIC interface */
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index a579a56..632e7e3 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -193,6 +193,7 @@ void __init start_xen(unsigned long boot_phys_offset,
         + (atag_paddr & ((1 << SECOND_SHIFT) - 1));
     fdt_size = device_tree_early_init(fdt);
 
+    cpus = device_tree_cpus(fdt);
     cmdline_parse(device_tree_bootargs(fdt));
 
     setup_pagetables(boot_phys_offset, get_xen_paddr());
@@ -203,7 +204,7 @@ void __init start_xen(unsigned long boot_phys_offset,
     console_init_preirq();
 #endif
 
-    cpus = gic_init();
+    gic_init();
     make_cpus_ready(cpus, boot_phys_offset);
 
     percpu_init_areas();
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 3d1f0f4..5b6dab9 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -153,6 +153,25 @@ const char *device_tree_bootargs(const void *fdt)
     return prop->data;
 }
 
+int device_tree_cpus(const void *fdt)
+{
+    int node = 0, depth = 1;
+    int cpus = 0;
+
+    node = fdt_path_offset(fdt, "/cpus/cpu");
+    if ( node < 0 )
+        return 1; /* we have at least one cpu */
+
+    while ( node >= 0 && depth >= 0 ) {
+        if ( strncmp(fdt_get_name(fdt, node, NULL), "cpu", 3) )
+            continue;
+        node = fdt_next_node(fdt, node, &depth);
+        cpus++;
+    }
+
+    return cpus > 0 ? cpus : 1;
+}
+
 static int dump_node(const void *fdt, int node, const char *name, int depth,
                      u32 address_cells, u32 size_cells, void *data)
 {
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 4d010c0..46bc0f8 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -49,6 +49,7 @@ bool_t device_tree_node_matches(const void *fdt, int node, const char *match);
 int device_tree_for_each_node(const void *fdt,
                               device_tree_node_func func, void *data);
 const char *device_tree_bootargs(const void *fdt);
+int device_tree_cpus(const void *fdt);
 void device_tree_dump(const void *fdt);
 
 #endif
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:43:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:43:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIdk-0008W9-33; Tue, 13 Nov 2012 15:43:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYIdh-0008V1-Pp
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 15:43:02 +0000
Received: from [85.158.139.83:13859] by server-14.bemta-5.messagelabs.com id
	E9/AC-21768-48A62A05; Tue, 13 Nov 2012 15:43:00 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352821376!29383434!4
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27147 invoked from network); 13 Nov 2012 15:43:00 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:43:00 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44429021"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:42:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:42:56 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYIdW-0008Hy-FG;
	Tue, 13 Nov 2012 15:42:50 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <xen-devel@lists.xensource.com>
Date: Tue, 13 Nov 2012 15:42:15 +0000
Message-ID: <1352821336-25837-6-git-send-email-stefano.stabellini@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
MIME-Version: 1.0
Cc: tim@xen.org, Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH 6/7] xen/arm: flush D-cache and I-cache when
	appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

- invalidate tlb after setting WXN;
- flush D-cache and I-cache after relocation;
- flush D-cache after writing to smp_up_cpu;
- flush TLB before changing HTTBR;
- flush I-cache after changing HTTBR;
- flush I-cache and branch predictor after writing Xen text ptes.


Changes in v2:
- fix a wrong comment;
- add a comment to described why we need a DSB at the beginning of
write_pte;
- do not issue ISB within write_pte, call isb() afterwards whenever
appropriate;
- issue DSB after DCCMVAC in write_pte to make sure that the data flush
is completed before proceeding;
- make flush_xen_dcache_va take a void* as argument;
- introduce flush_xen_dcache_va_range.


Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/head.S        |    9 +++++++
 xen/arch/arm/mm.c          |   18 +++++++++++++-
 xen/arch/arm/setup.c       |    4 +++
 xen/arch/arm/smpboot.c     |    2 +
 xen/include/asm-arm/page.h |   51 +++++++++++++++++++++++++++++++++++++++++--
 5 files changed, 79 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 3fe6412..4de4d95 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -278,8 +278,15 @@ paging:
 	ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
 	add   r4, r4, r10            /* PA of it */
 	ldrd  r4, r5, [r4]           /* Actual value */
+	dsb
+	mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
+	dsb
+	isb
 	mcrr  CP64(r4, r5, HTTBR)
+	dsb
+	isb
 	mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
+	mcr   CP32(r0, ICIALLU)      /* Flush I-cache */
 	mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
 	dsb                          /* Ensure completion of TLB+BP flush */
 	isb
@@ -292,6 +299,8 @@ paging:
 	teq   r2, #0
 	bne   1b
 	dsb
+	mcr   CP32(r0, DCCMVAC)      /* flush D-Cache */
+	dsb
 
 	/* Here, the non-boot CPUs must wait again -- they're now running on
 	 * the boot CPU's pagetables so it's safe for the boot CPU to
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index d0cd2c9..3d25153 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -32,6 +32,7 @@
 #include <public/memory.h>
 #include <xen/sched.h>
 
+int __read_mostly cacheline_bytes = MIN_CACHELINE_BYTES;
 struct domain *dom_xen, *dom_io;
 
 /* Static start-of-day pagetables that we use before the allocators are up */
@@ -244,10 +245,17 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
 
     /* Change pagetables to the copy in the relocated Xen */
     boot_httbr = (unsigned long) xen_pgtable + phys_offset;
+    flush_xen_dcache_va(&boot_httbr);
+    flush_xen_dcache_va_range((void*)dest_va, _end - _start);
+    isb();
+    flush_xen_text_tlb();
+
     asm volatile (
         STORE_CP64(0, HTTBR)          /* Change translation base */
         "dsb;"                        /* Ensure visibility of HTTBR update */
+        "isb;"
         STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
+        STORE_CP32(0, ICIALLU)        /* Flush I-cache */
         STORE_CP32(0, BPIALL)         /* Flush branch predictor */
         "dsb;"                        /* Ensure completion of TLB+BP flush */
         "isb;"
@@ -256,6 +264,7 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
     /* Undo the temporary map */
     pte.bits = 0;
     write_pte(xen_second + second_table_offset(dest_va), pte);
+    isb();
     flush_xen_text_tlb();
 
     /* Link in the fixmap pagetable */
@@ -291,11 +300,14 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
                            >> PAGE_SHIFT);
     pte.pt.table = 1;
     write_pte(xen_second + second_linear_offset(XEN_VIRT_START), pte);
-    /* Have changed a mapping used for .text. Flush everything for safety. */
-    flush_xen_text_tlb();
+    /* ISB is needed because we changed the text mappings */
+    isb();
 
     /* From now on, no mapping may be both writable and executable. */
     WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
+    isb();
+    /* Flush everything after setting WXN bit. */
+    flush_xen_text_tlb();
 }
 
 /* MMU setup for secondary CPUS (which already have paging enabled) */
@@ -303,6 +315,8 @@ void __cpuinit mmu_init_secondary_cpu(void)
 {
     /* From now on, no mapping may be both writable and executable. */
     WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
+    isb();
+    flush_xen_text_tlb();
 }
 
 /* Create Xen's mappings of memory.
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 6fbcb81..a579a56 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -185,6 +185,10 @@ void __init start_xen(unsigned long boot_phys_offset,
     size_t fdt_size;
     int cpus, i;
 
+    cacheline_bytes = READ_CP32(CCSIDR);
+    if ( cacheline_bytes < MIN_CACHELINE_BYTES )
+        panic("CPU has preposterously small cache lines");
+
     fdt = (void *)BOOT_MISC_VIRT_START
         + (atag_paddr & ((1 << SECOND_SHIFT) - 1));
     fdt_size = device_tree_early_init(fdt);
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index c0750c0..f4fd512 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -105,6 +105,7 @@ make_cpus_ready(unsigned int max_cpus, unsigned long boot_phys_offset)
         /* Tell the next CPU to get ready */
         /* TODO: handle boards where CPUIDs are not contiguous */
         *gate = i;
+        flush_xen_dcache_va(gate);
         asm volatile("dsb; isb; sev");
         /* And wait for it to respond */
         while ( ready_cpus < i )
@@ -201,6 +202,7 @@ int __cpu_up(unsigned int cpu)
     /* Unblock the CPU.  It should be waiting in the loop in head.S
      * for an event to arrive when smp_up_cpu matches its cpuid. */
     smp_up_cpu = cpu;
+    flush_xen_dcache_va(&smp_up_cpu);
     asm volatile("dsb; isb; sev");
 
     while ( !cpu_online(cpu) )
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 9511c45..1b1d556 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -228,27 +228,72 @@ static inline lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr)
     return e;
 }
 
-/* Write a pagetable entry */
+/* Write a pagetable entry.
+ *
+ * If the table entry is changing a text mapping, it is responsibility
+ * of the caller to issue an ISB after write_pte.
+ */
 static inline void write_pte(lpae_t *p, lpae_t pte)
 {
     asm volatile (
+        /* Ensure any writes have completed with the old mappings. */
+        "dsb;"
         /* Safely write the entry (STRD is atomic on CPUs that support LPAE) */
         "strd %0, %H0, [%1];"
+        "dsb;"
         /* Push this cacheline to the PoC so the rest of the system sees it. */
         STORE_CP32(1, DCCMVAC)
+        /* Ensure that the data flush is completed before proceeding */
+        "dsb;"
         : : "r" (pte.bits), "r" (p) : "memory");
 }
 
+
+#define MIN_CACHELINE_BYTES 32
+extern int cacheline_bytes;
+
+/* Function for flushing medium-sized areas.
+ * if 'range' is large enough we might want to use model-specific
+ * full-cache flushes. */
+static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
+{
+    void *end;
+    dsb();           /* So the CPU issues all writes to the range */ 
+    for ( end = p + size; p < end; p += cacheline_bytes )
+        WRITE_CP32((uint32_t) p, DCCMVAC);
+    dsb();           /* So we know the flushes happen before continuing */
+}
+
+
+/* Macro for flushing a single small item.  The predicate is always 
+ * compile-time constant so this will compile down to 3 instructions in
+ * the common case.  Make sure to call it with the correct type of
+ * pointer! */
+#define flush_xen_dcache_va(p) do {                       \
+    typeof(p) _p = (p);                                   \
+    if ( (sizeof *_p) > MIN_CACHELINE_BYTES )             \
+        flush_xen_dcache_va_range(_p, sizeof *_p);        \
+    else                                                  \
+        asm volatile (                                    \
+            "dsb;"   /* Finish all earlier writes */      \
+            STORE_CP32(0, DCCMVAC)                        \
+            "dsb;"   /* Finish flush before continuing */ \
+            : : "r" (_p), "m" (*_p));                     \
+} while (0)
+
+
 /*
  * Flush all hypervisor mappings from the TLB and branch predictor.
- * This is needed after changing Xen code mappings. 
+ * This is needed after changing Xen code mappings.
+ *
+ * The caller needs to issue the necessary barriers before this functions.
  */
 static inline void flush_xen_text_tlb(void)
 {
     register unsigned long r0 asm ("r0");
     asm volatile (
-        "dsb;"                        /* Ensure visibility of PTE writes */
         STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
+        STORE_CP32(0, ICIALLU)        /* Flush I-cache */
         STORE_CP32(0, BPIALL)         /* Flush branch predictor */
         "dsb;"                        /* Ensure completion of TLB+BP flush */
         "isb;"
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:43:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:43:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIdg-0008Uh-A0; Tue, 13 Nov 2012 15:43:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYIdf-0008US-BL
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 15:42:59 +0000
Received: from [85.158.139.211:37782] by server-11.bemta-5.messagelabs.com id
	D8/6A-03409-28A62A05; Tue, 13 Nov 2012 15:42:58 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1352821376!19966884!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17150 invoked from network); 13 Nov 2012 15:42:58 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:42:58 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="214346974"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:42:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:42:56 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYIdW-0008Hy-BM;
	Tue, 13 Nov 2012 15:42:50 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <xen-devel@lists.xensource.com>
Date: Tue, 13 Nov 2012 15:42:12 +0000
Message-ID: <1352821336-25837-3-git-send-email-stefano.stabellini@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
MIME-Version: 1.0
Cc: tim@xen.org, Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH 3/7] pl011: set baud and clock_hz to the right
	defaults for Versatile Express
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
---
 xen/drivers/char/pl011.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
index 6af45aa..6ccb73a 100644
--- a/xen/drivers/char/pl011.c
+++ b/xen/drivers/char/pl011.c
@@ -241,8 +241,8 @@ void __init pl011_init(int index, unsigned long register_base_address)
 
     uart = &pl011_com[index];
 
-    uart->clock_hz  = 7372800;
-    uart->baud      = 115200;
+    uart->clock_hz  = 0x16e3600;
+    uart->baud      = 38400;
     uart->data_bits = 8;
     uart->parity    = PARITY_NONE;
     uart->stop_bits = 1;
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:43:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:43:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIdk-00004v-Rg; Tue, 13 Nov 2012 15:43:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYIdi-0008Ub-ON
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 15:43:03 +0000
Received: from [85.158.139.211:58313] by server-5.bemta-5.messagelabs.com id
	D6/CB-11353-68A62A05; Tue, 13 Nov 2012 15:43:02 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1352821376!19966884!2
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17293 invoked from network); 13 Nov 2012 15:43:01 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:43:01 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="214347008"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:43:01 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:43:01 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYIdW-0008Hy-H7;
	Tue, 13 Nov 2012 15:42:50 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <xen-devel@lists.xensource.com>
Date: Tue, 13 Nov 2012 15:42:16 +0000
Message-ID: <1352821336-25837-7-git-send-email-stefano.stabellini@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
MIME-Version: 1.0
Cc: tim@xen.org, Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH 7/7] xen/arm: get the number of cpus from device
	tree
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The system might have fewer cpus than the GIC supports.

Changes in v2:
- return always at least 1 cpu;
- skip nodes with names that don't start with "cpu".

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/gic.c            |    4 +---
 xen/arch/arm/gic.h            |    2 +-
 xen/arch/arm/setup.c          |    3 ++-
 xen/common/device_tree.c      |   19 +++++++++++++++++++
 xen/include/xen/device_tree.h |    1 +
 5 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 5f06e08..0c6fab9 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -304,7 +304,7 @@ static void __cpuinit gic_hyp_disable(void)
 }
 
 /* Set up the GIC */
-int __init gic_init(void)
+void __init gic_init(void)
 {
     /* XXX FIXME get this from devicetree */
     gic.dbase = GIC_BASE_ADDRESS + GIC_DR_OFFSET;
@@ -328,8 +328,6 @@ int __init gic_init(void)
     gic.lr_mask = 0ULL;
 
     spin_unlock(&gic.lock);
-
-    return gic.cpus;
 }
 
 /* Set up the per-CPU parts of the GIC for a secondary CPU */
diff --git a/xen/arch/arm/gic.h b/xen/arch/arm/gic.h
index b2e1d7f..1bf1b02 100644
--- a/xen/arch/arm/gic.h
+++ b/xen/arch/arm/gic.h
@@ -147,7 +147,7 @@ extern int gic_route_irq_to_guest(struct domain *d, unsigned int irq,
 /* Accept an interrupt from the GIC and dispatch its handler */
 extern void gic_interrupt(struct cpu_user_regs *regs, int is_fiq);
 /* Bring up the interrupt controller, and report # cpus attached */
-extern int gic_init(void);
+extern void gic_init(void);
 /* Bring up a secondary CPU's per-CPU GIC interface */
 extern void gic_init_secondary_cpu(void);
 /* Take down a CPU's per-CPU GIC interface */
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index a579a56..632e7e3 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -193,6 +193,7 @@ void __init start_xen(unsigned long boot_phys_offset,
         + (atag_paddr & ((1 << SECOND_SHIFT) - 1));
     fdt_size = device_tree_early_init(fdt);
 
+    cpus = device_tree_cpus(fdt);
     cmdline_parse(device_tree_bootargs(fdt));
 
     setup_pagetables(boot_phys_offset, get_xen_paddr());
@@ -203,7 +204,7 @@ void __init start_xen(unsigned long boot_phys_offset,
     console_init_preirq();
 #endif
 
-    cpus = gic_init();
+    gic_init();
     make_cpus_ready(cpus, boot_phys_offset);
 
     percpu_init_areas();
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 3d1f0f4..5b6dab9 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -153,6 +153,25 @@ const char *device_tree_bootargs(const void *fdt)
     return prop->data;
 }
 
+int device_tree_cpus(const void *fdt)
+{
+    int node = 0, depth = 1;
+    int cpus = 0;
+
+    node = fdt_path_offset(fdt, "/cpus/cpu");
+    if ( node < 0 )
+        return 1; /* we have at least one cpu */
+
+    while ( node >= 0 && depth >= 0 ) {
+        if ( strncmp(fdt_get_name(fdt, node, NULL), "cpu", 3) )
+            continue;
+        node = fdt_next_node(fdt, node, &depth);
+        cpus++;
+    }
+
+    return cpus > 0 ? cpus : 1;
+}
+
 static int dump_node(const void *fdt, int node, const char *name, int depth,
                      u32 address_cells, u32 size_cells, void *data)
 {
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 4d010c0..46bc0f8 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -49,6 +49,7 @@ bool_t device_tree_node_matches(const void *fdt, int node, const char *match);
 int device_tree_for_each_node(const void *fdt,
                               device_tree_node_func func, void *data);
 const char *device_tree_bootargs(const void *fdt);
+int device_tree_cpus(const void *fdt);
 void device_tree_dump(const void *fdt);
 
 #endif
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:43:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:43:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIdl-00005B-8P; Tue, 13 Nov 2012 15:43:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYIdj-0008Uv-28
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 15:43:03 +0000
Received: from [85.158.138.51:32016] by server-14.bemta-3.messagelabs.com id
	A1/16-12788-48A62A05; Tue, 13 Nov 2012 15:43:00 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352821378!21780108!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 832 invoked from network); 13 Nov 2012 15:42:59 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-3.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:42:59 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44429020"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:42:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:42:56 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYIdW-0008Hy-Ej;
	Tue, 13 Nov 2012 15:42:50 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <xen-devel@lists.xensource.com>
Date: Tue, 13 Nov 2012 15:42:14 +0000
Message-ID: <1352821336-25837-5-git-send-email-stefano.stabellini@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
MIME-Version: 1.0
Cc: tim@xen.org, Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH 5/7] xen/arm: wake up secondary cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Secondary cpus are held by the firmware until we send an IPI to them.

Changes in v2:
- use preprocessor definitions in kick_cpus;
- do not manually increment the base address register, use an offset
instead;
- move kick_cpus to proc-ca15.S.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/gic.h                      |    2 ++
 xen/arch/arm/head.S                     |    8 ++++++--
 xen/arch/arm/mode_switch.S              |   28 ++++++++++++++++++++++++++++
 xen/include/asm-arm/platform_vexpress.h |   17 +++++++++++++++++
 4 files changed, 53 insertions(+), 2 deletions(-)
 create mode 100644 xen/include/asm-arm/platform_vexpress.h

diff --git a/xen/arch/arm/gic.h b/xen/arch/arm/gic.h
index b8f9f201..b2e1d7f 100644
--- a/xen/arch/arm/gic.h
+++ b/xen/arch/arm/gic.h
@@ -124,6 +124,7 @@
 /* XXX: write this into the DT */
 #define VGIC_IRQ_EVTCHN_CALLBACK 31
 
+#ifndef __ASSEMBLY__
 extern int domain_vgic_init(struct domain *d);
 extern void domain_vgic_free(struct domain *d);
 
@@ -158,6 +159,7 @@ extern int gicv_setup(struct domain *d);
 extern void gic_save_state(struct vcpu *v);
 extern void gic_restore_state(struct vcpu *v);
 
+#endif /* __ASSEMBLY__ */
 #endif
 
 /*
diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 25993d6..3fe6412 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -80,12 +80,12 @@ start:
 	beq   boot_cpu               /* If we're CPU 0, boot now */
 
 	/* Non-boot CPUs wait here to be woken up one at a time. */
-1:	wfe
-	dsb
+1:	dsb
 	ldr   r0, =smp_up_cpu        /* VA of gate */
 	add   r0, r0, r10            /* PA of gate */
 	ldr   r1, [r0]               /* Which CPU is being booted? */
 	teq   r1, r12                /* Is it us? */
+	wfene
 	bne   1b
 
 boot_cpu:
@@ -99,6 +99,10 @@ boot_cpu:
 	PRINT(" booting -\r\n")
 #endif
 
+	/* Wake up secondary cpus */
+	teq   r12, #0
+	bleq  kick_cpus
+
 	/* Check that this CPU has Hyp mode */
 	mrc   CP32(r0, ID_PFR1)
 	and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
diff --git a/xen/arch/arm/mode_switch.S b/xen/arch/arm/mode_switch.S
index 83a682b..7ff2f9e 100644
--- a/xen/arch/arm/mode_switch.S
+++ b/xen/arch/arm/mode_switch.S
@@ -19,7 +19,35 @@
 
 #include <asm/config.h>
 #include <asm/page.h>
+#include <asm/platform_vexpress.h>
 #include <asm/asm_defns.h>
+#include "gic.h"
+
+
+/* XXX: Versatile Express specific code */
+/* wake up secondary cpus */
+.globl kick_cpus
+kick_cpus:
+    /* write start paddr to v2m sysreg FLAGSSET register */
+	ldr   r0, =(V2M_SYS_MMIO_BASE)        /* base V2M sysreg MMIO address */
+	dsb
+	mov   r2, #0xffffffff
+	str   r2, [r0, #(V2M_SYS_FLAGSCLR)]
+	dsb
+	ldr   r2, =start
+	add   r2, r2, r10
+	str   r2, [r0, #(V2M_SYS_FLAGSSET)]
+	dsb
+	/* send an interrupt */
+	ldr   r0, =(GIC_BASE_ADDRESS + GIC_DR_OFFSET) /* base GICD MMIO address */
+	mov   r2, #0x1
+	str   r2, [r0, #(GICD_CTLR * 4)]      /* enable distributor */
+	mov   r2, #0xfe0000
+	str   r2, [r0, #(GICD_SGIR * 4)]      /* send IPI to everybody */
+	dsb
+	str   r2, [r0, #(GICD_CTLR * 4)]      /* disable distributor */
+	mov   pc, lr
+
 
 /* Get up a CPU into Hyp mode.  Clobbers r0-r3.
  *
diff --git a/xen/include/asm-arm/platform_vexpress.h b/xen/include/asm-arm/platform_vexpress.h
new file mode 100644
index 0000000..3556af3
--- /dev/null
+++ b/xen/include/asm-arm/platform_vexpress.h
@@ -0,0 +1,17 @@
+#ifndef __ASM_ARM_PLATFORM_H
+#define __ASM_ARM_PLATFORM_H
+
+/* V2M */
+#define V2M_SYS_MMIO_BASE     (0x1c010000)
+#define V2M_SYS_FLAGSSET      (0x30)
+#define V2M_SYS_FLAGSCLR      (0x34)
+
+#endif /* __ASM_ARM_PLATFORM_H */
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:43:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:43:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIdl-00005B-8P; Tue, 13 Nov 2012 15:43:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYIdj-0008Uv-28
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 15:43:03 +0000
Received: from [85.158.138.51:32016] by server-14.bemta-3.messagelabs.com id
	A1/16-12788-48A62A05; Tue, 13 Nov 2012 15:43:00 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352821378!21780108!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 832 invoked from network); 13 Nov 2012 15:42:59 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-3.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:42:59 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44429020"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:42:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:42:56 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYIdW-0008Hy-Ej;
	Tue, 13 Nov 2012 15:42:50 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <xen-devel@lists.xensource.com>
Date: Tue, 13 Nov 2012 15:42:14 +0000
Message-ID: <1352821336-25837-5-git-send-email-stefano.stabellini@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
MIME-Version: 1.0
Cc: tim@xen.org, Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH 5/7] xen/arm: wake up secondary cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Secondary cpus are held by the firmware until we send an IPI to them.

Changes in v2:
- use preprocessor definitions in kick_cpus;
- do not manually increment the base address register, use an offset
instead;
- move kick_cpus to proc-ca15.S.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/gic.h                      |    2 ++
 xen/arch/arm/head.S                     |    8 ++++++--
 xen/arch/arm/mode_switch.S              |   28 ++++++++++++++++++++++++++++
 xen/include/asm-arm/platform_vexpress.h |   17 +++++++++++++++++
 4 files changed, 53 insertions(+), 2 deletions(-)
 create mode 100644 xen/include/asm-arm/platform_vexpress.h

diff --git a/xen/arch/arm/gic.h b/xen/arch/arm/gic.h
index b8f9f201..b2e1d7f 100644
--- a/xen/arch/arm/gic.h
+++ b/xen/arch/arm/gic.h
@@ -124,6 +124,7 @@
 /* XXX: write this into the DT */
 #define VGIC_IRQ_EVTCHN_CALLBACK 31
 
+#ifndef __ASSEMBLY__
 extern int domain_vgic_init(struct domain *d);
 extern void domain_vgic_free(struct domain *d);
 
@@ -158,6 +159,7 @@ extern int gicv_setup(struct domain *d);
 extern void gic_save_state(struct vcpu *v);
 extern void gic_restore_state(struct vcpu *v);
 
+#endif /* __ASSEMBLY__ */
 #endif
 
 /*
diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 25993d6..3fe6412 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -80,12 +80,12 @@ start:
 	beq   boot_cpu               /* If we're CPU 0, boot now */
 
 	/* Non-boot CPUs wait here to be woken up one at a time. */
-1:	wfe
-	dsb
+1:	dsb
 	ldr   r0, =smp_up_cpu        /* VA of gate */
 	add   r0, r0, r10            /* PA of gate */
 	ldr   r1, [r0]               /* Which CPU is being booted? */
 	teq   r1, r12                /* Is it us? */
+	wfene
 	bne   1b
 
 boot_cpu:
@@ -99,6 +99,10 @@ boot_cpu:
 	PRINT(" booting -\r\n")
 #endif
 
+	/* Wake up secondary cpus */
+	teq   r12, #0
+	bleq  kick_cpus
+
 	/* Check that this CPU has Hyp mode */
 	mrc   CP32(r0, ID_PFR1)
 	and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
diff --git a/xen/arch/arm/mode_switch.S b/xen/arch/arm/mode_switch.S
index 83a682b..7ff2f9e 100644
--- a/xen/arch/arm/mode_switch.S
+++ b/xen/arch/arm/mode_switch.S
@@ -19,7 +19,35 @@
 
 #include <asm/config.h>
 #include <asm/page.h>
+#include <asm/platform_vexpress.h>
 #include <asm/asm_defns.h>
+#include "gic.h"
+
+
+/* XXX: Versatile Express specific code */
+/* wake up secondary cpus */
+.globl kick_cpus
+kick_cpus:
+    /* write start paddr to v2m sysreg FLAGSSET register */
+	ldr   r0, =(V2M_SYS_MMIO_BASE)        /* base V2M sysreg MMIO address */
+	dsb
+	mov   r2, #0xffffffff
+	str   r2, [r0, #(V2M_SYS_FLAGSCLR)]
+	dsb
+	ldr   r2, =start
+	add   r2, r2, r10
+	str   r2, [r0, #(V2M_SYS_FLAGSSET)]
+	dsb
+	/* send an interrupt */
+	ldr   r0, =(GIC_BASE_ADDRESS + GIC_DR_OFFSET) /* base GICD MMIO address */
+	mov   r2, #0x1
+	str   r2, [r0, #(GICD_CTLR * 4)]      /* enable distributor */
+	mov   r2, #0xfe0000
+	str   r2, [r0, #(GICD_SGIR * 4)]      /* send IPI to everybody */
+	dsb
+	str   r2, [r0, #(GICD_CTLR * 4)]      /* disable distributor */
+	mov   pc, lr
+
 
 /* Get up a CPU into Hyp mode.  Clobbers r0-r3.
  *
diff --git a/xen/include/asm-arm/platform_vexpress.h b/xen/include/asm-arm/platform_vexpress.h
new file mode 100644
index 0000000..3556af3
--- /dev/null
+++ b/xen/include/asm-arm/platform_vexpress.h
@@ -0,0 +1,17 @@
+#ifndef __ASM_ARM_PLATFORM_H
+#define __ASM_ARM_PLATFORM_H
+
+/* V2M */
+#define V2M_SYS_MMIO_BASE     (0x1c010000)
+#define V2M_SYS_FLAGSSET      (0x30)
+#define V2M_SYS_FLAGSCLR      (0x34)
+
+#endif /* __ASM_ARM_PLATFORM_H */
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:43:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:43:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIdi-0008VW-MU; Tue, 13 Nov 2012 15:43:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYIdh-0008Ul-2l
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 15:43:01 +0000
Received: from [85.158.139.83:13815] by server-8.bemta-5.messagelabs.com id
	80/7A-06050-48A62A05; Tue, 13 Nov 2012 15:43:00 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352821376!29383434!3
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27091 invoked from network); 13 Nov 2012 15:42:59 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:42:59 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44429019"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:42:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:42:56 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYIdW-0008Hy-9i;
	Tue, 13 Nov 2012 15:42:50 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <xen-devel@lists.xensource.com>
Date: Tue, 13 Nov 2012 15:42:11 +0000
Message-ID: <1352821336-25837-2-git-send-email-stefano.stabellini@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
MIME-Version: 1.0
Cc: tim@xen.org, Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH 2/7] xen/arm: setup the fixmap in head.S
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Setup the fixmap mapping directly in head.S rather than having a
temporary mapping only to re-do it later in C.


Changes in v2:

- fix code style;
- more comments;
- always hook xen_fixmap in the pagetable but fill in the console fixmap
only if EARLY_UART_ADDRESS.


Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/early_printk.c |    5 ++---
 xen/arch/arm/head.S         |   40 +++++++++++++++++++++++-----------------
 xen/arch/arm/mm.c           |    2 +-
 xen/arch/arm/setup.c        |    2 --
 4 files changed, 26 insertions(+), 23 deletions(-)

diff --git a/xen/arch/arm/early_printk.c b/xen/arch/arm/early_printk.c
index 3e51252..bdf4c0e 100644
--- a/xen/arch/arm/early_printk.c
+++ b/xen/arch/arm/early_printk.c
@@ -17,12 +17,11 @@
 
 #ifdef EARLY_UART_ADDRESS
 
-static void __init early_putch(char c)
+void __init early_putch(char c)
 {
     volatile uint32_t *r;
 
-    r = (uint32_t *)((EARLY_UART_ADDRESS & 0x001fffff)
-                     + XEN_VIRT_START + (1 << 21));
+    r = (uint32_t *)(XEN_VIRT_START + (1 << 21));
 
     /* XXX: assuming a PL011 UART. */
     while(*(r + 0x6) & 0x8)
diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 9fdeda7..4506244 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -24,6 +24,7 @@
 #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
 #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
 #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
+#define PT_DEV_L3 0xe73 /* lev3: nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=1, P=1 */
 
 #define PT_UPPER(x) (PT_##x & 0xf00)
 #define PT_LOWER(x) (PT_##x & 0x0ff)
@@ -183,6 +184,18 @@ skip_bss:
 	teq   r12, #0
 	bne   pt_ready
 	
+	/* console fixmap */
+#ifdef EARLY_UART_ADDRESS
+	ldr   r1, =xen_fixmap
+	add   r1, r1, r10            /* r1 := paddr (xen_fixmap) */
+	mov   r3, #0
+	lsr   r2, r11, #12
+	lsl   r2, r2, #12            /* 4K aligned paddr of UART */
+	orr   r2, r2, #PT_UPPER(DEV_L3)
+	orr   r2, r2, #PT_LOWER(DEV_L3) /* r2:r3 := 4K dev map including UART */
+	strd  r2, r3, [r1, #(FIXMAP_CONSOLE*8)] /* Map it in the first fixmap's slot */
+#endif
+	
 	/* Build the baseline idle pagetable's first-level entries */
 	ldr   r1, =xen_second
 	add   r1, r1, r10            /* r1 := paddr (xen_second) */
@@ -205,17 +218,15 @@ skip_bss:
 	ldr   r4, =start
 	lsr   r4, #18                /* Slot for vaddr(start) */
 	strd  r2, r3, [r1, r4]       /* Map Xen there too */
-#ifdef EARLY_UART_ADDRESS
-	ldr   r3, =(1<<(54-32))      /* NS for device mapping */
-	lsr   r2, r11, #21
-	lsl   r2, r2, #21            /* 2MB-aligned paddr of UART */
-	orr   r2, r2, #PT_UPPER(DEV)
-	orr   r2, r2, #PT_LOWER(DEV) /* r2:r3 := 2MB dev map including UART */
+
+	/* xen_fixmap pagetable */
+	ldr   r2, =xen_fixmap
+	add   r2, r2, r10            /* r2 := paddr (xen_fixmap) */
+	orr   r2, r2, #PT_UPPER(PT)
+	orr   r2, r2, #PT_LOWER(PT)  /* r2:r3 := table map of xen_fixmap */
 	add   r4, r4, #8
 	strd  r2, r3, [r1, r4]       /* Map it in the fixmap's slot */
-#else
-	add   r4, r4, #8             /* Skip over unused fixmap slot */
-#endif
+
 	mov   r3, #0x0
 	lsr   r2, r8, #21
 	lsl   r2, r2, #21            /* 2MB-aligned paddr of DTB */
@@ -236,13 +247,10 @@ pt_ready:
 	mov   pc, r1                 /* Get a proper vaddr into PC */
 paging:
 
+	
 #ifdef EARLY_UART_ADDRESS
-	/* Recover the UART address in the new address space. */
-	lsl   r11, #11
-	lsr   r11, #11               /* UART base's offset from 2MB base */
-	adr   r0, start
-	add   r0, r0, #0x200000      /* vaddr of the fixmap's 2MB slot */
-	add   r11, r11, r0           /* r11 := vaddr (UART base address) */
+    /* Use a virtual address to access the UART. */
+	ldr   r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
 #endif
 
 	PRINT("- Ready -\r\n")
@@ -261,8 +269,6 @@ paging:
 	mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
 	dsb                          /* Ensure completion of TLB+BP flush */
 	isb
- 	/* Now, the UART is in its proper fixmap address */
-	ldrne r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
 
 	/* Non-boot CPUs report that they've got this far */
 	ldr   r0, =ready_cpus
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index b0068d2..d0cd2c9 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -37,7 +37,7 @@ struct domain *dom_xen, *dom_io;
 /* Static start-of-day pagetables that we use before the allocators are up */
 lpae_t xen_pgtable[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 lpae_t xen_second[LPAE_ENTRIES*4] __attribute__((__aligned__(4096*4)));
-static lpae_t xen_fixmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
+lpae_t xen_fixmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 static lpae_t xen_xenmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 
 /* Non-boot CPUs use this to find the correct pagetables. */
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 7568968..6fbcb81 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -194,9 +194,7 @@ void __init start_xen(unsigned long boot_phys_offset,
     setup_pagetables(boot_phys_offset, get_xen_paddr());
 
 #ifdef EARLY_UART_ADDRESS
-    /* Map the UART */
     /* TODO Need to get device tree or command line for UART address */
-    set_fixmap(FIXMAP_CONSOLE, EARLY_UART_ADDRESS >> PAGE_SHIFT, DEV_SHARED);
     pl011_init(0, FIXMAP_ADDR(FIXMAP_CONSOLE));
     console_init_preirq();
 #endif
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:43:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:43:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIdi-0008VA-8j; Tue, 13 Nov 2012 15:43:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYIdf-0008UU-NC
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 15:43:00 +0000
Received: from [85.158.139.83:26229] by server-16.bemta-5.messagelabs.com id
	F9/71-04786-28A62A05; Tue, 13 Nov 2012 15:42:58 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352821376!29383434!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27003 invoked from network); 13 Nov 2012 15:42:57 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:42:57 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44429016"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:42:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:42:56 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYIdW-0008Hy-8w;
	Tue, 13 Nov 2012 15:42:50 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <xen-devel@lists.xensource.com>
Date: Tue, 13 Nov 2012 15:42:10 +0000
Message-ID: <1352821336-25837-1-git-send-email-stefano.stabellini@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
MIME-Version: 1.0
Cc: tim@xen.org, Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH 1/7] xen/arm: pass the correct bit-per-interrupt
	argument to vgic_irq_rank
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Use 1 for registers that have 1 bit per irq.

Changes in v2:
- add case 1 to REG_RANK_NR rather than changing the implementation.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/vgic.c |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 3c3983f..3f7e757 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -47,6 +47,7 @@ static inline int REG_RANK_NR(int b, uint32_t n)
     case 8: return n >> 3;
     case 4: return n >> 2;
     case 2: return n >> 1;
+    case 1: return n;
     default: BUG();
     }
 }
@@ -199,7 +200,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISENABLER ... GICD_ISENABLERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISENABLER);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISENABLER);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = rank->ienable;
@@ -208,7 +209,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICENABLER ... GICD_ICENABLERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICENABLER);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICENABLER);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = rank->ienable;
@@ -217,7 +218,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISPENDR ... GICD_ISPENDRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISPENDR);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISPENDR);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = byte_read(rank->ipend, dabt.sign, offset);
@@ -226,7 +227,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICPENDR ... GICD_ICPENDRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICPENDR);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICPENDR);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = byte_read(rank->ipend, dabt.sign, offset);
@@ -235,7 +236,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISACTIVER);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISACTIVER);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = rank->iactive;
@@ -244,7 +245,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICACTIVER ... GICD_ICACTIVERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICACTIVER);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICACTIVER);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = rank->iactive;
@@ -296,7 +297,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_CPENDSGIR);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_CPENDSGIR);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = byte_read(rank->pendsgi, dabt.sign, offset);
@@ -305,7 +306,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_SPENDSGIR);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_SPENDSGIR);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = byte_read(rank->pendsgi, dabt.sign, offset);
@@ -400,7 +401,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISENABLER ... GICD_ISENABLERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISENABLER);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISENABLER);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         tr = rank->ienable;
@@ -411,7 +412,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICENABLER ... GICD_ICENABLERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICENABLER);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICENABLER);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         rank->ienable &= ~*r;
@@ -432,7 +433,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISACTIVER);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISACTIVER);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         rank->iactive &= ~*r;
@@ -441,7 +442,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICACTIVER ... GICD_ICACTIVERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICACTIVER);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICACTIVER);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         rank->iactive &= ~*r;
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:43:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:43:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIdi-0008VW-MU; Tue, 13 Nov 2012 15:43:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYIdh-0008Ul-2l
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 15:43:01 +0000
Received: from [85.158.139.83:13815] by server-8.bemta-5.messagelabs.com id
	80/7A-06050-48A62A05; Tue, 13 Nov 2012 15:43:00 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352821376!29383434!3
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27091 invoked from network); 13 Nov 2012 15:42:59 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:42:59 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44429019"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:42:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:42:56 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYIdW-0008Hy-9i;
	Tue, 13 Nov 2012 15:42:50 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <xen-devel@lists.xensource.com>
Date: Tue, 13 Nov 2012 15:42:11 +0000
Message-ID: <1352821336-25837-2-git-send-email-stefano.stabellini@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
MIME-Version: 1.0
Cc: tim@xen.org, Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH 2/7] xen/arm: setup the fixmap in head.S
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Setup the fixmap mapping directly in head.S rather than having a
temporary mapping only to re-do it later in C.


Changes in v2:

- fix code style;
- more comments;
- always hook xen_fixmap in the pagetable but fill in the console fixmap
only if EARLY_UART_ADDRESS.


Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/early_printk.c |    5 ++---
 xen/arch/arm/head.S         |   40 +++++++++++++++++++++++-----------------
 xen/arch/arm/mm.c           |    2 +-
 xen/arch/arm/setup.c        |    2 --
 4 files changed, 26 insertions(+), 23 deletions(-)

diff --git a/xen/arch/arm/early_printk.c b/xen/arch/arm/early_printk.c
index 3e51252..bdf4c0e 100644
--- a/xen/arch/arm/early_printk.c
+++ b/xen/arch/arm/early_printk.c
@@ -17,12 +17,11 @@
 
 #ifdef EARLY_UART_ADDRESS
 
-static void __init early_putch(char c)
+void __init early_putch(char c)
 {
     volatile uint32_t *r;
 
-    r = (uint32_t *)((EARLY_UART_ADDRESS & 0x001fffff)
-                     + XEN_VIRT_START + (1 << 21));
+    r = (uint32_t *)(XEN_VIRT_START + (1 << 21));
 
     /* XXX: assuming a PL011 UART. */
     while(*(r + 0x6) & 0x8)
diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 9fdeda7..4506244 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -24,6 +24,7 @@
 #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
 #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
 #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
+#define PT_DEV_L3 0xe73 /* lev3: nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=1, P=1 */
 
 #define PT_UPPER(x) (PT_##x & 0xf00)
 #define PT_LOWER(x) (PT_##x & 0x0ff)
@@ -183,6 +184,18 @@ skip_bss:
 	teq   r12, #0
 	bne   pt_ready
 	
+	/* console fixmap */
+#ifdef EARLY_UART_ADDRESS
+	ldr   r1, =xen_fixmap
+	add   r1, r1, r10            /* r1 := paddr (xen_fixmap) */
+	mov   r3, #0
+	lsr   r2, r11, #12
+	lsl   r2, r2, #12            /* 4K aligned paddr of UART */
+	orr   r2, r2, #PT_UPPER(DEV_L3)
+	orr   r2, r2, #PT_LOWER(DEV_L3) /* r2:r3 := 4K dev map including UART */
+	strd  r2, r3, [r1, #(FIXMAP_CONSOLE*8)] /* Map it in the first fixmap's slot */
+#endif
+	
 	/* Build the baseline idle pagetable's first-level entries */
 	ldr   r1, =xen_second
 	add   r1, r1, r10            /* r1 := paddr (xen_second) */
@@ -205,17 +218,15 @@ skip_bss:
 	ldr   r4, =start
 	lsr   r4, #18                /* Slot for vaddr(start) */
 	strd  r2, r3, [r1, r4]       /* Map Xen there too */
-#ifdef EARLY_UART_ADDRESS
-	ldr   r3, =(1<<(54-32))      /* NS for device mapping */
-	lsr   r2, r11, #21
-	lsl   r2, r2, #21            /* 2MB-aligned paddr of UART */
-	orr   r2, r2, #PT_UPPER(DEV)
-	orr   r2, r2, #PT_LOWER(DEV) /* r2:r3 := 2MB dev map including UART */
+
+	/* xen_fixmap pagetable */
+	ldr   r2, =xen_fixmap
+	add   r2, r2, r10            /* r2 := paddr (xen_fixmap) */
+	orr   r2, r2, #PT_UPPER(PT)
+	orr   r2, r2, #PT_LOWER(PT)  /* r2:r3 := table map of xen_fixmap */
 	add   r4, r4, #8
 	strd  r2, r3, [r1, r4]       /* Map it in the fixmap's slot */
-#else
-	add   r4, r4, #8             /* Skip over unused fixmap slot */
-#endif
+
 	mov   r3, #0x0
 	lsr   r2, r8, #21
 	lsl   r2, r2, #21            /* 2MB-aligned paddr of DTB */
@@ -236,13 +247,10 @@ pt_ready:
 	mov   pc, r1                 /* Get a proper vaddr into PC */
 paging:
 
+	
 #ifdef EARLY_UART_ADDRESS
-	/* Recover the UART address in the new address space. */
-	lsl   r11, #11
-	lsr   r11, #11               /* UART base's offset from 2MB base */
-	adr   r0, start
-	add   r0, r0, #0x200000      /* vaddr of the fixmap's 2MB slot */
-	add   r11, r11, r0           /* r11 := vaddr (UART base address) */
+    /* Use a virtual address to access the UART. */
+	ldr   r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
 #endif
 
 	PRINT("- Ready -\r\n")
@@ -261,8 +269,6 @@ paging:
 	mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
 	dsb                          /* Ensure completion of TLB+BP flush */
 	isb
- 	/* Now, the UART is in its proper fixmap address */
-	ldrne r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
 
 	/* Non-boot CPUs report that they've got this far */
 	ldr   r0, =ready_cpus
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index b0068d2..d0cd2c9 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -37,7 +37,7 @@ struct domain *dom_xen, *dom_io;
 /* Static start-of-day pagetables that we use before the allocators are up */
 lpae_t xen_pgtable[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 lpae_t xen_second[LPAE_ENTRIES*4] __attribute__((__aligned__(4096*4)));
-static lpae_t xen_fixmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
+lpae_t xen_fixmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 static lpae_t xen_xenmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 
 /* Non-boot CPUs use this to find the correct pagetables. */
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 7568968..6fbcb81 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -194,9 +194,7 @@ void __init start_xen(unsigned long boot_phys_offset,
     setup_pagetables(boot_phys_offset, get_xen_paddr());
 
 #ifdef EARLY_UART_ADDRESS
-    /* Map the UART */
     /* TODO Need to get device tree or command line for UART address */
-    set_fixmap(FIXMAP_CONSOLE, EARLY_UART_ADDRESS >> PAGE_SHIFT, DEV_SHARED);
     pl011_init(0, FIXMAP_ADDR(FIXMAP_CONSOLE));
     console_init_preirq();
 #endif
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:43:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:43:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIdi-0008VA-8j; Tue, 13 Nov 2012 15:43:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYIdf-0008UU-NC
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 15:43:00 +0000
Received: from [85.158.139.83:26229] by server-16.bemta-5.messagelabs.com id
	F9/71-04786-28A62A05; Tue, 13 Nov 2012 15:42:58 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352821376!29383434!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27003 invoked from network); 13 Nov 2012 15:42:57 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:42:57 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44429016"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:42:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:42:56 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYIdW-0008Hy-8w;
	Tue, 13 Nov 2012 15:42:50 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <xen-devel@lists.xensource.com>
Date: Tue, 13 Nov 2012 15:42:10 +0000
Message-ID: <1352821336-25837-1-git-send-email-stefano.stabellini@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
MIME-Version: 1.0
Cc: tim@xen.org, Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH 1/7] xen/arm: pass the correct bit-per-interrupt
	argument to vgic_irq_rank
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Use 1 for registers that have 1 bit per irq.

Changes in v2:
- add case 1 to REG_RANK_NR rather than changing the implementation.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/vgic.c |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 3c3983f..3f7e757 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -47,6 +47,7 @@ static inline int REG_RANK_NR(int b, uint32_t n)
     case 8: return n >> 3;
     case 4: return n >> 2;
     case 2: return n >> 1;
+    case 1: return n;
     default: BUG();
     }
 }
@@ -199,7 +200,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISENABLER ... GICD_ISENABLERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISENABLER);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISENABLER);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = rank->ienable;
@@ -208,7 +209,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICENABLER ... GICD_ICENABLERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICENABLER);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICENABLER);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = rank->ienable;
@@ -217,7 +218,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISPENDR ... GICD_ISPENDRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISPENDR);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISPENDR);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = byte_read(rank->ipend, dabt.sign, offset);
@@ -226,7 +227,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICPENDR ... GICD_ICPENDRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICPENDR);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICPENDR);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = byte_read(rank->ipend, dabt.sign, offset);
@@ -235,7 +236,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISACTIVER);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISACTIVER);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = rank->iactive;
@@ -244,7 +245,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICACTIVER ... GICD_ICACTIVERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICACTIVER);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICACTIVER);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = rank->iactive;
@@ -296,7 +297,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_CPENDSGIR);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_CPENDSGIR);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = byte_read(rank->pendsgi, dabt.sign, offset);
@@ -305,7 +306,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_SPENDSGIR);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_SPENDSGIR);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = byte_read(rank->pendsgi, dabt.sign, offset);
@@ -400,7 +401,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISENABLER ... GICD_ISENABLERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISENABLER);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISENABLER);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         tr = rank->ienable;
@@ -411,7 +412,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICENABLER ... GICD_ICENABLERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICENABLER);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICENABLER);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         rank->ienable &= ~*r;
@@ -432,7 +433,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISACTIVER);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISACTIVER);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         rank->iactive &= ~*r;
@@ -441,7 +442,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICACTIVER ... GICD_ICACTIVERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICACTIVER);
+        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICACTIVER);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         rank->iactive &= ~*r;
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:43:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:43:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIdk-0008WL-EV; Tue, 13 Nov 2012 15:43:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYIdi-0008Ub-2K
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 15:43:02 +0000
Received: from [85.158.139.83:13728] by server-5.bemta-5.messagelabs.com id
	4B/BB-11353-38A62A05; Tue, 13 Nov 2012 15:42:59 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352821376!29383434!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27045 invoked from network); 13 Nov 2012 15:42:58 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:42:58 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208,223";a="44429018"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:42:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:42:56 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYIdW-0008Hy-D2;
	Tue, 13 Nov 2012 15:42:50 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <xen-devel@lists.xensource.com>
Date: Tue, 13 Nov 2012 15:42:13 +0000
Message-ID: <1352821336-25837-4-git-send-email-stefano.stabellini@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
MIME-Version: 1.0
Cc: tim@xen.org, Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH 4/7] xen/arm: set the SMP bit in the ACTLR
	register
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>From the Cortex A15 manual:

"Enables the processor to receive instruction cache, BTB, and TLB maintenance
operations from other processors"

...

"You must set this bit before enabling the caches and MMU, or
performing any cache and TLB maintenance operations. The only time
you must clear this bit is during a processor power-down sequence"


Changes in v2:
- detect the processor ID and call a processor specific initialization
function;
- move the ACTLR initialization to the CortexA15 initialization
function;
- move the ACTLR_* defines to processor-ca15.h.


Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/arm/Makefile                |    1 +
 xen/arch/arm/head.S                  |   10 +++++++
 xen/arch/arm/proc-ca15.S             |   28 +++++++++++++++++++++
 xen/include/asm-arm/cpregs.h         |    1 +
 xen/include/asm-arm/processor-ca15.h |   45 ++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/processor.h      |    3 ++
 6 files changed, 88 insertions(+), 0 deletions(-)
 create mode 100644 xen/arch/arm/proc-ca15.S
 create mode 100644 xen/include/asm-arm/processor-ca15.h

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 634b620..d3e34bc 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -13,6 +13,7 @@ obj-y += irq.o
 obj-y += kernel.o
 obj-y += mm.o
 obj-y += mode_switch.o
+obj-y += proc-ca15.o
 obj-y += p2m.o
 obj-y += percpu.o
 obj-y += guestcopy.o
diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 4506244..25993d6 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -19,6 +19,7 @@
 
 #include <asm/config.h>
 #include <asm/page.h>
+#include <asm/processor-ca15.h>
 #include <asm/asm_defns.h>
 
 #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
@@ -148,6 +149,15 @@ skip_bss:
 
 	PRINT("- Setting up control registers -\r\n")
 	
+	/* Read CPU ID */
+	mrc   CP32(r0, MIDR)
+	ldr   r1, =(MIDR_MASK)
+	and   r0, r0, r1
+	/* Is this a Cortex A15? */
+	ldr   r1, =(CORTEX_A15_ID)
+	teq   r0, r1
+	bleq  cortex_a15_init
+
 	/* Set up memory attribute type tables */
 	ldr   r0, =MAIR0VAL
 	ldr   r1, =MAIR1VAL
diff --git a/xen/arch/arm/proc-ca15.S b/xen/arch/arm/proc-ca15.S
new file mode 100644
index 0000000..5a5bf64
--- /dev/null
+++ b/xen/arch/arm/proc-ca15.S
@@ -0,0 +1,28 @@
+/*
+ * xen/arch/arm/proc-ca15.S
+ *
+ * Cortex A15 specific initializations
+ *
+ * Copyright (c) 2011 Citrix Systems.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ */
+
+#include <asm/asm_defns.h>
+#include <asm/processor-ca15.h>
+
+.globl cortex_a15_init
+cortex_a15_init:
+	/* Set up the SMP bit in ACTLR */
+	mrc   CP32(r0, ACTLR)
+	orr   r0, r0, #(ACTLR_CA15_SMP) /* enable SMP bit*/
+	mcr   CP32(r0, ACTLR)
+	mov   pc, lr
diff --git a/xen/include/asm-arm/cpregs.h b/xen/include/asm-arm/cpregs.h
index 34a9e93..3b51845 100644
--- a/xen/include/asm-arm/cpregs.h
+++ b/xen/include/asm-arm/cpregs.h
@@ -104,6 +104,7 @@
 /* Coprocessor 15 */
 
 /* CP15 CR0: CPUID and Cache Type Registers */
+#define MIDR            p15,0,c0,c0,0   /* Main ID Register */
 #define MPIDR           p15,0,c0,c0,5   /* Multiprocessor Affinity Register */
 #define ID_PFR0         p15,0,c0,c1,0   /* Processor Feature Register 0 */
 #define ID_PFR1         p15,0,c0,c1,1   /* Processor Feature Register 1 */
diff --git a/xen/include/asm-arm/processor-ca15.h b/xen/include/asm-arm/processor-ca15.h
new file mode 100644
index 0000000..86231b3
--- /dev/null
+++ b/xen/include/asm-arm/processor-ca15.h
@@ -0,0 +1,45 @@
+#ifndef __ASM_ARM_PROCESSOR_CA15_H
+#define __ASM_ARM_PROCESSOR_CA15_H
+
+
+#define CORTEX_A15_ID     (0x410FC0F0)
+
+/* ACTLR Auxiliary Control Register, Cortex A15 */
+#define ACTLR_CA15_SNOOP_DELAYED      (1<<31)
+#define ACTLR_CA15_MAIN_CLOCK         (1<<30)
+#define ACTLR_CA15_NEON_CLOCK         (1<<29)
+#define ACTLR_CA15_NONCACHE           (1<<24)
+#define ACTLR_CA15_INORDER_REQ        (1<<23)
+#define ACTLR_CA15_INORDER_LOAD       (1<<22)
+#define ACTLR_CA15_L2_TLB_PREFETCH    (1<<21)
+#define ACTLR_CA15_L2_IPA_PA_CACHE    (1<<20)
+#define ACTLR_CA15_L2_CACHE           (1<<19)
+#define ACTLR_CA15_L2_PA_CACHE        (1<<18)
+#define ACTLR_CA15_TLB                (1<<17)
+#define ACTLR_CA15_STRONGY_ORDERED    (1<<16)
+#define ACTLR_CA15_INORDER            (1<<15)
+#define ACTLR_CA15_FORCE_LIM          (1<<14)
+#define ACTLR_CA15_CP_FLUSH           (1<<13)
+#define ACTLR_CA15_CP_PUSH            (1<<12)
+#define ACTLR_CA15_LIM                (1<<11)
+#define ACTLR_CA15_SER                (1<<10)
+#define ACTLR_CA15_OPT                (1<<9)
+#define ACTLR_CA15_WFI                (1<<8)
+#define ACTLR_CA15_WFE                (1<<7)
+#define ACTLR_CA15_SMP                (1<<6)
+#define ACTLR_CA15_PLD                (1<<5)
+#define ACTLR_CA15_IP                 (1<<4)
+#define ACTLR_CA15_MICRO_BTB          (1<<3)
+#define ACTLR_CA15_LOOP_ONE           (1<<2)
+#define ACTLR_CA15_LOOP_DISABLE       (1<<1)
+#define ACTLR_CA15_BTB                (1<<0)
+
+#endif /* __ASM_ARM_PROCESSOR_CA15_H */
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index 3849b23..e0c0beb 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -3,6 +3,9 @@
 
 #include <asm/cpregs.h>
 
+/* MIDR Main ID Register */
+#define MIDR_MASK    0xff0ffff0
+
 /* TTBCR Translation Table Base Control Register */
 #define TTBCR_EAE    0x80000000
 #define TTBCR_N_MASK 0x07
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:43:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:43:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIdk-0008WL-EV; Tue, 13 Nov 2012 15:43:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TYIdi-0008Ub-2K
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 15:43:02 +0000
Received: from [85.158.139.83:13728] by server-5.bemta-5.messagelabs.com id
	4B/BB-11353-38A62A05; Tue, 13 Nov 2012 15:42:59 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352821376!29383434!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27045 invoked from network); 13 Nov 2012 15:42:58 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:42:58 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208,223";a="44429018"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 15:42:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 10:42:56 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TYIdW-0008Hy-D2;
	Tue, 13 Nov 2012 15:42:50 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <xen-devel@lists.xensource.com>
Date: Tue, 13 Nov 2012 15:42:13 +0000
Message-ID: <1352821336-25837-4-git-send-email-stefano.stabellini@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
MIME-Version: 1.0
Cc: tim@xen.org, Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH 4/7] xen/arm: set the SMP bit in the ACTLR
	register
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>From the Cortex A15 manual:

"Enables the processor to receive instruction cache, BTB, and TLB maintenance
operations from other processors"

...

"You must set this bit before enabling the caches and MMU, or
performing any cache and TLB maintenance operations. The only time
you must clear this bit is during a processor power-down sequence"


Changes in v2:
- detect the processor ID and call a processor specific initialization
function;
- move the ACTLR initialization to the CortexA15 initialization
function;
- move the ACTLR_* defines to processor-ca15.h.


Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/arm/Makefile                |    1 +
 xen/arch/arm/head.S                  |   10 +++++++
 xen/arch/arm/proc-ca15.S             |   28 +++++++++++++++++++++
 xen/include/asm-arm/cpregs.h         |    1 +
 xen/include/asm-arm/processor-ca15.h |   45 ++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/processor.h      |    3 ++
 6 files changed, 88 insertions(+), 0 deletions(-)
 create mode 100644 xen/arch/arm/proc-ca15.S
 create mode 100644 xen/include/asm-arm/processor-ca15.h

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 634b620..d3e34bc 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -13,6 +13,7 @@ obj-y += irq.o
 obj-y += kernel.o
 obj-y += mm.o
 obj-y += mode_switch.o
+obj-y += proc-ca15.o
 obj-y += p2m.o
 obj-y += percpu.o
 obj-y += guestcopy.o
diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 4506244..25993d6 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -19,6 +19,7 @@
 
 #include <asm/config.h>
 #include <asm/page.h>
+#include <asm/processor-ca15.h>
 #include <asm/asm_defns.h>
 
 #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
@@ -148,6 +149,15 @@ skip_bss:
 
 	PRINT("- Setting up control registers -\r\n")
 	
+	/* Read CPU ID */
+	mrc   CP32(r0, MIDR)
+	ldr   r1, =(MIDR_MASK)
+	and   r0, r0, r1
+	/* Is this a Cortex A15? */
+	ldr   r1, =(CORTEX_A15_ID)
+	teq   r0, r1
+	bleq  cortex_a15_init
+
 	/* Set up memory attribute type tables */
 	ldr   r0, =MAIR0VAL
 	ldr   r1, =MAIR1VAL
diff --git a/xen/arch/arm/proc-ca15.S b/xen/arch/arm/proc-ca15.S
new file mode 100644
index 0000000..5a5bf64
--- /dev/null
+++ b/xen/arch/arm/proc-ca15.S
@@ -0,0 +1,28 @@
+/*
+ * xen/arch/arm/proc-ca15.S
+ *
+ * Cortex A15 specific initializations
+ *
+ * Copyright (c) 2011 Citrix Systems.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ */
+
+#include <asm/asm_defns.h>
+#include <asm/processor-ca15.h>
+
+.globl cortex_a15_init
+cortex_a15_init:
+	/* Set up the SMP bit in ACTLR */
+	mrc   CP32(r0, ACTLR)
+	orr   r0, r0, #(ACTLR_CA15_SMP) /* enable SMP bit*/
+	mcr   CP32(r0, ACTLR)
+	mov   pc, lr
diff --git a/xen/include/asm-arm/cpregs.h b/xen/include/asm-arm/cpregs.h
index 34a9e93..3b51845 100644
--- a/xen/include/asm-arm/cpregs.h
+++ b/xen/include/asm-arm/cpregs.h
@@ -104,6 +104,7 @@
 /* Coprocessor 15 */
 
 /* CP15 CR0: CPUID and Cache Type Registers */
+#define MIDR            p15,0,c0,c0,0   /* Main ID Register */
 #define MPIDR           p15,0,c0,c0,5   /* Multiprocessor Affinity Register */
 #define ID_PFR0         p15,0,c0,c1,0   /* Processor Feature Register 0 */
 #define ID_PFR1         p15,0,c0,c1,1   /* Processor Feature Register 1 */
diff --git a/xen/include/asm-arm/processor-ca15.h b/xen/include/asm-arm/processor-ca15.h
new file mode 100644
index 0000000..86231b3
--- /dev/null
+++ b/xen/include/asm-arm/processor-ca15.h
@@ -0,0 +1,45 @@
+#ifndef __ASM_ARM_PROCESSOR_CA15_H
+#define __ASM_ARM_PROCESSOR_CA15_H
+
+
+#define CORTEX_A15_ID     (0x410FC0F0)
+
+/* ACTLR Auxiliary Control Register, Cortex A15 */
+#define ACTLR_CA15_SNOOP_DELAYED      (1<<31)
+#define ACTLR_CA15_MAIN_CLOCK         (1<<30)
+#define ACTLR_CA15_NEON_CLOCK         (1<<29)
+#define ACTLR_CA15_NONCACHE           (1<<24)
+#define ACTLR_CA15_INORDER_REQ        (1<<23)
+#define ACTLR_CA15_INORDER_LOAD       (1<<22)
+#define ACTLR_CA15_L2_TLB_PREFETCH    (1<<21)
+#define ACTLR_CA15_L2_IPA_PA_CACHE    (1<<20)
+#define ACTLR_CA15_L2_CACHE           (1<<19)
+#define ACTLR_CA15_L2_PA_CACHE        (1<<18)
+#define ACTLR_CA15_TLB                (1<<17)
+#define ACTLR_CA15_STRONGY_ORDERED    (1<<16)
+#define ACTLR_CA15_INORDER            (1<<15)
+#define ACTLR_CA15_FORCE_LIM          (1<<14)
+#define ACTLR_CA15_CP_FLUSH           (1<<13)
+#define ACTLR_CA15_CP_PUSH            (1<<12)
+#define ACTLR_CA15_LIM                (1<<11)
+#define ACTLR_CA15_SER                (1<<10)
+#define ACTLR_CA15_OPT                (1<<9)
+#define ACTLR_CA15_WFI                (1<<8)
+#define ACTLR_CA15_WFE                (1<<7)
+#define ACTLR_CA15_SMP                (1<<6)
+#define ACTLR_CA15_PLD                (1<<5)
+#define ACTLR_CA15_IP                 (1<<4)
+#define ACTLR_CA15_MICRO_BTB          (1<<3)
+#define ACTLR_CA15_LOOP_ONE           (1<<2)
+#define ACTLR_CA15_LOOP_DISABLE       (1<<1)
+#define ACTLR_CA15_BTB                (1<<0)
+
+#endif /* __ASM_ARM_PROCESSOR_CA15_H */
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index 3849b23..e0c0beb 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -3,6 +3,9 @@
 
 #include <asm/cpregs.h>
 
+/* MIDR Main ID Register */
+#define MIDR_MASK    0xff0ffff0
+
 /* TTBCR Translation Table Base Control Register */
 #define TTBCR_EAE    0x80000000
 #define TTBCR_N_MASK 0x07
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 15:46:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:46:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIh8-00016u-8f; Tue, 13 Nov 2012 15:46:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <zhigang.x.wang@oracle.com>) id 1TYIh6-00016R-LE
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 15:46:33 +0000
Received: from [85.158.139.83:41918] by server-1.bemta-5.messagelabs.com id
	6E/87-05877-75B62A05; Tue, 13 Nov 2012 15:46:31 +0000
X-Env-Sender: zhigang.x.wang@oracle.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1352821589!30091028!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1OTk2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17500 invoked from network); 13 Nov 2012 15:46:30 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-3.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 15:46:30 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADFkQwY003516
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 15:46:27 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADFkPBK010812
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 15:46:26 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADFkPhT005587; Tue, 13 Nov 2012 09:46:25 -0600
Received: from zhigang.us.oracle.com (/10.149.236.110)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 07:46:25 -0800
Message-ID: <50A26B50.5090109@oracle.com>
Date: Tue, 13 Nov 2012 10:46:24 -0500
From: Zhigang Wang <zhigang.x.wang@oracle.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120827 Thunderbird/15.0
MIME-Version: 1.0
To: Keir Fraser <keir.xen@gmail.com>
References: <CCC6EFAD.44728%keir.xen@gmail.com>
In-Reply-To: <CCC6EFAD.44728%keir.xen@gmail.com>
Content-Type: multipart/mixed; boundary="------------040402080502050701090706"
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>, Jan Beulich <jbeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] VM memory allocation speed with cs 26056
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.
--------------040402080502050701090706
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On 11/12/2012 01:25 PM, Keir Fraser wrote:
> On 12/11/2012 15:01, "Zhigang Wang" <zhigang.x.wang@oracle.com> wrote:
>
>> Hi Keir/Jan,
>>
>> Recently I got a chance to access a big machine (2T mem/160 cpus) and I tested
>> your patch: http://xenbits.xen.org/hg/xen-unstable.hg/rev/177fdda0be56
>>
>> Attached is the result.
> The PVM result is weird, there is a small-ish slowdown for small domains,
> becoming a very large %age slowdown as domain memory increases, and then
> turning into a *speedup* as the memory size gets very large indeed.
>
> What are the error bars like on these measurements I wonder? One thing we
> could do to allow PV guests doing 4k-at-a-time allocations through
> alloc_heap_pages() to benefit from the TLB-flush improvements, is pull the
> filtering-and-flush out into populate_physmap() and increase_reservation().
> This is listed as a todo in the original patch (26056).
>
> To be honest I don't know why the original patch would make PV domain
> creation slower, and certainly not by a varying %age depending on domain
> memory size!
>
>  -- Keir
I did it second time. It seems the result (attached) is promising.

I think the strange result is due to the order of testing:
start_physical_machine -> test_hvm -> test_pvm.

This time, I did: start_physical_machine -> test_pvm -> test_hvm.

You can see the pvm memory allocation speed is not affected by your patch this time.

So I believe this patch is excellent now.

Thanks,

Zhigang


--------------040402080502050701090706
Content-Type: application/pdf;
 name="result.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="result.pdf"

JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0ZpbHRlci9GbGF0
ZURlY29kZT4+CnN0cmVhbQp4nLWaSavcOBDH7/0pfB54PdptQ2NwLz7MLdAwh0dus8AcAskl
X38klWSpu6tKykbArzHWX7X8VCrZEUc5fD18HoT/56QaxlkNX/4+/Pnb8OnwYfg8WHd0w6ic
f8zM09EOs/+VH4BhYvjy7+F8P9zuhw9Pt9Rs4/DpaIb7X8Pvmxyc17j/834ScjEnoRZ1Enq/
GGGXj/c/MKl4a7fIX8bvN8iGMc/2uOVNipMYgx3TbtFM2aOl8ia8Kp28C/f/WA/qm1JMRz2M
YgyD+3SkGY8KG+KdWIPNZ3EJf2y4XCn7lZDHiVCxoHILf+JlJVWsxs33KltUkaJti/bjKVuS
R0FAynBRpIpTx5n3aM220CpGSZ/SZlzArY1UGV23itSUitWGjO6zRz7nhAog5ubZU/OE2Eoh
ZoVPCDLkPUQuTryB+SxdqAAQdfY05IzSKpEuXCXRpQAszn+gi1OBXGg2F0AXrmKrVXdhVYAu
VuW6e0SuF6CrzxZaBejqs4XOUaZL+Og80uVzwxUwZMg7AOHTqmGNcmnNiCEqrwWMLoMJMUyl
LmB8QrSUfofjVPJCbdCFCaxVLm4dtavpTL406KJtiekBLkhbMl09Ks3aNSm/az/RpUm6tH8Y
GfK+l/44u2z7oIQNaSWl0r7EMAp0oQLbc1plo4AxKuDTxp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E1MDU5CiUlRU9GCg==
--------------040402080502050701090706
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.xen.org
http://lists.xen.org/xen-devel

--------------040402080502050701090706--


From xen-devel-bounces@lists.xen.org Tue Nov 13 15:46:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:46:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIh8-00016u-8f; Tue, 13 Nov 2012 15:46:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <zhigang.x.wang@oracle.com>) id 1TYIh6-00016R-LE
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 15:46:33 +0000
Received: from [85.158.139.83:41918] by server-1.bemta-5.messagelabs.com id
	6E/87-05877-75B62A05; Tue, 13 Nov 2012 15:46:31 +0000
X-Env-Sender: zhigang.x.wang@oracle.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1352821589!30091028!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1OTk2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17500 invoked from network); 13 Nov 2012 15:46:30 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-3.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 15:46:30 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADFkQwY003516
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 15:46:27 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADFkPBK010812
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 15:46:26 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADFkPhT005587; Tue, 13 Nov 2012 09:46:25 -0600
Received: from zhigang.us.oracle.com (/10.149.236.110)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 07:46:25 -0800
Message-ID: <50A26B50.5090109@oracle.com>
Date: Tue, 13 Nov 2012 10:46:24 -0500
From: Zhigang Wang <zhigang.x.wang@oracle.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120827 Thunderbird/15.0
MIME-Version: 1.0
To: Keir Fraser <keir.xen@gmail.com>
References: <CCC6EFAD.44728%keir.xen@gmail.com>
In-Reply-To: <CCC6EFAD.44728%keir.xen@gmail.com>
Content-Type: multipart/mixed; boundary="------------040402080502050701090706"
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>, Jan Beulich <jbeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] VM memory allocation speed with cs 26056
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.
--------------040402080502050701090706
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On 11/12/2012 01:25 PM, Keir Fraser wrote:
> On 12/11/2012 15:01, "Zhigang Wang" <zhigang.x.wang@oracle.com> wrote:
>
>> Hi Keir/Jan,
>>
>> Recently I got a chance to access a big machine (2T mem/160 cpus) and I tested
>> your patch: http://xenbits.xen.org/hg/xen-unstable.hg/rev/177fdda0be56
>>
>> Attached is the result.
> The PVM result is weird, there is a small-ish slowdown for small domains,
> becoming a very large %age slowdown as domain memory increases, and then
> turning into a *speedup* as the memory size gets very large indeed.
>
> What are the error bars like on these measurements I wonder? One thing we
> could do to allow PV guests doing 4k-at-a-time allocations through
> alloc_heap_pages() to benefit from the TLB-flush improvements, is pull the
> filtering-and-flush out into populate_physmap() and increase_reservation().
> This is listed as a todo in the original patch (26056).
>
> To be honest I don't know why the original patch would make PV domain
> creation slower, and certainly not by a varying %age depending on domain
> memory size!
>
>  -- Keir
I did it second time. It seems the result (attached) is promising.

I think the strange result is due to the order of testing:
start_physical_machine -> test_hvm -> test_pvm.

This time, I did: start_physical_machine -> test_pvm -> test_hvm.

You can see the pvm memory allocation speed is not affected by your patch this time.

So I believe this patch is excellent now.

Thanks,

Zhigang


--------------040402080502050701090706
Content-Type: application/pdf;
 name="result.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="result.pdf"

JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0ZpbHRlci9GbGF0
ZURlY29kZT4+CnN0cmVhbQp4n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uIAowMDAwMDE0MzgyIDAwMDAwIG4gCjAwMDAw
MDE1NjAgMDAwMDAgbiAKMDAwMDAwMTY0NSAwMDAwMCBuIAowMDAwMDE0Njg2IDAwMDAwIG4g
CjAwMDAwMDE2NjQgMDAwMDAgbiAKMDAwMDAxMzE4MSAwMDAwMCBuIAowMDAwMDEzMjAzIDAw
MDAwIG4gCjAwMDAwMTMzOTggMDAwMDAgbiAKMDAwMDAxMzg0OSAwMDAwMCBuIAowMDAwMDE0
MTUxIDAwMDAwIG4gCjAwMDAwMTQxODQgMDAwMDAgbiAKMDAwMDAxNDUyNSAwMDAwMCBuIAow
MDAwMDE0NTgxIDAwMDAwIG4gCjAwMDAwMTQ3OTEgMDAwMDAgbiAKMDAwMDAxNDg5MiAwMDAw
MCBuIAp0cmFpbGVyCjw8L1NpemUgMTkvUm9vdCAxNyAwIFIKL0luZm8gMTggMCBSCi9JRCBb
IDxGRDM1RDM2NkFDNTkzM0Q5NzE1QzY5ODBDQjhGMTdDRD4KPEZEMzVEMzY2QUM1OTMzRDk3
MTVDNjk4MENCOEYxN0NEPiBdCi9Eb2NDaGVja3N1bSAvNkY5NTNCNkQxMkREMzE1NUY5MUZE
NkY5RDY2RDQ0N0IKPj4Kc3RhcnR4cmVmCjE1MDU5CiUlRU9GCg==
--------------040402080502050701090706
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.xen.org
http://lists.xen.org/xen-devel

--------------040402080502050701090706--


From xen-devel-bounces@lists.xen.org Tue Nov 13 15:56:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:56:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIqN-0001Up-Gt; Tue, 13 Nov 2012 15:56:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <cutter409@gmail.com>) id 1TYIqM-0001Uk-IR
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 15:56:06 +0000
Received: from [85.158.139.211:49330] by server-8.bemta-5.messagelabs.com id
	F7/73-06050-39D62A05; Tue, 13 Nov 2012 15:56:03 +0000
X-Env-Sender: cutter409@gmail.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1352822161!20036383!1
X-Originating-IP: [209.85.213.171]
X-SpamReason: No, hits=1.5 required=7.0 tests=HTML_00_10,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20631 invoked from network); 13 Nov 2012 15:56:03 -0000
Received: from mail-ye0-f171.google.com (HELO mail-ye0-f171.google.com)
	(209.85.213.171)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:56:03 -0000
Received: by mail-ye0-f171.google.com with SMTP id m11so1518329yen.30
	for <xen-devel@lists.xensource.com>;
	Tue, 13 Nov 2012 07:56:01 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=UJVA0nzhRohYvHuF8X1VXABR5eEHvqZmEJi+yXBE07U=;
	b=fLriSQdc4E2a/186ihW0mJUSMnK527kRXUE7Bo+a65q4RyoQLf6ndpGiBFC3XETfb7
	LcRbHAdaUkB6TJ7+WA8EnDHyacifOf01A+9U/qinvoOFiBBf5QQl69Dpf25MsWpO0BRK
	WlRYqRgqE19tbI/MIHHZJwRWH5XszTAgJAIezVME3BTH+A8VsDmemR9hKRUDkR6xbCQh
	Rzj4k88RkUMOOoMrG0Efa1p+MfrD3oT+/SAKTtF3Q2ylsoUgMYVbrVFRoshXBzKyINMX
	T2jPy4yFRxYdMOP4eXOyxR1eoGN8zbT7+SQzgDnKAGKz1GalHHExMb05otUSuisjyAXI
	56Jg==
MIME-Version: 1.0
Received: by 10.58.221.130 with SMTP id qe2mr27618763vec.14.1352822161381;
	Tue, 13 Nov 2012 07:56:01 -0800 (PST)
Received: by 10.220.162.144 with HTTP; Tue, 13 Nov 2012 07:56:01 -0800 (PST)
Date: Tue, 13 Nov 2012 10:56:01 -0500
Message-ID: <CAG4Ohu_p-vVF9ZS01PeMqHvscCrrO+UDawK-noaaP8k+MuqHrQ@mail.gmail.com>
From: Cutter 409 <cutter409@gmail.com>
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] Guest memory access hooking
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3961150325815961932=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============3961150325815961932==
Content-Type: multipart/alternative; boundary=047d7bf0cabe5f9ad904ce62746b

--047d7bf0cabe5f9ad904ce62746b
Content-Type: text/plain; charset=ISO-8859-1

Hello all,

I'm trying to do some research with malware, and I'm trying to get
notifications on arbitrary guest page accesses (similar to what Ether
does.) I've noticed the mem-event API and it seems like it might be close
to what I need, but I can't find much documentation about how it works or
how to use it.

I know that that mem-event API works only with EPT, but is the code to
change permissions modifying the guest page tables, or does it work via
EPT? (Can the guest detect it?) Is there any documentation about usage,
besides the xen-access.c test ?

I'm also interested monitoring arbitrary page access via the shadow page
tables. I've been reading through the code, but if anyone has any insight
or some kind of push in the right direction, I'd really appreciate it.

Thank you!

--047d7bf0cabe5f9ad904ce62746b
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello all,<br><br>I&#39;m trying to do some research with malware, and I&#3=
9;m trying to get notifications on arbitrary guest page accesses (similar t=
o what Ether does.) I&#39;ve noticed the mem-event API and it seems like it=
 might be close to what I need, but I can&#39;t find much documentation abo=
ut how it works or how to use it.<br>
<br>I know that that mem-event API works only with EPT, but is the code to =
change permissions modifying the guest page tables, or does it work via EPT=
? (Can the guest detect it?) Is there any documentation about usage, beside=
s the xen-access.c test ?<br>
<br>I&#39;m also interested monitoring arbitrary page access via the shadow=
 page tables. I&#39;ve been reading through the code, but if anyone has any=
 insight or some kind of push in the right direction, I&#39;d really apprec=
iate it. <br>
<br>Thank you!<br>

--047d7bf0cabe5f9ad904ce62746b--


--===============3961150325815961932==
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.xen.org
http://lists.xen.org/xen-devel

--===============3961150325815961932==--


From xen-devel-bounces@lists.xen.org Tue Nov 13 15:56:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 15:56:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIqN-0001Up-Gt; Tue, 13 Nov 2012 15:56:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <cutter409@gmail.com>) id 1TYIqM-0001Uk-IR
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 15:56:06 +0000
Received: from [85.158.139.211:49330] by server-8.bemta-5.messagelabs.com id
	F7/73-06050-39D62A05; Tue, 13 Nov 2012 15:56:03 +0000
X-Env-Sender: cutter409@gmail.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1352822161!20036383!1
X-Originating-IP: [209.85.213.171]
X-SpamReason: No, hits=1.5 required=7.0 tests=HTML_00_10,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20631 invoked from network); 13 Nov 2012 15:56:03 -0000
Received: from mail-ye0-f171.google.com (HELO mail-ye0-f171.google.com)
	(209.85.213.171)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 15:56:03 -0000
Received: by mail-ye0-f171.google.com with SMTP id m11so1518329yen.30
	for <xen-devel@lists.xensource.com>;
	Tue, 13 Nov 2012 07:56:01 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=UJVA0nzhRohYvHuF8X1VXABR5eEHvqZmEJi+yXBE07U=;
	b=fLriSQdc4E2a/186ihW0mJUSMnK527kRXUE7Bo+a65q4RyoQLf6ndpGiBFC3XETfb7
	LcRbHAdaUkB6TJ7+WA8EnDHyacifOf01A+9U/qinvoOFiBBf5QQl69Dpf25MsWpO0BRK
	WlRYqRgqE19tbI/MIHHZJwRWH5XszTAgJAIezVME3BTH+A8VsDmemR9hKRUDkR6xbCQh
	Rzj4k88RkUMOOoMrG0Efa1p+MfrD3oT+/SAKTtF3Q2ylsoUgMYVbrVFRoshXBzKyINMX
	T2jPy4yFRxYdMOP4eXOyxR1eoGN8zbT7+SQzgDnKAGKz1GalHHExMb05otUSuisjyAXI
	56Jg==
MIME-Version: 1.0
Received: by 10.58.221.130 with SMTP id qe2mr27618763vec.14.1352822161381;
	Tue, 13 Nov 2012 07:56:01 -0800 (PST)
Received: by 10.220.162.144 with HTTP; Tue, 13 Nov 2012 07:56:01 -0800 (PST)
Date: Tue, 13 Nov 2012 10:56:01 -0500
Message-ID: <CAG4Ohu_p-vVF9ZS01PeMqHvscCrrO+UDawK-noaaP8k+MuqHrQ@mail.gmail.com>
From: Cutter 409 <cutter409@gmail.com>
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] Guest memory access hooking
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3961150325815961932=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============3961150325815961932==
Content-Type: multipart/alternative; boundary=047d7bf0cabe5f9ad904ce62746b

--047d7bf0cabe5f9ad904ce62746b
Content-Type: text/plain; charset=ISO-8859-1

Hello all,

I'm trying to do some research with malware, and I'm trying to get
notifications on arbitrary guest page accesses (similar to what Ether
does.) I've noticed the mem-event API and it seems like it might be close
to what I need, but I can't find much documentation about how it works or
how to use it.

I know that that mem-event API works only with EPT, but is the code to
change permissions modifying the guest page tables, or does it work via
EPT? (Can the guest detect it?) Is there any documentation about usage,
besides the xen-access.c test ?

I'm also interested monitoring arbitrary page access via the shadow page
tables. I've been reading through the code, but if anyone has any insight
or some kind of push in the right direction, I'd really appreciate it.

Thank you!

--047d7bf0cabe5f9ad904ce62746b
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello all,<br><br>I&#39;m trying to do some research with malware, and I&#3=
9;m trying to get notifications on arbitrary guest page accesses (similar t=
o what Ether does.) I&#39;ve noticed the mem-event API and it seems like it=
 might be close to what I need, but I can&#39;t find much documentation abo=
ut how it works or how to use it.<br>
<br>I know that that mem-event API works only with EPT, but is the code to =
change permissions modifying the guest page tables, or does it work via EPT=
? (Can the guest detect it?) Is there any documentation about usage, beside=
s the xen-access.c test ?<br>
<br>I&#39;m also interested monitoring arbitrary page access via the shadow=
 page tables. I&#39;ve been reading through the code, but if anyone has any=
 insight or some kind of push in the right direction, I&#39;d really apprec=
iate it. <br>
<br>Thank you!<br>

--047d7bf0cabe5f9ad904ce62746b--


--===============3961150325815961932==
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.xen.org
http://lists.xen.org/xen-devel

--===============3961150325815961932==--


From xen-devel-bounces@lists.xen.org Tue Nov 13 16:03:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:03:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIwv-0002Jr-CA; Tue, 13 Nov 2012 16:02:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TYIwu-0002Jm-8y
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:02:52 +0000
Received: from [85.158.138.51:55591] by server-13.bemta-3.messagelabs.com id
	F4/B3-24887-B2F62A05; Tue, 13 Nov 2012 16:02:51 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1352822570!29817826!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5707 invoked from network); 13 Nov 2012 16:02:50 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:02:50 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15783448"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:02:46 +0000
Received: from Roger-2.local.net (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 16:02:45 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>
Date: Tue, 13 Nov 2012 17:02:19 +0100
Message-ID: <1352822539-56930-1-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH] qemu-stubdom: prevent useless medium change
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel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U7CisgICAgICAgIGZyZWUocGFyYW1zKTsKKyAgICAgICAgcGFyYW1zID0geHNfcmVhZCh4c2gs
IFhCVF9OVUxMLCBidWYsICZsZW4pOworICAgICAgICBpZiAocGFyYW1zID09IE5VTEwpCisgICAg
ICAgICAgICBjb250aW51ZTsKIAkgICAgcHN0cmNweShicy0+ZmlsZW5hbWUsIHNpemVvZihicy0+
ZmlsZW5hbWUpLCBwYXJhbXMpOwogCX0KICNlbHNlCkBAIC02NjcsMTEgKzY3Myw3IEBAIHZvaWQg
eGVuc3RvcmVfcGFyc2VfZG9tYWluX2NvbmZpZyhpbnQgaHZtX2RvbWlkKQogCiAJZHJpdmVzX3Rh
YmxlW25iX2RyaXZlc10uYmRydiA9IGJzOwogCWRyaXZlc190YWJsZVtuYl9kcml2ZXNdLnVzZWQg
PSAxOwotI2lmZGVmIENPTkZJR19TVFVCRE9NCi0gICAgbWVkaWFfZmlsZW5hbWVbbmJfZHJpdmVz
XSA9IHN0cmR1cChkYW5nZXJfYnVmKTsKLSNlbHNlCiAgICAgbWVkaWFfZmlsZW5hbWVbbmJfZHJp
dmVzXSA9IHN0cmR1cChicy0+ZmlsZW5hbWUpOwotI2VuZGlmCiAJbmJfZHJpdmVzKys7CiAKICAg
ICB9Ci0tIAoxLjcuNy41IChBcHBsZSBHaXQtMjYpCgoKX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxA
bGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:03:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:03:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYIwv-0002Jr-CA; Tue, 13 Nov 2012 16:02:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TYIwu-0002Jm-8y
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:02:52 +0000
Received: from [85.158.138.51:55591] by server-13.bemta-3.messagelabs.com id
	F4/B3-24887-B2F62A05; Tue, 13 Nov 2012 16:02:51 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1352822570!29817826!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5707 invoked from network); 13 Nov 2012 16:02:50 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:02:50 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15783448"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:02:46 +0000
Received: from Roger-2.local.net (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 16:02:45 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>
Date: Tue, 13 Nov 2012 17:02:19 +0100
Message-ID: <1352822539-56930-1-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH] qemu-stubdom: prevent useless medium change
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

cWVtdS1zdHViZG9tIHdhcyBzdHJpcHBpbmcgdGhlIHByZWZpeCBmcm9tIHRoZSAicGFyYW1zIiB4
ZW5zdG9yZQprZXkgaW4geGVuc3RvcmVfcGFyc2VfZG9tYWluX2NvbmZpZywgd2hpY2ggd2FzIHRo
ZW4gc2F2ZWQgc3RyaXBwZWQgaW4KYSB2YXJpYWJsZS4gSW4geGVuc3RvcmVfcHJvY2Vzc19ldmVu
dCB3ZSBjb21wYXJlIHRoZSAicGFyYW0iIGZyb20KeGVuc3RvcmUgKG5vdCBzdHJpcHBlZCkgd2l0
aCB0aGUgc3RyaXBwZWQgInBhcmFtIiBzYXZlZCBpbiB0aGUKdmFyaWFibGUsIHdoaWNoIGxlYWRz
IHRvIGEgbWVkaXVtIGNoYW5nZSAoZXZlbiBpZiB0aGVyZSBpc24ndCBhbnkpLApzaW5jZSB3ZSBh
cmUgY29tcGFyaW5nIHNvbWV0aGluZyBsaWtlIGFpbzovcGF0aC90by9maWxlIHdpdGgKL3BhdGgv
dG8vZmlsZS4gVGhpcyBvbmx5IGhhcHBlbnMgb25lIHRpbWUsIHNpbmNlCnhlbnN0b3JlX3BhcnNl
X2RvbWFpbl9jb25maWcgaXMgd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iAKICAg
ICB9Ci0tIAoxLjcuNy41IChBcHBsZSBHaXQtMjYpCgoKX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxA
bGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:11:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:11:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJ4Y-0002cn-Co; Tue, 13 Nov 2012 16:10:46 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1TYJ4W-0002ci-OB
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 16:10:44 +0000
Received: from [193.109.254.147:37431] by server-11.bemta-14.messagelabs.com
	id 65/37-29027-40172A05; Tue, 13 Nov 2012 16:10:44 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1352823040!3855839!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1OTk2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26956 invoked from network); 13 Nov 2012 16:10:42 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-14.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 16:10:42 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADGAQLZ032199
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 16:10:27 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADGAPSJ011745
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 16:10:25 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADGAOqV017228; Tue, 13 Nov 2012 10:10:24 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 08:10:24 -0800
Date: Tue, 13 Nov 2012 17:10:00 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: anderson@redhat.com, konrad.wilk@oracle.com, andrew.cooper3@citrix.com,
	olaf@aepfle.de, jbeulich@suse.com, ptesarik@suse.cz,
	crash-utility@redhat.com, kexec@lists.infradead.org,
	xen-devel@lists.xensource.com
Message-ID: <20121113161000.GA2942@host-192-168-1-59.local.net-space.pl>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Subject: [Xen-devel] [PATCH 0/5] crash: Bundle of fixes for Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

Here is next bundle of fixes for crash Xen support:
  - xen: Fix page tables caching issues,
  - xen: Use init_tss array or per_cpu__init_tss,
  - xen: Use per_cpu__crash_notes or crash_notes array,
  - xen: Try hard to get max_cpus value,
  - xen: Use cpu_present_map instead of cpu_online_map.

All patches were tested with Xen versions up to 4.2.

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:11:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:11:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJ4Y-0002cn-Co; Tue, 13 Nov 2012 16:10:46 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1TYJ4W-0002ci-OB
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 16:10:44 +0000
Received: from [193.109.254.147:37431] by server-11.bemta-14.messagelabs.com
	id 65/37-29027-40172A05; Tue, 13 Nov 2012 16:10:44 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1352823040!3855839!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1OTk2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26956 invoked from network); 13 Nov 2012 16:10:42 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-14.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 16:10:42 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADGAQLZ032199
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 16:10:27 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADGAPSJ011745
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 16:10:25 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADGAOqV017228; Tue, 13 Nov 2012 10:10:24 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 08:10:24 -0800
Date: Tue, 13 Nov 2012 17:10:00 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: anderson@redhat.com, konrad.wilk@oracle.com, andrew.cooper3@citrix.com,
	olaf@aepfle.de, jbeulich@suse.com, ptesarik@suse.cz,
	crash-utility@redhat.com, kexec@lists.infradead.org,
	xen-devel@lists.xensource.com
Message-ID: <20121113161000.GA2942@host-192-168-1-59.local.net-space.pl>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Subject: [Xen-devel] [PATCH 0/5] crash: Bundle of fixes for Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

Here is next bundle of fixes for crash Xen support:
  - xen: Fix page tables caching issues,
  - xen: Use init_tss array or per_cpu__init_tss,
  - xen: Use per_cpu__crash_notes or crash_notes array,
  - xen: Try hard to get max_cpus value,
  - xen: Use cpu_present_map instead of cpu_online_map.

All patches were tested with Xen versions up to 4.2.

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:12:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:12:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJ5r-0002ja-VB; Tue, 13 Nov 2012 16:12:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1TYJ5q-0002jP-16
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 16:12:06 +0000
Received: from [85.158.139.83:60439] by server-14.bemta-5.messagelabs.com id
	80/9B-21768-55172A05; Tue, 13 Nov 2012 16:12:05 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352823123!22870692!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1OTk2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10156 invoked from network); 13 Nov 2012 16:12:04 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-11.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 16:12:04 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADGBs93001400
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 16:11:55 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADGBsM0004352
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 16:11:54 GMT
Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADGBrGO018443; Tue, 13 Nov 2012 10:11:54 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 08:11:53 -0800
Date: Tue, 13 Nov 2012 17:11:40 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: anderson@redhat.com, konrad.wilk@oracle.com, andrew.cooper3@citrix.com,
	olaf@aepfle.de, jbeulich@suse.com, ptesarik@suse.cz,
	crash-utility@redhat.com, kexec@lists.infradead.org,
	xen-devel@lists.xensource.com
Message-ID: <20121113161140.GB2942@host-192-168-1-59.local.net-space.pl>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Subject: [Xen-devel] [PATCH 1/5] xen: Fix page tables caching issues
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Xen specific functions reading page tables utilize a form
of cache to speed up reading process. However, some of them
do not properly update info about cached data. In specific
cases it leads to the situation in which functions attempting
to use cached data in real read freshly loaded garbage. This
patch fixes this issue by adding relevant updates
for cached info data.

Linux Kernel commit 250a41e0ecc433cdd553a364d0fc74c766425209
(xen/p2m: Reuse existing P2M leafs if they are filled
with 1:1 PFNs or INVALID) helped to discover this issue.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>

diff -Npru crash-6.1.0.orig/x86.c crash-6.1.0/x86.c
--- crash-6.1.0.orig/x86.c	2012-09-27 21:19:15.000000000 +0200
+++ crash-6.1.0/x86.c	2012-11-12 15:29:45.000000000 +0100
@@ -4684,6 +4684,7 @@ use_cr3:
 
         machdep->last_ptbl_read = BADADDR;
         machdep->last_pmd_read = BADADDR;
+        machdep->last_pgd_read = BADADDR;
 
         for (i = 0; i < xkd->p2m_frames; i++) {
                 xkd->p2m_mfn_frame_list[i] = x86_xen_kdump_page_mfn(kvaddr);
@@ -4698,6 +4699,7 @@ use_cr3:
 
         machdep->last_ptbl_read = 0;
         machdep->last_pmd_read = 0;
+        machdep->last_pgd_read = 0;
 	pc->readmem = read_kdump;
 	if (CRASHDEBUG(1)) 
 		fprintf(fp, "readmem (restore): read_kdump()\n");
@@ -4910,6 +4912,8 @@ x86_xendump_p2m_create(struct xendump_da
 	if (!xc_core_mfn_to_page(mfn, machdep->pgd))
 		error(FATAL, "cannot read/find cr3 page\n");
 
+	machdep->last_pgd_read = mfn;
+
 	if (CRASHDEBUG(1)) {
 		fprintf(xd->ofp, "contents of page directory page:\n");	
 
@@ -5008,6 +5012,8 @@ x86_pvops_xendump_p2m_create(struct xend
 	if (!xc_core_mfn_to_page(mfn, machdep->pgd))
 		error(FATAL, "cannot read/find cr3 page\n");
 
+	machdep->last_pgd_read = mfn;
+
 	if (CRASHDEBUG(1)) {
 		fprintf(xd->ofp, "contents of page directory page:\n");	
 
diff -Npru crash-6.1.0.orig/x86_64.c crash-6.1.0/x86_64.c
--- crash-6.1.0.orig/x86_64.c	2012-09-27 21:19:15.000000000 +0200
+++ crash-6.1.0/x86_64.c	2012-11-09 14:41:29.000000000 +0100
@@ -5653,6 +5653,8 @@ x86_64_xen_kdump_load_page(ulong kvaddr,
         if (!readmem(PTOB(mfn), PHYSADDR, machdep->pgd, PAGESIZE(),
             "xen kdump pud page", RETURN_ON_ERROR))
 		error(FATAL, "cannot read/find pud page\n");
+
+	machdep->last_pgd_read = mfn;
         
         if (CRASHDEBUG(7))
 		x86_64_debug_dump_page(fp, machdep->pgd, 
@@ -5670,6 +5672,8 @@ x86_64_xen_kdump_load_page(ulong kvaddr,
             "xen kdump pmd page", RETURN_ON_ERROR))
                 error(FATAL, "cannot read/find pmd page\n");
 
+	machdep->last_pmd_read = mfn;
+
         if (CRASHDEBUG(7)) 
 		x86_64_debug_dump_page(fp, machdep->pmd, 
 			"contents of page middle directory page:");
@@ -5686,6 +5690,8 @@ x86_64_xen_kdump_load_page(ulong kvaddr,
             "xen kdump page table page", RETURN_ON_ERROR))
                 error(FATAL, "cannot read/find page table page\n");
 
+	machdep->last_ptbl_read = mfn;
+
         if (CRASHDEBUG(7)) 
 		x86_64_debug_dump_page(fp, machdep->ptbl, 
 			"contents of page table page:");
@@ -6304,6 +6310,8 @@ x86_64_xendump_load_page(ulong kvaddr, s
 	if (!xc_core_mfn_to_page(mfn, machdep->pgd))
 		error(FATAL, "cannot read/find pud page\n");
 
+	machdep->last_pgd_read = mfn;
+
         if (CRASHDEBUG(7))
 		x86_64_debug_dump_page(xd->ofp, machdep->pgd, 
                 	"contents of page upper directory page:");
@@ -6319,6 +6327,8 @@ x86_64_xendump_load_page(ulong kvaddr, s
         if (!xc_core_mfn_to_page(mfn, machdep->pmd))
                 error(FATAL, "cannot read/find pmd page\n");
 
+	machdep->last_pmd_read = mfn;
+
         if (CRASHDEBUG(7)) 
 		x86_64_debug_dump_page(xd->ofp, machdep->pmd, 
 			"contents of page middle directory page:");
@@ -6334,6 +6344,8 @@ x86_64_xendump_load_page(ulong kvaddr, s
         if (!xc_core_mfn_to_page(mfn, machdep->ptbl))
                 error(FATAL, "cannot read/find page table page\n");
 
+	machdep->last_ptbl_read = mfn;
+
         if (CRASHDEBUG(7)) 
 		x86_64_debug_dump_page(xd->ofp, machdep->ptbl, 
 			"contents of page table page:");

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:12:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:12:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJ5r-0002ja-VB; Tue, 13 Nov 2012 16:12:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1TYJ5q-0002jP-16
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 16:12:06 +0000
Received: from [85.158.139.83:60439] by server-14.bemta-5.messagelabs.com id
	80/9B-21768-55172A05; Tue, 13 Nov 2012 16:12:05 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352823123!22870692!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1OTk2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10156 invoked from network); 13 Nov 2012 16:12:04 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-11.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 16:12:04 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADGBs93001400
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 16:11:55 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADGBsM0004352
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 16:11:54 GMT
Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADGBrGO018443; Tue, 13 Nov 2012 10:11:54 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 08:11:53 -0800
Date: Tue, 13 Nov 2012 17:11:40 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: anderson@redhat.com, konrad.wilk@oracle.com, andrew.cooper3@citrix.com,
	olaf@aepfle.de, jbeulich@suse.com, ptesarik@suse.cz,
	crash-utility@redhat.com, kexec@lists.infradead.org,
	xen-devel@lists.xensource.com
Message-ID: <20121113161140.GB2942@host-192-168-1-59.local.net-space.pl>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Subject: [Xen-devel] [PATCH 1/5] xen: Fix page tables caching issues
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Xen specific functions reading page tables utilize a form
of cache to speed up reading process. However, some of them
do not properly update info about cached data. In specific
cases it leads to the situation in which functions attempting
to use cached data in real read freshly loaded garbage. This
patch fixes this issue by adding relevant updates
for cached info data.

Linux Kernel commit 250a41e0ecc433cdd553a364d0fc74c766425209
(xen/p2m: Reuse existing P2M leafs if they are filled
with 1:1 PFNs or INVALID) helped to discover this issue.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>

diff -Npru crash-6.1.0.orig/x86.c crash-6.1.0/x86.c
--- crash-6.1.0.orig/x86.c	2012-09-27 21:19:15.000000000 +0200
+++ crash-6.1.0/x86.c	2012-11-12 15:29:45.000000000 +0100
@@ -4684,6 +4684,7 @@ use_cr3:
 
         machdep->last_ptbl_read = BADADDR;
         machdep->last_pmd_read = BADADDR;
+        machdep->last_pgd_read = BADADDR;
 
         for (i = 0; i < xkd->p2m_frames; i++) {
                 xkd->p2m_mfn_frame_list[i] = x86_xen_kdump_page_mfn(kvaddr);
@@ -4698,6 +4699,7 @@ use_cr3:
 
         machdep->last_ptbl_read = 0;
         machdep->last_pmd_read = 0;
+        machdep->last_pgd_read = 0;
 	pc->readmem = read_kdump;
 	if (CRASHDEBUG(1)) 
 		fprintf(fp, "readmem (restore): read_kdump()\n");
@@ -4910,6 +4912,8 @@ x86_xendump_p2m_create(struct xendump_da
 	if (!xc_core_mfn_to_page(mfn, machdep->pgd))
 		error(FATAL, "cannot read/find cr3 page\n");
 
+	machdep->last_pgd_read = mfn;
+
 	if (CRASHDEBUG(1)) {
 		fprintf(xd->ofp, "contents of page directory page:\n");	
 
@@ -5008,6 +5012,8 @@ x86_pvops_xendump_p2m_create(struct xend
 	if (!xc_core_mfn_to_page(mfn, machdep->pgd))
 		error(FATAL, "cannot read/find cr3 page\n");
 
+	machdep->last_pgd_read = mfn;
+
 	if (CRASHDEBUG(1)) {
 		fprintf(xd->ofp, "contents of page directory page:\n");	
 
diff -Npru crash-6.1.0.orig/x86_64.c crash-6.1.0/x86_64.c
--- crash-6.1.0.orig/x86_64.c	2012-09-27 21:19:15.000000000 +0200
+++ crash-6.1.0/x86_64.c	2012-11-09 14:41:29.000000000 +0100
@@ -5653,6 +5653,8 @@ x86_64_xen_kdump_load_page(ulong kvaddr,
         if (!readmem(PTOB(mfn), PHYSADDR, machdep->pgd, PAGESIZE(),
             "xen kdump pud page", RETURN_ON_ERROR))
 		error(FATAL, "cannot read/find pud page\n");
+
+	machdep->last_pgd_read = mfn;
         
         if (CRASHDEBUG(7))
 		x86_64_debug_dump_page(fp, machdep->pgd, 
@@ -5670,6 +5672,8 @@ x86_64_xen_kdump_load_page(ulong kvaddr,
             "xen kdump pmd page", RETURN_ON_ERROR))
                 error(FATAL, "cannot read/find pmd page\n");
 
+	machdep->last_pmd_read = mfn;
+
         if (CRASHDEBUG(7)) 
 		x86_64_debug_dump_page(fp, machdep->pmd, 
 			"contents of page middle directory page:");
@@ -5686,6 +5690,8 @@ x86_64_xen_kdump_load_page(ulong kvaddr,
             "xen kdump page table page", RETURN_ON_ERROR))
                 error(FATAL, "cannot read/find page table page\n");
 
+	machdep->last_ptbl_read = mfn;
+
         if (CRASHDEBUG(7)) 
 		x86_64_debug_dump_page(fp, machdep->ptbl, 
 			"contents of page table page:");
@@ -6304,6 +6310,8 @@ x86_64_xendump_load_page(ulong kvaddr, s
 	if (!xc_core_mfn_to_page(mfn, machdep->pgd))
 		error(FATAL, "cannot read/find pud page\n");
 
+	machdep->last_pgd_read = mfn;
+
         if (CRASHDEBUG(7))
 		x86_64_debug_dump_page(xd->ofp, machdep->pgd, 
                 	"contents of page upper directory page:");
@@ -6319,6 +6327,8 @@ x86_64_xendump_load_page(ulong kvaddr, s
         if (!xc_core_mfn_to_page(mfn, machdep->pmd))
                 error(FATAL, "cannot read/find pmd page\n");
 
+	machdep->last_pmd_read = mfn;
+
         if (CRASHDEBUG(7)) 
 		x86_64_debug_dump_page(xd->ofp, machdep->pmd, 
 			"contents of page middle directory page:");
@@ -6334,6 +6344,8 @@ x86_64_xendump_load_page(ulong kvaddr, s
         if (!xc_core_mfn_to_page(mfn, machdep->ptbl))
                 error(FATAL, "cannot read/find page table page\n");
 
+	machdep->last_ptbl_read = mfn;
+
         if (CRASHDEBUG(7)) 
 		x86_64_debug_dump_page(xd->ofp, machdep->ptbl, 
 			"contents of page table page:");

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:13:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:13:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJ6Y-0002nt-HH; Tue, 13 Nov 2012 16:12:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1TYJ6W-0002na-Sb
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 16:12:49 +0000
Received: from [85.158.143.99:62530] by server-3.bemta-4.messagelabs.com id
	24/DB-06841-08172A05; Tue, 13 Nov 2012 16:12:48 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1352823166!18838688!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1OTk2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12742 invoked from network); 13 Nov 2012 16:12:47 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-8.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 16:12:47 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADGCe2k002398
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 16:12:41 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADGCdUN029720
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 16:12:40 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADGCdKa028310; Tue, 13 Nov 2012 10:12:39 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 08:12:39 -0800
Date: Tue, 13 Nov 2012 17:12:25 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: anderson@redhat.com, konrad.wilk@oracle.com, andrew.cooper3@citrix.com,
	olaf@aepfle.de, jbeulich@suse.com, ptesarik@suse.cz,
	crash-utility@redhat.com, kexec@lists.infradead.org,
	xen-devel@lists.xensource.com
Message-ID: <20121113161225.GC2942@host-192-168-1-59.local.net-space.pl>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Subject: [Xen-devel] [PATCH 2/5] xen: Use init_tss array or per_cpu__init_tss
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Newer Xen versions (at least 4.2) use per_cpu__init_tss
instead of init_tss array. Take into account that.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>

diff -Npru crash-6.1.0.orig/x86.c crash-6.1.0/x86.c
--- crash-6.1.0.orig/x86.c	2012-11-13 14:45:58.000000000 +0100
+++ crash-6.1.0/x86.c	2012-11-13 14:48:13.000000000 +0100
@@ -5471,9 +5471,16 @@ x86_get_stackbase_hyper(ulong task)
 	if (!xen_hyper_test_pcpu_id(pcpu)) {
 		error(FATAL, "invalid pcpu number\n");
 	}
-	init_tss = symbol_value("init_tss");
+
+	if (symbol_exists("init_tss")) {
+		init_tss = symbol_value("init_tss");
+		init_tss += XEN_HYPER_SIZE(tss_struct) * pcpu;
+	} else {
+		init_tss = symbol_value("per_cpu__init_tss");
+		init_tss = xen_hyper_per_cpu(init_tss, pcpu);
+	}
+	
 	buf = GETBUF(XEN_HYPER_SIZE(tss_struct));
-	init_tss += XEN_HYPER_SIZE(tss_struct) * pcpu;
 	if (!readmem(init_tss, KVADDR, buf,
 			XEN_HYPER_SIZE(tss_struct), "init_tss", RETURN_ON_ERROR)) {
 		error(FATAL, "cannot read init_tss.\n");

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:13:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:13:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJ6Y-0002nt-HH; Tue, 13 Nov 2012 16:12:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1TYJ6W-0002na-Sb
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 16:12:49 +0000
Received: from [85.158.143.99:62530] by server-3.bemta-4.messagelabs.com id
	24/DB-06841-08172A05; Tue, 13 Nov 2012 16:12:48 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1352823166!18838688!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1OTk2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12742 invoked from network); 13 Nov 2012 16:12:47 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-8.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 16:12:47 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADGCe2k002398
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 16:12:41 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADGCdUN029720
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 16:12:40 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADGCdKa028310; Tue, 13 Nov 2012 10:12:39 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 08:12:39 -0800
Date: Tue, 13 Nov 2012 17:12:25 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: anderson@redhat.com, konrad.wilk@oracle.com, andrew.cooper3@citrix.com,
	olaf@aepfle.de, jbeulich@suse.com, ptesarik@suse.cz,
	crash-utility@redhat.com, kexec@lists.infradead.org,
	xen-devel@lists.xensource.com
Message-ID: <20121113161225.GC2942@host-192-168-1-59.local.net-space.pl>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Subject: [Xen-devel] [PATCH 2/5] xen: Use init_tss array or per_cpu__init_tss
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Newer Xen versions (at least 4.2) use per_cpu__init_tss
instead of init_tss array. Take into account that.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>

diff -Npru crash-6.1.0.orig/x86.c crash-6.1.0/x86.c
--- crash-6.1.0.orig/x86.c	2012-11-13 14:45:58.000000000 +0100
+++ crash-6.1.0/x86.c	2012-11-13 14:48:13.000000000 +0100
@@ -5471,9 +5471,16 @@ x86_get_stackbase_hyper(ulong task)
 	if (!xen_hyper_test_pcpu_id(pcpu)) {
 		error(FATAL, "invalid pcpu number\n");
 	}
-	init_tss = symbol_value("init_tss");
+
+	if (symbol_exists("init_tss")) {
+		init_tss = symbol_value("init_tss");
+		init_tss += XEN_HYPER_SIZE(tss_struct) * pcpu;
+	} else {
+		init_tss = symbol_value("per_cpu__init_tss");
+		init_tss = xen_hyper_per_cpu(init_tss, pcpu);
+	}
+	
 	buf = GETBUF(XEN_HYPER_SIZE(tss_struct));
-	init_tss += XEN_HYPER_SIZE(tss_struct) * pcpu;
 	if (!readmem(init_tss, KVADDR, buf,
 			XEN_HYPER_SIZE(tss_struct), "init_tss", RETURN_ON_ERROR)) {
 		error(FATAL, "cannot read init_tss.\n");

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:13:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:13:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJ70-0002s6-WB; Tue, 13 Nov 2012 16:13:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TYJ6z-0002rk-Jx
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:13:17 +0000
Received: from [85.158.139.211:43621] by server-12.bemta-5.messagelabs.com id
	09/44-02886-C9172A05; Tue, 13 Nov 2012 16:13:16 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1352823194!20031995!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNDkxNzE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28241 invoked from network); 13 Nov 2012 16:13:16 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 16:13:16 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADGDAuV008283
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 16:13:11 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADGD9lQ000815
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 16:13:10 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADGD9gA023227; Tue, 13 Nov 2012 10:13:09 -0600
MIME-Version: 1.0
Message-ID: <8809ab93-4255-464b-88c2-28272980db16@default>
Date: Tue, 13 Nov 2012 08:13:06 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Zhigang Wang <zhigang.x.wang@oracle.com>, Keir Fraser <keir.xen@gmail.com>
References: <CCC6EFAD.44728%keir.xen@gmail.com> <50A26B50.5090109@oracle.com>
In-Reply-To: <50A26B50.5090109@oracle.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: xen-devel <xen-devel@lists.xen.org>, Jan Beulich <jbeulich@suse.com>,
	Konrad Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] VM memory allocation speed with cs 26056
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Zhigang Wang
> Subject: Re: [Xen-devel] VM memory allocation speed with cs 26056
> 
> On 11/12/2012 01:25 PM, Keir Fraser wrote:
> > On 12/11/2012 15:01, "Zhigang Wang" <zhigang.x.wang@oracle.com> wrote:
> >
> >> Hi Keir/Jan,
> >>
> >> Recently I got a chance to access a big machine (2T mem/160 cpus) and I tested
> >> your patch: http://xenbits.xen.org/hg/xen-unstable.hg/rev/177fdda0be56
> >>
> >> Attached is the result.
> > The PVM result is weird, there is a small-ish slowdown for small domains,
> > becoming a very large %age slowdown as domain memory increases, and then
> > turning into a *speedup* as the memory size gets very large indeed.
> >
> > What are the error bars like on these measurements I wonder? One thing we
> > could do to allow PV guests doing 4k-at-a-time allocations through
> > alloc_heap_pages() to benefit from the TLB-flush improvements, is pull the
> > filtering-and-flush out into populate_physmap() and increase_reservation().
> > This is listed as a todo in the original patch (26056).
> >
> > To be honest I don't know why the original patch would make PV domain
> > creation slower, and certainly not by a varying %age depending on domain
> > memory size!
> >
> >  -- Keir
> I did it second time. It seems the result (attached) is promising.
> 
> I think the strange result is due to the order of testing:
> start_physical_machine -> test_hvm -> test_pvm.
> 
> This time, I did: start_physical_machine -> test_pvm -> test_hvm.
> 
> You can see the pvm memory allocation speed is not affected by your patch this time.
> 
> So I believe this patch is excellent now.

I don't know about Keir's opinion, but to me the performance dependency
on ordering is even more bizarre and still calls into question the
acceptability of the patch.  Customers aren't going to like being
told that, for best results, they should launch all PV domains before
their HVM domains.

Is scrubbing still/ever done lazily?  That might explain some of
the weirdness.

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:13:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:13:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJ70-0002s6-WB; Tue, 13 Nov 2012 16:13:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TYJ6z-0002rk-Jx
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:13:17 +0000
Received: from [85.158.139.211:43621] by server-12.bemta-5.messagelabs.com id
	09/44-02886-C9172A05; Tue, 13 Nov 2012 16:13:16 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1352823194!20031995!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNDkxNzE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28241 invoked from network); 13 Nov 2012 16:13:16 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 16:13:16 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADGDAuV008283
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 16:13:11 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADGD9lQ000815
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 16:13:10 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADGD9gA023227; Tue, 13 Nov 2012 10:13:09 -0600
MIME-Version: 1.0
Message-ID: <8809ab93-4255-464b-88c2-28272980db16@default>
Date: Tue, 13 Nov 2012 08:13:06 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Zhigang Wang <zhigang.x.wang@oracle.com>, Keir Fraser <keir.xen@gmail.com>
References: <CCC6EFAD.44728%keir.xen@gmail.com> <50A26B50.5090109@oracle.com>
In-Reply-To: <50A26B50.5090109@oracle.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: xen-devel <xen-devel@lists.xen.org>, Jan Beulich <jbeulich@suse.com>,
	Konrad Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] VM memory allocation speed with cs 26056
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Zhigang Wang
> Subject: Re: [Xen-devel] VM memory allocation speed with cs 26056
> 
> On 11/12/2012 01:25 PM, Keir Fraser wrote:
> > On 12/11/2012 15:01, "Zhigang Wang" <zhigang.x.wang@oracle.com> wrote:
> >
> >> Hi Keir/Jan,
> >>
> >> Recently I got a chance to access a big machine (2T mem/160 cpus) and I tested
> >> your patch: http://xenbits.xen.org/hg/xen-unstable.hg/rev/177fdda0be56
> >>
> >> Attached is the result.
> > The PVM result is weird, there is a small-ish slowdown for small domains,
> > becoming a very large %age slowdown as domain memory increases, and then
> > turning into a *speedup* as the memory size gets very large indeed.
> >
> > What are the error bars like on these measurements I wonder? One thing we
> > could do to allow PV guests doing 4k-at-a-time allocations through
> > alloc_heap_pages() to benefit from the TLB-flush improvements, is pull the
> > filtering-and-flush out into populate_physmap() and increase_reservation().
> > This is listed as a todo in the original patch (26056).
> >
> > To be honest I don't know why the original patch would make PV domain
> > creation slower, and certainly not by a varying %age depending on domain
> > memory size!
> >
> >  -- Keir
> I did it second time. It seems the result (attached) is promising.
> 
> I think the strange result is due to the order of testing:
> start_physical_machine -> test_hvm -> test_pvm.
> 
> This time, I did: start_physical_machine -> test_pvm -> test_hvm.
> 
> You can see the pvm memory allocation speed is not affected by your patch this time.
> 
> So I believe this patch is excellent now.

I don't know about Keir's opinion, but to me the performance dependency
on ordering is even more bizarre and still calls into question the
acceptability of the patch.  Customers aren't going to like being
told that, for best results, they should launch all PV domains before
their HVM domains.

Is scrubbing still/ever done lazily?  That might explain some of
the weirdness.

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:14:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:14:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJ7z-00032u-KW; Tue, 13 Nov 2012 16:14:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1TYJ7y-00032X-Kn
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 16:14:18 +0000
Received: from [85.158.139.83:18555] by server-10.bemta-5.messagelabs.com id
	AB/1F-09257-9D172A05; Tue, 13 Nov 2012 16:14:17 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1352823255!21493487!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1OTk2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 951 invoked from network); 13 Nov 2012 16:14:17 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-16.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 16:14:17 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADGE9CT004353
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 16:14:10 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADGE9Gu002902
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 16:14:09 GMT
Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADGE84k024163; Tue, 13 Nov 2012 10:14:08 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 08:14:08 -0800
Date: Tue, 13 Nov 2012 17:13:54 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: anderson@redhat.com, konrad.wilk@oracle.com, andrew.cooper3@citrix.com,
	olaf@aepfle.de, jbeulich@suse.com, ptesarik@suse.cz,
	crash-utility@redhat.com, kexec@lists.infradead.org,
	xen-devel@lists.xensource.com
Message-ID: <20121113161354.GD2942@host-192-168-1-59.local.net-space.pl>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Subject: [Xen-devel] [PATCH 3/5] xen: Use per_cpu__crash_notes or
	crash_notes array
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Newer Xen versions (at least 4.2) use crash_notes array
instead of per_cpu__crash_notes. Take into account that.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>

diff -Npru crash-6.1.0.orig/xen_hyper.c crash-6.1.0/xen_hyper.c
--- crash-6.1.0.orig/xen_hyper.c	2012-09-27 21:19:15.000000000 +0200
+++ crash-6.1.0/xen_hyper.c	2012-11-12 15:56:17.000000000 +0100
@@ -645,15 +645,22 @@ xen_hyper_dumpinfo_init(void)
 		error(FATAL, "cannot malloc dumpinfo table context_xen_core_array space.\n");
 	}
 	BZERO(xhdit->context_xen_core_array, size);
-	addr = symbol_value("per_cpu__crash_notes");
+	if (symbol_exists("per_cpu__crash_notes"))
+		addr = symbol_value("per_cpu__crash_notes");
+	else
+		get_symbol_data("crash_notes", sizeof(ulong), &addr);
 	for (i = 0; i < machdep->get_smp_cpus(); i++) {
 		ulong addr_notes;
 
-		addr_notes = xen_hyper_per_cpu(addr, i);
+		if (symbol_exists("per_cpu__crash_notes"))
+			addr_notes = xen_hyper_per_cpu(addr, i);
+		else
+			addr_notes = addr + i * STRUCT_SIZE("crash_note_range_t") +
+					MEMBER_OFFSET("crash_note_range_t", "start");
 		if (xhdit->note_ver == XEN_HYPER_ELF_NOTE_V4) {
 			if (!readmem(addr_notes, KVADDR, &(xhdit->context_array[i].note),
-			sizeof(ulong), "per_cpu__crash_notes", RETURN_ON_ERROR)) {
-				error(WARNING, "cannot read per_cpu__crash_notes.\n");
+			sizeof(ulong), "crash_notes", RETURN_ON_ERROR)) {
+				error(WARNING, "cannot read crash_notes.\n");
 				return;
 			}
 		} else {
@@ -678,7 +685,7 @@ xen_hyper_dumpinfo_init(void)
 	xhdit->xen_info_cpu = samp_cpuid;
 	if (!xen_hyper_fill_elf_notes(xhdit->context_array[samp_cpuid].note,
 	buf, XEN_HYPER_ELF_NOTE_FILL_T_NOTE)) {
-		error(FATAL, "cannot read per_cpu__crash_notes.\n");
+		error(FATAL, "cannot read crash_notes.\n");
 	}
 	bp = buf;
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:14:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:14:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJ7z-00032u-KW; Tue, 13 Nov 2012 16:14:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1TYJ7y-00032X-Kn
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 16:14:18 +0000
Received: from [85.158.139.83:18555] by server-10.bemta-5.messagelabs.com id
	AB/1F-09257-9D172A05; Tue, 13 Nov 2012 16:14:17 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1352823255!21493487!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1OTk2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 951 invoked from network); 13 Nov 2012 16:14:17 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-16.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 16:14:17 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADGE9CT004353
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 16:14:10 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADGE9Gu002902
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 16:14:09 GMT
Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADGE84k024163; Tue, 13 Nov 2012 10:14:08 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 08:14:08 -0800
Date: Tue, 13 Nov 2012 17:13:54 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: anderson@redhat.com, konrad.wilk@oracle.com, andrew.cooper3@citrix.com,
	olaf@aepfle.de, jbeulich@suse.com, ptesarik@suse.cz,
	crash-utility@redhat.com, kexec@lists.infradead.org,
	xen-devel@lists.xensource.com
Message-ID: <20121113161354.GD2942@host-192-168-1-59.local.net-space.pl>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Subject: [Xen-devel] [PATCH 3/5] xen: Use per_cpu__crash_notes or
	crash_notes array
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Newer Xen versions (at least 4.2) use crash_notes array
instead of per_cpu__crash_notes. Take into account that.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>

diff -Npru crash-6.1.0.orig/xen_hyper.c crash-6.1.0/xen_hyper.c
--- crash-6.1.0.orig/xen_hyper.c	2012-09-27 21:19:15.000000000 +0200
+++ crash-6.1.0/xen_hyper.c	2012-11-12 15:56:17.000000000 +0100
@@ -645,15 +645,22 @@ xen_hyper_dumpinfo_init(void)
 		error(FATAL, "cannot malloc dumpinfo table context_xen_core_array space.\n");
 	}
 	BZERO(xhdit->context_xen_core_array, size);
-	addr = symbol_value("per_cpu__crash_notes");
+	if (symbol_exists("per_cpu__crash_notes"))
+		addr = symbol_value("per_cpu__crash_notes");
+	else
+		get_symbol_data("crash_notes", sizeof(ulong), &addr);
 	for (i = 0; i < machdep->get_smp_cpus(); i++) {
 		ulong addr_notes;
 
-		addr_notes = xen_hyper_per_cpu(addr, i);
+		if (symbol_exists("per_cpu__crash_notes"))
+			addr_notes = xen_hyper_per_cpu(addr, i);
+		else
+			addr_notes = addr + i * STRUCT_SIZE("crash_note_range_t") +
+					MEMBER_OFFSET("crash_note_range_t", "start");
 		if (xhdit->note_ver == XEN_HYPER_ELF_NOTE_V4) {
 			if (!readmem(addr_notes, KVADDR, &(xhdit->context_array[i].note),
-			sizeof(ulong), "per_cpu__crash_notes", RETURN_ON_ERROR)) {
-				error(WARNING, "cannot read per_cpu__crash_notes.\n");
+			sizeof(ulong), "crash_notes", RETURN_ON_ERROR)) {
+				error(WARNING, "cannot read crash_notes.\n");
 				return;
 			}
 		} else {
@@ -678,7 +685,7 @@ xen_hyper_dumpinfo_init(void)
 	xhdit->xen_info_cpu = samp_cpuid;
 	if (!xen_hyper_fill_elf_notes(xhdit->context_array[samp_cpuid].note,
 	buf, XEN_HYPER_ELF_NOTE_FILL_T_NOTE)) {
-		error(FATAL, "cannot read per_cpu__crash_notes.\n");
+		error(FATAL, "cannot read crash_notes.\n");
 	}
 	bp = buf;
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:15:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:15:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJ8X-00038D-2m; Tue, 13 Nov 2012 16:14:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TYJ8V-00037s-R6
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:14:52 +0000
Received: from [85.158.143.35:29856] by server-2.bemta-4.messagelabs.com id
	11/5F-28922-BF172A05; Tue, 13 Nov 2012 16:14:51 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352823287!13431347!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19583 invoked from network); 13 Nov 2012 16:14:48 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-12.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 16:14:48 -0000
Received: from ([128.244.198.91])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149012707;
	Tue, 13 Nov 2012 11:14:22 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas2.dom1.jhuapl.edu ([128.244.198.91]) with mapi; Tue, 13 Nov 2012
	11:14:22 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Ian Campbell <Ian.Campbell@citrix.com>
Date: Tue, 13 Nov 2012 11:14:21 -0500
Thread-Topic: [PATCH VTPM 6/9] Remove the vtpm process model
Thread-Index: Ac3BsSkajcG9bTGIQlOW4yhbbyRsmgACJokA
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48A23D7AC1@aplesstripe.dom1.jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
	<068F06DC4D106941B297C0C5F9F446EA48A229F471@aplesstripe.dom1.jhuapl.edu>
	<1352819016.7491.84.camel@zakaz.uk.xensource.com>
	<068F06DC4D106941B297C0C5F9F446EA48A23D7A30@aplesstripe.dom1.jhuapl.edu>
	<1352819496.7491.89.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352819496.7491.89.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I actually just made a patch to remove it entirely and tested it and its working. I'll send it in the next update.

-----Original Message-----
From: Ian Campbell [mailto:Ian.Campbell@citrix.com] 
Sent: Tuesday, November 13, 2012 10:12 AM
To: Fioravante, Matthew E.
Cc: xen-devel@lists.xen.org; Stefano Stabellini
Subject: Re: [PATCH VTPM 6/9] Remove the vtpm process model


On Tue, 2012-11-13 at 15:07 +0000, Fioravante, Matthew E. wrote:
> Xend/xm was not changed at all so it should work fine for people not 
> using vtpm. However it still "supports" vtpm devices from the old 
> process mode, which now will not work and possibly crash, hang, or 
> cause an error. It may be confusing to users to see vtpm support in 
> xm, thinking it will work with the new vtpm system.

Are there any xm/xend docs which could be updated to clearly state that this stuff doesn't work?

I'd also be happy with a patch which added a check and error message at the entry point (e.g. tools/python/xen/xm/create.py) without any attempt to root out the support from the underlying code.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:15:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:15:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJ8X-00038D-2m; Tue, 13 Nov 2012 16:14:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TYJ8V-00037s-R6
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:14:52 +0000
Received: from [85.158.143.35:29856] by server-2.bemta-4.messagelabs.com id
	11/5F-28922-BF172A05; Tue, 13 Nov 2012 16:14:51 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352823287!13431347!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19583 invoked from network); 13 Nov 2012 16:14:48 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-12.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 16:14:48 -0000
Received: from ([128.244.198.91])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149012707;
	Tue, 13 Nov 2012 11:14:22 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas2.dom1.jhuapl.edu ([128.244.198.91]) with mapi; Tue, 13 Nov 2012
	11:14:22 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Ian Campbell <Ian.Campbell@citrix.com>
Date: Tue, 13 Nov 2012 11:14:21 -0500
Thread-Topic: [PATCH VTPM 6/9] Remove the vtpm process model
Thread-Index: Ac3BsSkajcG9bTGIQlOW4yhbbyRsmgACJokA
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48A23D7AC1@aplesstripe.dom1.jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
	<068F06DC4D106941B297C0C5F9F446EA48A229F471@aplesstripe.dom1.jhuapl.edu>
	<1352819016.7491.84.camel@zakaz.uk.xensource.com>
	<068F06DC4D106941B297C0C5F9F446EA48A23D7A30@aplesstripe.dom1.jhuapl.edu>
	<1352819496.7491.89.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352819496.7491.89.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I actually just made a patch to remove it entirely and tested it and its working. I'll send it in the next update.

-----Original Message-----
From: Ian Campbell [mailto:Ian.Campbell@citrix.com] 
Sent: Tuesday, November 13, 2012 10:12 AM
To: Fioravante, Matthew E.
Cc: xen-devel@lists.xen.org; Stefano Stabellini
Subject: Re: [PATCH VTPM 6/9] Remove the vtpm process model


On Tue, 2012-11-13 at 15:07 +0000, Fioravante, Matthew E. wrote:
> Xend/xm was not changed at all so it should work fine for people not 
> using vtpm. However it still "supports" vtpm devices from the old 
> process mode, which now will not work and possibly crash, hang, or 
> cause an error. It may be confusing to users to see vtpm support in 
> xm, thinking it will work with the new vtpm system.

Are there any xm/xend docs which could be updated to clearly state that this stuff doesn't work?

I'd also be happy with a patch which added a check and error message at the entry point (e.g. tools/python/xen/xm/create.py) without any attempt to root out the support from the underlying code.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:15:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:15:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJ8y-0003Dl-H0; Tue, 13 Nov 2012 16:15:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1TYJ8w-0003DP-Tx
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 16:15:19 +0000
Received: from [85.158.143.99:15996] by server-2.bemta-4.messagelabs.com id
	E5/00-28922-61272A05; Tue, 13 Nov 2012 16:15:18 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1352823315!29803959!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1OTk2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9435 invoked from network); 13 Nov 2012 16:15:16 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 16:15:16 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADGF94t005790
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 16:15:10 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADGF9Yj004779
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 16:15:09 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADGF8C3021283; Tue, 13 Nov 2012 10:15:08 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 08:15:08 -0800
Date: Tue, 13 Nov 2012 17:14:54 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: anderson@redhat.com, konrad.wilk@oracle.com, andrew.cooper3@citrix.com,
	olaf@aepfle.de, jbeulich@suse.com, ptesarik@suse.cz,
	crash-utility@redhat.com, kexec@lists.infradead.org,
	xen-devel@lists.xensource.com
Message-ID: <20121113161454.GE2942@host-192-168-1-59.local.net-space.pl>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Subject: [Xen-devel] [PATCH 4/5] xen: Try hard to get max_cpus value
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch improves max_cpus value calculation. First
xen_hyper_get_cpu_info() tries to get it from nr_cpu_ids
variable. If nr_cpu_ids does not exist then it attempts
to read max_cpus variable. If it is not available estimate
max_cpus value on the base of cpumask_t size.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>

diff -Npru crash-6.1.0.orig/xen_hyper.c crash-6.1.0/xen_hyper.c
--- crash-6.1.0.orig/xen_hyper.c	2012-11-13 15:02:34.000000000 +0100
+++ crash-6.1.0/xen_hyper.c	2012-11-13 15:07:40.000000000 +0100
@@ -1883,13 +1883,28 @@ xen_hyper_get_uptime_hyper(void)
 void
 xen_hyper_get_cpu_info(void)
 {
-	ulong addr;
+	ulong addr, init_begin, init_end;
 	ulong *cpumask;
 	uint *cpu_idx;
 	int i, j, cpus;
 
 	XEN_HYPER_STRUCT_SIZE_INIT(cpumask_t, "cpumask_t");
-	xht->max_cpus = XEN_HYPER_SIZE(cpumask_t) * 8;
+
+	if (symbol_exists("nr_cpu_ids"))
+		get_symbol_data("nr_cpu_ids", sizeof(uint), &xht->max_cpus);
+	else {
+		init_begin = symbol_value("__init_begin");
+		init_end = symbol_value("__init_end");
+		addr = symbol_value("max_cpus");
+
+		if (addr >= init_begin && addr < init_end)
+			xht->max_cpus = XEN_HYPER_SIZE(cpumask_t) * 8;
+		else {
+			get_symbol_data("max_cpus", sizeof(xht->max_cpus), &xht->max_cpus);
+			if (XEN_HYPER_SIZE(cpumask_t) * 8 > xht->max_cpus)
+				xht->max_cpus = XEN_HYPER_SIZE(cpumask_t) * 8;
+		}
+	}
 
 	if (xht->cpumask) {
 		free(xht->cpumask);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:15:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:15:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJ8y-0003Dl-H0; Tue, 13 Nov 2012 16:15:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1TYJ8w-0003DP-Tx
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 16:15:19 +0000
Received: from [85.158.143.99:15996] by server-2.bemta-4.messagelabs.com id
	E5/00-28922-61272A05; Tue, 13 Nov 2012 16:15:18 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1352823315!29803959!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1OTk2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9435 invoked from network); 13 Nov 2012 16:15:16 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 16:15:16 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADGF94t005790
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 16:15:10 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADGF9Yj004779
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 16:15:09 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADGF8C3021283; Tue, 13 Nov 2012 10:15:08 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 08:15:08 -0800
Date: Tue, 13 Nov 2012 17:14:54 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: anderson@redhat.com, konrad.wilk@oracle.com, andrew.cooper3@citrix.com,
	olaf@aepfle.de, jbeulich@suse.com, ptesarik@suse.cz,
	crash-utility@redhat.com, kexec@lists.infradead.org,
	xen-devel@lists.xensource.com
Message-ID: <20121113161454.GE2942@host-192-168-1-59.local.net-space.pl>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Subject: [Xen-devel] [PATCH 4/5] xen: Try hard to get max_cpus value
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch improves max_cpus value calculation. First
xen_hyper_get_cpu_info() tries to get it from nr_cpu_ids
variable. If nr_cpu_ids does not exist then it attempts
to read max_cpus variable. If it is not available estimate
max_cpus value on the base of cpumask_t size.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>

diff -Npru crash-6.1.0.orig/xen_hyper.c crash-6.1.0/xen_hyper.c
--- crash-6.1.0.orig/xen_hyper.c	2012-11-13 15:02:34.000000000 +0100
+++ crash-6.1.0/xen_hyper.c	2012-11-13 15:07:40.000000000 +0100
@@ -1883,13 +1883,28 @@ xen_hyper_get_uptime_hyper(void)
 void
 xen_hyper_get_cpu_info(void)
 {
-	ulong addr;
+	ulong addr, init_begin, init_end;
 	ulong *cpumask;
 	uint *cpu_idx;
 	int i, j, cpus;
 
 	XEN_HYPER_STRUCT_SIZE_INIT(cpumask_t, "cpumask_t");
-	xht->max_cpus = XEN_HYPER_SIZE(cpumask_t) * 8;
+
+	if (symbol_exists("nr_cpu_ids"))
+		get_symbol_data("nr_cpu_ids", sizeof(uint), &xht->max_cpus);
+	else {
+		init_begin = symbol_value("__init_begin");
+		init_end = symbol_value("__init_end");
+		addr = symbol_value("max_cpus");
+
+		if (addr >= init_begin && addr < init_end)
+			xht->max_cpus = XEN_HYPER_SIZE(cpumask_t) * 8;
+		else {
+			get_symbol_data("max_cpus", sizeof(xht->max_cpus), &xht->max_cpus);
+			if (XEN_HYPER_SIZE(cpumask_t) * 8 > xht->max_cpus)
+				xht->max_cpus = XEN_HYPER_SIZE(cpumask_t) * 8;
+		}
+	}
 
 	if (xht->cpumask) {
 		free(xht->cpumask);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:15:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:15:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJ93-0003FA-UL; Tue, 13 Nov 2012 16:15:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYJ92-0003Ed-SQ
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 16:15:25 +0000
Received: from [85.158.139.83:63189] by server-10.bemta-5.messagelabs.com id
	8B/D1-09257-C1272A05; Tue, 13 Nov 2012 16:15:24 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1352823320!30086738!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29549 invoked from network); 13 Nov 2012 16:15:21 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:15:21 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15783931"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:15:16 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 13 Nov 2012 16:15:15 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYJ8t-0007QL-VL;
	Tue, 13 Nov 2012 16:15:16 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYJ8t-0007DS-KG;
	Tue, 13 Nov 2012 16:15:15 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14386-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 13 Nov 2012 16:15:15 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14386: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14386 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14386/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14385
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14385
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14385
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14385

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  8b93ac0c93f3
baseline version:
 xen                  a3cde70320ad

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Daley <mattjd@gmail.com>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Ronny Hegewald <Ronny.Hegewald@online.de>
  Samuel Thibault <samuel.thibault@ens-lyon.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=8b93ac0c93f3
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 8b93ac0c93f3
+ branch=xen-unstable
+ revision=8b93ac0c93f3
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 8b93ac0c93f3 ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 7 changesets with 51 changes to 50 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:15:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:15:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJ93-0003FA-UL; Tue, 13 Nov 2012 16:15:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYJ92-0003Ed-SQ
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 16:15:25 +0000
Received: from [85.158.139.83:63189] by server-10.bemta-5.messagelabs.com id
	8B/D1-09257-C1272A05; Tue, 13 Nov 2012 16:15:24 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1352823320!30086738!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29549 invoked from network); 13 Nov 2012 16:15:21 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:15:21 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15783931"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:15:16 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 13 Nov 2012 16:15:15 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYJ8t-0007QL-VL;
	Tue, 13 Nov 2012 16:15:16 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYJ8t-0007DS-KG;
	Tue, 13 Nov 2012 16:15:15 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14386-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 13 Nov 2012 16:15:15 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14386: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14386 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14386/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14385
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14385
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14385
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14385

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  8b93ac0c93f3
baseline version:
 xen                  a3cde70320ad

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Daley <mattjd@gmail.com>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Ronny Hegewald <Ronny.Hegewald@online.de>
  Samuel Thibault <samuel.thibault@ens-lyon.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=8b93ac0c93f3
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 8b93ac0c93f3
+ branch=xen-unstable
+ revision=8b93ac0c93f3
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 8b93ac0c93f3 ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 7 changesets with 51 changes to 50 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:16:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:16:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJAJ-0003W6-F7; Tue, 13 Nov 2012 16:16:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1TYJAI-0003Vp-Av
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 16:16:42 +0000
Received: from [85.158.143.35:56504] by server-2.bemta-4.messagelabs.com id
	FD/72-28922-96272A05; Tue, 13 Nov 2012 16:16:41 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1352823367!12000928!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNDkxNzE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17185 invoked from network); 13 Nov 2012 16:16:12 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-11.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 16:16:12 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADGG1dh012069
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 16:16:02 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADGG0b5023420
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 16:16:01 GMT
Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADGG0d1025797; Tue, 13 Nov 2012 10:16:00 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 08:16:00 -0800
Date: Tue, 13 Nov 2012 17:15:47 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: anderson@redhat.com, konrad.wilk@oracle.com, andrew.cooper3@citrix.com,
	olaf@aepfle.de, jbeulich@suse.com, ptesarik@suse.cz,
	crash-utility@redhat.com, kexec@lists.infradead.org,
	xen-devel@lists.xensource.com
Message-ID: <20121113161547.GF2942@host-192-168-1-59.local.net-space.pl>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Subject: [Xen-devel] [PATCH 5/5] xen: Use cpu_present_map instead of
	cpu_online_map
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Newer Xen versions (at least 4.2) clear cpu_online_map during crash.
In this case it is not possible to check which CPUs were available.
cpu_present_map contains such information but it has different meaning.
However, we do not have a choice and we must use cpu_present_map instead
of cpu_online_map.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>

diff -Npru crash-6.1.0.orig/xen_hyper.c crash-6.1.0/xen_hyper.c
--- crash-6.1.0.orig/xen_hyper.c	2012-11-13 15:08:41.000000000 +0100
+++ crash-6.1.0/xen_hyper.c	2012-11-13 15:09:03.000000000 +0100
@@ -1912,11 +1912,10 @@ xen_hyper_get_cpu_info(void)
 	if((xht->cpumask = malloc(XEN_HYPER_SIZE(cpumask_t))) == NULL) {
 		error(FATAL, "cannot malloc cpumask space.\n");
 	}
-	/* kakuma: It may be better to use cpu_present_map. */
-	addr = symbol_value("cpu_online_map");
+	addr = symbol_value("cpu_present_map");
 	if (!readmem(addr, KVADDR, xht->cpumask,
-		XEN_HYPER_SIZE(cpumask_t), "cpu_online_map", RETURN_ON_ERROR)) {
-		error(FATAL, "cannot read cpu_online_map.\n");
+		XEN_HYPER_SIZE(cpumask_t), "cpu_present_map", RETURN_ON_ERROR)) {
+		error(FATAL, "cannot read cpu_present_map.\n");
 	}
 	if (xht->cpu_idxs) {
 		free(xht->cpu_idxs);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:16:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:16:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJAJ-0003W6-F7; Tue, 13 Nov 2012 16:16:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1TYJAI-0003Vp-Av
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 16:16:42 +0000
Received: from [85.158.143.35:56504] by server-2.bemta-4.messagelabs.com id
	FD/72-28922-96272A05; Tue, 13 Nov 2012 16:16:41 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1352823367!12000928!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNDkxNzE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17185 invoked from network); 13 Nov 2012 16:16:12 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-11.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 16:16:12 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADGG1dh012069
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 16:16:02 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADGG0b5023420
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 16:16:01 GMT
Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADGG0d1025797; Tue, 13 Nov 2012 10:16:00 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 08:16:00 -0800
Date: Tue, 13 Nov 2012 17:15:47 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: anderson@redhat.com, konrad.wilk@oracle.com, andrew.cooper3@citrix.com,
	olaf@aepfle.de, jbeulich@suse.com, ptesarik@suse.cz,
	crash-utility@redhat.com, kexec@lists.infradead.org,
	xen-devel@lists.xensource.com
Message-ID: <20121113161547.GF2942@host-192-168-1-59.local.net-space.pl>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Subject: [Xen-devel] [PATCH 5/5] xen: Use cpu_present_map instead of
	cpu_online_map
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Newer Xen versions (at least 4.2) clear cpu_online_map during crash.
In this case it is not possible to check which CPUs were available.
cpu_present_map contains such information but it has different meaning.
However, we do not have a choice and we must use cpu_present_map instead
of cpu_online_map.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>

diff -Npru crash-6.1.0.orig/xen_hyper.c crash-6.1.0/xen_hyper.c
--- crash-6.1.0.orig/xen_hyper.c	2012-11-13 15:08:41.000000000 +0100
+++ crash-6.1.0/xen_hyper.c	2012-11-13 15:09:03.000000000 +0100
@@ -1912,11 +1912,10 @@ xen_hyper_get_cpu_info(void)
 	if((xht->cpumask = malloc(XEN_HYPER_SIZE(cpumask_t))) == NULL) {
 		error(FATAL, "cannot malloc cpumask space.\n");
 	}
-	/* kakuma: It may be better to use cpu_present_map. */
-	addr = symbol_value("cpu_online_map");
+	addr = symbol_value("cpu_present_map");
 	if (!readmem(addr, KVADDR, xht->cpumask,
-		XEN_HYPER_SIZE(cpumask_t), "cpu_online_map", RETURN_ON_ERROR)) {
-		error(FATAL, "cannot read cpu_online_map.\n");
+		XEN_HYPER_SIZE(cpumask_t), "cpu_present_map", RETURN_ON_ERROR)) {
+		error(FATAL, "cannot read cpu_present_map.\n");
 	}
 	if (xht->cpu_idxs) {
 		free(xht->cpu_idxs);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:22:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:22:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJFL-0004B6-C0; Tue, 13 Nov 2012 16:21:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYJFJ-0004Az-7R
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 16:21:53 +0000
Received: from [85.158.139.83:17294] by server-10.bemta-5.messagelabs.com id
	E0/12-09257-0A372A05; Tue, 13 Nov 2012 16:21:52 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1352823711!25498007!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12786 invoked from network); 13 Nov 2012 16:21:52 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:21:52 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15784186"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:21:26 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 13 Nov 2012 16:21:26 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TYJEs-0007Sd-8R; Tue, 13 Nov 2012 16:21:26 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TYJEs-0002Af-2c;
	Tue, 13 Nov 2012 16:21:26 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20642.29568.426761.422604@mariner.uk.xensource.com>
Date: Tue, 13 Nov 2012 16:21:20 +0000
To: Jacek Konieczny <jajcus@jajcus.net>
In-Reply-To: <20121113132735.GD7561@jajo.eggsoft>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
	<1352738557.27833.302.camel@zakaz.uk.xensource.com>
	<20121112180738.GA26672@aepfle.de>
	<20121112183457.GB2114@lolek.nigdzie>
	<20121112184047.GA28988@aepfle.de>
	<1352804909.7491.55.camel@zakaz.uk.xensource.com>
	<20121113132735.GD7561@jajo.eggsoft>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH] Fix locking in
 tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Jacek Konieczny writes ("Re: [Xen-devel] [PATCH] Fix locking in tools/hotplug/Linux/locking.sh"):
> fcntl(3, F_GETFL)                       = 0x8401 (flags O_WRONLY|O_APPEND|O_LARGEFILE)

So it seems perl is going out of its way to spot this earlier.
That explains the mystery.  Anyway the patch is fine.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:22:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:22:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJFL-0004B6-C0; Tue, 13 Nov 2012 16:21:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYJFJ-0004Az-7R
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 16:21:53 +0000
Received: from [85.158.139.83:17294] by server-10.bemta-5.messagelabs.com id
	E0/12-09257-0A372A05; Tue, 13 Nov 2012 16:21:52 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1352823711!25498007!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12786 invoked from network); 13 Nov 2012 16:21:52 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:21:52 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15784186"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:21:26 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 13 Nov 2012 16:21:26 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TYJEs-0007Sd-8R; Tue, 13 Nov 2012 16:21:26 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TYJEs-0002Af-2c;
	Tue, 13 Nov 2012 16:21:26 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20642.29568.426761.422604@mariner.uk.xensource.com>
Date: Tue, 13 Nov 2012 16:21:20 +0000
To: Jacek Konieczny <jajcus@jajcus.net>
In-Reply-To: <20121113132735.GD7561@jajo.eggsoft>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
	<1352738557.27833.302.camel@zakaz.uk.xensource.com>
	<20121112180738.GA26672@aepfle.de>
	<20121112183457.GB2114@lolek.nigdzie>
	<20121112184047.GA28988@aepfle.de>
	<1352804909.7491.55.camel@zakaz.uk.xensource.com>
	<20121113132735.GD7561@jajo.eggsoft>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH] Fix locking in
 tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Jacek Konieczny writes ("Re: [Xen-devel] [PATCH] Fix locking in tools/hotplug/Linux/locking.sh"):
> fcntl(3, F_GETFL)                       = 0x8401 (flags O_WRONLY|O_APPEND|O_LARGEFILE)

So it seems perl is going out of its way to spot this earlier.
That explains the mystery.  Anyway the patch is fine.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJGS-0004Si-5c; Tue, 13 Nov 2012 16:23:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJGR-0004SR-GS
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:03 +0000
Received: from [85.158.139.83:32149] by server-7.bemta-5.messagelabs.com id
	8D/E0-23096-6E372A05; Tue, 13 Nov 2012 16:23:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1352823781!30133374!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25885 invoked from network); 13 Nov 2012 16:23:02 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:02 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15784229"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:00 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 16:23:00 +0000
Message-ID: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: xen-devel <xen-devel@lists.xen.org>
Date: Tue, 13 Nov 2012 16:22:59 +0000
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Subject: [Xen-devel] [PATCH V2 00/12] arm: support for initial modules (e.g.
 dom0) and DTB supplied in RAM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The following series implements support for initial images and DTB in
RAM, as opposed to in flash (dom0 kernel) or compiled into the
hypervisor (DTB). It arranges to not clobber these with either the h/v
text on relocation or with the heaps and frees them as appropriate.

Most of this is independent of the specific bootloader protocol which is
used to tell Xen where these modules actually are, but I have included a
simple PoC bootloader protocol based around device tree which is similar
to the protocol used by Linux to find its initrd
(where /chosen/linux,initrd-{start,end} indicate the physical address).

The PoC protocol is documented in docs/misc/arm/device-tree/booting.txt
which is added by this series.

I will post a patch against the boot-wrapper which implements the
"bootloader" side of this protocol shortly. With that you can boot using
the semi-hosting feature of the model (paths are host paths) like so:
        $MODEL linux-system-semi.axf -C cluster.cpu0.semihosting-cmd_line=\
                '--kernel xen-arm.bin \
                 --module zImage earlyprintk=xenboot console=ttyAMA1 root=/dev/mmcblk0 ro \
                 --dtb vexpress-v2p-aem-v7a-xen.dtb -- dom0_mem=256M'

Where xen-arm.bin, zImage and vexpress-v2p-aem-v7a-xen.dtb are all files
in your $CWD.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJGS-0004Si-5c; Tue, 13 Nov 2012 16:23:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJGR-0004SR-GS
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:03 +0000
Received: from [85.158.139.83:32149] by server-7.bemta-5.messagelabs.com id
	8D/E0-23096-6E372A05; Tue, 13 Nov 2012 16:23:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1352823781!30133374!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25885 invoked from network); 13 Nov 2012 16:23:02 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:02 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15784229"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:00 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 16:23:00 +0000
Message-ID: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: xen-devel <xen-devel@lists.xen.org>
Date: Tue, 13 Nov 2012 16:22:59 +0000
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Subject: [Xen-devel] [PATCH V2 00/12] arm: support for initial modules (e.g.
 dom0) and DTB supplied in RAM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The following series implements support for initial images and DTB in
RAM, as opposed to in flash (dom0 kernel) or compiled into the
hypervisor (DTB). It arranges to not clobber these with either the h/v
text on relocation or with the heaps and frees them as appropriate.

Most of this is independent of the specific bootloader protocol which is
used to tell Xen where these modules actually are, but I have included a
simple PoC bootloader protocol based around device tree which is similar
to the protocol used by Linux to find its initrd
(where /chosen/linux,initrd-{start,end} indicate the physical address).

The PoC protocol is documented in docs/misc/arm/device-tree/booting.txt
which is added by this series.

I will post a patch against the boot-wrapper which implements the
"bootloader" side of this protocol shortly. With that you can boot using
the semi-hosting feature of the model (paths are host paths) like so:
        $MODEL linux-system-semi.axf -C cluster.cpu0.semihosting-cmd_line=\
                '--kernel xen-arm.bin \
                 --module zImage earlyprintk=xenboot console=ttyAMA1 root=/dev/mmcblk0 ro \
                 --dtb vexpress-v2p-aem-v7a-xen.dtb -- dom0_mem=256M'

Where xen-arm.bin, zImage and vexpress-v2p-aem-v7a-xen.dtb are all files
in your $CWD.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJGd-0004Vi-JW; Tue, 13 Nov 2012 16:23:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYJGb-0004V2-Tf
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:14 +0000
Received: from [193.109.254.147:8178] by server-16.bemta-14.messagelabs.com id
	37/F3-09215-1F372A05; Tue, 13 Nov 2012 16:23:13 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1352823792!3824472!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4178 invoked from network); 13 Nov 2012 16:23:12 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:12 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15784240"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:12 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 13 Nov 2012 16:23:12 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TYJGa-0007TH-AG; Tue, 13 Nov 2012 16:23:12 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TYJGa-0002B1-6K;
	Tue, 13 Nov 2012 16:23:12 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20642.29680.90716.63517@mariner.uk.xensource.com>
Date: Tue, 13 Nov 2012 16:23:12 +0000
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1352739849.27833.308.camel@zakaz.uk.xensource.com>
References: <509CB5FB.7020404@jp.fujitsu.com>
	<1352739849.27833.308.camel@zakaz.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Kouya Shimura <kouya@jp.fujitsu.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] libxl: fix reboot failure of migrated domain
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("Re: [Xen-devel] [PATCH] libxl: fix reboot failure of migrated domain"):
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> 
> and applied.
> 
> Ian (J): Not sure if the test harness does much after the migration
> phase but adding a few lifecycle ops as a sanity check might be useful?

At least a reboot would probably be a good idea.  I need to merge my
two branches before I can make a change like that, though.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJGd-0004Vi-JW; Tue, 13 Nov 2012 16:23:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYJGb-0004V2-Tf
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:14 +0000
Received: from [193.109.254.147:8178] by server-16.bemta-14.messagelabs.com id
	37/F3-09215-1F372A05; Tue, 13 Nov 2012 16:23:13 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1352823792!3824472!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4178 invoked from network); 13 Nov 2012 16:23:12 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:12 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15784240"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:12 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 13 Nov 2012 16:23:12 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TYJGa-0007TH-AG; Tue, 13 Nov 2012 16:23:12 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TYJGa-0002B1-6K;
	Tue, 13 Nov 2012 16:23:12 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20642.29680.90716.63517@mariner.uk.xensource.com>
Date: Tue, 13 Nov 2012 16:23:12 +0000
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1352739849.27833.308.camel@zakaz.uk.xensource.com>
References: <509CB5FB.7020404@jp.fujitsu.com>
	<1352739849.27833.308.camel@zakaz.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Kouya Shimura <kouya@jp.fujitsu.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] libxl: fix reboot failure of migrated domain
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("Re: [Xen-devel] [PATCH] libxl: fix reboot failure of migrated domain"):
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> 
> and applied.
> 
> Ian (J): Not sure if the test harness does much after the migration
> phase but adding a few lifecycle ops as a sanity check might be useful?

At least a reboot would probably be a good idea.  I need to merge my
two branches before I can make a change like that, though.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJGs-0004aq-19; Tue, 13 Nov 2012 16:23:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJGq-0004a5-Om
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:28 +0000
Received: from [85.158.138.51:51622] by server-8.bemta-3.messagelabs.com id
	76/3D-07786-00472A05; Tue, 13 Nov 2012 16:23:28 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1352823806!29850157!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23003 invoked from network); 13 Nov 2012 16:23:27 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:27 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="214354944"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:25 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:25 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGm-0000Qd-V4;
	Tue, 13 Nov 2012 16:23:24 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:13 +0000
Message-ID: <1352823804-28482-1-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 01/12] arm: Enable build without CONFIG_DTB_FILE
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/Makefile  |    4 ----
 xen/arch/arm/xen.lds.S |    2 ++
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 634b620..bfac017 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -33,10 +33,6 @@ obj-y += hvm.o
 ifdef CONFIG_DTB_FILE
 obj-y += dtb.o
 AFLAGS += -DCONFIG_DTB_FILE=\"$(CONFIG_DTB_FILE)\"
-else
-# XXX: When running on the model there is no bootloader to provide a
-# device tree.  It must be linked into Xen.
-$(error CONFIG_DTB_FILE must be set to the absolute filename of a DTB)
 endif
 
 ALL_OBJS := head.o $(ALL_OBJS)
diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index f0f4cd3..410d7db 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -123,9 +123,11 @@ SECTIONS
   } :text
   _end = . ;
 
+#ifdef CONFIG_DTB_FILE
   /* Section for the device tree blob (if any). */
   _sdtb = .;
   .dtb : { *(.dtb) } :text
+#endif
 
   /* Sections to be discarded */
   /DISCARD/ : {
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJGs-0004aq-19; Tue, 13 Nov 2012 16:23:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJGq-0004a5-Om
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:28 +0000
Received: from [85.158.138.51:51622] by server-8.bemta-3.messagelabs.com id
	76/3D-07786-00472A05; Tue, 13 Nov 2012 16:23:28 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1352823806!29850157!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23003 invoked from network); 13 Nov 2012 16:23:27 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:27 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="214354944"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:25 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:25 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGm-0000Qd-V4;
	Tue, 13 Nov 2012 16:23:24 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:13 +0000
Message-ID: <1352823804-28482-1-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 01/12] arm: Enable build without CONFIG_DTB_FILE
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/Makefile  |    4 ----
 xen/arch/arm/xen.lds.S |    2 ++
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 634b620..bfac017 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -33,10 +33,6 @@ obj-y += hvm.o
 ifdef CONFIG_DTB_FILE
 obj-y += dtb.o
 AFLAGS += -DCONFIG_DTB_FILE=\"$(CONFIG_DTB_FILE)\"
-else
-# XXX: When running on the model there is no bootloader to provide a
-# device tree.  It must be linked into Xen.
-$(error CONFIG_DTB_FILE must be set to the absolute filename of a DTB)
 endif
 
 ALL_OBJS := head.o $(ALL_OBJS)
diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index f0f4cd3..410d7db 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -123,9 +123,11 @@ SECTIONS
   } :text
   _end = . ;
 
+#ifdef CONFIG_DTB_FILE
   /* Section for the device tree blob (if any). */
   _sdtb = .;
   .dtb : { *(.dtb) } :text
+#endif
 
   /* Sections to be discarded */
   /DISCARD/ : {
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJGt-0004bg-E3; Tue, 13 Nov 2012 16:23:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJGr-0004aP-Bw
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:29 +0000
Received: from [85.158.138.51:51654] by server-13.bemta-3.messagelabs.com id
	6A/4E-24887-00472A05; Tue, 13 Nov 2012 16:23:28 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1352823806!29850157!2
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23026 invoked from network); 13 Nov 2012 16:23:28 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:28 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="214354945"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:25 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:25 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-11;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:15 +0000
Message-ID: <1352823804-28482-3-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 03/12] arm: handle xenheap which isn't at the
	start of RAM.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: Simplify page_to_virt by using mfn_to_virt & page_to_mfn as
    suggested by Tim.
---
 xen/include/asm-arm/mm.h |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index c0f5b1f..260af35 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -214,17 +214,15 @@ static inline struct page_info *virt_to_page(const void *v)
     ASSERT(va >= XENHEAP_VIRT_START);
     ASSERT(va < xenheap_virt_end);
 
-    return frame_table + ((va - XENHEAP_VIRT_START) >> PAGE_SHIFT);
+    return frame_table
+        + ((va - XENHEAP_VIRT_START) >> PAGE_SHIFT)
+        + xenheap_mfn_start
+        - frametable_base_mfn;
 }
 
 static inline void *page_to_virt(const struct page_info *pg)
 {
-    ASSERT((unsigned long)pg - FRAMETABLE_VIRT_START < frametable_virt_end);
-    return (void *)(XENHEAP_VIRT_START +
-                    ((unsigned long)pg - FRAMETABLE_VIRT_START) /
-                    (sizeof(*pg) / (sizeof(*pg) & -sizeof(*pg))) *
-                    (PAGE_SIZE / (sizeof(*pg) & -sizeof(*pg))));
-
+    return mfn_to_virt(page_to_mfn(pg));
 }
 
 struct domain *page_get_owner_and_reference(struct page_info *page);
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJGt-0004bg-E3; Tue, 13 Nov 2012 16:23:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJGr-0004aP-Bw
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:29 +0000
Received: from [85.158.138.51:51654] by server-13.bemta-3.messagelabs.com id
	6A/4E-24887-00472A05; Tue, 13 Nov 2012 16:23:28 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1352823806!29850157!2
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23026 invoked from network); 13 Nov 2012 16:23:28 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:28 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="214354945"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:25 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:25 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-11;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:15 +0000
Message-ID: <1352823804-28482-3-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 03/12] arm: handle xenheap which isn't at the
	start of RAM.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: Simplify page_to_virt by using mfn_to_virt & page_to_mfn as
    suggested by Tim.
---
 xen/include/asm-arm/mm.h |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index c0f5b1f..260af35 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -214,17 +214,15 @@ static inline struct page_info *virt_to_page(const void *v)
     ASSERT(va >= XENHEAP_VIRT_START);
     ASSERT(va < xenheap_virt_end);
 
-    return frame_table + ((va - XENHEAP_VIRT_START) >> PAGE_SHIFT);
+    return frame_table
+        + ((va - XENHEAP_VIRT_START) >> PAGE_SHIFT)
+        + xenheap_mfn_start
+        - frametable_base_mfn;
 }
 
 static inline void *page_to_virt(const struct page_info *pg)
 {
-    ASSERT((unsigned long)pg - FRAMETABLE_VIRT_START < frametable_virt_end);
-    return (void *)(XENHEAP_VIRT_START +
-                    ((unsigned long)pg - FRAMETABLE_VIRT_START) /
-                    (sizeof(*pg) / (sizeof(*pg) & -sizeof(*pg))) *
-                    (PAGE_SIZE / (sizeof(*pg) & -sizeof(*pg))));
-
+    return mfn_to_virt(page_to_mfn(pg));
 }
 
 struct domain *page_get_owner_and_reference(struct page_info *page);
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJGw-0004dU-1m; Tue, 13 Nov 2012 16:23:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJGu-0004aP-1X
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:32 +0000
Received: from [85.158.137.99:22003] by server-13.bemta-3.messagelabs.com id
	B0/6E-24887-30472A05; Tue, 13 Nov 2012 16:23:31 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1352823809!18961018!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10620 invoked from network); 13 Nov 2012 16:23:30 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:30 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="214354949"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:25 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:26 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-Eg;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:22 +0000
Message-ID: <1352823804-28482-10-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 10/12] arm: discard boot modules after building
	domain 0.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/arm/domain_build.c |    3 +++
 xen/arch/arm/setup.c        |   16 ++++++++++++++++
 xen/include/asm-arm/setup.h |    2 ++
 3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index a9e7f43..e96ed10 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -10,6 +10,7 @@
 #include <xen/device_tree.h>
 #include <xen/libfdt/libfdt.h>
 #include <xen/guest_access.h>
+#include <asm/setup.h>
 
 #include "gic.h"
 #include "kernel.h"
@@ -308,6 +309,8 @@ int construct_dom0(struct domain *d)
     dtb_load(&kinfo);
     kernel_load(&kinfo);
 
+    discard_initial_modules();
+
     clear_bit(_VPF_down, &v->pause_flags);
 
     memset(regs, 0, sizeof(*regs));
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 04d16a1..0b668fa 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -68,6 +68,22 @@ static void __init processor_id(void)
            READ_CP32(ID_ISAR3), READ_CP32(ID_ISAR4), READ_CP32(ID_ISAR5));
 }
 
+void __init discard_initial_modules(void)
+{
+    struct dt_module_info *mi = &early_info.modules;
+    int i;
+
+    for ( i = 1; i <= mi->nr_mods; i++ )
+    {
+        paddr_t s = mi->module[i].start;
+        paddr_t e = s + PAGE_ALIGN(mi->module[i].size);
+
+        init_domheap_pages(s, e);
+    }
+
+    mi->nr_mods = 0;
+}
+
 /*
  * Returns the end address of the highest region in the range s..e
  * with required size and alignment that does not conflict with the
diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h
index 8769f66..3267db0 100644
--- a/xen/include/asm-arm/setup.h
+++ b/xen/include/asm-arm/setup.h
@@ -9,6 +9,8 @@ void arch_get_xen_caps(xen_capabilities_info_t *info);
 
 int construct_dom0(struct domain *d);
 
+void discard_initial_modules(void);
+
 #endif
 /*
  * Local variables:
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJGw-0004dU-1m; Tue, 13 Nov 2012 16:23:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJGu-0004aP-1X
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:32 +0000
Received: from [85.158.137.99:22003] by server-13.bemta-3.messagelabs.com id
	B0/6E-24887-30472A05; Tue, 13 Nov 2012 16:23:31 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1352823809!18961018!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10620 invoked from network); 13 Nov 2012 16:23:30 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:30 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="214354949"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:25 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:26 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-Eg;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:22 +0000
Message-ID: <1352823804-28482-10-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 10/12] arm: discard boot modules after building
	domain 0.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/arm/domain_build.c |    3 +++
 xen/arch/arm/setup.c        |   16 ++++++++++++++++
 xen/include/asm-arm/setup.h |    2 ++
 3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index a9e7f43..e96ed10 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -10,6 +10,7 @@
 #include <xen/device_tree.h>
 #include <xen/libfdt/libfdt.h>
 #include <xen/guest_access.h>
+#include <asm/setup.h>
 
 #include "gic.h"
 #include "kernel.h"
@@ -308,6 +309,8 @@ int construct_dom0(struct domain *d)
     dtb_load(&kinfo);
     kernel_load(&kinfo);
 
+    discard_initial_modules();
+
     clear_bit(_VPF_down, &v->pause_flags);
 
     memset(regs, 0, sizeof(*regs));
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 04d16a1..0b668fa 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -68,6 +68,22 @@ static void __init processor_id(void)
            READ_CP32(ID_ISAR3), READ_CP32(ID_ISAR4), READ_CP32(ID_ISAR5));
 }
 
+void __init discard_initial_modules(void)
+{
+    struct dt_module_info *mi = &early_info.modules;
+    int i;
+
+    for ( i = 1; i <= mi->nr_mods; i++ )
+    {
+        paddr_t s = mi->module[i].start;
+        paddr_t e = s + PAGE_ALIGN(mi->module[i].size);
+
+        init_domheap_pages(s, e);
+    }
+
+    mi->nr_mods = 0;
+}
+
 /*
  * Returns the end address of the highest region in the range s..e
  * with required size and alignment that does not conflict with the
diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h
index 8769f66..3267db0 100644
--- a/xen/include/asm-arm/setup.h
+++ b/xen/include/asm-arm/setup.h
@@ -9,6 +9,8 @@ void arch_get_xen_caps(xen_capabilities_info_t *info);
 
 int construct_dom0(struct domain *d);
 
+void discard_initial_modules(void);
+
 #endif
 /*
  * Local variables:
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJGu-0004cM-8g; Tue, 13 Nov 2012 16:23:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJGs-0004bA-T1
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:31 +0000
Received: from [85.158.138.51:51763] by server-1.bemta-3.messagelabs.com id
	32/11-12169-20472A05; Tue, 13 Nov 2012 16:23:30 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1352823806!29850157!4
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23106 invoked from network); 13 Nov 2012 16:23:29 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:29 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="214354947"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:25 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:26 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-8V;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:19 +0000
Message-ID: <1352823804-28482-7-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 07/12] arm: const-correctness in virt_to_maddr
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Acked-by: Tim Deegan <tim@xen.org>
---
v2: dropped one unnecessary const.
---
 xen/include/asm-arm/mm.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index 260af35..e95ece1 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -179,7 +179,7 @@ extern void clear_fixmap(unsigned map);
 #define paddr_to_pdx(pa)    pfn_to_pdx(paddr_to_pfn(pa))
 
 
-static inline paddr_t virt_to_maddr(void *va)
+static inline paddr_t virt_to_maddr(const void *va)
 {
     uint64_t par = va_to_par((uint32_t)va);
     return (par & PADDR_MASK & PAGE_MASK) | ((unsigned long) va & ~PAGE_MASK);
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJGu-0004cM-8g; Tue, 13 Nov 2012 16:23:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJGs-0004bA-T1
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:31 +0000
Received: from [85.158.138.51:51763] by server-1.bemta-3.messagelabs.com id
	32/11-12169-20472A05; Tue, 13 Nov 2012 16:23:30 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1352823806!29850157!4
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23106 invoked from network); 13 Nov 2012 16:23:29 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:29 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="214354947"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:25 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:26 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-8V;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:19 +0000
Message-ID: <1352823804-28482-7-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 07/12] arm: const-correctness in virt_to_maddr
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Acked-by: Tim Deegan <tim@xen.org>
---
v2: dropped one unnecessary const.
---
 xen/include/asm-arm/mm.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index 260af35..e95ece1 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -179,7 +179,7 @@ extern void clear_fixmap(unsigned map);
 #define paddr_to_pdx(pa)    pfn_to_pdx(paddr_to_pfn(pa))
 
 
-static inline paddr_t virt_to_maddr(void *va)
+static inline paddr_t virt_to_maddr(const void *va)
 {
     uint64_t par = va_to_par((uint32_t)va);
     return (par & PADDR_MASK & PAGE_MASK) | ((unsigned long) va & ~PAGE_MASK);
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJGt-0004c2-Re; Tue, 13 Nov 2012 16:23:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJGs-0004ah-22
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:30 +0000
Received: from [85.158.138.51:51716] by server-4.bemta-3.messagelabs.com id
	E5/30-30023-10472A05; Tue, 13 Nov 2012 16:23:29 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1352823806!29850157!3
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23067 invoked from network); 13 Nov 2012 16:23:28 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:28 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="214354946"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:25 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:25 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGm-0000Qd-WC;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:14 +0000
Message-ID: <1352823804-28482-2-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 02/12] arm: create a raw binary target.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is suitable for direct loading by a bootloader.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: Don't strip the .comment section, we don't have one any way.
---
 xen/arch/arm/Makefile |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index bfac017..92a4ccf 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -37,12 +37,16 @@ endif
 
 ALL_OBJS := head.o $(ALL_OBJS)
 
-$(TARGET): $(TARGET)-syms
+$(TARGET): $(TARGET)-syms $(TARGET).bin
 	# XXX: VE model loads by VMA so instead of
 	# making a proper ELF we link with LMA == VMA and adjust crudely
 	$(OBJCOPY) --change-addresses +0x80000000 $< $@
 	$(STRIP) $@
 
+#
+$(TARGET).bin: $(TARGET)-syms
+	objcopy -O binary -S $< $@
+
 #$(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
 #	./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 \
 #	`$(NM) -nr $(TARGET)-syms | head -n 1 | sed -e 's/^\([^ ]*\).*/0x\1/'`
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJGt-0004c2-Re; Tue, 13 Nov 2012 16:23:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJGs-0004ah-22
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:30 +0000
Received: from [85.158.138.51:51716] by server-4.bemta-3.messagelabs.com id
	E5/30-30023-10472A05; Tue, 13 Nov 2012 16:23:29 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1352823806!29850157!3
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23067 invoked from network); 13 Nov 2012 16:23:28 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:28 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="214354946"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:25 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:25 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGm-0000Qd-WC;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:14 +0000
Message-ID: <1352823804-28482-2-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 02/12] arm: create a raw binary target.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is suitable for direct loading by a bootloader.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: Don't strip the .comment section, we don't have one any way.
---
 xen/arch/arm/Makefile |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index bfac017..92a4ccf 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -37,12 +37,16 @@ endif
 
 ALL_OBJS := head.o $(ALL_OBJS)
 
-$(TARGET): $(TARGET)-syms
+$(TARGET): $(TARGET)-syms $(TARGET).bin
 	# XXX: VE model loads by VMA so instead of
 	# making a proper ELF we link with LMA == VMA and adjust crudely
 	$(OBJCOPY) --change-addresses +0x80000000 $< $@
 	$(STRIP) $@
 
+#
+$(TARGET).bin: $(TARGET)-syms
+	objcopy -O binary -S $< $@
+
 #$(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
 #	./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 \
 #	`$(NM) -nr $(TARGET)-syms | head -n 1 | sed -e 's/^\([^ ]*\).*/0x\1/'`
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJGv-0004d9-M6; Tue, 13 Nov 2012 16:23:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJGt-0004bU-F6
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:31 +0000
Received: from [85.158.138.51:31819] by server-10.bemta-3.messagelabs.com id
	14/86-19806-20472A05; Tue, 13 Nov 2012 16:23:30 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1352823806!29850157!5
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23133 invoked from network); 13 Nov 2012 16:23:30 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:30 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="214354948"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:25 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:26 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-B1;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:20 +0000
Message-ID: <1352823804-28482-8-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 08/12] device-tree: get_val cannot cope with
	cells > 2, add a BUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: drop unrelated white space fixup
---
 xen/common/device_tree.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index efd1663..7d3fd9f 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -45,6 +45,8 @@ static void __init get_val(const u32 **cell, u32 cells, u64 *val)
 {
     *val = 0;
 
+    BUG_ON( cells > 2 );
+
     while ( cells-- )
     {
         *val <<= 32;
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJGv-0004d9-M6; Tue, 13 Nov 2012 16:23:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJGt-0004bU-F6
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:31 +0000
Received: from [85.158.138.51:31819] by server-10.bemta-3.messagelabs.com id
	14/86-19806-20472A05; Tue, 13 Nov 2012 16:23:30 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1352823806!29850157!5
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODU4OTM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23133 invoked from network); 13 Nov 2012 16:23:30 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:30 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="214354948"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:25 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:26 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-B1;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:20 +0000
Message-ID: <1352823804-28482-8-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 08/12] device-tree: get_val cannot cope with
	cells > 2, add a BUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: drop unrelated white space fixup
---
 xen/common/device_tree.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index efd1663..7d3fd9f 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -45,6 +45,8 @@ static void __init get_val(const u32 **cell, u32 cells, u64 *val)
 {
     *val = 0;
 
+    BUG_ON( cells > 2 );
+
     while ( cells-- )
     {
         *val <<= 32;
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJHE-0004tE-FD; Tue, 13 Nov 2012 16:23:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJHD-0004r6-CC
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:51 +0000
Received: from [85.158.143.35:50042] by server-3.bemta-4.messagelabs.com id
	F8/7D-06841-71472A05; Tue, 13 Nov 2012 16:23:51 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1352823827!17537935!3
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12696 invoked from network); 13 Nov 2012 16:23:50 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:50 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44437586"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:25 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:25 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-4h;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:17 +0000
Message-ID: <1352823804-28482-5-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 05/12] arm: avoid placing Xen over any modules.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This will still fail if the modules are such that Xen is pushed out of
the top 32M of RAM since it will then overlap with the domheap (or
possibly xenheap). This will be dealt with later.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
---
v2: Xen is module 0, modules start at 1.
---
 xen/arch/arm/setup.c |   68 ++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 61 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index b0b30d6..587b1e7 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -68,17 +68,55 @@ static void __init processor_id(void)
            READ_CP32(ID_ISAR3), READ_CP32(ID_ISAR4), READ_CP32(ID_ISAR5));
 }
 
+/*
+ * Returns the end address of the highest region in the range s..e
+ * with required size and alignment that does not conflict with the
+ * modules from first_mod to nr_modules.
+ *
+ * For non-recursive callers first_mod should normally be 1.
+ */
+static paddr_t __init consider_modules(paddr_t s, paddr_t e,
+                                       uint32_t size, paddr_t align,
+                                       int first_mod)
+{
+    const struct dt_module_info *mi = &early_info.modules;
+    int i;
+
+    s = (s+align-1) & ~(align-1);
+    e = e & ~(align-1);
+
+    if ( s > e ||  e - s < size )
+        return 0;
+
+    for ( i = first_mod; i <= mi->nr_mods; i++ )
+    {
+        paddr_t mod_s = mi->module[i].start;
+        paddr_t mod_e = mod_s + mi->module[i].size;
+
+        if ( s < mod_e && mod_s < e )
+        {
+            mod_e = consider_modules(mod_e, e, size, align, i+1);
+            if ( mod_e )
+                return mod_e;
+
+            return consider_modules(s, mod_s, size, align, i+1);
+        }
+    }
+
+    return e;
+}
+
 /**
  * get_xen_paddr - get physical address to relocate Xen to
  *
- * Xen is relocated to the top of RAM and aligned to a XEN_PADDR_ALIGN
- * boundary.
+ * Xen is relocated to as near to the top of RAM as possible and
+ * aligned to a XEN_PADDR_ALIGN boundary.
  */
 static paddr_t __init get_xen_paddr(void)
 {
     struct dt_mem_info *mi = &early_info.mem;
     paddr_t min_size;
-    paddr_t paddr = 0, t;
+    paddr_t paddr = 0;
     int i;
 
     min_size = (_end - _start + (XEN_PADDR_ALIGN-1)) & ~(XEN_PADDR_ALIGN-1);
@@ -86,17 +124,33 @@ static paddr_t __init get_xen_paddr(void)
     /* Find the highest bank with enough space. */
     for ( i = 0; i < mi->nr_banks; i++ )
     {
-        if ( mi->bank[i].size >= min_size )
+        const struct membank *bank = &mi->bank[i];
+        paddr_t s, e;
+
+        if ( bank->size >= min_size )
         {
-            t = mi->bank[i].start + mi->bank[i].size - min_size;
-            if ( t > paddr )
-                paddr = t;
+            e = consider_modules(bank->start, bank->start + bank->size,
+                                 min_size, XEN_PADDR_ALIGN, 1);
+            if ( !e )
+                continue;
+
+            s = e - min_size;
+
+            if ( s > paddr )
+                paddr = s;
         }
     }
 
     if ( !paddr )
         early_panic("Not enough memory to relocate Xen\n");
 
+    early_printk("Placing Xen at 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
+                 paddr, paddr + min_size);
+
+    /* Xen is module 0 */
+    early_info.modules.module[0].start = paddr;
+    early_info.modules.module[0].size = min_size;
+
     return paddr;
 }
 
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJHE-0004tE-FD; Tue, 13 Nov 2012 16:23:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJHD-0004r6-CC
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:51 +0000
Received: from [85.158.143.35:50042] by server-3.bemta-4.messagelabs.com id
	F8/7D-06841-71472A05; Tue, 13 Nov 2012 16:23:51 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1352823827!17537935!3
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12696 invoked from network); 13 Nov 2012 16:23:50 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:50 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44437586"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:25 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:25 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-4h;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:17 +0000
Message-ID: <1352823804-28482-5-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 05/12] arm: avoid placing Xen over any modules.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This will still fail if the modules are such that Xen is pushed out of
the top 32M of RAM since it will then overlap with the domheap (or
possibly xenheap). This will be dealt with later.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
---
v2: Xen is module 0, modules start at 1.
---
 xen/arch/arm/setup.c |   68 ++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 61 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index b0b30d6..587b1e7 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -68,17 +68,55 @@ static void __init processor_id(void)
            READ_CP32(ID_ISAR3), READ_CP32(ID_ISAR4), READ_CP32(ID_ISAR5));
 }
 
+/*
+ * Returns the end address of the highest region in the range s..e
+ * with required size and alignment that does not conflict with the
+ * modules from first_mod to nr_modules.
+ *
+ * For non-recursive callers first_mod should normally be 1.
+ */
+static paddr_t __init consider_modules(paddr_t s, paddr_t e,
+                                       uint32_t size, paddr_t align,
+                                       int first_mod)
+{
+    const struct dt_module_info *mi = &early_info.modules;
+    int i;
+
+    s = (s+align-1) & ~(align-1);
+    e = e & ~(align-1);
+
+    if ( s > e ||  e - s < size )
+        return 0;
+
+    for ( i = first_mod; i <= mi->nr_mods; i++ )
+    {
+        paddr_t mod_s = mi->module[i].start;
+        paddr_t mod_e = mod_s + mi->module[i].size;
+
+        if ( s < mod_e && mod_s < e )
+        {
+            mod_e = consider_modules(mod_e, e, size, align, i+1);
+            if ( mod_e )
+                return mod_e;
+
+            return consider_modules(s, mod_s, size, align, i+1);
+        }
+    }
+
+    return e;
+}
+
 /**
  * get_xen_paddr - get physical address to relocate Xen to
  *
- * Xen is relocated to the top of RAM and aligned to a XEN_PADDR_ALIGN
- * boundary.
+ * Xen is relocated to as near to the top of RAM as possible and
+ * aligned to a XEN_PADDR_ALIGN boundary.
  */
 static paddr_t __init get_xen_paddr(void)
 {
     struct dt_mem_info *mi = &early_info.mem;
     paddr_t min_size;
-    paddr_t paddr = 0, t;
+    paddr_t paddr = 0;
     int i;
 
     min_size = (_end - _start + (XEN_PADDR_ALIGN-1)) & ~(XEN_PADDR_ALIGN-1);
@@ -86,17 +124,33 @@ static paddr_t __init get_xen_paddr(void)
     /* Find the highest bank with enough space. */
     for ( i = 0; i < mi->nr_banks; i++ )
     {
-        if ( mi->bank[i].size >= min_size )
+        const struct membank *bank = &mi->bank[i];
+        paddr_t s, e;
+
+        if ( bank->size >= min_size )
         {
-            t = mi->bank[i].start + mi->bank[i].size - min_size;
-            if ( t > paddr )
-                paddr = t;
+            e = consider_modules(bank->start, bank->start + bank->size,
+                                 min_size, XEN_PADDR_ALIGN, 1);
+            if ( !e )
+                continue;
+
+            s = e - min_size;
+
+            if ( s > paddr )
+                paddr = s;
         }
     }
 
     if ( !paddr )
         early_panic("Not enough memory to relocate Xen\n");
 
+    early_printk("Placing Xen at 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
+                 paddr, paddr + min_size);
+
+    /* Xen is module 0 */
+    early_info.modules.module[0].start = paddr;
+    early_info.modules.module[0].size = min_size;
+
     return paddr;
 }
 
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJHD-0004sJ-FI; Tue, 13 Nov 2012 16:23:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJHC-0004r6-BG
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:50 +0000
Received: from [85.158.143.35:12030] by server-3.bemta-4.messagelabs.com id
	08/6D-06841-51472A05; Tue, 13 Nov 2012 16:23:49 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1352823827!17537935!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12440 invoked from network); 13 Nov 2012 16:23:48 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:48 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44437584"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:25 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:25 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-2A;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:16 +0000
Message-ID: <1352823804-28482-4-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 04/12] arm: parse modules from DT during early
	boot.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The bootloader should populate /chosen/module@<N>/ for each module it
wishes to pass to the hypervisor. The content of these nodes is
described in docs/misc/arm/device-tree/booting.txt

The hypervisor allows for 2 modules (@1==kernel and @2==initrd).
Currently we don't do anything with them.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: Reserve the zeroeth module for Xen itself (not used yet)
    Use a more idiomatic DT layout
    Document said layout
---
 docs/misc/arm/device-tree/booting.txt |   27 ++++++++++++
 xen/common/device_tree.c              |   75 +++++++++++++++++++++++++++++++++
 xen/include/xen/device_tree.h         |   14 ++++++
 3 files changed, 116 insertions(+), 0 deletions(-)
 create mode 100644 docs/misc/arm/device-tree/booting.txt

diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt
new file mode 100644
index 0000000..2609450
--- /dev/null
+++ b/docs/misc/arm/device-tree/booting.txt
@@ -0,0 +1,27 @@
+Xen is passed the dom0 kernel and initrd via a reference in the /chosen
+node of the device tree.
+
+Each node has the form /chosen/module@<N> and contains the following
+properties:
+
+- compatible
+
+	Must be "xen,multiboot-module"
+
+- start
+
+	Physical address of the start of this module
+
+- end
+
+	Physical address of the end of this module
+
+- bootargs (optional)
+
+	Command line associated with this module
+
+The following modules are understood
+
+- 1 -- the domain 0 kernel
+- 2 -- the domain 0 ramdisk
+
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 3d1f0f4..efd1663 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -229,6 +229,79 @@ static void __init process_memory_node(const void *fdt, int node,
     }
 }
 
+static void __init process_chosen_node(const void *fdt, int node,
+                                       const char *name,
+                                       u32 address_cells, u32 size_cells)
+{
+    const struct fdt_property *prop;
+    const u32 *cell;
+    paddr_t size;
+    int nr, depth, nr_modules = 0;
+    struct dt_mb_module *mod;
+    int len;
+
+    for ( depth = 0;
+          depth >= 0;
+          node = fdt_next_node(fdt, node, &depth) )
+    {
+        name = fdt_get_name(fdt, node, NULL);
+        if ( strncmp(name, "module@", strlen("module@")) == 0 ) {
+
+            if ( fdt_node_check_compatible(fdt, node,
+                                           "xen,multiboot-module" ) != 0 )
+                early_panic("%s not a compatible module node\n", name);
+
+            nr = simple_strtol(name + strlen("module@"), NULL, 10);
+            if ( nr <= 0 )
+                early_panic("Invalid module number %d\n", nr);
+
+            if ( nr > NR_MODULES )
+                early_panic("too many modules %d > %d\n", nr, NR_MODULES);
+            if ( nr > nr_modules )
+                nr_modules = nr;
+
+            mod = &early_info.modules.module[nr];
+
+            prop = fdt_get_property(fdt, node, "start", NULL);
+            if ( !prop )
+                early_panic("no start for module %d\n", nr);
+
+            cell = (const u32 *)prop->data;
+            device_tree_get_reg(&cell, address_cells, size_cells,
+                                &mod->start, &size);
+
+            prop = fdt_get_property(fdt, node, "end", NULL);
+            if ( !prop )
+                early_panic("no end for module %d\n", nr);
+
+            cell = (const u32 *)prop->data;
+            device_tree_get_reg(&cell, address_cells, size_cells,
+                                &mod->size, &size);
+            mod->size -= mod->start;
+
+            prop = fdt_get_property(fdt, node, "bootargs", &len);
+            if ( prop )
+            {
+                if ( len > sizeof(mod->cmdline) )
+                    early_panic("module %d command line too long\n", nr);
+
+                safe_strcpy(mod->cmdline, prop->data);
+            }
+            else
+                mod->cmdline[0] = 0;
+        }
+    }
+
+    for ( nr = 1 ; nr < nr_modules ; nr++ )
+    {
+        mod = &early_info.modules.module[nr];
+        if ( !mod->start || !mod->size )
+            early_panic("module %d  missing / invalid\n", nr);
+    }
+
+    early_info.modules.nr_mods = nr_modules;
+}
+
 static int __init early_scan_node(const void *fdt,
                                   int node, const char *name, int depth,
                                   u32 address_cells, u32 size_cells,
@@ -236,6 +309,8 @@ static int __init early_scan_node(const void *fdt,
 {
     if ( device_tree_node_matches(fdt, node, "memory") )
         process_memory_node(fdt, node, name, address_cells, size_cells);
+    else if ( device_tree_node_matches(fdt, node, "chosen") )
+        process_chosen_node(fdt, node, name, address_cells, size_cells);
 
     return 0;
 }
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 4d010c0..c383677 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -15,6 +15,7 @@
 #define DEVICE_TREE_MAX_DEPTH 16
 
 #define NR_MEM_BANKS 8
+#define NR_MODULES 2
 
 struct membank {
     paddr_t start;
@@ -26,8 +27,21 @@ struct dt_mem_info {
     struct membank bank[NR_MEM_BANKS];
 };
 
+struct dt_mb_module {
+    paddr_t start;
+    paddr_t size;
+    char cmdline[1024];
+};
+
+struct dt_module_info {
+    int nr_mods;
+    /* Module 0 is Xen itself, followed by the provided modules-proper */
+    struct dt_mb_module module[NR_MODULES + 1];
+};
+
 struct dt_early_info {
     struct dt_mem_info mem;
+    struct dt_module_info modules;
 };
 
 typedef int (*device_tree_node_func)(const void *fdt,
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJHD-0004sJ-FI; Tue, 13 Nov 2012 16:23:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJHC-0004r6-BG
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:50 +0000
Received: from [85.158.143.35:12030] by server-3.bemta-4.messagelabs.com id
	08/6D-06841-51472A05; Tue, 13 Nov 2012 16:23:49 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1352823827!17537935!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12440 invoked from network); 13 Nov 2012 16:23:48 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:48 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44437584"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:25 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:25 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-2A;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:16 +0000
Message-ID: <1352823804-28482-4-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 04/12] arm: parse modules from DT during early
	boot.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The bootloader should populate /chosen/module@<N>/ for each module it
wishes to pass to the hypervisor. The content of these nodes is
described in docs/misc/arm/device-tree/booting.txt

The hypervisor allows for 2 modules (@1==kernel and @2==initrd).
Currently we don't do anything with them.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: Reserve the zeroeth module for Xen itself (not used yet)
    Use a more idiomatic DT layout
    Document said layout
---
 docs/misc/arm/device-tree/booting.txt |   27 ++++++++++++
 xen/common/device_tree.c              |   75 +++++++++++++++++++++++++++++++++
 xen/include/xen/device_tree.h         |   14 ++++++
 3 files changed, 116 insertions(+), 0 deletions(-)
 create mode 100644 docs/misc/arm/device-tree/booting.txt

diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt
new file mode 100644
index 0000000..2609450
--- /dev/null
+++ b/docs/misc/arm/device-tree/booting.txt
@@ -0,0 +1,27 @@
+Xen is passed the dom0 kernel and initrd via a reference in the /chosen
+node of the device tree.
+
+Each node has the form /chosen/module@<N> and contains the following
+properties:
+
+- compatible
+
+	Must be "xen,multiboot-module"
+
+- start
+
+	Physical address of the start of this module
+
+- end
+
+	Physical address of the end of this module
+
+- bootargs (optional)
+
+	Command line associated with this module
+
+The following modules are understood
+
+- 1 -- the domain 0 kernel
+- 2 -- the domain 0 ramdisk
+
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 3d1f0f4..efd1663 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -229,6 +229,79 @@ static void __init process_memory_node(const void *fdt, int node,
     }
 }
 
+static void __init process_chosen_node(const void *fdt, int node,
+                                       const char *name,
+                                       u32 address_cells, u32 size_cells)
+{
+    const struct fdt_property *prop;
+    const u32 *cell;
+    paddr_t size;
+    int nr, depth, nr_modules = 0;
+    struct dt_mb_module *mod;
+    int len;
+
+    for ( depth = 0;
+          depth >= 0;
+          node = fdt_next_node(fdt, node, &depth) )
+    {
+        name = fdt_get_name(fdt, node, NULL);
+        if ( strncmp(name, "module@", strlen("module@")) == 0 ) {
+
+            if ( fdt_node_check_compatible(fdt, node,
+                                           "xen,multiboot-module" ) != 0 )
+                early_panic("%s not a compatible module node\n", name);
+
+            nr = simple_strtol(name + strlen("module@"), NULL, 10);
+            if ( nr <= 0 )
+                early_panic("Invalid module number %d\n", nr);
+
+            if ( nr > NR_MODULES )
+                early_panic("too many modules %d > %d\n", nr, NR_MODULES);
+            if ( nr > nr_modules )
+                nr_modules = nr;
+
+            mod = &early_info.modules.module[nr];
+
+            prop = fdt_get_property(fdt, node, "start", NULL);
+            if ( !prop )
+                early_panic("no start for module %d\n", nr);
+
+            cell = (const u32 *)prop->data;
+            device_tree_get_reg(&cell, address_cells, size_cells,
+                                &mod->start, &size);
+
+            prop = fdt_get_property(fdt, node, "end", NULL);
+            if ( !prop )
+                early_panic("no end for module %d\n", nr);
+
+            cell = (const u32 *)prop->data;
+            device_tree_get_reg(&cell, address_cells, size_cells,
+                                &mod->size, &size);
+            mod->size -= mod->start;
+
+            prop = fdt_get_property(fdt, node, "bootargs", &len);
+            if ( prop )
+            {
+                if ( len > sizeof(mod->cmdline) )
+                    early_panic("module %d command line too long\n", nr);
+
+                safe_strcpy(mod->cmdline, prop->data);
+            }
+            else
+                mod->cmdline[0] = 0;
+        }
+    }
+
+    for ( nr = 1 ; nr < nr_modules ; nr++ )
+    {
+        mod = &early_info.modules.module[nr];
+        if ( !mod->start || !mod->size )
+            early_panic("module %d  missing / invalid\n", nr);
+    }
+
+    early_info.modules.nr_mods = nr_modules;
+}
+
 static int __init early_scan_node(const void *fdt,
                                   int node, const char *name, int depth,
                                   u32 address_cells, u32 size_cells,
@@ -236,6 +309,8 @@ static int __init early_scan_node(const void *fdt,
 {
     if ( device_tree_node_matches(fdt, node, "memory") )
         process_memory_node(fdt, node, name, address_cells, size_cells);
+    else if ( device_tree_node_matches(fdt, node, "chosen") )
+        process_chosen_node(fdt, node, name, address_cells, size_cells);
 
     return 0;
 }
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 4d010c0..c383677 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -15,6 +15,7 @@
 #define DEVICE_TREE_MAX_DEPTH 16
 
 #define NR_MEM_BANKS 8
+#define NR_MODULES 2
 
 struct membank {
     paddr_t start;
@@ -26,8 +27,21 @@ struct dt_mem_info {
     struct membank bank[NR_MEM_BANKS];
 };
 
+struct dt_mb_module {
+    paddr_t start;
+    paddr_t size;
+    char cmdline[1024];
+};
+
+struct dt_module_info {
+    int nr_mods;
+    /* Module 0 is Xen itself, followed by the provided modules-proper */
+    struct dt_mb_module module[NR_MODULES + 1];
+};
+
 struct dt_early_info {
     struct dt_mem_info mem;
+    struct dt_module_info modules;
 };
 
 typedef int (*device_tree_node_func)(const void *fdt,
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJHE-0004sw-2B; Tue, 13 Nov 2012 16:23:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJHC-0004r6-TB
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:51 +0000
Received: from [85.158.143.35:12100] by server-3.bemta-4.messagelabs.com id
	FD/6D-06841-61472A05; Tue, 13 Nov 2012 16:23:50 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1352823827!17537935!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12588 invoked from network); 13 Nov 2012 16:23:49 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:49 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44437585"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:25 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:26 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-78;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:18 +0000
Message-ID: <1352823804-28482-6-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 06/12] arm: avoid allocating the heaps over
	modules or xen itself.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/setup.c |   89 +++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 78 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 587b1e7..04d16a1 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -73,7 +73,8 @@ static void __init processor_id(void)
  * with required size and alignment that does not conflict with the
  * modules from first_mod to nr_modules.
  *
- * For non-recursive callers first_mod should normally be 1.
+ * For non-recursive callers first_mod should normally be 0 (all
+ * modules and Xen itself) or 1 (all modules but not Xen).
  */
 static paddr_t __init consider_modules(paddr_t s, paddr_t e,
                                        uint32_t size, paddr_t align,
@@ -106,6 +107,34 @@ static paddr_t __init consider_modules(paddr_t s, paddr_t e,
     return e;
 }
 
+/*
+ * Return the end of the non-module region starting at s. In other
+ * words return s the start of the next modules after s.
+ *
+ * Also returns the end of that module in *n.
+ */
+static paddr_t __init next_module(paddr_t s, paddr_t *n)
+{
+    struct dt_module_info *mi = &early_info.modules;
+    paddr_t lowest = ~(paddr_t)0;
+    int i;
+
+    for ( i = 0; i <= mi->nr_mods; i++ )
+    {
+        paddr_t mod_s = mi->module[i].start;
+        paddr_t mod_e = mod_s + mi->module[i].size;
+
+        if ( mod_s < s )
+            continue;
+        if ( mod_s > lowest )
+            continue;
+        lowest = mod_s;
+        *n = mod_e;
+    }
+    return lowest;
+}
+
+
 /**
  * get_xen_paddr - get physical address to relocate Xen to
  *
@@ -159,6 +188,7 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
     paddr_t ram_start;
     paddr_t ram_end;
     paddr_t ram_size;
+    paddr_t s, e;
     unsigned long ram_pages;
     unsigned long heap_pages, xenheap_pages, domheap_pages;
     unsigned long dtb_pages;
@@ -176,22 +206,37 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
     ram_pages = ram_size >> PAGE_SHIFT;
 
     /*
-     * Calculate the sizes for the heaps using these constraints:
+     * Locate the xenheap using these constraints:
      *
-     *  - heaps must be 32 MiB aligned
-     *  - must not include Xen itself
-     *  - xen heap must be at most 1 GiB
+     *  - must be 32 MiB aligned
+     *  - must not include Xen itself or the boot modules
+     *  - must be at most 1 GiB
+     *  - must be at least 128M
      *
-     * XXX: needs a platform with at least 1GiB of RAM or the dom
-     * heap will be empty and no domains can be created.
+     * We try to allocate the largest xenheap possible within these
+     * constraints.
      */
-    heap_pages = (ram_size >> PAGE_SHIFT) - (32 << (20 - PAGE_SHIFT));
+    heap_pages = (ram_size >> PAGE_SHIFT);
     xenheap_pages = min(1ul << (30 - PAGE_SHIFT), heap_pages);
+
+    do
+    {
+        e = consider_modules(ram_start, ram_end, xenheap_pages<<PAGE_SHIFT,
+                             32<<20, 0);
+        if ( e )
+            break;
+
+        xenheap_pages >>= 1;
+    } while ( xenheap_pages > 128<<(20-PAGE_SHIFT) );
+
+    if ( ! e )
+        panic("Not not enough space for xenheap\n");
+
     domheap_pages = heap_pages - xenheap_pages;
 
     printk("Xen heap: %lu pages  Dom heap: %lu pages\n", xenheap_pages, domheap_pages);
 
-    setup_xenheap_mappings(ram_start >> PAGE_SHIFT, xenheap_pages);
+    setup_xenheap_mappings((e >> PAGE_SHIFT) - xenheap_pages, xenheap_pages);
 
     /*
      * Need a single mapped page for populating bootmem_region_list
@@ -215,8 +260,30 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
     copy_from_paddr(device_tree_flattened, dtb_paddr, dtb_size, BUFFERABLE);
 
     /* Add non-xenheap memory */
-    init_boot_pages(pfn_to_paddr(xenheap_mfn_start + xenheap_pages),
-                    pfn_to_paddr(xenheap_mfn_start + xenheap_pages + domheap_pages));
+    s = ram_start;
+    while ( s < ram_end )
+    {
+        paddr_t n = ram_end;
+
+        e = next_module(s, &n);
+
+        if ( e == ~(paddr_t)0 )
+        {
+            e = n = ram_end;
+        }
+
+        /* Avoid the xenheap */
+        if ( s < ((xenheap_mfn_start+xenheap_pages) << PAGE_SHIFT)
+             && (xenheap_mfn_start << PAGE_SHIFT) < e )
+        {
+            e = pfn_to_paddr(xenheap_mfn_start);
+            n = pfn_to_paddr(xenheap_mfn_start+xenheap_pages);
+        }
+
+        init_boot_pages(s, e);
+
+        s = n;
+    }
 
     setup_frametable_mappings(ram_start, ram_end);
     max_page = PFN_DOWN(ram_end);
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJHE-0004sw-2B; Tue, 13 Nov 2012 16:23:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJHC-0004r6-TB
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:51 +0000
Received: from [85.158.143.35:12100] by server-3.bemta-4.messagelabs.com id
	FD/6D-06841-61472A05; Tue, 13 Nov 2012 16:23:50 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1352823827!17537935!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12588 invoked from network); 13 Nov 2012 16:23:49 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:49 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44437585"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:25 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:26 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-78;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:18 +0000
Message-ID: <1352823804-28482-6-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 06/12] arm: avoid allocating the heaps over
	modules or xen itself.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/setup.c |   89 +++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 78 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 587b1e7..04d16a1 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -73,7 +73,8 @@ static void __init processor_id(void)
  * with required size and alignment that does not conflict with the
  * modules from first_mod to nr_modules.
  *
- * For non-recursive callers first_mod should normally be 1.
+ * For non-recursive callers first_mod should normally be 0 (all
+ * modules and Xen itself) or 1 (all modules but not Xen).
  */
 static paddr_t __init consider_modules(paddr_t s, paddr_t e,
                                        uint32_t size, paddr_t align,
@@ -106,6 +107,34 @@ static paddr_t __init consider_modules(paddr_t s, paddr_t e,
     return e;
 }
 
+/*
+ * Return the end of the non-module region starting at s. In other
+ * words return s the start of the next modules after s.
+ *
+ * Also returns the end of that module in *n.
+ */
+static paddr_t __init next_module(paddr_t s, paddr_t *n)
+{
+    struct dt_module_info *mi = &early_info.modules;
+    paddr_t lowest = ~(paddr_t)0;
+    int i;
+
+    for ( i = 0; i <= mi->nr_mods; i++ )
+    {
+        paddr_t mod_s = mi->module[i].start;
+        paddr_t mod_e = mod_s + mi->module[i].size;
+
+        if ( mod_s < s )
+            continue;
+        if ( mod_s > lowest )
+            continue;
+        lowest = mod_s;
+        *n = mod_e;
+    }
+    return lowest;
+}
+
+
 /**
  * get_xen_paddr - get physical address to relocate Xen to
  *
@@ -159,6 +188,7 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
     paddr_t ram_start;
     paddr_t ram_end;
     paddr_t ram_size;
+    paddr_t s, e;
     unsigned long ram_pages;
     unsigned long heap_pages, xenheap_pages, domheap_pages;
     unsigned long dtb_pages;
@@ -176,22 +206,37 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
     ram_pages = ram_size >> PAGE_SHIFT;
 
     /*
-     * Calculate the sizes for the heaps using these constraints:
+     * Locate the xenheap using these constraints:
      *
-     *  - heaps must be 32 MiB aligned
-     *  - must not include Xen itself
-     *  - xen heap must be at most 1 GiB
+     *  - must be 32 MiB aligned
+     *  - must not include Xen itself or the boot modules
+     *  - must be at most 1 GiB
+     *  - must be at least 128M
      *
-     * XXX: needs a platform with at least 1GiB of RAM or the dom
-     * heap will be empty and no domains can be created.
+     * We try to allocate the largest xenheap possible within these
+     * constraints.
      */
-    heap_pages = (ram_size >> PAGE_SHIFT) - (32 << (20 - PAGE_SHIFT));
+    heap_pages = (ram_size >> PAGE_SHIFT);
     xenheap_pages = min(1ul << (30 - PAGE_SHIFT), heap_pages);
+
+    do
+    {
+        e = consider_modules(ram_start, ram_end, xenheap_pages<<PAGE_SHIFT,
+                             32<<20, 0);
+        if ( e )
+            break;
+
+        xenheap_pages >>= 1;
+    } while ( xenheap_pages > 128<<(20-PAGE_SHIFT) );
+
+    if ( ! e )
+        panic("Not not enough space for xenheap\n");
+
     domheap_pages = heap_pages - xenheap_pages;
 
     printk("Xen heap: %lu pages  Dom heap: %lu pages\n", xenheap_pages, domheap_pages);
 
-    setup_xenheap_mappings(ram_start >> PAGE_SHIFT, xenheap_pages);
+    setup_xenheap_mappings((e >> PAGE_SHIFT) - xenheap_pages, xenheap_pages);
 
     /*
      * Need a single mapped page for populating bootmem_region_list
@@ -215,8 +260,30 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
     copy_from_paddr(device_tree_flattened, dtb_paddr, dtb_size, BUFFERABLE);
 
     /* Add non-xenheap memory */
-    init_boot_pages(pfn_to_paddr(xenheap_mfn_start + xenheap_pages),
-                    pfn_to_paddr(xenheap_mfn_start + xenheap_pages + domheap_pages));
+    s = ram_start;
+    while ( s < ram_end )
+    {
+        paddr_t n = ram_end;
+
+        e = next_module(s, &n);
+
+        if ( e == ~(paddr_t)0 )
+        {
+            e = n = ram_end;
+        }
+
+        /* Avoid the xenheap */
+        if ( s < ((xenheap_mfn_start+xenheap_pages) << PAGE_SHIFT)
+             && (xenheap_mfn_start << PAGE_SHIFT) < e )
+        {
+            e = pfn_to_paddr(xenheap_mfn_start);
+            n = pfn_to_paddr(xenheap_mfn_start+xenheap_pages);
+        }
+
+        init_boot_pages(s, e);
+
+        s = n;
+    }
 
     setup_frametable_mappings(ram_start, ram_end);
     max_page = PFN_DOWN(ram_end);
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJHG-0004vm-RV; Tue, 13 Nov 2012 16:23:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJHE-0004tH-WE
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:53 +0000
Received: from [85.158.139.83:43969] by server-14.bemta-5.messagelabs.com id
	A2/19-21768-81472A05; Tue, 13 Nov 2012 16:23:52 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1352823829!29549126!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20228 invoked from network); 13 Nov 2012 16:23:50 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-13.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:50 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44437590"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:26 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:26 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-DR;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:21 +0000
Message-ID: <1352823804-28482-9-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 09/12] arm: load dom0 kernel from first boot
	module
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/kernel.c |   74 +++++++++++++++++++++++++++++++++++++-----------
 xen/arch/arm/kernel.h |   10 ++++++
 2 files changed, 67 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 2d56130..7fb6268 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -65,13 +65,13 @@ void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len, int attrindx)
 static void kernel_zimage_load(struct kernel_info *info)
 {
     paddr_t load_addr = info->zimage.load_addr;
+    paddr_t paddr = info->zimage.kernel_addr;
     paddr_t len = info->zimage.len;
-    paddr_t flash = KERNEL_FLASH_ADDRESS;
     void *src = (void *)FIXMAP_ADDR(FIXMAP_MISC);
     unsigned long offs;
 
-    printk("Loading %"PRIpaddr" byte zImage from flash %"PRIpaddr" to %"PRIpaddr"-%"PRIpaddr": [",
-           len, flash, load_addr, load_addr + len);
+    printk("Loading zImage from %"PRIpaddr" to %"PRIpaddr"-%"PRIpaddr": [",
+           paddr, load_addr, load_addr + len);
     for ( offs = 0; offs < len; offs += PAGE_SIZE )
     {
         paddr_t ma = gvirt_to_maddr(load_addr + offs);
@@ -80,7 +80,7 @@ static void kernel_zimage_load(struct kernel_info *info)
         if ( ( offs % (1<<20) ) == 0 )
             printk(".");
 
-        set_fixmap(FIXMAP_MISC, (flash+offs) >> PAGE_SHIFT, DEV_SHARED);
+        set_fixmap(FIXMAP_MISC, (paddr+offs) >> PAGE_SHIFT, DEV_SHARED);
         memcpy(dst, src, PAGE_SIZE);
         clear_fixmap(FIXMAP_MISC);
 
@@ -92,30 +92,48 @@ static void kernel_zimage_load(struct kernel_info *info)
 /**
  * Check the image is a zImage and return the load address and length
  */
-static int kernel_try_zimage_prepare(struct kernel_info *info)
+static int kernel_try_zimage_prepare(struct kernel_info *info,
+                                     paddr_t addr, paddr_t size)
 {
     uint32_t *zimage = (void *)FIXMAP_ADDR(FIXMAP_MISC);
     uint32_t start, end;
     struct minimal_dtb_header dtb_hdr;
 
-    set_fixmap(FIXMAP_MISC, KERNEL_FLASH_ADDRESS >> PAGE_SHIFT, DEV_SHARED);
+    set_fixmap(FIXMAP_MISC, addr >> PAGE_SHIFT, DEV_SHARED);
+
+    zimage += addr & ~PAGE_MASK;
 
     if (zimage[ZIMAGE_MAGIC_OFFSET/4] != ZIMAGE_MAGIC)
+    {
+        clear_fixmap(FIXMAP_MISC);
         return -EINVAL;
+    }
 
     start = zimage[ZIMAGE_START_OFFSET/4];
     end = zimage[ZIMAGE_END_OFFSET/4];
 
     clear_fixmap(FIXMAP_MISC);
 
+    if ( end > addr + size )
+        return -EINVAL;
+
     /*
      * Check for an appended DTB.
      */
-    copy_from_paddr(&dtb_hdr, KERNEL_FLASH_ADDRESS + end - start, sizeof(dtb_hdr), DEV_SHARED);
-    if (be32_to_cpu(dtb_hdr.magic) == DTB_MAGIC) {
-        end += be32_to_cpu(dtb_hdr.total_size);
+    if ( addr + end - start + sizeof(dtb_hdr) <= size )
+    {
+        copy_from_paddr(&dtb_hdr, addr + end - start,
+                        sizeof(dtb_hdr), DEV_SHARED);
+        if (be32_to_cpu(dtb_hdr.magic) == DTB_MAGIC) {
+            end += be32_to_cpu(dtb_hdr.total_size);
+
+            if ( end > addr + size )
+                return -EINVAL;
+        }
     }
 
+    info->zimage.kernel_addr = addr;
+
     /*
      * If start is zero, the zImage is position independent -- load it
      * at 32k from start of RAM.
@@ -142,25 +160,26 @@ static void kernel_elf_load(struct kernel_info *info)
     free_xenheap_pages(info->kernel_img, info->kernel_order);
 }
 
-static int kernel_try_elf_prepare(struct kernel_info *info)
+static int kernel_try_elf_prepare(struct kernel_info *info,
+                                  paddr_t addr, paddr_t size)
 {
     int rc;
 
-    info->kernel_order = get_order_from_bytes(KERNEL_FLASH_SIZE);
+    info->kernel_order = get_order_from_bytes(size);
     info->kernel_img = alloc_xenheap_pages(info->kernel_order, 0);
     if ( info->kernel_img == NULL )
         panic("Cannot allocate temporary buffer for kernel.\n");
 
-    copy_from_paddr(info->kernel_img, KERNEL_FLASH_ADDRESS, KERNEL_FLASH_SIZE, DEV_SHARED);
+    copy_from_paddr(info->kernel_img, addr, size, DEV_SHARED);
 
-    if ( (rc = elf_init(&info->elf.elf, info->kernel_img, KERNEL_FLASH_SIZE )) != 0 )
-        return rc;
+    if ( (rc = elf_init(&info->elf.elf, info->kernel_img, size )) != 0 )
+        goto err;
 #ifdef VERBOSE
     elf_set_verbose(&info->elf.elf);
 #endif
     elf_parse_binary(&info->elf.elf);
     if ( (rc = elf_xen_parse(&info->elf.elf, &info->elf.parms)) != 0 )
-        return rc;
+        goto err;
 
     /*
      * TODO: can the ELF header be used to find the physical address
@@ -170,15 +189,36 @@ static int kernel_try_elf_prepare(struct kernel_info *info)
     info->load = kernel_elf_load;
 
     return 0;
+err:
+    free_xenheap_pages(info->kernel_img, info->kernel_order);
+    return rc;
 }
 
 int kernel_prepare(struct kernel_info *info)
 {
     int rc;
 
-    rc = kernel_try_zimage_prepare(info);
+    paddr_t start, size;
+
+    if ( early_info.modules.nr_mods > 1 )
+        panic("Cannot handle dom0 initrd yet\n");
+
+    if ( early_info.modules.nr_mods < 1 )
+    {
+        printk("No boot modules found, trying flash\n");
+        start = KERNEL_FLASH_ADDRESS;
+        size = KERNEL_FLASH_SIZE;
+    }
+    else
+    {
+        printk("Loading kernel from boot module 1\n");
+        start = early_info.modules.module[1].start;
+        size = early_info.modules.module[1].size;
+    }
+
+    rc = kernel_try_zimage_prepare(info, start, size);
     if (rc < 0)
-        rc = kernel_try_elf_prepare(info);
+        rc = kernel_try_elf_prepare(info, start, size);
 
     return rc;
 }
diff --git a/xen/arch/arm/kernel.h b/xen/arch/arm/kernel.h
index 4533568..2353e13 100644
--- a/xen/arch/arm/kernel.h
+++ b/xen/arch/arm/kernel.h
@@ -22,6 +22,7 @@ struct kernel_info {
 
     union {
         struct {
+            paddr_t kernel_addr;
             paddr_t load_addr;
             paddr_t len;
         } zimage;
@@ -39,3 +40,12 @@ int kernel_prepare(struct kernel_info *info);
 void kernel_load(struct kernel_info *info);
 
 #endif /* #ifdef __ARCH_ARM_KERNEL_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:23:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:23:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJHG-0004vm-RV; Tue, 13 Nov 2012 16:23:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJHE-0004tH-WE
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:23:53 +0000
Received: from [85.158.139.83:43969] by server-14.bemta-5.messagelabs.com id
	A2/19-21768-81472A05; Tue, 13 Nov 2012 16:23:52 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1352823829!29549126!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20228 invoked from network); 13 Nov 2012 16:23:50 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-13.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:50 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="44437590"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:26 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:23:26 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-DR;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:21 +0000
Message-ID: <1352823804-28482-9-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 09/12] arm: load dom0 kernel from first boot
	module
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/kernel.c |   74 +++++++++++++++++++++++++++++++++++++-----------
 xen/arch/arm/kernel.h |   10 ++++++
 2 files changed, 67 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 2d56130..7fb6268 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -65,13 +65,13 @@ void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len, int attrindx)
 static void kernel_zimage_load(struct kernel_info *info)
 {
     paddr_t load_addr = info->zimage.load_addr;
+    paddr_t paddr = info->zimage.kernel_addr;
     paddr_t len = info->zimage.len;
-    paddr_t flash = KERNEL_FLASH_ADDRESS;
     void *src = (void *)FIXMAP_ADDR(FIXMAP_MISC);
     unsigned long offs;
 
-    printk("Loading %"PRIpaddr" byte zImage from flash %"PRIpaddr" to %"PRIpaddr"-%"PRIpaddr": [",
-           len, flash, load_addr, load_addr + len);
+    printk("Loading zImage from %"PRIpaddr" to %"PRIpaddr"-%"PRIpaddr": [",
+           paddr, load_addr, load_addr + len);
     for ( offs = 0; offs < len; offs += PAGE_SIZE )
     {
         paddr_t ma = gvirt_to_maddr(load_addr + offs);
@@ -80,7 +80,7 @@ static void kernel_zimage_load(struct kernel_info *info)
         if ( ( offs % (1<<20) ) == 0 )
             printk(".");
 
-        set_fixmap(FIXMAP_MISC, (flash+offs) >> PAGE_SHIFT, DEV_SHARED);
+        set_fixmap(FIXMAP_MISC, (paddr+offs) >> PAGE_SHIFT, DEV_SHARED);
         memcpy(dst, src, PAGE_SIZE);
         clear_fixmap(FIXMAP_MISC);
 
@@ -92,30 +92,48 @@ static void kernel_zimage_load(struct kernel_info *info)
 /**
  * Check the image is a zImage and return the load address and length
  */
-static int kernel_try_zimage_prepare(struct kernel_info *info)
+static int kernel_try_zimage_prepare(struct kernel_info *info,
+                                     paddr_t addr, paddr_t size)
 {
     uint32_t *zimage = (void *)FIXMAP_ADDR(FIXMAP_MISC);
     uint32_t start, end;
     struct minimal_dtb_header dtb_hdr;
 
-    set_fixmap(FIXMAP_MISC, KERNEL_FLASH_ADDRESS >> PAGE_SHIFT, DEV_SHARED);
+    set_fixmap(FIXMAP_MISC, addr >> PAGE_SHIFT, DEV_SHARED);
+
+    zimage += addr & ~PAGE_MASK;
 
     if (zimage[ZIMAGE_MAGIC_OFFSET/4] != ZIMAGE_MAGIC)
+    {
+        clear_fixmap(FIXMAP_MISC);
         return -EINVAL;
+    }
 
     start = zimage[ZIMAGE_START_OFFSET/4];
     end = zimage[ZIMAGE_END_OFFSET/4];
 
     clear_fixmap(FIXMAP_MISC);
 
+    if ( end > addr + size )
+        return -EINVAL;
+
     /*
      * Check for an appended DTB.
      */
-    copy_from_paddr(&dtb_hdr, KERNEL_FLASH_ADDRESS + end - start, sizeof(dtb_hdr), DEV_SHARED);
-    if (be32_to_cpu(dtb_hdr.magic) == DTB_MAGIC) {
-        end += be32_to_cpu(dtb_hdr.total_size);
+    if ( addr + end - start + sizeof(dtb_hdr) <= size )
+    {
+        copy_from_paddr(&dtb_hdr, addr + end - start,
+                        sizeof(dtb_hdr), DEV_SHARED);
+        if (be32_to_cpu(dtb_hdr.magic) == DTB_MAGIC) {
+            end += be32_to_cpu(dtb_hdr.total_size);
+
+            if ( end > addr + size )
+                return -EINVAL;
+        }
     }
 
+    info->zimage.kernel_addr = addr;
+
     /*
      * If start is zero, the zImage is position independent -- load it
      * at 32k from start of RAM.
@@ -142,25 +160,26 @@ static void kernel_elf_load(struct kernel_info *info)
     free_xenheap_pages(info->kernel_img, info->kernel_order);
 }
 
-static int kernel_try_elf_prepare(struct kernel_info *info)
+static int kernel_try_elf_prepare(struct kernel_info *info,
+                                  paddr_t addr, paddr_t size)
 {
     int rc;
 
-    info->kernel_order = get_order_from_bytes(KERNEL_FLASH_SIZE);
+    info->kernel_order = get_order_from_bytes(size);
     info->kernel_img = alloc_xenheap_pages(info->kernel_order, 0);
     if ( info->kernel_img == NULL )
         panic("Cannot allocate temporary buffer for kernel.\n");
 
-    copy_from_paddr(info->kernel_img, KERNEL_FLASH_ADDRESS, KERNEL_FLASH_SIZE, DEV_SHARED);
+    copy_from_paddr(info->kernel_img, addr, size, DEV_SHARED);
 
-    if ( (rc = elf_init(&info->elf.elf, info->kernel_img, KERNEL_FLASH_SIZE )) != 0 )
-        return rc;
+    if ( (rc = elf_init(&info->elf.elf, info->kernel_img, size )) != 0 )
+        goto err;
 #ifdef VERBOSE
     elf_set_verbose(&info->elf.elf);
 #endif
     elf_parse_binary(&info->elf.elf);
     if ( (rc = elf_xen_parse(&info->elf.elf, &info->elf.parms)) != 0 )
-        return rc;
+        goto err;
 
     /*
      * TODO: can the ELF header be used to find the physical address
@@ -170,15 +189,36 @@ static int kernel_try_elf_prepare(struct kernel_info *info)
     info->load = kernel_elf_load;
 
     return 0;
+err:
+    free_xenheap_pages(info->kernel_img, info->kernel_order);
+    return rc;
 }
 
 int kernel_prepare(struct kernel_info *info)
 {
     int rc;
 
-    rc = kernel_try_zimage_prepare(info);
+    paddr_t start, size;
+
+    if ( early_info.modules.nr_mods > 1 )
+        panic("Cannot handle dom0 initrd yet\n");
+
+    if ( early_info.modules.nr_mods < 1 )
+    {
+        printk("No boot modules found, trying flash\n");
+        start = KERNEL_FLASH_ADDRESS;
+        size = KERNEL_FLASH_SIZE;
+    }
+    else
+    {
+        printk("Loading kernel from boot module 1\n");
+        start = early_info.modules.module[1].start;
+        size = early_info.modules.module[1].size;
+    }
+
+    rc = kernel_try_zimage_prepare(info, start, size);
     if (rc < 0)
-        rc = kernel_try_elf_prepare(info);
+        rc = kernel_try_elf_prepare(info, start, size);
 
     return rc;
 }
diff --git a/xen/arch/arm/kernel.h b/xen/arch/arm/kernel.h
index 4533568..2353e13 100644
--- a/xen/arch/arm/kernel.h
+++ b/xen/arch/arm/kernel.h
@@ -22,6 +22,7 @@ struct kernel_info {
 
     union {
         struct {
+            paddr_t kernel_addr;
             paddr_t load_addr;
             paddr_t len;
         } zimage;
@@ -39,3 +40,12 @@ int kernel_prepare(struct kernel_info *info);
 void kernel_load(struct kernel_info *info);
 
 #endif /* #ifdef __ARCH_ARM_KERNEL_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:24:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:24:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJHO-00055N-8i; Tue, 13 Nov 2012 16:24:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TYJHM-00052h-7B
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:24:00 +0000
Received: from [85.158.143.35:13020] by server-2.bemta-4.messagelabs.com id
	37/DC-28922-F1472A05; Tue, 13 Nov 2012 16:23:59 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1352823839!10193639!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9805 invoked from network); 13 Nov 2012 16:23:59 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-10.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:59 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15784285"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:58 +0000
Received: from Roger-2.local (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 16:23:58 +0000
Message-ID: <50A2741D.70401@citrix.com>
Date: Tue, 13 Nov 2012 17:23:57 +0100
From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
	<1352734432.27833.280.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352734432.27833.280.camel@zakaz.uk.xensource.com>
Cc: "port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: add persistent grants to xbd_xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 12/11/12 16:33, Ian Campbell wrote:
> On Sun, 2012-11-04 at 22:23 +0000, Roger Pau Monne wrote:
>> @@ -652,6 +686,15 @@ xbd_connect(struct xbd_xenbus_softc *sc)
>>         else
>>                 sc->sc_cache_flush = 0;
>>
>> +       err = xenbus_read_ul(NULL, sc->sc_xbusd->xbusd_otherend,
>> +           "feature-persistent", &feature_persistent, 10);
>> +       if (err)
>> +               feature_persistent = 0;
>> +       if (feature_persistent > 0)
>> +               sc->sc_persistent_grants = 1;
>> +       else
>> +               sc->sc_persistent_grants = 0;
> 
> I can't find anywhere which reads sc->sc_persistent_grants?

I've added this to be used for debugging mainly, but I think we should
probably print it, to know if the backend supports persistent grants or
not (like the Linux kernel does).


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:24:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:24:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJHO-00055N-8i; Tue, 13 Nov 2012 16:24:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TYJHM-00052h-7B
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:24:00 +0000
Received: from [85.158.143.35:13020] by server-2.bemta-4.messagelabs.com id
	37/DC-28922-F1472A05; Tue, 13 Nov 2012 16:23:59 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1352823839!10193639!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9805 invoked from network); 13 Nov 2012 16:23:59 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-10.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:23:59 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15784285"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:23:58 +0000
Received: from Roger-2.local (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 16:23:58 +0000
Message-ID: <50A2741D.70401@citrix.com>
Date: Tue, 13 Nov 2012 17:23:57 +0100
From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
	<1352734432.27833.280.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352734432.27833.280.camel@zakaz.uk.xensource.com>
Cc: "port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: add persistent grants to xbd_xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 12/11/12 16:33, Ian Campbell wrote:
> On Sun, 2012-11-04 at 22:23 +0000, Roger Pau Monne wrote:
>> @@ -652,6 +686,15 @@ xbd_connect(struct xbd_xenbus_softc *sc)
>>         else
>>                 sc->sc_cache_flush = 0;
>>
>> +       err = xenbus_read_ul(NULL, sc->sc_xbusd->xbusd_otherend,
>> +           "feature-persistent", &feature_persistent, 10);
>> +       if (err)
>> +               feature_persistent = 0;
>> +       if (feature_persistent > 0)
>> +               sc->sc_persistent_grants = 1;
>> +       else
>> +               sc->sc_persistent_grants = 0;
> 
> I can't find anywhere which reads sc->sc_persistent_grants?

I've added this to be used for debugging mainly, but I think we should
probably print it, to know if the backend supports persistent grants or
not (like the Linux kernel does).


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:24:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:24:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJHa-0005Gz-LV; Tue, 13 Nov 2012 16:24:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TYJHZ-0005Eq-16
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:24:13 +0000
Received: from [85.158.143.99:15137] by server-1.bemta-4.messagelabs.com id
	47/A0-27934-C2472A05; Tue, 13 Nov 2012 16:24:12 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-2.tower-216.messagelabs.com!1352823851!24473487!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8016 invoked from network); 13 Nov 2012 16:24:11 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-2.tower-216.messagelabs.com with SMTP;
	13 Nov 2012 16:24:11 -0000
X-TM-IMSS-Message-ID: <793fee0800080fc5@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 793fee0800080fc5 ;
	Tue, 13 Nov 2012 11:23:46 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qADGO3YY008576; 
	Tue, 13 Nov 2012 11:24:03 -0500
Message-ID: <50A27423.6040104@tycho.nsa.gov>
Date: Tue, 13 Nov 2012 11:24:03 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: D Sundstrom <sunds@peapod.net>
References: <CAP4+OA3-CsKxJizFpx-V48cCFKJc5KXNQzzY4oQ6pQ5pu0RFMg@mail.gmail.com>
	<CAL08nMGDeaQO6HAJypK+pzmsmg8wcz2=WnLWwX==R5MRBCyoPA@mail.gmail.com>
	<CAP4+OA064YvLQyPahGWoyxPhWv+v5LLCjBUOUg09QF7XKJ1tZg@mail.gmail.com>
In-Reply-To: <CAP4+OA064YvLQyPahGWoyxPhWv+v5LLCjBUOUg09QF7XKJ1tZg@mail.gmail.com>
Cc: Pablo Llopis <pllopis@arcos.inf.uc3m.es>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Immediate kernel panic using gntdev device
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/12/2012 08:15 AM, D Sundstrom wrote:
> Thank you Pablo.
> 
> It makes no difference if I run both the src-add and map from the same
> domain or from different DomU domains.
> Whichever DomU I run the map function in crashes immediately.

Mapping your own grants (which is what the test run you showed did) might
cause problems - although it's a bug that needs to be fixed, if so. You
may want to try using the vchan-node2 tool (tools/libvchan) for testing
and as an example user.
 
> You mention Dom0.  I just want to be clear that I'd like to share
> between two DomU domains.  Have you gotten this to work?

That was the goal of gntalloc/libvchan - it should work (and has for me).
 
> I also tried the userspace APIs provided by Xen such as
> xc_gnttab_map_grant_ref() and these also crash.  Of course, these use
> the same driver IOCTLs, so this isn't a surprise.
> 
> I'll need to see if I can get some debug info from the DomU kernel to
> make progress.

You might want to try booting your domU with console=hvc0 and look at
xl console - that will usually give you useful backtraces. Without that,
it's rather difficult to tell what the problem is.
 
> If I can get this to work, are there any restrictions on sharing large
> amounts of memory?  Say 160Mb?  Or are grant tables intended for a
> small number of pages?

There are restrictions within the modules (default is 1024 4K pages), and
in Xen itself for the number of grant table and maptrack pages - but I
think those can be adjusted via a boot parameter. The grant tables aren't
currently intended to share large amounts of memory, so you may run in to
some inefficiencies when doing the map/unmap. If you're using an IOMMU for
one of the domUs, this may end up being especially costly.
 
> Thanks,
> David
> 
> 
> 
> On Mon, Nov 12, 2012 at 5:36 AM, Pablo Llopis <pllopis@arcos.inf.uc3m.es> wrote:
>>
>> It is not clear from your output from which domain you are running
>> each command. It looks like you are trying to issue a grant and map it
>> from within the same domain. That's probably the reason it crashes.
>> You are supposed to run this tool from both domains, running the calls
>> which interface with gntalloc from one domain, and the calls which
>> interface with gntdev from the other domain.
>> In any case, the domid you have to specify in the map must be the
>> domid of the domain which issued the grant. In other words, when
>> creating a grant, the domid which is granted access is specified. When
>> mapping a grant, the domid which issued the grant is specified. (i.e.
>> If you did "src-add 8" from dom0 you should run map 0 1372 from domU
>> 8)
>>
>>>
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 


-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:24:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:24:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJHa-0005Gz-LV; Tue, 13 Nov 2012 16:24:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TYJHZ-0005Eq-16
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:24:13 +0000
Received: from [85.158.143.99:15137] by server-1.bemta-4.messagelabs.com id
	47/A0-27934-C2472A05; Tue, 13 Nov 2012 16:24:12 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-2.tower-216.messagelabs.com!1352823851!24473487!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8016 invoked from network); 13 Nov 2012 16:24:11 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-2.tower-216.messagelabs.com with SMTP;
	13 Nov 2012 16:24:11 -0000
X-TM-IMSS-Message-ID: <793fee0800080fc5@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 793fee0800080fc5 ;
	Tue, 13 Nov 2012 11:23:46 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qADGO3YY008576; 
	Tue, 13 Nov 2012 11:24:03 -0500
Message-ID: <50A27423.6040104@tycho.nsa.gov>
Date: Tue, 13 Nov 2012 11:24:03 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: D Sundstrom <sunds@peapod.net>
References: <CAP4+OA3-CsKxJizFpx-V48cCFKJc5KXNQzzY4oQ6pQ5pu0RFMg@mail.gmail.com>
	<CAL08nMGDeaQO6HAJypK+pzmsmg8wcz2=WnLWwX==R5MRBCyoPA@mail.gmail.com>
	<CAP4+OA064YvLQyPahGWoyxPhWv+v5LLCjBUOUg09QF7XKJ1tZg@mail.gmail.com>
In-Reply-To: <CAP4+OA064YvLQyPahGWoyxPhWv+v5LLCjBUOUg09QF7XKJ1tZg@mail.gmail.com>
Cc: Pablo Llopis <pllopis@arcos.inf.uc3m.es>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Immediate kernel panic using gntdev device
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/12/2012 08:15 AM, D Sundstrom wrote:
> Thank you Pablo.
> 
> It makes no difference if I run both the src-add and map from the same
> domain or from different DomU domains.
> Whichever DomU I run the map function in crashes immediately.

Mapping your own grants (which is what the test run you showed did) might
cause problems - although it's a bug that needs to be fixed, if so. You
may want to try using the vchan-node2 tool (tools/libvchan) for testing
and as an example user.
 
> You mention Dom0.  I just want to be clear that I'd like to share
> between two DomU domains.  Have you gotten this to work?

That was the goal of gntalloc/libvchan - it should work (and has for me).
 
> I also tried the userspace APIs provided by Xen such as
> xc_gnttab_map_grant_ref() and these also crash.  Of course, these use
> the same driver IOCTLs, so this isn't a surprise.
> 
> I'll need to see if I can get some debug info from the DomU kernel to
> make progress.

You might want to try booting your domU with console=hvc0 and look at
xl console - that will usually give you useful backtraces. Without that,
it's rather difficult to tell what the problem is.
 
> If I can get this to work, are there any restrictions on sharing large
> amounts of memory?  Say 160Mb?  Or are grant tables intended for a
> small number of pages?

There are restrictions within the modules (default is 1024 4K pages), and
in Xen itself for the number of grant table and maptrack pages - but I
think those can be adjusted via a boot parameter. The grant tables aren't
currently intended to share large amounts of memory, so you may run in to
some inefficiencies when doing the map/unmap. If you're using an IOMMU for
one of the domUs, this may end up being especially costly.
 
> Thanks,
> David
> 
> 
> 
> On Mon, Nov 12, 2012 at 5:36 AM, Pablo Llopis <pllopis@arcos.inf.uc3m.es> wrote:
>>
>> It is not clear from your output from which domain you are running
>> each command. It looks like you are trying to issue a grant and map it
>> from within the same domain. That's probably the reason it crashes.
>> You are supposed to run this tool from both domains, running the calls
>> which interface with gntalloc from one domain, and the calls which
>> interface with gntdev from the other domain.
>> In any case, the domid you have to specify in the map must be the
>> domid of the domain which issued the grant. In other words, when
>> creating a grant, the domid which is granted access is specified. When
>> mapping a grant, the domid which issued the grant is specified. (i.e.
>> If you did "src-add 8" from dom0 you should run map 0 1372 from domU
>> 8)
>>
>>>
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 


-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:25:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:25:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJIh-0005s6-BD; Tue, 13 Nov 2012 16:25:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJIf-0005rJ-MA
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 16:25:21 +0000
Received: from [85.158.143.99:60813] by server-2.bemta-4.messagelabs.com id
	98/BE-28922-17472A05; Tue, 13 Nov 2012 16:25:21 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1352823919!24505294!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32159 invoked from network); 13 Nov 2012 16:25:20 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:25:20 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15784332"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:25:19 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 16:25:19 +0000
Message-ID: <1352823918.7491.96.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Date: Tue, 13 Nov 2012 16:25:18 +0000
In-Reply-To: <20642.29568.426761.422604@mariner.uk.xensource.com>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
	<1352738557.27833.302.camel@zakaz.uk.xensource.com>
	<20121112180738.GA26672@aepfle.de>	<20121112183457.GB2114@lolek.nigdzie>
	<20121112184047.GA28988@aepfle.de>
	<1352804909.7491.55.camel@zakaz.uk.xensource.com>
	<20121113132735.GD7561@jajo.eggsoft>
	<20642.29568.426761.422604@mariner.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Jacek Konieczny <jajcus@jajcus.net>
Subject: Re: [Xen-devel] [PATCH] Fix locking in
 tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 16:21 +0000, Ian Jackson wrote:
> Jacek Konieczny writes ("Re: [Xen-devel] [PATCH] Fix locking in tools/hotplug/Linux/locking.sh"):
> > fcntl(3, F_GETFL)                       = 0x8401 (flags O_WRONLY|O_APPEND|O_LARGEFILE)
> 
> So it seems perl is going out of its way to spot this earlier.
> That explains the mystery.

Looking at glibc it seems like it has had this test since the
mid-nineties, so quite why we aren't seeing it elsewhere I can't explain
(maybe bash buggily opens the fd RDWR?)

> Anyway the patch is fine.
> 
> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Yes, irrespective of why this patch does seem to be correct:

Acked-by: Ian Campbell <ian.campbell@citrix.com>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:25:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:25:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJIh-0005s6-BD; Tue, 13 Nov 2012 16:25:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJIf-0005rJ-MA
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 16:25:21 +0000
Received: from [85.158.143.99:60813] by server-2.bemta-4.messagelabs.com id
	98/BE-28922-17472A05; Tue, 13 Nov 2012 16:25:21 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1352823919!24505294!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32159 invoked from network); 13 Nov 2012 16:25:20 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:25:20 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15784332"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:25:19 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 16:25:19 +0000
Message-ID: <1352823918.7491.96.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Date: Tue, 13 Nov 2012 16:25:18 +0000
In-Reply-To: <20642.29568.426761.422604@mariner.uk.xensource.com>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
	<1352738557.27833.302.camel@zakaz.uk.xensource.com>
	<20121112180738.GA26672@aepfle.de>	<20121112183457.GB2114@lolek.nigdzie>
	<20121112184047.GA28988@aepfle.de>
	<1352804909.7491.55.camel@zakaz.uk.xensource.com>
	<20121113132735.GD7561@jajo.eggsoft>
	<20642.29568.426761.422604@mariner.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Jacek Konieczny <jajcus@jajcus.net>
Subject: Re: [Xen-devel] [PATCH] Fix locking in
 tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 16:21 +0000, Ian Jackson wrote:
> Jacek Konieczny writes ("Re: [Xen-devel] [PATCH] Fix locking in tools/hotplug/Linux/locking.sh"):
> > fcntl(3, F_GETFL)                       = 0x8401 (flags O_WRONLY|O_APPEND|O_LARGEFILE)
> 
> So it seems perl is going out of its way to spot this earlier.
> That explains the mystery.

Looking at glibc it seems like it has had this test since the
mid-nineties, so quite why we aren't seeing it elsewhere I can't explain
(maybe bash buggily opens the fd RDWR?)

> Anyway the patch is fine.
> 
> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Yes, irrespective of why this patch does seem to be correct:

Acked-by: Ian Campbell <ian.campbell@citrix.com>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:39:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:39:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJVm-0007Fl-Oi; Tue, 13 Nov 2012 16:38:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJVl-0007Fg-8m
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:38:53 +0000
Received: from [85.158.137.99:8866] by server-1.bemta-3.messagelabs.com id
	3A/B9-12169-C9772A05; Tue, 13 Nov 2012 16:38:52 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1352824731!13816429!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32525 invoked from network); 13 Nov 2012 16:38:51 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:38:51 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15784683"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:38:46 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 16:38:45 +0000
Message-ID: <1352824724.7491.103.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: xen-devel <xen-devel@lists.xen.org>
Date: Tue, 13 Nov 2012 16:38:44 +0000
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH V2 00/12] arm: support for initial modules
 (e.g. dom0) and DTB supplied in RAM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 16:22 +0000, Ian Campbell wrote:
> I will post a patch against the boot-wrapper which implements the
> "bootloader" side of this protocol shortly.

See
http://xenbits.xen.org/gitweb/?p=people/ianc/boot-wrapper.git;a=summary

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:39:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:39:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJVm-0007Fl-Oi; Tue, 13 Nov 2012 16:38:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJVl-0007Fg-8m
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:38:53 +0000
Received: from [85.158.137.99:8866] by server-1.bemta-3.messagelabs.com id
	3A/B9-12169-C9772A05; Tue, 13 Nov 2012 16:38:52 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1352824731!13816429!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32525 invoked from network); 13 Nov 2012 16:38:51 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:38:51 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15784683"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:38:46 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 16:38:45 +0000
Message-ID: <1352824724.7491.103.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: xen-devel <xen-devel@lists.xen.org>
Date: Tue, 13 Nov 2012 16:38:44 +0000
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH V2 00/12] arm: support for initial modules
 (e.g. dom0) and DTB supplied in RAM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 16:22 +0000, Ian Campbell wrote:
> I will post a patch against the boot-wrapper which implements the
> "bootloader" side of this protocol shortly.

See
http://xenbits.xen.org/gitweb/?p=people/ianc/boot-wrapper.git;a=summary

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:50:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:50:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJgZ-0007g3-Ut; Tue, 13 Nov 2012 16:50:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TYJgZ-0007fy-02
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:50:03 +0000
Received: from [85.158.143.35:10464] by server-1.bemta-4.messagelabs.com id
	66/85-27934-93A72A05; Tue, 13 Nov 2012 16:50:01 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1352825400!4692824!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13413 invoked from network); 13 Nov 2012 16:50:01 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:50:01 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15785078"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:50:00 +0000
Received: from Roger-2.local (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 16:50:00 +0000
Message-ID: <50A27A37.2090506@citrix.com>
Date: Tue, 13 Nov 2012 17:49:59 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <CAF6-1L51R5yMBNO1wQe7YWoeGoM_bFJcAb0XN0cVg6cm7+Kzaw@mail.gmail.com>
	<1352363172.12977.87.camel@hastur.hellion.org.uk>
	<509D22E6.2090005@citrix.com>
In-Reply-To: <509D22E6.2090005@citrix.com>
Cc: Sylvain Munaut <s.munaut@whatever-company.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Custom block script started twice for root block
 but only stopped once
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 09/11/12 16:36, Roger Pau Monn=E9 wrote:
> On 08/11/12 09:26, Ian Campbell wrote:
>> On Fri, 2012-11-02 at 10:37 +0000, Sylvain Munaut wrote:
>>> Hi,
>>>
>>> I'm using a custom block script in my xen setup and when started, it
>>> creates a new device node pointing to some network resources.
>>>
>>> Now I noticed that the script is called twice for the root block, the
>>> first time for pygrub most likely, but is only stopped once ... I
>>> don't mind creating two devices node, but then I need to destroy both
>>> ...
>>>
>>> Is this a known issue ?
>>
>> Not one I've heard. Running "xl -vvv create" might provide some logs
>> which give an idea what is going on, likewise the logging
>> in /var/log/xen/...
>>
>> Roger -- any ideas?
> =

> Yes, I've been able to reproduce the error when using stubdoms, I'm
> currently working on a fix. Have you seen this when using stubdomains
> Sylvain?

I've been thinking about this, and I think it's the right thing to do to
call hotplug scripts twice when using stubdomains. Each script gets
called for the corresponding PV interface of each guest. Here is a
stripped trace of the creation of a guest with a stubdomain:

[...]
libxl: debug: libxl_device.c:919:device_hotplug: for-domain: 46 - calling h=
otplug script: /etc/xen/scripts/block add
[...]
libxl: debug: libxl_device.c:919:device_hotplug: for-domain: 47 - calling h=
otplug script: /etc/xen/scripts/block add
[...]
libxl: debug: libxl_device.c:919:device_hotplug: for-domain: 47 - calling h=
otplug script: /etc/xen/scripts/vif-bridge online
[...]
libxl: debug: libxl_device.c:919:device_hotplug: for-domain: 46 - calling h=
otplug script: /etc/xen/scripts/vif-bridge online
[...]

And the destruction:

[...]
libxl: debug: libxl_device.c:919:device_hotplug: for-domain: 47 - calling h=
otplug script: /etc/xen/scripts/block remove
[...]
libxl: debug: libxl_device.c:919:device_hotplug: for-domain: 47 - calling h=
otplug script: /etc/xen/scripts/vif-bridge offline
[...]
libxl: debug: libxl_device.c:919:device_hotplug: for-domain: 46 - calling h=
otplug script: /etc/xen/scripts/block remove
[...]
libxl: debug: libxl_device.c:919:device_hotplug: for-domain: 46 - calling h=
otplug script: /etc/xen/scripts/vif-bridge offline
[...]

So hotplug script gets called twice for both creation and
destruction. Can you run a guest creation/destruction with
-vvv and provide the output?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:50:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:50:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJgZ-0007g3-Ut; Tue, 13 Nov 2012 16:50:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TYJgZ-0007fy-02
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:50:03 +0000
Received: from [85.158.143.35:10464] by server-1.bemta-4.messagelabs.com id
	66/85-27934-93A72A05; Tue, 13 Nov 2012 16:50:01 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1352825400!4692824!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13413 invoked from network); 13 Nov 2012 16:50:01 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:50:01 -0000
X-IronPort-AV: E=Sophos;i="4.80,767,1344211200"; d="scan'208";a="15785078"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:50:00 +0000
Received: from Roger-2.local (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 16:50:00 +0000
Message-ID: <50A27A37.2090506@citrix.com>
Date: Tue, 13 Nov 2012 17:49:59 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <CAF6-1L51R5yMBNO1wQe7YWoeGoM_bFJcAb0XN0cVg6cm7+Kzaw@mail.gmail.com>
	<1352363172.12977.87.camel@hastur.hellion.org.uk>
	<509D22E6.2090005@citrix.com>
In-Reply-To: <509D22E6.2090005@citrix.com>
Cc: Sylvain Munaut <s.munaut@whatever-company.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Custom block script started twice for root block
 but only stopped once
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 09/11/12 16:36, Roger Pau Monn=E9 wrote:
> On 08/11/12 09:26, Ian Campbell wrote:
>> On Fri, 2012-11-02 at 10:37 +0000, Sylvain Munaut wrote:
>>> Hi,
>>>
>>> I'm using a custom block script in my xen setup and when started, it
>>> creates a new device node pointing to some network resources.
>>>
>>> Now I noticed that the script is called twice for the root block, the
>>> first time for pygrub most likely, but is only stopped once ... I
>>> don't mind creating two devices node, but then I need to destroy both
>>> ...
>>>
>>> Is this a known issue ?
>>
>> Not one I've heard. Running "xl -vvv create" might provide some logs
>> which give an idea what is going on, likewise the logging
>> in /var/log/xen/...
>>
>> Roger -- any ideas?
> =

> Yes, I've been able to reproduce the error when using stubdoms, I'm
> currently working on a fix. Have you seen this when using stubdomains
> Sylvain?

I've been thinking about this, and I think it's the right thing to do to
call hotplug scripts twice when using stubdomains. Each script gets
called for the corresponding PV interface of each guest. Here is a
stripped trace of the creation of a guest with a stubdomain:

[...]
libxl: debug: libxl_device.c:919:device_hotplug: for-domain: 46 - calling h=
otplug script: /etc/xen/scripts/block add
[...]
libxl: debug: libxl_device.c:919:device_hotplug: for-domain: 47 - calling h=
otplug script: /etc/xen/scripts/block add
[...]
libxl: debug: libxl_device.c:919:device_hotplug: for-domain: 47 - calling h=
otplug script: /etc/xen/scripts/vif-bridge online
[...]
libxl: debug: libxl_device.c:919:device_hotplug: for-domain: 46 - calling h=
otplug script: /etc/xen/scripts/vif-bridge online
[...]

And the destruction:

[...]
libxl: debug: libxl_device.c:919:device_hotplug: for-domain: 47 - calling h=
otplug script: /etc/xen/scripts/block remove
[...]
libxl: debug: libxl_device.c:919:device_hotplug: for-domain: 47 - calling h=
otplug script: /etc/xen/scripts/vif-bridge offline
[...]
libxl: debug: libxl_device.c:919:device_hotplug: for-domain: 46 - calling h=
otplug script: /etc/xen/scripts/block remove
[...]
libxl: debug: libxl_device.c:919:device_hotplug: for-domain: 46 - calling h=
otplug script: /etc/xen/scripts/vif-bridge offline
[...]

So hotplug script gets called twice for both creation and
destruction. Can you run a guest creation/destruction with
-vvv and provide the output?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:53:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:53:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJjh-0007yH-Iw; Tue, 13 Nov 2012 16:53:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJjg-0007y8-1M
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:53:16 +0000
Received: from [85.158.143.35:22620] by server-1.bemta-4.messagelabs.com id
	34/0A-27934-BFA72A05; Tue, 13 Nov 2012 16:53:15 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352825581!13435561!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12281 invoked from network); 13 Nov 2012 16:53:03 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:53:03 -0000
X-IronPort-AV: E=Sophos;i="4.80,768,1344211200"; d="scan'208";a="44442777"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:53:01 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:53:00 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-IP;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: <xen-devel@lists.xen.org>
Date: Tue, 13 Nov 2012 16:23:24 +0000
Message-ID: <1352823804-28482-12-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbel@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 12/12] xen: strip /chosen/module@<N>/* from dom0
	device tree
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

These nodes are used by Xen to find the initial modules.

Only drop the "xen,multiboot-module" compatible nodes in case someone
else has a similar idea.

Signed-off-by: Ian Campbell <ian.campbel@citrix.com>
---
 xen/arch/arm/domain_build.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 7a964f7..d2158d8 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -179,6 +179,7 @@ static int write_nodes(struct domain *d, struct kernel_info *kinfo,
     int depth = 0, last_depth = -1;
     u32 address_cells[DEVICE_TREE_MAX_DEPTH];
     u32 size_cells[DEVICE_TREE_MAX_DEPTH];
+    int parents[DEVICE_TREE_MAX_DEPTH];
     int ret;
 
     for ( node = 0, depth = 0;
@@ -196,10 +197,25 @@ static int write_nodes(struct domain *d, struct kernel_info *kinfo,
         }
 
         while ( last_depth-- >= depth )
+        {
+            parents[last_depth+1] = -1;
             fdt_end_node(kinfo->fdt);
+        }
 
         address_cells[depth] = device_tree_get_u32(fdt, node, "#address-cells");
         size_cells[depth] = device_tree_get_u32(fdt, node, "#size-cells");
+        parents[depth] = node;
+
+        /* Skip /chosen/module@<N>/ nodes */
+        if ( depth == 2 &&
+             device_tree_node_matches(fdt, parents[1], "chosen") &&
+             device_tree_node_matches(fdt, node, "module") &&
+             fdt_node_check_compatible(fdt, node,
+                                       "xen,multiboot-module" ) == 0 )
+        {
+            last_depth = depth - 1;
+            continue;
+        }
 
         fdt_begin_node(kinfo->fdt, name);
 
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:53:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:53:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJjh-0007yH-Iw; Tue, 13 Nov 2012 16:53:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJjg-0007y8-1M
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:53:16 +0000
Received: from [85.158.143.35:22620] by server-1.bemta-4.messagelabs.com id
	34/0A-27934-BFA72A05; Tue, 13 Nov 2012 16:53:15 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352825581!13435561!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12281 invoked from network); 13 Nov 2012 16:53:03 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:53:03 -0000
X-IronPort-AV: E=Sophos;i="4.80,768,1344211200"; d="scan'208";a="44442777"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:53:01 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:53:00 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-IP;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: <xen-devel@lists.xen.org>
Date: Tue, 13 Nov 2012 16:23:24 +0000
Message-ID: <1352823804-28482-12-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbel@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 12/12] xen: strip /chosen/module@<N>/* from dom0
	device tree
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

These nodes are used by Xen to find the initial modules.

Only drop the "xen,multiboot-module" compatible nodes in case someone
else has a similar idea.

Signed-off-by: Ian Campbell <ian.campbel@citrix.com>
---
 xen/arch/arm/domain_build.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 7a964f7..d2158d8 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -179,6 +179,7 @@ static int write_nodes(struct domain *d, struct kernel_info *kinfo,
     int depth = 0, last_depth = -1;
     u32 address_cells[DEVICE_TREE_MAX_DEPTH];
     u32 size_cells[DEVICE_TREE_MAX_DEPTH];
+    int parents[DEVICE_TREE_MAX_DEPTH];
     int ret;
 
     for ( node = 0, depth = 0;
@@ -196,10 +197,25 @@ static int write_nodes(struct domain *d, struct kernel_info *kinfo,
         }
 
         while ( last_depth-- >= depth )
+        {
+            parents[last_depth+1] = -1;
             fdt_end_node(kinfo->fdt);
+        }
 
         address_cells[depth] = device_tree_get_u32(fdt, node, "#address-cells");
         size_cells[depth] = device_tree_get_u32(fdt, node, "#size-cells");
+        parents[depth] = node;
+
+        /* Skip /chosen/module@<N>/ nodes */
+        if ( depth == 2 &&
+             device_tree_node_matches(fdt, parents[1], "chosen") &&
+             device_tree_node_matches(fdt, node, "module") &&
+             fdt_node_check_compatible(fdt, node,
+                                       "xen,multiboot-module" ) == 0 )
+        {
+            last_depth = depth - 1;
+            continue;
+        }
 
         fdt_begin_node(kinfo->fdt, name);
 
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:53:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:53:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJjo-0007z1-VN; Tue, 13 Nov 2012 16:53:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJjn-0007yl-6D
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:53:23 +0000
Received: from [85.158.143.35:23078] by server-2.bemta-4.messagelabs.com id
	46/A5-28922-20B72A05; Tue, 13 Nov 2012 16:53:22 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352825581!13435561!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12379 invoked from network); 13 Nov 2012 16:53:07 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:53:07 -0000
X-IronPort-AV: E=Sophos;i="4.80,768,1344211200"; d="scan'208";a="44442781"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:53:01 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:53:01 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-Fs;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:23 +0000
Message-ID: <1352823804-28482-11-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 11/12] arm: use /chosen/module@1/bootargs for
	domain 0 command line
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Fallback to xen,dom0-bootargs if this isn't present.

Ideally this would use module1-args iff the kernel came from
module@1/{start,end} and the existing xen,dom0-bootargs if the kernel
came from flash, but this approach is simpler and has the same effect
in practice.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: update for new DT layout
---
 xen/arch/arm/domain_build.c |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index e96ed10..7a964f7 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -86,8 +86,13 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
                             int node, const char *name, int depth,
                             u32 address_cells, u32 size_cells)
 {
+    const char *bootargs = NULL;
     int prop;
 
+    if ( early_info.modules.nr_mods >= 1 &&
+         early_info.modules.module[1].cmdline[0] )
+        bootargs = &early_info.modules.module[1].cmdline[0];
+
     for ( prop = fdt_first_property_offset(fdt, node);
           prop >= 0;
           prop = fdt_next_property_offset(fdt, prop) )
@@ -104,15 +109,22 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
         prop_len  = fdt32_to_cpu(p->len);
 
         /*
-         * In chosen node: replace bootargs with value from
-         * xen,dom0-bootargs.
+         * In chosen node:
+         *
+         * * remember xen,dom0-bootargs if we don't already have
+         *   bootargs (from module #1, above).
+         * * remove bootargs and xen,dom0-bootargs.
          */
         if ( device_tree_node_matches(fdt, node, "chosen") )
         {
             if ( strcmp(prop_name, "bootargs") == 0 )
                 continue;
-            if ( strcmp(prop_name, "xen,dom0-bootargs") == 0 )
-                prop_name = "bootargs";
+            else if ( strcmp(prop_name, "xen,dom0-bootargs") == 0 )
+            {
+                if ( !bootargs )
+                    bootargs = prop_data;
+                continue;
+            }
         }
         /*
          * In a memory node: adjust reg property.
@@ -147,6 +159,14 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
         xfree(new_data);
     }
 
+    if ( device_tree_node_matches(fdt, node, "chosen") && bootargs )
+        fdt_property(kinfo->fdt, "bootargs", bootargs, strlen(bootargs));
+
+    /*
+     * XXX should populate /chosen/linux,initrd-{start,end} here if we
+     * have module[2]
+     */
+
     if ( prop == -FDT_ERR_NOTFOUND )
         return 0;
     return prop;
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 16:53:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 16:53:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYJjo-0007z1-VN; Tue, 13 Nov 2012 16:53:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYJjn-0007yl-6D
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 16:53:23 +0000
Received: from [85.158.143.35:23078] by server-2.bemta-4.messagelabs.com id
	46/A5-28922-20B72A05; Tue, 13 Nov 2012 16:53:22 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352825581!13435561!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODMxNzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12379 invoked from network); 13 Nov 2012 16:53:07 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 16:53:07 -0000
X-IronPort-AV: E=Sophos;i="4.80,768,1344211200"; d="scan'208";a="44442781"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 16:53:01 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 11:53:01 -0500
Received: from [10.80.246.74] (helo=army.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TYJGn-0000Qd-Fs;
	Tue, 13 Nov 2012 16:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 13 Nov 2012 16:23:23 +0000
Message-ID: <1352823804-28482-11-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.9.1
In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 11/12] arm: use /chosen/module@1/bootargs for
	domain 0 command line
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Fallback to xen,dom0-bootargs if this isn't present.

Ideally this would use module1-args iff the kernel came from
module@1/{start,end} and the existing xen,dom0-bootargs if the kernel
came from flash, but this approach is simpler and has the same effect
in practice.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: update for new DT layout
---
 xen/arch/arm/domain_build.c |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index e96ed10..7a964f7 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -86,8 +86,13 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
                             int node, const char *name, int depth,
                             u32 address_cells, u32 size_cells)
 {
+    const char *bootargs = NULL;
     int prop;
 
+    if ( early_info.modules.nr_mods >= 1 &&
+         early_info.modules.module[1].cmdline[0] )
+        bootargs = &early_info.modules.module[1].cmdline[0];
+
     for ( prop = fdt_first_property_offset(fdt, node);
           prop >= 0;
           prop = fdt_next_property_offset(fdt, prop) )
@@ -104,15 +109,22 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
         prop_len  = fdt32_to_cpu(p->len);
 
         /*
-         * In chosen node: replace bootargs with value from
-         * xen,dom0-bootargs.
+         * In chosen node:
+         *
+         * * remember xen,dom0-bootargs if we don't already have
+         *   bootargs (from module #1, above).
+         * * remove bootargs and xen,dom0-bootargs.
          */
         if ( device_tree_node_matches(fdt, node, "chosen") )
         {
             if ( strcmp(prop_name, "bootargs") == 0 )
                 continue;
-            if ( strcmp(prop_name, "xen,dom0-bootargs") == 0 )
-                prop_name = "bootargs";
+            else if ( strcmp(prop_name, "xen,dom0-bootargs") == 0 )
+            {
+                if ( !bootargs )
+                    bootargs = prop_data;
+                continue;
+            }
         }
         /*
          * In a memory node: adjust reg property.
@@ -147,6 +159,14 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
         xfree(new_data);
     }
 
+    if ( device_tree_node_matches(fdt, node, "chosen") && bootargs )
+        fdt_property(kinfo->fdt, "bootargs", bootargs, strlen(bootargs));
+
+    /*
+     * XXX should populate /chosen/linux,initrd-{start,end} here if we
+     * have module[2]
+     */
+
     if ( prop == -FDT_ERR_NOTFOUND )
         return 0;
     return prop;
-- 
1.7.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 17:14:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 17:14:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYK43-0000vA-Dw; Tue, 13 Nov 2012 17:14:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TYK42-0000v0-1G
	for Xen-devel@lists.xensource.com; Tue, 13 Nov 2012 17:14:18 +0000
Received: from [85.158.139.83:27991] by server-1.bemta-5.messagelabs.com id
	DF/1A-05877-9EF72A05; Tue, 13 Nov 2012 17:14:17 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1352826854!30096260!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13283 invoked from network); 13 Nov 2012 17:14:14 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 17:14:14 -0000
X-IronPort-AV: E=Sophos;i="4.80,768,1344211200"; d="scan'208";a="15785820"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 17:14:11 +0000
Received: from Roger-2.local (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 17:14:10 +0000
Message-ID: <50A27FE2.1020201@citrix.com>
Date: Tue, 13 Nov 2012 18:14:10 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Mukesh Rathor <mukesh.rathor@oracle.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
In-Reply-To: <20121112190934.5e702799@mantra.us.oracle.com>
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 13/11/12 04:09, Mukesh Rathor wrote:
> Hi,
> 
> I am wondering if there's libxl expert who can help me make some PVH
> related changes to libxl, pref in the US time zone. I could consult on
> irc or the phone.

I wouldn't consider myself a libxl expert, but I've been working with it
for some time (specially in the devices section) so if you need help I
would like to give you a hand, (I'm in the EU timezone, GMT+1).

> I find the libxl code hard to read, and don't
> want to spend lot of time figuring it out if someone can just help
> quickly.
> 
> thanks,
> Mukesh
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 17:14:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 17:14:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYK43-0000vA-Dw; Tue, 13 Nov 2012 17:14:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TYK42-0000v0-1G
	for Xen-devel@lists.xensource.com; Tue, 13 Nov 2012 17:14:18 +0000
Received: from [85.158.139.83:27991] by server-1.bemta-5.messagelabs.com id
	DF/1A-05877-9EF72A05; Tue, 13 Nov 2012 17:14:17 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1352826854!30096260!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13283 invoked from network); 13 Nov 2012 17:14:14 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 17:14:14 -0000
X-IronPort-AV: E=Sophos;i="4.80,768,1344211200"; d="scan'208";a="15785820"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 17:14:11 +0000
Received: from Roger-2.local (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 17:14:10 +0000
Message-ID: <50A27FE2.1020201@citrix.com>
Date: Tue, 13 Nov 2012 18:14:10 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Mukesh Rathor <mukesh.rathor@oracle.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
In-Reply-To: <20121112190934.5e702799@mantra.us.oracle.com>
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 13/11/12 04:09, Mukesh Rathor wrote:
> Hi,
> 
> I am wondering if there's libxl expert who can help me make some PVH
> related changes to libxl, pref in the US time zone. I could consult on
> irc or the phone.

I wouldn't consider myself a libxl expert, but I've been working with it
for some time (specially in the devices section) so if you need help I
would like to give you a hand, (I'm in the EU timezone, GMT+1).

> I find the libxl code hard to read, and don't
> want to spend lot of time figuring it out if someone can just help
> quickly.
> 
> thanks,
> Mukesh
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 17:17:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 17:17:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYK71-00014B-0t; Tue, 13 Nov 2012 17:17:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TYK6z-000142-CC
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 17:17:21 +0000
Received: from [85.158.139.83:46565] by server-15.bemta-5.messagelabs.com id
	95/3D-26920-0A082A05; Tue, 13 Nov 2012 17:17:20 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352827039!22881499!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14046 invoked from network); 13 Nov 2012 17:17:19 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-11.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 17:17:19 -0000
Received: by mail-ea0-f173.google.com with SMTP id i13so234745eaa.32
	for <xen-devel@lists.xen.org>; Tue, 13 Nov 2012 09:17:19 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=Udt8G89CjZCWeZ3qfkjflvVKF4pPv5UFDOLxj8CkTvU=;
	b=I43gUA2Oyy3Qv0wOGOubIbfn+8UmDrAVPrQwlAMseGjGduXy5Sk5HUFNJRRboLGxgW
	6KEiGMQjdxnFqAT2IGOQj91smKXAP4KS8tIQ2MWk03z8RpbszmasNBaash3nCRBEcMf8
	HwP0pfYI/A+KjDQ3r47ty8AglgrGHDp3BI5MWIUsvDY6Y1oIUpTapPJ7uIscxLVtB2WG
	biscyk9xIOuT+BtCr6Yw9Fa+v9JY49+pFz0p05KPc+5uB0JcQKJfzzI+gFEsAoAXbFhH
	re7aKjjWpX5rcfhnLQj1nnb+auhmSxiiH7W2YIw2uiC+uw5u1sAYzxxvLFSl6FXgdjE0
	pY7w==
Received: by 10.14.193.136 with SMTP id k8mr76875042een.30.1352827039707;
	Tue, 13 Nov 2012 09:17:19 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id g5sm23772989eem.4.2012.11.13.09.17.17
	(version=SSLv3 cipher=OTHER); Tue, 13 Nov 2012 09:17:19 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Tue, 13 Nov 2012 17:17:13 +0000
From: Keir Fraser <keir@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Message-ID: <CCC83119.5215F%keir@xen.org>
Thread-Topic: [Xen-devel] VM memory allocation speed with cs 26056
Thread-Index: Ac3BwriwUGmtcRjAwEGgyTHMyo/+oQ==
In-Reply-To: <8809ab93-4255-464b-88c2-28272980db16@default>
Mime-version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>, Jan Beulich <jbeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] VM memory allocation speed with cs 26056
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 13/11/2012 16:13, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:

>> I did it second time. It seems the result (attached) is promising.
>> 
>> I think the strange result is due to the order of testing:
>> start_physical_machine -> test_hvm -> test_pvm.
>> 
>> This time, I did: start_physical_machine -> test_pvm -> test_hvm.
>> 
>> You can see the pvm memory allocation speed is not affected by your patch
>> this time.
>> 
>> So I believe this patch is excellent now.
> 
> I don't know about Keir's opinion, but to me the performance dependency
> on ordering is even more bizarre and still calls into question the
> acceptability of the patch.  Customers aren't going to like being
> told that, for best results, they should launch all PV domains before
> their HVM domains.

Yes it's very odd. I would want to see more runs to be convinced that
nothing else weird is going on and affecting the results.

If it is something to do with the movement of the TLB-flush filtering logic,
it may just be a tiny difference being amplified by the vast number of times
alloc_heap_pages() gets called. We should be able to actually *improve* PV
build performance by pulling the flush filtering out into populate_physmap
and increase_reservation.

> Is scrubbing still/ever done lazily?  That might explain some of
> the weirdness.

No lazy scrubbing any more.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 17:17:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 17:17:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYK71-00014B-0t; Tue, 13 Nov 2012 17:17:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TYK6z-000142-CC
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 17:17:21 +0000
Received: from [85.158.139.83:46565] by server-15.bemta-5.messagelabs.com id
	95/3D-26920-0A082A05; Tue, 13 Nov 2012 17:17:20 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352827039!22881499!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14046 invoked from network); 13 Nov 2012 17:17:19 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-11.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 17:17:19 -0000
Received: by mail-ea0-f173.google.com with SMTP id i13so234745eaa.32
	for <xen-devel@lists.xen.org>; Tue, 13 Nov 2012 09:17:19 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=Udt8G89CjZCWeZ3qfkjflvVKF4pPv5UFDOLxj8CkTvU=;
	b=I43gUA2Oyy3Qv0wOGOubIbfn+8UmDrAVPrQwlAMseGjGduXy5Sk5HUFNJRRboLGxgW
	6KEiGMQjdxnFqAT2IGOQj91smKXAP4KS8tIQ2MWk03z8RpbszmasNBaash3nCRBEcMf8
	HwP0pfYI/A+KjDQ3r47ty8AglgrGHDp3BI5MWIUsvDY6Y1oIUpTapPJ7uIscxLVtB2WG
	biscyk9xIOuT+BtCr6Yw9Fa+v9JY49+pFz0p05KPc+5uB0JcQKJfzzI+gFEsAoAXbFhH
	re7aKjjWpX5rcfhnLQj1nnb+auhmSxiiH7W2YIw2uiC+uw5u1sAYzxxvLFSl6FXgdjE0
	pY7w==
Received: by 10.14.193.136 with SMTP id k8mr76875042een.30.1352827039707;
	Tue, 13 Nov 2012 09:17:19 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id g5sm23772989eem.4.2012.11.13.09.17.17
	(version=SSLv3 cipher=OTHER); Tue, 13 Nov 2012 09:17:19 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Tue, 13 Nov 2012 17:17:13 +0000
From: Keir Fraser <keir@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Message-ID: <CCC83119.5215F%keir@xen.org>
Thread-Topic: [Xen-devel] VM memory allocation speed with cs 26056
Thread-Index: Ac3BwriwUGmtcRjAwEGgyTHMyo/+oQ==
In-Reply-To: <8809ab93-4255-464b-88c2-28272980db16@default>
Mime-version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>, Jan Beulich <jbeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] VM memory allocation speed with cs 26056
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 13/11/2012 16:13, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:

>> I did it second time. It seems the result (attached) is promising.
>> 
>> I think the strange result is due to the order of testing:
>> start_physical_machine -> test_hvm -> test_pvm.
>> 
>> This time, I did: start_physical_machine -> test_pvm -> test_hvm.
>> 
>> You can see the pvm memory allocation speed is not affected by your patch
>> this time.
>> 
>> So I believe this patch is excellent now.
> 
> I don't know about Keir's opinion, but to me the performance dependency
> on ordering is even more bizarre and still calls into question the
> acceptability of the patch.  Customers aren't going to like being
> told that, for best results, they should launch all PV domains before
> their HVM domains.

Yes it's very odd. I would want to see more runs to be convinced that
nothing else weird is going on and affecting the results.

If it is something to do with the movement of the TLB-flush filtering logic,
it may just be a tiny difference being amplified by the vast number of times
alloc_heap_pages() gets called. We should be able to actually *improve* PV
build performance by pulling the flush filtering out into populate_physmap
and increase_reservation.

> Is scrubbing still/ever done lazily?  That might explain some of
> the weirdness.

No lazy scrubbing any more.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 18:09:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 18:09:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYKvV-0002fF-4w; Tue, 13 Nov 2012 18:09:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYKvT-0002fA-3e
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 18:09:31 +0000
Received: from [85.158.143.35:20322] by server-3.bemta-4.messagelabs.com id
	C6/3A-06841-ADC82A05; Tue, 13 Nov 2012 18:09:30 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1352830169!7158347!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 405 invoked from network); 13 Nov 2012 18:09:29 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 18:09:29 -0000
X-IronPort-AV: E=Sophos;i="4.80,768,1344211200"; d="scan'208";a="15786993"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 18:09:25 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 13 Nov 2012 18:09:24 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TYKvN-00081n-1F; Tue, 13 Nov 2012 18:09:25 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TYKvM-0001WH-Lt;
	Tue, 13 Nov 2012 18:09:24 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20642.36052.425566.123033@mariner.uk.xensource.com>
Date: Tue, 13 Nov 2012 18:09:24 +0000
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1349695144.18008.102.camel@zakaz.uk.xensource.com>
References: <patchbomb.1349454156@probook.site>
	<1349695144.18008.102.camel@zakaz.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 0 of 5] misc tools changes, backport request
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("Re: [Xen-devel] [PATCH 0 of 5] misc tools changes, backport request"):
> On Fri, 2012-10-05 at 17:22 +0100, Olaf Hering wrote:
> > The following 5 patches were sent shortly before 4.2 was released, so
> > they were not considered (I think).  I propose the vscsi changes and the
> > stubdom parallel build change for inclusion in 4.2.1.
> 
> I nearly skipped this because it said backport request but I spotted
> that these were actually new patches to also be backported. I've now
> acked the unacked ones and applied.
...
> > Changes:

I have backported these to 4.2:

> > xend/pvscsi: fix passing of SCSI control LUNs
> > xend/pvscsi: fix usage of persistant device names for SCSI devices
> > xend/pvscsi: update sysfs parser for Linux 3.0
> > stubdom: fix parallel build by expanding CROSS_MAKE



This one doesn't seem to actually need backporting, based on the
description ?

> > tools/configure.ac: fill PACKAGE_TARNAME in AC_INIT


Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 18:09:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 18:09:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYKvV-0002fF-4w; Tue, 13 Nov 2012 18:09:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYKvT-0002fA-3e
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 18:09:31 +0000
Received: from [85.158.143.35:20322] by server-3.bemta-4.messagelabs.com id
	C6/3A-06841-ADC82A05; Tue, 13 Nov 2012 18:09:30 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1352830169!7158347!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 405 invoked from network); 13 Nov 2012 18:09:29 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 18:09:29 -0000
X-IronPort-AV: E=Sophos;i="4.80,768,1344211200"; d="scan'208";a="15786993"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 18:09:25 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 13 Nov 2012 18:09:24 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TYKvN-00081n-1F; Tue, 13 Nov 2012 18:09:25 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TYKvM-0001WH-Lt;
	Tue, 13 Nov 2012 18:09:24 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20642.36052.425566.123033@mariner.uk.xensource.com>
Date: Tue, 13 Nov 2012 18:09:24 +0000
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1349695144.18008.102.camel@zakaz.uk.xensource.com>
References: <patchbomb.1349454156@probook.site>
	<1349695144.18008.102.camel@zakaz.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 0 of 5] misc tools changes, backport request
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("Re: [Xen-devel] [PATCH 0 of 5] misc tools changes, backport request"):
> On Fri, 2012-10-05 at 17:22 +0100, Olaf Hering wrote:
> > The following 5 patches were sent shortly before 4.2 was released, so
> > they were not considered (I think).  I propose the vscsi changes and the
> > stubdom parallel build change for inclusion in 4.2.1.
> 
> I nearly skipped this because it said backport request but I spotted
> that these were actually new patches to also be backported. I've now
> acked the unacked ones and applied.
...
> > Changes:

I have backported these to 4.2:

> > xend/pvscsi: fix passing of SCSI control LUNs
> > xend/pvscsi: fix usage of persistant device names for SCSI devices
> > xend/pvscsi: update sysfs parser for Linux 3.0
> > stubdom: fix parallel build by expanding CROSS_MAKE



This one doesn't seem to actually need backporting, based on the
description ?

> > tools/configure.ac: fill PACKAGE_TARNAME in AC_INIT


Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 18:16:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 18:16:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYL2B-00032P-8x; Tue, 13 Nov 2012 18:16:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TYL29-00032K-Of
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 18:16:25 +0000
Received: from [85.158.137.99:11541] by server-5.bemta-3.messagelabs.com id
	1F/65-26311-87E82A05; Tue, 13 Nov 2012 18:16:24 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-15.tower-217.messagelabs.com!1352830578!16606665!1
X-Originating-IP: [81.169.146.176]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NiA9PiAyNjA1NA==\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NiA9PiAyNjA1NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24857 invoked from network); 13 Nov 2012 18:16:18 -0000
Received: from mo-p04-ob.rzone.de (HELO mo-p04-ob.rzone.de) (81.169.146.176)
	by server-15.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 18:16:18 -0000
X-RZG-CLASS-ID: mo04
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmxtMZ80VwmRNV67U=
Received: from probook.site (ip-80-226-24-1.vodafone-net.de [80.226.24.1])
	by smtp.strato.de (josoe mo36) (RZmta 31.3 SBL|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id x07116oADHbbCH ;
	Tue, 13 Nov 2012 19:16:17 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 87D0F189BA; Tue, 13 Nov 2012 19:15:59 +0100 (CET)
Date: Tue, 13 Nov 2012 19:15:59 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Message-ID: <20121113181559.GA31289@aepfle.de>
References: <patchbomb.1349454156@probook.site>
	<1349695144.18008.102.camel@zakaz.uk.xensource.com>
	<20642.36052.425566.123033@mariner.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20642.36052.425566.123033@mariner.uk.xensource.com>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 0 of 5] misc tools changes, backport request
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 13, Ian Jackson wrote:

> This one doesn't seem to actually need backporting, based on the
> description ?
> 
> > > tools/configure.ac: fill PACKAGE_TARNAME in AC_INIT

Sorry, that one appearently slipped into the list due to copy&paste.

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 18:16:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 18:16:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYL2B-00032P-8x; Tue, 13 Nov 2012 18:16:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TYL29-00032K-Of
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 18:16:25 +0000
Received: from [85.158.137.99:11541] by server-5.bemta-3.messagelabs.com id
	1F/65-26311-87E82A05; Tue, 13 Nov 2012 18:16:24 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-15.tower-217.messagelabs.com!1352830578!16606665!1
X-Originating-IP: [81.169.146.176]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NiA9PiAyNjA1NA==\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NiA9PiAyNjA1NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24857 invoked from network); 13 Nov 2012 18:16:18 -0000
Received: from mo-p04-ob.rzone.de (HELO mo-p04-ob.rzone.de) (81.169.146.176)
	by server-15.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 18:16:18 -0000
X-RZG-CLASS-ID: mo04
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmxtMZ80VwmRNV67U=
Received: from probook.site (ip-80-226-24-1.vodafone-net.de [80.226.24.1])
	by smtp.strato.de (josoe mo36) (RZmta 31.3 SBL|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id x07116oADHbbCH ;
	Tue, 13 Nov 2012 19:16:17 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 87D0F189BA; Tue, 13 Nov 2012 19:15:59 +0100 (CET)
Date: Tue, 13 Nov 2012 19:15:59 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Message-ID: <20121113181559.GA31289@aepfle.de>
References: <patchbomb.1349454156@probook.site>
	<1349695144.18008.102.camel@zakaz.uk.xensource.com>
	<20642.36052.425566.123033@mariner.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20642.36052.425566.123033@mariner.uk.xensource.com>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 0 of 5] misc tools changes, backport request
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 13, Ian Jackson wrote:

> This one doesn't seem to actually need backporting, based on the
> description ?
> 
> > > tools/configure.ac: fill PACKAGE_TARNAME in AC_INIT

Sorry, that one appearently slipped into the list due to copy&paste.

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 18:38:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 18:38:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYLMs-0003cb-8x; Tue, 13 Nov 2012 18:37:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYLMq-0003cW-5i
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 18:37:48 +0000
Received: from [85.158.143.35:13129] by server-2.bemta-4.messagelabs.com id
	11/49-28922-B7392A05; Tue, 13 Nov 2012 18:37:47 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1352831866!12018285!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18751 invoked from network); 13 Nov 2012 18:37:46 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 18:37:46 -0000
X-IronPort-AV: E=Sophos;i="4.80,768,1344211200"; d="scan'208";a="15787410"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 18:37:46 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 13 Nov 2012 18:37:45 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TYLMn-0008B2-SP; Tue, 13 Nov 2012 18:37:45 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TYLMn-0000YZ-9k;
	Tue, 13 Nov 2012 18:37:45 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20642.37747.982297.553297@mariner.uk.xensource.com>
Date: Tue, 13 Nov 2012 18:37:39 +0000
To: <xen-devel@lists.xen.org>, Frediano Ziglio <frediano.ziglio@citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>, Jan Beulich <JBeulich@suse.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Subject: [Xen-devel] Tools backports to 4.1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I have backported a number of the tools fixes from 4.2 to 4.1.


This one looked like a good candidate but it looked like too big a job
to bite off right now (the c/s is in 4.2):

  changeset:   25908:9ebebb1904fd
  user:        Roger Pau Monne <roger.pau@citrix.com>
  date:        Fri Oct 26 17:02:22 2012 +0100
  description:
  libfsimage: add ext4 support for CentOS 5.x

This one (in qemu-xen-4.2-testing.git) needed adjusting which I hope
I've done right:

  commit d94efd9aa814f17f3243dae91476dc42b5ad052e
  Author: Frediano Ziglio <frediano.ziglio@citrix.com>
  Date:   Tue Aug 7 18:17:27 2012 +0100

      mapcache: Fix invalidate if memory requested was not bucket aligned

I was cautious about build system changes and didn't take any libxl backports.

The full list of commits is below.



changeset:   23394:8cd220183845
user:        Matt Wilson <msw@amazon.com>
date:        Tue Nov 13 18:08:16 2012 +0000
files:       docs/man/xmdomain.cfg.pod.5
description:
docs: correct formatting errors in xmdomain.cfg

This patch corrects the following errors produced by pod2man:

Hey! The above document had some coding errors, which are explained
below:

Around line 301:
    You can't have =items (as at line 305) unless the first thing after
    the =over is an =item

Around line 311:
    '=item' outside of any '=over'

Signed-off-by: Matt Wilson <msw@amazon.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 25840:c7e4b7e64303
Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-4.2-testing changeset: 25885:c23d938e3e64
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>


changeset:   23395:8931942405ea
user:        Olaf Hering <olaf@aepfle.de>
date:        Tue Nov 13 18:09:07 2012 +0000
files:       tools/pygrub/src/pygrub
description:
pygrub: always append --args

If a bootloader entry in menu.lst has no additional kernel command line
options listed and the domU.cfg has 'bootargs="--args=something"' the
additional arguments from the config file are not passed to the kernel.
The reason for that incorrect behaviour is that run_grub appends arg
only if the parsed config file has arguments listed.

Fix this by appending args from image section and the config file separatly.
To avoid adding to a NoneType initialize grubcfg['args'] to an empty string.
This does not change behaviour but simplifies the code which appends the
string.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 25941:795c493fe561
Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-4.2-testing changeset: 25891:7e91c668bae2
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>


changeset:   23396:30a7232b184d
user:        Olaf Hering <olaf@aepfle.de>
date:        Tue Nov 13 18:09:58 2012 +0000
files:       tools/hotplug/Linux/network-nat
description:
hotplug/Linux: Remove tracing (bash -x) from network-nat script

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 26006:8b6870d686d6
Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-4.2-testing changeset: 25896:6adf0c7937bf
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>


changeset:   23397:e9f906ff6539
user:        Olaf Hering <olaf@aepfle.de>
date:        Tue Nov 13 18:10:06 2012 +0000
files:       tools/xenballoon/xenballoond.init
description:
xenballoond.init: remove 4 from default runlevel

Remove 4 from default runlevel in xenballoond.init.

Similar to what changeset 24847:0900b1c905f1 does in xencommons, remove
runlevel 4 from the other runlevel scripts. LSB defines runlevel 4 as
reserved for local use, the local sysadmin is responsible for symlink
creation in rc4.d.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 26007:fe756682cc7f
Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-4.2-testing changeset: 25897:dcd4bf824284
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>


changeset:   23398:0ac3938a6cee
user:        Olaf Hering <olaf@aepfle.de>
date:        Tue Nov 13 18:10:15 2012 +0000
files:       tools/pygrub/src/pygrub
description:
pygrub: correct typo in --args assignment

If pygrub was called with --args="some thing", then this string should
be append to the kernel command line.  But the last changeset
25941:795c493fe561 contained a typo, it assigns 'args' instead of 'arg'.

Rename the local variable which holds the string from the domain config
file to avoid further confusion.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 26018:ecc7627ca6d7
Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-4.2-testing changeset: 25899:dbb1872bbb97
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>


changeset:   23399:bfe09091c0c5
user:        Joe Jin <joe.jin@oracle.com>
date:        Tue Nov 13 18:11:09 2012 +0000
files:       tools/python/xen/xend/XendStateStore.py
description:
tools: xend: fix wrong condition check for xml file

In commit e8d40584, it intended to check xml file size and when empty will
return, the condition should be "if os.path.getsize(xml_path) == 0" rather
then "if not os.path.getsize(xml_path) == 0".

Signed-off-by: Chuang Cao <chuang.cao@oracle.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 26088:dd64a1bdbe3a
Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-4.2-testing changeset: 25905:82b61b99d15d
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>


changeset:   23400:0f01a15628da
user:        Olaf Hering <olaf@aepfle.de>
date:        Tue Nov 13 18:13:11 2012 +0000
files:       tools/python/xen/util/vscsi_util.py
description:
xend/pvscsi: fix passing of SCSI control LUNs

Currently pvscsi can not pass SCSI devices that have just a scsi_generic node.
In the following example sg3 is a control LUN for the disk sdd.
But vscsi=['4:0:2:0,0:0:0:0'] does not work because the internal 'devname'
variable remains None. Later writing p-devname to xenstore fails because None
is not a valid string variable.

Since devname is used for just informational purpose use sg also as devname.

carron:~ $ lsscsi -g
[0:0:0:0]    disk    ATA      FK0032CAAZP      HPF2  /dev/sda   /dev/sg0
[4:0:0:0]    disk    HP       P2000G3 FC/iSCSI T100  /dev/sdb   /dev/sg1
[4:0:1:0]    disk    HP       P2000G3 FC/iSCSI T100  /dev/sdc   /dev/sg2
[4:0:2:0]    storage HP       HSV400           0950  -         /dev/sg3
[4:0:2:1]    disk    HP       HSV400           0950  /dev/sdd   /dev/sg4
[4:0:3:0]    storage HP       HSV400           0950  -         /dev/sg5
[4:0:3:1]    disk    HP       HSV400           0950  /dev/sde   /dev/sg6

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 26008:eecb528583d7
Backport-requested-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-4.2-testing changeset: 25913:16ced2f387b9
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>


changeset:   23401:c14e37335775
user:        Olaf Hering <olaf@aepfle.de>
date:        Tue Nov 13 18:13:17 2012 +0000
files:       tools/python/xen/util/vscsi_util.py
description:
xend/pvscsi: fix usage of persistant device names for SCSI devices

Currently the callers of vscsi_get_scsidevices() do not pass a mask
string.  This will call "lsscsi -g '[]'", which causes a lsscsi syntax
error. As a result the sysfs parser _vscsi_get_scsidevices() is used.
But this parser is broken and the specified names in the config file are
not found.

Using a mask '*' if no mask was given will call lsscsi correctly and the
following config is parsed correctly:

vscsi=[
	'/dev/sg3, 0:0:0:0',
	'/dev/disk/by-id/wwn-0x600508b4000cf1c30000800000410000, 0:0:0:1'
]

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 26009:2dbfa4d2e107
Backport-requested-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-4.2-testing changeset: 25914:b8916af165b9
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>


changeset:   23402:1104badf4151
tag:         tip
user:        Olaf Hering <olaf@aepfle.de>
date:        Tue Nov 13 18:13:24 2012 +0000
files:       tools/python/xen/util/vscsi_util.py
description:
xend/pvscsi: update sysfs parser for Linux 3.0

The sysfs parser for /sys/bus/scsi/devices understands only the layout
of kernel version 2.6.16. This looks as follows:

/sys/bus/scsi/devices/1:0:0:0/block:sda is a symlink to /sys/block/sda/
/sys/bus/scsi/devices/1:0:0:0/scsi_generic:sg1 is a symlink to /sys/class/scsi_generic/sg1

Both directories contain a 'dev' file with the major:minor information.
This patch updates the used regex strings to match also the colon to
make it more robust against possible future changes.

In kernel version 3.0 the layout changed:
/sys/bus/scsi/devices/ contains now additional symlinks to directories
such as host1 and target1:0:0. This patch ignores these as they do not
point to the desired scsi devices. They just clutter the devices array.

The directory layout in '1:0:0:0' changed as well, the 'type:name'
notation was replaced with 'type/name' directories:

/sys/bus/scsi/devices/1:0:0:0/block/sda/
/sys/bus/scsi/devices/1:0:0:0/scsi_generic/sg1/

Both directories contain a 'dev' file with the major:minor information.
This patch adds additional code to walk the subdir to find the 'dev'
file to make sure the given subdirectory is really the kernel name.

In addition this patch makes sure devname is not None.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 26010:cff10030c6ea
Backport-requested-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-4.2-testing changeset: 25915:839e5d95d483
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>




commit b36c42985575cd6d761d39e5770e57a1f52832ae
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date:   Tue Nov 13 18:25:17 2012 +0000

    mapcache: Fix invalidate if memory requested was not bucket aligned
    
    When memory is mapped in qemu_map_cache with lock != 0 a reverse mapping
    is created pointing to the virtual address of location requested.
    The cached mapped entry is saved in last_address_vaddr with the memory
    location of the base virtual address (without bucket offset).
    However when this entry is invalidated the virtual address saved in the
    reverse mapping is used. This cause that the mapping is freed but the
    last_address_vaddr is not reset.
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit d94efd9aa814f17f3243dae91476dc42b5ad052e)
    
    Conflicts:
    	hw/xen_machine_fv.c
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

commit bdbf5a6aba74658b95756c8d7d26d664fbd9c83d
Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date:   Thu Aug 30 16:11:32 2012 +0100

    qemu-xen-trad: fix msi_translate with PV event delivery
    
    When switching from msitranslate to straight msi we need to make sure
    that we respect PV event delivery for the msi if the guest asked for it:
    
    - completely disable MSI on the device in pt_disable_msi_translate;
    - then enable MSI again (pt_msi_setup), mapping the correct pirq to it.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Tested-by: Rolu <rolu@roce.org>
    (cherry picked from commit 3e66da7266c84638c0e22a09c9d2b07529802576)

commit dbd79be2d3d47c6a73f6292ffb8de9860cd80ad8
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date:   Tue Aug 14 15:57:49 2012 +0100

    Revert "qemu-xen-traditional: use O_DIRECT to open disk images for IDE"
    
    This reverts commit 1307e42a4b3c1102d75401bc0cffb4eb6c9b7a38.
    
    In fact after a lengthy discussion, we came up with the conclusion
    that WRITEBACK is OK for IDE.
    See: http://marc.info/?l=xen-devel&m=133311527009773
    
    Therefore revert this which was committed in error.
    (cherry picked from commit effd5676225761abdab90becac519716515c3be4)



-- 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 18:38:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 18:38:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYLMs-0003cb-8x; Tue, 13 Nov 2012 18:37:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYLMq-0003cW-5i
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 18:37:48 +0000
Received: from [85.158.143.35:13129] by server-2.bemta-4.messagelabs.com id
	11/49-28922-B7392A05; Tue, 13 Nov 2012 18:37:47 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1352831866!12018285!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18751 invoked from network); 13 Nov 2012 18:37:46 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 18:37:46 -0000
X-IronPort-AV: E=Sophos;i="4.80,768,1344211200"; d="scan'208";a="15787410"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 18:37:46 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 13 Nov 2012 18:37:45 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TYLMn-0008B2-SP; Tue, 13 Nov 2012 18:37:45 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TYLMn-0000YZ-9k;
	Tue, 13 Nov 2012 18:37:45 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20642.37747.982297.553297@mariner.uk.xensource.com>
Date: Tue, 13 Nov 2012 18:37:39 +0000
To: <xen-devel@lists.xen.org>, Frediano Ziglio <frediano.ziglio@citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>, Jan Beulich <JBeulich@suse.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Subject: [Xen-devel] Tools backports to 4.1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I have backported a number of the tools fixes from 4.2 to 4.1.


This one looked like a good candidate but it looked like too big a job
to bite off right now (the c/s is in 4.2):

  changeset:   25908:9ebebb1904fd
  user:        Roger Pau Monne <roger.pau@citrix.com>
  date:        Fri Oct 26 17:02:22 2012 +0100
  description:
  libfsimage: add ext4 support for CentOS 5.x

This one (in qemu-xen-4.2-testing.git) needed adjusting which I hope
I've done right:

  commit d94efd9aa814f17f3243dae91476dc42b5ad052e
  Author: Frediano Ziglio <frediano.ziglio@citrix.com>
  Date:   Tue Aug 7 18:17:27 2012 +0100

      mapcache: Fix invalidate if memory requested was not bucket aligned

I was cautious about build system changes and didn't take any libxl backports.

The full list of commits is below.



changeset:   23394:8cd220183845
user:        Matt Wilson <msw@amazon.com>
date:        Tue Nov 13 18:08:16 2012 +0000
files:       docs/man/xmdomain.cfg.pod.5
description:
docs: correct formatting errors in xmdomain.cfg

This patch corrects the following errors produced by pod2man:

Hey! The above document had some coding errors, which are explained
below:

Around line 301:
    You can't have =items (as at line 305) unless the first thing after
    the =over is an =item

Around line 311:
    '=item' outside of any '=over'

Signed-off-by: Matt Wilson <msw@amazon.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 25840:c7e4b7e64303
Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-4.2-testing changeset: 25885:c23d938e3e64
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>


changeset:   23395:8931942405ea
user:        Olaf Hering <olaf@aepfle.de>
date:        Tue Nov 13 18:09:07 2012 +0000
files:       tools/pygrub/src/pygrub
description:
pygrub: always append --args

If a bootloader entry in menu.lst has no additional kernel command line
options listed and the domU.cfg has 'bootargs="--args=something"' the
additional arguments from the config file are not passed to the kernel.
The reason for that incorrect behaviour is that run_grub appends arg
only if the parsed config file has arguments listed.

Fix this by appending args from image section and the config file separatly.
To avoid adding to a NoneType initialize grubcfg['args'] to an empty string.
This does not change behaviour but simplifies the code which appends the
string.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 25941:795c493fe561
Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-4.2-testing changeset: 25891:7e91c668bae2
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>


changeset:   23396:30a7232b184d
user:        Olaf Hering <olaf@aepfle.de>
date:        Tue Nov 13 18:09:58 2012 +0000
files:       tools/hotplug/Linux/network-nat
description:
hotplug/Linux: Remove tracing (bash -x) from network-nat script

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 26006:8b6870d686d6
Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-4.2-testing changeset: 25896:6adf0c7937bf
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>


changeset:   23397:e9f906ff6539
user:        Olaf Hering <olaf@aepfle.de>
date:        Tue Nov 13 18:10:06 2012 +0000
files:       tools/xenballoon/xenballoond.init
description:
xenballoond.init: remove 4 from default runlevel

Remove 4 from default runlevel in xenballoond.init.

Similar to what changeset 24847:0900b1c905f1 does in xencommons, remove
runlevel 4 from the other runlevel scripts. LSB defines runlevel 4 as
reserved for local use, the local sysadmin is responsible for symlink
creation in rc4.d.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 26007:fe756682cc7f
Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-4.2-testing changeset: 25897:dcd4bf824284
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>


changeset:   23398:0ac3938a6cee
user:        Olaf Hering <olaf@aepfle.de>
date:        Tue Nov 13 18:10:15 2012 +0000
files:       tools/pygrub/src/pygrub
description:
pygrub: correct typo in --args assignment

If pygrub was called with --args="some thing", then this string should
be append to the kernel command line.  But the last changeset
25941:795c493fe561 contained a typo, it assigns 'args' instead of 'arg'.

Rename the local variable which holds the string from the domain config
file to avoid further confusion.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 26018:ecc7627ca6d7
Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-4.2-testing changeset: 25899:dbb1872bbb97
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>


changeset:   23399:bfe09091c0c5
user:        Joe Jin <joe.jin@oracle.com>
date:        Tue Nov 13 18:11:09 2012 +0000
files:       tools/python/xen/xend/XendStateStore.py
description:
tools: xend: fix wrong condition check for xml file

In commit e8d40584, it intended to check xml file size and when empty will
return, the condition should be "if os.path.getsize(xml_path) == 0" rather
then "if not os.path.getsize(xml_path) == 0".

Signed-off-by: Chuang Cao <chuang.cao@oracle.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 26088:dd64a1bdbe3a
Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-4.2-testing changeset: 25905:82b61b99d15d
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>


changeset:   23400:0f01a15628da
user:        Olaf Hering <olaf@aepfle.de>
date:        Tue Nov 13 18:13:11 2012 +0000
files:       tools/python/xen/util/vscsi_util.py
description:
xend/pvscsi: fix passing of SCSI control LUNs

Currently pvscsi can not pass SCSI devices that have just a scsi_generic node.
In the following example sg3 is a control LUN for the disk sdd.
But vscsi=['4:0:2:0,0:0:0:0'] does not work because the internal 'devname'
variable remains None. Later writing p-devname to xenstore fails because None
is not a valid string variable.

Since devname is used for just informational purpose use sg also as devname.

carron:~ $ lsscsi -g
[0:0:0:0]    disk    ATA      FK0032CAAZP      HPF2  /dev/sda   /dev/sg0
[4:0:0:0]    disk    HP       P2000G3 FC/iSCSI T100  /dev/sdb   /dev/sg1
[4:0:1:0]    disk    HP       P2000G3 FC/iSCSI T100  /dev/sdc   /dev/sg2
[4:0:2:0]    storage HP       HSV400           0950  -         /dev/sg3
[4:0:2:1]    disk    HP       HSV400           0950  /dev/sdd   /dev/sg4
[4:0:3:0]    storage HP       HSV400           0950  -         /dev/sg5
[4:0:3:1]    disk    HP       HSV400           0950  /dev/sde   /dev/sg6

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 26008:eecb528583d7
Backport-requested-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-4.2-testing changeset: 25913:16ced2f387b9
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>


changeset:   23401:c14e37335775
user:        Olaf Hering <olaf@aepfle.de>
date:        Tue Nov 13 18:13:17 2012 +0000
files:       tools/python/xen/util/vscsi_util.py
description:
xend/pvscsi: fix usage of persistant device names for SCSI devices

Currently the callers of vscsi_get_scsidevices() do not pass a mask
string.  This will call "lsscsi -g '[]'", which causes a lsscsi syntax
error. As a result the sysfs parser _vscsi_get_scsidevices() is used.
But this parser is broken and the specified names in the config file are
not found.

Using a mask '*' if no mask was given will call lsscsi correctly and the
following config is parsed correctly:

vscsi=[
	'/dev/sg3, 0:0:0:0',
	'/dev/disk/by-id/wwn-0x600508b4000cf1c30000800000410000, 0:0:0:1'
]

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 26009:2dbfa4d2e107
Backport-requested-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-4.2-testing changeset: 25914:b8916af165b9
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>


changeset:   23402:1104badf4151
tag:         tip
user:        Olaf Hering <olaf@aepfle.de>
date:        Tue Nov 13 18:13:24 2012 +0000
files:       tools/python/xen/util/vscsi_util.py
description:
xend/pvscsi: update sysfs parser for Linux 3.0

The sysfs parser for /sys/bus/scsi/devices understands only the layout
of kernel version 2.6.16. This looks as follows:

/sys/bus/scsi/devices/1:0:0:0/block:sda is a symlink to /sys/block/sda/
/sys/bus/scsi/devices/1:0:0:0/scsi_generic:sg1 is a symlink to /sys/class/scsi_generic/sg1

Both directories contain a 'dev' file with the major:minor information.
This patch updates the used regex strings to match also the colon to
make it more robust against possible future changes.

In kernel version 3.0 the layout changed:
/sys/bus/scsi/devices/ contains now additional symlinks to directories
such as host1 and target1:0:0. This patch ignores these as they do not
point to the desired scsi devices. They just clutter the devices array.

The directory layout in '1:0:0:0' changed as well, the 'type:name'
notation was replaced with 'type/name' directories:

/sys/bus/scsi/devices/1:0:0:0/block/sda/
/sys/bus/scsi/devices/1:0:0:0/scsi_generic/sg1/

Both directories contain a 'dev' file with the major:minor information.
This patch adds additional code to walk the subdir to find the 'dev'
file to make sure the given subdirectory is really the kernel name.

In addition this patch makes sure devname is not None.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 26010:cff10030c6ea
Backport-requested-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-4.2-testing changeset: 25915:839e5d95d483
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>




commit b36c42985575cd6d761d39e5770e57a1f52832ae
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date:   Tue Nov 13 18:25:17 2012 +0000

    mapcache: Fix invalidate if memory requested was not bucket aligned
    
    When memory is mapped in qemu_map_cache with lock != 0 a reverse mapping
    is created pointing to the virtual address of location requested.
    The cached mapped entry is saved in last_address_vaddr with the memory
    location of the base virtual address (without bucket offset).
    However when this entry is invalidated the virtual address saved in the
    reverse mapping is used. This cause that the mapping is freed but the
    last_address_vaddr is not reset.
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit d94efd9aa814f17f3243dae91476dc42b5ad052e)
    
    Conflicts:
    	hw/xen_machine_fv.c
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

commit bdbf5a6aba74658b95756c8d7d26d664fbd9c83d
Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date:   Thu Aug 30 16:11:32 2012 +0100

    qemu-xen-trad: fix msi_translate with PV event delivery
    
    When switching from msitranslate to straight msi we need to make sure
    that we respect PV event delivery for the msi if the guest asked for it:
    
    - completely disable MSI on the device in pt_disable_msi_translate;
    - then enable MSI again (pt_msi_setup), mapping the correct pirq to it.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Tested-by: Rolu <rolu@roce.org>
    (cherry picked from commit 3e66da7266c84638c0e22a09c9d2b07529802576)

commit dbd79be2d3d47c6a73f6292ffb8de9860cd80ad8
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date:   Tue Aug 14 15:57:49 2012 +0100

    Revert "qemu-xen-traditional: use O_DIRECT to open disk images for IDE"
    
    This reverts commit 1307e42a4b3c1102d75401bc0cffb4eb6c9b7a38.
    
    In fact after a lengthy discussion, we came up with the conclusion
    that WRITEBACK is OK for IDE.
    See: http://marc.info/?l=xen-devel&m=133311527009773
    
    Therefore revert this which was committed in error.
    (cherry picked from commit effd5676225761abdab90becac519716515c3be4)



-- 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 19:00:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 19:00:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYLi4-0004HN-Su; Tue, 13 Nov 2012 18:59:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TYLi3-0004HI-8b
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 18:59:43 +0000
Received: from [85.158.139.83:45824] by server-16.bemta-5.messagelabs.com id
	30/94-04786-E9892A05; Tue, 13 Nov 2012 18:59:42 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1352833180!27409592!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16996 invoked from network); 13 Nov 2012 18:59:40 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 18:59:40 -0000
X-IronPort-AV: E=Sophos;i="4.80,768,1344211200"; d="scan'208";a="15787754"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 18:59:35 +0000
Received: from Roger-2.local (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 18:59:34 +0000
Message-ID: <50A29896.3060705@citrix.com>
Date: Tue, 13 Nov 2012 19:59:34 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Manuel Bouyer <bouyer@antioche.eu.org>
References: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
	<20121110104536.GA1027@antioche.eu.org>
In-Reply-To: <20121110104536.GA1027@antioche.eu.org>
Cc: "port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: add persistent grants to xbd_xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 10/11/12 11:45, Manuel Bouyer wrote:
> On Sun, Nov 04, 2012 at 11:23:50PM +0100, Roger Pau Monne wrote:
>> This patch implements persistent grants for xbd_xenbus (blkfront in
>> Linux terminology). The effect of this change is to reduce the number
>> of unmap operations performed, since they cause a (costly) TLB
>> shootdown. This allows the I/O performance to scale better when a
>> large number of VMs are performing I/O.
>>
>> On startup xbd_xenbus notifies the backend driver that it is using
>> persistent grants. If the backend driver is not capable of persistent
>> mapping, xbd_xenbus will still use the same grants, since it is
>> compatible with the previous protocol, and simplifies the code
>> complexity in xbd_xenbus.
>>
>> Each time a request is send to the backend driver, xbd_xenbus will
>> check if there are free grants already mapped and will try to use one
>> of those. If there are not enough grants already mapped, xbd_xenbus
>> will request new grants, and they will be added to the list of free
>> grants when the transaction is finished, so they can be reused. Data
>> has to be copied from the request (struct buf) to the mapped grant, or
>> from the mapped grant to the request, depending on the operation being
>> performed.
>>
>> To test the performance impact of this patch I've benchmarked the
>> number of IOPS performed simultaneously by 15 NetBSD DomU guests on a
>> Linux Dom0 that supports persistent grants. The backend used to
>> perform this tests was a ramdisk of size 1GB.
>>
>>                      Sum of IOPS
>> Non-persistent            336718
>> Persistent                686010
>>
>> As seen, there's a x2 increase in the total number of IOPS being
>> performed. As a reference, using exactly the same setup Linux DomUs
>> are able to achieve 1102019 IOPS, so there's still plenty of room for
>> improvement.
> 
> I'd like to see a similar test run against a NetBSD dom0. Also, how big
> are your IOPs ?

I've run some test on a NetBSD Dom0, but it is not a big box, it only
has 8-ways. I've run 7 NetBSD DomUs on a NetBSD Dom0, and here are the
results (again using a block size of 4k and a md based backend):

Persistent frontend: 297688 IOPS
Non-persistent frontend: 326497 IOPS

This is consistent with the Linux graph on
http://xenbits.xen.org/people/royger/persistent_grants/nonpers_read.png,
which shows that there's a performance improvement when using at least 8
guests or more. I will also work on a persistent implementation for
NetBSD xbd backend, but I don't think it's going to make a difference
until we get a MP Dom0 (so it might be better to work on getting a MP
Dom0 first).

Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 19:00:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 19:00:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYLi4-0004HN-Su; Tue, 13 Nov 2012 18:59:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TYLi3-0004HI-8b
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 18:59:43 +0000
Received: from [85.158.139.83:45824] by server-16.bemta-5.messagelabs.com id
	30/94-04786-E9892A05; Tue, 13 Nov 2012 18:59:42 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1352833180!27409592!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16996 invoked from network); 13 Nov 2012 18:59:40 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 18:59:40 -0000
X-IronPort-AV: E=Sophos;i="4.80,768,1344211200"; d="scan'208";a="15787754"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 18:59:35 +0000
Received: from Roger-2.local (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 18:59:34 +0000
Message-ID: <50A29896.3060705@citrix.com>
Date: Tue, 13 Nov 2012 19:59:34 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Manuel Bouyer <bouyer@antioche.eu.org>
References: <1352067830-27804-1-git-send-email-roger.pau@citrix.com>
	<20121110104536.GA1027@antioche.eu.org>
In-Reply-To: <20121110104536.GA1027@antioche.eu.org>
Cc: "port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: add persistent grants to xbd_xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 10/11/12 11:45, Manuel Bouyer wrote:
> On Sun, Nov 04, 2012 at 11:23:50PM +0100, Roger Pau Monne wrote:
>> This patch implements persistent grants for xbd_xenbus (blkfront in
>> Linux terminology). The effect of this change is to reduce the number
>> of unmap operations performed, since they cause a (costly) TLB
>> shootdown. This allows the I/O performance to scale better when a
>> large number of VMs are performing I/O.
>>
>> On startup xbd_xenbus notifies the backend driver that it is using
>> persistent grants. If the backend driver is not capable of persistent
>> mapping, xbd_xenbus will still use the same grants, since it is
>> compatible with the previous protocol, and simplifies the code
>> complexity in xbd_xenbus.
>>
>> Each time a request is send to the backend driver, xbd_xenbus will
>> check if there are free grants already mapped and will try to use one
>> of those. If there are not enough grants already mapped, xbd_xenbus
>> will request new grants, and they will be added to the list of free
>> grants when the transaction is finished, so they can be reused. Data
>> has to be copied from the request (struct buf) to the mapped grant, or
>> from the mapped grant to the request, depending on the operation being
>> performed.
>>
>> To test the performance impact of this patch I've benchmarked the
>> number of IOPS performed simultaneously by 15 NetBSD DomU guests on a
>> Linux Dom0 that supports persistent grants. The backend used to
>> perform this tests was a ramdisk of size 1GB.
>>
>>                      Sum of IOPS
>> Non-persistent            336718
>> Persistent                686010
>>
>> As seen, there's a x2 increase in the total number of IOPS being
>> performed. As a reference, using exactly the same setup Linux DomUs
>> are able to achieve 1102019 IOPS, so there's still plenty of room for
>> improvement.
> 
> I'd like to see a similar test run against a NetBSD dom0. Also, how big
> are your IOPs ?

I've run some test on a NetBSD Dom0, but it is not a big box, it only
has 8-ways. I've run 7 NetBSD DomUs on a NetBSD Dom0, and here are the
results (again using a block size of 4k and a md based backend):

Persistent frontend: 297688 IOPS
Non-persistent frontend: 326497 IOPS

This is consistent with the Linux graph on
http://xenbits.xen.org/people/royger/persistent_grants/nonpers_read.png,
which shows that there's a performance improvement when using at least 8
guests or more. I will also work on a persistent implementation for
NetBSD xbd backend, but I don't think it's going to make a difference
until we get a MP Dom0 (so it might be better to work on getting a MP
Dom0 first).

Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 19:15:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 19:15:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYLxF-0004qP-L6; Tue, 13 Nov 2012 19:15:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TYLxE-0004qK-KS
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 19:15:24 +0000
Received: from [85.158.143.35:12744] by server-2.bemta-4.messagelabs.com id
	F6/81-28922-B4C92A05; Tue, 13 Nov 2012 19:15:23 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1352834120!7164416!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1OTk2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22103 invoked from network); 13 Nov 2012 19:15:21 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 19:15:21 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADJEcBk000480
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 19:14:39 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADJEaAE008903
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 19:14:37 GMT
Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADJEYBg003843; Tue, 13 Nov 2012 13:14:34 -0600
Received: from localhost.localdomain (/192.102.209.5)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 11:14:34 -0800
Date: Tue, 13 Nov 2012 14:14:28 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: roger.pau@citrix.com, xen-devel@lists.xensource.com
Message-ID: <20121113191428.GA12691@localhost.localdomain>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: james.harper@bendigoit.com.au, martin.petersen@oracle.com,
	koverstreet@google.com, ronghui.duan@intel.com,
	justing@spectralogic.com, JBeulich@suse.com,
	joseph.glanville@orionvm.com.au
Subject: [Xen-devel] Xen-blkback bugs/features
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hey Roger,

Since you are taking a look at blkback and continuing the work
that Oliver did with persistent grants (and btw, thanks for doing
that!) I was wondering if you were also looking at some of the
"todos" that were circulating around.

One of them was the 4KB issue. If one hooks up bcache as backend
into blkback, the I/Os don't seem to go anywhere. Both James Harper
and .. I think the author of bcache were talking about this but
it never got anywhere.

The other one is expanding the segment limit. We have hard-coded
it to be 11 but with existing use-cases (say SSDs) that is not
enough. Intel had posted an RFC patchset that created a new ring
for segments. SpectraLogic (Justin) did it by expanding the ring.

Then there is the prototype work that Martin Peterson (really really
prototype) to get DIF/DIX plumbed in xen-blkback/xen-blkfront. He
needed 8 bytes per bio so he ended up creating a new ring to track that.

I think those are the outstanding use-cases that I know off.

So was wondering if you had thought/looked at some of this and
had ideas  - and were thinking to do something in the future?

Thanks!

P.S.
I hope I have CC-ed everybody here.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 19:15:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 19:15:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYLxF-0004qP-L6; Tue, 13 Nov 2012 19:15:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TYLxE-0004qK-KS
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 19:15:24 +0000
Received: from [85.158.143.35:12744] by server-2.bemta-4.messagelabs.com id
	F6/81-28922-B4C92A05; Tue, 13 Nov 2012 19:15:23 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1352834120!7164416!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1OTk2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22103 invoked from network); 13 Nov 2012 19:15:21 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 19:15:21 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADJEcBk000480
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 19:14:39 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADJEaAE008903
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 19:14:37 GMT
Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADJEYBg003843; Tue, 13 Nov 2012 13:14:34 -0600
Received: from localhost.localdomain (/192.102.209.5)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 11:14:34 -0800
Date: Tue, 13 Nov 2012 14:14:28 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: roger.pau@citrix.com, xen-devel@lists.xensource.com
Message-ID: <20121113191428.GA12691@localhost.localdomain>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: james.harper@bendigoit.com.au, martin.petersen@oracle.com,
	koverstreet@google.com, ronghui.duan@intel.com,
	justing@spectralogic.com, JBeulich@suse.com,
	joseph.glanville@orionvm.com.au
Subject: [Xen-devel] Xen-blkback bugs/features
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hey Roger,

Since you are taking a look at blkback and continuing the work
that Oliver did with persistent grants (and btw, thanks for doing
that!) I was wondering if you were also looking at some of the
"todos" that were circulating around.

One of them was the 4KB issue. If one hooks up bcache as backend
into blkback, the I/Os don't seem to go anywhere. Both James Harper
and .. I think the author of bcache were talking about this but
it never got anywhere.

The other one is expanding the segment limit. We have hard-coded
it to be 11 but with existing use-cases (say SSDs) that is not
enough. Intel had posted an RFC patchset that created a new ring
for segments. SpectraLogic (Justin) did it by expanding the ring.

Then there is the prototype work that Martin Peterson (really really
prototype) to get DIF/DIX plumbed in xen-blkback/xen-blkfront. He
needed 8 bytes per bio so he ended up creating a new ring to track that.

I think those are the outstanding use-cases that I know off.

So was wondering if you had thought/looked at some of this and
had ideas  - and were thinking to do something in the future?

Thanks!

P.S.
I hope I have CC-ed everybody here.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 19:53:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 19:53:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYMXy-0005yJ-FO; Tue, 13 Nov 2012 19:53:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TYMXw-0005yE-P4
	for Xen-devel@lists.xensource.com; Tue, 13 Nov 2012 19:53:20 +0000
Received: from [85.158.139.211:12723] by server-16.bemta-5.messagelabs.com id
	7B/C5-04786-035A2A05; Tue, 13 Nov 2012 19:53:20 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1352836397!20061364!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1OTk2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5187 invoked from network); 13 Nov 2012 19:53:19 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-4.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 19:53:19 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADJrDer008424
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 19:53:14 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADJrCqp025734
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 19:53:13 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADJrCd9029697; Tue, 13 Nov 2012 13:53:12 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 11:53:12 -0800
Date: Tue, 13 Nov 2012 11:53:10 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121113115310.6773e92e@mantra.us.oracle.com>
In-Reply-To: <1352800853.7491.22.camel@zakaz.uk.xensource.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
	<1352800853.7491.22.camel@zakaz.uk.xensource.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	Roger Pau =?UTF-8?B?TW9ubsOp?= <roger.pau@citrix.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 13 Nov 2012 10:00:53 +0000
Ian Campbell <Ian.Campbell@citrix.com> wrote:

> On Tue, 2012-11-13 at 03:09 +0000, Mukesh Rathor wrote:
> > Hi,
> > 
> > I am wondering if there's libxl expert who can help me make some PVH
> > related changes to libxl, pref in the US time zone. I could consult
> > on irc or the phone.
> 
> I think most of the libxl experts are in European time zones. Probably
> the best bet is to just ask your questions either here or on IRC.

Ian C/Roger: what are your handles on the #xen IRC? Mine: mrathor.

thanks,
Mukesh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 19:53:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 19:53:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYMXy-0005yJ-FO; Tue, 13 Nov 2012 19:53:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TYMXw-0005yE-P4
	for Xen-devel@lists.xensource.com; Tue, 13 Nov 2012 19:53:20 +0000
Received: from [85.158.139.211:12723] by server-16.bemta-5.messagelabs.com id
	7B/C5-04786-035A2A05; Tue, 13 Nov 2012 19:53:20 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1352836397!20061364!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1OTk2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5187 invoked from network); 13 Nov 2012 19:53:19 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-4.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 13 Nov 2012 19:53:19 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADJrDer008424
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 19:53:14 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADJrCqp025734
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 19:53:13 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADJrCd9029697; Tue, 13 Nov 2012 13:53:12 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 11:53:12 -0800
Date: Tue, 13 Nov 2012 11:53:10 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121113115310.6773e92e@mantra.us.oracle.com>
In-Reply-To: <1352800853.7491.22.camel@zakaz.uk.xensource.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
	<1352800853.7491.22.camel@zakaz.uk.xensource.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	Roger Pau =?UTF-8?B?TW9ubsOp?= <roger.pau@citrix.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 13 Nov 2012 10:00:53 +0000
Ian Campbell <Ian.Campbell@citrix.com> wrote:

> On Tue, 2012-11-13 at 03:09 +0000, Mukesh Rathor wrote:
> > Hi,
> > 
> > I am wondering if there's libxl expert who can help me make some PVH
> > related changes to libxl, pref in the US time zone. I could consult
> > on irc or the phone.
> 
> I think most of the libxl experts are in European time zones. Probably
> the best bet is to just ask your questions either here or on IRC.

Ian C/Roger: what are your handles on the #xen IRC? Mine: mrathor.

thanks,
Mukesh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 20:10:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 20:10:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYMnk-0006TI-4J; Tue, 13 Nov 2012 20:09:40 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <malcolm.crossley@citrix.com>) id 1TYMni-0006TD-L8
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 20:09:38 +0000
Received: from [85.158.137.99:57027] by server-2.bemta-3.messagelabs.com id
	C1/9D-04744-109A2A05; Tue, 13 Nov 2012 20:09:37 +0000
X-Env-Sender: malcolm.crossley@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1352837377!13837501!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18634 invoked from network); 13 Nov 2012 20:09:37 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 20:09:37 -0000
X-IronPort-AV: E=Sophos;i="4.83,768,1352073600"; d="scan'208";a="15788552"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 20:08:48 +0000
Received: from [127.0.1.1] (10.80.3.206) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 20:08:47 +0000
MIME-Version: 1.0
X-Mercurial-Node: 7d6fd0219dd791e5788ae5b7c43a396bb27964ec
Message-ID: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Tue, 13 Nov 2012 20:08:24 +0000
From: Malcolm Crossley <malcolm.crossley@citrix.com>
To: xen-devel@lists.xensource.com
Cc: tim@xen.org, eddie.dong@intel.com, JBeulich@suse.com,
	jun.nakajima@intel.com, Ian.Campbell@citrix.com
Subject: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process real
 NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The self_nmi() code cause's an NMI to be triggered by sending an APIC message
to the local processor. Unfortunately there is a delay in the delivery of the
APIC message and we may already have re-entered the HVM guest by the time the
NMI is taken. This results in the VMEXIT code calling the self_nmi() function
again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop before
the HVM guest resumes normal operation.

Volume 3 Chapter 27 Section 1 of the Intel SDM states:

An NMI causes subsequent NMIs to be blocked, but only after the VM exit
completes.

So we believe it is safe to directly invoke the INT call as NMI's should
already be blocked.

The INT 2 call will perform an IRET which will unblock later calls to the NMI
handler, according to Intel SDM Volume 3 Chapter 6.7.1. We must ensure that the
IRET from the INT 2 IRET is the first IRET issued to prevent losing an NMI.
Moving the INT 2 call to before the interrupts are enabled should ensure we
don't lose the NMI.

Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>

diff -r 62885b3c34c8 -r 7d6fd0219dd7 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
         vector = intr_info & INTR_INFO_VECTOR_MASK;
         if ( vector == TRAP_machine_check )
             do_machine_check(regs);
+        else if ( vector == TRAP_nmi &&
+                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
+                  (X86_EVENTTYPE_NMI << 8) ) )
+            /* Must be called before interrupts are enabled to ensure
+             * the NMI handler code is run before the first IRET. The
+             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
+             */
+            asm volatile("int $2"); /* Real NMI, vector 2: normal processing */
         break;
     case EXIT_REASON_MCE_DURING_VMENTRY:
         do_machine_check(regs);
@@ -2442,7 +2450,6 @@ void vmx_vmexit_handler(struct cpu_user_
                  (X86_EVENTTYPE_NMI << 8) )
                 goto exit_and_crash;
             HVMTRACE_0D(NMI);
-            self_nmi(); /* Real NMI, vector 2: normal processing. */
             break;
         case TRAP_machine_check:
             HVMTRACE_0D(MCE);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 20:10:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 20:10:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYMnk-0006TI-4J; Tue, 13 Nov 2012 20:09:40 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <malcolm.crossley@citrix.com>) id 1TYMni-0006TD-L8
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 20:09:38 +0000
Received: from [85.158.137.99:57027] by server-2.bemta-3.messagelabs.com id
	C1/9D-04744-109A2A05; Tue, 13 Nov 2012 20:09:37 +0000
X-Env-Sender: malcolm.crossley@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1352837377!13837501!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18634 invoked from network); 13 Nov 2012 20:09:37 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 20:09:37 -0000
X-IronPort-AV: E=Sophos;i="4.83,768,1352073600"; d="scan'208";a="15788552"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 20:08:48 +0000
Received: from [127.0.1.1] (10.80.3.206) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 13 Nov 2012 20:08:47 +0000
MIME-Version: 1.0
X-Mercurial-Node: 7d6fd0219dd791e5788ae5b7c43a396bb27964ec
Message-ID: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Tue, 13 Nov 2012 20:08:24 +0000
From: Malcolm Crossley <malcolm.crossley@citrix.com>
To: xen-devel@lists.xensource.com
Cc: tim@xen.org, eddie.dong@intel.com, JBeulich@suse.com,
	jun.nakajima@intel.com, Ian.Campbell@citrix.com
Subject: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process real
 NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The self_nmi() code cause's an NMI to be triggered by sending an APIC message
to the local processor. Unfortunately there is a delay in the delivery of the
APIC message and we may already have re-entered the HVM guest by the time the
NMI is taken. This results in the VMEXIT code calling the self_nmi() function
again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop before
the HVM guest resumes normal operation.

Volume 3 Chapter 27 Section 1 of the Intel SDM states:

An NMI causes subsequent NMIs to be blocked, but only after the VM exit
completes.

So we believe it is safe to directly invoke the INT call as NMI's should
already be blocked.

The INT 2 call will perform an IRET which will unblock later calls to the NMI
handler, according to Intel SDM Volume 3 Chapter 6.7.1. We must ensure that the
IRET from the INT 2 IRET is the first IRET issued to prevent losing an NMI.
Moving the INT 2 call to before the interrupts are enabled should ensure we
don't lose the NMI.

Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>

diff -r 62885b3c34c8 -r 7d6fd0219dd7 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
         vector = intr_info & INTR_INFO_VECTOR_MASK;
         if ( vector == TRAP_machine_check )
             do_machine_check(regs);
+        else if ( vector == TRAP_nmi &&
+                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
+                  (X86_EVENTTYPE_NMI << 8) ) )
+            /* Must be called before interrupts are enabled to ensure
+             * the NMI handler code is run before the first IRET. The
+             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
+             */
+            asm volatile("int $2"); /* Real NMI, vector 2: normal processing */
         break;
     case EXIT_REASON_MCE_DURING_VMENTRY:
         do_machine_check(regs);
@@ -2442,7 +2450,6 @@ void vmx_vmexit_handler(struct cpu_user_
                  (X86_EVENTTYPE_NMI << 8) )
                 goto exit_and_crash;
             HVMTRACE_0D(NMI);
-            self_nmi(); /* Real NMI, vector 2: normal processing. */
             break;
         case TRAP_machine_check:
             HVMTRACE_0D(MCE);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 22:24:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 22:24:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYOtS-0000bL-At; Tue, 13 Nov 2012 22:23:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TYOtQ-0000bG-92
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 22:23:40 +0000
Received: from [85.158.137.99:34765] by server-11.bemta-3.messagelabs.com id
	B5/E6-19361-B68C2A05; Tue, 13 Nov 2012 22:23:39 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1352845416!17291090!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1OTk2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14184 invoked from network); 13 Nov 2012 22:23:38 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-10.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 22:23:38 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADMNYMm022801
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 22:23:35 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADMNYNY017457
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 22:23:34 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADMNXQi019327; Tue, 13 Nov 2012 16:23:33 -0600
MIME-Version: 1.0
Message-ID: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
Date: Tue, 13 Nov 2012 14:23:29 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__135284541349983992abhmt108.oracle.com"
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an existing)
	hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__135284541349983992abhmt108.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This is a first cut of the hypervisor patch of the proposed
XENMEM_claim_pages hypercall/subop.  The goal of this hypercall
is to attempt to atomically and very quickly determine if
there are sufficient pages available in the system and, if
so, "set aside" that quantity of pages for future allocations
by that domain.  Unlike an existing hypercall such as
increase_reservation or populate_physmap, specific physical
pageframes are not assigned to the domain because this
cannot be done sufficiently quickly (especially for very large
allocations in an arbitrarily fragmented system) and so the
existing mechanisms result in classic time-of-check-time-of-use
(TOCTOU) races.  One can think of claiming as similar to a
"lazy" allocation, but subsequent hypercalls are required
to do the actual physical pageframe allocation.

This patch is (so far) only compile-tested.

I don't have a patch for the toolstack side, but I envision
a "xl create --claim" option to maximize backwards
compatibility while minimizing impact on existing toolstacks.

Code overview:

Though the hypercall simply does arithmetic within locks,
some of the semantics in the code may be a bit subtle
so let me explain a bit.

The key variables (d->unclaimed_pages and total_unclaimed_pages)
start at zero if no claim has yet been staked for any domain.
(Perhaps a better name is "claimed_but_not_yet_possessed" but that's
a bit unwieldy.)  If no claim hypercalls are executed, there
should be no impact on existing usage.

When a claim is successfully staked by a domain, it is like a
watermark but there is no record kept of the size of the claim.
Instead, d->unclaimed_pages is set to the difference between
d->tot_pages and the claim (d->tot_pages may normally be zero
but see Note 1).  When d->tot_pages increases or decreases,
d->unclaimed_pages atomically decreases or increases.  Once
d->unclaimed_pages reaches zero, the claim is satisfied and
d->unclaimed pages stays at zero -- unless a new claim is
subsequently staked.  See Note 2.

The systemwide variable total_unclaimed_pages is always the sum
of d->unclaimed_pages, across all domains.  A non-domain-
specific heap allocation will fail if total_unclaimed_pages
exceeds free (plus, on tmem enabled systems, freeable) pages.

Claim semantics may be modified by flags.  The initial
implementation has one flag, which discerns whether the
caller would like tmem freeable pages to be considered
in determining whether or not the claim can be successfully
staked. Future flags may, for example, specify that the
caller would like the claim to be successful only if there
are sufficient pages available on a single node (per Dario's
suggestion).

Note 1: Tim: I'm thinking this may resolve your concern that
the claim mechanism must be more complicated to handle
restricted memory allocations and order>0 allocations.
The proposed claim mechanism only guarantees a quantity of
order=3D=3D0 pages; if restricted allocations are required, these
are done first by the toolstack, and followed by the claim.
Order>0 allocations still work if memory is not fragmented,
but the claim mechanism doesn't guarantee anything but
a quantity of order=3D=3D0 pages.

Note 2: Tim: This arithmetic also indirectly implements the
"claim auto-expire" discussed earlier.  We certainly don't
want a negative claim.  It's possible that the toolstack need
never call "unclaim" (and so such a hypercall/subop need
not even exist) as long as domain_reset_unclaimed_pages()
is called when a domain dies.  This draft doesn't even
provide unclaim... though if a reason for its existence
is determined, it should be easy to add.

Thanks for any feedback!

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

Diffstat:
 arch/x86/mm/mem_sharing.c |    4 -
 common/grant_table.c      |    2=20
 common/memory.c           |   15 ++++++-
 common/page_alloc.c       |   93 +++++++++++++++++++++++++++++++++++++++++=
++++-
 include/public/memory.h   |   19 +++++++++
 include/xen/mm.h          |    7 +++
 include/xen/sched.h       |    1=20
 7 files changed, 135 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..943a3b5 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d,
     }
=20
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_decrease_tot_pages(d, 1);
     drop_dom_ref =3D (d->tot_pages =3D=3D 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct p=
age_info *page)
     ASSERT(page_get_owner(page) =3D=3D dom_cow);
     page_set_owner(page, d);
=20
-    if ( d->tot_pages++ =3D=3D 0 )
+    if ( domain_increase_tot_pages(d, 1) =3D=3D 0 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..10ce78f 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1656,7 +1656,7 @@ gnttab_transfer(
         }
=20
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ =3D=3D 0) )
+        if ( unlikely(domain_increase_tot_pages(e, 1) =3D=3D 0) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..fc7b24c 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_=
memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
=20
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -=3D dec_count;
+                domain_decrease_tot_pages(d, dec_count);
                 drop_dom_ref =3D (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
=20
@@ -685,6 +685,19 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_=
PARAM(void) arg)
         break;
     }
=20
+    case XENMEM_claim_pages:
+
+        rc =3D rcu_lock_target_domain_by_id(domid, &d);
+        if ( rc )
+            return rc;
+
+        rc =3D domain_set_unclaimed_pages(d, reservation.nr_extents,
+                                        reservation.mem_flags);
+
+        rcu_unlock_domain(d);
+
+        break;
+
     default:
         rc =3D arch_memory_op(op, arg);
         break;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 15ebc66..ddda9a1 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -238,6 +238,90 @@ static long midsize_alloc_zone_pages;
 #define MIDSIZE_ALLOC_FRAC 128
=20
 static DEFINE_SPINLOCK(heap_lock);
+static long total_unclaimed_pages; /* total outstanding claims by all doma=
ins */
+
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
+
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    ASSERT(!spin_is_locked(&heap_lock));
+    spin_lock(&heap_lock);
+    d->tot_pages +=3D pages;
+    if ( d->unclaimed_pages )
+    {
+        dom_before =3D d->unclaimed_pages;
+        dom_after =3D dom_before - pages;
+        if ( (dom_before > 0) && (dom_after < 0) )
+            dom_claimed =3D 0;
+        else
+            dom_claimed =3D dom_after;
+=09sys_before =3D total_unclaimed_pages;
+=09sys_after =3D sys_before - (dom_before - dom_claimed);
+=09BUG_ON( (sys_before > 0) && (sys_after < 0) );
+        total_unclaimed_pages =3D sys_after;
+        d->unclaimed_pages =3D dom_claimed;
+    }
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    ASSERT(!spin_is_locked(&heap_lock));
+    spin_lock(&heap_lock);
+    d->tot_pages -=3D pages;
+    if ( d->unclaimed_pages )
+    {
+        d->unclaimed_pages +=3D pages;
+=09total_unclaimed_pages +=3D pages;
+    }
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
+                                unsigned long flags)
+{
+    int ret =3D -ENOMEM;
+    unsigned long avail_pages;
+
+    ASSERT(!spin_is_locked(&d->page_alloc_lock));
+    ASSERT(!spin_is_locked(&heap_lock));
+    spin_lock(&d->page_alloc_lock);
+    spin_lock(&heap_lock);
+    /* only one active claim per domain please */
+    if ( d->unclaimed_pages )
+=09goto out;
+    avail_pages =3D total_avail_pages;
+    if ( !(flags & XENMEM_CLAIMF_free_only) )
+        avail_pages +=3D tmem_freeable_pages();
+    avail_pages -=3D total_unclaimed_pages;
+    if ( pages < avail_pages )
+    {
+        /* ok if domain has allocated some pages before making a claim */
+        d->unclaimed_pages =3D pages - d->tot_pages;
+        total_unclaimed_pages +=3D total_unclaimed_pages;
+        ret =3D 0;
+    }
+out:
+    spin_unlock(&heap_lock);
+    spin_unlock(&d->page_alloc_lock);
+    return ret;
+}
+
+void domain_reset_unclaimed_pages(struct domain *d)
+{
+    ASSERT(!spin_is_locked(&d->page_alloc_lock));
+    ASSERT(!spin_is_locked(&heap_lock));
+    spin_lock(&d->page_alloc_lock);
+    spin_lock(&heap_lock);
+    total_unclaimed_pages -=3D d->unclaimed_pages;
+    d->unclaimed_pages =3D 0;
+    spin_unlock(&heap_lock);
+    spin_unlock(&d->page_alloc_lock);
+}
=20
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
@@ -442,6 +526,11 @@ static struct page_info *alloc_heap_pages(
=20
     spin_lock(&heap_lock);
=20
+    /* Claimed memory is considered not available */
+    if ( total_unclaimed_pages + request >
+         total_avail_pages + tmem_freeable_pages() )
+        goto not_found;
+
     /*
      * TMEM: When available memory is scarce due to tmem absorbing it, all=
ow
      * only mid-size allocations to avoid worst of fragmentation issues.
@@ -1291,7 +1380,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages =3D=3D 0) )
             get_knownalive_domain(d);
=20
-        d->tot_pages +=3D 1 << order;
+        domain_increase_tot_pages(d, 1 << order);
     }
=20
     for ( i =3D 0; i < (1 << order); i++ )
@@ -1375,7 +1464,7 @@ void free_domheap_pages(struct page_info *pg, unsigne=
d int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
=20
-        d->tot_pages -=3D 1 << order;
+        domain_decrease_tot_pages(d, 1 << order);
         drop_dom_ref =3D (d->tot_pages =3D=3D 0);
=20
         spin_unlock_recursive(&d->page_alloc_lock);
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index f1ddbc0..d8c8b4c 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -421,6 +421,25 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
=20
+/*
+ * Attempt to stake a claim for a domain on a quantity of pages
+ * of system RAM, but _not_ assign specific pageframes.  Only
+ * arithmetic is performed so the hypercall is very fast and need
+ * not be preemptible, thus sidestepping time-of-check-time-of-use
+ * races for memory allocation.  Returns 0 if the hypervisor page
+ * allocator has atomically and successfully claimed the requested
+ * number of pages, else -ENOMEM.
+ */
+#define XENMEM_claim_pages                  24
+/*
+ * XENMEM_claim_pages flags:
+ *  free_only: claim is successful only if sufficient free pages
+ *    are available.  If not set and tmem is enabled, hypervisor
+ *    may also consider tmem "freeable" pages to satisfy the claim.
+ */
+#define _XENMEM_CLAIMF_free_only            0
+#define XENMEM_CLAIMF_free_only             (1U<<_XENMEM_CLAIMF_free_only)
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
=20
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 64a0cc1..120b93f 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,13 @@ void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
=20
+/* Claim handling */
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges);
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges);
+int domain_set_unclaimed_pages(
+    struct domain *d, unsigned long pages, unsigned long flags);
+void domain_reset_unclaimed_pages(struct domain *d);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..480ef39 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -242,6 +242,7 @@ struct domain
     struct page_list_head page_list;  /* linked list */
     struct page_list_head xenpage_list; /* linked list (size xenheap_pages=
) */
     unsigned int     tot_pages;       /* number of pages currently possese=
d */
+    unsigned int     unclaimed_pages; /* pages claimed but not possessed  =
  */
     unsigned int     max_pages;       /* maximum value for tot_pages      =
  */
     atomic_t         shr_pages;       /* number of shared pages           =
  */
     atomic_t         paged_pages;     /* number of paged-out pages        =
  */

--__135284541349983992abhmt108.oracle.com
Content-Type: application/octet-stream; name="claim-121113.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-121113.patch"

ZGlmZiAtLWdpdCBhL3hlbi9hcmNoL3g4Ni9tbS9tZW1fc2hhcmluZy5jIGIveGVuL2FyY2gveDg2
L21tL21lbV9zaGFyaW5nLmMKaW5kZXggNTEwMzI4NS4uOTQzYTNiNSAxMDA2NDQKLS0tIGEveGVu
L2FyY2gveDg2L21tL21lbV9zaGFyaW5nLmMKKysrIGIveGVuL2FyY2gveDg2L21tL21lbV9zaGFy
aW5nLmMKQEAgLTYzOSw3ICs2MzksNyBAQCBzdGF0aWMgaW50IHBhZ2VfbWFrZV9zaGFyYWJsZShz
dHJ1Y3QgZG9tYWluICpkLAogICAgIH0KIAogICAgIHBhZ2Vfc2V0X293bmVyKHBhZ2UsIGRvbV9j
b3cpOwotICAgIGQtPnRvdF9wYWdlcy0tOworICAgIGRvbWFpbl9kZWNyZWFzZV90b3RfcGFnZXMo
ZCwgMSk7CiAgICAgZHJvcF9kb21fcmVmID0gKGQtPnRvdF9wYWdlcyA9PSAwKTsKICAgICBwYWdl
X2xpc3RfZGVsKHBhZ2UsICZkLT5wYWdlX2xpc3QpOwogICAgIHNwaW5fdW5sb2NrKCZkLT5wYWdl
X2FsbG9jX2xvY2spOwpAQCAtNjgwLDcgKzY4MCw3IEBAIHN0YXRpYyBpbnQgcGFnZV9tYWtlX3By
aXZhdGUoc3RydWN0IGRvbWFpbiAqZCwgc3RydWN0IHBhZ2VfaW5mbyAqcGFnZSkKICAgICBBU1N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zKApkaWZmIC0tZ2l0IGEveGVu
L2luY2x1ZGUveGVuL3NjaGVkLmggYi94ZW4vaW5jbHVkZS94ZW4vc2NoZWQuaAppbmRleCA2YzU1
MDM5Li40ODBlZjM5IDEwMDY0NAotLS0gYS94ZW4vaW5jbHVkZS94ZW4vc2NoZWQuaAorKysgYi94
ZW4vaW5jbHVkZS94ZW4vc2NoZWQuaApAQCAtMjQyLDYgKzI0Miw3IEBAIHN0cnVjdCBkb21haW4K
ICAgICBzdHJ1Y3QgcGFnZV9saXN0X2hlYWQgcGFnZV9saXN0OyAgLyogbGlua2VkIGxpc3QgKi8K
ICAgICBzdHJ1Y3QgcGFnZV9saXN0X2hlYWQgeGVucGFnZV9saXN0OyAvKiBsaW5rZWQgbGlzdCAo
c2l6ZSB4ZW5oZWFwX3BhZ2VzKSAqLwogICAgIHVuc2lnbmVkIGludCAgICAgdG90X3BhZ2VzOyAg
ICAgICAvKiBudW1iZXIgb2YgcGFnZXMgY3VycmVudGx5IHBvc3Nlc2VkICovCisgICAgdW5zaWdu
ZWQgaW50ICAgICB1bmNsYWltZWRfcGFnZXM7IC8qIHBhZ2VzIGNsYWltZWQgYnV0IG5vdCBwb3Nz
ZXNzZWQgICAgKi8KICAgICB1bnNpZ25lZCBpbnQgICAgIG1heF9wYWdlczsgICAgICAgLyogbWF4
aW11bSB2YWx1ZSBmb3IgdG90X3BhZ2VzICAgICAgICAqLwogICAgIGF0b21pY190ICAgICAgICAg
c2hyX3BhZ2VzOyAgICAgICAvKiBudW1iZXIgb2Ygc2hhcmVkIHBhZ2VzICAgICAgICAgICAgICov
CiAgICAgYXRvbWljX3QgICAgICAgICBwYWdlZF9wYWdlczsgICAgIC8qIG51bWJlciBvZiBwYWdl
ZC1vdXQgcGFnZXMgICAgICAgICAgKi8K
--__135284541349983992abhmt108.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__135284541349983992abhmt108.oracle.com--


From xen-devel-bounces@lists.xen.org Tue Nov 13 22:24:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 22:24:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYOtS-0000bL-At; Tue, 13 Nov 2012 22:23:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TYOtQ-0000bG-92
	for xen-devel@lists.xen.org; Tue, 13 Nov 2012 22:23:40 +0000
Received: from [85.158.137.99:34765] by server-11.bemta-3.messagelabs.com id
	B5/E6-19361-B68C2A05; Tue, 13 Nov 2012 22:23:39 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1352845416!17291090!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA1OTk2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14184 invoked from network); 13 Nov 2012 22:23:38 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-10.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 13 Nov 2012 22:23:38 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qADMNYMm022801
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 13 Nov 2012 22:23:35 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qADMNYNY017457
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 13 Nov 2012 22:23:34 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qADMNXQi019327; Tue, 13 Nov 2012 16:23:33 -0600
MIME-Version: 1.0
Message-ID: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
Date: Tue, 13 Nov 2012 14:23:29 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__135284541349983992abhmt108.oracle.com"
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an existing)
	hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__135284541349983992abhmt108.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This is a first cut of the hypervisor patch of the proposed
XENMEM_claim_pages hypercall/subop.  The goal of this hypercall
is to attempt to atomically and very quickly determine if
there are sufficient pages available in the system and, if
so, "set aside" that quantity of pages for future allocations
by that domain.  Unlike an existing hypercall such as
increase_reservation or populate_physmap, specific physical
pageframes are not assigned to the domain because this
cannot be done sufficiently quickly (especially for very large
allocations in an arbitrarily fragmented system) and so the
existing mechanisms result in classic time-of-check-time-of-use
(TOCTOU) races.  One can think of claiming as similar to a
"lazy" allocation, but subsequent hypercalls are required
to do the actual physical pageframe allocation.

This patch is (so far) only compile-tested.

I don't have a patch for the toolstack side, but I envision
a "xl create --claim" option to maximize backwards
compatibility while minimizing impact on existing toolstacks.

Code overview:

Though the hypercall simply does arithmetic within locks,
some of the semantics in the code may be a bit subtle
so let me explain a bit.

The key variables (d->unclaimed_pages and total_unclaimed_pages)
start at zero if no claim has yet been staked for any domain.
(Perhaps a better name is "claimed_but_not_yet_possessed" but that's
a bit unwieldy.)  If no claim hypercalls are executed, there
should be no impact on existing usage.

When a claim is successfully staked by a domain, it is like a
watermark but there is no record kept of the size of the claim.
Instead, d->unclaimed_pages is set to the difference between
d->tot_pages and the claim (d->tot_pages may normally be zero
but see Note 1).  When d->tot_pages increases or decreases,
d->unclaimed_pages atomically decreases or increases.  Once
d->unclaimed_pages reaches zero, the claim is satisfied and
d->unclaimed pages stays at zero -- unless a new claim is
subsequently staked.  See Note 2.

The systemwide variable total_unclaimed_pages is always the sum
of d->unclaimed_pages, across all domains.  A non-domain-
specific heap allocation will fail if total_unclaimed_pages
exceeds free (plus, on tmem enabled systems, freeable) pages.

Claim semantics may be modified by flags.  The initial
implementation has one flag, which discerns whether the
caller would like tmem freeable pages to be considered
in determining whether or not the claim can be successfully
staked. Future flags may, for example, specify that the
caller would like the claim to be successful only if there
are sufficient pages available on a single node (per Dario's
suggestion).

Note 1: Tim: I'm thinking this may resolve your concern that
the claim mechanism must be more complicated to handle
restricted memory allocations and order>0 allocations.
The proposed claim mechanism only guarantees a quantity of
order=3D=3D0 pages; if restricted allocations are required, these
are done first by the toolstack, and followed by the claim.
Order>0 allocations still work if memory is not fragmented,
but the claim mechanism doesn't guarantee anything but
a quantity of order=3D=3D0 pages.

Note 2: Tim: This arithmetic also indirectly implements the
"claim auto-expire" discussed earlier.  We certainly don't
want a negative claim.  It's possible that the toolstack need
never call "unclaim" (and so such a hypercall/subop need
not even exist) as long as domain_reset_unclaimed_pages()
is called when a domain dies.  This draft doesn't even
provide unclaim... though if a reason for its existence
is determined, it should be easy to add.

Thanks for any feedback!

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

Diffstat:
 arch/x86/mm/mem_sharing.c |    4 -
 common/grant_table.c      |    2=20
 common/memory.c           |   15 ++++++-
 common/page_alloc.c       |   93 +++++++++++++++++++++++++++++++++++++++++=
++++-
 include/public/memory.h   |   19 +++++++++
 include/xen/mm.h          |    7 +++
 include/xen/sched.h       |    1=20
 7 files changed, 135 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..943a3b5 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d,
     }
=20
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_decrease_tot_pages(d, 1);
     drop_dom_ref =3D (d->tot_pages =3D=3D 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct p=
age_info *page)
     ASSERT(page_get_owner(page) =3D=3D dom_cow);
     page_set_owner(page, d);
=20
-    if ( d->tot_pages++ =3D=3D 0 )
+    if ( domain_increase_tot_pages(d, 1) =3D=3D 0 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..10ce78f 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1656,7 +1656,7 @@ gnttab_transfer(
         }
=20
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ =3D=3D 0) )
+        if ( unlikely(domain_increase_tot_pages(e, 1) =3D=3D 0) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..fc7b24c 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_=
memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
=20
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -=3D dec_count;
+                domain_decrease_tot_pages(d, dec_count);
                 drop_dom_ref =3D (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
=20
@@ -685,6 +685,19 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_=
PARAM(void) arg)
         break;
     }
=20
+    case XENMEM_claim_pages:
+
+        rc =3D rcu_lock_target_domain_by_id(domid, &d);
+        if ( rc )
+            return rc;
+
+        rc =3D domain_set_unclaimed_pages(d, reservation.nr_extents,
+                                        reservation.mem_flags);
+
+        rcu_unlock_domain(d);
+
+        break;
+
     default:
         rc =3D arch_memory_op(op, arg);
         break;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 15ebc66..ddda9a1 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -238,6 +238,90 @@ static long midsize_alloc_zone_pages;
 #define MIDSIZE_ALLOC_FRAC 128
=20
 static DEFINE_SPINLOCK(heap_lock);
+static long total_unclaimed_pages; /* total outstanding claims by all doma=
ins */
+
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
+
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    ASSERT(!spin_is_locked(&heap_lock));
+    spin_lock(&heap_lock);
+    d->tot_pages +=3D pages;
+    if ( d->unclaimed_pages )
+    {
+        dom_before =3D d->unclaimed_pages;
+        dom_after =3D dom_before - pages;
+        if ( (dom_before > 0) && (dom_after < 0) )
+            dom_claimed =3D 0;
+        else
+            dom_claimed =3D dom_after;
+=09sys_before =3D total_unclaimed_pages;
+=09sys_after =3D sys_before - (dom_before - dom_claimed);
+=09BUG_ON( (sys_before > 0) && (sys_after < 0) );
+        total_unclaimed_pages =3D sys_after;
+        d->unclaimed_pages =3D dom_claimed;
+    }
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    ASSERT(!spin_is_locked(&heap_lock));
+    spin_lock(&heap_lock);
+    d->tot_pages -=3D pages;
+    if ( d->unclaimed_pages )
+    {
+        d->unclaimed_pages +=3D pages;
+=09total_unclaimed_pages +=3D pages;
+    }
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
+                                unsigned long flags)
+{
+    int ret =3D -ENOMEM;
+    unsigned long avail_pages;
+
+    ASSERT(!spin_is_locked(&d->page_alloc_lock));
+    ASSERT(!spin_is_locked(&heap_lock));
+    spin_lock(&d->page_alloc_lock);
+    spin_lock(&heap_lock);
+    /* only one active claim per domain please */
+    if ( d->unclaimed_pages )
+=09goto out;
+    avail_pages =3D total_avail_pages;
+    if ( !(flags & XENMEM_CLAIMF_free_only) )
+        avail_pages +=3D tmem_freeable_pages();
+    avail_pages -=3D total_unclaimed_pages;
+    if ( pages < avail_pages )
+    {
+        /* ok if domain has allocated some pages before making a claim */
+        d->unclaimed_pages =3D pages - d->tot_pages;
+        total_unclaimed_pages +=3D total_unclaimed_pages;
+        ret =3D 0;
+    }
+out:
+    spin_unlock(&heap_lock);
+    spin_unlock(&d->page_alloc_lock);
+    return ret;
+}
+
+void domain_reset_unclaimed_pages(struct domain *d)
+{
+    ASSERT(!spin_is_locked(&d->page_alloc_lock));
+    ASSERT(!spin_is_locked(&heap_lock));
+    spin_lock(&d->page_alloc_lock);
+    spin_lock(&heap_lock);
+    total_unclaimed_pages -=3D d->unclaimed_pages;
+    d->unclaimed_pages =3D 0;
+    spin_unlock(&heap_lock);
+    spin_unlock(&d->page_alloc_lock);
+}
=20
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
@@ -442,6 +526,11 @@ static struct page_info *alloc_heap_pages(
=20
     spin_lock(&heap_lock);
=20
+    /* Claimed memory is considered not available */
+    if ( total_unclaimed_pages + request >
+         total_avail_pages + tmem_freeable_pages() )
+        goto not_found;
+
     /*
      * TMEM: When available memory is scarce due to tmem absorbing it, all=
ow
      * only mid-size allocations to avoid worst of fragmentation issues.
@@ -1291,7 +1380,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages =3D=3D 0) )
             get_knownalive_domain(d);
=20
-        d->tot_pages +=3D 1 << order;
+        domain_increase_tot_pages(d, 1 << order);
     }
=20
     for ( i =3D 0; i < (1 << order); i++ )
@@ -1375,7 +1464,7 @@ void free_domheap_pages(struct page_info *pg, unsigne=
d int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
=20
-        d->tot_pages -=3D 1 << order;
+        domain_decrease_tot_pages(d, 1 << order);
         drop_dom_ref =3D (d->tot_pages =3D=3D 0);
=20
         spin_unlock_recursive(&d->page_alloc_lock);
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index f1ddbc0..d8c8b4c 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -421,6 +421,25 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
=20
+/*
+ * Attempt to stake a claim for a domain on a quantity of pages
+ * of system RAM, but _not_ assign specific pageframes.  Only
+ * arithmetic is performed so the hypercall is very fast and need
+ * not be preemptible, thus sidestepping time-of-check-time-of-use
+ * races for memory allocation.  Returns 0 if the hypervisor page
+ * allocator has atomically and successfully claimed the requested
+ * number of pages, else -ENOMEM.
+ */
+#define XENMEM_claim_pages                  24
+/*
+ * XENMEM_claim_pages flags:
+ *  free_only: claim is successful only if sufficient free pages
+ *    are available.  If not set and tmem is enabled, hypervisor
+ *    may also consider tmem "freeable" pages to satisfy the claim.
+ */
+#define _XENMEM_CLAIMF_free_only            0
+#define XENMEM_CLAIMF_free_only             (1U<<_XENMEM_CLAIMF_free_only)
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
=20
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 64a0cc1..120b93f 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,13 @@ void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
=20
+/* Claim handling */
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges);
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges);
+int domain_set_unclaimed_pages(
+    struct domain *d, unsigned long pages, unsigned long flags);
+void domain_reset_unclaimed_pages(struct domain *d);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..480ef39 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -242,6 +242,7 @@ struct domain
     struct page_list_head page_list;  /* linked list */
     struct page_list_head xenpage_list; /* linked list (size xenheap_pages=
) */
     unsigned int     tot_pages;       /* number of pages currently possese=
d */
+    unsigned int     unclaimed_pages; /* pages claimed but not possessed  =
  */
     unsigned int     max_pages;       /* maximum value for tot_pages      =
  */
     atomic_t         shr_pages;       /* number of shared pages           =
  */
     atomic_t         paged_pages;     /* number of paged-out pages        =
  */

--__135284541349983992abhmt108.oracle.com
Content-Type: application/octet-stream; name="claim-121113.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-121113.patch"

ZGlmZiAtLWdpdCBhL3hlbi9hcmNoL3g4Ni9tbS9tZW1fc2hhcmluZy5jIGIveGVuL2FyY2gveDg2
L21tL21lbV9zaGFyaW5nLmMKaW5kZXggNTEwMzI4NS4uOTQzYTNiNSAxMDA2NDQKLS0tIGEveGVu
L2FyY2gveDg2L21tL21lbV9zaGFyaW5nLmMKKysrIGIveGVuL2FyY2gveDg2L21tL21lbV9zaGFy
aW5nLmMKQEAgLTYzOSw3ICs2MzksNyBAQCBzdGF0aWMgaW50IHBhZ2VfbWFrZV9zaGFyYWJsZShz
dHJ1Y3QgZG9tYWluICpkLAogICAgIH0KIAogICAgIHBhZ2Vfc2V0X293bmVyKHBhZ2UsIGRvbV9j
b3cpOwotICAgIGQtPnRvdF9wYWdlcy0tOworICAgIGRvbWFpbl9kZWNyZWFzZV90b3RfcGFnZXMo
ZCwgMSk7CiAgICAgZHJvcF9kb21fcmVmID0gKGQtPnRvdF9wYWdlcyA9PSAwKTsKICAgICBwYWdl
X2xpc3RfZGVsKHBhZ2UsICZkLT5wYWdlX2xpc3QpOwogICAgIHNwaW5fdW5sb2NrKCZkLT5wYWdl
X2FsbG9jX2xvY2spOwpAQCAtNjgwLDcgKzY4MCw3IEBAIHN0YXRpYyBpbnQgcGFnZV9tYWtlX3By
aXZhdGUoc3RydWN0IGRvbWFpbiAqZCwgc3RydWN0IHBhZ2VfaW5mbyAqcGFnZSkKICAgICBBU1NF
UlQocGFnZV9nZXRfb3duZXIocGFnZSkgPT0g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UveGVuL3NjaGVkLmggYi94ZW4vaW5jbHVkZS94ZW4vc2NoZWQuaAppbmRleCA2YzU1
MDM5Li40ODBlZjM5IDEwMDY0NAotLS0gYS94ZW4vaW5jbHVkZS94ZW4vc2NoZWQuaAorKysgYi94
ZW4vaW5jbHVkZS94ZW4vc2NoZWQuaApAQCAtMjQyLDYgKzI0Miw3IEBAIHN0cnVjdCBkb21haW4K
ICAgICBzdHJ1Y3QgcGFnZV9saXN0X2hlYWQgcGFnZV9saXN0OyAgLyogbGlua2VkIGxpc3QgKi8K
ICAgICBzdHJ1Y3QgcGFnZV9saXN0X2hlYWQgeGVucGFnZV9saXN0OyAvKiBsaW5rZWQgbGlzdCAo
c2l6ZSB4ZW5oZWFwX3BhZ2VzKSAqLwogICAgIHVuc2lnbmVkIGludCAgICAgdG90X3BhZ2VzOyAg
ICAgICAvKiBudW1iZXIgb2YgcGFnZXMgY3VycmVudGx5IHBvc3Nlc2VkICovCisgICAgdW5zaWdu
ZWQgaW50ICAgICB1bmNsYWltZWRfcGFnZXM7IC8qIHBhZ2VzIGNsYWltZWQgYnV0IG5vdCBwb3Nz
ZXNzZWQgICAgKi8KICAgICB1bnNpZ25lZCBpbnQgICAgIG1heF9wYWdlczsgICAgICAgLyogbWF4
aW11bSB2YWx1ZSBmb3IgdG90X3BhZ2VzICAgICAgICAqLwogICAgIGF0b21pY190ICAgICAgICAg
c2hyX3BhZ2VzOyAgICAgICAvKiBudW1iZXIgb2Ygc2hhcmVkIHBhZ2VzICAgICAgICAgICAgICov
CiAgICAgYXRvbWljX3QgICAgICAgICBwYWdlZF9wYWdlczsgICAgIC8qIG51bWJlciBvZiBwYWdl
ZC1vdXQgcGFnZXMgICAgICAgICAgKi8K
--__135284541349983992abhmt108.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__135284541349983992abhmt108.oracle.com--


From xen-devel-bounces@lists.xen.org Tue Nov 13 23:43:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 23:43:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYQ8O-00027b-Rs; Tue, 13 Nov 2012 23:43:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYQ8N-00027W-8e
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 23:43:11 +0000
Received: from [85.158.137.99:23524] by server-10.bemta-3.messagelabs.com id
	AB/DA-19806-E0BD2A05; Tue, 13 Nov 2012 23:43:10 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1352850189!18105728!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32289 invoked from network); 13 Nov 2012 23:43:09 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 23:43:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,768,1352073600"; d="scan'208";a="15790395"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 23:43:05 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 13 Nov 2012 23:43:04 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYQ8G-0001Qh-Rj;
	Tue, 13 Nov 2012 23:43:04 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYQ8G-0004iv-8v;
	Tue, 13 Nov 2012 23:43:04 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14387-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 13 Nov 2012 23:43:04 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.1-testing test] 14387: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14387 xen-4.1-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14387/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail like 14149
 test-amd64-amd64-xl-sedf     14 guest-localmigrate/x10       fail   like 14149

Tests which did not succeed, but are not blocking:
 test-amd64-i386-qemuu-rhel6hvm-intel 11 leak-check/check       fail never pass
 test-amd64-i386-qemuu-rhel6hvm-amd 11 leak-check/check         fail never pass
 test-amd64-i386-rhel6hvm-intel 11 leak-check/check             fail never pass
 test-amd64-i386-rhel6hvm-amd 11 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-i386-i386-xl-qemuu-winxpsp3 13 guest-stop                 fail never pass

version targeted for testing:
 xen                  26281a1650dc
baseline version:
 xen                  700d0f03d50a

------------------------------------------------------------
People who touched revisions under test:
  Chuang Cao <chuang.cao@oracle.com>
  Frediano Ziglio <frediano.ziglio@citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Joe Jin <joe.jin@oracle.com>
  Keir Fraser <keir@xen.org>
  Matt Wilson <msw@amazon.com>
  Olaf Hering <olaf@aepfle.de>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               fail    
 test-amd64-i386-qemuu-rhel6hvm-intel                         fail    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 pass    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.1-testing
+ revision=26281a1650dc
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.1-testing 26281a1650dc
+ branch=xen-4.1-testing
+ revision=26281a1650dc
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.1-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.1-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.1-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.1-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.1-testing.git
++ : daily-cron.xen-4.1-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.1-testing.git
+ info_linux_tree xen-4.1-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.1-testing.hg
+ hg push -r 26281a1650dc ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 10 changesets with 10 changes to 7 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 13 23:43:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Nov 2012 23:43:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYQ8O-00027b-Rs; Tue, 13 Nov 2012 23:43:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYQ8N-00027W-8e
	for xen-devel@lists.xensource.com; Tue, 13 Nov 2012 23:43:11 +0000
Received: from [85.158.137.99:23524] by server-10.bemta-3.messagelabs.com id
	AB/DA-19806-E0BD2A05; Tue, 13 Nov 2012 23:43:10 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1352850189!18105728!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTgzMTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32289 invoked from network); 13 Nov 2012 23:43:09 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	13 Nov 2012 23:43:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,768,1352073600"; d="scan'208";a="15790395"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	13 Nov 2012 23:43:05 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 13 Nov 2012 23:43:04 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYQ8G-0001Qh-Rj;
	Tue, 13 Nov 2012 23:43:04 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYQ8G-0004iv-8v;
	Tue, 13 Nov 2012 23:43:04 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14387-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 13 Nov 2012 23:43:04 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.1-testing test] 14387: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14387 xen-4.1-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14387/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail like 14149
 test-amd64-amd64-xl-sedf     14 guest-localmigrate/x10       fail   like 14149

Tests which did not succeed, but are not blocking:
 test-amd64-i386-qemuu-rhel6hvm-intel 11 leak-check/check       fail never pass
 test-amd64-i386-qemuu-rhel6hvm-amd 11 leak-check/check         fail never pass
 test-amd64-i386-rhel6hvm-intel 11 leak-check/check             fail never pass
 test-amd64-i386-rhel6hvm-amd 11 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-i386-i386-xl-qemuu-winxpsp3 13 guest-stop                 fail never pass

version targeted for testing:
 xen                  26281a1650dc
baseline version:
 xen                  700d0f03d50a

------------------------------------------------------------
People who touched revisions under test:
  Chuang Cao <chuang.cao@oracle.com>
  Frediano Ziglio <frediano.ziglio@citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Joe Jin <joe.jin@oracle.com>
  Keir Fraser <keir@xen.org>
  Matt Wilson <msw@amazon.com>
  Olaf Hering <olaf@aepfle.de>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               fail    
 test-amd64-i386-qemuu-rhel6hvm-intel                         fail    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 pass    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.1-testing
+ revision=26281a1650dc
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.1-testing 26281a1650dc
+ branch=xen-4.1-testing
+ revision=26281a1650dc
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.1-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.1-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.1-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.1-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.1-testing.git
++ : daily-cron.xen-4.1-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.1-testing.git
+ info_linux_tree xen-4.1-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.1-testing.hg
+ hg push -r 26281a1650dc ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 10 changesets with 10 changes to 7 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 00:09:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 00:09:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYQXG-0003RT-4R; Wed, 14 Nov 2012 00:08:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TYQXF-0003RO-JM
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 00:08:53 +0000
Received: from [85.158.139.211:9410] by server-6.bemta-5.messagelabs.com id
	F8/40-19321-411E2A05; Wed, 14 Nov 2012 00:08:52 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1352851730!19626006!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2MTE2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2951 invoked from network); 14 Nov 2012 00:08:51 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 00:08:51 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAE08ULc012641
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 00:08:31 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAE08TCA005099
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Nov 2012 00:08:30 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAE08TQb014601; Tue, 13 Nov 2012 18:08:29 -0600
MIME-Version: 1.0
Message-ID: <90421d4a-2b5e-49de-9c0f-e4c914980e7f@default>
Date: Tue, 13 Nov 2012 16:08:26 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, Ian Jackson
	<Ian.Jackson@eu.citrix.com>
References: <38bc9a60-827c-41f8-a667-e08960b8c135@default>
In-Reply-To: <38bc9a60-827c-41f8-a667-e08960b8c135@default>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen-tmem-list-parse: fix ugly parse output
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ping?  (Sorry if I am being too impatient... I just saw
a tmem hypervisor fix go in and it reminded me to look
for this tools fix.)

> -----Original Message-----
> From: Dan Magenheimer
> Sent: Thursday, November 01, 2012 10:43 AM
> To: Ian Campbell; Ian Jackson
> Cc: xen-devel@lists.xen.org
> Subject: [PATCH] xen-tmem-list-parse: fix ugly parse output
> 
> Hmmm... It appears I never posted the corrected version of this patch
> so it never made it upstream.  See:
> 
> http://lists.xen.org/archives/html/xen-devel/2011-11/msg00587.html
> http://lists.xen.org/archives/html/xen-devel/2011-11/msg02145.html
> 
> It would be good if this very minor fix was also applied to 4.2
> (and, if possible, 4.1).
> 
> Thanks,
> Dan
> 
> ===================
> 
> The program xen-tmem-list-parse parses the output of xm/xl tmem-list
> into human-readable format.  A missing NULL terminator sometimes
> causes garbage to be spewed where the two-letter pool type
> should be output.
> 
> Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
> ---
>  tools/misc/xen-tmem-list-parse.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/misc/xen-tmem-list-parse.c b/tools/misc/xen-tmem-list-parse.c
> index 977e4d3..f32b107 100644
> --- a/tools/misc/xen-tmem-list-parse.c
> +++ b/tools/misc/xen-tmem-list-parse.c
> @@ -243,6 +243,7 @@ void parse_pool(char *s)
>      unsigned long long flush_objs = parse(s,"ot");
> 
>      parse_string(s,"PT",pool_type,2);
> +    pool_type[2] = '\0';
>      if (pool_type[1] == 'S')
>          return; /* no need to repeat print data for shared pools */
>      printf("domid%lu,id%lu[%s]:pgp=%llu(max=%llu) obj=%llu(%llu) "
> @@ -286,6 +287,7 @@ void parse_shared_pool(char *s)
>      unsigned long long flush_objs = parse(s,"ot");
> 
>      parse_string(s,"PT",pool_type,2);
> +    pool_type[2] = '\0';
>      parse_sharers(s,"SC",buf,BUFSIZE);
>      printf("poolid=%lu[%s] uuid=%llx.%llx, shared-by:%s: "
>             "pgp=%llu(max=%llu) obj=%llu(%llu) "
> --
> 1.7.1

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 00:09:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 00:09:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYQXG-0003RT-4R; Wed, 14 Nov 2012 00:08:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TYQXF-0003RO-JM
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 00:08:53 +0000
Received: from [85.158.139.211:9410] by server-6.bemta-5.messagelabs.com id
	F8/40-19321-411E2A05; Wed, 14 Nov 2012 00:08:52 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1352851730!19626006!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2MTE2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2951 invoked from network); 14 Nov 2012 00:08:51 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 00:08:51 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAE08ULc012641
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 00:08:31 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAE08TCA005099
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Nov 2012 00:08:30 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAE08TQb014601; Tue, 13 Nov 2012 18:08:29 -0600
MIME-Version: 1.0
Message-ID: <90421d4a-2b5e-49de-9c0f-e4c914980e7f@default>
Date: Tue, 13 Nov 2012 16:08:26 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, Ian Jackson
	<Ian.Jackson@eu.citrix.com>
References: <38bc9a60-827c-41f8-a667-e08960b8c135@default>
In-Reply-To: <38bc9a60-827c-41f8-a667-e08960b8c135@default>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen-tmem-list-parse: fix ugly parse output
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ping?  (Sorry if I am being too impatient... I just saw
a tmem hypervisor fix go in and it reminded me to look
for this tools fix.)

> -----Original Message-----
> From: Dan Magenheimer
> Sent: Thursday, November 01, 2012 10:43 AM
> To: Ian Campbell; Ian Jackson
> Cc: xen-devel@lists.xen.org
> Subject: [PATCH] xen-tmem-list-parse: fix ugly parse output
> 
> Hmmm... It appears I never posted the corrected version of this patch
> so it never made it upstream.  See:
> 
> http://lists.xen.org/archives/html/xen-devel/2011-11/msg00587.html
> http://lists.xen.org/archives/html/xen-devel/2011-11/msg02145.html
> 
> It would be good if this very minor fix was also applied to 4.2
> (and, if possible, 4.1).
> 
> Thanks,
> Dan
> 
> ===================
> 
> The program xen-tmem-list-parse parses the output of xm/xl tmem-list
> into human-readable format.  A missing NULL terminator sometimes
> causes garbage to be spewed where the two-letter pool type
> should be output.
> 
> Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
> ---
>  tools/misc/xen-tmem-list-parse.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/misc/xen-tmem-list-parse.c b/tools/misc/xen-tmem-list-parse.c
> index 977e4d3..f32b107 100644
> --- a/tools/misc/xen-tmem-list-parse.c
> +++ b/tools/misc/xen-tmem-list-parse.c
> @@ -243,6 +243,7 @@ void parse_pool(char *s)
>      unsigned long long flush_objs = parse(s,"ot");
> 
>      parse_string(s,"PT",pool_type,2);
> +    pool_type[2] = '\0';
>      if (pool_type[1] == 'S')
>          return; /* no need to repeat print data for shared pools */
>      printf("domid%lu,id%lu[%s]:pgp=%llu(max=%llu) obj=%llu(%llu) "
> @@ -286,6 +287,7 @@ void parse_shared_pool(char *s)
>      unsigned long long flush_objs = parse(s,"ot");
> 
>      parse_string(s,"PT",pool_type,2);
> +    pool_type[2] = '\0';
>      parse_sharers(s,"SC",buf,BUFSIZE);
>      printf("poolid=%lu[%s] uuid=%llx.%llx, shared-by:%s: "
>             "pgp=%llu(max=%llu) obj=%llu(%llu) "
> --
> 1.7.1

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 00:38:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 00:38:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYQzH-0004Q7-Hd; Wed, 14 Nov 2012 00:37:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TYQzG-0004Q2-29
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 00:37:50 +0000
Received: from [85.158.138.51:65042] by server-14.bemta-3.messagelabs.com id
	02/D7-12788-CD7E2A05; Wed, 14 Nov 2012 00:37:48 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1352853466!29819419!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI3OTEzOQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20811 invoked from network); 14 Nov 2012 00:37:47 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-16.tower-174.messagelabs.com with SMTP;
	14 Nov 2012 00:37:47 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 13 Nov 2012 16:37:45 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,247,1352102400"; d="scan'208";a="246617621"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by fmsmga001.fm.intel.com with ESMTP; 13 Nov 2012 16:37:43 -0800
Received: from fmsmsx101.amr.corp.intel.com (10.19.9.52) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 13 Nov 2012 16:37:42 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX101.amr.corp.intel.com (10.19.9.52) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 13 Nov 2012 16:37:42 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Wed, 14 Nov 2012 08:37:40 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, "Zhang, Yang Z" <yang.z.zhang@intel.com>
Thread-Topic: [Xen-devel] iommu=dom0-passthrough behavior
Thread-Index: AQHNwXYJqLF+2AjHBkK5l/uG97/aIZfnbfFggAAyLdWAADp0YP//g6QAgAEdtPA=
Date: Wed, 14 Nov 2012 00:37:39 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
	<50A2755402000078000A837D@nat28.tlf.novell.com>
In-Reply-To: <50A2755402000078000A837D@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>, "Zhang,
	Xiantao" <xiantao.zhang@intel.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Tuesday, November 13, 2012 11:29 PM
> To: Zhang, Xiantao; Zhang, Yang Z
> Cc: wei.huang2@amd.com; weiwang.dd@gmail.com; xen-devel
> Subject: RE: [Xen-devel] iommu=dom0-passthrough behavior
> 
> >>> On 13.11.12 at 16:02, "Zhang, Xiantao" <xiantao.zhang@intel.com>
> wrote:
> >> From: Jan Beulich [mailto:JBeulich@suse.com]
> >> > If software cannot see it, then how to use it? If there still have
> >> > an approach to detect it, then xen can do it too and setup the
> >> > context entry as passthrough.
> >>
> >> We see it the latest at the point the fault occurs. So there are
> >> multiple
> >> options:
> >> a) if the device is "real" as in having a valid config space despite
> >>     func 0 not advertising itself as multi-function, we have ways to
> >>     discover the device (at boot time)
> >
> > I think current Xen logic also covers multi-function devices case.
> > When Xen boots up, it will scan all functions of devices on each bus,
> > through reads their vendor ID.  If the vendor ID is valid, Xen deems
> > this BDF has a real device/function existed there
> 
> Not anymore - we're now honoring the multi-function flag in
> _scan_pci_devices() (as Linux always did in its bus scan logic); see c/s
> 22337:7afd8dd1d6cb (with a subsequent adjustment in c/s
> 25869:59b3663316db).
> 
> >> b) we could insert the context entry in the fault handler, assuming
> >>     the device is able to recover
> > At least current VT-d doesn't have recovery fault supported, so each
> > triggered faults are fatal.
> 
> Fatal in what sense? I would assume that if the driver retries the operation, it
> would succeed if the first fault causes the context entry to be inserted.

If the driver knows the fact, it should work.  For VT-d without fault recovery capability,  it should do nothing for the unknown translations which maybe faked by some malicious devices. 

> >> c) we could provide a command line option to allow fake devices to
> >>     be create
> >
> > Agree, this maybe a feasible solution I can figure out, so far.
> >
> >> d) we could create context entries for all BDFs, whether or not a
> >>     device exists there
> >
> > As I said,  this maybe bring security issue. Even for the
> > iommu-passthrough option,  it is also not suggested to be used if security is
> considered.
> 
> As said - it is clear that the basic thing here (using
> "iommu=dom0-passthrough") is already weakening security. So security isn't
> the concern in this discussion, that's left to whoever is intending to use that
> option.

Okay,  I vote your option C if don't care security. 
Xiantao




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 00:38:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 00:38:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYQzH-0004Q7-Hd; Wed, 14 Nov 2012 00:37:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TYQzG-0004Q2-29
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 00:37:50 +0000
Received: from [85.158.138.51:65042] by server-14.bemta-3.messagelabs.com id
	02/D7-12788-CD7E2A05; Wed, 14 Nov 2012 00:37:48 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1352853466!29819419!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI3OTEzOQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20811 invoked from network); 14 Nov 2012 00:37:47 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-16.tower-174.messagelabs.com with SMTP;
	14 Nov 2012 00:37:47 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 13 Nov 2012 16:37:45 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,247,1352102400"; d="scan'208";a="246617621"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by fmsmga001.fm.intel.com with ESMTP; 13 Nov 2012 16:37:43 -0800
Received: from fmsmsx101.amr.corp.intel.com (10.19.9.52) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 13 Nov 2012 16:37:42 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX101.amr.corp.intel.com (10.19.9.52) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 13 Nov 2012 16:37:42 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.123]) with mapi id
	14.01.0355.002; Wed, 14 Nov 2012 08:37:40 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, "Zhang, Yang Z" <yang.z.zhang@intel.com>
Thread-Topic: [Xen-devel] iommu=dom0-passthrough behavior
Thread-Index: AQHNwXYJqLF+2AjHBkK5l/uG97/aIZfnbfFggAAyLdWAADp0YP//g6QAgAEdtPA=
Date: Wed, 14 Nov 2012 00:37:39 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
	<50A2755402000078000A837D@nat28.tlf.novell.com>
In-Reply-To: <50A2755402000078000A837D@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>, "Zhang,
	Xiantao" <xiantao.zhang@intel.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Tuesday, November 13, 2012 11:29 PM
> To: Zhang, Xiantao; Zhang, Yang Z
> Cc: wei.huang2@amd.com; weiwang.dd@gmail.com; xen-devel
> Subject: RE: [Xen-devel] iommu=dom0-passthrough behavior
> 
> >>> On 13.11.12 at 16:02, "Zhang, Xiantao" <xiantao.zhang@intel.com>
> wrote:
> >> From: Jan Beulich [mailto:JBeulich@suse.com]
> >> > If software cannot see it, then how to use it? If there still have
> >> > an approach to detect it, then xen can do it too and setup the
> >> > context entry as passthrough.
> >>
> >> We see it the latest at the point the fault occurs. So there are
> >> multiple
> >> options:
> >> a) if the device is "real" as in having a valid config space despite
> >>     func 0 not advertising itself as multi-function, we have ways to
> >>     discover the device (at boot time)
> >
> > I think current Xen logic also covers multi-function devices case.
> > When Xen boots up, it will scan all functions of devices on each bus,
> > through reads their vendor ID.  If the vendor ID is valid, Xen deems
> > this BDF has a real device/function existed there
> 
> Not anymore - we're now honoring the multi-function flag in
> _scan_pci_devices() (as Linux always did in its bus scan logic); see c/s
> 22337:7afd8dd1d6cb (with a subsequent adjustment in c/s
> 25869:59b3663316db).
> 
> >> b) we could insert the context entry in the fault handler, assuming
> >>     the device is able to recover
> > At least current VT-d doesn't have recovery fault supported, so each
> > triggered faults are fatal.
> 
> Fatal in what sense? I would assume that if the driver retries the operation, it
> would succeed if the first fault causes the context entry to be inserted.

If the driver knows the fact, it should work.  For VT-d without fault recovery capability,  it should do nothing for the unknown translations which maybe faked by some malicious devices. 

> >> c) we could provide a command line option to allow fake devices to
> >>     be create
> >
> > Agree, this maybe a feasible solution I can figure out, so far.
> >
> >> d) we could create context entries for all BDFs, whether or not a
> >>     device exists there
> >
> > As I said,  this maybe bring security issue. Even for the
> > iommu-passthrough option,  it is also not suggested to be used if security is
> considered.
> 
> As said - it is clear that the basic thing here (using
> "iommu=dom0-passthrough") is already weakening security. So security isn't
> the concern in this discussion, that's left to whoever is intending to use that
> option.

Okay,  I vote your option C if don't care security. 
Xiantao




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 01:22:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 01:22:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYRfo-0000hj-Fj; Wed, 14 Nov 2012 01:21:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TYRfm-0000hH-ON
	for Xen-devel@lists.xensource.com; Wed, 14 Nov 2012 01:21:46 +0000
Received: from [85.158.143.99:34051] by server-2.bemta-4.messagelabs.com id
	5B/0F-28922-A22F2A05; Wed, 14 Nov 2012 01:21:46 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1352856104!29848576!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2MTE2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13682 invoked from network); 14 Nov 2012 01:21:45 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 01:21:45 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAE1Lf5u030679
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 01:21:42 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAE1LeuH018934
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Nov 2012 01:21:41 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAE1LeoG028233; Tue, 13 Nov 2012 19:21:40 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 17:21:40 -0800
Date: Tue, 13 Nov 2012 17:21:38 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121113172138.1d3274d9@mantra.us.oracle.com>
In-Reply-To: <1352800853.7491.22.camel@zakaz.uk.xensource.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
	<1352800853.7491.22.camel@zakaz.uk.xensource.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 13 Nov 2012 10:00:53 +0000
Ian Campbell <Ian.Campbell@citrix.com> wrote:

> On Tue, 2012-11-13 at 03:09 +0000, Mukesh Rathor wrote:
> > Hi,
> > 
> > I am wondering if there's libxl expert who can help me make some PVH
> > related changes to libxl, pref in the US time zone. I could consult
> > on irc or the phone.
> 
> I think most of the libxl experts are in European time zones. Probably
> the best bet is to just ask your questions either here or on IRC.

For PVH, xc_dom_feature_translated is not returning true, looks like
its not finding XENFEAT_auto_translated_physmap set in the elf???

I've modified the arch/x86/xen/xen-head.S file to include the PVH:

ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "!writable_page_tables|pae_pgdir_above_4gb"FEATURES_PVH)

where
#define FEATURES_PVH "|writable_descriptor_tables" \
                    "|auto_translated_physmap" \
                    "|supervisor_mode_kernel" \
                    "|hvm_callback_vector"


So, not sure why it's failing. In xc_dom_parse_image(), I see 
dom->parms.f_required is 0. I assume this is what the kernel is built
with and should be filled with the values above? Presumably, 
dom->f_requested is what the library expects the kernel to have. 
I set it as:

libxl__build_pv():
    if (is_pvh) {
        printf("info..features:%s\n", info->u.pv.features);
        info->u.pv.features = strdup("auto_translated_physmap");
    }

which is temporary hack, and I wanna consult with libxl expert for the
proper way to to this. I don't see any thing similar being done.

I can't tell why f_active is there. I also see supported, may be thats
the string of what the kernel supports. It is set to 0x11 ??? 

Hmm... Using readelf and hexeditor, I see the feature string properly
set in vmlinux (assume its in bzImage too). So, not sure whats going on.

thanks
Mukesh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 01:22:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 01:22:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYRfo-0000hj-Fj; Wed, 14 Nov 2012 01:21:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TYRfm-0000hH-ON
	for Xen-devel@lists.xensource.com; Wed, 14 Nov 2012 01:21:46 +0000
Received: from [85.158.143.99:34051] by server-2.bemta-4.messagelabs.com id
	5B/0F-28922-A22F2A05; Wed, 14 Nov 2012 01:21:46 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1352856104!29848576!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2MTE2Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13682 invoked from network); 14 Nov 2012 01:21:45 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 01:21:45 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAE1Lf5u030679
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 01:21:42 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAE1LeuH018934
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Nov 2012 01:21:41 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAE1LeoG028233; Tue, 13 Nov 2012 19:21:40 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 17:21:40 -0800
Date: Tue, 13 Nov 2012 17:21:38 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121113172138.1d3274d9@mantra.us.oracle.com>
In-Reply-To: <1352800853.7491.22.camel@zakaz.uk.xensource.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
	<1352800853.7491.22.camel@zakaz.uk.xensource.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 13 Nov 2012 10:00:53 +0000
Ian Campbell <Ian.Campbell@citrix.com> wrote:

> On Tue, 2012-11-13 at 03:09 +0000, Mukesh Rathor wrote:
> > Hi,
> > 
> > I am wondering if there's libxl expert who can help me make some PVH
> > related changes to libxl, pref in the US time zone. I could consult
> > on irc or the phone.
> 
> I think most of the libxl experts are in European time zones. Probably
> the best bet is to just ask your questions either here or on IRC.

For PVH, xc_dom_feature_translated is not returning true, looks like
its not finding XENFEAT_auto_translated_physmap set in the elf???

I've modified the arch/x86/xen/xen-head.S file to include the PVH:

ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "!writable_page_tables|pae_pgdir_above_4gb"FEATURES_PVH)

where
#define FEATURES_PVH "|writable_descriptor_tables" \
                    "|auto_translated_physmap" \
                    "|supervisor_mode_kernel" \
                    "|hvm_callback_vector"


So, not sure why it's failing. In xc_dom_parse_image(), I see 
dom->parms.f_required is 0. I assume this is what the kernel is built
with and should be filled with the values above? Presumably, 
dom->f_requested is what the library expects the kernel to have. 
I set it as:

libxl__build_pv():
    if (is_pvh) {
        printf("info..features:%s\n", info->u.pv.features);
        info->u.pv.features = strdup("auto_translated_physmap");
    }

which is temporary hack, and I wanna consult with libxl expert for the
proper way to to this. I don't see any thing similar being done.

I can't tell why f_active is there. I also see supported, may be thats
the string of what the kernel supports. It is set to 0x11 ??? 

Hmm... Using readelf and hexeditor, I see the feature string properly
set in vmlinux (assume its in bzImage too). So, not sure whats going on.

thanks
Mukesh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 01:32:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 01:32:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYRpT-00012k-Iu; Wed, 14 Nov 2012 01:31:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TYRpR-00012c-Qf
	for Xen-devel@lists.xensource.com; Wed, 14 Nov 2012 01:31:46 +0000
Received: from [85.158.143.99:47850] by server-3.bemta-4.messagelabs.com id
	5B/8D-06841-184F2A05; Wed, 14 Nov 2012 01:31:45 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1352856702!19026821!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTA1Mzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14380 invoked from network); 14 Nov 2012 01:31:44 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-14.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 14 Nov 2012 01:31:44 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAE1Vehq018086
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 01:31:41 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAE1VdgO029757
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Nov 2012 01:31:40 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAE1VdPd000624; Tue, 13 Nov 2012 19:31:39 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 17:31:39 -0800
Date: Tue, 13 Nov 2012 17:31:38 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>
Message-ID: <20121113173138.61b21067@mantra.us.oracle.com>
In-Reply-To: <20121113172138.1d3274d9@mantra.us.oracle.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
	<1352800853.7491.22.camel@zakaz.uk.xensource.com>
	<20121113172138.1d3274d9@mantra.us.oracle.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 13 Nov 2012 17:21:38 -0800
Mukesh Rathor <mukesh.rathor@oracle.com> wrote:

> 
> 
> I can't tell why f_active is there. I also see supported, may be thats
> the string of what the kernel supports. It is set to 0x11 ??? 

Debugging further, I see in xc_dom_parse_elf_kernel() after
elf_parse_binary(), the strings are set as:

      type = XEN_ENT_STR, name = 0x3cadc2e116 "PAE_MODE", data = {
        str = 0x7ffff61e14b0 "yes", num = 0x7ffff61e14b0}}, {
      type = XEN_ENT_STR, name = 0x3cadc2dd2d "FEATURES", data = {
        str = 0x7ffff61e1414 "!writable_page_tables|pae_pgdir_above_4gb", 
        num = 0x7ffff61e1414}}, {type = XEN_ENT_NONE, name = 0x0, data = {
        str = 0x0, num = 0x0}}, {type = XEN_ENT_LONG, 

So, may be it's not properly set in bzImage and something else needs to
be done to get the correct strings there???

thanks
Mukesh


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 01:32:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 01:32:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYRpT-00012k-Iu; Wed, 14 Nov 2012 01:31:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TYRpR-00012c-Qf
	for Xen-devel@lists.xensource.com; Wed, 14 Nov 2012 01:31:46 +0000
Received: from [85.158.143.99:47850] by server-3.bemta-4.messagelabs.com id
	5B/8D-06841-184F2A05; Wed, 14 Nov 2012 01:31:45 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1352856702!19026821!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTA1Mzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14380 invoked from network); 14 Nov 2012 01:31:44 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-14.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 14 Nov 2012 01:31:44 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAE1Vehq018086
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 01:31:41 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAE1VdgO029757
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Nov 2012 01:31:40 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAE1VdPd000624; Tue, 13 Nov 2012 19:31:39 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 17:31:39 -0800
Date: Tue, 13 Nov 2012 17:31:38 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>
Message-ID: <20121113173138.61b21067@mantra.us.oracle.com>
In-Reply-To: <20121113172138.1d3274d9@mantra.us.oracle.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
	<1352800853.7491.22.camel@zakaz.uk.xensource.com>
	<20121113172138.1d3274d9@mantra.us.oracle.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 13 Nov 2012 17:21:38 -0800
Mukesh Rathor <mukesh.rathor@oracle.com> wrote:

> 
> 
> I can't tell why f_active is there. I also see supported, may be thats
> the string of what the kernel supports. It is set to 0x11 ??? 

Debugging further, I see in xc_dom_parse_elf_kernel() after
elf_parse_binary(), the strings are set as:

      type = XEN_ENT_STR, name = 0x3cadc2e116 "PAE_MODE", data = {
        str = 0x7ffff61e14b0 "yes", num = 0x7ffff61e14b0}}, {
      type = XEN_ENT_STR, name = 0x3cadc2dd2d "FEATURES", data = {
        str = 0x7ffff61e1414 "!writable_page_tables|pae_pgdir_above_4gb", 
        num = 0x7ffff61e1414}}, {type = XEN_ENT_NONE, name = 0x0, data = {
        str = 0x0, num = 0x0}}, {type = XEN_ENT_LONG, 

So, may be it's not properly set in bzImage and something else needs to
be done to get the correct strings there???

thanks
Mukesh


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 01:50:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 01:50:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYS7N-0001TV-II; Wed, 14 Nov 2012 01:50:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xzhang@cs.uic.edu>) id 1TYS7M-0001TQ-8n
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 01:50:16 +0000
Received: from [85.158.138.51:34319] by server-15.bemta-3.messagelabs.com id
	66/7D-09445-7D8F2A05; Wed, 14 Nov 2012 01:50:15 +0000
X-Env-Sender: xzhang@cs.uic.edu
X-Msg-Ref: server-10.tower-174.messagelabs.com!1352857783!25874236!1
X-Originating-IP: [131.193.32.56]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23950 invoked from network); 14 Nov 2012 01:49:55 -0000
Received: from mailvm.cs.uic.edu (HELO mailvm.cs.uic.edu) (131.193.32.56)
	by server-10.tower-174.messagelabs.com with SMTP;
	14 Nov 2012 01:49:55 -0000
Received: from [10.8.201.154] (unknown [131.193.31.118])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mailvm.cs.uic.edu (Postfix) with ESMTP id 154EA1F01FA;
	Tue, 13 Nov 2012 19:49:28 -0600 (CST)
Message-ID: <50A2F8A7.5000202@cs.uic.edu>
Date: Tue, 13 Nov 2012 19:49:27 -0600
From: Xu Zhang <xzhang@cs.uic.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120911 Thunderbird/15.0.1
MIME-Version: 1.0
To: Samuel Thibault <samuel.thibault@ens-lyon.org>, 
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, gm281@cam.ac.uk
References: <50871D90.50606@gmail.com> <20121025205653.GW5925@type.chello.at>
	<5098A674.5090203@cs.uic.edu> <20121110135218.GA5436@type>
	<509FC5F6.4050506@cs.uic.edu>
In-Reply-To: <509FC5F6.4050506@cs.uic.edu>
Subject: Re: [Xen-devel] Nested events in 64bit mini-OS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


>>> +    .byte 0x78,0x78,0x78,0x78,0x78            # jmp    
>>> hypercall_page + (__HYPERVISOR_iret * 32)
>> Here we would also need a fixup table for the code at hypercall_page!
> Nice catch!
>
>> A nicer fix would be to inline the hypercall code here.
After a second thought, it seems to me such "expansion" of 
hypercall_page into fixup table is not necessary (and wrong). Insead, we 
can and need to mask out events before we doing a hypercall iret. I 
think it is safe (and must, see below) to do this because:
1. if event is disabled: doesn't hurt to mask it again;
2. if event is enabled: we disable event, and jumps to hypercall_page to 
make a hypercall iret, which eventually calls do_iret:

In do_iret, line 309:
      /* Restore upcall mask from supplied EFLAGS.IF. */
      vcpu_info(v, evtchn_upcall_mask) = !(iret_saved.rflags & 
X86_EFLAGS_IF);

No matter what the current value of upcall mask is, do_iret always 
retores it to the negation of rflags.IF saved on stack. In other words, 
it is safe to mask upcall mask before hypercall iret. And in fact, I am 
afraid it's necessary that we make it a must, because even one can guard 
against nested events in guest OS, but can never do so on hypercall page 
(because the code is in Xen). We should never jump to hypercall_page 
iret with events enabled. So we have to set upcall mask before the jump. 
I guess that's one of the reason why Xen always restores upcall mask 
from stack.


>> Also, it would be good to check against critical section size change, in
>> case somebody e.g. changes a value, or a macro like XEN_PUT_VCPU_INFO.
>> For instance, stuff right after the table:
>>
>>     .if (ecrit-scrit) != (critical_fixup_table_end - 
>> critical_fixup_table)
>>     .error "The critical has changed, the fixup table needs updating"
>>     .endif
> Totally agree. And it somewhat saves the obligation of checking if the 
> table size matches the one of critical section by looking at 
> disassemble output. :-)
>
>
Correct me if I am wrong, I think hypercall_page is mapped at runtime to 
guest OS by Xen. It's not actually part of the critical section of guest 
OS, at least not at compile time. So having a fixup table for the code 
at hypercall_page would cause such check to fail (mismatch). Following 
the discussion above, we could easily avoid such fixup table by mask out 
the events.

I don't know if this make sense at all. :-)



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 01:50:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 01:50:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYS7N-0001TV-II; Wed, 14 Nov 2012 01:50:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xzhang@cs.uic.edu>) id 1TYS7M-0001TQ-8n
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 01:50:16 +0000
Received: from [85.158.138.51:34319] by server-15.bemta-3.messagelabs.com id
	66/7D-09445-7D8F2A05; Wed, 14 Nov 2012 01:50:15 +0000
X-Env-Sender: xzhang@cs.uic.edu
X-Msg-Ref: server-10.tower-174.messagelabs.com!1352857783!25874236!1
X-Originating-IP: [131.193.32.56]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23950 invoked from network); 14 Nov 2012 01:49:55 -0000
Received: from mailvm.cs.uic.edu (HELO mailvm.cs.uic.edu) (131.193.32.56)
	by server-10.tower-174.messagelabs.com with SMTP;
	14 Nov 2012 01:49:55 -0000
Received: from [10.8.201.154] (unknown [131.193.31.118])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mailvm.cs.uic.edu (Postfix) with ESMTP id 154EA1F01FA;
	Tue, 13 Nov 2012 19:49:28 -0600 (CST)
Message-ID: <50A2F8A7.5000202@cs.uic.edu>
Date: Tue, 13 Nov 2012 19:49:27 -0600
From: Xu Zhang <xzhang@cs.uic.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120911 Thunderbird/15.0.1
MIME-Version: 1.0
To: Samuel Thibault <samuel.thibault@ens-lyon.org>, 
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, gm281@cam.ac.uk
References: <50871D90.50606@gmail.com> <20121025205653.GW5925@type.chello.at>
	<5098A674.5090203@cs.uic.edu> <20121110135218.GA5436@type>
	<509FC5F6.4050506@cs.uic.edu>
In-Reply-To: <509FC5F6.4050506@cs.uic.edu>
Subject: Re: [Xen-devel] Nested events in 64bit mini-OS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


>>> +    .byte 0x78,0x78,0x78,0x78,0x78            # jmp    
>>> hypercall_page + (__HYPERVISOR_iret * 32)
>> Here we would also need a fixup table for the code at hypercall_page!
> Nice catch!
>
>> A nicer fix would be to inline the hypercall code here.
After a second thought, it seems to me such "expansion" of 
hypercall_page into fixup table is not necessary (and wrong). Insead, we 
can and need to mask out events before we doing a hypercall iret. I 
think it is safe (and must, see below) to do this because:
1. if event is disabled: doesn't hurt to mask it again;
2. if event is enabled: we disable event, and jumps to hypercall_page to 
make a hypercall iret, which eventually calls do_iret:

In do_iret, line 309:
      /* Restore upcall mask from supplied EFLAGS.IF. */
      vcpu_info(v, evtchn_upcall_mask) = !(iret_saved.rflags & 
X86_EFLAGS_IF);

No matter what the current value of upcall mask is, do_iret always 
retores it to the negation of rflags.IF saved on stack. In other words, 
it is safe to mask upcall mask before hypercall iret. And in fact, I am 
afraid it's necessary that we make it a must, because even one can guard 
against nested events in guest OS, but can never do so on hypercall page 
(because the code is in Xen). We should never jump to hypercall_page 
iret with events enabled. So we have to set upcall mask before the jump. 
I guess that's one of the reason why Xen always restores upcall mask 
from stack.


>> Also, it would be good to check against critical section size change, in
>> case somebody e.g. changes a value, or a macro like XEN_PUT_VCPU_INFO.
>> For instance, stuff right after the table:
>>
>>     .if (ecrit-scrit) != (critical_fixup_table_end - 
>> critical_fixup_table)
>>     .error "The critical has changed, the fixup table needs updating"
>>     .endif
> Totally agree. And it somewhat saves the obligation of checking if the 
> table size matches the one of critical section by looking at 
> disassemble output. :-)
>
>
Correct me if I am wrong, I think hypercall_page is mapped at runtime to 
guest OS by Xen. It's not actually part of the critical section of guest 
OS, at least not at compile time. So having a fixup table for the code 
at hypercall_page would cause such check to fail (mismatch). Following 
the discussion above, we could easily avoid such fixup table by mask out 
the events.

I don't know if this make sense at all. :-)



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 04:03:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 04:03:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYUCA-00049e-W5; Wed, 14 Nov 2012 04:03:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYUC9-00049B-9F
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 04:03:21 +0000
Received: from [85.158.143.99:27256] by server-3.bemta-4.messagelabs.com id
	5D/C2-06841-80813A05; Wed, 14 Nov 2012 04:03:20 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1352865799!29796586!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg0Mjk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1117 invoked from network); 14 Nov 2012 04:03:19 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 04:03:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,247,1352073600"; d="scan'208";a="15791684"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 04:03:11 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 14 Nov 2012 04:03:10 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYUBy-0002mt-K9;
	Wed, 14 Nov 2012 04:03:10 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYUBy-0004xP-8c;
	Wed, 14 Nov 2012 04:03:10 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14388-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 14 Nov 2012 04:03:10 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14388: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14388 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14388/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14332
 test-amd64-amd64-xl-sedf     11 guest-localmigrate           fail   like 14332

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  9 guest-localmigrate         fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  839e5d95d483
baseline version:
 xen                  651d965ee2c0

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Olaf Hering <olaf@aepfle.de>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.2-testing
+ revision=839e5d95d483
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.2-testing 839e5d95d483
+ branch=xen-4.2-testing
+ revision=839e5d95d483
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.2-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.2-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
++ : daily-cron.xen-4.2-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.2-testing.git
+ info_linux_tree xen-4.2-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.2-testing.hg
+ hg push -r 839e5d95d483 ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 3 changesets with 3 changes to 1 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 04:03:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 04:03:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYUCA-00049e-W5; Wed, 14 Nov 2012 04:03:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYUC9-00049B-9F
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 04:03:21 +0000
Received: from [85.158.143.99:27256] by server-3.bemta-4.messagelabs.com id
	5D/C2-06841-80813A05; Wed, 14 Nov 2012 04:03:20 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1352865799!29796586!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg0Mjk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1117 invoked from network); 14 Nov 2012 04:03:19 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 04:03:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,247,1352073600"; d="scan'208";a="15791684"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 04:03:11 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 14 Nov 2012 04:03:10 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYUBy-0002mt-K9;
	Wed, 14 Nov 2012 04:03:10 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYUBy-0004xP-8c;
	Wed, 14 Nov 2012 04:03:10 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14388-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 14 Nov 2012 04:03:10 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14388: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14388 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14388/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14332
 test-amd64-amd64-xl-sedf     11 guest-localmigrate           fail   like 14332

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  9 guest-localmigrate         fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  839e5d95d483
baseline version:
 xen                  651d965ee2c0

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Olaf Hering <olaf@aepfle.de>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.2-testing
+ revision=839e5d95d483
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.2-testing 839e5d95d483
+ branch=xen-4.2-testing
+ revision=839e5d95d483
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.2-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.2-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
++ : daily-cron.xen-4.2-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.2-testing.git
+ info_linux_tree xen-4.2-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.2-testing.hg
+ hg push -r 839e5d95d483 ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 3 changesets with 3 changes to 1 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 05:54:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 05:54:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYVvM-0006Gx-2S; Wed, 14 Nov 2012 05:54:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYVvK-0006Gs-8v
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 05:54:06 +0000
Received: from [85.158.143.99:29691] by server-1.bemta-4.messagelabs.com id
	73/37-27934-DF133A05; Wed, 14 Nov 2012 05:54:05 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1352872444!24533626!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg0Mjk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27237 invoked from network); 14 Nov 2012 05:54:04 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 05:54:04 -0000
X-IronPort-AV: E=Sophos;i="4.83,248,1352073600"; d="scan'208";a="15792317"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 05:53:55 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 14 Nov 2012 05:53:55 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYVv9-0003Nx-C1;
	Wed, 14 Nov 2012 05:53:55 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYVv9-0003j3-90;
	Wed, 14 Nov 2012 05:53:55 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14389-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 14 Nov 2012 05:53:55 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14389: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14389 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14389/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14386
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14386
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14386
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14386

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  8b93ac0c93f3
baseline version:
 xen                  8b93ac0c93f3

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 05:54:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 05:54:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYVvM-0006Gx-2S; Wed, 14 Nov 2012 05:54:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYVvK-0006Gs-8v
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 05:54:06 +0000
Received: from [85.158.143.99:29691] by server-1.bemta-4.messagelabs.com id
	73/37-27934-DF133A05; Wed, 14 Nov 2012 05:54:05 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1352872444!24533626!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg0Mjk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27237 invoked from network); 14 Nov 2012 05:54:04 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 05:54:04 -0000
X-IronPort-AV: E=Sophos;i="4.83,248,1352073600"; d="scan'208";a="15792317"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 05:53:55 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 14 Nov 2012 05:53:55 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYVv9-0003Nx-C1;
	Wed, 14 Nov 2012 05:53:55 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYVv9-0003j3-90;
	Wed, 14 Nov 2012 05:53:55 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14389-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 14 Nov 2012 05:53:55 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14389: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14389 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14389/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14386
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14386
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14386
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14386

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  8b93ac0c93f3
baseline version:
 xen                  8b93ac0c93f3

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 06:25:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 06:25:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYWPO-0006w0-2A; Wed, 14 Nov 2012 06:25:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TYWPN-0006vv-7x
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 06:25:09 +0000
Received: from [85.158.143.35:13983] by server-2.bemta-4.messagelabs.com id
	03/12-28922-44933A05; Wed, 14 Nov 2012 06:25:08 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1352874305!17693114!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTA1Mzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30998 invoked from network); 14 Nov 2012 06:25:06 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 06:25:06 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAE6OwBQ028940
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 06:24:59 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAE6Ovim010807
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Nov 2012 06:24:58 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAE6Ove6023728; Wed, 14 Nov 2012 00:24:57 -0600
Received: from localhost.localdomain (/208.54.32.192)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 22:24:57 -0800
Date: Wed, 14 Nov 2012 01:24:53 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Sander Eikelenboom <linux@eikelenboom.it>
Message-ID: <20121114062451.GB24800@localhost.localdomain>
References: <20121110135931.GD23686@localhost.localdomain>
	<1352714084.27833.137.camel@zakaz.uk.xensource.com>
	<20121112142835.GG19860@phenom.dumpdata.com>
	<711956045.20121112155024@eikelenboom.it>
	<20121112163204.GB9575@phenom.dumpdata.com>
	<1945521669.20121112182055@eikelenboom.it>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1945521669.20121112182055@eikelenboom.it>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "annie.li@oracle.com" <annie.li@oracle.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"marcos.matsunaga@oracle.com" <marcos.matsunaga@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] domU to domU networking issues in v3.7?
 (netserver/netperf failing to communicate)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 12, 2012 at 06:20:55PM +0100, Sander Eikelenboom wrote:
> 
> Monday, November 12, 2012, 5:32:04 PM, you wrote:
> 
> > On Mon, Nov 12, 2012 at 03:50:24PM +0100, Sander Eikelenboom wrote:
> >> 
> >> Monday, November 12, 2012, 3:28:35 PM, you wrote:
> >> 
> >> > On Mon, Nov 12, 2012 at 09:54:44AM +0000, Ian Campbell wrote:
> >> >> On Sat, 2012-11-10 at 13:59 +0000, Konrad Rzeszutek Wilk wrote:
> >> >> > Hey Ian, Xen-devel mailingl list,
> >> >> > 
> >> >> > I think the issue of 70% traffic lost was actually introduced in v3.6 or
> >> >> > perhaps v3.5. Annie and Marcos (CC-ed here) are looking to see which of
> >> >> > the releases introduced this. The issue we are seeing is that a domU
> >> >> > to domU communication breaks - this is with netperf/netserver talking to
> >> >> > each other.
> >> >> > 
> >> >> > Anyhow, I think the 3.7 compound page exacerbated the problem and also
> >> >> > (at least on some of my test hardware) exposed existing issues with
> >> >> > drivers. The issue I have is that the 'skge' driver has a bug that has
> >> >> > been there for ages (I tested way back to 3.0 and still saw it) were it
> >> >> > can not work with SWIOTLB. It is probably missing an pci_dma_sync
> >> >> > somewhere. 
> >> >> > 
> >> >> > Anyhow the compound page got me to look at Xen-SWIOTLB and that looks
> >> >> > OK. Even with synthetic driver (the fake one I posted somewhere) it
> >> >> > dealt with compound pages properly (with debug or non-debug Xen
> >> >> > hypervisor).
> >> >> 
> >> >> The debug build is probably most interesting since it deliberately
> >> >> allocates a non 1-1 p-to-m mapping so as to catch exactly these sorts of
> >> >> issues.
> >> 
> >> > Right. My test env runs with that. And so far it only has issues
> >> > with the skge one.
> >> >> 
> >> >> > So was wondering if you had looked at this in more details? Any
> >> >> > ideas? Or would it be more prudent to ask that once we know for sure
> >> >> > which Linux release introduced the communication failures between
> >> >> > guests?
> >> >> 
> >> >> I've not looked at it any further I'm afraid.
> >> >> 
> >> >> If these changes (be they in 3.5 or later, or earlier) are exposing
> >> >> driver bugs then I suspect the netdev chaps would want to know about it.
> >> 
> >> > Right. Annie (CC-ed here) mentioned to me that v3.5 looks to work ok.
> >> > And is off checking v3.6. v3.7 is definitly a no go.
> >> >> 
> >> >> FWIW I see the issue with tg3.
> >> 
> >> After the issues with netback where fixed, I'm seeing the issues with net_front reverting the single commit 5640f7685831e088fe6c2e1f863a6805962f8e81 (that was pointed out for netback) also makes these disappear.
> 
> > Were you ever able to trigger the BUG_ON in the patch that Ian posted?
> 
> What exact patch (or any other patch that can help you ) ?
> (so i can try again to be sure)

This one:
http://lists.xen.org/archives/html/xen-devel/2012-10/msg00893.html

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 06:25:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 06:25:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYWPO-0006w0-2A; Wed, 14 Nov 2012 06:25:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TYWPN-0006vv-7x
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 06:25:09 +0000
Received: from [85.158.143.35:13983] by server-2.bemta-4.messagelabs.com id
	03/12-28922-44933A05; Wed, 14 Nov 2012 06:25:08 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1352874305!17693114!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTA1Mzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30998 invoked from network); 14 Nov 2012 06:25:06 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 06:25:06 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAE6OwBQ028940
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 06:24:59 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAE6Ovim010807
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Nov 2012 06:24:58 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAE6Ove6023728; Wed, 14 Nov 2012 00:24:57 -0600
Received: from localhost.localdomain (/208.54.32.192)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 13 Nov 2012 22:24:57 -0800
Date: Wed, 14 Nov 2012 01:24:53 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Sander Eikelenboom <linux@eikelenboom.it>
Message-ID: <20121114062451.GB24800@localhost.localdomain>
References: <20121110135931.GD23686@localhost.localdomain>
	<1352714084.27833.137.camel@zakaz.uk.xensource.com>
	<20121112142835.GG19860@phenom.dumpdata.com>
	<711956045.20121112155024@eikelenboom.it>
	<20121112163204.GB9575@phenom.dumpdata.com>
	<1945521669.20121112182055@eikelenboom.it>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1945521669.20121112182055@eikelenboom.it>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "annie.li@oracle.com" <annie.li@oracle.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"marcos.matsunaga@oracle.com" <marcos.matsunaga@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] domU to domU networking issues in v3.7?
 (netserver/netperf failing to communicate)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 12, 2012 at 06:20:55PM +0100, Sander Eikelenboom wrote:
> 
> Monday, November 12, 2012, 5:32:04 PM, you wrote:
> 
> > On Mon, Nov 12, 2012 at 03:50:24PM +0100, Sander Eikelenboom wrote:
> >> 
> >> Monday, November 12, 2012, 3:28:35 PM, you wrote:
> >> 
> >> > On Mon, Nov 12, 2012 at 09:54:44AM +0000, Ian Campbell wrote:
> >> >> On Sat, 2012-11-10 at 13:59 +0000, Konrad Rzeszutek Wilk wrote:
> >> >> > Hey Ian, Xen-devel mailingl list,
> >> >> > 
> >> >> > I think the issue of 70% traffic lost was actually introduced in v3.6 or
> >> >> > perhaps v3.5. Annie and Marcos (CC-ed here) are looking to see which of
> >> >> > the releases introduced this. The issue we are seeing is that a domU
> >> >> > to domU communication breaks - this is with netperf/netserver talking to
> >> >> > each other.
> >> >> > 
> >> >> > Anyhow, I think the 3.7 compound page exacerbated the problem and also
> >> >> > (at least on some of my test hardware) exposed existing issues with
> >> >> > drivers. The issue I have is that the 'skge' driver has a bug that has
> >> >> > been there for ages (I tested way back to 3.0 and still saw it) were it
> >> >> > can not work with SWIOTLB. It is probably missing an pci_dma_sync
> >> >> > somewhere. 
> >> >> > 
> >> >> > Anyhow the compound page got me to look at Xen-SWIOTLB and that looks
> >> >> > OK. Even with synthetic driver (the fake one I posted somewhere) it
> >> >> > dealt with compound pages properly (with debug or non-debug Xen
> >> >> > hypervisor).
> >> >> 
> >> >> The debug build is probably most interesting since it deliberately
> >> >> allocates a non 1-1 p-to-m mapping so as to catch exactly these sorts of
> >> >> issues.
> >> 
> >> > Right. My test env runs with that. And so far it only has issues
> >> > with the skge one.
> >> >> 
> >> >> > So was wondering if you had looked at this in more details? Any
> >> >> > ideas? Or would it be more prudent to ask that once we know for sure
> >> >> > which Linux release introduced the communication failures between
> >> >> > guests?
> >> >> 
> >> >> I've not looked at it any further I'm afraid.
> >> >> 
> >> >> If these changes (be they in 3.5 or later, or earlier) are exposing
> >> >> driver bugs then I suspect the netdev chaps would want to know about it.
> >> 
> >> > Right. Annie (CC-ed here) mentioned to me that v3.5 looks to work ok.
> >> > And is off checking v3.6. v3.7 is definitly a no go.
> >> >> 
> >> >> FWIW I see the issue with tg3.
> >> 
> >> After the issues with netback where fixed, I'm seeing the issues with net_front reverting the single commit 5640f7685831e088fe6c2e1f863a6805962f8e81 (that was pointed out for netback) also makes these disappear.
> 
> > Were you ever able to trigger the BUG_ON in the patch that Ian posted?
> 
> What exact patch (or any other patch that can help you ) ?
> (so i can try again to be sure)

This one:
http://lists.xen.org/archives/html/xen-devel/2012-10/msg00893.html

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 07:24:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 07:24:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYXKT-0008Sb-4L; Wed, 14 Nov 2012 07:24:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TYXKR-0008ST-4y
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 07:24:07 +0000
Received: from [85.158.139.211:6372] by server-5.bemta-5.messagelabs.com id
	6C/71-11353-61743A05; Wed, 14 Nov 2012 07:24:06 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1352877841!20083718!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7140 invoked from network); 14 Nov 2012 07:24:01 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-3.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 07:24:01 -0000
Received: by mail-wi0-f173.google.com with SMTP id hm2so3357051wib.14
	for <xen-devel@lists.xen.org>; Tue, 13 Nov 2012 23:24:01 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=rupVRaarqyMfivDIy2ZhfKBhVlaCDSjXPVWb5otwiv4=;
	b=aNoGYU/SpxKddFS7pTm5Xx7VJY+8mBj63f33CdKsWi3dTWcN7k8e3wSGSMnBJFWnfq
	UNPoilYgjZJyZfmdVAqdmxPFS7ujnE4lPLmeLgkzlpMnRDlPJcART2qeU/g8dYoXtQDO
	obCGwkRKWPj9XOlddYPUTMZu9CZbktqmWIE9GCHtJqcq+Gj/tptQdBstzf4HhiZiGbwj
	xTSAB5ZwdblJrITg6nff8MGMy35dtYPwh9x3Py0+UpuK/2eArsCukqey0fooSwpV5hJv
	E+Mtz3zXHbzZTUTfEJtO+CfjHsIWbKTiUuf0ZqgxXRWLyvv13g5xqpq7PX1caXy9NUVE
	qt2Q==
Received: by 10.180.97.72 with SMTP id dy8mr24332388wib.6.1352877841034;
	Tue, 13 Nov 2012 23:24:01 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id b1sm1058512wix.11.2012.11.13.23.23.59
	(version=SSLv3 cipher=OTHER); Tue, 13 Nov 2012 23:24:00 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 14 Nov 2012 07:23:56 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Jan Beulich <JBeulich@suse.com>, TimDeegan <tim@xen.org>
Message-ID: <CCC8F78C.44A23%keir.xen@gmail.com>
Thread-Topic: [RFC/PATCH] XENMEM_claim_pages (subop of an existing) hypercall
Thread-Index: Ac3COQGjmuJBsRSXU0i4DSzzjCHyMw==
In-Reply-To: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
Mime-version: 1.0
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 13/11/2012 22:23, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:

> The key variables (d->unclaimed_pages and total_unclaimed_pages)
> start at zero if no claim has yet been staked for any domain.
> (Perhaps a better name is "claimed_but_not_yet_possessed" but that's
> a bit unwieldy.)  If no claim hypercalls are executed, there
> should be no impact on existing usage.

It would be nice if d->tot_pages adjustments didn't take the global
heap_lock in this case. There's probably some way to bail out of those new
update functions before doing the locked work, in that case.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 07:24:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 07:24:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYXKT-0008Sb-4L; Wed, 14 Nov 2012 07:24:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TYXKR-0008ST-4y
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 07:24:07 +0000
Received: from [85.158.139.211:6372] by server-5.bemta-5.messagelabs.com id
	6C/71-11353-61743A05; Wed, 14 Nov 2012 07:24:06 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1352877841!20083718!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7140 invoked from network); 14 Nov 2012 07:24:01 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-3.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 07:24:01 -0000
Received: by mail-wi0-f173.google.com with SMTP id hm2so3357051wib.14
	for <xen-devel@lists.xen.org>; Tue, 13 Nov 2012 23:24:01 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=rupVRaarqyMfivDIy2ZhfKBhVlaCDSjXPVWb5otwiv4=;
	b=aNoGYU/SpxKddFS7pTm5Xx7VJY+8mBj63f33CdKsWi3dTWcN7k8e3wSGSMnBJFWnfq
	UNPoilYgjZJyZfmdVAqdmxPFS7ujnE4lPLmeLgkzlpMnRDlPJcART2qeU/g8dYoXtQDO
	obCGwkRKWPj9XOlddYPUTMZu9CZbktqmWIE9GCHtJqcq+Gj/tptQdBstzf4HhiZiGbwj
	xTSAB5ZwdblJrITg6nff8MGMy35dtYPwh9x3Py0+UpuK/2eArsCukqey0fooSwpV5hJv
	E+Mtz3zXHbzZTUTfEJtO+CfjHsIWbKTiUuf0ZqgxXRWLyvv13g5xqpq7PX1caXy9NUVE
	qt2Q==
Received: by 10.180.97.72 with SMTP id dy8mr24332388wib.6.1352877841034;
	Tue, 13 Nov 2012 23:24:01 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id b1sm1058512wix.11.2012.11.13.23.23.59
	(version=SSLv3 cipher=OTHER); Tue, 13 Nov 2012 23:24:00 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 14 Nov 2012 07:23:56 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Jan Beulich <JBeulich@suse.com>, TimDeegan <tim@xen.org>
Message-ID: <CCC8F78C.44A23%keir.xen@gmail.com>
Thread-Topic: [RFC/PATCH] XENMEM_claim_pages (subop of an existing) hypercall
Thread-Index: Ac3COQGjmuJBsRSXU0i4DSzzjCHyMw==
In-Reply-To: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
Mime-version: 1.0
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 13/11/2012 22:23, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:

> The key variables (d->unclaimed_pages and total_unclaimed_pages)
> start at zero if no claim has yet been staked for any domain.
> (Perhaps a better name is "claimed_but_not_yet_possessed" but that's
> a bit unwieldy.)  If no claim hypercalls are executed, there
> should be no impact on existing usage.

It would be nice if d->tot_pages adjustments didn't take the global
heap_lock in this case. There's probably some way to bail out of those new
update functions before doing the locked work, in that case.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 09:08:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 09:08:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYYwh-0002CT-O5; Wed, 14 Nov 2012 09:07:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYYwg-0002CM-8p
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 09:07:42 +0000
Received: from [85.158.143.35:9241] by server-1.bemta-4.messagelabs.com id
	AF/00-27934-D5F53A05; Wed, 14 Nov 2012 09:07:41 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1352884060!7229399!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3680 invoked from network); 14 Nov 2012 09:07:40 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-21.messagelabs.com with SMTP;
	14 Nov 2012 09:07:40 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 14 Nov 2012 09:07:39 +0000
Message-Id: <50A36D6B02000078000A8676@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 14 Nov 2012 09:07:39 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part8FBE714B.0__="
Subject: [Xen-devel] [PATCH] linux-2.6.18/scsifront: cleanup
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part8FBE714B.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

- properly type the shadow field tracking the active command
- as a result, there's no need to also track the data direction
- in turn, re-arranging shadow fields reduces the size of the structure
  on 64-bit architectures
- there's no point in map_data_for_request() failing if there are no
  grant references available when none are needed anyway
- don't redundantly include linux/version.h

--- a/drivers/xen/scsifront/common.h
+++ b/drivers/xen/scsifront/common.h
@@ -80,21 +80,17 @@ struct vscsifrnt_shadow {
 	 * VSCSIIF_ACT_SCSI_CDB or VSCSIIF_ACT_SCSI_RESET */
 	unsigned char act;
 =09
+	/* Number of pieces of scatter-gather */
+	unsigned int nr_segments;
+
 	/* do reset function */
 	wait_queue_head_t wq_reset;	/* reset work queue           */
 	int wait_reset;			/* reset work queue condition */
 	int32_t rslt_reset;		/* reset response status      */
 					/* (SUCESS or FAILED)         */
=20
-	/* for DMA_TO_DEVICE(1), DMA_FROM_DEVICE(2), DMA_NONE(3)=20
-	   requests */
-	unsigned int sc_data_direction;
-=09
-	/* Number of pieces of scatter-gather */
-	unsigned int nr_segments;
-
 	/* requested struct scsi_cmnd is stored from kernel */
-	unsigned long req_scsi_cmnd;
+	struct scsi_cmnd *sc;
 	int gref[VSCSIIF_SG_TABLESIZE];
 };
=20
--- a/drivers/xen/scsifront/scsifront.c
+++ b/drivers/xen/scsifront/scsifront.c
@@ -28,8 +28,6 @@
  * IN THE SOFTWARE.
  */
 =20
-
-#include <linux/version.h>
 #include "common.h"
=20
 static int get_id_from_freelist(struct vscsifrnt_info *info)
@@ -57,8 +55,8 @@ static void add_id_to_freelist(struct vs
=20
 	spin_lock_irqsave(&info->shadow_lock, flags);
=20
-	info->shadow[id].next_free  =3D info->shadow_free;
-	info->shadow[id].req_scsi_cmnd =3D 0;
+	info->shadow[id].next_free =3D info->shadow_free;
+	info->shadow[id].sc =3D NULL;
 	info->shadow_free =3D id;
=20
 	spin_unlock_irqrestore(&info->shadow_lock, flags);
@@ -111,7 +109,7 @@ static void scsifront_gnttab_done(struct
 {
 	int i;
=20
-	if (s->sc_data_direction =3D=3D DMA_NONE)
+	if (s->sc->sc_data_direction =3D=3D DMA_NONE)
 		return;
=20
 	if (s->nr_segments) {
@@ -138,7 +136,7 @@ static void scsifront_cdb_cmd_done(struc
 	uint8_t sense_len;
=20
 	id =3D ring_res->rqid;
-	sc =3D (struct scsi_cmnd *)info->shadow[id].req_scsi_cmnd;
+	sc =3D info->shadow[id].sc;
=20
 	if (sc =3D=3D NULL)
 		BUG();
@@ -252,7 +250,7 @@ static int map_data_for_request(struct v
 	unsigned long buffer_pfn;
 	unsigned int data_len =3D 0;
=20
-	if (sc->sc_data_direction =3D=3D DMA_NONE)
+	if (sc->sc_data_direction =3D=3D DMA_NONE || !sc->request_bufflen)
 		return 0;
=20
 	err =3D gnttab_alloc_grant_references(VSCSIIF_SG_TABLESIZE, =
&gref_head);
@@ -300,7 +298,7 @@ static int map_data_for_request(struct v
 				ref_cnt++;
 			}
 		}
-	} else if (sc->request_bufflen) {
+	} else {
 		unsigned long end   =3D ((unsigned long)sc->request_buffer
 					+ sc->request_bufflen + PAGE_SIZE =
- 1) >> PAGE_SHIFT;
 		unsigned long start =3D (unsigned long)sc->request_buffer =
>> PAGE_SHIFT;
@@ -388,9 +386,8 @@ static int scsifront_queuecommand(struct
 	ring_req->sc_data_direction   =3D (uint8_t)sc->sc_data_direction;
 	ring_req->timeout_per_command =3D (sc->timeout_per_command / HZ);
=20
-	info->shadow[rqid].req_scsi_cmnd     =3D (unsigned long)sc;
-	info->shadow[rqid].sc_data_direction =3D sc->sc_data_direction;
-	info->shadow[rqid].act               =3D ring_req->act;
+	info->shadow[rqid].sc  =3D sc;
+	info->shadow[rqid].act =3D VSCSIIF_ACT_SCSI_CDB;
=20
 	ref_cnt =3D map_data_for_request(info, sc, ring_req, rqid);
 	if (ref_cnt < 0) {
--- a/drivers/xen/scsifront/xenbus.c
+++ b/drivers/xen/scsifront/xenbus.c
@@ -33,7 +33,6 @@
 * 2010, Samuel Kvasnica, IMS Nanofabrication AG
 */
=20
-#include <linux/version.h>
 #include "common.h"
=20
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)



--=__Part8FBE714B.0__=
Content-Type: text/plain; name="xen-scsifront-cleanup.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-scsifront-cleanup.patch"

scsifront: cleanup=0A=0A- properly type the shadow field tracking the =
active command=0A- as a result, there's no need to also track the data =
direction=0A- in turn, re-arranging shadow fields reduces the size of the =
structure=0A  on 64-bit architectures=0A- there's no point in map_data_for_=
request() failing if there are no=0A  grant references available when none =
are needed anyway=0A- don't redundantly include linux/version.h=0A=0A--- =
a/drivers/xen/scsifront/common.h=0A+++ b/drivers/xen/scsifront/common.h=0A@=
@ -80,21 +80,17 @@ struct vscsifrnt_shadow {=0A 	 * VSCSIIF_ACT_SCSI=
_CDB or VSCSIIF_ACT_SCSI_RESET */=0A 	unsigned char act;=0A 	=0A+	/* =
Number of pieces of scatter-gather */=0A+	unsigned int nr_segments;=
=0A+=0A 	/* do reset function */=0A 	wait_queue_head_t =
wq_reset;	/* reset work queue           */=0A 	int wait_reset;		=
	/* reset work queue condition */=0A 	int32_t rslt_reset;		=
/* reset response status      */=0A 					/* =
(SUCESS or FAILED)         */=0A =0A-	/* for DMA_TO_DEVICE(1), DMA_FROM_D=
EVICE(2), DMA_NONE(3) =0A-	   requests */=0A-	unsigned int =
sc_data_direction;=0A-	=0A-	/* Number of pieces of scatter-gather =
*/=0A-	unsigned int nr_segments;=0A-=0A 	/* requested struct =
scsi_cmnd is stored from kernel */=0A-	unsigned long req_scsi_cmnd;=0A+	=
struct scsi_cmnd *sc;=0A 	int gref[VSCSIIF_SG_TABLESIZE];=0A };=0A =
=0A--- a/drivers/xen/scsifront/scsifront.c=0A+++ b/drivers/xen/scsifront/sc=
sifront.c=0A@@ -28,8 +28,6 @@=0A  * IN THE SOFTWARE.=0A  */=0A  =0A-=0A-#in=
clude <linux/version.h>=0A #include "common.h"=0A =0A static int get_id_fro=
m_freelist(struct vscsifrnt_info *info)=0A@@ -57,8 +55,8 @@ static void =
add_id_to_freelist(struct vs=0A =0A 	spin_lock_irqsave(&info->shadow_loc=
k, flags);=0A =0A-	info->shadow[id].next_free  =3D info->shadow_free;=
=0A-	info->shadow[id].req_scsi_cmnd =3D 0;=0A+	info->shadow[id].ne=
xt_free =3D info->shadow_free;=0A+	info->shadow[id].sc =3D NULL;=0A 	=
info->shadow_free =3D id;=0A =0A 	spin_unlock_irqrestore(&info->shado=
w_lock, flags);=0A@@ -111,7 +109,7 @@ static void scsifront_gnttab_done(str=
uct=0A {=0A 	int i;=0A =0A-	if (s->sc_data_direction =3D=3D =
DMA_NONE)=0A+	if (s->sc->sc_data_direction =3D=3D DMA_NONE)=0A 		=
return;=0A =0A 	if (s->nr_segments) {=0A@@ -138,7 +136,7 @@ static void =
scsifront_cdb_cmd_done(struc=0A 	uint8_t sense_len;=0A =0A 	id =
=3D ring_res->rqid;=0A-	sc =3D (struct scsi_cmnd *)info->shadow[id].req_scs=
i_cmnd;=0A+	sc =3D info->shadow[id].sc;=0A =0A 	if (sc =3D=3D =
NULL)=0A 		BUG();=0A@@ -252,7 +250,7 @@ static int map_data_fo=
r_request(struct v=0A 	unsigned long buffer_pfn;=0A 	unsigned int =
data_len =3D 0;=0A =0A-	if (sc->sc_data_direction =3D=3D DMA_NONE)=0A+	if =
(sc->sc_data_direction =3D=3D DMA_NONE || !sc->request_bufflen)=0A 		=
return 0;=0A =0A 	err =3D gnttab_alloc_grant_references(VSCSIIF_SG_TA=
BLESIZE, &gref_head);=0A@@ -300,7 +298,7 @@ static int map_data_for_request=
(struct v=0A 				ref_cnt++;=0A 			=
}=0A 		}=0A-	} else if (sc->request_bufflen) {=0A+	} else =
{=0A 		unsigned long end   =3D ((unsigned long)sc->request_buffer=
=0A 					+ sc->request_bufflen + PAGE_SIZE =
- 1) >> PAGE_SHIFT;=0A 		unsigned long start =3D (unsigned =
long)sc->request_buffer >> PAGE_SHIFT;=0A@@ -388,9 +386,8 @@ static int =
scsifront_queuecommand(struct=0A 	ring_req->sc_data_direction   =3D =
(uint8_t)sc->sc_data_direction;=0A 	ring_req->timeout_per_command =3D =
(sc->timeout_per_command / HZ);=0A =0A-	info->shadow[rqid].req_scsi_cmnd   =
  =3D (unsigned long)sc;=0A-	info->shadow[rqid].sc_data_direction =3D =
sc->sc_data_direction;=0A-	info->shadow[rqid].act               =3D =
ring_req->act;=0A+	info->shadow[rqid].sc  =3D sc;=0A+	info->shado=
w[rqid].act =3D VSCSIIF_ACT_SCSI_CDB;=0A =0A 	ref_cnt =3D map_data_for_re=
quest(info, sc, ring_req, rqid);=0A 	if (ref_cnt < 0) {=0A--- a/drivers/=
xen/scsifront/xenbus.c=0A+++ b/drivers/xen/scsifront/xenbus.c=0A@@ -33,7 =
+33,6 @@=0A * 2010, Samuel Kvasnica, IMS Nanofabrication AG=0A */=0A =
=0A-#include <linux/version.h>=0A #include "common.h"=0A =0A #if LINUX_VERS=
ION_CODE < KERNEL_VERSION(2,6,11)=0A
--=__Part8FBE714B.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.xen.org
http://lists.xen.org/xen-devel

--=__Part8FBE714B.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 14 09:08:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 09:08:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYYwh-0002CT-O5; Wed, 14 Nov 2012 09:07:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYYwg-0002CM-8p
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 09:07:42 +0000
Received: from [85.158.143.35:9241] by server-1.bemta-4.messagelabs.com id
	AF/00-27934-D5F53A05; Wed, 14 Nov 2012 09:07:41 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1352884060!7229399!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3680 invoked from network); 14 Nov 2012 09:07:40 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-21.messagelabs.com with SMTP;
	14 Nov 2012 09:07:40 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 14 Nov 2012 09:07:39 +0000
Message-Id: <50A36D6B02000078000A8676@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 14 Nov 2012 09:07:39 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part8FBE714B.0__="
Subject: [Xen-devel] [PATCH] linux-2.6.18/scsifront: cleanup
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part8FBE714B.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

- properly type the shadow field tracking the active command
- as a result, there's no need to also track the data direction
- in turn, re-arranging shadow fields reduces the size of the structure
  on 64-bit architectures
- there's no point in map_data_for_request() failing if there are no
  grant references available when none are needed anyway
- don't redundantly include linux/version.h

--- a/drivers/xen/scsifront/common.h
+++ b/drivers/xen/scsifront/common.h
@@ -80,21 +80,17 @@ struct vscsifrnt_shadow {
 	 * VSCSIIF_ACT_SCSI_CDB or VSCSIIF_ACT_SCSI_RESET */
 	unsigned char act;
 =09
+	/* Number of pieces of scatter-gather */
+	unsigned int nr_segments;
+
 	/* do reset function */
 	wait_queue_head_t wq_reset;	/* reset work queue           */
 	int wait_reset;			/* reset work queue condition */
 	int32_t rslt_reset;		/* reset response status      */
 					/* (SUCESS or FAILED)         */
=20
-	/* for DMA_TO_DEVICE(1), DMA_FROM_DEVICE(2), DMA_NONE(3)=20
-	   requests */
-	unsigned int sc_data_direction;
-=09
-	/* Number of pieces of scatter-gather */
-	unsigned int nr_segments;
-
 	/* requested struct scsi_cmnd is stored from kernel */
-	unsigned long req_scsi_cmnd;
+	struct scsi_cmnd *sc;
 	int gref[VSCSIIF_SG_TABLESIZE];
 };
=20
--- a/drivers/xen/scsifront/scsifront.c
+++ b/drivers/xen/scsifront/scsifront.c
@@ -28,8 +28,6 @@
  * IN THE SOFTWARE.
  */
 =20
-
-#include <linux/version.h>
 #include "common.h"
=20
 static int get_id_from_freelist(struct vscsifrnt_info *info)
@@ -57,8 +55,8 @@ static void add_id_to_freelist(struct vs
=20
 	spin_lock_irqsave(&info->shadow_lock, flags);
=20
-	info->shadow[id].next_free  =3D info->shadow_free;
-	info->shadow[id].req_scsi_cmnd =3D 0;
+	info->shadow[id].next_free =3D info->shadow_free;
+	info->shadow[id].sc =3D NULL;
 	info->shadow_free =3D id;
=20
 	spin_unlock_irqrestore(&info->shadow_lock, flags);
@@ -111,7 +109,7 @@ static void scsifront_gnttab_done(struct
 {
 	int i;
=20
-	if (s->sc_data_direction =3D=3D DMA_NONE)
+	if (s->sc->sc_data_direction =3D=3D DMA_NONE)
 		return;
=20
 	if (s->nr_segments) {
@@ -138,7 +136,7 @@ static void scsifront_cdb_cmd_done(struc
 	uint8_t sense_len;
=20
 	id =3D ring_res->rqid;
-	sc =3D (struct scsi_cmnd *)info->shadow[id].req_scsi_cmnd;
+	sc =3D info->shadow[id].sc;
=20
 	if (sc =3D=3D NULL)
 		BUG();
@@ -252,7 +250,7 @@ static int map_data_for_request(struct v
 	unsigned long buffer_pfn;
 	unsigned int data_len =3D 0;
=20
-	if (sc->sc_data_direction =3D=3D DMA_NONE)
+	if (sc->sc_data_direction =3D=3D DMA_NONE || !sc->request_bufflen)
 		return 0;
=20
 	err =3D gnttab_alloc_grant_references(VSCSIIF_SG_TABLESIZE, =
&gref_head);
@@ -300,7 +298,7 @@ static int map_data_for_request(struct v
 				ref_cnt++;
 			}
 		}
-	} else if (sc->request_bufflen) {
+	} else {
 		unsigned long end   =3D ((unsigned long)sc->request_buffer
 					+ sc->request_bufflen + PAGE_SIZE =
- 1) >> PAGE_SHIFT;
 		unsigned long start =3D (unsigned long)sc->request_buffer =
>> PAGE_SHIFT;
@@ -388,9 +386,8 @@ static int scsifront_queuecommand(struct
 	ring_req->sc_data_direction   =3D (uint8_t)sc->sc_data_direction;
 	ring_req->timeout_per_command =3D (sc->timeout_per_command / HZ);
=20
-	info->shadow[rqid].req_scsi_cmnd     =3D (unsigned long)sc;
-	info->shadow[rqid].sc_data_direction =3D sc->sc_data_direction;
-	info->shadow[rqid].act               =3D ring_req->act;
+	info->shadow[rqid].sc  =3D sc;
+	info->shadow[rqid].act =3D VSCSIIF_ACT_SCSI_CDB;
=20
 	ref_cnt =3D map_data_for_request(info, sc, ring_req, rqid);
 	if (ref_cnt < 0) {
--- a/drivers/xen/scsifront/xenbus.c
+++ b/drivers/xen/scsifront/xenbus.c
@@ -33,7 +33,6 @@
 * 2010, Samuel Kvasnica, IMS Nanofabrication AG
 */
=20
-#include <linux/version.h>
 #include "common.h"
=20
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)



--=__Part8FBE714B.0__=
Content-Type: text/plain; name="xen-scsifront-cleanup.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-scsifront-cleanup.patch"

scsifront: cleanup=0A=0A- properly type the shadow field tracking the =
active command=0A- as a result, there's no need to also track the data =
direction=0A- in turn, re-arranging shadow fields reduces the size of the =
structure=0A  on 64-bit architectures=0A- there's no point in map_data_for_=
request() failing if there are no=0A  grant references available when none =
are needed anyway=0A- don't redundantly include linux/version.h=0A=0A--- =
a/drivers/xen/scsifront/common.h=0A+++ b/drivers/xen/scsifront/common.h=0A@=
@ -80,21 +80,17 @@ struct vscsifrnt_shadow {=0A 	 * VSCSIIF_ACT_SCSI=
_CDB or VSCSIIF_ACT_SCSI_RESET */=0A 	unsigned char act;=0A 	=0A+	/* =
Number of pieces of scatter-gather */=0A+	unsigned int nr_segments;=
=0A+=0A 	/* do reset function */=0A 	wait_queue_head_t =
wq_reset;	/* reset work queue           */=0A 	int wait_reset;		=
	/* reset work queue condition */=0A 	int32_t rslt_reset;		=
/* reset response status      */=0A 					/* =
(SUCESS or FAILED)         */=0A =0A-	/* for DMA_TO_DEVICE(1), DMA_FROM_D=
EVICE(2), DMA_NONE(3) =0A-	   requests */=0A-	unsigned int =
sc_data_direction;=0A-	=0A-	/* Number of pieces of scatter-gather =
*/=0A-	unsigned int nr_segments;=0A-=0A 	/* requested struct =
scsi_cmnd is stored from kernel */=0A-	unsigned long req_scsi_cmnd;=0A+	=
struct scsi_cmnd *sc;=0A 	int gref[VSCSIIF_SG_TABLESIZE];=0A };=0A =
=0A--- a/drivers/xen/scsifront/scsifront.c=0A+++ b/drivers/xen/scsifront/sc=
sifront.c=0A@@ -28,8 +28,6 @@=0A  * IN THE SOFTWARE.=0A  */=0A  =0A-=0A-#in=
clude <linux/version.h>=0A #include "common.h"=0A =0A static int get_id_fro=
m_freelist(struct vscsifrnt_info *info)=0A@@ -57,8 +55,8 @@ static void =
add_id_to_freelist(struct vs=0A =0A 	spin_lock_irqsave(&info->shadow_loc=
k, flags);=0A =0A-	info->shadow[id].next_free  =3D info->shadow_free;=
=0A-	info->shadow[id].req_scsi_cmnd =3D 0;=0A+	info->shadow[id].ne=
xt_free =3D info->shadow_free;=0A+	info->shadow[id].sc =3D NULL;=0A 	=
info->shadow_free =3D id;=0A =0A 	spin_unlock_irqrestore(&info->shado=
w_lock, flags);=0A@@ -111,7 +109,7 @@ static void scsifront_gnttab_done(str=
uct=0A {=0A 	int i;=0A =0A-	if (s->sc_data_direction =3D=3D =
DMA_NONE)=0A+	if (s->sc->sc_data_direction =3D=3D DMA_NONE)=0A 		=
return;=0A =0A 	if (s->nr_segments) {=0A@@ -138,7 +136,7 @@ static void =
scsifront_cdb_cmd_done(struc=0A 	uint8_t sense_len;=0A =0A 	id =
=3D ring_res->rqid;=0A-	sc =3D (struct scsi_cmnd *)info->shadow[id].req_scs=
i_cmnd;=0A+	sc =3D info->shadow[id].sc;=0A =0A 	if (sc =3D=3D =
NULL)=0A 		BUG();=0A@@ -252,7 +250,7 @@ static int map_data_fo=
r_request(struct v=0A 	unsigned long buffer_pfn;=0A 	unsigned int =
data_len =3D 0;=0A =0A-	if (sc->sc_data_direction =3D=3D DMA_NONE)=0A+	if =
(sc->sc_data_direction =3D=3D DMA_NONE || !sc->request_bufflen)=0A 		=
return 0;=0A =0A 	err =3D gnttab_alloc_grant_references(VSCSIIF_SG_TA=
BLESIZE, &gref_head);=0A@@ -300,7 +298,7 @@ static int map_data_for_request=
(struct v=0A 				ref_cnt++;=0A 			=
}=0A 		}=0A-	} else if (sc->request_bufflen) {=0A+	} else =
{=0A 		unsigned long end   =3D ((unsigned long)sc->request_buffer=
=0A 					+ sc->request_bufflen + PAGE_SIZE =
- 1) >> PAGE_SHIFT;=0A 		unsigned long start =3D (unsigned =
long)sc->request_buffer >> PAGE_SHIFT;=0A@@ -388,9 +386,8 @@ static int =
scsifront_queuecommand(struct=0A 	ring_req->sc_data_direction   =3D =
(uint8_t)sc->sc_data_direction;=0A 	ring_req->timeout_per_command =3D =
(sc->timeout_per_command / HZ);=0A =0A-	info->shadow[rqid].req_scsi_cmnd   =
  =3D (unsigned long)sc;=0A-	info->shadow[rqid].sc_data_direction =3D =
sc->sc_data_direction;=0A-	info->shadow[rqid].act               =3D =
ring_req->act;=0A+	info->shadow[rqid].sc  =3D sc;=0A+	info->shado=
w[rqid].act =3D VSCSIIF_ACT_SCSI_CDB;=0A =0A 	ref_cnt =3D map_data_for_re=
quest(info, sc, ring_req, rqid);=0A 	if (ref_cnt < 0) {=0A--- a/drivers/=
xen/scsifront/xenbus.c=0A+++ b/drivers/xen/scsifront/xenbus.c=0A@@ -33,7 =
+33,6 @@=0A * 2010, Samuel Kvasnica, IMS Nanofabrication AG=0A */=0A =
=0A-#include <linux/version.h>=0A #include "common.h"=0A =0A #if LINUX_VERS=
ION_CODE < KERNEL_VERSION(2,6,11)=0A
--=__Part8FBE714B.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.xen.org
http://lists.xen.org/xen-devel

--=__Part8FBE714B.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 14 09:58:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 09:58:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYZjv-0003Z7-29; Wed, 14 Nov 2012 09:58:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYZjt-0003Z2-VR
	for Xen-devel@lists.xensource.com; Wed, 14 Nov 2012 09:58:34 +0000
Received: from [193.109.254.147:12287] by server-13.bemta-14.messagelabs.com
	id 0D/0F-11239-94B63A05; Wed, 14 Nov 2012 09:58:33 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352887112!8231166!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31984 invoked from network); 14 Nov 2012 09:58:32 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 09:58:32 -0000
X-IronPort-AV: E=Sophos;i="4.83,249,1352073600"; d="scan'208";a="15796367"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 09:58:32 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 14 Nov 2012 09:58:31 +0000
Message-ID: <1352887110.26873.15.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>
Date: Wed, 14 Nov 2012 09:58:30 +0000
In-Reply-To: <20121113173138.61b21067@mantra.us.oracle.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
	<1352800853.7491.22.camel@zakaz.uk.xensource.com>
	<20121113172138.1d3274d9@mantra.us.oracle.com>
	<20121113173138.61b21067@mantra.us.oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-14 at 01:31 +0000, Mukesh Rathor wrote:
> On Tue, 13 Nov 2012 17:21:38 -0800
> Mukesh Rathor <mukesh.rathor@oracle.com> wrote:
> 
> > 
> > 
> > I can't tell why f_active is there. I also see supported, may be thats
> > the string of what the kernel supports. It is set to 0x11 ??? 
> 
> Debugging further, I see in xc_dom_parse_elf_kernel() after
> elf_parse_binary(), the strings are set as:
> 
>       type = XEN_ENT_STR, name = 0x3cadc2e116 "PAE_MODE", data = {
>         str = 0x7ffff61e14b0 "yes", num = 0x7ffff61e14b0}}, {
>       type = XEN_ENT_STR, name = 0x3cadc2dd2d "FEATURES", data = {
>         str = 0x7ffff61e1414 "!writable_page_tables|pae_pgdir_above_4gb", 
>         num = 0x7ffff61e1414}}, {type = XEN_ENT_NONE, name = 0x0, data = {
>         str = 0x0, num = 0x0}}, {type = XEN_ENT_LONG, 
> 
> So, may be it's not properly set in bzImage and something else needs to
> be done to get the correct strings there???

bzImage is a container for the ELF file, possibly things don't get
parsed early enough by xc_dom in this case?

Did you say that if you use the raw ELF file it works?

I think in the default case you don't need to touch libxl here (yet),
you need libxc to do the correct thing.

Do you need to know if this is a PV vs PVH domain at
XEN_DOMCTL_createdomain (aka xc_domain_create) time or can it be set
later? My suspicion is that when the domain is created the kernel hasn't
been parsed yet so the feature flags are not available. This would be
easier to deal with if the PVH selection could be moved later on to the
point where you are actually building the domain -- but I don't know how
hard that would be.

When I prototyped this stuff years ago I added XEN_DOMCTL_setfeatures
which was called from xc_dom_parse_image:
        @@ -668,8 +669,26 @@ int xc_dom_parse_image(struct xc_dom_ima
             /* check features */
             for ( i = 0; i < XENFEAT_NR_SUBMAPS; i++ )
             {
        -        dom->f_active[i] |= dom->f_requested[i]; /* cmd line */
        -        dom->f_active[i] |= dom->parms.f_required[i]; /* kernel   */
        +        domctl.cmd = XEN_DOMCTL_setfeatures;
        +        domctl.domain = dom->guest_domid;
        +
        +        domctl.u.setfeatures.submap_idx = i;
        +        domctl.u.setfeatures.submap = 0;
        +
        +        domctl.u.setfeatures.submap |= dom->f_requested[i]; /* cmd line */
        +        domctl.u.setfeatures.submap |= dom->parms.f_required[i]; /* kernel   */
        +
        +        xc_dom_printf(dom->xch, "requesting features[%d] = %#x", domctl.u.setfeatures.submap_idx, domctl.u.setfeatures.submap);
        +        if (do_domctl(dom->xch, &domctl))
        +        {
        +            xc_dom_panic(dom->xch, XC_INVALID_PARAM,
        +                         "%s: unable to set requested features\n", __FUNCTION__);
        +            goto err;
        +        }
        +
        +        xc_dom_printf(dom->xch, "received   features[%d] = %#x", domctl.u.setfeatures.submap_idx, domctl.u.setfeatures.submap);
        +        dom->f_active[i] = domctl.u.setfeatures.submap;
        +
                 if ( (dom->f_active[i] & dom->parms.f_supported[i]) !=
                      dom->f_active[i] )
                 {
        
On the hypervisor side setting the features would enable "PVH" mode as
appropriate.

You only need to worry about libxl integration to allow the user to
override these defaults, but shall we worry about that later once we
have libxc sorted?

BTW for the purposes of parallelising things up you could post the
hypervisor side part of the series stuff + a patch to force enable PVH
in libxc (obviously the last not to be applied) first then we can be
reviewing the h/v side things while simultaneously figuring out how the
tools side fits together.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 09:58:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 09:58:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYZjv-0003Z7-29; Wed, 14 Nov 2012 09:58:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYZjt-0003Z2-VR
	for Xen-devel@lists.xensource.com; Wed, 14 Nov 2012 09:58:34 +0000
Received: from [193.109.254.147:12287] by server-13.bemta-14.messagelabs.com
	id 0D/0F-11239-94B63A05; Wed, 14 Nov 2012 09:58:33 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352887112!8231166!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31984 invoked from network); 14 Nov 2012 09:58:32 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 09:58:32 -0000
X-IronPort-AV: E=Sophos;i="4.83,249,1352073600"; d="scan'208";a="15796367"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 09:58:32 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 14 Nov 2012 09:58:31 +0000
Message-ID: <1352887110.26873.15.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>
Date: Wed, 14 Nov 2012 09:58:30 +0000
In-Reply-To: <20121113173138.61b21067@mantra.us.oracle.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
	<1352800853.7491.22.camel@zakaz.uk.xensource.com>
	<20121113172138.1d3274d9@mantra.us.oracle.com>
	<20121113173138.61b21067@mantra.us.oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-14 at 01:31 +0000, Mukesh Rathor wrote:
> On Tue, 13 Nov 2012 17:21:38 -0800
> Mukesh Rathor <mukesh.rathor@oracle.com> wrote:
> 
> > 
> > 
> > I can't tell why f_active is there. I also see supported, may be thats
> > the string of what the kernel supports. It is set to 0x11 ??? 
> 
> Debugging further, I see in xc_dom_parse_elf_kernel() after
> elf_parse_binary(), the strings are set as:
> 
>       type = XEN_ENT_STR, name = 0x3cadc2e116 "PAE_MODE", data = {
>         str = 0x7ffff61e14b0 "yes", num = 0x7ffff61e14b0}}, {
>       type = XEN_ENT_STR, name = 0x3cadc2dd2d "FEATURES", data = {
>         str = 0x7ffff61e1414 "!writable_page_tables|pae_pgdir_above_4gb", 
>         num = 0x7ffff61e1414}}, {type = XEN_ENT_NONE, name = 0x0, data = {
>         str = 0x0, num = 0x0}}, {type = XEN_ENT_LONG, 
> 
> So, may be it's not properly set in bzImage and something else needs to
> be done to get the correct strings there???

bzImage is a container for the ELF file, possibly things don't get
parsed early enough by xc_dom in this case?

Did you say that if you use the raw ELF file it works?

I think in the default case you don't need to touch libxl here (yet),
you need libxc to do the correct thing.

Do you need to know if this is a PV vs PVH domain at
XEN_DOMCTL_createdomain (aka xc_domain_create) time or can it be set
later? My suspicion is that when the domain is created the kernel hasn't
been parsed yet so the feature flags are not available. This would be
easier to deal with if the PVH selection could be moved later on to the
point where you are actually building the domain -- but I don't know how
hard that would be.

When I prototyped this stuff years ago I added XEN_DOMCTL_setfeatures
which was called from xc_dom_parse_image:
        @@ -668,8 +669,26 @@ int xc_dom_parse_image(struct xc_dom_ima
             /* check features */
             for ( i = 0; i < XENFEAT_NR_SUBMAPS; i++ )
             {
        -        dom->f_active[i] |= dom->f_requested[i]; /* cmd line */
        -        dom->f_active[i] |= dom->parms.f_required[i]; /* kernel   */
        +        domctl.cmd = XEN_DOMCTL_setfeatures;
        +        domctl.domain = dom->guest_domid;
        +
        +        domctl.u.setfeatures.submap_idx = i;
        +        domctl.u.setfeatures.submap = 0;
        +
        +        domctl.u.setfeatures.submap |= dom->f_requested[i]; /* cmd line */
        +        domctl.u.setfeatures.submap |= dom->parms.f_required[i]; /* kernel   */
        +
        +        xc_dom_printf(dom->xch, "requesting features[%d] = %#x", domctl.u.setfeatures.submap_idx, domctl.u.setfeatures.submap);
        +        if (do_domctl(dom->xch, &domctl))
        +        {
        +            xc_dom_panic(dom->xch, XC_INVALID_PARAM,
        +                         "%s: unable to set requested features\n", __FUNCTION__);
        +            goto err;
        +        }
        +
        +        xc_dom_printf(dom->xch, "received   features[%d] = %#x", domctl.u.setfeatures.submap_idx, domctl.u.setfeatures.submap);
        +        dom->f_active[i] = domctl.u.setfeatures.submap;
        +
                 if ( (dom->f_active[i] & dom->parms.f_supported[i]) !=
                      dom->f_active[i] )
                 {
        
On the hypervisor side setting the features would enable "PVH" mode as
appropriate.

You only need to worry about libxl integration to allow the user to
override these defaults, but shall we worry about that later once we
have libxc sorted?

BTW for the purposes of parallelising things up you could post the
hypervisor side part of the series stuff + a patch to force enable PVH
in libxc (obviously the last not to be applied) first then we can be
reviewing the h/v side things while simultaneously figuring out how the
tools side fits together.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 10:02:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 10:02:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYZn3-0003ll-M2; Wed, 14 Nov 2012 10:01:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <juergen.gross@ts.fujitsu.com>) id 1TYZn2-0003lc-C4
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 10:01:48 +0000
Received: from [85.158.143.99:18012] by server-2.bemta-4.messagelabs.com id
	0B/E8-28922-B0C63A05; Wed, 14 Nov 2012 10:01:47 +0000
X-Env-Sender: juergen.gross@ts.fujitsu.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1352887306!24597727!1
X-Originating-IP: [80.70.172.49]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuNzAuMTcyLjQ5ID0+IDI2MzMyMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13031 invoked from network); 14 Nov 2012 10:01:46 -0000
Received: from dgate10.ts.fujitsu.com (HELO dgate10.ts.fujitsu.com)
	(80.70.172.49)
	by server-4.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 10:01:46 -0000
DomainKey-Signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns;
	h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV:
	Received:Received:Content-Type:MIME-Version:Subject:
	X-Mercurial-Node:Message-Id:Date:From:To;
	b=TKTG1aER4GqY+OfGb+AdicvoKVhhnGkMVF9d6tp03wlarTxOoM/xB4D0
	DofYEDyqPKA9KX6fnnfGEcAcHzl29T0UDl7LhY8exGTvYo5Rug4mLrLCQ
	ym76eEfX85WpxPMQOW//LvnuxvwcN8lGfUSjbQnwxROYKVDQk6j3IKUS0
	vXLM1iam9y9llP6ABS05VuZtx9wo2DnKHJRk8fn5jOo3NLZOw8iqu3n2A
	udx3kl0ImG8Tb1yVIxGS7q3ixa0k7;
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
	d=ts.fujitsu.com; i=@ts.fujitsu.com; q=dns/txt;
	s=s1536b; t=1352887307; x=1384423307;
	h=mime-version:subject:message-id:date:from:to;
	bh=iNvULN/QWy/LrbTjKcgLFM6nd2OK7wAd+5LsnIjFnJc=;
	b=dlMyKcbuuD0GsWZObPZxEtzTNau3laJlHBfHegq2mAiPguijgqn8jF9k
	oVhVS5XXlWS2qgID02Mifx7izxh014d0f0oYuXNuYOksOtQJVQ4B0FKrR
	kdwJsUOx/vZRNuth2hFVmg3F7M8STeYETloCaPPQqzI3XLtaMb+B/DuSk
	f/SQ5iFqNp7MiANPDNgN4oc4uKwxHYuPhBtQihZo3FKAg0H4l7NRskarQ
	D/rYM+fjY5NOxVRPs+UcMDag/K/i3;
X-SBRSScore: None
X-IronPort-AV: E=Sophos;i="4.83,249,1352070000"; 
	d="scan'208,217";a="128193062"
Received: from abgdgate40u.abg.fsc.net ([172.25.138.90])
	by dgate10u.abg.fsc.net with ESMTP; 14 Nov 2012 11:01:46 +0100
X-IronPort-AV: E=Sophos;i="4.83,248,1352070000"; 
	d="scan'208,217";a="149928049"
Received: from sanpedro.mch.fsc.net ([172.17.20.6])
	by abgdgate40u.abg.fsc.net with SMTP; 14 Nov 2012 11:01:45 +0100
Received: from [172.17.21.25] (nehalem1.osd.mch.fsc.net [172.17.21.25])
	by sanpedro.mch.fsc.net (Postfix) with ESMTP id BAC9976B6A5;
	Wed, 14 Nov 2012 11:01:45 +0100 (CET)
Content-Type: multipart/mixed; boundary="===============6126879887583360703=="
MIME-Version: 1.0
X-Mercurial-Node: 7c02a22ef82161c3930f996785b0a2565dba4c56
Message-Id: <7c02a22ef82161c3930f.1352886775@nehalem1>
Date: Wed, 14 Nov 2012 10:52:55 +0100
From: Juergen Gross <juergen.gross@ts.fujitsu.com>
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH] Support user domain create extensions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6126879887583360703==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

This patch supports arbitrary extensions to xl create by being able to specify
a script which is run at domain creation. The script is specified in the xl
config file and will be started at domain creation with following parameters:

<script> restore|create <domid> <path of config file>

To be able to use non-standard devices a new device class "NSTD" is defined.
The xl framework will remove all NSTD devices when destroying a domain.

This extension enables us (Fujitsu) to use standard Xen with xl for our
Xen-based mainframe with BS2000 as DomU (this requires an additional Xen
PV-device emulating the BS2000 I/O-system).

It might be interesting for others as well to be able to add new experimental
devices or other features to Xen without having to change Xen (especially xl)
itself.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>


7 files changed, 65 insertions(+)
tools/examples/xl.conf               |   11 +++++++++++
tools/libxl/libxl.h                  |    3 +++
tools/libxl/libxl_dom.c              |   16 ++++++++++++++++
tools/libxl/libxl_types_internal.idl |    1 +
tools/libxl/xl.c                     |    5 +++++
tools/libxl/xl.h                     |    1 +
tools/libxl/xl_cmdimpl.c             |   28 ++++++++++++++++++++++++++++



--===============6126879887583360703==
Content-Type: text/x-patch; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=xen-staging.hg.patch

# HG changeset patch
# User Juergen Gross <juergen.gross@ts.fujitsu.com>
# Date 1352886719 -3600
# Node ID 7c02a22ef82161c3930f996785b0a2565dba4c56
# Parent  8b93ac0c93f3fb8a140b4688ba71841ac927d4e3
Support user domain create extensions

This patch supports arbitrary extensions to xl create by being able to specify
a script which is run at domain creation. The script is specified in the xl
config file and will be started at domain creation with following parameters:

<script> restore|create <domid> <path of config file>

To be able to use non-standard devices a new device class "NSTD" is defined.
The xl framework will remove all NSTD devices when destroying a domain.

This extension enables us (Fujitsu) to use standard Xen with xl for our
Xen-based mainframe with BS2000 as DomU (this requires an additional Xen
PV-device emulating the BS2000 I/O-system).

It might be interesting for others as well to be able to add new experimental
devices or other features to Xen without having to change Xen (especially xl)
itself.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>

diff -r 8b93ac0c93f3 -r 7c02a22ef821 tools/examples/xl.conf
--- a/tools/examples/xl.conf	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/examples/xl.conf	Wed Nov 14 10:51:59 2012 +0100
@@ -20,3 +20,14 @@
 # if disabled the old behaviour will be used, and hotplug scripts will be
 # launched by udev.
 #run_hotplug_scripts=1
+
+# additional script called on domain creation
+# the script must be located in xl script directory.
+# Arguments passed:
+# <domain_create_script> restore|create <domid> <domain config file>
+#   restore|create       restore: domain created by restore or migration action
+#                        create: domain created by xl create
+#   <domid>
+#   <domain config file> full path to domain config file stored by xl
+# If the script returns an exit code != 0, domain creation will by aborted.
+#domain_create_script=
diff -r 8b93ac0c93f3 -r 7c02a22ef821 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxl/libxl.h	Wed Nov 14 10:51:59 2012 +0100
@@ -875,6 +875,9 @@ int libxl_userdata_retrieve(libxl_ctx *c
    * data_r and datalen_r may be 0.
    * On error return, *data_r and *datalen_r are undefined.
    */
+const char *libxl_userdata_path(libxl_ctx *ctx, uint32_t domid,
+                                const char *userdata_userid,
+                                const char *wh);
 
 int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo);
 int libxl_set_vcpuaffinity(libxl_ctx *ctx, uint32_t domid, uint32_t vcpuid,
diff -r 8b93ac0c93f3 -r 7c02a22ef821 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxl/libxl_dom.c	Wed Nov 14 10:51:59 2012 +0100
@@ -1508,6 +1508,22 @@ out:
     return;
 }
 
+const char *libxl_userdata_path(libxl_ctx *ctx, uint32_t domid,
+                                const char *userdata_userid,
+                                const char *wh)
+{
+    GC_INIT(ctx);
+    const char *path;
+
+    path = userdata_path(gc, domid, userdata_userid, "d");
+    if (path) {
+        path = strdup(path);
+    }
+
+    GC_FREE;
+    return path;
+}
+
 int libxl_userdata_store(libxl_ctx *ctx, uint32_t domid,
                               const char *userdata_userid,
                               const uint8_t *data, int datalen)
diff -r 8b93ac0c93f3 -r 7c02a22ef821 tools/libxl/libxl_types_internal.idl
--- a/tools/libxl/libxl_types_internal.idl	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxl/libxl_types_internal.idl	Wed Nov 14 10:51:59 2012 +0100
@@ -20,6 +20,7 @@ libxl__device_kind = Enumeration("device
     (6, "VKBD"),
     (7, "CONSOLE"),
     (8, "VTPM"),
+    (9, "NSTD"),
     ])
 
 libxl__console_backend = Enumeration("console_backend", [
diff -r 8b93ac0c93f3 -r 7c02a22ef821 tools/libxl/xl.c
--- a/tools/libxl/xl.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxl/xl.c	Wed Nov 14 10:51:59 2012 +0100
@@ -43,6 +43,7 @@ char *lockfile;
 char *lockfile;
 char *default_vifscript = NULL;
 char *default_bridge = NULL;
+char *domain_create_script = NULL;
 enum output_format default_output_format = OUTPUT_FORMAT_JSON;
 
 static xentoollog_level minmsglevel = XTL_PROGRESS;
@@ -102,6 +103,10 @@ static void parse_global_config(const ch
     }
     if (!xlu_cfg_get_string (config, "blkdev_start", &buf, 0))
         blkdev_start = strdup(buf);
+
+    if (!xlu_cfg_get_string (config, "domain_create_script", &buf, 0))
+        domain_create_script = strdup(buf);
+
     xlu_cfg_destroy(config);
 }
 
diff -r 8b93ac0c93f3 -r 7c02a22ef821 tools/libxl/xl.h
--- a/tools/libxl/xl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxl/xl.h	Wed Nov 14 10:51:59 2012 +0100
@@ -149,6 +149,7 @@ extern char *default_vifscript;
 extern char *default_vifscript;
 extern char *default_bridge;
 extern char *blkdev_start;
+extern char *domain_create_script;
 
 enum output_format {
     OUTPUT_FORMAT_JSON,
diff -r 8b93ac0c93f3 -r 7c02a22ef821 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Wed Nov 14 10:51:59 2012 +0100
@@ -1806,6 +1806,8 @@ static uint32_t create_domain(struct dom
     int status = 0;
     const libxl_asyncprogress_how *autoconnect_console_how;
     struct save_file_header hdr;
+    
+    char *domain_create_cmdline;
 
     int restoring = (restore_file || (migrate_fd >= 0));
 
@@ -2020,6 +2022,32 @@ start:
         perror("cannot save config file");
         ret = ERROR_FAIL;
         goto error_out;
+    }
+
+    if (domain_create_script) {
+        const char *conf;
+
+        /* call additional domain create script
+           <script> restore|create <domid> <path of config file>
+         */
+        conf = libxl_userdata_path(ctx, domid, "xl", "d");
+        if (!conf) {
+            fprintf(stderr, "no config file found\n");
+            ret = ERROR_FAIL;
+            goto error_out;
+        }
+        asprintf(&domain_create_cmdline, "%s/%s %s %d %s", 
+                 XEN_SCRIPT_DIR, domain_create_script, 
+                 restoring ? "restore" : "create", 
+                 domid, conf);
+
+        ret = system(domain_create_cmdline);
+
+        if (ret) {
+            perror("domain create script failed");
+            ret = ERROR_FAIL;
+            goto error_out;
+        }
     }
 
     release_lock();

--===============6126879887583360703==
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.xen.org
http://lists.xen.org/xen-devel

--===============6126879887583360703==--


From xen-devel-bounces@lists.xen.org Wed Nov 14 10:02:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 10:02:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYZn3-0003ll-M2; Wed, 14 Nov 2012 10:01:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <juergen.gross@ts.fujitsu.com>) id 1TYZn2-0003lc-C4
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 10:01:48 +0000
Received: from [85.158.143.99:18012] by server-2.bemta-4.messagelabs.com id
	0B/E8-28922-B0C63A05; Wed, 14 Nov 2012 10:01:47 +0000
X-Env-Sender: juergen.gross@ts.fujitsu.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1352887306!24597727!1
X-Originating-IP: [80.70.172.49]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuNzAuMTcyLjQ5ID0+IDI2MzMyMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13031 invoked from network); 14 Nov 2012 10:01:46 -0000
Received: from dgate10.ts.fujitsu.com (HELO dgate10.ts.fujitsu.com)
	(80.70.172.49)
	by server-4.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 10:01:46 -0000
DomainKey-Signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns;
	h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV:
	Received:Received:Content-Type:MIME-Version:Subject:
	X-Mercurial-Node:Message-Id:Date:From:To;
	b=TKTG1aER4GqY+OfGb+AdicvoKVhhnGkMVF9d6tp03wlarTxOoM/xB4D0
	DofYEDyqPKA9KX6fnnfGEcAcHzl29T0UDl7LhY8exGTvYo5Rug4mLrLCQ
	ym76eEfX85WpxPMQOW//LvnuxvwcN8lGfUSjbQnwxROYKVDQk6j3IKUS0
	vXLM1iam9y9llP6ABS05VuZtx9wo2DnKHJRk8fn5jOo3NLZOw8iqu3n2A
	udx3kl0ImG8Tb1yVIxGS7q3ixa0k7;
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
	d=ts.fujitsu.com; i=@ts.fujitsu.com; q=dns/txt;
	s=s1536b; t=1352887307; x=1384423307;
	h=mime-version:subject:message-id:date:from:to;
	bh=iNvULN/QWy/LrbTjKcgLFM6nd2OK7wAd+5LsnIjFnJc=;
	b=dlMyKcbuuD0GsWZObPZxEtzTNau3laJlHBfHegq2mAiPguijgqn8jF9k
	oVhVS5XXlWS2qgID02Mifx7izxh014d0f0oYuXNuYOksOtQJVQ4B0FKrR
	kdwJsUOx/vZRNuth2hFVmg3F7M8STeYETloCaPPQqzI3XLtaMb+B/DuSk
	f/SQ5iFqNp7MiANPDNgN4oc4uKwxHYuPhBtQihZo3FKAg0H4l7NRskarQ
	D/rYM+fjY5NOxVRPs+UcMDag/K/i3;
X-SBRSScore: None
X-IronPort-AV: E=Sophos;i="4.83,249,1352070000"; 
	d="scan'208,217";a="128193062"
Received: from abgdgate40u.abg.fsc.net ([172.25.138.90])
	by dgate10u.abg.fsc.net with ESMTP; 14 Nov 2012 11:01:46 +0100
X-IronPort-AV: E=Sophos;i="4.83,248,1352070000"; 
	d="scan'208,217";a="149928049"
Received: from sanpedro.mch.fsc.net ([172.17.20.6])
	by abgdgate40u.abg.fsc.net with SMTP; 14 Nov 2012 11:01:45 +0100
Received: from [172.17.21.25] (nehalem1.osd.mch.fsc.net [172.17.21.25])
	by sanpedro.mch.fsc.net (Postfix) with ESMTP id BAC9976B6A5;
	Wed, 14 Nov 2012 11:01:45 +0100 (CET)
Content-Type: multipart/mixed; boundary="===============6126879887583360703=="
MIME-Version: 1.0
X-Mercurial-Node: 7c02a22ef82161c3930f996785b0a2565dba4c56
Message-Id: <7c02a22ef82161c3930f.1352886775@nehalem1>
Date: Wed, 14 Nov 2012 10:52:55 +0100
From: Juergen Gross <juergen.gross@ts.fujitsu.com>
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH] Support user domain create extensions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6126879887583360703==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

This patch supports arbitrary extensions to xl create by being able to specify
a script which is run at domain creation. The script is specified in the xl
config file and will be started at domain creation with following parameters:

<script> restore|create <domid> <path of config file>

To be able to use non-standard devices a new device class "NSTD" is defined.
The xl framework will remove all NSTD devices when destroying a domain.

This extension enables us (Fujitsu) to use standard Xen with xl for our
Xen-based mainframe with BS2000 as DomU (this requires an additional Xen
PV-device emulating the BS2000 I/O-system).

It might be interesting for others as well to be able to add new experimental
devices or other features to Xen without having to change Xen (especially xl)
itself.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>


7 files changed, 65 insertions(+)
tools/examples/xl.conf               |   11 +++++++++++
tools/libxl/libxl.h                  |    3 +++
tools/libxl/libxl_dom.c              |   16 ++++++++++++++++
tools/libxl/libxl_types_internal.idl |    1 +
tools/libxl/xl.c                     |    5 +++++
tools/libxl/xl.h                     |    1 +
tools/libxl/xl_cmdimpl.c             |   28 ++++++++++++++++++++++++++++



--===============6126879887583360703==
Content-Type: text/x-patch; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=xen-staging.hg.patch

# HG changeset patch
# User Juergen Gross <juergen.gross@ts.fujitsu.com>
# Date 1352886719 -3600
# Node ID 7c02a22ef82161c3930f996785b0a2565dba4c56
# Parent  8b93ac0c93f3fb8a140b4688ba71841ac927d4e3
Support user domain create extensions

This patch supports arbitrary extensions to xl create by being able to specify
a script which is run at domain creation. The script is specified in the xl
config file and will be started at domain creation with following parameters:

<script> restore|create <domid> <path of config file>

To be able to use non-standard devices a new device class "NSTD" is defined.
The xl framework will remove all NSTD devices when destroying a domain.

This extension enables us (Fujitsu) to use standard Xen with xl for our
Xen-based mainframe with BS2000 as DomU (this requires an additional Xen
PV-device emulating the BS2000 I/O-system).

It might be interesting for others as well to be able to add new experimental
devices or other features to Xen without having to change Xen (especially xl)
itself.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>

diff -r 8b93ac0c93f3 -r 7c02a22ef821 tools/examples/xl.conf
--- a/tools/examples/xl.conf	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/examples/xl.conf	Wed Nov 14 10:51:59 2012 +0100
@@ -20,3 +20,14 @@
 # if disabled the old behaviour will be used, and hotplug scripts will be
 # launched by udev.
 #run_hotplug_scripts=1
+
+# additional script called on domain creation
+# the script must be located in xl script directory.
+# Arguments passed:
+# <domain_create_script> restore|create <domid> <domain config file>
+#   restore|create       restore: domain created by restore or migration action
+#                        create: domain created by xl create
+#   <domid>
+#   <domain config file> full path to domain config file stored by xl
+# If the script returns an exit code != 0, domain creation will by aborted.
+#domain_create_script=
diff -r 8b93ac0c93f3 -r 7c02a22ef821 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxl/libxl.h	Wed Nov 14 10:51:59 2012 +0100
@@ -875,6 +875,9 @@ int libxl_userdata_retrieve(libxl_ctx *c
    * data_r and datalen_r may be 0.
    * On error return, *data_r and *datalen_r are undefined.
    */
+const char *libxl_userdata_path(libxl_ctx *ctx, uint32_t domid,
+                                const char *userdata_userid,
+                                const char *wh);
 
 int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo);
 int libxl_set_vcpuaffinity(libxl_ctx *ctx, uint32_t domid, uint32_t vcpuid,
diff -r 8b93ac0c93f3 -r 7c02a22ef821 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxl/libxl_dom.c	Wed Nov 14 10:51:59 2012 +0100
@@ -1508,6 +1508,22 @@ out:
     return;
 }
 
+const char *libxl_userdata_path(libxl_ctx *ctx, uint32_t domid,
+                                const char *userdata_userid,
+                                const char *wh)
+{
+    GC_INIT(ctx);
+    const char *path;
+
+    path = userdata_path(gc, domid, userdata_userid, "d");
+    if (path) {
+        path = strdup(path);
+    }
+
+    GC_FREE;
+    return path;
+}
+
 int libxl_userdata_store(libxl_ctx *ctx, uint32_t domid,
                               const char *userdata_userid,
                               const uint8_t *data, int datalen)
diff -r 8b93ac0c93f3 -r 7c02a22ef821 tools/libxl/libxl_types_internal.idl
--- a/tools/libxl/libxl_types_internal.idl	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxl/libxl_types_internal.idl	Wed Nov 14 10:51:59 2012 +0100
@@ -20,6 +20,7 @@ libxl__device_kind = Enumeration("device
     (6, "VKBD"),
     (7, "CONSOLE"),
     (8, "VTPM"),
+    (9, "NSTD"),
     ])
 
 libxl__console_backend = Enumeration("console_backend", [
diff -r 8b93ac0c93f3 -r 7c02a22ef821 tools/libxl/xl.c
--- a/tools/libxl/xl.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxl/xl.c	Wed Nov 14 10:51:59 2012 +0100
@@ -43,6 +43,7 @@ char *lockfile;
 char *lockfile;
 char *default_vifscript = NULL;
 char *default_bridge = NULL;
+char *domain_create_script = NULL;
 enum output_format default_output_format = OUTPUT_FORMAT_JSON;
 
 static xentoollog_level minmsglevel = XTL_PROGRESS;
@@ -102,6 +103,10 @@ static void parse_global_config(const ch
     }
     if (!xlu_cfg_get_string (config, "blkdev_start", &buf, 0))
         blkdev_start = strdup(buf);
+
+    if (!xlu_cfg_get_string (config, "domain_create_script", &buf, 0))
+        domain_create_script = strdup(buf);
+
     xlu_cfg_destroy(config);
 }
 
diff -r 8b93ac0c93f3 -r 7c02a22ef821 tools/libxl/xl.h
--- a/tools/libxl/xl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxl/xl.h	Wed Nov 14 10:51:59 2012 +0100
@@ -149,6 +149,7 @@ extern char *default_vifscript;
 extern char *default_vifscript;
 extern char *default_bridge;
 extern char *blkdev_start;
+extern char *domain_create_script;
 
 enum output_format {
     OUTPUT_FORMAT_JSON,
diff -r 8b93ac0c93f3 -r 7c02a22ef821 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Wed Nov 14 10:51:59 2012 +0100
@@ -1806,6 +1806,8 @@ static uint32_t create_domain(struct dom
     int status = 0;
     const libxl_asyncprogress_how *autoconnect_console_how;
     struct save_file_header hdr;
+    
+    char *domain_create_cmdline;
 
     int restoring = (restore_file || (migrate_fd >= 0));
 
@@ -2020,6 +2022,32 @@ start:
         perror("cannot save config file");
         ret = ERROR_FAIL;
         goto error_out;
+    }
+
+    if (domain_create_script) {
+        const char *conf;
+
+        /* call additional domain create script
+           <script> restore|create <domid> <path of config file>
+         */
+        conf = libxl_userdata_path(ctx, domid, "xl", "d");
+        if (!conf) {
+            fprintf(stderr, "no config file found\n");
+            ret = ERROR_FAIL;
+            goto error_out;
+        }
+        asprintf(&domain_create_cmdline, "%s/%s %s %d %s", 
+                 XEN_SCRIPT_DIR, domain_create_script, 
+                 restoring ? "restore" : "create", 
+                 domid, conf);
+
+        ret = system(domain_create_cmdline);
+
+        if (ret) {
+            perror("domain create script failed");
+            ret = ERROR_FAIL;
+            goto error_out;
+        }
     }
 
     release_lock();

--===============6126879887583360703==
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.xen.org
http://lists.xen.org/xen-devel

--===============6126879887583360703==--


From xen-devel-bounces@lists.xen.org Wed Nov 14 10:06:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 10:06:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYZrC-000447-GJ; Wed, 14 Nov 2012 10:06:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYZrB-00043w-Al
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 10:06:05 +0000
Received: from [85.158.137.99:3177] by server-5.bemta-3.messagelabs.com id
	65/3F-26311-C0D63A05; Wed, 14 Nov 2012 10:06:04 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1352887561!13978462!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1856 invoked from network); 14 Nov 2012 10:06:01 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-217.messagelabs.com with SMTP;
	14 Nov 2012 10:06:01 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 14 Nov 2012 10:06:00 +0000
Message-Id: <50A37B1802000078000A86D5@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 14 Nov 2012 10:06:00 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Malcolm Crossley" <malcolm.crossley@citrix.com>,<tim@xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
In-Reply-To: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
Mime-Version: 1.0
Content-Disposition: inline
Cc: eddie.dong@intel.com, Ian.Campbell@citrix.com, jun.nakajima@intel.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 21:08, Malcolm Crossley <malcolm.crossley@citrix.com> wrote:
> The self_nmi() code cause's an NMI to be triggered by sending an APIC message
> to the local processor. Unfortunately there is a delay in the delivery of 
> the
> APIC message and we may already have re-entered the HVM guest by the time the
> NMI is taken. This results in the VMEXIT code calling the self_nmi() 
> function
> again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop 
> before
> the HVM guest resumes normal operation.
> 
> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
> 
> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
> completes.
> 
> So we believe it is safe to directly invoke the INT call as NMI's should
> already be blocked.
> 
> The INT 2 call will perform an IRET which will unblock later calls to the 
> NMI
> handler, according to Intel SDM Volume 3 Chapter 6.7.1. We must ensure that 
> the
> IRET from the INT 2 IRET is the first IRET issued to prevent losing an NMI.
> Moving the INT 2 call to before the interrupts are enabled should ensure we
> don't lose the NMI.
> 
> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
> Acked-by: Tim Deegan <tim@xen.org>
> 
> diff -r 62885b3c34c8 -r 7d6fd0219dd7 xen/arch/x86/hvm/vmx/vmx.c
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>          vector = intr_info & INTR_INFO_VECTOR_MASK;
>          if ( vector == TRAP_machine_check )
>              do_machine_check(regs);
> +        else if ( vector == TRAP_nmi &&
> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
> +                  (X86_EVENTTYPE_NMI << 8) ) )
> +            /* Must be called before interrupts are enabled to ensure
> +             * the NMI handler code is run before the first IRET. The
> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
> +             */
> +            asm volatile("int $2"); /* Real NMI, vector 2: normal processing */

And I still don't like this use of "int $2" here: An aspect we didn't
consider so far is that a nested MCE would break things again
(yes, that also is the case for NMIs arriving when in VMX root
context, but this wouldn't be the case here if we called do_nmi()
and took care of the missing IRET in a place also covering the PV
path, e.g. in continue_idle_domain() or reset_stack_and_jump();
we should at least keep the window where this can happen as
small as possible).

Jan

>          break;
>      case EXIT_REASON_MCE_DURING_VMENTRY:
>          do_machine_check(regs);
> @@ -2442,7 +2450,6 @@ void vmx_vmexit_handler(struct cpu_user_
>                   (X86_EVENTTYPE_NMI << 8) )
>                  goto exit_and_crash;
>              HVMTRACE_0D(NMI);
> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>              break;
>          case TRAP_machine_check:
>              HVMTRACE_0D(MCE);
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 10:06:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 10:06:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYZrC-000447-GJ; Wed, 14 Nov 2012 10:06:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYZrB-00043w-Al
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 10:06:05 +0000
Received: from [85.158.137.99:3177] by server-5.bemta-3.messagelabs.com id
	65/3F-26311-C0D63A05; Wed, 14 Nov 2012 10:06:04 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1352887561!13978462!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1856 invoked from network); 14 Nov 2012 10:06:01 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-217.messagelabs.com with SMTP;
	14 Nov 2012 10:06:01 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 14 Nov 2012 10:06:00 +0000
Message-Id: <50A37B1802000078000A86D5@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 14 Nov 2012 10:06:00 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Malcolm Crossley" <malcolm.crossley@citrix.com>,<tim@xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
In-Reply-To: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
Mime-Version: 1.0
Content-Disposition: inline
Cc: eddie.dong@intel.com, Ian.Campbell@citrix.com, jun.nakajima@intel.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 21:08, Malcolm Crossley <malcolm.crossley@citrix.com> wrote:
> The self_nmi() code cause's an NMI to be triggered by sending an APIC message
> to the local processor. Unfortunately there is a delay in the delivery of 
> the
> APIC message and we may already have re-entered the HVM guest by the time the
> NMI is taken. This results in the VMEXIT code calling the self_nmi() 
> function
> again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop 
> before
> the HVM guest resumes normal operation.
> 
> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
> 
> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
> completes.
> 
> So we believe it is safe to directly invoke the INT call as NMI's should
> already be blocked.
> 
> The INT 2 call will perform an IRET which will unblock later calls to the 
> NMI
> handler, according to Intel SDM Volume 3 Chapter 6.7.1. We must ensure that 
> the
> IRET from the INT 2 IRET is the first IRET issued to prevent losing an NMI.
> Moving the INT 2 call to before the interrupts are enabled should ensure we
> don't lose the NMI.
> 
> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
> Acked-by: Tim Deegan <tim@xen.org>
> 
> diff -r 62885b3c34c8 -r 7d6fd0219dd7 xen/arch/x86/hvm/vmx/vmx.c
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>          vector = intr_info & INTR_INFO_VECTOR_MASK;
>          if ( vector == TRAP_machine_check )
>              do_machine_check(regs);
> +        else if ( vector == TRAP_nmi &&
> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
> +                  (X86_EVENTTYPE_NMI << 8) ) )
> +            /* Must be called before interrupts are enabled to ensure
> +             * the NMI handler code is run before the first IRET. The
> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
> +             */
> +            asm volatile("int $2"); /* Real NMI, vector 2: normal processing */

And I still don't like this use of "int $2" here: An aspect we didn't
consider so far is that a nested MCE would break things again
(yes, that also is the case for NMIs arriving when in VMX root
context, but this wouldn't be the case here if we called do_nmi()
and took care of the missing IRET in a place also covering the PV
path, e.g. in continue_idle_domain() or reset_stack_and_jump();
we should at least keep the window where this can happen as
small as possible).

Jan

>          break;
>      case EXIT_REASON_MCE_DURING_VMENTRY:
>          do_machine_check(regs);
> @@ -2442,7 +2450,6 @@ void vmx_vmexit_handler(struct cpu_user_
>                   (X86_EVENTTYPE_NMI << 8) )
>                  goto exit_and_crash;
>              HVMTRACE_0D(NMI);
> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>              break;
>          case TRAP_machine_check:
>              HVMTRACE_0D(MCE);
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 10:25:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 10:25:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYa9I-0004sl-3K; Wed, 14 Nov 2012 10:24:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYa9G-0004sc-8Q
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 10:24:46 +0000
Received: from [193.109.254.147:2901] by server-15.bemta-14.messagelabs.com id
	97/A7-12105-D6173A05; Wed, 14 Nov 2012 10:24:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1352888684!10897210!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5851 invoked from network); 14 Nov 2012 10:24:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 10:24:44 -0000
X-IronPort-AV: E=Sophos;i="4.83,249,1352073600"; d="scan'208";a="15797201"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 10:24:44 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 14 Nov 2012 10:24:43 +0000
Message-ID: <1352888682.26873.23.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Date: Wed, 14 Nov 2012 10:24:42 +0000
In-Reply-To: <90421d4a-2b5e-49de-9c0f-e4c914980e7f@default>
References: <38bc9a60-827c-41f8-a667-e08960b8c135@default>
	<90421d4a-2b5e-49de-9c0f-e4c914980e7f@default>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen-tmem-list-parse: fix ugly parse output
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-14 at 00:08 +0000, Dan Magenheimer wrote:

> > Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com> and applied, sorry for
the delay.

> > ---
> >  tools/misc/xen-tmem-list-parse.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/tools/misc/xen-tmem-list-parse.c b/tools/misc/xen-tmem-list-parse.c
> > index 977e4d3..f32b107 100644
> > --- a/tools/misc/xen-tmem-list-parse.c
> > +++ b/tools/misc/xen-tmem-list-parse.c
> > @@ -243,6 +243,7 @@ void parse_pool(char *s)
> >      unsigned long long flush_objs = parse(s,"ot");
> > 
> >      parse_string(s,"PT",pool_type,2);
> > +    pool_type[2] = '\0';
> >      if (pool_type[1] == 'S')
> >          return; /* no need to repeat print data for shared pools */
> >      printf("domid%lu,id%lu[%s]:pgp=%llu(max=%llu) obj=%llu(%llu) "
> > @@ -286,6 +287,7 @@ void parse_shared_pool(char *s)
> >      unsigned long long flush_objs = parse(s,"ot");
> > 
> >      parse_string(s,"PT",pool_type,2);
> > +    pool_type[2] = '\0';
> >      parse_sharers(s,"SC",buf,BUFSIZE);
> >      printf("poolid=%lu[%s] uuid=%llx.%llx, shared-by:%s: "
> >             "pgp=%llu(max=%llu) obj=%llu(%llu) "
> > --
> > 1.7.1



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 10:25:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 10:25:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYa9I-0004sl-3K; Wed, 14 Nov 2012 10:24:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYa9G-0004sc-8Q
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 10:24:46 +0000
Received: from [193.109.254.147:2901] by server-15.bemta-14.messagelabs.com id
	97/A7-12105-D6173A05; Wed, 14 Nov 2012 10:24:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1352888684!10897210!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5851 invoked from network); 14 Nov 2012 10:24:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 10:24:44 -0000
X-IronPort-AV: E=Sophos;i="4.83,249,1352073600"; d="scan'208";a="15797201"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 10:24:44 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 14 Nov 2012 10:24:43 +0000
Message-ID: <1352888682.26873.23.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Date: Wed, 14 Nov 2012 10:24:42 +0000
In-Reply-To: <90421d4a-2b5e-49de-9c0f-e4c914980e7f@default>
References: <38bc9a60-827c-41f8-a667-e08960b8c135@default>
	<90421d4a-2b5e-49de-9c0f-e4c914980e7f@default>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen-tmem-list-parse: fix ugly parse output
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-14 at 00:08 +0000, Dan Magenheimer wrote:

> > Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com> and applied, sorry for
the delay.

> > ---
> >  tools/misc/xen-tmem-list-parse.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/tools/misc/xen-tmem-list-parse.c b/tools/misc/xen-tmem-list-parse.c
> > index 977e4d3..f32b107 100644
> > --- a/tools/misc/xen-tmem-list-parse.c
> > +++ b/tools/misc/xen-tmem-list-parse.c
> > @@ -243,6 +243,7 @@ void parse_pool(char *s)
> >      unsigned long long flush_objs = parse(s,"ot");
> > 
> >      parse_string(s,"PT",pool_type,2);
> > +    pool_type[2] = '\0';
> >      if (pool_type[1] == 'S')
> >          return; /* no need to repeat print data for shared pools */
> >      printf("domid%lu,id%lu[%s]:pgp=%llu(max=%llu) obj=%llu(%llu) "
> > @@ -286,6 +287,7 @@ void parse_shared_pool(char *s)
> >      unsigned long long flush_objs = parse(s,"ot");
> > 
> >      parse_string(s,"PT",pool_type,2);
> > +    pool_type[2] = '\0';
> >      parse_sharers(s,"SC",buf,BUFSIZE);
> >      printf("poolid=%lu[%s] uuid=%llx.%llx, shared-by:%s: "
> >             "pgp=%llu(max=%llu) obj=%llu(%llu) "
> > --
> > 1.7.1



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 10:25:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 10:25:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYa9M-0004t8-Fz; Wed, 14 Nov 2012 10:24:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYa9L-0004sx-EB
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 10:24:51 +0000
Received: from [85.158.139.83:30206] by server-12.bemta-5.messagelabs.com id
	18/EB-02886-27173A05; Wed, 14 Nov 2012 10:24:50 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1352888689!30243428!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16197 invoked from network); 14 Nov 2012 10:24:50 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 10:24:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,249,1352073600"; d="scan'208";a="15797203"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 10:24:49 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 14 Nov 2012 10:24:49 +0000
Message-ID: <1352888688.26873.24.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Date: Wed, 14 Nov 2012 10:24:48 +0000
In-Reply-To: <1352823918.7491.96.camel@zakaz.uk.xensource.com>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
	<1352738557.27833.302.camel@zakaz.uk.xensource.com>
	<20121112180738.GA26672@aepfle.de>	<20121112183457.GB2114@lolek.nigdzie>
	<20121112184047.GA28988@aepfle.de>
	<1352804909.7491.55.camel@zakaz.uk.xensource.com>
	<20121113132735.GD7561@jajo.eggsoft>
	<20642.29568.426761.422604@mariner.uk.xensource.com>
	<1352823918.7491.96.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Jacek Konieczny <jajcus@jajcus.net>
Subject: Re: [Xen-devel] [PATCH] Fix locking in
 tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 16:25 +0000, Ian Campbell wrote:
> On Tue, 2012-11-13 at 16:21 +0000, Ian Jackson wrote:

> > Anyway the patch is fine.
> > 
> > Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> 
> Yes, irrespective of why this patch does seem to be correct:
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>

Applied, thanks all.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 10:25:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 10:25:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYa9M-0004t8-Fz; Wed, 14 Nov 2012 10:24:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYa9L-0004sx-EB
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 10:24:51 +0000
Received: from [85.158.139.83:30206] by server-12.bemta-5.messagelabs.com id
	18/EB-02886-27173A05; Wed, 14 Nov 2012 10:24:50 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1352888689!30243428!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16197 invoked from network); 14 Nov 2012 10:24:50 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 10:24:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,249,1352073600"; d="scan'208";a="15797203"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 10:24:49 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 14 Nov 2012 10:24:49 +0000
Message-ID: <1352888688.26873.24.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Date: Wed, 14 Nov 2012 10:24:48 +0000
In-Reply-To: <1352823918.7491.96.camel@zakaz.uk.xensource.com>
References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net>
	<1352738557.27833.302.camel@zakaz.uk.xensource.com>
	<20121112180738.GA26672@aepfle.de>	<20121112183457.GB2114@lolek.nigdzie>
	<20121112184047.GA28988@aepfle.de>
	<1352804909.7491.55.camel@zakaz.uk.xensource.com>
	<20121113132735.GD7561@jajo.eggsoft>
	<20642.29568.426761.422604@mariner.uk.xensource.com>
	<1352823918.7491.96.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Jacek Konieczny <jajcus@jajcus.net>
Subject: Re: [Xen-devel] [PATCH] Fix locking in
 tools/hotplug/Linux/locking.sh
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 16:25 +0000, Ian Campbell wrote:
> On Tue, 2012-11-13 at 16:21 +0000, Ian Jackson wrote:

> > Anyway the patch is fine.
> > 
> > Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> 
> Yes, irrespective of why this patch does seem to be correct:
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>

Applied, thanks all.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 10:33:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 10:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYaHY-0005Ky-Hp; Wed, 14 Nov 2012 10:33:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYaHX-0005Kh-Aq
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 10:33:19 +0000
Received: from [85.158.139.211:6779] by server-16.bemta-5.messagelabs.com id
	AA/E0-04786-E6373A05; Wed, 14 Nov 2012 10:33:18 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1352889197!18109902!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32382 invoked from network); 14 Nov 2012 10:33:17 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-206.messagelabs.com with SMTP;
	14 Nov 2012 10:33:17 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 14 Nov 2012 10:33:17 +0000
Message-Id: <50A3817D02000078000A8710@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 14 Nov 2012 10:33:17 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
In-Reply-To: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, TimDeegan <tim@xen.org>,
	KonradWilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 23:23, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> --- a/xen/common/memory.c
> +++ b/xen/common/memory.c
> @@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
>                               (j * (1UL << exch.out.extent_order)));
>  
>                  spin_lock(&d->page_alloc_lock);
> -                d->tot_pages -= dec_count;
> +                domain_decrease_tot_pages(d, dec_count);
>                  drop_dom_ref = (dec_count && !d->tot_pages);
>                  spin_unlock(&d->page_alloc_lock);
>  
> @@ -685,6 +685,19 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>          break;
>      }
>  
> +    case XENMEM_claim_pages:
> +
> +        rc = rcu_lock_target_domain_by_id(domid, &d);

Where does "domid" come from?

> +        if ( rc )
> +            return rc;
> +
> +        rc = domain_set_unclaimed_pages(d, reservation.nr_extents,
> +                                        reservation.mem_flags);

Where do you initialize "reservation"?

And if you're indeed intending to re-use struct
xen_memory_reservation for this sub-function, then you either
ought to honor the other fields, or bail on them not being zero.

> +
> +        rcu_unlock_domain(d);
> +
> +        break;
> +
>      default:
>          rc = arch_memory_op(op, arg);
>          break;
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -238,6 +238,90 @@ static long midsize_alloc_zone_pages;
>  #define MIDSIZE_ALLOC_FRAC 128
>  
>  static DEFINE_SPINLOCK(heap_lock);
> +static long total_unclaimed_pages; /* total outstanding claims by all domains */
> +
> +unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pages)
> +{
> +    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
> +
> +    ASSERT(spin_is_locked(&d->page_alloc_lock));
> +    ASSERT(!spin_is_locked(&heap_lock));
> +    spin_lock(&heap_lock);
> +    d->tot_pages += pages;
> +    if ( d->unclaimed_pages )
> +    {
> +        dom_before = d->unclaimed_pages;
> +        dom_after = dom_before - pages;
> +        if ( (dom_before > 0) && (dom_after < 0) )
> +            dom_claimed = 0;
> +        else
> +            dom_claimed = dom_after;
> +	sys_before = total_unclaimed_pages;
> +	sys_after = sys_before - (dom_before - dom_claimed);
> +	BUG_ON( (sys_before > 0) && (sys_after < 0) );
> +        total_unclaimed_pages = sys_after;
> +        d->unclaimed_pages = dom_claimed;
> +    }
> +    spin_unlock(&heap_lock);
> +    return d->tot_pages;
> +}
> +
> +unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pages)
> +{
> +    ASSERT(spin_is_locked(&d->page_alloc_lock));
> +    ASSERT(!spin_is_locked(&heap_lock));
> +    spin_lock(&heap_lock);
> +    d->tot_pages -= pages;
> +    if ( d->unclaimed_pages )
> +    {
> +        d->unclaimed_pages += pages;
> +	total_unclaimed_pages += pages;
> +    }
> +    spin_unlock(&heap_lock);
> +    return d->tot_pages;
> +}
> +
> +int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
> +                                unsigned long flags)
> +{
> +    int ret = -ENOMEM;
> +    unsigned long avail_pages;
> +
> +    ASSERT(!spin_is_locked(&d->page_alloc_lock));
> +    ASSERT(!spin_is_locked(&heap_lock));
> +    spin_lock(&d->page_alloc_lock);
> +    spin_lock(&heap_lock);
> +    /* only one active claim per domain please */
> +    if ( d->unclaimed_pages )
> +	goto out;
> +    avail_pages = total_avail_pages;
> +    if ( !(flags & XENMEM_CLAIMF_free_only) )
> +        avail_pages += tmem_freeable_pages();
> +    avail_pages -= total_unclaimed_pages;
> +    if ( pages < avail_pages )
> +    {
> +        /* ok if domain has allocated some pages before making a claim */
> +        d->unclaimed_pages = pages - d->tot_pages;
> +        total_unclaimed_pages += total_unclaimed_pages;

        total_unclaimed_pages += d->unclaimed_pages;

> +        ret = 0;
> +    }
> +out:
> +    spin_unlock(&heap_lock);
> +    spin_unlock(&d->page_alloc_lock);
> +    return ret;
> +}
> +
> +void domain_reset_unclaimed_pages(struct domain *d)
> +{
> +    ASSERT(!spin_is_locked(&d->page_alloc_lock));
> +    ASSERT(!spin_is_locked(&heap_lock));
> +    spin_lock(&d->page_alloc_lock);
> +    spin_lock(&heap_lock);
> +    total_unclaimed_pages -= d->unclaimed_pages;
> +    d->unclaimed_pages = 0;
> +    spin_unlock(&heap_lock);
> +    spin_unlock(&d->page_alloc_lock);

What is the point of acquiring d->page_alloc_lock here if
d->unclaimed_pages is always manipulated with heap_lock
held anyway?

Also, you mention the need to use this function at least
during domain shutdown, but there is no user of it throughout
the patch.

> +}
>  
>  static unsigned long init_node_heap(int node, unsigned long mfn,
>                                      unsigned long nr, bool_t *use_tail)
> @@ -442,6 +526,11 @@ static struct page_info *alloc_heap_pages(
>  
>      spin_lock(&heap_lock);
>  
> +    /* Claimed memory is considered not available */
> +    if ( total_unclaimed_pages + request >
> +         total_avail_pages + tmem_freeable_pages() )

So how would a domain having an active claim get to allocate
its memory if total_unclaimed_pages == total_avail_pages +
tmem_freeable_pages()?

> +        goto not_found;
> +
>      /*
>       * TMEM: When available memory is scarce due to tmem absorbing it, allow
>       * only mid-size allocations to avoid worst of fragmentation issues.

There are also a few uses of tabs for indentation that would
need cleaning up.

Finally, assuming we really want/need this, shouldn't there be
a way for claims to expire (e.g. in case of tool stack problems),
so they don't indefinitely prevent (perhaps large) portions of
memory to be used for other purpose (e.g. when a domain can't
get fully cleaned up)?

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 10:33:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 10:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYaHY-0005Ky-Hp; Wed, 14 Nov 2012 10:33:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYaHX-0005Kh-Aq
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 10:33:19 +0000
Received: from [85.158.139.211:6779] by server-16.bemta-5.messagelabs.com id
	AA/E0-04786-E6373A05; Wed, 14 Nov 2012 10:33:18 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1352889197!18109902!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32382 invoked from network); 14 Nov 2012 10:33:17 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-206.messagelabs.com with SMTP;
	14 Nov 2012 10:33:17 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 14 Nov 2012 10:33:17 +0000
Message-Id: <50A3817D02000078000A8710@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 14 Nov 2012 10:33:17 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
In-Reply-To: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, TimDeegan <tim@xen.org>,
	KonradWilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 23:23, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> --- a/xen/common/memory.c
> +++ b/xen/common/memory.c
> @@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
>                               (j * (1UL << exch.out.extent_order)));
>  
>                  spin_lock(&d->page_alloc_lock);
> -                d->tot_pages -= dec_count;
> +                domain_decrease_tot_pages(d, dec_count);
>                  drop_dom_ref = (dec_count && !d->tot_pages);
>                  spin_unlock(&d->page_alloc_lock);
>  
> @@ -685,6 +685,19 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>          break;
>      }
>  
> +    case XENMEM_claim_pages:
> +
> +        rc = rcu_lock_target_domain_by_id(domid, &d);

Where does "domid" come from?

> +        if ( rc )
> +            return rc;
> +
> +        rc = domain_set_unclaimed_pages(d, reservation.nr_extents,
> +                                        reservation.mem_flags);

Where do you initialize "reservation"?

And if you're indeed intending to re-use struct
xen_memory_reservation for this sub-function, then you either
ought to honor the other fields, or bail on them not being zero.

> +
> +        rcu_unlock_domain(d);
> +
> +        break;
> +
>      default:
>          rc = arch_memory_op(op, arg);
>          break;
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -238,6 +238,90 @@ static long midsize_alloc_zone_pages;
>  #define MIDSIZE_ALLOC_FRAC 128
>  
>  static DEFINE_SPINLOCK(heap_lock);
> +static long total_unclaimed_pages; /* total outstanding claims by all domains */
> +
> +unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pages)
> +{
> +    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
> +
> +    ASSERT(spin_is_locked(&d->page_alloc_lock));
> +    ASSERT(!spin_is_locked(&heap_lock));
> +    spin_lock(&heap_lock);
> +    d->tot_pages += pages;
> +    if ( d->unclaimed_pages )
> +    {
> +        dom_before = d->unclaimed_pages;
> +        dom_after = dom_before - pages;
> +        if ( (dom_before > 0) && (dom_after < 0) )
> +            dom_claimed = 0;
> +        else
> +            dom_claimed = dom_after;
> +	sys_before = total_unclaimed_pages;
> +	sys_after = sys_before - (dom_before - dom_claimed);
> +	BUG_ON( (sys_before > 0) && (sys_after < 0) );
> +        total_unclaimed_pages = sys_after;
> +        d->unclaimed_pages = dom_claimed;
> +    }
> +    spin_unlock(&heap_lock);
> +    return d->tot_pages;
> +}
> +
> +unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pages)
> +{
> +    ASSERT(spin_is_locked(&d->page_alloc_lock));
> +    ASSERT(!spin_is_locked(&heap_lock));
> +    spin_lock(&heap_lock);
> +    d->tot_pages -= pages;
> +    if ( d->unclaimed_pages )
> +    {
> +        d->unclaimed_pages += pages;
> +	total_unclaimed_pages += pages;
> +    }
> +    spin_unlock(&heap_lock);
> +    return d->tot_pages;
> +}
> +
> +int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
> +                                unsigned long flags)
> +{
> +    int ret = -ENOMEM;
> +    unsigned long avail_pages;
> +
> +    ASSERT(!spin_is_locked(&d->page_alloc_lock));
> +    ASSERT(!spin_is_locked(&heap_lock));
> +    spin_lock(&d->page_alloc_lock);
> +    spin_lock(&heap_lock);
> +    /* only one active claim per domain please */
> +    if ( d->unclaimed_pages )
> +	goto out;
> +    avail_pages = total_avail_pages;
> +    if ( !(flags & XENMEM_CLAIMF_free_only) )
> +        avail_pages += tmem_freeable_pages();
> +    avail_pages -= total_unclaimed_pages;
> +    if ( pages < avail_pages )
> +    {
> +        /* ok if domain has allocated some pages before making a claim */
> +        d->unclaimed_pages = pages - d->tot_pages;
> +        total_unclaimed_pages += total_unclaimed_pages;

        total_unclaimed_pages += d->unclaimed_pages;

> +        ret = 0;
> +    }
> +out:
> +    spin_unlock(&heap_lock);
> +    spin_unlock(&d->page_alloc_lock);
> +    return ret;
> +}
> +
> +void domain_reset_unclaimed_pages(struct domain *d)
> +{
> +    ASSERT(!spin_is_locked(&d->page_alloc_lock));
> +    ASSERT(!spin_is_locked(&heap_lock));
> +    spin_lock(&d->page_alloc_lock);
> +    spin_lock(&heap_lock);
> +    total_unclaimed_pages -= d->unclaimed_pages;
> +    d->unclaimed_pages = 0;
> +    spin_unlock(&heap_lock);
> +    spin_unlock(&d->page_alloc_lock);

What is the point of acquiring d->page_alloc_lock here if
d->unclaimed_pages is always manipulated with heap_lock
held anyway?

Also, you mention the need to use this function at least
during domain shutdown, but there is no user of it throughout
the patch.

> +}
>  
>  static unsigned long init_node_heap(int node, unsigned long mfn,
>                                      unsigned long nr, bool_t *use_tail)
> @@ -442,6 +526,11 @@ static struct page_info *alloc_heap_pages(
>  
>      spin_lock(&heap_lock);
>  
> +    /* Claimed memory is considered not available */
> +    if ( total_unclaimed_pages + request >
> +         total_avail_pages + tmem_freeable_pages() )

So how would a domain having an active claim get to allocate
its memory if total_unclaimed_pages == total_avail_pages +
tmem_freeable_pages()?

> +        goto not_found;
> +
>      /*
>       * TMEM: When available memory is scarce due to tmem absorbing it, allow
>       * only mid-size allocations to avoid worst of fragmentation issues.

There are also a few uses of tabs for indentation that would
need cleaning up.

Finally, assuming we really want/need this, shouldn't there be
a way for claims to expire (e.g. in case of tool stack problems),
so they don't indefinitely prevent (perhaps large) portions of
memory to be used for other purpose (e.g. when a domain can't
get fully cleaned up)?

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 10:48:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 10:48:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYaWF-0006KP-1G; Wed, 14 Nov 2012 10:48:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYaWD-0006KD-VL
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 10:48:30 +0000
Received: from [85.158.137.99:24423] by server-8.bemta-3.messagelabs.com id
	FC/FE-07786-DF673A05; Wed, 14 Nov 2012 10:48:29 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1352890108!16697480!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27103 invoked from network); 14 Nov 2012 10:48:28 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-217.messagelabs.com with SMTP;
	14 Nov 2012 10:48:28 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 14 Nov 2012 10:48:28 +0000
Message-Id: <50A3850B02000078000A8730@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 14 Nov 2012 10:48:27 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Jackson" <Ian.Jackson@eu.citrix.com>
References: <20642.37747.982297.553297@mariner.uk.xensource.com>
In-Reply-To: <20642.37747.982297.553297@mariner.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>, xen-devel@lists.xen.org,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] Tools backports to 4.1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 19:37, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> I have backported a number of the tools fixes from 4.2 to 4.1.

Thanks a lot! I see this also included some qemu changes, so I
imply that we're then all set for RC1 on both trees as soon as
the patches for the security problems published yesterday went
in (and got a push) - are you planning to do this, or should
someone else (e.g. me) step in?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 10:48:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 10:48:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYaWF-0006KP-1G; Wed, 14 Nov 2012 10:48:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYaWD-0006KD-VL
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 10:48:30 +0000
Received: from [85.158.137.99:24423] by server-8.bemta-3.messagelabs.com id
	FC/FE-07786-DF673A05; Wed, 14 Nov 2012 10:48:29 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1352890108!16697480!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27103 invoked from network); 14 Nov 2012 10:48:28 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-217.messagelabs.com with SMTP;
	14 Nov 2012 10:48:28 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 14 Nov 2012 10:48:28 +0000
Message-Id: <50A3850B02000078000A8730@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 14 Nov 2012 10:48:27 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Jackson" <Ian.Jackson@eu.citrix.com>
References: <20642.37747.982297.553297@mariner.uk.xensource.com>
In-Reply-To: <20642.37747.982297.553297@mariner.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>, xen-devel@lists.xen.org,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] Tools backports to 4.1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 19:37, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> I have backported a number of the tools fixes from 4.2 to 4.1.

Thanks a lot! I see this also included some qemu changes, so I
imply that we're then all set for RC1 on both trees as soon as
the patches for the security problems published yesterday went
in (and got a push) - are you planning to do this, or should
someone else (e.g. me) step in?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 11:13:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 11:13:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYauD-0007lJ-Ox; Wed, 14 Nov 2012 11:13:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TYauC-0007l6-6C
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 11:13:16 +0000
Received: from [85.158.139.211:32482] by server-3.bemta-5.messagelabs.com id
	6D/43-18736-BCC73A05; Wed, 14 Nov 2012 11:13:15 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1352891593!20115894!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODYyNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4604 invoked from network); 14 Nov 2012 11:13:14 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 11:13:14 -0000
X-IronPort-AV: E=Sophos;i="4.83,249,1352073600"; d="scan'208";a="214453283"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	14 Nov 2012 11:13:13 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Wed, 14 Nov 2012 06:13:12 -0500
Message-ID: <50A37CC7.8050700@citrix.com>
Date: Wed, 14 Nov 2012 11:13:11 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
X-Originating-IP: [10.80.3.146]
Subject: [Xen-devel] [RFC/PATCH] Improve speed of mapping guest memory into
	Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Whilst investigating why "guest not pingable time is too long", I found 
that the rate at which guest memory is copied on a localhost is quite 
slow. I tracked down that a large portion of the time copying the guest 
memory was actually spent mapping guest pages into Dom0 memory space, 
and then found that there are two hypervisor call for every page, one to 
map that page in, and one to flush the TLB. So with some work, I managed 
to get it to map a larger number of pages at once (the complication here 
is that Xen isn't allocating machine physical pages "in order", which 
the original remap function expects).

I originally prototyped this on a 2.6.32 kernel, and then ported it 
again onto the 3.7rc kernel.

When microbenchmarking only the map/unmap of guest memory into Dom0, 
this provides a speed up of around 10x for the mapping itself, compared 
to the original 2.6 kernel, and a little less, around 7-8x - in clock 
cycles the mapping with the new code, for a block of 1024 pages, takes 
around 650k cycles, where the 3.7 kernel takes 5M, and the 2.6 kernel 
around 7.6M.

When comparing the total localhost migration time, this makes a 15% 
improvment on a light load (idle) guest with 1GB memory, on a heavy load 
guest (aggressively dirtying 800MB of the 1GB guest memory) it gives 
more than 20% improvement. (When comapring 3.7 "original" vs. with the 
patch below - 3.7 is a little better than the 2.6 kernel in my benchmarks).

The basic principle of the change is to pass a "list" of mfns (pointer 
to a sequence of mfns) to a new xen_remap_domain_mfn_list function, 
instead of the existing xen_remap_domain_mfn_range.

This change should only affect xen parts of the kernel.

I have also found that the munmap() call used to unmap the guest memory 
from Dom0 is about 35% slower in 3.7 kernel than in the 2.6 kernel (3.8M 
cycles vs 2.8M cycles). I think this could be made quicker by using a 
direct write of zero rather than the compare exchange operation that is 
currently used [which traps into Xen, performs the compare & exchange] - 
the compare exchange is required if the mapping is part of a mapped file 
that needs to write dirty pages out to the backing storage, but for 
"we've mapped guest memory to Dom0", there is no need to atomically 
check if it's dirty [it shouldn't be dirty in the first place, as we 
only read from it]. Unfortunately, this is generic kernel code, so I 
fear it's hard to get changes approved. I have a feeling, however, that 
if the memory is not a memory mapped file [with write allowed], it would 
be faster to write zero to the page-table entries even in native code.

--
Mats

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index dcf5f2d..b8c022c 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -2482,6 +2482,12 @@ struct remap_data {
      struct mmu_update *mmu_update;
  };

+struct remap_list_data {
+    unsigned long *mfn;
+    pgprot_t prot;
+    struct mmu_update *mmu_update;
+};
+
  static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
                   unsigned long addr, void *data)
  {
@@ -2495,6 +2501,19 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, 
pgtable_t token,
      return 0;
  }

+static int remap_area_mfn_list_pte_fn(pte_t *ptep, pgtable_t token,
+                      unsigned long addr, void *data)
+{
+    struct remap_list_data *rmd = data;
+    pte_t pte = pte_mkspecial(pfn_pte(*rmd->mfn++, rmd->prot));
+
+    rmd->mmu_update->ptr = virt_to_machine(ptep).maddr;
+    rmd->mmu_update->val = pte_val_ma(pte);
+    rmd->mmu_update++;
+
+    return 0;
+}
+
  int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
                     unsigned long addr,
                     unsigned long mfn, int nr,
@@ -2542,3 +2561,77 @@ out:
      return err;
  }
  EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range);
+
+/* like xen_remap_domain_mfn_range, but does a list of mfn's, rather
+ * than the, for xen, quite useless, consecutive pages.
+ */
+int xen_remap_domain_mfn_list(struct vm_area_struct *vma,
+                  unsigned long addr,
+                  unsigned long *mfn, int nr,
+                  int *err_ptr,
+                  pgprot_t prot, unsigned domid)
+{
+    struct remap_list_data rmd;
+    struct mmu_update mmu_update[REMAP_BATCH_SIZE];
+    int batch;
+    int done;
+    unsigned long range;
+    int err = 0;
+
+    if (xen_feature(XENFEAT_auto_translated_physmap))
+        return -EINVAL;
+
+    prot = __pgprot(pgprot_val(prot) | _PAGE_IOMAP);
+
+    BUG_ON(!((vma->vm_flags & (VM_PFNMAP | VM_IO)) == (VM_PFNMAP | 
VM_IO)));
+
+    rmd.mfn = mfn;
+    rmd.prot = prot;
+
+    while (nr) {
+        batch = min(REMAP_BATCH_SIZE, nr);
+        range = (unsigned long)batch << PAGE_SHIFT;
+
+        rmd.mmu_update = mmu_update;
+        err = apply_to_page_range(vma->vm_mm, addr, range,
+                      remap_area_mfn_list_pte_fn, &rmd);
+        if (err)
+        {
+            printk("xen_remap_domain_mfn_list: apply_to_range: 
err=%d\n", err);
+            goto out;
+        }
+
+        err = HYPERVISOR_mmu_update(mmu_update, batch, &done, domid);
+        if (err < 0)
+        {
+            int i;
+            /* TODO: We should remove this printk later */
+            printk("xen_remap_domain_mfn_list: mmu_update: err=%d, 
done=%d, batch=%d\n", err, done, batch);
+            err_ptr[done] = err;
+
+            /* now do the remaining part of this batch */
+            for(i = done+1; i < batch; i++)
+            {
+                int tmp_err = HYPERVISOR_mmu_update(&mmu_update[i], 1, 
NULL, domid);
+                if (tmp_err < 0)
+                {
+                    err_ptr[i] = tmp_err;
+                }
+            }
+
+            goto out;
+        }
+
+        nr -= batch;
+        addr += range;
+        err_ptr += batch;
+    }
+
+    err = 0;
+out:
+
+    xen_flush_tlb_all();
+
+    return err;
+}
+EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_list);
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index 8adb9cc..b39a7b7 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -151,6 +151,41 @@ static int traverse_pages(unsigned nelem, size_t size,
      return ret;
  }

+/*
+ * Similar to traverse_pages, but use each page as a "block" of
+ * data to be processed as one unit.
+ */
+static int traverse_pages_block(unsigned nelem, size_t size,
+                struct list_head *pos,
+                int (*fn)(void *data, int nr, void *state),
+                void *state)
+{
+    void *pagedata;
+    unsigned pageidx;
+    int ret = 0;
+
+    BUG_ON(size > PAGE_SIZE);
+
+    pageidx = PAGE_SIZE;
+    pagedata = NULL;    /* hush, gcc */
+
+    while (nelem) {
+        int nr = (PAGE_SIZE/size);
+        struct page *page;
+        if (nr > nelem)
+            nr = nelem;
+        pos = pos->next;
+        page = list_entry(pos, struct page, lru);
+        pagedata = page_address(page);
+        ret = (*fn)(pagedata, nr, state);
+        if (ret)
+            break;
+        nelem -= nr;
+    }
+
+    return ret;
+}
+
  struct mmap_mfn_state {
      unsigned long va;
      struct vm_area_struct *vma;
@@ -250,7 +285,7 @@ struct mmap_batch_state {
       *      0 for no errors
       *      1 if at least one error has happened (and no
       *          -ENOENT errors have happened)
-     *      -ENOENT if at least 1 -ENOENT has happened.
+     *      -ENOENT if at least one -ENOENT has happened.
       */
      int global_error;
      /* An array for individual errors */
@@ -260,17 +295,17 @@ struct mmap_batch_state {
      xen_pfn_t __user *user_mfn;
  };

-static int mmap_batch_fn(void *data, void *state)
+static int mmap_batch_fn(void *data, int nr, void *state)
  {
      xen_pfn_t *mfnp = data;
+
      struct mmap_batch_state *st = state;
      int ret;

-    ret = xen_remap_domain_mfn_range(st->vma, st->va & PAGE_MASK, *mfnp, 1,
-                     st->vma->vm_page_prot, st->domain);
+    BUG_ON(nr < 0);

-    /* Store error code for second pass. */
-    *(st->err++) = ret;
+    ret = xen_remap_domain_mfn_list(st->vma, st->va & PAGE_MASK, mfnp, 
nr, st->err,
+                    st->vma->vm_page_prot, st->domain);

      /* And see if it affects the global_error. */
      if (ret < 0) {
@@ -282,7 +317,7 @@ static int mmap_batch_fn(void *data, void *state)
                  st->global_error = 1;
          }
      }
-    st->va += PAGE_SIZE;
+    st->va += PAGE_SIZE * nr;

      return 0;
  }
@@ -303,6 +338,7 @@ static int mmap_return_errors_v1(void *data, void 
*state)
      return __put_user(*mfnp, st->user_mfn++);
  }

+
  static struct vm_operations_struct privcmd_vm_ops;

  static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
@@ -319,6 +355,7 @@ static long privcmd_ioctl_mmap_batch(void __user 
*udata, int version)
      if (!xen_initial_domain())
          return -EPERM;

+
      switch (version) {
      case 1:
          if (copy_from_user(&m, udata, sizeof(struct privcmd_mmapbatch)))
@@ -378,8 +415,8 @@ static long privcmd_ioctl_mmap_batch(void __user 
*udata, int version)
      state.err           = err_array;

      /* mmap_batch_fn guarantees ret == 0 */
-    BUG_ON(traverse_pages(m.num, sizeof(xen_pfn_t),
-                 &pagelist, mmap_batch_fn, &state));
+    BUG_ON(traverse_pages_block(m.num, sizeof(xen_pfn_t),
+                    &pagelist, mmap_batch_fn, &state));

      up_write(&mm->mmap_sem);

diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
index 6a198e4..15ae4f7 100644
--- a/include/xen/xen-ops.h
+++ b/include/xen/xen-ops.h
@@ -29,4 +29,10 @@ int xen_remap_domain_mfn_range(struct vm_area_struct 
*vma,
                     unsigned long mfn, int nr,
                     pgprot_t prot, unsigned domid);

+int xen_remap_domain_mfn_list(struct vm_area_struct *vma,
+                  unsigned long addr,
+                  unsigned long *mfn, int nr,
+                  int *err_ptr,
+                  pgprot_t prot, unsigned domid);
+
  #endif /* INCLUDE_XEN_OPS_H */





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 11:13:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 11:13:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYauD-0007lJ-Ox; Wed, 14 Nov 2012 11:13:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TYauC-0007l6-6C
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 11:13:16 +0000
Received: from [85.158.139.211:32482] by server-3.bemta-5.messagelabs.com id
	6D/43-18736-BCC73A05; Wed, 14 Nov 2012 11:13:15 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1352891593!20115894!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODYyNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4604 invoked from network); 14 Nov 2012 11:13:14 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 11:13:14 -0000
X-IronPort-AV: E=Sophos;i="4.83,249,1352073600"; d="scan'208";a="214453283"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	14 Nov 2012 11:13:13 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Wed, 14 Nov 2012 06:13:12 -0500
Message-ID: <50A37CC7.8050700@citrix.com>
Date: Wed, 14 Nov 2012 11:13:11 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
X-Originating-IP: [10.80.3.146]
Subject: [Xen-devel] [RFC/PATCH] Improve speed of mapping guest memory into
	Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Whilst investigating why "guest not pingable time is too long", I found 
that the rate at which guest memory is copied on a localhost is quite 
slow. I tracked down that a large portion of the time copying the guest 
memory was actually spent mapping guest pages into Dom0 memory space, 
and then found that there are two hypervisor call for every page, one to 
map that page in, and one to flush the TLB. So with some work, I managed 
to get it to map a larger number of pages at once (the complication here 
is that Xen isn't allocating machine physical pages "in order", which 
the original remap function expects).

I originally prototyped this on a 2.6.32 kernel, and then ported it 
again onto the 3.7rc kernel.

When microbenchmarking only the map/unmap of guest memory into Dom0, 
this provides a speed up of around 10x for the mapping itself, compared 
to the original 2.6 kernel, and a little less, around 7-8x - in clock 
cycles the mapping with the new code, for a block of 1024 pages, takes 
around 650k cycles, where the 3.7 kernel takes 5M, and the 2.6 kernel 
around 7.6M.

When comparing the total localhost migration time, this makes a 15% 
improvment on a light load (idle) guest with 1GB memory, on a heavy load 
guest (aggressively dirtying 800MB of the 1GB guest memory) it gives 
more than 20% improvement. (When comapring 3.7 "original" vs. with the 
patch below - 3.7 is a little better than the 2.6 kernel in my benchmarks).

The basic principle of the change is to pass a "list" of mfns (pointer 
to a sequence of mfns) to a new xen_remap_domain_mfn_list function, 
instead of the existing xen_remap_domain_mfn_range.

This change should only affect xen parts of the kernel.

I have also found that the munmap() call used to unmap the guest memory 
from Dom0 is about 35% slower in 3.7 kernel than in the 2.6 kernel (3.8M 
cycles vs 2.8M cycles). I think this could be made quicker by using a 
direct write of zero rather than the compare exchange operation that is 
currently used [which traps into Xen, performs the compare & exchange] - 
the compare exchange is required if the mapping is part of a mapped file 
that needs to write dirty pages out to the backing storage, but for 
"we've mapped guest memory to Dom0", there is no need to atomically 
check if it's dirty [it shouldn't be dirty in the first place, as we 
only read from it]. Unfortunately, this is generic kernel code, so I 
fear it's hard to get changes approved. I have a feeling, however, that 
if the memory is not a memory mapped file [with write allowed], it would 
be faster to write zero to the page-table entries even in native code.

--
Mats

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index dcf5f2d..b8c022c 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -2482,6 +2482,12 @@ struct remap_data {
      struct mmu_update *mmu_update;
  };

+struct remap_list_data {
+    unsigned long *mfn;
+    pgprot_t prot;
+    struct mmu_update *mmu_update;
+};
+
  static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
                   unsigned long addr, void *data)
  {
@@ -2495,6 +2501,19 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, 
pgtable_t token,
      return 0;
  }

+static int remap_area_mfn_list_pte_fn(pte_t *ptep, pgtable_t token,
+                      unsigned long addr, void *data)
+{
+    struct remap_list_data *rmd = data;
+    pte_t pte = pte_mkspecial(pfn_pte(*rmd->mfn++, rmd->prot));
+
+    rmd->mmu_update->ptr = virt_to_machine(ptep).maddr;
+    rmd->mmu_update->val = pte_val_ma(pte);
+    rmd->mmu_update++;
+
+    return 0;
+}
+
  int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
                     unsigned long addr,
                     unsigned long mfn, int nr,
@@ -2542,3 +2561,77 @@ out:
      return err;
  }
  EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range);
+
+/* like xen_remap_domain_mfn_range, but does a list of mfn's, rather
+ * than the, for xen, quite useless, consecutive pages.
+ */
+int xen_remap_domain_mfn_list(struct vm_area_struct *vma,
+                  unsigned long addr,
+                  unsigned long *mfn, int nr,
+                  int *err_ptr,
+                  pgprot_t prot, unsigned domid)
+{
+    struct remap_list_data rmd;
+    struct mmu_update mmu_update[REMAP_BATCH_SIZE];
+    int batch;
+    int done;
+    unsigned long range;
+    int err = 0;
+
+    if (xen_feature(XENFEAT_auto_translated_physmap))
+        return -EINVAL;
+
+    prot = __pgprot(pgprot_val(prot) | _PAGE_IOMAP);
+
+    BUG_ON(!((vma->vm_flags & (VM_PFNMAP | VM_IO)) == (VM_PFNMAP | 
VM_IO)));
+
+    rmd.mfn = mfn;
+    rmd.prot = prot;
+
+    while (nr) {
+        batch = min(REMAP_BATCH_SIZE, nr);
+        range = (unsigned long)batch << PAGE_SHIFT;
+
+        rmd.mmu_update = mmu_update;
+        err = apply_to_page_range(vma->vm_mm, addr, range,
+                      remap_area_mfn_list_pte_fn, &rmd);
+        if (err)
+        {
+            printk("xen_remap_domain_mfn_list: apply_to_range: 
err=%d\n", err);
+            goto out;
+        }
+
+        err = HYPERVISOR_mmu_update(mmu_update, batch, &done, domid);
+        if (err < 0)
+        {
+            int i;
+            /* TODO: We should remove this printk later */
+            printk("xen_remap_domain_mfn_list: mmu_update: err=%d, 
done=%d, batch=%d\n", err, done, batch);
+            err_ptr[done] = err;
+
+            /* now do the remaining part of this batch */
+            for(i = done+1; i < batch; i++)
+            {
+                int tmp_err = HYPERVISOR_mmu_update(&mmu_update[i], 1, 
NULL, domid);
+                if (tmp_err < 0)
+                {
+                    err_ptr[i] = tmp_err;
+                }
+            }
+
+            goto out;
+        }
+
+        nr -= batch;
+        addr += range;
+        err_ptr += batch;
+    }
+
+    err = 0;
+out:
+
+    xen_flush_tlb_all();
+
+    return err;
+}
+EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_list);
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index 8adb9cc..b39a7b7 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -151,6 +151,41 @@ static int traverse_pages(unsigned nelem, size_t size,
      return ret;
  }

+/*
+ * Similar to traverse_pages, but use each page as a "block" of
+ * data to be processed as one unit.
+ */
+static int traverse_pages_block(unsigned nelem, size_t size,
+                struct list_head *pos,
+                int (*fn)(void *data, int nr, void *state),
+                void *state)
+{
+    void *pagedata;
+    unsigned pageidx;
+    int ret = 0;
+
+    BUG_ON(size > PAGE_SIZE);
+
+    pageidx = PAGE_SIZE;
+    pagedata = NULL;    /* hush, gcc */
+
+    while (nelem) {
+        int nr = (PAGE_SIZE/size);
+        struct page *page;
+        if (nr > nelem)
+            nr = nelem;
+        pos = pos->next;
+        page = list_entry(pos, struct page, lru);
+        pagedata = page_address(page);
+        ret = (*fn)(pagedata, nr, state);
+        if (ret)
+            break;
+        nelem -= nr;
+    }
+
+    return ret;
+}
+
  struct mmap_mfn_state {
      unsigned long va;
      struct vm_area_struct *vma;
@@ -250,7 +285,7 @@ struct mmap_batch_state {
       *      0 for no errors
       *      1 if at least one error has happened (and no
       *          -ENOENT errors have happened)
-     *      -ENOENT if at least 1 -ENOENT has happened.
+     *      -ENOENT if at least one -ENOENT has happened.
       */
      int global_error;
      /* An array for individual errors */
@@ -260,17 +295,17 @@ struct mmap_batch_state {
      xen_pfn_t __user *user_mfn;
  };

-static int mmap_batch_fn(void *data, void *state)
+static int mmap_batch_fn(void *data, int nr, void *state)
  {
      xen_pfn_t *mfnp = data;
+
      struct mmap_batch_state *st = state;
      int ret;

-    ret = xen_remap_domain_mfn_range(st->vma, st->va & PAGE_MASK, *mfnp, 1,
-                     st->vma->vm_page_prot, st->domain);
+    BUG_ON(nr < 0);

-    /* Store error code for second pass. */
-    *(st->err++) = ret;
+    ret = xen_remap_domain_mfn_list(st->vma, st->va & PAGE_MASK, mfnp, 
nr, st->err,
+                    st->vma->vm_page_prot, st->domain);

      /* And see if it affects the global_error. */
      if (ret < 0) {
@@ -282,7 +317,7 @@ static int mmap_batch_fn(void *data, void *state)
                  st->global_error = 1;
          }
      }
-    st->va += PAGE_SIZE;
+    st->va += PAGE_SIZE * nr;

      return 0;
  }
@@ -303,6 +338,7 @@ static int mmap_return_errors_v1(void *data, void 
*state)
      return __put_user(*mfnp, st->user_mfn++);
  }

+
  static struct vm_operations_struct privcmd_vm_ops;

  static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
@@ -319,6 +355,7 @@ static long privcmd_ioctl_mmap_batch(void __user 
*udata, int version)
      if (!xen_initial_domain())
          return -EPERM;

+
      switch (version) {
      case 1:
          if (copy_from_user(&m, udata, sizeof(struct privcmd_mmapbatch)))
@@ -378,8 +415,8 @@ static long privcmd_ioctl_mmap_batch(void __user 
*udata, int version)
      state.err           = err_array;

      /* mmap_batch_fn guarantees ret == 0 */
-    BUG_ON(traverse_pages(m.num, sizeof(xen_pfn_t),
-                 &pagelist, mmap_batch_fn, &state));
+    BUG_ON(traverse_pages_block(m.num, sizeof(xen_pfn_t),
+                    &pagelist, mmap_batch_fn, &state));

      up_write(&mm->mmap_sem);

diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
index 6a198e4..15ae4f7 100644
--- a/include/xen/xen-ops.h
+++ b/include/xen/xen-ops.h
@@ -29,4 +29,10 @@ int xen_remap_domain_mfn_range(struct vm_area_struct 
*vma,
                     unsigned long mfn, int nr,
                     pgprot_t prot, unsigned domid);

+int xen_remap_domain_mfn_list(struct vm_area_struct *vma,
+                  unsigned long addr,
+                  unsigned long *mfn, int nr,
+                  int *err_ptr,
+                  pgprot_t prot, unsigned domid);
+
  #endif /* INCLUDE_XEN_OPS_H */





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 12:10:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 12:10:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYbmh-0002Yt-5A; Wed, 14 Nov 2012 12:09:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYbmf-0002Yo-J2
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 12:09:33 +0000
Received: from [85.158.143.35:45611] by server-2.bemta-4.messagelabs.com id
	89/A8-28922-CF983A05; Wed, 14 Nov 2012 12:09:32 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1352894905!5460466!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28562 invoked from network); 14 Nov 2012 12:08:26 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 12:08:26 -0000
X-IronPort-AV: E=Sophos;i="4.83,250,1352073600"; d="scan'208";a="15800142"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 12:08:05 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 14 Nov 2012 12:08:04 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TYblE-0005Ru-Vd; Wed, 14 Nov 2012 12:08:05 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TYblE-0001Tt-R4;
	Wed, 14 Nov 2012 12:08:04 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20643.35236.734433.350743@mariner.uk.xensource.com>
Date: Wed, 14 Nov 2012 12:08:04 +0000
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1352888682.26873.23.camel@zakaz.uk.xensource.com>
References: <38bc9a60-827c-41f8-a667-e08960b8c135@default>
	<90421d4a-2b5e-49de-9c0f-e4c914980e7f@default>
	<1352888682.26873.23.camel@zakaz.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen-tmem-list-parse: fix ugly parse output
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("Re: [PATCH] xen-tmem-list-parse: fix ugly parse output"):
> On Wed, 2012-11-14 at 00:08 +0000, Dan Magenheimer wrote:
> 
> > > Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com> and applied, sorry for
> the delay.

I'm happy to backport this to 4.2.  Since none of this is tested by
the autotests and the change is self-contained, there is no point
waiting to see if it survives in -unstable and I have done so right
away.

As for 4.1, I think that's really very much in the deep freeze and
receiving essential bug/compatibility/security fixes only so I would
be inclined to punt on this patch.

I have another comment though:

  The program xen-tmem-list-parse parses the output of xm/xl tmem-list
  into human-readable format.  A missing NULL terminator sometimes
  causes garbage to be spewed where the two-letter pool type
  should be output.

Would it not be much better if  xl tmem-list  produced a sane format
to start with ?  I haven't seen what the old and new formats are like
but in general I think  xl foo-list  should produce information useful
to humans.

In xl for the future we should be providing json output for things
which need to be machine-readable.  This may need a transition plan of
course.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 12:10:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 12:10:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYbmh-0002Yt-5A; Wed, 14 Nov 2012 12:09:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYbmf-0002Yo-J2
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 12:09:33 +0000
Received: from [85.158.143.35:45611] by server-2.bemta-4.messagelabs.com id
	89/A8-28922-CF983A05; Wed, 14 Nov 2012 12:09:32 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1352894905!5460466!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28562 invoked from network); 14 Nov 2012 12:08:26 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 12:08:26 -0000
X-IronPort-AV: E=Sophos;i="4.83,250,1352073600"; d="scan'208";a="15800142"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 12:08:05 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 14 Nov 2012 12:08:04 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TYblE-0005Ru-Vd; Wed, 14 Nov 2012 12:08:05 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TYblE-0001Tt-R4;
	Wed, 14 Nov 2012 12:08:04 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20643.35236.734433.350743@mariner.uk.xensource.com>
Date: Wed, 14 Nov 2012 12:08:04 +0000
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1352888682.26873.23.camel@zakaz.uk.xensource.com>
References: <38bc9a60-827c-41f8-a667-e08960b8c135@default>
	<90421d4a-2b5e-49de-9c0f-e4c914980e7f@default>
	<1352888682.26873.23.camel@zakaz.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen-tmem-list-parse: fix ugly parse output
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("Re: [PATCH] xen-tmem-list-parse: fix ugly parse output"):
> On Wed, 2012-11-14 at 00:08 +0000, Dan Magenheimer wrote:
> 
> > > Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com> and applied, sorry for
> the delay.

I'm happy to backport this to 4.2.  Since none of this is tested by
the autotests and the change is self-contained, there is no point
waiting to see if it survives in -unstable and I have done so right
away.

As for 4.1, I think that's really very much in the deep freeze and
receiving essential bug/compatibility/security fixes only so I would
be inclined to punt on this patch.

I have another comment though:

  The program xen-tmem-list-parse parses the output of xm/xl tmem-list
  into human-readable format.  A missing NULL terminator sometimes
  causes garbage to be spewed where the two-letter pool type
  should be output.

Would it not be much better if  xl tmem-list  produced a sane format
to start with ?  I haven't seen what the old and new formats are like
but in general I think  xl foo-list  should produce information useful
to humans.

In xl for the future we should be providing json output for things
which need to be machine-readable.  This may need a transition plan of
course.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 12:11:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 12:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYbo0-0002eJ-KA; Wed, 14 Nov 2012 12:10:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYbnz-0002dz-9C
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 12:10:55 +0000
Received: from [85.158.143.99:32619] by server-3.bemta-4.messagelabs.com id
	E2/7E-06841-E4A83A05; Wed, 14 Nov 2012 12:10:54 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352895038!26520483!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6050 invoked from network); 14 Nov 2012 12:10:39 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 12:10:39 -0000
X-IronPort-AV: E=Sophos;i="4.83,250,1352073600"; d="scan'208";a="15800182"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 12:09:39 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 14 Nov 2012 12:09:38 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TYbml-0005SP-3I; Wed, 14 Nov 2012 12:09:39 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TYbmk-0001UA-Vz;
	Wed, 14 Nov 2012 12:09:38 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20643.35330.882722.297475@mariner.uk.xensource.com>
Date: Wed, 14 Nov 2012 12:09:38 +0000
To: Jan Beulich <JBeulich@suse.com>
In-Reply-To: <50A3850B02000078000A8730@nat28.tlf.novell.com>
References: <20642.37747.982297.553297@mariner.uk.xensource.com>
	<50A3850B02000078000A8730@nat28.tlf.novell.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] Tools backports to 4.1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Jan Beulich writes ("Re: Tools backports to 4.1"):
> >>> On 13.11.12 at 19:37, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> > I have backported a number of the tools fixes from 4.2 to 4.1.
> 
> Thanks a lot! I see this also included some qemu changes, so I
> imply that we're then all set for RC1 on both trees as soon as
> the patches for the security problems published yesterday went
> in (and got a push) - are you planning to do this, or should
> someone else (e.g. me) step in?

Yes, I think we can do RC1 as soon as we have 25922:8ca6372315f8.

When we get a test push which includes the QEMU_TAG I will tag the
qemu trees.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 12:11:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 12:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYbo0-0002eJ-KA; Wed, 14 Nov 2012 12:10:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYbnz-0002dz-9C
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 12:10:55 +0000
Received: from [85.158.143.99:32619] by server-3.bemta-4.messagelabs.com id
	E2/7E-06841-E4A83A05; Wed, 14 Nov 2012 12:10:54 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352895038!26520483!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6050 invoked from network); 14 Nov 2012 12:10:39 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 12:10:39 -0000
X-IronPort-AV: E=Sophos;i="4.83,250,1352073600"; d="scan'208";a="15800182"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 12:09:39 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 14 Nov 2012 12:09:38 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TYbml-0005SP-3I; Wed, 14 Nov 2012 12:09:39 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TYbmk-0001UA-Vz;
	Wed, 14 Nov 2012 12:09:38 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20643.35330.882722.297475@mariner.uk.xensource.com>
Date: Wed, 14 Nov 2012 12:09:38 +0000
To: Jan Beulich <JBeulich@suse.com>
In-Reply-To: <50A3850B02000078000A8730@nat28.tlf.novell.com>
References: <20642.37747.982297.553297@mariner.uk.xensource.com>
	<50A3850B02000078000A8730@nat28.tlf.novell.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] Tools backports to 4.1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Jan Beulich writes ("Re: Tools backports to 4.1"):
> >>> On 13.11.12 at 19:37, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> > I have backported a number of the tools fixes from 4.2 to 4.1.
> 
> Thanks a lot! I see this also included some qemu changes, so I
> imply that we're then all set for RC1 on both trees as soon as
> the patches for the security problems published yesterday went
> in (and got a push) - are you planning to do this, or should
> someone else (e.g. me) step in?

Yes, I think we can do RC1 as soon as we have 25922:8ca6372315f8.

When we get a test push which includes the QEMU_TAG I will tag the
qemu trees.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 12:35:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 12:35:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYcBV-0003NJ-Ql; Wed, 14 Nov 2012 12:35:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <khch82@naver.com>) id 1TYcBU-0003NE-Dt
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 12:35:12 +0000
Received: from [85.158.143.35:25224] by server-1.bemta-4.messagelabs.com id
	86/74-27934-FFF83A05; Wed, 14 Nov 2012 12:35:11 +0000
X-Env-Sender: khch82@naver.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1352896502!4806880!1
X-Originating-IP: [114.111.32.66]
X-SpamReason: No, hits=2.3 required=7.0 tests=HTML_30_40,
	HTML_IMAGE_ONLY_32,HTML_MESSAGE,SUBJECT_EXCESS_BASE64
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3262 invoked from network); 14 Nov 2012 12:35:04 -0000
Received: from tmailpost32-2.nm.naver.com (HELO tmailpost32-2.nm.naver.com)
	(114.111.32.66) by server-2.tower-21.messagelabs.com with SMTP;
	14 Nov 2012 12:35:04 -0000
Received: (qmail 18999 invoked from network); 14 Nov 2012 12:35:01 -0000
Received: from 61.247.195.142 (HELO tweb06.nm.nhnsystem.com) (61.247.195.142)
	by tmailpost32-2.nm.naver.com with SMTP; 14 Nov 2012 12:35:01 -0000
Date: Wed, 14 Nov 2012 21:35:00 +0900 (KST)
From: =?UTF-8?B?6rmA7Zqo7LKg?= <khch82@naver.com>
To: xen-devel@lists.xen.org
Message-ID: <e7a1cb6662aefdd2ecdf80ba7782d6@tweb06.nm.nhnsystem.com>
MIME-Version: 1.0
Importance: normal
X-Priority: 3 (Normal)
Subject: [Xen-devel] =?utf-8?q?libxl=3A_error=3A_libxl=5Fdm=2Ec=3A1212=3Ad?=
 =?utf-8?q?evice=5Fmodel=5Fspawn=5Foutcome=3A_domain_1_device_model=3A_spa?=
 =?utf-8?q?wn_failed_=28rc=3D-3?=
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: =?UTF-8?B?6rmA7Zqo7LKg?= <khch82@naver.com>
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1933137297807035317=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--===============1933137297807035317==
Content-Type: multipart/alternative; 
	boundary="----=_Part_597738_2112896404.1352896501087"


------=_Part_597738_2112896404.1352896501087
Content-Type: text/plain;
	charset=UTF-8
Content-Transfer-Encoding: base64

CkhlbGxvLAoKCkkndmUgdGVzdGVkIFhlbiA0LjIgb24gQ2VudE9TIDYuMyh4ODZfeDY0KQpNeSBn
b2FsIGlzIHRvIGNvbm5lY3QgdG8gV2luZG93cyBWTSBvbiBYZW4gNC4yIHVzaW5nIFNQSUNFIGNs
aWVudC4KCgpJbnN0YWxsYXRpb24gb2YgWGVuIDQuMiB3YXMgc3VjY2Vzc2Z1bC4gCkFsc28gY3Jl
YXRpbmcgV2luZG93cyBWTSB1c2luZyBxZW11LWRtIGFuZCBjb25uZWN0aW5nIHRvIGl0IHVzaW5n
IFZOQyBhcmUgT0suCkJ1dCBxZW11LWRtIGNhbid0IHN1cHBvcnQgU1BJQ0UsIHNvIEkgaW5zdGFs
bGVkIHVwc3RyZWFtIHFlbXUuIChodHRwOi8vd2lraS54ZW4ub3JnL3dpa2kvUUVNVV9VcHN0cmVh
bSkKSSBhbHNvIGluc3RhbGxlZCBzcGljZS1zZXJ2ZXIgYW5kIHNwaWNlLXByb3RvY29sIGFzIG5l
d2VzdCB2ZXJzaW9uLgpDb25maWd1cmF0aW9uIGFuZCBpbnN0YWxsYXRpb24gc2VlbXMgbGlrZSBz
dWNjZXNzZnVsLiBCdXQgbm90IHdvcmsgd2l0aCBlcnJvciBtZXNzYWdlIGFib3ZlLgoKCj09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09Cltyb290QGxvY2Fs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yc8
L3A+PHA+dm5jdW51c2VkPTE8L3A+PHA+dm5jbGlzdGVuPScwLjAuMC4wJzwvcD48cD52bmNkaXNw
bGF5PTM8L3A+PHA+PGJyPjwvcD48cD5zcGljZT0xPC9wPjxwPnNwaWNlaG9zdD0nMC4wLjAuMCc8
L3A+PHA+c3BpY2Vwb3J0PTYwMDA8L3A+PHA+c3BpY2VkaXNhYmxlX3RpY2tldGluZz0xPC9wPjxw
PnNwaWNlcGFzc3dkID0gJ3Bhc3N3b3JkJzwvcD48cD48YnI+PC9wPjxwPjxicj48L3A+PHA+VGhh
bmtzIGluIGFkdmFuY2UuPC9wPjxwPjxicj48L3A+PHA+RGFuaWVsLjwvcD48cD48L3A+PC9kaXY+
PHRhYmxlIHN0eWxlPSJkaXNwbGF5Om5vbmUiPjx0cj48dGQ+PGltZyBzcmM9Imh0dHA6Ly9tYWls
Lm5hdmVyLmNvbS9yZWFkUmVjZWlwdC9ub3RpZnkvP2ltZz1VJTJGS1phekNvMXpSb0s2dVhweG1z
TW9NckZvaUNwNnB2cEFpME1yMzRhQUlTTXhiWGFBaXZGdklkJTJCcmtTS0FNNVc0ZDVXNEM1Ylgw
cSUyQnprUjc0RlRXeCUyRnNEems1NzYzMCUyQjRrbnR6d0diWDNxN05DMFdTbFRiNGIlM0QuZ2lm
IiBib3JkZXI9IjAiPjwvdGQ+PC90cj48L3RhYmxlPiAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAg
------=_Part_597738_2112896404.1352896501087--


--===============1933137297807035317==
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.xen.org
http://lists.xen.org/xen-devel

--===============1933137297807035317==--


From xen-devel-bounces@lists.xen.org Wed Nov 14 12:35:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 12:35:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYcBV-0003NJ-Ql; Wed, 14 Nov 2012 12:35:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <khch82@naver.com>) id 1TYcBU-0003NE-Dt
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 12:35:12 +0000
Received: from [85.158.143.35:25224] by server-1.bemta-4.messagelabs.com id
	86/74-27934-FFF83A05; Wed, 14 Nov 2012 12:35:11 +0000
X-Env-Sender: khch82@naver.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1352896502!4806880!1
X-Originating-IP: [114.111.32.66]
X-SpamReason: No, hits=2.3 required=7.0 tests=HTML_30_40,
	HTML_IMAGE_ONLY_32,HTML_MESSAGE,SUBJECT_EXCESS_BASE64
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3262 invoked from network); 14 Nov 2012 12:35:04 -0000
Received: from tmailpost32-2.nm.naver.com (HELO tmailpost32-2.nm.naver.com)
	(114.111.32.66) by server-2.tower-21.messagelabs.com with SMTP;
	14 Nov 2012 12:35:04 -0000
Received: (qmail 18999 invoked from network); 14 Nov 2012 12:35:01 -0000
Received: from 61.247.195.142 (HELO tweb06.nm.nhnsystem.com) (61.247.195.142)
	by tmailpost32-2.nm.naver.com with SMTP; 14 Nov 2012 12:35:01 -0000
Date: Wed, 14 Nov 2012 21:35:00 +0900 (KST)
From: =?UTF-8?B?6rmA7Zqo7LKg?= <khch82@naver.com>
To: xen-devel@lists.xen.org
Message-ID: <e7a1cb6662aefdd2ecdf80ba7782d6@tweb06.nm.nhnsystem.com>
MIME-Version: 1.0
Importance: normal
X-Priority: 3 (Normal)
Subject: [Xen-devel] =?utf-8?q?libxl=3A_error=3A_libxl=5Fdm=2Ec=3A1212=3Ad?=
 =?utf-8?q?evice=5Fmodel=5Fspawn=5Foutcome=3A_domain_1_device_model=3A_spa?=
 =?utf-8?q?wn_failed_=28rc=3D-3?=
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: =?UTF-8?B?6rmA7Zqo7LKg?= <khch82@naver.com>
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1933137297807035317=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--===============1933137297807035317==
Content-Type: multipart/alternative; 
	boundary="----=_Part_597738_2112896404.1352896501087"


------=_Part_597738_2112896404.1352896501087
Content-Type: text/plain;
	charset=UTF-8
Content-Transfer-Encoding: base64

CkhlbGxvLAoKCkkndmUgdGVzdGVkIFhlbiA0LjIgb24gQ2VudE9TIDYuMyh4ODZfeDY0KQpNeSBn
b2FsIGlzIHRvIGNvbm5lY3QgdG8gV2luZG93cyBWTSBvbiBYZW4gNC4yIHVzaW5nIFNQSUNFIGNs
aWVudC4KCgpJbnN0YWxsYXRpb24gb2YgWGVuIDQuMiB3YXMgc3VjY2Vzc2Z1bC4gCkFsc28gY3Jl
YXRpbmcgV2luZG93cyBWTSB1c2luZyBxZW11LWRtIGFuZCBjb25uZWN0aW5nIHRvIGl0IHVzaW5n
IFZOQyBhcmUgT0suCkJ1dCBxZW11LWRtIGNhbid0IHN1cHBvcnQgU1BJQ0UsIHNvIEkgaW5zdGFs
bGVkIHVwc3RyZWFtIHFlbXUuIChodHRwOi8vd2lraS54ZW4ub3Jn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ib3JkZXI9IjAiPjwvdGQ+PC90cj48L3RhYmxlPiAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAg
------=_Part_597738_2112896404.1352896501087--


--===============1933137297807035317==
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.xen.org
http://lists.xen.org/xen-devel

--===============1933137297807035317==--


From xen-devel-bounces@lists.xen.org Wed Nov 14 12:39:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 12:39:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYcFW-0003Ui-Fy; Wed, 14 Nov 2012 12:39:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYcFV-0003Ub-6k
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 12:39:21 +0000
Received: from [85.158.138.51:61283] by server-10.bemta-3.messagelabs.com id
	F9/08-19806-8F093A05; Wed, 14 Nov 2012 12:39:20 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1352896759!29967439!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27215 invoked from network); 14 Nov 2012 12:39:19 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-174.messagelabs.com with SMTP;
	14 Nov 2012 12:39:19 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 14 Nov 2012 12:39:34 +0000
Message-Id: <50A39F0502000078000A8770@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 14 Nov 2012 12:39:17 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Jackson" <Ian.Jackson@eu.citrix.com>
References: <20642.37747.982297.553297@mariner.uk.xensource.com>
	<50A3850B02000078000A8730@nat28.tlf.novell.com>
	<20643.35330.882722.297475@mariner.uk.xensource.com>
In-Reply-To: <20643.35330.882722.297475@mariner.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] Tools backports to 4.1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 14.11.12 at 13:09, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> Jan Beulich writes ("Re: Tools backports to 4.1"):
>> >>> On 13.11.12 at 19:37, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
>> > I have backported a number of the tools fixes from 4.2 to 4.1.
>> 
>> Thanks a lot! I see this also included some qemu changes, so I
>> imply that we're then all set for RC1 on both trees as soon as
>> the patches for the security problems published yesterday went
>> in (and got a push) - are you planning to do this, or should
>> someone else (e.g. me) step in?
> 
> Yes, I think we can do RC1 as soon as we have 25922:8ca6372315f8.
> 
> When we get a test push which includes the QEMU_TAG I will tag the
> qemu trees.

Didn't that happen already? Or do you mean a push on the qemu
tree?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 12:39:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 12:39:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYcFW-0003Ui-Fy; Wed, 14 Nov 2012 12:39:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYcFV-0003Ub-6k
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 12:39:21 +0000
Received: from [85.158.138.51:61283] by server-10.bemta-3.messagelabs.com id
	F9/08-19806-8F093A05; Wed, 14 Nov 2012 12:39:20 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1352896759!29967439!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27215 invoked from network); 14 Nov 2012 12:39:19 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-174.messagelabs.com with SMTP;
	14 Nov 2012 12:39:19 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 14 Nov 2012 12:39:34 +0000
Message-Id: <50A39F0502000078000A8770@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 14 Nov 2012 12:39:17 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Jackson" <Ian.Jackson@eu.citrix.com>
References: <20642.37747.982297.553297@mariner.uk.xensource.com>
	<50A3850B02000078000A8730@nat28.tlf.novell.com>
	<20643.35330.882722.297475@mariner.uk.xensource.com>
In-Reply-To: <20643.35330.882722.297475@mariner.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] Tools backports to 4.1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 14.11.12 at 13:09, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> Jan Beulich writes ("Re: Tools backports to 4.1"):
>> >>> On 13.11.12 at 19:37, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
>> > I have backported a number of the tools fixes from 4.2 to 4.1.
>> 
>> Thanks a lot! I see this also included some qemu changes, so I
>> imply that we're then all set for RC1 on both trees as soon as
>> the patches for the security problems published yesterday went
>> in (and got a push) - are you planning to do this, or should
>> someone else (e.g. me) step in?
> 
> Yes, I think we can do RC1 as soon as we have 25922:8ca6372315f8.
> 
> When we get a test push which includes the QEMU_TAG I will tag the
> qemu trees.

Didn't that happen already? Or do you mean a push on the qemu
tree?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 12:57:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 12:57:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYcWz-00047I-UE; Wed, 14 Nov 2012 12:57:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYcWy-000479-Rg
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 12:57:25 +0000
Received: from [85.158.139.211:17702] by server-8.bemta-5.messagelabs.com id
	25/BE-06050-33593A05; Wed, 14 Nov 2012 12:57:23 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1352897843!20084965!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4152 invoked from network); 14 Nov 2012 12:57:23 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 12:57:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,250,1352073600"; d="scan'208";a="15801259"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 12:56:54 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 14 Nov 2012 12:56:53 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TYcWT-0005jR-Oj; Wed, 14 Nov 2012 12:56:53 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TYcWT-0001Xo-KV;
	Wed, 14 Nov 2012 12:56:53 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20643.38165.530746.42005@mariner.uk.xensource.com>
Date: Wed, 14 Nov 2012 12:56:53 +0000
To: Jan Beulich <JBeulich@suse.com>
In-Reply-To: <50A39F0502000078000A8770@nat28.tlf.novell.com>
References: <20642.37747.982297.553297@mariner.uk.xensource.com>
	<50A3850B02000078000A8730@nat28.tlf.novell.com>
	<20643.35330.882722.297475@mariner.uk.xensource.com>
	<50A39F0502000078000A8770@nat28.tlf.novell.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] Tools backports to 4.1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Jan Beulich writes ("Re: Tools backports to 4.1"):
> On 14.11.12 at 13:09, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> > When we get a test push which includes the QEMU_TAG I will tag the
> > qemu trees.
> 
> Didn't that happen already? Or do you mean a push on the qemu
> tree?

I've just double-checked and you're right.  I thought we were waiting
for 4.2 but there have been no backported commits to
qemu-xen-4.2-testing.git since 4.2.0.

I will tag the qemu trees and get back to you.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 12:57:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 12:57:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYcWz-00047I-UE; Wed, 14 Nov 2012 12:57:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYcWy-000479-Rg
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 12:57:25 +0000
Received: from [85.158.139.211:17702] by server-8.bemta-5.messagelabs.com id
	25/BE-06050-33593A05; Wed, 14 Nov 2012 12:57:23 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1352897843!20084965!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4152 invoked from network); 14 Nov 2012 12:57:23 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 12:57:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,250,1352073600"; d="scan'208";a="15801259"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 12:56:54 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 14 Nov 2012 12:56:53 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TYcWT-0005jR-Oj; Wed, 14 Nov 2012 12:56:53 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TYcWT-0001Xo-KV;
	Wed, 14 Nov 2012 12:56:53 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20643.38165.530746.42005@mariner.uk.xensource.com>
Date: Wed, 14 Nov 2012 12:56:53 +0000
To: Jan Beulich <JBeulich@suse.com>
In-Reply-To: <50A39F0502000078000A8770@nat28.tlf.novell.com>
References: <20642.37747.982297.553297@mariner.uk.xensource.com>
	<50A3850B02000078000A8730@nat28.tlf.novell.com>
	<20643.35330.882722.297475@mariner.uk.xensource.com>
	<50A39F0502000078000A8770@nat28.tlf.novell.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] Tools backports to 4.1
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Jan Beulich writes ("Re: Tools backports to 4.1"):
> On 14.11.12 at 13:09, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> > When we get a test push which includes the QEMU_TAG I will tag the
> > qemu trees.
> 
> Didn't that happen already? Or do you mean a push on the qemu
> tree?

I've just double-checked and you're right.  I thought we were waiting
for 4.2 but there have been no backported commits to
qemu-xen-4.2-testing.git since 4.2.0.

I will tag the qemu trees and get back to you.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 13:09:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 13:09:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYci7-0004ej-8C; Wed, 14 Nov 2012 13:08:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TYci5-0004eW-P8
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 13:08:54 +0000
Received: from [85.158.143.99:41140] by server-2.bemta-4.messagelabs.com id
	AD/44-28922-5E793A05; Wed, 14 Nov 2012 13:08:53 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352898531!26529819!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODYyNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6075 invoked from network); 14 Nov 2012 13:08:52 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 13:08:52 -0000
X-IronPort-AV: E=Sophos;i="4.83,250,1352073600"; d="scan'208";a="214461547"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	14 Nov 2012 13:08:50 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL03.citrite.net
	(10.13.107.80) with Microsoft SMTP Server id 14.2.318.1;
	Wed, 14 Nov 2012 08:08:50 -0500
Message-ID: <50A397E1.7000602@citrix.com>
Date: Wed, 14 Nov 2012 13:08:49 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Mats Petersson <mats.petersson@citrix.com>
References: <50A37CC7.8050700@citrix.com>
In-Reply-To: <50A37CC7.8050700@citrix.com>
X-Originating-IP: [10.80.2.76]
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH] Improve speed of mapping guest memory
 into	Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Mats,

Your patch has been white-space damaged and will not apply.  You should
use git send-email which will do the right thing.  I've also CC'd Konrad
who is the maintainer for the Xen parts of the kernel.

On 14/11/12 11:13, Mats Petersson wrote:
> [a long, rambling commit message?]

The text as-is isn't really suitable for a commit message (too much
irrelevant stuff) and there is no suitable subject line.

> I have also found that the munmap() call used to unmap the guest memory
> from Dom0 is about 35% slower in 3.7 kernel than in the 2.6 kernel (3.8M
> cycles vs 2.8M cycles).

This performance reduction only occurs with 32-bit guests is the Xen
then traps-and-emulates both halves of the PTE write.

> I think this could be made quicker by using a
> direct write of zero rather than the compare exchange operation that is
> currently used [which traps into Xen, performs the compare & exchange] -

This is something I noticed but never got around to producing a patch.
How about this (uncomplied!) patch?

-- a/mm/memory.c
+++ b/mm/memory.c
@@ -1146,8 +1146,16 @@ again:
 				     page->index > details->last_index))
 					continue;
 			}
-			ptent = ptep_get_and_clear_full(mm, addr, pte,
-							tlb->fullmm);
+			/*
+			 * No need for the expensive atomic get and
+			 * clear for anonymous mappings as the dirty
+			 * and young bits are not used.
+			 */
+			if (PageAnon(page))
+				pte_clear(mm, addr, pte);
+			else
+				ptent = ptep_get_and_clear_full(mm, addr, pte,
+								tlb->fullmm);
 			tlb_remove_tlb_entry(tlb, pte, addr);
 			if (unlikely(!page))
 				continue;


Now for the patch itself.  On the whole, the approach looks good and the
real-word performance improvements are nice.  Specific comments inline.

> --- a/arch/x86/xen/mmu.c
> +++ b/arch/x86/xen/mmu.c
> @@ -2542,3 +2561,77 @@ out:
>      return err;
>  }
>  EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range);
> +
> +/* like xen_remap_domain_mfn_range, but does a list of mfn's, rather
> + * than the, for xen, quite useless, consecutive pages.
> + */

/*
 * Like xen_remap_domain_mfn_range(), but more efficiently handles MFNs
 * that are not contiguous (which is common for a domain's memory).
 */

> +int xen_remap_domain_mfn_list(struct vm_area_struct *vma,
> +                  unsigned long addr,
> +                  unsigned long *mfn, int nr,
> +                  int *err_ptr,
> +                  pgprot_t prot, unsigned domid)

xen_remap_domain_mfn_array() ?  It's not taking a list.

> +{
> +    struct remap_list_data rmd;
> +    struct mmu_update mmu_update[REMAP_BATCH_SIZE];

This is surprisingly large (256 bytes) but I note that the existing
xen_remap_domain_mfn_range() does the same thing so I guess it's ok.

> +    int batch;
> +    int done;
> +    unsigned long range;
> +    int err = 0;
> +
> +    if (xen_feature(XENFEAT_auto_translated_physmap))
> +        return -EINVAL;
> +
> +    prot = __pgprot(pgprot_val(prot) | _PAGE_IOMAP);
> +
> +    BUG_ON(!((vma->vm_flags & (VM_PFNMAP | VM_IO)) == (VM_PFNMAP |
> VM_IO)));
> +
> +    rmd.mfn = mfn;
> +    rmd.prot = prot;
> +
> +    while (nr) {
> +        batch = min(REMAP_BATCH_SIZE, nr);
> +        range = (unsigned long)batch << PAGE_SHIFT;
> +
> +        rmd.mmu_update = mmu_update;
> +        err = apply_to_page_range(vma->vm_mm, addr, range,
> +                      remap_area_mfn_list_pte_fn, &rmd);
> +        if (err)
> +        {
> +            printk("xen_remap_domain_mfn_list: apply_to_range:
> err=%d\n", err);

Stray printk?

> +            goto out;
> +        }
> +
> +        err = HYPERVISOR_mmu_update(mmu_update, batch, &done, domid);
> +        if (err < 0)
> +        {
> +            int i;
> +            /* TODO: We should remove this printk later */
> +            printk("xen_remap_domain_mfn_list: mmu_update: err=%d,
> done=%d, batch=%d\n", err, done, batch);

Yes, you should...

> +            err_ptr[done] = err;
> +
> +            /* now do the remaining part of this batch */
> +            for(i = done+1; i < batch; i++)
> +            {
> +                int tmp_err = HYPERVISOR_mmu_update(&mmu_update[i], 1,
> NULL, domid);
> +                if (tmp_err < 0)
> +                {
> +                    err_ptr[i] = tmp_err;
> +                }
> +            }

There's no need to fall back to doing it page-by-page here. You can
still batch the remainder.

> +
> +            goto out;
> +        }
> +
> +        nr -= batch;
> +        addr += range;
> +        err_ptr += batch;
> +    }
> +
> +    err = 0;
> +out:
> +
> +    xen_flush_tlb_all();

Probably not that important anymore since we would now do far fewer TLB
flushes, but this TLB flush is only needed by the PTEs being updated
were already present -- if they're all clear then TLB flush can be
omitted entirely.

> +
> +    return err;
> +}
> +EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_list);
> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
> index 8adb9cc..b39a7b7 100644
> --- a/drivers/xen/privcmd.c
> +++ b/drivers/xen/privcmd.c
> @@ -151,6 +151,41 @@ static int traverse_pages(unsigned nelem, size_t size,
>      return ret;
>  }
> 
> +/*
> + * Similar to traverse_pages, but use each page as a "block" of
> + * data to be processed as one unit.
> + */
> +static int traverse_pages_block(unsigned nelem, size_t size,
> +                struct list_head *pos,
> +                int (*fn)(void *data, int nr, void *state),
> +                void *state)
> +{
> +    void *pagedata;
> +    unsigned pageidx;
> +    int ret = 0;
> +
> +    BUG_ON(size > PAGE_SIZE);
> +
> +    pageidx = PAGE_SIZE;
> +    pagedata = NULL;    /* hush, gcc */

What was gcc upset about?  I don't see anything it could get confused about.

> @@ -260,17 +295,17 @@ struct mmap_batch_state {
>      xen_pfn_t __user *user_mfn;
>  };
> 
> -static int mmap_batch_fn(void *data, void *state)
> +static int mmap_batch_fn(void *data, int nr, void *state)
>  {
>      xen_pfn_t *mfnp = data;
> +
>      struct mmap_batch_state *st = state;
>      int ret;
> 
> -    ret = xen_remap_domain_mfn_range(st->vma, st->va & PAGE_MASK,
> *mfnp, 1,
> -                     st->vma->vm_page_prot, st->domain);
> +    BUG_ON(nr < 0);

Is this BUG_ON() useful?

David

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 13:09:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 13:09:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYci7-0004ej-8C; Wed, 14 Nov 2012 13:08:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TYci5-0004eW-P8
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 13:08:54 +0000
Received: from [85.158.143.99:41140] by server-2.bemta-4.messagelabs.com id
	AD/44-28922-5E793A05; Wed, 14 Nov 2012 13:08:53 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352898531!26529819!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODYyNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6075 invoked from network); 14 Nov 2012 13:08:52 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 13:08:52 -0000
X-IronPort-AV: E=Sophos;i="4.83,250,1352073600"; d="scan'208";a="214461547"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	14 Nov 2012 13:08:50 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL03.citrite.net
	(10.13.107.80) with Microsoft SMTP Server id 14.2.318.1;
	Wed, 14 Nov 2012 08:08:50 -0500
Message-ID: <50A397E1.7000602@citrix.com>
Date: Wed, 14 Nov 2012 13:08:49 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Mats Petersson <mats.petersson@citrix.com>
References: <50A37CC7.8050700@citrix.com>
In-Reply-To: <50A37CC7.8050700@citrix.com>
X-Originating-IP: [10.80.2.76]
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH] Improve speed of mapping guest memory
 into	Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Mats,

Your patch has been white-space damaged and will not apply.  You should
use git send-email which will do the right thing.  I've also CC'd Konrad
who is the maintainer for the Xen parts of the kernel.

On 14/11/12 11:13, Mats Petersson wrote:
> [a long, rambling commit message?]

The text as-is isn't really suitable for a commit message (too much
irrelevant stuff) and there is no suitable subject line.

> I have also found that the munmap() call used to unmap the guest memory
> from Dom0 is about 35% slower in 3.7 kernel than in the 2.6 kernel (3.8M
> cycles vs 2.8M cycles).

This performance reduction only occurs with 32-bit guests is the Xen
then traps-and-emulates both halves of the PTE write.

> I think this could be made quicker by using a
> direct write of zero rather than the compare exchange operation that is
> currently used [which traps into Xen, performs the compare & exchange] -

This is something I noticed but never got around to producing a patch.
How about this (uncomplied!) patch?

-- a/mm/memory.c
+++ b/mm/memory.c
@@ -1146,8 +1146,16 @@ again:
 				     page->index > details->last_index))
 					continue;
 			}
-			ptent = ptep_get_and_clear_full(mm, addr, pte,
-							tlb->fullmm);
+			/*
+			 * No need for the expensive atomic get and
+			 * clear for anonymous mappings as the dirty
+			 * and young bits are not used.
+			 */
+			if (PageAnon(page))
+				pte_clear(mm, addr, pte);
+			else
+				ptent = ptep_get_and_clear_full(mm, addr, pte,
+								tlb->fullmm);
 			tlb_remove_tlb_entry(tlb, pte, addr);
 			if (unlikely(!page))
 				continue;


Now for the patch itself.  On the whole, the approach looks good and the
real-word performance improvements are nice.  Specific comments inline.

> --- a/arch/x86/xen/mmu.c
> +++ b/arch/x86/xen/mmu.c
> @@ -2542,3 +2561,77 @@ out:
>      return err;
>  }
>  EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range);
> +
> +/* like xen_remap_domain_mfn_range, but does a list of mfn's, rather
> + * than the, for xen, quite useless, consecutive pages.
> + */

/*
 * Like xen_remap_domain_mfn_range(), but more efficiently handles MFNs
 * that are not contiguous (which is common for a domain's memory).
 */

> +int xen_remap_domain_mfn_list(struct vm_area_struct *vma,
> +                  unsigned long addr,
> +                  unsigned long *mfn, int nr,
> +                  int *err_ptr,
> +                  pgprot_t prot, unsigned domid)

xen_remap_domain_mfn_array() ?  It's not taking a list.

> +{
> +    struct remap_list_data rmd;
> +    struct mmu_update mmu_update[REMAP_BATCH_SIZE];

This is surprisingly large (256 bytes) but I note that the existing
xen_remap_domain_mfn_range() does the same thing so I guess it's ok.

> +    int batch;
> +    int done;
> +    unsigned long range;
> +    int err = 0;
> +
> +    if (xen_feature(XENFEAT_auto_translated_physmap))
> +        return -EINVAL;
> +
> +    prot = __pgprot(pgprot_val(prot) | _PAGE_IOMAP);
> +
> +    BUG_ON(!((vma->vm_flags & (VM_PFNMAP | VM_IO)) == (VM_PFNMAP |
> VM_IO)));
> +
> +    rmd.mfn = mfn;
> +    rmd.prot = prot;
> +
> +    while (nr) {
> +        batch = min(REMAP_BATCH_SIZE, nr);
> +        range = (unsigned long)batch << PAGE_SHIFT;
> +
> +        rmd.mmu_update = mmu_update;
> +        err = apply_to_page_range(vma->vm_mm, addr, range,
> +                      remap_area_mfn_list_pte_fn, &rmd);
> +        if (err)
> +        {
> +            printk("xen_remap_domain_mfn_list: apply_to_range:
> err=%d\n", err);

Stray printk?

> +            goto out;
> +        }
> +
> +        err = HYPERVISOR_mmu_update(mmu_update, batch, &done, domid);
> +        if (err < 0)
> +        {
> +            int i;
> +            /* TODO: We should remove this printk later */
> +            printk("xen_remap_domain_mfn_list: mmu_update: err=%d,
> done=%d, batch=%d\n", err, done, batch);

Yes, you should...

> +            err_ptr[done] = err;
> +
> +            /* now do the remaining part of this batch */
> +            for(i = done+1; i < batch; i++)
> +            {
> +                int tmp_err = HYPERVISOR_mmu_update(&mmu_update[i], 1,
> NULL, domid);
> +                if (tmp_err < 0)
> +                {
> +                    err_ptr[i] = tmp_err;
> +                }
> +            }

There's no need to fall back to doing it page-by-page here. You can
still batch the remainder.

> +
> +            goto out;
> +        }
> +
> +        nr -= batch;
> +        addr += range;
> +        err_ptr += batch;
> +    }
> +
> +    err = 0;
> +out:
> +
> +    xen_flush_tlb_all();

Probably not that important anymore since we would now do far fewer TLB
flushes, but this TLB flush is only needed by the PTEs being updated
were already present -- if they're all clear then TLB flush can be
omitted entirely.

> +
> +    return err;
> +}
> +EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_list);
> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
> index 8adb9cc..b39a7b7 100644
> --- a/drivers/xen/privcmd.c
> +++ b/drivers/xen/privcmd.c
> @@ -151,6 +151,41 @@ static int traverse_pages(unsigned nelem, size_t size,
>      return ret;
>  }
> 
> +/*
> + * Similar to traverse_pages, but use each page as a "block" of
> + * data to be processed as one unit.
> + */
> +static int traverse_pages_block(unsigned nelem, size_t size,
> +                struct list_head *pos,
> +                int (*fn)(void *data, int nr, void *state),
> +                void *state)
> +{
> +    void *pagedata;
> +    unsigned pageidx;
> +    int ret = 0;
> +
> +    BUG_ON(size > PAGE_SIZE);
> +
> +    pageidx = PAGE_SIZE;
> +    pagedata = NULL;    /* hush, gcc */

What was gcc upset about?  I don't see anything it could get confused about.

> @@ -260,17 +295,17 @@ struct mmap_batch_state {
>      xen_pfn_t __user *user_mfn;
>  };
> 
> -static int mmap_batch_fn(void *data, void *state)
> +static int mmap_batch_fn(void *data, int nr, void *state)
>  {
>      xen_pfn_t *mfnp = data;
> +
>      struct mmap_batch_state *st = state;
>      int ret;
> 
> -    ret = xen_remap_domain_mfn_range(st->vma, st->va & PAGE_MASK,
> *mfnp, 1,
> -                     st->vma->vm_page_prot, st->domain);
> +    BUG_ON(nr < 0);

Is this BUG_ON() useful?

David

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 13:16:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 13:16:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYcpf-0005XW-Al; Wed, 14 Nov 2012 13:16:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYcpe-0005XQ-BW
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 13:16:42 +0000
Received: from [85.158.143.99:22277] by server-3.bemta-4.messagelabs.com id
	F3/B8-06841-9B993A05; Wed, 14 Nov 2012 13:16:41 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1352899000!23497804!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1216 invoked from network); 14 Nov 2012 13:16:41 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-10.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 13:16:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,250,1352073600"; d="scan'208";a="15801831"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 13:16:40 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 14 Nov 2012 13:16:39 +0000
Message-ID: <1352898998.3499.17.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: David Vrabel <david.vrabel@citrix.com>
Date: Wed, 14 Nov 2012 13:16:38 +0000
In-Reply-To: <50A397E1.7000602@citrix.com>
References: <50A37CC7.8050700@citrix.com> <50A397E1.7000602@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Mats Petersson <mats.petersson@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH] Improve speed of mapping guest memory
 into	Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-14 at 13:08 +0000, David Vrabel wrote:
> > +
> > +/* like xen_remap_domain_mfn_range, but does a list of mfn's,
> rather
> > + * than the, for xen, quite useless, consecutive pages.
> > + */
> 
> /*
>  * Like xen_remap_domain_mfn_range(), but more efficiently handles
> MFNs
>  * that are not contiguous (which is common for a domain's memory).
>  */ 

Can we not fix xen_remap_domain_mfn (and modify the small number of
callers to suit) rather than duplicating most of the functionality with
a slight difference?

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 13:16:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 13:16:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYcpf-0005XW-Al; Wed, 14 Nov 2012 13:16:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYcpe-0005XQ-BW
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 13:16:42 +0000
Received: from [85.158.143.99:22277] by server-3.bemta-4.messagelabs.com id
	F3/B8-06841-9B993A05; Wed, 14 Nov 2012 13:16:41 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1352899000!23497804!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1216 invoked from network); 14 Nov 2012 13:16:41 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-10.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 13:16:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,250,1352073600"; d="scan'208";a="15801831"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 13:16:40 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 14 Nov 2012 13:16:39 +0000
Message-ID: <1352898998.3499.17.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: David Vrabel <david.vrabel@citrix.com>
Date: Wed, 14 Nov 2012 13:16:38 +0000
In-Reply-To: <50A397E1.7000602@citrix.com>
References: <50A37CC7.8050700@citrix.com> <50A397E1.7000602@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Mats Petersson <mats.petersson@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH] Improve speed of mapping guest memory
 into	Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-14 at 13:08 +0000, David Vrabel wrote:
> > +
> > +/* like xen_remap_domain_mfn_range, but does a list of mfn's,
> rather
> > + * than the, for xen, quite useless, consecutive pages.
> > + */
> 
> /*
>  * Like xen_remap_domain_mfn_range(), but more efficiently handles
> MFNs
>  * that are not contiguous (which is common for a domain's memory).
>  */ 

Can we not fix xen_remap_domain_mfn (and modify the small number of
callers to suit) rather than duplicating most of the functionality with
a slight difference?

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 13:40:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 13:40:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYdCV-0006E4-D6; Wed, 14 Nov 2012 13:40:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYdCU-0006Dz-4J
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 13:40:18 +0000
Received: from [85.158.138.51:18973] by server-7.bemta-3.messagelabs.com id
	B5/F4-01713-14F93A05; Wed, 14 Nov 2012 13:40:17 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1352900414!29991129!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15930 invoked from network); 14 Nov 2012 13:40:14 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-174.messagelabs.com with SMTP;
	14 Nov 2012 13:40:14 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 14 Nov 2012 13:42:37 +0000
Message-Id: <50A3AD4E02000078000A87BD@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 14 Nov 2012 13:40:14 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>,
	"Yang Z Zhang" <yang.z.zhang@intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
	<50A2755402000078000A837D@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 14.11.12 at 01:37, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
>> >> c) we could provide a command line option to allow fake devices to
>> >>     be create
>> >
>> > Agree, this maybe a feasible solution I can figure out, so far.
>> >
>> >> d) we could create context entries for all BDFs, whether or not a
>> >>     device exists there
>> >
>> > As I said,  this maybe bring security issue. Even for the
>> > iommu-passthrough option,  it is also not suggested to be used if security 
> is
>> considered.
>> 
>> As said - it is clear that the basic thing here (using
>> "iommu=dom0-passthrough") is already weakening security. So security isn't
>> the concern in this discussion, that's left to whoever is intending to use 
> that
>> option.
> 
> Okay,  I vote your option C if don't care security. 

Which, if I'm not mistaken, could be implemented entirely
independent of "iommu=dom0-passthrough". I'll see if that
helps on the offending system.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 13:40:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 13:40:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYdCV-0006E4-D6; Wed, 14 Nov 2012 13:40:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYdCU-0006Dz-4J
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 13:40:18 +0000
Received: from [85.158.138.51:18973] by server-7.bemta-3.messagelabs.com id
	B5/F4-01713-14F93A05; Wed, 14 Nov 2012 13:40:17 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1352900414!29991129!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15930 invoked from network); 14 Nov 2012 13:40:14 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-174.messagelabs.com with SMTP;
	14 Nov 2012 13:40:14 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 14 Nov 2012 13:42:37 +0000
Message-Id: <50A3AD4E02000078000A87BD@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Wed, 14 Nov 2012 13:40:14 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>,
	"Yang Z Zhang" <yang.z.zhang@intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
	<50A2755402000078000A837D@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 14.11.12 at 01:37, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
>> >> c) we could provide a command line option to allow fake devices to
>> >>     be create
>> >
>> > Agree, this maybe a feasible solution I can figure out, so far.
>> >
>> >> d) we could create context entries for all BDFs, whether or not a
>> >>     device exists there
>> >
>> > As I said,  this maybe bring security issue. Even for the
>> > iommu-passthrough option,  it is also not suggested to be used if security 
> is
>> considered.
>> 
>> As said - it is clear that the basic thing here (using
>> "iommu=dom0-passthrough") is already weakening security. So security isn't
>> the concern in this discussion, that's left to whoever is intending to use 
> that
>> option.
> 
> Okay,  I vote your option C if don't care security. 

Which, if I'm not mistaken, could be implemented entirely
independent of "iommu=dom0-passthrough". I'll see if that
helps on the offending system.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 14:05:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 14:05:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYdaX-0006wi-Jm; Wed, 14 Nov 2012 14:05:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TYdaW-0006vz-4j
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 14:05:08 +0000
Received: from [85.158.139.211:14487] by server-4.bemta-5.messagelabs.com id
	1C/C1-15011-315A3A05; Wed, 14 Nov 2012 14:05:07 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1352901904!18143750!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODYyNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4941 invoked from network); 14 Nov 2012 14:05:06 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 14:05:06 -0000
X-IronPort-AV: E=Sophos;i="4.83,250,1352073600"; d="scan'208";a="214468479"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	14 Nov 2012 14:04:46 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.318.1;
	Wed, 14 Nov 2012 09:04:45 -0500
Message-ID: <50A3A4FC.8040408@citrix.com>
Date: Wed, 14 Nov 2012 14:04:44 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: David Vrabel <david.vrabel@citrix.com>
References: <50A37CC7.8050700@citrix.com> <50A397E1.7000602@citrix.com>
In-Reply-To: <50A397E1.7000602@citrix.com>
X-Originating-IP: [10.80.3.146]
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [RFC/PATCH] Improve speed of mapping guest memory
 into	Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 14/11/12 13:08, David Vrabel wrote:
> Mats,
>
> Your patch has been white-space damaged and will not apply.  You should
> use git send-email which will do the right thing.  I've also CC'd Konrad
> who is the maintainer for the Xen parts of the kernel.
Thanks for the advice. Will use git send-email for V2 of this patch.
> On 14/11/12 11:13, Mats Petersson wrote:
>> [a long, rambling commit message?]
> The text as-is isn't really suitable for a commit message (too much
> irrelevant stuff) and there is no suitable subject line.
>
>> I have also found that the munmap() call used to unmap the guest memory
>> from Dom0 is about 35% slower in 3.7 kernel than in the 2.6 kernel (3.8M
>> cycles vs 2.8M cycles).
> This performance reduction only occurs with 32-bit guests is the Xen
> then traps-and-emulates both halves of the PTE write.
>
>> I think this could be made quicker by using a
>> direct write of zero rather than the compare exchange operation that is
>> currently used [which traps into Xen, performs the compare & exchange] -
> This is something I noticed but never got around to producing a patch.
> How about this (uncomplied!) patch?
>
> -- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1146,8 +1146,16 @@ again:
>   				     page->index > details->last_index))
>   					continue;
>   			}
> -			ptent = ptep_get_and_clear_full(mm, addr, pte,
> -							tlb->fullmm);
> +			/*
> +			 * No need for the expensive atomic get and
> +			 * clear for anonymous mappings as the dirty
> +			 * and young bits are not used.
> +			 */
> +			if (PageAnon(page))
> +				pte_clear(mm, addr, pte);
> +			else
> +				ptent = ptep_get_and_clear_full(mm, addr, pte,
> +								tlb->fullmm);
>   			tlb_remove_tlb_entry(tlb, pte, addr);
>   			if (unlikely(!page))
>   				continue;
I came up with something very similar, however found that page is 
sometimes NULL which causes problems. if (page && PageAnon(page)) will 
probably work... Trying that now.

> Now for the patch itself.  On the whole, the approach looks good and the
> real-word performance improvements are nice.  Specific comments inline.
>
>> --- a/arch/x86/xen/mmu.c
>> +++ b/arch/x86/xen/mmu.c
>> @@ -2542,3 +2561,77 @@ out:
>>       return err;
>>   }
>>   EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range);
>> +
>> +/* like xen_remap_domain_mfn_range, but does a list of mfn's, rather
>> + * than the, for xen, quite useless, consecutive pages.
>> + */
> /*
>   * Like xen_remap_domain_mfn_range(), but more efficiently handles MFNs
>   * that are not contiguous (which is common for a domain's memory).
>   */
Will update.
>> +int xen_remap_domain_mfn_list(struct vm_area_struct *vma,
>> +                  unsigned long addr,
>> +                  unsigned long *mfn, int nr,
>> +                  int *err_ptr,
>> +                  pgprot_t prot, unsigned domid)
> xen_remap_domain_mfn_array() ?  It's not taking a list.
Yes, better name. Although, perhaps following Ian Campbell's suggestion 
and changing the xen_remain_domain_mfn_range to "do the right thing" is 
even better. I will have a quick look at how difficult that may be - I 
feel it may be rather simpler than I first thought, as there is only one 
call to this function in privcmd.c.

The arm/xen/enlighten.c will probably also need fixing, I suppose...

>> +{
>> +    struct remap_list_data rmd;
>> +    struct mmu_update mmu_update[REMAP_BATCH_SIZE];
> This is surprisingly large (256 bytes) but I note that the existing
> xen_remap_domain_mfn_range() does the same thing so I guess it's ok.
I would actually like to increase it, but that would probably require 
allocation. One HV call per 32
>> +    int batch;
>> +    int done;
>> +    unsigned long range;
>> +    int err = 0;
>> +
>> +    if (xen_feature(XENFEAT_auto_translated_physmap))
>> +        return -EINVAL;
>> +
>> +    prot = __pgprot(pgprot_val(prot) | _PAGE_IOMAP);
>> +
>> +    BUG_ON(!((vma->vm_flags & (VM_PFNMAP | VM_IO)) == (VM_PFNMAP |
>> VM_IO)));
>> +
>> +    rmd.mfn = mfn;
>> +    rmd.prot = prot;
>> +
>> +    while (nr) {
>> +        batch = min(REMAP_BATCH_SIZE, nr);
>> +        range = (unsigned long)batch << PAGE_SHIFT;
>> +
>> +        rmd.mmu_update = mmu_update;
>> +        err = apply_to_page_range(vma->vm_mm, addr, range,
>> +                      remap_area_mfn_list_pte_fn, &rmd);
>> +        if (err)
>> +        {
>> +            printk("xen_remap_domain_mfn_list: apply_to_range:
>> err=%d\n", err);
> Stray printk?
Yes.
>> +            goto out;
>> +        }
>> +
>> +        err = HYPERVISOR_mmu_update(mmu_update, batch, &done, domid);
>> +        if (err < 0)
>> +        {
>> +            int i;
>> +            /* TODO: We should remove this printk later */
>> +            printk("xen_remap_domain_mfn_list: mmu_update: err=%d,
>> done=%d, batch=%d\n", err, done, batch);
> Yes, you should...
>
>> +            err_ptr[done] = err;
>> +
>> +            /* now do the remaining part of this batch */
>> +            for(i = done+1; i < batch; i++)
>> +            {
>> +                int tmp_err = HYPERVISOR_mmu_update(&mmu_update[i], 1,
>> NULL, domid);
>> +                if (tmp_err < 0)
>> +                {
>> +                    err_ptr[i] = tmp_err;
>> +                }
>> +            }
> There's no need to fall back to doing it page-by-page here. You can
> still batch the remainder.
Yes, I agree.
>> +
>> +            goto out;
>> +        }
>> +
>> +        nr -= batch;
>> +        addr += range;
>> +        err_ptr += batch;
>> +    }
>> +
>> +    err = 0;
>> +out:
>> +
>> +    xen_flush_tlb_all();
> Probably not that important anymore since we would now do far fewer TLB
> flushes, but this TLB flush is only needed by the PTEs being updated
> were already present -- if they're all clear then TLB flush can be
> omitted entirely.
The 2.6 kernel actually had a check BUG_ON(!pte_none(pte)) [or something 
like that], but the 3.x kernel seems to have "lost" that. Either way, 
once per, say, 1024 pages isn't measurable in my benchmarks.
>
>> +
>> +    return err;
>> +}
>> +EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_list);
>> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
>> index 8adb9cc..b39a7b7 100644
>> --- a/drivers/xen/privcmd.c
>> +++ b/drivers/xen/privcmd.c
>> @@ -151,6 +151,41 @@ static int traverse_pages(unsigned nelem, size_t size,
>>       return ret;
>>   }
>>
>> +/*
>> + * Similar to traverse_pages, but use each page as a "block" of
>> + * data to be processed as one unit.
>> + */
>> +static int traverse_pages_block(unsigned nelem, size_t size,
>> +                struct list_head *pos,
>> +                int (*fn)(void *data, int nr, void *state),
>> +                void *state)
>> +{
>> +    void *pagedata;
>> +    unsigned pageidx;
>> +    int ret = 0;
>> +
>> +    BUG_ON(size > PAGE_SIZE);
>> +
>> +    pageidx = PAGE_SIZE;
>> +    pagedata = NULL;    /* hush, gcc */
> What was gcc upset about?  I don't see anything it could get confused about.
This comes from the original traverse_pages code, which does this. I 
will see if it compiles without warnings if I remove the initialization.
>
>> @@ -260,17 +295,17 @@ struct mmap_batch_state {
>>       xen_pfn_t __user *user_mfn;
>>   };
>>
>> -static int mmap_batch_fn(void *data, void *state)
>> +static int mmap_batch_fn(void *data, int nr, void *state)
>>   {
>>       xen_pfn_t *mfnp = data;
>> +
>>       struct mmap_batch_state *st = state;
>>       int ret;
>>
>> -    ret = xen_remap_domain_mfn_range(st->vma, st->va & PAGE_MASK,
>> *mfnp, 1,
>> -                     st->vma->vm_page_prot, st->domain);
>> +    BUG_ON(nr < 0);
> Is this BUG_ON() useful?
I think very bad things will happen when nr is less than zero, but I 
guess they will be pretty obvious... So perhaps just letting it die from 
the consequences. It does "while(nr)" in the remap function, and then 
min(REMAP_BATCH_SIZE, nr) an various other things that will definitely 
not work as expected if nr is negative. I thought it's much easier to 
detect when it's gone wrong if you assert early tho'.

--
Mats
>
> David
>
>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 14:05:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 14:05:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYdaX-0006wi-Jm; Wed, 14 Nov 2012 14:05:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TYdaW-0006vz-4j
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 14:05:08 +0000
Received: from [85.158.139.211:14487] by server-4.bemta-5.messagelabs.com id
	1C/C1-15011-315A3A05; Wed, 14 Nov 2012 14:05:07 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1352901904!18143750!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODYyNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4941 invoked from network); 14 Nov 2012 14:05:06 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 14:05:06 -0000
X-IronPort-AV: E=Sophos;i="4.83,250,1352073600"; d="scan'208";a="214468479"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	14 Nov 2012 14:04:46 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.318.1;
	Wed, 14 Nov 2012 09:04:45 -0500
Message-ID: <50A3A4FC.8040408@citrix.com>
Date: Wed, 14 Nov 2012 14:04:44 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: David Vrabel <david.vrabel@citrix.com>
References: <50A37CC7.8050700@citrix.com> <50A397E1.7000602@citrix.com>
In-Reply-To: <50A397E1.7000602@citrix.com>
X-Originating-IP: [10.80.3.146]
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [RFC/PATCH] Improve speed of mapping guest memory
 into	Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 14/11/12 13:08, David Vrabel wrote:
> Mats,
>
> Your patch has been white-space damaged and will not apply.  You should
> use git send-email which will do the right thing.  I've also CC'd Konrad
> who is the maintainer for the Xen parts of the kernel.
Thanks for the advice. Will use git send-email for V2 of this patch.
> On 14/11/12 11:13, Mats Petersson wrote:
>> [a long, rambling commit message?]
> The text as-is isn't really suitable for a commit message (too much
> irrelevant stuff) and there is no suitable subject line.
>
>> I have also found that the munmap() call used to unmap the guest memory
>> from Dom0 is about 35% slower in 3.7 kernel than in the 2.6 kernel (3.8M
>> cycles vs 2.8M cycles).
> This performance reduction only occurs with 32-bit guests is the Xen
> then traps-and-emulates both halves of the PTE write.
>
>> I think this could be made quicker by using a
>> direct write of zero rather than the compare exchange operation that is
>> currently used [which traps into Xen, performs the compare & exchange] -
> This is something I noticed but never got around to producing a patch.
> How about this (uncomplied!) patch?
>
> -- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1146,8 +1146,16 @@ again:
>   				     page->index > details->last_index))
>   					continue;
>   			}
> -			ptent = ptep_get_and_clear_full(mm, addr, pte,
> -							tlb->fullmm);
> +			/*
> +			 * No need for the expensive atomic get and
> +			 * clear for anonymous mappings as the dirty
> +			 * and young bits are not used.
> +			 */
> +			if (PageAnon(page))
> +				pte_clear(mm, addr, pte);
> +			else
> +				ptent = ptep_get_and_clear_full(mm, addr, pte,
> +								tlb->fullmm);
>   			tlb_remove_tlb_entry(tlb, pte, addr);
>   			if (unlikely(!page))
>   				continue;
I came up with something very similar, however found that page is 
sometimes NULL which causes problems. if (page && PageAnon(page)) will 
probably work... Trying that now.

> Now for the patch itself.  On the whole, the approach looks good and the
> real-word performance improvements are nice.  Specific comments inline.
>
>> --- a/arch/x86/xen/mmu.c
>> +++ b/arch/x86/xen/mmu.c
>> @@ -2542,3 +2561,77 @@ out:
>>       return err;
>>   }
>>   EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range);
>> +
>> +/* like xen_remap_domain_mfn_range, but does a list of mfn's, rather
>> + * than the, for xen, quite useless, consecutive pages.
>> + */
> /*
>   * Like xen_remap_domain_mfn_range(), but more efficiently handles MFNs
>   * that are not contiguous (which is common for a domain's memory).
>   */
Will update.
>> +int xen_remap_domain_mfn_list(struct vm_area_struct *vma,
>> +                  unsigned long addr,
>> +                  unsigned long *mfn, int nr,
>> +                  int *err_ptr,
>> +                  pgprot_t prot, unsigned domid)
> xen_remap_domain_mfn_array() ?  It's not taking a list.
Yes, better name. Although, perhaps following Ian Campbell's suggestion 
and changing the xen_remain_domain_mfn_range to "do the right thing" is 
even better. I will have a quick look at how difficult that may be - I 
feel it may be rather simpler than I first thought, as there is only one 
call to this function in privcmd.c.

The arm/xen/enlighten.c will probably also need fixing, I suppose...

>> +{
>> +    struct remap_list_data rmd;
>> +    struct mmu_update mmu_update[REMAP_BATCH_SIZE];
> This is surprisingly large (256 bytes) but I note that the existing
> xen_remap_domain_mfn_range() does the same thing so I guess it's ok.
I would actually like to increase it, but that would probably require 
allocation. One HV call per 32
>> +    int batch;
>> +    int done;
>> +    unsigned long range;
>> +    int err = 0;
>> +
>> +    if (xen_feature(XENFEAT_auto_translated_physmap))
>> +        return -EINVAL;
>> +
>> +    prot = __pgprot(pgprot_val(prot) | _PAGE_IOMAP);
>> +
>> +    BUG_ON(!((vma->vm_flags & (VM_PFNMAP | VM_IO)) == (VM_PFNMAP |
>> VM_IO)));
>> +
>> +    rmd.mfn = mfn;
>> +    rmd.prot = prot;
>> +
>> +    while (nr) {
>> +        batch = min(REMAP_BATCH_SIZE, nr);
>> +        range = (unsigned long)batch << PAGE_SHIFT;
>> +
>> +        rmd.mmu_update = mmu_update;
>> +        err = apply_to_page_range(vma->vm_mm, addr, range,
>> +                      remap_area_mfn_list_pte_fn, &rmd);
>> +        if (err)
>> +        {
>> +            printk("xen_remap_domain_mfn_list: apply_to_range:
>> err=%d\n", err);
> Stray printk?
Yes.
>> +            goto out;
>> +        }
>> +
>> +        err = HYPERVISOR_mmu_update(mmu_update, batch, &done, domid);
>> +        if (err < 0)
>> +        {
>> +            int i;
>> +            /* TODO: We should remove this printk later */
>> +            printk("xen_remap_domain_mfn_list: mmu_update: err=%d,
>> done=%d, batch=%d\n", err, done, batch);
> Yes, you should...
>
>> +            err_ptr[done] = err;
>> +
>> +            /* now do the remaining part of this batch */
>> +            for(i = done+1; i < batch; i++)
>> +            {
>> +                int tmp_err = HYPERVISOR_mmu_update(&mmu_update[i], 1,
>> NULL, domid);
>> +                if (tmp_err < 0)
>> +                {
>> +                    err_ptr[i] = tmp_err;
>> +                }
>> +            }
> There's no need to fall back to doing it page-by-page here. You can
> still batch the remainder.
Yes, I agree.
>> +
>> +            goto out;
>> +        }
>> +
>> +        nr -= batch;
>> +        addr += range;
>> +        err_ptr += batch;
>> +    }
>> +
>> +    err = 0;
>> +out:
>> +
>> +    xen_flush_tlb_all();
> Probably not that important anymore since we would now do far fewer TLB
> flushes, but this TLB flush is only needed by the PTEs being updated
> were already present -- if they're all clear then TLB flush can be
> omitted entirely.
The 2.6 kernel actually had a check BUG_ON(!pte_none(pte)) [or something 
like that], but the 3.x kernel seems to have "lost" that. Either way, 
once per, say, 1024 pages isn't measurable in my benchmarks.
>
>> +
>> +    return err;
>> +}
>> +EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_list);
>> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
>> index 8adb9cc..b39a7b7 100644
>> --- a/drivers/xen/privcmd.c
>> +++ b/drivers/xen/privcmd.c
>> @@ -151,6 +151,41 @@ static int traverse_pages(unsigned nelem, size_t size,
>>       return ret;
>>   }
>>
>> +/*
>> + * Similar to traverse_pages, but use each page as a "block" of
>> + * data to be processed as one unit.
>> + */
>> +static int traverse_pages_block(unsigned nelem, size_t size,
>> +                struct list_head *pos,
>> +                int (*fn)(void *data, int nr, void *state),
>> +                void *state)
>> +{
>> +    void *pagedata;
>> +    unsigned pageidx;
>> +    int ret = 0;
>> +
>> +    BUG_ON(size > PAGE_SIZE);
>> +
>> +    pageidx = PAGE_SIZE;
>> +    pagedata = NULL;    /* hush, gcc */
> What was gcc upset about?  I don't see anything it could get confused about.
This comes from the original traverse_pages code, which does this. I 
will see if it compiles without warnings if I remove the initialization.
>
>> @@ -260,17 +295,17 @@ struct mmap_batch_state {
>>       xen_pfn_t __user *user_mfn;
>>   };
>>
>> -static int mmap_batch_fn(void *data, void *state)
>> +static int mmap_batch_fn(void *data, int nr, void *state)
>>   {
>>       xen_pfn_t *mfnp = data;
>> +
>>       struct mmap_batch_state *st = state;
>>       int ret;
>>
>> -    ret = xen_remap_domain_mfn_range(st->vma, st->va & PAGE_MASK,
>> *mfnp, 1,
>> -                     st->vma->vm_page_prot, st->domain);
>> +    BUG_ON(nr < 0);
> Is this BUG_ON() useful?
I think very bad things will happen when nr is less than zero, but I 
guess they will be pretty obvious... So perhaps just letting it die from 
the consequences. It does "while(nr)" in the remap function, and then 
min(REMAP_BATCH_SIZE, nr) an various other things that will definitely 
not work as expected if nr is negative. I thought it's much easier to 
detect when it's gone wrong if you assert early tho'.

--
Mats
>
> David
>
>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 14:17:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 14:17:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYdmW-0007Gq-VI; Wed, 14 Nov 2012 14:17:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <hchkim@gmail.com>) id 1TYS2l-0001SC-Uz
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 01:45:32 +0000
Received: from [85.158.139.83:50251] by server-10.bemta-5.messagelabs.com id
	66/62-09257-BB7F2A05; Wed, 14 Nov 2012 01:45:31 +0000
X-Env-Sender: hchkim@gmail.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1352857529!30139997!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23200 invoked from network); 14 Nov 2012 01:45:29 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 01:45:29 -0000
Received: by mail-ee0-f45.google.com with SMTP id d49so2379437eek.32
	for <xen-devel@lists.xen.org>; Tue, 13 Nov 2012 17:45:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=s9I8kV3ldQTiBtM6d2QpaGv/E2wsKA3yYIuucH1vz+8=;
	b=y6OS/FRwOz7go/gpqnSSlOfFtWRM/qXwaTzVYpWLQ3gguK+I3yVbEc8h3QeG2p/s30
	ujPCbt8adRX8Agsa1STOoYTsGiC20Ot/+9Y+c/mj2nHA7kvDW9IM59Q/dKKiyJ7d9JJZ
	PH0hthWrZq/NEFPjaAj1PHv9HnKO8USQDEJFwoxcLyWxm4BA28noBUN7hDVUNItp3mzH
	aKpar5jlz4WmXIfTyUDkSpv3B+VBBp4ZyTP4EiMMjSFotkpAlMprBqE9JZu/Vy0T8D0i
	KmyYoKql0s1+rtPlFdihyY2xWmELKmWp60NKraVLnoa3lP1BMsfMRtEy7H2ITP376rx7
	Rc2Q==
MIME-Version: 1.0
Received: by 10.14.194.2 with SMTP id l2mr81496799een.12.1352857529483; Tue,
	13 Nov 2012 17:45:29 -0800 (PST)
Received: by 10.223.156.65 with HTTP; Tue, 13 Nov 2012 17:45:29 -0800 (PST)
Date: Wed, 14 Nov 2012 10:45:29 +0900
Message-ID: <CAB8QuJ6-XMAGCU87MRsBQcm32PaUWEVX4GBTV2JYGz4-s3Hb4A@mail.gmail.com>
From: HyoCheol Kim <hchkim@gmail.com>
To: xen-devel@lists.xen.org
X-Mailman-Approved-At: Wed, 14 Nov 2012 14:17:31 +0000
Subject: [Xen-devel] libxl: error:
 libxl_dm.c:1212:device_model_spawn_outcome: domain 1 device model: spawn
 failed (rc=-3) when creating VM using upstream qemu on Xen 4.2.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2611304372723772791=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============2611304372723772791==
Content-Type: multipart/alternative; boundary=047d7b3434967a037c04ce6ab0f3

--047d7b3434967a037c04ce6ab0f3
Content-Type: text/plain; charset=ISO-8859-1

Hello,

I've tested Xen 4.2 on CentOS 6.3(x86_x64)
My goal is to connect to Windows VM on Xen 4.2 using SPICE client.

Installation of Xen 4.2 was successful.
Also creating Windows VM using qemu-dm and connecting to it using VNC are
OK.
But qemu-dm can't support SPICE, so I installed upstream qemu. (
http://wiki.xen.org/wiki/QEMU_Upstream)
I also installed spice-server and spice-protocol as newest version.
Configuration and installation seems like successful. But not work with
error message above.

=========================================================================================
[root@localhost xen]# xl -f create Windows2003.cfg
Parsing config from Windows2003.cfg
xc: info: VIRTUAL MEMORY ARRANGEMENT:
  Loader:        0000000000100000->000000000019bae4
  TOTAL:         0000000000000000->000000003c000000
  ENTRY ADDRESS: 0000000000100000
xc: info: PHYSICAL MEMORY ALLOCATION:
  4KB PAGES: 0x0000000000000200
  2MB PAGES: 0x00000000000001df
  1GB PAGES: 0x0000000000000000
libxl: error: libxl_dm.c:1212:device_model_spawn_outcome: domain 1 device
model: spawn failed (rc=-3)
libxl: error: libxl_qmp.c:641:libxl__qmp_initialize: Connection error: No
such file or directory
Daemon running with PID 3912
=========================================================================================

My Windows2003.cfg file is above.

builder = "hvm"
name = "Windows2003"
memory = 1024

on_poweroff="destroy"
on_reboot="restart"
on_crash="destroy"

vcpus = 2
disk = [ '/dev/VolGroup/lv_home,,hda',
'/usr/src/Windows2003.iso,,hdc,cdrom' ]

# using qemu-dm is success to work.
#device_model='qemu-dm'
device_model_version='qemu-xen'
device_model_override='/usr/src/qemu/i386-softmmu/qemu-system-i386'
#device_model_override='/usr/src/qemu/x86_64-softmmu/qemu-system-x86_64'

boot="dc"
acpi=1
xen_platform_pci=1
xiridian=1
stdvga=1

#sdl = 1
vnc =0
vncconsole=0
vncpasswd=''
vncunused=1
vnclisten='0.0.0.0'
vncdisplay=3

spice=1
spicehost='0.0.0.0'
spiceport=6000
spicedisable_ticketing=1
spicepasswd = 'password'


Thanks in advance.

Daniel.

--047d7b3434967a037c04ce6ab0f3
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello,<div><br></div><div>I&#39;ve tested Xen 4.2 on CentOS 6.3(x86_x64)</d=
iv><div>My goal is to connect to Windows VM on Xen 4.2 using SPICE client.<=
br><div><br></div><div>Installation of Xen 4.2 was successful.=A0</div><div=
>
Also creating Windows VM using qemu-dm and connecting to it using VNC are O=
K.</div><div>But qemu-dm can&#39;t support SPICE, so I installed upstream q=
emu. (<a href=3D"http://wiki.xen.org/wiki/QEMU_Upstream">http://wiki.xen.or=
g/wiki/QEMU_Upstream</a>)</div>
<div>I also installed spice-server and spice-protocol as newest version.</d=
iv><div>Configuration and installation seems like successful. But not work =
with error message above.</div><div><br></div><div>=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D</div>
<div>[root@localhost xen]# xl -f create Windows2003.cfg=A0</div><div><div>P=
arsing config from Windows2003.cfg</div><div>xc: info: VIRTUAL MEMORY ARRAN=
GEMENT:</div><div>=A0 Loader: =A0 =A0 =A0 =A00000000000100000-&gt;000000000=
019bae4</div>
<div>=A0 TOTAL: =A0 =A0 =A0 =A0 0000000000000000-&gt;000000003c000000</div>=
<div>=A0 ENTRY ADDRESS: 0000000000100000</div><div>xc: info: PHYSICAL MEMOR=
Y ALLOCATION:</div><div>=A0 4KB PAGES: 0x0000000000000200</div><div>=A0 2MB=
 PAGES: 0x00000000000001df</div>
<div>=A0 1GB PAGES: 0x0000000000000000</div><div>libxl: error: libxl_dm.c:1=
212:device_model_spawn_outcome: domain 1 device model: spawn failed (rc=3D-=
3)</div><div>libxl: error: libxl_qmp.c:641:libxl__qmp_initialize: Connectio=
n error: No such file or directory</div>
<div>Daemon running with PID 3912</div></div></div><div>=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D</div><div><br></div><div>My Windows2003.cfg file i=
s above.</div><div><br></div>
<div>builder =3D &quot;hvm&quot;</div><div>name =3D &quot;Windows2003&quot;=
</div><div>memory =3D 1024</div><div><br></div><div><div>on_poweroff=3D&quo=
t;destroy&quot;</div><div>on_reboot=3D&quot;restart&quot;</div><div>on_cras=
h=3D&quot;destroy&quot;</div>
</div><div><br></div><div>vcpus =3D 2</div><div>disk =3D [ &#39;/dev/VolGro=
up/lv_home,,hda&#39;, &#39;/usr/src/Windows2003.iso,,hdc,cdrom&#39; ]</div>=
<div><br></div><div># using qemu-dm is success to work.</div><div>#device_m=
odel=3D&#39;qemu-dm&#39;</div>
<div>device_model_version=3D&#39;qemu-xen&#39;</div><div>device_model_overr=
ide=3D&#39;/usr/src/qemu/i386-softmmu/qemu-system-i386&#39;</div><div>#devi=
ce_model_override=3D&#39;/usr/src/qemu/x86_64-softmmu/qemu-system-x86_64&#3=
9;</div>
<div><br></div><div><div>boot=3D&quot;dc&quot;</div><div>acpi=3D1</div><div=
>xen_platform_pci=3D1</div><div>xiridian=3D1</div><div>stdvga=3D1</div><div=
><br></div><div>#sdl =3D 1</div><div>vnc =3D0</div><div>vncconsole=3D0</div=
><div>vncpasswd=3D&#39;&#39;</div>
<div>vncunused=3D1</div><div>vnclisten=3D&#39;0.0.0.0&#39;</div><div>vncdis=
play=3D3</div><div><br></div><div>spice=3D1</div><div>spicehost=3D&#39;0.0.=
0.0&#39;</div><div>spiceport=3D6000</div><div>spicedisable_ticketing=3D1</d=
iv><div>spicepasswd =3D &#39;password&#39;</div>
</div><div><br></div><div><br></div><div>Thanks in advance.</div><div><br><=
/div><div>Daniel.</div><div><br></div><div><br></div><div><br></div><div><b=
r></div><div><br></div><div><br></div>

--047d7b3434967a037c04ce6ab0f3--


--===============2611304372723772791==
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.xen.org
http://lists.xen.org/xen-devel

--===============2611304372723772791==--


From xen-devel-bounces@lists.xen.org Wed Nov 14 14:17:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 14:17:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYdmW-0007Gq-VI; Wed, 14 Nov 2012 14:17:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <hchkim@gmail.com>) id 1TYS2l-0001SC-Uz
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 01:45:32 +0000
Received: from [85.158.139.83:50251] by server-10.bemta-5.messagelabs.com id
	66/62-09257-BB7F2A05; Wed, 14 Nov 2012 01:45:31 +0000
X-Env-Sender: hchkim@gmail.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1352857529!30139997!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23200 invoked from network); 14 Nov 2012 01:45:29 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 01:45:29 -0000
Received: by mail-ee0-f45.google.com with SMTP id d49so2379437eek.32
	for <xen-devel@lists.xen.org>; Tue, 13 Nov 2012 17:45:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=s9I8kV3ldQTiBtM6d2QpaGv/E2wsKA3yYIuucH1vz+8=;
	b=y6OS/FRwOz7go/gpqnSSlOfFtWRM/qXwaTzVYpWLQ3gguK+I3yVbEc8h3QeG2p/s30
	ujPCbt8adRX8Agsa1STOoYTsGiC20Ot/+9Y+c/mj2nHA7kvDW9IM59Q/dKKiyJ7d9JJZ
	PH0hthWrZq/NEFPjaAj1PHv9HnKO8USQDEJFwoxcLyWxm4BA28noBUN7hDVUNItp3mzH
	aKpar5jlz4WmXIfTyUDkSpv3B+VBBp4ZyTP4EiMMjSFotkpAlMprBqE9JZu/Vy0T8D0i
	KmyYoKql0s1+rtPlFdihyY2xWmELKmWp60NKraVLnoa3lP1BMsfMRtEy7H2ITP376rx7
	Rc2Q==
MIME-Version: 1.0
Received: by 10.14.194.2 with SMTP id l2mr81496799een.12.1352857529483; Tue,
	13 Nov 2012 17:45:29 -0800 (PST)
Received: by 10.223.156.65 with HTTP; Tue, 13 Nov 2012 17:45:29 -0800 (PST)
Date: Wed, 14 Nov 2012 10:45:29 +0900
Message-ID: <CAB8QuJ6-XMAGCU87MRsBQcm32PaUWEVX4GBTV2JYGz4-s3Hb4A@mail.gmail.com>
From: HyoCheol Kim <hchkim@gmail.com>
To: xen-devel@lists.xen.org
X-Mailman-Approved-At: Wed, 14 Nov 2012 14:17:31 +0000
Subject: [Xen-devel] libxl: error:
 libxl_dm.c:1212:device_model_spawn_outcome: domain 1 device model: spawn
 failed (rc=-3) when creating VM using upstream qemu on Xen 4.2.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2611304372723772791=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============2611304372723772791==
Content-Type: multipart/alternative; boundary=047d7b3434967a037c04ce6ab0f3

--047d7b3434967a037c04ce6ab0f3
Content-Type: text/plain; charset=ISO-8859-1

Hello,

I've tested Xen 4.2 on CentOS 6.3(x86_x64)
My goal is to connect to Windows VM on Xen 4.2 using SPICE client.

Installation of Xen 4.2 was successful.
Also creating Windows VM using qemu-dm and connecting to it using VNC are
OK.
But qemu-dm can't support SPICE, so I installed upstream qemu. (
http://wiki.xen.org/wiki/QEMU_Upstream)
I also installed spice-server and spice-protocol as newest version.
Configuration and installation seems like successful. But not work with
error message above.

=========================================================================================
[root@localhost xen]# xl -f create Windows2003.cfg
Parsing config from Windows2003.cfg
xc: info: VIRTUAL MEMORY ARRANGEMENT:
  Loader:        0000000000100000->000000000019bae4
  TOTAL:         0000000000000000->000000003c000000
  ENTRY ADDRESS: 0000000000100000
xc: info: PHYSICAL MEMORY ALLOCATION:
  4KB PAGES: 0x0000000000000200
  2MB PAGES: 0x00000000000001df
  1GB PAGES: 0x0000000000000000
libxl: error: libxl_dm.c:1212:device_model_spawn_outcome: domain 1 device
model: spawn failed (rc=-3)
libxl: error: libxl_qmp.c:641:libxl__qmp_initialize: Connection error: No
such file or directory
Daemon running with PID 3912
=========================================================================================

My Windows2003.cfg file is above.

builder = "hvm"
name = "Windows2003"
memory = 1024

on_poweroff="destroy"
on_reboot="restart"
on_crash="destroy"

vcpus = 2
disk = [ '/dev/VolGroup/lv_home,,hda',
'/usr/src/Windows2003.iso,,hdc,cdrom' ]

# using qemu-dm is success to work.
#device_model='qemu-dm'
device_model_version='qemu-xen'
device_model_override='/usr/src/qemu/i386-softmmu/qemu-system-i386'
#device_model_override='/usr/src/qemu/x86_64-softmmu/qemu-system-x86_64'

boot="dc"
acpi=1
xen_platform_pci=1
xiridian=1
stdvga=1

#sdl = 1
vnc =0
vncconsole=0
vncpasswd=''
vncunused=1
vnclisten='0.0.0.0'
vncdisplay=3

spice=1
spicehost='0.0.0.0'
spiceport=6000
spicedisable_ticketing=1
spicepasswd = 'password'


Thanks in advance.

Daniel.

--047d7b3434967a037c04ce6ab0f3
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello,<div><br></div><div>I&#39;ve tested Xen 4.2 on CentOS 6.3(x86_x64)</d=
iv><div>My goal is to connect to Windows VM on Xen 4.2 using SPICE client.<=
br><div><br></div><div>Installation of Xen 4.2 was successful.=A0</div><div=
>
Also creating Windows VM using qemu-dm and connecting to it using VNC are O=
K.</div><div>But qemu-dm can&#39;t support SPICE, so I installed upstream q=
emu. (<a href=3D"http://wiki.xen.org/wiki/QEMU_Upstream">http://wiki.xen.or=
g/wiki/QEMU_Upstream</a>)</div>
<div>I also installed spice-server and spice-protocol as newest version.</d=
iv><div>Configuration and installation seems like successful. But not work =
with error message above.</div><div><br></div><div>=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D</div>
<div>[root@localhost xen]# xl -f create Windows2003.cfg=A0</div><div><div>P=
arsing config from Windows2003.cfg</div><div>xc: info: VIRTUAL MEMORY ARRAN=
GEMENT:</div><div>=A0 Loader: =A0 =A0 =A0 =A00000000000100000-&gt;000000000=
019bae4</div>
<div>=A0 TOTAL: =A0 =A0 =A0 =A0 0000000000000000-&gt;000000003c000000</div>=
<div>=A0 ENTRY ADDRESS: 0000000000100000</div><div>xc: info: PHYSICAL MEMOR=
Y ALLOCATION:</div><div>=A0 4KB PAGES: 0x0000000000000200</div><div>=A0 2MB=
 PAGES: 0x00000000000001df</div>
<div>=A0 1GB PAGES: 0x0000000000000000</div><div>libxl: error: libxl_dm.c:1=
212:device_model_spawn_outcome: domain 1 device model: spawn failed (rc=3D-=
3)</div><div>libxl: error: libxl_qmp.c:641:libxl__qmp_initialize: Connectio=
n error: No such file or directory</div>
<div>Daemon running with PID 3912</div></div></div><div>=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D</div><div><br></div><div>My Windows2003.cfg file i=
s above.</div><div><br></div>
<div>builder =3D &quot;hvm&quot;</div><div>name =3D &quot;Windows2003&quot;=
</div><div>memory =3D 1024</div><div><br></div><div><div>on_poweroff=3D&quo=
t;destroy&quot;</div><div>on_reboot=3D&quot;restart&quot;</div><div>on_cras=
h=3D&quot;destroy&quot;</div>
</div><div><br></div><div>vcpus =3D 2</div><div>disk =3D [ &#39;/dev/VolGro=
up/lv_home,,hda&#39;, &#39;/usr/src/Windows2003.iso,,hdc,cdrom&#39; ]</div>=
<div><br></div><div># using qemu-dm is success to work.</div><div>#device_m=
odel=3D&#39;qemu-dm&#39;</div>
<div>device_model_version=3D&#39;qemu-xen&#39;</div><div>device_model_overr=
ide=3D&#39;/usr/src/qemu/i386-softmmu/qemu-system-i386&#39;</div><div>#devi=
ce_model_override=3D&#39;/usr/src/qemu/x86_64-softmmu/qemu-system-x86_64&#3=
9;</div>
<div><br></div><div><div>boot=3D&quot;dc&quot;</div><div>acpi=3D1</div><div=
>xen_platform_pci=3D1</div><div>xiridian=3D1</div><div>stdvga=3D1</div><div=
><br></div><div>#sdl =3D 1</div><div>vnc =3D0</div><div>vncconsole=3D0</div=
><div>vncpasswd=3D&#39;&#39;</div>
<div>vncunused=3D1</div><div>vnclisten=3D&#39;0.0.0.0&#39;</div><div>vncdis=
play=3D3</div><div><br></div><div>spice=3D1</div><div>spicehost=3D&#39;0.0.=
0.0&#39;</div><div>spiceport=3D6000</div><div>spicedisable_ticketing=3D1</d=
iv><div>spicepasswd =3D &#39;password&#39;</div>
</div><div><br></div><div><br></div><div>Thanks in advance.</div><div><br><=
/div><div>Daniel.</div><div><br></div><div><br></div><div><br></div><div><b=
r></div><div><br></div><div><br></div>

--047d7b3434967a037c04ce6ab0f3--


--===============2611304372723772791==
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.xen.org
http://lists.xen.org/xen-devel

--===============2611304372723772791==--


From xen-devel-bounces@lists.xen.org Wed Nov 14 14:32:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 14:32:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYe0A-0007gK-Gy; Wed, 14 Nov 2012 14:31:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jym@netbsd.org>) id 1TYe09-0007fu-Fd
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 14:31:37 +0000
Received: from [85.158.139.211:49989] by server-13.bemta-5.messagelabs.com id
	57/C9-27809-84BA3A05; Wed, 14 Nov 2012 14:31:36 +0000
X-Env-Sender: jym@netbsd.org
X-Msg-Ref: server-15.tower-206.messagelabs.com!1352903496!20100485!1
X-Originating-IP: [80.12.242.126]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21610 invoked from network); 14 Nov 2012 14:31:36 -0000
Received: from smtp04.smtpout.orange.fr (HELO smtp.smtpout.orange.fr)
	(80.12.242.126) by server-15.tower-206.messagelabs.com with SMTP;
	14 Nov 2012 14:31:36 -0000
Received: from helkyn.dyndns.org ([193.253.63.231]) by mwinf5d08 with ME
	id PSXa1k00T4zMix503SXaac; Wed, 14 Nov 2012 15:31:36 +0100
Received: by helkyn.dyndns.org (Postfix, from userid 1003)
	id 23F6A770A1; Wed, 14 Nov 2012 15:31:34 +0100 (CET)
To: <xen-devel@lists.xen.org>
MIME-Version: 1.0
Date: Wed, 14 Nov 2012 15:31:34 +0100
From: "Jean-Yves Migeon (NetBSD)" <jym@NetBSD.org>
Mail-Reply-To: <jym@NetBSD.org>
Message-ID: <121149b56ff3ce2fa58c8a539828fe3b@helkyn.dyndns.org>
X-Sender: jym@NetBSD.org
User-Agent: RoundCube Webmail/0.7.2
Subject: [Xen-devel] Image format for an HVM domain
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: jym@NetBSD.org
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi list,

Is there a documentation somewhere where the image format for 
xc_domain_save/_restore is specified, or at least described?

I am looking for one regarding an HVM domU, but can't find any in the 
wiki -- Most notably, I am interested in knowing how the P2M translation 
tables are dumped, in case they are differences from the one for a PV 
domU. Purpose is to add its support to our NetBSD crash(8) program.

Cheers,

-- 
Jean-Yves Migeon
jym@NetBSD.org

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 14:32:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 14:32:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYe0A-0007gK-Gy; Wed, 14 Nov 2012 14:31:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jym@netbsd.org>) id 1TYe09-0007fu-Fd
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 14:31:37 +0000
Received: from [85.158.139.211:49989] by server-13.bemta-5.messagelabs.com id
	57/C9-27809-84BA3A05; Wed, 14 Nov 2012 14:31:36 +0000
X-Env-Sender: jym@netbsd.org
X-Msg-Ref: server-15.tower-206.messagelabs.com!1352903496!20100485!1
X-Originating-IP: [80.12.242.126]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21610 invoked from network); 14 Nov 2012 14:31:36 -0000
Received: from smtp04.smtpout.orange.fr (HELO smtp.smtpout.orange.fr)
	(80.12.242.126) by server-15.tower-206.messagelabs.com with SMTP;
	14 Nov 2012 14:31:36 -0000
Received: from helkyn.dyndns.org ([193.253.63.231]) by mwinf5d08 with ME
	id PSXa1k00T4zMix503SXaac; Wed, 14 Nov 2012 15:31:36 +0100
Received: by helkyn.dyndns.org (Postfix, from userid 1003)
	id 23F6A770A1; Wed, 14 Nov 2012 15:31:34 +0100 (CET)
To: <xen-devel@lists.xen.org>
MIME-Version: 1.0
Date: Wed, 14 Nov 2012 15:31:34 +0100
From: "Jean-Yves Migeon (NetBSD)" <jym@NetBSD.org>
Mail-Reply-To: <jym@NetBSD.org>
Message-ID: <121149b56ff3ce2fa58c8a539828fe3b@helkyn.dyndns.org>
X-Sender: jym@NetBSD.org
User-Agent: RoundCube Webmail/0.7.2
Subject: [Xen-devel] Image format for an HVM domain
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: jym@NetBSD.org
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi list,

Is there a documentation somewhere where the image format for 
xc_domain_save/_restore is specified, or at least described?

I am looking for one regarding an HVM domU, but can't find any in the 
wiki -- Most notably, I am interested in knowing how the P2M translation 
tables are dumped, in case they are differences from the one for a PV 
domU. Purpose is to add its support to our NetBSD crash(8) program.

Cheers,

-- 
Jean-Yves Migeon
jym@NetBSD.org

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 14:48:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 14:48:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYeG6-00013V-41; Wed, 14 Nov 2012 14:48:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fantonifabio@tiscali.it>) id 1TYeG3-00013G-VD
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 14:48:04 +0000
Received: from [85.158.139.83:18671] by server-16.bemta-5.messagelabs.com id
	50/6D-04786-32FA3A05; Wed, 14 Nov 2012 14:48:03 +0000
X-Env-Sender: fantonifabio@tiscali.it
X-Msg-Ref: server-3.tower-182.messagelabs.com!1352904481!30261937!1
X-Originating-IP: [94.23.245.208]
X-SpamReason: No, hits=0.1 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23884 invoked from network); 14 Nov 2012 14:48:02 -0000
Received: from lnx3.fantu.it (HELO lnx3.fantu.it) (94.23.245.208)
	by server-3.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 14:48:02 -0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by lnx3.fantu.it (Postfix) with ESMTP id C061540086D
	for <xen-devel@lists.xen.org>; Wed, 14 Nov 2012 15:48:01 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at lnx3.fantu.it
Received: from lnx3.fantu.it ([127.0.0.1])
	by localhost (lnx3.fantu.it [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id UJ-TJ7lZ75-n for <xen-devel@lists.xen.org>;
	Wed, 14 Nov 2012 15:48:00 +0100 (CET)
Received: from [192.168.178.50]
	(host51-78-dynamic.2-87-r.retail.telecomitalia.it [87.2.78.51])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: prova@fantu.it)
	by lnx3.fantu.it (Postfix) with ESMTPSA id F05C5400843
	for <xen-devel@lists.xen.org>; Wed, 14 Nov 2012 15:47:59 +0100 (CET)
Message-ID: <50A3AF17.4090701@tiscali.it>
Date: Wed, 14 Nov 2012 15:47:51 +0100
From: Fabio Fantoni <fantonifabio@tiscali.it>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] libxl: error:
 libxl_dm.c:1212:device_model_spawn_outcome: domain 1 device model: spawn
 failed (rc=-3) when creating VM using upstream qemu on Xen 4.2.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5406002184902897017=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--===============5406002184902897017==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms050609000509030709090206"

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--------------ms050609000509030709090206
Content-Type: multipart/alternative;
 boundary="------------050301070801080209000902"

This is a multi-part message in MIME format.
--------------050301070801080209000902
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: quoted-printable

> Hello,
>
>
> I've tested Xen 4.2 on CentOS 6.3(x86_x64)
>
> My goal is to connect to Windows VM on Xen 4.2 using SPICE client.
>
>
> Installation of Xen 4.2 was successful.
>
> Also creating Windows VM using qemu-dm and connecting to it using VNC=20
> are OK.
>
> But qemu-dm can't support SPICE, so I installed upstream qemu.=20
> (http://wiki.xen.org/wiki/QEMU_Upstream)=20
> <http://wiki.xen.org/wiki/QEMU_Upstream%29>
>
> I also installed spice-server and spice-protocol as newest version.
>
> Configuration and installation seems like successful. But not work=20
> with error message above.
>
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> [root@localhost xen]# xl -f create Windows2003.cfg
>
> Parsing config from Windows2003.cfg
>
> xc: info: VIRTUAL MEMORY ARRANGEMENT:
>
>   Loader:        0000000000100000->000000000019bae4
>
>   TOTAL:         0000000000000000->000000003c000000
>
>   ENTRY ADDRESS: 0000000000100000
>
> xc: info: PHYSICAL MEMORY ALLOCATION:
>
>   4KB PAGES: 0x0000000000000200
>
>   2MB PAGES: 0x00000000000001df
>
>   1GB PAGES: 0x0000000000000000
>
> libxl: error: libxl_dm.c:1212:device_model_spawn_outcome: domain 1=20
> device model: spawn failed (rc=3D-3)
>
> libxl: error: libxl_qmp.c:641:libxl__qmp_initialize: Connection error: =

> No such file or directory
>
> Daemon running with PID 3912
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
>
> My Windows2003.cfg file is above.
>
>
> builder =3D "hvm"
>
> name =3D "Windows2003"
>
> memory =3D 1024
>
>
>
> vcpus =3D 2
>
> disk =3D [ '/dev/VolGroup/lv_home,,hda',=20
> '/usr/src/Windows2003.iso,,hdc,cdrom' ]
>
>
> # using qemu-dm is success to work.
>
> #device_model=3D'qemu-dm'
>
> device_model_version=3D'qemu-xen'
>
> device_model_override=3D'/usr/src/qemu/i386-softmmu/qemu-system-i386'
>
> #device_model_override=3D'/usr/src/qemu/x86_64-softmmu/qemu-system-x86_=
64'
>
>
> boot=3D"dc"
>
> acpi=3D1
>
> xen_platform_pci=3D1
>
> xiridian=3D1
>
> stdvga=3D1
>
>
> #sdl =3D 1
>
> vnc =3D0
>
> vncconsole=3D0
>
> vncpasswd=3D''
>
> vncunused=3D1
>
> vnclisten=3D'0.0.0.0'
>
> vncdisplay=3D3
>
>
> spice=3D1
>
> spicehost=3D'0.0.0.0'
>
> spiceport=3D6000
>
> spicedisable_ticketing=3D1
>
> spicepasswd =3D 'password'
>
>
>
> Thanks in advance.
>
>
> Daniel.
>
Hi, is also my goal have spice working on xen, is over one year that I'm =

testing it.
Now the main problem for me is a qemu crashes when running spice + qxl.
Start trying build with internal qemu upstream instead of external one=20
(I did the same), see patch below and remove on domU cfg the qemudm=20
override:

diff -r 10feb0933708 -r 2a3a5cf9d593 Config.mk
--- a/Config.mk    lun ott 29 15:08:56 2012 +0100
+++ b/Config.mk    ven nov 02 10:33:55 2012 +0100
@@ -202,12 +202,12 @@
  SEABIOS_UPSTREAM_URL ?=3D http://xenbits.xen.org/git-http/seabios.git
  else
  OVMF_UPSTREAM_URL ?=3D git://xenbits.xen.org/ovmf.git
-QEMU_UPSTREAM_URL ?=3D git://xenbits.xen.org/qemu-upstream-unstable.git
-SEABIOS_UPSTREAM_URL ?=3D git://xenbits.xen.org/seabios.git
+QEMU_UPSTREAM_URL ?=3D git://git.qemu.org/qemu.git
+SEABIOS_UPSTREAM_URL ?=3D git://code.coreboot.org/seabios.git
  endif
  OVMF_UPSTREAM_REVISION ?=3D b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
  QEMU_UPSTREAM_REVISION ?=3D master
-SEABIOS_UPSTREAM_TAG ?=3D rel-1.6.3.2
+SEABIOS_UPSTREAM_TAG ?=3D master
  # Sun Mar 11 09:27:07 2012 -0400
  # Update version to 1.6.3.2

diff -r 10feb0933708 -r 2a3a5cf9d593 tools/Makefile
--- a/tools/Makefile    lun ott 29 15:08:56 2012 +0100
+++ b/tools/Makefile    ven nov 02 10:33:55 2012 +0100
@@ -199,6 +199,7 @@
          --bindir=3D$(LIBEXEC) \
          --datadir=3D$(SHAREDIR)/qemu-xen \
          --disable-kvm \
+        --enable-spice \
          --python=3D$(PYTHON) \
          $(IOEMU_CONFIGURE_CROSS); \
      $(MAKE) all


--------------050301070801080209000902
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

<html>
  <head>

    <meta http-equiv=3D"content-type" content=3D"text/html; charset=3DISO=
-8859-15">
  </head>
  <body bgcolor=3D"#FFFFFF" text=3D"#000000">
    <blockquote type=3D"cite">
      <p>Hello,</p>
      <p><br>
      </p>
      <p>I've tested Xen 4.2 on CentOS 6.3(x86_x64)</p>
      <p>My goal is to connect to Windows VM on Xen 4.2 using SPICE
        client.</p>
      <p><br>
      </p>
      <p>Installation of Xen 4.2 was successful.=A0</p>
      <p>Also creating Windows VM using qemu-dm and connecting to it
        using VNC are OK.</p>
      <p>But qemu-dm can't support SPICE, so I installed upstream qemu.
        (<a rel=3D"nofollow"
          href=3D"http://wiki.xen.org/wiki/QEMU_Upstream%29">http://wiki.=
xen.org/wiki/QEMU_Upstream)</a></p>
      <p>I also installed spice-server and spice-protocol as newest
        version.</p>
      <p>Configuration and installation seems like successful. But not
        work with error message above.</p>
      <p><br>
      </p>
      <p>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</p>
      <p>[root@localhost xen]# xl -f create Windows2003.cfg=A0</p>
      <p>Parsing config from Windows2003.cfg</p>
      <p>xc: info: VIRTUAL MEMORY ARRANGEMENT:</p>
      <p>=A0 Loader: =A0 =A0 =A0 =A00000000000100000-&gt;000000000019bae4=
</p>
      <p>=A0 TOTAL: =A0 =A0 =A0 =A0 0000000000000000-&gt;000000003c000000=
</p>
      <p>=A0 ENTRY ADDRESS: 0000000000100000</p>
      <p>xc: info: PHYSICAL MEMORY ALLOCATION:</p>
      <p>=A0 4KB PAGES: 0x0000000000000200</p>
      <p>=A0 2MB PAGES: 0x00000000000001df</p>
      <p>=A0 1GB PAGES: 0x0000000000000000</p>
      <p>libxl: error: libxl_dm.c:1212:device_model_spawn_outcome:
        domain 1 device model: spawn failed (rc=3D-3)</p>
      <p>libxl: error: libxl_qmp.c:641:libxl__qmp_initialize: Connection
        error: No such file or directory</p>
      <p>Daemon running with PID 3912</p>
      <p>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</p>
      <p><br>
      </p>
      <p>My Windows2003.cfg file is above.</p>
      <p><br>
      </p>
      <p>builder =3D "hvm"</p>
      <p>name =3D "Windows2003"</p>
      <p>memory =3D 1024</p>
      <p><br>
      </p>
      <p><br>
      </p>
      <p>vcpus =3D 2</p>
      <p>disk =3D [ '/dev/VolGroup/lv_home,,hda',
        '/usr/src/Windows2003.iso,,hdc,cdrom' ]</p>
      <p><br>
      </p>
      <p># using qemu-dm is success to work.</p>
      <p>#device_model=3D'qemu-dm'</p>
      <p>device_model_version=3D'qemu-xen'</p>
      <p>device_model_override=3D'/usr/src/qemu/i386-softmmu/qemu-system-=
i386'</p>
      <p>#device_model_override=3D'/usr/src/qemu/x86_64-softmmu/qemu-syst=
em-x86_64'</p>
      <p><br>
      </p>
      <p>boot=3D"dc"</p>
      <p>acpi=3D1</p>
      <p>xen_platform_pci=3D1</p>
      <p>xiridian=3D1</p>
      <p>stdvga=3D1</p>
      <p><br>
      </p>
      <p>#sdl =3D 1</p>
      <p>vnc =3D0</p>
      <p>vncconsole=3D0</p>
      <p>vncpasswd=3D''</p>
      <p>vncunused=3D1</p>
      <p>vnclisten=3D'0.0.0.0'</p>
      <p>vncdisplay=3D3</p>
      <p><br>
      </p>
      <p>spice=3D1</p>
      <p>spicehost=3D'0.0.0.0'</p>
      <p>spiceport=3D6000</p>
      <p>spicedisable_ticketing=3D1</p>
      <p>spicepasswd =3D 'password'</p>
      <p><br>
      </p>
      <p><br>
      </p>
      <p>Thanks in advance.</p>
      <p><br>
      </p>
      <p>Daniel.</p>
    </blockquote>
    Hi, is also my goal have spice working on xen, is over one year that
    I'm testing it.<br>
    Now the main problem for me is a qemu crashes when running spice +
    qxl.<br>
    Start trying build with internal qemu upstream instead of external
    one (I did the same), see patch below and remove on domU cfg the
    qemudm override:<br>
    <br>
    diff -r 10feb0933708 -r 2a3a5cf9d593 Config.mk<br>
    --- a/Config.mk=A0=A0=A0 lun ott 29 15:08:56 2012 +0100<br>
    +++ b/Config.mk=A0=A0=A0 ven nov 02 10:33:55 2012 +0100<br>
    @@ -202,12 +202,12 @@<br>
    =A0SEABIOS_UPSTREAM_URL ?=3D <a class=3D"moz-txt-link-freetext" href=3D=
"http://xenbits.xen.org/git-http/seabios.git">http://xenbits.xen.org/git-=
http/seabios.git</a><br>
    =A0else<br>
    =A0OVMF_UPSTREAM_URL ?=3D git://xenbits.xen.org/ovmf.git<br>
    -QEMU_UPSTREAM_URL ?=3D
    git://xenbits.xen.org/qemu-upstream-unstable.git<br>
    -SEABIOS_UPSTREAM_URL ?=3D git://xenbits.xen.org/seabios.git<br>
    +QEMU_UPSTREAM_URL ?=3D git://git.qemu.org/qemu.git<br>
    +SEABIOS_UPSTREAM_URL ?=3D git://code.coreboot.org/seabios.git<br>
    =A0endif<br>
    =A0OVMF_UPSTREAM_REVISION ?=3D b0855f925c6e2e0b21fbb03fab4b5fb5b68768=
71<br>
    =A0QEMU_UPSTREAM_REVISION ?=3D master<br>
    -SEABIOS_UPSTREAM_TAG ?=3D rel-1.6.3.2<br>
    +SEABIOS_UPSTREAM_TAG ?=3D master<br>
    =A0# Sun Mar 11 09:27:07 2012 -0400<br>
    =A0# Update version to 1.6.3.2<br>
    =A0<br>
    diff -r 10feb0933708 -r 2a3a5cf9d593 tools/Makefile<br>
    --- a/tools/Makefile=A0=A0=A0 lun ott 29 15:08:56 2012 +0100<br>
    +++ b/tools/Makefile=A0=A0=A0 ven nov 02 10:33:55 2012 +0100<br>
    @@ -199,6 +199,7 @@<br>
    =A0=A0=A0=A0 =A0=A0=A0 --bindir=3D$(LIBEXEC) \<br>
    =A0=A0=A0=A0 =A0=A0=A0 --datadir=3D$(SHAREDIR)/qemu-xen \<br>
    =A0=A0=A0=A0 =A0=A0=A0 --disable-kvm \<br>
    +=A0=A0=A0 =A0=A0=A0 --enable-spice \<br>
    =A0=A0=A0=A0 =A0=A0=A0 --python=3D$(PYTHON) \<br>
    =A0=A0=A0=A0 =A0=A0=A0 $(IOEMU_CONFIGURE_CROSS); \<br>
    =A0=A0=A0=A0 $(MAKE) all<br>
    <br>
  </body>
</html>

--------------050301070801080209000902--

--------------ms050609000509030709090206
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: Firma crittografica S/MIME

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIINhjCC
BjQwggQcoAMCAQICASAwDQYJKoZIhvcNAQEFBQAwfTELMAkGA1UEBhMCSUwxFjAUBgNVBAoT
DVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNp
Z25pbmcxKTAnBgNVBAMTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA3
MTAyNDIxMDI1NVoXDTE3MTAyNDIxMDI1NVowgYwxCzAJBgNVBAYTAklMMRYwFAYDVQQKEw1T
dGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRhbCBDZXJ0aWZpY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/l3PL8E8urnj5e7Q1SP1vLbwyAzRo+dvjciJlHPReHTb5RjynD66qJ2zZA+g/U/R/
Fpb+xikjb9VlK3n86eev/GXgcjsCzEYwrcGmNWIVKXFyyxkSQwM9+hIOxNw3B3vvU6+AOMx/
VrwfgFani3uZ1sIMJaU1j4MmP1XuNQWkq6Olo5t26eDSoSph9Orsuy56lUyrhWQZiM+EIn3u
1um9CvU9mJ05BMkUjQdAw5F2cfY01RmGov6SqFUVfmXsXX0GFQIYF3+8TbvIfEegwQJTH+ST
Z/h+kSQQBgh1vis2oa4KI4pndPxdiAAAAAAAAA==
--------------ms050609000509030709090206--


--===============5406002184902897017==
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.xen.org
http://lists.xen.org/xen-devel

--===============5406002184902897017==--


From xen-devel-bounces@lists.xen.org Wed Nov 14 14:48:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 14:48:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYeG6-00013V-41; Wed, 14 Nov 2012 14:48:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fantonifabio@tiscali.it>) id 1TYeG3-00013G-VD
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 14:48:04 +0000
Received: from [85.158.139.83:18671] by server-16.bemta-5.messagelabs.com id
	50/6D-04786-32FA3A05; Wed, 14 Nov 2012 14:48:03 +0000
X-Env-Sender: fantonifabio@tiscali.it
X-Msg-Ref: server-3.tower-182.messagelabs.com!1352904481!30261937!1
X-Originating-IP: [94.23.245.208]
X-SpamReason: No, hits=0.1 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23884 invoked from network); 14 Nov 2012 14:48:02 -0000
Received: from lnx3.fantu.it (HELO lnx3.fantu.it) (94.23.245.208)
	by server-3.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 14:48:02 -0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by lnx3.fantu.it (Postfix) with ESMTP id C061540086D
	for <xen-devel@lists.xen.org>; Wed, 14 Nov 2012 15:48:01 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at lnx3.fantu.it
Received: from lnx3.fantu.it ([127.0.0.1])
	by localhost (lnx3.fantu.it [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id UJ-TJ7lZ75-n for <xen-devel@lists.xen.org>;
	Wed, 14 Nov 2012 15:48:00 +0100 (CET)
Received: from [192.168.178.50]
	(host51-78-dynamic.2-87-r.retail.telecomitalia.it [87.2.78.51])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: prova@fantu.it)
	by lnx3.fantu.it (Postfix) with ESMTPSA id F05C5400843
	for <xen-devel@lists.xen.org>; Wed, 14 Nov 2012 15:47:59 +0100 (CET)
Message-ID: <50A3AF17.4090701@tiscali.it>
Date: Wed, 14 Nov 2012 15:47:51 +0100
From: Fabio Fantoni <fantonifabio@tiscali.it>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] libxl: error:
 libxl_dm.c:1212:device_model_spawn_outcome: domain 1 device model: spawn
 failed (rc=-3) when creating VM using upstream qemu on Xen 4.2.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5406002184902897017=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--===============5406002184902897017==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms050609000509030709090206"

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--------------ms050609000509030709090206
Content-Type: multipart/alternative;
 boundary="------------050301070801080209000902"

This is a multi-part message in MIME format.
--------------050301070801080209000902
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: quoted-printable

> Hello,
>
>
> I've tested Xen 4.2 on CentOS 6.3(x86_x64)
>
> My goal is to connect to Windows VM on Xen 4.2 using SPICE client.
>
>
> Installation of Xen 4.2 was successful.
>
> Also creating Windows VM using qemu-dm and connecting to it using VNC=20
> are OK.
>
> But qemu-dm can't support SPICE, so I installed upstream qemu.=20
> (http://wiki.xen.org/wiki/QEMU_Upstream)=20
> <http://wiki.xen.org/wiki/QEMU_Upstream%29>
>
> I also installed spice-server and spice-protocol as newest version.
>
> Configuration and installation seems like successful. But not work=20
> with error message above.
>
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> [root@localhost xen]# xl -f create Windows2003.cfg
>
> Parsing config from Windows2003.cfg
>
> xc: info: VIRTUAL MEMORY ARRANGEMENT:
>
>   Loader:        0000000000100000->000000000019bae4
>
>   TOTAL:         0000000000000000->000000003c000000
>
>   ENTRY ADDRESS: 0000000000100000
>
> xc: info: PHYSICAL MEMORY ALLOCATION:
>
>   4KB PAGES: 0x0000000000000200
>
>   2MB PAGES: 0x00000000000001df
>
>   1GB PAGES: 0x0000000000000000
>
> libxl: error: libxl_dm.c:1212:device_model_spawn_outcome: domain 1=20
> device model: spawn failed (rc=3D-3)
>
> libxl: error: libxl_qmp.c:641:libxl__qmp_initialize: Connection error: =

> No such file or directory
>
> Daemon running with PID 3912
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
>
> My Windows2003.cfg file is above.
>
>
> builder =3D "hvm"
>
> name =3D "Windows2003"
>
> memory =3D 1024
>
>
>
> vcpus =3D 2
>
> disk =3D [ '/dev/VolGroup/lv_home,,hda',=20
> '/usr/src/Windows2003.iso,,hdc,cdrom' ]
>
>
> # using qemu-dm is success to work.
>
> #device_model=3D'qemu-dm'
>
> device_model_version=3D'qemu-xen'
>
> device_model_override=3D'/usr/src/qemu/i386-softmmu/qemu-system-i386'
>
> #device_model_override=3D'/usr/src/qemu/x86_64-softmmu/qemu-system-x86_=
64'
>
>
> boot=3D"dc"
>
> acpi=3D1
>
> xen_platform_pci=3D1
>
> xiridian=3D1
>
> stdvga=3D1
>
>
> #sdl =3D 1
>
> vnc =3D0
>
> vncconsole=3D0
>
> vncpasswd=3D''
>
> vncunused=3D1
>
> vnclisten=3D'0.0.0.0'
>
> vncdisplay=3D3
>
>
> spice=3D1
>
> spicehost=3D'0.0.0.0'
>
> spiceport=3D6000
>
> spicedisable_ticketing=3D1
>
> spicepasswd =3D 'password'
>
>
>
> Thanks in advance.
>
>
> Daniel.
>
Hi, is also my goal have spice working on xen, is over one year that I'm =

testing it.
Now the main problem for me is a qemu crashes when running spice + qxl.
Start trying build with internal qemu upstream instead of external one=20
(I did the same), see patch below and remove on domU cfg the qemudm=20
override:

diff -r 10feb0933708 -r 2a3a5cf9d593 Config.mk
--- a/Config.mk    lun ott 29 15:08:56 2012 +0100
+++ b/Config.mk    ven nov 02 10:33:55 2012 +0100
@@ -202,12 +202,12 @@
  SEABIOS_UPSTREAM_URL ?=3D http://xenbits.xen.org/git-http/seabios.git
  else
  OVMF_UPSTREAM_URL ?=3D git://xenbits.xen.org/ovmf.git
-QEMU_UPSTREAM_URL ?=3D git://xenbits.xen.org/qemu-upstream-unstable.git
-SEABIOS_UPSTREAM_URL ?=3D git://xenbits.xen.org/seabios.git
+QEMU_UPSTREAM_URL ?=3D git://git.qemu.org/qemu.git
+SEABIOS_UPSTREAM_URL ?=3D git://code.coreboot.org/seabios.git
  endif
  OVMF_UPSTREAM_REVISION ?=3D b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
  QEMU_UPSTREAM_REVISION ?=3D master
-SEABIOS_UPSTREAM_TAG ?=3D rel-1.6.3.2
+SEABIOS_UPSTREAM_TAG ?=3D master
  # Sun Mar 11 09:27:07 2012 -0400
  # Update version to 1.6.3.2

diff -r 10feb0933708 -r 2a3a5cf9d593 tools/Makefile
--- a/tools/Makefile    lun ott 29 15:08:56 2012 +0100
+++ b/tools/Makefile    ven nov 02 10:33:55 2012 +0100
@@ -199,6 +199,7 @@
          --bindir=3D$(LIBEXEC) \
          --datadir=3D$(SHAREDIR)/qemu-xen \
          --disable-kvm \
+        --enable-spice \
          --python=3D$(PYTHON) \
          $(IOEMU_CONFIGURE_CROSS); \
      $(MAKE) all


--------------050301070801080209000902
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

<html>
  <head>

    <meta http-equiv=3D"content-type" content=3D"text/html; charset=3DISO=
-8859-15">
  </head>
  <body bgcolor=3D"#FFFFFF" text=3D"#000000">
    <blockquote type=3D"cite">
      <p>Hello,</p>
      <p><br>
      </p>
      <p>I've tested Xen 4.2 on CentOS 6.3(x86_x64)</p>
      <p>My goal is to connect to Windows VM on Xen 4.2 using SPICE
        client.</p>
      <p><br>
      </p>
      <p>Installation of Xen 4.2 was successful.=A0</p>
      <p>Also creating Windows VM using qemu-dm and connecting to it
        using VNC are OK.</p>
      <p>But qemu-dm can't support SPICE, so I installed upstream qemu.
        (<a rel=3D"nofollow"
          href=3D"http://wiki.xen.org/wiki/QEMU_Upstream%29">http://wiki.=
xen.org/wiki/QEMU_Upstream)</a></p>
      <p>I also installed spice-server and spice-protocol as newest
        version.</p>
      <p>Configuration and installation seems like successful. But not
        work with error message above.</p>
      <p><br>
      </p>
      <p>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</p>
      <p>[root@localhost xen]# xl -f create Windows2003.cfg=A0</p>
      <p>Parsing config from Windows2003.cfg</p>
      <p>xc: info: VIRTUAL MEMORY ARRANGEMENT:</p>
      <p>=A0 Loader: =A0 =A0 =A0 =A00000000000100000-&gt;000000000019bae4=
</p>
      <p>=A0 TOTAL: =A0 =A0 =A0 =A0 0000000000000000-&gt;000000003c000000=
</p>
      <p>=A0 ENTRY ADDRESS: 0000000000100000</p>
      <p>xc: info: PHYSICAL MEMORY ALLOCATION:</p>
      <p>=A0 4KB PAGES: 0x0000000000000200</p>
      <p>=A0 2MB PAGES: 0x00000000000001df</p>
      <p>=A0 1GB PAGES: 0x0000000000000000</p>
      <p>libxl: error: libxl_dm.c:1212:device_model_spawn_outcome:
        domain 1 device model: spawn failed (rc=3D-3)</p>
      <p>libxl: error: libxl_qmp.c:641:libxl__qmp_initialize: Connection
        error: No such file or directory</p>
      <p>Daemon running with PID 3912</p>
      <p>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</p>
      <p><br>
      </p>
      <p>My Windows2003.cfg file is above.</p>
      <p><br>
      </p>
      <p>builder =3D "hvm"</p>
      <p>name =3D "Windows2003"</p>
      <p>memory =3D 1024</p>
      <p><br>
      </p>
      <p><br>
      </p>
      <p>vcpus =3D 2</p>
      <p>disk =3D [ '/dev/VolGroup/lv_home,,hda',
        '/usr/src/Windows2003.iso,,hdc,cdrom' ]</p>
      <p><br>
      </p>
      <p># using qemu-dm is success to work.</p>
      <p>#device_model=3D'qemu-dm'</p>
      <p>device_model_version=3D'qemu-xen'</p>
      <p>device_model_override=3D'/usr/src/qemu/i386-softmmu/qemu-system-=
i386'</p>
      <p>#device_model_override=3D'/usr/src/qemu/x86_64-softmmu/qemu-syst=
em-x86_64'</p>
      <p><br>
      </p>
      <p>boot=3D"dc"</p>
      <p>acpi=3D1</p>
      <p>xen_platform_pci=3D1</p>
      <p>xiridian=3D1</p>
      <p>stdvga=3D1</p>
      <p><br>
      </p>
      <p>#sdl =3D 1</p>
      <p>vnc =3D0</p>
      <p>vncconsole=3D0</p>
      <p>vncpasswd=3D''</p>
      <p>vncunused=3D1</p>
      <p>vnclisten=3D'0.0.0.0'</p>
      <p>vncdisplay=3D3</p>
      <p><br>
      </p>
      <p>spice=3D1</p>
      <p>spicehost=3D'0.0.0.0'</p>
      <p>spiceport=3D6000</p>
      <p>spicedisable_ticketing=3D1</p>
      <p>spicepasswd =3D 'password'</p>
      <p><br>
      </p>
      <p><br>
      </p>
      <p>Thanks in advance.</p>
      <p><br>
      </p>
      <p>Daniel.</p>
    </blockquote>
    Hi, is also my goal have spice working on xen, is over one year that
    I'm testing it.<br>
    Now the main problem for me is a qemu crashes when running spice +
    qxl.<br>
    Start trying build with internal qemu upstream instead of external
    one (I did the same), see patch below and remove on domU cfg the
    qemudm override:<br>
    <br>
    diff -r 10feb0933708 -r 2a3a5cf9d593 Config.mk<br>
    --- a/Config.mk=A0=A0=A0 lun ott 29 15:08:56 2012 +0100<br>
    +++ b/Config.mk=A0=A0=A0 ven nov 02 10:33:55 2012 +0100<br>
    @@ -202,12 +202,12 @@<br>
    =A0SEABIOS_UPSTREAM_URL ?=3D <a class=3D"moz-txt-link-freetext" href=3D=
"http://xenbits.xen.org/git-http/seabios.git">http://xenbits.xen.org/git-=
http/seabios.git</a><br>
    =A0else<br>
    =A0OVMF_UPSTREAM_URL ?=3D git://xenbits.xen.org/ovmf.git<br>
    -QEMU_UPSTREAM_URL ?=3D
    git://xenbits.xen.org/qemu-upstream-unstable.git<br>
    -SEABIOS_UPSTREAM_URL ?=3D git://xenbits.xen.org/seabios.git<br>
    +QEMU_UPSTREAM_URL ?=3D git://git.qemu.org/qemu.git<br>
    +SEABIOS_UPSTREAM_URL ?=3D git://code.coreboot.org/seabios.git<br>
    =A0endif<br>
    =A0OVMF_UPSTREAM_REVISION ?=3D b0855f925c6e2e0b21fbb03fab4b5fb5b68768=
71<br>
    =A0QEMU_UPSTREAM_REVISION ?=3D master<br>
    -SEABIOS_UPSTREAM_TAG ?=3D rel-1.6.3.2<br>
    +SEABIOS_UPSTREAM_TAG ?=3D master<br>
    =A0# Sun Mar 11 09:27:07 2012 -0400<br>
    =A0# Update version to 1.6.3.2<br>
    =A0<br>
    diff -r 10feb0933708 -r 2a3a5cf9d593 tools/Makefile<br>
    --- a/tools/Makefile=A0=A0=A0 lun ott 29 15:08:56 2012 +0100<br>
    +++ b/tools/Makefile=A0=A0=A0 ven nov 02 10:33:55 2012 +0100<br>
    @@ -199,6 +199,7 @@<br>
    =A0=A0=A0=A0 =A0=A0=A0 --bindir=3D$(LIBEXEC) \<br>
    =A0=A0=A0=A0 =A0=A0=A0 --datadir=3D$(SHAREDIR)/qemu-xen \<br>
    =A0=A0=A0=A0 =A0=A0=A0 --disable-kvm \<br>
    +=A0=A0=A0 =A0=A0=A0 --enable-spice \<br>
    =A0=A0=A0=A0 =A0=A0=A0 --python=3D$(PYTHON) \<br>
    =A0=A0=A0=A0 =A0=A0=A0 $(IOEMU_CONFIGURE_CROSS); \<br>
    =A0=A0=A0=A0 $(MAKE) all<br>
    <br>
  </body>
</html>

--------------050301070801080209000902--

--------------ms050609000509030709090206
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: Firma crittografica S/MIME

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIINhjCC
BjQwggQcoAMCAQICASAwDQYJKoZIhvcNAQEFBQAwfTELMAkGA1UEBhMCSUwxFjAUBgNVBAoT
DVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmlj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Ew1TdGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRhbCBDZXJ0aWZpY2F0
ZSBTaWduaW5nMTgwNgYDVQQDEy9TdGFydENvbSBDbGFzcyAyIFByaW1hcnkgSW50ZXJtZWRp
YXRlIENsaWVudCBDQQICHmMwDQYJKoZIhvcNAQEBBQAEggEAc+2rfxjq+eisa1hc1Tleqewr
KrABCJF/l3PL8E8urnj5e7Q1SP1vLbwyAzRo+dvjciJlHPReHTb5RjynD66qJ2zZA+g/U/R/
Fpb+xikjb9VlK3n86eev/GXgcjsCzEYwrcGmNWIVKXFyyxkSQwM9+hIOxNw3B3vvU6+AOMx/
VrwfgFani3uZ1sIMJaU1j4MmP1XuNQWkq6Olo5t26eDSoSph9Orsuy56lUyrhWQZiM+EIn3u
1um9CvU9mJ05BMkUjQdAw5F2cfY01RmGov6SqFUVfmXsXX0GFQIYF3+8TbvIfEegwQJTH+ST
Z/h+kSQQBgh1vis2oa4KI4pndPxdiAAAAAAAAA==
--------------ms050609000509030709090206--


--===============5406002184902897017==
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.xen.org
http://lists.xen.org/xen-devel

--===============5406002184902897017==--


From xen-devel-bounces@lists.xen.org Wed Nov 14 14:55:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 14:55:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYeN0-0002Ii-AK; Wed, 14 Nov 2012 14:55:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TYeMz-0002Ic-EA
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 14:55:13 +0000
Received: from [85.158.138.51:21892] by server-11.bemta-3.messagelabs.com id
	9E/FC-19361-0D0B3A05; Wed, 14 Nov 2012 14:55:12 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1352904910!30002347!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODYyNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28782 invoked from network); 14 Nov 2012 14:55:12 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 14:55:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,250,1352073600"; d="scan'208";a="214477825"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	14 Nov 2012 14:48:26 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL03.citrite.net
	(10.13.107.80) with Microsoft SMTP Server id 14.2.318.1;
	Wed, 14 Nov 2012 09:48:25 -0500
Message-ID: <50A3AF39.3050107@citrix.com>
Date: Wed, 14 Nov 2012 14:48:25 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <121149b56ff3ce2fa58c8a539828fe3b@helkyn.dyndns.org>
In-Reply-To: <121149b56ff3ce2fa58c8a539828fe3b@helkyn.dyndns.org>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] Image format for an HVM domain
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 14/11/12 14:31, Jean-Yves Migeon (NetBSD) wrote:
> Hi list,
>
> Is there a documentation somewhere where the image format for
> xc_domain_save/_restore is specified, or at least described?
I'm not aware of anything besides the source code itself.
libxc/xc_domain_restore, particularly apply_batch and pagebuf_get_one 
are fairly straight forward.

>
> I am looking for one regarding an HVM domU, but can't find any in the
> wiki -- Most notably, I am interested in knowing how the P2M translation
> tables are dumped, in case they are differences from the one for a PV
> domU. Purpose is to add its support to our NetBSD crash(8) program.
>
The main differences between pv and hvm can be found by searching for 
"hvm", such as:
      region_mfn[i] = hvm ? pfn : ctx->p2m[pfn];

Obviously, xc_domain_save is what produces the output, and will also 
contain the corresponding "if (hvm)" and "if (!hvm)" type of 
constructions to do things that only happen in PV or HVM guests.

The actual content format is the same, the difference is derived from 
"is this PV or HVM".

--
Mats
>
> Cheers,
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 14:55:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 14:55:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYeN0-0002Ii-AK; Wed, 14 Nov 2012 14:55:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TYeMz-0002Ic-EA
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 14:55:13 +0000
Received: from [85.158.138.51:21892] by server-11.bemta-3.messagelabs.com id
	9E/FC-19361-0D0B3A05; Wed, 14 Nov 2012 14:55:12 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1352904910!30002347!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODYyNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28782 invoked from network); 14 Nov 2012 14:55:12 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 14:55:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,250,1352073600"; d="scan'208";a="214477825"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	14 Nov 2012 14:48:26 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL03.citrite.net
	(10.13.107.80) with Microsoft SMTP Server id 14.2.318.1;
	Wed, 14 Nov 2012 09:48:25 -0500
Message-ID: <50A3AF39.3050107@citrix.com>
Date: Wed, 14 Nov 2012 14:48:25 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <121149b56ff3ce2fa58c8a539828fe3b@helkyn.dyndns.org>
In-Reply-To: <121149b56ff3ce2fa58c8a539828fe3b@helkyn.dyndns.org>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] Image format for an HVM domain
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 14/11/12 14:31, Jean-Yves Migeon (NetBSD) wrote:
> Hi list,
>
> Is there a documentation somewhere where the image format for
> xc_domain_save/_restore is specified, or at least described?
I'm not aware of anything besides the source code itself.
libxc/xc_domain_restore, particularly apply_batch and pagebuf_get_one 
are fairly straight forward.

>
> I am looking for one regarding an HVM domU, but can't find any in the
> wiki -- Most notably, I am interested in knowing how the P2M translation
> tables are dumped, in case they are differences from the one for a PV
> domU. Purpose is to add its support to our NetBSD crash(8) program.
>
The main differences between pv and hvm can be found by searching for 
"hvm", such as:
      region_mfn[i] = hvm ? pfn : ctx->p2m[pfn];

Obviously, xc_domain_save is what produces the output, and will also 
contain the corresponding "if (hvm)" and "if (!hvm)" type of 
constructions to do things that only happen in PV or HVM guests.

The actual content format is the same, the difference is derived from 
"is this PV or HVM".

--
Mats
>
> Cheers,
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 15:03:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 15:03:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYeUk-0004R8-9Y; Wed, 14 Nov 2012 15:03:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TYeUi-0004R1-KS
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 15:03:12 +0000
Received: from [85.158.143.35:45397] by server-3.bemta-4.messagelabs.com id
	48/DA-06841-FA2B3A05; Wed, 14 Nov 2012 15:03:11 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-13.tower-21.messagelabs.com!1352905390!17070387!1
X-Originating-IP: [81.169.146.176]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NiA9PiAyNjI2Nw==\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NiA9PiAyNjI2Nw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26141 invoked from network); 14 Nov 2012 15:03:11 -0000
Received: from mo-p04-ob.rzone.de (HELO mo-p04-ob.rzone.de) (81.169.146.176)
	by server-13.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 15:03:11 -0000
X-RZG-CLASS-ID: mo04
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmxtMZ80VwmRNV69z6
Received: from probook.site (ip-80-226-24-14.vodafone-net.de [80.226.24.14])
	by smtp.strato.de (jorabe mo24) (RZmta 31.3 SBL|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id v038eeoAEEedGC ;
	Wed, 14 Nov 2012 16:03:09 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id B1789189BA; Wed, 14 Nov 2012 16:03:07 +0100 (CET)
Date: Wed, 14 Nov 2012 16:03:07 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121114150307.GA17986@aepfle.de>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352803755.7491.47.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 13, Ian Campbell wrote:

> On Thu, 2012-11-01 at 20:35 +0000, Matthew Fioravante wrote:
> > Remove the old vtpm process model. It doesn't work very
> > well and is no longer supported.
> > 
> > Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>


configure still has --enable/disable-vtpm, I think that has to be
removed as well. The resulting VTPM_TOOLS variable is appearently not
used anymore.

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 15:03:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 15:03:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYeUk-0004R8-9Y; Wed, 14 Nov 2012 15:03:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TYeUi-0004R1-KS
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 15:03:12 +0000
Received: from [85.158.143.35:45397] by server-3.bemta-4.messagelabs.com id
	48/DA-06841-FA2B3A05; Wed, 14 Nov 2012 15:03:11 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-13.tower-21.messagelabs.com!1352905390!17070387!1
X-Originating-IP: [81.169.146.176]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NiA9PiAyNjI2Nw==\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3NiA9PiAyNjI2Nw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26141 invoked from network); 14 Nov 2012 15:03:11 -0000
Received: from mo-p04-ob.rzone.de (HELO mo-p04-ob.rzone.de) (81.169.146.176)
	by server-13.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 15:03:11 -0000
X-RZG-CLASS-ID: mo04
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmxtMZ80VwmRNV69z6
Received: from probook.site (ip-80-226-24-14.vodafone-net.de [80.226.24.14])
	by smtp.strato.de (jorabe mo24) (RZmta 31.3 SBL|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id v038eeoAEEedGC ;
	Wed, 14 Nov 2012 16:03:09 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id B1789189BA; Wed, 14 Nov 2012 16:03:07 +0100 (CET)
Date: Wed, 14 Nov 2012 16:03:07 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121114150307.GA17986@aepfle.de>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352803755.7491.47.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 13, Ian Campbell wrote:

> On Thu, 2012-11-01 at 20:35 +0000, Matthew Fioravante wrote:
> > Remove the old vtpm process model. It doesn't work very
> > well and is no longer supported.
> > 
> > Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>


configure still has --enable/disable-vtpm, I think that has to be
removed as well. The resulting VTPM_TOOLS variable is appearently not
used anymore.

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 15:27:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 15:27:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYerc-00054S-9Z; Wed, 14 Nov 2012 15:26:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TYera-00054M-Tk
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 15:26:51 +0000
Received: from [85.158.138.51:4437] by server-11.bemta-3.messagelabs.com id
	DD/61-19361-A38B3A05; Wed, 14 Nov 2012 15:26:50 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-12.tower-174.messagelabs.com!1352906808!22089382!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29964 invoked from network); 14 Nov 2012 15:26:49 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-12.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 14 Nov 2012 15:26:49 -0000
Received: from ([128.244.198.90])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157323002;
	Wed, 14 Nov 2012 10:26:16 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas1.dom1.jhuapl.edu ([128.244.198.90]) with mapi; Wed, 14 Nov 2012
	10:26:16 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Olaf Hering <olaf@aepfle.de>
Date: Wed, 14 Nov 2012 10:26:16 -0500
Thread-Topic: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
Thread-Index: Ac3CeSTjX849cfi7Q3yEjFv5iG2usQAAx0bw
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48A23D7F7E@aplesstripe.dom1.jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
	<20121114150307.GA17986@aepfle.de>
In-Reply-To: <20121114150307.GA17986@aepfle.de>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--enable-vtpm is no longer used and the patch takes it out of configure.ac.

Do you want me to run autoreconf on my system or do you guys prefer to do that yourselves on your own build machines?

-----Original Message-----
From: Olaf Hering [mailto:olaf@aepfle.de] 
Sent: Wednesday, November 14, 2012 10:03 AM
To: Fioravante, Matthew E.
Cc: Ian Campbell; Stefano Stabellini; xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model

On Tue, Nov 13, Ian Campbell wrote:

> On Thu, 2012-11-01 at 20:35 +0000, Matthew Fioravante wrote:
> > Remove the old vtpm process model. It doesn't work very well and is 
> > no longer supported.
> > 
> > Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>


configure still has --enable/disable-vtpm, I think that has to be removed as well. The resulting VTPM_TOOLS variable is appearently not used anymore.

Olaf
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 15:27:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 15:27:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYerc-00054S-9Z; Wed, 14 Nov 2012 15:26:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TYera-00054M-Tk
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 15:26:51 +0000
Received: from [85.158.138.51:4437] by server-11.bemta-3.messagelabs.com id
	DD/61-19361-A38B3A05; Wed, 14 Nov 2012 15:26:50 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-12.tower-174.messagelabs.com!1352906808!22089382!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29964 invoked from network); 14 Nov 2012 15:26:49 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-12.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 14 Nov 2012 15:26:49 -0000
Received: from ([128.244.198.90])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157323002;
	Wed, 14 Nov 2012 10:26:16 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas1.dom1.jhuapl.edu ([128.244.198.90]) with mapi; Wed, 14 Nov 2012
	10:26:16 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Olaf Hering <olaf@aepfle.de>
Date: Wed, 14 Nov 2012 10:26:16 -0500
Thread-Topic: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
Thread-Index: Ac3CeSTjX849cfi7Q3yEjFv5iG2usQAAx0bw
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48A23D7F7E@aplesstripe.dom1.jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
	<20121114150307.GA17986@aepfle.de>
In-Reply-To: <20121114150307.GA17986@aepfle.de>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--enable-vtpm is no longer used and the patch takes it out of configure.ac.

Do you want me to run autoreconf on my system or do you guys prefer to do that yourselves on your own build machines?

-----Original Message-----
From: Olaf Hering [mailto:olaf@aepfle.de] 
Sent: Wednesday, November 14, 2012 10:03 AM
To: Fioravante, Matthew E.
Cc: Ian Campbell; Stefano Stabellini; xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model

On Tue, Nov 13, Ian Campbell wrote:

> On Thu, 2012-11-01 at 20:35 +0000, Matthew Fioravante wrote:
> > Remove the old vtpm process model. It doesn't work very well and is 
> > no longer supported.
> > 
> > Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>


configure still has --enable/disable-vtpm, I think that has to be removed as well. The resulting VTPM_TOOLS variable is appearently not used anymore.

Olaf
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 15:55:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 15:55:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYfJH-0005k0-S0; Wed, 14 Nov 2012 15:55:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TYfJH-0005jv-8b
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 15:55:27 +0000
Received: from [85.158.139.83:65482] by server-9.bemta-5.messagelabs.com id
	53/50-29295-EEEB3A05; Wed, 14 Nov 2012 15:55:26 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1352908524!27891359!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM1NjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20923 invoked from network); 14 Nov 2012 15:55:25 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-10.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 15:55:25 -0000
X-IronPort-AV: E=Sophos;i="4.83,251,1352073600"; d="scan'208";a="44578795"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 15:55:05 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 14 Nov 2012 10:55:05 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TYfIu-0004zJ-Sr;
	Wed, 14 Nov 2012 15:55:04 +0000
MIME-Version: 1.0
X-Mercurial-Node: f3adcb7d84eaa557fb127a219bf50cf0bf4e8887
Message-ID: <f3adcb7d84eaa557fb12.1352908504@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Wed, 14 Nov 2012 15:55:04 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH] x86/nmi: self_nmi() should not unconditionally
 enable interrupts
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

It seems that all current callers have interrupts enabled, making the
code currently safe but dangerous.  Also, fix a trailing whitespace issue.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 8b93ac0c93f3 -r f3adcb7d84ea xen/arch/x86/nmi.c
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -482,13 +482,14 @@ void nmi_watchdog_tick(struct cpu_user_r
  * 8-3 and 8-4 in IA32 Reference Manual Volume 3. We send the IPI to
  * our own APIC ID explicitly which is valid.
  */
-void self_nmi(void) 
+void self_nmi(void)
 {
+    unsigned long flags;
     u32 id = get_apic_id();
-    local_irq_disable();
+    local_irq_save(flags);
     apic_wait_icr_idle();
     apic_icr_write(APIC_DM_NMI | APIC_DEST_PHYSICAL, id);
-    local_irq_enable();
+    local_irq_restore(flags);
 }
 
 static void do_nmi_trigger(unsigned char key)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 15:55:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 15:55:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYfJH-0005k0-S0; Wed, 14 Nov 2012 15:55:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TYfJH-0005jv-8b
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 15:55:27 +0000
Received: from [85.158.139.83:65482] by server-9.bemta-5.messagelabs.com id
	53/50-29295-EEEB3A05; Wed, 14 Nov 2012 15:55:26 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1352908524!27891359!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM1NjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20923 invoked from network); 14 Nov 2012 15:55:25 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-10.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 15:55:25 -0000
X-IronPort-AV: E=Sophos;i="4.83,251,1352073600"; d="scan'208";a="44578795"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 15:55:05 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 14 Nov 2012 10:55:05 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TYfIu-0004zJ-Sr;
	Wed, 14 Nov 2012 15:55:04 +0000
MIME-Version: 1.0
X-Mercurial-Node: f3adcb7d84eaa557fb127a219bf50cf0bf4e8887
Message-ID: <f3adcb7d84eaa557fb12.1352908504@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Wed, 14 Nov 2012 15:55:04 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH] x86/nmi: self_nmi() should not unconditionally
 enable interrupts
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

It seems that all current callers have interrupts enabled, making the
code currently safe but dangerous.  Also, fix a trailing whitespace issue.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 8b93ac0c93f3 -r f3adcb7d84ea xen/arch/x86/nmi.c
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -482,13 +482,14 @@ void nmi_watchdog_tick(struct cpu_user_r
  * 8-3 and 8-4 in IA32 Reference Manual Volume 3. We send the IPI to
  * our own APIC ID explicitly which is valid.
  */
-void self_nmi(void) 
+void self_nmi(void)
 {
+    unsigned long flags;
     u32 id = get_apic_id();
-    local_irq_disable();
+    local_irq_save(flags);
     apic_wait_icr_idle();
     apic_icr_write(APIC_DM_NMI | APIC_DEST_PHYSICAL, id);
-    local_irq_enable();
+    local_irq_restore(flags);
 }
 
 static void do_nmi_trigger(unsigned char key)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 15:55:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 15:55:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYfJU-0005kY-8c; Wed, 14 Nov 2012 15:55:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TYfJS-0005kQ-IP
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 15:55:38 +0000
Received: from [85.158.143.35:13248] by server-2.bemta-4.messagelabs.com id
	8B/4B-28922-9FEB3A05; Wed, 14 Nov 2012 15:55:37 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-14.tower-21.messagelabs.com!1352908535!17777867!1
X-Originating-IP: [81.169.146.178]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3OCA9PiAyNjM1NA==\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3OCA9PiAyNjM1NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24115 invoked from network); 14 Nov 2012 15:55:36 -0000
Received: from mo-p04-ob.rzone.de (HELO mo-p04-ob.rzone.de) (81.169.146.178)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 15:55:36 -0000
X-RZG-CLASS-ID: mo04
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmxtMZ80VwmRNV69z6
Received: from probook.site (ip-80-226-24-14.vodafone-net.de [80.226.24.14])
	by smtp.strato.de (josoe mo49) (RZmta 31.3 SBL|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id Y07466oAEEiGX4 ;
	Wed, 14 Nov 2012 16:55:34 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 90106189BA; Wed, 14 Nov 2012 16:55:32 +0100 (CET)
Date: Wed, 14 Nov 2012 16:55:32 +0100
From: Olaf Hering <olaf@aepfle.de>
To: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
Message-ID: <20121114155532.GA26411@aepfle.de>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
	<20121114150307.GA17986@aepfle.de>
	<068F06DC4D106941B297C0C5F9F446EA48A23D7F7E@aplesstripe.dom1.jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48A23D7F7E@aplesstripe.dom1.jhuapl.edu>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 14, Fioravante, Matthew E. wrote:

> --enable-vtpm is no longer used and the patch takes it out of configure.ac.

Oh, I noticed this just now that its gone from configure.ac. It will
automatically disappear after the next rerun of autotools.

So that leaves only the VTPM_TOOLS variable.

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 15:55:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 15:55:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYfJU-0005kY-8c; Wed, 14 Nov 2012 15:55:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TYfJS-0005kQ-IP
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 15:55:38 +0000
Received: from [85.158.143.35:13248] by server-2.bemta-4.messagelabs.com id
	8B/4B-28922-9FEB3A05; Wed, 14 Nov 2012 15:55:37 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-14.tower-21.messagelabs.com!1352908535!17777867!1
X-Originating-IP: [81.169.146.178]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3OCA9PiAyNjM1NA==\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE3OCA9PiAyNjM1NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24115 invoked from network); 14 Nov 2012 15:55:36 -0000
Received: from mo-p04-ob.rzone.de (HELO mo-p04-ob.rzone.de) (81.169.146.178)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 15:55:36 -0000
X-RZG-CLASS-ID: mo04
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmxtMZ80VwmRNV69z6
Received: from probook.site (ip-80-226-24-14.vodafone-net.de [80.226.24.14])
	by smtp.strato.de (josoe mo49) (RZmta 31.3 SBL|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id Y07466oAEEiGX4 ;
	Wed, 14 Nov 2012 16:55:34 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 90106189BA; Wed, 14 Nov 2012 16:55:32 +0100 (CET)
Date: Wed, 14 Nov 2012 16:55:32 +0100
From: Olaf Hering <olaf@aepfle.de>
To: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
Message-ID: <20121114155532.GA26411@aepfle.de>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
	<20121114150307.GA17986@aepfle.de>
	<068F06DC4D106941B297C0C5F9F446EA48A23D7F7E@aplesstripe.dom1.jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48A23D7F7E@aplesstripe.dom1.jhuapl.edu>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 14, Fioravante, Matthew E. wrote:

> --enable-vtpm is no longer used and the patch takes it out of configure.ac.

Oh, I noticed this just now that its gone from configure.ac. It will
automatically disappear after the next rerun of autotools.

So that leaves only the VTPM_TOOLS variable.

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 16:04:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 16:04:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYfRH-0006ak-8H; Wed, 14 Nov 2012 16:03:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYfRG-0006af-8e
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 16:03:42 +0000
Received: from [85.158.143.99:30185] by server-3.bemta-4.messagelabs.com id
	DB/CE-06841-DD0C3A05; Wed, 14 Nov 2012 16:03:41 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352909013!29361585!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17872 invoked from network); 14 Nov 2012 16:03:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 16:03:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,251,1352073600"; d="scan'208";a="15807589"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 16:02:57 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 14 Nov 2012 16:02:57 +0000
Message-ID: <1352908976.3499.19.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Mats Petersson <mats.petersson@citrix.com>
Date: Wed, 14 Nov 2012 16:02:56 +0000
In-Reply-To: <50A3AF39.3050107@citrix.com>
References: <121149b56ff3ce2fa58c8a539828fe3b@helkyn.dyndns.org>
	<50A3AF39.3050107@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Image format for an HVM domain
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-14 at 14:48 +0000, Mats Petersson wrote:
> On 14/11/12 14:31, Jean-Yves Migeon (NetBSD) wrote:
> > Hi list,
> >
> > Is there a documentation somewhere where the image format for
> > xc_domain_save/_restore is specified, or at least described?
> I'm not aware of anything besides the source code itself.

tools/libxc/xg_save_restore.h has something of a protocol doc at the
top.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 16:04:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 16:04:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYfRH-0006ak-8H; Wed, 14 Nov 2012 16:03:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYfRG-0006af-8e
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 16:03:42 +0000
Received: from [85.158.143.99:30185] by server-3.bemta-4.messagelabs.com id
	DB/CE-06841-DD0C3A05; Wed, 14 Nov 2012 16:03:41 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352909013!29361585!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17872 invoked from network); 14 Nov 2012 16:03:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 16:03:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,251,1352073600"; d="scan'208";a="15807589"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 16:02:57 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 14 Nov 2012 16:02:57 +0000
Message-ID: <1352908976.3499.19.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Mats Petersson <mats.petersson@citrix.com>
Date: Wed, 14 Nov 2012 16:02:56 +0000
In-Reply-To: <50A3AF39.3050107@citrix.com>
References: <121149b56ff3ce2fa58c8a539828fe3b@helkyn.dyndns.org>
	<50A3AF39.3050107@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Image format for an HVM domain
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-14 at 14:48 +0000, Mats Petersson wrote:
> On 14/11/12 14:31, Jean-Yves Migeon (NetBSD) wrote:
> > Hi list,
> >
> > Is there a documentation somewhere where the image format for
> > xc_domain_save/_restore is specified, or at least described?
> I'm not aware of anything besides the source code itself.

tools/libxc/xg_save_restore.h has something of a protocol doc at the
top.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 16:05:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 16:05:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYfSb-0006ej-OS; Wed, 14 Nov 2012 16:05:05 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYfSZ-0006eY-LJ
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 16:05:03 +0000
Received: from [85.158.143.99:15482] by server-1.bemta-4.messagelabs.com id
	17/6F-27934-E21C3A05; Wed, 14 Nov 2012 16:05:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1352909101!22403002!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19351 invoked from network); 14 Nov 2012 16:05:02 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 16:05:02 -0000
X-IronPort-AV: E=Sophos;i="4.83,251,1352073600"; d="scan'208";a="15807686"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 16:05:01 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 14 Nov 2012 16:05:00 +0000
Message-ID: <1352909100.3499.20.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
Date: Wed, 14 Nov 2012 16:05:00 +0000
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48A23D7F7E@aplesstripe.dom1.jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
	<20121114150307.GA17986@aepfle.de>
	<068F06DC4D106941B297C0C5F9F446EA48A23D7F7E@aplesstripe.dom1.jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-14 at 15:26 +0000, Fioravante, Matthew E. wrote:
> --enable-vtpm is no longer used and the patch takes it out of
> configure.ac.
> 
> Do you want me to run autoreconf on my system or do you guys prefer to
> do that yourselves on your own build machines?

We will rerun it but it is useful to call out the need to do so in the
commit message, otherwise it'll get forgotten / overlooked.

Which I think is what happened here? Should I rerun autogen then?

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 16:05:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 16:05:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYfSb-0006ej-OS; Wed, 14 Nov 2012 16:05:05 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYfSZ-0006eY-LJ
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 16:05:03 +0000
Received: from [85.158.143.99:15482] by server-1.bemta-4.messagelabs.com id
	17/6F-27934-E21C3A05; Wed, 14 Nov 2012 16:05:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1352909101!22403002!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19351 invoked from network); 14 Nov 2012 16:05:02 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 16:05:02 -0000
X-IronPort-AV: E=Sophos;i="4.83,251,1352073600"; d="scan'208";a="15807686"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 16:05:01 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 14 Nov 2012 16:05:00 +0000
Message-ID: <1352909100.3499.20.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
Date: Wed, 14 Nov 2012 16:05:00 +0000
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48A23D7F7E@aplesstripe.dom1.jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
	<20121114150307.GA17986@aepfle.de>
	<068F06DC4D106941B297C0C5F9F446EA48A23D7F7E@aplesstripe.dom1.jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-14 at 15:26 +0000, Fioravante, Matthew E. wrote:
> --enable-vtpm is no longer used and the patch takes it out of
> configure.ac.
> 
> Do you want me to run autoreconf on my system or do you guys prefer to
> do that yourselves on your own build machines?

We will rerun it but it is useful to call out the need to do so in the
commit message, otherwise it'll get forgotten / overlooked.

Which I think is what happened here? Should I rerun autogen then?

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 16:25:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 16:25:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYfmJ-0007Eq-Jk; Wed, 14 Nov 2012 16:25:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TYfmI-0007El-U1
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 16:25:27 +0000
Received: from [85.158.143.35:41651] by server-3.bemta-4.messagelabs.com id
	E8/1F-06841-6F5C3A05; Wed, 14 Nov 2012 16:25:26 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352910318!13582614!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19471 invoked from network); 14 Nov 2012 16:25:22 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 16:25:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,251,1352073600"; d="scan'208";a="15808562"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 16:25:11 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Wed, 14 Nov 2012
	16:25:10 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>, Paolo Bonzini
	<pbonzini@redhat.com>
Date: Wed, 14 Nov 2012 16:25:11 +0000
Thread-Topic: [PATCH] block: vpc support for ~2 TB disks
Thread-Index: Ac3BjZmzE55vBM6zTVeoUqO3ZJzMRQA9mE/w
Message-ID: <4B45B535F7F6BE4CB1C044ED5115CDDE012D550D234B@LONPMAILBOX01.citrite.net>
References: <50A0E79F0200009100082E4C@novprvoes0310.provo.novell.com>
	<50A2250A.4070108@redhat.com>
	<alpine.DEB.2.02.1211131054200.28049@kaball.uk.xensource.com>
In-Reply-To: <alpine.DEB.2.02.1211131054200.28049@kaball.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: Charles Arnold <carnold@suse.com>, Kevin Wolf <kwolf@redhat.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"stefanha@redhat.com" <stefanha@redhat.com>
Subject: Re: [Xen-devel] [PATCH] block: vpc support for ~2 TB disks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

We don't use qemu's VHD driver in XenServer. Instead, we use blktap2 to create a block device in dom0 serving the VHD file in question, and have qemu open that block device instead of the VHD file itself.

> -----Original Message-----
> From: Stefano Stabellini [mailto:stefano.stabellini@eu.citrix.com]
> Sent: 13 November 2012 10:56
> To: Paolo Bonzini
> Cc: Charles Arnold; qemu-devel@nongnu.org; Kevin Wolf;
> stefanha@redhat.com; Stefano Stabellini; xen-devel@lists.xensource.com;
> Thanos Makatos
> Subject: Re: [PATCH] block: vpc support for ~2 TB disks
> 
> On Tue, 13 Nov 2012, Paolo Bonzini wrote:
> > Il 12/11/2012 20:12, Charles Arnold ha scritto:
> > > Ping?
> > >
> > > Any thoughts on whether this is acceptable?
> >
> > I would like to know what is done by other platforms.  Stefano, any
> > idea about XenServer?
> >
> 
> I am not sure, but maybe Thanos, that is working on blktap3, knows, or
> at least knows who to CC.
> 
> 
> 
> > > - Charles
> > >
> > >>>> On 10/30/2012 at 08:59 PM, in message
> > >>>> <50A0E561.5B74.0091.0@suse.com>, Charles
> > > Arnold wrote:
> > >> The VHD specification allows for up to a 2 TB disk size. The
> > >> current implementation in qemu emulates EIDE and ATA-2 hardware
> > >> which only allows for up to 127 GB.  This disk size limitation can
> > >> be overridden by allowing up to 255 heads instead of the normal 4
> > >> bit limitation of 16.  Doing so allows disk images to be created
> of
> > >> up to nearly 2 TB.  This change does not violate the VHD format
> > >> specification nor does it change how smaller disks (ie, <=127GB)
> are defined.
> > >>
> > >> Signed-off-by: Charles Arnold <carnold@suse.com>
> > >>
> > >> diff --git a/block/vpc.c b/block/vpc.c index b6bf52f..0c2eaf8
> > >> 100644
> > >> --- a/block/vpc.c
> > >> +++ b/block/vpc.c
> > >> @@ -198,7 +198,8 @@ static int vpc_open(BlockDriverState *bs, int
> flags)
> > >>      bs->total_sectors = (int64_t)
> > >>          be16_to_cpu(footer->cyls) * footer->heads *
> > >> footer->secs_per_cyl;
> > >>
> > >> -    if (bs->total_sectors >= 65535 * 16 * 255) {
> > >> +    /* Allow a maximum disk size of approximately 2 TB */
> > >> +    if (bs->total_sectors >= 65535LL * 255 * 255)
> > >> + {qemu-devel@nongnu.org
> > >>          err = -EFBIG;
> > >>          goto fail;
> > >>      }
> > >> @@ -524,19 +525,27 @@ static coroutine_fn int
> > >> vpc_co_write(BlockDriverState *bs, int64_t sector_num,
> > >>   * Note that the geometry doesn't always exactly match
> total_sectors but
> > >>   * may round it down.
> > >>   *
> > >> - * Returns 0 on success, -EFBIG if the size is larger than 127 GB
> > >> + * Returns 0 on success, -EFBIG if the size is larger than ~2 TB.
> > >> + Override
> > >> + * the hardware EIDE and ATA-2 limit of 16 heads (max disk size
> of
> > >> + 127 GB)
> > >> + * and instead allow up to 255 heads.
> > >>   */
> > >>  static int calculate_geometry(int64_t total_sectors, uint16_t*
> cyls,
> > >>      uint8_t* heads, uint8_t* secs_per_cyl)  {
> > >>      uint32_t cyls_times_heads;
> > >>
> > >> -    if (total_sectors > 65535 * 16 * 255)
> > >> +    /* Allow a maximum disk size of approximately 2 TB */
> > >> +    if (total_sectors > 65535LL * 255 * 255) {
> > >>          return -EFBIG;
> > >> +    }
> > >>
> > >>      if (total_sectors > 65535 * 16 * 63) {
> > >>          *secs_per_cyl = 255;
> > >> -        *heads = 16;
> > >> +        if (total_sectors > 65535 * 16 * 255) {
> > >> +            *heads = 255;
> > >> +        } else {
> > >> +            *heads = 16;
> > >> +        }
> > >>          cyls_times_heads = total_sectors / *secs_per_cyl;
> > >>      } else {
> > >>          *secs_per_cyl = 17;
> > >
> > >
> > >
> > >
> >

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 16:25:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 16:25:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYfmJ-0007Eq-Jk; Wed, 14 Nov 2012 16:25:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TYfmI-0007El-U1
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 16:25:27 +0000
Received: from [85.158.143.35:41651] by server-3.bemta-4.messagelabs.com id
	E8/1F-06841-6F5C3A05; Wed, 14 Nov 2012 16:25:26 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352910318!13582614!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19471 invoked from network); 14 Nov 2012 16:25:22 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 16:25:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,251,1352073600"; d="scan'208";a="15808562"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 16:25:11 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Wed, 14 Nov 2012
	16:25:10 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>, Paolo Bonzini
	<pbonzini@redhat.com>
Date: Wed, 14 Nov 2012 16:25:11 +0000
Thread-Topic: [PATCH] block: vpc support for ~2 TB disks
Thread-Index: Ac3BjZmzE55vBM6zTVeoUqO3ZJzMRQA9mE/w
Message-ID: <4B45B535F7F6BE4CB1C044ED5115CDDE012D550D234B@LONPMAILBOX01.citrite.net>
References: <50A0E79F0200009100082E4C@novprvoes0310.provo.novell.com>
	<50A2250A.4070108@redhat.com>
	<alpine.DEB.2.02.1211131054200.28049@kaball.uk.xensource.com>
In-Reply-To: <alpine.DEB.2.02.1211131054200.28049@kaball.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: Charles Arnold <carnold@suse.com>, Kevin Wolf <kwolf@redhat.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"stefanha@redhat.com" <stefanha@redhat.com>
Subject: Re: [Xen-devel] [PATCH] block: vpc support for ~2 TB disks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

We don't use qemu's VHD driver in XenServer. Instead, we use blktap2 to create a block device in dom0 serving the VHD file in question, and have qemu open that block device instead of the VHD file itself.

> -----Original Message-----
> From: Stefano Stabellini [mailto:stefano.stabellini@eu.citrix.com]
> Sent: 13 November 2012 10:56
> To: Paolo Bonzini
> Cc: Charles Arnold; qemu-devel@nongnu.org; Kevin Wolf;
> stefanha@redhat.com; Stefano Stabellini; xen-devel@lists.xensource.com;
> Thanos Makatos
> Subject: Re: [PATCH] block: vpc support for ~2 TB disks
> 
> On Tue, 13 Nov 2012, Paolo Bonzini wrote:
> > Il 12/11/2012 20:12, Charles Arnold ha scritto:
> > > Ping?
> > >
> > > Any thoughts on whether this is acceptable?
> >
> > I would like to know what is done by other platforms.  Stefano, any
> > idea about XenServer?
> >
> 
> I am not sure, but maybe Thanos, that is working on blktap3, knows, or
> at least knows who to CC.
> 
> 
> 
> > > - Charles
> > >
> > >>>> On 10/30/2012 at 08:59 PM, in message
> > >>>> <50A0E561.5B74.0091.0@suse.com>, Charles
> > > Arnold wrote:
> > >> The VHD specification allows for up to a 2 TB disk size. The
> > >> current implementation in qemu emulates EIDE and ATA-2 hardware
> > >> which only allows for up to 127 GB.  This disk size limitation can
> > >> be overridden by allowing up to 255 heads instead of the normal 4
> > >> bit limitation of 16.  Doing so allows disk images to be created
> of
> > >> up to nearly 2 TB.  This change does not violate the VHD format
> > >> specification nor does it change how smaller disks (ie, <=127GB)
> are defined.
> > >>
> > >> Signed-off-by: Charles Arnold <carnold@suse.com>
> > >>
> > >> diff --git a/block/vpc.c b/block/vpc.c index b6bf52f..0c2eaf8
> > >> 100644
> > >> --- a/block/vpc.c
> > >> +++ b/block/vpc.c
> > >> @@ -198,7 +198,8 @@ static int vpc_open(BlockDriverState *bs, int
> flags)
> > >>      bs->total_sectors = (int64_t)
> > >>          be16_to_cpu(footer->cyls) * footer->heads *
> > >> footer->secs_per_cyl;
> > >>
> > >> -    if (bs->total_sectors >= 65535 * 16 * 255) {
> > >> +    /* Allow a maximum disk size of approximately 2 TB */
> > >> +    if (bs->total_sectors >= 65535LL * 255 * 255)
> > >> + {qemu-devel@nongnu.org
> > >>          err = -EFBIG;
> > >>          goto fail;
> > >>      }
> > >> @@ -524,19 +525,27 @@ static coroutine_fn int
> > >> vpc_co_write(BlockDriverState *bs, int64_t sector_num,
> > >>   * Note that the geometry doesn't always exactly match
> total_sectors but
> > >>   * may round it down.
> > >>   *
> > >> - * Returns 0 on success, -EFBIG if the size is larger than 127 GB
> > >> + * Returns 0 on success, -EFBIG if the size is larger than ~2 TB.
> > >> + Override
> > >> + * the hardware EIDE and ATA-2 limit of 16 heads (max disk size
> of
> > >> + 127 GB)
> > >> + * and instead allow up to 255 heads.
> > >>   */
> > >>  static int calculate_geometry(int64_t total_sectors, uint16_t*
> cyls,
> > >>      uint8_t* heads, uint8_t* secs_per_cyl)  {
> > >>      uint32_t cyls_times_heads;
> > >>
> > >> -    if (total_sectors > 65535 * 16 * 255)
> > >> +    /* Allow a maximum disk size of approximately 2 TB */
> > >> +    if (total_sectors > 65535LL * 255 * 255) {
> > >>          return -EFBIG;
> > >> +    }
> > >>
> > >>      if (total_sectors > 65535 * 16 * 63) {
> > >>          *secs_per_cyl = 255;
> > >> -        *heads = 16;
> > >> +        if (total_sectors > 65535 * 16 * 255) {
> > >> +            *heads = 255;
> > >> +        } else {
> > >> +            *heads = 16;
> > >> +        }
> > >>          cyls_times_heads = total_sectors / *secs_per_cyl;
> > >>      } else {
> > >>          *secs_per_cyl = 17;
> > >
> > >
> > >
> > >
> >

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 16:36:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 16:36:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYfwP-00082j-FO; Wed, 14 Nov 2012 16:35:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pbonzini@redhat.com>) id 1TYfwN-00082a-Bi
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 16:35:51 +0000
Received: from [85.158.138.51:47023] by server-16.bemta-3.messagelabs.com id
	8F/F2-07461-668C3A05; Wed, 14 Nov 2012 16:35:50 +0000
X-Env-Sender: pbonzini@redhat.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1352910949!30017412!1
X-Originating-IP: [209.132.183.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTY5NzU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28104 invoked from network); 14 Nov 2012 16:35:50 -0000
Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28)
	by server-2.tower-174.messagelabs.com with SMTP;
	14 Nov 2012 16:35:50 -0000
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qAEGZZJa031567
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 11:35:36 -0500
Received: from yakj.usersys.redhat.com (dhcp-176-227.mxp.redhat.com
	[10.32.176.227])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id qAEGZWJI018593; Wed, 14 Nov 2012 11:35:32 -0500
Message-ID: <50A3C853.4010809@redhat.com>
Date: Wed, 14 Nov 2012 17:35:31 +0100
From: Paolo Bonzini <pbonzini@redhat.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121016 Thunderbird/16.0.1
MIME-Version: 1.0
To: Thanos Makatos <thanos.makatos@citrix.com>
References: <50A0E79F0200009100082E4C@novprvoes0310.provo.novell.com>
	<50A2250A.4070108@redhat.com>
	<alpine.DEB.2.02.1211131054200.28049@kaball.uk.xensource.com>
	<4B45B535F7F6BE4CB1C044ED5115CDDE012D550D234B@LONPMAILBOX01.citrite.net>
In-Reply-To: <4B45B535F7F6BE4CB1C044ED5115CDDE012D550D234B@LONPMAILBOX01.citrite.net>
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
Cc: Charles Arnold <carnold@suse.com>, Kevin Wolf <kwolf@redhat.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"stefanha@redhat.com" <stefanha@redhat.com>
Subject: Re: [Xen-devel] [PATCH] block: vpc support for ~2 TB disks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Il 14/11/2012 17:25, Thanos Makatos ha scritto:
> We don't use qemu's VHD driver in XenServer. Instead, we use blktap2
> to create a block device in dom0 serving the VHD file in question,
> and have qemu open that block device instead of the VHD file itself.

Yes, the question is how you handle disks bigger than 127GB, so that
QEMU can do the same.

Paolo

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 16:36:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 16:36:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYfwP-00082j-FO; Wed, 14 Nov 2012 16:35:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pbonzini@redhat.com>) id 1TYfwN-00082a-Bi
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 16:35:51 +0000
Received: from [85.158.138.51:47023] by server-16.bemta-3.messagelabs.com id
	8F/F2-07461-668C3A05; Wed, 14 Nov 2012 16:35:50 +0000
X-Env-Sender: pbonzini@redhat.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1352910949!30017412!1
X-Originating-IP: [209.132.183.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTY5NzU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28104 invoked from network); 14 Nov 2012 16:35:50 -0000
Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28)
	by server-2.tower-174.messagelabs.com with SMTP;
	14 Nov 2012 16:35:50 -0000
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qAEGZZJa031567
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 11:35:36 -0500
Received: from yakj.usersys.redhat.com (dhcp-176-227.mxp.redhat.com
	[10.32.176.227])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id qAEGZWJI018593; Wed, 14 Nov 2012 11:35:32 -0500
Message-ID: <50A3C853.4010809@redhat.com>
Date: Wed, 14 Nov 2012 17:35:31 +0100
From: Paolo Bonzini <pbonzini@redhat.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121016 Thunderbird/16.0.1
MIME-Version: 1.0
To: Thanos Makatos <thanos.makatos@citrix.com>
References: <50A0E79F0200009100082E4C@novprvoes0310.provo.novell.com>
	<50A2250A.4070108@redhat.com>
	<alpine.DEB.2.02.1211131054200.28049@kaball.uk.xensource.com>
	<4B45B535F7F6BE4CB1C044ED5115CDDE012D550D234B@LONPMAILBOX01.citrite.net>
In-Reply-To: <4B45B535F7F6BE4CB1C044ED5115CDDE012D550D234B@LONPMAILBOX01.citrite.net>
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
Cc: Charles Arnold <carnold@suse.com>, Kevin Wolf <kwolf@redhat.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"stefanha@redhat.com" <stefanha@redhat.com>
Subject: Re: [Xen-devel] [PATCH] block: vpc support for ~2 TB disks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Il 14/11/2012 17:25, Thanos Makatos ha scritto:
> We don't use qemu's VHD driver in XenServer. Instead, we use blktap2
> to create a block device in dom0 serving the VHD file in question,
> and have qemu open that block device instead of the VHD file itself.

Yes, the question is how you handle disks bigger than 127GB, so that
QEMU can do the same.

Paolo

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 16:40:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 16:40:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYg0F-0008Gr-9y; Wed, 14 Nov 2012 16:39:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TYg0D-0008Gj-TM
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 16:39:50 +0000
Received: from [193.109.254.147:58569] by server-11.bemta-14.messagelabs.com
	id 38/6A-29027-559C3A05; Wed, 14 Nov 2012 16:39:49 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352911187!8291170!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODYyNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6003 invoked from network); 14 Nov 2012 16:39:48 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 16:39:48 -0000
X-IronPort-AV: E=Sophos;i="4.83,251,1352073600"; d="scan'208";a="214501761"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	14 Nov 2012 16:39:41 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.318.1;
	Wed, 14 Nov 2012 11:39:41 -0500
Message-ID: <50A3C94C.2040806@citrix.com>
Date: Wed, 14 Nov 2012 16:39:40 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: David Vrabel <david.vrabel@citrix.com>
References: <50A37CC7.8050700@citrix.com> <50A397E1.7000602@citrix.com>
In-Reply-To: <50A397E1.7000602@citrix.com>
X-Originating-IP: [10.80.2.76]
Cc: Mats Petersson <mats.petersson@citrix.com>, xen-devel@lists.xen.org,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH] Improve speed of mapping guest memory
 into	Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 14/11/12 13:08, David Vrabel wrote:
> On 14/11/12 11:13, Mats Petersson wrote:
> 
>> I have also found that the munmap() call used to unmap the guest memory
>> from Dom0 is about 35% slower in 3.7 kernel than in the 2.6 kernel (3.8M
>> cycles vs 2.8M cycles).
> 
> This performance reduction only occurs with 32-bit guests is the Xen
> then traps-and-emulates both halves of the PTE write.
> 
>> I think this could be made quicker by using a
>> direct write of zero rather than the compare exchange operation that is
>> currently used [which traps into Xen, performs the compare & exchange] -
> 
> This is something I noticed but never got around to producing a patch.
> How about this (uncomplied!) patch?
> 
> -- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1146,8 +1146,16 @@ again:
>  				     page->index > details->last_index))
>  					continue;
>  			}
> -			ptent = ptep_get_and_clear_full(mm, addr, pte,
> -							tlb->fullmm);
> +			/*
> +			 * No need for the expensive atomic get and
> +			 * clear for anonymous mappings as the dirty
> +			 * and young bits are not used.
> +			 */
> +			if (PageAnon(page))

The mapping might not be backed by pages (e.g., foreign mappings) so:

if (!page || PageAnon(page))

> +				pte_clear(mm, addr, pte);
> +			else
> +				ptent = ptep_get_and_clear_full(mm, addr, pte,
> +								tlb->fullmm);
>  			tlb_remove_tlb_entry(tlb, pte, addr);
>  			if (unlikely(!page))
>  				continue;

David

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 16:40:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 16:40:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYg0F-0008Gr-9y; Wed, 14 Nov 2012 16:39:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TYg0D-0008Gj-TM
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 16:39:50 +0000
Received: from [193.109.254.147:58569] by server-11.bemta-14.messagelabs.com
	id 38/6A-29027-559C3A05; Wed, 14 Nov 2012 16:39:49 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352911187!8291170!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODYyNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6003 invoked from network); 14 Nov 2012 16:39:48 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 16:39:48 -0000
X-IronPort-AV: E=Sophos;i="4.83,251,1352073600"; d="scan'208";a="214501761"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	14 Nov 2012 16:39:41 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.318.1;
	Wed, 14 Nov 2012 11:39:41 -0500
Message-ID: <50A3C94C.2040806@citrix.com>
Date: Wed, 14 Nov 2012 16:39:40 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: David Vrabel <david.vrabel@citrix.com>
References: <50A37CC7.8050700@citrix.com> <50A397E1.7000602@citrix.com>
In-Reply-To: <50A397E1.7000602@citrix.com>
X-Originating-IP: [10.80.2.76]
Cc: Mats Petersson <mats.petersson@citrix.com>, xen-devel@lists.xen.org,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH] Improve speed of mapping guest memory
 into	Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 14/11/12 13:08, David Vrabel wrote:
> On 14/11/12 11:13, Mats Petersson wrote:
> 
>> I have also found that the munmap() call used to unmap the guest memory
>> from Dom0 is about 35% slower in 3.7 kernel than in the 2.6 kernel (3.8M
>> cycles vs 2.8M cycles).
> 
> This performance reduction only occurs with 32-bit guests is the Xen
> then traps-and-emulates both halves of the PTE write.
> 
>> I think this could be made quicker by using a
>> direct write of zero rather than the compare exchange operation that is
>> currently used [which traps into Xen, performs the compare & exchange] -
> 
> This is something I noticed but never got around to producing a patch.
> How about this (uncomplied!) patch?
> 
> -- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1146,8 +1146,16 @@ again:
>  				     page->index > details->last_index))
>  					continue;
>  			}
> -			ptent = ptep_get_and_clear_full(mm, addr, pte,
> -							tlb->fullmm);
> +			/*
> +			 * No need for the expensive atomic get and
> +			 * clear for anonymous mappings as the dirty
> +			 * and young bits are not used.
> +			 */
> +			if (PageAnon(page))

The mapping might not be backed by pages (e.g., foreign mappings) so:

if (!page || PageAnon(page))

> +				pte_clear(mm, addr, pte);
> +			else
> +				ptent = ptep_get_and_clear_full(mm, addr, pte,
> +								tlb->fullmm);
>  			tlb_remove_tlb_entry(tlb, pte, addr);
>  			if (unlikely(!page))
>  				continue;

David

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 16:43:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 16:43:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYg3V-0008Vx-Tq; Wed, 14 Nov 2012 16:43:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TYg3U-0008Vp-Qj
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 16:43:13 +0000
Received: from [85.158.139.83:22287] by server-4.bemta-5.messagelabs.com id
	A6/15-15011-F1AC3A05; Wed, 14 Nov 2012 16:43:11 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352911390!23055862!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODYyNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7624 invoked from network); 14 Nov 2012 16:43:11 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-11.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 16:43:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,251,1352073600"; d="scan'208";a="214502412"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	14 Nov 2012 16:43:09 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Wed, 14 Nov 2012 11:43:08 -0500
Message-ID: <50A3CA1B.6050907@citrix.com>
Date: Wed, 14 Nov 2012 16:43:07 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: David Vrabel <david.vrabel@citrix.com>
References: <50A37CC7.8050700@citrix.com> <50A397E1.7000602@citrix.com>
	<50A3C94C.2040806@citrix.com>
In-Reply-To: <50A3C94C.2040806@citrix.com>
X-Originating-IP: [10.80.3.146]
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH] Improve speed of mapping guest memory
 into	Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 14/11/12 16:39, David Vrabel wrote:
> On 14/11/12 13:08, David Vrabel wrote:
>> On 14/11/12 11:13, Mats Petersson wrote:
>>
>>> I have also found that the munmap() call used to unmap the guest memory
>>> from Dom0 is about 35% slower in 3.7 kernel than in the 2.6 kernel (3.8M
>>> cycles vs 2.8M cycles).
>> This performance reduction only occurs with 32-bit guests is the Xen
>> then traps-and-emulates both halves of the PTE write.
>>
>>> I think this could be made quicker by using a
>>> direct write of zero rather than the compare exchange operation that is
>>> currently used [which traps into Xen, performs the compare & exchange] -
>> This is something I noticed but never got around to producing a patch.
>> How about this (uncomplied!) patch?
>>
>> -- a/mm/memory.c
>> +++ b/mm/memory.c
>> @@ -1146,8 +1146,16 @@ again:
>>   				     page->index > details->last_index))
>>   					continue;
>>   			}
>> -			ptent = ptep_get_and_clear_full(mm, addr, pte,
>> -							tlb->fullmm);
>> +			/*
>> +			 * No need for the expensive atomic get and
>> +			 * clear for anonymous mappings as the dirty
>> +			 * and young bits are not used.
>> +			 */
>> +			if (PageAnon(page))
> The mapping might not be backed by pages (e.g., foreign mappings) so:
>
> if (!page || PageAnon(page))
Indeed, this works fine - it now takes just under 500K cycles to "unmap" 
1024 pages - compared to 3800k cycles with the original code.

--
Mats
>
>> +				pte_clear(mm, addr, pte);
>> +			else
>> +				ptent = ptep_get_and_clear_full(mm, addr, pte,
>> +								tlb->fullmm);
>>   			tlb_remove_tlb_entry(tlb, pte, addr);
>>   			if (unlikely(!page))
>>   				continue;
> David
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 16:43:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 16:43:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYg3V-0008Vx-Tq; Wed, 14 Nov 2012 16:43:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TYg3U-0008Vp-Qj
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 16:43:13 +0000
Received: from [85.158.139.83:22287] by server-4.bemta-5.messagelabs.com id
	A6/15-15011-F1AC3A05; Wed, 14 Nov 2012 16:43:11 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352911390!23055862!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODYyNjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7624 invoked from network); 14 Nov 2012 16:43:11 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-11.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 16:43:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,251,1352073600"; d="scan'208";a="214502412"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	14 Nov 2012 16:43:09 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Wed, 14 Nov 2012 11:43:08 -0500
Message-ID: <50A3CA1B.6050907@citrix.com>
Date: Wed, 14 Nov 2012 16:43:07 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: David Vrabel <david.vrabel@citrix.com>
References: <50A37CC7.8050700@citrix.com> <50A397E1.7000602@citrix.com>
	<50A3C94C.2040806@citrix.com>
In-Reply-To: <50A3C94C.2040806@citrix.com>
X-Originating-IP: [10.80.3.146]
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH] Improve speed of mapping guest memory
 into	Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 14/11/12 16:39, David Vrabel wrote:
> On 14/11/12 13:08, David Vrabel wrote:
>> On 14/11/12 11:13, Mats Petersson wrote:
>>
>>> I have also found that the munmap() call used to unmap the guest memory
>>> from Dom0 is about 35% slower in 3.7 kernel than in the 2.6 kernel (3.8M
>>> cycles vs 2.8M cycles).
>> This performance reduction only occurs with 32-bit guests is the Xen
>> then traps-and-emulates both halves of the PTE write.
>>
>>> I think this could be made quicker by using a
>>> direct write of zero rather than the compare exchange operation that is
>>> currently used [which traps into Xen, performs the compare & exchange] -
>> This is something I noticed but never got around to producing a patch.
>> How about this (uncomplied!) patch?
>>
>> -- a/mm/memory.c
>> +++ b/mm/memory.c
>> @@ -1146,8 +1146,16 @@ again:
>>   				     page->index > details->last_index))
>>   					continue;
>>   			}
>> -			ptent = ptep_get_and_clear_full(mm, addr, pte,
>> -							tlb->fullmm);
>> +			/*
>> +			 * No need for the expensive atomic get and
>> +			 * clear for anonymous mappings as the dirty
>> +			 * and young bits are not used.
>> +			 */
>> +			if (PageAnon(page))
> The mapping might not be backed by pages (e.g., foreign mappings) so:
>
> if (!page || PageAnon(page))
Indeed, this works fine - it now takes just under 500K cycles to "unmap" 
1024 pages - compared to 3800k cycles with the original code.

--
Mats
>
>> +				pte_clear(mm, addr, pte);
>> +			else
>> +				ptent = ptep_get_and_clear_full(mm, addr, pte,
>> +								tlb->fullmm);
>>   			tlb_remove_tlb_entry(tlb, pte, addr);
>>   			if (unlikely(!page))
>>   				continue;
> David
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 16:59:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 16:59:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYgIv-0000ct-Ge; Wed, 14 Nov 2012 16:59:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TYgIt-0000co-5Q
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 16:59:07 +0000
Received: from [85.158.143.35:12814] by server-2.bemta-4.messagelabs.com id
	4B/36-28922-ADDC3A05; Wed, 14 Nov 2012 16:59:06 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-6.tower-21.messagelabs.com!1352912344!17702885!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31877 invoked from network); 14 Nov 2012 16:59:05 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-6.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 16:59:05 -0000
Received: from ([128.244.198.91])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149104416;
	Wed, 14 Nov 2012 11:58:34 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas2.dom1.jhuapl.edu ([128.244.198.91]) with mapi; Wed, 14 Nov 2012
	11:58:34 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Ian Campbell <Ian.Campbell@citrix.com>
Date: Wed, 14 Nov 2012 11:58:33 -0500
Thread-Topic: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
Thread-Index: Ac3CgcuDoDMf079RSHCUxeCJA3eafQAB1UKw
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48A23D8047@aplesstripe.dom1.jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
	<20121114150307.GA17986@aepfle.de>
	<068F06DC4D106941B297C0C5F9F446EA48A23D7F7E@aplesstripe.dom1.jhuapl.edu>
	<1352909100.3499.20.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352909100.3499.20.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

WWVzIHlvdSBuZWVkIHRvIHJ1biBpdC4gTmV4dCByb3VuZCBJ4oCZbGwgaW5jbHVkZSBhIHNlcGFy
YXRlIHBhdGNoIGFmdGVyIHRoZSBiaWcgcmVtb3ZlIHBhdGNoIHdpdGggdGhlIG5ldyBjb25maWd1
cmUgc2NyaXB0LiBZb3UgY2FuIHVzZSBtaW5lIG9yIHJ1biBhdXRvY29uZiB5b3Vyc2VsZi4NCg0K
SSdtIGp1c3Qgd2FpdGluZyBmb3IgZG9jdW1lbnRhdGlvbiBpbnRlcm5hbCByZXZpZXcgdG8gZmlu
aXNoIGFuZCB0aGVuIEkgd2lsbCBzZW5kI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1biBhdXRvZ2VuIHRoZW4/DQoNCklhbi4NCg0KDQpfX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1k
ZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Wed Nov 14 16:59:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 16:59:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYgIv-0000ct-Ge; Wed, 14 Nov 2012 16:59:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TYgIt-0000co-5Q
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 16:59:07 +0000
Received: from [85.158.143.35:12814] by server-2.bemta-4.messagelabs.com id
	4B/36-28922-ADDC3A05; Wed, 14 Nov 2012 16:59:06 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-6.tower-21.messagelabs.com!1352912344!17702885!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31877 invoked from network); 14 Nov 2012 16:59:05 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-6.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 16:59:05 -0000
Received: from ([128.244.198.91])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149104416;
	Wed, 14 Nov 2012 11:58:34 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas2.dom1.jhuapl.edu ([128.244.198.91]) with mapi; Wed, 14 Nov 2012
	11:58:34 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Ian Campbell <Ian.Campbell@citrix.com>
Date: Wed, 14 Nov 2012 11:58:33 -0500
Thread-Topic: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
Thread-Index: Ac3CgcuDoDMf079RSHCUxeCJA3eafQAB1UKw
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48A23D8047@aplesstripe.dom1.jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
	<20121114150307.GA17986@aepfle.de>
	<068F06DC4D106941B297C0C5F9F446EA48A23D7F7E@aplesstripe.dom1.jhuapl.edu>
	<1352909100.3499.20.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352909100.3499.20.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

WWVzIHlvdSBuZWVkIHRvIHJ1biBpdC4gTmV4dCByb3VuZCBJ4oCZbGwgaW5jbHVkZSBhIHNlcGFy
YXRlIHBhdGNoIGFmdGVyIHRoZSBiaWcgcmVtb3ZlIHBhdGNoIHdpdGggdGhlIG5ldyBjb25maWd1
cmUgc2NyaXB0LiBZb3UgY2FuIHVzZSBtaW5lIG9yIHJ1biBhdXRvY29uZiB5b3Vyc2VsZi4NCg0K
SSdtIGp1c3Qgd2FpdGluZyBmb3IgZG9jdW1lbnRhdGlvbiBpbnRlcm5hbCByZXZpZXcgdG8gZmlu
aXNoIGFuZCB0aGVuIEkgd2lsbCBzZW5kIG91dCB0aGUgcGF0Y2hlcyBhZ2Fpbi4NCg0KLS0tLS1P
cmlnaW5hbCBNZXNzYWdlLS0tLS0NCkZyb206IElhbiBDYW1wYmVsbCBbbWFpbHRvOklhbi5DYW1w
YmVsbEBjaXRyaXguY29tXSANClNlbnQ6IFdlZG5lc2RheSwgTm92ZW1iZXIgMTQsIDIwMTIgMTE6
MDUgQU0NClRvOiBGaW9yYXZhbnRlLCBNYXR0aGV3IEUuDQpDYzogT2xhZiBIZXJpbmc7IFN0ZWZh
bm8gU3RhYmVsbGluaTsgeGVuLWRldmVsQGxpc3RzLnhlbi5vcmcNClN1YmplY3Q6IFJlOiBbWGVu
LWRldmVsXSBbUEFUQ0ggVlRQTSA2LzldIFJlbW92ZSB0aGUgdnRwbSBwcm9jZXNzIG1vZGVsDQoN
Ck9uIFdlZCwgMjAxMi0xMS0xNCBhdCAxNToyNiArMDAwMCwgRmlvcmF2YW50ZSwgTWF0dGhldyBF
LiB3cm90ZToNCj4gLS1lbmFibGUtdnRwbSBpcyBubyBsb25nZXIgdXNlZCBhbmQgdGhlIHBhdGNo
IHRha2VzIGl0IG91dCBvZiANCj4gY29uZmlndXJlLmFjLg0KPiANCj4gRG8geW91IHdhbnQgbWUg
dG8gcnVuIGF1dG9yZWNvbmYgb24gbXkgc3lzdGVtIG9yIGRvIHlvdSBndXlzIHByZWZlciB0byAN
Cj4gZG8gdGhhdCB5b3Vyc2VsdmVzIG9uIHlvdXIgb3duIGJ1aWxkIG1hY2hpbmVzPw0KDQpXZSB3
aWxsIHJlcnVuIGl0IGJ1dCBpdCBpcyB1c2VmdWwgdG8gY2FsbCBvdXQgdGhlIG5lZWQgdG8gZG8g
c28gaW4gdGhlIGNvbW1pdCBtZXNzYWdlLCBvdGhlcndpc2UgaXQnbGwgZ2V0IGZvcmdvdHRlbiAv
IG92ZXJsb29rZWQuDQoNCldoaWNoIEkgdGhpbmsgaXMgd2hhdCBoYXBwZW5lZCBoZXJlPyBTaG91
bGQgSSByZXJ1biBhdXRvZ2VuIHRoZW4/DQoNCklhbi4NCg0KDQpfX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1k
ZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Wed Nov 14 17:01:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 17:01:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYgKZ-0000jJ-11; Wed, 14 Nov 2012 17:00:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TYgKX-0000j6-RG
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 17:00:50 +0000
Received: from [85.158.139.211:61196] by server-4.bemta-5.messagelabs.com id
	20/35-15011-04EC3A05; Wed, 14 Nov 2012 17:00:48 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-13.tower-206.messagelabs.com!1352912446!16184472!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19278 invoked from network); 14 Nov 2012 17:00:48 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-13.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 14 Nov 2012 17:00:48 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157335425;
	Wed, 14 Nov 2012 12:00:28 -0500
Message-ID: <50A3CE2A.3010102@jhuapl.edu>
Date: Wed, 14 Nov 2012 12:00:26 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Olaf Hering <olaf@aepfle.de>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
	<20121114150307.GA17986@aepfle.de>
In-Reply-To: <20121114150307.GA17986@aepfle.de>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4875371488418917219=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============4875371488418917219==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms020307070207010202060203"

This is a cryptographically signed message in MIME format.

--------------ms020307070207010202060203
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Good catch, looks like I missed that in config/tooks.mk.in

On 11/14/2012 10:03 AM, Olaf Hering wrote:
> On Tue, Nov 13, Ian Campbell wrote:
>
>> On Thu, 2012-11-01 at 20:35 +0000, Matthew Fioravante wrote:
>>> Remove the old vtpm process model. It doesn't work very
>>> well and is no longer supported.
>>>
>>> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>> Acked-by: Ian Campbell <ian.campbell@citrix.com>
>
> configure still has --enable/disable-vtpm, I think that has to be
> removed as well. The resulting VTPM_TOOLS variable is appearently not
> used anymore.
>
> Olaf



--------------ms020307070207010202060203
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNV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pN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTExNDE3MDAyNlowIwYJKoZIhvcNAQkEMRYEFMDB2p95mg9OhecB
n1JRR7SUiHmUMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYBWn7ca36QFvD79oEjh7AzKPD9pyKBET5O4
S+IFR44OXeSXMJCdCIDWuiBfk4UjyTr4OJjSQjkqkHoTufzJkHQyT7ABR2c3iDwdT1RLMofq
G712z00YyECCoh47zAwYsIBph2/JNbs5WEZoLj9ePpfYLy49lanPEq7wxlz+s0gMHAAAAAAA
AA==
--------------ms020307070207010202060203--


--===============4875371488418917219==
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.xen.org
http://lists.xen.org/xen-devel

--===============4875371488418917219==--


From xen-devel-bounces@lists.xen.org Wed Nov 14 17:01:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 17:01:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYgKZ-0000jJ-11; Wed, 14 Nov 2012 17:00:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TYgKX-0000j6-RG
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 17:00:50 +0000
Received: from [85.158.139.211:61196] by server-4.bemta-5.messagelabs.com id
	20/35-15011-04EC3A05; Wed, 14 Nov 2012 17:00:48 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-13.tower-206.messagelabs.com!1352912446!16184472!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19278 invoked from network); 14 Nov 2012 17:00:48 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-13.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 14 Nov 2012 17:00:48 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157335425;
	Wed, 14 Nov 2012 12:00:28 -0500
Message-ID: <50A3CE2A.3010102@jhuapl.edu>
Date: Wed, 14 Nov 2012 12:00:26 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Olaf Hering <olaf@aepfle.de>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
	<20121114150307.GA17986@aepfle.de>
In-Reply-To: <20121114150307.GA17986@aepfle.de>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4875371488418917219=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============4875371488418917219==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms020307070207010202060203"

This is a cryptographically signed message in MIME format.

--------------ms020307070207010202060203
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Good catch, looks like I missed that in config/tooks.mk.in

On 11/14/2012 10:03 AM, Olaf Hering wrote:
> On Tue, Nov 13, Ian Campbell wrote:
>
>> On Thu, 2012-11-01 at 20:35 +0000, Matthew Fioravante wrote:
>>> Remove the old vtpm process model. It doesn't work very
>>> well and is no longer supported.
>>>
>>> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>> Acked-by: Ian Campbell <ian.campbell@citrix.com>
>
> configure still has --enable/disable-vtpm, I think that has to be
> removed as well. The resulting VTPM_TOOLS variable is appearently not
> used anymore.
>
> Olaf



--------------ms020307070207010202060203
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMv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kGA1UdEwQCMAAwGQYJKoZIhvZ9B0EABAww
ChsEVjcuMQMCBLAwDQYJKoZIhvcNAQEFBQADgYEAJO9HQh4YNChVLzuZqK5ARJARD8JoujGZ
fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTExNDE3MDAyNlowIwYJKoZIhvcNAQkEMRYEFMDB2p95mg9OhecB
n1JRR7SUiHmUMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYBWn7ca36QFvD79oEjh7AzKPD9pyKBET5O4
S+IFR44OXeSXMJCdCIDWuiBfk4UjyTr4OJjSQjkqkHoTufzJkHQyT7ABR2c3iDwdT1RLMofq
G712z00YyECCoh47zAwYsIBph2/JNbs5WEZoLj9ePpfYLy49lanPEq7wxlz+s0gMHAAAAAAA
AA==
--------------ms020307070207010202060203--


--===============4875371488418917219==
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.xen.org
http://lists.xen.org/xen-devel

--===============4875371488418917219==--


From xen-devel-bounces@lists.xen.org Wed Nov 14 17:41:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 17:41:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYgxb-0001e8-GP; Wed, 14 Nov 2012 17:41:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TYgxX-0001e0-Oo
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 17:41:09 +0000
Received: from [85.158.138.51:24646] by server-13.bemta-3.messagelabs.com id
	FD/FD-24887-2B7D3A05; Wed, 14 Nov 2012 17:41:06 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1352914864!30025345!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjMwNDI5\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29891 invoked from network); 14 Nov 2012 17:41:05 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-2.tower-174.messagelabs.com with SMTP;
	14 Nov 2012 17:41:05 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga102.ch.intel.com with ESMTP; 14 Nov 2012 09:41:02 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,252,1352102400"; d="scan'208";a="168350682"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by AZSMGA002.ch.intel.com with ESMTP; 14 Nov 2012 09:41:01 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 14 Nov 2012 09:41:01 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Thu, 15 Nov 2012 01:40:59 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Thread-Topic: [Xen-devel] [PATCH] Handle broken page with regard to migration
Thread-Index: AQHNwPik26Ew5okwlE67aZr+ve5mgZfpkprQ
Date: Wed, 14 Nov 2012 17:40:58 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353827C5@SHSMSX101.ccr.corp.intel.com>
References: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
	<1352273413.12977.27.camel@hastur.hellion.org.uk>
	<DE8DF0795D48FD4CA783C40EC829233537BA4E@SHSMSX101.ccr.corp.intel.com>
	<1352740209.27833.314.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352740209.27833.314.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_004_DE8DF0795D48FD4CA783C40EC82923353827C5SHSMSX101ccrcorpi_"
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] Handle broken page with regard to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_004_DE8DF0795D48FD4CA783C40EC82923353827C5SHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Ian Campbell wrote:
> On Wed, 2012-11-07 at 14:25 +0000, Liu, Jinsong wrote:
>> Ian Campbell wrote:
>>>> At the target
>>>>   it would set p2m as p2m_ram_broken for broken page, so that if
>>>>   guest access the broken page again, it would kill itself as
>>>> expected.
>>>=20
>>> Can you add a few words here about why this is preferable to just
>>> ignoring the issue and populating a regular page non-broken page on
>>> the target? I think I know why but it would be useful to be
>>> explicit in the changelog.=20
>>>=20
>>> I also spotted a typo:
>>>> +                     * vMCE occur during migration +
>>>> * +                     *   At sender, it marks broken page to
>>>> dirty bitmap, +                     *   so that at copypages stage
>>>> of migration, brokan
>>>=20
>>>=20
>>> broken
>>>=20
>>> Ian.
>>=20
>> OK, add some comments and correct typo.
>>=20
>> Thanks,
>> Jinsong
>>=20
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> Handle broken page with regard to migration
>>=20
>> Generally, there are 2 cases:
>> 1. broken page occurs before migration
>> 2. broken page occurs during migration
>>=20
>> At the sender
>>   For case 1, the broken page would be mapped but not copied to
>>   target (otherwise it may trigger more serious error, say, SRAR
>>   error). While its pfn_type and pfn number would be transferred to
>>   target so that target take appropriate action.
>>=20
>>   For case 2, mce handler marks the broken page to dirty bitmap, so
>>   that at copypages stage of migration, its pfn_type and pfn number
>>   would be transferred to target and then take appropriate action.
>>=20
>> At the target
>>   When migration target would populate pages for guest. As for the
>>   case of broken page wrt migration, we prefer keep the
>>   corresponding page, for the sake of seamless migration.
>>=20
>>   At target it would set p2m as p2m_ram_broken for broken page.
>>   Guest MCE may have good chance to handle its broken page, while if
>>   guest access the broken page again it would kill itself as
>> expected.=20
>>=20
>> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
>> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
>=20
> I believe George Acked this patch in
> <CAFLBxZYy8mqvfNH4Hp9x=3Do0jqZ4r9hnCS_qLR0O8+rkY2AAdTA@mail.gmail.com>.
> Were there other acks, e.g. from Jan for the hypervisor side?

Attached are acks from George, Jan, and IanJ.

>=20
> Please do collect acks into the commit log and keep them while the
> patch hasn't change substantially to invalidate them (especially when
> a series has had many iterations and variations like this one),
> otherwise I have to go hunting for them which makes it more likely
> that I'll either get distracted or go and apply some easier to deal
> with patch instead.=20
>=20
> Anyway, I afraid that when I went to apply this there were loads of
> rejects, I suspect a conflict with the superpage migration patch,
> sorry. Please can you rebase and resend (with patchbomb).
>=20
> Thanks,
> Ian.
>=20

Yes, it conflicted w/ some other patches.
I've rebased it and added 'Acked-by' (George/Jan/IanJ), will resend soon vi=
a 'hg email' w/ patchbomb.

Thanks,
Jinsong
=20

>>=20
>> diff -r d675797494bd tools/libxc/xc_domain.c
>> --- a/tools/libxc/xc_domain.c   Fri Nov 02 11:08:37 2012 +0800
>> +++ b/tools/libxc/xc_domain.c   Thu Nov 08 05:07:20 2012 +0800 @@
>>      -283,6 +283,22 @@ return ret;
>>  }
>>=20
>> +/* set broken page p2m */
>> +int xc_set_broken_page_p2m(xc_interface *xch,
>> +                           uint32_t domid,
>> +                           unsigned long pfn)
>> +{
>> +    int ret;
>> +    DECLARE_DOMCTL;
>> +
>> +    domctl.cmd =3D XEN_DOMCTL_set_broken_page_p2m;
>> +    domctl.domain =3D (domid_t)domid;
>> +    domctl.u.set_broken_page_p2m.pfn =3D pfn;
>> +    ret =3D do_domctl(xch, &domctl);
>> +
>> +    return ret ? -1 : 0;
>> +}
>> +
>>  /* get info from hvm guest for save */
>>  int xc_domain_hvm_getcontext(xc_interface *xch,
>>                               uint32_t domid,
>> diff -r d675797494bd tools/libxc/xc_domain_restore.c
>> --- a/tools/libxc/xc_domain_restore.c   Fri Nov 02 11:08:37 2012
>> +0800 +++ b/tools/libxc/xc_domain_restore.c   Thu Nov 08 05:07:20
>> 2012 +0800 @@ -962,9 +962,15 @@=20
>>=20
>>      countpages =3D count;
>>      for (i =3D oldcount; i < buf->nr_pages; ++i)
>> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) =3D=3D
>> XEN_DOMCTL_PFINFO_XTAB=20
>> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) =3D=3D
>> XEN_DOMCTL_PFINFO_XALLOC) +    { +        unsigned long pagetype;
>> +
>> +        pagetype =3D buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
>> +        if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTAB ||
>> +             pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN ||
>> +             pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )            =20
>> --countpages; +    }
>>=20
>>      if (!countpages)
>>          return count;
>> @@ -1200,6 +1206,17 @@
>>              /* a bogus/unmapped/allocate-only page: skip it */    =20
>> continue;=20
>>=20
>> +        if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN ) +        {
>> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) ) +        =20
>> { +                ERROR("Set p2m for broken page failed, "
>> +                      "dom=3D%d, pfn=3D%lx\n", dom, pfn);
>> +                goto err_mapped;
>> +            }
>> +            continue;
>> +        }
>> +
>>          if (pfn_err[i])
>>          {
>>              ERROR("unexpected PFN mapping failure pfn %lx map_mfn
>> %lx p2m_mfn %lx",=20
>> diff -r d675797494bd tools/libxc/xc_domain_save.c
>> --- a/tools/libxc/xc_domain_save.c      Fri Nov 02 11:08:37 2012
>> +0800 +++ b/tools/libxc/xc_domain_save.c      Thu Nov 08 05:07:20
>>                  2012 +0800 @@ -1277,6 +1277,13 @@ if ( !hvm )
>>                      gmfn =3D pfn_to_mfn(gmfn);
>>=20
>> +                if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_BROKEN ) +  =
=20
>> { +                    pfn_type[j] |=3D pfn_batch[j];
>> +                    ++run;
>> +                    continue;
>> +                }
>> +
>>                  if ( pfn_err[j] )
>>                  {
>>                      if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_XTAB ) @@
>>                      -1371,8 +1378,12 @@ }
>>                  }
>>=20
>> -                /* skip pages that aren't present or are alloc-only
>> */ +                /* +                 * skip pages that aren't
>> present, +                 * or are broken, or are alloc-only +    =20
>>                  */ if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTAB
>> +                    || pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN
>>                      || pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )
>>                      continue;
>>=20
>> diff -r d675797494bd tools/libxc/xenctrl.h
>> --- a/tools/libxc/xenctrl.h     Fri Nov 02 11:08:37 2012 +0800
>> +++ b/tools/libxc/xenctrl.h     Thu Nov 08 05:07:20 2012 +0800 @@
>>                            -575,6 +575,17 @@ xc_domaininfo_t *info);
>>=20
>>  /**
>> + * This function set p2m for broken page
>> + * &parm xch a handle to an open hypervisor interface
>> + * @parm domid the domain id which broken page belong to
>> + * @parm pfn the pfn number of the broken page
>> + * @return 0 on success, -1 on failure
>> + */
>> +int xc_set_broken_page_p2m(xc_interface *xch,
>> +                           uint32_t domid,
>> +                           unsigned long pfn);
>> +
>> +/**
>>   * This function returns information about the context of a hvm
>> domain=20
>>   * @parm xch a handle to an open hypervisor interface
>>   * @parm domid the domain to get information from
>> diff -r d675797494bd xen/arch/x86/cpu/mcheck/mcaction.c
>> --- a/xen/arch/x86/cpu/mcheck/mcaction.c        Fri Nov 02 11:08:37
>> 2012 +0800 +++ b/xen/arch/x86/cpu/mcheck/mcaction.c        Thu Nov
>>  08 05:07:20 2012 +0800 @@ -1,5 +1,6 @@ #include <xen/types.h>
>>  #include <xen/sched.h>
>> +#include <asm/p2m.h>
>>  #include "mcaction.h"
>>  #include "vmce.h"
>>  #include "mce.h"
>> @@ -91,6 +92,24 @@
>>                      goto vmce_failed;
>>                  }
>>=20
>> +                if ( is_hvm_domain(d) &&
>> !d->arch.hvm_domain.dirty_vram && +                   =20
>> paging_mode_log_dirty(d) ) +                {
>> +                    /*
>> +                     * vMCE occur during migration +              =20
>> * +                     *   At sender, it marks broken page to dirty
>> bitmap, +                     *   so that at copypages stage of
>> migration, broken +                     *   page's pfn_type and pfn
>> number would be transferred +                     *   to target and
>> then take appropriate action. +                     * +            =20
>> *   At target, it would set p2m as p2m_ram_broken for +            =20
>> *   broken page, so that if guest access the broken page +         =20
>> *   again, it would kill itself as expected. +                   =20
>> */ +                    paging_mark_dirty(d, mfn); +                }
>> +
>>                  if ( unmmap_broken_page(d, _mfn(mfn), gfn) )      =20
>>                      { printk("Unmap broken memory %lx for DOM%d
>> failed\n",=20
>> diff -r d675797494bd xen/arch/x86/domctl.c
>> --- a/xen/arch/x86/domctl.c     Fri Nov 02 11:08:37 2012 +0800
>> +++ b/xen/arch/x86/domctl.c     Thu Nov 08 05:07:20 2012 +0800 @@
>>                  -209,12 +209,18 @@ for ( j =3D 0; j < k; j++ )
>>                  {
>>                      unsigned long type =3D 0;
>> +                    p2m_type_t t;
>>=20
>> -                    page =3D get_page_from_gfn(d, arr[j], NULL,
>> P2M_ALLOC); +                    page =3D get_page_from_gfn(d, arr[j],
>> &t, P2M_ALLOC);=20
>>=20
>>                      if ( unlikely(!page) ||
>>                           unlikely(is_xen_heap_page(page)) )
>> -                        type =3D XEN_DOMCTL_PFINFO_XTAB; +          =20
>> { +                        if ( p2m_is_broken(t) )
>> +                            type =3D XEN_DOMCTL_PFINFO_BROKEN; +    =20
>> else +                            type =3D XEN_DOMCTL_PFINFO_XTAB; + =20
>>                      } else
>>                      {
>>                          switch( page->u.inuse.type_info &
>> PGT_type_mask ) @@ -235,6 +241,9 @@=20
>>=20
>>                          if ( page->u.inuse.type_info & PGT_pinned )
>>                              type |=3D XEN_DOMCTL_PFINFO_LPINTAB; +
>> +                        if ( page->count_info & PGC_broken )
>> +                            type =3D XEN_DOMCTL_PFINFO_BROKEN;      =20
>> }=20
>>=20
>>                      if ( page )
>> @@ -1568,6 +1577,29 @@
>>      }
>>      break;
>>=20
>> +    case XEN_DOMCTL_set_broken_page_p2m:
>> +    {
>> +        struct domain *d;
>> +
>> +        d =3D rcu_lock_domain_by_id(domctl->domain); +        if ( d
>> !=3D NULL ) +        {
>> +            p2m_type_t pt;
>> +            unsigned long pfn =3D domctl->u.set_broken_page_p2m.pfn;
>> +            mfn_t mfn =3D get_gfn_query(d, pfn, &pt); +
>> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt)
>> || +                         (p2m_change_type(d, pfn, pt,
>> p2m_ram_broken) !=3D pt)) ) +                ret =3D -EINVAL;
>> +
>> +            put_gfn(d, pfn);
>> +            rcu_unlock_domain(d);
>> +        }
>> +        else
>> +            ret =3D -ESRCH;
>> +    }
>> +    break;
>> +
>>      default:
>>          ret =3D iommu_do_domctl(domctl, u_domctl);
>>          break;
>> diff -r d675797494bd xen/include/public/domctl.h
>> --- a/xen/include/public/domctl.h       Fri Nov 02 11:08:37 2012
>> +0800 +++ b/xen/include/public/domctl.h       Thu Nov 08 05:07:20
>>  2012 +0800 @@ -136,6 +136,7 @@ #define XEN_DOMCTL_PFINFO_LPINTAB
>>  (0x1U<<31) #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid
>>  page */ #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /*
>> allocate-only page */ +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28)
>>  /* broken page */ #define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
>>  #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
>>=20
>> @@ -835,6 +836,12 @@
>>  typedef struct xen_domctl_set_access_required
>>  xen_domctl_set_access_required_t;
>> DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);=20
>>=20
>> +struct xen_domctl_set_broken_page_p2m {
>> +    uint64_aligned_t pfn;
>> +};
>> +typedef struct xen_domctl_set_broken_page_p2m
>> xen_domctl_set_broken_page_p2m_t;
>>  +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t); +
>>      struct xen_domctl { uint32_t cmd;
>>  #define XEN_DOMCTL_createdomain                   1 @@ -900,6
>>  +907,7 @@ #define XEN_DOMCTL_set_access_required           64
>>  #define XEN_DOMCTL_audit_p2m                     65
>>  #define XEN_DOMCTL_set_virq_handler              66
>> +#define XEN_DOMCTL_set_broken_page_p2m           67
>>  #define XEN_DOMCTL_gdbsx_guestmemio            1000
>>  #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>>  #define XEN_DOMCTL_gdbsx_unpausevcpu           1002 @@ -955,6
>>          +963,7 @@ struct xen_domctl_audit_p2m         audit_p2m;
>>          struct xen_domctl_set_virq_handler  set_virq_handler;
>>          struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
>> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>>          struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>>          struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>>          uint8_t                             pad[128];


--_004_DE8DF0795D48FD4CA783C40EC82923353827C5SHSMSX101ccrcorpi_
Content-Type: message/rfc822
Content-Disposition: attachment;
	creation-date="Wed, 14 Nov 2012 17:40:57 GMT";
	modification-date="Wed, 14 Nov 2012 17:40:57 GMT"

Received: from fmsmsx108.amr.corp.intel.com (10.19.9.228) by
 SHSMSX102.ccr.corp.intel.com (10.239.4.154) with Microsoft SMTP Server (TLS)
 id 14.1.355.2; Tue, 6 Nov 2012 23:43:03 +0800
Received: from azsmga001.ch.intel.com (10.2.17.19) by FMSMSX108-1.fm.intel.com
 (10.19.9.228) with Microsoft SMTP Server id 14.1.355.2; Tue, 6 Nov 2012
 07:43:02 -0800
Received: from azsmga102.ch.intel.com ([10.2.16.52])  by
 azsmga001-1.ch.intel.com with ESMTP; 06 Nov 2012 07:42:51 -0800
Received: from mail-vc0-f180.google.com ([209.85.220.180])  by mga14.intel.com
 with ESMTP/TLS/RC4-SHA; 06 Nov 2012 07:42:51 -0800
Received: by mail-vc0-f180.google.com with SMTP id fl13so423911vcb.25
        for <jinsong.liu@intel.com>; Tue, 06 Nov 2012 07:42:50 -0800 (PST)
Received: by 10.220.152.11 with SMTP id e11mr1189476vcw.61.1352216570022; Tue,
 06 Nov 2012 07:42:50 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Tue, 6 Nov 2012 07:42:49 -0800 (PST)
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
CC: "ian.jackson@eu.citrix.com" <ian.jackson@eu.citrix.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>, "xen-devel@lists.xensource.com"
	<xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] Handle broken page with regard to migration
Thread-Topic: [Xen-devel] [PATCH] Handle broken page with regard to migration
Thread-Index: AQHNvDVowo0CS0uWQ02/ywhb/M0oqg==
Sender: "dunlapg@gmail.com" <dunlapg@gmail.com>
Date: Tue, 6 Nov 2012 15:42:49 +0000
Message-ID: <CAFLBxZYy8mqvfNH4Hp9x=o0jqZ4r9hnCS_qLR0O8+rkY2AAdTA@mail.gmail.com>
References: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
In-Reply-To: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Organization-AuthSource: FMSMSX108.amr.corp.intel.com
X-MS-Has-Attach: 
X-Message-Flag: Follow up
X-MS-TNEF-Correlator: 
dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com;
 s=20120113;        h=mime-version:sender:in-reply-to:references:date
         :x-google-sender-auth:message-id:subject:from:to:cc:content-type;
        bh=3Mwt18hOQZbZcCLlJVQIdMoO6nnbB8vmEMZn/3g2skQ=;
        b=LplQQQPSFX/Mpbsmhhgqhwj5k7Jx35Jm6zpp1rfTZNuKc3+5Cq0QZPoEX5YFb1H9MQ
         8X8D+uvKIXfvSX8UFY0sGGRpvC3j1xJMbXgf6VYncygXcAXqH+YKABDttRv0UkEXuq1w
         CDVByoqaBcsyGvqEATMCeOMSRZsXDr5B3zreyjp451q5YWy9OhHMkXtvUzmHBxxRLIcD
         osR3EtLAExWzOsvxrZL5Ll5pOhL/hEc81rS4TAvTMWRlA3lvR/uKEgNwtl5y902OkKR3
         1xGofE010scgmiB0ZIS4eh9DzJIGOqBD/Iz70Rv97nhjo34RgGkgJkj73vCcPEA5n6C/
         grjg==
Content-Type: text/plain; charset="iso-8859-1"
Content-ID: <E704FCC90AD8A74B888A475DA7B7C27D@intel.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

On Fri, Nov 2, 2012 at 3:25 AM, Liu Jinsong <jinsong.liu@intel.com> wrote:
> Generally, there are 2 cases:
> 1. broken page occurs before migration
> 2. broken page occurs during migration
>
> At the sender
>   for case 1, the broken page would be mapped but not copied to target
>   (otherwise it may trigger more serious error, say, SRAR error).
>   While its pfn_type and pfn number would be transferred to target
>   so that target take appropriate action.
>
>   for case 2, mce handler marks the broken page to dirty bitmap, so that
>   at copypages stage of migration, its pfn_type and pfn number would be
>   transferred to target and then take appropriate action.
>
> At the target
>   it would set p2m as p2m_ram_broken for broken page, so that if guest
>   access the broken page again, it would kill itself as expected.
>
> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

Looks good to me -- thanks, Jinsong!

Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

>
> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain.c
> --- a/tools/libxc/xc_domain.c   Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xc_domain.c   Fri Nov 02 11:08:37 2012 +0800
> @@ -283,6 +283,22 @@
>      return ret;
>  }
>
> +/* set broken page p2m */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn)
> +{
> +    int ret;
> +    DECLARE_DOMCTL;
> +
> +    domctl.cmd =3D XEN_DOMCTL_set_broken_page_p2m;
> +    domctl.domain =3D (domid_t)domid;
> +    domctl.u.set_broken_page_p2m.pfn =3D pfn;
> +    ret =3D do_domctl(xch, &domctl);
> +
> +    return ret ? -1 : 0;
> +}
> +
>  /* get info from hvm guest for save */
>  int xc_domain_hvm_getcontext(xc_interface *xch,
>                               uint32_t domid,
> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain_restore.c
> --- a/tools/libxc/xc_domain_restore.c   Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xc_domain_restore.c   Fri Nov 02 11:08:37 2012 +0800
> @@ -962,9 +962,15 @@
>
>      countpages =3D count;
>      for (i =3D oldcount; i < buf->nr_pages; ++i)
> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) =3D=3D XEN=
_DOMCTL_PFINFO_XTAB
> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) =3D=3D X=
EN_DOMCTL_PFINFO_XALLOC)
> +    {
> +        unsigned long pagetype;
> +
> +        pagetype =3D buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
> +        if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTAB ||
> +             pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN ||
> +             pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )
>              --countpages;
> +    }
>
>      if (!countpages)
>          return count;
> @@ -1200,6 +1206,17 @@
>              /* a bogus/unmapped/allocate-only page: skip it */
>              continue;
>
> +        if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN )
> +        {
> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
> +            {
> +                ERROR("Set p2m for broken page failed, "
> +                      "dom=3D%d, pfn=3D%lx\n", dom, pfn);
> +                goto err_mapped;
> +            }
> +            continue;
> +        }
> +
>          if (pfn_err[i])
>          {
>              ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2=
m_mfn %lx",
> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain_save.c
> --- a/tools/libxc/xc_domain_save.c      Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xc_domain_save.c      Fri Nov 02 11:08:37 2012 +0800
> @@ -1277,6 +1277,13 @@
>                  if ( !hvm )
>                      gmfn =3D pfn_to_mfn(gmfn);
>
> +                if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_BROKEN )
> +                {
> +                    pfn_type[j] |=3D pfn_batch[j];
> +                    ++run;
> +                    continue;
> +                }
> +
>                  if ( pfn_err[j] )
>                  {
>                      if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_XTAB )
> @@ -1371,8 +1378,12 @@
>                      }
>                  }
>
> -                /* skip pages that aren't present or are alloc-only */
> +                /*
> +                 * skip pages that aren't present,
> +                 * or are broken, or are alloc-only
> +                 */
>                  if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTAB
> +                    || pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN
>                      || pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )
>                      continue;
>
> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xenctrl.h
> --- a/tools/libxc/xenctrl.h     Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xenctrl.h     Fri Nov 02 11:08:37 2012 +0800
> @@ -575,6 +575,17 @@
>                            xc_domaininfo_t *info);
>
>  /**
> + * This function set p2m for broken page
> + * &parm xch a handle to an open hypervisor interface
> + * @parm domid the domain id which broken page belong to
> + * @parm pfn the pfn number of the broken page
> + * @return 0 on success, -1 on failure
> + */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn);
> +
> +/**
>   * This function returns information about the context of a hvm domain
>   * @parm xch a handle to an open hypervisor interface
>   * @parm domid the domain to get information from
> diff -r d675797494bd -r 730dd3f22a12 xen/arch/x86/cpu/mcheck/mcaction.c
> --- a/xen/arch/x86/cpu/mcheck/mcaction.c        Fri Nov 02 11:08:37 2012 =
+0800
> +++ b/xen/arch/x86/cpu/mcheck/mcaction.c        Fri Nov 02 11:08:37 2012 =
+0800
> @@ -1,5 +1,6 @@
>  #include <xen/types.h>
>  #include <xen/sched.h>
> +#include <asm/p2m.h>
>  #include "mcaction.h"
>  #include "vmce.h"
>  #include "mce.h"
> @@ -91,6 +92,24 @@
>                      goto vmce_failed;
>                  }
>
> +                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram =
&&
> +                     paging_mode_log_dirty(d) )
> +                {
> +                    /*
> +                     * vMCE occur during migration
> +                     *
> +                     *   At sender, it marks broken page to dirty bitmap=
,
> +                     *   so that at copypages stage of migration, brokan
> +                     *   page's pfn_type and pfn number would be transfe=
rred
> +                     *   to target and then take appropriate action.
> +                     *
> +                     *   At target, it would set p2m as p2m_ram_broken f=
or
> +                     *   broken page, so that if guest access the broken=
 page
> +                     *   again, it would kill itself as expected.
> +                     */
> +                    paging_mark_dirty(d, mfn);
> +                }
> +
>                  if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
>                  {
>                      printk("Unmap broken memory %lx for DOM%d failed\n",
> diff -r d675797494bd -r 730dd3f22a12 xen/arch/x86/domctl.c
> --- a/xen/arch/x86/domctl.c     Fri Nov 02 11:08:37 2012 +0800
> +++ b/xen/arch/x86/domctl.c     Fri Nov 02 11:08:37 2012 +0800
> @@ -209,12 +209,18 @@
>                  for ( j =3D 0; j < k; j++ )
>                  {
>                      unsigned long type =3D 0;
> +                    p2m_type_t t;
>
> -                    page =3D get_page_from_gfn(d, arr[j], NULL, P2M_ALLO=
C);
> +                    page =3D get_page_from_gfn(d, arr[j], &t, P2M_ALLOC)=
;
>
>                      if ( unlikely(!page) ||
>                           unlikely(is_xen_heap_page(page)) )
> -                        type =3D XEN_DOMCTL_PFINFO_XTAB;
> +                    {
> +                        if ( p2m_is_broken(t) )
> +                            type =3D XEN_DOMCTL_PFINFO_BROKEN;
> +                        else
> +                            type =3D XEN_DOMCTL_PFINFO_XTAB;
> +                    }
>                      else
>                      {
>                          switch( page->u.inuse.type_info & PGT_type_mask =
)
> @@ -235,6 +241,9 @@
>
>                          if ( page->u.inuse.type_info & PGT_pinned )
>                              type |=3D XEN_DOMCTL_PFINFO_LPINTAB;
> +
> +                        if ( page->count_info & PGC_broken )
> +                            type =3D XEN_DOMCTL_PFINFO_BROKEN;
>                      }
>
>                      if ( page )
> @@ -1568,6 +1577,29 @@
>      }
>      break;
>
> +    case XEN_DOMCTL_set_broken_page_p2m:
> +    {
> +        struct domain *d;
> +
> +        d =3D rcu_lock_domain_by_id(domctl->domain);
> +        if ( d !=3D NULL )
> +        {
> +            p2m_type_t pt;
> +            unsigned long pfn =3D domctl->u.set_broken_page_p2m.pfn;
> +            mfn_t mfn =3D get_gfn_query(d, pfn, &pt);
> +
> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
> +                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) !=
=3D pt)) )
> +                ret =3D -EINVAL;
> +
> +            put_gfn(d, pfn);
> +            rcu_unlock_domain(d);
> +        }
> +        else
> +            ret =3D -ESRCH;
> +    }
> +    break;
> +
>      default:
>          ret =3D iommu_do_domctl(domctl, u_domctl);
>          break;
> diff -r d675797494bd -r 730dd3f22a12 xen/include/public/domctl.h
> --- a/xen/include/public/domctl.h       Fri Nov 02 11:08:37 2012 +0800
> +++ b/xen/include/public/domctl.h       Fri Nov 02 11:08:37 2012 +0800
> @@ -136,6 +136,7 @@
>  #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
>  #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
>  #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
> +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
>  #define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
>  #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
>
> @@ -835,6 +836,12 @@
>  typedef struct xen_domctl_set_access_required xen_domctl_set_access_requ=
ired_t;
>  DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
>
> +struct xen_domctl_set_broken_page_p2m {
> +    uint64_aligned_t pfn;
> +};
> +typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page=
_p2m_t;
> +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
> +
>  struct xen_domctl {
>      uint32_t cmd;
>  #define XEN_DOMCTL_createdomain                   1
> @@ -900,6 +907,7 @@
>  #define XEN_DOMCTL_set_access_required           64
>  #define XEN_DOMCTL_audit_p2m                     65
>  #define XEN_DOMCTL_set_virq_handler              66
> +#define XEN_DOMCTL_set_broken_page_p2m           67
>  #define XEN_DOMCTL_gdbsx_guestmemio            1000
>  #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>  #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
> @@ -955,6 +963,7 @@
>          struct xen_domctl_audit_p2m         audit_p2m;
>          struct xen_domctl_set_virq_handler  set_virq_handler;
>          struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>          struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>          struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>          uint8_t                             pad[128];
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

--_004_DE8DF0795D48FD4CA783C40EC82923353827C5SHSMSX101ccrcorpi_
Content-Type: message/rfc822
Content-Disposition: attachment;
	creation-date="Wed, 14 Nov 2012 17:40:57 GMT";
	modification-date="Wed, 14 Nov 2012 17:40:57 GMT"

Received: from fmsmsx106.amr.corp.intel.com (10.19.9.37) by
 SHSMSX151.ccr.corp.intel.com (10.239.6.50) with Microsoft SMTP Server (TLS)
 id 14.1.355.2; Thu, 25 Oct 2012 19:22:52 +0800
Received: from fmsmga002.fm.intel.com (10.253.24.26) by
 FMSMSX106-1.fm.intel.com (10.19.9.37) with Microsoft SMTP Server id
 14.1.355.2; Thu, 25 Oct 2012 04:22:51 -0700
Received: from fmsmga101.fm.intel.com ([10.1.193.65])  by
 fmsmga002-1.fm.intel.com with ESMTP; 25 Oct 2012 04:22:36 -0700
Received: from smtp.eu.citrix.com ([62.200.22.115])  by mga01.intel.com with
 ESMTP; 25 Oct 2012 04:22:27 -0700
Received: from lonpmailmx01.citrite.net ([10.30.203.162])  by
 LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5; 25 Oct 2012 11:21:20 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
 smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
 Thu, 25 Oct 2012 12:21:20 +0100
Received: from mariner.cam.xci-test.com	([10.80.2.22]
 helo=mariner.uk.xensource.com ident=Debian-exim)	by norwich.cam.xci-test.com
 with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
 1TRLV2-0003qs-58; Thu, 25 Oct 2012 11:21:20 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TRLV2-0000iT-1I; Thu, 25 Oct
 2012 12:21:20 +0100
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
CC: Christoph Egger <Christoph.Egger@amd.com>, "xen-devel@lists.xensource.com"
	<xen-devel@lists.xensource.com>, "Keir (Xen.org)" <keir@xen.org>, Ian
 Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH 4/5] Xen/MCE: Abort live migration	when	vMCE
	occur
Thread-Topic: [Xen-devel] [PATCH 4/5] Xen/MCE: Abort live migration	when
	vMCE	occur
Thread-Index: AQHNsqMT37eXSzhKqkORq5TmD1OlTw==
Date: Thu, 25 Oct 2012 11:21:19 +0000
Message-ID: <20617.8367.946706.92097@mariner.uk.xensource.com>
References: <DE8DF0795D48FD4CA783C40EC829233534A62F@SHSMSX101.ccr.corp.intel.com>
	<20609.26910.2416.305293@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC82923353610F0@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC8292335361F91@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC8292335361F91@SHSMSX101.ccr.corp.intel.com>
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Organization-AuthSource: FMSMSX106.amr.corp.intel.com
X-MS-Has-Attach: 
X-Message-Flag: Follow up
X-MS-TNEF-Correlator: 
x-ironport-av: E=Sophos;i="4.80,646,1344211200";    d="scan'208";a="15385861"
x-ironport-anti-spam-filtered: true
x-ironport-anti-spam-result: AlIBAH4giVA+yBZznGdsb2JhbABEhU+8UiMBAQEBAQgLCQkUJ4IfAQEBAwEBATcZJhALNhA8GwYOBYgIvV+STgOpIQ
Content-Type: text/plain; charset="us-ascii"
Content-ID: <A746355994264A419436FCFB6A375B52@intel.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

Liu, Jinsong writes ("Re: [Xen-devel] [PATCH 4/5] Xen/MCE: Abort live migra=
tion when	vMCE	occur"):
> Update patch 4/5 as attached.

Thanks.  As for the tools parts:

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Ian.

--_004_DE8DF0795D48FD4CA783C40EC82923353827C5SHSMSX101ccrcorpi_
Content-Type: message/rfc822
Content-Disposition: attachment;
	creation-date="Wed, 14 Nov 2012 17:40:57 GMT";
	modification-date="Wed, 14 Nov 2012 17:40:57 GMT"

Received: from fmsmsx104.amr.corp.intel.com (10.19.9.35) by
 SHSMSX151.ccr.corp.intel.com (10.239.6.50) with Microsoft SMTP Server (TLS)
 id 14.1.355.2; Tue, 28 Aug 2012 22:06:14 +0800
Received: from AZSMGA002.ch.intel.com (10.2.17.35) by FMSMSX104-1.fm.intel.com
 (10.19.9.35) with Microsoft SMTP Server id 14.1.355.2; Tue, 28 Aug 2012
 07:06:12 -0700
Received: from azsmga101.ch.intel.com ([10.2.16.36])  by
 AZSMGA002-1.ch.intel.com with ESMTP; 28 Aug 2012 07:05:54 -0700
Received: from nat28.tlf.novell.com ([130.57.49.28])  by mga03.intel.com with
 ESMTP; 28 Aug 2012 07:05:51 -0700
Received: from EMEA1-MTA by nat28.tlf.novell.com	with Novell_GroupWise; Tue,
 28 Aug 2012 15:05:50 +0100
From: Jan Beulich <jbeulich@suse.com>
To: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>, "Liu, Jinsong"
	<jinsong.liu@intel.com>
CC: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, "keir@xen.org"
	<keir@xen.org>
Subject: Re: [PATCH] X86/vMCE: guest broken page handling when migration
Thread-Topic: [PATCH] X86/vMCE: guest broken page handling when migration
Thread-Index: AQHNhSY5Zp6ZOLjuREqA3X3AgCYhPw==
Date: Tue, 28 Aug 2012 14:05:48 +0000
Message-ID: <503CDE4C020000780008AA09@nat28.tlf.novell.com>
References: <DE8DF0795D48FD4CA783C40EC8292335317D90@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC8292335317D90@SHSMSX101.ccr.corp.intel.com>
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Organization-AuthSource: FMSMSX104.amr.corp.intel.com
X-MS-Has-Attach: 
X-Message-Flag: Follow up
X-MS-TNEF-Correlator: 
x-ironport-av: E=Sophos;i="4.80,326,1344236400";    d="scan'208";a="1079254"
x-ironport-anti-spam-filtered: true
x-ironport-anti-spam-result: AkQDAMfPPFCCOTEcmWdsb2JhbABFhTwBtCoEBHsiAQEBAQEICwsHFCeCIQEFOj8QCzQSVwYBCQmIDbwFjkWCPGADjVyHepJ5
Content-Type: text/plain; charset="us-ascii"
Content-ID: <D156595E82024E42B7E735592914DDCB@intel.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

>>> "Liu, Jinsong" <jinsong.liu@intel.com> 08/27/12 4:13 AM >>>=20
>X86/vMCE: guest broken page handling when migration=20
>
>This patch is used to handle guest broken page when migration.=20
>
>At sender, the broken page would not be mapped, and the error page=20
>content would not be copied to target, otherwise it may trigger more=20
>serious error (i.e. SRAR error). While its pfn_type and pfn number=20
>would be transferred to target so that target take appropriate action.=20
>
>At target, it would set p2m as p2m_ram_broken for broken page, so that=20
>if guest crazy access the broken page again, it would kill guest as expect=
ed.=20

Looks okay to me, but would also need looking at by a tools person of cours=
e.

Please add to your series when you resubmit past-4.2.

=20

Thanks, Jan

--_004_DE8DF0795D48FD4CA783C40EC82923353827C5SHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_004_DE8DF0795D48FD4CA783C40EC82923353827C5SHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Wed Nov 14 17:41:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 17:41:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYgxb-0001e8-GP; Wed, 14 Nov 2012 17:41:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TYgxX-0001e0-Oo
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 17:41:09 +0000
Received: from [85.158.138.51:24646] by server-13.bemta-3.messagelabs.com id
	FD/FD-24887-2B7D3A05; Wed, 14 Nov 2012 17:41:06 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1352914864!30025345!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjMwNDI5\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29891 invoked from network); 14 Nov 2012 17:41:05 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-2.tower-174.messagelabs.com with SMTP;
	14 Nov 2012 17:41:05 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga102.ch.intel.com with ESMTP; 14 Nov 2012 09:41:02 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,252,1352102400"; d="scan'208";a="168350682"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by AZSMGA002.ch.intel.com with ESMTP; 14 Nov 2012 09:41:01 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 14 Nov 2012 09:41:01 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Thu, 15 Nov 2012 01:40:59 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Thread-Topic: [Xen-devel] [PATCH] Handle broken page with regard to migration
Thread-Index: AQHNwPik26Ew5okwlE67aZr+ve5mgZfpkprQ
Date: Wed, 14 Nov 2012 17:40:58 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353827C5@SHSMSX101.ccr.corp.intel.com>
References: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
	<1352273413.12977.27.camel@hastur.hellion.org.uk>
	<DE8DF0795D48FD4CA783C40EC829233537BA4E@SHSMSX101.ccr.corp.intel.com>
	<1352740209.27833.314.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352740209.27833.314.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_004_DE8DF0795D48FD4CA783C40EC82923353827C5SHSMSX101ccrcorpi_"
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] Handle broken page with regard to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_004_DE8DF0795D48FD4CA783C40EC82923353827C5SHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Ian Campbell wrote:
> On Wed, 2012-11-07 at 14:25 +0000, Liu, Jinsong wrote:
>> Ian Campbell wrote:
>>>> At the target
>>>>   it would set p2m as p2m_ram_broken for broken page, so that if
>>>>   guest access the broken page again, it would kill itself as
>>>> expected.
>>>=20
>>> Can you add a few words here about why this is preferable to just
>>> ignoring the issue and populating a regular page non-broken page on
>>> the target? I think I know why but it would be useful to be
>>> explicit in the changelog.=20
>>>=20
>>> I also spotted a typo:
>>>> +                     * vMCE occur during migration +
>>>> * +                     *   At sender, it marks broken page to
>>>> dirty bitmap, +                     *   so that at copypages stage
>>>> of migration, brokan
>>>=20
>>>=20
>>> broken
>>>=20
>>> Ian.
>>=20
>> OK, add some comments and correct typo.
>>=20
>> Thanks,
>> Jinsong
>>=20
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> Handle broken page with regard to migration
>>=20
>> Generally, there are 2 cases:
>> 1. broken page occurs before migration
>> 2. broken page occurs during migration
>>=20
>> At the sender
>>   For case 1, the broken page would be mapped but not copied to
>>   target (otherwise it may trigger more serious error, say, SRAR
>>   error). While its pfn_type and pfn number would be transferred to
>>   target so that target take appropriate action.
>>=20
>>   For case 2, mce handler marks the broken page to dirty bitmap, so
>>   that at copypages stage of migration, its pfn_type and pfn number
>>   would be transferred to target and then take appropriate action.
>>=20
>> At the target
>>   When migration target would populate pages for guest. As for the
>>   case of broken page wrt migration, we prefer keep the
>>   corresponding page, for the sake of seamless migration.
>>=20
>>   At target it would set p2m as p2m_ram_broken for broken page.
>>   Guest MCE may have good chance to handle its broken page, while if
>>   guest access the broken page again it would kill itself as
>> expected.=20
>>=20
>> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
>> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
>=20
> I believe George Acked this patch in
> <CAFLBxZYy8mqvfNH4Hp9x=3Do0jqZ4r9hnCS_qLR0O8+rkY2AAdTA@mail.gmail.com>.
> Were there other acks, e.g. from Jan for the hypervisor side?

Attached are acks from George, Jan, and IanJ.

>=20
> Please do collect acks into the commit log and keep them while the
> patch hasn't change substantially to invalidate them (especially when
> a series has had many iterations and variations like this one),
> otherwise I have to go hunting for them which makes it more likely
> that I'll either get distracted or go and apply some easier to deal
> with patch instead.=20
>=20
> Anyway, I afraid that when I went to apply this there were loads of
> rejects, I suspect a conflict with the superpage migration patch,
> sorry. Please can you rebase and resend (with patchbomb).
>=20
> Thanks,
> Ian.
>=20

Yes, it conflicted w/ some other patches.
I've rebased it and added 'Acked-by' (George/Jan/IanJ), will resend soon vi=
a 'hg email' w/ patchbomb.

Thanks,
Jinsong
=20

>>=20
>> diff -r d675797494bd tools/libxc/xc_domain.c
>> --- a/tools/libxc/xc_domain.c   Fri Nov 02 11:08:37 2012 +0800
>> +++ b/tools/libxc/xc_domain.c   Thu Nov 08 05:07:20 2012 +0800 @@
>>      -283,6 +283,22 @@ return ret;
>>  }
>>=20
>> +/* set broken page p2m */
>> +int xc_set_broken_page_p2m(xc_interface *xch,
>> +                           uint32_t domid,
>> +                           unsigned long pfn)
>> +{
>> +    int ret;
>> +    DECLARE_DOMCTL;
>> +
>> +    domctl.cmd =3D XEN_DOMCTL_set_broken_page_p2m;
>> +    domctl.domain =3D (domid_t)domid;
>> +    domctl.u.set_broken_page_p2m.pfn =3D pfn;
>> +    ret =3D do_domctl(xch, &domctl);
>> +
>> +    return ret ? -1 : 0;
>> +}
>> +
>>  /* get info from hvm guest for save */
>>  int xc_domain_hvm_getcontext(xc_interface *xch,
>>                               uint32_t domid,
>> diff -r d675797494bd tools/libxc/xc_domain_restore.c
>> --- a/tools/libxc/xc_domain_restore.c   Fri Nov 02 11:08:37 2012
>> +0800 +++ b/tools/libxc/xc_domain_restore.c   Thu Nov 08 05:07:20
>> 2012 +0800 @@ -962,9 +962,15 @@=20
>>=20
>>      countpages =3D count;
>>      for (i =3D oldcount; i < buf->nr_pages; ++i)
>> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) =3D=3D
>> XEN_DOMCTL_PFINFO_XTAB=20
>> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) =3D=3D
>> XEN_DOMCTL_PFINFO_XALLOC) +    { +        unsigned long pagetype;
>> +
>> +        pagetype =3D buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
>> +        if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTAB ||
>> +             pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN ||
>> +             pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )            =20
>> --countpages; +    }
>>=20
>>      if (!countpages)
>>          return count;
>> @@ -1200,6 +1206,17 @@
>>              /* a bogus/unmapped/allocate-only page: skip it */    =20
>> continue;=20
>>=20
>> +        if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN ) +        {
>> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) ) +        =20
>> { +                ERROR("Set p2m for broken page failed, "
>> +                      "dom=3D%d, pfn=3D%lx\n", dom, pfn);
>> +                goto err_mapped;
>> +            }
>> +            continue;
>> +        }
>> +
>>          if (pfn_err[i])
>>          {
>>              ERROR("unexpected PFN mapping failure pfn %lx map_mfn
>> %lx p2m_mfn %lx",=20
>> diff -r d675797494bd tools/libxc/xc_domain_save.c
>> --- a/tools/libxc/xc_domain_save.c      Fri Nov 02 11:08:37 2012
>> +0800 +++ b/tools/libxc/xc_domain_save.c      Thu Nov 08 05:07:20
>>                  2012 +0800 @@ -1277,6 +1277,13 @@ if ( !hvm )
>>                      gmfn =3D pfn_to_mfn(gmfn);
>>=20
>> +                if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_BROKEN ) +  =
=20
>> { +                    pfn_type[j] |=3D pfn_batch[j];
>> +                    ++run;
>> +                    continue;
>> +                }
>> +
>>                  if ( pfn_err[j] )
>>                  {
>>                      if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_XTAB ) @@
>>                      -1371,8 +1378,12 @@ }
>>                  }
>>=20
>> -                /* skip pages that aren't present or are alloc-only
>> */ +                /* +                 * skip pages that aren't
>> present, +                 * or are broken, or are alloc-only +    =20
>>                  */ if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTAB
>> +                    || pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN
>>                      || pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )
>>                      continue;
>>=20
>> diff -r d675797494bd tools/libxc/xenctrl.h
>> --- a/tools/libxc/xenctrl.h     Fri Nov 02 11:08:37 2012 +0800
>> +++ b/tools/libxc/xenctrl.h     Thu Nov 08 05:07:20 2012 +0800 @@
>>                            -575,6 +575,17 @@ xc_domaininfo_t *info);
>>=20
>>  /**
>> + * This function set p2m for broken page
>> + * &parm xch a handle to an open hypervisor interface
>> + * @parm domid the domain id which broken page belong to
>> + * @parm pfn the pfn number of the broken page
>> + * @return 0 on success, -1 on failure
>> + */
>> +int xc_set_broken_page_p2m(xc_interface *xch,
>> +                           uint32_t domid,
>> +                           unsigned long pfn);
>> +
>> +/**
>>   * This function returns information about the context of a hvm
>> domain=20
>>   * @parm xch a handle to an open hypervisor interface
>>   * @parm domid the domain to get information from
>> diff -r d675797494bd xen/arch/x86/cpu/mcheck/mcaction.c
>> --- a/xen/arch/x86/cpu/mcheck/mcaction.c        Fri Nov 02 11:08:37
>> 2012 +0800 +++ b/xen/arch/x86/cpu/mcheck/mcaction.c        Thu Nov
>>  08 05:07:20 2012 +0800 @@ -1,5 +1,6 @@ #include <xen/types.h>
>>  #include <xen/sched.h>
>> +#include <asm/p2m.h>
>>  #include "mcaction.h"
>>  #include "vmce.h"
>>  #include "mce.h"
>> @@ -91,6 +92,24 @@
>>                      goto vmce_failed;
>>                  }
>>=20
>> +                if ( is_hvm_domain(d) &&
>> !d->arch.hvm_domain.dirty_vram && +                   =20
>> paging_mode_log_dirty(d) ) +                {
>> +                    /*
>> +                     * vMCE occur during migration +              =20
>> * +                     *   At sender, it marks broken page to dirty
>> bitmap, +                     *   so that at copypages stage of
>> migration, broken +                     *   page's pfn_type and pfn
>> number would be transferred +                     *   to target and
>> then take appropriate action. +                     * +            =20
>> *   At target, it would set p2m as p2m_ram_broken for +            =20
>> *   broken page, so that if guest access the broken page +         =20
>> *   again, it would kill itself as expected. +                   =20
>> */ +                    paging_mark_dirty(d, mfn); +                }
>> +
>>                  if ( unmmap_broken_page(d, _mfn(mfn), gfn) )      =20
>>                      { printk("Unmap broken memory %lx for DOM%d
>> failed\n",=20
>> diff -r d675797494bd xen/arch/x86/domctl.c
>> --- a/xen/arch/x86/domctl.c     Fri Nov 02 11:08:37 2012 +0800
>> +++ b/xen/arch/x86/domctl.c     Thu Nov 08 05:07:20 2012 +0800 @@
>>                  -209,12 +209,18 @@ for ( j =3D 0; j < k; j++ )
>>                  {
>>                      unsigned long type =3D 0;
>> +                    p2m_type_t t;
>>=20
>> -                    page =3D get_page_from_gfn(d, arr[j], NULL,
>> P2M_ALLOC); +                    page =3D get_page_from_gfn(d, arr[j],
>> &t, P2M_ALLOC);=20
>>=20
>>                      if ( unlikely(!page) ||
>>                           unlikely(is_xen_heap_page(page)) )
>> -                        type =3D XEN_DOMCTL_PFINFO_XTAB; +          =20
>> { +                        if ( p2m_is_broken(t) )
>> +                            type =3D XEN_DOMCTL_PFINFO_BROKEN; +    =20
>> else +                            type =3D XEN_DOMCTL_PFINFO_XTAB; + =20
>>                      } else
>>                      {
>>                          switch( page->u.inuse.type_info &
>> PGT_type_mask ) @@ -235,6 +241,9 @@=20
>>=20
>>                          if ( page->u.inuse.type_info & PGT_pinned )
>>                              type |=3D XEN_DOMCTL_PFINFO_LPINTAB; +
>> +                        if ( page->count_info & PGC_broken )
>> +                            type =3D XEN_DOMCTL_PFINFO_BROKEN;      =20
>> }=20
>>=20
>>                      if ( page )
>> @@ -1568,6 +1577,29 @@
>>      }
>>      break;
>>=20
>> +    case XEN_DOMCTL_set_broken_page_p2m:
>> +    {
>> +        struct domain *d;
>> +
>> +        d =3D rcu_lock_domain_by_id(domctl->domain); +        if ( d
>> !=3D NULL ) +        {
>> +            p2m_type_t pt;
>> +            unsigned long pfn =3D domctl->u.set_broken_page_p2m.pfn;
>> +            mfn_t mfn =3D get_gfn_query(d, pfn, &pt); +
>> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt)
>> || +                         (p2m_change_type(d, pfn, pt,
>> p2m_ram_broken) !=3D pt)) ) +                ret =3D -EINVAL;
>> +
>> +            put_gfn(d, pfn);
>> +            rcu_unlock_domain(d);
>> +        }
>> +        else
>> +            ret =3D -ESRCH;
>> +    }
>> +    break;
>> +
>>      default:
>>          ret =3D iommu_do_domctl(domctl, u_domctl);
>>          break;
>> diff -r d675797494bd xen/include/public/domctl.h
>> --- a/xen/include/public/domctl.h       Fri Nov 02 11:08:37 2012
>> +0800 +++ b/xen/include/public/domctl.h       Thu Nov 08 05:07:20
>>  2012 +0800 @@ -136,6 +136,7 @@ #define XEN_DOMCTL_PFINFO_LPINTAB
>>  (0x1U<<31) #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid
>>  page */ #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /*
>> allocate-only page */ +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28)
>>  /* broken page */ #define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
>>  #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
>>=20
>> @@ -835,6 +836,12 @@
>>  typedef struct xen_domctl_set_access_required
>>  xen_domctl_set_access_required_t;
>> DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);=20
>>=20
>> +struct xen_domctl_set_broken_page_p2m {
>> +    uint64_aligned_t pfn;
>> +};
>> +typedef struct xen_domctl_set_broken_page_p2m
>> xen_domctl_set_broken_page_p2m_t;
>>  +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t); +
>>      struct xen_domctl { uint32_t cmd;
>>  #define XEN_DOMCTL_createdomain                   1 @@ -900,6
>>  +907,7 @@ #define XEN_DOMCTL_set_access_required           64
>>  #define XEN_DOMCTL_audit_p2m                     65
>>  #define XEN_DOMCTL_set_virq_handler              66
>> +#define XEN_DOMCTL_set_broken_page_p2m           67
>>  #define XEN_DOMCTL_gdbsx_guestmemio            1000
>>  #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>>  #define XEN_DOMCTL_gdbsx_unpausevcpu           1002 @@ -955,6
>>          +963,7 @@ struct xen_domctl_audit_p2m         audit_p2m;
>>          struct xen_domctl_set_virq_handler  set_virq_handler;
>>          struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
>> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>>          struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>>          struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>>          uint8_t                             pad[128];


--_004_DE8DF0795D48FD4CA783C40EC82923353827C5SHSMSX101ccrcorpi_
Content-Type: message/rfc822
Content-Disposition: attachment;
	creation-date="Wed, 14 Nov 2012 17:40:57 GMT";
	modification-date="Wed, 14 Nov 2012 17:40:57 GMT"

Received: from fmsmsx108.amr.corp.intel.com (10.19.9.228) by
 SHSMSX102.ccr.corp.intel.com (10.239.4.154) with Microsoft SMTP Server (TLS)
 id 14.1.355.2; Tue, 6 Nov 2012 23:43:03 +0800
Received: from azsmga001.ch.intel.com (10.2.17.19) by FMSMSX108-1.fm.intel.com
 (10.19.9.228) with Microsoft SMTP Server id 14.1.355.2; Tue, 6 Nov 2012
 07:43:02 -0800
Received: from azsmga102.ch.intel.com ([10.2.16.52])  by
 azsmga001-1.ch.intel.com with ESMTP; 06 Nov 2012 07:42:51 -0800
Received: from mail-vc0-f180.google.com ([209.85.220.180])  by mga14.intel.com
 with ESMTP/TLS/RC4-SHA; 06 Nov 2012 07:42:51 -0800
Received: by mail-vc0-f180.google.com with SMTP id fl13so423911vcb.25
        for <jinsong.liu@intel.com>; Tue, 06 Nov 2012 07:42:50 -0800 (PST)
Received: by 10.220.152.11 with SMTP id e11mr1189476vcw.61.1352216570022; Tue,
 06 Nov 2012 07:42:50 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Tue, 6 Nov 2012 07:42:49 -0800 (PST)
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
CC: "ian.jackson@eu.citrix.com" <ian.jackson@eu.citrix.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>, "xen-devel@lists.xensource.com"
	<xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] Handle broken page with regard to migration
Thread-Topic: [Xen-devel] [PATCH] Handle broken page with regard to migration
Thread-Index: AQHNvDVowo0CS0uWQ02/ywhb/M0oqg==
Sender: "dunlapg@gmail.com" <dunlapg@gmail.com>
Date: Tue, 6 Nov 2012 15:42:49 +0000
Message-ID: <CAFLBxZYy8mqvfNH4Hp9x=o0jqZ4r9hnCS_qLR0O8+rkY2AAdTA@mail.gmail.com>
References: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
In-Reply-To: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Organization-AuthSource: FMSMSX108.amr.corp.intel.com
X-MS-Has-Attach: 
X-Message-Flag: Follow up
X-MS-TNEF-Correlator: 
dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com;
 s=20120113;        h=mime-version:sender:in-reply-to:references:date
         :x-google-sender-auth:message-id:subject:from:to:cc:content-type;
        bh=3Mwt18hOQZbZcCLlJVQIdMoO6nnbB8vmEMZn/3g2skQ=;
        b=LplQQQPSFX/Mpbsmhhgqhwj5k7Jx35Jm6zpp1rfTZNuKc3+5Cq0QZPoEX5YFb1H9MQ
         8X8D+uvKIXfvSX8UFY0sGGRpvC3j1xJMbXgf6VYncygXcAXqH+YKABDttRv0UkEXuq1w
         CDVByoqaBcsyGvqEATMCeOMSRZsXDr5B3zreyjp451q5YWy9OhHMkXtvUzmHBxxRLIcD
         osR3EtLAExWzOsvxrZL5Ll5pOhL/hEc81rS4TAvTMWRlA3lvR/uKEgNwtl5y902OkKR3
         1xGofE010scgmiB0ZIS4eh9DzJIGOqBD/Iz70Rv97nhjo34RgGkgJkj73vCcPEA5n6C/
         grjg==
Content-Type: text/plain; charset="iso-8859-1"
Content-ID: <E704FCC90AD8A74B888A475DA7B7C27D@intel.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

On Fri, Nov 2, 2012 at 3:25 AM, Liu Jinsong <jinsong.liu@intel.com> wrote:
> Generally, there are 2 cases:
> 1. broken page occurs before migration
> 2. broken page occurs during migration
>
> At the sender
>   for case 1, the broken page would be mapped but not copied to target
>   (otherwise it may trigger more serious error, say, SRAR error).
>   While its pfn_type and pfn number would be transferred to target
>   so that target take appropriate action.
>
>   for case 2, mce handler marks the broken page to dirty bitmap, so that
>   at copypages stage of migration, its pfn_type and pfn number would be
>   transferred to target and then take appropriate action.
>
> At the target
>   it would set p2m as p2m_ram_broken for broken page, so that if guest
>   access the broken page again, it would kill itself as expected.
>
> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

Looks good to me -- thanks, Jinsong!

Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

>
> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain.c
> --- a/tools/libxc/xc_domain.c   Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xc_domain.c   Fri Nov 02 11:08:37 2012 +0800
> @@ -283,6 +283,22 @@
>      return ret;
>  }
>
> +/* set broken page p2m */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn)
> +{
> +    int ret;
> +    DECLARE_DOMCTL;
> +
> +    domctl.cmd =3D XEN_DOMCTL_set_broken_page_p2m;
> +    domctl.domain =3D (domid_t)domid;
> +    domctl.u.set_broken_page_p2m.pfn =3D pfn;
> +    ret =3D do_domctl(xch, &domctl);
> +
> +    return ret ? -1 : 0;
> +}
> +
>  /* get info from hvm guest for save */
>  int xc_domain_hvm_getcontext(xc_interface *xch,
>                               uint32_t domid,
> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain_restore.c
> --- a/tools/libxc/xc_domain_restore.c   Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xc_domain_restore.c   Fri Nov 02 11:08:37 2012 +0800
> @@ -962,9 +962,15 @@
>
>      countpages =3D count;
>      for (i =3D oldcount; i < buf->nr_pages; ++i)
> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) =3D=3D XEN=
_DOMCTL_PFINFO_XTAB
> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) =3D=3D X=
EN_DOMCTL_PFINFO_XALLOC)
> +    {
> +        unsigned long pagetype;
> +
> +        pagetype =3D buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
> +        if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTAB ||
> +             pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN ||
> +             pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )
>              --countpages;
> +    }
>
>      if (!countpages)
>          return count;
> @@ -1200,6 +1206,17 @@
>              /* a bogus/unmapped/allocate-only page: skip it */
>              continue;
>
> +        if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN )
> +        {
> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
> +            {
> +                ERROR("Set p2m for broken page failed, "
> +                      "dom=3D%d, pfn=3D%lx\n", dom, pfn);
> +                goto err_mapped;
> +            }
> +            continue;
> +        }
> +
>          if (pfn_err[i])
>          {
>              ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2=
m_mfn %lx",
> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xc_domain_save.c
> --- a/tools/libxc/xc_domain_save.c      Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xc_domain_save.c      Fri Nov 02 11:08:37 2012 +0800
> @@ -1277,6 +1277,13 @@
>                  if ( !hvm )
>                      gmfn =3D pfn_to_mfn(gmfn);
>
> +                if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_BROKEN )
> +                {
> +                    pfn_type[j] |=3D pfn_batch[j];
> +                    ++run;
> +                    continue;
> +                }
> +
>                  if ( pfn_err[j] )
>                  {
>                      if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_XTAB )
> @@ -1371,8 +1378,12 @@
>                      }
>                  }
>
> -                /* skip pages that aren't present or are alloc-only */
> +                /*
> +                 * skip pages that aren't present,
> +                 * or are broken, or are alloc-only
> +                 */
>                  if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTAB
> +                    || pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN
>                      || pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )
>                      continue;
>
> diff -r d675797494bd -r 730dd3f22a12 tools/libxc/xenctrl.h
> --- a/tools/libxc/xenctrl.h     Fri Nov 02 11:08:37 2012 +0800
> +++ b/tools/libxc/xenctrl.h     Fri Nov 02 11:08:37 2012 +0800
> @@ -575,6 +575,17 @@
>                            xc_domaininfo_t *info);
>
>  /**
> + * This function set p2m for broken page
> + * &parm xch a handle to an open hypervisor interface
> + * @parm domid the domain id which broken page belong to
> + * @parm pfn the pfn number of the broken page
> + * @return 0 on success, -1 on failure
> + */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn);
> +
> +/**
>   * This function returns information about the context of a hvm domain
>   * @parm xch a handle to an open hypervisor interface
>   * @parm domid the domain to get information from
> diff -r d675797494bd -r 730dd3f22a12 xen/arch/x86/cpu/mcheck/mcaction.c
> --- a/xen/arch/x86/cpu/mcheck/mcaction.c        Fri Nov 02 11:08:37 2012 =
+0800
> +++ b/xen/arch/x86/cpu/mcheck/mcaction.c        Fri Nov 02 11:08:37 2012 =
+0800
> @@ -1,5 +1,6 @@
>  #include <xen/types.h>
>  #include <xen/sched.h>
> +#include <asm/p2m.h>
>  #include "mcaction.h"
>  #include "vmce.h"
>  #include "mce.h"
> @@ -91,6 +92,24 @@
>                      goto vmce_failed;
>                  }
>
> +                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram =
&&
> +                     paging_mode_log_dirty(d) )
> +                {
> +                    /*
> +                     * vMCE occur during migration
> +                     *
> +                     *   At sender, it marks broken page to dirty bitmap=
,
> +                     *   so that at copypages stage of migration, brokan
> +                     *   page's pfn_type and pfn number would be transfe=
rred
> +                     *   to target and then take appropriate action.
> +                     *
> +                     *   At target, it would set p2m as p2m_ram_broken f=
or
> +                     *   broken page, so that if guest access the broken=
 page
> +                     *   again, it would kill itself as expected.
> +                     */
> +                    paging_mark_dirty(d, mfn);
> +                }
> +
>                  if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
>                  {
>                      printk("Unmap broken memory %lx for DOM%d failed\n",
> diff -r d675797494bd -r 730dd3f22a12 xen/arch/x86/domctl.c
> --- a/xen/arch/x86/domctl.c     Fri Nov 02 11:08:37 2012 +0800
> +++ b/xen/arch/x86/domctl.c     Fri Nov 02 11:08:37 2012 +0800
> @@ -209,12 +209,18 @@
>                  for ( j =3D 0; j < k; j++ )
>                  {
>                      unsigned long type =3D 0;
> +                    p2m_type_t t;
>
> -                    page =3D get_page_from_gfn(d, arr[j], NULL, P2M_ALLO=
C);
> +                    page =3D get_page_from_gfn(d, arr[j], &t, P2M_ALLOC)=
;
>
>                      if ( unlikely(!page) ||
>                           unlikely(is_xen_heap_page(page)) )
> -                        type =3D XEN_DOMCTL_PFINFO_XTAB;
> +                    {
> +                        if ( p2m_is_broken(t) )
> +                            type =3D XEN_DOMCTL_PFINFO_BROKEN;
> +                        else
> +                            type =3D XEN_DOMCTL_PFINFO_XTAB;
> +                    }
>                      else
>                      {
>                          switch( page->u.inuse.type_info & PGT_type_mask =
)
> @@ -235,6 +241,9 @@
>
>                          if ( page->u.inuse.type_info & PGT_pinned )
>                              type |=3D XEN_DOMCTL_PFINFO_LPINTAB;
> +
> +                        if ( page->count_info & PGC_broken )
> +                            type =3D XEN_DOMCTL_PFINFO_BROKEN;
>                      }
>
>                      if ( page )
> @@ -1568,6 +1577,29 @@
>      }
>      break;
>
> +    case XEN_DOMCTL_set_broken_page_p2m:
> +    {
> +        struct domain *d;
> +
> +        d =3D rcu_lock_domain_by_id(domctl->domain);
> +        if ( d !=3D NULL )
> +        {
> +            p2m_type_t pt;
> +            unsigned long pfn =3D domctl->u.set_broken_page_p2m.pfn;
> +            mfn_t mfn =3D get_gfn_query(d, pfn, &pt);
> +
> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
> +                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) !=
=3D pt)) )
> +                ret =3D -EINVAL;
> +
> +            put_gfn(d, pfn);
> +            rcu_unlock_domain(d);
> +        }
> +        else
> +            ret =3D -ESRCH;
> +    }
> +    break;
> +
>      default:
>          ret =3D iommu_do_domctl(domctl, u_domctl);
>          break;
> diff -r d675797494bd -r 730dd3f22a12 xen/include/public/domctl.h
> --- a/xen/include/public/domctl.h       Fri Nov 02 11:08:37 2012 +0800
> +++ b/xen/include/public/domctl.h       Fri Nov 02 11:08:37 2012 +0800
> @@ -136,6 +136,7 @@
>  #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
>  #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
>  #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
> +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
>  #define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
>  #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
>
> @@ -835,6 +836,12 @@
>  typedef struct xen_domctl_set_access_required xen_domctl_set_access_requ=
ired_t;
>  DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
>
> +struct xen_domctl_set_broken_page_p2m {
> +    uint64_aligned_t pfn;
> +};
> +typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page=
_p2m_t;
> +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
> +
>  struct xen_domctl {
>      uint32_t cmd;
>  #define XEN_DOMCTL_createdomain                   1
> @@ -900,6 +907,7 @@
>  #define XEN_DOMCTL_set_access_required           64
>  #define XEN_DOMCTL_audit_p2m                     65
>  #define XEN_DOMCTL_set_virq_handler              66
> +#define XEN_DOMCTL_set_broken_page_p2m           67
>  #define XEN_DOMCTL_gdbsx_guestmemio            1000
>  #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>  #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
> @@ -955,6 +963,7 @@
>          struct xen_domctl_audit_p2m         audit_p2m;
>          struct xen_domctl_set_virq_handler  set_virq_handler;
>          struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>          struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>          struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>          uint8_t                             pad[128];
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

--_004_DE8DF0795D48FD4CA783C40EC82923353827C5SHSMSX101ccrcorpi_
Content-Type: message/rfc822
Content-Disposition: attachment;
	creation-date="Wed, 14 Nov 2012 17:40:57 GMT";
	modification-date="Wed, 14 Nov 2012 17:40:57 GMT"

Received: from fmsmsx106.amr.corp.intel.com (10.19.9.37) by
 SHSMSX151.ccr.corp.intel.com (10.239.6.50) with Microsoft SMTP Server (TLS)
 id 14.1.355.2; Thu, 25 Oct 2012 19:22:52 +0800
Received: from fmsmga002.fm.intel.com (10.253.24.26) by
 FMSMSX106-1.fm.intel.com (10.19.9.37) with Microsoft SMTP Server id
 14.1.355.2; Thu, 25 Oct 2012 04:22:51 -0700
Received: from fmsmga101.fm.intel.com ([10.1.193.65])  by
 fmsmga002-1.fm.intel.com with ESMTP; 25 Oct 2012 04:22:36 -0700
Received: from smtp.eu.citrix.com ([62.200.22.115])  by mga01.intel.com with
 ESMTP; 25 Oct 2012 04:22:27 -0700
Received: from lonpmailmx01.citrite.net ([10.30.203.162])  by
 LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5; 25 Oct 2012 11:21:20 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
 smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
 Thu, 25 Oct 2012 12:21:20 +0100
Received: from mariner.cam.xci-test.com	([10.80.2.22]
 helo=mariner.uk.xensource.com ident=Debian-exim)	by norwich.cam.xci-test.com
 with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
 1TRLV2-0003qs-58; Thu, 25 Oct 2012 11:21:20 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TRLV2-0000iT-1I; Thu, 25 Oct
 2012 12:21:20 +0100
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
CC: Christoph Egger <Christoph.Egger@amd.com>, "xen-devel@lists.xensource.com"
	<xen-devel@lists.xensource.com>, "Keir (Xen.org)" <keir@xen.org>, Ian
 Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH 4/5] Xen/MCE: Abort live migration	when	vMCE
	occur
Thread-Topic: [Xen-devel] [PATCH 4/5] Xen/MCE: Abort live migration	when
	vMCE	occur
Thread-Index: AQHNsqMT37eXSzhKqkORq5TmD1OlTw==
Date: Thu, 25 Oct 2012 11:21:19 +0000
Message-ID: <20617.8367.946706.92097@mariner.uk.xensource.com>
References: <DE8DF0795D48FD4CA783C40EC829233534A62F@SHSMSX101.ccr.corp.intel.com>
	<20609.26910.2416.305293@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC82923353610F0@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC8292335361F91@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC8292335361F91@SHSMSX101.ccr.corp.intel.com>
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Organization-AuthSource: FMSMSX106.amr.corp.intel.com
X-MS-Has-Attach: 
X-Message-Flag: Follow up
X-MS-TNEF-Correlator: 
x-ironport-av: E=Sophos;i="4.80,646,1344211200";    d="scan'208";a="15385861"
x-ironport-anti-spam-filtered: true
x-ironport-anti-spam-result: AlIBAH4giVA+yBZznGdsb2JhbABEhU+8UiMBAQEBAQgLCQkUJ4IfAQEBAwEBATcZJhALNhA8GwYOBYgIvV+STgOpIQ
Content-Type: text/plain; charset="us-ascii"
Content-ID: <A746355994264A419436FCFB6A375B52@intel.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

Liu, Jinsong writes ("Re: [Xen-devel] [PATCH 4/5] Xen/MCE: Abort live migra=
tion when	vMCE	occur"):
> Update patch 4/5 as attached.

Thanks.  As for the tools parts:

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Ian.

--_004_DE8DF0795D48FD4CA783C40EC82923353827C5SHSMSX101ccrcorpi_
Content-Type: message/rfc822
Content-Disposition: attachment;
	creation-date="Wed, 14 Nov 2012 17:40:57 GMT";
	modification-date="Wed, 14 Nov 2012 17:40:57 GMT"

Received: from fmsmsx104.amr.corp.intel.com (10.19.9.35) by
 SHSMSX151.ccr.corp.intel.com (10.239.6.50) with Microsoft SMTP Server (TLS)
 id 14.1.355.2; Tue, 28 Aug 2012 22:06:14 +0800
Received: from AZSMGA002.ch.intel.com (10.2.17.35) by FMSMSX104-1.fm.intel.com
 (10.19.9.35) with Microsoft SMTP Server id 14.1.355.2; Tue, 28 Aug 2012
 07:06:12 -0700
Received: from azsmga101.ch.intel.com ([10.2.16.36])  by
 AZSMGA002-1.ch.intel.com with ESMTP; 28 Aug 2012 07:05:54 -0700
Received: from nat28.tlf.novell.com ([130.57.49.28])  by mga03.intel.com with
 ESMTP; 28 Aug 2012 07:05:51 -0700
Received: from EMEA1-MTA by nat28.tlf.novell.com	with Novell_GroupWise; Tue,
 28 Aug 2012 15:05:50 +0100
From: Jan Beulich <jbeulich@suse.com>
To: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>, "Liu, Jinsong"
	<jinsong.liu@intel.com>
CC: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, "keir@xen.org"
	<keir@xen.org>
Subject: Re: [PATCH] X86/vMCE: guest broken page handling when migration
Thread-Topic: [PATCH] X86/vMCE: guest broken page handling when migration
Thread-Index: AQHNhSY5Zp6ZOLjuREqA3X3AgCYhPw==
Date: Tue, 28 Aug 2012 14:05:48 +0000
Message-ID: <503CDE4C020000780008AA09@nat28.tlf.novell.com>
References: <DE8DF0795D48FD4CA783C40EC8292335317D90@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC8292335317D90@SHSMSX101.ccr.corp.intel.com>
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Organization-AuthSource: FMSMSX104.amr.corp.intel.com
X-MS-Has-Attach: 
X-Message-Flag: Follow up
X-MS-TNEF-Correlator: 
x-ironport-av: E=Sophos;i="4.80,326,1344236400";    d="scan'208";a="1079254"
x-ironport-anti-spam-filtered: true
x-ironport-anti-spam-result: AkQDAMfPPFCCOTEcmWdsb2JhbABFhTwBtCoEBHsiAQEBAQEICwsHFCeCIQEFOj8QCzQSVwYBCQmIDbwFjkWCPGADjVyHepJ5
Content-Type: text/plain; charset="us-ascii"
Content-ID: <D156595E82024E42B7E735592914DDCB@intel.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

>>> "Liu, Jinsong" <jinsong.liu@intel.com> 08/27/12 4:13 AM >>>=20
>X86/vMCE: guest broken page handling when migration=20
>
>This patch is used to handle guest broken page when migration.=20
>
>At sender, the broken page would not be mapped, and the error page=20
>content would not be copied to target, otherwise it may trigger more=20
>serious error (i.e. SRAR error). While its pfn_type and pfn number=20
>would be transferred to target so that target take appropriate action.=20
>
>At target, it would set p2m as p2m_ram_broken for broken page, so that=20
>if guest crazy access the broken page again, it would kill guest as expect=
ed.=20

Looks okay to me, but would also need looking at by a tools person of cours=
e.

Please add to your series when you resubmit past-4.2.

=20

Thanks, Jan

--_004_DE8DF0795D48FD4CA783C40EC82923353827C5SHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_004_DE8DF0795D48FD4CA783C40EC82923353827C5SHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Wed Nov 14 17:41:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 17:41:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYgxw-0001jm-42; Wed, 14 Nov 2012 17:41:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYgxt-0001iX-V0
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 17:41:30 +0000
Received: from [85.158.139.211:19245] by server-12.bemta-5.messagelabs.com id
	34/4B-02886-9C7D3A05; Wed, 14 Nov 2012 17:41:29 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1352914888!20197162!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11325 invoked from network); 14 Nov 2012 17:41:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 17:41:28 -0000
X-IronPort-AV: E=Sophos;i="4.83,252,1352073600"; d="scan'208";a="15811088"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 17:41:28 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 14 Nov 2012 17:41:27 +0000
Message-ID: <1352914886.3499.25.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
Date: Wed, 14 Nov 2012 17:41:26 +0000
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48A23D8047@aplesstripe.dom1.jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
	<20121114150307.GA17986@aepfle.de>
	<068F06DC4D106941B297C0C5F9F446EA48A23D7F7E@aplesstripe.dom1.jhuapl.edu>
	<1352909100.3499.20.camel@zakaz.uk.xensource.com>
	<068F06DC4D106941B297C0C5F9F446EA48A23D8047@aplesstripe.dom1.jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gV2VkLCAyMDEyLTExLTE0IGF0IDE2OjU4ICswMDAwLCBGaW9yYXZhbnRlLCBNYXR0aGV3IEUu
IHdyb3RlOgo+IFllcyB5b3UgbmVlZCB0byBydW4gaXQuCgpEb25lIGFuZCBwdXNoZWQuCgo+ICBO
ZXh0IHJvdW5kIEnigJlsbCBpbmNsdWRlIGEgc2VwYXJhdGUgcGF0Y2ggYWZ0ZXIgdGhlIGJpZyBy
ZW1vdmUgcGF0Y2gKPiB3aXRoIHRoZSBuZXcgY29uZmlndXJlIHNjcmlwdC4gWW91IGNhbiB1c2Ug
bWluZSBvciBydW4gYXV0b2NvbmYKPiB5b3Vyc2VsZi4KClBsZWFzZSBjYW4geW91IHB0IGEgbm90
ZSBpbiB0aGUgcGF0Y2ggd2hpY2ggY2hhbmdlIGNvbmZpZ3VyZS5hYyB0bwpyZW1pbmQgbWUgdG8g
cmVydW4gaXQsIG5vIG5lZWQgdG8gc3VwcGx5IGEgZGlmZmVyZW50IHBhdGNoIHVubGVzcyB5b3UK
d2FudCB0by4KClNlZSAyNjAxMjowMmU3NDRkYTUyYzkgZm9yIGFuIGV4YW1wbGUuCgo+IEknbSBq
dXN0IHdhaXRpbmcgZm9yIGRvY3VtZW50YXRpb24gaW50ZXJuYWwgcmV2aWV3IHRvIGZpbmlzaCBh
bmQgdGhlbgo+IEkgd2lsbCBzZW5kIG91dCB0aGUgcGF0Y2hlcyBhZ2Fpbi4KCkNvb2wuCgpJYW4u
CgoKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fClhlbi1k
ZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxpc3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhl
bi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Wed Nov 14 17:41:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 17:41:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYgxw-0001jm-42; Wed, 14 Nov 2012 17:41:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYgxt-0001iX-V0
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 17:41:30 +0000
Received: from [85.158.139.211:19245] by server-12.bemta-5.messagelabs.com id
	34/4B-02886-9C7D3A05; Wed, 14 Nov 2012 17:41:29 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1352914888!20197162!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11325 invoked from network); 14 Nov 2012 17:41:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 17:41:28 -0000
X-IronPort-AV: E=Sophos;i="4.83,252,1352073600"; d="scan'208";a="15811088"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 17:41:28 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 14 Nov 2012 17:41:27 +0000
Message-ID: <1352914886.3499.25.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
Date: Wed, 14 Nov 2012 17:41:26 +0000
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48A23D8047@aplesstripe.dom1.jhuapl.edu>
References: <1351802150-19258-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352803755.7491.47.camel@zakaz.uk.xensource.com>
	<20121114150307.GA17986@aepfle.de>
	<068F06DC4D106941B297C0C5F9F446EA48A23D7F7E@aplesstripe.dom1.jhuapl.edu>
	<1352909100.3499.20.camel@zakaz.uk.xensource.com>
	<068F06DC4D106941B297C0C5F9F446EA48A23D8047@aplesstripe.dom1.jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH VTPM 6/9] Remove the vtpm process model
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gV2VkLCAyMDEyLTExLTE0IGF0IDE2OjU4ICswMDAwLCBGaW9yYXZhbnRlLCBNYXR0aGV3IEUu
IHdyb3RlOgo+IFllcyB5b3UgbmVlZCB0byBydW4gaXQuCgpEb25lIGFuZCBwdXNoZWQuCgo+ICBO
ZXh0IHJvdW5kIEnigJlsbCBpbmNsdWRlIGEgc2VwYXJhdGUgcGF0Y2ggYWZ0ZXIgdGhlIGJpZyBy
ZW1vdmUgcGF0Y2gKPiB3aXRoIHRoZSBuZXcgY29uZmlndXJlIHNjcmlwdC4gWW91IGNhbiB1c2Ug
bWluZSBvciBydW4gYXV0b2NvbmYKPiB5b3Vyc2VsZi4KClBsZWFzZSBjYW4geW91IHB0IGEgbm90
ZSBpbiB0aGUgcGF0Y2ggd2hpY2ggY2hhbmdlIGNvbmZpZ3VyZS5hYyB0bwpyZW1pbmQgbWUgdG8g
cmVydW4gaXQsIG5vIG5lZWQgdG8gc3VwcGx5IGEgZGlmZmVyZW50IHBhdGNoIHVubGVzcyB5b3UK
d2FudCB0by4KClNlZSAyNjAxMjowMmU3NDRkYTUyYzkgZm9yIGFuIGV4YW1wbGUuCgo+IEknbSBq
dXN0IHdhaXRpbmcgZm9yIGRvY3VtZW50YXRpb24gaW50ZXJuYWwgcmV2aWV3IHRvIGZpbmlzaCBh
bmQgdGhlbgo+IEkgd2lsbCBzZW5kIG91dCB0aGUgcGF0Y2hlcyBhZ2Fpbi4KCkNvb2wuCgpJYW4u
CgoKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fClhlbi1k
ZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxpc3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhl
bi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Wed Nov 14 17:42:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 17:42:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYgyd-0001qD-Hy; Wed, 14 Nov 2012 17:42:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TYgyc-0001q4-Ae
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 17:42:14 +0000
Received: from [193.109.254.147:17518] by server-2.bemta-14.messagelabs.com id
	08/93-20829-5F7D3A05; Wed, 14 Nov 2012 17:42:13 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352914929!8298225!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTI0Mzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26948 invoked from network); 14 Nov 2012 17:42:11 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-5.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 17:42:11 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAEHg7rv028551
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 17:42:07 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAEHg66C009518
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Nov 2012 17:42:07 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAEHg6jl022193; Wed, 14 Nov 2012 11:42:06 -0600
MIME-Version: 1.0
Message-ID: <c6b2faed-a38b-4bb7-8bc8-361513837569@default>
Date: Wed, 14 Nov 2012 09:42:03 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Keir Fraser <keir.xen@gmail.com>, Jan Beulich <JBeulich@suse.com>,
	TimDeegan <tim@xen.org>
References: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
	<CCC8F78C.44A23%keir.xen@gmail.com>
In-Reply-To: <CCC8F78C.44A23%keir.xen@gmail.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Keir Fraser [mailto:keir.xen@gmail.com]
> Sent: Wednesday, November 14, 2012 12:24 AM
> To: Dan Magenheimer; Jan Beulich; TimDeegan
> Cc: xen-devel@lists.xen.org; Zhigang Wang; Konrad Rzeszutek Wilk
> Subject: Re: [RFC/PATCH] XENMEM_claim_pages (subop of an existing) hypercall
> 
> On 13/11/2012 22:23, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:
> 
> > The key variables (d->unclaimed_pages and total_unclaimed_pages)
> > start at zero if no claim has yet been staked for any domain.
> > (Perhaps a better name is "claimed_but_not_yet_possessed" but that's
> > a bit unwieldy.)  If no claim hypercalls are executed, there
> > should be no impact on existing usage.

Hi Keir --

Thanks for the feedback!

> It would be nice if d->tot_pages adjustments didn't take the global
> heap_lock in this case. There's probably some way to bail out of those new
> update functions before doing the locked work, in that case.

I agree.  I played with atomics for a bit but couldn't
see a way it would work without races.  The generic
pseudo-code is

	if (A) {
		atomically {
			modify A
			modify d->B
		}
	} else {
		modify d->B
	}

Any ideas?

Or possibly if your suggestion from a couple weeks ago (attached
below) is implemented, the heap_lock will always be held so
briefly in alloc/free_heap_pages that taking heap_lock briefly
in domain_de/increase_tot_pages will no longer be an issue?

Thanks,
Dan

> -----Original Message-----
> From: Keir Fraser [mailto:keir@xen.org]
> Sent: Friday, November 02, 2012 3:30 AM
> To: Jan Beulich; Dan Magenheimer
> Cc: Olaf Hering; IanCampbell; George Dunlap; Ian Jackson; George Shuklin; DarioFaggioli; xen-
> devel@lists.xen.org; Konrad Rzeszutek Wilk; Kurt Hackel; Mukesh Rathor; Zhigang Wang; TimDeegan
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> 
> On 02/11/2012 09:01, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
> > Plus, if necessary, that loop could be broken up so that only the
> > initial part of it gets run with the lock held (see c/s
> > 22135:69e8bb164683 for why the unlock was moved past the
> > loop). That would make for a shorter lock hold time, but for a
> > higher allocation latency on large oder allocations (due to worse
> > cache locality).
> 
> In fact I believe only the first page needs to have its count_info set to !=
> PGC_state_free, while the lock is held. That is sufficient to defeat the
> buddy merging in free_heap_pages(). Similarly, we could hoist most of the
> first loop in free_heap_pages() outside the lock. There's a lot of scope for
> optimisation here.
> 
>  -- Keir

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 17:42:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 17:42:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYgyd-0001qD-Hy; Wed, 14 Nov 2012 17:42:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TYgyc-0001q4-Ae
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 17:42:14 +0000
Received: from [193.109.254.147:17518] by server-2.bemta-14.messagelabs.com id
	08/93-20829-5F7D3A05; Wed, 14 Nov 2012 17:42:13 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352914929!8298225!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTI0Mzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26948 invoked from network); 14 Nov 2012 17:42:11 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-5.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 17:42:11 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAEHg7rv028551
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 17:42:07 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAEHg66C009518
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Nov 2012 17:42:07 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAEHg6jl022193; Wed, 14 Nov 2012 11:42:06 -0600
MIME-Version: 1.0
Message-ID: <c6b2faed-a38b-4bb7-8bc8-361513837569@default>
Date: Wed, 14 Nov 2012 09:42:03 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Keir Fraser <keir.xen@gmail.com>, Jan Beulich <JBeulich@suse.com>,
	TimDeegan <tim@xen.org>
References: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
	<CCC8F78C.44A23%keir.xen@gmail.com>
In-Reply-To: <CCC8F78C.44A23%keir.xen@gmail.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Keir Fraser [mailto:keir.xen@gmail.com]
> Sent: Wednesday, November 14, 2012 12:24 AM
> To: Dan Magenheimer; Jan Beulich; TimDeegan
> Cc: xen-devel@lists.xen.org; Zhigang Wang; Konrad Rzeszutek Wilk
> Subject: Re: [RFC/PATCH] XENMEM_claim_pages (subop of an existing) hypercall
> 
> On 13/11/2012 22:23, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:
> 
> > The key variables (d->unclaimed_pages and total_unclaimed_pages)
> > start at zero if no claim has yet been staked for any domain.
> > (Perhaps a better name is "claimed_but_not_yet_possessed" but that's
> > a bit unwieldy.)  If no claim hypercalls are executed, there
> > should be no impact on existing usage.

Hi Keir --

Thanks for the feedback!

> It would be nice if d->tot_pages adjustments didn't take the global
> heap_lock in this case. There's probably some way to bail out of those new
> update functions before doing the locked work, in that case.

I agree.  I played with atomics for a bit but couldn't
see a way it would work without races.  The generic
pseudo-code is

	if (A) {
		atomically {
			modify A
			modify d->B
		}
	} else {
		modify d->B
	}

Any ideas?

Or possibly if your suggestion from a couple weeks ago (attached
below) is implemented, the heap_lock will always be held so
briefly in alloc/free_heap_pages that taking heap_lock briefly
in domain_de/increase_tot_pages will no longer be an issue?

Thanks,
Dan

> -----Original Message-----
> From: Keir Fraser [mailto:keir@xen.org]
> Sent: Friday, November 02, 2012 3:30 AM
> To: Jan Beulich; Dan Magenheimer
> Cc: Olaf Hering; IanCampbell; George Dunlap; Ian Jackson; George Shuklin; DarioFaggioli; xen-
> devel@lists.xen.org; Konrad Rzeszutek Wilk; Kurt Hackel; Mukesh Rathor; Zhigang Wang; TimDeegan
> Subject: Re: Proposed new "memory capacity claim" hypercall/feature
> 
> On 02/11/2012 09:01, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
> > Plus, if necessary, that loop could be broken up so that only the
> > initial part of it gets run with the lock held (see c/s
> > 22135:69e8bb164683 for why the unlock was moved past the
> > loop). That would make for a shorter lock hold time, but for a
> > higher allocation latency on large oder allocations (due to worse
> > cache locality).
> 
> In fact I believe only the first page needs to have its count_info set to !=
> PGC_state_free, while the lock is held. That is sufficient to defeat the
> buddy merging in free_heap_pages(). Similarly, we could hoist most of the
> first loop in free_heap_pages() outside the lock. There's a lot of scope for
> optimisation here.
> 
>  -- Keir

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 18:01:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 18:01:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYhGb-0002Sa-GH; Wed, 14 Nov 2012 18:00:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TYhGZ-0002Rj-Dh
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 18:00:47 +0000
Received: from [85.158.137.99:54211] by server-16.bemta-3.messagelabs.com id
	2C/6A-07461-E4CD3A05; Wed, 14 Nov 2012 18:00:46 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1352916044!13986373!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY1NTMy\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12819 invoked from network); 14 Nov 2012 18:00:45 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-6.tower-217.messagelabs.com with SMTP;
	14 Nov 2012 18:00:45 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 14 Nov 2012 10:00:01 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,252,1352102400"; d="scan'208";a="219657978"
Received: from ljsromley.bj.intel.com ([10.240.192.102])
	by orsmga001.jf.intel.com with ESMTP; 14 Nov 2012 10:00:24 -0800
MIME-Version: 1.0
X-Mercurial-Node: da7faf53790e661cb6c417fc28e76aebe8ab4415
Message-Id: <da7faf53790e661cb6c4.1352944365@ljsromley.bj.intel.com>
User-Agent: Mercurial-patchbomb/1.4
Date: Thu, 15 Nov 2012 09:52:45 +0800
From: Liu Jinsong <jinsong.liu@intel.com>
To: ian.campbell@citrix.com, george.dunlap@eu.citrix.com,
	Ian.Jackson@eu.citrix.com, JBeulich@suse.com
Cc: jinsong.liu@intel.com, xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH V2] X86/vMCE: handle broken page with regard to
	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Generally, there are 2 cases:
1. broken page occurs before migration
2. broken page occurs during migration

At the sender
  For case 1, the broken page would be mapped but not copied to target
  (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number would be transferred to target
  so that target take appropriate action.

  For case 2, mce handler marks the broken page to dirty bitmap, so that
  at copypages stage of migration, its pfn_type and pfn number would be
  transferred to target and then take appropriate action.

At the target
  When migration target would populate pages for guest. As for the case
  of broken page wrt migration, we prefer keep the corresponding page,
  for the sake of seamless migration.

  At target it would set p2m as p2m_ram_broken for broken page. Guest MCE
  may have good chance to handle its broken page, while if guest access
  the broken page again it would kill itself as expected.

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Jan Beulich <JBeulich@suse.com>

diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain.c	Thu Nov 15 09:42:24 2012 +0800
@@ -283,6 +283,22 @@
     return ret;
 }
 
+/* set broken page p2m */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn)
+{
+    int ret;
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
+    domctl.domain = (domid_t)domid;
+    domctl.u.set_broken_page_p2m.pfn = pfn;
+    ret = do_domctl(xch, &domctl);
+
+    return ret ? -1 : 0;
+}
+
 /* get info from hvm guest for save */
 int xc_domain_hvm_getcontext(xc_interface *xch,
                              uint32_t domid,
diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_restore.c	Thu Nov 15 09:42:24 2012 +0800
@@ -1023,9 +1023,15 @@
 
     countpages = count;
     for (i = oldcount; i < buf->nr_pages; ++i)
-        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
-            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
+    {
+        unsigned long pagetype;
+
+        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
+        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
+             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
+             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
             --countpages;
+    }
 
     if (!countpages)
         return count;
@@ -1267,6 +1273,17 @@
             /* a bogus/unmapped/allocate-only page: skip it */
             continue;
 
+        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
+        {
+            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
+            {
+                ERROR("Set p2m for broken page failed, "
+                      "dom=%d, pfn=%lx\n", dom, pfn);
+                goto err_mapped;
+            }
+            continue;
+        }
+
         if (pfn_err[i])
         {
             ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_save.c	Thu Nov 15 09:42:24 2012 +0800
@@ -1277,6 +1277,13 @@
                 if ( !hvm )
                     gmfn = pfn_to_mfn(gmfn);
 
+                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                {
+                    pfn_type[j] |= pfn_batch[j];
+                    ++run;
+                    continue;
+                }
+
                 if ( pfn_err[j] )
                 {
                     if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
@@ -1371,8 +1378,12 @@
                     }
                 }
 
-                /* skip pages that aren't present or are alloc-only */
+                /*
+                 * skip pages that aren't present,
+                 * or are broken, or are alloc-only
+                 */
                 if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
+                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
                     || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
                     continue;
 
diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xenctrl.h	Thu Nov 15 09:42:24 2012 +0800
@@ -575,6 +575,17 @@
                           xc_domaininfo_t *info);
 
 /**
+ * This function set p2m for broken page
+ * &parm xch a handle to an open hypervisor interface
+ * @parm domid the domain id which broken page belong to
+ * @parm pfn the pfn number of the broken page
+ * @return 0 on success, -1 on failure
+ */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn);
+
+/**
  * This function returns information about the context of a hvm domain
  * @parm xch a handle to an open hypervisor interface
  * @parm domid the domain to get information from
diff -r 8b93ac0c93f3 -r da7faf53790e xen/arch/x86/cpu/mcheck/mcaction.c
--- a/xen/arch/x86/cpu/mcheck/mcaction.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Thu Nov 15 09:42:24 2012 +0800
@@ -1,5 +1,6 @@
 #include <xen/types.h>
 #include <xen/sched.h>
+#include <asm/p2m.h>
 #include "mcaction.h"
 #include "vmce.h"
 #include "mce.h"
@@ -91,6 +92,24 @@
                     goto vmce_failed;
                 }
 
+                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram &&
+                     paging_mode_log_dirty(d) )
+                {
+                    /*
+                     * vMCE occur during migration
+                     *
+                     *   At sender, it marks broken page to dirty bitmap,
+                     *   so that at copypages stage of migration, broken
+                     *   page's pfn_type and pfn number would be transferred
+                     *   to target and then take appropriate action.
+                     *
+                     *   At target, it would set p2m as p2m_ram_broken for
+                     *   broken page, so that if guest access the broken page
+                     *   again, it would kill itself as expected.
+                     */
+                    paging_mark_dirty(d, mfn);
+                }
+
                 if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
                 {
                     printk("Unmap broken memory %lx for DOM%d failed\n",
diff -r 8b93ac0c93f3 -r da7faf53790e xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/arch/x86/domctl.c	Thu Nov 15 09:42:24 2012 +0800
@@ -209,12 +209,18 @@
                 for ( j = 0; j < k; j++ )
                 {
                     unsigned long type = 0;
+                    p2m_type_t t;
 
-                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
+                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
 
                     if ( unlikely(!page) ||
                          unlikely(is_xen_heap_page(page)) )
-                        type = XEN_DOMCTL_PFINFO_XTAB;
+                    {
+                        if ( p2m_is_broken(t) )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
+                        else
+                            type = XEN_DOMCTL_PFINFO_XTAB;
+                    }
                     else
                     {
                         switch( page->u.inuse.type_info & PGT_type_mask )
@@ -235,6 +241,9 @@
 
                         if ( page->u.inuse.type_info & PGT_pinned )
                             type |= XEN_DOMCTL_PFINFO_LPINTAB;
+
+                        if ( page->count_info & PGC_broken )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
                     }
 
                     if ( page )
@@ -1568,6 +1577,29 @@
     }
     break;
 
+    case XEN_DOMCTL_set_broken_page_p2m:
+    {
+        struct domain *d;
+
+        d = rcu_lock_domain_by_id(domctl->domain);
+        if ( d != NULL )
+        {
+            p2m_type_t pt;
+            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
+            mfn_t mfn = get_gfn_query(d, pfn, &pt);
+
+            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
+                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
+                ret = -EINVAL;
+
+            put_gfn(d, pfn);
+            rcu_unlock_domain(d);
+        }
+        else
+            ret = -ESRCH;
+    }
+    break;
+
     default:
         ret = iommu_do_domctl(domctl, u_domctl);
         break;
diff -r 8b93ac0c93f3 -r da7faf53790e xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/include/public/domctl.h	Thu Nov 15 09:42:24 2012 +0800
@@ -136,6 +136,7 @@
 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
 #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
 #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
+#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
 
 struct xen_domctl_getpageframeinfo {
@@ -834,6 +835,12 @@
 typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
 
+struct xen_domctl_set_broken_page_p2m {
+    uint64_aligned_t pfn;
+};
+typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -899,6 +906,7 @@
 #define XEN_DOMCTL_set_access_required           64
 #define XEN_DOMCTL_audit_p2m                     65
 #define XEN_DOMCTL_set_virq_handler              66
+#define XEN_DOMCTL_set_broken_page_p2m           67
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -954,6 +962,7 @@
         struct xen_domctl_audit_p2m         audit_p2m;
         struct xen_domctl_set_virq_handler  set_virq_handler;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
+        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
         uint8_t                             pad[128];

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 18:01:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 18:01:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYhGb-0002Sa-GH; Wed, 14 Nov 2012 18:00:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TYhGZ-0002Rj-Dh
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 18:00:47 +0000
Received: from [85.158.137.99:54211] by server-16.bemta-3.messagelabs.com id
	2C/6A-07461-E4CD3A05; Wed, 14 Nov 2012 18:00:46 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1352916044!13986373!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY1NTMy\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12819 invoked from network); 14 Nov 2012 18:00:45 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-6.tower-217.messagelabs.com with SMTP;
	14 Nov 2012 18:00:45 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 14 Nov 2012 10:00:01 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,252,1352102400"; d="scan'208";a="219657978"
Received: from ljsromley.bj.intel.com ([10.240.192.102])
	by orsmga001.jf.intel.com with ESMTP; 14 Nov 2012 10:00:24 -0800
MIME-Version: 1.0
X-Mercurial-Node: da7faf53790e661cb6c417fc28e76aebe8ab4415
Message-Id: <da7faf53790e661cb6c4.1352944365@ljsromley.bj.intel.com>
User-Agent: Mercurial-patchbomb/1.4
Date: Thu, 15 Nov 2012 09:52:45 +0800
From: Liu Jinsong <jinsong.liu@intel.com>
To: ian.campbell@citrix.com, george.dunlap@eu.citrix.com,
	Ian.Jackson@eu.citrix.com, JBeulich@suse.com
Cc: jinsong.liu@intel.com, xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH V2] X86/vMCE: handle broken page with regard to
	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Generally, there are 2 cases:
1. broken page occurs before migration
2. broken page occurs during migration

At the sender
  For case 1, the broken page would be mapped but not copied to target
  (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number would be transferred to target
  so that target take appropriate action.

  For case 2, mce handler marks the broken page to dirty bitmap, so that
  at copypages stage of migration, its pfn_type and pfn number would be
  transferred to target and then take appropriate action.

At the target
  When migration target would populate pages for guest. As for the case
  of broken page wrt migration, we prefer keep the corresponding page,
  for the sake of seamless migration.

  At target it would set p2m as p2m_ram_broken for broken page. Guest MCE
  may have good chance to handle its broken page, while if guest access
  the broken page again it would kill itself as expected.

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Jan Beulich <JBeulich@suse.com>

diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain.c	Thu Nov 15 09:42:24 2012 +0800
@@ -283,6 +283,22 @@
     return ret;
 }
 
+/* set broken page p2m */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn)
+{
+    int ret;
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
+    domctl.domain = (domid_t)domid;
+    domctl.u.set_broken_page_p2m.pfn = pfn;
+    ret = do_domctl(xch, &domctl);
+
+    return ret ? -1 : 0;
+}
+
 /* get info from hvm guest for save */
 int xc_domain_hvm_getcontext(xc_interface *xch,
                              uint32_t domid,
diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_restore.c	Thu Nov 15 09:42:24 2012 +0800
@@ -1023,9 +1023,15 @@
 
     countpages = count;
     for (i = oldcount; i < buf->nr_pages; ++i)
-        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
-            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
+    {
+        unsigned long pagetype;
+
+        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
+        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
+             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
+             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
             --countpages;
+    }
 
     if (!countpages)
         return count;
@@ -1267,6 +1273,17 @@
             /* a bogus/unmapped/allocate-only page: skip it */
             continue;
 
+        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
+        {
+            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
+            {
+                ERROR("Set p2m for broken page failed, "
+                      "dom=%d, pfn=%lx\n", dom, pfn);
+                goto err_mapped;
+            }
+            continue;
+        }
+
         if (pfn_err[i])
         {
             ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_save.c	Thu Nov 15 09:42:24 2012 +0800
@@ -1277,6 +1277,13 @@
                 if ( !hvm )
                     gmfn = pfn_to_mfn(gmfn);
 
+                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                {
+                    pfn_type[j] |= pfn_batch[j];
+                    ++run;
+                    continue;
+                }
+
                 if ( pfn_err[j] )
                 {
                     if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
@@ -1371,8 +1378,12 @@
                     }
                 }
 
-                /* skip pages that aren't present or are alloc-only */
+                /*
+                 * skip pages that aren't present,
+                 * or are broken, or are alloc-only
+                 */
                 if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
+                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
                     || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
                     continue;
 
diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xenctrl.h	Thu Nov 15 09:42:24 2012 +0800
@@ -575,6 +575,17 @@
                           xc_domaininfo_t *info);
 
 /**
+ * This function set p2m for broken page
+ * &parm xch a handle to an open hypervisor interface
+ * @parm domid the domain id which broken page belong to
+ * @parm pfn the pfn number of the broken page
+ * @return 0 on success, -1 on failure
+ */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn);
+
+/**
  * This function returns information about the context of a hvm domain
  * @parm xch a handle to an open hypervisor interface
  * @parm domid the domain to get information from
diff -r 8b93ac0c93f3 -r da7faf53790e xen/arch/x86/cpu/mcheck/mcaction.c
--- a/xen/arch/x86/cpu/mcheck/mcaction.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Thu Nov 15 09:42:24 2012 +0800
@@ -1,5 +1,6 @@
 #include <xen/types.h>
 #include <xen/sched.h>
+#include <asm/p2m.h>
 #include "mcaction.h"
 #include "vmce.h"
 #include "mce.h"
@@ -91,6 +92,24 @@
                     goto vmce_failed;
                 }
 
+                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram &&
+                     paging_mode_log_dirty(d) )
+                {
+                    /*
+                     * vMCE occur during migration
+                     *
+                     *   At sender, it marks broken page to dirty bitmap,
+                     *   so that at copypages stage of migration, broken
+                     *   page's pfn_type and pfn number would be transferred
+                     *   to target and then take appropriate action.
+                     *
+                     *   At target, it would set p2m as p2m_ram_broken for
+                     *   broken page, so that if guest access the broken page
+                     *   again, it would kill itself as expected.
+                     */
+                    paging_mark_dirty(d, mfn);
+                }
+
                 if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
                 {
                     printk("Unmap broken memory %lx for DOM%d failed\n",
diff -r 8b93ac0c93f3 -r da7faf53790e xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/arch/x86/domctl.c	Thu Nov 15 09:42:24 2012 +0800
@@ -209,12 +209,18 @@
                 for ( j = 0; j < k; j++ )
                 {
                     unsigned long type = 0;
+                    p2m_type_t t;
 
-                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
+                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
 
                     if ( unlikely(!page) ||
                          unlikely(is_xen_heap_page(page)) )
-                        type = XEN_DOMCTL_PFINFO_XTAB;
+                    {
+                        if ( p2m_is_broken(t) )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
+                        else
+                            type = XEN_DOMCTL_PFINFO_XTAB;
+                    }
                     else
                     {
                         switch( page->u.inuse.type_info & PGT_type_mask )
@@ -235,6 +241,9 @@
 
                         if ( page->u.inuse.type_info & PGT_pinned )
                             type |= XEN_DOMCTL_PFINFO_LPINTAB;
+
+                        if ( page->count_info & PGC_broken )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
                     }
 
                     if ( page )
@@ -1568,6 +1577,29 @@
     }
     break;
 
+    case XEN_DOMCTL_set_broken_page_p2m:
+    {
+        struct domain *d;
+
+        d = rcu_lock_domain_by_id(domctl->domain);
+        if ( d != NULL )
+        {
+            p2m_type_t pt;
+            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
+            mfn_t mfn = get_gfn_query(d, pfn, &pt);
+
+            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
+                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
+                ret = -EINVAL;
+
+            put_gfn(d, pfn);
+            rcu_unlock_domain(d);
+        }
+        else
+            ret = -ESRCH;
+    }
+    break;
+
     default:
         ret = iommu_do_domctl(domctl, u_domctl);
         break;
diff -r 8b93ac0c93f3 -r da7faf53790e xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/include/public/domctl.h	Thu Nov 15 09:42:24 2012 +0800
@@ -136,6 +136,7 @@
 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
 #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
 #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
+#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
 
 struct xen_domctl_getpageframeinfo {
@@ -834,6 +835,12 @@
 typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
 
+struct xen_domctl_set_broken_page_p2m {
+    uint64_aligned_t pfn;
+};
+typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -899,6 +906,7 @@
 #define XEN_DOMCTL_set_access_required           64
 #define XEN_DOMCTL_audit_p2m                     65
 #define XEN_DOMCTL_set_virq_handler              66
+#define XEN_DOMCTL_set_broken_page_p2m           67
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -954,6 +962,7 @@
         struct xen_domctl_audit_p2m         audit_p2m;
         struct xen_domctl_set_virq_handler  set_virq_handler;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
+        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
         uint8_t                             pad[128];

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 18:01:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 18:01:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYhHG-0002gB-Dz; Wed, 14 Nov 2012 18:01:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYhHF-0002fK-4q
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 18:01:29 +0000
Received: from [85.158.143.35:59501] by server-3.bemta-4.messagelabs.com id
	88/7C-06841-87CD3A05; Wed, 14 Nov 2012 18:01:28 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1352916087!15257602!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32605 invoked from network); 14 Nov 2012 18:01:27 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 18:01:27 -0000
X-IronPort-AV: E=Sophos;i="4.83,252,1352073600"; d="scan'208";a="15811441"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 18:00:44 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 14 Nov 2012 18:00:44 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYhGV-0008On-Se;
	Wed, 14 Nov 2012 18:00:43 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYhGV-00029Y-L0;
	Wed, 14 Nov 2012 18:00:43 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14390-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 14 Nov 2012 18:00:43 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.1-testing test] 14390: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14390 xen-4.1-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14390/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail like 14387
 test-amd64-amd64-xl-sedf     13 guest-localmigrate.2      fail REGR. vs. 14387

Tests which did not succeed, but are not blocking:
 test-amd64-i386-qemuu-rhel6hvm-intel 11 leak-check/check       fail never pass
 test-amd64-i386-qemuu-rhel6hvm-amd 11 leak-check/check         fail never pass
 test-amd64-i386-rhel6hvm-intel 11 leak-check/check             fail never pass
 test-amd64-i386-rhel6hvm-amd 11 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-i386-i386-xl-qemuu-winxpsp3 13 guest-stop                 fail never pass

version targeted for testing:
 xen                  178f63286b02
baseline version:
 xen                  26281a1650dc

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Frediano Ziglio <frediano.ziglio@citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Matthew Daley <mattjd@gmail.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               fail    
 test-amd64-i386-qemuu-rhel6hvm-intel                         fail    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 pass    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.1-testing
+ revision=178f63286b02
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.1-testing 178f63286b02
+ branch=xen-4.1-testing
+ revision=178f63286b02
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.1-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.1-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.1-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.1-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.1-testing.git
++ : daily-cron.xen-4.1-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.1-testing.git
+ info_linux_tree xen-4.1-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.1-testing.hg
+ hg push -r 178f63286b02 ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 7 changesets with 8 changes to 7 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 18:01:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 18:01:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYhHG-0002gB-Dz; Wed, 14 Nov 2012 18:01:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYhHF-0002fK-4q
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 18:01:29 +0000
Received: from [85.158.143.35:59501] by server-3.bemta-4.messagelabs.com id
	88/7C-06841-87CD3A05; Wed, 14 Nov 2012 18:01:28 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1352916087!15257602!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32605 invoked from network); 14 Nov 2012 18:01:27 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 18:01:27 -0000
X-IronPort-AV: E=Sophos;i="4.83,252,1352073600"; d="scan'208";a="15811441"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 18:00:44 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 14 Nov 2012 18:00:44 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYhGV-0008On-Se;
	Wed, 14 Nov 2012 18:00:43 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYhGV-00029Y-L0;
	Wed, 14 Nov 2012 18:00:43 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14390-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 14 Nov 2012 18:00:43 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.1-testing test] 14390: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14390 xen-4.1-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14390/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail like 14387
 test-amd64-amd64-xl-sedf     13 guest-localmigrate.2      fail REGR. vs. 14387

Tests which did not succeed, but are not blocking:
 test-amd64-i386-qemuu-rhel6hvm-intel 11 leak-check/check       fail never pass
 test-amd64-i386-qemuu-rhel6hvm-amd 11 leak-check/check         fail never pass
 test-amd64-i386-rhel6hvm-intel 11 leak-check/check             fail never pass
 test-amd64-i386-rhel6hvm-amd 11 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-i386-i386-xl-qemuu-winxpsp3 13 guest-stop                 fail never pass

version targeted for testing:
 xen                  178f63286b02
baseline version:
 xen                  26281a1650dc

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Frediano Ziglio <frediano.ziglio@citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Matthew Daley <mattjd@gmail.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               fail    
 test-amd64-i386-qemuu-rhel6hvm-intel                         fail    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 pass    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.1-testing
+ revision=178f63286b02
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.1-testing 178f63286b02
+ branch=xen-4.1-testing
+ revision=178f63286b02
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.1-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.1-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.1-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.1-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.1-testing.git
++ : daily-cron.xen-4.1-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.1-testing.git
+ info_linux_tree xen-4.1-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.1-testing.hg
+ hg push -r 178f63286b02 ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 7 changesets with 8 changes to 7 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 18:34:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 18:34:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYhmk-0003yo-Ln; Wed, 14 Nov 2012 18:34:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TYhmj-0003yf-2K
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 18:34:01 +0000
Received: from [85.158.139.83:57077] by server-12.bemta-5.messagelabs.com id
	2D/7C-02886-614E3A05; Wed, 14 Nov 2012 18:33:58 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1352918036!30298300!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTI0Mzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13370 invoked from network); 14 Nov 2012 18:33:57 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-3.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 18:33:57 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAEIXpav023810
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 18:33:52 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAEIXoPn003241
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Nov 2012 18:33:51 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAEIXofL031362; Wed, 14 Nov 2012 12:33:50 -0600
MIME-Version: 1.0
Message-ID: <9e2b4f29-124e-4feb-9712-f0a931224e98@default>
Date: Wed, 14 Nov 2012 10:33:46 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
	<50A3817D02000078000A8710@nat28.tlf.novell.com>
In-Reply-To: <50A3817D02000078000A8710@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Keir Fraser <keir@xen.org>, TimDeegan <tim@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Subject: Re: [RFC/PATCH] XENMEM_claim_pages (subop of an existing) hypercall

Hi Jan --

Excellent feedback, thanks.  You probably saved me hours
of debugging... always nice to have another pair of eyes
to catch stupid mistakes that I could start at for a long
time without noticing the insanity. :-)

I'll start working on v2 incorporating your suggestions
(and get some runtime testing completed).

One thing:

> Finally, assuming we really want/need this, shouldn't there be
> a way for claims to expire (e.g. in case of tool stack problems),
> so they don't indefinitely prevent (perhaps large) portions of
> memory to be used for other purpose (e.g. when a domain can't
> get fully cleaned up)?

I was envisioning (and thanks for catching that I had neglected
it in the patch) that the reset_claim call would be done very
early in the domain death sequence.

But maybe that's a good reason to add back in the "manual"
unclaim hypercall/subop, so a toolstack can force the
claim to zero.  I realized I can easily add that by
allowing an existing claim to be "overridden" by a
claim of zero pages, so another subop isn't even needed.

Dan

.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 18:34:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 18:34:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYhmk-0003yo-Ln; Wed, 14 Nov 2012 18:34:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TYhmj-0003yf-2K
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 18:34:01 +0000
Received: from [85.158.139.83:57077] by server-12.bemta-5.messagelabs.com id
	2D/7C-02886-614E3A05; Wed, 14 Nov 2012 18:33:58 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1352918036!30298300!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTI0Mzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13370 invoked from network); 14 Nov 2012 18:33:57 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-3.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 18:33:57 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAEIXpav023810
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 18:33:52 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAEIXoPn003241
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Nov 2012 18:33:51 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAEIXofL031362; Wed, 14 Nov 2012 12:33:50 -0600
MIME-Version: 1.0
Message-ID: <9e2b4f29-124e-4feb-9712-f0a931224e98@default>
Date: Wed, 14 Nov 2012 10:33:46 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
	<50A3817D02000078000A8710@nat28.tlf.novell.com>
In-Reply-To: <50A3817D02000078000A8710@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Keir Fraser <keir@xen.org>, TimDeegan <tim@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Subject: Re: [RFC/PATCH] XENMEM_claim_pages (subop of an existing) hypercall

Hi Jan --

Excellent feedback, thanks.  You probably saved me hours
of debugging... always nice to have another pair of eyes
to catch stupid mistakes that I could start at for a long
time without noticing the insanity. :-)

I'll start working on v2 incorporating your suggestions
(and get some runtime testing completed).

One thing:

> Finally, assuming we really want/need this, shouldn't there be
> a way for claims to expire (e.g. in case of tool stack problems),
> so they don't indefinitely prevent (perhaps large) portions of
> memory to be used for other purpose (e.g. when a domain can't
> get fully cleaned up)?

I was envisioning (and thanks for catching that I had neglected
it in the patch) that the reset_claim call would be done very
early in the domain death sequence.

But maybe that's a good reason to add back in the "manual"
unclaim hypercall/subop, so a toolstack can force the
claim to zero.  I realized I can easily add that by
allowing an existing claim to be "overridden" by a
claim of zero pages, so another subop isn't even needed.

Dan

.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 18:52:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 18:52:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYi4L-0004c9-C9; Wed, 14 Nov 2012 18:52:13 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYi4J-0004c4-Uu
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 18:52:12 +0000
Received: from [193.109.254.147:17795] by server-11.bemta-14.messagelabs.com
	id 2C/46-29027-B58E3A05; Wed, 14 Nov 2012 18:52:11 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352919128!4120914!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14094 invoked from network); 14 Nov 2012 18:52:08 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 18:52:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,252,1352073600"; d="scan'208";a="15812866"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 18:52:08 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 14 Nov 2012 18:52:07 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYi4G-0000HA-0v;
	Wed, 14 Nov 2012 18:52:08 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYi4F-0007DR-Qm;
	Wed, 14 Nov 2012 18:52:07 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14392-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 14 Nov 2012 18:52:07 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14392: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14392 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14392/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-i386-pvops              4 kernel-build              fail REGR. vs. 14389

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14389
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14389
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14389
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14389

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  b64a7d868f06
baseline version:
 xen                  8b93ac0c93f3

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Dan Magenheimer <dan.magenheimer@oracle.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jacek Konieczny <jajcus@jajcus.net>
  Jan Beulich <jbeulich@suse.com>
  Ronny Hegewald <Ronny.Hegewald@online.de>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             fail    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26151:b64a7d868f06
tag:         tip
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Nov 14 11:45:37 2012 +0000
    
    compat/gnttab: Prevent infinite loop in compat code
    
    c/s 20281:95ea2052b41b, which introduces Grant Table version 2
    hypercalls introduces a vulnerability whereby the compat hypercall
    handler can fall into an infinite loop.
    
    If the watchdog is enabled, Xen will die after the timeout.
    
    This is a security problem, XSA-24 / CVE-2012-4539.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   26150:c7a01b6450e4
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Nov 14 11:42:21 2012 +0000
    
    xen/mm/shadow: check toplevel pagetables are present before unhooking them.
    
    If the guest has not fully populated its top-level PAE entries when it calls
    HVMOP_pagetable_dying, the shadow code could try to unhook entries from
    MFN 0.  Add a check to avoid that case.
    
    This issue was introduced by c/s 21239:b9d2db109cf5.
    
    This is a security problem, XSA-23 / CVE-2012-4538.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   26149:6b6a4007a609
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Nov 14 11:36:02 2012 +0000
    
    x86/physmap: Prevent incorrect updates of m2p mappings
    
    In certain conditions, such as low memory, set_p2m_entry() can fail.
    Currently, the p2m and m2p tables will get out of sync because we still
    update the m2p table after the p2m update has failed.
    
    If that happens, subsequent guest-invoked memory operations can cause
    BUG()s and ASSERT()s to kill Xen.
    
    This is fixed by only updating the m2p table iff the p2m was
    successfully updated.
    
    This is a security problem, XSA-22 / CVE-2012-4537.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   26148:bf58b94b3cef
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Nov 14 11:30:34 2012 +0000
    
    VCPU/timers: Prevent overflow in calculations, leading to DoS vulnerability
    
    The timer action for a vcpu periodic timer is to calculate the next
    expiry time, and to reinsert itself into the timer queue.  If the
    deadline ends up in the past, Xen never leaves __do_softirq().  The
    affected PCPU will stay in an infinite loop until Xen is killed by the
    watchdog (if enabled).
    
    This is a security problem, XSA-20 / CVE-2012-4535.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   26147:3186c04af582
user:        Dan Magenheimer <dan.magenheimer@oracle.com>
date:        Wed Nov 14 10:24:28 2012 +0000
    
    xen-tmem-list-parse: fix ugly parse output
    
    The program xen-tmem-list-parse parses the output of xm/xl tmem-list
    into human-readable format.  A missing NULL terminator sometimes
    causes garbage to be spewed where the two-letter pool type
    should be output.
    
    Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26146:92c52eb4b270
user:        Jacek Konieczny <jajcus@jajcus.net>
date:        Wed Nov 14 10:24:28 2012 +0000
    
    hotplug/Linux: Fix locking in tools/hotplug/Linux/locking.sh
    
    The claim_lock() function would fail in the perl code with:
    
      Invalid argument at -e line 2.
    
    because the Perl snippet opens for reading the file descriptor, which
    was earlier opened for write (append).
    
    Signed-off-by: Jacek Konieczny <jajcus@jajcus.net>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26145:8b93ac0c93f3
user:        Ronny Hegewald <ronny.hegewald@online.de>
date:        Tue Nov 13 11:19:17 2012 +0000
    
    libxl: fix vfb related assertion problem when starting pv-domU
    
    When a config-file for a pv-domU has a vfb section with a vnc=0
    option then a "xl create" for that domU crashes with the message
    
    xl: libxl.c:252: libxl_defbool_val: Assertion `!libxl_defbool_is_default(db)'
    failed.
    
    and the domU hangs early in the start.
    
    This patch fixes the cause of the assertion and let the domU start
    normally.
    
    This problem exists since xen 4.2.
    
    Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 18:52:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 18:52:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYi4L-0004c9-C9; Wed, 14 Nov 2012 18:52:13 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYi4J-0004c4-Uu
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 18:52:12 +0000
Received: from [193.109.254.147:17795] by server-11.bemta-14.messagelabs.com
	id 2C/46-29027-B58E3A05; Wed, 14 Nov 2012 18:52:11 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352919128!4120914!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14094 invoked from network); 14 Nov 2012 18:52:08 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 18:52:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,252,1352073600"; d="scan'208";a="15812866"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 18:52:08 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 14 Nov 2012 18:52:07 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYi4G-0000HA-0v;
	Wed, 14 Nov 2012 18:52:08 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYi4F-0007DR-Qm;
	Wed, 14 Nov 2012 18:52:07 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14392-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 14 Nov 2012 18:52:07 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14392: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14392 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14392/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-i386-pvops              4 kernel-build              fail REGR. vs. 14389

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14389
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14389
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14389
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14389

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  b64a7d868f06
baseline version:
 xen                  8b93ac0c93f3

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Dan Magenheimer <dan.magenheimer@oracle.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jacek Konieczny <jajcus@jajcus.net>
  Jan Beulich <jbeulich@suse.com>
  Ronny Hegewald <Ronny.Hegewald@online.de>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             fail    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26151:b64a7d868f06
tag:         tip
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Nov 14 11:45:37 2012 +0000
    
    compat/gnttab: Prevent infinite loop in compat code
    
    c/s 20281:95ea2052b41b, which introduces Grant Table version 2
    hypercalls introduces a vulnerability whereby the compat hypercall
    handler can fall into an infinite loop.
    
    If the watchdog is enabled, Xen will die after the timeout.
    
    This is a security problem, XSA-24 / CVE-2012-4539.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   26150:c7a01b6450e4
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Nov 14 11:42:21 2012 +0000
    
    xen/mm/shadow: check toplevel pagetables are present before unhooking them.
    
    If the guest has not fully populated its top-level PAE entries when it calls
    HVMOP_pagetable_dying, the shadow code could try to unhook entries from
    MFN 0.  Add a check to avoid that case.
    
    This issue was introduced by c/s 21239:b9d2db109cf5.
    
    This is a security problem, XSA-23 / CVE-2012-4538.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   26149:6b6a4007a609
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Nov 14 11:36:02 2012 +0000
    
    x86/physmap: Prevent incorrect updates of m2p mappings
    
    In certain conditions, such as low memory, set_p2m_entry() can fail.
    Currently, the p2m and m2p tables will get out of sync because we still
    update the m2p table after the p2m update has failed.
    
    If that happens, subsequent guest-invoked memory operations can cause
    BUG()s and ASSERT()s to kill Xen.
    
    This is fixed by only updating the m2p table iff the p2m was
    successfully updated.
    
    This is a security problem, XSA-22 / CVE-2012-4537.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   26148:bf58b94b3cef
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Nov 14 11:30:34 2012 +0000
    
    VCPU/timers: Prevent overflow in calculations, leading to DoS vulnerability
    
    The timer action for a vcpu periodic timer is to calculate the next
    expiry time, and to reinsert itself into the timer queue.  If the
    deadline ends up in the past, Xen never leaves __do_softirq().  The
    affected PCPU will stay in an infinite loop until Xen is killed by the
    watchdog (if enabled).
    
    This is a security problem, XSA-20 / CVE-2012-4535.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   26147:3186c04af582
user:        Dan Magenheimer <dan.magenheimer@oracle.com>
date:        Wed Nov 14 10:24:28 2012 +0000
    
    xen-tmem-list-parse: fix ugly parse output
    
    The program xen-tmem-list-parse parses the output of xm/xl tmem-list
    into human-readable format.  A missing NULL terminator sometimes
    causes garbage to be spewed where the two-letter pool type
    should be output.
    
    Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26146:92c52eb4b270
user:        Jacek Konieczny <jajcus@jajcus.net>
date:        Wed Nov 14 10:24:28 2012 +0000
    
    hotplug/Linux: Fix locking in tools/hotplug/Linux/locking.sh
    
    The claim_lock() function would fail in the perl code with:
    
      Invalid argument at -e line 2.
    
    because the Perl snippet opens for reading the file descriptor, which
    was earlier opened for write (append).
    
    Signed-off-by: Jacek Konieczny <jajcus@jajcus.net>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26145:8b93ac0c93f3
user:        Ronny Hegewald <ronny.hegewald@online.de>
date:        Tue Nov 13 11:19:17 2012 +0000
    
    libxl: fix vfb related assertion problem when starting pv-domU
    
    When a config-file for a pv-domU has a vfb section with a vnc=0
    option then a "xl create" for that domU crashes with the message
    
    xl: libxl.c:252: libxl_defbool_val: Assertion `!libxl_defbool_is_default(db)'
    failed.
    
    and the domU hangs early in the start.
    
    This patch fixes the cause of the assertion and let the domU start
    normally.
    
    This problem exists since xen 4.2.
    
    Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 18:59:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 18:59:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYiAh-0004la-7w; Wed, 14 Nov 2012 18:58:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TYiAf-0004lS-30
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 18:58:45 +0000
Received: from [85.158.139.211:22431] by server-15.bemta-5.messagelabs.com id
	51/66-26920-4E9E3A05; Wed, 14 Nov 2012 18:58:44 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1352919523!20206552!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19691 invoked from network); 14 Nov 2012 18:58:43 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 18:58:43 -0000
Received: by mail-wi0-f173.google.com with SMTP id hm2so3703845wib.14
	for <xen-devel@lists.xen.org>; Wed, 14 Nov 2012 10:58:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=vsvYai///92+3bo+iNE/1IjSmqUoa76A/MTU1Dydn2M=;
	b=rPcJd+01/QyHaDmIraU7jR0aqUn4U3740TLrYclwrfW89/0iIhnVzrf/VaYmab3y+f
	zBRzr+/z7fm4FaXW0QIBMuk61u/DI9Y3BBGb5cMxVk/CFdowNdWx3dHEAdAIfhTHniN4
	4/vSPdcm+eg6+1dtKTGd9eaH1UXSMYgFUJoPC2OzPJUTFzBo6jaZdRj7vuDy2vIn5Jc7
	6oAHbxLUYG77LBkzDxkJOKSjF1Adud8un+iC7SC2guAWOhEktMMXVxZ2b0m25x+694Xa
	s7VKLdEGhmWfljyZQ2tEPvSvPGyPge9I5F3T48cWw7DeYwesTY3Bk80JGtYdEA/uaai4
	OVGA==
Received: by 10.180.94.161 with SMTP id dd1mr11847455wib.17.1352919523614;
	Wed, 14 Nov 2012 10:58:43 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id ec3sm12318339wib.10.2012.11.14.10.58.41
	(version=SSLv3 cipher=OTHER); Wed, 14 Nov 2012 10:58:43 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 14 Nov 2012 18:58:34 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Jan Beulich <JBeulich@suse.com>, TimDeegan <tim@xen.org>
Message-ID: <CCC99A5A.44A8D%keir.xen@gmail.com>
Thread-Topic: [RFC/PATCH] XENMEM_claim_pages (subop of an existing) hypercall
Thread-Index: Ac3CmgupEsXrnLcCcU2ua8LpOhcoeQ==
In-Reply-To: <c6b2faed-a38b-4bb7-8bc8-361513837569@default>
Mime-version: 1.0
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 14/11/2012 17:42, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:

>> It would be nice if d->tot_pages adjustments didn't take the global
>> heap_lock in this case. There's probably some way to bail out of those new
>> update functions before doing the locked work, in that case.
> 
> I agree.  I played with atomics for a bit but couldn't
> see a way it would work without races.  The generic
> pseudo-code is
> 
> if (A) {
> atomically {
> modify A
> modify d->B
> }
> } else {
> modify d->B
> }
> 
> Any ideas?

E.g.,
    /* Fast path (new). */
    if ( !d->unclaimed_pages )
        return d->tot_pages += pages;
    /* Slower path (as in your patch). */
    spin_lock(&heap_lock);
    d->tot_pages += pages;
    if ( d->unclaimed_pages )
        ....

The only danger is around any necessary interlocking with d->unclaimed_pages
becoming non-zero. But the fast-path test is still under d->page_alloc_lock,
and you set up d->unclaimed_pages under that lock, so it looks okay to me.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 18:59:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 18:59:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYiAh-0004la-7w; Wed, 14 Nov 2012 18:58:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TYiAf-0004lS-30
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 18:58:45 +0000
Received: from [85.158.139.211:22431] by server-15.bemta-5.messagelabs.com id
	51/66-26920-4E9E3A05; Wed, 14 Nov 2012 18:58:44 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1352919523!20206552!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19691 invoked from network); 14 Nov 2012 18:58:43 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 18:58:43 -0000
Received: by mail-wi0-f173.google.com with SMTP id hm2so3703845wib.14
	for <xen-devel@lists.xen.org>; Wed, 14 Nov 2012 10:58:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=vsvYai///92+3bo+iNE/1IjSmqUoa76A/MTU1Dydn2M=;
	b=rPcJd+01/QyHaDmIraU7jR0aqUn4U3740TLrYclwrfW89/0iIhnVzrf/VaYmab3y+f
	zBRzr+/z7fm4FaXW0QIBMuk61u/DI9Y3BBGb5cMxVk/CFdowNdWx3dHEAdAIfhTHniN4
	4/vSPdcm+eg6+1dtKTGd9eaH1UXSMYgFUJoPC2OzPJUTFzBo6jaZdRj7vuDy2vIn5Jc7
	6oAHbxLUYG77LBkzDxkJOKSjF1Adud8un+iC7SC2guAWOhEktMMXVxZ2b0m25x+694Xa
	s7VKLdEGhmWfljyZQ2tEPvSvPGyPge9I5F3T48cWw7DeYwesTY3Bk80JGtYdEA/uaai4
	OVGA==
Received: by 10.180.94.161 with SMTP id dd1mr11847455wib.17.1352919523614;
	Wed, 14 Nov 2012 10:58:43 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id ec3sm12318339wib.10.2012.11.14.10.58.41
	(version=SSLv3 cipher=OTHER); Wed, 14 Nov 2012 10:58:43 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 14 Nov 2012 18:58:34 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Jan Beulich <JBeulich@suse.com>, TimDeegan <tim@xen.org>
Message-ID: <CCC99A5A.44A8D%keir.xen@gmail.com>
Thread-Topic: [RFC/PATCH] XENMEM_claim_pages (subop of an existing) hypercall
Thread-Index: Ac3CmgupEsXrnLcCcU2ua8LpOhcoeQ==
In-Reply-To: <c6b2faed-a38b-4bb7-8bc8-361513837569@default>
Mime-version: 1.0
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 14/11/2012 17:42, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:

>> It would be nice if d->tot_pages adjustments didn't take the global
>> heap_lock in this case. There's probably some way to bail out of those new
>> update functions before doing the locked work, in that case.
> 
> I agree.  I played with atomics for a bit but couldn't
> see a way it would work without races.  The generic
> pseudo-code is
> 
> if (A) {
> atomically {
> modify A
> modify d->B
> }
> } else {
> modify d->B
> }
> 
> Any ideas?

E.g.,
    /* Fast path (new). */
    if ( !d->unclaimed_pages )
        return d->tot_pages += pages;
    /* Slower path (as in your patch). */
    spin_lock(&heap_lock);
    d->tot_pages += pages;
    if ( d->unclaimed_pages )
        ....

The only danger is around any necessary interlocking with d->unclaimed_pages
becoming non-zero. But the fast-path test is still under d->page_alloc_lock,
and you set up d->unclaimed_pages under that lock, so it looks okay to me.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 19:05:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 19:05:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYiGb-00056n-37; Wed, 14 Nov 2012 19:04:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TYiGZ-00056g-Hh
	for Xen-devel@lists.xensource.com; Wed, 14 Nov 2012 19:04:52 +0000
Received: from [85.158.143.99:60420] by server-3.bemta-4.messagelabs.com id
	5B/39-06841-25BE3A05; Wed, 14 Nov 2012 19:04:50 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352919887!29381992!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2MjkwNg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32650 invoked from network); 14 Nov 2012 19:04:49 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-3.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 19:04:49 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAEJ4iWD020462
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 19:04:45 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAEJ4hXC017878
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Nov 2012 19:04:43 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAEJ4hfM022749; Wed, 14 Nov 2012 13:04:43 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 11:04:42 -0800
Date: Wed, 14 Nov 2012 11:04:41 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121114110441.712a00f7@mantra.us.oracle.com>
In-Reply-To: <1352887110.26873.15.camel@zakaz.uk.xensource.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
	<1352800853.7491.22.camel@zakaz.uk.xensource.com>
	<20121113172138.1d3274d9@mantra.us.oracle.com>
	<20121113173138.61b21067@mantra.us.oracle.com>
	<1352887110.26873.15.camel@zakaz.uk.xensource.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 14 Nov 2012 09:58:30 +0000
Ian Campbell <Ian.Campbell@citrix.com> wrote:

> On Wed, 2012-11-14 at 01:31 +0000, Mukesh Rathor wrote:
> > On Tue, 13 Nov 2012 17:21:38 -0800
> > Mukesh Rathor <mukesh.rathor@oracle.com> wrote:
> > 
> > > 
> Did you say that if you use the raw ELF file it works?

You mean vmlinux? I couldn't its 133M and my boot partition is 
only 99M.

> BTW for the purposes of parallelising things up you could post the
> hypervisor side part of the series stuff + a patch to force enable PVH
> in libxc (obviously the last not to be applied) first then we can be
> reviewing the h/v side things while simultaneously figuring out how
> the tools side fits together.

Ok. I've been procrastinating as the patch is full of debug code, 
is rather big, and would take lot of time to split up in different
patches. If you don't mind a very raw/debug version, all in one,
here it is (built on c/s: 26124 + my KDB patch):



diff -r 8b0762504037 tools/debugger/gdbsx/xg/xg_main.c
--- a/tools/debugger/gdbsx/xg/xg_main.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/debugger/gdbsx/xg/xg_main.c	Wed Nov 14 11:03:24 2012 -0800
@@ -80,6 +80,7 @@ int xgtrc_on = 0;
 struct xen_domctl domctl;         /* just use a global domctl */
 
 static int     _hvm_guest;        /* hvm guest? 32bit HVMs have 64bit context */
+static int     _pvh_guest;        /* PV guest in HVM container */
 static domid_t _dom_id;           /* guest domid */
 static int     _max_vcpu_id;      /* thus max_vcpu_id+1 VCPUs */
 static int     _dom0_fd;          /* fd of /dev/privcmd */
@@ -308,6 +309,7 @@ xg_attach(int domid, int guest_bitness)
 
     _max_vcpu_id = domctl.u.getdomaininfo.max_vcpu_id;
     _hvm_guest = (domctl.u.getdomaininfo.flags & XEN_DOMINF_hvm_guest);
+    _pvh_guest = (domctl.u.getdomaininfo.flags & XEN_DOMINF_pvh_guest);
     return _max_vcpu_id;
 }
 
@@ -368,7 +370,7 @@ _change_TF(vcpuid_t which_vcpu, int gues
     int sz = sizeof(anyc);
 
     /* first try the MTF for hvm guest. otherwise do manually */
-    if (_hvm_guest) {
+    if (_hvm_guest || _pvh_guest) {
         domctl.u.debug_op.vcpu = which_vcpu;
         domctl.u.debug_op.op = setit ? XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON :
                                        XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF;
diff -r 8b0762504037 tools/libxc/Makefile
--- a/tools/libxc/Makefile	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxc/Makefile	Wed Nov 14 11:03:24 2012 -0800
@@ -73,7 +73,7 @@ OSDEP_SRCS-y                 += xenctrl_
 -include $(XEN_TARGET_ARCH)/Makefile
 
 CFLAGS   += -Werror -Wmissing-prototypes
-CFLAGS   += -I. $(CFLAGS_xeninclude)
+CFLAGS   += -I. $(CFLAGS_xeninclude) -g -O0
 
 # Needed for posix_fadvise64() in xc_linux.c
 CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
diff -r 8b0762504037 tools/libxc/xc_dom_x86.c
--- a/tools/libxc/xc_dom_x86.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxc/xc_dom_x86.c	Wed Nov 14 11:03:24 2012 -0800
@@ -386,7 +386,8 @@ static int setup_pgtables_x86_64(struct 
         pgpfn = (addr - dom->parms.virt_base) >> PAGE_SHIFT_X86;
         l1tab[l1off] =
             pfn_to_paddr(xc_dom_p2m_guest(dom, pgpfn)) | L1_PROT;
-        if ( (addr >= dom->pgtables_seg.vstart) && 
+        if ( !(dom->flags & SIF_IS_PVH)      &&
+             (addr >= dom->pgtables_seg.vstart) && 
              (addr < dom->pgtables_seg.vend) )
             l1tab[l1off] &= ~_PAGE_RW; /* page tables are r/o */
         if ( l1off == (L1_PAGETABLE_ENTRIES_X86_64 - 1) )
@@ -716,7 +717,7 @@ int arch_setup_meminit(struct xc_dom_ima
     rc = x86_compat(dom->xch, dom->guest_domid, dom->guest_type);
     if ( rc )
         return rc;
-    if ( xc_dom_feature_translated(dom) )
+    if ( xc_dom_feature_translated(dom) && !(dom->flags & SIF_IS_PVH) )
     {
         dom->shadow_enabled = 1;
         rc = x86_shadow(dom->xch, dom->guest_domid);
@@ -830,7 +831,7 @@ int arch_setup_bootlate(struct xc_dom_im
         }
 
         /* Map grant table frames into guest physmap. */
-        for ( i = 0; ; i++ )
+        for ( i = 0; !(dom->flags & SIF_IS_PVH); i++ )
         {
             rc = xc_domain_add_to_physmap(dom->xch, dom->guest_domid,
                                           XENMAPSPACE_grant_table,
diff -r 8b0762504037 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxc/xc_domain_restore.c	Wed Nov 14 11:03:24 2012 -0800
@@ -1933,15 +1933,15 @@ int xc_domain_restore(xc_interface *xch,
             munmap(start_info, PAGE_SIZE);
         }
         /* Uncanonicalise each GDT frame number. */
-        if ( GET_FIELD(ctxt, gdt_ents) > 8192 )
+        if ( GET_FIELD(ctxt, u.pv.gdt_ents) > 8192 )
         {
             ERROR("GDT entry count out of range");
             goto out;
         }
 
-        for ( j = 0; (512*j) < GET_FIELD(ctxt, gdt_ents); j++ )
+        for ( j = 0; (512*j) < GET_FIELD(ctxt, u.pv.gdt_ents); j++ )
         {
-            pfn = GET_FIELD(ctxt, gdt_frames[j]);
+            pfn = GET_FIELD(ctxt, u.pv.gdt_frames[j]);
             if ( (pfn >= dinfo->p2m_size) ||
                  (pfn_type[pfn] != XEN_DOMCTL_PFINFO_NOTAB) )
             {
@@ -1949,7 +1949,7 @@ int xc_domain_restore(xc_interface *xch,
                       j, (unsigned long)pfn);
                 goto out;
             }
-            SET_FIELD(ctxt, gdt_frames[j], ctx->p2m[pfn]);
+            SET_FIELD(ctxt, u.pv.gdt_frames[j], ctx->p2m[pfn]);
         }
         /* Uncanonicalise the page table base pointer. */
         pfn = UNFOLD_CR3(GET_FIELD(ctxt, ctrlreg[3]));
diff -r 8b0762504037 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxc/xc_domain_save.c	Wed Nov 14 11:03:24 2012 -0800
@@ -1889,15 +1889,15 @@ int xc_domain_save(xc_interface *xch, in
         }
 
         /* Canonicalise each GDT frame number. */
-        for ( j = 0; (512*j) < GET_FIELD(&ctxt, gdt_ents); j++ )
+        for ( j = 0; (512*j) < GET_FIELD(&ctxt, u.pv.gdt_ents); j++ )
         {
-            mfn = GET_FIELD(&ctxt, gdt_frames[j]);
+            mfn = GET_FIELD(&ctxt, u.pv.gdt_frames[j]);
             if ( !MFN_IS_IN_PSEUDOPHYS_MAP(mfn) )
             {
                 ERROR("GDT frame is not in range of pseudophys map");
                 goto out;
             }
-            SET_FIELD(&ctxt, gdt_frames[j], mfn_to_pfn(mfn));
+            SET_FIELD(&ctxt, u.pv.gdt_frames[j], mfn_to_pfn(mfn));
         }
 
         /* Canonicalise the page table base pointer. */
diff -r 8b0762504037 tools/libxl/Makefile
--- a/tools/libxl/Makefile	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/Makefile	Wed Nov 14 11:03:24 2012 -0800
@@ -13,7 +13,7 @@ XLUMINOR = 1
 
 CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
 	-Wno-declaration-after-statement -Wformat-nonliteral
-CFLAGS += -I. -fPIC
+CFLAGS += -I. -fPIC -O0
 
 ifeq ($(CONFIG_Linux),y)
 LIBUUID_LIBS += -luuid
diff -r 8b0762504037 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/libxl_create.c	Wed Nov 14 11:03:24 2012 -0800
@@ -409,6 +409,8 @@ int libxl__domain_make(libxl__gc *gc, li
         flags |= XEN_DOMCTL_CDF_hvm_guest;
         flags |= libxl_defbool_val(info->hap) ? XEN_DOMCTL_CDF_hap : 0;
         flags |= libxl_defbool_val(info->oos) ? 0 : XEN_DOMCTL_CDF_oos_off;
+    } else if ( libxl_defbool_val(info->ci_pvh) ) {
+        flags |= (XEN_DOMCTL_CDF_pvh_guest | XEN_DOMCTL_CDF_hap);
     }
     *domid = -1;
 
diff -r 8b0762504037 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/libxl_dom.c	Wed Nov 14 11:03:24 2012 -0800
@@ -270,7 +270,8 @@ int libxl__build_pre(libxl__gc *gc, uint
     if (rtc_timeoffset)
         xc_domain_set_time_offset(ctx->xch, domid, rtc_timeoffset);
 
-    if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
+    if (info->type == LIBXL_DOMAIN_TYPE_HVM ||
+        libxl_defbool_val(info->bi_pvh) ) {
         unsigned long shadow;
         shadow = (info->shadow_memkb + 1023) / 1024;
         xc_shadow_control(ctx->xch, domid, XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION, NULL, 0, &shadow, 0, NULL);
@@ -368,9 +369,15 @@ int libxl__build_pv(libxl__gc *gc, uint3
     struct xc_dom_image *dom;
     int ret;
     int flags = 0;
+    int is_pvh = libxl_defbool_val(info->bi_pvh);
 
     xc_dom_loginit(ctx->xch);
 
+    if (is_pvh) {
+        printf("info..features:%s\n", info->u.pv.features);
+        info->u.pv.features = strdup("auto_translated_physmap");
+    }
+
     dom = xc_dom_allocate(ctx->xch, state->pv_cmdline, info->u.pv.features);
     if (!dom) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_dom_allocate failed");
@@ -408,6 +415,7 @@ int libxl__build_pv(libxl__gc *gc, uint3
         }
     }
 
+    flags |= is_pvh ? SIF_IS_PVH : 0;
     dom->flags = flags;
     dom->console_evtchn = state->console_port;
     dom->console_domid = state->console_domid;
@@ -438,7 +446,8 @@ int libxl__build_pv(libxl__gc *gc, uint3
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_dom_boot_image failed");
         goto out;
     }
-    if ( (ret = xc_dom_gnttab_init(dom)) != 0 ) {
+    /* PVH sets up its own grant during boot via hvm mechanisms */
+    if ( !is_pvh && (ret = xc_dom_gnttab_init(dom)) != 0 ) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_dom_gnttab_init failed");
         goto out;
     }
diff -r 8b0762504037 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/libxl_types.idl	Wed Nov 14 11:03:24 2012 -0800
@@ -243,6 +243,7 @@ libxl_domain_create_info = Struct("domai
     ("platformdata", libxl_key_value_list),
     ("poolid",       uint32),
     ("run_hotplug_scripts",libxl_defbool),
+    ("ci_pvh",       libxl_defbool),
     ], dir=DIR_IN)
 
 MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
@@ -339,6 +340,7 @@ libxl_domain_build_info = Struct("domain
                                       ])),
                  ("invalid", Struct(None, [])),
                  ], keyvar_init_val = "LIBXL_DOMAIN_TYPE_INVALID")),
+    ("bi_pvh",       libxl_defbool),
     ], dir=DIR_IN
 )
 
diff -r 8b0762504037 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/xl_cmdimpl.c	Wed Nov 14 11:03:24 2012 -0800
@@ -615,8 +615,18 @@ static void parse_config_data(const char
         !strncmp(buf, "hvm", strlen(buf)))
         c_info->type = LIBXL_DOMAIN_TYPE_HVM;
 
+    libxl_defbool_setdefault(&c_info->ci_pvh, false);
+    libxl_defbool_setdefault(&c_info->hap, false);
+    xlu_cfg_get_defbool(config, "pvh", &c_info->ci_pvh, 0);
     xlu_cfg_get_defbool(config, "hap", &c_info->hap, 0);
 
+    if (libxl_defbool_val(c_info->ci_pvh) &&
+        !libxl_defbool_val(c_info->hap)) {
+
+        fprintf(stderr, "hap is required for PVH domain\n");
+        exit(1);
+    }
+
     if (xlu_cfg_replace_string (config, "name", &c_info->name, 0)) {
         fprintf(stderr, "Domain name must be specified.\n");
         exit(1);
@@ -916,6 +926,7 @@ static void parse_config_data(const char
 
         b_info->u.pv.cmdline = cmdline;
         xlu_cfg_replace_string (config, "ramdisk", &b_info->u.pv.ramdisk, 0);
+        libxl_defbool_set(&b_info->bi_pvh, libxl_defbool_val(c_info->ci_pvh));
         break;
     }
     default:
diff -r 8b0762504037 tools/xenstore/xenstored_domain.c
--- a/tools/xenstore/xenstored_domain.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/xenstore/xenstored_domain.c	Wed Nov 14 11:03:24 2012 -0800
@@ -578,11 +578,13 @@ static int close_xc_handle(void *_handle
 	return 0;
 }
 
+#if 0
 static int close_xcg_handle(void *_handle)
 {
 	xc_gnttab_close(*(xc_gnttab **)_handle);
 	return 0;
 }
+#endif
 
 /* Returns the implicit path of a connection (only domains have this) */
 const char *get_implicit_path(const struct connection *conn)
@@ -639,12 +641,14 @@ void domain_init(void)
 	if (!xcg_handle)
 		barf_perror("Failed to allocate domain gnttab handle");
 
+*xcg_handle = NULL;
+#if 0
 	*xcg_handle = xc_gnttab_open(NULL, 0);
 	if (*xcg_handle < 0)
 		xprintf("WARNING: Failed to open connection to gnttab\n");
 	else
 		talloc_set_destructor(xcg_handle, close_xcg_handle);
-
+#endif
 	xce_handle = xc_evtchn_open(NULL, 0);
 
 	if (xce_handle == NULL)
diff -r 8b0762504037 xen/arch/x86/debug.c
--- a/xen/arch/x86/debug.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/debug.c	Wed Nov 14 11:03:24 2012 -0800
@@ -59,7 +59,7 @@ dbg_hvm_va2mfn(dbgva_t vaddr, struct dom
         return INVALID_MFN;
     }
 
-    mfn = mfn_x(get_gfn(dp, *gfn, &gfntype)); 
+    mfn = mfn_x(get_gfn_query_unlocked(dp, *gfn, &gfntype)); 
     if ( p2m_is_readonly(gfntype) && toaddr )
     {
         DBGP2("kdb:p2m_is_readonly: gfntype:%x\n", gfntype);
@@ -153,7 +153,7 @@ dbg_rw_guest_mem(dbgva_t addr, dbgbyte_t
 
         pagecnt = min_t(long, PAGE_SIZE - (addr & ~PAGE_MASK), len);
 
-        mfn = (dp->is_hvm
+        mfn = (is_hvm_or_pvh_domain(dp)
                ? dbg_hvm_va2mfn(addr, dp, toaddr, &gfn)
                : dbg_pv_va2mfn(addr, dp, pgd3));
         if ( mfn == INVALID_MFN ) 
@@ -173,8 +173,6 @@ dbg_rw_guest_mem(dbgva_t addr, dbgbyte_t
         }
 
         unmap_domain_page(va);
-        if ( gfn != INVALID_GFN )
-            put_gfn(dp, gfn);
 
         addr += pagecnt;
         buf += pagecnt;
diff -r 8b0762504037 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/domain.c	Wed Nov 14 11:03:24 2012 -0800
@@ -410,7 +410,7 @@ int vcpu_initialise(struct vcpu *v)
 
     vmce_init_vcpu(v);
 
-    if ( is_hvm_domain(d) )
+    if ( is_hvm_or_pvh_domain(d) )
     {
         rc = hvm_vcpu_initialise(v);
         goto done;
@@ -476,7 +476,7 @@ void vcpu_destroy(struct vcpu *v)
 
     vcpu_destroy_fpu(v);
 
-    if ( is_hvm_vcpu(v) )
+    if ( is_hvm_or_pvh_vcpu(v) )
         hvm_vcpu_destroy(v);
     else if ( standalone_trap_ctxt(v) )
         free_xenheap_page(v->arch.pv_vcpu.trap_ctxt);
@@ -489,7 +489,7 @@ int arch_domain_create(struct domain *d,
     int rc = -ENOMEM;
 
     d->arch.hvm_domain.hap_enabled =
-        is_hvm_domain(d) &&
+        is_hvm_or_pvh_domain(d) &&
         hvm_funcs.hap_supported &&
         (domcr_flags & DOMCRF_hap);
     d->arch.hvm_domain.mem_sharing_enabled = 0;
@@ -539,7 +539,7 @@ int arch_domain_create(struct domain *d,
                             __PAGE_HYPERVISOR);
 
     HYPERVISOR_COMPAT_VIRT_START(d) =
-        is_hvm_domain(d) ? ~0u : __HYPERVISOR_COMPAT_VIRT_START;
+        is_hvm_or_pvh_domain(d) ? ~0u : __HYPERVISOR_COMPAT_VIRT_START;
 
     if ( (rc = paging_domain_init(d, domcr_flags)) != 0 )
         goto fail;
@@ -581,7 +581,7 @@ int arch_domain_create(struct domain *d,
             goto fail;
     }
 
-    if ( is_hvm_domain(d) )
+    if ( is_hvm_or_pvh_domain(d) )
     {
         if ( (rc = hvm_domain_initialise(d)) != 0 )
         {
@@ -593,9 +593,9 @@ int arch_domain_create(struct domain *d,
     {
         /* 64-bit PV guest by default. */
         d->arch.is_32bit_pv = d->arch.has_32bit_shinfo = 0;
-
+    }
+    if ( !is_hvm_domain(d) )
         spin_lock_init(&d->arch.pv_domain.e820_lock);
-    }
 
     /* initialize default tsc behavior in case tools don't */
     tsc_set_info(d, TSC_MODE_DEFAULT, 0UL, 0, 0);
@@ -622,9 +622,10 @@ void arch_domain_destroy(struct domain *
 {
     unsigned int i;
 
-    if ( is_hvm_domain(d) )
+    if ( is_hvm_or_pvh_domain(d) )
         hvm_domain_destroy(d);
-    else
+
+    if ( !is_hvm_domain(d) )
         xfree(d->arch.pv_domain.e820);
 
     free_domain_pirqs(d);
@@ -683,6 +684,9 @@ int arch_set_info_guest(
     unsigned int i;
     int rc = 0, compat;
 
+    if ( is_pvh_vcpu(v) && is_pvh_vcpu(current) )
+        return -EINVAL;
+
     /* The context is a compat-mode one if the target domain is compat-mode;
      * we expect the tools to DTRT even in compat-mode callers. */
     compat = is_pv_32on64_domain(d);
@@ -690,7 +694,7 @@ int arch_set_info_guest(
 #define c(fld) (compat ? (c.cmp->fld) : (c.nat->fld))
     flags = c(flags);
 
-    if ( !is_hvm_vcpu(v) )
+    if ( !is_hvm_or_pvh_vcpu(v) )
     {
         if ( !compat )
         {
@@ -743,7 +747,7 @@ int arch_set_info_guest(
     v->fpu_initialised = !!(flags & VGCF_I387_VALID);
 
     v->arch.flags &= ~TF_kernel_mode;
-    if ( (flags & VGCF_in_kernel) || is_hvm_vcpu(v)/*???*/ )
+    if ( (flags & VGCF_in_kernel) || is_hvm_or_pvh_vcpu(v)/*???*/ )
         v->arch.flags |= TF_kernel_mode;
 
     v->arch.vgc_flags = flags;
@@ -752,7 +756,7 @@ int arch_set_info_guest(
     if ( !compat )
     {
         memcpy(&v->arch.user_regs, &c.nat->user_regs, sizeof(c.nat->user_regs));
-        if ( !is_hvm_vcpu(v) )
+        if ( !is_hvm_or_pvh_vcpu(v) )
             memcpy(v->arch.pv_vcpu.trap_ctxt, c.nat->trap_ctxt,
                    sizeof(c.nat->trap_ctxt));
     }
@@ -768,10 +772,13 @@ int arch_set_info_guest(
 
     v->arch.user_regs.eflags |= 2;
 
-    if ( is_hvm_vcpu(v) )
+    if ( is_hvm_or_pvh_vcpu(v) )
     {
         hvm_set_info_guest(v);
-        goto out;
+        if ( is_hvm_vcpu(v) || v->is_initialised )
+            goto out;
+        else 
+            goto pvh_skip_pv;;
     }
 
     init_int80_direct_trap(v);
@@ -780,7 +787,8 @@ int arch_set_info_guest(
     v->arch.pv_vcpu.iopl = (v->arch.user_regs.eflags >> 12) & 3;
     v->arch.user_regs.eflags &= ~X86_EFLAGS_IOPL;
 
-    /* Ensure real hardware interrupts are enabled. */
+    /* Ensure real hardware interrupts are enabled. FYI: PVH may not have 
+     * IDT set on all vcpus so don't enable IF for it yet. */
     v->arch.user_regs.eflags |= X86_EFLAGS_IF;
 
     if ( !v->is_initialised )
@@ -811,8 +819,8 @@ int arch_set_info_guest(
         }
 
         for ( i = 0; i < ARRAY_SIZE(v->arch.pv_vcpu.gdt_frames); ++i )
-            fail |= v->arch.pv_vcpu.gdt_frames[i] != c(gdt_frames[i]);
-        fail |= v->arch.pv_vcpu.gdt_ents != c(gdt_ents);
+            fail |= v->arch.pv_vcpu.gdt_frames[i] != c(u.pv.gdt_frames[i]);
+        fail |= v->arch.pv_vcpu.gdt_ents != c(u.pv.gdt_ents);
 
         fail |= v->arch.pv_vcpu.ldt_base != c(ldt_base);
         fail |= v->arch.pv_vcpu.ldt_ents != c(ldt_ents);
@@ -861,21 +869,22 @@ int arch_set_info_guest(
         d->vm_assist = c(vm_assist);
 
     if ( !compat )
-        rc = (int)set_gdt(v, c.nat->gdt_frames, c.nat->gdt_ents);
+        rc = (int)set_gdt(v, c.nat->u.pv.gdt_frames, c.nat->u.pv.gdt_ents);
     else
     {
         unsigned long gdt_frames[ARRAY_SIZE(v->arch.pv_vcpu.gdt_frames)];
-        unsigned int n = (c.cmp->gdt_ents + 511) / 512;
+        unsigned int n = (c.cmp->u.pv.gdt_ents + 511) / 512;
 
         if ( n > ARRAY_SIZE(v->arch.pv_vcpu.gdt_frames) )
             return -EINVAL;
         for ( i = 0; i < n; ++i )
-            gdt_frames[i] = c.cmp->gdt_frames[i];
-        rc = (int)set_gdt(v, gdt_frames, c.cmp->gdt_ents);
+            gdt_frames[i] = c.cmp->u.pv.gdt_frames[i];
+        rc = (int)set_gdt(v, gdt_frames, c.cmp->u.pv.gdt_ents);
     }
     if ( rc != 0 )
         return rc;
 
+pvh_skip_pv:
     if ( !compat )
     {
         cr3_gfn = xen_cr3_to_pfn(c.nat->ctrlreg[3]);
@@ -883,19 +892,26 @@ int arch_set_info_guest(
 
         if ( !cr3_page )
         {
-            destroy_gdt(v);
+            if ( !is_pvh_vcpu(v) )
+                destroy_gdt(v);
             return -EINVAL;
         }
         if ( !paging_mode_refcounts(d)
              && !get_page_type(cr3_page, PGT_base_page_table) )
         {
             put_page(cr3_page);
-            destroy_gdt(v);
+            if ( !is_pvh_vcpu(v) )
+                destroy_gdt(v);
             return -EINVAL;
         }
 
+        if ( is_pvh_vcpu(v) ) {
+            v->arch.cr3 = page_to_mfn(cr3_page);
+            v->arch.hvm_vcpu.guest_cr[3] = c.nat->ctrlreg[3];
+        }
+
         v->arch.guest_table = pagetable_from_page(cr3_page);
-        if ( c.nat->ctrlreg[1] )
+        if ( c.nat->ctrlreg[1] && !is_pvh_vcpu(v) )
         {
             cr3_gfn = xen_cr3_to_pfn(c.nat->ctrlreg[1]);
             cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC);
@@ -920,7 +936,8 @@ int arch_set_info_guest(
         }
         else if ( !(flags & VGCF_in_kernel) )
         {
-            destroy_gdt(v);
+            if ( !is_pvh_vcpu(v) )
+                destroy_gdt(v);
             return -EINVAL;
         }
     }
@@ -961,6 +978,13 @@ int arch_set_info_guest(
 
     update_cr3(v);
 
+    if ( is_pvh_vcpu(v) )
+    {
+        /* guest is bringing up non-boot SMP vcpu */
+        if ( (rc=hvm_pvh_set_vcpu_info(v, c.nat)) != 0 )
+            return rc;
+    }
+
  out:
     if ( flags & VGCF_online )
         clear_bit(_VPF_down, &v->pause_flags);
@@ -991,16 +1015,21 @@ void arch_vcpu_reset(struct vcpu *v)
 static void
 unmap_vcpu_info(struct vcpu *v)
 {
-    unsigned long mfn;
+    unsigned long mfn, *mfnp;
 
-    if ( v->arch.pv_vcpu.vcpu_info_mfn == INVALID_MFN )
+    if ( is_pvh_vcpu(v) )
+        mfnp = &v->arch.hvm_vcpu.hv_pvh.pvh_vcpu_info_mfn;
+    else
+        mfnp = &v->arch.pv_vcpu.vcpu_info_mfn;
+
+    mfn = *mfnp;
+    if ( mfn == INVALID_MFN )
         return;
 
-    mfn = v->arch.pv_vcpu.vcpu_info_mfn;
     unmap_domain_page_global(v->vcpu_info);
 
     v->vcpu_info = &dummy_vcpu_info;
-    v->arch.pv_vcpu.vcpu_info_mfn = INVALID_MFN;
+    *mfnp = INVALID_MFN;
 
     put_page_and_type(mfn_to_page(mfn));
 }
@@ -1011,7 +1040,7 @@ unmap_vcpu_info(struct vcpu *v)
  * of memory, and it sets a pending event to make sure that a pending
  * event doesn't get missed.
  */
-static int
+static noinline int
 map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
 {
     struct domain *d = v->domain;
@@ -1019,11 +1048,17 @@ map_vcpu_info(struct vcpu *v, unsigned l
     vcpu_info_t *new_info;
     struct page_info *page;
     int i;
+    unsigned long *mfnp;
+
+    if ( is_pvh_vcpu(v) )
+        mfnp = &v->arch.hvm_vcpu.hv_pvh.pvh_vcpu_info_mfn;
+    else
+        mfnp = &v->arch.pv_vcpu.vcpu_info_mfn;
 
     if ( offset > (PAGE_SIZE - sizeof(vcpu_info_t)) )
         return -EINVAL;
 
-    if ( v->arch.pv_vcpu.vcpu_info_mfn != INVALID_MFN )
+    if ( *mfnp != INVALID_MFN )
         return -EINVAL;
 
     /* Run this command on yourself or on other offline VCPUS. */
@@ -1060,7 +1095,7 @@ map_vcpu_info(struct vcpu *v, unsigned l
     }
 
     v->vcpu_info = new_info;
-    v->arch.pv_vcpu.vcpu_info_mfn = page_to_mfn(page);
+    *mfnp = page_to_mfn(page);
 
     /* Set new vcpu_info pointer /before/ setting pending flags. */
     wmb();
@@ -1370,10 +1405,10 @@ static void save_segments(struct vcpu *v
     struct cpu_user_regs *regs = &v->arch.user_regs;
     unsigned int dirty_segment_mask = 0;
 
-    regs->ds = read_segment_register(ds);
-    regs->es = read_segment_register(es);
-    regs->fs = read_segment_register(fs);
-    regs->gs = read_segment_register(gs);
+    regs->ds = read_segment_register(v, regs, ds);
+    regs->es = read_segment_register(v, regs, es);
+    regs->fs = read_segment_register(v, regs, fs);
+    regs->gs = read_segment_register(v, regs, gs);
 
     if ( regs->ds )
         dirty_segment_mask |= DIRTY_DS;
@@ -1466,7 +1501,7 @@ static void update_runstate_area(struct 
 
 static inline int need_full_gdt(struct vcpu *v)
 {
-    return (!is_hvm_vcpu(v) && !is_idle_vcpu(v));
+    return (!is_hvm_or_pvh_vcpu(v) && !is_idle_vcpu(v));
 }
 
 static void __context_switch(void)
@@ -1593,7 +1628,7 @@ void context_switch(struct vcpu *prev, s
         /* Re-enable interrupts before restoring state which may fault. */
         local_irq_enable();
 
-        if ( !is_hvm_vcpu(next) )
+        if ( !is_hvm_or_pvh_vcpu(next) )
         {
             load_LDT(next);
             load_segments(next);
@@ -2034,7 +2069,7 @@ int domain_relinquish_resources(struct d
         for_each_vcpu ( d, v )
             vcpu_destroy_pagetables(v);
 
-        if ( !is_hvm_domain(d) )
+        if ( !is_hvm_or_pvh_domain(d) )
         {
             for_each_vcpu ( d, v )
             {
@@ -2045,6 +2080,7 @@ int domain_relinquish_resources(struct d
                  */
                 destroy_gdt(v);
 
+/**** PVH: unmap vcpu info here ??????????????? */
                 unmap_vcpu_info(v);
             }
 
@@ -2109,7 +2145,7 @@ int domain_relinquish_resources(struct d
         BUG();
     }
 
-    if ( is_hvm_domain(d) )
+    if ( is_hvm_or_pvh_domain(d) )
         hvm_domain_relinquish_resources(d);
 
     return 0;
@@ -2190,7 +2226,7 @@ void vcpu_mark_events_pending(struct vcp
     if ( already_pending )
         return;
 
-    if ( is_hvm_vcpu(v) )
+    if ( is_hvm_or_pvh_vcpu(v) )
         hvm_assert_evtchn_irq(v);
     else
         vcpu_kick(v);
diff -r 8b0762504037 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/domain_build.c	Wed Nov 14 11:03:24 2012 -0800
@@ -35,6 +35,8 @@
 #include <asm/setup.h>
 #include <asm/bzimage.h> /* for bzimage_parse */
 #include <asm/io_apic.h>
+#include <asm/hap.h>
+#include <asm/debugger.h>
 
 #include <public/version.h>
 
@@ -307,6 +309,31 @@ static void __init process_dom0_ioports_
     }
 }
 
+static noinline __init void dom0_update_physmap(struct domain *d, unsigned long pfn,
+                                    unsigned long mfn, unsigned long vphysmap_s)
+{
+    if (d->is_pvh) {
+        int rc = guest_physmap_add_page(d, pfn, mfn, 0);
+        BUG_ON(rc);             /* for now while PVH feature is experimental */
+	return;
+    }
+    if ( !is_pv_32on64_domain(d) )
+        ((unsigned long *)vphysmap_s)[pfn] = mfn;
+    else
+        ((unsigned int *)vphysmap_s)[pfn] = mfn;
+
+    set_gpfn_from_mfn(mfn, pfn);
+}
+
+static __init void noinline copy_pvh(char *dest, char *src, int bytes)
+{
+    int rem = dbg_rw_mem((dbgva_t)dest, (unsigned char *)src, bytes, 0, 1, 0);
+    if (rem) {
+        printk("Failed to copy to dom0. len:%d rem:%d\n", bytes, rem);
+        domain_crash_synchronous();
+    }
+}
+
 int __init construct_dom0(
     struct domain *d,
     const module_t *image, unsigned long image_headroom,
@@ -314,6 +341,7 @@ int __init construct_dom0(
     void *(*bootstrap_map)(const module_t *),
     char *cmdline)
 {
+    char si_buf[PAGE_SIZE], tmp_buf[PAGE_SIZE];
     int i, cpu, rc, compatible, compat32, order, machine;
     struct cpu_user_regs *regs;
     unsigned long pfn, mfn;
@@ -322,7 +350,7 @@ int __init construct_dom0(
     unsigned long alloc_spfn;
     unsigned long alloc_epfn;
     unsigned long initrd_pfn = -1, initrd_mfn = 0;
-    unsigned long count;
+    unsigned long count, shared_info_pfn_addr = 0;
     struct page_info *page = NULL;
     start_info_t *si;
     struct vcpu *v = d->vcpu[0];
@@ -480,6 +508,15 @@ int __init construct_dom0(
     vstartinfo_end   = (vstartinfo_start +
                         sizeof(struct start_info) +
                         sizeof(struct dom0_vga_console_info));
+
+    if ( is_pvh_domain(d) ) {
+        kdbp("MUK: vstartinfo_end:%lx\n", vstartinfo_end);
+	shared_info_pfn_addr = round_pgup(vstartinfo_end) - v_start;
+    	vstartinfo_end   += PAGE_SIZE;
+        kdbp("MUK: adjusted vstartinfo_end:%lx shared_info_pfn:%lx\n", 
+	       vstartinfo_end, shared_info_pfn_addr);
+    }
+
     vpt_start        = round_pgup(vstartinfo_end);
     for ( nr_pt_pages = 2; ; nr_pt_pages++ )
     {
@@ -621,20 +658,30 @@ int __init construct_dom0(
         maddr_to_page(mpt_alloc)->u.inuse.type_info = PGT_l3_page_table;
         l3start = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
     }
-    copy_page(l4tab, idle_pg_table);
-    l4tab[0] = l4e_empty(); /* zap trampoline mapping */
-    l4tab[l4_table_offset(LINEAR_PT_VIRT_START)] =
-        l4e_from_paddr(__pa(l4start), __PAGE_HYPERVISOR);
-    l4tab[l4_table_offset(PERDOMAIN_VIRT_START)] =
-        l4e_from_paddr(__pa(d->arch.mm_perdomain_l3), __PAGE_HYPERVISOR);
-    v->arch.guest_table = pagetable_from_paddr(__pa(l4start));
-    if ( is_pv_32on64_domain(d) )
-        v->arch.guest_table_user = v->arch.guest_table;
+    if ( is_pvh_domain(d) ) 
+    {
+        v->arch.guest_table = pagetable_from_paddr(vpt_start - v_start);
+        pfn = 0;
+    } else {
+        copy_page(l4tab, idle_pg_table);
+        l4tab[0] = l4e_empty(); /* zap trampoline mapping */
+        l4tab[l4_table_offset(LINEAR_PT_VIRT_START)] =
+            l4e_from_paddr(__pa(l4start), __PAGE_HYPERVISOR);
+        l4tab[l4_table_offset(PERDOMAIN_VIRT_START)] =
+            l4e_from_paddr(__pa(d->arch.mm_perdomain_l3), __PAGE_HYPERVISOR);
+            v->arch.guest_table = pagetable_from_paddr(__pa(l4start));
+        if ( is_pv_32on64_domain(d) )
+            v->arch.guest_table_user = v->arch.guest_table;
+        pfn = alloc_spfn;
+    }
 
     l4tab += l4_table_offset(v_start);
-    pfn = alloc_spfn;
     for ( count = 0; count < ((v_end-v_start)>>PAGE_SHIFT); count++ )
     {
+        /* initrd chunk's mfns are separate, so we need to adjust for them */
+        signed long hyb_adj = is_pvh_domain(d) ?
+                            (-alloc_spfn + PFN_UP(initrd_len))<<PAGE_SHIFT : 0;
+
         if ( !((unsigned long)l1tab & (PAGE_SIZE-1)) )
         {
             maddr_to_page(mpt_alloc)->u.inuse.type_info = PGT_l1_page_table;
@@ -661,16 +708,17 @@ int __init construct_dom0(
                     clear_page(l3tab);
                     if ( count == 0 )
                         l3tab += l3_table_offset(v_start);
-                    *l4tab = l4e_from_paddr(__pa(l3start), L4_PROT);
+                    *l4tab = l4e_from_paddr(__pa(l3start) + hyb_adj, L4_PROT);
                     l4tab++;
                 }
-                *l3tab = l3e_from_paddr(__pa(l2start), L3_PROT);
+                *l3tab = l3e_from_paddr(__pa(l2start) + hyb_adj, L3_PROT);
                 l3tab++;
             }
-            *l2tab = l2e_from_paddr(__pa(l1start), L2_PROT);
+            *l2tab = l2e_from_paddr(__pa(l1start) + hyb_adj, L2_PROT);
             l2tab++;
         }
-        if ( count < initrd_pfn || count >= initrd_pfn + PFN_UP(initrd_len) )
+        if ( is_pvh_domain(d) ||
+             count < initrd_pfn || count >= initrd_pfn + PFN_UP(initrd_len) )
             mfn = pfn++;
         else
             mfn = initrd_mfn++;
@@ -678,6 +726,9 @@ int __init construct_dom0(
                                     L1_PROT : COMPAT_L1_PROT));
         l1tab++;
 
+        if ( is_pvh_domain(d) )
+            continue;
+
         page = mfn_to_page(mfn);
         if ( (page->u.inuse.type_info == 0) &&
              !get_page_and_type(page, d, PGT_writable_page) )
@@ -714,7 +765,7 @@ int __init construct_dom0(
     l2tab += l2_table_offset(vpt_start);
     l1start = l1tab = l2e_to_l1e(*l2tab);
     l1tab += l1_table_offset(vpt_start);
-    for ( count = 0; count < nr_pt_pages; count++ ) 
+    for ( count = 0; count < nr_pt_pages && !is_pvh_domain(d); count++ ) 
     {
         l1e_remove_flags(*l1tab, _PAGE_RW);
         page = mfn_to_page(l1e_get_pfn(*l1tab));
@@ -758,6 +809,11 @@ int __init construct_dom0(
         (void)alloc_vcpu(d, i, cpu);
     }
 
+    if ( is_pvh_domain(d) )
+    {
+        v->arch.cr3 = v->arch.hvm_vcpu.guest_cr[3] =
+                        (pagetable_get_pfn(v->arch.guest_table)) << PAGE_SHIFT;
+    }
     /* Set up CR3 value for write_ptbase */
     if ( paging_mode_enabled(d) )
         paging_update_paging_modes(v);
@@ -767,34 +823,12 @@ int __init construct_dom0(
     /* We run on dom0's page tables for the final part of the build process. */
     write_ptbase(v);
 
-    /* Copy the OS image and free temporary buffer. */
-    elf.dest = (void*)vkern_start;
-    rc = elf_load_binary(&elf);
-    if ( rc < 0 )
-    {
-        printk("Failed to load the kernel binary\n");
-        return rc;
-    }
-    bootstrap_map(NULL);
+    /* Set up start info area. */
+    if ( is_pvh_domain(d) )
+        si = (start_info_t *)si_buf;
+    else
+        si = (start_info_t *)vstartinfo_start;
 
-    if ( UNSET_ADDR != parms.virt_hypercall )
-    {
-        if ( (parms.virt_hypercall < v_start) ||
-             (parms.virt_hypercall >= v_end) )
-        {
-            write_ptbase(current);
-            printk("Invalid HYPERCALL_PAGE field in ELF notes.\n");
-            return -1;
-        }
-        hypercall_page_initialise(
-            d, (void *)(unsigned long)parms.virt_hypercall);
-    }
-
-    /* Free temporary buffers. */
-    discard_initial_images();
-
-    /* Set up start info area. */
-    si = (start_info_t *)vstartinfo_start;
     clear_page(si);
     si->nr_pages = nr_pages;
 
@@ -803,6 +837,8 @@ int __init construct_dom0(
     si->flags        = SIF_PRIVILEGED | SIF_INITDOMAIN;
     if ( !vinitrd_start && initrd_len )
         si->flags   |= SIF_MOD_START_PFN;
+    if ( is_pvh_domain(d) )
+        si->flags   |= SIF_IS_PVH;
     si->flags       |= (xen_processor_pmbits << 8) & SIF_PM_MASK;
     si->pt_base      = vpt_start;
     si->nr_pt_frames = nr_pt_pages;
@@ -812,7 +848,7 @@ int __init construct_dom0(
 
     count = d->tot_pages;
     /* Set up the phys->machine table if not part of the initial mapping. */
-    if ( parms.p2m_base != UNSET_ADDR )
+    if ( parms.p2m_base != UNSET_ADDR && !is_pvh_domain(d) )
     {
         unsigned long va = vphysmap_start;
 
@@ -911,6 +947,11 @@ int __init construct_dom0(
             panic("Not enough RAM for DOM0 P->M table.\n");
     }
 
+    if (is_pvh_domain(d) )
+    {
+        hap_set_pvh_alloc_for_dom0(d, nr_pages);
+        kdbp("MUK: Count is:%d 0x%x\n", count, count);
+    }
     /* Write the phys->machine and machine->phys table entries. */
     for ( pfn = 0; pfn < count; pfn++ )
     {
@@ -927,11 +968,8 @@ int __init construct_dom0(
         if ( pfn > REVERSE_START && (vinitrd_start || pfn < initrd_pfn) )
             mfn = alloc_epfn - (pfn - REVERSE_START);
 #endif
-        if ( !is_pv_32on64_domain(d) )
-            ((unsigned long *)vphysmap_start)[pfn] = mfn;
-        else
-            ((unsigned int *)vphysmap_start)[pfn] = mfn;
-        set_gpfn_from_mfn(mfn, pfn);
+        dom0_update_physmap(d, pfn, mfn, vphysmap_start);
+
         if (!(pfn & 0xfffff))
             process_pending_softirqs();
     }
@@ -947,8 +985,8 @@ int __init construct_dom0(
             if ( !page->u.inuse.type_info &&
                  !get_page_and_type(page, d, PGT_writable_page) )
                 BUG();
-            ((unsigned long *)vphysmap_start)[pfn] = mfn;
-            set_gpfn_from_mfn(mfn, pfn);
+            
+            dom0_update_physmap(d, pfn, mfn, vphysmap_start);
             ++pfn;
             if (!(pfn & 0xfffff))
                 process_pending_softirqs();
@@ -968,11 +1006,7 @@ int __init construct_dom0(
 #ifndef NDEBUG
 #define pfn (nr_pages - 1 - (pfn - (alloc_epfn - alloc_spfn)))
 #endif
-            if ( !is_pv_32on64_domain(d) )
-                ((unsigned long *)vphysmap_start)[pfn] = mfn;
-            else
-                ((unsigned int *)vphysmap_start)[pfn] = mfn;
-            set_gpfn_from_mfn(mfn, pfn);
+            dom0_update_physmap(d, pfn, mfn, vphysmap_start);
 #undef pfn
             page++; pfn++;
             if (!(pfn & 0xfffff))
@@ -980,6 +1014,35 @@ int __init construct_dom0(
         }
     }
 
+    /* Copy the OS image and free temporary buffer. */
+    elf.dest = (void*)vkern_start;
+    rc = elf_load_binary(&elf, is_pvh_domain(d) );
+    if ( rc < 0 )
+    {
+        printk("Failed to load the kernel binary\n");
+        return rc;
+    }
+    bootstrap_map(NULL);
+
+    if ( UNSET_ADDR != parms.virt_hypercall )
+    {
+        void *addr = is_pvh_domain(d) ? tmp_buf : (void *)parms.virt_hypercall;
+
+        if ( (parms.virt_hypercall < v_start) ||
+             (parms.virt_hypercall >= v_end) )
+        {
+            write_ptbase(current);
+            printk("Invalid HYPERCALL_PAGE field in ELF notes.\n");
+            return -1;
+        }
+        hypercall_page_initialise(d, addr);
+        if ( is_pvh_domain(d) )
+            copy_pvh((void *)parms.virt_hypercall, tmp_buf, PAGE_SIZE);
+    }
+
+    /* Free temporary buffers. */
+    discard_initial_images();
+
     if ( initrd_len != 0 )
     {
         si->mod_start = vinitrd_start ?: initrd_pfn;
@@ -995,6 +1058,15 @@ int __init construct_dom0(
         si->console.dom0.info_off  = sizeof(struct start_info);
         si->console.dom0.info_size = sizeof(struct dom0_vga_console_info);
     }
+    if ( is_pvh_domain(d) ) {
+        unsigned long mfn = virt_to_mfn(d->shared_info);
+        unsigned long pfn = shared_info_pfn_addr>>PAGE_SHIFT;
+        si->shared_info = shared_info_pfn_addr;
+        dom0_update_physmap(d, pfn, mfn, 0);
+
+        copy_pvh((char *)vstartinfo_start, si_buf, PAGE_SIZE);
+    }
+    kdbp("MUK: si->shared_info:%lx\n", si->shared_info);
 
     if ( is_pv_32on64_domain(d) )
         xlat_start_info(si, XLAT_start_info_console_dom0);
@@ -1007,6 +1079,7 @@ int __init construct_dom0(
     v->is_initialised = 1;
     clear_bit(_VPF_down, &v->pause_flags);
 
+/* PVH NOTE: some of these are ignored */
     /*
      * Initial register values:
      *  DS,ES,FS,GS = FLAT_KERNEL_DS
@@ -1025,12 +1098,16 @@ int __init construct_dom0(
     regs->eip = parms.virt_entry;
     regs->esp = vstack_end;
     regs->esi = vstartinfo_start;
-    regs->eflags = X86_EFLAGS_IF;
+    regs->eflags = X86_EFLAGS_IF | 0x2;
 
-    if ( opt_dom0_shadow )
+    if ( opt_dom0_shadow ) {
+        if ( is_pvh_domain(d) ) {
+            printk("Invalid option dom0_shadow for PVH\n");
+            return -EINVAL;
+        }
         if ( paging_enable(d, PG_SH_enable) == 0 ) 
             paging_update_paging_modes(v);
-
+    }
     if ( supervisor_mode_kernel )
     {
         v->arch.pv_vcpu.kernel_ss &= ~3;
diff -r 8b0762504037 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/domctl.c	Wed Nov 14 11:03:24 2012 -0800
@@ -46,6 +46,77 @@ static int gdbsx_guest_mem_io(
     return (iop->remain ? -EFAULT : 0);
 }
 
+long domctl_memory_mapping(struct domain *d, unsigned long gfn,
+                           unsigned long mfn, unsigned long nr_mfns,
+                           int add_map)
+{
+    int i;
+    long ret = -EINVAL;
+
+    if ( (mfn + nr_mfns - 1) < mfn || /* wrap? */
+         ((mfn | (mfn + nr_mfns - 1)) >> (paddr_bits - PAGE_SHIFT)) ||
+         (gfn + nr_mfns - 1) < gfn ) /* wrap? */
+        return ret;
+
+    ret = -EPERM;
+    if ( !IS_PRIV(current->domain) &&
+         !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
+        return ret;
+
+/* TBD: common code with do_physdev_op() */
+
+    ret = xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, add_map);
+    if ( ret )
+        return ret;
+
+    if ( add_map )
+    {
+        if ( !is_pvh_domain(d) )   /* PVH maps lots and lots */
+            printk(XENLOG_G_INFO
+                   "memory_map:add: dom%d gfn=%lx mfn=%lx nr=%lx\n",
+                   d->domain_id, gfn, mfn, nr_mfns);
+
+        ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
+        if ( !ret && paging_mode_translate(d) )
+        {
+            for ( i = 0; !ret && i < nr_mfns; i++ )
+                if ( !set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i)) )
+                    ret = -EIO;
+            if ( ret )
+            {
+                printk(XENLOG_G_WARNING
+                       "memory_map:fail: dom%d gfn=%lx mfn=%lx\n",
+                       d->domain_id, gfn + i, mfn + i);
+                while ( i-- )
+                    clear_mmio_p2m_entry(d, gfn + i);
+                if ( iomem_deny_access(d, mfn, mfn + nr_mfns - 1) &&
+                     IS_PRIV(current->domain) )
+                    printk(XENLOG_ERR
+                           "memory_map: failed to deny dom%d access to [%lx,%lx]\n",
+                           d->domain_id, mfn, mfn + nr_mfns - 1);
+            }
+        }
+    } else {
+        if ( !is_pvh_domain(d) )   /* PVH unmaps lots and lots */
+            printk(XENLOG_G_INFO
+                   "memory_map:remove: dom%d gfn=%lx mfn=%lx nr=%lx\n",
+                   d->domain_id, gfn, mfn, nr_mfns);
+
+        if ( paging_mode_translate(d) )
+            for ( i = 0; i < nr_mfns; i++ )
+                add_map |= !clear_mmio_p2m_entry(d, gfn + i);
+        ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
+        if ( !ret && add_map )
+            ret = -EIO;
+        if ( ret && IS_PRIV(current->domain) )
+            printk(XENLOG_ERR
+                   "memory_map: error %ld %s dom%d access to [%lx,%lx]\n",
+                   ret, add_map ? "removing" : "denying", d->domain_id,
+                   mfn, mfn + nr_mfns - 1);
+    }
+    return ret;
+}
+
 long arch_do_domctl(
     struct xen_domctl *domctl,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
@@ -825,75 +896,13 @@ long arch_do_domctl(
         unsigned long mfn = domctl->u.memory_mapping.first_mfn;
         unsigned long nr_mfns = domctl->u.memory_mapping.nr_mfns;
         int add = domctl->u.memory_mapping.add_mapping;
-        unsigned long i;
 
-        ret = -EINVAL;
-        if ( (mfn + nr_mfns - 1) < mfn || /* wrap? */
-             ((mfn | (mfn + nr_mfns - 1)) >> (paddr_bits - PAGE_SHIFT)) ||
-             (gfn + nr_mfns - 1) < gfn ) /* wrap? */
-            break;
-
-        ret = -EPERM;
-        if ( !IS_PRIV(current->domain) &&
-             !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
-            break;
 
         ret = -ESRCH;
         if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
             break;
 
-        ret = xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, add);
-        if ( ret ) {
-            rcu_unlock_domain(d);
-            break;
-        }
-
-        if ( add )
-        {
-            printk(XENLOG_G_INFO
-                   "memory_map:add: dom%d gfn=%lx mfn=%lx nr=%lx\n",
-                   d->domain_id, gfn, mfn, nr_mfns);
-
-            ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
-            if ( !ret && paging_mode_translate(d) )
-            {
-                for ( i = 0; !ret && i < nr_mfns; i++ )
-                    if ( !set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i)) )
-                        ret = -EIO;
-                if ( ret )
-                {
-                    printk(XENLOG_G_WARNING
-                           "memory_map:fail: dom%d gfn=%lx mfn=%lx\n",
-                           d->domain_id, gfn + i, mfn + i);
-                    while ( i-- )
-                        clear_mmio_p2m_entry(d, gfn + i);
-                    if ( iomem_deny_access(d, mfn, mfn + nr_mfns - 1) &&
-                         IS_PRIV(current->domain) )
-                        printk(XENLOG_ERR
-                               "memory_map: failed to deny dom%d access to [%lx,%lx]\n",
-                               d->domain_id, mfn, mfn + nr_mfns - 1);
-                }
-            }
-        }
-        else
-        {
-            printk(XENLOG_G_INFO
-                   "memory_map:remove: dom%d gfn=%lx mfn=%lx nr=%lx\n",
-                   d->domain_id, gfn, mfn, nr_mfns);
-
-            if ( paging_mode_translate(d) )
-                for ( i = 0; i < nr_mfns; i++ )
-                    add |= !clear_mmio_p2m_entry(d, gfn + i);
-            ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
-            if ( !ret && add )
-                ret = -EIO;
-            if ( ret && IS_PRIV(current->domain) )
-                printk(XENLOG_ERR
-                       "memory_map: error %ld %s dom%d access to [%lx,%lx]\n",
-                       ret, add ? "removing" : "denying", d->domain_id,
-                       mfn, mfn + nr_mfns - 1);
-        }
-
+        ret = domctl_memory_mapping(d, gfn, mfn, nr_mfns, add);
         rcu_unlock_domain(d);
     }
     break;
@@ -1646,17 +1655,21 @@ void arch_get_info_guest(struct vcpu *v,
             c.nat->gs_base_kernel = hvm_get_shadow_gs_base(v);
         }
     }
+    else if ( is_pvh_vcpu(v) )
+    {
+        printk("PVH: FIXME: arch_get_info_guest()\n");
+    }
     else
     {
         c(ldt_base = v->arch.pv_vcpu.ldt_base);
         c(ldt_ents = v->arch.pv_vcpu.ldt_ents);
         for ( i = 0; i < ARRAY_SIZE(v->arch.pv_vcpu.gdt_frames); ++i )
-            c(gdt_frames[i] = v->arch.pv_vcpu.gdt_frames[i]);
-        BUILD_BUG_ON(ARRAY_SIZE(c.nat->gdt_frames) !=
-                     ARRAY_SIZE(c.cmp->gdt_frames));
-        for ( ; i < ARRAY_SIZE(c.nat->gdt_frames); ++i )
-            c(gdt_frames[i] = 0);
-        c(gdt_ents = v->arch.pv_vcpu.gdt_ents);
+            c(u.pv.gdt_frames[i] = v->arch.pv_vcpu.gdt_frames[i]);
+        BUILD_BUG_ON(ARRAY_SIZE(c.nat->u.pv.gdt_frames) !=
+                     ARRAY_SIZE(c.cmp->u.pv.gdt_frames));
+        for ( ; i < ARRAY_SIZE(c.nat->u.pv.gdt_frames); ++i )
+            c(u.pv.gdt_frames[i] = 0);
+        c(u.pv.gdt_ents = v->arch.pv_vcpu.gdt_ents);
         c(kernel_ss = v->arch.pv_vcpu.kernel_ss);
         c(kernel_sp = v->arch.pv_vcpu.kernel_sp);
         for ( i = 0; i < ARRAY_SIZE(v->arch.pv_vcpu.ctrlreg); ++i )
diff -r 8b0762504037 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/hvm/hvm.c	Wed Nov 14 11:03:24 2012 -0800
@@ -331,6 +331,9 @@ void hvm_do_resume(struct vcpu *v)
 {
     ioreq_t *p;
 
+    if ( is_pvh_vcpu(v) )
+        return;
+
     pt_restore_timer(v);
 
     check_wakeup_from_wait();
@@ -499,6 +502,29 @@ static int hvm_print_line(
     return X86EMUL_OKAY;
 }
 
+static noinline int hvm_pvh_dom_initialise(struct domain *d)
+{
+    int rc;
+
+    if (!d->arch.hvm_domain.hap_enabled)
+        return -EINVAL;
+
+    spin_lock_init(&d->arch.hvm_domain.irq_lock);
+    hvm_init_guest_time(d);
+
+    hvm_init_cacheattr_region_list(d);
+
+    if ( (rc=paging_enable(d, PG_refcounts|PG_translate|PG_external)) != 0 )
+        goto fail1;
+
+    if ( (rc = hvm_funcs.domain_initialise(d)) == 0 )
+        return 0;
+
+fail1:
+    hvm_destroy_cacheattr_region_list(d);
+    return rc;
+}
+
 int hvm_domain_initialise(struct domain *d)
 {
     int rc;
@@ -509,6 +535,8 @@ int hvm_domain_initialise(struct domain 
                  "on a non-VT/AMDV platform.\n");
         return -EINVAL;
     }
+    if ( is_pvh_domain(d) )
+        return hvm_pvh_dom_initialise(d);
 
     spin_lock_init(&d->arch.hvm_domain.pbuf_lock);
     spin_lock_init(&d->arch.hvm_domain.irq_lock);
@@ -572,6 +600,11 @@ int hvm_domain_initialise(struct domain 
 
 void hvm_domain_relinquish_resources(struct domain *d)
 {
+    if ( is_pvh_domain(d) ) 
+    {
+        pit_deinit(d);
+        return;
+    }
     if ( hvm_funcs.nhvm_domain_relinquish_resources )
         hvm_funcs.nhvm_domain_relinquish_resources(d);
 
@@ -597,10 +630,16 @@ void hvm_domain_relinquish_resources(str
 void hvm_domain_destroy(struct domain *d)
 {
     hvm_funcs.domain_destroy(d);
+    hvm_destroy_cacheattr_region_list(d);
+
+    if ( is_pvh_domain(d) ) {
+        printk("PVH:skippoing stuff in hvm_domain_destroy(). reexamine me\n");
+        return;
+    }
+
     rtc_deinit(d);
     stdvga_deinit(d);
     vioapic_deinit(d);
-    hvm_destroy_cacheattr_region_list(d);
 }
 
 static int hvm_save_tsc_adjust(struct domain *d, hvm_domain_context_t *h)
@@ -1054,12 +1093,44 @@ static int __init __hvm_register_CPU_XSA
 }
 __initcall(__hvm_register_CPU_XSAVE_save_and_restore);
 
+static noinline int hvm_pvh_vcpu_initialise(struct vcpu *v)
+{
+    int rc;
+
+    if ( (rc = hvm_funcs.vcpu_initialise(v)) != 0 )
+        return rc;
+
+    softirq_tasklet_init( &v->arch.hvm_vcpu.assert_evtchn_irq_tasklet,
+                          (void(*)(unsigned long))hvm_assert_evtchn_irq,
+                          (unsigned long)v );
+
+    v->arch.hvm_vcpu.hv_pvh.pvh_vcpu_info_mfn = INVALID_MFN;
+    v->arch.user_regs.eflags = 2;
+    v->arch.hvm_vcpu.inject_trap.vector = -1;
+
+    if ( (rc=hvm_vcpu_cacheattr_init(v)) != 0 ) {
+        hvm_funcs.vcpu_destroy(v);
+        return rc;
+    }
+
+    /* during domain shutdown: pvh_vmx_vmexit_handler->emulate_privileged_op
+     * -> guest_io_read -> pv_pit_handler -> handle_speaker_io -> _spin_lock
+     *  so we call pit_init to initialize the spin lock */
+    if ( v->vcpu_id == 0 )
+        pit_init(v, cpu_khz);
+
+    return 0;
+}
+
 int hvm_vcpu_initialise(struct vcpu *v)
 {
     int rc;
 
     hvm_asid_flush_vcpu(v);
 
+    if ( is_pvh_vcpu(v) )
+        return hvm_pvh_vcpu_initialise(v);
+
     if ( (rc = vlapic_init(v)) != 0 )
         goto fail1;
 
@@ -1147,11 +1218,14 @@ void hvm_vcpu_destroy(struct vcpu *v)
 
     free_compat_arg_xlat(v);
 
+if ( is_pvh_vcpu(v) )
+    printk("PVH: fixme: ignoring tasklet kill in hvm_vcpu_destroy(). \n");
+else {
     tasklet_kill(&v->arch.hvm_vcpu.assert_evtchn_irq_tasklet);
     hvm_vcpu_cacheattr_destroy(v);
     vlapic_destroy(v);
+}
     hvm_funcs.vcpu_destroy(v);
-
     /* Event channel is already freed by evtchn_destroy(). */
     /*free_xen_event_channel(v, v->arch.hvm_vcpu.xen_port);*/
 }
diff -r 8b0762504037 xen/arch/x86/hvm/irq.c
--- a/xen/arch/x86/hvm/irq.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/hvm/irq.c	Wed Nov 14 11:03:24 2012 -0800
@@ -405,6 +405,9 @@ struct hvm_intack hvm_vcpu_has_pending_i
          && vcpu_info(v, evtchn_upcall_pending) )
         return hvm_intack_vector(plat->irq.callback_via.vector);
 
+    if ( is_pvh_vcpu(v) )
+        return hvm_intack_none;
+
     if ( vlapic_accept_pic_intr(v) && plat->vpic[0].int_output )
         return hvm_intack_pic(0);
 
diff -r 8b0762504037 xen/arch/x86/hvm/mtrr.c
--- a/xen/arch/x86/hvm/mtrr.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/hvm/mtrr.c	Wed Nov 14 11:03:24 2012 -0800
@@ -553,6 +553,10 @@ int32_t hvm_get_mem_pinned_cacheattr(
 
     *type = 0;
 
+    if ( is_pvh_domain(d) ) {
+        printk("PVH: fixme: hvm_get_mem_pinned_cacheattr(). \n");
+        return 0;
+    }
     if ( !is_hvm_domain(d) )
         return 0;
 
@@ -578,6 +582,11 @@ int32_t hvm_set_mem_pinned_cacheattr(
 {
     struct hvm_mem_pinned_cacheattr_range *range;
 
+    if ( is_pvh_domain(d) ) {
+        printk("PVH: fixme: hvm_set_mem_pinned_cacheattr()\n");
+        return 0;
+    }
+
     if ( !((type == PAT_TYPE_UNCACHABLE) ||
            (type == PAT_TYPE_WRCOMB) ||
            (type == PAT_TYPE_WRTHROUGH) ||
@@ -606,6 +615,12 @@ static int hvm_save_mtrr_msr(struct doma
     struct vcpu *v;
     struct hvm_hw_mtrr hw_mtrr;
     struct mtrr_state *mtrr_state;
+
+    if ( is_pvh_domain(d) ) {
+        printk("PVH: fixme: hvm_save_mtrr_msr()\n");
+        return 0;
+    }
+
     /* save mtrr&pat */
     for_each_vcpu(d, v)
     {
@@ -644,6 +659,10 @@ static int hvm_load_mtrr_msr(struct doma
     struct mtrr_state *mtrr_state;
     struct hvm_hw_mtrr hw_mtrr;
 
+    if ( is_pvh_domain(d) ) {
+        printk("PVH: fixme: hvm_load_mtrr_msr()\n");
+        return 0;
+    }
     vcpuid = hvm_load_instance(h);
     if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
     {
@@ -693,6 +712,14 @@ uint8_t epte_get_entry_emt(struct domain
          ((d->vcpu == NULL) || ((v = d->vcpu[0]) == NULL)) )
         return MTRR_TYPE_WRBACK;
 
+    /* PVH TBD: FIXME: this needs to be studied, figure what need to be done
+     * for PVH */
+    if ( is_pvh_domain(d) ) {
+        if (direct_mmio)
+            return MTRR_TYPE_UNCACHABLE;
+        return MTRR_TYPE_WRBACK;
+    }
+
     if ( !v->domain->arch.hvm_domain.params[HVM_PARAM_IDENT_PT] )
         return MTRR_TYPE_WRBACK;
 
diff -r 8b0762504037 xen/arch/x86/hvm/svm/vmcb.c
--- a/xen/arch/x86/hvm/svm/vmcb.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/hvm/svm/vmcb.c	Wed Nov 14 11:03:24 2012 -0800
@@ -326,7 +326,7 @@ void kdb_dump_vmcb(domid_t did, int vid)
 
     rcu_read_lock(&domlist_read_lock);
     for_each_domain (dp) {
-        if (!is_hvm_or_hyb_domain(dp) || dp->is_dying)
+        if (!is_hvm_or_pvh_domain(dp) || dp->is_dying)
             continue;
         if (did != 0 && did != dp->domain_id)
             continue;
diff -r 8b0762504037 xen/arch/x86/hvm/vmx/Makefile
--- a/xen/arch/x86/hvm/vmx/Makefile	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/hvm/vmx/Makefile	Wed Nov 14 11:03:24 2012 -0800
@@ -5,3 +5,4 @@ obj-y += vmcs.o
 obj-y += vmx.o
 obj-y += vpmu_core2.o
 obj-y += vvmx.o
+obj-y += vmx_pvh.o
diff -r 8b0762504037 xen/arch/x86/hvm/vmx/intr.c
--- a/xen/arch/x86/hvm/vmx/intr.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/hvm/vmx/intr.c	Wed Nov 14 11:03:24 2012 -0800
@@ -216,15 +216,16 @@ void vmx_intr_assist(void)
         return;
     }
 
-    /* Crank the handle on interrupt state. */
-    pt_vector = pt_update_irq(v);
+    if ( !is_pvh_vcpu(v) )
+        /* Crank the handle on interrupt state. */
+        pt_vector = pt_update_irq(v);
 
     do {
         intack = hvm_vcpu_has_pending_irq(v);
         if ( likely(intack.source == hvm_intsrc_none) )
             goto out;
 
-        if ( unlikely(nvmx_intr_intercept(v, intack)) )
+        if ( !is_pvh_vcpu(v) && unlikely(nvmx_intr_intercept(v, intack)) )
             goto out;
 
         intblk = hvm_interrupt_blocked(v, intack);
diff -r 8b0762504037 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Wed Nov 14 11:03:24 2012 -0800
@@ -606,7 +606,7 @@ void vmx_vmcs_exit(struct vcpu *v)
     {
         /* Don't confuse vmx_do_resume (for @v or @current!) */
         vmx_clear_vmcs(v);
-        if ( is_hvm_vcpu(current) )
+        if ( is_hvm_or_pvh_vcpu(current) )
             vmx_load_vmcs(current);
 
         spin_unlock(&v->arch.hvm_vmx.vmcs_lock);
@@ -697,6 +697,306 @@ void vmx_vmcs_switch(struct vmcs_struct 
     spin_unlock(&vmx->vmcs_lock);
 }
 
+static noinline int pvh_construct_vmcs(struct vcpu *v)
+{
+    struct domain *d = v->domain;
+    uint16_t sysenter_cs;
+    unsigned long sysenter_eip;
+    u32 vmexit_ctl = vmx_vmexit_control;
+    u32 vmentry_ctl = vmx_vmentry_control;
+    u64 u64val = -1;
+
+    vmx_vmcs_enter(v);
+
+    /* VMCS controls. */
+    vmx_pin_based_exec_control &= ~PIN_BASED_VIRTUAL_NMIS;
+    __vmwrite(PIN_BASED_VM_EXEC_CONTROL, vmx_pin_based_exec_control);
+
+    v->arch.hvm_vmx.exec_control = vmx_cpu_based_exec_control;
+
+    /* if ( v->domain->arch.vtsc ) */
+    v->arch.hvm_vmx.exec_control &= ~CPU_BASED_RDTSC_EXITING;
+v->arch.hvm_vmx.exec_control &= ~CPU_BASED_USE_TSC_OFFSETING;
+
+    if ( !paging_mode_hap(d) )
+    {
+        printk("ERROR: HAP is required to run PV in HVM container\n");
+        goto out;
+    }
+    v->arch.hvm_vmx.exec_control &= ~(CPU_BASED_INVLPG_EXITING |
+                                      CPU_BASED_CR3_LOAD_EXITING |
+                                      CPU_BASED_CR3_STORE_EXITING);
+    v->arch.hvm_vmx.exec_control |= CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
+    v->arch.hvm_vmx.exec_control &= ~CPU_BASED_MONITOR_TRAP_FLAG;
+#if 0
+    v->arch.hvm_vmx.exec_control &= ~CPU_BASED_ACTIVATE_IO_BITMAP; /* ??? */
+#endif
+    v->arch.hvm_vmx.exec_control |= CPU_BASED_ACTIVATE_MSR_BITMAP;
+    v->arch.hvm_vmx.exec_control &= ~CPU_BASED_TPR_SHADOW;
+    v->arch.hvm_vmx.exec_control &= ~CPU_BASED_VIRTUAL_NMI_PENDING;
+
+    kdbp("MUK: writing proc based exec controls:%x\n", 
+                 v->arch.hvm_vmx.exec_control);
+    __vmwrite(CPU_BASED_VM_EXEC_CONTROL, v->arch.hvm_vmx.exec_control);
+
+    /* I/O access bitmap. */
+    __vmwrite(IO_BITMAP_A, virt_to_maddr((char *)hvm_io_bitmap + 0));
+    __vmwrite(IO_BITMAP_B, virt_to_maddr((char *)hvm_io_bitmap + PAGE_SIZE));
+
+    /* MSR access bitmap. */
+    if ( cpu_has_vmx_msr_bitmap )
+    {
+        unsigned long *msr_bitmap = alloc_xenheap_page();
+        int msr_type = MSR_TYPE_R | MSR_TYPE_W;
+
+        if ( msr_bitmap == NULL )
+            goto out;
+
+        memset(msr_bitmap, ~0, PAGE_SIZE);
+        v->arch.hvm_vmx.msr_bitmap = msr_bitmap;
+        __vmwrite(MSR_BITMAP, virt_to_maddr(msr_bitmap));
+
+        vmx_disable_intercept_for_msr(v, MSR_FS_BASE, msr_type);
+        vmx_disable_intercept_for_msr(v, MSR_GS_BASE, msr_type);
+        vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS, msr_type);
+        vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP, msr_type);
+        vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP, msr_type);
+        vmx_disable_intercept_for_msr(v, MSR_SHADOW_GS_BASE, msr_type);
+
+        /* pure hvm doesn't do this. safe? see: long_mode_do_msr_write() */
+#if 0
+        vmx_disable_intercept_for_msr(v, MSR_STAR);
+        vmx_disable_intercept_for_msr(v, MSR_LSTAR);
+        vmx_disable_intercept_for_msr(v, MSR_CSTAR);
+        vmx_disable_intercept_for_msr(v, MSR_SYSCALL_MASK);
+#endif
+        kdbp("MUK: disabled intercepts for few msrs\n");
+
+    } else {
+        kdbp("MUK: CPU does NOT have msr bitmap\n");
+        for (;;) cpu_relax();
+    }
+
+    if ( !cpu_has_vmx_vpid ) {
+        printk("ERROR: VPID support is required to run PV in HVM container\n");
+        goto out;
+    }
+
+    v->arch.hvm_vmx.secondary_exec_control = vmx_secondary_exec_control;
+
+    if ( cpu_has_vmx_secondary_exec_control ) {
+        v->arch.hvm_vmx.secondary_exec_control &= ~0x4FF; /* turn off all */
+#if 0
+        v->arch.hvm_vmx.secondary_exec_control &= 
+                                       ~SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
+        v->arch.hvm_vmx.secondary_exec_control &= ~SECONDARY_EXEC_ENABLE_RDTSCP;
+
+        v->arch.hvm_vmx.secondary_exec_control &= 
+                                             ~SECONDARY_EXEC_UNRESTRICTED_GUEST;
+#endif
+        v->arch.hvm_vmx.secondary_exec_control |= 
+                                              SECONDARY_EXEC_PAUSE_LOOP_EXITING;
+        v->arch.hvm_vmx.secondary_exec_control |= SECONDARY_EXEC_ENABLE_VPID;
+
+        if ( paging_mode_hap(d) )
+            v->arch.hvm_vmx.secondary_exec_control |= SECONDARY_EXEC_ENABLE_EPT;
+
+        kdbp("MUK: muk_construct_vmcs: sec exec:0x%x\n",
+                                        v->arch.hvm_vmx.secondary_exec_control);
+        __vmwrite(SECONDARY_VM_EXEC_CONTROL,
+                  v->arch.hvm_vmx.secondary_exec_control);
+    } else {
+        printk("ERROR: NO Secondary Exec control\n");
+        goto out;
+    }
+
+    /* __vmwrite(VIRTUAL_PROCESSOR_ID, v->arch.hvm_vcpu.asid); */
+
+    if ( !paging_mode_hap(d) )
+        vmexit_ctl &= ~(VM_EXIT_SAVE_GUEST_PAT | VM_EXIT_LOAD_HOST_PAT);
+    __vmwrite(VM_EXIT_CONTROLS, vmexit_ctl);
+
+    #define VM_ENTRY_LOAD_DEBUG_CTLS 0x4
+    #define VM_ENTRY_LOAD_EFER 0x8000
+    #define GUEST_EFER 0x2806        /* see page 23-20 */
+    #define GUEST_EFER_HIGH 0x2807   /* see page 23-20 */
+    vmentry_ctl &= ~VM_ENTRY_LOAD_DEBUG_CTLS;
+    vmentry_ctl &= ~VM_ENTRY_LOAD_EFER;
+    vmentry_ctl &= ~VM_ENTRY_SMM;
+    vmentry_ctl &= ~VM_ENTRY_DEACT_DUAL_MONITOR;
+    vmentry_ctl |= VM_ENTRY_IA32E_MODE;
+    if ( !paging_mode_hap(d) )
+        vmentry_ctl &= ~VM_ENTRY_LOAD_GUEST_PAT;
+    kdbp("MUK:muk_construct_vmcs(). vmentry_ctl:0x%x\n", vmentry_ctl);
+    __vmwrite(VM_ENTRY_CONTROLS, vmentry_ctl);
+
+    /* MSR intercepts. */
+    __vmwrite(VM_ENTRY_MSR_LOAD_COUNT, 0);
+    __vmwrite(VM_EXIT_MSR_LOAD_COUNT, 0);
+    __vmwrite(VM_EXIT_MSR_STORE_COUNT, 0);
+
+    /* Host data selectors. */
+    __vmwrite(HOST_SS_SELECTOR, __HYPERVISOR_DS);
+    __vmwrite(HOST_DS_SELECTOR, __HYPERVISOR_DS);
+    __vmwrite(HOST_ES_SELECTOR, __HYPERVISOR_DS);
+    __vmwrite(HOST_FS_SELECTOR, 0);
+    __vmwrite(HOST_GS_SELECTOR, 0);
+    __vmwrite(HOST_FS_BASE, 0);
+    __vmwrite(HOST_GS_BASE, 0);
+
+    vmx_set_host_env(v);
+
+    /* Host control registers. */
+    v->arch.hvm_vmx.host_cr0 = read_cr0() | X86_CR0_TS;
+    __vmwrite(HOST_CR0, v->arch.hvm_vmx.host_cr0);
+    __vmwrite(HOST_CR4, mmu_cr4_features|(cpu_has_xsave ? X86_CR4_OSXSAVE : 0));
+
+    /* Host CS:RIP. */
+    __vmwrite(HOST_CS_SELECTOR, __HYPERVISOR_CS);
+    __vmwrite(HOST_RIP, (unsigned long)vmx_asm_vmexit_handler);
+
+    /* Host SYSENTER CS:RIP. */
+    rdmsrl(MSR_IA32_SYSENTER_CS, sysenter_cs);
+    __vmwrite(HOST_SYSENTER_CS, sysenter_cs);
+    rdmsrl(MSR_IA32_SYSENTER_EIP, sysenter_eip);
+    __vmwrite(HOST_SYSENTER_EIP, sysenter_eip);
+
+    __vmwrite(VM_ENTRY_INTR_INFO, 0);
+
+    __vmwrite(CR3_TARGET_COUNT, 0);
+
+    __vmwrite(GUEST_ACTIVITY_STATE, 0);
+
+    /* Set default guest context values here. Some of these are then overwritten
+     * in vmx_pvh_set_vcpu_info() by guest itself during vcpu bringup */
+    __vmwrite(GUEST_CS_BASE, 0);
+    __vmwrite(GUEST_CS_LIMIT, ~0u);
+    __vmwrite(GUEST_CS_AR_BYTES, 0xa09b); /* CS.L == 1 */
+    __vmwrite(GUEST_CS_SELECTOR, 0x10);
+
+    __vmwrite(GUEST_DS_BASE, 0);
+    __vmwrite(GUEST_DS_LIMIT, ~0u);
+    __vmwrite(GUEST_DS_AR_BYTES, 0xc093);
+    __vmwrite(GUEST_DS_SELECTOR, 0x18);
+
+    __vmwrite(GUEST_SS_BASE, 0);         /* use same seg as DS */
+    __vmwrite(GUEST_SS_LIMIT, ~0u);
+    __vmwrite(GUEST_SS_AR_BYTES, 0xc093);
+    __vmwrite(GUEST_SS_SELECTOR, 0x18);
+
+    __vmwrite(GUEST_ES_SELECTOR, 0);
+    __vmwrite(GUEST_FS_SELECTOR, 0);
+    __vmwrite(GUEST_GS_SELECTOR, 0);
+
+    /* Guest segment bases. */
+    __vmwrite(GUEST_ES_BASE, 0);
+    __vmwrite(GUEST_FS_BASE, 0);
+    __vmwrite(GUEST_GS_BASE, 0);
+
+    /* Guest segment limits. */
+    __vmwrite(GUEST_ES_LIMIT, ~0u);
+    __vmwrite(GUEST_FS_LIMIT, ~0u);
+    __vmwrite(GUEST_GS_LIMIT, ~0u);
+
+    /* Guest segment AR bytes. */
+    __vmwrite(GUEST_ES_AR_BYTES, 0xc093); /* read/write, accessed */
+    __vmwrite(GUEST_FS_AR_BYTES, 0xc093);
+    __vmwrite(GUEST_GS_AR_BYTES, 0xc093);
+
+    /* Guest IDT. */
+    __vmwrite(GUEST_GDTR_BASE, 0);
+    __vmwrite(GUEST_GDTR_LIMIT, 0);
+
+    /* Guest LDT. */
+    __vmwrite(GUEST_LDTR_AR_BYTES, 0x82); /* LDT */
+    __vmwrite(GUEST_LDTR_SELECTOR, 0);
+    __vmwrite(GUEST_LDTR_BASE, 0);
+    __vmwrite(GUEST_LDTR_LIMIT, 0);
+
+    /* Guest TSS. */
+    __vmwrite(GUEST_TR_AR_BYTES, 0x8b); /* 32-bit TSS (busy) */
+    __vmwrite(GUEST_TR_BASE, 0);
+    __vmwrite(GUEST_TR_LIMIT, 0xff);
+
+    __vmwrite(GUEST_INTERRUPTIBILITY_INFO, 0);
+    __vmwrite(GUEST_DR7, 0);
+    __vmwrite(VMCS_LINK_POINTER, ~0UL);
+
+    __vmwrite(PAGE_FAULT_ERROR_CODE_MASK, 0);
+    __vmwrite(PAGE_FAULT_ERROR_CODE_MATCH, 0);
+
+    v->arch.hvm_vmx.exception_bitmap = 
+                                   HVM_TRAP_MASK     | (1 << TRAP_debug) | 
+                                   (1U << TRAP_int3) | (1U << TRAP_no_device);
+    __vmwrite(EXCEPTION_BITMAP, v->arch.hvm_vmx.exception_bitmap);
+
+#if 0
+    __vmwrite(EXCEPTION_BITMAP,
+              HVM_TRAP_MASK | (1<<TRAP_debug) | (1<<TRAP_gp_fault) |
+              (1U<<TRAP_int3) | (1U << TRAP_page_fault)|(1U << TRAP_no_device));
+#endif
+    __vmwrite(TSC_OFFSET, 0);
+
+#if 0
+    v->arch.hvm_vcpu.guest_cr[0] = X86_CR0_PG | X86_CR0_PE | X86_CR0_ET;
+    hvm_update_guest_cr(v, 0);
+
+    v->arch.hvm_vcpu.guest_cr[4] = 0;
+    hvm_update_guest_cr(v, 4);
+#endif
+
+#if 0
+    u64val = X86_CR0_PG | X86_CR0_PE | X86_CR0_ET | X86_CR0_TS |
+             X86_CR0_NE | X86_CR0_WP;
+#endif
+    /* make sure to set WP bit so rdonly pages are not written from CPL 0 */
+    u64val = X86_CR0_PG | X86_CR0_NE | X86_CR0_PE | X86_CR0_WP;
+    __vmwrite(GUEST_CR0, u64val);
+    __vmwrite(CR0_READ_SHADOW, u64val);
+    v->arch.hvm_vcpu.hw_cr[0] = v->arch.hvm_vcpu.guest_cr[0] = u64val;
+
+    u64val = X86_CR4_PAE | X86_CR4_VMXE;
+    __vmwrite(GUEST_CR4, u64val);
+    __vmwrite(CR4_READ_SHADOW, u64val);
+    v->arch.hvm_vcpu.guest_cr[4] = u64val;
+
+    __vmwrite(CR0_GUEST_HOST_MASK, ~0UL);
+    __vmwrite(CR4_GUEST_HOST_MASK, ~0UL);
+
+     v->arch.hvm_vmx.vmx_realmode = 0;
+
+    if ( paging_mode_hap(d) )
+    {
+        __vmwrite(EPT_POINTER, d->arch.hvm_domain.vmx.ept_control.eptp);
+#ifdef __i386__
+        __vmwrite(EPT_POINTER_HIGH,
+                  d->arch.hvm_domain.vmx.ept_control.eptp >> 32);
+#endif
+    }
+
+    if ( cpu_has_vmx_pat && paging_mode_hap(d) )
+    {
+        u64 host_pat, guest_pat;
+
+        rdmsrl(MSR_IA32_CR_PAT, host_pat);
+        guest_pat = MSR_IA32_CR_PAT_RESET;
+
+        __vmwrite(HOST_PAT, host_pat);
+        __vmwrite(GUEST_PAT, guest_pat);
+#ifdef __i386__
+JUNK
+        __vmwrite(HOST_PAT_HIGH, host_pat >> 32);
+        __vmwrite(GUEST_PAT_HIGH, guest_pat >> 32);
+#endif
+    }
+out:
+    vmx_vmcs_exit(v);
+#if 0
+    paging_update_paging_modes(v); /* will update HOST & GUEST_CR3 as reqd */
+#endif
+    return 0;
+}
+
 static int construct_vmcs(struct vcpu *v)
 {
     struct domain *d = v->domain;
@@ -705,6 +1005,9 @@ static int construct_vmcs(struct vcpu *v
     u32 vmexit_ctl = vmx_vmexit_control;
     u32 vmentry_ctl = vmx_vmentry_control;
 
+    if ( is_pvh_vcpu(v) )
+        return pvh_construct_vmcs(v);
+
     vmx_vmcs_enter(v);
 
     /* VMCS controls. */
@@ -1143,9 +1446,11 @@ void vmx_do_resume(struct vcpu *v)
 
         vmx_clear_vmcs(v);
         vmx_load_vmcs(v);
-        hvm_migrate_timers(v);
-        hvm_migrate_pirqs(v);
-        vmx_set_host_env(v);
+        if ( !is_pvh_vcpu(v) ) {
+            hvm_migrate_timers(v);
+            hvm_migrate_pirqs(v);
+            vmx_set_host_env(v);
+        }
         /*
          * Both n1 VMCS and n2 VMCS need to update the host environment after 
          * VCPU migration. The environment of current VMCS is updated in place,
@@ -1163,6 +1468,9 @@ void vmx_do_resume(struct vcpu *v)
         __vmwrite(GUEST_DR7, 0);
 #endif
 
+    if ( is_pvh_vcpu(v) )
+        goto skip_inteLdbgr;   /* PVH supports gdbsx and gdb inside PVH */
+
     debug_state = v->domain->debugger_attached
                   || v->domain->arch.hvm_domain.params[HVM_PARAM_MEMORY_EVENT_INT3]
                   || v->domain->arch.hvm_domain.params[HVM_PARAM_MEMORY_EVENT_SINGLE_STEP];
@@ -1173,18 +1481,11 @@ void vmx_do_resume(struct vcpu *v)
         vmx_update_debug_state(v);
     }
 
+skip_inteLdbgr:
     hvm_do_resume(v);
     reset_stack_and_jump(vmx_asm_do_vmentry);
 }
 
-static unsigned long vmr(unsigned long field)
-{
-    int rc;
-    unsigned long val;
-    val = __vmread_safe(field, &rc);
-    return rc ? 0 : val;
-}
-
 static void vmx_dump_sel(char *name, uint32_t selector)
 {
     uint32_t sel, attr, limit;
@@ -1346,7 +1647,7 @@ static void vmcs_dump(unsigned char ch)
 
     for_each_domain ( d )
     {
-        if ( !is_hvm_domain(d) )
+        if ( !is_hvm_or_pvh_domain(d) )
             continue;
         printk("\n>>> Domain %d <<<\n", d->domain_id);
         for_each_vcpu ( d, v )
@@ -1531,7 +1832,7 @@ void kdb_curr_cpu_flush_vmcs(void)
     /* looks like we got one. unfortunately, current_vmcs points to vmcs 
      * and not VCPU, so we gotta search the entire list... */
     for_each_domain (dp) {
-        if ( !(is_hvm_or_hyb_domain(dp)) || dp->is_dying)
+        if ( !(is_hvm_or_pvh_domain(dp)) || dp->is_dying)
             continue;
         for_each_vcpu (dp, vp) {
             if ( vp->arch.hvm_vmx.vmcs == cvp ) {
@@ -1562,7 +1863,7 @@ void kdb_dump_vmcs(domid_t did, int vid)
     __vmptrst(&addr);
 
     for_each_domain (dp) {
-        if ( !(is_hvm_or_hyb_domain(dp)) || dp->is_dying)
+        if ( !(is_hvm_or_pvh_domain(dp)) || dp->is_dying)
             continue;
         if (did != 0 && did != dp->domain_id)
             continue;
diff -r 8b0762504037 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Wed Nov 14 11:03:24 2012 -0800
@@ -55,6 +55,7 @@
 #include <asm/debugger.h>
 #include <asm/apic.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/hvm/vmx/pvh.h>
 
 enum handler_return { HNDL_done, HNDL_unhandled, HNDL_exception_raised };
 
@@ -92,6 +93,9 @@ static int vmx_domain_initialise(struct 
     if ( !zalloc_cpumask_var(&d->arch.hvm_domain.vmx.ept_synced) )
         return -ENOMEM;
 
+    if ( is_pvh_domain(d) )
+        return 0;
+
     if ( (rc = vmx_alloc_vlapic_mapping(d)) != 0 )
     {
         free_cpumask_var(d->arch.hvm_domain.vmx.ept_synced);
@@ -129,6 +133,12 @@ static int vmx_vcpu_initialise(struct vc
 
     vpmu_initialise(v);
 
+    if (is_pvh_vcpu(v) ) 
+    {
+        /* this for hvm_long_mode_enabled(v) */
+        v->arch.hvm_vcpu.guest_efer = EFER_SCE | EFER_LMA | EFER_LME;
+        return 0;
+    }
     vmx_install_vlapic_mapping(v);
 
     /* %eax == 1 signals full real-mode support to the guest loader. */
@@ -366,6 +376,10 @@ static int vmx_guest_x86_mode(struct vcp
 {
     unsigned int cs_ar_bytes;
 
+/* PVH: fixme : look at vmcs.cs?? or just assume 8 ?? */
+if ( is_pvh_vcpu(v) )
+    return 8;
+
     if ( unlikely(!(v->arch.hvm_vcpu.guest_cr[0] & X86_CR0_PE)) )
         return 0;
     if ( unlikely(guest_cpu_user_regs()->eflags & X86_EFLAGS_VM) )
@@ -593,7 +607,7 @@ static int vmx_load_vmcs_ctxt(struct vcp
     return 0;
 }
 
-static void vmx_fpu_enter(struct vcpu *v)
+void vmx_fpu_enter(struct vcpu *v)
 {
     vcpu_restore_fpu_lazy(v);
     v->arch.hvm_vmx.exception_bitmap &= ~(1u << TRAP_no_device);
@@ -1051,6 +1065,25 @@ static void vmx_update_host_cr3(struct v
     vmx_vmcs_exit(v);
 }
 
+static noinline void vmx_update_pvh_cr(struct vcpu *v, unsigned int cr)
+{
+    vmx_vmcs_enter(v);
+    switch ( cr )
+    {
+        case 3:
+            __vmwrite(GUEST_CR3, v->arch.hvm_vcpu.guest_cr[3]);
+kdbp("pvh: d:%d update cr3:%lx\n", v->domain->domain_id, v->arch.hvm_vcpu.guest_cr[3]);
+            hvm_asid_flush_vcpu(v);
+            break;
+
+        default:
+            printk("pvh: d%d v%d unexpected cr%d rip:%lx update\n", 
+                   v->domain->domain_id, v->vcpu_id, cr, __vmread(GUEST_RIP));
+            kdb_trap_immed(KDB_TRAP_NONFATAL);
+    }
+    vmx_vmcs_exit(v);
+}
+
 void vmx_update_debug_state(struct vcpu *v)
 {
     unsigned long mask;
@@ -1070,6 +1103,11 @@ void vmx_update_debug_state(struct vcpu 
 
 static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
 {
+    if ( is_pvh_vcpu(v) ) {
+        vmx_update_pvh_cr(v, cr);
+        return;
+    }
+
     vmx_vmcs_enter(v);
 
     switch ( cr )
@@ -1267,7 +1305,7 @@ static int nvmx_vmexit_trap(struct vcpu 
     return NESTEDHVM_VMEXIT_DONE;
 }
 
-static void __vmx_inject_exception(int trap, int type, int error_code)
+static noinline void __vmx_inject_exception(int trap, int type, int error_code)
 {
     unsigned long intr_fields;
     struct vcpu *curr = current;
@@ -1511,7 +1549,10 @@ static struct hvm_function_table __read_
     .nhvm_intr_blocked    = nvmx_intr_blocked,
     .nhvm_domain_relinquish_resources = nvmx_domain_relinquish_resources,
     .update_eoi_exit_bitmap = vmx_update_eoi_exit_bitmap,
-    .virtual_intr_delivery_enabled = vmx_virtual_intr_delivery_enabled
+    .virtual_intr_delivery_enabled = vmx_virtual_intr_delivery_enabled,
+    .pvh_update_cr3       = vmx_pvh_update_cr3,
+    .pvh_set_vcpu_info    = vmx_pvh_set_vcpu_info,
+    .pvh_read_descriptor  = vmx_pvh_read_descriptor
 };
 
 struct hvm_function_table * __init start_vmx(void)
@@ -1543,19 +1584,7 @@ struct hvm_function_table * __init start
     return &vmx_function_table;
 }
 
-/*
- * Not all cases receive valid value in the VM-exit instruction length field.
- * Callers must know what they're doing!
- */
-static int get_instruction_length(void)
-{
-    int len;
-    len = __vmread(VM_EXIT_INSTRUCTION_LEN); /* Safe: callers audited */
-    BUG_ON((len < 1) || (len > 15));
-    return len;
-}
-
-static void update_guest_eip(void)
+void update_guest_eip(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     unsigned long x;
@@ -1633,8 +1662,8 @@ static void vmx_do_cpuid(struct cpu_user
     regs->edx = edx;
 }
 
-static void vmx_dr_access(unsigned long exit_qualification,
-                          struct cpu_user_regs *regs)
+void vmx_dr_access(unsigned long exit_qualification,
+                   struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
 
@@ -2009,7 +2038,7 @@ gp_fault:
     return X86EMUL_EXCEPTION;
 }
 
-static void vmx_do_extint(struct cpu_user_regs *regs)
+void vmx_do_extint(struct cpu_user_regs *regs)
 {
     unsigned int vector;
 
@@ -2260,6 +2289,14 @@ void vmx_vmexit_handler(struct cpu_user_
 
     perfc_incra(vmexits, exit_reason);
 
+    if ( is_pvh_vcpu(v) ) {
+        if ( unlikely(exit_reason & VMX_EXIT_REASONS_FAILED_VMENTRY) )
+            return vmx_failed_vmentry(exit_reason, regs);
+
+        pvh_vmx_vmexit_handler(regs);
+        return;
+    }
+
     /* Handle the interrupt we missed before allowing any more in. */
     switch ( (uint16_t)exit_reason )
     {
diff -r 8b0762504037 xen/arch/x86/hvm/vmx/vmx_pvh.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx_pvh.c	Wed Nov 14 11:03:24 2012 -0800
@@ -0,0 +1,1109 @@
+#include <xen/config.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/trace.h>
+#include <xen/sched.h>
+#include <xen/irq.h>
+#include <xen/softirq.h>
+#include <xen/domain_page.h>
+#include <xen/hypercall.h>
+#include <xen/guest_access.h>
+#include <xen/perfc.h>
+#include <asm/current.h>
+#include <asm/io.h>
+#include <asm/regs.h>
+#include <asm/cpufeature.h>
+#include <asm/processor.h>
+#include <asm/types.h>
+#include <asm/debugreg.h>
+#include <asm/msr.h>
+#include <asm/spinlock.h>
+#include <asm/paging.h>
+#include <asm/p2m.h>
+#include <asm/traps.h>
+#include <asm/mem_sharing.h>
+#include <asm/hvm/emulate.h>
+#include <asm/hvm/hvm.h>
+#include <asm/hvm/support.h>
+#include <asm/hvm/vmx/vmx.h>
+#include <asm/hvm/vmx/vmcs.h>
+#include <public/sched.h>
+#include <public/hvm/ioreq.h>
+#include <asm/hvm/vpic.h>
+#include <asm/hvm/vlapic.h>
+#include <asm/x86_emulate.h>
+#include <asm/hvm/vpt.h>
+#include <public/hvm/save.h>
+#include <asm/hvm/trace.h>
+#include <asm/xenoprof.h>
+#include <asm/debugger.h>
+
+#if 0
+enum handler_return { HNDL_done, HNDL_unhandled, HNDL_exception_raised };
+extern enum handler_return long_mode_do_msr_read(struct cpu_user_regs *);
+extern enum handler_return long_mode_do_msr_write(struct cpu_user_regs *);
+#endif
+
+volatile int mukprint=0, mukspin=1;
+#define dbgp0(...) dprintk(XENLOG_ERR, __VA_ARGS__);
+#define dbgp1(...) {(mukprint==1) ? kdbp(__VA_ARGS__):0;}
+#define dbgp2(...) {(mukprint==2) ? kdbp(__VA_ARGS__):0;}
+
+
+static void read_vmcs_selectors(struct cpu_user_regs *regs)
+{
+    regs->cs = vmr(GUEST_CS_SELECTOR);
+    regs->ss = vmr(GUEST_SS_SELECTOR);
+    regs->ds = vmr(GUEST_DS_SELECTOR);
+    regs->es = vmr(GUEST_ES_SELECTOR);
+    regs->gs = vmr(GUEST_GS_SELECTOR);
+    regs->fs = vmr(GUEST_FS_SELECTOR);
+}
+
+/* returns : 0 success */
+static noinline int vmxit_msr_read(struct cpu_user_regs *regs)
+{
+    int rc=1;
+
+    u64 msr_content = 0;
+    switch (regs->ecx)
+    {
+        case MSR_IA32_MISC_ENABLE:
+        {
+            rdmsrl(MSR_IA32_MISC_ENABLE, msr_content);
+            msr_content |= MSR_IA32_MISC_ENABLE_BTS_UNAVAIL |
+                           MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL;
+            break;
+        }
+        default:
+        {
+            rdmsrl(regs->ecx, msr_content);
+            break;
+        }
+    }
+    regs->eax = (uint32_t)msr_content;
+    regs->edx = (uint32_t)(msr_content >> 32);
+    update_guest_eip();
+    rc = 0;
+
+#if 0
+    rc = (long_mode_do_msr_read(regs) == HNDL_done) ? 0 : 1;
+
+    if ( hvm_msr_read_intercept(regs) == X86EMUL_OKAY ) {
+        update_guest_eip();
+        rc = 0;
+    }
+#endif
+
+    dbgp1("msr read c:%lx a:%lx d:%lx RIP:%lx RSP:%lx\n", regs->ecx, regs->eax, 
+          regs->edx, vmr(GUEST_RIP), vmr(GUEST_RSP));
+    return rc;
+}
+
+/* for now just scratch the cpu since nothing else will run on it. eventually
+ * we need to save and restore these MSRs 
+ * returns : 0 success */
+static noinline int vmxit_msr_write(struct cpu_user_regs *regs)
+{
+    uint64_t msr_content = (uint32_t)regs->eax | ((uint64_t)regs->edx << 32);
+    int rc=1;
+#if 0
+    wrmsr(regs->ecx, regs->eax, regs->edx);
+
+    rc = (long_mode_do_msr_write(regs) == HNDL_done) ? 0 : 1;
+    return rc;
+#endif
+
+    dbgp1("MUK: msr write:0x%lx. eax:0x%lx edx:0x%lx\n", regs->ecx, 
+          regs->eax,regs->edx);
+    if ( hvm_msr_write_intercept(regs->ecx, msr_content) == X86EMUL_OKAY ) {
+        update_guest_eip();
+        rc = 0;
+    }
+    return rc;
+}
+
+/* rc == 0: handled the MTF vmexit */
+static noinline int vmxit_mtf(struct cpu_user_regs *regs)
+{
+    struct vcpu *vp = current;
+    int rc=1, ss=vp->arch.hvm_vcpu.single_step; 
+
+    dbgp2("\n");
+    vp->arch.hvm_vmx.exec_control &= ~CPU_BASED_MONITOR_TRAP_FLAG;
+    __vmwrite(CPU_BASED_VM_EXEC_CONTROL, vp->arch.hvm_vmx.exec_control);
+    vp->arch.hvm_vcpu.single_step = 0;
+
+    /* kdb will set hvm_vcpu.single_step again if ss command */
+    if (kdb_handle_trap_entry(TRAP_debug, regs)) { /* TBD: ifdef KDB */
+        rc = 0;
+    } else if ( vp->domain->debugger_attached && ss ) {
+        domain_pause_for_debugger();
+        rc = 0;
+    }
+    return rc;
+}
+
+static noinline int vmxit_int3(struct cpu_user_regs *regs)
+{
+    struct vcpu *vp = current;
+
+    if ( vp->domain->debugger_attached ) {
+        update_guest_eip();
+
+        if (kdb_handle_trap_entry(TRAP_int3, regs))
+            return 0;
+        else 
+	    /* gdbsx or another debugger. Never pause dom0 */
+            if ( vp->domain->domain_id != 0 && guest_kernel_mode(vp, regs) )
+            {
+                kdbp("[%d]MUK: domain pause for debugger\n",smp_processor_id());
+                current->arch.gdbsx_vcpu_event = TRAP_int3;
+                domain_pause_for_debugger();
+            }
+
+    } else {  /* User mode exception. Inject into the guest */
+
+        /* int ilen = get_instruction_length(); */
+        struct hvm_trap trap_info = { 
+                        .vector = TRAP_int3, 
+                        .type = X86_EVENTTYPE_SW_EXCEPTION,
+                        .error_code = HVM_DELIVER_NO_ERROR_CODE, 
+                        .insn_len = get_instruction_length() 
+        };
+        hvm_inject_trap(&trap_info);
+    }
+    return 0;
+}
+
+volatile int mukprintpf;
+/* rc == 0: handled the exception or NMI */
+static noinline int vmxit_exception(struct cpu_user_regs *regs)
+{
+    unsigned int vector = (__vmread(VM_EXIT_INTR_INFO)) & INTR_INFO_VECTOR_MASK;
+    int rc=1; 
+    struct vcpu *vp = current;
+
+    dbgp2(" EXCPT: vec:%d cs:%x r.IP:%lx\n", vector, vmr(GUEST_CS_SELECTOR), 
+          regs->eip);
+
+    if (vector == TRAP_debug) {
+        unsigned long exit_qualification = __vmread(EXIT_QUALIFICATION);
+        write_debugreg(6, exit_qualification | 0xffff0ff0);
+        regs->rip = vmr(GUEST_RIP); 
+        regs->rsp = vmr(GUEST_RSP);
+        rc = 0;
+        if (kdb_handle_trap_entry(vector, regs)) /* TBD: ifdef KDB */
+            return 0;
+        else {
+	    /* gdbsx or another debugger */
+            if ( vp->domain->domain_id != 0 &&    /* never pause dom0 */
+                 guest_kernel_mode(vp, regs) &&  vp->domain->debugger_attached )
+            {
+                domain_pause_for_debugger();
+            } else {
+                hvm_inject_hw_exception(TRAP_debug, HVM_DELIVER_NO_ERROR_CODE);
+            }
+        }
+    } 
+    if (vector == TRAP_int3) {
+        rc = vmxit_int3(regs);
+    } 
+
+    if (vector == TRAP_invalid_op) {
+#if 0
+kdbp("MUK: invalid op. injection exception. rip:%lx\n", (ulong)vmr(GUEST_RIP));
+kdb_trap_immed(KDB_TRAP_NONFATAL);
+        hvm_inject_hw_exception(TRAP_invalid_op, HVM_DELIVER_NO_ERROR_CODE);
+        rc = 0;
+#endif
+        if ( guest_kernel_mode(vp, regs) || emulate_forced_invalid_op(regs)==0 )
+        {
+            hvm_inject_hw_exception(TRAP_invalid_op, HVM_DELIVER_NO_ERROR_CODE);
+            rc = 0;
+        }
+
+    }
+    if (vector == TRAP_no_device) {
+        hvm_funcs.fpu_dirty_intercept();  /* calls vmx_fpu_dirty_intercept */
+        rc = 0;
+    }
+
+    if (vector == TRAP_gp_fault) {
+        regs->error_code = __vmread(VM_EXIT_INTR_ERROR_CODE);
+        kdbp("MUK: inject GP: errcode:0x%04x RIP:%016lx RSP:%016lx\n", 
+             regs->error_code, (ulong)vmr(GUEST_RIP), 
+             (ulong)vmr(GUEST_RSP));
+
+        kdb_trap_immed(KDB_TRAP_NONFATAL);
+        /* hvm_inject_hw_exception(TRAP_gp_fault, regs->error_code); */
+        rc = 1;
+    }
+
+    if (vector == TRAP_page_fault) {
+        kdbp("Unexpected vector page_fault\n");
+        kdb_trap_immed(KDB_TRAP_NONFATAL);
+#if 0
+        extern int fixup_page_fault(unsigned long , struct cpu_user_regs *);
+        ulong eflags_sav = regs->eflags;
+        unsigned long va = __vmread(EXIT_QUALIFICATION);
+
+        regs->error_code = __vmread(VM_EXIT_INTR_ERROR_CODE);
+
+        if (mukprintpf)
+            kdbp("MUK:PF va:%016lx errcode:0x%04x RIP:%016lx RSP:%016lx", 
+                 va, regs->error_code, (ulong)vmr(GUEST_RIP), 
+                 (ulong)vmr(GUEST_RSP));
+
+        regs->eflags |= X86_EFLAGS_IF;
+        if (fixup_page_fault(va, regs) == 0) {
+            if (mukprintpf)
+                kdbp(" NOT ");
+            current->arch.hvm_vcpu.guest_cr[2] = va;
+            hvm_inject_hw_exception(TRAP_page_fault, regs->error_code);
+        }
+        regs->eflags = eflags_sav;
+        if (mukprintpf)
+            kdbp(" fixedup\n");
+        rc = 0;
+#endif
+    }
+
+    /* TBD: call do_guest_trap() here */
+    if (rc)
+        kdbp("MUK: Unhandled trap vector:%d\n", vector);
+    return rc;
+}
+
+static noinline int vmxit_invlpg(void)
+{
+    ulong vaddr = __vmread(EXIT_QUALIFICATION);
+
+    update_guest_eip();
+    vpid_sync_vcpu_gva(current, vaddr);
+    return 0;
+}
+
+#if 0
+static noinline void native_cpuid(struct cpu_user_regs *regs);
+{
+    uint32_t a, b, c, d;
+
+    a = regs->eax;
+    b = regs->ebx;
+    c = regs->ecx;
+    d = regs->edx;
+
+    asm ( "cpuid"
+          : "=a" (a), "=b" (b), "=c" (c), "=d" (d)
+          : "0" (a), "1" (b), "2" (c), "3" (d) );
+
+    regs->eax = a;
+    regs->ebx = b;
+    regs->ecx = c;
+    regs->edx = d;
+}
+#endif
+
+static noinline int pvh_grant_table_op(
+              unsigned int cmd, XEN_GUEST_HANDLE(void) uop, unsigned int count)
+{
+    switch (cmd)
+    {
+        case GNTTABOP_map_grant_ref:
+        case GNTTABOP_unmap_grant_ref:
+        case GNTTABOP_setup_table:
+        case GNTTABOP_copy:
+        case GNTTABOP_query_size:
+        case GNTTABOP_set_version:
+            return do_grant_table_op(cmd, uop, count);
+    }
+kdbp("MUK: hcall: pvh_grant_table_op: unhandled grant op:%d\n", cmd);
+kdb_trap_immed(KDB_TRAP_NONFATAL);
+    return -ENOSYS;
+}
+
+static long pvh_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
+{
+    long rc = -ENOSYS;
+
+    switch ( cmd )
+    {
+        case VCPUOP_register_runstate_memory_area:
+        case VCPUOP_get_runstate_info:
+        case VCPUOP_set_periodic_timer:
+        case VCPUOP_stop_periodic_timer:
+        case VCPUOP_set_singleshot_timer:
+        case VCPUOP_stop_singleshot_timer:
+        case VCPUOP_is_up:
+        case VCPUOP_up:
+        case VCPUOP_initialise:
+            rc = do_vcpu_op(cmd, vcpuid, arg);
+
+            /* pvh boot vcpu setting context for bringing up smp vcpu */
+            if (cmd == VCPUOP_initialise)
+                vmx_vmcs_enter(current);
+    }
+    return rc;
+}
+
+static long pvh_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+{
+    switch ( cmd )
+    {
+        case PHYSDEVOP_map_pirq:
+        case PHYSDEVOP_unmap_pirq:
+        case PHYSDEVOP_eoi:
+        case PHYSDEVOP_irq_status_query:
+        case PHYSDEVOP_get_free_pirq:
+#if 0
+        case PHYSDEVOP_set_iopl:
+#endif
+            return do_physdev_op(cmd, arg);
+
+        default:
+            if ( IS_PRIV(current->domain) )
+                return do_physdev_op(cmd, arg);
+    }
+    return -ENOSYS;
+}
+
+static noinline long do_pvh_hvm_op(unsigned long op, XEN_GUEST_HANDLE(void) arg)
+{
+    long rc = -EINVAL;
+    struct xen_hvm_param harg;
+    struct domain *d;
+
+    if ( copy_from_guest(&harg, arg, 1) )
+        return -EFAULT;
+
+    rc = rcu_lock_target_domain_by_id(harg.domid, &d);
+    if ( rc != 0 )
+        return rc;
+
+    if (is_hvm_domain(d)) {
+        /* pvh dom0 is building an hvm guest */
+        rcu_unlock_domain(d);
+	return do_hvm_op(op, arg);  
+    }
+
+    rc = -ENOSYS;
+    if (op == HVMOP_set_param) {
+        if (harg.index == HVM_PARAM_CALLBACK_IRQ) {
+            struct hvm_irq *hvm_irq = &d->arch.hvm_domain.irq;
+            uint64_t via = harg.value;
+            uint8_t via_type = (uint8_t)(via >> 56) + 1;
+
+            if (via_type == HVMIRQ_callback_vector) {
+                hvm_irq->callback_via_type = HVMIRQ_callback_vector;
+                hvm_irq->callback_via.vector = (uint8_t)via;
+                rc = 0;
+            }
+        }
+    }
+    return rc;
+}
+
+typedef unsigned long pvh_hypercall_t(
+    unsigned long, unsigned long, unsigned long, unsigned long, unsigned long,
+    unsigned long);
+
+int hcall_a[NR_hypercalls];
+
+static pvh_hypercall_t *pvh_hypercall64_table[NR_hypercalls] = {
+    [__HYPERVISOR_platform_op]     = (pvh_hypercall_t *)do_platform_op,
+    [__HYPERVISOR_memory_op]       = (pvh_hypercall_t *)do_memory_op,
+    /* [__HYPERVISOR_set_timer_op]     = (pvh_hypercall_t *)do_set_timer_op, */
+    [__HYPERVISOR_xen_version]     = (pvh_hypercall_t *)do_xen_version,
+    [__HYPERVISOR_console_io]      = (pvh_hypercall_t *)do_console_io,
+    [__HYPERVISOR_grant_table_op]  = (pvh_hypercall_t *)pvh_grant_table_op,
+    [__HYPERVISOR_vcpu_op]         = (pvh_hypercall_t *)pvh_vcpu_op,
+    [__HYPERVISOR_mmuext_op]       = (pvh_hypercall_t *)do_mmuext_op,
+    [__HYPERVISOR_xsm_op]          = (pvh_hypercall_t *)do_xsm_op,
+    [__HYPERVISOR_sched_op]        = (pvh_hypercall_t *)do_sched_op,
+    [__HYPERVISOR_event_channel_op]= (pvh_hypercall_t *)do_event_channel_op,
+    [__HYPERVISOR_physdev_op]      = (pvh_hypercall_t *)pvh_physdev_op,
+    [__HYPERVISOR_hvm_op]          = (pvh_hypercall_t *)do_pvh_hvm_op,
+    [__HYPERVISOR_sysctl]          = (pvh_hypercall_t *)do_sysctl,
+    [__HYPERVISOR_domctl]          = (pvh_hypercall_t *)do_domctl
+};
+
+/* TBD: Do we need to worry about this and slow things down in this path? */
+static int pvh_long_mode_enabled(void)
+{
+    return 1;
+}
+
+/* Check if hypercall is valid 
+ * Returns: 0 if hcall is not valid with eax set to the errno to ret to guest
+ */
+static noinline int hcall_valid(struct cpu_user_regs *regs)
+{
+    struct segment_register sreg;
+
+    if (!pvh_long_mode_enabled()) {
+        printk("PVH Error: Expected long mode set\n");
+        return 1;
+    }
+    hvm_get_segment_register(current, x86_seg_ss, &sreg);
+    if ( unlikely(sreg.attr.fields.dpl == 3) ) {
+        regs->eax = -EPERM;
+        return 0;
+    }
+
+    /* domU's are not allowed following hcalls */
+    if ( !IS_PRIV(current->domain) &&
+         (regs->eax == __HYPERVISOR_xsm_op ||
+          regs->eax == __HYPERVISOR_platform_op ||
+#if 0
+          regs->eax == __HYPERVISOR_mmuext_op ||    /* for privcmd mmap */
+#endif
+          regs->eax == __HYPERVISOR_domctl) ) {     /* for privcmd mmap */
+
+        regs->eax = -EPERM;
+        return 0;
+    }
+    return 1;
+}
+volatile int mukdbg178=1;
+static noinline int vmxit_vmcall(struct cpu_user_regs *regs)
+{
+    uint32_t hnum = regs->eax;
+
+    if (hnum >= NR_hypercalls || pvh_hypercall64_table[hnum] ==NULL) 
+    {
+        kdbp("MUK: UnImplemented HCALL:%d. ret -ENOSYS to guest\n", regs->eax);
+if (mukdbg178)
+    kdb_trap_immed(KDB_TRAP_NONFATAL);
+        regs->eax = -ENOSYS;
+        update_guest_eip();
+        return HVM_HCALL_completed;
+    }
+
+    dbgp2("vmxit_vmcall: hcall eax:$%ld\n", regs->eax);
+    if (regs->eax == __HYPERVISOR_sched_op && regs->rdi == SCHEDOP_shutdown) {
+        kdbp("MUK: FIXME: SCHEDOP_shutdown hcall\n");
+        regs->eax = -ENOSYS;
+        update_guest_eip();
+        domain_crash_synchronous();
+        return HVM_HCALL_completed;
+    }
+
+    if ( !hcall_valid(regs) ) {
+kdbp("!hcall_valid(). hcall:%d\n", hnum);
+if (mukdbg178)
+    kdb_trap_immed(KDB_TRAP_NONFATAL);
+        return HVM_HCALL_completed;
+    }
+
+
+hcall_a[hnum]++;
+current->arch.hvm_vcpu.hcall_preempted = 0; /* TBD */
+/* search for this and do it. PV method will not work */
+
+    regs->rax = pvh_hypercall64_table[hnum](regs->rdi, regs->rsi, regs->rdx,
+                                            regs->r10, regs->r8, regs->r9);
+
+    if ( !current->arch.hvm_vcpu.hcall_preempted )
+        update_guest_eip();
+    else
+        kdbp("Hcall :%d preempted\n", hnum);
+         
+
+    return HVM_HCALL_completed;
+}
+
+static noinline uint64_t *get_gpr_ptr(struct cpu_user_regs *regs, uint gpr)
+{
+    switch (gpr)
+    {
+        case VMX_CONTROL_REG_ACCESS_GPR_EAX:
+            return &regs->eax;
+        case VMX_CONTROL_REG_ACCESS_GPR_ECX:
+            return &regs->ecx;
+        case VMX_CONTROL_REG_ACCESS_GPR_EDX:
+            return &regs->edx;
+        case VMX_CONTROL_REG_ACCESS_GPR_EBX:
+            return &regs->ebx;
+        case VMX_CONTROL_REG_ACCESS_GPR_ESP:
+            return &regs->esp;
+        case VMX_CONTROL_REG_ACCESS_GPR_EBP:
+            return &regs->ebp;
+        case VMX_CONTROL_REG_ACCESS_GPR_ESI:
+            return &regs->esi;
+        case VMX_CONTROL_REG_ACCESS_GPR_EDI:
+            return &regs->edi;
+        case VMX_CONTROL_REG_ACCESS_GPR_R8:
+            return &regs->r8;
+        case VMX_CONTROL_REG_ACCESS_GPR_R9:
+            return &regs->r9;
+        case VMX_CONTROL_REG_ACCESS_GPR_R10:
+            return &regs->r10;
+        case VMX_CONTROL_REG_ACCESS_GPR_R11:
+            return &regs->r11;
+        case VMX_CONTROL_REG_ACCESS_GPR_R12:
+            return &regs->r12;
+        case VMX_CONTROL_REG_ACCESS_GPR_R13:
+            return &regs->r13;
+        case VMX_CONTROL_REG_ACCESS_GPR_R14:
+            return &regs->r14;
+        case VMX_CONTROL_REG_ACCESS_GPR_R15:
+            return &regs->r15;
+        default:
+            return NULL;
+    }
+}
+/* rc == 0: success */
+static noinline int access_cr0(struct cpu_user_regs *regs, uint acc_typ, 
+                               uint64_t *regp)
+{
+    struct vcpu *vp = current;
+
+    if (acc_typ == VMX_CONTROL_REG_ACCESS_TYPE_MOV_TO_CR )
+    {
+        unsigned long new_cr0 = *regp;
+        unsigned long old_cr0 = __vmread(GUEST_CR0);
+
+        dbgp2("MUK:writing to CR0. RIP:%lx val:0x%lx\n", vmr(GUEST_RIP),*regp);
+        if ( (u32)new_cr0 != new_cr0 )
+        {
+            HVM_DBG_LOG(DBG_LEVEL_1, 
+                        "Guest setting upper 32 bits in CR0: %lx", new_cr0);
+            return 1;
+        }
+
+        new_cr0 &= ~HVM_CR0_GUEST_RESERVED_BITS;
+        /* ET is reserved and should be always be 1. */
+        new_cr0 |= X86_CR0_ET;
+
+        /* pvh cannot change to real mode */
+        if ( (new_cr0 & (X86_CR0_PE|X86_CR0_PG)) != (X86_CR0_PG|X86_CR0_PE) ) {
+            kdbp("Guest attempting to turn off PE/PG. CR0:%lx\n", new_cr0);
+            return 1;
+        }
+        /* TS going from 1 to 0 */
+        if ( (old_cr0 & X86_CR0_TS) && ((new_cr0 & X86_CR0_TS)==0) )
+            vmx_fpu_enter(vp);
+
+        vp->arch.hvm_vcpu.hw_cr[0] = vp->arch.hvm_vcpu.guest_cr[0] = new_cr0;
+        __vmwrite(GUEST_CR0, new_cr0);
+        __vmwrite(CR0_READ_SHADOW, new_cr0);
+    } else {
+        *regp = __vmread(GUEST_CR0);
+    } 
+    return 0;
+}
+
+#if 0
+volatile int mukdbgcr3;
+/* rc == 0: success */
+static noinline int access_cr3(struct cpu_user_regs *regs, uint acc_typ, 
+                               uint64_t *regp)
+{
+    if (acc_typ == VMX_CONTROL_REG_ACCESS_TYPE_MOV_TO_CR ) {
+        unsigned long new_cr3 = *regp;
+
+        __vmwrite(GUEST_CR3, new_cr3);
+        vpid_sync_all();
+        if (mukdbgcr3)
+            kdbp("MUK: mov to cr3:%016lx cs:%lx RIP:%016lx\n", new_cr3,regs->cs,
+                 vmr(GUEST_RIP));
+    } else {
+        *regp = __vmread(GUEST_CR3);
+    }
+
+    return 0;
+}
+#endif
+
+/* rc == 0: success */
+static noinline int access_cr4(struct cpu_user_regs *regs, uint acc_typ, 
+                               uint64_t *regp)
+{
+    if (acc_typ == VMX_CONTROL_REG_ACCESS_TYPE_MOV_TO_CR )
+    {
+        u64 old_cr4 = __vmread(GUEST_CR4);
+        /* kdbp("MUK:writing to CR4. val:0x%lx\n", *regp); */
+
+        if ( (old_cr4 ^ (*regp)) & (X86_CR4_PSE | X86_CR4_PGE | X86_CR4_PAE) )
+            vpid_sync_all();
+
+        /* pvh_verify_cr4_wr(*regp)); */
+        __vmwrite(GUEST_CR4, *regp);
+    } else {
+        *regp = __vmread(GUEST_CR4);
+        kdbp("MUK: read cr4. val:0x%lx\n", *regp);
+    } 
+    return 0;
+}
+
+/* rc == 0: success */
+static noinline int vmxit_cr_access(struct cpu_user_regs *regs)
+{
+    unsigned long exit_qualification = __vmread(EXIT_QUALIFICATION);
+    uint acc_typ = VMX_CONTROL_REG_ACCESS_TYPE(exit_qualification);
+    int cr, rc = 1;
+
+    switch ( acc_typ )
+    {
+        case VMX_CONTROL_REG_ACCESS_TYPE_MOV_TO_CR:
+        case VMX_CONTROL_REG_ACCESS_TYPE_MOV_FROM_CR:
+        {
+            uint gpr = VMX_CONTROL_REG_ACCESS_GPR(exit_qualification);
+            uint64_t *regp = get_gpr_ptr(regs, gpr);
+            cr = VMX_CONTROL_REG_ACCESS_NUM(exit_qualification);
+
+            if (regp == NULL)
+                break;
+
+            /* pl don't embed switch statements */
+            if (cr == 0)
+                rc = access_cr0(regs, acc_typ, regp);
+            else if (cr == 3) {
+                printk("PVH: d%d: unexpected cr3 access vmexit. rip:%lx\n", 
+		       current->domain->domain_id, vmr(GUEST_RIP));
+                domain_crash_synchronous();
+            } else if (cr == 4) 
+                rc = access_cr4(regs, acc_typ, regp);
+
+            if (rc == 0)
+                update_guest_eip();
+            break;
+        }
+        case VMX_CONTROL_REG_ACCESS_TYPE_CLTS:
+        {
+#if 0
+            unsigned long cr0 = __vmread(GUEST_CR0);
+            cr0 &= ~X86_CR0_TS;
+#endif
+            struct vcpu *vp = current;
+            unsigned long cr0 = vp->arch.hvm_vcpu.guest_cr[0] & ~X86_CR0_TS;
+            vp->arch.hvm_vcpu.hw_cr[0] = vp->arch.hvm_vcpu.guest_cr[0] = cr0;
+            vmx_fpu_enter(vp);
+            __vmwrite(GUEST_CR0, cr0);
+            __vmwrite(CR0_READ_SHADOW, cr0);
+            update_guest_eip();
+            rc = 0;
+        }
+    }
+    return rc;
+}
+
+static int noinline vmxit_io_instr(struct cpu_user_regs *regs)
+{
+    int curr_lvl;
+    int requested = (regs->rflags >> 12) & 3;
+
+    read_vmcs_selectors(regs);
+    curr_lvl = regs->cs & 3;
+
+    if (requested >= curr_lvl && emulate_privileged_op(regs)) 
+        return 0;
+
+    kdbp("MUK: io instr about to inject gpf. req:%x curr:%x\n", requested, 
+         curr_lvl);
+    kdb_trap_immed(KDB_TRAP_NONFATAL);
+    hvm_inject_hw_exception(TRAP_gp_fault, regs->error_code);
+
+    return 0;
+}
+
+static noinline int pvh_ept_handle_violation(unsigned long qualification, paddr_t gpa)
+{
+    unsigned long gla, gfn = gpa >> PAGE_SHIFT;
+    p2m_type_t p2mt;
+    mfn_t mfn = get_gfn_query_unlocked(current->domain, gfn, &p2mt);
+
+    gdprintk(XENLOG_ERR, "Dom:%d EPT violation %#lx (%c%c%c/%c%c%c), "
+             "gpa %#"PRIpaddr", mfn %#lx, type %i.\n",
+             current->domain->domain_id, qualification, 
+             (qualification & EPT_READ_VIOLATION) ? 'r' : '-',
+             (qualification & EPT_WRITE_VIOLATION) ? 'w' : '-',
+             (qualification & EPT_EXEC_VIOLATION) ? 'x' : '-',
+             (qualification & EPT_EFFECTIVE_READ) ? 'r' : '-',
+             (qualification & EPT_EFFECTIVE_WRITE) ? 'w' : '-',
+             (qualification & EPT_EFFECTIVE_EXEC) ? 'x' : '-',
+             gpa, mfn_x(mfn), p2mt);
+             
+    ept_walk_table(current->domain, gfn);
+
+    if ( qualification & EPT_GLA_VALID )
+    {
+        gla = __vmread(GUEST_LINEAR_ADDRESS);
+        gdprintk(XENLOG_ERR, " --- GLA %#lx\n", gla);
+    }
+#if 0
+    if (vmr(GUEST_CS_SELECTOR) & 3 == 3) {
+	kdbp("EPT Violation in user mode. inject GP\n");
+        hvm_inject_hw_exception(TRAP_gp_fault, regs->error_code);
+    } else
+#endif
+        hvm_inject_hw_exception(TRAP_gp_fault, 0);
+        kdb_trap_immed(KDB_TRAP_NONFATAL);
+
+    return 0;
+}
+
+#if 0
+/* emulate write_cr3(read_cr3()) in guest. */
+static noinline int vmxit_invvpid(void)
+{
+    hvm_asid_flush_vcpu(current);
+    return 0;
+}
+#endif
+volatile int mukcpuiddbg=0;
+static noinline void pvh_cpuid(struct cpu_user_regs *regs)
+{
+    unsigned int eax, ebx, ecx, edx;
+
+    if (mukcpuiddbg)
+        kdbp("ucpuid: rax:%lx bx:%lx cx:%lx dx:%lx\n", regs->rax, regs->rbx,
+             regs->rcx, regs->rdx);
+
+    asm volatile ( "cpuid"
+              : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
+              : "0" (regs->eax), "2" (regs->rcx) );
+
+    regs->rax = eax; regs->rbx = ebx; regs->rcx = ecx; regs->rdx = edx;
+    if (mukcpuiddbg)
+        kdbp("done: rax:%lx bx:%lx cx:%lx dx:%lx\n", regs->rax, regs->rbx,
+             regs->rcx, regs->rdx);
+}
+
+volatile int mukprdr7, mukprtsc=1, mukcrashit;
+void pvh_vmx_vmexit_handler(struct cpu_user_regs *regs)
+{
+    unsigned long exit_qualification;
+    unsigned int vector, exit_reason = __vmread(VM_EXIT_REASON);
+    int rc=0, ccpu = smp_processor_id();
+    struct vcpu *vp = current;
+
+#if defined(XEN_KDB_CONFIG)
+{
+    if (kdb_dr7)
+        write_debugreg(7, kdb_dr7);
+}
+#endif
+    if (mukprdr7) 
+        kdbp("MUK: vmexit dr0:%lx 7:%lx vmcs.7:%lx\n", read_debugreg(0),
+              read_debugreg(7), __vmread(GUEST_DR7));
+
+    dbgp1("MUK:[%d]left VMCS exitreas:%d RIP:%lx RSP:%lx EFLAGS:%lx CR0:%lx\n", 
+          ccpu, exit_reason, vmr(GUEST_RIP), vmr(GUEST_RSP), regs->rflags, 
+          vmr(GUEST_CR0));
+
+    /* for guest_kernel_mode in fixup_page_fault() */
+    regs->cs = vmr(GUEST_CS_SELECTOR); 
+
+    switch ( (uint16_t)exit_reason )
+    {
+        case EXIT_REASON_EXCEPTION_NMI:
+        case EXIT_REASON_EXTERNAL_INTERRUPT:
+        case EXIT_REASON_MCE_DURING_VMENTRY:
+            break;
+        default:
+            local_irq_enable();
+    }
+
+    switch ( (uint16_t)exit_reason )
+    {
+        case EXIT_REASON_EXCEPTION_NMI:      /* 0 */
+            rc = vmxit_exception(regs);
+            break;
+            
+        case EXIT_REASON_EXTERNAL_INTERRUPT: /* 1 */
+        {
+            vector = __vmread(VM_EXIT_INTR_INFO);
+            vector &= INTR_INFO_VECTOR_MASK;
+#if 0
+            dbgp2("MUK: [%d] exit vmcs reas:%d vec:%d cr0:0x%016lx\n", ccpu, 
+                 exit_reason, vector, vmr(GUEST_CR0));
+#endif
+            vmx_do_extint(regs);
+            break;
+        }
+
+        case EXIT_REASON_TRIPLE_FAULT:  /* 2 */
+        {
+#if 0
+            static int once;
+     if (!once)
+     kdbp("MUK:[%d]left VMCS exitreas:%d RIP:%lx RSP:%lx EFLAGS:%lx CR0:%lx\n",
+          ccpu, exit_reason, vmr(GUEST_RIP), vmr(GUEST_RSP), regs->rflags, 
+          vmr(GUEST_CR0));
+            once = 1;
+            hvm_inject_hw_exception(TRAP_gp_fault, regs->error_code);
+            rc = 0;
+#endif
+     kdbp("MUK:Triple Flt:[%d]exitreas:%d RIP:%lx RSP:%lx EFLAGS:%lx CR3:%lx\n",
+          ccpu, exit_reason, vmr(GUEST_RIP), vmr(GUEST_RSP), regs->rflags, 
+          vmr(GUEST_CR3));
+
+    if ( paging_mode_hap(vp->domain) && hvm_paging_enabled(vp) )
+        vp->arch.hvm_vcpu.guest_cr[3] = vp->arch.hvm_vcpu.hw_cr[3] =
+                                                           __vmread(GUEST_CR3);
+            kdb_trap_immed(KDB_TRAP_NONFATAL);
+            rc = 1;
+            break;
+        }
+        case EXIT_REASON_PENDING_VIRT_INTR:  /* 7 */
+        {
+            struct vcpu *v = current;
+            /* Disable the interrupt window. */
+            v->arch.hvm_vmx.exec_control &= ~CPU_BASED_VIRTUAL_INTR_PENDING;
+            __vmwrite(CPU_BASED_VM_EXEC_CONTROL, v->arch.hvm_vmx.exec_control);
+            break;
+        }
+
+        case EXIT_REASON_CPUID:              /* 10 */
+        {
+            if ( guest_kernel_mode(vp, regs) ) {
+                pv_cpuid(regs);
+
+                /* Because we are setting CR4.OSFXSR to 0, we need to disable
+                 * this because, during boot, user process "init" (which doesn't
+                 * do cpuid), will do 'pxor xmm0,xmm0' and cause #UD. For now 
+                 * disable this. HVM doesn't allow setting of CR4.OSFXSR.
+                 * TBD/FIXME: this and also look at CR4.OSXSAVE */
+
+                __clear_bit(X86_FEATURE_FXSR, &regs->edx);
+            } else
+                pvh_cpuid(regs);
+
+             /* TBD/FIXME: investigate and fix the XSAVE/MMX/FPU stuff */
+
+            update_guest_eip();
+            dbgp2("cpuid:%d RIP:%lx\n", regs->eax, vmr(GUEST_RIP));
+            break;
+        }
+
+        case EXIT_REASON_HLT:             /* 12 */
+	{
+            update_guest_eip();
+            hvm_hlt(regs->eflags);
+	    break;
+#if 0
+            XEN_GUEST_HANDLE(void) p = {NULL};
+	    /* hvm_event_pending ?? see hvm_hlt() */
+	    do_sched_op(SCHEDOP_block, p);
+#endif
+	}
+
+        case EXIT_REASON_INVLPG:             /* 14 */
+            rc = vmxit_invlpg();
+            break;
+
+        case EXIT_REASON_RDTSC:              /* 16 */
+        {
+#if 0
+            uint64_t tsc;
+            int ilen=get_instruction_length();
+            rdtscll(tsc);
+            regs->eax = (uint32_t)tsc;
+            regs->edx = (uint32_t)(tsc >> 32);
+            rdtsc(regs->eax, regs->edx);
+if (mukprtsc)
+    kdbp(" RDTSC: eax:%lx edx:%lx\n", regs->eax, regs->edx);
+            update_guest_eip();
+#endif
+            rc = 1;
+            break;
+        }
+
+        case EXIT_REASON_VMCALL:             /* 18 */
+            rc = vmxit_vmcall(regs);
+            break;
+
+        case EXIT_REASON_CR_ACCESS:          /* 28 */
+            rc = vmxit_cr_access(regs);
+            break;
+
+        case EXIT_REASON_DR_ACCESS:          /* 29 */
+        {
+            exit_qualification = __vmread(EXIT_QUALIFICATION);
+#if defined(XEN_KDB_CONFIG)
+            update_guest_eip();
+            break;
+#endif
+            vmx_dr_access(exit_qualification, regs);
+            break;
+        }
+
+        case EXIT_REASON_IO_INSTRUCTION:
+            vmxit_io_instr(regs);
+            break;
+
+        case EXIT_REASON_MSR_READ:           /* 31 */
+            rc = vmxit_msr_read(regs);
+            break;
+
+        case EXIT_REASON_MSR_WRITE:          /* 32 */
+            rc = vmxit_msr_write(regs);
+            break;
+
+        case EXIT_REASON_MONITOR_TRAP_FLAG:  /* 37 */
+            rc = vmxit_mtf(regs);
+            break;
+
+        case EXIT_REASON_EPT_VIOLATION:
+        {
+            paddr_t gpa = __vmread(GUEST_PHYSICAL_ADDRESS);
+            exit_qualification = __vmread(EXIT_QUALIFICATION);
+            rc = pvh_ept_handle_violation(exit_qualification, gpa);
+            break;
+        }
+#if 0
+        case EXIT_REASON_INVVPID:            /* 53 */
+            rc = vmxit_invvpid();
+            break;
+#endif
+        default: 
+            rc = 1;
+            kdbp("Unexpected exit reason:%d 0x%x\n", exit_reason, exit_reason);
+    }
+    if (rc) {
+        exit_qualification = __vmread(EXIT_QUALIFICATION);
+        kdbp("MUK: [%d] exit_reas:%d 0x%lx qual:%ld 0x%lx cr0:0x%016lx\n", 
+             ccpu, exit_reason, exit_reason, exit_qualification,
+             exit_qualification, vmr(GUEST_CR0));
+        kdbp("MUK: [%d] RIP:%lx RSP:%lx\n", ccpu, 
+             vmr(GUEST_RIP), vmr(GUEST_RSP));
+        domain_crash_synchronous();
+    }
+
+if (mukcrashit)
+    domain_crash_synchronous();
+
+    /*dbgp("MUK: will enter vmcs: cs:%x ss:%x\n", vmr(GUEST_CS_SELECTOR),
+         vmr(GUEST_SS_SELECTOR)); */
+
+    dbgp1("MUK: will enter vmcs:RIP:%lx RSP:%lx cr0:%lx eflags:%lx\n", 
+          vmr(GUEST_RIP), vmr(GUEST_RSP), vmr(GUEST_CR0), regs->rflags);
+
+    if (mukprdr7) 
+        kdbp("MUK: vmexit dr0:%lx 7:%lx vmcs.7:%lx\n", read_debugreg(0),
+              read_debugreg(7), __vmread(GUEST_DR7));
+
+}
+
+void pvh_flush_tlb(void)
+{
+    vpid_sync_all();
+}
+
+void pvh_do_invlpg(ulong addr)
+{
+    /* vpid_sync_all(); */
+    vpid_sync_vcpu_gva(current, addr);
+}
+
+/* 
+ * Sets info for non boot vcpu. VCPU 0 context is set by library which needs 
+ * to be modified to send
+ * correct selectors and gs_base. For now, we use this for nonboot vcpu 
+ * in which case the call somes from the kernel cpu_initialize_context().
+ */
+int vmx_pvh_set_vcpu_info(struct vcpu *v, struct vcpu_guest_context *ctxtp)
+{
+kdbp("MUK: bringup pvh vcpu: cs:%x ds:%x es:%x ss:%x gsbase:%lx\n", 
+     ctxtp->user_regs.cs, ctxtp->user_regs.ds, ctxtp->user_regs.es,
+     ctxtp->user_regs.ss, ctxtp->gs_base_kernel);
+kdbp("MUK: bringup pvh vcpu: gdtr base:%lx sz:%lx gsusr:%lx\n", 
+ctxtp->u.pvh.gdtaddr, ctxtp->u.pvh.gdtsz, ctxtp->gs_base_user);
+
+    if (v->vcpu_id == 0)
+        return 0;
+
+    vmx_vmcs_enter(v);
+    __vmwrite(GUEST_GDTR_BASE, ctxtp->u.pvh.gdtaddr);
+    __vmwrite(GUEST_GDTR_LIMIT, ctxtp->u.pvh.gdtsz);
+    __vmwrite(GUEST_GS_BASE, ctxtp->gs_base_user);
+
+    __vmwrite(GUEST_CS_SELECTOR, ctxtp->user_regs.cs);
+    __vmwrite(GUEST_DS_SELECTOR, ctxtp->user_regs.ds);
+    __vmwrite(GUEST_ES_SELECTOR, ctxtp->user_regs.es);
+    __vmwrite(GUEST_SS_SELECTOR, ctxtp->user_regs.ss);
+    __vmwrite(GUEST_GS_SELECTOR, ctxtp->user_regs.gs);
+
+    if ( vmx_add_guest_msr(MSR_SHADOW_GS_BASE) )
+        return -EINVAL;
+
+    vmx_write_guest_msr(MSR_SHADOW_GS_BASE, ctxtp->gs_base_kernel);
+
+    vmx_vmcs_exit(v);
+    return 0;
+}
+
+void vmx_pvh_update_cr3(struct vcpu *v)
+{
+kdbp("MUK: in vmx_pvh_update_cr3\n");
+kdb_trap_immed(KDB_TRAP_NONFATAL);
+    vmx_vmcs_enter(v);
+    __vmwrite(GUEST_CR3, v->arch.cr3);
+    __vmwrite(HOST_CR3, v->arch.cr3);
+
+    vpid_sync_all();
+    /* hvm_asid_flush_vcpu(v); ????????????? */
+    vmx_vmcs_exit(v);
+}
+
+
+int vmx_pvh_read_descriptor(unsigned int sel, const struct vcpu *v,
+                            const struct cpu_user_regs *regs,
+                            unsigned long *base, unsigned long *limit,
+                            unsigned int *ar)
+{
+    unsigned int tmp_ar = 0;
+    BUG_ON(v!=current);
+    BUG_ON(!is_pvh_vcpu(v));
+
+    if (sel == (unsigned int)regs->cs) {
+        *base = vmr(GUEST_CS_BASE);
+        *limit = vmr(GUEST_CS_LIMIT);
+        tmp_ar = vmr(GUEST_CS_AR_BYTES); 
+    } else if (sel == (unsigned int)regs->ds) {
+        *base = vmr(GUEST_DS_BASE);
+        *limit = vmr(GUEST_DS_LIMIT);
+        tmp_ar = vmr(GUEST_DS_AR_BYTES); 
+    } else if (sel == (unsigned int)regs->ss) {
+        *base = vmr(GUEST_SS_BASE);
+        *limit = vmr(GUEST_SS_LIMIT);
+        tmp_ar = vmr(GUEST_SS_AR_BYTES); 
+    } else if (sel == (unsigned int)regs->gs) {
+        *base = vmr(GUEST_GS_BASE);
+        *limit = vmr(GUEST_GS_LIMIT);
+        tmp_ar = vmr(GUEST_GS_AR_BYTES); 
+    } else if (sel == (unsigned int)regs->fs) {
+        *base = vmr(GUEST_FS_BASE);
+        *limit = vmr(GUEST_FS_LIMIT);
+        tmp_ar = vmr(GUEST_FS_AR_BYTES); 
+    } else if (sel == (unsigned int)regs->es) {
+        *base = vmr(GUEST_ES_BASE);
+        *limit = vmr(GUEST_ES_LIMIT);
+        tmp_ar = vmr(GUEST_ES_AR_BYTES); 
+    } else {
+        kdbp("Unmatche segment selector:%d\n", sel);
+        kdb_trap_immed(KDB_TRAP_NONFATAL);
+    }
+
+    if (tmp_ar & X86_SEG_AR_CS_LM_ACTIVE) {           /* x86 mess!! */
+        *base = 0UL;
+        *limit = ~0UL;
+    }
+    /* Fixup ar so that it looks the same as in native mode */
+    *ar = (tmp_ar << 8);
+    return 1;
+}
+
+int pvh_segment_bad(unsigned int ar, struct vcpu *v)
+{
+    int rc;
+
+    BUG_ON(v!=current);
+    BUG_ON(!is_pvh_vcpu(v));
+    rc = !(ar & X86_SEG_AR_DESC_TYPE) || !(ar & X86_SEG_AR_SEG_PRESENT) ||
+         !(ar & X86_SEG_AR_SEG_TYPE_CODE);
+    return rc;
+}
+
diff -r 8b0762504037 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/mm.c	Wed Nov 14 11:03:24 2012 -0800
@@ -2608,7 +2608,7 @@ static struct domain *get_pg_owner(domid
         goto out;
     }
 
-    if ( unlikely(paging_mode_translate(curr)) )
+    if ( !is_pvh_domain(curr) && unlikely(paging_mode_translate(curr)) )
     {
         MEM_LOG("Cannot mix foreign mappings with translated domains");
         goto out;
@@ -3667,7 +3667,7 @@ static int destroy_grant_va_mapping(
     return replace_grant_va_mapping(addr, frame, l1e_empty(), v);
 }
 
-static int create_grant_p2m_mapping(uint64_t addr, unsigned long frame,
+static noinline int create_grant_p2m_mapping(uint64_t addr, unsigned long frame,
                                     unsigned int flags,
                                     unsigned int cache_flags)
 {
@@ -3742,6 +3742,22 @@ static int replace_grant_p2m_mapping(
     }
     guest_physmap_remove_page(d, gfn, frame, PAGE_ORDER_4K);
 
+    if (is_pvh_domain(d)) {
+        struct page_info *page = alloc_domheap_page(d, 0);
+
+	if (page == NULL) {
+	    gdprintk(XENLOG_ERR, "Unable to alloc domheap page\n");
+#if 0
+            /* the guest will crash anyways with ept fault when gfn accessed */
+	    domain_crash_synchronous();
+#endif
+	}
+	if (guest_physmap_add_page(d, gfn, page_to_mfn(page), 0) != 0) {
+	    gdprintk(XENLOG_ERR, "Unable to add mfn to replace grant\n");
+	    /* domain_crash_synchronous(); */
+            return GNTST_general_error;
+        }
+    }
     put_gfn(d, gfn);
     return GNTST_okay;
 }
@@ -4143,7 +4159,7 @@ long do_update_descriptor(u64 pa, u64 de
     page = get_page_from_gfn(dom, gmfn, NULL, P2M_ALLOC);
     if ( (((unsigned int)pa % sizeof(struct desc_struct)) != 0) ||
          !page ||
-         !check_descriptor(dom, &d) )
+         (!is_pvh_domain(dom) && !check_descriptor(dom, &d)) )
     {
         if ( page )
             put_page(page);
@@ -4217,9 +4233,106 @@ static int handle_iomem_range(unsigned l
     return 0;
 }
 
-static int xenmem_add_to_physmap_once(
-    struct domain *d,
-    const struct xen_add_to_physmap *xatp)
+/* add frames from foreign domain to current domain physmap. Similar to 
+ * XENMAPSPACE_gmfn but the frame is foreign being mapped into current,
+ * and is not removed from foreign domain. 
+ * Usage: libxl on pvh dom0 creating guest and doing privcmd_ioctl_mmap
+ * Returns: 0 ==> success
+ */
+static long noinline xenmem_add_foreign_to_pmap( domid_t foreign_domid, 
+                                        unsigned long fgmfn, unsigned long gpfn)
+{
+    unsigned long rc=0, failed=0, prev_mfn, mfn = 0;
+    struct domain *fdom, *currd = current->domain;
+    p2m_type_t p2mt, p2mt_prev;
+
+    if ( (fdom = get_pg_owner(foreign_domid)) == NULL ) {
+        kdb_trap_immed(KDB_TRAP_NONFATAL);
+        return -EPERM;
+    }
+failed = 0;
+
+    mfn = mfn_x(get_gfn_query_unlocked(fdom, fgmfn, &p2mt));
+
+    /* qemu, running on PVH dom0, mapping hvm domain's pages during domain 
+     * creation, doesn't have mfns in the HAP table */
+    if ( !mfn_valid(mfn) && p2m_is_mmio(p2mt) ) {
+
+        if (!is_hvm_domain(fdom)) {
+            printk("mmio type for non-hvm domain. fd:%d fgmfn:%lx gpfn:%lx\n",
+                   foreign_domid, fgmfn, gpfn);
+            kdb_trap_immed(KDB_TRAP_NONFATAL);
+        }
+        mfn = fgmfn;
+    }
+
+    if ( !p2m_is_valid(p2mt) ) {
+        put_pg_owner(fdom);
+        return -EINVAL;
+    }
+#if 0
+    if (paging_mode_external(fdom)) {
+        /* Foreign mappings into guests in shadow external mode don't       
+         * contribute to writeable mapping refcounts.  (This allows the
+         * qemu-dm helper process in dom0 to map the domain's memory without
+         * messing up the count of "real" writable mappings.) */
+        if (get_page_from_pagenr(mfn, fdom) == 0)
+            failed = 1;
+    } else {
+        if (get_page_and_type_from_pagenr(mfn, PGT_writable_page, fdom, 0, 0))
+            failed = 1;
+    }
+    if (failed) {
+        put_pg_owner(fdom);
+        return -EINVAL;
+    }
+#endif
+    /* Remove previously mapped page if it was present. */
+    prev_mfn = mfn_x(get_gfn_query_unlocked(currd, gpfn, &p2mt_prev));
+    if ( mfn_valid(prev_mfn) )
+    {
+        if ( is_xen_heap_mfn(prev_mfn) )
+            /* Xen heap frames are simply unhooked from this phys slot */
+            guest_physmap_remove_page(currd, gpfn, prev_mfn, 0);
+        else
+            /* Normal domain memory is freed, to avoid leaking memory. */
+            guest_remove_page(currd, gpfn);
+    }
+/* I CAN PROB remove the mmio because all io space is mapped upfront via
+ * domctl_memory_mapping */
+    /* Map at new location. */
+    /* Can't use guest_physmap_add_page() because it will update the m2p
+     * table so mfn ---> gpfn in dom0 and not gpfn of domU.
+     */
+    if ( p2m_is_mmio(p2mt) ) {
+        if (set_mmio_p2m_entry(currd, gpfn, mfn) == 0) {
+            kdbp("guest_physmap_add_page failed. gpfn:%lx mfn:%lx fgmfn:%lx\n", 
+                 gpfn, mfn, fgmfn);
+            kdb_trap_immed(KDB_TRAP_NONFATAL);
+            rc = -EINVAL;
+        }
+        goto out;
+    }
+    if (set_foreign_p2m_entry(currd, gpfn, mfn) == 0) {
+#if 0
+        if (paging_mode_external(fdom))
+            put_page(mfn_to_page(mfn));
+        else
+            put_page_and_type(mfn_to_page(mfn));
+#endif
+        kdbp("guest_physmap_add_page failed1. gpfn:%lx mfn:%lx fgmfn:%lx\n", 
+             gpfn, mfn, fgmfn);
+        kdb_trap_immed(KDB_TRAP_NONFATAL);
+        rc = -EINVAL;
+    }
+out:
+    put_pg_owner(fdom);
+    return rc;
+}
+
+static noinline int xenmem_add_to_physmap_once(
+    struct domain *d, uint16_t xatp_space, domid_t foreign_domid,
+    unsigned long xatp_idx, unsigned long xatp_gpfn)
 {
     struct page_info *page = NULL;
     unsigned long gfn = 0; /* gcc ... */
@@ -4227,10 +4340,10 @@ static int xenmem_add_to_physmap_once(
     int rc;
     p2m_type_t p2mt;
 
-    switch ( xatp->space )
+    switch ( xatp_space )
     {
         case XENMAPSPACE_shared_info:
-            if ( xatp->idx == 0 )
+            if ( xatp_idx == 0 )
                 mfn = virt_to_mfn(d->shared_info);
             break;
         case XENMAPSPACE_grant_table:
@@ -4239,9 +4352,9 @@ static int xenmem_add_to_physmap_once(
             if ( d->grant_table->gt_version == 0 )
                 d->grant_table->gt_version = 1;
 
-            idx = xatp->idx;
+            idx = xatp_idx;
             if ( d->grant_table->gt_version == 2 &&
-                 (xatp->idx & XENMAPIDX_grant_table_status) )
+                 (xatp_idx & XENMAPIDX_grant_table_status) )
             {
                 idx &= ~XENMAPIDX_grant_table_status;
                 if ( idx < nr_status_frames(d->grant_table) )
@@ -4263,9 +4376,9 @@ static int xenmem_add_to_physmap_once(
         case XENMAPSPACE_gmfn:
         {
             p2m_type_t p2mt;
-            gfn = xatp->idx;
-
-            idx = mfn_x(get_gfn_unshare(d, xatp->idx, &p2mt));
+            gfn = xatp_idx;
+
+            idx = mfn_x(get_gfn_unshare(d, xatp_idx, &p2mt));
             /* If the page is still shared, exit early */
             if ( p2m_is_shared(p2mt) )
             {
@@ -4278,6 +4391,13 @@ static int xenmem_add_to_physmap_once(
             page = mfn_to_page(mfn);
             break;
         }
+
+        case XENMAPSPACE_gmfn_foreign:
+        {
+            rc = xenmem_add_foreign_to_pmap(foreign_domid, xatp_idx, xatp_gpfn);
+            return rc;
+        }
+
         default:
             break;
     }
@@ -4286,8 +4406,8 @@ static int xenmem_add_to_physmap_once(
     {
         if ( page )
             put_page(page);
-        if ( xatp->space == XENMAPSPACE_gmfn ||
-             xatp->space == XENMAPSPACE_gmfn_range )
+        if ( xatp_space == XENMAPSPACE_gmfn ||
+             xatp_space == XENMAPSPACE_gmfn_range )
             put_gfn(d, gfn);
         return -EINVAL;
     }
@@ -4298,41 +4418,41 @@ static int xenmem_add_to_physmap_once(
         put_page(page);
 
     /* Remove previously mapped page if it was present. */
-    prev_mfn = mfn_x(get_gfn(d, xatp->gpfn, &p2mt));
+    prev_mfn = mfn_x(get_gfn(d, xatp_gpfn, &p2mt));
     if ( mfn_valid(prev_mfn) )
     {
         if ( is_xen_heap_mfn(prev_mfn) )
             /* Xen heap frames are simply unhooked from this phys slot. */
-            guest_physmap_remove_page(d, xatp->gpfn, prev_mfn, PAGE_ORDER_4K);
+            guest_physmap_remove_page(d, xatp_gpfn, prev_mfn, PAGE_ORDER_4K);
         else
             /* Normal domain memory is freed, to avoid leaking memory. */
-            guest_remove_page(d, xatp->gpfn);
+            guest_remove_page(d, xatp_gpfn);
     }
     /* In the XENMAPSPACE_gmfn case we still hold a ref on the old page. */
-    put_gfn(d, xatp->gpfn);
+    put_gfn(d, xatp_gpfn);
 
     /* Unmap from old location, if any. */
     gpfn = get_gpfn_from_mfn(mfn);
     ASSERT( gpfn != SHARED_M2P_ENTRY );
-    if ( xatp->space == XENMAPSPACE_gmfn ||
-         xatp->space == XENMAPSPACE_gmfn_range )
+    if ( xatp_space == XENMAPSPACE_gmfn ||
+         xatp_space == XENMAPSPACE_gmfn_range )
         ASSERT( gpfn == gfn );
     if ( gpfn != INVALID_M2P_ENTRY )
         guest_physmap_remove_page(d, gpfn, mfn, PAGE_ORDER_4K);
 
     /* Map at new location. */
-    rc = guest_physmap_add_page(d, xatp->gpfn, mfn, PAGE_ORDER_4K);
+    rc = guest_physmap_add_page(d, xatp_gpfn, mfn, PAGE_ORDER_4K);
 
     /* In the XENMAPSPACE_gmfn, we took a ref of the gfn at the top */
-    if ( xatp->space == XENMAPSPACE_gmfn ||
-         xatp->space == XENMAPSPACE_gmfn_range )
+    if ( xatp_space == XENMAPSPACE_gmfn ||
+         xatp_space == XENMAPSPACE_gmfn_range )
         put_gfn(d, gfn);
     domain_unlock(d);
 
     return rc;
 }
 
-static int xenmem_add_to_physmap(struct domain *d,
+static noinline int xenmem_add_to_physmap(struct domain *d,
                                  struct xen_add_to_physmap *xatp)
 {
     struct xen_add_to_physmap start_xatp;
@@ -4346,7 +4466,8 @@ static int xenmem_add_to_physmap(struct 
         start_xatp = *xatp;
         while ( xatp->size > 0 )
         {
-            rc = xenmem_add_to_physmap_once(d, xatp);
+            rc = xenmem_add_to_physmap_once(d, xatp->space, -1,
+                                            xatp->idx, xatp->gpfn);
             if ( rc < 0 )
                 return rc;
 
@@ -4372,7 +4493,50 @@ static int xenmem_add_to_physmap(struct 
         return rc;
     }
 
-    return xenmem_add_to_physmap_once(d, xatp);
+    return xenmem_add_to_physmap_once(d, xatp->space, -1,
+                                      xatp->idx, xatp->gpfn);
+}
+
+static noinline int xenmem_add_to_physmap_range(struct domain *d,
+                                       struct xen_add_to_physmap_range *xatpr)
+{
+    int rc;
+
+    /* Process entries in reverse order to allow continuations */
+    while ( xatpr->size > 0 )
+    {
+        xen_ulong_t idx;
+        xen_pfn_t gpfn;
+
+        rc = copy_from_guest_offset(&idx, xatpr->idxs, xatpr->size-1, 1);
+        if ( rc < 0 )
+            goto out;
+
+        rc = copy_from_guest_offset(&gpfn, xatpr->gpfns, xatpr->size-1, 1);
+        if ( rc < 0 )
+            goto out;
+
+        rc = xenmem_add_to_physmap_once(d, xatpr->space, xatpr->foreign_domid,
+                                        idx, gpfn);
+
+	if (rc)
+            goto out;
+
+        xatpr->size--;
+
+        /* Check for continuation if it's not the last interation */
+        if ( xatpr->size > 0 && hypercall_preempt_check() )
+        {
+            rc = -EAGAIN;
+            goto out;
+        }
+    }
+
+    rc = 0;
+
+out:
+    return rc;
+
 }
 
 long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
@@ -4389,6 +4553,10 @@ long arch_memory_op(int op, XEN_GUEST_HA
         if ( copy_from_guest(&xatp, arg, 1) )
             return -EFAULT;
 
+        /* This one is only supported for add_to_physmap_range */
+        if ( xatp.space == XENMAPSPACE_gmfn_foreign )
+            return -EINVAL;
+
         rc = rcu_lock_target_domain_by_id(xatp.domid, &d);
         if ( rc != 0 )
             return rc;
@@ -4416,6 +4584,32 @@ long arch_memory_op(int op, XEN_GUEST_HA
         return rc;
     }
 
+    case XENMEM_add_to_physmap_range:
+    {
+        struct xen_add_to_physmap_range xatpr;
+        struct domain *d;
+
+        if ( copy_from_guest(&xatpr, arg, 1) )
+            return -EFAULT;
+
+        rc = rcu_lock_target_domain_by_id(xatpr.domid, &d);
+        if ( rc != 0 )
+            return rc;
+
+        rc = xenmem_add_to_physmap_range(d, &xatpr);
+
+        rcu_unlock_domain(d);
+
+        if ( rc && copy_to_guest(arg, &xatpr, 1) )
+            rc = -EFAULT;
+
+        if ( rc == -EAGAIN )
+            rc = hypercall_create_continuation(
+                __HYPERVISOR_memory_op, "ih", op, arg);
+
+        return rc;
+    }
+
     case XENMEM_set_memory_map:
     {
         struct xen_foreign_memory_map fmap;
diff -r 8b0762504037 xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/mm/hap/hap.c	Wed Nov 14 11:03:24 2012 -0800
@@ -600,6 +600,20 @@ int hap_domctl(struct domain *d, xen_dom
     }
 }
 
+/* Resize hap table. Copied from: libxl_get_required_shadow_memory() */
+void hap_set_pvh_alloc_for_dom0(struct domain *d, unsigned long num_pages)
+{
+    int rc;
+    unsigned long memkb = num_pages * (PAGE_SIZE / 1024);
+
+    memkb = 4 * (256 * d->max_vcpus + 2 * (memkb / 1024));
+    num_pages = ((memkb+1023)/1024) << (20 - PAGE_SHIFT);
+    paging_lock(d);
+    rc = hap_set_allocation(d, num_pages, NULL);
+    paging_unlock(d);
+    BUG_ON(rc);
+}
+
 static const struct paging_mode hap_paging_real_mode;
 static const struct paging_mode hap_paging_protected_mode;
 static const struct paging_mode hap_paging_pae_mode;
@@ -659,7 +673,8 @@ static void hap_update_cr3(struct vcpu *
 const struct paging_mode *
 hap_paging_get_mode(struct vcpu *v)
 {
-    return !hvm_paging_enabled(v)   ? &hap_paging_real_mode :
+    return is_pvh_vcpu(v) ? &hap_paging_long_mode :
+        !hvm_paging_enabled(v)   ? &hap_paging_real_mode :
         hvm_long_mode_enabled(v) ? &hap_paging_long_mode :
         hvm_pae_enabled(v)       ? &hap_paging_pae_mode  :
                                    &hap_paging_protected_mode;
diff -r 8b0762504037 xen/arch/x86/mm/p2m-ept.c
--- a/xen/arch/x86/mm/p2m-ept.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/mm/p2m-ept.c	Wed Nov 14 11:03:24 2012 -0800
@@ -75,6 +75,7 @@ static void ept_p2m_type_to_flags(ept_en
             entry->w = 0;
             break;
         case p2m_grant_map_rw:
+        case p2m_map_foreign:
             entry->r = entry->w = 1;
             entry->x = 0;
             break;
@@ -428,7 +429,7 @@ ept_set_entry(struct p2m_domain *p2m, un
     }
 
     /* Track the highest gfn for which we have ever had a valid mapping */
-    if ( p2mt != p2m_invalid &&
+    if ( p2mt != p2m_invalid && p2mt != p2m_mmio_dm &&
          (gfn + (1UL << order) - 1 > p2m->max_mapped_pfn) )
         p2m->max_mapped_pfn = gfn + (1UL << order) - 1;
 
@@ -462,6 +463,9 @@ out:
             }
             else
             {
+
+if (p2m->domain->domain_id == 0)   /******* PVH : FIXME */
+    goto skip;
                 if ( order > 0 )
                 {
                     for ( i = 0; i < (1 << order); i++ )
@@ -472,7 +476,7 @@ out:
             }
         }
     }
-
+skip:
     /* Release the old intermediate tables, if any.  This has to be the
        last thing we do, after the ept_sync_domain() and removal
        from the iommu tables, so as to avoid a potential
diff -r 8b0762504037 xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/mm/p2m-pt.c	Wed Nov 14 11:03:24 2012 -0800
@@ -89,6 +89,7 @@ static unsigned long p2m_type_to_flags(p
     case p2m_ram_rw:
         return flags | P2M_BASE_FLAGS | _PAGE_RW;
     case p2m_grant_map_rw:
+    case p2m_map_foreign:
         return flags | P2M_BASE_FLAGS | _PAGE_RW | _PAGE_NX_BIT;
     case p2m_mmio_direct:
         if ( !rangeset_contains_singleton(mmio_ro_ranges, mfn_x(mfn)) )
@@ -429,7 +430,7 @@ p2m_set_entry(struct p2m_domain *p2m, un
     }
 
     /* Track the highest gfn for which we have ever had a valid mapping */
-    if ( p2mt != p2m_invalid
+    if ( p2mt != p2m_invalid && p2mt != p2m_mmio_dm
          && (gfn + (1UL << page_order) - 1 > p2m->max_mapped_pfn) )
         p2m->max_mapped_pfn = gfn + (1UL << page_order) - 1;
 
diff -r 8b0762504037 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/mm/p2m.c	Wed Nov 14 11:03:24 2012 -0800
@@ -488,7 +488,7 @@ p2m_remove_page(struct p2m_domain *p2m, 
         for ( i = 0; i < (1UL << page_order); i++ )
         {
             mfn_return = p2m->get_entry(p2m, gfn + i, &t, &a, 0, NULL);
-            if ( !p2m_is_grant(t) && !p2m_is_shared(t) )
+            if ( !p2m_is_grant(t) && !p2m_is_shared(t) && !p2m_is_foreign(t) )
                 set_gpfn_from_mfn(mfn+i, INVALID_M2P_ENTRY);
             ASSERT( !p2m_is_valid(t) || mfn + i == mfn_x(mfn_return) );
         }
@@ -584,6 +584,11 @@ guest_physmap_add_entry(struct domain *d
         {
             ASSERT(mfn_valid(omfn));
             set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
+
+            /* Because PVH domU uses kmalloc for grant pfn, we need to save
+             * and restore the old mfn */
+             if (is_pvh_domain(d) && p2m_is_grant(t))
+                 free_domheap_page(mfn_to_page(omfn));
         }
         else if ( ot == p2m_populate_on_demand )
         {
@@ -715,7 +720,33 @@ void p2m_change_type_range(struct domain
     p2m_unlock(p2m);
 }
 
+/* Returns: True for success. 0 for failure */
+int set_foreign_p2m_entry(struct domain *domp, unsigned long gfn, mfn_t mfn)
+{
+    int rc = 0;
+    p2m_type_t ot;
+    mfn_t omfn;
+    struct p2m_domain *p2m = p2m_get_hostp2m(domp);
 
+    if ( !paging_mode_translate(domp) )
+        return 0;
+
+    omfn = get_gfn_query_unlocked(domp, gfn, &ot);
+    if (mfn_valid(omfn)) {
+        gdprintk(XENLOG_ERR, "Already mapped mfn %lx at gfn:%lx\n", omfn, gfn);
+        set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
+    }
+
+    P2M_DEBUG("set foreign %lx %lx\n", gfn, mfn_x(mfn));
+    p2m_lock(p2m);
+    rc = set_p2m_entry(p2m, gfn, mfn, 0, p2m_map_foreign, p2m->default_access);
+    p2m_unlock(p2m);
+    if ( rc == 0 )
+        gdprintk(XENLOG_ERR,
+            "set_foreign_p2m_entry: set_p2m_entry failed! gfn:%lx mfn=%08lx\n",
+            gfn, mfn_x(get_gfn_query(domp, gfn, &ot)));
+    return rc;
+}
 
 int
 set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
diff -r 8b0762504037 xen/arch/x86/msi.c
--- a/xen/arch/x86/msi.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/msi.c	Wed Nov 14 11:03:24 2012 -0800
@@ -766,6 +766,9 @@ static int msix_capability_init(struct p
         WARN_ON(rangeset_overlaps_range(mmio_ro_ranges, dev->msix_pba.first,
                                         dev->msix_pba.last));
 
+/* PVH: fixme: not a clue what to do here :) */
+if (is_pvh_domain(dev->domain) && dev->domain->domain_id != 0)
+{
         if ( rangeset_add_range(mmio_ro_ranges, dev->msix_table.first,
                                 dev->msix_table.last) )
             WARN();
@@ -793,6 +796,7 @@ static int msix_capability_init(struct p
                 /* XXX How to deal with existing mappings? */
             }
         }
+}
     }
     WARN_ON(dev->msix_nr_entries != nr_entries);
     WARN_ON(dev->msix_table.first != (table_paddr >> PAGE_SHIFT));
diff -r 8b0762504037 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/physdev.c	Wed Nov 14 11:03:24 2012 -0800
@@ -732,6 +732,25 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         break;
     }
 
+    case PHYSDEVOP_pvh_map_iomem : {
+
+	struct physdev_map_iomem iomem;
+        struct domain *d = current->domain;
+
+        ret = -EPERM;
+        if ( !IS_PRIV(d) || !is_pvh_domain(d))
+            break;
+        d = rcu_lock_current_domain();
+        
+        ret = -EFAULT;
+        if ( copy_from_guest(&iomem, arg, 1) != 0 )
+            break;
+
+	ret = domctl_memory_mapping(d, iomem.first_gfn, iomem.first_mfn, 
+	                            iomem.nr_mfns, iomem.add_mapping);
+        break;
+    }
+
     default:
         ret = -ENOSYS;
         break;
diff -r 8b0762504037 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/setup.c	Wed Nov 14 11:03:24 2012 -0800
@@ -54,6 +54,9 @@ int opt_earlykdb=0;
 boolean_param("earlykdb", opt_earlykdb);
 #endif
 
+int opt_dom0hyb=0;
+boolean_param("dom0hyb", opt_dom0hyb);
+
 /* opt_nosmp: If true, secondary processors are ignored. */
 static bool_t __initdata opt_nosmp;
 boolean_param("nosmp", opt_nosmp);
@@ -542,7 +545,7 @@ void __init __start_xen(unsigned long mb
 {
     char *memmap_type = NULL;
     char *cmdline, *kextra, *loader;
-    unsigned int initrdidx;
+    unsigned int initrdidx, domcr_flags = 0;
     multiboot_info_t *mbi = __va(mbi_p);
     module_t *mod = (module_t *)__va(mbi->mods_addr);
     unsigned long nr_pages, modules_headroom, *module_map;
@@ -1260,7 +1263,9 @@ void __init __start_xen(unsigned long mb
         panic("Could not protect TXT memory regions\n");
 
     /* Create initial domain 0. */
-    dom0 = domain_create(0, DOMCRF_s3_integrity, 0);
+    domcr_flags = (opt_dom0hyb ? DOMCRF_pvh | DOMCRF_hap : 0);
+    domcr_flags |= DOMCRF_s3_integrity;
+    dom0 = domain_create(0, domcr_flags, 0);
     if ( IS_ERR(dom0) || (alloc_dom0_vcpu0() == NULL) )
         panic("Error creating domain 0\n");
 
diff -r 8b0762504037 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/time.c	Wed Nov 14 11:03:24 2012 -0800
@@ -1923,7 +1923,7 @@ void tsc_set_info(struct domain *d,
         break;
     }
     d->arch.incarnation = incarnation + 1;
-    if ( is_hvm_domain(d) )
+    if ( is_hvm_or_pvh_domain(d) )
         hvm_set_rdtsc_exiting(d, d->arch.vtsc);
 }
 
diff -r 8b0762504037 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/traps.c	Wed Nov 14 11:03:24 2012 -0800
@@ -723,7 +723,7 @@ int cpuid_hypervisor_leaves( uint32_t id
     return 1;
 }
 
-static void pv_cpuid(struct cpu_user_regs *regs)
+void pv_cpuid(struct cpu_user_regs *regs)
 {
     uint32_t a, b, c, d;
 
@@ -900,7 +900,7 @@ static int emulate_invalid_rdtscp(struct
     return EXCRET_fault_fixed;
 }
 
-static int emulate_forced_invalid_op(struct cpu_user_regs *regs)
+int emulate_forced_invalid_op(struct cpu_user_regs *regs)
 {
     char sig[5], instr[2];
     unsigned long eip, rc;
@@ -910,6 +910,10 @@ static int emulate_forced_invalid_op(str
     /* Check for forced emulation signature: ud2 ; .ascii "xen". */
     if ( (rc = copy_from_user(sig, (char *)eip, sizeof(sig))) != 0 )
     {
+        /* PVH: fixme: hmm... what do we do for PVH? */
+        if ( is_pvh_vcpu(current) )
+            return 0;
+
         propagate_page_fault(eip + sizeof(sig) - rc, 0);
         return EXCRET_fault_fixed;
     }
@@ -920,6 +924,10 @@ static int emulate_forced_invalid_op(str
     /* We only emulate CPUID. */
     if ( ( rc = copy_from_user(instr, (char *)eip, sizeof(instr))) != 0 )
     {
+        /* PVH: fixme: hmm... what do we do for PVH? */
+        if ( is_pvh_vcpu(current) )
+            return 0;
+
         propagate_page_fault(eip + sizeof(instr) - rc, 0);
         return EXCRET_fault_fixed;
     }
@@ -1448,6 +1456,9 @@ static int read_descriptor(unsigned int 
 {
     struct desc_struct desc;
 
+    if ( is_pvh_vcpu(v) )
+        return hvm_pvh_read_descriptor(sel, v, regs, base, limit, ar);
+
     if ( !vm86_mode(regs) )
     {
         if ( sel < 4)
@@ -1566,6 +1577,10 @@ static int guest_io_okay(
     int user_mode = !(v->arch.flags & TF_kernel_mode);
 #define TOGGLE_MODE() if ( user_mode ) toggle_guest_mode(v)
 
+    /* for PVH we check this in vmexit for EXIT_REASON_IO_INSTRUCTION */
+    if (is_pvh_vcpu(v))
+        return 1;
+
     if ( !vm86_mode(regs) &&
          (v->arch.pv_vcpu.iopl >= (guest_kernel_mode(v, regs) ? 1 : 3)) )
         return 1;
@@ -1811,14 +1826,14 @@ static inline uint64_t guest_misc_enable
         _ptr = (unsigned int)_ptr;                                          \
     if ( (limit) < sizeof(_x) - 1 || (eip) > (limit) - (sizeof(_x) - 1) )   \
         goto fail;                                                          \
-    if ( (_rc = copy_from_user(&_x, (type *)_ptr, sizeof(_x))) != 0 )       \
+    if ( (_rc = raw_copy_from_guest(&_x, (type *)_ptr, sizeof(_x))) != 0 )  \
     {                                                                       \
         propagate_page_fault(_ptr + sizeof(_x) - _rc, 0);                   \
         goto skip;                                                          \
     }                                                                       \
     (eip) += sizeof(_x); _x; })
 
-#define read_sreg(regs, sr) read_segment_register(sr)
+#define read_sreg(vcpu, regs, sr) read_segment_register(vcpu, regs, sr)
 
 static int is_cpufreq_controller(struct domain *d)
 {
@@ -1828,7 +1843,7 @@ static int is_cpufreq_controller(struct 
 
 #include "x86_64/mmconfig.h"
 
-static int emulate_privileged_op(struct cpu_user_regs *regs)
+int emulate_privileged_op(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
     unsigned long *reg, eip = regs->eip;
@@ -1864,7 +1879,7 @@ static int emulate_privileged_op(struct 
         goto fail;
 
     /* emulating only opcodes not allowing SS to be default */
-    data_sel = read_sreg(regs, ds);
+    data_sel = read_sreg(v, regs, ds);
 
     /* Legacy prefixes. */
     for ( i = 0; i < 8; i++, rex == opcode || (rex = 0) )
@@ -1882,17 +1897,17 @@ static int emulate_privileged_op(struct 
             data_sel = regs->cs;
             continue;
         case 0x3e: /* DS override */
-            data_sel = read_sreg(regs, ds);
+            data_sel = read_sreg(v, regs, ds);
             continue;
         case 0x26: /* ES override */
-            data_sel = read_sreg(regs, es);
+            data_sel = read_sreg(v, regs, es);
             continue;
         case 0x64: /* FS override */
-            data_sel = read_sreg(regs, fs);
+            data_sel = read_sreg(v, regs, fs);
             lm_ovr = lm_seg_fs;
             continue;
         case 0x65: /* GS override */
-            data_sel = read_sreg(regs, gs);
+            data_sel = read_sreg(v, regs, gs);
             lm_ovr = lm_seg_gs;
             continue;
         case 0x36: /* SS override */
@@ -1939,7 +1954,7 @@ static int emulate_privileged_op(struct 
 
         if ( !(opcode & 2) )
         {
-            data_sel = read_sreg(regs, es);
+            data_sel = read_sreg(v, regs, es);
             lm_ovr = lm_seg_none;
         }
 
@@ -2668,22 +2683,22 @@ static void emulate_gate_op(struct cpu_u
             ASSERT(opnd_sel);
             continue;
         case 0x3e: /* DS override */
-            opnd_sel = read_sreg(regs, ds);
+            opnd_sel = read_sreg(v, regs, ds);
             if ( !opnd_sel )
                 opnd_sel = dpl;
             continue;
         case 0x26: /* ES override */
-            opnd_sel = read_sreg(regs, es);
+            opnd_sel = read_sreg(v, regs, es);
             if ( !opnd_sel )
                 opnd_sel = dpl;
             continue;
         case 0x64: /* FS override */
-            opnd_sel = read_sreg(regs, fs);
+            opnd_sel = read_sreg(v, regs, fs);
             if ( !opnd_sel )
                 opnd_sel = dpl;
             continue;
         case 0x65: /* GS override */
-            opnd_sel = read_sreg(regs, gs);
+            opnd_sel = read_sreg(v, regs, gs);
             if ( !opnd_sel )
                 opnd_sel = dpl;
             continue;
@@ -2736,7 +2751,7 @@ static void emulate_gate_op(struct cpu_u
                             switch ( modrm & 7 )
                             {
                             default:
-                                opnd_sel = read_sreg(regs, ds);
+                                opnd_sel = read_sreg(v, regs, ds);
                                 break;
                             case 4: case 5:
                                 opnd_sel = regs->ss;
@@ -2764,7 +2779,7 @@ static void emulate_gate_op(struct cpu_u
                             break;
                         }
                         if ( !opnd_sel )
-                            opnd_sel = read_sreg(regs, ds);
+                            opnd_sel = read_sreg(v, regs, ds);
                         switch ( modrm & 7 )
                         {
                         case 0: case 2: case 4:
diff -r 8b0762504037 xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/x86_64/traps.c	Wed Nov 14 11:03:24 2012 -0800
@@ -127,10 +127,10 @@ void show_registers(struct cpu_user_regs
         fault_crs[0] = read_cr0();
         fault_crs[3] = read_cr3();
         fault_crs[4] = read_cr4();
-        fault_regs.ds = read_segment_register(ds);
-        fault_regs.es = read_segment_register(es);
-        fault_regs.fs = read_segment_register(fs);
-        fault_regs.gs = read_segment_register(gs);
+        fault_regs.ds = read_segment_register(v, regs, ds);
+        fault_regs.es = read_segment_register(v, regs, es);
+        fault_regs.fs = read_segment_register(v, regs, fs);
+        fault_regs.gs = read_segment_register(v, regs, gs);
     }
 
     print_xen_info();
@@ -624,7 +624,7 @@ static void hypercall_page_initialise_ri
 void hypercall_page_initialise(struct domain *d, void *hypercall_page)
 {
     memset(hypercall_page, 0xCC, PAGE_SIZE);
-    if ( is_hvm_domain(d) )
+    if ( is_hvm_or_pvh_domain(d) )
         hvm_hypercall_page_initialise(d, hypercall_page);
     else if ( !is_pv_32bit_domain(d) )
         hypercall_page_initialise_ring3_kernel(hypercall_page);
diff -r 8b0762504037 xen/common/domain.c
--- a/xen/common/domain.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/common/domain.c	Wed Nov 14 11:03:24 2012 -0800
@@ -232,6 +232,14 @@ struct domain *domain_create(
 
     if ( domcr_flags & DOMCRF_hvm )
         d->is_hvm = 1;
+    else if ( domcr_flags & DOMCRF_pvh ) {
+        d->is_pvh = 1;
+        if ( !(domcr_flags & DOMCRF_hap) ) {
+            printk("PVH guest must have HAP on\n");
+            goto fail;
+        } else
+            printk("Yeay... PVH guest. domid:%d\n", domid);
+    }
 
     if ( domid == 0 )
     {
diff -r 8b0762504037 xen/common/domctl.c
--- a/xen/common/domctl.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/common/domctl.c	Wed Nov 14 11:03:24 2012 -0800
@@ -149,6 +149,8 @@ void getdomaininfo(struct domain *d, str
 
     if ( is_hvm_domain(d) )
         info->flags |= XEN_DOMINF_hvm_guest;
+    else if ( is_pvh_domain(d) )
+        info->flags |= XEN_DOMINF_pvh_guest;
 
     xsm_security_domaininfo(d, info);
 
@@ -419,6 +421,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         if ( supervisor_mode_kernel ||
              (op->u.createdomain.flags &
              ~(XEN_DOMCTL_CDF_hvm_guest | XEN_DOMCTL_CDF_hap |
+               XEN_DOMCTL_CDF_pvh_guest |
                XEN_DOMCTL_CDF_s3_integrity | XEN_DOMCTL_CDF_oos_off)) )
             break;
 
@@ -449,6 +452,8 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         domcr_flags = 0;
         if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_hvm_guest )
             domcr_flags |= DOMCRF_hvm;
+        if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_pvh_guest )
+            domcr_flags |= DOMCRF_pvh;
         if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_hap )
             domcr_flags |= DOMCRF_hap;
         if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_s3_integrity )
diff -r 8b0762504037 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/common/grant_table.c	Wed Nov 14 11:03:24 2012 -0800
@@ -529,7 +529,7 @@ static void mapcount(
  * addr is _either_ a host virtual address, or the address of the pte to
  * update, as indicated by the GNTMAP_contains_pte flag.
  */
-static void
+static noinline void
 __gnttab_map_grant_ref(
     struct gnttab_map_grant_ref *op)
 {
@@ -745,7 +745,7 @@ __gnttab_map_grant_ref(
 
     double_gt_lock(lgt, rgt);
 
-    if ( !is_hvm_domain(ld) && need_iommu(ld) )
+    if ( !is_hvm_or_pvh_domain(ld) && need_iommu(ld) )
     {
         unsigned int wrc, rdc;
         int err = 0;
@@ -956,7 +956,7 @@ __gnttab_unmap_common(
             act->pin -= GNTPIN_hstw_inc;
     }
 
-    if ( !is_hvm_domain(ld) && need_iommu(ld) )
+    if ( !is_hvm_or_pvh_domain(ld) && need_iommu(ld) )
     {
         unsigned int wrc, rdc;
         int err = 0;
diff -r 8b0762504037 xen/common/kernel.c
--- a/xen/common/kernel.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/common/kernel.c	Wed Nov 14 11:03:24 2012 -0800
@@ -289,7 +289,11 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDL
             if ( current->domain == dom0 )
                 fi.submap |= 1U << XENFEAT_dom0;
 #ifdef CONFIG_X86
-            if ( !is_hvm_vcpu(current) )
+            if ( is_pvh_vcpu(current) )
+                fi.submap |= (1U << XENFEAT_hvm_safe_pvclock) |
+                             (1U << XENFEAT_supervisor_mode_kernel) |
+                             (1U << XENFEAT_hvm_callback_vector);
+            else if ( !is_hvm_vcpu(current) )
                 fi.submap |= (1U << XENFEAT_mmu_pt_update_preserve_ad) |
                              (1U << XENFEAT_highmem_assist) |
                              (1U << XENFEAT_gnttab_map_avail_bits);
diff -r 8b0762504037 xen/common/libelf/libelf-loader.c
--- a/xen/common/libelf/libelf-loader.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/common/libelf/libelf-loader.c	Wed Nov 14 11:03:24 2012 -0800
@@ -17,6 +17,10 @@
  */
 
 #include "libelf-private.h"
+#ifdef __XEN__
+#include <public/xen.h>
+#include <asm/debugger.h>
+#endif
 
 /* ------------------------------------------------------------------------ */
 
@@ -108,7 +112,8 @@ void elf_set_log(struct elf_binary *elf,
     elf->verbose = verbose;
 }
 
-static int elf_load_image(void *dst, const void *src, uint64_t filesz, uint64_t memsz)
+static int elf_load_image(void *dst, const void *src, uint64_t filesz, 
+                          uint64_t memsz, int not_used)
 {
     memcpy(dst, src, filesz);
     memset(dst + filesz, 0, memsz - filesz);
@@ -122,11 +127,35 @@ void elf_set_verbose(struct elf_binary *
     elf->verbose = 1;
 }
 
-static int elf_load_image(void *dst, const void *src, uint64_t filesz, uint64_t memsz)
+static int elf_load_image(void *dst, const void *src, uint64_t filesz, 
+                          uint64_t memsz, int is_pvh_dom0)
 {
     int rc;
     if ( filesz > ULONG_MAX || memsz > ULONG_MAX )
         return -1;
+
+    /* raw_copy_to_guest -> copy_to_user_hvm -> __hvm_copy needs curr to
+     * point to the hvm/pvh vcpu. Hence for PVH dom0 we can't use that. For now
+     * just use dbg_rw_mem(). FIXME: this is kinda slow, enhance to copy
+     * more than one byte at a time. */
+    if ( is_pvh_dom0 ) 
+    {
+        int j, rem; 
+        rem = dbg_rw_mem((dbgva_t)dst, (dbgbyte_t *)src, (int)filesz, 0, 1, 0);
+        if ( rem ) {
+            printk("Failed to copy elf binary. len:%ld rem:%d\n", filesz, rem);
+            return -1;
+        }
+        for (j=0; j < memsz - filesz; j++) {
+            unsigned char zero=0;
+            rem = dbg_rw_mem((dbgva_t)(dst+filesz+j), &zero, 1, 0, 1, 0);
+            if (rem) {
+                kdbp("Failed to copy to: %lx rem:%d\n", dst+filesz+j, rem);
+                return -1;
+            }
+        }
+        return 0;
+    }
     rc = raw_copy_to_guest(dst, src, filesz);
     if ( rc != 0 )
         return -1;
@@ -260,7 +289,9 @@ void elf_parse_binary(struct elf_binary 
             __FUNCTION__, elf->pstart, elf->pend);
 }
 
-int elf_load_binary(struct elf_binary *elf)
+/* This function called for dom0 and also from the libraries when building 
+ * guests */
+static int _elf_load_binary(struct elf_binary *elf, int is_pvh_dom0)
 {
     const elf_phdr *phdr;
     uint64_t i, count, paddr, offset, filesz, memsz;
@@ -279,7 +310,8 @@ int elf_load_binary(struct elf_binary *e
         dest = elf_get_ptr(elf, paddr);
         elf_msg(elf, "%s: phdr %" PRIu64 " at 0x%p -> 0x%p\n",
                 __func__, i, dest, dest + filesz);
-        if ( elf_load_image(dest, elf->image + offset, filesz, memsz) != 0 )
+        if ( elf_load_image(dest, elf->image + offset, filesz, memsz, 
+                            is_pvh_dom0) != 0 )
             return -1;
     }
 
@@ -287,6 +319,18 @@ int elf_load_binary(struct elf_binary *e
     return 0;
 }
 
+#ifdef __XEN__
+int elf_load_binary(struct elf_binary *elf, int is_pvh_dom0)
+{
+    return _elf_load_binary(elf, is_pvh_dom0);
+}
+#else
+int elf_load_binary(struct elf_binary *elf)
+{
+    return _elf_load_binary(elf, 0);
+}
+#endif
+
 void *elf_get_ptr(struct elf_binary *elf, unsigned long addr)
 {
     return elf->dest + addr - elf->pstart;
diff -r 8b0762504037 xen/common/memory.c
--- a/xen/common/memory.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/common/memory.c	Wed Nov 14 11:03:24 2012 -0800
@@ -653,6 +653,8 @@ long do_memory_op(unsigned long cmd, XEN
         struct xen_remove_from_physmap xrfp;
         struct page_info *page;
         struct domain *d;
+        p2m_type_t p2mt;
+        int is_curr_pvh = is_pvh_vcpu(current);
 
         if ( copy_from_guest(&xrfp, arg, 1) )
             return -EFAULT;
@@ -669,14 +671,22 @@ long do_memory_op(unsigned long cmd, XEN
 
         domain_lock(d);
 
-        page = get_page_from_gfn(d, xrfp.gpfn, NULL, P2M_ALLOC);
-        if ( page )
+        page = get_page_from_gfn(d, xrfp.gpfn, &p2mt, P2M_ALLOC);
+        if ( page || 
+             (is_curr_pvh && (p2m_is_mmio(p2mt) || p2m_is_foreign(p2mt))) )
         {
-            guest_physmap_remove_page(d, xrfp.gpfn, page_to_mfn(page), 0);
-            put_page(page);
+            unsigned long argmfn = page ? page_to_mfn(page) : INVALID_MFN;
+            guest_physmap_remove_page(d, xrfp.gpfn, argmfn, 0);
+            if (page)
+                put_page(page);
         }
-        else
+        else 
+        {
+            if ( is_curr_pvh )
+                gdprintk(XENLOG_WARNING, "%s: Domain:%u gmfn:%lx invalid\n",
+                         __FUNCTION__, current->domain->domain_id, xrfp.gpfn);
             rc = -ENOENT;
+        }
 
         domain_unlock(d);
 
diff -r 8b0762504037 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/drivers/passthrough/iommu.c	Wed Nov 14 11:03:24 2012 -0800
@@ -120,15 +120,25 @@ int iommu_domain_init(struct domain *d)
     return hd->platform_ops->init(d);
 }
 
+static inline void check_dom0_pvh_reqs(struct domain *d)
+{
+    if (!iommu_enabled || iommu_passthrough)
+        panic("For pvh dom0, iommu must be enabled, dom0-passthrough must "
+              "not be enabled \n");
+}
+
 void __init iommu_dom0_init(struct domain *d)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
 
+    if ( is_pvh_domain(d) )
+        check_dom0_pvh_reqs(d);
+
     if ( !iommu_enabled )
         return;
 
     register_keyhandler('o', &iommu_p2m_table);
-    d->need_iommu = !!iommu_dom0_strict;
+    d->need_iommu = is_pvh_domain(d) || !!iommu_dom0_strict;
     if ( need_iommu(d) )
     {
         struct page_info *page;
@@ -141,7 +151,10 @@ void __init iommu_dom0_init(struct domai
                  ((page->u.inuse.type_info & PGT_type_mask)
                   == PGT_writable_page) )
                 mapping |= IOMMUF_writable;
-            hd->platform_ops->map_page(d, mfn, mfn, mapping);
+            if ( is_pvh_domain(d) )
+                hd->platform_ops->map_page(d, mfn_to_gfn(d, mfn), mfn, mapping);
+            else
+                hd->platform_ops->map_page(d, mfn, mfn, mapping);
             if ( !(i++ & 0xfffff) )
                 process_pending_softirqs();
         }
diff -r 8b0762504037 xen/include/asm-x86/desc.h
--- a/xen/include/asm-x86/desc.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/desc.h	Wed Nov 14 11:03:24 2012 -0800
@@ -38,7 +38,8 @@
 
 #ifndef __ASSEMBLY__
 
-#define GUEST_KERNEL_RPL(d) (is_pv_32bit_domain(d) ? 1 : 3)
+#define GUEST_KERNEL_RPL(d) (is_pvh_domain(d) ? 0 : \
+                                                is_pv_32bit_domain(d) ? 1 : 3)
 
 /* Fix up the RPL of a guest segment selector. */
 #define __fixup_guest_selector(d, sel)                             \
diff -r 8b0762504037 xen/include/asm-x86/domain.h
--- a/xen/include/asm-x86/domain.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/domain.h	Wed Nov 14 11:03:24 2012 -0800
@@ -16,7 +16,7 @@
 #define is_pv_32on64_domain(d) (is_pv_32bit_domain(d))
 #define is_pv_32on64_vcpu(v)   (is_pv_32on64_domain((v)->domain))
 
-#define is_hvm_pv_evtchn_domain(d) (is_hvm_domain(d) && \
+#define is_hvm_pv_evtchn_domain(d) (is_hvm_or_pvh_domain(d) && \
         d->arch.hvm_domain.irq.callback_via_type == HVMIRQ_callback_vector)
 #define is_hvm_pv_evtchn_vcpu(v) (is_hvm_pv_evtchn_domain(v->domain))
 
@@ -252,10 +252,10 @@ struct arch_domain
 
     struct list_head pdev_list;
 
-    union {
-        struct pv_domain pv_domain;
-        struct hvm_domain hvm_domain;
-    };
+/* PVH fixme: pvh uses fields from both pv and hvm, so separate the union
+ * for now. make a separate pvh struct and put in HVM */
+    struct pv_domain pv_domain;
+    struct hvm_domain hvm_domain;
 
     struct paging_domain paging;
     struct p2m_domain *p2m;
@@ -396,10 +396,14 @@ struct arch_vcpu
     void (*ctxt_switch_to) (struct vcpu *);
 
     /* Virtual Machine Extensions */
+#if 0
     union {
+#endif
         struct pv_vcpu pv_vcpu;
         struct hvm_vcpu hvm_vcpu;
+#if 0
     };
+#endif
 
     /*
      * Every domain has a L1 pagetable of its own. Per-domain mappings
diff -r 8b0762504037 xen/include/asm-x86/event.h
--- a/xen/include/asm-x86/event.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/event.h	Wed Nov 14 11:03:24 2012 -0800
@@ -18,7 +18,7 @@ int hvm_local_events_need_delivery(struc
 static inline int local_events_need_delivery(void)
 {
     struct vcpu *v = current;
-    return (is_hvm_vcpu(v) ? hvm_local_events_need_delivery(v) :
+    return (is_hvm_or_pvh_vcpu(v) ? hvm_local_events_need_delivery(v) :
             (vcpu_info(v, evtchn_upcall_pending) &&
              !vcpu_info(v, evtchn_upcall_mask)));
 }
diff -r 8b0762504037 xen/include/asm-x86/guest_access.h
--- a/xen/include/asm-x86/guest_access.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/guest_access.h	Wed Nov 14 11:03:24 2012 -0800
@@ -14,27 +14,27 @@
 
 /* Raw access functions: no type checking. */
 #define raw_copy_to_guest(dst, src, len)        \
-    (is_hvm_vcpu(current) ?                     \
+    (is_hvm_or_pvh_vcpu(current) ?                     \
      copy_to_user_hvm((dst), (src), (len)) :    \
      copy_to_user((dst), (src), (len)))
 #define raw_copy_from_guest(dst, src, len)      \
-    (is_hvm_vcpu(current) ?                     \
+    (is_hvm_or_pvh_vcpu(current) ?                     \
      copy_from_user_hvm((dst), (src), (len)) :  \
      copy_from_user((dst), (src), (len)))
 #define raw_clear_guest(dst,  len)              \
-    (is_hvm_vcpu(current) ?                     \
+    (is_hvm_or_pvh_vcpu(current) ?                     \
      clear_user_hvm((dst), (len)) :             \
      clear_user((dst), (len)))
 #define __raw_copy_to_guest(dst, src, len)      \
-    (is_hvm_vcpu(current) ?                     \
+    (is_hvm_or_pvh_vcpu(current) ?                     \
      copy_to_user_hvm((dst), (src), (len)) :    \
      __copy_to_user((dst), (src), (len)))
 #define __raw_copy_from_guest(dst, src, len)    \
-    (is_hvm_vcpu(current) ?                     \
+    (is_hvm_or_pvh_vcpu(current) ?                     \
      copy_from_user_hvm((dst), (src), (len)) :  \
      __copy_from_user((dst), (src), (len)))
 #define __raw_clear_guest(dst,  len)            \
-    (is_hvm_vcpu(current) ?                     \
+    (is_hvm_or_pvh_vcpu(current) ?                     \
      clear_user_hvm((dst), (len)) :             \
      clear_user((dst), (len)))
 
diff -r 8b0762504037 xen/include/asm-x86/hap.h
--- a/xen/include/asm-x86/hap.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/hap.h	Wed Nov 14 11:03:24 2012 -0800
@@ -63,6 +63,7 @@ int   hap_track_dirty_vram(struct domain
                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
 
 extern const struct paging_mode *hap_paging_get_mode(struct vcpu *);
+void hap_set_pvh_alloc_for_dom0(struct domain *d, unsigned long num_pages);
 
 #endif /* XEN_HAP_H */
 
diff -r 8b0762504037 xen/include/asm-x86/hvm/hvm.h
--- a/xen/include/asm-x86/hvm/hvm.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/hvm/hvm.h	Wed Nov 14 11:03:24 2012 -0800
@@ -183,6 +183,13 @@ struct hvm_function_table {
     /* Virtual interrupt delivery */
     void (*update_eoi_exit_bitmap)(struct vcpu *v, u8 vector, u8 trig);
     int (*virtual_intr_delivery_enabled)(void);
+
+    /* PVH functions */
+    void (*pvh_update_cr3)(struct vcpu *v);
+    int (*pvh_set_vcpu_info)(struct vcpu *v, struct vcpu_guest_context *ctxtp);
+    int (*pvh_read_descriptor)(unsigned int sel, const struct vcpu *v,
+                         const struct cpu_user_regs *regs, unsigned long *base,
+                         unsigned long *limit, unsigned int *ar);
 };
 
 extern struct hvm_function_table hvm_funcs;
@@ -316,6 +323,24 @@ static inline unsigned long hvm_get_shad
     return hvm_funcs.get_shadow_gs_base(v);
 }
 
+static inline void hvm_pvh_update_cr3(struct vcpu *v)
+{
+    hvm_funcs.pvh_update_cr3(v);
+}
+
+static inline int hvm_pvh_set_vcpu_info(struct vcpu *v, 
+                                        struct vcpu_guest_context *ctxtp)
+{
+    return hvm_funcs.pvh_set_vcpu_info(v, ctxtp);
+}
+
+static inline int hvm_pvh_read_descriptor(unsigned int sel, 
+               const struct vcpu *v, const struct cpu_user_regs *regs, 
+               unsigned long *base, unsigned long *limit, unsigned int *ar)
+{
+    return hvm_funcs.pvh_read_descriptor(sel, v, regs, base, limit, ar);
+}
+
 #define is_viridian_domain(_d)                                             \
  (is_hvm_domain(_d) && ((_d)->arch.hvm_domain.params[HVM_PARAM_VIRIDIAN]))
 
diff -r 8b0762504037 xen/include/asm-x86/hvm/vcpu.h
--- a/xen/include/asm-x86/hvm/vcpu.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/hvm/vcpu.h	Wed Nov 14 11:03:24 2012 -0800
@@ -104,6 +104,17 @@ struct nestedvcpu {
 
 #define vcpu_nestedhvm(v) ((v)->arch.hvm_vcpu.nvcpu)
 
+struct pvh_hvm_vcpu_ext
+{
+    /* I/O-port access bitmap. */
+    XEN_GUEST_HANDLE(uint8) iobmp;  /* Guest kernel vaddr of the bitmap. */
+    unsigned int pvh_iobmp_limit;   /* Number of ports in the bitmap. */
+    unsigned int pvh_iopl;          /* Current IOPL for this VCPU. */
+
+    /* Guest-specified relocation of vcpu_info. */
+    unsigned long pvh_vcpu_info_mfn;
+};
+
 struct hvm_vcpu {
     /* Guest control-register and EFER values, just as the guest sees them. */
     unsigned long       guest_cr[5];
@@ -170,6 +181,8 @@ struct hvm_vcpu {
     struct hvm_trap     inject_trap;
 
     struct viridian_vcpu viridian;
+
+    struct pvh_hvm_vcpu_ext hv_pvh;
 };
 
 #endif /* __ASM_X86_HVM_VCPU_H__ */
diff -r 8b0762504037 xen/include/asm-x86/hvm/vmx/pvh.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/asm-x86/hvm/vmx/pvh.h	Wed Nov 14 11:03:24 2012 -0800
@@ -0,0 +1,11 @@
+#ifndef __ASM_X86_HVM_VMX_PVH_H__
+#define __ASM_X86_HVM_VMX_PVH_H__
+    
+void vmx_pvh_update_cr3(struct vcpu *v);
+int vmx_pvh_set_vcpu_info(struct vcpu *v, struct vcpu_guest_context *ctxtp);
+int vmx_pvh_read_descriptor(unsigned int sel, const struct vcpu *v,
+                         const struct cpu_user_regs *regs, unsigned long *base,
+                         unsigned long *limit, unsigned int *ar);
+#endif /* __ASM_X86_HVM_VMX_PVH_H__ */
+
+
diff -r 8b0762504037 xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Wed Nov 14 11:03:24 2012 -0800
@@ -413,6 +413,7 @@ int vmx_write_guest_msr(u32 msr, u64 val
 int vmx_add_guest_msr(u32 msr);
 int vmx_add_host_load_msr(u32 msr);
 void vmx_vmcs_switch(struct vmcs_struct *from, struct vmcs_struct *to);
+void vmx_fpu_enter(struct vcpu *v);
 void vmx_set_eoi_exit_bitmap(struct vcpu *v, u8 vector);
 void vmx_clear_eoi_exit_bitmap(struct vcpu *v, u8 vector);
 
diff -r 8b0762504037 xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Wed Nov 14 11:03:24 2012 -0800
@@ -156,11 +156,28 @@ void vmx_update_cpu_exec_control(struct 
 # define VMX_CONTROL_REG_ACCESS_TYPE_LMSW        3
  /* 10:8 - general purpose register operand */
 #define VMX_CONTROL_REG_ACCESS_GPR(eq)  (((eq) >> 8) & 0xf)
+#define VMX_CONTROL_REG_ACCESS_GPR_EAX  0
+#define VMX_CONTROL_REG_ACCESS_GPR_ECX  1
+#define VMX_CONTROL_REG_ACCESS_GPR_EDX  2
+#define VMX_CONTROL_REG_ACCESS_GPR_EBX  3
+#define VMX_CONTROL_REG_ACCESS_GPR_ESP  4
+#define VMX_CONTROL_REG_ACCESS_GPR_EBP  5
+#define VMX_CONTROL_REG_ACCESS_GPR_ESI  6
+#define VMX_CONTROL_REG_ACCESS_GPR_EDI  7
+#define VMX_CONTROL_REG_ACCESS_GPR_R8   8
+#define VMX_CONTROL_REG_ACCESS_GPR_R9   9
+#define VMX_CONTROL_REG_ACCESS_GPR_R10  10
+#define VMX_CONTROL_REG_ACCESS_GPR_R11  11
+#define VMX_CONTROL_REG_ACCESS_GPR_R12  12
+#define VMX_CONTROL_REG_ACCESS_GPR_R13  13
+#define VMX_CONTROL_REG_ACCESS_GPR_R14  14
+#define VMX_CONTROL_REG_ACCESS_GPR_R15  15
 
 /*
  * Access Rights
  */
 #define X86_SEG_AR_SEG_TYPE     0xf        /* 3:0, segment type */
+#define X86_SEG_AR_SEG_TYPE_CODE (1u << 3) /* code (vs data) segment */
 #define X86_SEG_AR_DESC_TYPE    (1u << 4)  /* 4, descriptor type */
 #define X86_SEG_AR_DPL          0x60       /* 6:5, descriptor privilege level */
 #define X86_SEG_AR_SEG_PRESENT  (1u << 7)  /* 7, segment present */
@@ -389,6 +406,26 @@ static inline int __vmxon(u64 addr)
     return rc;
 }
 
+static inline unsigned long vmr(unsigned long field)
+{
+    int rc;
+    unsigned long val;
+    val = __vmread_safe(field, &rc);
+    return rc ? 0 : val;
+}
+
+/*
+ * Not all cases receive valid value in the VM-exit instruction length field.
+ * Callers must know what they're doing!
+ */
+static inline int get_instruction_length(void)
+{
+    int len;
+    len = __vmread(VM_EXIT_INSTRUCTION_LEN); /* Safe: callers audited */
+    BUG_ON((len < 1) || (len > 15));
+    return len;
+}
+
 void vmx_get_segment_register(struct vcpu *, enum x86_segment,
                               struct segment_register *);
 void vmx_inject_extint(int trap);
@@ -398,6 +435,11 @@ void ept_p2m_init(struct p2m_domain *p2m
 void ept_walk_table(struct domain *d, unsigned long gfn);
 void setup_ept_dump(void);
 
+void update_guest_eip(void);
+void pvh_vmx_vmexit_handler(struct cpu_user_regs *regs);
+void vmx_dr_access(unsigned long exit_qualification,struct cpu_user_regs *regs);
+void vmx_do_extint(struct cpu_user_regs *regs);
+
 /* EPT violation qualifications definitions */
 #define _EPT_READ_VIOLATION         0
 #define EPT_READ_VIOLATION          (1UL<<_EPT_READ_VIOLATION)
diff -r 8b0762504037 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/p2m.h	Wed Nov 14 11:03:24 2012 -0800
@@ -70,6 +70,7 @@ typedef enum {
     p2m_ram_paging_in = 11,       /* Memory that is being paged in */
     p2m_ram_shared = 12,          /* Shared or sharable memory */
     p2m_ram_broken = 13,          /* Broken page, access cause domain crash */
+    p2m_map_foreign  = 14,        /* ram pages from foreign domain */
 } p2m_type_t;
 
 /*
@@ -180,6 +181,7 @@ typedef unsigned int p2m_query_t;
 #define p2m_is_sharable(_t) (p2m_to_mask(_t) & P2M_SHARABLE_TYPES)
 #define p2m_is_shared(_t)   (p2m_to_mask(_t) & P2M_SHARED_TYPES)
 #define p2m_is_broken(_t)   (p2m_to_mask(_t) & P2M_BROKEN_TYPES)
+#define p2m_is_foreign(_t)  (p2m_to_mask(_t) & p2m_to_mask(p2m_map_foreign))
 
 /* Per-p2m-table state */
 struct p2m_domain {
@@ -506,6 +508,8 @@ p2m_type_t p2m_change_type(struct domain
 int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
 int clear_mmio_p2m_entry(struct domain *d, unsigned long gfn);
 
+/* Set foreign mfn in the current guest's p2m table (for pvh dom0) */
+int set_foreign_p2m_entry(struct domain *domp, unsigned long gfn, mfn_t mfn);
 
 /* 
  * Populate-on-demand
diff -r 8b0762504037 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/processor.h	Wed Nov 14 11:03:24 2012 -0800
@@ -545,12 +545,14 @@ extern int hypercall(void);
 
 int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx,
           uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx);
+void pv_cpuid(struct cpu_user_regs *regs);
 int rdmsr_hypervisor_regs(uint32_t idx, uint64_t *val);
 int wrmsr_hypervisor_regs(uint32_t idx, uint64_t val);
 
 void microcode_set_module(unsigned int);
 int microcode_update(XEN_GUEST_HANDLE_PARAM(const_void), unsigned long len);
 int microcode_resume_cpu(int cpu);
+int emulate_forced_invalid_op(struct cpu_user_regs *regs);
 
 #endif /* !__ASSEMBLY__ */
 
diff -r 8b0762504037 xen/include/asm-x86/system.h
--- a/xen/include/asm-x86/system.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/system.h	Wed Nov 14 11:03:24 2012 -0800
@@ -4,9 +4,15 @@
 #include <xen/lib.h>
 #include <asm/bitops.h>
 
-#define read_segment_register(name)                             \
+/* We need vcpu because during context switch, going from pure pv to pvh,
+ * in save_segments(), current has been updated to next, and no longer pointing
+ * to the pure pv. Btw, for pvh, we update regs->selectors on each vmexit */
+#define read_segment_register(vcpu, regs, name)                 \
 ({  u16 __sel;                                                  \
-    asm volatile ( "movw %%" STR(name) ",%0" : "=r" (__sel) );  \
+    if (is_pvh_vcpu(v))                                         \
+        __sel = regs->name;                                     \
+    else                                                         \
+        asm volatile ( "movw %%" STR(name) ",%0" : "=r" (__sel) );  \
     __sel;                                                      \
 })
 
diff -r 8b0762504037 xen/include/asm-x86/traps.h
--- a/xen/include/asm-x86/traps.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/traps.h	Wed Nov 14 11:03:24 2012 -0800
@@ -48,5 +48,6 @@ extern int guest_has_trap_callback(struc
  */
 extern int send_guest_trap(struct domain *d, uint16_t vcpuid,
 				unsigned int trap_nr);
+int emulate_privileged_op(struct cpu_user_regs *regs);
 
 #endif /* ASM_TRAP_H */
diff -r 8b0762504037 xen/include/asm-x86/x86_64/regs.h
--- a/xen/include/asm-x86/x86_64/regs.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/x86_64/regs.h	Wed Nov 14 11:03:24 2012 -0800
@@ -11,9 +11,10 @@
 #define ring_3(r)    (((r)->cs & 3) == 3)
 
 #define guest_kernel_mode(v, r)                                 \
+   ( is_pvh_vcpu(v) ? ({BUG_ON(v!=current); ring_0(r);}) :  \
     (!is_pv_32bit_vcpu(v) ?                                     \
      (ring_3(r) && ((v)->arch.flags & TF_kernel_mode)) :        \
-     (ring_1(r)))
+     (ring_1(r))) )
 
 #define permit_softint(dpl, v, r) \
     ((dpl) >= (guest_kernel_mode(v, r) ? 1 : 3))
diff -r 8b0762504037 xen/include/public/arch-x86/xen.h
--- a/xen/include/public/arch-x86/xen.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/public/arch-x86/xen.h	Wed Nov 14 11:03:24 2012 -0800
@@ -157,7 +157,16 @@ struct vcpu_guest_context {
     struct cpu_user_regs user_regs;         /* User-level CPU registers     */
     struct trap_info trap_ctxt[256];        /* Virtual IDT                  */
     unsigned long ldt_base, ldt_ents;       /* LDT (linear address, # ents) */
-    unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */
+    union {
+        struct {
+            /* GDT (machine frames, # ents) */
+            unsigned long gdt_frames[16], gdt_ents;
+        } pv;
+        struct {
+            /* PVH: GDTR addr and size */   
+            unsigned long gdtaddr, gdtsz;
+        } pvh;
+    } u;
     unsigned long kernel_ss, kernel_sp;     /* Virtual TSS (only SS1/SP1)   */
     /* NB. User pagetable on x86/64 is placed in ctrlreg[1]. */
     unsigned long ctrlreg[8];               /* CR0-CR7 (control registers)  */
diff -r 8b0762504037 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/public/domctl.h	Wed Nov 14 11:03:24 2012 -0800
@@ -59,6 +59,10 @@ struct xen_domctl_createdomain {
  /* Disable out-of-sync shadow page tables? */
 #define _XEN_DOMCTL_CDF_oos_off       3
 #define XEN_DOMCTL_CDF_oos_off        (1U<<_XEN_DOMCTL_CDF_oos_off)
+ /* Is this a PV guest in HVM container, aka, a pvh guest? */
+ #define _XEN_DOMCTL_CDF_pvh_guest    4
+ #define XEN_DOMCTL_CDF_pvh_guest     (1U<<_XEN_DOMCTL_CDF_pvh_guest)
+
     uint32_t flags;
 };
 typedef struct xen_domctl_createdomain xen_domctl_createdomain_t;
@@ -89,6 +93,10 @@ struct xen_domctl_getdomaininfo {
  /* Being debugged.  */
 #define _XEN_DOMINF_debugged  6
 #define XEN_DOMINF_debugged   (1U<<_XEN_DOMINF_debugged)
+ /* domain is PVH */
+#define _XEN_DOMINF_pvh_guest 7
+#define XEN_DOMINF_pvh_guest   (1U<<_XEN_DOMINF_pvh_guest)
+
  /* XEN_DOMINF_shutdown guest-supplied code.  */
 #define XEN_DOMINF_shutdownmask 255
 #define XEN_DOMINF_shutdownshift 16
diff -r 8b0762504037 xen/include/public/physdev.h
--- a/xen/include/public/physdev.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/public/physdev.h	Wed Nov 14 11:03:24 2012 -0800
@@ -330,6 +330,19 @@ struct physdev_dbgp_op {
 typedef struct physdev_dbgp_op physdev_dbgp_op_t;
 DEFINE_XEN_GUEST_HANDLE(physdev_dbgp_op_t);
 
+ 
+#define PHYSDEVOP_pvh_map_iomem        30
+struct physdev_map_iomem {
+    /* IN */
+    unsigned long first_gfn;
+    unsigned long first_mfn;
+    unsigned int nr_mfns;
+    unsigned int add_mapping;        /* 1 == add mapping;  0 == unmap */
+
+};
+typedef struct physdev_map_iomem physdev_map_iomem_t;
+DEFINE_XEN_GUEST_HANDLE(physdev_map_iomem_t);
+
 /*
  * Notify that some PIRQ-bound event channels have been unmasked.
  * ** This command is obsolete since interface version 0x00030202 and is **
diff -r 8b0762504037 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/public/xen.h	Wed Nov 14 11:03:24 2012 -0800
@@ -723,6 +723,7 @@ typedef struct start_info start_info_t;
 #define SIF_INITDOMAIN    (1<<1)  /* Is this the initial control domain? */
 #define SIF_MULTIBOOT_MOD (1<<2)  /* Is mod_start a multiboot module? */
 #define SIF_MOD_START_PFN (1<<3)  /* Is mod_start a PFN? */
+#define SIF_IS_PVH        (1<<4)  /* Is it a PVH guest? */
 #define SIF_PM_MASK       (0xFF<<8) /* reserve 1 byte for xen-pm options */
 
 /*
diff -r 8b0762504037 xen/include/xen/domain.h
--- a/xen/include/xen/domain.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/xen/domain.h	Wed Nov 14 11:03:24 2012 -0800
@@ -86,4 +86,7 @@ extern unsigned int xen_processor_pmbits
 
 extern bool_t opt_dom0_vcpus_pin;
 
+extern long domctl_memory_mapping(struct domain *d, unsigned long gfn,
+                    unsigned long mfn, unsigned long nr_mfns, int add_map);
+
 #endif /* __XEN_DOMAIN_H__ */
diff -r 8b0762504037 xen/include/xen/lib.h
--- a/xen/include/xen/lib.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/xen/lib.h	Wed Nov 14 11:03:24 2012 -0800
@@ -45,6 +45,10 @@ do {                                    
 #define ASSERT(p) do { if ( 0 && (p) ); } while (0)
 #endif
 
+/* While PVH feature is experimental, make it an unconditional assert */
+#define PVH_ASSERT(p) \
+    do { if ( unlikely(!(p)) ) assert_failed(#p); } while (0)
+
 #define ABS(_x) ({                              \
     typeof(_x) __x = (_x);                      \
     (__x < 0) ? -__x : __x;                     \
diff -r 8b0762504037 xen/include/xen/libelf.h
--- a/xen/include/xen/libelf.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/xen/libelf.h	Wed Nov 14 11:03:24 2012 -0800
@@ -192,13 +192,14 @@ int elf_phdr_is_loadable(struct elf_bina
 int elf_init(struct elf_binary *elf, const char *image, size_t size);
 #ifdef __XEN__
 void elf_set_verbose(struct elf_binary *elf);
+int elf_load_binary(struct elf_binary *elf, int is_pvh_dom0);
 #else
 void elf_set_log(struct elf_binary *elf, elf_log_callback*,
                  void *log_caller_pointer, int verbose);
+int elf_load_binary(struct elf_binary *elf);
 #endif
 
 void elf_parse_binary(struct elf_binary *elf);
-int elf_load_binary(struct elf_binary *elf);
 
 void *elf_get_ptr(struct elf_binary *elf, unsigned long addr);
 uint64_t elf_lookup_addr(struct elf_binary *elf, const char *symbol);
diff -r 8b0762504037 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/xen/sched.h	Wed Nov 14 11:03:24 2012 -0800
@@ -230,6 +230,9 @@ struct mem_event_per_domain
     struct mem_event_domain access;
 };
 
+/* PVH: is a PV guest running in HVM container. is_hvm is false for it. 
+ *      But it uses few of the HVM data structs.
+ */
 struct domain
 {
     domid_t          domain_id;
@@ -278,6 +281,7 @@ struct domain
 
     /* Is this an HVM guest? */
     bool_t           is_hvm;
+    bool_t           is_pvh;      /* see above for description */
 #ifdef HAS_PASSTHROUGH
     /* Does this guest need iommu mappings? */
     bool_t           need_iommu;
@@ -449,6 +453,10 @@ struct domain *domain_create(
  /* DOMCRF_oos_off: dont use out-of-sync optimization for shadow page tables */
 #define _DOMCRF_oos_off         4
 #define DOMCRF_oos_off          (1U<<_DOMCRF_oos_off)
+ /* DOMCRF_pvh: Create PV domain in HVM container */
+#define _DOMCRF_pvh            5
+#define DOMCRF_pvh             (1U<<_DOMCRF_pvh)
+
 
 /*
  * rcu_lock_domain_by_id() is more efficient than get_domain_by_id().
@@ -716,8 +724,12 @@ void watchdog_domain_destroy(struct doma
 
 #define is_hvm_domain(d) ((d)->is_hvm)
 #define is_hvm_vcpu(v)   (is_hvm_domain(v->domain))
+#define is_pvh_domain(d) ((d)->is_pvh)
+#define is_pvh_vcpu(v)   (is_pvh_domain(v->domain))
 #define is_pinned_vcpu(v) ((v)->domain->is_pinned || \
                            cpumask_weight((v)->cpu_affinity) == 1)
+#define is_hvm_or_pvh_domain(d) (is_hvm_domain(d) || is_pvh_domain(d))
+#define is_hvm_or_pvh_vcpu(v) (is_hvm_or_pvh_domain(v->domain))
 #ifdef HAS_PASSTHROUGH
 #define need_iommu(d)    ((d)->need_iommu)
 #else
diff -r 8b0762504037 xen/kdb/include/kdb_extern.h
--- a/xen/kdb/include/kdb_extern.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/kdb/include/kdb_extern.h	Wed Nov 14 11:03:24 2012 -0800
@@ -59,8 +59,5 @@ static inline void __vmptrst(u64 *addr)
 }
 
 extern void mukchk(unsigned long);
-#define is_hvm_or_hyb_domain is_hvm_domain
-#define is_hvm_or_hyb_vcpu is_hvm_vcpu
-
 
 #endif  /* _KDB_EXTERN_H */
diff -r 8b0762504037 xen/kdb/kdb_cmds.c
--- a/xen/kdb/kdb_cmds.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/kdb/kdb_cmds.c	Wed Nov 14 11:03:24 2012 -0800
@@ -317,7 +317,7 @@ kdb_guest_bitness(domid_t domid)
 
     if (is_idle_domain(dp))
         retval = HYPSZ;
-    else if (is_hvm_or_hyb_domain(dp))
+    else if (is_hvm_or_pvh_domain(dp))
         retval = (hvm_long_mode_enabled(dp->vcpu[0])) ? HYPSZ : 32;
     else 
         retval = is_pv_32bit_domain(dp) ? 32 : HYPSZ;
@@ -977,7 +977,7 @@ kdb_cmdf_ss(int argc, const char **argv,
         kdbp("kdb: Failed to read byte at: %lx\n", regs->KDBIP);
         return KDB_CPU_MAIN_KDB;
     }
-    if (guest_mode(regs) && is_hvm_or_hyb_vcpu(current)) {
+    if (guest_mode(regs) && is_hvm_or_pvh_vcpu(current)) {
         dp->debugger_attached = 1;  /* see svm_do_resume/vmx_do_ */
         current->arch.hvm_vcpu.single_step = 1;
     } else
@@ -1016,7 +1016,7 @@ kdb_cmdf_ni(int argc, const char **argv,
         return KDB_CPU_MAIN_KDB;
 
     kdb_sbpa[i].bp_ni = 1;
-    if (guest_mode(regs) && is_hvm_or_hyb_vcpu(current))
+    if (guest_mode(regs) && is_hvm_or_pvh_vcpu(current))
         current->arch.hvm_vcpu.single_step = 0;
     else
         regs->eflags &= ~X86_EFLAGS_TF;
@@ -1052,7 +1052,7 @@ kdb_cmdf_ssb(int argc, const char **argv
         kdbp("%s: regs not available\n", __FUNCTION__);
         return KDB_CPU_MAIN_KDB;
     }
-    if (is_hvm_or_hyb_vcpu(current)) 
+    if (is_hvm_or_pvh_vcpu(current)) 
         current->domain->debugger_attached = 1;        /* vmx/svm_do_resume()*/
 
     regs->eflags |= X86_EFLAGS_TF;
@@ -1655,7 +1655,7 @@ kdb_set_bp(domid_t domid, kdbva_t addr, 
         return KDBMAXSBP;
     }
     /* make sure swbp reporting is enabled in the vmcb/vmcs */
-    if (is_hvm_or_hyb_domain(kdb_domid2ptr(domid))) {
+    if (is_hvm_or_pvh_domain(kdb_domid2ptr(domid))) {
         struct domain *dp = kdb_domid2ptr(domid);
         dp->debugger_attached = 1;              /* see svm_do_resume/vmx_do_ */
         KDBGP("debugger_attached set. domid:%d\n", domid);
@@ -1708,7 +1708,7 @@ kdb_cmdf_bp(int argc, const char **argv,
     if (domidstrp && !kdb_str2domid(domidstrp, &domid, 1)) {
         return kdb_usgf_bp();
     }
-    if (argc > 3 && is_hvm_or_hyb_domain(kdb_domid2ptr(domid))) {
+    if (argc > 3 && is_hvm_or_pvh_domain(kdb_domid2ptr(domid))) {
         kdbp("HVM domain not supported yet for conditional bp\n");
         return KDB_CPU_MAIN_KDB;
     }
@@ -1756,7 +1756,7 @@ kdb_cmdf_btp(int argc, const char **argv
     argsidx = 2;                   /* assume 3rd arg is not domid */
     if (argc > 3 && kdb_str2domid(argv[2], &domid, 0)) {
 
-        if (is_hvm_or_hyb_domain(kdb_domid2ptr(domid))) {
+        if (is_hvm_or_pvh_domain(kdb_domid2ptr(domid))) {
             kdbp("HVM domains are not currently supprted\n");
             return KDB_CPU_MAIN_KDB;
         } else
@@ -1889,6 +1889,73 @@ kdb_cmdf_wc(int argc, const char **argv,
     return KDB_CPU_MAIN_KDB;
 }
 
+static void
+kdb_display_hvm_vcpu(struct vcpu *vp)
+{
+    struct hvm_vcpu *hvp;
+    struct vlapic *vlp;
+    struct hvm_io_op *ioop;
+
+    hvp = &vp->arch.hvm_vcpu;
+    vlp = &hvp->vlapic;
+    kdbp("vcpu:%lx id:%d domid:%d\n", vp, vp->vcpu_id, vp->domain->domain_id);
+
+    if (is_pvh_vcpu(vp)) {
+        struct pvh_hvm_vcpu_ext *hp = &hvp->hv_pvh;
+        kdbp("    &pvh_ext:%p limit:%x iopl:%x vcpu_info_mfn:%lx\n",
+             hp, hp->pvh_iobmp_limit, hp->pvh_iopl, hp->pvh_vcpu_info_mfn);
+    }
+
+    ioop = NULL;   /* compiler warning */
+    kdbp("    &hvm_vcpu:%lx  guest_efer:"KDBFL"\n", hvp, hvp->guest_efer);
+    kdbp("      guest_cr: [0]:"KDBFL" [1]:"KDBFL" [2]:"KDBFL"\n", 
+         hvp->guest_cr[0], hvp->guest_cr[1],hvp->guest_cr[2]);
+    kdbp("                [3]:"KDBFL" [4]:"KDBFL"\n", hvp->guest_cr[3],
+         hvp->guest_cr[4]);
+    kdbp("      hw_cr: [0]:"KDBFL" [1]:"KDBFL" [2]:"KDBFL"\n", hvp->hw_cr[0],
+         hvp->hw_cr[1], hvp->hw_cr[2]);
+    kdbp("              [3]:"KDBFL" [4]:"KDBFL"\n", hvp->hw_cr[3], 
+         hvp->hw_cr[4]);
+
+    kdbp("      VLAPIC: base msr:"KDBF64" dis:%x tmrdiv:%x\n", 
+         vlp->hw.apic_base_msr, vlp->hw.disabled, vlp->hw.timer_divisor);
+    kdbp("          regs:%p regs_page:%p\n", vlp->regs, vlp->regs_page);
+    kdbp("          periodic time:\n"); 
+    kdb_prnt_periodic_time(&vlp->pt);
+
+    kdbp("      xen_port:%x flag_dr_dirty:%x dbg_st_latch:%x\n", hvp->xen_port,
+         hvp->flag_dr_dirty, hvp->debug_state_latch);
+
+    if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
+
+        struct arch_vmx_struct *vxp = &hvp->u.vmx;
+        kdbp("      &vmx: %p vmcs:%lx active_cpu:%x launched:%x\n", vxp, 
+             vxp->vmcs, vxp->active_cpu, vxp->launched);
+#if XEN_VERSION != 4               /* xen 3.x.x */
+        kdbp("        exec_ctrl:%x vpid:$%d\n", vxp->exec_control, vxp->vpid);
+#endif
+        kdbp("        host_cr0: "KDBFL" vmx: {realm:%x emulate:%x}\n",
+             vxp->host_cr0, vxp->vmx_realmode, vxp->vmx_emulate);
+
+#ifdef __x86_64__
+        kdbp("        &msr_state:%p exception_bitmap:%lx\n", &vxp->msr_state,
+             vxp->exception_bitmap);
+#endif
+    } else if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) {
+        struct arch_svm_struct *svp = &hvp->u.svm;
+#if XEN_VERSION != 4               /* xen 3.x.x */
+        kdbp("  &svm: vmcb:%lx pa:"KDBF64" asid:"KDBF64"\n", svp, svp->vmcb,
+             svp->vmcb_pa, svp->asid_generation);
+#endif
+        kdbp("    msrpm:%p lnch_core:%x vmcb_sync:%x\n", svp->msrpm, 
+             svp->launch_core, svp->vmcb_in_sync);
+    }
+    kdbp("      cachemode:%x io: {state: %x data: "KDBFL"}\n", hvp->cache_mode,
+         hvp->hvm_io.io_state, hvp->hvm_io.io_data);
+    kdbp("      mmio: {gva: "KDBFL" gpfn: "KDBFL"}\n", hvp->hvm_io.mmio_gva,
+         hvp->hvm_io.mmio_gpfn);
+}
+
 /* display struct hvm_vcpu{} in struct vcpu.arch{} */
 static kdb_cpu_cmd_t
 kdb_usgf_vcpuh(void)
@@ -1900,71 +1967,17 @@ static kdb_cpu_cmd_t
 kdb_cmdf_vcpuh(int argc, const char **argv, struct cpu_user_regs *regs)
 {
     struct vcpu *vp;
-    struct hvm_vcpu *hvp;
-    struct hvm_io_op *ioop;
-    struct vlapic *vlp;
 
     if (argc < 2 || *argv[1] == '?') 
         return kdb_usgf_vcpuh();
 
     if (!kdb_str2ulong(argv[1], (ulong *)&vp) || !kdb_vcpu_valid(vp) ||
-        !is_hvm_or_hyb_vcpu(vp)) {
+        !is_hvm_or_pvh_vcpu(vp)) {
 
         kdbp("kdb: Bad VCPU: %s\n", argv[1]);
         return KDB_CPU_MAIN_KDB;
     }
-
-    hvp = &vp->arch.hvm_vcpu;
-    vlp = &hvp->vlapic;
-    kdbp("vcpu:%lx id:%d domid:%d\n", vp, vp->vcpu_id, vp->domain->domain_id);
-
-    ioop = NULL;   /* compiler warning */
-    kdbp("&hvm_vcpu:%lx  guest_efer:"KDBFL"\n", hvp, hvp->guest_efer);
-    kdbp("  guest_cr: [0]:"KDBFL" [1]:"KDBFL" [2]:"KDBFL"\n", hvp->guest_cr[0],
-         hvp->guest_cr[1],hvp->guest_cr[2]);
-    kdbp("            [3]:"KDBFL" [4]:"KDBFL"\n", hvp->guest_cr[3],
-         hvp->guest_cr[4]);
-    kdbp("  hw_cr: [0]:"KDBFL" [1]:"KDBFL" [2]:"KDBFL"\n", hvp->hw_cr[0],
-         hvp->hw_cr[1], hvp->hw_cr[2]);
-    kdbp("          [3]:"KDBFL" [4]:"KDBFL"\n", hvp->hw_cr[3], hvp->hw_cr[4]);
-
-    kdbp("  VLAPIC: base msr:"KDBF64" dis:%x tmrdiv:%x\n", 
-         vlp->hw.apic_base_msr, vlp->hw.disabled, vlp->hw.timer_divisor);
-    kdbp("          regs:%p regs_page:%p\n", vlp->regs, vlp->regs_page);
-    kdbp("          periodic time:\n"); 
-    kdb_prnt_periodic_time(&vlp->pt);
-
-    kdbp("  xen_port:%x flag_dr_dirty:%x dbg_st_latch:%x\n", hvp->xen_port,
-         hvp->flag_dr_dirty, hvp->debug_state_latch);
-
-    if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
-
-        struct arch_vmx_struct *vxp = &hvp->u.vmx;
-        kdbp("  &vmx: %p vmcs:%lx active_cpu:%x launched:%x\n", vxp, vxp->vmcs, 
-             vxp->active_cpu, vxp->launched);
-#if XEN_VERSION != 4               /* xen 3.x.x */
-        kdbp("    exec_ctrl:%x vpid:$%d\n", vxp->exec_control, vxp->vpid);
-#endif
-        kdbp("    host_cr0: "KDBFL" vmx: {realm:%x emulate:%x}\n",
-             vxp->host_cr0, vxp->vmx_realmode, vxp->vmx_emulate);
-
-#ifdef __x86_64__
-        kdbp("    &msr_state:%p\n", &vxp->msr_state);
-#endif
-    } else if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) {
-        struct arch_svm_struct *svp = &hvp->u.svm;
-#if XEN_VERSION != 4               /* xen 3.x.x */
-        kdbp("  &svm: vmcb:%lx pa:"KDBF64" asid:"KDBF64"\n", svp, svp->vmcb,
-             svp->vmcb_pa, svp->asid_generation);
-#endif
-        kdbp("    msrpm:%p lnch_core:%x vmcb_sync:%x\n", svp->msrpm, 
-             svp->launch_core, svp->vmcb_in_sync);
-    }
-    kdbp("  cachemode:%x io: {state: %x data: "KDBFL"}\n", hvp->cache_mode,
-         hvp->hvm_io.io_state, hvp->hvm_io.io_data);
-    kdbp("  mmio: {gva: "KDBFL" gpfn: "KDBFL"}\n", hvp->hvm_io.mmio_gva,
-         hvp->hvm_io.mmio_gpfn);
-
+    kdb_display_hvm_vcpu(vp);
     return KDB_CPU_MAIN_KDB;
 }
 
@@ -2094,7 +2107,7 @@ kdb_display_vcpu(struct vcpu *vp)
     kdbp("  arch info: (%p)\n", &vp->arch);
     kdbp("    guest_context: VGCF_ flags:%lx", 
          vp->arch.vgc_flags); /* VGCF_in_kernel */
-    if (is_hvm_or_hyb_vcpu(vp))
+    if (is_hvm_or_pvh_vcpu(vp))
         kdbp("    (HVM guest: IP, SP, EFLAGS may be stale)");
     kdbp("\n");
     kdb_print_uregs(&vp->arch.user_regs);
@@ -2102,7 +2115,11 @@ kdb_display_vcpu(struct vcpu *vp)
     for (i=0; i < 8; i=i+4)
         kdbp("          %016lx %016lx %016lx %016lx\n", avp->debugreg[i], 
              avp->debugreg[i+1], avp->debugreg[i+2], avp->debugreg[i+3]);
-    kdb_display_pv_vcpu(vp);
+
+    if (is_hvm_or_pvh_vcpu(vp))
+        kdb_display_hvm_vcpu(vp);
+    else
+        kdb_display_pv_vcpu(vp);
 
     kdbp("    TF_flags: %016lx  guest_table: %016lx cr3:%016lx\n", 
          vp->arch.flags, vp->arch.guest_table.pfn, avp->cr3); 
@@ -2291,6 +2308,21 @@ static void kdb_pr_vtsc_info(struct arch
          ap->vtsc_kerncount, ap->vtsc_usercount);
 }
 
+static void kdb_print_p2mlock(struct domain *dp)
+{
+    struct p2m_domain *p2m = p2m_get_hostp2m(dp);
+    mm_rwlock_t *lp = p2m ? &p2m->lock : NULL;
+
+    if (lp == NULL) {
+        kdbp("    p2m lock ptr is null\n");
+        return;
+    }
+    kdbp("    p2m lockval: %x unlock_level:%x recurse_count:%x locker cpu:%x\n",
+         lp->lock.raw.lock, lp->unlock_level, lp->recurse_count,
+         lp->locker);
+    kdbp("    p2m locker_function:%s\n", lp->locker_function);
+}
+
 /* display one domain info */
 static void
 kdb_display_dom(struct domain *dp)
@@ -2332,8 +2364,8 @@ kdb_display_dom(struct domain *dp)
         kdbp("    mapcnt:");
         kdb_print_spin_lock("mapcnt: lk:", &gp->lock, "\n");
     }
-    kdbp("  hvm:%d priv:%d need_iommu:%d dbg:%d dying:%d paused:%d\n",
-         dp->is_hvm, dp->is_privileged, dp->need_iommu,
+    kdbp("  hvm:%d pvh:%d priv:%d need_iommu:%d dbg:%d dying:%d paused:%d\n",
+         dp->is_hvm, dp->is_pvh, dp->is_privileged, dp->need_iommu,
          dp->debugger_attached, dp->is_dying, dp->is_paused_by_controller);
     kdb_print_spin_lock("  shutdown: lk:", &dp->shutdown_lock, "\n");
     kdbp("  shutn:%d shut:%d code:%d \n", dp->is_shutting_down,
@@ -2351,13 +2383,14 @@ kdb_display_dom(struct domain *dp)
     kdbp("    pt_pages:0x%p ", ap->mm_perdomain_pt_pages);
     kdbp("    l2:0x%p l3:0x%p\n", ap->mm_perdomain_l2, ap->mm_perdomain_l3);
     kdbp("    ioport:0x%p &hvm_dom:0x%p\n", ap->ioport_caps, &ap->hvm_domain);
-    if (is_hvm_or_hyb_domain(dp))
+    if (is_hvm_or_pvh_domain(dp))
         kdb_prnt_hvm_dom_info(dp);
 
     kdbp("    &pging_dom:%p mode: %lx", &ap->paging, ap->paging.mode); 
     kdb_pr_dom_pg_modes(dp);
     kdbp("    p2m ptr:%p  pages:{%p, %p}\n", ap->p2m, ap->p2m->pages.next,
          KDB_PGLLE(ap->p2m->pages));
+    kdb_print_p2mlock(dp);
     kdbp("       max_mapped_pfn:"KDBFL, ap->p2m->max_mapped_pfn);
 #if XEN_SUBVERSION > 0 && XEN_VERSION == 4              /* xen 4.1 and above */
     kdbp("  phys_table:%p\n", ap->p2m->phys_table.pfn);
@@ -2932,7 +2965,7 @@ kdb_cmdf_mmu(int argc, const char **argv
     return KDB_CPU_MAIN_KDB;
 }
 
-/* for HVM/HYB guests, go thru EPT. For PV guest we need to go to the btree. 
+/* for HVM/PVH guests, go thru EPT. For PV guest we need to go to the btree. 
  * btree: pfn_to_mfn_frame_list_list is root that points (has mfns of) upto 16
  * pages (call 'em l2 nodes) that contain mfns of guest p2m table pages 
  * NOTE: num of entries in a p2m page is same as num of entries in l2 node */
@@ -2985,7 +3018,7 @@ kdb_gpfn2mfn(struct domain *dp, ulong gp
 	*typep = -1;
         return mfn;
     } else
-        return get_gfn_query(dp, gpfn, typep);
+        return mfn_x(get_gfn_query_unlocked(dp, gpfn, typep));
 
     return INVALID_MFN;
 }
@@ -3001,8 +3034,8 @@ static kdb_cpu_cmd_t
 kdb_cmdf_p2m(int argc, const char **argv, struct cpu_user_regs *regs)
 {
     struct domain *dp;
-    ulong gpfn, mfn;
-    p2m_type_t p2mtype;
+    ulong gpfn, mfn=0xdeadbeef;
+    p2m_type_t p2mtype = -1;
 
     if (argc < 3                                   ||
         (dp=kdb_strdomid2ptr(argv[1], 1)) == NULL  ||
@@ -3015,6 +3048,7 @@ kdb_cmdf_p2m(int argc, const char **argv
         kdbp("p2m[%lx] == %lx type:%d/0x%x\n", gpfn, mfn, p2mtype, p2mtype);
     else 
         kdbp("p2m[%lx] == %lx type:N/A(PV)\n", gpfn, mfn);
+
     return KDB_CPU_MAIN_KDB;
 }
 
@@ -3556,6 +3590,9 @@ kdb_cmdf_info(int argc, const char **arg
             kdbp("|_x2apic");
     kdbp("\n\n");
     kdbp("CC:");
+#if defined(CONFIG_X86_64)
+        kdbp(" CONFIG_X86_64");
+#endif
 #if defined(CONFIG_COMPAT)
         kdbp(" CONFIG_COMPAT");
 #endif
diff -r 8b0762504037 xen/kdb/kdbmain.c
--- a/xen/kdb/kdbmain.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/kdb/kdbmain.c	Wed Nov 14 11:03:24 2012 -0800
@@ -53,10 +53,6 @@ static inline unsigned int kdb_firstbit(
     return (unsigned int)val;
 }
 
-void noinline mukchk(unsigned long ul)
-{
-}
-
 static void 
 kdb_dbg_prnt_ctrps(char *label, int ccpu)
 {
@@ -179,11 +175,6 @@ kdb_begin_session(void)
     }
 }
 
-int noinline mukid(void)
-{
-    return smp_processor_id();
-}
-
 static void
 kdb_smp_unpause_cpus(int ccpu)
 {
@@ -238,8 +229,7 @@ kdb_end_session(int ccpu, struct cpu_use
     watchdog_enable();
     KDBGP("end_session:ccpu:%d\n", ccpu);
 }
-volatile int mukwpprnt;
-unsigned long mukaddr1 = 0xffffffff81243ae7, mukaddr2 = 0xffffffff8100986e;
+
 /* 
  * check if we entered kdb because of DB trap. If yes, then check if
  * we caused it or someone else.
@@ -276,14 +266,6 @@ kdb_check_dbtrap(kdb_reason_t *reasp, in
             }
         } else if (! kdb_check_watchpoints(regs)) {
             rc = 0;                        /* hyp must handle it */
-        } else {
-            if (regs->rip==mukaddr1 || regs->rip==mukaddr2)
-            {
-                if (mukwpprnt)
-                    kdbp("MUK: ignoring wp:%lx\n", regs->rip);
-                kdb_end_session(ccpu, regs);
-                rc = 1;
-            } 
         }
     }
     return rc;
@@ -382,7 +364,7 @@ kdbmain(kdb_reason_t reason, struct cpu_
             }
         } else if (rc == 2) {        /* one of ours but condition not met */
                 kdb_begin_session();
-                if (guest_mode(regs) && is_hvm_or_hyb_vcpu(current))
+                if (guest_mode(regs) && is_hvm_or_pvh_vcpu(current))
                     current->arch.hvm_vcpu.single_step = 1;
                 else
                     regs->eflags |= X86_EFLAGS_TF;  
@@ -422,7 +404,7 @@ kdbmain(kdb_reason_t reason, struct cpu_
             if (!cpumask_empty(&kdb_cpu_traps)) {
                 /* execute current instruction without 0xcc */
                 kdb_dbg_prnt_ctrps("nempty:", ccpu);
-                if (guest_mode(regs) && is_hvm_or_hyb_vcpu(current))
+                if (guest_mode(regs) && is_hvm_or_pvh_vcpu(current))
                     current->arch.hvm_vcpu.single_step = 1;
                 else
                     regs->eflags |= X86_EFLAGS_TF;  
@@ -439,7 +421,7 @@ kdbmain(kdb_reason_t reason, struct cpu_
         if (kdb_swbp_exists()) {
             if (reason == KDB_REASON_BPEXCP) {
                 /* do delayed install */
-                if (guest_mode(regs) && is_hvm_or_hyb_vcpu(current))
+                if (guest_mode(regs) && is_hvm_or_pvh_vcpu(current))
                     current->arch.hvm_vcpu.single_step = 1;
                 else
                     regs->eflags |= X86_EFLAGS_TF;  
@@ -538,7 +520,7 @@ kdb_handle_trap_entry(int vector, struct
             kdb_trap_immed_reason = 0;
             rc = kdb_keyboard(regs);
         } else {                         /* ss/ni/delayed install... */
-            if (guest_mode(regs) && is_hvm_or_hyb_vcpu(current))
+            if (guest_mode(regs) && is_hvm_or_pvh_vcpu(current))
                 current->arch.hvm_vcpu.single_step = 0;
             rc = kdbmain(KDB_REASON_DBEXCP, regs); 
         }
@@ -755,3 +737,8 @@ kdb_trcp(void)
     kdbp(" [most recent]: %016lx   trcidx: 0x%x\n", &trca[i], trcidx);
 }
 
+volatile int muklkdbg;
+void noinline mukchk(unsigned long ul)
+{
+}
+

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 19:05:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 19:05:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYiGb-00056n-37; Wed, 14 Nov 2012 19:04:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TYiGZ-00056g-Hh
	for Xen-devel@lists.xensource.com; Wed, 14 Nov 2012 19:04:52 +0000
Received: from [85.158.143.99:60420] by server-3.bemta-4.messagelabs.com id
	5B/39-06841-25BE3A05; Wed, 14 Nov 2012 19:04:50 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352919887!29381992!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2MjkwNg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32650 invoked from network); 14 Nov 2012 19:04:49 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-3.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 19:04:49 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAEJ4iWD020462
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 19:04:45 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAEJ4hXC017878
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Nov 2012 19:04:43 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAEJ4hfM022749; Wed, 14 Nov 2012 13:04:43 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 11:04:42 -0800
Date: Wed, 14 Nov 2012 11:04:41 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121114110441.712a00f7@mantra.us.oracle.com>
In-Reply-To: <1352887110.26873.15.camel@zakaz.uk.xensource.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
	<1352800853.7491.22.camel@zakaz.uk.xensource.com>
	<20121113172138.1d3274d9@mantra.us.oracle.com>
	<20121113173138.61b21067@mantra.us.oracle.com>
	<1352887110.26873.15.camel@zakaz.uk.xensource.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 14 Nov 2012 09:58:30 +0000
Ian Campbell <Ian.Campbell@citrix.com> wrote:

> On Wed, 2012-11-14 at 01:31 +0000, Mukesh Rathor wrote:
> > On Tue, 13 Nov 2012 17:21:38 -0800
> > Mukesh Rathor <mukesh.rathor@oracle.com> wrote:
> > 
> > > 
> Did you say that if you use the raw ELF file it works?

You mean vmlinux? I couldn't its 133M and my boot partition is 
only 99M.

> BTW for the purposes of parallelising things up you could post the
> hypervisor side part of the series stuff + a patch to force enable PVH
> in libxc (obviously the last not to be applied) first then we can be
> reviewing the h/v side things while simultaneously figuring out how
> the tools side fits together.

Ok. I've been procrastinating as the patch is full of debug code, 
is rather big, and would take lot of time to split up in different
patches. If you don't mind a very raw/debug version, all in one,
here it is (built on c/s: 26124 + my KDB patch):



diff -r 8b0762504037 tools/debugger/gdbsx/xg/xg_main.c
--- a/tools/debugger/gdbsx/xg/xg_main.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/debugger/gdbsx/xg/xg_main.c	Wed Nov 14 11:03:24 2012 -0800
@@ -80,6 +80,7 @@ int xgtrc_on = 0;
 struct xen_domctl domctl;         /* just use a global domctl */
 
 static int     _hvm_guest;        /* hvm guest? 32bit HVMs have 64bit context */
+static int     _pvh_guest;        /* PV guest in HVM container */
 static domid_t _dom_id;           /* guest domid */
 static int     _max_vcpu_id;      /* thus max_vcpu_id+1 VCPUs */
 static int     _dom0_fd;          /* fd of /dev/privcmd */
@@ -308,6 +309,7 @@ xg_attach(int domid, int guest_bitness)
 
     _max_vcpu_id = domctl.u.getdomaininfo.max_vcpu_id;
     _hvm_guest = (domctl.u.getdomaininfo.flags & XEN_DOMINF_hvm_guest);
+    _pvh_guest = (domctl.u.getdomaininfo.flags & XEN_DOMINF_pvh_guest);
     return _max_vcpu_id;
 }
 
@@ -368,7 +370,7 @@ _change_TF(vcpuid_t which_vcpu, int gues
     int sz = sizeof(anyc);
 
     /* first try the MTF for hvm guest. otherwise do manually */
-    if (_hvm_guest) {
+    if (_hvm_guest || _pvh_guest) {
         domctl.u.debug_op.vcpu = which_vcpu;
         domctl.u.debug_op.op = setit ? XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON :
                                        XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF;
diff -r 8b0762504037 tools/libxc/Makefile
--- a/tools/libxc/Makefile	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxc/Makefile	Wed Nov 14 11:03:24 2012 -0800
@@ -73,7 +73,7 @@ OSDEP_SRCS-y                 += xenctrl_
 -include $(XEN_TARGET_ARCH)/Makefile
 
 CFLAGS   += -Werror -Wmissing-prototypes
-CFLAGS   += -I. $(CFLAGS_xeninclude)
+CFLAGS   += -I. $(CFLAGS_xeninclude) -g -O0
 
 # Needed for posix_fadvise64() in xc_linux.c
 CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
diff -r 8b0762504037 tools/libxc/xc_dom_x86.c
--- a/tools/libxc/xc_dom_x86.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxc/xc_dom_x86.c	Wed Nov 14 11:03:24 2012 -0800
@@ -386,7 +386,8 @@ static int setup_pgtables_x86_64(struct 
         pgpfn = (addr - dom->parms.virt_base) >> PAGE_SHIFT_X86;
         l1tab[l1off] =
             pfn_to_paddr(xc_dom_p2m_guest(dom, pgpfn)) | L1_PROT;
-        if ( (addr >= dom->pgtables_seg.vstart) && 
+        if ( !(dom->flags & SIF_IS_PVH)      &&
+             (addr >= dom->pgtables_seg.vstart) && 
              (addr < dom->pgtables_seg.vend) )
             l1tab[l1off] &= ~_PAGE_RW; /* page tables are r/o */
         if ( l1off == (L1_PAGETABLE_ENTRIES_X86_64 - 1) )
@@ -716,7 +717,7 @@ int arch_setup_meminit(struct xc_dom_ima
     rc = x86_compat(dom->xch, dom->guest_domid, dom->guest_type);
     if ( rc )
         return rc;
-    if ( xc_dom_feature_translated(dom) )
+    if ( xc_dom_feature_translated(dom) && !(dom->flags & SIF_IS_PVH) )
     {
         dom->shadow_enabled = 1;
         rc = x86_shadow(dom->xch, dom->guest_domid);
@@ -830,7 +831,7 @@ int arch_setup_bootlate(struct xc_dom_im
         }
 
         /* Map grant table frames into guest physmap. */
-        for ( i = 0; ; i++ )
+        for ( i = 0; !(dom->flags & SIF_IS_PVH); i++ )
         {
             rc = xc_domain_add_to_physmap(dom->xch, dom->guest_domid,
                                           XENMAPSPACE_grant_table,
diff -r 8b0762504037 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxc/xc_domain_restore.c	Wed Nov 14 11:03:24 2012 -0800
@@ -1933,15 +1933,15 @@ int xc_domain_restore(xc_interface *xch,
             munmap(start_info, PAGE_SIZE);
         }
         /* Uncanonicalise each GDT frame number. */
-        if ( GET_FIELD(ctxt, gdt_ents) > 8192 )
+        if ( GET_FIELD(ctxt, u.pv.gdt_ents) > 8192 )
         {
             ERROR("GDT entry count out of range");
             goto out;
         }
 
-        for ( j = 0; (512*j) < GET_FIELD(ctxt, gdt_ents); j++ )
+        for ( j = 0; (512*j) < GET_FIELD(ctxt, u.pv.gdt_ents); j++ )
         {
-            pfn = GET_FIELD(ctxt, gdt_frames[j]);
+            pfn = GET_FIELD(ctxt, u.pv.gdt_frames[j]);
             if ( (pfn >= dinfo->p2m_size) ||
                  (pfn_type[pfn] != XEN_DOMCTL_PFINFO_NOTAB) )
             {
@@ -1949,7 +1949,7 @@ int xc_domain_restore(xc_interface *xch,
                       j, (unsigned long)pfn);
                 goto out;
             }
-            SET_FIELD(ctxt, gdt_frames[j], ctx->p2m[pfn]);
+            SET_FIELD(ctxt, u.pv.gdt_frames[j], ctx->p2m[pfn]);
         }
         /* Uncanonicalise the page table base pointer. */
         pfn = UNFOLD_CR3(GET_FIELD(ctxt, ctrlreg[3]));
diff -r 8b0762504037 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxc/xc_domain_save.c	Wed Nov 14 11:03:24 2012 -0800
@@ -1889,15 +1889,15 @@ int xc_domain_save(xc_interface *xch, in
         }
 
         /* Canonicalise each GDT frame number. */
-        for ( j = 0; (512*j) < GET_FIELD(&ctxt, gdt_ents); j++ )
+        for ( j = 0; (512*j) < GET_FIELD(&ctxt, u.pv.gdt_ents); j++ )
         {
-            mfn = GET_FIELD(&ctxt, gdt_frames[j]);
+            mfn = GET_FIELD(&ctxt, u.pv.gdt_frames[j]);
             if ( !MFN_IS_IN_PSEUDOPHYS_MAP(mfn) )
             {
                 ERROR("GDT frame is not in range of pseudophys map");
                 goto out;
             }
-            SET_FIELD(&ctxt, gdt_frames[j], mfn_to_pfn(mfn));
+            SET_FIELD(&ctxt, u.pv.gdt_frames[j], mfn_to_pfn(mfn));
         }
 
         /* Canonicalise the page table base pointer. */
diff -r 8b0762504037 tools/libxl/Makefile
--- a/tools/libxl/Makefile	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/Makefile	Wed Nov 14 11:03:24 2012 -0800
@@ -13,7 +13,7 @@ XLUMINOR = 1
 
 CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
 	-Wno-declaration-after-statement -Wformat-nonliteral
-CFLAGS += -I. -fPIC
+CFLAGS += -I. -fPIC -O0
 
 ifeq ($(CONFIG_Linux),y)
 LIBUUID_LIBS += -luuid
diff -r 8b0762504037 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/libxl_create.c	Wed Nov 14 11:03:24 2012 -0800
@@ -409,6 +409,8 @@ int libxl__domain_make(libxl__gc *gc, li
         flags |= XEN_DOMCTL_CDF_hvm_guest;
         flags |= libxl_defbool_val(info->hap) ? XEN_DOMCTL_CDF_hap : 0;
         flags |= libxl_defbool_val(info->oos) ? 0 : XEN_DOMCTL_CDF_oos_off;
+    } else if ( libxl_defbool_val(info->ci_pvh) ) {
+        flags |= (XEN_DOMCTL_CDF_pvh_guest | XEN_DOMCTL_CDF_hap);
     }
     *domid = -1;
 
diff -r 8b0762504037 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/libxl_dom.c	Wed Nov 14 11:03:24 2012 -0800
@@ -270,7 +270,8 @@ int libxl__build_pre(libxl__gc *gc, uint
     if (rtc_timeoffset)
         xc_domain_set_time_offset(ctx->xch, domid, rtc_timeoffset);
 
-    if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
+    if (info->type == LIBXL_DOMAIN_TYPE_HVM ||
+        libxl_defbool_val(info->bi_pvh) ) {
         unsigned long shadow;
         shadow = (info->shadow_memkb + 1023) / 1024;
         xc_shadow_control(ctx->xch, domid, XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION, NULL, 0, &shadow, 0, NULL);
@@ -368,9 +369,15 @@ int libxl__build_pv(libxl__gc *gc, uint3
     struct xc_dom_image *dom;
     int ret;
     int flags = 0;
+    int is_pvh = libxl_defbool_val(info->bi_pvh);
 
     xc_dom_loginit(ctx->xch);
 
+    if (is_pvh) {
+        printf("info..features:%s\n", info->u.pv.features);
+        info->u.pv.features = strdup("auto_translated_physmap");
+    }
+
     dom = xc_dom_allocate(ctx->xch, state->pv_cmdline, info->u.pv.features);
     if (!dom) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_dom_allocate failed");
@@ -408,6 +415,7 @@ int libxl__build_pv(libxl__gc *gc, uint3
         }
     }
 
+    flags |= is_pvh ? SIF_IS_PVH : 0;
     dom->flags = flags;
     dom->console_evtchn = state->console_port;
     dom->console_domid = state->console_domid;
@@ -438,7 +446,8 @@ int libxl__build_pv(libxl__gc *gc, uint3
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_dom_boot_image failed");
         goto out;
     }
-    if ( (ret = xc_dom_gnttab_init(dom)) != 0 ) {
+    /* PVH sets up its own grant during boot via hvm mechanisms */
+    if ( !is_pvh && (ret = xc_dom_gnttab_init(dom)) != 0 ) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_dom_gnttab_init failed");
         goto out;
     }
diff -r 8b0762504037 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/libxl_types.idl	Wed Nov 14 11:03:24 2012 -0800
@@ -243,6 +243,7 @@ libxl_domain_create_info = Struct("domai
     ("platformdata", libxl_key_value_list),
     ("poolid",       uint32),
     ("run_hotplug_scripts",libxl_defbool),
+    ("ci_pvh",       libxl_defbool),
     ], dir=DIR_IN)
 
 MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
@@ -339,6 +340,7 @@ libxl_domain_build_info = Struct("domain
                                       ])),
                  ("invalid", Struct(None, [])),
                  ], keyvar_init_val = "LIBXL_DOMAIN_TYPE_INVALID")),
+    ("bi_pvh",       libxl_defbool),
     ], dir=DIR_IN
 )
 
diff -r 8b0762504037 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/xl_cmdimpl.c	Wed Nov 14 11:03:24 2012 -0800
@@ -615,8 +615,18 @@ static void parse_config_data(const char
         !strncmp(buf, "hvm", strlen(buf)))
         c_info->type = LIBXL_DOMAIN_TYPE_HVM;
 
+    libxl_defbool_setdefault(&c_info->ci_pvh, false);
+    libxl_defbool_setdefault(&c_info->hap, false);
+    xlu_cfg_get_defbool(config, "pvh", &c_info->ci_pvh, 0);
     xlu_cfg_get_defbool(config, "hap", &c_info->hap, 0);
 
+    if (libxl_defbool_val(c_info->ci_pvh) &&
+        !libxl_defbool_val(c_info->hap)) {
+
+        fprintf(stderr, "hap is required for PVH domain\n");
+        exit(1);
+    }
+
     if (xlu_cfg_replace_string (config, "name", &c_info->name, 0)) {
         fprintf(stderr, "Domain name must be specified.\n");
         exit(1);
@@ -916,6 +926,7 @@ static void parse_config_data(const char
 
         b_info->u.pv.cmdline = cmdline;
         xlu_cfg_replace_string (config, "ramdisk", &b_info->u.pv.ramdisk, 0);
+        libxl_defbool_set(&b_info->bi_pvh, libxl_defbool_val(c_info->ci_pvh));
         break;
     }
     default:
diff -r 8b0762504037 tools/xenstore/xenstored_domain.c
--- a/tools/xenstore/xenstored_domain.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/xenstore/xenstored_domain.c	Wed Nov 14 11:03:24 2012 -0800
@@ -578,11 +578,13 @@ static int close_xc_handle(void *_handle
 	return 0;
 }
 
+#if 0
 static int close_xcg_handle(void *_handle)
 {
 	xc_gnttab_close(*(xc_gnttab **)_handle);
 	return 0;
 }
+#endif
 
 /* Returns the implicit path of a connection (only domains have this) */
 const char *get_implicit_path(const struct connection *conn)
@@ -639,12 +641,14 @@ void domain_init(void)
 	if (!xcg_handle)
 		barf_perror("Failed to allocate domain gnttab handle");
 
+*xcg_handle = NULL;
+#if 0
 	*xcg_handle = xc_gnttab_open(NULL, 0);
 	if (*xcg_handle < 0)
 		xprintf("WARNING: Failed to open connection to gnttab\n");
 	else
 		talloc_set_destructor(xcg_handle, close_xcg_handle);
-
+#endif
 	xce_handle = xc_evtchn_open(NULL, 0);
 
 	if (xce_handle == NULL)
diff -r 8b0762504037 xen/arch/x86/debug.c
--- a/xen/arch/x86/debug.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/debug.c	Wed Nov 14 11:03:24 2012 -0800
@@ -59,7 +59,7 @@ dbg_hvm_va2mfn(dbgva_t vaddr, struct dom
         return INVALID_MFN;
     }
 
-    mfn = mfn_x(get_gfn(dp, *gfn, &gfntype)); 
+    mfn = mfn_x(get_gfn_query_unlocked(dp, *gfn, &gfntype)); 
     if ( p2m_is_readonly(gfntype) && toaddr )
     {
         DBGP2("kdb:p2m_is_readonly: gfntype:%x\n", gfntype);
@@ -153,7 +153,7 @@ dbg_rw_guest_mem(dbgva_t addr, dbgbyte_t
 
         pagecnt = min_t(long, PAGE_SIZE - (addr & ~PAGE_MASK), len);
 
-        mfn = (dp->is_hvm
+        mfn = (is_hvm_or_pvh_domain(dp)
                ? dbg_hvm_va2mfn(addr, dp, toaddr, &gfn)
                : dbg_pv_va2mfn(addr, dp, pgd3));
         if ( mfn == INVALID_MFN ) 
@@ -173,8 +173,6 @@ dbg_rw_guest_mem(dbgva_t addr, dbgbyte_t
         }
 
         unmap_domain_page(va);
-        if ( gfn != INVALID_GFN )
-            put_gfn(dp, gfn);
 
         addr += pagecnt;
         buf += pagecnt;
diff -r 8b0762504037 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/domain.c	Wed Nov 14 11:03:24 2012 -0800
@@ -410,7 +410,7 @@ int vcpu_initialise(struct vcpu *v)
 
     vmce_init_vcpu(v);
 
-    if ( is_hvm_domain(d) )
+    if ( is_hvm_or_pvh_domain(d) )
     {
         rc = hvm_vcpu_initialise(v);
         goto done;
@@ -476,7 +476,7 @@ void vcpu_destroy(struct vcpu *v)
 
     vcpu_destroy_fpu(v);
 
-    if ( is_hvm_vcpu(v) )
+    if ( is_hvm_or_pvh_vcpu(v) )
         hvm_vcpu_destroy(v);
     else if ( standalone_trap_ctxt(v) )
         free_xenheap_page(v->arch.pv_vcpu.trap_ctxt);
@@ -489,7 +489,7 @@ int arch_domain_create(struct domain *d,
     int rc = -ENOMEM;
 
     d->arch.hvm_domain.hap_enabled =
-        is_hvm_domain(d) &&
+        is_hvm_or_pvh_domain(d) &&
         hvm_funcs.hap_supported &&
         (domcr_flags & DOMCRF_hap);
     d->arch.hvm_domain.mem_sharing_enabled = 0;
@@ -539,7 +539,7 @@ int arch_domain_create(struct domain *d,
                             __PAGE_HYPERVISOR);
 
     HYPERVISOR_COMPAT_VIRT_START(d) =
-        is_hvm_domain(d) ? ~0u : __HYPERVISOR_COMPAT_VIRT_START;
+        is_hvm_or_pvh_domain(d) ? ~0u : __HYPERVISOR_COMPAT_VIRT_START;
 
     if ( (rc = paging_domain_init(d, domcr_flags)) != 0 )
         goto fail;
@@ -581,7 +581,7 @@ int arch_domain_create(struct domain *d,
             goto fail;
     }
 
-    if ( is_hvm_domain(d) )
+    if ( is_hvm_or_pvh_domain(d) )
     {
         if ( (rc = hvm_domain_initialise(d)) != 0 )
         {
@@ -593,9 +593,9 @@ int arch_domain_create(struct domain *d,
     {
         /* 64-bit PV guest by default. */
         d->arch.is_32bit_pv = d->arch.has_32bit_shinfo = 0;
-
+    }
+    if ( !is_hvm_domain(d) )
         spin_lock_init(&d->arch.pv_domain.e820_lock);
-    }
 
     /* initialize default tsc behavior in case tools don't */
     tsc_set_info(d, TSC_MODE_DEFAULT, 0UL, 0, 0);
@@ -622,9 +622,10 @@ void arch_domain_destroy(struct domain *
 {
     unsigned int i;
 
-    if ( is_hvm_domain(d) )
+    if ( is_hvm_or_pvh_domain(d) )
         hvm_domain_destroy(d);
-    else
+
+    if ( !is_hvm_domain(d) )
         xfree(d->arch.pv_domain.e820);
 
     free_domain_pirqs(d);
@@ -683,6 +684,9 @@ int arch_set_info_guest(
     unsigned int i;
     int rc = 0, compat;
 
+    if ( is_pvh_vcpu(v) && is_pvh_vcpu(current) )
+        return -EINVAL;
+
     /* The context is a compat-mode one if the target domain is compat-mode;
      * we expect the tools to DTRT even in compat-mode callers. */
     compat = is_pv_32on64_domain(d);
@@ -690,7 +694,7 @@ int arch_set_info_guest(
 #define c(fld) (compat ? (c.cmp->fld) : (c.nat->fld))
     flags = c(flags);
 
-    if ( !is_hvm_vcpu(v) )
+    if ( !is_hvm_or_pvh_vcpu(v) )
     {
         if ( !compat )
         {
@@ -743,7 +747,7 @@ int arch_set_info_guest(
     v->fpu_initialised = !!(flags & VGCF_I387_VALID);
 
     v->arch.flags &= ~TF_kernel_mode;
-    if ( (flags & VGCF_in_kernel) || is_hvm_vcpu(v)/*???*/ )
+    if ( (flags & VGCF_in_kernel) || is_hvm_or_pvh_vcpu(v)/*???*/ )
         v->arch.flags |= TF_kernel_mode;
 
     v->arch.vgc_flags = flags;
@@ -752,7 +756,7 @@ int arch_set_info_guest(
     if ( !compat )
     {
         memcpy(&v->arch.user_regs, &c.nat->user_regs, sizeof(c.nat->user_regs));
-        if ( !is_hvm_vcpu(v) )
+        if ( !is_hvm_or_pvh_vcpu(v) )
             memcpy(v->arch.pv_vcpu.trap_ctxt, c.nat->trap_ctxt,
                    sizeof(c.nat->trap_ctxt));
     }
@@ -768,10 +772,13 @@ int arch_set_info_guest(
 
     v->arch.user_regs.eflags |= 2;
 
-    if ( is_hvm_vcpu(v) )
+    if ( is_hvm_or_pvh_vcpu(v) )
     {
         hvm_set_info_guest(v);
-        goto out;
+        if ( is_hvm_vcpu(v) || v->is_initialised )
+            goto out;
+        else 
+            goto pvh_skip_pv;;
     }
 
     init_int80_direct_trap(v);
@@ -780,7 +787,8 @@ int arch_set_info_guest(
     v->arch.pv_vcpu.iopl = (v->arch.user_regs.eflags >> 12) & 3;
     v->arch.user_regs.eflags &= ~X86_EFLAGS_IOPL;
 
-    /* Ensure real hardware interrupts are enabled. */
+    /* Ensure real hardware interrupts are enabled. FYI: PVH may not have 
+     * IDT set on all vcpus so don't enable IF for it yet. */
     v->arch.user_regs.eflags |= X86_EFLAGS_IF;
 
     if ( !v->is_initialised )
@@ -811,8 +819,8 @@ int arch_set_info_guest(
         }
 
         for ( i = 0; i < ARRAY_SIZE(v->arch.pv_vcpu.gdt_frames); ++i )
-            fail |= v->arch.pv_vcpu.gdt_frames[i] != c(gdt_frames[i]);
-        fail |= v->arch.pv_vcpu.gdt_ents != c(gdt_ents);
+            fail |= v->arch.pv_vcpu.gdt_frames[i] != c(u.pv.gdt_frames[i]);
+        fail |= v->arch.pv_vcpu.gdt_ents != c(u.pv.gdt_ents);
 
         fail |= v->arch.pv_vcpu.ldt_base != c(ldt_base);
         fail |= v->arch.pv_vcpu.ldt_ents != c(ldt_ents);
@@ -861,21 +869,22 @@ int arch_set_info_guest(
         d->vm_assist = c(vm_assist);
 
     if ( !compat )
-        rc = (int)set_gdt(v, c.nat->gdt_frames, c.nat->gdt_ents);
+        rc = (int)set_gdt(v, c.nat->u.pv.gdt_frames, c.nat->u.pv.gdt_ents);
     else
     {
         unsigned long gdt_frames[ARRAY_SIZE(v->arch.pv_vcpu.gdt_frames)];
-        unsigned int n = (c.cmp->gdt_ents + 511) / 512;
+        unsigned int n = (c.cmp->u.pv.gdt_ents + 511) / 512;
 
         if ( n > ARRAY_SIZE(v->arch.pv_vcpu.gdt_frames) )
             return -EINVAL;
         for ( i = 0; i < n; ++i )
-            gdt_frames[i] = c.cmp->gdt_frames[i];
-        rc = (int)set_gdt(v, gdt_frames, c.cmp->gdt_ents);
+            gdt_frames[i] = c.cmp->u.pv.gdt_frames[i];
+        rc = (int)set_gdt(v, gdt_frames, c.cmp->u.pv.gdt_ents);
     }
     if ( rc != 0 )
         return rc;
 
+pvh_skip_pv:
     if ( !compat )
     {
         cr3_gfn = xen_cr3_to_pfn(c.nat->ctrlreg[3]);
@@ -883,19 +892,26 @@ int arch_set_info_guest(
 
         if ( !cr3_page )
         {
-            destroy_gdt(v);
+            if ( !is_pvh_vcpu(v) )
+                destroy_gdt(v);
             return -EINVAL;
         }
         if ( !paging_mode_refcounts(d)
              && !get_page_type(cr3_page, PGT_base_page_table) )
         {
             put_page(cr3_page);
-            destroy_gdt(v);
+            if ( !is_pvh_vcpu(v) )
+                destroy_gdt(v);
             return -EINVAL;
         }
 
+        if ( is_pvh_vcpu(v) ) {
+            v->arch.cr3 = page_to_mfn(cr3_page);
+            v->arch.hvm_vcpu.guest_cr[3] = c.nat->ctrlreg[3];
+        }
+
         v->arch.guest_table = pagetable_from_page(cr3_page);
-        if ( c.nat->ctrlreg[1] )
+        if ( c.nat->ctrlreg[1] && !is_pvh_vcpu(v) )
         {
             cr3_gfn = xen_cr3_to_pfn(c.nat->ctrlreg[1]);
             cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC);
@@ -920,7 +936,8 @@ int arch_set_info_guest(
         }
         else if ( !(flags & VGCF_in_kernel) )
         {
-            destroy_gdt(v);
+            if ( !is_pvh_vcpu(v) )
+                destroy_gdt(v);
             return -EINVAL;
         }
     }
@@ -961,6 +978,13 @@ int arch_set_info_guest(
 
     update_cr3(v);
 
+    if ( is_pvh_vcpu(v) )
+    {
+        /* guest is bringing up non-boot SMP vcpu */
+        if ( (rc=hvm_pvh_set_vcpu_info(v, c.nat)) != 0 )
+            return rc;
+    }
+
  out:
     if ( flags & VGCF_online )
         clear_bit(_VPF_down, &v->pause_flags);
@@ -991,16 +1015,21 @@ void arch_vcpu_reset(struct vcpu *v)
 static void
 unmap_vcpu_info(struct vcpu *v)
 {
-    unsigned long mfn;
+    unsigned long mfn, *mfnp;
 
-    if ( v->arch.pv_vcpu.vcpu_info_mfn == INVALID_MFN )
+    if ( is_pvh_vcpu(v) )
+        mfnp = &v->arch.hvm_vcpu.hv_pvh.pvh_vcpu_info_mfn;
+    else
+        mfnp = &v->arch.pv_vcpu.vcpu_info_mfn;
+
+    mfn = *mfnp;
+    if ( mfn == INVALID_MFN )
         return;
 
-    mfn = v->arch.pv_vcpu.vcpu_info_mfn;
     unmap_domain_page_global(v->vcpu_info);
 
     v->vcpu_info = &dummy_vcpu_info;
-    v->arch.pv_vcpu.vcpu_info_mfn = INVALID_MFN;
+    *mfnp = INVALID_MFN;
 
     put_page_and_type(mfn_to_page(mfn));
 }
@@ -1011,7 +1040,7 @@ unmap_vcpu_info(struct vcpu *v)
  * of memory, and it sets a pending event to make sure that a pending
  * event doesn't get missed.
  */
-static int
+static noinline int
 map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
 {
     struct domain *d = v->domain;
@@ -1019,11 +1048,17 @@ map_vcpu_info(struct vcpu *v, unsigned l
     vcpu_info_t *new_info;
     struct page_info *page;
     int i;
+    unsigned long *mfnp;
+
+    if ( is_pvh_vcpu(v) )
+        mfnp = &v->arch.hvm_vcpu.hv_pvh.pvh_vcpu_info_mfn;
+    else
+        mfnp = &v->arch.pv_vcpu.vcpu_info_mfn;
 
     if ( offset > (PAGE_SIZE - sizeof(vcpu_info_t)) )
         return -EINVAL;
 
-    if ( v->arch.pv_vcpu.vcpu_info_mfn != INVALID_MFN )
+    if ( *mfnp != INVALID_MFN )
         return -EINVAL;
 
     /* Run this command on yourself or on other offline VCPUS. */
@@ -1060,7 +1095,7 @@ map_vcpu_info(struct vcpu *v, unsigned l
     }
 
     v->vcpu_info = new_info;
-    v->arch.pv_vcpu.vcpu_info_mfn = page_to_mfn(page);
+    *mfnp = page_to_mfn(page);
 
     /* Set new vcpu_info pointer /before/ setting pending flags. */
     wmb();
@@ -1370,10 +1405,10 @@ static void save_segments(struct vcpu *v
     struct cpu_user_regs *regs = &v->arch.user_regs;
     unsigned int dirty_segment_mask = 0;
 
-    regs->ds = read_segment_register(ds);
-    regs->es = read_segment_register(es);
-    regs->fs = read_segment_register(fs);
-    regs->gs = read_segment_register(gs);
+    regs->ds = read_segment_register(v, regs, ds);
+    regs->es = read_segment_register(v, regs, es);
+    regs->fs = read_segment_register(v, regs, fs);
+    regs->gs = read_segment_register(v, regs, gs);
 
     if ( regs->ds )
         dirty_segment_mask |= DIRTY_DS;
@@ -1466,7 +1501,7 @@ static void update_runstate_area(struct 
 
 static inline int need_full_gdt(struct vcpu *v)
 {
-    return (!is_hvm_vcpu(v) && !is_idle_vcpu(v));
+    return (!is_hvm_or_pvh_vcpu(v) && !is_idle_vcpu(v));
 }
 
 static void __context_switch(void)
@@ -1593,7 +1628,7 @@ void context_switch(struct vcpu *prev, s
         /* Re-enable interrupts before restoring state which may fault. */
         local_irq_enable();
 
-        if ( !is_hvm_vcpu(next) )
+        if ( !is_hvm_or_pvh_vcpu(next) )
         {
             load_LDT(next);
             load_segments(next);
@@ -2034,7 +2069,7 @@ int domain_relinquish_resources(struct d
         for_each_vcpu ( d, v )
             vcpu_destroy_pagetables(v);
 
-        if ( !is_hvm_domain(d) )
+        if ( !is_hvm_or_pvh_domain(d) )
         {
             for_each_vcpu ( d, v )
             {
@@ -2045,6 +2080,7 @@ int domain_relinquish_resources(struct d
                  */
                 destroy_gdt(v);
 
+/**** PVH: unmap vcpu info here ??????????????? */
                 unmap_vcpu_info(v);
             }
 
@@ -2109,7 +2145,7 @@ int domain_relinquish_resources(struct d
         BUG();
     }
 
-    if ( is_hvm_domain(d) )
+    if ( is_hvm_or_pvh_domain(d) )
         hvm_domain_relinquish_resources(d);
 
     return 0;
@@ -2190,7 +2226,7 @@ void vcpu_mark_events_pending(struct vcp
     if ( already_pending )
         return;
 
-    if ( is_hvm_vcpu(v) )
+    if ( is_hvm_or_pvh_vcpu(v) )
         hvm_assert_evtchn_irq(v);
     else
         vcpu_kick(v);
diff -r 8b0762504037 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/domain_build.c	Wed Nov 14 11:03:24 2012 -0800
@@ -35,6 +35,8 @@
 #include <asm/setup.h>
 #include <asm/bzimage.h> /* for bzimage_parse */
 #include <asm/io_apic.h>
+#include <asm/hap.h>
+#include <asm/debugger.h>
 
 #include <public/version.h>
 
@@ -307,6 +309,31 @@ static void __init process_dom0_ioports_
     }
 }
 
+static noinline __init void dom0_update_physmap(struct domain *d, unsigned long pfn,
+                                    unsigned long mfn, unsigned long vphysmap_s)
+{
+    if (d->is_pvh) {
+        int rc = guest_physmap_add_page(d, pfn, mfn, 0);
+        BUG_ON(rc);             /* for now while PVH feature is experimental */
+	return;
+    }
+    if ( !is_pv_32on64_domain(d) )
+        ((unsigned long *)vphysmap_s)[pfn] = mfn;
+    else
+        ((unsigned int *)vphysmap_s)[pfn] = mfn;
+
+    set_gpfn_from_mfn(mfn, pfn);
+}
+
+static __init void noinline copy_pvh(char *dest, char *src, int bytes)
+{
+    int rem = dbg_rw_mem((dbgva_t)dest, (unsigned char *)src, bytes, 0, 1, 0);
+    if (rem) {
+        printk("Failed to copy to dom0. len:%d rem:%d\n", bytes, rem);
+        domain_crash_synchronous();
+    }
+}
+
 int __init construct_dom0(
     struct domain *d,
     const module_t *image, unsigned long image_headroom,
@@ -314,6 +341,7 @@ int __init construct_dom0(
     void *(*bootstrap_map)(const module_t *),
     char *cmdline)
 {
+    char si_buf[PAGE_SIZE], tmp_buf[PAGE_SIZE];
     int i, cpu, rc, compatible, compat32, order, machine;
     struct cpu_user_regs *regs;
     unsigned long pfn, mfn;
@@ -322,7 +350,7 @@ int __init construct_dom0(
     unsigned long alloc_spfn;
     unsigned long alloc_epfn;
     unsigned long initrd_pfn = -1, initrd_mfn = 0;
-    unsigned long count;
+    unsigned long count, shared_info_pfn_addr = 0;
     struct page_info *page = NULL;
     start_info_t *si;
     struct vcpu *v = d->vcpu[0];
@@ -480,6 +508,15 @@ int __init construct_dom0(
     vstartinfo_end   = (vstartinfo_start +
                         sizeof(struct start_info) +
                         sizeof(struct dom0_vga_console_info));
+
+    if ( is_pvh_domain(d) ) {
+        kdbp("MUK: vstartinfo_end:%lx\n", vstartinfo_end);
+	shared_info_pfn_addr = round_pgup(vstartinfo_end) - v_start;
+    	vstartinfo_end   += PAGE_SIZE;
+        kdbp("MUK: adjusted vstartinfo_end:%lx shared_info_pfn:%lx\n", 
+	       vstartinfo_end, shared_info_pfn_addr);
+    }
+
     vpt_start        = round_pgup(vstartinfo_end);
     for ( nr_pt_pages = 2; ; nr_pt_pages++ )
     {
@@ -621,20 +658,30 @@ int __init construct_dom0(
         maddr_to_page(mpt_alloc)->u.inuse.type_info = PGT_l3_page_table;
         l3start = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
     }
-    copy_page(l4tab, idle_pg_table);
-    l4tab[0] = l4e_empty(); /* zap trampoline mapping */
-    l4tab[l4_table_offset(LINEAR_PT_VIRT_START)] =
-        l4e_from_paddr(__pa(l4start), __PAGE_HYPERVISOR);
-    l4tab[l4_table_offset(PERDOMAIN_VIRT_START)] =
-        l4e_from_paddr(__pa(d->arch.mm_perdomain_l3), __PAGE_HYPERVISOR);
-    v->arch.guest_table = pagetable_from_paddr(__pa(l4start));
-    if ( is_pv_32on64_domain(d) )
-        v->arch.guest_table_user = v->arch.guest_table;
+    if ( is_pvh_domain(d) ) 
+    {
+        v->arch.guest_table = pagetable_from_paddr(vpt_start - v_start);
+        pfn = 0;
+    } else {
+        copy_page(l4tab, idle_pg_table);
+        l4tab[0] = l4e_empty(); /* zap trampoline mapping */
+        l4tab[l4_table_offset(LINEAR_PT_VIRT_START)] =
+            l4e_from_paddr(__pa(l4start), __PAGE_HYPERVISOR);
+        l4tab[l4_table_offset(PERDOMAIN_VIRT_START)] =
+            l4e_from_paddr(__pa(d->arch.mm_perdomain_l3), __PAGE_HYPERVISOR);
+            v->arch.guest_table = pagetable_from_paddr(__pa(l4start));
+        if ( is_pv_32on64_domain(d) )
+            v->arch.guest_table_user = v->arch.guest_table;
+        pfn = alloc_spfn;
+    }
 
     l4tab += l4_table_offset(v_start);
-    pfn = alloc_spfn;
     for ( count = 0; count < ((v_end-v_start)>>PAGE_SHIFT); count++ )
     {
+        /* initrd chunk's mfns are separate, so we need to adjust for them */
+        signed long hyb_adj = is_pvh_domain(d) ?
+                            (-alloc_spfn + PFN_UP(initrd_len))<<PAGE_SHIFT : 0;
+
         if ( !((unsigned long)l1tab & (PAGE_SIZE-1)) )
         {
             maddr_to_page(mpt_alloc)->u.inuse.type_info = PGT_l1_page_table;
@@ -661,16 +708,17 @@ int __init construct_dom0(
                     clear_page(l3tab);
                     if ( count == 0 )
                         l3tab += l3_table_offset(v_start);
-                    *l4tab = l4e_from_paddr(__pa(l3start), L4_PROT);
+                    *l4tab = l4e_from_paddr(__pa(l3start) + hyb_adj, L4_PROT);
                     l4tab++;
                 }
-                *l3tab = l3e_from_paddr(__pa(l2start), L3_PROT);
+                *l3tab = l3e_from_paddr(__pa(l2start) + hyb_adj, L3_PROT);
                 l3tab++;
             }
-            *l2tab = l2e_from_paddr(__pa(l1start), L2_PROT);
+            *l2tab = l2e_from_paddr(__pa(l1start) + hyb_adj, L2_PROT);
             l2tab++;
         }
-        if ( count < initrd_pfn || count >= initrd_pfn + PFN_UP(initrd_len) )
+        if ( is_pvh_domain(d) ||
+             count < initrd_pfn || count >= initrd_pfn + PFN_UP(initrd_len) )
             mfn = pfn++;
         else
             mfn = initrd_mfn++;
@@ -678,6 +726,9 @@ int __init construct_dom0(
                                     L1_PROT : COMPAT_L1_PROT));
         l1tab++;
 
+        if ( is_pvh_domain(d) )
+            continue;
+
         page = mfn_to_page(mfn);
         if ( (page->u.inuse.type_info == 0) &&
              !get_page_and_type(page, d, PGT_writable_page) )
@@ -714,7 +765,7 @@ int __init construct_dom0(
     l2tab += l2_table_offset(vpt_start);
     l1start = l1tab = l2e_to_l1e(*l2tab);
     l1tab += l1_table_offset(vpt_start);
-    for ( count = 0; count < nr_pt_pages; count++ ) 
+    for ( count = 0; count < nr_pt_pages && !is_pvh_domain(d); count++ ) 
     {
         l1e_remove_flags(*l1tab, _PAGE_RW);
         page = mfn_to_page(l1e_get_pfn(*l1tab));
@@ -758,6 +809,11 @@ int __init construct_dom0(
         (void)alloc_vcpu(d, i, cpu);
     }
 
+    if ( is_pvh_domain(d) )
+    {
+        v->arch.cr3 = v->arch.hvm_vcpu.guest_cr[3] =
+                        (pagetable_get_pfn(v->arch.guest_table)) << PAGE_SHIFT;
+    }
     /* Set up CR3 value for write_ptbase */
     if ( paging_mode_enabled(d) )
         paging_update_paging_modes(v);
@@ -767,34 +823,12 @@ int __init construct_dom0(
     /* We run on dom0's page tables for the final part of the build process. */
     write_ptbase(v);
 
-    /* Copy the OS image and free temporary buffer. */
-    elf.dest = (void*)vkern_start;
-    rc = elf_load_binary(&elf);
-    if ( rc < 0 )
-    {
-        printk("Failed to load the kernel binary\n");
-        return rc;
-    }
-    bootstrap_map(NULL);
+    /* Set up start info area. */
+    if ( is_pvh_domain(d) )
+        si = (start_info_t *)si_buf;
+    else
+        si = (start_info_t *)vstartinfo_start;
 
-    if ( UNSET_ADDR != parms.virt_hypercall )
-    {
-        if ( (parms.virt_hypercall < v_start) ||
-             (parms.virt_hypercall >= v_end) )
-        {
-            write_ptbase(current);
-            printk("Invalid HYPERCALL_PAGE field in ELF notes.\n");
-            return -1;
-        }
-        hypercall_page_initialise(
-            d, (void *)(unsigned long)parms.virt_hypercall);
-    }
-
-    /* Free temporary buffers. */
-    discard_initial_images();
-
-    /* Set up start info area. */
-    si = (start_info_t *)vstartinfo_start;
     clear_page(si);
     si->nr_pages = nr_pages;
 
@@ -803,6 +837,8 @@ int __init construct_dom0(
     si->flags        = SIF_PRIVILEGED | SIF_INITDOMAIN;
     if ( !vinitrd_start && initrd_len )
         si->flags   |= SIF_MOD_START_PFN;
+    if ( is_pvh_domain(d) )
+        si->flags   |= SIF_IS_PVH;
     si->flags       |= (xen_processor_pmbits << 8) & SIF_PM_MASK;
     si->pt_base      = vpt_start;
     si->nr_pt_frames = nr_pt_pages;
@@ -812,7 +848,7 @@ int __init construct_dom0(
 
     count = d->tot_pages;
     /* Set up the phys->machine table if not part of the initial mapping. */
-    if ( parms.p2m_base != UNSET_ADDR )
+    if ( parms.p2m_base != UNSET_ADDR && !is_pvh_domain(d) )
     {
         unsigned long va = vphysmap_start;
 
@@ -911,6 +947,11 @@ int __init construct_dom0(
             panic("Not enough RAM for DOM0 P->M table.\n");
     }
 
+    if (is_pvh_domain(d) )
+    {
+        hap_set_pvh_alloc_for_dom0(d, nr_pages);
+        kdbp("MUK: Count is:%d 0x%x\n", count, count);
+    }
     /* Write the phys->machine and machine->phys table entries. */
     for ( pfn = 0; pfn < count; pfn++ )
     {
@@ -927,11 +968,8 @@ int __init construct_dom0(
         if ( pfn > REVERSE_START && (vinitrd_start || pfn < initrd_pfn) )
             mfn = alloc_epfn - (pfn - REVERSE_START);
 #endif
-        if ( !is_pv_32on64_domain(d) )
-            ((unsigned long *)vphysmap_start)[pfn] = mfn;
-        else
-            ((unsigned int *)vphysmap_start)[pfn] = mfn;
-        set_gpfn_from_mfn(mfn, pfn);
+        dom0_update_physmap(d, pfn, mfn, vphysmap_start);
+
         if (!(pfn & 0xfffff))
             process_pending_softirqs();
     }
@@ -947,8 +985,8 @@ int __init construct_dom0(
             if ( !page->u.inuse.type_info &&
                  !get_page_and_type(page, d, PGT_writable_page) )
                 BUG();
-            ((unsigned long *)vphysmap_start)[pfn] = mfn;
-            set_gpfn_from_mfn(mfn, pfn);
+            
+            dom0_update_physmap(d, pfn, mfn, vphysmap_start);
             ++pfn;
             if (!(pfn & 0xfffff))
                 process_pending_softirqs();
@@ -968,11 +1006,7 @@ int __init construct_dom0(
 #ifndef NDEBUG
 #define pfn (nr_pages - 1 - (pfn - (alloc_epfn - alloc_spfn)))
 #endif
-            if ( !is_pv_32on64_domain(d) )
-                ((unsigned long *)vphysmap_start)[pfn] = mfn;
-            else
-                ((unsigned int *)vphysmap_start)[pfn] = mfn;
-            set_gpfn_from_mfn(mfn, pfn);
+            dom0_update_physmap(d, pfn, mfn, vphysmap_start);
 #undef pfn
             page++; pfn++;
             if (!(pfn & 0xfffff))
@@ -980,6 +1014,35 @@ int __init construct_dom0(
         }
     }
 
+    /* Copy the OS image and free temporary buffer. */
+    elf.dest = (void*)vkern_start;
+    rc = elf_load_binary(&elf, is_pvh_domain(d) );
+    if ( rc < 0 )
+    {
+        printk("Failed to load the kernel binary\n");
+        return rc;
+    }
+    bootstrap_map(NULL);
+
+    if ( UNSET_ADDR != parms.virt_hypercall )
+    {
+        void *addr = is_pvh_domain(d) ? tmp_buf : (void *)parms.virt_hypercall;
+
+        if ( (parms.virt_hypercall < v_start) ||
+             (parms.virt_hypercall >= v_end) )
+        {
+            write_ptbase(current);
+            printk("Invalid HYPERCALL_PAGE field in ELF notes.\n");
+            return -1;
+        }
+        hypercall_page_initialise(d, addr);
+        if ( is_pvh_domain(d) )
+            copy_pvh((void *)parms.virt_hypercall, tmp_buf, PAGE_SIZE);
+    }
+
+    /* Free temporary buffers. */
+    discard_initial_images();
+
     if ( initrd_len != 0 )
     {
         si->mod_start = vinitrd_start ?: initrd_pfn;
@@ -995,6 +1058,15 @@ int __init construct_dom0(
         si->console.dom0.info_off  = sizeof(struct start_info);
         si->console.dom0.info_size = sizeof(struct dom0_vga_console_info);
     }
+    if ( is_pvh_domain(d) ) {
+        unsigned long mfn = virt_to_mfn(d->shared_info);
+        unsigned long pfn = shared_info_pfn_addr>>PAGE_SHIFT;
+        si->shared_info = shared_info_pfn_addr;
+        dom0_update_physmap(d, pfn, mfn, 0);
+
+        copy_pvh((char *)vstartinfo_start, si_buf, PAGE_SIZE);
+    }
+    kdbp("MUK: si->shared_info:%lx\n", si->shared_info);
 
     if ( is_pv_32on64_domain(d) )
         xlat_start_info(si, XLAT_start_info_console_dom0);
@@ -1007,6 +1079,7 @@ int __init construct_dom0(
     v->is_initialised = 1;
     clear_bit(_VPF_down, &v->pause_flags);
 
+/* PVH NOTE: some of these are ignored */
     /*
      * Initial register values:
      *  DS,ES,FS,GS = FLAT_KERNEL_DS
@@ -1025,12 +1098,16 @@ int __init construct_dom0(
     regs->eip = parms.virt_entry;
     regs->esp = vstack_end;
     regs->esi = vstartinfo_start;
-    regs->eflags = X86_EFLAGS_IF;
+    regs->eflags = X86_EFLAGS_IF | 0x2;
 
-    if ( opt_dom0_shadow )
+    if ( opt_dom0_shadow ) {
+        if ( is_pvh_domain(d) ) {
+            printk("Invalid option dom0_shadow for PVH\n");
+            return -EINVAL;
+        }
         if ( paging_enable(d, PG_SH_enable) == 0 ) 
             paging_update_paging_modes(v);
-
+    }
     if ( supervisor_mode_kernel )
     {
         v->arch.pv_vcpu.kernel_ss &= ~3;
diff -r 8b0762504037 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/domctl.c	Wed Nov 14 11:03:24 2012 -0800
@@ -46,6 +46,77 @@ static int gdbsx_guest_mem_io(
     return (iop->remain ? -EFAULT : 0);
 }
 
+long domctl_memory_mapping(struct domain *d, unsigned long gfn,
+                           unsigned long mfn, unsigned long nr_mfns,
+                           int add_map)
+{
+    int i;
+    long ret = -EINVAL;
+
+    if ( (mfn + nr_mfns - 1) < mfn || /* wrap? */
+         ((mfn | (mfn + nr_mfns - 1)) >> (paddr_bits - PAGE_SHIFT)) ||
+         (gfn + nr_mfns - 1) < gfn ) /* wrap? */
+        return ret;
+
+    ret = -EPERM;
+    if ( !IS_PRIV(current->domain) &&
+         !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
+        return ret;
+
+/* TBD: common code with do_physdev_op() */
+
+    ret = xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, add_map);
+    if ( ret )
+        return ret;
+
+    if ( add_map )
+    {
+        if ( !is_pvh_domain(d) )   /* PVH maps lots and lots */
+            printk(XENLOG_G_INFO
+                   "memory_map:add: dom%d gfn=%lx mfn=%lx nr=%lx\n",
+                   d->domain_id, gfn, mfn, nr_mfns);
+
+        ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
+        if ( !ret && paging_mode_translate(d) )
+        {
+            for ( i = 0; !ret && i < nr_mfns; i++ )
+                if ( !set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i)) )
+                    ret = -EIO;
+            if ( ret )
+            {
+                printk(XENLOG_G_WARNING
+                       "memory_map:fail: dom%d gfn=%lx mfn=%lx\n",
+                       d->domain_id, gfn + i, mfn + i);
+                while ( i-- )
+                    clear_mmio_p2m_entry(d, gfn + i);
+                if ( iomem_deny_access(d, mfn, mfn + nr_mfns - 1) &&
+                     IS_PRIV(current->domain) )
+                    printk(XENLOG_ERR
+                           "memory_map: failed to deny dom%d access to [%lx,%lx]\n",
+                           d->domain_id, mfn, mfn + nr_mfns - 1);
+            }
+        }
+    } else {
+        if ( !is_pvh_domain(d) )   /* PVH unmaps lots and lots */
+            printk(XENLOG_G_INFO
+                   "memory_map:remove: dom%d gfn=%lx mfn=%lx nr=%lx\n",
+                   d->domain_id, gfn, mfn, nr_mfns);
+
+        if ( paging_mode_translate(d) )
+            for ( i = 0; i < nr_mfns; i++ )
+                add_map |= !clear_mmio_p2m_entry(d, gfn + i);
+        ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
+        if ( !ret && add_map )
+            ret = -EIO;
+        if ( ret && IS_PRIV(current->domain) )
+            printk(XENLOG_ERR
+                   "memory_map: error %ld %s dom%d access to [%lx,%lx]\n",
+                   ret, add_map ? "removing" : "denying", d->domain_id,
+                   mfn, mfn + nr_mfns - 1);
+    }
+    return ret;
+}
+
 long arch_do_domctl(
     struct xen_domctl *domctl,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
@@ -825,75 +896,13 @@ long arch_do_domctl(
         unsigned long mfn = domctl->u.memory_mapping.first_mfn;
         unsigned long nr_mfns = domctl->u.memory_mapping.nr_mfns;
         int add = domctl->u.memory_mapping.add_mapping;
-        unsigned long i;
 
-        ret = -EINVAL;
-        if ( (mfn + nr_mfns - 1) < mfn || /* wrap? */
-             ((mfn | (mfn + nr_mfns - 1)) >> (paddr_bits - PAGE_SHIFT)) ||
-             (gfn + nr_mfns - 1) < gfn ) /* wrap? */
-            break;
-
-        ret = -EPERM;
-        if ( !IS_PRIV(current->domain) &&
-             !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
-            break;
 
         ret = -ESRCH;
         if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
             break;
 
-        ret = xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, add);
-        if ( ret ) {
-            rcu_unlock_domain(d);
-            break;
-        }
-
-        if ( add )
-        {
-            printk(XENLOG_G_INFO
-                   "memory_map:add: dom%d gfn=%lx mfn=%lx nr=%lx\n",
-                   d->domain_id, gfn, mfn, nr_mfns);
-
-            ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
-            if ( !ret && paging_mode_translate(d) )
-            {
-                for ( i = 0; !ret && i < nr_mfns; i++ )
-                    if ( !set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i)) )
-                        ret = -EIO;
-                if ( ret )
-                {
-                    printk(XENLOG_G_WARNING
-                           "memory_map:fail: dom%d gfn=%lx mfn=%lx\n",
-                           d->domain_id, gfn + i, mfn + i);
-                    while ( i-- )
-                        clear_mmio_p2m_entry(d, gfn + i);
-                    if ( iomem_deny_access(d, mfn, mfn + nr_mfns - 1) &&
-                         IS_PRIV(current->domain) )
-                        printk(XENLOG_ERR
-                               "memory_map: failed to deny dom%d access to [%lx,%lx]\n",
-                               d->domain_id, mfn, mfn + nr_mfns - 1);
-                }
-            }
-        }
-        else
-        {
-            printk(XENLOG_G_INFO
-                   "memory_map:remove: dom%d gfn=%lx mfn=%lx nr=%lx\n",
-                   d->domain_id, gfn, mfn, nr_mfns);
-
-            if ( paging_mode_translate(d) )
-                for ( i = 0; i < nr_mfns; i++ )
-                    add |= !clear_mmio_p2m_entry(d, gfn + i);
-            ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
-            if ( !ret && add )
-                ret = -EIO;
-            if ( ret && IS_PRIV(current->domain) )
-                printk(XENLOG_ERR
-                       "memory_map: error %ld %s dom%d access to [%lx,%lx]\n",
-                       ret, add ? "removing" : "denying", d->domain_id,
-                       mfn, mfn + nr_mfns - 1);
-        }
-
+        ret = domctl_memory_mapping(d, gfn, mfn, nr_mfns, add);
         rcu_unlock_domain(d);
     }
     break;
@@ -1646,17 +1655,21 @@ void arch_get_info_guest(struct vcpu *v,
             c.nat->gs_base_kernel = hvm_get_shadow_gs_base(v);
         }
     }
+    else if ( is_pvh_vcpu(v) )
+    {
+        printk("PVH: FIXME: arch_get_info_guest()\n");
+    }
     else
     {
         c(ldt_base = v->arch.pv_vcpu.ldt_base);
         c(ldt_ents = v->arch.pv_vcpu.ldt_ents);
         for ( i = 0; i < ARRAY_SIZE(v->arch.pv_vcpu.gdt_frames); ++i )
-            c(gdt_frames[i] = v->arch.pv_vcpu.gdt_frames[i]);
-        BUILD_BUG_ON(ARRAY_SIZE(c.nat->gdt_frames) !=
-                     ARRAY_SIZE(c.cmp->gdt_frames));
-        for ( ; i < ARRAY_SIZE(c.nat->gdt_frames); ++i )
-            c(gdt_frames[i] = 0);
-        c(gdt_ents = v->arch.pv_vcpu.gdt_ents);
+            c(u.pv.gdt_frames[i] = v->arch.pv_vcpu.gdt_frames[i]);
+        BUILD_BUG_ON(ARRAY_SIZE(c.nat->u.pv.gdt_frames) !=
+                     ARRAY_SIZE(c.cmp->u.pv.gdt_frames));
+        for ( ; i < ARRAY_SIZE(c.nat->u.pv.gdt_frames); ++i )
+            c(u.pv.gdt_frames[i] = 0);
+        c(u.pv.gdt_ents = v->arch.pv_vcpu.gdt_ents);
         c(kernel_ss = v->arch.pv_vcpu.kernel_ss);
         c(kernel_sp = v->arch.pv_vcpu.kernel_sp);
         for ( i = 0; i < ARRAY_SIZE(v->arch.pv_vcpu.ctrlreg); ++i )
diff -r 8b0762504037 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/hvm/hvm.c	Wed Nov 14 11:03:24 2012 -0800
@@ -331,6 +331,9 @@ void hvm_do_resume(struct vcpu *v)
 {
     ioreq_t *p;
 
+    if ( is_pvh_vcpu(v) )
+        return;
+
     pt_restore_timer(v);
 
     check_wakeup_from_wait();
@@ -499,6 +502,29 @@ static int hvm_print_line(
     return X86EMUL_OKAY;
 }
 
+static noinline int hvm_pvh_dom_initialise(struct domain *d)
+{
+    int rc;
+
+    if (!d->arch.hvm_domain.hap_enabled)
+        return -EINVAL;
+
+    spin_lock_init(&d->arch.hvm_domain.irq_lock);
+    hvm_init_guest_time(d);
+
+    hvm_init_cacheattr_region_list(d);
+
+    if ( (rc=paging_enable(d, PG_refcounts|PG_translate|PG_external)) != 0 )
+        goto fail1;
+
+    if ( (rc = hvm_funcs.domain_initialise(d)) == 0 )
+        return 0;
+
+fail1:
+    hvm_destroy_cacheattr_region_list(d);
+    return rc;
+}
+
 int hvm_domain_initialise(struct domain *d)
 {
     int rc;
@@ -509,6 +535,8 @@ int hvm_domain_initialise(struct domain 
                  "on a non-VT/AMDV platform.\n");
         return -EINVAL;
     }
+    if ( is_pvh_domain(d) )
+        return hvm_pvh_dom_initialise(d);
 
     spin_lock_init(&d->arch.hvm_domain.pbuf_lock);
     spin_lock_init(&d->arch.hvm_domain.irq_lock);
@@ -572,6 +600,11 @@ int hvm_domain_initialise(struct domain 
 
 void hvm_domain_relinquish_resources(struct domain *d)
 {
+    if ( is_pvh_domain(d) ) 
+    {
+        pit_deinit(d);
+        return;
+    }
     if ( hvm_funcs.nhvm_domain_relinquish_resources )
         hvm_funcs.nhvm_domain_relinquish_resources(d);
 
@@ -597,10 +630,16 @@ void hvm_domain_relinquish_resources(str
 void hvm_domain_destroy(struct domain *d)
 {
     hvm_funcs.domain_destroy(d);
+    hvm_destroy_cacheattr_region_list(d);
+
+    if ( is_pvh_domain(d) ) {
+        printk("PVH:skippoing stuff in hvm_domain_destroy(). reexamine me\n");
+        return;
+    }
+
     rtc_deinit(d);
     stdvga_deinit(d);
     vioapic_deinit(d);
-    hvm_destroy_cacheattr_region_list(d);
 }
 
 static int hvm_save_tsc_adjust(struct domain *d, hvm_domain_context_t *h)
@@ -1054,12 +1093,44 @@ static int __init __hvm_register_CPU_XSA
 }
 __initcall(__hvm_register_CPU_XSAVE_save_and_restore);
 
+static noinline int hvm_pvh_vcpu_initialise(struct vcpu *v)
+{
+    int rc;
+
+    if ( (rc = hvm_funcs.vcpu_initialise(v)) != 0 )
+        return rc;
+
+    softirq_tasklet_init( &v->arch.hvm_vcpu.assert_evtchn_irq_tasklet,
+                          (void(*)(unsigned long))hvm_assert_evtchn_irq,
+                          (unsigned long)v );
+
+    v->arch.hvm_vcpu.hv_pvh.pvh_vcpu_info_mfn = INVALID_MFN;
+    v->arch.user_regs.eflags = 2;
+    v->arch.hvm_vcpu.inject_trap.vector = -1;
+
+    if ( (rc=hvm_vcpu_cacheattr_init(v)) != 0 ) {
+        hvm_funcs.vcpu_destroy(v);
+        return rc;
+    }
+
+    /* during domain shutdown: pvh_vmx_vmexit_handler->emulate_privileged_op
+     * -> guest_io_read -> pv_pit_handler -> handle_speaker_io -> _spin_lock
+     *  so we call pit_init to initialize the spin lock */
+    if ( v->vcpu_id == 0 )
+        pit_init(v, cpu_khz);
+
+    return 0;
+}
+
 int hvm_vcpu_initialise(struct vcpu *v)
 {
     int rc;
 
     hvm_asid_flush_vcpu(v);
 
+    if ( is_pvh_vcpu(v) )
+        return hvm_pvh_vcpu_initialise(v);
+
     if ( (rc = vlapic_init(v)) != 0 )
         goto fail1;
 
@@ -1147,11 +1218,14 @@ void hvm_vcpu_destroy(struct vcpu *v)
 
     free_compat_arg_xlat(v);
 
+if ( is_pvh_vcpu(v) )
+    printk("PVH: fixme: ignoring tasklet kill in hvm_vcpu_destroy(). \n");
+else {
     tasklet_kill(&v->arch.hvm_vcpu.assert_evtchn_irq_tasklet);
     hvm_vcpu_cacheattr_destroy(v);
     vlapic_destroy(v);
+}
     hvm_funcs.vcpu_destroy(v);
-
     /* Event channel is already freed by evtchn_destroy(). */
     /*free_xen_event_channel(v, v->arch.hvm_vcpu.xen_port);*/
 }
diff -r 8b0762504037 xen/arch/x86/hvm/irq.c
--- a/xen/arch/x86/hvm/irq.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/hvm/irq.c	Wed Nov 14 11:03:24 2012 -0800
@@ -405,6 +405,9 @@ struct hvm_intack hvm_vcpu_has_pending_i
          && vcpu_info(v, evtchn_upcall_pending) )
         return hvm_intack_vector(plat->irq.callback_via.vector);
 
+    if ( is_pvh_vcpu(v) )
+        return hvm_intack_none;
+
     if ( vlapic_accept_pic_intr(v) && plat->vpic[0].int_output )
         return hvm_intack_pic(0);
 
diff -r 8b0762504037 xen/arch/x86/hvm/mtrr.c
--- a/xen/arch/x86/hvm/mtrr.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/hvm/mtrr.c	Wed Nov 14 11:03:24 2012 -0800
@@ -553,6 +553,10 @@ int32_t hvm_get_mem_pinned_cacheattr(
 
     *type = 0;
 
+    if ( is_pvh_domain(d) ) {
+        printk("PVH: fixme: hvm_get_mem_pinned_cacheattr(). \n");
+        return 0;
+    }
     if ( !is_hvm_domain(d) )
         return 0;
 
@@ -578,6 +582,11 @@ int32_t hvm_set_mem_pinned_cacheattr(
 {
     struct hvm_mem_pinned_cacheattr_range *range;
 
+    if ( is_pvh_domain(d) ) {
+        printk("PVH: fixme: hvm_set_mem_pinned_cacheattr()\n");
+        return 0;
+    }
+
     if ( !((type == PAT_TYPE_UNCACHABLE) ||
            (type == PAT_TYPE_WRCOMB) ||
            (type == PAT_TYPE_WRTHROUGH) ||
@@ -606,6 +615,12 @@ static int hvm_save_mtrr_msr(struct doma
     struct vcpu *v;
     struct hvm_hw_mtrr hw_mtrr;
     struct mtrr_state *mtrr_state;
+
+    if ( is_pvh_domain(d) ) {
+        printk("PVH: fixme: hvm_save_mtrr_msr()\n");
+        return 0;
+    }
+
     /* save mtrr&pat */
     for_each_vcpu(d, v)
     {
@@ -644,6 +659,10 @@ static int hvm_load_mtrr_msr(struct doma
     struct mtrr_state *mtrr_state;
     struct hvm_hw_mtrr hw_mtrr;
 
+    if ( is_pvh_domain(d) ) {
+        printk("PVH: fixme: hvm_load_mtrr_msr()\n");
+        return 0;
+    }
     vcpuid = hvm_load_instance(h);
     if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
     {
@@ -693,6 +712,14 @@ uint8_t epte_get_entry_emt(struct domain
          ((d->vcpu == NULL) || ((v = d->vcpu[0]) == NULL)) )
         return MTRR_TYPE_WRBACK;
 
+    /* PVH TBD: FIXME: this needs to be studied, figure what need to be done
+     * for PVH */
+    if ( is_pvh_domain(d) ) {
+        if (direct_mmio)
+            return MTRR_TYPE_UNCACHABLE;
+        return MTRR_TYPE_WRBACK;
+    }
+
     if ( !v->domain->arch.hvm_domain.params[HVM_PARAM_IDENT_PT] )
         return MTRR_TYPE_WRBACK;
 
diff -r 8b0762504037 xen/arch/x86/hvm/svm/vmcb.c
--- a/xen/arch/x86/hvm/svm/vmcb.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/hvm/svm/vmcb.c	Wed Nov 14 11:03:24 2012 -0800
@@ -326,7 +326,7 @@ void kdb_dump_vmcb(domid_t did, int vid)
 
     rcu_read_lock(&domlist_read_lock);
     for_each_domain (dp) {
-        if (!is_hvm_or_hyb_domain(dp) || dp->is_dying)
+        if (!is_hvm_or_pvh_domain(dp) || dp->is_dying)
             continue;
         if (did != 0 && did != dp->domain_id)
             continue;
diff -r 8b0762504037 xen/arch/x86/hvm/vmx/Makefile
--- a/xen/arch/x86/hvm/vmx/Makefile	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/hvm/vmx/Makefile	Wed Nov 14 11:03:24 2012 -0800
@@ -5,3 +5,4 @@ obj-y += vmcs.o
 obj-y += vmx.o
 obj-y += vpmu_core2.o
 obj-y += vvmx.o
+obj-y += vmx_pvh.o
diff -r 8b0762504037 xen/arch/x86/hvm/vmx/intr.c
--- a/xen/arch/x86/hvm/vmx/intr.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/hvm/vmx/intr.c	Wed Nov 14 11:03:24 2012 -0800
@@ -216,15 +216,16 @@ void vmx_intr_assist(void)
         return;
     }
 
-    /* Crank the handle on interrupt state. */
-    pt_vector = pt_update_irq(v);
+    if ( !is_pvh_vcpu(v) )
+        /* Crank the handle on interrupt state. */
+        pt_vector = pt_update_irq(v);
 
     do {
         intack = hvm_vcpu_has_pending_irq(v);
         if ( likely(intack.source == hvm_intsrc_none) )
             goto out;
 
-        if ( unlikely(nvmx_intr_intercept(v, intack)) )
+        if ( !is_pvh_vcpu(v) && unlikely(nvmx_intr_intercept(v, intack)) )
             goto out;
 
         intblk = hvm_interrupt_blocked(v, intack);
diff -r 8b0762504037 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Wed Nov 14 11:03:24 2012 -0800
@@ -606,7 +606,7 @@ void vmx_vmcs_exit(struct vcpu *v)
     {
         /* Don't confuse vmx_do_resume (for @v or @current!) */
         vmx_clear_vmcs(v);
-        if ( is_hvm_vcpu(current) )
+        if ( is_hvm_or_pvh_vcpu(current) )
             vmx_load_vmcs(current);
 
         spin_unlock(&v->arch.hvm_vmx.vmcs_lock);
@@ -697,6 +697,306 @@ void vmx_vmcs_switch(struct vmcs_struct 
     spin_unlock(&vmx->vmcs_lock);
 }
 
+static noinline int pvh_construct_vmcs(struct vcpu *v)
+{
+    struct domain *d = v->domain;
+    uint16_t sysenter_cs;
+    unsigned long sysenter_eip;
+    u32 vmexit_ctl = vmx_vmexit_control;
+    u32 vmentry_ctl = vmx_vmentry_control;
+    u64 u64val = -1;
+
+    vmx_vmcs_enter(v);
+
+    /* VMCS controls. */
+    vmx_pin_based_exec_control &= ~PIN_BASED_VIRTUAL_NMIS;
+    __vmwrite(PIN_BASED_VM_EXEC_CONTROL, vmx_pin_based_exec_control);
+
+    v->arch.hvm_vmx.exec_control = vmx_cpu_based_exec_control;
+
+    /* if ( v->domain->arch.vtsc ) */
+    v->arch.hvm_vmx.exec_control &= ~CPU_BASED_RDTSC_EXITING;
+v->arch.hvm_vmx.exec_control &= ~CPU_BASED_USE_TSC_OFFSETING;
+
+    if ( !paging_mode_hap(d) )
+    {
+        printk("ERROR: HAP is required to run PV in HVM container\n");
+        goto out;
+    }
+    v->arch.hvm_vmx.exec_control &= ~(CPU_BASED_INVLPG_EXITING |
+                                      CPU_BASED_CR3_LOAD_EXITING |
+                                      CPU_BASED_CR3_STORE_EXITING);
+    v->arch.hvm_vmx.exec_control |= CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
+    v->arch.hvm_vmx.exec_control &= ~CPU_BASED_MONITOR_TRAP_FLAG;
+#if 0
+    v->arch.hvm_vmx.exec_control &= ~CPU_BASED_ACTIVATE_IO_BITMAP; /* ??? */
+#endif
+    v->arch.hvm_vmx.exec_control |= CPU_BASED_ACTIVATE_MSR_BITMAP;
+    v->arch.hvm_vmx.exec_control &= ~CPU_BASED_TPR_SHADOW;
+    v->arch.hvm_vmx.exec_control &= ~CPU_BASED_VIRTUAL_NMI_PENDING;
+
+    kdbp("MUK: writing proc based exec controls:%x\n", 
+                 v->arch.hvm_vmx.exec_control);
+    __vmwrite(CPU_BASED_VM_EXEC_CONTROL, v->arch.hvm_vmx.exec_control);
+
+    /* I/O access bitmap. */
+    __vmwrite(IO_BITMAP_A, virt_to_maddr((char *)hvm_io_bitmap + 0));
+    __vmwrite(IO_BITMAP_B, virt_to_maddr((char *)hvm_io_bitmap + PAGE_SIZE));
+
+    /* MSR access bitmap. */
+    if ( cpu_has_vmx_msr_bitmap )
+    {
+        unsigned long *msr_bitmap = alloc_xenheap_page();
+        int msr_type = MSR_TYPE_R | MSR_TYPE_W;
+
+        if ( msr_bitmap == NULL )
+            goto out;
+
+        memset(msr_bitmap, ~0, PAGE_SIZE);
+        v->arch.hvm_vmx.msr_bitmap = msr_bitmap;
+        __vmwrite(MSR_BITMAP, virt_to_maddr(msr_bitmap));
+
+        vmx_disable_intercept_for_msr(v, MSR_FS_BASE, msr_type);
+        vmx_disable_intercept_for_msr(v, MSR_GS_BASE, msr_type);
+        vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS, msr_type);
+        vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP, msr_type);
+        vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP, msr_type);
+        vmx_disable_intercept_for_msr(v, MSR_SHADOW_GS_BASE, msr_type);
+
+        /* pure hvm doesn't do this. safe? see: long_mode_do_msr_write() */
+#if 0
+        vmx_disable_intercept_for_msr(v, MSR_STAR);
+        vmx_disable_intercept_for_msr(v, MSR_LSTAR);
+        vmx_disable_intercept_for_msr(v, MSR_CSTAR);
+        vmx_disable_intercept_for_msr(v, MSR_SYSCALL_MASK);
+#endif
+        kdbp("MUK: disabled intercepts for few msrs\n");
+
+    } else {
+        kdbp("MUK: CPU does NOT have msr bitmap\n");
+        for (;;) cpu_relax();
+    }
+
+    if ( !cpu_has_vmx_vpid ) {
+        printk("ERROR: VPID support is required to run PV in HVM container\n");
+        goto out;
+    }
+
+    v->arch.hvm_vmx.secondary_exec_control = vmx_secondary_exec_control;
+
+    if ( cpu_has_vmx_secondary_exec_control ) {
+        v->arch.hvm_vmx.secondary_exec_control &= ~0x4FF; /* turn off all */
+#if 0
+        v->arch.hvm_vmx.secondary_exec_control &= 
+                                       ~SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
+        v->arch.hvm_vmx.secondary_exec_control &= ~SECONDARY_EXEC_ENABLE_RDTSCP;
+
+        v->arch.hvm_vmx.secondary_exec_control &= 
+                                             ~SECONDARY_EXEC_UNRESTRICTED_GUEST;
+#endif
+        v->arch.hvm_vmx.secondary_exec_control |= 
+                                              SECONDARY_EXEC_PAUSE_LOOP_EXITING;
+        v->arch.hvm_vmx.secondary_exec_control |= SECONDARY_EXEC_ENABLE_VPID;
+
+        if ( paging_mode_hap(d) )
+            v->arch.hvm_vmx.secondary_exec_control |= SECONDARY_EXEC_ENABLE_EPT;
+
+        kdbp("MUK: muk_construct_vmcs: sec exec:0x%x\n",
+                                        v->arch.hvm_vmx.secondary_exec_control);
+        __vmwrite(SECONDARY_VM_EXEC_CONTROL,
+                  v->arch.hvm_vmx.secondary_exec_control);
+    } else {
+        printk("ERROR: NO Secondary Exec control\n");
+        goto out;
+    }
+
+    /* __vmwrite(VIRTUAL_PROCESSOR_ID, v->arch.hvm_vcpu.asid); */
+
+    if ( !paging_mode_hap(d) )
+        vmexit_ctl &= ~(VM_EXIT_SAVE_GUEST_PAT | VM_EXIT_LOAD_HOST_PAT);
+    __vmwrite(VM_EXIT_CONTROLS, vmexit_ctl);
+
+    #define VM_ENTRY_LOAD_DEBUG_CTLS 0x4
+    #define VM_ENTRY_LOAD_EFER 0x8000
+    #define GUEST_EFER 0x2806        /* see page 23-20 */
+    #define GUEST_EFER_HIGH 0x2807   /* see page 23-20 */
+    vmentry_ctl &= ~VM_ENTRY_LOAD_DEBUG_CTLS;
+    vmentry_ctl &= ~VM_ENTRY_LOAD_EFER;
+    vmentry_ctl &= ~VM_ENTRY_SMM;
+    vmentry_ctl &= ~VM_ENTRY_DEACT_DUAL_MONITOR;
+    vmentry_ctl |= VM_ENTRY_IA32E_MODE;
+    if ( !paging_mode_hap(d) )
+        vmentry_ctl &= ~VM_ENTRY_LOAD_GUEST_PAT;
+    kdbp("MUK:muk_construct_vmcs(). vmentry_ctl:0x%x\n", vmentry_ctl);
+    __vmwrite(VM_ENTRY_CONTROLS, vmentry_ctl);
+
+    /* MSR intercepts. */
+    __vmwrite(VM_ENTRY_MSR_LOAD_COUNT, 0);
+    __vmwrite(VM_EXIT_MSR_LOAD_COUNT, 0);
+    __vmwrite(VM_EXIT_MSR_STORE_COUNT, 0);
+
+    /* Host data selectors. */
+    __vmwrite(HOST_SS_SELECTOR, __HYPERVISOR_DS);
+    __vmwrite(HOST_DS_SELECTOR, __HYPERVISOR_DS);
+    __vmwrite(HOST_ES_SELECTOR, __HYPERVISOR_DS);
+    __vmwrite(HOST_FS_SELECTOR, 0);
+    __vmwrite(HOST_GS_SELECTOR, 0);
+    __vmwrite(HOST_FS_BASE, 0);
+    __vmwrite(HOST_GS_BASE, 0);
+
+    vmx_set_host_env(v);
+
+    /* Host control registers. */
+    v->arch.hvm_vmx.host_cr0 = read_cr0() | X86_CR0_TS;
+    __vmwrite(HOST_CR0, v->arch.hvm_vmx.host_cr0);
+    __vmwrite(HOST_CR4, mmu_cr4_features|(cpu_has_xsave ? X86_CR4_OSXSAVE : 0));
+
+    /* Host CS:RIP. */
+    __vmwrite(HOST_CS_SELECTOR, __HYPERVISOR_CS);
+    __vmwrite(HOST_RIP, (unsigned long)vmx_asm_vmexit_handler);
+
+    /* Host SYSENTER CS:RIP. */
+    rdmsrl(MSR_IA32_SYSENTER_CS, sysenter_cs);
+    __vmwrite(HOST_SYSENTER_CS, sysenter_cs);
+    rdmsrl(MSR_IA32_SYSENTER_EIP, sysenter_eip);
+    __vmwrite(HOST_SYSENTER_EIP, sysenter_eip);
+
+    __vmwrite(VM_ENTRY_INTR_INFO, 0);
+
+    __vmwrite(CR3_TARGET_COUNT, 0);
+
+    __vmwrite(GUEST_ACTIVITY_STATE, 0);
+
+    /* Set default guest context values here. Some of these are then overwritten
+     * in vmx_pvh_set_vcpu_info() by guest itself during vcpu bringup */
+    __vmwrite(GUEST_CS_BASE, 0);
+    __vmwrite(GUEST_CS_LIMIT, ~0u);
+    __vmwrite(GUEST_CS_AR_BYTES, 0xa09b); /* CS.L == 1 */
+    __vmwrite(GUEST_CS_SELECTOR, 0x10);
+
+    __vmwrite(GUEST_DS_BASE, 0);
+    __vmwrite(GUEST_DS_LIMIT, ~0u);
+    __vmwrite(GUEST_DS_AR_BYTES, 0xc093);
+    __vmwrite(GUEST_DS_SELECTOR, 0x18);
+
+    __vmwrite(GUEST_SS_BASE, 0);         /* use same seg as DS */
+    __vmwrite(GUEST_SS_LIMIT, ~0u);
+    __vmwrite(GUEST_SS_AR_BYTES, 0xc093);
+    __vmwrite(GUEST_SS_SELECTOR, 0x18);
+
+    __vmwrite(GUEST_ES_SELECTOR, 0);
+    __vmwrite(GUEST_FS_SELECTOR, 0);
+    __vmwrite(GUEST_GS_SELECTOR, 0);
+
+    /* Guest segment bases. */
+    __vmwrite(GUEST_ES_BASE, 0);
+    __vmwrite(GUEST_FS_BASE, 0);
+    __vmwrite(GUEST_GS_BASE, 0);
+
+    /* Guest segment limits. */
+    __vmwrite(GUEST_ES_LIMIT, ~0u);
+    __vmwrite(GUEST_FS_LIMIT, ~0u);
+    __vmwrite(GUEST_GS_LIMIT, ~0u);
+
+    /* Guest segment AR bytes. */
+    __vmwrite(GUEST_ES_AR_BYTES, 0xc093); /* read/write, accessed */
+    __vmwrite(GUEST_FS_AR_BYTES, 0xc093);
+    __vmwrite(GUEST_GS_AR_BYTES, 0xc093);
+
+    /* Guest IDT. */
+    __vmwrite(GUEST_GDTR_BASE, 0);
+    __vmwrite(GUEST_GDTR_LIMIT, 0);
+
+    /* Guest LDT. */
+    __vmwrite(GUEST_LDTR_AR_BYTES, 0x82); /* LDT */
+    __vmwrite(GUEST_LDTR_SELECTOR, 0);
+    __vmwrite(GUEST_LDTR_BASE, 0);
+    __vmwrite(GUEST_LDTR_LIMIT, 0);
+
+    /* Guest TSS. */
+    __vmwrite(GUEST_TR_AR_BYTES, 0x8b); /* 32-bit TSS (busy) */
+    __vmwrite(GUEST_TR_BASE, 0);
+    __vmwrite(GUEST_TR_LIMIT, 0xff);
+
+    __vmwrite(GUEST_INTERRUPTIBILITY_INFO, 0);
+    __vmwrite(GUEST_DR7, 0);
+    __vmwrite(VMCS_LINK_POINTER, ~0UL);
+
+    __vmwrite(PAGE_FAULT_ERROR_CODE_MASK, 0);
+    __vmwrite(PAGE_FAULT_ERROR_CODE_MATCH, 0);
+
+    v->arch.hvm_vmx.exception_bitmap = 
+                                   HVM_TRAP_MASK     | (1 << TRAP_debug) | 
+                                   (1U << TRAP_int3) | (1U << TRAP_no_device);
+    __vmwrite(EXCEPTION_BITMAP, v->arch.hvm_vmx.exception_bitmap);
+
+#if 0
+    __vmwrite(EXCEPTION_BITMAP,
+              HVM_TRAP_MASK | (1<<TRAP_debug) | (1<<TRAP_gp_fault) |
+              (1U<<TRAP_int3) | (1U << TRAP_page_fault)|(1U << TRAP_no_device));
+#endif
+    __vmwrite(TSC_OFFSET, 0);
+
+#if 0
+    v->arch.hvm_vcpu.guest_cr[0] = X86_CR0_PG | X86_CR0_PE | X86_CR0_ET;
+    hvm_update_guest_cr(v, 0);
+
+    v->arch.hvm_vcpu.guest_cr[4] = 0;
+    hvm_update_guest_cr(v, 4);
+#endif
+
+#if 0
+    u64val = X86_CR0_PG | X86_CR0_PE | X86_CR0_ET | X86_CR0_TS |
+             X86_CR0_NE | X86_CR0_WP;
+#endif
+    /* make sure to set WP bit so rdonly pages are not written from CPL 0 */
+    u64val = X86_CR0_PG | X86_CR0_NE | X86_CR0_PE | X86_CR0_WP;
+    __vmwrite(GUEST_CR0, u64val);
+    __vmwrite(CR0_READ_SHADOW, u64val);
+    v->arch.hvm_vcpu.hw_cr[0] = v->arch.hvm_vcpu.guest_cr[0] = u64val;
+
+    u64val = X86_CR4_PAE | X86_CR4_VMXE;
+    __vmwrite(GUEST_CR4, u64val);
+    __vmwrite(CR4_READ_SHADOW, u64val);
+    v->arch.hvm_vcpu.guest_cr[4] = u64val;
+
+    __vmwrite(CR0_GUEST_HOST_MASK, ~0UL);
+    __vmwrite(CR4_GUEST_HOST_MASK, ~0UL);
+
+     v->arch.hvm_vmx.vmx_realmode = 0;
+
+    if ( paging_mode_hap(d) )
+    {
+        __vmwrite(EPT_POINTER, d->arch.hvm_domain.vmx.ept_control.eptp);
+#ifdef __i386__
+        __vmwrite(EPT_POINTER_HIGH,
+                  d->arch.hvm_domain.vmx.ept_control.eptp >> 32);
+#endif
+    }
+
+    if ( cpu_has_vmx_pat && paging_mode_hap(d) )
+    {
+        u64 host_pat, guest_pat;
+
+        rdmsrl(MSR_IA32_CR_PAT, host_pat);
+        guest_pat = MSR_IA32_CR_PAT_RESET;
+
+        __vmwrite(HOST_PAT, host_pat);
+        __vmwrite(GUEST_PAT, guest_pat);
+#ifdef __i386__
+JUNK
+        __vmwrite(HOST_PAT_HIGH, host_pat >> 32);
+        __vmwrite(GUEST_PAT_HIGH, guest_pat >> 32);
+#endif
+    }
+out:
+    vmx_vmcs_exit(v);
+#if 0
+    paging_update_paging_modes(v); /* will update HOST & GUEST_CR3 as reqd */
+#endif
+    return 0;
+}
+
 static int construct_vmcs(struct vcpu *v)
 {
     struct domain *d = v->domain;
@@ -705,6 +1005,9 @@ static int construct_vmcs(struct vcpu *v
     u32 vmexit_ctl = vmx_vmexit_control;
     u32 vmentry_ctl = vmx_vmentry_control;
 
+    if ( is_pvh_vcpu(v) )
+        return pvh_construct_vmcs(v);
+
     vmx_vmcs_enter(v);
 
     /* VMCS controls. */
@@ -1143,9 +1446,11 @@ void vmx_do_resume(struct vcpu *v)
 
         vmx_clear_vmcs(v);
         vmx_load_vmcs(v);
-        hvm_migrate_timers(v);
-        hvm_migrate_pirqs(v);
-        vmx_set_host_env(v);
+        if ( !is_pvh_vcpu(v) ) {
+            hvm_migrate_timers(v);
+            hvm_migrate_pirqs(v);
+            vmx_set_host_env(v);
+        }
         /*
          * Both n1 VMCS and n2 VMCS need to update the host environment after 
          * VCPU migration. The environment of current VMCS is updated in place,
@@ -1163,6 +1468,9 @@ void vmx_do_resume(struct vcpu *v)
         __vmwrite(GUEST_DR7, 0);
 #endif
 
+    if ( is_pvh_vcpu(v) )
+        goto skip_inteLdbgr;   /* PVH supports gdbsx and gdb inside PVH */
+
     debug_state = v->domain->debugger_attached
                   || v->domain->arch.hvm_domain.params[HVM_PARAM_MEMORY_EVENT_INT3]
                   || v->domain->arch.hvm_domain.params[HVM_PARAM_MEMORY_EVENT_SINGLE_STEP];
@@ -1173,18 +1481,11 @@ void vmx_do_resume(struct vcpu *v)
         vmx_update_debug_state(v);
     }
 
+skip_inteLdbgr:
     hvm_do_resume(v);
     reset_stack_and_jump(vmx_asm_do_vmentry);
 }
 
-static unsigned long vmr(unsigned long field)
-{
-    int rc;
-    unsigned long val;
-    val = __vmread_safe(field, &rc);
-    return rc ? 0 : val;
-}
-
 static void vmx_dump_sel(char *name, uint32_t selector)
 {
     uint32_t sel, attr, limit;
@@ -1346,7 +1647,7 @@ static void vmcs_dump(unsigned char ch)
 
     for_each_domain ( d )
     {
-        if ( !is_hvm_domain(d) )
+        if ( !is_hvm_or_pvh_domain(d) )
             continue;
         printk("\n>>> Domain %d <<<\n", d->domain_id);
         for_each_vcpu ( d, v )
@@ -1531,7 +1832,7 @@ void kdb_curr_cpu_flush_vmcs(void)
     /* looks like we got one. unfortunately, current_vmcs points to vmcs 
      * and not VCPU, so we gotta search the entire list... */
     for_each_domain (dp) {
-        if ( !(is_hvm_or_hyb_domain(dp)) || dp->is_dying)
+        if ( !(is_hvm_or_pvh_domain(dp)) || dp->is_dying)
             continue;
         for_each_vcpu (dp, vp) {
             if ( vp->arch.hvm_vmx.vmcs == cvp ) {
@@ -1562,7 +1863,7 @@ void kdb_dump_vmcs(domid_t did, int vid)
     __vmptrst(&addr);
 
     for_each_domain (dp) {
-        if ( !(is_hvm_or_hyb_domain(dp)) || dp->is_dying)
+        if ( !(is_hvm_or_pvh_domain(dp)) || dp->is_dying)
             continue;
         if (did != 0 && did != dp->domain_id)
             continue;
diff -r 8b0762504037 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Wed Nov 14 11:03:24 2012 -0800
@@ -55,6 +55,7 @@
 #include <asm/debugger.h>
 #include <asm/apic.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/hvm/vmx/pvh.h>
 
 enum handler_return { HNDL_done, HNDL_unhandled, HNDL_exception_raised };
 
@@ -92,6 +93,9 @@ static int vmx_domain_initialise(struct 
     if ( !zalloc_cpumask_var(&d->arch.hvm_domain.vmx.ept_synced) )
         return -ENOMEM;
 
+    if ( is_pvh_domain(d) )
+        return 0;
+
     if ( (rc = vmx_alloc_vlapic_mapping(d)) != 0 )
     {
         free_cpumask_var(d->arch.hvm_domain.vmx.ept_synced);
@@ -129,6 +133,12 @@ static int vmx_vcpu_initialise(struct vc
 
     vpmu_initialise(v);
 
+    if (is_pvh_vcpu(v) ) 
+    {
+        /* this for hvm_long_mode_enabled(v) */
+        v->arch.hvm_vcpu.guest_efer = EFER_SCE | EFER_LMA | EFER_LME;
+        return 0;
+    }
     vmx_install_vlapic_mapping(v);
 
     /* %eax == 1 signals full real-mode support to the guest loader. */
@@ -366,6 +376,10 @@ static int vmx_guest_x86_mode(struct vcp
 {
     unsigned int cs_ar_bytes;
 
+/* PVH: fixme : look at vmcs.cs?? or just assume 8 ?? */
+if ( is_pvh_vcpu(v) )
+    return 8;
+
     if ( unlikely(!(v->arch.hvm_vcpu.guest_cr[0] & X86_CR0_PE)) )
         return 0;
     if ( unlikely(guest_cpu_user_regs()->eflags & X86_EFLAGS_VM) )
@@ -593,7 +607,7 @@ static int vmx_load_vmcs_ctxt(struct vcp
     return 0;
 }
 
-static void vmx_fpu_enter(struct vcpu *v)
+void vmx_fpu_enter(struct vcpu *v)
 {
     vcpu_restore_fpu_lazy(v);
     v->arch.hvm_vmx.exception_bitmap &= ~(1u << TRAP_no_device);
@@ -1051,6 +1065,25 @@ static void vmx_update_host_cr3(struct v
     vmx_vmcs_exit(v);
 }
 
+static noinline void vmx_update_pvh_cr(struct vcpu *v, unsigned int cr)
+{
+    vmx_vmcs_enter(v);
+    switch ( cr )
+    {
+        case 3:
+            __vmwrite(GUEST_CR3, v->arch.hvm_vcpu.guest_cr[3]);
+kdbp("pvh: d:%d update cr3:%lx\n", v->domain->domain_id, v->arch.hvm_vcpu.guest_cr[3]);
+            hvm_asid_flush_vcpu(v);
+            break;
+
+        default:
+            printk("pvh: d%d v%d unexpected cr%d rip:%lx update\n", 
+                   v->domain->domain_id, v->vcpu_id, cr, __vmread(GUEST_RIP));
+            kdb_trap_immed(KDB_TRAP_NONFATAL);
+    }
+    vmx_vmcs_exit(v);
+}
+
 void vmx_update_debug_state(struct vcpu *v)
 {
     unsigned long mask;
@@ -1070,6 +1103,11 @@ void vmx_update_debug_state(struct vcpu 
 
 static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
 {
+    if ( is_pvh_vcpu(v) ) {
+        vmx_update_pvh_cr(v, cr);
+        return;
+    }
+
     vmx_vmcs_enter(v);
 
     switch ( cr )
@@ -1267,7 +1305,7 @@ static int nvmx_vmexit_trap(struct vcpu 
     return NESTEDHVM_VMEXIT_DONE;
 }
 
-static void __vmx_inject_exception(int trap, int type, int error_code)
+static noinline void __vmx_inject_exception(int trap, int type, int error_code)
 {
     unsigned long intr_fields;
     struct vcpu *curr = current;
@@ -1511,7 +1549,10 @@ static struct hvm_function_table __read_
     .nhvm_intr_blocked    = nvmx_intr_blocked,
     .nhvm_domain_relinquish_resources = nvmx_domain_relinquish_resources,
     .update_eoi_exit_bitmap = vmx_update_eoi_exit_bitmap,
-    .virtual_intr_delivery_enabled = vmx_virtual_intr_delivery_enabled
+    .virtual_intr_delivery_enabled = vmx_virtual_intr_delivery_enabled,
+    .pvh_update_cr3       = vmx_pvh_update_cr3,
+    .pvh_set_vcpu_info    = vmx_pvh_set_vcpu_info,
+    .pvh_read_descriptor  = vmx_pvh_read_descriptor
 };
 
 struct hvm_function_table * __init start_vmx(void)
@@ -1543,19 +1584,7 @@ struct hvm_function_table * __init start
     return &vmx_function_table;
 }
 
-/*
- * Not all cases receive valid value in the VM-exit instruction length field.
- * Callers must know what they're doing!
- */
-static int get_instruction_length(void)
-{
-    int len;
-    len = __vmread(VM_EXIT_INSTRUCTION_LEN); /* Safe: callers audited */
-    BUG_ON((len < 1) || (len > 15));
-    return len;
-}
-
-static void update_guest_eip(void)
+void update_guest_eip(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     unsigned long x;
@@ -1633,8 +1662,8 @@ static void vmx_do_cpuid(struct cpu_user
     regs->edx = edx;
 }
 
-static void vmx_dr_access(unsigned long exit_qualification,
-                          struct cpu_user_regs *regs)
+void vmx_dr_access(unsigned long exit_qualification,
+                   struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
 
@@ -2009,7 +2038,7 @@ gp_fault:
     return X86EMUL_EXCEPTION;
 }
 
-static void vmx_do_extint(struct cpu_user_regs *regs)
+void vmx_do_extint(struct cpu_user_regs *regs)
 {
     unsigned int vector;
 
@@ -2260,6 +2289,14 @@ void vmx_vmexit_handler(struct cpu_user_
 
     perfc_incra(vmexits, exit_reason);
 
+    if ( is_pvh_vcpu(v) ) {
+        if ( unlikely(exit_reason & VMX_EXIT_REASONS_FAILED_VMENTRY) )
+            return vmx_failed_vmentry(exit_reason, regs);
+
+        pvh_vmx_vmexit_handler(regs);
+        return;
+    }
+
     /* Handle the interrupt we missed before allowing any more in. */
     switch ( (uint16_t)exit_reason )
     {
diff -r 8b0762504037 xen/arch/x86/hvm/vmx/vmx_pvh.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx_pvh.c	Wed Nov 14 11:03:24 2012 -0800
@@ -0,0 +1,1109 @@
+#include <xen/config.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/trace.h>
+#include <xen/sched.h>
+#include <xen/irq.h>
+#include <xen/softirq.h>
+#include <xen/domain_page.h>
+#include <xen/hypercall.h>
+#include <xen/guest_access.h>
+#include <xen/perfc.h>
+#include <asm/current.h>
+#include <asm/io.h>
+#include <asm/regs.h>
+#include <asm/cpufeature.h>
+#include <asm/processor.h>
+#include <asm/types.h>
+#include <asm/debugreg.h>
+#include <asm/msr.h>
+#include <asm/spinlock.h>
+#include <asm/paging.h>
+#include <asm/p2m.h>
+#include <asm/traps.h>
+#include <asm/mem_sharing.h>
+#include <asm/hvm/emulate.h>
+#include <asm/hvm/hvm.h>
+#include <asm/hvm/support.h>
+#include <asm/hvm/vmx/vmx.h>
+#include <asm/hvm/vmx/vmcs.h>
+#include <public/sched.h>
+#include <public/hvm/ioreq.h>
+#include <asm/hvm/vpic.h>
+#include <asm/hvm/vlapic.h>
+#include <asm/x86_emulate.h>
+#include <asm/hvm/vpt.h>
+#include <public/hvm/save.h>
+#include <asm/hvm/trace.h>
+#include <asm/xenoprof.h>
+#include <asm/debugger.h>
+
+#if 0
+enum handler_return { HNDL_done, HNDL_unhandled, HNDL_exception_raised };
+extern enum handler_return long_mode_do_msr_read(struct cpu_user_regs *);
+extern enum handler_return long_mode_do_msr_write(struct cpu_user_regs *);
+#endif
+
+volatile int mukprint=0, mukspin=1;
+#define dbgp0(...) dprintk(XENLOG_ERR, __VA_ARGS__);
+#define dbgp1(...) {(mukprint==1) ? kdbp(__VA_ARGS__):0;}
+#define dbgp2(...) {(mukprint==2) ? kdbp(__VA_ARGS__):0;}
+
+
+static void read_vmcs_selectors(struct cpu_user_regs *regs)
+{
+    regs->cs = vmr(GUEST_CS_SELECTOR);
+    regs->ss = vmr(GUEST_SS_SELECTOR);
+    regs->ds = vmr(GUEST_DS_SELECTOR);
+    regs->es = vmr(GUEST_ES_SELECTOR);
+    regs->gs = vmr(GUEST_GS_SELECTOR);
+    regs->fs = vmr(GUEST_FS_SELECTOR);
+}
+
+/* returns : 0 success */
+static noinline int vmxit_msr_read(struct cpu_user_regs *regs)
+{
+    int rc=1;
+
+    u64 msr_content = 0;
+    switch (regs->ecx)
+    {
+        case MSR_IA32_MISC_ENABLE:
+        {
+            rdmsrl(MSR_IA32_MISC_ENABLE, msr_content);
+            msr_content |= MSR_IA32_MISC_ENABLE_BTS_UNAVAIL |
+                           MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL;
+            break;
+        }
+        default:
+        {
+            rdmsrl(regs->ecx, msr_content);
+            break;
+        }
+    }
+    regs->eax = (uint32_t)msr_content;
+    regs->edx = (uint32_t)(msr_content >> 32);
+    update_guest_eip();
+    rc = 0;
+
+#if 0
+    rc = (long_mode_do_msr_read(regs) == HNDL_done) ? 0 : 1;
+
+    if ( hvm_msr_read_intercept(regs) == X86EMUL_OKAY ) {
+        update_guest_eip();
+        rc = 0;
+    }
+#endif
+
+    dbgp1("msr read c:%lx a:%lx d:%lx RIP:%lx RSP:%lx\n", regs->ecx, regs->eax, 
+          regs->edx, vmr(GUEST_RIP), vmr(GUEST_RSP));
+    return rc;
+}
+
+/* for now just scratch the cpu since nothing else will run on it. eventually
+ * we need to save and restore these MSRs 
+ * returns : 0 success */
+static noinline int vmxit_msr_write(struct cpu_user_regs *regs)
+{
+    uint64_t msr_content = (uint32_t)regs->eax | ((uint64_t)regs->edx << 32);
+    int rc=1;
+#if 0
+    wrmsr(regs->ecx, regs->eax, regs->edx);
+
+    rc = (long_mode_do_msr_write(regs) == HNDL_done) ? 0 : 1;
+    return rc;
+#endif
+
+    dbgp1("MUK: msr write:0x%lx. eax:0x%lx edx:0x%lx\n", regs->ecx, 
+          regs->eax,regs->edx);
+    if ( hvm_msr_write_intercept(regs->ecx, msr_content) == X86EMUL_OKAY ) {
+        update_guest_eip();
+        rc = 0;
+    }
+    return rc;
+}
+
+/* rc == 0: handled the MTF vmexit */
+static noinline int vmxit_mtf(struct cpu_user_regs *regs)
+{
+    struct vcpu *vp = current;
+    int rc=1, ss=vp->arch.hvm_vcpu.single_step; 
+
+    dbgp2("\n");
+    vp->arch.hvm_vmx.exec_control &= ~CPU_BASED_MONITOR_TRAP_FLAG;
+    __vmwrite(CPU_BASED_VM_EXEC_CONTROL, vp->arch.hvm_vmx.exec_control);
+    vp->arch.hvm_vcpu.single_step = 0;
+
+    /* kdb will set hvm_vcpu.single_step again if ss command */
+    if (kdb_handle_trap_entry(TRAP_debug, regs)) { /* TBD: ifdef KDB */
+        rc = 0;
+    } else if ( vp->domain->debugger_attached && ss ) {
+        domain_pause_for_debugger();
+        rc = 0;
+    }
+    return rc;
+}
+
+static noinline int vmxit_int3(struct cpu_user_regs *regs)
+{
+    struct vcpu *vp = current;
+
+    if ( vp->domain->debugger_attached ) {
+        update_guest_eip();
+
+        if (kdb_handle_trap_entry(TRAP_int3, regs))
+            return 0;
+        else 
+	    /* gdbsx or another debugger. Never pause dom0 */
+            if ( vp->domain->domain_id != 0 && guest_kernel_mode(vp, regs) )
+            {
+                kdbp("[%d]MUK: domain pause for debugger\n",smp_processor_id());
+                current->arch.gdbsx_vcpu_event = TRAP_int3;
+                domain_pause_for_debugger();
+            }
+
+    } else {  /* User mode exception. Inject into the guest */
+
+        /* int ilen = get_instruction_length(); */
+        struct hvm_trap trap_info = { 
+                        .vector = TRAP_int3, 
+                        .type = X86_EVENTTYPE_SW_EXCEPTION,
+                        .error_code = HVM_DELIVER_NO_ERROR_CODE, 
+                        .insn_len = get_instruction_length() 
+        };
+        hvm_inject_trap(&trap_info);
+    }
+    return 0;
+}
+
+volatile int mukprintpf;
+/* rc == 0: handled the exception or NMI */
+static noinline int vmxit_exception(struct cpu_user_regs *regs)
+{
+    unsigned int vector = (__vmread(VM_EXIT_INTR_INFO)) & INTR_INFO_VECTOR_MASK;
+    int rc=1; 
+    struct vcpu *vp = current;
+
+    dbgp2(" EXCPT: vec:%d cs:%x r.IP:%lx\n", vector, vmr(GUEST_CS_SELECTOR), 
+          regs->eip);
+
+    if (vector == TRAP_debug) {
+        unsigned long exit_qualification = __vmread(EXIT_QUALIFICATION);
+        write_debugreg(6, exit_qualification | 0xffff0ff0);
+        regs->rip = vmr(GUEST_RIP); 
+        regs->rsp = vmr(GUEST_RSP);
+        rc = 0;
+        if (kdb_handle_trap_entry(vector, regs)) /* TBD: ifdef KDB */
+            return 0;
+        else {
+	    /* gdbsx or another debugger */
+            if ( vp->domain->domain_id != 0 &&    /* never pause dom0 */
+                 guest_kernel_mode(vp, regs) &&  vp->domain->debugger_attached )
+            {
+                domain_pause_for_debugger();
+            } else {
+                hvm_inject_hw_exception(TRAP_debug, HVM_DELIVER_NO_ERROR_CODE);
+            }
+        }
+    } 
+    if (vector == TRAP_int3) {
+        rc = vmxit_int3(regs);
+    } 
+
+    if (vector == TRAP_invalid_op) {
+#if 0
+kdbp("MUK: invalid op. injection exception. rip:%lx\n", (ulong)vmr(GUEST_RIP));
+kdb_trap_immed(KDB_TRAP_NONFATAL);
+        hvm_inject_hw_exception(TRAP_invalid_op, HVM_DELIVER_NO_ERROR_CODE);
+        rc = 0;
+#endif
+        if ( guest_kernel_mode(vp, regs) || emulate_forced_invalid_op(regs)==0 )
+        {
+            hvm_inject_hw_exception(TRAP_invalid_op, HVM_DELIVER_NO_ERROR_CODE);
+            rc = 0;
+        }
+
+    }
+    if (vector == TRAP_no_device) {
+        hvm_funcs.fpu_dirty_intercept();  /* calls vmx_fpu_dirty_intercept */
+        rc = 0;
+    }
+
+    if (vector == TRAP_gp_fault) {
+        regs->error_code = __vmread(VM_EXIT_INTR_ERROR_CODE);
+        kdbp("MUK: inject GP: errcode:0x%04x RIP:%016lx RSP:%016lx\n", 
+             regs->error_code, (ulong)vmr(GUEST_RIP), 
+             (ulong)vmr(GUEST_RSP));
+
+        kdb_trap_immed(KDB_TRAP_NONFATAL);
+        /* hvm_inject_hw_exception(TRAP_gp_fault, regs->error_code); */
+        rc = 1;
+    }
+
+    if (vector == TRAP_page_fault) {
+        kdbp("Unexpected vector page_fault\n");
+        kdb_trap_immed(KDB_TRAP_NONFATAL);
+#if 0
+        extern int fixup_page_fault(unsigned long , struct cpu_user_regs *);
+        ulong eflags_sav = regs->eflags;
+        unsigned long va = __vmread(EXIT_QUALIFICATION);
+
+        regs->error_code = __vmread(VM_EXIT_INTR_ERROR_CODE);
+
+        if (mukprintpf)
+            kdbp("MUK:PF va:%016lx errcode:0x%04x RIP:%016lx RSP:%016lx", 
+                 va, regs->error_code, (ulong)vmr(GUEST_RIP), 
+                 (ulong)vmr(GUEST_RSP));
+
+        regs->eflags |= X86_EFLAGS_IF;
+        if (fixup_page_fault(va, regs) == 0) {
+            if (mukprintpf)
+                kdbp(" NOT ");
+            current->arch.hvm_vcpu.guest_cr[2] = va;
+            hvm_inject_hw_exception(TRAP_page_fault, regs->error_code);
+        }
+        regs->eflags = eflags_sav;
+        if (mukprintpf)
+            kdbp(" fixedup\n");
+        rc = 0;
+#endif
+    }
+
+    /* TBD: call do_guest_trap() here */
+    if (rc)
+        kdbp("MUK: Unhandled trap vector:%d\n", vector);
+    return rc;
+}
+
+static noinline int vmxit_invlpg(void)
+{
+    ulong vaddr = __vmread(EXIT_QUALIFICATION);
+
+    update_guest_eip();
+    vpid_sync_vcpu_gva(current, vaddr);
+    return 0;
+}
+
+#if 0
+static noinline void native_cpuid(struct cpu_user_regs *regs);
+{
+    uint32_t a, b, c, d;
+
+    a = regs->eax;
+    b = regs->ebx;
+    c = regs->ecx;
+    d = regs->edx;
+
+    asm ( "cpuid"
+          : "=a" (a), "=b" (b), "=c" (c), "=d" (d)
+          : "0" (a), "1" (b), "2" (c), "3" (d) );
+
+    regs->eax = a;
+    regs->ebx = b;
+    regs->ecx = c;
+    regs->edx = d;
+}
+#endif
+
+static noinline int pvh_grant_table_op(
+              unsigned int cmd, XEN_GUEST_HANDLE(void) uop, unsigned int count)
+{
+    switch (cmd)
+    {
+        case GNTTABOP_map_grant_ref:
+        case GNTTABOP_unmap_grant_ref:
+        case GNTTABOP_setup_table:
+        case GNTTABOP_copy:
+        case GNTTABOP_query_size:
+        case GNTTABOP_set_version:
+            return do_grant_table_op(cmd, uop, count);
+    }
+kdbp("MUK: hcall: pvh_grant_table_op: unhandled grant op:%d\n", cmd);
+kdb_trap_immed(KDB_TRAP_NONFATAL);
+    return -ENOSYS;
+}
+
+static long pvh_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
+{
+    long rc = -ENOSYS;
+
+    switch ( cmd )
+    {
+        case VCPUOP_register_runstate_memory_area:
+        case VCPUOP_get_runstate_info:
+        case VCPUOP_set_periodic_timer:
+        case VCPUOP_stop_periodic_timer:
+        case VCPUOP_set_singleshot_timer:
+        case VCPUOP_stop_singleshot_timer:
+        case VCPUOP_is_up:
+        case VCPUOP_up:
+        case VCPUOP_initialise:
+            rc = do_vcpu_op(cmd, vcpuid, arg);
+
+            /* pvh boot vcpu setting context for bringing up smp vcpu */
+            if (cmd == VCPUOP_initialise)
+                vmx_vmcs_enter(current);
+    }
+    return rc;
+}
+
+static long pvh_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+{
+    switch ( cmd )
+    {
+        case PHYSDEVOP_map_pirq:
+        case PHYSDEVOP_unmap_pirq:
+        case PHYSDEVOP_eoi:
+        case PHYSDEVOP_irq_status_query:
+        case PHYSDEVOP_get_free_pirq:
+#if 0
+        case PHYSDEVOP_set_iopl:
+#endif
+            return do_physdev_op(cmd, arg);
+
+        default:
+            if ( IS_PRIV(current->domain) )
+                return do_physdev_op(cmd, arg);
+    }
+    return -ENOSYS;
+}
+
+static noinline long do_pvh_hvm_op(unsigned long op, XEN_GUEST_HANDLE(void) arg)
+{
+    long rc = -EINVAL;
+    struct xen_hvm_param harg;
+    struct domain *d;
+
+    if ( copy_from_guest(&harg, arg, 1) )
+        return -EFAULT;
+
+    rc = rcu_lock_target_domain_by_id(harg.domid, &d);
+    if ( rc != 0 )
+        return rc;
+
+    if (is_hvm_domain(d)) {
+        /* pvh dom0 is building an hvm guest */
+        rcu_unlock_domain(d);
+	return do_hvm_op(op, arg);  
+    }
+
+    rc = -ENOSYS;
+    if (op == HVMOP_set_param) {
+        if (harg.index == HVM_PARAM_CALLBACK_IRQ) {
+            struct hvm_irq *hvm_irq = &d->arch.hvm_domain.irq;
+            uint64_t via = harg.value;
+            uint8_t via_type = (uint8_t)(via >> 56) + 1;
+
+            if (via_type == HVMIRQ_callback_vector) {
+                hvm_irq->callback_via_type = HVMIRQ_callback_vector;
+                hvm_irq->callback_via.vector = (uint8_t)via;
+                rc = 0;
+            }
+        }
+    }
+    return rc;
+}
+
+typedef unsigned long pvh_hypercall_t(
+    unsigned long, unsigned long, unsigned long, unsigned long, unsigned long,
+    unsigned long);
+
+int hcall_a[NR_hypercalls];
+
+static pvh_hypercall_t *pvh_hypercall64_table[NR_hypercalls] = {
+    [__HYPERVISOR_platform_op]     = (pvh_hypercall_t *)do_platform_op,
+    [__HYPERVISOR_memory_op]       = (pvh_hypercall_t *)do_memory_op,
+    /* [__HYPERVISOR_set_timer_op]     = (pvh_hypercall_t *)do_set_timer_op, */
+    [__HYPERVISOR_xen_version]     = (pvh_hypercall_t *)do_xen_version,
+    [__HYPERVISOR_console_io]      = (pvh_hypercall_t *)do_console_io,
+    [__HYPERVISOR_grant_table_op]  = (pvh_hypercall_t *)pvh_grant_table_op,
+    [__HYPERVISOR_vcpu_op]         = (pvh_hypercall_t *)pvh_vcpu_op,
+    [__HYPERVISOR_mmuext_op]       = (pvh_hypercall_t *)do_mmuext_op,
+    [__HYPERVISOR_xsm_op]          = (pvh_hypercall_t *)do_xsm_op,
+    [__HYPERVISOR_sched_op]        = (pvh_hypercall_t *)do_sched_op,
+    [__HYPERVISOR_event_channel_op]= (pvh_hypercall_t *)do_event_channel_op,
+    [__HYPERVISOR_physdev_op]      = (pvh_hypercall_t *)pvh_physdev_op,
+    [__HYPERVISOR_hvm_op]          = (pvh_hypercall_t *)do_pvh_hvm_op,
+    [__HYPERVISOR_sysctl]          = (pvh_hypercall_t *)do_sysctl,
+    [__HYPERVISOR_domctl]          = (pvh_hypercall_t *)do_domctl
+};
+
+/* TBD: Do we need to worry about this and slow things down in this path? */
+static int pvh_long_mode_enabled(void)
+{
+    return 1;
+}
+
+/* Check if hypercall is valid 
+ * Returns: 0 if hcall is not valid with eax set to the errno to ret to guest
+ */
+static noinline int hcall_valid(struct cpu_user_regs *regs)
+{
+    struct segment_register sreg;
+
+    if (!pvh_long_mode_enabled()) {
+        printk("PVH Error: Expected long mode set\n");
+        return 1;
+    }
+    hvm_get_segment_register(current, x86_seg_ss, &sreg);
+    if ( unlikely(sreg.attr.fields.dpl == 3) ) {
+        regs->eax = -EPERM;
+        return 0;
+    }
+
+    /* domU's are not allowed following hcalls */
+    if ( !IS_PRIV(current->domain) &&
+         (regs->eax == __HYPERVISOR_xsm_op ||
+          regs->eax == __HYPERVISOR_platform_op ||
+#if 0
+          regs->eax == __HYPERVISOR_mmuext_op ||    /* for privcmd mmap */
+#endif
+          regs->eax == __HYPERVISOR_domctl) ) {     /* for privcmd mmap */
+
+        regs->eax = -EPERM;
+        return 0;
+    }
+    return 1;
+}
+volatile int mukdbg178=1;
+static noinline int vmxit_vmcall(struct cpu_user_regs *regs)
+{
+    uint32_t hnum = regs->eax;
+
+    if (hnum >= NR_hypercalls || pvh_hypercall64_table[hnum] ==NULL) 
+    {
+        kdbp("MUK: UnImplemented HCALL:%d. ret -ENOSYS to guest\n", regs->eax);
+if (mukdbg178)
+    kdb_trap_immed(KDB_TRAP_NONFATAL);
+        regs->eax = -ENOSYS;
+        update_guest_eip();
+        return HVM_HCALL_completed;
+    }
+
+    dbgp2("vmxit_vmcall: hcall eax:$%ld\n", regs->eax);
+    if (regs->eax == __HYPERVISOR_sched_op && regs->rdi == SCHEDOP_shutdown) {
+        kdbp("MUK: FIXME: SCHEDOP_shutdown hcall\n");
+        regs->eax = -ENOSYS;
+        update_guest_eip();
+        domain_crash_synchronous();
+        return HVM_HCALL_completed;
+    }
+
+    if ( !hcall_valid(regs) ) {
+kdbp("!hcall_valid(). hcall:%d\n", hnum);
+if (mukdbg178)
+    kdb_trap_immed(KDB_TRAP_NONFATAL);
+        return HVM_HCALL_completed;
+    }
+
+
+hcall_a[hnum]++;
+current->arch.hvm_vcpu.hcall_preempted = 0; /* TBD */
+/* search for this and do it. PV method will not work */
+
+    regs->rax = pvh_hypercall64_table[hnum](regs->rdi, regs->rsi, regs->rdx,
+                                            regs->r10, regs->r8, regs->r9);
+
+    if ( !current->arch.hvm_vcpu.hcall_preempted )
+        update_guest_eip();
+    else
+        kdbp("Hcall :%d preempted\n", hnum);
+         
+
+    return HVM_HCALL_completed;
+}
+
+static noinline uint64_t *get_gpr_ptr(struct cpu_user_regs *regs, uint gpr)
+{
+    switch (gpr)
+    {
+        case VMX_CONTROL_REG_ACCESS_GPR_EAX:
+            return &regs->eax;
+        case VMX_CONTROL_REG_ACCESS_GPR_ECX:
+            return &regs->ecx;
+        case VMX_CONTROL_REG_ACCESS_GPR_EDX:
+            return &regs->edx;
+        case VMX_CONTROL_REG_ACCESS_GPR_EBX:
+            return &regs->ebx;
+        case VMX_CONTROL_REG_ACCESS_GPR_ESP:
+            return &regs->esp;
+        case VMX_CONTROL_REG_ACCESS_GPR_EBP:
+            return &regs->ebp;
+        case VMX_CONTROL_REG_ACCESS_GPR_ESI:
+            return &regs->esi;
+        case VMX_CONTROL_REG_ACCESS_GPR_EDI:
+            return &regs->edi;
+        case VMX_CONTROL_REG_ACCESS_GPR_R8:
+            return &regs->r8;
+        case VMX_CONTROL_REG_ACCESS_GPR_R9:
+            return &regs->r9;
+        case VMX_CONTROL_REG_ACCESS_GPR_R10:
+            return &regs->r10;
+        case VMX_CONTROL_REG_ACCESS_GPR_R11:
+            return &regs->r11;
+        case VMX_CONTROL_REG_ACCESS_GPR_R12:
+            return &regs->r12;
+        case VMX_CONTROL_REG_ACCESS_GPR_R13:
+            return &regs->r13;
+        case VMX_CONTROL_REG_ACCESS_GPR_R14:
+            return &regs->r14;
+        case VMX_CONTROL_REG_ACCESS_GPR_R15:
+            return &regs->r15;
+        default:
+            return NULL;
+    }
+}
+/* rc == 0: success */
+static noinline int access_cr0(struct cpu_user_regs *regs, uint acc_typ, 
+                               uint64_t *regp)
+{
+    struct vcpu *vp = current;
+
+    if (acc_typ == VMX_CONTROL_REG_ACCESS_TYPE_MOV_TO_CR )
+    {
+        unsigned long new_cr0 = *regp;
+        unsigned long old_cr0 = __vmread(GUEST_CR0);
+
+        dbgp2("MUK:writing to CR0. RIP:%lx val:0x%lx\n", vmr(GUEST_RIP),*regp);
+        if ( (u32)new_cr0 != new_cr0 )
+        {
+            HVM_DBG_LOG(DBG_LEVEL_1, 
+                        "Guest setting upper 32 bits in CR0: %lx", new_cr0);
+            return 1;
+        }
+
+        new_cr0 &= ~HVM_CR0_GUEST_RESERVED_BITS;
+        /* ET is reserved and should be always be 1. */
+        new_cr0 |= X86_CR0_ET;
+
+        /* pvh cannot change to real mode */
+        if ( (new_cr0 & (X86_CR0_PE|X86_CR0_PG)) != (X86_CR0_PG|X86_CR0_PE) ) {
+            kdbp("Guest attempting to turn off PE/PG. CR0:%lx\n", new_cr0);
+            return 1;
+        }
+        /* TS going from 1 to 0 */
+        if ( (old_cr0 & X86_CR0_TS) && ((new_cr0 & X86_CR0_TS)==0) )
+            vmx_fpu_enter(vp);
+
+        vp->arch.hvm_vcpu.hw_cr[0] = vp->arch.hvm_vcpu.guest_cr[0] = new_cr0;
+        __vmwrite(GUEST_CR0, new_cr0);
+        __vmwrite(CR0_READ_SHADOW, new_cr0);
+    } else {
+        *regp = __vmread(GUEST_CR0);
+    } 
+    return 0;
+}
+
+#if 0
+volatile int mukdbgcr3;
+/* rc == 0: success */
+static noinline int access_cr3(struct cpu_user_regs *regs, uint acc_typ, 
+                               uint64_t *regp)
+{
+    if (acc_typ == VMX_CONTROL_REG_ACCESS_TYPE_MOV_TO_CR ) {
+        unsigned long new_cr3 = *regp;
+
+        __vmwrite(GUEST_CR3, new_cr3);
+        vpid_sync_all();
+        if (mukdbgcr3)
+            kdbp("MUK: mov to cr3:%016lx cs:%lx RIP:%016lx\n", new_cr3,regs->cs,
+                 vmr(GUEST_RIP));
+    } else {
+        *regp = __vmread(GUEST_CR3);
+    }
+
+    return 0;
+}
+#endif
+
+/* rc == 0: success */
+static noinline int access_cr4(struct cpu_user_regs *regs, uint acc_typ, 
+                               uint64_t *regp)
+{
+    if (acc_typ == VMX_CONTROL_REG_ACCESS_TYPE_MOV_TO_CR )
+    {
+        u64 old_cr4 = __vmread(GUEST_CR4);
+        /* kdbp("MUK:writing to CR4. val:0x%lx\n", *regp); */
+
+        if ( (old_cr4 ^ (*regp)) & (X86_CR4_PSE | X86_CR4_PGE | X86_CR4_PAE) )
+            vpid_sync_all();
+
+        /* pvh_verify_cr4_wr(*regp)); */
+        __vmwrite(GUEST_CR4, *regp);
+    } else {
+        *regp = __vmread(GUEST_CR4);
+        kdbp("MUK: read cr4. val:0x%lx\n", *regp);
+    } 
+    return 0;
+}
+
+/* rc == 0: success */
+static noinline int vmxit_cr_access(struct cpu_user_regs *regs)
+{
+    unsigned long exit_qualification = __vmread(EXIT_QUALIFICATION);
+    uint acc_typ = VMX_CONTROL_REG_ACCESS_TYPE(exit_qualification);
+    int cr, rc = 1;
+
+    switch ( acc_typ )
+    {
+        case VMX_CONTROL_REG_ACCESS_TYPE_MOV_TO_CR:
+        case VMX_CONTROL_REG_ACCESS_TYPE_MOV_FROM_CR:
+        {
+            uint gpr = VMX_CONTROL_REG_ACCESS_GPR(exit_qualification);
+            uint64_t *regp = get_gpr_ptr(regs, gpr);
+            cr = VMX_CONTROL_REG_ACCESS_NUM(exit_qualification);
+
+            if (regp == NULL)
+                break;
+
+            /* pl don't embed switch statements */
+            if (cr == 0)
+                rc = access_cr0(regs, acc_typ, regp);
+            else if (cr == 3) {
+                printk("PVH: d%d: unexpected cr3 access vmexit. rip:%lx\n", 
+		       current->domain->domain_id, vmr(GUEST_RIP));
+                domain_crash_synchronous();
+            } else if (cr == 4) 
+                rc = access_cr4(regs, acc_typ, regp);
+
+            if (rc == 0)
+                update_guest_eip();
+            break;
+        }
+        case VMX_CONTROL_REG_ACCESS_TYPE_CLTS:
+        {
+#if 0
+            unsigned long cr0 = __vmread(GUEST_CR0);
+            cr0 &= ~X86_CR0_TS;
+#endif
+            struct vcpu *vp = current;
+            unsigned long cr0 = vp->arch.hvm_vcpu.guest_cr[0] & ~X86_CR0_TS;
+            vp->arch.hvm_vcpu.hw_cr[0] = vp->arch.hvm_vcpu.guest_cr[0] = cr0;
+            vmx_fpu_enter(vp);
+            __vmwrite(GUEST_CR0, cr0);
+            __vmwrite(CR0_READ_SHADOW, cr0);
+            update_guest_eip();
+            rc = 0;
+        }
+    }
+    return rc;
+}
+
+static int noinline vmxit_io_instr(struct cpu_user_regs *regs)
+{
+    int curr_lvl;
+    int requested = (regs->rflags >> 12) & 3;
+
+    read_vmcs_selectors(regs);
+    curr_lvl = regs->cs & 3;
+
+    if (requested >= curr_lvl && emulate_privileged_op(regs)) 
+        return 0;
+
+    kdbp("MUK: io instr about to inject gpf. req:%x curr:%x\n", requested, 
+         curr_lvl);
+    kdb_trap_immed(KDB_TRAP_NONFATAL);
+    hvm_inject_hw_exception(TRAP_gp_fault, regs->error_code);
+
+    return 0;
+}
+
+static noinline int pvh_ept_handle_violation(unsigned long qualification, paddr_t gpa)
+{
+    unsigned long gla, gfn = gpa >> PAGE_SHIFT;
+    p2m_type_t p2mt;
+    mfn_t mfn = get_gfn_query_unlocked(current->domain, gfn, &p2mt);
+
+    gdprintk(XENLOG_ERR, "Dom:%d EPT violation %#lx (%c%c%c/%c%c%c), "
+             "gpa %#"PRIpaddr", mfn %#lx, type %i.\n",
+             current->domain->domain_id, qualification, 
+             (qualification & EPT_READ_VIOLATION) ? 'r' : '-',
+             (qualification & EPT_WRITE_VIOLATION) ? 'w' : '-',
+             (qualification & EPT_EXEC_VIOLATION) ? 'x' : '-',
+             (qualification & EPT_EFFECTIVE_READ) ? 'r' : '-',
+             (qualification & EPT_EFFECTIVE_WRITE) ? 'w' : '-',
+             (qualification & EPT_EFFECTIVE_EXEC) ? 'x' : '-',
+             gpa, mfn_x(mfn), p2mt);
+             
+    ept_walk_table(current->domain, gfn);
+
+    if ( qualification & EPT_GLA_VALID )
+    {
+        gla = __vmread(GUEST_LINEAR_ADDRESS);
+        gdprintk(XENLOG_ERR, " --- GLA %#lx\n", gla);
+    }
+#if 0
+    if (vmr(GUEST_CS_SELECTOR) & 3 == 3) {
+	kdbp("EPT Violation in user mode. inject GP\n");
+        hvm_inject_hw_exception(TRAP_gp_fault, regs->error_code);
+    } else
+#endif
+        hvm_inject_hw_exception(TRAP_gp_fault, 0);
+        kdb_trap_immed(KDB_TRAP_NONFATAL);
+
+    return 0;
+}
+
+#if 0
+/* emulate write_cr3(read_cr3()) in guest. */
+static noinline int vmxit_invvpid(void)
+{
+    hvm_asid_flush_vcpu(current);
+    return 0;
+}
+#endif
+volatile int mukcpuiddbg=0;
+static noinline void pvh_cpuid(struct cpu_user_regs *regs)
+{
+    unsigned int eax, ebx, ecx, edx;
+
+    if (mukcpuiddbg)
+        kdbp("ucpuid: rax:%lx bx:%lx cx:%lx dx:%lx\n", regs->rax, regs->rbx,
+             regs->rcx, regs->rdx);
+
+    asm volatile ( "cpuid"
+              : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
+              : "0" (regs->eax), "2" (regs->rcx) );
+
+    regs->rax = eax; regs->rbx = ebx; regs->rcx = ecx; regs->rdx = edx;
+    if (mukcpuiddbg)
+        kdbp("done: rax:%lx bx:%lx cx:%lx dx:%lx\n", regs->rax, regs->rbx,
+             regs->rcx, regs->rdx);
+}
+
+volatile int mukprdr7, mukprtsc=1, mukcrashit;
+void pvh_vmx_vmexit_handler(struct cpu_user_regs *regs)
+{
+    unsigned long exit_qualification;
+    unsigned int vector, exit_reason = __vmread(VM_EXIT_REASON);
+    int rc=0, ccpu = smp_processor_id();
+    struct vcpu *vp = current;
+
+#if defined(XEN_KDB_CONFIG)
+{
+    if (kdb_dr7)
+        write_debugreg(7, kdb_dr7);
+}
+#endif
+    if (mukprdr7) 
+        kdbp("MUK: vmexit dr0:%lx 7:%lx vmcs.7:%lx\n", read_debugreg(0),
+              read_debugreg(7), __vmread(GUEST_DR7));
+
+    dbgp1("MUK:[%d]left VMCS exitreas:%d RIP:%lx RSP:%lx EFLAGS:%lx CR0:%lx\n", 
+          ccpu, exit_reason, vmr(GUEST_RIP), vmr(GUEST_RSP), regs->rflags, 
+          vmr(GUEST_CR0));
+
+    /* for guest_kernel_mode in fixup_page_fault() */
+    regs->cs = vmr(GUEST_CS_SELECTOR); 
+
+    switch ( (uint16_t)exit_reason )
+    {
+        case EXIT_REASON_EXCEPTION_NMI:
+        case EXIT_REASON_EXTERNAL_INTERRUPT:
+        case EXIT_REASON_MCE_DURING_VMENTRY:
+            break;
+        default:
+            local_irq_enable();
+    }
+
+    switch ( (uint16_t)exit_reason )
+    {
+        case EXIT_REASON_EXCEPTION_NMI:      /* 0 */
+            rc = vmxit_exception(regs);
+            break;
+            
+        case EXIT_REASON_EXTERNAL_INTERRUPT: /* 1 */
+        {
+            vector = __vmread(VM_EXIT_INTR_INFO);
+            vector &= INTR_INFO_VECTOR_MASK;
+#if 0
+            dbgp2("MUK: [%d] exit vmcs reas:%d vec:%d cr0:0x%016lx\n", ccpu, 
+                 exit_reason, vector, vmr(GUEST_CR0));
+#endif
+            vmx_do_extint(regs);
+            break;
+        }
+
+        case EXIT_REASON_TRIPLE_FAULT:  /* 2 */
+        {
+#if 0
+            static int once;
+     if (!once)
+     kdbp("MUK:[%d]left VMCS exitreas:%d RIP:%lx RSP:%lx EFLAGS:%lx CR0:%lx\n",
+          ccpu, exit_reason, vmr(GUEST_RIP), vmr(GUEST_RSP), regs->rflags, 
+          vmr(GUEST_CR0));
+            once = 1;
+            hvm_inject_hw_exception(TRAP_gp_fault, regs->error_code);
+            rc = 0;
+#endif
+     kdbp("MUK:Triple Flt:[%d]exitreas:%d RIP:%lx RSP:%lx EFLAGS:%lx CR3:%lx\n",
+          ccpu, exit_reason, vmr(GUEST_RIP), vmr(GUEST_RSP), regs->rflags, 
+          vmr(GUEST_CR3));
+
+    if ( paging_mode_hap(vp->domain) && hvm_paging_enabled(vp) )
+        vp->arch.hvm_vcpu.guest_cr[3] = vp->arch.hvm_vcpu.hw_cr[3] =
+                                                           __vmread(GUEST_CR3);
+            kdb_trap_immed(KDB_TRAP_NONFATAL);
+            rc = 1;
+            break;
+        }
+        case EXIT_REASON_PENDING_VIRT_INTR:  /* 7 */
+        {
+            struct vcpu *v = current;
+            /* Disable the interrupt window. */
+            v->arch.hvm_vmx.exec_control &= ~CPU_BASED_VIRTUAL_INTR_PENDING;
+            __vmwrite(CPU_BASED_VM_EXEC_CONTROL, v->arch.hvm_vmx.exec_control);
+            break;
+        }
+
+        case EXIT_REASON_CPUID:              /* 10 */
+        {
+            if ( guest_kernel_mode(vp, regs) ) {
+                pv_cpuid(regs);
+
+                /* Because we are setting CR4.OSFXSR to 0, we need to disable
+                 * this because, during boot, user process "init" (which doesn't
+                 * do cpuid), will do 'pxor xmm0,xmm0' and cause #UD. For now 
+                 * disable this. HVM doesn't allow setting of CR4.OSFXSR.
+                 * TBD/FIXME: this and also look at CR4.OSXSAVE */
+
+                __clear_bit(X86_FEATURE_FXSR, &regs->edx);
+            } else
+                pvh_cpuid(regs);
+
+             /* TBD/FIXME: investigate and fix the XSAVE/MMX/FPU stuff */
+
+            update_guest_eip();
+            dbgp2("cpuid:%d RIP:%lx\n", regs->eax, vmr(GUEST_RIP));
+            break;
+        }
+
+        case EXIT_REASON_HLT:             /* 12 */
+	{
+            update_guest_eip();
+            hvm_hlt(regs->eflags);
+	    break;
+#if 0
+            XEN_GUEST_HANDLE(void) p = {NULL};
+	    /* hvm_event_pending ?? see hvm_hlt() */
+	    do_sched_op(SCHEDOP_block, p);
+#endif
+	}
+
+        case EXIT_REASON_INVLPG:             /* 14 */
+            rc = vmxit_invlpg();
+            break;
+
+        case EXIT_REASON_RDTSC:              /* 16 */
+        {
+#if 0
+            uint64_t tsc;
+            int ilen=get_instruction_length();
+            rdtscll(tsc);
+            regs->eax = (uint32_t)tsc;
+            regs->edx = (uint32_t)(tsc >> 32);
+            rdtsc(regs->eax, regs->edx);
+if (mukprtsc)
+    kdbp(" RDTSC: eax:%lx edx:%lx\n", regs->eax, regs->edx);
+            update_guest_eip();
+#endif
+            rc = 1;
+            break;
+        }
+
+        case EXIT_REASON_VMCALL:             /* 18 */
+            rc = vmxit_vmcall(regs);
+            break;
+
+        case EXIT_REASON_CR_ACCESS:          /* 28 */
+            rc = vmxit_cr_access(regs);
+            break;
+
+        case EXIT_REASON_DR_ACCESS:          /* 29 */
+        {
+            exit_qualification = __vmread(EXIT_QUALIFICATION);
+#if defined(XEN_KDB_CONFIG)
+            update_guest_eip();
+            break;
+#endif
+            vmx_dr_access(exit_qualification, regs);
+            break;
+        }
+
+        case EXIT_REASON_IO_INSTRUCTION:
+            vmxit_io_instr(regs);
+            break;
+
+        case EXIT_REASON_MSR_READ:           /* 31 */
+            rc = vmxit_msr_read(regs);
+            break;
+
+        case EXIT_REASON_MSR_WRITE:          /* 32 */
+            rc = vmxit_msr_write(regs);
+            break;
+
+        case EXIT_REASON_MONITOR_TRAP_FLAG:  /* 37 */
+            rc = vmxit_mtf(regs);
+            break;
+
+        case EXIT_REASON_EPT_VIOLATION:
+        {
+            paddr_t gpa = __vmread(GUEST_PHYSICAL_ADDRESS);
+            exit_qualification = __vmread(EXIT_QUALIFICATION);
+            rc = pvh_ept_handle_violation(exit_qualification, gpa);
+            break;
+        }
+#if 0
+        case EXIT_REASON_INVVPID:            /* 53 */
+            rc = vmxit_invvpid();
+            break;
+#endif
+        default: 
+            rc = 1;
+            kdbp("Unexpected exit reason:%d 0x%x\n", exit_reason, exit_reason);
+    }
+    if (rc) {
+        exit_qualification = __vmread(EXIT_QUALIFICATION);
+        kdbp("MUK: [%d] exit_reas:%d 0x%lx qual:%ld 0x%lx cr0:0x%016lx\n", 
+             ccpu, exit_reason, exit_reason, exit_qualification,
+             exit_qualification, vmr(GUEST_CR0));
+        kdbp("MUK: [%d] RIP:%lx RSP:%lx\n", ccpu, 
+             vmr(GUEST_RIP), vmr(GUEST_RSP));
+        domain_crash_synchronous();
+    }
+
+if (mukcrashit)
+    domain_crash_synchronous();
+
+    /*dbgp("MUK: will enter vmcs: cs:%x ss:%x\n", vmr(GUEST_CS_SELECTOR),
+         vmr(GUEST_SS_SELECTOR)); */
+
+    dbgp1("MUK: will enter vmcs:RIP:%lx RSP:%lx cr0:%lx eflags:%lx\n", 
+          vmr(GUEST_RIP), vmr(GUEST_RSP), vmr(GUEST_CR0), regs->rflags);
+
+    if (mukprdr7) 
+        kdbp("MUK: vmexit dr0:%lx 7:%lx vmcs.7:%lx\n", read_debugreg(0),
+              read_debugreg(7), __vmread(GUEST_DR7));
+
+}
+
+void pvh_flush_tlb(void)
+{
+    vpid_sync_all();
+}
+
+void pvh_do_invlpg(ulong addr)
+{
+    /* vpid_sync_all(); */
+    vpid_sync_vcpu_gva(current, addr);
+}
+
+/* 
+ * Sets info for non boot vcpu. VCPU 0 context is set by library which needs 
+ * to be modified to send
+ * correct selectors and gs_base. For now, we use this for nonboot vcpu 
+ * in which case the call somes from the kernel cpu_initialize_context().
+ */
+int vmx_pvh_set_vcpu_info(struct vcpu *v, struct vcpu_guest_context *ctxtp)
+{
+kdbp("MUK: bringup pvh vcpu: cs:%x ds:%x es:%x ss:%x gsbase:%lx\n", 
+     ctxtp->user_regs.cs, ctxtp->user_regs.ds, ctxtp->user_regs.es,
+     ctxtp->user_regs.ss, ctxtp->gs_base_kernel);
+kdbp("MUK: bringup pvh vcpu: gdtr base:%lx sz:%lx gsusr:%lx\n", 
+ctxtp->u.pvh.gdtaddr, ctxtp->u.pvh.gdtsz, ctxtp->gs_base_user);
+
+    if (v->vcpu_id == 0)
+        return 0;
+
+    vmx_vmcs_enter(v);
+    __vmwrite(GUEST_GDTR_BASE, ctxtp->u.pvh.gdtaddr);
+    __vmwrite(GUEST_GDTR_LIMIT, ctxtp->u.pvh.gdtsz);
+    __vmwrite(GUEST_GS_BASE, ctxtp->gs_base_user);
+
+    __vmwrite(GUEST_CS_SELECTOR, ctxtp->user_regs.cs);
+    __vmwrite(GUEST_DS_SELECTOR, ctxtp->user_regs.ds);
+    __vmwrite(GUEST_ES_SELECTOR, ctxtp->user_regs.es);
+    __vmwrite(GUEST_SS_SELECTOR, ctxtp->user_regs.ss);
+    __vmwrite(GUEST_GS_SELECTOR, ctxtp->user_regs.gs);
+
+    if ( vmx_add_guest_msr(MSR_SHADOW_GS_BASE) )
+        return -EINVAL;
+
+    vmx_write_guest_msr(MSR_SHADOW_GS_BASE, ctxtp->gs_base_kernel);
+
+    vmx_vmcs_exit(v);
+    return 0;
+}
+
+void vmx_pvh_update_cr3(struct vcpu *v)
+{
+kdbp("MUK: in vmx_pvh_update_cr3\n");
+kdb_trap_immed(KDB_TRAP_NONFATAL);
+    vmx_vmcs_enter(v);
+    __vmwrite(GUEST_CR3, v->arch.cr3);
+    __vmwrite(HOST_CR3, v->arch.cr3);
+
+    vpid_sync_all();
+    /* hvm_asid_flush_vcpu(v); ????????????? */
+    vmx_vmcs_exit(v);
+}
+
+
+int vmx_pvh_read_descriptor(unsigned int sel, const struct vcpu *v,
+                            const struct cpu_user_regs *regs,
+                            unsigned long *base, unsigned long *limit,
+                            unsigned int *ar)
+{
+    unsigned int tmp_ar = 0;
+    BUG_ON(v!=current);
+    BUG_ON(!is_pvh_vcpu(v));
+
+    if (sel == (unsigned int)regs->cs) {
+        *base = vmr(GUEST_CS_BASE);
+        *limit = vmr(GUEST_CS_LIMIT);
+        tmp_ar = vmr(GUEST_CS_AR_BYTES); 
+    } else if (sel == (unsigned int)regs->ds) {
+        *base = vmr(GUEST_DS_BASE);
+        *limit = vmr(GUEST_DS_LIMIT);
+        tmp_ar = vmr(GUEST_DS_AR_BYTES); 
+    } else if (sel == (unsigned int)regs->ss) {
+        *base = vmr(GUEST_SS_BASE);
+        *limit = vmr(GUEST_SS_LIMIT);
+        tmp_ar = vmr(GUEST_SS_AR_BYTES); 
+    } else if (sel == (unsigned int)regs->gs) {
+        *base = vmr(GUEST_GS_BASE);
+        *limit = vmr(GUEST_GS_LIMIT);
+        tmp_ar = vmr(GUEST_GS_AR_BYTES); 
+    } else if (sel == (unsigned int)regs->fs) {
+        *base = vmr(GUEST_FS_BASE);
+        *limit = vmr(GUEST_FS_LIMIT);
+        tmp_ar = vmr(GUEST_FS_AR_BYTES); 
+    } else if (sel == (unsigned int)regs->es) {
+        *base = vmr(GUEST_ES_BASE);
+        *limit = vmr(GUEST_ES_LIMIT);
+        tmp_ar = vmr(GUEST_ES_AR_BYTES); 
+    } else {
+        kdbp("Unmatche segment selector:%d\n", sel);
+        kdb_trap_immed(KDB_TRAP_NONFATAL);
+    }
+
+    if (tmp_ar & X86_SEG_AR_CS_LM_ACTIVE) {           /* x86 mess!! */
+        *base = 0UL;
+        *limit = ~0UL;
+    }
+    /* Fixup ar so that it looks the same as in native mode */
+    *ar = (tmp_ar << 8);
+    return 1;
+}
+
+int pvh_segment_bad(unsigned int ar, struct vcpu *v)
+{
+    int rc;
+
+    BUG_ON(v!=current);
+    BUG_ON(!is_pvh_vcpu(v));
+    rc = !(ar & X86_SEG_AR_DESC_TYPE) || !(ar & X86_SEG_AR_SEG_PRESENT) ||
+         !(ar & X86_SEG_AR_SEG_TYPE_CODE);
+    return rc;
+}
+
diff -r 8b0762504037 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/mm.c	Wed Nov 14 11:03:24 2012 -0800
@@ -2608,7 +2608,7 @@ static struct domain *get_pg_owner(domid
         goto out;
     }
 
-    if ( unlikely(paging_mode_translate(curr)) )
+    if ( !is_pvh_domain(curr) && unlikely(paging_mode_translate(curr)) )
     {
         MEM_LOG("Cannot mix foreign mappings with translated domains");
         goto out;
@@ -3667,7 +3667,7 @@ static int destroy_grant_va_mapping(
     return replace_grant_va_mapping(addr, frame, l1e_empty(), v);
 }
 
-static int create_grant_p2m_mapping(uint64_t addr, unsigned long frame,
+static noinline int create_grant_p2m_mapping(uint64_t addr, unsigned long frame,
                                     unsigned int flags,
                                     unsigned int cache_flags)
 {
@@ -3742,6 +3742,22 @@ static int replace_grant_p2m_mapping(
     }
     guest_physmap_remove_page(d, gfn, frame, PAGE_ORDER_4K);
 
+    if (is_pvh_domain(d)) {
+        struct page_info *page = alloc_domheap_page(d, 0);
+
+	if (page == NULL) {
+	    gdprintk(XENLOG_ERR, "Unable to alloc domheap page\n");
+#if 0
+            /* the guest will crash anyways with ept fault when gfn accessed */
+	    domain_crash_synchronous();
+#endif
+	}
+	if (guest_physmap_add_page(d, gfn, page_to_mfn(page), 0) != 0) {
+	    gdprintk(XENLOG_ERR, "Unable to add mfn to replace grant\n");
+	    /* domain_crash_synchronous(); */
+            return GNTST_general_error;
+        }
+    }
     put_gfn(d, gfn);
     return GNTST_okay;
 }
@@ -4143,7 +4159,7 @@ long do_update_descriptor(u64 pa, u64 de
     page = get_page_from_gfn(dom, gmfn, NULL, P2M_ALLOC);
     if ( (((unsigned int)pa % sizeof(struct desc_struct)) != 0) ||
          !page ||
-         !check_descriptor(dom, &d) )
+         (!is_pvh_domain(dom) && !check_descriptor(dom, &d)) )
     {
         if ( page )
             put_page(page);
@@ -4217,9 +4233,106 @@ static int handle_iomem_range(unsigned l
     return 0;
 }
 
-static int xenmem_add_to_physmap_once(
-    struct domain *d,
-    const struct xen_add_to_physmap *xatp)
+/* add frames from foreign domain to current domain physmap. Similar to 
+ * XENMAPSPACE_gmfn but the frame is foreign being mapped into current,
+ * and is not removed from foreign domain. 
+ * Usage: libxl on pvh dom0 creating guest and doing privcmd_ioctl_mmap
+ * Returns: 0 ==> success
+ */
+static long noinline xenmem_add_foreign_to_pmap( domid_t foreign_domid, 
+                                        unsigned long fgmfn, unsigned long gpfn)
+{
+    unsigned long rc=0, failed=0, prev_mfn, mfn = 0;
+    struct domain *fdom, *currd = current->domain;
+    p2m_type_t p2mt, p2mt_prev;
+
+    if ( (fdom = get_pg_owner(foreign_domid)) == NULL ) {
+        kdb_trap_immed(KDB_TRAP_NONFATAL);
+        return -EPERM;
+    }
+failed = 0;
+
+    mfn = mfn_x(get_gfn_query_unlocked(fdom, fgmfn, &p2mt));
+
+    /* qemu, running on PVH dom0, mapping hvm domain's pages during domain 
+     * creation, doesn't have mfns in the HAP table */
+    if ( !mfn_valid(mfn) && p2m_is_mmio(p2mt) ) {
+
+        if (!is_hvm_domain(fdom)) {
+            printk("mmio type for non-hvm domain. fd:%d fgmfn:%lx gpfn:%lx\n",
+                   foreign_domid, fgmfn, gpfn);
+            kdb_trap_immed(KDB_TRAP_NONFATAL);
+        }
+        mfn = fgmfn;
+    }
+
+    if ( !p2m_is_valid(p2mt) ) {
+        put_pg_owner(fdom);
+        return -EINVAL;
+    }
+#if 0
+    if (paging_mode_external(fdom)) {
+        /* Foreign mappings into guests in shadow external mode don't       
+         * contribute to writeable mapping refcounts.  (This allows the
+         * qemu-dm helper process in dom0 to map the domain's memory without
+         * messing up the count of "real" writable mappings.) */
+        if (get_page_from_pagenr(mfn, fdom) == 0)
+            failed = 1;
+    } else {
+        if (get_page_and_type_from_pagenr(mfn, PGT_writable_page, fdom, 0, 0))
+            failed = 1;
+    }
+    if (failed) {
+        put_pg_owner(fdom);
+        return -EINVAL;
+    }
+#endif
+    /* Remove previously mapped page if it was present. */
+    prev_mfn = mfn_x(get_gfn_query_unlocked(currd, gpfn, &p2mt_prev));
+    if ( mfn_valid(prev_mfn) )
+    {
+        if ( is_xen_heap_mfn(prev_mfn) )
+            /* Xen heap frames are simply unhooked from this phys slot */
+            guest_physmap_remove_page(currd, gpfn, prev_mfn, 0);
+        else
+            /* Normal domain memory is freed, to avoid leaking memory. */
+            guest_remove_page(currd, gpfn);
+    }
+/* I CAN PROB remove the mmio because all io space is mapped upfront via
+ * domctl_memory_mapping */
+    /* Map at new location. */
+    /* Can't use guest_physmap_add_page() because it will update the m2p
+     * table so mfn ---> gpfn in dom0 and not gpfn of domU.
+     */
+    if ( p2m_is_mmio(p2mt) ) {
+        if (set_mmio_p2m_entry(currd, gpfn, mfn) == 0) {
+            kdbp("guest_physmap_add_page failed. gpfn:%lx mfn:%lx fgmfn:%lx\n", 
+                 gpfn, mfn, fgmfn);
+            kdb_trap_immed(KDB_TRAP_NONFATAL);
+            rc = -EINVAL;
+        }
+        goto out;
+    }
+    if (set_foreign_p2m_entry(currd, gpfn, mfn) == 0) {
+#if 0
+        if (paging_mode_external(fdom))
+            put_page(mfn_to_page(mfn));
+        else
+            put_page_and_type(mfn_to_page(mfn));
+#endif
+        kdbp("guest_physmap_add_page failed1. gpfn:%lx mfn:%lx fgmfn:%lx\n", 
+             gpfn, mfn, fgmfn);
+        kdb_trap_immed(KDB_TRAP_NONFATAL);
+        rc = -EINVAL;
+    }
+out:
+    put_pg_owner(fdom);
+    return rc;
+}
+
+static noinline int xenmem_add_to_physmap_once(
+    struct domain *d, uint16_t xatp_space, domid_t foreign_domid,
+    unsigned long xatp_idx, unsigned long xatp_gpfn)
 {
     struct page_info *page = NULL;
     unsigned long gfn = 0; /* gcc ... */
@@ -4227,10 +4340,10 @@ static int xenmem_add_to_physmap_once(
     int rc;
     p2m_type_t p2mt;
 
-    switch ( xatp->space )
+    switch ( xatp_space )
     {
         case XENMAPSPACE_shared_info:
-            if ( xatp->idx == 0 )
+            if ( xatp_idx == 0 )
                 mfn = virt_to_mfn(d->shared_info);
             break;
         case XENMAPSPACE_grant_table:
@@ -4239,9 +4352,9 @@ static int xenmem_add_to_physmap_once(
             if ( d->grant_table->gt_version == 0 )
                 d->grant_table->gt_version = 1;
 
-            idx = xatp->idx;
+            idx = xatp_idx;
             if ( d->grant_table->gt_version == 2 &&
-                 (xatp->idx & XENMAPIDX_grant_table_status) )
+                 (xatp_idx & XENMAPIDX_grant_table_status) )
             {
                 idx &= ~XENMAPIDX_grant_table_status;
                 if ( idx < nr_status_frames(d->grant_table) )
@@ -4263,9 +4376,9 @@ static int xenmem_add_to_physmap_once(
         case XENMAPSPACE_gmfn:
         {
             p2m_type_t p2mt;
-            gfn = xatp->idx;
-
-            idx = mfn_x(get_gfn_unshare(d, xatp->idx, &p2mt));
+            gfn = xatp_idx;
+
+            idx = mfn_x(get_gfn_unshare(d, xatp_idx, &p2mt));
             /* If the page is still shared, exit early */
             if ( p2m_is_shared(p2mt) )
             {
@@ -4278,6 +4391,13 @@ static int xenmem_add_to_physmap_once(
             page = mfn_to_page(mfn);
             break;
         }
+
+        case XENMAPSPACE_gmfn_foreign:
+        {
+            rc = xenmem_add_foreign_to_pmap(foreign_domid, xatp_idx, xatp_gpfn);
+            return rc;
+        }
+
         default:
             break;
     }
@@ -4286,8 +4406,8 @@ static int xenmem_add_to_physmap_once(
     {
         if ( page )
             put_page(page);
-        if ( xatp->space == XENMAPSPACE_gmfn ||
-             xatp->space == XENMAPSPACE_gmfn_range )
+        if ( xatp_space == XENMAPSPACE_gmfn ||
+             xatp_space == XENMAPSPACE_gmfn_range )
             put_gfn(d, gfn);
         return -EINVAL;
     }
@@ -4298,41 +4418,41 @@ static int xenmem_add_to_physmap_once(
         put_page(page);
 
     /* Remove previously mapped page if it was present. */
-    prev_mfn = mfn_x(get_gfn(d, xatp->gpfn, &p2mt));
+    prev_mfn = mfn_x(get_gfn(d, xatp_gpfn, &p2mt));
     if ( mfn_valid(prev_mfn) )
     {
         if ( is_xen_heap_mfn(prev_mfn) )
             /* Xen heap frames are simply unhooked from this phys slot. */
-            guest_physmap_remove_page(d, xatp->gpfn, prev_mfn, PAGE_ORDER_4K);
+            guest_physmap_remove_page(d, xatp_gpfn, prev_mfn, PAGE_ORDER_4K);
         else
             /* Normal domain memory is freed, to avoid leaking memory. */
-            guest_remove_page(d, xatp->gpfn);
+            guest_remove_page(d, xatp_gpfn);
     }
     /* In the XENMAPSPACE_gmfn case we still hold a ref on the old page. */
-    put_gfn(d, xatp->gpfn);
+    put_gfn(d, xatp_gpfn);
 
     /* Unmap from old location, if any. */
     gpfn = get_gpfn_from_mfn(mfn);
     ASSERT( gpfn != SHARED_M2P_ENTRY );
-    if ( xatp->space == XENMAPSPACE_gmfn ||
-         xatp->space == XENMAPSPACE_gmfn_range )
+    if ( xatp_space == XENMAPSPACE_gmfn ||
+         xatp_space == XENMAPSPACE_gmfn_range )
         ASSERT( gpfn == gfn );
     if ( gpfn != INVALID_M2P_ENTRY )
         guest_physmap_remove_page(d, gpfn, mfn, PAGE_ORDER_4K);
 
     /* Map at new location. */
-    rc = guest_physmap_add_page(d, xatp->gpfn, mfn, PAGE_ORDER_4K);
+    rc = guest_physmap_add_page(d, xatp_gpfn, mfn, PAGE_ORDER_4K);
 
     /* In the XENMAPSPACE_gmfn, we took a ref of the gfn at the top */
-    if ( xatp->space == XENMAPSPACE_gmfn ||
-         xatp->space == XENMAPSPACE_gmfn_range )
+    if ( xatp_space == XENMAPSPACE_gmfn ||
+         xatp_space == XENMAPSPACE_gmfn_range )
         put_gfn(d, gfn);
     domain_unlock(d);
 
     return rc;
 }
 
-static int xenmem_add_to_physmap(struct domain *d,
+static noinline int xenmem_add_to_physmap(struct domain *d,
                                  struct xen_add_to_physmap *xatp)
 {
     struct xen_add_to_physmap start_xatp;
@@ -4346,7 +4466,8 @@ static int xenmem_add_to_physmap(struct 
         start_xatp = *xatp;
         while ( xatp->size > 0 )
         {
-            rc = xenmem_add_to_physmap_once(d, xatp);
+            rc = xenmem_add_to_physmap_once(d, xatp->space, -1,
+                                            xatp->idx, xatp->gpfn);
             if ( rc < 0 )
                 return rc;
 
@@ -4372,7 +4493,50 @@ static int xenmem_add_to_physmap(struct 
         return rc;
     }
 
-    return xenmem_add_to_physmap_once(d, xatp);
+    return xenmem_add_to_physmap_once(d, xatp->space, -1,
+                                      xatp->idx, xatp->gpfn);
+}
+
+static noinline int xenmem_add_to_physmap_range(struct domain *d,
+                                       struct xen_add_to_physmap_range *xatpr)
+{
+    int rc;
+
+    /* Process entries in reverse order to allow continuations */
+    while ( xatpr->size > 0 )
+    {
+        xen_ulong_t idx;
+        xen_pfn_t gpfn;
+
+        rc = copy_from_guest_offset(&idx, xatpr->idxs, xatpr->size-1, 1);
+        if ( rc < 0 )
+            goto out;
+
+        rc = copy_from_guest_offset(&gpfn, xatpr->gpfns, xatpr->size-1, 1);
+        if ( rc < 0 )
+            goto out;
+
+        rc = xenmem_add_to_physmap_once(d, xatpr->space, xatpr->foreign_domid,
+                                        idx, gpfn);
+
+	if (rc)
+            goto out;
+
+        xatpr->size--;
+
+        /* Check for continuation if it's not the last interation */
+        if ( xatpr->size > 0 && hypercall_preempt_check() )
+        {
+            rc = -EAGAIN;
+            goto out;
+        }
+    }
+
+    rc = 0;
+
+out:
+    return rc;
+
 }
 
 long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
@@ -4389,6 +4553,10 @@ long arch_memory_op(int op, XEN_GUEST_HA
         if ( copy_from_guest(&xatp, arg, 1) )
             return -EFAULT;
 
+        /* This one is only supported for add_to_physmap_range */
+        if ( xatp.space == XENMAPSPACE_gmfn_foreign )
+            return -EINVAL;
+
         rc = rcu_lock_target_domain_by_id(xatp.domid, &d);
         if ( rc != 0 )
             return rc;
@@ -4416,6 +4584,32 @@ long arch_memory_op(int op, XEN_GUEST_HA
         return rc;
     }
 
+    case XENMEM_add_to_physmap_range:
+    {
+        struct xen_add_to_physmap_range xatpr;
+        struct domain *d;
+
+        if ( copy_from_guest(&xatpr, arg, 1) )
+            return -EFAULT;
+
+        rc = rcu_lock_target_domain_by_id(xatpr.domid, &d);
+        if ( rc != 0 )
+            return rc;
+
+        rc = xenmem_add_to_physmap_range(d, &xatpr);
+
+        rcu_unlock_domain(d);
+
+        if ( rc && copy_to_guest(arg, &xatpr, 1) )
+            rc = -EFAULT;
+
+        if ( rc == -EAGAIN )
+            rc = hypercall_create_continuation(
+                __HYPERVISOR_memory_op, "ih", op, arg);
+
+        return rc;
+    }
+
     case XENMEM_set_memory_map:
     {
         struct xen_foreign_memory_map fmap;
diff -r 8b0762504037 xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/mm/hap/hap.c	Wed Nov 14 11:03:24 2012 -0800
@@ -600,6 +600,20 @@ int hap_domctl(struct domain *d, xen_dom
     }
 }
 
+/* Resize hap table. Copied from: libxl_get_required_shadow_memory() */
+void hap_set_pvh_alloc_for_dom0(struct domain *d, unsigned long num_pages)
+{
+    int rc;
+    unsigned long memkb = num_pages * (PAGE_SIZE / 1024);
+
+    memkb = 4 * (256 * d->max_vcpus + 2 * (memkb / 1024));
+    num_pages = ((memkb+1023)/1024) << (20 - PAGE_SHIFT);
+    paging_lock(d);
+    rc = hap_set_allocation(d, num_pages, NULL);
+    paging_unlock(d);
+    BUG_ON(rc);
+}
+
 static const struct paging_mode hap_paging_real_mode;
 static const struct paging_mode hap_paging_protected_mode;
 static const struct paging_mode hap_paging_pae_mode;
@@ -659,7 +673,8 @@ static void hap_update_cr3(struct vcpu *
 const struct paging_mode *
 hap_paging_get_mode(struct vcpu *v)
 {
-    return !hvm_paging_enabled(v)   ? &hap_paging_real_mode :
+    return is_pvh_vcpu(v) ? &hap_paging_long_mode :
+        !hvm_paging_enabled(v)   ? &hap_paging_real_mode :
         hvm_long_mode_enabled(v) ? &hap_paging_long_mode :
         hvm_pae_enabled(v)       ? &hap_paging_pae_mode  :
                                    &hap_paging_protected_mode;
diff -r 8b0762504037 xen/arch/x86/mm/p2m-ept.c
--- a/xen/arch/x86/mm/p2m-ept.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/mm/p2m-ept.c	Wed Nov 14 11:03:24 2012 -0800
@@ -75,6 +75,7 @@ static void ept_p2m_type_to_flags(ept_en
             entry->w = 0;
             break;
         case p2m_grant_map_rw:
+        case p2m_map_foreign:
             entry->r = entry->w = 1;
             entry->x = 0;
             break;
@@ -428,7 +429,7 @@ ept_set_entry(struct p2m_domain *p2m, un
     }
 
     /* Track the highest gfn for which we have ever had a valid mapping */
-    if ( p2mt != p2m_invalid &&
+    if ( p2mt != p2m_invalid && p2mt != p2m_mmio_dm &&
          (gfn + (1UL << order) - 1 > p2m->max_mapped_pfn) )
         p2m->max_mapped_pfn = gfn + (1UL << order) - 1;
 
@@ -462,6 +463,9 @@ out:
             }
             else
             {
+
+if (p2m->domain->domain_id == 0)   /******* PVH : FIXME */
+    goto skip;
                 if ( order > 0 )
                 {
                     for ( i = 0; i < (1 << order); i++ )
@@ -472,7 +476,7 @@ out:
             }
         }
     }
-
+skip:
     /* Release the old intermediate tables, if any.  This has to be the
        last thing we do, after the ept_sync_domain() and removal
        from the iommu tables, so as to avoid a potential
diff -r 8b0762504037 xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/mm/p2m-pt.c	Wed Nov 14 11:03:24 2012 -0800
@@ -89,6 +89,7 @@ static unsigned long p2m_type_to_flags(p
     case p2m_ram_rw:
         return flags | P2M_BASE_FLAGS | _PAGE_RW;
     case p2m_grant_map_rw:
+    case p2m_map_foreign:
         return flags | P2M_BASE_FLAGS | _PAGE_RW | _PAGE_NX_BIT;
     case p2m_mmio_direct:
         if ( !rangeset_contains_singleton(mmio_ro_ranges, mfn_x(mfn)) )
@@ -429,7 +430,7 @@ p2m_set_entry(struct p2m_domain *p2m, un
     }
 
     /* Track the highest gfn for which we have ever had a valid mapping */
-    if ( p2mt != p2m_invalid
+    if ( p2mt != p2m_invalid && p2mt != p2m_mmio_dm
          && (gfn + (1UL << page_order) - 1 > p2m->max_mapped_pfn) )
         p2m->max_mapped_pfn = gfn + (1UL << page_order) - 1;
 
diff -r 8b0762504037 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/mm/p2m.c	Wed Nov 14 11:03:24 2012 -0800
@@ -488,7 +488,7 @@ p2m_remove_page(struct p2m_domain *p2m, 
         for ( i = 0; i < (1UL << page_order); i++ )
         {
             mfn_return = p2m->get_entry(p2m, gfn + i, &t, &a, 0, NULL);
-            if ( !p2m_is_grant(t) && !p2m_is_shared(t) )
+            if ( !p2m_is_grant(t) && !p2m_is_shared(t) && !p2m_is_foreign(t) )
                 set_gpfn_from_mfn(mfn+i, INVALID_M2P_ENTRY);
             ASSERT( !p2m_is_valid(t) || mfn + i == mfn_x(mfn_return) );
         }
@@ -584,6 +584,11 @@ guest_physmap_add_entry(struct domain *d
         {
             ASSERT(mfn_valid(omfn));
             set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
+
+            /* Because PVH domU uses kmalloc for grant pfn, we need to save
+             * and restore the old mfn */
+             if (is_pvh_domain(d) && p2m_is_grant(t))
+                 free_domheap_page(mfn_to_page(omfn));
         }
         else if ( ot == p2m_populate_on_demand )
         {
@@ -715,7 +720,33 @@ void p2m_change_type_range(struct domain
     p2m_unlock(p2m);
 }
 
+/* Returns: True for success. 0 for failure */
+int set_foreign_p2m_entry(struct domain *domp, unsigned long gfn, mfn_t mfn)
+{
+    int rc = 0;
+    p2m_type_t ot;
+    mfn_t omfn;
+    struct p2m_domain *p2m = p2m_get_hostp2m(domp);
 
+    if ( !paging_mode_translate(domp) )
+        return 0;
+
+    omfn = get_gfn_query_unlocked(domp, gfn, &ot);
+    if (mfn_valid(omfn)) {
+        gdprintk(XENLOG_ERR, "Already mapped mfn %lx at gfn:%lx\n", omfn, gfn);
+        set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
+    }
+
+    P2M_DEBUG("set foreign %lx %lx\n", gfn, mfn_x(mfn));
+    p2m_lock(p2m);
+    rc = set_p2m_entry(p2m, gfn, mfn, 0, p2m_map_foreign, p2m->default_access);
+    p2m_unlock(p2m);
+    if ( rc == 0 )
+        gdprintk(XENLOG_ERR,
+            "set_foreign_p2m_entry: set_p2m_entry failed! gfn:%lx mfn=%08lx\n",
+            gfn, mfn_x(get_gfn_query(domp, gfn, &ot)));
+    return rc;
+}
 
 int
 set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
diff -r 8b0762504037 xen/arch/x86/msi.c
--- a/xen/arch/x86/msi.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/msi.c	Wed Nov 14 11:03:24 2012 -0800
@@ -766,6 +766,9 @@ static int msix_capability_init(struct p
         WARN_ON(rangeset_overlaps_range(mmio_ro_ranges, dev->msix_pba.first,
                                         dev->msix_pba.last));
 
+/* PVH: fixme: not a clue what to do here :) */
+if (is_pvh_domain(dev->domain) && dev->domain->domain_id != 0)
+{
         if ( rangeset_add_range(mmio_ro_ranges, dev->msix_table.first,
                                 dev->msix_table.last) )
             WARN();
@@ -793,6 +796,7 @@ static int msix_capability_init(struct p
                 /* XXX How to deal with existing mappings? */
             }
         }
+}
     }
     WARN_ON(dev->msix_nr_entries != nr_entries);
     WARN_ON(dev->msix_table.first != (table_paddr >> PAGE_SHIFT));
diff -r 8b0762504037 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/physdev.c	Wed Nov 14 11:03:24 2012 -0800
@@ -732,6 +732,25 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         break;
     }
 
+    case PHYSDEVOP_pvh_map_iomem : {
+
+	struct physdev_map_iomem iomem;
+        struct domain *d = current->domain;
+
+        ret = -EPERM;
+        if ( !IS_PRIV(d) || !is_pvh_domain(d))
+            break;
+        d = rcu_lock_current_domain();
+        
+        ret = -EFAULT;
+        if ( copy_from_guest(&iomem, arg, 1) != 0 )
+            break;
+
+	ret = domctl_memory_mapping(d, iomem.first_gfn, iomem.first_mfn, 
+	                            iomem.nr_mfns, iomem.add_mapping);
+        break;
+    }
+
     default:
         ret = -ENOSYS;
         break;
diff -r 8b0762504037 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/setup.c	Wed Nov 14 11:03:24 2012 -0800
@@ -54,6 +54,9 @@ int opt_earlykdb=0;
 boolean_param("earlykdb", opt_earlykdb);
 #endif
 
+int opt_dom0hyb=0;
+boolean_param("dom0hyb", opt_dom0hyb);
+
 /* opt_nosmp: If true, secondary processors are ignored. */
 static bool_t __initdata opt_nosmp;
 boolean_param("nosmp", opt_nosmp);
@@ -542,7 +545,7 @@ void __init __start_xen(unsigned long mb
 {
     char *memmap_type = NULL;
     char *cmdline, *kextra, *loader;
-    unsigned int initrdidx;
+    unsigned int initrdidx, domcr_flags = 0;
     multiboot_info_t *mbi = __va(mbi_p);
     module_t *mod = (module_t *)__va(mbi->mods_addr);
     unsigned long nr_pages, modules_headroom, *module_map;
@@ -1260,7 +1263,9 @@ void __init __start_xen(unsigned long mb
         panic("Could not protect TXT memory regions\n");
 
     /* Create initial domain 0. */
-    dom0 = domain_create(0, DOMCRF_s3_integrity, 0);
+    domcr_flags = (opt_dom0hyb ? DOMCRF_pvh | DOMCRF_hap : 0);
+    domcr_flags |= DOMCRF_s3_integrity;
+    dom0 = domain_create(0, domcr_flags, 0);
     if ( IS_ERR(dom0) || (alloc_dom0_vcpu0() == NULL) )
         panic("Error creating domain 0\n");
 
diff -r 8b0762504037 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/time.c	Wed Nov 14 11:03:24 2012 -0800
@@ -1923,7 +1923,7 @@ void tsc_set_info(struct domain *d,
         break;
     }
     d->arch.incarnation = incarnation + 1;
-    if ( is_hvm_domain(d) )
+    if ( is_hvm_or_pvh_domain(d) )
         hvm_set_rdtsc_exiting(d, d->arch.vtsc);
 }
 
diff -r 8b0762504037 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/traps.c	Wed Nov 14 11:03:24 2012 -0800
@@ -723,7 +723,7 @@ int cpuid_hypervisor_leaves( uint32_t id
     return 1;
 }
 
-static void pv_cpuid(struct cpu_user_regs *regs)
+void pv_cpuid(struct cpu_user_regs *regs)
 {
     uint32_t a, b, c, d;
 
@@ -900,7 +900,7 @@ static int emulate_invalid_rdtscp(struct
     return EXCRET_fault_fixed;
 }
 
-static int emulate_forced_invalid_op(struct cpu_user_regs *regs)
+int emulate_forced_invalid_op(struct cpu_user_regs *regs)
 {
     char sig[5], instr[2];
     unsigned long eip, rc;
@@ -910,6 +910,10 @@ static int emulate_forced_invalid_op(str
     /* Check for forced emulation signature: ud2 ; .ascii "xen". */
     if ( (rc = copy_from_user(sig, (char *)eip, sizeof(sig))) != 0 )
     {
+        /* PVH: fixme: hmm... what do we do for PVH? */
+        if ( is_pvh_vcpu(current) )
+            return 0;
+
         propagate_page_fault(eip + sizeof(sig) - rc, 0);
         return EXCRET_fault_fixed;
     }
@@ -920,6 +924,10 @@ static int emulate_forced_invalid_op(str
     /* We only emulate CPUID. */
     if ( ( rc = copy_from_user(instr, (char *)eip, sizeof(instr))) != 0 )
     {
+        /* PVH: fixme: hmm... what do we do for PVH? */
+        if ( is_pvh_vcpu(current) )
+            return 0;
+
         propagate_page_fault(eip + sizeof(instr) - rc, 0);
         return EXCRET_fault_fixed;
     }
@@ -1448,6 +1456,9 @@ static int read_descriptor(unsigned int 
 {
     struct desc_struct desc;
 
+    if ( is_pvh_vcpu(v) )
+        return hvm_pvh_read_descriptor(sel, v, regs, base, limit, ar);
+
     if ( !vm86_mode(regs) )
     {
         if ( sel < 4)
@@ -1566,6 +1577,10 @@ static int guest_io_okay(
     int user_mode = !(v->arch.flags & TF_kernel_mode);
 #define TOGGLE_MODE() if ( user_mode ) toggle_guest_mode(v)
 
+    /* for PVH we check this in vmexit for EXIT_REASON_IO_INSTRUCTION */
+    if (is_pvh_vcpu(v))
+        return 1;
+
     if ( !vm86_mode(regs) &&
          (v->arch.pv_vcpu.iopl >= (guest_kernel_mode(v, regs) ? 1 : 3)) )
         return 1;
@@ -1811,14 +1826,14 @@ static inline uint64_t guest_misc_enable
         _ptr = (unsigned int)_ptr;                                          \
     if ( (limit) < sizeof(_x) - 1 || (eip) > (limit) - (sizeof(_x) - 1) )   \
         goto fail;                                                          \
-    if ( (_rc = copy_from_user(&_x, (type *)_ptr, sizeof(_x))) != 0 )       \
+    if ( (_rc = raw_copy_from_guest(&_x, (type *)_ptr, sizeof(_x))) != 0 )  \
     {                                                                       \
         propagate_page_fault(_ptr + sizeof(_x) - _rc, 0);                   \
         goto skip;                                                          \
     }                                                                       \
     (eip) += sizeof(_x); _x; })
 
-#define read_sreg(regs, sr) read_segment_register(sr)
+#define read_sreg(vcpu, regs, sr) read_segment_register(vcpu, regs, sr)
 
 static int is_cpufreq_controller(struct domain *d)
 {
@@ -1828,7 +1843,7 @@ static int is_cpufreq_controller(struct 
 
 #include "x86_64/mmconfig.h"
 
-static int emulate_privileged_op(struct cpu_user_regs *regs)
+int emulate_privileged_op(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
     unsigned long *reg, eip = regs->eip;
@@ -1864,7 +1879,7 @@ static int emulate_privileged_op(struct 
         goto fail;
 
     /* emulating only opcodes not allowing SS to be default */
-    data_sel = read_sreg(regs, ds);
+    data_sel = read_sreg(v, regs, ds);
 
     /* Legacy prefixes. */
     for ( i = 0; i < 8; i++, rex == opcode || (rex = 0) )
@@ -1882,17 +1897,17 @@ static int emulate_privileged_op(struct 
             data_sel = regs->cs;
             continue;
         case 0x3e: /* DS override */
-            data_sel = read_sreg(regs, ds);
+            data_sel = read_sreg(v, regs, ds);
             continue;
         case 0x26: /* ES override */
-            data_sel = read_sreg(regs, es);
+            data_sel = read_sreg(v, regs, es);
             continue;
         case 0x64: /* FS override */
-            data_sel = read_sreg(regs, fs);
+            data_sel = read_sreg(v, regs, fs);
             lm_ovr = lm_seg_fs;
             continue;
         case 0x65: /* GS override */
-            data_sel = read_sreg(regs, gs);
+            data_sel = read_sreg(v, regs, gs);
             lm_ovr = lm_seg_gs;
             continue;
         case 0x36: /* SS override */
@@ -1939,7 +1954,7 @@ static int emulate_privileged_op(struct 
 
         if ( !(opcode & 2) )
         {
-            data_sel = read_sreg(regs, es);
+            data_sel = read_sreg(v, regs, es);
             lm_ovr = lm_seg_none;
         }
 
@@ -2668,22 +2683,22 @@ static void emulate_gate_op(struct cpu_u
             ASSERT(opnd_sel);
             continue;
         case 0x3e: /* DS override */
-            opnd_sel = read_sreg(regs, ds);
+            opnd_sel = read_sreg(v, regs, ds);
             if ( !opnd_sel )
                 opnd_sel = dpl;
             continue;
         case 0x26: /* ES override */
-            opnd_sel = read_sreg(regs, es);
+            opnd_sel = read_sreg(v, regs, es);
             if ( !opnd_sel )
                 opnd_sel = dpl;
             continue;
         case 0x64: /* FS override */
-            opnd_sel = read_sreg(regs, fs);
+            opnd_sel = read_sreg(v, regs, fs);
             if ( !opnd_sel )
                 opnd_sel = dpl;
             continue;
         case 0x65: /* GS override */
-            opnd_sel = read_sreg(regs, gs);
+            opnd_sel = read_sreg(v, regs, gs);
             if ( !opnd_sel )
                 opnd_sel = dpl;
             continue;
@@ -2736,7 +2751,7 @@ static void emulate_gate_op(struct cpu_u
                             switch ( modrm & 7 )
                             {
                             default:
-                                opnd_sel = read_sreg(regs, ds);
+                                opnd_sel = read_sreg(v, regs, ds);
                                 break;
                             case 4: case 5:
                                 opnd_sel = regs->ss;
@@ -2764,7 +2779,7 @@ static void emulate_gate_op(struct cpu_u
                             break;
                         }
                         if ( !opnd_sel )
-                            opnd_sel = read_sreg(regs, ds);
+                            opnd_sel = read_sreg(v, regs, ds);
                         switch ( modrm & 7 )
                         {
                         case 0: case 2: case 4:
diff -r 8b0762504037 xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/arch/x86/x86_64/traps.c	Wed Nov 14 11:03:24 2012 -0800
@@ -127,10 +127,10 @@ void show_registers(struct cpu_user_regs
         fault_crs[0] = read_cr0();
         fault_crs[3] = read_cr3();
         fault_crs[4] = read_cr4();
-        fault_regs.ds = read_segment_register(ds);
-        fault_regs.es = read_segment_register(es);
-        fault_regs.fs = read_segment_register(fs);
-        fault_regs.gs = read_segment_register(gs);
+        fault_regs.ds = read_segment_register(v, regs, ds);
+        fault_regs.es = read_segment_register(v, regs, es);
+        fault_regs.fs = read_segment_register(v, regs, fs);
+        fault_regs.gs = read_segment_register(v, regs, gs);
     }
 
     print_xen_info();
@@ -624,7 +624,7 @@ static void hypercall_page_initialise_ri
 void hypercall_page_initialise(struct domain *d, void *hypercall_page)
 {
     memset(hypercall_page, 0xCC, PAGE_SIZE);
-    if ( is_hvm_domain(d) )
+    if ( is_hvm_or_pvh_domain(d) )
         hvm_hypercall_page_initialise(d, hypercall_page);
     else if ( !is_pv_32bit_domain(d) )
         hypercall_page_initialise_ring3_kernel(hypercall_page);
diff -r 8b0762504037 xen/common/domain.c
--- a/xen/common/domain.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/common/domain.c	Wed Nov 14 11:03:24 2012 -0800
@@ -232,6 +232,14 @@ struct domain *domain_create(
 
     if ( domcr_flags & DOMCRF_hvm )
         d->is_hvm = 1;
+    else if ( domcr_flags & DOMCRF_pvh ) {
+        d->is_pvh = 1;
+        if ( !(domcr_flags & DOMCRF_hap) ) {
+            printk("PVH guest must have HAP on\n");
+            goto fail;
+        } else
+            printk("Yeay... PVH guest. domid:%d\n", domid);
+    }
 
     if ( domid == 0 )
     {
diff -r 8b0762504037 xen/common/domctl.c
--- a/xen/common/domctl.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/common/domctl.c	Wed Nov 14 11:03:24 2012 -0800
@@ -149,6 +149,8 @@ void getdomaininfo(struct domain *d, str
 
     if ( is_hvm_domain(d) )
         info->flags |= XEN_DOMINF_hvm_guest;
+    else if ( is_pvh_domain(d) )
+        info->flags |= XEN_DOMINF_pvh_guest;
 
     xsm_security_domaininfo(d, info);
 
@@ -419,6 +421,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         if ( supervisor_mode_kernel ||
              (op->u.createdomain.flags &
              ~(XEN_DOMCTL_CDF_hvm_guest | XEN_DOMCTL_CDF_hap |
+               XEN_DOMCTL_CDF_pvh_guest |
                XEN_DOMCTL_CDF_s3_integrity | XEN_DOMCTL_CDF_oos_off)) )
             break;
 
@@ -449,6 +452,8 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         domcr_flags = 0;
         if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_hvm_guest )
             domcr_flags |= DOMCRF_hvm;
+        if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_pvh_guest )
+            domcr_flags |= DOMCRF_pvh;
         if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_hap )
             domcr_flags |= DOMCRF_hap;
         if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_s3_integrity )
diff -r 8b0762504037 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/common/grant_table.c	Wed Nov 14 11:03:24 2012 -0800
@@ -529,7 +529,7 @@ static void mapcount(
  * addr is _either_ a host virtual address, or the address of the pte to
  * update, as indicated by the GNTMAP_contains_pte flag.
  */
-static void
+static noinline void
 __gnttab_map_grant_ref(
     struct gnttab_map_grant_ref *op)
 {
@@ -745,7 +745,7 @@ __gnttab_map_grant_ref(
 
     double_gt_lock(lgt, rgt);
 
-    if ( !is_hvm_domain(ld) && need_iommu(ld) )
+    if ( !is_hvm_or_pvh_domain(ld) && need_iommu(ld) )
     {
         unsigned int wrc, rdc;
         int err = 0;
@@ -956,7 +956,7 @@ __gnttab_unmap_common(
             act->pin -= GNTPIN_hstw_inc;
     }
 
-    if ( !is_hvm_domain(ld) && need_iommu(ld) )
+    if ( !is_hvm_or_pvh_domain(ld) && need_iommu(ld) )
     {
         unsigned int wrc, rdc;
         int err = 0;
diff -r 8b0762504037 xen/common/kernel.c
--- a/xen/common/kernel.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/common/kernel.c	Wed Nov 14 11:03:24 2012 -0800
@@ -289,7 +289,11 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDL
             if ( current->domain == dom0 )
                 fi.submap |= 1U << XENFEAT_dom0;
 #ifdef CONFIG_X86
-            if ( !is_hvm_vcpu(current) )
+            if ( is_pvh_vcpu(current) )
+                fi.submap |= (1U << XENFEAT_hvm_safe_pvclock) |
+                             (1U << XENFEAT_supervisor_mode_kernel) |
+                             (1U << XENFEAT_hvm_callback_vector);
+            else if ( !is_hvm_vcpu(current) )
                 fi.submap |= (1U << XENFEAT_mmu_pt_update_preserve_ad) |
                              (1U << XENFEAT_highmem_assist) |
                              (1U << XENFEAT_gnttab_map_avail_bits);
diff -r 8b0762504037 xen/common/libelf/libelf-loader.c
--- a/xen/common/libelf/libelf-loader.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/common/libelf/libelf-loader.c	Wed Nov 14 11:03:24 2012 -0800
@@ -17,6 +17,10 @@
  */
 
 #include "libelf-private.h"
+#ifdef __XEN__
+#include <public/xen.h>
+#include <asm/debugger.h>
+#endif
 
 /* ------------------------------------------------------------------------ */
 
@@ -108,7 +112,8 @@ void elf_set_log(struct elf_binary *elf,
     elf->verbose = verbose;
 }
 
-static int elf_load_image(void *dst, const void *src, uint64_t filesz, uint64_t memsz)
+static int elf_load_image(void *dst, const void *src, uint64_t filesz, 
+                          uint64_t memsz, int not_used)
 {
     memcpy(dst, src, filesz);
     memset(dst + filesz, 0, memsz - filesz);
@@ -122,11 +127,35 @@ void elf_set_verbose(struct elf_binary *
     elf->verbose = 1;
 }
 
-static int elf_load_image(void *dst, const void *src, uint64_t filesz, uint64_t memsz)
+static int elf_load_image(void *dst, const void *src, uint64_t filesz, 
+                          uint64_t memsz, int is_pvh_dom0)
 {
     int rc;
     if ( filesz > ULONG_MAX || memsz > ULONG_MAX )
         return -1;
+
+    /* raw_copy_to_guest -> copy_to_user_hvm -> __hvm_copy needs curr to
+     * point to the hvm/pvh vcpu. Hence for PVH dom0 we can't use that. For now
+     * just use dbg_rw_mem(). FIXME: this is kinda slow, enhance to copy
+     * more than one byte at a time. */
+    if ( is_pvh_dom0 ) 
+    {
+        int j, rem; 
+        rem = dbg_rw_mem((dbgva_t)dst, (dbgbyte_t *)src, (int)filesz, 0, 1, 0);
+        if ( rem ) {
+            printk("Failed to copy elf binary. len:%ld rem:%d\n", filesz, rem);
+            return -1;
+        }
+        for (j=0; j < memsz - filesz; j++) {
+            unsigned char zero=0;
+            rem = dbg_rw_mem((dbgva_t)(dst+filesz+j), &zero, 1, 0, 1, 0);
+            if (rem) {
+                kdbp("Failed to copy to: %lx rem:%d\n", dst+filesz+j, rem);
+                return -1;
+            }
+        }
+        return 0;
+    }
     rc = raw_copy_to_guest(dst, src, filesz);
     if ( rc != 0 )
         return -1;
@@ -260,7 +289,9 @@ void elf_parse_binary(struct elf_binary 
             __FUNCTION__, elf->pstart, elf->pend);
 }
 
-int elf_load_binary(struct elf_binary *elf)
+/* This function called for dom0 and also from the libraries when building 
+ * guests */
+static int _elf_load_binary(struct elf_binary *elf, int is_pvh_dom0)
 {
     const elf_phdr *phdr;
     uint64_t i, count, paddr, offset, filesz, memsz;
@@ -279,7 +310,8 @@ int elf_load_binary(struct elf_binary *e
         dest = elf_get_ptr(elf, paddr);
         elf_msg(elf, "%s: phdr %" PRIu64 " at 0x%p -> 0x%p\n",
                 __func__, i, dest, dest + filesz);
-        if ( elf_load_image(dest, elf->image + offset, filesz, memsz) != 0 )
+        if ( elf_load_image(dest, elf->image + offset, filesz, memsz, 
+                            is_pvh_dom0) != 0 )
             return -1;
     }
 
@@ -287,6 +319,18 @@ int elf_load_binary(struct elf_binary *e
     return 0;
 }
 
+#ifdef __XEN__
+int elf_load_binary(struct elf_binary *elf, int is_pvh_dom0)
+{
+    return _elf_load_binary(elf, is_pvh_dom0);
+}
+#else
+int elf_load_binary(struct elf_binary *elf)
+{
+    return _elf_load_binary(elf, 0);
+}
+#endif
+
 void *elf_get_ptr(struct elf_binary *elf, unsigned long addr)
 {
     return elf->dest + addr - elf->pstart;
diff -r 8b0762504037 xen/common/memory.c
--- a/xen/common/memory.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/common/memory.c	Wed Nov 14 11:03:24 2012 -0800
@@ -653,6 +653,8 @@ long do_memory_op(unsigned long cmd, XEN
         struct xen_remove_from_physmap xrfp;
         struct page_info *page;
         struct domain *d;
+        p2m_type_t p2mt;
+        int is_curr_pvh = is_pvh_vcpu(current);
 
         if ( copy_from_guest(&xrfp, arg, 1) )
             return -EFAULT;
@@ -669,14 +671,22 @@ long do_memory_op(unsigned long cmd, XEN
 
         domain_lock(d);
 
-        page = get_page_from_gfn(d, xrfp.gpfn, NULL, P2M_ALLOC);
-        if ( page )
+        page = get_page_from_gfn(d, xrfp.gpfn, &p2mt, P2M_ALLOC);
+        if ( page || 
+             (is_curr_pvh && (p2m_is_mmio(p2mt) || p2m_is_foreign(p2mt))) )
         {
-            guest_physmap_remove_page(d, xrfp.gpfn, page_to_mfn(page), 0);
-            put_page(page);
+            unsigned long argmfn = page ? page_to_mfn(page) : INVALID_MFN;
+            guest_physmap_remove_page(d, xrfp.gpfn, argmfn, 0);
+            if (page)
+                put_page(page);
         }
-        else
+        else 
+        {
+            if ( is_curr_pvh )
+                gdprintk(XENLOG_WARNING, "%s: Domain:%u gmfn:%lx invalid\n",
+                         __FUNCTION__, current->domain->domain_id, xrfp.gpfn);
             rc = -ENOENT;
+        }
 
         domain_unlock(d);
 
diff -r 8b0762504037 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/drivers/passthrough/iommu.c	Wed Nov 14 11:03:24 2012 -0800
@@ -120,15 +120,25 @@ int iommu_domain_init(struct domain *d)
     return hd->platform_ops->init(d);
 }
 
+static inline void check_dom0_pvh_reqs(struct domain *d)
+{
+    if (!iommu_enabled || iommu_passthrough)
+        panic("For pvh dom0, iommu must be enabled, dom0-passthrough must "
+              "not be enabled \n");
+}
+
 void __init iommu_dom0_init(struct domain *d)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
 
+    if ( is_pvh_domain(d) )
+        check_dom0_pvh_reqs(d);
+
     if ( !iommu_enabled )
         return;
 
     register_keyhandler('o', &iommu_p2m_table);
-    d->need_iommu = !!iommu_dom0_strict;
+    d->need_iommu = is_pvh_domain(d) || !!iommu_dom0_strict;
     if ( need_iommu(d) )
     {
         struct page_info *page;
@@ -141,7 +151,10 @@ void __init iommu_dom0_init(struct domai
                  ((page->u.inuse.type_info & PGT_type_mask)
                   == PGT_writable_page) )
                 mapping |= IOMMUF_writable;
-            hd->platform_ops->map_page(d, mfn, mfn, mapping);
+            if ( is_pvh_domain(d) )
+                hd->platform_ops->map_page(d, mfn_to_gfn(d, mfn), mfn, mapping);
+            else
+                hd->platform_ops->map_page(d, mfn, mfn, mapping);
             if ( !(i++ & 0xfffff) )
                 process_pending_softirqs();
         }
diff -r 8b0762504037 xen/include/asm-x86/desc.h
--- a/xen/include/asm-x86/desc.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/desc.h	Wed Nov 14 11:03:24 2012 -0800
@@ -38,7 +38,8 @@
 
 #ifndef __ASSEMBLY__
 
-#define GUEST_KERNEL_RPL(d) (is_pv_32bit_domain(d) ? 1 : 3)
+#define GUEST_KERNEL_RPL(d) (is_pvh_domain(d) ? 0 : \
+                                                is_pv_32bit_domain(d) ? 1 : 3)
 
 /* Fix up the RPL of a guest segment selector. */
 #define __fixup_guest_selector(d, sel)                             \
diff -r 8b0762504037 xen/include/asm-x86/domain.h
--- a/xen/include/asm-x86/domain.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/domain.h	Wed Nov 14 11:03:24 2012 -0800
@@ -16,7 +16,7 @@
 #define is_pv_32on64_domain(d) (is_pv_32bit_domain(d))
 #define is_pv_32on64_vcpu(v)   (is_pv_32on64_domain((v)->domain))
 
-#define is_hvm_pv_evtchn_domain(d) (is_hvm_domain(d) && \
+#define is_hvm_pv_evtchn_domain(d) (is_hvm_or_pvh_domain(d) && \
         d->arch.hvm_domain.irq.callback_via_type == HVMIRQ_callback_vector)
 #define is_hvm_pv_evtchn_vcpu(v) (is_hvm_pv_evtchn_domain(v->domain))
 
@@ -252,10 +252,10 @@ struct arch_domain
 
     struct list_head pdev_list;
 
-    union {
-        struct pv_domain pv_domain;
-        struct hvm_domain hvm_domain;
-    };
+/* PVH fixme: pvh uses fields from both pv and hvm, so separate the union
+ * for now. make a separate pvh struct and put in HVM */
+    struct pv_domain pv_domain;
+    struct hvm_domain hvm_domain;
 
     struct paging_domain paging;
     struct p2m_domain *p2m;
@@ -396,10 +396,14 @@ struct arch_vcpu
     void (*ctxt_switch_to) (struct vcpu *);
 
     /* Virtual Machine Extensions */
+#if 0
     union {
+#endif
         struct pv_vcpu pv_vcpu;
         struct hvm_vcpu hvm_vcpu;
+#if 0
     };
+#endif
 
     /*
      * Every domain has a L1 pagetable of its own. Per-domain mappings
diff -r 8b0762504037 xen/include/asm-x86/event.h
--- a/xen/include/asm-x86/event.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/event.h	Wed Nov 14 11:03:24 2012 -0800
@@ -18,7 +18,7 @@ int hvm_local_events_need_delivery(struc
 static inline int local_events_need_delivery(void)
 {
     struct vcpu *v = current;
-    return (is_hvm_vcpu(v) ? hvm_local_events_need_delivery(v) :
+    return (is_hvm_or_pvh_vcpu(v) ? hvm_local_events_need_delivery(v) :
             (vcpu_info(v, evtchn_upcall_pending) &&
              !vcpu_info(v, evtchn_upcall_mask)));
 }
diff -r 8b0762504037 xen/include/asm-x86/guest_access.h
--- a/xen/include/asm-x86/guest_access.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/guest_access.h	Wed Nov 14 11:03:24 2012 -0800
@@ -14,27 +14,27 @@
 
 /* Raw access functions: no type checking. */
 #define raw_copy_to_guest(dst, src, len)        \
-    (is_hvm_vcpu(current) ?                     \
+    (is_hvm_or_pvh_vcpu(current) ?                     \
      copy_to_user_hvm((dst), (src), (len)) :    \
      copy_to_user((dst), (src), (len)))
 #define raw_copy_from_guest(dst, src, len)      \
-    (is_hvm_vcpu(current) ?                     \
+    (is_hvm_or_pvh_vcpu(current) ?                     \
      copy_from_user_hvm((dst), (src), (len)) :  \
      copy_from_user((dst), (src), (len)))
 #define raw_clear_guest(dst,  len)              \
-    (is_hvm_vcpu(current) ?                     \
+    (is_hvm_or_pvh_vcpu(current) ?                     \
      clear_user_hvm((dst), (len)) :             \
      clear_user((dst), (len)))
 #define __raw_copy_to_guest(dst, src, len)      \
-    (is_hvm_vcpu(current) ?                     \
+    (is_hvm_or_pvh_vcpu(current) ?                     \
      copy_to_user_hvm((dst), (src), (len)) :    \
      __copy_to_user((dst), (src), (len)))
 #define __raw_copy_from_guest(dst, src, len)    \
-    (is_hvm_vcpu(current) ?                     \
+    (is_hvm_or_pvh_vcpu(current) ?                     \
      copy_from_user_hvm((dst), (src), (len)) :  \
      __copy_from_user((dst), (src), (len)))
 #define __raw_clear_guest(dst,  len)            \
-    (is_hvm_vcpu(current) ?                     \
+    (is_hvm_or_pvh_vcpu(current) ?                     \
      clear_user_hvm((dst), (len)) :             \
      clear_user((dst), (len)))
 
diff -r 8b0762504037 xen/include/asm-x86/hap.h
--- a/xen/include/asm-x86/hap.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/hap.h	Wed Nov 14 11:03:24 2012 -0800
@@ -63,6 +63,7 @@ int   hap_track_dirty_vram(struct domain
                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
 
 extern const struct paging_mode *hap_paging_get_mode(struct vcpu *);
+void hap_set_pvh_alloc_for_dom0(struct domain *d, unsigned long num_pages);
 
 #endif /* XEN_HAP_H */
 
diff -r 8b0762504037 xen/include/asm-x86/hvm/hvm.h
--- a/xen/include/asm-x86/hvm/hvm.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/hvm/hvm.h	Wed Nov 14 11:03:24 2012 -0800
@@ -183,6 +183,13 @@ struct hvm_function_table {
     /* Virtual interrupt delivery */
     void (*update_eoi_exit_bitmap)(struct vcpu *v, u8 vector, u8 trig);
     int (*virtual_intr_delivery_enabled)(void);
+
+    /* PVH functions */
+    void (*pvh_update_cr3)(struct vcpu *v);
+    int (*pvh_set_vcpu_info)(struct vcpu *v, struct vcpu_guest_context *ctxtp);
+    int (*pvh_read_descriptor)(unsigned int sel, const struct vcpu *v,
+                         const struct cpu_user_regs *regs, unsigned long *base,
+                         unsigned long *limit, unsigned int *ar);
 };
 
 extern struct hvm_function_table hvm_funcs;
@@ -316,6 +323,24 @@ static inline unsigned long hvm_get_shad
     return hvm_funcs.get_shadow_gs_base(v);
 }
 
+static inline void hvm_pvh_update_cr3(struct vcpu *v)
+{
+    hvm_funcs.pvh_update_cr3(v);
+}
+
+static inline int hvm_pvh_set_vcpu_info(struct vcpu *v, 
+                                        struct vcpu_guest_context *ctxtp)
+{
+    return hvm_funcs.pvh_set_vcpu_info(v, ctxtp);
+}
+
+static inline int hvm_pvh_read_descriptor(unsigned int sel, 
+               const struct vcpu *v, const struct cpu_user_regs *regs, 
+               unsigned long *base, unsigned long *limit, unsigned int *ar)
+{
+    return hvm_funcs.pvh_read_descriptor(sel, v, regs, base, limit, ar);
+}
+
 #define is_viridian_domain(_d)                                             \
  (is_hvm_domain(_d) && ((_d)->arch.hvm_domain.params[HVM_PARAM_VIRIDIAN]))
 
diff -r 8b0762504037 xen/include/asm-x86/hvm/vcpu.h
--- a/xen/include/asm-x86/hvm/vcpu.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/hvm/vcpu.h	Wed Nov 14 11:03:24 2012 -0800
@@ -104,6 +104,17 @@ struct nestedvcpu {
 
 #define vcpu_nestedhvm(v) ((v)->arch.hvm_vcpu.nvcpu)
 
+struct pvh_hvm_vcpu_ext
+{
+    /* I/O-port access bitmap. */
+    XEN_GUEST_HANDLE(uint8) iobmp;  /* Guest kernel vaddr of the bitmap. */
+    unsigned int pvh_iobmp_limit;   /* Number of ports in the bitmap. */
+    unsigned int pvh_iopl;          /* Current IOPL for this VCPU. */
+
+    /* Guest-specified relocation of vcpu_info. */
+    unsigned long pvh_vcpu_info_mfn;
+};
+
 struct hvm_vcpu {
     /* Guest control-register and EFER values, just as the guest sees them. */
     unsigned long       guest_cr[5];
@@ -170,6 +181,8 @@ struct hvm_vcpu {
     struct hvm_trap     inject_trap;
 
     struct viridian_vcpu viridian;
+
+    struct pvh_hvm_vcpu_ext hv_pvh;
 };
 
 #endif /* __ASM_X86_HVM_VCPU_H__ */
diff -r 8b0762504037 xen/include/asm-x86/hvm/vmx/pvh.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/asm-x86/hvm/vmx/pvh.h	Wed Nov 14 11:03:24 2012 -0800
@@ -0,0 +1,11 @@
+#ifndef __ASM_X86_HVM_VMX_PVH_H__
+#define __ASM_X86_HVM_VMX_PVH_H__
+    
+void vmx_pvh_update_cr3(struct vcpu *v);
+int vmx_pvh_set_vcpu_info(struct vcpu *v, struct vcpu_guest_context *ctxtp);
+int vmx_pvh_read_descriptor(unsigned int sel, const struct vcpu *v,
+                         const struct cpu_user_regs *regs, unsigned long *base,
+                         unsigned long *limit, unsigned int *ar);
+#endif /* __ASM_X86_HVM_VMX_PVH_H__ */
+
+
diff -r 8b0762504037 xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Wed Nov 14 11:03:24 2012 -0800
@@ -413,6 +413,7 @@ int vmx_write_guest_msr(u32 msr, u64 val
 int vmx_add_guest_msr(u32 msr);
 int vmx_add_host_load_msr(u32 msr);
 void vmx_vmcs_switch(struct vmcs_struct *from, struct vmcs_struct *to);
+void vmx_fpu_enter(struct vcpu *v);
 void vmx_set_eoi_exit_bitmap(struct vcpu *v, u8 vector);
 void vmx_clear_eoi_exit_bitmap(struct vcpu *v, u8 vector);
 
diff -r 8b0762504037 xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Wed Nov 14 11:03:24 2012 -0800
@@ -156,11 +156,28 @@ void vmx_update_cpu_exec_control(struct 
 # define VMX_CONTROL_REG_ACCESS_TYPE_LMSW        3
  /* 10:8 - general purpose register operand */
 #define VMX_CONTROL_REG_ACCESS_GPR(eq)  (((eq) >> 8) & 0xf)
+#define VMX_CONTROL_REG_ACCESS_GPR_EAX  0
+#define VMX_CONTROL_REG_ACCESS_GPR_ECX  1
+#define VMX_CONTROL_REG_ACCESS_GPR_EDX  2
+#define VMX_CONTROL_REG_ACCESS_GPR_EBX  3
+#define VMX_CONTROL_REG_ACCESS_GPR_ESP  4
+#define VMX_CONTROL_REG_ACCESS_GPR_EBP  5
+#define VMX_CONTROL_REG_ACCESS_GPR_ESI  6
+#define VMX_CONTROL_REG_ACCESS_GPR_EDI  7
+#define VMX_CONTROL_REG_ACCESS_GPR_R8   8
+#define VMX_CONTROL_REG_ACCESS_GPR_R9   9
+#define VMX_CONTROL_REG_ACCESS_GPR_R10  10
+#define VMX_CONTROL_REG_ACCESS_GPR_R11  11
+#define VMX_CONTROL_REG_ACCESS_GPR_R12  12
+#define VMX_CONTROL_REG_ACCESS_GPR_R13  13
+#define VMX_CONTROL_REG_ACCESS_GPR_R14  14
+#define VMX_CONTROL_REG_ACCESS_GPR_R15  15
 
 /*
  * Access Rights
  */
 #define X86_SEG_AR_SEG_TYPE     0xf        /* 3:0, segment type */
+#define X86_SEG_AR_SEG_TYPE_CODE (1u << 3) /* code (vs data) segment */
 #define X86_SEG_AR_DESC_TYPE    (1u << 4)  /* 4, descriptor type */
 #define X86_SEG_AR_DPL          0x60       /* 6:5, descriptor privilege level */
 #define X86_SEG_AR_SEG_PRESENT  (1u << 7)  /* 7, segment present */
@@ -389,6 +406,26 @@ static inline int __vmxon(u64 addr)
     return rc;
 }
 
+static inline unsigned long vmr(unsigned long field)
+{
+    int rc;
+    unsigned long val;
+    val = __vmread_safe(field, &rc);
+    return rc ? 0 : val;
+}
+
+/*
+ * Not all cases receive valid value in the VM-exit instruction length field.
+ * Callers must know what they're doing!
+ */
+static inline int get_instruction_length(void)
+{
+    int len;
+    len = __vmread(VM_EXIT_INSTRUCTION_LEN); /* Safe: callers audited */
+    BUG_ON((len < 1) || (len > 15));
+    return len;
+}
+
 void vmx_get_segment_register(struct vcpu *, enum x86_segment,
                               struct segment_register *);
 void vmx_inject_extint(int trap);
@@ -398,6 +435,11 @@ void ept_p2m_init(struct p2m_domain *p2m
 void ept_walk_table(struct domain *d, unsigned long gfn);
 void setup_ept_dump(void);
 
+void update_guest_eip(void);
+void pvh_vmx_vmexit_handler(struct cpu_user_regs *regs);
+void vmx_dr_access(unsigned long exit_qualification,struct cpu_user_regs *regs);
+void vmx_do_extint(struct cpu_user_regs *regs);
+
 /* EPT violation qualifications definitions */
 #define _EPT_READ_VIOLATION         0
 #define EPT_READ_VIOLATION          (1UL<<_EPT_READ_VIOLATION)
diff -r 8b0762504037 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/p2m.h	Wed Nov 14 11:03:24 2012 -0800
@@ -70,6 +70,7 @@ typedef enum {
     p2m_ram_paging_in = 11,       /* Memory that is being paged in */
     p2m_ram_shared = 12,          /* Shared or sharable memory */
     p2m_ram_broken = 13,          /* Broken page, access cause domain crash */
+    p2m_map_foreign  = 14,        /* ram pages from foreign domain */
 } p2m_type_t;
 
 /*
@@ -180,6 +181,7 @@ typedef unsigned int p2m_query_t;
 #define p2m_is_sharable(_t) (p2m_to_mask(_t) & P2M_SHARABLE_TYPES)
 #define p2m_is_shared(_t)   (p2m_to_mask(_t) & P2M_SHARED_TYPES)
 #define p2m_is_broken(_t)   (p2m_to_mask(_t) & P2M_BROKEN_TYPES)
+#define p2m_is_foreign(_t)  (p2m_to_mask(_t) & p2m_to_mask(p2m_map_foreign))
 
 /* Per-p2m-table state */
 struct p2m_domain {
@@ -506,6 +508,8 @@ p2m_type_t p2m_change_type(struct domain
 int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
 int clear_mmio_p2m_entry(struct domain *d, unsigned long gfn);
 
+/* Set foreign mfn in the current guest's p2m table (for pvh dom0) */
+int set_foreign_p2m_entry(struct domain *domp, unsigned long gfn, mfn_t mfn);
 
 /* 
  * Populate-on-demand
diff -r 8b0762504037 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/processor.h	Wed Nov 14 11:03:24 2012 -0800
@@ -545,12 +545,14 @@ extern int hypercall(void);
 
 int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx,
           uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx);
+void pv_cpuid(struct cpu_user_regs *regs);
 int rdmsr_hypervisor_regs(uint32_t idx, uint64_t *val);
 int wrmsr_hypervisor_regs(uint32_t idx, uint64_t val);
 
 void microcode_set_module(unsigned int);
 int microcode_update(XEN_GUEST_HANDLE_PARAM(const_void), unsigned long len);
 int microcode_resume_cpu(int cpu);
+int emulate_forced_invalid_op(struct cpu_user_regs *regs);
 
 #endif /* !__ASSEMBLY__ */
 
diff -r 8b0762504037 xen/include/asm-x86/system.h
--- a/xen/include/asm-x86/system.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/system.h	Wed Nov 14 11:03:24 2012 -0800
@@ -4,9 +4,15 @@
 #include <xen/lib.h>
 #include <asm/bitops.h>
 
-#define read_segment_register(name)                             \
+/* We need vcpu because during context switch, going from pure pv to pvh,
+ * in save_segments(), current has been updated to next, and no longer pointing
+ * to the pure pv. Btw, for pvh, we update regs->selectors on each vmexit */
+#define read_segment_register(vcpu, regs, name)                 \
 ({  u16 __sel;                                                  \
-    asm volatile ( "movw %%" STR(name) ",%0" : "=r" (__sel) );  \
+    if (is_pvh_vcpu(v))                                         \
+        __sel = regs->name;                                     \
+    else                                                         \
+        asm volatile ( "movw %%" STR(name) ",%0" : "=r" (__sel) );  \
     __sel;                                                      \
 })
 
diff -r 8b0762504037 xen/include/asm-x86/traps.h
--- a/xen/include/asm-x86/traps.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/traps.h	Wed Nov 14 11:03:24 2012 -0800
@@ -48,5 +48,6 @@ extern int guest_has_trap_callback(struc
  */
 extern int send_guest_trap(struct domain *d, uint16_t vcpuid,
 				unsigned int trap_nr);
+int emulate_privileged_op(struct cpu_user_regs *regs);
 
 #endif /* ASM_TRAP_H */
diff -r 8b0762504037 xen/include/asm-x86/x86_64/regs.h
--- a/xen/include/asm-x86/x86_64/regs.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/asm-x86/x86_64/regs.h	Wed Nov 14 11:03:24 2012 -0800
@@ -11,9 +11,10 @@
 #define ring_3(r)    (((r)->cs & 3) == 3)
 
 #define guest_kernel_mode(v, r)                                 \
+   ( is_pvh_vcpu(v) ? ({BUG_ON(v!=current); ring_0(r);}) :  \
     (!is_pv_32bit_vcpu(v) ?                                     \
      (ring_3(r) && ((v)->arch.flags & TF_kernel_mode)) :        \
-     (ring_1(r)))
+     (ring_1(r))) )
 
 #define permit_softint(dpl, v, r) \
     ((dpl) >= (guest_kernel_mode(v, r) ? 1 : 3))
diff -r 8b0762504037 xen/include/public/arch-x86/xen.h
--- a/xen/include/public/arch-x86/xen.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/public/arch-x86/xen.h	Wed Nov 14 11:03:24 2012 -0800
@@ -157,7 +157,16 @@ struct vcpu_guest_context {
     struct cpu_user_regs user_regs;         /* User-level CPU registers     */
     struct trap_info trap_ctxt[256];        /* Virtual IDT                  */
     unsigned long ldt_base, ldt_ents;       /* LDT (linear address, # ents) */
-    unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */
+    union {
+        struct {
+            /* GDT (machine frames, # ents) */
+            unsigned long gdt_frames[16], gdt_ents;
+        } pv;
+        struct {
+            /* PVH: GDTR addr and size */   
+            unsigned long gdtaddr, gdtsz;
+        } pvh;
+    } u;
     unsigned long kernel_ss, kernel_sp;     /* Virtual TSS (only SS1/SP1)   */
     /* NB. User pagetable on x86/64 is placed in ctrlreg[1]. */
     unsigned long ctrlreg[8];               /* CR0-CR7 (control registers)  */
diff -r 8b0762504037 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/public/domctl.h	Wed Nov 14 11:03:24 2012 -0800
@@ -59,6 +59,10 @@ struct xen_domctl_createdomain {
  /* Disable out-of-sync shadow page tables? */
 #define _XEN_DOMCTL_CDF_oos_off       3
 #define XEN_DOMCTL_CDF_oos_off        (1U<<_XEN_DOMCTL_CDF_oos_off)
+ /* Is this a PV guest in HVM container, aka, a pvh guest? */
+ #define _XEN_DOMCTL_CDF_pvh_guest    4
+ #define XEN_DOMCTL_CDF_pvh_guest     (1U<<_XEN_DOMCTL_CDF_pvh_guest)
+
     uint32_t flags;
 };
 typedef struct xen_domctl_createdomain xen_domctl_createdomain_t;
@@ -89,6 +93,10 @@ struct xen_domctl_getdomaininfo {
  /* Being debugged.  */
 #define _XEN_DOMINF_debugged  6
 #define XEN_DOMINF_debugged   (1U<<_XEN_DOMINF_debugged)
+ /* domain is PVH */
+#define _XEN_DOMINF_pvh_guest 7
+#define XEN_DOMINF_pvh_guest   (1U<<_XEN_DOMINF_pvh_guest)
+
  /* XEN_DOMINF_shutdown guest-supplied code.  */
 #define XEN_DOMINF_shutdownmask 255
 #define XEN_DOMINF_shutdownshift 16
diff -r 8b0762504037 xen/include/public/physdev.h
--- a/xen/include/public/physdev.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/public/physdev.h	Wed Nov 14 11:03:24 2012 -0800
@@ -330,6 +330,19 @@ struct physdev_dbgp_op {
 typedef struct physdev_dbgp_op physdev_dbgp_op_t;
 DEFINE_XEN_GUEST_HANDLE(physdev_dbgp_op_t);
 
+ 
+#define PHYSDEVOP_pvh_map_iomem        30
+struct physdev_map_iomem {
+    /* IN */
+    unsigned long first_gfn;
+    unsigned long first_mfn;
+    unsigned int nr_mfns;
+    unsigned int add_mapping;        /* 1 == add mapping;  0 == unmap */
+
+};
+typedef struct physdev_map_iomem physdev_map_iomem_t;
+DEFINE_XEN_GUEST_HANDLE(physdev_map_iomem_t);
+
 /*
  * Notify that some PIRQ-bound event channels have been unmasked.
  * ** This command is obsolete since interface version 0x00030202 and is **
diff -r 8b0762504037 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/public/xen.h	Wed Nov 14 11:03:24 2012 -0800
@@ -723,6 +723,7 @@ typedef struct start_info start_info_t;
 #define SIF_INITDOMAIN    (1<<1)  /* Is this the initial control domain? */
 #define SIF_MULTIBOOT_MOD (1<<2)  /* Is mod_start a multiboot module? */
 #define SIF_MOD_START_PFN (1<<3)  /* Is mod_start a PFN? */
+#define SIF_IS_PVH        (1<<4)  /* Is it a PVH guest? */
 #define SIF_PM_MASK       (0xFF<<8) /* reserve 1 byte for xen-pm options */
 
 /*
diff -r 8b0762504037 xen/include/xen/domain.h
--- a/xen/include/xen/domain.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/xen/domain.h	Wed Nov 14 11:03:24 2012 -0800
@@ -86,4 +86,7 @@ extern unsigned int xen_processor_pmbits
 
 extern bool_t opt_dom0_vcpus_pin;
 
+extern long domctl_memory_mapping(struct domain *d, unsigned long gfn,
+                    unsigned long mfn, unsigned long nr_mfns, int add_map);
+
 #endif /* __XEN_DOMAIN_H__ */
diff -r 8b0762504037 xen/include/xen/lib.h
--- a/xen/include/xen/lib.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/xen/lib.h	Wed Nov 14 11:03:24 2012 -0800
@@ -45,6 +45,10 @@ do {                                    
 #define ASSERT(p) do { if ( 0 && (p) ); } while (0)
 #endif
 
+/* While PVH feature is experimental, make it an unconditional assert */
+#define PVH_ASSERT(p) \
+    do { if ( unlikely(!(p)) ) assert_failed(#p); } while (0)
+
 #define ABS(_x) ({                              \
     typeof(_x) __x = (_x);                      \
     (__x < 0) ? -__x : __x;                     \
diff -r 8b0762504037 xen/include/xen/libelf.h
--- a/xen/include/xen/libelf.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/xen/libelf.h	Wed Nov 14 11:03:24 2012 -0800
@@ -192,13 +192,14 @@ int elf_phdr_is_loadable(struct elf_bina
 int elf_init(struct elf_binary *elf, const char *image, size_t size);
 #ifdef __XEN__
 void elf_set_verbose(struct elf_binary *elf);
+int elf_load_binary(struct elf_binary *elf, int is_pvh_dom0);
 #else
 void elf_set_log(struct elf_binary *elf, elf_log_callback*,
                  void *log_caller_pointer, int verbose);
+int elf_load_binary(struct elf_binary *elf);
 #endif
 
 void elf_parse_binary(struct elf_binary *elf);
-int elf_load_binary(struct elf_binary *elf);
 
 void *elf_get_ptr(struct elf_binary *elf, unsigned long addr);
 uint64_t elf_lookup_addr(struct elf_binary *elf, const char *symbol);
diff -r 8b0762504037 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/include/xen/sched.h	Wed Nov 14 11:03:24 2012 -0800
@@ -230,6 +230,9 @@ struct mem_event_per_domain
     struct mem_event_domain access;
 };
 
+/* PVH: is a PV guest running in HVM container. is_hvm is false for it. 
+ *      But it uses few of the HVM data structs.
+ */
 struct domain
 {
     domid_t          domain_id;
@@ -278,6 +281,7 @@ struct domain
 
     /* Is this an HVM guest? */
     bool_t           is_hvm;
+    bool_t           is_pvh;      /* see above for description */
 #ifdef HAS_PASSTHROUGH
     /* Does this guest need iommu mappings? */
     bool_t           need_iommu;
@@ -449,6 +453,10 @@ struct domain *domain_create(
  /* DOMCRF_oos_off: dont use out-of-sync optimization for shadow page tables */
 #define _DOMCRF_oos_off         4
 #define DOMCRF_oos_off          (1U<<_DOMCRF_oos_off)
+ /* DOMCRF_pvh: Create PV domain in HVM container */
+#define _DOMCRF_pvh            5
+#define DOMCRF_pvh             (1U<<_DOMCRF_pvh)
+
 
 /*
  * rcu_lock_domain_by_id() is more efficient than get_domain_by_id().
@@ -716,8 +724,12 @@ void watchdog_domain_destroy(struct doma
 
 #define is_hvm_domain(d) ((d)->is_hvm)
 #define is_hvm_vcpu(v)   (is_hvm_domain(v->domain))
+#define is_pvh_domain(d) ((d)->is_pvh)
+#define is_pvh_vcpu(v)   (is_pvh_domain(v->domain))
 #define is_pinned_vcpu(v) ((v)->domain->is_pinned || \
                            cpumask_weight((v)->cpu_affinity) == 1)
+#define is_hvm_or_pvh_domain(d) (is_hvm_domain(d) || is_pvh_domain(d))
+#define is_hvm_or_pvh_vcpu(v) (is_hvm_or_pvh_domain(v->domain))
 #ifdef HAS_PASSTHROUGH
 #define need_iommu(d)    ((d)->need_iommu)
 #else
diff -r 8b0762504037 xen/kdb/include/kdb_extern.h
--- a/xen/kdb/include/kdb_extern.h	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/kdb/include/kdb_extern.h	Wed Nov 14 11:03:24 2012 -0800
@@ -59,8 +59,5 @@ static inline void __vmptrst(u64 *addr)
 }
 
 extern void mukchk(unsigned long);
-#define is_hvm_or_hyb_domain is_hvm_domain
-#define is_hvm_or_hyb_vcpu is_hvm_vcpu
-
 
 #endif  /* _KDB_EXTERN_H */
diff -r 8b0762504037 xen/kdb/kdb_cmds.c
--- a/xen/kdb/kdb_cmds.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/kdb/kdb_cmds.c	Wed Nov 14 11:03:24 2012 -0800
@@ -317,7 +317,7 @@ kdb_guest_bitness(domid_t domid)
 
     if (is_idle_domain(dp))
         retval = HYPSZ;
-    else if (is_hvm_or_hyb_domain(dp))
+    else if (is_hvm_or_pvh_domain(dp))
         retval = (hvm_long_mode_enabled(dp->vcpu[0])) ? HYPSZ : 32;
     else 
         retval = is_pv_32bit_domain(dp) ? 32 : HYPSZ;
@@ -977,7 +977,7 @@ kdb_cmdf_ss(int argc, const char **argv,
         kdbp("kdb: Failed to read byte at: %lx\n", regs->KDBIP);
         return KDB_CPU_MAIN_KDB;
     }
-    if (guest_mode(regs) && is_hvm_or_hyb_vcpu(current)) {
+    if (guest_mode(regs) && is_hvm_or_pvh_vcpu(current)) {
         dp->debugger_attached = 1;  /* see svm_do_resume/vmx_do_ */
         current->arch.hvm_vcpu.single_step = 1;
     } else
@@ -1016,7 +1016,7 @@ kdb_cmdf_ni(int argc, const char **argv,
         return KDB_CPU_MAIN_KDB;
 
     kdb_sbpa[i].bp_ni = 1;
-    if (guest_mode(regs) && is_hvm_or_hyb_vcpu(current))
+    if (guest_mode(regs) && is_hvm_or_pvh_vcpu(current))
         current->arch.hvm_vcpu.single_step = 0;
     else
         regs->eflags &= ~X86_EFLAGS_TF;
@@ -1052,7 +1052,7 @@ kdb_cmdf_ssb(int argc, const char **argv
         kdbp("%s: regs not available\n", __FUNCTION__);
         return KDB_CPU_MAIN_KDB;
     }
-    if (is_hvm_or_hyb_vcpu(current)) 
+    if (is_hvm_or_pvh_vcpu(current)) 
         current->domain->debugger_attached = 1;        /* vmx/svm_do_resume()*/
 
     regs->eflags |= X86_EFLAGS_TF;
@@ -1655,7 +1655,7 @@ kdb_set_bp(domid_t domid, kdbva_t addr, 
         return KDBMAXSBP;
     }
     /* make sure swbp reporting is enabled in the vmcb/vmcs */
-    if (is_hvm_or_hyb_domain(kdb_domid2ptr(domid))) {
+    if (is_hvm_or_pvh_domain(kdb_domid2ptr(domid))) {
         struct domain *dp = kdb_domid2ptr(domid);
         dp->debugger_attached = 1;              /* see svm_do_resume/vmx_do_ */
         KDBGP("debugger_attached set. domid:%d\n", domid);
@@ -1708,7 +1708,7 @@ kdb_cmdf_bp(int argc, const char **argv,
     if (domidstrp && !kdb_str2domid(domidstrp, &domid, 1)) {
         return kdb_usgf_bp();
     }
-    if (argc > 3 && is_hvm_or_hyb_domain(kdb_domid2ptr(domid))) {
+    if (argc > 3 && is_hvm_or_pvh_domain(kdb_domid2ptr(domid))) {
         kdbp("HVM domain not supported yet for conditional bp\n");
         return KDB_CPU_MAIN_KDB;
     }
@@ -1756,7 +1756,7 @@ kdb_cmdf_btp(int argc, const char **argv
     argsidx = 2;                   /* assume 3rd arg is not domid */
     if (argc > 3 && kdb_str2domid(argv[2], &domid, 0)) {
 
-        if (is_hvm_or_hyb_domain(kdb_domid2ptr(domid))) {
+        if (is_hvm_or_pvh_domain(kdb_domid2ptr(domid))) {
             kdbp("HVM domains are not currently supprted\n");
             return KDB_CPU_MAIN_KDB;
         } else
@@ -1889,6 +1889,73 @@ kdb_cmdf_wc(int argc, const char **argv,
     return KDB_CPU_MAIN_KDB;
 }
 
+static void
+kdb_display_hvm_vcpu(struct vcpu *vp)
+{
+    struct hvm_vcpu *hvp;
+    struct vlapic *vlp;
+    struct hvm_io_op *ioop;
+
+    hvp = &vp->arch.hvm_vcpu;
+    vlp = &hvp->vlapic;
+    kdbp("vcpu:%lx id:%d domid:%d\n", vp, vp->vcpu_id, vp->domain->domain_id);
+
+    if (is_pvh_vcpu(vp)) {
+        struct pvh_hvm_vcpu_ext *hp = &hvp->hv_pvh;
+        kdbp("    &pvh_ext:%p limit:%x iopl:%x vcpu_info_mfn:%lx\n",
+             hp, hp->pvh_iobmp_limit, hp->pvh_iopl, hp->pvh_vcpu_info_mfn);
+    }
+
+    ioop = NULL;   /* compiler warning */
+    kdbp("    &hvm_vcpu:%lx  guest_efer:"KDBFL"\n", hvp, hvp->guest_efer);
+    kdbp("      guest_cr: [0]:"KDBFL" [1]:"KDBFL" [2]:"KDBFL"\n", 
+         hvp->guest_cr[0], hvp->guest_cr[1],hvp->guest_cr[2]);
+    kdbp("                [3]:"KDBFL" [4]:"KDBFL"\n", hvp->guest_cr[3],
+         hvp->guest_cr[4]);
+    kdbp("      hw_cr: [0]:"KDBFL" [1]:"KDBFL" [2]:"KDBFL"\n", hvp->hw_cr[0],
+         hvp->hw_cr[1], hvp->hw_cr[2]);
+    kdbp("              [3]:"KDBFL" [4]:"KDBFL"\n", hvp->hw_cr[3], 
+         hvp->hw_cr[4]);
+
+    kdbp("      VLAPIC: base msr:"KDBF64" dis:%x tmrdiv:%x\n", 
+         vlp->hw.apic_base_msr, vlp->hw.disabled, vlp->hw.timer_divisor);
+    kdbp("          regs:%p regs_page:%p\n", vlp->regs, vlp->regs_page);
+    kdbp("          periodic time:\n"); 
+    kdb_prnt_periodic_time(&vlp->pt);
+
+    kdbp("      xen_port:%x flag_dr_dirty:%x dbg_st_latch:%x\n", hvp->xen_port,
+         hvp->flag_dr_dirty, hvp->debug_state_latch);
+
+    if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
+
+        struct arch_vmx_struct *vxp = &hvp->u.vmx;
+        kdbp("      &vmx: %p vmcs:%lx active_cpu:%x launched:%x\n", vxp, 
+             vxp->vmcs, vxp->active_cpu, vxp->launched);
+#if XEN_VERSION != 4               /* xen 3.x.x */
+        kdbp("        exec_ctrl:%x vpid:$%d\n", vxp->exec_control, vxp->vpid);
+#endif
+        kdbp("        host_cr0: "KDBFL" vmx: {realm:%x emulate:%x}\n",
+             vxp->host_cr0, vxp->vmx_realmode, vxp->vmx_emulate);
+
+#ifdef __x86_64__
+        kdbp("        &msr_state:%p exception_bitmap:%lx\n", &vxp->msr_state,
+             vxp->exception_bitmap);
+#endif
+    } else if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) {
+        struct arch_svm_struct *svp = &hvp->u.svm;
+#if XEN_VERSION != 4               /* xen 3.x.x */
+        kdbp("  &svm: vmcb:%lx pa:"KDBF64" asid:"KDBF64"\n", svp, svp->vmcb,
+             svp->vmcb_pa, svp->asid_generation);
+#endif
+        kdbp("    msrpm:%p lnch_core:%x vmcb_sync:%x\n", svp->msrpm, 
+             svp->launch_core, svp->vmcb_in_sync);
+    }
+    kdbp("      cachemode:%x io: {state: %x data: "KDBFL"}\n", hvp->cache_mode,
+         hvp->hvm_io.io_state, hvp->hvm_io.io_data);
+    kdbp("      mmio: {gva: "KDBFL" gpfn: "KDBFL"}\n", hvp->hvm_io.mmio_gva,
+         hvp->hvm_io.mmio_gpfn);
+}
+
 /* display struct hvm_vcpu{} in struct vcpu.arch{} */
 static kdb_cpu_cmd_t
 kdb_usgf_vcpuh(void)
@@ -1900,71 +1967,17 @@ static kdb_cpu_cmd_t
 kdb_cmdf_vcpuh(int argc, const char **argv, struct cpu_user_regs *regs)
 {
     struct vcpu *vp;
-    struct hvm_vcpu *hvp;
-    struct hvm_io_op *ioop;
-    struct vlapic *vlp;
 
     if (argc < 2 || *argv[1] == '?') 
         return kdb_usgf_vcpuh();
 
     if (!kdb_str2ulong(argv[1], (ulong *)&vp) || !kdb_vcpu_valid(vp) ||
-        !is_hvm_or_hyb_vcpu(vp)) {
+        !is_hvm_or_pvh_vcpu(vp)) {
 
         kdbp("kdb: Bad VCPU: %s\n", argv[1]);
         return KDB_CPU_MAIN_KDB;
     }
-
-    hvp = &vp->arch.hvm_vcpu;
-    vlp = &hvp->vlapic;
-    kdbp("vcpu:%lx id:%d domid:%d\n", vp, vp->vcpu_id, vp->domain->domain_id);
-
-    ioop = NULL;   /* compiler warning */
-    kdbp("&hvm_vcpu:%lx  guest_efer:"KDBFL"\n", hvp, hvp->guest_efer);
-    kdbp("  guest_cr: [0]:"KDBFL" [1]:"KDBFL" [2]:"KDBFL"\n", hvp->guest_cr[0],
-         hvp->guest_cr[1],hvp->guest_cr[2]);
-    kdbp("            [3]:"KDBFL" [4]:"KDBFL"\n", hvp->guest_cr[3],
-         hvp->guest_cr[4]);
-    kdbp("  hw_cr: [0]:"KDBFL" [1]:"KDBFL" [2]:"KDBFL"\n", hvp->hw_cr[0],
-         hvp->hw_cr[1], hvp->hw_cr[2]);
-    kdbp("          [3]:"KDBFL" [4]:"KDBFL"\n", hvp->hw_cr[3], hvp->hw_cr[4]);
-
-    kdbp("  VLAPIC: base msr:"KDBF64" dis:%x tmrdiv:%x\n", 
-         vlp->hw.apic_base_msr, vlp->hw.disabled, vlp->hw.timer_divisor);
-    kdbp("          regs:%p regs_page:%p\n", vlp->regs, vlp->regs_page);
-    kdbp("          periodic time:\n"); 
-    kdb_prnt_periodic_time(&vlp->pt);
-
-    kdbp("  xen_port:%x flag_dr_dirty:%x dbg_st_latch:%x\n", hvp->xen_port,
-         hvp->flag_dr_dirty, hvp->debug_state_latch);
-
-    if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
-
-        struct arch_vmx_struct *vxp = &hvp->u.vmx;
-        kdbp("  &vmx: %p vmcs:%lx active_cpu:%x launched:%x\n", vxp, vxp->vmcs, 
-             vxp->active_cpu, vxp->launched);
-#if XEN_VERSION != 4               /* xen 3.x.x */
-        kdbp("    exec_ctrl:%x vpid:$%d\n", vxp->exec_control, vxp->vpid);
-#endif
-        kdbp("    host_cr0: "KDBFL" vmx: {realm:%x emulate:%x}\n",
-             vxp->host_cr0, vxp->vmx_realmode, vxp->vmx_emulate);
-
-#ifdef __x86_64__
-        kdbp("    &msr_state:%p\n", &vxp->msr_state);
-#endif
-    } else if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) {
-        struct arch_svm_struct *svp = &hvp->u.svm;
-#if XEN_VERSION != 4               /* xen 3.x.x */
-        kdbp("  &svm: vmcb:%lx pa:"KDBF64" asid:"KDBF64"\n", svp, svp->vmcb,
-             svp->vmcb_pa, svp->asid_generation);
-#endif
-        kdbp("    msrpm:%p lnch_core:%x vmcb_sync:%x\n", svp->msrpm, 
-             svp->launch_core, svp->vmcb_in_sync);
-    }
-    kdbp("  cachemode:%x io: {state: %x data: "KDBFL"}\n", hvp->cache_mode,
-         hvp->hvm_io.io_state, hvp->hvm_io.io_data);
-    kdbp("  mmio: {gva: "KDBFL" gpfn: "KDBFL"}\n", hvp->hvm_io.mmio_gva,
-         hvp->hvm_io.mmio_gpfn);
-
+    kdb_display_hvm_vcpu(vp);
     return KDB_CPU_MAIN_KDB;
 }
 
@@ -2094,7 +2107,7 @@ kdb_display_vcpu(struct vcpu *vp)
     kdbp("  arch info: (%p)\n", &vp->arch);
     kdbp("    guest_context: VGCF_ flags:%lx", 
          vp->arch.vgc_flags); /* VGCF_in_kernel */
-    if (is_hvm_or_hyb_vcpu(vp))
+    if (is_hvm_or_pvh_vcpu(vp))
         kdbp("    (HVM guest: IP, SP, EFLAGS may be stale)");
     kdbp("\n");
     kdb_print_uregs(&vp->arch.user_regs);
@@ -2102,7 +2115,11 @@ kdb_display_vcpu(struct vcpu *vp)
     for (i=0; i < 8; i=i+4)
         kdbp("          %016lx %016lx %016lx %016lx\n", avp->debugreg[i], 
              avp->debugreg[i+1], avp->debugreg[i+2], avp->debugreg[i+3]);
-    kdb_display_pv_vcpu(vp);
+
+    if (is_hvm_or_pvh_vcpu(vp))
+        kdb_display_hvm_vcpu(vp);
+    else
+        kdb_display_pv_vcpu(vp);
 
     kdbp("    TF_flags: %016lx  guest_table: %016lx cr3:%016lx\n", 
          vp->arch.flags, vp->arch.guest_table.pfn, avp->cr3); 
@@ -2291,6 +2308,21 @@ static void kdb_pr_vtsc_info(struct arch
          ap->vtsc_kerncount, ap->vtsc_usercount);
 }
 
+static void kdb_print_p2mlock(struct domain *dp)
+{
+    struct p2m_domain *p2m = p2m_get_hostp2m(dp);
+    mm_rwlock_t *lp = p2m ? &p2m->lock : NULL;
+
+    if (lp == NULL) {
+        kdbp("    p2m lock ptr is null\n");
+        return;
+    }
+    kdbp("    p2m lockval: %x unlock_level:%x recurse_count:%x locker cpu:%x\n",
+         lp->lock.raw.lock, lp->unlock_level, lp->recurse_count,
+         lp->locker);
+    kdbp("    p2m locker_function:%s\n", lp->locker_function);
+}
+
 /* display one domain info */
 static void
 kdb_display_dom(struct domain *dp)
@@ -2332,8 +2364,8 @@ kdb_display_dom(struct domain *dp)
         kdbp("    mapcnt:");
         kdb_print_spin_lock("mapcnt: lk:", &gp->lock, "\n");
     }
-    kdbp("  hvm:%d priv:%d need_iommu:%d dbg:%d dying:%d paused:%d\n",
-         dp->is_hvm, dp->is_privileged, dp->need_iommu,
+    kdbp("  hvm:%d pvh:%d priv:%d need_iommu:%d dbg:%d dying:%d paused:%d\n",
+         dp->is_hvm, dp->is_pvh, dp->is_privileged, dp->need_iommu,
          dp->debugger_attached, dp->is_dying, dp->is_paused_by_controller);
     kdb_print_spin_lock("  shutdown: lk:", &dp->shutdown_lock, "\n");
     kdbp("  shutn:%d shut:%d code:%d \n", dp->is_shutting_down,
@@ -2351,13 +2383,14 @@ kdb_display_dom(struct domain *dp)
     kdbp("    pt_pages:0x%p ", ap->mm_perdomain_pt_pages);
     kdbp("    l2:0x%p l3:0x%p\n", ap->mm_perdomain_l2, ap->mm_perdomain_l3);
     kdbp("    ioport:0x%p &hvm_dom:0x%p\n", ap->ioport_caps, &ap->hvm_domain);
-    if (is_hvm_or_hyb_domain(dp))
+    if (is_hvm_or_pvh_domain(dp))
         kdb_prnt_hvm_dom_info(dp);
 
     kdbp("    &pging_dom:%p mode: %lx", &ap->paging, ap->paging.mode); 
     kdb_pr_dom_pg_modes(dp);
     kdbp("    p2m ptr:%p  pages:{%p, %p}\n", ap->p2m, ap->p2m->pages.next,
          KDB_PGLLE(ap->p2m->pages));
+    kdb_print_p2mlock(dp);
     kdbp("       max_mapped_pfn:"KDBFL, ap->p2m->max_mapped_pfn);
 #if XEN_SUBVERSION > 0 && XEN_VERSION == 4              /* xen 4.1 and above */
     kdbp("  phys_table:%p\n", ap->p2m->phys_table.pfn);
@@ -2932,7 +2965,7 @@ kdb_cmdf_mmu(int argc, const char **argv
     return KDB_CPU_MAIN_KDB;
 }
 
-/* for HVM/HYB guests, go thru EPT. For PV guest we need to go to the btree. 
+/* for HVM/PVH guests, go thru EPT. For PV guest we need to go to the btree. 
  * btree: pfn_to_mfn_frame_list_list is root that points (has mfns of) upto 16
  * pages (call 'em l2 nodes) that contain mfns of guest p2m table pages 
  * NOTE: num of entries in a p2m page is same as num of entries in l2 node */
@@ -2985,7 +3018,7 @@ kdb_gpfn2mfn(struct domain *dp, ulong gp
 	*typep = -1;
         return mfn;
     } else
-        return get_gfn_query(dp, gpfn, typep);
+        return mfn_x(get_gfn_query_unlocked(dp, gpfn, typep));
 
     return INVALID_MFN;
 }
@@ -3001,8 +3034,8 @@ static kdb_cpu_cmd_t
 kdb_cmdf_p2m(int argc, const char **argv, struct cpu_user_regs *regs)
 {
     struct domain *dp;
-    ulong gpfn, mfn;
-    p2m_type_t p2mtype;
+    ulong gpfn, mfn=0xdeadbeef;
+    p2m_type_t p2mtype = -1;
 
     if (argc < 3                                   ||
         (dp=kdb_strdomid2ptr(argv[1], 1)) == NULL  ||
@@ -3015,6 +3048,7 @@ kdb_cmdf_p2m(int argc, const char **argv
         kdbp("p2m[%lx] == %lx type:%d/0x%x\n", gpfn, mfn, p2mtype, p2mtype);
     else 
         kdbp("p2m[%lx] == %lx type:N/A(PV)\n", gpfn, mfn);
+
     return KDB_CPU_MAIN_KDB;
 }
 
@@ -3556,6 +3590,9 @@ kdb_cmdf_info(int argc, const char **arg
             kdbp("|_x2apic");
     kdbp("\n\n");
     kdbp("CC:");
+#if defined(CONFIG_X86_64)
+        kdbp(" CONFIG_X86_64");
+#endif
 #if defined(CONFIG_COMPAT)
         kdbp(" CONFIG_COMPAT");
 #endif
diff -r 8b0762504037 xen/kdb/kdbmain.c
--- a/xen/kdb/kdbmain.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/xen/kdb/kdbmain.c	Wed Nov 14 11:03:24 2012 -0800
@@ -53,10 +53,6 @@ static inline unsigned int kdb_firstbit(
     return (unsigned int)val;
 }
 
-void noinline mukchk(unsigned long ul)
-{
-}
-
 static void 
 kdb_dbg_prnt_ctrps(char *label, int ccpu)
 {
@@ -179,11 +175,6 @@ kdb_begin_session(void)
     }
 }
 
-int noinline mukid(void)
-{
-    return smp_processor_id();
-}
-
 static void
 kdb_smp_unpause_cpus(int ccpu)
 {
@@ -238,8 +229,7 @@ kdb_end_session(int ccpu, struct cpu_use
     watchdog_enable();
     KDBGP("end_session:ccpu:%d\n", ccpu);
 }
-volatile int mukwpprnt;
-unsigned long mukaddr1 = 0xffffffff81243ae7, mukaddr2 = 0xffffffff8100986e;
+
 /* 
  * check if we entered kdb because of DB trap. If yes, then check if
  * we caused it or someone else.
@@ -276,14 +266,6 @@ kdb_check_dbtrap(kdb_reason_t *reasp, in
             }
         } else if (! kdb_check_watchpoints(regs)) {
             rc = 0;                        /* hyp must handle it */
-        } else {
-            if (regs->rip==mukaddr1 || regs->rip==mukaddr2)
-            {
-                if (mukwpprnt)
-                    kdbp("MUK: ignoring wp:%lx\n", regs->rip);
-                kdb_end_session(ccpu, regs);
-                rc = 1;
-            } 
         }
     }
     return rc;
@@ -382,7 +364,7 @@ kdbmain(kdb_reason_t reason, struct cpu_
             }
         } else if (rc == 2) {        /* one of ours but condition not met */
                 kdb_begin_session();
-                if (guest_mode(regs) && is_hvm_or_hyb_vcpu(current))
+                if (guest_mode(regs) && is_hvm_or_pvh_vcpu(current))
                     current->arch.hvm_vcpu.single_step = 1;
                 else
                     regs->eflags |= X86_EFLAGS_TF;  
@@ -422,7 +404,7 @@ kdbmain(kdb_reason_t reason, struct cpu_
             if (!cpumask_empty(&kdb_cpu_traps)) {
                 /* execute current instruction without 0xcc */
                 kdb_dbg_prnt_ctrps("nempty:", ccpu);
-                if (guest_mode(regs) && is_hvm_or_hyb_vcpu(current))
+                if (guest_mode(regs) && is_hvm_or_pvh_vcpu(current))
                     current->arch.hvm_vcpu.single_step = 1;
                 else
                     regs->eflags |= X86_EFLAGS_TF;  
@@ -439,7 +421,7 @@ kdbmain(kdb_reason_t reason, struct cpu_
         if (kdb_swbp_exists()) {
             if (reason == KDB_REASON_BPEXCP) {
                 /* do delayed install */
-                if (guest_mode(regs) && is_hvm_or_hyb_vcpu(current))
+                if (guest_mode(regs) && is_hvm_or_pvh_vcpu(current))
                     current->arch.hvm_vcpu.single_step = 1;
                 else
                     regs->eflags |= X86_EFLAGS_TF;  
@@ -538,7 +520,7 @@ kdb_handle_trap_entry(int vector, struct
             kdb_trap_immed_reason = 0;
             rc = kdb_keyboard(regs);
         } else {                         /* ss/ni/delayed install... */
-            if (guest_mode(regs) && is_hvm_or_hyb_vcpu(current))
+            if (guest_mode(regs) && is_hvm_or_pvh_vcpu(current))
                 current->arch.hvm_vcpu.single_step = 0;
             rc = kdbmain(KDB_REASON_DBEXCP, regs); 
         }
@@ -755,3 +737,8 @@ kdb_trcp(void)
     kdbp(" [most recent]: %016lx   trcidx: 0x%x\n", &trca[i], trcidx);
 }
 
+volatile int muklkdbg;
+void noinline mukchk(unsigned long ul)
+{
+}
+

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 19:33:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 19:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYihx-0005jr-52; Wed, 14 Nov 2012 19:33:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TYihu-0005jK-Qp
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 19:33:07 +0000
Received: from [85.158.138.51:26616] by server-15.bemta-3.messagelabs.com id
	76/FF-09445-DE1F3A05; Wed, 14 Nov 2012 19:33:01 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1352921579!21157389!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTI0Mzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27456 invoked from network); 14 Nov 2012 19:33:00 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-7.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 19:33:00 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAEJWfWQ027034
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 19:32:41 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAEJWdBC019583
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Nov 2012 19:32:40 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAEJWcSF013343; Wed, 14 Nov 2012 13:32:39 -0600
MIME-Version: 1.0
Message-ID: <4875f016-739f-4a62-9308-90ddd8791026@default>
Date: Wed, 14 Nov 2012 11:32:34 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Keir Fraser <keir.xen@gmail.com>, Jan Beulich <JBeulich@suse.com>,
	TimDeegan <tim@xen.org>
References: <c6b2faed-a38b-4bb7-8bc8-361513837569@default>
	<CCC99A5A.44A8D%keir.xen@gmail.com>
In-Reply-To: <CCC99A5A.44A8D%keir.xen@gmail.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org,
	Konrad Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Keir Fraser [mailto:keir.xen@gmail.com]
> Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an existing) hypercall
> 
> On 14/11/2012 17:42, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:
> 
> >> It would be nice if d->tot_pages adjustments didn't take the global
> >> heap_lock in this case. There's probably some way to bail out of those new
> >> update functions before doing the locked work, in that case.
> >
> > I agree.  I played with atomics for a bit but couldn't
> > see a way it would work without races.  The generic
> > pseudo-code is
> >
> > if (A) {
> > atomically {
> > modify A
> > modify d->B
> > }
> > } else {
> > modify d->B
> > }
> >
> > Any ideas?
> 
> E.g.,
>     /* Fast path (new). */
>     if ( !d->unclaimed_pages )
>         return d->tot_pages += pages;
>     /* Slower path (as in your patch). */
>     spin_lock(&heap_lock);
>     d->tot_pages += pages;
>     if ( d->unclaimed_pages )
>         ....
> 
> The only danger is around any necessary interlocking with d->unclaimed_pages
> becoming non-zero. But the fast-path test is still under d->page_alloc_lock,
> and you set up d->unclaimed_pages under that lock, so it looks okay to me.

Hmmm, nice, I think you are right.  I had just removed the
d->page_alloc_lock in the "set" code at Jan's suggestion,
but this is a good reason to keep it there.  I'll also
add a comment to document this subtle lock interdependency.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 19:33:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 19:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYihx-0005jr-52; Wed, 14 Nov 2012 19:33:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TYihu-0005jK-Qp
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 19:33:07 +0000
Received: from [85.158.138.51:26616] by server-15.bemta-3.messagelabs.com id
	76/FF-09445-DE1F3A05; Wed, 14 Nov 2012 19:33:01 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1352921579!21157389!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTI0Mzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27456 invoked from network); 14 Nov 2012 19:33:00 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-7.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 19:33:00 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAEJWfWQ027034
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 19:32:41 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAEJWdBC019583
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Nov 2012 19:32:40 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAEJWcSF013343; Wed, 14 Nov 2012 13:32:39 -0600
MIME-Version: 1.0
Message-ID: <4875f016-739f-4a62-9308-90ddd8791026@default>
Date: Wed, 14 Nov 2012 11:32:34 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Keir Fraser <keir.xen@gmail.com>, Jan Beulich <JBeulich@suse.com>,
	TimDeegan <tim@xen.org>
References: <c6b2faed-a38b-4bb7-8bc8-361513837569@default>
	<CCC99A5A.44A8D%keir.xen@gmail.com>
In-Reply-To: <CCC99A5A.44A8D%keir.xen@gmail.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org,
	Konrad Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Keir Fraser [mailto:keir.xen@gmail.com]
> Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an existing) hypercall
> 
> On 14/11/2012 17:42, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:
> 
> >> It would be nice if d->tot_pages adjustments didn't take the global
> >> heap_lock in this case. There's probably some way to bail out of those new
> >> update functions before doing the locked work, in that case.
> >
> > I agree.  I played with atomics for a bit but couldn't
> > see a way it would work without races.  The generic
> > pseudo-code is
> >
> > if (A) {
> > atomically {
> > modify A
> > modify d->B
> > }
> > } else {
> > modify d->B
> > }
> >
> > Any ideas?
> 
> E.g.,
>     /* Fast path (new). */
>     if ( !d->unclaimed_pages )
>         return d->tot_pages += pages;
>     /* Slower path (as in your patch). */
>     spin_lock(&heap_lock);
>     d->tot_pages += pages;
>     if ( d->unclaimed_pages )
>         ....
> 
> The only danger is around any necessary interlocking with d->unclaimed_pages
> becoming non-zero. But the fast-path test is still under d->page_alloc_lock,
> and you set up d->unclaimed_pages under that lock, so it looks okay to me.

Hmmm, nice, I think you are right.  I had just removed the
d->page_alloc_lock in the "set" code at Jan's suggestion,
but this is a good reason to keep it there.  I'll also
add a comment to document this subtle lock interdependency.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 19:52:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 19:52:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYj0R-0006Hc-UY; Wed, 14 Nov 2012 19:52:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <anderson@redhat.com>) id 1TYj0Q-0006HX-PL
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 19:52:14 +0000
Received: from [85.158.143.35:60145] by server-2.bemta-4.messagelabs.com id
	C8/09-28922-D66F3A05; Wed, 14 Nov 2012 19:52:13 +0000
X-Env-Sender: anderson@redhat.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1352922729!17804305!1
X-Originating-IP: [209.132.183.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjUgPT4gODE2Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17161 invoked from network); 14 Nov 2012 19:52:10 -0000
Received: from mx4-phx2.redhat.com (HELO mx4-phx2.redhat.com) (209.132.183.25)
	by server-14.tower-21.messagelabs.com with SMTP;
	14 Nov 2012 19:52:10 -0000
Received: from zmail15.collab.prod.int.phx2.redhat.com
	(zmail15.collab.prod.int.phx2.redhat.com [10.5.83.17])
	by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qAEJq0sZ004891;
	Wed, 14 Nov 2012 14:52:00 -0500
Date: Wed, 14 Nov 2012 14:52:00 -0500 (EST)
From: Dave Anderson <anderson@redhat.com>
To: Daniel Kiper <daniel.kiper@oracle.com>
Message-ID: <935158332.31770683.1352922720179.JavaMail.root@redhat.com>
In-Reply-To: <20121113161000.GA2942@host-192-168-1-59.local.net-space.pl>
MIME-Version: 1.0
X-Originating-IP: [10.16.187.10]
X-Mailer: Zimbra 7.2.0_GA_2669 (ZimbraWebClient - FF3.0 (Linux)/7.2.0_GA_2669)
Cc: olaf@aepfle.de, xen-devel@lists.xensource.com,
	konrad wilk <konrad.wilk@oracle.com>,
	andrew cooper3 <andrew.cooper3@citrix.com>, ptesarik@suse.cz,
	duanshuidao@hotmail.com, jbeulich@suse.com,
	kexec@lists.infradead.org, crash-utility@redhat.com
Subject: Re: [Xen-devel] [PATCH 0/5] crash: Bundle of fixes for Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



----- Original Message -----
> Hi,
> 
> Here is next bundle of fixes for crash Xen support:
>   - xen: Fix page tables caching issues,
>   - xen: Use init_tss array or per_cpu__init_tss,
>   - xen: Use per_cpu__crash_notes or crash_notes array,
>   - xen: Try hard to get max_cpus value,
>   - xen: Use cpu_present_map instead of cpu_online_map.
> 
> All patches were tested with Xen versions up to 4.2.
> 
> Daniel
> 

Hi Daniel,

The patches look reasonable to me, and they test OK on older
RHEL5 dom0 dumpfiles.  It would be interesting to see whether
they work for Hu Jun's SUSE kernel dumpfile.  I've cc'd him
directly.

Thanks,
  Dave

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 19:52:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 19:52:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYj0R-0006Hc-UY; Wed, 14 Nov 2012 19:52:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <anderson@redhat.com>) id 1TYj0Q-0006HX-PL
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 19:52:14 +0000
Received: from [85.158.143.35:60145] by server-2.bemta-4.messagelabs.com id
	C8/09-28922-D66F3A05; Wed, 14 Nov 2012 19:52:13 +0000
X-Env-Sender: anderson@redhat.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1352922729!17804305!1
X-Originating-IP: [209.132.183.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjUgPT4gODE2Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17161 invoked from network); 14 Nov 2012 19:52:10 -0000
Received: from mx4-phx2.redhat.com (HELO mx4-phx2.redhat.com) (209.132.183.25)
	by server-14.tower-21.messagelabs.com with SMTP;
	14 Nov 2012 19:52:10 -0000
Received: from zmail15.collab.prod.int.phx2.redhat.com
	(zmail15.collab.prod.int.phx2.redhat.com [10.5.83.17])
	by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qAEJq0sZ004891;
	Wed, 14 Nov 2012 14:52:00 -0500
Date: Wed, 14 Nov 2012 14:52:00 -0500 (EST)
From: Dave Anderson <anderson@redhat.com>
To: Daniel Kiper <daniel.kiper@oracle.com>
Message-ID: <935158332.31770683.1352922720179.JavaMail.root@redhat.com>
In-Reply-To: <20121113161000.GA2942@host-192-168-1-59.local.net-space.pl>
MIME-Version: 1.0
X-Originating-IP: [10.16.187.10]
X-Mailer: Zimbra 7.2.0_GA_2669 (ZimbraWebClient - FF3.0 (Linux)/7.2.0_GA_2669)
Cc: olaf@aepfle.de, xen-devel@lists.xensource.com,
	konrad wilk <konrad.wilk@oracle.com>,
	andrew cooper3 <andrew.cooper3@citrix.com>, ptesarik@suse.cz,
	duanshuidao@hotmail.com, jbeulich@suse.com,
	kexec@lists.infradead.org, crash-utility@redhat.com
Subject: Re: [Xen-devel] [PATCH 0/5] crash: Bundle of fixes for Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



----- Original Message -----
> Hi,
> 
> Here is next bundle of fixes for crash Xen support:
>   - xen: Fix page tables caching issues,
>   - xen: Use init_tss array or per_cpu__init_tss,
>   - xen: Use per_cpu__crash_notes or crash_notes array,
>   - xen: Try hard to get max_cpus value,
>   - xen: Use cpu_present_map instead of cpu_online_map.
> 
> All patches were tested with Xen versions up to 4.2.
> 
> Daniel
> 

Hi Daniel,

The patches look reasonable to me, and they test OK on older
RHEL5 dom0 dumpfiles.  It would be interesting to see whether
they work for Hu Jun's SUSE kernel dumpfile.  I've cc'd him
directly.

Thanks,
  Dave

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 20:14:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 20:14:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYjLx-0006sc-VT; Wed, 14 Nov 2012 20:14:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1TYjLw-0006sX-BE
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 20:14:28 +0000
Received: from [85.158.139.211:54558] by server-5.bemta-5.messagelabs.com id
	2E/B2-11353-3ABF3A05; Wed, 14 Nov 2012 20:14:27 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-9.tower-206.messagelabs.com!1352924065!18700323!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7514 invoked from network); 14 Nov 2012 20:14:26 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 20:14:26 -0000
Received: by mail-ie0-f173.google.com with SMTP id 17so1433415iea.32
	for <xen-devel@lists.xen.org>; Wed, 14 Nov 2012 12:14:25 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=from:content-type:content-transfer-encoding:subject:date:message-id
	:cc:to:mime-version:x-mailer:x-gm-message-state;
	bh=13hZ9MVqumATOU4fptVRIVCcQNmRehTJMfThPNbzsVk=;
	b=g+mzR/sSfYZc/+No54gnLXzG+E5fXZfzCUm4BMZgL1gujxXwe4pJg0yy95f/QrcnEj
	OyP0BLsDL0SGpCWTjze0SlfixFKH5pHItYFZqGoS3DYJgZ2nPXrPeUwxmWY27nkbFoxN
	0LDo4y+JcBayFQOsVpTZmkRtoQ5nzD+jm8M1tGIdwxltHOA1PCU68whmcoG/C1FCPGC5
	vbEB4MhpeTkj6nqYCJQIJx7tOI2Ax4gEMurUZWM2gD5Vm6HyzVQbpCnA8LDeGeLnzvq+
	r+TEPn/1bnCYFm/GU1+9OGyZBhQVOdeOvDGxS0Y2gTEdYlWxYCQHHDOyc1jkX9Y+hVTa
	IopQ==
Received: by 10.42.44.196 with SMTP id c4mr25446110icf.17.1352924065206;
	Wed, 14 Nov 2012 12:14:25 -0800 (PST)
Received: from andress-macbook.gridcentric.ca ([206.223.182.18])
	by mx.google.com with ESMTPS id eo7sm2087751igc.12.2012.11.14.12.14.24
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 14 Nov 2012 12:14:24 -0800 (PST)
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
Date: Wed, 14 Nov 2012 15:14:22 -0500
Message-Id: <F4532D0E-2988-4B56-8555-0ADCE9D44CC8@gridcentric.ca>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, qemu-devel@nongnu.org
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQlhIav5+rDMlWG50AgR3I7LvO4hhQTCM4+bLLfS99xVYsKd5cqZ5A5/3Eu+SkUfWoCURCon
Cc: Peter Feiner <peter@gridcentric.ca>
Subject: [Xen-devel] Question on Xen management of qemu ram blocks and
	memory regions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Stefano, and Xen-qemu team, I have a question.

The standard Xen-qemu workflow has Xen manage the physmap for a VM, and allocate all the backing memory for valid pfns, regardless of whether they are MMIO, RAM, etc. On save/migrate, when using upstream qemu, a special monitor command is used to save the device model state, while the save/restore code blocks in libxc takes care of the memory.

Qemu has a chain of ram blocks with offsets, each of which is further subdivided into memory regions that map to specific chunks of the physmap.

AFAICT, the restore code in libxc has no knowledge of qemu's ram blocks and offsets. My question is, how is a mismatch avoided?

How does the workflow ensure that all the sub regions in each ram block map to the same physmap chunks on restore? Is this an implicit guarantee from qemu when building the VM (with the same command line) on the restore side? 

Are the regions and physmap offsets contained in the device state that is saved?

If, for example, I were to save/restore a VM with four e1000 emulated devices, how does the workflow guarantee that each physmap region backing each e1000 ROM gets reconstructed with exactly the same ram block, offset, and physmap chunk coordinates?

Code inspection seems to suggest qemu will lay out things deterministically given the command line. I want to make sure I am not missing anything.

Thanks!
Andres




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 20:14:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 20:14:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYjLx-0006sc-VT; Wed, 14 Nov 2012 20:14:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1TYjLw-0006sX-BE
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 20:14:28 +0000
Received: from [85.158.139.211:54558] by server-5.bemta-5.messagelabs.com id
	2E/B2-11353-3ABF3A05; Wed, 14 Nov 2012 20:14:27 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-9.tower-206.messagelabs.com!1352924065!18700323!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7514 invoked from network); 14 Nov 2012 20:14:26 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 20:14:26 -0000
Received: by mail-ie0-f173.google.com with SMTP id 17so1433415iea.32
	for <xen-devel@lists.xen.org>; Wed, 14 Nov 2012 12:14:25 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=from:content-type:content-transfer-encoding:subject:date:message-id
	:cc:to:mime-version:x-mailer:x-gm-message-state;
	bh=13hZ9MVqumATOU4fptVRIVCcQNmRehTJMfThPNbzsVk=;
	b=g+mzR/sSfYZc/+No54gnLXzG+E5fXZfzCUm4BMZgL1gujxXwe4pJg0yy95f/QrcnEj
	OyP0BLsDL0SGpCWTjze0SlfixFKH5pHItYFZqGoS3DYJgZ2nPXrPeUwxmWY27nkbFoxN
	0LDo4y+JcBayFQOsVpTZmkRtoQ5nzD+jm8M1tGIdwxltHOA1PCU68whmcoG/C1FCPGC5
	vbEB4MhpeTkj6nqYCJQIJx7tOI2Ax4gEMurUZWM2gD5Vm6HyzVQbpCnA8LDeGeLnzvq+
	r+TEPn/1bnCYFm/GU1+9OGyZBhQVOdeOvDGxS0Y2gTEdYlWxYCQHHDOyc1jkX9Y+hVTa
	IopQ==
Received: by 10.42.44.196 with SMTP id c4mr25446110icf.17.1352924065206;
	Wed, 14 Nov 2012 12:14:25 -0800 (PST)
Received: from andress-macbook.gridcentric.ca ([206.223.182.18])
	by mx.google.com with ESMTPS id eo7sm2087751igc.12.2012.11.14.12.14.24
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 14 Nov 2012 12:14:24 -0800 (PST)
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
Date: Wed, 14 Nov 2012 15:14:22 -0500
Message-Id: <F4532D0E-2988-4B56-8555-0ADCE9D44CC8@gridcentric.ca>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, qemu-devel@nongnu.org
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQlhIav5+rDMlWG50AgR3I7LvO4hhQTCM4+bLLfS99xVYsKd5cqZ5A5/3Eu+SkUfWoCURCon
Cc: Peter Feiner <peter@gridcentric.ca>
Subject: [Xen-devel] Question on Xen management of qemu ram blocks and
	memory regions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Stefano, and Xen-qemu team, I have a question.

The standard Xen-qemu workflow has Xen manage the physmap for a VM, and allocate all the backing memory for valid pfns, regardless of whether they are MMIO, RAM, etc. On save/migrate, when using upstream qemu, a special monitor command is used to save the device model state, while the save/restore code blocks in libxc takes care of the memory.

Qemu has a chain of ram blocks with offsets, each of which is further subdivided into memory regions that map to specific chunks of the physmap.

AFAICT, the restore code in libxc has no knowledge of qemu's ram blocks and offsets. My question is, how is a mismatch avoided?

How does the workflow ensure that all the sub regions in each ram block map to the same physmap chunks on restore? Is this an implicit guarantee from qemu when building the VM (with the same command line) on the restore side? 

Are the regions and physmap offsets contained in the device state that is saved?

If, for example, I were to save/restore a VM with four e1000 emulated devices, how does the workflow guarantee that each physmap region backing each e1000 ROM gets reconstructed with exactly the same ram block, offset, and physmap chunk coordinates?

Code inspection seems to suggest qemu will lay out things deterministically given the command line. I want to make sure I am not missing anything.

Thanks!
Andres




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 20:48:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 20:48:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYjsT-0007cw-0D; Wed, 14 Nov 2012 20:48:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TYjsR-0007cr-Lh
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 20:48:03 +0000
Received: from [85.158.139.83:11380] by server-13.bemta-5.messagelabs.com id
	A6/24-27809-18304A05; Wed, 14 Nov 2012 20:48:01 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-12.tower-182.messagelabs.com!1352926080!30295361!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDY2NTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2615 invoked from network); 14 Nov 2012 20:48:00 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-12.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 14 Nov 2012 20:48:00 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id B35551247;
	Wed, 14 Nov 2012 22:47:59 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 3013FEC027; Wed, 14 Nov 2012 22:47:59 +0200 (EET)
Date: Wed, 14 Nov 2012 22:47:59 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: ????????? <khch82@naver.com>
Message-ID: <20121114204758.GN8912@reaktio.net>
References: <e7a1cb6662aefdd2ecdf80ba7782d6@tweb06.nm.nhnsystem.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <e7a1cb6662aefdd2ecdf80ba7782d6@tweb06.nm.nhnsystem.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] libxl: error:
 libxl_dm.c:1212:device_model_spawn_outcome: domain 1 device model: spawn
 failed (rc=-3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 14, 2012 at 09:35:00PM +0900, ????????? wrote:
> 
>    xen_platform_pci=1
> 
>    xiridian=1
> 

That should be "viridian=1". 

Sorry I don't have comments/help about your actual SPICE problem :)

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 20:48:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 20:48:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYjsT-0007cw-0D; Wed, 14 Nov 2012 20:48:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TYjsR-0007cr-Lh
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 20:48:03 +0000
Received: from [85.158.139.83:11380] by server-13.bemta-5.messagelabs.com id
	A6/24-27809-18304A05; Wed, 14 Nov 2012 20:48:01 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-12.tower-182.messagelabs.com!1352926080!30295361!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDY2NTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2615 invoked from network); 14 Nov 2012 20:48:00 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-12.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 14 Nov 2012 20:48:00 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id B35551247;
	Wed, 14 Nov 2012 22:47:59 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 3013FEC027; Wed, 14 Nov 2012 22:47:59 +0200 (EET)
Date: Wed, 14 Nov 2012 22:47:59 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: ????????? <khch82@naver.com>
Message-ID: <20121114204758.GN8912@reaktio.net>
References: <e7a1cb6662aefdd2ecdf80ba7782d6@tweb06.nm.nhnsystem.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <e7a1cb6662aefdd2ecdf80ba7782d6@tweb06.nm.nhnsystem.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] libxl: error:
 libxl_dm.c:1212:device_model_spawn_outcome: domain 1 device model: spawn
 failed (rc=-3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 14, 2012 at 09:35:00PM +0900, ????????? wrote:
> 
>    xen_platform_pci=1
> 
>    xiridian=1
> 

That should be "viridian=1". 

Sorry I don't have comments/help about your actual SPICE problem :)

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 21:40:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 21:40:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYkhB-0000Id-D2; Wed, 14 Nov 2012 21:40:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg@wind.enjellic.com>) id 1TYkh9-0000IX-OC
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 21:40:27 +0000
Received: from [85.158.143.35:50517] by server-2.bemta-4.messagelabs.com id
	3B/DD-28922-BCF04A05; Wed, 14 Nov 2012 21:40:27 +0000
X-Env-Sender: greg@wind.enjellic.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1352929225!5526143!1
X-Originating-IP: [76.10.64.91]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9485 invoked from network); 14 Nov 2012 21:40:25 -0000
Received: from wind.enjellic.com (HELO wind.enjellic.com) (76.10.64.91)
	by server-4.tower-21.messagelabs.com with SMTP;
	14 Nov 2012 21:40:25 -0000
Received: from wind.enjellic.com (localhost [127.0.0.1])
	by wind.enjellic.com (8.14.3/8.14.3) with ESMTP id qAELeIJG023144;
	Wed, 14 Nov 2012 15:40:18 -0600
Received: (from greg@localhost)
	by wind.enjellic.com (8.14.3/8.14.3/Submit) id qAELeHpG023143;
	Wed, 14 Nov 2012 15:40:17 -0600
Date: Wed, 14 Nov 2012 15:40:17 -0600
From: "Dr. Greg Wettstein" <greg@wind.enjellic.com>
Message-Id: <201211142140.qAELeHpG023143@wind.enjellic.com>
In-Reply-To: Ian Campbell <Ian.Campbell@citrix.com>
	"Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the
	virtual machine created by xl command?" (Nov 13, 10:02am)
X-Mailer: Mail User's Shell (7.2.6-ESD1.0 03/31/2012)
To: Ian Campbell <Ian.Campbell@citrix.com>, Qian Hu <qianhu2011@gmail.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.3
	(wind.enjellic.com [0.0.0.0]);
	Wed, 14 Nov 2012 15:40:18 -0600 (CST)
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the
	virtual machine created by xl command?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: greg@enjellic.com
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Nov 13, 10:02am, Ian Campbell wrote:
} Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the v

Good afternoon, hope the week is going well for everyone.

> On Tue, 2012-11-13 at 06:30 +0000, Qian Hu wrote:
> 
> > With spice tool, I have to create a VM by xl command, and now I am
> > wondering if it supports VGA passghrouth?

> This list is for the development of Xen. You';d probably have more
> luck with these sorts of support requests on the xen-users list.

That would normally be the case but I'm suspicious there are issues
with VGA passthrough in 4.2.0.

I worked through all the vagaries of getting VGA passthrough going
with ATI cards about two years ago using the patches which are
available through the xen-vel archives.  We have run literally
thousands of Windows 7 passthrough sessions since then under 4.0.x and
4.1.x.

We've just started validating 4.2.0 and passthrough reliably generates
segmentation faults in qemu-dm on the first attempt to do an I/O port
read.  The fault occurs with an identical configuration file using
either xm or xl.  Testing is being done with a 3.4.18 dom0 kernel.

I'm thinking we may have initially hit this in 4.1.0.  Segmentation
faults in the device emulator were being experienced but these seemed
to go away when we the dom0 kernel was switched back to a 2.6.32.x
kernel which we were using from Jeremy's GIT tree.

We need to make the jump to 3.4.x so I'm going to see if I can hunt
the issue down.

For those who may want to assist in trying to get all of this working
a bit better I have a 4.2.0 port of the ATI patches available at the
following location:

	ftp://ftp.enjellic.com/pub/xen/xen-4.2.0.ati-passthrough.patch

You will minimally need the qemu-dm binary from a build with this
patch applied.

I have also made available a helper script which we use to automate
the binding/rebinding of the VGA card and the USB controller passed
through to provide mouse/keyboard support.   The script can be picked
up from the following location:

	ftp://ftp.enjellic.com/pub/xen/run-passthrough

The script is straight forward but will need a bit of tweaking for
items such as the PCI configuration being passwed through.

The script uses vbetool to issue a VGA post reset after the passthough
session is completed.  We run all this from a VGA text mode console
(yes we are old fashioned) so the results are 'unspecified' for trying
do this from anything resembling a remotely sophisticated graphics
session.

This all tends to not be for the faint of heart.  I recommend having a
network login session running from a separate machine in case things
decide to go south.  A 'sync && reboot' always being a bit more
palatable then yanking the power cord.

The VGA cards we have been using were some monstrous thing which was
in vogue 2-3 years ago.  The fundamentals are as follows:

---------------------------------------------------------------------------
01:00.0 VGA compatible controller: ATI Technologies Inc Device 6898
(prog-if 00
[VGA controller])
        Subsystem: ASUSTeK Computer Inc. Device 0346
        Flags: fast devsel, IRQ 16
        Memory at b0000000 (64-bit, prefetchable) [size=256M]
        Memory at c1a00000 (64-bit, non-prefetchable) [size=128K]
        I/O ports at 3000 [size=256]
        Expansion ROM at c1a40000 [disabled] [size=128K]
        Capabilities: <access denied>
---------------------------------------------------------------------------

I will continue to hunt to see if I can further isolate the problem.
If anyone else wants to experiment a bit please do so and let me know
the results from 4.2.0.

For the record we are using Intel S3420GP motherboards.  We found the
VT-D implementation to be solid on that motherboard.

> Ian.

Hope the above is helpful.

Have a good evening.

Greg

}-- End of excerpt from Ian Campbell

As always,
Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
4206 N. 19th Ave.           Specializing in information infra-structure
Fargo, ND  58102            development.
PH: 701-281-1686
FAX: 701-281-3949           EMAIL: greg@enjellic.com
------------------------------------------------------------------------------
"We have more to fear from the bungling of the incompetent than from
 the machinations of the wicked."
                                -- Slashdot

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 21:40:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 21:40:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYkhB-0000Id-D2; Wed, 14 Nov 2012 21:40:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg@wind.enjellic.com>) id 1TYkh9-0000IX-OC
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 21:40:27 +0000
Received: from [85.158.143.35:50517] by server-2.bemta-4.messagelabs.com id
	3B/DD-28922-BCF04A05; Wed, 14 Nov 2012 21:40:27 +0000
X-Env-Sender: greg@wind.enjellic.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1352929225!5526143!1
X-Originating-IP: [76.10.64.91]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9485 invoked from network); 14 Nov 2012 21:40:25 -0000
Received: from wind.enjellic.com (HELO wind.enjellic.com) (76.10.64.91)
	by server-4.tower-21.messagelabs.com with SMTP;
	14 Nov 2012 21:40:25 -0000
Received: from wind.enjellic.com (localhost [127.0.0.1])
	by wind.enjellic.com (8.14.3/8.14.3) with ESMTP id qAELeIJG023144;
	Wed, 14 Nov 2012 15:40:18 -0600
Received: (from greg@localhost)
	by wind.enjellic.com (8.14.3/8.14.3/Submit) id qAELeHpG023143;
	Wed, 14 Nov 2012 15:40:17 -0600
Date: Wed, 14 Nov 2012 15:40:17 -0600
From: "Dr. Greg Wettstein" <greg@wind.enjellic.com>
Message-Id: <201211142140.qAELeHpG023143@wind.enjellic.com>
In-Reply-To: Ian Campbell <Ian.Campbell@citrix.com>
	"Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the
	virtual machine created by xl command?" (Nov 13, 10:02am)
X-Mailer: Mail User's Shell (7.2.6-ESD1.0 03/31/2012)
To: Ian Campbell <Ian.Campbell@citrix.com>, Qian Hu <qianhu2011@gmail.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.3
	(wind.enjellic.com [0.0.0.0]);
	Wed, 14 Nov 2012 15:40:18 -0600 (CST)
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the
	virtual machine created by xl command?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: greg@enjellic.com
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Nov 13, 10:02am, Ian Campbell wrote:
} Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the v

Good afternoon, hope the week is going well for everyone.

> On Tue, 2012-11-13 at 06:30 +0000, Qian Hu wrote:
> 
> > With spice tool, I have to create a VM by xl command, and now I am
> > wondering if it supports VGA passghrouth?

> This list is for the development of Xen. You';d probably have more
> luck with these sorts of support requests on the xen-users list.

That would normally be the case but I'm suspicious there are issues
with VGA passthrough in 4.2.0.

I worked through all the vagaries of getting VGA passthrough going
with ATI cards about two years ago using the patches which are
available through the xen-vel archives.  We have run literally
thousands of Windows 7 passthrough sessions since then under 4.0.x and
4.1.x.

We've just started validating 4.2.0 and passthrough reliably generates
segmentation faults in qemu-dm on the first attempt to do an I/O port
read.  The fault occurs with an identical configuration file using
either xm or xl.  Testing is being done with a 3.4.18 dom0 kernel.

I'm thinking we may have initially hit this in 4.1.0.  Segmentation
faults in the device emulator were being experienced but these seemed
to go away when we the dom0 kernel was switched back to a 2.6.32.x
kernel which we were using from Jeremy's GIT tree.

We need to make the jump to 3.4.x so I'm going to see if I can hunt
the issue down.

For those who may want to assist in trying to get all of this working
a bit better I have a 4.2.0 port of the ATI patches available at the
following location:

	ftp://ftp.enjellic.com/pub/xen/xen-4.2.0.ati-passthrough.patch

You will minimally need the qemu-dm binary from a build with this
patch applied.

I have also made available a helper script which we use to automate
the binding/rebinding of the VGA card and the USB controller passed
through to provide mouse/keyboard support.   The script can be picked
up from the following location:

	ftp://ftp.enjellic.com/pub/xen/run-passthrough

The script is straight forward but will need a bit of tweaking for
items such as the PCI configuration being passwed through.

The script uses vbetool to issue a VGA post reset after the passthough
session is completed.  We run all this from a VGA text mode console
(yes we are old fashioned) so the results are 'unspecified' for trying
do this from anything resembling a remotely sophisticated graphics
session.

This all tends to not be for the faint of heart.  I recommend having a
network login session running from a separate machine in case things
decide to go south.  A 'sync && reboot' always being a bit more
palatable then yanking the power cord.

The VGA cards we have been using were some monstrous thing which was
in vogue 2-3 years ago.  The fundamentals are as follows:

---------------------------------------------------------------------------
01:00.0 VGA compatible controller: ATI Technologies Inc Device 6898
(prog-if 00
[VGA controller])
        Subsystem: ASUSTeK Computer Inc. Device 0346
        Flags: fast devsel, IRQ 16
        Memory at b0000000 (64-bit, prefetchable) [size=256M]
        Memory at c1a00000 (64-bit, non-prefetchable) [size=128K]
        I/O ports at 3000 [size=256]
        Expansion ROM at c1a40000 [disabled] [size=128K]
        Capabilities: <access denied>
---------------------------------------------------------------------------

I will continue to hunt to see if I can further isolate the problem.
If anyone else wants to experiment a bit please do so and let me know
the results from 4.2.0.

For the record we are using Intel S3420GP motherboards.  We found the
VT-D implementation to be solid on that motherboard.

> Ian.

Hope the above is helpful.

Have a good evening.

Greg

}-- End of excerpt from Ian Campbell

As always,
Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
4206 N. 19th Ave.           Specializing in information infra-structure
Fargo, ND  58102            development.
PH: 701-281-1686
FAX: 701-281-3949           EMAIL: greg@enjellic.com
------------------------------------------------------------------------------
"We have more to fear from the bungling of the incompetent than from
 the machinations of the wicked."
                                -- Slashdot

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 21:57:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 21:57:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYkxD-0000mb-U5; Wed, 14 Nov 2012 21:57:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYkxC-0000mW-UF
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 21:57:03 +0000
Received: from [85.158.143.35:55277] by server-3.bemta-4.messagelabs.com id
	D0/53-06841-EA314A05; Wed, 14 Nov 2012 21:57:02 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1352930221!12189080!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13161 invoked from network); 14 Nov 2012 21:57:01 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 21:57:01 -0000
X-IronPort-AV: E=Sophos;i="4.83,252,1352073600"; d="scan'208";a="15814937"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 21:57:00 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 14 Nov 2012 21:57:00 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYkxA-0001a9-E1;
	Wed, 14 Nov 2012 21:57:00 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYkxA-0002rT-0O;
	Wed, 14 Nov 2012 21:57:00 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14391-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 14 Nov 2012 21:57:00 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.0-testing test] 14391: trouble: broken/fail/pass
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14391 xen-4.0-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14391/

Failures and problems with tests :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-rhel6hvm-intel  3 host-install(3)       broken REGR. vs. 13719

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 13 guest-localmigrate.2      fail REGR. vs. 13719
 test-amd64-i386-xl-credit2    5 xen-boot                     fail   like 13719

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail never pass
 test-amd64-amd64-xl-sedf     15 guest-stop                   fail   never pass
 test-amd64-amd64-xl          15 guest-stop                   fail   never pass
 test-amd64-i386-xl-multivcpu 15 guest-stop                   fail   never pass
 test-i386-i386-xl            15 guest-stop                   fail   never pass
 test-amd64-i386-xl           15 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  8 guest-saverestore      fail never pass
 test-amd64-i386-xl-win7-amd64  8 guest-saverestore            fail  never pass
 test-amd64-i386-qemuu-rhel6hvm-amd  7 redhat-install           fail never pass
 test-amd64-amd64-xl-win7-amd64  8 guest-saverestore            fail never pass
 test-amd64-i386-qemuu-rhel6hvm-intel  7 redhat-install         fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-rhel6hvm-amd  7 redhat-install               fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1  7 windows-install          fail never pass
 test-i386-i386-xl-winxpsp3    7 windows-install              fail   never pass
 test-i386-i386-xl-win         7 windows-install              fail   never pass
 test-amd64-i386-xl-win-vcpus1  7 windows-install              fail  never pass
 test-amd64-amd64-xl-win       7 windows-install              fail   never pass
 test-amd64-amd64-xl-winxpsp3  7 windows-install              fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  7 windows-install          fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  7 windows-install            fail never pass

version targeted for testing:
 xen                  68d7b9cc8259
baseline version:
 xen                  1d1538beeada

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-i386-xl                                           fail    
 test-i386-i386-xl                                            fail    
 test-amd64-i386-rhel6hvm-amd                                 fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   fail    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               broken  
 test-amd64-i386-qemuu-rhel6hvm-intel                         fail    
 test-amd64-i386-xl-multivcpu                                 fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   21621:68d7b9cc8259
tag:         tip
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Nov 14 11:46:35 2012 +0000
    
    compat/gnttab: Prevent infinite loop in compat code
    
    c/s 20281:95ea2052b41b, which introduces Grant Table version 2
    hypercalls introduces a vulnerability whereby the compat hypercall
    handler can fall into an infinite loop.
    
    If the watchdog is enabled, Xen will die after the timeout.
    
    This is a security problem, XSA-24 / CVE-2012-4539.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    xen-unstable changeset: 26151:b64a7d868f06
    Backport-requested-by: security@xen.org
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   21620:c52d74b254dc
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Nov 14 11:44:46 2012 +0000
    
    xen/mm/shadow: check toplevel pagetables are present before unhooking them.
    
    If the guest has not fully populated its top-level PAE entries when it calls
    HVMOP_pagetable_dying, the shadow code could try to unhook entries from
    MFN 0.  Add a check to avoid that case.
    
    This issue was introduced by c/s 21239:b9d2db109cf5.
    
    This is a security problem, XSA-23 / CVE-2012-4538.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    xen-4.1-testing changeset: 23409:61eb3d030f52
    Backport-requested-by: security@xen.org
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   21619:04462a8c7966
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Nov 14 11:40:51 2012 +0000
    
    x86/physmap: Prevent incorrect updates of m2p mappings
    
    In certain conditions, such as low memory, set_p2m_entry() can fail.
    Currently, the p2m and m2p tables will get out of sync because we still
    update the m2p table after the p2m update has failed.
    
    If that happens, subsequent guest-invoked memory operations can cause
    BUG()s and ASSERT()s to kill Xen.
    
    This is fixed by only updating the m2p table iff the p2m was
    successfully updated.
    
    This is a security problem, XSA-22 / CVE-2012-4537.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   21618:6b9809dc1e86
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Nov 14 11:37:55 2012 +0000
    
    VCPU/timers: Prevent overflow in calculations, leading to DoS vulnerability
    
    The timer action for a vcpu periodic timer is to calculate the next
    expiry time, and to reinsert itself into the timer queue.  If the
    deadline ends up in the past, Xen never leaves __do_softirq().  The
    affected PCPU will stay in an infinite loop until Xen is killed by the
    watchdog (if enabled).
    
    This is a security problem, XSA-20 / CVE-2012-4535.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    xen-unstable changeset: 26148:bf58b94b3cef
    Backport-requested-by: security@xen.org
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   21617:1d1538beeada
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Sep 12 11:18:03 2012 +0100
    
    QEMU_TAG fix to refer to correct tree
    
    
========================================
commit eaa1bd612f50d2f253738ed19e14981e4ede98a5
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date:   Thu Sep 6 17:05:30 2012 +0100

    Disable qemu monitor by default.  The qemu monitor is an overly
    powerful feature which must be protected from untrusted (guest)
    administrators.
    
    Neither xl nor xend expect qemu to produce this monitor unless it is
    explicitly requested.
    
    This is a security problem, XSA-19.  Previously it was CVE-2007-0998
    in Red Hat but we haven't dealt with it in upstream.  We hope to have
    a new CVE for it here but we don't have one yet.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit bacc0d302445c75f18f4c826750fb5853b60e7ca)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 21:57:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 21:57:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYkxD-0000mb-U5; Wed, 14 Nov 2012 21:57:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYkxC-0000mW-UF
	for xen-devel@lists.xensource.com; Wed, 14 Nov 2012 21:57:03 +0000
Received: from [85.158.143.35:55277] by server-3.bemta-4.messagelabs.com id
	D0/53-06841-EA314A05; Wed, 14 Nov 2012 21:57:02 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1352930221!12189080!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13161 invoked from network); 14 Nov 2012 21:57:01 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 21:57:01 -0000
X-IronPort-AV: E=Sophos;i="4.83,252,1352073600"; d="scan'208";a="15814937"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	14 Nov 2012 21:57:00 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 14 Nov 2012 21:57:00 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYkxA-0001a9-E1;
	Wed, 14 Nov 2012 21:57:00 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYkxA-0002rT-0O;
	Wed, 14 Nov 2012 21:57:00 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14391-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 14 Nov 2012 21:57:00 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.0-testing test] 14391: trouble: broken/fail/pass
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14391 xen-4.0-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14391/

Failures and problems with tests :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-rhel6hvm-intel  3 host-install(3)       broken REGR. vs. 13719

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 13 guest-localmigrate.2      fail REGR. vs. 13719
 test-amd64-i386-xl-credit2    5 xen-boot                     fail   like 13719

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail never pass
 test-amd64-amd64-xl-sedf     15 guest-stop                   fail   never pass
 test-amd64-amd64-xl          15 guest-stop                   fail   never pass
 test-amd64-i386-xl-multivcpu 15 guest-stop                   fail   never pass
 test-i386-i386-xl            15 guest-stop                   fail   never pass
 test-amd64-i386-xl           15 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  8 guest-saverestore      fail never pass
 test-amd64-i386-xl-win7-amd64  8 guest-saverestore            fail  never pass
 test-amd64-i386-qemuu-rhel6hvm-amd  7 redhat-install           fail never pass
 test-amd64-amd64-xl-win7-amd64  8 guest-saverestore            fail never pass
 test-amd64-i386-qemuu-rhel6hvm-intel  7 redhat-install         fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-rhel6hvm-amd  7 redhat-install               fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1  7 windows-install          fail never pass
 test-i386-i386-xl-winxpsp3    7 windows-install              fail   never pass
 test-i386-i386-xl-win         7 windows-install              fail   never pass
 test-amd64-i386-xl-win-vcpus1  7 windows-install              fail  never pass
 test-amd64-amd64-xl-win       7 windows-install              fail   never pass
 test-amd64-amd64-xl-winxpsp3  7 windows-install              fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  7 windows-install          fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  7 windows-install            fail never pass

version targeted for testing:
 xen                  68d7b9cc8259
baseline version:
 xen                  1d1538beeada

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-i386-xl                                           fail    
 test-i386-i386-xl                                            fail    
 test-amd64-i386-rhel6hvm-amd                                 fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   fail    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               broken  
 test-amd64-i386-qemuu-rhel6hvm-intel                         fail    
 test-amd64-i386-xl-multivcpu                                 fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   21621:68d7b9cc8259
tag:         tip
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Nov 14 11:46:35 2012 +0000
    
    compat/gnttab: Prevent infinite loop in compat code
    
    c/s 20281:95ea2052b41b, which introduces Grant Table version 2
    hypercalls introduces a vulnerability whereby the compat hypercall
    handler can fall into an infinite loop.
    
    If the watchdog is enabled, Xen will die after the timeout.
    
    This is a security problem, XSA-24 / CVE-2012-4539.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    xen-unstable changeset: 26151:b64a7d868f06
    Backport-requested-by: security@xen.org
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   21620:c52d74b254dc
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Nov 14 11:44:46 2012 +0000
    
    xen/mm/shadow: check toplevel pagetables are present before unhooking them.
    
    If the guest has not fully populated its top-level PAE entries when it calls
    HVMOP_pagetable_dying, the shadow code could try to unhook entries from
    MFN 0.  Add a check to avoid that case.
    
    This issue was introduced by c/s 21239:b9d2db109cf5.
    
    This is a security problem, XSA-23 / CVE-2012-4538.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    xen-4.1-testing changeset: 23409:61eb3d030f52
    Backport-requested-by: security@xen.org
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   21619:04462a8c7966
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Nov 14 11:40:51 2012 +0000
    
    x86/physmap: Prevent incorrect updates of m2p mappings
    
    In certain conditions, such as low memory, set_p2m_entry() can fail.
    Currently, the p2m and m2p tables will get out of sync because we still
    update the m2p table after the p2m update has failed.
    
    If that happens, subsequent guest-invoked memory operations can cause
    BUG()s and ASSERT()s to kill Xen.
    
    This is fixed by only updating the m2p table iff the p2m was
    successfully updated.
    
    This is a security problem, XSA-22 / CVE-2012-4537.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   21618:6b9809dc1e86
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Nov 14 11:37:55 2012 +0000
    
    VCPU/timers: Prevent overflow in calculations, leading to DoS vulnerability
    
    The timer action for a vcpu periodic timer is to calculate the next
    expiry time, and to reinsert itself into the timer queue.  If the
    deadline ends up in the past, Xen never leaves __do_softirq().  The
    affected PCPU will stay in an infinite loop until Xen is killed by the
    watchdog (if enabled).
    
    This is a security problem, XSA-20 / CVE-2012-4535.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    xen-unstable changeset: 26148:bf58b94b3cef
    Backport-requested-by: security@xen.org
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   21617:1d1538beeada
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Sep 12 11:18:03 2012 +0100
    
    QEMU_TAG fix to refer to correct tree
    
    
========================================
commit eaa1bd612f50d2f253738ed19e14981e4ede98a5
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date:   Thu Sep 6 17:05:30 2012 +0100

    Disable qemu monitor by default.  The qemu monitor is an overly
    powerful feature which must be protected from untrusted (guest)
    administrators.
    
    Neither xl nor xend expect qemu to produce this monitor unless it is
    explicitly requested.
    
    This is a security problem, XSA-19.  Previously it was CVE-2007-0998
    in Red Hat but we haven't dealt with it in upstream.  We hope to have
    a new CVE for it here but we don't have one yet.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit bacc0d302445c75f18f4c826750fb5853b60e7ca)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 22:44:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 22:44:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYlh4-00021q-GF; Wed, 14 Nov 2012 22:44:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TYlh3-00021j-LT
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 22:44:25 +0000
Received: from [85.158.143.35:21400] by server-2.bemta-4.messagelabs.com id
	EE/2B-28922-9CE14A05; Wed, 14 Nov 2012 22:44:25 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1352933064!17732506!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7755 invoked from network); 14 Nov 2012 22:44:24 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 22:44:24 -0000
Received: by mail-ee0-f45.google.com with SMTP id d49so741166eek.32
	for <xen-devel@lists.xen.org>; Wed, 14 Nov 2012 14:44:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:subject
	:content-type:content-transfer-encoding;
	bh=EwKU4HO7JdoEf9PHtCzgjYDdGyBLOulIhE36IdCkA+A=;
	b=i3NA6M79KLuBE/rtsk7Bee9sOd8WF51Z1CrCy8csgqu0fNFoaZmse/dMLAx6QNISaR
	WBAWgDno3Nw1Bq3nAGxdtARk909xU5ILunSG8IahJoTcbckMzA6hHT0p30fWSlfs56GV
	QzdYiunEGhYTV+evqiY6XF2Eq4LZsONi9lyrXsPMf74V+1jhUfUXNcGXJe19p5oo0aJf
	RVLpZc1T7YTfm8WCzhn0kMpcCcaWwhBMcy6kKJ6pSIFiPdx7Zn09bTbtHhxa6Ha/BPqJ
	ZdcVaVgv2Fn2MkiCV1j91WbRushXpVxTSiKmrdh5pJVtfQOAa25GIITZUAO7tj+kZuxB
	pATA==
Received: by 10.14.220.71 with SMTP id n47mr91524212eep.26.1352933064402;
	Wed, 14 Nov 2012 14:44:24 -0800 (PST)
Received: from [192.168.228.100] ([188.25.211.36])
	by mx.google.com with ESMTPS id a44sm32370825eeo.7.2012.11.14.14.44.23
	(version=SSLv3 cipher=OTHER); Wed, 14 Nov 2012 14:44:23 -0800 (PST)
Message-ID: <50A41EC6.7010106@gmail.com>
Date: Thu, 15 Nov 2012 00:44:22 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.10) Gecko/20121106 Thunderbird/10.0.10
MIME-Version: 1.0
To: xen-devel@lists.xen.org
Subject: [Xen-devel] Hypervisor <-> dom0 userspace event channel
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

if the goal is establishing an event channel between the Xen HV and a
custom dom0 userspace application,

1. for the hypervisor code, would you recommend using the EVTCHNOP_*
hypercalls from xen/include/public/event_channel.h directly, or the
friendlier xen/include/xen/event.h functions? And for the userspace
tool, I'd use the xenctrl.h xc_evtchn_*() functions, correct?

2. what would be the best way of exposing the hypervisor event channel
port received from alloc_unbound_xen_event_channel() to the dom0
userspace application? Put it somewhere in the shared info page? I'm
assuming the XenStore is out of the question for this purpose, and
otherwise overkill.

3. what is the best way (most efficient, and Xen-friendly way) of
exposing HV data such as event channel ports or shared page mfns/pfns to
a custom dom0 userspace application?

Thanks,
Razvan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 22:44:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 22:44:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYlh4-00021q-GF; Wed, 14 Nov 2012 22:44:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TYlh3-00021j-LT
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 22:44:25 +0000
Received: from [85.158.143.35:21400] by server-2.bemta-4.messagelabs.com id
	EE/2B-28922-9CE14A05; Wed, 14 Nov 2012 22:44:25 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1352933064!17732506!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7755 invoked from network); 14 Nov 2012 22:44:24 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	14 Nov 2012 22:44:24 -0000
Received: by mail-ee0-f45.google.com with SMTP id d49so741166eek.32
	for <xen-devel@lists.xen.org>; Wed, 14 Nov 2012 14:44:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:subject
	:content-type:content-transfer-encoding;
	bh=EwKU4HO7JdoEf9PHtCzgjYDdGyBLOulIhE36IdCkA+A=;
	b=i3NA6M79KLuBE/rtsk7Bee9sOd8WF51Z1CrCy8csgqu0fNFoaZmse/dMLAx6QNISaR
	WBAWgDno3Nw1Bq3nAGxdtARk909xU5ILunSG8IahJoTcbckMzA6hHT0p30fWSlfs56GV
	QzdYiunEGhYTV+evqiY6XF2Eq4LZsONi9lyrXsPMf74V+1jhUfUXNcGXJe19p5oo0aJf
	RVLpZc1T7YTfm8WCzhn0kMpcCcaWwhBMcy6kKJ6pSIFiPdx7Zn09bTbtHhxa6Ha/BPqJ
	ZdcVaVgv2Fn2MkiCV1j91WbRushXpVxTSiKmrdh5pJVtfQOAa25GIITZUAO7tj+kZuxB
	pATA==
Received: by 10.14.220.71 with SMTP id n47mr91524212eep.26.1352933064402;
	Wed, 14 Nov 2012 14:44:24 -0800 (PST)
Received: from [192.168.228.100] ([188.25.211.36])
	by mx.google.com with ESMTPS id a44sm32370825eeo.7.2012.11.14.14.44.23
	(version=SSLv3 cipher=OTHER); Wed, 14 Nov 2012 14:44:23 -0800 (PST)
Message-ID: <50A41EC6.7010106@gmail.com>
Date: Thu, 15 Nov 2012 00:44:22 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.10) Gecko/20121106 Thunderbird/10.0.10
MIME-Version: 1.0
To: xen-devel@lists.xen.org
Subject: [Xen-devel] Hypervisor <-> dom0 userspace event channel
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

if the goal is establishing an event channel between the Xen HV and a
custom dom0 userspace application,

1. for the hypervisor code, would you recommend using the EVTCHNOP_*
hypercalls from xen/include/public/event_channel.h directly, or the
friendlier xen/include/xen/event.h functions? And for the userspace
tool, I'd use the xenctrl.h xc_evtchn_*() functions, correct?

2. what would be the best way of exposing the hypervisor event channel
port received from alloc_unbound_xen_event_channel() to the dom0
userspace application? Put it somewhere in the shared info page? I'm
assuming the XenStore is out of the question for this purpose, and
otherwise overkill.

3. what is the best way (most efficient, and Xen-friendly way) of
exposing HV data such as event channel ports or shared page mfns/pfns to
a custom dom0 userspace application?

Thanks,
Razvan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 14 23:56:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 23:56:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYmoI-0003Mj-7B; Wed, 14 Nov 2012 23:55:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TYmoG-0003Me-U1
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 23:55:57 +0000
Received: from [85.158.143.35:53005] by server-3.bemta-4.messagelabs.com id
	6A/B3-06841-C8F24A05; Wed, 14 Nov 2012 23:55:56 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1352937354!15936228!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTQwMTg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31251 invoked from network); 14 Nov 2012 23:55:55 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 23:55:55 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAENtqrt023956
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 23:55:52 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAENtoRa000617
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Nov 2012 23:55:51 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAENtoTq028202; Wed, 14 Nov 2012 17:55:50 -0600
MIME-Version: 1.0
Message-ID: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
Date: Wed, 14 Nov 2012 15:55:45 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__1352937350095136424abhmt108.oracle.com"
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of existing)
	hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__1352937350095136424abhmt108.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This is a second cut of the hypervisor patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account
feedback from Jan and Keir, plus some fixes found via runtime
debugging (using privcmd only) and some comments/cleanup.

v1->v2:
- Add reset-to-zero page claim in domain_kill [JBeulich]
- Proper handling of struct passed to hypercall [JBeulich]
- Fix alloc_heap_pages when a domain has a claim [JBeulich]
- Need not hold heap_lock if !d->unclaimed_pages [keir]
- Fix missed tot_pages call in donate_page [djm]
- Remove domain_reset_unclaimed_pages; use set with zero [djm]
- Bugfixes found through testing in set_unclaimed [djm]
- More comments in code [djm]
- Code formatting fixes [djm]

=3D=3D=3D

Motivation:

The goal of this hypercall
is to attempt to atomically and very quickly determine if
there are sufficient pages available in the system and, if
so, "set aside" that quantity of pages for future allocations
by that domain.  Unlike an existing hypercall such as
increase_reservation or populate_physmap, specific physical
pageframes are not assigned to the domain because this
cannot be done sufficiently quickly (especially for very large
allocations in an arbitrarily fragmented system) and so the
existing mechanisms result in classic time-of-check-time-of-use
(TOCTOU) races.  One can think of claiming as similar to a
"lazy" allocation, but subsequent hypercalls are required
to do the actual physical pageframe allocation.

I don't have a patch for the toolstack side, but I envision
a "xl create --claim" option to maximize backwards
compatibility while minimizing impact on existing toolstacks.
As a result, testing has (so far) only been done via privcmd.

Code overview:

Though the hypercall simply does arithmetic within locks,
some of the semantics in the code may be a bit subtle
so let me explain a bit.

The key variables (d->unclaimed_pages and total_unclaimed_pages)
start at zero if no claim has yet been staked for any domain.
(Perhaps a better name is "claimed_but_not_yet_possessed" but that's
a bit unwieldy.)  If no claim hypercalls are executed, there
should be no impact on existing usage.

When a claim is successfully staked by a domain, it is like a
watermark but there is no record kept of the size of the claim.
Instead, d->unclaimed_pages is set to the difference between
d->tot_pages and the claim (d->tot_pages may normally be zero
but see Note 1).  When d->tot_pages increases or decreases,
d->unclaimed_pages atomically decreases or increases.  Once
d->unclaimed_pages reaches zero, the claim is satisfied and
d->unclaimed pages stays at zero -- unless a new claim is
subsequently staked.  See Note 2.

The systemwide variable total_unclaimed_pages is always the sum
of d->unclaimed_pages, across all domains.  A non-domain-
specific heap allocation will fail if total_unclaimed_pages
exceeds free (plus, on tmem enabled systems, freeable) pages.

Claim semantics may be modified by flags.  The initial
implementation has one flag, which discerns whether the
caller would like tmem freeable pages to be considered
in determining whether or not the claim can be successfully
staked. Future flags may, for example, specify that the
caller would like the claim to be successful only if there
are sufficient pages available on a single node (per Dario's
suggestion).

Note 1: Tim: I'm thinking this may resolve your concern that
the claim mechanism must be more complicated to handle
restricted memory allocations and order>0 allocations.
The proposed claim mechanism only guarantees a quantity of
order=3D=3D0 pages; if restricted allocations are required, these
are done first by the toolstack, and followed by the claim.
Order>0 allocations still work if memory is not fragmented,
but the claim mechanism doesn't guarantee anything but
a quantity of order=3D=3D0 pages.

Note 2: Tim: This arithmetic also indirectly implements the
"claim auto-expire" discussed earlier.  We certainly don't
want a negative claim.  It's possible that the toolstack need
never call "unclaim" (and so such a hypercall/subop need
not even exist) as long as domain_reset_unclaimed_pages()
is called when a domain dies.  This draft doesn't even
provide unclaim... though if a reason for its existence
is determined, it should be easy to add.

Note 3: There is currently no way to observe a staked claim,
so a staked claim will not survive a save/restore/migrate.
Not clear yet if this is needed but could be added.

Thanks for any feedback!

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com

 arch/x86/mm.c             |    2=20
 arch/x86/mm/mem_sharing.c |    4 -
 common/domain.c           |    1=20
 common/grant_table.c      |    2=20
 common/memory.c           |   31 ++++++++++++-
 common/page_alloc.c       |  107 +++++++++++++++++++++++++++++++++++++++++=
++++-
 include/public/memory.h   |   31 +++++++++++++
 include/xen/mm.h          |    6 ++
 include/xen/sched.h       |    1=20
 9 files changed, 178 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fad3d33..7e55908 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3841,7 +3841,7 @@ int donate_page(
     {
         if ( d->tot_pages >=3D d->max_pages )
             goto fail;
-        d->tot_pages++;
+        domain_increase_tot_pages(d, 1);
     }
=20
     page->count_info =3D PGC_allocated | 1;
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..943a3b5 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d,
     }
=20
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_decrease_tot_pages(d, 1);
     drop_dom_ref =3D (d->tot_pages =3D=3D 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct p=
age_info *page)
     ASSERT(page_get_owner(page) =3D=3D dom_cow);
     page_set_owner(page, d);
=20
-    if ( d->tot_pages++ =3D=3D 0 )
+    if ( domain_increase_tot_pages(d, 1) =3D=3D 0 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0e3e36a..95509e2 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -492,6 +492,7 @@ int domain_kill(struct domain *d)
         evtchn_destroy(d);
         gnttab_release_mappings(d);
         tmem_destroy(d->tmem);
+        domain_set_unclaimed_pages(d, 0, 0);
         d->tmem =3D NULL;
         /* fallthrough */
     case DOMDYING_dying:
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..10ce78f 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1656,7 +1656,7 @@ gnttab_transfer(
         }
=20
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ =3D=3D 0) )
+        if ( unlikely(domain_increase_tot_pages(e, 1) =3D=3D 0) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..38f2cb9 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_=
memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
=20
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -=3D dec_count;
+                domain_decrease_tot_pages(d, dec_count);
                 drop_dom_ref =3D (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
=20
@@ -685,6 +685,35 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_=
PARAM(void) arg)
         break;
     }
=20
+    case XENMEM_claim_pages:
+    {
+        unsigned long request;
+
+        start_extent =3D cmd >> MEMOP_EXTENT_SHIFT;
+
+        if ( copy_from_guest(&reservation, arg, 1) )
+            return start_extent;
+
+        if ( !(guest_handle_is_null(reservation.extent_start)) )
+            return start_extent;
+
+        rc =3D rcu_lock_target_domain_by_id(reservation.domid, &d);
+        if ( rc )
+            return rc;
+
+        /*
+         * extent_order may be non-zero, but is only a multiplier and
+         * does not currently claim any order>0 slabs, though this is
+         * a possible future feature
+         */
+        request =3D reservation.nr_extents << reservation.extent_order;
+        rc =3D domain_set_unclaimed_pages(d, request, reservation.mem_flag=
s);
+
+        rcu_unlock_domain(d);
+
+        break;
+    }
+
     default:
         rc =3D arch_memory_op(op, arg);
         break;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 15ebc66..178d816 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -238,6 +238,100 @@ static long midsize_alloc_zone_pages;
 #define MIDSIZE_ALLOC_FRAC 128
=20
 static DEFINE_SPINLOCK(heap_lock);
+static long total_unclaimed_pages; /* total outstanding claims by all doma=
ins */
+
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
+
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    ASSERT(!spin_is_locked(&heap_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages +=3D pages;
+    spin_lock(&heap_lock);
+    dom_before =3D d->unclaimed_pages;
+    dom_after =3D dom_before - pages;
+    if ( (dom_before > 0) && (dom_after < 0) )
+        dom_claimed =3D 0;
+    else
+        dom_claimed =3D dom_after;
+    sys_before =3D total_unclaimed_pages;
+    sys_after =3D sys_before - (dom_before - dom_claimed);
+    BUG_ON( (sys_before > 0) && (sys_after < 0) );
+    total_unclaimed_pages =3D sys_after;
+    d->unclaimed_pages =3D dom_claimed;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    ASSERT(!spin_is_locked(&heap_lock));
+    spin_lock(&heap_lock);
+    d->tot_pages -=3D pages;
+    if ( d->unclaimed_pages )
+    {
+        d->unclaimed_pages +=3D pages;
+        total_unclaimed_pages +=3D pages;
+    }
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
+                                unsigned long flags)
+{
+    int ret =3D -ENOMEM;
+    unsigned long claim =3D 0, avail_pages =3D 0;
+
+    /*
+     * take the domain's page_alloc_lock, else all increases/decreases
+     * must always take the global heap_lock rather than only in the much
+     * rarer case that d->unclaimed_pages is non-zero
+     */
+    ASSERT(!spin_is_locked(&d->page_alloc_lock));
+    spin_lock(&d->page_alloc_lock);
+    ASSERT(!spin_is_locked(&heap_lock));
+    spin_lock(&heap_lock);
+
+    /* pages=3D=3D0 means "unset" the claim (and flags is ignored) */
+    if (pages =3D=3D 0)
+    {
+        total_unclaimed_pages -=3D d->unclaimed_pages;
+        d->unclaimed_pages =3D 0;
+        ret =3D 0;
+        goto out;
+    }
+
+    /* only one active claim per domain please */
+    if ( d->unclaimed_pages)
+        goto out;
+
+    /* how much memory is available? */
+    avail_pages =3D total_avail_pages;
+    if ( !(flags & XENMEM_CLAIMF_free_only) )
+        avail_pages +=3D tmem_freeable_pages();
+    avail_pages -=3D total_unclaimed_pages;
+
+    /*
+     * note, if domain has already allocated memory before making a claim=
=20
+     * then the claim must take tot_pages into account
+     */
+    claim =3D pages - d->tot_pages;
+    if ( claim > avail_pages )
+        goto out;
+
+    /* yay, claim fits in available memory, stake the claim, success! */
+    d->unclaimed_pages =3D claim;
+    total_unclaimed_pages +=3D d->unclaimed_pages;
+    ret =3D 0;
+
+out:
+    spin_unlock(&heap_lock);
+    spin_unlock(&d->page_alloc_lock);
+    return ret;
+}
=20
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
@@ -443,6 +537,15 @@ static struct page_info *alloc_heap_pages(
     spin_lock(&heap_lock);
=20
     /*
+     * Claimed memory is considered unavailable unless the request
+     * is made by a domain with sufficient unclaimed pages.
+     */
+    if ( (total_unclaimed_pages + request >
+           total_avail_pages + tmem_freeable_pages()) &&
+          (d =3D=3D NULL || d->unclaimed_pages < request) )
+        goto not_found;
+
+    /*
      * TMEM: When available memory is scarce due to tmem absorbing it, all=
ow
      * only mid-size allocations to avoid worst of fragmentation issues.
      * Others try tmem pools then fail.  This is a workaround until all
@@ -1291,7 +1394,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages =3D=3D 0) )
             get_knownalive_domain(d);
=20
-        d->tot_pages +=3D 1 << order;
+        domain_increase_tot_pages(d, 1 << order);
     }
=20
     for ( i =3D 0; i < (1 << order); i++ )
@@ -1375,7 +1478,7 @@ void free_domheap_pages(struct page_info *pg, unsigne=
d int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
=20
-        d->tot_pages -=3D 1 << order;
+        domain_decrease_tot_pages(d, 1 << order);
         drop_dom_ref =3D (d->tot_pages =3D=3D 0);
=20
         spin_unlock_recursive(&d->page_alloc_lock);
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index f1ddbc0..c4de5c1 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -68,6 +68,8 @@ struct xen_memory_reservation {
      *   IN:  GPFN bases of extents to populate with memory
      *   OUT: GMFN bases of extents that were allocated
      *   (NB. This command also updates the mach_to_phys translation table=
)
+     * XENMEM_claim_pages:
+     *   IN: must be zero
      */
     XEN_GUEST_HANDLE(xen_pfn_t) extent_start;
=20
@@ -421,6 +423,35 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
=20
+/*
+ * Attempt to stake a claim for a domain on a quantity of pages
+ * of system RAM, but _not_ assign specific pageframes.  Only
+ * arithmetic is performed so the hypercall is very fast and need
+ * not be preemptible, thus sidestepping time-of-check-time-of-use
+ * races for memory allocation.  Returns 0 if the hypervisor page
+ * allocator has atomically and successfully claimed the requested
+ * number of pages, else non-zero.
+ *
+ * Any domain may have only one active claim.  When sufficient memory
+ * has been allocated to resolve the claim, the claim silently expires.
+ * Claiming zero pages effectively resets any outstanding claim and
+ * is always successful.
+ *
+ * Note that a valid claim may be staked even after memory has been
+ * allocated for a domain.  In this case, the claim is not incremental,
+ * i.e. if the domain's tot_pages is 3, and a claim is staked for 10,
+ * only 7 additional pages are claimed.
+ */
+#define XENMEM_claim_pages                  24
+/*
+ * XENMEM_claim_pages flags:
+ *  free_only: claim is successful only if sufficient free pages
+ *    are available.  If not set and tmem is enabled, hypervisor
+ *    may also consider tmem "freeable" pages to satisfy the claim.
+ */
+#define _XENMEM_CLAIMF_free_only            0
+#define XENMEM_CLAIMF_free_only             (1U<<_XENMEM_CLAIMF_free_only)
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
=20
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 64a0cc1..5c63581 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,12 @@ void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
=20
+/* Claim handling */
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges);
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges);
+int domain_set_unclaimed_pages(
+    struct domain *d, unsigned long pages, unsigned long flags);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..480ef39 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -242,6 +242,7 @@ struct domain
     struct page_list_head page_list;  /* linked list */
     struct page_list_head xenpage_list; /* linked list (size xenheap_pages=
) */
     unsigned int     tot_pages;       /* number of pages currently possese=
d */
+    unsigned int     unclaimed_pages; /* pages claimed but not possessed  =
  */
     unsigned int     max_pages;       /* maximum value for tot_pages      =
  */
     atomic_t         shr_pages;       /* number of shared pages           =
  */
     atomic_t         paged_pages;     /* number of paged-out pages        =
  */

--__1352937350095136424abhmt108.oracle.com
Content-Type: application/octet-stream; name="claim-121114.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="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4vc2NoZWQuaAppbmRleCA2YzU1
MDM5Li40ODBlZjM5IDEwMDY0NAotLS0gYS94ZW4vaW5jbHVkZS94ZW4vc2NoZWQuaAorKysgYi94
ZW4vaW5jbHVkZS94ZW4vc2NoZWQuaApAQCAtMjQyLDYgKzI0Miw3IEBAIHN0cnVjdCBkb21haW4K
ICAgICBzdHJ1Y3QgcGFnZV9saXN0X2hlYWQgcGFnZV9saXN0OyAgLyogbGlua2VkIGxpc3QgKi8K
ICAgICBzdHJ1Y3QgcGFnZV9saXN0X2hlYWQgeGVucGFnZV9saXN0OyAvKiBsaW5rZWQgbGlzdCAo
c2l6ZSB4ZW5oZWFwX3BhZ2VzKSAqLwogICAgIHVuc2lnbmVkIGludCAgICAgdG90X3BhZ2VzOyAg
ICAgICAvKiBudW1iZXIgb2YgcGFnZXMgY3VycmVudGx5IHBvc3Nlc2VkICovCisgICAgdW5zaWdu
ZWQgaW50ICAgICB1bmNsYWltZWRfcGFnZXM7IC8qIHBhZ2VzIGNsYWltZWQgYnV0IG5vdCBwb3Nz
ZXNzZWQgICAgKi8KICAgICB1bnNpZ25lZCBpbnQgICAgIG1heF9wYWdlczsgICAgICAgLyogbWF4
aW11bSB2YWx1ZSBmb3IgdG90X3BhZ2VzICAgICAgICAqLwogICAgIGF0b21pY190ICAgICAgICAg
c2hyX3BhZ2VzOyAgICAgICAvKiBudW1iZXIgb2Ygc2hhcmVkIHBhZ2VzICAgICAgICAgICAgICov
CiAgICAgYXRvbWljX3QgICAgICAgICBwYWdlZF9wYWdlczsgICAgIC8qIG51bWJlciBvZiBwYWdl
ZC1vdXQgcGFnZXMgICAgICAgICAgKi8K
--__1352937350095136424abhmt108.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__1352937350095136424abhmt108.oracle.com--


From xen-devel-bounces@lists.xen.org Wed Nov 14 23:56:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Nov 2012 23:56:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYmoI-0003Mj-7B; Wed, 14 Nov 2012 23:55:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TYmoG-0003Me-U1
	for xen-devel@lists.xen.org; Wed, 14 Nov 2012 23:55:57 +0000
Received: from [85.158.143.35:53005] by server-3.bemta-4.messagelabs.com id
	6A/B3-06841-C8F24A05; Wed, 14 Nov 2012 23:55:56 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1352937354!15936228!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTQwMTg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31251 invoked from network); 14 Nov 2012 23:55:55 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Nov 2012 23:55:55 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAENtqrt023956
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 14 Nov 2012 23:55:52 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAENtoRa000617
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 14 Nov 2012 23:55:51 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAENtoTq028202; Wed, 14 Nov 2012 17:55:50 -0600
MIME-Version: 1.0
Message-ID: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
Date: Wed, 14 Nov 2012 15:55:45 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__1352937350095136424abhmt108.oracle.com"
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of existing)
	hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__1352937350095136424abhmt108.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This is a second cut of the hypervisor patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account
feedback from Jan and Keir, plus some fixes found via runtime
debugging (using privcmd only) and some comments/cleanup.

v1->v2:
- Add reset-to-zero page claim in domain_kill [JBeulich]
- Proper handling of struct passed to hypercall [JBeulich]
- Fix alloc_heap_pages when a domain has a claim [JBeulich]
- Need not hold heap_lock if !d->unclaimed_pages [keir]
- Fix missed tot_pages call in donate_page [djm]
- Remove domain_reset_unclaimed_pages; use set with zero [djm]
- Bugfixes found through testing in set_unclaimed [djm]
- More comments in code [djm]
- Code formatting fixes [djm]

=3D=3D=3D

Motivation:

The goal of this hypercall
is to attempt to atomically and very quickly determine if
there are sufficient pages available in the system and, if
so, "set aside" that quantity of pages for future allocations
by that domain.  Unlike an existing hypercall such as
increase_reservation or populate_physmap, specific physical
pageframes are not assigned to the domain because this
cannot be done sufficiently quickly (especially for very large
allocations in an arbitrarily fragmented system) and so the
existing mechanisms result in classic time-of-check-time-of-use
(TOCTOU) races.  One can think of claiming as similar to a
"lazy" allocation, but subsequent hypercalls are required
to do the actual physical pageframe allocation.

I don't have a patch for the toolstack side, but I envision
a "xl create --claim" option to maximize backwards
compatibility while minimizing impact on existing toolstacks.
As a result, testing has (so far) only been done via privcmd.

Code overview:

Though the hypercall simply does arithmetic within locks,
some of the semantics in the code may be a bit subtle
so let me explain a bit.

The key variables (d->unclaimed_pages and total_unclaimed_pages)
start at zero if no claim has yet been staked for any domain.
(Perhaps a better name is "claimed_but_not_yet_possessed" but that's
a bit unwieldy.)  If no claim hypercalls are executed, there
should be no impact on existing usage.

When a claim is successfully staked by a domain, it is like a
watermark but there is no record kept of the size of the claim.
Instead, d->unclaimed_pages is set to the difference between
d->tot_pages and the claim (d->tot_pages may normally be zero
but see Note 1).  When d->tot_pages increases or decreases,
d->unclaimed_pages atomically decreases or increases.  Once
d->unclaimed_pages reaches zero, the claim is satisfied and
d->unclaimed pages stays at zero -- unless a new claim is
subsequently staked.  See Note 2.

The systemwide variable total_unclaimed_pages is always the sum
of d->unclaimed_pages, across all domains.  A non-domain-
specific heap allocation will fail if total_unclaimed_pages
exceeds free (plus, on tmem enabled systems, freeable) pages.

Claim semantics may be modified by flags.  The initial
implementation has one flag, which discerns whether the
caller would like tmem freeable pages to be considered
in determining whether or not the claim can be successfully
staked. Future flags may, for example, specify that the
caller would like the claim to be successful only if there
are sufficient pages available on a single node (per Dario's
suggestion).

Note 1: Tim: I'm thinking this may resolve your concern that
the claim mechanism must be more complicated to handle
restricted memory allocations and order>0 allocations.
The proposed claim mechanism only guarantees a quantity of
order=3D=3D0 pages; if restricted allocations are required, these
are done first by the toolstack, and followed by the claim.
Order>0 allocations still work if memory is not fragmented,
but the claim mechanism doesn't guarantee anything but
a quantity of order=3D=3D0 pages.

Note 2: Tim: This arithmetic also indirectly implements the
"claim auto-expire" discussed earlier.  We certainly don't
want a negative claim.  It's possible that the toolstack need
never call "unclaim" (and so such a hypercall/subop need
not even exist) as long as domain_reset_unclaimed_pages()
is called when a domain dies.  This draft doesn't even
provide unclaim... though if a reason for its existence
is determined, it should be easy to add.

Note 3: There is currently no way to observe a staked claim,
so a staked claim will not survive a save/restore/migrate.
Not clear yet if this is needed but could be added.

Thanks for any feedback!

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com

 arch/x86/mm.c             |    2=20
 arch/x86/mm/mem_sharing.c |    4 -
 common/domain.c           |    1=20
 common/grant_table.c      |    2=20
 common/memory.c           |   31 ++++++++++++-
 common/page_alloc.c       |  107 +++++++++++++++++++++++++++++++++++++++++=
++++-
 include/public/memory.h   |   31 +++++++++++++
 include/xen/mm.h          |    6 ++
 include/xen/sched.h       |    1=20
 9 files changed, 178 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fad3d33..7e55908 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3841,7 +3841,7 @@ int donate_page(
     {
         if ( d->tot_pages >=3D d->max_pages )
             goto fail;
-        d->tot_pages++;
+        domain_increase_tot_pages(d, 1);
     }
=20
     page->count_info =3D PGC_allocated | 1;
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..943a3b5 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d,
     }
=20
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_decrease_tot_pages(d, 1);
     drop_dom_ref =3D (d->tot_pages =3D=3D 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct p=
age_info *page)
     ASSERT(page_get_owner(page) =3D=3D dom_cow);
     page_set_owner(page, d);
=20
-    if ( d->tot_pages++ =3D=3D 0 )
+    if ( domain_increase_tot_pages(d, 1) =3D=3D 0 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0e3e36a..95509e2 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -492,6 +492,7 @@ int domain_kill(struct domain *d)
         evtchn_destroy(d);
         gnttab_release_mappings(d);
         tmem_destroy(d->tmem);
+        domain_set_unclaimed_pages(d, 0, 0);
         d->tmem =3D NULL;
         /* fallthrough */
     case DOMDYING_dying:
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..10ce78f 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1656,7 +1656,7 @@ gnttab_transfer(
         }
=20
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ =3D=3D 0) )
+        if ( unlikely(domain_increase_tot_pages(e, 1) =3D=3D 0) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..38f2cb9 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_=
memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
=20
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -=3D dec_count;
+                domain_decrease_tot_pages(d, dec_count);
                 drop_dom_ref =3D (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
=20
@@ -685,6 +685,35 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_=
PARAM(void) arg)
         break;
     }
=20
+    case XENMEM_claim_pages:
+    {
+        unsigned long request;
+
+        start_extent =3D cmd >> MEMOP_EXTENT_SHIFT;
+
+        if ( copy_from_guest(&reservation, arg, 1) )
+            return start_extent;
+
+        if ( !(guest_handle_is_null(reservation.extent_start)) )
+            return start_extent;
+
+        rc =3D rcu_lock_target_domain_by_id(reservation.domid, &d);
+        if ( rc )
+            return rc;
+
+        /*
+         * extent_order may be non-zero, but is only a multiplier and
+         * does not currently claim any order>0 slabs, though this is
+         * a possible future feature
+         */
+        request =3D reservation.nr_extents << reservation.extent_order;
+        rc =3D domain_set_unclaimed_pages(d, request, reservation.mem_flag=
s);
+
+        rcu_unlock_domain(d);
+
+        break;
+    }
+
     default:
         rc =3D arch_memory_op(op, arg);
         break;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 15ebc66..178d816 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -238,6 +238,100 @@ static long midsize_alloc_zone_pages;
 #define MIDSIZE_ALLOC_FRAC 128
=20
 static DEFINE_SPINLOCK(heap_lock);
+static long total_unclaimed_pages; /* total outstanding claims by all doma=
ins */
+
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
+
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    ASSERT(!spin_is_locked(&heap_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages +=3D pages;
+    spin_lock(&heap_lock);
+    dom_before =3D d->unclaimed_pages;
+    dom_after =3D dom_before - pages;
+    if ( (dom_before > 0) && (dom_after < 0) )
+        dom_claimed =3D 0;
+    else
+        dom_claimed =3D dom_after;
+    sys_before =3D total_unclaimed_pages;
+    sys_after =3D sys_before - (dom_before - dom_claimed);
+    BUG_ON( (sys_before > 0) && (sys_after < 0) );
+    total_unclaimed_pages =3D sys_after;
+    d->unclaimed_pages =3D dom_claimed;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    ASSERT(!spin_is_locked(&heap_lock));
+    spin_lock(&heap_lock);
+    d->tot_pages -=3D pages;
+    if ( d->unclaimed_pages )
+    {
+        d->unclaimed_pages +=3D pages;
+        total_unclaimed_pages +=3D pages;
+    }
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
+                                unsigned long flags)
+{
+    int ret =3D -ENOMEM;
+    unsigned long claim =3D 0, avail_pages =3D 0;
+
+    /*
+     * take the domain's page_alloc_lock, else all increases/decreases
+     * must always take the global heap_lock rather than only in the much
+     * rarer case that d->unclaimed_pages is non-zero
+     */
+    ASSERT(!spin_is_locked(&d->page_alloc_lock));
+    spin_lock(&d->page_alloc_lock);
+    ASSERT(!spin_is_locked(&heap_lock));
+    spin_lock(&heap_lock);
+
+    /* pages=3D=3D0 means "unset" the claim (and flags is ignored) */
+    if (pages =3D=3D 0)
+    {
+        total_unclaimed_pages -=3D d->unclaimed_pages;
+        d->unclaimed_pages =3D 0;
+        ret =3D 0;
+        goto out;
+    }
+
+    /* only one active claim per domain please */
+    if ( d->unclaimed_pages)
+        goto out;
+
+    /* how much memory is available? */
+    avail_pages =3D total_avail_pages;
+    if ( !(flags & XENMEM_CLAIMF_free_only) )
+        avail_pages +=3D tmem_freeable_pages();
+    avail_pages -=3D total_unclaimed_pages;
+
+    /*
+     * note, if domain has already allocated memory before making a claim=
=20
+     * then the claim must take tot_pages into account
+     */
+    claim =3D pages - d->tot_pages;
+    if ( claim > avail_pages )
+        goto out;
+
+    /* yay, claim fits in available memory, stake the claim, success! */
+    d->unclaimed_pages =3D claim;
+    total_unclaimed_pages +=3D d->unclaimed_pages;
+    ret =3D 0;
+
+out:
+    spin_unlock(&heap_lock);
+    spin_unlock(&d->page_alloc_lock);
+    return ret;
+}
=20
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
@@ -443,6 +537,15 @@ static struct page_info *alloc_heap_pages(
     spin_lock(&heap_lock);
=20
     /*
+     * Claimed memory is considered unavailable unless the request
+     * is made by a domain with sufficient unclaimed pages.
+     */
+    if ( (total_unclaimed_pages + request >
+           total_avail_pages + tmem_freeable_pages()) &&
+          (d =3D=3D NULL || d->unclaimed_pages < request) )
+        goto not_found;
+
+    /*
      * TMEM: When available memory is scarce due to tmem absorbing it, all=
ow
      * only mid-size allocations to avoid worst of fragmentation issues.
      * Others try tmem pools then fail.  This is a workaround until all
@@ -1291,7 +1394,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages =3D=3D 0) )
             get_knownalive_domain(d);
=20
-        d->tot_pages +=3D 1 << order;
+        domain_increase_tot_pages(d, 1 << order);
     }
=20
     for ( i =3D 0; i < (1 << order); i++ )
@@ -1375,7 +1478,7 @@ void free_domheap_pages(struct page_info *pg, unsigne=
d int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
=20
-        d->tot_pages -=3D 1 << order;
+        domain_decrease_tot_pages(d, 1 << order);
         drop_dom_ref =3D (d->tot_pages =3D=3D 0);
=20
         spin_unlock_recursive(&d->page_alloc_lock);
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index f1ddbc0..c4de5c1 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -68,6 +68,8 @@ struct xen_memory_reservation {
      *   IN:  GPFN bases of extents to populate with memory
      *   OUT: GMFN bases of extents that were allocated
      *   (NB. This command also updates the mach_to_phys translation table=
)
+     * XENMEM_claim_pages:
+     *   IN: must be zero
      */
     XEN_GUEST_HANDLE(xen_pfn_t) extent_start;
=20
@@ -421,6 +423,35 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
=20
+/*
+ * Attempt to stake a claim for a domain on a quantity of pages
+ * of system RAM, but _not_ assign specific pageframes.  Only
+ * arithmetic is performed so the hypercall is very fast and need
+ * not be preemptible, thus sidestepping time-of-check-time-of-use
+ * races for memory allocation.  Returns 0 if the hypervisor page
+ * allocator has atomically and successfully claimed the requested
+ * number of pages, else non-zero.
+ *
+ * Any domain may have only one active claim.  When sufficient memory
+ * has been allocated to resolve the claim, the claim silently expires.
+ * Claiming zero pages effectively resets any outstanding claim and
+ * is always successful.
+ *
+ * Note that a valid claim may be staked even after memory has been
+ * allocated for a domain.  In this case, the claim is not incremental,
+ * i.e. if the domain's tot_pages is 3, and a claim is staked for 10,
+ * only 7 additional pages are claimed.
+ */
+#define XENMEM_claim_pages                  24
+/*
+ * XENMEM_claim_pages flags:
+ *  free_only: claim is successful only if sufficient free pages
+ *    are available.  If not set and tmem is enabled, hypervisor
+ *    may also consider tmem "freeable" pages to satisfy the claim.
+ */
+#define _XENMEM_CLAIMF_free_only            0
+#define XENMEM_CLAIMF_free_only             (1U<<_XENMEM_CLAIMF_free_only)
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
=20
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 64a0cc1..5c63581 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,12 @@ void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
=20
+/* Claim handling */
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges);
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges);
+int domain_set_unclaimed_pages(
+    struct domain *d, unsigned long pages, unsigned long flags);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..480ef39 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -242,6 +242,7 @@ struct domain
     struct page_list_head page_list;  /* linked list */
     struct page_list_head xenpage_list; /* linked list (size xenheap_pages=
) */
     unsigned int     tot_pages;       /* number of pages currently possese=
d */
+    unsigned int     unclaimed_pages; /* pages claimed but not possessed  =
  */
     unsigned int     max_pages;       /* maximum value for tot_pages      =
  */
     atomic_t         shr_pages;       /* number of shared pages           =
  */
     atomic_t         paged_pages;     /* number of paged-out pages        =
  */

--__1352937350095136424abhmt108.oracle.com
Content-Type: application/octet-stream; name="claim-121114.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-121114.patch"

ZGlmZiAtLWdpdCBhL3hlbi9hcmNoL3g4Ni9tbS5jIGIveGVuL2FyY2gveDg2L21tLmMKaW5kZXgg
ZmFkM2QzMy4uN2U1NTkwOCAxMDA2NDQKLS0tIGEveGVuL2FyY2gveDg2L21tLmMKKysrIGIveGVu
L2FyY2gveDg2L21tLmMKQEAgLTM4NDEsNyArMzg0MSw3IEBAIGludCBkb25hdGVfcGFnZSgKICAg
ICB7CiAgICAgICAgIGlmICggZC0+dG90X3BhZ2VzID49IGQtPm1heF9wYWdlcyApCiAgICAgICAg
ICAgICBnb3RvIGZhaWw7Ci0gICAgICAgIGQtPnRvdF9wYWdlcysrOworICAgICAgICBk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AgIHVuc2lnbmVkIGludCAgICAgdG90X3BhZ2VzOyAg
ICAgICAvKiBudW1iZXIgb2YgcGFnZXMgY3VycmVudGx5IHBvc3Nlc2VkICovCisgICAgdW5zaWdu
ZWQgaW50ICAgICB1bmNsYWltZWRfcGFnZXM7IC8qIHBhZ2VzIGNsYWltZWQgYnV0IG5vdCBwb3Nz
ZXNzZWQgICAgKi8KICAgICB1bnNpZ25lZCBpbnQgICAgIG1heF9wYWdlczsgICAgICAgLyogbWF4
aW11bSB2YWx1ZSBmb3IgdG90X3BhZ2VzICAgICAgICAqLwogICAgIGF0b21pY190ICAgICAgICAg
c2hyX3BhZ2VzOyAgICAgICAvKiBudW1iZXIgb2Ygc2hhcmVkIHBhZ2VzICAgICAgICAgICAgICov
CiAgICAgYXRvbWljX3QgICAgICAgICBwYWdlZF9wYWdlczsgICAgIC8qIG51bWJlciBvZiBwYWdl
ZC1vdXQgcGFnZXMgICAgICAgICAgKi8K
--__1352937350095136424abhmt108.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__1352937350095136424abhmt108.oracle.com--


From xen-devel-bounces@lists.xen.org Thu Nov 15 00:12:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 00:12:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYn41-0004N2-L1; Thu, 15 Nov 2012 00:12:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYn3z-0004Mn-RQ
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 00:12:12 +0000
Received: from [85.158.143.35:23825] by server-1.bemta-4.messagelabs.com id
	05/71-27934-B5334A05; Thu, 15 Nov 2012 00:12:11 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1352938330!6635543!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg2MzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13340 invoked from network); 15 Nov 2012 00:12:10 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 00:12:10 -0000
X-IronPort-AV: E=Sophos;i="4.83,252,1352073600"; d="scan'208";a="15816272"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 00:12:10 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 00:12:09 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYn3x-0002MV-OR;
	Thu, 15 Nov 2012 00:12:09 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYn3x-0004Ui-LA;
	Thu, 15 Nov 2012 00:12:09 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14393-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 15 Nov 2012 00:12:09 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14393: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14393 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14393/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14388
 test-amd64-amd64-xl-sedf     11 guest-localmigrate           fail   like 14388

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  9 guest-localmigrate         fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  8ca6372315f8
baseline version:
 xen                  839e5d95d483

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Daley <mattjd@gmail.com>
  Olaf Hering <olaf@aepfle.de>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.2-testing
+ revision=8ca6372315f8
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.2-testing 8ca6372315f8
+ branch=xen-4.2-testing
+ revision=8ca6372315f8
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.2-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.2-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
++ : daily-cron.xen-4.2-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.2-testing.git
+ info_linux_tree xen-4.2-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.2-testing.hg
+ hg push -r 8ca6372315f8 ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 7 changesets with 8 changes to 7 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 00:12:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 00:12:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYn41-0004N2-L1; Thu, 15 Nov 2012 00:12:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYn3z-0004Mn-RQ
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 00:12:12 +0000
Received: from [85.158.143.35:23825] by server-1.bemta-4.messagelabs.com id
	05/71-27934-B5334A05; Thu, 15 Nov 2012 00:12:11 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1352938330!6635543!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg2MzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13340 invoked from network); 15 Nov 2012 00:12:10 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 00:12:10 -0000
X-IronPort-AV: E=Sophos;i="4.83,252,1352073600"; d="scan'208";a="15816272"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 00:12:10 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 00:12:09 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYn3x-0002MV-OR;
	Thu, 15 Nov 2012 00:12:09 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYn3x-0004Ui-LA;
	Thu, 15 Nov 2012 00:12:09 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14393-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 15 Nov 2012 00:12:09 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14393: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14393 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14393/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14388
 test-amd64-amd64-xl-sedf     11 guest-localmigrate           fail   like 14388

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  9 guest-localmigrate         fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  8ca6372315f8
baseline version:
 xen                  839e5d95d483

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Daley <mattjd@gmail.com>
  Olaf Hering <olaf@aepfle.de>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.2-testing
+ revision=8ca6372315f8
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.2-testing 8ca6372315f8
+ branch=xen-4.2-testing
+ revision=8ca6372315f8
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.2-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.2-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
++ : daily-cron.xen-4.2-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.2-testing.git
+ info_linux_tree xen-4.2-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.2-testing.hg
+ hg push -r 8ca6372315f8 ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 7 changesets with 8 changes to 7 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 00:30:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 00:30:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYnLF-00059W-Ar; Thu, 15 Nov 2012 00:30:01 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TYnLD-00059P-Og
	for Xen-devel@lists.xensource.com; Thu, 15 Nov 2012 00:29:59 +0000
Received: from [193.109.254.147:62530] by server-10.bemta-14.messagelabs.com
	id 7E/0B-31741-78734A05; Thu, 15 Nov 2012 00:29:59 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1352939396!9224943!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTQwMTg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21848 invoked from network); 15 Nov 2012 00:29:58 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-13.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 00:29:58 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF0TsPG017444
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 00:29:55 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF0TsHI004530
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 00:29:54 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF0TsER014094; Wed, 14 Nov 2012 18:29:54 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 16:29:53 -0800
Date: Wed, 14 Nov 2012 16:29:52 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121114162952.31f0f1ab@mantra.us.oracle.com>
In-Reply-To: <1352887110.26873.15.camel@zakaz.uk.xensource.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
	<1352800853.7491.22.camel@zakaz.uk.xensource.com>
	<20121113172138.1d3274d9@mantra.us.oracle.com>
	<20121113173138.61b21067@mantra.us.oracle.com>
	<1352887110.26873.15.camel@zakaz.uk.xensource.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 14 Nov 2012 09:58:30 +0000
Ian Campbell <Ian.Campbell@citrix.com> wrote:

> On Wed, 2012-11-14 at 01:31 +0000, Mukesh Rathor wrote:
> > On Tue, 13 Nov 2012 17:21:38 -0800
> > Mukesh Rathor <mukesh.rathor@oracle.com> wrote:
> > 
> > > 
> > > 
> > > I can't tell why f_active is there. I also see supported, may be
> > > thats the string of what the kernel supports. It is set to
> > > 0x11 ??? 
> > 
> > Debugging further, I see in xc_dom_parse_elf_kernel() after
> > elf_parse_binary(), the strings are set as:
> > 
> >       type = XEN_ENT_STR, name = 0x3cadc2e116 "PAE_MODE", data = {
> >         str = 0x7ffff61e14b0 "yes", num = 0x7ffff61e14b0}}, {
> >       type = XEN_ENT_STR, name = 0x3cadc2dd2d "FEATURES", data = {
> >         str = 0x7ffff61e1414
> > "!writable_page_tables|pae_pgdir_above_4gb", num =
> > 0x7ffff61e1414}}, {type = XEN_ENT_NONE, name = 0x0, data = { str =
> > 0x0, num = 0x0}}, {type = XEN_ENT_LONG, 

>later? My suspicion is that when the domain is created the kernel hasn't
>been parsed yet so the feature flags are not available. This would be

Well, it found "!writable_page_tables|pae_pgdir_above_4gb", but 
not the addition ones I added:

#define FEATURES_PVH "|writable_descriptor_tables" \
                    "|auto_translated_physmap" \
                    "|supervisor_mode_kernel" \
                    "|hvm_callback_vector"

However, I see the new ones in vmlinux. So, something either in 
bzImage or parser.

thanks for your help.
Mukesh


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 00:30:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 00:30:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYnLF-00059W-Ar; Thu, 15 Nov 2012 00:30:01 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TYnLD-00059P-Og
	for Xen-devel@lists.xensource.com; Thu, 15 Nov 2012 00:29:59 +0000
Received: from [193.109.254.147:62530] by server-10.bemta-14.messagelabs.com
	id 7E/0B-31741-78734A05; Thu, 15 Nov 2012 00:29:59 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1352939396!9224943!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTQwMTg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21848 invoked from network); 15 Nov 2012 00:29:58 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-13.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 00:29:58 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF0TsPG017444
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 00:29:55 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF0TsHI004530
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 00:29:54 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF0TsER014094; Wed, 14 Nov 2012 18:29:54 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 16:29:53 -0800
Date: Wed, 14 Nov 2012 16:29:52 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121114162952.31f0f1ab@mantra.us.oracle.com>
In-Reply-To: <1352887110.26873.15.camel@zakaz.uk.xensource.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
	<1352800853.7491.22.camel@zakaz.uk.xensource.com>
	<20121113172138.1d3274d9@mantra.us.oracle.com>
	<20121113173138.61b21067@mantra.us.oracle.com>
	<1352887110.26873.15.camel@zakaz.uk.xensource.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 14 Nov 2012 09:58:30 +0000
Ian Campbell <Ian.Campbell@citrix.com> wrote:

> On Wed, 2012-11-14 at 01:31 +0000, Mukesh Rathor wrote:
> > On Tue, 13 Nov 2012 17:21:38 -0800
> > Mukesh Rathor <mukesh.rathor@oracle.com> wrote:
> > 
> > > 
> > > 
> > > I can't tell why f_active is there. I also see supported, may be
> > > thats the string of what the kernel supports. It is set to
> > > 0x11 ??? 
> > 
> > Debugging further, I see in xc_dom_parse_elf_kernel() after
> > elf_parse_binary(), the strings are set as:
> > 
> >       type = XEN_ENT_STR, name = 0x3cadc2e116 "PAE_MODE", data = {
> >         str = 0x7ffff61e14b0 "yes", num = 0x7ffff61e14b0}}, {
> >       type = XEN_ENT_STR, name = 0x3cadc2dd2d "FEATURES", data = {
> >         str = 0x7ffff61e1414
> > "!writable_page_tables|pae_pgdir_above_4gb", num =
> > 0x7ffff61e1414}}, {type = XEN_ENT_NONE, name = 0x0, data = { str =
> > 0x0, num = 0x0}}, {type = XEN_ENT_LONG, 

>later? My suspicion is that when the domain is created the kernel hasn't
>been parsed yet so the feature flags are not available. This would be

Well, it found "!writable_page_tables|pae_pgdir_above_4gb", but 
not the addition ones I added:

#define FEATURES_PVH "|writable_descriptor_tables" \
                    "|auto_translated_physmap" \
                    "|supervisor_mode_kernel" \
                    "|hvm_callback_vector"

However, I see the new ones in vmlinux. So, something either in 
bzImage or parser.

thanks for your help.
Mukesh


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 01:51:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 01:51:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYobp-0002K2-1b; Thu, 15 Nov 2012 01:51:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kgrace.liu@gmail.com>) id 1TYobn-0002Jx-6p
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 01:51:11 +0000
Received: from [85.158.137.99:5224] by server-1.bemta-3.messagelabs.com id
	BB/00-12169-E8A44A05; Thu, 15 Nov 2012 01:51:10 +0000
X-Env-Sender: kgrace.liu@gmail.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352944267!19033570!1
X-Originating-IP: [209.85.214.171]
X-SpamReason: No, hits=0.9 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_30_40,HTML_MESSAGE,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3345 invoked from network); 15 Nov 2012 01:51:09 -0000
Received: from mail-ob0-f171.google.com (HELO mail-ob0-f171.google.com)
	(209.85.214.171)
	by server-14.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 01:51:09 -0000
Received: by mail-ob0-f171.google.com with SMTP id dn14so1511608obc.30
	for <xen-devel@lists.xensource.com>;
	Wed, 14 Nov 2012 17:51:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=1hjov78LYQBv8Ka05IQ17NgD3p1cHoEYGJ/9jw7HNEI=;
	b=xnY4wIny66OfOzFg+EWrVeCk95cxDkyigYrAXMyrzY3Akm2QMGBS5vIaF3MpbAwxbd
	lnCit//VmwbKrx8Jgredq3QCce3Him5a3ApMyI7lv1+lpgzg6fPaB4f3EbmJTytY6SoL
	ExdR5sHizvhvhkBxGfa+6eVyfw5Fg1z+wvGx+lXgAAnmZXy3VQQKuz9yqY9gaTVQACQs
	u36zmYznYMaKKJi2WK2eRev+5w4IKQ/DDDqcmReo4afvYnNjnwmTk6mfRJErBnGpaRMj
	eMXPS1Exj7jJlZ5ic0DuAqcVS+qqBWiPvWNSoDmAzQZX0OgY+ZBj/gqdyJb1TF4vCgaU
	8blw==
MIME-Version: 1.0
Received: by 10.182.218.37 with SMTP id pd5mr22727170obc.24.1352944267467;
	Wed, 14 Nov 2012 17:51:07 -0800 (PST)
Received: by 10.60.21.163 with HTTP; Wed, 14 Nov 2012 17:51:07 -0800 (PST)
In-Reply-To: <CAERYnoYg1iaM==-Gk__LtXLbQKaSpM-KAR-jr-cUPkt-WEe_aA@mail.gmail.com>
References: <CAERYnoYbLddzpE6729Nkx2YzMPcr09Do0f1rkob4U1h34NjQgQ@mail.gmail.com>
	<1352734133.27833.277.camel@zakaz.uk.xensource.com>
	<CAERYnoYg1iaM==-Gk__LtXLbQKaSpM-KAR-jr-cUPkt-WEe_aA@mail.gmail.com>
Date: Thu, 15 Nov 2012 09:51:07 +0800
X-Google-Sender-Auth: CdGAVtK0-O0YJ42tToueJstVr-o
Message-ID: <CAERYnoYgwRBycoc9+nV7uOk1Brwjs2r=QecpgKDQjASjwdkiew@mail.gmail.com>
From: Chunyan Liu <cyliu@suse.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] question about xenstore-chmod MAX_PERMS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1171014926411099278=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============1171014926411099278==
Content-Type: multipart/alternative; boundary=f46d04447dff769cf604ce7ee21a

--f46d04447dff769cf604ce7ee21a
Content-Type: text/plain; charset=UTF-8

2012/11/13 Chunyan Liu <cyliu@suse.com>

>
>
> 2012/11/12 Ian Campbell <Ian.Campbell@citrix.com>
>
>> Dropping users list, please don't cross post.
>>
> Sorry. Thanks for reminding.
>
>
>> On Mon, 2012-11-12 at 08:35 +0000, Chunyan Liu wrote:
>> > Dear List,
>> >
>> > I'm trying to issue:
>> > "xenstore-chmod PATH r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14
>> > r15 r16 r17 r18"
>> > it failed at error report "Too many permissions specified.  Maximum
>> > per invocation is 16."
>> >
>> > I changed MAX_PERMS to 18 for testing, it turns to be OK to run above
>> > command.
>> > I don't know why there is "MAX_PERMS=16" limitation and couldn't find
>> > useful info about that. Does anyone know that?
>>
>> It seems like an obvious case of an arbitrary constant to me.
>>
>> Do you actually have a practical requirement to be able to set > 16
>> perms via the command line tool?
>>
>> Yes. Our customer plans to have some hypervisor running above 32 domUs
> and needs to share common information between xen domU. He uses xenstore
> capabilities:
> i.e. xenstore-write /local/domain/0/foo "8 CPU"
> Then he gives read access to domU with:
> xenstore-chmod /local/domain/0/foo r0 r2 r3 r4 r5 r6 r7 r9 r10 r11 r12 r13
> r17 r18 r19 r20 r21 r22
> With current MAX_PERM limitation, xenstore-chmod will report "Too many
> permissions specified. Maximum per invocation is 16".
> And serial commands:
> xenstore-chmod /local/domain/0/foo r0
> xenstore-chmod /local/domain/0/foo r1
> ...
> couldn't achieve that either. (result will be only the last command).
>
>
>> I can't see anything obvious in the underlying library which would
>> prevent it handling essentially arbitrary length lists of perms. If you
>> want to change the client to increase the number supported I think you
>> should make it likewise handle arbitrary numbers rather than just
>> increasing MAX_PERMS.
>>
>
In addition: there is a check for msg.len <=  XENSTORE_PAYLOAD_MAX (which
is 4096).
For chmod, the msg.len = path len + mode len. In current environments,
there won't be so many perms that could exceed the value. But it IS a
limitation.

Sure, if there is nothing that prevents handling an arbitrary number of
> perms, it's better to handle it like arbitrary numbers rather than
> increasing MAX_PERMS. I was just not sure if there was some consideration
> to set a limitation.
> I'll modify code and test.
>
> Ian.
>>
>>
>>
>>
>

--f46d04447dff769cf604ce7ee21a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">2012/11/13 Chunyan Liu <span dir=3D"ltr"=
>&lt;<a href=3D"mailto:cyliu@suse.com" target=3D"_blank">cyliu@suse.com</a>=
&gt;</span><br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex=
;border-left:1px #ccc solid;padding-left:1ex">
<br><br><div class=3D"gmail_quote"><div class=3D"im">2012/11/12 Ian Campbel=
l <span dir=3D"ltr">&lt;<a href=3D"mailto:Ian.Campbell@citrix.com" target=
=3D"_blank">Ian.Campbell@citrix.com</a>&gt;</span><br><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex">

Dropping users list, please don&#39;t cross post.<br></blockquote></div><di=
v>Sorry. Thanks for reminding.<br>=C2=A0<br></div><div class=3D"im"><blockq=
uote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc =
solid;padding-left:1ex">

<div><div>On Mon, 2012-11-12 at 08:35 +0000, Chunyan Liu wrote:<br>
&gt; Dear List,<br>
&gt;<br>
&gt; I&#39;m trying to issue:<br>
&gt; &quot;xenstore-chmod PATH r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r1=
3 r14<br>
&gt; r15 r16 r17 r18&quot;<br>
&gt; it failed at error report &quot;Too many permissions specified. =C2=A0=
Maximum<br>
&gt; per invocation is 16.&quot;<br>
&gt;<br>
&gt; I changed MAX_PERMS to 18 for testing, it turns to be OK to run above<=
br>
&gt; command.<br>
&gt; I don&#39;t know why there is &quot;MAX_PERMS=3D16&quot; limitation an=
d couldn&#39;t find<br>
&gt; useful info about that. Does anyone know that?<br>
<br>
</div></div>It seems like an obvious case of an arbitrary constant to me.<b=
r>
<br>
Do you actually have a practical requirement to be able to set &gt; 16<br>
perms via the command line tool?<br>
<br></blockquote></div><div>Yes. Our customer plans to have some hypervisor=
 running above 32 domUs=20
and needs to share common information between xen domU. He uses xenstore
 capabilities: <br>i.e. xenstore-write /local/domain/0/foo &quot;8 CPU&quot=
;<br>Then he gives read access to domU with:<br>xenstore-chmod /local/domai=
n/0/foo r0 r2 r3 r4 r5 r6 r7 r9 r10 r11 r12 r13 r17 r18 r19 r20 r21 r22<br>

With current MAX_PERM limitation, xenstore-chmod will report &quot;Too many=
 permissions specified.  Maximum per invocation is 16&quot;.<br>And serial =
commands:<br>xenstore-chmod /local/domain/0/foo r0<br>xenstore-chmod /local=
/domain/0/foo r1<br>

...<br>couldn&#39;t achieve that either. (result will be only the last comm=
and).<br>=C2=A0<br></div><div class=3D"im"><blockquote class=3D"gmail_quote=
" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I can&#39;t see anything obvious in the underlying library which would<br>
prevent it handling essentially arbitrary length lists of perms. If you<br>
want to change the client to increase the number supported I think you<br>
should make it likewise handle arbitrary numbers rather than just<br>
increasing MAX_PERMS.<br></blockquote></div></div></blockquote><div><br>In =
addition: there is a check for msg.len &lt;=3D=C2=A0 XENSTORE_PAYLOAD_MAX (=
which is 4096). <br>For chmod, the msg.len =3D path len + mode len. In curr=
ent environments, there won&#39;t be so many perms that could exceed the va=
lue. But it IS a limitation. <br>
<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"><div class=3D"gmail_quote"><div>Su=
re, if there is nothing that prevents handling an arbitrary number of perms=
, it&#39;s better to handle it like arbitrary numbers rather than increasin=
g MAX_PERMS. I was just not sure if there was some consideration to set a l=
imitation.<br>

I&#39;ll modify code and test. <br><br></div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"=
><span><font color=3D"#888888">
Ian.<br>
<br>
<br>
<br>
</font></span></blockquote></div><br>
</blockquote></div><br>

--f46d04447dff769cf604ce7ee21a--


--===============1171014926411099278==
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.xen.org
http://lists.xen.org/xen-devel

--===============1171014926411099278==--


From xen-devel-bounces@lists.xen.org Thu Nov 15 01:51:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 01:51:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYobp-0002K2-1b; Thu, 15 Nov 2012 01:51:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kgrace.liu@gmail.com>) id 1TYobn-0002Jx-6p
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 01:51:11 +0000
Received: from [85.158.137.99:5224] by server-1.bemta-3.messagelabs.com id
	BB/00-12169-E8A44A05; Thu, 15 Nov 2012 01:51:10 +0000
X-Env-Sender: kgrace.liu@gmail.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352944267!19033570!1
X-Originating-IP: [209.85.214.171]
X-SpamReason: No, hits=0.9 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_30_40,HTML_MESSAGE,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3345 invoked from network); 15 Nov 2012 01:51:09 -0000
Received: from mail-ob0-f171.google.com (HELO mail-ob0-f171.google.com)
	(209.85.214.171)
	by server-14.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 01:51:09 -0000
Received: by mail-ob0-f171.google.com with SMTP id dn14so1511608obc.30
	for <xen-devel@lists.xensource.com>;
	Wed, 14 Nov 2012 17:51:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=1hjov78LYQBv8Ka05IQ17NgD3p1cHoEYGJ/9jw7HNEI=;
	b=xnY4wIny66OfOzFg+EWrVeCk95cxDkyigYrAXMyrzY3Akm2QMGBS5vIaF3MpbAwxbd
	lnCit//VmwbKrx8Jgredq3QCce3Him5a3ApMyI7lv1+lpgzg6fPaB4f3EbmJTytY6SoL
	ExdR5sHizvhvhkBxGfa+6eVyfw5Fg1z+wvGx+lXgAAnmZXy3VQQKuz9yqY9gaTVQACQs
	u36zmYznYMaKKJi2WK2eRev+5w4IKQ/DDDqcmReo4afvYnNjnwmTk6mfRJErBnGpaRMj
	eMXPS1Exj7jJlZ5ic0DuAqcVS+qqBWiPvWNSoDmAzQZX0OgY+ZBj/gqdyJb1TF4vCgaU
	8blw==
MIME-Version: 1.0
Received: by 10.182.218.37 with SMTP id pd5mr22727170obc.24.1352944267467;
	Wed, 14 Nov 2012 17:51:07 -0800 (PST)
Received: by 10.60.21.163 with HTTP; Wed, 14 Nov 2012 17:51:07 -0800 (PST)
In-Reply-To: <CAERYnoYg1iaM==-Gk__LtXLbQKaSpM-KAR-jr-cUPkt-WEe_aA@mail.gmail.com>
References: <CAERYnoYbLddzpE6729Nkx2YzMPcr09Do0f1rkob4U1h34NjQgQ@mail.gmail.com>
	<1352734133.27833.277.camel@zakaz.uk.xensource.com>
	<CAERYnoYg1iaM==-Gk__LtXLbQKaSpM-KAR-jr-cUPkt-WEe_aA@mail.gmail.com>
Date: Thu, 15 Nov 2012 09:51:07 +0800
X-Google-Sender-Auth: CdGAVtK0-O0YJ42tToueJstVr-o
Message-ID: <CAERYnoYgwRBycoc9+nV7uOk1Brwjs2r=QecpgKDQjASjwdkiew@mail.gmail.com>
From: Chunyan Liu <cyliu@suse.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] question about xenstore-chmod MAX_PERMS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1171014926411099278=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============1171014926411099278==
Content-Type: multipart/alternative; boundary=f46d04447dff769cf604ce7ee21a

--f46d04447dff769cf604ce7ee21a
Content-Type: text/plain; charset=UTF-8

2012/11/13 Chunyan Liu <cyliu@suse.com>

>
>
> 2012/11/12 Ian Campbell <Ian.Campbell@citrix.com>
>
>> Dropping users list, please don't cross post.
>>
> Sorry. Thanks for reminding.
>
>
>> On Mon, 2012-11-12 at 08:35 +0000, Chunyan Liu wrote:
>> > Dear List,
>> >
>> > I'm trying to issue:
>> > "xenstore-chmod PATH r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14
>> > r15 r16 r17 r18"
>> > it failed at error report "Too many permissions specified.  Maximum
>> > per invocation is 16."
>> >
>> > I changed MAX_PERMS to 18 for testing, it turns to be OK to run above
>> > command.
>> > I don't know why there is "MAX_PERMS=16" limitation and couldn't find
>> > useful info about that. Does anyone know that?
>>
>> It seems like an obvious case of an arbitrary constant to me.
>>
>> Do you actually have a practical requirement to be able to set > 16
>> perms via the command line tool?
>>
>> Yes. Our customer plans to have some hypervisor running above 32 domUs
> and needs to share common information between xen domU. He uses xenstore
> capabilities:
> i.e. xenstore-write /local/domain/0/foo "8 CPU"
> Then he gives read access to domU with:
> xenstore-chmod /local/domain/0/foo r0 r2 r3 r4 r5 r6 r7 r9 r10 r11 r12 r13
> r17 r18 r19 r20 r21 r22
> With current MAX_PERM limitation, xenstore-chmod will report "Too many
> permissions specified. Maximum per invocation is 16".
> And serial commands:
> xenstore-chmod /local/domain/0/foo r0
> xenstore-chmod /local/domain/0/foo r1
> ...
> couldn't achieve that either. (result will be only the last command).
>
>
>> I can't see anything obvious in the underlying library which would
>> prevent it handling essentially arbitrary length lists of perms. If you
>> want to change the client to increase the number supported I think you
>> should make it likewise handle arbitrary numbers rather than just
>> increasing MAX_PERMS.
>>
>
In addition: there is a check for msg.len <=  XENSTORE_PAYLOAD_MAX (which
is 4096).
For chmod, the msg.len = path len + mode len. In current environments,
there won't be so many perms that could exceed the value. But it IS a
limitation.

Sure, if there is nothing that prevents handling an arbitrary number of
> perms, it's better to handle it like arbitrary numbers rather than
> increasing MAX_PERMS. I was just not sure if there was some consideration
> to set a limitation.
> I'll modify code and test.
>
> Ian.
>>
>>
>>
>>
>

--f46d04447dff769cf604ce7ee21a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">2012/11/13 Chunyan Liu <span dir=3D"ltr"=
>&lt;<a href=3D"mailto:cyliu@suse.com" target=3D"_blank">cyliu@suse.com</a>=
&gt;</span><br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex=
;border-left:1px #ccc solid;padding-left:1ex">
<br><br><div class=3D"gmail_quote"><div class=3D"im">2012/11/12 Ian Campbel=
l <span dir=3D"ltr">&lt;<a href=3D"mailto:Ian.Campbell@citrix.com" target=
=3D"_blank">Ian.Campbell@citrix.com</a>&gt;</span><br><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex">

Dropping users list, please don&#39;t cross post.<br></blockquote></div><di=
v>Sorry. Thanks for reminding.<br>=C2=A0<br></div><div class=3D"im"><blockq=
uote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc =
solid;padding-left:1ex">

<div><div>On Mon, 2012-11-12 at 08:35 +0000, Chunyan Liu wrote:<br>
&gt; Dear List,<br>
&gt;<br>
&gt; I&#39;m trying to issue:<br>
&gt; &quot;xenstore-chmod PATH r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r1=
3 r14<br>
&gt; r15 r16 r17 r18&quot;<br>
&gt; it failed at error report &quot;Too many permissions specified. =C2=A0=
Maximum<br>
&gt; per invocation is 16.&quot;<br>
&gt;<br>
&gt; I changed MAX_PERMS to 18 for testing, it turns to be OK to run above<=
br>
&gt; command.<br>
&gt; I don&#39;t know why there is &quot;MAX_PERMS=3D16&quot; limitation an=
d couldn&#39;t find<br>
&gt; useful info about that. Does anyone know that?<br>
<br>
</div></div>It seems like an obvious case of an arbitrary constant to me.<b=
r>
<br>
Do you actually have a practical requirement to be able to set &gt; 16<br>
perms via the command line tool?<br>
<br></blockquote></div><div>Yes. Our customer plans to have some hypervisor=
 running above 32 domUs=20
and needs to share common information between xen domU. He uses xenstore
 capabilities: <br>i.e. xenstore-write /local/domain/0/foo &quot;8 CPU&quot=
;<br>Then he gives read access to domU with:<br>xenstore-chmod /local/domai=
n/0/foo r0 r2 r3 r4 r5 r6 r7 r9 r10 r11 r12 r13 r17 r18 r19 r20 r21 r22<br>

With current MAX_PERM limitation, xenstore-chmod will report &quot;Too many=
 permissions specified.  Maximum per invocation is 16&quot;.<br>And serial =
commands:<br>xenstore-chmod /local/domain/0/foo r0<br>xenstore-chmod /local=
/domain/0/foo r1<br>

...<br>couldn&#39;t achieve that either. (result will be only the last comm=
and).<br>=C2=A0<br></div><div class=3D"im"><blockquote class=3D"gmail_quote=
" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I can&#39;t see anything obvious in the underlying library which would<br>
prevent it handling essentially arbitrary length lists of perms. If you<br>
want to change the client to increase the number supported I think you<br>
should make it likewise handle arbitrary numbers rather than just<br>
increasing MAX_PERMS.<br></blockquote></div></div></blockquote><div><br>In =
addition: there is a check for msg.len &lt;=3D=C2=A0 XENSTORE_PAYLOAD_MAX (=
which is 4096). <br>For chmod, the msg.len =3D path len + mode len. In curr=
ent environments, there won&#39;t be so many perms that could exceed the va=
lue. But it IS a limitation. <br>
<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"><div class=3D"gmail_quote"><div>Su=
re, if there is nothing that prevents handling an arbitrary number of perms=
, it&#39;s better to handle it like arbitrary numbers rather than increasin=
g MAX_PERMS. I was just not sure if there was some consideration to set a l=
imitation.<br>

I&#39;ll modify code and test. <br><br></div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"=
><span><font color=3D"#888888">
Ian.<br>
<br>
<br>
<br>
</font></span></blockquote></div><br>
</blockquote></div><br>

--f46d04447dff769cf604ce7ee21a--


--===============1171014926411099278==
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.xen.org
http://lists.xen.org/xen-devel

--===============1171014926411099278==--


From xen-devel-bounces@lists.xen.org Thu Nov 15 02:04:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 02:04:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYoo6-00035p-AE; Thu, 15 Nov 2012 02:03:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jfehlig@suse.com>) id 1TYoo5-00035k-AU
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 02:03:53 +0000
Received: from [85.158.143.35:27071] by server-2.bemta-4.messagelabs.com id
	BE/E8-28922-88D44A05; Thu, 15 Nov 2012 02:03:52 +0000
X-Env-Sender: jfehlig@suse.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1352945031!7348493!1
X-Originating-IP: [137.65.248.124]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20318 invoked from network); 15 Nov 2012 02:03:52 -0000
Received: from inet-orm.provo.novell.com (HELO mail.novell.com)
	(137.65.248.124) by server-9.tower-21.messagelabs.com with SMTP;
	15 Nov 2012 02:03:52 -0000
Received: from localhost.localdomain ([147.2.215.227])
	by mail.novell.com with ESMTP; Wed, 14 Nov 2012 19:03:47 -0700
From: Jim Fehlig <jfehlig@suse.com>
To: xen-devel@lists.xensource.com
Date: Wed, 14 Nov 2012 19:03:31 -0700
Message-Id: <1352945011-2847-1-git-send-email-jfehlig@suse.com>
X-Mailer: git-send-email 1.7.7
Subject: [Xen-devel] [PATCH] libxl: Fix passing of application data to
	timeout_deregister hook
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

When deregistering a timeout, the address of application data was
being passed to the timeout_deregister hook instead of the data
itself.

    Signed-off-by: Jim Fehlig <jfehlig@suse.com>
---
 tools/libxl/libxl_event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index 41fd5bb..72cb723 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -184,7 +184,7 @@ static int time_register_finite(libxl__gc *gc, libxl__ev_time *ev,
 static void time_deregister(libxl__gc *gc, libxl__ev_time *ev)
 {
     if (!ev->infinite) {
-        OSEVENT_HOOK_VOID(timeout_deregister, &ev->for_app_reg);
+        OSEVENT_HOOK_VOID(timeout_deregister, ev->for_app_reg);
         LIBXL_TAILQ_REMOVE(&CTX->etimes, ev, entry);
     }
 }
-- 
1.7.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 02:04:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 02:04:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYoo6-00035p-AE; Thu, 15 Nov 2012 02:03:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jfehlig@suse.com>) id 1TYoo5-00035k-AU
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 02:03:53 +0000
Received: from [85.158.143.35:27071] by server-2.bemta-4.messagelabs.com id
	BE/E8-28922-88D44A05; Thu, 15 Nov 2012 02:03:52 +0000
X-Env-Sender: jfehlig@suse.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1352945031!7348493!1
X-Originating-IP: [137.65.248.124]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20318 invoked from network); 15 Nov 2012 02:03:52 -0000
Received: from inet-orm.provo.novell.com (HELO mail.novell.com)
	(137.65.248.124) by server-9.tower-21.messagelabs.com with SMTP;
	15 Nov 2012 02:03:52 -0000
Received: from localhost.localdomain ([147.2.215.227])
	by mail.novell.com with ESMTP; Wed, 14 Nov 2012 19:03:47 -0700
From: Jim Fehlig <jfehlig@suse.com>
To: xen-devel@lists.xensource.com
Date: Wed, 14 Nov 2012 19:03:31 -0700
Message-Id: <1352945011-2847-1-git-send-email-jfehlig@suse.com>
X-Mailer: git-send-email 1.7.7
Subject: [Xen-devel] [PATCH] libxl: Fix passing of application data to
	timeout_deregister hook
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

When deregistering a timeout, the address of application data was
being passed to the timeout_deregister hook instead of the data
itself.

    Signed-off-by: Jim Fehlig <jfehlig@suse.com>
---
 tools/libxl/libxl_event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index 41fd5bb..72cb723 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -184,7 +184,7 @@ static int time_register_finite(libxl__gc *gc, libxl__ev_time *ev,
 static void time_deregister(libxl__gc *gc, libxl__ev_time *ev)
 {
     if (!ev->infinite) {
-        OSEVENT_HOOK_VOID(timeout_deregister, &ev->for_app_reg);
+        OSEVENT_HOOK_VOID(timeout_deregister, ev->for_app_reg);
         LIBXL_TAILQ_REMOVE(&CTX->etimes, ev, entry);
     }
 }
-- 
1.7.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 02:14:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 02:14:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYoxw-0003Iv-DS; Thu, 15 Nov 2012 02:14:04 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TYoxv-0003Iq-2l
	for Xen-devel@lists.xensource.com; Thu, 15 Nov 2012 02:14:03 +0000
Received: from [193.109.254.147:56266] by server-5.bemta-14.messagelabs.com id
	77/E5-10257-9EF44A05; Thu, 15 Nov 2012 02:14:01 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352945639!3063497!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NDM1NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2741 invoked from network); 15 Nov 2012 02:14:00 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-15.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 02:14:00 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF2DuSX029262
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 02:13:57 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF2DuUA023875
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 02:13:56 GMT
Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF2DuKJ009307; Wed, 14 Nov 2012 20:13:56 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 18:13:55 -0800
Date: Wed, 14 Nov 2012 18:13:54 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121114181354.568ce2db@mantra.us.oracle.com>
In-Reply-To: <1352887110.26873.15.camel@zakaz.uk.xensource.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
	<1352800853.7491.22.camel@zakaz.uk.xensource.com>
	<20121113172138.1d3274d9@mantra.us.oracle.com>
	<20121113173138.61b21067@mantra.us.oracle.com>
	<1352887110.26873.15.camel@zakaz.uk.xensource.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 14 Nov 2012 09:58:30 +0000
Ian Campbell <Ian.Campbell@citrix.com> wrote:

Duuude!!! You owe me a beer next time we meet (was your code ;)), and I
ain't making it a cheap one :).

The problem is :

#define FEATURES_PVH "|writable_descriptor_tables" \
                    "|auto_translated_physmap" \
                    "|supervisor_mode_kernel" \
                    "|hvm_callback_vector"

ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz
"!writable_page_tables|pae_pgdir_above_4gb"FEATURES_PVH)


This is a .S file and not C, and it puts null char after _4gb. Fixed it
and now xc_dom_feature_translated() is returnig true. Whew! I'll send
konrad a patch.

On to the next one .............

thanks again,
Mukesh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 02:14:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 02:14:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYoxw-0003Iv-DS; Thu, 15 Nov 2012 02:14:04 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TYoxv-0003Iq-2l
	for Xen-devel@lists.xensource.com; Thu, 15 Nov 2012 02:14:03 +0000
Received: from [193.109.254.147:56266] by server-5.bemta-14.messagelabs.com id
	77/E5-10257-9EF44A05; Thu, 15 Nov 2012 02:14:01 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352945639!3063497!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NDM1NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2741 invoked from network); 15 Nov 2012 02:14:00 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-15.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 02:14:00 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF2DuSX029262
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 02:13:57 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF2DuUA023875
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 02:13:56 GMT
Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF2DuKJ009307; Wed, 14 Nov 2012 20:13:56 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 18:13:55 -0800
Date: Wed, 14 Nov 2012 18:13:54 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121114181354.568ce2db@mantra.us.oracle.com>
In-Reply-To: <1352887110.26873.15.camel@zakaz.uk.xensource.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
	<1352800853.7491.22.camel@zakaz.uk.xensource.com>
	<20121113172138.1d3274d9@mantra.us.oracle.com>
	<20121113173138.61b21067@mantra.us.oracle.com>
	<1352887110.26873.15.camel@zakaz.uk.xensource.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 14 Nov 2012 09:58:30 +0000
Ian Campbell <Ian.Campbell@citrix.com> wrote:

Duuude!!! You owe me a beer next time we meet (was your code ;)), and I
ain't making it a cheap one :).

The problem is :

#define FEATURES_PVH "|writable_descriptor_tables" \
                    "|auto_translated_physmap" \
                    "|supervisor_mode_kernel" \
                    "|hvm_callback_vector"

ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz
"!writable_page_tables|pae_pgdir_above_4gb"FEATURES_PVH)


This is a .S file and not C, and it puts null char after _4gb. Fixed it
and now xc_dom_feature_translated() is returnig true. Whew! I'll send
konrad a patch.

On to the next one .............

thanks again,
Mukesh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 02:20:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 02:20:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYp3O-0003a6-Br; Thu, 15 Nov 2012 02:19:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TYp3M-0003Zz-AD
	for Xen-devel@lists.xensource.com; Thu, 15 Nov 2012 02:19:40 +0000
Received: from [193.109.254.147:58053] by server-3.bemta-14.messagelabs.com id
	14/1E-01317-B3154A05; Thu, 15 Nov 2012 02:19:39 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352945977!8334535!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTQwMTg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17801 invoked from network); 15 Nov 2012 02:19:39 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-5.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 02:19:39 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF2JakT029895
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 02:19:37 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF2JZXD003783
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 02:19:35 GMT
Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF2JYpN007762; Wed, 14 Nov 2012 20:19:34 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 18:19:34 -0800
Date: Wed, 14 Nov 2012 18:19:33 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Message-ID: <20121114181933.1ffb5f09@mantra.us.oracle.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Subject: [Xen-devel] [PATCH]:  PVH: remove FEATURES_PVH macro
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

PVH: remove macro FEATURES_PVH and put PVH strings in the ELFNOTE line, because there's a null char before FEATURES_PVH and in the FEATURES_PVH strings since this is not C file

Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
---
 arch/x86/xen/xen-head.S |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
index 1a6bca1..340fd4e 100644
--- a/arch/x86/xen/xen-head.S
+++ b/arch/x86/xen/xen-head.S
@@ -13,14 +13,6 @@
 #include <xen/interface/elfnote.h>
 #include <asm/xen/interface.h>
 
-#ifdef CONFIG_XEN_X86_PVH
-#define FEATURES_PVH "|writable_descriptor_tables" \
-		     "|auto_translated_physmap" \
-		     "|supervisor_mode_kernel" \
-		     "|hvm_callback_vector"
-#else
-#define FEATURES_PVH /* Not supported */
-#endif
 
 	__INIT
 ENTRY(startup_xen)
@@ -104,7 +96,11 @@ NEXT_HYPERCALL(arch_6)
 #endif
 	ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          _ASM_PTR startup_xen)
 	ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _ASM_PTR hypercall_page)
-	ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "!writable_page_tables|pae_pgdir_above_4gb"FEATURES_PVH)
+#ifdef CONFIG_XEN_X86_PVH
+        ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "!writable_page_tables|pae_pgdir_above_4gb|writable_descriptor_tables|auto_translated_physmap|supervisor_mode_kernel|hvm_callback_vector")
+#else
+        ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "!writable_page_tables|pae_pgdir_above_4gb")
+#endif
 	ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz "yes")
 	ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz "generic")
 	ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,
-- 
1.7.2.3


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 02:20:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 02:20:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYp3O-0003a6-Br; Thu, 15 Nov 2012 02:19:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TYp3M-0003Zz-AD
	for Xen-devel@lists.xensource.com; Thu, 15 Nov 2012 02:19:40 +0000
Received: from [193.109.254.147:58053] by server-3.bemta-14.messagelabs.com id
	14/1E-01317-B3154A05; Thu, 15 Nov 2012 02:19:39 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352945977!8334535!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTQwMTg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17801 invoked from network); 15 Nov 2012 02:19:39 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-5.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 02:19:39 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF2JakT029895
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 02:19:37 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF2JZXD003783
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 02:19:35 GMT
Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF2JYpN007762; Wed, 14 Nov 2012 20:19:34 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 18:19:34 -0800
Date: Wed, 14 Nov 2012 18:19:33 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Message-ID: <20121114181933.1ffb5f09@mantra.us.oracle.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Subject: [Xen-devel] [PATCH]:  PVH: remove FEATURES_PVH macro
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

PVH: remove macro FEATURES_PVH and put PVH strings in the ELFNOTE line, because there's a null char before FEATURES_PVH and in the FEATURES_PVH strings since this is not C file

Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
---
 arch/x86/xen/xen-head.S |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
index 1a6bca1..340fd4e 100644
--- a/arch/x86/xen/xen-head.S
+++ b/arch/x86/xen/xen-head.S
@@ -13,14 +13,6 @@
 #include <xen/interface/elfnote.h>
 #include <asm/xen/interface.h>
 
-#ifdef CONFIG_XEN_X86_PVH
-#define FEATURES_PVH "|writable_descriptor_tables" \
-		     "|auto_translated_physmap" \
-		     "|supervisor_mode_kernel" \
-		     "|hvm_callback_vector"
-#else
-#define FEATURES_PVH /* Not supported */
-#endif
 
 	__INIT
 ENTRY(startup_xen)
@@ -104,7 +96,11 @@ NEXT_HYPERCALL(arch_6)
 #endif
 	ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          _ASM_PTR startup_xen)
 	ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _ASM_PTR hypercall_page)
-	ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "!writable_page_tables|pae_pgdir_above_4gb"FEATURES_PVH)
+#ifdef CONFIG_XEN_X86_PVH
+        ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "!writable_page_tables|pae_pgdir_above_4gb|writable_descriptor_tables|auto_translated_physmap|supervisor_mode_kernel|hvm_callback_vector")
+#else
+        ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "!writable_page_tables|pae_pgdir_above_4gb")
+#endif
 	ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz "yes")
 	ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz "generic")
 	ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,
-- 
1.7.2.3


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 02:32:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 02:32:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYpFI-0003xW-K9; Thu, 15 Nov 2012 02:32:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYpFH-0003xR-Qy
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 02:32:00 +0000
Received: from [85.158.143.99:46659] by server-1.bemta-4.messagelabs.com id
	55/69-27934-F1454A05; Thu, 15 Nov 2012 02:31:59 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352946717!26611015!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTQwMTg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26360 invoked from network); 15 Nov 2012 02:31:58 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-7.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 02:31:58 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF2VmUL005298
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 02:31:49 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF2Vlje011784
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 02:31:47 GMT
Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF2VkeY013119; Wed, 14 Nov 2012 20:31:46 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 18:31:46 -0800
Message-ID: <50A4540E.1010601@oracle.com>
Date: Thu, 15 Nov 2012 10:31:42 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1349790467.21847.185.camel@zakaz.uk.xensource.com>
	<1349790863.21172.4406.camel@edumazet-glaptop>
	<1349792241.21847.199.camel@zakaz.uk.xensource.com>
	<1349792847.21172.4479.camel@edumazet-glaptop>
	<1349793630.21847.208.camel@zakaz.uk.xensource.com>
	<1349863984.10070.26.camel@zakaz.uk.xensource.com>
	<1349874598.10070.39.camel@zakaz.uk.xensource.com>
	<748966751.20121010164949@eikelenboom.it>
	<1349942546.14806.7.camel@zakaz.uk.xensource.com>
	<151954917.20121011120004@eikelenboom.it>
	<1349949924.21172.8462.camel@edumazet-glaptop>
	<1349950494.14806.29.camel@zakaz.uk.xensource.com>
In-Reply-To: <1349950494.14806.29.camel@zakaz.uk.xensource.com>
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Marcos E. Matsunaga" <Marcos.Matsunaga@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] compound skb frag pages appearing in start_xmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-10-11 18:14, Ian Campbell wrote:
> On Thu, 2012-10-11 at 11:05 +0100, Eric Dumazet wrote:
>> On Thu, 2012-10-11 at 12:00 +0200, Sander Eikelenboom wrote:
>>
>>> Probably due to the BUG_ON from the patch below, i changed it into a WARN_ON.
>>> And i seem to hit it, but only in one of the guests at the moment and it triggers quite irregularly.
>> xennet_make_frags() is able to split the skb->head in multiple page-size
>> chunks.
>>
>> It should do the same for fragments
> Right, I just want to be reproduce the issue so I can know I've fixed it
> properly ;-)
Hi Ian,

I can reproduce this BUG_ON when running netperf/netserver test between 
two domus running on the same dom0. The domu and dom0 all use v3.7-rc1.

When I tried to rebase my persistent grant netfront/netback patch on 
latest kernel, netperf/netserver test never succeeded. I did some test 
to find out that v3.6-rc7 works fine, but v3.7-rc1, v3.7-rc2 and 
v3.7-rc4 does not succeed in netperf/netserver test. So I keep my 
persistent grant patch only based on v3.4-rc3 now.

Konrad thought about commit 6a8ed462f16b8455eec5ae00eb6014159a6721f0 in 
v3.7-rc1, and suggested me to test your debug patch in netfront. This 
BUG_ON happens soon after running the netperf/netserver test case.

Thanks
Annie
>
> Ian.
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 02:32:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 02:32:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYpFI-0003xW-K9; Thu, 15 Nov 2012 02:32:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYpFH-0003xR-Qy
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 02:32:00 +0000
Received: from [85.158.143.99:46659] by server-1.bemta-4.messagelabs.com id
	55/69-27934-F1454A05; Thu, 15 Nov 2012 02:31:59 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352946717!26611015!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTQwMTg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26360 invoked from network); 15 Nov 2012 02:31:58 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-7.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 02:31:58 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF2VmUL005298
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 02:31:49 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF2Vlje011784
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 02:31:47 GMT
Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF2VkeY013119; Wed, 14 Nov 2012 20:31:46 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 18:31:46 -0800
Message-ID: <50A4540E.1010601@oracle.com>
Date: Thu, 15 Nov 2012 10:31:42 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1349790467.21847.185.camel@zakaz.uk.xensource.com>
	<1349790863.21172.4406.camel@edumazet-glaptop>
	<1349792241.21847.199.camel@zakaz.uk.xensource.com>
	<1349792847.21172.4479.camel@edumazet-glaptop>
	<1349793630.21847.208.camel@zakaz.uk.xensource.com>
	<1349863984.10070.26.camel@zakaz.uk.xensource.com>
	<1349874598.10070.39.camel@zakaz.uk.xensource.com>
	<748966751.20121010164949@eikelenboom.it>
	<1349942546.14806.7.camel@zakaz.uk.xensource.com>
	<151954917.20121011120004@eikelenboom.it>
	<1349949924.21172.8462.camel@edumazet-glaptop>
	<1349950494.14806.29.camel@zakaz.uk.xensource.com>
In-Reply-To: <1349950494.14806.29.camel@zakaz.uk.xensource.com>
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Marcos E. Matsunaga" <Marcos.Matsunaga@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] compound skb frag pages appearing in start_xmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-10-11 18:14, Ian Campbell wrote:
> On Thu, 2012-10-11 at 11:05 +0100, Eric Dumazet wrote:
>> On Thu, 2012-10-11 at 12:00 +0200, Sander Eikelenboom wrote:
>>
>>> Probably due to the BUG_ON from the patch below, i changed it into a WARN_ON.
>>> And i seem to hit it, but only in one of the guests at the moment and it triggers quite irregularly.
>> xennet_make_frags() is able to split the skb->head in multiple page-size
>> chunks.
>>
>> It should do the same for fragments
> Right, I just want to be reproduce the issue so I can know I've fixed it
> properly ;-)
Hi Ian,

I can reproduce this BUG_ON when running netperf/netserver test between 
two domus running on the same dom0. The domu and dom0 all use v3.7-rc1.

When I tried to rebase my persistent grant netfront/netback patch on 
latest kernel, netperf/netserver test never succeeded. I did some test 
to find out that v3.6-rc7 works fine, but v3.7-rc1, v3.7-rc2 and 
v3.7-rc4 does not succeed in netperf/netserver test. So I keep my 
persistent grant patch only based on v3.4-rc3 now.

Konrad thought about commit 6a8ed462f16b8455eec5ae00eb6014159a6721f0 in 
v3.7-rc1, and suggested me to test your debug patch in netfront. This 
BUG_ON happens soon after running the netperf/netserver test case.

Thanks
Annie
>
> Ian.
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 02:36:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 02:36:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYpJH-0004DL-9Y; Thu, 15 Nov 2012 02:36:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYpJF-0004DE-LH
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 02:36:05 +0000
Received: from [193.109.254.147:2337] by server-1.bemta-14.messagelabs.com id
	9E/B9-25314-41554A05; Thu, 15 Nov 2012 02:36:04 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1352946963!9148688!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg2MzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1445 invoked from network); 15 Nov 2012 02:36:03 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 02:36:03 -0000
X-IronPort-AV: E=Sophos;i="4.83,254,1352073600"; d="scan'208";a="15817095"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 02:36:03 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 02:36:02 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYpJC-00037e-Lr;
	Thu, 15 Nov 2012 02:36:02 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYpJC-0005Pw-8S;
	Thu, 15 Nov 2012 02:36:02 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14395-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 15 Nov 2012 02:36:02 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14395: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14395 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14395/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14389
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14389
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14389
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14389

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  d1d05cb59a76
baseline version:
 xen                  8b93ac0c93f3

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Dan Magenheimer <dan.magenheimer@oracle.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jacek Konieczny <jajcus@jajcus.net>
  Jan Beulich <jbeulich@suse.com>
  Ronny Hegewald <Ronny.Hegewald@online.de>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=d1d05cb59a76
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable d1d05cb59a76
+ branch=xen-unstable
+ revision=d1d05cb59a76
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r d1d05cb59a76 ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 7 changesets with 8 changes to 8 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 02:36:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 02:36:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYpJH-0004DL-9Y; Thu, 15 Nov 2012 02:36:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYpJF-0004DE-LH
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 02:36:05 +0000
Received: from [193.109.254.147:2337] by server-1.bemta-14.messagelabs.com id
	9E/B9-25314-41554A05; Thu, 15 Nov 2012 02:36:04 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1352946963!9148688!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg2MzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1445 invoked from network); 15 Nov 2012 02:36:03 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 02:36:03 -0000
X-IronPort-AV: E=Sophos;i="4.83,254,1352073600"; d="scan'208";a="15817095"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 02:36:03 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 02:36:02 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYpJC-00037e-Lr;
	Thu, 15 Nov 2012 02:36:02 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYpJC-0005Pw-8S;
	Thu, 15 Nov 2012 02:36:02 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14395-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 15 Nov 2012 02:36:02 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14395: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14395 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14395/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14389
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14389
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14389
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14389

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  d1d05cb59a76
baseline version:
 xen                  8b93ac0c93f3

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Dan Magenheimer <dan.magenheimer@oracle.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jacek Konieczny <jajcus@jajcus.net>
  Jan Beulich <jbeulich@suse.com>
  Ronny Hegewald <Ronny.Hegewald@online.de>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=d1d05cb59a76
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable d1d05cb59a76
+ branch=xen-unstable
+ revision=d1d05cb59a76
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r d1d05cb59a76 ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 7 changesets with 8 changes to 8 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 03:07:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 03:07:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYpnE-00059A-Kt; Thu, 15 Nov 2012 03:07:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <afaerber@suse.de>) id 1TYpnD-000595-T2
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 03:07:04 +0000
Received: from [85.158.143.99:39813] by server-1.bemta-4.messagelabs.com id
	F6/35-27934-75C54A05; Thu, 15 Nov 2012 03:07:03 +0000
X-Env-Sender: afaerber@suse.de
X-Msg-Ref: server-16.tower-216.messagelabs.com!1352948822!18775142!1
X-Originating-IP: [195.135.220.15]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29008 invoked from network); 15 Nov 2012 03:07:02 -0000
Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15)
	by server-16.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 03:07:02 -0000
Received: from relay2.suse.de (unknown [195.135.220.254])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx2.suse.de (Postfix) with ESMTP id 7F64CA329D;
	Thu, 15 Nov 2012 04:07:00 +0100 (CET)
From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
To: qemu-devel@nongnu.org
Date: Thu, 15 Nov 2012 04:06:38 +0100
Message-Id: <1352948807-30415-3-git-send-email-afaerber@suse.de>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352948807-30415-1-git-send-email-afaerber@suse.de>
References: <1352948807-30415-1-git-send-email-afaerber@suse.de>
MIME-Version: 1.0
Cc: Peter Maydell <peter.maydell@linaro.org>,
	"open list:X86" <xen-devel@lists.xensource.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	anthony@codemonkey.ws, Igor Mammedov <imammedo@redhat.com>,
	=?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
Subject: [Xen-devel] [PATCH 02/11] Move qemu_irq typedef out of qemu-common.h
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

RnJvbTogSWdvciBNYW1tZWRvdiA8aW1hbW1lZG9AcmVkaGF0LmNvbT4KCkl0J3MgbmVjZXNzYXJ5
IGZvciBtYWtpbmcgQ1BVIGNoaWxkIG9mIERFVklDRSB3aXRob3V0CmNhdXNpbmcgY2lyY3VsYXIg
aGVhZGVyIGRlcHMuCgpTaWduZWQtb2ZmLWJ5OiBJZ29yIE1hbW1lZG92IDxpbWFtbWVkb0ByZWRo
YXQuY29tPgpbZWhhYmtvc3Q6IHJlLWFkZGVkIHRoZSB0eXBlZGVm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y3QgUENJRVBv
cnQgUENJRVBvcnQ7CiB0eXBlZGVmIHN0cnVjdCBQQ0lFU2xvdCBQQ0lFU2xvdDsKIHR5cGVkZWYg
c3RydWN0IE1TSU1lc3NhZ2UgTVNJTWVzc2FnZTsKIHR5cGVkZWYgc3RydWN0IFNlcmlhbFN0YXRl
IFNlcmlhbFN0YXRlOwotdHlwZWRlZiBzdHJ1Y3QgSVJRU3RhdGUgKnFlbXVfaXJxOwogdHlwZWRl
ZiBzdHJ1Y3QgUENNQ0lBQ2FyZFN0YXRlIFBDTUNJQUNhcmRTdGF0ZTsKIHR5cGVkZWYgc3RydWN0
IE1vdXNlVHJhbnNmb3JtSW5mbyBNb3VzZVRyYW5zZm9ybUluZm87CiB0eXBlZGVmIHN0cnVjdCB1
V2lyZVNsYXZlIHVXaXJlU2xhdmU7Ci0tIAoxLjcuMTAuNAoKCl9fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRl
dmVsQGxpc3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Thu Nov 15 03:07:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 03:07:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYpnE-00059A-Kt; Thu, 15 Nov 2012 03:07:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <afaerber@suse.de>) id 1TYpnD-000595-T2
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 03:07:04 +0000
Received: from [85.158.143.99:39813] by server-1.bemta-4.messagelabs.com id
	F6/35-27934-75C54A05; Thu, 15 Nov 2012 03:07:03 +0000
X-Env-Sender: afaerber@suse.de
X-Msg-Ref: server-16.tower-216.messagelabs.com!1352948822!18775142!1
X-Originating-IP: [195.135.220.15]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29008 invoked from network); 15 Nov 2012 03:07:02 -0000
Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15)
	by server-16.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 03:07:02 -0000
Received: from relay2.suse.de (unknown [195.135.220.254])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx2.suse.de (Postfix) with ESMTP id 7F64CA329D;
	Thu, 15 Nov 2012 04:07:00 +0100 (CET)
From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
To: qemu-devel@nongnu.org
Date: Thu, 15 Nov 2012 04:06:38 +0100
Message-Id: <1352948807-30415-3-git-send-email-afaerber@suse.de>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352948807-30415-1-git-send-email-afaerber@suse.de>
References: <1352948807-30415-1-git-send-email-afaerber@suse.de>
MIME-Version: 1.0
Cc: Peter Maydell <peter.maydell@linaro.org>,
	"open list:X86" <xen-devel@lists.xensource.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	anthony@codemonkey.ws, Igor Mammedov <imammedo@redhat.com>,
	=?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
Subject: [Xen-devel] [PATCH 02/11] Move qemu_irq typedef out of qemu-common.h
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

RnJvbTogSWdvciBNYW1tZWRvdiA8aW1hbW1lZG9AcmVkaGF0LmNvbT4KCkl0J3MgbmVjZXNzYXJ5
IGZvciBtYWtpbmcgQ1BVIGNoaWxkIG9mIERFVklDRSB3aXRob3V0CmNhdXNpbmcgY2lyY3VsYXIg
aGVhZGVyIGRlcHMuCgpTaWduZWQtb2ZmLWJ5OiBJZ29yIE1hbW1lZG92IDxpbWFtbWVkb0ByZWRo
YXQuY29tPgpbZWhhYmtvc3Q6IHJlLWFkZGVkIHRoZSB0eXBlZGVmIHRvIGh3L2lycS5oIGFmdGVy
IHJlYmFzaW5nXQpTaWduZWQtb2ZmLWJ5OiBFZHVhcmRvIEhhYmtvc3QgPGVoYWJrb3N0QHJlZGhh
dC5jb20+ClNpZ25lZC1vZmYtYnk6IEFuZHJlYXMgRsOkcmJlciA8YWZhZXJiZXJAc3VzZS5kZT4K
LS0tCiBody9hcm0tbWlzYy5oIHwgICAgMSArCiBody9idC5oICAgICAgIHwgICAgMiArKwogaHcv
ZGV2aWNlcy5oICB8ICAgIDIgKysKIGh3L2lycS5oICAgICAgfCAgICAyICsrCiBody9vbWFwLmgg
ICAgIHwgICAgMSArCiBody9zb2NfZG1hLmggIHwgICAgMSArCiBody94ZW4uaCAgICAgIHwgICAg
MSArCiBxZW11LWNvbW1vbi5oIHwgICAgMSAtCiA4IERhdGVpZW4gZ2XDpG5kZXJ0LCAxMCBaZWls
ZW4gaGluenVnZWbDvGd0KCspLCAxIFplaWxlIGVudGZlcm50KC0pC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Clhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRl
dmVsQGxpc3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Thu Nov 15 07:05:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 07:05:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYtUr-0000WO-Hq; Thu, 15 Nov 2012 07:04:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYtUp-0000WG-PS
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 07:04:19 +0000
Received: from [193.109.254.147:30032] by server-8.bemta-14.messagelabs.com id
	AD/6F-05026-3F394A05; Thu, 15 Nov 2012 07:04:19 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1352963057!3282844!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NDM1NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31892 invoked from network); 15 Nov 2012 07:04:18 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 07:04:18 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF74Da8007223
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 07:04:14 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF74D1d001140
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 07:04:13 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF74CAM028095; Thu, 15 Nov 2012 01:04:12 -0600
Received: from localhost.cn.oracle.com (/10.182.37.205)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 23:04:12 -0800
From: Annie Li <annie.li@oracle.com>
To: xen-devel@lists.xensource.com, netdev@vger.kernel.org,
	konrad.wilk@oracle.com, Ian.Campbell@citrix.com
Date: Thu, 15 Nov 2012 15:03:07 +0800
Message-Id: <1352962987-541-1-git-send-email-annie.li@oracle.com>
X-Mailer: git-send-email 1.7.3.4
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: annie.li@oracle.com
Subject: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch implements persistent grants for xen-netfront/netback. This
mechanism maintains page pools in netback/netfront, these page pools is used to
save grant pages which are mapped. This way improve performance which is wasted
when doing grant operations.

Current netback/netfront does map/unmap grant operations frequently when
transmitting/receiving packets, and grant operations costs much cpu clock. In
this patch, netfront/netback maps grant pages when needed and then saves them
into a page pool for future use. All these pages will be unmapped when
removing/releasing the net device.

In netfront, two pools are maintained for transmitting and receiving packets.
When new grant pages are needed, the driver gets grant pages from this pool
first. If no free grant page exists, it allocates new page, maps it and then
saves it into the pool. The pool size for transmit/receive is exactly tx/rx
ring size. The driver uses memcpy(not grantcopy) to copy data grant pages.
Here, memcpy is copying the whole page size data. I tried to copy len size data
from offset, but network does not seem work well. I am trying to find the root
cause now.

In netback, it also maintains two page pools for tx/rx. When netback gets a
request, it does a search first to find out whether the grant reference of
this request is already mapped into its page pool. If the grant ref is mapped,
the address of this mapped page is gotten and memcpy is used to copy data
between grant pages. However, if the grant ref is not mapped, a new page is
allocated, mapped with this grant ref, and then saved into page pool for
future use. Similarly, memcpy replaces grant copy to copy data between grant
pages. In this implementation, two arrays(gnttab_tx_vif,gnttab_rx_vif) are
used to save vif pointer for every request because current netback is not
per-vif based. This would be changed after implementing 1:1 model in netback.

This patch supports both persistent-grant and non persistent grant. A new
xenstore key "feature-persistent-grants" is used to represent this feature.

This patch is based on linux3.4-rc3. I hit netperf/netserver failure on
linux latest version v3.7-rc1, v3.7-rc2 and v3.7-rc4. Not sure whether this
netperf/netserver failure connects compound page commit in v3.7-rc1, but I did
hit BUG_ON with debug patch from thread
http://lists.xen.org/archives/html/xen-devel/2012-10/msg00893.html


Annie Li (4):
  xen/netback: implements persistent grant with one page pool.
  xen/netback: Split one page pool into two(tx/rx) page pool.
  Xen/netfront: Implement persistent grant in netfront.
  fix code indent issue in xen-netfront.

 drivers/net/xen-netback/common.h    |   24 ++-
 drivers/net/xen-netback/interface.c |   26 +++
 drivers/net/xen-netback/netback.c   |  215 ++++++++++++++++++--
 drivers/net/xen-netback/xenbus.c    |   14 ++-
 drivers/net/xen-netfront.c          |  378 +++++++++++++++++++++++++++++------
 5 files changed, 570 insertions(+), 87 deletions(-)

-- 
1.7.3.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 07:05:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 07:05:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYtUr-0000WO-Hq; Thu, 15 Nov 2012 07:04:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYtUp-0000WG-PS
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 07:04:19 +0000
Received: from [193.109.254.147:30032] by server-8.bemta-14.messagelabs.com id
	AD/6F-05026-3F394A05; Thu, 15 Nov 2012 07:04:19 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1352963057!3282844!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NDM1NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31892 invoked from network); 15 Nov 2012 07:04:18 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 07:04:18 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF74Da8007223
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 07:04:14 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF74D1d001140
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 07:04:13 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF74CAM028095; Thu, 15 Nov 2012 01:04:12 -0600
Received: from localhost.cn.oracle.com (/10.182.37.205)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 23:04:12 -0800
From: Annie Li <annie.li@oracle.com>
To: xen-devel@lists.xensource.com, netdev@vger.kernel.org,
	konrad.wilk@oracle.com, Ian.Campbell@citrix.com
Date: Thu, 15 Nov 2012 15:03:07 +0800
Message-Id: <1352962987-541-1-git-send-email-annie.li@oracle.com>
X-Mailer: git-send-email 1.7.3.4
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: annie.li@oracle.com
Subject: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch implements persistent grants for xen-netfront/netback. This
mechanism maintains page pools in netback/netfront, these page pools is used to
save grant pages which are mapped. This way improve performance which is wasted
when doing grant operations.

Current netback/netfront does map/unmap grant operations frequently when
transmitting/receiving packets, and grant operations costs much cpu clock. In
this patch, netfront/netback maps grant pages when needed and then saves them
into a page pool for future use. All these pages will be unmapped when
removing/releasing the net device.

In netfront, two pools are maintained for transmitting and receiving packets.
When new grant pages are needed, the driver gets grant pages from this pool
first. If no free grant page exists, it allocates new page, maps it and then
saves it into the pool. The pool size for transmit/receive is exactly tx/rx
ring size. The driver uses memcpy(not grantcopy) to copy data grant pages.
Here, memcpy is copying the whole page size data. I tried to copy len size data
from offset, but network does not seem work well. I am trying to find the root
cause now.

In netback, it also maintains two page pools for tx/rx. When netback gets a
request, it does a search first to find out whether the grant reference of
this request is already mapped into its page pool. If the grant ref is mapped,
the address of this mapped page is gotten and memcpy is used to copy data
between grant pages. However, if the grant ref is not mapped, a new page is
allocated, mapped with this grant ref, and then saved into page pool for
future use. Similarly, memcpy replaces grant copy to copy data between grant
pages. In this implementation, two arrays(gnttab_tx_vif,gnttab_rx_vif) are
used to save vif pointer for every request because current netback is not
per-vif based. This would be changed after implementing 1:1 model in netback.

This patch supports both persistent-grant and non persistent grant. A new
xenstore key "feature-persistent-grants" is used to represent this feature.

This patch is based on linux3.4-rc3. I hit netperf/netserver failure on
linux latest version v3.7-rc1, v3.7-rc2 and v3.7-rc4. Not sure whether this
netperf/netserver failure connects compound page commit in v3.7-rc1, but I did
hit BUG_ON with debug patch from thread
http://lists.xen.org/archives/html/xen-devel/2012-10/msg00893.html


Annie Li (4):
  xen/netback: implements persistent grant with one page pool.
  xen/netback: Split one page pool into two(tx/rx) page pool.
  Xen/netfront: Implement persistent grant in netfront.
  fix code indent issue in xen-netfront.

 drivers/net/xen-netback/common.h    |   24 ++-
 drivers/net/xen-netback/interface.c |   26 +++
 drivers/net/xen-netback/netback.c   |  215 ++++++++++++++++++--
 drivers/net/xen-netback/xenbus.c    |   14 ++-
 drivers/net/xen-netfront.c          |  378 +++++++++++++++++++++++++++++------
 5 files changed, 570 insertions(+), 87 deletions(-)

-- 
1.7.3.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 07:06:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 07:06:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYtW7-0000cX-9s; Thu, 15 Nov 2012 07:05:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYtW5-0000cG-BX
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 07:05:37 +0000
Received: from [193.109.254.147:17150] by server-5.bemta-14.messagelabs.com id
	AF/15-10257-04494A05; Thu, 15 Nov 2012 07:05:36 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1352963133!11028434!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTQwMTg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7210 invoked from network); 15 Nov 2012 07:05:35 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-8.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 07:05:35 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF75VBx010649
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 07:05:32 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF75V22003201
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 07:05:31 GMT
Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF75VH3028977; Thu, 15 Nov 2012 01:05:31 -0600
Received: from localhost.cn.oracle.com (/10.182.37.205)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 23:05:31 -0800
From: Annie Li <annie.li@oracle.com>
To: xen-devel@lists.xensource.com, netdev@vger.kernel.org,
	konrad.wilk@oracle.com, Ian.Campbell@citrix.com
Date: Thu, 15 Nov 2012 15:04:26 +0800
Message-Id: <1352963066-570-1-git-send-email-annie.li@oracle.com>
X-Mailer: git-send-email 1.7.3.4
In-Reply-To: <1352962987-541-1-git-send-email-annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: annie.li@oracle.com
Subject: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent grant
	with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch implements persistent grant in netback driver. Tx and rx
share the same page pool, this pool will be split into two parts
in next patch.

Signed-off-by: Annie Li <annie.li@oracle.com>
---
 drivers/net/xen-netback/common.h    |   18 +++-
 drivers/net/xen-netback/interface.c |   22 ++++
 drivers/net/xen-netback/netback.c   |  212 +++++++++++++++++++++++++++++++----
 drivers/net/xen-netback/xenbus.c    |   14 ++-
 4 files changed, 239 insertions(+), 27 deletions(-)

diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
index 94b79c3..a85cac6 100644
--- a/drivers/net/xen-netback/common.h
+++ b/drivers/net/xen-netback/common.h
@@ -45,8 +45,19 @@
 #include <xen/grant_table.h>
 #include <xen/xenbus.h>
 
+#define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE)
+#define XEN_NETIF_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE)
+#define MAXIMUM_OUTSTANDING_BLOCK_REQS \
+			(XEN_NETIF_TX_RING_SIZE + XEN_NETIF_RX_RING_SIZE)
+
 struct xen_netbk;
 
+struct persistent_entry {
+	grant_ref_t forgranted;
+	struct page *fpage;
+	struct gnttab_map_grant_ref map;
+};
+
 struct xenvif {
 	/* Unique identifier for this interface. */
 	domid_t          domid;
@@ -75,6 +86,7 @@ struct xenvif {
 
 	/* Internal feature information. */
 	u8 can_queue:1;	    /* can queue packets for receiver? */
+	u8 persistent_grant:1;
 
 	/*
 	 * Allow xenvif_start_xmit() to peek ahead in the rx request
@@ -98,6 +110,9 @@ struct xenvif {
 	struct net_device *dev;
 
 	wait_queue_head_t waiting_to_free;
+
+	struct persistent_entry *persistent_gnt[MAXIMUM_OUTSTANDING_BLOCK_REQS];
+	unsigned int persistent_gntcnt;
 };
 
 static inline struct xenbus_device *xenvif_to_xenbus_device(struct xenvif *vif)
@@ -105,9 +120,6 @@ static inline struct xenbus_device *xenvif_to_xenbus_device(struct xenvif *vif)
 	return to_xenbus_device(vif->dev->dev.parent);
 }
 
-#define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE)
-#define XEN_NETIF_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE)
-
 struct xenvif *xenvif_alloc(struct device *parent,
 			    domid_t domid,
 			    unsigned int handle);
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
index b7d41f8..226d159 100644
--- a/drivers/net/xen-netback/interface.c
+++ b/drivers/net/xen-netback/interface.c
@@ -300,6 +300,8 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
 		return ERR_PTR(err);
 	}
 
+	vif->persistent_gntcnt = 0;
+
 	netdev_dbg(dev, "Successfully created xenvif\n");
 	return vif;
 }
@@ -343,6 +345,23 @@ err:
 	return err;
 }
 
+void xenvif_free_grants(struct persistent_entry **pers_entry,
+			unsigned int count)
+{
+	int i, ret;
+	struct gnttab_unmap_grant_ref unmap;
+
+	for (i = 0; i < count; i++) {
+		gnttab_set_unmap_op(&unmap,
+			(unsigned long)page_to_pfn(pers_entry[i]->fpage),
+			GNTMAP_host_map,
+			pers_entry[i]->map.handle);
+		ret = gnttab_unmap_refs(&unmap, &pers_entry[i]->fpage,
+					1, false);
+		BUG_ON(ret);
+	}
+}
+
 void xenvif_disconnect(struct xenvif *vif)
 {
 	struct net_device *dev = vif->dev;
@@ -366,6 +385,9 @@ void xenvif_disconnect(struct xenvif *vif)
 	unregister_netdev(vif->dev);
 
 	xen_netbk_unmap_frontend_rings(vif);
+	if (vif->persistent_grant)
+		xenvif_free_grants(vif->persistent_gnt,
+				   vif->persistent_gntcnt);
 
 	free_netdev(vif->dev);
 }
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 2596401..a26d3fc 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -80,6 +80,8 @@ union page_ext {
 	void *mapping;
 };
 
+struct xenvif;
+
 struct xen_netbk {
 	wait_queue_head_t wq;
 	struct task_struct *task;
@@ -102,6 +104,7 @@ struct xen_netbk {
 
 	struct pending_tx_info pending_tx_info[MAX_PENDING_REQS];
 	struct gnttab_copy tx_copy_ops[MAX_PENDING_REQS];
+	struct xenvif *gnttab_tx_vif[MAX_PENDING_REQS];
 
 	u16 pending_ring[MAX_PENDING_REQS];
 
@@ -111,12 +114,139 @@ struct xen_netbk {
 	 * straddles two buffers in the frontend.
 	 */
 	struct gnttab_copy grant_copy_op[2*XEN_NETIF_RX_RING_SIZE];
+	struct xenvif *gnttab_rx_vif[2*XEN_NETIF_RX_RING_SIZE];
 	struct netbk_rx_meta meta[2*XEN_NETIF_RX_RING_SIZE];
 };
 
 static struct xen_netbk *xen_netbk;
 static int xen_netbk_group_nr;
 
+static struct persistent_entry*
+get_per_gnt(struct persistent_entry **pers_entry,
+	    unsigned int count, grant_ref_t gref)
+{
+	int i;
+
+	for (i = 0; i < count; i++)
+		if (gref == pers_entry[i]->forgranted)
+			return pers_entry[i];
+
+	return NULL;
+}
+
+static void*
+map_new_gnt(struct persistent_entry **pers_entry, unsigned int count,
+	    grant_ref_t ref, domid_t domid)
+{
+	struct gnttab_map_grant_ref *map;
+	struct page *page;
+	unsigned long vaddr;
+	unsigned long pfn;
+	uint32_t flags;
+	int ret = 0;
+
+	pers_entry[count] = (struct persistent_entry *)
+			    kmalloc(sizeof(struct persistent_entry),
+				    GFP_KERNEL);
+	if (!pers_entry[count])
+		return ERR_PTR(-ENOMEM);
+
+	map = &pers_entry[count]->map;
+	page = alloc_page(GFP_KERNEL);
+	if (!page) {
+		kfree(pers_entry[count]);
+		pers_entry[count] = NULL;
+		return ERR_PTR(-ENOMEM);
+	}
+
+	pers_entry[count]->fpage = page;
+	pfn = page_to_pfn(page);
+	vaddr = (unsigned long)pfn_to_kaddr(pfn);
+	flags = GNTMAP_host_map;
+
+	gnttab_set_map_op(map, vaddr, flags, ref, domid);
+	ret = gnttab_map_refs(map, NULL, &page, 1);
+	BUG_ON(ret);
+
+	pers_entry[count]->forgranted = ref;
+
+	return page_address(page);
+}
+
+static void*
+get_ref_page(struct persistent_entry **pers_entry, unsigned int *count,
+	     grant_ref_t ref, domid_t domid, unsigned int total)
+{
+	struct persistent_entry *per_gnt;
+	void *vaddr;
+
+	per_gnt = get_per_gnt(pers_entry, *count, ref);
+
+	if (per_gnt != NULL)
+		return page_address(per_gnt->fpage);
+	else {
+		BUG_ON(*count >= total);
+		vaddr = map_new_gnt(pers_entry, *count, ref, domid);
+		if (IS_ERR_OR_NULL(vaddr))
+			return vaddr;
+		*count += 1;
+		return vaddr;
+	}
+}
+
+static int
+grant_memory_copy_op(unsigned int cmd, void *vuop, unsigned int count,
+		     struct xen_netbk *netbk, bool tx_pool)
+{
+	int i;
+	struct xenvif *vif;
+	struct gnttab_copy *uop = vuop;
+	unsigned int *gnt_count;
+	unsigned int gnt_total;
+	struct persistent_entry **pers_entry;
+	int ret = 0;
+
+	BUG_ON(cmd != GNTTABOP_copy);
+	for (i = 0; i < count; i++) {
+		if (tx_pool)
+			vif = netbk->gnttab_tx_vif[i];
+		else
+			vif = netbk->gnttab_rx_vif[i];
+
+		pers_entry = vif->persistent_gnt;
+		gnt_count = &vif->persistent_gntcnt;
+		gnt_total = MAXIMUM_OUTSTANDING_BLOCK_REQS;
+
+		if (vif->persistent_grant) {
+			void *saddr, *daddr;
+
+			saddr = uop[i].source.domid == DOMID_SELF ?
+				(void *) uop[i].source.u.gmfn :
+				get_ref_page(pers_entry, gnt_count,
+					     uop[i].source.u.ref,
+					     uop[i].source.domid,
+					     gnt_total);
+			if (IS_ERR_OR_NULL(saddr))
+				return -ENOMEM;
+
+			daddr = uop[i].dest.domid == DOMID_SELF ?
+				(void *) uop[i].dest.u.gmfn :
+				get_ref_page(pers_entry, gnt_count,
+					     uop[i].dest.u.ref,
+					     uop[i].dest.domid,
+					     gnt_total);
+			if (IS_ERR_OR_NULL(daddr))
+				return -ENOMEM;
+
+			memcpy(daddr+uop[i].dest.offset,
+			       saddr+uop[i].source.offset, uop[i].len);
+		} else
+			ret = HYPERVISOR_grant_table_op(cmd, &uop[i], 1);
+	}
+
+	return ret;
+}
+
 void xen_netbk_add_xenvif(struct xenvif *vif)
 {
 	int i;
@@ -387,13 +517,15 @@ static struct netbk_rx_meta *get_next_rx_buffer(struct xenvif *vif,
  * Set up the grant operations for this fragment. If it's a flipping
  * interface, we also set up the unmap request from here.
  */
-static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
-				struct netrx_pending_operations *npo,
-				struct page *page, unsigned long size,
-				unsigned long offset, int *head)
+static int netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
+			       struct netrx_pending_operations *npo,
+			       struct page *page, unsigned long size,
+			       unsigned long offset, int *head,
+			       struct xenvif **grxvif)
 {
 	struct gnttab_copy *copy_gop;
 	struct netbk_rx_meta *meta;
+	int count = 0;
 	/*
 	 * These variables are used iff get_page_ext returns true,
 	 * in which case they are guaranteed to be initialized.
@@ -425,6 +557,10 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
 			bytes = MAX_BUFFER_OFFSET - npo->copy_off;
 
 		copy_gop = npo->copy + npo->copy_prod++;
+		*grxvif = vif;
+		grxvif++;
+		count++;
+
 		copy_gop->flags = GNTCOPY_dest_gref;
 		if (foreign) {
 			struct xen_netbk *netbk = &xen_netbk[group];
@@ -438,7 +574,10 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
 		} else {
 			void *vaddr = page_address(page);
 			copy_gop->source.domid = DOMID_SELF;
-			copy_gop->source.u.gmfn = virt_to_mfn(vaddr);
+			if (!vif->persistent_grant)
+				copy_gop->source.u.gmfn = virt_to_mfn(vaddr);
+			else
+				copy_gop->source.u.gmfn = (unsigned long)vaddr;
 		}
 		copy_gop->source.offset = offset;
 		copy_gop->dest.domid = vif->domid;
@@ -460,6 +599,7 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
 		*head = 0; /* There must be something in this buffer now. */
 
 	}
+	return count;
 }
 
 /*
@@ -474,8 +614,10 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
  * zero GSO descriptors (for non-GSO packets) or one descriptor (for
  * frontend-side LRO).
  */
-static int netbk_gop_skb(struct sk_buff *skb,
-			 struct netrx_pending_operations *npo)
+static int netbk_gop_skb(struct xen_netbk *netbk,
+			 struct sk_buff *skb,
+			 struct netrx_pending_operations *npo,
+			 struct xenvif **grxvif)
 {
 	struct xenvif *vif = netdev_priv(skb->dev);
 	int nr_frags = skb_shinfo(skb)->nr_frags;
@@ -518,17 +660,19 @@ static int netbk_gop_skb(struct sk_buff *skb,
 		if (data + len > skb_tail_pointer(skb))
 			len = skb_tail_pointer(skb) - data;
 
-		netbk_gop_frag_copy(vif, skb, npo,
-				    virt_to_page(data), len, offset, &head);
+		grxvif += netbk_gop_frag_copy(vif, skb, npo,
+					      virt_to_page(data), len,
+					      offset, &head, grxvif);
+
 		data += len;
 	}
 
 	for (i = 0; i < nr_frags; i++) {
-		netbk_gop_frag_copy(vif, skb, npo,
-				    skb_frag_page(&skb_shinfo(skb)->frags[i]),
-				    skb_frag_size(&skb_shinfo(skb)->frags[i]),
-				    skb_shinfo(skb)->frags[i].page_offset,
-				    &head);
+		grxvif += netbk_gop_frag_copy(vif, skb, npo,
+				skb_frag_page(&skb_shinfo(skb)->frags[i]),
+				skb_frag_size(&skb_shinfo(skb)->frags[i]),
+				skb_shinfo(skb)->frags[i].page_offset,
+				&head, grxvif);
 	}
 
 	return npo->meta_prod - old_meta_prod;
@@ -593,6 +737,8 @@ struct skb_cb_overlay {
 static void xen_netbk_rx_action(struct xen_netbk *netbk)
 {
 	struct xenvif *vif = NULL, *tmp;
+	struct xenvif **grxvif = netbk->gnttab_rx_vif;
+	int old_copy_prod = 0;
 	s8 status;
 	u16 irq, flags;
 	struct xen_netif_rx_response *resp;
@@ -619,7 +765,9 @@ static void xen_netbk_rx_action(struct xen_netbk *netbk)
 		nr_frags = skb_shinfo(skb)->nr_frags;
 
 		sco = (struct skb_cb_overlay *)skb->cb;
-		sco->meta_slots_used = netbk_gop_skb(skb, &npo);
+		sco->meta_slots_used = netbk_gop_skb(netbk, skb, &npo, grxvif);
+		grxvif += npo.copy_prod - old_copy_prod;
+		old_copy_prod = npo.copy_prod;
 
 		count += nr_frags + 1;
 
@@ -636,8 +784,10 @@ static void xen_netbk_rx_action(struct xen_netbk *netbk)
 		return;
 
 	BUG_ON(npo.copy_prod > ARRAY_SIZE(netbk->grant_copy_op));
-	ret = HYPERVISOR_grant_table_op(GNTTABOP_copy, &netbk->grant_copy_op,
-					npo.copy_prod);
+	ret = grant_memory_copy_op(GNTTABOP_copy,
+				   &netbk->grant_copy_op,
+				   npo.copy_prod, netbk,
+				   false);
 	BUG_ON(ret != 0);
 
 	while ((skb = __skb_dequeue(&rxq)) != NULL) {
@@ -918,7 +1068,8 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk,
 						  struct xenvif *vif,
 						  struct sk_buff *skb,
 						  struct xen_netif_tx_request *txp,
-						  struct gnttab_copy *gop)
+						  struct gnttab_copy *gop,
+						  struct xenvif **gtxvif)
 {
 	struct skb_shared_info *shinfo = skb_shinfo(skb);
 	skb_frag_t *frags = shinfo->frags;
@@ -944,7 +1095,11 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk,
 		gop->source.domid = vif->domid;
 		gop->source.offset = txp->offset;
 
-		gop->dest.u.gmfn = virt_to_mfn(page_address(page));
+		if (!vif->persistent_grant)
+			gop->dest.u.gmfn = virt_to_mfn(page_address(page));
+		else
+			gop->dest.u.gmfn = (unsigned long)page_address(page);
+
 		gop->dest.domid = DOMID_SELF;
 		gop->dest.offset = txp->offset;
 
@@ -952,6 +1107,9 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk,
 		gop->flags = GNTCOPY_source_gref;
 
 		gop++;
+		*gtxvif = vif;
+		gtxvif++;
+
 
 		memcpy(&pending_tx_info[pending_idx].req, txp, sizeof(*txp));
 		xenvif_get(vif);
@@ -1218,6 +1376,7 @@ static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
 static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
 {
 	struct gnttab_copy *gop = netbk->tx_copy_ops, *request_gop;
+	struct xenvif **gtxvif = netbk->gnttab_tx_vif;
 	struct sk_buff *skb;
 	int ret;
 
@@ -1338,7 +1497,11 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
 		gop->source.domid = vif->domid;
 		gop->source.offset = txreq.offset;
 
-		gop->dest.u.gmfn = virt_to_mfn(page_address(page));
+		if (!vif->persistent_grant)
+			gop->dest.u.gmfn = virt_to_mfn(page_address(page));
+		else
+			gop->dest.u.gmfn = (unsigned long)page_address(page);
+
 		gop->dest.domid = DOMID_SELF;
 		gop->dest.offset = txreq.offset;
 
@@ -1346,6 +1509,7 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
 		gop->flags = GNTCOPY_source_gref;
 
 		gop++;
+		*gtxvif++ = vif;
 
 		memcpy(&netbk->pending_tx_info[pending_idx].req,
 		       &txreq, sizeof(txreq));
@@ -1369,12 +1533,13 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
 		netbk->pending_cons++;
 
 		request_gop = xen_netbk_get_requests(netbk, vif,
-						     skb, txfrags, gop);
+						     skb, txfrags, gop, gtxvif);
 		if (request_gop == NULL) {
 			kfree_skb(skb);
 			netbk_tx_err(vif, &txreq, idx);
 			continue;
 		}
+		gtxvif += request_gop - gop;
 		gop = request_gop;
 
 		vif->tx.req_cons = idx;
@@ -1467,8 +1632,9 @@ static void xen_netbk_tx_action(struct xen_netbk *netbk)
 
 	if (nr_gops == 0)
 		return;
-	ret = HYPERVISOR_grant_table_op(GNTTABOP_copy,
-					netbk->tx_copy_ops, nr_gops);
+	ret = grant_memory_copy_op(GNTTABOP_copy,
+				   netbk->tx_copy_ops, nr_gops,
+				   netbk, true);
 	BUG_ON(ret);
 
 	xen_netbk_tx_submit(netbk);
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index 410018c..938e908 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -114,6 +114,13 @@ static int netback_probe(struct xenbus_device *dev,
 			goto abort_transaction;
 		}
 
+		err = xenbus_printf(xbt, dev->nodename,
+				    "feature-persistent-grants", "%u", 1);
+		if (err) {
+			message = "writing feature-persistent-grants";
+			goto abort_transaction;
+		}
+
 		err = xenbus_transaction_end(xbt, 0);
 	} while (err == -EAGAIN);
 
@@ -453,7 +460,12 @@ static int connect_rings(struct backend_info *be)
 		val = 0;
 	vif->csum = !val;
 
-	/* Map the shared frame, irq etc. */
+	if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-persistent-grants",
+			 "%u", &val) < 0)
+		val = 0;
+	vif->persistent_grant = !!val;
+
+/* Map the shared frame, irq etc. */
 	err = xenvif_connect(vif, tx_ring_ref, rx_ring_ref, evtchn);
 	if (err) {
 		xenbus_dev_fatal(dev, err,
-- 
1.7.3.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 07:06:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 07:06:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYtW7-0000cX-9s; Thu, 15 Nov 2012 07:05:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYtW5-0000cG-BX
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 07:05:37 +0000
Received: from [193.109.254.147:17150] by server-5.bemta-14.messagelabs.com id
	AF/15-10257-04494A05; Thu, 15 Nov 2012 07:05:36 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1352963133!11028434!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTQwMTg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7210 invoked from network); 15 Nov 2012 07:05:35 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-8.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 07:05:35 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF75VBx010649
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 07:05:32 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF75V22003201
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 07:05:31 GMT
Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF75VH3028977; Thu, 15 Nov 2012 01:05:31 -0600
Received: from localhost.cn.oracle.com (/10.182.37.205)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 23:05:31 -0800
From: Annie Li <annie.li@oracle.com>
To: xen-devel@lists.xensource.com, netdev@vger.kernel.org,
	konrad.wilk@oracle.com, Ian.Campbell@citrix.com
Date: Thu, 15 Nov 2012 15:04:26 +0800
Message-Id: <1352963066-570-1-git-send-email-annie.li@oracle.com>
X-Mailer: git-send-email 1.7.3.4
In-Reply-To: <1352962987-541-1-git-send-email-annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: annie.li@oracle.com
Subject: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent grant
	with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch implements persistent grant in netback driver. Tx and rx
share the same page pool, this pool will be split into two parts
in next patch.

Signed-off-by: Annie Li <annie.li@oracle.com>
---
 drivers/net/xen-netback/common.h    |   18 +++-
 drivers/net/xen-netback/interface.c |   22 ++++
 drivers/net/xen-netback/netback.c   |  212 +++++++++++++++++++++++++++++++----
 drivers/net/xen-netback/xenbus.c    |   14 ++-
 4 files changed, 239 insertions(+), 27 deletions(-)

diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
index 94b79c3..a85cac6 100644
--- a/drivers/net/xen-netback/common.h
+++ b/drivers/net/xen-netback/common.h
@@ -45,8 +45,19 @@
 #include <xen/grant_table.h>
 #include <xen/xenbus.h>
 
+#define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE)
+#define XEN_NETIF_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE)
+#define MAXIMUM_OUTSTANDING_BLOCK_REQS \
+			(XEN_NETIF_TX_RING_SIZE + XEN_NETIF_RX_RING_SIZE)
+
 struct xen_netbk;
 
+struct persistent_entry {
+	grant_ref_t forgranted;
+	struct page *fpage;
+	struct gnttab_map_grant_ref map;
+};
+
 struct xenvif {
 	/* Unique identifier for this interface. */
 	domid_t          domid;
@@ -75,6 +86,7 @@ struct xenvif {
 
 	/* Internal feature information. */
 	u8 can_queue:1;	    /* can queue packets for receiver? */
+	u8 persistent_grant:1;
 
 	/*
 	 * Allow xenvif_start_xmit() to peek ahead in the rx request
@@ -98,6 +110,9 @@ struct xenvif {
 	struct net_device *dev;
 
 	wait_queue_head_t waiting_to_free;
+
+	struct persistent_entry *persistent_gnt[MAXIMUM_OUTSTANDING_BLOCK_REQS];
+	unsigned int persistent_gntcnt;
 };
 
 static inline struct xenbus_device *xenvif_to_xenbus_device(struct xenvif *vif)
@@ -105,9 +120,6 @@ static inline struct xenbus_device *xenvif_to_xenbus_device(struct xenvif *vif)
 	return to_xenbus_device(vif->dev->dev.parent);
 }
 
-#define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE)
-#define XEN_NETIF_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE)
-
 struct xenvif *xenvif_alloc(struct device *parent,
 			    domid_t domid,
 			    unsigned int handle);
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
index b7d41f8..226d159 100644
--- a/drivers/net/xen-netback/interface.c
+++ b/drivers/net/xen-netback/interface.c
@@ -300,6 +300,8 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
 		return ERR_PTR(err);
 	}
 
+	vif->persistent_gntcnt = 0;
+
 	netdev_dbg(dev, "Successfully created xenvif\n");
 	return vif;
 }
@@ -343,6 +345,23 @@ err:
 	return err;
 }
 
+void xenvif_free_grants(struct persistent_entry **pers_entry,
+			unsigned int count)
+{
+	int i, ret;
+	struct gnttab_unmap_grant_ref unmap;
+
+	for (i = 0; i < count; i++) {
+		gnttab_set_unmap_op(&unmap,
+			(unsigned long)page_to_pfn(pers_entry[i]->fpage),
+			GNTMAP_host_map,
+			pers_entry[i]->map.handle);
+		ret = gnttab_unmap_refs(&unmap, &pers_entry[i]->fpage,
+					1, false);
+		BUG_ON(ret);
+	}
+}
+
 void xenvif_disconnect(struct xenvif *vif)
 {
 	struct net_device *dev = vif->dev;
@@ -366,6 +385,9 @@ void xenvif_disconnect(struct xenvif *vif)
 	unregister_netdev(vif->dev);
 
 	xen_netbk_unmap_frontend_rings(vif);
+	if (vif->persistent_grant)
+		xenvif_free_grants(vif->persistent_gnt,
+				   vif->persistent_gntcnt);
 
 	free_netdev(vif->dev);
 }
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 2596401..a26d3fc 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -80,6 +80,8 @@ union page_ext {
 	void *mapping;
 };
 
+struct xenvif;
+
 struct xen_netbk {
 	wait_queue_head_t wq;
 	struct task_struct *task;
@@ -102,6 +104,7 @@ struct xen_netbk {
 
 	struct pending_tx_info pending_tx_info[MAX_PENDING_REQS];
 	struct gnttab_copy tx_copy_ops[MAX_PENDING_REQS];
+	struct xenvif *gnttab_tx_vif[MAX_PENDING_REQS];
 
 	u16 pending_ring[MAX_PENDING_REQS];
 
@@ -111,12 +114,139 @@ struct xen_netbk {
 	 * straddles two buffers in the frontend.
 	 */
 	struct gnttab_copy grant_copy_op[2*XEN_NETIF_RX_RING_SIZE];
+	struct xenvif *gnttab_rx_vif[2*XEN_NETIF_RX_RING_SIZE];
 	struct netbk_rx_meta meta[2*XEN_NETIF_RX_RING_SIZE];
 };
 
 static struct xen_netbk *xen_netbk;
 static int xen_netbk_group_nr;
 
+static struct persistent_entry*
+get_per_gnt(struct persistent_entry **pers_entry,
+	    unsigned int count, grant_ref_t gref)
+{
+	int i;
+
+	for (i = 0; i < count; i++)
+		if (gref == pers_entry[i]->forgranted)
+			return pers_entry[i];
+
+	return NULL;
+}
+
+static void*
+map_new_gnt(struct persistent_entry **pers_entry, unsigned int count,
+	    grant_ref_t ref, domid_t domid)
+{
+	struct gnttab_map_grant_ref *map;
+	struct page *page;
+	unsigned long vaddr;
+	unsigned long pfn;
+	uint32_t flags;
+	int ret = 0;
+
+	pers_entry[count] = (struct persistent_entry *)
+			    kmalloc(sizeof(struct persistent_entry),
+				    GFP_KERNEL);
+	if (!pers_entry[count])
+		return ERR_PTR(-ENOMEM);
+
+	map = &pers_entry[count]->map;
+	page = alloc_page(GFP_KERNEL);
+	if (!page) {
+		kfree(pers_entry[count]);
+		pers_entry[count] = NULL;
+		return ERR_PTR(-ENOMEM);
+	}
+
+	pers_entry[count]->fpage = page;
+	pfn = page_to_pfn(page);
+	vaddr = (unsigned long)pfn_to_kaddr(pfn);
+	flags = GNTMAP_host_map;
+
+	gnttab_set_map_op(map, vaddr, flags, ref, domid);
+	ret = gnttab_map_refs(map, NULL, &page, 1);
+	BUG_ON(ret);
+
+	pers_entry[count]->forgranted = ref;
+
+	return page_address(page);
+}
+
+static void*
+get_ref_page(struct persistent_entry **pers_entry, unsigned int *count,
+	     grant_ref_t ref, domid_t domid, unsigned int total)
+{
+	struct persistent_entry *per_gnt;
+	void *vaddr;
+
+	per_gnt = get_per_gnt(pers_entry, *count, ref);
+
+	if (per_gnt != NULL)
+		return page_address(per_gnt->fpage);
+	else {
+		BUG_ON(*count >= total);
+		vaddr = map_new_gnt(pers_entry, *count, ref, domid);
+		if (IS_ERR_OR_NULL(vaddr))
+			return vaddr;
+		*count += 1;
+		return vaddr;
+	}
+}
+
+static int
+grant_memory_copy_op(unsigned int cmd, void *vuop, unsigned int count,
+		     struct xen_netbk *netbk, bool tx_pool)
+{
+	int i;
+	struct xenvif *vif;
+	struct gnttab_copy *uop = vuop;
+	unsigned int *gnt_count;
+	unsigned int gnt_total;
+	struct persistent_entry **pers_entry;
+	int ret = 0;
+
+	BUG_ON(cmd != GNTTABOP_copy);
+	for (i = 0; i < count; i++) {
+		if (tx_pool)
+			vif = netbk->gnttab_tx_vif[i];
+		else
+			vif = netbk->gnttab_rx_vif[i];
+
+		pers_entry = vif->persistent_gnt;
+		gnt_count = &vif->persistent_gntcnt;
+		gnt_total = MAXIMUM_OUTSTANDING_BLOCK_REQS;
+
+		if (vif->persistent_grant) {
+			void *saddr, *daddr;
+
+			saddr = uop[i].source.domid == DOMID_SELF ?
+				(void *) uop[i].source.u.gmfn :
+				get_ref_page(pers_entry, gnt_count,
+					     uop[i].source.u.ref,
+					     uop[i].source.domid,
+					     gnt_total);
+			if (IS_ERR_OR_NULL(saddr))
+				return -ENOMEM;
+
+			daddr = uop[i].dest.domid == DOMID_SELF ?
+				(void *) uop[i].dest.u.gmfn :
+				get_ref_page(pers_entry, gnt_count,
+					     uop[i].dest.u.ref,
+					     uop[i].dest.domid,
+					     gnt_total);
+			if (IS_ERR_OR_NULL(daddr))
+				return -ENOMEM;
+
+			memcpy(daddr+uop[i].dest.offset,
+			       saddr+uop[i].source.offset, uop[i].len);
+		} else
+			ret = HYPERVISOR_grant_table_op(cmd, &uop[i], 1);
+	}
+
+	return ret;
+}
+
 void xen_netbk_add_xenvif(struct xenvif *vif)
 {
 	int i;
@@ -387,13 +517,15 @@ static struct netbk_rx_meta *get_next_rx_buffer(struct xenvif *vif,
  * Set up the grant operations for this fragment. If it's a flipping
  * interface, we also set up the unmap request from here.
  */
-static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
-				struct netrx_pending_operations *npo,
-				struct page *page, unsigned long size,
-				unsigned long offset, int *head)
+static int netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
+			       struct netrx_pending_operations *npo,
+			       struct page *page, unsigned long size,
+			       unsigned long offset, int *head,
+			       struct xenvif **grxvif)
 {
 	struct gnttab_copy *copy_gop;
 	struct netbk_rx_meta *meta;
+	int count = 0;
 	/*
 	 * These variables are used iff get_page_ext returns true,
 	 * in which case they are guaranteed to be initialized.
@@ -425,6 +557,10 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
 			bytes = MAX_BUFFER_OFFSET - npo->copy_off;
 
 		copy_gop = npo->copy + npo->copy_prod++;
+		*grxvif = vif;
+		grxvif++;
+		count++;
+
 		copy_gop->flags = GNTCOPY_dest_gref;
 		if (foreign) {
 			struct xen_netbk *netbk = &xen_netbk[group];
@@ -438,7 +574,10 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
 		} else {
 			void *vaddr = page_address(page);
 			copy_gop->source.domid = DOMID_SELF;
-			copy_gop->source.u.gmfn = virt_to_mfn(vaddr);
+			if (!vif->persistent_grant)
+				copy_gop->source.u.gmfn = virt_to_mfn(vaddr);
+			else
+				copy_gop->source.u.gmfn = (unsigned long)vaddr;
 		}
 		copy_gop->source.offset = offset;
 		copy_gop->dest.domid = vif->domid;
@@ -460,6 +599,7 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
 		*head = 0; /* There must be something in this buffer now. */
 
 	}
+	return count;
 }
 
 /*
@@ -474,8 +614,10 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
  * zero GSO descriptors (for non-GSO packets) or one descriptor (for
  * frontend-side LRO).
  */
-static int netbk_gop_skb(struct sk_buff *skb,
-			 struct netrx_pending_operations *npo)
+static int netbk_gop_skb(struct xen_netbk *netbk,
+			 struct sk_buff *skb,
+			 struct netrx_pending_operations *npo,
+			 struct xenvif **grxvif)
 {
 	struct xenvif *vif = netdev_priv(skb->dev);
 	int nr_frags = skb_shinfo(skb)->nr_frags;
@@ -518,17 +660,19 @@ static int netbk_gop_skb(struct sk_buff *skb,
 		if (data + len > skb_tail_pointer(skb))
 			len = skb_tail_pointer(skb) - data;
 
-		netbk_gop_frag_copy(vif, skb, npo,
-				    virt_to_page(data), len, offset, &head);
+		grxvif += netbk_gop_frag_copy(vif, skb, npo,
+					      virt_to_page(data), len,
+					      offset, &head, grxvif);
+
 		data += len;
 	}
 
 	for (i = 0; i < nr_frags; i++) {
-		netbk_gop_frag_copy(vif, skb, npo,
-				    skb_frag_page(&skb_shinfo(skb)->frags[i]),
-				    skb_frag_size(&skb_shinfo(skb)->frags[i]),
-				    skb_shinfo(skb)->frags[i].page_offset,
-				    &head);
+		grxvif += netbk_gop_frag_copy(vif, skb, npo,
+				skb_frag_page(&skb_shinfo(skb)->frags[i]),
+				skb_frag_size(&skb_shinfo(skb)->frags[i]),
+				skb_shinfo(skb)->frags[i].page_offset,
+				&head, grxvif);
 	}
 
 	return npo->meta_prod - old_meta_prod;
@@ -593,6 +737,8 @@ struct skb_cb_overlay {
 static void xen_netbk_rx_action(struct xen_netbk *netbk)
 {
 	struct xenvif *vif = NULL, *tmp;
+	struct xenvif **grxvif = netbk->gnttab_rx_vif;
+	int old_copy_prod = 0;
 	s8 status;
 	u16 irq, flags;
 	struct xen_netif_rx_response *resp;
@@ -619,7 +765,9 @@ static void xen_netbk_rx_action(struct xen_netbk *netbk)
 		nr_frags = skb_shinfo(skb)->nr_frags;
 
 		sco = (struct skb_cb_overlay *)skb->cb;
-		sco->meta_slots_used = netbk_gop_skb(skb, &npo);
+		sco->meta_slots_used = netbk_gop_skb(netbk, skb, &npo, grxvif);
+		grxvif += npo.copy_prod - old_copy_prod;
+		old_copy_prod = npo.copy_prod;
 
 		count += nr_frags + 1;
 
@@ -636,8 +784,10 @@ static void xen_netbk_rx_action(struct xen_netbk *netbk)
 		return;
 
 	BUG_ON(npo.copy_prod > ARRAY_SIZE(netbk->grant_copy_op));
-	ret = HYPERVISOR_grant_table_op(GNTTABOP_copy, &netbk->grant_copy_op,
-					npo.copy_prod);
+	ret = grant_memory_copy_op(GNTTABOP_copy,
+				   &netbk->grant_copy_op,
+				   npo.copy_prod, netbk,
+				   false);
 	BUG_ON(ret != 0);
 
 	while ((skb = __skb_dequeue(&rxq)) != NULL) {
@@ -918,7 +1068,8 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk,
 						  struct xenvif *vif,
 						  struct sk_buff *skb,
 						  struct xen_netif_tx_request *txp,
-						  struct gnttab_copy *gop)
+						  struct gnttab_copy *gop,
+						  struct xenvif **gtxvif)
 {
 	struct skb_shared_info *shinfo = skb_shinfo(skb);
 	skb_frag_t *frags = shinfo->frags;
@@ -944,7 +1095,11 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk,
 		gop->source.domid = vif->domid;
 		gop->source.offset = txp->offset;
 
-		gop->dest.u.gmfn = virt_to_mfn(page_address(page));
+		if (!vif->persistent_grant)
+			gop->dest.u.gmfn = virt_to_mfn(page_address(page));
+		else
+			gop->dest.u.gmfn = (unsigned long)page_address(page);
+
 		gop->dest.domid = DOMID_SELF;
 		gop->dest.offset = txp->offset;
 
@@ -952,6 +1107,9 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk,
 		gop->flags = GNTCOPY_source_gref;
 
 		gop++;
+		*gtxvif = vif;
+		gtxvif++;
+
 
 		memcpy(&pending_tx_info[pending_idx].req, txp, sizeof(*txp));
 		xenvif_get(vif);
@@ -1218,6 +1376,7 @@ static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
 static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
 {
 	struct gnttab_copy *gop = netbk->tx_copy_ops, *request_gop;
+	struct xenvif **gtxvif = netbk->gnttab_tx_vif;
 	struct sk_buff *skb;
 	int ret;
 
@@ -1338,7 +1497,11 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
 		gop->source.domid = vif->domid;
 		gop->source.offset = txreq.offset;
 
-		gop->dest.u.gmfn = virt_to_mfn(page_address(page));
+		if (!vif->persistent_grant)
+			gop->dest.u.gmfn = virt_to_mfn(page_address(page));
+		else
+			gop->dest.u.gmfn = (unsigned long)page_address(page);
+
 		gop->dest.domid = DOMID_SELF;
 		gop->dest.offset = txreq.offset;
 
@@ -1346,6 +1509,7 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
 		gop->flags = GNTCOPY_source_gref;
 
 		gop++;
+		*gtxvif++ = vif;
 
 		memcpy(&netbk->pending_tx_info[pending_idx].req,
 		       &txreq, sizeof(txreq));
@@ -1369,12 +1533,13 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
 		netbk->pending_cons++;
 
 		request_gop = xen_netbk_get_requests(netbk, vif,
-						     skb, txfrags, gop);
+						     skb, txfrags, gop, gtxvif);
 		if (request_gop == NULL) {
 			kfree_skb(skb);
 			netbk_tx_err(vif, &txreq, idx);
 			continue;
 		}
+		gtxvif += request_gop - gop;
 		gop = request_gop;
 
 		vif->tx.req_cons = idx;
@@ -1467,8 +1632,9 @@ static void xen_netbk_tx_action(struct xen_netbk *netbk)
 
 	if (nr_gops == 0)
 		return;
-	ret = HYPERVISOR_grant_table_op(GNTTABOP_copy,
-					netbk->tx_copy_ops, nr_gops);
+	ret = grant_memory_copy_op(GNTTABOP_copy,
+				   netbk->tx_copy_ops, nr_gops,
+				   netbk, true);
 	BUG_ON(ret);
 
 	xen_netbk_tx_submit(netbk);
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index 410018c..938e908 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -114,6 +114,13 @@ static int netback_probe(struct xenbus_device *dev,
 			goto abort_transaction;
 		}
 
+		err = xenbus_printf(xbt, dev->nodename,
+				    "feature-persistent-grants", "%u", 1);
+		if (err) {
+			message = "writing feature-persistent-grants";
+			goto abort_transaction;
+		}
+
 		err = xenbus_transaction_end(xbt, 0);
 	} while (err == -EAGAIN);
 
@@ -453,7 +460,12 @@ static int connect_rings(struct backend_info *be)
 		val = 0;
 	vif->csum = !val;
 
-	/* Map the shared frame, irq etc. */
+	if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-persistent-grants",
+			 "%u", &val) < 0)
+		val = 0;
+	vif->persistent_grant = !!val;
+
+/* Map the shared frame, irq etc. */
 	err = xenvif_connect(vif, tx_ring_ref, rx_ring_ref, evtchn);
 	if (err) {
 		xenbus_dev_fatal(dev, err,
-- 
1.7.3.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 07:06:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 07:06:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYtWV-0000f3-OO; Thu, 15 Nov 2012 07:06:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYtWU-0000em-05
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 07:06:02 +0000
Received: from [85.158.143.35:54302] by server-1.bemta-4.messagelabs.com id
	46/4E-27934-95494A05; Thu, 15 Nov 2012 07:06:01 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1352963159!17766159!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NDM1NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27046 invoked from network); 15 Nov 2012 07:06:00 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-6.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 07:06:00 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF75u2c008507
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 07:05:57 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF75tGQ003731
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 07:05:56 GMT
Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF75tuE027910; Thu, 15 Nov 2012 01:05:55 -0600
Received: from localhost.cn.oracle.com (/10.182.37.205)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 23:05:55 -0800
From: Annie Li <annie.li@oracle.com>
To: xen-devel@lists.xensource.com, netdev@vger.kernel.org,
	konrad.wilk@oracle.com, Ian.Campbell@citrix.com
Date: Thu, 15 Nov 2012 15:04:49 +0800
Message-Id: <1352963089-599-1-git-send-email-annie.li@oracle.com>
X-Mailer: git-send-email 1.7.3.4
In-Reply-To: <1352962987-541-1-git-send-email-annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: annie.li@oracle.com
Subject: [Xen-devel] [PATCH 2/4] xen/netback: Split one page pool into
	two(tx/rx) page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

For tx path, this implementation simplifies the work of searching out
grant page from page pool based on grant reference.

Signed-off-by: Annie Li <annie.li@oracle.com>
---
 drivers/net/xen-netback/common.h    |   14 ++++++++++----
 drivers/net/xen-netback/interface.c |   12 ++++++++----
 drivers/net/xen-netback/netback.c   |   15 +++++++++------
 3 files changed, 27 insertions(+), 14 deletions(-)

diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
index a85cac6..02c8573 100644
--- a/drivers/net/xen-netback/common.h
+++ b/drivers/net/xen-netback/common.h
@@ -47,8 +47,6 @@
 
 #define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE)
 #define XEN_NETIF_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE)
-#define MAXIMUM_OUTSTANDING_BLOCK_REQS \
-			(XEN_NETIF_TX_RING_SIZE + XEN_NETIF_RX_RING_SIZE)
 
 struct xen_netbk;
 
@@ -111,8 +109,16 @@ struct xenvif {
 
 	wait_queue_head_t waiting_to_free;
 
-	struct persistent_entry *persistent_gnt[MAXIMUM_OUTSTANDING_BLOCK_REQS];
-	unsigned int persistent_gntcnt;
+	struct persistent_entry *persistent_tx_gnt[XEN_NETIF_TX_RING_SIZE];
+
+	/*
+	 * 2*XEN_NETIF_RX_RING_SIZE is for the case of each head/fragment page
+	 * using 2 copy operations.
+	 */
+	struct persistent_entry *persistent_rx_gnt[2*XEN_NETIF_RX_RING_SIZE];
+
+	unsigned int persistent_tx_gntcnt;
+	unsigned int persistent_rx_gntcnt;
 };
 
 static inline struct xenbus_device *xenvif_to_xenbus_device(struct xenvif *vif)
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
index 226d159..ecbe116 100644
--- a/drivers/net/xen-netback/interface.c
+++ b/drivers/net/xen-netback/interface.c
@@ -300,7 +300,8 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
 		return ERR_PTR(err);
 	}
 
-	vif->persistent_gntcnt = 0;
+	vif->persistent_tx_gntcnt = 0;
+	vif->persistent_rx_gntcnt = 0;
 
 	netdev_dbg(dev, "Successfully created xenvif\n");
 	return vif;
@@ -385,9 +386,12 @@ void xenvif_disconnect(struct xenvif *vif)
 	unregister_netdev(vif->dev);
 
 	xen_netbk_unmap_frontend_rings(vif);
-	if (vif->persistent_grant)
-		xenvif_free_grants(vif->persistent_gnt,
-				   vif->persistent_gntcnt);
+	if (vif->persistent_grant) {
+		xenvif_free_grants(vif->persistent_tx_gnt,
+				   vif->persistent_tx_gntcnt);
+		xenvif_free_grants(vif->persistent_rx_gnt,
+				   vif->persistent_rx_gntcnt);
+	}
 
 	free_netdev(vif->dev);
 }
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index a26d3fc..ec59c73 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -208,14 +208,17 @@ grant_memory_copy_op(unsigned int cmd, void *vuop, unsigned int count,
 
 	BUG_ON(cmd != GNTTABOP_copy);
 	for (i = 0; i < count; i++) {
-		if (tx_pool)
+		if (tx_pool) {
 			vif = netbk->gnttab_tx_vif[i];
-		else
+			gnt_count = &vif->persistent_tx_gntcnt;
+			gnt_total = XEN_NETIF_TX_RING_SIZE;
+			pers_entry = vif->persistent_tx_gnt;
+		} else {
 			vif = netbk->gnttab_rx_vif[i];
-
-		pers_entry = vif->persistent_gnt;
-		gnt_count = &vif->persistent_gntcnt;
-		gnt_total = MAXIMUM_OUTSTANDING_BLOCK_REQS;
+			gnt_count = &vif->persistent_rx_gntcnt;
+			gnt_total = 2*XEN_NETIF_RX_RING_SIZE;
+			pers_entry = vif->persistent_rx_gnt;
+		}
 
 		if (vif->persistent_grant) {
 			void *saddr, *daddr;
-- 
1.7.3.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 07:06:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 07:06:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYtWV-0000f3-OO; Thu, 15 Nov 2012 07:06:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYtWU-0000em-05
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 07:06:02 +0000
Received: from [85.158.143.35:54302] by server-1.bemta-4.messagelabs.com id
	46/4E-27934-95494A05; Thu, 15 Nov 2012 07:06:01 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1352963159!17766159!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NDM1NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27046 invoked from network); 15 Nov 2012 07:06:00 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-6.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 07:06:00 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF75u2c008507
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 07:05:57 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF75tGQ003731
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 07:05:56 GMT
Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF75tuE027910; Thu, 15 Nov 2012 01:05:55 -0600
Received: from localhost.cn.oracle.com (/10.182.37.205)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 23:05:55 -0800
From: Annie Li <annie.li@oracle.com>
To: xen-devel@lists.xensource.com, netdev@vger.kernel.org,
	konrad.wilk@oracle.com, Ian.Campbell@citrix.com
Date: Thu, 15 Nov 2012 15:04:49 +0800
Message-Id: <1352963089-599-1-git-send-email-annie.li@oracle.com>
X-Mailer: git-send-email 1.7.3.4
In-Reply-To: <1352962987-541-1-git-send-email-annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: annie.li@oracle.com
Subject: [Xen-devel] [PATCH 2/4] xen/netback: Split one page pool into
	two(tx/rx) page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

For tx path, this implementation simplifies the work of searching out
grant page from page pool based on grant reference.

Signed-off-by: Annie Li <annie.li@oracle.com>
---
 drivers/net/xen-netback/common.h    |   14 ++++++++++----
 drivers/net/xen-netback/interface.c |   12 ++++++++----
 drivers/net/xen-netback/netback.c   |   15 +++++++++------
 3 files changed, 27 insertions(+), 14 deletions(-)

diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
index a85cac6..02c8573 100644
--- a/drivers/net/xen-netback/common.h
+++ b/drivers/net/xen-netback/common.h
@@ -47,8 +47,6 @@
 
 #define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE)
 #define XEN_NETIF_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE)
-#define MAXIMUM_OUTSTANDING_BLOCK_REQS \
-			(XEN_NETIF_TX_RING_SIZE + XEN_NETIF_RX_RING_SIZE)
 
 struct xen_netbk;
 
@@ -111,8 +109,16 @@ struct xenvif {
 
 	wait_queue_head_t waiting_to_free;
 
-	struct persistent_entry *persistent_gnt[MAXIMUM_OUTSTANDING_BLOCK_REQS];
-	unsigned int persistent_gntcnt;
+	struct persistent_entry *persistent_tx_gnt[XEN_NETIF_TX_RING_SIZE];
+
+	/*
+	 * 2*XEN_NETIF_RX_RING_SIZE is for the case of each head/fragment page
+	 * using 2 copy operations.
+	 */
+	struct persistent_entry *persistent_rx_gnt[2*XEN_NETIF_RX_RING_SIZE];
+
+	unsigned int persistent_tx_gntcnt;
+	unsigned int persistent_rx_gntcnt;
 };
 
 static inline struct xenbus_device *xenvif_to_xenbus_device(struct xenvif *vif)
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
index 226d159..ecbe116 100644
--- a/drivers/net/xen-netback/interface.c
+++ b/drivers/net/xen-netback/interface.c
@@ -300,7 +300,8 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
 		return ERR_PTR(err);
 	}
 
-	vif->persistent_gntcnt = 0;
+	vif->persistent_tx_gntcnt = 0;
+	vif->persistent_rx_gntcnt = 0;
 
 	netdev_dbg(dev, "Successfully created xenvif\n");
 	return vif;
@@ -385,9 +386,12 @@ void xenvif_disconnect(struct xenvif *vif)
 	unregister_netdev(vif->dev);
 
 	xen_netbk_unmap_frontend_rings(vif);
-	if (vif->persistent_grant)
-		xenvif_free_grants(vif->persistent_gnt,
-				   vif->persistent_gntcnt);
+	if (vif->persistent_grant) {
+		xenvif_free_grants(vif->persistent_tx_gnt,
+				   vif->persistent_tx_gntcnt);
+		xenvif_free_grants(vif->persistent_rx_gnt,
+				   vif->persistent_rx_gntcnt);
+	}
 
 	free_netdev(vif->dev);
 }
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index a26d3fc..ec59c73 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -208,14 +208,17 @@ grant_memory_copy_op(unsigned int cmd, void *vuop, unsigned int count,
 
 	BUG_ON(cmd != GNTTABOP_copy);
 	for (i = 0; i < count; i++) {
-		if (tx_pool)
+		if (tx_pool) {
 			vif = netbk->gnttab_tx_vif[i];
-		else
+			gnt_count = &vif->persistent_tx_gntcnt;
+			gnt_total = XEN_NETIF_TX_RING_SIZE;
+			pers_entry = vif->persistent_tx_gnt;
+		} else {
 			vif = netbk->gnttab_rx_vif[i];
-
-		pers_entry = vif->persistent_gnt;
-		gnt_count = &vif->persistent_gntcnt;
-		gnt_total = MAXIMUM_OUTSTANDING_BLOCK_REQS;
+			gnt_count = &vif->persistent_rx_gntcnt;
+			gnt_total = 2*XEN_NETIF_RX_RING_SIZE;
+			pers_entry = vif->persistent_rx_gnt;
+		}
 
 		if (vif->persistent_grant) {
 			void *saddr, *daddr;
-- 
1.7.3.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 07:06:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 07:06:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYtWu-0000iu-5W; Thu, 15 Nov 2012 07:06:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYtWs-0000iV-Et
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 07:06:26 +0000
Received: from [85.158.139.83:25664] by server-16.bemta-5.messagelabs.com id
	81/5A-04786-17494A05; Thu, 15 Nov 2012 07:06:25 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352963183!29649005!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NDM1NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19093 invoked from network); 15 Nov 2012 07:06:24 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 07:06:24 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF76J1g008962
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 07:06:20 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF76Jno004472
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 07:06:19 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF76Jx8001273; Thu, 15 Nov 2012 01:06:19 -0600
Received: from localhost.cn.oracle.com (/10.182.37.205)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 23:06:18 -0800
From: Annie Li <annie.li@oracle.com>
To: xen-devel@lists.xensource.com, netdev@vger.kernel.org,
	konrad.wilk@oracle.com, Ian.Campbell@citrix.com
Date: Thu, 15 Nov 2012 15:05:14 +0800
Message-Id: <1352963114-628-1-git-send-email-annie.li@oracle.com>
X-Mailer: git-send-email 1.7.3.4
In-Reply-To: <1352962987-541-1-git-send-email-annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: annie.li@oracle.com
Subject: [Xen-devel] [PATCH 3/4] Xen/netfront: Implement persistent grant in
	netfront.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Tx/rx page pool are maintained. New grant is mapped and put into
pool, unmap only happens when releasing/removing device.

Signed-off-by: Annie Li <annie.li@oracle.com>
---
 drivers/net/xen-netfront.c |  372 +++++++++++++++++++++++++++++++++++++-------
 1 files changed, 315 insertions(+), 57 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 0ebbb19..17b81c0 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -79,6 +79,13 @@ struct netfront_stats {
 	struct u64_stats_sync	syncp;
 };
 
+struct gnt_list {
+	grant_ref_t		gref;
+	struct			page *gnt_pages;
+	void			*gnt_target;
+	struct			gnt_list *tail;
+};
+
 struct netfront_info {
 	struct list_head list;
 	struct net_device *netdev;
@@ -109,6 +116,10 @@ struct netfront_info {
 	grant_ref_t grant_tx_ref[NET_TX_RING_SIZE];
 	unsigned tx_skb_freelist;
 
+	struct gnt_list *tx_grant[NET_TX_RING_SIZE];
+	struct gnt_list *tx_gnt_list;
+	unsigned int tx_gnt_cnt;
+
 	spinlock_t   rx_lock ____cacheline_aligned_in_smp;
 	struct xen_netif_rx_front_ring rx;
 	int rx_ring_ref;
@@ -126,6 +137,10 @@ struct netfront_info {
 	grant_ref_t gref_rx_head;
 	grant_ref_t grant_rx_ref[NET_RX_RING_SIZE];
 
+	struct gnt_list *rx_grant[NET_RX_RING_SIZE];
+	struct gnt_list *rx_gnt_list;
+	unsigned int rx_gnt_cnt;
+
 	unsigned long rx_pfn_array[NET_RX_RING_SIZE];
 	struct multicall_entry rx_mcl[NET_RX_RING_SIZE+1];
 	struct mmu_update rx_mmu[NET_RX_RING_SIZE];
@@ -134,6 +149,7 @@ struct netfront_info {
 	struct netfront_stats __percpu *stats;
 
 	unsigned long rx_gso_checksum_fixup;
+	u8 persistent_gnt:1;
 };
 
 struct netfront_rx_info {
@@ -194,6 +210,16 @@ static grant_ref_t xennet_get_rx_ref(struct netfront_info *np,
 	return ref;
 }
 
+static struct gnt_list *xennet_get_rx_grant(struct netfront_info *np,
+					    RING_IDX ri)
+{
+	int i = xennet_rxidx(ri);
+	struct gnt_list *gntlist = np->rx_grant[i];
+	np->rx_grant[i] = NULL;
+
+	return gntlist;
+}
+
 #ifdef CONFIG_SYSFS
 static int xennet_sysfs_addif(struct net_device *netdev);
 static void xennet_sysfs_delif(struct net_device *netdev);
@@ -231,6 +257,68 @@ static void xennet_maybe_wake_tx(struct net_device *dev)
 		netif_wake_queue(dev);
 }
 
+static grant_ref_t xennet_alloc_rx_ref(struct net_device *dev,
+				       unsigned long mfn, void *vaddr,
+				       unsigned int id,
+				       grant_ref_t ref)
+{
+	struct netfront_info *np = netdev_priv(dev);
+	grant_ref_t gnt_ref;
+	struct gnt_list *gnt_list_entry;
+
+	if (np->persistent_gnt && np->rx_gnt_cnt) {
+		gnt_list_entry = np->rx_gnt_list;
+		np->rx_gnt_list = np->rx_gnt_list->tail;
+		np->rx_gnt_cnt--;
+
+		gnt_list_entry->gnt_target = vaddr;
+		gnt_ref = gnt_list_entry->gref;
+		np->rx_grant[id] = gnt_list_entry;
+	} else {
+		struct page *page;
+
+		BUG_ON(!np->persistent_gnt && np->rx_gnt_cnt);
+		if (!ref)
+			gnt_ref =
+				gnttab_claim_grant_reference(&np->gref_rx_head);
+		else
+			gnt_ref = ref;
+		BUG_ON((signed short)gnt_ref < 0);
+
+		if (np->persistent_gnt) {
+			page = alloc_page(GFP_KERNEL);
+			if (!page) {
+				if (!ref)
+					gnttab_release_grant_reference(
+							&np->gref_rx_head, ref);
+				return -ENOMEM;
+			}
+			mfn = pfn_to_mfn(page_to_pfn(page));
+
+			gnt_list_entry = kmalloc(sizeof(struct gnt_list),
+						 GFP_KERNEL);
+			if (!gnt_list_entry) {
+				__free_page(page);
+				if (!ref)
+					gnttab_release_grant_reference(
+							&np->gref_rx_head, ref);
+				return -ENOMEM;
+			}
+			gnt_list_entry->gref = gnt_ref;
+			gnt_list_entry->gnt_pages = page;
+			gnt_list_entry->gnt_target = vaddr;
+
+			np->rx_grant[id] = gnt_list_entry;
+		}
+
+		gnttab_grant_foreign_access_ref(gnt_ref, np->xbdev->otherend_id,
+						mfn, 0);
+	}
+	np->grant_rx_ref[id] = gnt_ref;
+
+	return gnt_ref;
+}
+
 static void xennet_alloc_rx_buffers(struct net_device *dev)
 {
 	unsigned short id;
@@ -240,8 +328,6 @@ static void xennet_alloc_rx_buffers(struct net_device *dev)
 	int i, batch_target, notify;
 	RING_IDX req_prod = np->rx.req_prod_pvt;
 	grant_ref_t ref;
-	unsigned long pfn;
-	void *vaddr;
 	struct xen_netif_rx_request *req;
 
 	if (unlikely(!netif_carrier_ok(dev)))
@@ -306,19 +392,16 @@ no_skb:
 		BUG_ON(np->rx_skbs[id]);
 		np->rx_skbs[id] = skb;
 
-		ref = gnttab_claim_grant_reference(&np->gref_rx_head);
-		BUG_ON((signed short)ref < 0);
-		np->grant_rx_ref[id] = ref;
+		page = skb_frag_page(&skb_shinfo(skb)->frags[0]);
 
-		pfn = page_to_pfn(skb_frag_page(&skb_shinfo(skb)->frags[0]));
-		vaddr = page_address(skb_frag_page(&skb_shinfo(skb)->frags[0]));
+		ref = xennet_alloc_rx_ref(dev, pfn_to_mfn(page_to_pfn(page)),
+					  page_address(page), id, 0);
+		if ((signed short)ref < 0) {
+			__skb_queue_tail(&np->rx_batch, skb);
+			break;
+		}
 
 		req = RING_GET_REQUEST(&np->rx, req_prod + i);
-		gnttab_grant_foreign_access_ref(ref,
-						np->xbdev->otherend_id,
-						pfn_to_mfn(pfn),
-						0);
-
 		req->id = id;
 		req->gref = ref;
 	}
@@ -375,17 +458,30 @@ static void xennet_tx_buf_gc(struct net_device *dev)
 
 			id  = txrsp->id;
 			skb = np->tx_skbs[id].skb;
-			if (unlikely(gnttab_query_foreign_access(
-				np->grant_tx_ref[id]) != 0)) {
-				printk(KERN_ALERT "xennet_tx_buf_gc: warning "
-				       "-- grant still in use by backend "
-				       "domain.\n");
-				BUG();
+
+			if (np->persistent_gnt) {
+				struct gnt_list *gnt_list_entry;
+
+				gnt_list_entry = np->tx_grant[id];
+				BUG_ON(!gnt_list_entry);
+
+				gnt_list_entry->tail = np->tx_gnt_list;
+				np->tx_gnt_list = gnt_list_entry;
+				np->tx_gnt_cnt++;
+			} else {
+				if (unlikely(gnttab_query_foreign_access(
+					np->grant_tx_ref[id]) != 0)) {
+					printk(KERN_ALERT "xennet_tx_buf_gc: warning "
+					       "-- grant still in use by backend "
+					       "domain.\n");
+					BUG();
+				}
+
+				gnttab_end_foreign_access_ref(
+					np->grant_tx_ref[id], GNTMAP_readonly);
+				gnttab_release_grant_reference(
+				      &np->gref_tx_head, np->grant_tx_ref[id]);
 			}
-			gnttab_end_foreign_access_ref(
-				np->grant_tx_ref[id], GNTMAP_readonly);
-			gnttab_release_grant_reference(
-				&np->gref_tx_head, np->grant_tx_ref[id]);
 			np->grant_tx_ref[id] = GRANT_INVALID_REF;
 			add_id_to_freelist(&np->tx_skb_freelist, np->tx_skbs, id);
 			dev_kfree_skb_irq(skb);
@@ -409,6 +505,59 @@ static void xennet_tx_buf_gc(struct net_device *dev)
 	xennet_maybe_wake_tx(dev);
 }
 
+static grant_ref_t xennet_alloc_tx_ref(struct net_device *dev,
+				       unsigned long mfn,
+				       unsigned int id)
+{
+	struct netfront_info *np = netdev_priv(dev);
+	grant_ref_t ref;
+	struct page *granted_page;
+
+	if (np->persistent_gnt && np->tx_gnt_cnt) {
+		struct gnt_list *gnt_list_entry;
+
+		gnt_list_entry = np->tx_gnt_list;
+		np->tx_gnt_list = np->tx_gnt_list->tail;
+		np->tx_gnt_cnt--;
+
+		ref = gnt_list_entry->gref;
+		np->tx_grant[id] = gnt_list_entry;
+	} else {
+		struct gnt_list *gnt_list_entry;
+
+		BUG_ON(!np->persistent_gnt && np->tx_gnt_cnt);
+		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
+		BUG_ON((signed short)ref < 0);
+
+		if (np->persistent_gnt) {
+			granted_page = alloc_page(GFP_KERNEL);
+			if (!granted_page) {
+				gnttab_release_grant_reference(
+							&np->gref_tx_head, ref);
+				return -ENOMEM;
+			}
+
+			mfn = pfn_to_mfn(page_to_pfn(granted_page));
+			gnt_list_entry = kmalloc(sizeof(struct gnt_list),
+						 GFP_KERNEL);
+			if (!gnt_list_entry) {
+				__free_page(granted_page);
+				gnttab_release_grant_reference(
+							&np->gref_tx_head, ref);
+				return -ENOMEM;
+			}
+
+			gnt_list_entry->gref = ref;
+			gnt_list_entry->gnt_pages = granted_page;
+			np->tx_grant[id] = gnt_list_entry;
+		}
+		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
+						mfn, 0);
+	}
+
+	return ref;
+}
+
 static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
 			      struct xen_netif_tx_request *tx)
 {
@@ -421,6 +570,9 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
 	unsigned int len = skb_headlen(skb);
 	unsigned int id;
 	grant_ref_t ref;
+	struct gnt_list *gnt_list_entry;
+	void *out_addr;
+	void *in_addr;
 	int i;
 
 	/* While the header overlaps a page boundary (including being
@@ -436,17 +588,19 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
 		np->tx_skbs[id].skb = skb_get(skb);
 		tx = RING_GET_REQUEST(&np->tx, prod++);
 		tx->id = id;
-		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
-		BUG_ON((signed short)ref < 0);
-
 		mfn = virt_to_mfn(data);
-		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
-						mfn, GNTMAP_readonly);
-
+		ref = xennet_alloc_tx_ref(dev, mfn, id);
 		tx->gref = np->grant_tx_ref[id] = ref;
 		tx->offset = offset;
 		tx->size = len;
 		tx->flags = 0;
+		if (np->persistent_gnt) {
+			gnt_list_entry = np->tx_grant[id];
+			out_addr = page_address(gnt_list_entry->gnt_pages);
+			in_addr = (void *)((unsigned long)data
+							& ~(PAGE_SIZE-1));
+			memcpy(out_addr, in_addr, PAGE_SIZE);
+		}
 	}
 
 	/* Grant backend access to each skb fragment page. */
@@ -459,17 +613,19 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
 		np->tx_skbs[id].skb = skb_get(skb);
 		tx = RING_GET_REQUEST(&np->tx, prod++);
 		tx->id = id;
-		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
-		BUG_ON((signed short)ref < 0);
-
 		mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
-		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
-						mfn, GNTMAP_readonly);
-
+		ref = xennet_alloc_tx_ref(dev, mfn, id);
 		tx->gref = np->grant_tx_ref[id] = ref;
 		tx->offset = frag->page_offset;
 		tx->size = skb_frag_size(frag);
 		tx->flags = 0;
+		if (np->persistent_gnt) {
+			gnt_list_entry = np->tx_grant[id];
+			out_addr = page_address(gnt_list_entry->gnt_pages);
+			in_addr = (void *)((unsigned long)page_address(
+					skb_frag_page(frag)) & ~(PAGE_SIZE-1));
+			memcpy(out_addr, in_addr, PAGE_SIZE);
+		}
 	}
 
 	np->tx.req_prod_pvt = prod;
@@ -491,6 +647,9 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	unsigned int offset = offset_in_page(data);
 	unsigned int len = skb_headlen(skb);
 	unsigned long flags;
+	struct gnt_list *gnt_list_entry;
+	void *out_addr;
+	void *in_addr;
 
 	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
 	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
@@ -517,16 +676,20 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	tx = RING_GET_REQUEST(&np->tx, i);
 
 	tx->id   = id;
-	ref = gnttab_claim_grant_reference(&np->gref_tx_head);
-	BUG_ON((signed short)ref < 0);
 	mfn = virt_to_mfn(data);
-	gnttab_grant_foreign_access_ref(
-		ref, np->xbdev->otherend_id, mfn, GNTMAP_readonly);
+	ref = xennet_alloc_tx_ref(dev, mfn, id);
 	tx->gref = np->grant_tx_ref[id] = ref;
 	tx->offset = offset;
 	tx->size = len;
 	extra = NULL;
 
+	if (np->persistent_gnt) {
+		gnt_list_entry = np->tx_grant[id];
+		out_addr = page_address(gnt_list_entry->gnt_pages);
+		in_addr = (void *)((unsigned long)data & ~(PAGE_SIZE-1));
+		memcpy(out_addr, in_addr, PAGE_SIZE);
+	}
+
 	tx->flags = 0;
 	if (skb->ip_summed == CHECKSUM_PARTIAL)
 		/* local packet? */
@@ -595,13 +758,17 @@ static int xennet_close(struct net_device *dev)
 }
 
 static void xennet_move_rx_slot(struct netfront_info *np, struct sk_buff *skb,
-				grant_ref_t ref)
+				grant_ref_t ref, RING_IDX cons)
 {
 	int new = xennet_rxidx(np->rx.req_prod_pvt);
 
 	BUG_ON(np->rx_skbs[new]);
 	np->rx_skbs[new] = skb;
 	np->grant_rx_ref[new] = ref;
+
+	if (np->persistent_gnt)
+		np->rx_grant[new] = xennet_get_rx_grant(np, cons);
+
 	RING_GET_REQUEST(&np->rx, np->rx.req_prod_pvt)->id = new;
 	RING_GET_REQUEST(&np->rx, np->rx.req_prod_pvt)->gref = ref;
 	np->rx.req_prod_pvt++;
@@ -644,7 +811,7 @@ static int xennet_get_extras(struct netfront_info *np,
 
 		skb = xennet_get_rx_skb(np, cons);
 		ref = xennet_get_rx_ref(np, cons);
-		xennet_move_rx_slot(np, skb, ref);
+		xennet_move_rx_slot(np, skb, ref, cons);
 	} while (extra->flags & XEN_NETIF_EXTRA_FLAG_MORE);
 
 	np->rx.rsp_cons = cons;
@@ -665,6 +832,12 @@ static int xennet_get_responses(struct netfront_info *np,
 	int frags = 1;
 	int err = 0;
 	unsigned long ret;
+	struct gnt_list *gnt_list_entry;
+
+	if (np->persistent_gnt) {
+		gnt_list_entry = xennet_get_rx_grant(np, cons);
+		BUG_ON(!gnt_list_entry);
+	}
 
 	if (rx->flags & XEN_NETRXF_extra_info) {
 		err = xennet_get_extras(np, extras, rp);
@@ -677,7 +850,7 @@ static int xennet_get_responses(struct netfront_info *np,
 			if (net_ratelimit())
 				dev_warn(dev, "rx->offset: %x, size: %u\n",
 					 rx->offset, rx->status);
-			xennet_move_rx_slot(np, skb, ref);
+			xennet_move_rx_slot(np, skb, ref, cons);
 			err = -EINVAL;
 			goto next;
 		}
@@ -695,11 +868,29 @@ static int xennet_get_responses(struct netfront_info *np,
 			goto next;
 		}
 
-		ret = gnttab_end_foreign_access_ref(ref, 0);
-		BUG_ON(!ret);
-
-		gnttab_release_grant_reference(&np->gref_rx_head, ref);
-
+		if (!np->persistent_gnt) {
+			ret = gnttab_end_foreign_access_ref(ref, 0);
+			BUG_ON(!ret);
+			gnttab_release_grant_reference(&np->gref_rx_head, ref);
+		} else {
+			struct page *grant_page;
+			void *grant_target;
+
+			grant_page = gnt_list_entry->gnt_pages;
+			grant_target = gnt_list_entry->gnt_target;
+			BUG_ON(grant_page == 0);
+			BUG_ON(grant_target == 0);
+
+			if (rx->status > 0)
+				memcpy(grant_target+rx->offset,
+				       page_address(grant_page)+rx->offset,
+				       rx->status); /* status encodes size */
+
+			gnt_list_entry->gref = ref;
+			gnt_list_entry->tail = np->rx_gnt_list;
+			np->rx_gnt_list = gnt_list_entry;
+			np->rx_gnt_cnt++;
+		}
 		__skb_queue_tail(list, skb);
 
 next:
@@ -716,6 +907,10 @@ next:
 		rx = RING_GET_RESPONSE(&np->rx, cons + frags);
 		skb = xennet_get_rx_skb(np, cons + frags);
 		ref = xennet_get_rx_ref(np, cons + frags);
+		if (np->persistent_gnt) {
+			gnt_list_entry = xennet_get_rx_grant(np, cons + frags);
+			BUG_ON(!gnt_list_entry);
+		}
 		frags++;
 	}
 
@@ -1090,16 +1285,32 @@ static void xennet_release_tx_bufs(struct netfront_info *np)
 	struct sk_buff *skb;
 	int i;
 
+	if (np->persistent_gnt) {
+		struct gnt_list *gnt_list_entry;
+
+		while (np->tx_gnt_list) {
+			gnt_list_entry = np->tx_gnt_list;
+			np->tx_gnt_list = np->tx_gnt_list->tail;
+			gnttab_end_foreign_access(gnt_list_entry->gref, 0, 0UL);
+			gnttab_release_grant_reference(&np->gref_tx_head,
+						       gnt_list_entry->gref);
+
+			__free_page(gnt_list_entry->gnt_pages);
+			kfree(gnt_list_entry);
+		}
+	}
+
 	for (i = 0; i < NET_TX_RING_SIZE; i++) {
 		/* Skip over entries which are actually freelist references */
 		if (skb_entry_is_link(&np->tx_skbs[i]))
 			continue;
-
 		skb = np->tx_skbs[i].skb;
-		gnttab_end_foreign_access_ref(np->grant_tx_ref[i],
-					      GNTMAP_readonly);
-		gnttab_release_grant_reference(&np->gref_tx_head,
-					       np->grant_tx_ref[i]);
+		if (!np->persistent_gnt) {
+			gnttab_end_foreign_access_ref(np->grant_tx_ref[i],
+						      GNTMAP_readonly);
+			gnttab_release_grant_reference(&np->gref_tx_head,
+						       np->grant_tx_ref[i]);
+		}
 		np->grant_tx_ref[i] = GRANT_INVALID_REF;
 		add_id_to_freelist(&np->tx_skb_freelist, np->tx_skbs, i);
 		dev_kfree_skb_irq(skb);
@@ -1124,6 +1335,20 @@ static void xennet_release_rx_bufs(struct netfront_info *np)
 
 	spin_lock_bh(&np->rx_lock);
 
+	if (np->persistent_gnt) {
+		struct gnt_list *gnt_list_entry;
+
+		while (np->rx_gnt_list) {
+			gnt_list_entry = np->rx_gnt_list;
+			np->rx_gnt_list = np->rx_gnt_list->tail;
+			gnttab_end_foreign_access(gnt_list_entry->gref, 0, 0UL);
+			gnttab_release_grant_reference(&np->gref_rx_head,
+							gnt_list_entry->gref);
+			__free_page(gnt_list_entry->gnt_pages);
+			kfree(gnt_list_entry);
+		}
+	}
+
 	for (id = 0; id < NET_RX_RING_SIZE; id++) {
 		ref = np->grant_rx_ref[id];
 		if (ref == GRANT_INVALID_REF) {
@@ -1132,8 +1357,10 @@ static void xennet_release_rx_bufs(struct netfront_info *np)
 		}
 
 		skb = np->rx_skbs[id];
-		mfn = gnttab_end_foreign_transfer_ref(ref);
-		gnttab_release_grant_reference(&np->gref_rx_head, ref);
+		if (!np->persistent_gnt) {
+			mfn = gnttab_end_foreign_transfer_ref(ref);
+			gnttab_release_grant_reference(&np->gref_rx_head, ref);
+		}
 		np->grant_rx_ref[id] = GRANT_INVALID_REF;
 
 		if (0 == mfn) {
@@ -1607,6 +1834,13 @@ again:
 		goto abort_transaction;
 	}
 
+	err = xenbus_printf(xbt, dev->nodename, "feature-persistent-grants",
+			    "%u", info->persistent_gnt);
+	if (err) {
+		message = "writing feature-persistent-grants";
+		xenbus_dev_fatal(dev, err, "%s", message);
+	}
+
 	err = xenbus_transaction_end(xbt, 0);
 	if (err) {
 		if (err == -EAGAIN)
@@ -1634,6 +1868,7 @@ static int xennet_connect(struct net_device *dev)
 	grant_ref_t ref;
 	struct xen_netif_rx_request *req;
 	unsigned int feature_rx_copy;
+	int ret, val;
 
 	err = xenbus_scanf(XBT_NIL, np->xbdev->otherend,
 			   "feature-rx-copy", "%u", &feature_rx_copy);
@@ -1646,6 +1881,13 @@ static int xennet_connect(struct net_device *dev)
 		return -ENODEV;
 	}
 
+	err = xenbus_scanf(XBT_NIL, np->xbdev->otherend,
+			   "feature-persistent-grants", "%u", &val);
+	if (err != 1)
+		val = 0;
+
+	np->persistent_gnt = !!val;
+
 	err = talk_to_netback(np->xbdev, np);
 	if (err)
 		return err;
@@ -1657,9 +1899,24 @@ static int xennet_connect(struct net_device *dev)
 	spin_lock_bh(&np->rx_lock);
 	spin_lock_irq(&np->tx_lock);
 
+	np->tx_gnt_cnt = 0;
+	np->rx_gnt_cnt = 0;
+
 	/* Step 1: Discard all pending TX packet fragments. */
 	xennet_release_tx_bufs(np);
 
+	if (np->persistent_gnt) {
+		struct gnt_list *gnt_list_entry;
+
+		while (np->rx_gnt_list) {
+			gnt_list_entry = np->rx_gnt_list;
+			np->rx_gnt_list = np->rx_gnt_list->tail;
+			gnttab_end_foreign_access(gnt_list_entry->gref, 0, 0UL);
+			__free_page(gnt_list_entry->gnt_pages);
+			kfree(gnt_list_entry);
+		}
+	}
+
 	/* Step 2: Rebuild the RX buffer freelist and the RX ring itself. */
 	for (requeue_idx = 0, i = 0; i < NET_RX_RING_SIZE; i++) {
 		skb_frag_t *frag;
@@ -1673,10 +1930,11 @@ static int xennet_connect(struct net_device *dev)
 
 		frag = &skb_shinfo(skb)->frags[0];
 		page = skb_frag_page(frag);
-		gnttab_grant_foreign_access_ref(
-			ref, np->xbdev->otherend_id,
-			pfn_to_mfn(page_to_pfn(page)),
-			0);
+		ret = xennet_alloc_rx_ref(dev, pfn_to_mfn(page_to_pfn(page)),
+					  page_address(page), requeue_idx, ref);
+		if ((signed short)ret < 0)
+			break;
+
 		req->gref = ref;
 		req->id   = requeue_idx;
 
-- 
1.7.3.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 07:06:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 07:06:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYtWu-0000iu-5W; Thu, 15 Nov 2012 07:06:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYtWs-0000iV-Et
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 07:06:26 +0000
Received: from [85.158.139.83:25664] by server-16.bemta-5.messagelabs.com id
	81/5A-04786-17494A05; Thu, 15 Nov 2012 07:06:25 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352963183!29649005!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NDM1NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19093 invoked from network); 15 Nov 2012 07:06:24 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 07:06:24 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF76J1g008962
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 07:06:20 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF76Jno004472
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 07:06:19 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF76Jx8001273; Thu, 15 Nov 2012 01:06:19 -0600
Received: from localhost.cn.oracle.com (/10.182.37.205)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 23:06:18 -0800
From: Annie Li <annie.li@oracle.com>
To: xen-devel@lists.xensource.com, netdev@vger.kernel.org,
	konrad.wilk@oracle.com, Ian.Campbell@citrix.com
Date: Thu, 15 Nov 2012 15:05:14 +0800
Message-Id: <1352963114-628-1-git-send-email-annie.li@oracle.com>
X-Mailer: git-send-email 1.7.3.4
In-Reply-To: <1352962987-541-1-git-send-email-annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: annie.li@oracle.com
Subject: [Xen-devel] [PATCH 3/4] Xen/netfront: Implement persistent grant in
	netfront.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Tx/rx page pool are maintained. New grant is mapped and put into
pool, unmap only happens when releasing/removing device.

Signed-off-by: Annie Li <annie.li@oracle.com>
---
 drivers/net/xen-netfront.c |  372 +++++++++++++++++++++++++++++++++++++-------
 1 files changed, 315 insertions(+), 57 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 0ebbb19..17b81c0 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -79,6 +79,13 @@ struct netfront_stats {
 	struct u64_stats_sync	syncp;
 };
 
+struct gnt_list {
+	grant_ref_t		gref;
+	struct			page *gnt_pages;
+	void			*gnt_target;
+	struct			gnt_list *tail;
+};
+
 struct netfront_info {
 	struct list_head list;
 	struct net_device *netdev;
@@ -109,6 +116,10 @@ struct netfront_info {
 	grant_ref_t grant_tx_ref[NET_TX_RING_SIZE];
 	unsigned tx_skb_freelist;
 
+	struct gnt_list *tx_grant[NET_TX_RING_SIZE];
+	struct gnt_list *tx_gnt_list;
+	unsigned int tx_gnt_cnt;
+
 	spinlock_t   rx_lock ____cacheline_aligned_in_smp;
 	struct xen_netif_rx_front_ring rx;
 	int rx_ring_ref;
@@ -126,6 +137,10 @@ struct netfront_info {
 	grant_ref_t gref_rx_head;
 	grant_ref_t grant_rx_ref[NET_RX_RING_SIZE];
 
+	struct gnt_list *rx_grant[NET_RX_RING_SIZE];
+	struct gnt_list *rx_gnt_list;
+	unsigned int rx_gnt_cnt;
+
 	unsigned long rx_pfn_array[NET_RX_RING_SIZE];
 	struct multicall_entry rx_mcl[NET_RX_RING_SIZE+1];
 	struct mmu_update rx_mmu[NET_RX_RING_SIZE];
@@ -134,6 +149,7 @@ struct netfront_info {
 	struct netfront_stats __percpu *stats;
 
 	unsigned long rx_gso_checksum_fixup;
+	u8 persistent_gnt:1;
 };
 
 struct netfront_rx_info {
@@ -194,6 +210,16 @@ static grant_ref_t xennet_get_rx_ref(struct netfront_info *np,
 	return ref;
 }
 
+static struct gnt_list *xennet_get_rx_grant(struct netfront_info *np,
+					    RING_IDX ri)
+{
+	int i = xennet_rxidx(ri);
+	struct gnt_list *gntlist = np->rx_grant[i];
+	np->rx_grant[i] = NULL;
+
+	return gntlist;
+}
+
 #ifdef CONFIG_SYSFS
 static int xennet_sysfs_addif(struct net_device *netdev);
 static void xennet_sysfs_delif(struct net_device *netdev);
@@ -231,6 +257,68 @@ static void xennet_maybe_wake_tx(struct net_device *dev)
 		netif_wake_queue(dev);
 }
 
+static grant_ref_t xennet_alloc_rx_ref(struct net_device *dev,
+				       unsigned long mfn, void *vaddr,
+				       unsigned int id,
+				       grant_ref_t ref)
+{
+	struct netfront_info *np = netdev_priv(dev);
+	grant_ref_t gnt_ref;
+	struct gnt_list *gnt_list_entry;
+
+	if (np->persistent_gnt && np->rx_gnt_cnt) {
+		gnt_list_entry = np->rx_gnt_list;
+		np->rx_gnt_list = np->rx_gnt_list->tail;
+		np->rx_gnt_cnt--;
+
+		gnt_list_entry->gnt_target = vaddr;
+		gnt_ref = gnt_list_entry->gref;
+		np->rx_grant[id] = gnt_list_entry;
+	} else {
+		struct page *page;
+
+		BUG_ON(!np->persistent_gnt && np->rx_gnt_cnt);
+		if (!ref)
+			gnt_ref =
+				gnttab_claim_grant_reference(&np->gref_rx_head);
+		else
+			gnt_ref = ref;
+		BUG_ON((signed short)gnt_ref < 0);
+
+		if (np->persistent_gnt) {
+			page = alloc_page(GFP_KERNEL);
+			if (!page) {
+				if (!ref)
+					gnttab_release_grant_reference(
+							&np->gref_rx_head, ref);
+				return -ENOMEM;
+			}
+			mfn = pfn_to_mfn(page_to_pfn(page));
+
+			gnt_list_entry = kmalloc(sizeof(struct gnt_list),
+						 GFP_KERNEL);
+			if (!gnt_list_entry) {
+				__free_page(page);
+				if (!ref)
+					gnttab_release_grant_reference(
+							&np->gref_rx_head, ref);
+				return -ENOMEM;
+			}
+			gnt_list_entry->gref = gnt_ref;
+			gnt_list_entry->gnt_pages = page;
+			gnt_list_entry->gnt_target = vaddr;
+
+			np->rx_grant[id] = gnt_list_entry;
+		}
+
+		gnttab_grant_foreign_access_ref(gnt_ref, np->xbdev->otherend_id,
+						mfn, 0);
+	}
+	np->grant_rx_ref[id] = gnt_ref;
+
+	return gnt_ref;
+}
+
 static void xennet_alloc_rx_buffers(struct net_device *dev)
 {
 	unsigned short id;
@@ -240,8 +328,6 @@ static void xennet_alloc_rx_buffers(struct net_device *dev)
 	int i, batch_target, notify;
 	RING_IDX req_prod = np->rx.req_prod_pvt;
 	grant_ref_t ref;
-	unsigned long pfn;
-	void *vaddr;
 	struct xen_netif_rx_request *req;
 
 	if (unlikely(!netif_carrier_ok(dev)))
@@ -306,19 +392,16 @@ no_skb:
 		BUG_ON(np->rx_skbs[id]);
 		np->rx_skbs[id] = skb;
 
-		ref = gnttab_claim_grant_reference(&np->gref_rx_head);
-		BUG_ON((signed short)ref < 0);
-		np->grant_rx_ref[id] = ref;
+		page = skb_frag_page(&skb_shinfo(skb)->frags[0]);
 
-		pfn = page_to_pfn(skb_frag_page(&skb_shinfo(skb)->frags[0]));
-		vaddr = page_address(skb_frag_page(&skb_shinfo(skb)->frags[0]));
+		ref = xennet_alloc_rx_ref(dev, pfn_to_mfn(page_to_pfn(page)),
+					  page_address(page), id, 0);
+		if ((signed short)ref < 0) {
+			__skb_queue_tail(&np->rx_batch, skb);
+			break;
+		}
 
 		req = RING_GET_REQUEST(&np->rx, req_prod + i);
-		gnttab_grant_foreign_access_ref(ref,
-						np->xbdev->otherend_id,
-						pfn_to_mfn(pfn),
-						0);
-
 		req->id = id;
 		req->gref = ref;
 	}
@@ -375,17 +458,30 @@ static void xennet_tx_buf_gc(struct net_device *dev)
 
 			id  = txrsp->id;
 			skb = np->tx_skbs[id].skb;
-			if (unlikely(gnttab_query_foreign_access(
-				np->grant_tx_ref[id]) != 0)) {
-				printk(KERN_ALERT "xennet_tx_buf_gc: warning "
-				       "-- grant still in use by backend "
-				       "domain.\n");
-				BUG();
+
+			if (np->persistent_gnt) {
+				struct gnt_list *gnt_list_entry;
+
+				gnt_list_entry = np->tx_grant[id];
+				BUG_ON(!gnt_list_entry);
+
+				gnt_list_entry->tail = np->tx_gnt_list;
+				np->tx_gnt_list = gnt_list_entry;
+				np->tx_gnt_cnt++;
+			} else {
+				if (unlikely(gnttab_query_foreign_access(
+					np->grant_tx_ref[id]) != 0)) {
+					printk(KERN_ALERT "xennet_tx_buf_gc: warning "
+					       "-- grant still in use by backend "
+					       "domain.\n");
+					BUG();
+				}
+
+				gnttab_end_foreign_access_ref(
+					np->grant_tx_ref[id], GNTMAP_readonly);
+				gnttab_release_grant_reference(
+				      &np->gref_tx_head, np->grant_tx_ref[id]);
 			}
-			gnttab_end_foreign_access_ref(
-				np->grant_tx_ref[id], GNTMAP_readonly);
-			gnttab_release_grant_reference(
-				&np->gref_tx_head, np->grant_tx_ref[id]);
 			np->grant_tx_ref[id] = GRANT_INVALID_REF;
 			add_id_to_freelist(&np->tx_skb_freelist, np->tx_skbs, id);
 			dev_kfree_skb_irq(skb);
@@ -409,6 +505,59 @@ static void xennet_tx_buf_gc(struct net_device *dev)
 	xennet_maybe_wake_tx(dev);
 }
 
+static grant_ref_t xennet_alloc_tx_ref(struct net_device *dev,
+				       unsigned long mfn,
+				       unsigned int id)
+{
+	struct netfront_info *np = netdev_priv(dev);
+	grant_ref_t ref;
+	struct page *granted_page;
+
+	if (np->persistent_gnt && np->tx_gnt_cnt) {
+		struct gnt_list *gnt_list_entry;
+
+		gnt_list_entry = np->tx_gnt_list;
+		np->tx_gnt_list = np->tx_gnt_list->tail;
+		np->tx_gnt_cnt--;
+
+		ref = gnt_list_entry->gref;
+		np->tx_grant[id] = gnt_list_entry;
+	} else {
+		struct gnt_list *gnt_list_entry;
+
+		BUG_ON(!np->persistent_gnt && np->tx_gnt_cnt);
+		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
+		BUG_ON((signed short)ref < 0);
+
+		if (np->persistent_gnt) {
+			granted_page = alloc_page(GFP_KERNEL);
+			if (!granted_page) {
+				gnttab_release_grant_reference(
+							&np->gref_tx_head, ref);
+				return -ENOMEM;
+			}
+
+			mfn = pfn_to_mfn(page_to_pfn(granted_page));
+			gnt_list_entry = kmalloc(sizeof(struct gnt_list),
+						 GFP_KERNEL);
+			if (!gnt_list_entry) {
+				__free_page(granted_page);
+				gnttab_release_grant_reference(
+							&np->gref_tx_head, ref);
+				return -ENOMEM;
+			}
+
+			gnt_list_entry->gref = ref;
+			gnt_list_entry->gnt_pages = granted_page;
+			np->tx_grant[id] = gnt_list_entry;
+		}
+		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
+						mfn, 0);
+	}
+
+	return ref;
+}
+
 static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
 			      struct xen_netif_tx_request *tx)
 {
@@ -421,6 +570,9 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
 	unsigned int len = skb_headlen(skb);
 	unsigned int id;
 	grant_ref_t ref;
+	struct gnt_list *gnt_list_entry;
+	void *out_addr;
+	void *in_addr;
 	int i;
 
 	/* While the header overlaps a page boundary (including being
@@ -436,17 +588,19 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
 		np->tx_skbs[id].skb = skb_get(skb);
 		tx = RING_GET_REQUEST(&np->tx, prod++);
 		tx->id = id;
-		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
-		BUG_ON((signed short)ref < 0);
-
 		mfn = virt_to_mfn(data);
-		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
-						mfn, GNTMAP_readonly);
-
+		ref = xennet_alloc_tx_ref(dev, mfn, id);
 		tx->gref = np->grant_tx_ref[id] = ref;
 		tx->offset = offset;
 		tx->size = len;
 		tx->flags = 0;
+		if (np->persistent_gnt) {
+			gnt_list_entry = np->tx_grant[id];
+			out_addr = page_address(gnt_list_entry->gnt_pages);
+			in_addr = (void *)((unsigned long)data
+							& ~(PAGE_SIZE-1));
+			memcpy(out_addr, in_addr, PAGE_SIZE);
+		}
 	}
 
 	/* Grant backend access to each skb fragment page. */
@@ -459,17 +613,19 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
 		np->tx_skbs[id].skb = skb_get(skb);
 		tx = RING_GET_REQUEST(&np->tx, prod++);
 		tx->id = id;
-		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
-		BUG_ON((signed short)ref < 0);
-
 		mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
-		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
-						mfn, GNTMAP_readonly);
-
+		ref = xennet_alloc_tx_ref(dev, mfn, id);
 		tx->gref = np->grant_tx_ref[id] = ref;
 		tx->offset = frag->page_offset;
 		tx->size = skb_frag_size(frag);
 		tx->flags = 0;
+		if (np->persistent_gnt) {
+			gnt_list_entry = np->tx_grant[id];
+			out_addr = page_address(gnt_list_entry->gnt_pages);
+			in_addr = (void *)((unsigned long)page_address(
+					skb_frag_page(frag)) & ~(PAGE_SIZE-1));
+			memcpy(out_addr, in_addr, PAGE_SIZE);
+		}
 	}
 
 	np->tx.req_prod_pvt = prod;
@@ -491,6 +647,9 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	unsigned int offset = offset_in_page(data);
 	unsigned int len = skb_headlen(skb);
 	unsigned long flags;
+	struct gnt_list *gnt_list_entry;
+	void *out_addr;
+	void *in_addr;
 
 	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
 	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
@@ -517,16 +676,20 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	tx = RING_GET_REQUEST(&np->tx, i);
 
 	tx->id   = id;
-	ref = gnttab_claim_grant_reference(&np->gref_tx_head);
-	BUG_ON((signed short)ref < 0);
 	mfn = virt_to_mfn(data);
-	gnttab_grant_foreign_access_ref(
-		ref, np->xbdev->otherend_id, mfn, GNTMAP_readonly);
+	ref = xennet_alloc_tx_ref(dev, mfn, id);
 	tx->gref = np->grant_tx_ref[id] = ref;
 	tx->offset = offset;
 	tx->size = len;
 	extra = NULL;
 
+	if (np->persistent_gnt) {
+		gnt_list_entry = np->tx_grant[id];
+		out_addr = page_address(gnt_list_entry->gnt_pages);
+		in_addr = (void *)((unsigned long)data & ~(PAGE_SIZE-1));
+		memcpy(out_addr, in_addr, PAGE_SIZE);
+	}
+
 	tx->flags = 0;
 	if (skb->ip_summed == CHECKSUM_PARTIAL)
 		/* local packet? */
@@ -595,13 +758,17 @@ static int xennet_close(struct net_device *dev)
 }
 
 static void xennet_move_rx_slot(struct netfront_info *np, struct sk_buff *skb,
-				grant_ref_t ref)
+				grant_ref_t ref, RING_IDX cons)
 {
 	int new = xennet_rxidx(np->rx.req_prod_pvt);
 
 	BUG_ON(np->rx_skbs[new]);
 	np->rx_skbs[new] = skb;
 	np->grant_rx_ref[new] = ref;
+
+	if (np->persistent_gnt)
+		np->rx_grant[new] = xennet_get_rx_grant(np, cons);
+
 	RING_GET_REQUEST(&np->rx, np->rx.req_prod_pvt)->id = new;
 	RING_GET_REQUEST(&np->rx, np->rx.req_prod_pvt)->gref = ref;
 	np->rx.req_prod_pvt++;
@@ -644,7 +811,7 @@ static int xennet_get_extras(struct netfront_info *np,
 
 		skb = xennet_get_rx_skb(np, cons);
 		ref = xennet_get_rx_ref(np, cons);
-		xennet_move_rx_slot(np, skb, ref);
+		xennet_move_rx_slot(np, skb, ref, cons);
 	} while (extra->flags & XEN_NETIF_EXTRA_FLAG_MORE);
 
 	np->rx.rsp_cons = cons;
@@ -665,6 +832,12 @@ static int xennet_get_responses(struct netfront_info *np,
 	int frags = 1;
 	int err = 0;
 	unsigned long ret;
+	struct gnt_list *gnt_list_entry;
+
+	if (np->persistent_gnt) {
+		gnt_list_entry = xennet_get_rx_grant(np, cons);
+		BUG_ON(!gnt_list_entry);
+	}
 
 	if (rx->flags & XEN_NETRXF_extra_info) {
 		err = xennet_get_extras(np, extras, rp);
@@ -677,7 +850,7 @@ static int xennet_get_responses(struct netfront_info *np,
 			if (net_ratelimit())
 				dev_warn(dev, "rx->offset: %x, size: %u\n",
 					 rx->offset, rx->status);
-			xennet_move_rx_slot(np, skb, ref);
+			xennet_move_rx_slot(np, skb, ref, cons);
 			err = -EINVAL;
 			goto next;
 		}
@@ -695,11 +868,29 @@ static int xennet_get_responses(struct netfront_info *np,
 			goto next;
 		}
 
-		ret = gnttab_end_foreign_access_ref(ref, 0);
-		BUG_ON(!ret);
-
-		gnttab_release_grant_reference(&np->gref_rx_head, ref);
-
+		if (!np->persistent_gnt) {
+			ret = gnttab_end_foreign_access_ref(ref, 0);
+			BUG_ON(!ret);
+			gnttab_release_grant_reference(&np->gref_rx_head, ref);
+		} else {
+			struct page *grant_page;
+			void *grant_target;
+
+			grant_page = gnt_list_entry->gnt_pages;
+			grant_target = gnt_list_entry->gnt_target;
+			BUG_ON(grant_page == 0);
+			BUG_ON(grant_target == 0);
+
+			if (rx->status > 0)
+				memcpy(grant_target+rx->offset,
+				       page_address(grant_page)+rx->offset,
+				       rx->status); /* status encodes size */
+
+			gnt_list_entry->gref = ref;
+			gnt_list_entry->tail = np->rx_gnt_list;
+			np->rx_gnt_list = gnt_list_entry;
+			np->rx_gnt_cnt++;
+		}
 		__skb_queue_tail(list, skb);
 
 next:
@@ -716,6 +907,10 @@ next:
 		rx = RING_GET_RESPONSE(&np->rx, cons + frags);
 		skb = xennet_get_rx_skb(np, cons + frags);
 		ref = xennet_get_rx_ref(np, cons + frags);
+		if (np->persistent_gnt) {
+			gnt_list_entry = xennet_get_rx_grant(np, cons + frags);
+			BUG_ON(!gnt_list_entry);
+		}
 		frags++;
 	}
 
@@ -1090,16 +1285,32 @@ static void xennet_release_tx_bufs(struct netfront_info *np)
 	struct sk_buff *skb;
 	int i;
 
+	if (np->persistent_gnt) {
+		struct gnt_list *gnt_list_entry;
+
+		while (np->tx_gnt_list) {
+			gnt_list_entry = np->tx_gnt_list;
+			np->tx_gnt_list = np->tx_gnt_list->tail;
+			gnttab_end_foreign_access(gnt_list_entry->gref, 0, 0UL);
+			gnttab_release_grant_reference(&np->gref_tx_head,
+						       gnt_list_entry->gref);
+
+			__free_page(gnt_list_entry->gnt_pages);
+			kfree(gnt_list_entry);
+		}
+	}
+
 	for (i = 0; i < NET_TX_RING_SIZE; i++) {
 		/* Skip over entries which are actually freelist references */
 		if (skb_entry_is_link(&np->tx_skbs[i]))
 			continue;
-
 		skb = np->tx_skbs[i].skb;
-		gnttab_end_foreign_access_ref(np->grant_tx_ref[i],
-					      GNTMAP_readonly);
-		gnttab_release_grant_reference(&np->gref_tx_head,
-					       np->grant_tx_ref[i]);
+		if (!np->persistent_gnt) {
+			gnttab_end_foreign_access_ref(np->grant_tx_ref[i],
+						      GNTMAP_readonly);
+			gnttab_release_grant_reference(&np->gref_tx_head,
+						       np->grant_tx_ref[i]);
+		}
 		np->grant_tx_ref[i] = GRANT_INVALID_REF;
 		add_id_to_freelist(&np->tx_skb_freelist, np->tx_skbs, i);
 		dev_kfree_skb_irq(skb);
@@ -1124,6 +1335,20 @@ static void xennet_release_rx_bufs(struct netfront_info *np)
 
 	spin_lock_bh(&np->rx_lock);
 
+	if (np->persistent_gnt) {
+		struct gnt_list *gnt_list_entry;
+
+		while (np->rx_gnt_list) {
+			gnt_list_entry = np->rx_gnt_list;
+			np->rx_gnt_list = np->rx_gnt_list->tail;
+			gnttab_end_foreign_access(gnt_list_entry->gref, 0, 0UL);
+			gnttab_release_grant_reference(&np->gref_rx_head,
+							gnt_list_entry->gref);
+			__free_page(gnt_list_entry->gnt_pages);
+			kfree(gnt_list_entry);
+		}
+	}
+
 	for (id = 0; id < NET_RX_RING_SIZE; id++) {
 		ref = np->grant_rx_ref[id];
 		if (ref == GRANT_INVALID_REF) {
@@ -1132,8 +1357,10 @@ static void xennet_release_rx_bufs(struct netfront_info *np)
 		}
 
 		skb = np->rx_skbs[id];
-		mfn = gnttab_end_foreign_transfer_ref(ref);
-		gnttab_release_grant_reference(&np->gref_rx_head, ref);
+		if (!np->persistent_gnt) {
+			mfn = gnttab_end_foreign_transfer_ref(ref);
+			gnttab_release_grant_reference(&np->gref_rx_head, ref);
+		}
 		np->grant_rx_ref[id] = GRANT_INVALID_REF;
 
 		if (0 == mfn) {
@@ -1607,6 +1834,13 @@ again:
 		goto abort_transaction;
 	}
 
+	err = xenbus_printf(xbt, dev->nodename, "feature-persistent-grants",
+			    "%u", info->persistent_gnt);
+	if (err) {
+		message = "writing feature-persistent-grants";
+		xenbus_dev_fatal(dev, err, "%s", message);
+	}
+
 	err = xenbus_transaction_end(xbt, 0);
 	if (err) {
 		if (err == -EAGAIN)
@@ -1634,6 +1868,7 @@ static int xennet_connect(struct net_device *dev)
 	grant_ref_t ref;
 	struct xen_netif_rx_request *req;
 	unsigned int feature_rx_copy;
+	int ret, val;
 
 	err = xenbus_scanf(XBT_NIL, np->xbdev->otherend,
 			   "feature-rx-copy", "%u", &feature_rx_copy);
@@ -1646,6 +1881,13 @@ static int xennet_connect(struct net_device *dev)
 		return -ENODEV;
 	}
 
+	err = xenbus_scanf(XBT_NIL, np->xbdev->otherend,
+			   "feature-persistent-grants", "%u", &val);
+	if (err != 1)
+		val = 0;
+
+	np->persistent_gnt = !!val;
+
 	err = talk_to_netback(np->xbdev, np);
 	if (err)
 		return err;
@@ -1657,9 +1899,24 @@ static int xennet_connect(struct net_device *dev)
 	spin_lock_bh(&np->rx_lock);
 	spin_lock_irq(&np->tx_lock);
 
+	np->tx_gnt_cnt = 0;
+	np->rx_gnt_cnt = 0;
+
 	/* Step 1: Discard all pending TX packet fragments. */
 	xennet_release_tx_bufs(np);
 
+	if (np->persistent_gnt) {
+		struct gnt_list *gnt_list_entry;
+
+		while (np->rx_gnt_list) {
+			gnt_list_entry = np->rx_gnt_list;
+			np->rx_gnt_list = np->rx_gnt_list->tail;
+			gnttab_end_foreign_access(gnt_list_entry->gref, 0, 0UL);
+			__free_page(gnt_list_entry->gnt_pages);
+			kfree(gnt_list_entry);
+		}
+	}
+
 	/* Step 2: Rebuild the RX buffer freelist and the RX ring itself. */
 	for (requeue_idx = 0, i = 0; i < NET_RX_RING_SIZE; i++) {
 		skb_frag_t *frag;
@@ -1673,10 +1930,11 @@ static int xennet_connect(struct net_device *dev)
 
 		frag = &skb_shinfo(skb)->frags[0];
 		page = skb_frag_page(frag);
-		gnttab_grant_foreign_access_ref(
-			ref, np->xbdev->otherend_id,
-			pfn_to_mfn(page_to_pfn(page)),
-			0);
+		ret = xennet_alloc_rx_ref(dev, pfn_to_mfn(page_to_pfn(page)),
+					  page_address(page), requeue_idx, ref);
+		if ((signed short)ret < 0)
+			break;
+
 		req->gref = ref;
 		req->id   = requeue_idx;
 
-- 
1.7.3.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 07:07:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 07:07:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYtXF-0000nR-OL; Thu, 15 Nov 2012 07:06:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYtXE-0000n0-44
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 07:06:48 +0000
Received: from [85.158.137.99:42737] by server-4.bemta-3.messagelabs.com id
	15/D8-30023-78494A05; Thu, 15 Nov 2012 07:06:47 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352963204!19056537!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NDM1NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25236 invoked from network); 15 Nov 2012 07:06:46 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-14.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 07:06:46 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF76fQr009178
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 07:06:42 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF76fuI005050
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 07:06:41 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF76fsk028382; Thu, 15 Nov 2012 01:06:41 -0600
Received: from localhost.cn.oracle.com (/10.182.37.205)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 23:06:40 -0800
From: Annie Li <annie.li@oracle.com>
To: xen-devel@lists.xensource.com, netdev@vger.kernel.org,
	konrad.wilk@oracle.com, Ian.Campbell@citrix.com
Date: Thu, 15 Nov 2012 15:05:33 +0800
Message-Id: <1352963133-657-1-git-send-email-annie.li@oracle.com>
X-Mailer: git-send-email 1.7.3.4
In-Reply-To: <1352962987-541-1-git-send-email-annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: annie.li@oracle.com
Subject: [Xen-devel] [PATCH 4/4] fix code indent issue in xen-netfront.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Annie Li <annie.li@oracle.com>
---
 drivers/net/xen-netfront.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 17b81c0..66bb29f 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -202,7 +202,7 @@ static struct sk_buff *xennet_get_rx_skb(struct netfront_info *np,
 }
 
 static grant_ref_t xennet_get_rx_ref(struct netfront_info *np,
-					    RING_IDX ri)
+				     RING_IDX ri)
 {
 	int i = xennet_rxidx(ri);
 	grant_ref_t ref = np->grant_rx_ref[i];
@@ -1420,7 +1420,7 @@ static void xennet_uninit(struct net_device *dev)
 }
 
 static netdev_features_t xennet_fix_features(struct net_device *dev,
-	netdev_features_t features)
+					     netdev_features_t features)
 {
 	struct netfront_info *np = netdev_priv(dev);
 	int val;
@@ -1447,7 +1447,7 @@ static netdev_features_t xennet_fix_features(struct net_device *dev,
 }
 
 static int xennet_set_features(struct net_device *dev,
-	netdev_features_t features)
+			       netdev_features_t features)
 {
 	if (!(features & NETIF_F_SG) && dev->mtu > ETH_DATA_LEN) {
 		netdev_info(dev, "Reducing MTU because no SG offload");
-- 
1.7.3.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 07:07:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 07:07:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYtXF-0000nR-OL; Thu, 15 Nov 2012 07:06:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYtXE-0000n0-44
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 07:06:48 +0000
Received: from [85.158.137.99:42737] by server-4.bemta-3.messagelabs.com id
	15/D8-30023-78494A05; Thu, 15 Nov 2012 07:06:47 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352963204!19056537!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NDM1NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25236 invoked from network); 15 Nov 2012 07:06:46 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-14.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 07:06:46 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF76fQr009178
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 07:06:42 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF76fuI005050
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 07:06:41 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF76fsk028382; Thu, 15 Nov 2012 01:06:41 -0600
Received: from localhost.cn.oracle.com (/10.182.37.205)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 14 Nov 2012 23:06:40 -0800
From: Annie Li <annie.li@oracle.com>
To: xen-devel@lists.xensource.com, netdev@vger.kernel.org,
	konrad.wilk@oracle.com, Ian.Campbell@citrix.com
Date: Thu, 15 Nov 2012 15:05:33 +0800
Message-Id: <1352963133-657-1-git-send-email-annie.li@oracle.com>
X-Mailer: git-send-email 1.7.3.4
In-Reply-To: <1352962987-541-1-git-send-email-annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: annie.li@oracle.com
Subject: [Xen-devel] [PATCH 4/4] fix code indent issue in xen-netfront.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Annie Li <annie.li@oracle.com>
---
 drivers/net/xen-netfront.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 17b81c0..66bb29f 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -202,7 +202,7 @@ static struct sk_buff *xennet_get_rx_skb(struct netfront_info *np,
 }
 
 static grant_ref_t xennet_get_rx_ref(struct netfront_info *np,
-					    RING_IDX ri)
+				     RING_IDX ri)
 {
 	int i = xennet_rxidx(ri);
 	grant_ref_t ref = np->grant_rx_ref[i];
@@ -1420,7 +1420,7 @@ static void xennet_uninit(struct net_device *dev)
 }
 
 static netdev_features_t xennet_fix_features(struct net_device *dev,
-	netdev_features_t features)
+					     netdev_features_t features)
 {
 	struct netfront_info *np = netdev_priv(dev);
 	int val;
@@ -1447,7 +1447,7 @@ static netdev_features_t xennet_fix_features(struct net_device *dev,
 }
 
 static int xennet_set_features(struct net_device *dev,
-	netdev_features_t features)
+			       netdev_features_t features)
 {
 	if (!(features & NETIF_F_SG) && dev->mtu > ETH_DATA_LEN) {
 		netdev_info(dev, "Reducing MTU because no SG offload");
-- 
1.7.3.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 07:41:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 07:41:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYu4O-0001l9-N5; Thu, 15 Nov 2012 07:41:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TYu4M-0001l4-Er
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 07:41:02 +0000
Received: from [85.158.143.99:30629] by server-1.bemta-4.messagelabs.com id
	CB/10-27934-D8C94A05; Thu, 15 Nov 2012 07:41:01 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-6.tower-216.messagelabs.com!1352965260!22967322!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDc4Mjk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18514 invoked from network); 15 Nov 2012 07:41:00 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 07:41:00 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 8F5212528;
	Thu, 15 Nov 2012 09:40:58 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 57167EC027; Thu, 15 Nov 2012 09:40:58 +0200 (EET)
Date: Thu, 15 Nov 2012 09:40:58 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Annie Li <annie.li@oracle.com>
Message-ID: <20121115074057.GO8912@reaktio.net>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352962987-541-1-git-send-email-annie.li@oracle.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: netdev@vger.kernel.org, xen-devel@lists.xensource.com,
	Ian.Campbell@citrix.com, konrad.wilk@oracle.com
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
 xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
> This patch implements persistent grants for xen-netfront/netback. This
> mechanism maintains page pools in netback/netfront, these page pools is used to
> save grant pages which are mapped. This way improve performance which is wasted
> when doing grant operations.
> 
> Current netback/netfront does map/unmap grant operations frequently when
> transmitting/receiving packets, and grant operations costs much cpu clock. In
> this patch, netfront/netback maps grant pages when needed and then saves them
> into a page pool for future use. All these pages will be unmapped when
> removing/releasing the net device.
> 

Do you have performance numbers available already? with/without persistent grants? 


> In netfront, two pools are maintained for transmitting and receiving packets.
> When new grant pages are needed, the driver gets grant pages from this pool
> first. If no free grant page exists, it allocates new page, maps it and then
> saves it into the pool. The pool size for transmit/receive is exactly tx/rx
> ring size. The driver uses memcpy(not grantcopy) to copy data grant pages.
> Here, memcpy is copying the whole page size data. I tried to copy len size data
> from offset, but network does not seem work well. I am trying to find the root
> cause now.
> 
> In netback, it also maintains two page pools for tx/rx. When netback gets a
> request, it does a search first to find out whether the grant reference of
> this request is already mapped into its page pool. If the grant ref is mapped,
> the address of this mapped page is gotten and memcpy is used to copy data
> between grant pages. However, if the grant ref is not mapped, a new page is
> allocated, mapped with this grant ref, and then saved into page pool for
> future use. Similarly, memcpy replaces grant copy to copy data between grant
> pages. In this implementation, two arrays(gnttab_tx_vif,gnttab_rx_vif) are
> used to save vif pointer for every request because current netback is not
> per-vif based. This would be changed after implementing 1:1 model in netback.
> 

Btw is xen-netback/xen-netfront multiqueue support something you're planning to implement aswell? 
multiqueue allows single vif scaling to multiple vcpus/cores.


Thanks,

-- Pasi


> This patch supports both persistent-grant and non persistent grant. A new
> xenstore key "feature-persistent-grants" is used to represent this feature.
> 
> This patch is based on linux3.4-rc3. I hit netperf/netserver failure on
> linux latest version v3.7-rc1, v3.7-rc2 and v3.7-rc4. Not sure whether this
> netperf/netserver failure connects compound page commit in v3.7-rc1, but I did
> hit BUG_ON with debug patch from thread
> http://lists.xen.org/archives/html/xen-devel/2012-10/msg00893.html
> 
> 
> Annie Li (4):
>   xen/netback: implements persistent grant with one page pool.
>   xen/netback: Split one page pool into two(tx/rx) page pool.
>   Xen/netfront: Implement persistent grant in netfront.
>   fix code indent issue in xen-netfront.
> 
>  drivers/net/xen-netback/common.h    |   24 ++-
>  drivers/net/xen-netback/interface.c |   26 +++
>  drivers/net/xen-netback/netback.c   |  215 ++++++++++++++++++--
>  drivers/net/xen-netback/xenbus.c    |   14 ++-
>  drivers/net/xen-netfront.c          |  378 +++++++++++++++++++++++++++++------
>  5 files changed, 570 insertions(+), 87 deletions(-)
> 
> -- 
> 1.7.3.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 07:41:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 07:41:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYu4O-0001l9-N5; Thu, 15 Nov 2012 07:41:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TYu4M-0001l4-Er
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 07:41:02 +0000
Received: from [85.158.143.99:30629] by server-1.bemta-4.messagelabs.com id
	CB/10-27934-D8C94A05; Thu, 15 Nov 2012 07:41:01 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-6.tower-216.messagelabs.com!1352965260!22967322!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDc4Mjk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18514 invoked from network); 15 Nov 2012 07:41:00 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 07:41:00 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 8F5212528;
	Thu, 15 Nov 2012 09:40:58 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 57167EC027; Thu, 15 Nov 2012 09:40:58 +0200 (EET)
Date: Thu, 15 Nov 2012 09:40:58 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Annie Li <annie.li@oracle.com>
Message-ID: <20121115074057.GO8912@reaktio.net>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352962987-541-1-git-send-email-annie.li@oracle.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: netdev@vger.kernel.org, xen-devel@lists.xensource.com,
	Ian.Campbell@citrix.com, konrad.wilk@oracle.com
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
 xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
> This patch implements persistent grants for xen-netfront/netback. This
> mechanism maintains page pools in netback/netfront, these page pools is used to
> save grant pages which are mapped. This way improve performance which is wasted
> when doing grant operations.
> 
> Current netback/netfront does map/unmap grant operations frequently when
> transmitting/receiving packets, and grant operations costs much cpu clock. In
> this patch, netfront/netback maps grant pages when needed and then saves them
> into a page pool for future use. All these pages will be unmapped when
> removing/releasing the net device.
> 

Do you have performance numbers available already? with/without persistent grants? 


> In netfront, two pools are maintained for transmitting and receiving packets.
> When new grant pages are needed, the driver gets grant pages from this pool
> first. If no free grant page exists, it allocates new page, maps it and then
> saves it into the pool. The pool size for transmit/receive is exactly tx/rx
> ring size. The driver uses memcpy(not grantcopy) to copy data grant pages.
> Here, memcpy is copying the whole page size data. I tried to copy len size data
> from offset, but network does not seem work well. I am trying to find the root
> cause now.
> 
> In netback, it also maintains two page pools for tx/rx. When netback gets a
> request, it does a search first to find out whether the grant reference of
> this request is already mapped into its page pool. If the grant ref is mapped,
> the address of this mapped page is gotten and memcpy is used to copy data
> between grant pages. However, if the grant ref is not mapped, a new page is
> allocated, mapped with this grant ref, and then saved into page pool for
> future use. Similarly, memcpy replaces grant copy to copy data between grant
> pages. In this implementation, two arrays(gnttab_tx_vif,gnttab_rx_vif) are
> used to save vif pointer for every request because current netback is not
> per-vif based. This would be changed after implementing 1:1 model in netback.
> 

Btw is xen-netback/xen-netfront multiqueue support something you're planning to implement aswell? 
multiqueue allows single vif scaling to multiple vcpus/cores.


Thanks,

-- Pasi


> This patch supports both persistent-grant and non persistent grant. A new
> xenstore key "feature-persistent-grants" is used to represent this feature.
> 
> This patch is based on linux3.4-rc3. I hit netperf/netserver failure on
> linux latest version v3.7-rc1, v3.7-rc2 and v3.7-rc4. Not sure whether this
> netperf/netserver failure connects compound page commit in v3.7-rc1, but I did
> hit BUG_ON with debug patch from thread
> http://lists.xen.org/archives/html/xen-devel/2012-10/msg00893.html
> 
> 
> Annie Li (4):
>   xen/netback: implements persistent grant with one page pool.
>   xen/netback: Split one page pool into two(tx/rx) page pool.
>   Xen/netfront: Implement persistent grant in netfront.
>   fix code indent issue in xen-netfront.
> 
>  drivers/net/xen-netback/common.h    |   24 ++-
>  drivers/net/xen-netback/interface.c |   26 +++
>  drivers/net/xen-netback/netback.c   |  215 ++++++++++++++++++--
>  drivers/net/xen-netback/xenbus.c    |   14 ++-
>  drivers/net/xen-netfront.c          |  378 +++++++++++++++++++++++++++++------
>  5 files changed, 570 insertions(+), 87 deletions(-)
> 
> -- 
> 1.7.3.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 07:57:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 07:57:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYuKE-00029M-9r; Thu, 15 Nov 2012 07:57:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYuKD-00029H-Ap
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 07:57:25 +0000
Received: from [193.109.254.147:51069] by server-4.bemta-14.messagelabs.com id
	F5/6C-18856-460A4A05; Thu, 15 Nov 2012 07:57:24 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1352966242!11024885!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg2MzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7079 invoked from network); 15 Nov 2012 07:57:22 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 07:57:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15819257"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 07:57:11 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 07:57:10 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYuJz-0004qi-6y;
	Thu, 15 Nov 2012 07:57:11 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYuJy-0007C2-VG;
	Thu, 15 Nov 2012 07:57:11 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14396-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 15 Nov 2012 07:57:11 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.0-testing test] 14396: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14396 xen-4.0-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14396/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-sedf-pin  5 xen-boot                    fail pass in 14391
 test-amd64-amd64-xl-qemuu-win7-amd64  5 xen-boot            fail pass in 14391
 test-amd64-i386-xl-win7-amd64  7 windows-install            fail pass in 14391
 test-amd64-i386-rhel6hvm-intel 3 host-install(3) broken in 14391 pass in 14396

Regressions which are regarded as allowable (not blocking):
 test-amd64-i386-xl-credit2    5 xen-boot                     fail   like 13719
 test-amd64-amd64-xl-sedf-pin 13 guest-localmigrate.2 fail in 14391 REGR. vs. 13719

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail never pass
 test-amd64-amd64-xl-sedf     15 guest-stop                   fail   never pass
 test-amd64-amd64-xl          15 guest-stop                   fail   never pass
 test-i386-i386-xl            15 guest-stop                   fail   never pass
 test-amd64-i386-xl-multivcpu 15 guest-stop                   fail   never pass
 test-amd64-i386-xl           15 guest-stop                   fail   never pass
 test-amd64-amd64-xl-win7-amd64  8 guest-saverestore            fail never pass
 test-amd64-i386-qemuu-rhel6hvm-intel  7 redhat-install         fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-qemuu-rhel6hvm-amd  7 redhat-install           fail never pass
 test-amd64-i386-rhel6hvm-amd  7 redhat-install               fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-rhel6hvm-intel  7 redhat-install               fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1  7 windows-install          fail never pass
 test-i386-i386-xl-winxpsp3    7 windows-install              fail   never pass
 test-amd64-amd64-xl-win       7 windows-install              fail   never pass
 test-i386-i386-xl-win         7 windows-install              fail   never pass
 test-amd64-i386-xl-win-vcpus1  7 windows-install              fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  7 windows-install          fail never pass
 test-amd64-amd64-xl-winxpsp3  7 windows-install              fail   never pass
 test-i386-i386-xl-qemuu-winxpsp3  7 windows-install            fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 8 guest-saverestore fail in 14391 never pass
 test-amd64-i386-xl-win7-amd64  8 guest-saverestore    fail in 14391 never pass

version targeted for testing:
 xen                  68d7b9cc8259
baseline version:
 xen                  1d1538beeada

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-i386-xl                                           fail    
 test-i386-i386-xl                                            fail    
 test-amd64-i386-rhel6hvm-amd                                 fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   fail    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               fail    
 test-amd64-i386-qemuu-rhel6hvm-intel                         fail    
 test-amd64-i386-xl-multivcpu                                 fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.0-testing
+ revision=68d7b9cc8259
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.0-testing 68d7b9cc8259
+ branch=xen-4.0-testing
+ revision=68d7b9cc8259
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.0-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.0-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.0-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.0-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.0-testing.git
++ : daily-cron.xen-4.0-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.0-testing.git
+ info_linux_tree xen-4.0-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.0-testing.hg
+ hg push -r 68d7b9cc8259 ssh://xen@xenbits.xensource.com/HG/xen-4.0-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.0-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 4 changesets with 5 changes to 5 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 07:57:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 07:57:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYuKE-00029M-9r; Thu, 15 Nov 2012 07:57:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYuKD-00029H-Ap
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 07:57:25 +0000
Received: from [193.109.254.147:51069] by server-4.bemta-14.messagelabs.com id
	F5/6C-18856-460A4A05; Thu, 15 Nov 2012 07:57:24 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1352966242!11024885!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg2MzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7079 invoked from network); 15 Nov 2012 07:57:22 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 07:57:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15819257"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 07:57:11 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 07:57:10 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYuJz-0004qi-6y;
	Thu, 15 Nov 2012 07:57:11 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYuJy-0007C2-VG;
	Thu, 15 Nov 2012 07:57:11 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14396-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 15 Nov 2012 07:57:11 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.0-testing test] 14396: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14396 xen-4.0-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14396/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-sedf-pin  5 xen-boot                    fail pass in 14391
 test-amd64-amd64-xl-qemuu-win7-amd64  5 xen-boot            fail pass in 14391
 test-amd64-i386-xl-win7-amd64  7 windows-install            fail pass in 14391
 test-amd64-i386-rhel6hvm-intel 3 host-install(3) broken in 14391 pass in 14396

Regressions which are regarded as allowable (not blocking):
 test-amd64-i386-xl-credit2    5 xen-boot                     fail   like 13719
 test-amd64-amd64-xl-sedf-pin 13 guest-localmigrate.2 fail in 14391 REGR. vs. 13719

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail never pass
 test-amd64-amd64-xl-sedf     15 guest-stop                   fail   never pass
 test-amd64-amd64-xl          15 guest-stop                   fail   never pass
 test-i386-i386-xl            15 guest-stop                   fail   never pass
 test-amd64-i386-xl-multivcpu 15 guest-stop                   fail   never pass
 test-amd64-i386-xl           15 guest-stop                   fail   never pass
 test-amd64-amd64-xl-win7-amd64  8 guest-saverestore            fail never pass
 test-amd64-i386-qemuu-rhel6hvm-intel  7 redhat-install         fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-qemuu-rhel6hvm-amd  7 redhat-install           fail never pass
 test-amd64-i386-rhel6hvm-amd  7 redhat-install               fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-rhel6hvm-intel  7 redhat-install               fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1  7 windows-install          fail never pass
 test-i386-i386-xl-winxpsp3    7 windows-install              fail   never pass
 test-amd64-amd64-xl-win       7 windows-install              fail   never pass
 test-i386-i386-xl-win         7 windows-install              fail   never pass
 test-amd64-i386-xl-win-vcpus1  7 windows-install              fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  7 windows-install          fail never pass
 test-amd64-amd64-xl-winxpsp3  7 windows-install              fail   never pass
 test-i386-i386-xl-qemuu-winxpsp3  7 windows-install            fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 8 guest-saverestore fail in 14391 never pass
 test-amd64-i386-xl-win7-amd64  8 guest-saverestore    fail in 14391 never pass

version targeted for testing:
 xen                  68d7b9cc8259
baseline version:
 xen                  1d1538beeada

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-i386-xl                                           fail    
 test-i386-i386-xl                                            fail    
 test-amd64-i386-rhel6hvm-amd                                 fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   fail    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               fail    
 test-amd64-i386-qemuu-rhel6hvm-intel                         fail    
 test-amd64-i386-xl-multivcpu                                 fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.0-testing
+ revision=68d7b9cc8259
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.0-testing 68d7b9cc8259
+ branch=xen-4.0-testing
+ revision=68d7b9cc8259
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.0-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.0-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.0-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.0-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.0-testing.git
++ : daily-cron.xen-4.0-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.0-testing.git
+ info_linux_tree xen-4.0-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.0-testing.hg
+ hg push -r 68d7b9cc8259 ssh://xen@xenbits.xensource.com/HG/xen-4.0-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.0-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 4 changesets with 5 changes to 5 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 08:24:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 08:24:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYujq-0003AB-HO; Thu, 15 Nov 2012 08:23:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TYujp-00039f-1l
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 08:23:53 +0000
Received: from [85.158.139.83:20313] by server-16.bemta-5.messagelabs.com id
	E5/44-04786-896A4A05; Thu, 15 Nov 2012 08:23:52 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1352967829!30367305!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzIyMzQ1\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20686 invoked from network); 15 Nov 2012 08:23:50 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-3.tower-182.messagelabs.com with SMTP;
	15 Nov 2012 08:23:50 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga101.jf.intel.com with ESMTP; 15 Nov 2012 00:23:48 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,255,1352102400"; d="scan'208";a="242561572"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by orsmga002.jf.intel.com with ESMTP; 15 Nov 2012 00:23:48 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 15 Nov 2012 00:23:48 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Thu, 15 Nov 2012 16:23:46 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, "Zhang, Yang Z" <yang.z.zhang@intel.com>
Thread-Topic: [Xen-devel] iommu=dom0-passthrough behavior
Thread-Index: AQHNwXYJqLF+2AjHBkK5l/uG97/aIZfnbfFggAAyLdWAADp0YP//g6QAgAEdtPCAAFY0AIABvW7Q
Date: Thu, 15 Nov 2012 08:23:45 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A4834564403374F44@SHSMSX101.ccr.corp.intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
	<50A2755402000078000A837D@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
	<50A3AD4E02000078000A87BD@nat28.tlf.novell.com>
In-Reply-To: <50A3AD4E02000078000A87BD@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>, "Zhang,
	Xiantao" <xiantao.zhang@intel.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Wednesday, November 14, 2012 9:40 PM
> To: Zhang, Xiantao; Zhang, Yang Z
> Cc: wei.huang2@amd.com; weiwang.dd@gmail.com; xen-devel
> Subject: RE: [Xen-devel] iommu=dom0-passthrough behavior
> 
> >>> On 14.11.12 at 01:37, "Zhang, Xiantao" <xiantao.zhang@intel.com>
> wrote:
> >> >> c) we could provide a command line option to allow fake devices to
> >> >>     be create
> >> >
> >> > Agree, this maybe a feasible solution I can figure out, so far.
> >> >
> >> >> d) we could create context entries for all BDFs, whether or not a
> >> >>     device exists there
> >> >
> >> > As I said,  this maybe bring security issue. Even for the
> >> > iommu-passthrough option,  it is also not suggested to be used if
> >> > security
> > is
> >> considered.
> >>
> >> As said - it is clear that the basic thing here (using
> >> "iommu=dom0-passthrough") is already weakening security. So security
> >> isn't the concern in this discussion, that's left to whoever is
> >> intending to use
> > that
> >> option.
> >
> > Okay,  I vote your option C if don't care security.
> 
> Which, if I'm not mistaken, could be implemented entirely independent of
> "iommu=dom0-passthrough". I'll see if that helps on the offending system.

I mean this one: 
>>c) we could provide a command line option to allow fake devices to be create

Yes,  I don't think "iommu=dom0-passthrough" can meet your requirement.
 We had better add a cmd line option to  pass the related information to hypervisor and VT-d can create 
the pass-through context entry  for the undetectable device.  


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 08:24:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 08:24:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYujq-0003AB-HO; Thu, 15 Nov 2012 08:23:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TYujp-00039f-1l
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 08:23:53 +0000
Received: from [85.158.139.83:20313] by server-16.bemta-5.messagelabs.com id
	E5/44-04786-896A4A05; Thu, 15 Nov 2012 08:23:52 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1352967829!30367305!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzIyMzQ1\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20686 invoked from network); 15 Nov 2012 08:23:50 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-3.tower-182.messagelabs.com with SMTP;
	15 Nov 2012 08:23:50 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga101.jf.intel.com with ESMTP; 15 Nov 2012 00:23:48 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,255,1352102400"; d="scan'208";a="242561572"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by orsmga002.jf.intel.com with ESMTP; 15 Nov 2012 00:23:48 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 15 Nov 2012 00:23:48 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.186]) with mapi id
	14.01.0355.002; Thu, 15 Nov 2012 16:23:46 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, "Zhang, Yang Z" <yang.z.zhang@intel.com>
Thread-Topic: [Xen-devel] iommu=dom0-passthrough behavior
Thread-Index: AQHNwXYJqLF+2AjHBkK5l/uG97/aIZfnbfFggAAyLdWAADp0YP//g6QAgAEdtPCAAFY0AIABvW7Q
Date: Thu, 15 Nov 2012 08:23:45 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A4834564403374F44@SHSMSX101.ccr.corp.intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
	<50A2755402000078000A837D@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
	<50A3AD4E02000078000A87BD@nat28.tlf.novell.com>
In-Reply-To: <50A3AD4E02000078000A87BD@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>, "Zhang,
	Xiantao" <xiantao.zhang@intel.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Wednesday, November 14, 2012 9:40 PM
> To: Zhang, Xiantao; Zhang, Yang Z
> Cc: wei.huang2@amd.com; weiwang.dd@gmail.com; xen-devel
> Subject: RE: [Xen-devel] iommu=dom0-passthrough behavior
> 
> >>> On 14.11.12 at 01:37, "Zhang, Xiantao" <xiantao.zhang@intel.com>
> wrote:
> >> >> c) we could provide a command line option to allow fake devices to
> >> >>     be create
> >> >
> >> > Agree, this maybe a feasible solution I can figure out, so far.
> >> >
> >> >> d) we could create context entries for all BDFs, whether or not a
> >> >>     device exists there
> >> >
> >> > As I said,  this maybe bring security issue. Even for the
> >> > iommu-passthrough option,  it is also not suggested to be used if
> >> > security
> > is
> >> considered.
> >>
> >> As said - it is clear that the basic thing here (using
> >> "iommu=dom0-passthrough") is already weakening security. So security
> >> isn't the concern in this discussion, that's left to whoever is
> >> intending to use
> > that
> >> option.
> >
> > Okay,  I vote your option C if don't care security.
> 
> Which, if I'm not mistaken, could be implemented entirely independent of
> "iommu=dom0-passthrough". I'll see if that helps on the offending system.

I mean this one: 
>>c) we could provide a command line option to allow fake devices to be create

Yes,  I don't think "iommu=dom0-passthrough" can meet your requirement.
 We had better add a cmd line option to  pass the related information to hypervisor and VT-d can create 
the pass-through context entry  for the undetectable device.  


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 08:39:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 08:39:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYuyG-0003Wn-6P; Thu, 15 Nov 2012 08:38:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYuyF-0003Wg-9V
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 08:38:47 +0000
Received: from [85.158.137.99:43133] by server-15.bemta-3.messagelabs.com id
	A5/F3-09445-61AA4A05; Thu, 15 Nov 2012 08:38:46 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352968724!19068508!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTQwMTg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29769 invoked from network); 15 Nov 2012 08:38:45 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-14.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 08:38:45 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF8cWvV022263
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 08:38:33 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF8cVrs026985
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 08:38:32 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF8cVRN021530; Thu, 15 Nov 2012 02:38:31 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 00:38:30 -0800
Message-ID: <50A4AA06.8080900@oracle.com>
Date: Thu, 15 Nov 2012 16:38:30 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: =?ISO-8859-1?Q?Pasi_K=E4rkk=E4inen?= <pasik@iki.fi>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net>
In-Reply-To: <20121115074057.GO8912@reaktio.net>
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: netdev@vger.kernel.org, xen-devel@lists.xensource.com,
	Ian.Campbell@citrix.com, konrad.wilk@oracle.com
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-15 15:40, Pasi K=E4rkk=E4inen wrote:
> Hello,
>
> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
>> This patch implements persistent grants for xen-netfront/netback. This
>> mechanism maintains page pools in netback/netfront, these page pools is =
used to
>> save grant pages which are mapped. This way improve performance which is=
 wasted
>> when doing grant operations.
>>
>> Current netback/netfront does map/unmap grant operations frequently when
>> transmitting/receiving packets, and grant operations costs much cpu cloc=
k. In
>> this patch, netfront/netback maps grant pages when needed and then saves=
 them
>> into a page pool for future use. All these pages will be unmapped when
>> removing/releasing the net device.
>>
> Do you have performance numbers available already? with/without persisten=
t grants?
I have some simple netperf/netserver test result with/without persistent =

grants,

Following is result of with persistent grant patch,

Guests, Sum,      Avg,     Min,     Max
  1,  15106.4,  15106.4, 15106.36, 15106.36
  2,  13052.7,  6526.34,  6261.81,  6790.86
  3,  12675.1,  6337.53,  6220.24,  6454.83
  4,  13194,  6596.98,  6274.70,  6919.25


Following are result of without persistent patch

Guests, Sum,     Avg,    Min,        Max
  1,  10864.1,  10864.1, 10864.10, 10864.10
  2,  10898.5,  5449.24,  4862.08,  6036.40
  3,  10734.5,  5367.26,  5261.43,  5473.08
  4,  10924,    5461.99,  5314.84,  5609.14

>> In netfront, two pools are maintained for transmitting and receiving pac=
kets.
>> When new grant pages are needed, the driver gets grant pages from this p=
ool
>> first. If no free grant page exists, it allocates new page, maps it and =
then
>> saves it into the pool. The pool size for transmit/receive is exactly tx=
/rx
>> ring size. The driver uses memcpy(not grantcopy) to copy data grant page=
s.
>> Here, memcpy is copying the whole page size data. I tried to copy len si=
ze data
>> from offset, but network does not seem work well. I am trying to find th=
e root
>> cause now.
>>
>> In netback, it also maintains two page pools for tx/rx. When netback get=
s a
>> request, it does a search first to find out whether the grant reference =
of
>> this request is already mapped into its page pool. If the grant ref is m=
apped,
>> the address of this mapped page is gotten and memcpy is used to copy data
>> between grant pages. However, if the grant ref is not mapped, a new page=
 is
>> allocated, mapped with this grant ref, and then saved into page pool for
>> future use. Similarly, memcpy replaces grant copy to copy data between g=
rant
>> pages. In this implementation, two arrays(gnttab_tx_vif,gnttab_rx_vif) a=
re
>> used to save vif pointer for every request because current netback is not
>> per-vif based. This would be changed after implementing 1:1 model in net=
back.
>>
> Btw is xen-netback/xen-netfront multiqueue support something you're plann=
ing to implement aswell?
Currently, some patches exist for implementing 1:1 model in netback, but =

this should be different from what you mentioned, and they are not ready =

for upstream.
These patches make netback thread per VIF, and mainly implement some =

concepts from netchannel2, such as multipage rings, seperate tx and rx =

rings, seperate tx and rx event channels, etc.

Thanks
Annie

> multiqueue allows single vif scaling to multiple vcpus/cores.
>
>
> Thanks,
>
> -- Pasi
>
>
>> This patch supports both persistent-grant and non persistent grant. A new
>> xenstore key "feature-persistent-grants" is used to represent this featu=
re.
>>
>> This patch is based on linux3.4-rc3. I hit netperf/netserver failure on
>> linux latest version v3.7-rc1, v3.7-rc2 and v3.7-rc4. Not sure whether t=
his
>> netperf/netserver failure connects compound page commit in v3.7-rc1, but=
 I did
>> hit BUG_ON with debug patch from thread
>> http://lists.xen.org/archives/html/xen-devel/2012-10/msg00893.html
>>
>>
>> Annie Li (4):
>>    xen/netback: implements persistent grant with one page pool.
>>    xen/netback: Split one page pool into two(tx/rx) page pool.
>>    Xen/netfront: Implement persistent grant in netfront.
>>    fix code indent issue in xen-netfront.
>>
>>   drivers/net/xen-netback/common.h    |   24 ++-
>>   drivers/net/xen-netback/interface.c |   26 +++
>>   drivers/net/xen-netback/netback.c   |  215 ++++++++++++++++++--
>>   drivers/net/xen-netback/xenbus.c    |   14 ++-
>>   drivers/net/xen-netfront.c          |  378 +++++++++++++++++++++++++++=
++------
>>   5 files changed, 570 insertions(+), 87 deletions(-)
>>
>> -- =

>> 1.7.3.4
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 08:39:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 08:39:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYuyG-0003Wn-6P; Thu, 15 Nov 2012 08:38:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYuyF-0003Wg-9V
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 08:38:47 +0000
Received: from [85.158.137.99:43133] by server-15.bemta-3.messagelabs.com id
	A5/F3-09445-61AA4A05; Thu, 15 Nov 2012 08:38:46 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352968724!19068508!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTQwMTg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29769 invoked from network); 15 Nov 2012 08:38:45 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-14.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 08:38:45 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF8cWvV022263
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 08:38:33 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF8cVrs026985
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 08:38:32 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF8cVRN021530; Thu, 15 Nov 2012 02:38:31 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 00:38:30 -0800
Message-ID: <50A4AA06.8080900@oracle.com>
Date: Thu, 15 Nov 2012 16:38:30 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: =?ISO-8859-1?Q?Pasi_K=E4rkk=E4inen?= <pasik@iki.fi>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net>
In-Reply-To: <20121115074057.GO8912@reaktio.net>
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: netdev@vger.kernel.org, xen-devel@lists.xensource.com,
	Ian.Campbell@citrix.com, konrad.wilk@oracle.com
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-15 15:40, Pasi K=E4rkk=E4inen wrote:
> Hello,
>
> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
>> This patch implements persistent grants for xen-netfront/netback. This
>> mechanism maintains page pools in netback/netfront, these page pools is =
used to
>> save grant pages which are mapped. This way improve performance which is=
 wasted
>> when doing grant operations.
>>
>> Current netback/netfront does map/unmap grant operations frequently when
>> transmitting/receiving packets, and grant operations costs much cpu cloc=
k. In
>> this patch, netfront/netback maps grant pages when needed and then saves=
 them
>> into a page pool for future use. All these pages will be unmapped when
>> removing/releasing the net device.
>>
> Do you have performance numbers available already? with/without persisten=
t grants?
I have some simple netperf/netserver test result with/without persistent =

grants,

Following is result of with persistent grant patch,

Guests, Sum,      Avg,     Min,     Max
  1,  15106.4,  15106.4, 15106.36, 15106.36
  2,  13052.7,  6526.34,  6261.81,  6790.86
  3,  12675.1,  6337.53,  6220.24,  6454.83
  4,  13194,  6596.98,  6274.70,  6919.25


Following are result of without persistent patch

Guests, Sum,     Avg,    Min,        Max
  1,  10864.1,  10864.1, 10864.10, 10864.10
  2,  10898.5,  5449.24,  4862.08,  6036.40
  3,  10734.5,  5367.26,  5261.43,  5473.08
  4,  10924,    5461.99,  5314.84,  5609.14

>> In netfront, two pools are maintained for transmitting and receiving pac=
kets.
>> When new grant pages are needed, the driver gets grant pages from this p=
ool
>> first. If no free grant page exists, it allocates new page, maps it and =
then
>> saves it into the pool. The pool size for transmit/receive is exactly tx=
/rx
>> ring size. The driver uses memcpy(not grantcopy) to copy data grant page=
s.
>> Here, memcpy is copying the whole page size data. I tried to copy len si=
ze data
>> from offset, but network does not seem work well. I am trying to find th=
e root
>> cause now.
>>
>> In netback, it also maintains two page pools for tx/rx. When netback get=
s a
>> request, it does a search first to find out whether the grant reference =
of
>> this request is already mapped into its page pool. If the grant ref is m=
apped,
>> the address of this mapped page is gotten and memcpy is used to copy data
>> between grant pages. However, if the grant ref is not mapped, a new page=
 is
>> allocated, mapped with this grant ref, and then saved into page pool for
>> future use. Similarly, memcpy replaces grant copy to copy data between g=
rant
>> pages. In this implementation, two arrays(gnttab_tx_vif,gnttab_rx_vif) a=
re
>> used to save vif pointer for every request because current netback is not
>> per-vif based. This would be changed after implementing 1:1 model in net=
back.
>>
> Btw is xen-netback/xen-netfront multiqueue support something you're plann=
ing to implement aswell?
Currently, some patches exist for implementing 1:1 model in netback, but =

this should be different from what you mentioned, and they are not ready =

for upstream.
These patches make netback thread per VIF, and mainly implement some =

concepts from netchannel2, such as multipage rings, seperate tx and rx =

rings, seperate tx and rx event channels, etc.

Thanks
Annie

> multiqueue allows single vif scaling to multiple vcpus/cores.
>
>
> Thanks,
>
> -- Pasi
>
>
>> This patch supports both persistent-grant and non persistent grant. A new
>> xenstore key "feature-persistent-grants" is used to represent this featu=
re.
>>
>> This patch is based on linux3.4-rc3. I hit netperf/netserver failure on
>> linux latest version v3.7-rc1, v3.7-rc2 and v3.7-rc4. Not sure whether t=
his
>> netperf/netserver failure connects compound page commit in v3.7-rc1, but=
 I did
>> hit BUG_ON with debug patch from thread
>> http://lists.xen.org/archives/html/xen-devel/2012-10/msg00893.html
>>
>>
>> Annie Li (4):
>>    xen/netback: implements persistent grant with one page pool.
>>    xen/netback: Split one page pool into two(tx/rx) page pool.
>>    Xen/netfront: Implement persistent grant in netfront.
>>    fix code indent issue in xen-netfront.
>>
>>   drivers/net/xen-netback/common.h    |   24 ++-
>>   drivers/net/xen-netback/interface.c |   26 +++
>>   drivers/net/xen-netback/netback.c   |  215 ++++++++++++++++++--
>>   drivers/net/xen-netback/xenbus.c    |   14 ++-
>>   drivers/net/xen-netfront.c          |  378 +++++++++++++++++++++++++++=
++------
>>   5 files changed, 570 insertions(+), 87 deletions(-)
>>
>> -- =

>> 1.7.3.4
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 08:47:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 08:47:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYv6l-0003pM-CL; Thu, 15 Nov 2012 08:47:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYv6j-0003pH-HR
	for Xen-devel@lists.xensource.com; Thu, 15 Nov 2012 08:47:33 +0000
Received: from [85.158.143.35:30190] by server-3.bemta-4.messagelabs.com id
	61/C2-06841-42CA4A05; Thu, 15 Nov 2012 08:47:32 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1352969252!7382159!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg2MzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23768 invoked from network); 15 Nov 2012 08:47:32 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 08:47:32 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15820340"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 08:47:32 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 08:47:31 +0000
Message-ID: <1352969250.3499.27.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>
Date: Thu, 15 Nov 2012 08:47:30 +0000
In-Reply-To: <20121114181354.568ce2db@mantra.us.oracle.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
	<1352800853.7491.22.camel@zakaz.uk.xensource.com>
	<20121113172138.1d3274d9@mantra.us.oracle.com>
	<20121113173138.61b21067@mantra.us.oracle.com>
	<1352887110.26873.15.camel@zakaz.uk.xensource.com>
	<20121114181354.568ce2db@mantra.us.oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 02:13 +0000, Mukesh Rathor wrote:
> On Wed, 14 Nov 2012 09:58:30 +0000
> Ian Campbell <Ian.Campbell@citrix.com> wrote:
> 
> Duuude!!! You owe me a beer next time we meet (was your code ;)), and I
> ain't making it a cheap one :).

:-)

> [...]
> This is a .S file and not C, and it puts null char after _4gb. Fixed it
> and now xc_dom_feature_translated() is returnig true. Whew! I'll send
> konrad a patch.

Wow, good catch! I had no idea that gas didn't concatenate strings!

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 08:47:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 08:47:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYv6l-0003pM-CL; Thu, 15 Nov 2012 08:47:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYv6j-0003pH-HR
	for Xen-devel@lists.xensource.com; Thu, 15 Nov 2012 08:47:33 +0000
Received: from [85.158.143.35:30190] by server-3.bemta-4.messagelabs.com id
	61/C2-06841-42CA4A05; Thu, 15 Nov 2012 08:47:32 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1352969252!7382159!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg2MzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23768 invoked from network); 15 Nov 2012 08:47:32 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 08:47:32 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15820340"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 08:47:32 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 08:47:31 +0000
Message-ID: <1352969250.3499.27.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>
Date: Thu, 15 Nov 2012 08:47:30 +0000
In-Reply-To: <20121114181354.568ce2db@mantra.us.oracle.com>
References: <20121112190934.5e702799@mantra.us.oracle.com>
	<1352800853.7491.22.camel@zakaz.uk.xensource.com>
	<20121113172138.1d3274d9@mantra.us.oracle.com>
	<20121113173138.61b21067@mantra.us.oracle.com>
	<1352887110.26873.15.camel@zakaz.uk.xensource.com>
	<20121114181354.568ce2db@mantra.us.oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] PVH: libxl expertise...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 02:13 +0000, Mukesh Rathor wrote:
> On Wed, 14 Nov 2012 09:58:30 +0000
> Ian Campbell <Ian.Campbell@citrix.com> wrote:
> 
> Duuude!!! You owe me a beer next time we meet (was your code ;)), and I
> ain't making it a cheap one :).

:-)

> [...]
> This is a .S file and not C, and it puts null char after _4gb. Fixed it
> and now xc_dom_feature_translated() is returnig true. Whew! I'll send
> konrad a patch.

Wow, good catch! I had no idea that gas didn't concatenate strings!

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 08:52:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 08:52:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvB5-00044l-4m; Thu, 15 Nov 2012 08:52:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYvB4-00044g-FL
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 08:52:02 +0000
Received: from [85.158.138.51:56543] by server-13.bemta-3.messagelabs.com id
	CD/18-24887-13DA4A05; Thu, 15 Nov 2012 08:52:01 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1352969520!21217840!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6120 invoked from network); 15 Nov 2012 08:52:00 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 08:52:00 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15820459"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 08:52:00 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 08:51:59 +0000
Message-ID: <1352969519.3499.30.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: ANNIE LI <annie.li@oracle.com>
Date: Thu, 15 Nov 2012 08:51:59 +0000
In-Reply-To: <50A4AA06.8080900@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
 xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVGh1LCAyMDEyLTExLTE1IGF0IDA4OjM4ICswMDAwLCBBTk5JRSBMSSB3cm90ZToKPiAKPiBP
biAyMDEyLTExLTE1IDE1OjQwLCBQYXNpIEvDpHJra8OkaW5lbiB3cm90ZToKPiA+IEhlbGxvLAo+
ID4KPiA+IE9uIFRodSwgTm92IDE1LCAyMDEy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RlbmQgYW5kIHZpY2UgdmVy
c2E/CgoKPiAKPiAKPiBGb2xsb3dpbmcgYXJlIHJlc3VsdCBvZiB3aXRob3V0IHBlcnNpc3RlbnQg
cGF0Y2gKPiAKPiBHdWVzdHMsIFN1bSwgICAgIEF2ZywgICAgTWluLCAgICAgICAgTWF4Cj4gICAx
LCAgMTA4NjQuMSwgIDEwODY0LjEsIDEwODY0LjEwLCAxMDg2NC4xMAo+ICAgMiwgIDEwODk4LjUs
ICA1NDQ5LjI0LCAgNDg2Mi4wOCwgIDYwMzYuNDAKPiAgIDMsICAxMDczNC41LCAgNTM2Ny4yNiwg
IDUyNjEuNDMsICA1NDczLjA4Cj4gICA0LCAgMTA5MjQsICAgIDU0NjEuOTksICA1MzE0Ljg0LCAg
NTYwOS4xNAoKCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
XwpYZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9s
aXN0cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Thu Nov 15 08:52:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 08:52:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvB5-00044l-4m; Thu, 15 Nov 2012 08:52:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYvB4-00044g-FL
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 08:52:02 +0000
Received: from [85.158.138.51:56543] by server-13.bemta-3.messagelabs.com id
	CD/18-24887-13DA4A05; Thu, 15 Nov 2012 08:52:01 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1352969520!21217840!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6120 invoked from network); 15 Nov 2012 08:52:00 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 08:52:00 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15820459"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 08:52:00 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 08:51:59 +0000
Message-ID: <1352969519.3499.30.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: ANNIE LI <annie.li@oracle.com>
Date: Thu, 15 Nov 2012 08:51:59 +0000
In-Reply-To: <50A4AA06.8080900@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
 xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVGh1LCAyMDEyLTExLTE1IGF0IDA4OjM4ICswMDAwLCBBTk5JRSBMSSB3cm90ZToKPiAKPiBP
biAyMDEyLTExLTE1IDE1OjQwLCBQYXNpIEvDpHJra8OkaW5lbiB3cm90ZToKPiA+IEhlbGxvLAo+
ID4KPiA+IE9uIFRodSwgTm92IDE1LCAyMDEyIGF0IDAzOjAzOjA3UE0gKzA4MDAsIEFubmllIExp
IHdyb3RlOgo+ID4+IFRoaXMgcGF0Y2ggaW1wbGVtZW50cyBwZXJzaXN0ZW50IGdyYW50cyBmb3Ig
eGVuLW5ldGZyb250L25ldGJhY2suIFRoaXMKPiA+PiBtZWNoYW5pc20gbWFpbnRhaW5zIHBhZ2Ug
cG9vbHMgaW4gbmV0YmFjay9uZXRmcm9udCwgdGhlc2UgcGFnZSBwb29scyBpcyB1c2VkIHRvCj4g
Pj4gc2F2ZSBncmFudCBwYWdlcyB3aGljaCBhcmUgbWFwcGVkLiBUaGlzIHdheSBpbXByb3ZlIHBl
cmZvcm1hbmNlIHdoaWNoIGlzIHdhc3RlZAo+ID4+IHdoZW4gZG9pbmcgZ3JhbnQgb3BlcmF0aW9u
cy4KPiA+Pgo+ID4+IEN1cnJlbnQgbmV0YmFjay9uZXRmcm9udCBkb2VzIG1hcC91bm1hcCBncmFu
dCBvcGVyYXRpb25zIGZyZXF1ZW50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4ub3JnCmh0dHA6Ly9s
aXN0cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Thu Nov 15 08:55:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 08:55:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvDX-0004Cx-OY; Thu, 15 Nov 2012 08:54:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYvDW-0004Cq-Ks
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 08:54:34 +0000
Received: from [193.109.254.147:53264] by server-15.bemta-14.messagelabs.com
	id 11/E1-12105-9CDA4A05; Thu, 15 Nov 2012 08:54:33 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352969637!4181981!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg2MzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10647 invoked from network); 15 Nov 2012 08:53:57 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 08:53:57 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15820491"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 08:53:10 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 08:53:09 +0000
Message-ID: <1352969589.3499.31.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Annie Li <annie.li@oracle.com>
Date: Thu, 15 Nov 2012 08:53:09 +0000
In-Reply-To: <1352962987-541-1-git-send-email-annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 07:03 +0000, Annie Li wrote:
> 
> This patch is based on linux3.4-rc3. I hit netperf/netserver failure
> on linux latest version v3.7-rc1, v3.7-rc2 and v3.7-rc4. Not sure
> whether thisnetperf/netserver failure connects compound page commit in
> v3.7-rc1, but I did hit BUG_ON with debug patch from thread
> http://lists.xen.org/archives/html/xen-devel/2012-10/msg00893.html

Do you think you could cook up a netfront fix similar in principal to
the 6a8ed462f16b8455eec5ae00eb6014159a6721f0 fix for netback?

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 08:55:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 08:55:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvDX-0004Cx-OY; Thu, 15 Nov 2012 08:54:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYvDW-0004Cq-Ks
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 08:54:34 +0000
Received: from [193.109.254.147:53264] by server-15.bemta-14.messagelabs.com
	id 11/E1-12105-9CDA4A05; Thu, 15 Nov 2012 08:54:33 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352969637!4181981!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg2MzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10647 invoked from network); 15 Nov 2012 08:53:57 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 08:53:57 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15820491"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 08:53:10 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 08:53:09 +0000
Message-ID: <1352969589.3499.31.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Annie Li <annie.li@oracle.com>
Date: Thu, 15 Nov 2012 08:53:09 +0000
In-Reply-To: <1352962987-541-1-git-send-email-annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 07:03 +0000, Annie Li wrote:
> 
> This patch is based on linux3.4-rc3. I hit netperf/netserver failure
> on linux latest version v3.7-rc1, v3.7-rc2 and v3.7-rc4. Not sure
> whether thisnetperf/netserver failure connects compound page commit in
> v3.7-rc1, but I did hit BUG_ON with debug patch from thread
> http://lists.xen.org/archives/html/xen-devel/2012-10/msg00893.html

Do you think you could cook up a netfront fix similar in principal to
the 6a8ed462f16b8455eec5ae00eb6014159a6721f0 fix for netback?

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 08:56:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 08:56:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvF9-0004J7-91; Thu, 15 Nov 2012 08:56:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYvF8-0004J0-49
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 08:56:14 +0000
Received: from [85.158.139.83:37673] by server-10.bemta-5.messagelabs.com id
	F5/7C-09257-D2EA4A05; Thu, 15 Nov 2012 08:56:13 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1352969772!29820998!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1382 invoked from network); 15 Nov 2012 08:56:12 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 08:56:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15820561"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 08:56:12 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 08:56:11 +0000
Message-ID: <1352969771.3499.34.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Annie Li <annie.li@oracle.com>
Date: Thu, 15 Nov 2012 08:56:11 +0000
In-Reply-To: <1352962987-541-1-git-send-email-annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 07:03 +0000, Annie Li wrote:

> 
> This patch implements persistent grants for xen-netfront/netback. This
> mechanism maintains page pools in netback/netfront, these page pools
> is used to save grant pages which are mapped. This way improve
> performance which is wasted when doing grant operations. 

Please can you send a patch against xen-unstable.hg to document this new
protocol variant in xen/include/public/io/netif.h. This header is a bit
under-documented but lets not let it fall further behind (if you want to
go further and document the existing features, in the style of the
current blkif.h, then that would be awesome!).

You may also want to provide a similar patch to Linux's copy which is in
linux/include/xen/interface/io/netif.h

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 08:56:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 08:56:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvF9-0004J7-91; Thu, 15 Nov 2012 08:56:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYvF8-0004J0-49
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 08:56:14 +0000
Received: from [85.158.139.83:37673] by server-10.bemta-5.messagelabs.com id
	F5/7C-09257-D2EA4A05; Thu, 15 Nov 2012 08:56:13 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1352969772!29820998!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1382 invoked from network); 15 Nov 2012 08:56:12 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 08:56:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15820561"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 08:56:12 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 08:56:11 +0000
Message-ID: <1352969771.3499.34.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Annie Li <annie.li@oracle.com>
Date: Thu, 15 Nov 2012 08:56:11 +0000
In-Reply-To: <1352962987-541-1-git-send-email-annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 07:03 +0000, Annie Li wrote:

> 
> This patch implements persistent grants for xen-netfront/netback. This
> mechanism maintains page pools in netback/netfront, these page pools
> is used to save grant pages which are mapped. This way improve
> performance which is wasted when doing grant operations. 

Please can you send a patch against xen-unstable.hg to document this new
protocol variant in xen/include/public/io/netif.h. This header is a bit
under-documented but lets not let it fall further behind (if you want to
go further and document the existing features, in the style of the
current blkif.h, then that would be awesome!).

You may also want to provide a similar patch to Linux's copy which is in
linux/include/xen/interface/io/netif.h

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:02:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:02:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvL8-0004i0-77; Thu, 15 Nov 2012 09:02:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYvL7-0004hv-MP
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 09:02:25 +0000
Received: from [85.158.139.83:34098] by server-10.bemta-5.messagelabs.com id
	69/5C-09257-0AFA4A05; Thu, 15 Nov 2012 09:02:24 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352970142!29665431!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTUyOTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30523 invoked from network); 15 Nov 2012 09:02:24 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 09:02:24 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF92BYs011159
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 09:02:11 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF92A9d012252
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 09:02:10 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF929ZD003758; Thu, 15 Nov 2012 03:02:09 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 01:02:09 -0800
Message-ID: <50A4AF92.20206@oracle.com>
Date: Thu, 15 Nov 2012 17:02:10 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
	<1352969519.3499.30.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352969519.3499.30.camel@zakaz.uk.xensource.com>
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CgpPbiAyMDEyLTExLTE1IDE2OjUxLCBJYW4gQ2FtcGJlbGwgd3JvdGU6Cj4gT24gVGh1LCAyMDEy
LTExLTE1IGF0IDA4OjM4ICswMDAwLCBBTk5JRSBMSSB3cm90ZToKPj4gT24gMjAxMi0xMS0xNSAx
NTo0MCwgUGFzaSBLw6Rya2vDpGluZW4gd3JvdGU6Cj4+PiBIZWxsbywKPj4+Cj4+PiBPbiBUaHUs
IE5vdiAxNSwgMjAxMiBhdCAwMzowMzowN1BNICswODAwLCBBbm5pZSBMaSB3cm90ZToKPj4+PiBU
aGlzIHBhdGNoIGltcGxlbWVudHMgcGVyc2lzdGVudCBncmFudHMgZm9yIHhlbi1uZXRmcm9udC9u
ZXRiYWNrLiBUaGlzCj4+Pj4gbWVjaGFuaXNtIG1haW50YWlucyBwYWdlIHBvb2xzIGluIG5ldGJh
Y2svbmV0ZnJvbnQsIHRoZXNlIHBhZ2UgcG9vbHMgaXMgdXNlZCB0bwo+Pj4+IHNhdmUgZ3JhbnQg
cGFnZXMgd2hpY2ggYXJlIG1hcHBlZC4gVGhpcyB3YXkgaW1wcm92ZSBwZXJmb3JtYW5jZSB3aGlj
aCBpcyB3YXN0ZWQKPj4+Pi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3RlbnQgcGF0Y2gKPj4KPj4gR3Vlc3RzLCBTdW0s
ICAgICBBdmcsICAgIE1pbiwgICAgICAgIE1heAo+PiAgICAxLCAgMTA4NjQuMSwgIDEwODY0LjEs
IDEwODY0LjEwLCAxMDg2NC4xMAo+PiAgICAyLCAgMTA4OTguNSwgIDU0NDkuMjQsICA0ODYyLjA4
LCAgNjAzNi40MAo+PiAgICAzLCAgMTA3MzQuNSwgIDUzNjcuMjYsICA1MjYxLjQzLCAgNTQ3My4w
OAo+PiAgICA0LCAgMTA5MjQsICAgIDU0NjEuOTksICA1MzE0Ljg0LCAgNTYwOS4xNAo+CgpfX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwgbWFp
bGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hl
bi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:02:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:02:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvL8-0004i0-77; Thu, 15 Nov 2012 09:02:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYvL7-0004hv-MP
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 09:02:25 +0000
Received: from [85.158.139.83:34098] by server-10.bemta-5.messagelabs.com id
	69/5C-09257-0AFA4A05; Thu, 15 Nov 2012 09:02:24 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1352970142!29665431!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTUyOTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30523 invoked from network); 15 Nov 2012 09:02:24 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 09:02:24 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF92BYs011159
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 09:02:11 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF92A9d012252
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 09:02:10 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF929ZD003758; Thu, 15 Nov 2012 03:02:09 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 01:02:09 -0800
Message-ID: <50A4AF92.20206@oracle.com>
Date: Thu, 15 Nov 2012 17:02:10 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
	<1352969519.3499.30.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352969519.3499.30.camel@zakaz.uk.xensource.com>
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CgpPbiAyMDEyLTExLTE1IDE2OjUxLCBJYW4gQ2FtcGJlbGwgd3JvdGU6Cj4gT24gVGh1LCAyMDEy
LTExLTE1IGF0IDA4OjM4ICswMDAwLCBBTk5JRSBMSSB3cm90ZToKPj4gT24gMjAxMi0xMS0xNSAx
NTo0MCwgUGFzaSBLw6Rya2vDpGluZW4gd3JvdGU6Cj4+PiBIZWxsbywKPj4+Cj4+PiBPbiBUaHUs
IE5vdiAxNSwgMjAxMiBhdCAwMzowMzowN1BNICswODAwLCBBbm5pZSBMaSB3cm90ZToKPj4+PiBU
aGlzIHBhdGNoIGltcGxlbWVudHMgcGVyc2lzdGVudCBncmFudHMgZm9yIHhlbi1uZXRmcm9udC9u
ZXRiYWNrLiBUaGlzCj4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cnNpc3RlbnQgZnJvbnRlbmQgYW5kIHZpY2UgdmVyc2E/Ckkg
ZGlkIGl0LCBidXQgdGhlIHRlc3Qgb25seSBydW5zIHdpdGggNCBndWVzdHMgdG9v77yMd2lsbCB0
ZXN0IHdpdGggbW9yZSAKZ3Vlc3RzLgoKVGhhbmtzCkFubmllCj4KPgo+Pgo+PiBGb2xsb3dpbmcg
YXJlIHJlc3VsdCBvZiB3aXRob3V0IHBlcnNpc3RlbnQgcGF0Y2gKPj4KPj4gR3Vlc3RzLCBTdW0s
ICAgICBBdmcsICAgIE1pbiwgICAgICAgIE1heAo+PiAgICAxLCAgMTA4NjQuMSwgIDEwODY0LjEs
IDEwODY0LjEwLCAxMDg2NC4xMAo+PiAgICAyLCAgMTA4OTguNSwgIDU0NDkuMjQsICA0ODYyLjA4
LCAgNjAzNi40MAo+PiAgICAzLCAgMTA3MzQuNSwgIDUzNjcuMjYsICA1MjYxLjQzLCAgNTQ3My4w
OAo+PiAgICA0LCAgMTA5MjQsICAgIDU0NjEuOTksICA1MzE0Ljg0LCAgNTYwOS4xNAo+CgpfX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwgbWFp
bGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hl
bi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:05:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:05:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvOE-0004oP-Qj; Thu, 15 Nov 2012 09:05:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYvOD-0004oH-OJ
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 09:05:37 +0000
Received: from [85.158.143.99:61730] by server-3.bemta-4.messagelabs.com id
	D1/01-06841-160B4A05; Thu, 15 Nov 2012 09:05:37 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1352970334!29096306!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6865 invoked from network); 15 Nov 2012 09:05:35 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-216.messagelabs.com with SMTP;
	15 Nov 2012 09:05:35 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 09:05:34 +0000
Message-Id: <50A4BE6D02000078000A8B89@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 15 Nov 2012 09:05:33 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>,
	"Yang Z Zhang" <yang.z.zhang@intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
	<50A2755402000078000A837D@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
	<50A3AD4E02000078000A87BD@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403374F44@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A4834564403374F44@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 09:23, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:

> 
>> -----Original Message-----
>> From: Jan Beulich [mailto:JBeulich@suse.com]
>> Sent: Wednesday, November 14, 2012 9:40 PM
>> To: Zhang, Xiantao; Zhang, Yang Z
>> Cc: wei.huang2@amd.com; weiwang.dd@gmail.com; xen-devel
>> Subject: RE: [Xen-devel] iommu=dom0-passthrough behavior
>> 
>> >>> On 14.11.12 at 01:37, "Zhang, Xiantao" <xiantao.zhang@intel.com>
>> wrote:
>> >> >> c) we could provide a command line option to allow fake devices to
>> >> >>     be create
>> >> >
>> >> > Agree, this maybe a feasible solution I can figure out, so far.
>> >> >
>> >> >> d) we could create context entries for all BDFs, whether or not a
>> >> >>     device exists there
>> >> >
>> >> > As I said,  this maybe bring security issue. Even for the
>> >> > iommu-passthrough option,  it is also not suggested to be used if
>> >> > security
>> > is
>> >> considered.
>> >>
>> >> As said - it is clear that the basic thing here (using
>> >> "iommu=dom0-passthrough") is already weakening security. So security
>> >> isn't the concern in this discussion, that's left to whoever is
>> >> intending to use
>> > that
>> >> option.
>> >
>> > Okay,  I vote your option C if don't care security.
>> 
>> Which, if I'm not mistaken, could be implemented entirely independent of
>> "iommu=dom0-passthrough". I'll see if that helps on the offending system.
> 
> I mean this one: 
>>>c) we could provide a command line option to allow fake devices to be create
> 
> Yes,  I don't think "iommu=dom0-passthrough" can meet your requirement.
>  We had better add a cmd line option to  pass the related information to 
> hypervisor and VT-d can create 
> the pass-through context entry  for the undetectable device.  

You misunderstood: What I was saying (and seeking confirmation)
is that I don't think the new command line option would need to
have any connection to the existing, non-suitable one. In
particular, for it to take effect, "iommu=dom0-passthrough"
wouldn't need to be specified at all.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:05:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:05:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvOE-0004oP-Qj; Thu, 15 Nov 2012 09:05:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYvOD-0004oH-OJ
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 09:05:37 +0000
Received: from [85.158.143.99:61730] by server-3.bemta-4.messagelabs.com id
	D1/01-06841-160B4A05; Thu, 15 Nov 2012 09:05:37 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1352970334!29096306!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6865 invoked from network); 15 Nov 2012 09:05:35 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-216.messagelabs.com with SMTP;
	15 Nov 2012 09:05:35 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 09:05:34 +0000
Message-Id: <50A4BE6D02000078000A8B89@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 15 Nov 2012 09:05:33 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>,
	"Yang Z Zhang" <yang.z.zhang@intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
	<50A2755402000078000A837D@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
	<50A3AD4E02000078000A87BD@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403374F44@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A4834564403374F44@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 09:23, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:

> 
>> -----Original Message-----
>> From: Jan Beulich [mailto:JBeulich@suse.com]
>> Sent: Wednesday, November 14, 2012 9:40 PM
>> To: Zhang, Xiantao; Zhang, Yang Z
>> Cc: wei.huang2@amd.com; weiwang.dd@gmail.com; xen-devel
>> Subject: RE: [Xen-devel] iommu=dom0-passthrough behavior
>> 
>> >>> On 14.11.12 at 01:37, "Zhang, Xiantao" <xiantao.zhang@intel.com>
>> wrote:
>> >> >> c) we could provide a command line option to allow fake devices to
>> >> >>     be create
>> >> >
>> >> > Agree, this maybe a feasible solution I can figure out, so far.
>> >> >
>> >> >> d) we could create context entries for all BDFs, whether or not a
>> >> >>     device exists there
>> >> >
>> >> > As I said,  this maybe bring security issue. Even for the
>> >> > iommu-passthrough option,  it is also not suggested to be used if
>> >> > security
>> > is
>> >> considered.
>> >>
>> >> As said - it is clear that the basic thing here (using
>> >> "iommu=dom0-passthrough") is already weakening security. So security
>> >> isn't the concern in this discussion, that's left to whoever is
>> >> intending to use
>> > that
>> >> option.
>> >
>> > Okay,  I vote your option C if don't care security.
>> 
>> Which, if I'm not mistaken, could be implemented entirely independent of
>> "iommu=dom0-passthrough". I'll see if that helps on the offending system.
> 
> I mean this one: 
>>>c) we could provide a command line option to allow fake devices to be create
> 
> Yes,  I don't think "iommu=dom0-passthrough" can meet your requirement.
>  We had better add a cmd line option to  pass the related information to 
> hypervisor and VT-d can create 
> the pass-through context entry  for the undetectable device.  

You misunderstood: What I was saying (and seeking confirmation)
is that I don't think the new command line option would need to
have any connection to the existing, non-suitable one. In
particular, for it to take effect, "iommu=dom0-passthrough"
wouldn't need to be specified at all.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:10:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:10:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvSm-0004zM-HV; Thu, 15 Nov 2012 09:10:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYvSl-0004zG-C7
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 09:10:19 +0000
Received: from [193.109.254.147:29083] by server-6.bemta-14.messagelabs.com id
	47/F1-02788-A71B4A05; Thu, 15 Nov 2012 09:10:18 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1352970614!11035997!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 734 invoked from network); 15 Nov 2012 09:10:14 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 09:10:14 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15820946"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 09:10:14 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 09:10:13 +0000
Message-ID: <1352970612.3499.43.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Annie Li <annie.li@oracle.com>
Date: Thu, 15 Nov 2012 09:10:12 +0000
In-Reply-To: <1352963066-570-1-git-send-email-annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963066-570-1-git-send-email-annie.li@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent
 grant with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 07:04 +0000, Annie Li wrote:
> This patch implements persistent grant in netback driver. Tx and rx
> share the same page pool, this pool will be split into two parts
> in next patch.
> 
> Signed-off-by: Annie Li <annie.li@oracle.com>
> ---
>  drivers/net/xen-netback/common.h    |   18 +++-
>  drivers/net/xen-netback/interface.c |   22 ++++
>  drivers/net/xen-netback/netback.c   |  212 +++++++++++++++++++++++++++++++----
>  drivers/net/xen-netback/xenbus.c    |   14 ++-
>  4 files changed, 239 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
> index 94b79c3..a85cac6 100644
> --- a/drivers/net/xen-netback/common.h
> +++ b/drivers/net/xen-netback/common.h
> @@ -45,8 +45,19 @@
>  #include <xen/grant_table.h>
>  #include <xen/xenbus.h>
> 
> +#define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE)
> +#define XEN_NETIF_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE)
> +#define MAXIMUM_OUTSTANDING_BLOCK_REQS \

BLOCK?

> +                       (XEN_NETIF_TX_RING_SIZE + XEN_NETIF_RX_RING_SIZE)
> +
>  struct xen_netbk;
> 
> +struct persistent_entry {
> +       grant_ref_t forgranted;
> +       struct page *fpage;
> +       struct gnttab_map_grant_ref map;
> +};

Isn't this duplicating a bunch of infrastructure which is also in
blkback? Can we put it into some common helpers please?

> +
>  struct xenvif {
>         /* Unique identifier for this interface. */
>         domid_t          domid;
> @@ -75,6 +86,7 @@ struct xenvif {
> 
>         /* Internal feature information. */
>         u8 can_queue:1;     /* can queue packets for receiver? */
> +       u8 persistent_grant:1;
> 
>         /*
>          * Allow xenvif_start_xmit() to peek ahead in the rx request
> @@ -98,6 +110,9 @@ struct xenvif {
>         struct net_device *dev;
> 
>         wait_queue_head_t waiting_to_free;
> +
> +       struct persistent_entry *persistent_gnt[MAXIMUM_OUTSTANDING_BLOCK_REQS];

What is the per-vif memory overhead of this array?

> +static struct persistent_entry*
> +get_per_gnt(struct persistent_entry **pers_entry,
> +           unsigned int count, grant_ref_t gref)
> +{
> +       int i;
> +
> +       for (i = 0; i < count; i++)
> +               if (gref == pers_entry[i]->forgranted)
> +                       return pers_entry[i];

Isn't this linear scan rather expensive? I think Roger implemented some
sort of hash lookup for blkback which I think is required here too (and
should be easy if you make that code common).

> +
> +       return NULL;
> +}
> +

> @@ -1338,7 +1497,11 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
>                 gop->source.domid = vif->domid;
>                 gop->source.offset = txreq.offset;
> 
> -               gop->dest.u.gmfn = virt_to_mfn(page_address(page));
> +               if (!vif->persistent_grant)
> +                       gop->dest.u.gmfn = virt_to_mfn(page_address(page));
> +               else
> +                       gop->dest.u.gmfn = (unsigned long)page_address(page);

page_address doesn't return any sort of frame number, does it? This is
rather confusing...

> @@ -453,7 +460,12 @@ static int connect_rings(struct backend_info *be)
>                 val = 0;
>         vif->csum = !val;
> 
> -       /* Map the shared frame, irq etc. */
> +       if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-persistent-grants",
> +                        "%u", &val) < 0)
> +               val = 0;
> +       vif->persistent_grant = !!val;
> +
> +/* Map the shared frame, irq etc. */

Please run the patches through checkpatch.pl

>         err = xenvif_connect(vif, tx_ring_ref, rx_ring_ref, evtchn);
>         if (err) {
>                 xenbus_dev_fatal(dev, err,
> --
> 1.7.3.4
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:10:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:10:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvSm-0004zM-HV; Thu, 15 Nov 2012 09:10:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYvSl-0004zG-C7
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 09:10:19 +0000
Received: from [193.109.254.147:29083] by server-6.bemta-14.messagelabs.com id
	47/F1-02788-A71B4A05; Thu, 15 Nov 2012 09:10:18 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1352970614!11035997!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 734 invoked from network); 15 Nov 2012 09:10:14 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 09:10:14 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15820946"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 09:10:14 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 09:10:13 +0000
Message-ID: <1352970612.3499.43.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Annie Li <annie.li@oracle.com>
Date: Thu, 15 Nov 2012 09:10:12 +0000
In-Reply-To: <1352963066-570-1-git-send-email-annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963066-570-1-git-send-email-annie.li@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent
 grant with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 07:04 +0000, Annie Li wrote:
> This patch implements persistent grant in netback driver. Tx and rx
> share the same page pool, this pool will be split into two parts
> in next patch.
> 
> Signed-off-by: Annie Li <annie.li@oracle.com>
> ---
>  drivers/net/xen-netback/common.h    |   18 +++-
>  drivers/net/xen-netback/interface.c |   22 ++++
>  drivers/net/xen-netback/netback.c   |  212 +++++++++++++++++++++++++++++++----
>  drivers/net/xen-netback/xenbus.c    |   14 ++-
>  4 files changed, 239 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
> index 94b79c3..a85cac6 100644
> --- a/drivers/net/xen-netback/common.h
> +++ b/drivers/net/xen-netback/common.h
> @@ -45,8 +45,19 @@
>  #include <xen/grant_table.h>
>  #include <xen/xenbus.h>
> 
> +#define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE)
> +#define XEN_NETIF_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE)
> +#define MAXIMUM_OUTSTANDING_BLOCK_REQS \

BLOCK?

> +                       (XEN_NETIF_TX_RING_SIZE + XEN_NETIF_RX_RING_SIZE)
> +
>  struct xen_netbk;
> 
> +struct persistent_entry {
> +       grant_ref_t forgranted;
> +       struct page *fpage;
> +       struct gnttab_map_grant_ref map;
> +};

Isn't this duplicating a bunch of infrastructure which is also in
blkback? Can we put it into some common helpers please?

> +
>  struct xenvif {
>         /* Unique identifier for this interface. */
>         domid_t          domid;
> @@ -75,6 +86,7 @@ struct xenvif {
> 
>         /* Internal feature information. */
>         u8 can_queue:1;     /* can queue packets for receiver? */
> +       u8 persistent_grant:1;
> 
>         /*
>          * Allow xenvif_start_xmit() to peek ahead in the rx request
> @@ -98,6 +110,9 @@ struct xenvif {
>         struct net_device *dev;
> 
>         wait_queue_head_t waiting_to_free;
> +
> +       struct persistent_entry *persistent_gnt[MAXIMUM_OUTSTANDING_BLOCK_REQS];

What is the per-vif memory overhead of this array?

> +static struct persistent_entry*
> +get_per_gnt(struct persistent_entry **pers_entry,
> +           unsigned int count, grant_ref_t gref)
> +{
> +       int i;
> +
> +       for (i = 0; i < count; i++)
> +               if (gref == pers_entry[i]->forgranted)
> +                       return pers_entry[i];

Isn't this linear scan rather expensive? I think Roger implemented some
sort of hash lookup for blkback which I think is required here too (and
should be easy if you make that code common).

> +
> +       return NULL;
> +}
> +

> @@ -1338,7 +1497,11 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
>                 gop->source.domid = vif->domid;
>                 gop->source.offset = txreq.offset;
> 
> -               gop->dest.u.gmfn = virt_to_mfn(page_address(page));
> +               if (!vif->persistent_grant)
> +                       gop->dest.u.gmfn = virt_to_mfn(page_address(page));
> +               else
> +                       gop->dest.u.gmfn = (unsigned long)page_address(page);

page_address doesn't return any sort of frame number, does it? This is
rather confusing...

> @@ -453,7 +460,12 @@ static int connect_rings(struct backend_info *be)
>                 val = 0;
>         vif->csum = !val;
> 
> -       /* Map the shared frame, irq etc. */
> +       if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-persistent-grants",
> +                        "%u", &val) < 0)
> +               val = 0;
> +       vif->persistent_grant = !!val;
> +
> +/* Map the shared frame, irq etc. */

Please run the patches through checkpatch.pl

>         err = xenvif_connect(vif, tx_ring_ref, rx_ring_ref, evtchn);
>         if (err) {
>                 xenbus_dev_fatal(dev, err,
> --
> 1.7.3.4
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:15:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:15:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvXa-0005Hc-Dj; Thu, 15 Nov 2012 09:15:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYvXZ-0005HS-IA
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 09:15:17 +0000
Received: from [85.158.137.99:27827] by server-13.bemta-3.messagelabs.com id
	DB/A4-24887-4A2B4A05; Thu, 15 Nov 2012 09:15:16 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352970915!19073785!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19080 invoked from network); 15 Nov 2012 09:15:15 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-14.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 09:15:15 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15821092"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 09:15:14 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 09:15:13 +0000
Message-ID: <1352970913.3499.47.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Annie Li <annie.li@oracle.com>
Date: Thu, 15 Nov 2012 09:15:13 +0000
In-Reply-To: <1352963089-599-1-git-send-email-annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963089-599-1-git-send-email-annie.li@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 2/4] xen/netback: Split one page pool into
 two(tx/rx) page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 07:04 +0000, Annie Li wrote:
> For tx path, this implementation simplifies the work of searching out
> grant page from page pool based on grant reference.

It's still a linear search though, and it doesn't look much simpler to
me:
  	for (i = 0; i < count; i++) {
		if (tx_pool)
			vif = netbk->gnttab_tx_vif[i];
		else
			vif = netbk->gnttab_rx_vif[i];

		pers_entry = vif->persistent_gnt;
		gnt_count = &vif->persistent_gntcnt;
		gnt_total = MAXIMUM_OUTSTANDING_BLOCK_REQS;
becomes:
	for (i = 0; i < count; i++) {
		if (tx_pool) {
			vif = netbk->gnttab_tx_vif[i];
			gnt_count = &vif->persistent_tx_gntcnt;
			gnt_total = XEN_NETIF_TX_RING_SIZE;
			pers_entry = vif->persistent_tx_gnt;
		} else {
			vif = netbk->gnttab_rx_vif[i];
			gnt_count = &vif->persistent_rx_gntcnt;
			gnt_total = 2*XEN_NETIF_RX_RING_SIZE;
			pers_entry = vif->persistent_rx_gnt;
		}

> @@ -111,8 +109,16 @@ struct xenvif {
>  
>  	wait_queue_head_t waiting_to_free;
>  
> -	struct persistent_entry *persistent_gnt[MAXIMUM_OUTSTANDING_BLOCK_REQS];
> -	unsigned int persistent_gntcnt;
> +	struct persistent_entry *persistent_tx_gnt[XEN_NETIF_TX_RING_SIZE];
> +
> +	/*
> +	 * 2*XEN_NETIF_RX_RING_SIZE is for the case of each head/fragment page

Shouldn't that been incorporated into MAXIMUM_OUTSTANDING_BLOCK_REQS
(sic) too?

> +	 * using 2 copy operations.
> +	 */
> +	struct persistent_entry *persistent_rx_gnt[2*XEN_NETIF_RX_RING_SIZE];

What is the per-vif memory overhead after this change?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:15:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:15:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvXa-0005Hc-Dj; Thu, 15 Nov 2012 09:15:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYvXZ-0005HS-IA
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 09:15:17 +0000
Received: from [85.158.137.99:27827] by server-13.bemta-3.messagelabs.com id
	DB/A4-24887-4A2B4A05; Thu, 15 Nov 2012 09:15:16 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352970915!19073785!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19080 invoked from network); 15 Nov 2012 09:15:15 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-14.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 09:15:15 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15821092"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 09:15:14 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 09:15:13 +0000
Message-ID: <1352970913.3499.47.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Annie Li <annie.li@oracle.com>
Date: Thu, 15 Nov 2012 09:15:13 +0000
In-Reply-To: <1352963089-599-1-git-send-email-annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963089-599-1-git-send-email-annie.li@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 2/4] xen/netback: Split one page pool into
 two(tx/rx) page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 07:04 +0000, Annie Li wrote:
> For tx path, this implementation simplifies the work of searching out
> grant page from page pool based on grant reference.

It's still a linear search though, and it doesn't look much simpler to
me:
  	for (i = 0; i < count; i++) {
		if (tx_pool)
			vif = netbk->gnttab_tx_vif[i];
		else
			vif = netbk->gnttab_rx_vif[i];

		pers_entry = vif->persistent_gnt;
		gnt_count = &vif->persistent_gntcnt;
		gnt_total = MAXIMUM_OUTSTANDING_BLOCK_REQS;
becomes:
	for (i = 0; i < count; i++) {
		if (tx_pool) {
			vif = netbk->gnttab_tx_vif[i];
			gnt_count = &vif->persistent_tx_gntcnt;
			gnt_total = XEN_NETIF_TX_RING_SIZE;
			pers_entry = vif->persistent_tx_gnt;
		} else {
			vif = netbk->gnttab_rx_vif[i];
			gnt_count = &vif->persistent_rx_gntcnt;
			gnt_total = 2*XEN_NETIF_RX_RING_SIZE;
			pers_entry = vif->persistent_rx_gnt;
		}

> @@ -111,8 +109,16 @@ struct xenvif {
>  
>  	wait_queue_head_t waiting_to_free;
>  
> -	struct persistent_entry *persistent_gnt[MAXIMUM_OUTSTANDING_BLOCK_REQS];
> -	unsigned int persistent_gntcnt;
> +	struct persistent_entry *persistent_tx_gnt[XEN_NETIF_TX_RING_SIZE];
> +
> +	/*
> +	 * 2*XEN_NETIF_RX_RING_SIZE is for the case of each head/fragment page

Shouldn't that been incorporated into MAXIMUM_OUTSTANDING_BLOCK_REQS
(sic) too?

> +	 * using 2 copy operations.
> +	 */
> +	struct persistent_entry *persistent_rx_gnt[2*XEN_NETIF_RX_RING_SIZE];

What is the per-vif memory overhead after this change?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:19:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:19:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvb0-0005Q7-1U; Thu, 15 Nov 2012 09:18:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYvaz-0005Q0-0S
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 09:18:49 +0000
Received: from [85.158.143.35:6272] by server-2.bemta-4.messagelabs.com id
	DE/7D-28922-873B4A05; Thu, 15 Nov 2012 09:18:48 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1352971091!12880685!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7574 invoked from network); 15 Nov 2012 09:18:13 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 09:18:13 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15821174"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 09:18:11 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 09:18:10 +0000
Message-ID: <1352971089.3499.49.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Chunyan Liu <cyliu@suse.com>
Date: Thu, 15 Nov 2012 09:18:09 +0000
In-Reply-To: <CAERYnoYgwRBycoc9+nV7uOk1Brwjs2r=QecpgKDQjASjwdkiew@mail.gmail.com>
References: <CAERYnoYbLddzpE6729Nkx2YzMPcr09Do0f1rkob4U1h34NjQgQ@mail.gmail.com>
	<1352734133.27833.277.camel@zakaz.uk.xensource.com>
	<CAERYnoYg1iaM==-Gk__LtXLbQKaSpM-KAR-jr-cUPkt-WEe_aA@mail.gmail.com>
	<CAERYnoYgwRBycoc9+nV7uOk1Brwjs2r=QecpgKDQjASjwdkiew@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] question about xenstore-chmod MAX_PERMS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 01:51 +0000, Chunyan Liu wrote:
>         
>                 I can't see anything obvious in the underlying library
>                 which would
>                 prevent it handling essentially arbitrary length lists
>                 of perms. If you
>                 want to change the client to increase the number
>                 supported I think you
>                 should make it likewise handle arbitrary numbers
>                 rather than just
>                 increasing MAX_PERMS. 
> 
> In addition: there is a check for msg.len <=  XENSTORE_PAYLOAD_MAX
> (which is 4096). 
> For chmod, the msg.len = path len + mode len. In current environments,
> there won't be so many perms that could exceed the value. But it IS a
> limitation. 

Do you know what it works out as?

If atomicity matters you could do it as batches within a transaction,
otherwise simple batching would do?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:19:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:19:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvb0-0005Q7-1U; Thu, 15 Nov 2012 09:18:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYvaz-0005Q0-0S
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 09:18:49 +0000
Received: from [85.158.143.35:6272] by server-2.bemta-4.messagelabs.com id
	DE/7D-28922-873B4A05; Thu, 15 Nov 2012 09:18:48 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1352971091!12880685!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7574 invoked from network); 15 Nov 2012 09:18:13 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 09:18:13 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15821174"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 09:18:11 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 09:18:10 +0000
Message-ID: <1352971089.3499.49.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Chunyan Liu <cyliu@suse.com>
Date: Thu, 15 Nov 2012 09:18:09 +0000
In-Reply-To: <CAERYnoYgwRBycoc9+nV7uOk1Brwjs2r=QecpgKDQjASjwdkiew@mail.gmail.com>
References: <CAERYnoYbLddzpE6729Nkx2YzMPcr09Do0f1rkob4U1h34NjQgQ@mail.gmail.com>
	<1352734133.27833.277.camel@zakaz.uk.xensource.com>
	<CAERYnoYg1iaM==-Gk__LtXLbQKaSpM-KAR-jr-cUPkt-WEe_aA@mail.gmail.com>
	<CAERYnoYgwRBycoc9+nV7uOk1Brwjs2r=QecpgKDQjASjwdkiew@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] question about xenstore-chmod MAX_PERMS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 01:51 +0000, Chunyan Liu wrote:
>         
>                 I can't see anything obvious in the underlying library
>                 which would
>                 prevent it handling essentially arbitrary length lists
>                 of perms. If you
>                 want to change the client to increase the number
>                 supported I think you
>                 should make it likewise handle arbitrary numbers
>                 rather than just
>                 increasing MAX_PERMS. 
> 
> In addition: there is a check for msg.len <=  XENSTORE_PAYLOAD_MAX
> (which is 4096). 
> For chmod, the msg.len = path len + mode len. In current environments,
> there won't be so many perms that could exceed the value. But it IS a
> limitation. 

Do you know what it works out as?

If atomicity matters you could do it as batches within a transaction,
otherwise simple batching would do?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:29:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:29:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvks-0005vq-Os; Thu, 15 Nov 2012 09:29:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYvkr-0005vk-Ur
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 09:29:02 +0000
Received: from [85.158.143.99:51000] by server-1.bemta-4.messagelabs.com id
	BA/BA-27934-DD5B4A05; Thu, 15 Nov 2012 09:29:01 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1352971739!18810330!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26008 invoked from network); 15 Nov 2012 09:28:59 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 09:28:59 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15821419"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 09:28:36 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 09:28:35 +0000
Message-ID: <1352971714.3499.57.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Liu Jinsong <jinsong.liu@intel.com>
Date: Thu, 15 Nov 2012 09:28:34 +0000
In-Reply-To: <da7faf53790e661cb6c4.1352944365@ljsromley.bj.intel.com>
References: <da7faf53790e661cb6c4.1352944365@ljsromley.bj.intel.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V2] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 01:52 +0000, Liu Jinsong wrote:
> Generally, there are 2 cases:
> 1. broken page occurs before migration
> 2. broken page occurs during migration
> 
> At the sender
>   For case 1, the broken page would be mapped but not copied to target

Do you mean "will be mapped"? "would be" is past tense which suggests it
was the behaviour before this patch, which I don't think is what you
meant (here and elsewhere in the commit message).

>   (otherwise it may trigger more serious error, say, SRAR error).
>   While its pfn_type and pfn number would be transferred to target
>   so that target take appropriate action.
> 
>   For case 2, mce handler marks the broken page to dirty bitmap, so that
>   at copypages stage of migration, its pfn_type and pfn number would be
>   transferred to target and then take appropriate action.

What happens if the page is marked broken during the final pass?

> At the target
>   When migration target would populate pages for guest. As for the case
>   of broken page wrt migration, we prefer keep the corresponding page,
>   for the sake of seamless migration.

I don't understanding this paragraph, what do you mean by "keep the
corresponding page"? My understanding is the patch explicitly doesn't
keep the page, it marks it as broken.

Did you perhaps mean "... we prefer to keep the type of the page for the
sake..." ?

>   At target it would set p2m as p2m_ram_broken for broken page. Guest MCE
>   may have good chance to handle its broken page, while if guest access
>   the broken page again it would kill itself as expected.
> 
> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
> Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> Acked-by: Jan Beulich <JBeulich@suse.com>
> 
> diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xc_domain.c
> --- a/tools/libxc/xc_domain.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xc_domain.c	Thu Nov 15 09:42:24 2012 +0800
> @@ -283,6 +283,22 @@
>      return ret;
>  }
>  
> +/* set broken page p2m */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn)
> +{
> +    int ret;
> +    DECLARE_DOMCTL;
> +
> +    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
> +    domctl.domain = (domid_t)domid;
> +    domctl.u.set_broken_page_p2m.pfn = pfn;
> +    ret = do_domctl(xch, &domctl);
> +
> +    return ret ? -1 : 0;
> +}
> +
>  /* get info from hvm guest for save */
>  int xc_domain_hvm_getcontext(xc_interface *xch,
>                               uint32_t domid,
> diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xc_domain_restore.c
> --- a/tools/libxc/xc_domain_restore.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xc_domain_restore.c	Thu Nov 15 09:42:24 2012 +0800
> @@ -1023,9 +1023,15 @@
>  
>      countpages = count;
>      for (i = oldcount; i < buf->nr_pages; ++i)
> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
> +    {
> +        unsigned long pagetype;
> +
> +        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
> +        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
> +             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
> +             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>              --countpages;
> +    }
>  
>      if (!countpages)
>          return count;
> @@ -1267,6 +1273,17 @@
>              /* a bogus/unmapped/allocate-only page: skip it */
>              continue;
>  
> +        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
> +        {
> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
> +            {
> +                ERROR("Set p2m for broken page failed, "
> +                      "dom=%d, pfn=%lx\n", dom, pfn);
> +                goto err_mapped;
> +            }
> +            continue;
> +        }
> +
>          if (pfn_err[i])
>          {
>              ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
> diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xc_domain_save.c
> --- a/tools/libxc/xc_domain_save.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xc_domain_save.c	Thu Nov 15 09:42:24 2012 +0800
> @@ -1277,6 +1277,13 @@
>                  if ( !hvm )
>                      gmfn = pfn_to_mfn(gmfn);
>  
> +                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                {
> +                    pfn_type[j] |= pfn_batch[j];
> +                    ++run;
> +                    continue;
> +                }
> +
>                  if ( pfn_err[j] )
>                  {
>                      if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
> @@ -1371,8 +1378,12 @@
>                      }
>                  }
>  
> -                /* skip pages that aren't present or are alloc-only */
> +                /*
> +                 * skip pages that aren't present,
> +                 * or are broken, or are alloc-only
> +                 */
>                  if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
> +                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
>                      || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>                      continue;
>  
> diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xenctrl.h
> --- a/tools/libxc/xenctrl.h	Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xenctrl.h	Thu Nov 15 09:42:24 2012 +0800
> @@ -575,6 +575,17 @@
>                            xc_domaininfo_t *info);
>  
>  /**
> + * This function set p2m for broken page
> + * &parm xch a handle to an open hypervisor interface
> + * @parm domid the domain id which broken page belong to
> + * @parm pfn the pfn number of the broken page
> + * @return 0 on success, -1 on failure
> + */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn);
> +
> +/**
>   * This function returns information about the context of a hvm domain
>   * @parm xch a handle to an open hypervisor interface
>   * @parm domid the domain to get information from
> diff -r 8b93ac0c93f3 -r da7faf53790e xen/arch/x86/cpu/mcheck/mcaction.c
> --- a/xen/arch/x86/cpu/mcheck/mcaction.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Thu Nov 15 09:42:24 2012 +0800
> @@ -1,5 +1,6 @@
>  #include <xen/types.h>
>  #include <xen/sched.h>
> +#include <asm/p2m.h>
>  #include "mcaction.h"
>  #include "vmce.h"
>  #include "mce.h"
> @@ -91,6 +92,24 @@
>                      goto vmce_failed;
>                  }
>  
> +                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram &&
> +                     paging_mode_log_dirty(d) )
> +                {
> +                    /*
> +                     * vMCE occur during migration
> +                     *
> +                     *   At sender, it marks broken page to dirty bitmap,
> +                     *   so that at copypages stage of migration, broken
> +                     *   page's pfn_type and pfn number would be transferred
> +                     *   to target and then take appropriate action.
> +                     *
> +                     *   At target, it would set p2m as p2m_ram_broken for
> +                     *   broken page, so that if guest access the broken page
> +                     *   again, it would kill itself as expected.
> +                     */
> +                    paging_mark_dirty(d, mfn);
> +                }
> +
>                  if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
>                  {
>                      printk("Unmap broken memory %lx for DOM%d failed\n",
> diff -r 8b93ac0c93f3 -r da7faf53790e xen/arch/x86/domctl.c
> --- a/xen/arch/x86/domctl.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/xen/arch/x86/domctl.c	Thu Nov 15 09:42:24 2012 +0800
> @@ -209,12 +209,18 @@
>                  for ( j = 0; j < k; j++ )
>                  {
>                      unsigned long type = 0;
> +                    p2m_type_t t;
>  
> -                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
> +                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
>  
>                      if ( unlikely(!page) ||
>                           unlikely(is_xen_heap_page(page)) )
> -                        type = XEN_DOMCTL_PFINFO_XTAB;
> +                    {
> +                        if ( p2m_is_broken(t) )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
> +                        else
> +                            type = XEN_DOMCTL_PFINFO_XTAB;
> +                    }
>                      else
>                      {
>                          switch( page->u.inuse.type_info & PGT_type_mask )
> @@ -235,6 +241,9 @@
>  
>                          if ( page->u.inuse.type_info & PGT_pinned )
>                              type |= XEN_DOMCTL_PFINFO_LPINTAB;
> +
> +                        if ( page->count_info & PGC_broken )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
>                      }
>  
>                      if ( page )
> @@ -1568,6 +1577,29 @@
>      }
>      break;
>  
> +    case XEN_DOMCTL_set_broken_page_p2m:
> +    {
> +        struct domain *d;
> +
> +        d = rcu_lock_domain_by_id(domctl->domain);
> +        if ( d != NULL )
> +        {
> +            p2m_type_t pt;
> +            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
> +            mfn_t mfn = get_gfn_query(d, pfn, &pt);
> +
> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
> +                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
> +                ret = -EINVAL;
> +
> +            put_gfn(d, pfn);
> +            rcu_unlock_domain(d);
> +        }
> +        else
> +            ret = -ESRCH;
> +    }
> +    break;
> +
>      default:
>          ret = iommu_do_domctl(domctl, u_domctl);
>          break;
> diff -r 8b93ac0c93f3 -r da7faf53790e xen/include/public/domctl.h
> --- a/xen/include/public/domctl.h	Tue Nov 13 11:19:17 2012 +0000
> +++ b/xen/include/public/domctl.h	Thu Nov 15 09:42:24 2012 +0800
> @@ -136,6 +136,7 @@
>  #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
>  #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
>  #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
> +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
>  #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
>  
>  struct xen_domctl_getpageframeinfo {
> @@ -834,6 +835,12 @@
>  typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
>  DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
>  
> +struct xen_domctl_set_broken_page_p2m {
> +    uint64_aligned_t pfn;
> +};
> +typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
> +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
> +
>  struct xen_domctl {
>      uint32_t cmd;
>  #define XEN_DOMCTL_createdomain                   1
> @@ -899,6 +906,7 @@
>  #define XEN_DOMCTL_set_access_required           64
>  #define XEN_DOMCTL_audit_p2m                     65
>  #define XEN_DOMCTL_set_virq_handler              66
> +#define XEN_DOMCTL_set_broken_page_p2m           67
>  #define XEN_DOMCTL_gdbsx_guestmemio            1000
>  #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>  #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
> @@ -954,6 +962,7 @@
>          struct xen_domctl_audit_p2m         audit_p2m;
>          struct xen_domctl_set_virq_handler  set_virq_handler;
>          struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>          struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>          struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>          uint8_t                             pad[128];



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:29:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:29:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvks-0005vq-Os; Thu, 15 Nov 2012 09:29:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYvkr-0005vk-Ur
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 09:29:02 +0000
Received: from [85.158.143.99:51000] by server-1.bemta-4.messagelabs.com id
	BA/BA-27934-DD5B4A05; Thu, 15 Nov 2012 09:29:01 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1352971739!18810330!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26008 invoked from network); 15 Nov 2012 09:28:59 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 09:28:59 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15821419"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 09:28:36 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 09:28:35 +0000
Message-ID: <1352971714.3499.57.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Liu Jinsong <jinsong.liu@intel.com>
Date: Thu, 15 Nov 2012 09:28:34 +0000
In-Reply-To: <da7faf53790e661cb6c4.1352944365@ljsromley.bj.intel.com>
References: <da7faf53790e661cb6c4.1352944365@ljsromley.bj.intel.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V2] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 01:52 +0000, Liu Jinsong wrote:
> Generally, there are 2 cases:
> 1. broken page occurs before migration
> 2. broken page occurs during migration
> 
> At the sender
>   For case 1, the broken page would be mapped but not copied to target

Do you mean "will be mapped"? "would be" is past tense which suggests it
was the behaviour before this patch, which I don't think is what you
meant (here and elsewhere in the commit message).

>   (otherwise it may trigger more serious error, say, SRAR error).
>   While its pfn_type and pfn number would be transferred to target
>   so that target take appropriate action.
> 
>   For case 2, mce handler marks the broken page to dirty bitmap, so that
>   at copypages stage of migration, its pfn_type and pfn number would be
>   transferred to target and then take appropriate action.

What happens if the page is marked broken during the final pass?

> At the target
>   When migration target would populate pages for guest. As for the case
>   of broken page wrt migration, we prefer keep the corresponding page,
>   for the sake of seamless migration.

I don't understanding this paragraph, what do you mean by "keep the
corresponding page"? My understanding is the patch explicitly doesn't
keep the page, it marks it as broken.

Did you perhaps mean "... we prefer to keep the type of the page for the
sake..." ?

>   At target it would set p2m as p2m_ram_broken for broken page. Guest MCE
>   may have good chance to handle its broken page, while if guest access
>   the broken page again it would kill itself as expected.
> 
> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
> Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> Acked-by: Jan Beulich <JBeulich@suse.com>
> 
> diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xc_domain.c
> --- a/tools/libxc/xc_domain.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xc_domain.c	Thu Nov 15 09:42:24 2012 +0800
> @@ -283,6 +283,22 @@
>      return ret;
>  }
>  
> +/* set broken page p2m */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn)
> +{
> +    int ret;
> +    DECLARE_DOMCTL;
> +
> +    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
> +    domctl.domain = (domid_t)domid;
> +    domctl.u.set_broken_page_p2m.pfn = pfn;
> +    ret = do_domctl(xch, &domctl);
> +
> +    return ret ? -1 : 0;
> +}
> +
>  /* get info from hvm guest for save */
>  int xc_domain_hvm_getcontext(xc_interface *xch,
>                               uint32_t domid,
> diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xc_domain_restore.c
> --- a/tools/libxc/xc_domain_restore.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xc_domain_restore.c	Thu Nov 15 09:42:24 2012 +0800
> @@ -1023,9 +1023,15 @@
>  
>      countpages = count;
>      for (i = oldcount; i < buf->nr_pages; ++i)
> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
> +    {
> +        unsigned long pagetype;
> +
> +        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
> +        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
> +             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
> +             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>              --countpages;
> +    }
>  
>      if (!countpages)
>          return count;
> @@ -1267,6 +1273,17 @@
>              /* a bogus/unmapped/allocate-only page: skip it */
>              continue;
>  
> +        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
> +        {
> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
> +            {
> +                ERROR("Set p2m for broken page failed, "
> +                      "dom=%d, pfn=%lx\n", dom, pfn);
> +                goto err_mapped;
> +            }
> +            continue;
> +        }
> +
>          if (pfn_err[i])
>          {
>              ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
> diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xc_domain_save.c
> --- a/tools/libxc/xc_domain_save.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xc_domain_save.c	Thu Nov 15 09:42:24 2012 +0800
> @@ -1277,6 +1277,13 @@
>                  if ( !hvm )
>                      gmfn = pfn_to_mfn(gmfn);
>  
> +                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                {
> +                    pfn_type[j] |= pfn_batch[j];
> +                    ++run;
> +                    continue;
> +                }
> +
>                  if ( pfn_err[j] )
>                  {
>                      if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
> @@ -1371,8 +1378,12 @@
>                      }
>                  }
>  
> -                /* skip pages that aren't present or are alloc-only */
> +                /*
> +                 * skip pages that aren't present,
> +                 * or are broken, or are alloc-only
> +                 */
>                  if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
> +                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
>                      || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>                      continue;
>  
> diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xenctrl.h
> --- a/tools/libxc/xenctrl.h	Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xenctrl.h	Thu Nov 15 09:42:24 2012 +0800
> @@ -575,6 +575,17 @@
>                            xc_domaininfo_t *info);
>  
>  /**
> + * This function set p2m for broken page
> + * &parm xch a handle to an open hypervisor interface
> + * @parm domid the domain id which broken page belong to
> + * @parm pfn the pfn number of the broken page
> + * @return 0 on success, -1 on failure
> + */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn);
> +
> +/**
>   * This function returns information about the context of a hvm domain
>   * @parm xch a handle to an open hypervisor interface
>   * @parm domid the domain to get information from
> diff -r 8b93ac0c93f3 -r da7faf53790e xen/arch/x86/cpu/mcheck/mcaction.c
> --- a/xen/arch/x86/cpu/mcheck/mcaction.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Thu Nov 15 09:42:24 2012 +0800
> @@ -1,5 +1,6 @@
>  #include <xen/types.h>
>  #include <xen/sched.h>
> +#include <asm/p2m.h>
>  #include "mcaction.h"
>  #include "vmce.h"
>  #include "mce.h"
> @@ -91,6 +92,24 @@
>                      goto vmce_failed;
>                  }
>  
> +                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram &&
> +                     paging_mode_log_dirty(d) )
> +                {
> +                    /*
> +                     * vMCE occur during migration
> +                     *
> +                     *   At sender, it marks broken page to dirty bitmap,
> +                     *   so that at copypages stage of migration, broken
> +                     *   page's pfn_type and pfn number would be transferred
> +                     *   to target and then take appropriate action.
> +                     *
> +                     *   At target, it would set p2m as p2m_ram_broken for
> +                     *   broken page, so that if guest access the broken page
> +                     *   again, it would kill itself as expected.
> +                     */
> +                    paging_mark_dirty(d, mfn);
> +                }
> +
>                  if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
>                  {
>                      printk("Unmap broken memory %lx for DOM%d failed\n",
> diff -r 8b93ac0c93f3 -r da7faf53790e xen/arch/x86/domctl.c
> --- a/xen/arch/x86/domctl.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/xen/arch/x86/domctl.c	Thu Nov 15 09:42:24 2012 +0800
> @@ -209,12 +209,18 @@
>                  for ( j = 0; j < k; j++ )
>                  {
>                      unsigned long type = 0;
> +                    p2m_type_t t;
>  
> -                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
> +                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
>  
>                      if ( unlikely(!page) ||
>                           unlikely(is_xen_heap_page(page)) )
> -                        type = XEN_DOMCTL_PFINFO_XTAB;
> +                    {
> +                        if ( p2m_is_broken(t) )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
> +                        else
> +                            type = XEN_DOMCTL_PFINFO_XTAB;
> +                    }
>                      else
>                      {
>                          switch( page->u.inuse.type_info & PGT_type_mask )
> @@ -235,6 +241,9 @@
>  
>                          if ( page->u.inuse.type_info & PGT_pinned )
>                              type |= XEN_DOMCTL_PFINFO_LPINTAB;
> +
> +                        if ( page->count_info & PGC_broken )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
>                      }
>  
>                      if ( page )
> @@ -1568,6 +1577,29 @@
>      }
>      break;
>  
> +    case XEN_DOMCTL_set_broken_page_p2m:
> +    {
> +        struct domain *d;
> +
> +        d = rcu_lock_domain_by_id(domctl->domain);
> +        if ( d != NULL )
> +        {
> +            p2m_type_t pt;
> +            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
> +            mfn_t mfn = get_gfn_query(d, pfn, &pt);
> +
> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
> +                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
> +                ret = -EINVAL;
> +
> +            put_gfn(d, pfn);
> +            rcu_unlock_domain(d);
> +        }
> +        else
> +            ret = -ESRCH;
> +    }
> +    break;
> +
>      default:
>          ret = iommu_do_domctl(domctl, u_domctl);
>          break;
> diff -r 8b93ac0c93f3 -r da7faf53790e xen/include/public/domctl.h
> --- a/xen/include/public/domctl.h	Tue Nov 13 11:19:17 2012 +0000
> +++ b/xen/include/public/domctl.h	Thu Nov 15 09:42:24 2012 +0800
> @@ -136,6 +136,7 @@
>  #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
>  #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
>  #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
> +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
>  #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
>  
>  struct xen_domctl_getpageframeinfo {
> @@ -834,6 +835,12 @@
>  typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
>  DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
>  
> +struct xen_domctl_set_broken_page_p2m {
> +    uint64_aligned_t pfn;
> +};
> +typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
> +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
> +
>  struct xen_domctl {
>      uint32_t cmd;
>  #define XEN_DOMCTL_createdomain                   1
> @@ -899,6 +906,7 @@
>  #define XEN_DOMCTL_set_access_required           64
>  #define XEN_DOMCTL_audit_p2m                     65
>  #define XEN_DOMCTL_set_virq_handler              66
> +#define XEN_DOMCTL_set_broken_page_p2m           67
>  #define XEN_DOMCTL_gdbsx_guestmemio            1000
>  #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>  #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
> @@ -954,6 +962,7 @@
>          struct xen_domctl_audit_p2m         audit_p2m;
>          struct xen_domctl_set_virq_handler  set_virq_handler;
>          struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>          struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>          struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>          uint8_t                             pad[128];



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:29:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:29:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvlM-0005yR-63; Thu, 15 Nov 2012 09:29:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1TYvlL-0005yC-23
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 09:29:31 +0000
Received: from [85.158.139.211:53954] by server-5.bemta-5.messagelabs.com id
	0A/07-11353-AF5B4A05; Thu, 15 Nov 2012 09:29:30 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1352971768!20276251!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTUyOTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19619 invoked from network); 15 Nov 2012 09:29:29 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-4.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 09:29:29 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF9TJZp004509
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 09:29:20 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF9TGrX022485
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 09:29:16 GMT
Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF9TFSQ021141; Thu, 15 Nov 2012 03:29:15 -0600
MIME-Version: 1.0
Message-ID: <f6696efe-8527-4edb-99b4-ab7fdf8a3859@default>
Date: Thu, 15 Nov 2012 01:29:15 -0800 (PST)
From: Daniel Kiper <daniel.kiper@oracle.com>
To: <duanshuidao@hotmail.com>
X-Mailer: Zimbra on Oracle Beehive
Content-Disposition: inline
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: olaf@aepfle.de, xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com, kexec@lists.infradead.org,
	ptesarik@suse.cz, anderson@redhat.com, jbeulich@suse.com,
	crash-utility@redhat.com
Subject: Re: [Xen-devel] [PATCH 0/5] crash: Bundle of fixes for Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

> I am pleased to see those patch, and want to test
> the latest crash version for my issue.
>
> but how I get the latest crash version,
> by git or other ? I can't find it.
>
> please tell me.

Please check http://people.redhat.com/anderson/

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:29:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:29:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvlM-0005yR-63; Thu, 15 Nov 2012 09:29:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1TYvlL-0005yC-23
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 09:29:31 +0000
Received: from [85.158.139.211:53954] by server-5.bemta-5.messagelabs.com id
	0A/07-11353-AF5B4A05; Thu, 15 Nov 2012 09:29:30 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1352971768!20276251!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTUyOTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19619 invoked from network); 15 Nov 2012 09:29:29 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-4.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 09:29:29 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAF9TJZp004509
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 09:29:20 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAF9TGrX022485
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 09:29:16 GMT
Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAF9TFSQ021141; Thu, 15 Nov 2012 03:29:15 -0600
MIME-Version: 1.0
Message-ID: <f6696efe-8527-4edb-99b4-ab7fdf8a3859@default>
Date: Thu, 15 Nov 2012 01:29:15 -0800 (PST)
From: Daniel Kiper <daniel.kiper@oracle.com>
To: <duanshuidao@hotmail.com>
X-Mailer: Zimbra on Oracle Beehive
Content-Disposition: inline
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: olaf@aepfle.de, xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com, kexec@lists.infradead.org,
	ptesarik@suse.cz, anderson@redhat.com, jbeulich@suse.com,
	crash-utility@redhat.com
Subject: Re: [Xen-devel] [PATCH 0/5] crash: Bundle of fixes for Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

> I am pleased to see those patch, and want to test
> the latest crash version for my issue.
>
> but how I get the latest crash version,
> by git or other ? I can't find it.
>
> please tell me.

Please check http://people.redhat.com/anderson/

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:34:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:34:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvqH-0006V9-7g; Thu, 15 Nov 2012 09:34:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <duanshuidao@hotmail.com>) id 1TYn8E-0004e2-R3
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 00:16:35 +0000
Received: from [85.158.138.51:14992] by server-16.bemta-3.messagelabs.com id
	DF/25-07461-D5434A05; Thu, 15 Nov 2012 00:16:29 +0000
X-Env-Sender: duanshuidao@hotmail.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1352938587!28159568!1
X-Originating-IP: [65.55.34.18]
X-SpamReason: No, hits=0.1 required=7.0 tests=FORGED_HOTMAIL_RCVD,
	ML_RADAR_SPEW_LINKS_12,ML_RADAR_SPEW_LINKS_14,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7961 invoked from network); 15 Nov 2012 00:16:28 -0000
Received: from col0-omc1-s8.col0.hotmail.com (HELO
	col0-omc1-s8.col0.hotmail.com) (65.55.34.18)
	by server-15.tower-174.messagelabs.com with SMTP;
	15 Nov 2012 00:16:28 -0000
Received: from COL115-DS10 ([65.55.34.8]) by col0-omc1-s8.col0.hotmail.com
	with Microsoft SMTPSVC(6.0.3790.4675); 
	Wed, 14 Nov 2012 16:16:26 -0800
X-Originating-IP: [219.133.131.46]
X-EIP: [RZJ/Pz6SVE6JniaU2RC6MhqhFKr/9Dr5]
X-Originating-Email: [duanshuidao@hotmail.com]
Message-ID: <COL115-DS10732CE1033159B778B27FBC520@phx.gbl>
From: "Jun Hu" <duanshuidao@hotmail.com>
To: "Dave Anderson" <anderson@redhat.com>,
	"Daniel Kiper" <daniel.kiper@oracle.com>
References: <935158332.31770683.1352922720179.JavaMail.root@redhat.com>
In-Reply-To: <935158332.31770683.1352922720179.JavaMail.root@redhat.com>
Date: Thu, 15 Nov 2012 08:16:19 +0800
Organization: SUSE
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Mailer: Microsoft Windows Live Mail 16.4.3505.912
X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3505.912
X-OriginalArrivalTime: 15 Nov 2012 00:16:26.0419 (UTC)
	FILETIME=[73B55830:01CDC2C6]
X-Mailman-Approved-At: Thu, 15 Nov 2012 09:34:35 +0000
Cc: olaf@aepfle.de, xen-devel@lists.xensource.com,
	konrad wilk <konrad.wilk@oracle.com>,
	andrew cooper3 <andrew.cooper3@citrix.com>, ptesarik@suse.cz,
	jbeulich@suse.com, kexec@lists.infradead.org, crash-utility@redhat.com
Subject: Re: [Xen-devel] [PATCH 0/5] crash: Bundle of fixes for Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

SGkgRGFuaWVsOgoKSSBhbSBwbGVhc2VkIHRvIHNlZSB0aG9zZSBwYXRjaCwgYW5kICB3YW50IHRv
IHRlc3QgIHRoZSBsYXRlc3QgY3Jhc2ggdmVyc2lvbiAKZm9yIG15IGlzc3VlLgoKYnV0ICBob3cg
IEkgZ2V0IHRoZSBsYXRlc3QgY3Jhc2ggdmVyc2lvbiAsIGJ5IGdpdCAgb3Igb3RoZXIgPyAgIEkg
Y2FuJ3QgZmluZCAKaXQuCgpwbGVhc2UgdGVsbCBtZS4KCgotLS0tLeWOn+Wni+mCruS7ti0tLS0t
IApGcm9tOiBEYXZlIEFuZGVyc29uClNlbnQ6IFRodXJzZGF5LCBOb3ZlbWJlciAxNSwgMjAxMiAz
OjUyIEFNClRvOiBEYW5pZWwgS2lwZXIKQ2M6IGtvbnJhZCB3aWxrIDsgYW5kcmV3IGNvb3BlcjMg
OyBvbGFmQGFlcGZsZS5kZSA7IGpiZXVsaWNoQHN1c2UuY29tIDsgCnB0ZXNhcmlrQHN1c2UuY3og
OyBjcmFzaC11dGlsaXR5QHJlZGhhdC5jb20gOyBrZXhlY0BsaXN0cy5pbmZyYWRlYWQub3JnIDsg
Cnhlbi1kZXZlbEBsaXN0cy54ZW5zb3VyY2UuY29tIDsgZHVhbnNodWlkYW9AaG90bWFpbC5jb20K
U3ViamVjdDogUmU6IFtQQVRDSCAwLzVdIGNyYXNoOiBCdW5kbGUgb2YgZml4ZXMgZm9yIFhlbgoK
CgotLS0tLSBPcmlnaW5hbCBNZXNzYWdlIC0tLS0tCj4gSGksCj4KPiBIZXJlIGlzIG5leHQgYnVu
ZGxlIG9mIGZpeGVzIGZvciBjcmFzaCBYZW4gc3VwcG9ydDoKPiAgIC0geGVuOiBGaXggcGFnZSB0
YWJsZXMgY2FjaGluZyBpc3N1ZXMsCj4gICAtIHhlbjogVXNlIGluaXRfdHNzIGFycmF5IG9yIHBl
cl9jcHVfX2luaXRfdHNzLAo+ICAgLSB4ZW46IFVzZSBwZXJfY3B1X19jcmFzaF9ub3RlcyBvciBj
cmFzaF9ub3RlcyBhcnJheSwKPiAgIC0geGVuOiBUcnkgaGFyZCB0byBnZXQgbWF4X2NwdXMgdmFs
dWUsCj4gICAtIHhlbjogVXNlIGNwdV9wcmVzZW50X21hcCBpbnN0ZWFkIG9mIGNwdV9vbmxpbmVf
bWFwLgo+Cj4gQWxsIHBhdGNoZXMgd2VyZSB0ZXN0ZWQgd2l0aCBYZW4gdmVyc2lvbnMgdXAgdG8g
NC4yLgo+Cj4gRGFuaWVsCj4KCkhpIERhbmllbCwKClRoZSBwYXRjaGVzIGxvb2sgcmVhc29uYWJs
ZSB0byBtZSwgYW5kIHRoZXkgdGVzdCBPSyBvbiBvbGRlcgpSSEVMNSBkb20wIGR1bXBmaWxlcy4g
IEl0IHdvdWxkIGJlIGludGVyZXN0aW5nIHRvIHNlZSB3aGV0aGVyCnRoZXkgd29yayBmb3IgSHUg
SnVuJ3MgU1VTRSBrZXJuZWwgZHVtcGZpbGUuICBJJ3ZlIGNjJ2QgaGltCmRpcmVjdGx5LgoKVGhh
bmtzLAogIERhdmUgCgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRw
Oi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:34:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:34:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvqH-0006V9-7g; Thu, 15 Nov 2012 09:34:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <duanshuidao@hotmail.com>) id 1TYn8E-0004e2-R3
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 00:16:35 +0000
Received: from [85.158.138.51:14992] by server-16.bemta-3.messagelabs.com id
	DF/25-07461-D5434A05; Thu, 15 Nov 2012 00:16:29 +0000
X-Env-Sender: duanshuidao@hotmail.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1352938587!28159568!1
X-Originating-IP: [65.55.34.18]
X-SpamReason: No, hits=0.1 required=7.0 tests=FORGED_HOTMAIL_RCVD,
	ML_RADAR_SPEW_LINKS_12,ML_RADAR_SPEW_LINKS_14,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7961 invoked from network); 15 Nov 2012 00:16:28 -0000
Received: from col0-omc1-s8.col0.hotmail.com (HELO
	col0-omc1-s8.col0.hotmail.com) (65.55.34.18)
	by server-15.tower-174.messagelabs.com with SMTP;
	15 Nov 2012 00:16:28 -0000
Received: from COL115-DS10 ([65.55.34.8]) by col0-omc1-s8.col0.hotmail.com
	with Microsoft SMTPSVC(6.0.3790.4675); 
	Wed, 14 Nov 2012 16:16:26 -0800
X-Originating-IP: [219.133.131.46]
X-EIP: [RZJ/Pz6SVE6JniaU2RC6MhqhFKr/9Dr5]
X-Originating-Email: [duanshuidao@hotmail.com]
Message-ID: <COL115-DS10732CE1033159B778B27FBC520@phx.gbl>
From: "Jun Hu" <duanshuidao@hotmail.com>
To: "Dave Anderson" <anderson@redhat.com>,
	"Daniel Kiper" <daniel.kiper@oracle.com>
References: <935158332.31770683.1352922720179.JavaMail.root@redhat.com>
In-Reply-To: <935158332.31770683.1352922720179.JavaMail.root@redhat.com>
Date: Thu, 15 Nov 2012 08:16:19 +0800
Organization: SUSE
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Mailer: Microsoft Windows Live Mail 16.4.3505.912
X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3505.912
X-OriginalArrivalTime: 15 Nov 2012 00:16:26.0419 (UTC)
	FILETIME=[73B55830:01CDC2C6]
X-Mailman-Approved-At: Thu, 15 Nov 2012 09:34:35 +0000
Cc: olaf@aepfle.de, xen-devel@lists.xensource.com,
	konrad wilk <konrad.wilk@oracle.com>,
	andrew cooper3 <andrew.cooper3@citrix.com>, ptesarik@suse.cz,
	jbeulich@suse.com, kexec@lists.infradead.org, crash-utility@redhat.com
Subject: Re: [Xen-devel] [PATCH 0/5] crash: Bundle of fixes for Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

SGkgRGFuaWVsOgoKSSBhbSBwbGVhc2VkIHRvIHNlZSB0aG9zZSBwYXRjaCwgYW5kICB3YW50IHRv
IHRlc3QgIHRoZSBsYXRlc3QgY3Jhc2ggdmVyc2lvbiAKZm9yIG15IGlzc3VlLgoKYnV0ICBob3cg
IEkgZ2V0IHRoZSBsYXRlc3QgY3Jhc2ggdmVyc2lvbiAsIGJ5IGdpdCAgb3Igb3RoZXIgPyAgIEkg
Y2FuJ3QgZmluZCAKaXQuCgpwbGVhc2UgdGVsbCBtZS4KCgotLS0tLeWOn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hbmllbCwKClRoZSBwYXRjaGVzIGxvb2sgcmVhc29uYWJs
ZSB0byBtZSwgYW5kIHRoZXkgdGVzdCBPSyBvbiBvbGRlcgpSSEVMNSBkb20wIGR1bXBmaWxlcy4g
IEl0IHdvdWxkIGJlIGludGVyZXN0aW5nIHRvIHNlZSB3aGV0aGVyCnRoZXkgd29yayBmb3IgSHUg
SnVuJ3MgU1VTRSBrZXJuZWwgZHVtcGZpbGUuICBJJ3ZlIGNjJ2QgaGltCmRpcmVjdGx5LgoKVGhh
bmtzLAogIERhdmUgCgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRw
Oi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:36:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:36:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvrR-0006a6-Md; Thu, 15 Nov 2012 09:35:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <liuw@liuw.name>) id 1TYvrQ-0006Zx-0x
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 09:35:48 +0000
Received: from [85.158.139.83:31279] by server-12.bemta-5.messagelabs.com id
	35/F9-02886-377B4A05; Thu, 15 Nov 2012 09:35:47 +0000
X-Env-Sender: liuw@liuw.name
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352972144!23152850!1
X-Originating-IP: [209.85.214.171]
X-SpamReason: No, hits=0.9 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_30_40,HTML_MESSAGE,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8680 invoked from network); 15 Nov 2012 09:35:45 -0000
Received: from mail-ob0-f171.google.com (HELO mail-ob0-f171.google.com)
	(209.85.214.171)
	by server-11.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 09:35:45 -0000
Received: by mail-ob0-f171.google.com with SMTP id dn14so1869838obc.30
	for <xen-devel@lists.xensource.com>;
	Thu, 15 Nov 2012 01:35:44 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type:x-gm-message-state;
	bh=ovGSdshesBz7BhMbC0QDUlAJPu+NttBon2Ygcl4Wt0U=;
	b=gKV4Ft/FUl0z+7PhReV5iLG/ORsAq2epYHzRRgG4pIS0eF3LqLsCmYo/sQDFQ/uMHw
	rpCMuh4VKOBwbPffY/FQKg9RD//Nxy+4PN4BhypQdLYvgYQNbzzspdo+lEL+oHPwBWlJ
	xH+RUWFlxdg0XDltgSHq1iaMEI8UCfAdFaQ14YKr0/wXLyiGuahAHb5YYeAKkZ+NJDRl
	0GbAudsSua1DX4UbmArs199mR5/gjUrYIqsFvCkXQV4dl4Ze2IrG2T1NL5FOMrrGg7DA
	N+QrL8cF/D5iONa2FeSMGgzak4qTDnTfKCt/DdKFpOOCzIMzuFAzA0WvPUU3xgHvTarQ
	ndVg==
Received: by 10.182.146.107 with SMTP id tb11mr402398obb.30.1352972143998;
	Thu, 15 Nov 2012 01:35:43 -0800 (PST)
MIME-Version: 1.0
Received: by 10.76.8.6 with HTTP; Thu, 15 Nov 2012 01:35:13 -0800 (PST)
In-Reply-To: <50A4AA06.8080900@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
From: Wei Liu <liuw@liuw.name>
Date: Thu, 15 Nov 2012 17:35:13 +0800
Message-ID: <CAOsiSVU+9fkGQhVhnrx=xxUD8hej55XXJGpKGWAxe1USPEhiEQ@mail.gmail.com>
To: ANNIE LI <annie.li@oracle.com>
X-Gm-Message-State: ALoCoQk9FmIZTtiiLAk5iksCfcpPRP5G9a8zqG5yvvCyRae/1Z/Awx/HTdGHscOr16JmNwAsYrZD
Cc: netdev@vger.kernel.org,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0487768002020222232=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0487768002020222232==
Content-Type: multipart/alternative; boundary=f46d04447fb108b73304ce856095

--f46d04447fb108b73304ce856095
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Thu, Nov 15, 2012 at 4:38 PM, ANNIE LI <annie.li@oracle.com> wrote:

>
>
> On 2012-11-15 15:40, Pasi K=C3=A4rkk=C3=A4inen wrote:
>
>> Hello,
>>
>> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
>>
>>> This patch implements persistent grants for xen-netfront/netback. This
>>> mechanism maintains page pools in netback/netfront, these page pools is
>>> used to
>>> save grant pages which are mapped. This way improve performance which i=
s
>>> wasted
>>> when doing grant operations.
>>>
>>> Current netback/netfront does map/unmap grant operations frequently whe=
n
>>> transmitting/receiving packets, and grant operations costs much cpu
>>> clock. In
>>> this patch, netfront/netback maps grant pages when needed and then save=
s
>>> them
>>> into a page pool for future use. All these pages will be unmapped when
>>> removing/releasing the net device.
>>>
>>>  Do you have performance numbers available already? with/without
>> persistent grants?
>>
> I have some simple netperf/netserver test result with/without persistent
> grants,
>
> Following is result of with persistent grant patch,
>
> Guests, Sum,      Avg,     Min,     Max
>  1,  15106.4,  15106.4, 15106.36, 15106.36
>  2,  13052.7,  6526.34,  6261.81,  6790.86
>  3,  12675.1,  6337.53,  6220.24,  6454.83
>  4,  13194,  6596.98,  6274.70,  6919.25
>
>
> Following are result of without persistent patch
>
> Guests, Sum,     Avg,    Min,        Max
>  1,  10864.1,  10864.1, 10864.10, 10864.10
>  2,  10898.5,  5449.24,  4862.08,  6036.40
>  3,  10734.5,  5367.26,  5261.43,  5473.08
>  4,  10924,    5461.99,  5314.84,  5609.14
>
>
>
Interesting results. Have you tested how good it is on a 10G nic, i.e.
guest sending packets
through physical network to another host.


Wei.

--f46d04447fb108b73304ce856095
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><div class=3D"gmail_extra"><div class=3D"gmail_quote">On Thu, Nov 15, 2=
012 at 4:38 PM, ANNIE LI <span dir=3D"ltr">&lt;<a href=3D"mailto:annie.li@o=
racle.com" target=3D"_blank">annie.li@oracle.com</a>&gt;</span> wrote:<br><=
blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px=
 #ccc solid;padding-left:1ex">

<div class=3D"im"><br>
<br>
On 2012-11-15 15:40, Pasi K=C3=A4rkk=C3=A4inen wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
Hello,<br>
<br>
On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
This patch implements persistent grants for xen-netfront/netback. This<br>
mechanism maintains page pools in netback/netfront, these page pools is use=
d to<br>
save grant pages which are mapped. This way improve performance which is wa=
sted<br>
when doing grant operations.<br>
<br>
Current netback/netfront does map/unmap grant operations frequently when<br=
>
transmitting/receiving packets, and grant operations costs much cpu clock. =
In<br>
this patch, netfront/netback maps grant pages when needed and then saves th=
em<br>
into a page pool for future use. All these pages will be unmapped when<br>
removing/releasing the net device.<br>
<br>
</blockquote>
Do you have performance numbers available already? with/without persistent =
grants?<br>
</blockquote></div>
I have some simple netperf/netserver test result with/without persistent gr=
ants,<br>
<br>
Following is result of with persistent grant patch,<br>
<br>
Guests, Sum, =C2=A0 =C2=A0 =C2=A0Avg, =C2=A0 =C2=A0 Min, =C2=A0 =C2=A0 Max<=
br>
=C2=A01, =C2=A015106.4, =C2=A015106.4, 15106.36, 15106.36<br>
=C2=A02, =C2=A013052.7, =C2=A06526.34, =C2=A06261.81, =C2=A06790.86<br>
=C2=A03, =C2=A012675.1, =C2=A06337.53, =C2=A06220.24, =C2=A06454.83<br>
=C2=A04, =C2=A013194, =C2=A06596.98, =C2=A06274.70, =C2=A06919.25<br>
<br>
<br>
Following are result of without persistent patch<br>
<br>
Guests, Sum, =C2=A0 =C2=A0 Avg, =C2=A0 =C2=A0Min, =C2=A0 =C2=A0 =C2=A0 =C2=
=A0Max<br>
=C2=A01, =C2=A010864.1, =C2=A010864.1, 10864.10, 10864.10<br>
=C2=A02, =C2=A010898.5, =C2=A05449.24, =C2=A04862.08, =C2=A06036.40<br>
=C2=A03, =C2=A010734.5, =C2=A05367.26, =C2=A05261.43, =C2=A05473.08<br>
=C2=A04, =C2=A010924, =C2=A0 =C2=A05461.99, =C2=A05314.84, =C2=A05609.14<di=
v class=3D"im"><br>
<br></div></blockquote><div><br></div><div>Interesting results. Have you te=
sted how good it is on a 10G nic, i.e. guest sending packets</div><div>thro=
ugh physical network to another host.</div><div><br></div><div><br></div>

<div>Wei.</div></div></div>

--f46d04447fb108b73304ce856095--


--===============0487768002020222232==
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.xen.org
http://lists.xen.org/xen-devel

--===============0487768002020222232==--


From xen-devel-bounces@lists.xen.org Thu Nov 15 09:36:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:36:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvrR-0006a6-Md; Thu, 15 Nov 2012 09:35:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <liuw@liuw.name>) id 1TYvrQ-0006Zx-0x
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 09:35:48 +0000
Received: from [85.158.139.83:31279] by server-12.bemta-5.messagelabs.com id
	35/F9-02886-377B4A05; Thu, 15 Nov 2012 09:35:47 +0000
X-Env-Sender: liuw@liuw.name
X-Msg-Ref: server-11.tower-182.messagelabs.com!1352972144!23152850!1
X-Originating-IP: [209.85.214.171]
X-SpamReason: No, hits=0.9 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_30_40,HTML_MESSAGE,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8680 invoked from network); 15 Nov 2012 09:35:45 -0000
Received: from mail-ob0-f171.google.com (HELO mail-ob0-f171.google.com)
	(209.85.214.171)
	by server-11.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 09:35:45 -0000
Received: by mail-ob0-f171.google.com with SMTP id dn14so1869838obc.30
	for <xen-devel@lists.xensource.com>;
	Thu, 15 Nov 2012 01:35:44 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type:x-gm-message-state;
	bh=ovGSdshesBz7BhMbC0QDUlAJPu+NttBon2Ygcl4Wt0U=;
	b=gKV4Ft/FUl0z+7PhReV5iLG/ORsAq2epYHzRRgG4pIS0eF3LqLsCmYo/sQDFQ/uMHw
	rpCMuh4VKOBwbPffY/FQKg9RD//Nxy+4PN4BhypQdLYvgYQNbzzspdo+lEL+oHPwBWlJ
	xH+RUWFlxdg0XDltgSHq1iaMEI8UCfAdFaQ14YKr0/wXLyiGuahAHb5YYeAKkZ+NJDRl
	0GbAudsSua1DX4UbmArs199mR5/gjUrYIqsFvCkXQV4dl4Ze2IrG2T1NL5FOMrrGg7DA
	N+QrL8cF/D5iONa2FeSMGgzak4qTDnTfKCt/DdKFpOOCzIMzuFAzA0WvPUU3xgHvTarQ
	ndVg==
Received: by 10.182.146.107 with SMTP id tb11mr402398obb.30.1352972143998;
	Thu, 15 Nov 2012 01:35:43 -0800 (PST)
MIME-Version: 1.0
Received: by 10.76.8.6 with HTTP; Thu, 15 Nov 2012 01:35:13 -0800 (PST)
In-Reply-To: <50A4AA06.8080900@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
From: Wei Liu <liuw@liuw.name>
Date: Thu, 15 Nov 2012 17:35:13 +0800
Message-ID: <CAOsiSVU+9fkGQhVhnrx=xxUD8hej55XXJGpKGWAxe1USPEhiEQ@mail.gmail.com>
To: ANNIE LI <annie.li@oracle.com>
X-Gm-Message-State: ALoCoQk9FmIZTtiiLAk5iksCfcpPRP5G9a8zqG5yvvCyRae/1Z/Awx/HTdGHscOr16JmNwAsYrZD
Cc: netdev@vger.kernel.org,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0487768002020222232=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0487768002020222232==
Content-Type: multipart/alternative; boundary=f46d04447fb108b73304ce856095

--f46d04447fb108b73304ce856095
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Thu, Nov 15, 2012 at 4:38 PM, ANNIE LI <annie.li@oracle.com> wrote:

>
>
> On 2012-11-15 15:40, Pasi K=C3=A4rkk=C3=A4inen wrote:
>
>> Hello,
>>
>> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
>>
>>> This patch implements persistent grants for xen-netfront/netback. This
>>> mechanism maintains page pools in netback/netfront, these page pools is
>>> used to
>>> save grant pages which are mapped. This way improve performance which i=
s
>>> wasted
>>> when doing grant operations.
>>>
>>> Current netback/netfront does map/unmap grant operations frequently whe=
n
>>> transmitting/receiving packets, and grant operations costs much cpu
>>> clock. In
>>> this patch, netfront/netback maps grant pages when needed and then save=
s
>>> them
>>> into a page pool for future use. All these pages will be unmapped when
>>> removing/releasing the net device.
>>>
>>>  Do you have performance numbers available already? with/without
>> persistent grants?
>>
> I have some simple netperf/netserver test result with/without persistent
> grants,
>
> Following is result of with persistent grant patch,
>
> Guests, Sum,      Avg,     Min,     Max
>  1,  15106.4,  15106.4, 15106.36, 15106.36
>  2,  13052.7,  6526.34,  6261.81,  6790.86
>  3,  12675.1,  6337.53,  6220.24,  6454.83
>  4,  13194,  6596.98,  6274.70,  6919.25
>
>
> Following are result of without persistent patch
>
> Guests, Sum,     Avg,    Min,        Max
>  1,  10864.1,  10864.1, 10864.10, 10864.10
>  2,  10898.5,  5449.24,  4862.08,  6036.40
>  3,  10734.5,  5367.26,  5261.43,  5473.08
>  4,  10924,    5461.99,  5314.84,  5609.14
>
>
>
Interesting results. Have you tested how good it is on a 10G nic, i.e.
guest sending packets
through physical network to another host.


Wei.

--f46d04447fb108b73304ce856095
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><div class=3D"gmail_extra"><div class=3D"gmail_quote">On Thu, Nov 15, 2=
012 at 4:38 PM, ANNIE LI <span dir=3D"ltr">&lt;<a href=3D"mailto:annie.li@o=
racle.com" target=3D"_blank">annie.li@oracle.com</a>&gt;</span> wrote:<br><=
blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px=
 #ccc solid;padding-left:1ex">

<div class=3D"im"><br>
<br>
On 2012-11-15 15:40, Pasi K=C3=A4rkk=C3=A4inen wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
Hello,<br>
<br>
On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
This patch implements persistent grants for xen-netfront/netback. This<br>
mechanism maintains page pools in netback/netfront, these page pools is use=
d to<br>
save grant pages which are mapped. This way improve performance which is wa=
sted<br>
when doing grant operations.<br>
<br>
Current netback/netfront does map/unmap grant operations frequently when<br=
>
transmitting/receiving packets, and grant operations costs much cpu clock. =
In<br>
this patch, netfront/netback maps grant pages when needed and then saves th=
em<br>
into a page pool for future use. All these pages will be unmapped when<br>
removing/releasing the net device.<br>
<br>
</blockquote>
Do you have performance numbers available already? with/without persistent =
grants?<br>
</blockquote></div>
I have some simple netperf/netserver test result with/without persistent gr=
ants,<br>
<br>
Following is result of with persistent grant patch,<br>
<br>
Guests, Sum, =C2=A0 =C2=A0 =C2=A0Avg, =C2=A0 =C2=A0 Min, =C2=A0 =C2=A0 Max<=
br>
=C2=A01, =C2=A015106.4, =C2=A015106.4, 15106.36, 15106.36<br>
=C2=A02, =C2=A013052.7, =C2=A06526.34, =C2=A06261.81, =C2=A06790.86<br>
=C2=A03, =C2=A012675.1, =C2=A06337.53, =C2=A06220.24, =C2=A06454.83<br>
=C2=A04, =C2=A013194, =C2=A06596.98, =C2=A06274.70, =C2=A06919.25<br>
<br>
<br>
Following are result of without persistent patch<br>
<br>
Guests, Sum, =C2=A0 =C2=A0 Avg, =C2=A0 =C2=A0Min, =C2=A0 =C2=A0 =C2=A0 =C2=
=A0Max<br>
=C2=A01, =C2=A010864.1, =C2=A010864.1, 10864.10, 10864.10<br>
=C2=A02, =C2=A010898.5, =C2=A05449.24, =C2=A04862.08, =C2=A06036.40<br>
=C2=A03, =C2=A010734.5, =C2=A05367.26, =C2=A05261.43, =C2=A05473.08<br>
=C2=A04, =C2=A010924, =C2=A0 =C2=A05461.99, =C2=A05314.84, =C2=A05609.14<di=
v class=3D"im"><br>
<br></div></blockquote><div><br></div><div>Interesting results. Have you te=
sted how good it is on a 10G nic, i.e. guest sending packets</div><div>thro=
ugh physical network to another host.</div><div><br></div><div><br></div>

<div>Wei.</div></div></div>

--f46d04447fb108b73304ce856095--


--===============0487768002020222232==
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.xen.org
http://lists.xen.org/xen-devel

--===============0487768002020222232==--


From xen-devel-bounces@lists.xen.org Thu Nov 15 09:42:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:42:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvxi-0006sV-RF; Thu, 15 Nov 2012 09:42:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYvxh-0006sQ-I1
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 09:42:17 +0000
Received: from [85.158.143.99:44088] by server-1.bemta-4.messagelabs.com id
	32/B3-27934-8F8B4A05; Thu, 15 Nov 2012 09:42:16 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1352972536!29102390!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11848 invoked from network); 15 Nov 2012 09:42:16 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-216.messagelabs.com with SMTP;
	15 Nov 2012 09:42:16 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 09:42:16 +0000
Message-Id: <50A4C70602000078000A8BED@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 15 Nov 2012 09:42:14 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Jinsong Liu" <jinsong.liu@intel.com>
References: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
	<1352273413.12977.27.camel@hastur.hellion.org.uk>
	<DE8DF0795D48FD4CA783C40EC829233537BA4E@SHSMSX101.ccr.corp.intel.com>
	<1352740209.27833.314.camel@zakaz.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC82923353827C5@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923353827C5@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH] Handle broken page with regard to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 14.11.12 at 18:40, "Liu, Jinsong" <jinsong.liu@intel.com> wrote:
> Ian Campbell wrote:
>> I believe George Acked this patch in
>> <CAFLBxZYy8mqvfNH4Hp9x=o0jqZ4r9hnCS_qLR0O8+rkY2AAdTA@mail.gmail.com>.
>> Were there other acks, e.g. from Jan for the hypervisor side?
> 
> Attached are acks from George, Jan, and IanJ.

Just to be clear: I never acked this change. For one, I only said
"looks okay to me", which doesn't immediately translate to an
ack. Plus, this was on an old version of the patch, and with me
subsequently having spotted problems with it, that would have
automatically invalidated any acks.

Nevertheless, with the patch as it currently is, I'm fine with
keeping the ack, if it gets amended by mentioning that this is
for the hypervisor portion of the patch only.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:42:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:42:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYvxi-0006sV-RF; Thu, 15 Nov 2012 09:42:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYvxh-0006sQ-I1
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 09:42:17 +0000
Received: from [85.158.143.99:44088] by server-1.bemta-4.messagelabs.com id
	32/B3-27934-8F8B4A05; Thu, 15 Nov 2012 09:42:16 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1352972536!29102390!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11848 invoked from network); 15 Nov 2012 09:42:16 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-216.messagelabs.com with SMTP;
	15 Nov 2012 09:42:16 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 09:42:16 +0000
Message-Id: <50A4C70602000078000A8BED@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 15 Nov 2012 09:42:14 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Jinsong Liu" <jinsong.liu@intel.com>
References: <730dd3f22a12fd97814b.1351826729@ljsromley.bj.intel.com>
	<1352273413.12977.27.camel@hastur.hellion.org.uk>
	<DE8DF0795D48FD4CA783C40EC829233537BA4E@SHSMSX101.ccr.corp.intel.com>
	<1352740209.27833.314.camel@zakaz.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC82923353827C5@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923353827C5@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH] Handle broken page with regard to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 14.11.12 at 18:40, "Liu, Jinsong" <jinsong.liu@intel.com> wrote:
> Ian Campbell wrote:
>> I believe George Acked this patch in
>> <CAFLBxZYy8mqvfNH4Hp9x=o0jqZ4r9hnCS_qLR0O8+rkY2AAdTA@mail.gmail.com>.
>> Were there other acks, e.g. from Jan for the hypervisor side?
> 
> Attached are acks from George, Jan, and IanJ.

Just to be clear: I never acked this change. For one, I only said
"looks okay to me", which doesn't immediately translate to an
ack. Plus, this was on an old version of the patch, and with me
subsequently having spotted problems with it, that would have
automatically invalidated any acks.

Nevertheless, with the patch as it currently is, I'm fine with
keeping the ack, if it gets amended by mentioning that this is
for the hypervisor portion of the patch only.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:45:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:45:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYw0e-00070R-Ff; Thu, 15 Nov 2012 09:45:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYw0d-00070K-Hn
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 09:45:19 +0000
Received: from [85.158.143.99:31274] by server-1.bemta-4.messagelabs.com id
	F8/19-27934-EA9B4A05; Thu, 15 Nov 2012 09:45:18 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352972717!26650975!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31730 invoked from network); 15 Nov 2012 09:45:17 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-216.messagelabs.com with SMTP;
	15 Nov 2012 09:45:17 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 09:45:17 +0000
Message-Id: <50A4C7BC02000078000A8BF0@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 15 Nov 2012 09:45:16 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Liu Jinsong" <jinsong.liu@intel.com>
References: <da7faf53790e661cb6c4.1352944365@ljsromley.bj.intel.com>
In-Reply-To: <da7faf53790e661cb6c4.1352944365@ljsromley.bj.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: george.dunlap@eu.citrix.com, Ian.Jackson@eu.citrix.com,
	ian.campbell@citrix.com, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 02:52, Liu Jinsong <jinsong.liu@intel.com> wrote:
> Generally, there are 2 cases:
> 1. broken page occurs before migration
> 2. broken page occurs during migration
> 
> At the sender
>   For case 1, the broken page would be mapped but not copied to target
>   (otherwise it may trigger more serious error, say, SRAR error).
>   While its pfn_type and pfn number would be transferred to target
>   so that target take appropriate action.
> 
>   For case 2, mce handler marks the broken page to dirty bitmap, so that
>   at copypages stage of migration, its pfn_type and pfn number would be
>   transferred to target and then take appropriate action.
> 
> At the target
>   When migration target would populate pages for guest. As for the case
>   of broken page wrt migration, we prefer keep the corresponding page,
>   for the sake of seamless migration.
> 
>   At target it would set p2m as p2m_ram_broken for broken page. Guest MCE
>   may have good chance to handle its broken page, while if guest access
>   the broken page again it would kill itself as expected.
> 
> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
> Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> Acked-by: Jan Beulich <JBeulich@suse.com>

We're getting closer, but given that this is a re-submission _and_
the subject says v2 (albeit it really is v3 or higher), briefly
mentioning what changed from earlier versions would greatly
help with reviewing.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:45:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:45:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYw0e-00070R-Ff; Thu, 15 Nov 2012 09:45:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYw0d-00070K-Hn
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 09:45:19 +0000
Received: from [85.158.143.99:31274] by server-1.bemta-4.messagelabs.com id
	F8/19-27934-EA9B4A05; Thu, 15 Nov 2012 09:45:18 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352972717!26650975!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31730 invoked from network); 15 Nov 2012 09:45:17 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-216.messagelabs.com with SMTP;
	15 Nov 2012 09:45:17 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 09:45:17 +0000
Message-Id: <50A4C7BC02000078000A8BF0@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 15 Nov 2012 09:45:16 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Liu Jinsong" <jinsong.liu@intel.com>
References: <da7faf53790e661cb6c4.1352944365@ljsromley.bj.intel.com>
In-Reply-To: <da7faf53790e661cb6c4.1352944365@ljsromley.bj.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: george.dunlap@eu.citrix.com, Ian.Jackson@eu.citrix.com,
	ian.campbell@citrix.com, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 02:52, Liu Jinsong <jinsong.liu@intel.com> wrote:
> Generally, there are 2 cases:
> 1. broken page occurs before migration
> 2. broken page occurs during migration
> 
> At the sender
>   For case 1, the broken page would be mapped but not copied to target
>   (otherwise it may trigger more serious error, say, SRAR error).
>   While its pfn_type and pfn number would be transferred to target
>   so that target take appropriate action.
> 
>   For case 2, mce handler marks the broken page to dirty bitmap, so that
>   at copypages stage of migration, its pfn_type and pfn number would be
>   transferred to target and then take appropriate action.
> 
> At the target
>   When migration target would populate pages for guest. As for the case
>   of broken page wrt migration, we prefer keep the corresponding page,
>   for the sake of seamless migration.
> 
>   At target it would set p2m as p2m_ram_broken for broken page. Guest MCE
>   may have good chance to handle its broken page, while if guest access
>   the broken page again it would kill itself as expected.
> 
> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
> Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> Acked-by: Jan Beulich <JBeulich@suse.com>

We're getting closer, but given that this is a re-submission _and_
the subject says v2 (albeit it really is v3 or higher), briefly
mentioning what changed from earlier versions would greatly
help with reviewing.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:50:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:50:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYw5e-0007Gp-8S; Thu, 15 Nov 2012 09:50:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYw5c-0007Gk-IG
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 09:50:28 +0000
Received: from [85.158.143.99:49872] by server-3.bemta-4.messagelabs.com id
	E7/C2-06841-3EAB4A05; Thu, 15 Nov 2012 09:50:27 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1352973026!22495220!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25888 invoked from network); 15 Nov 2012 09:50:26 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-216.messagelabs.com with SMTP;
	15 Nov 2012 09:50:26 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 09:50:26 +0000
Message-Id: <50A4C8F102000078000A8C14@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 15 Nov 2012 09:50:25 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Subject: [Xen-devel] Xen 4.2.1-rc1 and 4.1.4-rc1 have been tagged
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

All,

aiming at releases with not too many more RCs, please test!

Thanks, Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:50:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:50:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYw5e-0007Gp-8S; Thu, 15 Nov 2012 09:50:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYw5c-0007Gk-IG
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 09:50:28 +0000
Received: from [85.158.143.99:49872] by server-3.bemta-4.messagelabs.com id
	E7/C2-06841-3EAB4A05; Thu, 15 Nov 2012 09:50:27 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1352973026!22495220!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25888 invoked from network); 15 Nov 2012 09:50:26 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-216.messagelabs.com with SMTP;
	15 Nov 2012 09:50:26 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 09:50:26 +0000
Message-Id: <50A4C8F102000078000A8C14@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 15 Nov 2012 09:50:25 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Subject: [Xen-devel] Xen 4.2.1-rc1 and 4.1.4-rc1 have been tagged
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

All,

aiming at releases with not too many more RCs, please test!

Thanks, Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:55:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:55:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwAf-0007Y6-2Q; Thu, 15 Nov 2012 09:55:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYwAd-0007Y0-Ax
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 09:55:39 +0000
Received: from [85.158.143.35:24100] by server-2.bemta-4.messagelabs.com id
	91/1D-28922-A1CB4A05; Thu, 15 Nov 2012 09:55:38 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1352973307!11922138!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21561 invoked from network); 15 Nov 2012 09:55:10 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-21.messagelabs.com with SMTP;
	15 Nov 2012 09:55:10 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 09:55:04 +0000
Message-Id: <50A4CA0702000078000A8C21@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 15 Nov 2012 09:55:03 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mukesh Rathor" <mukesh.rathor@oracle.com>
References: <20121114181933.1ffb5f09@mantra.us.oracle.com>
In-Reply-To: <20121114181933.1ffb5f09@mantra.us.oracle.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH]:  PVH: remove FEATURES_PVH macro
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 03:19, Mukesh Rathor <mukesh.rathor@oracle.com> wrote:
> PVH: remove macro FEATURES_PVH and put PVH strings in the ELFNOTE line, 
> because there's a null char before FEATURES_PVH and in the FEATURES_PVH 
> strings since this is not C file
> 
> Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
> ---
>  arch/x86/xen/xen-head.S |   14 +++++---------
>  1 files changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
> index 1a6bca1..340fd4e 100644
> --- a/arch/x86/xen/xen-head.S
> +++ b/arch/x86/xen/xen-head.S
> @@ -13,14 +13,6 @@
>  #include <xen/interface/elfnote.h>
>  #include <asm/xen/interface.h>
>  
> -#ifdef CONFIG_XEN_X86_PVH
> -#define FEATURES_PVH "|writable_descriptor_tables" \
> -		     "|auto_translated_physmap" \
> -		     "|supervisor_mode_kernel" \
> -		     "|hvm_callback_vector"
> -#else
> -#define FEATURES_PVH /* Not supported */
> -#endif
>  
>  	__INIT
>  ENTRY(startup_xen)
> @@ -104,7 +96,11 @@ NEXT_HYPERCALL(arch_6)
>  #endif
>  	ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          _ASM_PTR startup_xen)
>  	ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _ASM_PTR hypercall_page)
> -	ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz 
> "!writable_page_tables|pae_pgdir_above_4gb"FEATURES_PVH)
> +#ifdef CONFIG_XEN_X86_PVH
> +        ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz 
> "!writable_page_tables|pae_pgdir_above_4gb|writable_descriptor_tables|auto_tr
> anslated_physmap|supervisor_mode_kernel|hvm_callback_vector")
> +#else
> +        ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz 
> "!writable_page_tables|pae_pgdir_above_4gb")
> +#endif

Ugly. Can't you do this with a combination of .ascii and .asciz,
keeping the macro above?

Jan

>  	ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz "yes")
>  	ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz "generic")
>  	ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,
> -- 
> 1.7.2.3
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:55:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:55:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwAf-0007Y6-2Q; Thu, 15 Nov 2012 09:55:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYwAd-0007Y0-Ax
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 09:55:39 +0000
Received: from [85.158.143.35:24100] by server-2.bemta-4.messagelabs.com id
	91/1D-28922-A1CB4A05; Thu, 15 Nov 2012 09:55:38 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1352973307!11922138!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21561 invoked from network); 15 Nov 2012 09:55:10 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-21.messagelabs.com with SMTP;
	15 Nov 2012 09:55:10 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 09:55:04 +0000
Message-Id: <50A4CA0702000078000A8C21@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 15 Nov 2012 09:55:03 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mukesh Rathor" <mukesh.rathor@oracle.com>
References: <20121114181933.1ffb5f09@mantra.us.oracle.com>
In-Reply-To: <20121114181933.1ffb5f09@mantra.us.oracle.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH]:  PVH: remove FEATURES_PVH macro
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 03:19, Mukesh Rathor <mukesh.rathor@oracle.com> wrote:
> PVH: remove macro FEATURES_PVH and put PVH strings in the ELFNOTE line, 
> because there's a null char before FEATURES_PVH and in the FEATURES_PVH 
> strings since this is not C file
> 
> Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
> ---
>  arch/x86/xen/xen-head.S |   14 +++++---------
>  1 files changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
> index 1a6bca1..340fd4e 100644
> --- a/arch/x86/xen/xen-head.S
> +++ b/arch/x86/xen/xen-head.S
> @@ -13,14 +13,6 @@
>  #include <xen/interface/elfnote.h>
>  #include <asm/xen/interface.h>
>  
> -#ifdef CONFIG_XEN_X86_PVH
> -#define FEATURES_PVH "|writable_descriptor_tables" \
> -		     "|auto_translated_physmap" \
> -		     "|supervisor_mode_kernel" \
> -		     "|hvm_callback_vector"
> -#else
> -#define FEATURES_PVH /* Not supported */
> -#endif
>  
>  	__INIT
>  ENTRY(startup_xen)
> @@ -104,7 +96,11 @@ NEXT_HYPERCALL(arch_6)
>  #endif
>  	ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          _ASM_PTR startup_xen)
>  	ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _ASM_PTR hypercall_page)
> -	ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz 
> "!writable_page_tables|pae_pgdir_above_4gb"FEATURES_PVH)
> +#ifdef CONFIG_XEN_X86_PVH
> +        ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz 
> "!writable_page_tables|pae_pgdir_above_4gb|writable_descriptor_tables|auto_tr
> anslated_physmap|supervisor_mode_kernel|hvm_callback_vector")
> +#else
> +        ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz 
> "!writable_page_tables|pae_pgdir_above_4gb")
> +#endif

Ugly. Can't you do this with a combination of .ascii and .asciz,
keeping the macro above?

Jan

>  	ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz "yes")
>  	ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz "generic")
>  	ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,
> -- 
> 1.7.2.3
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:57:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:57:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwCO-0007dr-Ix; Thu, 15 Nov 2012 09:57:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TYwCM-0007dh-GI
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 09:57:26 +0000
Received: from [85.158.143.99:34715] by server-3.bemta-4.messagelabs.com id
	59/6E-06841-58CB4A05; Thu, 15 Nov 2012 09:57:25 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352973443!26652960!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20872 invoked from network); 15 Nov 2012 09:57:24 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 09:57:24 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15822179"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 09:57:18 +0000
Received: from [192.168.1.30] (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 09:57:17 +0000
Message-ID: <50A4BC7D.6060707@citrix.com>
Date: Thu, 15 Nov 2012 10:57:17 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Annie Li <annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963066-570-1-git-send-email-annie.li@oracle.com>
In-Reply-To: <1352963066-570-1-git-send-email-annie.li@oracle.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent
 grant with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 15/11/12 08:04, Annie Li wrote:
> This patch implements persistent grant in netback driver. Tx and rx
> share the same page pool, this pool will be split into two parts
> in next patch.
> 
> Signed-off-by: Annie Li <annie.li@oracle.com>
> ---
>  drivers/net/xen-netback/common.h    |   18 +++-
>  drivers/net/xen-netback/interface.c |   22 ++++
>  drivers/net/xen-netback/netback.c   |  212 +++++++++++++++++++++++++++++++----
>  drivers/net/xen-netback/xenbus.c    |   14 ++-
>  4 files changed, 239 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
> index 94b79c3..a85cac6 100644
> --- a/drivers/net/xen-netback/common.h
> +++ b/drivers/net/xen-netback/common.h
> @@ -45,8 +45,19 @@
>  #include <xen/grant_table.h>
>  #include <xen/xenbus.h>
> 
> +#define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE)
> +#define XEN_NETIF_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE)
> +#define MAXIMUM_OUTSTANDING_BLOCK_REQS \
> +                       (XEN_NETIF_TX_RING_SIZE + XEN_NETIF_RX_RING_SIZE)
> +
>  struct xen_netbk;
> 
> +struct persistent_entry {
> +       grant_ref_t forgranted;
> +       struct page *fpage;
> +       struct gnttab_map_grant_ref map;
> +};

This should be common with the blkback implementation, I think we should
move some structures/functions from blkback to a common place. When I
implementated some functions in blkback I though they could be reused by
other backends that wanted to use persistent grants, so I keep them free
of blkback specific structures.

>  struct xenvif {
>         /* Unique identifier for this interface. */
>         domid_t          domid;
> @@ -75,6 +86,7 @@ struct xenvif {
> 
>         /* Internal feature information. */
>         u8 can_queue:1;     /* can queue packets for receiver? */
> +       u8 persistent_grant:1;
> 
>         /*
>          * Allow xenvif_start_xmit() to peek ahead in the rx request
> @@ -98,6 +110,9 @@ struct xenvif {
>         struct net_device *dev;
> 
>         wait_queue_head_t waiting_to_free;
> +
> +       struct persistent_entry *persistent_gnt[MAXIMUM_OUTSTANDING_BLOCK_REQS];
> +       unsigned int persistent_gntcnt;

This should be a red-black tree, which has the property of a search time
<= O(log n), using an array is more expensive in terms of memory and has
a worse search time O(n), this is specially interesting for netback,
which can have twice as much persistent grants as blkback (because two
rings are used).

Take a look at the following functions from blkback; foreach_grant,
add_persistent_gnt and get_persistent_gnt. They are generic functions to
deal with persistent grants.

>  };
> 
>  static inline struct xenbus_device *xenvif_to_xenbus_device(struct xenvif *vif)
> @@ -105,9 +120,6 @@ static inline struct xenbus_device *xenvif_to_xenbus_device(struct xenvif *vif)
>         return to_xenbus_device(vif->dev->dev.parent);
>  }
> 
> -#define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE)
> -#define XEN_NETIF_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE)
> -
>  struct xenvif *xenvif_alloc(struct device *parent,
>                             domid_t domid,
>                             unsigned int handle);
> diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
> index b7d41f8..226d159 100644
> --- a/drivers/net/xen-netback/interface.c
> +++ b/drivers/net/xen-netback/interface.c
> @@ -300,6 +300,8 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
>                 return ERR_PTR(err);
>         }
> 
> +       vif->persistent_gntcnt = 0;
> +
>         netdev_dbg(dev, "Successfully created xenvif\n");
>         return vif;
>  }
> @@ -343,6 +345,23 @@ err:
>         return err;
>  }
> 
> +void xenvif_free_grants(struct persistent_entry **pers_entry,
> +                       unsigned int count)
> +{
> +       int i, ret;
> +       struct gnttab_unmap_grant_ref unmap;
> +
> +       for (i = 0; i < count; i++) {
> +               gnttab_set_unmap_op(&unmap,
> +                       (unsigned long)page_to_pfn(pers_entry[i]->fpage),
> +                       GNTMAP_host_map,
> +                       pers_entry[i]->map.handle);
> +               ret = gnttab_unmap_refs(&unmap, &pers_entry[i]->fpage,
> +                                       1, false);

This is not correct, you should call gnttab_set_unmap_op on a batch of
grants (up to BLKIF_MAX_SEGMENTS_PER_REQUEST), and then call
gnttab_unmap_refs on all of them. Here is a simple example (take a look
at blkback.c function xen_blkif_schedule to see an example with a
red-black tree, I think this part of the code should also be made common):

for (i = 0, segs_to_unmap = 0; i < count; i++) {
	gnttab_set_unmap_op(&unmap[segs_to_unmap],
		(unsigned long)page_to_pfn(pers_entry[i]->fpage),
		GNTMAP_host_map,
		pers_entry[i]->map.handle);
	pages[segs_to_unmap] =
		(unsigned long)page_to_pfn(pers_entry[i]->fpage);
	if (++segs_to_unmap == BLKIF_MAX_SEGMENTS_PER_REQUEST ||
		(i + 1) == count) {
		ret = gnttab_unmap_refs(unmap, NULL, pages,
			segs_to_unmap);
		BUG_ON(ret);
		segs_to_unmap == 0;
	}
}

> +               BUG_ON(ret);
> +       }
> +}
> +
>  void xenvif_disconnect(struct xenvif *vif)
>  {
>         struct net_device *dev = vif->dev;
> @@ -366,6 +385,9 @@ void xenvif_disconnect(struct xenvif *vif)
>         unregister_netdev(vif->dev);
> 
>         xen_netbk_unmap_frontend_rings(vif);
> +       if (vif->persistent_grant)
> +               xenvif_free_grants(vif->persistent_gnt,
> +                                  vif->persistent_gntcnt);
> 
>         free_netdev(vif->dev);
>  }
> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
> index 2596401..a26d3fc 100644
> --- a/drivers/net/xen-netback/netback.c
> +++ b/drivers/net/xen-netback/netback.c
> @@ -80,6 +80,8 @@ union page_ext {
>         void *mapping;
>  };
> 
> +struct xenvif;
> +
>  struct xen_netbk {
>         wait_queue_head_t wq;
>         struct task_struct *task;
> @@ -102,6 +104,7 @@ struct xen_netbk {
> 
>         struct pending_tx_info pending_tx_info[MAX_PENDING_REQS];
>         struct gnttab_copy tx_copy_ops[MAX_PENDING_REQS];
> +       struct xenvif *gnttab_tx_vif[MAX_PENDING_REQS];
> 
>         u16 pending_ring[MAX_PENDING_REQS];
> 
> @@ -111,12 +114,139 @@ struct xen_netbk {
>          * straddles two buffers in the frontend.
>          */
>         struct gnttab_copy grant_copy_op[2*XEN_NETIF_RX_RING_SIZE];
> +       struct xenvif *gnttab_rx_vif[2*XEN_NETIF_RX_RING_SIZE];
>         struct netbk_rx_meta meta[2*XEN_NETIF_RX_RING_SIZE];
>  };
> 
>  static struct xen_netbk *xen_netbk;
>  static int xen_netbk_group_nr;
> 
> +static struct persistent_entry*
> +get_per_gnt(struct persistent_entry **pers_entry,
> +           unsigned int count, grant_ref_t gref)
> +{
> +       int i;
> +
> +       for (i = 0; i < count; i++)
> +               if (gref == pers_entry[i]->forgranted)
> +                       return pers_entry[i];
> +
> +       return NULL;
> +}

This should be replaced with common code shared with all persistent
backends implementations.

> +
> +static void*
> +map_new_gnt(struct persistent_entry **pers_entry, unsigned int count,
> +           grant_ref_t ref, domid_t domid)
> +{
> +       struct gnttab_map_grant_ref *map;
> +       struct page *page;
> +       unsigned long vaddr;
> +       unsigned long pfn;
> +       uint32_t flags;
> +       int ret = 0;
> +
> +       pers_entry[count] = (struct persistent_entry *)
> +                           kmalloc(sizeof(struct persistent_entry),
> +                                   GFP_KERNEL);
> +       if (!pers_entry[count])
> +               return ERR_PTR(-ENOMEM);
> +
> +       map = &pers_entry[count]->map;
> +       page = alloc_page(GFP_KERNEL);
> +       if (!page) {
> +               kfree(pers_entry[count]);
> +               pers_entry[count] = NULL;
> +               return ERR_PTR(-ENOMEM);
> +       }
> +
> +       pers_entry[count]->fpage = page;
> +       pfn = page_to_pfn(page);
> +       vaddr = (unsigned long)pfn_to_kaddr(pfn);
> +       flags = GNTMAP_host_map;
> +
> +       gnttab_set_map_op(map, vaddr, flags, ref, domid);
> +       ret = gnttab_map_refs(map, NULL, &page, 1);
> +       BUG_ON(ret);

This is highly inefficient, one of the points of using gnttab_set_map_op
is that you can queue a bunch of grants, and then map them at the same
time using gnttab_map_refs, but here you are using it to map a single
grant at a time. You should instead see how much grants you need to map
to complete the request and map them all at the same time.

> +
> +       pers_entry[count]->forgranted = ref;
> +
> +       return page_address(page);
> +}
> +
> +static void*
> +get_ref_page(struct persistent_entry **pers_entry, unsigned int *count,
> +            grant_ref_t ref, domid_t domid, unsigned int total)
> +{
> +       struct persistent_entry *per_gnt;
> +       void *vaddr;
> +
> +       per_gnt = get_per_gnt(pers_entry, *count, ref);
> +
> +       if (per_gnt != NULL)
> +               return page_address(per_gnt->fpage);
> +       else {
> +               BUG_ON(*count >= total);
> +               vaddr = map_new_gnt(pers_entry, *count, ref, domid);
> +               if (IS_ERR_OR_NULL(vaddr))
> +                       return vaddr;
> +               *count += 1;
> +               return vaddr;
> +       }
> +}
> +
> +static int
> +grant_memory_copy_op(unsigned int cmd, void *vuop, unsigned int count,
> +                    struct xen_netbk *netbk, bool tx_pool)
> +{
> +       int i;
> +       struct xenvif *vif;
> +       struct gnttab_copy *uop = vuop;
> +       unsigned int *gnt_count;
> +       unsigned int gnt_total;
> +       struct persistent_entry **pers_entry;
> +       int ret = 0;
> +
> +       BUG_ON(cmd != GNTTABOP_copy);
> +       for (i = 0; i < count; i++) {
> +               if (tx_pool)
> +                       vif = netbk->gnttab_tx_vif[i];
> +               else
> +                       vif = netbk->gnttab_rx_vif[i];
> +
> +               pers_entry = vif->persistent_gnt;
> +               gnt_count = &vif->persistent_gntcnt;
> +               gnt_total = MAXIMUM_OUTSTANDING_BLOCK_REQS;
> +
> +               if (vif->persistent_grant) {
> +                       void *saddr, *daddr;
> +
> +                       saddr = uop[i].source.domid == DOMID_SELF ?
> +                               (void *) uop[i].source.u.gmfn :
> +                               get_ref_page(pers_entry, gnt_count,
> +                                            uop[i].source.u.ref,
> +                                            uop[i].source.domid,
> +                                            gnt_total);
> +                       if (IS_ERR_OR_NULL(saddr))
> +                               return -ENOMEM;
> +
> +                       daddr = uop[i].dest.domid == DOMID_SELF ?
> +                               (void *) uop[i].dest.u.gmfn :
> +                               get_ref_page(pers_entry, gnt_count,
> +                                            uop[i].dest.u.ref,
> +                                            uop[i].dest.domid,
> +                                            gnt_total);
> +                       if (IS_ERR_OR_NULL(daddr))
> +                               return -ENOMEM;
> +
> +                       memcpy(daddr+uop[i].dest.offset,
> +                              saddr+uop[i].source.offset, uop[i].len);
> +               } else
> +                       ret = HYPERVISOR_grant_table_op(cmd, &uop[i], 1);
> +       }
> +
> +       return ret;
> +}
> +
>  void xen_netbk_add_xenvif(struct xenvif *vif)
>  {
>         int i;
> @@ -387,13 +517,15 @@ static struct netbk_rx_meta *get_next_rx_buffer(struct xenvif *vif,
>   * Set up the grant operations for this fragment. If it's a flipping
>   * interface, we also set up the unmap request from here.
>   */
> -static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
> -                               struct netrx_pending_operations *npo,
> -                               struct page *page, unsigned long size,
> -                               unsigned long offset, int *head)
> +static int netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
> +                              struct netrx_pending_operations *npo,
> +                              struct page *page, unsigned long size,
> +                              unsigned long offset, int *head,
> +                              struct xenvif **grxvif)
>  {
>         struct gnttab_copy *copy_gop;
>         struct netbk_rx_meta *meta;
> +       int count = 0;
>         /*
>          * These variables are used iff get_page_ext returns true,
>          * in which case they are guaranteed to be initialized.
> @@ -425,6 +557,10 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
>                         bytes = MAX_BUFFER_OFFSET - npo->copy_off;
> 
>                 copy_gop = npo->copy + npo->copy_prod++;
> +               *grxvif = vif;
> +               grxvif++;
> +               count++;
> +
>                 copy_gop->flags = GNTCOPY_dest_gref;
>                 if (foreign) {
>                         struct xen_netbk *netbk = &xen_netbk[group];
> @@ -438,7 +574,10 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
>                 } else {
>                         void *vaddr = page_address(page);
>                         copy_gop->source.domid = DOMID_SELF;
> -                       copy_gop->source.u.gmfn = virt_to_mfn(vaddr);
> +                       if (!vif->persistent_grant)
> +                               copy_gop->source.u.gmfn = virt_to_mfn(vaddr);
> +                       else
> +                               copy_gop->source.u.gmfn = (unsigned long)vaddr;
>                 }
>                 copy_gop->source.offset = offset;
>                 copy_gop->dest.domid = vif->domid;
> @@ -460,6 +599,7 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
>                 *head = 0; /* There must be something in this buffer now. */
> 
>         }
> +       return count;
>  }
> 
>  /*
> @@ -474,8 +614,10 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
>   * zero GSO descriptors (for non-GSO packets) or one descriptor (for
>   * frontend-side LRO).
>   */
> -static int netbk_gop_skb(struct sk_buff *skb,
> -                        struct netrx_pending_operations *npo)
> +static int netbk_gop_skb(struct xen_netbk *netbk,
> +                        struct sk_buff *skb,
> +                        struct netrx_pending_operations *npo,
> +                        struct xenvif **grxvif)
>  {
>         struct xenvif *vif = netdev_priv(skb->dev);
>         int nr_frags = skb_shinfo(skb)->nr_frags;
> @@ -518,17 +660,19 @@ static int netbk_gop_skb(struct sk_buff *skb,
>                 if (data + len > skb_tail_pointer(skb))
>                         len = skb_tail_pointer(skb) - data;
> 
> -               netbk_gop_frag_copy(vif, skb, npo,
> -                                   virt_to_page(data), len, offset, &head);
> +               grxvif += netbk_gop_frag_copy(vif, skb, npo,
> +                                             virt_to_page(data), len,
> +                                             offset, &head, grxvif);
> +
>                 data += len;
>         }
> 
>         for (i = 0; i < nr_frags; i++) {
> -               netbk_gop_frag_copy(vif, skb, npo,
> -                                   skb_frag_page(&skb_shinfo(skb)->frags[i]),
> -                                   skb_frag_size(&skb_shinfo(skb)->frags[i]),
> -                                   skb_shinfo(skb)->frags[i].page_offset,
> -                                   &head);
> +               grxvif += netbk_gop_frag_copy(vif, skb, npo,
> +                               skb_frag_page(&skb_shinfo(skb)->frags[i]),
> +                               skb_frag_size(&skb_shinfo(skb)->frags[i]),
> +                               skb_shinfo(skb)->frags[i].page_offset,
> +                               &head, grxvif);
>         }
> 
>         return npo->meta_prod - old_meta_prod;
> @@ -593,6 +737,8 @@ struct skb_cb_overlay {
>  static void xen_netbk_rx_action(struct xen_netbk *netbk)
>  {
>         struct xenvif *vif = NULL, *tmp;
> +       struct xenvif **grxvif = netbk->gnttab_rx_vif;
> +       int old_copy_prod = 0;
>         s8 status;
>         u16 irq, flags;
>         struct xen_netif_rx_response *resp;
> @@ -619,7 +765,9 @@ static void xen_netbk_rx_action(struct xen_netbk *netbk)
>                 nr_frags = skb_shinfo(skb)->nr_frags;
> 
>                 sco = (struct skb_cb_overlay *)skb->cb;
> -               sco->meta_slots_used = netbk_gop_skb(skb, &npo);
> +               sco->meta_slots_used = netbk_gop_skb(netbk, skb, &npo, grxvif);
> +               grxvif += npo.copy_prod - old_copy_prod;
> +               old_copy_prod = npo.copy_prod;
> 
>                 count += nr_frags + 1;
> 
> @@ -636,8 +784,10 @@ static void xen_netbk_rx_action(struct xen_netbk *netbk)
>                 return;
> 
>         BUG_ON(npo.copy_prod > ARRAY_SIZE(netbk->grant_copy_op));
> -       ret = HYPERVISOR_grant_table_op(GNTTABOP_copy, &netbk->grant_copy_op,
> -                                       npo.copy_prod);
> +       ret = grant_memory_copy_op(GNTTABOP_copy,
> +                                  &netbk->grant_copy_op,
> +                                  npo.copy_prod, netbk,
> +                                  false);
>         BUG_ON(ret != 0);
> 
>         while ((skb = __skb_dequeue(&rxq)) != NULL) {
> @@ -918,7 +1068,8 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk,
>                                                   struct xenvif *vif,
>                                                   struct sk_buff *skb,
>                                                   struct xen_netif_tx_request *txp,
> -                                                 struct gnttab_copy *gop)
> +                                                 struct gnttab_copy *gop,
> +                                                 struct xenvif **gtxvif)
>  {
>         struct skb_shared_info *shinfo = skb_shinfo(skb);
>         skb_frag_t *frags = shinfo->frags;
> @@ -944,7 +1095,11 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk,
>                 gop->source.domid = vif->domid;
>                 gop->source.offset = txp->offset;
> 
> -               gop->dest.u.gmfn = virt_to_mfn(page_address(page));
> +               if (!vif->persistent_grant)
> +                       gop->dest.u.gmfn = virt_to_mfn(page_address(page));
> +               else
> +                       gop->dest.u.gmfn = (unsigned long)page_address(page);
> +
>                 gop->dest.domid = DOMID_SELF;
>                 gop->dest.offset = txp->offset;
> 
> @@ -952,6 +1107,9 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk,
>                 gop->flags = GNTCOPY_source_gref;
> 
>                 gop++;
> +               *gtxvif = vif;
> +               gtxvif++;
> +
> 
>                 memcpy(&pending_tx_info[pending_idx].req, txp, sizeof(*txp));
>                 xenvif_get(vif);
> @@ -1218,6 +1376,7 @@ static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
>  static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
>  {
>         struct gnttab_copy *gop = netbk->tx_copy_ops, *request_gop;
> +       struct xenvif **gtxvif = netbk->gnttab_tx_vif;
>         struct sk_buff *skb;
>         int ret;
> 
> @@ -1338,7 +1497,11 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
>                 gop->source.domid = vif->domid;
>                 gop->source.offset = txreq.offset;
> 
> -               gop->dest.u.gmfn = virt_to_mfn(page_address(page));
> +               if (!vif->persistent_grant)
> +                       gop->dest.u.gmfn = virt_to_mfn(page_address(page));
> +               else
> +                       gop->dest.u.gmfn = (unsigned long)page_address(page);
> +
>                 gop->dest.domid = DOMID_SELF;
>                 gop->dest.offset = txreq.offset;
> 
> @@ -1346,6 +1509,7 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
>                 gop->flags = GNTCOPY_source_gref;
> 
>                 gop++;
> +               *gtxvif++ = vif;
> 
>                 memcpy(&netbk->pending_tx_info[pending_idx].req,
>                        &txreq, sizeof(txreq));
> @@ -1369,12 +1533,13 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
>                 netbk->pending_cons++;
> 
>                 request_gop = xen_netbk_get_requests(netbk, vif,
> -                                                    skb, txfrags, gop);
> +                                                    skb, txfrags, gop, gtxvif);
>                 if (request_gop == NULL) {
>                         kfree_skb(skb);
>                         netbk_tx_err(vif, &txreq, idx);
>                         continue;
>                 }
> +               gtxvif += request_gop - gop;
>                 gop = request_gop;
> 
>                 vif->tx.req_cons = idx;
> @@ -1467,8 +1632,9 @@ static void xen_netbk_tx_action(struct xen_netbk *netbk)
> 
>         if (nr_gops == 0)
>                 return;
> -       ret = HYPERVISOR_grant_table_op(GNTTABOP_copy,
> -                                       netbk->tx_copy_ops, nr_gops);
> +       ret = grant_memory_copy_op(GNTTABOP_copy,
> +                                  netbk->tx_copy_ops, nr_gops,
> +                                  netbk, true);
>         BUG_ON(ret);
> 
>         xen_netbk_tx_submit(netbk);
> diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
> index 410018c..938e908 100644
> --- a/drivers/net/xen-netback/xenbus.c
> +++ b/drivers/net/xen-netback/xenbus.c
> @@ -114,6 +114,13 @@ static int netback_probe(struct xenbus_device *dev,
>                         goto abort_transaction;
>                 }
> 
> +               err = xenbus_printf(xbt, dev->nodename,
> +                                   "feature-persistent-grants", "%u", 1);
> +               if (err) {
> +                       message = "writing feature-persistent-grants";
> +                       goto abort_transaction;
> +               }
> +
>                 err = xenbus_transaction_end(xbt, 0);
>         } while (err == -EAGAIN);
> 
> @@ -453,7 +460,12 @@ static int connect_rings(struct backend_info *be)
>                 val = 0;
>         vif->csum = !val;
> 
> -       /* Map the shared frame, irq etc. */
> +       if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-persistent-grants",
> +                        "%u", &val) < 0)

In block devices "feature-persistent" is used, so I think that for
clearness it should be announced the same way in net.

> +               val = 0;
> +       vif->persistent_grant = !!val;
> +
> +/* Map the shared frame, irq etc. */
>         err = xenvif_connect(vif, tx_ring_ref, rx_ring_ref, evtchn);
>         if (err) {
>                 xenbus_dev_fatal(dev, err,
> --
> 1.7.3.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 09:57:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 09:57:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwCO-0007dr-Ix; Thu, 15 Nov 2012 09:57:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TYwCM-0007dh-GI
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 09:57:26 +0000
Received: from [85.158.143.99:34715] by server-3.bemta-4.messagelabs.com id
	59/6E-06841-58CB4A05; Thu, 15 Nov 2012 09:57:25 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352973443!26652960!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20872 invoked from network); 15 Nov 2012 09:57:24 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 09:57:24 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15822179"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 09:57:18 +0000
Received: from [192.168.1.30] (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 09:57:17 +0000
Message-ID: <50A4BC7D.6060707@citrix.com>
Date: Thu, 15 Nov 2012 10:57:17 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Annie Li <annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963066-570-1-git-send-email-annie.li@oracle.com>
In-Reply-To: <1352963066-570-1-git-send-email-annie.li@oracle.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent
 grant with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 15/11/12 08:04, Annie Li wrote:
> This patch implements persistent grant in netback driver. Tx and rx
> share the same page pool, this pool will be split into two parts
> in next patch.
> 
> Signed-off-by: Annie Li <annie.li@oracle.com>
> ---
>  drivers/net/xen-netback/common.h    |   18 +++-
>  drivers/net/xen-netback/interface.c |   22 ++++
>  drivers/net/xen-netback/netback.c   |  212 +++++++++++++++++++++++++++++++----
>  drivers/net/xen-netback/xenbus.c    |   14 ++-
>  4 files changed, 239 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
> index 94b79c3..a85cac6 100644
> --- a/drivers/net/xen-netback/common.h
> +++ b/drivers/net/xen-netback/common.h
> @@ -45,8 +45,19 @@
>  #include <xen/grant_table.h>
>  #include <xen/xenbus.h>
> 
> +#define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE)
> +#define XEN_NETIF_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE)
> +#define MAXIMUM_OUTSTANDING_BLOCK_REQS \
> +                       (XEN_NETIF_TX_RING_SIZE + XEN_NETIF_RX_RING_SIZE)
> +
>  struct xen_netbk;
> 
> +struct persistent_entry {
> +       grant_ref_t forgranted;
> +       struct page *fpage;
> +       struct gnttab_map_grant_ref map;
> +};

This should be common with the blkback implementation, I think we should
move some structures/functions from blkback to a common place. When I
implementated some functions in blkback I though they could be reused by
other backends that wanted to use persistent grants, so I keep them free
of blkback specific structures.

>  struct xenvif {
>         /* Unique identifier for this interface. */
>         domid_t          domid;
> @@ -75,6 +86,7 @@ struct xenvif {
> 
>         /* Internal feature information. */
>         u8 can_queue:1;     /* can queue packets for receiver? */
> +       u8 persistent_grant:1;
> 
>         /*
>          * Allow xenvif_start_xmit() to peek ahead in the rx request
> @@ -98,6 +110,9 @@ struct xenvif {
>         struct net_device *dev;
> 
>         wait_queue_head_t waiting_to_free;
> +
> +       struct persistent_entry *persistent_gnt[MAXIMUM_OUTSTANDING_BLOCK_REQS];
> +       unsigned int persistent_gntcnt;

This should be a red-black tree, which has the property of a search time
<= O(log n), using an array is more expensive in terms of memory and has
a worse search time O(n), this is specially interesting for netback,
which can have twice as much persistent grants as blkback (because two
rings are used).

Take a look at the following functions from blkback; foreach_grant,
add_persistent_gnt and get_persistent_gnt. They are generic functions to
deal with persistent grants.

>  };
> 
>  static inline struct xenbus_device *xenvif_to_xenbus_device(struct xenvif *vif)
> @@ -105,9 +120,6 @@ static inline struct xenbus_device *xenvif_to_xenbus_device(struct xenvif *vif)
>         return to_xenbus_device(vif->dev->dev.parent);
>  }
> 
> -#define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE)
> -#define XEN_NETIF_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE)
> -
>  struct xenvif *xenvif_alloc(struct device *parent,
>                             domid_t domid,
>                             unsigned int handle);
> diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
> index b7d41f8..226d159 100644
> --- a/drivers/net/xen-netback/interface.c
> +++ b/drivers/net/xen-netback/interface.c
> @@ -300,6 +300,8 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
>                 return ERR_PTR(err);
>         }
> 
> +       vif->persistent_gntcnt = 0;
> +
>         netdev_dbg(dev, "Successfully created xenvif\n");
>         return vif;
>  }
> @@ -343,6 +345,23 @@ err:
>         return err;
>  }
> 
> +void xenvif_free_grants(struct persistent_entry **pers_entry,
> +                       unsigned int count)
> +{
> +       int i, ret;
> +       struct gnttab_unmap_grant_ref unmap;
> +
> +       for (i = 0; i < count; i++) {
> +               gnttab_set_unmap_op(&unmap,
> +                       (unsigned long)page_to_pfn(pers_entry[i]->fpage),
> +                       GNTMAP_host_map,
> +                       pers_entry[i]->map.handle);
> +               ret = gnttab_unmap_refs(&unmap, &pers_entry[i]->fpage,
> +                                       1, false);

This is not correct, you should call gnttab_set_unmap_op on a batch of
grants (up to BLKIF_MAX_SEGMENTS_PER_REQUEST), and then call
gnttab_unmap_refs on all of them. Here is a simple example (take a look
at blkback.c function xen_blkif_schedule to see an example with a
red-black tree, I think this part of the code should also be made common):

for (i = 0, segs_to_unmap = 0; i < count; i++) {
	gnttab_set_unmap_op(&unmap[segs_to_unmap],
		(unsigned long)page_to_pfn(pers_entry[i]->fpage),
		GNTMAP_host_map,
		pers_entry[i]->map.handle);
	pages[segs_to_unmap] =
		(unsigned long)page_to_pfn(pers_entry[i]->fpage);
	if (++segs_to_unmap == BLKIF_MAX_SEGMENTS_PER_REQUEST ||
		(i + 1) == count) {
		ret = gnttab_unmap_refs(unmap, NULL, pages,
			segs_to_unmap);
		BUG_ON(ret);
		segs_to_unmap == 0;
	}
}

> +               BUG_ON(ret);
> +       }
> +}
> +
>  void xenvif_disconnect(struct xenvif *vif)
>  {
>         struct net_device *dev = vif->dev;
> @@ -366,6 +385,9 @@ void xenvif_disconnect(struct xenvif *vif)
>         unregister_netdev(vif->dev);
> 
>         xen_netbk_unmap_frontend_rings(vif);
> +       if (vif->persistent_grant)
> +               xenvif_free_grants(vif->persistent_gnt,
> +                                  vif->persistent_gntcnt);
> 
>         free_netdev(vif->dev);
>  }
> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
> index 2596401..a26d3fc 100644
> --- a/drivers/net/xen-netback/netback.c
> +++ b/drivers/net/xen-netback/netback.c
> @@ -80,6 +80,8 @@ union page_ext {
>         void *mapping;
>  };
> 
> +struct xenvif;
> +
>  struct xen_netbk {
>         wait_queue_head_t wq;
>         struct task_struct *task;
> @@ -102,6 +104,7 @@ struct xen_netbk {
> 
>         struct pending_tx_info pending_tx_info[MAX_PENDING_REQS];
>         struct gnttab_copy tx_copy_ops[MAX_PENDING_REQS];
> +       struct xenvif *gnttab_tx_vif[MAX_PENDING_REQS];
> 
>         u16 pending_ring[MAX_PENDING_REQS];
> 
> @@ -111,12 +114,139 @@ struct xen_netbk {
>          * straddles two buffers in the frontend.
>          */
>         struct gnttab_copy grant_copy_op[2*XEN_NETIF_RX_RING_SIZE];
> +       struct xenvif *gnttab_rx_vif[2*XEN_NETIF_RX_RING_SIZE];
>         struct netbk_rx_meta meta[2*XEN_NETIF_RX_RING_SIZE];
>  };
> 
>  static struct xen_netbk *xen_netbk;
>  static int xen_netbk_group_nr;
> 
> +static struct persistent_entry*
> +get_per_gnt(struct persistent_entry **pers_entry,
> +           unsigned int count, grant_ref_t gref)
> +{
> +       int i;
> +
> +       for (i = 0; i < count; i++)
> +               if (gref == pers_entry[i]->forgranted)
> +                       return pers_entry[i];
> +
> +       return NULL;
> +}

This should be replaced with common code shared with all persistent
backends implementations.

> +
> +static void*
> +map_new_gnt(struct persistent_entry **pers_entry, unsigned int count,
> +           grant_ref_t ref, domid_t domid)
> +{
> +       struct gnttab_map_grant_ref *map;
> +       struct page *page;
> +       unsigned long vaddr;
> +       unsigned long pfn;
> +       uint32_t flags;
> +       int ret = 0;
> +
> +       pers_entry[count] = (struct persistent_entry *)
> +                           kmalloc(sizeof(struct persistent_entry),
> +                                   GFP_KERNEL);
> +       if (!pers_entry[count])
> +               return ERR_PTR(-ENOMEM);
> +
> +       map = &pers_entry[count]->map;
> +       page = alloc_page(GFP_KERNEL);
> +       if (!page) {
> +               kfree(pers_entry[count]);
> +               pers_entry[count] = NULL;
> +               return ERR_PTR(-ENOMEM);
> +       }
> +
> +       pers_entry[count]->fpage = page;
> +       pfn = page_to_pfn(page);
> +       vaddr = (unsigned long)pfn_to_kaddr(pfn);
> +       flags = GNTMAP_host_map;
> +
> +       gnttab_set_map_op(map, vaddr, flags, ref, domid);
> +       ret = gnttab_map_refs(map, NULL, &page, 1);
> +       BUG_ON(ret);

This is highly inefficient, one of the points of using gnttab_set_map_op
is that you can queue a bunch of grants, and then map them at the same
time using gnttab_map_refs, but here you are using it to map a single
grant at a time. You should instead see how much grants you need to map
to complete the request and map them all at the same time.

> +
> +       pers_entry[count]->forgranted = ref;
> +
> +       return page_address(page);
> +}
> +
> +static void*
> +get_ref_page(struct persistent_entry **pers_entry, unsigned int *count,
> +            grant_ref_t ref, domid_t domid, unsigned int total)
> +{
> +       struct persistent_entry *per_gnt;
> +       void *vaddr;
> +
> +       per_gnt = get_per_gnt(pers_entry, *count, ref);
> +
> +       if (per_gnt != NULL)
> +               return page_address(per_gnt->fpage);
> +       else {
> +               BUG_ON(*count >= total);
> +               vaddr = map_new_gnt(pers_entry, *count, ref, domid);
> +               if (IS_ERR_OR_NULL(vaddr))
> +                       return vaddr;
> +               *count += 1;
> +               return vaddr;
> +       }
> +}
> +
> +static int
> +grant_memory_copy_op(unsigned int cmd, void *vuop, unsigned int count,
> +                    struct xen_netbk *netbk, bool tx_pool)
> +{
> +       int i;
> +       struct xenvif *vif;
> +       struct gnttab_copy *uop = vuop;
> +       unsigned int *gnt_count;
> +       unsigned int gnt_total;
> +       struct persistent_entry **pers_entry;
> +       int ret = 0;
> +
> +       BUG_ON(cmd != GNTTABOP_copy);
> +       for (i = 0; i < count; i++) {
> +               if (tx_pool)
> +                       vif = netbk->gnttab_tx_vif[i];
> +               else
> +                       vif = netbk->gnttab_rx_vif[i];
> +
> +               pers_entry = vif->persistent_gnt;
> +               gnt_count = &vif->persistent_gntcnt;
> +               gnt_total = MAXIMUM_OUTSTANDING_BLOCK_REQS;
> +
> +               if (vif->persistent_grant) {
> +                       void *saddr, *daddr;
> +
> +                       saddr = uop[i].source.domid == DOMID_SELF ?
> +                               (void *) uop[i].source.u.gmfn :
> +                               get_ref_page(pers_entry, gnt_count,
> +                                            uop[i].source.u.ref,
> +                                            uop[i].source.domid,
> +                                            gnt_total);
> +                       if (IS_ERR_OR_NULL(saddr))
> +                               return -ENOMEM;
> +
> +                       daddr = uop[i].dest.domid == DOMID_SELF ?
> +                               (void *) uop[i].dest.u.gmfn :
> +                               get_ref_page(pers_entry, gnt_count,
> +                                            uop[i].dest.u.ref,
> +                                            uop[i].dest.domid,
> +                                            gnt_total);
> +                       if (IS_ERR_OR_NULL(daddr))
> +                               return -ENOMEM;
> +
> +                       memcpy(daddr+uop[i].dest.offset,
> +                              saddr+uop[i].source.offset, uop[i].len);
> +               } else
> +                       ret = HYPERVISOR_grant_table_op(cmd, &uop[i], 1);
> +       }
> +
> +       return ret;
> +}
> +
>  void xen_netbk_add_xenvif(struct xenvif *vif)
>  {
>         int i;
> @@ -387,13 +517,15 @@ static struct netbk_rx_meta *get_next_rx_buffer(struct xenvif *vif,
>   * Set up the grant operations for this fragment. If it's a flipping
>   * interface, we also set up the unmap request from here.
>   */
> -static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
> -                               struct netrx_pending_operations *npo,
> -                               struct page *page, unsigned long size,
> -                               unsigned long offset, int *head)
> +static int netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
> +                              struct netrx_pending_operations *npo,
> +                              struct page *page, unsigned long size,
> +                              unsigned long offset, int *head,
> +                              struct xenvif **grxvif)
>  {
>         struct gnttab_copy *copy_gop;
>         struct netbk_rx_meta *meta;
> +       int count = 0;
>         /*
>          * These variables are used iff get_page_ext returns true,
>          * in which case they are guaranteed to be initialized.
> @@ -425,6 +557,10 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
>                         bytes = MAX_BUFFER_OFFSET - npo->copy_off;
> 
>                 copy_gop = npo->copy + npo->copy_prod++;
> +               *grxvif = vif;
> +               grxvif++;
> +               count++;
> +
>                 copy_gop->flags = GNTCOPY_dest_gref;
>                 if (foreign) {
>                         struct xen_netbk *netbk = &xen_netbk[group];
> @@ -438,7 +574,10 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
>                 } else {
>                         void *vaddr = page_address(page);
>                         copy_gop->source.domid = DOMID_SELF;
> -                       copy_gop->source.u.gmfn = virt_to_mfn(vaddr);
> +                       if (!vif->persistent_grant)
> +                               copy_gop->source.u.gmfn = virt_to_mfn(vaddr);
> +                       else
> +                               copy_gop->source.u.gmfn = (unsigned long)vaddr;
>                 }
>                 copy_gop->source.offset = offset;
>                 copy_gop->dest.domid = vif->domid;
> @@ -460,6 +599,7 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
>                 *head = 0; /* There must be something in this buffer now. */
> 
>         }
> +       return count;
>  }
> 
>  /*
> @@ -474,8 +614,10 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
>   * zero GSO descriptors (for non-GSO packets) or one descriptor (for
>   * frontend-side LRO).
>   */
> -static int netbk_gop_skb(struct sk_buff *skb,
> -                        struct netrx_pending_operations *npo)
> +static int netbk_gop_skb(struct xen_netbk *netbk,
> +                        struct sk_buff *skb,
> +                        struct netrx_pending_operations *npo,
> +                        struct xenvif **grxvif)
>  {
>         struct xenvif *vif = netdev_priv(skb->dev);
>         int nr_frags = skb_shinfo(skb)->nr_frags;
> @@ -518,17 +660,19 @@ static int netbk_gop_skb(struct sk_buff *skb,
>                 if (data + len > skb_tail_pointer(skb))
>                         len = skb_tail_pointer(skb) - data;
> 
> -               netbk_gop_frag_copy(vif, skb, npo,
> -                                   virt_to_page(data), len, offset, &head);
> +               grxvif += netbk_gop_frag_copy(vif, skb, npo,
> +                                             virt_to_page(data), len,
> +                                             offset, &head, grxvif);
> +
>                 data += len;
>         }
> 
>         for (i = 0; i < nr_frags; i++) {
> -               netbk_gop_frag_copy(vif, skb, npo,
> -                                   skb_frag_page(&skb_shinfo(skb)->frags[i]),
> -                                   skb_frag_size(&skb_shinfo(skb)->frags[i]),
> -                                   skb_shinfo(skb)->frags[i].page_offset,
> -                                   &head);
> +               grxvif += netbk_gop_frag_copy(vif, skb, npo,
> +                               skb_frag_page(&skb_shinfo(skb)->frags[i]),
> +                               skb_frag_size(&skb_shinfo(skb)->frags[i]),
> +                               skb_shinfo(skb)->frags[i].page_offset,
> +                               &head, grxvif);
>         }
> 
>         return npo->meta_prod - old_meta_prod;
> @@ -593,6 +737,8 @@ struct skb_cb_overlay {
>  static void xen_netbk_rx_action(struct xen_netbk *netbk)
>  {
>         struct xenvif *vif = NULL, *tmp;
> +       struct xenvif **grxvif = netbk->gnttab_rx_vif;
> +       int old_copy_prod = 0;
>         s8 status;
>         u16 irq, flags;
>         struct xen_netif_rx_response *resp;
> @@ -619,7 +765,9 @@ static void xen_netbk_rx_action(struct xen_netbk *netbk)
>                 nr_frags = skb_shinfo(skb)->nr_frags;
> 
>                 sco = (struct skb_cb_overlay *)skb->cb;
> -               sco->meta_slots_used = netbk_gop_skb(skb, &npo);
> +               sco->meta_slots_used = netbk_gop_skb(netbk, skb, &npo, grxvif);
> +               grxvif += npo.copy_prod - old_copy_prod;
> +               old_copy_prod = npo.copy_prod;
> 
>                 count += nr_frags + 1;
> 
> @@ -636,8 +784,10 @@ static void xen_netbk_rx_action(struct xen_netbk *netbk)
>                 return;
> 
>         BUG_ON(npo.copy_prod > ARRAY_SIZE(netbk->grant_copy_op));
> -       ret = HYPERVISOR_grant_table_op(GNTTABOP_copy, &netbk->grant_copy_op,
> -                                       npo.copy_prod);
> +       ret = grant_memory_copy_op(GNTTABOP_copy,
> +                                  &netbk->grant_copy_op,
> +                                  npo.copy_prod, netbk,
> +                                  false);
>         BUG_ON(ret != 0);
> 
>         while ((skb = __skb_dequeue(&rxq)) != NULL) {
> @@ -918,7 +1068,8 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk,
>                                                   struct xenvif *vif,
>                                                   struct sk_buff *skb,
>                                                   struct xen_netif_tx_request *txp,
> -                                                 struct gnttab_copy *gop)
> +                                                 struct gnttab_copy *gop,
> +                                                 struct xenvif **gtxvif)
>  {
>         struct skb_shared_info *shinfo = skb_shinfo(skb);
>         skb_frag_t *frags = shinfo->frags;
> @@ -944,7 +1095,11 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk,
>                 gop->source.domid = vif->domid;
>                 gop->source.offset = txp->offset;
> 
> -               gop->dest.u.gmfn = virt_to_mfn(page_address(page));
> +               if (!vif->persistent_grant)
> +                       gop->dest.u.gmfn = virt_to_mfn(page_address(page));
> +               else
> +                       gop->dest.u.gmfn = (unsigned long)page_address(page);
> +
>                 gop->dest.domid = DOMID_SELF;
>                 gop->dest.offset = txp->offset;
> 
> @@ -952,6 +1107,9 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk,
>                 gop->flags = GNTCOPY_source_gref;
> 
>                 gop++;
> +               *gtxvif = vif;
> +               gtxvif++;
> +
> 
>                 memcpy(&pending_tx_info[pending_idx].req, txp, sizeof(*txp));
>                 xenvif_get(vif);
> @@ -1218,6 +1376,7 @@ static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
>  static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
>  {
>         struct gnttab_copy *gop = netbk->tx_copy_ops, *request_gop;
> +       struct xenvif **gtxvif = netbk->gnttab_tx_vif;
>         struct sk_buff *skb;
>         int ret;
> 
> @@ -1338,7 +1497,11 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
>                 gop->source.domid = vif->domid;
>                 gop->source.offset = txreq.offset;
> 
> -               gop->dest.u.gmfn = virt_to_mfn(page_address(page));
> +               if (!vif->persistent_grant)
> +                       gop->dest.u.gmfn = virt_to_mfn(page_address(page));
> +               else
> +                       gop->dest.u.gmfn = (unsigned long)page_address(page);
> +
>                 gop->dest.domid = DOMID_SELF;
>                 gop->dest.offset = txreq.offset;
> 
> @@ -1346,6 +1509,7 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
>                 gop->flags = GNTCOPY_source_gref;
> 
>                 gop++;
> +               *gtxvif++ = vif;
> 
>                 memcpy(&netbk->pending_tx_info[pending_idx].req,
>                        &txreq, sizeof(txreq));
> @@ -1369,12 +1533,13 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
>                 netbk->pending_cons++;
> 
>                 request_gop = xen_netbk_get_requests(netbk, vif,
> -                                                    skb, txfrags, gop);
> +                                                    skb, txfrags, gop, gtxvif);
>                 if (request_gop == NULL) {
>                         kfree_skb(skb);
>                         netbk_tx_err(vif, &txreq, idx);
>                         continue;
>                 }
> +               gtxvif += request_gop - gop;
>                 gop = request_gop;
> 
>                 vif->tx.req_cons = idx;
> @@ -1467,8 +1632,9 @@ static void xen_netbk_tx_action(struct xen_netbk *netbk)
> 
>         if (nr_gops == 0)
>                 return;
> -       ret = HYPERVISOR_grant_table_op(GNTTABOP_copy,
> -                                       netbk->tx_copy_ops, nr_gops);
> +       ret = grant_memory_copy_op(GNTTABOP_copy,
> +                                  netbk->tx_copy_ops, nr_gops,
> +                                  netbk, true);
>         BUG_ON(ret);
> 
>         xen_netbk_tx_submit(netbk);
> diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
> index 410018c..938e908 100644
> --- a/drivers/net/xen-netback/xenbus.c
> +++ b/drivers/net/xen-netback/xenbus.c
> @@ -114,6 +114,13 @@ static int netback_probe(struct xenbus_device *dev,
>                         goto abort_transaction;
>                 }
> 
> +               err = xenbus_printf(xbt, dev->nodename,
> +                                   "feature-persistent-grants", "%u", 1);
> +               if (err) {
> +                       message = "writing feature-persistent-grants";
> +                       goto abort_transaction;
> +               }
> +
>                 err = xenbus_transaction_end(xbt, 0);
>         } while (err == -EAGAIN);
> 
> @@ -453,7 +460,12 @@ static int connect_rings(struct backend_info *be)
>                 val = 0;
>         vif->csum = !val;
> 
> -       /* Map the shared frame, irq etc. */
> +       if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-persistent-grants",
> +                        "%u", &val) < 0)

In block devices "feature-persistent" is used, so I think that for
clearness it should be announced the same way in net.

> +               val = 0;
> +       vif->persistent_grant = !!val;
> +
> +/* Map the shared frame, irq etc. */
>         err = xenvif_connect(vif, tx_ring_ref, rx_ring_ref, evtchn);
>         if (err) {
>                 xenbus_dev_fatal(dev, err,
> --
> 1.7.3.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:02:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:02:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwHU-00083C-Kn; Thu, 15 Nov 2012 10:02:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYwHT-000835-L5
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:02:43 +0000
Received: from [85.158.138.51:36102] by server-4.bemta-3.messagelabs.com id
	B9/60-30023-2CDB4A05; Thu, 15 Nov 2012 10:02:42 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1352973756!30107011!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9822 invoked from network); 15 Nov 2012 10:02:36 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:02:36 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15822368"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:02:36 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:02:35 +0000
Message-ID: <1352973753.3499.81.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 15 Nov 2012 10:02:33 +0000
In-Reply-To: <1352821336-25837-6-git-send-email-stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-6-git-send-email-stefano.stabellini@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 6/7] xen/arm: flush D-cache and I-cache when
	appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> - invalidate tlb after setting WXN;
> - flush D-cache and I-cache after relocation;
> - flush D-cache after writing to smp_up_cpu;
> - flush TLB before changing HTTBR;
> - flush I-cache after changing HTTBR;
> - flush I-cache and branch predictor after writing Xen text ptes.

Since the reasoning is pretty subtle I wonder if you could say a few
words in each case about why these flushes are necessary? Either here on
in the comments in the code.

> @@ -244,10 +245,17 @@ void __init setup_pagetables(unsigned long
> boot_phys_offset, paddr_t xen_paddr)
>  
>      /* Change pagetables to the copy in the relocated Xen */
>      boot_httbr = (unsigned long) xen_pgtable + phys_offset;
> +    flush_xen_dcache_va(&boot_httbr);
> +    flush_xen_dcache_va_range((void*)dest_va, _end - _start);
> +    isb();
> +    flush_xen_text_tlb();
> +
>      asm volatile (
>          STORE_CP64(0, HTTBR)          /* Change translation base */
>          "dsb;"                        /* Ensure visibility of HTTBR
> update */
> +        "isb;"
>          STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
> +        STORE_CP32(0, ICIALLU)        /* Flush I-cache */
>          STORE_CP32(0, BPIALL)         /* Flush branch predictor */

This now looks exactly like flush_xen_text_tlb() -- shall we call it
instead of open coding?

>          "dsb;"                        /* Ensure completion of TLB+BP
> flush */
>          "isb;"
> @@ -256,6 +264,7 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
>      /* Undo the temporary map */
>      pte.bits = 0;
>      write_pte(xen_second + second_table_offset(dest_va), pte);
> +    isb();
>      flush_xen_text_tlb();

Do any calls to flush_xen_text_tlb() not require a preceding isb? I'd
have thought that by its nature an isb would be required every time --
in which case it may as well go in the macro.
 
>      /* Link in the fixmap pagetable */
> @@ -291,11 +300,14 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
>                             >> PAGE_SHIFT);
>      pte.pt.table = 1;
>      write_pte(xen_second + second_linear_offset(XEN_VIRT_START), pte);
> -    /* Have changed a mapping used for .text. Flush everything for safety. */
> -    flush_xen_text_tlb();
> +    /* ISB is needed because we changed the text mappings */
> +    isb();

Why is the text TLB flush is not also required in this case?

>      /* From now on, no mapping may be both writable and executable. */
>      WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
> +    isb();
> +    /* Flush everything after setting WXN bit. */
> +    flush_xen_text_tlb();
>  }
>  
>  /* MMU setup for secondary CPUS (which already have paging enabled) */
> @@ -303,6 +315,8 @@ void __cpuinit mmu_init_secondary_cpu(void)
>  {
>      /* From now on, no mapping may be both writable and executable. */
>      WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
> +    isb();
> +    flush_xen_text_tlb();
>  }
>  
>  /* Create Xen's mappings of memory.

> diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
> index 9511c45..1b1d556 100644
> --- a/xen/include/asm-arm/page.h
> +++ b/xen/include/asm-arm/page.h
> @@ -228,27 +228,72 @@ static inline lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr)
>      return e;
>  }
>  
> -/* Write a pagetable entry */
> +/* Write a pagetable entry.
> + *
> + * If the table entry is changing a text mapping, it is responsibility
> + * of the caller to issue an ISB after write_pte.
> + */
>  static inline void write_pte(lpae_t *p, lpae_t pte)
>  {
>      asm volatile (
> +        /* Ensure any writes have completed with the old mappings. */
> +        "dsb;"
>          /* Safely write the entry (STRD is atomic on CPUs that support LPAE) */
>          "strd %0, %H0, [%1];"
> +        "dsb;"
>          /* Push this cacheline to the PoC so the rest of the system sees it. */
>          STORE_CP32(1, DCCMVAC)
> +        /* Ensure that the data flush is completed before proceeding */
> +        "dsb;"
>          : : "r" (pte.bits), "r" (p) : "memory");
>  }
>  
> +
> +#define MIN_CACHELINE_BYTES 32
> +extern int cacheline_bytes;
> +
> +/* Function for flushing medium-sized areas.
> + * if 'range' is large enough we might want to use model-specific
> + * full-cache flushes. */
> +static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
> +{
> +    void *end;
> +    dsb();           /* So the CPU issues all writes to the range */ 
> +    for ( end = p + size; p < end; p += cacheline_bytes )

Tim asked if this memory read of the cached cacheline_bytes might not be
more expensive than hitting the (on-core) cp register every time, which
I also suspect will be the case. Looking at Linux it seems to reread the
register each time in v7_flush_dcache_all which suggests that reading
the register is faster or at least preferable.

> +        WRITE_CP32((uint32_t) p, DCCMVAC);
> +    dsb();           /* So we know the flushes happen before continuing */
> +}
> +
> +
> +/* Macro for flushing a single small item.  The predicate is always 
> + * compile-time constant so this will compile down to 3 instructions in
> + * the common case.  Make sure to call it with the correct type of
> + * pointer! */

Do we need to worry about pointers to things which cross a cacheline
boundary? i.e. a 4 byte thing at offset 30 in a 32-byte cache line.

Or do ARMs C alignment rules ensure this can never happen? (I suspect
the answer is yes).

> +#define flush_xen_dcache_va(p) do {                       \
> +    typeof(p) _p = (p);                                   \
> +    if ( (sizeof *_p) > MIN_CACHELINE_BYTES )             \
> +        flush_xen_dcache_va_range(_p, sizeof *_p);        \
> +    else                                                  \
> +        asm volatile (                                    \
> +            "dsb;"   /* Finish all earlier writes */      \
> +            STORE_CP32(0, DCCMVAC)                        \
> +            "dsb;"   /* Finish flush before continuing */ \
> +            : : "r" (_p), "m" (*_p));                     \
> +} while (0)
> +
> +
>  /*
>   * Flush all hypervisor mappings from the TLB and branch predictor.
> - * This is needed after changing Xen code mappings. 
> + * This is needed after changing Xen code mappings.
> + *
> + * The caller needs to issue the necessary barriers before this functions.

Worth commenting on what those are and when they are needed?

>   */
>  static inline void flush_xen_text_tlb(void)
>  {
>      register unsigned long r0 asm ("r0");
>      asm volatile (
> -        "dsb;"                        /* Ensure visibility of PTE writes */
>          STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
> +        STORE_CP32(0, ICIALLU)        /* Flush I-cache */
>          STORE_CP32(0, BPIALL)         /* Flush branch predictor */
>          "dsb;"                        /* Ensure completion of TLB+BP flush */
>          "isb;"



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:02:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:02:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwHU-00083C-Kn; Thu, 15 Nov 2012 10:02:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYwHT-000835-L5
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:02:43 +0000
Received: from [85.158.138.51:36102] by server-4.bemta-3.messagelabs.com id
	B9/60-30023-2CDB4A05; Thu, 15 Nov 2012 10:02:42 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1352973756!30107011!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9822 invoked from network); 15 Nov 2012 10:02:36 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:02:36 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15822368"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:02:36 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:02:35 +0000
Message-ID: <1352973753.3499.81.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 15 Nov 2012 10:02:33 +0000
In-Reply-To: <1352821336-25837-6-git-send-email-stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-6-git-send-email-stefano.stabellini@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 6/7] xen/arm: flush D-cache and I-cache when
	appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> - invalidate tlb after setting WXN;
> - flush D-cache and I-cache after relocation;
> - flush D-cache after writing to smp_up_cpu;
> - flush TLB before changing HTTBR;
> - flush I-cache after changing HTTBR;
> - flush I-cache and branch predictor after writing Xen text ptes.

Since the reasoning is pretty subtle I wonder if you could say a few
words in each case about why these flushes are necessary? Either here on
in the comments in the code.

> @@ -244,10 +245,17 @@ void __init setup_pagetables(unsigned long
> boot_phys_offset, paddr_t xen_paddr)
>  
>      /* Change pagetables to the copy in the relocated Xen */
>      boot_httbr = (unsigned long) xen_pgtable + phys_offset;
> +    flush_xen_dcache_va(&boot_httbr);
> +    flush_xen_dcache_va_range((void*)dest_va, _end - _start);
> +    isb();
> +    flush_xen_text_tlb();
> +
>      asm volatile (
>          STORE_CP64(0, HTTBR)          /* Change translation base */
>          "dsb;"                        /* Ensure visibility of HTTBR
> update */
> +        "isb;"
>          STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
> +        STORE_CP32(0, ICIALLU)        /* Flush I-cache */
>          STORE_CP32(0, BPIALL)         /* Flush branch predictor */

This now looks exactly like flush_xen_text_tlb() -- shall we call it
instead of open coding?

>          "dsb;"                        /* Ensure completion of TLB+BP
> flush */
>          "isb;"
> @@ -256,6 +264,7 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
>      /* Undo the temporary map */
>      pte.bits = 0;
>      write_pte(xen_second + second_table_offset(dest_va), pte);
> +    isb();
>      flush_xen_text_tlb();

Do any calls to flush_xen_text_tlb() not require a preceding isb? I'd
have thought that by its nature an isb would be required every time --
in which case it may as well go in the macro.
 
>      /* Link in the fixmap pagetable */
> @@ -291,11 +300,14 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
>                             >> PAGE_SHIFT);
>      pte.pt.table = 1;
>      write_pte(xen_second + second_linear_offset(XEN_VIRT_START), pte);
> -    /* Have changed a mapping used for .text. Flush everything for safety. */
> -    flush_xen_text_tlb();
> +    /* ISB is needed because we changed the text mappings */
> +    isb();

Why is the text TLB flush is not also required in this case?

>      /* From now on, no mapping may be both writable and executable. */
>      WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
> +    isb();
> +    /* Flush everything after setting WXN bit. */
> +    flush_xen_text_tlb();
>  }
>  
>  /* MMU setup for secondary CPUS (which already have paging enabled) */
> @@ -303,6 +315,8 @@ void __cpuinit mmu_init_secondary_cpu(void)
>  {
>      /* From now on, no mapping may be both writable and executable. */
>      WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
> +    isb();
> +    flush_xen_text_tlb();
>  }
>  
>  /* Create Xen's mappings of memory.

> diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
> index 9511c45..1b1d556 100644
> --- a/xen/include/asm-arm/page.h
> +++ b/xen/include/asm-arm/page.h
> @@ -228,27 +228,72 @@ static inline lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr)
>      return e;
>  }
>  
> -/* Write a pagetable entry */
> +/* Write a pagetable entry.
> + *
> + * If the table entry is changing a text mapping, it is responsibility
> + * of the caller to issue an ISB after write_pte.
> + */
>  static inline void write_pte(lpae_t *p, lpae_t pte)
>  {
>      asm volatile (
> +        /* Ensure any writes have completed with the old mappings. */
> +        "dsb;"
>          /* Safely write the entry (STRD is atomic on CPUs that support LPAE) */
>          "strd %0, %H0, [%1];"
> +        "dsb;"
>          /* Push this cacheline to the PoC so the rest of the system sees it. */
>          STORE_CP32(1, DCCMVAC)
> +        /* Ensure that the data flush is completed before proceeding */
> +        "dsb;"
>          : : "r" (pte.bits), "r" (p) : "memory");
>  }
>  
> +
> +#define MIN_CACHELINE_BYTES 32
> +extern int cacheline_bytes;
> +
> +/* Function for flushing medium-sized areas.
> + * if 'range' is large enough we might want to use model-specific
> + * full-cache flushes. */
> +static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
> +{
> +    void *end;
> +    dsb();           /* So the CPU issues all writes to the range */ 
> +    for ( end = p + size; p < end; p += cacheline_bytes )

Tim asked if this memory read of the cached cacheline_bytes might not be
more expensive than hitting the (on-core) cp register every time, which
I also suspect will be the case. Looking at Linux it seems to reread the
register each time in v7_flush_dcache_all which suggests that reading
the register is faster or at least preferable.

> +        WRITE_CP32((uint32_t) p, DCCMVAC);
> +    dsb();           /* So we know the flushes happen before continuing */
> +}
> +
> +
> +/* Macro for flushing a single small item.  The predicate is always 
> + * compile-time constant so this will compile down to 3 instructions in
> + * the common case.  Make sure to call it with the correct type of
> + * pointer! */

Do we need to worry about pointers to things which cross a cacheline
boundary? i.e. a 4 byte thing at offset 30 in a 32-byte cache line.

Or do ARMs C alignment rules ensure this can never happen? (I suspect
the answer is yes).

> +#define flush_xen_dcache_va(p) do {                       \
> +    typeof(p) _p = (p);                                   \
> +    if ( (sizeof *_p) > MIN_CACHELINE_BYTES )             \
> +        flush_xen_dcache_va_range(_p, sizeof *_p);        \
> +    else                                                  \
> +        asm volatile (                                    \
> +            "dsb;"   /* Finish all earlier writes */      \
> +            STORE_CP32(0, DCCMVAC)                        \
> +            "dsb;"   /* Finish flush before continuing */ \
> +            : : "r" (_p), "m" (*_p));                     \
> +} while (0)
> +
> +
>  /*
>   * Flush all hypervisor mappings from the TLB and branch predictor.
> - * This is needed after changing Xen code mappings. 
> + * This is needed after changing Xen code mappings.
> + *
> + * The caller needs to issue the necessary barriers before this functions.

Worth commenting on what those are and when they are needed?

>   */
>  static inline void flush_xen_text_tlb(void)
>  {
>      register unsigned long r0 asm ("r0");
>      asm volatile (
> -        "dsb;"                        /* Ensure visibility of PTE writes */
>          STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
> +        STORE_CP32(0, ICIALLU)        /* Flush I-cache */
>          STORE_CP32(0, BPIALL)         /* Flush branch predictor */
>          "dsb;"                        /* Ensure completion of TLB+BP flush */
>          "isb;"



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:12:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:12:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwR2-0008LU-1V; Thu, 15 Nov 2012 10:12:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYwR0-0008LP-Qe
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:12:35 +0000
Received: from [85.158.143.35:33506] by server-2.bemta-4.messagelabs.com id
	46/6E-28922-210C4A05; Thu, 15 Nov 2012 10:12:34 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1352974181!14104026!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1743 invoked from network); 15 Nov 2012 10:09:41 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:09:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15822552"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:09:41 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:09:40 +0000
Message-ID: <1352974179.3499.83.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 15 Nov 2012 10:09:39 +0000
In-Reply-To: <1352821336-25837-7-git-send-email-stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-7-git-send-email-stefano.stabellini@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 7/7] xen/arm: get the number of cpus from
	device tree
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 3d1f0f4..5b6dab9 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -153,6 +153,25 @@ const char *device_tree_bootargs(const void *fdt)
>      return prop->data;
>  }
>  
> +int device_tree_cpus(const void *fdt)
> +{
> +    int node = 0, depth = 1;
> +    int cpus = 0;
> +
> +    node = fdt_path_offset(fdt, "/cpus/cpu");
> +    if ( node < 0 )
> +        return 1; /* we have at least one cpu */
> +
> +    while ( node >= 0 && depth >= 0 ) {
> +        if ( strncmp(fdt_get_name(fdt, node, NULL), "cpu", 3) )
> +            continue;
> +        node = fdt_next_node(fdt, node, &depth);
> +        cpus++;

Do we not need to track the largest <n> for each cpu@<n> which we see,
in order to handle systems with e.g. CPUs 0, 1, 4 & 5?

There are some helpers in device_tree.c to walk over trees like this,
are none of them suitable?



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:12:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:12:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwR2-0008LU-1V; Thu, 15 Nov 2012 10:12:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYwR0-0008LP-Qe
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:12:35 +0000
Received: from [85.158.143.35:33506] by server-2.bemta-4.messagelabs.com id
	46/6E-28922-210C4A05; Thu, 15 Nov 2012 10:12:34 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1352974181!14104026!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1743 invoked from network); 15 Nov 2012 10:09:41 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:09:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15822552"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:09:41 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:09:40 +0000
Message-ID: <1352974179.3499.83.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 15 Nov 2012 10:09:39 +0000
In-Reply-To: <1352821336-25837-7-git-send-email-stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-7-git-send-email-stefano.stabellini@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 7/7] xen/arm: get the number of cpus from
	device tree
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 3d1f0f4..5b6dab9 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -153,6 +153,25 @@ const char *device_tree_bootargs(const void *fdt)
>      return prop->data;
>  }
>  
> +int device_tree_cpus(const void *fdt)
> +{
> +    int node = 0, depth = 1;
> +    int cpus = 0;
> +
> +    node = fdt_path_offset(fdt, "/cpus/cpu");
> +    if ( node < 0 )
> +        return 1; /* we have at least one cpu */
> +
> +    while ( node >= 0 && depth >= 0 ) {
> +        if ( strncmp(fdt_get_name(fdt, node, NULL), "cpu", 3) )
> +            continue;
> +        node = fdt_next_node(fdt, node, &depth);
> +        cpus++;

Do we not need to track the largest <n> for each cpu@<n> which we see,
in order to handle systems with e.g. CPUs 0, 1, 4 & 5?

There are some helpers in device_tree.c to walk over trees like this,
are none of them suitable?



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:25:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:25:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwdW-0000B2-D3; Thu, 15 Nov 2012 10:25:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYwdV-0000Ax-2P
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 10:25:29 +0000
Received: from [85.158.143.99:17450] by server-3.bemta-4.messagelabs.com id
	67/3A-06841-813C4A05; Thu, 15 Nov 2012 10:25:28 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1352975121!24761317!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3121 invoked from network); 15 Nov 2012 10:25:21 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-216.messagelabs.com with SMTP;
	15 Nov 2012 10:25:21 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 10:25:22 +0000
Message-Id: <50A4D12002000078000A8C68@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 15 Nov 2012 10:25:20 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
In-Reply-To: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, TimDeegan <tim@xen.org>,
	KonradWilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 00:55, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> @@ -685,6 +685,35 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>          break;
>      }
>  
> +    case XENMEM_claim_pages:
> +    {
> +        unsigned long request;
> +
> +        start_extent = cmd >> MEMOP_EXTENT_SHIFT;

What's this? You don't do continuations (you explicitly do that
change in order to be fast), and hence this ought to be ignored
just like e.g. XENMEM_remove_from_physmap ignores it.

> +
> +        if ( copy_from_guest(&reservation, arg, 1) )
> +            return start_extent;

-EFAULT

> +
> +        if ( !(guest_handle_is_null(reservation.extent_start)) )
> +            return start_extent;

-EINVAL

> +
> +        rc = rcu_lock_target_domain_by_id(reservation.domid, &d);
> +        if ( rc )
> +            return rc;
> +
> +        /*
> +         * extent_order may be non-zero, but is only a multiplier and
> +         * does not currently claim any order>0 slabs, though this is
> +         * a possible future feature
> +         */

If extent_order doesn't do what it promises to do, just don't
allow non-zero values.

> +        request = reservation.nr_extents << reservation.extent_order;
> +        rc = domain_set_unclaimed_pages(d, request, reservation.mem_flags);
> +
> +        rcu_unlock_domain(d);
> +
> +        break;
> +    }
> +
>...
> +unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pages)
> +{
> +    ASSERT(spin_is_locked(&d->page_alloc_lock));
> +    ASSERT(!spin_is_locked(&heap_lock));

There are numerous of these throughout the code, but while
asserting a certain lock to be held is valid, asserting that one
isn't being held (by _anyone_) clearly isn't. You're presumably
mixing this up with something like spin_is_owned()...

> +    spin_lock(&heap_lock);
> +    d->tot_pages -= pages;

Shouldn't you do the same lockless approach for the common case
here as you did on Keir's advice in domain_increase_tot_pages()?

> +    if ( d->unclaimed_pages )
> +    {
> +        d->unclaimed_pages += pages;
> +        total_unclaimed_pages += pages;
> +    }
> +    spin_unlock(&heap_lock);
> +    return d->tot_pages;
> +}
> +
> +int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
> +                                unsigned long flags)
> +{
> +    int ret = -ENOMEM;
> +    unsigned long claim = 0, avail_pages = 0;

Pointless initializers.

> +
> +    /*
> +     * take the domain's page_alloc_lock, else all increases/decreases
> +     * must always take the global heap_lock rather than only in the much
> +     * rarer case that d->unclaimed_pages is non-zero
> +     */
> +    ASSERT(!spin_is_locked(&d->page_alloc_lock));
> +    spin_lock(&d->page_alloc_lock);
> +    ASSERT(!spin_is_locked(&heap_lock));
> +    spin_lock(&heap_lock);
> +
> +    /* pages==0 means "unset" the claim (and flags is ignored) */
> +    if (pages == 0)
> +    {
> +        total_unclaimed_pages -= d->unclaimed_pages;
> +        d->unclaimed_pages = 0;
> +        ret = 0;
> +        goto out;
> +    }
> +
> +    /* only one active claim per domain please */
> +    if ( d->unclaimed_pages)
> +        goto out;

-ENOMEM for this case seems wrong.

> +
> +    /* how much memory is available? */
> +    avail_pages = total_avail_pages;
> +    if ( !(flags & XENMEM_CLAIMF_free_only) )
> +        avail_pages += tmem_freeable_pages();
> +    avail_pages -= total_unclaimed_pages;
> +
> +    /*
> +     * note, if domain has already allocated memory before making a claim 
> +     * then the claim must take tot_pages into account
> +     */
> +    claim = pages - d->tot_pages;
> +    if ( claim > avail_pages )
> +        goto out;

What if pages < d->tot_pages?

> +
> +    /* yay, claim fits in available memory, stake the claim, success! */
> +    d->unclaimed_pages = claim;
> +    total_unclaimed_pages += d->unclaimed_pages;
> +    ret = 0;
> +
> +out:
> +    spin_unlock(&heap_lock);
> +    spin_unlock(&d->page_alloc_lock);
> +    return ret;
> +}
>  
>  static unsigned long init_node_heap(int node, unsigned long mfn,
>                                      unsigned long nr, bool_t *use_tail)
> @@ -443,6 +537,15 @@ static struct page_info *alloc_heap_pages(
>      spin_lock(&heap_lock);
>  
>      /*
> +     * Claimed memory is considered unavailable unless the request
> +     * is made by a domain with sufficient unclaimed pages.
> +     */
> +    if ( (total_unclaimed_pages + request >
> +           total_avail_pages + tmem_freeable_pages()) &&
> +          (d == NULL || d->unclaimed_pages < request) )
> +        goto not_found;

The treatment of d being NULL certainly needs further thought:
Is it really better to fulfill the claim and fail some (perhaps
important) _xmalloc()?

Also, I'm missing a mechanism by which the tools could find out
how much unclaimed memory is available, in order to determine
(if in use) how much memory needs to be ballooned out of Dom0.

Similarly, but perhaps of lower priority, there is no integration
with the low-mem handling.

Finally, there still are a number of formatting issues.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:25:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:25:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwdW-0000B2-D3; Thu, 15 Nov 2012 10:25:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYwdV-0000Ax-2P
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 10:25:29 +0000
Received: from [85.158.143.99:17450] by server-3.bemta-4.messagelabs.com id
	67/3A-06841-813C4A05; Thu, 15 Nov 2012 10:25:28 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1352975121!24761317!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3121 invoked from network); 15 Nov 2012 10:25:21 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-216.messagelabs.com with SMTP;
	15 Nov 2012 10:25:21 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 10:25:22 +0000
Message-Id: <50A4D12002000078000A8C68@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 15 Nov 2012 10:25:20 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
In-Reply-To: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, TimDeegan <tim@xen.org>,
	KonradWilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 00:55, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> @@ -685,6 +685,35 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>          break;
>      }
>  
> +    case XENMEM_claim_pages:
> +    {
> +        unsigned long request;
> +
> +        start_extent = cmd >> MEMOP_EXTENT_SHIFT;

What's this? You don't do continuations (you explicitly do that
change in order to be fast), and hence this ought to be ignored
just like e.g. XENMEM_remove_from_physmap ignores it.

> +
> +        if ( copy_from_guest(&reservation, arg, 1) )
> +            return start_extent;

-EFAULT

> +
> +        if ( !(guest_handle_is_null(reservation.extent_start)) )
> +            return start_extent;

-EINVAL

> +
> +        rc = rcu_lock_target_domain_by_id(reservation.domid, &d);
> +        if ( rc )
> +            return rc;
> +
> +        /*
> +         * extent_order may be non-zero, but is only a multiplier and
> +         * does not currently claim any order>0 slabs, though this is
> +         * a possible future feature
> +         */

If extent_order doesn't do what it promises to do, just don't
allow non-zero values.

> +        request = reservation.nr_extents << reservation.extent_order;
> +        rc = domain_set_unclaimed_pages(d, request, reservation.mem_flags);
> +
> +        rcu_unlock_domain(d);
> +
> +        break;
> +    }
> +
>...
> +unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pages)
> +{
> +    ASSERT(spin_is_locked(&d->page_alloc_lock));
> +    ASSERT(!spin_is_locked(&heap_lock));

There are numerous of these throughout the code, but while
asserting a certain lock to be held is valid, asserting that one
isn't being held (by _anyone_) clearly isn't. You're presumably
mixing this up with something like spin_is_owned()...

> +    spin_lock(&heap_lock);
> +    d->tot_pages -= pages;

Shouldn't you do the same lockless approach for the common case
here as you did on Keir's advice in domain_increase_tot_pages()?

> +    if ( d->unclaimed_pages )
> +    {
> +        d->unclaimed_pages += pages;
> +        total_unclaimed_pages += pages;
> +    }
> +    spin_unlock(&heap_lock);
> +    return d->tot_pages;
> +}
> +
> +int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
> +                                unsigned long flags)
> +{
> +    int ret = -ENOMEM;
> +    unsigned long claim = 0, avail_pages = 0;

Pointless initializers.

> +
> +    /*
> +     * take the domain's page_alloc_lock, else all increases/decreases
> +     * must always take the global heap_lock rather than only in the much
> +     * rarer case that d->unclaimed_pages is non-zero
> +     */
> +    ASSERT(!spin_is_locked(&d->page_alloc_lock));
> +    spin_lock(&d->page_alloc_lock);
> +    ASSERT(!spin_is_locked(&heap_lock));
> +    spin_lock(&heap_lock);
> +
> +    /* pages==0 means "unset" the claim (and flags is ignored) */
> +    if (pages == 0)
> +    {
> +        total_unclaimed_pages -= d->unclaimed_pages;
> +        d->unclaimed_pages = 0;
> +        ret = 0;
> +        goto out;
> +    }
> +
> +    /* only one active claim per domain please */
> +    if ( d->unclaimed_pages)
> +        goto out;

-ENOMEM for this case seems wrong.

> +
> +    /* how much memory is available? */
> +    avail_pages = total_avail_pages;
> +    if ( !(flags & XENMEM_CLAIMF_free_only) )
> +        avail_pages += tmem_freeable_pages();
> +    avail_pages -= total_unclaimed_pages;
> +
> +    /*
> +     * note, if domain has already allocated memory before making a claim 
> +     * then the claim must take tot_pages into account
> +     */
> +    claim = pages - d->tot_pages;
> +    if ( claim > avail_pages )
> +        goto out;

What if pages < d->tot_pages?

> +
> +    /* yay, claim fits in available memory, stake the claim, success! */
> +    d->unclaimed_pages = claim;
> +    total_unclaimed_pages += d->unclaimed_pages;
> +    ret = 0;
> +
> +out:
> +    spin_unlock(&heap_lock);
> +    spin_unlock(&d->page_alloc_lock);
> +    return ret;
> +}
>  
>  static unsigned long init_node_heap(int node, unsigned long mfn,
>                                      unsigned long nr, bool_t *use_tail)
> @@ -443,6 +537,15 @@ static struct page_info *alloc_heap_pages(
>      spin_lock(&heap_lock);
>  
>      /*
> +     * Claimed memory is considered unavailable unless the request
> +     * is made by a domain with sufficient unclaimed pages.
> +     */
> +    if ( (total_unclaimed_pages + request >
> +           total_avail_pages + tmem_freeable_pages()) &&
> +          (d == NULL || d->unclaimed_pages < request) )
> +        goto not_found;

The treatment of d being NULL certainly needs further thought:
Is it really better to fulfill the claim and fail some (perhaps
important) _xmalloc()?

Also, I'm missing a mechanism by which the tools could find out
how much unclaimed memory is available, in order to determine
(if in use) how much memory needs to be ballooned out of Dom0.

Similarly, but perhaps of lower priority, there is no integration
with the low-mem handling.

Finally, there still are a number of formatting issues.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:28:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:28:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwfn-0000Gi-UV; Thu, 15 Nov 2012 10:27:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYwfm-0000Gb-Qx
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:27:50 +0000
Received: from [193.109.254.147:40698] by server-8.bemta-14.messagelabs.com id
	5E/00-05026-6A3C4A05; Thu, 15 Nov 2012 10:27:50 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1352975262!4208542!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16547 invoked from network); 15 Nov 2012 10:27:43 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-10.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:27:43 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15823055"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:27:42 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:27:41 +0000
Message-ID: <1352975261.3499.92.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 15 Nov 2012 10:27:41 +0000
In-Reply-To: <1352821336-25837-4-git-send-email-stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-4-git-send-email-stefano.stabellini@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 4/7] xen/arm: set the SMP bit in the ACTLR
	register
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:

> Changes in v2:
> - detect the processor ID and call a processor specific initialization
> function;

I presume this will become a table driven lookup at some point...

> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Acked-by: Tim Deegan <tim@xen.org>

Applied, thanks.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:28:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:28:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwfn-0000Gi-UV; Thu, 15 Nov 2012 10:27:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYwfm-0000Gb-Qx
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:27:50 +0000
Received: from [193.109.254.147:40698] by server-8.bemta-14.messagelabs.com id
	5E/00-05026-6A3C4A05; Thu, 15 Nov 2012 10:27:50 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1352975262!4208542!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16547 invoked from network); 15 Nov 2012 10:27:43 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-10.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:27:43 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15823055"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:27:42 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:27:41 +0000
Message-ID: <1352975261.3499.92.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 15 Nov 2012 10:27:41 +0000
In-Reply-To: <1352821336-25837-4-git-send-email-stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-4-git-send-email-stefano.stabellini@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 4/7] xen/arm: set the SMP bit in the ACTLR
	register
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:

> Changes in v2:
> - detect the processor ID and call a processor specific initialization
> function;

I presume this will become a table driven lookup at some point...

> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Acked-by: Tim Deegan <tim@xen.org>

Applied, thanks.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:28:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:28:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwg5-0000II-Bt; Thu, 15 Nov 2012 10:28:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYwg3-0000Hs-UK
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:28:08 +0000
Received: from [85.158.143.99:27130] by server-3.bemta-4.messagelabs.com id
	3B/FE-06841-7B3C4A05; Thu, 15 Nov 2012 10:28:07 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1352975286!29993139!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10859 invoked from network); 15 Nov 2012 10:28:06 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:28:06 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15823063"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:28:05 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:28:05 +0000
Message-ID: <1352975284.3499.93.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 15 Nov 2012 10:28:04 +0000
In-Reply-To: <1352821336-25837-5-git-send-email-stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-5-git-send-email-stefano.stabellini@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 5/7] xen/arm: wake up secondary cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> Secondary cpus are held by the firmware until we send an IPI to them.

I inserted:

Reordered non-boot cpu wait loop to perform the check before waiting for
an event, to handled the case where the event has already happened when
we reach the loop.

At some point we'll need to do something to handle different platforms,
but this will do for now.

> 
> Changes in v2:
> - use preprocessor definitions in kick_cpus;
> - do not manually increment the base address register, use an offset
> instead;
> - move kick_cpus to proc-ca15.S.

You meant mode_switch.S I think? I'm going to assume this comment is
wrong rather than the patch. If not then please send a followup.

> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

fixed up tab vs space + Acked + applied 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:28:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:28:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwg5-0000II-Bt; Thu, 15 Nov 2012 10:28:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYwg3-0000Hs-UK
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:28:08 +0000
Received: from [85.158.143.99:27130] by server-3.bemta-4.messagelabs.com id
	3B/FE-06841-7B3C4A05; Thu, 15 Nov 2012 10:28:07 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1352975286!29993139!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10859 invoked from network); 15 Nov 2012 10:28:06 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:28:06 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15823063"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:28:05 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:28:05 +0000
Message-ID: <1352975284.3499.93.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 15 Nov 2012 10:28:04 +0000
In-Reply-To: <1352821336-25837-5-git-send-email-stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-5-git-send-email-stefano.stabellini@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 5/7] xen/arm: wake up secondary cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> Secondary cpus are held by the firmware until we send an IPI to them.

I inserted:

Reordered non-boot cpu wait loop to perform the check before waiting for
an event, to handled the case where the event has already happened when
we reach the loop.

At some point we'll need to do something to handle different platforms,
but this will do for now.

> 
> Changes in v2:
> - use preprocessor definitions in kick_cpus;
> - do not manually increment the base address register, use an offset
> instead;
> - move kick_cpus to proc-ca15.S.

You meant mode_switch.S I think? I'm going to assume this comment is
wrong rather than the patch. If not then please send a followup.

> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

fixed up tab vs space + Acked + applied 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:28:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:28:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwgb-0000OP-U9; Thu, 15 Nov 2012 10:28:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYwga-0000Nk-MI
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:28:40 +0000
Received: from [193.109.254.147:37104] by server-6.bemta-14.messagelabs.com id
	AD/D8-02788-7D3C4A05; Thu, 15 Nov 2012 10:28:39 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352975231!4198225!4
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23337 invoked from network); 15 Nov 2012 10:27:19 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:27:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15823046"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:27:19 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:27:18 +0000
Message-ID: <1352975238.3499.91.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 15 Nov 2012 10:27:18 +0000
In-Reply-To: <1352821336-25837-3-git-send-email-stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-3-git-send-email-stefano.stabellini@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 3/7] pl011: set baud and clock_hz to the
 right defaults for Versatile Express
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Acked-by: Tim Deegan <tim@xen.org>

Applied, thanks.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:28:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:28:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwgb-0000OP-U9; Thu, 15 Nov 2012 10:28:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYwga-0000Nk-MI
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:28:40 +0000
Received: from [193.109.254.147:37104] by server-6.bemta-14.messagelabs.com id
	AD/D8-02788-7D3C4A05; Thu, 15 Nov 2012 10:28:39 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352975231!4198225!4
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23337 invoked from network); 15 Nov 2012 10:27:19 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:27:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15823046"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:27:19 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:27:18 +0000
Message-ID: <1352975238.3499.91.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 15 Nov 2012 10:27:18 +0000
In-Reply-To: <1352821336-25837-3-git-send-email-stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-3-git-send-email-stefano.stabellini@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 3/7] pl011: set baud and clock_hz to the
 right defaults for Versatile Express
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Acked-by: Tim Deegan <tim@xen.org>

Applied, thanks.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:28:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:28:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwge-0000PV-Ca; Thu, 15 Nov 2012 10:28:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYwgd-0000Ok-0E
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:28:43 +0000
Received: from [193.109.254.147:37188] by server-14.bemta-14.messagelabs.com
	id 7B/41-14517-AD3C4A05; Thu, 15 Nov 2012 10:28:42 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352975231!4198225!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22824 invoked from network); 15 Nov 2012 10:27:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:27:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15823023"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:26:17 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:26:16 +0000
Message-ID: <1352975175.3499.88.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jim Fehlig <jfehlig@suse.com>
Date: Thu, 15 Nov 2012 10:26:15 +0000
In-Reply-To: <1352945011-2847-1-git-send-email-jfehlig@suse.com>
References: <1352945011-2847-1-git-send-email-jfehlig@suse.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, Ian
	Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Fix passing of application data to
 timeout_deregister hook
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 02:03 +0000, Jim Fehlig wrote:
> When deregistering a timeout, the address of application data was
> being passed to the timeout_deregister hook instead of the data
> itself.
> 
>     Signed-off-by: Jim Fehlig <jfehlig@suse.com>

Acked + applied, thanks.

Ian, this should be a candidate for the next 4.2.1 rc IMHO.

> ---
>  tools/libxl/libxl_event.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
> index 41fd5bb..72cb723 100644
> --- a/tools/libxl/libxl_event.c
> +++ b/tools/libxl/libxl_event.c
> @@ -184,7 +184,7 @@ static int time_register_finite(libxl__gc *gc, libxl__ev_time *ev,
>  static void time_deregister(libxl__gc *gc, libxl__ev_time *ev)
>  {
>      if (!ev->infinite) {
> -        OSEVENT_HOOK_VOID(timeout_deregister, &ev->for_app_reg);
> +        OSEVENT_HOOK_VOID(timeout_deregister, ev->for_app_reg);
>          LIBXL_TAILQ_REMOVE(&CTX->etimes, ev, entry);
>      }
>  }



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:28:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:28:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwge-0000PV-Ca; Thu, 15 Nov 2012 10:28:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYwgd-0000Ok-0E
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:28:43 +0000
Received: from [193.109.254.147:37188] by server-14.bemta-14.messagelabs.com
	id 7B/41-14517-AD3C4A05; Thu, 15 Nov 2012 10:28:42 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352975231!4198225!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22824 invoked from network); 15 Nov 2012 10:27:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:27:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15823023"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:26:17 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:26:16 +0000
Message-ID: <1352975175.3499.88.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jim Fehlig <jfehlig@suse.com>
Date: Thu, 15 Nov 2012 10:26:15 +0000
In-Reply-To: <1352945011-2847-1-git-send-email-jfehlig@suse.com>
References: <1352945011-2847-1-git-send-email-jfehlig@suse.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, Ian
	Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Fix passing of application data to
 timeout_deregister hook
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 02:03 +0000, Jim Fehlig wrote:
> When deregistering a timeout, the address of application data was
> being passed to the timeout_deregister hook instead of the data
> itself.
> 
>     Signed-off-by: Jim Fehlig <jfehlig@suse.com>

Acked + applied, thanks.

Ian, this should be a candidate for the next 4.2.1 rc IMHO.

> ---
>  tools/libxl/libxl_event.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
> index 41fd5bb..72cb723 100644
> --- a/tools/libxl/libxl_event.c
> +++ b/tools/libxl/libxl_event.c
> @@ -184,7 +184,7 @@ static int time_register_finite(libxl__gc *gc, libxl__ev_time *ev,
>  static void time_deregister(libxl__gc *gc, libxl__ev_time *ev)
>  {
>      if (!ev->infinite) {
> -        OSEVENT_HOOK_VOID(timeout_deregister, &ev->for_app_reg);
> +        OSEVENT_HOOK_VOID(timeout_deregister, ev->for_app_reg);
>          LIBXL_TAILQ_REMOVE(&CTX->etimes, ev, entry);
>      }
>  }



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:28:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:28:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwgZ-0000NZ-Q7; Thu, 15 Nov 2012 10:28:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYwgY-0000N9-An
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:28:38 +0000
Received: from [193.109.254.147:26609] by server-5.bemta-14.messagelabs.com id
	42/76-10257-5D3C4A05; Thu, 15 Nov 2012 10:28:37 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352975231!4198225!2
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22872 invoked from network); 15 Nov 2012 10:27:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:27:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15823037"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:26:38 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:26:37 +0000
Message-ID: <1352975196.3499.89.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 15 Nov 2012 10:26:36 +0000
In-Reply-To: <1352821336-25837-1-git-send-email-stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-1-git-send-email-stefano.stabellini@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 1/7] xen/arm: pass the correct
 bit-per-interrupt argument to vgic_irq_rank
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> Use 1 for registers that have 1 bit per irq.
> 
> Changes in v2:
> - add case 1 to REG_RANK_NR rather than changing the implementation.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Acked + applied.

> ---
>  xen/arch/arm/vgic.c |   25 +++++++++++++------------
>  1 files changed, 13 insertions(+), 12 deletions(-)
> 
> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
> index 3c3983f..3f7e757 100644
> --- a/xen/arch/arm/vgic.c
> +++ b/xen/arch/arm/vgic.c
> @@ -47,6 +47,7 @@ static inline int REG_RANK_NR(int b, uint32_t n)
>      case 8: return n >> 3;
>      case 4: return n >> 2;
>      case 2: return n >> 1;
> +    case 1: return n;
>      default: BUG();
>      }
>  }
> @@ -199,7 +200,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ISENABLER ... GICD_ISENABLERN:
>          if ( dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISENABLER);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISENABLER);
>          if ( rank == NULL) goto read_as_zero;
>          vgic_lock_rank(v, rank);
>          *r = rank->ienable;
> @@ -208,7 +209,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ICENABLER ... GICD_ICENABLERN:
>          if ( dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICENABLER);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICENABLER);
>          if ( rank == NULL) goto read_as_zero;
>          vgic_lock_rank(v, rank);
>          *r = rank->ienable;
> @@ -217,7 +218,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ISPENDR ... GICD_ISPENDRN:
>          if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISPENDR);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISPENDR);
>          if ( rank == NULL) goto read_as_zero;
>          vgic_lock_rank(v, rank);
>          *r = byte_read(rank->ipend, dabt.sign, offset);
> @@ -226,7 +227,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ICPENDR ... GICD_ICPENDRN:
>          if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICPENDR);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICPENDR);
>          if ( rank == NULL) goto read_as_zero;
>          vgic_lock_rank(v, rank);
>          *r = byte_read(rank->ipend, dabt.sign, offset);
> @@ -235,7 +236,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ISACTIVER ... GICD_ISACTIVERN:
>          if ( dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISACTIVER);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISACTIVER);
>          if ( rank == NULL) goto read_as_zero;
>          vgic_lock_rank(v, rank);
>          *r = rank->iactive;
> @@ -244,7 +245,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ICACTIVER ... GICD_ICACTIVERN:
>          if ( dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICACTIVER);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICACTIVER);
>          if ( rank == NULL) goto read_as_zero;
>          vgic_lock_rank(v, rank);
>          *r = rank->iactive;
> @@ -296,7 +297,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
>          if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_CPENDSGIR);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_CPENDSGIR);
>          if ( rank == NULL) goto read_as_zero;
>          vgic_lock_rank(v, rank);
>          *r = byte_read(rank->pendsgi, dabt.sign, offset);
> @@ -305,7 +306,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
>          if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_SPENDSGIR);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_SPENDSGIR);
>          if ( rank == NULL) goto read_as_zero;
>          vgic_lock_rank(v, rank);
>          *r = byte_read(rank->pendsgi, dabt.sign, offset);
> @@ -400,7 +401,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ISENABLER ... GICD_ISENABLERN:
>          if ( dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISENABLER);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISENABLER);
>          if ( rank == NULL) goto write_ignore;
>          vgic_lock_rank(v, rank);
>          tr = rank->ienable;
> @@ -411,7 +412,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ICENABLER ... GICD_ICENABLERN:
>          if ( dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICENABLER);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICENABLER);
>          if ( rank == NULL) goto write_ignore;
>          vgic_lock_rank(v, rank);
>          rank->ienable &= ~*r;
> @@ -432,7 +433,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ISACTIVER ... GICD_ISACTIVERN:
>          if ( dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISACTIVER);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISACTIVER);
>          if ( rank == NULL) goto write_ignore;
>          vgic_lock_rank(v, rank);
>          rank->iactive &= ~*r;
> @@ -441,7 +442,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ICACTIVER ... GICD_ICACTIVERN:
>          if ( dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICACTIVER);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICACTIVER);
>          if ( rank == NULL) goto write_ignore;
>          vgic_lock_rank(v, rank);
>          rank->iactive &= ~*r;



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:28:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:28:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwgZ-0000NZ-Q7; Thu, 15 Nov 2012 10:28:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYwgY-0000N9-An
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:28:38 +0000
Received: from [193.109.254.147:26609] by server-5.bemta-14.messagelabs.com id
	42/76-10257-5D3C4A05; Thu, 15 Nov 2012 10:28:37 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352975231!4198225!2
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22872 invoked from network); 15 Nov 2012 10:27:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:27:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15823037"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:26:38 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:26:37 +0000
Message-ID: <1352975196.3499.89.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 15 Nov 2012 10:26:36 +0000
In-Reply-To: <1352821336-25837-1-git-send-email-stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-1-git-send-email-stefano.stabellini@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 1/7] xen/arm: pass the correct
 bit-per-interrupt argument to vgic_irq_rank
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> Use 1 for registers that have 1 bit per irq.
> 
> Changes in v2:
> - add case 1 to REG_RANK_NR rather than changing the implementation.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Acked + applied.

> ---
>  xen/arch/arm/vgic.c |   25 +++++++++++++------------
>  1 files changed, 13 insertions(+), 12 deletions(-)
> 
> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
> index 3c3983f..3f7e757 100644
> --- a/xen/arch/arm/vgic.c
> +++ b/xen/arch/arm/vgic.c
> @@ -47,6 +47,7 @@ static inline int REG_RANK_NR(int b, uint32_t n)
>      case 8: return n >> 3;
>      case 4: return n >> 2;
>      case 2: return n >> 1;
> +    case 1: return n;
>      default: BUG();
>      }
>  }
> @@ -199,7 +200,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ISENABLER ... GICD_ISENABLERN:
>          if ( dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISENABLER);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISENABLER);
>          if ( rank == NULL) goto read_as_zero;
>          vgic_lock_rank(v, rank);
>          *r = rank->ienable;
> @@ -208,7 +209,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ICENABLER ... GICD_ICENABLERN:
>          if ( dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICENABLER);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICENABLER);
>          if ( rank == NULL) goto read_as_zero;
>          vgic_lock_rank(v, rank);
>          *r = rank->ienable;
> @@ -217,7 +218,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ISPENDR ... GICD_ISPENDRN:
>          if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISPENDR);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISPENDR);
>          if ( rank == NULL) goto read_as_zero;
>          vgic_lock_rank(v, rank);
>          *r = byte_read(rank->ipend, dabt.sign, offset);
> @@ -226,7 +227,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ICPENDR ... GICD_ICPENDRN:
>          if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICPENDR);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICPENDR);
>          if ( rank == NULL) goto read_as_zero;
>          vgic_lock_rank(v, rank);
>          *r = byte_read(rank->ipend, dabt.sign, offset);
> @@ -235,7 +236,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ISACTIVER ... GICD_ISACTIVERN:
>          if ( dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISACTIVER);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISACTIVER);
>          if ( rank == NULL) goto read_as_zero;
>          vgic_lock_rank(v, rank);
>          *r = rank->iactive;
> @@ -244,7 +245,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ICACTIVER ... GICD_ICACTIVERN:
>          if ( dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICACTIVER);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICACTIVER);
>          if ( rank == NULL) goto read_as_zero;
>          vgic_lock_rank(v, rank);
>          *r = rank->iactive;
> @@ -296,7 +297,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
>          if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_CPENDSGIR);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_CPENDSGIR);
>          if ( rank == NULL) goto read_as_zero;
>          vgic_lock_rank(v, rank);
>          *r = byte_read(rank->pendsgi, dabt.sign, offset);
> @@ -305,7 +306,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
>          if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_SPENDSGIR);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_SPENDSGIR);
>          if ( rank == NULL) goto read_as_zero;
>          vgic_lock_rank(v, rank);
>          *r = byte_read(rank->pendsgi, dabt.sign, offset);
> @@ -400,7 +401,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ISENABLER ... GICD_ISENABLERN:
>          if ( dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISENABLER);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISENABLER);
>          if ( rank == NULL) goto write_ignore;
>          vgic_lock_rank(v, rank);
>          tr = rank->ienable;
> @@ -411,7 +412,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ICENABLER ... GICD_ICENABLERN:
>          if ( dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICENABLER);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICENABLER);
>          if ( rank == NULL) goto write_ignore;
>          vgic_lock_rank(v, rank);
>          rank->ienable &= ~*r;
> @@ -432,7 +433,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ISACTIVER ... GICD_ISACTIVERN:
>          if ( dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ISACTIVER);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISACTIVER);
>          if ( rank == NULL) goto write_ignore;
>          vgic_lock_rank(v, rank);
>          rank->iactive &= ~*r;
> @@ -441,7 +442,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
>  
>      case GICD_ICACTIVER ... GICD_ICACTIVERN:
>          if ( dabt.size != 2 ) goto bad_width;
> -        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ICACTIVER);
> +        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICACTIVER);
>          if ( rank == NULL) goto write_ignore;
>          vgic_lock_rank(v, rank);
>          rank->iactive &= ~*r;



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:28:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:28:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwge-0000Pj-PN; Thu, 15 Nov 2012 10:28:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYwgc-0000Oj-W2
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:28:43 +0000
Received: from [193.109.254.147:37216] by server-10.bemta-14.messagelabs.com
	id AC/91-31741-AD3C4A05; Thu, 15 Nov 2012 10:28:42 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352975231!4198225!3
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23187 invoked from network); 15 Nov 2012 10:27:16 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:27:16 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15823042"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:27:05 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:27:04 +0000
Message-ID: <1352975223.3499.90.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 15 Nov 2012 10:27:03 +0000
In-Reply-To: <1352821336-25837-2-git-send-email-stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-2-git-send-email-stefano.stabellini@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 2/7] xen/arm: setup the fixmap in head.S
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> diff --git a/xen/arch/arm/early_printk.c b/xen/arch/arm/early_printk.c
> index 3e51252..bdf4c0e 100644
> --- a/xen/arch/arm/early_printk.c
> +++ b/xen/arch/arm/early_printk.c
> @@ -17,12 +17,11 @@
>  
>  #ifdef EARLY_UART_ADDRESS
>  
> -static void __init early_putch(char c)
> +void __init early_putch(char c)
>  {
>      volatile uint32_t *r;
>  
> -    r = (uint32_t *)((EARLY_UART_ADDRESS & 0x001fffff)
> -                     + XEN_VIRT_START + (1 << 21));
> +    r = (uint32_t *)(XEN_VIRT_START + (1 << 21));

I'm not sure I understand the significance of this address (I know this
was already here, but I figured you might know having touched it).

>  #ifdef EARLY_UART_ADDRESS
> -	/* Recover the UART address in the new address space. */
> -	lsl   r11, #11
> -	lsr   r11, #11               /* UART base's offset from 2MB base */
> -	adr   r0, start
> -	add   r0, r0, #0x200000      /* vaddr of the fixmap's 2MB slot */
> -	add   r11, r11, r0           /* r11 := vaddr (UART base address) */
> +    /* Use a virtual address to access the UART. */

Should be a tab.

(a separate patch to use soft tabs in all .S files would also be
acceptable ;-))

Actually that turned out to be my only "significant" comment so I'll
just fix it on commit.

Acked + applied.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:28:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:28:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwge-0000Pj-PN; Thu, 15 Nov 2012 10:28:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYwgc-0000Oj-W2
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:28:43 +0000
Received: from [193.109.254.147:37216] by server-10.bemta-14.messagelabs.com
	id AC/91-31741-AD3C4A05; Thu, 15 Nov 2012 10:28:42 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1352975231!4198225!3
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23187 invoked from network); 15 Nov 2012 10:27:16 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:27:16 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15823042"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:27:05 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:27:04 +0000
Message-ID: <1352975223.3499.90.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 15 Nov 2012 10:27:03 +0000
In-Reply-To: <1352821336-25837-2-git-send-email-stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-2-git-send-email-stefano.stabellini@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 2/7] xen/arm: setup the fixmap in head.S
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> diff --git a/xen/arch/arm/early_printk.c b/xen/arch/arm/early_printk.c
> index 3e51252..bdf4c0e 100644
> --- a/xen/arch/arm/early_printk.c
> +++ b/xen/arch/arm/early_printk.c
> @@ -17,12 +17,11 @@
>  
>  #ifdef EARLY_UART_ADDRESS
>  
> -static void __init early_putch(char c)
> +void __init early_putch(char c)
>  {
>      volatile uint32_t *r;
>  
> -    r = (uint32_t *)((EARLY_UART_ADDRESS & 0x001fffff)
> -                     + XEN_VIRT_START + (1 << 21));
> +    r = (uint32_t *)(XEN_VIRT_START + (1 << 21));

I'm not sure I understand the significance of this address (I know this
was already here, but I figured you might know having touched it).

>  #ifdef EARLY_UART_ADDRESS
> -	/* Recover the UART address in the new address space. */
> -	lsl   r11, #11
> -	lsr   r11, #11               /* UART base's offset from 2MB base */
> -	adr   r0, start
> -	add   r0, r0, #0x200000      /* vaddr of the fixmap's 2MB slot */
> -	add   r11, r11, r0           /* r11 := vaddr (UART base address) */
> +    /* Use a virtual address to access the UART. */

Should be a tab.

(a separate patch to use soft tabs in all .S files would also be
acceptable ;-))

Actually that turned out to be my only "significant" comment so I'll
just fix it on commit.

Acked + applied.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:47:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:47:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwyV-0001Us-Nz; Thu, 15 Nov 2012 10:47:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYwyV-0001Un-5J
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 10:47:11 +0000
Received: from [85.158.143.99:11520] by server-1.bemta-4.messagelabs.com id
	A0/AC-27934-E28C4A05; Thu, 15 Nov 2012 10:47:10 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1352976429!30057751!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5175 invoked from network); 15 Nov 2012 10:47:10 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:47:10 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15823613"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:47:09 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:47:09 +0000
Message-ID: <1352976427.3499.100.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Date: Thu, 15 Nov 2012 10:47:07 +0000
In-Reply-To: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
References: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Konrad
	Wilk <konrad.wilk@oracle.com>, "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 22:23 +0000, Dan Magenheimer wrote:
> This is a first cut of the hypervisor patch of the proposed
> XENMEM_claim_pages hypercall/subop.

Who is expected to be able to call this? I think a XENMEM subop implies
that the guest itself, plus perhaps any controlling stubdom (e.g. qemu) could call
it, which I don't think is desirable.

Should this be limited to the toolstack only and therefore be a subop of
domctl or some other hypercall?

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:47:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:47:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYwyV-0001Us-Nz; Thu, 15 Nov 2012 10:47:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYwyV-0001Un-5J
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 10:47:11 +0000
Received: from [85.158.143.99:11520] by server-1.bemta-4.messagelabs.com id
	A0/AC-27934-E28C4A05; Thu, 15 Nov 2012 10:47:10 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1352976429!30057751!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5175 invoked from network); 15 Nov 2012 10:47:10 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:47:10 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15823613"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:47:09 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:47:09 +0000
Message-ID: <1352976427.3499.100.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Date: Thu, 15 Nov 2012 10:47:07 +0000
In-Reply-To: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
References: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Konrad
	Wilk <konrad.wilk@oracle.com>, "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-13 at 22:23 +0000, Dan Magenheimer wrote:
> This is a first cut of the hypervisor patch of the proposed
> XENMEM_claim_pages hypercall/subop.

Who is expected to be able to call this? I think a XENMEM subop implies
that the guest itself, plus perhaps any controlling stubdom (e.g. qemu) could call
it, which I don't think is desirable.

Should this be limited to the toolstack only and therefore be a subop of
domctl or some other hypercall?

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:53:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:53:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYx47-0001mD-Hu; Thu, 15 Nov 2012 10:52:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TYx45-0001m7-OG
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:52:58 +0000
Received: from [85.158.143.99:40669] by server-3.bemta-4.messagelabs.com id
	D1/6F-06841-989C4A05; Thu, 15 Nov 2012 10:52:57 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352976776!26663358!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22164 invoked from network); 15 Nov 2012 10:52:56 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:52:56 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15823755"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:52:56 +0000
Received: from [192.168.1.30] (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:52:55 +0000
Message-ID: <50A4C987.3020308@citrix.com>
Date: Thu, 15 Nov 2012 11:52:55 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Annie Li <annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963114-628-1-git-send-email-annie.li@oracle.com>
In-Reply-To: <1352963114-628-1-git-send-email-annie.li@oracle.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 3/4] Xen/netfront: Implement persistent
 grant in netfront.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 15/11/12 08:05, Annie Li wrote:
> Tx/rx page pool are maintained. New grant is mapped and put into
> pool, unmap only happens when releasing/removing device.
> 
> Signed-off-by: Annie Li <annie.li@oracle.com>
> ---
>  drivers/net/xen-netfront.c |  372 +++++++++++++++++++++++++++++++++++++-------
>  1 files changed, 315 insertions(+), 57 deletions(-)
> 
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index 0ebbb19..17b81c0 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -79,6 +79,13 @@ struct netfront_stats {
>         struct u64_stats_sync   syncp;
>  };
> 
> +struct gnt_list {
> +       grant_ref_t             gref;
> +       struct                  page *gnt_pages;
> +       void                    *gnt_target;
> +       struct                  gnt_list *tail;
> +};

This could also be shared with blkfront.

> +
>  struct netfront_info {
>         struct list_head list;
>         struct net_device *netdev;
> @@ -109,6 +116,10 @@ struct netfront_info {
>         grant_ref_t grant_tx_ref[NET_TX_RING_SIZE];
>         unsigned tx_skb_freelist;
> 
> +       struct gnt_list *tx_grant[NET_TX_RING_SIZE];
> +       struct gnt_list *tx_gnt_list;
> +       unsigned int tx_gnt_cnt;

I don't understand this, why do you need both an array and a list? I'm
not familiar with net code, so I don't know if this is some kind of
special netfront thing?

Anyway if you have to use a list I would recommend using one of the list
constructions that's already in the kernel, it simplifies the code and
makes it more easy to understand than creating your own list structure.

> +
>         spinlock_t   rx_lock ____cacheline_aligned_in_smp;
>         struct xen_netif_rx_front_ring rx;
>         int rx_ring_ref;
> @@ -126,6 +137,10 @@ struct netfront_info {
>         grant_ref_t gref_rx_head;
>         grant_ref_t grant_rx_ref[NET_RX_RING_SIZE];
> 
> +       struct gnt_list *rx_grant[NET_RX_RING_SIZE];
> +       struct gnt_list *rx_gnt_list;
> +       unsigned int rx_gnt_cnt;

Same comment above here.

> +
>         unsigned long rx_pfn_array[NET_RX_RING_SIZE];
>         struct multicall_entry rx_mcl[NET_RX_RING_SIZE+1];
>         struct mmu_update rx_mmu[NET_RX_RING_SIZE];
> @@ -134,6 +149,7 @@ struct netfront_info {
>         struct netfront_stats __percpu *stats;
> 
>         unsigned long rx_gso_checksum_fixup;
> +       u8 persistent_gnt:1;
>  };
> 
>  struct netfront_rx_info {
> @@ -194,6 +210,16 @@ static grant_ref_t xennet_get_rx_ref(struct netfront_info *np,
>         return ref;
>  }
> 
> +static struct gnt_list *xennet_get_rx_grant(struct netfront_info *np,
> +                                           RING_IDX ri)
> +{
> +       int i = xennet_rxidx(ri);
> +       struct gnt_list *gntlist = np->rx_grant[i];
> +       np->rx_grant[i] = NULL;

Ok, I think I get why do you need both an array and a list, is that
because netfront doesn't have some kind of shadow ring to keep track of
issued requests?

So each issued request has an associated gnt_list with the list of used
grants? If so it would be good to add a comment about it.

> +       return gntlist;
> +}
> +
>  #ifdef CONFIG_SYSFS
>  static int xennet_sysfs_addif(struct net_device *netdev);
>  static void xennet_sysfs_delif(struct net_device *netdev);
> @@ -231,6 +257,68 @@ static void xennet_maybe_wake_tx(struct net_device *dev)
>                 netif_wake_queue(dev);
>  }
> 
> +static grant_ref_t xennet_alloc_rx_ref(struct net_device *dev,
> +                                      unsigned long mfn, void *vaddr,
> +                                      unsigned int id,
> +                                      grant_ref_t ref)
> +{
> +       struct netfront_info *np = netdev_priv(dev);
> +       grant_ref_t gnt_ref;
> +       struct gnt_list *gnt_list_entry;
> +
> +       if (np->persistent_gnt && np->rx_gnt_cnt) {
> +               gnt_list_entry = np->rx_gnt_list;
> +               np->rx_gnt_list = np->rx_gnt_list->tail;
> +               np->rx_gnt_cnt--;
> +
> +               gnt_list_entry->gnt_target = vaddr;
> +               gnt_ref = gnt_list_entry->gref;
> +               np->rx_grant[id] = gnt_list_entry;
> +       } else {
> +               struct page *page;
> +
> +               BUG_ON(!np->persistent_gnt && np->rx_gnt_cnt);
> +               if (!ref)
> +                       gnt_ref =
> +                               gnttab_claim_grant_reference(&np->gref_rx_head);
> +               else
> +                       gnt_ref = ref;
> +               BUG_ON((signed short)gnt_ref < 0);
> +
> +               if (np->persistent_gnt) {

So you are only using persistent grants if the backend also supports
them. Have you benchmarked the performance of a persistent frontend with
a non-persistent backend. In the block case, usign a persistent frontend
with a non-persistent backend let to an overall performance improvement,
so blkfront uses persistent grants even if blkback doesn't support them.
Take a look at the following graph:

http://xenbits.xen.org/people/royger/persistent_grants/nonpers_read.png

> +                       page = alloc_page(GFP_KERNEL);
> +                       if (!page) {
> +                               if (!ref)
> +                                       gnttab_release_grant_reference(
> +                                                       &np->gref_rx_head, ref);
> +                               return -ENOMEM;
> +                       }
> +                       mfn = pfn_to_mfn(page_to_pfn(page));
> +
> +                       gnt_list_entry = kmalloc(sizeof(struct gnt_list),
> +                                                GFP_KERNEL);
> +                       if (!gnt_list_entry) {
> +                               __free_page(page);
> +                               if (!ref)
> +                                       gnttab_release_grant_reference(
> +                                                       &np->gref_rx_head, ref);
> +                               return -ENOMEM;
> +                       }
> +                       gnt_list_entry->gref = gnt_ref;
> +                       gnt_list_entry->gnt_pages = page;
> +                       gnt_list_entry->gnt_target = vaddr;
> +
> +                       np->rx_grant[id] = gnt_list_entry;
> +               }
> +
> +               gnttab_grant_foreign_access_ref(gnt_ref, np->xbdev->otherend_id,
> +                                               mfn, 0);
> +       }
> +       np->grant_rx_ref[id] = gnt_ref;
> +
> +       return gnt_ref;
> +}
> +
>  static void xennet_alloc_rx_buffers(struct net_device *dev)
>  {
>         unsigned short id;
> @@ -240,8 +328,6 @@ static void xennet_alloc_rx_buffers(struct net_device *dev)
>         int i, batch_target, notify;
>         RING_IDX req_prod = np->rx.req_prod_pvt;
>         grant_ref_t ref;
> -       unsigned long pfn;
> -       void *vaddr;
>         struct xen_netif_rx_request *req;
> 
>         if (unlikely(!netif_carrier_ok(dev)))
> @@ -306,19 +392,16 @@ no_skb:
>                 BUG_ON(np->rx_skbs[id]);
>                 np->rx_skbs[id] = skb;
> 
> -               ref = gnttab_claim_grant_reference(&np->gref_rx_head);
> -               BUG_ON((signed short)ref < 0);
> -               np->grant_rx_ref[id] = ref;
> +               page = skb_frag_page(&skb_shinfo(skb)->frags[0]);
> 
> -               pfn = page_to_pfn(skb_frag_page(&skb_shinfo(skb)->frags[0]));
> -               vaddr = page_address(skb_frag_page(&skb_shinfo(skb)->frags[0]));
> +               ref = xennet_alloc_rx_ref(dev, pfn_to_mfn(page_to_pfn(page)),
> +                                         page_address(page), id, 0);
> +               if ((signed short)ref < 0) {
> +                       __skb_queue_tail(&np->rx_batch, skb);
> +                       break;
> +               }
> 
>                 req = RING_GET_REQUEST(&np->rx, req_prod + i);
> -               gnttab_grant_foreign_access_ref(ref,
> -                                               np->xbdev->otherend_id,
> -                                               pfn_to_mfn(pfn),
> -                                               0);
> -
>                 req->id = id;
>                 req->gref = ref;
>         }
> @@ -375,17 +458,30 @@ static void xennet_tx_buf_gc(struct net_device *dev)
> 
>                         id  = txrsp->id;
>                         skb = np->tx_skbs[id].skb;
> -                       if (unlikely(gnttab_query_foreign_access(
> -                               np->grant_tx_ref[id]) != 0)) {
> -                               printk(KERN_ALERT "xennet_tx_buf_gc: warning "
> -                                      "-- grant still in use by backend "
> -                                      "domain.\n");
> -                               BUG();
> +
> +                       if (np->persistent_gnt) {
> +                               struct gnt_list *gnt_list_entry;
> +
> +                               gnt_list_entry = np->tx_grant[id];
> +                               BUG_ON(!gnt_list_entry);
> +
> +                               gnt_list_entry->tail = np->tx_gnt_list;
> +                               np->tx_gnt_list = gnt_list_entry;
> +                               np->tx_gnt_cnt++;
> +                       } else {
> +                               if (unlikely(gnttab_query_foreign_access(
> +                                       np->grant_tx_ref[id]) != 0)) {
> +                                       printk(KERN_ALERT "xennet_tx_buf_gc: warning "
> +                                              "-- grant still in use by backend "
> +                                              "domain.\n");
> +                                       BUG();
> +                               }
> +
> +                               gnttab_end_foreign_access_ref(
> +                                       np->grant_tx_ref[id], GNTMAP_readonly);

If I've read the code correctly, you are giving this frame both
read/write permissions to the other end on xennet_alloc_tx_ref, but then
you are only removing the read permissions? (see comment below on the
xennet_alloc_tx_ref function).

> +                               gnttab_release_grant_reference(
> +                                     &np->gref_tx_head, np->grant_tx_ref[id]);
>                         }
> -                       gnttab_end_foreign_access_ref(
> -                               np->grant_tx_ref[id], GNTMAP_readonly);
> -                       gnttab_release_grant_reference(
> -                               &np->gref_tx_head, np->grant_tx_ref[id]);
>                         np->grant_tx_ref[id] = GRANT_INVALID_REF;
>                         add_id_to_freelist(&np->tx_skb_freelist, np->tx_skbs, id);
>                         dev_kfree_skb_irq(skb);
> @@ -409,6 +505,59 @@ static void xennet_tx_buf_gc(struct net_device *dev)
>         xennet_maybe_wake_tx(dev);
>  }
> 
> +static grant_ref_t xennet_alloc_tx_ref(struct net_device *dev,
> +                                      unsigned long mfn,
> +                                      unsigned int id)
> +{
> +       struct netfront_info *np = netdev_priv(dev);
> +       grant_ref_t ref;
> +       struct page *granted_page;
> +
> +       if (np->persistent_gnt && np->tx_gnt_cnt) {
> +               struct gnt_list *gnt_list_entry;
> +
> +               gnt_list_entry = np->tx_gnt_list;
> +               np->tx_gnt_list = np->tx_gnt_list->tail;
> +               np->tx_gnt_cnt--;
> +
> +               ref = gnt_list_entry->gref;
> +               np->tx_grant[id] = gnt_list_entry;
> +       } else {
> +               struct gnt_list *gnt_list_entry;
> +
> +               BUG_ON(!np->persistent_gnt && np->tx_gnt_cnt);
> +               ref = gnttab_claim_grant_reference(&np->gref_tx_head);
> +               BUG_ON((signed short)ref < 0);
> +
> +               if (np->persistent_gnt) {
> +                       granted_page = alloc_page(GFP_KERNEL);
> +                       if (!granted_page) {
> +                               gnttab_release_grant_reference(
> +                                                       &np->gref_tx_head, ref);
> +                               return -ENOMEM;
> +                       }
> +
> +                       mfn = pfn_to_mfn(page_to_pfn(granted_page));
> +                       gnt_list_entry = kmalloc(sizeof(struct gnt_list),
> +                                                GFP_KERNEL);
> +                       if (!gnt_list_entry) {
> +                               __free_page(granted_page);
> +                               gnttab_release_grant_reference(
> +                                                       &np->gref_tx_head, ref);
> +                               return -ENOMEM;
> +                       }
> +
> +                       gnt_list_entry->gref = ref;
> +                       gnt_list_entry->gnt_pages = granted_page;
> +                       np->tx_grant[id] = gnt_list_entry;
> +               }
> +               gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> +                                               mfn, 0);

If you are not always using persistent grants I guess you need to give
read only permissions to this frame (GNTMAP_readonly). Also, for keeping
things in logical order, isn't it best that this function comes before
xennet_tx_buf_gc?

> +       }
> +
> +       return ref;
> +}
> +
> @@ -1132,8 +1357,10 @@ static void xennet_release_rx_bufs(struct netfront_info *np)
>                 }
> 
>                 skb = np->rx_skbs[id];
> -               mfn = gnttab_end_foreign_transfer_ref(ref);
> -               gnttab_release_grant_reference(&np->gref_rx_head, ref);
> +               if (!np->persistent_gnt) {
> +                       mfn = gnttab_end_foreign_transfer_ref(ref);
> +                       gnttab_release_grant_reference(&np->gref_rx_head, ref);
> +               }
>                 np->grant_rx_ref[id] = GRANT_INVALID_REF;
> 
>                 if (0 == mfn) {
> @@ -1607,6 +1834,13 @@ again:
>                 goto abort_transaction;
>         }
> 
> +       err = xenbus_printf(xbt, dev->nodename, "feature-persistent-grants",
> +                           "%u", info->persistent_gnt);

As in netback, I think "feature-persistent" should be used.

> +       if (err) {
> +               message = "writing feature-persistent-grants";
> +               xenbus_dev_fatal(dev, err, "%s", message);
> +       }
> +
>         err = xenbus_transaction_end(xbt, 0);
>         if (err) {
>                 if (err == -EAGAIN)
> @@ -1634,6 +1868,7 @@ static int xennet_connect(struct net_device *dev)
>         grant_ref_t ref;
>         struct xen_netif_rx_request *req;
>         unsigned int feature_rx_copy;
> +       int ret, val;
> 
>         err = xenbus_scanf(XBT_NIL, np->xbdev->otherend,
>                            "feature-rx-copy", "%u", &feature_rx_copy);
> @@ -1646,6 +1881,13 @@ static int xennet_connect(struct net_device *dev)
>                 return -ENODEV;
>         }
> 
> +       err = xenbus_scanf(XBT_NIL, np->xbdev->otherend,
> +                          "feature-persistent-grants", "%u", &val);
> +       if (err != 1)
> +               val = 0;
> +
> +       np->persistent_gnt = !!val;
> +
>         err = talk_to_netback(np->xbdev, np);
>         if (err)
>                 return err;
> @@ -1657,9 +1899,24 @@ static int xennet_connect(struct net_device *dev)
>         spin_lock_bh(&np->rx_lock);
>         spin_lock_irq(&np->tx_lock);
> 
> +       np->tx_gnt_cnt = 0;
> +       np->rx_gnt_cnt = 0;
> +
>         /* Step 1: Discard all pending TX packet fragments. */
>         xennet_release_tx_bufs(np);
> 
> +       if (np->persistent_gnt) {
> +               struct gnt_list *gnt_list_entry;
> +
> +               while (np->rx_gnt_list) {
> +                       gnt_list_entry = np->rx_gnt_list;
> +                       np->rx_gnt_list = np->rx_gnt_list->tail;
> +                       gnttab_end_foreign_access(gnt_list_entry->gref, 0, 0UL);
> +                       __free_page(gnt_list_entry->gnt_pages);
> +                       kfree(gnt_list_entry);
> +               }
> +       }
> +
>         /* Step 2: Rebuild the RX buffer freelist and the RX ring itself. */
>         for (requeue_idx = 0, i = 0; i < NET_RX_RING_SIZE; i++) {
>                 skb_frag_t *frag;
> @@ -1673,10 +1930,11 @@ static int xennet_connect(struct net_device *dev)
> 
>                 frag = &skb_shinfo(skb)->frags[0];
>                 page = skb_frag_page(frag);
> -               gnttab_grant_foreign_access_ref(
> -                       ref, np->xbdev->otherend_id,
> -                       pfn_to_mfn(page_to_pfn(page)),
> -                       0);
> +               ret = xennet_alloc_rx_ref(dev, pfn_to_mfn(page_to_pfn(page)),
> +                                         page_address(page), requeue_idx, ref);
> +               if ((signed short)ret < 0)
> +                       break;
> +
>                 req->gref = ref;
>                 req->id   = requeue_idx;
> 
> --
> 1.7.3.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:53:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:53:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYx47-0001mD-Hu; Thu, 15 Nov 2012 10:52:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TYx45-0001m7-OG
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:52:58 +0000
Received: from [85.158.143.99:40669] by server-3.bemta-4.messagelabs.com id
	D1/6F-06841-989C4A05; Thu, 15 Nov 2012 10:52:57 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352976776!26663358!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22164 invoked from network); 15 Nov 2012 10:52:56 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:52:56 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15823755"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:52:56 +0000
Received: from [192.168.1.30] (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:52:55 +0000
Message-ID: <50A4C987.3020308@citrix.com>
Date: Thu, 15 Nov 2012 11:52:55 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Annie Li <annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963114-628-1-git-send-email-annie.li@oracle.com>
In-Reply-To: <1352963114-628-1-git-send-email-annie.li@oracle.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 3/4] Xen/netfront: Implement persistent
 grant in netfront.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 15/11/12 08:05, Annie Li wrote:
> Tx/rx page pool are maintained. New grant is mapped and put into
> pool, unmap only happens when releasing/removing device.
> 
> Signed-off-by: Annie Li <annie.li@oracle.com>
> ---
>  drivers/net/xen-netfront.c |  372 +++++++++++++++++++++++++++++++++++++-------
>  1 files changed, 315 insertions(+), 57 deletions(-)
> 
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index 0ebbb19..17b81c0 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -79,6 +79,13 @@ struct netfront_stats {
>         struct u64_stats_sync   syncp;
>  };
> 
> +struct gnt_list {
> +       grant_ref_t             gref;
> +       struct                  page *gnt_pages;
> +       void                    *gnt_target;
> +       struct                  gnt_list *tail;
> +};

This could also be shared with blkfront.

> +
>  struct netfront_info {
>         struct list_head list;
>         struct net_device *netdev;
> @@ -109,6 +116,10 @@ struct netfront_info {
>         grant_ref_t grant_tx_ref[NET_TX_RING_SIZE];
>         unsigned tx_skb_freelist;
> 
> +       struct gnt_list *tx_grant[NET_TX_RING_SIZE];
> +       struct gnt_list *tx_gnt_list;
> +       unsigned int tx_gnt_cnt;

I don't understand this, why do you need both an array and a list? I'm
not familiar with net code, so I don't know if this is some kind of
special netfront thing?

Anyway if you have to use a list I would recommend using one of the list
constructions that's already in the kernel, it simplifies the code and
makes it more easy to understand than creating your own list structure.

> +
>         spinlock_t   rx_lock ____cacheline_aligned_in_smp;
>         struct xen_netif_rx_front_ring rx;
>         int rx_ring_ref;
> @@ -126,6 +137,10 @@ struct netfront_info {
>         grant_ref_t gref_rx_head;
>         grant_ref_t grant_rx_ref[NET_RX_RING_SIZE];
> 
> +       struct gnt_list *rx_grant[NET_RX_RING_SIZE];
> +       struct gnt_list *rx_gnt_list;
> +       unsigned int rx_gnt_cnt;

Same comment above here.

> +
>         unsigned long rx_pfn_array[NET_RX_RING_SIZE];
>         struct multicall_entry rx_mcl[NET_RX_RING_SIZE+1];
>         struct mmu_update rx_mmu[NET_RX_RING_SIZE];
> @@ -134,6 +149,7 @@ struct netfront_info {
>         struct netfront_stats __percpu *stats;
> 
>         unsigned long rx_gso_checksum_fixup;
> +       u8 persistent_gnt:1;
>  };
> 
>  struct netfront_rx_info {
> @@ -194,6 +210,16 @@ static grant_ref_t xennet_get_rx_ref(struct netfront_info *np,
>         return ref;
>  }
> 
> +static struct gnt_list *xennet_get_rx_grant(struct netfront_info *np,
> +                                           RING_IDX ri)
> +{
> +       int i = xennet_rxidx(ri);
> +       struct gnt_list *gntlist = np->rx_grant[i];
> +       np->rx_grant[i] = NULL;

Ok, I think I get why do you need both an array and a list, is that
because netfront doesn't have some kind of shadow ring to keep track of
issued requests?

So each issued request has an associated gnt_list with the list of used
grants? If so it would be good to add a comment about it.

> +       return gntlist;
> +}
> +
>  #ifdef CONFIG_SYSFS
>  static int xennet_sysfs_addif(struct net_device *netdev);
>  static void xennet_sysfs_delif(struct net_device *netdev);
> @@ -231,6 +257,68 @@ static void xennet_maybe_wake_tx(struct net_device *dev)
>                 netif_wake_queue(dev);
>  }
> 
> +static grant_ref_t xennet_alloc_rx_ref(struct net_device *dev,
> +                                      unsigned long mfn, void *vaddr,
> +                                      unsigned int id,
> +                                      grant_ref_t ref)
> +{
> +       struct netfront_info *np = netdev_priv(dev);
> +       grant_ref_t gnt_ref;
> +       struct gnt_list *gnt_list_entry;
> +
> +       if (np->persistent_gnt && np->rx_gnt_cnt) {
> +               gnt_list_entry = np->rx_gnt_list;
> +               np->rx_gnt_list = np->rx_gnt_list->tail;
> +               np->rx_gnt_cnt--;
> +
> +               gnt_list_entry->gnt_target = vaddr;
> +               gnt_ref = gnt_list_entry->gref;
> +               np->rx_grant[id] = gnt_list_entry;
> +       } else {
> +               struct page *page;
> +
> +               BUG_ON(!np->persistent_gnt && np->rx_gnt_cnt);
> +               if (!ref)
> +                       gnt_ref =
> +                               gnttab_claim_grant_reference(&np->gref_rx_head);
> +               else
> +                       gnt_ref = ref;
> +               BUG_ON((signed short)gnt_ref < 0);
> +
> +               if (np->persistent_gnt) {

So you are only using persistent grants if the backend also supports
them. Have you benchmarked the performance of a persistent frontend with
a non-persistent backend. In the block case, usign a persistent frontend
with a non-persistent backend let to an overall performance improvement,
so blkfront uses persistent grants even if blkback doesn't support them.
Take a look at the following graph:

http://xenbits.xen.org/people/royger/persistent_grants/nonpers_read.png

> +                       page = alloc_page(GFP_KERNEL);
> +                       if (!page) {
> +                               if (!ref)
> +                                       gnttab_release_grant_reference(
> +                                                       &np->gref_rx_head, ref);
> +                               return -ENOMEM;
> +                       }
> +                       mfn = pfn_to_mfn(page_to_pfn(page));
> +
> +                       gnt_list_entry = kmalloc(sizeof(struct gnt_list),
> +                                                GFP_KERNEL);
> +                       if (!gnt_list_entry) {
> +                               __free_page(page);
> +                               if (!ref)
> +                                       gnttab_release_grant_reference(
> +                                                       &np->gref_rx_head, ref);
> +                               return -ENOMEM;
> +                       }
> +                       gnt_list_entry->gref = gnt_ref;
> +                       gnt_list_entry->gnt_pages = page;
> +                       gnt_list_entry->gnt_target = vaddr;
> +
> +                       np->rx_grant[id] = gnt_list_entry;
> +               }
> +
> +               gnttab_grant_foreign_access_ref(gnt_ref, np->xbdev->otherend_id,
> +                                               mfn, 0);
> +       }
> +       np->grant_rx_ref[id] = gnt_ref;
> +
> +       return gnt_ref;
> +}
> +
>  static void xennet_alloc_rx_buffers(struct net_device *dev)
>  {
>         unsigned short id;
> @@ -240,8 +328,6 @@ static void xennet_alloc_rx_buffers(struct net_device *dev)
>         int i, batch_target, notify;
>         RING_IDX req_prod = np->rx.req_prod_pvt;
>         grant_ref_t ref;
> -       unsigned long pfn;
> -       void *vaddr;
>         struct xen_netif_rx_request *req;
> 
>         if (unlikely(!netif_carrier_ok(dev)))
> @@ -306,19 +392,16 @@ no_skb:
>                 BUG_ON(np->rx_skbs[id]);
>                 np->rx_skbs[id] = skb;
> 
> -               ref = gnttab_claim_grant_reference(&np->gref_rx_head);
> -               BUG_ON((signed short)ref < 0);
> -               np->grant_rx_ref[id] = ref;
> +               page = skb_frag_page(&skb_shinfo(skb)->frags[0]);
> 
> -               pfn = page_to_pfn(skb_frag_page(&skb_shinfo(skb)->frags[0]));
> -               vaddr = page_address(skb_frag_page(&skb_shinfo(skb)->frags[0]));
> +               ref = xennet_alloc_rx_ref(dev, pfn_to_mfn(page_to_pfn(page)),
> +                                         page_address(page), id, 0);
> +               if ((signed short)ref < 0) {
> +                       __skb_queue_tail(&np->rx_batch, skb);
> +                       break;
> +               }
> 
>                 req = RING_GET_REQUEST(&np->rx, req_prod + i);
> -               gnttab_grant_foreign_access_ref(ref,
> -                                               np->xbdev->otherend_id,
> -                                               pfn_to_mfn(pfn),
> -                                               0);
> -
>                 req->id = id;
>                 req->gref = ref;
>         }
> @@ -375,17 +458,30 @@ static void xennet_tx_buf_gc(struct net_device *dev)
> 
>                         id  = txrsp->id;
>                         skb = np->tx_skbs[id].skb;
> -                       if (unlikely(gnttab_query_foreign_access(
> -                               np->grant_tx_ref[id]) != 0)) {
> -                               printk(KERN_ALERT "xennet_tx_buf_gc: warning "
> -                                      "-- grant still in use by backend "
> -                                      "domain.\n");
> -                               BUG();
> +
> +                       if (np->persistent_gnt) {
> +                               struct gnt_list *gnt_list_entry;
> +
> +                               gnt_list_entry = np->tx_grant[id];
> +                               BUG_ON(!gnt_list_entry);
> +
> +                               gnt_list_entry->tail = np->tx_gnt_list;
> +                               np->tx_gnt_list = gnt_list_entry;
> +                               np->tx_gnt_cnt++;
> +                       } else {
> +                               if (unlikely(gnttab_query_foreign_access(
> +                                       np->grant_tx_ref[id]) != 0)) {
> +                                       printk(KERN_ALERT "xennet_tx_buf_gc: warning "
> +                                              "-- grant still in use by backend "
> +                                              "domain.\n");
> +                                       BUG();
> +                               }
> +
> +                               gnttab_end_foreign_access_ref(
> +                                       np->grant_tx_ref[id], GNTMAP_readonly);

If I've read the code correctly, you are giving this frame both
read/write permissions to the other end on xennet_alloc_tx_ref, but then
you are only removing the read permissions? (see comment below on the
xennet_alloc_tx_ref function).

> +                               gnttab_release_grant_reference(
> +                                     &np->gref_tx_head, np->grant_tx_ref[id]);
>                         }
> -                       gnttab_end_foreign_access_ref(
> -                               np->grant_tx_ref[id], GNTMAP_readonly);
> -                       gnttab_release_grant_reference(
> -                               &np->gref_tx_head, np->grant_tx_ref[id]);
>                         np->grant_tx_ref[id] = GRANT_INVALID_REF;
>                         add_id_to_freelist(&np->tx_skb_freelist, np->tx_skbs, id);
>                         dev_kfree_skb_irq(skb);
> @@ -409,6 +505,59 @@ static void xennet_tx_buf_gc(struct net_device *dev)
>         xennet_maybe_wake_tx(dev);
>  }
> 
> +static grant_ref_t xennet_alloc_tx_ref(struct net_device *dev,
> +                                      unsigned long mfn,
> +                                      unsigned int id)
> +{
> +       struct netfront_info *np = netdev_priv(dev);
> +       grant_ref_t ref;
> +       struct page *granted_page;
> +
> +       if (np->persistent_gnt && np->tx_gnt_cnt) {
> +               struct gnt_list *gnt_list_entry;
> +
> +               gnt_list_entry = np->tx_gnt_list;
> +               np->tx_gnt_list = np->tx_gnt_list->tail;
> +               np->tx_gnt_cnt--;
> +
> +               ref = gnt_list_entry->gref;
> +               np->tx_grant[id] = gnt_list_entry;
> +       } else {
> +               struct gnt_list *gnt_list_entry;
> +
> +               BUG_ON(!np->persistent_gnt && np->tx_gnt_cnt);
> +               ref = gnttab_claim_grant_reference(&np->gref_tx_head);
> +               BUG_ON((signed short)ref < 0);
> +
> +               if (np->persistent_gnt) {
> +                       granted_page = alloc_page(GFP_KERNEL);
> +                       if (!granted_page) {
> +                               gnttab_release_grant_reference(
> +                                                       &np->gref_tx_head, ref);
> +                               return -ENOMEM;
> +                       }
> +
> +                       mfn = pfn_to_mfn(page_to_pfn(granted_page));
> +                       gnt_list_entry = kmalloc(sizeof(struct gnt_list),
> +                                                GFP_KERNEL);
> +                       if (!gnt_list_entry) {
> +                               __free_page(granted_page);
> +                               gnttab_release_grant_reference(
> +                                                       &np->gref_tx_head, ref);
> +                               return -ENOMEM;
> +                       }
> +
> +                       gnt_list_entry->gref = ref;
> +                       gnt_list_entry->gnt_pages = granted_page;
> +                       np->tx_grant[id] = gnt_list_entry;
> +               }
> +               gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> +                                               mfn, 0);

If you are not always using persistent grants I guess you need to give
read only permissions to this frame (GNTMAP_readonly). Also, for keeping
things in logical order, isn't it best that this function comes before
xennet_tx_buf_gc?

> +       }
> +
> +       return ref;
> +}
> +
> @@ -1132,8 +1357,10 @@ static void xennet_release_rx_bufs(struct netfront_info *np)
>                 }
> 
>                 skb = np->rx_skbs[id];
> -               mfn = gnttab_end_foreign_transfer_ref(ref);
> -               gnttab_release_grant_reference(&np->gref_rx_head, ref);
> +               if (!np->persistent_gnt) {
> +                       mfn = gnttab_end_foreign_transfer_ref(ref);
> +                       gnttab_release_grant_reference(&np->gref_rx_head, ref);
> +               }
>                 np->grant_rx_ref[id] = GRANT_INVALID_REF;
> 
>                 if (0 == mfn) {
> @@ -1607,6 +1834,13 @@ again:
>                 goto abort_transaction;
>         }
> 
> +       err = xenbus_printf(xbt, dev->nodename, "feature-persistent-grants",
> +                           "%u", info->persistent_gnt);

As in netback, I think "feature-persistent" should be used.

> +       if (err) {
> +               message = "writing feature-persistent-grants";
> +               xenbus_dev_fatal(dev, err, "%s", message);
> +       }
> +
>         err = xenbus_transaction_end(xbt, 0);
>         if (err) {
>                 if (err == -EAGAIN)
> @@ -1634,6 +1868,7 @@ static int xennet_connect(struct net_device *dev)
>         grant_ref_t ref;
>         struct xen_netif_rx_request *req;
>         unsigned int feature_rx_copy;
> +       int ret, val;
> 
>         err = xenbus_scanf(XBT_NIL, np->xbdev->otherend,
>                            "feature-rx-copy", "%u", &feature_rx_copy);
> @@ -1646,6 +1881,13 @@ static int xennet_connect(struct net_device *dev)
>                 return -ENODEV;
>         }
> 
> +       err = xenbus_scanf(XBT_NIL, np->xbdev->otherend,
> +                          "feature-persistent-grants", "%u", &val);
> +       if (err != 1)
> +               val = 0;
> +
> +       np->persistent_gnt = !!val;
> +
>         err = talk_to_netback(np->xbdev, np);
>         if (err)
>                 return err;
> @@ -1657,9 +1899,24 @@ static int xennet_connect(struct net_device *dev)
>         spin_lock_bh(&np->rx_lock);
>         spin_lock_irq(&np->tx_lock);
> 
> +       np->tx_gnt_cnt = 0;
> +       np->rx_gnt_cnt = 0;
> +
>         /* Step 1: Discard all pending TX packet fragments. */
>         xennet_release_tx_bufs(np);
> 
> +       if (np->persistent_gnt) {
> +               struct gnt_list *gnt_list_entry;
> +
> +               while (np->rx_gnt_list) {
> +                       gnt_list_entry = np->rx_gnt_list;
> +                       np->rx_gnt_list = np->rx_gnt_list->tail;
> +                       gnttab_end_foreign_access(gnt_list_entry->gref, 0, 0UL);
> +                       __free_page(gnt_list_entry->gnt_pages);
> +                       kfree(gnt_list_entry);
> +               }
> +       }
> +
>         /* Step 2: Rebuild the RX buffer freelist and the RX ring itself. */
>         for (requeue_idx = 0, i = 0; i < NET_RX_RING_SIZE; i++) {
>                 skb_frag_t *frag;
> @@ -1673,10 +1930,11 @@ static int xennet_connect(struct net_device *dev)
> 
>                 frag = &skb_shinfo(skb)->frags[0];
>                 page = skb_frag_page(frag);
> -               gnttab_grant_foreign_access_ref(
> -                       ref, np->xbdev->otherend_id,
> -                       pfn_to_mfn(page_to_pfn(page)),
> -                       0);
> +               ret = xennet_alloc_rx_ref(dev, pfn_to_mfn(page_to_pfn(page)),
> +                                         page_address(page), requeue_idx, ref);
> +               if ((signed short)ret < 0)
> +                       break;
> +
>                 req->gref = ref;
>                 req->id   = requeue_idx;
> 
> --
> 1.7.3.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:56:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:56:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYx7O-0001vC-As; Thu, 15 Nov 2012 10:56:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TYx7M-0001v6-OI
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:56:20 +0000
Received: from [193.109.254.147:43421] by server-16.bemta-14.messagelabs.com
	id AE/4B-09215-45AC4A05; Thu, 15 Nov 2012 10:56:20 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352976979!3114420!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8964 invoked from network); 15 Nov 2012 10:56:19 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:56:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15823871"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:56:19 +0000
Received: from [192.168.1.30] (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:56:18 +0000
Message-ID: <50A4CA51.8080208@citrix.com>
Date: Thu, 15 Nov 2012 11:56:17 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: ANNIE LI <annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
In-Reply-To: <50A4AA06.8080900@oracle.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 15/11/12 09:38, ANNIE LI wrote:
> =

> =

> On 2012-11-15 15:40, Pasi K=E4rkk=E4inen wrote:
>> Hello,
>>
>> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
>>> This patch implements persistent grants for xen-netfront/netback. This
>>> mechanism maintains page pools in netback/netfront, these page pools is=
 used to
>>> save grant pages which are mapped. This way improve performance which i=
s wasted
>>> when doing grant operations.
>>>
>>> Current netback/netfront does map/unmap grant operations frequently when
>>> transmitting/receiving packets, and grant operations costs much cpu clo=
ck. In
>>> this patch, netfront/netback maps grant pages when needed and then save=
s them
>>> into a page pool for future use. All these pages will be unmapped when
>>> removing/releasing the net device.
>>>
>> Do you have performance numbers available already? with/without persiste=
nt grants?
> I have some simple netperf/netserver test result with/without persistent =

> grants,
> =

> Following is result of with persistent grant patch,
> =

> Guests, Sum,      Avg,     Min,     Max
>   1,  15106.4,  15106.4, 15106.36, 15106.36
>   2,  13052.7,  6526.34,  6261.81,  6790.86
>   3,  12675.1,  6337.53,  6220.24,  6454.83
>   4,  13194,  6596.98,  6274.70,  6919.25
> =

> =

> Following are result of without persistent patch
> =

> Guests, Sum,     Avg,    Min,        Max
>   1,  10864.1,  10864.1, 10864.10, 10864.10
>   2,  10898.5,  5449.24,  4862.08,  6036.40
>   3,  10734.5,  5367.26,  5261.43,  5473.08
>   4,  10924,    5461.99,  5314.84,  5609.14

In the block case, performance improvement is seen when using a large
number of guests, could you perform the same benchmark increasing the
number of guests to 15?


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 10:56:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 10:56:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYx7O-0001vC-As; Thu, 15 Nov 2012 10:56:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TYx7M-0001v6-OI
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:56:20 +0000
Received: from [193.109.254.147:43421] by server-16.bemta-14.messagelabs.com
	id AE/4B-09215-45AC4A05; Thu, 15 Nov 2012 10:56:20 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352976979!3114420!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8964 invoked from network); 15 Nov 2012 10:56:19 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 10:56:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15823871"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 10:56:19 +0000
Received: from [192.168.1.30] (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:56:18 +0000
Message-ID: <50A4CA51.8080208@citrix.com>
Date: Thu, 15 Nov 2012 11:56:17 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: ANNIE LI <annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
In-Reply-To: <50A4AA06.8080900@oracle.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 15/11/12 09:38, ANNIE LI wrote:
> =

> =

> On 2012-11-15 15:40, Pasi K=E4rkk=E4inen wrote:
>> Hello,
>>
>> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
>>> This patch implements persistent grants for xen-netfront/netback. This
>>> mechanism maintains page pools in netback/netfront, these page pools is=
 used to
>>> save grant pages which are mapped. This way improve performance which i=
s wasted
>>> when doing grant operations.
>>>
>>> Current netback/netfront does map/unmap grant operations frequently when
>>> transmitting/receiving packets, and grant operations costs much cpu clo=
ck. In
>>> this patch, netfront/netback maps grant pages when needed and then save=
s them
>>> into a page pool for future use. All these pages will be unmapped when
>>> removing/releasing the net device.
>>>
>> Do you have performance numbers available already? with/without persiste=
nt grants?
> I have some simple netperf/netserver test result with/without persistent =

> grants,
> =

> Following is result of with persistent grant patch,
> =

> Guests, Sum,      Avg,     Min,     Max
>   1,  15106.4,  15106.4, 15106.36, 15106.36
>   2,  13052.7,  6526.34,  6261.81,  6790.86
>   3,  12675.1,  6337.53,  6220.24,  6454.83
>   4,  13194,  6596.98,  6274.70,  6919.25
> =

> =

> Following are result of without persistent patch
> =

> Guests, Sum,     Avg,    Min,        Max
>   1,  10864.1,  10864.1, 10864.10, 10864.10
>   2,  10898.5,  5449.24,  4862.08,  6036.40
>   3,  10734.5,  5367.26,  5261.43,  5473.08
>   4,  10924,    5461.99,  5314.84,  5609.14

In the block case, performance improvement is seen when using a large
number of guests, could you perform the same benchmark increasing the
number of guests to 15?


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 11:13:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 11:13:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYxNE-0002QL-27; Thu, 15 Nov 2012 11:12:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYxNC-0002QG-OH
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 11:12:42 +0000
Received: from [85.158.137.99:13407] by server-12.bemta-3.messagelabs.com id
	4A/16-22757-92EC4A05; Thu, 15 Nov 2012 11:12:41 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1352977959!17525199!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTUyOTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22679 invoked from network); 15 Nov 2012 11:12:40 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-10.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 11:12:40 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFBCaD9007520
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 11:12:37 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFBCZ2p025644
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 11:12:35 GMT
Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFBCYJv031171; Thu, 15 Nov 2012 05:12:34 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 03:12:34 -0800
Message-ID: <50A4CE23.40804@oracle.com>
Date: Thu, 15 Nov 2012 19:12:35 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Wei Liu <liuw@liuw.name>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
	<CAOsiSVU+9fkGQhVhnrx=xxUD8hej55XXJGpKGWAxe1USPEhiEQ@mail.gmail.com>
In-Reply-To: <CAOsiSVU+9fkGQhVhnrx=xxUD8hej55XXJGpKGWAxe1USPEhiEQ@mail.gmail.com>
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: netdev@vger.kernel.org,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-15 17:35, Wei Liu wrote:
>
> On Thu, Nov 15, 2012 at 4:38 PM, ANNIE LI <annie.li@oracle.com =

> <mailto:annie.li@oracle.com>> wrote:
>
>
>
>     On 2012-11-15 15:40, Pasi K=E4rkk=E4inen wrote:
>
>         Hello,
>
>         On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
>
>             This patch implements persistent grants for
>             xen-netfront/netback. This
>             mechanism maintains page pools in netback/netfront, these
>             page pools is used to
>             save grant pages which are mapped. This way improve
>             performance which is wasted
>             when doing grant operations.
>
>             Current netback/netfront does map/unmap grant operations
>             frequently when
>             transmitting/receiving packets, and grant operations costs
>             much cpu clock. In
>             this patch, netfront/netback maps grant pages when needed
>             and then saves them
>             into a page pool for future use. All these pages will be
>             unmapped when
>             removing/releasing the net device.
>
>         Do you have performance numbers available already?
>         with/without persistent grants?
>
>     I have some simple netperf/netserver test result with/without
>     persistent grants,
>
>     Following is result of with persistent grant patch,
>
>     Guests, Sum,      Avg,     Min,     Max
>      1,  15106.4,  15106.4, 15106.36, 15106.36
>      2,  13052.7,  6526.34,  6261.81,  6790.86
>      3,  12675.1,  6337.53,  6220.24,  6454.83
>      4,  13194,  6596.98,  6274.70,  6919.25
>
>
>     Following are result of without persistent patch
>
>     Guests, Sum,     Avg,    Min,        Max
>      1,  10864.1,  10864.1, 10864.10, 10864.10
>      2,  10898.5,  5449.24,  4862.08,  6036.40
>      3,  10734.5,  5367.26,  5261.43,  5473.08
>      4,  10924,    5461.99,  5314.84,  5609.14
>
>
>
> Interesting results. Have you tested how good it is on a 10G nic, i.e. =

> guest sending packets
> through physical network to another host.
Not yet.

Thanks
Annie
>
>
> Wei.
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 11:13:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 11:13:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYxNE-0002QL-27; Thu, 15 Nov 2012 11:12:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYxNC-0002QG-OH
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 11:12:42 +0000
Received: from [85.158.137.99:13407] by server-12.bemta-3.messagelabs.com id
	4A/16-22757-92EC4A05; Thu, 15 Nov 2012 11:12:41 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1352977959!17525199!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTUyOTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22679 invoked from network); 15 Nov 2012 11:12:40 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-10.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 11:12:40 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFBCaD9007520
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 11:12:37 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFBCZ2p025644
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 11:12:35 GMT
Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFBCYJv031171; Thu, 15 Nov 2012 05:12:34 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 03:12:34 -0800
Message-ID: <50A4CE23.40804@oracle.com>
Date: Thu, 15 Nov 2012 19:12:35 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Wei Liu <liuw@liuw.name>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
	<CAOsiSVU+9fkGQhVhnrx=xxUD8hej55XXJGpKGWAxe1USPEhiEQ@mail.gmail.com>
In-Reply-To: <CAOsiSVU+9fkGQhVhnrx=xxUD8hej55XXJGpKGWAxe1USPEhiEQ@mail.gmail.com>
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: netdev@vger.kernel.org,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-15 17:35, Wei Liu wrote:
>
> On Thu, Nov 15, 2012 at 4:38 PM, ANNIE LI <annie.li@oracle.com =

> <mailto:annie.li@oracle.com>> wrote:
>
>
>
>     On 2012-11-15 15:40, Pasi K=E4rkk=E4inen wrote:
>
>         Hello,
>
>         On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
>
>             This patch implements persistent grants for
>             xen-netfront/netback. This
>             mechanism maintains page pools in netback/netfront, these
>             page pools is used to
>             save grant pages which are mapped. This way improve
>             performance which is wasted
>             when doing grant operations.
>
>             Current netback/netfront does map/unmap grant operations
>             frequently when
>             transmitting/receiving packets, and grant operations costs
>             much cpu clock. In
>             this patch, netfront/netback maps grant pages when needed
>             and then saves them
>             into a page pool for future use. All these pages will be
>             unmapped when
>             removing/releasing the net device.
>
>         Do you have performance numbers available already?
>         with/without persistent grants?
>
>     I have some simple netperf/netserver test result with/without
>     persistent grants,
>
>     Following is result of with persistent grant patch,
>
>     Guests, Sum,      Avg,     Min,     Max
>      1,  15106.4,  15106.4, 15106.36, 15106.36
>      2,  13052.7,  6526.34,  6261.81,  6790.86
>      3,  12675.1,  6337.53,  6220.24,  6454.83
>      4,  13194,  6596.98,  6274.70,  6919.25
>
>
>     Following are result of without persistent patch
>
>     Guests, Sum,     Avg,    Min,        Max
>      1,  10864.1,  10864.1, 10864.10, 10864.10
>      2,  10898.5,  5449.24,  4862.08,  6036.40
>      3,  10734.5,  5367.26,  5261.43,  5473.08
>      4,  10924,    5461.99,  5314.84,  5609.14
>
>
>
> Interesting results. Have you tested how good it is on a 10G nic, i.e. =

> guest sending packets
> through physical network to another host.
Not yet.

Thanks
Annie
>
>
> Wei.
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 11:14:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 11:14:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYxOv-0002W2-Vw; Thu, 15 Nov 2012 11:14:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYxOu-0002Vq-TH
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 11:14:29 +0000
Received: from [85.158.143.35:33590] by server-3.bemta-4.messagelabs.com id
	2B/9C-06841-49EC4A05; Thu, 15 Nov 2012 11:14:28 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1352978064!6697748!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8261 invoked from network); 15 Nov 2012 11:14:26 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-5.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 11:14:26 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFBEDdk028924
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 11:14:13 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFBECD4028448
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 11:14:12 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFBEBLX004841; Thu, 15 Nov 2012 05:14:11 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 03:14:11 -0800
Message-ID: <50A4CE84.6090802@oracle.com>
Date: Thu, 15 Nov 2012 19:14:12 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net>
	<50A4AA06.8080900@oracle.com> <50A4CA51.8080208@citrix.com>
In-Reply-To: <50A4CA51.8080208@citrix.com>
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-15 18:56, Roger Pau Monn=E9 wrote:
> On 15/11/12 09:38, ANNIE LI wrote:
>>
>> On 2012-11-15 15:40, Pasi K=E4rkk=E4inen wrote:
>>> Hello,
>>>
>>> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
>>>> This patch implements persistent grants for xen-netfront/netback. This
>>>> mechanism maintains page pools in netback/netfront, these page pools i=
s used to
>>>> save grant pages which are mapped. This way improve performance which =
is wasted
>>>> when doing grant operations.
>>>>
>>>> Current netback/netfront does map/unmap grant operations frequently wh=
en
>>>> transmitting/receiving packets, and grant operations costs much cpu cl=
ock. In
>>>> this patch, netfront/netback maps grant pages when needed and then sav=
es them
>>>> into a page pool for future use. All these pages will be unmapped when
>>>> removing/releasing the net device.
>>>>
>>> Do you have performance numbers available already? with/without persist=
ent grants?
>> I have some simple netperf/netserver test result with/without persistent
>> grants,
>>
>> Following is result of with persistent grant patch,
>>
>> Guests, Sum,      Avg,     Min,     Max
>>    1,  15106.4,  15106.4, 15106.36, 15106.36
>>    2,  13052.7,  6526.34,  6261.81,  6790.86
>>    3,  12675.1,  6337.53,  6220.24,  6454.83
>>    4,  13194,  6596.98,  6274.70,  6919.25
>>
>>
>> Following are result of without persistent patch
>>
>> Guests, Sum,     Avg,    Min,        Max
>>    1,  10864.1,  10864.1, 10864.10, 10864.10
>>    2,  10898.5,  5449.24,  4862.08,  6036.40
>>    3,  10734.5,  5367.26,  5261.43,  5473.08
>>    4,  10924,    5461.99,  5314.84,  5609.14
> In the block case, performance improvement is seen when using a large
> number of guests, could you perform the same benchmark increasing the
> number of guests to 15?
Sure, but my current local environment does not meet such test =

requirement, let me find an environment and then start such test.

Thanks
Annie
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 11:14:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 11:14:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYxOv-0002W2-Vw; Thu, 15 Nov 2012 11:14:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYxOu-0002Vq-TH
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 11:14:29 +0000
Received: from [85.158.143.35:33590] by server-3.bemta-4.messagelabs.com id
	2B/9C-06841-49EC4A05; Thu, 15 Nov 2012 11:14:28 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1352978064!6697748!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8261 invoked from network); 15 Nov 2012 11:14:26 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-5.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 11:14:26 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFBEDdk028924
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 11:14:13 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFBECD4028448
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 11:14:12 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFBEBLX004841; Thu, 15 Nov 2012 05:14:11 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 03:14:11 -0800
Message-ID: <50A4CE84.6090802@oracle.com>
Date: Thu, 15 Nov 2012 19:14:12 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net>
	<50A4AA06.8080900@oracle.com> <50A4CA51.8080208@citrix.com>
In-Reply-To: <50A4CA51.8080208@citrix.com>
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-15 18:56, Roger Pau Monn=E9 wrote:
> On 15/11/12 09:38, ANNIE LI wrote:
>>
>> On 2012-11-15 15:40, Pasi K=E4rkk=E4inen wrote:
>>> Hello,
>>>
>>> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
>>>> This patch implements persistent grants for xen-netfront/netback. This
>>>> mechanism maintains page pools in netback/netfront, these page pools i=
s used to
>>>> save grant pages which are mapped. This way improve performance which =
is wasted
>>>> when doing grant operations.
>>>>
>>>> Current netback/netfront does map/unmap grant operations frequently wh=
en
>>>> transmitting/receiving packets, and grant operations costs much cpu cl=
ock. In
>>>> this patch, netfront/netback maps grant pages when needed and then sav=
es them
>>>> into a page pool for future use. All these pages will be unmapped when
>>>> removing/releasing the net device.
>>>>
>>> Do you have performance numbers available already? with/without persist=
ent grants?
>> I have some simple netperf/netserver test result with/without persistent
>> grants,
>>
>> Following is result of with persistent grant patch,
>>
>> Guests, Sum,      Avg,     Min,     Max
>>    1,  15106.4,  15106.4, 15106.36, 15106.36
>>    2,  13052.7,  6526.34,  6261.81,  6790.86
>>    3,  12675.1,  6337.53,  6220.24,  6454.83
>>    4,  13194,  6596.98,  6274.70,  6919.25
>>
>>
>> Following are result of without persistent patch
>>
>> Guests, Sum,     Avg,    Min,        Max
>>    1,  10864.1,  10864.1, 10864.10, 10864.10
>>    2,  10898.5,  5449.24,  4862.08,  6036.40
>>    3,  10734.5,  5367.26,  5261.43,  5473.08
>>    4,  10924,    5461.99,  5314.84,  5609.14
> In the block case, performance improvement is seen when using a large
> number of guests, could you perform the same benchmark increasing the
> number of guests to 15?
Sure, but my current local environment does not meet such test =

requirement, let me find an environment and then start such test.

Thanks
Annie
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 11:14:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 11:14:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYxOv-0002Vv-Ih; Thu, 15 Nov 2012 11:14:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYxOt-0002Vk-S1
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 11:14:28 +0000
Received: from [85.158.139.211:13064] by server-2.bemta-5.messagelabs.com id
	5B/61-04892-39EC4A05; Thu, 15 Nov 2012 11:14:27 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1352978065!20232180!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3044 invoked from network); 15 Nov 2012 11:14:26 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 11:14:26 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFBEMDZ029086
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 11:14:23 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFBEMbO008028
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 11:14:22 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFBEMwi032200; Thu, 15 Nov 2012 05:14:22 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 03:14:22 -0800
Message-ID: <50A4CE8F.80400@oracle.com>
Date: Thu, 15 Nov 2012 19:14:23 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352969589.3499.31.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352969589.3499.31.camel@zakaz.uk.xensource.com>
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-15 16:53, Ian Campbell wrote:
> On Thu, 2012-11-15 at 07:03 +0000, Annie Li wrote:
>> This patch is based on linux3.4-rc3. I hit netperf/netserver failure
>> on linux latest version v3.7-rc1, v3.7-rc2 and v3.7-rc4. Not sure
>> whether thisnetperf/netserver failure connects compound page commit in
>> v3.7-rc1, but I did hit BUG_ON with debug patch from thread
>> http://lists.xen.org/archives/html/xen-devel/2012-10/msg00893.html
> Do you think you could cook up a netfront fix similar in principal to
> the 6a8ed462f16b8455eec5ae00eb6014159a6721f0 fix for netback?

Ok, let me have a try to do similar thing in netfront.

Thanks
Annie
>
> Ian.
>
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 11:14:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 11:14:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYxOv-0002Vv-Ih; Thu, 15 Nov 2012 11:14:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYxOt-0002Vk-S1
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 11:14:28 +0000
Received: from [85.158.139.211:13064] by server-2.bemta-5.messagelabs.com id
	5B/61-04892-39EC4A05; Thu, 15 Nov 2012 11:14:27 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1352978065!20232180!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3044 invoked from network); 15 Nov 2012 11:14:26 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 11:14:26 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFBEMDZ029086
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 11:14:23 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFBEMbO008028
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 11:14:22 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFBEMwi032200; Thu, 15 Nov 2012 05:14:22 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 03:14:22 -0800
Message-ID: <50A4CE8F.80400@oracle.com>
Date: Thu, 15 Nov 2012 19:14:23 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352969589.3499.31.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352969589.3499.31.camel@zakaz.uk.xensource.com>
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-15 16:53, Ian Campbell wrote:
> On Thu, 2012-11-15 at 07:03 +0000, Annie Li wrote:
>> This patch is based on linux3.4-rc3. I hit netperf/netserver failure
>> on linux latest version v3.7-rc1, v3.7-rc2 and v3.7-rc4. Not sure
>> whether thisnetperf/netserver failure connects compound page commit in
>> v3.7-rc1, but I did hit BUG_ON with debug patch from thread
>> http://lists.xen.org/archives/html/xen-devel/2012-10/msg00893.html
> Do you think you could cook up a netfront fix similar in principal to
> the 6a8ed462f16b8455eec5ae00eb6014159a6721f0 fix for netback?

Ok, let me have a try to do similar thing in netfront.

Thanks
Annie
>
> Ian.
>
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 11:15:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 11:15:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYxPs-0002eX-Ge; Thu, 15 Nov 2012 11:15:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYxPq-0002eB-NA
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 11:15:26 +0000
Received: from [85.158.139.211:32638] by server-14.bemta-5.messagelabs.com id
	00/14-21768-DCEC4A05; Thu, 15 Nov 2012 11:15:25 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1352978124!18782399!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4583 invoked from network); 15 Nov 2012 11:15:25 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 11:15:25 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15824503"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 11:15:08 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 11:15:07 +0000
Message-ID: <1352978106.3499.101.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Date: Thu, 15 Nov 2012 11:15:06 +0000
In-Reply-To: <50A4CA51.8080208@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
	<50A4CA51.8080208@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
 xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVGh1LCAyMDEyLTExLTE1IGF0IDEwOjU2ICswMDAwLCBSb2dlciBQYXUgTW9ubmUgd3JvdGU6
Cj4gT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jQzLCAgNTQ3My4wOAo+ID4gICA0LCAgMTA5MjQsICAgIDU0
NjEuOTksICA1MzE0Ljg0LCAgNTYwOS4xNAo+IAo+IEluIHRoZSBibG9jayBjYXNlLCBwZXJmb3Jt
YW5jZSBpbXByb3ZlbWVudCBpcyBzZWVuIHdoZW4gdXNpbmcgYSBsYXJnZQo+IG51bWJlciBvZiBn
dWVzdHMsIGNvdWxkIHlvdSBwZXJmb3JtIHRoZSBzYW1lIGJlbmNobWFyayBpbmNyZWFzaW5nIHRo
ZQo+IG51bWJlciBvZiBndWVzdHMgdG8gMTU/CgpJdCB3b3VsZCBhbHNvIGJlIG5pY2UgdG8gc2Vl
IHNvbWUgYW5hbHlzaXMgb2YgdGhlIG51bWJlcnMgd2hpY2gganVzdGlmeQp3aHkgdGhpcyBjaGFu
Z2UgaXMgYSBnb29kIG9uZSB3aXRob3V0IGV2ZXJ5IHJldmlld2VyIGhhdmluZyB0byBldmFsdWF0
ZQp0aGUgcmF3IGRhdGEgdGhlbXNlbHZlcy4gSW4gZmFjdCB0aGlzIHNob3VsZCByZWFsbHkgYmUg
cGFydCBvZiB0aGUKY29tbWl0IG1lc3NhZ2UuCgpJYW4uCgoKCl9fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRl
dmVsQGxpc3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Thu Nov 15 11:15:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 11:15:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYxPs-0002eX-Ge; Thu, 15 Nov 2012 11:15:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYxPq-0002eB-NA
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 11:15:26 +0000
Received: from [85.158.139.211:32638] by server-14.bemta-5.messagelabs.com id
	00/14-21768-DCEC4A05; Thu, 15 Nov 2012 11:15:25 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1352978124!18782399!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4583 invoked from network); 15 Nov 2012 11:15:25 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 11:15:25 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15824503"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 11:15:08 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 11:15:07 +0000
Message-ID: <1352978106.3499.101.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Date: Thu, 15 Nov 2012 11:15:06 +0000
In-Reply-To: <50A4CA51.8080208@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
	<50A4CA51.8080208@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
 xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVGh1LCAyMDEyLTExLTE1IGF0IDEwOjU2ICswMDAwLCBSb2dlciBQYXUgTW9ubmUgd3JvdGU6
Cj4gT24gMTUvMTEvMTIgMDk6MzgsIEFOTklFIExJIHdyb3RlOgo+ID4gCj4gPiAKPiA+IE9uIDIw
MTItMTEtMTUgMTU6NDAsIFBhc2kgS8Okcmtrw6RpbmVuIHdyb3RlOgo+ID4+IEhlbGxvLAo+ID4+
Cj4gPj4gT24gVGh1LCBOb3YgMTUsIDIwMTIgYXQgMDM6MDM6MDdQTSArMDgwMCwgQW5uaWUgTGkg
d3JvdGU6Cj4gPj4+IFRoaXMgcGF0Y2ggaW1wbGVtZW50cyBwZXJzaXN0ZW50IGdyYW50cyBmb3Ig
eGVuLW5ldGZyb250L25ldGJhY2suIFRoaXMKPiA+Pj4gbWVjaGFuaXNtIG1haW50YWlucyBwYWdl
I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hlIG51bWJlcnMgd2hpY2gganVzdGlmeQp3aHkgdGhpcyBjaGFu
Z2UgaXMgYSBnb29kIG9uZSB3aXRob3V0IGV2ZXJ5IHJldmlld2VyIGhhdmluZyB0byBldmFsdWF0
ZQp0aGUgcmF3IGRhdGEgdGhlbXNlbHZlcy4gSW4gZmFjdCB0aGlzIHNob3VsZCByZWFsbHkgYmUg
cGFydCBvZiB0aGUKY29tbWl0IG1lc3NhZ2UuCgpJYW4uCgoKCl9fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRl
dmVsQGxpc3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Thu Nov 15 11:16:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 11:16:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYxQw-0002nA-Vc; Thu, 15 Nov 2012 11:16:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYxQv-0002mx-OC
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 11:16:33 +0000
Received: from [193.109.254.147:57155] by server-14.bemta-14.messagelabs.com
	id 16/36-14517-11FC4A05; Thu, 15 Nov 2012 11:16:33 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1352978101!4216203!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4274 invoked from network); 15 Nov 2012 11:15:03 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-10.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 11:15:03 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFBExJM029490
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 11:14:59 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFBEwN2009782
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 11:14:58 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFBEwLg032519; Thu, 15 Nov 2012 05:14:58 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 03:14:58 -0800
Message-ID: <50A4CEB3.1050709@oracle.com>
Date: Thu, 15 Nov 2012 19:14:59 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352969771.3499.34.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352969771.3499.34.camel@zakaz.uk.xensource.com>
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-15 16:56, Ian Campbell wrote:
> On Thu, 2012-11-15 at 07:03 +0000, Annie Li wrote:
>
>> This patch implements persistent grants for xen-netfront/netback. This
>> mechanism maintains page pools in netback/netfront, these page pools
>> is used to save grant pages which are mapped. This way improve
>> performance which is wasted when doing grant operations.
> Please can you send a patch against xen-unstable.hg to document this new
> protocol variant in xen/include/public/io/netif.h. This header is a bit
> under-documented but lets not let it fall further behind (if you want to
> go further and document the existing features, in the style of the
> current blkif.h, then that would be awesome!).
Ok, no problem.
>
> You may also want to provide a similar patch to Linux's copy which is in
> linux/include/xen/interface/io/netif.h
Ok, will do that.

Thanks
Annie
>
> Ian.
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 11:16:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 11:16:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYxQw-0002nA-Vc; Thu, 15 Nov 2012 11:16:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TYxQv-0002mx-OC
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 11:16:33 +0000
Received: from [193.109.254.147:57155] by server-14.bemta-14.messagelabs.com
	id 16/36-14517-11FC4A05; Thu, 15 Nov 2012 11:16:33 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1352978101!4216203!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4274 invoked from network); 15 Nov 2012 11:15:03 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-10.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 11:15:03 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFBExJM029490
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 11:14:59 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFBEwN2009782
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 11:14:58 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFBEwLg032519; Thu, 15 Nov 2012 05:14:58 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 03:14:58 -0800
Message-ID: <50A4CEB3.1050709@oracle.com>
Date: Thu, 15 Nov 2012 19:14:59 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352969771.3499.34.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352969771.3499.34.camel@zakaz.uk.xensource.com>
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-15 16:56, Ian Campbell wrote:
> On Thu, 2012-11-15 at 07:03 +0000, Annie Li wrote:
>
>> This patch implements persistent grants for xen-netfront/netback. This
>> mechanism maintains page pools in netback/netfront, these page pools
>> is used to save grant pages which are mapped. This way improve
>> performance which is wasted when doing grant operations.
> Please can you send a patch against xen-unstable.hg to document this new
> protocol variant in xen/include/public/io/netif.h. This header is a bit
> under-documented but lets not let it fall further behind (if you want to
> go further and document the existing features, in the style of the
> current blkif.h, then that would be awesome!).
Ok, no problem.
>
> You may also want to provide a similar patch to Linux's copy which is in
> linux/include/xen/interface/io/netif.h
Ok, will do that.

Thanks
Annie
>
> Ian.
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 11:24:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 11:24:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYxY7-0003Ae-St; Thu, 15 Nov 2012 11:23:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYxY7-0003AY-AK
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 11:23:59 +0000
Received: from [85.158.143.99:9324] by server-2.bemta-4.messagelabs.com id
	8C/4E-28922-EC0D4A05; Thu, 15 Nov 2012 11:23:58 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1352978637!24763107!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14102 invoked from network); 15 Nov 2012 11:23:57 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-216.messagelabs.com with SMTP;
	15 Nov 2012 11:23:57 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 11:24:09 +0000
Message-Id: <50A4DEDE02000078000A8D22@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 15 Nov 2012 11:23:58 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>,
	"Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
	<1352976427.3499.100.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352976427.3499.100.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "Keir \(Xen.org\)" <keir@xen.org>, "Tim\(Xen.org\)" <tim@xen.org>,
	KonradWilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 11:47, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Tue, 2012-11-13 at 22:23 +0000, Dan Magenheimer wrote:
>> This is a first cut of the hypervisor patch of the proposed
>> XENMEM_claim_pages hypercall/subop.
> 
> Who is expected to be able to call this? I think a XENMEM subop implies
> that the guest itself, plus perhaps any controlling stubdom (e.g. qemu) 
> could call
> it, which I don't think is desirable.
> 
> Should this be limited to the toolstack only and therefore be a subop of
> domctl or some other hypercall?

Oh, yes, absolutely. Whether making it a domctl (where it doesn't
belong except for that aspect) I'm not that sure, though.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 11:24:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 11:24:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYxY7-0003Ae-St; Thu, 15 Nov 2012 11:23:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYxY7-0003AY-AK
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 11:23:59 +0000
Received: from [85.158.143.99:9324] by server-2.bemta-4.messagelabs.com id
	8C/4E-28922-EC0D4A05; Thu, 15 Nov 2012 11:23:58 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1352978637!24763107!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14102 invoked from network); 15 Nov 2012 11:23:57 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-216.messagelabs.com with SMTP;
	15 Nov 2012 11:23:57 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 11:24:09 +0000
Message-Id: <50A4DEDE02000078000A8D22@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 15 Nov 2012 11:23:58 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>,
	"Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
	<1352976427.3499.100.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352976427.3499.100.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "Keir \(Xen.org\)" <keir@xen.org>, "Tim\(Xen.org\)" <tim@xen.org>,
	KonradWilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 11:47, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Tue, 2012-11-13 at 22:23 +0000, Dan Magenheimer wrote:
>> This is a first cut of the hypervisor patch of the proposed
>> XENMEM_claim_pages hypercall/subop.
> 
> Who is expected to be able to call this? I think a XENMEM subop implies
> that the guest itself, plus perhaps any controlling stubdom (e.g. qemu) 
> could call
> it, which I don't think is desirable.
> 
> Should this be limited to the toolstack only and therefore be a subop of
> domctl or some other hypercall?

Oh, yes, absolutely. Whether making it a domctl (where it doesn't
belong except for that aspect) I'm not that sure, though.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:05:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:05:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyBZ-0004El-8F; Thu, 15 Nov 2012 12:04:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYyBY-0004Ee-5Q
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 12:04:44 +0000
Received: from [193.109.254.147:35341] by server-15.bemta-14.messagelabs.com
	id 90/03-12105-B5AD4A05; Thu, 15 Nov 2012 12:04:43 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1352981082!4081134!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26520 invoked from network); 15 Nov 2012 12:04:42 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 12:04:42 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15825662"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 12:04:42 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 12:04:42 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYyBW-0006bj-8k;
	Thu, 15 Nov 2012 12:04:42 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYyBV-0006FC-VV;
	Thu, 15 Nov 2012 12:04:42 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14398-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 15 Nov 2012 12:04:42 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14398: trouble: broken/fail/pass
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14398 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14398/

Failures and problems with tests :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-pair         4 host-install/dst_host(4) broken REGR. vs. 14393

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14393
 test-amd64-amd64-xl-sedf     11 guest-localmigrate           fail   like 14393

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  9 guest-localmigrate         fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  4f349508611f
baseline version:
 xen                  8ca6372315f8

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Dan Magenheimer <dan.magenheimer@oracle.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         broken  
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   25923:4f349508611f
tag:         tip
user:        Dan Magenheimer <dan.magenheimer@oracle.com>
date:        Wed Nov 14 12:06:00 2012 +0000
    
    xen-tmem-list-parse: fix ugly parse output
    
    The program xen-tmem-list-parse parses the output of xm/xl tmem-list
    into human-readable format.  A missing NULL terminator sometimes
    causes garbage to be spewed where the two-letter pool type
    should be output.
    
    Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    xen-unstable changeset: 26147:3186c04af582
    Backport-requested-by: Dan Magenheimer <dan.magenheimer@oracle.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   25922:8ca6372315f8
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Nov 14 11:46:07 2012 +0000
    
    compat/gnttab: Prevent infinite loop in compat code
    
    c/s 20281:95ea2052b41b, which introduces Grant Table version 2
    hypercalls introduces a vulnerability whereby the compat hypercall
    handler can fall into an infinite loop.
    
    If the watchdog is enabled, Xen will die after the timeout.
    
    This is a security problem, XSA-24 / CVE-2012-4539.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    xen-unstable changeset: 26151:b64a7d868f06
    Backport-requested-by: security@xen.org
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:05:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:05:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyBZ-0004El-8F; Thu, 15 Nov 2012 12:04:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYyBY-0004Ee-5Q
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 12:04:44 +0000
Received: from [193.109.254.147:35341] by server-15.bemta-14.messagelabs.com
	id 90/03-12105-B5AD4A05; Thu, 15 Nov 2012 12:04:43 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1352981082!4081134!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26520 invoked from network); 15 Nov 2012 12:04:42 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 12:04:42 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15825662"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 12:04:42 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 12:04:42 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYyBW-0006bj-8k;
	Thu, 15 Nov 2012 12:04:42 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYyBV-0006FC-VV;
	Thu, 15 Nov 2012 12:04:42 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14398-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 15 Nov 2012 12:04:42 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14398: trouble: broken/fail/pass
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14398 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14398/

Failures and problems with tests :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-pair         4 host-install/dst_host(4) broken REGR. vs. 14393

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14393
 test-amd64-amd64-xl-sedf     11 guest-localmigrate           fail   like 14393

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  9 guest-localmigrate         fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  4f349508611f
baseline version:
 xen                  8ca6372315f8

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Dan Magenheimer <dan.magenheimer@oracle.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         broken  
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   25923:4f349508611f
tag:         tip
user:        Dan Magenheimer <dan.magenheimer@oracle.com>
date:        Wed Nov 14 12:06:00 2012 +0000
    
    xen-tmem-list-parse: fix ugly parse output
    
    The program xen-tmem-list-parse parses the output of xm/xl tmem-list
    into human-readable format.  A missing NULL terminator sometimes
    causes garbage to be spewed where the two-letter pool type
    should be output.
    
    Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    xen-unstable changeset: 26147:3186c04af582
    Backport-requested-by: Dan Magenheimer <dan.magenheimer@oracle.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   25922:8ca6372315f8
user:        Ian Jackson <Ian.Jackson@eu.citrix.com>
date:        Wed Nov 14 11:46:07 2012 +0000
    
    compat/gnttab: Prevent infinite loop in compat code
    
    c/s 20281:95ea2052b41b, which introduces Grant Table version 2
    hypercalls introduces a vulnerability whereby the compat hypercall
    handler can fall into an infinite loop.
    
    If the watchdog is enabled, Xen will die after the timeout.
    
    This is a security problem, XSA-24 / CVE-2012-4539.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    xen-unstable changeset: 26151:b64a7d868f06
    Backport-requested-by: security@xen.org
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:09:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:09:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyFM-0004Mx-VV; Thu, 15 Nov 2012 12:08:40 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYyFL-0004Mn-Be
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 12:08:39 +0000
Received: from [85.158.137.99:7912] by server-13.bemta-3.messagelabs.com id
	84/FB-24887-64BD4A05; Thu, 15 Nov 2012 12:08:38 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-5.tower-217.messagelabs.com!1352981317!14485290!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=1.0 required=7.0 tests=MISSING_SUBJECT
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12817 invoked from network); 15 Nov 2012 12:08:37 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-5.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 12:08:37 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYyFI-000JoY-RO; Thu, 15 Nov 2012 12:08:36 +0000
Date: Thu, 15 Nov 2012 12:08:36 +0000
From: Tim Deegan <tim@xen.org>
To: Cutter 409 <cutter409@gmail.com>
Message-ID: <20121115120836.GA75988@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.4.2.1i
Cc: Aravindh Puthiyaparambil <aravindh@virtuata.com>,
	xen-devel@lists.xensource.com
Subject: [Xen-devel] (no subject)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Bcc: Tim Deegan <tjd-xen@phlegethon.org>
Subject: Re: [Xen-devel] Guest memory access hooking
Reply-To: 
In-Reply-To: <CAG4Ohu_p-vVF9ZS01PeMqHvscCrrO+UDawK-noaaP8k+MuqHrQ@mail.gmail.com>

Hi,

At 10:56 -0500 on 13 Nov (1352804161), Cutter 409 wrote:
> I'm trying to do some research with malware, and I'm trying to get
> notifications on arbitrary guest page accesses (similar to what Ether
> does.) I've noticed the mem-event API and it seems like it might be close
> to what I need, but I can't find much documentation about how it works or
> how to use it.

Yes, the mem-event api, and in particular the HVMOP_set_mem_access
hypercall, looks like what you want.  As you say, there isn't much
documentation for it, except the xen-access.c client and the mailing
list archive. 

CC'ing Aravindh, who has worked on this code most recently and might be
able to help with specific questions.

> I know that that mem-event API works only with EPT, but is the code to
> change permissions modifying the guest page tables, or does it work via
> EPT? (Can the guest detect it?)

It works by EPT.  The guest can't detect it by looking at its pagetables
or page fault patterns, though it might be able to detect it by looking
at timings.

> I'm also interested monitoring arbitrary page access via the shadow page
> tables. I've been reading through the code, but if anyone has any insight
> or some kind of push in the right direction, I'd really appreciate it.

Your best bet is to modify _sh_propagate.  Look at how it handles
shadow_mode_log_dirty() -- any time a writeable mapping is shadowed, the
shadow PTE is made read-only until the guest is actually doing a write,
then mark_dirty can be called.  You should be able to do the same thing
for other kinds of access.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:09:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:09:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyFM-0004Mx-VV; Thu, 15 Nov 2012 12:08:40 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYyFL-0004Mn-Be
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 12:08:39 +0000
Received: from [85.158.137.99:7912] by server-13.bemta-3.messagelabs.com id
	84/FB-24887-64BD4A05; Thu, 15 Nov 2012 12:08:38 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-5.tower-217.messagelabs.com!1352981317!14485290!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=1.0 required=7.0 tests=MISSING_SUBJECT
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12817 invoked from network); 15 Nov 2012 12:08:37 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-5.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 12:08:37 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYyFI-000JoY-RO; Thu, 15 Nov 2012 12:08:36 +0000
Date: Thu, 15 Nov 2012 12:08:36 +0000
From: Tim Deegan <tim@xen.org>
To: Cutter 409 <cutter409@gmail.com>
Message-ID: <20121115120836.GA75988@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.4.2.1i
Cc: Aravindh Puthiyaparambil <aravindh@virtuata.com>,
	xen-devel@lists.xensource.com
Subject: [Xen-devel] (no subject)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Bcc: Tim Deegan <tjd-xen@phlegethon.org>
Subject: Re: [Xen-devel] Guest memory access hooking
Reply-To: 
In-Reply-To: <CAG4Ohu_p-vVF9ZS01PeMqHvscCrrO+UDawK-noaaP8k+MuqHrQ@mail.gmail.com>

Hi,

At 10:56 -0500 on 13 Nov (1352804161), Cutter 409 wrote:
> I'm trying to do some research with malware, and I'm trying to get
> notifications on arbitrary guest page accesses (similar to what Ether
> does.) I've noticed the mem-event API and it seems like it might be close
> to what I need, but I can't find much documentation about how it works or
> how to use it.

Yes, the mem-event api, and in particular the HVMOP_set_mem_access
hypercall, looks like what you want.  As you say, there isn't much
documentation for it, except the xen-access.c client and the mailing
list archive. 

CC'ing Aravindh, who has worked on this code most recently and might be
able to help with specific questions.

> I know that that mem-event API works only with EPT, but is the code to
> change permissions modifying the guest page tables, or does it work via
> EPT? (Can the guest detect it?)

It works by EPT.  The guest can't detect it by looking at its pagetables
or page fault patterns, though it might be able to detect it by looking
at timings.

> I'm also interested monitoring arbitrary page access via the shadow page
> tables. I've been reading through the code, but if anyone has any insight
> or some kind of push in the right direction, I'd really appreciate it.

Your best bet is to modify _sh_propagate.  Look at how it handles
shadow_mode_log_dirty() -- any time a writeable mapping is shadowed, the
shadow PTE is made read-only until the guest is actually doing a write,
then mark_dirty can be called.  You should be able to do the same thing
for other kinds of access.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:11:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyHe-0004W3-HP; Thu, 15 Nov 2012 12:11:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <raistlin.df@gmail.com>) id 1TYyHc-0004Vn-4q
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 12:11:00 +0000
Received: from [85.158.138.51:55077] by server-13.bemta-3.messagelabs.com id
	3A/90-24887-3DBD4A05; Thu, 15 Nov 2012 12:10:59 +0000
X-Env-Sender: raistlin.df@gmail.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1352981456!30091703!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2191 invoked from network); 15 Nov 2012 12:10:56 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 12:10:56 -0000
Received: by mail-ea0-f173.google.com with SMTP id i13so734138eaa.32
	for <xen-devel@lists.xen.org>; Thu, 15 Nov 2012 04:10:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:subject:from:to:cc:date:in-reply-to:references
	:content-type:x-mailer:mime-version;
	bh=MeZZXucUXwzywuj/CmRXJsjqEGPuAkKCNvnfN1OJF+s=;
	b=RJr/7leBbJtOgJ4ZnWfIwKPcGHQDjPIZTmNHYFVXCUuYX3S2uWo7wMU0T7z+Zocj+S
	9zjzauZ1iJQXZlHTjVF6Fgfuj166I3trrIQIQ4c5Tl95/ukXLKdDGf0XRTX18LKrFxb4
	KSgfMvPY/B8/Bk8fO7f8XSYhDzjlb5lMFJENXt8Gg5sZBQuRomAwa2MCecTmEJ9QPeus
	dg/11P07UAfZhBLfXvdCl8JfdL7En/G8B5pC8fCR3erd/tOQEy/rFOlJGgbMpmcJkfsj
	dqMbhizR9dnLenn/w/cJzFjZxkQ1Q8FYa4ovY07++ZzOE4PkDc4KICP7/7MqA/twZd6x
	DOjA==
Received: by 10.14.194.2 with SMTP id l2mr3383133een.12.1352981456054;
	Thu, 15 Nov 2012 04:10:56 -0800 (PST)
Received: from [192.168.0.40] (ip-176-53.sn2.eutelia.it. [83.211.176.53])
	by mx.google.com with ESMTPS id 42sm35874187eee.0.2012.11.15.04.10.54
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 15 Nov 2012 04:10:54 -0800 (PST)
Message-ID: <1352981447.5351.51.camel@Solace>
From: Dario Faggioli <raistlin@linux.it>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Thu, 15 Nov 2012 13:10:47 +0100
In-Reply-To: <5086B4DF.6060701@eu.citrix.com>
References: <1350999260.5064.56.camel@Solace> <5086B4DF.6060701@eu.citrix.com>
X-Mailer: Evolution 3.4.4-1
Mime-Version: 1.0
Cc: Keir Fraser <keir.xen@gmail.com>, Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] About vcpu wakeup and runq tickling in credit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============9158097040976872101=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--===============9158097040976872101==
Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature";
	boundary="=-KClJYxTFavmKgtRGMHsN"


--=-KClJYxTFavmKgtRGMHsN
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, 2012-10-23 at 16:16 +0100, George Dunlap wrote:
> > As it comes to possible solution, I think that, for instance, tickling
> > all the CPUs in both v_W's and v_C's affinity masks could solve this,
> > but that would also potentially increase the overhead (by asking _a_lot=
_
> > of CPUs to reschedule), and again, it's hard to say if/when it's
> > worth...
>=20
> Well in my code, opt_tickle_idle_one is on by default, which means only=
=20
> one other cpu will be woken up.  If there were an easy way to make it=20
> wake up a CPU in v_C's affinity as well (supposing that there was no=20
> overlap), that would probably be a win.
>=20
> Of course, that's only necessary if:
> * v_C is lower priority than v_W
> * There are no idlers that intersect both v_C and v_W's affinity mask.
>=20
> It's probably a good idea though to try to set up a scenario where this=
=20
> might be an issue and see how often it actually happens.
>=20
Ok, I think I managed in reproducing this. Look at the following trace,
considering that d51 has vcpu-affinity with pcpus 8-15, while d0 has no
affinity at all (its vcpus can run everywhere):

 166.853945095 ---|-|-------x-| d51v1 runstate_change d0v7 blocked->runnabl=
e
]166.853945884 ---|-|-------x-| d51v1   28004(2:8:4) 2 [ 0 7 ]
.
]166.853986385 ---|-|-------x-| d51v1   2800e(2:8:e) 2 [ 33 4bf97be ]
]166.853986522 ---|-|-------x-| d51v1   2800f(2:8:f) 3 [ 0 a050 1c9c380 ]
]166.853986636 ---|-|-------x-| d51v1   2800a(2:8:a) 4 [ 33 1 0 7 ]
.
 166.853986775 ---|-|-------x-| d51v1 runstate_change d51v1 running->runnab=
le
 166.853986905 ---|-|-------x-| d?v? runstate_change d0v7 runnable->running
.
.
.
]166.854195353 ---|-|-------x-| d0v7   28006(2:8:6) 2 [ 0 7 ]
]166.854196484 ---|-|-------x-| d0v7   2800e(2:8:e) 2 [ 0 33530 ]
]166.854196584 ---|-|-------x-| d0v7   2800f(2:8:f) 3 [ 33 33530 1c9c380 ]
]166.854196691 ---|-|-------x-| d0v7   2800a(2:8:a) 4 [ 0 7 33 1 ]
 166.854196809 ---|-|-------x-| d0v7 runstate_change d0v7 running->blocked
 166.854197175 ---|-|-------x-| d?v? runstate_change d51v1 runnable->runnin=
g

So, if I'm not reading the trace wrong, when d0v7 wakes up (very first
event) it preempts d51v1. Now, even if almost all pcpus 8-15 are idle,
none of them get tickled and comes to pick d51v1 up, which has then to
wait in the runq until d0v7 goes back to sleep.

I suspect this could be because, at d0v7 wakeup time, we try to tickle
some pcpu which is in d0v7's affinity, but not in d51v1's one (as in the
second 'if() {}' block in __runq_tickle() we only care about
new->vcpu->cpu_affinity, and in this case, new is d0v7).

I know, looking at the timestamps it doesn't look like it is a big deal
in this case, and I'm still working on producing numbers that can better
show whether or not this is a real problem.

Anyway, and independently from the results of these tests, why do I care
so much?

Well, if you substitute the concept of "vcpu-affinity" with
"node-affinity" above (which is what I am doing in my NUMA aware
scheduling patches) you'll see why this is bothering me quite a bit. In
fact, in that case, waking up a random pcpu with which d0v7 has
node-affinity with, while d51v1 has not, would cause d51v1 being pulled
by that cpu (since node-affinity is only preference)!

So, in the vcpu-affinity case, if pcpu 3 get tickled, when it peeks at
pcpu 13's runq for work to steal it does not find anything suitable and
give up, leaving d51v1 in the runq even if there are idle pcpus on which
it could run, which is already bad.
In the node-affinity case, pcpu 3 will actually manage in stealing d51v1
and running it, even if there are idle pcpus with which it has
node-affinity, and thus defeating most of the benefits of the whole NUMA
aware scheduling thing (at least for some workloads).

:-(

Regards,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-KClJYxTFavmKgtRGMHsN
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCk28cACgkQk4XaBE3IOsS+XACZATO+sa5WcF548kUTBw+rMtMK
L2AAnirM0M7cJcyHIHplDR6OA6/jmTxa
=lCHV
-----END PGP SIGNATURE-----

--=-KClJYxTFavmKgtRGMHsN--



--===============9158097040976872101==
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.xen.org
http://lists.xen.org/xen-devel

--===============9158097040976872101==--



From xen-devel-bounces@lists.xen.org Thu Nov 15 12:11:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyHe-0004W3-HP; Thu, 15 Nov 2012 12:11:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <raistlin.df@gmail.com>) id 1TYyHc-0004Vn-4q
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 12:11:00 +0000
Received: from [85.158.138.51:55077] by server-13.bemta-3.messagelabs.com id
	3A/90-24887-3DBD4A05; Thu, 15 Nov 2012 12:10:59 +0000
X-Env-Sender: raistlin.df@gmail.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1352981456!30091703!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2191 invoked from network); 15 Nov 2012 12:10:56 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 12:10:56 -0000
Received: by mail-ea0-f173.google.com with SMTP id i13so734138eaa.32
	for <xen-devel@lists.xen.org>; Thu, 15 Nov 2012 04:10:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:subject:from:to:cc:date:in-reply-to:references
	:content-type:x-mailer:mime-version;
	bh=MeZZXucUXwzywuj/CmRXJsjqEGPuAkKCNvnfN1OJF+s=;
	b=RJr/7leBbJtOgJ4ZnWfIwKPcGHQDjPIZTmNHYFVXCUuYX3S2uWo7wMU0T7z+Zocj+S
	9zjzauZ1iJQXZlHTjVF6Fgfuj166I3trrIQIQ4c5Tl95/ukXLKdDGf0XRTX18LKrFxb4
	KSgfMvPY/B8/Bk8fO7f8XSYhDzjlb5lMFJENXt8Gg5sZBQuRomAwa2MCecTmEJ9QPeus
	dg/11P07UAfZhBLfXvdCl8JfdL7En/G8B5pC8fCR3erd/tOQEy/rFOlJGgbMpmcJkfsj
	dqMbhizR9dnLenn/w/cJzFjZxkQ1Q8FYa4ovY07++ZzOE4PkDc4KICP7/7MqA/twZd6x
	DOjA==
Received: by 10.14.194.2 with SMTP id l2mr3383133een.12.1352981456054;
	Thu, 15 Nov 2012 04:10:56 -0800 (PST)
Received: from [192.168.0.40] (ip-176-53.sn2.eutelia.it. [83.211.176.53])
	by mx.google.com with ESMTPS id 42sm35874187eee.0.2012.11.15.04.10.54
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 15 Nov 2012 04:10:54 -0800 (PST)
Message-ID: <1352981447.5351.51.camel@Solace>
From: Dario Faggioli <raistlin@linux.it>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Thu, 15 Nov 2012 13:10:47 +0100
In-Reply-To: <5086B4DF.6060701@eu.citrix.com>
References: <1350999260.5064.56.camel@Solace> <5086B4DF.6060701@eu.citrix.com>
X-Mailer: Evolution 3.4.4-1
Mime-Version: 1.0
Cc: Keir Fraser <keir.xen@gmail.com>, Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] About vcpu wakeup and runq tickling in credit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============9158097040976872101=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--===============9158097040976872101==
Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature";
	boundary="=-KClJYxTFavmKgtRGMHsN"


--=-KClJYxTFavmKgtRGMHsN
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, 2012-10-23 at 16:16 +0100, George Dunlap wrote:
> > As it comes to possible solution, I think that, for instance, tickling
> > all the CPUs in both v_W's and v_C's affinity masks could solve this,
> > but that would also potentially increase the overhead (by asking _a_lot=
_
> > of CPUs to reschedule), and again, it's hard to say if/when it's
> > worth...
>=20
> Well in my code, opt_tickle_idle_one is on by default, which means only=
=20
> one other cpu will be woken up.  If there were an easy way to make it=20
> wake up a CPU in v_C's affinity as well (supposing that there was no=20
> overlap), that would probably be a win.
>=20
> Of course, that's only necessary if:
> * v_C is lower priority than v_W
> * There are no idlers that intersect both v_C and v_W's affinity mask.
>=20
> It's probably a good idea though to try to set up a scenario where this=
=20
> might be an issue and see how often it actually happens.
>=20
Ok, I think I managed in reproducing this. Look at the following trace,
considering that d51 has vcpu-affinity with pcpus 8-15, while d0 has no
affinity at all (its vcpus can run everywhere):

 166.853945095 ---|-|-------x-| d51v1 runstate_change d0v7 blocked->runnabl=
e
]166.853945884 ---|-|-------x-| d51v1   28004(2:8:4) 2 [ 0 7 ]
.
]166.853986385 ---|-|-------x-| d51v1   2800e(2:8:e) 2 [ 33 4bf97be ]
]166.853986522 ---|-|-------x-| d51v1   2800f(2:8:f) 3 [ 0 a050 1c9c380 ]
]166.853986636 ---|-|-------x-| d51v1   2800a(2:8:a) 4 [ 33 1 0 7 ]
.
 166.853986775 ---|-|-------x-| d51v1 runstate_change d51v1 running->runnab=
le
 166.853986905 ---|-|-------x-| d?v? runstate_change d0v7 runnable->running
.
.
.
]166.854195353 ---|-|-------x-| d0v7   28006(2:8:6) 2 [ 0 7 ]
]166.854196484 ---|-|-------x-| d0v7   2800e(2:8:e) 2 [ 0 33530 ]
]166.854196584 ---|-|-------x-| d0v7   2800f(2:8:f) 3 [ 33 33530 1c9c380 ]
]166.854196691 ---|-|-------x-| d0v7   2800a(2:8:a) 4 [ 0 7 33 1 ]
 166.854196809 ---|-|-------x-| d0v7 runstate_change d0v7 running->blocked
 166.854197175 ---|-|-------x-| d?v? runstate_change d51v1 runnable->runnin=
g

So, if I'm not reading the trace wrong, when d0v7 wakes up (very first
event) it preempts d51v1. Now, even if almost all pcpus 8-15 are idle,
none of them get tickled and comes to pick d51v1 up, which has then to
wait in the runq until d0v7 goes back to sleep.

I suspect this could be because, at d0v7 wakeup time, we try to tickle
some pcpu which is in d0v7's affinity, but not in d51v1's one (as in the
second 'if() {}' block in __runq_tickle() we only care about
new->vcpu->cpu_affinity, and in this case, new is d0v7).

I know, looking at the timestamps it doesn't look like it is a big deal
in this case, and I'm still working on producing numbers that can better
show whether or not this is a real problem.

Anyway, and independently from the results of these tests, why do I care
so much?

Well, if you substitute the concept of "vcpu-affinity" with
"node-affinity" above (which is what I am doing in my NUMA aware
scheduling patches) you'll see why this is bothering me quite a bit. In
fact, in that case, waking up a random pcpu with which d0v7 has
node-affinity with, while d51v1 has not, would cause d51v1 being pulled
by that cpu (since node-affinity is only preference)!

So, in the vcpu-affinity case, if pcpu 3 get tickled, when it peeks at
pcpu 13's runq for work to steal it does not find anything suitable and
give up, leaving d51v1 in the runq even if there are idle pcpus on which
it could run, which is already bad.
In the node-affinity case, pcpu 3 will actually manage in stealing d51v1
and running it, even if there are idle pcpus with which it has
node-affinity, and thus defeating most of the benefits of the whole NUMA
aware scheduling thing (at least for some workloads).

:-(

Regards,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-KClJYxTFavmKgtRGMHsN
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCk28cACgkQk4XaBE3IOsS+XACZATO+sa5WcF548kUTBw+rMtMK
L2AAnirM0M7cJcyHIHplDR6OA6/jmTxa
=lCHV
-----END PGP SIGNATURE-----

--=-KClJYxTFavmKgtRGMHsN--



--===============9158097040976872101==
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.xen.org
http://lists.xen.org/xen-devel

--===============9158097040976872101==--



From xen-devel-bounces@lists.xen.org Thu Nov 15 12:11:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyHm-0004YJ-V7; Thu, 15 Nov 2012 12:11:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYyHl-0004Xj-UL
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 12:11:10 +0000
Received: from [85.158.143.35:33810] by server-2.bemta-4.messagelabs.com id
	14/4B-28922-DDBD4A05; Thu, 15 Nov 2012 12:11:09 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1352981434!10451529!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12926 invoked from network); 15 Nov 2012 12:10:35 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-10.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 12:10:35 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYyHC-000Jov-4w; Thu, 15 Nov 2012 12:10:34 +0000
Date: Thu, 15 Nov 2012 12:10:34 +0000
From: Tim Deegan <tim@xen.org>
To: Razvan Cojocaru <rzvncj@gmail.com>
Message-ID: <20121115121034.GB75988@ocelot.phlegethon.org>
References: <50A16639.2090209@gmail.com>
	<1352800791.7491.21.camel@zakaz.uk.xensource.com>
	<50A22044.6060608@gmail.com>
	<1352802973.7491.40.camel@zakaz.uk.xensource.com>
	<50A225CA.2080705@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A225CA.2080705@gmail.com>
User-Agent: Mutt/1.4.2.1i
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 12:49 +0200 on 13 Nov (1352810986), Razvan Cojocaru wrote:
> >>OK, my immediate end-goal is real-time logging of hypervisor events via
> >>a dom0 userspace application. These events are always about a currently
> >>running virtual machine, and said virtual machine is paused at the time.
> >>The userspace tool should be immediately notified, so no polling.
> >
> >This is very like the ioreq model, where the domain (or maybe just the
> >vcpu, I'm not sure) is paused while qemu does its thing.
> >
> >What sort of events are we talking about here?
> 
> A list of interesting registers that changed, that a page fault occured, 
> things like that, occasionally containing some small string messages 
> with extra information. Should be around 64 bytes or so.
> 
> >The right thing to do here is for the userspace tool to communicate with
> >the toolstack (by whatever means) rather the hypervisor in order to
> >control the domains.
> 
> That's what I was thinking too.
> 
> >You might also find some inspiration for this sort of model in the
> >xenpaging and memshare code.

Yes, the mem-event api that they use is pretty well suited to this -- it
sends a series of events to userspace, wih the option of pausing the
guest VCPU until userspace acknowledges the event.  ISRT the mem-access
API already allows for certain kinds of register info (CR3 writes) to be
sent on that channel.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:11:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyHm-0004YJ-V7; Thu, 15 Nov 2012 12:11:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYyHl-0004Xj-UL
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 12:11:10 +0000
Received: from [85.158.143.35:33810] by server-2.bemta-4.messagelabs.com id
	14/4B-28922-DDBD4A05; Thu, 15 Nov 2012 12:11:09 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1352981434!10451529!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12926 invoked from network); 15 Nov 2012 12:10:35 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-10.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 12:10:35 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYyHC-000Jov-4w; Thu, 15 Nov 2012 12:10:34 +0000
Date: Thu, 15 Nov 2012 12:10:34 +0000
From: Tim Deegan <tim@xen.org>
To: Razvan Cojocaru <rzvncj@gmail.com>
Message-ID: <20121115121034.GB75988@ocelot.phlegethon.org>
References: <50A16639.2090209@gmail.com>
	<1352800791.7491.21.camel@zakaz.uk.xensource.com>
	<50A22044.6060608@gmail.com>
	<1352802973.7491.40.camel@zakaz.uk.xensource.com>
	<50A225CA.2080705@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A225CA.2080705@gmail.com>
User-Agent: Mutt/1.4.2.1i
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 12:49 +0200 on 13 Nov (1352810986), Razvan Cojocaru wrote:
> >>OK, my immediate end-goal is real-time logging of hypervisor events via
> >>a dom0 userspace application. These events are always about a currently
> >>running virtual machine, and said virtual machine is paused at the time.
> >>The userspace tool should be immediately notified, so no polling.
> >
> >This is very like the ioreq model, where the domain (or maybe just the
> >vcpu, I'm not sure) is paused while qemu does its thing.
> >
> >What sort of events are we talking about here?
> 
> A list of interesting registers that changed, that a page fault occured, 
> things like that, occasionally containing some small string messages 
> with extra information. Should be around 64 bytes or so.
> 
> >The right thing to do here is for the userspace tool to communicate with
> >the toolstack (by whatever means) rather the hypervisor in order to
> >control the domains.
> 
> That's what I was thinking too.
> 
> >You might also find some inspiration for this sort of model in the
> >xenpaging and memshare code.

Yes, the mem-event api that they use is pretty well suited to this -- it
sends a series of events to userspace, wih the option of pausing the
guest VCPU until userspace acknowledges the event.  ISRT the mem-access
API already allows for certain kinds of register info (CR3 writes) to be
sent on that channel.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:15:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:15:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyLF-0004ts-JX; Thu, 15 Nov 2012 12:14:45 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TYyLE-0004tk-FB
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 12:14:44 +0000
Received: from [85.158.143.35:61592] by server-3.bemta-4.messagelabs.com id
	68/8C-06841-3BCD4A05; Thu, 15 Nov 2012 12:14:43 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1352981561!12911713!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=1.1 required=7.0 tests=GUARANTEED_100_PERCENT,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21212 invoked from network); 15 Nov 2012 12:12:44 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-8.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 12:12:44 -0000
Received: by mail-wg0-f51.google.com with SMTP id ed3so560872wgb.32
	for <xen-devel@lists.xen.org>; Thu, 15 Nov 2012 04:12:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=s0j6IDs6Z2FuKLOQpJplNOQkwqjwUMrUjWsnUqkLZhg=;
	b=i6gH1FJWZ1iNw4k7Ic8NOQb/qQ/id+w/5NjWJPS7Mx4ejzaz358tqEYRdZlt/OSCHH
	b/GdcL0JpJs7Im6hdbj5h0v+Kixfj5+lHkbfApNEN+MdI7xqp4QPFIpCIZzE4GrDgblL
	WURSdjhq2lhhVe+ZfgnZdEBunD2M5j8mOc/q4mu8j5CYUs+9PtEsHiW99X1oT9DGKgSf
	JlGTEqleLgKgbTQEA3ayJEIS7kSVktcQVvPVQV1N3Q7CnYiYkULKkp8bgy9ftZc3WSfv
	2/fEO3z/nmBgFrU1d1v46v8FugUWXC9A00fYNG90YCSjmTslhmrNRtfwdZYCIwNuhYrq
	zTLw==
Received: by 10.180.90.70 with SMTP id bu6mr30887776wib.20.1352981561350;
	Thu, 15 Nov 2012 04:12:41 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id d16sm10674393wiw.8.2012.11.15.04.12.35
	(version=SSLv3 cipher=OTHER); Thu, 15 Nov 2012 04:12:40 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 15 Nov 2012 12:12:30 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>, Ian Campbell <Ian.Campbell@citrix.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <CCCA8CAE.44B24%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
	existing) hypercall
Thread-Index: Ac3DKnv/L9UWSUomGkmNbuwBtQdP/w==
In-Reply-To: <50A4DEDE02000078000A8D22@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: "Tim\(Xen.org\)" <tim@xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 15/11/2012 11:23, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 15.11.12 at 11:47, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> On Tue, 2012-11-13 at 22:23 +0000, Dan Magenheimer wrote:
>>> This is a first cut of the hypervisor patch of the proposed
>>> XENMEM_claim_pages hypercall/subop.
>> 
>> Who is expected to be able to call this? I think a XENMEM subop implies
>> that the guest itself, plus perhaps any controlling stubdom (e.g. qemu)
>> could call
>> it, which I don't think is desirable.
>> 
>> Should this be limited to the toolstack only and therefore be a subop of
>> domctl or some other hypercall?
> 
> Oh, yes, absolutely. Whether making it a domctl (where it doesn't
> belong except for that aspect) I'm not that sure, though.

It can stay as a XENMEM_ subop, but it should be in the
__XEN__||__XEN_TOOLS__ section of public/memory.h indicating that it is
toolstack only (regardless of whether we actually enforce that), and that
the interface is not 100% guaranteed to remain compatible (since it is not
part of the general guest ABI).

 -- Keir

> Jan
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:15:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:15:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyLF-0004ts-JX; Thu, 15 Nov 2012 12:14:45 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TYyLE-0004tk-FB
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 12:14:44 +0000
Received: from [85.158.143.35:61592] by server-3.bemta-4.messagelabs.com id
	68/8C-06841-3BCD4A05; Thu, 15 Nov 2012 12:14:43 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1352981561!12911713!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=1.1 required=7.0 tests=GUARANTEED_100_PERCENT,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21212 invoked from network); 15 Nov 2012 12:12:44 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-8.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 12:12:44 -0000
Received: by mail-wg0-f51.google.com with SMTP id ed3so560872wgb.32
	for <xen-devel@lists.xen.org>; Thu, 15 Nov 2012 04:12:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=s0j6IDs6Z2FuKLOQpJplNOQkwqjwUMrUjWsnUqkLZhg=;
	b=i6gH1FJWZ1iNw4k7Ic8NOQb/qQ/id+w/5NjWJPS7Mx4ejzaz358tqEYRdZlt/OSCHH
	b/GdcL0JpJs7Im6hdbj5h0v+Kixfj5+lHkbfApNEN+MdI7xqp4QPFIpCIZzE4GrDgblL
	WURSdjhq2lhhVe+ZfgnZdEBunD2M5j8mOc/q4mu8j5CYUs+9PtEsHiW99X1oT9DGKgSf
	JlGTEqleLgKgbTQEA3ayJEIS7kSVktcQVvPVQV1N3Q7CnYiYkULKkp8bgy9ftZc3WSfv
	2/fEO3z/nmBgFrU1d1v46v8FugUWXC9A00fYNG90YCSjmTslhmrNRtfwdZYCIwNuhYrq
	zTLw==
Received: by 10.180.90.70 with SMTP id bu6mr30887776wib.20.1352981561350;
	Thu, 15 Nov 2012 04:12:41 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id d16sm10674393wiw.8.2012.11.15.04.12.35
	(version=SSLv3 cipher=OTHER); Thu, 15 Nov 2012 04:12:40 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 15 Nov 2012 12:12:30 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>, Ian Campbell <Ian.Campbell@citrix.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <CCCA8CAE.44B24%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
	existing) hypercall
Thread-Index: Ac3DKnv/L9UWSUomGkmNbuwBtQdP/w==
In-Reply-To: <50A4DEDE02000078000A8D22@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: "Tim\(Xen.org\)" <tim@xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 15/11/2012 11:23, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 15.11.12 at 11:47, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> On Tue, 2012-11-13 at 22:23 +0000, Dan Magenheimer wrote:
>>> This is a first cut of the hypervisor patch of the proposed
>>> XENMEM_claim_pages hypercall/subop.
>> 
>> Who is expected to be able to call this? I think a XENMEM subop implies
>> that the guest itself, plus perhaps any controlling stubdom (e.g. qemu)
>> could call
>> it, which I don't think is desirable.
>> 
>> Should this be limited to the toolstack only and therefore be a subop of
>> domctl or some other hypercall?
> 
> Oh, yes, absolutely. Whether making it a domctl (where it doesn't
> belong except for that aspect) I'm not that sure, though.

It can stay as a XENMEM_ subop, but it should be in the
__XEN__||__XEN_TOOLS__ section of public/memory.h indicating that it is
toolstack only (regardless of whether we actually enforce that), and that
the interface is not 100% guaranteed to remain compatible (since it is not
part of the general guest ABI).

 -- Keir

> Jan
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:17:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:17:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyNd-00052v-62; Thu, 15 Nov 2012 12:17:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYyNb-00052p-VB
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 12:17:12 +0000
Received: from [85.158.143.99:15672] by server-1.bemta-4.messagelabs.com id
	A2/7D-27934-74DD4A05; Thu, 15 Nov 2012 12:17:11 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1352981830!30011868!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31549 invoked from network); 15 Nov 2012 12:17:10 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 12:17:10 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15825982"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 12:17:10 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 12:17:10 +0000
Message-ID: <1352981829.3499.112.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Keir Fraser <keir.xen@gmail.com>
Date: Thu, 15 Nov 2012 12:17:09 +0000
In-Reply-To: <CCCA8CAE.44B24%keir.xen@gmail.com>
References: <CCCA8CAE.44B24%keir.xen@gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 12:12 +0000, Keir Fraser wrote:
> On 15/11/2012 11:23, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
> >>>> On 15.11.12 at 11:47, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> >> On Tue, 2012-11-13 at 22:23 +0000, Dan Magenheimer wrote:
> >>> This is a first cut of the hypervisor patch of the proposed
> >>> XENMEM_claim_pages hypercall/subop.
> >> 
> >> Who is expected to be able to call this? I think a XENMEM subop implies
> >> that the guest itself, plus perhaps any controlling stubdom (e.g. qemu)
> >> could call
> >> it, which I don't think is desirable.
> >> 
> >> Should this be limited to the toolstack only and therefore be a subop of
> >> domctl or some other hypercall?
> > 
> > Oh, yes, absolutely. Whether making it a domctl (where it doesn't
> > belong except for that aspect) I'm not that sure, though.
> 
> It can stay as a XENMEM_ subop, but it should be in the
> __XEN__||__XEN_TOOLS__ section of public/memory.h indicating that it is
> toolstack only (regardless of whether we actually enforce that), and that
> the interface is not 100% guaranteed to remain compatible (since it is not
> part of the general guest ABI).

We need to be mindful of what a guest who calls this anyway can achieve.
Is it limited by d->max_pages, IOW similar in principal to
XENMEM_populate_physmap? If so then it is probably acceptable.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:17:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:17:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyNd-00052v-62; Thu, 15 Nov 2012 12:17:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYyNb-00052p-VB
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 12:17:12 +0000
Received: from [85.158.143.99:15672] by server-1.bemta-4.messagelabs.com id
	A2/7D-27934-74DD4A05; Thu, 15 Nov 2012 12:17:11 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1352981830!30011868!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31549 invoked from network); 15 Nov 2012 12:17:10 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 12:17:10 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15825982"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 12:17:10 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 12:17:10 +0000
Message-ID: <1352981829.3499.112.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Keir Fraser <keir.xen@gmail.com>
Date: Thu, 15 Nov 2012 12:17:09 +0000
In-Reply-To: <CCCA8CAE.44B24%keir.xen@gmail.com>
References: <CCCA8CAE.44B24%keir.xen@gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 12:12 +0000, Keir Fraser wrote:
> On 15/11/2012 11:23, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
> >>>> On 15.11.12 at 11:47, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> >> On Tue, 2012-11-13 at 22:23 +0000, Dan Magenheimer wrote:
> >>> This is a first cut of the hypervisor patch of the proposed
> >>> XENMEM_claim_pages hypercall/subop.
> >> 
> >> Who is expected to be able to call this? I think a XENMEM subop implies
> >> that the guest itself, plus perhaps any controlling stubdom (e.g. qemu)
> >> could call
> >> it, which I don't think is desirable.
> >> 
> >> Should this be limited to the toolstack only and therefore be a subop of
> >> domctl or some other hypercall?
> > 
> > Oh, yes, absolutely. Whether making it a domctl (where it doesn't
> > belong except for that aspect) I'm not that sure, though.
> 
> It can stay as a XENMEM_ subop, but it should be in the
> __XEN__||__XEN_TOOLS__ section of public/memory.h indicating that it is
> toolstack only (regardless of whether we actually enforce that), and that
> the interface is not 100% guaranteed to remain compatible (since it is not
> part of the general guest ABI).

We need to be mindful of what a guest who calls this anyway can achieve.
Is it limited by d->max_pages, IOW similar in principal to
XENMEM_populate_physmap? If so then it is probably acceptable.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:24:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:24:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyUH-0005OS-79; Thu, 15 Nov 2012 12:24:05 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TYyUG-0005ON-9e
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 12:24:04 +0000
Received: from [85.158.143.99:18563] by server-3.bemta-4.messagelabs.com id
	07/D2-06841-3EED4A05; Thu, 15 Nov 2012 12:24:03 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1352982241!20926332!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM4MzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28030 invoked from network); 15 Nov 2012 12:24:03 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-10.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 12:24:03 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="44694253"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 12:24:00 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 07:24:00 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TYyUB-0007AY-VK;
	Thu, 15 Nov 2012 12:23:59 +0000
Message-ID: <50A4DD95.5020107@eu.citrix.com>
Date: Thu, 15 Nov 2012 12:18:29 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Dario Faggioli <raistlin@linux.it>
References: <1350999260.5064.56.camel@Solace> <5086B4DF.6060701@eu.citrix.com>
	<1352981447.5351.51.camel@Solace>
In-Reply-To: <1352981447.5351.51.camel@Solace>
Cc: Keir Fraser <keir.xen@gmail.com>, Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] About vcpu wakeup and runq tickling in credit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 15/11/12 12:10, Dario Faggioli wrote:
> On Tue, 2012-10-23 at 16:16 +0100, George Dunlap wrote:
>>> As it comes to possible solution, I think that, for instance, tickling
>>> all the CPUs in both v_W's and v_C's affinity masks could solve this,
>>> but that would also potentially increase the overhead (by asking _a_lot_
>>> of CPUs to reschedule), and again, it's hard to say if/when it's
>>> worth...
>> Well in my code, opt_tickle_idle_one is on by default, which means only
>> one other cpu will be woken up.  If there were an easy way to make it
>> wake up a CPU in v_C's affinity as well (supposing that there was no
>> overlap), that would probably be a win.
>>
>> Of course, that's only necessary if:
>> * v_C is lower priority than v_W
>> * There are no idlers that intersect both v_C and v_W's affinity mask.
>>
>> It's probably a good idea though to try to set up a scenario where this
>> might be an issue and see how often it actually happens.
>>
> Ok, I think I managed in reproducing this. Look at the following trace,
> considering that d51 has vcpu-affinity with pcpus 8-15, while d0 has no
> affinity at all (its vcpus can run everywhere):
>
>   166.853945095 ---|-|-------x-| d51v1 runstate_change d0v7 blocked->runnable
> ]166.853945884 ---|-|-------x-| d51v1   28004(2:8:4) 2 [ 0 7 ]
> .
> ]166.853986385 ---|-|-------x-| d51v1   2800e(2:8:e) 2 [ 33 4bf97be ]
> ]166.853986522 ---|-|-------x-| d51v1   2800f(2:8:f) 3 [ 0 a050 1c9c380 ]
> ]166.853986636 ---|-|-------x-| d51v1   2800a(2:8:a) 4 [ 33 1 0 7 ]
> .
>   166.853986775 ---|-|-------x-| d51v1 runstate_change d51v1 running->runnable
>   166.853986905 ---|-|-------x-| d?v? runstate_change d0v7 runnable->running
> .
> .
> .
> ]166.854195353 ---|-|-------x-| d0v7   28006(2:8:6) 2 [ 0 7 ]
> ]166.854196484 ---|-|-------x-| d0v7   2800e(2:8:e) 2 [ 0 33530 ]
> ]166.854196584 ---|-|-------x-| d0v7   2800f(2:8:f) 3 [ 33 33530 1c9c380 ]
> ]166.854196691 ---|-|-------x-| d0v7   2800a(2:8:a) 4 [ 0 7 33 1 ]
>   166.854196809 ---|-|-------x-| d0v7 runstate_change d0v7 running->blocked
>   166.854197175 ---|-|-------x-| d?v? runstate_change d51v1 runnable->running
>
> So, if I'm not reading the trace wrong, when d0v7 wakes up (very first
> event) it preempts d51v1. Now, even if almost all pcpus 8-15 are idle,
> none of them get tickled and comes to pick d51v1 up, which has then to
> wait in the runq until d0v7 goes back to sleep.
>
> I suspect this could be because, at d0v7 wakeup time, we try to tickle
> some pcpu which is in d0v7's affinity, but not in d51v1's one (as in the
> second 'if() {}' block in __runq_tickle() we only care about
> new->vcpu->cpu_affinity, and in this case, new is d0v7).
>
> I know, looking at the timestamps it doesn't look like it is a big deal
> in this case, and I'm still working on producing numbers that can better
> show whether or not this is a real problem.
>
> Anyway, and independently from the results of these tests, why do I care
> so much?
>
> Well, if you substitute the concept of "vcpu-affinity" with
> "node-affinity" above (which is what I am doing in my NUMA aware
> scheduling patches) you'll see why this is bothering me quite a bit. In
> fact, in that case, waking up a random pcpu with which d0v7 has
> node-affinity with, while d51v1 has not, would cause d51v1 being pulled
> by that cpu (since node-affinity is only preference)!
>
> So, in the vcpu-affinity case, if pcpu 3 get tickled, when it peeks at
> pcpu 13's runq for work to steal it does not find anything suitable and
> give up, leaving d51v1 in the runq even if there are idle pcpus on which
> it could run, which is already bad.
> In the node-affinity case, pcpu 3 will actually manage in stealing d51v1
> and running it, even if there are idle pcpus with which it has
> node-affinity, and thus defeating most of the benefits of the whole NUMA
> aware scheduling thing (at least for some workloads).

Maybe what we should do is do the wake-up based on who is likely to run 
on the current cpu: i.e., if "current" is likely to be pre-empted, look 
at idlers based on "current"'s mask; if "new" is likely to be put on the 
queue, look at idlers based on "new"'s mask.

What do you think?

  -George


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:24:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:24:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyUH-0005OS-79; Thu, 15 Nov 2012 12:24:05 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TYyUG-0005ON-9e
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 12:24:04 +0000
Received: from [85.158.143.99:18563] by server-3.bemta-4.messagelabs.com id
	07/D2-06841-3EED4A05; Thu, 15 Nov 2012 12:24:03 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1352982241!20926332!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM4MzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28030 invoked from network); 15 Nov 2012 12:24:03 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-10.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 12:24:03 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="44694253"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 12:24:00 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 07:24:00 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TYyUB-0007AY-VK;
	Thu, 15 Nov 2012 12:23:59 +0000
Message-ID: <50A4DD95.5020107@eu.citrix.com>
Date: Thu, 15 Nov 2012 12:18:29 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Dario Faggioli <raistlin@linux.it>
References: <1350999260.5064.56.camel@Solace> <5086B4DF.6060701@eu.citrix.com>
	<1352981447.5351.51.camel@Solace>
In-Reply-To: <1352981447.5351.51.camel@Solace>
Cc: Keir Fraser <keir.xen@gmail.com>, Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] About vcpu wakeup and runq tickling in credit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 15/11/12 12:10, Dario Faggioli wrote:
> On Tue, 2012-10-23 at 16:16 +0100, George Dunlap wrote:
>>> As it comes to possible solution, I think that, for instance, tickling
>>> all the CPUs in both v_W's and v_C's affinity masks could solve this,
>>> but that would also potentially increase the overhead (by asking _a_lot_
>>> of CPUs to reschedule), and again, it's hard to say if/when it's
>>> worth...
>> Well in my code, opt_tickle_idle_one is on by default, which means only
>> one other cpu will be woken up.  If there were an easy way to make it
>> wake up a CPU in v_C's affinity as well (supposing that there was no
>> overlap), that would probably be a win.
>>
>> Of course, that's only necessary if:
>> * v_C is lower priority than v_W
>> * There are no idlers that intersect both v_C and v_W's affinity mask.
>>
>> It's probably a good idea though to try to set up a scenario where this
>> might be an issue and see how often it actually happens.
>>
> Ok, I think I managed in reproducing this. Look at the following trace,
> considering that d51 has vcpu-affinity with pcpus 8-15, while d0 has no
> affinity at all (its vcpus can run everywhere):
>
>   166.853945095 ---|-|-------x-| d51v1 runstate_change d0v7 blocked->runnable
> ]166.853945884 ---|-|-------x-| d51v1   28004(2:8:4) 2 [ 0 7 ]
> .
> ]166.853986385 ---|-|-------x-| d51v1   2800e(2:8:e) 2 [ 33 4bf97be ]
> ]166.853986522 ---|-|-------x-| d51v1   2800f(2:8:f) 3 [ 0 a050 1c9c380 ]
> ]166.853986636 ---|-|-------x-| d51v1   2800a(2:8:a) 4 [ 33 1 0 7 ]
> .
>   166.853986775 ---|-|-------x-| d51v1 runstate_change d51v1 running->runnable
>   166.853986905 ---|-|-------x-| d?v? runstate_change d0v7 runnable->running
> .
> .
> .
> ]166.854195353 ---|-|-------x-| d0v7   28006(2:8:6) 2 [ 0 7 ]
> ]166.854196484 ---|-|-------x-| d0v7   2800e(2:8:e) 2 [ 0 33530 ]
> ]166.854196584 ---|-|-------x-| d0v7   2800f(2:8:f) 3 [ 33 33530 1c9c380 ]
> ]166.854196691 ---|-|-------x-| d0v7   2800a(2:8:a) 4 [ 0 7 33 1 ]
>   166.854196809 ---|-|-------x-| d0v7 runstate_change d0v7 running->blocked
>   166.854197175 ---|-|-------x-| d?v? runstate_change d51v1 runnable->running
>
> So, if I'm not reading the trace wrong, when d0v7 wakes up (very first
> event) it preempts d51v1. Now, even if almost all pcpus 8-15 are idle,
> none of them get tickled and comes to pick d51v1 up, which has then to
> wait in the runq until d0v7 goes back to sleep.
>
> I suspect this could be because, at d0v7 wakeup time, we try to tickle
> some pcpu which is in d0v7's affinity, but not in d51v1's one (as in the
> second 'if() {}' block in __runq_tickle() we only care about
> new->vcpu->cpu_affinity, and in this case, new is d0v7).
>
> I know, looking at the timestamps it doesn't look like it is a big deal
> in this case, and I'm still working on producing numbers that can better
> show whether or not this is a real problem.
>
> Anyway, and independently from the results of these tests, why do I care
> so much?
>
> Well, if you substitute the concept of "vcpu-affinity" with
> "node-affinity" above (which is what I am doing in my NUMA aware
> scheduling patches) you'll see why this is bothering me quite a bit. In
> fact, in that case, waking up a random pcpu with which d0v7 has
> node-affinity with, while d51v1 has not, would cause d51v1 being pulled
> by that cpu (since node-affinity is only preference)!
>
> So, in the vcpu-affinity case, if pcpu 3 get tickled, when it peeks at
> pcpu 13's runq for work to steal it does not find anything suitable and
> give up, leaving d51v1 in the runq even if there are idle pcpus on which
> it could run, which is already bad.
> In the node-affinity case, pcpu 3 will actually manage in stealing d51v1
> and running it, even if there are idle pcpus with which it has
> node-affinity, and thus defeating most of the benefits of the whole NUMA
> aware scheduling thing (at least for some workloads).

Maybe what we should do is do the wake-up based on who is likely to run 
on the current cpu: i.e., if "current" is likely to be pre-empted, look 
at idlers based on "current"'s mask; if "new" is likely to be put on the 
queue, look at idlers based on "new"'s mask.

What do you think?

  -George


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:25:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:25:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyVp-0005TH-Mn; Thu, 15 Nov 2012 12:25:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYyVo-0005TA-Fk
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 12:25:40 +0000
Received: from [85.158.139.211:21744] by server-14.bemta-5.messagelabs.com id
	72/66-21768-34FD4A05; Thu, 15 Nov 2012 12:25:39 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1352982339!20287089!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12469 invoked from network); 15 Nov 2012 12:25:39 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 12:25:39 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15826189"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 12:25:38 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 12:25:38 +0000
Message-ID: <1352982337.3499.119.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Date: Thu, 15 Nov 2012 12:25:37 +0000
In-Reply-To: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	Dave McCracken <dave.mccracken@oracle.com>, Konrad
	Wilk <konrad.wilk@oracle.com>, "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-14 at 23:55 +0000, Dan Magenheimer wrote:
> 
> Note 1: Tim: I'm thinking this may resolve your concern that
> the claim mechanism must be more complicated to handle
> restricted memory allocations and order>0 allocations.
> The proposed claim mechanism only guarantees a quantity of
> order==0 pages; if restricted allocations are required, these
> are done first by the toolstack, and followed by the claim.
> Order>0 allocations still work if memory is not fragmented,
> but the claim mechanism doesn't guarantee anything but
> a quantity of order==0 pages.

How does this interact with the feature which lets you create PV guests
using only superpages? I believe is something Oracle added and still
maintains (Dave added to the CC).

Also doesn't this fail to make any sort of guarantee if you are building
a 32 bit PV guest, since they require memory under a certain host
address limit (160GB IIRC)?

Basically neither of those cases benefit from this hypercall at all? I
don't know what the usecase for the superpage PV guests is (but I
suppose it is important to Oracle, at least). The 32 bit PV guest use
case is still a pretty significant one which I think ought to be
handled, otherwise any system built on top of this functionality will
only work reliably in a subset of cases.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:25:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:25:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyVp-0005TH-Mn; Thu, 15 Nov 2012 12:25:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TYyVo-0005TA-Fk
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 12:25:40 +0000
Received: from [85.158.139.211:21744] by server-14.bemta-5.messagelabs.com id
	72/66-21768-34FD4A05; Thu, 15 Nov 2012 12:25:39 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1352982339!20287089!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12469 invoked from network); 15 Nov 2012 12:25:39 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 12:25:39 -0000
X-IronPort-AV: E=Sophos;i="4.83,255,1352073600"; d="scan'208";a="15826189"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 12:25:38 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 12:25:38 +0000
Message-ID: <1352982337.3499.119.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Date: Thu, 15 Nov 2012 12:25:37 +0000
In-Reply-To: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	Dave McCracken <dave.mccracken@oracle.com>, Konrad
	Wilk <konrad.wilk@oracle.com>, "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-14 at 23:55 +0000, Dan Magenheimer wrote:
> 
> Note 1: Tim: I'm thinking this may resolve your concern that
> the claim mechanism must be more complicated to handle
> restricted memory allocations and order>0 allocations.
> The proposed claim mechanism only guarantees a quantity of
> order==0 pages; if restricted allocations are required, these
> are done first by the toolstack, and followed by the claim.
> Order>0 allocations still work if memory is not fragmented,
> but the claim mechanism doesn't guarantee anything but
> a quantity of order==0 pages.

How does this interact with the feature which lets you create PV guests
using only superpages? I believe is something Oracle added and still
maintains (Dave added to the CC).

Also doesn't this fail to make any sort of guarantee if you are building
a 32 bit PV guest, since they require memory under a certain host
address limit (160GB IIRC)?

Basically neither of those cases benefit from this hypercall at all? I
don't know what the usecase for the superpage PV guests is (but I
suppose it is important to Oracle, at least). The 32 bit PV guest use
case is still a pretty significant one which I think ought to be
handled, otherwise any system built on top of this functionality will
only work reliably in a subset of cases.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:39:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:39:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyix-0005on-24; Thu, 15 Nov 2012 12:39:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYyiv-0005oi-3L
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 12:39:13 +0000
Received: from [193.109.254.147:52252] by server-12.bemta-14.messagelabs.com
	id B9/D1-00510-072E4A05; Thu, 15 Nov 2012 12:39:12 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1352983151!9806640!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30808 invoked from network); 15 Nov 2012 12:39:11 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-27.messagelabs.com with SMTP;
	15 Nov 2012 12:39:11 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 12:41:42 +0000
Message-Id: <50A4F07F02000078000A8DBD@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 15 Nov 2012 12:39:11 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>,
	"Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352982337.3499.119.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Keir \(Xen.org\)" <keir@xen.org>, KonradWilk <konrad.wilk@oracle.com>,
	"Tim\(Xen.org\)" <tim@xen.org>, Dave McCracken <dave.mccracken@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 13:25, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> Also doesn't this fail to make any sort of guarantee if you are building
> a 32 bit PV guest, since they require memory under a certain host
> address limit (160GB IIRC)?

This case is unreliable already, and has always been (I think we
have a tools side hack in some of our trees in an attempt to deal
with that), when ballooning is used to get at the memory, or
when trying to start a 32-bit guest after having run 64-bit ones
exhausting most of memory, and having terminated an early
created one (as allocation is top down, ones created close to
exhaustion, i.e. later, would eat up that "special" memory at
lower addresses).

So this new functionality "only" makes a bad situation worse
(which isn't meant to say I wouldn't prefer to see it get fixed).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:39:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:39:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyix-0005on-24; Thu, 15 Nov 2012 12:39:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYyiv-0005oi-3L
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 12:39:13 +0000
Received: from [193.109.254.147:52252] by server-12.bemta-14.messagelabs.com
	id B9/D1-00510-072E4A05; Thu, 15 Nov 2012 12:39:12 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1352983151!9806640!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30808 invoked from network); 15 Nov 2012 12:39:11 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-27.messagelabs.com with SMTP;
	15 Nov 2012 12:39:11 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 12:41:42 +0000
Message-Id: <50A4F07F02000078000A8DBD@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 15 Nov 2012 12:39:11 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>,
	"Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352982337.3499.119.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Keir \(Xen.org\)" <keir@xen.org>, KonradWilk <konrad.wilk@oracle.com>,
	"Tim\(Xen.org\)" <tim@xen.org>, Dave McCracken <dave.mccracken@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 13:25, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> Also doesn't this fail to make any sort of guarantee if you are building
> a 32 bit PV guest, since they require memory under a certain host
> address limit (160GB IIRC)?

This case is unreliable already, and has always been (I think we
have a tools side hack in some of our trees in an attempt to deal
with that), when ballooning is used to get at the memory, or
when trying to start a 32-bit guest after having run 64-bit ones
exhausting most of memory, and having terminated an early
created one (as allocation is top down, ones created close to
exhaustion, i.e. later, would eat up that "special" memory at
lower addresses).

So this new functionality "only" makes a bad situation worse
(which isn't meant to say I wouldn't prefer to see it get fixed).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:44:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:44:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYynN-00064M-Ol; Thu, 15 Nov 2012 12:43:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYynM-00064E-N1
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 12:43:48 +0000
Received: from [85.158.143.35:45080] by server-1.bemta-4.messagelabs.com id
	B2/17-27934-383E4A05; Thu, 15 Nov 2012 12:43:47 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352983427!13704659!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22353 invoked from network); 15 Nov 2012 12:43:47 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-21.messagelabs.com with SMTP;
	15 Nov 2012 12:43:47 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 12:46:18 +0000
Message-Id: <50A4F19202000078000A8DD1@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 15 Nov 2012 12:43:46 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <ian.jackson@eu.citrix.com>,"xen-devel" <xen-devel@lists.xen.org>
References: <osstest-14398-mainreport@xen.org>
In-Reply-To: <osstest-14398-mainreport@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Subject: Re: [Xen-devel] [xen-4.2-testing test] 14398: trouble:
 broken/fail/pass
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 13:04, xen.org <ian.jackson@eu.citrix.com> wrote:
> flight 14398 xen-4.2-testing real [real]
> http://www.chiark.greenend.org.uk/~xensrcts/logs/14398/ 
> 
> Failures and problems with tests :-(
> 
> Tests which did not succeed and are blocking,
> including tests which could not be run:
>  test-amd64-i386-pair         4 host-install/dst_host(4) broken REGR. vs. 14393

Is that a random failure, or infrastructure related? "Autopartitioning
using LVM failed because an error occurred while creating the volume
group" doesn't sound like something under our control...

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:44:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:44:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYynN-00064M-Ol; Thu, 15 Nov 2012 12:43:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TYynM-00064E-N1
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 12:43:48 +0000
Received: from [85.158.143.35:45080] by server-1.bemta-4.messagelabs.com id
	B2/17-27934-383E4A05; Thu, 15 Nov 2012 12:43:47 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1352983427!13704659!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22353 invoked from network); 15 Nov 2012 12:43:47 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-21.messagelabs.com with SMTP;
	15 Nov 2012 12:43:47 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 12:46:18 +0000
Message-Id: <50A4F19202000078000A8DD1@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Thu, 15 Nov 2012 12:43:46 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <ian.jackson@eu.citrix.com>,"xen-devel" <xen-devel@lists.xen.org>
References: <osstest-14398-mainreport@xen.org>
In-Reply-To: <osstest-14398-mainreport@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Subject: Re: [Xen-devel] [xen-4.2-testing test] 14398: trouble:
 broken/fail/pass
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 13:04, xen.org <ian.jackson@eu.citrix.com> wrote:
> flight 14398 xen-4.2-testing real [real]
> http://www.chiark.greenend.org.uk/~xensrcts/logs/14398/ 
> 
> Failures and problems with tests :-(
> 
> Tests which did not succeed and are blocking,
> including tests which could not be run:
>  test-amd64-i386-pair         4 host-install/dst_host(4) broken REGR. vs. 14393

Is that a random failure, or infrastructure related? "Autopartitioning
using LVM failed because an error occurred while creating the volume
group" doesn't sound like something under our control...

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:55:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:55:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyyl-0006Oi-Ak; Thu, 15 Nov 2012 12:55:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYyyk-0006Od-6s
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 12:55:34 +0000
Received: from [85.158.137.99:42877] by server-12.bemta-3.messagelabs.com id
	2A/DC-22757-546E4A05; Thu, 15 Nov 2012 12:55:33 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1352984131!19242545!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18321 invoked from network); 15 Nov 2012 12:55:31 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 12:55:31 -0000
X-IronPort-AV: E=Sophos;i="4.83,257,1352073600"; d="scan'208";a="15826965"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 12:54:51 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 12:54:50 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TYyy2-0006rr-LZ; Thu, 15 Nov 2012 12:54:50 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TYyy2-0002gD-Ds;
	Thu, 15 Nov 2012 12:54:50 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20644.58906.302095.824131@mariner.uk.xensource.com>
Date: Thu, 15 Nov 2012 12:54:50 +0000
To: Jan Beulich <JBeulich@suse.com>
In-Reply-To: <50A4F19202000078000A8DD1@nat28.tlf.novell.com>
References: <osstest-14398-mainreport@xen.org>
	<50A4F19202000078000A8DD1@nat28.tlf.novell.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [xen-4.2-testing test] 14398: trouble:
 broken/fail/pass
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Jan Beulich writes ("Re: [Xen-devel] [xen-4.2-testing test] 14398: trouble: broken/fail/pass"):
> On 15.11.12 at 13:04, xen.org <ian.jackson@eu.citrix.com> wrote:
> > Tests which did not succeed and are blocking,
> > including tests which could not be run:
> >  test-amd64-i386-pair         4 host-install/dst_host(4) broken REGR. vs. 14393
> 
> Is that a random failure, or infrastructure related? "Autopartitioning
> using LVM failed because an error occurred while creating the volume
> group" doesn't sound like something under our control...

In general if the test is reported as "broken" that means it's an
infrastructure failure.

I looked at the log and in this case I think it's because the previous
state of the disk, as left by the previous use of this test machine,
was weird in a way that triggers a bug in debian-installer and
prevents the first and second attempts to wipe the disk and reinstall
- but not the third.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 12:55:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 12:55:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYyyl-0006Oi-Ak; Thu, 15 Nov 2012 12:55:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYyyk-0006Od-6s
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 12:55:34 +0000
Received: from [85.158.137.99:42877] by server-12.bemta-3.messagelabs.com id
	2A/DC-22757-546E4A05; Thu, 15 Nov 2012 12:55:33 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1352984131!19242545!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18321 invoked from network); 15 Nov 2012 12:55:31 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 12:55:31 -0000
X-IronPort-AV: E=Sophos;i="4.83,257,1352073600"; d="scan'208";a="15826965"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 12:54:51 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 12:54:50 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TYyy2-0006rr-LZ; Thu, 15 Nov 2012 12:54:50 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TYyy2-0002gD-Ds;
	Thu, 15 Nov 2012 12:54:50 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20644.58906.302095.824131@mariner.uk.xensource.com>
Date: Thu, 15 Nov 2012 12:54:50 +0000
To: Jan Beulich <JBeulich@suse.com>
In-Reply-To: <50A4F19202000078000A8DD1@nat28.tlf.novell.com>
References: <osstest-14398-mainreport@xen.org>
	<50A4F19202000078000A8DD1@nat28.tlf.novell.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [xen-4.2-testing test] 14398: trouble:
 broken/fail/pass
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Jan Beulich writes ("Re: [Xen-devel] [xen-4.2-testing test] 14398: trouble: broken/fail/pass"):
> On 15.11.12 at 13:04, xen.org <ian.jackson@eu.citrix.com> wrote:
> > Tests which did not succeed and are blocking,
> > including tests which could not be run:
> >  test-amd64-i386-pair         4 host-install/dst_host(4) broken REGR. vs. 14393
> 
> Is that a random failure, or infrastructure related? "Autopartitioning
> using LVM failed because an error occurred while creating the volume
> group" doesn't sound like something under our control...

In general if the test is reported as "broken" that means it's an
infrastructure failure.

I looked at the log and in this case I think it's because the previous
state of the disk, as left by the previous use of this test machine,
was weird in a way that triggers a bug in debian-installer and
prevents the first and second attempts to wipe the disk and reinstall
- but not the third.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 13:23:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 13:23:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYzPC-0006xK-Op; Thu, 15 Nov 2012 13:22:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYzPB-0006xF-5L
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 13:22:53 +0000
Received: from [85.158.138.51:60899] by server-15.bemta-3.messagelabs.com id
	9F/8C-09445-CACE4A05; Thu, 15 Nov 2012 13:22:52 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1352985771!21263671!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12094 invoked from network); 15 Nov 2012 13:22:51 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-7.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 13:22:51 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYzP7-000K53-QW; Thu, 15 Nov 2012 13:22:49 +0000
Date: Thu, 15 Nov 2012 13:22:49 +0000
From: Tim Deegan <tim@xen.org>
To: Robert Phillips <robert.phillips@citrix.com>
Message-ID: <20121115132249.GC75988@ocelot.phlegethon.org>
References: <1352755913-4229-1-git-send-email-robert.phillips@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352755913-4229-1-git-send-email-robert.phillips@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
	in Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi, 

We're very nearly there now.  I think I agree on almost all the
technical decisions but there are still a few things to tidy up (some of
which I mentioned before).

At 16:31 -0500 on 12 Nov (1352737913), Robert Phillips wrote:
> Support is provided for both shadow and hardware assisted paging (HAP) modes.
> This code bookkeeps the set of video frame buffers (vram),
> detects when the guest has modified any of those buffers and, upon request,
> returns a bitmap of the modified pages.
> This lets other software components re-paint the portions of the monitor (or monitors) that have changed.
> Each monitor has a frame buffer of some size at some position in guest physical memory.
> The set of frame buffers being tracked can change over time as monitors are plugged and unplugged.
> (Version 3 of this patch.)

Please linewrap at something less than 80 characters.

> diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile
> index eea5555..e374aac 100644
> --- a/xen/arch/x86/hvm/Makefile
> +++ b/xen/arch/x86/hvm/Makefile
> @@ -22,4 +22,4 @@ obj-y += vlapic.o
>  obj-y += vmsi.o
>  obj-y += vpic.o
>  obj-y += vpt.o
> -obj-y += vpmu.o
> \ No newline at end of file
> +obj-y += vpmu.o

This is an unrelated fix, so doesn't belong in this changeset.

> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index 34da2f5..3a3e5e4 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -57,6 +57,7 @@
>  #include <asm/hvm/cacheattr.h>
>  #include <asm/hvm/trace.h>
>  #include <asm/hvm/nestedhvm.h>
> +#include <asm/dirty_vram.h>
>  #include <asm/mtrr.h>
>  #include <asm/apic.h>
>  #include <public/sched.h>
> @@ -66,6 +67,7 @@
>  #include <asm/mem_event.h>
>  #include <asm/mem_access.h>
>  #include <public/mem_event.h>
> +#include "../mm/mm-locks.h"
>  
>  bool_t __read_mostly hvm_enabled;
>  
> @@ -1433,8 +1435,20 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
>           */
>          if ( access_w )
>          {
> +            p2m_type_t pt;
> +            pt = p2m_change_type(v->domain, gfn, p2m_ram_logdirty, p2m_ram_rw);
> +            
> +            paging_lock(v->domain);
> +            if ( pt == p2m_ram_logdirty )
> +            {
> +                dv_range_t *range;
> +                v->domain->arch.paging.log_dirty.dirty_count++;
> +                range = dirty_vram_range_find_gfn(v->domain, gfn);
> +                if ( range )
> +                    range->dirty_count++;
> +            }
>              paging_mark_dirty(v->domain, mfn_x(mfn));
> -            p2m_change_type(v->domain, gfn, p2m_ram_logdirty, p2m_ram_rw);
> +            paging_unlock(v->domain);

This is much nicer than the previous version, but I think it would be
even better if this bookkeeping went into paging_mark_dirty() so that
the other callers of paging_mark_dirty() also DTRT with the vram map.
That would avoid leaking mm-locks.h into this non-mm code, too.

Then this change becomes just swapping the order of the two lines (and
perhaps a comment to say why).

> diff --git a/xen/arch/x86/mm/dirty_vram.c b/xen/arch/x86/mm/dirty_vram.c
> new file mode 100644
> index 0000000..e3c7c1f
> --- /dev/null
> +++ b/xen/arch/x86/mm/dirty_vram.c
> @@ -0,0 +1,992 @@
> +/*
> + * arch/x86/mm/dirty_vram.c: Bookkeep/query dirty VRAM pages
> + * with support for multiple frame buffers.
> + *
> + * Copyright (c) 2012, Citrix Systems, Inc. (Robert Phillips)

Please bring in the copyright and authorship notices for the files you
copied code from.  That's at least mm/shadow/common.c and mm/hap/hap.c.

Apart from that this is looking good.  

Are you willing to take on maintainership of this feature (that is, to
respond to questions and fix bugs)?  If so, we should make an update to
the MAINTAINERS file for xen/arch/x86/mm/dirty_vram.c and
xen/include/asm-x86/dirty_vram.h.  That can happen separately, as it'll
need an ack from the other maintainers.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 13:23:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 13:23:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYzPC-0006xK-Op; Thu, 15 Nov 2012 13:22:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TYzPB-0006xF-5L
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 13:22:53 +0000
Received: from [85.158.138.51:60899] by server-15.bemta-3.messagelabs.com id
	9F/8C-09445-CACE4A05; Thu, 15 Nov 2012 13:22:52 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1352985771!21263671!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12094 invoked from network); 15 Nov 2012 13:22:51 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-7.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 13:22:51 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TYzP7-000K53-QW; Thu, 15 Nov 2012 13:22:49 +0000
Date: Thu, 15 Nov 2012 13:22:49 +0000
From: Tim Deegan <tim@xen.org>
To: Robert Phillips <robert.phillips@citrix.com>
Message-ID: <20121115132249.GC75988@ocelot.phlegethon.org>
References: <1352755913-4229-1-git-send-email-robert.phillips@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352755913-4229-1-git-send-email-robert.phillips@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
	in Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi, 

We're very nearly there now.  I think I agree on almost all the
technical decisions but there are still a few things to tidy up (some of
which I mentioned before).

At 16:31 -0500 on 12 Nov (1352737913), Robert Phillips wrote:
> Support is provided for both shadow and hardware assisted paging (HAP) modes.
> This code bookkeeps the set of video frame buffers (vram),
> detects when the guest has modified any of those buffers and, upon request,
> returns a bitmap of the modified pages.
> This lets other software components re-paint the portions of the monitor (or monitors) that have changed.
> Each monitor has a frame buffer of some size at some position in guest physical memory.
> The set of frame buffers being tracked can change over time as monitors are plugged and unplugged.
> (Version 3 of this patch.)

Please linewrap at something less than 80 characters.

> diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile
> index eea5555..e374aac 100644
> --- a/xen/arch/x86/hvm/Makefile
> +++ b/xen/arch/x86/hvm/Makefile
> @@ -22,4 +22,4 @@ obj-y += vlapic.o
>  obj-y += vmsi.o
>  obj-y += vpic.o
>  obj-y += vpt.o
> -obj-y += vpmu.o
> \ No newline at end of file
> +obj-y += vpmu.o

This is an unrelated fix, so doesn't belong in this changeset.

> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index 34da2f5..3a3e5e4 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -57,6 +57,7 @@
>  #include <asm/hvm/cacheattr.h>
>  #include <asm/hvm/trace.h>
>  #include <asm/hvm/nestedhvm.h>
> +#include <asm/dirty_vram.h>
>  #include <asm/mtrr.h>
>  #include <asm/apic.h>
>  #include <public/sched.h>
> @@ -66,6 +67,7 @@
>  #include <asm/mem_event.h>
>  #include <asm/mem_access.h>
>  #include <public/mem_event.h>
> +#include "../mm/mm-locks.h"
>  
>  bool_t __read_mostly hvm_enabled;
>  
> @@ -1433,8 +1435,20 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
>           */
>          if ( access_w )
>          {
> +            p2m_type_t pt;
> +            pt = p2m_change_type(v->domain, gfn, p2m_ram_logdirty, p2m_ram_rw);
> +            
> +            paging_lock(v->domain);
> +            if ( pt == p2m_ram_logdirty )
> +            {
> +                dv_range_t *range;
> +                v->domain->arch.paging.log_dirty.dirty_count++;
> +                range = dirty_vram_range_find_gfn(v->domain, gfn);
> +                if ( range )
> +                    range->dirty_count++;
> +            }
>              paging_mark_dirty(v->domain, mfn_x(mfn));
> -            p2m_change_type(v->domain, gfn, p2m_ram_logdirty, p2m_ram_rw);
> +            paging_unlock(v->domain);

This is much nicer than the previous version, but I think it would be
even better if this bookkeeping went into paging_mark_dirty() so that
the other callers of paging_mark_dirty() also DTRT with the vram map.
That would avoid leaking mm-locks.h into this non-mm code, too.

Then this change becomes just swapping the order of the two lines (and
perhaps a comment to say why).

> diff --git a/xen/arch/x86/mm/dirty_vram.c b/xen/arch/x86/mm/dirty_vram.c
> new file mode 100644
> index 0000000..e3c7c1f
> --- /dev/null
> +++ b/xen/arch/x86/mm/dirty_vram.c
> @@ -0,0 +1,992 @@
> +/*
> + * arch/x86/mm/dirty_vram.c: Bookkeep/query dirty VRAM pages
> + * with support for multiple frame buffers.
> + *
> + * Copyright (c) 2012, Citrix Systems, Inc. (Robert Phillips)

Please bring in the copyright and authorship notices for the files you
copied code from.  That's at least mm/shadow/common.c and mm/hap/hap.c.

Apart from that this is looking good.  

Are you willing to take on maintainership of this feature (that is, to
respond to questions and fix bugs)?  If so, we should make an update to
the MAINTAINERS file for xen/arch/x86/mm/dirty_vram.c and
xen/include/asm-x86/dirty_vram.h.  That can happen separately, as it'll
need an ack from the other maintainers.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 13:32:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 13:32:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYzYV-0007Dj-RG; Thu, 15 Nov 2012 13:32:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYzYU-0007De-Bs
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 13:32:30 +0000
Received: from [85.158.137.99:37659] by server-14.bemta-3.messagelabs.com id
	D3/24-12788-7EEE4A05; Thu, 15 Nov 2012 13:32:23 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1352986342!19248962!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28012 invoked from network); 15 Nov 2012 13:32:22 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 13:32:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,257,1352073600"; d="scan'208";a="15827994"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 13:32:22 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 13:32:22 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYzYM-00075h-4o;
	Thu, 15 Nov 2012 13:32:22 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYzYL-0000FG-V5;
	Thu, 15 Nov 2012 13:32:22 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14399-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 15 Nov 2012 13:32:21 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14399: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14399 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14399/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14395
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14395
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14395
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14395

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  d1d05cb59a76
baseline version:
 xen                  d1d05cb59a76

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 13:32:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 13:32:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TYzYV-0007Dj-RG; Thu, 15 Nov 2012 13:32:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TYzYU-0007De-Bs
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 13:32:30 +0000
Received: from [85.158.137.99:37659] by server-14.bemta-3.messagelabs.com id
	D3/24-12788-7EEE4A05; Thu, 15 Nov 2012 13:32:23 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1352986342!19248962!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28012 invoked from network); 15 Nov 2012 13:32:22 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 13:32:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,257,1352073600"; d="scan'208";a="15827994"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 13:32:22 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 13:32:22 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TYzYM-00075h-4o;
	Thu, 15 Nov 2012 13:32:22 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TYzYL-0000FG-V5;
	Thu, 15 Nov 2012 13:32:22 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14399-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 15 Nov 2012 13:32:21 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14399: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14399 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14399/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14395
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14395
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14395
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14395

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  d1d05cb59a76
baseline version:
 xen                  d1d05cb59a76

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 14:12:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 14:12:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ0B2-0007yL-KF; Thu, 15 Nov 2012 14:12:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1TZ0B0-0007y0-PS; Thu, 15 Nov 2012 14:12:19 +0000
Received: from [85.158.139.83:40073] by server-9.bemta-5.messagelabs.com id
	F4/4D-29295-148F4A05; Thu, 15 Nov 2012 14:12:17 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1352988735!30424280!1
X-Originating-IP: [209.85.214.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25158 invoked from network); 15 Nov 2012 14:12:15 -0000
Received: from mail-bk0-f45.google.com (HELO mail-bk0-f45.google.com)
	(209.85.214.45)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 14:12:15 -0000
Received: by mail-bk0-f45.google.com with SMTP id je9so793908bkc.32
	for <multiple recipients>; Thu, 15 Nov 2012 06:12:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:date:from:reply-to:user-agent:mime-version:to
	:subject:content-type:content-transfer-encoding;
	bh=ZrYpW9mUwOBN8gPyb2LOCMQFSC/3chyUSW3cwAOUL74=;
	b=IpA39dbxiZEbjmpmIDQDOZPjKYsdAXJuAm1uHoPERrISSASgwxJ3G2aorHlsobUwi0
	8ZhyU8Jryfj4jGacAcd0ulLufrY3eon58Q260SRkXwudlLa7bzapL9Vjc56FzIp8A68J
	FyTztcsMfioHub65mSabCDX91v2CcjQZTdgcZUIA2K75dvOZI1Tg98pgiSsQ0lFbiOPW
	t5UBOLk5cctVlrIl1BDp253bzvW1UDjZnu5r4ZiGNAYXpGKnahBALvNSILPoitJHjpp1
	tAsG5HuozycqccaXjXgdS5R8uEu0dtGhLMwItK3Hng/gryAUKeBXwAjNk3qb/bFNHvuB
	hvrA==
Received: by 10.204.147.89 with SMTP id k25mr441600bkv.127.1352988735442;
	Thu, 15 Nov 2012 06:12:15 -0800 (PST)
Received: from [172.16.26.11] (b0fb37e5.bb.sky.com. [176.251.55.229])
	by mx.google.com with ESMTPS id
	ht18sm10434280bkc.14.2012.11.15.06.12.14
	(version=SSLv3 cipher=OTHER); Thu, 15 Nov 2012 06:12:14 -0800 (PST)
Message-ID: <50A4F83D.4000205@xen.org>
Date: Thu, 15 Nov 2012 14:12:13 +0000
From: Lars Kurth <lars.kurth@xen.org>
User-Agent: Mozilla/5.0 (Windows NT 6.1;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, 
	"xen-api@lists.xen.org" <xen-api@lists.xen.org>, xen-arm@lists.xen.org
Subject: [Xen-devel] Getting into shape for GSOC 2013
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: lars.kurth@xen.org
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi everybody,

this is a gentle reminder to update 
http://wiki.xen.org/wiki/Xen_Development_Projects and to start thinking 
about projects that are suitable for GSoC. The template to add items to 
the project page is below...

{{project
|Project=Project description
|Date=date of insert
|Contact=Owner name
|Desc=Description of
|GSoC=Yes or No, or any other GSoC related comment
}}

In 2012, we didn't make it into GSoC because we didn't have a good 
enough project list. We need to have a list of about 10 good project 
proposals for GSoC and present these nicely. It would be a real shame, 
if we didn't make it in 2013, in particular with some of the exciting 
work which is going on at the moment.

In 2011, when we made it our project list was at 
http://wiki.xen.org/wiki/Archived/GSoc_2011_Ideas ... Google has raised 
the bar, so we need to have
a) Really good descriptions for our GSoC projects
b) Pre-assign mentors to each project
c) Ideally I would like to add biography and interest section for all 
our mentors. I can create a wiki template for mentors if it helps

All this needs to be in place when we apply for GSoC as a mentoring 
organisation. The application deadline is likely in early February 2013, 
so starting on this now should leave us in good shape! If we get a good 
list of projects together this year, we can tidy it up, iterate and 
improve in January!

Best Regards
Lars

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 14:12:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 14:12:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ0B2-0007yL-KF; Thu, 15 Nov 2012 14:12:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1TZ0B0-0007y0-PS; Thu, 15 Nov 2012 14:12:19 +0000
Received: from [85.158.139.83:40073] by server-9.bemta-5.messagelabs.com id
	F4/4D-29295-148F4A05; Thu, 15 Nov 2012 14:12:17 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1352988735!30424280!1
X-Originating-IP: [209.85.214.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25158 invoked from network); 15 Nov 2012 14:12:15 -0000
Received: from mail-bk0-f45.google.com (HELO mail-bk0-f45.google.com)
	(209.85.214.45)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 14:12:15 -0000
Received: by mail-bk0-f45.google.com with SMTP id je9so793908bkc.32
	for <multiple recipients>; Thu, 15 Nov 2012 06:12:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:date:from:reply-to:user-agent:mime-version:to
	:subject:content-type:content-transfer-encoding;
	bh=ZrYpW9mUwOBN8gPyb2LOCMQFSC/3chyUSW3cwAOUL74=;
	b=IpA39dbxiZEbjmpmIDQDOZPjKYsdAXJuAm1uHoPERrISSASgwxJ3G2aorHlsobUwi0
	8ZhyU8Jryfj4jGacAcd0ulLufrY3eon58Q260SRkXwudlLa7bzapL9Vjc56FzIp8A68J
	FyTztcsMfioHub65mSabCDX91v2CcjQZTdgcZUIA2K75dvOZI1Tg98pgiSsQ0lFbiOPW
	t5UBOLk5cctVlrIl1BDp253bzvW1UDjZnu5r4ZiGNAYXpGKnahBALvNSILPoitJHjpp1
	tAsG5HuozycqccaXjXgdS5R8uEu0dtGhLMwItK3Hng/gryAUKeBXwAjNk3qb/bFNHvuB
	hvrA==
Received: by 10.204.147.89 with SMTP id k25mr441600bkv.127.1352988735442;
	Thu, 15 Nov 2012 06:12:15 -0800 (PST)
Received: from [172.16.26.11] (b0fb37e5.bb.sky.com. [176.251.55.229])
	by mx.google.com with ESMTPS id
	ht18sm10434280bkc.14.2012.11.15.06.12.14
	(version=SSLv3 cipher=OTHER); Thu, 15 Nov 2012 06:12:14 -0800 (PST)
Message-ID: <50A4F83D.4000205@xen.org>
Date: Thu, 15 Nov 2012 14:12:13 +0000
From: Lars Kurth <lars.kurth@xen.org>
User-Agent: Mozilla/5.0 (Windows NT 6.1;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, 
	"xen-api@lists.xen.org" <xen-api@lists.xen.org>, xen-arm@lists.xen.org
Subject: [Xen-devel] Getting into shape for GSOC 2013
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: lars.kurth@xen.org
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi everybody,

this is a gentle reminder to update 
http://wiki.xen.org/wiki/Xen_Development_Projects and to start thinking 
about projects that are suitable for GSoC. The template to add items to 
the project page is below...

{{project
|Project=Project description
|Date=date of insert
|Contact=Owner name
|Desc=Description of
|GSoC=Yes or No, or any other GSoC related comment
}}

In 2012, we didn't make it into GSoC because we didn't have a good 
enough project list. We need to have a list of about 10 good project 
proposals for GSoC and present these nicely. It would be a real shame, 
if we didn't make it in 2013, in particular with some of the exciting 
work which is going on at the moment.

In 2011, when we made it our project list was at 
http://wiki.xen.org/wiki/Archived/GSoc_2011_Ideas ... Google has raised 
the bar, so we need to have
a) Really good descriptions for our GSoC projects
b) Pre-assign mentors to each project
c) Ideally I would like to add biography and interest section for all 
our mentors. I can create a wiki template for mentors if it helps

All this needs to be in place when we apply for GSoC as a mentoring 
organisation. The application deadline is likely in early February 2013, 
so starting on this now should leave us in good shape! If we get a good 
list of projects together this year, we can tidy it up, iterate and 
improve in January!

Best Regards
Lars

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 14:28:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 14:28:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ0Py-0008M6-6k; Thu, 15 Nov 2012 14:27:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <steve@zentific.com>) id 1TZ0Pw-0008M0-Ma
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 14:27:44 +0000
Received: from [85.158.138.51:55319] by server-11.bemta-3.messagelabs.com id
	00/C3-19361-FDBF4A05; Thu, 15 Nov 2012 14:27:43 +0000
X-Env-Sender: steve@zentific.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1352989658!30067381!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15657 invoked from network); 15 Nov 2012 14:27:39 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 14:27:39 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so1990537vbi.32
	for <xen-devel@lists.xen.org>; Thu, 15 Nov 2012 06:27:38 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type:x-gm-message-state;
	bh=DB6CIbw6abMXPQ3b7svzPxFvSp1VRLKuuynKlHvtqbc=;
	b=OGZ1n5KWJbxhsLQZSoYOfZe1NLKYMBBvaRWXbmBzTAgns0LNlFvnPlSaPdUIbOTSDU
	01jjkkKBaR9SF+T8GSw55sMQOaZAyv+N3/e5cd3jO3pqrZSgDFVAQXYmkdqX6UWLyBsQ
	CUtCMuy7xULzLB64Pv7tjyVbUb53RZ0JDCRN90scP9/XcfOSwCdcLFj7DEP9Bf4UiWtg
	lQo8liqAYWPYhp/0Pjh96JyY3t3lIwM+uGPlzKYevPEezs0/Wil5FH4niIMbx/UarhHA
	GhG3VV8NkkNcCCHnszVnBWQ0zA0+JUBg/7LN9lzQjGDaXVzu6kXwjpP+PyQyTVjH4UZp
	n3DA==
Received: by 10.52.26.242 with SMTP id o18mr1348851vdg.90.1352989658151; Thu,
	15 Nov 2012 06:27:38 -0800 (PST)
MIME-Version: 1.0
Received: by 10.220.1.65 with HTTP; Thu, 15 Nov 2012 06:26:56 -0800 (PST)
In-Reply-To: <50A22DD7.7020901@gmail.com>
References: <50A16639.2090209@gmail.com>
	<1352800791.7491.21.camel@zakaz.uk.xensource.com>
	<50A22044.6060608@gmail.com>
	<1352802973.7491.40.camel@zakaz.uk.xensource.com>
	<50A225CA.2080705@gmail.com>
	<1352805173.7491.57.camel@zakaz.uk.xensource.com>
	<50A22DD7.7020901@gmail.com>
From: Steven Maresca <steve@zentific.com>
Date: Thu, 15 Nov 2012 09:26:56 -0500
Message-ID: <CANSvah4437FvmZe-uvcrZOvC2NJ7hZUE8y9DUFUd29BWPHRc6g@mail.gmail.com>
To: Razvan Cojocaru <rzvncj@gmail.com>
X-Gm-Message-State: ALoCoQmBJqkHwwxqP/VeBim4cz6HnD3gWx9EFPZCyEF1+NeYI/JtzEBVm3OPq/kJbkVWbz0awXhY
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 13, 2012 at 6:24 AM, Razvan Cojocaru <rzvncj@gmail.com> wrote:
>> Perhaps it would be useful to build on the vmitools (previously
>> xenaccess)? http://code.google.com/p/vmitools/
>
>
> Indeed, but LibVMI does not offer event-based access, and polling is not
> really a solution.
>
>
>> In general we prefer not to put stuff in the hypervisor unless
>> absolutely required.
>
>
> Me too :)
>
> Thanks,
> Razvan

FYI, vmitools (LibVMI) does have support for memory events, just not
in the main branch. The events branch works properly for 4.1.x; I have
updated it to support 4.2, but due to other more pressing matters, I
have not had time to commit it to the main branch.

If you're interested in using the memory event facilities abstracted
via LibVMI, please let me know.

Steve

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 14:28:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 14:28:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ0Py-0008M6-6k; Thu, 15 Nov 2012 14:27:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <steve@zentific.com>) id 1TZ0Pw-0008M0-Ma
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 14:27:44 +0000
Received: from [85.158.138.51:55319] by server-11.bemta-3.messagelabs.com id
	00/C3-19361-FDBF4A05; Thu, 15 Nov 2012 14:27:43 +0000
X-Env-Sender: steve@zentific.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1352989658!30067381!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15657 invoked from network); 15 Nov 2012 14:27:39 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 14:27:39 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so1990537vbi.32
	for <xen-devel@lists.xen.org>; Thu, 15 Nov 2012 06:27:38 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type:x-gm-message-state;
	bh=DB6CIbw6abMXPQ3b7svzPxFvSp1VRLKuuynKlHvtqbc=;
	b=OGZ1n5KWJbxhsLQZSoYOfZe1NLKYMBBvaRWXbmBzTAgns0LNlFvnPlSaPdUIbOTSDU
	01jjkkKBaR9SF+T8GSw55sMQOaZAyv+N3/e5cd3jO3pqrZSgDFVAQXYmkdqX6UWLyBsQ
	CUtCMuy7xULzLB64Pv7tjyVbUb53RZ0JDCRN90scP9/XcfOSwCdcLFj7DEP9Bf4UiWtg
	lQo8liqAYWPYhp/0Pjh96JyY3t3lIwM+uGPlzKYevPEezs0/Wil5FH4niIMbx/UarhHA
	GhG3VV8NkkNcCCHnszVnBWQ0zA0+JUBg/7LN9lzQjGDaXVzu6kXwjpP+PyQyTVjH4UZp
	n3DA==
Received: by 10.52.26.242 with SMTP id o18mr1348851vdg.90.1352989658151; Thu,
	15 Nov 2012 06:27:38 -0800 (PST)
MIME-Version: 1.0
Received: by 10.220.1.65 with HTTP; Thu, 15 Nov 2012 06:26:56 -0800 (PST)
In-Reply-To: <50A22DD7.7020901@gmail.com>
References: <50A16639.2090209@gmail.com>
	<1352800791.7491.21.camel@zakaz.uk.xensource.com>
	<50A22044.6060608@gmail.com>
	<1352802973.7491.40.camel@zakaz.uk.xensource.com>
	<50A225CA.2080705@gmail.com>
	<1352805173.7491.57.camel@zakaz.uk.xensource.com>
	<50A22DD7.7020901@gmail.com>
From: Steven Maresca <steve@zentific.com>
Date: Thu, 15 Nov 2012 09:26:56 -0500
Message-ID: <CANSvah4437FvmZe-uvcrZOvC2NJ7hZUE8y9DUFUd29BWPHRc6g@mail.gmail.com>
To: Razvan Cojocaru <rzvncj@gmail.com>
X-Gm-Message-State: ALoCoQmBJqkHwwxqP/VeBim4cz6HnD3gWx9EFPZCyEF1+NeYI/JtzEBVm3OPq/kJbkVWbz0awXhY
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 13, 2012 at 6:24 AM, Razvan Cojocaru <rzvncj@gmail.com> wrote:
>> Perhaps it would be useful to build on the vmitools (previously
>> xenaccess)? http://code.google.com/p/vmitools/
>
>
> Indeed, but LibVMI does not offer event-based access, and polling is not
> really a solution.
>
>
>> In general we prefer not to put stuff in the hypervisor unless
>> absolutely required.
>
>
> Me too :)
>
> Thanks,
> Razvan

FYI, vmitools (LibVMI) does have support for memory events, just not
in the main branch. The events branch works properly for 4.1.x; I have
updated it to support 4.2, but due to other more pressing matters, I
have not had time to commit it to the main branch.

If you're interested in using the memory event facilities abstracted
via LibVMI, please let me know.

Steve

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 14:34:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 14:34:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ0WE-0008Vm-1U; Thu, 15 Nov 2012 14:34:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TZ0WC-0008Vh-TO
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 14:34:13 +0000
Received: from [85.158.143.99:45621] by server-2.bemta-4.messagelabs.com id
	AC/EA-28922-46DF4A05; Thu, 15 Nov 2012 14:34:12 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1352990050!24792870!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM4MzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5569 invoked from network); 15 Nov 2012 14:34:11 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 14:34:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,257,1352073600"; d="scan'208";a="44709772"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 14:34:09 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 09:34:10 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TZ0W9-0000pR-90;
	Thu, 15 Nov 2012 14:34:09 +0000
Date: Thu, 15 Nov 2012 14:33:35 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
In-Reply-To: <F4532D0E-2988-4B56-8555-0ADCE9D44CC8@gridcentric.ca>
Message-ID: <alpine.DEB.2.02.1211151425210.28049@kaball.uk.xensource.com>
References: <F4532D0E-2988-4B56-8555-0ADCE9D44CC8@gridcentric.ca>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Peter Feiner <peter@gridcentric.ca>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] Question on Xen management of qemu ram blocks and
 memory regions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 14 Nov 2012, Andres Lagar-Cavilla wrote:
> Stefano, and Xen-qemu team, I have a question.
> 
> The standard Xen-qemu workflow has Xen manage the physmap for a VM, and allocate all the backing memory for valid pfns, regardless of whether they are MMIO, RAM, etc. On save/migrate, when using upstream qemu, a special monitor command is used to save the device model state, while the save/restore code blocks in libxc takes care of the memory.
> 
> Qemu has a chain of ram blocks with offsets, each of which is further subdivided into memory regions that map to specific chunks of the physmap.
> 
> AFAICT, the restore code in libxc has no knowledge of qemu's ram blocks and offsets. My question is, how is a mismatch avoided?
> 
> How does the workflow ensure that all the sub regions in each ram block map to the same physmap chunks on restore? Is this an implicit guarantee from qemu when building the VM (with the same command line) on the restore side? 
> 
> Are the regions and physmap offsets contained in the device state that is saved?
> 
> If, for example, I were to save/restore a VM with four e1000 emulated devices, how does the workflow guarantee that each physmap region backing each e1000 ROM gets reconstructed with exactly the same ram block, offset, and physmap chunk coordinates?
> 
> Code inspection seems to suggest qemu will lay out things deterministically given the command line. I want to make sure I am not missing anything.

Yes, it does. Moreover QEMU is going to save everything it needs to
restore the state of the devices exactly the way it was, MMIO regions
addresses and sizes included.

The only issue is the videoram: even though it is an MMIO region, it is
saved by Xen because it looks like normal ram to the hypervisor.
To solve the problem QEMU writes the location and the size of the
videoram to xenstore and keeps the records up to date.
The toolstack reads those records and adds them to the savefile.

At restore time the toolstack writes back the records to xenstore and
QEMU at boot time uses them to populate a list of physmap regions, see
xen_read_physmap.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 14:34:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 14:34:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ0WE-0008Vm-1U; Thu, 15 Nov 2012 14:34:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TZ0WC-0008Vh-TO
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 14:34:13 +0000
Received: from [85.158.143.99:45621] by server-2.bemta-4.messagelabs.com id
	AC/EA-28922-46DF4A05; Thu, 15 Nov 2012 14:34:12 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1352990050!24792870!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM4MzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5569 invoked from network); 15 Nov 2012 14:34:11 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 14:34:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,257,1352073600"; d="scan'208";a="44709772"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 14:34:09 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 09:34:10 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TZ0W9-0000pR-90;
	Thu, 15 Nov 2012 14:34:09 +0000
Date: Thu, 15 Nov 2012 14:33:35 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
In-Reply-To: <F4532D0E-2988-4B56-8555-0ADCE9D44CC8@gridcentric.ca>
Message-ID: <alpine.DEB.2.02.1211151425210.28049@kaball.uk.xensource.com>
References: <F4532D0E-2988-4B56-8555-0ADCE9D44CC8@gridcentric.ca>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Peter Feiner <peter@gridcentric.ca>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] Question on Xen management of qemu ram blocks and
 memory regions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 14 Nov 2012, Andres Lagar-Cavilla wrote:
> Stefano, and Xen-qemu team, I have a question.
> 
> The standard Xen-qemu workflow has Xen manage the physmap for a VM, and allocate all the backing memory for valid pfns, regardless of whether they are MMIO, RAM, etc. On save/migrate, when using upstream qemu, a special monitor command is used to save the device model state, while the save/restore code blocks in libxc takes care of the memory.
> 
> Qemu has a chain of ram blocks with offsets, each of which is further subdivided into memory regions that map to specific chunks of the physmap.
> 
> AFAICT, the restore code in libxc has no knowledge of qemu's ram blocks and offsets. My question is, how is a mismatch avoided?
> 
> How does the workflow ensure that all the sub regions in each ram block map to the same physmap chunks on restore? Is this an implicit guarantee from qemu when building the VM (with the same command line) on the restore side? 
> 
> Are the regions and physmap offsets contained in the device state that is saved?
> 
> If, for example, I were to save/restore a VM with four e1000 emulated devices, how does the workflow guarantee that each physmap region backing each e1000 ROM gets reconstructed with exactly the same ram block, offset, and physmap chunk coordinates?
> 
> Code inspection seems to suggest qemu will lay out things deterministically given the command line. I want to make sure I am not missing anything.

Yes, it does. Moreover QEMU is going to save everything it needs to
restore the state of the devices exactly the way it was, MMIO regions
addresses and sizes included.

The only issue is the videoram: even though it is an MMIO region, it is
saved by Xen because it looks like normal ram to the hypervisor.
To solve the problem QEMU writes the location and the size of the
videoram to xenstore and keeps the records up to date.
The toolstack reads those records and adds them to the savefile.

At restore time the toolstack writes back the records to xenstore and
QEMU at boot time uses them to populate a list of physmap regions, see
xen_read_physmap.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 14:37:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 14:37:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ0ZW-0000Hb-Lh; Thu, 15 Nov 2012 14:37:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TZ0ZU-0000HT-9h
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 14:37:36 +0000
Received: from [85.158.139.83:26335] by server-13.bemta-5.messagelabs.com id
	EA/DD-27809-F2EF4A05; Thu, 15 Nov 2012 14:37:35 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1352990253!30428177!1
X-Originating-IP: [91.199.104.2]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28894 invoked from network); 15 Nov 2012 14:37:34 -0000
Received: from mail.bitdefender.com (HELO mail.bitdefender.com) (91.199.104.2)
	by server-12.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 14:37:34 -0000
Received: (qmail 7553 invoked from network); 15 Nov 2012 16:37:33 +0200
Received: from rcojocaru.dsd.ro (HELO ?10.10.14.59?)
	(rcojocaru@bitdefender.com@10.10.14.59)
	by mail.bitdefender.com with AES256-SHA encrypted SMTP;
	15 Nov 2012 16:37:33 +0200
Message-ID: <50A4FE37.4040809@gmail.com>
Date: Thu, 15 Nov 2012 16:37:43 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Steven Maresca <steve@zentific.com>
References: <50A16639.2090209@gmail.com>
	<1352800791.7491.21.camel@zakaz.uk.xensource.com>
	<50A22044.6060608@gmail.com>
	<1352802973.7491.40.camel@zakaz.uk.xensource.com>
	<50A225CA.2080705@gmail.com>
	<1352805173.7491.57.camel@zakaz.uk.xensource.com>
	<50A22DD7.7020901@gmail.com>
	<CANSvah4437FvmZe-uvcrZOvC2NJ7hZUE8y9DUFUd29BWPHRc6g@mail.gmail.com>
In-Reply-To: <CANSvah4437FvmZe-uvcrZOvC2NJ7hZUE8y9DUFUd29BWPHRc6g@mail.gmail.com>
X-BitDefender-Spam: No (0)
X-BitDefender-SpamStamp: Build: [Engines: 2.13.3.14894, Dats: 226806,
	Stamp: 3], Multi: [Enabled], BW: [Enabled], RBL DNSBL: [Disabled],
	APM: [Enabled, Score: 500, Flags: NN_GMAIL_WITH_XMAILER_ADN;
	NN_LEGIT_VALID_REPLY; NN_NO_LINK_NMD;
	NN_EXEC_H_YAHOO_AND_GMAIL_NO_DOMAIN_KEY; NN_LEGIT_S_SQARE_BRACKETS],
	SGN: [Enabled], URL: [Enabled], URI DNSBL: [Disabled], SQMD: [Enabled, 
	Hits: none, MD5: c6f6de2501c0a17d6b3f9674778f6f7c.fuzzy.fzrbl.org],
	RTDA: [Disabled, Hit: No], total: 0(775)
X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.0 on
	elfie.dsd.hq, sigver: 7.44010
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> FYI, vmitools (LibVMI) does have support for memory events, just not
> in the main branch. The events branch works properly for 4.1.x; I have
> updated it to support 4.2, but due to other more pressing matters, I
> have not had time to commit it to the main branch.
>
> If you're interested in using the memory event facilities abstracted
> via LibVMI, please let me know.

I am. I've already pulled the events branch from your git server to try 
out (on an up-to-date 64bit Arch Linux machine), but it didn't compile:

make[3]: Entering directory `vmitools/libvmi'
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. 
-I.. -I..   -fvisibility=hidden -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include   -g -O2 -MT driver/libvmi_la-interface.lo 
-MD -MP -MF driver/.deps/libvmi_la-interface.Tpo -c -o 
driver/libvmi_la-interface.lo `test -f 'driver/interface.c' || echo 
'./'`driver/interface.c
[...]
In file included from ./driver/xen.h:29:0,
                  from driver/interface.c:29:
./driver/xen_events.h:66:5: error: unknown type name 
'mem_event_shared_page_t'

Maybe I missed some ./configure flag?

Thanks,
Razvan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 14:37:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 14:37:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ0ZW-0000Hb-Lh; Thu, 15 Nov 2012 14:37:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TZ0ZU-0000HT-9h
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 14:37:36 +0000
Received: from [85.158.139.83:26335] by server-13.bemta-5.messagelabs.com id
	EA/DD-27809-F2EF4A05; Thu, 15 Nov 2012 14:37:35 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1352990253!30428177!1
X-Originating-IP: [91.199.104.2]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28894 invoked from network); 15 Nov 2012 14:37:34 -0000
Received: from mail.bitdefender.com (HELO mail.bitdefender.com) (91.199.104.2)
	by server-12.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 14:37:34 -0000
Received: (qmail 7553 invoked from network); 15 Nov 2012 16:37:33 +0200
Received: from rcojocaru.dsd.ro (HELO ?10.10.14.59?)
	(rcojocaru@bitdefender.com@10.10.14.59)
	by mail.bitdefender.com with AES256-SHA encrypted SMTP;
	15 Nov 2012 16:37:33 +0200
Message-ID: <50A4FE37.4040809@gmail.com>
Date: Thu, 15 Nov 2012 16:37:43 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Steven Maresca <steve@zentific.com>
References: <50A16639.2090209@gmail.com>
	<1352800791.7491.21.camel@zakaz.uk.xensource.com>
	<50A22044.6060608@gmail.com>
	<1352802973.7491.40.camel@zakaz.uk.xensource.com>
	<50A225CA.2080705@gmail.com>
	<1352805173.7491.57.camel@zakaz.uk.xensource.com>
	<50A22DD7.7020901@gmail.com>
	<CANSvah4437FvmZe-uvcrZOvC2NJ7hZUE8y9DUFUd29BWPHRc6g@mail.gmail.com>
In-Reply-To: <CANSvah4437FvmZe-uvcrZOvC2NJ7hZUE8y9DUFUd29BWPHRc6g@mail.gmail.com>
X-BitDefender-Spam: No (0)
X-BitDefender-SpamStamp: Build: [Engines: 2.13.3.14894, Dats: 226806,
	Stamp: 3], Multi: [Enabled], BW: [Enabled], RBL DNSBL: [Disabled],
	APM: [Enabled, Score: 500, Flags: NN_GMAIL_WITH_XMAILER_ADN;
	NN_LEGIT_VALID_REPLY; NN_NO_LINK_NMD;
	NN_EXEC_H_YAHOO_AND_GMAIL_NO_DOMAIN_KEY; NN_LEGIT_S_SQARE_BRACKETS],
	SGN: [Enabled], URL: [Enabled], URI DNSBL: [Disabled], SQMD: [Enabled, 
	Hits: none, MD5: c6f6de2501c0a17d6b3f9674778f6f7c.fuzzy.fzrbl.org],
	RTDA: [Disabled, Hit: No], total: 0(775)
X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.0 on
	elfie.dsd.hq, sigver: 7.44010
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> FYI, vmitools (LibVMI) does have support for memory events, just not
> in the main branch. The events branch works properly for 4.1.x; I have
> updated it to support 4.2, but due to other more pressing matters, I
> have not had time to commit it to the main branch.
>
> If you're interested in using the memory event facilities abstracted
> via LibVMI, please let me know.

I am. I've already pulled the events branch from your git server to try 
out (on an up-to-date 64bit Arch Linux machine), but it didn't compile:

make[3]: Entering directory `vmitools/libvmi'
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. 
-I.. -I..   -fvisibility=hidden -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include   -g -O2 -MT driver/libvmi_la-interface.lo 
-MD -MP -MF driver/.deps/libvmi_la-interface.Tpo -c -o 
driver/libvmi_la-interface.lo `test -f 'driver/interface.c' || echo 
'./'`driver/interface.c
[...]
In file included from ./driver/xen.h:29:0,
                  from driver/interface.c:29:
./driver/xen_events.h:66:5: error: unknown type name 
'mem_event_shared_page_t'

Maybe I missed some ./configure flag?

Thanks,
Razvan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 14:59:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 14:59:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ0uf-0000it-Ma; Thu, 15 Nov 2012 14:59:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fantonifabio@tiscali.it>) id 1TZ0ue-0000io-6g
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 14:59:29 +0000
Received: from [85.158.143.99:32555] by server-3.bemta-4.messagelabs.com id
	49/11-06841-F4305A05; Thu, 15 Nov 2012 14:59:27 +0000
X-Env-Sender: fantonifabio@tiscali.it
X-Msg-Ref: server-11.tower-216.messagelabs.com!1352991565!22547102!1
X-Originating-IP: [94.23.245.208]
X-SpamReason: No, hits=0.9 required=7.0 tests=HTML_20_30,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30059 invoked from network); 15 Nov 2012 14:59:25 -0000
Received: from unknown (HELO lnx3.fantu.it) (94.23.245.208)
	by server-11.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 14:59:25 -0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by lnx3.fantu.it (Postfix) with ESMTP id C5D35401747;
	Thu, 15 Nov 2012 15:57:26 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at lnx3.fantu.it
Received: from lnx3.fantu.it ([127.0.0.1])
	by localhost (lnx3.fantu.it [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id VNbwypF64QnJ; Thu, 15 Nov 2012 15:57:25 +0100 (CET)
Received: from [192.168.178.50]
	(host51-78-dynamic.2-87-r.retail.telecomitalia.it [87.2.78.51])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: prova@fantu.it)
	by lnx3.fantu.it (Postfix) with ESMTPSA id 1FBE94016DF;
	Thu, 15 Nov 2012 15:57:20 +0100 (CET)
Message-ID: <50A502C5.9070904@tiscali.it>
Date: Thu, 15 Nov 2012 15:57:09 +0100
From: Fabio Fantoni <fantonifabio@tiscali.it>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel <xen-devel@lists.xen.org>, 
	Anthony Liguori <aliguori@us.ibm.com>, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Xen-devel] Qemu crash on xen hvm domU with spice + qxl
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: fantonifabio@tiscali.it
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7913354209453772044=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--===============7913354209453772044==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms080700070703050209090706"

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--------------ms080700070703050209090706
Content-Type: multipart/mixed;
 boundary="------------060501020502040905060206"

This is a multi-part message in MIME format.
--------------060501020502040905060206
Content-Type: multipart/alternative;
 boundary="------------090700080306030300070805"


--------------090700080306030300070805
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: quoted-printable

Starting domU with spice + qxl qemu always crashes.

-------------------------------------------------------------------------=
----
/var/log/xen/qemu-dm-QUANTALHVM.log
-------------------------------------------------------------------------=
----
main_channel_link: add main channel client
main_channel_handle_parsed: net test: latency 51.500000 ms, bitrate=20
496725685 bps (473.714528 Mbps)
red_dispatcher_set_cursor_peer:
inputs_connect: inputs channel client create
id 0, group 0, virt start 0, virt end ffffffffffffffff, generation 0,=20
delta 0
id 1, group 1, virt start 7f3da8327000, virt end 7f3dac325000,=20
generation 0, delta 7f3da8327000
id 2, group 1, virt start 7f3da03bd000, virt end 7f3da43bd000,=20
generation 0, delta 7f3da03bd000
*(/usr/sbin/xl:3513): Spice-CRITICAL **: red_memslots.c:123:get_virt:=20
slot_id 194 too big, addr=3Dc2c2c2c2c2c2c2c2*
-------------------------------------------------------------------------=
----

Dom0:
Wheezy 64 bit with kernel from package linux-image-3.2.0-4-amd64 version =

3.2.32-1, package blktap-dkms, spice 0.12.0, spice protocol 0.12.2 and=20
all dependency packages for xen
hg clone http://xenbits.xen.org/hg/xen-unstable.hg (in this build=20
changeset is 26152:d1d05cb59a76)
-------------------------
vi Config.mk
------------
PYTHON_PREFIX_ARG =3D
QEMU_UPSTREAM_URL ?=3D git://git.qemu.org/qemu.git
SEABIOS_UPSTREAM_URL ?=3D git://code.coreboot.org/seabios.git
SEABIOS_UPSTREAM_TAG ?=3D master
-------------------------
Added some patches:
- tools: Improve make deb
- Add qxl vga interface support v5
- tools: Compile qemu-xen with spice
-------------------------
=2E/configure
-------------------------
make deb

Qemu upstream: commit ce34cf72fe508b27a78f83c184142e8d1e6a048a
Seabios upstream: commit 9600c800ac2a6b34a9993d99e7d3d4f7301e9265

Are there some new seabios settings that I'm not aware of in order to=20
get xen and spice with qxl functioning. See build log on attachment for=20
details.

Here the configuration of the domU tested:
-------------------------------------------------------------------------=
----
name=3D'QUANTALHVM'
builder=3D"hvm"
memory=3D2048
vcpus=3D2
hap=3D1
pae=3D1
acpi=3D1
apic=3D1
nx=3D1
vif=3D['bridge=3Dxenbr0']
#vfb=3D['vnc=3D1,vncunused=3D1,vnclisten=3D"0.0.0.0",keymap=3D"it"']
#disk=3D['/mnt/vm/disks/PRECISEHVM.disk1.xm,raw,hda,rw',=20
'/dev/sr0,raw,hdb,ro,cdrom']
#disk=3D['/mnt/vm/disks/QUANTALHVM.disk1.xm,raw,hda,rw','/mnt/vm/iso/QUAN=
TAL.iso,raw,hdb,ro,cdrom']
disk=3D['/mnt/vm/disks/QUANTALHVM.disk1.xm,raw,hda,rw']
boot=3D'c'
xen_platform_pci=3D1
device_model_version=3D'qemu-xen'
vnc=3D0
#vncunused=3D1
#vnclisten=3D"0.0.0.0"
#keymap=3D"it"
stdvga=3D0
spice=3D1
spicehost=3D'0.0.0.0'
spiceport=3D6000
spicedisable_ticketing=3D1
qxl=3D1
#videoram=3D16
#device_model_args=3D["-vga","qxl","-global","qxl-vga.vram_size_mb=3D64",=
"-global","qxl-vga.ram_size_mb=3D64","-device","virtio-serial-pci,id=3Dvi=
rtio-serial0,max_ports=3D16","-chardev","spicevmc,name=3Dvdagent,id=3Dvda=
gent","-device","virtserialport,nr=3D1,bus=3Dvirtio-serial0.0,chardev=3Dv=
dagent,name=3Dcom.redhat.spice.0"]
-------------------------------------------------------------------------=
----

Someone can help to solve the problem please?
If you need other information and/or test tell me and I'll do it.

--------------090700080306030300070805
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

<html>
  <head>

    <meta http-equiv=3D"content-type" content=3D"text/html; charset=3DISO=
-8859-15">
  </head>
  <body bgcolor=3D"#FFFFFF" text=3D"#000000">
    Starting domU with spice + qxl qemu always crashes.<br>
    <br>
-------------------------------------------------------------------------=
----<br>
    /var/log/xen/qemu-dm-QUANTALHVM.log<br>
-------------------------------------------------------------------------=
----<br>
    main_channel_link: add main channel client<br>
    main_channel_handle_parsed: net test: latency 51.500000 ms, bitrate
    496725685 bps (473.714528 Mbps)<br>
    red_dispatcher_set_cursor_peer:<br>
    inputs_connect: inputs channel client create<br>
    id 0, group 0, virt start 0, virt end ffffffffffffffff, generation
    0, delta 0<br>
    id 1, group 1, virt start 7f3da8327000, virt end 7f3dac325000,
    generation 0, delta 7f3da8327000<br>
    id 2, group 1, virt start 7f3da03bd000, virt end 7f3da43bd000,
    generation 0, delta 7f3da03bd000<br>
    <b>(/usr/sbin/xl:3513): Spice-CRITICAL **:
      red_memslots.c:123:get_virt: slot_id 194 too big,
      addr=3Dc2c2c2c2c2c2c2c2</b><br>
-------------------------------------------------------------------------=
----<br>
    <br>
    Dom0:<br>
    Wheezy 64 bit with kernel from package linux-image-3.2.0-4-amd64
    version 3.2.32-1, package blktap-dkms, spice 0.12.0, spice protocol
    0.12.2 and all dependency packages for xen
    <br>
    hg clone <a class=3D"moz-txt-link-freetext"
      href=3D"http://xenbits.xen.org/hg/xen-unstable.hg">http://xenbits.x=
en.org/hg/xen-unstable.hg</a>
    (in this build changeset is 26152:d1d05cb59a76)
    <br>
    -------------------------
    <br>
    vi Config.mk
    <br>
    ------------
    <br>
    PYTHON_PREFIX_ARG =3D
    <br>
    QEMU_UPSTREAM_URL ?=3D git://git.qemu.org/qemu.git
    <br>
    SEABIOS_UPSTREAM_URL ?=3D git://code.coreboot.org/seabios.git
    <br>
    SEABIOS_UPSTREAM_TAG ?=3D master
    <br>
    -------------------------
    <br>
    Added some patches:
    <br>
    - tools: Improve make deb
    <br>
    - Add qxl vga interface support v5<br>
    - tools: Compile qemu-xen with spice
    <br>
    -------------------------
    <br>
    ./configure
    <br>
    -------------------------
    <br>
    make deb
    <br>
    <br>
    Qemu upstream: commit ce34cf72fe508b27a78f83c184142e8d1e6a048a<br>
    Seabios upstream: commit 9600c800ac2a6b34a9993d99e7d3d4f7301e9265<br>=

    <br>
    Are there some new seabios settings that I'm not aware of in order
    to get xen and spice with qxl functioning. See build log on
    attachment for details.<br>
    <br>
    Here the configuration of the domU tested:<br>
-------------------------------------------------------------------------=
----<br>
    name=3D'QUANTALHVM'<br>
    builder=3D"hvm"<br>
    memory=3D2048<br>
    vcpus=3D2<br>
    hap=3D1<br>
    pae=3D1<br>
    acpi=3D1<br>
    apic=3D1<br>
    nx=3D1<br>
    vif=3D['bridge=3Dxenbr0']<br>
    #vfb=3D['vnc=3D1,vncunused=3D1,vnclisten=3D"0.0.0.0",keymap=3D"it"']<=
br>
    #disk=3D['/mnt/vm/disks/PRECISEHVM.disk1.xm,raw,hda,rw',
    '/dev/sr0,raw,hdb,ro,cdrom']<br>
#disk=3D['/mnt/vm/disks/QUANTALHVM.disk1.xm,raw,hda,rw','/mnt/vm/iso/QUAN=
TAL.iso,raw,hdb,ro,cdrom']<br>
    disk=3D['/mnt/vm/disks/QUANTALHVM.disk1.xm,raw,hda,rw']<br>
    boot=3D'c'<br>
    xen_platform_pci=3D1<br>
    device_model_version=3D'qemu-xen'<br>
    vnc=3D0<br>
    #vncunused=3D1<br>
    #vnclisten=3D"0.0.0.0"<br>
    #keymap=3D"it"<br>
    stdvga=3D0<br>
    spice=3D1<br>
    spicehost=3D'0.0.0.0'<br>
    spiceport=3D6000<br>
    spicedisable_ticketing=3D1<br>
    qxl=3D1<br>
    #videoram=3D16<br>
#device_model_args=3D["-vga","qxl","-global","qxl-vga.vram_size_mb=3D64",=
"-global","qxl-vga.ram_size_mb=3D64","-device","virtio-serial-pci,id=3Dvi=
rtio-serial0,max_ports=3D16","-chardev","spicevmc,name=3Dvdagent,id=3Dvda=
gent","-device","virtserialport,nr=3D1,bus=3Dvirtio-serial0.0,chardev=3Dv=
dagent,name=3Dcom.redhat.spice.0"]<br>
-------------------------------------------------------------------------=
----<br>
    <br>
    Someone can help to solve the problem please?<br>
    If you need other information and/or test tell me and I'll do it.<br>=

  </body>
</html>

--------------090700080306030300070805--

--------------060501020502040905060206
Content-Type: application/octet-stream;
 name="xenbuild.7z"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="xenbuild.7z"

N3q8ryccAANhS06UXrUBAAAAAABdAAAAAAAAAJsL+xQAHmgECYbzOIC5RUbjJg66yLypbeBN
TBXAfWZPAACagHoYvvxOFx9dlg1+CUEWKqPnxsQZDohW8Sg/7+7Qpw9/N0rj7LqXMaRAFVm3
XEKO9X1B9SyjCgbuv4tqJBjv5Hh9dM+NaKxkd0U6c3ASUvf4Bl1OQsgxeDUcRyn+GXFL/UdP
1k2I2k6MOl3HueExZ9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FlHyTc6/f0Yoi45u5PlAgXMk6YDc1XlJLoyG+2KcFKNbZOp
R26gv+Hrgnp6gbnglpHluSEl69mu7LpVsHQ57q4OvA+p8Ohd3HjTUzHOe7Nm29OWwUUZ7qhY
4NzXtZeqdhm1Nl80OkDU8DyFlMuFpybdYpUmbZUdaapqFD731km/UcQMZHjyNbUeFtdFGn/U
NSRkd+HAWdkJXdEu/rupTaZ7lS27PyJpk/ojssTANJnd2S1asExopKYI3oSqRCHFt76GAtmZ
jIAkXimMeJ0O5tY8k2pZQy1yyC71VQ0YTh/vg/hsu8opZXGIEQznP9OU6rbMEfW/mBkx7d6a
54AOnAYj3AARLPNi59D/qxM/EPwTChwff4gm/4CWXYRKI/TWnUj5HG5aZOlBqBCX981MH3m0
N0ZGeK5xVywOGOsT02/rRyrzAKgnN+QWCdNMrEyPaNkcQ5r8EiYc4oI3dEbOQoP16/QgOWL/
DNe89m3YJ2cjrKvVVJzxPMiZOv3/BSSJBOJp21yRvC2hakQmH6zB4LG5MNvvXA1MqQoSiYlY
3qNMV09rkgQbD1NlJ7bucrJuXqaUbXLGJWFYChTdaGMH6yZL6XYv5sYXHFWVVr77zmI5dAAp
VqlQ7PKYikHDZr9uA+zkl97g5mU6XnyIftx8yPYSDpprt1dJtI2j+iYT3nKs4PiFqZfZItuL
Evr0H+zPtJXY7yBMEJNBLWrGHAINo2aNiZHHYxCZ8pSGSsG9U6jd5TkQqS5fvbQbxCSdVF3F
MAABBAYAAQnBXrUABwsBAAEjAwEBBV0AAGAADOC4808ACAoBt3gMMAAABQERGwB4AGUAbgBi
AHUAaQBsAGQALgBsAG8AZwAAABQKAQAuFNfDPMPNARUGAQAgAAAAAAA=
--------------060501020502040905060206--

--------------ms080700070703050209090706
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: Firma crittografica S/MIME

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIA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YXRlIFNpZ25p
bmcxODA2BgNVBAMTL1N0YXJ0Q29tIENsYXNzIDIgUHJpbWFyeSBJbnRlcm1lZGlhdGUgQ2xp
ZW50IENBAgIeYzCBpgYLKoZIhvcNAQkQAgsxgZaggZMwgYwxCzAJBgNVBAYTAklMMRYwFAYD
VQQKEw1TdGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRhbCBDZXJ0aWZpY2F0
ZSBTaWduaW5nMTgwNgYDVQQDEy9TdGFydENvbSBDbGFzcyAyIFByaW1hcnkgSW50ZXJtZWRp
YXRlIENsaWVudCBDQQICHmMwDQYJKoZIhvcNAQEBBQAEggEAEFI8L31aNSVh8BOEbt0ZCIof
kn6ZJEr7gApU8RSi8sCZpzF9KIM37ccxbXCzYSUPkZrgLLm/PEnjjCRVIENXtSosM3fk+BTJ
fSw9z8UOczjQpuS9aXabmPK993RMDbQEeyt86hXT0hqq0SaKZgdMY862gWoQ6UXEIAXh/fgY
kaOXSGIK8o20COxmc3Dw9gpWEH/W/1BZQNUUMeuhEpK/7pIHkm8kJTOgj+BBRO9bb/aIbcIi
svKqX/szRRwUpUxWV7Z2WLKXQE7kyjI0Uqhk6kDANo33JUstNvXy/YEX1+pdgzdPCXGsBK9h
HZBLgejK+p1DJfXweFe1GJs0OgGWowAAAAAAAA==
--------------ms080700070703050209090706--


--===============7913354209453772044==
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.xen.org
http://lists.xen.org/xen-devel

--===============7913354209453772044==--


From xen-devel-bounces@lists.xen.org Thu Nov 15 14:59:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 14:59:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ0uf-0000it-Ma; Thu, 15 Nov 2012 14:59:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fantonifabio@tiscali.it>) id 1TZ0ue-0000io-6g
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 14:59:29 +0000
Received: from [85.158.143.99:32555] by server-3.bemta-4.messagelabs.com id
	49/11-06841-F4305A05; Thu, 15 Nov 2012 14:59:27 +0000
X-Env-Sender: fantonifabio@tiscali.it
X-Msg-Ref: server-11.tower-216.messagelabs.com!1352991565!22547102!1
X-Originating-IP: [94.23.245.208]
X-SpamReason: No, hits=0.9 required=7.0 tests=HTML_20_30,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30059 invoked from network); 15 Nov 2012 14:59:25 -0000
Received: from unknown (HELO lnx3.fantu.it) (94.23.245.208)
	by server-11.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 14:59:25 -0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by lnx3.fantu.it (Postfix) with ESMTP id C5D35401747;
	Thu, 15 Nov 2012 15:57:26 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at lnx3.fantu.it
Received: from lnx3.fantu.it ([127.0.0.1])
	by localhost (lnx3.fantu.it [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id VNbwypF64QnJ; Thu, 15 Nov 2012 15:57:25 +0100 (CET)
Received: from [192.168.178.50]
	(host51-78-dynamic.2-87-r.retail.telecomitalia.it [87.2.78.51])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: prova@fantu.it)
	by lnx3.fantu.it (Postfix) with ESMTPSA id 1FBE94016DF;
	Thu, 15 Nov 2012 15:57:20 +0100 (CET)
Message-ID: <50A502C5.9070904@tiscali.it>
Date: Thu, 15 Nov 2012 15:57:09 +0100
From: Fabio Fantoni <fantonifabio@tiscali.it>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel <xen-devel@lists.xen.org>, 
	Anthony Liguori <aliguori@us.ibm.com>, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Xen-devel] Qemu crash on xen hvm domU with spice + qxl
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: fantonifabio@tiscali.it
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7913354209453772044=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--===============7913354209453772044==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms080700070703050209090706"

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--------------ms080700070703050209090706
Content-Type: multipart/mixed;
 boundary="------------060501020502040905060206"

This is a multi-part message in MIME format.
--------------060501020502040905060206
Content-Type: multipart/alternative;
 boundary="------------090700080306030300070805"


--------------090700080306030300070805
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: quoted-printable

Starting domU with spice + qxl qemu always crashes.

-------------------------------------------------------------------------=
----
/var/log/xen/qemu-dm-QUANTALHVM.log
-------------------------------------------------------------------------=
----
main_channel_link: add main channel client
main_channel_handle_parsed: net test: latency 51.500000 ms, bitrate=20
496725685 bps (473.714528 Mbps)
red_dispatcher_set_cursor_peer:
inputs_connect: inputs channel client create
id 0, group 0, virt start 0, virt end ffffffffffffffff, generation 0,=20
delta 0
id 1, group 1, virt start 7f3da8327000, virt end 7f3dac325000,=20
generation 0, delta 7f3da8327000
id 2, group 1, virt start 7f3da03bd000, virt end 7f3da43bd000,=20
generation 0, delta 7f3da03bd000
*(/usr/sbin/xl:3513): Spice-CRITICAL **: red_memslots.c:123:get_virt:=20
slot_id 194 too big, addr=3Dc2c2c2c2c2c2c2c2*
-------------------------------------------------------------------------=
----

Dom0:
Wheezy 64 bit with kernel from package linux-image-3.2.0-4-amd64 version =

3.2.32-1, package blktap-dkms, spice 0.12.0, spice protocol 0.12.2 and=20
all dependency packages for xen
hg clone http://xenbits.xen.org/hg/xen-unstable.hg (in this build=20
changeset is 26152:d1d05cb59a76)
-------------------------
vi Config.mk
------------
PYTHON_PREFIX_ARG =3D
QEMU_UPSTREAM_URL ?=3D git://git.qemu.org/qemu.git
SEABIOS_UPSTREAM_URL ?=3D git://code.coreboot.org/seabios.git
SEABIOS_UPSTREAM_TAG ?=3D master
-------------------------
Added some patches:
- tools: Improve make deb
- Add qxl vga interface support v5
- tools: Compile qemu-xen with spice
-------------------------
=2E/configure
-------------------------
make deb

Qemu upstream: commit ce34cf72fe508b27a78f83c184142e8d1e6a048a
Seabios upstream: commit 9600c800ac2a6b34a9993d99e7d3d4f7301e9265

Are there some new seabios settings that I'm not aware of in order to=20
get xen and spice with qxl functioning. See build log on attachment for=20
details.

Here the configuration of the domU tested:
-------------------------------------------------------------------------=
----
name=3D'QUANTALHVM'
builder=3D"hvm"
memory=3D2048
vcpus=3D2
hap=3D1
pae=3D1
acpi=3D1
apic=3D1
nx=3D1
vif=3D['bridge=3Dxenbr0']
#vfb=3D['vnc=3D1,vncunused=3D1,vnclisten=3D"0.0.0.0",keymap=3D"it"']
#disk=3D['/mnt/vm/disks/PRECISEHVM.disk1.xm,raw,hda,rw',=20
'/dev/sr0,raw,hdb,ro,cdrom']
#disk=3D['/mnt/vm/disks/QUANTALHVM.disk1.xm,raw,hda,rw','/mnt/vm/iso/QUAN=
TAL.iso,raw,hdb,ro,cdrom']
disk=3D['/mnt/vm/disks/QUANTALHVM.disk1.xm,raw,hda,rw']
boot=3D'c'
xen_platform_pci=3D1
device_model_version=3D'qemu-xen'
vnc=3D0
#vncunused=3D1
#vnclisten=3D"0.0.0.0"
#keymap=3D"it"
stdvga=3D0
spice=3D1
spicehost=3D'0.0.0.0'
spiceport=3D6000
spicedisable_ticketing=3D1
qxl=3D1
#videoram=3D16
#device_model_args=3D["-vga","qxl","-global","qxl-vga.vram_size_mb=3D64",=
"-global","qxl-vga.ram_size_mb=3D64","-device","virtio-serial-pci,id=3Dvi=
rtio-serial0,max_ports=3D16","-chardev","spicevmc,name=3Dvdagent,id=3Dvda=
gent","-device","virtserialport,nr=3D1,bus=3Dvirtio-serial0.0,chardev=3Dv=
dagent,name=3Dcom.redhat.spice.0"]
-------------------------------------------------------------------------=
----

Someone can help to solve the problem please?
If you need other information and/or test tell me and I'll do it.

--------------090700080306030300070805
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

<html>
  <head>

    <meta http-equiv=3D"content-type" content=3D"text/html; charset=3DISO=
-8859-15">
  </head>
  <body bgcolor=3D"#FFFFFF" text=3D"#000000">
    Starting domU with spice + qxl qemu always crashes.<br>
    <br>
-------------------------------------------------------------------------=
----<br>
    /var/log/xen/qemu-dm-QUANTALHVM.log<br>
-------------------------------------------------------------------------=
----<br>
    main_channel_link: add main channel client<br>
    main_channel_handle_parsed: net test: latency 51.500000 ms, bitrate
    496725685 bps (473.714528 Mbps)<br>
    red_dispatcher_set_cursor_peer:<br>
    inputs_connect: inputs channel client create<br>
    id 0, group 0, virt start 0, virt end ffffffffffffffff, generation
    0, delta 0<br>
    id 1, group 1, virt start 7f3da8327000, virt end 7f3dac325000,
    generation 0, delta 7f3da8327000<br>
    id 2, group 1, virt start 7f3da03bd000, virt end 7f3da43bd000,
    generation 0, delta 7f3da03bd000<br>
    <b>(/usr/sbin/xl:3513): Spice-CRITICAL **:
      red_memslots.c:123:get_virt: slot_id 194 too big,
      addr=3Dc2c2c2c2c2c2c2c2</b><br>
-------------------------------------------------------------------------=
----<br>
    <br>
    Dom0:<br>
    Wheezy 64 bit with kernel from package linux-image-3.2.0-4-amd64
    version 3.2.32-1, package blktap-dkms, spice 0.12.0, spice protocol
    0.12.2 and all dependency packages for xen
    <br>
    hg clone <a class=3D"moz-txt-link-freetext"
      href=3D"http://xenbits.xen.org/hg/xen-unstable.hg">http://xenbits.x=
en.org/hg/xen-unstable.hg</a>
    (in this build changeset is 26152:d1d05cb59a76)
    <br>
    -------------------------
    <br>
    vi Config.mk
    <br>
    ------------
    <br>
    PYTHON_PREFIX_ARG =3D
    <br>
    QEMU_UPSTREAM_URL ?=3D git://git.qemu.org/qemu.git
    <br>
    SEABIOS_UPSTREAM_URL ?=3D git://code.coreboot.org/seabios.git
    <br>
    SEABIOS_UPSTREAM_TAG ?=3D master
    <br>
    -------------------------
    <br>
    Added some patches:
    <br>
    - tools: Improve make deb
    <br>
    - Add qxl vga interface support v5<br>
    - tools: Compile qemu-xen with spice
    <br>
    -------------------------
    <br>
    ./configure
    <br>
    -------------------------
    <br>
    make deb
    <br>
    <br>
    Qemu upstream: commit ce34cf72fe508b27a78f83c184142e8d1e6a048a<br>
    Seabios upstream: commit 9600c800ac2a6b34a9993d99e7d3d4f7301e9265<br>=

    <br>
    Are there some new seabios settings that I'm not aware of in order
    to get xen and spice with qxl functioning. See build log on
    attachment for details.<br>
    <br>
    Here the configuration of the domU tested:<br>
-------------------------------------------------------------------------=
----<br>
    name=3D'QUANTALHVM'<br>
    builder=3D"hvm"<br>
    memory=3D2048<br>
    vcpus=3D2<br>
    hap=3D1<br>
    pae=3D1<br>
    acpi=3D1<br>
    apic=3D1<br>
    nx=3D1<br>
    vif=3D['bridge=3Dxenbr0']<br>
    #vfb=3D['vnc=3D1,vncunused=3D1,vnclisten=3D"0.0.0.0",keymap=3D"it"']<=
br>
    #disk=3D['/mnt/vm/disks/PRECISEHVM.disk1.xm,raw,hda,rw',
    '/dev/sr0,raw,hdb,ro,cdrom']<br>
#disk=3D['/mnt/vm/disks/QUANTALHVM.disk1.xm,raw,hda,rw','/mnt/vm/iso/QUAN=
TAL.iso,raw,hdb,ro,cdrom']<br>
    disk=3D['/mnt/vm/disks/QUANTALHVM.disk1.xm,raw,hda,rw']<br>
    boot=3D'c'<br>
    xen_platform_pci=3D1<br>
    device_model_version=3D'qemu-xen'<br>
    vnc=3D0<br>
    #vncunused=3D1<br>
    #vnclisten=3D"0.0.0.0"<br>
    #keymap=3D"it"<br>
    stdvga=3D0<br>
    spice=3D1<br>
    spicehost=3D'0.0.0.0'<br>
    spiceport=3D6000<br>
    spicedisable_ticketing=3D1<br>
    qxl=3D1<br>
    #videoram=3D16<br>
#device_model_args=3D["-vga","qxl","-global","qxl-vga.vram_size_mb=3D64",=
"-global","qxl-vga.ram_size_mb=3D64","-device","virtio-serial-pci,id=3Dvi=
rtio-serial0,max_ports=3D16","-chardev","spicevmc,name=3Dvdagent,id=3Dvda=
gent","-device","virtserialport,nr=3D1,bus=3Dvirtio-serial0.0,chardev=3Dv=
dagent,name=3Dcom.redhat.spice.0"]<br>
-------------------------------------------------------------------------=
----<br>
    <br>
    Someone can help to solve the problem please?<br>
    If you need other information and/or test tell me and I'll do it.<br>=

  </body>
</html>

--------------090700080306030300070805--

--------------060501020502040905060206
Content-Type: application/octet-stream;
 name="xenbuild.7z"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="xenbuild.7z"

N3q8ryccAANhS06UXrUBAAAAAABdAAAAAAAAAJsL+xQAHmgECYbzOIC5RUbjJg66yLypbeBN
TBXAfWZPAACagHoYvvxOFx9dlg1+CUEWKqPnxsQZDohW8Sg/7+7Qpw9/N0rj7LqXMaRAFVm3
XEKO9X1B9Sy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ArlI+vjj6pK5cVvGSfvnmplRqbVU8uXCNu1bJYXRVPmwPqeKaNUm0duH2
wGsRmiZaa/hX+0ZSTz9m4kBbZFlHyTc6/f0Yoi45u5PlAgXMk6YDc1XlJLoyG+2KcFKNbZOp
R26gv+Hrgnp6gbnglpHluSEl69mu7LpVsHQ57q4OvA+p8Ohd3HjTUzHOe7Nm29OWwUUZ7qhY
4NzXtZeqdhm1Nl80OkDU8DyFlMuFpybdYpUmbZUdaapqFD731km/UcQMZHjyNbUeFtdFGn/U
NSRkd+HAWdkJXdEu/rupTaZ7lS27PyJpk/ojssTANJnd2S1asExopKYI3oSqRCHFt76GAtmZ
jIAkXimMeJ0O5tY8k2pZQy1yyC71VQ0YTh/vg/hsu8opZXGIEQznP9OU6rbMEfW/mBkx7d6a
54AOnAYj3AARLPNi59D/qxM/EPwTChwff4gm/4CWXYRKI/TWnUj5HG5aZOlBqBCX981MH3m0
N0ZGeK5xVywOGOsT02/rRyrzAKgnN+QWCdNMrEyPaNkcQ5r8EiYc4oI3dEbOQoP16/QgOWL/
DNe89m3YJ2cjrKvVVJzxPMiZOv3/BSSJBOJp21yRvC2hakQmH6zB4LG5MNvvXA1MqQoSiYlY
3qNMV09rkgQbD1NlJ7bucrJuXqaUbXLGJWFYChTdaGMH6yZL6XYv5sYXHFWVVr77zmI5dAAp
VqlQ7PKYikHDZr9uA+zkl97g5mU6XnyIftx8yPYSDpprt1dJtI2j+iYT3nKs4PiFqZfZItuL
Evr0H+zPtJXY7yBMEJNBLWrGHAINo2aNiZHHYxCZ8pSGSsG9U6jd5TkQqS5fvbQbxCSdVF3F
MAABBAYAAQnBXrUABwsBAAEjAwEBBV0AAGAADOC4808ACAoBt3gMMAAABQERGwB4AGUAbgBi
AHUAaQBsAGQALgBsAG8AZwAAABQKAQAuFNfDPMPNARUGAQAgAAAAAAA=
--------------060501020502040905060206--

--------------ms080700070703050209090706
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Dispos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CSUwxFjAUBgNVBAoTDVN0
YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNpZ25p
bmcxODA2BgNVBAMTL1N0YXJ0Q29tIENsYXNzIDIgUHJpbWFyeSBJbnRlcm1lZGlhdGUgQ2xp
ZW50IENBAgIeYzCBpgYLKoZIhvcNAQkQAgsxgZaggZMwgYwxCzAJBgNVBAYTAklMMRYwFAYD
VQQKEw1TdGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRhbCBDZXJ0aWZpY2F0
ZSBTaWduaW5nMTgwNgYDVQQDEy9TdGFydENvbSBDbGFzcyAyIFByaW1hcnkgSW50ZXJtZWRp
YXRlIENsaWVudCBDQQICHmMwDQYJKoZIhvcNAQEBBQAEggEAEFI8L31aNSVh8BOEbt0ZCIof
kn6ZJEr7gApU8RSi8sCZpzF9KIM37ccxbXCzYSUPkZrgLLm/PEnjjCRVIENXtSosM3fk+BTJ
fSw9z8UOczjQpuS9aXabmPK993RMDbQEeyt86hXT0hqq0SaKZgdMY862gWoQ6UXEIAXh/fgY
kaOXSGIK8o20COxmc3Dw9gpWEH/W/1BZQNUUMeuhEpK/7pIHkm8kJTOgj+BBRO9bb/aIbcIi
svKqX/szRRwUpUxWV7Z2WLKXQE7kyjI0Uqhk6kDANo33JUstNvXy/YEX1+pdgzdPCXGsBK9h
HZBLgejK+p1DJfXweFe1GJs0OgGWowAAAAAAAA==
--------------ms080700070703050209090706--


--===============7913354209453772044==
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.xen.org
http://lists.xen.org/xen-devel

--===============7913354209453772044==--


From xen-devel-bounces@lists.xen.org Thu Nov 15 15:10:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:10:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ15L-00013Z-AY; Thu, 15 Nov 2012 15:10:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jfehlig@suse.com>) id 1TZ15J-00013U-Sk
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 15:10:29 +0000
Received: from [85.158.137.99:17298] by server-12.bemta-3.messagelabs.com id
	7B/27-22757-4E505A05; Thu, 15 Nov 2012 15:10:28 +0000
X-Env-Sender: jfehlig@suse.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1352992225!19146635!1
X-Originating-IP: [137.65.250.26]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18960 invoked from network); 15 Nov 2012 15:10:27 -0000
Received: from victor.provo.novell.com (HELO victor.provo.novell.com)
	(137.65.250.26)
	by server-2.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 15:10:27 -0000
Received: from linux-0v7v.site (prv-ext-foundry1int.gns.novell.com
	[137.65.251.240])
	by victor.provo.novell.com with ESMTP (TLS encrypted);
	Thu, 15 Nov 2012 08:10:11 -0700
Message-ID: <50A505C7.2020601@suse.com>
Date: Thu, 15 Nov 2012 08:09:59 -0700
From: Jim Fehlig <jfehlig@suse.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120825 Thunderbird/15.0
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352945011-2847-1-git-send-email-jfehlig@suse.com>
	<1352975175.3499.88.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352975175.3499.88.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Fix passing of application data to
 timeout_deregister hook
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/15/2012 03:26 AM, Ian Campbell wrote:
> On Thu, 2012-11-15 at 02:03 +0000, Jim Fehlig wrote:
>> When deregistering a timeout, the address of application data was
>> being passed to the timeout_deregister hook instead of the data
>> itself.
>>
>>      Signed-off-by: Jim Fehlig <jfehlig@suse.com>
> Acked + applied, thanks.
>
> Ian, this should be a candidate for the next 4.2.1 rc IMHO.

Yes, that would be much appreciated.  Thanks!

Regards,
Jim


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:10:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:10:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ15L-00013Z-AY; Thu, 15 Nov 2012 15:10:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jfehlig@suse.com>) id 1TZ15J-00013U-Sk
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 15:10:29 +0000
Received: from [85.158.137.99:17298] by server-12.bemta-3.messagelabs.com id
	7B/27-22757-4E505A05; Thu, 15 Nov 2012 15:10:28 +0000
X-Env-Sender: jfehlig@suse.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1352992225!19146635!1
X-Originating-IP: [137.65.250.26]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18960 invoked from network); 15 Nov 2012 15:10:27 -0000
Received: from victor.provo.novell.com (HELO victor.provo.novell.com)
	(137.65.250.26)
	by server-2.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 15:10:27 -0000
Received: from linux-0v7v.site (prv-ext-foundry1int.gns.novell.com
	[137.65.251.240])
	by victor.provo.novell.com with ESMTP (TLS encrypted);
	Thu, 15 Nov 2012 08:10:11 -0700
Message-ID: <50A505C7.2020601@suse.com>
Date: Thu, 15 Nov 2012 08:09:59 -0700
From: Jim Fehlig <jfehlig@suse.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120825 Thunderbird/15.0
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352945011-2847-1-git-send-email-jfehlig@suse.com>
	<1352975175.3499.88.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352975175.3499.88.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Fix passing of application data to
 timeout_deregister hook
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/15/2012 03:26 AM, Ian Campbell wrote:
> On Thu, 2012-11-15 at 02:03 +0000, Jim Fehlig wrote:
>> When deregistering a timeout, the address of application data was
>> being passed to the timeout_deregister hook instead of the data
>> itself.
>>
>>      Signed-off-by: Jim Fehlig <jfehlig@suse.com>
> Acked + applied, thanks.
>
> Ian, this should be a candidate for the next 4.2.1 rc IMHO.

Yes, that would be much appreciated.  Thanks!

Regards,
Jim


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:17:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:17:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1C7-0001Jg-6f; Thu, 15 Nov 2012 15:17:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1C6-0001JW-5G
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:17:30 +0000
Received: from [85.158.143.99:20415] by server-3.bemta-4.messagelabs.com id
	8B/31-06841-98705A05; Thu, 15 Nov 2012 15:17:29 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-10.tower-216.messagelabs.com!1352992647!20953644!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23447 invoked from network); 15 Nov 2012 15:17:28 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-10.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 15:17:28 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187326;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:00 -0500
Message-Id: <1352992629-5850-2-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 01/10] fix bug in lseek for mini-os
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

lseek always used files[fd].file.offset. It should
use the offset of whatever union member is actually
being used.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 extras/mini-os/lib/sys.c |   67 ++++++++++++++++++++++++++--------------------
 1 file changed, 38 insertions(+), 29 deletions(-)

diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
index d212969..3cc3340 100644
--- a/extras/mini-os/lib/sys.c
+++ b/extras/mini-os/lib/sys.c
@@ -360,45 +360,54 @@ int write(int fd, const void *buf, size_t nbytes)
 
 off_t lseek(int fd, off_t offset, int whence)
 {
+    off_t* target = NULL;
     switch(files[fd].type) {
-#if defined(CONFIG_BLKFRONT) || defined(CONFIG_TPMFRONT) || defined(CONFIG_TPM_TIS)
 #ifdef CONFIG_BLKFRONT
        case FTYPE_BLK:
+          target = &files[fd].blk.offset;
+          break;
 #endif
-#ifdef CONFIG_TPMFRNT
+#ifdef CONFIG_TPMFRONT
        case FTYPE_TPMFRONT:
+          target = &files[fd].tpmfront.offset;
+          break;
 #endif
 #ifdef CONFIG_TPM_TIS
        case FTYPE_TPM_TIS:
+          target = &files[fd].tpm_tis.offset;
+          break;
 #endif
-	  switch (whence) {
-	     case SEEK_SET:
-		files[fd].file.offset = offset;
-		break;
-	     case SEEK_CUR:
-		files[fd].file.offset += offset;
-		break;
-	     case SEEK_END:
-		{
-		   struct stat st;
-		   int ret;
-		   ret = fstat(fd, &st);
-		   if (ret)
-		      return -1;
-		   files[fd].file.offset = st.st_size + offset;
-		   break;
-		}
-	     default:
-		errno = EINVAL;
-		return -1;
-	  }
-	  return files[fd].file.offset;
-	  break;
-#endif
-       default: /* Not implemented on this FTYPE */
-	  errno = ESPIPE;
-	  return (off_t) -1;
+       case FTYPE_FILE:
+          target = &files[fd].file.offset;
+          break;
+       default:
+          /* Not implemented for this filetype */
+          errno = ESPIPE;
+          return (off_t) -1;
+    }
+
+    switch (whence) {
+       case SEEK_SET:
+          *target = offset;
+          break;
+       case SEEK_CUR:
+          *target += offset;
+          break;
+       case SEEK_END:
+          {
+             struct stat st;
+             int ret;
+             ret = fstat(fd, &st);
+             if (ret)
+                return -1;
+             *target = st.st_size + offset;
+             break;
+          }
+       default:
+          errno = EINVAL;
+          return -1;
     }
+    return *target;
 }
 
 int fsync(int fd) {
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:17:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:17:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1C7-0001Jg-6f; Thu, 15 Nov 2012 15:17:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1C6-0001JW-5G
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:17:30 +0000
Received: from [85.158.143.99:20415] by server-3.bemta-4.messagelabs.com id
	8B/31-06841-98705A05; Thu, 15 Nov 2012 15:17:29 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-10.tower-216.messagelabs.com!1352992647!20953644!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23447 invoked from network); 15 Nov 2012 15:17:28 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-10.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 15:17:28 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187326;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:00 -0500
Message-Id: <1352992629-5850-2-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 01/10] fix bug in lseek for mini-os
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

lseek always used files[fd].file.offset. It should
use the offset of whatever union member is actually
being used.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 extras/mini-os/lib/sys.c |   67 ++++++++++++++++++++++++++--------------------
 1 file changed, 38 insertions(+), 29 deletions(-)

diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
index d212969..3cc3340 100644
--- a/extras/mini-os/lib/sys.c
+++ b/extras/mini-os/lib/sys.c
@@ -360,45 +360,54 @@ int write(int fd, const void *buf, size_t nbytes)
 
 off_t lseek(int fd, off_t offset, int whence)
 {
+    off_t* target = NULL;
     switch(files[fd].type) {
-#if defined(CONFIG_BLKFRONT) || defined(CONFIG_TPMFRONT) || defined(CONFIG_TPM_TIS)
 #ifdef CONFIG_BLKFRONT
        case FTYPE_BLK:
+          target = &files[fd].blk.offset;
+          break;
 #endif
-#ifdef CONFIG_TPMFRNT
+#ifdef CONFIG_TPMFRONT
        case FTYPE_TPMFRONT:
+          target = &files[fd].tpmfront.offset;
+          break;
 #endif
 #ifdef CONFIG_TPM_TIS
        case FTYPE_TPM_TIS:
+          target = &files[fd].tpm_tis.offset;
+          break;
 #endif
-	  switch (whence) {
-	     case SEEK_SET:
-		files[fd].file.offset = offset;
-		break;
-	     case SEEK_CUR:
-		files[fd].file.offset += offset;
-		break;
-	     case SEEK_END:
-		{
-		   struct stat st;
-		   int ret;
-		   ret = fstat(fd, &st);
-		   if (ret)
-		      return -1;
-		   files[fd].file.offset = st.st_size + offset;
-		   break;
-		}
-	     default:
-		errno = EINVAL;
-		return -1;
-	  }
-	  return files[fd].file.offset;
-	  break;
-#endif
-       default: /* Not implemented on this FTYPE */
-	  errno = ESPIPE;
-	  return (off_t) -1;
+       case FTYPE_FILE:
+          target = &files[fd].file.offset;
+          break;
+       default:
+          /* Not implemented for this filetype */
+          errno = ESPIPE;
+          return (off_t) -1;
+    }
+
+    switch (whence) {
+       case SEEK_SET:
+          *target = offset;
+          break;
+       case SEEK_CUR:
+          *target += offset;
+          break;
+       case SEEK_END:
+          {
+             struct stat st;
+             int ret;
+             ret = fstat(fd, &st);
+             if (ret)
+                return -1;
+             *target = st.st_size + offset;
+             break;
+          }
+       default:
+          errno = EINVAL;
+          return -1;
     }
+    return *target;
 }
 
 int fsync(int fd) {
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:17:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:17:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1C7-0001Jn-I8; Thu, 15 Nov 2012 15:17:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1C6-0001JX-MM
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:17:30 +0000
Received: from [85.158.139.83:44693] by server-15.bemta-5.messagelabs.com id
	E1/8B-26920-98705A05; Thu, 15 Nov 2012 15:17:29 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-14.tower-182.messagelabs.com!1352992647!26159583!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14843 invoked from network); 15 Nov 2012 15:17:28 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-14.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 15:17:28 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187323;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:16:59 -0500
Message-Id: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

THese are the remaining patches to add vtpm mini-os support to xen.
Documentation internal review is taking a bit longer so I will
send out a final patch with docs next week.

Matthew Fioravante (10):
  fix bug in lseek for mini-os
  Update mini-os license to support GPL features
  Remove old vtpm support from xm
  Remove VTPM_TOOLS from config/Tools.mk.in
  Remove old vtpm stuff from tools/libxen
  Remove tools/vtpm* from MAINTAINERS file
  Regenerate configure script after removing vtpm
  add vtpm-stubdom code
  add stubdom/vtpmmgr code
  vtpm/vtpmmgr and required libs to stubdom/Makefile

 MAINTAINERS                                  |    2 -
 config/Tools.mk.in                           |    1 -
 docs/man/xm.pod.1                            |   11 -
 extras/mini-os/COPYING                       |   13 +
 extras/mini-os/lib/sys.c                     |   67 +-
 stubdom/Makefile                             |  138 +++-
 stubdom/polarssl.patch                       |   64 ++
 stubdom/tpmemu-0.7.4.patch                   |   12 +
 stubdom/vtpm/Makefile                        |   37 +
 stubdom/vtpm/minios.cfg                      |   14 +
 stubdom/vtpm/vtpm.c                          |  404 +++++++++++
 stubdom/vtpm/vtpm.h                          |   36 +
 stubdom/vtpm/vtpm_cmd.c                      |  256 +++++++
 stubdom/vtpm/vtpm_cmd.h                      |   31 +
 stubdom/vtpm/vtpm_pcrs.c                     |   43 ++
 stubdom/vtpm/vtpm_pcrs.h                     |   53 ++
 stubdom/vtpm/vtpmblk.c                       |  307 +++++++++
 stubdom/vtpm/vtpmblk.h                       |   31 +
 stubdom/vtpmmgr/Makefile                     |   32 +
 stubdom/vtpmmgr/init.c                       |  553 +++++++++++++++
 stubdom/vtpmmgr/log.c                        |  151 +++++
 stubdom/vtpmmgr/log.h                        |   85 +++
 stubdom/vtpmmgr/marshal.h                    |  528 +++++++++++++++
 stubdom/vtpmmgr/minios.cfg                   |   14 +
 stubdom/vtpmmgr/tcg.h                        |  707 +++++++++++++++++++
 stubdom/vtpmmgr/tpm.c                        |  938 ++++++++++++++++++++++++++
 stubdom/vtpmmgr/tpm.h                        |  218 ++++++
 stubdom/vtpmmgr/tpmrsa.c                     |  175 +++++
 stubdom/vtpmmgr/tpmrsa.h                     |   67 ++
 stubdom/vtpmmgr/uuid.h                       |   50 ++
 stubdom/vtpmmgr/vtpm_cmd_handler.c           |  152 +++++
 stubdom/vtpmmgr/vtpm_manager.h               |   64 ++
 stubdom/vtpmmgr/vtpm_storage.c               |  783 +++++++++++++++++++++
 stubdom/vtpmmgr/vtpm_storage.h               |   68 ++
 stubdom/vtpmmgr/vtpmmgr.c                    |   93 +++
 stubdom/vtpmmgr/vtpmmgr.h                    |   77 +++
 tools/configure                              |  603 ++++++++---------
 tools/libxen/include/xen/api/xen_all.h       |    1 -
 tools/libxen/include/xen/api/xen_vm.h        |    9 -
 tools/libxen/include/xen/api/xen_vtpm.h      |  218 ------
 tools/libxen/include/xen/api/xen_vtpm_decl.h |   31 -
 tools/libxen/src/xen_vm.c                    |   22 -
 tools/libxen/src/xen_vtpm.c                  |  235 -------
 tools/python/README.XendConfig               |    2 -
 tools/python/README.sxpcfg                   |    4 -
 tools/python/scripts/xapi.py                 |   20 -
 tools/python/xen/xend/XendAPI.py             |  128 ----
 tools/python/xen/xend/XendConfig.py          |   19 +-
 tools/python/xen/xend/XendConstants.py       |    8 +-
 tools/python/xen/xend/XendDevices.py         |    4 +-
 tools/python/xen/xend/XendDomainInfo.py      |   29 -
 tools/python/xen/xend/XendError.py           |    1 -
 tools/python/xen/xend/XendOptions.py         |    4 -
 tools/python/xen/xend/server/tpmif.py        |  141 ----
 tools/python/xen/xend/tests/xend-config.sxp  |    2 -
 tools/python/xen/xm/create.dtd               |    4 -
 tools/python/xen/xm/create.py                |   69 --
 tools/python/xen/xm/main.py                  |   37 -
 tools/python/xen/xm/xenapi_create.py         |   39 --
 59 files changed, 6535 insertions(+), 1370 deletions(-)
 create mode 100644 stubdom/polarssl.patch
 create mode 100644 stubdom/tpmemu-0.7.4.patch
 create mode 100644 stubdom/vtpm/Makefile
 create mode 100644 stubdom/vtpm/minios.cfg
 create mode 100644 stubdom/vtpm/vtpm.c
 create mode 100644 stubdom/vtpm/vtpm.h
 create mode 100644 stubdom/vtpm/vtpm_cmd.c
 create mode 100644 stubdom/vtpm/vtpm_cmd.h
 create mode 100644 stubdom/vtpm/vtpm_pcrs.c
 create mode 100644 stubdom/vtpm/vtpm_pcrs.h
 create mode 100644 stubdom/vtpm/vtpmblk.c
 create mode 100644 stubdom/vtpm/vtpmblk.h
 create mode 100644 stubdom/vtpmmgr/Makefile
 create mode 100644 stubdom/vtpmmgr/init.c
 create mode 100644 stubdom/vtpmmgr/log.c
 create mode 100644 stubdom/vtpmmgr/log.h
 create mode 100644 stubdom/vtpmmgr/marshal.h
 create mode 100644 stubdom/vtpmmgr/minios.cfg
 create mode 100644 stubdom/vtpmmgr/tcg.h
 create mode 100644 stubdom/vtpmmgr/tpm.c
 create mode 100644 stubdom/vtpmmgr/tpm.h
 create mode 100644 stubdom/vtpmmgr/tpmrsa.c
 create mode 100644 stubdom/vtpmmgr/tpmrsa.h
 create mode 100644 stubdom/vtpmmgr/uuid.h
 create mode 100644 stubdom/vtpmmgr/vtpm_cmd_handler.c
 create mode 100644 stubdom/vtpmmgr/vtpm_manager.h
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.c
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.h
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.c
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.h
 delete mode 100644 tools/libxen/include/xen/api/xen_vtpm.h
 delete mode 100644 tools/libxen/include/xen/api/xen_vtpm_decl.h
 delete mode 100644 tools/libxen/src/xen_vtpm.c
 delete mode 100644 tools/python/xen/xend/server/tpmif.py

-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:17:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:17:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1C7-0001Jn-I8; Thu, 15 Nov 2012 15:17:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1C6-0001JX-MM
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:17:30 +0000
Received: from [85.158.139.83:44693] by server-15.bemta-5.messagelabs.com id
	E1/8B-26920-98705A05; Thu, 15 Nov 2012 15:17:29 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-14.tower-182.messagelabs.com!1352992647!26159583!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14843 invoked from network); 15 Nov 2012 15:17:28 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-14.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 15:17:28 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187323;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:16:59 -0500
Message-Id: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

THese are the remaining patches to add vtpm mini-os support to xen.
Documentation internal review is taking a bit longer so I will
send out a final patch with docs next week.

Matthew Fioravante (10):
  fix bug in lseek for mini-os
  Update mini-os license to support GPL features
  Remove old vtpm support from xm
  Remove VTPM_TOOLS from config/Tools.mk.in
  Remove old vtpm stuff from tools/libxen
  Remove tools/vtpm* from MAINTAINERS file
  Regenerate configure script after removing vtpm
  add vtpm-stubdom code
  add stubdom/vtpmmgr code
  vtpm/vtpmmgr and required libs to stubdom/Makefile

 MAINTAINERS                                  |    2 -
 config/Tools.mk.in                           |    1 -
 docs/man/xm.pod.1                            |   11 -
 extras/mini-os/COPYING                       |   13 +
 extras/mini-os/lib/sys.c                     |   67 +-
 stubdom/Makefile                             |  138 +++-
 stubdom/polarssl.patch                       |   64 ++
 stubdom/tpmemu-0.7.4.patch                   |   12 +
 stubdom/vtpm/Makefile                        |   37 +
 stubdom/vtpm/minios.cfg                      |   14 +
 stubdom/vtpm/vtpm.c                          |  404 +++++++++++
 stubdom/vtpm/vtpm.h                          |   36 +
 stubdom/vtpm/vtpm_cmd.c                      |  256 +++++++
 stubdom/vtpm/vtpm_cmd.h                      |   31 +
 stubdom/vtpm/vtpm_pcrs.c                     |   43 ++
 stubdom/vtpm/vtpm_pcrs.h                     |   53 ++
 stubdom/vtpm/vtpmblk.c                       |  307 +++++++++
 stubdom/vtpm/vtpmblk.h                       |   31 +
 stubdom/vtpmmgr/Makefile                     |   32 +
 stubdom/vtpmmgr/init.c                       |  553 +++++++++++++++
 stubdom/vtpmmgr/log.c                        |  151 +++++
 stubdom/vtpmmgr/log.h                        |   85 +++
 stubdom/vtpmmgr/marshal.h                    |  528 +++++++++++++++
 stubdom/vtpmmgr/minios.cfg                   |   14 +
 stubdom/vtpmmgr/tcg.h                        |  707 +++++++++++++++++++
 stubdom/vtpmmgr/tpm.c                        |  938 ++++++++++++++++++++++++++
 stubdom/vtpmmgr/tpm.h                        |  218 ++++++
 stubdom/vtpmmgr/tpmrsa.c                     |  175 +++++
 stubdom/vtpmmgr/tpmrsa.h                     |   67 ++
 stubdom/vtpmmgr/uuid.h                       |   50 ++
 stubdom/vtpmmgr/vtpm_cmd_handler.c           |  152 +++++
 stubdom/vtpmmgr/vtpm_manager.h               |   64 ++
 stubdom/vtpmmgr/vtpm_storage.c               |  783 +++++++++++++++++++++
 stubdom/vtpmmgr/vtpm_storage.h               |   68 ++
 stubdom/vtpmmgr/vtpmmgr.c                    |   93 +++
 stubdom/vtpmmgr/vtpmmgr.h                    |   77 +++
 tools/configure                              |  603 ++++++++---------
 tools/libxen/include/xen/api/xen_all.h       |    1 -
 tools/libxen/include/xen/api/xen_vm.h        |    9 -
 tools/libxen/include/xen/api/xen_vtpm.h      |  218 ------
 tools/libxen/include/xen/api/xen_vtpm_decl.h |   31 -
 tools/libxen/src/xen_vm.c                    |   22 -
 tools/libxen/src/xen_vtpm.c                  |  235 -------
 tools/python/README.XendConfig               |    2 -
 tools/python/README.sxpcfg                   |    4 -
 tools/python/scripts/xapi.py                 |   20 -
 tools/python/xen/xend/XendAPI.py             |  128 ----
 tools/python/xen/xend/XendConfig.py          |   19 +-
 tools/python/xen/xend/XendConstants.py       |    8 +-
 tools/python/xen/xend/XendDevices.py         |    4 +-
 tools/python/xen/xend/XendDomainInfo.py      |   29 -
 tools/python/xen/xend/XendError.py           |    1 -
 tools/python/xen/xend/XendOptions.py         |    4 -
 tools/python/xen/xend/server/tpmif.py        |  141 ----
 tools/python/xen/xend/tests/xend-config.sxp  |    2 -
 tools/python/xen/xm/create.dtd               |    4 -
 tools/python/xen/xm/create.py                |   69 --
 tools/python/xen/xm/main.py                  |   37 -
 tools/python/xen/xm/xenapi_create.py         |   39 --
 59 files changed, 6535 insertions(+), 1370 deletions(-)
 create mode 100644 stubdom/polarssl.patch
 create mode 100644 stubdom/tpmemu-0.7.4.patch
 create mode 100644 stubdom/vtpm/Makefile
 create mode 100644 stubdom/vtpm/minios.cfg
 create mode 100644 stubdom/vtpm/vtpm.c
 create mode 100644 stubdom/vtpm/vtpm.h
 create mode 100644 stubdom/vtpm/vtpm_cmd.c
 create mode 100644 stubdom/vtpm/vtpm_cmd.h
 create mode 100644 stubdom/vtpm/vtpm_pcrs.c
 create mode 100644 stubdom/vtpm/vtpm_pcrs.h
 create mode 100644 stubdom/vtpm/vtpmblk.c
 create mode 100644 stubdom/vtpm/vtpmblk.h
 create mode 100644 stubdom/vtpmmgr/Makefile
 create mode 100644 stubdom/vtpmmgr/init.c
 create mode 100644 stubdom/vtpmmgr/log.c
 create mode 100644 stubdom/vtpmmgr/log.h
 create mode 100644 stubdom/vtpmmgr/marshal.h
 create mode 100644 stubdom/vtpmmgr/minios.cfg
 create mode 100644 stubdom/vtpmmgr/tcg.h
 create mode 100644 stubdom/vtpmmgr/tpm.c
 create mode 100644 stubdom/vtpmmgr/tpm.h
 create mode 100644 stubdom/vtpmmgr/tpmrsa.c
 create mode 100644 stubdom/vtpmmgr/tpmrsa.h
 create mode 100644 stubdom/vtpmmgr/uuid.h
 create mode 100644 stubdom/vtpmmgr/vtpm_cmd_handler.c
 create mode 100644 stubdom/vtpmmgr/vtpm_manager.h
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.c
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.h
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.c
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.h
 delete mode 100644 tools/libxen/include/xen/api/xen_vtpm.h
 delete mode 100644 tools/libxen/include/xen/api/xen_vtpm_decl.h
 delete mode 100644 tools/libxen/src/xen_vtpm.c
 delete mode 100644 tools/python/xen/xend/server/tpmif.py

-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:17:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:17:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1CC-0001KS-VG; Thu, 15 Nov 2012 15:17:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1CB-0001K4-13
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:17:35 +0000
Received: from [85.158.139.211:8858] by server-14.bemta-5.messagelabs.com id
	7F/F4-21768-E8705A05; Thu, 15 Nov 2012 15:17:34 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-9.tower-206.messagelabs.com!1352992652!18822906!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2817 invoked from network); 15 Nov 2012 15:17:33 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-9.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 15:17:33 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187331;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:01 -0500
Message-Id: <1352992629-5850-3-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 02/10] Update mini-os license to support
	GPL features
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch updates extras/mini-os/COPYING to explain
which optional features are GPL and what the implications
of enabling them are.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 extras/mini-os/COPYING |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/extras/mini-os/COPYING b/extras/mini-os/COPYING
index c26ccfc..1d9df6c 100644
--- a/extras/mini-os/COPYING
+++ b/extras/mini-os/COPYING
@@ -1,3 +1,16 @@
+Certain files in this directory are licensed by the GNU
+General Public License version 2 (GPLv2). By default these
+files are not built and linked into MiniOs. Enabling them
+will cause the whole work to become covered by the GPLv2.
+
+The current set of GPLv2 features are:
+CONFIG_TPMFRONT
+CONFIG_TPMBACK
+CONFIG_TPM_TIS
+
+Do not use these if you do not want your MiniOS build to become
+GPL licensed!
+
 Copyright (c) 2009 Citrix Systems, Inc. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:17:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:17:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1CC-0001KS-VG; Thu, 15 Nov 2012 15:17:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1CB-0001K4-13
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:17:35 +0000
Received: from [85.158.139.211:8858] by server-14.bemta-5.messagelabs.com id
	7F/F4-21768-E8705A05; Thu, 15 Nov 2012 15:17:34 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-9.tower-206.messagelabs.com!1352992652!18822906!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2817 invoked from network); 15 Nov 2012 15:17:33 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-9.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 15:17:33 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187331;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:01 -0500
Message-Id: <1352992629-5850-3-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 02/10] Update mini-os license to support
	GPL features
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch updates extras/mini-os/COPYING to explain
which optional features are GPL and what the implications
of enabling them are.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 extras/mini-os/COPYING |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/extras/mini-os/COPYING b/extras/mini-os/COPYING
index c26ccfc..1d9df6c 100644
--- a/extras/mini-os/COPYING
+++ b/extras/mini-os/COPYING
@@ -1,3 +1,16 @@
+Certain files in this directory are licensed by the GNU
+General Public License version 2 (GPLv2). By default these
+files are not built and linked into MiniOs. Enabling them
+will cause the whole work to become covered by the GPLv2.
+
+The current set of GPLv2 features are:
+CONFIG_TPMFRONT
+CONFIG_TPMBACK
+CONFIG_TPM_TIS
+
+Do not use these if you do not want your MiniOS build to become
+GPL licensed!
+
 Copyright (c) 2009 Citrix Systems, Inc. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:17:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:17:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1CE-0001Ks-Bz; Thu, 15 Nov 2012 15:17:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1CC-0001KI-FN
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:17:36 +0000
Received: from [85.158.143.99:22093] by server-3.bemta-4.messagelabs.com id
	72/61-06841-F8705A05; Thu, 15 Nov 2012 15:17:35 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352992652!29507877!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD,UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21920 invoked from network); 15 Nov 2012 15:17:33 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-3.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 15:17:33 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187343;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:07 -0500
Message-Id: <1352992629-5850-9-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 08/10] add vtpm-stubdom code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add the code base for vtpm-stubdom to the stubdom
heirarchy. Makefile changes in later patch.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/vtpm/Makefile    |   37 +++++
 stubdom/vtpm/minios.cfg  |   14 ++
 stubdom/vtpm/vtpm.c      |  404 ++++++++++++++++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm.h      |   36 +++++
 stubdom/vtpm/vtpm_cmd.c  |  256 +++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm_cmd.h  |   31 ++++
 stubdom/vtpm/vtpm_pcrs.c |   43 +++++
 stubdom/vtpm/vtpm_pcrs.h |   53 ++++++
 stubdom/vtpm/vtpmblk.c   |  307 +++++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpmblk.h   |   31 ++++
 10 files changed, 1212 insertions(+)
 create mode 100644 stubdom/vtpm/Makefile
 create mode 100644 stubdom/vtpm/minios.cfg
 create mode 100644 stubdom/vtpm/vtpm.c
 create mode 100644 stubdom/vtpm/vtpm.h
 create mode 100644 stubdom/vtpm/vtpm_cmd.c
 create mode 100644 stubdom/vtpm/vtpm_cmd.h
 create mode 100644 stubdom/vtpm/vtpm_pcrs.c
 create mode 100644 stubdom/vtpm/vtpm_pcrs.h
 create mode 100644 stubdom/vtpm/vtpmblk.c
 create mode 100644 stubdom/vtpm/vtpmblk.h

diff --git a/stubdom/vtpm/Makefile b/stubdom/vtpm/Makefile
new file mode 100644
index 0000000..686c0ea
--- /dev/null
+++ b/stubdom/vtpm/Makefile
@@ -0,0 +1,37 @@
+# Copyright (c) 2010-2012 United States Government, as represented by
+# the Secretary of Defense.  All rights reserved.
+#
+# THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+# ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+# INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+# DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+# SOFTWARE.
+#
+
+XEN_ROOT=../..
+
+PSSL_DIR=../polarssl-$(XEN_TARGET_ARCH)/library
+PSSL_OBJS=aes.o sha1.o entropy.o ctr_drbg.o sha4.o
+
+TARGET=vtpm.a
+OBJS=vtpm.o vtpm_cmd.o vtpmblk.o vtpm_pcrs.o
+
+
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/build
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/tpm
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/crypto
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)
+
+$(TARGET): $(OBJS)
+	ar -cr $@ $(OBJS) $(TPMEMU_OBJS) $(foreach obj,$(PSSL_OBJS),$(PSSL_DIR)/$(obj))
+
+$(OBJS): vtpm_manager.h
+
+vtpm_manager.h:
+	ln -s ../vtpmmgr/vtpm_manager.h vtpm_manager.h
+
+clean:
+	-rm $(TARGET) $(OBJS) vtpm_manager.h
+
+.PHONY: clean
diff --git a/stubdom/vtpm/minios.cfg b/stubdom/vtpm/minios.cfg
new file mode 100644
index 0000000..31652ee
--- /dev/null
+++ b/stubdom/vtpm/minios.cfg
@@ -0,0 +1,14 @@
+CONFIG_TPMFRONT=y
+CONFIG_TPM_TIS=n
+CONFIG_TPMBACK=y
+CONFIG_START_NETWORK=n
+CONFIG_TEST=n
+CONFIG_PCIFRONT=n
+CONFIG_BLKFRONT=y
+CONFIG_NETFRONT=n
+CONFIG_FBFRONT=n
+CONFIG_KBDFRONT=n
+CONFIG_CONSFRONT=n
+CONFIG_XENBUS=y
+CONFIG_LWIP=n
+CONFIG_XC=n
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
new file mode 100644
index 0000000..71aef78
--- /dev/null
+++ b/stubdom/vtpm/vtpm.c
@@ -0,0 +1,404 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <syslog.h>
+#include <stdbool.h>
+#include <errno.h>
+#include <sys/time.h>
+#include <xen/xen.h>
+#include <tpmback.h>
+#include <tpmfront.h>
+
+#include <polarssl/entropy.h>
+#include <polarssl/ctr_drbg.h>
+
+#include "tpm/tpm_emulator_extern.h"
+#include "tpm/tpm_marshalling.h"
+#include "vtpm.h"
+#include "vtpm_cmd.h"
+#include "vtpm_pcrs.h"
+#include "vtpmblk.h"
+
+#define TPM_LOG_INFO LOG_INFO
+#define TPM_LOG_ERROR LOG_ERR
+#define TPM_LOG_DEBUG LOG_DEBUG
+
+/* Global commandline options - default values */
+struct Opt_args opt_args = {
+   .startup = ST_CLEAR,
+   .loglevel = TPM_LOG_INFO,
+   .hwinitpcrs = VTPM_PCRNONE,
+   .tpmconf = 0,
+   .enable_maint_cmds = false,
+};
+
+static uint32_t badords[32];
+static unsigned int n_badords = 0;
+
+entropy_context entropy;
+ctr_drbg_context ctr_drbg;
+
+struct tpmfront_dev* tpmfront_dev;
+
+void vtpm_get_extern_random_bytes(void *buf, size_t nbytes)
+{
+   ctr_drbg_random(&ctr_drbg, buf, nbytes);
+}
+
+int vtpm_read_from_file(uint8_t **data, size_t *data_length) {
+   return read_vtpmblk(tpmfront_dev, data, data_length);
+}
+
+int vtpm_write_to_file(uint8_t *data, size_t data_length) {
+   return write_vtpmblk(tpmfront_dev, data, data_length);
+}
+
+int vtpm_extern_init_fake(void) {
+   return 0;
+}
+
+void vtpm_extern_release_fake(void) {
+}
+
+
+void vtpm_log(int priority, const char *fmt, ...)
+{
+   if(opt_args.loglevel >= priority) {
+      va_list v;
+      va_start(v, fmt);
+      vprintf(fmt, v);
+      va_end(v);
+   }
+}
+
+static uint64_t vtpm_get_ticks(void)
+{
+  static uint64_t old_t = 0;
+  uint64_t new_t, res_t;
+  struct timeval tv;
+  gettimeofday(&tv, NULL);
+  new_t = (uint64_t)tv.tv_sec * 1000000 + (uint64_t)tv.tv_usec;
+  res_t = (old_t > 0) ? new_t - old_t : 0;
+  old_t = new_t;
+  return res_t;
+}
+
+
+static int tpm_entropy_source(void* dummy, unsigned char* data, size_t len, size_t* olen) {
+   UINT32 sz = len;
+   TPM_RESULT rc = VTPM_GetRandom(tpmfront_dev, data, &sz);
+   *olen = sz;
+   return rc == TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
+}
+
+int init_random(void) {
+   /* Initialize the rng */
+   entropy_init(&entropy);
+   entropy_add_source(&entropy, tpm_entropy_source, NULL, 0);
+   entropy_gather(&entropy);
+   ctr_drbg_init(&ctr_drbg, entropy_func, &entropy, NULL, 0);
+   ctr_drbg_set_prediction_resistance( &ctr_drbg, CTR_DRBG_PR_OFF );
+
+   return 0;
+}
+
+int check_ordinal(tpmcmd_t* tpmcmd) {
+   TPM_COMMAND_CODE ord;
+   UINT32 len = 4;
+   BYTE* ptr;
+   unsigned int i;
+
+   if(tpmcmd->req_len < 10) {
+      return true;
+   }
+
+   ptr = tpmcmd->req + 6;
+   tpm_unmarshal_UINT32(&ptr, &len, &ord);
+
+   for(i = 0; i < n_badords; ++i) {
+      if(ord == badords[i]) {
+         error("Disabled command ordinal (%" PRIu32") requested!\n");
+         return false;
+      }
+   }
+   return true;
+}
+
+static void main_loop(void) {
+   tpmcmd_t* tpmcmd = NULL;
+   domid_t domid;		/* Domid of frontend */
+   unsigned int handle;	/* handle of frontend */
+   int res = -1;
+
+   info("VTPM Initializing\n");
+
+   /* Set required tpm config args */
+   opt_args.tpmconf |= TPM_CONF_STRONG_PERSISTENCE;
+   opt_args.tpmconf &= ~TPM_CONF_USE_INTERNAL_PRNG;
+   opt_args.tpmconf |= TPM_CONF_GENERATE_EK;
+   opt_args.tpmconf |= TPM_CONF_GENERATE_SEED_DAA;
+
+   /* Initialize the emulator */
+   tpm_emulator_init(opt_args.startup, opt_args.tpmconf);
+
+   /* Initialize any requested PCRs with hardware TPM values */
+   if(vtpm_initialize_hw_pcrs(tpmfront_dev, opt_args.hwinitpcrs) != TPM_SUCCESS) {
+      error("Failed to initialize PCRs with hardware TPM values");
+      goto abort_postpcrs;
+   }
+
+   /* Wait for the frontend domain to connect */
+   info("Waiting for frontend domain to connect..");
+   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
+      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
+   } else {
+      error("Unable to attach to a frontend");
+   }
+
+   tpmcmd = tpmback_req(domid, handle);
+   while(tpmcmd) {
+      /* Handle the request */
+      if(tpmcmd->req_len) {
+	 tpmcmd->resp = NULL;
+	 tpmcmd->resp_len = 0;
+
+         /* First check for disabled ordinals */
+         if(!check_ordinal(tpmcmd)) {
+            create_error_response(tpmcmd, TPM_BAD_ORDINAL);
+         }
+         /* If not disabled, do the command */
+         else {
+            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
+               error("tpm_handle_command() failed");
+               create_error_response(tpmcmd, TPM_FAIL);
+            }
+         }
+      }
+
+      /* Send the response */
+      tpmback_resp(tpmcmd);
+
+      /* Wait for the next request */
+      tpmcmd = tpmback_req(domid, handle);
+
+   }
+
+abort_postpcrs:
+   info("VTPM Shutting down\n");
+
+   tpm_emulator_shutdown();
+}
+
+int parse_cmd_line(int argc, char** argv)
+{
+   char sval[25];
+   char* logstr = NULL;
+   /* Parse the command strings */
+   for(unsigned int i = 1; i < argc; ++i) {
+      if (sscanf(argv[i], "loglevel=%25s", sval) == 1){
+	 if (!strcmp(sval, "debug")) {
+	    opt_args.loglevel = TPM_LOG_DEBUG;
+	    logstr = "debug";
+	 }
+	 else if (!strcmp(sval, "info")) {
+	    logstr = "info";
+	    opt_args.loglevel = TPM_LOG_INFO;
+	 }
+	 else if (!strcmp(sval, "error")) {
+	    logstr = "error";
+	    opt_args.loglevel = TPM_LOG_ERROR;
+	 }
+      }
+      else if (!strcmp(argv[i], "clear")) {
+	 opt_args.startup = ST_CLEAR;
+      }
+      else if (!strcmp(argv[i], "save")) {
+	 opt_args.startup = ST_SAVE;
+      }
+      else if (!strcmp(argv[i], "deactivated")) {
+	 opt_args.startup = ST_DEACTIVATED;
+      }
+      else if (!strncmp(argv[i], "maintcmds=", 10)) {
+         if(!strcmp(argv[i] + 10, "1")) {
+            opt_args.enable_maint_cmds = true;
+         } else if(!strcmp(argv[i] + 10, "0")) {
+            opt_args.enable_maint_cmds = false;
+         }
+      }
+      else if(!strncmp(argv[i], "hwinitpcr=", 10)) {
+         char *pch = argv[i] + 10;
+         unsigned int v1, v2;
+         pch = strtok(pch, ",");
+         while(pch != NULL) {
+            if(!strcmp(pch, "all")) {
+               //Set all
+               opt_args.hwinitpcrs = VTPM_PCRALL;
+            } else if(!strcmp(pch, "none")) {
+               //Set none
+               opt_args.hwinitpcrs = VTPM_PCRNONE;
+            } else if(sscanf(pch, "%u", &v1) == 1) {
+               //Set one
+               if(v1 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               opt_args.hwinitpcrs |= (1 << v1);
+            } else if(sscanf(pch, "%u-%u", &v1, &v2) == 2) {
+               //Set range
+               if(v1 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               if(v2 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               if(v2 < v1) {
+                  unsigned tp = v1;
+                  v1 = v2;
+                  v2 = tp;
+               }
+               for(unsigned int i = v1; i <= v2; ++i) {
+                  opt_args.hwinitpcrs |= (1 << i);
+               }
+            } else {
+               error("hwintipcr error: Invalid PCR specification : %s", pch);
+               return -1;
+            }
+            pch = strtok(NULL, ",");
+         }
+      }
+      else {
+	 error("Invalid command line option `%s'", argv[i]);
+      }
+
+   }
+
+   /* Check Errors and print results */
+   switch(opt_args.startup) {
+      case ST_CLEAR:
+	 info("Startup mode is `clear'");
+	 break;
+      case ST_SAVE:
+	 info("Startup mode is `save'");
+	 break;
+      case ST_DEACTIVATED:
+	 info("Startup mode is `deactivated'");
+	 break;
+      default:
+	 error("Invalid startup mode %d", opt_args.startup);
+	 return -1;
+   }
+
+   if(opt_args.hwinitpcrs & (VTPM_PCRALL))
+   {
+      char pcrstr[1024];
+      char* ptr = pcrstr;
+
+      pcrstr[0] = '\0';
+      info("The following PCRs will be initialized with values from the hardware TPM:");
+      for(unsigned int i = 0; i < TPM_NUM_PCR; ++i) {
+         if(opt_args.hwinitpcrs & (1 << i)) {
+            ptr += sprintf(ptr, "%u, ", i);
+         }
+      }
+      /* get rid of the last comma if any numbers were printed */
+      *(ptr -2) = '\0';
+
+      info("\t%s", pcrstr);
+   } else {
+      info("All PCRs initialized to default values");
+   }
+
+   if(!opt_args.enable_maint_cmds) {
+      info("TPM Maintenance Commands disabled");
+      badords[n_badords++] = TPM_ORD_CreateMaintenanceArchive;
+      badords[n_badords++] = TPM_ORD_LoadMaintenanceArchive;
+      badords[n_badords++] = TPM_ORD_KillMaintenanceFeature;
+      badords[n_badords++] = TPM_ORD_LoadManuMaintPub;
+      badords[n_badords++] = TPM_ORD_ReadManuMaintPub;
+   } else {
+      info("TPM Maintenance Commands enabled");
+   }
+
+   info("Log level set to %s", logstr);
+
+   return 0;
+}
+
+void cleanup_opt_args(void) {
+}
+
+int main(int argc, char **argv)
+{
+   //FIXME: initializing blkfront without this sleep causes the domain to crash on boot
+   sleep(2);
+
+   /* Setup extern function pointers */
+   tpm_extern_init = vtpm_extern_init_fake;
+   tpm_extern_release = vtpm_extern_release_fake;
+   tpm_malloc = malloc;
+   tpm_free = free;
+   tpm_log = vtpm_log;
+   tpm_get_ticks = vtpm_get_ticks;
+   tpm_get_extern_random_bytes = vtpm_get_extern_random_bytes;
+   tpm_write_to_storage = vtpm_write_to_file;
+   tpm_read_from_storage = vtpm_read_from_file;
+
+   info("starting TPM Emulator (1.2.%d.%d-%d)", VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD);
+   if(parse_cmd_line(argc, argv)) {
+      error("Error parsing commandline\n");
+      return -1;
+   }
+
+   /* Initialize devices */
+   init_tpmback();
+   if((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
+      error("Unable to initialize tpmfront device");
+      goto abort_posttpmfront;
+   }
+
+   /* Seed the RNG with entropy from hardware TPM */
+   if(init_random()) {
+      error("Unable to initialize RNG");
+      goto abort_postrng;
+   }
+
+   /* Initialize blkfront device */
+   if(init_vtpmblk(tpmfront_dev)) {
+      error("Unable to initialize Blkfront persistent storage");
+      goto abort_postvtpmblk;
+   }
+
+   /* Run main loop */
+   main_loop();
+
+   /* Shutdown blkfront */
+   shutdown_vtpmblk();
+abort_postvtpmblk:
+abort_postrng:
+
+   /* Close devices */
+   shutdown_tpmfront(tpmfront_dev);
+abort_posttpmfront:
+   shutdown_tpmback();
+
+   cleanup_opt_args();
+
+   return 0;
+}
diff --git a/stubdom/vtpm/vtpm.h b/stubdom/vtpm/vtpm.h
new file mode 100644
index 0000000..5919e44
--- /dev/null
+++ b/stubdom/vtpm/vtpm.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef VTPM_H
+#define VTPM_H
+
+#include <stdbool.h>
+
+/* For testing */
+#define VERS_CMD "\x00\xC1\x00\x00\x00\x16\x00\x00\x00\x65\x00\x00\x00\x05\x00\x00\x00\x04\x00\x00\x01\x03"
+#define VERS_CMD_LEN 22
+
+/* Global commandline options */
+struct Opt_args {
+   enum StartUp {
+      ST_CLEAR = 1,
+      ST_SAVE = 2,
+      ST_DEACTIVATED = 3
+   } startup;
+   unsigned long hwinitpcrs;
+   int loglevel;
+   uint32_t tpmconf;
+   bool enable_maint_cmds;
+};
+extern struct Opt_args opt_args;
+
+#endif
diff --git a/stubdom/vtpm/vtpm_cmd.c b/stubdom/vtpm/vtpm_cmd.c
new file mode 100644
index 0000000..7eae98b
--- /dev/null
+++ b/stubdom/vtpm/vtpm_cmd.c
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <types.h>
+#include <xen/xen.h>
+#include <mm.h>
+#include <gnttab.h>
+#include "tpm/tpm_marshalling.h"
+#include "vtpm_manager.h"
+#include "vtpm_cmd.h"
+#include <tpmback.h>
+
+#define TRYFAILGOTO(C) \
+   if((C)) { \
+      status = TPM_FAIL; \
+      goto abort_egress; \
+   }
+#define TRYFAILGOTOMSG(C, msg) \
+   if((C)) { \
+      status = TPM_FAIL; \
+      error(msg); \
+      goto abort_egress; \
+   }
+#define CHECKSTATUSGOTO(ret, fname) \
+   if((ret) != TPM_SUCCESS) { \
+      error("%s failed with error code (%lu)", fname, (unsigned long) ret); \
+      status = ord; \
+      goto abort_egress; \
+   }
+
+#define ERR_MALFORMED "Malformed response from backend"
+#define ERR_TPMFRONT "Error sending command through frontend device"
+
+struct shpage {
+   void* page;
+   grant_ref_t grantref;
+};
+
+typedef struct shpage shpage_t;
+
+static inline int pack_header(uint8_t** bptr, UINT32* len, TPM_TAG tag, UINT32 size, TPM_COMMAND_CODE ord)
+{
+   return *bptr == NULL ||
+	 tpm_marshal_UINT16(bptr, len, tag) ||
+	 tpm_marshal_UINT32(bptr, len, size) ||
+	 tpm_marshal_UINT32(bptr, len, ord);
+}
+
+static inline int unpack_header(uint8_t** bptr, UINT32* len, TPM_TAG* tag, UINT32* size, TPM_COMMAND_CODE* ord)
+{
+   return *bptr == NULL ||
+	 tpm_unmarshal_UINT16(bptr, len, tag) ||
+	 tpm_unmarshal_UINT32(bptr, len, size) ||
+	 tpm_unmarshal_UINT32(bptr, len, ord);
+}
+
+int create_error_response(tpmcmd_t* tpmcmd, TPM_RESULT errorcode)
+{
+   TPM_TAG tag;
+   UINT32 len = tpmcmd->req_len;
+   uint8_t* respptr;
+   uint8_t* cmdptr = tpmcmd->req;
+
+   if(!tpm_unmarshal_UINT16(&cmdptr, &len, &tag)) {
+      switch (tag) {
+         case TPM_TAG_RQU_COMMAND:
+            tag = TPM_TAG_RSP_COMMAND;
+            break;
+         case TPM_TAG_RQU_AUTH1_COMMAND:
+            tag = TPM_TAG_RQU_AUTH2_COMMAND;
+            break;
+         case TPM_TAG_RQU_AUTH2_COMMAND:
+            tag = TPM_TAG_RQU_AUTH2_COMMAND;
+            break;
+      }
+   } else {
+      tag = TPM_TAG_RSP_COMMAND;
+   }
+
+   tpmcmd->resp_len = len = 10;
+   tpmcmd->resp = respptr = tpm_malloc(tpmcmd->resp_len);
+
+   return pack_header(&respptr, &len, tag, len, errorcode);
+}
+
+TPM_RESULT VTPM_GetRandom(struct tpmfront_dev* tpmfront_dev, BYTE* bytes, UINT32 *numbytes) {
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* cmdbuf, *resp, *bptr;
+   size_t resplen = 0;
+   UINT32 len;
+
+   /*Ask the real tpm for random bytes for the seed */
+   TPM_TAG tag = TPM_TAG_RQU_COMMAND;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = TPM_ORD_GetRandom;
+   len = size = sizeof(TPM_TAG) + sizeof(UINT32) + sizeof(TPM_COMMAND_CODE) + sizeof(UINT32);
+
+   /*Create the raw tpm command */
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   TRYFAILGOTO(tpm_marshal_UINT32(&bptr, &len, *numbytes));
+
+   /* Send cmd, wait for response */
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen),
+      ERR_TPMFRONT);
+
+   bptr = resp; len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   //Check return status of command
+   CHECKSTATUSGOTO(ord, "TPM_GetRandom()");
+
+   // Get the number of random bytes in the response
+   TRYFAILGOTOMSG(tpm_unmarshal_UINT32(&bptr, &len, &size), ERR_MALFORMED);
+   *numbytes = size;
+
+   //Get the random bytes out, tpm may give us less bytes than what we wanrt
+   TRYFAILGOTOMSG(tpm_unmarshal_BYTE_ARRAY(&bptr, &len, bytes, *numbytes), ERR_MALFORMED);
+
+   goto egress;
+abort_egress:
+egress:
+   free(cmdbuf);
+   return status;
+
+}
+
+TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* bptr, *resp;
+   uint8_t* cmdbuf = NULL;
+   size_t resplen = 0;
+   UINT32 len;
+
+   TPM_TAG tag = VTPM_TAG_REQ;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = VTPM_ORD_LOADHASHKEY;
+
+   /*Create the command*/
+   len = size = VTPM_COMMAND_HEADER_SIZE;
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+
+   /* Send the command to vtpm_manager */
+   info("Requesting Encryption key from backend");
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   /* Unpack response header */
+   bptr = resp;
+   len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   /* Check return code */
+   CHECKSTATUSGOTO(ord, "VTPM_LoadHashKey()");
+
+   /* Get the size of the key */
+   *data_length = size - VTPM_COMMAND_HEADER_SIZE;
+
+   /* Copy the key bits */
+   *data = malloc(*data_length);
+   memcpy(*data, bptr, *data_length);
+
+   goto egress;
+abort_egress:
+   error("VTPM_LoadHashKey failed");
+egress:
+   free(cmdbuf);
+   return status;
+}
+
+TPM_RESULT VTPM_SaveHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* bptr, *resp;
+   uint8_t* cmdbuf = NULL;
+   size_t resplen = 0;
+   UINT32 len;
+
+   TPM_TAG tag = VTPM_TAG_REQ;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = VTPM_ORD_SAVEHASHKEY;
+
+   /*Create the command*/
+   len = size = VTPM_COMMAND_HEADER_SIZE + data_length;
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   memcpy(bptr, data, data_length);
+   bptr += data_length;
+
+   /* Send the command to vtpm_manager */
+   info("Sending encryption key to backend");
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   /* Unpack response header */
+   bptr = resp;
+   len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   /* Check return code */
+   CHECKSTATUSGOTO(ord, "VTPM_SaveHashKey()");
+
+   goto egress;
+abort_egress:
+   error("VTPM_SaveHashKey failed");
+egress:
+   free(cmdbuf);
+   return status;
+}
+
+TPM_RESULT VTPM_PCRRead(struct tpmfront_dev* tpmfront_dev, UINT32 pcrIndex, BYTE* outDigest)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t *cmdbuf, *resp, *bptr;
+   size_t resplen = 0;
+   UINT32 len;
+
+   /*Just send a TPM_PCRRead Command to the HW tpm */
+   TPM_TAG tag = TPM_TAG_RQU_COMMAND;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = TPM_ORD_PCRRead;
+   len = size = sizeof(TPM_TAG) + sizeof(UINT32) + sizeof(TPM_COMMAND_CODE) + sizeof(UINT32);
+
+   /*Create the raw tpm cmd */
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   TRYFAILGOTO(tpm_marshal_UINT32(&bptr, &len, pcrIndex));
+
+   /*Send Cmd wait for response */
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   bptr = resp; len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   //Check return status of command
+   CHECKSTATUSGOTO(ord, "TPM_PCRRead");
+
+   //Get the ptr value
+   memcpy(outDigest, bptr, sizeof(TPM_PCRVALUE));
+
+   goto egress;
+abort_egress:
+egress:
+   free(cmdbuf);
+   return status;
+
+}
diff --git a/stubdom/vtpm/vtpm_cmd.h b/stubdom/vtpm/vtpm_cmd.h
new file mode 100644
index 0000000..b0bfa22
--- /dev/null
+++ b/stubdom/vtpm/vtpm_cmd.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef MANAGER_H
+#define MANAGER_H
+
+#include <tpmfront.h>
+#include <tpmback.h>
+#include "tpm/tpm_structures.h"
+
+/* Create a command response error header */
+int create_error_response(tpmcmd_t* tpmcmd, TPM_RESULT errorcode);
+/* Request random bytes from hardware tpm, returns 0 on success */
+TPM_RESULT VTPM_GetRandom(struct tpmfront_dev* tpmfront_dev, BYTE* bytes, UINT32* numbytes);
+/* Retreive 256 bit AES encryption key from manager */
+TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length);
+/* Manager securely saves our 256 bit AES encryption key */
+TPM_RESULT VTPM_SaveHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length);
+/* Send a TPM_PCRRead command passthrough the manager to the hw tpm */
+TPM_RESULT VTPM_PCRRead(struct tpmfront_dev* tpmfront_dev, UINT32 pcrIndex, BYTE* outDigest);
+
+#endif
diff --git a/stubdom/vtpm/vtpm_pcrs.c b/stubdom/vtpm/vtpm_pcrs.c
new file mode 100644
index 0000000..22a6cef
--- /dev/null
+++ b/stubdom/vtpm/vtpm_pcrs.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include "vtpm_pcrs.h"
+#include "vtpm_cmd.h"
+#include "tpm/tpm_data.h"
+
+#define PCR_VALUE      tpmData.permanent.data.pcrValue
+
+static int write_pcr_direct(unsigned int pcrIndex, uint8_t* val) {
+   if(pcrIndex > TPM_NUM_PCR) {
+      return TPM_BADINDEX;
+   }
+   memcpy(&PCR_VALUE[pcrIndex], val, sizeof(TPM_PCRVALUE));
+   return TPM_SUCCESS;
+}
+
+TPM_RESULT vtpm_initialize_hw_pcrs(struct tpmfront_dev* tpmfront_dev, unsigned long pcrs)
+{
+   TPM_RESULT rc = TPM_SUCCESS;
+   uint8_t digest[sizeof(TPM_PCRVALUE)];
+
+   for(unsigned int i = 0; i < TPM_NUM_PCR; ++i) {
+      if(pcrs & 1 << i) {
+         if((rc = VTPM_PCRRead(tpmfront_dev, i, digest)) != TPM_SUCCESS) {
+            error("TPM_PCRRead failed with error : %d", rc);
+            return rc;
+         }
+         write_pcr_direct(i, digest);
+      }
+   }
+
+   return rc;
+}
diff --git a/stubdom/vtpm/vtpm_pcrs.h b/stubdom/vtpm/vtpm_pcrs.h
new file mode 100644
index 0000000..11835f9
--- /dev/null
+++ b/stubdom/vtpm/vtpm_pcrs.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef VTPM_PCRS_H
+#define VTPM_PCRS_H
+
+#include "tpm/tpm_structures.h"
+
+#define VTPM_PCR0 1
+#define VTPM_PCR1 1 << 1
+#define VTPM_PCR2 1 << 2
+#define VTPM_PCR3 1 << 3
+#define VTPM_PCR4 1 << 4
+#define VTPM_PCR5 1 << 5
+#define VTPM_PCR6 1 << 6
+#define VTPM_PCR7 1 << 7
+#define VTPM_PCR8 1 << 8
+#define VTPM_PCR9 1 << 9
+#define VTPM_PCR10 1 << 10
+#define VTPM_PCR11 1 << 11
+#define VTPM_PCR12 1 << 12
+#define VTPM_PCR13 1 << 13
+#define VTPM_PCR14 1 << 14
+#define VTPM_PCR15 1 << 15
+#define VTPM_PCR16 1 << 16
+#define VTPM_PCR17 1 << 17
+#define VTPM_PCR18 1 << 18
+#define VTPM_PCR19 1 << 19
+#define VTPM_PCR20 1 << 20
+#define VTPM_PCR21 1 << 21
+#define VTPM_PCR22 1 << 22
+#define VTPM_PCR23 1 << 23
+
+#define VTPM_PCRALL (1 << TPM_NUM_PCR) - 1
+#define VTPM_PCRNONE 0
+
+#define VTPM_NUMPCRS 24
+
+struct tpmfront_dev;
+
+TPM_RESULT vtpm_initialize_hw_pcrs(struct tpmfront_dev* tpmfront_dev, unsigned long pcrs);
+
+
+#endif
diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
new file mode 100644
index 0000000..b343bd8
--- /dev/null
+++ b/stubdom/vtpm/vtpmblk.c
@@ -0,0 +1,307 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <mini-os/byteorder.h>
+#include "vtpmblk.h"
+#include "tpm/tpm_marshalling.h"
+#include "vtpm_cmd.h"
+#include "polarssl/aes.h"
+#include "polarssl/sha1.h"
+#include <blkfront.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+
+/*Encryption key and block sizes */
+#define BLKSZ 16
+
+static struct blkfront_dev* blkdev = NULL;
+static int blkfront_fd = -1;
+
+int init_vtpmblk(struct tpmfront_dev* tpmfront_dev)
+{
+   struct blkfront_info blkinfo;
+   info("Initializing persistent NVM storage\n");
+
+   if((blkdev = init_blkfront(NULL, &blkinfo)) == NULL) {
+      error("BLKIO: ERROR Unable to initialize blkfront");
+      return -1;
+   }
+   if (blkinfo.info & VDISK_READONLY || blkinfo.mode != O_RDWR) {
+      error("BLKIO: ERROR block device is read only!");
+      goto error;
+   }
+   if((blkfront_fd = blkfront_open(blkdev)) == -1) {
+      error("Unable to open blkfront file descriptor!");
+      goto error;
+   }
+
+   return 0;
+error:
+   shutdown_blkfront(blkdev);
+   blkdev = NULL;
+   return -1;
+}
+
+void shutdown_vtpmblk(void)
+{
+   close(blkfront_fd);
+   blkfront_fd = -1;
+   blkdev = NULL;
+}
+
+int write_vtpmblk_raw(uint8_t *data, size_t data_length)
+{
+   int rc;
+   uint32_t lenbuf;
+   debug("Begin Write data=%p len=%u", data, data_length);
+
+   lenbuf = cpu_to_be32((uint32_t)data_length);
+
+   lseek(blkfront_fd, 0, SEEK_SET);
+   if((rc = write(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
+      error("write(length) failed! error was %s", strerror(errno));
+      return -1;
+   }
+   if((rc = write(blkfront_fd, data, data_length)) != data_length) {
+      error("write(data) failed! error was %s", strerror(errno));
+      return -1;
+   }
+
+   info("Wrote %u bytes to NVM persistent storage", data_length);
+
+   return 0;
+}
+
+int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
+{
+   int rc;
+   uint32_t lenbuf;
+
+   lseek(blkfront_fd, 0, SEEK_SET);
+   if(( rc = read(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
+      error("read(length) failed! error was %s", strerror(errno));
+      return -1;
+   }
+   *data_length = (size_t) cpu_to_be32(lenbuf);
+   if(*data_length == 0) {
+      error("read 0 data_length for NVM");
+      return -1;
+   }
+
+   *data = tpm_malloc(*data_length);
+   if((rc = read(blkfront_fd, *data, *data_length)) != *data_length) {
+      error("read(data) failed! error was %s", strerror(errno));
+      return -1;
+   }
+
+   info("Read %u bytes from NVM persistent storage", *data_length);
+   return 0;
+}
+
+int encrypt_vtpmblk(uint8_t* clear, size_t clear_len, uint8_t** cipher, size_t* cipher_len, uint8_t* symkey)
+{
+   int rc = 0;
+   uint8_t iv[BLKSZ];
+   aes_context aes_ctx;
+   UINT32 temp;
+   int mod;
+
+   uint8_t* clbuf = NULL;
+
+   uint8_t* ivptr;
+   int ivlen;
+
+   uint8_t* cptr;	//Cipher block pointer
+   int clen;	//Cipher block length
+
+   /*Create a new 256 bit encryption key */
+   if(symkey == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+   tpm_get_extern_random_bytes(symkey, NVMKEYSZ);
+
+   /*Setup initialization vector - random bits and then 4 bytes clear text size at the end*/
+   temp = sizeof(UINT32);
+   ivlen = BLKSZ - temp;
+   tpm_get_extern_random_bytes(iv, ivlen);
+   ivptr = iv + ivlen;
+   tpm_marshal_UINT32(&ivptr, &temp, (UINT32) clear_len);
+
+   /*The clear text needs to be padded out to a multiple of BLKSZ */
+   mod = clear_len % BLKSZ;
+   clen = mod ? clear_len + BLKSZ - mod : clear_len;
+   clbuf = malloc(clen);
+   if (clbuf == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+   memcpy(clbuf, clear, clear_len);
+   /* zero out the padding bits - FIXME: better / more secure way to handle these? */
+   if(clen - clear_len) {
+      memset(clbuf + clear_len, 0, clen - clear_len);
+   }
+
+   /* Setup the ciphertext buffer */
+   *cipher_len = BLKSZ + clen;		/*iv + ciphertext */
+   cptr = *cipher = malloc(*cipher_len);
+   if (*cipher == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Copy the IV to cipher text blob*/
+   memcpy(cptr, iv, BLKSZ);
+   cptr += BLKSZ;
+
+   /* Setup encryption */
+   aes_setkey_enc(&aes_ctx, symkey, 256);
+
+   /* Do encryption now */
+   aes_crypt_cbc(&aes_ctx, AES_ENCRYPT, clen, iv, clbuf, cptr);
+
+   goto egress;
+abort_egress:
+egress:
+   free(clbuf);
+   return rc;
+}
+int decrypt_vtpmblk(uint8_t* cipher, size_t cipher_len, uint8_t** clear, size_t* clear_len, uint8_t* symkey)
+{
+   int rc = 0;
+   uint8_t iv[BLKSZ];
+   uint8_t* ivptr;
+   UINT32 u32, temp;
+   aes_context aes_ctx;
+
+   uint8_t* cptr = cipher;	//cipher block pointer
+   int clen = cipher_len;	//cipher block length
+
+   /* Pull out the initialization vector */
+   memcpy(iv, cipher, BLKSZ);
+   cptr += BLKSZ;
+   clen -= BLKSZ;
+
+   /* Setup the clear text buffer */
+   if((*clear = malloc(clen)) == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Get the length of clear text from last 4 bytes of iv */
+   temp = sizeof(UINT32);
+   ivptr = iv + BLKSZ - temp;
+   tpm_unmarshal_UINT32(&ivptr, &temp, &u32);
+   *clear_len = u32;
+
+   /* Setup decryption */
+   aes_setkey_dec(&aes_ctx, symkey, 256);
+
+   /* Do decryption now */
+   if ((clen % BLKSZ) != 0) {
+      error("Decryption Error: Cipher block size was not a multiple of %u", BLKSZ);
+      rc = -1;
+      goto abort_egress;
+   }
+   aes_crypt_cbc(&aes_ctx, AES_DECRYPT, clen, iv, cptr, *clear);
+
+   goto egress;
+abort_egress:
+egress:
+   return rc;
+}
+
+int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length) {
+   int rc;
+   uint8_t* cipher = NULL;
+   size_t cipher_len = 0;
+   uint8_t hashkey[HASHKEYSZ];
+   uint8_t* symkey = hashkey + HASHSZ;
+
+   /* Encrypt the data */
+   if((rc = encrypt_vtpmblk(data, data_length, &cipher, &cipher_len, symkey))) {
+      goto abort_egress;
+   }
+   /* Write to disk */
+   if((rc = write_vtpmblk_raw(cipher, cipher_len))) {
+      goto abort_egress;
+   }
+   /* Get sha1 hash of data */
+   sha1(cipher, cipher_len, hashkey);
+
+   /* Send hash and key to manager */
+   if((rc = VTPM_SaveHashKey(tpmfront_dev, hashkey, HASHKEYSZ)) != TPM_SUCCESS) {
+      goto abort_egress;
+   }
+   goto egress;
+abort_egress:
+egress:
+   free(cipher);
+   return rc;
+}
+
+int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data_length) {
+   int rc;
+   uint8_t* cipher = NULL;
+   size_t cipher_len = 0;
+   size_t keysize;
+   uint8_t* hashkey = NULL;
+   uint8_t hash[HASHSZ];
+   uint8_t* symkey;
+
+   /* Retreive the hash and the key from the manager */
+   if((rc = VTPM_LoadHashKey(tpmfront_dev, &hashkey, &keysize)) != TPM_SUCCESS) {
+      goto abort_egress;
+   }
+   if(keysize != HASHKEYSZ) {
+      error("Manager returned a hashkey of invalid size! expected %d, actual %d", NVMKEYSZ, keysize);
+      rc = -1;
+      goto abort_egress;
+   }
+   symkey = hashkey + HASHSZ;
+
+   /* Read from disk now */
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len))) {
+      goto abort_egress;
+   }
+
+   /* Compute the hash of the cipher text and compare */
+   sha1(cipher, cipher_len, hash);
+   if(memcmp(hash, hashkey, HASHSZ)) {
+      int i;
+      error("NVM Storage Checksum failed!");
+      printf("Expected: ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hashkey[i]);
+      }
+      printf("\n");
+      printf("Actual:   ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hash[i]);
+      }
+      printf("\n");
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Decrypt the blob */
+   if((rc = decrypt_vtpmblk(cipher, cipher_len, data, data_length, symkey))) {
+      goto abort_egress;
+   }
+   goto egress;
+abort_egress:
+egress:
+   free(cipher);
+   free(hashkey);
+   return rc;
+}
diff --git a/stubdom/vtpm/vtpmblk.h b/stubdom/vtpm/vtpmblk.h
new file mode 100644
index 0000000..282ce6a
--- /dev/null
+++ b/stubdom/vtpm/vtpmblk.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef NVM_H
+#define NVM_H
+#include <mini-os/types.h>
+#include <xen/xen.h>
+#include <tpmfront.h>
+
+#define NVMKEYSZ 32
+#define HASHSZ 20
+#define HASHKEYSZ (NVMKEYSZ + HASHSZ)
+
+int init_vtpmblk(struct tpmfront_dev* tpmfront_dev);
+void shutdown_vtpmblk(void);
+
+/* Encrypts and writes data to blk device */
+int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t *data, size_t data_length);
+/* Reads, Decrypts, and returns data from blk device */
+int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t **data, size_t *data_length);
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:17:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:17:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1CE-0001Ks-Bz; Thu, 15 Nov 2012 15:17:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1CC-0001KI-FN
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:17:36 +0000
Received: from [85.158.143.99:22093] by server-3.bemta-4.messagelabs.com id
	72/61-06841-F8705A05; Thu, 15 Nov 2012 15:17:35 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352992652!29507877!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD,UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21920 invoked from network); 15 Nov 2012 15:17:33 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-3.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 15:17:33 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187343;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:07 -0500
Message-Id: <1352992629-5850-9-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 08/10] add vtpm-stubdom code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add the code base for vtpm-stubdom to the stubdom
heirarchy. Makefile changes in later patch.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/vtpm/Makefile    |   37 +++++
 stubdom/vtpm/minios.cfg  |   14 ++
 stubdom/vtpm/vtpm.c      |  404 ++++++++++++++++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm.h      |   36 +++++
 stubdom/vtpm/vtpm_cmd.c  |  256 +++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm_cmd.h  |   31 ++++
 stubdom/vtpm/vtpm_pcrs.c |   43 +++++
 stubdom/vtpm/vtpm_pcrs.h |   53 ++++++
 stubdom/vtpm/vtpmblk.c   |  307 +++++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpmblk.h   |   31 ++++
 10 files changed, 1212 insertions(+)
 create mode 100644 stubdom/vtpm/Makefile
 create mode 100644 stubdom/vtpm/minios.cfg
 create mode 100644 stubdom/vtpm/vtpm.c
 create mode 100644 stubdom/vtpm/vtpm.h
 create mode 100644 stubdom/vtpm/vtpm_cmd.c
 create mode 100644 stubdom/vtpm/vtpm_cmd.h
 create mode 100644 stubdom/vtpm/vtpm_pcrs.c
 create mode 100644 stubdom/vtpm/vtpm_pcrs.h
 create mode 100644 stubdom/vtpm/vtpmblk.c
 create mode 100644 stubdom/vtpm/vtpmblk.h

diff --git a/stubdom/vtpm/Makefile b/stubdom/vtpm/Makefile
new file mode 100644
index 0000000..686c0ea
--- /dev/null
+++ b/stubdom/vtpm/Makefile
@@ -0,0 +1,37 @@
+# Copyright (c) 2010-2012 United States Government, as represented by
+# the Secretary of Defense.  All rights reserved.
+#
+# THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+# ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+# INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+# DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+# SOFTWARE.
+#
+
+XEN_ROOT=../..
+
+PSSL_DIR=../polarssl-$(XEN_TARGET_ARCH)/library
+PSSL_OBJS=aes.o sha1.o entropy.o ctr_drbg.o sha4.o
+
+TARGET=vtpm.a
+OBJS=vtpm.o vtpm_cmd.o vtpmblk.o vtpm_pcrs.o
+
+
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/build
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/tpm
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/crypto
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)
+
+$(TARGET): $(OBJS)
+	ar -cr $@ $(OBJS) $(TPMEMU_OBJS) $(foreach obj,$(PSSL_OBJS),$(PSSL_DIR)/$(obj))
+
+$(OBJS): vtpm_manager.h
+
+vtpm_manager.h:
+	ln -s ../vtpmmgr/vtpm_manager.h vtpm_manager.h
+
+clean:
+	-rm $(TARGET) $(OBJS) vtpm_manager.h
+
+.PHONY: clean
diff --git a/stubdom/vtpm/minios.cfg b/stubdom/vtpm/minios.cfg
new file mode 100644
index 0000000..31652ee
--- /dev/null
+++ b/stubdom/vtpm/minios.cfg
@@ -0,0 +1,14 @@
+CONFIG_TPMFRONT=y
+CONFIG_TPM_TIS=n
+CONFIG_TPMBACK=y
+CONFIG_START_NETWORK=n
+CONFIG_TEST=n
+CONFIG_PCIFRONT=n
+CONFIG_BLKFRONT=y
+CONFIG_NETFRONT=n
+CONFIG_FBFRONT=n
+CONFIG_KBDFRONT=n
+CONFIG_CONSFRONT=n
+CONFIG_XENBUS=y
+CONFIG_LWIP=n
+CONFIG_XC=n
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
new file mode 100644
index 0000000..71aef78
--- /dev/null
+++ b/stubdom/vtpm/vtpm.c
@@ -0,0 +1,404 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <syslog.h>
+#include <stdbool.h>
+#include <errno.h>
+#include <sys/time.h>
+#include <xen/xen.h>
+#include <tpmback.h>
+#include <tpmfront.h>
+
+#include <polarssl/entropy.h>
+#include <polarssl/ctr_drbg.h>
+
+#include "tpm/tpm_emulator_extern.h"
+#include "tpm/tpm_marshalling.h"
+#include "vtpm.h"
+#include "vtpm_cmd.h"
+#include "vtpm_pcrs.h"
+#include "vtpmblk.h"
+
+#define TPM_LOG_INFO LOG_INFO
+#define TPM_LOG_ERROR LOG_ERR
+#define TPM_LOG_DEBUG LOG_DEBUG
+
+/* Global commandline options - default values */
+struct Opt_args opt_args = {
+   .startup = ST_CLEAR,
+   .loglevel = TPM_LOG_INFO,
+   .hwinitpcrs = VTPM_PCRNONE,
+   .tpmconf = 0,
+   .enable_maint_cmds = false,
+};
+
+static uint32_t badords[32];
+static unsigned int n_badords = 0;
+
+entropy_context entropy;
+ctr_drbg_context ctr_drbg;
+
+struct tpmfront_dev* tpmfront_dev;
+
+void vtpm_get_extern_random_bytes(void *buf, size_t nbytes)
+{
+   ctr_drbg_random(&ctr_drbg, buf, nbytes);
+}
+
+int vtpm_read_from_file(uint8_t **data, size_t *data_length) {
+   return read_vtpmblk(tpmfront_dev, data, data_length);
+}
+
+int vtpm_write_to_file(uint8_t *data, size_t data_length) {
+   return write_vtpmblk(tpmfront_dev, data, data_length);
+}
+
+int vtpm_extern_init_fake(void) {
+   return 0;
+}
+
+void vtpm_extern_release_fake(void) {
+}
+
+
+void vtpm_log(int priority, const char *fmt, ...)
+{
+   if(opt_args.loglevel >= priority) {
+      va_list v;
+      va_start(v, fmt);
+      vprintf(fmt, v);
+      va_end(v);
+   }
+}
+
+static uint64_t vtpm_get_ticks(void)
+{
+  static uint64_t old_t = 0;
+  uint64_t new_t, res_t;
+  struct timeval tv;
+  gettimeofday(&tv, NULL);
+  new_t = (uint64_t)tv.tv_sec * 1000000 + (uint64_t)tv.tv_usec;
+  res_t = (old_t > 0) ? new_t - old_t : 0;
+  old_t = new_t;
+  return res_t;
+}
+
+
+static int tpm_entropy_source(void* dummy, unsigned char* data, size_t len, size_t* olen) {
+   UINT32 sz = len;
+   TPM_RESULT rc = VTPM_GetRandom(tpmfront_dev, data, &sz);
+   *olen = sz;
+   return rc == TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
+}
+
+int init_random(void) {
+   /* Initialize the rng */
+   entropy_init(&entropy);
+   entropy_add_source(&entropy, tpm_entropy_source, NULL, 0);
+   entropy_gather(&entropy);
+   ctr_drbg_init(&ctr_drbg, entropy_func, &entropy, NULL, 0);
+   ctr_drbg_set_prediction_resistance( &ctr_drbg, CTR_DRBG_PR_OFF );
+
+   return 0;
+}
+
+int check_ordinal(tpmcmd_t* tpmcmd) {
+   TPM_COMMAND_CODE ord;
+   UINT32 len = 4;
+   BYTE* ptr;
+   unsigned int i;
+
+   if(tpmcmd->req_len < 10) {
+      return true;
+   }
+
+   ptr = tpmcmd->req + 6;
+   tpm_unmarshal_UINT32(&ptr, &len, &ord);
+
+   for(i = 0; i < n_badords; ++i) {
+      if(ord == badords[i]) {
+         error("Disabled command ordinal (%" PRIu32") requested!\n");
+         return false;
+      }
+   }
+   return true;
+}
+
+static void main_loop(void) {
+   tpmcmd_t* tpmcmd = NULL;
+   domid_t domid;		/* Domid of frontend */
+   unsigned int handle;	/* handle of frontend */
+   int res = -1;
+
+   info("VTPM Initializing\n");
+
+   /* Set required tpm config args */
+   opt_args.tpmconf |= TPM_CONF_STRONG_PERSISTENCE;
+   opt_args.tpmconf &= ~TPM_CONF_USE_INTERNAL_PRNG;
+   opt_args.tpmconf |= TPM_CONF_GENERATE_EK;
+   opt_args.tpmconf |= TPM_CONF_GENERATE_SEED_DAA;
+
+   /* Initialize the emulator */
+   tpm_emulator_init(opt_args.startup, opt_args.tpmconf);
+
+   /* Initialize any requested PCRs with hardware TPM values */
+   if(vtpm_initialize_hw_pcrs(tpmfront_dev, opt_args.hwinitpcrs) != TPM_SUCCESS) {
+      error("Failed to initialize PCRs with hardware TPM values");
+      goto abort_postpcrs;
+   }
+
+   /* Wait for the frontend domain to connect */
+   info("Waiting for frontend domain to connect..");
+   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
+      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
+   } else {
+      error("Unable to attach to a frontend");
+   }
+
+   tpmcmd = tpmback_req(domid, handle);
+   while(tpmcmd) {
+      /* Handle the request */
+      if(tpmcmd->req_len) {
+	 tpmcmd->resp = NULL;
+	 tpmcmd->resp_len = 0;
+
+         /* First check for disabled ordinals */
+         if(!check_ordinal(tpmcmd)) {
+            create_error_response(tpmcmd, TPM_BAD_ORDINAL);
+         }
+         /* If not disabled, do the command */
+         else {
+            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
+               error("tpm_handle_command() failed");
+               create_error_response(tpmcmd, TPM_FAIL);
+            }
+         }
+      }
+
+      /* Send the response */
+      tpmback_resp(tpmcmd);
+
+      /* Wait for the next request */
+      tpmcmd = tpmback_req(domid, handle);
+
+   }
+
+abort_postpcrs:
+   info("VTPM Shutting down\n");
+
+   tpm_emulator_shutdown();
+}
+
+int parse_cmd_line(int argc, char** argv)
+{
+   char sval[25];
+   char* logstr = NULL;
+   /* Parse the command strings */
+   for(unsigned int i = 1; i < argc; ++i) {
+      if (sscanf(argv[i], "loglevel=%25s", sval) == 1){
+	 if (!strcmp(sval, "debug")) {
+	    opt_args.loglevel = TPM_LOG_DEBUG;
+	    logstr = "debug";
+	 }
+	 else if (!strcmp(sval, "info")) {
+	    logstr = "info";
+	    opt_args.loglevel = TPM_LOG_INFO;
+	 }
+	 else if (!strcmp(sval, "error")) {
+	    logstr = "error";
+	    opt_args.loglevel = TPM_LOG_ERROR;
+	 }
+      }
+      else if (!strcmp(argv[i], "clear")) {
+	 opt_args.startup = ST_CLEAR;
+      }
+      else if (!strcmp(argv[i], "save")) {
+	 opt_args.startup = ST_SAVE;
+      }
+      else if (!strcmp(argv[i], "deactivated")) {
+	 opt_args.startup = ST_DEACTIVATED;
+      }
+      else if (!strncmp(argv[i], "maintcmds=", 10)) {
+         if(!strcmp(argv[i] + 10, "1")) {
+            opt_args.enable_maint_cmds = true;
+         } else if(!strcmp(argv[i] + 10, "0")) {
+            opt_args.enable_maint_cmds = false;
+         }
+      }
+      else if(!strncmp(argv[i], "hwinitpcr=", 10)) {
+         char *pch = argv[i] + 10;
+         unsigned int v1, v2;
+         pch = strtok(pch, ",");
+         while(pch != NULL) {
+            if(!strcmp(pch, "all")) {
+               //Set all
+               opt_args.hwinitpcrs = VTPM_PCRALL;
+            } else if(!strcmp(pch, "none")) {
+               //Set none
+               opt_args.hwinitpcrs = VTPM_PCRNONE;
+            } else if(sscanf(pch, "%u", &v1) == 1) {
+               //Set one
+               if(v1 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               opt_args.hwinitpcrs |= (1 << v1);
+            } else if(sscanf(pch, "%u-%u", &v1, &v2) == 2) {
+               //Set range
+               if(v1 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               if(v2 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               if(v2 < v1) {
+                  unsigned tp = v1;
+                  v1 = v2;
+                  v2 = tp;
+               }
+               for(unsigned int i = v1; i <= v2; ++i) {
+                  opt_args.hwinitpcrs |= (1 << i);
+               }
+            } else {
+               error("hwintipcr error: Invalid PCR specification : %s", pch);
+               return -1;
+            }
+            pch = strtok(NULL, ",");
+         }
+      }
+      else {
+	 error("Invalid command line option `%s'", argv[i]);
+      }
+
+   }
+
+   /* Check Errors and print results */
+   switch(opt_args.startup) {
+      case ST_CLEAR:
+	 info("Startup mode is `clear'");
+	 break;
+      case ST_SAVE:
+	 info("Startup mode is `save'");
+	 break;
+      case ST_DEACTIVATED:
+	 info("Startup mode is `deactivated'");
+	 break;
+      default:
+	 error("Invalid startup mode %d", opt_args.startup);
+	 return -1;
+   }
+
+   if(opt_args.hwinitpcrs & (VTPM_PCRALL))
+   {
+      char pcrstr[1024];
+      char* ptr = pcrstr;
+
+      pcrstr[0] = '\0';
+      info("The following PCRs will be initialized with values from the hardware TPM:");
+      for(unsigned int i = 0; i < TPM_NUM_PCR; ++i) {
+         if(opt_args.hwinitpcrs & (1 << i)) {
+            ptr += sprintf(ptr, "%u, ", i);
+         }
+      }
+      /* get rid of the last comma if any numbers were printed */
+      *(ptr -2) = '\0';
+
+      info("\t%s", pcrstr);
+   } else {
+      info("All PCRs initialized to default values");
+   }
+
+   if(!opt_args.enable_maint_cmds) {
+      info("TPM Maintenance Commands disabled");
+      badords[n_badords++] = TPM_ORD_CreateMaintenanceArchive;
+      badords[n_badords++] = TPM_ORD_LoadMaintenanceArchive;
+      badords[n_badords++] = TPM_ORD_KillMaintenanceFeature;
+      badords[n_badords++] = TPM_ORD_LoadManuMaintPub;
+      badords[n_badords++] = TPM_ORD_ReadManuMaintPub;
+   } else {
+      info("TPM Maintenance Commands enabled");
+   }
+
+   info("Log level set to %s", logstr);
+
+   return 0;
+}
+
+void cleanup_opt_args(void) {
+}
+
+int main(int argc, char **argv)
+{
+   //FIXME: initializing blkfront without this sleep causes the domain to crash on boot
+   sleep(2);
+
+   /* Setup extern function pointers */
+   tpm_extern_init = vtpm_extern_init_fake;
+   tpm_extern_release = vtpm_extern_release_fake;
+   tpm_malloc = malloc;
+   tpm_free = free;
+   tpm_log = vtpm_log;
+   tpm_get_ticks = vtpm_get_ticks;
+   tpm_get_extern_random_bytes = vtpm_get_extern_random_bytes;
+   tpm_write_to_storage = vtpm_write_to_file;
+   tpm_read_from_storage = vtpm_read_from_file;
+
+   info("starting TPM Emulator (1.2.%d.%d-%d)", VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD);
+   if(parse_cmd_line(argc, argv)) {
+      error("Error parsing commandline\n");
+      return -1;
+   }
+
+   /* Initialize devices */
+   init_tpmback();
+   if((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
+      error("Unable to initialize tpmfront device");
+      goto abort_posttpmfront;
+   }
+
+   /* Seed the RNG with entropy from hardware TPM */
+   if(init_random()) {
+      error("Unable to initialize RNG");
+      goto abort_postrng;
+   }
+
+   /* Initialize blkfront device */
+   if(init_vtpmblk(tpmfront_dev)) {
+      error("Unable to initialize Blkfront persistent storage");
+      goto abort_postvtpmblk;
+   }
+
+   /* Run main loop */
+   main_loop();
+
+   /* Shutdown blkfront */
+   shutdown_vtpmblk();
+abort_postvtpmblk:
+abort_postrng:
+
+   /* Close devices */
+   shutdown_tpmfront(tpmfront_dev);
+abort_posttpmfront:
+   shutdown_tpmback();
+
+   cleanup_opt_args();
+
+   return 0;
+}
diff --git a/stubdom/vtpm/vtpm.h b/stubdom/vtpm/vtpm.h
new file mode 100644
index 0000000..5919e44
--- /dev/null
+++ b/stubdom/vtpm/vtpm.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef VTPM_H
+#define VTPM_H
+
+#include <stdbool.h>
+
+/* For testing */
+#define VERS_CMD "\x00\xC1\x00\x00\x00\x16\x00\x00\x00\x65\x00\x00\x00\x05\x00\x00\x00\x04\x00\x00\x01\x03"
+#define VERS_CMD_LEN 22
+
+/* Global commandline options */
+struct Opt_args {
+   enum StartUp {
+      ST_CLEAR = 1,
+      ST_SAVE = 2,
+      ST_DEACTIVATED = 3
+   } startup;
+   unsigned long hwinitpcrs;
+   int loglevel;
+   uint32_t tpmconf;
+   bool enable_maint_cmds;
+};
+extern struct Opt_args opt_args;
+
+#endif
diff --git a/stubdom/vtpm/vtpm_cmd.c b/stubdom/vtpm/vtpm_cmd.c
new file mode 100644
index 0000000..7eae98b
--- /dev/null
+++ b/stubdom/vtpm/vtpm_cmd.c
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <types.h>
+#include <xen/xen.h>
+#include <mm.h>
+#include <gnttab.h>
+#include "tpm/tpm_marshalling.h"
+#include "vtpm_manager.h"
+#include "vtpm_cmd.h"
+#include <tpmback.h>
+
+#define TRYFAILGOTO(C) \
+   if((C)) { \
+      status = TPM_FAIL; \
+      goto abort_egress; \
+   }
+#define TRYFAILGOTOMSG(C, msg) \
+   if((C)) { \
+      status = TPM_FAIL; \
+      error(msg); \
+      goto abort_egress; \
+   }
+#define CHECKSTATUSGOTO(ret, fname) \
+   if((ret) != TPM_SUCCESS) { \
+      error("%s failed with error code (%lu)", fname, (unsigned long) ret); \
+      status = ord; \
+      goto abort_egress; \
+   }
+
+#define ERR_MALFORMED "Malformed response from backend"
+#define ERR_TPMFRONT "Error sending command through frontend device"
+
+struct shpage {
+   void* page;
+   grant_ref_t grantref;
+};
+
+typedef struct shpage shpage_t;
+
+static inline int pack_header(uint8_t** bptr, UINT32* len, TPM_TAG tag, UINT32 size, TPM_COMMAND_CODE ord)
+{
+   return *bptr == NULL ||
+	 tpm_marshal_UINT16(bptr, len, tag) ||
+	 tpm_marshal_UINT32(bptr, len, size) ||
+	 tpm_marshal_UINT32(bptr, len, ord);
+}
+
+static inline int unpack_header(uint8_t** bptr, UINT32* len, TPM_TAG* tag, UINT32* size, TPM_COMMAND_CODE* ord)
+{
+   return *bptr == NULL ||
+	 tpm_unmarshal_UINT16(bptr, len, tag) ||
+	 tpm_unmarshal_UINT32(bptr, len, size) ||
+	 tpm_unmarshal_UINT32(bptr, len, ord);
+}
+
+int create_error_response(tpmcmd_t* tpmcmd, TPM_RESULT errorcode)
+{
+   TPM_TAG tag;
+   UINT32 len = tpmcmd->req_len;
+   uint8_t* respptr;
+   uint8_t* cmdptr = tpmcmd->req;
+
+   if(!tpm_unmarshal_UINT16(&cmdptr, &len, &tag)) {
+      switch (tag) {
+         case TPM_TAG_RQU_COMMAND:
+            tag = TPM_TAG_RSP_COMMAND;
+            break;
+         case TPM_TAG_RQU_AUTH1_COMMAND:
+            tag = TPM_TAG_RQU_AUTH2_COMMAND;
+            break;
+         case TPM_TAG_RQU_AUTH2_COMMAND:
+            tag = TPM_TAG_RQU_AUTH2_COMMAND;
+            break;
+      }
+   } else {
+      tag = TPM_TAG_RSP_COMMAND;
+   }
+
+   tpmcmd->resp_len = len = 10;
+   tpmcmd->resp = respptr = tpm_malloc(tpmcmd->resp_len);
+
+   return pack_header(&respptr, &len, tag, len, errorcode);
+}
+
+TPM_RESULT VTPM_GetRandom(struct tpmfront_dev* tpmfront_dev, BYTE* bytes, UINT32 *numbytes) {
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* cmdbuf, *resp, *bptr;
+   size_t resplen = 0;
+   UINT32 len;
+
+   /*Ask the real tpm for random bytes for the seed */
+   TPM_TAG tag = TPM_TAG_RQU_COMMAND;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = TPM_ORD_GetRandom;
+   len = size = sizeof(TPM_TAG) + sizeof(UINT32) + sizeof(TPM_COMMAND_CODE) + sizeof(UINT32);
+
+   /*Create the raw tpm command */
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   TRYFAILGOTO(tpm_marshal_UINT32(&bptr, &len, *numbytes));
+
+   /* Send cmd, wait for response */
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen),
+      ERR_TPMFRONT);
+
+   bptr = resp; len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   //Check return status of command
+   CHECKSTATUSGOTO(ord, "TPM_GetRandom()");
+
+   // Get the number of random bytes in the response
+   TRYFAILGOTOMSG(tpm_unmarshal_UINT32(&bptr, &len, &size), ERR_MALFORMED);
+   *numbytes = size;
+
+   //Get the random bytes out, tpm may give us less bytes than what we wanrt
+   TRYFAILGOTOMSG(tpm_unmarshal_BYTE_ARRAY(&bptr, &len, bytes, *numbytes), ERR_MALFORMED);
+
+   goto egress;
+abort_egress:
+egress:
+   free(cmdbuf);
+   return status;
+
+}
+
+TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* bptr, *resp;
+   uint8_t* cmdbuf = NULL;
+   size_t resplen = 0;
+   UINT32 len;
+
+   TPM_TAG tag = VTPM_TAG_REQ;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = VTPM_ORD_LOADHASHKEY;
+
+   /*Create the command*/
+   len = size = VTPM_COMMAND_HEADER_SIZE;
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+
+   /* Send the command to vtpm_manager */
+   info("Requesting Encryption key from backend");
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   /* Unpack response header */
+   bptr = resp;
+   len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   /* Check return code */
+   CHECKSTATUSGOTO(ord, "VTPM_LoadHashKey()");
+
+   /* Get the size of the key */
+   *data_length = size - VTPM_COMMAND_HEADER_SIZE;
+
+   /* Copy the key bits */
+   *data = malloc(*data_length);
+   memcpy(*data, bptr, *data_length);
+
+   goto egress;
+abort_egress:
+   error("VTPM_LoadHashKey failed");
+egress:
+   free(cmdbuf);
+   return status;
+}
+
+TPM_RESULT VTPM_SaveHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* bptr, *resp;
+   uint8_t* cmdbuf = NULL;
+   size_t resplen = 0;
+   UINT32 len;
+
+   TPM_TAG tag = VTPM_TAG_REQ;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = VTPM_ORD_SAVEHASHKEY;
+
+   /*Create the command*/
+   len = size = VTPM_COMMAND_HEADER_SIZE + data_length;
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   memcpy(bptr, data, data_length);
+   bptr += data_length;
+
+   /* Send the command to vtpm_manager */
+   info("Sending encryption key to backend");
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   /* Unpack response header */
+   bptr = resp;
+   len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   /* Check return code */
+   CHECKSTATUSGOTO(ord, "VTPM_SaveHashKey()");
+
+   goto egress;
+abort_egress:
+   error("VTPM_SaveHashKey failed");
+egress:
+   free(cmdbuf);
+   return status;
+}
+
+TPM_RESULT VTPM_PCRRead(struct tpmfront_dev* tpmfront_dev, UINT32 pcrIndex, BYTE* outDigest)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t *cmdbuf, *resp, *bptr;
+   size_t resplen = 0;
+   UINT32 len;
+
+   /*Just send a TPM_PCRRead Command to the HW tpm */
+   TPM_TAG tag = TPM_TAG_RQU_COMMAND;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = TPM_ORD_PCRRead;
+   len = size = sizeof(TPM_TAG) + sizeof(UINT32) + sizeof(TPM_COMMAND_CODE) + sizeof(UINT32);
+
+   /*Create the raw tpm cmd */
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   TRYFAILGOTO(tpm_marshal_UINT32(&bptr, &len, pcrIndex));
+
+   /*Send Cmd wait for response */
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   bptr = resp; len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   //Check return status of command
+   CHECKSTATUSGOTO(ord, "TPM_PCRRead");
+
+   //Get the ptr value
+   memcpy(outDigest, bptr, sizeof(TPM_PCRVALUE));
+
+   goto egress;
+abort_egress:
+egress:
+   free(cmdbuf);
+   return status;
+
+}
diff --git a/stubdom/vtpm/vtpm_cmd.h b/stubdom/vtpm/vtpm_cmd.h
new file mode 100644
index 0000000..b0bfa22
--- /dev/null
+++ b/stubdom/vtpm/vtpm_cmd.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef MANAGER_H
+#define MANAGER_H
+
+#include <tpmfront.h>
+#include <tpmback.h>
+#include "tpm/tpm_structures.h"
+
+/* Create a command response error header */
+int create_error_response(tpmcmd_t* tpmcmd, TPM_RESULT errorcode);
+/* Request random bytes from hardware tpm, returns 0 on success */
+TPM_RESULT VTPM_GetRandom(struct tpmfront_dev* tpmfront_dev, BYTE* bytes, UINT32* numbytes);
+/* Retreive 256 bit AES encryption key from manager */
+TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length);
+/* Manager securely saves our 256 bit AES encryption key */
+TPM_RESULT VTPM_SaveHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length);
+/* Send a TPM_PCRRead command passthrough the manager to the hw tpm */
+TPM_RESULT VTPM_PCRRead(struct tpmfront_dev* tpmfront_dev, UINT32 pcrIndex, BYTE* outDigest);
+
+#endif
diff --git a/stubdom/vtpm/vtpm_pcrs.c b/stubdom/vtpm/vtpm_pcrs.c
new file mode 100644
index 0000000..22a6cef
--- /dev/null
+++ b/stubdom/vtpm/vtpm_pcrs.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include "vtpm_pcrs.h"
+#include "vtpm_cmd.h"
+#include "tpm/tpm_data.h"
+
+#define PCR_VALUE      tpmData.permanent.data.pcrValue
+
+static int write_pcr_direct(unsigned int pcrIndex, uint8_t* val) {
+   if(pcrIndex > TPM_NUM_PCR) {
+      return TPM_BADINDEX;
+   }
+   memcpy(&PCR_VALUE[pcrIndex], val, sizeof(TPM_PCRVALUE));
+   return TPM_SUCCESS;
+}
+
+TPM_RESULT vtpm_initialize_hw_pcrs(struct tpmfront_dev* tpmfront_dev, unsigned long pcrs)
+{
+   TPM_RESULT rc = TPM_SUCCESS;
+   uint8_t digest[sizeof(TPM_PCRVALUE)];
+
+   for(unsigned int i = 0; i < TPM_NUM_PCR; ++i) {
+      if(pcrs & 1 << i) {
+         if((rc = VTPM_PCRRead(tpmfront_dev, i, digest)) != TPM_SUCCESS) {
+            error("TPM_PCRRead failed with error : %d", rc);
+            return rc;
+         }
+         write_pcr_direct(i, digest);
+      }
+   }
+
+   return rc;
+}
diff --git a/stubdom/vtpm/vtpm_pcrs.h b/stubdom/vtpm/vtpm_pcrs.h
new file mode 100644
index 0000000..11835f9
--- /dev/null
+++ b/stubdom/vtpm/vtpm_pcrs.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef VTPM_PCRS_H
+#define VTPM_PCRS_H
+
+#include "tpm/tpm_structures.h"
+
+#define VTPM_PCR0 1
+#define VTPM_PCR1 1 << 1
+#define VTPM_PCR2 1 << 2
+#define VTPM_PCR3 1 << 3
+#define VTPM_PCR4 1 << 4
+#define VTPM_PCR5 1 << 5
+#define VTPM_PCR6 1 << 6
+#define VTPM_PCR7 1 << 7
+#define VTPM_PCR8 1 << 8
+#define VTPM_PCR9 1 << 9
+#define VTPM_PCR10 1 << 10
+#define VTPM_PCR11 1 << 11
+#define VTPM_PCR12 1 << 12
+#define VTPM_PCR13 1 << 13
+#define VTPM_PCR14 1 << 14
+#define VTPM_PCR15 1 << 15
+#define VTPM_PCR16 1 << 16
+#define VTPM_PCR17 1 << 17
+#define VTPM_PCR18 1 << 18
+#define VTPM_PCR19 1 << 19
+#define VTPM_PCR20 1 << 20
+#define VTPM_PCR21 1 << 21
+#define VTPM_PCR22 1 << 22
+#define VTPM_PCR23 1 << 23
+
+#define VTPM_PCRALL (1 << TPM_NUM_PCR) - 1
+#define VTPM_PCRNONE 0
+
+#define VTPM_NUMPCRS 24
+
+struct tpmfront_dev;
+
+TPM_RESULT vtpm_initialize_hw_pcrs(struct tpmfront_dev* tpmfront_dev, unsigned long pcrs);
+
+
+#endif
diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
new file mode 100644
index 0000000..b343bd8
--- /dev/null
+++ b/stubdom/vtpm/vtpmblk.c
@@ -0,0 +1,307 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <mini-os/byteorder.h>
+#include "vtpmblk.h"
+#include "tpm/tpm_marshalling.h"
+#include "vtpm_cmd.h"
+#include "polarssl/aes.h"
+#include "polarssl/sha1.h"
+#include <blkfront.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+
+/*Encryption key and block sizes */
+#define BLKSZ 16
+
+static struct blkfront_dev* blkdev = NULL;
+static int blkfront_fd = -1;
+
+int init_vtpmblk(struct tpmfront_dev* tpmfront_dev)
+{
+   struct blkfront_info blkinfo;
+   info("Initializing persistent NVM storage\n");
+
+   if((blkdev = init_blkfront(NULL, &blkinfo)) == NULL) {
+      error("BLKIO: ERROR Unable to initialize blkfront");
+      return -1;
+   }
+   if (blkinfo.info & VDISK_READONLY || blkinfo.mode != O_RDWR) {
+      error("BLKIO: ERROR block device is read only!");
+      goto error;
+   }
+   if((blkfront_fd = blkfront_open(blkdev)) == -1) {
+      error("Unable to open blkfront file descriptor!");
+      goto error;
+   }
+
+   return 0;
+error:
+   shutdown_blkfront(blkdev);
+   blkdev = NULL;
+   return -1;
+}
+
+void shutdown_vtpmblk(void)
+{
+   close(blkfront_fd);
+   blkfront_fd = -1;
+   blkdev = NULL;
+}
+
+int write_vtpmblk_raw(uint8_t *data, size_t data_length)
+{
+   int rc;
+   uint32_t lenbuf;
+   debug("Begin Write data=%p len=%u", data, data_length);
+
+   lenbuf = cpu_to_be32((uint32_t)data_length);
+
+   lseek(blkfront_fd, 0, SEEK_SET);
+   if((rc = write(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
+      error("write(length) failed! error was %s", strerror(errno));
+      return -1;
+   }
+   if((rc = write(blkfront_fd, data, data_length)) != data_length) {
+      error("write(data) failed! error was %s", strerror(errno));
+      return -1;
+   }
+
+   info("Wrote %u bytes to NVM persistent storage", data_length);
+
+   return 0;
+}
+
+int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
+{
+   int rc;
+   uint32_t lenbuf;
+
+   lseek(blkfront_fd, 0, SEEK_SET);
+   if(( rc = read(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
+      error("read(length) failed! error was %s", strerror(errno));
+      return -1;
+   }
+   *data_length = (size_t) cpu_to_be32(lenbuf);
+   if(*data_length == 0) {
+      error("read 0 data_length for NVM");
+      return -1;
+   }
+
+   *data = tpm_malloc(*data_length);
+   if((rc = read(blkfront_fd, *data, *data_length)) != *data_length) {
+      error("read(data) failed! error was %s", strerror(errno));
+      return -1;
+   }
+
+   info("Read %u bytes from NVM persistent storage", *data_length);
+   return 0;
+}
+
+int encrypt_vtpmblk(uint8_t* clear, size_t clear_len, uint8_t** cipher, size_t* cipher_len, uint8_t* symkey)
+{
+   int rc = 0;
+   uint8_t iv[BLKSZ];
+   aes_context aes_ctx;
+   UINT32 temp;
+   int mod;
+
+   uint8_t* clbuf = NULL;
+
+   uint8_t* ivptr;
+   int ivlen;
+
+   uint8_t* cptr;	//Cipher block pointer
+   int clen;	//Cipher block length
+
+   /*Create a new 256 bit encryption key */
+   if(symkey == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+   tpm_get_extern_random_bytes(symkey, NVMKEYSZ);
+
+   /*Setup initialization vector - random bits and then 4 bytes clear text size at the end*/
+   temp = sizeof(UINT32);
+   ivlen = BLKSZ - temp;
+   tpm_get_extern_random_bytes(iv, ivlen);
+   ivptr = iv + ivlen;
+   tpm_marshal_UINT32(&ivptr, &temp, (UINT32) clear_len);
+
+   /*The clear text needs to be padded out to a multiple of BLKSZ */
+   mod = clear_len % BLKSZ;
+   clen = mod ? clear_len + BLKSZ - mod : clear_len;
+   clbuf = malloc(clen);
+   if (clbuf == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+   memcpy(clbuf, clear, clear_len);
+   /* zero out the padding bits - FIXME: better / more secure way to handle these? */
+   if(clen - clear_len) {
+      memset(clbuf + clear_len, 0, clen - clear_len);
+   }
+
+   /* Setup the ciphertext buffer */
+   *cipher_len = BLKSZ + clen;		/*iv + ciphertext */
+   cptr = *cipher = malloc(*cipher_len);
+   if (*cipher == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Copy the IV to cipher text blob*/
+   memcpy(cptr, iv, BLKSZ);
+   cptr += BLKSZ;
+
+   /* Setup encryption */
+   aes_setkey_enc(&aes_ctx, symkey, 256);
+
+   /* Do encryption now */
+   aes_crypt_cbc(&aes_ctx, AES_ENCRYPT, clen, iv, clbuf, cptr);
+
+   goto egress;
+abort_egress:
+egress:
+   free(clbuf);
+   return rc;
+}
+int decrypt_vtpmblk(uint8_t* cipher, size_t cipher_len, uint8_t** clear, size_t* clear_len, uint8_t* symkey)
+{
+   int rc = 0;
+   uint8_t iv[BLKSZ];
+   uint8_t* ivptr;
+   UINT32 u32, temp;
+   aes_context aes_ctx;
+
+   uint8_t* cptr = cipher;	//cipher block pointer
+   int clen = cipher_len;	//cipher block length
+
+   /* Pull out the initialization vector */
+   memcpy(iv, cipher, BLKSZ);
+   cptr += BLKSZ;
+   clen -= BLKSZ;
+
+   /* Setup the clear text buffer */
+   if((*clear = malloc(clen)) == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Get the length of clear text from last 4 bytes of iv */
+   temp = sizeof(UINT32);
+   ivptr = iv + BLKSZ - temp;
+   tpm_unmarshal_UINT32(&ivptr, &temp, &u32);
+   *clear_len = u32;
+
+   /* Setup decryption */
+   aes_setkey_dec(&aes_ctx, symkey, 256);
+
+   /* Do decryption now */
+   if ((clen % BLKSZ) != 0) {
+      error("Decryption Error: Cipher block size was not a multiple of %u", BLKSZ);
+      rc = -1;
+      goto abort_egress;
+   }
+   aes_crypt_cbc(&aes_ctx, AES_DECRYPT, clen, iv, cptr, *clear);
+
+   goto egress;
+abort_egress:
+egress:
+   return rc;
+}
+
+int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length) {
+   int rc;
+   uint8_t* cipher = NULL;
+   size_t cipher_len = 0;
+   uint8_t hashkey[HASHKEYSZ];
+   uint8_t* symkey = hashkey + HASHSZ;
+
+   /* Encrypt the data */
+   if((rc = encrypt_vtpmblk(data, data_length, &cipher, &cipher_len, symkey))) {
+      goto abort_egress;
+   }
+   /* Write to disk */
+   if((rc = write_vtpmblk_raw(cipher, cipher_len))) {
+      goto abort_egress;
+   }
+   /* Get sha1 hash of data */
+   sha1(cipher, cipher_len, hashkey);
+
+   /* Send hash and key to manager */
+   if((rc = VTPM_SaveHashKey(tpmfront_dev, hashkey, HASHKEYSZ)) != TPM_SUCCESS) {
+      goto abort_egress;
+   }
+   goto egress;
+abort_egress:
+egress:
+   free(cipher);
+   return rc;
+}
+
+int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data_length) {
+   int rc;
+   uint8_t* cipher = NULL;
+   size_t cipher_len = 0;
+   size_t keysize;
+   uint8_t* hashkey = NULL;
+   uint8_t hash[HASHSZ];
+   uint8_t* symkey;
+
+   /* Retreive the hash and the key from the manager */
+   if((rc = VTPM_LoadHashKey(tpmfront_dev, &hashkey, &keysize)) != TPM_SUCCESS) {
+      goto abort_egress;
+   }
+   if(keysize != HASHKEYSZ) {
+      error("Manager returned a hashkey of invalid size! expected %d, actual %d", NVMKEYSZ, keysize);
+      rc = -1;
+      goto abort_egress;
+   }
+   symkey = hashkey + HASHSZ;
+
+   /* Read from disk now */
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len))) {
+      goto abort_egress;
+   }
+
+   /* Compute the hash of the cipher text and compare */
+   sha1(cipher, cipher_len, hash);
+   if(memcmp(hash, hashkey, HASHSZ)) {
+      int i;
+      error("NVM Storage Checksum failed!");
+      printf("Expected: ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hashkey[i]);
+      }
+      printf("\n");
+      printf("Actual:   ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hash[i]);
+      }
+      printf("\n");
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Decrypt the blob */
+   if((rc = decrypt_vtpmblk(cipher, cipher_len, data, data_length, symkey))) {
+      goto abort_egress;
+   }
+   goto egress;
+abort_egress:
+egress:
+   free(cipher);
+   free(hashkey);
+   return rc;
+}
diff --git a/stubdom/vtpm/vtpmblk.h b/stubdom/vtpm/vtpmblk.h
new file mode 100644
index 0000000..282ce6a
--- /dev/null
+++ b/stubdom/vtpm/vtpmblk.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef NVM_H
+#define NVM_H
+#include <mini-os/types.h>
+#include <xen/xen.h>
+#include <tpmfront.h>
+
+#define NVMKEYSZ 32
+#define HASHSZ 20
+#define HASHKEYSZ (NVMKEYSZ + HASHSZ)
+
+int init_vtpmblk(struct tpmfront_dev* tpmfront_dev);
+void shutdown_vtpmblk(void);
+
+/* Encrypts and writes data to blk device */
+int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t *data, size_t data_length);
+/* Reads, Decrypts, and returns data from blk device */
+int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t **data, size_t *data_length);
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:17:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:17:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1CK-0001MS-0R; Thu, 15 Nov 2012 15:17:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1CI-0001Lh-1Q
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:17:42 +0000
Received: from [85.158.137.99:10385] by server-5.bemta-3.messagelabs.com id
	89/8A-26311-59705A05; Thu, 15 Nov 2012 15:17:41 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-15.tower-217.messagelabs.com!1352992655!16901189!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_23,UNPARSEABLE_RELAY,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27753 invoked from network); 15 Nov 2012 15:17:36 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-15.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 15:17:36 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187341;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:06 -0500
Message-Id: <1352992629-5850-8-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 07/10] Regenerate configure script after
	removing vtpm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 tools/configure |  603 ++++++++++++++++++++++++++++---------------------------
 1 file changed, 302 insertions(+), 301 deletions(-)

diff --git a/tools/configure b/tools/configure
index edf42f6..ed20d12 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1,13 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for Xen Hypervisor 4.3.
+# Generated by GNU Autoconf 2.69 for Xen Hypervisor 4.3.
 #
 # Report bugs to <xen-devel@lists.xen.org>.
 #
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -91,6 +89,7 @@ fi
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -135,6 +134,31 @@ export LANGUAGE
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
@@ -168,7 +192,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -213,14 +238,25 @@ IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-	# neutralization value for shells without unset; and this also
-	# works around shells that cannot unset nonexistent variables.
-	BASH_ENV=/dev/null
-	ENV=/dev/null
-	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-	export CONFIG_SHELL
-	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
 fi
 
     if test x$as_have_required = xno; then :
@@ -323,6 +359,14 @@ $as_echo X"$as_dir" |
 
 
 } # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -444,6 +488,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -478,16 +526,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -499,28 +547,8 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -668,7 +696,6 @@ lomount
 miniterm
 ocamltools
 xenapi
-vtpm
 monitors
 githttp
 host_os
@@ -722,7 +749,6 @@ ac_user_opts='
 enable_option_checking
 enable_githttp
 enable_monitors
-enable_vtpm
 enable_xenapi
 enable_ocamltools
 enable_miniterm
@@ -1166,7 +1192,7 @@ Try \`$0 --help' for more information"
     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
   esac
@@ -1217,8 +1243,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1381,8 +1405,6 @@ Optional Features:
                           DISABLED)
   --disable-monitors      Disable xenstat and xentop monitoring tools (default
                           is ENABLED)
-  --enable-vtpm           Enable Virtual Trusted Platform Module (default is
-                          DISABLED)
   --enable-xenapi         Enable Xen API Bindings (default is DISABLED)
   --disable-ocamltools    Disable Ocaml tools (default is ENABLED)
   --enable-miniterm       Enable miniterm (default is DISABLED)
@@ -1495,9 +1517,9 @@ test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
 Xen Hypervisor configure 4.3
-generated by GNU Autoconf 2.67
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1541,7 +1563,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_compile
@@ -1578,7 +1600,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
     ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_cpp
@@ -1591,10 +1613,10 @@ fi
 ac_fn_c_check_header_mongrel ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval "test \"\${$3+set}\"" = set; then :
+  if eval \${$3+:} false; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
@@ -1661,7 +1683,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
@@ -1670,7 +1692,7 @@ eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_mongrel
 
@@ -1711,7 +1733,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
        ac_retval=$ac_status
 fi
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_run
@@ -1725,7 +1747,7 @@ ac_fn_c_check_header_compile ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1743,7 +1765,7 @@ fi
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_compile
 
@@ -1774,7 +1796,7 @@ $as_echo "$ac_try_echo"; } >&5
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
 	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
+	 test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -1788,7 +1810,7 @@ fi
   # interfere with the next link command; also delete a directory that is
   # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
@@ -1797,7 +1819,7 @@ This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by Xen Hypervisor $as_me 4.3, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -2055,7 +2077,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;}
       || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
@@ -2199,7 +2221,7 @@ $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
 $as_echo_n "checking build system type... " >&6; }
-if test "${ac_cv_build+set}" = set; then :
+if ${ac_cv_build+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
@@ -2215,7 +2237,7 @@ fi
 $as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
 esac
 build=$ac_cv_build
 ac_save_IFS=$IFS; IFS='-'
@@ -2233,7 +2255,7 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
 $as_echo_n "checking host system type... " >&6; }
-if test "${ac_cv_host+set}" = set; then :
+if ${ac_cv_host+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
@@ -2248,7 +2270,7 @@ fi
 $as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
 esac
 host=$ac_cv_host
 ac_save_IFS=$IFS; IFS='-'
@@ -2445,29 +2467,6 @@ monitors=$ax_cv_monitors
 
 
 
-# Check whether --enable-vtpm was given.
-if test "${enable_vtpm+set}" = set; then :
-  enableval=$enable_vtpm;
-fi
-
-
-if test "x$enable_vtpm" = "xno"; then :
-
-    ax_cv_vtpm="n"
-
-elif test "x$enable_vtpm" = "xyes"; then :
-
-    ax_cv_vtpm="y"
-
-elif test -z $ax_cv_vtpm; then :
-
-    ax_cv_vtpm="n"
-
-fi
-vtpm=$ax_cv_vtpm
-
-
-
 # Check whether --enable-xenapi was given.
 if test "${enable_xenapi+set}" = set; then :
   enableval=$enable_xenapi;
@@ -2700,7 +2699,7 @@ if test -n "$ac_tool_prefix"; then
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2712,7 +2711,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2740,7 +2739,7 @@ if test -z "$ac_cv_prog_CC"; then
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2752,7 +2751,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2793,7 +2792,7 @@ if test -z "$CC"; then
 set dummy ${ac_tool_prefix}cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2805,7 +2804,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2833,7 +2832,7 @@ if test -z "$CC"; then
 set dummy cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2846,7 +2845,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -2892,7 +2891,7 @@ if test -z "$CC"; then
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2904,7 +2903,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2936,7 +2935,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2948,7 +2947,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2991,7 +2990,7 @@ fi
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -3106,7 +3105,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
@@ -3149,7 +3148,7 @@ else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -3208,7 +3207,7 @@ $as_echo "$ac_try_echo"; } >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
     fi
   fi
 fi
@@ -3219,7 +3218,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
 ac_clean_files=$ac_clean_files_save
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then :
+if ${ac_cv_objext+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3260,7 +3259,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
@@ -3270,7 +3269,7 @@ OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3307,7 +3306,7 @@ ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -3385,7 +3384,7 @@ else
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -3394,8 +3393,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -3484,7 +3482,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -3528,7 +3526,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then :
+if ${ac_cv_path_install+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3548,7 +3546,7 @@ case $as_dir/ in #((
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
 	  if test $ac_prog = install &&
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
@@ -3608,7 +3606,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 set dummy bison; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_BISON+set}" = set; then :
+if ${ac_cv_path_BISON+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $BISON in
@@ -3622,7 +3620,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_BISON="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3648,7 +3646,7 @@ fi
 set dummy flex; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_FLEX+set}" = set; then :
+if ${ac_cv_path_FLEX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $FLEX in
@@ -3662,7 +3660,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_FLEX="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3688,7 +3686,7 @@ fi
 set dummy perl; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PERL+set}" = set; then :
+if ${ac_cv_path_PERL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PERL in
@@ -3702,7 +3700,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3735,7 +3733,7 @@ if test "x$xapi" = "xy"; then :
 set dummy curl-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CURL+set}" = set; then :
+if ${ac_cv_path_CURL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $CURL in
@@ -3749,7 +3747,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_CURL="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3780,7 +3778,7 @@ fi
 set dummy xml2-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_XML+set}" = set; then :
+if ${ac_cv_path_XML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $XML in
@@ -3794,7 +3792,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_XML="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3831,7 +3829,7 @@ if test "x$ocamltools" = "xy"; then :
 set dummy ${ac_tool_prefix}ocamlc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLC+set}" = set; then :
+if ${ac_cv_prog_OCAMLC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLC"; then
@@ -3843,7 +3841,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLC="${ac_tool_prefix}ocamlc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3871,7 +3869,7 @@ if test -z "$ac_cv_prog_OCAMLC"; then
 set dummy ocamlc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLC"; then
@@ -3883,7 +3881,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLC="ocamlc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3942,7 +3940,7 @@ $as_echo "OCaml library path is $OCAMLLIB" >&6; }
 set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLOPT+set}" = set; then :
+if ${ac_cv_prog_OCAMLOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLOPT"; then
@@ -3954,7 +3952,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLOPT="${ac_tool_prefix}ocamlopt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3982,7 +3980,7 @@ if test -z "$ac_cv_prog_OCAMLOPT"; then
 set dummy ocamlopt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLOPT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLOPT"; then
@@ -3994,7 +3992,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLOPT="ocamlopt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4052,7 +4050,7 @@ $as_echo "versions differs from ocamlc; ocamlopt discarded." >&6; }
 set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLCDOTOPT+set}" = set; then :
+if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLCDOTOPT"; then
@@ -4064,7 +4062,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLCDOTOPT="${ac_tool_prefix}ocamlc.opt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4092,7 +4090,7 @@ if test -z "$ac_cv_prog_OCAMLCDOTOPT"; then
 set dummy ocamlc.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLCDOTOPT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLCDOTOPT"; then
@@ -4104,7 +4102,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLCDOTOPT="ocamlc.opt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4156,7 +4154,7 @@ $as_echo "versions differs from ocamlc; ocamlc.opt discarded." >&6; }
 set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLOPTDOTOPT+set}" = set; then :
+if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLOPTDOTOPT"; then
@@ -4168,7 +4166,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLOPTDOTOPT="${ac_tool_prefix}ocamlopt.opt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4196,7 +4194,7 @@ if test -z "$ac_cv_prog_OCAMLOPTDOTOPT"; then
 set dummy ocamlopt.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
@@ -4208,7 +4206,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="ocamlopt.opt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4265,7 +4263,7 @@ $as_echo "version differs from ocamlc; ocamlopt.opt discarded." >&6; }
 set dummy ${ac_tool_prefix}ocaml; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAML+set}" = set; then :
+if ${ac_cv_prog_OCAML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAML"; then
@@ -4277,7 +4275,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAML="${ac_tool_prefix}ocaml"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4305,7 +4303,7 @@ if test -z "$ac_cv_prog_OCAML"; then
 set dummy ocaml; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAML+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAML"; then
@@ -4317,7 +4315,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAML="ocaml"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4359,7 +4357,7 @@ fi
 set dummy ${ac_tool_prefix}ocamldep; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLDEP+set}" = set; then :
+if ${ac_cv_prog_OCAMLDEP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLDEP"; then
@@ -4371,7 +4369,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLDEP="${ac_tool_prefix}ocamldep"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4399,7 +4397,7 @@ if test -z "$ac_cv_prog_OCAMLDEP"; then
 set dummy ocamldep; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLDEP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLDEP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLDEP"; then
@@ -4411,7 +4409,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLDEP="ocamldep"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4453,7 +4451,7 @@ fi
 set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLMKTOP+set}" = set; then :
+if ${ac_cv_prog_OCAMLMKTOP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLMKTOP"; then
@@ -4465,7 +4463,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLMKTOP="${ac_tool_prefix}ocamlmktop"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4493,7 +4491,7 @@ if test -z "$ac_cv_prog_OCAMLMKTOP"; then
 set dummy ocamlmktop; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLMKTOP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLMKTOP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLMKTOP"; then
@@ -4505,7 +4503,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLMKTOP="ocamlmktop"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4547,7 +4545,7 @@ fi
 set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLMKLIB+set}" = set; then :
+if ${ac_cv_prog_OCAMLMKLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLMKLIB"; then
@@ -4559,7 +4557,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLMKLIB="${ac_tool_prefix}ocamlmklib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4587,7 +4585,7 @@ if test -z "$ac_cv_prog_OCAMLMKLIB"; then
 set dummy ocamlmklib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLMKLIB+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLMKLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLMKLIB"; then
@@ -4599,7 +4597,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLMKLIB="ocamlmklib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4641,7 +4639,7 @@ fi
 set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLDOC+set}" = set; then :
+if ${ac_cv_prog_OCAMLDOC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLDOC"; then
@@ -4653,7 +4651,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLDOC="${ac_tool_prefix}ocamldoc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4681,7 +4679,7 @@ if test -z "$ac_cv_prog_OCAMLDOC"; then
 set dummy ocamldoc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLDOC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLDOC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLDOC"; then
@@ -4693,7 +4691,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLDOC="ocamldoc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4735,7 +4733,7 @@ fi
 set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLBUILD+set}" = set; then :
+if ${ac_cv_prog_OCAMLBUILD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLBUILD"; then
@@ -4747,7 +4745,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLBUILD="${ac_tool_prefix}ocamlbuild"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4775,7 +4773,7 @@ if test -z "$ac_cv_prog_OCAMLBUILD"; then
 set dummy ocamlbuild; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLBUILD+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLBUILD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLBUILD"; then
@@ -4787,7 +4785,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLBUILD="ocamlbuild"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4838,7 +4836,7 @@ fi
 set dummy bash; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_BASH+set}" = set; then :
+if ${ac_cv_path_BASH+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $BASH in
@@ -4852,7 +4850,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_BASH="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4893,7 +4891,7 @@ fi
 set dummy $PYTHON; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PYTHONPATH+set}" = set; then :
+if ${ac_cv_path_PYTHONPATH+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PYTHONPATH in
@@ -4907,7 +4905,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PYTHONPATH="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4960,7 +4958,7 @@ if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then :
+  if ${ac_cv_prog_CPP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -5076,7 +5074,7 @@ else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -5088,7 +5086,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then :
+if ${ac_cv_path_GREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
@@ -5102,7 +5100,7 @@ do
     for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+      as_fn_executable_p "$ac_path_GREP" || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
@@ -5151,7 +5149,7 @@ $as_echo "$ac_cv_path_GREP" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then :
+if ${ac_cv_path_EGREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -5168,7 +5166,7 @@ do
     for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      as_fn_executable_p "$ac_path_EGREP" || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -5218,7 +5216,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
+if ${ac_cv_header_stdc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -5354,7 +5352,7 @@ ac_python_version=`$PYTHON -c 'import distutils.sysconfig; \
 set dummy $PYTHON-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_pyconfig+set}" = set; then :
+if ${ac_cv_path_pyconfig+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $pyconfig in
@@ -5368,7 +5366,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_pyconfig="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5417,7 +5415,7 @@ else
 fi
 
 ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default"
-if test "x$ac_cv_header_Python_h" = x""yes; then :
+if test "x$ac_cv_header_Python_h" = xyes; then :
 
 else
   as_fn_error $? "Unable to find Python development headers" "$LINENO" 5
@@ -5427,7 +5425,7 @@ fi
 as_ac_Lib=`$as_echo "ac_cv_lib_python$ac_python_version''_PyArg_ParseTuple" | $as_tr_sh`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PyArg_ParseTuple in -lpython$ac_python_version" >&5
 $as_echo_n "checking for PyArg_ParseTuple in -lpython$ac_python_version... " >&6; }
-if eval "test \"\${$as_ac_Lib+set}\"" = set; then :
+if eval \${$as_ac_Lib+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5480,7 +5478,7 @@ LDLFAGS=$ac_previous_ldflags
 set dummy xgettext; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_XGETTEXT+set}" = set; then :
+if ${ac_cv_path_XGETTEXT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $XGETTEXT in
@@ -5494,7 +5492,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5527,7 +5525,7 @@ i[3456]86|x86_64)
 set dummy as86; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_AS86+set}" = set; then :
+if ${ac_cv_path_AS86+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $AS86 in
@@ -5541,7 +5539,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_AS86="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5572,7 +5570,7 @@ fi
 set dummy ld86; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_LD86+set}" = set; then :
+if ${ac_cv_path_LD86+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $LD86 in
@@ -5586,7 +5584,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_LD86="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5617,7 +5615,7 @@ fi
 set dummy bcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_BCC+set}" = set; then :
+if ${ac_cv_path_BCC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $BCC in
@@ -5631,7 +5629,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_BCC="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5662,7 +5660,7 @@ fi
 set dummy iasl; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_IASL+set}" = set; then :
+if ${ac_cv_path_IASL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $IASL in
@@ -5676,7 +5674,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_IASL="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5707,11 +5705,11 @@ fi
 esac
 
 ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_uuid_h" = x""yes; then :
+if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5
 $as_echo_n "checking for uuid_clear in -luuid... " >&6; }
-if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then :
+if ${ac_cv_lib_uuid_uuid_clear+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5745,7 +5743,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_clear" >&5
 $as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; }
-if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then :
+if test "x$ac_cv_lib_uuid_uuid_clear" = xyes; then :
   libuuid="y"
 fi
 
@@ -5754,7 +5752,7 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_h" = x""yes; then :
+if test "x$ac_cv_header_uuid_h" = xyes; then :
   libuuid="y"
 fi
 
@@ -5767,11 +5765,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default"
-if test "x$ac_cv_header_curses_h" = x""yes; then :
+if test "x$ac_cv_header_curses_h" = xyes; then :
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clear in -lcurses" >&5
 $as_echo_n "checking for clear in -lcurses... " >&6; }
-if test "${ac_cv_lib_curses_clear+set}" = set; then :
+if ${ac_cv_lib_curses_clear+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5805,7 +5803,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_clear" >&5
 $as_echo "$ac_cv_lib_curses_clear" >&6; }
-if test "x$ac_cv_lib_curses_clear" = x""yes; then :
+if test "x$ac_cv_lib_curses_clear" = xyes; then :
   curses="y"
 else
   curses="n"
@@ -5818,11 +5816,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default"
-if test "x$ac_cv_header_ncurses_h" = x""yes; then :
+if test "x$ac_cv_header_ncurses_h" = xyes; then :
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clear in -lncurses" >&5
 $as_echo_n "checking for clear in -lncurses... " >&6; }
-if test "${ac_cv_lib_ncurses_clear+set}" = set; then :
+if ${ac_cv_lib_ncurses_clear+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5856,7 +5854,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_clear" >&5
 $as_echo "$ac_cv_lib_ncurses_clear" >&6; }
-if test "x$ac_cv_lib_ncurses_clear" = x""yes; then :
+if test "x$ac_cv_lib_ncurses_clear" = xyes; then :
   ncurses="y"
 else
   ncurses="n"
@@ -5903,7 +5901,7 @@ if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -5917,7 +5915,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5946,7 +5944,7 @@ if test -z "$ac_cv_path_PKG_CONFIG"; then
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $ac_pt_PKG_CONFIG in
@@ -5960,7 +5958,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6091,7 +6089,7 @@ and glib_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details.
 
 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 else
 	glib_CFLAGS=$pkg_cv_glib_CFLAGS
 	glib_LIBS=$pkg_cv_glib_LIBS
@@ -6104,7 +6102,7 @@ fi
 set dummy wget; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_WGET+set}" = set; then :
+if ${ac_cv_path_WGET+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $WGET in
@@ -6118,7 +6116,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6151,7 +6149,7 @@ else
 set dummy ftp; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_FTP+set}" = set; then :
+if ${ac_cv_path_FTP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $FTP in
@@ -6165,7 +6163,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_FTP="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6204,11 +6202,11 @@ fi
 
 # Checks for libraries.
 ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_bzlib_h" = x""yes; then :
+if test "x$ac_cv_header_bzlib_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzDecompressInit in -lbz2" >&5
 $as_echo_n "checking for BZ2_bzDecompressInit in -lbz2... " >&6; }
-if test "${ac_cv_lib_bz2_BZ2_bzDecompressInit+set}" = set; then :
+if ${ac_cv_lib_bz2_BZ2_bzDecompressInit+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6242,7 +6240,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzDecompressInit" >&5
 $as_echo "$ac_cv_lib_bz2_BZ2_bzDecompressInit" >&6; }
-if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = x""yes; then :
+if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = xyes; then :
   zlib="$zlib -DHAVE_BZLIB -lbz2"
 fi
 
@@ -6251,11 +6249,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default"
-if test "x$ac_cv_header_lzma_h" = x""yes; then :
+if test "x$ac_cv_header_lzma_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_stream_decoder in -llzma" >&5
 $as_echo_n "checking for lzma_stream_decoder in -llzma... " >&6; }
-if test "${ac_cv_lib_lzma_lzma_stream_decoder+set}" = set; then :
+if ${ac_cv_lib_lzma_lzma_stream_decoder+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6289,7 +6287,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_stream_decoder" >&5
 $as_echo "$ac_cv_lib_lzma_lzma_stream_decoder" >&6; }
-if test "x$ac_cv_lib_lzma_lzma_stream_decoder" = x""yes; then :
+if test "x$ac_cv_lib_lzma_lzma_stream_decoder" = xyes; then :
   zlib="$zlib -DHAVE_LZMA -llzma"
 fi
 
@@ -6298,11 +6296,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "lzo/lzo1x.h" "ac_cv_header_lzo_lzo1x_h" "$ac_includes_default"
-if test "x$ac_cv_header_lzo_lzo1x_h" = x""yes; then :
+if test "x$ac_cv_header_lzo_lzo1x_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzo1x_decompress in -llzo2" >&5
 $as_echo_n "checking for lzo1x_decompress in -llzo2... " >&6; }
-if test "${ac_cv_lib_lzo2_lzo1x_decompress+set}" = set; then :
+if ${ac_cv_lib_lzo2_lzo1x_decompress+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6336,7 +6334,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzo2_lzo1x_decompress" >&5
 $as_echo "$ac_cv_lib_lzo2_lzo1x_decompress" >&6; }
-if test "x$ac_cv_lib_lzo2_lzo1x_decompress" = x""yes; then :
+if test "x$ac_cv_lib_lzo2_lzo1x_decompress" = xyes; then :
   zlib="$zlib -DHAVE_LZO1X -llzo2"
 fi
 
@@ -6347,7 +6345,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for io_setup in -laio" >&5
 $as_echo_n "checking for io_setup in -laio... " >&6; }
-if test "${ac_cv_lib_aio_io_setup+set}" = set; then :
+if ${ac_cv_lib_aio_io_setup+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6381,7 +6379,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_aio_io_setup" >&5
 $as_echo "$ac_cv_lib_aio_io_setup" >&6; }
-if test "x$ac_cv_lib_aio_io_setup" = x""yes; then :
+if test "x$ac_cv_lib_aio_io_setup" = xyes; then :
   system_aio="y"
 else
   system_aio="n"
@@ -6390,7 +6388,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5 in -lcrypto" >&5
 $as_echo_n "checking for MD5 in -lcrypto... " >&6; }
-if test "${ac_cv_lib_crypto_MD5+set}" = set; then :
+if ${ac_cv_lib_crypto_MD5+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6424,7 +6422,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5" >&5
 $as_echo "$ac_cv_lib_crypto_MD5" >&6; }
-if test "x$ac_cv_lib_crypto_MD5" = x""yes; then :
+if test "x$ac_cv_lib_crypto_MD5" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBCRYPTO 1
 _ACEOF
@@ -6437,11 +6435,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "ext2fs/ext2fs.h" "ac_cv_header_ext2fs_ext2fs_h" "$ac_includes_default"
-if test "x$ac_cv_header_ext2fs_ext2fs_h" = x""yes; then :
+if test "x$ac_cv_header_ext2fs_ext2fs_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ext2fs_open2 in -lext2fs" >&5
 $as_echo_n "checking for ext2fs_open2 in -lext2fs... " >&6; }
-if test "${ac_cv_lib_ext2fs_ext2fs_open2+set}" = set; then :
+if ${ac_cv_lib_ext2fs_ext2fs_open2+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6475,7 +6473,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext2fs_ext2fs_open2" >&5
 $as_echo "$ac_cv_lib_ext2fs_ext2fs_open2" >&6; }
-if test "x$ac_cv_lib_ext2fs_ext2fs_open2" = x""yes; then :
+if test "x$ac_cv_lib_ext2fs_ext2fs_open2" = xyes; then :
 
 
 $as_echo "#define INCLUDE_EXTFS_H <ext2fs/ext2fs.h>" >>confdefs.h
@@ -6489,11 +6487,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "ext4fs/ext2fs.h" "ac_cv_header_ext4fs_ext2fs_h" "$ac_includes_default"
-if test "x$ac_cv_header_ext4fs_ext2fs_h" = x""yes; then :
+if test "x$ac_cv_header_ext4fs_ext2fs_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ext2fs_open2 in -lext4fs" >&5
 $as_echo_n "checking for ext2fs_open2 in -lext4fs... " >&6; }
-if test "${ac_cv_lib_ext4fs_ext2fs_open2+set}" = set; then :
+if ${ac_cv_lib_ext4fs_ext2fs_open2+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6527,7 +6525,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext4fs_ext2fs_open2" >&5
 $as_echo "$ac_cv_lib_ext4fs_ext2fs_open2" >&6; }
-if test "x$ac_cv_lib_ext4fs_ext2fs_open2" = x""yes; then :
+if test "x$ac_cv_lib_ext4fs_ext2fs_open2" = xyes; then :
 
 
 $as_echo "#define INCLUDE_EXTFS_H <ext4fs/ext2fs.h>" >>confdefs.h
@@ -6544,7 +6542,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_md_hash_buffer in -lgcrypt" >&5
 $as_echo_n "checking for gcry_md_hash_buffer in -lgcrypt... " >&6; }
-if test "${ac_cv_lib_gcrypt_gcry_md_hash_buffer+set}" = set; then :
+if ${ac_cv_lib_gcrypt_gcry_md_hash_buffer+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6578,7 +6576,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcrypt_gcry_md_hash_buffer" >&5
 $as_echo "$ac_cv_lib_gcrypt_gcry_md_hash_buffer" >&6; }
-if test "x$ac_cv_lib_gcrypt_gcry_md_hash_buffer" = x""yes; then :
+if test "x$ac_cv_lib_gcrypt_gcry_md_hash_buffer" = xyes; then :
   libgcrypt="y"
 else
   libgcrypt="n"
@@ -6588,7 +6586,7 @@ fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread flag" >&5
 $as_echo_n "checking for pthread flag... " >&6; }
-if test "${ax_cv_pthread_flags+set}" = set; then :
+if ${ax_cv_pthread_flags+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -6656,7 +6654,7 @@ $as_echo "$ax_cv_pthread_flags" >&6; }
 
     CPPFLAGS="$CPPFLAGS -Werror"
     ac_fn_c_check_header_mongrel "$LINENO" "libutil.h" "ac_cv_header_libutil_h" "$ac_includes_default"
-if test "x$ac_cv_header_libutil_h" = x""yes; then :
+if test "x$ac_cv_header_libutil_h" = xyes; then :
 
 
 $as_echo "#define INCLUDE_LIBUTIL_H <libutil.h>" >>confdefs.h
@@ -6670,7 +6668,7 @@ fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty et al" >&5
 $as_echo_n "checking for openpty et al... " >&6; }
-if test "${ax_cv_ptyfuncs_libs+set}" = set; then :
+if ${ax_cv_ptyfuncs_libs+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -6679,7 +6677,7 @@ else
                 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "Unable to find library for openpty and login_tty
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
             fi
 
     saved_LIBS="$LIBS"
@@ -6717,7 +6715,7 @@ $as_echo "$ax_cv_ptyfuncs_libs" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
 $as_echo_n "checking for yajl_alloc in -lyajl... " >&6; }
-if test "${ac_cv_lib_yajl_yajl_alloc+set}" = set; then :
+if ${ac_cv_lib_yajl_yajl_alloc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6751,7 +6749,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_yajl_yajl_alloc" >&5
 $as_echo "$ac_cv_lib_yajl_yajl_alloc" >&6; }
-if test "x$ac_cv_lib_yajl_yajl_alloc" = x""yes; then :
+if test "x$ac_cv_lib_yajl_yajl_alloc" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBYAJL 1
 _ACEOF
@@ -6764,7 +6762,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflateCopy in -lz" >&5
 $as_echo_n "checking for deflateCopy in -lz... " >&6; }
-if test "${ac_cv_lib_z_deflateCopy+set}" = set; then :
+if ${ac_cv_lib_z_deflateCopy+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6798,7 +6796,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflateCopy" >&5
 $as_echo "$ac_cv_lib_z_deflateCopy" >&6; }
-if test "x$ac_cv_lib_z_deflateCopy" = x""yes; then :
+if test "x$ac_cv_lib_z_deflateCopy" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBZ 1
 _ACEOF
@@ -6811,7 +6809,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5
 $as_echo_n "checking for libiconv_open in -liconv... " >&6; }
-if test "${ac_cv_lib_iconv_libiconv_open+set}" = set; then :
+if ${ac_cv_lib_iconv_libiconv_open+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6845,7 +6843,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5
 $as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; }
-if test "x$ac_cv_lib_iconv_libiconv_open" = x""yes; then :
+if test "x$ac_cv_lib_iconv_libiconv_open" = xyes; then :
   libiconv="y"
 else
   libiconv="n"
@@ -6857,7 +6855,7 @@ fi
 for ac_header in yajl/yajl_version.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "yajl/yajl_version.h" "ac_cv_header_yajl_yajl_version_h" "$ac_includes_default"
-if test "x$ac_cv_header_yajl_yajl_version_h" = x""yes; then :
+if test "x$ac_cv_header_yajl_yajl_version_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_YAJL_YAJL_VERSION_H 1
 _ACEOF
@@ -6931,10 +6929,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
-    test "x$cache_file" != "x/dev/null" &&
+    if test "x$cache_file" != "x/dev/null"; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
-    cat confcache >$cache_file
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
@@ -6966,7 +6975,7 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-: ${CONFIG_STATUS=./config.status}
+: "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -7067,6 +7076,7 @@ fi
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -7262,16 +7272,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -7331,28 +7341,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -7374,7 +7372,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # values after options handling.
 ac_log="
 This file was extended by Xen Hypervisor $as_me 4.3, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -7437,10 +7435,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 Xen Hypervisor config.status 4.3
-configured by $0, generated by GNU Autoconf 2.67,
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -7529,7 +7527,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -7561,7 +7559,7 @@ do
     "../config/Tools.mk") CONFIG_FILES="$CONFIG_FILES ../config/Tools.mk" ;;
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
 
-  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
@@ -7583,9 +7581,10 @@ fi
 # after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  tmp=
+  tmp= ac_tmp=
   trap 'exit_status=$?
-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
 ' 0
   trap 'as_fn_exit 1' 1 2 13 15
 }
@@ -7593,12 +7592,13 @@ $debug ||
 
 {
   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
+  test -d "$tmp"
 }  ||
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -7620,7 +7620,7 @@ else
   ac_cs_awk_cr=$ac_cr
 fi
 
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
 _ACEOF
 
 
@@ -7648,7 +7648,7 @@ done
 rm -f conf$$subs.sh
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
 sed -n '
 h
@@ -7696,7 +7696,7 @@ t delim
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = ""
 
@@ -7728,7 +7728,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 else
   cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
   || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
@@ -7762,7 +7762,7 @@ fi # test -n "$CONFIG_FILES"
 # No need to generate them if there are no CONFIG_HEADERS.
 # This happens for instance with `./config.status Makefile'.
 if test -n "$CONFIG_HEADERS"; then
-cat >"$tmp/defines.awk" <<\_ACAWK ||
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
@@ -7774,8 +7774,8 @@ _ACEOF
 # handling of long lines.
 ac_delim='%!_!# '
 for ac_last_try in false false :; do
-  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_t"; then
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
     break
   elif $ac_last_try; then
     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
@@ -7876,7 +7876,7 @@ do
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -7895,7 +7895,7 @@ do
     for ac_f
     do
       case $ac_f in
-      -) ac_f="$tmp/stdin";;
+      -) ac_f="$ac_tmp/stdin";;
       *) # Look for the file first in the build tree, then in the source tree
 	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
 	 # because $ac_f cannot contain `:'.
@@ -7904,7 +7904,7 @@ do
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
       as_fn_append ac_file_inputs " '$ac_f'"
@@ -7930,8 +7930,8 @@ $as_echo "$as_me: creating $ac_file" >&6;}
     esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5  ;;
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -8061,21 +8061,22 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
 s&@INSTALL@&$ac_INSTALL&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&2;}
 
-  rm -f "$tmp/stdin"
+  rm -f "$ac_tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out" && rm -f "$tmp/out";;
-  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
   esac \
   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
@@ -8086,20 +8087,20 @@ which seems to be undefined.  Please make sure it is defined" >&2;}
   if test x"$ac_file" != x-; then
     {
       $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
-    } >"$tmp/config.h" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
-      mv "$tmp/config.h" "$ac_file" \
+      mv "$ac_tmp/config.h" "$ac_file" \
 	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
       || as_fn_error $? "could not create -" "$LINENO" 5
   fi
  ;;
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:17:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:17:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1CK-0001MS-0R; Thu, 15 Nov 2012 15:17:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1CI-0001Lh-1Q
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:17:42 +0000
Received: from [85.158.137.99:10385] by server-5.bemta-3.messagelabs.com id
	89/8A-26311-59705A05; Thu, 15 Nov 2012 15:17:41 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-15.tower-217.messagelabs.com!1352992655!16901189!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_23,UNPARSEABLE_RELAY,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27753 invoked from network); 15 Nov 2012 15:17:36 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-15.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 15:17:36 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187341;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:06 -0500
Message-Id: <1352992629-5850-8-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 07/10] Regenerate configure script after
	removing vtpm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 tools/configure |  603 ++++++++++++++++++++++++++++---------------------------
 1 file changed, 302 insertions(+), 301 deletions(-)

diff --git a/tools/configure b/tools/configure
index edf42f6..ed20d12 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1,13 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for Xen Hypervisor 4.3.
+# Generated by GNU Autoconf 2.69 for Xen Hypervisor 4.3.
 #
 # Report bugs to <xen-devel@lists.xen.org>.
 #
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -91,6 +89,7 @@ fi
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -135,6 +134,31 @@ export LANGUAGE
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
@@ -168,7 +192,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -213,14 +238,25 @@ IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-	# neutralization value for shells without unset; and this also
-	# works around shells that cannot unset nonexistent variables.
-	BASH_ENV=/dev/null
-	ENV=/dev/null
-	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-	export CONFIG_SHELL
-	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
 fi
 
     if test x$as_have_required = xno; then :
@@ -323,6 +359,14 @@ $as_echo X"$as_dir" |
 
 
 } # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -444,6 +488,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -478,16 +526,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -499,28 +547,8 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -668,7 +696,6 @@ lomount
 miniterm
 ocamltools
 xenapi
-vtpm
 monitors
 githttp
 host_os
@@ -722,7 +749,6 @@ ac_user_opts='
 enable_option_checking
 enable_githttp
 enable_monitors
-enable_vtpm
 enable_xenapi
 enable_ocamltools
 enable_miniterm
@@ -1166,7 +1192,7 @@ Try \`$0 --help' for more information"
     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
   esac
@@ -1217,8 +1243,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1381,8 +1405,6 @@ Optional Features:
                           DISABLED)
   --disable-monitors      Disable xenstat and xentop monitoring tools (default
                           is ENABLED)
-  --enable-vtpm           Enable Virtual Trusted Platform Module (default is
-                          DISABLED)
   --enable-xenapi         Enable Xen API Bindings (default is DISABLED)
   --disable-ocamltools    Disable Ocaml tools (default is ENABLED)
   --enable-miniterm       Enable miniterm (default is DISABLED)
@@ -1495,9 +1517,9 @@ test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
 Xen Hypervisor configure 4.3
-generated by GNU Autoconf 2.67
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1541,7 +1563,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_compile
@@ -1578,7 +1600,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
     ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_cpp
@@ -1591,10 +1613,10 @@ fi
 ac_fn_c_check_header_mongrel ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval "test \"\${$3+set}\"" = set; then :
+  if eval \${$3+:} false; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
@@ -1661,7 +1683,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
@@ -1670,7 +1692,7 @@ eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_mongrel
 
@@ -1711,7 +1733,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
        ac_retval=$ac_status
 fi
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_run
@@ -1725,7 +1747,7 @@ ac_fn_c_check_header_compile ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1743,7 +1765,7 @@ fi
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_compile
 
@@ -1774,7 +1796,7 @@ $as_echo "$ac_try_echo"; } >&5
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
 	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
+	 test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -1788,7 +1810,7 @@ fi
   # interfere with the next link command; also delete a directory that is
   # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
@@ -1797,7 +1819,7 @@ This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by Xen Hypervisor $as_me 4.3, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -2055,7 +2077,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;}
       || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
@@ -2199,7 +2221,7 @@ $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
 $as_echo_n "checking build system type... " >&6; }
-if test "${ac_cv_build+set}" = set; then :
+if ${ac_cv_build+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
@@ -2215,7 +2237,7 @@ fi
 $as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
 esac
 build=$ac_cv_build
 ac_save_IFS=$IFS; IFS='-'
@@ -2233,7 +2255,7 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
 $as_echo_n "checking host system type... " >&6; }
-if test "${ac_cv_host+set}" = set; then :
+if ${ac_cv_host+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
@@ -2248,7 +2270,7 @@ fi
 $as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
 esac
 host=$ac_cv_host
 ac_save_IFS=$IFS; IFS='-'
@@ -2445,29 +2467,6 @@ monitors=$ax_cv_monitors
 
 
 
-# Check whether --enable-vtpm was given.
-if test "${enable_vtpm+set}" = set; then :
-  enableval=$enable_vtpm;
-fi
-
-
-if test "x$enable_vtpm" = "xno"; then :
-
-    ax_cv_vtpm="n"
-
-elif test "x$enable_vtpm" = "xyes"; then :
-
-    ax_cv_vtpm="y"
-
-elif test -z $ax_cv_vtpm; then :
-
-    ax_cv_vtpm="n"
-
-fi
-vtpm=$ax_cv_vtpm
-
-
-
 # Check whether --enable-xenapi was given.
 if test "${enable_xenapi+set}" = set; then :
   enableval=$enable_xenapi;
@@ -2700,7 +2699,7 @@ if test -n "$ac_tool_prefix"; then
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2712,7 +2711,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2740,7 +2739,7 @@ if test -z "$ac_cv_prog_CC"; then
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2752,7 +2751,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2793,7 +2792,7 @@ if test -z "$CC"; then
 set dummy ${ac_tool_prefix}cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2805,7 +2804,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2833,7 +2832,7 @@ if test -z "$CC"; then
 set dummy cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2846,7 +2845,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -2892,7 +2891,7 @@ if test -z "$CC"; then
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2904,7 +2903,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2936,7 +2935,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2948,7 +2947,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2991,7 +2990,7 @@ fi
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -3106,7 +3105,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
@@ -3149,7 +3148,7 @@ else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -3208,7 +3207,7 @@ $as_echo "$ac_try_echo"; } >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
     fi
   fi
 fi
@@ -3219,7 +3218,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
 ac_clean_files=$ac_clean_files_save
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then :
+if ${ac_cv_objext+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3260,7 +3259,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
@@ -3270,7 +3269,7 @@ OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3307,7 +3306,7 @@ ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -3385,7 +3384,7 @@ else
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -3394,8 +3393,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -3484,7 +3482,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -3528,7 +3526,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then :
+if ${ac_cv_path_install+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3548,7 +3546,7 @@ case $as_dir/ in #((
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
 	  if test $ac_prog = install &&
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
@@ -3608,7 +3606,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 set dummy bison; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_BISON+set}" = set; then :
+if ${ac_cv_path_BISON+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $BISON in
@@ -3622,7 +3620,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_BISON="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3648,7 +3646,7 @@ fi
 set dummy flex; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_FLEX+set}" = set; then :
+if ${ac_cv_path_FLEX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $FLEX in
@@ -3662,7 +3660,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_FLEX="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3688,7 +3686,7 @@ fi
 set dummy perl; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PERL+set}" = set; then :
+if ${ac_cv_path_PERL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PERL in
@@ -3702,7 +3700,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3735,7 +3733,7 @@ if test "x$xapi" = "xy"; then :
 set dummy curl-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CURL+set}" = set; then :
+if ${ac_cv_path_CURL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $CURL in
@@ -3749,7 +3747,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_CURL="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3780,7 +3778,7 @@ fi
 set dummy xml2-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_XML+set}" = set; then :
+if ${ac_cv_path_XML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $XML in
@@ -3794,7 +3792,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_XML="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3831,7 +3829,7 @@ if test "x$ocamltools" = "xy"; then :
 set dummy ${ac_tool_prefix}ocamlc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLC+set}" = set; then :
+if ${ac_cv_prog_OCAMLC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLC"; then
@@ -3843,7 +3841,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLC="${ac_tool_prefix}ocamlc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3871,7 +3869,7 @@ if test -z "$ac_cv_prog_OCAMLC"; then
 set dummy ocamlc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLC"; then
@@ -3883,7 +3881,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLC="ocamlc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3942,7 +3940,7 @@ $as_echo "OCaml library path is $OCAMLLIB" >&6; }
 set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLOPT+set}" = set; then :
+if ${ac_cv_prog_OCAMLOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLOPT"; then
@@ -3954,7 +3952,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLOPT="${ac_tool_prefix}ocamlopt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3982,7 +3980,7 @@ if test -z "$ac_cv_prog_OCAMLOPT"; then
 set dummy ocamlopt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLOPT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLOPT"; then
@@ -3994,7 +3992,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLOPT="ocamlopt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4052,7 +4050,7 @@ $as_echo "versions differs from ocamlc; ocamlopt discarded." >&6; }
 set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLCDOTOPT+set}" = set; then :
+if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLCDOTOPT"; then
@@ -4064,7 +4062,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLCDOTOPT="${ac_tool_prefix}ocamlc.opt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4092,7 +4090,7 @@ if test -z "$ac_cv_prog_OCAMLCDOTOPT"; then
 set dummy ocamlc.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLCDOTOPT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLCDOTOPT"; then
@@ -4104,7 +4102,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLCDOTOPT="ocamlc.opt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4156,7 +4154,7 @@ $as_echo "versions differs from ocamlc; ocamlc.opt discarded." >&6; }
 set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLOPTDOTOPT+set}" = set; then :
+if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLOPTDOTOPT"; then
@@ -4168,7 +4166,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLOPTDOTOPT="${ac_tool_prefix}ocamlopt.opt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4196,7 +4194,7 @@ if test -z "$ac_cv_prog_OCAMLOPTDOTOPT"; then
 set dummy ocamlopt.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
@@ -4208,7 +4206,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="ocamlopt.opt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4265,7 +4263,7 @@ $as_echo "version differs from ocamlc; ocamlopt.opt discarded." >&6; }
 set dummy ${ac_tool_prefix}ocaml; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAML+set}" = set; then :
+if ${ac_cv_prog_OCAML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAML"; then
@@ -4277,7 +4275,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAML="${ac_tool_prefix}ocaml"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4305,7 +4303,7 @@ if test -z "$ac_cv_prog_OCAML"; then
 set dummy ocaml; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAML+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAML"; then
@@ -4317,7 +4315,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAML="ocaml"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4359,7 +4357,7 @@ fi
 set dummy ${ac_tool_prefix}ocamldep; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLDEP+set}" = set; then :
+if ${ac_cv_prog_OCAMLDEP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLDEP"; then
@@ -4371,7 +4369,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLDEP="${ac_tool_prefix}ocamldep"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4399,7 +4397,7 @@ if test -z "$ac_cv_prog_OCAMLDEP"; then
 set dummy ocamldep; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLDEP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLDEP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLDEP"; then
@@ -4411,7 +4409,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLDEP="ocamldep"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4453,7 +4451,7 @@ fi
 set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLMKTOP+set}" = set; then :
+if ${ac_cv_prog_OCAMLMKTOP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLMKTOP"; then
@@ -4465,7 +4463,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLMKTOP="${ac_tool_prefix}ocamlmktop"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4493,7 +4491,7 @@ if test -z "$ac_cv_prog_OCAMLMKTOP"; then
 set dummy ocamlmktop; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLMKTOP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLMKTOP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLMKTOP"; then
@@ -4505,7 +4503,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLMKTOP="ocamlmktop"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4547,7 +4545,7 @@ fi
 set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLMKLIB+set}" = set; then :
+if ${ac_cv_prog_OCAMLMKLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLMKLIB"; then
@@ -4559,7 +4557,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLMKLIB="${ac_tool_prefix}ocamlmklib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4587,7 +4585,7 @@ if test -z "$ac_cv_prog_OCAMLMKLIB"; then
 set dummy ocamlmklib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLMKLIB+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLMKLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLMKLIB"; then
@@ -4599,7 +4597,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLMKLIB="ocamlmklib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4641,7 +4639,7 @@ fi
 set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLDOC+set}" = set; then :
+if ${ac_cv_prog_OCAMLDOC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLDOC"; then
@@ -4653,7 +4651,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLDOC="${ac_tool_prefix}ocamldoc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4681,7 +4679,7 @@ if test -z "$ac_cv_prog_OCAMLDOC"; then
 set dummy ocamldoc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLDOC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLDOC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLDOC"; then
@@ -4693,7 +4691,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLDOC="ocamldoc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4735,7 +4733,7 @@ fi
 set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLBUILD+set}" = set; then :
+if ${ac_cv_prog_OCAMLBUILD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLBUILD"; then
@@ -4747,7 +4745,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLBUILD="${ac_tool_prefix}ocamlbuild"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4775,7 +4773,7 @@ if test -z "$ac_cv_prog_OCAMLBUILD"; then
 set dummy ocamlbuild; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLBUILD+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLBUILD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLBUILD"; then
@@ -4787,7 +4785,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLBUILD="ocamlbuild"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4838,7 +4836,7 @@ fi
 set dummy bash; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_BASH+set}" = set; then :
+if ${ac_cv_path_BASH+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $BASH in
@@ -4852,7 +4850,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_BASH="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4893,7 +4891,7 @@ fi
 set dummy $PYTHON; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PYTHONPATH+set}" = set; then :
+if ${ac_cv_path_PYTHONPATH+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PYTHONPATH in
@@ -4907,7 +4905,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PYTHONPATH="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4960,7 +4958,7 @@ if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then :
+  if ${ac_cv_prog_CPP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -5076,7 +5074,7 @@ else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -5088,7 +5086,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then :
+if ${ac_cv_path_GREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
@@ -5102,7 +5100,7 @@ do
     for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+      as_fn_executable_p "$ac_path_GREP" || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
@@ -5151,7 +5149,7 @@ $as_echo "$ac_cv_path_GREP" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then :
+if ${ac_cv_path_EGREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -5168,7 +5166,7 @@ do
     for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      as_fn_executable_p "$ac_path_EGREP" || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -5218,7 +5216,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
+if ${ac_cv_header_stdc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -5354,7 +5352,7 @@ ac_python_version=`$PYTHON -c 'import distutils.sysconfig; \
 set dummy $PYTHON-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_pyconfig+set}" = set; then :
+if ${ac_cv_path_pyconfig+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $pyconfig in
@@ -5368,7 +5366,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_pyconfig="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5417,7 +5415,7 @@ else
 fi
 
 ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default"
-if test "x$ac_cv_header_Python_h" = x""yes; then :
+if test "x$ac_cv_header_Python_h" = xyes; then :
 
 else
   as_fn_error $? "Unable to find Python development headers" "$LINENO" 5
@@ -5427,7 +5425,7 @@ fi
 as_ac_Lib=`$as_echo "ac_cv_lib_python$ac_python_version''_PyArg_ParseTuple" | $as_tr_sh`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PyArg_ParseTuple in -lpython$ac_python_version" >&5
 $as_echo_n "checking for PyArg_ParseTuple in -lpython$ac_python_version... " >&6; }
-if eval "test \"\${$as_ac_Lib+set}\"" = set; then :
+if eval \${$as_ac_Lib+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5480,7 +5478,7 @@ LDLFAGS=$ac_previous_ldflags
 set dummy xgettext; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_XGETTEXT+set}" = set; then :
+if ${ac_cv_path_XGETTEXT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $XGETTEXT in
@@ -5494,7 +5492,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5527,7 +5525,7 @@ i[3456]86|x86_64)
 set dummy as86; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_AS86+set}" = set; then :
+if ${ac_cv_path_AS86+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $AS86 in
@@ -5541,7 +5539,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_AS86="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5572,7 +5570,7 @@ fi
 set dummy ld86; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_LD86+set}" = set; then :
+if ${ac_cv_path_LD86+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $LD86 in
@@ -5586,7 +5584,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_LD86="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5617,7 +5615,7 @@ fi
 set dummy bcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_BCC+set}" = set; then :
+if ${ac_cv_path_BCC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $BCC in
@@ -5631,7 +5629,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_BCC="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5662,7 +5660,7 @@ fi
 set dummy iasl; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_IASL+set}" = set; then :
+if ${ac_cv_path_IASL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $IASL in
@@ -5676,7 +5674,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_IASL="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5707,11 +5705,11 @@ fi
 esac
 
 ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_uuid_h" = x""yes; then :
+if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5
 $as_echo_n "checking for uuid_clear in -luuid... " >&6; }
-if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then :
+if ${ac_cv_lib_uuid_uuid_clear+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5745,7 +5743,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_clear" >&5
 $as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; }
-if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then :
+if test "x$ac_cv_lib_uuid_uuid_clear" = xyes; then :
   libuuid="y"
 fi
 
@@ -5754,7 +5752,7 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_h" = x""yes; then :
+if test "x$ac_cv_header_uuid_h" = xyes; then :
   libuuid="y"
 fi
 
@@ -5767,11 +5765,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default"
-if test "x$ac_cv_header_curses_h" = x""yes; then :
+if test "x$ac_cv_header_curses_h" = xyes; then :
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clear in -lcurses" >&5
 $as_echo_n "checking for clear in -lcurses... " >&6; }
-if test "${ac_cv_lib_curses_clear+set}" = set; then :
+if ${ac_cv_lib_curses_clear+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5805,7 +5803,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_clear" >&5
 $as_echo "$ac_cv_lib_curses_clear" >&6; }
-if test "x$ac_cv_lib_curses_clear" = x""yes; then :
+if test "x$ac_cv_lib_curses_clear" = xyes; then :
   curses="y"
 else
   curses="n"
@@ -5818,11 +5816,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default"
-if test "x$ac_cv_header_ncurses_h" = x""yes; then :
+if test "x$ac_cv_header_ncurses_h" = xyes; then :
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clear in -lncurses" >&5
 $as_echo_n "checking for clear in -lncurses... " >&6; }
-if test "${ac_cv_lib_ncurses_clear+set}" = set; then :
+if ${ac_cv_lib_ncurses_clear+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5856,7 +5854,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_clear" >&5
 $as_echo "$ac_cv_lib_ncurses_clear" >&6; }
-if test "x$ac_cv_lib_ncurses_clear" = x""yes; then :
+if test "x$ac_cv_lib_ncurses_clear" = xyes; then :
   ncurses="y"
 else
   ncurses="n"
@@ -5903,7 +5901,7 @@ if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -5917,7 +5915,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5946,7 +5944,7 @@ if test -z "$ac_cv_path_PKG_CONFIG"; then
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $ac_pt_PKG_CONFIG in
@@ -5960,7 +5958,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6091,7 +6089,7 @@ and glib_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details.
 
 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 else
 	glib_CFLAGS=$pkg_cv_glib_CFLAGS
 	glib_LIBS=$pkg_cv_glib_LIBS
@@ -6104,7 +6102,7 @@ fi
 set dummy wget; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_WGET+set}" = set; then :
+if ${ac_cv_path_WGET+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $WGET in
@@ -6118,7 +6116,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6151,7 +6149,7 @@ else
 set dummy ftp; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_FTP+set}" = set; then :
+if ${ac_cv_path_FTP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $FTP in
@@ -6165,7 +6163,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_FTP="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6204,11 +6202,11 @@ fi
 
 # Checks for libraries.
 ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_bzlib_h" = x""yes; then :
+if test "x$ac_cv_header_bzlib_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzDecompressInit in -lbz2" >&5
 $as_echo_n "checking for BZ2_bzDecompressInit in -lbz2... " >&6; }
-if test "${ac_cv_lib_bz2_BZ2_bzDecompressInit+set}" = set; then :
+if ${ac_cv_lib_bz2_BZ2_bzDecompressInit+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6242,7 +6240,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzDecompressInit" >&5
 $as_echo "$ac_cv_lib_bz2_BZ2_bzDecompressInit" >&6; }
-if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = x""yes; then :
+if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = xyes; then :
   zlib="$zlib -DHAVE_BZLIB -lbz2"
 fi
 
@@ -6251,11 +6249,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default"
-if test "x$ac_cv_header_lzma_h" = x""yes; then :
+if test "x$ac_cv_header_lzma_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_stream_decoder in -llzma" >&5
 $as_echo_n "checking for lzma_stream_decoder in -llzma... " >&6; }
-if test "${ac_cv_lib_lzma_lzma_stream_decoder+set}" = set; then :
+if ${ac_cv_lib_lzma_lzma_stream_decoder+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6289,7 +6287,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_stream_decoder" >&5
 $as_echo "$ac_cv_lib_lzma_lzma_stream_decoder" >&6; }
-if test "x$ac_cv_lib_lzma_lzma_stream_decoder" = x""yes; then :
+if test "x$ac_cv_lib_lzma_lzma_stream_decoder" = xyes; then :
   zlib="$zlib -DHAVE_LZMA -llzma"
 fi
 
@@ -6298,11 +6296,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "lzo/lzo1x.h" "ac_cv_header_lzo_lzo1x_h" "$ac_includes_default"
-if test "x$ac_cv_header_lzo_lzo1x_h" = x""yes; then :
+if test "x$ac_cv_header_lzo_lzo1x_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzo1x_decompress in -llzo2" >&5
 $as_echo_n "checking for lzo1x_decompress in -llzo2... " >&6; }
-if test "${ac_cv_lib_lzo2_lzo1x_decompress+set}" = set; then :
+if ${ac_cv_lib_lzo2_lzo1x_decompress+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6336,7 +6334,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzo2_lzo1x_decompress" >&5
 $as_echo "$ac_cv_lib_lzo2_lzo1x_decompress" >&6; }
-if test "x$ac_cv_lib_lzo2_lzo1x_decompress" = x""yes; then :
+if test "x$ac_cv_lib_lzo2_lzo1x_decompress" = xyes; then :
   zlib="$zlib -DHAVE_LZO1X -llzo2"
 fi
 
@@ -6347,7 +6345,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for io_setup in -laio" >&5
 $as_echo_n "checking for io_setup in -laio... " >&6; }
-if test "${ac_cv_lib_aio_io_setup+set}" = set; then :
+if ${ac_cv_lib_aio_io_setup+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6381,7 +6379,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_aio_io_setup" >&5
 $as_echo "$ac_cv_lib_aio_io_setup" >&6; }
-if test "x$ac_cv_lib_aio_io_setup" = x""yes; then :
+if test "x$ac_cv_lib_aio_io_setup" = xyes; then :
   system_aio="y"
 else
   system_aio="n"
@@ -6390,7 +6388,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5 in -lcrypto" >&5
 $as_echo_n "checking for MD5 in -lcrypto... " >&6; }
-if test "${ac_cv_lib_crypto_MD5+set}" = set; then :
+if ${ac_cv_lib_crypto_MD5+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6424,7 +6422,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5" >&5
 $as_echo "$ac_cv_lib_crypto_MD5" >&6; }
-if test "x$ac_cv_lib_crypto_MD5" = x""yes; then :
+if test "x$ac_cv_lib_crypto_MD5" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBCRYPTO 1
 _ACEOF
@@ -6437,11 +6435,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "ext2fs/ext2fs.h" "ac_cv_header_ext2fs_ext2fs_h" "$ac_includes_default"
-if test "x$ac_cv_header_ext2fs_ext2fs_h" = x""yes; then :
+if test "x$ac_cv_header_ext2fs_ext2fs_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ext2fs_open2 in -lext2fs" >&5
 $as_echo_n "checking for ext2fs_open2 in -lext2fs... " >&6; }
-if test "${ac_cv_lib_ext2fs_ext2fs_open2+set}" = set; then :
+if ${ac_cv_lib_ext2fs_ext2fs_open2+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6475,7 +6473,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext2fs_ext2fs_open2" >&5
 $as_echo "$ac_cv_lib_ext2fs_ext2fs_open2" >&6; }
-if test "x$ac_cv_lib_ext2fs_ext2fs_open2" = x""yes; then :
+if test "x$ac_cv_lib_ext2fs_ext2fs_open2" = xyes; then :
 
 
 $as_echo "#define INCLUDE_EXTFS_H <ext2fs/ext2fs.h>" >>confdefs.h
@@ -6489,11 +6487,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "ext4fs/ext2fs.h" "ac_cv_header_ext4fs_ext2fs_h" "$ac_includes_default"
-if test "x$ac_cv_header_ext4fs_ext2fs_h" = x""yes; then :
+if test "x$ac_cv_header_ext4fs_ext2fs_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ext2fs_open2 in -lext4fs" >&5
 $as_echo_n "checking for ext2fs_open2 in -lext4fs... " >&6; }
-if test "${ac_cv_lib_ext4fs_ext2fs_open2+set}" = set; then :
+if ${ac_cv_lib_ext4fs_ext2fs_open2+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6527,7 +6525,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext4fs_ext2fs_open2" >&5
 $as_echo "$ac_cv_lib_ext4fs_ext2fs_open2" >&6; }
-if test "x$ac_cv_lib_ext4fs_ext2fs_open2" = x""yes; then :
+if test "x$ac_cv_lib_ext4fs_ext2fs_open2" = xyes; then :
 
 
 $as_echo "#define INCLUDE_EXTFS_H <ext4fs/ext2fs.h>" >>confdefs.h
@@ -6544,7 +6542,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_md_hash_buffer in -lgcrypt" >&5
 $as_echo_n "checking for gcry_md_hash_buffer in -lgcrypt... " >&6; }
-if test "${ac_cv_lib_gcrypt_gcry_md_hash_buffer+set}" = set; then :
+if ${ac_cv_lib_gcrypt_gcry_md_hash_buffer+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6578,7 +6576,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcrypt_gcry_md_hash_buffer" >&5
 $as_echo "$ac_cv_lib_gcrypt_gcry_md_hash_buffer" >&6; }
-if test "x$ac_cv_lib_gcrypt_gcry_md_hash_buffer" = x""yes; then :
+if test "x$ac_cv_lib_gcrypt_gcry_md_hash_buffer" = xyes; then :
   libgcrypt="y"
 else
   libgcrypt="n"
@@ -6588,7 +6586,7 @@ fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread flag" >&5
 $as_echo_n "checking for pthread flag... " >&6; }
-if test "${ax_cv_pthread_flags+set}" = set; then :
+if ${ax_cv_pthread_flags+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -6656,7 +6654,7 @@ $as_echo "$ax_cv_pthread_flags" >&6; }
 
     CPPFLAGS="$CPPFLAGS -Werror"
     ac_fn_c_check_header_mongrel "$LINENO" "libutil.h" "ac_cv_header_libutil_h" "$ac_includes_default"
-if test "x$ac_cv_header_libutil_h" = x""yes; then :
+if test "x$ac_cv_header_libutil_h" = xyes; then :
 
 
 $as_echo "#define INCLUDE_LIBUTIL_H <libutil.h>" >>confdefs.h
@@ -6670,7 +6668,7 @@ fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty et al" >&5
 $as_echo_n "checking for openpty et al... " >&6; }
-if test "${ax_cv_ptyfuncs_libs+set}" = set; then :
+if ${ax_cv_ptyfuncs_libs+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -6679,7 +6677,7 @@ else
                 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "Unable to find library for openpty and login_tty
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
             fi
 
     saved_LIBS="$LIBS"
@@ -6717,7 +6715,7 @@ $as_echo "$ax_cv_ptyfuncs_libs" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
 $as_echo_n "checking for yajl_alloc in -lyajl... " >&6; }
-if test "${ac_cv_lib_yajl_yajl_alloc+set}" = set; then :
+if ${ac_cv_lib_yajl_yajl_alloc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6751,7 +6749,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_yajl_yajl_alloc" >&5
 $as_echo "$ac_cv_lib_yajl_yajl_alloc" >&6; }
-if test "x$ac_cv_lib_yajl_yajl_alloc" = x""yes; then :
+if test "x$ac_cv_lib_yajl_yajl_alloc" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBYAJL 1
 _ACEOF
@@ -6764,7 +6762,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflateCopy in -lz" >&5
 $as_echo_n "checking for deflateCopy in -lz... " >&6; }
-if test "${ac_cv_lib_z_deflateCopy+set}" = set; then :
+if ${ac_cv_lib_z_deflateCopy+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6798,7 +6796,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflateCopy" >&5
 $as_echo "$ac_cv_lib_z_deflateCopy" >&6; }
-if test "x$ac_cv_lib_z_deflateCopy" = x""yes; then :
+if test "x$ac_cv_lib_z_deflateCopy" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBZ 1
 _ACEOF
@@ -6811,7 +6809,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5
 $as_echo_n "checking for libiconv_open in -liconv... " >&6; }
-if test "${ac_cv_lib_iconv_libiconv_open+set}" = set; then :
+if ${ac_cv_lib_iconv_libiconv_open+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6845,7 +6843,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5
 $as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; }
-if test "x$ac_cv_lib_iconv_libiconv_open" = x""yes; then :
+if test "x$ac_cv_lib_iconv_libiconv_open" = xyes; then :
   libiconv="y"
 else
   libiconv="n"
@@ -6857,7 +6855,7 @@ fi
 for ac_header in yajl/yajl_version.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "yajl/yajl_version.h" "ac_cv_header_yajl_yajl_version_h" "$ac_includes_default"
-if test "x$ac_cv_header_yajl_yajl_version_h" = x""yes; then :
+if test "x$ac_cv_header_yajl_yajl_version_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_YAJL_YAJL_VERSION_H 1
 _ACEOF
@@ -6931,10 +6929,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
-    test "x$cache_file" != "x/dev/null" &&
+    if test "x$cache_file" != "x/dev/null"; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
-    cat confcache >$cache_file
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
@@ -6966,7 +6975,7 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-: ${CONFIG_STATUS=./config.status}
+: "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -7067,6 +7076,7 @@ fi
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -7262,16 +7272,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -7331,28 +7341,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -7374,7 +7372,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # values after options handling.
 ac_log="
 This file was extended by Xen Hypervisor $as_me 4.3, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -7437,10 +7435,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 Xen Hypervisor config.status 4.3
-configured by $0, generated by GNU Autoconf 2.67,
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -7529,7 +7527,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -7561,7 +7559,7 @@ do
     "../config/Tools.mk") CONFIG_FILES="$CONFIG_FILES ../config/Tools.mk" ;;
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
 
-  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
@@ -7583,9 +7581,10 @@ fi
 # after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  tmp=
+  tmp= ac_tmp=
   trap 'exit_status=$?
-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
 ' 0
   trap 'as_fn_exit 1' 1 2 13 15
 }
@@ -7593,12 +7592,13 @@ $debug ||
 
 {
   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
+  test -d "$tmp"
 }  ||
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -7620,7 +7620,7 @@ else
   ac_cs_awk_cr=$ac_cr
 fi
 
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
 _ACEOF
 
 
@@ -7648,7 +7648,7 @@ done
 rm -f conf$$subs.sh
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
 sed -n '
 h
@@ -7696,7 +7696,7 @@ t delim
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = ""
 
@@ -7728,7 +7728,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 else
   cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
   || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
@@ -7762,7 +7762,7 @@ fi # test -n "$CONFIG_FILES"
 # No need to generate them if there are no CONFIG_HEADERS.
 # This happens for instance with `./config.status Makefile'.
 if test -n "$CONFIG_HEADERS"; then
-cat >"$tmp/defines.awk" <<\_ACAWK ||
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
@@ -7774,8 +7774,8 @@ _ACEOF
 # handling of long lines.
 ac_delim='%!_!# '
 for ac_last_try in false false :; do
-  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_t"; then
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
     break
   elif $ac_last_try; then
     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
@@ -7876,7 +7876,7 @@ do
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -7895,7 +7895,7 @@ do
     for ac_f
     do
       case $ac_f in
-      -) ac_f="$tmp/stdin";;
+      -) ac_f="$ac_tmp/stdin";;
       *) # Look for the file first in the build tree, then in the source tree
 	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
 	 # because $ac_f cannot contain `:'.
@@ -7904,7 +7904,7 @@ do
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
       as_fn_append ac_file_inputs " '$ac_f'"
@@ -7930,8 +7930,8 @@ $as_echo "$as_me: creating $ac_file" >&6;}
     esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5  ;;
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -8061,21 +8061,22 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
 s&@INSTALL@&$ac_INSTALL&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&2;}
 
-  rm -f "$tmp/stdin"
+  rm -f "$ac_tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out" && rm -f "$tmp/out";;
-  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
   esac \
   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
@@ -8086,20 +8087,20 @@ which seems to be undefined.  Please make sure it is defined" >&2;}
   if test x"$ac_file" != x-; then
     {
       $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
-    } >"$tmp/config.h" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
-      mv "$tmp/config.h" "$ac_file" \
+      mv "$ac_tmp/config.h" "$ac_file" \
 	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
       || as_fn_error $? "could not create -" "$LINENO" 5
   fi
  ;;
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:18:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:18:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1D9-0001cm-IH; Thu, 15 Nov 2012 15:18:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1D8-0001br-IA
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:18:34 +0000
Received: from [85.158.138.51:30415] by server-11.bemta-3.messagelabs.com id
	3A/03-19361-9C705A05; Thu, 15 Nov 2012 15:18:33 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-16.tower-174.messagelabs.com!1352992711!30075836!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19927 invoked from network); 15 Nov 2012 15:18:32 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-16.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 15:18:32 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187335;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:03 -0500
Message-Id: <1352992629-5850-5-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 04/10] Remove VTPM_TOOLS from
	config/Tools.mk.in
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 config/Tools.mk.in |    1 -
 1 file changed, 1 deletion(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index a78f211..3967e7d 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -44,7 +44,6 @@ GIT_HTTP            := @githttp@
 
 # Optional components
 XENSTAT_XENTOP      := @monitors@
-VTPM_TOOLS          := @vtpm@
 LIBXENAPI_BINDINGS  := @xenapi@
 OCAML_TOOLS         := @ocamltools@
 CONFIG_MINITERM     := @miniterm@
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:18:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:18:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1D9-0001cm-IH; Thu, 15 Nov 2012 15:18:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1D8-0001br-IA
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:18:34 +0000
Received: from [85.158.138.51:30415] by server-11.bemta-3.messagelabs.com id
	3A/03-19361-9C705A05; Thu, 15 Nov 2012 15:18:33 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-16.tower-174.messagelabs.com!1352992711!30075836!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19927 invoked from network); 15 Nov 2012 15:18:32 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-16.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 15:18:32 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187335;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:03 -0500
Message-Id: <1352992629-5850-5-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 04/10] Remove VTPM_TOOLS from
	config/Tools.mk.in
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 config/Tools.mk.in |    1 -
 1 file changed, 1 deletion(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index a78f211..3967e7d 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -44,7 +44,6 @@ GIT_HTTP            := @githttp@
 
 # Optional components
 XENSTAT_XENTOP      := @monitors@
-VTPM_TOOLS          := @vtpm@
 LIBXENAPI_BINDINGS  := @xenapi@
 OCAML_TOOLS         := @ocamltools@
 CONFIG_MINITERM     := @miniterm@
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:18:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:18:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1D8-0001cD-No; Thu, 15 Nov 2012 15:18:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1D7-0001bS-27
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:18:33 +0000
Received: from [85.158.143.35:11667] by server-2.bemta-4.messagelabs.com id
	B1/4D-28922-8C705A05; Thu, 15 Nov 2012 15:18:32 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-14.tower-21.messagelabs.com!1352992652!17925409!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30122 invoked from network); 15 Nov 2012 15:17:33 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 15:17:33 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187337;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:04 -0500
Message-Id: <1352992629-5850-6-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 05/10] Remove old vtpm stuff from
	tools/libxen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 tools/libxen/include/xen/api/xen_all.h       |    1 -
 tools/libxen/include/xen/api/xen_vm.h        |    9 -
 tools/libxen/include/xen/api/xen_vtpm.h      |  218 ------------------------
 tools/libxen/include/xen/api/xen_vtpm_decl.h |   31 ----
 tools/libxen/src/xen_vm.c                    |   22 ---
 tools/libxen/src/xen_vtpm.c                  |  235 --------------------------
 6 files changed, 516 deletions(-)
 delete mode 100644 tools/libxen/include/xen/api/xen_vtpm.h
 delete mode 100644 tools/libxen/include/xen/api/xen_vtpm_decl.h
 delete mode 100644 tools/libxen/src/xen_vtpm.c

diff --git a/tools/libxen/include/xen/api/xen_all.h b/tools/libxen/include/xen/api/xen_all.h
index 52113c7..45ac171 100644
--- a/tools/libxen/include/xen/api/xen_all.h
+++ b/tools/libxen/include/xen/api/xen_all.h
@@ -35,7 +35,6 @@
 #include <xen/api/xen_vm.h>
 #include <xen/api/xen_vm_metrics.h>
 #include <xen/api/xen_vm_power_state.h>
-#include <xen/api/xen_vtpm.h>
 #include <xen/api/xen_xspolicy.h>
 #include <xen/api/xen_cpu_pool.h>
 #endif
diff --git a/tools/libxen/include/xen/api/xen_vm.h b/tools/libxen/include/xen/api/xen_vm.h
index de554fc..8be7d2b 100644
--- a/tools/libxen/include/xen/api/xen_vm.h
+++ b/tools/libxen/include/xen/api/xen_vm.h
@@ -33,7 +33,6 @@
 #include <xen/api/xen_vm_guest_metrics_decl.h>
 #include <xen/api/xen_vm_metrics_decl.h>
 #include <xen/api/xen_vm_power_state.h>
-#include <xen/api/xen_vtpm_decl.h>
 #include <xen/api/xen_cpu_pool_decl.h>
 
 
@@ -98,7 +97,6 @@ typedef struct xen_vm_record
     struct xen_vif_record_opt_set *vifs;
     struct xen_vbd_record_opt_set *vbds;
     struct xen_crashdump_record_opt_set *crash_dumps;
-    struct xen_vtpm_record_opt_set *vtpms;
     char *pv_bootloader;
     char *pv_kernel;
     char *pv_ramdisk;
@@ -396,13 +394,6 @@ xen_vm_get_crash_dumps(xen_session *session, struct xen_crashdump_set **result,
 
 
 /**
- * Get the VTPMs field of the given VM.
- */
-extern bool
-xen_vm_get_vtpms(xen_session *session, struct xen_vtpm_set **result, xen_vm vm);
-
-
-/**
  * Get the PV/bootloader field of the given VM.
  */
 extern bool
diff --git a/tools/libxen/include/xen/api/xen_vtpm.h b/tools/libxen/include/xen/api/xen_vtpm.h
deleted file mode 100644
index 9b3b2eb..0000000
--- a/tools/libxen/include/xen/api/xen_vtpm.h
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- * Copyright (c) 2006, IBM Corp.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * 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
- */
-
-#ifndef XEN_VTPM_H
-#define XEN_VTPM_H
-
-#include <xen/api/xen_common.h>
-#include <xen/api/xen_vm_decl.h>
-#include <xen/api/xen_vtpm_decl.h>
-
-
-/*
- * The VTPM class.
- * 
- * A virtual TPM device.
- */
-
-
-/**
- * Free the given xen_vtpm.  The given handle must have been allocated
- * by this library.
- */
-extern void
-xen_vtpm_free(xen_vtpm vtpm);
-
-
-typedef struct xen_vtpm_set
-{
-    size_t size;
-    xen_vtpm *contents[];
-} xen_vtpm_set;
-
-/**
- * Allocate a xen_vtpm_set of the given size.
- */
-extern xen_vtpm_set *
-xen_vtpm_set_alloc(size_t size);
-
-/**
- * Free the given xen_vtpm_set.  The given set must have been allocated
- * by this library.
- */
-extern void
-xen_vtpm_set_free(xen_vtpm_set *set);
-
-
-typedef struct xen_vtpm_record
-{
-    xen_vtpm handle;
-    char *uuid;
-    struct xen_vm_record_opt *vm;
-    struct xen_vm_record_opt *backend;
-    xen_string_string_map *other_config;
-} xen_vtpm_record;
-
-/**
- * Allocate a xen_vtpm_record.
- */
-extern xen_vtpm_record *
-xen_vtpm_record_alloc(void);
-
-/**
- * Free the given xen_vtpm_record, and all referenced values.  The
- * given record must have been allocated by this library.
- */
-extern void
-xen_vtpm_record_free(xen_vtpm_record *record);
-
-
-typedef struct xen_vtpm_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_vtpm handle;
-        xen_vtpm_record *record;
-    } u;
-} xen_vtpm_record_opt;
-
-/**
- * Allocate a xen_vtpm_record_opt.
- */
-extern xen_vtpm_record_opt *
-xen_vtpm_record_opt_alloc(void);
-
-/**
- * Free the given xen_vtpm_record_opt, and all referenced values.  The
- * given record_opt must have been allocated by this library.
- */
-extern void
-xen_vtpm_record_opt_free(xen_vtpm_record_opt *record_opt);
-
-
-typedef struct xen_vtpm_record_set
-{
-    size_t size;
-    xen_vtpm_record *contents[];
-} xen_vtpm_record_set;
-
-/**
- * Allocate a xen_vtpm_record_set of the given size.
- */
-extern xen_vtpm_record_set *
-xen_vtpm_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_vtpm_record_set, and all referenced values.  The
- * given set must have been allocated by this library.
- */
-extern void
-xen_vtpm_record_set_free(xen_vtpm_record_set *set);
-
-
-
-typedef struct xen_vtpm_record_opt_set
-{
-    size_t size;
-    xen_vtpm_record_opt *contents[];
-} xen_vtpm_record_opt_set;
-
-/**
- * Allocate a xen_vtpm_record_opt_set of the given size.
- */
-extern xen_vtpm_record_opt_set *
-xen_vtpm_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_vtpm_record_opt_set, and all referenced values. 
- * The given set must have been allocated by this library.
- */
-extern void
-xen_vtpm_record_opt_set_free(xen_vtpm_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given VTPM.
- */
-extern bool
-xen_vtpm_get_record(xen_session *session, xen_vtpm_record **result, xen_vtpm vtpm);
-
-
-/**
- * Get a reference to the VTPM instance with the specified UUID.
- */
-extern bool
-xen_vtpm_get_by_uuid(xen_session *session, xen_vtpm *result, char *uuid);
-
-
-/**
- * Create a new VTPM instance, and return its handle.
- */
-extern bool
-xen_vtpm_create(xen_session *session, xen_vtpm *result, xen_vtpm_record *record);
-
-
-/**
- * Destroy the specified VTPM instance.
- */
-extern bool
-xen_vtpm_destroy(xen_session *session, xen_vtpm vtpm);
-
-
-/**
- * Get the uuid field of the given VTPM.
- */
-extern bool
-xen_vtpm_get_uuid(xen_session *session, char **result, xen_vtpm vtpm);
-
-
-/**
- * Get the VM field of the given VTPM.
- */
-extern bool
-xen_vtpm_get_vm(xen_session *session, xen_vm *result, xen_vtpm vtpm);
-
-
-/**
- * Get the backend field of the given VTPM.
- */
-extern bool
-xen_vtpm_get_backend(xen_session *session, xen_vm *result, xen_vtpm vtpm);
-
-
-/**
- * Get the other_config field of the given VTPM.
- */
-extern bool
-xen_vtpm_get_other_config(xen_session *session,
-                          xen_string_string_map **result,
-                          xen_vtpm vtpm);
-
-
-/**
- * Set the other_config field of the given VTPM.
- */
-extern bool
-xen_vtpm_set_other_config(xen_session *session,
-                          xen_vtpm vtpm,
-                          xen_string_string_map *other_config);
-
-
-#endif
diff --git a/tools/libxen/include/xen/api/xen_vtpm_decl.h b/tools/libxen/include/xen/api/xen_vtpm_decl.h
deleted file mode 100644
index 7798e38..0000000
--- a/tools/libxen/include/xen/api/xen_vtpm_decl.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- * Copyright (c) 2006, IBM Corp.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * 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
- */
-
-#ifndef XEN_VTPM_DECL_H
-#define XEN_VTPM_DECL_H
-
-typedef void *xen_vtpm;
-
-struct xen_vtpm_set;
-struct xen_vtpm_record;
-struct xen_vtpm_record_set;
-struct xen_vtpm_record_opt;
-struct xen_vtpm_record_opt_set;
-
-#endif
diff --git a/tools/libxen/src/xen_vm.c b/tools/libxen/src/xen_vm.c
index b762fbe..dcd650c 100644
--- a/tools/libxen/src/xen_vm.c
+++ b/tools/libxen/src/xen_vm.c
@@ -35,7 +35,6 @@
 #include <xen/api/xen_vm.h>
 #include <xen/api/xen_vm_guest_metrics.h>
 #include <xen/api/xen_vm_metrics.h>
-#include <xen/api/xen_vtpm.h>
 #include <xen/api/xen_cpu_pool.h>
 
 
@@ -119,9 +118,6 @@ static const struct_member xen_vm_record_struct_members[] =
         { .key = "crash_dumps",
           .type = &abstract_type_ref_set,
           .offset = offsetof(xen_vm_record, crash_dumps) },
-        { .key = "VTPMs",
-          .type = &abstract_type_ref_set,
-          .offset = offsetof(xen_vm_record, vtpms) },
         { .key = "PV_bootloader",
           .type = &abstract_type_string,
           .offset = offsetof(xen_vm_record, pv_bootloader) },
@@ -203,7 +199,6 @@ xen_vm_record_free(xen_vm_record *record)
     xen_vif_record_opt_set_free(record->vifs);
     xen_vbd_record_opt_set_free(record->vbds);
     xen_crashdump_record_opt_set_free(record->crash_dumps);
-    xen_vtpm_record_opt_set_free(record->vtpms);
     free(record->pv_bootloader);
     free(record->pv_kernel);
     free(record->pv_ramdisk);
@@ -668,23 +663,6 @@ xen_vm_get_crash_dumps(xen_session *session, struct xen_crashdump_set **result,
 
 
 bool
-xen_vm_get_vtpms(xen_session *session, struct xen_vtpm_set **result, xen_vm vm)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vm }
-        };
-
-    abstract_type result_type = abstract_type_string_set;
-
-    *result = NULL;
-    XEN_CALL_("VM.get_VTPMs");
-    return session->ok;
-}
-
-
-bool
 xen_vm_get_pv_bootloader(xen_session *session, char **result, xen_vm vm)
 {
     abstract_value param_values[] =
diff --git a/tools/libxen/src/xen_vtpm.c b/tools/libxen/src/xen_vtpm.c
deleted file mode 100644
index 0ca7b41..0000000
--- a/tools/libxen/src/xen_vtpm.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- * Copyright (c) 2006, IBM Corp.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * 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
- */
-
-
-#include <stddef.h>
-#include <stdlib.h>
-
-#include "xen_internal.h"
-#include <xen/api/xen_common.h>
-#include <xen/api/xen_vm.h>
-#include <xen/api/xen_vtpm.h>
-
-
-XEN_FREE(xen_vtpm)
-XEN_SET_ALLOC_FREE(xen_vtpm)
-XEN_ALLOC(xen_vtpm_record)
-XEN_SET_ALLOC_FREE(xen_vtpm_record)
-XEN_ALLOC(xen_vtpm_record_opt)
-XEN_RECORD_OPT_FREE(xen_vtpm)
-XEN_SET_ALLOC_FREE(xen_vtpm_record_opt)
-
-
-static const struct_member xen_vtpm_record_struct_members[] =
-    {
-        { .key = "uuid",
-          .type = &abstract_type_string,
-          .offset = offsetof(xen_vtpm_record, uuid) },
-        { .key = "VM",
-          .type = &abstract_type_ref,
-          .offset = offsetof(xen_vtpm_record, vm) },
-        { .key = "backend",
-          .type = &abstract_type_ref,
-          .offset = offsetof(xen_vtpm_record, backend) },
-        { .key = "other_config",
-          .type = &abstract_type_string_string_map,
-          .offset = offsetof(xen_vtpm_record, other_config) }
-    };
-
-const abstract_type xen_vtpm_record_abstract_type_ =
-    {
-       .typename = STRUCT,
-       .struct_size = sizeof(xen_vtpm_record),
-       .member_count =
-           sizeof(xen_vtpm_record_struct_members) / sizeof(struct_member),
-       .members = xen_vtpm_record_struct_members
-    };
-
-
-void
-xen_vtpm_record_free(xen_vtpm_record *record)
-{
-    if (record == NULL)
-    {
-        return;
-    }
-    free(record->handle);
-    free(record->uuid);
-    xen_vm_record_opt_free(record->vm);
-    xen_vm_record_opt_free(record->backend);
-    xen_string_string_map_free(record->other_config);
-    free(record);
-}
-
-
-bool
-xen_vtpm_get_record(xen_session *session, xen_vtpm_record **result, xen_vtpm vtpm)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vtpm }
-        };
-
-    abstract_type result_type = xen_vtpm_record_abstract_type_;
-
-    *result = NULL;
-    XEN_CALL_("VTPM.get_record");
-
-    if (session->ok)
-    {
-       (*result)->handle = xen_strdup_((*result)->uuid);
-    }
-
-    return session->ok;
-}
-
-
-bool
-xen_vtpm_get_by_uuid(xen_session *session, xen_vtpm *result, char *uuid)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = uuid }
-        };
-
-    abstract_type result_type = abstract_type_string;
-
-    *result = NULL;
-    XEN_CALL_("VTPM.get_by_uuid");
-    return session->ok;
-}
-
-
-bool
-xen_vtpm_create(xen_session *session, xen_vtpm *result, xen_vtpm_record *record)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &xen_vtpm_record_abstract_type_,
-              .u.struct_val = record }
-        };
-
-    abstract_type result_type = abstract_type_string;
-
-    *result = NULL;
-    XEN_CALL_("VTPM.create");
-    return session->ok;
-}
-
-
-bool
-xen_vtpm_destroy(xen_session *session, xen_vtpm vtpm)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vtpm }
-        };
-
-    xen_call_(session, "VTPM.destroy", param_values, 1, NULL, NULL);
-    return session->ok;
-}
-
-
-bool
-xen_vtpm_get_vm(xen_session *session, xen_vm *result, xen_vtpm vtpm)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vtpm }
-        };
-
-    abstract_type result_type = abstract_type_string;
-
-    *result = NULL;
-    XEN_CALL_("VTPM.get_VM");
-    return session->ok;
-}
-
-
-bool
-xen_vtpm_get_backend(xen_session *session, xen_vm *result, xen_vtpm vtpm)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vtpm }
-        };
-
-    abstract_type result_type = abstract_type_string;
-
-    *result = NULL;
-    XEN_CALL_("VTPM.get_backend");
-    return session->ok;
-}
-
-
-bool
-xen_vtpm_get_uuid(xen_session *session, char **result, xen_vtpm vtpm)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vtpm }
-        };
-
-    abstract_type result_type = abstract_type_string;
-
-    *result = NULL;
-    XEN_CALL_("VTPM.get_uuid");
-    return session->ok;
-}
-
-
-bool
-xen_vtpm_get_other_config(xen_session *session, xen_string_string_map **result,
-                          xen_vtpm vtpm)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vtpm }
-        };
-
-    abstract_type result_type = abstract_type_string_string_map;
-
-    *result = NULL;
-    XEN_CALL_("VTPM.get_other_config");
-    return session->ok;
-}
-
-
-bool
-xen_vtpm_set_other_config(xen_session *session, xen_vtpm vtpm,
-                          xen_string_string_map *other_config)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vtpm },
-            { .type = &abstract_type_string_string_map,
-              .u.set_val = (arbitrary_set *)other_config }
-        };
-
-    xen_call_(session, "VTPM.set_other_config", param_values, 2, NULL, NULL);
-    return session->ok;
-}
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:18:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:18:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1D8-0001cD-No; Thu, 15 Nov 2012 15:18:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1D7-0001bS-27
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:18:33 +0000
Received: from [85.158.143.35:11667] by server-2.bemta-4.messagelabs.com id
	B1/4D-28922-8C705A05; Thu, 15 Nov 2012 15:18:32 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-14.tower-21.messagelabs.com!1352992652!17925409!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30122 invoked from network); 15 Nov 2012 15:17:33 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 15:17:33 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187337;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:04 -0500
Message-Id: <1352992629-5850-6-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 05/10] Remove old vtpm stuff from
	tools/libxen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 tools/libxen/include/xen/api/xen_all.h       |    1 -
 tools/libxen/include/xen/api/xen_vm.h        |    9 -
 tools/libxen/include/xen/api/xen_vtpm.h      |  218 ------------------------
 tools/libxen/include/xen/api/xen_vtpm_decl.h |   31 ----
 tools/libxen/src/xen_vm.c                    |   22 ---
 tools/libxen/src/xen_vtpm.c                  |  235 --------------------------
 6 files changed, 516 deletions(-)
 delete mode 100644 tools/libxen/include/xen/api/xen_vtpm.h
 delete mode 100644 tools/libxen/include/xen/api/xen_vtpm_decl.h
 delete mode 100644 tools/libxen/src/xen_vtpm.c

diff --git a/tools/libxen/include/xen/api/xen_all.h b/tools/libxen/include/xen/api/xen_all.h
index 52113c7..45ac171 100644
--- a/tools/libxen/include/xen/api/xen_all.h
+++ b/tools/libxen/include/xen/api/xen_all.h
@@ -35,7 +35,6 @@
 #include <xen/api/xen_vm.h>
 #include <xen/api/xen_vm_metrics.h>
 #include <xen/api/xen_vm_power_state.h>
-#include <xen/api/xen_vtpm.h>
 #include <xen/api/xen_xspolicy.h>
 #include <xen/api/xen_cpu_pool.h>
 #endif
diff --git a/tools/libxen/include/xen/api/xen_vm.h b/tools/libxen/include/xen/api/xen_vm.h
index de554fc..8be7d2b 100644
--- a/tools/libxen/include/xen/api/xen_vm.h
+++ b/tools/libxen/include/xen/api/xen_vm.h
@@ -33,7 +33,6 @@
 #include <xen/api/xen_vm_guest_metrics_decl.h>
 #include <xen/api/xen_vm_metrics_decl.h>
 #include <xen/api/xen_vm_power_state.h>
-#include <xen/api/xen_vtpm_decl.h>
 #include <xen/api/xen_cpu_pool_decl.h>
 
 
@@ -98,7 +97,6 @@ typedef struct xen_vm_record
     struct xen_vif_record_opt_set *vifs;
     struct xen_vbd_record_opt_set *vbds;
     struct xen_crashdump_record_opt_set *crash_dumps;
-    struct xen_vtpm_record_opt_set *vtpms;
     char *pv_bootloader;
     char *pv_kernel;
     char *pv_ramdisk;
@@ -396,13 +394,6 @@ xen_vm_get_crash_dumps(xen_session *session, struct xen_crashdump_set **result,
 
 
 /**
- * Get the VTPMs field of the given VM.
- */
-extern bool
-xen_vm_get_vtpms(xen_session *session, struct xen_vtpm_set **result, xen_vm vm);
-
-
-/**
  * Get the PV/bootloader field of the given VM.
  */
 extern bool
diff --git a/tools/libxen/include/xen/api/xen_vtpm.h b/tools/libxen/include/xen/api/xen_vtpm.h
deleted file mode 100644
index 9b3b2eb..0000000
--- a/tools/libxen/include/xen/api/xen_vtpm.h
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- * Copyright (c) 2006, IBM Corp.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * 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
- */
-
-#ifndef XEN_VTPM_H
-#define XEN_VTPM_H
-
-#include <xen/api/xen_common.h>
-#include <xen/api/xen_vm_decl.h>
-#include <xen/api/xen_vtpm_decl.h>
-
-
-/*
- * The VTPM class.
- * 
- * A virtual TPM device.
- */
-
-
-/**
- * Free the given xen_vtpm.  The given handle must have been allocated
- * by this library.
- */
-extern void
-xen_vtpm_free(xen_vtpm vtpm);
-
-
-typedef struct xen_vtpm_set
-{
-    size_t size;
-    xen_vtpm *contents[];
-} xen_vtpm_set;
-
-/**
- * Allocate a xen_vtpm_set of the given size.
- */
-extern xen_vtpm_set *
-xen_vtpm_set_alloc(size_t size);
-
-/**
- * Free the given xen_vtpm_set.  The given set must have been allocated
- * by this library.
- */
-extern void
-xen_vtpm_set_free(xen_vtpm_set *set);
-
-
-typedef struct xen_vtpm_record
-{
-    xen_vtpm handle;
-    char *uuid;
-    struct xen_vm_record_opt *vm;
-    struct xen_vm_record_opt *backend;
-    xen_string_string_map *other_config;
-} xen_vtpm_record;
-
-/**
- * Allocate a xen_vtpm_record.
- */
-extern xen_vtpm_record *
-xen_vtpm_record_alloc(void);
-
-/**
- * Free the given xen_vtpm_record, and all referenced values.  The
- * given record must have been allocated by this library.
- */
-extern void
-xen_vtpm_record_free(xen_vtpm_record *record);
-
-
-typedef struct xen_vtpm_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_vtpm handle;
-        xen_vtpm_record *record;
-    } u;
-} xen_vtpm_record_opt;
-
-/**
- * Allocate a xen_vtpm_record_opt.
- */
-extern xen_vtpm_record_opt *
-xen_vtpm_record_opt_alloc(void);
-
-/**
- * Free the given xen_vtpm_record_opt, and all referenced values.  The
- * given record_opt must have been allocated by this library.
- */
-extern void
-xen_vtpm_record_opt_free(xen_vtpm_record_opt *record_opt);
-
-
-typedef struct xen_vtpm_record_set
-{
-    size_t size;
-    xen_vtpm_record *contents[];
-} xen_vtpm_record_set;
-
-/**
- * Allocate a xen_vtpm_record_set of the given size.
- */
-extern xen_vtpm_record_set *
-xen_vtpm_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_vtpm_record_set, and all referenced values.  The
- * given set must have been allocated by this library.
- */
-extern void
-xen_vtpm_record_set_free(xen_vtpm_record_set *set);
-
-
-
-typedef struct xen_vtpm_record_opt_set
-{
-    size_t size;
-    xen_vtpm_record_opt *contents[];
-} xen_vtpm_record_opt_set;
-
-/**
- * Allocate a xen_vtpm_record_opt_set of the given size.
- */
-extern xen_vtpm_record_opt_set *
-xen_vtpm_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_vtpm_record_opt_set, and all referenced values. 
- * The given set must have been allocated by this library.
- */
-extern void
-xen_vtpm_record_opt_set_free(xen_vtpm_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given VTPM.
- */
-extern bool
-xen_vtpm_get_record(xen_session *session, xen_vtpm_record **result, xen_vtpm vtpm);
-
-
-/**
- * Get a reference to the VTPM instance with the specified UUID.
- */
-extern bool
-xen_vtpm_get_by_uuid(xen_session *session, xen_vtpm *result, char *uuid);
-
-
-/**
- * Create a new VTPM instance, and return its handle.
- */
-extern bool
-xen_vtpm_create(xen_session *session, xen_vtpm *result, xen_vtpm_record *record);
-
-
-/**
- * Destroy the specified VTPM instance.
- */
-extern bool
-xen_vtpm_destroy(xen_session *session, xen_vtpm vtpm);
-
-
-/**
- * Get the uuid field of the given VTPM.
- */
-extern bool
-xen_vtpm_get_uuid(xen_session *session, char **result, xen_vtpm vtpm);
-
-
-/**
- * Get the VM field of the given VTPM.
- */
-extern bool
-xen_vtpm_get_vm(xen_session *session, xen_vm *result, xen_vtpm vtpm);
-
-
-/**
- * Get the backend field of the given VTPM.
- */
-extern bool
-xen_vtpm_get_backend(xen_session *session, xen_vm *result, xen_vtpm vtpm);
-
-
-/**
- * Get the other_config field of the given VTPM.
- */
-extern bool
-xen_vtpm_get_other_config(xen_session *session,
-                          xen_string_string_map **result,
-                          xen_vtpm vtpm);
-
-
-/**
- * Set the other_config field of the given VTPM.
- */
-extern bool
-xen_vtpm_set_other_config(xen_session *session,
-                          xen_vtpm vtpm,
-                          xen_string_string_map *other_config);
-
-
-#endif
diff --git a/tools/libxen/include/xen/api/xen_vtpm_decl.h b/tools/libxen/include/xen/api/xen_vtpm_decl.h
deleted file mode 100644
index 7798e38..0000000
--- a/tools/libxen/include/xen/api/xen_vtpm_decl.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- * Copyright (c) 2006, IBM Corp.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * 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
- */
-
-#ifndef XEN_VTPM_DECL_H
-#define XEN_VTPM_DECL_H
-
-typedef void *xen_vtpm;
-
-struct xen_vtpm_set;
-struct xen_vtpm_record;
-struct xen_vtpm_record_set;
-struct xen_vtpm_record_opt;
-struct xen_vtpm_record_opt_set;
-
-#endif
diff --git a/tools/libxen/src/xen_vm.c b/tools/libxen/src/xen_vm.c
index b762fbe..dcd650c 100644
--- a/tools/libxen/src/xen_vm.c
+++ b/tools/libxen/src/xen_vm.c
@@ -35,7 +35,6 @@
 #include <xen/api/xen_vm.h>
 #include <xen/api/xen_vm_guest_metrics.h>
 #include <xen/api/xen_vm_metrics.h>
-#include <xen/api/xen_vtpm.h>
 #include <xen/api/xen_cpu_pool.h>
 
 
@@ -119,9 +118,6 @@ static const struct_member xen_vm_record_struct_members[] =
         { .key = "crash_dumps",
           .type = &abstract_type_ref_set,
           .offset = offsetof(xen_vm_record, crash_dumps) },
-        { .key = "VTPMs",
-          .type = &abstract_type_ref_set,
-          .offset = offsetof(xen_vm_record, vtpms) },
         { .key = "PV_bootloader",
           .type = &abstract_type_string,
           .offset = offsetof(xen_vm_record, pv_bootloader) },
@@ -203,7 +199,6 @@ xen_vm_record_free(xen_vm_record *record)
     xen_vif_record_opt_set_free(record->vifs);
     xen_vbd_record_opt_set_free(record->vbds);
     xen_crashdump_record_opt_set_free(record->crash_dumps);
-    xen_vtpm_record_opt_set_free(record->vtpms);
     free(record->pv_bootloader);
     free(record->pv_kernel);
     free(record->pv_ramdisk);
@@ -668,23 +663,6 @@ xen_vm_get_crash_dumps(xen_session *session, struct xen_crashdump_set **result,
 
 
 bool
-xen_vm_get_vtpms(xen_session *session, struct xen_vtpm_set **result, xen_vm vm)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vm }
-        };
-
-    abstract_type result_type = abstract_type_string_set;
-
-    *result = NULL;
-    XEN_CALL_("VM.get_VTPMs");
-    return session->ok;
-}
-
-
-bool
 xen_vm_get_pv_bootloader(xen_session *session, char **result, xen_vm vm)
 {
     abstract_value param_values[] =
diff --git a/tools/libxen/src/xen_vtpm.c b/tools/libxen/src/xen_vtpm.c
deleted file mode 100644
index 0ca7b41..0000000
--- a/tools/libxen/src/xen_vtpm.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- * Copyright (c) 2006, IBM Corp.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * 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
- */
-
-
-#include <stddef.h>
-#include <stdlib.h>
-
-#include "xen_internal.h"
-#include <xen/api/xen_common.h>
-#include <xen/api/xen_vm.h>
-#include <xen/api/xen_vtpm.h>
-
-
-XEN_FREE(xen_vtpm)
-XEN_SET_ALLOC_FREE(xen_vtpm)
-XEN_ALLOC(xen_vtpm_record)
-XEN_SET_ALLOC_FREE(xen_vtpm_record)
-XEN_ALLOC(xen_vtpm_record_opt)
-XEN_RECORD_OPT_FREE(xen_vtpm)
-XEN_SET_ALLOC_FREE(xen_vtpm_record_opt)
-
-
-static const struct_member xen_vtpm_record_struct_members[] =
-    {
-        { .key = "uuid",
-          .type = &abstract_type_string,
-          .offset = offsetof(xen_vtpm_record, uuid) },
-        { .key = "VM",
-          .type = &abstract_type_ref,
-          .offset = offsetof(xen_vtpm_record, vm) },
-        { .key = "backend",
-          .type = &abstract_type_ref,
-          .offset = offsetof(xen_vtpm_record, backend) },
-        { .key = "other_config",
-          .type = &abstract_type_string_string_map,
-          .offset = offsetof(xen_vtpm_record, other_config) }
-    };
-
-const abstract_type xen_vtpm_record_abstract_type_ =
-    {
-       .typename = STRUCT,
-       .struct_size = sizeof(xen_vtpm_record),
-       .member_count =
-           sizeof(xen_vtpm_record_struct_members) / sizeof(struct_member),
-       .members = xen_vtpm_record_struct_members
-    };
-
-
-void
-xen_vtpm_record_free(xen_vtpm_record *record)
-{
-    if (record == NULL)
-    {
-        return;
-    }
-    free(record->handle);
-    free(record->uuid);
-    xen_vm_record_opt_free(record->vm);
-    xen_vm_record_opt_free(record->backend);
-    xen_string_string_map_free(record->other_config);
-    free(record);
-}
-
-
-bool
-xen_vtpm_get_record(xen_session *session, xen_vtpm_record **result, xen_vtpm vtpm)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vtpm }
-        };
-
-    abstract_type result_type = xen_vtpm_record_abstract_type_;
-
-    *result = NULL;
-    XEN_CALL_("VTPM.get_record");
-
-    if (session->ok)
-    {
-       (*result)->handle = xen_strdup_((*result)->uuid);
-    }
-
-    return session->ok;
-}
-
-
-bool
-xen_vtpm_get_by_uuid(xen_session *session, xen_vtpm *result, char *uuid)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = uuid }
-        };
-
-    abstract_type result_type = abstract_type_string;
-
-    *result = NULL;
-    XEN_CALL_("VTPM.get_by_uuid");
-    return session->ok;
-}
-
-
-bool
-xen_vtpm_create(xen_session *session, xen_vtpm *result, xen_vtpm_record *record)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &xen_vtpm_record_abstract_type_,
-              .u.struct_val = record }
-        };
-
-    abstract_type result_type = abstract_type_string;
-
-    *result = NULL;
-    XEN_CALL_("VTPM.create");
-    return session->ok;
-}
-
-
-bool
-xen_vtpm_destroy(xen_session *session, xen_vtpm vtpm)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vtpm }
-        };
-
-    xen_call_(session, "VTPM.destroy", param_values, 1, NULL, NULL);
-    return session->ok;
-}
-
-
-bool
-xen_vtpm_get_vm(xen_session *session, xen_vm *result, xen_vtpm vtpm)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vtpm }
-        };
-
-    abstract_type result_type = abstract_type_string;
-
-    *result = NULL;
-    XEN_CALL_("VTPM.get_VM");
-    return session->ok;
-}
-
-
-bool
-xen_vtpm_get_backend(xen_session *session, xen_vm *result, xen_vtpm vtpm)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vtpm }
-        };
-
-    abstract_type result_type = abstract_type_string;
-
-    *result = NULL;
-    XEN_CALL_("VTPM.get_backend");
-    return session->ok;
-}
-
-
-bool
-xen_vtpm_get_uuid(xen_session *session, char **result, xen_vtpm vtpm)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vtpm }
-        };
-
-    abstract_type result_type = abstract_type_string;
-
-    *result = NULL;
-    XEN_CALL_("VTPM.get_uuid");
-    return session->ok;
-}
-
-
-bool
-xen_vtpm_get_other_config(xen_session *session, xen_string_string_map **result,
-                          xen_vtpm vtpm)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vtpm }
-        };
-
-    abstract_type result_type = abstract_type_string_string_map;
-
-    *result = NULL;
-    XEN_CALL_("VTPM.get_other_config");
-    return session->ok;
-}
-
-
-bool
-xen_vtpm_set_other_config(xen_session *session, xen_vtpm vtpm,
-                          xen_string_string_map *other_config)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vtpm },
-            { .type = &abstract_type_string_string_map,
-              .u.set_val = (arbitrary_set *)other_config }
-        };
-
-    xen_call_(session, "VTPM.set_other_config", param_values, 2, NULL, NULL);
-    return session->ok;
-}
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:18:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:18:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1DC-0001eu-Mg; Thu, 15 Nov 2012 15:18:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1D9-0001ca-Rs
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:18:36 +0000
Received: from [85.158.138.51:30656] by server-8.bemta-3.messagelabs.com id
	BD/81-07786-BC705A05; Thu, 15 Nov 2012 15:18:35 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-12.tower-174.messagelabs.com!1352992711!22245427!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD,UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28429 invoked from network); 15 Nov 2012 15:18:32 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-12.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 15:18:32 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187333;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:02 -0500
Message-Id: <1352992629-5850-4-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 03/10] Remove old vtpm support from xm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 docs/man/xm.pod.1                           |   11 ---
 tools/python/README.XendConfig              |    2 -
 tools/python/README.sxpcfg                  |    4 -
 tools/python/scripts/xapi.py                |   20 ----
 tools/python/xen/xend/XendAPI.py            |  128 ------------------------
 tools/python/xen/xend/XendConfig.py         |   19 +---
 tools/python/xen/xend/XendConstants.py      |    8 +-
 tools/python/xen/xend/XendDevices.py        |    4 +-
 tools/python/xen/xend/XendDomainInfo.py     |   29 ------
 tools/python/xen/xend/XendError.py          |    1 -
 tools/python/xen/xend/XendOptions.py        |    4 -
 tools/python/xen/xend/server/tpmif.py       |  141 ---------------------------
 tools/python/xen/xend/tests/xend-config.sxp |    2 -
 tools/python/xen/xm/create.dtd              |    4 -
 tools/python/xen/xm/create.py               |   69 -------------
 tools/python/xen/xm/main.py                 |   37 -------
 tools/python/xen/xm/xenapi_create.py        |   39 --------
 17 files changed, 4 insertions(+), 518 deletions(-)
 delete mode 100644 tools/python/xen/xend/server/tpmif.py

diff --git a/docs/man/xm.pod.1 b/docs/man/xm.pod.1
index 69e1f51..7c4ef85 100644
--- a/docs/man/xm.pod.1
+++ b/docs/man/xm.pod.1
@@ -977,17 +977,6 @@ formatted as a list or as an S-Expression if the B<--long> option was given.
 
 =back
 
-=head2 VIRTUAL TPM DEVICES
-
-=over 4
-
-=item B<vtpm-list> [B<-l>|B<--long>] I<domain-id>
-
-Show the virtual TPM device for a domain.  The returned output is
-formatted as a list or as an S-Expression if the B<--long> option was given.
-
-=back
-
 =head1 SEE ALSO
 
 B<xmdomain.cfg>(5), B<xentop>(1)
diff --git a/tools/python/README.XendConfig b/tools/python/README.XendConfig
index 9cc0ead..338715b 100644
--- a/tools/python/README.XendConfig
+++ b/tools/python/README.XendConfig
@@ -71,8 +71,6 @@ vbds                            !(devices.vbds)
  - io_read_kbs
  - io_write_kbs
 
-tpm_instance                    tpm.instance
-tpm_backend                     tpm.backend
 bios_boot                       image.boot?
 platform_std_VGA                image.stdvga
 platform_serial                 image.serial
diff --git a/tools/python/README.sxpcfg b/tools/python/README.sxpcfg
index 7a17fd1..a4762fe 100644
--- a/tools/python/README.sxpcfg
+++ b/tools/python/README.sxpcfg
@@ -105,10 +105,6 @@ io
   - from
   - to
 
-tpm
-  - pref_instance
-  - instance
-
 pciquirk
   - pci_ids
   - pci_config_space_fields
diff --git a/tools/python/scripts/xapi.py b/tools/python/scripts/xapi.py
index 9530f4a..0997187 100644
--- a/tools/python/scripts/xapi.py
+++ b/tools/python/scripts/xapi.py
@@ -58,7 +58,6 @@ COMMANDS = {
     'vdi-rename': ('<vdi_uuid> <new_name>', 'Rename VDI'),
     'vdi-destroy': ('<vdi_uuid>', 'Delete VDI'),
     'vif-create': ('<domname> <pycfg>', 'Create VIF attached to domname'),
-    'vtpm-create' : ('<domname> <pycfg>', 'Create VTPM attached to domname'),
 
     'vm-create': ('<pycfg>', 'Create VM with python config'),
     'vm-destroy': ('<domname>', 'Delete VM'),
@@ -284,22 +283,16 @@ def xapi_vm_list(args, async = False):
         if is_long:
             vbds = vm_info['VBDs']
             vifs = vm_info['VIFs']
-            vtpms = vm_info['VTPMs']
             vif_infos = []
             vbd_infos = []
-            vtpm_infos = []
             for vbd in vbds:
                 vbd_info = execute(server, 'VBD.get_record', (session, vbd))
                 vbd_infos.append(vbd_info)
             for vif in vifs:
                 vif_info = execute(server, 'VIF.get_record', (session, vif))
                 vif_infos.append(vif_info)
-            for vtpm in vtpms:
-                vtpm_info = execute(server, 'VTPM.get_record', (session, vtpm))
-                vtpm_infos.append(vtpm_info)
             vm_info['VBDs'] = vbd_infos
             vm_info['VIFs'] = vif_infos
-            vm_info['VTPMs'] = vtpm_infos
             pprint(vm_info)
         else:
             print VM_LIST_FORMAT % _stringify(vm_info)
@@ -661,19 +654,6 @@ def xapi_vdi_rename(args, async = False):
         print 'Done.'
 
 
-
-def xapi_vtpm_create(args, async = False):
-    server, session = connect()
-    domname = args[0]
-    cfg = _read_python_cfg(args[1])
-
-    vm_uuid = resolve_vm(server, session, domname)
-    cfg['VM'] = vm_uuid
-    print "Creating vTPM with cfg = %s" % cfg
-    vtpm_uuid = execute(server, 'VTPM.create', (session, cfg))
-    print "Done. (%s)" % vtpm_uuid
-
-
 def xapi_pif_list(args, async = False):
     server, session = connect()
     pif_uuids = execute(server, 'PIF.get_all', (session,))
diff --git a/tools/python/xen/xend/XendAPI.py b/tools/python/xen/xend/XendAPI.py
index 54eec31..359a26b 100644
--- a/tools/python/xen/xend/XendAPI.py
+++ b/tools/python/xen/xend/XendAPI.py
@@ -377,17 +377,6 @@ def valid_vdi(func):
            _check_ref(XendNode.instance().is_valid_vdi,
                       'VDI', func, *args, **kwargs)
 
-def valid_vtpm(func):
-    """Decorator to verify if vtpm_ref is valid before calling method.
-
-    @param func: function with params: (self, session, vtpm_ref, ...)
-    @rtype: callable object
-    """
-    return lambda *args, **kwargs: \
-           _check_ref(lambda r: XendDomain.instance().is_valid_dev('vtpm', r),
-                      'VTPM', func, *args, **kwargs)
-
-
 def valid_console(func):
     """Decorator to verify if console_ref is valid before calling method.
 
@@ -481,7 +470,6 @@ classes = {
     'VIF'          : valid_vif,
     'VIF_metrics'  : valid_vif_metrics,
     'VDI'          : valid_vdi,
-    'VTPM'         : valid_vtpm,
     'console'      : valid_console,
     'SR'           : valid_sr,
     'task'         : valid_task,
@@ -1293,7 +1281,6 @@ class XendAPI(object):
                   'consoles',
                   'VIFs',
                   'VBDs',
-                  'VTPMs',
                   'DPCIs',
                   'DSCSIs',
                   'DSCSI_HBAs',
@@ -1436,10 +1423,6 @@ class XendAPI(object):
         dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
         return xen_api_success(dom.get_vbds())
     
-    def VM_get_VTPMs(self, session, vm_ref):
-        dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
-        return xen_api_success(dom.get_vtpms())
-
     def VM_get_consoles(self, session, vm_ref):
         dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
         return xen_api_success(dom.get_consoles())
@@ -1851,7 +1834,6 @@ class XendAPI(object):
             'consoles': xeninfo.get_consoles(),
             'VIFs': xeninfo.get_vifs(),
             'VBDs': xeninfo.get_vbds(),
-            'VTPMs': xeninfo.get_vtpms(),
             'DPCIs': xeninfo.get_dpcis(),
             'DSCSIs': xeninfo.get_dscsis(),
             'DSCSI_HBAs': xeninfo.get_dscsi_HBAs(),
@@ -2537,116 +2519,6 @@ class XendAPI(object):
         vdi = XendNode.instance().get_vdi_by_uuid(vdi_ref)
         return xen_api_success(vdi.get_security_label())
 
-    # Xen API: Class VTPM
-    # ----------------------------------------------------------------
-
-    VTPM_attr_rw = ['other_config']
-    VTPM_attr_ro = ['VM',
-                    'backend',
-                    'runtime_properties' ]
-
-    VTPM_attr_inst = VTPM_attr_rw
-
-    VTPM_methods = [('destroy', None)]
-    VTPM_funcs = [('create', 'VTPM')]
-
-    def VTPM_get_other_config(self, session, vtpm_ref):
-        xendom = XendDomain.instance()
-        return xen_api_success(xendom.get_dev_property_by_uuid('vtpm',
-                                                               vtpm_ref,
-                                                               'other_config'))
-
-    def VTPM_set_other_config(self, session, vtpm_ref, other_config):
-        xendom = XendDomain.instance()
-        xendom.set_dev_property_by_uuid('vtpm',
-                                        vtpm_ref,
-                                        'other_config',
-                                        other_config)
-        return xen_api_success_void()
-    
-    # object methods
-    def VTPM_get_record(self, session, vtpm_ref):
-        xendom = XendDomain.instance()
-        vm = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
-        if not vm:
-            return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
-        cfg = vm.get_dev_xenapi_config('vtpm', vtpm_ref)
-        if not cfg:
-            return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
-        valid_vtpm_keys = self.VTPM_attr_ro + self.VTPM_attr_rw + \
-                          self.Base_attr_ro + self.Base_attr_rw
-        return_cfg = {}
-        for k in cfg.keys():
-            if k in valid_vtpm_keys:
-                return_cfg[k] = cfg[k]
-
-        return xen_api_success(return_cfg)
-
-    # Class Functions
-    def VTPM_get_backend(self, session, vtpm_ref):
-        xendom = XendDomain.instance()
-        vm = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
-        if not vm:
-            return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
-        cfg = vm.get_dev_xenapi_config('vtpm', vtpm_ref)
-        if not cfg:
-            return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
-        if not cfg.has_key('backend'):
-            return xen_api_error(['INTERNAL_ERROR', 'VTPM backend not set'])
-        return xen_api_success(cfg['backend'])
-
-    def VTPM_get_VM(self, session, vtpm_ref):
-        xendom = XendDomain.instance()
-        return xen_api_success(xendom.get_dev_property_by_uuid('vtpm',
-                                                              vtpm_ref, 'VM'))
-
-    def VTPM_destroy(self, session, vtpm_ref):
-        xendom = XendDomain.instance()
-        dom = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
-        if dom:
-            if dom.state != XEN_API_VM_POWER_STATE_HALTED:
-                vm_ref = dom.get_dev_property('vtpm', vtpm_ref, 'VM')
-                return xen_api_error(['VM_BAD_POWER_STATE', vm_ref,
-                 XendDomain.POWER_STATE_NAMES[XEN_API_VM_POWER_STATE_HALTED],
-                 XendDomain.POWER_STATE_NAMES[dom.state]])
-            from xen.xend.server import tpmif
-            tpmif.destroy_vtpmstate(dom.getName())
-            return xen_api_success_void()
-        else:
-            return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
-
-    # class methods
-    def VTPM_create(self, session, vtpm_struct):
-        xendom = XendDomain.instance()
-        if xendom.is_valid_vm(vtpm_struct['VM']):
-            dom = xendom.get_vm_by_uuid(vtpm_struct['VM'])
-            try:
-                vtpm_ref = dom.create_vtpm(vtpm_struct)
-                xendom.managed_config_save(dom)
-                return xen_api_success(vtpm_ref)
-            except XendError, exn:
-                return xen_api_error(['INTERNAL_ERROR', str(exn)])
-        else:
-            return xen_api_error(['HANDLE_INVALID', 'VM', vtpm_struct['VM']])
-
-    def VTPM_get_all(self, session):
-        xendom = XendDomain.instance()
-        vtpms = [d.get_vtpms() for d in XendDomain.instance().list('all')]
-        vtpms = reduce(lambda x, y: x + y, vtpms)
-        return xen_api_success(vtpms)
-
-    def VTPM_get_runtime_properties(self, _, vtpm_ref):
-        xendom = XendDomain.instance()
-        dominfo = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
-        device = dominfo.get_dev_config_by_uuid('vtpm', vtpm_ref)
-
-        try:
-            device_sxps = dominfo.getDeviceSxprs('vtpm')
-            device_dict = dict(device_sxps[0][1])
-            return xen_api_success(device_dict)
-        except:
-            return xen_api_success({})
-
     # Xen API: Class console
     # ----------------------------------------------------------------
 
diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py
index 9c47e56..497a5f4 100644
--- a/tools/python/xen/xend/XendConfig.py
+++ b/tools/python/xen/xend/XendConfig.py
@@ -417,7 +417,6 @@ class XendConfig(dict):
             'console_refs': [],
             'vif_refs': [],
             'vbd_refs': [],
-            'vtpm_refs': [],
             'other_config': {},
             'platform': {},
             'target': 0,
@@ -937,7 +936,6 @@ class XendConfig(dict):
         self['console_refs'] = cfg.get('console_refs', [])
         self['vif_refs'] = cfg.get('vif_refs', [])
         self['vbd_refs'] = cfg.get('vbd_refs', [])
-        self['vtpm_refs'] = cfg.get('vtpm_refs', [])
 
         # coalesce hvm vnc frame buffer with vfb config
         if self.is_hvm() and int(self['platform'].get('vnc', 0)) != 0:
@@ -1488,7 +1486,7 @@ class XendConfig(dict):
 
             # store dev references by uuid for certain device types
             target['devices'][dev_uuid] = (dev_type, dev_info)
-            if dev_type in ('vif', 'vbd', 'vtpm'):
+            if dev_type in ('vif', 'vbd'):
                 param = '%s_refs' % dev_type
                 if param not in target:
                     target[param] = []
@@ -1630,18 +1628,6 @@ class XendConfig(dict):
                 target['devices'][dev_uuid] = (dev_type, dev_info)
                 target['vbd_refs'].append(dev_uuid)                
 
-            elif dev_type == 'vtpm':
-                if cfg_xenapi.get('type'):
-                    dev_info['type'] = cfg_xenapi.get('type')
-
-                dev_uuid = cfg_xenapi.get('uuid', None)
-                if not dev_uuid:
-                    dev_uuid = uuid.createString()
-                dev_info['uuid'] = dev_uuid
-                dev_info['other_config'] = cfg_xenapi.get('other_config', {})
-                target['devices'][dev_uuid] = (dev_type, dev_info)
-                target['vtpm_refs'].append(dev_uuid)
-
             elif dev_type == 'console':
                 dev_uuid = cfg_xenapi.get('uuid', None)
                 if not dev_uuid:
@@ -2078,8 +2064,7 @@ class XendConfig(dict):
 
         result.extend(target.get('console_refs', []) +
                       target.get('vbd_refs', []) +
-                      target.get('vif_refs', []) +
-                      target.get('vtpm_refs', []))
+                      target.get('vif_refs', []))
 
         result.extend([u for u in target['devices'].keys() if u not in result])
         return result
diff --git a/tools/python/xen/xend/XendConstants.py b/tools/python/xen/xend/XendConstants.py
index c41b0fa..bc1c400 100644
--- a/tools/python/xen/xend/XendConstants.py
+++ b/tools/python/xen/xend/XendConstants.py
@@ -115,7 +115,7 @@ TRIGGER_TYPE = {
 }
 
 #
-# Device migration stages (eg. XendDomainInfo, XendCheckpoint, server.tpmif)
+# Device migration stages (eg. XendDomainInfo, XendCheckpoint)
 #
 
 DEV_MIGRATE_TEST  = 0
@@ -124,12 +124,6 @@ DEV_MIGRATE_STEP2 = 2
 DEV_MIGRATE_STEP3 = 3
 
 #
-# VTPM-related constants
-#
-
-VTPM_DELETE_SCRIPT = auxbin.scripts_dir() + '/vtpm-delete'
-
-#
 # Xenstore Constants
 #
 
diff --git a/tools/python/xen/xend/XendDevices.py b/tools/python/xen/xend/XendDevices.py
index e4585e1..bef4d8a 100644
--- a/tools/python/xen/xend/XendDevices.py
+++ b/tools/python/xen/xend/XendDevices.py
@@ -19,7 +19,7 @@
 # A collection of DevControllers 
 #
 
-from xen.xend.server import blkif, netif, tpmif, pciif, iopif, irqif, vfbif, vscsiif, netif2, vusbif
+from xen.xend.server import blkif, netif, pciif, iopif, irqif, vfbif, vscsiif, netif2, vusbif
 from xen.xend.server.BlktapController import BlktapController, Blktap2Controller
 from xen.xend.server.ConsoleController import ConsoleController
 
@@ -38,7 +38,6 @@ class XendDevices:
         'vbd': blkif.BlkifController,
         'vif': netif.NetifController,
         'vif2': netif2.NetifController2,
-        'vtpm': tpmif.TPMifController,
         'pci': pciif.PciController,
         'ioports': iopif.IOPortsController,
         'irq': irqif.IRQController,
@@ -82,6 +81,5 @@ class XendDevices:
         @type domain: XendDomainInfo
         """
         from xen.xend.XendLogging import log
-        tpmif.destroy_vtpmstate(domain.info.get('vtpm_refs'))
 
     destroy_device_state = classmethod(destroy_device_state)
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
index 456e325..e9d3e7e 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -3908,12 +3908,6 @@ class XendDomainInfo:
             else:
                 config['mode'] = 'RW'
 
-        if dev_class == 'vtpm':
-            if not config.has_key('type'):
-                config['type'] = 'paravirtualised' # TODO
-            if not config.has_key('backend'):
-                config['backend'] = "00000000-0000-0000-0000-000000000000"
-
         return config
 
     def get_dev_property(self, dev_class, dev_uuid, field):
@@ -3945,9 +3939,6 @@ class XendDomainInfo:
     def get_vbds(self):
         return self.info.get('vbd_refs', [])
 
-    def get_vtpms(self):
-        return self.info.get('vtpm_refs', [])
-
     def get_dpcis(self):
         return XendDPCI.get_by_VM(self.info.get('uuid'))
 
@@ -4046,23 +4037,6 @@ class XendDomainInfo:
  
         return dev_uuid
 
-    def create_vtpm(self, xenapi_vtpm):
-        """Create a VTPM device from the passed struct in Xen API format.
-
-        @return: uuid of the device
-        @rtype: string
-        """
-
-        if self._stateGet() not in (DOM_STATE_HALTED,):
-            raise VmError("Can only add vTPM to a halted domain.")
-        if self.get_vtpms() != []:
-            raise VmError('Domain already has a vTPM.')
-        dev_uuid = self.info.device_add('vtpm', cfg_xenapi = xenapi_vtpm)
-        if not dev_uuid:
-            raise XendError('Failed to create device')
-
-        return dev_uuid
-
     def create_console(self, xenapi_console):
         """ Create a console device from a Xen API struct.
 
@@ -4301,9 +4275,6 @@ class XendDomainInfo:
     def destroy_vif(self, dev_uuid):
         self.destroy_device_by_uuid('vif', dev_uuid)
 
-    def destroy_vtpm(self, dev_uuid):
-        self.destroy_device_by_uuid('vtpm', dev_uuid)
-
     def destroy_dpci(self, dev_uuid):
 
         dpci = XendAPIStore.get(dev_uuid, 'DPCI')
diff --git a/tools/python/xen/xend/XendError.py b/tools/python/xen/xend/XendError.py
index 3be0651..d7ec42d 100644
--- a/tools/python/xen/xend/XendError.py
+++ b/tools/python/xen/xend/XendError.py
@@ -246,7 +246,6 @@ XEND_ERROR_UNSUPPORTED           = ('EUNSUPPORTED', 'Method Unsupported')
 XEND_ERROR_VM_INVALID            = ('EVMINVALID', 'VM Invalid')
 XEND_ERROR_VBD_INVALID           = ('EVBDINVALID', 'VBD Invalid')
 XEND_ERROR_VIF_INVALID           = ('EVIFINVALID', 'VIF Invalid')
-XEND_ERROR_VTPM_INVALID          = ('EVTPMINVALID', 'VTPM Invalid')
 XEND_ERROR_VDI_INVALID           = ('EVDIINVALID', 'VDI Invalid')
 XEND_ERROR_SR_INVALID           = ('ESRINVALID', 'SR Invalid')
 XEND_ERROR_XSPOLICY_INVALID      = ('EXSPOLICYINVALID', 'XS Invalid')
diff --git a/tools/python/xen/xend/XendOptions.py b/tools/python/xen/xend/XendOptions.py
index 01287f7..e2651e3 100644
--- a/tools/python/xen/xend/XendOptions.py
+++ b/tools/python/xen/xend/XendOptions.py
@@ -349,10 +349,6 @@ class XendOptions:
         else:
             return None
 
-    def get_external_migration_tool(self):
-        """@return the name of the tool to handle virtual TPM migration."""
-        return self.get_config_string('external-migration-tool', self.external_migration_tool_default)
-
     def get_enable_dump(self):
         return self.get_config_bool('enable-dump', 'no')
 
diff --git a/tools/python/xen/xend/server/tpmif.py b/tools/python/xen/xend/server/tpmif.py
deleted file mode 100644
index 23a10e9..0000000
--- a/tools/python/xen/xend/server/tpmif.py
+++ /dev/null
@@ -1,141 +0,0 @@
-#============================================================================
-# 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) 2004 Mike Wray <mike.wray@hp.com>
-# Copyright (C) 2005 IBM Corporation
-#   Author: Stefan Berger, stefanb@us.ibm.com
-# Copyright (C) 2005 XenSource Ltd
-#============================================================================
-
-"""Support for virtual TPM interfaces."""
-
-from xen.xend import XendOptions
-from xen.xend.XendLogging import log
-from xen.xend.XendError import XendError
-from xen.xend.XendConstants import DEV_MIGRATE_TEST, VTPM_DELETE_SCRIPT
-from xen.xend.server.DevController import DevController
-
-import os
-import re
-
-xoptions = XendOptions.instance()
-
-def destroy_vtpmstate(uuids):
-    if os.path.exists(VTPM_DELETE_SCRIPT):
-        for uuid in uuids:
-            os.system(VTPM_DELETE_SCRIPT + " " + uuid)
-
-class TPMifController(DevController):
-    """TPM interface controller. Handles all TPM devices for a domain.
-    """
-
-    def __init__(self, vm):
-        DevController.__init__(self, vm)
-
-
-    def getDeviceDetails(self, config):
-        """@see DevController.getDeviceDetails"""
-
-        devid = self.allocateDeviceID()
-        inst = int(config.get('pref_instance', -1))
-        if inst == -1:
-            inst = int(config.get('instance', 0))
-
-        typ    = config.get('type')
-        uuid   = config.get('uuid')
-
-        log.info("The domain has a TPM with pref. instance %d and devid %d.",
-                 inst, devid)
-        back  = { 'pref_instance' : "%i" % inst,
-                  'resume'        : "%s" % (self.vm.getResume()) }
-        if typ:
-            back['type'] = typ
-        if uuid:
-            back['uuid'] = uuid
-
-            data = self.vm.info['devices'].get(uuid)
-            if data:
-                other = data[1].get('other_config')
-                if type(other) == dict:
-                    for key, item in other.items():
-                        back['oc_' + key] = item
-
-        front = { 'handle' : "%i" % devid }
-
-        return (devid, back, front)
-
-    def getDeviceConfiguration(self, devid, transaction = None):
-        """Returns the configuration of a device"""
-        result = DevController.getDeviceConfiguration(self, devid, transaction)
-
-        (instance, uuid, type) = \
-                           self.readBackend(devid, 'instance',
-                                                   'uuid',
-                                                   'type')
-
-        if instance:
-            result['instance'] = instance
-        if uuid:
-            result['uuid'] = uuid
-        if type:
-            result['type'] = type
-
-        if uuid:
-            data = self.vm.info['devices'].get(uuid)
-            if data:
-                other = data[1].get('other_config')
-                if other:
-                    result['other_config'] = other
-
-        return result
-
-    def migrate(self, deviceConfig, network, dst, step, domName):
-        """@see DevContoller.migrate"""
-        if network:
-            tool = xoptions.get_external_migration_tool()
-            if tool != '':
-                log.info("Request to network-migrate device to %s. step=%d.",
-                         dst, step)
-
-                if step == DEV_MIGRATE_TEST:
-                    """Assuming for now that everything is ok and migration
-                       with the given tool can proceed.
-                    """
-                    return 0
-                else:
-                    fd = os.popen("%s -type vtpm -step %d -host %s -domname %s" %
-                                  (tool, step, dst, domName),
-                                  'r')
-                    for line in fd.readlines():
-                        mo = re.search('Error', line)
-                        if mo:
-                            raise XendError("vtpm: Fatal error in migration step %d: %s" %
-                                            (step, line))
-                    return 0
-            else:
-                log.debug("External migration tool not in configuration.")
-                return -1
-        return 0
-
-    def recover_migrate(self, deviceConfig, network, dst, step, domName):
-        """@see DevContoller.recover_migrate"""
-        if network:
-            tool = xoptions.get_external_migration_tool()
-            if tool != '':
-                log.info("Request to recover network-migrated device. last good step=%d.",
-                         step)
-                fd = os.popen("%s -type vtpm -step %d -host %s -domname %s -recover" %
-                              (tool, step, dst, domName),
-                              'r')
-        return 0
diff --git a/tools/python/xen/xend/tests/xend-config.sxp b/tools/python/xen/xend/tests/xend-config.sxp
index 0793028..9f26e34 100644
--- a/tools/python/xen/xend/tests/xend-config.sxp
+++ b/tools/python/xen/xend/tests/xend-config.sxp
@@ -127,5 +127,3 @@
 # Whether to enable core-dumps when domains crash.
 #(enable-dump no)
 
-# The tool used for initiating virtual TPM migration
-#(external-migration-tool '')
diff --git a/tools/python/xen/xm/create.dtd b/tools/python/xen/xm/create.dtd
index bc8d314..c91ea90 100644
--- a/tools/python/xen/xm/create.dtd
+++ b/tools/python/xen/xm/create.dtd
@@ -38,7 +38,6 @@
                  memory,
                  vbd*,
                  vif*,
-                 vtpm*,
                  pci*,
                  vscsi*,
                  console*,
@@ -82,9 +81,6 @@
                  network         CDATA       #IMPLIED
                  security_label  CDATA       #IMPLIED>
 
-<!ELEMENT vtpm   (name*)>
-<!ATTLIST vtpm   backend         CDATA #REQUIRED>
-
 <!ELEMENT pci    (pci_opt*)>
 <!ATTLIST pci    domain          CDATA #REQUIRED
                  bus             CDATA #REQUIRED
diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py
index 7bad910..22841aa 100644
--- a/tools/python/xen/xm/create.py
+++ b/tools/python/xen/xm/create.py
@@ -324,10 +324,6 @@ gopts.var('netif', val='no|yes',
           fn=set_bool, default=0,
           use="Make the domain a network interface backend.")
 
-gopts.var('tpmif', val='no|yes',
-          fn=append_value, default=0,
-          use="Make the domain a TPM interface backend.")
-
 gopts.var('disk', val='phy:DEV,VDEV,MODE[,DOM]',
           fn=append_value, default=[],
           use="""Add a disk device to a domain. The physical device is DEV,
@@ -419,20 +415,6 @@ gopts.var('vif2', val="front_mac=MAC,back_mac=MAC,backend=DOM,pdev=PDEV,max_bypa
           and backend MAC addresses.  Randomly generated
           addresses will be used if either address is missing.""")
 
-gopts.var('vtpm', val="instance=INSTANCE,backend=DOM,type=TYPE",
-          fn=append_value, default=[],
-          use="""Add a TPM interface. On the backend side use the given
-          instance as virtual TPM instance. The given number is merely the
-          preferred instance number. The hotplug script will determine
-          which instance number will actually be assigned to the domain.
-          The associtation between virtual machine and the TPM instance
-          number can be found in /etc/xen/vtpm.db. Use the backend in the
-          given domain.
-          The type parameter can be used to select a specific driver type
-          that the VM can use. To prevent a fully virtualized domain (HVM)
-          from being able to access an emulated device model, you may specify
-          'paravirtualized' here.""")
-
 gopts.var('access_control', val="policy=POLICY,label=LABEL",
           fn=append_value, default=[],
           use="""Add a security label and the security policy reference that defines it.
@@ -997,37 +979,6 @@ def configure_mem_prot(config_image, vals):
     """
     config_image.append(['s3_integrity', vals.s3_integrity])
 
-def configure_vtpm(config_devs, vals):
-    """Create the config for virtual TPM interfaces.
-    """
-    vtpm = vals.vtpm
-    if len(vtpm) > 0:
-        d = vtpm[0]
-        instance = d.get('instance')
-        uuid = d.get('uuid')
-        if instance == "VTPMD":
-            instance = "0"
-        else:
-            if instance != None:
-                try:
-                    if int(instance) == 0:
-                        err('VM config error: vTPM instance must not be 0.')
-                except ValueError:
-                    err('Vm config error: could not parse instance number.')
-        backend = d.get('backend')
-        typ = d.get('type')
-        config_vtpm = ['vtpm']
-        if instance:
-            config_vtpm.append(['pref_instance', instance])
-        if backend:
-            config_vtpm.append(['backend', backend])
-        if typ:
-            config_vtpm.append(['type', typ])
-        if uuid:
-            config_vtpm.append(['uuid', uuid])
-        config_devs.append(['device', config_vtpm])
-
-
 def configure_vifs(config_devs, vals):
     """Create the config for virtual network interfaces.
     """
@@ -1160,8 +1111,6 @@ def make_config(vals):
         config.append(['backend', ['blkif']])
     if vals.netif:
         config.append(['backend', ['netif']])
-    if vals.tpmif:
-        config.append(['backend', ['tpmif']])
     if vals.localtime:
         config.append(['localtime', vals.localtime])
     if vals.oos:
@@ -1193,7 +1142,6 @@ def make_config(vals):
     configure_ioports(config_devs, vals)
     configure_irq(config_devs, vals)
     configure_vifs(config_devs, vals)
-    configure_vtpm(config_devs, vals)
     configure_vfbs(config_devs, vals)
     configure_security(config, vals)
     config += config_devs
@@ -1307,22 +1255,6 @@ def preprocess_irq(vals):
         irq.append(d)
     vals.irq = irq
 
-def preprocess_vtpm(vals):
-    if not vals.vtpm: return
-    vtpms = []
-    for vtpm in vals.vtpm:
-        d = {}
-        a = vtpm.split(',')
-        for b in a:
-            (k, v) = b.strip().split('=', 1)
-            k = k.strip()
-            v = v.strip()
-            if k not in ['backend', 'instance', 'uuid']:
-                err('Invalid vtpm specifier: ' + vtpm)
-            d[k] = v
-        vtpms.append(d)
-    vals.vtpm = vtpms
-
 def preprocess_access_control(vals):
     if not vals.access_control:
         return
@@ -1401,7 +1333,6 @@ def preprocess(vals):
     preprocess_ip(vals)
     preprocess_irq(vals)
     preprocess_nfs(vals)
-    preprocess_vtpm(vals)
     preprocess_access_control(vals)
     preprocess_cpuid(vals, 'cpuid')
     preprocess_cpuid(vals, 'cpuid_check')
diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py
index 948d3ce..429c573 100644
--- a/tools/python/xen/xm/main.py
+++ b/tools/python/xen/xm/main.py
@@ -204,7 +204,6 @@ SUBCOMMAND_HELP = {
     'vnet-create'   :  ('<ConfigFile>','Create a vnet from ConfigFile.'),
     'vnet-delete'   :  ('<VnetId>', 'Delete a Vnet.'),
     'vnet-list'     :  ('[-l|--long]', 'List Vnets.'),
-    'vtpm-list'     :  ('<Domain> [--long]', 'List virtual TPM devices.'),
     'pci-attach'    :  ('[-o|--options=<opt>] <Domain> <domain:bus:slot.func> [virtual slot]',
                         'Insert a new pass-through pci device.'),
     'pci-detach'    :  ('<Domain> <domain:bus:slot.func>',
@@ -469,7 +468,6 @@ device_commands = [
     "network2-attach",
     "network2-detach",
     "network2-list",
-    "vtpm-list",
     "pci-attach",
     "pci-detach",
     "pci-list",
@@ -2392,39 +2390,6 @@ def xm_block_list(args):
                    "%(be-path)-30s  "
                    % ni)
 
-def xm_vtpm_list(args):
-    (use_long, params) = arg_check_for_resource_list(args, "vtpm-list")
-
-    dom = params[0]
-
-    if serverType == SERVER_XEN_API:
-        vtpm_refs = server.xenapi.VM.get_VTPMs(get_single_vm(dom))
-        vtpm_properties = \
-            map(server.xenapi.VTPM.get_runtime_properties, vtpm_refs)
-        devs = map(lambda (handle, properties): [handle, map2sxp(properties)],
-                   zip(range(len(vtpm_properties)), vtpm_properties))
-    else:
-        devs = server.xend.domain.getDeviceSxprs(dom, 'vtpm')
-
-    if use_long:
-        map(PrettyPrint.prettyprint, devs)
-    else:
-        hdr = 0
-        for x in devs:
-            if hdr == 0:
-                print 'Idx  BE handle state evt-ch ring-ref BE-path'
-                hdr = 1
-            ni = parse_dev_info(x[1])
-            ni['idx'] = int(x[0])
-            print ("%(idx)-3d   "
-                   "%(backend-id)-3d  "
-                   "%(handle)-3d   "
-                   "%(state)-3d    "
-                   "%(event-ch)-3d    "
-                   "%(ring-ref)-5d "
-                   "%(be-path)-30s  "
-                   % ni)
-
 def attached_pci_dict_bin(dom):
     devs = []
     if serverType == SERVER_XEN_API:
@@ -3854,8 +3819,6 @@ commands = {
     "vnet-list": xm_vnet_list,
     "vnet-create": xm_vnet_create,
     "vnet-delete": xm_vnet_delete,
-    # vtpm
-    "vtpm-list": xm_vtpm_list,
     #pci
     "pci-attach": xm_pci_attach,
     "pci-detach": xm_pci_detach,
diff --git a/tools/python/xen/xm/xenapi_create.py b/tools/python/xen/xm/xenapi_create.py
index 3d526d8..346ff20 100644
--- a/tools/python/xen/xm/xenapi_create.py
+++ b/tools/python/xen/xm/xenapi_create.py
@@ -375,12 +375,6 @@ class xenapi_create:
 
             self.create_vifs(vm_ref, vifs, networks)
 
-            # Now create vtpms
-
-            vtpms = vm.getElementsByTagName("vtpm")
-
-            self.create_vtpms(vm_ref, vtpms)
-
             # Now create consoles
 
             consoles = vm.getElementsByTagName("console")
@@ -488,21 +482,6 @@ 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),
@@ -633,9 +612,6 @@ 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"])
-
         vfbs_sxp = map(lambda x: x[1], [device for device in devices
                                         if device[1][0] == "vfb"])
 
@@ -780,12 +756,6 @@ 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)
-
         # And now the pcis
 
         pcis = self.extract_pcis(pcis_sxp, document)
@@ -923,15 +893,6 @@ 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
-
     def extract_vfb(self, vfb_sxp, document):
 
         vfb = document.createElement("console")
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:18:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:18:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1DC-0001eu-Mg; Thu, 15 Nov 2012 15:18:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1D9-0001ca-Rs
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:18:36 +0000
Received: from [85.158.138.51:30656] by server-8.bemta-3.messagelabs.com id
	BD/81-07786-BC705A05; Thu, 15 Nov 2012 15:18:35 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-12.tower-174.messagelabs.com!1352992711!22245427!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD,UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28429 invoked from network); 15 Nov 2012 15:18:32 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-12.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 15:18:32 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187333;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:02 -0500
Message-Id: <1352992629-5850-4-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 03/10] Remove old vtpm support from xm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 docs/man/xm.pod.1                           |   11 ---
 tools/python/README.XendConfig              |    2 -
 tools/python/README.sxpcfg                  |    4 -
 tools/python/scripts/xapi.py                |   20 ----
 tools/python/xen/xend/XendAPI.py            |  128 ------------------------
 tools/python/xen/xend/XendConfig.py         |   19 +---
 tools/python/xen/xend/XendConstants.py      |    8 +-
 tools/python/xen/xend/XendDevices.py        |    4 +-
 tools/python/xen/xend/XendDomainInfo.py     |   29 ------
 tools/python/xen/xend/XendError.py          |    1 -
 tools/python/xen/xend/XendOptions.py        |    4 -
 tools/python/xen/xend/server/tpmif.py       |  141 ---------------------------
 tools/python/xen/xend/tests/xend-config.sxp |    2 -
 tools/python/xen/xm/create.dtd              |    4 -
 tools/python/xen/xm/create.py               |   69 -------------
 tools/python/xen/xm/main.py                 |   37 -------
 tools/python/xen/xm/xenapi_create.py        |   39 --------
 17 files changed, 4 insertions(+), 518 deletions(-)
 delete mode 100644 tools/python/xen/xend/server/tpmif.py

diff --git a/docs/man/xm.pod.1 b/docs/man/xm.pod.1
index 69e1f51..7c4ef85 100644
--- a/docs/man/xm.pod.1
+++ b/docs/man/xm.pod.1
@@ -977,17 +977,6 @@ formatted as a list or as an S-Expression if the B<--long> option was given.
 
 =back
 
-=head2 VIRTUAL TPM DEVICES
-
-=over 4
-
-=item B<vtpm-list> [B<-l>|B<--long>] I<domain-id>
-
-Show the virtual TPM device for a domain.  The returned output is
-formatted as a list or as an S-Expression if the B<--long> option was given.
-
-=back
-
 =head1 SEE ALSO
 
 B<xmdomain.cfg>(5), B<xentop>(1)
diff --git a/tools/python/README.XendConfig b/tools/python/README.XendConfig
index 9cc0ead..338715b 100644
--- a/tools/python/README.XendConfig
+++ b/tools/python/README.XendConfig
@@ -71,8 +71,6 @@ vbds                            !(devices.vbds)
  - io_read_kbs
  - io_write_kbs
 
-tpm_instance                    tpm.instance
-tpm_backend                     tpm.backend
 bios_boot                       image.boot?
 platform_std_VGA                image.stdvga
 platform_serial                 image.serial
diff --git a/tools/python/README.sxpcfg b/tools/python/README.sxpcfg
index 7a17fd1..a4762fe 100644
--- a/tools/python/README.sxpcfg
+++ b/tools/python/README.sxpcfg
@@ -105,10 +105,6 @@ io
   - from
   - to
 
-tpm
-  - pref_instance
-  - instance
-
 pciquirk
   - pci_ids
   - pci_config_space_fields
diff --git a/tools/python/scripts/xapi.py b/tools/python/scripts/xapi.py
index 9530f4a..0997187 100644
--- a/tools/python/scripts/xapi.py
+++ b/tools/python/scripts/xapi.py
@@ -58,7 +58,6 @@ COMMANDS = {
     'vdi-rename': ('<vdi_uuid> <new_name>', 'Rename VDI'),
     'vdi-destroy': ('<vdi_uuid>', 'Delete VDI'),
     'vif-create': ('<domname> <pycfg>', 'Create VIF attached to domname'),
-    'vtpm-create' : ('<domname> <pycfg>', 'Create VTPM attached to domname'),
 
     'vm-create': ('<pycfg>', 'Create VM with python config'),
     'vm-destroy': ('<domname>', 'Delete VM'),
@@ -284,22 +283,16 @@ def xapi_vm_list(args, async = False):
         if is_long:
             vbds = vm_info['VBDs']
             vifs = vm_info['VIFs']
-            vtpms = vm_info['VTPMs']
             vif_infos = []
             vbd_infos = []
-            vtpm_infos = []
             for vbd in vbds:
                 vbd_info = execute(server, 'VBD.get_record', (session, vbd))
                 vbd_infos.append(vbd_info)
             for vif in vifs:
                 vif_info = execute(server, 'VIF.get_record', (session, vif))
                 vif_infos.append(vif_info)
-            for vtpm in vtpms:
-                vtpm_info = execute(server, 'VTPM.get_record', (session, vtpm))
-                vtpm_infos.append(vtpm_info)
             vm_info['VBDs'] = vbd_infos
             vm_info['VIFs'] = vif_infos
-            vm_info['VTPMs'] = vtpm_infos
             pprint(vm_info)
         else:
             print VM_LIST_FORMAT % _stringify(vm_info)
@@ -661,19 +654,6 @@ def xapi_vdi_rename(args, async = False):
         print 'Done.'
 
 
-
-def xapi_vtpm_create(args, async = False):
-    server, session = connect()
-    domname = args[0]
-    cfg = _read_python_cfg(args[1])
-
-    vm_uuid = resolve_vm(server, session, domname)
-    cfg['VM'] = vm_uuid
-    print "Creating vTPM with cfg = %s" % cfg
-    vtpm_uuid = execute(server, 'VTPM.create', (session, cfg))
-    print "Done. (%s)" % vtpm_uuid
-
-
 def xapi_pif_list(args, async = False):
     server, session = connect()
     pif_uuids = execute(server, 'PIF.get_all', (session,))
diff --git a/tools/python/xen/xend/XendAPI.py b/tools/python/xen/xend/XendAPI.py
index 54eec31..359a26b 100644
--- a/tools/python/xen/xend/XendAPI.py
+++ b/tools/python/xen/xend/XendAPI.py
@@ -377,17 +377,6 @@ def valid_vdi(func):
            _check_ref(XendNode.instance().is_valid_vdi,
                       'VDI', func, *args, **kwargs)
 
-def valid_vtpm(func):
-    """Decorator to verify if vtpm_ref is valid before calling method.
-
-    @param func: function with params: (self, session, vtpm_ref, ...)
-    @rtype: callable object
-    """
-    return lambda *args, **kwargs: \
-           _check_ref(lambda r: XendDomain.instance().is_valid_dev('vtpm', r),
-                      'VTPM', func, *args, **kwargs)
-
-
 def valid_console(func):
     """Decorator to verify if console_ref is valid before calling method.
 
@@ -481,7 +470,6 @@ classes = {
     'VIF'          : valid_vif,
     'VIF_metrics'  : valid_vif_metrics,
     'VDI'          : valid_vdi,
-    'VTPM'         : valid_vtpm,
     'console'      : valid_console,
     'SR'           : valid_sr,
     'task'         : valid_task,
@@ -1293,7 +1281,6 @@ class XendAPI(object):
                   'consoles',
                   'VIFs',
                   'VBDs',
-                  'VTPMs',
                   'DPCIs',
                   'DSCSIs',
                   'DSCSI_HBAs',
@@ -1436,10 +1423,6 @@ class XendAPI(object):
         dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
         return xen_api_success(dom.get_vbds())
     
-    def VM_get_VTPMs(self, session, vm_ref):
-        dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
-        return xen_api_success(dom.get_vtpms())
-
     def VM_get_consoles(self, session, vm_ref):
         dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
         return xen_api_success(dom.get_consoles())
@@ -1851,7 +1834,6 @@ class XendAPI(object):
             'consoles': xeninfo.get_consoles(),
             'VIFs': xeninfo.get_vifs(),
             'VBDs': xeninfo.get_vbds(),
-            'VTPMs': xeninfo.get_vtpms(),
             'DPCIs': xeninfo.get_dpcis(),
             'DSCSIs': xeninfo.get_dscsis(),
             'DSCSI_HBAs': xeninfo.get_dscsi_HBAs(),
@@ -2537,116 +2519,6 @@ class XendAPI(object):
         vdi = XendNode.instance().get_vdi_by_uuid(vdi_ref)
         return xen_api_success(vdi.get_security_label())
 
-    # Xen API: Class VTPM
-    # ----------------------------------------------------------------
-
-    VTPM_attr_rw = ['other_config']
-    VTPM_attr_ro = ['VM',
-                    'backend',
-                    'runtime_properties' ]
-
-    VTPM_attr_inst = VTPM_attr_rw
-
-    VTPM_methods = [('destroy', None)]
-    VTPM_funcs = [('create', 'VTPM')]
-
-    def VTPM_get_other_config(self, session, vtpm_ref):
-        xendom = XendDomain.instance()
-        return xen_api_success(xendom.get_dev_property_by_uuid('vtpm',
-                                                               vtpm_ref,
-                                                               'other_config'))
-
-    def VTPM_set_other_config(self, session, vtpm_ref, other_config):
-        xendom = XendDomain.instance()
-        xendom.set_dev_property_by_uuid('vtpm',
-                                        vtpm_ref,
-                                        'other_config',
-                                        other_config)
-        return xen_api_success_void()
-    
-    # object methods
-    def VTPM_get_record(self, session, vtpm_ref):
-        xendom = XendDomain.instance()
-        vm = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
-        if not vm:
-            return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
-        cfg = vm.get_dev_xenapi_config('vtpm', vtpm_ref)
-        if not cfg:
-            return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
-        valid_vtpm_keys = self.VTPM_attr_ro + self.VTPM_attr_rw + \
-                          self.Base_attr_ro + self.Base_attr_rw
-        return_cfg = {}
-        for k in cfg.keys():
-            if k in valid_vtpm_keys:
-                return_cfg[k] = cfg[k]
-
-        return xen_api_success(return_cfg)
-
-    # Class Functions
-    def VTPM_get_backend(self, session, vtpm_ref):
-        xendom = XendDomain.instance()
-        vm = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
-        if not vm:
-            return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
-        cfg = vm.get_dev_xenapi_config('vtpm', vtpm_ref)
-        if not cfg:
-            return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
-        if not cfg.has_key('backend'):
-            return xen_api_error(['INTERNAL_ERROR', 'VTPM backend not set'])
-        return xen_api_success(cfg['backend'])
-
-    def VTPM_get_VM(self, session, vtpm_ref):
-        xendom = XendDomain.instance()
-        return xen_api_success(xendom.get_dev_property_by_uuid('vtpm',
-                                                              vtpm_ref, 'VM'))
-
-    def VTPM_destroy(self, session, vtpm_ref):
-        xendom = XendDomain.instance()
-        dom = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
-        if dom:
-            if dom.state != XEN_API_VM_POWER_STATE_HALTED:
-                vm_ref = dom.get_dev_property('vtpm', vtpm_ref, 'VM')
-                return xen_api_error(['VM_BAD_POWER_STATE', vm_ref,
-                 XendDomain.POWER_STATE_NAMES[XEN_API_VM_POWER_STATE_HALTED],
-                 XendDomain.POWER_STATE_NAMES[dom.state]])
-            from xen.xend.server import tpmif
-            tpmif.destroy_vtpmstate(dom.getName())
-            return xen_api_success_void()
-        else:
-            return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
-
-    # class methods
-    def VTPM_create(self, session, vtpm_struct):
-        xendom = XendDomain.instance()
-        if xendom.is_valid_vm(vtpm_struct['VM']):
-            dom = xendom.get_vm_by_uuid(vtpm_struct['VM'])
-            try:
-                vtpm_ref = dom.create_vtpm(vtpm_struct)
-                xendom.managed_config_save(dom)
-                return xen_api_success(vtpm_ref)
-            except XendError, exn:
-                return xen_api_error(['INTERNAL_ERROR', str(exn)])
-        else:
-            return xen_api_error(['HANDLE_INVALID', 'VM', vtpm_struct['VM']])
-
-    def VTPM_get_all(self, session):
-        xendom = XendDomain.instance()
-        vtpms = [d.get_vtpms() for d in XendDomain.instance().list('all')]
-        vtpms = reduce(lambda x, y: x + y, vtpms)
-        return xen_api_success(vtpms)
-
-    def VTPM_get_runtime_properties(self, _, vtpm_ref):
-        xendom = XendDomain.instance()
-        dominfo = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
-        device = dominfo.get_dev_config_by_uuid('vtpm', vtpm_ref)
-
-        try:
-            device_sxps = dominfo.getDeviceSxprs('vtpm')
-            device_dict = dict(device_sxps[0][1])
-            return xen_api_success(device_dict)
-        except:
-            return xen_api_success({})
-
     # Xen API: Class console
     # ----------------------------------------------------------------
 
diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py
index 9c47e56..497a5f4 100644
--- a/tools/python/xen/xend/XendConfig.py
+++ b/tools/python/xen/xend/XendConfig.py
@@ -417,7 +417,6 @@ class XendConfig(dict):
             'console_refs': [],
             'vif_refs': [],
             'vbd_refs': [],
-            'vtpm_refs': [],
             'other_config': {},
             'platform': {},
             'target': 0,
@@ -937,7 +936,6 @@ class XendConfig(dict):
         self['console_refs'] = cfg.get('console_refs', [])
         self['vif_refs'] = cfg.get('vif_refs', [])
         self['vbd_refs'] = cfg.get('vbd_refs', [])
-        self['vtpm_refs'] = cfg.get('vtpm_refs', [])
 
         # coalesce hvm vnc frame buffer with vfb config
         if self.is_hvm() and int(self['platform'].get('vnc', 0)) != 0:
@@ -1488,7 +1486,7 @@ class XendConfig(dict):
 
             # store dev references by uuid for certain device types
             target['devices'][dev_uuid] = (dev_type, dev_info)
-            if dev_type in ('vif', 'vbd', 'vtpm'):
+            if dev_type in ('vif', 'vbd'):
                 param = '%s_refs' % dev_type
                 if param not in target:
                     target[param] = []
@@ -1630,18 +1628,6 @@ class XendConfig(dict):
                 target['devices'][dev_uuid] = (dev_type, dev_info)
                 target['vbd_refs'].append(dev_uuid)                
 
-            elif dev_type == 'vtpm':
-                if cfg_xenapi.get('type'):
-                    dev_info['type'] = cfg_xenapi.get('type')
-
-                dev_uuid = cfg_xenapi.get('uuid', None)
-                if not dev_uuid:
-                    dev_uuid = uuid.createString()
-                dev_info['uuid'] = dev_uuid
-                dev_info['other_config'] = cfg_xenapi.get('other_config', {})
-                target['devices'][dev_uuid] = (dev_type, dev_info)
-                target['vtpm_refs'].append(dev_uuid)
-
             elif dev_type == 'console':
                 dev_uuid = cfg_xenapi.get('uuid', None)
                 if not dev_uuid:
@@ -2078,8 +2064,7 @@ class XendConfig(dict):
 
         result.extend(target.get('console_refs', []) +
                       target.get('vbd_refs', []) +
-                      target.get('vif_refs', []) +
-                      target.get('vtpm_refs', []))
+                      target.get('vif_refs', []))
 
         result.extend([u for u in target['devices'].keys() if u not in result])
         return result
diff --git a/tools/python/xen/xend/XendConstants.py b/tools/python/xen/xend/XendConstants.py
index c41b0fa..bc1c400 100644
--- a/tools/python/xen/xend/XendConstants.py
+++ b/tools/python/xen/xend/XendConstants.py
@@ -115,7 +115,7 @@ TRIGGER_TYPE = {
 }
 
 #
-# Device migration stages (eg. XendDomainInfo, XendCheckpoint, server.tpmif)
+# Device migration stages (eg. XendDomainInfo, XendCheckpoint)
 #
 
 DEV_MIGRATE_TEST  = 0
@@ -124,12 +124,6 @@ DEV_MIGRATE_STEP2 = 2
 DEV_MIGRATE_STEP3 = 3
 
 #
-# VTPM-related constants
-#
-
-VTPM_DELETE_SCRIPT = auxbin.scripts_dir() + '/vtpm-delete'
-
-#
 # Xenstore Constants
 #
 
diff --git a/tools/python/xen/xend/XendDevices.py b/tools/python/xen/xend/XendDevices.py
index e4585e1..bef4d8a 100644
--- a/tools/python/xen/xend/XendDevices.py
+++ b/tools/python/xen/xend/XendDevices.py
@@ -19,7 +19,7 @@
 # A collection of DevControllers 
 #
 
-from xen.xend.server import blkif, netif, tpmif, pciif, iopif, irqif, vfbif, vscsiif, netif2, vusbif
+from xen.xend.server import blkif, netif, pciif, iopif, irqif, vfbif, vscsiif, netif2, vusbif
 from xen.xend.server.BlktapController import BlktapController, Blktap2Controller
 from xen.xend.server.ConsoleController import ConsoleController
 
@@ -38,7 +38,6 @@ class XendDevices:
         'vbd': blkif.BlkifController,
         'vif': netif.NetifController,
         'vif2': netif2.NetifController2,
-        'vtpm': tpmif.TPMifController,
         'pci': pciif.PciController,
         'ioports': iopif.IOPortsController,
         'irq': irqif.IRQController,
@@ -82,6 +81,5 @@ class XendDevices:
         @type domain: XendDomainInfo
         """
         from xen.xend.XendLogging import log
-        tpmif.destroy_vtpmstate(domain.info.get('vtpm_refs'))
 
     destroy_device_state = classmethod(destroy_device_state)
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
index 456e325..e9d3e7e 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -3908,12 +3908,6 @@ class XendDomainInfo:
             else:
                 config['mode'] = 'RW'
 
-        if dev_class == 'vtpm':
-            if not config.has_key('type'):
-                config['type'] = 'paravirtualised' # TODO
-            if not config.has_key('backend'):
-                config['backend'] = "00000000-0000-0000-0000-000000000000"
-
         return config
 
     def get_dev_property(self, dev_class, dev_uuid, field):
@@ -3945,9 +3939,6 @@ class XendDomainInfo:
     def get_vbds(self):
         return self.info.get('vbd_refs', [])
 
-    def get_vtpms(self):
-        return self.info.get('vtpm_refs', [])
-
     def get_dpcis(self):
         return XendDPCI.get_by_VM(self.info.get('uuid'))
 
@@ -4046,23 +4037,6 @@ class XendDomainInfo:
  
         return dev_uuid
 
-    def create_vtpm(self, xenapi_vtpm):
-        """Create a VTPM device from the passed struct in Xen API format.
-
-        @return: uuid of the device
-        @rtype: string
-        """
-
-        if self._stateGet() not in (DOM_STATE_HALTED,):
-            raise VmError("Can only add vTPM to a halted domain.")
-        if self.get_vtpms() != []:
-            raise VmError('Domain already has a vTPM.')
-        dev_uuid = self.info.device_add('vtpm', cfg_xenapi = xenapi_vtpm)
-        if not dev_uuid:
-            raise XendError('Failed to create device')
-
-        return dev_uuid
-
     def create_console(self, xenapi_console):
         """ Create a console device from a Xen API struct.
 
@@ -4301,9 +4275,6 @@ class XendDomainInfo:
     def destroy_vif(self, dev_uuid):
         self.destroy_device_by_uuid('vif', dev_uuid)
 
-    def destroy_vtpm(self, dev_uuid):
-        self.destroy_device_by_uuid('vtpm', dev_uuid)
-
     def destroy_dpci(self, dev_uuid):
 
         dpci = XendAPIStore.get(dev_uuid, 'DPCI')
diff --git a/tools/python/xen/xend/XendError.py b/tools/python/xen/xend/XendError.py
index 3be0651..d7ec42d 100644
--- a/tools/python/xen/xend/XendError.py
+++ b/tools/python/xen/xend/XendError.py
@@ -246,7 +246,6 @@ XEND_ERROR_UNSUPPORTED           = ('EUNSUPPORTED', 'Method Unsupported')
 XEND_ERROR_VM_INVALID            = ('EVMINVALID', 'VM Invalid')
 XEND_ERROR_VBD_INVALID           = ('EVBDINVALID', 'VBD Invalid')
 XEND_ERROR_VIF_INVALID           = ('EVIFINVALID', 'VIF Invalid')
-XEND_ERROR_VTPM_INVALID          = ('EVTPMINVALID', 'VTPM Invalid')
 XEND_ERROR_VDI_INVALID           = ('EVDIINVALID', 'VDI Invalid')
 XEND_ERROR_SR_INVALID           = ('ESRINVALID', 'SR Invalid')
 XEND_ERROR_XSPOLICY_INVALID      = ('EXSPOLICYINVALID', 'XS Invalid')
diff --git a/tools/python/xen/xend/XendOptions.py b/tools/python/xen/xend/XendOptions.py
index 01287f7..e2651e3 100644
--- a/tools/python/xen/xend/XendOptions.py
+++ b/tools/python/xen/xend/XendOptions.py
@@ -349,10 +349,6 @@ class XendOptions:
         else:
             return None
 
-    def get_external_migration_tool(self):
-        """@return the name of the tool to handle virtual TPM migration."""
-        return self.get_config_string('external-migration-tool', self.external_migration_tool_default)
-
     def get_enable_dump(self):
         return self.get_config_bool('enable-dump', 'no')
 
diff --git a/tools/python/xen/xend/server/tpmif.py b/tools/python/xen/xend/server/tpmif.py
deleted file mode 100644
index 23a10e9..0000000
--- a/tools/python/xen/xend/server/tpmif.py
+++ /dev/null
@@ -1,141 +0,0 @@
-#============================================================================
-# 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) 2004 Mike Wray <mike.wray@hp.com>
-# Copyright (C) 2005 IBM Corporation
-#   Author: Stefan Berger, stefanb@us.ibm.com
-# Copyright (C) 2005 XenSource Ltd
-#============================================================================
-
-"""Support for virtual TPM interfaces."""
-
-from xen.xend import XendOptions
-from xen.xend.XendLogging import log
-from xen.xend.XendError import XendError
-from xen.xend.XendConstants import DEV_MIGRATE_TEST, VTPM_DELETE_SCRIPT
-from xen.xend.server.DevController import DevController
-
-import os
-import re
-
-xoptions = XendOptions.instance()
-
-def destroy_vtpmstate(uuids):
-    if os.path.exists(VTPM_DELETE_SCRIPT):
-        for uuid in uuids:
-            os.system(VTPM_DELETE_SCRIPT + " " + uuid)
-
-class TPMifController(DevController):
-    """TPM interface controller. Handles all TPM devices for a domain.
-    """
-
-    def __init__(self, vm):
-        DevController.__init__(self, vm)
-
-
-    def getDeviceDetails(self, config):
-        """@see DevController.getDeviceDetails"""
-
-        devid = self.allocateDeviceID()
-        inst = int(config.get('pref_instance', -1))
-        if inst == -1:
-            inst = int(config.get('instance', 0))
-
-        typ    = config.get('type')
-        uuid   = config.get('uuid')
-
-        log.info("The domain has a TPM with pref. instance %d and devid %d.",
-                 inst, devid)
-        back  = { 'pref_instance' : "%i" % inst,
-                  'resume'        : "%s" % (self.vm.getResume()) }
-        if typ:
-            back['type'] = typ
-        if uuid:
-            back['uuid'] = uuid
-
-            data = self.vm.info['devices'].get(uuid)
-            if data:
-                other = data[1].get('other_config')
-                if type(other) == dict:
-                    for key, item in other.items():
-                        back['oc_' + key] = item
-
-        front = { 'handle' : "%i" % devid }
-
-        return (devid, back, front)
-
-    def getDeviceConfiguration(self, devid, transaction = None):
-        """Returns the configuration of a device"""
-        result = DevController.getDeviceConfiguration(self, devid, transaction)
-
-        (instance, uuid, type) = \
-                           self.readBackend(devid, 'instance',
-                                                   'uuid',
-                                                   'type')
-
-        if instance:
-            result['instance'] = instance
-        if uuid:
-            result['uuid'] = uuid
-        if type:
-            result['type'] = type
-
-        if uuid:
-            data = self.vm.info['devices'].get(uuid)
-            if data:
-                other = data[1].get('other_config')
-                if other:
-                    result['other_config'] = other
-
-        return result
-
-    def migrate(self, deviceConfig, network, dst, step, domName):
-        """@see DevContoller.migrate"""
-        if network:
-            tool = xoptions.get_external_migration_tool()
-            if tool != '':
-                log.info("Request to network-migrate device to %s. step=%d.",
-                         dst, step)
-
-                if step == DEV_MIGRATE_TEST:
-                    """Assuming for now that everything is ok and migration
-                       with the given tool can proceed.
-                    """
-                    return 0
-                else:
-                    fd = os.popen("%s -type vtpm -step %d -host %s -domname %s" %
-                                  (tool, step, dst, domName),
-                                  'r')
-                    for line in fd.readlines():
-                        mo = re.search('Error', line)
-                        if mo:
-                            raise XendError("vtpm: Fatal error in migration step %d: %s" %
-                                            (step, line))
-                    return 0
-            else:
-                log.debug("External migration tool not in configuration.")
-                return -1
-        return 0
-
-    def recover_migrate(self, deviceConfig, network, dst, step, domName):
-        """@see DevContoller.recover_migrate"""
-        if network:
-            tool = xoptions.get_external_migration_tool()
-            if tool != '':
-                log.info("Request to recover network-migrated device. last good step=%d.",
-                         step)
-                fd = os.popen("%s -type vtpm -step %d -host %s -domname %s -recover" %
-                              (tool, step, dst, domName),
-                              'r')
-        return 0
diff --git a/tools/python/xen/xend/tests/xend-config.sxp b/tools/python/xen/xend/tests/xend-config.sxp
index 0793028..9f26e34 100644
--- a/tools/python/xen/xend/tests/xend-config.sxp
+++ b/tools/python/xen/xend/tests/xend-config.sxp
@@ -127,5 +127,3 @@
 # Whether to enable core-dumps when domains crash.
 #(enable-dump no)
 
-# The tool used for initiating virtual TPM migration
-#(external-migration-tool '')
diff --git a/tools/python/xen/xm/create.dtd b/tools/python/xen/xm/create.dtd
index bc8d314..c91ea90 100644
--- a/tools/python/xen/xm/create.dtd
+++ b/tools/python/xen/xm/create.dtd
@@ -38,7 +38,6 @@
                  memory,
                  vbd*,
                  vif*,
-                 vtpm*,
                  pci*,
                  vscsi*,
                  console*,
@@ -82,9 +81,6 @@
                  network         CDATA       #IMPLIED
                  security_label  CDATA       #IMPLIED>
 
-<!ELEMENT vtpm   (name*)>
-<!ATTLIST vtpm   backend         CDATA #REQUIRED>
-
 <!ELEMENT pci    (pci_opt*)>
 <!ATTLIST pci    domain          CDATA #REQUIRED
                  bus             CDATA #REQUIRED
diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py
index 7bad910..22841aa 100644
--- a/tools/python/xen/xm/create.py
+++ b/tools/python/xen/xm/create.py
@@ -324,10 +324,6 @@ gopts.var('netif', val='no|yes',
           fn=set_bool, default=0,
           use="Make the domain a network interface backend.")
 
-gopts.var('tpmif', val='no|yes',
-          fn=append_value, default=0,
-          use="Make the domain a TPM interface backend.")
-
 gopts.var('disk', val='phy:DEV,VDEV,MODE[,DOM]',
           fn=append_value, default=[],
           use="""Add a disk device to a domain. The physical device is DEV,
@@ -419,20 +415,6 @@ gopts.var('vif2', val="front_mac=MAC,back_mac=MAC,backend=DOM,pdev=PDEV,max_bypa
           and backend MAC addresses.  Randomly generated
           addresses will be used if either address is missing.""")
 
-gopts.var('vtpm', val="instance=INSTANCE,backend=DOM,type=TYPE",
-          fn=append_value, default=[],
-          use="""Add a TPM interface. On the backend side use the given
-          instance as virtual TPM instance. The given number is merely the
-          preferred instance number. The hotplug script will determine
-          which instance number will actually be assigned to the domain.
-          The associtation between virtual machine and the TPM instance
-          number can be found in /etc/xen/vtpm.db. Use the backend in the
-          given domain.
-          The type parameter can be used to select a specific driver type
-          that the VM can use. To prevent a fully virtualized domain (HVM)
-          from being able to access an emulated device model, you may specify
-          'paravirtualized' here.""")
-
 gopts.var('access_control', val="policy=POLICY,label=LABEL",
           fn=append_value, default=[],
           use="""Add a security label and the security policy reference that defines it.
@@ -997,37 +979,6 @@ def configure_mem_prot(config_image, vals):
     """
     config_image.append(['s3_integrity', vals.s3_integrity])
 
-def configure_vtpm(config_devs, vals):
-    """Create the config for virtual TPM interfaces.
-    """
-    vtpm = vals.vtpm
-    if len(vtpm) > 0:
-        d = vtpm[0]
-        instance = d.get('instance')
-        uuid = d.get('uuid')
-        if instance == "VTPMD":
-            instance = "0"
-        else:
-            if instance != None:
-                try:
-                    if int(instance) == 0:
-                        err('VM config error: vTPM instance must not be 0.')
-                except ValueError:
-                    err('Vm config error: could not parse instance number.')
-        backend = d.get('backend')
-        typ = d.get('type')
-        config_vtpm = ['vtpm']
-        if instance:
-            config_vtpm.append(['pref_instance', instance])
-        if backend:
-            config_vtpm.append(['backend', backend])
-        if typ:
-            config_vtpm.append(['type', typ])
-        if uuid:
-            config_vtpm.append(['uuid', uuid])
-        config_devs.append(['device', config_vtpm])
-
-
 def configure_vifs(config_devs, vals):
     """Create the config for virtual network interfaces.
     """
@@ -1160,8 +1111,6 @@ def make_config(vals):
         config.append(['backend', ['blkif']])
     if vals.netif:
         config.append(['backend', ['netif']])
-    if vals.tpmif:
-        config.append(['backend', ['tpmif']])
     if vals.localtime:
         config.append(['localtime', vals.localtime])
     if vals.oos:
@@ -1193,7 +1142,6 @@ def make_config(vals):
     configure_ioports(config_devs, vals)
     configure_irq(config_devs, vals)
     configure_vifs(config_devs, vals)
-    configure_vtpm(config_devs, vals)
     configure_vfbs(config_devs, vals)
     configure_security(config, vals)
     config += config_devs
@@ -1307,22 +1255,6 @@ def preprocess_irq(vals):
         irq.append(d)
     vals.irq = irq
 
-def preprocess_vtpm(vals):
-    if not vals.vtpm: return
-    vtpms = []
-    for vtpm in vals.vtpm:
-        d = {}
-        a = vtpm.split(',')
-        for b in a:
-            (k, v) = b.strip().split('=', 1)
-            k = k.strip()
-            v = v.strip()
-            if k not in ['backend', 'instance', 'uuid']:
-                err('Invalid vtpm specifier: ' + vtpm)
-            d[k] = v
-        vtpms.append(d)
-    vals.vtpm = vtpms
-
 def preprocess_access_control(vals):
     if not vals.access_control:
         return
@@ -1401,7 +1333,6 @@ def preprocess(vals):
     preprocess_ip(vals)
     preprocess_irq(vals)
     preprocess_nfs(vals)
-    preprocess_vtpm(vals)
     preprocess_access_control(vals)
     preprocess_cpuid(vals, 'cpuid')
     preprocess_cpuid(vals, 'cpuid_check')
diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py
index 948d3ce..429c573 100644
--- a/tools/python/xen/xm/main.py
+++ b/tools/python/xen/xm/main.py
@@ -204,7 +204,6 @@ SUBCOMMAND_HELP = {
     'vnet-create'   :  ('<ConfigFile>','Create a vnet from ConfigFile.'),
     'vnet-delete'   :  ('<VnetId>', 'Delete a Vnet.'),
     'vnet-list'     :  ('[-l|--long]', 'List Vnets.'),
-    'vtpm-list'     :  ('<Domain> [--long]', 'List virtual TPM devices.'),
     'pci-attach'    :  ('[-o|--options=<opt>] <Domain> <domain:bus:slot.func> [virtual slot]',
                         'Insert a new pass-through pci device.'),
     'pci-detach'    :  ('<Domain> <domain:bus:slot.func>',
@@ -469,7 +468,6 @@ device_commands = [
     "network2-attach",
     "network2-detach",
     "network2-list",
-    "vtpm-list",
     "pci-attach",
     "pci-detach",
     "pci-list",
@@ -2392,39 +2390,6 @@ def xm_block_list(args):
                    "%(be-path)-30s  "
                    % ni)
 
-def xm_vtpm_list(args):
-    (use_long, params) = arg_check_for_resource_list(args, "vtpm-list")
-
-    dom = params[0]
-
-    if serverType == SERVER_XEN_API:
-        vtpm_refs = server.xenapi.VM.get_VTPMs(get_single_vm(dom))
-        vtpm_properties = \
-            map(server.xenapi.VTPM.get_runtime_properties, vtpm_refs)
-        devs = map(lambda (handle, properties): [handle, map2sxp(properties)],
-                   zip(range(len(vtpm_properties)), vtpm_properties))
-    else:
-        devs = server.xend.domain.getDeviceSxprs(dom, 'vtpm')
-
-    if use_long:
-        map(PrettyPrint.prettyprint, devs)
-    else:
-        hdr = 0
-        for x in devs:
-            if hdr == 0:
-                print 'Idx  BE handle state evt-ch ring-ref BE-path'
-                hdr = 1
-            ni = parse_dev_info(x[1])
-            ni['idx'] = int(x[0])
-            print ("%(idx)-3d   "
-                   "%(backend-id)-3d  "
-                   "%(handle)-3d   "
-                   "%(state)-3d    "
-                   "%(event-ch)-3d    "
-                   "%(ring-ref)-5d "
-                   "%(be-path)-30s  "
-                   % ni)
-
 def attached_pci_dict_bin(dom):
     devs = []
     if serverType == SERVER_XEN_API:
@@ -3854,8 +3819,6 @@ commands = {
     "vnet-list": xm_vnet_list,
     "vnet-create": xm_vnet_create,
     "vnet-delete": xm_vnet_delete,
-    # vtpm
-    "vtpm-list": xm_vtpm_list,
     #pci
     "pci-attach": xm_pci_attach,
     "pci-detach": xm_pci_detach,
diff --git a/tools/python/xen/xm/xenapi_create.py b/tools/python/xen/xm/xenapi_create.py
index 3d526d8..346ff20 100644
--- a/tools/python/xen/xm/xenapi_create.py
+++ b/tools/python/xen/xm/xenapi_create.py
@@ -375,12 +375,6 @@ class xenapi_create:
 
             self.create_vifs(vm_ref, vifs, networks)
 
-            # Now create vtpms
-
-            vtpms = vm.getElementsByTagName("vtpm")
-
-            self.create_vtpms(vm_ref, vtpms)
-
             # Now create consoles
 
             consoles = vm.getElementsByTagName("console")
@@ -488,21 +482,6 @@ 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),
@@ -633,9 +612,6 @@ 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"])
-
         vfbs_sxp = map(lambda x: x[1], [device for device in devices
                                         if device[1][0] == "vfb"])
 
@@ -780,12 +756,6 @@ 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)
-
         # And now the pcis
 
         pcis = self.extract_pcis(pcis_sxp, document)
@@ -923,15 +893,6 @@ 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
-
     def extract_vfb(self, vfb_sxp, document):
 
         vfb = document.createElement("console")
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:18:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:18:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1DB-0001dW-1L; Thu, 15 Nov 2012 15:18:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1D8-0001br-Vj
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:18:35 +0000
Received: from [85.158.138.51:30469] by server-11.bemta-3.messagelabs.com id
	50/13-19361-AC705A05; Thu, 15 Nov 2012 15:18:34 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352992711!22085910!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8575 invoked from network); 15 Nov 2012 15:18:32 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-3.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 15:18:32 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187347;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:09 -0500
Message-Id: <1352992629-5850-11-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 10/10] vtpm/vtpmmgr and required libs to
	stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add 3 new libraries to stubdom:
libgmp
polarssl
Berlios TPM Emulator 0.7.4

Also adds makefile structure for vtpm-stubdom and vtpmmgrdom

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/Makefile           |  138 +++++++++++++++++++++++++++++++++++++++++++-
 stubdom/polarssl.patch     |   64 ++++++++++++++++++++
 stubdom/tpmemu-0.7.4.patch |   12 ++++
 3 files changed, 211 insertions(+), 3 deletions(-)
 create mode 100644 stubdom/polarssl.patch
 create mode 100644 stubdom/tpmemu-0.7.4.patch

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 50ba360..fc70d88 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -31,6 +31,18 @@ GRUB_VERSION=0.97
 OCAML_URL?=http://caml.inria.fr/pub/distrib/ocaml-3.11
 OCAML_VERSION=3.11.0
 
+GMP_VERSION=4.3.2
+GMP_URL?=$(XEN_EXTFILES_URL)
+#GMP_URL?=ftp://ftp.gmplib.org/pub/gmp-$(GMP_VERSION)
+
+POLARSSL_VERSION=1.1.4
+POLARSSL_URL?=$(XEN_EXTFILES_URL)
+#POLARSSL_URL?=http://polarssl.org/code/releases
+
+TPMEMU_VERSION=0.7.4
+TPMEMU_URL?=$(XEN_EXTFILES_URL)
+#TPMEMU_URL?=http://download.berlios.de/tpm-emulator
+
 WGET=wget -c
 
 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
@@ -74,12 +86,12 @@ TARGET_CPPFLAGS += -I$(XEN_ROOT)/xen/include
 
 TARGET_LDFLAGS += -nostdlib -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
 
-TARGETS=ioemu c caml grub xenstore
+TARGETS=ioemu c caml grub xenstore vtpm vtpmmgr
 
 .PHONY: all
 all: build
 ifeq ($(STUBDOM_SUPPORTED),1)
-build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom
+build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom vtpm-stubdom vtpmmgrdom
 else
 build: genpath
 endif
@@ -176,6 +188,76 @@ lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
 	touch $@
 
 #############
+# cross-gmp
+#############
+gmp-$(GMP_VERSION).tar.bz2:
+	$(WGET) $(GMP_URL)/$@
+
+.PHONY: cross-gmp
+ifeq ($(XEN_TARGET_ARCH), x86_32)
+   GMPEXT=ABI=32
+endif
+gmp-$(XEN_TARGET_ARCH): gmp-$(GMP_VERSION).tar.bz2 $(NEWLIB_STAMPFILE)
+	tar xjf $<
+	mv gmp-$(GMP_VERSION) $@
+	#patch -d $@ -p0 < gmp.patch
+	cd $@; CPPFLAGS="-isystem $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include $(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" CC=$(CC) $(GMPEXT) ./configure --disable-shared --enable-static --disable-fft --without-readline --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf
+	sed -i 's/#define HAVE_OBSTACK_VPRINTF 1/\/\/#define HAVE_OBSTACK_VPRINTF 1/' $@/config.h
+	touch $@
+
+GMP_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libgmp.a
+cross-gmp: $(GMP_STAMPFILE)
+$(GMP_STAMPFILE): gmp-$(XEN_TARGET_ARCH)
+	( cd $< && \
+	  $(MAKE) && \
+	  $(MAKE) install )
+
+#############
+# cross-polarssl
+#############
+polarssl-$(POLARSSL_VERSION)-gpl.tgz:
+	$(WGET) $(POLARSSL_URL)/$@
+
+polarssl-$(XEN_TARGET_ARCH): polarssl-$(POLARSSL_VERSION)-gpl.tgz
+	tar xzf $<
+	mv polarssl-$(POLARSSL_VERSION) $@
+	patch -d $@ -p1 < polarssl.patch
+	touch $@
+
+POLARSSL_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libpolarssl.a
+cross-polarssl: $(POLARSSL_STAMPFILE)
+$(POLARSSL_STAMPFILE): polarssl-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) lwip-$(XEN_TARGET_ARCH)
+	 ( cd $</library && \
+	   make CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I $(realpath $(MINI_OS)/include)" && \
+	   mkdir -p $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include && \
+	   cp -r ../include/* $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include && \
+	   mkdir -p $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib && \
+	   $(INSTALL_DATA) libpolarssl.a $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ )
+
+#############
+# cross-tpmemu
+#############
+tpm_emulator-$(TPMEMU_VERSION).tar.gz:
+	$(WGET) $(TPMEMU_URL)/$@
+
+tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
+	tar xzf $<
+	mv tpm_emulator-$(TPMEMU_VERSION) $@
+	patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
+	mkdir $@/build
+	cd $@/build; cmake .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
+	touch $@
+
+TPMEMU_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm.a
+$(TPMEMU_STAMPFILE): tpm_emulator-$(XEN_TARGET_ARCH) $(GMP_STAMPFILE)
+	( cd $</build && make VERBOSE=1 tpm_crypto tpm  )
+	cp $</build/crypto/libtpm_crypto.a $(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm_crypto.a
+	cp $</build/tpm/libtpm.a $(TPMEMU_STAMPFILE)
+
+.PHONY: cross-tpmemu
+cross-tpmemu: $(TPMEMU_STAMPFILE)
+
+#############
 # Cross-ocaml
 #############
 
@@ -319,6 +401,24 @@ c: $(CROSS_ROOT)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
 
 ######
+# VTPM
+######
+
+.PHONY: vtpm
+vtpm: cross-polarssl cross-tpmemu
+	make -C $(MINI_OS) links
+	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+
+######
+# VTPMMGR
+######
+
+.PHONY: vtpmmgr
+vtpmmgr: cross-polarssl
+	make -C $(MINI_OS) links
+	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+
+######
 # Grub
 ######
 
@@ -362,6 +462,14 @@ caml-stubdom: mini-os-$(XEN_TARGET_ARCH)-caml lwip-$(XEN_TARGET_ARCH) libxc cros
 c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxc c
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/c/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS=$(CURDIR)/c/main.a
 
+.PHONY: vtpm-stubdom
+vtpm-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpm vtpm
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpm/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpm/vtpm.a" APP_LDLIBS="-ltpm -ltpm_crypto -lgmp"
+
+.PHONY: vtpmmgrdom
+vtpmmgrdom: mini-os-$(XEN_TARGET_ARCH)-vtpmmgr vtpmmgr
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpmmgr/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpmmgr/vtpmmgr.a" APP_LDLIBS="-lm"
+
 .PHONY: pv-grub
 pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxc grub
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/grub/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a
@@ -375,7 +483,7 @@ xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxc xenstore
 #########
 
 ifeq ($(STUBDOM_SUPPORTED),1)
-install: genpath install-readme install-ioemu install-grub install-xenstore
+install: genpath install-readme install-ioemu install-grub install-xenstore install-vtpm install-vtpmmgr
 else
 install: genpath
 endif
@@ -399,6 +507,14 @@ install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/boot"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/xenstore-stubdom.gz"
 
+install-vtpm: vtpm-stubdom
+	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-vtpm/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpm-stubdom.gz"
+
+install-vtpmmgr: vtpm-stubdom
+	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-vtpmmgr/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpmmgrdom.gz"
+
 #######
 # clean
 #######
@@ -411,8 +527,12 @@ clean:
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-caml
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
+	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
+	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
 	$(MAKE) DESTDIR= -C caml clean
 	$(MAKE) DESTDIR= -C c clean
+	$(MAKE) -C vtpm clean
+	$(MAKE) -C vtpmmgr clean
 	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f $(STUBDOMPATH)
 	[ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
@@ -426,6 +546,10 @@ crossclean: clean
 	rm -fr newlib-$(XEN_TARGET_ARCH)
 	rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH)
 	rm -fr libxc-$(XEN_TARGET_ARCH) ioemu
+	rm -fr gmp-$(XEN_TARGET_ARCH)
+	rm -fr polarssl-$(XEN_TARGET_ARCH)
+	rm -fr openssl-$(XEN_TARGET_ARCH)
+	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -f mk-headers-$(XEN_TARGET_ARCH)
 	rm -fr ocaml-$(XEN_TARGET_ARCH)
 	rm -fr include
@@ -434,6 +558,10 @@ crossclean: clean
 .PHONY: patchclean
 patchclean: crossclean
 	rm -fr newlib-$(NEWLIB_VERSION)
+	rm -fr gmp-$(XEN_TARGET_ARCH)
+	rm -fr polarssl-$(XEN_TARGET_ARCH)
+	rm -fr openssl-$(XEN_TARGET_ARCH)
+	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -fr lwip-$(XEN_TARGET_ARCH)
 	rm -fr grub-upstream
 
@@ -442,10 +570,14 @@ patchclean: crossclean
 downloadclean: patchclean
 	rm -f newlib-$(NEWLIB_VERSION).tar.gz
 	rm -f zlib-$(ZLIB_VERSION).tar.gz
+	rm -f gmp-$(GMP_VERSION).tar.gz
+	rm -f tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	rm -f pciutils-$(LIBPCI_VERSION).tar.bz2
 	rm -f grub-$(GRUB_VERSION).tar.gz
 	rm -f lwip-$(LWIP_VERSION).tar.gz
 	rm -f ocaml-$(OCAML_VERSION).tar.gz
+	rm -f polarssl-$(POLARSSL_VERSION)-gpl.tgz
+	rm -f openssl-$(POLARSSL_VERSION)-gpl.tgz
 
 .PHONY: distclean
 distclean: downloadclean
diff --git a/stubdom/polarssl.patch b/stubdom/polarssl.patch
new file mode 100644
index 0000000..d387d4e
--- /dev/null
+++ b/stubdom/polarssl.patch
@@ -0,0 +1,64 @@
+diff -Naur polarssl-1.1.4/include/polarssl/config.h polarssl-x86_64/include/polarssl/config.h
+--- polarssl-1.1.4/include/polarssl/config.h	2011-12-22 05:06:27.000000000 -0500
++++ polarssl-x86_64/include/polarssl/config.h	2012-10-30 17:18:07.567001000 -0400
+@@ -164,8 +164,8 @@
+  * application.
+  *
+  * Uncomment this macro to prevent loading of default entropy functions.
+-#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
+  */
++#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
+
+ /**
+  * \def POLARSSL_NO_PLATFORM_ENTROPY
+@@ -175,8 +175,8 @@
+  * standards like the /dev/urandom or Windows CryptoAPI.
+  *
+  * Uncomment this macro to disable the built-in platform entropy functions.
+-#define POLARSSL_NO_PLATFORM_ENTROPY
+  */
++#define POLARSSL_NO_PLATFORM_ENTROPY
+
+ /**
+  * \def POLARSSL_PKCS1_V21
+@@ -426,8 +426,8 @@
+  * Requires: POLARSSL_TIMING_C
+  *
+  * This module enables the HAVEGE random number generator.
+- */
+ #define POLARSSL_HAVEGE_C
++ */
+
+ /**
+  * \def POLARSSL_MD_C
+@@ -490,7 +490,7 @@
+  *
+  * This module provides TCP/IP networking routines.
+  */
+-#define POLARSSL_NET_C
++//#define POLARSSL_NET_C
+
+ /**
+  * \def POLARSSL_PADLOCK_C
+@@ -644,8 +644,8 @@
+  * Caller:  library/havege.c
+  *
+  * This module is used by the HAVEGE random number generator.
+- */
+ #define POLARSSL_TIMING_C
++ */
+
+ /**
+  * \def POLARSSL_VERSION_C
+diff -Naur polarssl-1.1.4/library/bignum.c polarssl-x86_64/library/bignum.c
+--- polarssl-1.1.4/library/bignum.c	2012-04-29 16:15:55.000000000 -0400
++++ polarssl-x86_64/library/bignum.c	2012-10-30 17:21:52.135000999 -0400
+@@ -1101,7 +1101,7 @@
+             Z.p[i - t - 1] = ~0;
+         else
+         {
+-#if defined(POLARSSL_HAVE_LONGLONG)
++#if 0 //defined(POLARSSL_HAVE_LONGLONG)
+             t_udbl r;
+
+             r  = (t_udbl) X.p[i] << biL;
diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
new file mode 100644
index 0000000..b84eff1
--- /dev/null
+++ b/stubdom/tpmemu-0.7.4.patch
@@ -0,0 +1,12 @@
+diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
+--- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c	2012-04-27 10:55:46.581963398 -0400
++++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c	2012-04-27 10:56:02.193034152 -0400
+@@ -249,7 +249,7 @@
+ #else /* TPM_NO_EXTERN */
+
+ int (*tpm_extern_init)(void)                                      = NULL;
+-int (*tpm_extern_release)(void)                                   = NULL;
++void (*tpm_extern_release)(void)                                   = NULL;
+ void* (*tpm_malloc)(size_t size)                                  = NULL;
+ void (*tpm_free)(/*const*/ void *ptr)                             = NULL;
+ void (*tpm_log)(int priority, const char *fmt, ...)               = NULL;
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:18:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:18:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1DB-0001dW-1L; Thu, 15 Nov 2012 15:18:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1D8-0001br-Vj
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:18:35 +0000
Received: from [85.158.138.51:30469] by server-11.bemta-3.messagelabs.com id
	50/13-19361-AC705A05; Thu, 15 Nov 2012 15:18:34 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-3.tower-174.messagelabs.com!1352992711!22085910!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8575 invoked from network); 15 Nov 2012 15:18:32 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-3.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 15:18:32 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187347;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:09 -0500
Message-Id: <1352992629-5850-11-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 10/10] vtpm/vtpmmgr and required libs to
	stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add 3 new libraries to stubdom:
libgmp
polarssl
Berlios TPM Emulator 0.7.4

Also adds makefile structure for vtpm-stubdom and vtpmmgrdom

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/Makefile           |  138 +++++++++++++++++++++++++++++++++++++++++++-
 stubdom/polarssl.patch     |   64 ++++++++++++++++++++
 stubdom/tpmemu-0.7.4.patch |   12 ++++
 3 files changed, 211 insertions(+), 3 deletions(-)
 create mode 100644 stubdom/polarssl.patch
 create mode 100644 stubdom/tpmemu-0.7.4.patch

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 50ba360..fc70d88 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -31,6 +31,18 @@ GRUB_VERSION=0.97
 OCAML_URL?=http://caml.inria.fr/pub/distrib/ocaml-3.11
 OCAML_VERSION=3.11.0
 
+GMP_VERSION=4.3.2
+GMP_URL?=$(XEN_EXTFILES_URL)
+#GMP_URL?=ftp://ftp.gmplib.org/pub/gmp-$(GMP_VERSION)
+
+POLARSSL_VERSION=1.1.4
+POLARSSL_URL?=$(XEN_EXTFILES_URL)
+#POLARSSL_URL?=http://polarssl.org/code/releases
+
+TPMEMU_VERSION=0.7.4
+TPMEMU_URL?=$(XEN_EXTFILES_URL)
+#TPMEMU_URL?=http://download.berlios.de/tpm-emulator
+
 WGET=wget -c
 
 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
@@ -74,12 +86,12 @@ TARGET_CPPFLAGS += -I$(XEN_ROOT)/xen/include
 
 TARGET_LDFLAGS += -nostdlib -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
 
-TARGETS=ioemu c caml grub xenstore
+TARGETS=ioemu c caml grub xenstore vtpm vtpmmgr
 
 .PHONY: all
 all: build
 ifeq ($(STUBDOM_SUPPORTED),1)
-build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom
+build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom vtpm-stubdom vtpmmgrdom
 else
 build: genpath
 endif
@@ -176,6 +188,76 @@ lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
 	touch $@
 
 #############
+# cross-gmp
+#############
+gmp-$(GMP_VERSION).tar.bz2:
+	$(WGET) $(GMP_URL)/$@
+
+.PHONY: cross-gmp
+ifeq ($(XEN_TARGET_ARCH), x86_32)
+   GMPEXT=ABI=32
+endif
+gmp-$(XEN_TARGET_ARCH): gmp-$(GMP_VERSION).tar.bz2 $(NEWLIB_STAMPFILE)
+	tar xjf $<
+	mv gmp-$(GMP_VERSION) $@
+	#patch -d $@ -p0 < gmp.patch
+	cd $@; CPPFLAGS="-isystem $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include $(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" CC=$(CC) $(GMPEXT) ./configure --disable-shared --enable-static --disable-fft --without-readline --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf
+	sed -i 's/#define HAVE_OBSTACK_VPRINTF 1/\/\/#define HAVE_OBSTACK_VPRINTF 1/' $@/config.h
+	touch $@
+
+GMP_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libgmp.a
+cross-gmp: $(GMP_STAMPFILE)
+$(GMP_STAMPFILE): gmp-$(XEN_TARGET_ARCH)
+	( cd $< && \
+	  $(MAKE) && \
+	  $(MAKE) install )
+
+#############
+# cross-polarssl
+#############
+polarssl-$(POLARSSL_VERSION)-gpl.tgz:
+	$(WGET) $(POLARSSL_URL)/$@
+
+polarssl-$(XEN_TARGET_ARCH): polarssl-$(POLARSSL_VERSION)-gpl.tgz
+	tar xzf $<
+	mv polarssl-$(POLARSSL_VERSION) $@
+	patch -d $@ -p1 < polarssl.patch
+	touch $@
+
+POLARSSL_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libpolarssl.a
+cross-polarssl: $(POLARSSL_STAMPFILE)
+$(POLARSSL_STAMPFILE): polarssl-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) lwip-$(XEN_TARGET_ARCH)
+	 ( cd $</library && \
+	   make CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I $(realpath $(MINI_OS)/include)" && \
+	   mkdir -p $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include && \
+	   cp -r ../include/* $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include && \
+	   mkdir -p $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib && \
+	   $(INSTALL_DATA) libpolarssl.a $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ )
+
+#############
+# cross-tpmemu
+#############
+tpm_emulator-$(TPMEMU_VERSION).tar.gz:
+	$(WGET) $(TPMEMU_URL)/$@
+
+tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
+	tar xzf $<
+	mv tpm_emulator-$(TPMEMU_VERSION) $@
+	patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
+	mkdir $@/build
+	cd $@/build; cmake .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
+	touch $@
+
+TPMEMU_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm.a
+$(TPMEMU_STAMPFILE): tpm_emulator-$(XEN_TARGET_ARCH) $(GMP_STAMPFILE)
+	( cd $</build && make VERBOSE=1 tpm_crypto tpm  )
+	cp $</build/crypto/libtpm_crypto.a $(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm_crypto.a
+	cp $</build/tpm/libtpm.a $(TPMEMU_STAMPFILE)
+
+.PHONY: cross-tpmemu
+cross-tpmemu: $(TPMEMU_STAMPFILE)
+
+#############
 # Cross-ocaml
 #############
 
@@ -319,6 +401,24 @@ c: $(CROSS_ROOT)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
 
 ######
+# VTPM
+######
+
+.PHONY: vtpm
+vtpm: cross-polarssl cross-tpmemu
+	make -C $(MINI_OS) links
+	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+
+######
+# VTPMMGR
+######
+
+.PHONY: vtpmmgr
+vtpmmgr: cross-polarssl
+	make -C $(MINI_OS) links
+	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+
+######
 # Grub
 ######
 
@@ -362,6 +462,14 @@ caml-stubdom: mini-os-$(XEN_TARGET_ARCH)-caml lwip-$(XEN_TARGET_ARCH) libxc cros
 c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxc c
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/c/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS=$(CURDIR)/c/main.a
 
+.PHONY: vtpm-stubdom
+vtpm-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpm vtpm
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpm/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpm/vtpm.a" APP_LDLIBS="-ltpm -ltpm_crypto -lgmp"
+
+.PHONY: vtpmmgrdom
+vtpmmgrdom: mini-os-$(XEN_TARGET_ARCH)-vtpmmgr vtpmmgr
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpmmgr/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpmmgr/vtpmmgr.a" APP_LDLIBS="-lm"
+
 .PHONY: pv-grub
 pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxc grub
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/grub/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a
@@ -375,7 +483,7 @@ xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxc xenstore
 #########
 
 ifeq ($(STUBDOM_SUPPORTED),1)
-install: genpath install-readme install-ioemu install-grub install-xenstore
+install: genpath install-readme install-ioemu install-grub install-xenstore install-vtpm install-vtpmmgr
 else
 install: genpath
 endif
@@ -399,6 +507,14 @@ install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/boot"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/xenstore-stubdom.gz"
 
+install-vtpm: vtpm-stubdom
+	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-vtpm/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpm-stubdom.gz"
+
+install-vtpmmgr: vtpm-stubdom
+	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-vtpmmgr/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpmmgrdom.gz"
+
 #######
 # clean
 #######
@@ -411,8 +527,12 @@ clean:
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-caml
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
+	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
+	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
 	$(MAKE) DESTDIR= -C caml clean
 	$(MAKE) DESTDIR= -C c clean
+	$(MAKE) -C vtpm clean
+	$(MAKE) -C vtpmmgr clean
 	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f $(STUBDOMPATH)
 	[ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
@@ -426,6 +546,10 @@ crossclean: clean
 	rm -fr newlib-$(XEN_TARGET_ARCH)
 	rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH)
 	rm -fr libxc-$(XEN_TARGET_ARCH) ioemu
+	rm -fr gmp-$(XEN_TARGET_ARCH)
+	rm -fr polarssl-$(XEN_TARGET_ARCH)
+	rm -fr openssl-$(XEN_TARGET_ARCH)
+	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -f mk-headers-$(XEN_TARGET_ARCH)
 	rm -fr ocaml-$(XEN_TARGET_ARCH)
 	rm -fr include
@@ -434,6 +558,10 @@ crossclean: clean
 .PHONY: patchclean
 patchclean: crossclean
 	rm -fr newlib-$(NEWLIB_VERSION)
+	rm -fr gmp-$(XEN_TARGET_ARCH)
+	rm -fr polarssl-$(XEN_TARGET_ARCH)
+	rm -fr openssl-$(XEN_TARGET_ARCH)
+	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -fr lwip-$(XEN_TARGET_ARCH)
 	rm -fr grub-upstream
 
@@ -442,10 +570,14 @@ patchclean: crossclean
 downloadclean: patchclean
 	rm -f newlib-$(NEWLIB_VERSION).tar.gz
 	rm -f zlib-$(ZLIB_VERSION).tar.gz
+	rm -f gmp-$(GMP_VERSION).tar.gz
+	rm -f tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	rm -f pciutils-$(LIBPCI_VERSION).tar.bz2
 	rm -f grub-$(GRUB_VERSION).tar.gz
 	rm -f lwip-$(LWIP_VERSION).tar.gz
 	rm -f ocaml-$(OCAML_VERSION).tar.gz
+	rm -f polarssl-$(POLARSSL_VERSION)-gpl.tgz
+	rm -f openssl-$(POLARSSL_VERSION)-gpl.tgz
 
 .PHONY: distclean
 distclean: downloadclean
diff --git a/stubdom/polarssl.patch b/stubdom/polarssl.patch
new file mode 100644
index 0000000..d387d4e
--- /dev/null
+++ b/stubdom/polarssl.patch
@@ -0,0 +1,64 @@
+diff -Naur polarssl-1.1.4/include/polarssl/config.h polarssl-x86_64/include/polarssl/config.h
+--- polarssl-1.1.4/include/polarssl/config.h	2011-12-22 05:06:27.000000000 -0500
++++ polarssl-x86_64/include/polarssl/config.h	2012-10-30 17:18:07.567001000 -0400
+@@ -164,8 +164,8 @@
+  * application.
+  *
+  * Uncomment this macro to prevent loading of default entropy functions.
+-#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
+  */
++#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
+
+ /**
+  * \def POLARSSL_NO_PLATFORM_ENTROPY
+@@ -175,8 +175,8 @@
+  * standards like the /dev/urandom or Windows CryptoAPI.
+  *
+  * Uncomment this macro to disable the built-in platform entropy functions.
+-#define POLARSSL_NO_PLATFORM_ENTROPY
+  */
++#define POLARSSL_NO_PLATFORM_ENTROPY
+
+ /**
+  * \def POLARSSL_PKCS1_V21
+@@ -426,8 +426,8 @@
+  * Requires: POLARSSL_TIMING_C
+  *
+  * This module enables the HAVEGE random number generator.
+- */
+ #define POLARSSL_HAVEGE_C
++ */
+
+ /**
+  * \def POLARSSL_MD_C
+@@ -490,7 +490,7 @@
+  *
+  * This module provides TCP/IP networking routines.
+  */
+-#define POLARSSL_NET_C
++//#define POLARSSL_NET_C
+
+ /**
+  * \def POLARSSL_PADLOCK_C
+@@ -644,8 +644,8 @@
+  * Caller:  library/havege.c
+  *
+  * This module is used by the HAVEGE random number generator.
+- */
+ #define POLARSSL_TIMING_C
++ */
+
+ /**
+  * \def POLARSSL_VERSION_C
+diff -Naur polarssl-1.1.4/library/bignum.c polarssl-x86_64/library/bignum.c
+--- polarssl-1.1.4/library/bignum.c	2012-04-29 16:15:55.000000000 -0400
++++ polarssl-x86_64/library/bignum.c	2012-10-30 17:21:52.135000999 -0400
+@@ -1101,7 +1101,7 @@
+             Z.p[i - t - 1] = ~0;
+         else
+         {
+-#if defined(POLARSSL_HAVE_LONGLONG)
++#if 0 //defined(POLARSSL_HAVE_LONGLONG)
+             t_udbl r;
+
+             r  = (t_udbl) X.p[i] << biL;
diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
new file mode 100644
index 0000000..b84eff1
--- /dev/null
+++ b/stubdom/tpmemu-0.7.4.patch
@@ -0,0 +1,12 @@
+diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
+--- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c	2012-04-27 10:55:46.581963398 -0400
++++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c	2012-04-27 10:56:02.193034152 -0400
+@@ -249,7 +249,7 @@
+ #else /* TPM_NO_EXTERN */
+
+ int (*tpm_extern_init)(void)                                      = NULL;
+-int (*tpm_extern_release)(void)                                   = NULL;
++void (*tpm_extern_release)(void)                                   = NULL;
+ void* (*tpm_malloc)(size_t size)                                  = NULL;
+ void (*tpm_free)(/*const*/ void *ptr)                             = NULL;
+ void (*tpm_log)(int priority, const char *fmt, ...)               = NULL;
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:18:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:18:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1D9-0001cT-57; Thu, 15 Nov 2012 15:18:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1D8-0001bt-GS
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:18:34 +0000
Received: from [85.158.138.51:2338] by server-16.bemta-3.messagelabs.com id
	03/66-07461-9C705A05; Thu, 15 Nov 2012 15:18:33 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-12.tower-174.messagelabs.com!1352992711!22245426!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28435 invoked from network); 15 Nov 2012 15:18:32 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-12.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 15:18:32 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187339;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:05 -0500
Message-Id: <1352992629-5850-7-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 06/10] Remove tools/vtpm* from
	MAINTAINERS file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 MAINTAINERS |    2 --
 1 file changed, 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 2d8517b..fd45182 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -251,8 +251,6 @@ F:	extras/minios-os/tpm-tis.c
 F:	extras/minios-os/include/tpmfront.h
 F:	extras/minios-os/include/tpmback.h
 F:	extras/minios-os/include/tpm-tis.h
-F:	tools/vtpm/
-F:	tools/vtpm_manager/
 F:	stubdom/vtpm/
 F:	stubdom/vtpmmgr/
 F:	docs/misc/vtpm.txt
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:18:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:18:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1D9-0001cT-57; Thu, 15 Nov 2012 15:18:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1D8-0001bt-GS
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:18:34 +0000
Received: from [85.158.138.51:2338] by server-16.bemta-3.messagelabs.com id
	03/66-07461-9C705A05; Thu, 15 Nov 2012 15:18:33 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-12.tower-174.messagelabs.com!1352992711!22245426!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28435 invoked from network); 15 Nov 2012 15:18:32 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-12.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 15:18:32 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187339;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:05 -0500
Message-Id: <1352992629-5850-7-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 06/10] Remove tools/vtpm* from
	MAINTAINERS file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 MAINTAINERS |    2 --
 1 file changed, 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 2d8517b..fd45182 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -251,8 +251,6 @@ F:	extras/minios-os/tpm-tis.c
 F:	extras/minios-os/include/tpmfront.h
 F:	extras/minios-os/include/tpmback.h
 F:	extras/minios-os/include/tpm-tis.h
-F:	tools/vtpm/
-F:	tools/vtpm_manager/
 F:	stubdom/vtpm/
 F:	stubdom/vtpmmgr/
 F:	docs/misc/vtpm.txt
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:20:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:20:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1El-0002Ib-Eb; Thu, 15 Nov 2012 15:20:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1Ei-0002Hq-BG
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:20:14 +0000
Received: from [193.109.254.147:8686] by server-16.bemta-14.messagelabs.com id
	E1/36-09215-B2805A05; Thu, 15 Nov 2012 15:20:11 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352992652!8430483!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY,UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29480 invoked from network); 15 Nov 2012 15:17:33 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-5.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 15:17:33 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187345;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:08 -0500
Message-Id: <1352992629-5850-10-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 09/10] add stubdom/vtpmmgr code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add the code base for vtpmmgrdom. Makefile changes
next patch.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/vtpmmgr/Makefile           |   32 ++
 stubdom/vtpmmgr/init.c             |  553 +++++++++++++++++++++
 stubdom/vtpmmgr/log.c              |  151 ++++++
 stubdom/vtpmmgr/log.h              |   85 ++++
 stubdom/vtpmmgr/marshal.h          |  528 ++++++++++++++++++++
 stubdom/vtpmmgr/minios.cfg         |   14 +
 stubdom/vtpmmgr/tcg.h              |  707 +++++++++++++++++++++++++++
 stubdom/vtpmmgr/tpm.c              |  938 ++++++++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/tpm.h              |  218 +++++++++
 stubdom/vtpmmgr/tpmrsa.c           |  175 +++++++
 stubdom/vtpmmgr/tpmrsa.h           |   67 +++
 stubdom/vtpmmgr/uuid.h             |   50 ++
 stubdom/vtpmmgr/vtpm_cmd_handler.c |  152 ++++++
 stubdom/vtpmmgr/vtpm_manager.h     |   64 +++
 stubdom/vtpmmgr/vtpm_storage.c     |  783 ++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/vtpm_storage.h     |   68 +++
 stubdom/vtpmmgr/vtpmmgr.c          |   93 ++++
 stubdom/vtpmmgr/vtpmmgr.h          |   77 +++
 18 files changed, 4755 insertions(+)
 create mode 100644 stubdom/vtpmmgr/Makefile
 create mode 100644 stubdom/vtpmmgr/init.c
 create mode 100644 stubdom/vtpmmgr/log.c
 create mode 100644 stubdom/vtpmmgr/log.h
 create mode 100644 stubdom/vtpmmgr/marshal.h
 create mode 100644 stubdom/vtpmmgr/minios.cfg
 create mode 100644 stubdom/vtpmmgr/tcg.h
 create mode 100644 stubdom/vtpmmgr/tpm.c
 create mode 100644 stubdom/vtpmmgr/tpm.h
 create mode 100644 stubdom/vtpmmgr/tpmrsa.c
 create mode 100644 stubdom/vtpmmgr/tpmrsa.h
 create mode 100644 stubdom/vtpmmgr/uuid.h
 create mode 100644 stubdom/vtpmmgr/vtpm_cmd_handler.c
 create mode 100644 stubdom/vtpmmgr/vtpm_manager.h
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.c
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.h
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.c
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.h

diff --git a/stubdom/vtpmmgr/Makefile b/stubdom/vtpmmgr/Makefile
new file mode 100644
index 0000000..88c83c3
--- /dev/null
+++ b/stubdom/vtpmmgr/Makefile
@@ -0,0 +1,32 @@
+# Copyright (c) 2010-2012 United States Government, as represented by
+# the Secretary of Defense.  All rights reserved.
+#
+# THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+# ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+# INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+# DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+# SOFTWARE.
+#
+
+XEN_ROOT=../..
+
+PSSL_DIR=../polarssl-$(XEN_TARGET_ARCH)/library
+PSSL_OBJS=aes.o sha1.o entropy.o ctr_drbg.o bignum.o sha4.o havege.o timing.o entropy_poll.o
+
+TARGET=vtpmmgr.a
+OBJS=vtpmmgr.o vtpm_cmd_handler.o vtpm_storage.o init.o tpmrsa.o tpm.o log.o
+
+CFLAGS+=-Werror -Iutil -Icrypto -Itcs
+CFLAGS+=-Wno-declaration-after-statement -Wno-unused-label
+
+build: $(TARGET)
+$(TARGET): $(OBJS)
+	ar -rcs $@ $^ $(foreach obj,$(PSSL_OBJS),$(PSSL_DIR)/$(obj))
+
+clean:
+	rm -f $(TARGET) $(OBJS)
+
+distclean: clean
+
+.PHONY: clean distclean
diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
new file mode 100644
index 0000000..a158020
--- /dev/null
+++ b/stubdom/vtpmmgr/init.c
@@ -0,0 +1,553 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+#include <stdint.h>
+#include <stdlib.h>
+
+#include <xen/xen.h>
+#include <mini-os/tpmback.h>
+#include <mini-os/tpmfront.h>
+#include <mini-os/tpm_tis.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <polarssl/sha1.h>
+
+#include "log.h"
+#include "vtpmmgr.h"
+#include "vtpm_storage.h"
+#include "tpm.h"
+#include "marshal.h"
+
+struct Opts {
+   enum {
+      TPMDRV_TPM_TIS,
+      TPMDRV_TPMFRONT,
+   } tpmdriver;
+   unsigned long tpmiomem;
+   unsigned int tpmirq;
+   unsigned int tpmlocality;
+   int gen_owner_auth;
+};
+
+// --------------------------- Well Known Auths --------------------------
+const TPM_AUTHDATA WELLKNOWN_SRK_AUTH = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+const TPM_AUTHDATA WELLKNOWN_OWNER_AUTH = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+
+struct vtpm_globals vtpm_globals = {
+   .tpm_fd = -1,
+   .storage_key = TPM_KEY_INIT,
+   .storage_key_handle = 0,
+   .oiap = { .AuthHandle = 0 }
+};
+
+static int tpm_entropy_source(void* dummy, unsigned char* data, size_t len, size_t* olen) {
+   UINT32 sz = len;
+   TPM_RESULT rc = TPM_GetRandom(&sz, data);
+   *olen = sz;
+   return rc == TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
+}
+
+static TPM_RESULT check_tpm_version(void) {
+   TPM_RESULT status;
+   UINT32 rsize;
+   BYTE* res = NULL;
+   TPM_CAP_VERSION_INFO vinfo;
+
+   TPMTRYRETURN(TPM_GetCapability(
+            TPM_CAP_VERSION_VAL,
+            0,
+            NULL,
+            &rsize,
+            &res));
+   if(rsize < 4) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid size returned by GetCapability!\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   unpack_TPM_CAP_VERSION_INFO(res, &vinfo, UNPACK_ALIAS);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Hardware TPM:\n");
+   vtpmloginfo(VTPM_LOG_VTPM, " version: %hhd %hhd %hhd %hhd\n",
+         vinfo.version.major, vinfo.version.minor, vinfo.version.revMajor, vinfo.version.revMinor);
+   vtpmloginfo(VTPM_LOG_VTPM, " specLevel: %hd\n", vinfo.specLevel);
+   vtpmloginfo(VTPM_LOG_VTPM, " errataRev: %hhd\n", vinfo.errataRev);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorID: %c%c%c%c\n",
+         vinfo.tpmVendorID[0], vinfo.tpmVendorID[1],
+         vinfo.tpmVendorID[2], vinfo.tpmVendorID[3]);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecificSize: %hd\n", vinfo.vendorSpecificSize);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecific: ");
+   for(int i = 0; i < vinfo.vendorSpecificSize; ++i) {
+      vtpmloginfomore(VTPM_LOG_VTPM, "%02hhx", vinfo.vendorSpecific[i]);
+   }
+   vtpmloginfomore(VTPM_LOG_VTPM, "\n");
+
+abort_egress:
+   free(res);
+   return status;
+}
+
+static TPM_RESULT flush_tpm(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   const TPM_RESOURCE_TYPE reslist[] = { TPM_RT_KEY, TPM_RT_AUTH, TPM_RT_TRANS, TPM_RT_COUNTER, TPM_RT_DAA_TPM, TPM_RT_CONTEXT };
+   BYTE* keylist = NULL;
+   UINT32 keylistSize;
+   BYTE* ptr;
+
+   //Iterate through each resource type and flush all handles
+   for(int i = 0; i < sizeof(reslist) / sizeof(TPM_RESOURCE_TYPE); ++i) {
+      TPM_RESOURCE_TYPE beres = cpu_to_be32(reslist[i]);
+      UINT16 size;
+      TPMTRYRETURN(TPM_GetCapability(
+               TPM_CAP_HANDLE,
+               sizeof(TPM_RESOURCE_TYPE),
+               (BYTE*)(&beres),
+               &keylistSize,
+               &keylist));
+
+      ptr = keylist;
+      ptr = unpack_UINT16(ptr, &size);
+
+      //Flush each handle
+      if(size) {
+         vtpmloginfo(VTPM_LOG_VTPM, "Flushing %u handle(s) of type %lu\n", size, (unsigned long) reslist[i]);
+         for(int j = 0; j < size; ++j) {
+            TPM_HANDLE h;
+            ptr = unpack_TPM_HANDLE(ptr, &h);
+            TPMTRYRETURN(TPM_FlushSpecific(h, reslist[i]));
+         }
+      }
+
+      free(keylist);
+      keylist = NULL;
+   }
+
+   goto egress;
+abort_egress:
+   free(keylist);
+egress:
+   return status;
+}
+
+
+static TPM_RESULT try_take_ownership(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_PUBKEY pubEK = TPM_PUBKEY_INIT;
+
+   // If we can read PubEK then there is no owner and we should take it.
+   status = TPM_ReadPubek(&pubEK);
+
+   switch(status) {
+      case TPM_DISABLED_CMD:
+         //Cannot read ek? TPM has owner
+         vtpmloginfo(VTPM_LOG_VTPM, "Failed to readEK meaning TPM has an owner. Creating Keys off existing SRK.\n");
+         status = TPM_SUCCESS;
+         break;
+      case TPM_NO_ENDORSEMENT:
+         {
+            //If theres no ek, we have to create one
+            TPM_KEY_PARMS keyInfo = {
+               .algorithmID = TPM_ALG_RSA,
+               .encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1,
+               .sigScheme = TPM_SS_NONE,
+               .parmSize = 12,
+               .parms.rsa = {
+                  .keyLength = RSA_KEY_SIZE,
+                  .numPrimes = 2,
+                  .exponentSize = 0,
+                  .exponent = NULL,
+               },
+            };
+            TPMTRYRETURN(TPM_CreateEndorsementKeyPair(&keyInfo, &pubEK));
+         }
+         //fall through to take ownership
+      case TPM_SUCCESS:
+         {
+            //Construct the Srk
+            TPM_KEY srk = {
+               .ver = TPM_STRUCT_VER_1_1,
+               .keyUsage = TPM_KEY_STORAGE,
+               .keyFlags = 0x00,
+               .authDataUsage = TPM_AUTH_ALWAYS,
+               .algorithmParms = {
+                  .algorithmID = TPM_ALG_RSA,
+                  .encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1,
+                  .sigScheme =  TPM_SS_NONE,
+                  .parmSize = 12,
+                  .parms.rsa = {
+                     .keyLength = RSA_KEY_SIZE,
+                     .numPrimes = 2,
+                     .exponentSize = 0,
+                     .exponent = NULL,
+                  },
+               },
+               .PCRInfoSize = 0,
+               .pubKey = {
+                  .keyLength = 0,
+                  .key = NULL,
+               },
+               .encDataSize = 0,
+            };
+
+            TPMTRYRETURN(TPM_TakeOwnership(
+                     &pubEK,
+                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
+                     (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+                     &srk,
+                     NULL,
+                     &vtpm_globals.oiap));
+
+            TPMTRYRETURN(TPM_DisablePubekRead(
+                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
+                     &vtpm_globals.oiap));
+         }
+         break;
+      default:
+         break;
+   }
+abort_egress:
+   free_TPM_PUBKEY(&pubEK);
+   return status;
+}
+
+static void init_storage_key(TPM_KEY* key) {
+   key->ver.major = 1;
+   key->ver.minor = 1;
+   key->ver.revMajor = 0;
+   key->ver.revMinor = 0;
+
+   key->keyUsage = TPM_KEY_BIND;
+   key->keyFlags = 0;
+   key->authDataUsage = TPM_AUTH_ALWAYS;
+
+   TPM_KEY_PARMS* p = &key->algorithmParms;
+   p->algorithmID = TPM_ALG_RSA;
+   p->encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
+   p->sigScheme = TPM_SS_NONE;
+   p->parmSize = 12;
+
+   TPM_RSA_KEY_PARMS* r = &p->parms.rsa;
+   r->keyLength = RSA_KEY_SIZE;
+   r->numPrimes = 2;
+   r->exponentSize = 0;
+   r->exponent = NULL;
+
+   key->PCRInfoSize = 0;
+   key->encDataSize = 0;
+   key->encData = NULL;
+}
+
+static int parse_auth_string(char* authstr, BYTE* target, const TPM_AUTHDATA wellknown, int allowrandom) {
+   int rc;
+   /* well known owner auth */
+   if(!strcmp(authstr, "well-known")) {
+      memcpy(target, wellknown, sizeof(TPM_AUTHDATA));
+   }
+   /* Create a randomly generated owner auth */
+   else if(allowrandom && !strcmp(authstr, "random")) {
+      return 1;
+   }
+   /* owner auth is a raw hash */
+   else if(!strncmp(authstr, "hash:", 5)) {
+      authstr += 5;
+      if((rc = strlen(authstr)) != 40) {
+         vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth hex string `%s' must be exactly 40 characters (20 bytes) long, length=%d\n", authstr, rc);
+         return -1;
+      }
+      for(int j = 0; j < 20; ++j) {
+         if(sscanf(authstr, "%hhX", target + j) != 1) {
+            vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth string `%s' is not a valid hex string\n", authstr);
+            return -1;
+         }
+         authstr += 2;
+      }
+   }
+   /* owner auth is a string that will be hashed */
+   else if(!strncmp(authstr, "text:", 5)) {
+      authstr += 5;
+      sha1((const unsigned char*)authstr, strlen(authstr), target);
+   }
+   else {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid auth string %s\n", authstr);
+      return -1;
+   }
+
+   return 0;
+}
+
+int parse_cmdline_opts(int argc, char** argv, struct Opts* opts)
+{
+   int rc;
+   int i;
+
+   //Set defaults
+   memcpy(vtpm_globals.owner_auth, WELLKNOWN_OWNER_AUTH, sizeof(TPM_AUTHDATA));
+   memcpy(vtpm_globals.srk_auth, WELLKNOWN_SRK_AUTH, sizeof(TPM_AUTHDATA));
+
+   for(i = 1; i < argc; ++i) {
+      if(!strncmp(argv[i], "owner_auth:", 10)) {
+         if((rc = parse_auth_string(argv[i] + 10, vtpm_globals.owner_auth, WELLKNOWN_OWNER_AUTH, 1)) < 0) {
+            goto err_invalid;
+         }
+         if(rc == 1) {
+            opts->gen_owner_auth = 1;
+         }
+      }
+      else if(!strncmp(argv[i], "srk_auth:", 8)) {
+         if((rc = parse_auth_string(argv[i] + 8, vtpm_globals.srk_auth, WELLKNOWN_SRK_AUTH, 0)) != 0) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmdriver=", 10)) {
+         if(!strcmp(argv[i] + 10, "tpm_tis")) {
+            opts->tpmdriver = TPMDRV_TPM_TIS;
+         } else if(!strcmp(argv[i] + 10, "tpmfront")) {
+            opts->tpmdriver = TPMDRV_TPMFRONT;
+         } else {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmiomem=",9)) {
+         if(sscanf(argv[i] + 9, "0x%lX", &opts->tpmiomem) != 1) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmirq=",7)) {
+         if(!strcmp(argv[i] + 7, "probe")) {
+            opts->tpmirq = TPM_PROBE_IRQ;
+         } else if( sscanf(argv[i] + 7, "%u", &opts->tpmirq) != 1) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmlocality=",12)) {
+         if(sscanf(argv[i] + 12, "%u", &opts->tpmlocality) != 1 || opts->tpmlocality > 4) {
+            goto err_invalid;
+         }
+      }
+   }
+
+   switch(opts->tpmdriver) {
+      case TPMDRV_TPM_TIS:
+         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpm_tis driver\n");
+         break;
+      case TPMDRV_TPMFRONT:
+         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpmfront driver\n");
+         break;
+   }
+
+   return 0;
+err_invalid:
+   vtpmlogerror(VTPM_LOG_VTPM, "Invalid Option %s\n", argv[i]);
+   return -1;
+}
+
+
+
+static TPM_RESULT vtpmmgr_create(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_AUTH_SESSION osap = TPM_AUTH_SESSION_INIT;
+   TPM_AUTHDATA sharedsecret;
+
+   // Take ownership if TPM is unowned
+   TPMTRYRETURN(try_take_ownership());
+
+   // Generate storage key's auth
+   memset(&vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA));
+
+   TPMTRYRETURN( TPM_OSAP(
+            TPM_ET_KEYHANDLE,
+            TPM_SRK_KEYHANDLE,
+            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+            &sharedsecret,
+            &osap) );
+
+   init_storage_key(&vtpm_globals.storage_key);
+
+   //initialize the storage key
+   TPMTRYRETURN( TPM_CreateWrapKey(
+            TPM_SRK_KEYHANDLE,
+            (const TPM_AUTHDATA*)&sharedsecret,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.storage_key,
+            &osap) );
+
+   //Load Storage Key
+   TPMTRYRETURN( TPM_LoadKey(
+            TPM_SRK_KEYHANDLE,
+            &vtpm_globals.storage_key,
+            &vtpm_globals.storage_key_handle,
+            (const TPM_AUTHDATA*) &vtpm_globals.srk_auth,
+            &vtpm_globals.oiap));
+
+   //Make sure TPM has commited changes
+   TPMTRYRETURN( TPM_SaveState() );
+
+   //Create new disk image
+   TPMTRYRETURN(vtpm_storage_new_header());
+
+   goto egress;
+abort_egress:
+egress:
+   vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager\n");
+
+   //End the OSAP session
+   if(osap.AuthHandle) {
+      TPM_TerminateHandle(osap.AuthHandle);
+   }
+
+   return status;
+}
+
+TPM_RESULT vtpmmgr_init(int argc, char** argv) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   /* Default commandline options */
+   struct Opts opts = {
+      .tpmdriver = TPMDRV_TPM_TIS,
+      .tpmiomem = TPM_BASEADDR,
+      .tpmirq = 0,
+      .tpmlocality = 0,
+      .gen_owner_auth = 0,
+   };
+
+   if(parse_cmdline_opts(argc, argv, &opts) != 0) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Command line parsing failed! exiting..\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   //Setup storage system
+   if(vtpm_storage_init() != 0) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize storage subsystem!\n");
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   //Setup tpmback device
+   init_tpmback();
+
+   //Setup tpm access
+   switch(opts.tpmdriver) {
+      case TPMDRV_TPM_TIS:
+         {
+            struct tpm_chip* tpm;
+            if((tpm = init_tpm_tis(opts.tpmiomem, TPM_TIS_LOCL_INT_TO_FLAG(opts.tpmlocality), opts.tpmirq)) == NULL) {
+               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+               status = TPM_IOERROR;
+               goto abort_egress;
+            }
+            vtpm_globals.tpm_fd = tpm_tis_open(tpm);
+            tpm_tis_request_locality(tpm, opts.tpmlocality);
+         }
+         break;
+      case TPMDRV_TPMFRONT:
+         {
+            struct tpmfront_dev* tpmfront_dev;
+            if((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
+               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+               status = TPM_IOERROR;
+               goto abort_egress;
+            }
+            vtpm_globals.tpm_fd = tpmfront_open(tpmfront_dev);
+         }
+         break;
+   }
+
+   //Get the version of the tpm
+   TPMTRYRETURN(check_tpm_version());
+
+   // Blow away all stale handles left in the tpm
+   if(flush_tpm() != TPM_SUCCESS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_FlushResources failed, continuing anyway..\n");
+   }
+
+   /* Initialize the rng */
+   entropy_init(&vtpm_globals.entropy);
+   entropy_add_source(&vtpm_globals.entropy, tpm_entropy_source, NULL, 0);
+   entropy_gather(&vtpm_globals.entropy);
+   ctr_drbg_init(&vtpm_globals.ctr_drbg, entropy_func, &vtpm_globals.entropy, NULL, 0);
+   ctr_drbg_set_prediction_resistance( &vtpm_globals.ctr_drbg, CTR_DRBG_PR_OFF );
+
+   // Generate Auth for Owner
+   if(opts.gen_owner_auth) {
+      vtpmmgr_rand(vtpm_globals.owner_auth, sizeof(TPM_AUTHDATA));
+   }
+
+   // Create OIAP session for service's authorized commands
+   TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
+
+   /* Load the Manager data, if it fails create a new manager */
+   if (vtpm_storage_load_header() != TPM_SUCCESS) {
+      /* If the OIAP session was closed by an error, create a new one */
+      if(vtpm_globals.oiap.AuthHandle == 0) {
+         TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
+      }
+      vtpmloginfo(VTPM_LOG_VTPM, "Failed to read manager file. Assuming first time initialization.\n");
+      TPMTRYRETURN( vtpmmgr_create() );
+   }
+
+   goto egress;
+abort_egress:
+   vtpmmgr_shutdown();
+egress:
+   return status;
+}
+
+void vtpmmgr_shutdown(void)
+{
+   /* Cleanup resources */
+   free_TPM_KEY(&vtpm_globals.storage_key);
+
+   /* Cleanup TPM resources */
+   TPM_EvictKey(vtpm_globals.storage_key_handle);
+   TPM_TerminateHandle(vtpm_globals.oiap.AuthHandle);
+
+   /* Close tpmback */
+   shutdown_tpmback();
+
+   /* Close the storage system and blkfront */
+   vtpm_storage_shutdown();
+
+   /* Close tpmfront/tpm_tis */
+   close(vtpm_globals.tpm_fd);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
+}
diff --git a/stubdom/vtpmmgr/log.c b/stubdom/vtpmmgr/log.c
new file mode 100644
index 0000000..a82c913
--- /dev/null
+++ b/stubdom/vtpmmgr/log.c
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "tcg.h"
+
+char *module_names[] = { "",
+                                "TPM",
+                                "TPM",
+                                "VTPM",
+                                "VTPM",
+                                "TXDATA",
+                              };
+// Helper code for the consts, eg. to produce messages for error codes.
+
+typedef struct error_code_entry_t {
+  TPM_RESULT code;
+  char * code_name;
+  char * msg;
+} error_code_entry_t;
+
+static const error_code_entry_t error_msgs [] = {
+  { TPM_SUCCESS, "TPM_SUCCESS", "Successful completion of the operation" },
+  { TPM_AUTHFAIL, "TPM_AUTHFAIL", "Authentication failed" },
+  { TPM_BADINDEX, "TPM_BADINDEX", "The index to a PCR, DIR or other register is incorrect" },
+  { TPM_BAD_PARAMETER, "TPM_BAD_PARAMETER", "One or more parameter is bad" },
+  { TPM_AUDITFAILURE, "TPM_AUDITFAILURE", "An operation completed successfully but the auditing of that operation failed." },
+  { TPM_CLEAR_DISABLED, "TPM_CLEAR_DISABLED", "The clear disable flag is set and all clear operations now require physical access" },
+  { TPM_DEACTIVATED, "TPM_DEACTIVATED", "The TPM is deactivated" },
+  { TPM_DISABLED, "TPM_DISABLED", "The TPM is disabled" },
+  { TPM_DISABLED_CMD, "TPM_DISABLED_CMD", "The target command has been disabled" },
+  { TPM_FAIL, "TPM_FAIL", "The operation failed" },
+  { TPM_BAD_ORDINAL, "TPM_BAD_ORDINAL", "The ordinal was unknown or inconsistent" },
+  { TPM_INSTALL_DISABLED, "TPM_INSTALL_DISABLED", "The ability to install an owner is disabled" },
+  { TPM_INVALID_KEYHANDLE, "TPM_INVALID_KEYHANDLE", "The key handle presented was invalid" },
+  { TPM_KEYNOTFOUND, "TPM_KEYNOTFOUND", "The target key was not found" },
+  { TPM_INAPPROPRIATE_ENC, "TPM_INAPPROPRIATE_ENC", "Unacceptable encryption scheme" },
+  { TPM_MIGRATEFAIL, "TPM_MIGRATEFAIL", "Migration authorization failed" },
+  { TPM_INVALID_PCR_INFO, "TPM_INVALID_PCR_INFO", "PCR information could not be interpreted" },
+  { TPM_NOSPACE, "TPM_NOSPACE", "No room to load key." },
+  { TPM_NOSRK, "TPM_NOSRK", "There is no SRK set" },
+  { TPM_NOTSEALED_BLOB, "TPM_NOTSEALED_BLOB", "An encrypted blob is invalid or was not created by this TPM" },
+  { TPM_OWNER_SET, "TPM_OWNER_SET", "There is already an Owner" },
+  { TPM_RESOURCES, "TPM_RESOURCES", "The TPM has insufficient internal resources to perform the requested action." },
+  { TPM_SHORTRANDOM, "TPM_SHORTRANDOM", "A random string was too short" },
+  { TPM_SIZE, "TPM_SIZE", "The TPM does not have the space to perform the operation." },
+  { TPM_WRONGPCRVAL, "TPM_WRONGPCRVAL", "The named PCR value does not match the current PCR value." },
+  { TPM_BAD_PARAM_SIZE, "TPM_BAD_PARAM_SIZE", "The paramSize argument to the command has the incorrect value" },
+  { TPM_SHA_THREAD, "TPM_SHA_THREAD", "There is no existing SHA-1 thread." },
+  { TPM_SHA_ERROR, "TPM_SHA_ERROR", "The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error." },
+  { TPM_FAILEDSELFTEST, "TPM_FAILEDSELFTEST", "Self-test has failed and the TPM has shutdown." },
+  { TPM_AUTH2FAIL, "TPM_AUTH2FAIL", "The authorization for the second key in a 2 key function failed authorization" },
+  { TPM_BADTAG, "TPM_BADTAG", "The tag value sent to for a command is invalid" },
+  { TPM_IOERROR, "TPM_IOERROR", "An IO error occurred transmitting information to the TPM" },
+  { TPM_ENCRYPT_ERROR, "TPM_ENCRYPT_ERROR", "The encryption process had a problem." },
+  { TPM_DECRYPT_ERROR, "TPM_DECRYPT_ERROR", "The decryption process did not complete." },
+  { TPM_INVALID_AUTHHANDLE, "TPM_INVALID_AUTHHANDLE", "An invalid handle was used." },
+  { TPM_NO_ENDORSEMENT, "TPM_NO_ENDORSEMENT", "The TPM does not a EK installed" },
+  { TPM_INVALID_KEYUSAGE, "TPM_INVALID_KEYUSAGE", "The usage of a key is not allowed" },
+  { TPM_WRONG_ENTITYTYPE, "TPM_WRONG_ENTITYTYPE", "The submitted entity type is not allowed" },
+  { TPM_INVALID_POSTINIT, "TPM_INVALID_POSTINIT", "The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup" },
+  { TPM_INAPPROPRIATE_SIG, "TPM_INAPPROPRIATE_SIG", "Signed data cannot include additional DER information" },
+  { TPM_BAD_KEY_PROPERTY, "TPM_BAD_KEY_PROPERTY", "The key properties in TPM_KEY_PARMs are not supported by this TPM" },
+
+  { TPM_BAD_MIGRATION, "TPM_BAD_MIGRATION", "The migration properties of this key are incorrect." },
+  { TPM_BAD_SCHEME, "TPM_BAD_SCHEME", "The signature or encryption scheme for this key is incorrect or not permitted in this situation." },
+  { TPM_BAD_DATASIZE, "TPM_BAD_DATASIZE", "The size of the data (or blob) parameter is bad or inconsistent with the referenced key" },
+  { TPM_BAD_MODE, "TPM_BAD_MODE", "A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob." },
+  { TPM_BAD_PRESENCE, "TPM_BAD_PRESENCE", "Either the physicalPresence or physicalPresenceLock bits have the wrong value" },
+  { TPM_BAD_VERSION, "TPM_BAD_VERSION", "The TPM cannot perform this version of the capability" },
+  { TPM_NO_WRAP_TRANSPORT, "TPM_NO_WRAP_TRANSPORT", "The TPM does not allow for wrapped transport sessions" },
+  { TPM_AUDITFAIL_UNSUCCESSFUL, "TPM_AUDITFAIL_UNSUCCESSFUL", "TPM audit construction failed and the underlying command was returning a failure code also" },
+  { TPM_AUDITFAIL_SUCCESSFUL, "TPM_AUDITFAIL_SUCCESSFUL", "TPM audit construction failed and the underlying command was returning success" },
+  { TPM_NOTRESETABLE, "TPM_NOTRESETABLE", "Attempt to reset a PCR register that does not have the resettable attribute" },
+  { TPM_NOTLOCAL, "TPM_NOTLOCAL", "Attempt to reset a PCR register that requires locality and locality modifier not part of command transport" },
+  { TPM_BAD_TYPE, "TPM_BAD_TYPE", "Make identity blob not properly typed" },
+  { TPM_INVALID_RESOURCE, "TPM_INVALID_RESOURCE", "When saving context identified resource type does not match actual resource" },
+  { TPM_NOTFIPS, "TPM_NOTFIPS", "The TPM is attempting to execute a command only available when in FIPS mode" },
+  { TPM_INVALID_FAMILY, "TPM_INVALID_FAMILY", "The command is attempting to use an invalid family ID" },
+  { TPM_NO_NV_PERMISSION, "TPM_NO_NV_PERMISSION", "The permission to manipulate the NV storage is not available" },
+  { TPM_REQUIRES_SIGN, "TPM_REQUIRES_SIGN", "The operation requires a signed command" },
+  { TPM_KEY_NOTSUPPORTED, "TPM_KEY_NOTSUPPORTED", "Wrong operation to load an NV key" },
+  { TPM_AUTH_CONFLICT, "TPM_AUTH_CONFLICT", "NV_LoadKey blob requires both owner and blob authorization" },
+  { TPM_AREA_LOCKED, "TPM_AREA_LOCKED", "The NV area is locked and not writtable" },
+  { TPM_BAD_LOCALITY, "TPM_BAD_LOCALITY", "The locality is incorrect for the attempted operation" },
+  { TPM_READ_ONLY, "TPM_READ_ONLY", "The NV area is read only and can't be written to" },
+  { TPM_PER_NOWRITE, "TPM_PER_NOWRITE", "There is no protection on the write to the NV area" },
+  { TPM_FAMILYCOUNT, "TPM_FAMILYCOUNT", "The family count value does not match" },
+  { TPM_WRITE_LOCKED, "TPM_WRITE_LOCKED", "The NV area has already been written to" },
+  { TPM_BAD_ATTRIBUTES, "TPM_BAD_ATTRIBUTES", "The NV area attributes conflict" },
+  { TPM_INVALID_STRUCTURE, "TPM_INVALID_STRUCTURE", "The structure tag and version are invalid or inconsistent" },
+  { TPM_KEY_OWNER_CONTROL, "TPM_KEY_OWNER_CONTROL", "The key is under control of the TPM Owner and can only be evicted by the TPM Owner." },
+  { TPM_BAD_COUNTER, "TPM_BAD_COUNTER", "The counter handle is incorrect" },
+  { TPM_NOT_FULLWRITE, "TPM_NOT_FULLWRITE", "The write is not a complete write of the area" },
+  { TPM_CONTEXT_GAP, "TPM_CONTEXT_GAP", "The gap between saved context counts is too large" },
+  { TPM_MAXNVWRITES, "TPM_MAXNVWRITES", "The maximum number of NV writes without an owner has been exceeded" },
+  { TPM_NOOPERATOR, "TPM_NOOPERATOR", "No operator authorization value is set" },
+  { TPM_RESOURCEMISSING, "TPM_RESOURCEMISSING", "The resource pointed to by context is not loaded" },
+  { TPM_DELEGATE_LOCK, "TPM_DELEGATE_LOCK", "The delegate administration is locked" },
+  { TPM_DELEGATE_FAMILY, "TPM_DELEGATE_FAMILY", "Attempt to manage a family other then the delegated family" },
+  { TPM_DELEGATE_ADMIN, "TPM_DELEGATE_ADMIN", "Delegation table management not enabled" },
+  { TPM_TRANSPORT_EXCLUSIVE, "TPM_TRANSPORT_EXCLUSIVE", "There was a command executed outside of an exclusive transport session" },
+};
+
+
+// helper function for the error codes:
+const char* tpm_get_error_name (TPM_RESULT code) {
+  // just do a linear scan for now
+  unsigned i;
+  for (i = 0; i < sizeof(error_msgs)/sizeof(error_msgs[0]); i++)
+    if (code == error_msgs[i].code)
+      return error_msgs[i].code_name;
+
+    return("Unknown Error Code");
+}
diff --git a/stubdom/vtpmmgr/log.h b/stubdom/vtpmmgr/log.h
new file mode 100644
index 0000000..5c7abf5
--- /dev/null
+++ b/stubdom/vtpmmgr/log.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __VTPM_LOG_H__
+#define __VTPM_LOG_H__
+
+#include <stdint.h>             // for uint32_t
+#include <stddef.h>             // for pointer NULL
+#include <stdio.h>
+#include "tcg.h"
+
+// =========================== LOGGING ==============================
+
+// the logging module numbers
+#define VTPM_LOG_TPM         1
+#define VTPM_LOG_TPM_DEEP    2
+#define VTPM_LOG_VTPM        3
+#define VTPM_LOG_VTPM_DEEP   4
+#define VTPM_LOG_TXDATA      5
+
+extern char *module_names[];
+
+// Default to standard logging
+#ifndef LOGGING_MODULES
+#define LOGGING_MODULES (BITMASK(VTPM_LOG_VTPM)|BITMASK(VTPM_LOG_TPM))
+#endif
+
+// bit-access macros
+#define BITMASK(idx)      ( 1U << (idx) )
+#define GETBIT(num,idx)   ( ((num) & BITMASK(idx)) >> idx )
+#define SETBIT(num,idx)   (num) |= BITMASK(idx)
+#define CLEARBIT(num,idx) (num) &= ( ~ BITMASK(idx) )
+
+#define vtpmloginfo(module, fmt, args...) \
+  if (GETBIT (LOGGING_MODULES, module) == 1) {				\
+    fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); \
+  }
+
+#define vtpmloginfomore(module, fmt, args...) \
+  if (GETBIT (LOGGING_MODULES, module) == 1) {			      \
+    fprintf (stdout, fmt,##args);				      \
+  }
+
+#define vtpmlogerror(module, fmt, args...) \
+  fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
+
+//typedef UINT32 tpm_size_t;
+
+// helper function for the error codes:
+const char* tpm_get_error_name (TPM_RESULT code);
+
+#endif // _VTPM_LOG_H_
diff --git a/stubdom/vtpmmgr/marshal.h b/stubdom/vtpmmgr/marshal.h
new file mode 100644
index 0000000..77d32f0
--- /dev/null
+++ b/stubdom/vtpmmgr/marshal.h
@@ -0,0 +1,528 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef MARSHAL_H
+#define MARSHAL_H
+
+#include <stdlib.h>
+#include <mini-os/byteorder.h>
+#include <mini-os/endian.h>
+#include "tcg.h"
+
+typedef enum UnpackPtr {
+   UNPACK_ALIAS,
+   UNPACK_ALLOC
+} UnpackPtr;
+
+inline BYTE* pack_BYTE(BYTE* ptr, BYTE t) {
+   ptr[0] = t;
+   return ++ptr;
+}
+
+inline BYTE* unpack_BYTE(BYTE* ptr, BYTE* t) {
+   t[0] = ptr[0];
+   return ++ptr;
+}
+
+#define pack_BOOL(p, t) pack_BYTE(p, t)
+#define unpack_BOOL(p, t) unpack_BYTE(p, t)
+
+inline BYTE* pack_UINT16(BYTE* ptr, UINT16 t) {
+   BYTE* b = (BYTE*)&t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   ptr[0] = b[1];
+   ptr[1] = b[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   ptr[0] = b[0];
+   ptr[1] = b[1];
+#endif
+   return ptr + sizeof(UINT16);
+}
+
+inline BYTE* unpack_UINT16(BYTE* ptr, UINT16* t) {
+   BYTE* b = (BYTE*)t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   b[0] = ptr[1];
+   b[1] = ptr[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   b[0] = ptr[0];
+   b[1] = ptr[1];
+#endif
+   return ptr + sizeof(UINT16);
+}
+
+inline BYTE* pack_UINT32(BYTE* ptr, UINT32 t) {
+   BYTE* b = (BYTE*)&t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   ptr[3] = b[0];
+   ptr[2] = b[1];
+   ptr[1] = b[2];
+   ptr[0] = b[3];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   ptr[0] = b[0];
+   ptr[1] = b[1];
+   ptr[2] = b[2];
+   ptr[3] = b[3];
+#endif
+   return ptr + sizeof(UINT32);
+}
+
+inline BYTE* unpack_UINT32(BYTE* ptr, UINT32* t) {
+   BYTE* b = (BYTE*)t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   b[0] = ptr[3];
+   b[1] = ptr[2];
+   b[2] = ptr[1];
+   b[3] = ptr[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   b[0] = ptr[0];
+   b[1] = ptr[1];
+   b[2] = ptr[2];
+   b[3] = ptr[3];
+#endif
+   return ptr + sizeof(UINT32);
+}
+
+#define pack_TPM_RESULT(p, t) pack_UINT32(p, t)
+#define pack_TPM_PCRINDEX(p, t) pack_UINT32(p, t)
+#define pack_TPM_DIRINDEX(p, t) pack_UINT32(p, t)
+#define pack_TPM_HANDLE(p, t) pack_UINT32(p, t)
+#define pack_TPM_AUTHHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_HASHHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_HMACHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_ENCHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TPM_KEY_HANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_ENTITYHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TPM_RESOURCE_TYPE(p, t) pack_UINT32(p, t)
+#define pack_TPM_COMMAND_CODE(p, t) pack_UINT32(p, t)
+#define pack_TPM_PROTOCOL_ID(p, t) pack_UINT16(p, t)
+#define pack_TPM_AUTH_DATA_USAGE(p, t) pack_BYTE(p, t)
+#define pack_TPM_ENTITY_TYPE(p, t) pack_UINT16(p, t)
+#define pack_TPM_ALGORITHM_ID(p, t) pack_UINT32(p, t)
+#define pack_TPM_KEY_USAGE(p, t) pack_UINT16(p, t)
+#define pack_TPM_STARTUP_TYPE(p, t) pack_UINT16(p, t)
+#define pack_TPM_CAPABILITY_AREA(p, t) pack_UINT32(p, t)
+#define pack_TPM_ENC_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_SIG_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_MIGRATE_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_PHYSICAL_PRESENCE(p, t) pack_UINT16(p, t)
+#define pack_TPM_KEY_FLAGS(p, t) pack_UINT32(p, t)
+
+#define unpack_TPM_RESULT(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_PCRINDEX(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_DIRINDEX(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_HANDLE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_AUTHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_HASHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_HMACHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_ENCHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TPM_KEY_HANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_ENTITYHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TPM_RESOURCE_TYPE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_COMMAND_CODE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_PROTOCOL_ID(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_AUTH_DATA_USAGE(p, t) unpack_BYTE(p, t)
+#define unpack_TPM_ENTITY_TYPE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_ALGORITHM_ID(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_KEY_USAGE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_STARTUP_TYPE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_CAPABILITY_AREA(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_ENC_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_SIG_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_MIGRATE_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_PHYSICAL_PRESENCE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_KEY_FLAGS(p, t) unpack_UINT32(p, t)
+
+#define pack_TPM_AUTH_HANDLE(p, t) pack_UINT32(p, t);
+#define pack_TCS_CONTEXT_HANDLE(p, t) pack_UINT32(p, t);
+#define pack_TCS_KEY_HANDLE(p, t) pack_UINT32(p, t);
+
+#define unpack_TPM_AUTH_HANDLE(p, t) unpack_UINT32(p, t);
+#define unpack_TCS_CONTEXT_HANDLE(p, t) unpack_UINT32(p, t);
+#define unpack_TCS_KEY_HANDLE(p, t) unpack_UINT32(p, t);
+
+inline BYTE* pack_BUFFER(BYTE* ptr, const BYTE* buf, UINT32 size) {
+   memcpy(ptr, buf, size);
+   return ptr + size;
+}
+
+inline BYTE* unpack_BUFFER(BYTE* ptr, BYTE* buf, UINT32 size) {
+   memcpy(buf, ptr, size);
+   return ptr + size;
+}
+
+inline BYTE* unpack_ALIAS(BYTE* ptr, BYTE** buf, UINT32 size) {
+   *buf = ptr;
+   return ptr + size;
+}
+
+inline BYTE* unpack_ALLOC(BYTE* ptr, BYTE** buf, UINT32 size) {
+   if(size) {
+      *buf = malloc(size);
+      memcpy(*buf, ptr, size);
+   } else {
+      *buf = NULL;
+   }
+   return ptr + size;
+}
+
+inline BYTE* unpack_PTR(BYTE* ptr, BYTE** buf, UINT32 size, UnpackPtr alloc) {
+   if(alloc == UNPACK_ALLOC) {
+      return unpack_ALLOC(ptr, buf, size);
+   } else {
+      return unpack_ALIAS(ptr, buf, size);
+   }
+}
+
+inline BYTE* pack_TPM_AUTHDATA(BYTE* ptr, const TPM_AUTHDATA* d) {
+   return pack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_AUTHDATA(BYTE* ptr, TPM_AUTHDATA* d) {
+   return unpack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
+}
+
+#define pack_TPM_SECRET(p, t) pack_TPM_AUTHDATA(p, t)
+#define pack_TPM_ENCAUTH(p, t) pack_TPM_AUTHDATA(p, t)
+#define pack_TPM_PAYLOAD_TYPE(p, t) pack_BYTE(p, t)
+#define pack_TPM_TAG(p, t) pack_UINT16(p, t)
+#define pack_TPM_STRUCTURE_TAG(p, t) pack_UINT16(p, t)
+
+#define unpack_TPM_SECRET(p, t) unpack_TPM_AUTHDATA(p, t)
+#define unpack_TPM_ENCAUTH(p, t) unpack_TPM_AUTHDATA(p, t)
+#define unpack_TPM_PAYLOAD_TYPE(p, t) unpack_BYTE(p, t)
+#define unpack_TPM_TAG(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_STRUCTURE_TAG(p, t) unpack_UINT16(p, t)
+
+inline BYTE* pack_TPM_VERSION(BYTE* ptr, const TPM_VERSION* t) {
+   ptr[0] = t->major;
+   ptr[1] = t->minor;
+   ptr[2] = t->revMajor;
+   ptr[3] = t->revMinor;
+   return ptr + 4;
+}
+
+inline BYTE* unpack_TPM_VERSION(BYTE* ptr, TPM_VERSION* t) {
+   t->major = ptr[0];
+   t->minor = ptr[1];
+   t->revMajor = ptr[2];
+   t->revMinor = ptr[3];
+   return ptr + 4;
+}
+
+inline BYTE* pack_TPM_CAP_VERSION_INFO(BYTE* ptr, const TPM_CAP_VERSION_INFO* v) {
+   ptr = pack_TPM_STRUCTURE_TAG(ptr, v->tag);
+   ptr = pack_TPM_VERSION(ptr, &v->version);
+   ptr = pack_UINT16(ptr, v->specLevel);
+   ptr = pack_BYTE(ptr, v->errataRev);
+   ptr = pack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));
+   ptr = pack_UINT16(ptr, v->vendorSpecificSize);
+   ptr = pack_BUFFER(ptr, v->vendorSpecific, v->vendorSpecificSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_CAP_VERSION_INFO(BYTE* ptr, TPM_CAP_VERSION_INFO* v, UnpackPtr alloc) {
+   ptr = unpack_TPM_STRUCTURE_TAG(ptr, &v->tag);
+   ptr = unpack_TPM_VERSION(ptr, &v->version);
+   ptr = unpack_UINT16(ptr, &v->specLevel);
+   ptr = unpack_BYTE(ptr, &v->errataRev);
+   ptr = unpack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));
+   ptr = unpack_UINT16(ptr, &v->vendorSpecificSize);
+   ptr = unpack_PTR(ptr, &v->vendorSpecific, v->vendorSpecificSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_DIGEST(BYTE* ptr, const TPM_DIGEST* d) {
+   return pack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_DIGEST(BYTE* ptr, TPM_DIGEST* d) {
+   return unpack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
+}
+
+#define pack_TPM_PCRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_PCRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_COMPOSITE_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_COMPOSITE_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_DIRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_DIRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_HMAC(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_HMAC(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_CHOSENID_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_CHOSENID_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+inline BYTE* pack_TPM_NONCE(BYTE* ptr, const TPM_NONCE* n) {
+   return pack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_NONCE(BYTE* ptr, TPM_NONCE* n) {
+   return unpack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* pack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, const TPM_SYMMETRIC_KEY_PARMS* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_UINT32(ptr, k->blockSize);
+   ptr = pack_UINT32(ptr, k->ivSize);
+   return pack_BUFFER(ptr, k->IV, k->ivSize);
+}
+
+inline BYTE* unpack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, TPM_SYMMETRIC_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_UINT32(ptr, &k->blockSize);
+   ptr = unpack_UINT32(ptr, &k->ivSize);
+   return unpack_PTR(ptr, &k->IV, k->ivSize, alloc);
+}
+
+inline BYTE* pack_TPM_RSA_KEY_PARMS(BYTE* ptr, const TPM_RSA_KEY_PARMS* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_UINT32(ptr, k->numPrimes);
+   ptr = pack_UINT32(ptr, k->exponentSize);
+   return pack_BUFFER(ptr, k->exponent, k->exponentSize);
+}
+
+inline BYTE* unpack_TPM_RSA_KEY_PARMS(BYTE* ptr, TPM_RSA_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_UINT32(ptr, &k->numPrimes);
+   ptr = unpack_UINT32(ptr, &k->exponentSize);
+   return unpack_PTR(ptr, &k->exponent, k->exponentSize, alloc);
+}
+
+inline BYTE* pack_TPM_KEY_PARMS(BYTE* ptr, const TPM_KEY_PARMS* k) {
+   ptr = pack_TPM_ALGORITHM_ID(ptr, k->algorithmID);
+   ptr = pack_TPM_ENC_SCHEME(ptr, k->encScheme);
+   ptr = pack_TPM_SIG_SCHEME(ptr, k->sigScheme);
+   ptr = pack_UINT32(ptr, k->parmSize);
+
+   if(k->parmSize) {
+      switch(k->algorithmID) {
+         case TPM_ALG_RSA:
+            return pack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa);
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            return pack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym);
+      }
+   }
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_KEY_PARMS(BYTE* ptr, TPM_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_ALGORITHM_ID(ptr, &k->algorithmID);
+   ptr = unpack_TPM_ENC_SCHEME(ptr, &k->encScheme);
+   ptr = unpack_TPM_SIG_SCHEME(ptr, &k->sigScheme);
+   ptr = unpack_UINT32(ptr, &k->parmSize);
+
+   if(k->parmSize) {
+      switch(k->algorithmID) {
+         case TPM_ALG_RSA:
+            return unpack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa, alloc);
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            return unpack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym, alloc);
+      }
+   }
+   return ptr;
+}
+
+inline BYTE* pack_TPM_STORE_PUBKEY(BYTE* ptr, const TPM_STORE_PUBKEY* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_BUFFER(ptr, k->key, k->keyLength);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_STORE_PUBKEY(BYTE* ptr, TPM_STORE_PUBKEY* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_PTR(ptr, &k->key, k->keyLength, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PUBKEY(BYTE* ptr, const TPM_PUBKEY* k) {
+   ptr = pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
+   return pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
+}
+
+inline BYTE* unpack_TPM_PUBKEY(BYTE* ptr, TPM_PUBKEY* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
+   return unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
+}
+
+inline BYTE* pack_TPM_PCR_SELECTION(BYTE* ptr, const TPM_PCR_SELECTION* p) {
+   ptr = pack_UINT16(ptr, p->sizeOfSelect);
+   ptr = pack_BUFFER(ptr, p->pcrSelect, p->sizeOfSelect);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_SELECTION(BYTE* ptr, TPM_PCR_SELECTION* p, UnpackPtr alloc) {
+   ptr = unpack_UINT16(ptr, &p->sizeOfSelect);
+   ptr = unpack_PTR(ptr, &p->pcrSelect, p->sizeOfSelect, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PCR_INFO(BYTE* ptr, const TPM_PCR_INFO* p) {
+   ptr = pack_TPM_PCR_SELECTION(ptr, &p->pcrSelection);
+   ptr = pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
+   ptr = pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_INFO(BYTE* ptr, TPM_PCR_INFO* p, UnpackPtr alloc) {
+   ptr = unpack_TPM_PCR_SELECTION(ptr, &p->pcrSelection, alloc);
+   ptr = unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
+   ptr = unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PCR_COMPOSITE(BYTE* ptr, const TPM_PCR_COMPOSITE* p) {
+   ptr = pack_TPM_PCR_SELECTION(ptr, &p->select);
+   ptr = pack_UINT32(ptr, p->valueSize);
+   ptr = pack_BUFFER(ptr, (const BYTE*)p->pcrValue, p->valueSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_COMPOSITE(BYTE* ptr, TPM_PCR_COMPOSITE* p, UnpackPtr alloc) {
+   ptr = unpack_TPM_PCR_SELECTION(ptr, &p->select, alloc);
+   ptr = unpack_UINT32(ptr, &p->valueSize);
+   ptr = unpack_PTR(ptr, (BYTE**)&p->pcrValue, p->valueSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_KEY(BYTE* ptr, const TPM_KEY* k) {
+   ptr = pack_TPM_VERSION(ptr, &k->ver);
+   ptr = pack_TPM_KEY_USAGE(ptr, k->keyUsage);
+   ptr = pack_TPM_KEY_FLAGS(ptr, k->keyFlags);
+   ptr = pack_TPM_AUTH_DATA_USAGE(ptr, k->authDataUsage);
+   ptr = pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
+   ptr = pack_UINT32(ptr, k->PCRInfoSize);
+   if(k->PCRInfoSize) {
+      ptr = pack_TPM_PCR_INFO(ptr, &k->PCRInfo);
+   }
+   ptr = pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
+   ptr = pack_UINT32(ptr, k->encDataSize);
+   return pack_BUFFER(ptr, k->encData, k->encDataSize);
+}
+
+inline BYTE* unpack_TPM_KEY(BYTE* ptr, TPM_KEY* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &k->ver);
+   ptr = unpack_TPM_KEY_USAGE(ptr, &k->keyUsage);
+   ptr = unpack_TPM_KEY_FLAGS(ptr, &k->keyFlags);
+   ptr = unpack_TPM_AUTH_DATA_USAGE(ptr, &k->authDataUsage);
+   ptr = unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
+   ptr = unpack_UINT32(ptr, &k->PCRInfoSize);
+   if(k->PCRInfoSize) {
+      ptr = unpack_TPM_PCR_INFO(ptr, &k->PCRInfo, alloc);
+   }
+   ptr = unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
+   ptr = unpack_UINT32(ptr, &k->encDataSize);
+   return unpack_PTR(ptr, &k->encData, k->encDataSize, alloc);
+}
+
+inline BYTE* pack_TPM_BOUND_DATA(BYTE* ptr, const TPM_BOUND_DATA* b, UINT32 payloadSize) {
+   ptr = pack_TPM_VERSION(ptr, &b->ver);
+   ptr = pack_TPM_PAYLOAD_TYPE(ptr, b->payload);
+   return pack_BUFFER(ptr, b->payloadData, payloadSize);
+}
+
+inline BYTE* unpack_TPM_BOUND_DATA(BYTE* ptr, TPM_BOUND_DATA* b, UINT32 payloadSize, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &b->ver);
+   ptr = unpack_TPM_PAYLOAD_TYPE(ptr, &b->payload);
+   return unpack_PTR(ptr, &b->payloadData, payloadSize, alloc);
+}
+
+inline BYTE* pack_TPM_STORED_DATA(BYTE* ptr, const TPM_STORED_DATA* d) {
+   ptr = pack_TPM_VERSION(ptr, &d->ver);
+   ptr = pack_UINT32(ptr, d->sealInfoSize);
+   if(d->sealInfoSize) {
+      ptr = pack_TPM_PCR_INFO(ptr, &d->sealInfo);
+   }
+   ptr = pack_UINT32(ptr, d->encDataSize);
+   ptr = pack_BUFFER(ptr, d->encData, d->encDataSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_STORED_DATA(BYTE* ptr, TPM_STORED_DATA* d, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &d->ver);
+   ptr = unpack_UINT32(ptr, &d->sealInfoSize);
+   if(d->sealInfoSize) {
+      ptr = unpack_TPM_PCR_INFO(ptr, &d->sealInfo, alloc);
+   }
+   ptr = unpack_UINT32(ptr, &d->encDataSize);
+   ptr = unpack_PTR(ptr, &d->encData, d->encDataSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_AUTH_SESSION(BYTE* ptr, const TPM_AUTH_SESSION* auth) {
+   ptr = pack_TPM_AUTH_HANDLE(ptr, auth->AuthHandle);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+   ptr = pack_TPM_AUTHDATA(ptr, &auth->HMAC);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_AUTH_SESSION(BYTE* ptr, TPM_AUTH_SESSION* auth) {
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = unpack_BOOL(ptr, &auth->fContinueAuthSession);
+   ptr = unpack_TPM_AUTHDATA(ptr, &auth->HMAC);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_RQU_HEADER(BYTE* ptr,
+      TPM_TAG tag,
+      UINT32 size,
+      TPM_COMMAND_CODE ord) {
+   ptr = pack_UINT16(ptr, tag);
+   ptr = pack_UINT32(ptr, size);
+   return pack_UINT32(ptr, ord);
+}
+
+inline BYTE* unpack_TPM_RQU_HEADER(BYTE* ptr,
+      TPM_TAG* tag,
+      UINT32* size,
+      TPM_COMMAND_CODE* ord) {
+   ptr = unpack_UINT16(ptr, tag);
+   ptr = unpack_UINT32(ptr, size);
+   ptr = unpack_UINT32(ptr, ord);
+   return ptr;
+}
+
+#define pack_TPM_RSP_HEADER(p, t, s, r) pack_TPM_RQU_HEADER(p, t, s, r);
+#define unpack_TPM_RSP_HEADER(p, t, s, r) unpack_TPM_RQU_HEADER(p, t, s, r);
+
+#endif
diff --git a/stubdom/vtpmmgr/minios.cfg b/stubdom/vtpmmgr/minios.cfg
new file mode 100644
index 0000000..3fb383d
--- /dev/null
+++ b/stubdom/vtpmmgr/minios.cfg
@@ -0,0 +1,14 @@
+CONFIG_TPMFRONT=y
+CONFIG_TPM_TIS=y
+CONFIG_TPMBACK=y
+CONFIG_START_NETWORK=n
+CONFIG_TEST=n
+CONFIG_PCIFRONT=n
+CONFIG_BLKFRONT=y
+CONFIG_NETFRONT=n
+CONFIG_FBFRONT=n
+CONFIG_KBDFRONT=n
+CONFIG_CONSFRONT=n
+CONFIG_XENBUS=y
+CONFIG_LWIP=n
+CONFIG_XC=n
diff --git a/stubdom/vtpmmgr/tcg.h b/stubdom/vtpmmgr/tcg.h
new file mode 100644
index 0000000..7687eae
--- /dev/null
+++ b/stubdom/vtpmmgr/tcg.h
@@ -0,0 +1,707 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005 Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __TCG_H__
+#define __TCG_H__
+
+#include <stdlib.h>
+#include <stdint.h>
+
+// **************************** CONSTANTS *********************************
+
+// BOOL values
+#define TRUE 0x01
+#define FALSE 0x00
+
+#define TCPA_MAX_BUFFER_LENGTH 0x2000
+
+//
+// TPM_COMMAND_CODE values
+#define TPM_PROTECTED_ORDINAL 0x00000000UL
+#define TPM_UNPROTECTED_ORDINAL 0x80000000UL
+#define TPM_CONNECTION_ORDINAL 0x40000000UL
+#define TPM_VENDOR_ORDINAL 0x20000000UL
+
+#define TPM_ORD_OIAP                     (10UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OSAP                     (11UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuth               (12UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_TakeOwnership            (13UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthAsymStart      (14UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthAsymFinish     (15UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthOwner          (16UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Extend                   (20UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PcrRead                  (21UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Quote                    (22UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Seal                     (23UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Unseal                   (24UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DirWriteAuth             (25UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DirRead                  (26UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_UnBind                   (30UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateWrapKey            (31UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadKey                  (32UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetPubKey                (33UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_EvictKey                 (34UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateMigrationBlob      (40UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReWrapKey                (41UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ConvertMigrationBlob     (42UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_AuthorizeMigrationKey    (43UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateMaintenanceArchive (44UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadMaintenanceArchive   (45UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_KillMaintenanceFeature   (46UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadManuMaintPub         (47UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadManuMaintPub         (48UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CertifyKey               (50UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Sign                     (60UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetRandom                (70UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_StirRandom               (71UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SelfTestFull             (80UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SelfTestStartup          (81UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CertifySelfTest          (82UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ContinueSelfTest         (83UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetTestResult            (84UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Reset                    (90UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerClear               (91UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisableOwnerClear        (92UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ForceClear               (93UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisableForceClear        (94UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapabilitySigned      (100UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapability            (101UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapabilityOwner       (102UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerSetDisable          (110UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalEnable           (111UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalDisable          (112UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetOwnerInstall          (113UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalSetDeactivated   (114UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetTempDeactivated       (115UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateEndorsementKeyPair (120UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_MakeIdentity             (121UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ActivateIdentity         (122UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadPubek                (124UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerReadPubek           (125UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisablePubekRead         (126UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetAuditEvent            (130UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetAuditEventSigned      (131UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetOrdinalAuditStatus    (140UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetOrdinalAuditStatus    (141UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Terminate_Handle         (150UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Init                     (151UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveState                (152UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Startup                  (153UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetRedirection           (154UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Start                (160UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Update               (161UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Complete             (162UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1CompleteExtend       (163UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_FieldUpgrade             (170UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveKeyContext           (180UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadKeyContext           (181UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveAuthContext          (182UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadAuthContext          (183UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveContext                      (184UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadContext                      (185UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_FlushSpecific                    (186UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PCR_Reset                        (200UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_DefineSpace                   (204UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_WriteValue                    (205UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_WriteValueAuth                (206UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_ReadValue                     (207UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_ReadValueAuth                 (208UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_UpdateVerification      (209UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_Manage                  (210UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_CreateKeyDelegation     (212UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_CreateOwnerDelegation   (213UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_VerifyDelegation        (214UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_LoadOwnerDelegation     (216UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_ReadAuth                (217UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_ReadTable               (219UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateCounter                    (220UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_IncrementCounter                 (221UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadCounter                      (222UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseCounter                   (223UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseCounterOwner              (224UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_EstablishTransport               (230UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ExecuteTransport                 (231UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseTransportSigned           (232UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetTicks                         (241UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_TickStampBlob                    (242UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_MAX                              (256UL + TPM_PROTECTED_ORDINAL)
+
+#define TSC_ORD_PhysicalPresence         (10UL + TPM_CONNECTION_ORDINAL)
+
+
+
+//
+// TPM_RESULT values
+//
+// just put in the whole table from spec 1.2
+
+#define TPM_BASE   0x0 // The start of TPM return codes
+#define TPM_VENDOR_ERROR 0x00000400 // Mask to indicate that the error code is vendor specific for vendor specific commands
+#define TPM_NON_FATAL  0x00000800 // Mask to indicate that the error code is a non-fatal failure.
+
+#define TPM_SUCCESS   TPM_BASE // Successful completion of the operation
+#define TPM_AUTHFAIL      TPM_BASE + 1 // Authentication failed
+#define TPM_BADINDEX      TPM_BASE + 2 // The index to a PCR, DIR or other register is incorrect
+#define TPM_BAD_PARAMETER     TPM_BASE + 3 // One or more parameter is bad
+#define TPM_AUDITFAILURE     TPM_BASE + 4 // An operation completed successfully but the auditing of that operation failed.
+#define TPM_CLEAR_DISABLED     TPM_BASE + 5 // The clear disable flag is set and all clear operations now require physical access
+#define TPM_DEACTIVATED     TPM_BASE + 6 // The TPM is deactivated
+#define TPM_DISABLED      TPM_BASE + 7 // The TPM is disabled
+#define TPM_DISABLED_CMD     TPM_BASE + 8 // The target command has been disabled
+#define TPM_FAIL       TPM_BASE + 9 // The operation failed
+#define TPM_BAD_ORDINAL     TPM_BASE + 10 // The ordinal was unknown or inconsistent
+#define TPM_INSTALL_DISABLED   TPM_BASE + 11 // The ability to install an owner is disabled
+#define TPM_INVALID_KEYHANDLE  TPM_BASE + 12 // The key handle presented was invalid
+#define TPM_KEYNOTFOUND     TPM_BASE + 13 // The target key was not found
+#define TPM_INAPPROPRIATE_ENC  TPM_BASE + 14 // Unacceptable encryption scheme
+#define TPM_MIGRATEFAIL     TPM_BASE + 15 // Migration authorization failed
+#define TPM_INVALID_PCR_INFO   TPM_BASE + 16 // PCR information could not be interpreted
+#define TPM_NOSPACE      TPM_BASE + 17 // No room to load key.
+#define TPM_NOSRK       TPM_BASE + 18 // There is no SRK set
+#define TPM_NOTSEALED_BLOB     TPM_BASE + 19 // An encrypted blob is invalid or was not created by this TPM
+#define TPM_OWNER_SET      TPM_BASE + 20 // There is already an Owner
+#define TPM_RESOURCES      TPM_BASE + 21 // The TPM has insufficient internal resources to perform the requested action.
+#define TPM_SHORTRANDOM     TPM_BASE + 22 // A random string was too short
+#define TPM_SIZE       TPM_BASE + 23 // The TPM does not have the space to perform the operation.
+#define TPM_WRONGPCRVAL     TPM_BASE + 24 // The named PCR value does not match the current PCR value.
+#define TPM_BAD_PARAM_SIZE     TPM_BASE + 25 // The paramSize argument to the command has the incorrect value
+#define TPM_SHA_THREAD      TPM_BASE + 26 // There is no existing SHA-1 thread.
+#define TPM_SHA_ERROR      TPM_BASE + 27 // The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error.
+#define TPM_FAILEDSELFTEST     TPM_BASE + 28 // Self-test has failed and the TPM has shutdown.
+#define TPM_AUTH2FAIL      TPM_BASE + 29 // The authorization for the second key in a 2 key function failed authorization
+#define TPM_BADTAG       TPM_BASE + 30 // The tag value sent to for a command is invalid
+#define TPM_IOERROR      TPM_BASE + 31 // An IO error occurred transmitting information to the TPM
+#define TPM_ENCRYPT_ERROR     TPM_BASE + 32 // The encryption process had a problem.
+#define TPM_DECRYPT_ERROR     TPM_BASE + 33 // The decryption process did not complete.
+#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 // An invalid handle was used.
+#define TPM_NO_ENDORSEMENT     TPM_BASE + 35 // The TPM does not a EK installed
+#define TPM_INVALID_KEYUSAGE   TPM_BASE + 36 // The usage of a key is not allowed
+#define TPM_WRONG_ENTITYTYPE   TPM_BASE + 37 // The submitted entity type is not allowed
+#define TPM_INVALID_POSTINIT   TPM_BASE + 38 // The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup
+#define TPM_INAPPROPRIATE_SIG  TPM_BASE + 39 // Signed data cannot include additional DER information
+#define TPM_BAD_KEY_PROPERTY   TPM_BASE + 40 // The key properties in TPM_KEY_PARMs are not supported by this TPM
+
+#define TPM_BAD_MIGRATION      TPM_BASE + 41 // The migration properties of this key are incorrect.
+#define TPM_BAD_SCHEME       TPM_BASE + 42 // The signature or encryption scheme for this key is incorrect or not permitted in this situation.
+#define TPM_BAD_DATASIZE      TPM_BASE + 43 // The size of the data (or blob) parameter is bad or inconsistent with the referenced key
+#define TPM_BAD_MODE       TPM_BASE + 44 // A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob.
+#define TPM_BAD_PRESENCE      TPM_BASE + 45 // Either the physicalPresence or physicalPresenceLock bits have the wrong value
+#define TPM_BAD_VERSION      TPM_BASE + 46 // The TPM cannot perform this version of the capability
+#define TPM_NO_WRAP_TRANSPORT     TPM_BASE + 47 // The TPM does not allow for wrapped transport sessions
+#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 // TPM audit construction failed and the underlying command was returning a failure code also
+#define TPM_AUDITFAIL_SUCCESSFUL   TPM_BASE + 49 // TPM audit construction failed and the underlying command was returning success
+#define TPM_NOTRESETABLE      TPM_BASE + 50 // Attempt to reset a PCR register that does not have the resettable attribute
+#define TPM_NOTLOCAL       TPM_BASE + 51 // Attempt to reset a PCR register that requires locality and locality modifier not part of command transport
+#define TPM_BAD_TYPE       TPM_BASE + 52 // Make identity blob not properly typed
+#define TPM_INVALID_RESOURCE     TPM_BASE + 53 // When saving context identified resource type does not match actual resource
+#define TPM_NOTFIPS       TPM_BASE + 54 // The TPM is attempting to execute a command only available when in FIPS mode
+#define TPM_INVALID_FAMILY      TPM_BASE + 55 // The command is attempting to use an invalid family ID
+#define TPM_NO_NV_PERMISSION     TPM_BASE + 56 // The permission to manipulate the NV storage is not available
+#define TPM_REQUIRES_SIGN      TPM_BASE + 57 // The operation requires a signed command
+#define TPM_KEY_NOTSUPPORTED     TPM_BASE + 58 // Wrong operation to load an NV key
+#define TPM_AUTH_CONFLICT      TPM_BASE + 59 // NV_LoadKey blob requires both owner and blob authorization
+#define TPM_AREA_LOCKED      TPM_BASE + 60 // The NV area is locked and not writtable
+#define TPM_BAD_LOCALITY      TPM_BASE + 61 // The locality is incorrect for the attempted operation
+#define TPM_READ_ONLY       TPM_BASE + 62 // The NV area is read only and can't be written to
+#define TPM_PER_NOWRITE      TPM_BASE + 63 // There is no protection on the write to the NV area
+#define TPM_FAMILYCOUNT      TPM_BASE + 64 // The family count value does not match
+#define TPM_WRITE_LOCKED      TPM_BASE + 65 // The NV area has already been written to
+#define TPM_BAD_ATTRIBUTES      TPM_BASE + 66 // The NV area attributes conflict
+#define TPM_INVALID_STRUCTURE     TPM_BASE + 67 // The structure tag and version are invalid or inconsistent
+#define TPM_KEY_OWNER_CONTROL     TPM_BASE + 68 // The key is under control of the TPM Owner and can only be evicted by the TPM Owner.
+#define TPM_BAD_COUNTER      TPM_BASE + 69 // The counter handle is incorrect
+#define TPM_NOT_FULLWRITE      TPM_BASE + 70 // The write is not a complete write of the area
+#define TPM_CONTEXT_GAP      TPM_BASE + 71 // The gap between saved context counts is too large
+#define TPM_MAXNVWRITES      TPM_BASE + 72 // The maximum number of NV writes without an owner has been exceeded
+#define TPM_NOOPERATOR       TPM_BASE + 73 // No operator authorization value is set
+#define TPM_RESOURCEMISSING     TPM_BASE + 74 // The resource pointed to by context is not loaded
+#define TPM_DELEGATE_LOCK      TPM_BASE + 75 // The delegate administration is locked
+#define TPM_DELEGATE_FAMILY     TPM_BASE + 76 // Attempt to manage a family other then the delegated family
+#define TPM_DELEGATE_ADMIN      TPM_BASE + 77 // Delegation table management not enabled
+#define TPM_TRANSPORT_EXCLUSIVE    TPM_BASE + 78 // There was a command executed outside of an exclusive transport session
+
+// TPM_STARTUP_TYPE values
+#define TPM_ST_CLEAR 0x0001
+#define TPM_ST_STATE 0x0002
+#define TPM_ST_DEACTIVATED 0x003
+
+// TPM_TAG values
+#define TPM_TAG_RQU_COMMAND 0x00c1
+#define TPM_TAG_RQU_AUTH1_COMMAND 0x00c2
+#define TPM_TAG_RQU_AUTH2_COMMAND 0x00c3
+#define TPM_TAG_RSP_COMMAND 0x00c4
+#define TPM_TAG_RSP_AUTH1_COMMAND 0x00c5
+#define TPM_TAG_RSP_AUTH2_COMMAND 0x00c6
+
+// TPM_PAYLOAD_TYPE values
+#define TPM_PT_ASYM 0x01
+#define TPM_PT_BIND 0x02
+#define TPM_PT_MIGRATE 0x03
+#define TPM_PT_MAINT 0x04
+#define TPM_PT_SEAL 0x05
+
+// TPM_ENTITY_TYPE values
+#define TPM_ET_KEYHANDLE 0x0001
+#define TPM_ET_OWNER 0x0002
+#define TPM_ET_DATA 0x0003
+#define TPM_ET_SRK 0x0004
+#define TPM_ET_KEY 0x0005
+
+/// TPM_ResourceTypes
+#define TPM_RT_KEY      0x00000001
+#define TPM_RT_AUTH     0x00000002
+#define TPM_RT_HASH     0x00000003
+#define TPM_RT_TRANS    0x00000004
+#define TPM_RT_CONTEXT  0x00000005
+#define TPM_RT_COUNTER  0x00000006
+#define TPM_RT_DELEGATE 0x00000007
+#define TPM_RT_DAA_TPM  0x00000008
+#define TPM_RT_DAA_V0   0x00000009
+#define TPM_RT_DAA_V1   0x0000000A
+
+
+
+// TPM_PROTOCOL_ID values
+#define TPM_PID_OIAP 0x0001
+#define TPM_PID_OSAP 0x0002
+#define TPM_PID_ADIP 0x0003
+#define TPM_PID_ADCP 0x0004
+#define TPM_PID_OWNER 0x0005
+
+// TPM_ALGORITHM_ID values
+#define TPM_ALG_RSA 0x00000001
+#define TPM_ALG_SHA 0x00000004
+#define TPM_ALG_HMAC 0x00000005
+#define TPM_ALG_AES128 0x00000006
+#define TPM_ALG_MFG1 0x00000007
+#define TPM_ALG_AES192 0x00000008
+#define TPM_ALG_AES256 0x00000009
+#define TPM_ALG_XOR 0x0000000A
+
+// TPM_ENC_SCHEME values
+#define TPM_ES_NONE 0x0001
+#define TPM_ES_RSAESPKCSv15 0x0002
+#define TPM_ES_RSAESOAEP_SHA1_MGF1 0x0003
+
+// TPM_SIG_SCHEME values
+#define TPM_SS_NONE 0x0001
+#define TPM_SS_RSASSAPKCS1v15_SHA1 0x0002
+#define TPM_SS_RSASSAPKCS1v15_DER 0x0003
+
+/*
+ * TPM_CAPABILITY_AREA Values for TPM_GetCapability ([TPM_Part2], Section 21.1)
+ */
+#define TPM_CAP_ORD                     0x00000001
+#define TPM_CAP_ALG                     0x00000002
+#define TPM_CAP_PID                     0x00000003
+#define TPM_CAP_FLAG                    0x00000004
+#define TPM_CAP_PROPERTY                0x00000005
+#define TPM_CAP_VERSION                 0x00000006
+#define TPM_CAP_KEY_HANDLE              0x00000007
+#define TPM_CAP_CHECK_LOADED            0x00000008
+#define TPM_CAP_SYM_MODE                0x00000009
+#define TPM_CAP_KEY_STATUS              0x0000000C
+#define TPM_CAP_NV_LIST                 0x0000000D
+#define TPM_CAP_MFR                     0x00000010
+#define TPM_CAP_NV_INDEX                0x00000011
+#define TPM_CAP_TRANS_ALG               0x00000012
+#define TPM_CAP_HANDLE                  0x00000014
+#define TPM_CAP_TRANS_ES                0x00000015
+#define TPM_CAP_AUTH_ENCRYPT            0x00000017
+#define TPM_CAP_SELECT_SIZE             0x00000018
+#define TPM_CAP_DA_LOGIC                0x00000019
+#define TPM_CAP_VERSION_VAL             0x0000001A
+
+/* subCap definitions ([TPM_Part2], Section 21.2) */
+#define TPM_CAP_PROP_PCR                0x00000101
+#define TPM_CAP_PROP_DIR                0x00000102
+#define TPM_CAP_PROP_MANUFACTURER       0x00000103
+#define TPM_CAP_PROP_KEYS               0x00000104
+#define TPM_CAP_PROP_MIN_COUNTER        0x00000107
+#define TPM_CAP_FLAG_PERMANENT          0x00000108
+#define TPM_CAP_FLAG_VOLATILE           0x00000109
+#define TPM_CAP_PROP_AUTHSESS           0x0000010A
+#define TPM_CAP_PROP_TRANSESS           0x0000010B
+#define TPM_CAP_PROP_COUNTERS           0x0000010C
+#define TPM_CAP_PROP_MAX_AUTHSESS       0x0000010D
+#define TPM_CAP_PROP_MAX_TRANSESS       0x0000010E
+#define TPM_CAP_PROP_MAX_COUNTERS       0x0000010F
+#define TPM_CAP_PROP_MAX_KEYS           0x00000110
+#define TPM_CAP_PROP_OWNER              0x00000111
+#define TPM_CAP_PROP_CONTEXT            0x00000112
+#define TPM_CAP_PROP_MAX_CONTEXT        0x00000113
+#define TPM_CAP_PROP_FAMILYROWS         0x00000114
+#define TPM_CAP_PROP_TIS_TIMEOUT        0x00000115
+#define TPM_CAP_PROP_STARTUP_EFFECT     0x00000116
+#define TPM_CAP_PROP_DELEGATE_ROW       0x00000117
+#define TPM_CAP_PROP_MAX_DAASESS        0x00000119
+#define TPM_CAP_PROP_DAASESS            0x0000011A
+#define TPM_CAP_PROP_CONTEXT_DIST       0x0000011B
+#define TPM_CAP_PROP_DAA_INTERRUPT      0x0000011C
+#define TPM_CAP_PROP_SESSIONS           0x0000011D
+#define TPM_CAP_PROP_MAX_SESSIONS       0x0000011E
+#define TPM_CAP_PROP_CMK_RESTRICTION    0x0000011F
+#define TPM_CAP_PROP_DURATION           0x00000120
+#define TPM_CAP_PROP_ACTIVE_COUNTER     0x00000122
+#define TPM_CAP_PROP_MAX_NV_AVAILABLE   0x00000123
+#define TPM_CAP_PROP_INPUT_BUFFER       0x00000124
+
+// TPM_KEY_USAGE values
+#define TPM_KEY_EK 0x0000
+#define TPM_KEY_SIGNING 0x0010
+#define TPM_KEY_STORAGE 0x0011
+#define TPM_KEY_IDENTITY 0x0012
+#define TPM_KEY_AUTHCHANGE 0X0013
+#define TPM_KEY_BIND 0x0014
+#define TPM_KEY_LEGACY 0x0015
+
+// TPM_AUTH_DATA_USAGE values
+#define TPM_AUTH_NEVER 0x00
+#define TPM_AUTH_ALWAYS 0x01
+
+// Key Handle of owner and srk
+#define TPM_OWNER_KEYHANDLE 0x40000001
+#define TPM_SRK_KEYHANDLE 0x40000000
+
+
+
+// *************************** TYPEDEFS *********************************
+typedef unsigned char BYTE;
+typedef unsigned char BOOL;
+typedef uint16_t UINT16;
+typedef uint32_t UINT32;
+typedef uint64_t UINT64;
+
+typedef UINT32 TPM_RESULT;
+typedef UINT32 TPM_PCRINDEX;
+typedef UINT32 TPM_DIRINDEX;
+typedef UINT32 TPM_HANDLE;
+typedef TPM_HANDLE TPM_AUTHHANDLE;
+typedef TPM_HANDLE TCPA_HASHHANDLE;
+typedef TPM_HANDLE TCPA_HMACHANDLE;
+typedef TPM_HANDLE TCPA_ENCHANDLE;
+typedef TPM_HANDLE TPM_KEY_HANDLE;
+typedef TPM_HANDLE TCPA_ENTITYHANDLE;
+typedef UINT32 TPM_RESOURCE_TYPE;
+typedef UINT32 TPM_COMMAND_CODE;
+typedef UINT16 TPM_PROTOCOL_ID;
+typedef BYTE TPM_AUTH_DATA_USAGE;
+typedef UINT16 TPM_ENTITY_TYPE;
+typedef UINT32 TPM_ALGORITHM_ID;
+typedef UINT16 TPM_KEY_USAGE;
+typedef UINT16 TPM_STARTUP_TYPE;
+typedef UINT32 TPM_CAPABILITY_AREA;
+typedef UINT16 TPM_ENC_SCHEME;
+typedef UINT16 TPM_SIG_SCHEME;
+typedef UINT16 TPM_MIGRATE_SCHEME;
+typedef UINT16 TPM_PHYSICAL_PRESENCE;
+typedef UINT32 TPM_KEY_FLAGS;
+
+#define TPM_DIGEST_SIZE 20  // Don't change this
+typedef BYTE TPM_AUTHDATA[TPM_DIGEST_SIZE];
+typedef TPM_AUTHDATA TPM_SECRET;
+typedef TPM_AUTHDATA TPM_ENCAUTH;
+typedef BYTE TPM_PAYLOAD_TYPE;
+typedef UINT16 TPM_TAG;
+typedef UINT16 TPM_STRUCTURE_TAG;
+
+// Data Types of the TCS
+typedef UINT32 TCS_AUTHHANDLE;  // Handle addressing a authorization session
+typedef UINT32 TCS_CONTEXT_HANDLE; // Basic context handle
+typedef UINT32 TCS_KEY_HANDLE;  // Basic key handle
+
+// ************************* STRUCTURES **********************************
+
+typedef struct TPM_VERSION {
+  BYTE major;
+  BYTE minor;
+  BYTE revMajor;
+  BYTE revMinor;
+} TPM_VERSION;
+
+static const TPM_VERSION TPM_STRUCT_VER_1_1 = { 1,1,0,0 };
+
+typedef struct TPM_CAP_VERSION_INFO {
+   TPM_STRUCTURE_TAG tag;
+   TPM_VERSION version;
+   UINT16 specLevel;
+   BYTE errataRev;
+   BYTE tpmVendorID[4];
+   UINT16 vendorSpecificSize;
+   BYTE* vendorSpecific;
+} TPM_CAP_VERSION_INFO;
+
+inline void free_TPM_CAP_VERSION_INFO(TPM_CAP_VERSION_INFO* v) {
+   free(v->vendorSpecific);
+   v->vendorSpecific = NULL;
+}
+
+typedef struct TPM_DIGEST {
+  BYTE digest[TPM_DIGEST_SIZE];
+} TPM_DIGEST;
+
+typedef TPM_DIGEST TPM_PCRVALUE;
+typedef TPM_DIGEST TPM_COMPOSITE_HASH;
+typedef TPM_DIGEST TPM_DIRVALUE;
+typedef TPM_DIGEST TPM_HMAC;
+typedef TPM_DIGEST TPM_CHOSENID_HASH;
+
+typedef struct TPM_NONCE {
+  BYTE nonce[TPM_DIGEST_SIZE];
+} TPM_NONCE;
+
+typedef struct TPM_SYMMETRIC_KEY_PARMS {
+   UINT32 keyLength;
+   UINT32 blockSize;
+   UINT32 ivSize;
+   BYTE* IV;
+} TPM_SYMMETRIC_KEY_PARMS;
+
+inline void free_TPM_SYMMETRIC_KEY_PARMS(TPM_SYMMETRIC_KEY_PARMS* p) {
+   free(p->IV);
+   p->IV = NULL;
+}
+
+#define TPM_SYMMETRIC_KEY_PARMS_INIT { 0, 0, 0, NULL }
+
+typedef struct TPM_RSA_KEY_PARMS {
+  UINT32 keyLength;
+  UINT32 numPrimes;
+  UINT32 exponentSize;
+  BYTE* exponent;
+} TPM_RSA_KEY_PARMS;
+
+#define TPM_RSA_KEY_PARMS_INIT { 0, 0, 0, NULL }
+
+inline void free_TPM_RSA_KEY_PARMS(TPM_RSA_KEY_PARMS* p) {
+   free(p->exponent);
+   p->exponent = NULL;
+}
+
+typedef struct TPM_KEY_PARMS {
+  TPM_ALGORITHM_ID algorithmID;
+  TPM_ENC_SCHEME encScheme;
+  TPM_SIG_SCHEME sigScheme;
+  UINT32 parmSize;
+  union {
+     TPM_SYMMETRIC_KEY_PARMS sym;
+     TPM_RSA_KEY_PARMS rsa;
+  } parms;
+} TPM_KEY_PARMS;
+
+#define TPM_KEY_PARMS_INIT { 0, 0, 0, 0 }
+
+inline void free_TPM_KEY_PARMS(TPM_KEY_PARMS* p) {
+   if(p->parmSize) {
+      switch(p->algorithmID) {
+         case TPM_ALG_RSA:
+            free_TPM_RSA_KEY_PARMS(&p->parms.rsa);
+            break;
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            free_TPM_SYMMETRIC_KEY_PARMS(&p->parms.sym);
+            break;
+      }
+   }
+}
+
+typedef struct TPM_STORE_PUBKEY {
+  UINT32 keyLength;
+  BYTE* key;
+} TPM_STORE_PUBKEY;
+
+#define TPM_STORE_PUBKEY_INIT { 0, NULL }
+
+inline void free_TPM_STORE_PUBKEY(TPM_STORE_PUBKEY* p) {
+   free(p->key);
+   p->key = NULL;
+}
+
+typedef struct TPM_PUBKEY {
+  TPM_KEY_PARMS algorithmParms;
+  TPM_STORE_PUBKEY pubKey;
+} TPM_PUBKEY;
+
+#define TPM_PUBKEY_INIT { TPM_KEY_PARMS_INIT, TPM_STORE_PUBKEY_INIT }
+
+inline void free_TPM_PUBKEY(TPM_PUBKEY* k) {
+   free_TPM_KEY_PARMS(&k->algorithmParms);
+   free_TPM_STORE_PUBKEY(&k->pubKey);
+}
+
+typedef struct TPM_PCR_SELECTION {
+   UINT16 sizeOfSelect;
+   BYTE* pcrSelect;
+} TPM_PCR_SELECTION;
+
+#define TPM_PCR_SELECTION_INIT { 0, NULL }
+
+inline void free_TPM_PCR_SELECTION(TPM_PCR_SELECTION* p) {
+   free(p->pcrSelect);
+   p->pcrSelect = NULL;
+}
+
+typedef struct TPM_PCR_INFO {
+   TPM_PCR_SELECTION pcrSelection;
+   TPM_COMPOSITE_HASH digestAtRelease;
+   TPM_COMPOSITE_HASH digestAtCreation;
+} TPM_PCR_INFO;
+
+#define TPM_PCR_INFO_INIT { TPM_PCR_SELECTION_INIT }
+
+inline void free_TPM_PCR_INFO(TPM_PCR_INFO* p) {
+   free_TPM_PCR_SELECTION(&p->pcrSelection);
+}
+
+typedef struct TPM_PCR_COMPOSITE {
+  TPM_PCR_SELECTION select;
+  UINT32 valueSize;
+  TPM_PCRVALUE* pcrValue;
+} TPM_PCR_COMPOSITE;
+
+#define TPM_PCR_COMPOSITE_INIT { TPM_PCR_SELECTION_INIT, 0, NULL }
+
+inline void free_TPM_PCR_COMPOSITE(TPM_PCR_COMPOSITE* p) {
+   free_TPM_PCR_SELECTION(&p->select);
+   free(p->pcrValue);
+   p->pcrValue = NULL;
+}
+
+typedef struct TPM_KEY {
+  TPM_VERSION         ver;
+  TPM_KEY_USAGE       keyUsage;
+  TPM_KEY_FLAGS       keyFlags;
+  TPM_AUTH_DATA_USAGE authDataUsage;
+  TPM_KEY_PARMS       algorithmParms;
+  UINT32              PCRInfoSize;
+  TPM_PCR_INFO        PCRInfo;
+  TPM_STORE_PUBKEY    pubKey;
+  UINT32              encDataSize;
+  BYTE*               encData;
+} TPM_KEY;
+
+#define TPM_KEY_INIT { .algorithmParms = TPM_KEY_PARMS_INIT,\
+   .PCRInfoSize = 0, .PCRInfo = TPM_PCR_INFO_INIT, \
+   .pubKey = TPM_STORE_PUBKEY_INIT, \
+   .encDataSize = 0, .encData = NULL }
+
+inline void free_TPM_KEY(TPM_KEY* k) {
+   if(k->PCRInfoSize) {
+      free_TPM_PCR_INFO(&k->PCRInfo);
+   }
+   free_TPM_STORE_PUBKEY(&k->pubKey);
+   free(k->encData);
+   k->encData = NULL;
+}
+
+typedef struct TPM_BOUND_DATA {
+  TPM_VERSION ver;
+  TPM_PAYLOAD_TYPE payload;
+  BYTE* payloadData;
+} TPM_BOUND_DATA;
+
+#define TPM_BOUND_DATA_INIT { .payloadData = NULL }
+
+inline void free_TPM_BOUND_DATA(TPM_BOUND_DATA* d) {
+   free(d->payloadData);
+   d->payloadData = NULL;
+}
+
+typedef struct TPM_STORED_DATA {
+  TPM_VERSION ver;
+  UINT32 sealInfoSize;
+  TPM_PCR_INFO sealInfo;
+  UINT32 encDataSize;
+  BYTE* encData;
+} TPM_STORED_DATA;
+
+#define TPM_STORED_DATA_INIT { .sealInfoSize = 0, sealInfo = TPM_PCR_INFO_INIT,\
+   .encDataSize = 0, .encData = NULL }
+
+inline void free_TPM_STORED_DATA(TPM_STORED_DATA* d) {
+   if(d->sealInfoSize) {
+      free_TPM_PCR_INFO(&d->sealInfo);
+   }
+   free(d->encData);
+   d->encData = NULL;
+}
+
+typedef struct TPM_AUTH_SESSION {
+  TPM_AUTHHANDLE  AuthHandle;
+  TPM_NONCE   NonceOdd;   // system
+  TPM_NONCE   NonceEven;   // TPM
+  BOOL   fContinueAuthSession;
+  TPM_AUTHDATA  HMAC;
+} TPM_AUTH_SESSION;
+
+#define TPM_AUTH_SESSION_INIT { .AuthHandle = 0, .fContinueAuthSession = FALSE }
+
+// ---------------------- Functions for checking TPM_RESULTs -----------------
+
+#include <stdio.h>
+
+// FIXME: Review use of these and delete unneeded ones.
+
+// these are really badly dependent on local structure:
+// DEPENDS: local var 'status' of type TPM_RESULT
+// DEPENDS: label 'abort_egress' which cleans up and returns the status
+#define ERRORDIE(s) do { status = s; \
+                         fprintf (stderr, "*** ERRORDIE in %s at %s: %i\n", __func__, __FILE__, __LINE__); \
+                         goto abort_egress; } \
+                    while (0)
+
+// DEPENDS: local var 'status' of type TPM_RESULT
+// DEPENDS: label 'abort_egress' which cleans up and returns the status
+// Try command c. If it fails, set status to s and goto abort.
+#define TPMTRY(s,c) if (c != TPM_SUCCESS) { \
+                       status = s; \
+                       printf("ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
+                       goto abort_egress; \
+                    } else {\
+                       status = c; \
+                    }
+
+// Try command c. If it fails, print error message, set status to actual return code. Goto abort
+#define TPMTRYRETURN(c) do { status = c; \
+                             if (status != TPM_SUCCESS) { \
+                               fprintf(stderr, "ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
+                               goto abort_egress; \
+                             } \
+                        } while(0)
+
+
+#endif //__TCPA_H__
diff --git a/stubdom/vtpmmgr/tpm.c b/stubdom/vtpmmgr/tpm.c
new file mode 100644
index 0000000..123a27c
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm.c
@@ -0,0 +1,938 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <malloc.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <polarssl/sha1.h>
+
+#include "tcg.h"
+#include "tpm.h"
+#include "log.h"
+#include "marshal.h"
+#include "tpmrsa.h"
+#include "vtpmmgr.h"
+
+#define TCPA_MAX_BUFFER_LENGTH 0x2000
+
+#define TPM_BEGIN(TAG, ORD) \
+   const TPM_TAG intag = TAG;\
+TPM_TAG tag = intag;\
+UINT32 paramSize;\
+const TPM_COMMAND_CODE ordinal = ORD;\
+TPM_RESULT status = TPM_SUCCESS;\
+BYTE in_buf[TCPA_MAX_BUFFER_LENGTH];\
+BYTE out_buf[TCPA_MAX_BUFFER_LENGTH];\
+UINT32 out_len = sizeof(out_buf);\
+BYTE* ptr = in_buf;\
+/*Print a log message */\
+vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);\
+/* Pack the header*/\
+ptr = pack_TPM_TAG(ptr, tag);\
+ptr += sizeof(UINT32);\
+ptr = pack_TPM_COMMAND_CODE(ptr, ordinal)\
+
+#define TPM_AUTH_BEGIN() \
+   sha1_context sha1_ctx;\
+BYTE* authbase = ptr - sizeof(TPM_COMMAND_CODE);\
+TPM_DIGEST paramDigest;\
+sha1_starts(&sha1_ctx)
+
+#define TPM_AUTH1_GEN(HMACkey, auth) do {\
+   sha1_finish(&sha1_ctx, paramDigest.digest);\
+   generateAuth(&paramDigest, HMACkey, auth);\
+   ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_AUTH2_GEN(HMACkey, auth) do {\
+   generateAuth(&paramDigest, HMACkey, auth);\
+   ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_TRANSMIT() do {\
+   /* Pack the command size */\
+   paramSize = ptr - in_buf;\
+   pack_UINT32(in_buf + sizeof(TPM_TAG), paramSize);\
+   if((status = TPM_TransmitData(in_buf, paramSize, out_buf, &out_len)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH_VERIFY_BEGIN() do {\
+   UINT32 buf[2] = { cpu_to_be32(status), cpu_to_be32(ordinal) };\
+   sha1_starts(&sha1_ctx);\
+   sha1_update(&sha1_ctx, (unsigned char*)buf, sizeof(buf));\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH1_VERIFY(HMACkey, auth) do {\
+   sha1_finish(&sha1_ctx, paramDigest.digest);\
+   ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+   if((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH2_VERIFY(HMACkey, auth) do {\
+   ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+   if((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+
+
+#define TPM_UNPACK_VERIFY() do { \
+   ptr = out_buf;\
+   ptr = unpack_TPM_RSP_HEADER(ptr, \
+         &(tag), &(paramSize), &(status));\
+   if((status) != TPM_SUCCESS || (tag) != (intag +3)) { \
+      vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s\n", tpm_get_error_name(status));\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH_HASH() do {\
+   sha1_update(&sha1_ctx, authbase, ptr - authbase);\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH_SKIP() do {\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH_ERR_CHECK(auth) do {\
+   if(status != TPM_SUCCESS || auth->fContinueAuthSession == FALSE) {\
+      vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM\n", auth->AuthHandle);\
+      auth->AuthHandle = 0;\
+   }\
+} while(0)
+
+static void xorEncrypt(const TPM_SECRET* sharedSecret,
+      TPM_NONCE* nonce,
+      const TPM_AUTHDATA* inAuth0,
+      TPM_ENCAUTH outAuth0,
+      const TPM_AUTHDATA* inAuth1,
+      TPM_ENCAUTH outAuth1) {
+   BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
+   BYTE XORkey[TPM_DIGEST_SIZE];
+   BYTE* ptr = XORbuffer;
+   ptr = pack_TPM_SECRET(ptr, sharedSecret);
+   ptr = pack_TPM_NONCE(ptr, nonce);
+
+   sha1(XORbuffer, ptr - XORbuffer, XORkey);
+
+   if(inAuth0) {
+      for(int i = 0; i < TPM_DIGEST_SIZE; ++i) {
+         outAuth0[i] = XORkey[i] ^ (*inAuth0)[i];
+      }
+   }
+   if(inAuth1) {
+      for(int i = 0; i < TPM_DIGEST_SIZE; ++i) {
+         outAuth1[i] = XORkey[i] ^ (*inAuth1)[i];
+      }
+   }
+
+}
+
+static void generateAuth(const TPM_DIGEST* paramDigest,
+      const TPM_SECRET* HMACkey,
+      TPM_AUTH_SESSION *auth)
+{
+   //Generate new OddNonce
+   vtpmmgr_rand((BYTE*)auth->NonceOdd.nonce, sizeof(TPM_NONCE));
+
+   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
+   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
+   BYTE* ptr = hmacText;
+
+   ptr = pack_TPM_DIGEST(ptr, paramDigest);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+
+   sha1_hmac((BYTE *) HMACkey, sizeof(TPM_DIGEST),
+         (BYTE *) hmacText, sizeof(hmacText),
+         auth->HMAC);
+}
+
+static TPM_RESULT verifyAuth(const TPM_DIGEST* paramDigest,
+      /*[IN]*/ const TPM_SECRET *HMACkey,
+      /*[IN,OUT]*/ TPM_AUTH_SESSION *auth)
+{
+
+   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
+   TPM_AUTHDATA hm;
+   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
+   BYTE* ptr = hmacText;
+
+   ptr = pack_TPM_DIGEST(ptr, paramDigest);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+
+   sha1_hmac( (BYTE *) HMACkey, sizeof(TPM_DIGEST),
+         (BYTE *) hmacText, sizeof(hmacText),
+         hm);
+
+   // Compare correct HMAC with provided one.
+   if (memcmp(hm, auth->HMAC, sizeof(TPM_DIGEST)) == 0) { // 0 indicates equality
+      return TPM_SUCCESS;
+   } else {
+      vtpmlogerror(VTPM_LOG_TPM, "Auth Session verification failed!\n");
+      return TPM_AUTHFAIL;
+   }
+}
+
+
+
+// ------------------------------------------------------------------
+// Authorization Commands
+// ------------------------------------------------------------------
+
+TPM_RESULT TPM_OIAP(TPM_AUTH_SESSION*   auth)  // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OIAP);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
+   auth->fContinueAuthSession = TRUE;
+
+   ptr = unpack_UINT32(ptr, &auth->AuthHandle);
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OIAP.\n", auth->AuthHandle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_OSAP(TPM_ENTITY_TYPE  entityType,  // in
+      UINT32    entityValue, // in
+      const TPM_AUTHDATA* usageAuth, //in
+      TPM_SECRET *sharedSecret, //out
+      TPM_AUTH_SESSION *auth)
+{
+   BYTE* nonceOddOSAP;
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OSAP);
+
+   ptr = pack_TPM_ENTITY_TYPE(ptr, entityType);
+   ptr = pack_UINT32(ptr, entityValue);
+
+   //nonce Odd OSAP
+   nonceOddOSAP = ptr;
+   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
+   ptr += TPM_DIGEST_SIZE;
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, &auth->AuthHandle);
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+
+   //Calculate session secret
+   sha1_context ctx;
+   sha1_hmac_starts(&ctx, *usageAuth, TPM_DIGEST_SIZE);
+   sha1_hmac_update(&ctx, ptr, TPM_DIGEST_SIZE); //ptr = nonceEvenOSAP
+   sha1_hmac_update(&ctx, nonceOddOSAP, TPM_DIGEST_SIZE);
+   sha1_hmac_finish(&ctx, *sharedSecret);
+
+   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
+   auth->fContinueAuthSession = FALSE;
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OSAP.\n", auth->AuthHandle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_TakeOwnership(
+      const TPM_PUBKEY *pubEK, //in
+      const TPM_AUTHDATA* ownerAuth, //in
+      const TPM_AUTHDATA* srkAuth, //in
+      const TPM_KEY* inSrk, //in
+      TPM_KEY* outSrk, //out, optional
+      TPM_AUTH_SESSION*   auth)   // in, out
+{
+   int keyAlloced = 0;
+   tpmrsa_context ek_rsa = TPMRSA_CTX_INIT;
+
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_TakeOwnership);
+   TPM_AUTH_BEGIN();
+
+   tpmrsa_set_pubkey(&ek_rsa,
+         pubEK->pubKey.key, pubEK->pubKey.keyLength,
+         pubEK->algorithmParms.parms.rsa.exponent,
+         pubEK->algorithmParms.parms.rsa.exponentSize);
+
+   /* Pack the protocol ID */
+   ptr = pack_UINT16(ptr, TPM_PID_OWNER);
+
+   /* Pack the encrypted owner auth */
+   ptr = pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength / 8);
+   tpmrsa_pub_encrypt_oaep(&ek_rsa,
+         ctr_drbg_random, &vtpm_globals.ctr_drbg,
+         sizeof(TPM_SECRET),
+         (BYTE*) ownerAuth,
+         ptr);
+   ptr += pubEK->algorithmParms.parms.rsa.keyLength / 8;
+
+   /* Pack the encrypted srk auth */
+   ptr = pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength / 8);
+   tpmrsa_pub_encrypt_oaep(&ek_rsa,
+         ctr_drbg_random, &vtpm_globals.ctr_drbg,
+         sizeof(TPM_SECRET),
+         (BYTE*) srkAuth,
+         ptr);
+   ptr += pubEK->algorithmParms.parms.rsa.keyLength / 8;
+
+   /* Pack the Srk key */
+   ptr = pack_TPM_KEY(ptr, inSrk);
+
+   /* Hash everything up to here */
+   TPM_AUTH_HASH();
+
+   /* Generate the authorization */
+   TPM_AUTH1_GEN(ownerAuth, auth);
+
+   /* Send the command to the tpm*/
+   TPM_TRANSMIT();
+   /* Unpack and validate the header */
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   if(outSrk != NULL) {
+      /* If the user wants a copy of the srk we give it to them */
+      keyAlloced = 1;
+      ptr = unpack_TPM_KEY(ptr, outSrk, UNPACK_ALLOC);
+   } else {
+      /*otherwise just parse past it */
+      TPM_KEY temp;
+      ptr = unpack_TPM_KEY(ptr, &temp, UNPACK_ALIAS);
+   }
+
+   /* Hash the output key */
+   TPM_AUTH_HASH();
+
+   /* Verify authorizaton */
+   TPM_AUTH1_VERIFY(ownerAuth, auth);
+
+   goto egress;
+abort_egress:
+   if(keyAlloced) {
+      free_TPM_KEY(outSrk);
+   }
+egress:
+   tpmrsa_free(&ek_rsa);
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+
+TPM_RESULT TPM_DisablePubekRead (
+      const TPM_AUTHDATA* ownerAuth,
+      TPM_AUTH_SESSION*   auth)
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_DisablePubekRead);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(ownerAuth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   TPM_AUTH1_VERIFY(ownerAuth, auth);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+
+TPM_RESULT TPM_TerminateHandle(TPM_AUTHHANDLE  handle)  // in
+{
+   if(handle == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Terminate_Handle);
+
+   ptr = pack_TPM_AUTHHANDLE(ptr, handle);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM_TerminateHandle\n", handle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_Extend( TPM_PCRINDEX  pcrNum,  // in
+      TPM_DIGEST  inDigest, // in
+      TPM_PCRVALUE*  outDigest) // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Extend);
+
+   ptr = pack_TPM_PCRINDEX(ptr, pcrNum);
+   ptr = pack_TPM_DIGEST(ptr, &inDigest);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_TPM_PCRVALUE(ptr, outDigest);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_Seal(
+      TPM_KEY_HANDLE  keyHandle,  // in
+      UINT32    pcrInfoSize, // in
+      TPM_PCR_INFO*    pcrInfo,  // in
+      UINT32    inDataSize,  // in
+      const BYTE*    inData,   // in
+      TPM_STORED_DATA* sealedData, //out
+      const TPM_SECRET* osapSharedSecret, //in
+      const TPM_AUTHDATA* sealedDataAuth, //in
+      TPM_AUTH_SESSION*   pubAuth  // in, out
+      )
+{
+   int dataAlloced = 0;
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_Seal);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, keyHandle);
+
+   TPM_AUTH_SKIP();
+
+   xorEncrypt(osapSharedSecret, &pubAuth->NonceEven,
+         sealedDataAuth, ptr,
+         NULL, NULL);
+   ptr += sizeof(TPM_ENCAUTH);
+
+   ptr = pack_UINT32(ptr, pcrInfoSize);
+   ptr = pack_TPM_PCR_INFO(ptr, pcrInfo);
+
+   ptr = pack_UINT32(ptr, inDataSize);
+   ptr = pack_BUFFER(ptr, inData, inDataSize);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(osapSharedSecret, pubAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_TPM_STORED_DATA(ptr, sealedData, UNPACK_ALLOC);
+   dataAlloced = 1;
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(osapSharedSecret, pubAuth);
+
+   goto egress;
+abort_egress:
+   if(dataAlloced) {
+      free_TPM_STORED_DATA(sealedData);
+   }
+egress:
+   TPM_AUTH_ERR_CHECK(pubAuth);
+   return status;
+}
+
+TPM_RESULT TPM_Unseal(
+      TPM_KEY_HANDLE parentHandle, // in
+      const TPM_STORED_DATA* sealedData,
+      UINT32*   outSize,  // out
+      BYTE**    out, //out
+      const TPM_AUTHDATA* key_usage_auth, //in
+      const TPM_AUTHDATA* data_usage_auth, //in
+      TPM_AUTH_SESSION*   keyAuth,  // in, out
+      TPM_AUTH_SESSION*   dataAuth  // in, out
+      )
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH2_COMMAND, TPM_ORD_Unseal);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, parentHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_TPM_STORED_DATA(ptr, sealedData);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(key_usage_auth, keyAuth);
+   TPM_AUTH2_GEN(data_usage_auth, dataAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, outSize);
+   ptr = unpack_ALLOC(ptr, out, *outSize);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(key_usage_auth, keyAuth);
+   TPM_AUTH2_VERIFY(data_usage_auth, dataAuth);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(keyAuth);
+   TPM_AUTH_ERR_CHECK(dataAuth);
+   return status;
+}
+
+TPM_RESULT TPM_Bind(
+      const TPM_KEY* key,
+      const BYTE* in,
+      UINT32 ilen,
+      BYTE* out)
+{
+   TPM_RESULT status;
+   tpmrsa_context rsa = TPMRSA_CTX_INIT;
+   TPM_BOUND_DATA boundData;
+   uint8_t plain[TCPA_MAX_BUFFER_LENGTH];
+   BYTE* ptr = plain;
+
+   vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);
+
+   tpmrsa_set_pubkey(&rsa,
+         key->pubKey.key, key->pubKey.keyLength,
+         key->algorithmParms.parms.rsa.exponent,
+         key->algorithmParms.parms.rsa.exponentSize);
+
+   // Fill boundData's accessory information
+   boundData.ver = TPM_STRUCT_VER_1_1;
+   boundData.payload = TPM_PT_BIND;
+   boundData.payloadData = (BYTE*)in;
+
+   //marshall the bound data object
+   ptr = pack_TPM_BOUND_DATA(ptr, &boundData, ilen);
+
+   // Encrypt the data
+   TPMTRYRETURN(tpmrsa_pub_encrypt_oaep(&rsa,
+            ctr_drbg_random, &vtpm_globals.ctr_drbg,
+            ptr - plain,
+            plain,
+            out));
+
+abort_egress:
+   tpmrsa_free(&rsa);
+   return status;
+
+}
+
+TPM_RESULT TPM_UnBind(
+      TPM_KEY_HANDLE  keyHandle,  // in
+      UINT32 ilen, //in
+      const BYTE* in, //
+      UINT32* olen, //
+      BYTE*    out, //out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth //in, out
+      )
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_UnBind);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, keyHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_UINT32(ptr, ilen);
+   ptr = pack_BUFFER(ptr, in, ilen);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(usage_auth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, olen);
+   if(*olen > ilen) {
+      vtpmlogerror(VTPM_LOG_TPM, "Output length < input length!\n");
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+   ptr = unpack_BUFFER(ptr, out, *olen);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(usage_auth, auth);
+
+abort_egress:
+egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+TPM_RESULT TPM_CreateWrapKey(
+      TPM_KEY_HANDLE  hWrappingKey,  // in
+      const TPM_AUTHDATA* osapSharedSecret,
+      const TPM_AUTHDATA* dataUsageAuth, //in
+      const TPM_AUTHDATA* dataMigrationAuth, //in
+      TPM_KEY*     key, //in, out
+      TPM_AUTH_SESSION*   pAuth)    // in, out
+{
+   int keyAlloced = 0;
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_CreateWrapKey);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, hWrappingKey);
+
+   TPM_AUTH_SKIP();
+
+   //Encrypted auths
+   xorEncrypt(osapSharedSecret, &pAuth->NonceEven,
+         dataUsageAuth, ptr,
+         dataMigrationAuth, ptr + sizeof(TPM_ENCAUTH));
+   ptr += sizeof(TPM_ENCAUTH) * 2;
+
+   ptr = pack_TPM_KEY(ptr, key);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(osapSharedSecret, pAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   keyAlloced = 1;
+   ptr = unpack_TPM_KEY(ptr, key, UNPACK_ALLOC);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(osapSharedSecret, pAuth);
+
+   goto egress;
+abort_egress:
+   if(keyAlloced) {
+      free_TPM_KEY(key);
+   }
+egress:
+   TPM_AUTH_ERR_CHECK(pAuth);
+   return status;
+}
+
+TPM_RESULT TPM_LoadKey(
+      TPM_KEY_HANDLE  parentHandle, //
+      const TPM_KEY* key, //in
+      TPM_HANDLE*  keyHandle,    // out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth)
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_LoadKey);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, parentHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_TPM_KEY(ptr, key);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(usage_auth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, keyHandle);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(usage_auth, auth);
+
+   vtpmloginfo(VTPM_LOG_TPM, "Key Handle: 0x%x opened by TPM_LoadKey\n", *keyHandle);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+TPM_RESULT TPM_EvictKey( TPM_KEY_HANDLE  hKey)  // in
+{
+   if(hKey == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_EvictKey);
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, hKey);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   vtpmloginfo(VTPM_LOG_TPM, "Key handle: 0x%x closed by TPM_EvictKey\n", hKey);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle,
+      TPM_RESOURCE_TYPE rt) {
+   if(handle == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_FlushSpecific);
+
+   ptr = pack_TPM_HANDLE(ptr, handle);
+   ptr = pack_TPM_RESOURCE_TYPE(ptr, rt);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_GetRandom( UINT32*    bytesRequested, // in, out
+      BYTE*    randomBytes) // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetRandom);
+
+   // check input params
+   if (bytesRequested == NULL || randomBytes == NULL){
+      return TPM_BAD_PARAMETER;
+   }
+
+   ptr = pack_UINT32(ptr, *bytesRequested);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, bytesRequested);
+   ptr = unpack_BUFFER(ptr, randomBytes, *bytesRequested);
+
+abort_egress:
+   return status;
+}
+
+
+TPM_RESULT TPM_ReadPubek(
+      TPM_PUBKEY* pubEK //out
+      )
+{
+   BYTE* antiReplay = NULL;
+   BYTE* kptr = NULL;
+   BYTE digest[TPM_DIGEST_SIZE];
+   sha1_context ctx;
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_ReadPubek);
+
+   //antiReplay nonce
+   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
+   antiReplay = ptr;
+   ptr += TPM_DIGEST_SIZE;
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   //unpack and allocate the key
+   kptr = ptr;
+   ptr = unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
+
+   //Verify the checksum
+   sha1_starts(&ctx);
+   sha1_update(&ctx, kptr, ptr - kptr);
+   sha1_update(&ctx, antiReplay, TPM_DIGEST_SIZE);
+   sha1_finish(&ctx, digest);
+
+   //ptr points to the checksum computed by TPM
+   if(memcmp(digest, ptr, TPM_DIGEST_SIZE)) {
+      vtpmlogerror(VTPM_LOG_TPM, "TPM_ReadPubek: Checksum returned by TPM was invalid!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   goto egress;
+abort_egress:
+   if(kptr != NULL) { //If we unpacked the pubEK, we have to free it
+      free_TPM_PUBKEY(pubEK);
+   }
+egress:
+   return status;
+}
+
+
+TPM_RESULT TPM_SaveState(void)
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_SaveState);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_GetCapability(
+      TPM_CAPABILITY_AREA capArea,
+      UINT32 subCapSize,
+      const BYTE* subCap,
+      UINT32* respSize,
+      BYTE** resp)
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetCapability);
+
+   ptr = pack_TPM_CAPABILITY_AREA(ptr, capArea);
+   ptr = pack_UINT32(ptr, subCapSize);
+   ptr = pack_BUFFER(ptr, subCap, subCapSize);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, respSize);
+   ptr = unpack_ALLOC(ptr, resp, *respSize);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_CreateEndorsementKeyPair(
+      const TPM_KEY_PARMS* keyInfo,
+      TPM_PUBKEY* pubEK)
+{
+   BYTE* kptr = NULL;
+   sha1_context ctx;
+   TPM_DIGEST checksum;
+   TPM_DIGEST hash;
+   TPM_NONCE antiReplay;
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_CreateEndorsementKeyPair);
+
+   //Make anti replay nonce
+   vtpmmgr_rand(antiReplay.nonce, sizeof(antiReplay.nonce));
+
+   ptr = pack_TPM_NONCE(ptr, &antiReplay);
+   ptr = pack_TPM_KEY_PARMS(ptr, keyInfo);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   sha1_starts(&ctx);
+
+   kptr = ptr;
+   ptr = unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
+
+   /* Hash the pub key blob */
+   sha1_update(&ctx, kptr, ptr - kptr);
+   ptr = unpack_TPM_DIGEST(ptr, &checksum);
+
+   sha1_update(&ctx, antiReplay.nonce, sizeof(antiReplay.nonce));
+
+   sha1_finish(&ctx, hash.digest);
+   if(memcmp(checksum.digest, hash.digest, TPM_DIGEST_SIZE)) {
+      vtpmloginfo(VTPM_LOG_VTPM, "TPM_CreateEndorsementKey: Checkum verification failed!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   goto egress;
+abort_egress:
+   if(kptr) {
+      free_TPM_PUBKEY(pubEK);
+   }
+egress:
+   return status;
+}
+
+TPM_RESULT TPM_TransmitData(
+      BYTE* in,
+      UINT32 insize,
+      BYTE* out,
+      UINT32* outsize) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   UINT32 i;
+   vtpmloginfo(VTPM_LOG_TXDATA, "Sending buffer = 0x");
+   for(i = 0 ; i < insize ; i++)
+      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", in[i]);
+
+   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
+
+   ssize_t size = 0;
+
+   // send the request
+   size = write (vtpm_globals.tpm_fd, in, insize);
+   if (size < 0) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "write() failed : %s\n", strerror(errno));
+      ERRORDIE (TPM_IOERROR);
+   }
+   else if ((UINT32) size < insize) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "Wrote %d instead of %d bytes!\n", (int) size, insize);
+      ERRORDIE (TPM_IOERROR);
+   }
+
+   // read the response
+   size = read (vtpm_globals.tpm_fd, out, *outsize);
+   if (size < 0) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "read() failed : %s\n", strerror(errno));
+      ERRORDIE (TPM_IOERROR);
+   }
+
+   vtpmloginfo(VTPM_LOG_TXDATA, "Receiving buffer = 0x");
+   for(i = 0 ; i < size ; i++)
+      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out[i]);
+
+   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
+
+   *outsize = size;
+   goto egress;
+
+abort_egress:
+egress:
+   return status;
+}
diff --git a/stubdom/vtpmmgr/tpm.h b/stubdom/vtpmmgr/tpm.h
new file mode 100644
index 0000000..304e145
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm.h
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005/2006, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __TPM_H__
+#define __TPM_H__
+
+#include "tcg.h"
+
+// ------------------------------------------------------------------
+// Exposed API
+// ------------------------------------------------------------------
+
+// TPM v1.1B Command Set
+
+// Authorzation
+TPM_RESULT TPM_OIAP(
+      TPM_AUTH_SESSION*   auth //out
+      );
+
+TPM_RESULT TPM_OSAP (
+      TPM_ENTITY_TYPE entityType,  // in
+      UINT32    entityValue, // in
+      const TPM_AUTHDATA* usageAuth, //in
+      TPM_SECRET *sharedSecret, //out
+      TPM_AUTH_SESSION *auth);
+
+TPM_RESULT TPM_TakeOwnership(
+      const TPM_PUBKEY *pubEK, //in
+      const TPM_AUTHDATA* ownerAuth, //in
+      const TPM_AUTHDATA* srkAuth, //in
+      const TPM_KEY* inSrk, //in
+      TPM_KEY* outSrk, //out, optional
+      TPM_AUTH_SESSION*   auth   // in, out
+      );
+
+TPM_RESULT TPM_DisablePubekRead (
+      const TPM_AUTHDATA* ownerAuth,
+      TPM_AUTH_SESSION*   auth
+      );
+
+TPM_RESULT TPM_TerminateHandle ( TPM_AUTHHANDLE  handle  // in
+      );
+
+TPM_RESULT TPM_FlushSpecific ( TPM_HANDLE  handle,  // in
+      TPM_RESOURCE_TYPE resourceType //in
+      );
+
+// TPM Mandatory
+TPM_RESULT TPM_Extend ( TPM_PCRINDEX  pcrNum,  // in
+      TPM_DIGEST   inDigest, // in
+      TPM_PCRVALUE*   outDigest // out
+      );
+
+TPM_RESULT TPM_PcrRead ( TPM_PCRINDEX  pcrNum,  // in
+      TPM_PCRVALUE*  outDigest // out
+      );
+
+TPM_RESULT TPM_Quote ( TCS_KEY_HANDLE  keyHandle,  // in
+      TPM_NONCE   antiReplay,  // in
+      UINT32*    PcrDataSize, // in, out
+      BYTE**    PcrData,  // in, out
+      TPM_AUTH_SESSION*   privAuth,  // in, out
+      UINT32*    sigSize,  // out
+      BYTE**    sig    // out
+      );
+
+TPM_RESULT TPM_Seal(
+      TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32    pcrInfoSize, // in
+      TPM_PCR_INFO*    pcrInfo,  // in
+      UINT32    inDataSize,  // in
+      const BYTE*    inData,   // in
+      TPM_STORED_DATA* sealedData, //out
+      const TPM_SECRET* osapSharedSecret, //in
+      const TPM_AUTHDATA* sealDataAuth, //in
+      TPM_AUTH_SESSION*   pubAuth  // in, out
+      );
+
+TPM_RESULT TPM_Unseal (
+      TPM_KEY_HANDLE parentHandle, // in
+      const TPM_STORED_DATA* sealedData,
+      UINT32*   outSize,  // out
+      BYTE**    out, //out
+      const TPM_AUTHDATA* key_usage_auth, //in
+      const TPM_AUTHDATA* data_usage_auth, //in
+      TPM_AUTH_SESSION*   keyAuth,  // in, out
+      TPM_AUTH_SESSION*   dataAuth  // in, out
+      );
+
+TPM_RESULT TPM_DirWriteAuth ( TPM_DIRINDEX  dirIndex,  // in
+      TPM_DIRVALUE  newContents, // in
+      TPM_AUTH_SESSION*   ownerAuth  // in, out
+      );
+
+TPM_RESULT TPM_DirRead ( TPM_DIRINDEX  dirIndex, // in
+      TPM_DIRVALUE*  dirValue // out
+      );
+
+TPM_RESULT TPM_Bind(
+      const TPM_KEY* key, //in
+      const BYTE* in, //in
+      UINT32 ilen, //in
+      BYTE* out //out, must be at least cipher block size
+      );
+
+TPM_RESULT TPM_UnBind (
+      TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32 ilen, //in
+      const BYTE* in, //
+      UINT32*   outDataSize, // out
+      BYTE*    outData, //out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth //in, out
+      );
+
+TPM_RESULT TPM_CreateWrapKey (
+      TCS_KEY_HANDLE  hWrappingKey,  // in
+      const TPM_AUTHDATA* osapSharedSecret,
+      const TPM_AUTHDATA* dataUsageAuth, //in
+      const TPM_AUTHDATA* dataMigrationAuth, //in
+      TPM_KEY*     key, //in
+      TPM_AUTH_SESSION*   pAuth    // in, out
+      );
+
+TPM_RESULT TPM_LoadKey (
+      TPM_KEY_HANDLE  parentHandle, //
+      const TPM_KEY* key, //in
+      TPM_HANDLE*  keyHandle,    // out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth
+      );
+
+TPM_RESULT TPM_GetPubKey (  TCS_KEY_HANDLE  hKey,   // in
+      TPM_AUTH_SESSION*   pAuth,   // in, out
+      UINT32*    pcPubKeySize, // out
+      BYTE**    prgbPubKey  // out
+      );
+
+TPM_RESULT TPM_EvictKey ( TCS_KEY_HANDLE  hKey  // in
+      );
+
+TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle, //in
+      TPM_RESOURCE_TYPE rt //in
+      );
+
+TPM_RESULT TPM_Sign ( TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32    areaToSignSize, // in
+      BYTE*    areaToSign,  // in
+      TPM_AUTH_SESSION*   privAuth,  // in, out
+      UINT32*    sigSize,  // out
+      BYTE**    sig    // out
+      );
+
+TPM_RESULT TPM_GetRandom (  UINT32*    bytesRequested, // in, out
+      BYTE*    randomBytes  // out
+      );
+
+TPM_RESULT TPM_StirRandom (  UINT32    inDataSize, // in
+      BYTE*    inData  // in
+      );
+
+TPM_RESULT TPM_ReadPubek (
+      TPM_PUBKEY* pubEK //out
+      );
+
+TPM_RESULT TPM_GetCapability(
+      TPM_CAPABILITY_AREA capArea,
+      UINT32 subCapSize,
+      const BYTE* subCap,
+      UINT32* respSize,
+      BYTE** resp);
+
+TPM_RESULT TPM_SaveState(void);
+
+TPM_RESULT TPM_CreateEndorsementKeyPair(
+      const TPM_KEY_PARMS* keyInfo,
+      TPM_PUBKEY* pubEK);
+
+TPM_RESULT TPM_TransmitData(
+      BYTE* in,
+      UINT32 insize,
+      BYTE* out,
+      UINT32* outsize);
+
+#endif //TPM_H
diff --git a/stubdom/vtpmmgr/tpmrsa.c b/stubdom/vtpmmgr/tpmrsa.c
new file mode 100644
index 0000000..56094e7
--- /dev/null
+++ b/stubdom/vtpmmgr/tpmrsa.c
@@ -0,0 +1,175 @@
+/*
+ *  The RSA public-key cryptosystem
+ *
+ *  Copyright (C) 2006-2011, Brainspark B.V.
+ *
+ *  This file is part of PolarSSL (http://www.polarssl.org)
+ *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
+ *
+ *  All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ *  RSA was designed by Ron Rivest, Adi Shamir and Len Adleman.
+ *
+ *  http://theory.lcs.mit.edu/~rivest/rsapaper.pdf
+ *  http://www.cacr.math.uwaterloo.ca/hac/about/chap8.pdf
+ */
+
+#include "tcg.h"
+#include "polarssl/sha1.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "tpmrsa.h"
+
+#define HASH_LEN 20
+
+void tpmrsa_set_pubkey(tpmrsa_context* ctx,
+      const unsigned char* key,
+      int keylen,
+      const unsigned char* exponent,
+      int explen) {
+
+   tpmrsa_free(ctx);
+
+   if(explen == 0) { //Default e= 2^16+1
+      mpi_lset(&ctx->E, 65537);
+   } else {
+      mpi_read_binary(&ctx->E, exponent, explen);
+   }
+   mpi_read_binary(&ctx->N, key, keylen);
+
+   ctx->len = ( mpi_msb(&ctx->N) + 7) >> 3;
+}
+
+static TPM_RESULT tpmrsa_public( tpmrsa_context *ctx,
+      const unsigned char *input,
+      unsigned char *output )
+{
+   int ret;
+   size_t olen;
+   mpi T;
+
+   mpi_init( &T );
+
+   MPI_CHK( mpi_read_binary( &T, input, ctx->len ) );
+
+   if( mpi_cmp_mpi( &T, &ctx->N ) >= 0 )
+   {
+      mpi_free( &T );
+      return TPM_ENCRYPT_ERROR;
+   }
+
+   olen = ctx->len;
+   MPI_CHK( mpi_exp_mod( &T, &T, &ctx->E, &ctx->N, &ctx->RN ) );
+   MPI_CHK( mpi_write_binary( &T, output, olen ) );
+
+cleanup:
+
+   mpi_free( &T );
+
+   if( ret != 0 )
+      return TPM_ENCRYPT_ERROR;
+
+   return TPM_SUCCESS;
+}
+
+static void mgf_mask( unsigned char *dst, int dlen, unsigned char *src, int slen)
+{
+   unsigned char mask[HASH_LEN];
+   unsigned char counter[4] = {0, 0, 0, 0};
+   int i;
+   sha1_context mctx;
+
+   //We always hash the src with the counter, so save the partial hash
+   sha1_starts(&mctx);
+   sha1_update(&mctx, src, slen);
+
+   // Generate and apply dbMask
+   while(dlen > 0) {
+      //Copy the sha1 context
+      sha1_context ctx = mctx;
+
+      //compute hash for input || counter
+      sha1_update(&ctx, counter, sizeof(counter));
+      sha1_finish(&ctx, mask);
+
+      //Apply the mask
+      for(i = 0; i < (dlen < HASH_LEN ? dlen : HASH_LEN); ++i) {
+         *(dst++) ^= mask[i];
+      }
+
+      //Increment counter
+      ++counter[3];
+
+      dlen -= HASH_LEN;
+   }
+}
+
+/*
+ * Add the message padding, then do an RSA operation
+ */
+TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
+      int (*f_rng)(void *, unsigned char *, size_t),
+      void *p_rng,
+      size_t ilen,
+      const unsigned char *input,
+      unsigned char *output )
+{
+   int ret;
+   int olen;
+   unsigned char* seed = output + 1;
+   unsigned char* db = output + HASH_LEN +1;
+
+   olen = ctx->len-1;
+
+   if( f_rng == NULL )
+      return TPM_ENCRYPT_ERROR;
+
+   if( ilen > olen - 2 * HASH_LEN - 1)
+      return TPM_ENCRYPT_ERROR;
+
+   output[0] = 0;
+
+   //Encoding parameter p
+   sha1((unsigned char*)"TCPA", 4, db);
+
+   //PS
+   memset(db + HASH_LEN, 0,
+         olen - ilen - 2 * HASH_LEN - 1);
+
+   //constant 1 byte
+   db[olen - ilen - HASH_LEN -1] = 0x01;
+
+   //input string
+   memcpy(db + olen - ilen - HASH_LEN,
+         input, ilen);
+
+   //Generate random seed
+   if( ( ret = f_rng( p_rng, seed, HASH_LEN ) ) != 0 )
+      return TPM_ENCRYPT_ERROR;
+
+   // maskedDB: Apply dbMask to DB
+   mgf_mask( db, olen - HASH_LEN, seed, HASH_LEN);
+
+   // maskedSeed: Apply seedMask to seed
+   mgf_mask( seed, HASH_LEN, db, olen - HASH_LEN);
+
+   // Do the crypto op
+   return tpmrsa_public(ctx, output, output);
+}
diff --git a/stubdom/vtpmmgr/tpmrsa.h b/stubdom/vtpmmgr/tpmrsa.h
new file mode 100644
index 0000000..59579e7
--- /dev/null
+++ b/stubdom/vtpmmgr/tpmrsa.h
@@ -0,0 +1,67 @@
+/**
+ * \file rsa.h
+ *
+ * \brief The RSA public-key cryptosystem
+ *
+ *  Copyright (C) 2006-2010, Brainspark B.V.
+ *
+ *  This file is part of PolarSSL (http://www.polarssl.org)
+ *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
+ *
+ *  All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef TPMRSA_H
+#define TPMRSA_H
+
+#include "tcg.h"
+#include <polarssl/bignum.h>
+
+/* tpm software key */
+typedef struct
+{
+    size_t len;                 /*!<  size(N) in chars  */
+
+    mpi N;                      /*!<  public modulus    */
+    mpi E;                      /*!<  public exponent   */
+
+    mpi RN;                     /*!<  cached R^2 mod N  */
+}
+tpmrsa_context;
+
+#define TPMRSA_CTX_INIT { 0, {0, 0, NULL}, {0, 0, NULL}, {0, 0, NULL}}
+
+/* Setup the rsa context using tpm public key data */
+void tpmrsa_set_pubkey(tpmrsa_context* ctx,
+      const unsigned char* key,
+      int keylen,
+      const unsigned char* exponent,
+      int explen);
+
+/* Do rsa public crypto */
+TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
+      int (*f_rng)(void *, unsigned char *, size_t),
+      void *p_rng,
+      size_t ilen,
+      const unsigned char *input,
+      unsigned char *output );
+
+/* free tpmrsa key */
+inline void tpmrsa_free( tpmrsa_context *ctx ) {
+   mpi_free( &ctx->RN ); mpi_free( &ctx->E  ); mpi_free( &ctx->N  );
+}
+
+#endif /* tpmrsa.h */
diff --git a/stubdom/vtpmmgr/uuid.h b/stubdom/vtpmmgr/uuid.h
new file mode 100644
index 0000000..4737645
--- /dev/null
+++ b/stubdom/vtpmmgr/uuid.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPMMGR_UUID_H
+#define VTPMMGR_UUID_H
+
+#define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
+#define UUID_FMTLEN ((2*16)+4) /* 16 hex bytes plus 4 hypens */
+#define UUID_BYTES(uuid) uuid[0], uuid[1], uuid[2], uuid[3], \
+                                uuid[4], uuid[5], uuid[6], uuid[7], \
+                                uuid[8], uuid[9], uuid[10], uuid[11], \
+                                uuid[12], uuid[13], uuid[14], uuid[15]
+
+
+typedef uint8_t uuid_t[16];
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_cmd_handler.c b/stubdom/vtpmmgr/vtpm_cmd_handler.c
new file mode 100644
index 0000000..f82a2a9
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_cmd_handler.c
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <inttypes.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "marshal.h"
+#include "log.h"
+#include "vtpm_storage.h"
+#include "vtpmmgr.h"
+#include "tpm.h"
+#include "tcg.h"
+
+static TPM_RESULT vtpmmgr_SaveHashKey(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+
+   if(tpmcmd->req_len != VTPM_COMMAND_HEADER_SIZE + HASHKEYSZ) {
+      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_ORD_SAVEHASHKEY hashkey too short!\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   /* Do the command */
+   TPMTRYRETURN(vtpm_storage_save_hashkey(uuid, tpmcmd->req + VTPM_COMMAND_HEADER_SIZE));
+
+abort_egress:
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         VTPM_TAG_RSP, VTPM_COMMAND_HEADER_SIZE, status);
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+
+   return status;
+}
+
+static TPM_RESULT vtpmmgr_LoadHashKey(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+
+   TPMTRYRETURN(vtpm_storage_load_hashkey(uuid, tpmcmd->resp + VTPM_COMMAND_HEADER_SIZE));
+
+   tpmcmd->resp_len += HASHKEYSZ;
+
+abort_egress:
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         VTPM_TAG_RSP, tpmcmd->resp_len, status);
+
+   return status;
+}
+
+
+TPM_RESULT vtpmmgr_handle_cmd(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_TAG tag;
+   UINT32 size;
+   TPM_COMMAND_CODE ord;
+
+   unpack_TPM_RQU_HEADER(tpmcmd->req,
+         &tag, &size, &ord);
+
+   /* Handle the command now */
+   switch(tag) {
+      case VTPM_TAG_REQ:
+         //This is a vTPM command
+         switch(ord) {
+            case VTPM_ORD_SAVEHASHKEY:
+               return vtpmmgr_SaveHashKey(uuid, tpmcmd);
+            case VTPM_ORD_LOADHASHKEY:
+               return vtpmmgr_LoadHashKey(uuid, tpmcmd);
+            default:
+               vtpmlogerror(VTPM_LOG_VTPM, "Invalid vTPM Ordinal %" PRIu32 "\n", ord);
+               status = TPM_BAD_ORDINAL;
+         }
+         break;
+      case TPM_TAG_RQU_COMMAND:
+      case TPM_TAG_RQU_AUTH1_COMMAND:
+      case TPM_TAG_RQU_AUTH2_COMMAND:
+         //This is a TPM passthrough command
+         switch(ord) {
+            case TPM_ORD_GetRandom:
+               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_GetRandom\n");
+               break;
+            case TPM_ORD_PcrRead:
+               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_PcrRead\n");
+               break;
+            default:
+               vtpmlogerror(VTPM_LOG_VTPM, "TPM Disallowed Passthrough ord=%" PRIu32 "\n", ord);
+               status = TPM_DISABLED_CMD;
+               goto abort_egress;
+         }
+
+         size = TCPA_MAX_BUFFER_LENGTH;
+         TPMTRYRETURN(TPM_TransmitData(tpmcmd->req, tpmcmd->req_len, tpmcmd->resp, &size));
+         tpmcmd->resp_len = size;
+
+         unpack_TPM_RESULT(tpmcmd->resp + sizeof(TPM_TAG) + sizeof(UINT32), &status);
+         return status;
+
+         break;
+      default:
+         vtpmlogerror(VTPM_LOG_VTPM, "Invalid tag=%" PRIu16 "\n", tag);
+         status = TPM_BADTAG;
+   }
+
+abort_egress:
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         tag + 3, tpmcmd->resp_len, status);
+
+   return status;
+}
diff --git a/stubdom/vtpmmgr/vtpm_manager.h b/stubdom/vtpmmgr/vtpm_manager.h
new file mode 100644
index 0000000..a2bbcca
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_manager.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPM_MANAGER_H
+#define VTPM_MANAGER_H
+
+#define VTPM_TAG_REQ 0x01c1
+#define VTPM_TAG_RSP 0x01c4
+#define COMMAND_BUFFER_SIZE 4096
+
+// Header size
+#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
+
+//************************ Command Codes ****************************
+#define VTPM_ORD_BASE       0x0000
+#define VTPM_PRIV_MASK      0x01000000 // Priviledged VTPM Command
+#define VTPM_PRIV_BASE      (VTPM_ORD_BASE | VTPM_PRIV_MASK)
+
+// Non-priviledged VTPM Commands (From DMI's)
+#define VTPM_ORD_SAVEHASHKEY      (VTPM_ORD_BASE + 1) // DMI requests encryption key for persistent storage
+#define VTPM_ORD_LOADHASHKEY      (VTPM_ORD_BASE + 2) // DMI requests symkey to be regenerated
+
+//************************ Return Codes ****************************
+#define VTPM_SUCCESS               0
+#define VTPM_FAIL                  1
+#define VTPM_UNSUPPORTED           2
+#define VTPM_FORBIDDEN             3
+#define VTPM_RESTORE_CONTEXT_FAILED    4
+#define VTPM_INVALID_REQUEST       5
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_storage.c b/stubdom/vtpmmgr/vtpm_storage.c
new file mode 100644
index 0000000..3862fdb
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_storage.c
@@ -0,0 +1,783 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+/***************************************************************
+ * DISK IMAGE LAYOUT
+ * *************************************************************
+ * All data is stored in BIG ENDIAN format
+ * *************************************************************
+ * Section 1: Header
+ *
+ * 10 bytes 	id			ID String "VTPMMGRDOM"
+ * uint32_t	version	Disk 		Image version number (current == 1)
+ * uint32_t     storage_key_len		Length of the Boot Key
+ * BYTEARRAY    storage_key		TPM boot key
+ *
+ * *************************************************************
+ * Section 2: Key Data Table (starts at offset 4096)
+ *
+ * This is a list of blocks, each is RSA_CIPHER_SIZE long
+ * and is encrypted with the storage key.
+ *
+ * The first block always exists and it contains:
+ * uint32_t num_vtpms                   Number of vtpms (number of remaining blocks)
+ *
+ * The rest of the blocks look like this:
+ * 16 bytes	uuid			uuid of the owner of this key and hash
+ * 20 bytes	hash			Sha1 hash of vTPM's data, supplied by vTPM
+ * 32 bytes	key			AES-256 Encryption Key, supplied by vTPM
+ *
+ * *************************************************************
+ */
+#define DISKVERS 1
+#define IDSTR "VTPMMGRDOM"
+#define IDSTRLEN 10
+#define AES_BLOCK_SIZE 16
+#define AES_KEY_BITS 256
+#define AES_KEY_SIZE (AES_KEY_BITS/8)
+#define BUF_SIZE 4096
+
+#define UUID_TBL_ENT_SIZE (sizeof(uuid_t) + sizeof(uint32_t))
+
+#define HEADERSZ (10 + 4 + 4)
+
+#define TRY_READ(buf, size, msg) do {\
+   int rc; \
+   if((rc = read(blkfront_fd, buf, (size))) != (size)) { \
+      vtpmlogerror(VTPM_LOG_VTPM, "read() failed! " msg " : rc=(%d/%d), error=(%s)\n", rc, (int)(size), strerror(errno)); \
+      status = TPM_IOERROR;\
+      goto abort_egress;\
+   } \
+} while(0)
+
+#define TRY_WRITE(buf, size, msg) do {\
+   int rc; \
+   if((rc = write(blkfront_fd, buf, (size))) != (size)) { \
+      vtpmlogerror(VTPM_LOG_VTPM, "write() failed! " msg " : rc=(%d/%d), error=(%s)\n", rc, (int)(size), strerror(errno)); \
+      status = TPM_IOERROR;\
+      goto abort_egress;\
+   } \
+} while(0)
+
+#include <blkfront.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <mini-os/byteorder.h>
+#include <polarssl/aes.h>
+
+#include "vtpm_manager.h"
+#include "log.h"
+#include "marshal.h"
+#include "tpm.h"
+#include "uuid.h"
+
+#include "vtpmmgr.h"
+#include "vtpm_storage.h"
+
+#define MAX(a,b) ( ((a) > (b)) ? (a) : (b) )
+#define MIN(a,b) ( ((a) < (b)) ? (a) : (b) )
+
+/* blkfront device objets */
+static struct blkfront_dev* blkdev = NULL;
+static int blkfront_fd = -1;
+
+struct Vtpm {
+   uuid_t uuid;
+   int offset;
+};
+struct Storage {
+   int aes_offset;
+   int uuid_offset;
+   int end_offset;
+
+   int num_vtpms;
+   int num_vtpms_alloced;
+   struct Vtpm* vtpms;
+};
+
+/* Global storage data */
+static struct Storage g_store = {
+   .vtpms = NULL,
+};
+
+static int get_offset(void) {
+   return lseek(blkfront_fd, 0, SEEK_CUR);
+}
+
+static void reset_store(void) {
+   g_store.aes_offset = 0;
+   g_store.uuid_offset = 0;
+   g_store.end_offset = 0;
+
+   g_store.num_vtpms = 0;
+   g_store.num_vtpms_alloced = 0;
+   free(g_store.vtpms);
+   g_store.vtpms = NULL;
+}
+
+static int vtpm_get_index(const uuid_t uuid) {
+   int st = 0;
+   int ed = g_store.num_vtpms-1;
+   while(st <= ed) {
+      int mid = ((unsigned int)st + (unsigned int)ed) >> 1; //avoid overflow
+      int c = memcmp(uuid, &g_store.vtpms[mid].uuid, sizeof(uuid_t));
+      if(c == 0) {
+         return mid;
+      } else if(c > 0) {
+         st = mid + 1;
+      } else {
+         ed = mid - 1;
+      }
+   }
+   return -(st + 1);
+}
+
+static void vtpm_add(const uuid_t uuid, int offset, int index) {
+   /* Realloc more space if needed */
+   if(g_store.num_vtpms >= g_store.num_vtpms_alloced) {
+      g_store.num_vtpms_alloced += 16;
+      g_store.vtpms = realloc(
+            g_store.vtpms,
+            sizeof(struct Vtpm) * g_store.num_vtpms_alloced);
+   }
+
+   /* Move everybody after the new guy */
+   for(int i = g_store.num_vtpms; i > index; --i) {
+      g_store.vtpms[i] = g_store.vtpms[i-1];
+   }
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Registered vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+
+   /* Finally add new one */
+   memcpy(g_store.vtpms[index].uuid, uuid, sizeof(uuid_t));
+   g_store.vtpms[index].offset = offset;
+   ++g_store.num_vtpms;
+}
+
+#if 0
+static void vtpm_remove(int index) {
+   for(i = index; i < g_store.num_vtpms; ++i) {
+      g_store.vtpms[i] = g_store.vtpms[i+1];
+   }
+   --g_store.num_vtpms;
+}
+#endif
+
+static int pack_uuid_table(uint8_t* table, int size, int* nvtpms) {
+   uint8_t* ptr = table;
+   while(*nvtpms < g_store.num_vtpms && size >= 0)
+   {
+      /* Pack the uuid */
+      memcpy(ptr, (uint8_t*)g_store.vtpms[*nvtpms].uuid, sizeof(uuid_t));
+      ptr+= sizeof(uuid_t);
+
+
+      /* Pack the offset */
+      ptr = pack_UINT32(ptr, g_store.vtpms[*nvtpms].offset);
+
+      ++*nvtpms;
+      size -= UUID_TBL_ENT_SIZE;
+   }
+   return ptr - table;
+}
+
+/* Extract the uuids */
+static int extract_uuid_table(uint8_t* table, int size) {
+   uint8_t* ptr = table;
+   for(;size >= UUID_TBL_ENT_SIZE; size -= UUID_TBL_ENT_SIZE) {
+      int index;
+      uint32_t v32;
+
+      /*uuid_t is just an array of bytes, so we can do a direct cast here */
+      uint8_t* uuid = ptr;
+      ptr += sizeof(uuid_t);
+
+      /* Get the offset of the key */
+      ptr = unpack_UINT32(ptr, &v32);
+
+      /* Insert the new vtpm in sorted order */
+      if((index = vtpm_get_index(uuid)) >= 0) {
+         vtpmlogerror(VTPM_LOG_VTPM, "Vtpm (" UUID_FMT ") exists multiple times! ignoring...\n", UUID_BYTES(uuid));
+         continue;
+      }
+      index = -index -1;
+
+      vtpm_add(uuid, v32, index);
+
+   }
+   return ptr - table;
+}
+
+static void vtpm_decrypt_block(aes_context* aes,
+      uint8_t* iv,
+      uint8_t* cipher,
+      uint8_t* plain,
+      int cipher_sz,
+      int* overlap)
+{
+   int bytes_ext;
+   /* Decrypt */
+   aes_crypt_cbc(aes, AES_DECRYPT,
+         cipher_sz,
+         iv, cipher, plain + *overlap);
+
+   /* Extract */
+   bytes_ext = extract_uuid_table(plain, cipher_sz + *overlap);
+
+   /* Copy left overs to the beginning */
+   *overlap = cipher_sz + *overlap - bytes_ext;
+   memcpy(plain, plain + bytes_ext, *overlap);
+}
+
+static int vtpm_encrypt_block(aes_context* aes,
+      uint8_t* iv,
+      uint8_t* plain,
+      uint8_t* cipher,
+      int block_sz,
+      int* overlap,
+      int* num_vtpms)
+{
+   int bytes_to_crypt;
+   int bytes_packed;
+
+   /* Pack the uuid table */
+   bytes_packed = *overlap + pack_uuid_table(plain + *overlap, block_sz - *overlap, num_vtpms);
+   bytes_to_crypt = MIN(bytes_packed, block_sz);
+
+   /* Add padding if we aren't on a multiple of the block size */
+   if(bytes_to_crypt & (AES_BLOCK_SIZE-1)) {
+      int oldsz = bytes_to_crypt;
+      //add padding
+      bytes_to_crypt += AES_BLOCK_SIZE - (bytes_to_crypt & (AES_BLOCK_SIZE-1));
+      //fill padding with random bytes
+      vtpmmgr_rand(plain + oldsz, bytes_to_crypt - oldsz);
+      *overlap = 0;
+   } else {
+      *overlap = bytes_packed - bytes_to_crypt;
+   }
+
+   /* Encrypt this chunk */
+   aes_crypt_cbc(aes, AES_ENCRYPT,
+            bytes_to_crypt,
+            iv, plain, cipher);
+
+   /* Copy the left over partials to the beginning */
+   memcpy(plain, plain + bytes_to_crypt, *overlap);
+
+   return bytes_to_crypt;
+}
+
+static TPM_RESULT vtpm_storage_new_vtpm(const uuid_t uuid, int index) {
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
+   uint8_t buf[BUF_SIZE];
+   uint8_t* ptr;
+   int cipher_sz;
+   aes_context aes;
+
+   /* Add new vtpm to the table */
+   vtpm_add(uuid, g_store.end_offset, index);
+   g_store.end_offset += RSA_CIPHER_SIZE;
+
+   /* Compute the new end location of the encrypted uuid table */
+   cipher_sz = AES_BLOCK_SIZE; //IV
+   cipher_sz += g_store.num_vtpms * UUID_TBL_ENT_SIZE; //uuid table
+   cipher_sz += (AES_BLOCK_SIZE - (cipher_sz & (AES_BLOCK_SIZE -1))) & (AES_BLOCK_SIZE-1); //aes padding
+
+   /* Does this overlap any key data? If so they need to be relocated */
+   int uuid_end = (g_store.uuid_offset + cipher_sz + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+   for(int i = 0; i < g_store.num_vtpms; ++i) {
+      if(g_store.vtpms[i].offset < uuid_end) {
+
+         vtpmloginfo(VTPM_LOG_VTPM, "Relocating vtpm data\n");
+
+         //Read the hashkey cipher text
+         lseek(blkfront_fd, g_store.vtpms[i].offset, SEEK_SET);
+         TRY_READ(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
+
+         //Write the cipher text to new offset
+         lseek(blkfront_fd, g_store.end_offset, SEEK_SET);
+         TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
+
+         //Save new offset
+         g_store.vtpms[i].offset = g_store.end_offset;
+         g_store.end_offset += RSA_CIPHER_SIZE;
+      }
+   }
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Generating a new symmetric key\n");
+
+   /* Generate an aes key */
+   TPMTRYRETURN(vtpmmgr_rand(plain, AES_KEY_SIZE));
+   aes_setkey_enc(&aes, plain, AES_KEY_BITS);
+   ptr = plain + AES_KEY_SIZE;
+
+   /* Pack the crypted size */
+   ptr = pack_UINT32(ptr, cipher_sz);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Binding encrypted key\n");
+
+   /* Seal the key and size */
+   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
+            plain,
+            ptr - plain,
+            buf));
+
+   /* Write the sealed key to disk */
+   lseek(blkfront_fd, g_store.aes_offset, SEEK_SET);
+   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm aes key");
+
+   /* ENCRYPT AND WRITE UUID TABLE */
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Encrypting the uuid table\n");
+
+   int num_vtpms = 0;
+   int overlap = 0;
+   int bytes_crypted;
+   uint8_t iv[AES_BLOCK_SIZE];
+
+   /* Generate the iv for the first block */
+   TPMTRYRETURN(vtpmmgr_rand(iv, AES_BLOCK_SIZE));
+
+   /* Copy the iv to the cipher text buffer to be written to disk */
+   memcpy(buf, iv, AES_BLOCK_SIZE);
+   ptr = buf + AES_BLOCK_SIZE;
+
+   /* Encrypt the first block of the uuid table */
+   bytes_crypted = vtpm_encrypt_block(&aes,
+         iv, //iv
+         plain, //plaintext
+         ptr, //cipher text
+         BUF_SIZE - AES_BLOCK_SIZE,
+         &overlap,
+         &num_vtpms);
+
+   /* Write the iv followed by the crypted table*/
+   TRY_WRITE(buf, bytes_crypted + AES_BLOCK_SIZE, "vtpm uuid table");
+
+   /* Decrement the number of bytes encrypted */
+   cipher_sz -= bytes_crypted + AES_BLOCK_SIZE;
+
+   /* If there are more vtpms, encrypt and write them block by block */
+   while(cipher_sz > 0) {
+      /* Encrypt the next block of the uuid table */
+      bytes_crypted = vtpm_encrypt_block(&aes,
+               iv,
+               plain,
+               buf,
+               BUF_SIZE,
+               &overlap,
+               &num_vtpms);
+
+      /* Write the cipher text to disk */
+      TRY_WRITE(buf, bytes_crypted, "vtpm uuid table");
+
+      cipher_sz -= bytes_crypted;
+   }
+
+   goto egress;
+abort_egress:
+egress:
+   return status;
+}
+
+
+/**************************************
+ * PUBLIC FUNCTIONS
+ * ***********************************/
+
+int vtpm_storage_init(void) {
+   struct blkfront_info info;
+   if((blkdev = init_blkfront(NULL, &info)) == NULL) {
+      return -1;
+   }
+   if((blkfront_fd = blkfront_open(blkdev)) < 0) {
+      return -1;
+   }
+   return 0;
+}
+
+void vtpm_storage_shutdown(void) {
+   reset_store();
+   close(blkfront_fd);
+}
+
+TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ])
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   int index;
+   uint8_t cipher[RSA_CIPHER_SIZE];
+   uint8_t clear[RSA_CIPHER_SIZE];
+   UINT32 clear_size;
+
+   /* Find the index of this uuid */
+   if((index = vtpm_get_index(uuid)) < 0) {
+      index = -index-1;
+      vtpmlogerror(VTPM_LOG_VTPM, "LoadKey failure: Unrecognized uuid! " UUID_FMT "\n", UUID_BYTES(uuid));
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   /* Read the table entry */
+   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
+   TRY_READ(cipher, RSA_CIPHER_SIZE, "vtpm hashkey data");
+
+   /* Decrypt the table entry */
+   TPMTRYRETURN(TPM_UnBind(
+            vtpm_globals.storage_key_handle,
+            RSA_CIPHER_SIZE,
+            cipher,
+            &clear_size,
+            clear,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.oiap));
+
+   if(clear_size < HASHKEYSZ) {
+      vtpmloginfo(VTPM_LOG_VTPM, "Decrypted Hash key size (%" PRIu32 ") was too small!\n", clear_size);
+      status = TPM_RESOURCES;
+      goto abort_egress;
+   }
+
+   memcpy(hashkey, clear, HASHKEYSZ);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Loaded hash and key for vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+   goto egress;
+abort_egress:
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load key\n");
+egress:
+   return status;
+}
+
+TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ])
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   int index;
+   uint8_t buf[RSA_CIPHER_SIZE];
+
+   /* Find the index of this uuid */
+   if((index = vtpm_get_index(uuid)) < 0) {
+      index = -index-1;
+      /* Create a new vtpm */
+      TPMTRYRETURN( vtpm_storage_new_vtpm(uuid, index) );
+   }
+
+   /* Encrypt the hash and key */
+   TPMTRYRETURN( TPM_Bind(&vtpm_globals.storage_key,
+            hashkey,
+            HASHKEYSZ,
+            buf));
+
+   /* Write to disk */
+   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
+   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey data");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saved hash and key for vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+   goto egress;
+abort_egress:
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to save key\n");
+egress:
+   return status;
+}
+
+TPM_RESULT vtpm_storage_new_header()
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t buf[BUF_SIZE];
+   uint8_t keybuf[AES_KEY_SIZE + sizeof(uint32_t)];
+   uint8_t* ptr = buf;
+   uint8_t* sptr;
+
+   /* Clear everything first */
+   reset_store();
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Creating new disk image header\n");
+
+   /*Copy the ID string */
+   memcpy(ptr, IDSTR, IDSTRLEN);
+   ptr += IDSTRLEN;
+
+   /*Copy the version */
+   ptr = pack_UINT32(ptr, DISKVERS);
+
+   /*Save the location of the key size */
+   sptr = ptr;
+   ptr += sizeof(UINT32);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saving root storage key..\n");
+
+   /* Copy the storage key */
+   ptr = pack_TPM_KEY(ptr, &vtpm_globals.storage_key);
+
+   /* Now save the size */
+   pack_UINT32(sptr, ptr - (sptr + 4));
+
+   /* Create a fake aes key and set cipher text size to 0 */
+   memset(keybuf, 0, sizeof(keybuf));
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Binding uuid table symmetric key..\n");
+
+   /* Save the location of the aes key */
+   g_store.aes_offset = ptr - buf;
+
+   /* Store the fake aes key and vtpm count */
+   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
+         keybuf,
+         sizeof(keybuf),
+         ptr));
+   ptr+= RSA_CIPHER_SIZE;
+
+   /* Write the header to disk */
+   lseek(blkfront_fd, 0, SEEK_SET);
+   TRY_WRITE(buf, ptr-buf, "vtpm header");
+
+   /* Save the location of the uuid table */
+   g_store.uuid_offset = get_offset();
+
+   /* Save the end offset */
+   g_store.end_offset = (g_store.uuid_offset + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saved new manager disk header.\n");
+
+   goto egress;
+abort_egress:
+egress:
+   return status;
+}
+
+
+TPM_RESULT vtpm_storage_load_header(void)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint32_t v32;
+   uint8_t buf[BUF_SIZE];
+   uint8_t* ptr = buf;
+   aes_context aes;
+
+   /* Clear everything first */
+   reset_store();
+
+   /* Read the header from disk */
+   lseek(blkfront_fd, 0, SEEK_SET);
+   TRY_READ(buf, IDSTRLEN + sizeof(UINT32) + sizeof(UINT32), "vtpm header");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Loading disk image header\n");
+
+   /* Verify the ID string */
+   if(memcmp(ptr, IDSTR, IDSTRLEN)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid ID string in disk image!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+   ptr+=IDSTRLEN;
+
+   /* Unpack the version */
+   ptr = unpack_UINT32(ptr, &v32);
+
+   /* Verify the version */
+   if(v32 != DISKVERS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unsupported disk image version number %" PRIu32 "\n", v32);
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   /* Size of the storage key */
+   ptr = unpack_UINT32(ptr, &v32);
+
+   /* Sanity check */
+   if(v32 > BUF_SIZE) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Size of storage key (%" PRIu32 ") is too large!\n", v32);
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* read the storage key */
+   TRY_READ(buf, v32, "storage pub key");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Unpacking storage key\n");
+
+   /* unpack the storage key */
+   ptr = unpack_TPM_KEY(buf, &vtpm_globals.storage_key, UNPACK_ALLOC);
+
+   /* Load Storage Key into the TPM */
+   TPMTRYRETURN( TPM_LoadKey(
+            TPM_SRK_KEYHANDLE,
+            &vtpm_globals.storage_key,
+            &vtpm_globals.storage_key_handle,
+            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+            &vtpm_globals.oiap));
+
+   /* Initialize the storage key auth */
+   memset(vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA));
+
+   /* Store the offset of the aes key */
+   g_store.aes_offset = get_offset();
+
+   /* Read the rsa cipher text for the aes key */
+   TRY_READ(buf, RSA_CIPHER_SIZE, "aes key");
+   ptr = buf + RSA_CIPHER_SIZE;
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Unbinding uuid table symmetric key\n");
+
+   /* Decrypt the aes key protecting the uuid table */
+   UINT32 datalen;
+   TPMTRYRETURN(TPM_UnBind(
+            vtpm_globals.storage_key_handle,
+            RSA_CIPHER_SIZE,
+            buf,
+            &datalen,
+            ptr,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.oiap));
+
+   /* Validate the length of the output buffer */
+   if(datalen < AES_KEY_SIZE + sizeof(UINT32)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unbound AES key size (%d) was too small! expected (%ld)\n", datalen, AES_KEY_SIZE + sizeof(UINT32));
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* Extract the aes key */
+   aes_setkey_dec(&aes, ptr, AES_KEY_BITS);
+   ptr+= AES_KEY_SIZE;
+
+   /* Extract the ciphertext size */
+   ptr = unpack_UINT32(ptr, &v32);
+   int cipher_size = v32;
+
+   /* Sanity check */
+   if(cipher_size & (AES_BLOCK_SIZE-1)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Cipher text size (%" PRIu32 ") is not a multiple of the aes block size! (%d)\n", v32, AES_BLOCK_SIZE);
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* Save the location of the uuid table */
+   g_store.uuid_offset = get_offset();
+
+   /* Only decrypt the table if there are vtpms to decrypt */
+   if(cipher_size > 0) {
+      int rbytes;
+      int overlap = 0;
+      uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
+      uint8_t iv[AES_BLOCK_SIZE];
+
+      vtpmloginfo(VTPM_LOG_VTPM, "Decrypting uuid table\n");
+
+      /* Pre allocate the vtpm array */
+      g_store.num_vtpms_alloced = cipher_size / UUID_TBL_ENT_SIZE;
+      g_store.vtpms = malloc(sizeof(struct Vtpm) * g_store.num_vtpms_alloced);
+
+      /* Read the iv and the first chunk of cipher text */
+      rbytes = MIN(cipher_size, BUF_SIZE);
+      TRY_READ(buf, rbytes, "vtpm uuid table\n");
+      cipher_size -= rbytes;
+
+      /* Copy the iv */
+      memcpy(iv, buf, AES_BLOCK_SIZE);
+      ptr = buf + AES_BLOCK_SIZE;
+
+      /* Remove the iv from the number of bytes to decrypt */
+      rbytes -= AES_BLOCK_SIZE;
+
+      /* Decrypt and extract vtpms */
+      vtpm_decrypt_block(&aes,
+            iv, ptr, plain,
+            rbytes, &overlap);
+
+      /* Read the rest of the table if there is more */
+      while(cipher_size > 0) {
+         /* Read next chunk of cipher text */
+         rbytes = MIN(cipher_size, BUF_SIZE);
+         TRY_READ(buf, rbytes, "vtpm uuid table");
+         cipher_size -= rbytes;
+
+         /* Decrypt a block of text */
+         vtpm_decrypt_block(&aes,
+               iv, buf, plain,
+               rbytes, &overlap);
+
+      }
+      vtpmloginfo(VTPM_LOG_VTPM, "Loaded %d vtpms!\n", g_store.num_vtpms);
+   }
+
+   /* The end of the key table, new vtpms go here */
+   int uuid_end = (get_offset() + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+   g_store.end_offset = uuid_end;
+
+   /* Compute the end offset while validating vtpms*/
+   for(int i = 0; i < g_store.num_vtpms; ++i) {
+      /* offset must not collide with previous data */
+      if(g_store.vtpms[i].offset < uuid_end) {
+         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
+               " offset (%d) is before end of uuid table (%d)!\n",
+               UUID_BYTES(g_store.vtpms[i].uuid),
+               g_store.vtpms[i].offset, uuid_end);
+         status = TPM_IOERROR;
+         goto abort_egress;
+      }
+      /* offset must be at a multiple of cipher size */
+      if(g_store.vtpms[i].offset & (RSA_CIPHER_SIZE-1)) {
+         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
+               " offset(%d) is not at a multiple of the rsa cipher text size (%d)!\n",
+               UUID_BYTES(g_store.vtpms[i].uuid),
+               g_store.vtpms[i].offset, RSA_CIPHER_SIZE);
+         status = TPM_IOERROR;
+         goto abort_egress;
+      }
+      /* Save the last offset */
+      if(g_store.vtpms[i].offset >= g_store.end_offset) {
+         g_store.end_offset = g_store.vtpms[i].offset + RSA_CIPHER_SIZE;
+      }
+   }
+
+   goto egress;
+abort_egress:
+   //An error occured somewhere
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load manager data!\n");
+
+   //Clear the data store
+   reset_store();
+
+   //Reset the storage key structure
+   free_TPM_KEY(&vtpm_globals.storage_key);
+   {
+      TPM_KEY key = TPM_KEY_INIT;
+      vtpm_globals.storage_key = key;
+   }
+
+   //Reset the storage key handle
+   TPM_EvictKey(vtpm_globals.storage_key_handle);
+   vtpm_globals.storage_key_handle = 0;
+egress:
+   return status;
+}
+
+#if 0
+/* For testing disk IO */
+void add_fake_vtpms(int num) {
+   for(int i = 0; i < num; ++i) {
+      uint32_t ind = cpu_to_be32(i);
+
+      uuid_t uuid;
+      memset(uuid, 0, sizeof(uuid_t));
+      memcpy(uuid, &ind, sizeof(ind));
+      int index = vtpm_get_index(uuid);
+      index = -index-1;
+
+      vtpm_storage_new_vtpm(uuid, index);
+   }
+}
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_storage.h b/stubdom/vtpmmgr/vtpm_storage.h
new file mode 100644
index 0000000..a5a5fd7
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_storage.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPM_STORAGE_H
+#define VTPM_STORAGE_h
+
+#include "uuid.h"
+
+#define VTPM_NVMKEY_SIZE 32
+#define HASHKEYSZ (sizeof(TPM_DIGEST) + VTPM_NVMKEY_SIZE)
+
+/* Initialize the storage system and its virtual disk */
+int vtpm_storage_init(void);
+
+/* Shutdown the storage system and its virtual disk */
+void vtpm_storage_shutdown(void);
+
+/* Loads Sha1 hash and 256 bit AES key from disk and stores them
+ * packed together in outbuf. outbuf must be freed
+ * by the caller using buffer_free()
+ */
+TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ]);
+
+/* inbuf must contain a sha1 hash followed by a 256 bit AES key.
+ * Encrypts and stores the hash and key to disk */
+TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ]);
+
+/* Load the vtpm manager data - call this on startup */
+TPM_RESULT vtpm_storage_load_header(void);
+
+/* Saves the vtpm manager data - call this on shutdown */
+TPM_RESULT vtpm_storage_new_header(void);
+
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpmmgr.c b/stubdom/vtpmmgr/vtpmmgr.c
new file mode 100644
index 0000000..563f4e8
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpmmgr.c
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdint.h>
+#include <mini-os/tpmback.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "log.h"
+
+#include "vtpmmgr.h"
+#include "tcg.h"
+
+
+void main_loop(void) {
+   tpmcmd_t* tpmcmd;
+   uint8_t respbuf[TCPA_MAX_BUFFER_LENGTH];
+
+   while(1) {
+      /* Wait for requests from a vtpm */
+      vtpmloginfo(VTPM_LOG_VTPM, "Waiting for commands from vTPM's:\n");
+      if((tpmcmd = tpmback_req_any()) == NULL) {
+         vtpmlogerror(VTPM_LOG_VTPM, "NULL tpmcmd\n");
+         continue;
+      }
+
+      tpmcmd->resp = respbuf;
+
+      /* Process the command */
+      vtpmmgr_handle_cmd(tpmcmd->uuid, tpmcmd);
+
+      /* Send response */
+      tpmback_resp(tpmcmd);
+   }
+}
+
+int main(int argc, char** argv)
+{
+   int rc = 0;
+   sleep(2);
+   vtpmloginfo(VTPM_LOG_VTPM, "Starting vTPM manager domain\n");
+
+   /* Initialize the vtpm manager */
+   if(vtpmmgr_init(argc, argv) != TPM_SUCCESS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize vtpmmgr domain!\n");
+      rc = -1;
+      goto exit;
+   }
+
+   main_loop();
+
+   vtpmloginfo(VTPM_LOG_VTPM, "vTPM Manager shutting down...\n");
+
+   vtpmmgr_shutdown();
+
+exit:
+   return rc;
+
+}
diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
new file mode 100644
index 0000000..50a1992
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPMMGR_H
+#define VTPMMGR_H
+
+#include <mini-os/tpmback.h>
+#include <polarssl/entropy.h>
+#include <polarssl/ctr_drbg.h>
+
+#include "uuid.h"
+#include "tcg.h"
+#include "vtpm_manager.h"
+
+#define RSA_KEY_SIZE 0x0800
+#define RSA_CIPHER_SIZE (RSA_KEY_SIZE / 8)
+
+struct vtpm_globals {
+   int tpm_fd;
+   TPM_KEY             storage_key;
+   TPM_HANDLE          storage_key_handle;       // Key used by persistent store
+   TPM_AUTH_SESSION    oiap;                // OIAP session for storageKey
+   TPM_AUTHDATA        storage_key_usage_auth;
+
+   TPM_AUTHDATA        owner_auth;
+   TPM_AUTHDATA        srk_auth;
+
+   entropy_context     entropy;
+   ctr_drbg_context    ctr_drbg;
+};
+
+// --------------------------- Global Values --------------------------
+extern struct vtpm_globals vtpm_globals;   // Key info and DMI states
+
+TPM_RESULT vtpmmgr_init(int argc, char** argv);
+void vtpmmgr_shutdown(void);
+
+TPM_RESULT vtpmmgr_handle_cmd(const uuid_t uuid, tpmcmd_t* tpmcmd);
+
+inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes) {
+   return ctr_drbg_random(&vtpm_globals.ctr_drbg, bytes, num_bytes) == 0 ? 0 : TPM_FAIL;
+}
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:20:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:20:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1El-0002Ib-Eb; Thu, 15 Nov 2012 15:20:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TZ1Ei-0002Hq-BG
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:20:14 +0000
Received: from [193.109.254.147:8686] by server-16.bemta-14.messagelabs.com id
	E1/36-09215-B2805A05; Thu, 15 Nov 2012 15:20:11 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352992652!8430483!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY,UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29480 invoked from network); 15 Nov 2012 15:17:33 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-5.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 15:17:33 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149187345;
	Thu, 15 Nov 2012 10:17:21 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 10:17:08 -0500
Message-Id: <1352992629-5850-10-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v3 09/10] add stubdom/vtpmmgr code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add the code base for vtpmmgrdom. Makefile changes
next patch.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/vtpmmgr/Makefile           |   32 ++
 stubdom/vtpmmgr/init.c             |  553 +++++++++++++++++++++
 stubdom/vtpmmgr/log.c              |  151 ++++++
 stubdom/vtpmmgr/log.h              |   85 ++++
 stubdom/vtpmmgr/marshal.h          |  528 ++++++++++++++++++++
 stubdom/vtpmmgr/minios.cfg         |   14 +
 stubdom/vtpmmgr/tcg.h              |  707 +++++++++++++++++++++++++++
 stubdom/vtpmmgr/tpm.c              |  938 ++++++++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/tpm.h              |  218 +++++++++
 stubdom/vtpmmgr/tpmrsa.c           |  175 +++++++
 stubdom/vtpmmgr/tpmrsa.h           |   67 +++
 stubdom/vtpmmgr/uuid.h             |   50 ++
 stubdom/vtpmmgr/vtpm_cmd_handler.c |  152 ++++++
 stubdom/vtpmmgr/vtpm_manager.h     |   64 +++
 stubdom/vtpmmgr/vtpm_storage.c     |  783 ++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/vtpm_storage.h     |   68 +++
 stubdom/vtpmmgr/vtpmmgr.c          |   93 ++++
 stubdom/vtpmmgr/vtpmmgr.h          |   77 +++
 18 files changed, 4755 insertions(+)
 create mode 100644 stubdom/vtpmmgr/Makefile
 create mode 100644 stubdom/vtpmmgr/init.c
 create mode 100644 stubdom/vtpmmgr/log.c
 create mode 100644 stubdom/vtpmmgr/log.h
 create mode 100644 stubdom/vtpmmgr/marshal.h
 create mode 100644 stubdom/vtpmmgr/minios.cfg
 create mode 100644 stubdom/vtpmmgr/tcg.h
 create mode 100644 stubdom/vtpmmgr/tpm.c
 create mode 100644 stubdom/vtpmmgr/tpm.h
 create mode 100644 stubdom/vtpmmgr/tpmrsa.c
 create mode 100644 stubdom/vtpmmgr/tpmrsa.h
 create mode 100644 stubdom/vtpmmgr/uuid.h
 create mode 100644 stubdom/vtpmmgr/vtpm_cmd_handler.c
 create mode 100644 stubdom/vtpmmgr/vtpm_manager.h
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.c
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.h
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.c
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.h

diff --git a/stubdom/vtpmmgr/Makefile b/stubdom/vtpmmgr/Makefile
new file mode 100644
index 0000000..88c83c3
--- /dev/null
+++ b/stubdom/vtpmmgr/Makefile
@@ -0,0 +1,32 @@
+# Copyright (c) 2010-2012 United States Government, as represented by
+# the Secretary of Defense.  All rights reserved.
+#
+# THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+# ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+# INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+# DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+# SOFTWARE.
+#
+
+XEN_ROOT=../..
+
+PSSL_DIR=../polarssl-$(XEN_TARGET_ARCH)/library
+PSSL_OBJS=aes.o sha1.o entropy.o ctr_drbg.o bignum.o sha4.o havege.o timing.o entropy_poll.o
+
+TARGET=vtpmmgr.a
+OBJS=vtpmmgr.o vtpm_cmd_handler.o vtpm_storage.o init.o tpmrsa.o tpm.o log.o
+
+CFLAGS+=-Werror -Iutil -Icrypto -Itcs
+CFLAGS+=-Wno-declaration-after-statement -Wno-unused-label
+
+build: $(TARGET)
+$(TARGET): $(OBJS)
+	ar -rcs $@ $^ $(foreach obj,$(PSSL_OBJS),$(PSSL_DIR)/$(obj))
+
+clean:
+	rm -f $(TARGET) $(OBJS)
+
+distclean: clean
+
+.PHONY: clean distclean
diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
new file mode 100644
index 0000000..a158020
--- /dev/null
+++ b/stubdom/vtpmmgr/init.c
@@ -0,0 +1,553 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+#include <stdint.h>
+#include <stdlib.h>
+
+#include <xen/xen.h>
+#include <mini-os/tpmback.h>
+#include <mini-os/tpmfront.h>
+#include <mini-os/tpm_tis.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <polarssl/sha1.h>
+
+#include "log.h"
+#include "vtpmmgr.h"
+#include "vtpm_storage.h"
+#include "tpm.h"
+#include "marshal.h"
+
+struct Opts {
+   enum {
+      TPMDRV_TPM_TIS,
+      TPMDRV_TPMFRONT,
+   } tpmdriver;
+   unsigned long tpmiomem;
+   unsigned int tpmirq;
+   unsigned int tpmlocality;
+   int gen_owner_auth;
+};
+
+// --------------------------- Well Known Auths --------------------------
+const TPM_AUTHDATA WELLKNOWN_SRK_AUTH = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+const TPM_AUTHDATA WELLKNOWN_OWNER_AUTH = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+
+struct vtpm_globals vtpm_globals = {
+   .tpm_fd = -1,
+   .storage_key = TPM_KEY_INIT,
+   .storage_key_handle = 0,
+   .oiap = { .AuthHandle = 0 }
+};
+
+static int tpm_entropy_source(void* dummy, unsigned char* data, size_t len, size_t* olen) {
+   UINT32 sz = len;
+   TPM_RESULT rc = TPM_GetRandom(&sz, data);
+   *olen = sz;
+   return rc == TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
+}
+
+static TPM_RESULT check_tpm_version(void) {
+   TPM_RESULT status;
+   UINT32 rsize;
+   BYTE* res = NULL;
+   TPM_CAP_VERSION_INFO vinfo;
+
+   TPMTRYRETURN(TPM_GetCapability(
+            TPM_CAP_VERSION_VAL,
+            0,
+            NULL,
+            &rsize,
+            &res));
+   if(rsize < 4) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid size returned by GetCapability!\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   unpack_TPM_CAP_VERSION_INFO(res, &vinfo, UNPACK_ALIAS);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Hardware TPM:\n");
+   vtpmloginfo(VTPM_LOG_VTPM, " version: %hhd %hhd %hhd %hhd\n",
+         vinfo.version.major, vinfo.version.minor, vinfo.version.revMajor, vinfo.version.revMinor);
+   vtpmloginfo(VTPM_LOG_VTPM, " specLevel: %hd\n", vinfo.specLevel);
+   vtpmloginfo(VTPM_LOG_VTPM, " errataRev: %hhd\n", vinfo.errataRev);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorID: %c%c%c%c\n",
+         vinfo.tpmVendorID[0], vinfo.tpmVendorID[1],
+         vinfo.tpmVendorID[2], vinfo.tpmVendorID[3]);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecificSize: %hd\n", vinfo.vendorSpecificSize);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecific: ");
+   for(int i = 0; i < vinfo.vendorSpecificSize; ++i) {
+      vtpmloginfomore(VTPM_LOG_VTPM, "%02hhx", vinfo.vendorSpecific[i]);
+   }
+   vtpmloginfomore(VTPM_LOG_VTPM, "\n");
+
+abort_egress:
+   free(res);
+   return status;
+}
+
+static TPM_RESULT flush_tpm(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   const TPM_RESOURCE_TYPE reslist[] = { TPM_RT_KEY, TPM_RT_AUTH, TPM_RT_TRANS, TPM_RT_COUNTER, TPM_RT_DAA_TPM, TPM_RT_CONTEXT };
+   BYTE* keylist = NULL;
+   UINT32 keylistSize;
+   BYTE* ptr;
+
+   //Iterate through each resource type and flush all handles
+   for(int i = 0; i < sizeof(reslist) / sizeof(TPM_RESOURCE_TYPE); ++i) {
+      TPM_RESOURCE_TYPE beres = cpu_to_be32(reslist[i]);
+      UINT16 size;
+      TPMTRYRETURN(TPM_GetCapability(
+               TPM_CAP_HANDLE,
+               sizeof(TPM_RESOURCE_TYPE),
+               (BYTE*)(&beres),
+               &keylistSize,
+               &keylist));
+
+      ptr = keylist;
+      ptr = unpack_UINT16(ptr, &size);
+
+      //Flush each handle
+      if(size) {
+         vtpmloginfo(VTPM_LOG_VTPM, "Flushing %u handle(s) of type %lu\n", size, (unsigned long) reslist[i]);
+         for(int j = 0; j < size; ++j) {
+            TPM_HANDLE h;
+            ptr = unpack_TPM_HANDLE(ptr, &h);
+            TPMTRYRETURN(TPM_FlushSpecific(h, reslist[i]));
+         }
+      }
+
+      free(keylist);
+      keylist = NULL;
+   }
+
+   goto egress;
+abort_egress:
+   free(keylist);
+egress:
+   return status;
+}
+
+
+static TPM_RESULT try_take_ownership(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_PUBKEY pubEK = TPM_PUBKEY_INIT;
+
+   // If we can read PubEK then there is no owner and we should take it.
+   status = TPM_ReadPubek(&pubEK);
+
+   switch(status) {
+      case TPM_DISABLED_CMD:
+         //Cannot read ek? TPM has owner
+         vtpmloginfo(VTPM_LOG_VTPM, "Failed to readEK meaning TPM has an owner. Creating Keys off existing SRK.\n");
+         status = TPM_SUCCESS;
+         break;
+      case TPM_NO_ENDORSEMENT:
+         {
+            //If theres no ek, we have to create one
+            TPM_KEY_PARMS keyInfo = {
+               .algorithmID = TPM_ALG_RSA,
+               .encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1,
+               .sigScheme = TPM_SS_NONE,
+               .parmSize = 12,
+               .parms.rsa = {
+                  .keyLength = RSA_KEY_SIZE,
+                  .numPrimes = 2,
+                  .exponentSize = 0,
+                  .exponent = NULL,
+               },
+            };
+            TPMTRYRETURN(TPM_CreateEndorsementKeyPair(&keyInfo, &pubEK));
+         }
+         //fall through to take ownership
+      case TPM_SUCCESS:
+         {
+            //Construct the Srk
+            TPM_KEY srk = {
+               .ver = TPM_STRUCT_VER_1_1,
+               .keyUsage = TPM_KEY_STORAGE,
+               .keyFlags = 0x00,
+               .authDataUsage = TPM_AUTH_ALWAYS,
+               .algorithmParms = {
+                  .algorithmID = TPM_ALG_RSA,
+                  .encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1,
+                  .sigScheme =  TPM_SS_NONE,
+                  .parmSize = 12,
+                  .parms.rsa = {
+                     .keyLength = RSA_KEY_SIZE,
+                     .numPrimes = 2,
+                     .exponentSize = 0,
+                     .exponent = NULL,
+                  },
+               },
+               .PCRInfoSize = 0,
+               .pubKey = {
+                  .keyLength = 0,
+                  .key = NULL,
+               },
+               .encDataSize = 0,
+            };
+
+            TPMTRYRETURN(TPM_TakeOwnership(
+                     &pubEK,
+                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
+                     (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+                     &srk,
+                     NULL,
+                     &vtpm_globals.oiap));
+
+            TPMTRYRETURN(TPM_DisablePubekRead(
+                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
+                     &vtpm_globals.oiap));
+         }
+         break;
+      default:
+         break;
+   }
+abort_egress:
+   free_TPM_PUBKEY(&pubEK);
+   return status;
+}
+
+static void init_storage_key(TPM_KEY* key) {
+   key->ver.major = 1;
+   key->ver.minor = 1;
+   key->ver.revMajor = 0;
+   key->ver.revMinor = 0;
+
+   key->keyUsage = TPM_KEY_BIND;
+   key->keyFlags = 0;
+   key->authDataUsage = TPM_AUTH_ALWAYS;
+
+   TPM_KEY_PARMS* p = &key->algorithmParms;
+   p->algorithmID = TPM_ALG_RSA;
+   p->encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
+   p->sigScheme = TPM_SS_NONE;
+   p->parmSize = 12;
+
+   TPM_RSA_KEY_PARMS* r = &p->parms.rsa;
+   r->keyLength = RSA_KEY_SIZE;
+   r->numPrimes = 2;
+   r->exponentSize = 0;
+   r->exponent = NULL;
+
+   key->PCRInfoSize = 0;
+   key->encDataSize = 0;
+   key->encData = NULL;
+}
+
+static int parse_auth_string(char* authstr, BYTE* target, const TPM_AUTHDATA wellknown, int allowrandom) {
+   int rc;
+   /* well known owner auth */
+   if(!strcmp(authstr, "well-known")) {
+      memcpy(target, wellknown, sizeof(TPM_AUTHDATA));
+   }
+   /* Create a randomly generated owner auth */
+   else if(allowrandom && !strcmp(authstr, "random")) {
+      return 1;
+   }
+   /* owner auth is a raw hash */
+   else if(!strncmp(authstr, "hash:", 5)) {
+      authstr += 5;
+      if((rc = strlen(authstr)) != 40) {
+         vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth hex string `%s' must be exactly 40 characters (20 bytes) long, length=%d\n", authstr, rc);
+         return -1;
+      }
+      for(int j = 0; j < 20; ++j) {
+         if(sscanf(authstr, "%hhX", target + j) != 1) {
+            vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth string `%s' is not a valid hex string\n", authstr);
+            return -1;
+         }
+         authstr += 2;
+      }
+   }
+   /* owner auth is a string that will be hashed */
+   else if(!strncmp(authstr, "text:", 5)) {
+      authstr += 5;
+      sha1((const unsigned char*)authstr, strlen(authstr), target);
+   }
+   else {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid auth string %s\n", authstr);
+      return -1;
+   }
+
+   return 0;
+}
+
+int parse_cmdline_opts(int argc, char** argv, struct Opts* opts)
+{
+   int rc;
+   int i;
+
+   //Set defaults
+   memcpy(vtpm_globals.owner_auth, WELLKNOWN_OWNER_AUTH, sizeof(TPM_AUTHDATA));
+   memcpy(vtpm_globals.srk_auth, WELLKNOWN_SRK_AUTH, sizeof(TPM_AUTHDATA));
+
+   for(i = 1; i < argc; ++i) {
+      if(!strncmp(argv[i], "owner_auth:", 10)) {
+         if((rc = parse_auth_string(argv[i] + 10, vtpm_globals.owner_auth, WELLKNOWN_OWNER_AUTH, 1)) < 0) {
+            goto err_invalid;
+         }
+         if(rc == 1) {
+            opts->gen_owner_auth = 1;
+         }
+      }
+      else if(!strncmp(argv[i], "srk_auth:", 8)) {
+         if((rc = parse_auth_string(argv[i] + 8, vtpm_globals.srk_auth, WELLKNOWN_SRK_AUTH, 0)) != 0) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmdriver=", 10)) {
+         if(!strcmp(argv[i] + 10, "tpm_tis")) {
+            opts->tpmdriver = TPMDRV_TPM_TIS;
+         } else if(!strcmp(argv[i] + 10, "tpmfront")) {
+            opts->tpmdriver = TPMDRV_TPMFRONT;
+         } else {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmiomem=",9)) {
+         if(sscanf(argv[i] + 9, "0x%lX", &opts->tpmiomem) != 1) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmirq=",7)) {
+         if(!strcmp(argv[i] + 7, "probe")) {
+            opts->tpmirq = TPM_PROBE_IRQ;
+         } else if( sscanf(argv[i] + 7, "%u", &opts->tpmirq) != 1) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmlocality=",12)) {
+         if(sscanf(argv[i] + 12, "%u", &opts->tpmlocality) != 1 || opts->tpmlocality > 4) {
+            goto err_invalid;
+         }
+      }
+   }
+
+   switch(opts->tpmdriver) {
+      case TPMDRV_TPM_TIS:
+         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpm_tis driver\n");
+         break;
+      case TPMDRV_TPMFRONT:
+         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpmfront driver\n");
+         break;
+   }
+
+   return 0;
+err_invalid:
+   vtpmlogerror(VTPM_LOG_VTPM, "Invalid Option %s\n", argv[i]);
+   return -1;
+}
+
+
+
+static TPM_RESULT vtpmmgr_create(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_AUTH_SESSION osap = TPM_AUTH_SESSION_INIT;
+   TPM_AUTHDATA sharedsecret;
+
+   // Take ownership if TPM is unowned
+   TPMTRYRETURN(try_take_ownership());
+
+   // Generate storage key's auth
+   memset(&vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA));
+
+   TPMTRYRETURN( TPM_OSAP(
+            TPM_ET_KEYHANDLE,
+            TPM_SRK_KEYHANDLE,
+            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+            &sharedsecret,
+            &osap) );
+
+   init_storage_key(&vtpm_globals.storage_key);
+
+   //initialize the storage key
+   TPMTRYRETURN( TPM_CreateWrapKey(
+            TPM_SRK_KEYHANDLE,
+            (const TPM_AUTHDATA*)&sharedsecret,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.storage_key,
+            &osap) );
+
+   //Load Storage Key
+   TPMTRYRETURN( TPM_LoadKey(
+            TPM_SRK_KEYHANDLE,
+            &vtpm_globals.storage_key,
+            &vtpm_globals.storage_key_handle,
+            (const TPM_AUTHDATA*) &vtpm_globals.srk_auth,
+            &vtpm_globals.oiap));
+
+   //Make sure TPM has commited changes
+   TPMTRYRETURN( TPM_SaveState() );
+
+   //Create new disk image
+   TPMTRYRETURN(vtpm_storage_new_header());
+
+   goto egress;
+abort_egress:
+egress:
+   vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager\n");
+
+   //End the OSAP session
+   if(osap.AuthHandle) {
+      TPM_TerminateHandle(osap.AuthHandle);
+   }
+
+   return status;
+}
+
+TPM_RESULT vtpmmgr_init(int argc, char** argv) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   /* Default commandline options */
+   struct Opts opts = {
+      .tpmdriver = TPMDRV_TPM_TIS,
+      .tpmiomem = TPM_BASEADDR,
+      .tpmirq = 0,
+      .tpmlocality = 0,
+      .gen_owner_auth = 0,
+   };
+
+   if(parse_cmdline_opts(argc, argv, &opts) != 0) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Command line parsing failed! exiting..\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   //Setup storage system
+   if(vtpm_storage_init() != 0) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize storage subsystem!\n");
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   //Setup tpmback device
+   init_tpmback();
+
+   //Setup tpm access
+   switch(opts.tpmdriver) {
+      case TPMDRV_TPM_TIS:
+         {
+            struct tpm_chip* tpm;
+            if((tpm = init_tpm_tis(opts.tpmiomem, TPM_TIS_LOCL_INT_TO_FLAG(opts.tpmlocality), opts.tpmirq)) == NULL) {
+               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+               status = TPM_IOERROR;
+               goto abort_egress;
+            }
+            vtpm_globals.tpm_fd = tpm_tis_open(tpm);
+            tpm_tis_request_locality(tpm, opts.tpmlocality);
+         }
+         break;
+      case TPMDRV_TPMFRONT:
+         {
+            struct tpmfront_dev* tpmfront_dev;
+            if((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
+               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+               status = TPM_IOERROR;
+               goto abort_egress;
+            }
+            vtpm_globals.tpm_fd = tpmfront_open(tpmfront_dev);
+         }
+         break;
+   }
+
+   //Get the version of the tpm
+   TPMTRYRETURN(check_tpm_version());
+
+   // Blow away all stale handles left in the tpm
+   if(flush_tpm() != TPM_SUCCESS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_FlushResources failed, continuing anyway..\n");
+   }
+
+   /* Initialize the rng */
+   entropy_init(&vtpm_globals.entropy);
+   entropy_add_source(&vtpm_globals.entropy, tpm_entropy_source, NULL, 0);
+   entropy_gather(&vtpm_globals.entropy);
+   ctr_drbg_init(&vtpm_globals.ctr_drbg, entropy_func, &vtpm_globals.entropy, NULL, 0);
+   ctr_drbg_set_prediction_resistance( &vtpm_globals.ctr_drbg, CTR_DRBG_PR_OFF );
+
+   // Generate Auth for Owner
+   if(opts.gen_owner_auth) {
+      vtpmmgr_rand(vtpm_globals.owner_auth, sizeof(TPM_AUTHDATA));
+   }
+
+   // Create OIAP session for service's authorized commands
+   TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
+
+   /* Load the Manager data, if it fails create a new manager */
+   if (vtpm_storage_load_header() != TPM_SUCCESS) {
+      /* If the OIAP session was closed by an error, create a new one */
+      if(vtpm_globals.oiap.AuthHandle == 0) {
+         TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
+      }
+      vtpmloginfo(VTPM_LOG_VTPM, "Failed to read manager file. Assuming first time initialization.\n");
+      TPMTRYRETURN( vtpmmgr_create() );
+   }
+
+   goto egress;
+abort_egress:
+   vtpmmgr_shutdown();
+egress:
+   return status;
+}
+
+void vtpmmgr_shutdown(void)
+{
+   /* Cleanup resources */
+   free_TPM_KEY(&vtpm_globals.storage_key);
+
+   /* Cleanup TPM resources */
+   TPM_EvictKey(vtpm_globals.storage_key_handle);
+   TPM_TerminateHandle(vtpm_globals.oiap.AuthHandle);
+
+   /* Close tpmback */
+   shutdown_tpmback();
+
+   /* Close the storage system and blkfront */
+   vtpm_storage_shutdown();
+
+   /* Close tpmfront/tpm_tis */
+   close(vtpm_globals.tpm_fd);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
+}
diff --git a/stubdom/vtpmmgr/log.c b/stubdom/vtpmmgr/log.c
new file mode 100644
index 0000000..a82c913
--- /dev/null
+++ b/stubdom/vtpmmgr/log.c
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "tcg.h"
+
+char *module_names[] = { "",
+                                "TPM",
+                                "TPM",
+                                "VTPM",
+                                "VTPM",
+                                "TXDATA",
+                              };
+// Helper code for the consts, eg. to produce messages for error codes.
+
+typedef struct error_code_entry_t {
+  TPM_RESULT code;
+  char * code_name;
+  char * msg;
+} error_code_entry_t;
+
+static const error_code_entry_t error_msgs [] = {
+  { TPM_SUCCESS, "TPM_SUCCESS", "Successful completion of the operation" },
+  { TPM_AUTHFAIL, "TPM_AUTHFAIL", "Authentication failed" },
+  { TPM_BADINDEX, "TPM_BADINDEX", "The index to a PCR, DIR or other register is incorrect" },
+  { TPM_BAD_PARAMETER, "TPM_BAD_PARAMETER", "One or more parameter is bad" },
+  { TPM_AUDITFAILURE, "TPM_AUDITFAILURE", "An operation completed successfully but the auditing of that operation failed." },
+  { TPM_CLEAR_DISABLED, "TPM_CLEAR_DISABLED", "The clear disable flag is set and all clear operations now require physical access" },
+  { TPM_DEACTIVATED, "TPM_DEACTIVATED", "The TPM is deactivated" },
+  { TPM_DISABLED, "TPM_DISABLED", "The TPM is disabled" },
+  { TPM_DISABLED_CMD, "TPM_DISABLED_CMD", "The target command has been disabled" },
+  { TPM_FAIL, "TPM_FAIL", "The operation failed" },
+  { TPM_BAD_ORDINAL, "TPM_BAD_ORDINAL", "The ordinal was unknown or inconsistent" },
+  { TPM_INSTALL_DISABLED, "TPM_INSTALL_DISABLED", "The ability to install an owner is disabled" },
+  { TPM_INVALID_KEYHANDLE, "TPM_INVALID_KEYHANDLE", "The key handle presented was invalid" },
+  { TPM_KEYNOTFOUND, "TPM_KEYNOTFOUND", "The target key was not found" },
+  { TPM_INAPPROPRIATE_ENC, "TPM_INAPPROPRIATE_ENC", "Unacceptable encryption scheme" },
+  { TPM_MIGRATEFAIL, "TPM_MIGRATEFAIL", "Migration authorization failed" },
+  { TPM_INVALID_PCR_INFO, "TPM_INVALID_PCR_INFO", "PCR information could not be interpreted" },
+  { TPM_NOSPACE, "TPM_NOSPACE", "No room to load key." },
+  { TPM_NOSRK, "TPM_NOSRK", "There is no SRK set" },
+  { TPM_NOTSEALED_BLOB, "TPM_NOTSEALED_BLOB", "An encrypted blob is invalid or was not created by this TPM" },
+  { TPM_OWNER_SET, "TPM_OWNER_SET", "There is already an Owner" },
+  { TPM_RESOURCES, "TPM_RESOURCES", "The TPM has insufficient internal resources to perform the requested action." },
+  { TPM_SHORTRANDOM, "TPM_SHORTRANDOM", "A random string was too short" },
+  { TPM_SIZE, "TPM_SIZE", "The TPM does not have the space to perform the operation." },
+  { TPM_WRONGPCRVAL, "TPM_WRONGPCRVAL", "The named PCR value does not match the current PCR value." },
+  { TPM_BAD_PARAM_SIZE, "TPM_BAD_PARAM_SIZE", "The paramSize argument to the command has the incorrect value" },
+  { TPM_SHA_THREAD, "TPM_SHA_THREAD", "There is no existing SHA-1 thread." },
+  { TPM_SHA_ERROR, "TPM_SHA_ERROR", "The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error." },
+  { TPM_FAILEDSELFTEST, "TPM_FAILEDSELFTEST", "Self-test has failed and the TPM has shutdown." },
+  { TPM_AUTH2FAIL, "TPM_AUTH2FAIL", "The authorization for the second key in a 2 key function failed authorization" },
+  { TPM_BADTAG, "TPM_BADTAG", "The tag value sent to for a command is invalid" },
+  { TPM_IOERROR, "TPM_IOERROR", "An IO error occurred transmitting information to the TPM" },
+  { TPM_ENCRYPT_ERROR, "TPM_ENCRYPT_ERROR", "The encryption process had a problem." },
+  { TPM_DECRYPT_ERROR, "TPM_DECRYPT_ERROR", "The decryption process did not complete." },
+  { TPM_INVALID_AUTHHANDLE, "TPM_INVALID_AUTHHANDLE", "An invalid handle was used." },
+  { TPM_NO_ENDORSEMENT, "TPM_NO_ENDORSEMENT", "The TPM does not a EK installed" },
+  { TPM_INVALID_KEYUSAGE, "TPM_INVALID_KEYUSAGE", "The usage of a key is not allowed" },
+  { TPM_WRONG_ENTITYTYPE, "TPM_WRONG_ENTITYTYPE", "The submitted entity type is not allowed" },
+  { TPM_INVALID_POSTINIT, "TPM_INVALID_POSTINIT", "The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup" },
+  { TPM_INAPPROPRIATE_SIG, "TPM_INAPPROPRIATE_SIG", "Signed data cannot include additional DER information" },
+  { TPM_BAD_KEY_PROPERTY, "TPM_BAD_KEY_PROPERTY", "The key properties in TPM_KEY_PARMs are not supported by this TPM" },
+
+  { TPM_BAD_MIGRATION, "TPM_BAD_MIGRATION", "The migration properties of this key are incorrect." },
+  { TPM_BAD_SCHEME, "TPM_BAD_SCHEME", "The signature or encryption scheme for this key is incorrect or not permitted in this situation." },
+  { TPM_BAD_DATASIZE, "TPM_BAD_DATASIZE", "The size of the data (or blob) parameter is bad or inconsistent with the referenced key" },
+  { TPM_BAD_MODE, "TPM_BAD_MODE", "A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob." },
+  { TPM_BAD_PRESENCE, "TPM_BAD_PRESENCE", "Either the physicalPresence or physicalPresenceLock bits have the wrong value" },
+  { TPM_BAD_VERSION, "TPM_BAD_VERSION", "The TPM cannot perform this version of the capability" },
+  { TPM_NO_WRAP_TRANSPORT, "TPM_NO_WRAP_TRANSPORT", "The TPM does not allow for wrapped transport sessions" },
+  { TPM_AUDITFAIL_UNSUCCESSFUL, "TPM_AUDITFAIL_UNSUCCESSFUL", "TPM audit construction failed and the underlying command was returning a failure code also" },
+  { TPM_AUDITFAIL_SUCCESSFUL, "TPM_AUDITFAIL_SUCCESSFUL", "TPM audit construction failed and the underlying command was returning success" },
+  { TPM_NOTRESETABLE, "TPM_NOTRESETABLE", "Attempt to reset a PCR register that does not have the resettable attribute" },
+  { TPM_NOTLOCAL, "TPM_NOTLOCAL", "Attempt to reset a PCR register that requires locality and locality modifier not part of command transport" },
+  { TPM_BAD_TYPE, "TPM_BAD_TYPE", "Make identity blob not properly typed" },
+  { TPM_INVALID_RESOURCE, "TPM_INVALID_RESOURCE", "When saving context identified resource type does not match actual resource" },
+  { TPM_NOTFIPS, "TPM_NOTFIPS", "The TPM is attempting to execute a command only available when in FIPS mode" },
+  { TPM_INVALID_FAMILY, "TPM_INVALID_FAMILY", "The command is attempting to use an invalid family ID" },
+  { TPM_NO_NV_PERMISSION, "TPM_NO_NV_PERMISSION", "The permission to manipulate the NV storage is not available" },
+  { TPM_REQUIRES_SIGN, "TPM_REQUIRES_SIGN", "The operation requires a signed command" },
+  { TPM_KEY_NOTSUPPORTED, "TPM_KEY_NOTSUPPORTED", "Wrong operation to load an NV key" },
+  { TPM_AUTH_CONFLICT, "TPM_AUTH_CONFLICT", "NV_LoadKey blob requires both owner and blob authorization" },
+  { TPM_AREA_LOCKED, "TPM_AREA_LOCKED", "The NV area is locked and not writtable" },
+  { TPM_BAD_LOCALITY, "TPM_BAD_LOCALITY", "The locality is incorrect for the attempted operation" },
+  { TPM_READ_ONLY, "TPM_READ_ONLY", "The NV area is read only and can't be written to" },
+  { TPM_PER_NOWRITE, "TPM_PER_NOWRITE", "There is no protection on the write to the NV area" },
+  { TPM_FAMILYCOUNT, "TPM_FAMILYCOUNT", "The family count value does not match" },
+  { TPM_WRITE_LOCKED, "TPM_WRITE_LOCKED", "The NV area has already been written to" },
+  { TPM_BAD_ATTRIBUTES, "TPM_BAD_ATTRIBUTES", "The NV area attributes conflict" },
+  { TPM_INVALID_STRUCTURE, "TPM_INVALID_STRUCTURE", "The structure tag and version are invalid or inconsistent" },
+  { TPM_KEY_OWNER_CONTROL, "TPM_KEY_OWNER_CONTROL", "The key is under control of the TPM Owner and can only be evicted by the TPM Owner." },
+  { TPM_BAD_COUNTER, "TPM_BAD_COUNTER", "The counter handle is incorrect" },
+  { TPM_NOT_FULLWRITE, "TPM_NOT_FULLWRITE", "The write is not a complete write of the area" },
+  { TPM_CONTEXT_GAP, "TPM_CONTEXT_GAP", "The gap between saved context counts is too large" },
+  { TPM_MAXNVWRITES, "TPM_MAXNVWRITES", "The maximum number of NV writes without an owner has been exceeded" },
+  { TPM_NOOPERATOR, "TPM_NOOPERATOR", "No operator authorization value is set" },
+  { TPM_RESOURCEMISSING, "TPM_RESOURCEMISSING", "The resource pointed to by context is not loaded" },
+  { TPM_DELEGATE_LOCK, "TPM_DELEGATE_LOCK", "The delegate administration is locked" },
+  { TPM_DELEGATE_FAMILY, "TPM_DELEGATE_FAMILY", "Attempt to manage a family other then the delegated family" },
+  { TPM_DELEGATE_ADMIN, "TPM_DELEGATE_ADMIN", "Delegation table management not enabled" },
+  { TPM_TRANSPORT_EXCLUSIVE, "TPM_TRANSPORT_EXCLUSIVE", "There was a command executed outside of an exclusive transport session" },
+};
+
+
+// helper function for the error codes:
+const char* tpm_get_error_name (TPM_RESULT code) {
+  // just do a linear scan for now
+  unsigned i;
+  for (i = 0; i < sizeof(error_msgs)/sizeof(error_msgs[0]); i++)
+    if (code == error_msgs[i].code)
+      return error_msgs[i].code_name;
+
+    return("Unknown Error Code");
+}
diff --git a/stubdom/vtpmmgr/log.h b/stubdom/vtpmmgr/log.h
new file mode 100644
index 0000000..5c7abf5
--- /dev/null
+++ b/stubdom/vtpmmgr/log.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __VTPM_LOG_H__
+#define __VTPM_LOG_H__
+
+#include <stdint.h>             // for uint32_t
+#include <stddef.h>             // for pointer NULL
+#include <stdio.h>
+#include "tcg.h"
+
+// =========================== LOGGING ==============================
+
+// the logging module numbers
+#define VTPM_LOG_TPM         1
+#define VTPM_LOG_TPM_DEEP    2
+#define VTPM_LOG_VTPM        3
+#define VTPM_LOG_VTPM_DEEP   4
+#define VTPM_LOG_TXDATA      5
+
+extern char *module_names[];
+
+// Default to standard logging
+#ifndef LOGGING_MODULES
+#define LOGGING_MODULES (BITMASK(VTPM_LOG_VTPM)|BITMASK(VTPM_LOG_TPM))
+#endif
+
+// bit-access macros
+#define BITMASK(idx)      ( 1U << (idx) )
+#define GETBIT(num,idx)   ( ((num) & BITMASK(idx)) >> idx )
+#define SETBIT(num,idx)   (num) |= BITMASK(idx)
+#define CLEARBIT(num,idx) (num) &= ( ~ BITMASK(idx) )
+
+#define vtpmloginfo(module, fmt, args...) \
+  if (GETBIT (LOGGING_MODULES, module) == 1) {				\
+    fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); \
+  }
+
+#define vtpmloginfomore(module, fmt, args...) \
+  if (GETBIT (LOGGING_MODULES, module) == 1) {			      \
+    fprintf (stdout, fmt,##args);				      \
+  }
+
+#define vtpmlogerror(module, fmt, args...) \
+  fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
+
+//typedef UINT32 tpm_size_t;
+
+// helper function for the error codes:
+const char* tpm_get_error_name (TPM_RESULT code);
+
+#endif // _VTPM_LOG_H_
diff --git a/stubdom/vtpmmgr/marshal.h b/stubdom/vtpmmgr/marshal.h
new file mode 100644
index 0000000..77d32f0
--- /dev/null
+++ b/stubdom/vtpmmgr/marshal.h
@@ -0,0 +1,528 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef MARSHAL_H
+#define MARSHAL_H
+
+#include <stdlib.h>
+#include <mini-os/byteorder.h>
+#include <mini-os/endian.h>
+#include "tcg.h"
+
+typedef enum UnpackPtr {
+   UNPACK_ALIAS,
+   UNPACK_ALLOC
+} UnpackPtr;
+
+inline BYTE* pack_BYTE(BYTE* ptr, BYTE t) {
+   ptr[0] = t;
+   return ++ptr;
+}
+
+inline BYTE* unpack_BYTE(BYTE* ptr, BYTE* t) {
+   t[0] = ptr[0];
+   return ++ptr;
+}
+
+#define pack_BOOL(p, t) pack_BYTE(p, t)
+#define unpack_BOOL(p, t) unpack_BYTE(p, t)
+
+inline BYTE* pack_UINT16(BYTE* ptr, UINT16 t) {
+   BYTE* b = (BYTE*)&t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   ptr[0] = b[1];
+   ptr[1] = b[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   ptr[0] = b[0];
+   ptr[1] = b[1];
+#endif
+   return ptr + sizeof(UINT16);
+}
+
+inline BYTE* unpack_UINT16(BYTE* ptr, UINT16* t) {
+   BYTE* b = (BYTE*)t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   b[0] = ptr[1];
+   b[1] = ptr[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   b[0] = ptr[0];
+   b[1] = ptr[1];
+#endif
+   return ptr + sizeof(UINT16);
+}
+
+inline BYTE* pack_UINT32(BYTE* ptr, UINT32 t) {
+   BYTE* b = (BYTE*)&t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   ptr[3] = b[0];
+   ptr[2] = b[1];
+   ptr[1] = b[2];
+   ptr[0] = b[3];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   ptr[0] = b[0];
+   ptr[1] = b[1];
+   ptr[2] = b[2];
+   ptr[3] = b[3];
+#endif
+   return ptr + sizeof(UINT32);
+}
+
+inline BYTE* unpack_UINT32(BYTE* ptr, UINT32* t) {
+   BYTE* b = (BYTE*)t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   b[0] = ptr[3];
+   b[1] = ptr[2];
+   b[2] = ptr[1];
+   b[3] = ptr[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   b[0] = ptr[0];
+   b[1] = ptr[1];
+   b[2] = ptr[2];
+   b[3] = ptr[3];
+#endif
+   return ptr + sizeof(UINT32);
+}
+
+#define pack_TPM_RESULT(p, t) pack_UINT32(p, t)
+#define pack_TPM_PCRINDEX(p, t) pack_UINT32(p, t)
+#define pack_TPM_DIRINDEX(p, t) pack_UINT32(p, t)
+#define pack_TPM_HANDLE(p, t) pack_UINT32(p, t)
+#define pack_TPM_AUTHHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_HASHHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_HMACHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_ENCHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TPM_KEY_HANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_ENTITYHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TPM_RESOURCE_TYPE(p, t) pack_UINT32(p, t)
+#define pack_TPM_COMMAND_CODE(p, t) pack_UINT32(p, t)
+#define pack_TPM_PROTOCOL_ID(p, t) pack_UINT16(p, t)
+#define pack_TPM_AUTH_DATA_USAGE(p, t) pack_BYTE(p, t)
+#define pack_TPM_ENTITY_TYPE(p, t) pack_UINT16(p, t)
+#define pack_TPM_ALGORITHM_ID(p, t) pack_UINT32(p, t)
+#define pack_TPM_KEY_USAGE(p, t) pack_UINT16(p, t)
+#define pack_TPM_STARTUP_TYPE(p, t) pack_UINT16(p, t)
+#define pack_TPM_CAPABILITY_AREA(p, t) pack_UINT32(p, t)
+#define pack_TPM_ENC_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_SIG_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_MIGRATE_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_PHYSICAL_PRESENCE(p, t) pack_UINT16(p, t)
+#define pack_TPM_KEY_FLAGS(p, t) pack_UINT32(p, t)
+
+#define unpack_TPM_RESULT(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_PCRINDEX(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_DIRINDEX(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_HANDLE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_AUTHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_HASHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_HMACHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_ENCHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TPM_KEY_HANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_ENTITYHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TPM_RESOURCE_TYPE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_COMMAND_CODE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_PROTOCOL_ID(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_AUTH_DATA_USAGE(p, t) unpack_BYTE(p, t)
+#define unpack_TPM_ENTITY_TYPE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_ALGORITHM_ID(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_KEY_USAGE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_STARTUP_TYPE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_CAPABILITY_AREA(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_ENC_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_SIG_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_MIGRATE_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_PHYSICAL_PRESENCE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_KEY_FLAGS(p, t) unpack_UINT32(p, t)
+
+#define pack_TPM_AUTH_HANDLE(p, t) pack_UINT32(p, t);
+#define pack_TCS_CONTEXT_HANDLE(p, t) pack_UINT32(p, t);
+#define pack_TCS_KEY_HANDLE(p, t) pack_UINT32(p, t);
+
+#define unpack_TPM_AUTH_HANDLE(p, t) unpack_UINT32(p, t);
+#define unpack_TCS_CONTEXT_HANDLE(p, t) unpack_UINT32(p, t);
+#define unpack_TCS_KEY_HANDLE(p, t) unpack_UINT32(p, t);
+
+inline BYTE* pack_BUFFER(BYTE* ptr, const BYTE* buf, UINT32 size) {
+   memcpy(ptr, buf, size);
+   return ptr + size;
+}
+
+inline BYTE* unpack_BUFFER(BYTE* ptr, BYTE* buf, UINT32 size) {
+   memcpy(buf, ptr, size);
+   return ptr + size;
+}
+
+inline BYTE* unpack_ALIAS(BYTE* ptr, BYTE** buf, UINT32 size) {
+   *buf = ptr;
+   return ptr + size;
+}
+
+inline BYTE* unpack_ALLOC(BYTE* ptr, BYTE** buf, UINT32 size) {
+   if(size) {
+      *buf = malloc(size);
+      memcpy(*buf, ptr, size);
+   } else {
+      *buf = NULL;
+   }
+   return ptr + size;
+}
+
+inline BYTE* unpack_PTR(BYTE* ptr, BYTE** buf, UINT32 size, UnpackPtr alloc) {
+   if(alloc == UNPACK_ALLOC) {
+      return unpack_ALLOC(ptr, buf, size);
+   } else {
+      return unpack_ALIAS(ptr, buf, size);
+   }
+}
+
+inline BYTE* pack_TPM_AUTHDATA(BYTE* ptr, const TPM_AUTHDATA* d) {
+   return pack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_AUTHDATA(BYTE* ptr, TPM_AUTHDATA* d) {
+   return unpack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
+}
+
+#define pack_TPM_SECRET(p, t) pack_TPM_AUTHDATA(p, t)
+#define pack_TPM_ENCAUTH(p, t) pack_TPM_AUTHDATA(p, t)
+#define pack_TPM_PAYLOAD_TYPE(p, t) pack_BYTE(p, t)
+#define pack_TPM_TAG(p, t) pack_UINT16(p, t)
+#define pack_TPM_STRUCTURE_TAG(p, t) pack_UINT16(p, t)
+
+#define unpack_TPM_SECRET(p, t) unpack_TPM_AUTHDATA(p, t)
+#define unpack_TPM_ENCAUTH(p, t) unpack_TPM_AUTHDATA(p, t)
+#define unpack_TPM_PAYLOAD_TYPE(p, t) unpack_BYTE(p, t)
+#define unpack_TPM_TAG(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_STRUCTURE_TAG(p, t) unpack_UINT16(p, t)
+
+inline BYTE* pack_TPM_VERSION(BYTE* ptr, const TPM_VERSION* t) {
+   ptr[0] = t->major;
+   ptr[1] = t->minor;
+   ptr[2] = t->revMajor;
+   ptr[3] = t->revMinor;
+   return ptr + 4;
+}
+
+inline BYTE* unpack_TPM_VERSION(BYTE* ptr, TPM_VERSION* t) {
+   t->major = ptr[0];
+   t->minor = ptr[1];
+   t->revMajor = ptr[2];
+   t->revMinor = ptr[3];
+   return ptr + 4;
+}
+
+inline BYTE* pack_TPM_CAP_VERSION_INFO(BYTE* ptr, const TPM_CAP_VERSION_INFO* v) {
+   ptr = pack_TPM_STRUCTURE_TAG(ptr, v->tag);
+   ptr = pack_TPM_VERSION(ptr, &v->version);
+   ptr = pack_UINT16(ptr, v->specLevel);
+   ptr = pack_BYTE(ptr, v->errataRev);
+   ptr = pack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));
+   ptr = pack_UINT16(ptr, v->vendorSpecificSize);
+   ptr = pack_BUFFER(ptr, v->vendorSpecific, v->vendorSpecificSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_CAP_VERSION_INFO(BYTE* ptr, TPM_CAP_VERSION_INFO* v, UnpackPtr alloc) {
+   ptr = unpack_TPM_STRUCTURE_TAG(ptr, &v->tag);
+   ptr = unpack_TPM_VERSION(ptr, &v->version);
+   ptr = unpack_UINT16(ptr, &v->specLevel);
+   ptr = unpack_BYTE(ptr, &v->errataRev);
+   ptr = unpack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));
+   ptr = unpack_UINT16(ptr, &v->vendorSpecificSize);
+   ptr = unpack_PTR(ptr, &v->vendorSpecific, v->vendorSpecificSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_DIGEST(BYTE* ptr, const TPM_DIGEST* d) {
+   return pack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_DIGEST(BYTE* ptr, TPM_DIGEST* d) {
+   return unpack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
+}
+
+#define pack_TPM_PCRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_PCRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_COMPOSITE_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_COMPOSITE_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_DIRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_DIRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_HMAC(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_HMAC(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_CHOSENID_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_CHOSENID_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+inline BYTE* pack_TPM_NONCE(BYTE* ptr, const TPM_NONCE* n) {
+   return pack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_NONCE(BYTE* ptr, TPM_NONCE* n) {
+   return unpack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* pack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, const TPM_SYMMETRIC_KEY_PARMS* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_UINT32(ptr, k->blockSize);
+   ptr = pack_UINT32(ptr, k->ivSize);
+   return pack_BUFFER(ptr, k->IV, k->ivSize);
+}
+
+inline BYTE* unpack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, TPM_SYMMETRIC_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_UINT32(ptr, &k->blockSize);
+   ptr = unpack_UINT32(ptr, &k->ivSize);
+   return unpack_PTR(ptr, &k->IV, k->ivSize, alloc);
+}
+
+inline BYTE* pack_TPM_RSA_KEY_PARMS(BYTE* ptr, const TPM_RSA_KEY_PARMS* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_UINT32(ptr, k->numPrimes);
+   ptr = pack_UINT32(ptr, k->exponentSize);
+   return pack_BUFFER(ptr, k->exponent, k->exponentSize);
+}
+
+inline BYTE* unpack_TPM_RSA_KEY_PARMS(BYTE* ptr, TPM_RSA_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_UINT32(ptr, &k->numPrimes);
+   ptr = unpack_UINT32(ptr, &k->exponentSize);
+   return unpack_PTR(ptr, &k->exponent, k->exponentSize, alloc);
+}
+
+inline BYTE* pack_TPM_KEY_PARMS(BYTE* ptr, const TPM_KEY_PARMS* k) {
+   ptr = pack_TPM_ALGORITHM_ID(ptr, k->algorithmID);
+   ptr = pack_TPM_ENC_SCHEME(ptr, k->encScheme);
+   ptr = pack_TPM_SIG_SCHEME(ptr, k->sigScheme);
+   ptr = pack_UINT32(ptr, k->parmSize);
+
+   if(k->parmSize) {
+      switch(k->algorithmID) {
+         case TPM_ALG_RSA:
+            return pack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa);
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            return pack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym);
+      }
+   }
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_KEY_PARMS(BYTE* ptr, TPM_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_ALGORITHM_ID(ptr, &k->algorithmID);
+   ptr = unpack_TPM_ENC_SCHEME(ptr, &k->encScheme);
+   ptr = unpack_TPM_SIG_SCHEME(ptr, &k->sigScheme);
+   ptr = unpack_UINT32(ptr, &k->parmSize);
+
+   if(k->parmSize) {
+      switch(k->algorithmID) {
+         case TPM_ALG_RSA:
+            return unpack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa, alloc);
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            return unpack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym, alloc);
+      }
+   }
+   return ptr;
+}
+
+inline BYTE* pack_TPM_STORE_PUBKEY(BYTE* ptr, const TPM_STORE_PUBKEY* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_BUFFER(ptr, k->key, k->keyLength);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_STORE_PUBKEY(BYTE* ptr, TPM_STORE_PUBKEY* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_PTR(ptr, &k->key, k->keyLength, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PUBKEY(BYTE* ptr, const TPM_PUBKEY* k) {
+   ptr = pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
+   return pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
+}
+
+inline BYTE* unpack_TPM_PUBKEY(BYTE* ptr, TPM_PUBKEY* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
+   return unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
+}
+
+inline BYTE* pack_TPM_PCR_SELECTION(BYTE* ptr, const TPM_PCR_SELECTION* p) {
+   ptr = pack_UINT16(ptr, p->sizeOfSelect);
+   ptr = pack_BUFFER(ptr, p->pcrSelect, p->sizeOfSelect);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_SELECTION(BYTE* ptr, TPM_PCR_SELECTION* p, UnpackPtr alloc) {
+   ptr = unpack_UINT16(ptr, &p->sizeOfSelect);
+   ptr = unpack_PTR(ptr, &p->pcrSelect, p->sizeOfSelect, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PCR_INFO(BYTE* ptr, const TPM_PCR_INFO* p) {
+   ptr = pack_TPM_PCR_SELECTION(ptr, &p->pcrSelection);
+   ptr = pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
+   ptr = pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_INFO(BYTE* ptr, TPM_PCR_INFO* p, UnpackPtr alloc) {
+   ptr = unpack_TPM_PCR_SELECTION(ptr, &p->pcrSelection, alloc);
+   ptr = unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
+   ptr = unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PCR_COMPOSITE(BYTE* ptr, const TPM_PCR_COMPOSITE* p) {
+   ptr = pack_TPM_PCR_SELECTION(ptr, &p->select);
+   ptr = pack_UINT32(ptr, p->valueSize);
+   ptr = pack_BUFFER(ptr, (const BYTE*)p->pcrValue, p->valueSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_COMPOSITE(BYTE* ptr, TPM_PCR_COMPOSITE* p, UnpackPtr alloc) {
+   ptr = unpack_TPM_PCR_SELECTION(ptr, &p->select, alloc);
+   ptr = unpack_UINT32(ptr, &p->valueSize);
+   ptr = unpack_PTR(ptr, (BYTE**)&p->pcrValue, p->valueSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_KEY(BYTE* ptr, const TPM_KEY* k) {
+   ptr = pack_TPM_VERSION(ptr, &k->ver);
+   ptr = pack_TPM_KEY_USAGE(ptr, k->keyUsage);
+   ptr = pack_TPM_KEY_FLAGS(ptr, k->keyFlags);
+   ptr = pack_TPM_AUTH_DATA_USAGE(ptr, k->authDataUsage);
+   ptr = pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
+   ptr = pack_UINT32(ptr, k->PCRInfoSize);
+   if(k->PCRInfoSize) {
+      ptr = pack_TPM_PCR_INFO(ptr, &k->PCRInfo);
+   }
+   ptr = pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
+   ptr = pack_UINT32(ptr, k->encDataSize);
+   return pack_BUFFER(ptr, k->encData, k->encDataSize);
+}
+
+inline BYTE* unpack_TPM_KEY(BYTE* ptr, TPM_KEY* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &k->ver);
+   ptr = unpack_TPM_KEY_USAGE(ptr, &k->keyUsage);
+   ptr = unpack_TPM_KEY_FLAGS(ptr, &k->keyFlags);
+   ptr = unpack_TPM_AUTH_DATA_USAGE(ptr, &k->authDataUsage);
+   ptr = unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
+   ptr = unpack_UINT32(ptr, &k->PCRInfoSize);
+   if(k->PCRInfoSize) {
+      ptr = unpack_TPM_PCR_INFO(ptr, &k->PCRInfo, alloc);
+   }
+   ptr = unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
+   ptr = unpack_UINT32(ptr, &k->encDataSize);
+   return unpack_PTR(ptr, &k->encData, k->encDataSize, alloc);
+}
+
+inline BYTE* pack_TPM_BOUND_DATA(BYTE* ptr, const TPM_BOUND_DATA* b, UINT32 payloadSize) {
+   ptr = pack_TPM_VERSION(ptr, &b->ver);
+   ptr = pack_TPM_PAYLOAD_TYPE(ptr, b->payload);
+   return pack_BUFFER(ptr, b->payloadData, payloadSize);
+}
+
+inline BYTE* unpack_TPM_BOUND_DATA(BYTE* ptr, TPM_BOUND_DATA* b, UINT32 payloadSize, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &b->ver);
+   ptr = unpack_TPM_PAYLOAD_TYPE(ptr, &b->payload);
+   return unpack_PTR(ptr, &b->payloadData, payloadSize, alloc);
+}
+
+inline BYTE* pack_TPM_STORED_DATA(BYTE* ptr, const TPM_STORED_DATA* d) {
+   ptr = pack_TPM_VERSION(ptr, &d->ver);
+   ptr = pack_UINT32(ptr, d->sealInfoSize);
+   if(d->sealInfoSize) {
+      ptr = pack_TPM_PCR_INFO(ptr, &d->sealInfo);
+   }
+   ptr = pack_UINT32(ptr, d->encDataSize);
+   ptr = pack_BUFFER(ptr, d->encData, d->encDataSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_STORED_DATA(BYTE* ptr, TPM_STORED_DATA* d, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &d->ver);
+   ptr = unpack_UINT32(ptr, &d->sealInfoSize);
+   if(d->sealInfoSize) {
+      ptr = unpack_TPM_PCR_INFO(ptr, &d->sealInfo, alloc);
+   }
+   ptr = unpack_UINT32(ptr, &d->encDataSize);
+   ptr = unpack_PTR(ptr, &d->encData, d->encDataSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_AUTH_SESSION(BYTE* ptr, const TPM_AUTH_SESSION* auth) {
+   ptr = pack_TPM_AUTH_HANDLE(ptr, auth->AuthHandle);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+   ptr = pack_TPM_AUTHDATA(ptr, &auth->HMAC);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_AUTH_SESSION(BYTE* ptr, TPM_AUTH_SESSION* auth) {
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = unpack_BOOL(ptr, &auth->fContinueAuthSession);
+   ptr = unpack_TPM_AUTHDATA(ptr, &auth->HMAC);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_RQU_HEADER(BYTE* ptr,
+      TPM_TAG tag,
+      UINT32 size,
+      TPM_COMMAND_CODE ord) {
+   ptr = pack_UINT16(ptr, tag);
+   ptr = pack_UINT32(ptr, size);
+   return pack_UINT32(ptr, ord);
+}
+
+inline BYTE* unpack_TPM_RQU_HEADER(BYTE* ptr,
+      TPM_TAG* tag,
+      UINT32* size,
+      TPM_COMMAND_CODE* ord) {
+   ptr = unpack_UINT16(ptr, tag);
+   ptr = unpack_UINT32(ptr, size);
+   ptr = unpack_UINT32(ptr, ord);
+   return ptr;
+}
+
+#define pack_TPM_RSP_HEADER(p, t, s, r) pack_TPM_RQU_HEADER(p, t, s, r);
+#define unpack_TPM_RSP_HEADER(p, t, s, r) unpack_TPM_RQU_HEADER(p, t, s, r);
+
+#endif
diff --git a/stubdom/vtpmmgr/minios.cfg b/stubdom/vtpmmgr/minios.cfg
new file mode 100644
index 0000000..3fb383d
--- /dev/null
+++ b/stubdom/vtpmmgr/minios.cfg
@@ -0,0 +1,14 @@
+CONFIG_TPMFRONT=y
+CONFIG_TPM_TIS=y
+CONFIG_TPMBACK=y
+CONFIG_START_NETWORK=n
+CONFIG_TEST=n
+CONFIG_PCIFRONT=n
+CONFIG_BLKFRONT=y
+CONFIG_NETFRONT=n
+CONFIG_FBFRONT=n
+CONFIG_KBDFRONT=n
+CONFIG_CONSFRONT=n
+CONFIG_XENBUS=y
+CONFIG_LWIP=n
+CONFIG_XC=n
diff --git a/stubdom/vtpmmgr/tcg.h b/stubdom/vtpmmgr/tcg.h
new file mode 100644
index 0000000..7687eae
--- /dev/null
+++ b/stubdom/vtpmmgr/tcg.h
@@ -0,0 +1,707 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005 Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __TCG_H__
+#define __TCG_H__
+
+#include <stdlib.h>
+#include <stdint.h>
+
+// **************************** CONSTANTS *********************************
+
+// BOOL values
+#define TRUE 0x01
+#define FALSE 0x00
+
+#define TCPA_MAX_BUFFER_LENGTH 0x2000
+
+//
+// TPM_COMMAND_CODE values
+#define TPM_PROTECTED_ORDINAL 0x00000000UL
+#define TPM_UNPROTECTED_ORDINAL 0x80000000UL
+#define TPM_CONNECTION_ORDINAL 0x40000000UL
+#define TPM_VENDOR_ORDINAL 0x20000000UL
+
+#define TPM_ORD_OIAP                     (10UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OSAP                     (11UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuth               (12UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_TakeOwnership            (13UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthAsymStart      (14UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthAsymFinish     (15UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthOwner          (16UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Extend                   (20UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PcrRead                  (21UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Quote                    (22UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Seal                     (23UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Unseal                   (24UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DirWriteAuth             (25UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DirRead                  (26UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_UnBind                   (30UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateWrapKey            (31UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadKey                  (32UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetPubKey                (33UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_EvictKey                 (34UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateMigrationBlob      (40UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReWrapKey                (41UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ConvertMigrationBlob     (42UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_AuthorizeMigrationKey    (43UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateMaintenanceArchive (44UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadMaintenanceArchive   (45UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_KillMaintenanceFeature   (46UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadManuMaintPub         (47UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadManuMaintPub         (48UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CertifyKey               (50UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Sign                     (60UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetRandom                (70UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_StirRandom               (71UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SelfTestFull             (80UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SelfTestStartup          (81UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CertifySelfTest          (82UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ContinueSelfTest         (83UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetTestResult            (84UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Reset                    (90UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerClear               (91UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisableOwnerClear        (92UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ForceClear               (93UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisableForceClear        (94UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapabilitySigned      (100UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapability            (101UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapabilityOwner       (102UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerSetDisable          (110UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalEnable           (111UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalDisable          (112UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetOwnerInstall          (113UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalSetDeactivated   (114UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetTempDeactivated       (115UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateEndorsementKeyPair (120UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_MakeIdentity             (121UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ActivateIdentity         (122UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadPubek                (124UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerReadPubek           (125UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisablePubekRead         (126UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetAuditEvent            (130UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetAuditEventSigned      (131UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetOrdinalAuditStatus    (140UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetOrdinalAuditStatus    (141UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Terminate_Handle         (150UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Init                     (151UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveState                (152UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Startup                  (153UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetRedirection           (154UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Start                (160UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Update               (161UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Complete             (162UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1CompleteExtend       (163UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_FieldUpgrade             (170UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveKeyContext           (180UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadKeyContext           (181UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveAuthContext          (182UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadAuthContext          (183UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveContext                      (184UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadContext                      (185UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_FlushSpecific                    (186UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PCR_Reset                        (200UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_DefineSpace                   (204UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_WriteValue                    (205UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_WriteValueAuth                (206UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_ReadValue                     (207UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_ReadValueAuth                 (208UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_UpdateVerification      (209UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_Manage                  (210UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_CreateKeyDelegation     (212UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_CreateOwnerDelegation   (213UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_VerifyDelegation        (214UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_LoadOwnerDelegation     (216UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_ReadAuth                (217UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_ReadTable               (219UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateCounter                    (220UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_IncrementCounter                 (221UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadCounter                      (222UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseCounter                   (223UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseCounterOwner              (224UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_EstablishTransport               (230UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ExecuteTransport                 (231UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseTransportSigned           (232UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetTicks                         (241UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_TickStampBlob                    (242UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_MAX                              (256UL + TPM_PROTECTED_ORDINAL)
+
+#define TSC_ORD_PhysicalPresence         (10UL + TPM_CONNECTION_ORDINAL)
+
+
+
+//
+// TPM_RESULT values
+//
+// just put in the whole table from spec 1.2
+
+#define TPM_BASE   0x0 // The start of TPM return codes
+#define TPM_VENDOR_ERROR 0x00000400 // Mask to indicate that the error code is vendor specific for vendor specific commands
+#define TPM_NON_FATAL  0x00000800 // Mask to indicate that the error code is a non-fatal failure.
+
+#define TPM_SUCCESS   TPM_BASE // Successful completion of the operation
+#define TPM_AUTHFAIL      TPM_BASE + 1 // Authentication failed
+#define TPM_BADINDEX      TPM_BASE + 2 // The index to a PCR, DIR or other register is incorrect
+#define TPM_BAD_PARAMETER     TPM_BASE + 3 // One or more parameter is bad
+#define TPM_AUDITFAILURE     TPM_BASE + 4 // An operation completed successfully but the auditing of that operation failed.
+#define TPM_CLEAR_DISABLED     TPM_BASE + 5 // The clear disable flag is set and all clear operations now require physical access
+#define TPM_DEACTIVATED     TPM_BASE + 6 // The TPM is deactivated
+#define TPM_DISABLED      TPM_BASE + 7 // The TPM is disabled
+#define TPM_DISABLED_CMD     TPM_BASE + 8 // The target command has been disabled
+#define TPM_FAIL       TPM_BASE + 9 // The operation failed
+#define TPM_BAD_ORDINAL     TPM_BASE + 10 // The ordinal was unknown or inconsistent
+#define TPM_INSTALL_DISABLED   TPM_BASE + 11 // The ability to install an owner is disabled
+#define TPM_INVALID_KEYHANDLE  TPM_BASE + 12 // The key handle presented was invalid
+#define TPM_KEYNOTFOUND     TPM_BASE + 13 // The target key was not found
+#define TPM_INAPPROPRIATE_ENC  TPM_BASE + 14 // Unacceptable encryption scheme
+#define TPM_MIGRATEFAIL     TPM_BASE + 15 // Migration authorization failed
+#define TPM_INVALID_PCR_INFO   TPM_BASE + 16 // PCR information could not be interpreted
+#define TPM_NOSPACE      TPM_BASE + 17 // No room to load key.
+#define TPM_NOSRK       TPM_BASE + 18 // There is no SRK set
+#define TPM_NOTSEALED_BLOB     TPM_BASE + 19 // An encrypted blob is invalid or was not created by this TPM
+#define TPM_OWNER_SET      TPM_BASE + 20 // There is already an Owner
+#define TPM_RESOURCES      TPM_BASE + 21 // The TPM has insufficient internal resources to perform the requested action.
+#define TPM_SHORTRANDOM     TPM_BASE + 22 // A random string was too short
+#define TPM_SIZE       TPM_BASE + 23 // The TPM does not have the space to perform the operation.
+#define TPM_WRONGPCRVAL     TPM_BASE + 24 // The named PCR value does not match the current PCR value.
+#define TPM_BAD_PARAM_SIZE     TPM_BASE + 25 // The paramSize argument to the command has the incorrect value
+#define TPM_SHA_THREAD      TPM_BASE + 26 // There is no existing SHA-1 thread.
+#define TPM_SHA_ERROR      TPM_BASE + 27 // The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error.
+#define TPM_FAILEDSELFTEST     TPM_BASE + 28 // Self-test has failed and the TPM has shutdown.
+#define TPM_AUTH2FAIL      TPM_BASE + 29 // The authorization for the second key in a 2 key function failed authorization
+#define TPM_BADTAG       TPM_BASE + 30 // The tag value sent to for a command is invalid
+#define TPM_IOERROR      TPM_BASE + 31 // An IO error occurred transmitting information to the TPM
+#define TPM_ENCRYPT_ERROR     TPM_BASE + 32 // The encryption process had a problem.
+#define TPM_DECRYPT_ERROR     TPM_BASE + 33 // The decryption process did not complete.
+#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 // An invalid handle was used.
+#define TPM_NO_ENDORSEMENT     TPM_BASE + 35 // The TPM does not a EK installed
+#define TPM_INVALID_KEYUSAGE   TPM_BASE + 36 // The usage of a key is not allowed
+#define TPM_WRONG_ENTITYTYPE   TPM_BASE + 37 // The submitted entity type is not allowed
+#define TPM_INVALID_POSTINIT   TPM_BASE + 38 // The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup
+#define TPM_INAPPROPRIATE_SIG  TPM_BASE + 39 // Signed data cannot include additional DER information
+#define TPM_BAD_KEY_PROPERTY   TPM_BASE + 40 // The key properties in TPM_KEY_PARMs are not supported by this TPM
+
+#define TPM_BAD_MIGRATION      TPM_BASE + 41 // The migration properties of this key are incorrect.
+#define TPM_BAD_SCHEME       TPM_BASE + 42 // The signature or encryption scheme for this key is incorrect or not permitted in this situation.
+#define TPM_BAD_DATASIZE      TPM_BASE + 43 // The size of the data (or blob) parameter is bad or inconsistent with the referenced key
+#define TPM_BAD_MODE       TPM_BASE + 44 // A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob.
+#define TPM_BAD_PRESENCE      TPM_BASE + 45 // Either the physicalPresence or physicalPresenceLock bits have the wrong value
+#define TPM_BAD_VERSION      TPM_BASE + 46 // The TPM cannot perform this version of the capability
+#define TPM_NO_WRAP_TRANSPORT     TPM_BASE + 47 // The TPM does not allow for wrapped transport sessions
+#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 // TPM audit construction failed and the underlying command was returning a failure code also
+#define TPM_AUDITFAIL_SUCCESSFUL   TPM_BASE + 49 // TPM audit construction failed and the underlying command was returning success
+#define TPM_NOTRESETABLE      TPM_BASE + 50 // Attempt to reset a PCR register that does not have the resettable attribute
+#define TPM_NOTLOCAL       TPM_BASE + 51 // Attempt to reset a PCR register that requires locality and locality modifier not part of command transport
+#define TPM_BAD_TYPE       TPM_BASE + 52 // Make identity blob not properly typed
+#define TPM_INVALID_RESOURCE     TPM_BASE + 53 // When saving context identified resource type does not match actual resource
+#define TPM_NOTFIPS       TPM_BASE + 54 // The TPM is attempting to execute a command only available when in FIPS mode
+#define TPM_INVALID_FAMILY      TPM_BASE + 55 // The command is attempting to use an invalid family ID
+#define TPM_NO_NV_PERMISSION     TPM_BASE + 56 // The permission to manipulate the NV storage is not available
+#define TPM_REQUIRES_SIGN      TPM_BASE + 57 // The operation requires a signed command
+#define TPM_KEY_NOTSUPPORTED     TPM_BASE + 58 // Wrong operation to load an NV key
+#define TPM_AUTH_CONFLICT      TPM_BASE + 59 // NV_LoadKey blob requires both owner and blob authorization
+#define TPM_AREA_LOCKED      TPM_BASE + 60 // The NV area is locked and not writtable
+#define TPM_BAD_LOCALITY      TPM_BASE + 61 // The locality is incorrect for the attempted operation
+#define TPM_READ_ONLY       TPM_BASE + 62 // The NV area is read only and can't be written to
+#define TPM_PER_NOWRITE      TPM_BASE + 63 // There is no protection on the write to the NV area
+#define TPM_FAMILYCOUNT      TPM_BASE + 64 // The family count value does not match
+#define TPM_WRITE_LOCKED      TPM_BASE + 65 // The NV area has already been written to
+#define TPM_BAD_ATTRIBUTES      TPM_BASE + 66 // The NV area attributes conflict
+#define TPM_INVALID_STRUCTURE     TPM_BASE + 67 // The structure tag and version are invalid or inconsistent
+#define TPM_KEY_OWNER_CONTROL     TPM_BASE + 68 // The key is under control of the TPM Owner and can only be evicted by the TPM Owner.
+#define TPM_BAD_COUNTER      TPM_BASE + 69 // The counter handle is incorrect
+#define TPM_NOT_FULLWRITE      TPM_BASE + 70 // The write is not a complete write of the area
+#define TPM_CONTEXT_GAP      TPM_BASE + 71 // The gap between saved context counts is too large
+#define TPM_MAXNVWRITES      TPM_BASE + 72 // The maximum number of NV writes without an owner has been exceeded
+#define TPM_NOOPERATOR       TPM_BASE + 73 // No operator authorization value is set
+#define TPM_RESOURCEMISSING     TPM_BASE + 74 // The resource pointed to by context is not loaded
+#define TPM_DELEGATE_LOCK      TPM_BASE + 75 // The delegate administration is locked
+#define TPM_DELEGATE_FAMILY     TPM_BASE + 76 // Attempt to manage a family other then the delegated family
+#define TPM_DELEGATE_ADMIN      TPM_BASE + 77 // Delegation table management not enabled
+#define TPM_TRANSPORT_EXCLUSIVE    TPM_BASE + 78 // There was a command executed outside of an exclusive transport session
+
+// TPM_STARTUP_TYPE values
+#define TPM_ST_CLEAR 0x0001
+#define TPM_ST_STATE 0x0002
+#define TPM_ST_DEACTIVATED 0x003
+
+// TPM_TAG values
+#define TPM_TAG_RQU_COMMAND 0x00c1
+#define TPM_TAG_RQU_AUTH1_COMMAND 0x00c2
+#define TPM_TAG_RQU_AUTH2_COMMAND 0x00c3
+#define TPM_TAG_RSP_COMMAND 0x00c4
+#define TPM_TAG_RSP_AUTH1_COMMAND 0x00c5
+#define TPM_TAG_RSP_AUTH2_COMMAND 0x00c6
+
+// TPM_PAYLOAD_TYPE values
+#define TPM_PT_ASYM 0x01
+#define TPM_PT_BIND 0x02
+#define TPM_PT_MIGRATE 0x03
+#define TPM_PT_MAINT 0x04
+#define TPM_PT_SEAL 0x05
+
+// TPM_ENTITY_TYPE values
+#define TPM_ET_KEYHANDLE 0x0001
+#define TPM_ET_OWNER 0x0002
+#define TPM_ET_DATA 0x0003
+#define TPM_ET_SRK 0x0004
+#define TPM_ET_KEY 0x0005
+
+/// TPM_ResourceTypes
+#define TPM_RT_KEY      0x00000001
+#define TPM_RT_AUTH     0x00000002
+#define TPM_RT_HASH     0x00000003
+#define TPM_RT_TRANS    0x00000004
+#define TPM_RT_CONTEXT  0x00000005
+#define TPM_RT_COUNTER  0x00000006
+#define TPM_RT_DELEGATE 0x00000007
+#define TPM_RT_DAA_TPM  0x00000008
+#define TPM_RT_DAA_V0   0x00000009
+#define TPM_RT_DAA_V1   0x0000000A
+
+
+
+// TPM_PROTOCOL_ID values
+#define TPM_PID_OIAP 0x0001
+#define TPM_PID_OSAP 0x0002
+#define TPM_PID_ADIP 0x0003
+#define TPM_PID_ADCP 0x0004
+#define TPM_PID_OWNER 0x0005
+
+// TPM_ALGORITHM_ID values
+#define TPM_ALG_RSA 0x00000001
+#define TPM_ALG_SHA 0x00000004
+#define TPM_ALG_HMAC 0x00000005
+#define TPM_ALG_AES128 0x00000006
+#define TPM_ALG_MFG1 0x00000007
+#define TPM_ALG_AES192 0x00000008
+#define TPM_ALG_AES256 0x00000009
+#define TPM_ALG_XOR 0x0000000A
+
+// TPM_ENC_SCHEME values
+#define TPM_ES_NONE 0x0001
+#define TPM_ES_RSAESPKCSv15 0x0002
+#define TPM_ES_RSAESOAEP_SHA1_MGF1 0x0003
+
+// TPM_SIG_SCHEME values
+#define TPM_SS_NONE 0x0001
+#define TPM_SS_RSASSAPKCS1v15_SHA1 0x0002
+#define TPM_SS_RSASSAPKCS1v15_DER 0x0003
+
+/*
+ * TPM_CAPABILITY_AREA Values for TPM_GetCapability ([TPM_Part2], Section 21.1)
+ */
+#define TPM_CAP_ORD                     0x00000001
+#define TPM_CAP_ALG                     0x00000002
+#define TPM_CAP_PID                     0x00000003
+#define TPM_CAP_FLAG                    0x00000004
+#define TPM_CAP_PROPERTY                0x00000005
+#define TPM_CAP_VERSION                 0x00000006
+#define TPM_CAP_KEY_HANDLE              0x00000007
+#define TPM_CAP_CHECK_LOADED            0x00000008
+#define TPM_CAP_SYM_MODE                0x00000009
+#define TPM_CAP_KEY_STATUS              0x0000000C
+#define TPM_CAP_NV_LIST                 0x0000000D
+#define TPM_CAP_MFR                     0x00000010
+#define TPM_CAP_NV_INDEX                0x00000011
+#define TPM_CAP_TRANS_ALG               0x00000012
+#define TPM_CAP_HANDLE                  0x00000014
+#define TPM_CAP_TRANS_ES                0x00000015
+#define TPM_CAP_AUTH_ENCRYPT            0x00000017
+#define TPM_CAP_SELECT_SIZE             0x00000018
+#define TPM_CAP_DA_LOGIC                0x00000019
+#define TPM_CAP_VERSION_VAL             0x0000001A
+
+/* subCap definitions ([TPM_Part2], Section 21.2) */
+#define TPM_CAP_PROP_PCR                0x00000101
+#define TPM_CAP_PROP_DIR                0x00000102
+#define TPM_CAP_PROP_MANUFACTURER       0x00000103
+#define TPM_CAP_PROP_KEYS               0x00000104
+#define TPM_CAP_PROP_MIN_COUNTER        0x00000107
+#define TPM_CAP_FLAG_PERMANENT          0x00000108
+#define TPM_CAP_FLAG_VOLATILE           0x00000109
+#define TPM_CAP_PROP_AUTHSESS           0x0000010A
+#define TPM_CAP_PROP_TRANSESS           0x0000010B
+#define TPM_CAP_PROP_COUNTERS           0x0000010C
+#define TPM_CAP_PROP_MAX_AUTHSESS       0x0000010D
+#define TPM_CAP_PROP_MAX_TRANSESS       0x0000010E
+#define TPM_CAP_PROP_MAX_COUNTERS       0x0000010F
+#define TPM_CAP_PROP_MAX_KEYS           0x00000110
+#define TPM_CAP_PROP_OWNER              0x00000111
+#define TPM_CAP_PROP_CONTEXT            0x00000112
+#define TPM_CAP_PROP_MAX_CONTEXT        0x00000113
+#define TPM_CAP_PROP_FAMILYROWS         0x00000114
+#define TPM_CAP_PROP_TIS_TIMEOUT        0x00000115
+#define TPM_CAP_PROP_STARTUP_EFFECT     0x00000116
+#define TPM_CAP_PROP_DELEGATE_ROW       0x00000117
+#define TPM_CAP_PROP_MAX_DAASESS        0x00000119
+#define TPM_CAP_PROP_DAASESS            0x0000011A
+#define TPM_CAP_PROP_CONTEXT_DIST       0x0000011B
+#define TPM_CAP_PROP_DAA_INTERRUPT      0x0000011C
+#define TPM_CAP_PROP_SESSIONS           0x0000011D
+#define TPM_CAP_PROP_MAX_SESSIONS       0x0000011E
+#define TPM_CAP_PROP_CMK_RESTRICTION    0x0000011F
+#define TPM_CAP_PROP_DURATION           0x00000120
+#define TPM_CAP_PROP_ACTIVE_COUNTER     0x00000122
+#define TPM_CAP_PROP_MAX_NV_AVAILABLE   0x00000123
+#define TPM_CAP_PROP_INPUT_BUFFER       0x00000124
+
+// TPM_KEY_USAGE values
+#define TPM_KEY_EK 0x0000
+#define TPM_KEY_SIGNING 0x0010
+#define TPM_KEY_STORAGE 0x0011
+#define TPM_KEY_IDENTITY 0x0012
+#define TPM_KEY_AUTHCHANGE 0X0013
+#define TPM_KEY_BIND 0x0014
+#define TPM_KEY_LEGACY 0x0015
+
+// TPM_AUTH_DATA_USAGE values
+#define TPM_AUTH_NEVER 0x00
+#define TPM_AUTH_ALWAYS 0x01
+
+// Key Handle of owner and srk
+#define TPM_OWNER_KEYHANDLE 0x40000001
+#define TPM_SRK_KEYHANDLE 0x40000000
+
+
+
+// *************************** TYPEDEFS *********************************
+typedef unsigned char BYTE;
+typedef unsigned char BOOL;
+typedef uint16_t UINT16;
+typedef uint32_t UINT32;
+typedef uint64_t UINT64;
+
+typedef UINT32 TPM_RESULT;
+typedef UINT32 TPM_PCRINDEX;
+typedef UINT32 TPM_DIRINDEX;
+typedef UINT32 TPM_HANDLE;
+typedef TPM_HANDLE TPM_AUTHHANDLE;
+typedef TPM_HANDLE TCPA_HASHHANDLE;
+typedef TPM_HANDLE TCPA_HMACHANDLE;
+typedef TPM_HANDLE TCPA_ENCHANDLE;
+typedef TPM_HANDLE TPM_KEY_HANDLE;
+typedef TPM_HANDLE TCPA_ENTITYHANDLE;
+typedef UINT32 TPM_RESOURCE_TYPE;
+typedef UINT32 TPM_COMMAND_CODE;
+typedef UINT16 TPM_PROTOCOL_ID;
+typedef BYTE TPM_AUTH_DATA_USAGE;
+typedef UINT16 TPM_ENTITY_TYPE;
+typedef UINT32 TPM_ALGORITHM_ID;
+typedef UINT16 TPM_KEY_USAGE;
+typedef UINT16 TPM_STARTUP_TYPE;
+typedef UINT32 TPM_CAPABILITY_AREA;
+typedef UINT16 TPM_ENC_SCHEME;
+typedef UINT16 TPM_SIG_SCHEME;
+typedef UINT16 TPM_MIGRATE_SCHEME;
+typedef UINT16 TPM_PHYSICAL_PRESENCE;
+typedef UINT32 TPM_KEY_FLAGS;
+
+#define TPM_DIGEST_SIZE 20  // Don't change this
+typedef BYTE TPM_AUTHDATA[TPM_DIGEST_SIZE];
+typedef TPM_AUTHDATA TPM_SECRET;
+typedef TPM_AUTHDATA TPM_ENCAUTH;
+typedef BYTE TPM_PAYLOAD_TYPE;
+typedef UINT16 TPM_TAG;
+typedef UINT16 TPM_STRUCTURE_TAG;
+
+// Data Types of the TCS
+typedef UINT32 TCS_AUTHHANDLE;  // Handle addressing a authorization session
+typedef UINT32 TCS_CONTEXT_HANDLE; // Basic context handle
+typedef UINT32 TCS_KEY_HANDLE;  // Basic key handle
+
+// ************************* STRUCTURES **********************************
+
+typedef struct TPM_VERSION {
+  BYTE major;
+  BYTE minor;
+  BYTE revMajor;
+  BYTE revMinor;
+} TPM_VERSION;
+
+static const TPM_VERSION TPM_STRUCT_VER_1_1 = { 1,1,0,0 };
+
+typedef struct TPM_CAP_VERSION_INFO {
+   TPM_STRUCTURE_TAG tag;
+   TPM_VERSION version;
+   UINT16 specLevel;
+   BYTE errataRev;
+   BYTE tpmVendorID[4];
+   UINT16 vendorSpecificSize;
+   BYTE* vendorSpecific;
+} TPM_CAP_VERSION_INFO;
+
+inline void free_TPM_CAP_VERSION_INFO(TPM_CAP_VERSION_INFO* v) {
+   free(v->vendorSpecific);
+   v->vendorSpecific = NULL;
+}
+
+typedef struct TPM_DIGEST {
+  BYTE digest[TPM_DIGEST_SIZE];
+} TPM_DIGEST;
+
+typedef TPM_DIGEST TPM_PCRVALUE;
+typedef TPM_DIGEST TPM_COMPOSITE_HASH;
+typedef TPM_DIGEST TPM_DIRVALUE;
+typedef TPM_DIGEST TPM_HMAC;
+typedef TPM_DIGEST TPM_CHOSENID_HASH;
+
+typedef struct TPM_NONCE {
+  BYTE nonce[TPM_DIGEST_SIZE];
+} TPM_NONCE;
+
+typedef struct TPM_SYMMETRIC_KEY_PARMS {
+   UINT32 keyLength;
+   UINT32 blockSize;
+   UINT32 ivSize;
+   BYTE* IV;
+} TPM_SYMMETRIC_KEY_PARMS;
+
+inline void free_TPM_SYMMETRIC_KEY_PARMS(TPM_SYMMETRIC_KEY_PARMS* p) {
+   free(p->IV);
+   p->IV = NULL;
+}
+
+#define TPM_SYMMETRIC_KEY_PARMS_INIT { 0, 0, 0, NULL }
+
+typedef struct TPM_RSA_KEY_PARMS {
+  UINT32 keyLength;
+  UINT32 numPrimes;
+  UINT32 exponentSize;
+  BYTE* exponent;
+} TPM_RSA_KEY_PARMS;
+
+#define TPM_RSA_KEY_PARMS_INIT { 0, 0, 0, NULL }
+
+inline void free_TPM_RSA_KEY_PARMS(TPM_RSA_KEY_PARMS* p) {
+   free(p->exponent);
+   p->exponent = NULL;
+}
+
+typedef struct TPM_KEY_PARMS {
+  TPM_ALGORITHM_ID algorithmID;
+  TPM_ENC_SCHEME encScheme;
+  TPM_SIG_SCHEME sigScheme;
+  UINT32 parmSize;
+  union {
+     TPM_SYMMETRIC_KEY_PARMS sym;
+     TPM_RSA_KEY_PARMS rsa;
+  } parms;
+} TPM_KEY_PARMS;
+
+#define TPM_KEY_PARMS_INIT { 0, 0, 0, 0 }
+
+inline void free_TPM_KEY_PARMS(TPM_KEY_PARMS* p) {
+   if(p->parmSize) {
+      switch(p->algorithmID) {
+         case TPM_ALG_RSA:
+            free_TPM_RSA_KEY_PARMS(&p->parms.rsa);
+            break;
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            free_TPM_SYMMETRIC_KEY_PARMS(&p->parms.sym);
+            break;
+      }
+   }
+}
+
+typedef struct TPM_STORE_PUBKEY {
+  UINT32 keyLength;
+  BYTE* key;
+} TPM_STORE_PUBKEY;
+
+#define TPM_STORE_PUBKEY_INIT { 0, NULL }
+
+inline void free_TPM_STORE_PUBKEY(TPM_STORE_PUBKEY* p) {
+   free(p->key);
+   p->key = NULL;
+}
+
+typedef struct TPM_PUBKEY {
+  TPM_KEY_PARMS algorithmParms;
+  TPM_STORE_PUBKEY pubKey;
+} TPM_PUBKEY;
+
+#define TPM_PUBKEY_INIT { TPM_KEY_PARMS_INIT, TPM_STORE_PUBKEY_INIT }
+
+inline void free_TPM_PUBKEY(TPM_PUBKEY* k) {
+   free_TPM_KEY_PARMS(&k->algorithmParms);
+   free_TPM_STORE_PUBKEY(&k->pubKey);
+}
+
+typedef struct TPM_PCR_SELECTION {
+   UINT16 sizeOfSelect;
+   BYTE* pcrSelect;
+} TPM_PCR_SELECTION;
+
+#define TPM_PCR_SELECTION_INIT { 0, NULL }
+
+inline void free_TPM_PCR_SELECTION(TPM_PCR_SELECTION* p) {
+   free(p->pcrSelect);
+   p->pcrSelect = NULL;
+}
+
+typedef struct TPM_PCR_INFO {
+   TPM_PCR_SELECTION pcrSelection;
+   TPM_COMPOSITE_HASH digestAtRelease;
+   TPM_COMPOSITE_HASH digestAtCreation;
+} TPM_PCR_INFO;
+
+#define TPM_PCR_INFO_INIT { TPM_PCR_SELECTION_INIT }
+
+inline void free_TPM_PCR_INFO(TPM_PCR_INFO* p) {
+   free_TPM_PCR_SELECTION(&p->pcrSelection);
+}
+
+typedef struct TPM_PCR_COMPOSITE {
+  TPM_PCR_SELECTION select;
+  UINT32 valueSize;
+  TPM_PCRVALUE* pcrValue;
+} TPM_PCR_COMPOSITE;
+
+#define TPM_PCR_COMPOSITE_INIT { TPM_PCR_SELECTION_INIT, 0, NULL }
+
+inline void free_TPM_PCR_COMPOSITE(TPM_PCR_COMPOSITE* p) {
+   free_TPM_PCR_SELECTION(&p->select);
+   free(p->pcrValue);
+   p->pcrValue = NULL;
+}
+
+typedef struct TPM_KEY {
+  TPM_VERSION         ver;
+  TPM_KEY_USAGE       keyUsage;
+  TPM_KEY_FLAGS       keyFlags;
+  TPM_AUTH_DATA_USAGE authDataUsage;
+  TPM_KEY_PARMS       algorithmParms;
+  UINT32              PCRInfoSize;
+  TPM_PCR_INFO        PCRInfo;
+  TPM_STORE_PUBKEY    pubKey;
+  UINT32              encDataSize;
+  BYTE*               encData;
+} TPM_KEY;
+
+#define TPM_KEY_INIT { .algorithmParms = TPM_KEY_PARMS_INIT,\
+   .PCRInfoSize = 0, .PCRInfo = TPM_PCR_INFO_INIT, \
+   .pubKey = TPM_STORE_PUBKEY_INIT, \
+   .encDataSize = 0, .encData = NULL }
+
+inline void free_TPM_KEY(TPM_KEY* k) {
+   if(k->PCRInfoSize) {
+      free_TPM_PCR_INFO(&k->PCRInfo);
+   }
+   free_TPM_STORE_PUBKEY(&k->pubKey);
+   free(k->encData);
+   k->encData = NULL;
+}
+
+typedef struct TPM_BOUND_DATA {
+  TPM_VERSION ver;
+  TPM_PAYLOAD_TYPE payload;
+  BYTE* payloadData;
+} TPM_BOUND_DATA;
+
+#define TPM_BOUND_DATA_INIT { .payloadData = NULL }
+
+inline void free_TPM_BOUND_DATA(TPM_BOUND_DATA* d) {
+   free(d->payloadData);
+   d->payloadData = NULL;
+}
+
+typedef struct TPM_STORED_DATA {
+  TPM_VERSION ver;
+  UINT32 sealInfoSize;
+  TPM_PCR_INFO sealInfo;
+  UINT32 encDataSize;
+  BYTE* encData;
+} TPM_STORED_DATA;
+
+#define TPM_STORED_DATA_INIT { .sealInfoSize = 0, sealInfo = TPM_PCR_INFO_INIT,\
+   .encDataSize = 0, .encData = NULL }
+
+inline void free_TPM_STORED_DATA(TPM_STORED_DATA* d) {
+   if(d->sealInfoSize) {
+      free_TPM_PCR_INFO(&d->sealInfo);
+   }
+   free(d->encData);
+   d->encData = NULL;
+}
+
+typedef struct TPM_AUTH_SESSION {
+  TPM_AUTHHANDLE  AuthHandle;
+  TPM_NONCE   NonceOdd;   // system
+  TPM_NONCE   NonceEven;   // TPM
+  BOOL   fContinueAuthSession;
+  TPM_AUTHDATA  HMAC;
+} TPM_AUTH_SESSION;
+
+#define TPM_AUTH_SESSION_INIT { .AuthHandle = 0, .fContinueAuthSession = FALSE }
+
+// ---------------------- Functions for checking TPM_RESULTs -----------------
+
+#include <stdio.h>
+
+// FIXME: Review use of these and delete unneeded ones.
+
+// these are really badly dependent on local structure:
+// DEPENDS: local var 'status' of type TPM_RESULT
+// DEPENDS: label 'abort_egress' which cleans up and returns the status
+#define ERRORDIE(s) do { status = s; \
+                         fprintf (stderr, "*** ERRORDIE in %s at %s: %i\n", __func__, __FILE__, __LINE__); \
+                         goto abort_egress; } \
+                    while (0)
+
+// DEPENDS: local var 'status' of type TPM_RESULT
+// DEPENDS: label 'abort_egress' which cleans up and returns the status
+// Try command c. If it fails, set status to s and goto abort.
+#define TPMTRY(s,c) if (c != TPM_SUCCESS) { \
+                       status = s; \
+                       printf("ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
+                       goto abort_egress; \
+                    } else {\
+                       status = c; \
+                    }
+
+// Try command c. If it fails, print error message, set status to actual return code. Goto abort
+#define TPMTRYRETURN(c) do { status = c; \
+                             if (status != TPM_SUCCESS) { \
+                               fprintf(stderr, "ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
+                               goto abort_egress; \
+                             } \
+                        } while(0)
+
+
+#endif //__TCPA_H__
diff --git a/stubdom/vtpmmgr/tpm.c b/stubdom/vtpmmgr/tpm.c
new file mode 100644
index 0000000..123a27c
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm.c
@@ -0,0 +1,938 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <malloc.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <polarssl/sha1.h>
+
+#include "tcg.h"
+#include "tpm.h"
+#include "log.h"
+#include "marshal.h"
+#include "tpmrsa.h"
+#include "vtpmmgr.h"
+
+#define TCPA_MAX_BUFFER_LENGTH 0x2000
+
+#define TPM_BEGIN(TAG, ORD) \
+   const TPM_TAG intag = TAG;\
+TPM_TAG tag = intag;\
+UINT32 paramSize;\
+const TPM_COMMAND_CODE ordinal = ORD;\
+TPM_RESULT status = TPM_SUCCESS;\
+BYTE in_buf[TCPA_MAX_BUFFER_LENGTH];\
+BYTE out_buf[TCPA_MAX_BUFFER_LENGTH];\
+UINT32 out_len = sizeof(out_buf);\
+BYTE* ptr = in_buf;\
+/*Print a log message */\
+vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);\
+/* Pack the header*/\
+ptr = pack_TPM_TAG(ptr, tag);\
+ptr += sizeof(UINT32);\
+ptr = pack_TPM_COMMAND_CODE(ptr, ordinal)\
+
+#define TPM_AUTH_BEGIN() \
+   sha1_context sha1_ctx;\
+BYTE* authbase = ptr - sizeof(TPM_COMMAND_CODE);\
+TPM_DIGEST paramDigest;\
+sha1_starts(&sha1_ctx)
+
+#define TPM_AUTH1_GEN(HMACkey, auth) do {\
+   sha1_finish(&sha1_ctx, paramDigest.digest);\
+   generateAuth(&paramDigest, HMACkey, auth);\
+   ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_AUTH2_GEN(HMACkey, auth) do {\
+   generateAuth(&paramDigest, HMACkey, auth);\
+   ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_TRANSMIT() do {\
+   /* Pack the command size */\
+   paramSize = ptr - in_buf;\
+   pack_UINT32(in_buf + sizeof(TPM_TAG), paramSize);\
+   if((status = TPM_TransmitData(in_buf, paramSize, out_buf, &out_len)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH_VERIFY_BEGIN() do {\
+   UINT32 buf[2] = { cpu_to_be32(status), cpu_to_be32(ordinal) };\
+   sha1_starts(&sha1_ctx);\
+   sha1_update(&sha1_ctx, (unsigned char*)buf, sizeof(buf));\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH1_VERIFY(HMACkey, auth) do {\
+   sha1_finish(&sha1_ctx, paramDigest.digest);\
+   ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+   if((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH2_VERIFY(HMACkey, auth) do {\
+   ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+   if((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+
+
+#define TPM_UNPACK_VERIFY() do { \
+   ptr = out_buf;\
+   ptr = unpack_TPM_RSP_HEADER(ptr, \
+         &(tag), &(paramSize), &(status));\
+   if((status) != TPM_SUCCESS || (tag) != (intag +3)) { \
+      vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s\n", tpm_get_error_name(status));\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH_HASH() do {\
+   sha1_update(&sha1_ctx, authbase, ptr - authbase);\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH_SKIP() do {\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH_ERR_CHECK(auth) do {\
+   if(status != TPM_SUCCESS || auth->fContinueAuthSession == FALSE) {\
+      vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM\n", auth->AuthHandle);\
+      auth->AuthHandle = 0;\
+   }\
+} while(0)
+
+static void xorEncrypt(const TPM_SECRET* sharedSecret,
+      TPM_NONCE* nonce,
+      const TPM_AUTHDATA* inAuth0,
+      TPM_ENCAUTH outAuth0,
+      const TPM_AUTHDATA* inAuth1,
+      TPM_ENCAUTH outAuth1) {
+   BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
+   BYTE XORkey[TPM_DIGEST_SIZE];
+   BYTE* ptr = XORbuffer;
+   ptr = pack_TPM_SECRET(ptr, sharedSecret);
+   ptr = pack_TPM_NONCE(ptr, nonce);
+
+   sha1(XORbuffer, ptr - XORbuffer, XORkey);
+
+   if(inAuth0) {
+      for(int i = 0; i < TPM_DIGEST_SIZE; ++i) {
+         outAuth0[i] = XORkey[i] ^ (*inAuth0)[i];
+      }
+   }
+   if(inAuth1) {
+      for(int i = 0; i < TPM_DIGEST_SIZE; ++i) {
+         outAuth1[i] = XORkey[i] ^ (*inAuth1)[i];
+      }
+   }
+
+}
+
+static void generateAuth(const TPM_DIGEST* paramDigest,
+      const TPM_SECRET* HMACkey,
+      TPM_AUTH_SESSION *auth)
+{
+   //Generate new OddNonce
+   vtpmmgr_rand((BYTE*)auth->NonceOdd.nonce, sizeof(TPM_NONCE));
+
+   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
+   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
+   BYTE* ptr = hmacText;
+
+   ptr = pack_TPM_DIGEST(ptr, paramDigest);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+
+   sha1_hmac((BYTE *) HMACkey, sizeof(TPM_DIGEST),
+         (BYTE *) hmacText, sizeof(hmacText),
+         auth->HMAC);
+}
+
+static TPM_RESULT verifyAuth(const TPM_DIGEST* paramDigest,
+      /*[IN]*/ const TPM_SECRET *HMACkey,
+      /*[IN,OUT]*/ TPM_AUTH_SESSION *auth)
+{
+
+   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
+   TPM_AUTHDATA hm;
+   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
+   BYTE* ptr = hmacText;
+
+   ptr = pack_TPM_DIGEST(ptr, paramDigest);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+
+   sha1_hmac( (BYTE *) HMACkey, sizeof(TPM_DIGEST),
+         (BYTE *) hmacText, sizeof(hmacText),
+         hm);
+
+   // Compare correct HMAC with provided one.
+   if (memcmp(hm, auth->HMAC, sizeof(TPM_DIGEST)) == 0) { // 0 indicates equality
+      return TPM_SUCCESS;
+   } else {
+      vtpmlogerror(VTPM_LOG_TPM, "Auth Session verification failed!\n");
+      return TPM_AUTHFAIL;
+   }
+}
+
+
+
+// ------------------------------------------------------------------
+// Authorization Commands
+// ------------------------------------------------------------------
+
+TPM_RESULT TPM_OIAP(TPM_AUTH_SESSION*   auth)  // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OIAP);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
+   auth->fContinueAuthSession = TRUE;
+
+   ptr = unpack_UINT32(ptr, &auth->AuthHandle);
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OIAP.\n", auth->AuthHandle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_OSAP(TPM_ENTITY_TYPE  entityType,  // in
+      UINT32    entityValue, // in
+      const TPM_AUTHDATA* usageAuth, //in
+      TPM_SECRET *sharedSecret, //out
+      TPM_AUTH_SESSION *auth)
+{
+   BYTE* nonceOddOSAP;
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OSAP);
+
+   ptr = pack_TPM_ENTITY_TYPE(ptr, entityType);
+   ptr = pack_UINT32(ptr, entityValue);
+
+   //nonce Odd OSAP
+   nonceOddOSAP = ptr;
+   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
+   ptr += TPM_DIGEST_SIZE;
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, &auth->AuthHandle);
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+
+   //Calculate session secret
+   sha1_context ctx;
+   sha1_hmac_starts(&ctx, *usageAuth, TPM_DIGEST_SIZE);
+   sha1_hmac_update(&ctx, ptr, TPM_DIGEST_SIZE); //ptr = nonceEvenOSAP
+   sha1_hmac_update(&ctx, nonceOddOSAP, TPM_DIGEST_SIZE);
+   sha1_hmac_finish(&ctx, *sharedSecret);
+
+   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
+   auth->fContinueAuthSession = FALSE;
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OSAP.\n", auth->AuthHandle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_TakeOwnership(
+      const TPM_PUBKEY *pubEK, //in
+      const TPM_AUTHDATA* ownerAuth, //in
+      const TPM_AUTHDATA* srkAuth, //in
+      const TPM_KEY* inSrk, //in
+      TPM_KEY* outSrk, //out, optional
+      TPM_AUTH_SESSION*   auth)   // in, out
+{
+   int keyAlloced = 0;
+   tpmrsa_context ek_rsa = TPMRSA_CTX_INIT;
+
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_TakeOwnership);
+   TPM_AUTH_BEGIN();
+
+   tpmrsa_set_pubkey(&ek_rsa,
+         pubEK->pubKey.key, pubEK->pubKey.keyLength,
+         pubEK->algorithmParms.parms.rsa.exponent,
+         pubEK->algorithmParms.parms.rsa.exponentSize);
+
+   /* Pack the protocol ID */
+   ptr = pack_UINT16(ptr, TPM_PID_OWNER);
+
+   /* Pack the encrypted owner auth */
+   ptr = pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength / 8);
+   tpmrsa_pub_encrypt_oaep(&ek_rsa,
+         ctr_drbg_random, &vtpm_globals.ctr_drbg,
+         sizeof(TPM_SECRET),
+         (BYTE*) ownerAuth,
+         ptr);
+   ptr += pubEK->algorithmParms.parms.rsa.keyLength / 8;
+
+   /* Pack the encrypted srk auth */
+   ptr = pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength / 8);
+   tpmrsa_pub_encrypt_oaep(&ek_rsa,
+         ctr_drbg_random, &vtpm_globals.ctr_drbg,
+         sizeof(TPM_SECRET),
+         (BYTE*) srkAuth,
+         ptr);
+   ptr += pubEK->algorithmParms.parms.rsa.keyLength / 8;
+
+   /* Pack the Srk key */
+   ptr = pack_TPM_KEY(ptr, inSrk);
+
+   /* Hash everything up to here */
+   TPM_AUTH_HASH();
+
+   /* Generate the authorization */
+   TPM_AUTH1_GEN(ownerAuth, auth);
+
+   /* Send the command to the tpm*/
+   TPM_TRANSMIT();
+   /* Unpack and validate the header */
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   if(outSrk != NULL) {
+      /* If the user wants a copy of the srk we give it to them */
+      keyAlloced = 1;
+      ptr = unpack_TPM_KEY(ptr, outSrk, UNPACK_ALLOC);
+   } else {
+      /*otherwise just parse past it */
+      TPM_KEY temp;
+      ptr = unpack_TPM_KEY(ptr, &temp, UNPACK_ALIAS);
+   }
+
+   /* Hash the output key */
+   TPM_AUTH_HASH();
+
+   /* Verify authorizaton */
+   TPM_AUTH1_VERIFY(ownerAuth, auth);
+
+   goto egress;
+abort_egress:
+   if(keyAlloced) {
+      free_TPM_KEY(outSrk);
+   }
+egress:
+   tpmrsa_free(&ek_rsa);
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+
+TPM_RESULT TPM_DisablePubekRead (
+      const TPM_AUTHDATA* ownerAuth,
+      TPM_AUTH_SESSION*   auth)
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_DisablePubekRead);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(ownerAuth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   TPM_AUTH1_VERIFY(ownerAuth, auth);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+
+TPM_RESULT TPM_TerminateHandle(TPM_AUTHHANDLE  handle)  // in
+{
+   if(handle == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Terminate_Handle);
+
+   ptr = pack_TPM_AUTHHANDLE(ptr, handle);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM_TerminateHandle\n", handle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_Extend( TPM_PCRINDEX  pcrNum,  // in
+      TPM_DIGEST  inDigest, // in
+      TPM_PCRVALUE*  outDigest) // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Extend);
+
+   ptr = pack_TPM_PCRINDEX(ptr, pcrNum);
+   ptr = pack_TPM_DIGEST(ptr, &inDigest);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_TPM_PCRVALUE(ptr, outDigest);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_Seal(
+      TPM_KEY_HANDLE  keyHandle,  // in
+      UINT32    pcrInfoSize, // in
+      TPM_PCR_INFO*    pcrInfo,  // in
+      UINT32    inDataSize,  // in
+      const BYTE*    inData,   // in
+      TPM_STORED_DATA* sealedData, //out
+      const TPM_SECRET* osapSharedSecret, //in
+      const TPM_AUTHDATA* sealedDataAuth, //in
+      TPM_AUTH_SESSION*   pubAuth  // in, out
+      )
+{
+   int dataAlloced = 0;
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_Seal);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, keyHandle);
+
+   TPM_AUTH_SKIP();
+
+   xorEncrypt(osapSharedSecret, &pubAuth->NonceEven,
+         sealedDataAuth, ptr,
+         NULL, NULL);
+   ptr += sizeof(TPM_ENCAUTH);
+
+   ptr = pack_UINT32(ptr, pcrInfoSize);
+   ptr = pack_TPM_PCR_INFO(ptr, pcrInfo);
+
+   ptr = pack_UINT32(ptr, inDataSize);
+   ptr = pack_BUFFER(ptr, inData, inDataSize);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(osapSharedSecret, pubAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_TPM_STORED_DATA(ptr, sealedData, UNPACK_ALLOC);
+   dataAlloced = 1;
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(osapSharedSecret, pubAuth);
+
+   goto egress;
+abort_egress:
+   if(dataAlloced) {
+      free_TPM_STORED_DATA(sealedData);
+   }
+egress:
+   TPM_AUTH_ERR_CHECK(pubAuth);
+   return status;
+}
+
+TPM_RESULT TPM_Unseal(
+      TPM_KEY_HANDLE parentHandle, // in
+      const TPM_STORED_DATA* sealedData,
+      UINT32*   outSize,  // out
+      BYTE**    out, //out
+      const TPM_AUTHDATA* key_usage_auth, //in
+      const TPM_AUTHDATA* data_usage_auth, //in
+      TPM_AUTH_SESSION*   keyAuth,  // in, out
+      TPM_AUTH_SESSION*   dataAuth  // in, out
+      )
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH2_COMMAND, TPM_ORD_Unseal);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, parentHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_TPM_STORED_DATA(ptr, sealedData);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(key_usage_auth, keyAuth);
+   TPM_AUTH2_GEN(data_usage_auth, dataAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, outSize);
+   ptr = unpack_ALLOC(ptr, out, *outSize);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(key_usage_auth, keyAuth);
+   TPM_AUTH2_VERIFY(data_usage_auth, dataAuth);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(keyAuth);
+   TPM_AUTH_ERR_CHECK(dataAuth);
+   return status;
+}
+
+TPM_RESULT TPM_Bind(
+      const TPM_KEY* key,
+      const BYTE* in,
+      UINT32 ilen,
+      BYTE* out)
+{
+   TPM_RESULT status;
+   tpmrsa_context rsa = TPMRSA_CTX_INIT;
+   TPM_BOUND_DATA boundData;
+   uint8_t plain[TCPA_MAX_BUFFER_LENGTH];
+   BYTE* ptr = plain;
+
+   vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);
+
+   tpmrsa_set_pubkey(&rsa,
+         key->pubKey.key, key->pubKey.keyLength,
+         key->algorithmParms.parms.rsa.exponent,
+         key->algorithmParms.parms.rsa.exponentSize);
+
+   // Fill boundData's accessory information
+   boundData.ver = TPM_STRUCT_VER_1_1;
+   boundData.payload = TPM_PT_BIND;
+   boundData.payloadData = (BYTE*)in;
+
+   //marshall the bound data object
+   ptr = pack_TPM_BOUND_DATA(ptr, &boundData, ilen);
+
+   // Encrypt the data
+   TPMTRYRETURN(tpmrsa_pub_encrypt_oaep(&rsa,
+            ctr_drbg_random, &vtpm_globals.ctr_drbg,
+            ptr - plain,
+            plain,
+            out));
+
+abort_egress:
+   tpmrsa_free(&rsa);
+   return status;
+
+}
+
+TPM_RESULT TPM_UnBind(
+      TPM_KEY_HANDLE  keyHandle,  // in
+      UINT32 ilen, //in
+      const BYTE* in, //
+      UINT32* olen, //
+      BYTE*    out, //out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth //in, out
+      )
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_UnBind);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, keyHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_UINT32(ptr, ilen);
+   ptr = pack_BUFFER(ptr, in, ilen);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(usage_auth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, olen);
+   if(*olen > ilen) {
+      vtpmlogerror(VTPM_LOG_TPM, "Output length < input length!\n");
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+   ptr = unpack_BUFFER(ptr, out, *olen);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(usage_auth, auth);
+
+abort_egress:
+egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+TPM_RESULT TPM_CreateWrapKey(
+      TPM_KEY_HANDLE  hWrappingKey,  // in
+      const TPM_AUTHDATA* osapSharedSecret,
+      const TPM_AUTHDATA* dataUsageAuth, //in
+      const TPM_AUTHDATA* dataMigrationAuth, //in
+      TPM_KEY*     key, //in, out
+      TPM_AUTH_SESSION*   pAuth)    // in, out
+{
+   int keyAlloced = 0;
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_CreateWrapKey);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, hWrappingKey);
+
+   TPM_AUTH_SKIP();
+
+   //Encrypted auths
+   xorEncrypt(osapSharedSecret, &pAuth->NonceEven,
+         dataUsageAuth, ptr,
+         dataMigrationAuth, ptr + sizeof(TPM_ENCAUTH));
+   ptr += sizeof(TPM_ENCAUTH) * 2;
+
+   ptr = pack_TPM_KEY(ptr, key);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(osapSharedSecret, pAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   keyAlloced = 1;
+   ptr = unpack_TPM_KEY(ptr, key, UNPACK_ALLOC);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(osapSharedSecret, pAuth);
+
+   goto egress;
+abort_egress:
+   if(keyAlloced) {
+      free_TPM_KEY(key);
+   }
+egress:
+   TPM_AUTH_ERR_CHECK(pAuth);
+   return status;
+}
+
+TPM_RESULT TPM_LoadKey(
+      TPM_KEY_HANDLE  parentHandle, //
+      const TPM_KEY* key, //in
+      TPM_HANDLE*  keyHandle,    // out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth)
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_LoadKey);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, parentHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_TPM_KEY(ptr, key);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(usage_auth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, keyHandle);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(usage_auth, auth);
+
+   vtpmloginfo(VTPM_LOG_TPM, "Key Handle: 0x%x opened by TPM_LoadKey\n", *keyHandle);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+TPM_RESULT TPM_EvictKey( TPM_KEY_HANDLE  hKey)  // in
+{
+   if(hKey == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_EvictKey);
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, hKey);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   vtpmloginfo(VTPM_LOG_TPM, "Key handle: 0x%x closed by TPM_EvictKey\n", hKey);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle,
+      TPM_RESOURCE_TYPE rt) {
+   if(handle == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_FlushSpecific);
+
+   ptr = pack_TPM_HANDLE(ptr, handle);
+   ptr = pack_TPM_RESOURCE_TYPE(ptr, rt);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_GetRandom( UINT32*    bytesRequested, // in, out
+      BYTE*    randomBytes) // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetRandom);
+
+   // check input params
+   if (bytesRequested == NULL || randomBytes == NULL){
+      return TPM_BAD_PARAMETER;
+   }
+
+   ptr = pack_UINT32(ptr, *bytesRequested);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, bytesRequested);
+   ptr = unpack_BUFFER(ptr, randomBytes, *bytesRequested);
+
+abort_egress:
+   return status;
+}
+
+
+TPM_RESULT TPM_ReadPubek(
+      TPM_PUBKEY* pubEK //out
+      )
+{
+   BYTE* antiReplay = NULL;
+   BYTE* kptr = NULL;
+   BYTE digest[TPM_DIGEST_SIZE];
+   sha1_context ctx;
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_ReadPubek);
+
+   //antiReplay nonce
+   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
+   antiReplay = ptr;
+   ptr += TPM_DIGEST_SIZE;
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   //unpack and allocate the key
+   kptr = ptr;
+   ptr = unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
+
+   //Verify the checksum
+   sha1_starts(&ctx);
+   sha1_update(&ctx, kptr, ptr - kptr);
+   sha1_update(&ctx, antiReplay, TPM_DIGEST_SIZE);
+   sha1_finish(&ctx, digest);
+
+   //ptr points to the checksum computed by TPM
+   if(memcmp(digest, ptr, TPM_DIGEST_SIZE)) {
+      vtpmlogerror(VTPM_LOG_TPM, "TPM_ReadPubek: Checksum returned by TPM was invalid!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   goto egress;
+abort_egress:
+   if(kptr != NULL) { //If we unpacked the pubEK, we have to free it
+      free_TPM_PUBKEY(pubEK);
+   }
+egress:
+   return status;
+}
+
+
+TPM_RESULT TPM_SaveState(void)
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_SaveState);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_GetCapability(
+      TPM_CAPABILITY_AREA capArea,
+      UINT32 subCapSize,
+      const BYTE* subCap,
+      UINT32* respSize,
+      BYTE** resp)
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetCapability);
+
+   ptr = pack_TPM_CAPABILITY_AREA(ptr, capArea);
+   ptr = pack_UINT32(ptr, subCapSize);
+   ptr = pack_BUFFER(ptr, subCap, subCapSize);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, respSize);
+   ptr = unpack_ALLOC(ptr, resp, *respSize);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_CreateEndorsementKeyPair(
+      const TPM_KEY_PARMS* keyInfo,
+      TPM_PUBKEY* pubEK)
+{
+   BYTE* kptr = NULL;
+   sha1_context ctx;
+   TPM_DIGEST checksum;
+   TPM_DIGEST hash;
+   TPM_NONCE antiReplay;
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_CreateEndorsementKeyPair);
+
+   //Make anti replay nonce
+   vtpmmgr_rand(antiReplay.nonce, sizeof(antiReplay.nonce));
+
+   ptr = pack_TPM_NONCE(ptr, &antiReplay);
+   ptr = pack_TPM_KEY_PARMS(ptr, keyInfo);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   sha1_starts(&ctx);
+
+   kptr = ptr;
+   ptr = unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
+
+   /* Hash the pub key blob */
+   sha1_update(&ctx, kptr, ptr - kptr);
+   ptr = unpack_TPM_DIGEST(ptr, &checksum);
+
+   sha1_update(&ctx, antiReplay.nonce, sizeof(antiReplay.nonce));
+
+   sha1_finish(&ctx, hash.digest);
+   if(memcmp(checksum.digest, hash.digest, TPM_DIGEST_SIZE)) {
+      vtpmloginfo(VTPM_LOG_VTPM, "TPM_CreateEndorsementKey: Checkum verification failed!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   goto egress;
+abort_egress:
+   if(kptr) {
+      free_TPM_PUBKEY(pubEK);
+   }
+egress:
+   return status;
+}
+
+TPM_RESULT TPM_TransmitData(
+      BYTE* in,
+      UINT32 insize,
+      BYTE* out,
+      UINT32* outsize) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   UINT32 i;
+   vtpmloginfo(VTPM_LOG_TXDATA, "Sending buffer = 0x");
+   for(i = 0 ; i < insize ; i++)
+      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", in[i]);
+
+   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
+
+   ssize_t size = 0;
+
+   // send the request
+   size = write (vtpm_globals.tpm_fd, in, insize);
+   if (size < 0) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "write() failed : %s\n", strerror(errno));
+      ERRORDIE (TPM_IOERROR);
+   }
+   else if ((UINT32) size < insize) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "Wrote %d instead of %d bytes!\n", (int) size, insize);
+      ERRORDIE (TPM_IOERROR);
+   }
+
+   // read the response
+   size = read (vtpm_globals.tpm_fd, out, *outsize);
+   if (size < 0) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "read() failed : %s\n", strerror(errno));
+      ERRORDIE (TPM_IOERROR);
+   }
+
+   vtpmloginfo(VTPM_LOG_TXDATA, "Receiving buffer = 0x");
+   for(i = 0 ; i < size ; i++)
+      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out[i]);
+
+   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
+
+   *outsize = size;
+   goto egress;
+
+abort_egress:
+egress:
+   return status;
+}
diff --git a/stubdom/vtpmmgr/tpm.h b/stubdom/vtpmmgr/tpm.h
new file mode 100644
index 0000000..304e145
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm.h
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005/2006, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __TPM_H__
+#define __TPM_H__
+
+#include "tcg.h"
+
+// ------------------------------------------------------------------
+// Exposed API
+// ------------------------------------------------------------------
+
+// TPM v1.1B Command Set
+
+// Authorzation
+TPM_RESULT TPM_OIAP(
+      TPM_AUTH_SESSION*   auth //out
+      );
+
+TPM_RESULT TPM_OSAP (
+      TPM_ENTITY_TYPE entityType,  // in
+      UINT32    entityValue, // in
+      const TPM_AUTHDATA* usageAuth, //in
+      TPM_SECRET *sharedSecret, //out
+      TPM_AUTH_SESSION *auth);
+
+TPM_RESULT TPM_TakeOwnership(
+      const TPM_PUBKEY *pubEK, //in
+      const TPM_AUTHDATA* ownerAuth, //in
+      const TPM_AUTHDATA* srkAuth, //in
+      const TPM_KEY* inSrk, //in
+      TPM_KEY* outSrk, //out, optional
+      TPM_AUTH_SESSION*   auth   // in, out
+      );
+
+TPM_RESULT TPM_DisablePubekRead (
+      const TPM_AUTHDATA* ownerAuth,
+      TPM_AUTH_SESSION*   auth
+      );
+
+TPM_RESULT TPM_TerminateHandle ( TPM_AUTHHANDLE  handle  // in
+      );
+
+TPM_RESULT TPM_FlushSpecific ( TPM_HANDLE  handle,  // in
+      TPM_RESOURCE_TYPE resourceType //in
+      );
+
+// TPM Mandatory
+TPM_RESULT TPM_Extend ( TPM_PCRINDEX  pcrNum,  // in
+      TPM_DIGEST   inDigest, // in
+      TPM_PCRVALUE*   outDigest // out
+      );
+
+TPM_RESULT TPM_PcrRead ( TPM_PCRINDEX  pcrNum,  // in
+      TPM_PCRVALUE*  outDigest // out
+      );
+
+TPM_RESULT TPM_Quote ( TCS_KEY_HANDLE  keyHandle,  // in
+      TPM_NONCE   antiReplay,  // in
+      UINT32*    PcrDataSize, // in, out
+      BYTE**    PcrData,  // in, out
+      TPM_AUTH_SESSION*   privAuth,  // in, out
+      UINT32*    sigSize,  // out
+      BYTE**    sig    // out
+      );
+
+TPM_RESULT TPM_Seal(
+      TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32    pcrInfoSize, // in
+      TPM_PCR_INFO*    pcrInfo,  // in
+      UINT32    inDataSize,  // in
+      const BYTE*    inData,   // in
+      TPM_STORED_DATA* sealedData, //out
+      const TPM_SECRET* osapSharedSecret, //in
+      const TPM_AUTHDATA* sealDataAuth, //in
+      TPM_AUTH_SESSION*   pubAuth  // in, out
+      );
+
+TPM_RESULT TPM_Unseal (
+      TPM_KEY_HANDLE parentHandle, // in
+      const TPM_STORED_DATA* sealedData,
+      UINT32*   outSize,  // out
+      BYTE**    out, //out
+      const TPM_AUTHDATA* key_usage_auth, //in
+      const TPM_AUTHDATA* data_usage_auth, //in
+      TPM_AUTH_SESSION*   keyAuth,  // in, out
+      TPM_AUTH_SESSION*   dataAuth  // in, out
+      );
+
+TPM_RESULT TPM_DirWriteAuth ( TPM_DIRINDEX  dirIndex,  // in
+      TPM_DIRVALUE  newContents, // in
+      TPM_AUTH_SESSION*   ownerAuth  // in, out
+      );
+
+TPM_RESULT TPM_DirRead ( TPM_DIRINDEX  dirIndex, // in
+      TPM_DIRVALUE*  dirValue // out
+      );
+
+TPM_RESULT TPM_Bind(
+      const TPM_KEY* key, //in
+      const BYTE* in, //in
+      UINT32 ilen, //in
+      BYTE* out //out, must be at least cipher block size
+      );
+
+TPM_RESULT TPM_UnBind (
+      TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32 ilen, //in
+      const BYTE* in, //
+      UINT32*   outDataSize, // out
+      BYTE*    outData, //out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth //in, out
+      );
+
+TPM_RESULT TPM_CreateWrapKey (
+      TCS_KEY_HANDLE  hWrappingKey,  // in
+      const TPM_AUTHDATA* osapSharedSecret,
+      const TPM_AUTHDATA* dataUsageAuth, //in
+      const TPM_AUTHDATA* dataMigrationAuth, //in
+      TPM_KEY*     key, //in
+      TPM_AUTH_SESSION*   pAuth    // in, out
+      );
+
+TPM_RESULT TPM_LoadKey (
+      TPM_KEY_HANDLE  parentHandle, //
+      const TPM_KEY* key, //in
+      TPM_HANDLE*  keyHandle,    // out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth
+      );
+
+TPM_RESULT TPM_GetPubKey (  TCS_KEY_HANDLE  hKey,   // in
+      TPM_AUTH_SESSION*   pAuth,   // in, out
+      UINT32*    pcPubKeySize, // out
+      BYTE**    prgbPubKey  // out
+      );
+
+TPM_RESULT TPM_EvictKey ( TCS_KEY_HANDLE  hKey  // in
+      );
+
+TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle, //in
+      TPM_RESOURCE_TYPE rt //in
+      );
+
+TPM_RESULT TPM_Sign ( TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32    areaToSignSize, // in
+      BYTE*    areaToSign,  // in
+      TPM_AUTH_SESSION*   privAuth,  // in, out
+      UINT32*    sigSize,  // out
+      BYTE**    sig    // out
+      );
+
+TPM_RESULT TPM_GetRandom (  UINT32*    bytesRequested, // in, out
+      BYTE*    randomBytes  // out
+      );
+
+TPM_RESULT TPM_StirRandom (  UINT32    inDataSize, // in
+      BYTE*    inData  // in
+      );
+
+TPM_RESULT TPM_ReadPubek (
+      TPM_PUBKEY* pubEK //out
+      );
+
+TPM_RESULT TPM_GetCapability(
+      TPM_CAPABILITY_AREA capArea,
+      UINT32 subCapSize,
+      const BYTE* subCap,
+      UINT32* respSize,
+      BYTE** resp);
+
+TPM_RESULT TPM_SaveState(void);
+
+TPM_RESULT TPM_CreateEndorsementKeyPair(
+      const TPM_KEY_PARMS* keyInfo,
+      TPM_PUBKEY* pubEK);
+
+TPM_RESULT TPM_TransmitData(
+      BYTE* in,
+      UINT32 insize,
+      BYTE* out,
+      UINT32* outsize);
+
+#endif //TPM_H
diff --git a/stubdom/vtpmmgr/tpmrsa.c b/stubdom/vtpmmgr/tpmrsa.c
new file mode 100644
index 0000000..56094e7
--- /dev/null
+++ b/stubdom/vtpmmgr/tpmrsa.c
@@ -0,0 +1,175 @@
+/*
+ *  The RSA public-key cryptosystem
+ *
+ *  Copyright (C) 2006-2011, Brainspark B.V.
+ *
+ *  This file is part of PolarSSL (http://www.polarssl.org)
+ *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
+ *
+ *  All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ *  RSA was designed by Ron Rivest, Adi Shamir and Len Adleman.
+ *
+ *  http://theory.lcs.mit.edu/~rivest/rsapaper.pdf
+ *  http://www.cacr.math.uwaterloo.ca/hac/about/chap8.pdf
+ */
+
+#include "tcg.h"
+#include "polarssl/sha1.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "tpmrsa.h"
+
+#define HASH_LEN 20
+
+void tpmrsa_set_pubkey(tpmrsa_context* ctx,
+      const unsigned char* key,
+      int keylen,
+      const unsigned char* exponent,
+      int explen) {
+
+   tpmrsa_free(ctx);
+
+   if(explen == 0) { //Default e= 2^16+1
+      mpi_lset(&ctx->E, 65537);
+   } else {
+      mpi_read_binary(&ctx->E, exponent, explen);
+   }
+   mpi_read_binary(&ctx->N, key, keylen);
+
+   ctx->len = ( mpi_msb(&ctx->N) + 7) >> 3;
+}
+
+static TPM_RESULT tpmrsa_public( tpmrsa_context *ctx,
+      const unsigned char *input,
+      unsigned char *output )
+{
+   int ret;
+   size_t olen;
+   mpi T;
+
+   mpi_init( &T );
+
+   MPI_CHK( mpi_read_binary( &T, input, ctx->len ) );
+
+   if( mpi_cmp_mpi( &T, &ctx->N ) >= 0 )
+   {
+      mpi_free( &T );
+      return TPM_ENCRYPT_ERROR;
+   }
+
+   olen = ctx->len;
+   MPI_CHK( mpi_exp_mod( &T, &T, &ctx->E, &ctx->N, &ctx->RN ) );
+   MPI_CHK( mpi_write_binary( &T, output, olen ) );
+
+cleanup:
+
+   mpi_free( &T );
+
+   if( ret != 0 )
+      return TPM_ENCRYPT_ERROR;
+
+   return TPM_SUCCESS;
+}
+
+static void mgf_mask( unsigned char *dst, int dlen, unsigned char *src, int slen)
+{
+   unsigned char mask[HASH_LEN];
+   unsigned char counter[4] = {0, 0, 0, 0};
+   int i;
+   sha1_context mctx;
+
+   //We always hash the src with the counter, so save the partial hash
+   sha1_starts(&mctx);
+   sha1_update(&mctx, src, slen);
+
+   // Generate and apply dbMask
+   while(dlen > 0) {
+      //Copy the sha1 context
+      sha1_context ctx = mctx;
+
+      //compute hash for input || counter
+      sha1_update(&ctx, counter, sizeof(counter));
+      sha1_finish(&ctx, mask);
+
+      //Apply the mask
+      for(i = 0; i < (dlen < HASH_LEN ? dlen : HASH_LEN); ++i) {
+         *(dst++) ^= mask[i];
+      }
+
+      //Increment counter
+      ++counter[3];
+
+      dlen -= HASH_LEN;
+   }
+}
+
+/*
+ * Add the message padding, then do an RSA operation
+ */
+TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
+      int (*f_rng)(void *, unsigned char *, size_t),
+      void *p_rng,
+      size_t ilen,
+      const unsigned char *input,
+      unsigned char *output )
+{
+   int ret;
+   int olen;
+   unsigned char* seed = output + 1;
+   unsigned char* db = output + HASH_LEN +1;
+
+   olen = ctx->len-1;
+
+   if( f_rng == NULL )
+      return TPM_ENCRYPT_ERROR;
+
+   if( ilen > olen - 2 * HASH_LEN - 1)
+      return TPM_ENCRYPT_ERROR;
+
+   output[0] = 0;
+
+   //Encoding parameter p
+   sha1((unsigned char*)"TCPA", 4, db);
+
+   //PS
+   memset(db + HASH_LEN, 0,
+         olen - ilen - 2 * HASH_LEN - 1);
+
+   //constant 1 byte
+   db[olen - ilen - HASH_LEN -1] = 0x01;
+
+   //input string
+   memcpy(db + olen - ilen - HASH_LEN,
+         input, ilen);
+
+   //Generate random seed
+   if( ( ret = f_rng( p_rng, seed, HASH_LEN ) ) != 0 )
+      return TPM_ENCRYPT_ERROR;
+
+   // maskedDB: Apply dbMask to DB
+   mgf_mask( db, olen - HASH_LEN, seed, HASH_LEN);
+
+   // maskedSeed: Apply seedMask to seed
+   mgf_mask( seed, HASH_LEN, db, olen - HASH_LEN);
+
+   // Do the crypto op
+   return tpmrsa_public(ctx, output, output);
+}
diff --git a/stubdom/vtpmmgr/tpmrsa.h b/stubdom/vtpmmgr/tpmrsa.h
new file mode 100644
index 0000000..59579e7
--- /dev/null
+++ b/stubdom/vtpmmgr/tpmrsa.h
@@ -0,0 +1,67 @@
+/**
+ * \file rsa.h
+ *
+ * \brief The RSA public-key cryptosystem
+ *
+ *  Copyright (C) 2006-2010, Brainspark B.V.
+ *
+ *  This file is part of PolarSSL (http://www.polarssl.org)
+ *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
+ *
+ *  All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef TPMRSA_H
+#define TPMRSA_H
+
+#include "tcg.h"
+#include <polarssl/bignum.h>
+
+/* tpm software key */
+typedef struct
+{
+    size_t len;                 /*!<  size(N) in chars  */
+
+    mpi N;                      /*!<  public modulus    */
+    mpi E;                      /*!<  public exponent   */
+
+    mpi RN;                     /*!<  cached R^2 mod N  */
+}
+tpmrsa_context;
+
+#define TPMRSA_CTX_INIT { 0, {0, 0, NULL}, {0, 0, NULL}, {0, 0, NULL}}
+
+/* Setup the rsa context using tpm public key data */
+void tpmrsa_set_pubkey(tpmrsa_context* ctx,
+      const unsigned char* key,
+      int keylen,
+      const unsigned char* exponent,
+      int explen);
+
+/* Do rsa public crypto */
+TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
+      int (*f_rng)(void *, unsigned char *, size_t),
+      void *p_rng,
+      size_t ilen,
+      const unsigned char *input,
+      unsigned char *output );
+
+/* free tpmrsa key */
+inline void tpmrsa_free( tpmrsa_context *ctx ) {
+   mpi_free( &ctx->RN ); mpi_free( &ctx->E  ); mpi_free( &ctx->N  );
+}
+
+#endif /* tpmrsa.h */
diff --git a/stubdom/vtpmmgr/uuid.h b/stubdom/vtpmmgr/uuid.h
new file mode 100644
index 0000000..4737645
--- /dev/null
+++ b/stubdom/vtpmmgr/uuid.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPMMGR_UUID_H
+#define VTPMMGR_UUID_H
+
+#define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
+#define UUID_FMTLEN ((2*16)+4) /* 16 hex bytes plus 4 hypens */
+#define UUID_BYTES(uuid) uuid[0], uuid[1], uuid[2], uuid[3], \
+                                uuid[4], uuid[5], uuid[6], uuid[7], \
+                                uuid[8], uuid[9], uuid[10], uuid[11], \
+                                uuid[12], uuid[13], uuid[14], uuid[15]
+
+
+typedef uint8_t uuid_t[16];
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_cmd_handler.c b/stubdom/vtpmmgr/vtpm_cmd_handler.c
new file mode 100644
index 0000000..f82a2a9
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_cmd_handler.c
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <inttypes.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "marshal.h"
+#include "log.h"
+#include "vtpm_storage.h"
+#include "vtpmmgr.h"
+#include "tpm.h"
+#include "tcg.h"
+
+static TPM_RESULT vtpmmgr_SaveHashKey(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+
+   if(tpmcmd->req_len != VTPM_COMMAND_HEADER_SIZE + HASHKEYSZ) {
+      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_ORD_SAVEHASHKEY hashkey too short!\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   /* Do the command */
+   TPMTRYRETURN(vtpm_storage_save_hashkey(uuid, tpmcmd->req + VTPM_COMMAND_HEADER_SIZE));
+
+abort_egress:
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         VTPM_TAG_RSP, VTPM_COMMAND_HEADER_SIZE, status);
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+
+   return status;
+}
+
+static TPM_RESULT vtpmmgr_LoadHashKey(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+
+   TPMTRYRETURN(vtpm_storage_load_hashkey(uuid, tpmcmd->resp + VTPM_COMMAND_HEADER_SIZE));
+
+   tpmcmd->resp_len += HASHKEYSZ;
+
+abort_egress:
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         VTPM_TAG_RSP, tpmcmd->resp_len, status);
+
+   return status;
+}
+
+
+TPM_RESULT vtpmmgr_handle_cmd(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_TAG tag;
+   UINT32 size;
+   TPM_COMMAND_CODE ord;
+
+   unpack_TPM_RQU_HEADER(tpmcmd->req,
+         &tag, &size, &ord);
+
+   /* Handle the command now */
+   switch(tag) {
+      case VTPM_TAG_REQ:
+         //This is a vTPM command
+         switch(ord) {
+            case VTPM_ORD_SAVEHASHKEY:
+               return vtpmmgr_SaveHashKey(uuid, tpmcmd);
+            case VTPM_ORD_LOADHASHKEY:
+               return vtpmmgr_LoadHashKey(uuid, tpmcmd);
+            default:
+               vtpmlogerror(VTPM_LOG_VTPM, "Invalid vTPM Ordinal %" PRIu32 "\n", ord);
+               status = TPM_BAD_ORDINAL;
+         }
+         break;
+      case TPM_TAG_RQU_COMMAND:
+      case TPM_TAG_RQU_AUTH1_COMMAND:
+      case TPM_TAG_RQU_AUTH2_COMMAND:
+         //This is a TPM passthrough command
+         switch(ord) {
+            case TPM_ORD_GetRandom:
+               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_GetRandom\n");
+               break;
+            case TPM_ORD_PcrRead:
+               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_PcrRead\n");
+               break;
+            default:
+               vtpmlogerror(VTPM_LOG_VTPM, "TPM Disallowed Passthrough ord=%" PRIu32 "\n", ord);
+               status = TPM_DISABLED_CMD;
+               goto abort_egress;
+         }
+
+         size = TCPA_MAX_BUFFER_LENGTH;
+         TPMTRYRETURN(TPM_TransmitData(tpmcmd->req, tpmcmd->req_len, tpmcmd->resp, &size));
+         tpmcmd->resp_len = size;
+
+         unpack_TPM_RESULT(tpmcmd->resp + sizeof(TPM_TAG) + sizeof(UINT32), &status);
+         return status;
+
+         break;
+      default:
+         vtpmlogerror(VTPM_LOG_VTPM, "Invalid tag=%" PRIu16 "\n", tag);
+         status = TPM_BADTAG;
+   }
+
+abort_egress:
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         tag + 3, tpmcmd->resp_len, status);
+
+   return status;
+}
diff --git a/stubdom/vtpmmgr/vtpm_manager.h b/stubdom/vtpmmgr/vtpm_manager.h
new file mode 100644
index 0000000..a2bbcca
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_manager.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPM_MANAGER_H
+#define VTPM_MANAGER_H
+
+#define VTPM_TAG_REQ 0x01c1
+#define VTPM_TAG_RSP 0x01c4
+#define COMMAND_BUFFER_SIZE 4096
+
+// Header size
+#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
+
+//************************ Command Codes ****************************
+#define VTPM_ORD_BASE       0x0000
+#define VTPM_PRIV_MASK      0x01000000 // Priviledged VTPM Command
+#define VTPM_PRIV_BASE      (VTPM_ORD_BASE | VTPM_PRIV_MASK)
+
+// Non-priviledged VTPM Commands (From DMI's)
+#define VTPM_ORD_SAVEHASHKEY      (VTPM_ORD_BASE + 1) // DMI requests encryption key for persistent storage
+#define VTPM_ORD_LOADHASHKEY      (VTPM_ORD_BASE + 2) // DMI requests symkey to be regenerated
+
+//************************ Return Codes ****************************
+#define VTPM_SUCCESS               0
+#define VTPM_FAIL                  1
+#define VTPM_UNSUPPORTED           2
+#define VTPM_FORBIDDEN             3
+#define VTPM_RESTORE_CONTEXT_FAILED    4
+#define VTPM_INVALID_REQUEST       5
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_storage.c b/stubdom/vtpmmgr/vtpm_storage.c
new file mode 100644
index 0000000..3862fdb
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_storage.c
@@ -0,0 +1,783 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+/***************************************************************
+ * DISK IMAGE LAYOUT
+ * *************************************************************
+ * All data is stored in BIG ENDIAN format
+ * *************************************************************
+ * Section 1: Header
+ *
+ * 10 bytes 	id			ID String "VTPMMGRDOM"
+ * uint32_t	version	Disk 		Image version number (current == 1)
+ * uint32_t     storage_key_len		Length of the Boot Key
+ * BYTEARRAY    storage_key		TPM boot key
+ *
+ * *************************************************************
+ * Section 2: Key Data Table (starts at offset 4096)
+ *
+ * This is a list of blocks, each is RSA_CIPHER_SIZE long
+ * and is encrypted with the storage key.
+ *
+ * The first block always exists and it contains:
+ * uint32_t num_vtpms                   Number of vtpms (number of remaining blocks)
+ *
+ * The rest of the blocks look like this:
+ * 16 bytes	uuid			uuid of the owner of this key and hash
+ * 20 bytes	hash			Sha1 hash of vTPM's data, supplied by vTPM
+ * 32 bytes	key			AES-256 Encryption Key, supplied by vTPM
+ *
+ * *************************************************************
+ */
+#define DISKVERS 1
+#define IDSTR "VTPMMGRDOM"
+#define IDSTRLEN 10
+#define AES_BLOCK_SIZE 16
+#define AES_KEY_BITS 256
+#define AES_KEY_SIZE (AES_KEY_BITS/8)
+#define BUF_SIZE 4096
+
+#define UUID_TBL_ENT_SIZE (sizeof(uuid_t) + sizeof(uint32_t))
+
+#define HEADERSZ (10 + 4 + 4)
+
+#define TRY_READ(buf, size, msg) do {\
+   int rc; \
+   if((rc = read(blkfront_fd, buf, (size))) != (size)) { \
+      vtpmlogerror(VTPM_LOG_VTPM, "read() failed! " msg " : rc=(%d/%d), error=(%s)\n", rc, (int)(size), strerror(errno)); \
+      status = TPM_IOERROR;\
+      goto abort_egress;\
+   } \
+} while(0)
+
+#define TRY_WRITE(buf, size, msg) do {\
+   int rc; \
+   if((rc = write(blkfront_fd, buf, (size))) != (size)) { \
+      vtpmlogerror(VTPM_LOG_VTPM, "write() failed! " msg " : rc=(%d/%d), error=(%s)\n", rc, (int)(size), strerror(errno)); \
+      status = TPM_IOERROR;\
+      goto abort_egress;\
+   } \
+} while(0)
+
+#include <blkfront.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <mini-os/byteorder.h>
+#include <polarssl/aes.h>
+
+#include "vtpm_manager.h"
+#include "log.h"
+#include "marshal.h"
+#include "tpm.h"
+#include "uuid.h"
+
+#include "vtpmmgr.h"
+#include "vtpm_storage.h"
+
+#define MAX(a,b) ( ((a) > (b)) ? (a) : (b) )
+#define MIN(a,b) ( ((a) < (b)) ? (a) : (b) )
+
+/* blkfront device objets */
+static struct blkfront_dev* blkdev = NULL;
+static int blkfront_fd = -1;
+
+struct Vtpm {
+   uuid_t uuid;
+   int offset;
+};
+struct Storage {
+   int aes_offset;
+   int uuid_offset;
+   int end_offset;
+
+   int num_vtpms;
+   int num_vtpms_alloced;
+   struct Vtpm* vtpms;
+};
+
+/* Global storage data */
+static struct Storage g_store = {
+   .vtpms = NULL,
+};
+
+static int get_offset(void) {
+   return lseek(blkfront_fd, 0, SEEK_CUR);
+}
+
+static void reset_store(void) {
+   g_store.aes_offset = 0;
+   g_store.uuid_offset = 0;
+   g_store.end_offset = 0;
+
+   g_store.num_vtpms = 0;
+   g_store.num_vtpms_alloced = 0;
+   free(g_store.vtpms);
+   g_store.vtpms = NULL;
+}
+
+static int vtpm_get_index(const uuid_t uuid) {
+   int st = 0;
+   int ed = g_store.num_vtpms-1;
+   while(st <= ed) {
+      int mid = ((unsigned int)st + (unsigned int)ed) >> 1; //avoid overflow
+      int c = memcmp(uuid, &g_store.vtpms[mid].uuid, sizeof(uuid_t));
+      if(c == 0) {
+         return mid;
+      } else if(c > 0) {
+         st = mid + 1;
+      } else {
+         ed = mid - 1;
+      }
+   }
+   return -(st + 1);
+}
+
+static void vtpm_add(const uuid_t uuid, int offset, int index) {
+   /* Realloc more space if needed */
+   if(g_store.num_vtpms >= g_store.num_vtpms_alloced) {
+      g_store.num_vtpms_alloced += 16;
+      g_store.vtpms = realloc(
+            g_store.vtpms,
+            sizeof(struct Vtpm) * g_store.num_vtpms_alloced);
+   }
+
+   /* Move everybody after the new guy */
+   for(int i = g_store.num_vtpms; i > index; --i) {
+      g_store.vtpms[i] = g_store.vtpms[i-1];
+   }
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Registered vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+
+   /* Finally add new one */
+   memcpy(g_store.vtpms[index].uuid, uuid, sizeof(uuid_t));
+   g_store.vtpms[index].offset = offset;
+   ++g_store.num_vtpms;
+}
+
+#if 0
+static void vtpm_remove(int index) {
+   for(i = index; i < g_store.num_vtpms; ++i) {
+      g_store.vtpms[i] = g_store.vtpms[i+1];
+   }
+   --g_store.num_vtpms;
+}
+#endif
+
+static int pack_uuid_table(uint8_t* table, int size, int* nvtpms) {
+   uint8_t* ptr = table;
+   while(*nvtpms < g_store.num_vtpms && size >= 0)
+   {
+      /* Pack the uuid */
+      memcpy(ptr, (uint8_t*)g_store.vtpms[*nvtpms].uuid, sizeof(uuid_t));
+      ptr+= sizeof(uuid_t);
+
+
+      /* Pack the offset */
+      ptr = pack_UINT32(ptr, g_store.vtpms[*nvtpms].offset);
+
+      ++*nvtpms;
+      size -= UUID_TBL_ENT_SIZE;
+   }
+   return ptr - table;
+}
+
+/* Extract the uuids */
+static int extract_uuid_table(uint8_t* table, int size) {
+   uint8_t* ptr = table;
+   for(;size >= UUID_TBL_ENT_SIZE; size -= UUID_TBL_ENT_SIZE) {
+      int index;
+      uint32_t v32;
+
+      /*uuid_t is just an array of bytes, so we can do a direct cast here */
+      uint8_t* uuid = ptr;
+      ptr += sizeof(uuid_t);
+
+      /* Get the offset of the key */
+      ptr = unpack_UINT32(ptr, &v32);
+
+      /* Insert the new vtpm in sorted order */
+      if((index = vtpm_get_index(uuid)) >= 0) {
+         vtpmlogerror(VTPM_LOG_VTPM, "Vtpm (" UUID_FMT ") exists multiple times! ignoring...\n", UUID_BYTES(uuid));
+         continue;
+      }
+      index = -index -1;
+
+      vtpm_add(uuid, v32, index);
+
+   }
+   return ptr - table;
+}
+
+static void vtpm_decrypt_block(aes_context* aes,
+      uint8_t* iv,
+      uint8_t* cipher,
+      uint8_t* plain,
+      int cipher_sz,
+      int* overlap)
+{
+   int bytes_ext;
+   /* Decrypt */
+   aes_crypt_cbc(aes, AES_DECRYPT,
+         cipher_sz,
+         iv, cipher, plain + *overlap);
+
+   /* Extract */
+   bytes_ext = extract_uuid_table(plain, cipher_sz + *overlap);
+
+   /* Copy left overs to the beginning */
+   *overlap = cipher_sz + *overlap - bytes_ext;
+   memcpy(plain, plain + bytes_ext, *overlap);
+}
+
+static int vtpm_encrypt_block(aes_context* aes,
+      uint8_t* iv,
+      uint8_t* plain,
+      uint8_t* cipher,
+      int block_sz,
+      int* overlap,
+      int* num_vtpms)
+{
+   int bytes_to_crypt;
+   int bytes_packed;
+
+   /* Pack the uuid table */
+   bytes_packed = *overlap + pack_uuid_table(plain + *overlap, block_sz - *overlap, num_vtpms);
+   bytes_to_crypt = MIN(bytes_packed, block_sz);
+
+   /* Add padding if we aren't on a multiple of the block size */
+   if(bytes_to_crypt & (AES_BLOCK_SIZE-1)) {
+      int oldsz = bytes_to_crypt;
+      //add padding
+      bytes_to_crypt += AES_BLOCK_SIZE - (bytes_to_crypt & (AES_BLOCK_SIZE-1));
+      //fill padding with random bytes
+      vtpmmgr_rand(plain + oldsz, bytes_to_crypt - oldsz);
+      *overlap = 0;
+   } else {
+      *overlap = bytes_packed - bytes_to_crypt;
+   }
+
+   /* Encrypt this chunk */
+   aes_crypt_cbc(aes, AES_ENCRYPT,
+            bytes_to_crypt,
+            iv, plain, cipher);
+
+   /* Copy the left over partials to the beginning */
+   memcpy(plain, plain + bytes_to_crypt, *overlap);
+
+   return bytes_to_crypt;
+}
+
+static TPM_RESULT vtpm_storage_new_vtpm(const uuid_t uuid, int index) {
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
+   uint8_t buf[BUF_SIZE];
+   uint8_t* ptr;
+   int cipher_sz;
+   aes_context aes;
+
+   /* Add new vtpm to the table */
+   vtpm_add(uuid, g_store.end_offset, index);
+   g_store.end_offset += RSA_CIPHER_SIZE;
+
+   /* Compute the new end location of the encrypted uuid table */
+   cipher_sz = AES_BLOCK_SIZE; //IV
+   cipher_sz += g_store.num_vtpms * UUID_TBL_ENT_SIZE; //uuid table
+   cipher_sz += (AES_BLOCK_SIZE - (cipher_sz & (AES_BLOCK_SIZE -1))) & (AES_BLOCK_SIZE-1); //aes padding
+
+   /* Does this overlap any key data? If so they need to be relocated */
+   int uuid_end = (g_store.uuid_offset + cipher_sz + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+   for(int i = 0; i < g_store.num_vtpms; ++i) {
+      if(g_store.vtpms[i].offset < uuid_end) {
+
+         vtpmloginfo(VTPM_LOG_VTPM, "Relocating vtpm data\n");
+
+         //Read the hashkey cipher text
+         lseek(blkfront_fd, g_store.vtpms[i].offset, SEEK_SET);
+         TRY_READ(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
+
+         //Write the cipher text to new offset
+         lseek(blkfront_fd, g_store.end_offset, SEEK_SET);
+         TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
+
+         //Save new offset
+         g_store.vtpms[i].offset = g_store.end_offset;
+         g_store.end_offset += RSA_CIPHER_SIZE;
+      }
+   }
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Generating a new symmetric key\n");
+
+   /* Generate an aes key */
+   TPMTRYRETURN(vtpmmgr_rand(plain, AES_KEY_SIZE));
+   aes_setkey_enc(&aes, plain, AES_KEY_BITS);
+   ptr = plain + AES_KEY_SIZE;
+
+   /* Pack the crypted size */
+   ptr = pack_UINT32(ptr, cipher_sz);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Binding encrypted key\n");
+
+   /* Seal the key and size */
+   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
+            plain,
+            ptr - plain,
+            buf));
+
+   /* Write the sealed key to disk */
+   lseek(blkfront_fd, g_store.aes_offset, SEEK_SET);
+   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm aes key");
+
+   /* ENCRYPT AND WRITE UUID TABLE */
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Encrypting the uuid table\n");
+
+   int num_vtpms = 0;
+   int overlap = 0;
+   int bytes_crypted;
+   uint8_t iv[AES_BLOCK_SIZE];
+
+   /* Generate the iv for the first block */
+   TPMTRYRETURN(vtpmmgr_rand(iv, AES_BLOCK_SIZE));
+
+   /* Copy the iv to the cipher text buffer to be written to disk */
+   memcpy(buf, iv, AES_BLOCK_SIZE);
+   ptr = buf + AES_BLOCK_SIZE;
+
+   /* Encrypt the first block of the uuid table */
+   bytes_crypted = vtpm_encrypt_block(&aes,
+         iv, //iv
+         plain, //plaintext
+         ptr, //cipher text
+         BUF_SIZE - AES_BLOCK_SIZE,
+         &overlap,
+         &num_vtpms);
+
+   /* Write the iv followed by the crypted table*/
+   TRY_WRITE(buf, bytes_crypted + AES_BLOCK_SIZE, "vtpm uuid table");
+
+   /* Decrement the number of bytes encrypted */
+   cipher_sz -= bytes_crypted + AES_BLOCK_SIZE;
+
+   /* If there are more vtpms, encrypt and write them block by block */
+   while(cipher_sz > 0) {
+      /* Encrypt the next block of the uuid table */
+      bytes_crypted = vtpm_encrypt_block(&aes,
+               iv,
+               plain,
+               buf,
+               BUF_SIZE,
+               &overlap,
+               &num_vtpms);
+
+      /* Write the cipher text to disk */
+      TRY_WRITE(buf, bytes_crypted, "vtpm uuid table");
+
+      cipher_sz -= bytes_crypted;
+   }
+
+   goto egress;
+abort_egress:
+egress:
+   return status;
+}
+
+
+/**************************************
+ * PUBLIC FUNCTIONS
+ * ***********************************/
+
+int vtpm_storage_init(void) {
+   struct blkfront_info info;
+   if((blkdev = init_blkfront(NULL, &info)) == NULL) {
+      return -1;
+   }
+   if((blkfront_fd = blkfront_open(blkdev)) < 0) {
+      return -1;
+   }
+   return 0;
+}
+
+void vtpm_storage_shutdown(void) {
+   reset_store();
+   close(blkfront_fd);
+}
+
+TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ])
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   int index;
+   uint8_t cipher[RSA_CIPHER_SIZE];
+   uint8_t clear[RSA_CIPHER_SIZE];
+   UINT32 clear_size;
+
+   /* Find the index of this uuid */
+   if((index = vtpm_get_index(uuid)) < 0) {
+      index = -index-1;
+      vtpmlogerror(VTPM_LOG_VTPM, "LoadKey failure: Unrecognized uuid! " UUID_FMT "\n", UUID_BYTES(uuid));
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   /* Read the table entry */
+   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
+   TRY_READ(cipher, RSA_CIPHER_SIZE, "vtpm hashkey data");
+
+   /* Decrypt the table entry */
+   TPMTRYRETURN(TPM_UnBind(
+            vtpm_globals.storage_key_handle,
+            RSA_CIPHER_SIZE,
+            cipher,
+            &clear_size,
+            clear,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.oiap));
+
+   if(clear_size < HASHKEYSZ) {
+      vtpmloginfo(VTPM_LOG_VTPM, "Decrypted Hash key size (%" PRIu32 ") was too small!\n", clear_size);
+      status = TPM_RESOURCES;
+      goto abort_egress;
+   }
+
+   memcpy(hashkey, clear, HASHKEYSZ);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Loaded hash and key for vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+   goto egress;
+abort_egress:
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load key\n");
+egress:
+   return status;
+}
+
+TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ])
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   int index;
+   uint8_t buf[RSA_CIPHER_SIZE];
+
+   /* Find the index of this uuid */
+   if((index = vtpm_get_index(uuid)) < 0) {
+      index = -index-1;
+      /* Create a new vtpm */
+      TPMTRYRETURN( vtpm_storage_new_vtpm(uuid, index) );
+   }
+
+   /* Encrypt the hash and key */
+   TPMTRYRETURN( TPM_Bind(&vtpm_globals.storage_key,
+            hashkey,
+            HASHKEYSZ,
+            buf));
+
+   /* Write to disk */
+   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
+   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey data");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saved hash and key for vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+   goto egress;
+abort_egress:
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to save key\n");
+egress:
+   return status;
+}
+
+TPM_RESULT vtpm_storage_new_header()
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t buf[BUF_SIZE];
+   uint8_t keybuf[AES_KEY_SIZE + sizeof(uint32_t)];
+   uint8_t* ptr = buf;
+   uint8_t* sptr;
+
+   /* Clear everything first */
+   reset_store();
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Creating new disk image header\n");
+
+   /*Copy the ID string */
+   memcpy(ptr, IDSTR, IDSTRLEN);
+   ptr += IDSTRLEN;
+
+   /*Copy the version */
+   ptr = pack_UINT32(ptr, DISKVERS);
+
+   /*Save the location of the key size */
+   sptr = ptr;
+   ptr += sizeof(UINT32);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saving root storage key..\n");
+
+   /* Copy the storage key */
+   ptr = pack_TPM_KEY(ptr, &vtpm_globals.storage_key);
+
+   /* Now save the size */
+   pack_UINT32(sptr, ptr - (sptr + 4));
+
+   /* Create a fake aes key and set cipher text size to 0 */
+   memset(keybuf, 0, sizeof(keybuf));
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Binding uuid table symmetric key..\n");
+
+   /* Save the location of the aes key */
+   g_store.aes_offset = ptr - buf;
+
+   /* Store the fake aes key and vtpm count */
+   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
+         keybuf,
+         sizeof(keybuf),
+         ptr));
+   ptr+= RSA_CIPHER_SIZE;
+
+   /* Write the header to disk */
+   lseek(blkfront_fd, 0, SEEK_SET);
+   TRY_WRITE(buf, ptr-buf, "vtpm header");
+
+   /* Save the location of the uuid table */
+   g_store.uuid_offset = get_offset();
+
+   /* Save the end offset */
+   g_store.end_offset = (g_store.uuid_offset + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saved new manager disk header.\n");
+
+   goto egress;
+abort_egress:
+egress:
+   return status;
+}
+
+
+TPM_RESULT vtpm_storage_load_header(void)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint32_t v32;
+   uint8_t buf[BUF_SIZE];
+   uint8_t* ptr = buf;
+   aes_context aes;
+
+   /* Clear everything first */
+   reset_store();
+
+   /* Read the header from disk */
+   lseek(blkfront_fd, 0, SEEK_SET);
+   TRY_READ(buf, IDSTRLEN + sizeof(UINT32) + sizeof(UINT32), "vtpm header");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Loading disk image header\n");
+
+   /* Verify the ID string */
+   if(memcmp(ptr, IDSTR, IDSTRLEN)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid ID string in disk image!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+   ptr+=IDSTRLEN;
+
+   /* Unpack the version */
+   ptr = unpack_UINT32(ptr, &v32);
+
+   /* Verify the version */
+   if(v32 != DISKVERS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unsupported disk image version number %" PRIu32 "\n", v32);
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   /* Size of the storage key */
+   ptr = unpack_UINT32(ptr, &v32);
+
+   /* Sanity check */
+   if(v32 > BUF_SIZE) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Size of storage key (%" PRIu32 ") is too large!\n", v32);
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* read the storage key */
+   TRY_READ(buf, v32, "storage pub key");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Unpacking storage key\n");
+
+   /* unpack the storage key */
+   ptr = unpack_TPM_KEY(buf, &vtpm_globals.storage_key, UNPACK_ALLOC);
+
+   /* Load Storage Key into the TPM */
+   TPMTRYRETURN( TPM_LoadKey(
+            TPM_SRK_KEYHANDLE,
+            &vtpm_globals.storage_key,
+            &vtpm_globals.storage_key_handle,
+            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+            &vtpm_globals.oiap));
+
+   /* Initialize the storage key auth */
+   memset(vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA));
+
+   /* Store the offset of the aes key */
+   g_store.aes_offset = get_offset();
+
+   /* Read the rsa cipher text for the aes key */
+   TRY_READ(buf, RSA_CIPHER_SIZE, "aes key");
+   ptr = buf + RSA_CIPHER_SIZE;
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Unbinding uuid table symmetric key\n");
+
+   /* Decrypt the aes key protecting the uuid table */
+   UINT32 datalen;
+   TPMTRYRETURN(TPM_UnBind(
+            vtpm_globals.storage_key_handle,
+            RSA_CIPHER_SIZE,
+            buf,
+            &datalen,
+            ptr,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.oiap));
+
+   /* Validate the length of the output buffer */
+   if(datalen < AES_KEY_SIZE + sizeof(UINT32)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unbound AES key size (%d) was too small! expected (%ld)\n", datalen, AES_KEY_SIZE + sizeof(UINT32));
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* Extract the aes key */
+   aes_setkey_dec(&aes, ptr, AES_KEY_BITS);
+   ptr+= AES_KEY_SIZE;
+
+   /* Extract the ciphertext size */
+   ptr = unpack_UINT32(ptr, &v32);
+   int cipher_size = v32;
+
+   /* Sanity check */
+   if(cipher_size & (AES_BLOCK_SIZE-1)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Cipher text size (%" PRIu32 ") is not a multiple of the aes block size! (%d)\n", v32, AES_BLOCK_SIZE);
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* Save the location of the uuid table */
+   g_store.uuid_offset = get_offset();
+
+   /* Only decrypt the table if there are vtpms to decrypt */
+   if(cipher_size > 0) {
+      int rbytes;
+      int overlap = 0;
+      uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
+      uint8_t iv[AES_BLOCK_SIZE];
+
+      vtpmloginfo(VTPM_LOG_VTPM, "Decrypting uuid table\n");
+
+      /* Pre allocate the vtpm array */
+      g_store.num_vtpms_alloced = cipher_size / UUID_TBL_ENT_SIZE;
+      g_store.vtpms = malloc(sizeof(struct Vtpm) * g_store.num_vtpms_alloced);
+
+      /* Read the iv and the first chunk of cipher text */
+      rbytes = MIN(cipher_size, BUF_SIZE);
+      TRY_READ(buf, rbytes, "vtpm uuid table\n");
+      cipher_size -= rbytes;
+
+      /* Copy the iv */
+      memcpy(iv, buf, AES_BLOCK_SIZE);
+      ptr = buf + AES_BLOCK_SIZE;
+
+      /* Remove the iv from the number of bytes to decrypt */
+      rbytes -= AES_BLOCK_SIZE;
+
+      /* Decrypt and extract vtpms */
+      vtpm_decrypt_block(&aes,
+            iv, ptr, plain,
+            rbytes, &overlap);
+
+      /* Read the rest of the table if there is more */
+      while(cipher_size > 0) {
+         /* Read next chunk of cipher text */
+         rbytes = MIN(cipher_size, BUF_SIZE);
+         TRY_READ(buf, rbytes, "vtpm uuid table");
+         cipher_size -= rbytes;
+
+         /* Decrypt a block of text */
+         vtpm_decrypt_block(&aes,
+               iv, buf, plain,
+               rbytes, &overlap);
+
+      }
+      vtpmloginfo(VTPM_LOG_VTPM, "Loaded %d vtpms!\n", g_store.num_vtpms);
+   }
+
+   /* The end of the key table, new vtpms go here */
+   int uuid_end = (get_offset() + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+   g_store.end_offset = uuid_end;
+
+   /* Compute the end offset while validating vtpms*/
+   for(int i = 0; i < g_store.num_vtpms; ++i) {
+      /* offset must not collide with previous data */
+      if(g_store.vtpms[i].offset < uuid_end) {
+         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
+               " offset (%d) is before end of uuid table (%d)!\n",
+               UUID_BYTES(g_store.vtpms[i].uuid),
+               g_store.vtpms[i].offset, uuid_end);
+         status = TPM_IOERROR;
+         goto abort_egress;
+      }
+      /* offset must be at a multiple of cipher size */
+      if(g_store.vtpms[i].offset & (RSA_CIPHER_SIZE-1)) {
+         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
+               " offset(%d) is not at a multiple of the rsa cipher text size (%d)!\n",
+               UUID_BYTES(g_store.vtpms[i].uuid),
+               g_store.vtpms[i].offset, RSA_CIPHER_SIZE);
+         status = TPM_IOERROR;
+         goto abort_egress;
+      }
+      /* Save the last offset */
+      if(g_store.vtpms[i].offset >= g_store.end_offset) {
+         g_store.end_offset = g_store.vtpms[i].offset + RSA_CIPHER_SIZE;
+      }
+   }
+
+   goto egress;
+abort_egress:
+   //An error occured somewhere
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load manager data!\n");
+
+   //Clear the data store
+   reset_store();
+
+   //Reset the storage key structure
+   free_TPM_KEY(&vtpm_globals.storage_key);
+   {
+      TPM_KEY key = TPM_KEY_INIT;
+      vtpm_globals.storage_key = key;
+   }
+
+   //Reset the storage key handle
+   TPM_EvictKey(vtpm_globals.storage_key_handle);
+   vtpm_globals.storage_key_handle = 0;
+egress:
+   return status;
+}
+
+#if 0
+/* For testing disk IO */
+void add_fake_vtpms(int num) {
+   for(int i = 0; i < num; ++i) {
+      uint32_t ind = cpu_to_be32(i);
+
+      uuid_t uuid;
+      memset(uuid, 0, sizeof(uuid_t));
+      memcpy(uuid, &ind, sizeof(ind));
+      int index = vtpm_get_index(uuid);
+      index = -index-1;
+
+      vtpm_storage_new_vtpm(uuid, index);
+   }
+}
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_storage.h b/stubdom/vtpmmgr/vtpm_storage.h
new file mode 100644
index 0000000..a5a5fd7
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_storage.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPM_STORAGE_H
+#define VTPM_STORAGE_h
+
+#include "uuid.h"
+
+#define VTPM_NVMKEY_SIZE 32
+#define HASHKEYSZ (sizeof(TPM_DIGEST) + VTPM_NVMKEY_SIZE)
+
+/* Initialize the storage system and its virtual disk */
+int vtpm_storage_init(void);
+
+/* Shutdown the storage system and its virtual disk */
+void vtpm_storage_shutdown(void);
+
+/* Loads Sha1 hash and 256 bit AES key from disk and stores them
+ * packed together in outbuf. outbuf must be freed
+ * by the caller using buffer_free()
+ */
+TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ]);
+
+/* inbuf must contain a sha1 hash followed by a 256 bit AES key.
+ * Encrypts and stores the hash and key to disk */
+TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ]);
+
+/* Load the vtpm manager data - call this on startup */
+TPM_RESULT vtpm_storage_load_header(void);
+
+/* Saves the vtpm manager data - call this on shutdown */
+TPM_RESULT vtpm_storage_new_header(void);
+
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpmmgr.c b/stubdom/vtpmmgr/vtpmmgr.c
new file mode 100644
index 0000000..563f4e8
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpmmgr.c
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdint.h>
+#include <mini-os/tpmback.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "log.h"
+
+#include "vtpmmgr.h"
+#include "tcg.h"
+
+
+void main_loop(void) {
+   tpmcmd_t* tpmcmd;
+   uint8_t respbuf[TCPA_MAX_BUFFER_LENGTH];
+
+   while(1) {
+      /* Wait for requests from a vtpm */
+      vtpmloginfo(VTPM_LOG_VTPM, "Waiting for commands from vTPM's:\n");
+      if((tpmcmd = tpmback_req_any()) == NULL) {
+         vtpmlogerror(VTPM_LOG_VTPM, "NULL tpmcmd\n");
+         continue;
+      }
+
+      tpmcmd->resp = respbuf;
+
+      /* Process the command */
+      vtpmmgr_handle_cmd(tpmcmd->uuid, tpmcmd);
+
+      /* Send response */
+      tpmback_resp(tpmcmd);
+   }
+}
+
+int main(int argc, char** argv)
+{
+   int rc = 0;
+   sleep(2);
+   vtpmloginfo(VTPM_LOG_VTPM, "Starting vTPM manager domain\n");
+
+   /* Initialize the vtpm manager */
+   if(vtpmmgr_init(argc, argv) != TPM_SUCCESS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize vtpmmgr domain!\n");
+      rc = -1;
+      goto exit;
+   }
+
+   main_loop();
+
+   vtpmloginfo(VTPM_LOG_VTPM, "vTPM Manager shutting down...\n");
+
+   vtpmmgr_shutdown();
+
+exit:
+   return rc;
+
+}
diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
new file mode 100644
index 0000000..50a1992
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPMMGR_H
+#define VTPMMGR_H
+
+#include <mini-os/tpmback.h>
+#include <polarssl/entropy.h>
+#include <polarssl/ctr_drbg.h>
+
+#include "uuid.h"
+#include "tcg.h"
+#include "vtpm_manager.h"
+
+#define RSA_KEY_SIZE 0x0800
+#define RSA_CIPHER_SIZE (RSA_KEY_SIZE / 8)
+
+struct vtpm_globals {
+   int tpm_fd;
+   TPM_KEY             storage_key;
+   TPM_HANDLE          storage_key_handle;       // Key used by persistent store
+   TPM_AUTH_SESSION    oiap;                // OIAP session for storageKey
+   TPM_AUTHDATA        storage_key_usage_auth;
+
+   TPM_AUTHDATA        owner_auth;
+   TPM_AUTHDATA        srk_auth;
+
+   entropy_context     entropy;
+   ctr_drbg_context    ctr_drbg;
+};
+
+// --------------------------- Global Values --------------------------
+extern struct vtpm_globals vtpm_globals;   // Key info and DMI states
+
+TPM_RESULT vtpmmgr_init(int argc, char** argv);
+void vtpmmgr_shutdown(void);
+
+TPM_RESULT vtpmmgr_handle_cmd(const uuid_t uuid, tpmcmd_t* tpmcmd);
+
+inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes) {
+   return ctr_drbg_random(&vtpm_globals.ctr_drbg, bytes, num_bytes) == 0 ? 0 : TPM_FAIL;
+}
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:26:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:26:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1L7-00036Z-3n; Thu, 15 Nov 2012 15:26:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TZ1L5-00036T-NR
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 15:26:47 +0000
Received: from [85.158.139.211:56086] by server-15.bemta-5.messagelabs.com id
	C0/02-26920-7B905A05; Thu, 15 Nov 2012 15:26:47 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1352993204!20332700!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM4MzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5557 invoked from network); 15 Nov 2012 15:26:45 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 15:26:45 -0000
X-IronPort-AV: E=Sophos;i="4.83,258,1352073600"; d="scan'208";a="44718401"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 15:26:44 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:26:44 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TZ1L1-0001w2-K6;
	Thu, 15 Nov 2012 15:26:43 +0000
Date: Thu, 15 Nov 2012 15:26:09 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1352974179.3499.83.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211151507100.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-7-git-send-email-stefano.stabellini@eu.citrix.com>
	<1352974179.3499.83.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 7/7] xen/arm: get the number of cpus from
	device tree
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 15 Nov 2012, Ian Campbell wrote:
> On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> > diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> > index 3d1f0f4..5b6dab9 100644
> > --- a/xen/common/device_tree.c
> > +++ b/xen/common/device_tree.c
> > @@ -153,6 +153,25 @@ const char *device_tree_bootargs(const void *fdt)
> >      return prop->data;
> >  }
> >  
> > +int device_tree_cpus(const void *fdt)
> > +{
> > +    int node = 0, depth = 1;
> > +    int cpus = 0;
> > +
> > +    node = fdt_path_offset(fdt, "/cpus/cpu");
> > +    if ( node < 0 )
> > +        return 1; /* we have at least one cpu */
> > +
> > +    while ( node >= 0 && depth >= 0 ) {
> > +        if ( strncmp(fdt_get_name(fdt, node, NULL), "cpu", 3) )
> > +            continue;
> > +        node = fdt_next_node(fdt, node, &depth);
> > +        cpus++;
> 
> Do we not need to track the largest <n> for each cpu@<n> which we see,
> in order to handle systems with e.g. CPUs 0, 1, 4 & 5?

Actually the hardware ID is expressed by the <reg> propery.
Maybe we should set the corresponding ID in cpu_present_map from
device_tree_cpus?


> There are some helpers in device_tree.c to walk over trees like this,
> are none of them suitable?
 
Do you mean device_tree_node_matches?
Yes, I can use that instead of strncmp. I'll do that.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:26:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:26:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1L7-00036Z-3n; Thu, 15 Nov 2012 15:26:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TZ1L5-00036T-NR
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 15:26:47 +0000
Received: from [85.158.139.211:56086] by server-15.bemta-5.messagelabs.com id
	C0/02-26920-7B905A05; Thu, 15 Nov 2012 15:26:47 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1352993204!20332700!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM4MzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5557 invoked from network); 15 Nov 2012 15:26:45 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 15:26:45 -0000
X-IronPort-AV: E=Sophos;i="4.83,258,1352073600"; d="scan'208";a="44718401"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 15:26:44 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 10:26:44 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TZ1L1-0001w2-K6;
	Thu, 15 Nov 2012 15:26:43 +0000
Date: Thu, 15 Nov 2012 15:26:09 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1352974179.3499.83.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211151507100.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-7-git-send-email-stefano.stabellini@eu.citrix.com>
	<1352974179.3499.83.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 7/7] xen/arm: get the number of cpus from
	device tree
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 15 Nov 2012, Ian Campbell wrote:
> On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> > diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> > index 3d1f0f4..5b6dab9 100644
> > --- a/xen/common/device_tree.c
> > +++ b/xen/common/device_tree.c
> > @@ -153,6 +153,25 @@ const char *device_tree_bootargs(const void *fdt)
> >      return prop->data;
> >  }
> >  
> > +int device_tree_cpus(const void *fdt)
> > +{
> > +    int node = 0, depth = 1;
> > +    int cpus = 0;
> > +
> > +    node = fdt_path_offset(fdt, "/cpus/cpu");
> > +    if ( node < 0 )
> > +        return 1; /* we have at least one cpu */
> > +
> > +    while ( node >= 0 && depth >= 0 ) {
> > +        if ( strncmp(fdt_get_name(fdt, node, NULL), "cpu", 3) )
> > +            continue;
> > +        node = fdt_next_node(fdt, node, &depth);
> > +        cpus++;
> 
> Do we not need to track the largest <n> for each cpu@<n> which we see,
> in order to handle systems with e.g. CPUs 0, 1, 4 & 5?

Actually the hardware ID is expressed by the <reg> propery.
Maybe we should set the corresponding ID in cpu_present_map from
device_tree_cpus?


> There are some helpers in device_tree.c to walk over trees like this,
> are none of them suitable?
 
Do you mean device_tree_node_matches?
Yes, I can use that instead of strncmp. I'll do that.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:35:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:35:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1T2-0003Pf-2n; Thu, 15 Nov 2012 15:35:00 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZ1T0-0003Pa-Qa
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 15:34:59 +0000
Received: from [193.109.254.147:53548] by server-1.bemta-14.messagelabs.com id
	A7/EF-25314-1AB05A05; Thu, 15 Nov 2012 15:34:57 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352993685!8433052!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19798 invoked from network); 15 Nov 2012 15:34:45 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 15:34:45 -0000
X-IronPort-AV: E=Sophos;i="4.83,258,1352073600"; d="scan'208";a="15831465"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 15:34:45 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 15:34:44 +0000
Message-ID: <1352993683.3499.137.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 15 Nov 2012 15:34:43 +0000
In-Reply-To: <alpine.DEB.2.02.1211151507100.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-7-git-send-email-stefano.stabellini@eu.citrix.com>
	<1352974179.3499.83.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211151507100.28049@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 7/7] xen/arm: get the number of cpus from
	device tree
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 15:26 +0000, Stefano Stabellini wrote:
> On Thu, 15 Nov 2012, Ian Campbell wrote:
> > On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> > > diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> > > index 3d1f0f4..5b6dab9 100644
> > > --- a/xen/common/device_tree.c
> > > +++ b/xen/common/device_tree.c
> > > @@ -153,6 +153,25 @@ const char *device_tree_bootargs(const void *fdt)
> > >      return prop->data;
> > >  }
> > >  
> > > +int device_tree_cpus(const void *fdt)
> > > +{
> > > +    int node = 0, depth = 1;
> > > +    int cpus = 0;
> > > +
> > > +    node = fdt_path_offset(fdt, "/cpus/cpu");
> > > +    if ( node < 0 )
> > > +        return 1; /* we have at least one cpu */
> > > +
> > > +    while ( node >= 0 && depth >= 0 ) {
> > > +        if ( strncmp(fdt_get_name(fdt, node, NULL), "cpu", 3) )
> > > +            continue;
> > > +        node = fdt_next_node(fdt, node, &depth);
> > > +        cpus++;
> > 
> > Do we not need to track the largest <n> for each cpu@<n> which we see,
> > in order to handle systems with e.g. CPUs 0, 1, 4 & 5?
> 
> Actually the hardware ID is expressed by the <reg> propery.
> Maybe we should set the corresponding ID in cpu_present_map from
> device_tree_cpus?

I'm not sure what you mean.

> > There are some helpers in device_tree.c to walk over trees like this,
> > are none of them suitable?
>  
> Do you mean device_tree_node_matches?
> Yes, I can use that instead of strncmp. I'll do that.

You should , but that's not what I was talkig about ;-)

I was thinking of device_tree_for_each_node but I suppose that doesn't
quite fit? But perhaps you can integrate with early_scan_node?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:35:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:35:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1T2-0003Pf-2n; Thu, 15 Nov 2012 15:35:00 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZ1T0-0003Pa-Qa
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 15:34:59 +0000
Received: from [193.109.254.147:53548] by server-1.bemta-14.messagelabs.com id
	A7/EF-25314-1AB05A05; Thu, 15 Nov 2012 15:34:57 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1352993685!8433052!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19798 invoked from network); 15 Nov 2012 15:34:45 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 15:34:45 -0000
X-IronPort-AV: E=Sophos;i="4.83,258,1352073600"; d="scan'208";a="15831465"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 15:34:45 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 15:34:44 +0000
Message-ID: <1352993683.3499.137.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 15 Nov 2012 15:34:43 +0000
In-Reply-To: <alpine.DEB.2.02.1211151507100.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-7-git-send-email-stefano.stabellini@eu.citrix.com>
	<1352974179.3499.83.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211151507100.28049@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 7/7] xen/arm: get the number of cpus from
	device tree
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 15:26 +0000, Stefano Stabellini wrote:
> On Thu, 15 Nov 2012, Ian Campbell wrote:
> > On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> > > diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> > > index 3d1f0f4..5b6dab9 100644
> > > --- a/xen/common/device_tree.c
> > > +++ b/xen/common/device_tree.c
> > > @@ -153,6 +153,25 @@ const char *device_tree_bootargs(const void *fdt)
> > >      return prop->data;
> > >  }
> > >  
> > > +int device_tree_cpus(const void *fdt)
> > > +{
> > > +    int node = 0, depth = 1;
> > > +    int cpus = 0;
> > > +
> > > +    node = fdt_path_offset(fdt, "/cpus/cpu");
> > > +    if ( node < 0 )
> > > +        return 1; /* we have at least one cpu */
> > > +
> > > +    while ( node >= 0 && depth >= 0 ) {
> > > +        if ( strncmp(fdt_get_name(fdt, node, NULL), "cpu", 3) )
> > > +            continue;
> > > +        node = fdt_next_node(fdt, node, &depth);
> > > +        cpus++;
> > 
> > Do we not need to track the largest <n> for each cpu@<n> which we see,
> > in order to handle systems with e.g. CPUs 0, 1, 4 & 5?
> 
> Actually the hardware ID is expressed by the <reg> propery.
> Maybe we should set the corresponding ID in cpu_present_map from
> device_tree_cpus?

I'm not sure what you mean.

> > There are some helpers in device_tree.c to walk over trees like this,
> > are none of them suitable?
>  
> Do you mean device_tree_node_matches?
> Yes, I can use that instead of strncmp. I'll do that.

You should , but that's not what I was talkig about ;-)

I was thinking of device_tree_for_each_node but I suppose that doesn't
quite fit? But perhaps you can integrate with early_scan_node?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 15:39:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:39:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1Wr-0003YA-PM; Thu, 15 Nov 2012 15:38:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fantonifabio@tiscali.it>) id 1TZ1Wq-0003Y2-9W
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:38:56 +0000
Received: from [85.158.143.35:59048] by server-3.bemta-4.messagelabs.com id
	E0/14-06841-F8C05A05; Thu, 15 Nov 2012 15:38:55 +0000
X-Env-Sender: fantonifabio@tiscali.it
X-Msg-Ref: server-14.tower-21.messagelabs.com!1352993914!17928042!1
X-Originating-IP: [94.23.245.208]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_14,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7930 invoked from network); 15 Nov 2012 15:38:34 -0000
Received: from lnx3.fantu.it (HELO lnx3.fantu.it) (94.23.245.208)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 15:38:34 -0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by lnx3.fantu.it (Postfix) with ESMTP id 60A3940172A
	for <xen-devel@lists.xen.org>; Thu, 15 Nov 2012 16:38:34 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at lnx3.fantu.it
Received: from lnx3.fantu.it ([127.0.0.1])
	by localhost (lnx3.fantu.it [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id Viqs9mX+1LKQ for <xen-devel@lists.xen.org>;
	Thu, 15 Nov 2012 16:38:34 +0100 (CET)
Received: from [192.168.178.50]
	(host51-78-dynamic.2-87-r.retail.telecomitalia.it [87.2.78.51])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: prova@fantu.it)
	by lnx3.fantu.it (Postfix) with ESMTPSA id CE1274016C5
	for <xen-devel@lists.xen.org>; Thu, 15 Nov 2012 16:38:33 +0100 (CET)
Message-ID: <50A50C71.5080906@tiscali.it>
Date: Thu, 15 Nov 2012 16:38:25 +0100
From: Fabio Fantoni <fantonifabio@tiscali.it>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
 in Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: fantonifabio@tiscali.it
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3630304854155831512=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--===============3630304854155831512==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms050409030300030903090501"

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--------------ms050409030300030903090501
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: quoted-printable

> Support is provided for both shadow and hardware assisted paging (HAP) =
modes.
> This code bookkeeps the set of video frame buffers (vram),
> detects when the guest has modified any of those buffers and, upon requ=
est,
> returns a bitmap of the modified pages.
> This lets other software components re-paint the portions of the monito=
r (or
> monitors) that have changed.
> Each monitor has a frame buffer of some size at some position in guest =
physical
> memory.
> The set of frame buffers being tracked can change over time as monitors=
 are
> plugged and unplugged.
> (Version 3 of this patch.)
Is this patch intended for manage multiple indipendent graphic cards on=20
xen domU?
If yes is also intended for both pv and hvm domU?


--------------ms050409030300030903090501
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: Firma crittografica S/MIME

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIINhjCC
BjQwggQcoAMCAQICASAwDQYJKoZIhvcNAQEFBQAwfTELMAkGA1UEBhMCSUwxFjAUBgNVBAoT
DVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNp
Z25pbmcxKTAnBgNVBAMTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA3
MTAyNDIxMDI1NVoXDTE3MTAyNDIxMDI1NVowgYwxCzAJBgNVBAYTAklMMRYwFAYDVQQKEw1T
dGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRhbCBDZXJ0aWZpY2F0ZSBTaWdu
aW5nMTgwNgYDVQQDEy9TdGFydENvbSBDbGFzcyAyIFByaW1hcnkgSW50ZXJtZWRpYXRlIENs
aWVudCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMsohUWcASz7GfKrpTOM
KqANy9BV7V0igWdGxA8IU77L3aTxErQ+fcxtDYZ36Z6GH0YFn7fq5RADte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w4mHioj0VbLZyoUDLVkvhtW1Y7RmR9TR+BfeWKRQx/+ch2rrKKiyOx54PPm/LUKnjL
u2PPcy3G/CqUwsWWD1uxPRDFDHMm3wAAAAAAAA==
--------------ms050409030300030903090501--


--===============3630304854155831512==
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.xen.org
http://lists.xen.org/xen-devel

--===============3630304854155831512==--


From xen-devel-bounces@lists.xen.org Thu Nov 15 15:39:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:39:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1Wr-0003YA-PM; Thu, 15 Nov 2012 15:38:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fantonifabio@tiscali.it>) id 1TZ1Wq-0003Y2-9W
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:38:56 +0000
Received: from [85.158.143.35:59048] by server-3.bemta-4.messagelabs.com id
	E0/14-06841-F8C05A05; Thu, 15 Nov 2012 15:38:55 +0000
X-Env-Sender: fantonifabio@tiscali.it
X-Msg-Ref: server-14.tower-21.messagelabs.com!1352993914!17928042!1
X-Originating-IP: [94.23.245.208]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_14,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7930 invoked from network); 15 Nov 2012 15:38:34 -0000
Received: from lnx3.fantu.it (HELO lnx3.fantu.it) (94.23.245.208)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 15:38:34 -0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by lnx3.fantu.it (Postfix) with ESMTP id 60A3940172A
	for <xen-devel@lists.xen.org>; Thu, 15 Nov 2012 16:38:34 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at lnx3.fantu.it
Received: from lnx3.fantu.it ([127.0.0.1])
	by localhost (lnx3.fantu.it [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id Viqs9mX+1LKQ for <xen-devel@lists.xen.org>;
	Thu, 15 Nov 2012 16:38:34 +0100 (CET)
Received: from [192.168.178.50]
	(host51-78-dynamic.2-87-r.retail.telecomitalia.it [87.2.78.51])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: prova@fantu.it)
	by lnx3.fantu.it (Postfix) with ESMTPSA id CE1274016C5
	for <xen-devel@lists.xen.org>; Thu, 15 Nov 2012 16:38:33 +0100 (CET)
Message-ID: <50A50C71.5080906@tiscali.it>
Date: Thu, 15 Nov 2012 16:38:25 +0100
From: Fabio Fantoni <fantonifabio@tiscali.it>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
 in Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: fantonifabio@tiscali.it
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3630304854155831512=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--===============3630304854155831512==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms050409030300030903090501"

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--------------ms050409030300030903090501
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: quoted-printable

> Support is provided for both shadow and hardware assisted paging (HAP) =
modes.
> This code bookkeeps the set of video frame buffers (vram),
> detects when the guest has modified any of those buffers and, upon requ=
est,
> returns a bitmap of the modified pages.
> This lets other software components re-paint the portions of the monito=
r (or
> monitors) that have changed.
> Each monitor has a frame buffer of some size at some position in guest =
physical
> memory.
> The set of frame buffers being tracked can change over time as monitors=
 are
> plugged and unplugged.
> (Version 3 of this patch.)
Is this patch intended for manage multiple indipendent graphic cards on=20
xen domU?
If yes is also intended for both pv and hvm domU?


--------------ms050409030300030903090501
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: Firma crittografica S/MIME

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIINhjCC
BjQwggQcoAMCAQICASAwDQYJKoZIhvcNAQEFBQAwfTELMAkGA1UEBhMCSUwxFjAUBgNVBAoT
DVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNp
Z25pbmcxKTAnBgNVBAMTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA3
MTAyNDIxMDI1NVoXDTE3MTAyNDIxMDI1NVowgYwxCzAJBgNVBAYTAklMMRYwFAYDVQQKEw1T
dGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaX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YURkFR75
osshZzrzGAMCZuawuJ3xbS/IC6J3FgXALzIwQNCH/6dv9scCt31+awCzVldDLlPdrwv3zrHz
G8YnOQzJHyEMWxQv5M2543SAGqk38C7vLEASReohcD3q6OQKT/sq3YK7tOmfJdYkwMkqLEW6
O/BccEAWGLMztpvHw2pvhIuyjtfN+EtnUpNi2g/mOBtgMuEv6ELTcox4H4j6/G/oufHUc7Az
ZgDa9Vw4mHioj0VbLZyoUDLVkvhtW1Y7RmR9TR+BfeWKRQx/+ch2rrKKiyOx54PPm/LUKnjL
u2PPcy3G/CqUwsWWD1uxPRDFDHMm3wAAAAAAAA==
--------------ms050409030300030903090501--


--===============3630304854155831512==
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.xen.org
http://lists.xen.org/xen-devel

--===============3630304854155831512==--


From xen-devel-bounces@lists.xen.org Thu Nov 15 15:44:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1br-0003km-JI; Thu, 15 Nov 2012 15:44:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <michael.palmeter@oracle.com>) id 1TZ1bp-0003kf-O6
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:44:06 +0000
Received: from [85.158.143.99:35398] by server-1.bemta-4.messagelabs.com id
	84/3E-27934-5CD05A05; Thu, 15 Nov 2012 15:44:05 +0000
X-Env-Sender: michael.palmeter@oracle.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352994242!29512236!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTUyOTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8956 invoked from network); 15 Nov 2012 15:44:03 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-3.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 15:44:03 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFFhvkL013217
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 15:43:58 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFFhuTb021635
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 15:43:57 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFFhuP4028258; Thu, 15 Nov 2012 09:43:56 -0600
MIME-Version: 1.0
Message-ID: <c58a9d3a-99e4-42ac-86c9-fbec600dee14@default>
Date: Thu, 15 Nov 2012 07:43:56 -0800 (PST)
From: Michael Palmeter <michael.palmeter@oracle.com>
To: xen-devel@lists.xen.org
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] Xen credit scheduler question
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6147949025237676406=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6147949025237676406==
Content-Type: multipart/alternative;
 boundary="__1352994236664154657abhmt102.oracle.com"

--__1352994236664154657abhmt102.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

Hi all (and Mr. Dunlap in particular),

=20

I have a question about the credit (and ultimately credit2) scheduler that =
I hope you can help me with.

=20

I have read the white paper "Scheduler development update" and as much mate=
rial on the credit scheduler as I can find, but I am still not completely c=
lear on how I should think about the cap.

=20

Example scenario:

=20

Server hardware: 2 sockets, 8-cores per socket, 2 hardware threads per core=
 (total of 32 hardware threads)
Test VM: a single virtual machine with a single vCPU, weight=3D256 and cap=
=3D100%

=20

In this scenario, from what I understand, I should be able to load the Test=
 VM with traffic to a maximum of approximately 1/32 of the aggregate comput=
e capacity of the server.  The total CPU utilization of the server hardware=
 should be approximately 3.4%, plus the overhead of dom0 (say 1-2).  The cr=
edits available to any vCPU capped at 100% should be equal to 1/32 of the a=
ggregate compute available for the whole server, correct?

 =20

Put simply, is there a way to constrain a VM with 1 vCPU to consume no more=
 than 0.5 of a physical core (hyper-threaded) on the server hardware mentio=
ned below? Does the cap help in that respect?

=20

I have been struggling to understand how the scheduler can deal with the un=
certainty that hyperthreading introduces, however.  I know this is an issue=
 that you are tackling in the credit2 scheduler, but I would like to know w=
hat your thoughts are on this problem (if you are able to share).  Any insi=
ght or assistance you could offer would be greatly appreciated. =20

=20

Thanks very much and best regards,

=20

- Mike


Michael Palmeter | Sr. Director of Product Management, Oracle=20
Oracle Development
200 Oracle Parkway | Redwood Shores, California 94065=20

--__1352994236664154657abhmt102.oracle.com
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-micr=
osoft-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=3D"Content-Type" CONTENT=
=3D"text/html; charset=3Dus-ascii"><meta name=3DGenerator content=3D"Micros=
oft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
=09{font-family:"Cambria Math";
=09panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
=09{font-family:Calibri;
=09panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
=09{font-family:Tahoma;
=09panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
=09{font-family:Verdana;
=09panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
=09{margin:0in;
=09margin-bottom:.0001pt;
=09font-size:11.0pt;
=09font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
=09{mso-style-priority:99;
=09color:blue;
=09text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
=09{mso-style-priority:99;
=09color:purple;
=09text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
=09{mso-style-priority:99;
=09mso-style-link:"Balloon Text Char";
=09margin:0in;
=09margin-bottom:.0001pt;
=09font-size:8.0pt;
=09font-family:"Tahoma","sans-serif";}
span.EmailStyle17
=09{mso-style-type:personal-compose;
=09font-family:"Calibri","sans-serif";
=09color:windowtext;}
span.BalloonTextChar
=09{mso-style-name:"Balloon Text Char";
=09mso-style-priority:99;
=09mso-style-link:"Balloon Text";
=09font-family:"Tahoma","sans-serif";}
.MsoChpDefault
=09{mso-style-type:export-only;}
@page WordSection1
=09{size:8.5in 11.0in;
=09margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
=09{page:WordSection1;}
/* List Definitions */
@list l0
=09{mso-list-id:599684598;
=09mso-list-type:hybrid;
=09mso-list-template-ids:1243763380 67698689 67698691 67698693 67698689 676=
98691 67698693 67698689 67698691 67698693;}
@list l0:level1
=09{mso-level-number-format:bullet;
=09mso-level-text:\F0B7;
=09mso-level-tab-stop:none;
=09mso-level-number-position:left;
=09text-indent:-.25in;
=09font-family:Symbol;}
@list l0:level2
=09{mso-level-tab-stop:1.0in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level3
=09{mso-level-tab-stop:1.5in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level4
=09{mso-level-tab-stop:2.0in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level5
=09{mso-level-tab-stop:2.5in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level6
=09{mso-level-tab-stop:3.0in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level7
=09{mso-level-tab-stop:3.5in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level8
=09{mso-level-tab-stop:4.0in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level9
=09{mso-level-tab-stop:4.5in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
ol
=09{margin-bottom:0in;}
ul
=09{margin-bottom:0in;}
--></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=3DEN-US link=3Dblue vli=
nk=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal>Hi all (and Mr. =
Dunlap in particular),<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p>=
</p><p class=3DMsoNormal>I have a question about the credit (and ultimately=
 credit2) scheduler that I hope you can help me with.<o:p></o:p></p><p clas=
s=3DMsoNormal>&nbsp;<o:p></o:p></p><p class=3DMsoNormal>I have read the whi=
te paper &#8220;Scheduler development update&#8221; and as much material on=
 the credit scheduler as I can find, but I am still not completely clear on=
 how I should think about the cap.<o:p></o:p></p><p class=3DMsoNormal>&nbsp=
;<o:p></o:p></p><p class=3DMsoNormal>Example scenario:<o:p></o:p></p><p cla=
ss=3DMsoNormal>&nbsp;<o:p></o:p></p><ul style=3D'margin-top:0in' type=3Ddis=
c><li class=3DMsoNormal style=3D'mso-list:l0 level1 lfo1'>Server hardware: =
2 sockets, 8-cores per socket, 2 hardware threads per core (total of 32 har=
dware threads)<o:p></o:p></li><li class=3DMsoNormal style=3D'mso-list:l0 le=
vel1 lfo1'>Test VM: a single virtual machine with a single vCPU, weight=3D2=
56 and cap=3D100%<o:p></o:p></li></ul><p class=3DMsoNormal>&nbsp;<o:p></o:p=
></p><p class=3DMsoNormal>In this scenario, from what I understand, I shoul=
d be able to load the Test VM with traffic to a maximum of approximately 1/=
32 of the aggregate compute capacity of the server.&nbsp; The total CPU uti=
lization of the server hardware should be approximately 3.4%, plus the over=
head of dom0 (say 1-2).&nbsp; The credits available to any vCPU capped at 1=
00% should be equal to 1/32 of the aggregate compute available for the whol=
e server, correct?<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp;<o:p></o:=
p></p><p class=3DMsoNormal>Put simply, is there a way to constrain a VM wit=
h 1 vCPU to consume no more than 0.5 of a physical core (hyper-threaded) on=
 the server hardware mentioned below? Does the cap help in that respect?<o:=
p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>=
I have been struggling to understand how the scheduler can deal with the un=
certainty that hyperthreading introduces, however.&nbsp; I know this is an =
issue that you are tackling in the credit2 scheduler, but I would like to k=
now what your thoughts are on this problem (if you are able to share).&nbsp=
; Any insight or assistance you could offer would be greatly appreciated.&n=
bsp; <o:p></o:p></p><p class=3DMsoNormal>&nbsp;<o:p></o:p></p><p class=3DMs=
oNormal>Thanks very much and best regards,<o:p></o:p></p><p class=3DMsoNorm=
al>&nbsp;<o:p></o:p></p><p class=3DMsoNormal>- Mike<o:p></o:p></p><p class=
=3DMsoNormal><span style=3D'font-size:12.0pt;font-family:"Times New Roman",=
"serif"'><br></span><span style=3D'font-size:10.0pt;font-family:"Verdana","=
sans-serif";color:#666666'>Michael Palmeter | Sr. Director of Product Manag=
ement, Oracle <br></span><span style=3D'font-size:10.0pt;font-family:"Verda=
na","sans-serif";color:red'>Oracle</span><span style=3D'font-size:10.0pt;fo=
nt-family:"Verdana","sans-serif";color:#666666'> Development<br>200 Oracle =
Parkway | Redwood Shores, California 94065</span><span style=3D'font-size:1=
2.0pt;font-family:"Times New Roman","serif"'> </span><o:p></o:p></p></div><=
/body></html>
--__1352994236664154657abhmt102.oracle.com--


--===============6147949025237676406==
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.xen.org
http://lists.xen.org/xen-devel

--===============6147949025237676406==--


From xen-devel-bounces@lists.xen.org Thu Nov 15 15:44:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1br-0003km-JI; Thu, 15 Nov 2012 15:44:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <michael.palmeter@oracle.com>) id 1TZ1bp-0003kf-O6
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:44:06 +0000
Received: from [85.158.143.99:35398] by server-1.bemta-4.messagelabs.com id
	84/3E-27934-5CD05A05; Thu, 15 Nov 2012 15:44:05 +0000
X-Env-Sender: michael.palmeter@oracle.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352994242!29512236!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTUyOTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8956 invoked from network); 15 Nov 2012 15:44:03 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-3.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 15:44:03 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFFhvkL013217
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 15:43:58 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFFhuTb021635
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 15:43:57 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFFhuP4028258; Thu, 15 Nov 2012 09:43:56 -0600
MIME-Version: 1.0
Message-ID: <c58a9d3a-99e4-42ac-86c9-fbec600dee14@default>
Date: Thu, 15 Nov 2012 07:43:56 -0800 (PST)
From: Michael Palmeter <michael.palmeter@oracle.com>
To: xen-devel@lists.xen.org
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] Xen credit scheduler question
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6147949025237676406=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6147949025237676406==
Content-Type: multipart/alternative;
 boundary="__1352994236664154657abhmt102.oracle.com"

--__1352994236664154657abhmt102.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

Hi all (and Mr. Dunlap in particular),

=20

I have a question about the credit (and ultimately credit2) scheduler that =
I hope you can help me with.

=20

I have read the white paper "Scheduler development update" and as much mate=
rial on the credit scheduler as I can find, but I am still not completely c=
lear on how I should think about the cap.

=20

Example scenario:

=20

Server hardware: 2 sockets, 8-cores per socket, 2 hardware threads per core=
 (total of 32 hardware threads)
Test VM: a single virtual machine with a single vCPU, weight=3D256 and cap=
=3D100%

=20

In this scenario, from what I understand, I should be able to load the Test=
 VM with traffic to a maximum of approximately 1/32 of the aggregate comput=
e capacity of the server.  The total CPU utilization of the server hardware=
 should be approximately 3.4%, plus the overhead of dom0 (say 1-2).  The cr=
edits available to any vCPU capped at 100% should be equal to 1/32 of the a=
ggregate compute available for the whole server, correct?

 =20

Put simply, is there a way to constrain a VM with 1 vCPU to consume no more=
 than 0.5 of a physical core (hyper-threaded) on the server hardware mentio=
ned below? Does the cap help in that respect?

=20

I have been struggling to understand how the scheduler can deal with the un=
certainty that hyperthreading introduces, however.  I know this is an issue=
 that you are tackling in the credit2 scheduler, but I would like to know w=
hat your thoughts are on this problem (if you are able to share).  Any insi=
ght or assistance you could offer would be greatly appreciated. =20

=20

Thanks very much and best regards,

=20

- Mike


Michael Palmeter | Sr. Director of Product Management, Oracle=20
Oracle Development
200 Oracle Parkway | Redwood Shores, California 94065=20

--__1352994236664154657abhmt102.oracle.com
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-micr=
osoft-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=3D"Content-Type" CONTENT=
=3D"text/html; charset=3Dus-ascii"><meta name=3DGenerator content=3D"Micros=
oft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
=09{font-family:"Cambria Math";
=09panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
=09{font-family:Calibri;
=09panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
=09{font-family:Tahoma;
=09panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
=09{font-family:Verdana;
=09panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
=09{margin:0in;
=09margin-bottom:.0001pt;
=09font-size:11.0pt;
=09font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
=09{mso-style-priority:99;
=09color:blue;
=09text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
=09{mso-style-priority:99;
=09color:purple;
=09text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
=09{mso-style-priority:99;
=09mso-style-link:"Balloon Text Char";
=09margin:0in;
=09margin-bottom:.0001pt;
=09font-size:8.0pt;
=09font-family:"Tahoma","sans-serif";}
span.EmailStyle17
=09{mso-style-type:personal-compose;
=09font-family:"Calibri","sans-serif";
=09color:windowtext;}
span.BalloonTextChar
=09{mso-style-name:"Balloon Text Char";
=09mso-style-priority:99;
=09mso-style-link:"Balloon Text";
=09font-family:"Tahoma","sans-serif";}
.MsoChpDefault
=09{mso-style-type:export-only;}
@page WordSection1
=09{size:8.5in 11.0in;
=09margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
=09{page:WordSection1;}
/* List Definitions */
@list l0
=09{mso-list-id:599684598;
=09mso-list-type:hybrid;
=09mso-list-template-ids:1243763380 67698689 67698691 67698693 67698689 676=
98691 67698693 67698689 67698691 67698693;}
@list l0:level1
=09{mso-level-number-format:bullet;
=09mso-level-text:\F0B7;
=09mso-level-tab-stop:none;
=09mso-level-number-position:left;
=09text-indent:-.25in;
=09font-family:Symbol;}
@list l0:level2
=09{mso-level-tab-stop:1.0in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level3
=09{mso-level-tab-stop:1.5in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level4
=09{mso-level-tab-stop:2.0in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level5
=09{mso-level-tab-stop:2.5in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level6
=09{mso-level-tab-stop:3.0in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level7
=09{mso-level-tab-stop:3.5in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level8
=09{mso-level-tab-stop:4.0in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level9
=09{mso-level-tab-stop:4.5in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
ol
=09{margin-bottom:0in;}
ul
=09{margin-bottom:0in;}
--></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=3DEN-US link=3Dblue vli=
nk=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal>Hi all (and Mr. =
Dunlap in particular),<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p>=
</p><p class=3DMsoNormal>I have a question about the credit (and ultimately=
 credit2) scheduler that I hope you can help me with.<o:p></o:p></p><p clas=
s=3DMsoNormal>&nbsp;<o:p></o:p></p><p class=3DMsoNormal>I have read the whi=
te paper &#8220;Scheduler development update&#8221; and as much material on=
 the credit scheduler as I can find, but I am still not completely clear on=
 how I should think about the cap.<o:p></o:p></p><p class=3DMsoNormal>&nbsp=
;<o:p></o:p></p><p class=3DMsoNormal>Example scenario:<o:p></o:p></p><p cla=
ss=3DMsoNormal>&nbsp;<o:p></o:p></p><ul style=3D'margin-top:0in' type=3Ddis=
c><li class=3DMsoNormal style=3D'mso-list:l0 level1 lfo1'>Server hardware: =
2 sockets, 8-cores per socket, 2 hardware threads per core (total of 32 har=
dware threads)<o:p></o:p></li><li class=3DMsoNormal style=3D'mso-list:l0 le=
vel1 lfo1'>Test VM: a single virtual machine with a single vCPU, weight=3D2=
56 and cap=3D100%<o:p></o:p></li></ul><p class=3DMsoNormal>&nbsp;<o:p></o:p=
></p><p class=3DMsoNormal>In this scenario, from what I understand, I shoul=
d be able to load the Test VM with traffic to a maximum of approximately 1/=
32 of the aggregate compute capacity of the server.&nbsp; The total CPU uti=
lization of the server hardware should be approximately 3.4%, plus the over=
head of dom0 (say 1-2).&nbsp; The credits available to any vCPU capped at 1=
00% should be equal to 1/32 of the aggregate compute available for the whol=
e server, correct?<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp;<o:p></o:=
p></p><p class=3DMsoNormal>Put simply, is there a way to constrain a VM wit=
h 1 vCPU to consume no more than 0.5 of a physical core (hyper-threaded) on=
 the server hardware mentioned below? Does the cap help in that respect?<o:=
p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>=
I have been struggling to understand how the scheduler can deal with the un=
certainty that hyperthreading introduces, however.&nbsp; I know this is an =
issue that you are tackling in the credit2 scheduler, but I would like to k=
now what your thoughts are on this problem (if you are able to share).&nbsp=
; Any insight or assistance you could offer would be greatly appreciated.&n=
bsp; <o:p></o:p></p><p class=3DMsoNormal>&nbsp;<o:p></o:p></p><p class=3DMs=
oNormal>Thanks very much and best regards,<o:p></o:p></p><p class=3DMsoNorm=
al>&nbsp;<o:p></o:p></p><p class=3DMsoNormal>- Mike<o:p></o:p></p><p class=
=3DMsoNormal><span style=3D'font-size:12.0pt;font-family:"Times New Roman",=
"serif"'><br></span><span style=3D'font-size:10.0pt;font-family:"Verdana","=
sans-serif";color:#666666'>Michael Palmeter | Sr. Director of Product Manag=
ement, Oracle <br></span><span style=3D'font-size:10.0pt;font-family:"Verda=
na","sans-serif";color:red'>Oracle</span><span style=3D'font-size:10.0pt;fo=
nt-family:"Verdana","sans-serif";color:#666666'> Development<br>200 Oracle =
Parkway | Redwood Shores, California 94065</span><span style=3D'font-size:1=
2.0pt;font-family:"Times New Roman","serif"'> </span><o:p></o:p></p></div><=
/body></html>
--__1352994236664154657abhmt102.oracle.com--


--===============6147949025237676406==
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.xen.org
http://lists.xen.org/xen-devel

--===============6147949025237676406==--


From xen-devel-bounces@lists.xen.org Thu Nov 15 15:50:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:50:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1hs-0003vE-Eg; Thu, 15 Nov 2012 15:50:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <raistlin.df@gmail.com>) id 1TZ1hq-0003v9-UM
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:50:19 +0000
Received: from [85.158.138.51:56204] by server-14.bemta-3.messagelabs.com id
	C8/07-12788-A3F05A05; Thu, 15 Nov 2012 15:50:18 +0000
X-Env-Sender: raistlin.df@gmail.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1352994616!22250558!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16674 invoked from network); 15 Nov 2012 15:50:17 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 15:50:17 -0000
Received: by mail-ea0-f173.google.com with SMTP id i13so832704eaa.32
	for <xen-devel@lists.xen.org>; Thu, 15 Nov 2012 07:50:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:subject:from:to:cc:date:in-reply-to:references
	:content-type:x-mailer:mime-version;
	bh=Yv8shdb+U9Xfo1+DLI9J8ZWcEMNddliWQVRtRJSlwQc=;
	b=ozdCQWww14gb3P3k4uzK8ankYbBI5ciW1I/SrqIaA5NN5uLQRINoO72gD/BU8MsxQZ
	Cy6gIBq6jYDB3NJCWD+b72xrkiBVxIqkJn55G+jNaHyNPxpoulBTvUgWpzTcrYN5Ve35
	c1tApc264oiqea9Y0w43fEwsLCIYtZoI3nF3f4hIOtXcolB/lKB+amgRCD0zGM7eUZbq
	xDzsxzpX++qmVIJjT8jCjJ0oOwWDQMVdwU4s7kpJqK5pNbZClokm8ytSCmTIkvA7SlFx
	Xsj+9tv36UhvrsTBOKiO4iCy0pcSEetm43mp/ZiPitKNiuJTnIYodrugf+S89ZfG4QpT
	vu1A==
Received: by 10.14.193.134 with SMTP id k6mr5054705een.15.1352994616858;
	Thu, 15 Nov 2012 07:50:16 -0800 (PST)
Received: from [192.168.0.40] (ip-176-53.sn2.eutelia.it. [83.211.176.53])
	by mx.google.com with ESMTPS id f2sm36876934eep.2.2012.11.15.07.50.13
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 15 Nov 2012 07:50:14 -0800 (PST)
Message-ID: <1352994606.5351.54.camel@Solace>
From: Dario Faggioli <raistlin@linux.it>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Thu, 15 Nov 2012 16:50:06 +0100
In-Reply-To: <50A4DD95.5020107@eu.citrix.com>
References: <1350999260.5064.56.camel@Solace>
	<5086B4DF.6060701@eu.citrix.com> <1352981447.5351.51.camel@Solace>
	<50A4DD95.5020107@eu.citrix.com>
X-Mailer: Evolution 3.4.4-1
Mime-Version: 1.0
Cc: Keir Fraser <keir.xen@gmail.com>, Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] About vcpu wakeup and runq tickling in credit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5764231555700086058=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--===============5764231555700086058==
Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature";
	boundary="=-VwrTH+C7LkAoQg6FMWA8"


--=-VwrTH+C7LkAoQg6FMWA8
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, 2012-11-15 at 12:18 +0000, George Dunlap wrote:
> > So, in the vcpu-affinity case, if pcpu 3 get tickled, when it peeks at
> > pcpu 13's runq for work to steal it does not find anything suitable and
> > give up, leaving d51v1 in the runq even if there are idle pcpus on whic=
h
> > it could run, which is already bad.
> > In the node-affinity case, pcpu 3 will actually manage in stealing d51v=
1
> > and running it, even if there are idle pcpus with which it has
> > node-affinity, and thus defeating most of the benefits of the whole NUM=
A
> > aware scheduling thing (at least for some workloads).
>=20
> Maybe what we should do is do the wake-up based on who is likely to run=
=20
> on the current cpu: i.e., if "current" is likely to be pre-empted, look=
=20
> at idlers based on "current"'s mask; if "new" is likely to be put on the=
=20
> queue, look at idlers based on "new"'s mask.
>=20
EhEh, if you check  the whole thread, you'll find evidence that I
thought this to be a good idea from the very beginning. I've already a
patch for that, just let me see if numbers (with and without NUMA
scheduling) are aligned with impressions and then I'll send everything
together.

Thanks for your time,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-VwrTH+C7LkAoQg6FMWA8
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlClDy4ACgkQk4XaBE3IOsQ+NwCaA5kXUEYERYaSNQI0YfZxBuFc
L+AAnR0m8l+f0nV19lKZOmlVES/TfhvH
=RGIX
-----END PGP SIGNATURE-----

--=-VwrTH+C7LkAoQg6FMWA8--



--===============5764231555700086058==
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.xen.org
http://lists.xen.org/xen-devel

--===============5764231555700086058==--



From xen-devel-bounces@lists.xen.org Thu Nov 15 15:50:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 15:50:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ1hs-0003vE-Eg; Thu, 15 Nov 2012 15:50:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <raistlin.df@gmail.com>) id 1TZ1hq-0003v9-UM
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 15:50:19 +0000
Received: from [85.158.138.51:56204] by server-14.bemta-3.messagelabs.com id
	C8/07-12788-A3F05A05; Thu, 15 Nov 2012 15:50:18 +0000
X-Env-Sender: raistlin.df@gmail.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1352994616!22250558!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16674 invoked from network); 15 Nov 2012 15:50:17 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 15:50:17 -0000
Received: by mail-ea0-f173.google.com with SMTP id i13so832704eaa.32
	for <xen-devel@lists.xen.org>; Thu, 15 Nov 2012 07:50:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:subject:from:to:cc:date:in-reply-to:references
	:content-type:x-mailer:mime-version;
	bh=Yv8shdb+U9Xfo1+DLI9J8ZWcEMNddliWQVRtRJSlwQc=;
	b=ozdCQWww14gb3P3k4uzK8ankYbBI5ciW1I/SrqIaA5NN5uLQRINoO72gD/BU8MsxQZ
	Cy6gIBq6jYDB3NJCWD+b72xrkiBVxIqkJn55G+jNaHyNPxpoulBTvUgWpzTcrYN5Ve35
	c1tApc264oiqea9Y0w43fEwsLCIYtZoI3nF3f4hIOtXcolB/lKB+amgRCD0zGM7eUZbq
	xDzsxzpX++qmVIJjT8jCjJ0oOwWDQMVdwU4s7kpJqK5pNbZClokm8ytSCmTIkvA7SlFx
	Xsj+9tv36UhvrsTBOKiO4iCy0pcSEetm43mp/ZiPitKNiuJTnIYodrugf+S89ZfG4QpT
	vu1A==
Received: by 10.14.193.134 with SMTP id k6mr5054705een.15.1352994616858;
	Thu, 15 Nov 2012 07:50:16 -0800 (PST)
Received: from [192.168.0.40] (ip-176-53.sn2.eutelia.it. [83.211.176.53])
	by mx.google.com with ESMTPS id f2sm36876934eep.2.2012.11.15.07.50.13
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 15 Nov 2012 07:50:14 -0800 (PST)
Message-ID: <1352994606.5351.54.camel@Solace>
From: Dario Faggioli <raistlin@linux.it>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Thu, 15 Nov 2012 16:50:06 +0100
In-Reply-To: <50A4DD95.5020107@eu.citrix.com>
References: <1350999260.5064.56.camel@Solace>
	<5086B4DF.6060701@eu.citrix.com> <1352981447.5351.51.camel@Solace>
	<50A4DD95.5020107@eu.citrix.com>
X-Mailer: Evolution 3.4.4-1
Mime-Version: 1.0
Cc: Keir Fraser <keir.xen@gmail.com>, Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] About vcpu wakeup and runq tickling in credit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5764231555700086058=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--===============5764231555700086058==
Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature";
	boundary="=-VwrTH+C7LkAoQg6FMWA8"


--=-VwrTH+C7LkAoQg6FMWA8
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, 2012-11-15 at 12:18 +0000, George Dunlap wrote:
> > So, in the vcpu-affinity case, if pcpu 3 get tickled, when it peeks at
> > pcpu 13's runq for work to steal it does not find anything suitable and
> > give up, leaving d51v1 in the runq even if there are idle pcpus on whic=
h
> > it could run, which is already bad.
> > In the node-affinity case, pcpu 3 will actually manage in stealing d51v=
1
> > and running it, even if there are idle pcpus with which it has
> > node-affinity, and thus defeating most of the benefits of the whole NUM=
A
> > aware scheduling thing (at least for some workloads).
>=20
> Maybe what we should do is do the wake-up based on who is likely to run=
=20
> on the current cpu: i.e., if "current" is likely to be pre-empted, look=
=20
> at idlers based on "current"'s mask; if "new" is likely to be put on the=
=20
> queue, look at idlers based on "new"'s mask.
>=20
EhEh, if you check  the whole thread, you'll find evidence that I
thought this to be a good idea from the very beginning. I've already a
patch for that, just let me see if numbers (with and without NUMA
scheduling) are aligned with impressions and then I'll send everything
together.

Thanks for your time,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-VwrTH+C7LkAoQg6FMWA8
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlClDy4ACgkQk4XaBE3IOsQ+NwCaA5kXUEYERYaSNQI0YfZxBuFc
L+AAnR0m8l+f0nV19lKZOmlVES/TfhvH
=RGIX
-----END PGP SIGNATURE-----

--=-VwrTH+C7LkAoQg6FMWA8--



--===============5764231555700086058==
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.xen.org
http://lists.xen.org/xen-devel

--===============5764231555700086058==--



From xen-devel-bounces@lists.xen.org Thu Nov 15 16:16:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 16:16:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ27E-00052t-1l; Thu, 15 Nov 2012 16:16:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZ27B-00052o-Sc
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 16:16:30 +0000
Received: from [193.109.254.147:30992] by server-13.bemta-14.messagelabs.com
	id 8C/6F-11239-C5515A05; Thu, 15 Nov 2012 16:16:28 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352996184!3166545!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21693 invoked from network); 15 Nov 2012 16:16:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 16:16:24 -0000
X-IronPort-AV: E=Sophos;i="4.83,258,1352073600"; d="scan'208";a="15832678"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 16:16:24 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 16:16:23 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TZ275-00080Q-Qg;
	Thu, 15 Nov 2012 16:16:23 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TZ275-0001ex-BS;
	Thu, 15 Nov 2012 16:16:23 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14402-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 15 Nov 2012 16:16:23 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14402: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14402 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14402/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-amd64-pvops             4 kernel-build              fail REGR. vs. 14399
 build-i386-pvops              4 kernel-build              fail REGR. vs. 14399

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a

version targeted for testing:
 xen                  321f8487379b
baseline version:
 xen                  d1d05cb59a76

------------------------------------------------------------
People who touched revisions under test:
  Andre Przywara <osp@andrep.de>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Boris Ostrovsky <boris.ostrovsky@amd.com>
  Christoph Egger <Christoph_Egger@gmx.de>
  Ian Campbell <ian.campbell@citrix.com>
  Jim Fehlig <jfehlig@suse.com>
  Keir Fraser <keir@xen.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
  Wei Huang <wei.huang2@amd.com>
  Wei Wang <weiwang.dd@gmail.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            fail    
 build-i386-pvops                                             fail    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26160:321f8487379b
tag:         tip
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:29 2012 +0000
    
    xen/arm: wake up secondary cpus
    
    Secondary cpus are held by the firmware until we send an IPI to them.
    
    Reordered non-boot cpu wait loop to perform the check before waiting
    for an event, to handled the case where the event has already
    happened when we reach the loop.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26159:5718bbed558b
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:28 2012 +0000
    
    xen/arm: set the SMP bit in the ACTLR register
    
    "Enables the processor to receive instruction cache, BTB, and TLB maintenance
    operations from other processors"
    
    ...
    
    "You must set this bit before enabling the caches and MMU, or
    performing any cache and TLB maintenance operations. The only time
    you must clear this bit is during a processor power-down sequence"
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26158:999fae11df23
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:27 2012 +0000
    
    pl011: set baud and clock_hz to the right defaults for Versatile Express
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26157:2312d29744e3
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:26 2012 +0000
    
    xen/arm: setup the fixmap in head.S
    
    Setup the fixmap mapping directly in head.S rather than having a
    temporary mapping only to re-do it later in C.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26156:008726e63e7d
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:26 2012 +0000
    
    xen/arm: pass the correct bit-per-interrupt argument to vgic_irq_rank
    
    Use 1 for registers that have 1 bit per irq.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26155:babb84d9a82e
user:        Jim Fehlig <jfehlig@suse.com>
date:        Thu Nov 15 10:25:25 2012 +0000
    
    libxl: Fix passing of application data to timeout_deregister hook
    
    When deregistering a timeout, the address of application data was
    being passed to the timeout_deregister hook instead of the data
    itself.
    
    Signed-off-by: Jim Fehlig <jfehlig@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26154:b9b4456e12d1
user:        Andrew Cooper <andrew.cooper3@citrix.com>
date:        Thu Nov 15 09:54:38 2012 +0000
    
    x86/nmi: self_nmi() should not unconditionally enable interrupts
    
    It seems that all current callers have interrupts enabled, making the
    code currently safe but dangerous.  Also, fix a trailing whitespace
    issue.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Committed-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26153:f50e2f4278ab
user:        Andre Przywara <osp@andrep.de>
date:        Thu Nov 15 09:52:12 2012 +0000
    
    update MAINTAINERS file
    
    There have been some "organizational changes" within AMD.
    Update the MAINTAINERS file accordingly.
    Please also feel free to use the new email addresses if there are
    any inquires related to code authored by Wei Wang, Christoph Egger
    or Andre Przywara.
    
    Signed-off-by: Andre Przywara <osp@andrep.de>
    Acked-by: Wei Wang <weiwang.dd@gmail.com>
    Acked-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
    Acked-by: Wei Huang <wei.huang2@amd.com>
    Acked-by: Christoph Egger <Christoph_Egger@gmx.de>
    Committed-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26152:d1d05cb59a76
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Wed Nov 14 16:27:58 2012 +0000
    
    tools: rerun autoconf after 26144:170d45f7a2eb
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 16:16:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 16:16:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ27E-00052t-1l; Thu, 15 Nov 2012 16:16:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZ27B-00052o-Sc
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 16:16:30 +0000
Received: from [193.109.254.147:30992] by server-13.bemta-14.messagelabs.com
	id 8C/6F-11239-C5515A05; Thu, 15 Nov 2012 16:16:28 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1352996184!3166545!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21693 invoked from network); 15 Nov 2012 16:16:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 16:16:24 -0000
X-IronPort-AV: E=Sophos;i="4.83,258,1352073600"; d="scan'208";a="15832678"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 16:16:24 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 16:16:23 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TZ275-00080Q-Qg;
	Thu, 15 Nov 2012 16:16:23 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TZ275-0001ex-BS;
	Thu, 15 Nov 2012 16:16:23 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14402-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 15 Nov 2012 16:16:23 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14402: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14402 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14402/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-amd64-pvops             4 kernel-build              fail REGR. vs. 14399
 build-i386-pvops              4 kernel-build              fail REGR. vs. 14399

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a

version targeted for testing:
 xen                  321f8487379b
baseline version:
 xen                  d1d05cb59a76

------------------------------------------------------------
People who touched revisions under test:
  Andre Przywara <osp@andrep.de>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Boris Ostrovsky <boris.ostrovsky@amd.com>
  Christoph Egger <Christoph_Egger@gmx.de>
  Ian Campbell <ian.campbell@citrix.com>
  Jim Fehlig <jfehlig@suse.com>
  Keir Fraser <keir@xen.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
  Wei Huang <wei.huang2@amd.com>
  Wei Wang <weiwang.dd@gmail.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            fail    
 build-i386-pvops                                             fail    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26160:321f8487379b
tag:         tip
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:29 2012 +0000
    
    xen/arm: wake up secondary cpus
    
    Secondary cpus are held by the firmware until we send an IPI to them.
    
    Reordered non-boot cpu wait loop to perform the check before waiting
    for an event, to handled the case where the event has already
    happened when we reach the loop.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26159:5718bbed558b
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:28 2012 +0000
    
    xen/arm: set the SMP bit in the ACTLR register
    
    "Enables the processor to receive instruction cache, BTB, and TLB maintenance
    operations from other processors"
    
    ...
    
    "You must set this bit before enabling the caches and MMU, or
    performing any cache and TLB maintenance operations. The only time
    you must clear this bit is during a processor power-down sequence"
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26158:999fae11df23
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:27 2012 +0000
    
    pl011: set baud and clock_hz to the right defaults for Versatile Express
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26157:2312d29744e3
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:26 2012 +0000
    
    xen/arm: setup the fixmap in head.S
    
    Setup the fixmap mapping directly in head.S rather than having a
    temporary mapping only to re-do it later in C.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26156:008726e63e7d
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:26 2012 +0000
    
    xen/arm: pass the correct bit-per-interrupt argument to vgic_irq_rank
    
    Use 1 for registers that have 1 bit per irq.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26155:babb84d9a82e
user:        Jim Fehlig <jfehlig@suse.com>
date:        Thu Nov 15 10:25:25 2012 +0000
    
    libxl: Fix passing of application data to timeout_deregister hook
    
    When deregistering a timeout, the address of application data was
    being passed to the timeout_deregister hook instead of the data
    itself.
    
    Signed-off-by: Jim Fehlig <jfehlig@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26154:b9b4456e12d1
user:        Andrew Cooper <andrew.cooper3@citrix.com>
date:        Thu Nov 15 09:54:38 2012 +0000
    
    x86/nmi: self_nmi() should not unconditionally enable interrupts
    
    It seems that all current callers have interrupts enabled, making the
    code currently safe but dangerous.  Also, fix a trailing whitespace
    issue.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Committed-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26153:f50e2f4278ab
user:        Andre Przywara <osp@andrep.de>
date:        Thu Nov 15 09:52:12 2012 +0000
    
    update MAINTAINERS file
    
    There have been some "organizational changes" within AMD.
    Update the MAINTAINERS file accordingly.
    Please also feel free to use the new email addresses if there are
    any inquires related to code authored by Wei Wang, Christoph Egger
    or Andre Przywara.
    
    Signed-off-by: Andre Przywara <osp@andrep.de>
    Acked-by: Wei Wang <weiwang.dd@gmail.com>
    Acked-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
    Acked-by: Wei Huang <wei.huang2@amd.com>
    Acked-by: Christoph Egger <Christoph_Egger@gmx.de>
    Committed-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26152:d1d05cb59a76
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Wed Nov 14 16:27:58 2012 +0000
    
    tools: rerun autoconf after 26144:170d45f7a2eb
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 16:20:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 16:20:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ2AN-00059N-LU; Thu, 15 Nov 2012 16:19:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TZ2AL-00059D-RC
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 16:19:46 +0000
Received: from [85.158.143.99:32117] by server-2.bemta-4.messagelabs.com id
	C9/69-28922-F1615A05; Thu, 15 Nov 2012 16:19:43 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352996381!26716063!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODY1MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29352 invoked from network); 15 Nov 2012 16:19:42 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 16:19:42 -0000
X-IronPort-AV: E=Sophos;i="4.83,258,1352073600"; d="scan'208";a="214635440"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 16:19:26 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 11:19:25 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TZ2A1-0002hu-Ic;
	Thu, 15 Nov 2012 16:19:25 +0000
Date: Thu, 15 Nov 2012 16:18:51 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1352993683.3499.137.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211151536300.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-7-git-send-email-stefano.stabellini@eu.citrix.com>
	<1352974179.3499.83.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211151507100.28049@kaball.uk.xensource.com>
	<1352993683.3499.137.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 7/7] xen/arm: get the number of cpus from
	device tree
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 15 Nov 2012, Ian Campbell wrote:
> On Thu, 2012-11-15 at 15:26 +0000, Stefano Stabellini wrote:
> > On Thu, 15 Nov 2012, Ian Campbell wrote:
> > > On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> > > > diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> > > > index 3d1f0f4..5b6dab9 100644
> > > > --- a/xen/common/device_tree.c
> > > > +++ b/xen/common/device_tree.c
> > > > @@ -153,6 +153,25 @@ const char *device_tree_bootargs(const void *fdt)
> > > >      return prop->data;
> > > >  }
> > > >  
> > > > +int device_tree_cpus(const void *fdt)
> > > > +{
> > > > +    int node = 0, depth = 1;
> > > > +    int cpus = 0;
> > > > +
> > > > +    node = fdt_path_offset(fdt, "/cpus/cpu");
> > > > +    if ( node < 0 )
> > > > +        return 1; /* we have at least one cpu */
> > > > +
> > > > +    while ( node >= 0 && depth >= 0 ) {
> > > > +        if ( strncmp(fdt_get_name(fdt, node, NULL), "cpu", 3) )
> > > > +            continue;
> > > > +        node = fdt_next_node(fdt, node, &depth);
> > > > +        cpus++;
> > > 
> > > Do we not need to track the largest <n> for each cpu@<n> which we see,
> > > in order to handle systems with e.g. CPUs 0, 1, 4 & 5?
> > 
> > Actually the hardware ID is expressed by the <reg> propery.
> > Maybe we should set the corresponding ID in cpu_present_map from
> > device_tree_cpus?
> 
> I'm not sure what you mean.

I mean that it is not the @<num> that expresses the cpu number from the
hardware point of view.
The cpu number is held by the <reg> property of the cpu node.
Considering that the second cpu could theoretically have ID number 5, we
should go and mark cpu 1-4 as non present in the cpu masks. We should
only set cpu number 5 as present.

> > > There are some helpers in device_tree.c to walk over trees like this,
> > > are none of them suitable?
> >  
> > Do you mean device_tree_node_matches?
> > Yes, I can use that instead of strncmp. I'll do that.
> 
> You should , but that's not what I was talkig about ;-)
> 
> I was thinking of device_tree_for_each_node but I suppose that doesn't
> quite fit? But perhaps you can integrate with early_scan_node?

Maybe, but now that I think about it we should be matching on
device_type rather than node name. We should do the same for memory too.
We need to either change device_tree_node_matches or write a new
matching function.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 16:20:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 16:20:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ2AN-00059N-LU; Thu, 15 Nov 2012 16:19:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TZ2AL-00059D-RC
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 16:19:46 +0000
Received: from [85.158.143.99:32117] by server-2.bemta-4.messagelabs.com id
	C9/69-28922-F1615A05; Thu, 15 Nov 2012 16:19:43 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352996381!26716063!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODY1MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29352 invoked from network); 15 Nov 2012 16:19:42 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 16:19:42 -0000
X-IronPort-AV: E=Sophos;i="4.83,258,1352073600"; d="scan'208";a="214635440"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 16:19:26 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 11:19:25 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TZ2A1-0002hu-Ic;
	Thu, 15 Nov 2012 16:19:25 +0000
Date: Thu, 15 Nov 2012 16:18:51 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1352993683.3499.137.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211151536300.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-7-git-send-email-stefano.stabellini@eu.citrix.com>
	<1352974179.3499.83.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211151507100.28049@kaball.uk.xensource.com>
	<1352993683.3499.137.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 7/7] xen/arm: get the number of cpus from
	device tree
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 15 Nov 2012, Ian Campbell wrote:
> On Thu, 2012-11-15 at 15:26 +0000, Stefano Stabellini wrote:
> > On Thu, 15 Nov 2012, Ian Campbell wrote:
> > > On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> > > > diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> > > > index 3d1f0f4..5b6dab9 100644
> > > > --- a/xen/common/device_tree.c
> > > > +++ b/xen/common/device_tree.c
> > > > @@ -153,6 +153,25 @@ const char *device_tree_bootargs(const void *fdt)
> > > >      return prop->data;
> > > >  }
> > > >  
> > > > +int device_tree_cpus(const void *fdt)
> > > > +{
> > > > +    int node = 0, depth = 1;
> > > > +    int cpus = 0;
> > > > +
> > > > +    node = fdt_path_offset(fdt, "/cpus/cpu");
> > > > +    if ( node < 0 )
> > > > +        return 1; /* we have at least one cpu */
> > > > +
> > > > +    while ( node >= 0 && depth >= 0 ) {
> > > > +        if ( strncmp(fdt_get_name(fdt, node, NULL), "cpu", 3) )
> > > > +            continue;
> > > > +        node = fdt_next_node(fdt, node, &depth);
> > > > +        cpus++;
> > > 
> > > Do we not need to track the largest <n> for each cpu@<n> which we see,
> > > in order to handle systems with e.g. CPUs 0, 1, 4 & 5?
> > 
> > Actually the hardware ID is expressed by the <reg> propery.
> > Maybe we should set the corresponding ID in cpu_present_map from
> > device_tree_cpus?
> 
> I'm not sure what you mean.

I mean that it is not the @<num> that expresses the cpu number from the
hardware point of view.
The cpu number is held by the <reg> property of the cpu node.
Considering that the second cpu could theoretically have ID number 5, we
should go and mark cpu 1-4 as non present in the cpu masks. We should
only set cpu number 5 as present.

> > > There are some helpers in device_tree.c to walk over trees like this,
> > > are none of them suitable?
> >  
> > Do you mean device_tree_node_matches?
> > Yes, I can use that instead of strncmp. I'll do that.
> 
> You should , but that's not what I was talkig about ;-)
> 
> I was thinking of device_tree_for_each_node but I suppose that doesn't
> quite fit? But perhaps you can integrate with early_scan_node?

Maybe, but now that I think about it we should be matching on
device_type rather than node name. We should do the same for memory too.
We need to either change device_tree_node_matches or write a new
matching function.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 16:27:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 16:27:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ2Hq-0005Uf-2P; Thu, 15 Nov 2012 16:27:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZ2Ho-0005Ua-Ub
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 16:27:29 +0000
Received: from [85.158.143.35:50774] by server-2.bemta-4.messagelabs.com id
	39/D3-28922-FE715A05; Thu, 15 Nov 2012 16:27:27 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1352996840!15400847!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30054 invoked from network); 15 Nov 2012 16:27:22 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 16:27:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,258,1352073600"; d="scan'208";a="15833008"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 16:27:19 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 16:27:19 +0000
Message-ID: <1352996837.3499.153.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 15 Nov 2012 16:27:17 +0000
In-Reply-To: <alpine.DEB.2.02.1211151536300.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-7-git-send-email-stefano.stabellini@eu.citrix.com>
	<1352974179.3499.83.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211151507100.28049@kaball.uk.xensource.com>
	<1352993683.3499.137.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211151536300.28049@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 7/7] xen/arm: get the number of cpus from
	device tree
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 16:18 +0000, Stefano Stabellini wrote:
> On Thu, 15 Nov 2012, Ian Campbell wrote:
> > On Thu, 2012-11-15 at 15:26 +0000, Stefano Stabellini wrote:
> > > On Thu, 15 Nov 2012, Ian Campbell wrote:
> > > > On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> > > > > diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> > > > > index 3d1f0f4..5b6dab9 100644
> > > > > --- a/xen/common/device_tree.c
> > > > > +++ b/xen/common/device_tree.c
> > > > > @@ -153,6 +153,25 @@ const char *device_tree_bootargs(const void *fdt)
> > > > >      return prop->data;
> > > > >  }
> > > > >  
> > > > > +int device_tree_cpus(const void *fdt)
> > > > > +{
> > > > > +    int node = 0, depth = 1;
> > > > > +    int cpus = 0;
> > > > > +
> > > > > +    node = fdt_path_offset(fdt, "/cpus/cpu");
> > > > > +    if ( node < 0 )
> > > > > +        return 1; /* we have at least one cpu */
> > > > > +
> > > > > +    while ( node >= 0 && depth >= 0 ) {
> > > > > +        if ( strncmp(fdt_get_name(fdt, node, NULL), "cpu", 3) )
> > > > > +            continue;
> > > > > +        node = fdt_next_node(fdt, node, &depth);
> > > > > +        cpus++;
> > > > 
> > > > Do we not need to track the largest <n> for each cpu@<n> which we see,
> > > > in order to handle systems with e.g. CPUs 0, 1, 4 & 5?
> > > 
> > > Actually the hardware ID is expressed by the <reg> propery.
> > > Maybe we should set the corresponding ID in cpu_present_map from
> > > device_tree_cpus?
> > 
> > I'm not sure what you mean.
> 
> I mean that it is not the @<num> that expresses the cpu number from the
> hardware point of view.
> The cpu number is held by the <reg> property of the cpu node.
> Considering that the second cpu could theoretically have ID number 5, we
> should go and mark cpu 1-4 as non present in the cpu masks. We should
> only set cpu number 5 as present.

I think that makes sense, unless we want to construct a logic->physical
CPU numbering scheme for some other reason.

> > > > There are some helpers in device_tree.c to walk over trees like this,
> > > > are none of them suitable?
> > >  
> > > Do you mean device_tree_node_matches?
> > > Yes, I can use that instead of strncmp. I'll do that.
> > 
> > You should , but that's not what I was talkig about ;-)
> > 
> > I was thinking of device_tree_for_each_node but I suppose that doesn't
> > quite fit? But perhaps you can integrate with early_scan_node?
> 
> Maybe, but now that I think about it we should be matching on
> device_type rather than node name.

I've no idea what this means, but I trust you ;-)

>  We should do the same for memory too.
> We need to either change device_tree_node_matches or write a new
> matching function.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 16:27:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 16:27:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ2Hq-0005Uf-2P; Thu, 15 Nov 2012 16:27:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZ2Ho-0005Ua-Ub
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 16:27:29 +0000
Received: from [85.158.143.35:50774] by server-2.bemta-4.messagelabs.com id
	39/D3-28922-FE715A05; Thu, 15 Nov 2012 16:27:27 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1352996840!15400847!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30054 invoked from network); 15 Nov 2012 16:27:22 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 16:27:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,258,1352073600"; d="scan'208";a="15833008"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 16:27:19 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 16:27:19 +0000
Message-ID: <1352996837.3499.153.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 15 Nov 2012 16:27:17 +0000
In-Reply-To: <alpine.DEB.2.02.1211151536300.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-7-git-send-email-stefano.stabellini@eu.citrix.com>
	<1352974179.3499.83.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211151507100.28049@kaball.uk.xensource.com>
	<1352993683.3499.137.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211151536300.28049@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH 7/7] xen/arm: get the number of cpus from
	device tree
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 16:18 +0000, Stefano Stabellini wrote:
> On Thu, 15 Nov 2012, Ian Campbell wrote:
> > On Thu, 2012-11-15 at 15:26 +0000, Stefano Stabellini wrote:
> > > On Thu, 15 Nov 2012, Ian Campbell wrote:
> > > > On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> > > > > diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> > > > > index 3d1f0f4..5b6dab9 100644
> > > > > --- a/xen/common/device_tree.c
> > > > > +++ b/xen/common/device_tree.c
> > > > > @@ -153,6 +153,25 @@ const char *device_tree_bootargs(const void *fdt)
> > > > >      return prop->data;
> > > > >  }
> > > > >  
> > > > > +int device_tree_cpus(const void *fdt)
> > > > > +{
> > > > > +    int node = 0, depth = 1;
> > > > > +    int cpus = 0;
> > > > > +
> > > > > +    node = fdt_path_offset(fdt, "/cpus/cpu");
> > > > > +    if ( node < 0 )
> > > > > +        return 1; /* we have at least one cpu */
> > > > > +
> > > > > +    while ( node >= 0 && depth >= 0 ) {
> > > > > +        if ( strncmp(fdt_get_name(fdt, node, NULL), "cpu", 3) )
> > > > > +            continue;
> > > > > +        node = fdt_next_node(fdt, node, &depth);
> > > > > +        cpus++;
> > > > 
> > > > Do we not need to track the largest <n> for each cpu@<n> which we see,
> > > > in order to handle systems with e.g. CPUs 0, 1, 4 & 5?
> > > 
> > > Actually the hardware ID is expressed by the <reg> propery.
> > > Maybe we should set the corresponding ID in cpu_present_map from
> > > device_tree_cpus?
> > 
> > I'm not sure what you mean.
> 
> I mean that it is not the @<num> that expresses the cpu number from the
> hardware point of view.
> The cpu number is held by the <reg> property of the cpu node.
> Considering that the second cpu could theoretically have ID number 5, we
> should go and mark cpu 1-4 as non present in the cpu masks. We should
> only set cpu number 5 as present.

I think that makes sense, unless we want to construct a logic->physical
CPU numbering scheme for some other reason.

> > > > There are some helpers in device_tree.c to walk over trees like this,
> > > > are none of them suitable?
> > >  
> > > Do you mean device_tree_node_matches?
> > > Yes, I can use that instead of strncmp. I'll do that.
> > 
> > You should , but that's not what I was talkig about ;-)
> > 
> > I was thinking of device_tree_for_each_node but I suppose that doesn't
> > quite fit? But perhaps you can integrate with early_scan_node?
> 
> Maybe, but now that I think about it we should be matching on
> device_type rather than node name.

I've no idea what this means, but I trust you ;-)

>  We should do the same for memory too.
> We need to either change device_tree_node_matches or write a new
> matching function.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 16:42:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 16:42:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ2W9-0005r4-KE; Thu, 15 Nov 2012 16:42:17 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TZ2W7-0005qz-NA
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 16:42:15 +0000
Received: from [193.109.254.147:14380] by server-11.bemta-14.messagelabs.com
	id 75/61-29027-66B15A05; Thu, 15 Nov 2012 16:42:14 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-16.tower-27.messagelabs.com!1352997730!9844285!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19807 invoked from network); 15 Nov 2012 16:42:12 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-16.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 16:42:12 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TZ2Vp-000Keb-1P; Thu, 15 Nov 2012 16:41:57 +0000
Date: Thu, 15 Nov 2012 16:41:56 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121115164156.GE75988@ocelot.phlegethon.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A37B1802000078000A86D5@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>, eddie.dong@intel.com,
	Ian.Campbell@citrix.com, jun.nakajima@intel.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
	real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi, 

At 10:06 +0000 on 14 Nov (1352887560), Jan Beulich wrote:
> > +            asm volatile("int $2"); /* Real NMI, vector 2: normal processing */
> 
> And I still don't like this use of "int $2" here: An aspect we didn't
> consider so far is that a nested MCE would break things again

OK, I think I understand the problem[s], but I'm going to spell it out
slowly so you can correct me. :)

[ tl;dr I agree that do_nmi() is better, and we should do that in this
  patch, but maybe we need to solve the general problem too. ]

On a PV guest, we have to use dedicated stacks for NMI and MCE in case
either of those things happens just before SYSRET when we're on the user
stack (no other interrupt or exception can happen at that point).

On an AMD CPU we _don't_ have dedicated stacks for NMI or MCE when we're
running a HVM guest, so the stack issue doesn't apply (but nested NMIs
are still bad).

On an Intel CPU, we _do_ use dedicated stacks for NMI and MCE in HVM
guests.  We don't really have to but it saves time in the context switch
not to update the IDT.  Using do_nmi() here means that the first NMI is
handled on the normal stack instead.  It's also consistent with the way
we call do_machine_check() for the MCE case.  But it needs an explicit
IRET after the call to do_nmi() to make sure that NMIs get re-enabled.

These dedicated stacks make the general problem of re-entrant MCE/NMI
worse.  In the general case those handlers don't expect to be called in
a reentrant way, but blatting the stack turns a possible problem into a
definite one.

---

All of this would be moot except for the risk that we might take an MCE
while in the NMI handler.  The IRET from the MCE handler re-enables NMIs
while we're still in the NMI handler, and a second NMI arriving could
break the NMI handler.  In the PV case, it will also clobber the NMI
handler's stack.  In the VMX case we would need to see something like
(NMI (MCE) (NMI (MCE) (NMI))) for that to happen, but it could.

The inverse case, taking an NMI while in the MCE handler, is not very
interesting.  There's no masking of MCEs so that handler already has to
deal with nested entry, and the IRET from the NMI handler has no effect.

We could potentially solve the problem by having the MCE handler check
whether it's returning to the NMI stack, and do a normal return in that
case.  It's a bit of extra code but only in the MCE handler, which is
not performance-critical. 

If we do that, then the choice of 'int $2' vs 'do_nmi(); fake_iret()'
is mostly one of taste.  do_nmi() saves an IDT indirection but
unbalances the call/return stack.  I slightly prefer 'int $2' just
because it makes the PV and non-PV cases more similar.

But first, we should take the current fix, with do_nmi() and iret() 
instead of 'int $2'.  The nested-MCE issue can be handled separately.

Does that make sense?

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 16:42:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 16:42:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ2W9-0005r4-KE; Thu, 15 Nov 2012 16:42:17 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TZ2W7-0005qz-NA
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 16:42:15 +0000
Received: from [193.109.254.147:14380] by server-11.bemta-14.messagelabs.com
	id 75/61-29027-66B15A05; Thu, 15 Nov 2012 16:42:14 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-16.tower-27.messagelabs.com!1352997730!9844285!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19807 invoked from network); 15 Nov 2012 16:42:12 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-16.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 16:42:12 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TZ2Vp-000Keb-1P; Thu, 15 Nov 2012 16:41:57 +0000
Date: Thu, 15 Nov 2012 16:41:56 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121115164156.GE75988@ocelot.phlegethon.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A37B1802000078000A86D5@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>, eddie.dong@intel.com,
	Ian.Campbell@citrix.com, jun.nakajima@intel.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
	real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi, 

At 10:06 +0000 on 14 Nov (1352887560), Jan Beulich wrote:
> > +            asm volatile("int $2"); /* Real NMI, vector 2: normal processing */
> 
> And I still don't like this use of "int $2" here: An aspect we didn't
> consider so far is that a nested MCE would break things again

OK, I think I understand the problem[s], but I'm going to spell it out
slowly so you can correct me. :)

[ tl;dr I agree that do_nmi() is better, and we should do that in this
  patch, but maybe we need to solve the general problem too. ]

On a PV guest, we have to use dedicated stacks for NMI and MCE in case
either of those things happens just before SYSRET when we're on the user
stack (no other interrupt or exception can happen at that point).

On an AMD CPU we _don't_ have dedicated stacks for NMI or MCE when we're
running a HVM guest, so the stack issue doesn't apply (but nested NMIs
are still bad).

On an Intel CPU, we _do_ use dedicated stacks for NMI and MCE in HVM
guests.  We don't really have to but it saves time in the context switch
not to update the IDT.  Using do_nmi() here means that the first NMI is
handled on the normal stack instead.  It's also consistent with the way
we call do_machine_check() for the MCE case.  But it needs an explicit
IRET after the call to do_nmi() to make sure that NMIs get re-enabled.

These dedicated stacks make the general problem of re-entrant MCE/NMI
worse.  In the general case those handlers don't expect to be called in
a reentrant way, but blatting the stack turns a possible problem into a
definite one.

---

All of this would be moot except for the risk that we might take an MCE
while in the NMI handler.  The IRET from the MCE handler re-enables NMIs
while we're still in the NMI handler, and a second NMI arriving could
break the NMI handler.  In the PV case, it will also clobber the NMI
handler's stack.  In the VMX case we would need to see something like
(NMI (MCE) (NMI (MCE) (NMI))) for that to happen, but it could.

The inverse case, taking an NMI while in the MCE handler, is not very
interesting.  There's no masking of MCEs so that handler already has to
deal with nested entry, and the IRET from the NMI handler has no effect.

We could potentially solve the problem by having the MCE handler check
whether it's returning to the NMI stack, and do a normal return in that
case.  It's a bit of extra code but only in the MCE handler, which is
not performance-critical. 

If we do that, then the choice of 'int $2' vs 'do_nmi(); fake_iret()'
is mostly one of taste.  do_nmi() saves an IDT indirection but
unbalances the call/return stack.  I slightly prefer 'int $2' just
because it makes the PV and non-PV cases more similar.

But first, we should take the current fix, with do_nmi() and iret() 
instead of 'int $2'.  The nested-MCE issue can be handled separately.

Does that make sense?

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 16:47:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 16:47:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ2aS-000632-CF; Thu, 15 Nov 2012 16:46:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <carnold@suse.com>) id 1TZ2aQ-00062v-Qd
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 16:46:43 +0000
Received: from [85.158.143.35:4664] by server-1.bemta-4.messagelabs.com id
	8F/D5-27934-27C15A05; Thu, 15 Nov 2012 16:46:42 +0000
X-Env-Sender: carnold@suse.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1352997999!17938817!1
X-Originating-IP: [137.65.248.74]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16786 invoked from network); 15 Nov 2012 16:46:39 -0000
Received: from novprvoes0310.provo.novell.com (HELO
	novprvoes0310.provo.novell.com) (137.65.248.74)
	by server-14.tower-21.messagelabs.com with SMTP;
	15 Nov 2012 16:46:39 -0000
Received: from INET-PRV-MTA by novprvoes0310.provo.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 09:46:37 -0700
Message-Id: <50A4B9FB0200009100083093@novprvoes0310.provo.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 15 Nov 2012 09:46:35 -0700
From: "Charles Arnold" <carnold@suse.com>
To: "Thanos Makatos" <thanos.makatos@citrix.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>
References: <50A0E79F0200009100082E4C@novprvoes0310.provo.novell.com>
	<50A2250A.4070108@redhat.com>
	<alpine.DEB.2.02.1211131054200.28049@kaball.uk.xensource.com>
	<4B45B535F7F6BE4CB1C044ED5115CDDE012D550D234B@LONPMAILBOX01.citrite.net>
	<50A3C853.4010809@redhat.com>
In-Reply-To: <50A3C853.4010809@redhat.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Kevin Wolf <kwolf@redhat.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"stefanha@redhat.com" <stefanha@redhat.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] block: vpc support for ~2 TB disks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 11/14/2012 at 09:35 AM, in message <50A3C853.4010809@redhat.com>, Paolo
Bonzini <pbonzini@redhat.com> wrote: 
> Il 14/11/2012 17:25, Thanos Makatos ha scritto:
>> We don't use qemu's VHD driver in XenServer. Instead, we use blktap2
>> to create a block device in dom0 serving the VHD file in question,
>> and have qemu open that block device instead of the VHD file itself.
> 
> Yes, the question is how you handle disks bigger than 127GB, so that
> QEMU can do the same.
> 

In analyzing a 160 GB VHD fixed disk image created on Windows 2008 R2, it appears that
MS is also ignoring the CHS values in the footer geometry field in whatever
driver they use for accessing the image.  The CHS values are set at 65535,16,255
which obviously doesn't represent an image size of 160 GB.

This patch only extends the existing qemu driver to allow a larger image by allowing
more heads.  On real hardware, only 4 bits would be allowed for heads but we don't
have that restriction in qemu. 

- Charles



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 16:47:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 16:47:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ2aS-000632-CF; Thu, 15 Nov 2012 16:46:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <carnold@suse.com>) id 1TZ2aQ-00062v-Qd
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 16:46:43 +0000
Received: from [85.158.143.35:4664] by server-1.bemta-4.messagelabs.com id
	8F/D5-27934-27C15A05; Thu, 15 Nov 2012 16:46:42 +0000
X-Env-Sender: carnold@suse.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1352997999!17938817!1
X-Originating-IP: [137.65.248.74]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16786 invoked from network); 15 Nov 2012 16:46:39 -0000
Received: from novprvoes0310.provo.novell.com (HELO
	novprvoes0310.provo.novell.com) (137.65.248.74)
	by server-14.tower-21.messagelabs.com with SMTP;
	15 Nov 2012 16:46:39 -0000
Received: from INET-PRV-MTA by novprvoes0310.provo.novell.com
	with Novell_GroupWise; Thu, 15 Nov 2012 09:46:37 -0700
Message-Id: <50A4B9FB0200009100083093@novprvoes0310.provo.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 15 Nov 2012 09:46:35 -0700
From: "Charles Arnold" <carnold@suse.com>
To: "Thanos Makatos" <thanos.makatos@citrix.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>
References: <50A0E79F0200009100082E4C@novprvoes0310.provo.novell.com>
	<50A2250A.4070108@redhat.com>
	<alpine.DEB.2.02.1211131054200.28049@kaball.uk.xensource.com>
	<4B45B535F7F6BE4CB1C044ED5115CDDE012D550D234B@LONPMAILBOX01.citrite.net>
	<50A3C853.4010809@redhat.com>
In-Reply-To: <50A3C853.4010809@redhat.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Kevin Wolf <kwolf@redhat.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"stefanha@redhat.com" <stefanha@redhat.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] block: vpc support for ~2 TB disks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 11/14/2012 at 09:35 AM, in message <50A3C853.4010809@redhat.com>, Paolo
Bonzini <pbonzini@redhat.com> wrote: 
> Il 14/11/2012 17:25, Thanos Makatos ha scritto:
>> We don't use qemu's VHD driver in XenServer. Instead, we use blktap2
>> to create a block device in dom0 serving the VHD file in question,
>> and have qemu open that block device instead of the VHD file itself.
> 
> Yes, the question is how you handle disks bigger than 127GB, so that
> QEMU can do the same.
> 

In analyzing a 160 GB VHD fixed disk image created on Windows 2008 R2, it appears that
MS is also ignoring the CHS values in the footer geometry field in whatever
driver they use for accessing the image.  The CHS values are set at 65535,16,255
which obviously doesn't represent an image size of 160 GB.

This patch only extends the existing qemu driver to allow a larger image by allowing
more heads.  On real hardware, only 4 bits would be allowed for heads but we don't
have that restriction in qemu. 

- Charles



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 16:48:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 16:48:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ2bi-00069T-1j; Thu, 15 Nov 2012 16:48:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TZ2bg-00069M-Np
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 16:48:01 +0000
Received: from [85.158.137.99:41997] by server-10.bemta-3.messagelabs.com id
	23/6B-19806-FBC15A05; Thu, 15 Nov 2012 16:47:59 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352998078!19152483!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODY1MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27241 invoked from network); 15 Nov 2012 16:47:59 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-14.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 16:47:59 -0000
X-IronPort-AV: E=Sophos;i="4.83,258,1352073600"; d="scan'208";a="214640925"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 16:46:52 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 11:46:52 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TZ2aa-00039s-0g;
	Thu, 15 Nov 2012 16:46:52 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 16:41:16 +0000
Message-ID: <1352997676-10704-1-git-send-email-george.dunlap@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
MIME-Version: 1.0
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Subject: [Xen-devel] [PATCH] Clean up minor inconsistency re public
	disclosure
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Include a summary of both kinds of e-mail which may be sent to the
pre-disclosure list in the "Pre-disclosure list" section, before the
discussion of what is expected of pre-disclosure list members.  Also
make it consistently clear that the public disclosure will always be
sent to the pre-disclosure list.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 security_vulnerability_process.html |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/security_vulnerability_process.html b/security_vulnerability_process.html
index 568279d..e305371 100644
--- a/security_vulnerability_process.html
+++ b/security_vulnerability_process.html
@@ -141,9 +141,7 @@ if(ns4)_d.write("<scr"+"ipt type=text/javascript src=/globals/mmenuns4.js><\/scr
     <p>Public advisories will be posted to xen-devel,
        xen-users and xen-annnounce and will be added to the
        <a href="http://wiki.xen.org/wiki/Security_Announcements">Security Announcements wiki page</a>.</p>
-    <p>Copies will also be sent to the pre-disclosure list, unless
-       the advisory was already sent there previously during the embargo
-       period and has not been updated since.</p>
+    <p>Copies will also be sent to the pre-disclosure list.</p>
     </li>
 
     <li><p><b>Updates</b></p>
@@ -208,6 +206,11 @@ if(ns4)_d.write("<scr"+"ipt type=text/javascript src=/globals/mmenuns4.js><\/scr
     a case-by-case basis.</p>    
     <p>The list of entities on the pre-disclosure list is public. (Just the list
     of projects and organisations, not the actual email addresses.)</p>  
+    <p>If there is an embargo, the pre-disclosure list will receive
+    copies of the advisory and patches, with a clearly marked embargo
+    date, as soon as they are available.  The pre-disclosure list will
+    also receive copies of public advisories when they are first
+    issued or updated.</p>
     <p>Pre-disclosure list members are expected to maintain the confidentiality
     of the vulnerability up to the embargo date which security@xen have agreed
     with the discoverer.</p>    
@@ -229,7 +232,6 @@ if(ns4)_d.write("<scr"+"ipt type=text/javascript src=/globals/mmenuns4.js><\/scr
     <p>Organisations who meet the criteria should contact security@xen if they wish to receive pre-disclosure of advisories. Organisations should not request subscription via the mailing list web interface, any such subscription requests will be rejected and ignored.</p>
     <p>Normally we would prefer that a role address be used for each organisation, rather than one or more individual's direct email address. This helps to ensure that changes of personnel do not end up effectively dropping an organisation from the list</p>
 
-    <p>The pre-disclosure list will also receive copies of public advisories when they are first issued or updated.</p>
     
     <h3>Organizations on the pre-disclosure list:</h3>
     <p>This is a list of organisations on the pre-disclosure list
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 16:48:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 16:48:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ2bi-00069T-1j; Thu, 15 Nov 2012 16:48:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TZ2bg-00069M-Np
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 16:48:01 +0000
Received: from [85.158.137.99:41997] by server-10.bemta-3.messagelabs.com id
	23/6B-19806-FBC15A05; Thu, 15 Nov 2012 16:47:59 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1352998078!19152483!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODY1MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27241 invoked from network); 15 Nov 2012 16:47:59 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-14.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 16:47:59 -0000
X-IronPort-AV: E=Sophos;i="4.83,258,1352073600"; d="scan'208";a="214640925"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 16:46:52 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 11:46:52 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TZ2aa-00039s-0g;
	Thu, 15 Nov 2012 16:46:52 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 16:41:16 +0000
Message-ID: <1352997676-10704-1-git-send-email-george.dunlap@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
MIME-Version: 1.0
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Subject: [Xen-devel] [PATCH] Clean up minor inconsistency re public
	disclosure
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Include a summary of both kinds of e-mail which may be sent to the
pre-disclosure list in the "Pre-disclosure list" section, before the
discussion of what is expected of pre-disclosure list members.  Also
make it consistently clear that the public disclosure will always be
sent to the pre-disclosure list.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 security_vulnerability_process.html |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/security_vulnerability_process.html b/security_vulnerability_process.html
index 568279d..e305371 100644
--- a/security_vulnerability_process.html
+++ b/security_vulnerability_process.html
@@ -141,9 +141,7 @@ if(ns4)_d.write("<scr"+"ipt type=text/javascript src=/globals/mmenuns4.js><\/scr
     <p>Public advisories will be posted to xen-devel,
        xen-users and xen-annnounce and will be added to the
        <a href="http://wiki.xen.org/wiki/Security_Announcements">Security Announcements wiki page</a>.</p>
-    <p>Copies will also be sent to the pre-disclosure list, unless
-       the advisory was already sent there previously during the embargo
-       period and has not been updated since.</p>
+    <p>Copies will also be sent to the pre-disclosure list.</p>
     </li>
 
     <li><p><b>Updates</b></p>
@@ -208,6 +206,11 @@ if(ns4)_d.write("<scr"+"ipt type=text/javascript src=/globals/mmenuns4.js><\/scr
     a case-by-case basis.</p>    
     <p>The list of entities on the pre-disclosure list is public. (Just the list
     of projects and organisations, not the actual email addresses.)</p>  
+    <p>If there is an embargo, the pre-disclosure list will receive
+    copies of the advisory and patches, with a clearly marked embargo
+    date, as soon as they are available.  The pre-disclosure list will
+    also receive copies of public advisories when they are first
+    issued or updated.</p>
     <p>Pre-disclosure list members are expected to maintain the confidentiality
     of the vulnerability up to the embargo date which security@xen have agreed
     with the discoverer.</p>    
@@ -229,7 +232,6 @@ if(ns4)_d.write("<scr"+"ipt type=text/javascript src=/globals/mmenuns4.js><\/scr
     <p>Organisations who meet the criteria should contact security@xen if they wish to receive pre-disclosure of advisories. Organisations should not request subscription via the mailing list web interface, any such subscription requests will be rejected and ignored.</p>
     <p>Normally we would prefer that a role address be used for each organisation, rather than one or more individual's direct email address. This helps to ensure that changes of personnel do not end up effectively dropping an organisation from the list</p>
 
-    <p>The pre-disclosure list will also receive copies of public advisories when they are first issued or updated.</p>
     
     <h3>Organizations on the pre-disclosure list:</h3>
     <p>This is a list of organisations on the pre-disclosure list
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 16:54:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 16:54:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ2hc-0006Uo-Ry; Thu, 15 Nov 2012 16:54:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TZ2hb-0006Ui-Bl
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 16:54:07 +0000
Received: from [85.158.137.99:38274] by server-4.bemta-3.messagelabs.com id
	36/19-30023-E2E15A05; Thu, 15 Nov 2012 16:54:06 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1352998443!16115675!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM4MzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11744 invoked from network); 15 Nov 2012 16:54:05 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 16:54:05 -0000
X-IronPort-AV: E=Sophos;i="4.83,258,1352073600"; d="scan'208";a="44735129"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 16:52:27 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 11:52:20 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TZ2fs-0003Er-Or;
	Thu, 15 Nov 2012 16:52:20 +0000
Message-ID: <50A51DC4.7040205@citrix.com>
Date: Thu, 15 Nov 2012 16:52:20 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
In-Reply-To: <20121115164156.GE75988@ocelot.phlegethon.org>
X-Enigmail-Version: 1.4.6
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	xen-devel <xen-devel@lists.xen.org>, Jan Beulich <JBeulich@suse.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	Malcolm Crossley <malcolm.crossley@citrix.com>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 15/11/12 16:41, Tim Deegan wrote:
> Hi, 
>
> At 10:06 +0000 on 14 Nov (1352887560), Jan Beulich wrote:
>>> +            asm volatile("int $2"); /* Real NMI, vector 2: normal processing */
>> And I still don't like this use of "int $2" here: An aspect we didn't
>> consider so far is that a nested MCE would break things again
> OK, I think I understand the problem[s], but I'm going to spell it out
> slowly so you can correct me. :)
>
> [ tl;dr I agree that do_nmi() is better, and we should do that in this
>   patch, but maybe we need to solve the general problem too. ]
>
> On a PV guest, we have to use dedicated stacks for NMI and MCE in case
> either of those things happens just before SYSRET when we're on the user
> stack (no other interrupt or exception can happen at that point).
>
> On an AMD CPU we _don't_ have dedicated stacks for NMI or MCE when we're
> running a HVM guest, so the stack issue doesn't apply (but nested NMIs
> are still bad).
>
> On an Intel CPU, we _do_ use dedicated stacks for NMI and MCE in HVM
> guests.  We don't really have to but it saves time in the context switch
> not to update the IDT.  Using do_nmi() here means that the first NMI is
> handled on the normal stack instead.  It's also consistent with the way
> we call do_machine_check() for the MCE case.  But it needs an explicit
> IRET after the call to do_nmi() to make sure that NMIs get re-enabled.
>
> These dedicated stacks make the general problem of re-entrant MCE/NMI
> worse.  In the general case those handlers don't expect to be called in
> a reentrant way, but blatting the stack turns a possible problem into a
> definite one.

I have made a fairly simple patch which deliberately invokes a
re-entrant NMI.  The result is that a PCPU spins around the NMI handler
until the watchdog takes the host down.  It is also possible to get a
reentrant NMI if there is a pagefault (or handful of other possible
faults) when trying to execute the iret of the NMI itself; NMIs can get
re-enabled from the iret of the pagefault, and we take a new NMI before
attempting to retry the iret from the original NMI.

>
> ---
>
> All of this would be moot except for the risk that we might take an MCE
> while in the NMI handler.  The IRET from the MCE handler re-enables NMIs
> while we're still in the NMI handler, and a second NMI arriving could
> break the NMI handler.  In the PV case, it will also clobber the NMI
> handler's stack.  In the VMX case we would need to see something like
> (NMI (MCE) (NMI (MCE) (NMI))) for that to happen, but it could.

There is the MCIP bit in an MCE status MSR which acts as a latch for
MCEs.  If a new MCE is generated while this bit is set, then a triple
fault occurs.  An MCE handler is required to set this bit to 0 to
indicate that it has dealt with the MCE.  However, there is a race
condition window between setting this bit to 0 and leaving the MCE stack
during which another MCE can arrive and corrupt the stack.

>
> The inverse case, taking an NMI while in the MCE handler, is not very
> interesting.  There's no masking of MCEs so that handler already has to
> deal with nested entry, and the IRET from the NMI handler has no effect.
>
> We could potentially solve the problem by having the MCE handler check
> whether it's returning to the NMI stack, and do a normal return in that
> case.  It's a bit of extra code but only in the MCE handler, which is
> not performance-critical. 
>
> If we do that, then the choice of 'int $2' vs 'do_nmi(); fake_iret()'
> is mostly one of taste.  do_nmi() saves an IDT indirection but
> unbalances the call/return stack.  I slightly prefer 'int $2' just
> because it makes the PV and non-PV cases more similar.
>
> But first, we should take the current fix, with do_nmi() and iret() 
> instead of 'int $2'.  The nested-MCE issue can be handled separately.
>
> Does that make sense?

I have been looking at appling a similar fix to Linuses fix
(http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=3f3c8b8c4b2a34776c3470142a7c8baafcda6eb0)
to Xen, for both the NMI and MCE stacks.

Work is currently in the preliminary stages at the moment.

~Andrew

>
> Tim.
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 16:54:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 16:54:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ2hc-0006Uo-Ry; Thu, 15 Nov 2012 16:54:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TZ2hb-0006Ui-Bl
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 16:54:07 +0000
Received: from [85.158.137.99:38274] by server-4.bemta-3.messagelabs.com id
	36/19-30023-E2E15A05; Thu, 15 Nov 2012 16:54:06 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1352998443!16115675!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM4MzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11744 invoked from network); 15 Nov 2012 16:54:05 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 16:54:05 -0000
X-IronPort-AV: E=Sophos;i="4.83,258,1352073600"; d="scan'208";a="44735129"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 16:52:27 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 11:52:20 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TZ2fs-0003Er-Or;
	Thu, 15 Nov 2012 16:52:20 +0000
Message-ID: <50A51DC4.7040205@citrix.com>
Date: Thu, 15 Nov 2012 16:52:20 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
In-Reply-To: <20121115164156.GE75988@ocelot.phlegethon.org>
X-Enigmail-Version: 1.4.6
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	xen-devel <xen-devel@lists.xen.org>, Jan Beulich <JBeulich@suse.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	Malcolm Crossley <malcolm.crossley@citrix.com>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 15/11/12 16:41, Tim Deegan wrote:
> Hi, 
>
> At 10:06 +0000 on 14 Nov (1352887560), Jan Beulich wrote:
>>> +            asm volatile("int $2"); /* Real NMI, vector 2: normal processing */
>> And I still don't like this use of "int $2" here: An aspect we didn't
>> consider so far is that a nested MCE would break things again
> OK, I think I understand the problem[s], but I'm going to spell it out
> slowly so you can correct me. :)
>
> [ tl;dr I agree that do_nmi() is better, and we should do that in this
>   patch, but maybe we need to solve the general problem too. ]
>
> On a PV guest, we have to use dedicated stacks for NMI and MCE in case
> either of those things happens just before SYSRET when we're on the user
> stack (no other interrupt or exception can happen at that point).
>
> On an AMD CPU we _don't_ have dedicated stacks for NMI or MCE when we're
> running a HVM guest, so the stack issue doesn't apply (but nested NMIs
> are still bad).
>
> On an Intel CPU, we _do_ use dedicated stacks for NMI and MCE in HVM
> guests.  We don't really have to but it saves time in the context switch
> not to update the IDT.  Using do_nmi() here means that the first NMI is
> handled on the normal stack instead.  It's also consistent with the way
> we call do_machine_check() for the MCE case.  But it needs an explicit
> IRET after the call to do_nmi() to make sure that NMIs get re-enabled.
>
> These dedicated stacks make the general problem of re-entrant MCE/NMI
> worse.  In the general case those handlers don't expect to be called in
> a reentrant way, but blatting the stack turns a possible problem into a
> definite one.

I have made a fairly simple patch which deliberately invokes a
re-entrant NMI.  The result is that a PCPU spins around the NMI handler
until the watchdog takes the host down.  It is also possible to get a
reentrant NMI if there is a pagefault (or handful of other possible
faults) when trying to execute the iret of the NMI itself; NMIs can get
re-enabled from the iret of the pagefault, and we take a new NMI before
attempting to retry the iret from the original NMI.

>
> ---
>
> All of this would be moot except for the risk that we might take an MCE
> while in the NMI handler.  The IRET from the MCE handler re-enables NMIs
> while we're still in the NMI handler, and a second NMI arriving could
> break the NMI handler.  In the PV case, it will also clobber the NMI
> handler's stack.  In the VMX case we would need to see something like
> (NMI (MCE) (NMI (MCE) (NMI))) for that to happen, but it could.

There is the MCIP bit in an MCE status MSR which acts as a latch for
MCEs.  If a new MCE is generated while this bit is set, then a triple
fault occurs.  An MCE handler is required to set this bit to 0 to
indicate that it has dealt with the MCE.  However, there is a race
condition window between setting this bit to 0 and leaving the MCE stack
during which another MCE can arrive and corrupt the stack.

>
> The inverse case, taking an NMI while in the MCE handler, is not very
> interesting.  There's no masking of MCEs so that handler already has to
> deal with nested entry, and the IRET from the NMI handler has no effect.
>
> We could potentially solve the problem by having the MCE handler check
> whether it's returning to the NMI stack, and do a normal return in that
> case.  It's a bit of extra code but only in the MCE handler, which is
> not performance-critical. 
>
> If we do that, then the choice of 'int $2' vs 'do_nmi(); fake_iret()'
> is mostly one of taste.  do_nmi() saves an IDT indirection but
> unbalances the call/return stack.  I slightly prefer 'int $2' just
> because it makes the PV and non-PV cases more similar.
>
> But first, we should take the current fix, with do_nmi() and iret() 
> instead of 'int $2'.  The nested-MCE issue can be handled separately.
>
> Does that make sense?

I have been looking at appling a similar fix to Linuses fix
(http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=3f3c8b8c4b2a34776c3470142a7c8baafcda6eb0)
to Xen, for both the NMI and MCE stacks.

Work is currently in the preliminary stages at the moment.

~Andrew

>
> Tim.
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:00:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:00:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ2nn-0006hB-Cp; Thu, 15 Nov 2012 17:00:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1TZ2nl-0006h3-Rs
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 17:00:30 +0000
Received: from [85.158.137.99:7892] by server-14.bemta-3.messagelabs.com id
	06/1B-12788-CAF15A05; Thu, 15 Nov 2012 17:00:28 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-8.tower-217.messagelabs.com!1352998826!12430592!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4715 invoked from network); 15 Nov 2012 17:00:27 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 17:00:27 -0000
Received: by mail-ie0-f173.google.com with SMTP id 17so2904153iea.32
	for <xen-devel@lists.xen.org>; Thu, 15 Nov 2012 09:00:26 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer
	:x-gm-message-state;
	bh=icfaYM7tRNg3oTCRLXwMof4J0OiUn68pVo+AEHm2EWw=;
	b=AiAlneEenuoy8o2zhHLuRMb+xzehdBVG+PDQ77mQhZNJOVI3eAUkOJKip7hPDX59+G
	WahPIg0ftjOj4yLS65R+4CyzCm0nk2TZpESZHBV5B1l3r3yV6ui4ltlM3Sv0o41Lt1pB
	kCH5x47ZhfSaK2lTW7h3l/Qkmh9CqQGSWVKLbE7SPZuEX5W7eo70tvOKvSV/44L97BHZ
	h08NyaJYFbt+WVAPTeX4DyTUWH1dNcXKq7HZ8GAQaCmfZqe0sgYl34C2zrBeY+1XMQQX
	mSkozOZVx1QYx9HN1jsPJ5HxiUf9Xxj7uO9DPnGGllk3SlZ6Yk09LO+VsG2pfXFCsjlu
	fauQ==
Received: by 10.50.88.199 with SMTP id bi7mr482604igb.9.1352998825765;
	Thu, 15 Nov 2012 09:00:25 -0800 (PST)
Received: from [192.168.15.1] ([206.223.182.18])
	by mx.google.com with ESMTPS id kp4sm4403194igc.1.2012.11.15.09.00.24
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 15 Nov 2012 09:00:25 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
In-Reply-To: <alpine.DEB.2.02.1211151425210.28049@kaball.uk.xensource.com>
Date: Thu, 15 Nov 2012 12:00:25 -0500
Message-Id: <AE5E69D2-CE47-4825-B83A-BC13F84BACC6@gridcentric.ca>
References: <F4532D0E-2988-4B56-8555-0ADCE9D44CC8@gridcentric.ca>
	<alpine.DEB.2.02.1211151425210.28049@kaball.uk.xensource.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQlRRLfKmeBujjCEHvIslVaO3PDUD0Gj7g6xtuWzPIWSGKy216fTz3RPQE8FPSIQ2Kmsdeb6
Cc: Anthony Perard <anthony.perard@citrix.com>,
	Andres Lagar-Cavilla <andreslc@gridcentric.ca>,
	Peter Feiner <peter@gridcentric.ca>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Question on Xen management of qemu ram blocks and
	memory regions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On Nov 15, 2012, at 9:33 AM, Stefano Stabellini <stefano.stabellini@eu.citrix.com> wrote:

> On Wed, 14 Nov 2012, Andres Lagar-Cavilla wrote:
>> Stefano, and Xen-qemu team, I have a question.
>> 
>> The standard Xen-qemu workflow has Xen manage the physmap for a VM, and allocate all the backing memory for valid pfns, regardless of whether they are MMIO, RAM, etc. On save/migrate, when using upstream qemu, a special monitor command is used to save the device model state, while the save/restore code blocks in libxc takes care of the memory.
>> 
>> Qemu has a chain of ram blocks with offsets, each of which is further subdivided into memory regions that map to specific chunks of the physmap.
>> 
>> AFAICT, the restore code in libxc has no knowledge of qemu's ram blocks and offsets. My question is, how is a mismatch avoided?
>> 
>> How does the workflow ensure that all the sub regions in each ram block map to the same physmap chunks on restore? Is this an implicit guarantee from qemu when building the VM (with the same command line) on the restore side? 
>> 
>> Are the regions and physmap offsets contained in the device state that is saved?
>> 
>> If, for example, I were to save/restore a VM with four e1000 emulated devices, how does the workflow guarantee that each physmap region backing each e1000 ROM gets reconstructed with exactly the same ram block, offset, and physmap chunk coordinates?
>> 
>> Code inspection seems to suggest qemu will lay out things deterministically given the command line. I want to make sure I am not missing anything.
> 
> Yes, it does. Moreover QEMU is going to save everything it needs to
> restore the state of the devices exactly the way it was, MMIO regions
> addresses and sizes included.
> 
> The only issue is the videoram: even though it is an MMIO region, it is
> saved by Xen because it looks like normal ram to the hypervisor.
> To solve the problem QEMU writes the location and the size of the
> videoram to xenstore and keeps the records up to date.
> The toolstack reads those records and adds them to the save file.
> 

Thanks Stefano. That matches my read. IIUC, the xen MemoryListener callbacks will write to xenstore any ram block that is relocated, for restore's benefit. It just happens to only be the cirrus vram in the standard workflow.

Cheers!
Andres

> At restore time the toolstack writes back the records to xenstore and
> QEMU at boot time uses them to populate a list of physmap regions, see
> xen_read_physmap.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:00:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:00:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ2nn-0006hB-Cp; Thu, 15 Nov 2012 17:00:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1TZ2nl-0006h3-Rs
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 17:00:30 +0000
Received: from [85.158.137.99:7892] by server-14.bemta-3.messagelabs.com id
	06/1B-12788-CAF15A05; Thu, 15 Nov 2012 17:00:28 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-8.tower-217.messagelabs.com!1352998826!12430592!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4715 invoked from network); 15 Nov 2012 17:00:27 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 17:00:27 -0000
Received: by mail-ie0-f173.google.com with SMTP id 17so2904153iea.32
	for <xen-devel@lists.xen.org>; Thu, 15 Nov 2012 09:00:26 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer
	:x-gm-message-state;
	bh=icfaYM7tRNg3oTCRLXwMof4J0OiUn68pVo+AEHm2EWw=;
	b=AiAlneEenuoy8o2zhHLuRMb+xzehdBVG+PDQ77mQhZNJOVI3eAUkOJKip7hPDX59+G
	WahPIg0ftjOj4yLS65R+4CyzCm0nk2TZpESZHBV5B1l3r3yV6ui4ltlM3Sv0o41Lt1pB
	kCH5x47ZhfSaK2lTW7h3l/Qkmh9CqQGSWVKLbE7SPZuEX5W7eo70tvOKvSV/44L97BHZ
	h08NyaJYFbt+WVAPTeX4DyTUWH1dNcXKq7HZ8GAQaCmfZqe0sgYl34C2zrBeY+1XMQQX
	mSkozOZVx1QYx9HN1jsPJ5HxiUf9Xxj7uO9DPnGGllk3SlZ6Yk09LO+VsG2pfXFCsjlu
	fauQ==
Received: by 10.50.88.199 with SMTP id bi7mr482604igb.9.1352998825765;
	Thu, 15 Nov 2012 09:00:25 -0800 (PST)
Received: from [192.168.15.1] ([206.223.182.18])
	by mx.google.com with ESMTPS id kp4sm4403194igc.1.2012.11.15.09.00.24
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 15 Nov 2012 09:00:25 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
In-Reply-To: <alpine.DEB.2.02.1211151425210.28049@kaball.uk.xensource.com>
Date: Thu, 15 Nov 2012 12:00:25 -0500
Message-Id: <AE5E69D2-CE47-4825-B83A-BC13F84BACC6@gridcentric.ca>
References: <F4532D0E-2988-4B56-8555-0ADCE9D44CC8@gridcentric.ca>
	<alpine.DEB.2.02.1211151425210.28049@kaball.uk.xensource.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQlRRLfKmeBujjCEHvIslVaO3PDUD0Gj7g6xtuWzPIWSGKy216fTz3RPQE8FPSIQ2Kmsdeb6
Cc: Anthony Perard <anthony.perard@citrix.com>,
	Andres Lagar-Cavilla <andreslc@gridcentric.ca>,
	Peter Feiner <peter@gridcentric.ca>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Question on Xen management of qemu ram blocks and
	memory regions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On Nov 15, 2012, at 9:33 AM, Stefano Stabellini <stefano.stabellini@eu.citrix.com> wrote:

> On Wed, 14 Nov 2012, Andres Lagar-Cavilla wrote:
>> Stefano, and Xen-qemu team, I have a question.
>> 
>> The standard Xen-qemu workflow has Xen manage the physmap for a VM, and allocate all the backing memory for valid pfns, regardless of whether they are MMIO, RAM, etc. On save/migrate, when using upstream qemu, a special monitor command is used to save the device model state, while the save/restore code blocks in libxc takes care of the memory.
>> 
>> Qemu has a chain of ram blocks with offsets, each of which is further subdivided into memory regions that map to specific chunks of the physmap.
>> 
>> AFAICT, the restore code in libxc has no knowledge of qemu's ram blocks and offsets. My question is, how is a mismatch avoided?
>> 
>> How does the workflow ensure that all the sub regions in each ram block map to the same physmap chunks on restore? Is this an implicit guarantee from qemu when building the VM (with the same command line) on the restore side? 
>> 
>> Are the regions and physmap offsets contained in the device state that is saved?
>> 
>> If, for example, I were to save/restore a VM with four e1000 emulated devices, how does the workflow guarantee that each physmap region backing each e1000 ROM gets reconstructed with exactly the same ram block, offset, and physmap chunk coordinates?
>> 
>> Code inspection seems to suggest qemu will lay out things deterministically given the command line. I want to make sure I am not missing anything.
> 
> Yes, it does. Moreover QEMU is going to save everything it needs to
> restore the state of the devices exactly the way it was, MMIO regions
> addresses and sizes included.
> 
> The only issue is the videoram: even though it is an MMIO region, it is
> saved by Xen because it looks like normal ram to the hypervisor.
> To solve the problem QEMU writes the location and the size of the
> videoram to xenstore and keeps the records up to date.
> The toolstack reads those records and adds them to the save file.
> 

Thanks Stefano. That matches my read. IIUC, the xen MemoryListener callbacks will write to xenstore any ram block that is relocated, for restore's benefit. It just happens to only be the cirrus vram in the standard workflow.

Cheers!
Andres

> At restore time the toolstack writes back the records to xenstore and
> QEMU at boot time uses them to populate a list of physmap regions, see
> xen_read_physmap.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:05:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:05:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ2ru-00076d-2p; Thu, 15 Nov 2012 17:04:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZ2rs-00076U-UP
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 17:04:45 +0000
Received: from [85.158.143.99:35995] by server-2.bemta-4.messagelabs.com id
	38/73-28922-CA025A05; Thu, 15 Nov 2012 17:04:44 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352999081!29523334!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODY1MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27555 invoked from network); 15 Nov 2012 17:04:43 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-3.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 17:04:43 -0000
X-IronPort-AV: E=Sophos;i="4.83,258,1352073600"; d="scan'208";a="214646051"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	15 Nov 2012 17:03:15 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Thu, 15 Nov 2012 12:03:14 -0500
Message-ID: <50A52051.9010807@citrix.com>
Date: Thu, 15 Nov 2012 17:03:13 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
In-Reply-To: <20121115164156.GE75988@ocelot.phlegethon.org>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 15/11/12 16:41, Tim Deegan wrote:
> Hi,
>
> At 10:06 +0000 on 14 Nov (1352887560), Jan Beulich wrote:
>>> +            asm volatile("int $2"); /* Real NMI, vector 2: normal processing */
>> And I still don't like this use of "int $2" here: An aspect we didn't
>> consider so far is that a nested MCE would break things again
> OK, I think I understand the problem[s], but I'm going to spell it out
> slowly so you can correct me. :)
>
> [ tl;dr I agree that do_nmi() is better, and we should do that in this
>    patch, but maybe we need to solve the general problem too. ]
>
> On a PV guest, we have to use dedicated stacks for NMI and MCE in case
> either of those things happens just before SYSRET when we're on the user
> stack (no other interrupt or exception can happen at that point).
>
> On an AMD CPU we _don't_ have dedicated stacks for NMI or MCE when we're
> running a HVM guest, so the stack issue doesn't apply (but nested NMIs
> are still bad).
>
> On an Intel CPU, we _do_ use dedicated stacks for NMI and MCE in HVM
> guests.  We don't really have to but it saves time in the context switch
> not to update the IDT.  Using do_nmi() here means that the first NMI is
> handled on the normal stack instead.  It's also consistent with the way
> we call do_machine_check() for the MCE case.  But it needs an explicit
> IRET after the call to do_nmi() to make sure that NMIs get re-enabled.

Both AMD and Intel has an identical setup with regard to stacks and 
general "what happens when we taken one of these interrupts". As Andy 
Cooper is about to post, there are ways to solve the nesting of either 
of these interrupts.

There are subtle differences between Intel and AMD in how the actual 
interrupt gets handled when the processor is currently running a HVM 
guest, which is why the patch in this thread is "Intel only", because 
the Intel system "eats" the NMI, and it needs to be "reissued". On AMD, 
the interrupts are held pending until the guest has exited into the 
Hypervisor, and then taken after the processor executes the STGI (Set 
Global Interrupt Enable) instruction - analogous to what happens when 
you have a CLI and STI for ordinary interrupts.

The issues with regards to nesting of NMI and MCE is completely 
different from the "how do we issue an NMI from the HVM handling code 
when the guest got interrupted by NMI".

Nested NMI and nested MCE is the same problem on both AMD and Intel 
processors, and need a completely separate solution [Andy is working on 
this].

--
Mats

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:05:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:05:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ2ru-00076d-2p; Thu, 15 Nov 2012 17:04:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZ2rs-00076U-UP
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 17:04:45 +0000
Received: from [85.158.143.99:35995] by server-2.bemta-4.messagelabs.com id
	38/73-28922-CA025A05; Thu, 15 Nov 2012 17:04:44 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1352999081!29523334!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODY1MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27555 invoked from network); 15 Nov 2012 17:04:43 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-3.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 17:04:43 -0000
X-IronPort-AV: E=Sophos;i="4.83,258,1352073600"; d="scan'208";a="214646051"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	15 Nov 2012 17:03:15 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Thu, 15 Nov 2012 12:03:14 -0500
Message-ID: <50A52051.9010807@citrix.com>
Date: Thu, 15 Nov 2012 17:03:13 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
In-Reply-To: <20121115164156.GE75988@ocelot.phlegethon.org>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 15/11/12 16:41, Tim Deegan wrote:
> Hi,
>
> At 10:06 +0000 on 14 Nov (1352887560), Jan Beulich wrote:
>>> +            asm volatile("int $2"); /* Real NMI, vector 2: normal processing */
>> And I still don't like this use of "int $2" here: An aspect we didn't
>> consider so far is that a nested MCE would break things again
> OK, I think I understand the problem[s], but I'm going to spell it out
> slowly so you can correct me. :)
>
> [ tl;dr I agree that do_nmi() is better, and we should do that in this
>    patch, but maybe we need to solve the general problem too. ]
>
> On a PV guest, we have to use dedicated stacks for NMI and MCE in case
> either of those things happens just before SYSRET when we're on the user
> stack (no other interrupt or exception can happen at that point).
>
> On an AMD CPU we _don't_ have dedicated stacks for NMI or MCE when we're
> running a HVM guest, so the stack issue doesn't apply (but nested NMIs
> are still bad).
>
> On an Intel CPU, we _do_ use dedicated stacks for NMI and MCE in HVM
> guests.  We don't really have to but it saves time in the context switch
> not to update the IDT.  Using do_nmi() here means that the first NMI is
> handled on the normal stack instead.  It's also consistent with the way
> we call do_machine_check() for the MCE case.  But it needs an explicit
> IRET after the call to do_nmi() to make sure that NMIs get re-enabled.

Both AMD and Intel has an identical setup with regard to stacks and 
general "what happens when we taken one of these interrupts". As Andy 
Cooper is about to post, there are ways to solve the nesting of either 
of these interrupts.

There are subtle differences between Intel and AMD in how the actual 
interrupt gets handled when the processor is currently running a HVM 
guest, which is why the patch in this thread is "Intel only", because 
the Intel system "eats" the NMI, and it needs to be "reissued". On AMD, 
the interrupts are held pending until the guest has exited into the 
Hypervisor, and then taken after the processor executes the STGI (Set 
Global Interrupt Enable) instruction - analogous to what happens when 
you have a CLI and STI for ordinary interrupts.

The issues with regards to nesting of NMI and MCE is completely 
different from the "how do we issue an NMI from the HVM handling code 
when the guest got interrupted by NMI".

Nested NMI and nested MCE is the same problem on both AMD and Intel 
processors, and need a completely separate solution [Andy is working on 
this].

--
Mats

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:12:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:12:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ2zK-0007Wh-5Z; Thu, 15 Nov 2012 17:12:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pbonzini@redhat.com>) id 1TZ2zI-0007Wb-Og
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 17:12:24 +0000
Received: from [85.158.143.99:20720] by server-1.bemta-4.messagelabs.com id
	11/64-27934-87225A05; Thu, 15 Nov 2012 17:12:24 +0000
X-Env-Sender: pbonzini@redhat.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352999542!26723512!1
X-Originating-IP: [209.132.183.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTY5MDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14521 invoked from network); 15 Nov 2012 17:12:23 -0000
Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28)
	by server-7.tower-216.messagelabs.com with SMTP;
	15 Nov 2012 17:12:23 -0000
Received: from int-mx11.intmail.prod.int.phx2.redhat.com
	(int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qAFHCE95019256
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 12:12:18 -0500
Received: from yakj.usersys.redhat.com (ovpn-112-36.ams2.redhat.com
	[10.36.112.36])
	by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id qAFH0Jli027147; Thu, 15 Nov 2012 12:00:26 -0500
Message-ID: <50A51FA0.1070504@redhat.com>
Date: Thu, 15 Nov 2012 18:00:16 +0100
From: Paolo Bonzini <pbonzini@redhat.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121016 Thunderbird/16.0.1
MIME-Version: 1.0
To: Charles Arnold <carnold@suse.com>
References: <50A0E79F0200009100082E4C@novprvoes0310.provo.novell.com>
	<50A2250A.4070108@redhat.com>
	<alpine.DEB.2.02.1211131054200.28049@kaball.uk.xensource.com>
	<4B45B535F7F6BE4CB1C044ED5115CDDE012D550D234B@LONPMAILBOX01.citrite.net>
	<50A3C853.4010809@redhat.com>
	<50A4B9FB0200009100083093@novprvoes0310.provo.novell.com>
In-Reply-To: <50A4B9FB0200009100083093@novprvoes0310.provo.novell.com>
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24
Cc: Kevin Wolf <kwolf@redhat.com>, Thanos Makatos <thanos.makatos@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"stefanha@redhat.com" <stefanha@redhat.com>
Subject: Re: [Xen-devel] [PATCH] block: vpc support for ~2 TB disks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Il 15/11/2012 17:46, Charles Arnold ha scritto:
>>> We don't use qemu's VHD driver in XenServer. Instead, we use blktap2
>>> >> to create a block device in dom0 serving the VHD file in question,
>>> >> and have qemu open that block device instead of the VHD file itself.
>> > 
>> > Yes, the question is how you handle disks bigger than 127GB, so that
>> > QEMU can do the same.
>> > 
> In analyzing a 160 GB VHD fixed disk image created on Windows 2008 R2, it appears that
> MS is also ignoring the CHS values in the footer geometry field in whatever
> driver they use for accessing the image.  The CHS values are set at 65535,16,255
> which obviously doesn't represent an image size of 160 GB.

Thanks, this would have been useful in the commit message.

The patch looks good,

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo

> This patch only extends the existing qemu driver to allow a larger image by allowing
> more heads.  On real hardware, only 4 bits would be allowed for heads but we don't
> have that restriction in qemu. 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:12:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:12:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ2zK-0007Wh-5Z; Thu, 15 Nov 2012 17:12:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pbonzini@redhat.com>) id 1TZ2zI-0007Wb-Og
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 17:12:24 +0000
Received: from [85.158.143.99:20720] by server-1.bemta-4.messagelabs.com id
	11/64-27934-87225A05; Thu, 15 Nov 2012 17:12:24 +0000
X-Env-Sender: pbonzini@redhat.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1352999542!26723512!1
X-Originating-IP: [209.132.183.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTY5MDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14521 invoked from network); 15 Nov 2012 17:12:23 -0000
Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28)
	by server-7.tower-216.messagelabs.com with SMTP;
	15 Nov 2012 17:12:23 -0000
Received: from int-mx11.intmail.prod.int.phx2.redhat.com
	(int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qAFHCE95019256
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 12:12:18 -0500
Received: from yakj.usersys.redhat.com (ovpn-112-36.ams2.redhat.com
	[10.36.112.36])
	by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id qAFH0Jli027147; Thu, 15 Nov 2012 12:00:26 -0500
Message-ID: <50A51FA0.1070504@redhat.com>
Date: Thu, 15 Nov 2012 18:00:16 +0100
From: Paolo Bonzini <pbonzini@redhat.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121016 Thunderbird/16.0.1
MIME-Version: 1.0
To: Charles Arnold <carnold@suse.com>
References: <50A0E79F0200009100082E4C@novprvoes0310.provo.novell.com>
	<50A2250A.4070108@redhat.com>
	<alpine.DEB.2.02.1211131054200.28049@kaball.uk.xensource.com>
	<4B45B535F7F6BE4CB1C044ED5115CDDE012D550D234B@LONPMAILBOX01.citrite.net>
	<50A3C853.4010809@redhat.com>
	<50A4B9FB0200009100083093@novprvoes0310.provo.novell.com>
In-Reply-To: <50A4B9FB0200009100083093@novprvoes0310.provo.novell.com>
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24
Cc: Kevin Wolf <kwolf@redhat.com>, Thanos Makatos <thanos.makatos@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"stefanha@redhat.com" <stefanha@redhat.com>
Subject: Re: [Xen-devel] [PATCH] block: vpc support for ~2 TB disks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Il 15/11/2012 17:46, Charles Arnold ha scritto:
>>> We don't use qemu's VHD driver in XenServer. Instead, we use blktap2
>>> >> to create a block device in dom0 serving the VHD file in question,
>>> >> and have qemu open that block device instead of the VHD file itself.
>> > 
>> > Yes, the question is how you handle disks bigger than 127GB, so that
>> > QEMU can do the same.
>> > 
> In analyzing a 160 GB VHD fixed disk image created on Windows 2008 R2, it appears that
> MS is also ignoring the CHS values in the footer geometry field in whatever
> driver they use for accessing the image.  The CHS values are set at 65535,16,255
> which obviously doesn't represent an image size of 160 GB.

Thanks, this would have been useful in the commit message.

The patch looks good,

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo

> This patch only extends the existing qemu driver to allow a larger image by allowing
> more heads.  On real hardware, only 4 bits would be allowed for heads but we don't
> have that restriction in qemu. 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:15:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:15:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ32U-0007iZ-E5; Thu, 15 Nov 2012 17:15:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TZ32T-0007iF-2S
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 17:15:41 +0000
Received: from [85.158.143.99:44208] by server-1.bemta-4.messagelabs.com id
	D5/C7-27934-C3325A05; Thu, 15 Nov 2012 17:15:40 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1352999738!27430425!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14290 invoked from network); 15 Nov 2012 17:15:38 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-5.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 17:15:38 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TZ32P-000KkM-Jd; Thu, 15 Nov 2012 17:15:37 +0000
Date: Thu, 15 Nov 2012 17:15:37 +0000
From: Tim Deegan <tim@xen.org>
To: Mats Petersson <mats.petersson@citrix.com>
Message-ID: <20121115171537.GF75988@ocelot.phlegethon.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A52051.9010807@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A52051.9010807@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
	real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 17:03 +0000 on 15 Nov (1352998993), Mats Petersson wrote:
> >On an AMD CPU we _don't_ have dedicated stacks for NMI or MCE when we're
> >running a HVM guest, so the stack issue doesn't apply (but nested NMIs
> >are still bad).
> >
> >On an Intel CPU, we _do_ use dedicated stacks for NMI and MCE in HVM
> >guests.  We don't really have to but it saves time in the context switch
> >not to update the IDT.  Using do_nmi() here means that the first NMI is
> >handled on the normal stack instead.  It's also consistent with the way
> >we call do_machine_check() for the MCE case.  But it needs an explicit
> >IRET after the call to do_nmi() to make sure that NMIs get re-enabled.
> 
> Both AMD and Intel has an identical setup with regard to stacks and 
> general "what happens when we taken one of these interrupts".

My reading of svm_ctxt_switch_{to,from} makes me disagree with this. 
AFAICT, on SVM we're not using dedicated stacks at all. 

> The issues with regards to nesting of NMI and MCE is completely 
> different from the "how do we issue an NMI from the HVM handling code 
> when the guest got interrupted by NMI".

Yes.  As I said, we should take the fix to the VMX NMI handling now, and
sort out the nesting separately.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:15:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:15:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ32U-0007iZ-E5; Thu, 15 Nov 2012 17:15:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TZ32T-0007iF-2S
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 17:15:41 +0000
Received: from [85.158.143.99:44208] by server-1.bemta-4.messagelabs.com id
	D5/C7-27934-C3325A05; Thu, 15 Nov 2012 17:15:40 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1352999738!27430425!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14290 invoked from network); 15 Nov 2012 17:15:38 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-5.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 17:15:38 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TZ32P-000KkM-Jd; Thu, 15 Nov 2012 17:15:37 +0000
Date: Thu, 15 Nov 2012 17:15:37 +0000
From: Tim Deegan <tim@xen.org>
To: Mats Petersson <mats.petersson@citrix.com>
Message-ID: <20121115171537.GF75988@ocelot.phlegethon.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A52051.9010807@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A52051.9010807@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
	real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 17:03 +0000 on 15 Nov (1352998993), Mats Petersson wrote:
> >On an AMD CPU we _don't_ have dedicated stacks for NMI or MCE when we're
> >running a HVM guest, so the stack issue doesn't apply (but nested NMIs
> >are still bad).
> >
> >On an Intel CPU, we _do_ use dedicated stacks for NMI and MCE in HVM
> >guests.  We don't really have to but it saves time in the context switch
> >not to update the IDT.  Using do_nmi() here means that the first NMI is
> >handled on the normal stack instead.  It's also consistent with the way
> >we call do_machine_check() for the MCE case.  But it needs an explicit
> >IRET after the call to do_nmi() to make sure that NMIs get re-enabled.
> 
> Both AMD and Intel has an identical setup with regard to stacks and 
> general "what happens when we taken one of these interrupts".

My reading of svm_ctxt_switch_{to,from} makes me disagree with this. 
AFAICT, on SVM we're not using dedicated stacks at all. 

> The issues with regards to nesting of NMI and MCE is completely 
> different from the "how do we issue an NMI from the HVM handling code 
> when the guest got interrupted by NMI".

Yes.  As I said, we should take the fix to the VMX NMI handling now, and
sort out the nesting separately.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:22:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:22:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ38R-0008HC-EM; Thu, 15 Nov 2012 17:21:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TZ38Q-0008H7-Rq
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 17:21:51 +0000
Received: from [85.158.143.99:40143] by server-1.bemta-4.messagelabs.com id
	3D/6D-27934-EA425A05; Thu, 15 Nov 2012 17:21:50 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1353000108!19155162!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM4MzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19381 invoked from network); 15 Nov 2012 17:21:49 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 17:21:49 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208";a="44741918"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 17:20:16 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 12:20:16 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TZ36t-0003dd-Dq;
	Thu, 15 Nov 2012 17:20:15 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 17:14:42 +0000
Message-ID: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
MIME-Version: 1.0
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Subject: [Xen-devel] [PATCH RFC] Make all public hosting providers eligible
	for the pre-disclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

As discussed on the xen-devel mailing list, allow any public hosting
provider to join the pre-disclosure list:
* Change "Large hosting providers" to "Public hosting providers"
* Add rule of thumb for what "public hosting provider" means
* Add an itemized list of information to be included in the application,
to make expectations clear and (hopefully) applications more streamlined.

NOTE: This RFC is meant to be a way to start a discussion on the exact
wording which will be voted on.  Once it has gone through review from
the xen-devel mailing list, I will post an "RC" and announce it on the
Xen blog, as well as on xen-users.  Once discussion seems to have
converged, I will post a "FINAL" one, which I will put up for a vote.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 security_vulnerability_process.html |   27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/security_vulnerability_process.html b/security_vulnerability_process.html
index e305371..35236c9 100644
--- a/security_vulnerability_process.html
+++ b/security_vulnerability_process.html
@@ -194,16 +194,18 @@ if(ns4)_d.write("<scr"+"ipt type=text/javascript src=/globals/mmenuns4.js><\/scr
     addresses (ideally, role addresses) of the security response teams for
     significant Xen operators and distributors.</p>
     <p>This includes:<ul>
-      <li>Large-scale hosting providers;</li>
+      <li>Public hosting providers;</li>
       <li>Large-scale organisational users of Xen;</li>
       <li>Vendors of widely-deployed Xen-based systems;</li>
       <li>Distributors of widely-deployed operating systems with Xen support.</li>
     </ul></p>
     <p>This includes both corporations and community institutions.</p>    
-    <p>Here as a rule of thumb "large scale" and "widely deployed" means an
-    installed base of 300,000 or more Xen guests; other well-established
-    organisations with a mature security response process will be considered on
-    a case-by-case basis.</p>    
+    <p>Here as a rule of thumb, "public hosting provider" means
+    "selling virtualization services to the general public";
+    "large-scale" and "widely deployed" means an installed base of
+    300,000 or more Xen guests.  Other well-established organisations
+    with a mature security response process will be considered on a
+    case-by-case basis.</p>
     <p>The list of entities on the pre-disclosure list is public. (Just the list
     of projects and organisations, not the actual email addresses.)</p>  
     <p>If there is an embargo, the pre-disclosure list will receive
@@ -229,8 +231,19 @@ if(ns4)_d.write("<scr"+"ipt type=text/javascript src=/globals/mmenuns4.js><\/scr
        <li>The planned disclosure date</li>
     </ul></p>
 
-    <p>Organisations who meet the criteria should contact security@xen if they wish to receive pre-disclosure of advisories. Organisations should not request subscription via the mailing list web interface, any such subscription requests will be rejected and ignored.</p>
-    <p>Normally we would prefer that a role address be used for each organisation, rather than one or more individual's direct email address. This helps to ensure that changes of personnel do not end up effectively dropping an organisation from the list</p>
+    <p>Organisations who meet the criteria should contact security@xen
+      if they wish to receive pre-disclosure of advisories.  Please
+      include in the e-mail: <ul>
+	<li>The name of your organization</li>
+	<li>A brief description of why you fit the criteria</li>
+	<li>A security alias e-mail address (see below)</li>
+	<li>A web page with your security policy statement</li>
+	<li>If you are a public hosting provider, a web page with your public rates</li>
+      </ul>
+      Organisations should not request subscription via the mailing
+      list web interface, any such subscription requests will be
+      rejected and ignored.</p>
+    <p>We prefer that a role address be used for each organisation, rather than one or more individual's direct email address. This helps to ensure that changes of personnel do not end up effectively dropping an organisation from the list</p>
 
     
     <h3>Organizations on the pre-disclosure list:</h3>
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:22:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:22:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ38R-0008HC-EM; Thu, 15 Nov 2012 17:21:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TZ38Q-0008H7-Rq
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 17:21:51 +0000
Received: from [85.158.143.99:40143] by server-1.bemta-4.messagelabs.com id
	3D/6D-27934-EA425A05; Thu, 15 Nov 2012 17:21:50 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1353000108!19155162!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM4MzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19381 invoked from network); 15 Nov 2012 17:21:49 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 17:21:49 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208";a="44741918"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 17:20:16 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 12:20:16 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TZ36t-0003dd-Dq;
	Thu, 15 Nov 2012 17:20:15 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xen.org
Date: Thu, 15 Nov 2012 17:14:42 +0000
Message-ID: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
MIME-Version: 1.0
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Subject: [Xen-devel] [PATCH RFC] Make all public hosting providers eligible
	for the pre-disclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

As discussed on the xen-devel mailing list, allow any public hosting
provider to join the pre-disclosure list:
* Change "Large hosting providers" to "Public hosting providers"
* Add rule of thumb for what "public hosting provider" means
* Add an itemized list of information to be included in the application,
to make expectations clear and (hopefully) applications more streamlined.

NOTE: This RFC is meant to be a way to start a discussion on the exact
wording which will be voted on.  Once it has gone through review from
the xen-devel mailing list, I will post an "RC" and announce it on the
Xen blog, as well as on xen-users.  Once discussion seems to have
converged, I will post a "FINAL" one, which I will put up for a vote.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 security_vulnerability_process.html |   27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/security_vulnerability_process.html b/security_vulnerability_process.html
index e305371..35236c9 100644
--- a/security_vulnerability_process.html
+++ b/security_vulnerability_process.html
@@ -194,16 +194,18 @@ if(ns4)_d.write("<scr"+"ipt type=text/javascript src=/globals/mmenuns4.js><\/scr
     addresses (ideally, role addresses) of the security response teams for
     significant Xen operators and distributors.</p>
     <p>This includes:<ul>
-      <li>Large-scale hosting providers;</li>
+      <li>Public hosting providers;</li>
       <li>Large-scale organisational users of Xen;</li>
       <li>Vendors of widely-deployed Xen-based systems;</li>
       <li>Distributors of widely-deployed operating systems with Xen support.</li>
     </ul></p>
     <p>This includes both corporations and community institutions.</p>    
-    <p>Here as a rule of thumb "large scale" and "widely deployed" means an
-    installed base of 300,000 or more Xen guests; other well-established
-    organisations with a mature security response process will be considered on
-    a case-by-case basis.</p>    
+    <p>Here as a rule of thumb, "public hosting provider" means
+    "selling virtualization services to the general public";
+    "large-scale" and "widely deployed" means an installed base of
+    300,000 or more Xen guests.  Other well-established organisations
+    with a mature security response process will be considered on a
+    case-by-case basis.</p>
     <p>The list of entities on the pre-disclosure list is public. (Just the list
     of projects and organisations, not the actual email addresses.)</p>  
     <p>If there is an embargo, the pre-disclosure list will receive
@@ -229,8 +231,19 @@ if(ns4)_d.write("<scr"+"ipt type=text/javascript src=/globals/mmenuns4.js><\/scr
        <li>The planned disclosure date</li>
     </ul></p>
 
-    <p>Organisations who meet the criteria should contact security@xen if they wish to receive pre-disclosure of advisories. Organisations should not request subscription via the mailing list web interface, any such subscription requests will be rejected and ignored.</p>
-    <p>Normally we would prefer that a role address be used for each organisation, rather than one or more individual's direct email address. This helps to ensure that changes of personnel do not end up effectively dropping an organisation from the list</p>
+    <p>Organisations who meet the criteria should contact security@xen
+      if they wish to receive pre-disclosure of advisories.  Please
+      include in the e-mail: <ul>
+	<li>The name of your organization</li>
+	<li>A brief description of why you fit the criteria</li>
+	<li>A security alias e-mail address (see below)</li>
+	<li>A web page with your security policy statement</li>
+	<li>If you are a public hosting provider, a web page with your public rates</li>
+      </ul>
+      Organisations should not request subscription via the mailing
+      list web interface, any such subscription requests will be
+      rejected and ignored.</p>
+    <p>We prefer that a role address be used for each organisation, rather than one or more individual's direct email address. This helps to ensure that changes of personnel do not end up effectively dropping an organisation from the list</p>
 
     
     <h3>Organizations on the pre-disclosure list:</h3>
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:25:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:25:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ3Br-0008RY-2f; Thu, 15 Nov 2012 17:25:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TZ3Bp-0008RP-PX
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 17:25:21 +0000
Received: from [85.158.143.99:51668] by server-3.bemta-4.messagelabs.com id
	D9/73-06841-18525A05; Thu, 15 Nov 2012 17:25:21 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1353000319!24790739!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24495 invoked from network); 15 Nov 2012 17:25:20 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-2.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 17:25:20 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TZ3Bi-000Kms-RP; Thu, 15 Nov 2012 17:25:14 +0000
Date: Thu, 15 Nov 2012 17:25:14 +0000
From: Tim Deegan <tim@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121115172514.GG75988@ocelot.phlegethon.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A51DC4.7040205@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A51DC4.7040205@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	xen-devel <xen-devel@lists.xen.org>, Jan Beulich <JBeulich@suse.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	Malcolm Crossley <malcolm.crossley@citrix.com>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
	real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:52 +0000 on 15 Nov (1352998340), Andrew Cooper wrote:
> It is also possible to get a reentrant NMI if there is a pagefault (or
> handful of other possible faults) when trying to execute the iret of
> the NMI itself; NMIs can get re-enabled from the iret of the
> pagefault, and we take a new NMI before attempting to retry the iret
> from the original NMI.

Yes, I hadn't thought of that case.

> > All of this would be moot except for the risk that we might take an MCE
> > while in the NMI handler.  The IRET from the MCE handler re-enables NMIs
> > while we're still in the NMI handler, and a second NMI arriving could
> > break the NMI handler.  In the PV case, it will also clobber the NMI
> > handler's stack.  In the VMX case we would need to see something like
> > (NMI (MCE) (NMI (MCE) (NMI))) for that to happen, but it could.
> 
> There is the MCIP bit in an MCE status MSR which acts as a latch for
> MCEs.  If a new MCE is generated while this bit is set, then a triple
> fault occurs.  An MCE handler is required to set this bit to 0 to
> indicate that it has dealt with the MCE.  However, there is a race
> condition window between setting this bit to 0 and leaving the MCE stack
> during which another MCE can arrive and corrupt the stack.

Sure.  Nested MCEs aren't very interesting to me.  If you're taking MCEs
faster than you can handle them, the difference between one of your CPUs
resetting and the stack getting blasted isn't that much. :)

> I have been looking at appling a similar fix to Linuses fix
> (http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=3f3c8b8c4b2a34776c3470142a7c8baafcda6eb0)
> to Xen, for both the NMI and MCE stacks.
> 
> Work is currently in the preliminary stages at the moment.

Sounds great!

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:25:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:25:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ3Br-0008RY-2f; Thu, 15 Nov 2012 17:25:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TZ3Bp-0008RP-PX
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 17:25:21 +0000
Received: from [85.158.143.99:51668] by server-3.bemta-4.messagelabs.com id
	D9/73-06841-18525A05; Thu, 15 Nov 2012 17:25:21 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1353000319!24790739!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24495 invoked from network); 15 Nov 2012 17:25:20 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-2.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 17:25:20 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TZ3Bi-000Kms-RP; Thu, 15 Nov 2012 17:25:14 +0000
Date: Thu, 15 Nov 2012 17:25:14 +0000
From: Tim Deegan <tim@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121115172514.GG75988@ocelot.phlegethon.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A51DC4.7040205@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A51DC4.7040205@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	xen-devel <xen-devel@lists.xen.org>, Jan Beulich <JBeulich@suse.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	Malcolm Crossley <malcolm.crossley@citrix.com>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
	real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:52 +0000 on 15 Nov (1352998340), Andrew Cooper wrote:
> It is also possible to get a reentrant NMI if there is a pagefault (or
> handful of other possible faults) when trying to execute the iret of
> the NMI itself; NMIs can get re-enabled from the iret of the
> pagefault, and we take a new NMI before attempting to retry the iret
> from the original NMI.

Yes, I hadn't thought of that case.

> > All of this would be moot except for the risk that we might take an MCE
> > while in the NMI handler.  The IRET from the MCE handler re-enables NMIs
> > while we're still in the NMI handler, and a second NMI arriving could
> > break the NMI handler.  In the PV case, it will also clobber the NMI
> > handler's stack.  In the VMX case we would need to see something like
> > (NMI (MCE) (NMI (MCE) (NMI))) for that to happen, but it could.
> 
> There is the MCIP bit in an MCE status MSR which acts as a latch for
> MCEs.  If a new MCE is generated while this bit is set, then a triple
> fault occurs.  An MCE handler is required to set this bit to 0 to
> indicate that it has dealt with the MCE.  However, there is a race
> condition window between setting this bit to 0 and leaving the MCE stack
> during which another MCE can arrive and corrupt the stack.

Sure.  Nested MCEs aren't very interesting to me.  If you're taking MCEs
faster than you can handle them, the difference between one of your CPUs
resetting and the stack getting blasted isn't that much. :)

> I have been looking at appling a similar fix to Linuses fix
> (http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=3f3c8b8c4b2a34776c3470142a7c8baafcda6eb0)
> to Xen, for both the NMI and MCE stacks.
> 
> Work is currently in the preliminary stages at the moment.

Sounds great!

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:34:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:34:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ3KU-0000Ft-4h; Thu, 15 Nov 2012 17:34:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZ3KS-0000Fo-14
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 17:34:16 +0000
Received: from [85.158.138.51:25806] by server-14.bemta-3.messagelabs.com id
	D6/6F-12788-79725A05; Thu, 15 Nov 2012 17:34:15 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1353000853!30178662!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM4MzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12772 invoked from network); 15 Nov 2012 17:34:14 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 17:34:14 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208";a="44745144"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	15 Nov 2012 17:33:04 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Thu, 15 Nov 2012 12:33:03 -0500
Message-ID: <50A5274E.4030302@citrix.com>
Date: Thu, 15 Nov 2012 17:33:02 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A52051.9010807@citrix.com>
	<20121115171537.GF75988@ocelot.phlegethon.org>
In-Reply-To: <20121115171537.GF75988@ocelot.phlegethon.org>
X-Originating-IP: [10.80.3.146]
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 15/11/12 17:15, Tim Deegan wrote:
> At 17:03 +0000 on 15 Nov (1352998993), Mats Petersson wrote:
>>> On an AMD CPU we _don't_ have dedicated stacks for NMI or MCE when we're
>>> running a HVM guest, so the stack issue doesn't apply (but nested NMIs
>>> are still bad).
>>>
>>> On an Intel CPU, we _do_ use dedicated stacks for NMI and MCE in HVM
>>> guests.  We don't really have to but it saves time in the context switch
>>> not to update the IDT.  Using do_nmi() here means that the first NMI is
>>> handled on the normal stack instead.  It's also consistent with the way
>>> we call do_machine_check() for the MCE case.  But it needs an explicit
>>> IRET after the call to do_nmi() to make sure that NMIs get re-enabled.
>> Both AMD and Intel has an identical setup with regard to stacks and
>> general "what happens when we taken one of these interrupts".
> My reading of svm_ctxt_switch_{to,from} makes me disagree with this.
> AFAICT, on SVM we're not using dedicated stacks at all.
In SVM, the VMRUN returns to whatever stack you had before the VMRUN. 
This is not what I'm talking about, however. The stack used for the NMI 
and MCE comes from the interrupt descriptor entry for those respective 
vectors.

I'm fairly sure (but I haven't followed all the code-paths to verify 
this) that both AMD and Intel HVM code uses the same stack when a VMEXIT 
happens (as in, the the value in RSP, at least nominally, the same value 
each time you end up in the {svm,vmx}_exit_handler(), but the value may 
vary from one time to another, and probably isn't the exact same on an 
Intel vs. AMD comparison). The Intel solution is slightly different as 
to "how you end up with the RSP value you want to be at", but that's a 
beside the point.

Either way, what stack we are on at VMEXIT shouldn't matter to the 
handling of NMI or MCE, but we should avoid using the "current" stack to 
handle NMI, in case it's somehow causing further problems to do so, and 
we need the NMI to "get out of a problem". Similarly for MCE - if the 
memory used by RSP is bad, we probably don't want to reboot the machine 
by using it to store the return address for MCE (although I'm not sure 
we can completely avoid that)...

So in conclusion, the do_mce_exception() call probably should be a 
__asm__ __volatile__("int $X"), where X is the relevant vector. 
[Although I admit that when we take an MCE exception from HVM, it 
hopefully isn't using the Hypervisor stack that the VMEXIT happens to 
use... That would be rather bad in all manner of ways, and of course, 
the MCE stack may also be equally bad!]

--
Mats
>
>> The issues with regards to nesting of NMI and MCE is completely
>> different from the "how do we issue an NMI from the HVM handling code
>> when the guest got interrupted by NMI".
> Yes.  As I said, we should take the fix to the VMX NMI handling now, and
> sort out the nesting separately.
>
> Tim.
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:34:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:34:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ3KU-0000Ft-4h; Thu, 15 Nov 2012 17:34:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZ3KS-0000Fo-14
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 17:34:16 +0000
Received: from [85.158.138.51:25806] by server-14.bemta-3.messagelabs.com id
	D6/6F-12788-79725A05; Thu, 15 Nov 2012 17:34:15 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1353000853!30178662!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM4MzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12772 invoked from network); 15 Nov 2012 17:34:14 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 17:34:14 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208";a="44745144"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	15 Nov 2012 17:33:04 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Thu, 15 Nov 2012 12:33:03 -0500
Message-ID: <50A5274E.4030302@citrix.com>
Date: Thu, 15 Nov 2012 17:33:02 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A52051.9010807@citrix.com>
	<20121115171537.GF75988@ocelot.phlegethon.org>
In-Reply-To: <20121115171537.GF75988@ocelot.phlegethon.org>
X-Originating-IP: [10.80.3.146]
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 15/11/12 17:15, Tim Deegan wrote:
> At 17:03 +0000 on 15 Nov (1352998993), Mats Petersson wrote:
>>> On an AMD CPU we _don't_ have dedicated stacks for NMI or MCE when we're
>>> running a HVM guest, so the stack issue doesn't apply (but nested NMIs
>>> are still bad).
>>>
>>> On an Intel CPU, we _do_ use dedicated stacks for NMI and MCE in HVM
>>> guests.  We don't really have to but it saves time in the context switch
>>> not to update the IDT.  Using do_nmi() here means that the first NMI is
>>> handled on the normal stack instead.  It's also consistent with the way
>>> we call do_machine_check() for the MCE case.  But it needs an explicit
>>> IRET after the call to do_nmi() to make sure that NMIs get re-enabled.
>> Both AMD and Intel has an identical setup with regard to stacks and
>> general "what happens when we taken one of these interrupts".
> My reading of svm_ctxt_switch_{to,from} makes me disagree with this.
> AFAICT, on SVM we're not using dedicated stacks at all.
In SVM, the VMRUN returns to whatever stack you had before the VMRUN. 
This is not what I'm talking about, however. The stack used for the NMI 
and MCE comes from the interrupt descriptor entry for those respective 
vectors.

I'm fairly sure (but I haven't followed all the code-paths to verify 
this) that both AMD and Intel HVM code uses the same stack when a VMEXIT 
happens (as in, the the value in RSP, at least nominally, the same value 
each time you end up in the {svm,vmx}_exit_handler(), but the value may 
vary from one time to another, and probably isn't the exact same on an 
Intel vs. AMD comparison). The Intel solution is slightly different as 
to "how you end up with the RSP value you want to be at", but that's a 
beside the point.

Either way, what stack we are on at VMEXIT shouldn't matter to the 
handling of NMI or MCE, but we should avoid using the "current" stack to 
handle NMI, in case it's somehow causing further problems to do so, and 
we need the NMI to "get out of a problem". Similarly for MCE - if the 
memory used by RSP is bad, we probably don't want to reboot the machine 
by using it to store the return address for MCE (although I'm not sure 
we can completely avoid that)...

So in conclusion, the do_mce_exception() call probably should be a 
__asm__ __volatile__("int $X"), where X is the relevant vector. 
[Although I admit that when we take an MCE exception from HVM, it 
hopefully isn't using the Hypervisor stack that the VMEXIT happens to 
use... That would be rather bad in all manner of ways, and of course, 
the MCE stack may also be equally bad!]

--
Mats
>
>> The issues with regards to nesting of NMI and MCE is completely
>> different from the "how do we issue an NMI from the HVM handling code
>> when the guest got interrupted by NMI".
> Yes.  As I said, we should take the fix to the VMX NMI handling now, and
> sort out the nesting separately.
>
> Tim.
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:40:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:40:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ3Pt-0000VI-TZ; Thu, 15 Nov 2012 17:39:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZ3Pr-0000VC-I7
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 17:39:51 +0000
Received: from [85.158.143.35:20449] by server-1.bemta-4.messagelabs.com id
	F0/5D-27934-6E825A05; Thu, 15 Nov 2012 17:39:50 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1353001190!17868406!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11064 invoked from network); 15 Nov 2012 17:39:50 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 17:39:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208";a="15835062"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 17:39:50 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 17:39:49 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TZ3Pp-0000Fx-Km;
	Thu, 15 Nov 2012 17:39:49 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TZ3Pp-0003Lx-HY;
	Thu, 15 Nov 2012 17:39:49 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14400-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 15 Nov 2012 17:39:49 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.1-testing test] 14400: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14400 xen-4.1-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14400/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail like 14390

Tests which did not succeed, but are not blocking:
 test-amd64-i386-qemuu-rhel6hvm-intel 11 leak-check/check       fail never pass
 test-amd64-i386-qemuu-rhel6hvm-amd 11 leak-check/check         fail never pass
 test-amd64-i386-rhel6hvm-intel 11 leak-check/check             fail never pass
 test-amd64-i386-rhel6hvm-amd 11 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-i386-i386-xl-qemuu-winxpsp3 13 guest-stop                 fail never pass

version targeted for testing:
 xen                  ce405f5fd5ee
baseline version:
 xen                  178f63286b02

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               fail    
 test-amd64-i386-qemuu-rhel6hvm-intel                         fail    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 pass    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     pass    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.1-testing
+ revision=ce405f5fd5ee
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.1-testing ce405f5fd5ee
+ branch=xen-4.1-testing
+ revision=ce405f5fd5ee
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.1-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.1-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.1-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.1-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.1-testing.git
++ : daily-cron.xen-4.1-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.1-testing.git
+ info_linux_tree xen-4.1-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.1-testing.hg
+ hg push -r ce405f5fd5ee ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 3 changesets with 4 changes to 4 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:40:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:40:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ3Pt-0000VI-TZ; Thu, 15 Nov 2012 17:39:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZ3Pr-0000VC-I7
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 17:39:51 +0000
Received: from [85.158.143.35:20449] by server-1.bemta-4.messagelabs.com id
	F0/5D-27934-6E825A05; Thu, 15 Nov 2012 17:39:50 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1353001190!17868406!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11064 invoked from network); 15 Nov 2012 17:39:50 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 17:39:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208";a="15835062"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 17:39:50 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 17:39:49 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TZ3Pp-0000Fx-Km;
	Thu, 15 Nov 2012 17:39:49 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TZ3Pp-0003Lx-HY;
	Thu, 15 Nov 2012 17:39:49 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14400-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 15 Nov 2012 17:39:49 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.1-testing test] 14400: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14400 xen-4.1-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14400/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail like 14390

Tests which did not succeed, but are not blocking:
 test-amd64-i386-qemuu-rhel6hvm-intel 11 leak-check/check       fail never pass
 test-amd64-i386-qemuu-rhel6hvm-amd 11 leak-check/check         fail never pass
 test-amd64-i386-rhel6hvm-intel 11 leak-check/check             fail never pass
 test-amd64-i386-rhel6hvm-amd 11 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-i386-i386-xl-qemuu-winxpsp3 13 guest-stop                 fail never pass

version targeted for testing:
 xen                  ce405f5fd5ee
baseline version:
 xen                  178f63286b02

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               fail    
 test-amd64-i386-qemuu-rhel6hvm-intel                         fail    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 pass    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     pass    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.1-testing
+ revision=ce405f5fd5ee
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.1-testing ce405f5fd5ee
+ branch=xen-4.1-testing
+ revision=ce405f5fd5ee
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.1-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.1-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.1-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.1-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.1-testing.git
++ : daily-cron.xen-4.1-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.1-testing.git
+ info_linux_tree xen-4.1-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.1-testing.hg
+ hg push -r ce405f5fd5ee ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 3 changesets with 4 changes to 4 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:44:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:44:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ3Ub-0000pP-SJ; Thu, 15 Nov 2012 17:44:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TZ3Ua-0000oy-Dq
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 17:44:44 +0000
Received: from [193.109.254.147:26641] by server-10.bemta-14.messagelabs.com
	id 07/20-31741-B0A25A05; Thu, 15 Nov 2012 17:44:43 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1353001483!8525986!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3138 invoked from network); 15 Nov 2012 17:44:43 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-4.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 17:44:43 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TZ3UY-000KrS-BL; Thu, 15 Nov 2012 17:44:42 +0000
Date: Thu, 15 Nov 2012 17:44:42 +0000
From: Tim Deegan <tim@xen.org>
To: Mats Petersson <mats.petersson@citrix.com>
Message-ID: <20121115174442.GH75988@ocelot.phlegethon.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A52051.9010807@citrix.com>
	<20121115171537.GF75988@ocelot.phlegethon.org>
	<50A5274E.4030302@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A5274E.4030302@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
	real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 17:33 +0000 on 15 Nov (1353000782), Mats Petersson wrote:
> On 15/11/12 17:15, Tim Deegan wrote:
> >At 17:03 +0000 on 15 Nov (1352998993), Mats Petersson wrote:
> >>>On an AMD CPU we _don't_ have dedicated stacks for NMI or MCE when we're
> >>>running a HVM guest, so the stack issue doesn't apply (but nested NMIs
> >>>are still bad).
> >>>
> >>>On an Intel CPU, we _do_ use dedicated stacks for NMI and MCE in HVM
> >>>guests.  We don't really have to but it saves time in the context switch
> >>>not to update the IDT.  Using do_nmi() here means that the first NMI is
> >>>handled on the normal stack instead.  It's also consistent with the way
> >>>we call do_machine_check() for the MCE case.  But it needs an explicit
> >>>IRET after the call to do_nmi() to make sure that NMIs get re-enabled.
> >>Both AMD and Intel has an identical setup with regard to stacks and
> >>general "what happens when we taken one of these interrupts".
> >My reading of svm_ctxt_switch_{to,from} makes me disagree with this.
> >AFAICT, on SVM we're not using dedicated stacks at all.
> In SVM, the VMRUN returns to whatever stack you had before the VMRUN. 
> This is not what I'm talking about, however. The stack used for the NMI 
> and MCE comes from the interrupt descriptor entry for those respective 
> vectors.

This is the code I was referring to:

    /*
     * Cannot use ISTs for NMI/#MC/#DF while we are running with the guest TR.
     * But this doesn't matter: the IST is only req'd to handle SYSCALL/SYSRET.
     */
    idt_tables[cpu][TRAP_double_fault].a  &= ~(7UL << 32);
    idt_tables[cpu][TRAP_nmi].a           &= ~(7UL << 32);
    idt_tables[cpu][TRAP_machine_check].a &= ~(7UL << 32);

Am I misreading it?

> So in conclusion, the do_mce_exception() call probably should be a 
> __asm__ __volatile__("int $X"), where X is the relevant vector. 

This handles MCEs that were raised in guest context.  If we've managed
to get this far into the exit handler, the hypervisor stack is probably
OK. :)

I'd be happy to invoke the MCE handler though the IDT here, just for
symmetry with the other cases, but I don't think it makes much
difference. 

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:44:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:44:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ3Ub-0000pP-SJ; Thu, 15 Nov 2012 17:44:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TZ3Ua-0000oy-Dq
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 17:44:44 +0000
Received: from [193.109.254.147:26641] by server-10.bemta-14.messagelabs.com
	id 07/20-31741-B0A25A05; Thu, 15 Nov 2012 17:44:43 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1353001483!8525986!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3138 invoked from network); 15 Nov 2012 17:44:43 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-4.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 17:44:43 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TZ3UY-000KrS-BL; Thu, 15 Nov 2012 17:44:42 +0000
Date: Thu, 15 Nov 2012 17:44:42 +0000
From: Tim Deegan <tim@xen.org>
To: Mats Petersson <mats.petersson@citrix.com>
Message-ID: <20121115174442.GH75988@ocelot.phlegethon.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A52051.9010807@citrix.com>
	<20121115171537.GF75988@ocelot.phlegethon.org>
	<50A5274E.4030302@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A5274E.4030302@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
	real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 17:33 +0000 on 15 Nov (1353000782), Mats Petersson wrote:
> On 15/11/12 17:15, Tim Deegan wrote:
> >At 17:03 +0000 on 15 Nov (1352998993), Mats Petersson wrote:
> >>>On an AMD CPU we _don't_ have dedicated stacks for NMI or MCE when we're
> >>>running a HVM guest, so the stack issue doesn't apply (but nested NMIs
> >>>are still bad).
> >>>
> >>>On an Intel CPU, we _do_ use dedicated stacks for NMI and MCE in HVM
> >>>guests.  We don't really have to but it saves time in the context switch
> >>>not to update the IDT.  Using do_nmi() here means that the first NMI is
> >>>handled on the normal stack instead.  It's also consistent with the way
> >>>we call do_machine_check() for the MCE case.  But it needs an explicit
> >>>IRET after the call to do_nmi() to make sure that NMIs get re-enabled.
> >>Both AMD and Intel has an identical setup with regard to stacks and
> >>general "what happens when we taken one of these interrupts".
> >My reading of svm_ctxt_switch_{to,from} makes me disagree with this.
> >AFAICT, on SVM we're not using dedicated stacks at all.
> In SVM, the VMRUN returns to whatever stack you had before the VMRUN. 
> This is not what I'm talking about, however. The stack used for the NMI 
> and MCE comes from the interrupt descriptor entry for those respective 
> vectors.

This is the code I was referring to:

    /*
     * Cannot use ISTs for NMI/#MC/#DF while we are running with the guest TR.
     * But this doesn't matter: the IST is only req'd to handle SYSCALL/SYSRET.
     */
    idt_tables[cpu][TRAP_double_fault].a  &= ~(7UL << 32);
    idt_tables[cpu][TRAP_nmi].a           &= ~(7UL << 32);
    idt_tables[cpu][TRAP_machine_check].a &= ~(7UL << 32);

Am I misreading it?

> So in conclusion, the do_mce_exception() call probably should be a 
> __asm__ __volatile__("int $X"), where X is the relevant vector. 

This handles MCEs that were raised in guest context.  If we've managed
to get this far into the exit handler, the hypervisor stack is probably
OK. :)

I'd be happy to invoke the MCE handler though the IDT here, just for
symmetry with the other cases, but I don't think it makes much
difference. 

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:49:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:49:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ3Yn-00013Z-OM; Thu, 15 Nov 2012 17:49:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZ3Yk-00013R-Oy
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 17:49:04 +0000
Received: from [85.158.138.51:25169] by server-13.bemta-3.messagelabs.com id
	3E/A8-24887-E0B25A05; Thu, 15 Nov 2012 17:49:02 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1353001741!22265912!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8900 invoked from network); 15 Nov 2012 17:49:01 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 17:49:01 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208";a="15835273"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 17:48:51 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Thu, 15 Nov 2012
	17:48:52 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Date: Thu, 15 Nov 2012 17:48:50 +0000
Thread-Topic: [PATCH] block: vpc support for ~2 TB disks
Thread-Index: Ac3ChhSXsKo9ys8oS7yEpfnGDpArNwA0diYQ
Message-ID: <4B45B535F7F6BE4CB1C044ED5115CDDE012D550D2585@LONPMAILBOX01.citrite.net>
References: <50A0E79F0200009100082E4C@novprvoes0310.provo.novell.com>
	<50A2250A.4070108@redhat.com>
	<alpine.DEB.2.02.1211131054200.28049@kaball.uk.xensource.com>
	<4B45B535F7F6BE4CB1C044ED5115CDDE012D550D234B@LONPMAILBOX01.citrite.net>
	<50A3C853.4010809@redhat.com>
In-Reply-To: <50A3C853.4010809@redhat.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: Charles Arnold <carnold@suse.com>, Kevin Wolf <kwolf@redhat.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"stefanha@redhat.com" <stefanha@redhat.com>
Subject: Re: [Xen-devel] [PATCH] block: vpc support for ~2 TB disks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I'm not sure I understand your question. In XenServer blktap2 we set CHS to 65535*16*255 in the VHD metadata for disks larger than 127GB. We don't really care about these values, we just store them in the VHD metadata.

> -----Original Message-----
> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> Sent: 14 November 2012 16:36
> To: Thanos Makatos
> Cc: Stefano Stabellini; Charles Arnold; qemu-devel@nongnu.org; Kevin
> Wolf; stefanha@redhat.com; xen-devel@lists.xensource.com
> Subject: Re: [PATCH] block: vpc support for ~2 TB disks
> 
> Il 14/11/2012 17:25, Thanos Makatos ha scritto:
> > We don't use qemu's VHD driver in XenServer. Instead, we use blktap2
> > to create a block device in dom0 serving the VHD file in question,
> and
> > have qemu open that block device instead of the VHD file itself.
> 
> Yes, the question is how you handle disks bigger than 127GB, so that
> QEMU can do the same.
> 
> Paolo

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:49:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:49:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ3Yn-00013Z-OM; Thu, 15 Nov 2012 17:49:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZ3Yk-00013R-Oy
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 17:49:04 +0000
Received: from [85.158.138.51:25169] by server-13.bemta-3.messagelabs.com id
	3E/A8-24887-E0B25A05; Thu, 15 Nov 2012 17:49:02 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1353001741!22265912!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8900 invoked from network); 15 Nov 2012 17:49:01 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 17:49:01 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208";a="15835273"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 17:48:51 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Thu, 15 Nov 2012
	17:48:52 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Date: Thu, 15 Nov 2012 17:48:50 +0000
Thread-Topic: [PATCH] block: vpc support for ~2 TB disks
Thread-Index: Ac3ChhSXsKo9ys8oS7yEpfnGDpArNwA0diYQ
Message-ID: <4B45B535F7F6BE4CB1C044ED5115CDDE012D550D2585@LONPMAILBOX01.citrite.net>
References: <50A0E79F0200009100082E4C@novprvoes0310.provo.novell.com>
	<50A2250A.4070108@redhat.com>
	<alpine.DEB.2.02.1211131054200.28049@kaball.uk.xensource.com>
	<4B45B535F7F6BE4CB1C044ED5115CDDE012D550D234B@LONPMAILBOX01.citrite.net>
	<50A3C853.4010809@redhat.com>
In-Reply-To: <50A3C853.4010809@redhat.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: Charles Arnold <carnold@suse.com>, Kevin Wolf <kwolf@redhat.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"stefanha@redhat.com" <stefanha@redhat.com>
Subject: Re: [Xen-devel] [PATCH] block: vpc support for ~2 TB disks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I'm not sure I understand your question. In XenServer blktap2 we set CHS to 65535*16*255 in the VHD metadata for disks larger than 127GB. We don't really care about these values, we just store them in the VHD metadata.

> -----Original Message-----
> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> Sent: 14 November 2012 16:36
> To: Thanos Makatos
> Cc: Stefano Stabellini; Charles Arnold; qemu-devel@nongnu.org; Kevin
> Wolf; stefanha@redhat.com; xen-devel@lists.xensource.com
> Subject: Re: [PATCH] block: vpc support for ~2 TB disks
> 
> Il 14/11/2012 17:25, Thanos Makatos ha scritto:
> > We don't use qemu's VHD driver in XenServer. Instead, we use blktap2
> > to create a block device in dom0 serving the VHD file in question,
> and
> > have qemu open that block device instead of the VHD file itself.
> 
> Yes, the question is how you handle disks bigger than 127GB, so that
> QEMU can do the same.
> 
> Paolo

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:49:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:49:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ3Z4-00014t-54; Thu, 15 Nov 2012 17:49:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TZ3Z2-00014e-QL
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 17:49:21 +0000
Received: from [85.158.138.51:25668] by server-8.bemta-3.messagelabs.com id
	EF/1B-07786-B1B25A05; Thu, 15 Nov 2012 17:49:15 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1353001753!30169737!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM4MzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13563 invoked from network); 15 Nov 2012 17:49:14 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 17:49:14 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208";a="44747673"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 17:48:49 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 12:48:48 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TZ3YR-00042H-7L;
	Thu, 15 Nov 2012 17:48:43 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <Ian.Campbell@citrix.com>
Date: Thu, 15 Nov 2012 17:48:07 +0000
Message-ID: <1353001687-3560-1-git-send-email-stefano.stabellini@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
MIME-Version: 1.0
Cc: xen-devel@lists.xensource.com, tim@xen.org,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH v3] xen/arm: get the number of cpus from device
	tree
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The system might have fewer cpus than the GIC supports.

Changes in v3:
- get cpu nodes matching the device_type property on the DT;
- get the cpu ID from the reg property on the DT;
- hook the DT cpu parsing in early_scan_node.

Changes in v2:
- return always at least 1 cpu;
- skip nodes with names that don't start with "cpu".

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/gic.c        |    4 +---
 xen/arch/arm/gic.h        |    2 +-
 xen/arch/arm/setup.c      |    5 ++++-
 xen/arch/arm/smpboot.c    |   27 ++++++++++++++++++++-------
 xen/common/device_tree.c  |   43 +++++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/smp.h |    2 ++
 6 files changed, 71 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 5f06e08..0c6fab9 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -304,7 +304,7 @@ static void __cpuinit gic_hyp_disable(void)
 }
 
 /* Set up the GIC */
-int __init gic_init(void)
+void __init gic_init(void)
 {
     /* XXX FIXME get this from devicetree */
     gic.dbase = GIC_BASE_ADDRESS + GIC_DR_OFFSET;
@@ -328,8 +328,6 @@ int __init gic_init(void)
     gic.lr_mask = 0ULL;
 
     spin_unlock(&gic.lock);
-
-    return gic.cpus;
 }
 
 /* Set up the per-CPU parts of the GIC for a secondary CPU */
diff --git a/xen/arch/arm/gic.h b/xen/arch/arm/gic.h
index b2e1d7f..1bf1b02 100644
--- a/xen/arch/arm/gic.h
+++ b/xen/arch/arm/gic.h
@@ -147,7 +147,7 @@ extern int gic_route_irq_to_guest(struct domain *d, unsigned int irq,
 /* Accept an interrupt from the GIC and dispatch its handler */
 extern void gic_interrupt(struct cpu_user_regs *regs, int is_fiq);
 /* Bring up the interrupt controller, and report # cpus attached */
-extern int gic_init(void);
+extern void gic_init(void);
 /* Bring up a secondary CPU's per-CPU GIC interface */
 extern void gic_init_secondary_cpu(void);
 /* Take down a CPU's per-CPU GIC interface */
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index a579a56..d5d845a 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -189,10 +189,13 @@ void __init start_xen(unsigned long boot_phys_offset,
     if ( cacheline_bytes < MIN_CACHELINE_BYTES )
         panic("CPU has preposterously small cache lines");
 
+    smp_clear_cpu_maps();
+
     fdt = (void *)BOOT_MISC_VIRT_START
         + (atag_paddr & ((1 << SECOND_SHIFT) - 1));
     fdt_size = device_tree_early_init(fdt);
 
+    cpus = smp_get_max_cpus();
     cmdline_parse(device_tree_bootargs(fdt));
 
     setup_pagetables(boot_phys_offset, get_xen_paddr());
@@ -203,7 +206,7 @@ void __init start_xen(unsigned long boot_phys_offset,
     console_init_preirq();
 #endif
 
-    cpus = gic_init();
+    gic_init();
     make_cpus_ready(cpus, boot_phys_offset);
 
     percpu_init_areas();
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index f4fd512..93b7ded 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -71,18 +71,31 @@ static void setup_cpu_sibling_map(int cpu)
     cpumask_set_cpu(cpu, per_cpu(cpu_core_mask, cpu));
 }
 
-
 void __init
-smp_prepare_cpus (unsigned int max_cpus)
+smp_clear_cpu_maps (void)
 {
-    int i;
-
+    cpumask_clear(&cpu_possible_map);
     cpumask_clear(&cpu_online_map);
     cpumask_set_cpu(0, &cpu_online_map);
+    cpumask_set_cpu(0, &cpu_possible_map);
+}
 
-    cpumask_clear(&cpu_possible_map);
-    for ( i = 0; i < max_cpus; i++ )
-        cpumask_set_cpu(i, &cpu_possible_map);
+int __init
+smp_get_max_cpus (void)
+{
+    int i, max_cpus = 0;
+
+    for ( i = 0; i < nr_cpu_ids; i++ )
+        if ( cpu_possible(i) )
+            max_cpus++;
+
+    return max_cpus;
+}
+
+
+void __init
+smp_prepare_cpus (unsigned int max_cpus)
+{
     cpumask_copy(&cpu_present_map, &cpu_possible_map);
 
     setup_cpu_sibling_map(0);
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 3d1f0f4..da0af77 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -18,6 +18,7 @@
 #include <xen/mm.h>
 #include <xen/stdarg.h>
 #include <xen/string.h>
+#include <xen/cpumask.h>
 #include <asm/early_printk.h>
 
 struct dt_early_info __initdata early_info;
@@ -41,6 +42,18 @@ bool_t device_tree_node_matches(const void *fdt, int node, const char *match)
         && (name[match_len] == '@' || name[match_len] == '\0');
 }
 
+bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
+{
+    int len;
+    const void *prop;
+
+    prop = fdt_getprop(fdt, node, "device_type", &len);
+    if ( prop == NULL )
+        return 0;
+
+    return !strncmp(prop, match, len);
+}
+
 static void __init get_val(const u32 **cell, u32 cells, u64 *val)
 {
     *val = 0;
@@ -229,6 +242,34 @@ static void __init process_memory_node(const void *fdt, int node,
     }
 }
 
+static void __init process_cpu_node(const void *fdt, int node,
+                                    const char *name,
+                                    u32 address_cells, u32 size_cells)
+{
+    const struct fdt_property *prop;
+    const u32 *cell;
+    paddr_t start, size;
+
+    if ( address_cells != 1 || size_cells != 0 )
+    {
+        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
+                     name);
+        return;
+    }
+
+    prop = fdt_get_property(fdt, node, "reg", NULL);
+    if ( !prop )
+    {
+        early_printk("fdt: node `%s': missing `reg' property\n", name);
+        return;
+    }
+
+    cell = (const u32 *)prop->data;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+
+    cpumask_set_cpu(start, &cpu_possible_map);
+}
+
 static int __init early_scan_node(const void *fdt,
                                   int node, const char *name, int depth,
                                   u32 address_cells, u32 size_cells,
@@ -236,6 +277,8 @@ static int __init early_scan_node(const void *fdt,
 {
     if ( device_tree_node_matches(fdt, node, "memory") )
         process_memory_node(fdt, node, name, address_cells, size_cells);
+    else if ( device_tree_type_matches(fdt, node, "cpu") )
+        process_cpu_node(fdt, node, name, address_cells, size_cells);
 
     return 0;
 }
diff --git a/xen/include/asm-arm/smp.h b/xen/include/asm-arm/smp.h
index a98032d..d4ed1cb 100644
--- a/xen/include/asm-arm/smp.h
+++ b/xen/include/asm-arm/smp.h
@@ -22,6 +22,8 @@ extern void stop_cpu(void);
 extern void
 make_cpus_ready(unsigned int max_cpus, unsigned long boot_phys_offset);
 
+extern void smp_clear_cpu_maps (void);
+extern int smp_get_max_cpus (void);
 #endif
 /*
  * Local variables:
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 17:49:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 17:49:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ3Z4-00014t-54; Thu, 15 Nov 2012 17:49:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TZ3Z2-00014e-QL
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 17:49:21 +0000
Received: from [85.158.138.51:25668] by server-8.bemta-3.messagelabs.com id
	EF/1B-07786-B1B25A05; Thu, 15 Nov 2012 17:49:15 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1353001753!30169737!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM4MzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13563 invoked from network); 15 Nov 2012 17:49:14 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 17:49:14 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208";a="44747673"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 17:48:49 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 12:48:48 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TZ3YR-00042H-7L;
	Thu, 15 Nov 2012 17:48:43 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <Ian.Campbell@citrix.com>
Date: Thu, 15 Nov 2012 17:48:07 +0000
Message-ID: <1353001687-3560-1-git-send-email-stefano.stabellini@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
MIME-Version: 1.0
Cc: xen-devel@lists.xensource.com, tim@xen.org,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH v3] xen/arm: get the number of cpus from device
	tree
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The system might have fewer cpus than the GIC supports.

Changes in v3:
- get cpu nodes matching the device_type property on the DT;
- get the cpu ID from the reg property on the DT;
- hook the DT cpu parsing in early_scan_node.

Changes in v2:
- return always at least 1 cpu;
- skip nodes with names that don't start with "cpu".

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/gic.c        |    4 +---
 xen/arch/arm/gic.h        |    2 +-
 xen/arch/arm/setup.c      |    5 ++++-
 xen/arch/arm/smpboot.c    |   27 ++++++++++++++++++++-------
 xen/common/device_tree.c  |   43 +++++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/smp.h |    2 ++
 6 files changed, 71 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 5f06e08..0c6fab9 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -304,7 +304,7 @@ static void __cpuinit gic_hyp_disable(void)
 }
 
 /* Set up the GIC */
-int __init gic_init(void)
+void __init gic_init(void)
 {
     /* XXX FIXME get this from devicetree */
     gic.dbase = GIC_BASE_ADDRESS + GIC_DR_OFFSET;
@@ -328,8 +328,6 @@ int __init gic_init(void)
     gic.lr_mask = 0ULL;
 
     spin_unlock(&gic.lock);
-
-    return gic.cpus;
 }
 
 /* Set up the per-CPU parts of the GIC for a secondary CPU */
diff --git a/xen/arch/arm/gic.h b/xen/arch/arm/gic.h
index b2e1d7f..1bf1b02 100644
--- a/xen/arch/arm/gic.h
+++ b/xen/arch/arm/gic.h
@@ -147,7 +147,7 @@ extern int gic_route_irq_to_guest(struct domain *d, unsigned int irq,
 /* Accept an interrupt from the GIC and dispatch its handler */
 extern void gic_interrupt(struct cpu_user_regs *regs, int is_fiq);
 /* Bring up the interrupt controller, and report # cpus attached */
-extern int gic_init(void);
+extern void gic_init(void);
 /* Bring up a secondary CPU's per-CPU GIC interface */
 extern void gic_init_secondary_cpu(void);
 /* Take down a CPU's per-CPU GIC interface */
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index a579a56..d5d845a 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -189,10 +189,13 @@ void __init start_xen(unsigned long boot_phys_offset,
     if ( cacheline_bytes < MIN_CACHELINE_BYTES )
         panic("CPU has preposterously small cache lines");
 
+    smp_clear_cpu_maps();
+
     fdt = (void *)BOOT_MISC_VIRT_START
         + (atag_paddr & ((1 << SECOND_SHIFT) - 1));
     fdt_size = device_tree_early_init(fdt);
 
+    cpus = smp_get_max_cpus();
     cmdline_parse(device_tree_bootargs(fdt));
 
     setup_pagetables(boot_phys_offset, get_xen_paddr());
@@ -203,7 +206,7 @@ void __init start_xen(unsigned long boot_phys_offset,
     console_init_preirq();
 #endif
 
-    cpus = gic_init();
+    gic_init();
     make_cpus_ready(cpus, boot_phys_offset);
 
     percpu_init_areas();
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index f4fd512..93b7ded 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -71,18 +71,31 @@ static void setup_cpu_sibling_map(int cpu)
     cpumask_set_cpu(cpu, per_cpu(cpu_core_mask, cpu));
 }
 
-
 void __init
-smp_prepare_cpus (unsigned int max_cpus)
+smp_clear_cpu_maps (void)
 {
-    int i;
-
+    cpumask_clear(&cpu_possible_map);
     cpumask_clear(&cpu_online_map);
     cpumask_set_cpu(0, &cpu_online_map);
+    cpumask_set_cpu(0, &cpu_possible_map);
+}
 
-    cpumask_clear(&cpu_possible_map);
-    for ( i = 0; i < max_cpus; i++ )
-        cpumask_set_cpu(i, &cpu_possible_map);
+int __init
+smp_get_max_cpus (void)
+{
+    int i, max_cpus = 0;
+
+    for ( i = 0; i < nr_cpu_ids; i++ )
+        if ( cpu_possible(i) )
+            max_cpus++;
+
+    return max_cpus;
+}
+
+
+void __init
+smp_prepare_cpus (unsigned int max_cpus)
+{
     cpumask_copy(&cpu_present_map, &cpu_possible_map);
 
     setup_cpu_sibling_map(0);
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 3d1f0f4..da0af77 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -18,6 +18,7 @@
 #include <xen/mm.h>
 #include <xen/stdarg.h>
 #include <xen/string.h>
+#include <xen/cpumask.h>
 #include <asm/early_printk.h>
 
 struct dt_early_info __initdata early_info;
@@ -41,6 +42,18 @@ bool_t device_tree_node_matches(const void *fdt, int node, const char *match)
         && (name[match_len] == '@' || name[match_len] == '\0');
 }
 
+bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
+{
+    int len;
+    const void *prop;
+
+    prop = fdt_getprop(fdt, node, "device_type", &len);
+    if ( prop == NULL )
+        return 0;
+
+    return !strncmp(prop, match, len);
+}
+
 static void __init get_val(const u32 **cell, u32 cells, u64 *val)
 {
     *val = 0;
@@ -229,6 +242,34 @@ static void __init process_memory_node(const void *fdt, int node,
     }
 }
 
+static void __init process_cpu_node(const void *fdt, int node,
+                                    const char *name,
+                                    u32 address_cells, u32 size_cells)
+{
+    const struct fdt_property *prop;
+    const u32 *cell;
+    paddr_t start, size;
+
+    if ( address_cells != 1 || size_cells != 0 )
+    {
+        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
+                     name);
+        return;
+    }
+
+    prop = fdt_get_property(fdt, node, "reg", NULL);
+    if ( !prop )
+    {
+        early_printk("fdt: node `%s': missing `reg' property\n", name);
+        return;
+    }
+
+    cell = (const u32 *)prop->data;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+
+    cpumask_set_cpu(start, &cpu_possible_map);
+}
+
 static int __init early_scan_node(const void *fdt,
                                   int node, const char *name, int depth,
                                   u32 address_cells, u32 size_cells,
@@ -236,6 +277,8 @@ static int __init early_scan_node(const void *fdt,
 {
     if ( device_tree_node_matches(fdt, node, "memory") )
         process_memory_node(fdt, node, name, address_cells, size_cells);
+    else if ( device_tree_type_matches(fdt, node, "cpu") )
+        process_cpu_node(fdt, node, name, address_cells, size_cells);
 
     return 0;
 }
diff --git a/xen/include/asm-arm/smp.h b/xen/include/asm-arm/smp.h
index a98032d..d4ed1cb 100644
--- a/xen/include/asm-arm/smp.h
+++ b/xen/include/asm-arm/smp.h
@@ -22,6 +22,8 @@ extern void stop_cpu(void);
 extern void
 make_cpus_ready(unsigned int max_cpus, unsigned long boot_phys_offset);
 
+extern void smp_clear_cpu_maps (void);
+extern int smp_get_max_cpus (void);
 #endif
 /*
  * Local variables:
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 18:00:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 18:00:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ3jv-0001ZN-0X; Thu, 15 Nov 2012 18:00:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TZ3jt-0001ZH-KH
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 18:00:33 +0000
Received: from [85.158.138.51:33552] by server-8.bemta-3.messagelabs.com id
	36/A5-07786-0CD25A05; Thu, 15 Nov 2012 18:00:32 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1353002430!22267048!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTUyOTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15934 invoked from network); 15 Nov 2012 18:00:32 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-12.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 18:00:32 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFI0Tmg005181
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 18:00:30 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFI0SbI013231
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 18:00:29 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFI0RWF002868; Thu, 15 Nov 2012 12:00:27 -0600
MIME-Version: 1.0
Message-ID: <c0905ad1-ed26-485b-9232-3475fd32e6a4@default>
Date: Thu, 15 Nov 2012 10:00:22 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<50A4D12002000078000A8C68@nat28.tlf.novell.com>
In-Reply-To: <50A4D12002000078000A8C68@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Keir Fraser <keir@xen.org>, TimDeegan <tim@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Thursday, November 15, 2012 3:25 AM
> To: Dan Magenheimer
> Cc: xen-devel@lists.xen.org; KonradWilk; Zhigang Wang; Keir Fraser; TimDeegan
> Subject: Re: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall

Hi Jan --

Thanks for the quick review!

Mostly fixed for v3 but a couple things:
 
> > +     * Claimed memory is considered unavailable unless the request
> > +     * is made by a domain with sufficient unclaimed pages.
> > +     */
> > +    if ( (total_unclaimed_pages + request >
> > +           total_avail_pages + tmem_freeable_pages()) &&
> > +          (d == NULL || d->unclaimed_pages < request) )
> > +        goto not_found;
> 
> The treatment of d being NULL certainly needs further thought:
> Is it really better to fulfill the claim and fail some (perhaps
> important) _xmalloc()?

Ideally, allocation in the presence of existing claims should
behave as if the claiming domains had actually already allocated
the unclaimed-amount-of-memory.  So I'd argue that enforcing
the claim should be sacrosanct here.
 
> Also, I'm missing a mechanism by which the tools could find out
> how much unclaimed memory is available, in order to determine
> (if in use) how much memory needs to be ballooned out of Dom0.

OK.  I'm not certain if this will be useful on a per-domain
basis as well but, for completeness, I will also add
unclaimed_pages into xc_dominfo etc (which causes a bump
in XEN_DOMCTL_INTERFACE_VERSION).

> Similarly, but perhaps of lower priority, there is no integration
> with the low-mem handling.

I'd also consider this lower priority as Olaf and Andre
have argued that the claim mechanism is not needed for
sharing/paging so the two mechanisms may not
be used together, at least for the foreseeable future.
So I plan to skip this, unless you change your mind and
consider it a showstopper for acceptance.

> Finally, there still are a number of formatting issues.

Hmmm... I found one I think.  Is there an equivalent to
checkpatch for hypervisor code?  If you see any formatting
issues in v3, please call them out explicitly as I am
sincerely trying to avoid them.

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 18:00:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 18:00:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ3jv-0001ZN-0X; Thu, 15 Nov 2012 18:00:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TZ3jt-0001ZH-KH
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 18:00:33 +0000
Received: from [85.158.138.51:33552] by server-8.bemta-3.messagelabs.com id
	36/A5-07786-0CD25A05; Thu, 15 Nov 2012 18:00:32 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1353002430!22267048!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTUyOTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15934 invoked from network); 15 Nov 2012 18:00:32 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-12.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 18:00:32 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFI0Tmg005181
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 18:00:30 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFI0SbI013231
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 18:00:29 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFI0RWF002868; Thu, 15 Nov 2012 12:00:27 -0600
MIME-Version: 1.0
Message-ID: <c0905ad1-ed26-485b-9232-3475fd32e6a4@default>
Date: Thu, 15 Nov 2012 10:00:22 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<50A4D12002000078000A8C68@nat28.tlf.novell.com>
In-Reply-To: <50A4D12002000078000A8C68@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Keir Fraser <keir@xen.org>, TimDeegan <tim@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Thursday, November 15, 2012 3:25 AM
> To: Dan Magenheimer
> Cc: xen-devel@lists.xen.org; KonradWilk; Zhigang Wang; Keir Fraser; TimDeegan
> Subject: Re: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall

Hi Jan --

Thanks for the quick review!

Mostly fixed for v3 but a couple things:
 
> > +     * Claimed memory is considered unavailable unless the request
> > +     * is made by a domain with sufficient unclaimed pages.
> > +     */
> > +    if ( (total_unclaimed_pages + request >
> > +           total_avail_pages + tmem_freeable_pages()) &&
> > +          (d == NULL || d->unclaimed_pages < request) )
> > +        goto not_found;
> 
> The treatment of d being NULL certainly needs further thought:
> Is it really better to fulfill the claim and fail some (perhaps
> important) _xmalloc()?

Ideally, allocation in the presence of existing claims should
behave as if the claiming domains had actually already allocated
the unclaimed-amount-of-memory.  So I'd argue that enforcing
the claim should be sacrosanct here.
 
> Also, I'm missing a mechanism by which the tools could find out
> how much unclaimed memory is available, in order to determine
> (if in use) how much memory needs to be ballooned out of Dom0.

OK.  I'm not certain if this will be useful on a per-domain
basis as well but, for completeness, I will also add
unclaimed_pages into xc_dominfo etc (which causes a bump
in XEN_DOMCTL_INTERFACE_VERSION).

> Similarly, but perhaps of lower priority, there is no integration
> with the low-mem handling.

I'd also consider this lower priority as Olaf and Andre
have argued that the claim mechanism is not needed for
sharing/paging so the two mechanisms may not
be used together, at least for the foreseeable future.
So I plan to skip this, unless you change your mind and
consider it a showstopper for acceptance.

> Finally, there still are a number of formatting issues.

Hmmm... I found one I think.  Is there an equivalent to
checkpatch for hypervisor code?  If you see any formatting
issues in v3, please call them out explicitly as I am
sincerely trying to avoid them.

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 18:23:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 18:23:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ45r-0002hz-QC; Thu, 15 Nov 2012 18:23:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZ45p-0002ht-MP
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 18:23:13 +0000
Received: from [85.158.143.35:53513] by server-1.bemta-4.messagelabs.com id
	FE/8E-27934-01335A05; Thu, 15 Nov 2012 18:23:12 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1353003791!13171088!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODY1MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4218 invoked from network); 15 Nov 2012 18:23:12 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-16.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 18:23:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208";a="214660313"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	15 Nov 2012 18:23:10 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Thu, 15 Nov 2012 13:23:10 -0500
Message-ID: <50A5330D.9020204@citrix.com>
Date: Thu, 15 Nov 2012 18:23:09 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A52051.9010807@citrix.com>
	<20121115171537.GF75988@ocelot.phlegethon.org>
	<50A5274E.4030302@citrix.com>
	<20121115174442.GH75988@ocelot.phlegethon.org>
In-Reply-To: <20121115174442.GH75988@ocelot.phlegethon.org>
X-Originating-IP: [10.80.3.146]
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 15/11/12 17:44, Tim Deegan wrote:
> At 17:33 +0000 on 15 Nov (1353000782), Mats Petersson wrote:
>> On 15/11/12 17:15, Tim Deegan wrote:
>>> At 17:03 +0000 on 15 Nov (1352998993), Mats Petersson wrote:
>>>>> On an AMD CPU we _don't_ have dedicated stacks for NMI or MCE when we're
>>>>> running a HVM guest, so the stack issue doesn't apply (but nested NMIs
>>>>> are still bad).
>>>>>
>>>>> On an Intel CPU, we _do_ use dedicated stacks for NMI and MCE in HVM
>>>>> guests.  We don't really have to but it saves time in the context switch
>>>>> not to update the IDT.  Using do_nmi() here means that the first NMI is
>>>>> handled on the normal stack instead.  It's also consistent with the way
>>>>> we call do_machine_check() for the MCE case.  But it needs an explicit
>>>>> IRET after the call to do_nmi() to make sure that NMIs get re-enabled.
>>>> Both AMD and Intel has an identical setup with regard to stacks and
>>>> general "what happens when we taken one of these interrupts".
>>> My reading of svm_ctxt_switch_{to,from} makes me disagree with this.
>>> AFAICT, on SVM we're not using dedicated stacks at all.
>> In SVM, the VMRUN returns to whatever stack you had before the VMRUN.
>> This is not what I'm talking about, however. The stack used for the NMI
>> and MCE comes from the interrupt descriptor entry for those respective
>> vectors.
> This is the code I was referring to:
>
>      /*
>       * Cannot use ISTs for NMI/#MC/#DF while we are running with the guest TR.
>       * But this doesn't matter: the IST is only req'd to handle SYSCALL/SYSRET.
>       */
>      idt_tables[cpu][TRAP_double_fault].a  &= ~(7UL << 32);
>      idt_tables[cpu][TRAP_nmi].a           &= ~(7UL << 32);
>      idt_tables[cpu][TRAP_machine_check].a &= ~(7UL << 32);
>
> Am I misreading it?

No, you are reading it perfectly right, I'm wrong...

--
Mats
>
>> So in conclusion, the do_mce_exception() call probably should be a
>> __asm__ __volatile__("int $X"), where X is the relevant vector.
> This handles MCEs that were raised in guest context.  If we've managed
> to get this far into the exit handler, the hypervisor stack is probably
> OK. :)
>
> I'd be happy to invoke the MCE handler though the IDT here, just for
> symmetry with the other cases, but I don't think it makes much
> difference.
>
> Tim.
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 18:23:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 18:23:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ45r-0002hz-QC; Thu, 15 Nov 2012 18:23:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZ45p-0002ht-MP
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 18:23:13 +0000
Received: from [85.158.143.35:53513] by server-1.bemta-4.messagelabs.com id
	FE/8E-27934-01335A05; Thu, 15 Nov 2012 18:23:12 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1353003791!13171088!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODY1MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4218 invoked from network); 15 Nov 2012 18:23:12 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-16.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 18:23:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208";a="214660313"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	15 Nov 2012 18:23:10 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Thu, 15 Nov 2012 13:23:10 -0500
Message-ID: <50A5330D.9020204@citrix.com>
Date: Thu, 15 Nov 2012 18:23:09 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A52051.9010807@citrix.com>
	<20121115171537.GF75988@ocelot.phlegethon.org>
	<50A5274E.4030302@citrix.com>
	<20121115174442.GH75988@ocelot.phlegethon.org>
In-Reply-To: <20121115174442.GH75988@ocelot.phlegethon.org>
X-Originating-IP: [10.80.3.146]
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 15/11/12 17:44, Tim Deegan wrote:
> At 17:33 +0000 on 15 Nov (1353000782), Mats Petersson wrote:
>> On 15/11/12 17:15, Tim Deegan wrote:
>>> At 17:03 +0000 on 15 Nov (1352998993), Mats Petersson wrote:
>>>>> On an AMD CPU we _don't_ have dedicated stacks for NMI or MCE when we're
>>>>> running a HVM guest, so the stack issue doesn't apply (but nested NMIs
>>>>> are still bad).
>>>>>
>>>>> On an Intel CPU, we _do_ use dedicated stacks for NMI and MCE in HVM
>>>>> guests.  We don't really have to but it saves time in the context switch
>>>>> not to update the IDT.  Using do_nmi() here means that the first NMI is
>>>>> handled on the normal stack instead.  It's also consistent with the way
>>>>> we call do_machine_check() for the MCE case.  But it needs an explicit
>>>>> IRET after the call to do_nmi() to make sure that NMIs get re-enabled.
>>>> Both AMD and Intel has an identical setup with regard to stacks and
>>>> general "what happens when we taken one of these interrupts".
>>> My reading of svm_ctxt_switch_{to,from} makes me disagree with this.
>>> AFAICT, on SVM we're not using dedicated stacks at all.
>> In SVM, the VMRUN returns to whatever stack you had before the VMRUN.
>> This is not what I'm talking about, however. The stack used for the NMI
>> and MCE comes from the interrupt descriptor entry for those respective
>> vectors.
> This is the code I was referring to:
>
>      /*
>       * Cannot use ISTs for NMI/#MC/#DF while we are running with the guest TR.
>       * But this doesn't matter: the IST is only req'd to handle SYSCALL/SYSRET.
>       */
>      idt_tables[cpu][TRAP_double_fault].a  &= ~(7UL << 32);
>      idt_tables[cpu][TRAP_nmi].a           &= ~(7UL << 32);
>      idt_tables[cpu][TRAP_machine_check].a &= ~(7UL << 32);
>
> Am I misreading it?

No, you are reading it perfectly right, I'm wrong...

--
Mats
>
>> So in conclusion, the do_mce_exception() call probably should be a
>> __asm__ __volatile__("int $X"), where X is the relevant vector.
> This handles MCEs that were raised in guest context.  If we've managed
> to get this far into the exit handler, the hypervisor stack is probably
> OK. :)
>
> I'd be happy to invoke the MCE handler though the IDT here, just for
> symmetry with the other cases, but I don't think it makes much
> difference.
>
> Tim.
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 18:30:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 18:30:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ4CD-00030J-VE; Thu, 15 Nov 2012 18:29:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZ4CC-00030E-FV
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 18:29:48 +0000
Received: from [85.158.138.51:59267] by server-9.bemta-3.messagelabs.com id
	73/B9-02388-B9435A05; Thu, 15 Nov 2012 18:29:47 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1353004185!22269471!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTUyOTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16920 invoked from network); 15 Nov 2012 18:29:46 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-12.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 18:29:46 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFITXeS002431
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 18:29:34 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFITWjj001284
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 18:29:33 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFITVul027249; Thu, 15 Nov 2012 12:29:31 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 10:29:31 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id AA06840469; Thu, 15 Nov 2012 13:29:28 -0500 (EST)
Date: Thu, 15 Nov 2012 13:29:28 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121115182928.GB22320@phenom.dumpdata.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
	<50A4CA51.8080208@citrix.com>
	<1352978106.3499.101.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352978106.3499.101.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
 xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 15, 2012 at 11:15:06AM +0000, Ian Campbell wrote:
> On Thu, 2012-11-15 at 10:56 +0000, Roger Pau Monne wrote:
> > On 15/11/12 09:38, ANNIE LI wrote:
> > > =

> > > =

> > > On 2012-11-15 15:40, Pasi K=E4rkk=E4inen wrote:
> > >> Hello,
> > >>
> > >> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
> > >>> This patch implements persistent grants for xen-netfront/netback. T=
his
> > >>> mechanism maintains page pools in netback/netfront, these page pool=
s is used to
> > >>> save grant pages which are mapped. This way improve performance whi=
ch is wasted
> > >>> when doing grant operations.
> > >>>
> > >>> Current netback/netfront does map/unmap grant operations frequently=
 when
> > >>> transmitting/receiving packets, and grant operations costs much cpu=
 clock. In
> > >>> this patch, netfront/netback maps grant pages when needed and then =
saves them
> > >>> into a page pool for future use. All these pages will be unmapped w=
hen
> > >>> removing/releasing the net device.
> > >>>
> > >> Do you have performance numbers available already? with/without pers=
istent grants?
> > > I have some simple netperf/netserver test result with/without persist=
ent =

> > > grants,
> > > =

> > > Following is result of with persistent grant patch,
> > > =

> > > Guests, Sum,      Avg,     Min,     Max
> > >   1,  15106.4,  15106.4, 15106.36, 15106.36
> > >   2,  13052.7,  6526.34,  6261.81,  6790.86
> > >   3,  12675.1,  6337.53,  6220.24,  6454.83
> > >   4,  13194,  6596.98,  6274.70,  6919.25
> > > =

> > > =

> > > Following are result of without persistent patch
> > > =

> > > Guests, Sum,     Avg,    Min,        Max
> > >   1,  10864.1,  10864.1, 10864.10, 10864.10
> > >   2,  10898.5,  5449.24,  4862.08,  6036.40
> > >   3,  10734.5,  5367.26,  5261.43,  5473.08
> > >   4,  10924,    5461.99,  5314.84,  5609.14
> > =

> > In the block case, performance improvement is seen when using a large
> > number of guests, could you perform the same benchmark increasing the
> > number of guests to 15?
> =

> It would also be nice to see some analysis of the numbers which justify
> why this change is a good one without every reviewer having to evaluate
> the raw data themselves. In fact this should really be part of the
> commit message.

You mean like a nice graph, eh?

I will run these patches on my 32GB box and see if I can give you
a nice PDF/jpg.

> =

> Ian.
> =


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 18:30:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 18:30:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ4CD-00030J-VE; Thu, 15 Nov 2012 18:29:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZ4CC-00030E-FV
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 18:29:48 +0000
Received: from [85.158.138.51:59267] by server-9.bemta-3.messagelabs.com id
	73/B9-02388-B9435A05; Thu, 15 Nov 2012 18:29:47 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1353004185!22269471!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTUyOTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16920 invoked from network); 15 Nov 2012 18:29:46 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-12.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 18:29:46 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFITXeS002431
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 18:29:34 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFITWjj001284
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 18:29:33 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFITVul027249; Thu, 15 Nov 2012 12:29:31 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 10:29:31 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id AA06840469; Thu, 15 Nov 2012 13:29:28 -0500 (EST)
Date: Thu, 15 Nov 2012 13:29:28 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121115182928.GB22320@phenom.dumpdata.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
	<50A4CA51.8080208@citrix.com>
	<1352978106.3499.101.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352978106.3499.101.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
 xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 15, 2012 at 11:15:06AM +0000, Ian Campbell wrote:
> On Thu, 2012-11-15 at 10:56 +0000, Roger Pau Monne wrote:
> > On 15/11/12 09:38, ANNIE LI wrote:
> > > =

> > > =

> > > On 2012-11-15 15:40, Pasi K=E4rkk=E4inen wrote:
> > >> Hello,
> > >>
> > >> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
> > >>> This patch implements persistent grants for xen-netfront/netback. T=
his
> > >>> mechanism maintains page pools in netback/netfront, these page pool=
s is used to
> > >>> save grant pages which are mapped. This way improve performance whi=
ch is wasted
> > >>> when doing grant operations.
> > >>>
> > >>> Current netback/netfront does map/unmap grant operations frequently=
 when
> > >>> transmitting/receiving packets, and grant operations costs much cpu=
 clock. In
> > >>> this patch, netfront/netback maps grant pages when needed and then =
saves them
> > >>> into a page pool for future use. All these pages will be unmapped w=
hen
> > >>> removing/releasing the net device.
> > >>>
> > >> Do you have performance numbers available already? with/without pers=
istent grants?
> > > I have some simple netperf/netserver test result with/without persist=
ent =

> > > grants,
> > > =

> > > Following is result of with persistent grant patch,
> > > =

> > > Guests, Sum,      Avg,     Min,     Max
> > >   1,  15106.4,  15106.4, 15106.36, 15106.36
> > >   2,  13052.7,  6526.34,  6261.81,  6790.86
> > >   3,  12675.1,  6337.53,  6220.24,  6454.83
> > >   4,  13194,  6596.98,  6274.70,  6919.25
> > > =

> > > =

> > > Following are result of without persistent patch
> > > =

> > > Guests, Sum,     Avg,    Min,        Max
> > >   1,  10864.1,  10864.1, 10864.10, 10864.10
> > >   2,  10898.5,  5449.24,  4862.08,  6036.40
> > >   3,  10734.5,  5367.26,  5261.43,  5473.08
> > >   4,  10924,    5461.99,  5314.84,  5609.14
> > =

> > In the block case, performance improvement is seen when using a large
> > number of guests, could you perform the same benchmark increasing the
> > number of guests to 15?
> =

> It would also be nice to see some analysis of the numbers which justify
> why this change is a good one without every reviewer having to evaluate
> the raw data themselves. In fact this should really be part of the
> commit message.

You mean like a nice graph, eh?

I will run these patches on my 32GB box and see if I can give you
a nice PDF/jpg.

> =

> Ian.
> =


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 18:35:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 18:35:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ4HG-0003GU-6v; Thu, 15 Nov 2012 18:35:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TZ4HD-0003GO-HJ
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 18:34:59 +0000
Received: from [85.158.137.99:12460] by server-5.bemta-3.messagelabs.com id
	E7/51-26311-2D535A05; Thu, 15 Nov 2012 18:34:58 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1353004496!14476872!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODY1MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12011 invoked from network); 15 Nov 2012 18:34:57 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 18:34:57 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; 
	d="scan'208,217";a="214662025"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 18:34:44 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 13:34:44 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TZ4Gy-0004jz-2T;
	Thu, 15 Nov 2012 18:34:44 +0000
Message-ID: <50A53479.5050901@eu.citrix.com>
Date: Thu, 15 Nov 2012 18:29:13 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Michael Palmeter <michael.palmeter@oracle.com>
References: <c58a9d3a-99e4-42ac-86c9-fbec600dee14@default>
In-Reply-To: <c58a9d3a-99e4-42ac-86c9-fbec600dee14@default>
Cc: Dario Faggioli <raistlin@linux.it>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen credit scheduler question
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5721675100836511393=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5721675100836511393==
Content-Type: multipart/alternative;
	boundary="------------080804000802020308040205"

--------------080804000802020308040205
Content-Type: text/plain; charset="windows-1252"; format=flowed
Content-Transfer-Encoding: 7bit

On 15/11/12 15:43, Michael Palmeter wrote:
>
> Hi all (and Mr. Dunlap in particular),
>

Haha -- please don't call me "Mr"; I prefer "George", but if you want a 
title, use "Dr" (since I have  PhD). :-)

> Example scenario:
>
>   * Server hardware: 2 sockets, 8-cores per socket, 2 hardware threads
>     per core (total of 32 hardware threads)
>   * Test VM: a single virtual machine with a single vCPU, weight=256
>     and cap=100%
>
> In this scenario, from what I understand, I should be able to load the 
> Test VM with traffic to a maximum of approximately 1/32 of the 
> aggregate compute capacity of the server.  The total CPU utilization 
> of the server hardware should be approximately 3.4%, plus the overhead 
> of dom0 (say 1-2).  The credits available to any vCPU capped at 100% 
> should be equal to 1/32 of the aggregate compute available for the 
> whole server, correct?
>

I think to really be precise, you should say, "1/32nd of the logical cpu 
time available", where "logical cpu time" simply means, "time processing 
on one logical CPU".  At the moment, that is all that either the credit1 
or credit2 schedulers look at.

As I'm sure you're aware, not all "logical cpu time" is equal.  If one 
thread of a hyperthread pair is running but the other idle, it will get 
significantly higher performance than if the other thread is busy.  How 
much is highly unpredictable, and depends very much on exactly what 
units are shared with the other hyperthread, and the workload running on 
each unit.  But even when both threads are busy, it should (in theory) 
be rare for both threads to get a throughput of 50%; the whole idea of 
HT is that threads typically get 70-80% of the full performance of the 
core (so the overall throughput is increased).

But if course, while this is particularly extreme in the case of 
hyperthreads, it's also true on a smaller scale even without that -- 
cores share caches, NUMA nodes share memory bandwidth, and so on. No 
attempt is made to compensate VMs for cache misses or extra memory 
latency due to sharing either. :-)

> Put simply, is there a way to constrain a VM with 1 vCPU to consume no 
> more than 0.5 of a physical core (hyper-threaded) on the server 
> hardware mentioned below? Does the cap help in that respect?
>

You can use "cap" to make the VM in question get 50% of logical vcpu 
time, which on an idle system will give it 0.5 of the capacity of a 
physical core (if we don't consider Intel's Turbo Boost technology).  
But if the system becomes busy, it will get less than 0.5 of the 
processing capacity of a physical core.

> I have been struggling to understand how the scheduler can deal with 
> the uncertainty that hyperthreading introduces, however.  I know this 
> is an issue that you are tackling in the credit2 scheduler, but I 
> would like to know what your thoughts are on this problem (if you are 
> able to share).  Any insight or assistance you could offer would be 
> greatly appreciated.
>

At the moment it does not attempt to; the only thing it does is try not 
to schedule two hyperthreads that share a core if there is an idle 
core.  But if there are more active vcpus than cores, then some will 
share; and the ones that share a core with another vcpu will be charged 
the same as the ones that have the core all to themselves.

Could you explain why you your question is important to you -- i.e,. 
what are you trying to accomplish?  It sounds a bit like you're more 
concerned with accuracy in reporting, and control of resources, rather 
than fairness, for instance.

  -George

--------------080804000802020308040205
Content-Type: text/html; charset="windows-1252"
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 15/11/12 15:43, Michael Palmeter
      wrote:<br>
    </div>
    <blockquote cite="mid:c58a9d3a-99e4-42ac-86c9-fbec600dee14@default"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 12 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@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:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
	{font-family:Verdana;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	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;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{mso-style-priority:99;
	mso-style-link:"Balloon Text Char";
	margin:0in;
	margin-bottom:.0001pt;
	font-size:8.0pt;
	font-family:"Tahoma","sans-serif";}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
span.BalloonTextChar
	{mso-style-name:"Balloon Text Char";
	mso-style-priority:99;
	mso-style-link:"Balloon Text";
	font-family:"Tahoma","sans-serif";}
.MsoChpDefault
	{mso-style-type:export-only;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
/* List Definitions */
@list l0
	{mso-list-id:599684598;
	mso-list-type:hybrid;
	mso-list-template-ids:1243763380 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Symbol;}
@list l0:level2
	{mso-level-tab-stop:1.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level3
	{mso-level-tab-stop:1.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level4
	{mso-level-tab-stop:2.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level5
	{mso-level-tab-stop:2.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level6
	{mso-level-tab-stop:3.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level7
	{mso-level-tab-stop:3.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level8
	{mso-level-tab-stop:4.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level9
	{mso-level-tab-stop:4.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Hi all (and Mr. Dunlap in particular),</p>
      </div>
    </blockquote>
    <br>
    Haha -- please don't call me "Mr"; I prefer "George", but if you
    want a title, use "Dr" (since I have  PhD). :-)<br>
    <br>
    <blockquote cite="mid:c58a9d3a-99e4-42ac-86c9-fbec600dee14@default"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p>Example scenario:<o:p></o:p></p>
        <p class="MsoNormal"> <o:p></o:p></p>
        <ul style="margin-top:0in" type="disc">
          <li class="MsoNormal" style="mso-list:l0 level1 lfo1">Server
            hardware: 2 sockets, 8-cores per socket, 2 hardware threads
            per core (total of 32 hardware threads)<o:p></o:p></li>
          <li class="MsoNormal" style="mso-list:l0 level1 lfo1">Test VM:
            a single virtual machine with a single vCPU, weight=256 and
            cap=100%<o:p></o:p></li>
        </ul>
        <p class="MsoNormal"> <o:p></o:p></p>
        <p class="MsoNormal">In this scenario, from what I understand, I
          should be able to load the Test VM with traffic to a maximum
          of approximately 1/32 of the aggregate compute capacity of the
          server.  The total CPU utilization of the server hardware
          should be approximately 3.4%, plus the overhead of dom0 (say
          1-2).  The credits available to any vCPU capped at 100% should
          be equal to 1/32 of the aggregate compute available for the
          whole server, correct?<o:p></o:p></p>
      </div>
    </blockquote>
    <br>
    I think to really be precise, you should say, "1/32nd of the logical
    cpu time available", where "logical cpu time" simply means, "time
    processing on one logical CPU".  At the moment, that is all that
    either the credit1 or credit2 schedulers look at.<br>
    <br>
    As I'm sure you're aware, not all "logical cpu time" is equal.  If
    one thread of a hyperthread pair is running but the other idle, it
    will get significantly higher performance than if the other thread
    is busy.  How much is highly unpredictable, and depends very much on
    exactly what units are shared with the other hyperthread, and the
    workload running on each unit.  But even when both threads are busy,
    it should (in theory) be rare for both threads to get a throughput
    of 50%; the whole idea of HT is that threads typically get 70-80% of
    the full performance of the core (so the overall throughput is
    increased).<br>
    <br>
    But if course, while this is particularly extreme in the case of
    hyperthreads, it's also true on a smaller scale even without that --
    cores share caches, NUMA nodes share memory bandwidth, and so on. 
    No attempt is made to compensate VMs for cache misses or extra
    memory latency due to sharing either. :-)<br>
    <br>
    <blockquote cite="mid:c58a9d3a-99e4-42ac-86c9-fbec600dee14@default"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal">Put simply, is there a way to constrain a
          VM with 1 vCPU to consume no more than 0.5 of a physical core
          (hyper-threaded) on the server hardware mentioned below? Does
          the cap help in that respect?<o:p></o:p></p>
      </div>
    </blockquote>
    <br>
    You can use "cap" to make the VM in question get 50% of logical vcpu
    time, which on an idle system will give it 0.5 of the capacity of a
    physical core (if we don't consider Intel's Turbo Boost
    technology).  But if the system becomes busy, it will get less than
    0.5 of the processing capacity of a physical core.<br>
    <br>
    <blockquote cite="mid:c58a9d3a-99e4-42ac-86c9-fbec600dee14@default"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><o:p></o:p>I have been struggling to
          understand how the scheduler can deal with the uncertainty
          that hyperthreading introduces, however.  I know this is an
          issue that you are tackling in the credit2 scheduler, but I
          would like to know what your thoughts are on this problem (if
          you are able to share).  Any insight or assistance you could
          offer would be greatly appreciated.  </p>
      </div>
    </blockquote>
    <br>
    At the moment it does not attempt to; the only thing it does is try
    not to schedule two hyperthreads that share a core if there is an
    idle core.  But if there are more active vcpus than cores, then some
    will share; and the ones that share a core with another vcpu will be
    charged the same as the ones that have the core all to themselves.<br>
    <br>
    Could you explain why you your question is important to you -- i.e,.
    what are you trying to accomplish?  It sounds a bit like you're more
    concerned with accuracy in reporting, and control of resources,
    rather than fairness, for instance.<br>
    <br>
     -George<br>
  </body>
</html>

--------------080804000802020308040205--


--===============5721675100836511393==
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.xen.org
http://lists.xen.org/xen-devel

--===============5721675100836511393==--


From xen-devel-bounces@lists.xen.org Thu Nov 15 18:35:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 18:35:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ4HG-0003GU-6v; Thu, 15 Nov 2012 18:35:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TZ4HD-0003GO-HJ
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 18:34:59 +0000
Received: from [85.158.137.99:12460] by server-5.bemta-3.messagelabs.com id
	E7/51-26311-2D535A05; Thu, 15 Nov 2012 18:34:58 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1353004496!14476872!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODY1MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12011 invoked from network); 15 Nov 2012 18:34:57 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 18:34:57 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; 
	d="scan'208,217";a="214662025"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 18:34:44 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 13:34:44 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TZ4Gy-0004jz-2T;
	Thu, 15 Nov 2012 18:34:44 +0000
Message-ID: <50A53479.5050901@eu.citrix.com>
Date: Thu, 15 Nov 2012 18:29:13 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Michael Palmeter <michael.palmeter@oracle.com>
References: <c58a9d3a-99e4-42ac-86c9-fbec600dee14@default>
In-Reply-To: <c58a9d3a-99e4-42ac-86c9-fbec600dee14@default>
Cc: Dario Faggioli <raistlin@linux.it>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen credit scheduler question
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5721675100836511393=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5721675100836511393==
Content-Type: multipart/alternative;
	boundary="------------080804000802020308040205"

--------------080804000802020308040205
Content-Type: text/plain; charset="windows-1252"; format=flowed
Content-Transfer-Encoding: 7bit

On 15/11/12 15:43, Michael Palmeter wrote:
>
> Hi all (and Mr. Dunlap in particular),
>

Haha -- please don't call me "Mr"; I prefer "George", but if you want a 
title, use "Dr" (since I have  PhD). :-)

> Example scenario:
>
>   * Server hardware: 2 sockets, 8-cores per socket, 2 hardware threads
>     per core (total of 32 hardware threads)
>   * Test VM: a single virtual machine with a single vCPU, weight=256
>     and cap=100%
>
> In this scenario, from what I understand, I should be able to load the 
> Test VM with traffic to a maximum of approximately 1/32 of the 
> aggregate compute capacity of the server.  The total CPU utilization 
> of the server hardware should be approximately 3.4%, plus the overhead 
> of dom0 (say 1-2).  The credits available to any vCPU capped at 100% 
> should be equal to 1/32 of the aggregate compute available for the 
> whole server, correct?
>

I think to really be precise, you should say, "1/32nd of the logical cpu 
time available", where "logical cpu time" simply means, "time processing 
on one logical CPU".  At the moment, that is all that either the credit1 
or credit2 schedulers look at.

As I'm sure you're aware, not all "logical cpu time" is equal.  If one 
thread of a hyperthread pair is running but the other idle, it will get 
significantly higher performance than if the other thread is busy.  How 
much is highly unpredictable, and depends very much on exactly what 
units are shared with the other hyperthread, and the workload running on 
each unit.  But even when both threads are busy, it should (in theory) 
be rare for both threads to get a throughput of 50%; the whole idea of 
HT is that threads typically get 70-80% of the full performance of the 
core (so the overall throughput is increased).

But if course, while this is particularly extreme in the case of 
hyperthreads, it's also true on a smaller scale even without that -- 
cores share caches, NUMA nodes share memory bandwidth, and so on. No 
attempt is made to compensate VMs for cache misses or extra memory 
latency due to sharing either. :-)

> Put simply, is there a way to constrain a VM with 1 vCPU to consume no 
> more than 0.5 of a physical core (hyper-threaded) on the server 
> hardware mentioned below? Does the cap help in that respect?
>

You can use "cap" to make the VM in question get 50% of logical vcpu 
time, which on an idle system will give it 0.5 of the capacity of a 
physical core (if we don't consider Intel's Turbo Boost technology).  
But if the system becomes busy, it will get less than 0.5 of the 
processing capacity of a physical core.

> I have been struggling to understand how the scheduler can deal with 
> the uncertainty that hyperthreading introduces, however.  I know this 
> is an issue that you are tackling in the credit2 scheduler, but I 
> would like to know what your thoughts are on this problem (if you are 
> able to share).  Any insight or assistance you could offer would be 
> greatly appreciated.
>

At the moment it does not attempt to; the only thing it does is try not 
to schedule two hyperthreads that share a core if there is an idle 
core.  But if there are more active vcpus than cores, then some will 
share; and the ones that share a core with another vcpu will be charged 
the same as the ones that have the core all to themselves.

Could you explain why you your question is important to you -- i.e,. 
what are you trying to accomplish?  It sounds a bit like you're more 
concerned with accuracy in reporting, and control of resources, rather 
than fairness, for instance.

  -George

--------------080804000802020308040205
Content-Type: text/html; charset="windows-1252"
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 15/11/12 15:43, Michael Palmeter
      wrote:<br>
    </div>
    <blockquote cite="mid:c58a9d3a-99e4-42ac-86c9-fbec600dee14@default"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 12 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@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:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
	{font-family:Verdana;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	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;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{mso-style-priority:99;
	mso-style-link:"Balloon Text Char";
	margin:0in;
	margin-bottom:.0001pt;
	font-size:8.0pt;
	font-family:"Tahoma","sans-serif";}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
span.BalloonTextChar
	{mso-style-name:"Balloon Text Char";
	mso-style-priority:99;
	mso-style-link:"Balloon Text";
	font-family:"Tahoma","sans-serif";}
.MsoChpDefault
	{mso-style-type:export-only;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
/* List Definitions */
@list l0
	{mso-list-id:599684598;
	mso-list-type:hybrid;
	mso-list-template-ids:1243763380 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Symbol;}
@list l0:level2
	{mso-level-tab-stop:1.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level3
	{mso-level-tab-stop:1.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level4
	{mso-level-tab-stop:2.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level5
	{mso-level-tab-stop:2.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level6
	{mso-level-tab-stop:3.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level7
	{mso-level-tab-stop:3.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level8
	{mso-level-tab-stop:4.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level9
	{mso-level-tab-stop:4.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Hi all (and Mr. Dunlap in particular),</p>
      </div>
    </blockquote>
    <br>
    Haha -- please don't call me "Mr"; I prefer "George", but if you
    want a title, use "Dr" (since I have  PhD). :-)<br>
    <br>
    <blockquote cite="mid:c58a9d3a-99e4-42ac-86c9-fbec600dee14@default"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p>Example scenario:<o:p></o:p></p>
        <p class="MsoNormal"> <o:p></o:p></p>
        <ul style="margin-top:0in" type="disc">
          <li class="MsoNormal" style="mso-list:l0 level1 lfo1">Server
            hardware: 2 sockets, 8-cores per socket, 2 hardware threads
            per core (total of 32 hardware threads)<o:p></o:p></li>
          <li class="MsoNormal" style="mso-list:l0 level1 lfo1">Test VM:
            a single virtual machine with a single vCPU, weight=256 and
            cap=100%<o:p></o:p></li>
        </ul>
        <p class="MsoNormal"> <o:p></o:p></p>
        <p class="MsoNormal">In this scenario, from what I understand, I
          should be able to load the Test VM with traffic to a maximum
          of approximately 1/32 of the aggregate compute capacity of the
          server.  The total CPU utilization of the server hardware
          should be approximately 3.4%, plus the overhead of dom0 (say
          1-2).  The credits available to any vCPU capped at 100% should
          be equal to 1/32 of the aggregate compute available for the
          whole server, correct?<o:p></o:p></p>
      </div>
    </blockquote>
    <br>
    I think to really be precise, you should say, "1/32nd of the logical
    cpu time available", where "logical cpu time" simply means, "time
    processing on one logical CPU".  At the moment, that is all that
    either the credit1 or credit2 schedulers look at.<br>
    <br>
    As I'm sure you're aware, not all "logical cpu time" is equal.  If
    one thread of a hyperthread pair is running but the other idle, it
    will get significantly higher performance than if the other thread
    is busy.  How much is highly unpredictable, and depends very much on
    exactly what units are shared with the other hyperthread, and the
    workload running on each unit.  But even when both threads are busy,
    it should (in theory) be rare for both threads to get a throughput
    of 50%; the whole idea of HT is that threads typically get 70-80% of
    the full performance of the core (so the overall throughput is
    increased).<br>
    <br>
    But if course, while this is particularly extreme in the case of
    hyperthreads, it's also true on a smaller scale even without that --
    cores share caches, NUMA nodes share memory bandwidth, and so on. 
    No attempt is made to compensate VMs for cache misses or extra
    memory latency due to sharing either. :-)<br>
    <br>
    <blockquote cite="mid:c58a9d3a-99e4-42ac-86c9-fbec600dee14@default"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal">Put simply, is there a way to constrain a
          VM with 1 vCPU to consume no more than 0.5 of a physical core
          (hyper-threaded) on the server hardware mentioned below? Does
          the cap help in that respect?<o:p></o:p></p>
      </div>
    </blockquote>
    <br>
    You can use "cap" to make the VM in question get 50% of logical vcpu
    time, which on an idle system will give it 0.5 of the capacity of a
    physical core (if we don't consider Intel's Turbo Boost
    technology).  But if the system becomes busy, it will get less than
    0.5 of the processing capacity of a physical core.<br>
    <br>
    <blockquote cite="mid:c58a9d3a-99e4-42ac-86c9-fbec600dee14@default"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><o:p></o:p>I have been struggling to
          understand how the scheduler can deal with the uncertainty
          that hyperthreading introduces, however.  I know this is an
          issue that you are tackling in the credit2 scheduler, but I
          would like to know what your thoughts are on this problem (if
          you are able to share).  Any insight or assistance you could
          offer would be greatly appreciated.  </p>
      </div>
    </blockquote>
    <br>
    At the moment it does not attempt to; the only thing it does is try
    not to schedule two hyperthreads that share a core if there is an
    idle core.  But if there are more active vcpus than cores, then some
    will share; and the ones that share a core with another vcpu will be
    charged the same as the ones that have the core all to themselves.<br>
    <br>
    Could you explain why you your question is important to you -- i.e,.
    what are you trying to accomplish?  It sounds a bit like you're more
    concerned with accuracy in reporting, and control of resources,
    rather than fairness, for instance.<br>
    <br>
     -George<br>
  </body>
</html>

--------------080804000802020308040205--


--===============5721675100836511393==
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.xen.org
http://lists.xen.org/xen-devel

--===============5721675100836511393==--


From xen-devel-bounces@lists.xen.org Thu Nov 15 18:38:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 18:38:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ4KH-0003PM-1Q; Thu, 15 Nov 2012 18:38:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TZ4KF-0003PC-8V
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 18:38:07 +0000
Received: from [85.158.143.35:30907] by server-3.bemta-4.messagelabs.com id
	2D/2C-06841-E8635A05; Thu, 15 Nov 2012 18:38:06 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1353004682!17874194!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM4MzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6286 invoked from network); 15 Nov 2012 18:38:04 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 18:38:04 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208,217";a="44755188"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 18:38:01 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 13:38:01 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TZ4K9-0004mc-7i;
	Thu, 15 Nov 2012 18:38:01 +0000
Message-ID: <50A5353E.6090102@eu.citrix.com>
Date: Thu, 15 Nov 2012 18:32:30 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Michael Palmeter <michael.palmeter@oracle.com>
References: <c58a9d3a-99e4-42ac-86c9-fbec600dee14@default>
	<50A53479.5050901@eu.citrix.com>
In-Reply-To: <50A53479.5050901@eu.citrix.com>
Cc: Dario Faggioli <raistlin@linux.it>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen credit scheduler question
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0778104893750546398=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0778104893750546398==
Content-Type: multipart/alternative;
	boundary="------------010906050907030102020802"

--------------010906050907030102020802
Content-Type: text/plain; charset="windows-1252"; format=flowed
Content-Transfer-Encoding: 7bit

On 15/11/12 18:29, George Dunlap wrote:
>>
>> Put simply, is there a way to constrain a VM with 1 vCPU to consume 
>> no more than 0.5 of a physical core (hyper-threaded) on the server 
>> hardware mentioned below? Does the cap help in that respect?
>>
>
> You can use "cap" to make the VM in question get 50% of logical vcpu time,

This should be "logical CPU time"...

  -George

--------------010906050907030102020802
Content-Type: text/html; charset="windows-1252"
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 15/11/12 18:29, George Dunlap wrote:<br>
    </div>
    <blockquote cite="mid:50A53479.5050901@eu.citrix.com" type="cite">
      <blockquote
        cite="mid:c58a9d3a-99e4-42ac-86c9-fbec600dee14@default"
        type="cite">
        <div class="WordSection1">
          <p class="MsoNormal">Put simply, is there a way to constrain a
            VM with 1 vCPU to consume no more than 0.5 of a physical
            core (hyper-threaded) on the server hardware mentioned
            below? Does the cap help in that respect?<o:p></o:p></p>
        </div>
      </blockquote>
      <br>
      You can use "cap" to make the VM in question get 50% of logical
      vcpu time,</blockquote>
    <br>
    This should be "logical CPU time"...<br>
    <br>
     -George<br>
  </body>
</html>

--------------010906050907030102020802--


--===============0778104893750546398==
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.xen.org
http://lists.xen.org/xen-devel

--===============0778104893750546398==--


From xen-devel-bounces@lists.xen.org Thu Nov 15 18:38:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 18:38:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ4KH-0003PM-1Q; Thu, 15 Nov 2012 18:38:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TZ4KF-0003PC-8V
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 18:38:07 +0000
Received: from [85.158.143.35:30907] by server-3.bemta-4.messagelabs.com id
	2D/2C-06841-E8635A05; Thu, 15 Nov 2012 18:38:06 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1353004682!17874194!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM4MzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6286 invoked from network); 15 Nov 2012 18:38:04 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 18:38:04 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208,217";a="44755188"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 18:38:01 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 13:38:01 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TZ4K9-0004mc-7i;
	Thu, 15 Nov 2012 18:38:01 +0000
Message-ID: <50A5353E.6090102@eu.citrix.com>
Date: Thu, 15 Nov 2012 18:32:30 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Michael Palmeter <michael.palmeter@oracle.com>
References: <c58a9d3a-99e4-42ac-86c9-fbec600dee14@default>
	<50A53479.5050901@eu.citrix.com>
In-Reply-To: <50A53479.5050901@eu.citrix.com>
Cc: Dario Faggioli <raistlin@linux.it>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen credit scheduler question
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0778104893750546398=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0778104893750546398==
Content-Type: multipart/alternative;
	boundary="------------010906050907030102020802"

--------------010906050907030102020802
Content-Type: text/plain; charset="windows-1252"; format=flowed
Content-Transfer-Encoding: 7bit

On 15/11/12 18:29, George Dunlap wrote:
>>
>> Put simply, is there a way to constrain a VM with 1 vCPU to consume 
>> no more than 0.5 of a physical core (hyper-threaded) on the server 
>> hardware mentioned below? Does the cap help in that respect?
>>
>
> You can use "cap" to make the VM in question get 50% of logical vcpu time,

This should be "logical CPU time"...

  -George

--------------010906050907030102020802
Content-Type: text/html; charset="windows-1252"
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 15/11/12 18:29, George Dunlap wrote:<br>
    </div>
    <blockquote cite="mid:50A53479.5050901@eu.citrix.com" type="cite">
      <blockquote
        cite="mid:c58a9d3a-99e4-42ac-86c9-fbec600dee14@default"
        type="cite">
        <div class="WordSection1">
          <p class="MsoNormal">Put simply, is there a way to constrain a
            VM with 1 vCPU to consume no more than 0.5 of a physical
            core (hyper-threaded) on the server hardware mentioned
            below? Does the cap help in that respect?<o:p></o:p></p>
        </div>
      </blockquote>
      <br>
      You can use "cap" to make the VM in question get 50% of logical
      vcpu time,</blockquote>
    <br>
    This should be "logical CPU time"...<br>
    <br>
     -George<br>
  </body>
</html>

--------------010906050907030102020802--


--===============0778104893750546398==
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.xen.org
http://lists.xen.org/xen-devel

--===============0778104893750546398==--


From xen-devel-bounces@lists.xen.org Thu Nov 15 18:52:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 18:52:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ4XW-0003kX-E7; Thu, 15 Nov 2012 18:51:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1TZ4XU-0003kS-Ui
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 18:51:49 +0000
Received: from [85.158.143.35:65043] by server-1.bemta-4.messagelabs.com id
	FD/BF-27934-4C935A05; Thu, 15 Nov 2012 18:51:48 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-15.tower-21.messagelabs.com!1353005504!14125443!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29993 invoked from network); 15 Nov 2012 18:51:45 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 18:51:45 -0000
Received: by mail-ie0-f173.google.com with SMTP id 17so3018004iea.32
	for <xen-devel@lists.xen.org>; Thu, 15 Nov 2012 10:51:43 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer
	:x-gm-message-state;
	bh=UeXr6BGl3cTokpif09LW8MFhgzNThVy6JZLOGZKeiF0=;
	b=Lo07+UA7OcRTDNJikA112No4IJHotkmdX/dkOup0JrEelr3dg94EI0AWZ2wWBcAwGK
	2s8p3vgkzzEtDNT7iuf2n2JtAJBrO1iZmKxi85UPmgHr9pt1mOqgbXb+OA7s4OlSmXTJ
	AHW0HkxFGUfpSYWD8BvLbg6h8VVtJiy62E6mplSp6aC+Cy6Q/IlhjUcTZ7GOnf8H45/s
	NQ+KGM1PVfVsnisFep28ncRp4qRjHoPC/4BIzuUGcsPCumZxGOd/Js0tC06XYlqMSx5j
	OiHUHAKVuoFGVem+01bIN/oprY70N99bPc03ejpjELD6iBeiiVsM0Z0gAUgUMXCoRKV2
	Yssg==
Received: by 10.50.16.177 with SMTP id h17mr821217igd.37.1353005503845;
	Thu, 15 Nov 2012 10:51:43 -0800 (PST)
Received: from andress-macbook.gridcentric.ca ([206.223.182.18])
	by mx.google.com with ESMTPS id ex10sm4610818igc.15.2012.11.15.10.51.40
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 15 Nov 2012 10:51:42 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
In-Reply-To: <mailman.16651.1353004500.1399.xen-devel@lists.xen.org>
Date: Thu, 15 Nov 2012 13:51:39 -0500
Message-Id: <99DE5B0D-391E-4845-B9CE-46319825CCD6@gridcentric.ca>
References: <mailman.16651.1353004500.1399.xen-devel@lists.xen.org>
To: xen-devel@lists.xen.org
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQlghNNxTTsEWQqA43HZS84/kFJjDVy5P7zszbO4PHUXcL1GfIDOOmDQUVZCTZ8/YK5D92LA
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>, Tim Deegan <tim@xen.org>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop
	of	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> Hi Jan --
> 
> Thanks for the quick review!
> 
> Mostly fixed for v3 but a couple things:
> 
>>> +     * Claimed memory is considered unavailable unless the request
>>> +     * is made by a domain with sufficient unclaimed pages.
>>> +     */
>>> +    if ( (total_unclaimed_pages + request >
>>> +           total_avail_pages + tmem_freeable_pages()) &&
>>> +          (d == NULL || d->unclaimed_pages < request) )
>>> +        goto not_found;
>> 
>> The treatment of d being NULL certainly needs further thought:
>> Is it really better to fulfill the claim and fail some (perhaps
>> important) _xmalloc()?
> 
> Ideally, allocation in the presence of existing claims should
> behave as if the claiming domains had actually already allocated
> the unclaimed-amount-of-memory.  So I'd argue that enforcing
> the claim should be sacrosanct here.

Well, are we sure that failing an "anonymous" allocations is not going to trigger a BUG_ON? That's a lot of code review. If you get this wrong, now Xen suddenly crashes if allocating domains close to the max. It doesn't, today, afaict.

> 
>> Also, I'm missing a mechanism by which the tools could find out
>> how much unclaimed memory is available, in order to determine
>> (if in use) how much memory needs to be ballooned out of Dom0.
> 
> OK.  I'm not certain if this will be useful on a per-domain
> basis as well but, for completeness, I will also add
> unclaimed_pages into xc_dominfo etc (which causes a bump
> in XEN_DOMCTL_INTERFACE_VERSION).
> 
>> Similarly, but perhaps of lower priority, there is no integration
>> with the low-mem handling.
> 
> I'd also consider this lower priority as Olaf and Andre
> have argued that the claim mechanism is not needed for
> sharing/paging so the two mechanisms may not
> be used together, at least for the foreseeable future.
> So I plan to skip this, unless you change your mind and
> consider it a showstopper for acceptance.

This is a slippery slope. Let's not work out the interactions with existing subsystems before adding code to the tree. What could go wrong?

As a data point for everyone, I've found the low men virq extremely useful as a sync interrupt signaling to our toolstack that it needs to get its act together and start rebalancing memory, if it hasn't yet. I don't see how that cannot be useful to any other toolstack.

Andres

> 
>> Finally, there still are a number of formatting issues.
> 
> Hmmm... I found one I think.  Is there an equivalent to
> checkpatch for hypervisor code?  If you see any formatting
> issues in v3, please call them out explicitly as I am
> sincerely trying to avoid them.
> 
> Thanks,
> Dan
> 
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Thu, 15 Nov 2012 18:23:09 +0000
> From: Mats Petersson <mats.petersson@citrix.com>
> To: Tim Deegan <tim@xen.org>
> Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
> Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to
> 	process real NMI's instead of self_nmi() in VMEXIT handler
> Message-ID: <50A5330D.9020204@citrix.com>
> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
> 
> On 15/11/12 17:44, Tim Deegan wrote:
>> At 17:33 +0000 on 15 Nov (1353000782), Mats Petersson wrote:
>>> On 15/11/12 17:15, Tim Deegan wrote:
>>>> At 17:03 +0000 on 15 Nov (1352998993), Mats Petersson wrote:
>>>>>> On an AMD CPU we _don't_ have dedicated stacks for NMI or MCE when we're
>>>>>> running a HVM guest, so the stack issue doesn't apply (but nested NMIs
>>>>>> are still bad).
>>>>>> 
>>>>>> On an Intel CPU, we _do_ use dedicated stacks for NMI and MCE in HVM
>>>>>> guests.  We don't really have to but it saves time in the context switch
>>>>>> not to update the IDT.  Using do_nmi() here means that the first NMI is
>>>>>> handled on the normal stack instead.  It's also consistent with the way
>>>>>> we call do_machine_check() for the MCE case.  But it needs an explicit
>>>>>> IRET after the call to do_nmi() to make sure that NMIs get re-enabled.
>>>>> Both AMD and Intel has an identical setup with regard to stacks and
>>>>> general "what happens when we taken one of these interrupts".
>>>> My reading of svm_ctxt_switch_{to,from} makes me disagree with this.
>>>> AFAICT, on SVM we're not using dedicated stacks at all.
>>> In SVM, the VMRUN returns to whatever stack you had before the VMRUN.
>>> This is not what I'm talking about, however. The stack used for the NMI
>>> and MCE comes from the interrupt descriptor entry for those respective
>>> vectors.
>> This is the code I was referring to:
>> 
>>     /*
>>      * Cannot use ISTs for NMI/#MC/#DF while we are running with the guest TR.
>>      * But this doesn't matter: the IST is only req'd to handle SYSCALL/SYSRET.
>>      */
>>     idt_tables[cpu][TRAP_double_fault].a  &= ~(7UL << 32);
>>     idt_tables[cpu][TRAP_nmi].a           &= ~(7UL << 32);
>>     idt_tables[cpu][TRAP_machine_check].a &= ~(7UL << 32);
>> 
>> Am I misreading it?
> 
> No, you are reading it perfectly right, I'm wrong...
> 
> --
> Mats
>> 
>>> So in conclusion, the do_mce_exception() call probably should be a
>>> __asm__ __volatile__("int $X"), where X is the relevant vector.
>> This handles MCEs that were raised in guest context.  If we've managed
>> to get this far into the exit handler, the hypervisor stack is probably
>> OK. :)
>> 
>> I'd be happy to invoke the MCE handler though the IDT here, just for
>> symmetry with the other cases, but I don't think it makes much
>> difference.
>> 
>> Tim.
>> 
>> 
> 
> 
> 
> 
> ------------------------------
> 
> Message: 5
> Date: Thu, 15 Nov 2012 13:29:28 -0500
> From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> To: Ian Campbell <Ian.Campbell@citrix.com>
> Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,	ANNIE LI
> 	<annie.li@oracle.com>,	"xen-devel@lists.xensource.com"
> 	<xen-devel@lists.xensource.com>,	Roger Pau Monne
> 	<roger.pau@citrix.com>
> Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
> 	xen-netfront/netback
> Message-ID: <20121115182928.GB22320@phenom.dumpdata.com>
> Content-Type: text/plain; charset=iso-8859-1
> 
> On Thu, Nov 15, 2012 at 11:15:06AM +0000, Ian Campbell wrote:
>> On Thu, 2012-11-15 at 10:56 +0000, Roger Pau Monne wrote:
>>> On 15/11/12 09:38, ANNIE LI wrote:
>>>> 
>>>> 
>>>> On 2012-11-15 15:40, Pasi K?rkk?inen wrote:
>>>>> Hello,
>>>>> 
>>>>> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
>>>>>> This patch implements persistent grants for xen-netfront/netback. This
>>>>>> mechanism maintains page pools in netback/netfront, these page pools is used to
>>>>>> save grant pages which are mapped. This way improve performance which is wasted
>>>>>> when doing grant operations.
>>>>>> 
>>>>>> Current netback/netfront does map/unmap grant operations frequently when
>>>>>> transmitting/receiving packets, and grant operations costs much cpu clock. In
>>>>>> this patch, netfront/netback maps grant pages when needed and then saves them
>>>>>> into a page pool for future use. All these pages will be unmapped when
>>>>>> removing/releasing the net device.
>>>>>> 
>>>>> Do you have performance numbers available already? with/without persistent grants?
>>>> I have some simple netperf/netserver test result with/without persistent 
>>>> grants,
>>>> 
>>>> Following is result of with persistent grant patch,
>>>> 
>>>> Guests, Sum,      Avg,     Min,     Max
>>>>  1,  15106.4,  15106.4, 15106.36, 15106.36
>>>>  2,  13052.7,  6526.34,  6261.81,  6790.86
>>>>  3,  12675.1,  6337.53,  6220.24,  6454.83
>>>>  4,  13194,  6596.98,  6274.70,  6919.25
>>>> 
>>>> 
>>>> Following are result of without persistent patch
>>>> 
>>>> Guests, Sum,     Avg,    Min,        Max
>>>>  1,  10864.1,  10864.1, 10864.10, 10864.10
>>>>  2,  10898.5,  5449.24,  4862.08,  6036.40
>>>>  3,  10734.5,  5367.26,  5261.43,  5473.08
>>>>  4,  10924,    5461.99,  5314.84,  5609.14
>>> 
>>> In the block case, performance improvement is seen when using a large
>>> number of guests, could you perform the same benchmark increasing the
>>> number of guests to 15?
>> 
>> It would also be nice to see some analysis of the numbers which justify
>> why this change is a good one without every reviewer having to evaluate
>> the raw data themselves. In fact this should really be part of the
>> commit message.
> 
> You mean like a nice graph, eh?
> 
> I will run these patches on my 32GB box and see if I can give you
> a nice PDF/jpg.
> 
>> 
>> Ian.
>> 
> 
> 
> 
> ------------------------------
> 
> Message: 6
> Date: Thu, 15 Nov 2012 18:29:13 +0000
> From: George Dunlap <george.dunlap@eu.citrix.com>
> To: Michael Palmeter <michael.palmeter@oracle.com>
> Cc: Dario Faggioli <raistlin@linux.it>,	"xen-devel@lists.xen.org"
> 	<xen-devel@lists.xen.org>
> Subject: Re: [Xen-devel] Xen credit scheduler question
> Message-ID: <50A53479.5050901@eu.citrix.com>
> Content-Type: text/plain; charset="windows-1252"; Format="flowed"
> 
> On 15/11/12 15:43, Michael Palmeter wrote:
>> 
>> Hi all (and Mr. Dunlap in particular),
>> 
> 
> Haha -- please don't call me "Mr"; I prefer "George", but if you want a 
> title, use "Dr" (since I have  PhD). :-)
> 
>> Example scenario:
>> 
>>  * Server hardware: 2 sockets, 8-cores per socket, 2 hardware threads
>>    per core (total of 32 hardware threads)
>>  * Test VM: a single virtual machine with a single vCPU, weight=256
>>    and cap=100%
>> 
>> In this scenario, from what I understand, I should be able to load the 
>> Test VM with traffic to a maximum of approximately 1/32 of the 
>> aggregate compute capacity of the server.  The total CPU utilization 
>> of the server hardware should be approximately 3.4%, plus the overhead 
>> of dom0 (say 1-2).  The credits available to any vCPU capped at 100% 
>> should be equal to 1/32 of the aggregate compute available for the 
>> whole server, correct?
>> 
> 
> I think to really be precise, you should say, "1/32nd of the logical cpu 
> time available", where "logical cpu time" simply means, "time processing 
> on one logical CPU".  At the moment, that is all that either the credit1 
> or credit2 schedulers look at.
> 
> As I'm sure you're aware, not all "logical cpu time" is equal.  If one 
> thread of a hyperthread pair is running but the other idle, it will get 
> significantly higher performance than if the other thread is busy.  How 
> much is highly unpredictable, and depends very much on exactly what 
> units are shared with the other hyperthread, and the workload running on 
> each unit.  But even when both threads are busy, it should (in theory) 
> be rare for both threads to get a throughput of 50%; the whole idea of 
> HT is that threads typically get 70-80% of the full performance of the 
> core (so the overall throughput is increased).
> 
> But if course, while this is particularly extreme in the case of 
> hyperthreads, it's also true on a smaller scale even without that -- 
> cores share caches, NUMA nodes share memory bandwidth, and so on. No 
> attempt is made to compensate VMs for cache misses or extra memory 
> latency due to sharing either. :-)
> 
>> Put simply, is there a way to constrain a VM with 1 vCPU to consume no 
>> more than 0.5 of a physical core (hyper-threaded) on the server 
>> hardware mentioned below? Does the cap help in that respect?
>> 
> 
> You can use "cap" to make the VM in question get 50% of logical vcpu 
> time, which on an idle system will give it 0.5 of the capacity of a 
> physical core (if we don't consider Intel's Turbo Boost technology).  
> But if the system becomes busy, it will get less than 0.5 of the 
> processing capacity of a physical core.
> 
>> I have been struggling to understand how the scheduler can deal with 
>> the uncertainty that hyperthreading introduces, however.  I know this 
>> is an issue that you are tackling in the credit2 scheduler, but I 
>> would like to know what your thoughts are on this problem (if you are 
>> able to share).  Any insight or assistance you could offer would be 
>> greatly appreciated.
>> 
> 
> At the moment it does not attempt to; the only thing it does is try not 
> to schedule two hyperthreads that share a core if there is an idle 
> core.  But if there are more active vcpus than cores, then some will 
> share; and the ones that share a core with another vcpu will be charged 
> the same as the ones that have the core all to themselves.
> 
> Could you explain why you your question is important to you -- i.e,. 
> what are you trying to accomplish?  It sounds a bit like you're more 
> concerned with accuracy in reporting, and control of resources, rather 
> than fairness, for instance.
> 
>  -George
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.xen.org/archives/html/xen-devel/attachments/20121115/b2ff8583/attachment.html>
> 
> ------------------------------
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 
> 
> End of Xen-devel Digest, Vol 93, Issue 157
> ******************************************


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 18:52:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 18:52:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ4XW-0003kX-E7; Thu, 15 Nov 2012 18:51:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1TZ4XU-0003kS-Ui
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 18:51:49 +0000
Received: from [85.158.143.35:65043] by server-1.bemta-4.messagelabs.com id
	FD/BF-27934-4C935A05; Thu, 15 Nov 2012 18:51:48 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-15.tower-21.messagelabs.com!1353005504!14125443!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29993 invoked from network); 15 Nov 2012 18:51:45 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 18:51:45 -0000
Received: by mail-ie0-f173.google.com with SMTP id 17so3018004iea.32
	for <xen-devel@lists.xen.org>; Thu, 15 Nov 2012 10:51:43 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer
	:x-gm-message-state;
	bh=UeXr6BGl3cTokpif09LW8MFhgzNThVy6JZLOGZKeiF0=;
	b=Lo07+UA7OcRTDNJikA112No4IJHotkmdX/dkOup0JrEelr3dg94EI0AWZ2wWBcAwGK
	2s8p3vgkzzEtDNT7iuf2n2JtAJBrO1iZmKxi85UPmgHr9pt1mOqgbXb+OA7s4OlSmXTJ
	AHW0HkxFGUfpSYWD8BvLbg6h8VVtJiy62E6mplSp6aC+Cy6Q/IlhjUcTZ7GOnf8H45/s
	NQ+KGM1PVfVsnisFep28ncRp4qRjHoPC/4BIzuUGcsPCumZxGOd/Js0tC06XYlqMSx5j
	OiHUHAKVuoFGVem+01bIN/oprY70N99bPc03ejpjELD6iBeiiVsM0Z0gAUgUMXCoRKV2
	Yssg==
Received: by 10.50.16.177 with SMTP id h17mr821217igd.37.1353005503845;
	Thu, 15 Nov 2012 10:51:43 -0800 (PST)
Received: from andress-macbook.gridcentric.ca ([206.223.182.18])
	by mx.google.com with ESMTPS id ex10sm4610818igc.15.2012.11.15.10.51.40
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 15 Nov 2012 10:51:42 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
In-Reply-To: <mailman.16651.1353004500.1399.xen-devel@lists.xen.org>
Date: Thu, 15 Nov 2012 13:51:39 -0500
Message-Id: <99DE5B0D-391E-4845-B9CE-46319825CCD6@gridcentric.ca>
References: <mailman.16651.1353004500.1399.xen-devel@lists.xen.org>
To: xen-devel@lists.xen.org
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQlghNNxTTsEWQqA43HZS84/kFJjDVy5P7zszbO4PHUXcL1GfIDOOmDQUVZCTZ8/YK5D92LA
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>, Tim Deegan <tim@xen.org>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop
	of	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> Hi Jan --
> 
> Thanks for the quick review!
> 
> Mostly fixed for v3 but a couple things:
> 
>>> +     * Claimed memory is considered unavailable unless the request
>>> +     * is made by a domain with sufficient unclaimed pages.
>>> +     */
>>> +    if ( (total_unclaimed_pages + request >
>>> +           total_avail_pages + tmem_freeable_pages()) &&
>>> +          (d == NULL || d->unclaimed_pages < request) )
>>> +        goto not_found;
>> 
>> The treatment of d being NULL certainly needs further thought:
>> Is it really better to fulfill the claim and fail some (perhaps
>> important) _xmalloc()?
> 
> Ideally, allocation in the presence of existing claims should
> behave as if the claiming domains had actually already allocated
> the unclaimed-amount-of-memory.  So I'd argue that enforcing
> the claim should be sacrosanct here.

Well, are we sure that failing an "anonymous" allocations is not going to trigger a BUG_ON? That's a lot of code review. If you get this wrong, now Xen suddenly crashes if allocating domains close to the max. It doesn't, today, afaict.

> 
>> Also, I'm missing a mechanism by which the tools could find out
>> how much unclaimed memory is available, in order to determine
>> (if in use) how much memory needs to be ballooned out of Dom0.
> 
> OK.  I'm not certain if this will be useful on a per-domain
> basis as well but, for completeness, I will also add
> unclaimed_pages into xc_dominfo etc (which causes a bump
> in XEN_DOMCTL_INTERFACE_VERSION).
> 
>> Similarly, but perhaps of lower priority, there is no integration
>> with the low-mem handling.
> 
> I'd also consider this lower priority as Olaf and Andre
> have argued that the claim mechanism is not needed for
> sharing/paging so the two mechanisms may not
> be used together, at least for the foreseeable future.
> So I plan to skip this, unless you change your mind and
> consider it a showstopper for acceptance.

This is a slippery slope. Let's not work out the interactions with existing subsystems before adding code to the tree. What could go wrong?

As a data point for everyone, I've found the low men virq extremely useful as a sync interrupt signaling to our toolstack that it needs to get its act together and start rebalancing memory, if it hasn't yet. I don't see how that cannot be useful to any other toolstack.

Andres

> 
>> Finally, there still are a number of formatting issues.
> 
> Hmmm... I found one I think.  Is there an equivalent to
> checkpatch for hypervisor code?  If you see any formatting
> issues in v3, please call them out explicitly as I am
> sincerely trying to avoid them.
> 
> Thanks,
> Dan
> 
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Thu, 15 Nov 2012 18:23:09 +0000
> From: Mats Petersson <mats.petersson@citrix.com>
> To: Tim Deegan <tim@xen.org>
> Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
> Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to
> 	process real NMI's instead of self_nmi() in VMEXIT handler
> Message-ID: <50A5330D.9020204@citrix.com>
> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
> 
> On 15/11/12 17:44, Tim Deegan wrote:
>> At 17:33 +0000 on 15 Nov (1353000782), Mats Petersson wrote:
>>> On 15/11/12 17:15, Tim Deegan wrote:
>>>> At 17:03 +0000 on 15 Nov (1352998993), Mats Petersson wrote:
>>>>>> On an AMD CPU we _don't_ have dedicated stacks for NMI or MCE when we're
>>>>>> running a HVM guest, so the stack issue doesn't apply (but nested NMIs
>>>>>> are still bad).
>>>>>> 
>>>>>> On an Intel CPU, we _do_ use dedicated stacks for NMI and MCE in HVM
>>>>>> guests.  We don't really have to but it saves time in the context switch
>>>>>> not to update the IDT.  Using do_nmi() here means that the first NMI is
>>>>>> handled on the normal stack instead.  It's also consistent with the way
>>>>>> we call do_machine_check() for the MCE case.  But it needs an explicit
>>>>>> IRET after the call to do_nmi() to make sure that NMIs get re-enabled.
>>>>> Both AMD and Intel has an identical setup with regard to stacks and
>>>>> general "what happens when we taken one of these interrupts".
>>>> My reading of svm_ctxt_switch_{to,from} makes me disagree with this.
>>>> AFAICT, on SVM we're not using dedicated stacks at all.
>>> In SVM, the VMRUN returns to whatever stack you had before the VMRUN.
>>> This is not what I'm talking about, however. The stack used for the NMI
>>> and MCE comes from the interrupt descriptor entry for those respective
>>> vectors.
>> This is the code I was referring to:
>> 
>>     /*
>>      * Cannot use ISTs for NMI/#MC/#DF while we are running with the guest TR.
>>      * But this doesn't matter: the IST is only req'd to handle SYSCALL/SYSRET.
>>      */
>>     idt_tables[cpu][TRAP_double_fault].a  &= ~(7UL << 32);
>>     idt_tables[cpu][TRAP_nmi].a           &= ~(7UL << 32);
>>     idt_tables[cpu][TRAP_machine_check].a &= ~(7UL << 32);
>> 
>> Am I misreading it?
> 
> No, you are reading it perfectly right, I'm wrong...
> 
> --
> Mats
>> 
>>> So in conclusion, the do_mce_exception() call probably should be a
>>> __asm__ __volatile__("int $X"), where X is the relevant vector.
>> This handles MCEs that were raised in guest context.  If we've managed
>> to get this far into the exit handler, the hypervisor stack is probably
>> OK. :)
>> 
>> I'd be happy to invoke the MCE handler though the IDT here, just for
>> symmetry with the other cases, but I don't think it makes much
>> difference.
>> 
>> Tim.
>> 
>> 
> 
> 
> 
> 
> ------------------------------
> 
> Message: 5
> Date: Thu, 15 Nov 2012 13:29:28 -0500
> From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> To: Ian Campbell <Ian.Campbell@citrix.com>
> Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,	ANNIE LI
> 	<annie.li@oracle.com>,	"xen-devel@lists.xensource.com"
> 	<xen-devel@lists.xensource.com>,	Roger Pau Monne
> 	<roger.pau@citrix.com>
> Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
> 	xen-netfront/netback
> Message-ID: <20121115182928.GB22320@phenom.dumpdata.com>
> Content-Type: text/plain; charset=iso-8859-1
> 
> On Thu, Nov 15, 2012 at 11:15:06AM +0000, Ian Campbell wrote:
>> On Thu, 2012-11-15 at 10:56 +0000, Roger Pau Monne wrote:
>>> On 15/11/12 09:38, ANNIE LI wrote:
>>>> 
>>>> 
>>>> On 2012-11-15 15:40, Pasi K?rkk?inen wrote:
>>>>> Hello,
>>>>> 
>>>>> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
>>>>>> This patch implements persistent grants for xen-netfront/netback. This
>>>>>> mechanism maintains page pools in netback/netfront, these page pools is used to
>>>>>> save grant pages which are mapped. This way improve performance which is wasted
>>>>>> when doing grant operations.
>>>>>> 
>>>>>> Current netback/netfront does map/unmap grant operations frequently when
>>>>>> transmitting/receiving packets, and grant operations costs much cpu clock. In
>>>>>> this patch, netfront/netback maps grant pages when needed and then saves them
>>>>>> into a page pool for future use. All these pages will be unmapped when
>>>>>> removing/releasing the net device.
>>>>>> 
>>>>> Do you have performance numbers available already? with/without persistent grants?
>>>> I have some simple netperf/netserver test result with/without persistent 
>>>> grants,
>>>> 
>>>> Following is result of with persistent grant patch,
>>>> 
>>>> Guests, Sum,      Avg,     Min,     Max
>>>>  1,  15106.4,  15106.4, 15106.36, 15106.36
>>>>  2,  13052.7,  6526.34,  6261.81,  6790.86
>>>>  3,  12675.1,  6337.53,  6220.24,  6454.83
>>>>  4,  13194,  6596.98,  6274.70,  6919.25
>>>> 
>>>> 
>>>> Following are result of without persistent patch
>>>> 
>>>> Guests, Sum,     Avg,    Min,        Max
>>>>  1,  10864.1,  10864.1, 10864.10, 10864.10
>>>>  2,  10898.5,  5449.24,  4862.08,  6036.40
>>>>  3,  10734.5,  5367.26,  5261.43,  5473.08
>>>>  4,  10924,    5461.99,  5314.84,  5609.14
>>> 
>>> In the block case, performance improvement is seen when using a large
>>> number of guests, could you perform the same benchmark increasing the
>>> number of guests to 15?
>> 
>> It would also be nice to see some analysis of the numbers which justify
>> why this change is a good one without every reviewer having to evaluate
>> the raw data themselves. In fact this should really be part of the
>> commit message.
> 
> You mean like a nice graph, eh?
> 
> I will run these patches on my 32GB box and see if I can give you
> a nice PDF/jpg.
> 
>> 
>> Ian.
>> 
> 
> 
> 
> ------------------------------
> 
> Message: 6
> Date: Thu, 15 Nov 2012 18:29:13 +0000
> From: George Dunlap <george.dunlap@eu.citrix.com>
> To: Michael Palmeter <michael.palmeter@oracle.com>
> Cc: Dario Faggioli <raistlin@linux.it>,	"xen-devel@lists.xen.org"
> 	<xen-devel@lists.xen.org>
> Subject: Re: [Xen-devel] Xen credit scheduler question
> Message-ID: <50A53479.5050901@eu.citrix.com>
> Content-Type: text/plain; charset="windows-1252"; Format="flowed"
> 
> On 15/11/12 15:43, Michael Palmeter wrote:
>> 
>> Hi all (and Mr. Dunlap in particular),
>> 
> 
> Haha -- please don't call me "Mr"; I prefer "George", but if you want a 
> title, use "Dr" (since I have  PhD). :-)
> 
>> Example scenario:
>> 
>>  * Server hardware: 2 sockets, 8-cores per socket, 2 hardware threads
>>    per core (total of 32 hardware threads)
>>  * Test VM: a single virtual machine with a single vCPU, weight=256
>>    and cap=100%
>> 
>> In this scenario, from what I understand, I should be able to load the 
>> Test VM with traffic to a maximum of approximately 1/32 of the 
>> aggregate compute capacity of the server.  The total CPU utilization 
>> of the server hardware should be approximately 3.4%, plus the overhead 
>> of dom0 (say 1-2).  The credits available to any vCPU capped at 100% 
>> should be equal to 1/32 of the aggregate compute available for the 
>> whole server, correct?
>> 
> 
> I think to really be precise, you should say, "1/32nd of the logical cpu 
> time available", where "logical cpu time" simply means, "time processing 
> on one logical CPU".  At the moment, that is all that either the credit1 
> or credit2 schedulers look at.
> 
> As I'm sure you're aware, not all "logical cpu time" is equal.  If one 
> thread of a hyperthread pair is running but the other idle, it will get 
> significantly higher performance than if the other thread is busy.  How 
> much is highly unpredictable, and depends very much on exactly what 
> units are shared with the other hyperthread, and the workload running on 
> each unit.  But even when both threads are busy, it should (in theory) 
> be rare for both threads to get a throughput of 50%; the whole idea of 
> HT is that threads typically get 70-80% of the full performance of the 
> core (so the overall throughput is increased).
> 
> But if course, while this is particularly extreme in the case of 
> hyperthreads, it's also true on a smaller scale even without that -- 
> cores share caches, NUMA nodes share memory bandwidth, and so on. No 
> attempt is made to compensate VMs for cache misses or extra memory 
> latency due to sharing either. :-)
> 
>> Put simply, is there a way to constrain a VM with 1 vCPU to consume no 
>> more than 0.5 of a physical core (hyper-threaded) on the server 
>> hardware mentioned below? Does the cap help in that respect?
>> 
> 
> You can use "cap" to make the VM in question get 50% of logical vcpu 
> time, which on an idle system will give it 0.5 of the capacity of a 
> physical core (if we don't consider Intel's Turbo Boost technology).  
> But if the system becomes busy, it will get less than 0.5 of the 
> processing capacity of a physical core.
> 
>> I have been struggling to understand how the scheduler can deal with 
>> the uncertainty that hyperthreading introduces, however.  I know this 
>> is an issue that you are tackling in the credit2 scheduler, but I 
>> would like to know what your thoughts are on this problem (if you are 
>> able to share).  Any insight or assistance you could offer would be 
>> greatly appreciated.
>> 
> 
> At the moment it does not attempt to; the only thing it does is try not 
> to schedule two hyperthreads that share a core if there is an idle 
> core.  But if there are more active vcpus than cores, then some will 
> share; and the ones that share a core with another vcpu will be charged 
> the same as the ones that have the core all to themselves.
> 
> Could you explain why you your question is important to you -- i.e,. 
> what are you trying to accomplish?  It sounds a bit like you're more 
> concerned with accuracy in reporting, and control of resources, rather 
> than fairness, for instance.
> 
>  -George
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.xen.org/archives/html/xen-devel/attachments/20121115/b2ff8583/attachment.html>
> 
> ------------------------------
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 
> 
> End of Xen-devel Digest, Vol 93, Issue 157
> ******************************************


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 19:03:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 19:03:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ4iO-000471-Kc; Thu, 15 Nov 2012 19:03:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TZ4iN-00046w-OZ
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 19:03:03 +0000
Received: from [85.158.139.83:32331] by server-4.bemta-5.messagelabs.com id
	96/2E-15011-66C35A05; Thu, 15 Nov 2012 19:03:02 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1353006180!26521434!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25548 invoked from network); 15 Nov 2012 19:03:02 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 19:03:02 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFJ2pAP031352
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 19:02:52 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFJ2oNU008051
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 19:02:50 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFJ2nL2020688; Thu, 15 Nov 2012 13:02:49 -0600
MIME-Version: 1.0
Message-ID: <b410417c-55d5-46cc-a9bb-66ff20e4faf6@default>
Date: Thu, 15 Nov 2012 11:02:44 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Ian Campbell <Ian.Campbell@citrix.com>
References: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
	<1352976427.3499.100.camel@zakaz.uk.xensource.com>
	<50A4DEDE02000078000A8D22@nat28.tlf.novell.com>
In-Reply-To: <50A4DEDE02000078000A8D22@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "Keir \(Xen.org\)" <keir@xen.org>, "Tim\(Xen.org\)" <tim@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Thursday, November 15, 2012 4:24 AM
> To: Ian Campbell; Dan Magenheimer
> Cc: xen-devel@lists.xen.org; KonradWilk; Zhigang Wang; Keir (Xen.org); Tim(Xen.org)
> Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an existing) hypercall
> 
> >>> On 15.11.12 at 11:47, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Tue, 2012-11-13 at 22:23 +0000, Dan Magenheimer wrote:
> >> This is a first cut of the hypervisor patch of the proposed
> >> XENMEM_claim_pages hypercall/subop.
> >
> > Who is expected to be able to call this? I think a XENMEM subop implies
> > that the guest itself, plus perhaps any controlling stubdom (e.g. qemu)
> > could call
> > it, which I don't think is desirable.
> >
> > Should this be limited to the toolstack only and therefore be a subop of
> > domctl or some other hypercall?
> 
> Oh, yes, absolutely. Whether making it a domctl (where it doesn't
> belong except for that aspect) I'm not that sure, though.

I've added an IS_PRIV(current->domain) check in v3.  If this is
incorrect or insufficient, please let me know!

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 19:03:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 19:03:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ4iO-000471-Kc; Thu, 15 Nov 2012 19:03:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TZ4iN-00046w-OZ
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 19:03:03 +0000
Received: from [85.158.139.83:32331] by server-4.bemta-5.messagelabs.com id
	96/2E-15011-66C35A05; Thu, 15 Nov 2012 19:03:02 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1353006180!26521434!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25548 invoked from network); 15 Nov 2012 19:03:02 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 19:03:02 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFJ2pAP031352
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 19:02:52 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFJ2oNU008051
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 19:02:50 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFJ2nL2020688; Thu, 15 Nov 2012 13:02:49 -0600
MIME-Version: 1.0
Message-ID: <b410417c-55d5-46cc-a9bb-66ff20e4faf6@default>
Date: Thu, 15 Nov 2012 11:02:44 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Ian Campbell <Ian.Campbell@citrix.com>
References: <4a60001b-b323-4d62-8e7a-456b0f5e553a@default>
	<1352976427.3499.100.camel@zakaz.uk.xensource.com>
	<50A4DEDE02000078000A8D22@nat28.tlf.novell.com>
In-Reply-To: <50A4DEDE02000078000A8D22@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "Keir \(Xen.org\)" <keir@xen.org>, "Tim\(Xen.org\)" <tim@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Thursday, November 15, 2012 4:24 AM
> To: Ian Campbell; Dan Magenheimer
> Cc: xen-devel@lists.xen.org; KonradWilk; Zhigang Wang; Keir (Xen.org); Tim(Xen.org)
> Subject: Re: [Xen-devel] [RFC/PATCH] XENMEM_claim_pages (subop of an existing) hypercall
> 
> >>> On 15.11.12 at 11:47, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Tue, 2012-11-13 at 22:23 +0000, Dan Magenheimer wrote:
> >> This is a first cut of the hypervisor patch of the proposed
> >> XENMEM_claim_pages hypercall/subop.
> >
> > Who is expected to be able to call this? I think a XENMEM subop implies
> > that the guest itself, plus perhaps any controlling stubdom (e.g. qemu)
> > could call
> > it, which I don't think is desirable.
> >
> > Should this be limited to the toolstack only and therefore be a subop of
> > domctl or some other hypercall?
> 
> Oh, yes, absolutely. Whether making it a domctl (where it doesn't
> belong except for that aspect) I'm not that sure, though.

I've added an IS_PRIV(current->domain) check in v3.  If this is
incorrect or insufficient, please let me know!

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 19:04:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 19:04:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ4jd-0004FH-3T; Thu, 15 Nov 2012 19:04:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <michael.palmeter@oracle.com>) id 1TZ4jb-0004F7-Ag
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 19:04:19 +0000
Received: from [85.158.139.83:22925] by server-16.bemta-5.messagelabs.com id
	60/6A-04786-2BC35A05; Thu, 15 Nov 2012 19:04:18 +0000
X-Env-Sender: michael.palmeter@oracle.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1353006255!30466984!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTUyOTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9534 invoked from network); 15 Nov 2012 19:04:17 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-12.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 19:04:17 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFJ41pF003962
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 19:04:02 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFJ3xCa005293
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 19:04:00 GMT
Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFJ3wF4015878; Thu, 15 Nov 2012 13:03:58 -0600
MIME-Version: 1.0
Message-ID: <27449f60-0433-4e5f-b1fb-06914b84c6f1@default>
Date: Thu, 15 Nov 2012 11:03:56 -0800 (PST)
From: Michael Palmeter <michael.palmeter@oracle.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
References: <c58a9d3a-99e4-42ac-86c9-fbec600dee14@default>
	<50A53479.5050901@eu.citrix.com>
In-Reply-To: <50A53479.5050901@eu.citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__1353006237677169871abhmt114.oracle.com"
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Ashok Aletty <ashok.aletty@oracle.com>, Dario Faggioli <raistlin@linux.it>,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Xen credit scheduler question
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__1353006237677169871abhmt114.oracle.com
Content-Type: multipart/alternative;
 boundary="__1353006237677169872abhmt114.oracle.com"

--__1353006237677169872abhmt114.oracle.com
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Thank you for your answer, George.

=A0

The origin of my question is more of a business concern than a technical on=
e.=A0 Many software products are licensed based on a cost per processor cor=
e.=A0 It is desirable to sometimes allow customers to pay a fraction of sof=
tware license costs in exchange for running that software using only a comm=
ensurate fraction of available compute power (capacity sub-licensing).=A0 I=
f the cap is a means of making a vCPU more-or-less deterministic (in terms =
of its effective computational capacity) then that would be useful as a pro=
grammatic means of enabling capacity sub-licensing.=A0 My example below was=
 based on a case where I have a customer that would like to use 'cap' to co=
nstrain their single vCPU VM to only =BD of a core worth of compute capacit=
y (logically 1/32 of the compute power) in exchange for only paying 1/32 of=
 the license cost for the physical server.

=A0

Below you answered:

=A0

"You can use 'cap' to make the VM in question get 50% of logical vcpu time,=
 which on an idle system will give it 0.5 of the capacity of a physical cor=
e (if we don't consider Intel's Turbo Boost technology).=A0 But if the syst=
em becomes busy, it will get less than 0.5 of the processing capacity of a =
physical core."

=A0

Are you saying that cap would be able to CONSTRAIN a vCPU to an effective c=
ompute capacity equal to 50% of a physical core, but it does not GUARANTEE =
effective compute capacity equal to 50% of a physical core?=20

=A0

Can you offer any guidance regarding real-world scheduler overhead (when ca=
p>0 is used) and precision (how variable is actual compute power for a vCPU=
 with a cap of 100%, for example)?

=A0

- Mike

HYPERLINK "http://www.oracle.com/" \nOracle
Michael Palmeter | Sr. Director of Product Management, Oracle Exalogic Elas=
tic Cloud
Phone: HYPERLINK "tel:+14153736497"+14153736497 | Mobile: HYPERLINK "tel:+1=
4156949573"+14156949573 | VOIP: HYPERLINK "tel:+14154027422"+14154027422=20
Oracle Exalogic Development
200 Oracle Parkway | Redwood Shores, California 94065=20

HYPERLINK "http://www.oracle.com/commitment" \nGreen Oracle

Oracle is committed to developing practices and products that help protect =
the environment

=A0

HYPERLINK "http://www.oracle.com/pls/ebn/swf_viewer.load?p_shows_id=3D12641=
667&p_referred=3D0&p_width=3D1000&p_height=3D675"Watch the Exalogic 5-minut=
e Demo at http://www.oracle.com/pls/ebn/swf_viewer.load?p_shows_id=3D126416=
67

=A0

From: George Dunlap [mailto:george.dunlap@eu.citrix.com]=20
Sent: November 15, 2012 10:29 AM
To: Michael Palmeter
Cc: Dario Faggioli; xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Xen credit scheduler question

=A0

On 15/11/12 15:43, Michael Palmeter wrote:

Hi all (and Mr. Dunlap in particular),


Haha -- please don't call me "Mr"; I prefer "George", but if you want a tit=
le, use "Dr" (since I have=A0 PhD). :-)




Example scenario:

=A0

Server hardware: 2 sockets, 8-cores per socket, 2 hardware threads per core=
 (total of 32 hardware threads)
Test VM: a single virtual machine with a single vCPU, weight=3D256 and cap=
=3D100%

=A0

In this scenario, from what I understand, I should be able to load the Test=
 VM with traffic to a maximum of approximately 1/32 of the aggregate comput=
e capacity of the server.=A0 The total CPU utilization of the server hardwa=
re should be approximately 3.4%, plus the overhead of dom0 (say 1-2).=A0 Th=
e credits available to any vCPU capped at 100% should be equal to 1/32 of t=
he aggregate compute available for the whole server, correct?


I think to really be precise, you should say, "1/32nd of the logical cpu ti=
me available", where "logical cpu time" simply means, "time processing on o=
ne logical CPU".=A0 At the moment, that is all that either the credit1 or c=
redit2 schedulers look at.

As I'm sure you're aware, not all "logical cpu time" is equal.=A0 If one th=
read of a hyperthread pair is running but the other idle, it will get signi=
ficantly higher performance than if the other thread is busy.=A0 How much i=
s highly unpredictable, and depends very much on exactly what units are sha=
red with the other hyperthread, and the workload running on each unit.=A0 B=
ut even when both threads are busy, it should (in theory) be rare for both =
threads to get a throughput of 50%; the whole idea of HT is that threads ty=
pically get 70-80% of the full performance of the core (so the overall thro=
ughput is increased).

But if course, while this is particularly extreme in the case of hyperthrea=
ds, it's also true on a smaller scale even without that -- cores share cach=
es, NUMA nodes share memory bandwidth, and so on.=A0 No attempt is made to =
compensate VMs for cache misses or extra memory latency due to sharing eith=
er. :-)




Put simply, is there a way to constrain a VM with 1 vCPU to consume no more=
 than 0.5 of a physical core (hyper-threaded) on the server hardware mentio=
ned below? Does the cap help in that respect?


You can use "cap" to make the VM in question get 50% of logical vcpu time, =
which on an idle system will give it 0.5 of the capacity of a physical core=
 (if we don't consider Intel's Turbo Boost technology).=A0 But if the syste=
m becomes busy, it will get less than 0.5 of the processing capacity of a p=
hysical core.




I have been struggling to understand how the scheduler can deal with the un=
certainty that hyperthreading introduces, however.=A0 I know this is an iss=
ue that you are tackling in the credit2 scheduler, but I would like to know=
 what your thoughts are on this problem (if you are able to share).=A0 Any =
insight or assistance you could offer would be greatly appreciated.=A0=20


At the moment it does not attempt to; the only thing it does is try not to =
schedule two hyperthreads that share a core if there is an idle core.=A0 Bu=
t if there are more active vcpus than cores, then some will share; and the =
ones that share a core with another vcpu will be charged the same as the on=
es that have the core all to themselves.

Could you explain why you your question is important to you -- i.e,. what a=
re you trying to accomplish?=A0 It sounds a bit like you're more concerned =
with accuracy in reporting, and control of resources, rather than fairness,=
 for instance.

=A0-George

--__1353006237677169872abhmt114.oracle.com
Content-Type: multipart/related;
 boundary="__1353006237677169873abhmt114.oracle.com"

--__1353006237677169873abhmt114.oracle.com
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Diso-8859-=
1">
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-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 name=3DGenerator content=3D"Microso=
ft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#defa=
ult#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
=09{font-family:"Cambria Math";
=09panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
=09{font-family:Calibri;
=09panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
=09{font-family:Tahoma;
=09panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
=09{font-family:Verdana;
=09panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
=09{margin:0in;
=09margin-bottom:.0001pt;
=09font-size:11.0pt;
=09font-family:"Calibri","sans-serif";
=09color:black;}
a:link, span.MsoHyperlink
=09{mso-style-priority:99;
=09color:blue;
=09text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
=09{mso-style-priority:99;
=09color:purple;
=09text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
=09{mso-style-priority:99;
=09mso-style-link:"Balloon Text Char";
=09margin:0in;
=09margin-bottom:.0001pt;
=09font-size:8.0pt;
=09font-family:"Tahoma","sans-serif";
=09color:black;}
span.BalloonTextChar
=09{mso-style-name:"Balloon Text Char";
=09mso-style-priority:99;
=09mso-style-link:"Balloon Text";
=09font-family:"Tahoma","sans-serif";}
span.EmailStyle19
=09{mso-style-type:personal;
=09font-family:"Calibri","sans-serif";
=09color:windowtext;}
span.EmailStyle20
=09{mso-style-type:personal-reply;
=09font-family:"Calibri","sans-serif";
=09color:#1F497D;}
.MsoChpDefault
=09{mso-style-type:export-only;
=09font-size:10.0pt;}
@page WordSection1
=09{size:8.5in 11.0in;
=09margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
=09{page:WordSection1;}
/* List Definitions */
@list l0
=09{mso-list-id:599684598;
=09mso-list-type:hybrid;
=09mso-list-template-ids:1243763380 67698689 67698691 67698693 67698689 676=
98691 67698693 67698689 67698691 67698693;}
@list l0:level1
=09{mso-level-number-format:bullet;
=09mso-level-text:\F0B7;
=09mso-level-tab-stop:none;
=09mso-level-number-position:left;
=09text-indent:-.25in;
=09font-family:Symbol;}
@list l0:level2
=09{mso-level-tab-stop:1.0in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level3
=09{mso-level-tab-stop:1.5in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level4
=09{mso-level-tab-stop:2.0in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level5
=09{mso-level-tab-stop:2.5in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level6
=09{mso-level-tab-stop:3.0in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level7
=09{mso-level-tab-stop:3.5in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level8
=09{mso-level-tab-stop:4.0in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level9
=09{mso-level-tab-stop:4.5in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l1
=09{mso-list-id:1244485665;
=09mso-list-template-ids:2139918180;}
@list l1:level1
=09{mso-level-number-format:bullet;
=09mso-level-text:\F0B7;
=09mso-level-tab-stop:.5in;
=09mso-level-number-position:left;
=09text-indent:-.25in;
=09mso-ansi-font-size:10.0pt;
=09font-family:Symbol;}
ol
=09{margin-bottom:0in;}
ul
=09{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"2050" />
</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 bgcolor=3Dwhite lang=3DEN-US=
 link=3Dblue vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal>=
<span style=3D'color:#1F497D'>Thank you for your answer, George.<o:p></o:p>=
</span></p><p class=3DMsoNormal><span style=3D'color:#1F497D'><o:p>&nbsp;</=
o:p></span></p><p class=3DMsoNormal><span style=3D'color:#1F497D'>The origi=
n of my question is more of a business concern than a technical one.&nbsp; =
Many software products are licensed based on a cost per processor core.&nbs=
p; It is desirable to sometimes allow customers to pay a fraction of softwa=
re license costs in exchange for running that software using only a commens=
urate fraction of available compute power (capacity sub-licensing).&nbsp; I=
f the cap is a means of making a vCPU more-or-less deterministic (in terms =
of its effective computational capacity) then that would be useful as a pro=
grammatic means of enabling capacity sub-licensing.&nbsp; My example below =
was based on a case where I have a customer that would like to use &#8216;c=
ap&#8217; to constrain their single vCPU VM to only &frac12; of a core wort=
h of compute capacity (logically 1/32 of the compute power) in exchange for=
 only paying 1/32 of the license cost for the physical server.<o:p></o:p></=
span></p><p class=3DMsoNormal><span style=3D'color:#1F497D'><o:p>&nbsp;</o:=
p></span></p><p class=3DMsoNormal><span style=3D'color:#1F497D'>Below you a=
nswered:<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'color:#1F=
497D'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span style=3D'color=
:#1F497D'>&#8220;You can use &#8216;cap&#8217; to make the VM in question g=
et 50% of logical vcpu time, which on an idle system will give it 0.5 of th=
e capacity of a physical core (if we don't consider Intel's Turbo Boost tec=
hnology).&nbsp; But if the system becomes busy, it will get less than 0.5 o=
f the processing capacity of a physical core.&#8221;<o:p></o:p></span></p><=
p class=3DMsoNormal><span style=3D'color:#1F497D'><o:p>&nbsp;</o:p></span><=
/p><p class=3DMsoNormal><span style=3D'color:#1F497D'>Are you saying that c=
ap would be able to CONSTRAIN a vCPU to an effective compute capacity equal=
 to 50% of a physical core, but it does not GUARANTEE effective compute cap=
acity equal to 50% of a physical core? <o:p></o:p></span></p><p class=3DMso=
Normal><span style=3D'color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=
=3DMsoNormal><span style=3D'color:#1F497D'>Can you offer any guidance regar=
ding real-world scheduler overhead (when cap&gt;0 is used) and precision (h=
ow variable is actual compute power for a vCPU with a cap of 100%, for exam=
ple)?<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'color:#1F497=
D'><o:p>&nbsp;</o:p></span></p><div><p class=3DMsoNormal><span style=3D'col=
or:#1F497D'>- Mike<o:p></o:p></span></p><p class=3DMsoNormal style=3D'mso-m=
argin-top-alt:auto;mso-margin-bottom-alt:auto'><a href=3D"http://www.oracle=
.com/" target=3D"_blank"><span style=3D'font-size:12.0pt;font-family:"Times=
 New Roman","serif";color:black;text-decoration:none'><img border=3D0 width=
=3D114 height=3D26 id=3D"_x0000_i1026" src=3D"cid:image001.gif@01CDC31D.D76=
76D80" alt=3DOracle></span></a><span style=3D'font-size:12.0pt;font-family:=
"Times New Roman","serif";color:#1F497D'><br></span><span style=3D'font-siz=
e:10.0pt;font-family:"Verdana","sans-serif";color:#666666'>Michael Palmeter=
 | Sr. Director of Product Management, Oracle Exalogic Elastic Cloud<br>Pho=
ne: <a href=3D"tel:+14153736497"><span style=3D'color:black'>+14153736497</=
span></a> | Mobile: <a href=3D"tel:+14156949573"><span style=3D'color:black=
'>+14156949573</span></a> | VOIP: <a href=3D"tel:+14154027422"><span style=
=3D'color:black'>+14154027422</span></a> <br></span><span style=3D'font-siz=
e:10.0pt;font-family:"Verdana","sans-serif";color:red'>Oracle</span><span s=
tyle=3D'font-size:10.0pt;font-family:"Verdana","sans-serif";color:#666666'>=
 Exalogic Development<br>200 Oracle Parkway | Redwood Shores, California 94=
065</span><span style=3D'font-size:12.0pt;font-family:"Times New Roman","se=
rif";color:#1F497D'> <o:p></o:p></span></p></div><table class=3DMsoNormalTa=
ble border=3D0 cellspacing=3D3 cellpadding=3D0><tr><td style=3D'padding:.75=
pt .75pt .75pt .75pt'><p class=3DMsoNormal><a href=3D"http://www.oracle.com=
/commitment" target=3D"_blank"><span style=3D'color:black;text-decoration:n=
one'><img border=3D0 width=3D44 height=3D28 id=3D"_x0000_i1025" src=3D"cid:=
image002.gif@01CDC31D.D7676D80" alt=3D"Green Oracle"></span></a><span style=
=3D'font-size:12.0pt;color:#1F497D'><o:p></o:p></span></p></td><td style=3D=
'padding:.75pt .75pt .75pt .75pt'><p class=3DMsoNormal><span style=3D'font-=
size:7.5pt;font-family:"Verdana","sans-serif";color:#4B7D42'>Oracle is comm=
itted to developing practices and products that help protect the environmen=
t</span><span style=3D'font-size:12.0pt;color:#1F497D'><o:p></o:p></span></=
p></td></tr></table><p class=3DMsoNormal><span style=3D'color:#1F497D'><o:p=
>&nbsp;</o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:9.0pt=
;color:#1F497D'><a href=3D"http://www.oracle.com/pls/ebn/swf_viewer.load?p_=
shows_id=3D12641667&amp;p_referred=3D0&amp;p_width=3D1000&amp;p_height=3D67=
5"><span style=3D'color:black;text-decoration:none'>Watch the Exalogic 5-mi=
nute Demo at</span><span style=3D'color:#1F497D'> </span>http://www.oracle.=
com/pls/ebn/swf_viewer.load?p_shows_id=3D12641667</a><o:p></o:p></span></p>=
<p class=3DMsoNormal><span style=3D'color:#1F497D'><o:p>&nbsp;</o:p></span>=
</p><div><div style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3=
.0pt 0in 0in 0in'><p class=3DMsoNormal><b><span style=3D'font-size:10.0pt;f=
ont-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span st=
yle=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'=
> George Dunlap [mailto:george.dunlap@eu.citrix.com] <br><b>Sent:</b> Novem=
ber 15, 2012 10:29 AM<br><b>To:</b> Michael Palmeter<br><b>Cc:</b> Dario Fa=
ggioli; xen-devel@lists.xen.org<br><b>Subject:</b> Re: [Xen-devel] Xen cred=
it scheduler question<o:p></o:p></span></p></div></div><p class=3DMsoNormal=
><o:p>&nbsp;</o:p></p><div><p class=3DMsoNormal>On 15/11/12 15:43, Michael =
Palmeter wrote:<o:p></o:p></p></div><blockquote style=3D'margin-top:5.0pt;m=
argin-bottom:5.0pt'><p class=3DMsoNormal>Hi all (and Mr. Dunlap in particul=
ar),<o:p></o:p></p></blockquote><p class=3DMsoNormal><span style=3D'font-si=
ze:12.0pt;font-family:"Times New Roman","serif"'><br>Haha -- please don't c=
all me &quot;Mr&quot;; I prefer &quot;George&quot;, but if you want a title=
, use &quot;Dr&quot; (since I have&nbsp; PhD). :-)<br><br><br><o:p></o:p></=
span></p><p class=3DMsoNormal>Example scenario:<o:p></o:p></p><p class=3DMs=
oNormal>&nbsp;<o:p></o:p></p><ul style=3D'margin-top:0in' type=3Ddisc><li c=
lass=3DMsoNormal style=3D'mso-list:l0 level1 lfo3'>Server hardware: 2 socke=
ts, 8-cores per socket, 2 hardware threads per core (total of 32 hardware t=
hreads)<o:p></o:p></li><li class=3DMsoNormal style=3D'mso-list:l0 level1 lf=
o3'>Test VM: a single virtual machine with a single vCPU, weight=3D256 and =
cap=3D100%<o:p></o:p></li></ul><p class=3DMsoNormal>&nbsp;<o:p></o:p></p><p=
 class=3DMsoNormal>In this scenario, from what I understand, I should be ab=
le to load the Test VM with traffic to a maximum of approximately 1/32 of t=
he aggregate compute capacity of the server.&nbsp; The total CPU utilizatio=
n of the server hardware should be approximately 3.4%, plus the overhead of=
 dom0 (say 1-2).&nbsp; The credits available to any vCPU capped at 100% sho=
uld be equal to 1/32 of the aggregate compute available for the whole serve=
r, correct?<o:p></o:p></p><p class=3DMsoNormal><span style=3D'font-size:12.=
0pt;font-family:"Times New Roman","serif"'><br>I think to really be precise=
, you should say, &quot;1/32nd of the logical cpu time available&quot;, whe=
re &quot;logical cpu time&quot; simply means, &quot;time processing on one =
logical CPU&quot;.&nbsp; At the moment, that is all that either the credit1=
 or credit2 schedulers look at.<br><br>As I'm sure you're aware, not all &q=
uot;logical cpu time&quot; is equal.&nbsp; If one thread of a hyperthread p=
air is running but the other idle, it will get significantly higher perform=
ance than if the other thread is busy.&nbsp; How much is highly unpredictab=
le, and depends very much on exactly what units are shared with the other h=
yperthread, and the workload running on each unit.&nbsp; But even when both=
 threads are busy, it should (in theory) be rare for both threads to get a =
throughput of 50%; the whole idea of HT is that threads typically get 70-80=
% of the full performance of the core (so the overall throughput is increas=
ed).<br><br>But if course, while this is particularly extreme in the case o=
f hyperthreads, it's also true on a smaller scale even without that -- core=
s share caches, NUMA nodes share memory bandwidth, and so on.&nbsp; No atte=
mpt is made to compensate VMs for cache misses or extra memory latency due =
to sharing either. :-)<br><br><br><o:p></o:p></span></p><p class=3DMsoNorma=
l>Put simply, is there a way to constrain a VM with 1 vCPU to consume no mo=
re than 0.5 of a physical core (hyper-threaded) on the server hardware ment=
ioned below? Does the cap help in that respect?<o:p></o:p></p><p class=3DMs=
oNormal><span style=3D'font-size:12.0pt;font-family:"Times New Roman","seri=
f"'><br>You can use &quot;cap&quot; to make the VM in question get 50% of l=
ogical vcpu time, which on an idle system will give it 0.5 of the capacity =
of a physical core (if we don't consider Intel's Turbo Boost technology).&n=
bsp; But if the system becomes busy, it will get less than 0.5 of the proce=
ssing capacity of a physical core.<br><br><br><o:p></o:p></span></p><p clas=
s=3DMsoNormal>I have been struggling to understand how the scheduler can de=
al with the uncertainty that hyperthreading introduces, however.&nbsp; I kn=
ow this is an issue that you are tackling in the credit2 scheduler, but I w=
ould like to know what your thoughts are on this problem (if you are able t=
o share).&nbsp; Any insight or assistance you could offer would be greatly =
appreciated.&nbsp; <o:p></o:p></p><p class=3DMsoNormal><span style=3D'font-=
size:12.0pt;font-family:"Times New Roman","serif"'><br>At the moment it doe=
s not attempt to; the only thing it does is try not to schedule two hyperth=
reads that share a core if there is an idle core.&nbsp; But if there are mo=
re active vcpus than cores, then some will share; and the ones that share a=
 core with another vcpu will be charged the same as the ones that have the =
core all to themselves.<br><br>Could you explain why you your question is i=
mportant to you -- i.e,. what are you trying to accomplish?&nbsp; It sounds=
 a bit like you're more concerned with accuracy in reporting, and control o=
f resources, rather than fairness, for instance.<br><br>&nbsp;-George<o:p><=
/o:p></span></p></div></body></html>
--__1353006237677169873abhmt114.oracle.com
Content-Type: image/gif; name="image001.gif"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="image001.gif"
Content-ID: <image001.gif@01CDC31D.D7676D80>

R0lGODlhcgAaAMQAAP8QEP/w8P/Q0P/g4P8wMP9gYP8gIP+goP9QUP+QkP+wsP9wcP+AgP9AQP/A
wP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAA
AAAALAAAAAByABoAAAX/ICSOZGmeaKqubOu+cCzPdC0GCqPvvBKUDp5wp1gFdIPVIDfcOQa6A8yR
aO4gweQoUHh4v2Bw4SdihM9egyBF8ALIpkEXDR44vA2XwkD/IgYGAAZbbX1nBGRmhl8AWiUJYicC
AIsPDFh4LXOGjQ4NAAhrEIUPBQcOqKmoB5sEZV4JqqoHhQVxlGAOJQG4AAunsqg/dw95KwdfBgzB
qKIEBMaQDwCiKpOwEIq6KANuJg14igZwEHPULMTGKbxetjF8D1ItxK7aKl8lCl8DAfALW1+2rUi3
QtqgGN2mwYCXzYvAON624LoEQZ9DEfRcEFSBIE2DjyBDfnyIqRgMcA8a/z5AZQWXOxEdHxwUgfIg
sX/zMqlAWclVCQFefLpAqdJBAFJn3owgtpJEQkslEWjUmYLnomokcDlS4s0eFzQNqvXDEyzmAwFP
yaXYmGJBuxlzELWIacueiE0AFGyF4HbaNTquUEpFRxUFUC9YXQzARYAkEJSNipKQ9kDu0i9SKKNZ
9iXswMIoYgI4oJYFskpgzkkmcdrviELqmPVt1HpRAaaLqCE1lBgjvEpqRtgl8Tevygd7TcCuiKvP
m8OVEkAIYLYPThSsRIpEQJr1x94QBIT09FH6QJC6AiRAoB1kEb7tRb4MvyB+AwSlbejfz7+///8A
BijggAQWaOCBCCao4A+CDDbo4IMQRijhhBQKGAIAOw==
--__1353006237677169873abhmt114.oracle.com
Content-Type: image/gif; name="image002.gif"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="image002.gif"
Content-ID: <image002.gif@01CDC31D.D7676D80>

R0lGODlhLAAcAMQAAP///0x9RHmec9Pf0aa+oleFULHGrmKNW+nv6I+uivT39N7n3W6VZ7zPuZu2
lsjXxYSmfwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAA
AAAALAAAAAAsABwAQAXhICCOZGmeaDoaReC+sKAMR7GopIA6boIvLgPAVSAgALxjSYdrOp/Q6NPg
YqIEPkTBV2taTwgGbEw+PAZo3FfKbqMQQfeJ8DoY0Hg0wxhAKBgHCl5XLgMqDwFCAAIFPIYDgidr
OUQGkSh0cQMJAQyXOXKhoqOkpaanI2aoIwMErq+uCY0BMlANKpxkYwQGBH82TpMicD0pAgQACToD
AchqhAG3KQ4HIlQNnErG0IYqB9EAiEQvwEsozC43hy0CAeXMwsLDLS8MAvf497ruCZ+gOA0gfNt3
AIK0J/JWKVzIsEQIADs=
--__1353006237677169873abhmt114.oracle.com--

--__1353006237677169872abhmt114.oracle.com--

--__1353006237677169871abhmt114.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__1353006237677169871abhmt114.oracle.com--


From xen-devel-bounces@lists.xen.org Thu Nov 15 19:04:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 19:04:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ4jd-0004FH-3T; Thu, 15 Nov 2012 19:04:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <michael.palmeter@oracle.com>) id 1TZ4jb-0004F7-Ag
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 19:04:19 +0000
Received: from [85.158.139.83:22925] by server-16.bemta-5.messagelabs.com id
	60/6A-04786-2BC35A05; Thu, 15 Nov 2012 19:04:18 +0000
X-Env-Sender: michael.palmeter@oracle.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1353006255!30466984!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTUyOTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9534 invoked from network); 15 Nov 2012 19:04:17 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-12.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 19:04:17 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFJ41pF003962
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 19:04:02 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFJ3xCa005293
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 19:04:00 GMT
Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFJ3wF4015878; Thu, 15 Nov 2012 13:03:58 -0600
MIME-Version: 1.0
Message-ID: <27449f60-0433-4e5f-b1fb-06914b84c6f1@default>
Date: Thu, 15 Nov 2012 11:03:56 -0800 (PST)
From: Michael Palmeter <michael.palmeter@oracle.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
References: <c58a9d3a-99e4-42ac-86c9-fbec600dee14@default>
	<50A53479.5050901@eu.citrix.com>
In-Reply-To: <50A53479.5050901@eu.citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__1353006237677169871abhmt114.oracle.com"
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Ashok Aletty <ashok.aletty@oracle.com>, Dario Faggioli <raistlin@linux.it>,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Xen credit scheduler question
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__1353006237677169871abhmt114.oracle.com
Content-Type: multipart/alternative;
 boundary="__1353006237677169872abhmt114.oracle.com"

--__1353006237677169872abhmt114.oracle.com
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Thank you for your answer, George.

=A0

The origin of my question is more of a business concern than a technical on=
e.=A0 Many software products are licensed based on a cost per processor cor=
e.=A0 It is desirable to sometimes allow customers to pay a fraction of sof=
tware license costs in exchange for running that software using only a comm=
ensurate fraction of available compute power (capacity sub-licensing).=A0 I=
f the cap is a means of making a vCPU more-or-less deterministic (in terms =
of its effective computational capacity) then that would be useful as a pro=
grammatic means of enabling capacity sub-licensing.=A0 My example below was=
 based on a case where I have a customer that would like to use 'cap' to co=
nstrain their single vCPU VM to only =BD of a core worth of compute capacit=
y (logically 1/32 of the compute power) in exchange for only paying 1/32 of=
 the license cost for the physical server.

=A0

Below you answered:

=A0

"You can use 'cap' to make the VM in question get 50% of logical vcpu time,=
 which on an idle system will give it 0.5 of the capacity of a physical cor=
e (if we don't consider Intel's Turbo Boost technology).=A0 But if the syst=
em becomes busy, it will get less than 0.5 of the processing capacity of a =
physical core."

=A0

Are you saying that cap would be able to CONSTRAIN a vCPU to an effective c=
ompute capacity equal to 50% of a physical core, but it does not GUARANTEE =
effective compute capacity equal to 50% of a physical core?=20

=A0

Can you offer any guidance regarding real-world scheduler overhead (when ca=
p>0 is used) and precision (how variable is actual compute power for a vCPU=
 with a cap of 100%, for example)?

=A0

- Mike

HYPERLINK "http://www.oracle.com/" \nOracle
Michael Palmeter | Sr. Director of Product Management, Oracle Exalogic Elas=
tic Cloud
Phone: HYPERLINK "tel:+14153736497"+14153736497 | Mobile: HYPERLINK "tel:+1=
4156949573"+14156949573 | VOIP: HYPERLINK "tel:+14154027422"+14154027422=20
Oracle Exalogic Development
200 Oracle Parkway | Redwood Shores, California 94065=20

HYPERLINK "http://www.oracle.com/commitment" \nGreen Oracle

Oracle is committed to developing practices and products that help protect =
the environment

=A0

HYPERLINK "http://www.oracle.com/pls/ebn/swf_viewer.load?p_shows_id=3D12641=
667&p_referred=3D0&p_width=3D1000&p_height=3D675"Watch the Exalogic 5-minut=
e Demo at http://www.oracle.com/pls/ebn/swf_viewer.load?p_shows_id=3D126416=
67

=A0

From: George Dunlap [mailto:george.dunlap@eu.citrix.com]=20
Sent: November 15, 2012 10:29 AM
To: Michael Palmeter
Cc: Dario Faggioli; xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Xen credit scheduler question

=A0

On 15/11/12 15:43, Michael Palmeter wrote:

Hi all (and Mr. Dunlap in particular),


Haha -- please don't call me "Mr"; I prefer "George", but if you want a tit=
le, use "Dr" (since I have=A0 PhD). :-)




Example scenario:

=A0

Server hardware: 2 sockets, 8-cores per socket, 2 hardware threads per core=
 (total of 32 hardware threads)
Test VM: a single virtual machine with a single vCPU, weight=3D256 and cap=
=3D100%

=A0

In this scenario, from what I understand, I should be able to load the Test=
 VM with traffic to a maximum of approximately 1/32 of the aggregate comput=
e capacity of the server.=A0 The total CPU utilization of the server hardwa=
re should be approximately 3.4%, plus the overhead of dom0 (say 1-2).=A0 Th=
e credits available to any vCPU capped at 100% should be equal to 1/32 of t=
he aggregate compute available for the whole server, correct?


I think to really be precise, you should say, "1/32nd of the logical cpu ti=
me available", where "logical cpu time" simply means, "time processing on o=
ne logical CPU".=A0 At the moment, that is all that either the credit1 or c=
redit2 schedulers look at.

As I'm sure you're aware, not all "logical cpu time" is equal.=A0 If one th=
read of a hyperthread pair is running but the other idle, it will get signi=
ficantly higher performance than if the other thread is busy.=A0 How much i=
s highly unpredictable, and depends very much on exactly what units are sha=
red with the other hyperthread, and the workload running on each unit.=A0 B=
ut even when both threads are busy, it should (in theory) be rare for both =
threads to get a throughput of 50%; the whole idea of HT is that threads ty=
pically get 70-80% of the full performance of the core (so the overall thro=
ughput is increased).

But if course, while this is particularly extreme in the case of hyperthrea=
ds, it's also true on a smaller scale even without that -- cores share cach=
es, NUMA nodes share memory bandwidth, and so on.=A0 No attempt is made to =
compensate VMs for cache misses or extra memory latency due to sharing eith=
er. :-)




Put simply, is there a way to constrain a VM with 1 vCPU to consume no more=
 than 0.5 of a physical core (hyper-threaded) on the server hardware mentio=
ned below? Does the cap help in that respect?


You can use "cap" to make the VM in question get 50% of logical vcpu time, =
which on an idle system will give it 0.5 of the capacity of a physical core=
 (if we don't consider Intel's Turbo Boost technology).=A0 But if the syste=
m becomes busy, it will get less than 0.5 of the processing capacity of a p=
hysical core.




I have been struggling to understand how the scheduler can deal with the un=
certainty that hyperthreading introduces, however.=A0 I know this is an iss=
ue that you are tackling in the credit2 scheduler, but I would like to know=
 what your thoughts are on this problem (if you are able to share).=A0 Any =
insight or assistance you could offer would be greatly appreciated.=A0=20


At the moment it does not attempt to; the only thing it does is try not to =
schedule two hyperthreads that share a core if there is an idle core.=A0 Bu=
t if there are more active vcpus than cores, then some will share; and the =
ones that share a core with another vcpu will be charged the same as the on=
es that have the core all to themselves.

Could you explain why you your question is important to you -- i.e,. what a=
re you trying to accomplish?=A0 It sounds a bit like you're more concerned =
with accuracy in reporting, and control of resources, rather than fairness,=
 for instance.

=A0-George

--__1353006237677169872abhmt114.oracle.com
Content-Type: multipart/related;
 boundary="__1353006237677169873abhmt114.oracle.com"

--__1353006237677169873abhmt114.oracle.com
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Diso-8859-=
1">
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-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 name=3DGenerator content=3D"Microso=
ft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#defa=
ult#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
=09{font-family:"Cambria Math";
=09panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
=09{font-family:Calibri;
=09panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
=09{font-family:Tahoma;
=09panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
=09{font-family:Verdana;
=09panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
=09{margin:0in;
=09margin-bottom:.0001pt;
=09font-size:11.0pt;
=09font-family:"Calibri","sans-serif";
=09color:black;}
a:link, span.MsoHyperlink
=09{mso-style-priority:99;
=09color:blue;
=09text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
=09{mso-style-priority:99;
=09color:purple;
=09text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
=09{mso-style-priority:99;
=09mso-style-link:"Balloon Text Char";
=09margin:0in;
=09margin-bottom:.0001pt;
=09font-size:8.0pt;
=09font-family:"Tahoma","sans-serif";
=09color:black;}
span.BalloonTextChar
=09{mso-style-name:"Balloon Text Char";
=09mso-style-priority:99;
=09mso-style-link:"Balloon Text";
=09font-family:"Tahoma","sans-serif";}
span.EmailStyle19
=09{mso-style-type:personal;
=09font-family:"Calibri","sans-serif";
=09color:windowtext;}
span.EmailStyle20
=09{mso-style-type:personal-reply;
=09font-family:"Calibri","sans-serif";
=09color:#1F497D;}
.MsoChpDefault
=09{mso-style-type:export-only;
=09font-size:10.0pt;}
@page WordSection1
=09{size:8.5in 11.0in;
=09margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
=09{page:WordSection1;}
/* List Definitions */
@list l0
=09{mso-list-id:599684598;
=09mso-list-type:hybrid;
=09mso-list-template-ids:1243763380 67698689 67698691 67698693 67698689 676=
98691 67698693 67698689 67698691 67698693;}
@list l0:level1
=09{mso-level-number-format:bullet;
=09mso-level-text:\F0B7;
=09mso-level-tab-stop:none;
=09mso-level-number-position:left;
=09text-indent:-.25in;
=09font-family:Symbol;}
@list l0:level2
=09{mso-level-tab-stop:1.0in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level3
=09{mso-level-tab-stop:1.5in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level4
=09{mso-level-tab-stop:2.0in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level5
=09{mso-level-tab-stop:2.5in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level6
=09{mso-level-tab-stop:3.0in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level7
=09{mso-level-tab-stop:3.5in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level8
=09{mso-level-tab-stop:4.0in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l0:level9
=09{mso-level-tab-stop:4.5in;
=09mso-level-number-position:left;
=09text-indent:-.25in;}
@list l1
=09{mso-list-id:1244485665;
=09mso-list-template-ids:2139918180;}
@list l1:level1
=09{mso-level-number-format:bullet;
=09mso-level-text:\F0B7;
=09mso-level-tab-stop:.5in;
=09mso-level-number-position:left;
=09text-indent:-.25in;
=09mso-ansi-font-size:10.0pt;
=09font-family:Symbol;}
ol
=09{margin-bottom:0in;}
ul
=09{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"2050" />
</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 bgcolor=3Dwhite lang=3DEN-US=
 link=3Dblue vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal>=
<span style=3D'color:#1F497D'>Thank you for your answer, George.<o:p></o:p>=
</span></p><p class=3DMsoNormal><span style=3D'color:#1F497D'><o:p>&nbsp;</=
o:p></span></p><p class=3DMsoNormal><span style=3D'color:#1F497D'>The origi=
n of my question is more of a business concern than a technical one.&nbsp; =
Many software products are licensed based on a cost per processor core.&nbs=
p; It is desirable to sometimes allow customers to pay a fraction of softwa=
re license costs in exchange for running that software using only a commens=
urate fraction of available compute power (capacity sub-licensing).&nbsp; I=
f the cap is a means of making a vCPU more-or-less deterministic (in terms =
of its effective computational capacity) then that would be useful as a pro=
grammatic means of enabling capacity sub-licensing.&nbsp; My example below =
was based on a case where I have a customer that would like to use &#8216;c=
ap&#8217; to constrain their single vCPU VM to only &frac12; of a core wort=
h of compute capacity (logically 1/32 of the compute power) in exchange for=
 only paying 1/32 of the license cost for the physical server.<o:p></o:p></=
span></p><p class=3DMsoNormal><span style=3D'color:#1F497D'><o:p>&nbsp;</o:=
p></span></p><p class=3DMsoNormal><span style=3D'color:#1F497D'>Below you a=
nswered:<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'color:#1F=
497D'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span style=3D'color=
:#1F497D'>&#8220;You can use &#8216;cap&#8217; to make the VM in question g=
et 50% of logical vcpu time, which on an idle system will give it 0.5 of th=
e capacity of a physical core (if we don't consider Intel's Turbo Boost tec=
hnology).&nbsp; But if the system becomes busy, it will get less than 0.5 o=
f the processing capacity of a physical core.&#8221;<o:p></o:p></span></p><=
p class=3DMsoNormal><span style=3D'color:#1F497D'><o:p>&nbsp;</o:p></span><=
/p><p class=3DMsoNormal><span style=3D'color:#1F497D'>Are you saying that c=
ap would be able to CONSTRAIN a vCPU to an effective compute capacity equal=
 to 50% of a physical core, but it does not GUARANTEE effective compute cap=
acity equal to 50% of a physical core? <o:p></o:p></span></p><p class=3DMso=
Normal><span style=3D'color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=
=3DMsoNormal><span style=3D'color:#1F497D'>Can you offer any guidance regar=
ding real-world scheduler overhead (when cap&gt;0 is used) and precision (h=
ow variable is actual compute power for a vCPU with a cap of 100%, for exam=
ple)?<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'color:#1F497=
D'><o:p>&nbsp;</o:p></span></p><div><p class=3DMsoNormal><span style=3D'col=
or:#1F497D'>- Mike<o:p></o:p></span></p><p class=3DMsoNormal style=3D'mso-m=
argin-top-alt:auto;mso-margin-bottom-alt:auto'><a href=3D"http://www.oracle=
.com/" target=3D"_blank"><span style=3D'font-size:12.0pt;font-family:"Times=
 New Roman","serif";color:black;text-decoration:none'><img border=3D0 width=
=3D114 height=3D26 id=3D"_x0000_i1026" src=3D"cid:image001.gif@01CDC31D.D76=
76D80" alt=3DOracle></span></a><span style=3D'font-size:12.0pt;font-family:=
"Times New Roman","serif";color:#1F497D'><br></span><span style=3D'font-siz=
e:10.0pt;font-family:"Verdana","sans-serif";color:#666666'>Michael Palmeter=
 | Sr. Director of Product Management, Oracle Exalogic Elastic Cloud<br>Pho=
ne: <a href=3D"tel:+14153736497"><span style=3D'color:black'>+14153736497</=
span></a> | Mobile: <a href=3D"tel:+14156949573"><span style=3D'color:black=
'>+14156949573</span></a> | VOIP: <a href=3D"tel:+14154027422"><span style=
=3D'color:black'>+14154027422</span></a> <br></span><span style=3D'font-siz=
e:10.0pt;font-family:"Verdana","sans-serif";color:red'>Oracle</span><span s=
tyle=3D'font-size:10.0pt;font-family:"Verdana","sans-serif";color:#666666'>=
 Exalogic Development<br>200 Oracle Parkway | Redwood Shores, California 94=
065</span><span style=3D'font-size:12.0pt;font-family:"Times New Roman","se=
rif";color:#1F497D'> <o:p></o:p></span></p></div><table class=3DMsoNormalTa=
ble border=3D0 cellspacing=3D3 cellpadding=3D0><tr><td style=3D'padding:.75=
pt .75pt .75pt .75pt'><p class=3DMsoNormal><a href=3D"http://www.oracle.com=
/commitment" target=3D"_blank"><span style=3D'color:black;text-decoration:n=
one'><img border=3D0 width=3D44 height=3D28 id=3D"_x0000_i1025" src=3D"cid:=
image002.gif@01CDC31D.D7676D80" alt=3D"Green Oracle"></span></a><span style=
=3D'font-size:12.0pt;color:#1F497D'><o:p></o:p></span></p></td><td style=3D=
'padding:.75pt .75pt .75pt .75pt'><p class=3DMsoNormal><span style=3D'font-=
size:7.5pt;font-family:"Verdana","sans-serif";color:#4B7D42'>Oracle is comm=
itted to developing practices and products that help protect the environmen=
t</span><span style=3D'font-size:12.0pt;color:#1F497D'><o:p></o:p></span></=
p></td></tr></table><p class=3DMsoNormal><span style=3D'color:#1F497D'><o:p=
>&nbsp;</o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:9.0pt=
;color:#1F497D'><a href=3D"http://www.oracle.com/pls/ebn/swf_viewer.load?p_=
shows_id=3D12641667&amp;p_referred=3D0&amp;p_width=3D1000&amp;p_height=3D67=
5"><span style=3D'color:black;text-decoration:none'>Watch the Exalogic 5-mi=
nute Demo at</span><span style=3D'color:#1F497D'> </span>http://www.oracle.=
com/pls/ebn/swf_viewer.load?p_shows_id=3D12641667</a><o:p></o:p></span></p>=
<p class=3DMsoNormal><span style=3D'color:#1F497D'><o:p>&nbsp;</o:p></span>=
</p><div><div style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3=
.0pt 0in 0in 0in'><p class=3DMsoNormal><b><span style=3D'font-size:10.0pt;f=
ont-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span st=
yle=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'=
> George Dunlap [mailto:george.dunlap@eu.citrix.com] <br><b>Sent:</b> Novem=
ber 15, 2012 10:29 AM<br><b>To:</b> Michael Palmeter<br><b>Cc:</b> Dario Fa=
ggioli; xen-devel@lists.xen.org<br><b>Subject:</b> Re: [Xen-devel] Xen cred=
it scheduler question<o:p></o:p></span></p></div></div><p class=3DMsoNormal=
><o:p>&nbsp;</o:p></p><div><p class=3DMsoNormal>On 15/11/12 15:43, Michael =
Palmeter wrote:<o:p></o:p></p></div><blockquote style=3D'margin-top:5.0pt;m=
argin-bottom:5.0pt'><p class=3DMsoNormal>Hi all (and Mr. Dunlap in particul=
ar),<o:p></o:p></p></blockquote><p class=3DMsoNormal><span style=3D'font-si=
ze:12.0pt;font-family:"Times New Roman","serif"'><br>Haha -- please don't c=
all me &quot;Mr&quot;; I prefer &quot;George&quot;, but if you want a title=
, use &quot;Dr&quot; (since I have&nbsp; PhD). :-)<br><br><br><o:p></o:p></=
span></p><p class=3DMsoNormal>Example scenario:<o:p></o:p></p><p class=3DMs=
oNormal>&nbsp;<o:p></o:p></p><ul style=3D'margin-top:0in' type=3Ddisc><li c=
lass=3DMsoNormal style=3D'mso-list:l0 level1 lfo3'>Server hardware: 2 socke=
ts, 8-cores per socket, 2 hardware threads per core (total of 32 hardware t=
hreads)<o:p></o:p></li><li class=3DMsoNormal style=3D'mso-list:l0 level1 lf=
o3'>Test VM: a single virtual machine with a single vCPU, weight=3D256 and =
cap=3D100%<o:p></o:p></li></ul><p class=3DMsoNormal>&nbsp;<o:p></o:p></p><p=
 class=3DMsoNormal>In this scenario, from what I understand, I should be ab=
le to load the Test VM with traffic to a maximum of approximately 1/32 of t=
he aggregate compute capacity of the server.&nbsp; The total CPU utilizatio=
n of the server hardware should be approximately 3.4%, plus the overhead of=
 dom0 (say 1-2).&nbsp; The credits available to any vCPU capped at 100% sho=
uld be equal to 1/32 of the aggregate compute available for the whole serve=
r, correct?<o:p></o:p></p><p class=3DMsoNormal><span style=3D'font-size:12.=
0pt;font-family:"Times New Roman","serif"'><br>I think to really be precise=
, you should say, &quot;1/32nd of the logical cpu time available&quot;, whe=
re &quot;logical cpu time&quot; simply means, &quot;time processing on one =
logical CPU&quot;.&nbsp; At the moment, that is all that either the credit1=
 or credit2 schedulers look at.<br><br>As I'm sure you're aware, not all &q=
uot;logical cpu time&quot; is equal.&nbsp; If one thread of a hyperthread p=
air is running but the other idle, it will get significantly higher perform=
ance than if the other thread is busy.&nbsp; How much is highly unpredictab=
le, and depends very much on exactly what units are shared with the other h=
yperthread, and the workload running on each unit.&nbsp; But even when both=
 threads are busy, it should (in theory) be rare for both threads to get a =
throughput of 50%; the whole idea of HT is that threads typically get 70-80=
% of the full performance of the core (so the overall throughput is increas=
ed).<br><br>But if course, while this is particularly extreme in the case o=
f hyperthreads, it's also true on a smaller scale even without that -- core=
s share caches, NUMA nodes share memory bandwidth, and so on.&nbsp; No atte=
mpt is made to compensate VMs for cache misses or extra memory latency due =
to sharing either. :-)<br><br><br><o:p></o:p></span></p><p class=3DMsoNorma=
l>Put simply, is there a way to constrain a VM with 1 vCPU to consume no mo=
re than 0.5 of a physical core (hyper-threaded) on the server hardware ment=
ioned below? Does the cap help in that respect?<o:p></o:p></p><p class=3DMs=
oNormal><span style=3D'font-size:12.0pt;font-family:"Times New Roman","seri=
f"'><br>You can use &quot;cap&quot; to make the VM in question get 50% of l=
ogical vcpu time, which on an idle system will give it 0.5 of the capacity =
of a physical core (if we don't consider Intel's Turbo Boost technology).&n=
bsp; But if the system becomes busy, it will get less than 0.5 of the proce=
ssing capacity of a physical core.<br><br><br><o:p></o:p></span></p><p clas=
s=3DMsoNormal>I have been struggling to understand how the scheduler can de=
al with the uncertainty that hyperthreading introduces, however.&nbsp; I kn=
ow this is an issue that you are tackling in the credit2 scheduler, but I w=
ould like to know what your thoughts are on this problem (if you are able t=
o share).&nbsp; Any insight or assistance you could offer would be greatly =
appreciated.&nbsp; <o:p></o:p></p><p class=3DMsoNormal><span style=3D'font-=
size:12.0pt;font-family:"Times New Roman","serif"'><br>At the moment it doe=
s not attempt to; the only thing it does is try not to schedule two hyperth=
reads that share a core if there is an idle core.&nbsp; But if there are mo=
re active vcpus than cores, then some will share; and the ones that share a=
 core with another vcpu will be charged the same as the ones that have the =
core all to themselves.<br><br>Could you explain why you your question is i=
mportant to you -- i.e,. what are you trying to accomplish?&nbsp; It sounds=
 a bit like you're more concerned with accuracy in reporting, and control o=
f resources, rather than fairness, for instance.<br><br>&nbsp;-George<o:p><=
/o:p></span></p></div></body></html>
--__1353006237677169873abhmt114.oracle.com
Content-Type: image/gif; name="image001.gif"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="image001.gif"
Content-ID: <image001.gif@01CDC31D.D7676D80>

R0lGODlhcgAaAMQAAP8QEP/w8P/Q0P/g4P8wMP9gYP8gIP+goP9QUP+QkP+wsP9wcP+AgP9AQP/A
wP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAA
AAAALAAAAAByABoAAAX/ICSOZGmeaKqubOu+cCzPdC0GCqPvvBKUDp5wp1gFdIPVIDfcOQa6A8yR
aO4gweQoUHh4v2Bw4SdihM9egyBF8ALIpkEXDR44vA2XwkD/IgYGAAZbbX1nBGRmhl8AWiUJYicC
AIsPDFh4LXOGjQ4NAAhrEIUPBQcOqKmoB5sEZV4JqqoHhQVxlGAOJQG4AAunsqg/dw95KwdfBgzB
qKIEBMaQDwCiKpOwEIq6KANuJg14igZwEHPULMTGKbxetjF8D1ItxK7aKl8lCl8DAfALW1+2rUi3
QtqgGN2mwYCXzYvAON624LoEQZ9DEfRcEFSBIE2DjyBDfnyIqRgMcA8a/z5AZQWXOxEdHxwUgfIg
sX/zMqlAWclVCQFefLpAqdJBAFJn3owgtpJEQkslEWjUmYLnomokcDlS4s0eFzQNqvXDEyzmAwFP
yaXYmGJBuxlzELWIacueiE0AFGyF4HbaNTquUEpFRxUFUC9YXQzARYAkEJSNipKQ9kDu0i9SKKNZ
9iXswMIoYgI4oJYFskpgzkkmcdrviELqmPVt1HpRAaaLqCE1lBgjvEpqRtgl8Tevygd7TcCuiKvP
m8OVEkAIYLYPThSsRIpEQJr1x94QBIT09FH6QJC6AiRAoB1kEb7tRb4MvyB+AwSlbejfz7+///8A
BijggAQWaOCBCCao4A+CDDbo4IMQRijhhBQKGAIAOw==
--__1353006237677169873abhmt114.oracle.com
Content-Type: image/gif; name="image002.gif"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="image002.gif"
Content-ID: <image002.gif@01CDC31D.D7676D80>

R0lGODlhLAAcAMQAAP///0x9RHmec9Pf0aa+oleFULHGrmKNW+nv6I+uivT39N7n3W6VZ7zPuZu2
lsjXxYSmfwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAA
AAAALAAAAAAsABwAQAXhICCOZGmeaDoaReC+sKAMR7GopIA6boIvLgPAVSAgALxjSYdrOp/Q6NPg
YqIEPkTBV2taTwgGbEw+PAZo3FfKbqMQQfeJ8DoY0Hg0wxhAKBgHCl5XLgMqDwFCAAIFPIYDgidr
OUQGkSh0cQMJAQyXOXKhoqOkpaanI2aoIwMErq+uCY0BMlANKpxkYwQGBH82TpMicD0pAgQACToD
AchqhAG3KQ4HIlQNnErG0IYqB9EAiEQvwEsozC43hy0CAeXMwsLDLS8MAvf497ruCZ+gOA0gfNt3
AIK0J/JWKVzIsEQIADs=
--__1353006237677169873abhmt114.oracle.com--

--__1353006237677169872abhmt114.oracle.com--

--__1353006237677169871abhmt114.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__1353006237677169871abhmt114.oracle.com--


From xen-devel-bounces@lists.xen.org Thu Nov 15 19:11:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 19:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ4qF-0004VN-7z; Thu, 15 Nov 2012 19:11:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZ4qD-0004VF-Nk
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 19:11:09 +0000
Received: from [85.158.139.83:47651] by server-1.bemta-5.messagelabs.com id
	E7/AB-05877-C4E35A05; Thu, 15 Nov 2012 19:11:08 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1353006668!29930812!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3015 invoked from network); 15 Nov 2012 19:11:08 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 19:11:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208";a="15836731"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 19:11:08 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 19:11:07 +0000
Message-ID: <1353006667.26243.6.camel@dagon.hellion.org.uk>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Thu, 15 Nov 2012 19:11:07 +0000
In-Reply-To: <20121115182928.GB22320@phenom.dumpdata.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
	<50A4CA51.8080208@citrix.com>
	<1352978106.3499.101.camel@zakaz.uk.xensource.com>
	<20121115182928.GB22320@phenom.dumpdata.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
 xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 18:29 +0000, Konrad Rzeszutek Wilk wrote:
> On Thu, Nov 15, 2012 at 11:15:06AM +0000, Ian Campbell wrote:
> > On Thu, 2012-11-15 at 10:56 +0000, Roger Pau Monne wrote:
> > > On 15/11/12 09:38, ANNIE LI wrote:
> > > > =

> > > > =

> > > > On 2012-11-15 15:40, Pasi K=E4rkk=E4inen wrote:
> > > >> Hello,
> > > >>
> > > >> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
> > > >>> This patch implements persistent grants for xen-netfront/netback.=
 This
> > > >>> mechanism maintains page pools in netback/netfront, these page po=
ols is used to
> > > >>> save grant pages which are mapped. This way improve performance w=
hich is wasted
> > > >>> when doing grant operations.
> > > >>>
> > > >>> Current netback/netfront does map/unmap grant operations frequent=
ly when
> > > >>> transmitting/receiving packets, and grant operations costs much c=
pu clock. In
> > > >>> this patch, netfront/netback maps grant pages when needed and the=
n saves them
> > > >>> into a page pool for future use. All these pages will be unmapped=
 when
> > > >>> removing/releasing the net device.
> > > >>>
> > > >> Do you have performance numbers available already? with/without pe=
rsistent grants?
> > > > I have some simple netperf/netserver test result with/without persi=
stent =

> > > > grants,
> > > > =

> > > > Following is result of with persistent grant patch,
> > > > =

> > > > Guests, Sum,      Avg,     Min,     Max
> > > >   1,  15106.4,  15106.4, 15106.36, 15106.36
> > > >   2,  13052.7,  6526.34,  6261.81,  6790.86
> > > >   3,  12675.1,  6337.53,  6220.24,  6454.83
> > > >   4,  13194,  6596.98,  6274.70,  6919.25
> > > > =

> > > > =

> > > > Following are result of without persistent patch
> > > > =

> > > > Guests, Sum,     Avg,    Min,        Max
> > > >   1,  10864.1,  10864.1, 10864.10, 10864.10
> > > >   2,  10898.5,  5449.24,  4862.08,  6036.40
> > > >   3,  10734.5,  5367.26,  5261.43,  5473.08
> > > >   4,  10924,    5461.99,  5314.84,  5609.14
> > > =

> > > In the block case, performance improvement is seen when using a large
> > > number of guests, could you perform the same benchmark increasing the
> > > number of guests to 15?
> > =

> > It would also be nice to see some analysis of the numbers which justify
> > why this change is a good one without every reviewer having to evaluate
> > the raw data themselves. In fact this should really be part of the
> > commit message.
> =

> You mean like a nice graph, eh?

Together with an analysis of what it means and why it is a good thing,
yes.

Ian.

> =

> I will run these patches on my 32GB box and see if I can give you
> a nice PDF/jpg.
> =

> > =

> > Ian.
> > =




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 19:11:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 19:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ4qF-0004VN-7z; Thu, 15 Nov 2012 19:11:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZ4qD-0004VF-Nk
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 19:11:09 +0000
Received: from [85.158.139.83:47651] by server-1.bemta-5.messagelabs.com id
	E7/AB-05877-C4E35A05; Thu, 15 Nov 2012 19:11:08 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1353006668!29930812!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3015 invoked from network); 15 Nov 2012 19:11:08 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 19:11:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208";a="15836731"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 19:11:08 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 19:11:07 +0000
Message-ID: <1353006667.26243.6.camel@dagon.hellion.org.uk>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Thu, 15 Nov 2012 19:11:07 +0000
In-Reply-To: <20121115182928.GB22320@phenom.dumpdata.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
	<50A4CA51.8080208@citrix.com>
	<1352978106.3499.101.camel@zakaz.uk.xensource.com>
	<20121115182928.GB22320@phenom.dumpdata.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
 xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 18:29 +0000, Konrad Rzeszutek Wilk wrote:
> On Thu, Nov 15, 2012 at 11:15:06AM +0000, Ian Campbell wrote:
> > On Thu, 2012-11-15 at 10:56 +0000, Roger Pau Monne wrote:
> > > On 15/11/12 09:38, ANNIE LI wrote:
> > > > =

> > > > =

> > > > On 2012-11-15 15:40, Pasi K=E4rkk=E4inen wrote:
> > > >> Hello,
> > > >>
> > > >> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
> > > >>> This patch implements persistent grants for xen-netfront/netback.=
 This
> > > >>> mechanism maintains page pools in netback/netfront, these page po=
ols is used to
> > > >>> save grant pages which are mapped. This way improve performance w=
hich is wasted
> > > >>> when doing grant operations.
> > > >>>
> > > >>> Current netback/netfront does map/unmap grant operations frequent=
ly when
> > > >>> transmitting/receiving packets, and grant operations costs much c=
pu clock. In
> > > >>> this patch, netfront/netback maps grant pages when needed and the=
n saves them
> > > >>> into a page pool for future use. All these pages will be unmapped=
 when
> > > >>> removing/releasing the net device.
> > > >>>
> > > >> Do you have performance numbers available already? with/without pe=
rsistent grants?
> > > > I have some simple netperf/netserver test result with/without persi=
stent =

> > > > grants,
> > > > =

> > > > Following is result of with persistent grant patch,
> > > > =

> > > > Guests, Sum,      Avg,     Min,     Max
> > > >   1,  15106.4,  15106.4, 15106.36, 15106.36
> > > >   2,  13052.7,  6526.34,  6261.81,  6790.86
> > > >   3,  12675.1,  6337.53,  6220.24,  6454.83
> > > >   4,  13194,  6596.98,  6274.70,  6919.25
> > > > =

> > > > =

> > > > Following are result of without persistent patch
> > > > =

> > > > Guests, Sum,     Avg,    Min,        Max
> > > >   1,  10864.1,  10864.1, 10864.10, 10864.10
> > > >   2,  10898.5,  5449.24,  4862.08,  6036.40
> > > >   3,  10734.5,  5367.26,  5261.43,  5473.08
> > > >   4,  10924,    5461.99,  5314.84,  5609.14
> > > =

> > > In the block case, performance improvement is seen when using a large
> > > number of guests, could you perform the same benchmark increasing the
> > > number of guests to 15?
> > =

> > It would also be nice to see some analysis of the numbers which justify
> > why this change is a good one without every reviewer having to evaluate
> > the raw data themselves. In fact this should really be part of the
> > commit message.
> =

> You mean like a nice graph, eh?

Together with an analysis of what it means and why it is a good thing,
yes.

Ian.

> =

> I will run these patches on my 32GB box and see if I can give you
> a nice PDF/jpg.
> =

> > =

> > Ian.
> > =




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 19:16:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 19:16:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ4uy-0004jX-VT; Thu, 15 Nov 2012 19:16:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TZ4uy-0004jS-01
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 19:16:04 +0000
Received: from [85.158.137.99:16490] by server-2.bemta-3.messagelabs.com id
	84/3E-04744-37F35A05; Thu, 15 Nov 2012 19:16:03 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353006960!14154662!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10297 invoked from network); 15 Nov 2012 19:16:02 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-6.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 19:16:02 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFJFsOB012237
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 19:15:55 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFJFsdf000373
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 19:15:54 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFJFrTU029966; Thu, 15 Nov 2012 13:15:53 -0600
MIME-Version: 1.0
Message-ID: <ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
Date: Thu, 15 Nov 2012 11:15:49 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352982337.3499.119.camel@zakaz.uk.xensource.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, "Tim
	\(Xen.org\)" <tim@xen.org>, xen-devel@lists.xen.org,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> 
> On Wed, 2012-11-14 at 23:55 +0000, Dan Magenheimer wrote:
> >
> > Note 1: Tim: I'm thinking this may resolve your concern that
> > the claim mechanism must be more complicated to handle
> > restricted memory allocations and order>0 allocations.
> > The proposed claim mechanism only guarantees a quantity of
> > order==0 pages; if restricted allocations are required, these
> > are done first by the toolstack, and followed by the claim.
> > Order>0 allocations still work if memory is not fragmented,
> > but the claim mechanism doesn't guarantee anything but
> > a quantity of order==0 pages.
> 
> How does this interact with the feature which lets you create PV guests
> using only superpages? I believe is something Oracle added and still
> maintains (Dave added to the CC).
> 
> Also doesn't this fail to make any sort of guarantee if you are building
> a 32 bit PV guest, since they require memory under a certain host
> address limit (160GB IIRC)?
> 
> Basically neither of those cases benefit from this hypercall at all? I
> don't know what the usecase for the superpage PV guests is (but I
> suppose it is important to Oracle, at least). The 32 bit PV guest use
> case is still a pretty significant one which I think ought to be
> handled, otherwise any system built on top of this functionality will
> only work reliably in a subset of cases.

The claim mechanism will not benefit PV superpages.  IIUC, the
design of the PV superpages will cause a domain launch to fail
if it requests 10000 superpages but Xen can only successfully
allocate 9999.  That's already very fragile.  Since the only
way currently to find out if there are 10000 superpages available
is to start allocating them, claim can't really help.

For 32 bit PV guests, note that a claim does NOT have to be
staked prior to any allocation.  So if a toolstack needs
to enforce that some portion of allocated memory is under
a host address limit, it can (attempt to) allocate those pages,
then stake a claim for the rest.  Or just not use the claim
mechanism at all.

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 19:16:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 19:16:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ4uy-0004jX-VT; Thu, 15 Nov 2012 19:16:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TZ4uy-0004jS-01
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 19:16:04 +0000
Received: from [85.158.137.99:16490] by server-2.bemta-3.messagelabs.com id
	84/3E-04744-37F35A05; Thu, 15 Nov 2012 19:16:03 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353006960!14154662!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10297 invoked from network); 15 Nov 2012 19:16:02 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-6.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 19:16:02 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFJFsOB012237
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 19:15:55 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFJFsdf000373
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 19:15:54 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFJFrTU029966; Thu, 15 Nov 2012 13:15:53 -0600
MIME-Version: 1.0
Message-ID: <ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
Date: Thu, 15 Nov 2012 11:15:49 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352982337.3499.119.camel@zakaz.uk.xensource.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, "Tim
	\(Xen.org\)" <tim@xen.org>, xen-devel@lists.xen.org,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> 
> On Wed, 2012-11-14 at 23:55 +0000, Dan Magenheimer wrote:
> >
> > Note 1: Tim: I'm thinking this may resolve your concern that
> > the claim mechanism must be more complicated to handle
> > restricted memory allocations and order>0 allocations.
> > The proposed claim mechanism only guarantees a quantity of
> > order==0 pages; if restricted allocations are required, these
> > are done first by the toolstack, and followed by the claim.
> > Order>0 allocations still work if memory is not fragmented,
> > but the claim mechanism doesn't guarantee anything but
> > a quantity of order==0 pages.
> 
> How does this interact with the feature which lets you create PV guests
> using only superpages? I believe is something Oracle added and still
> maintains (Dave added to the CC).
> 
> Also doesn't this fail to make any sort of guarantee if you are building
> a 32 bit PV guest, since they require memory under a certain host
> address limit (160GB IIRC)?
> 
> Basically neither of those cases benefit from this hypercall at all? I
> don't know what the usecase for the superpage PV guests is (but I
> suppose it is important to Oracle, at least). The 32 bit PV guest use
> case is still a pretty significant one which I think ought to be
> handled, otherwise any system built on top of this functionality will
> only work reliably in a subset of cases.

The claim mechanism will not benefit PV superpages.  IIUC, the
design of the PV superpages will cause a domain launch to fail
if it requests 10000 superpages but Xen can only successfully
allocate 9999.  That's already very fragile.  Since the only
way currently to find out if there are 10000 superpages available
is to start allocating them, claim can't really help.

For 32 bit PV guests, note that a claim does NOT have to be
staked prior to any allocation.  So if a toolstack needs
to enforce that some portion of allocated memory is under
a host address limit, it can (attempt to) allocate those pages,
then stake a claim for the rest.  Or just not use the claim
mechanism at all.

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 19:20:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 19:20:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ4yw-0004zE-Ay; Thu, 15 Nov 2012 19:20:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TZ4yv-0004z7-2K
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 19:20:09 +0000
Received: from [85.158.137.99:41837] by server-13.bemta-3.messagelabs.com id
	64/A2-24887-86045A05; Thu, 15 Nov 2012 19:20:08 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1353007205!19294932!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24569 invoked from network); 15 Nov 2012 19:20:07 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-13.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 19:20:07 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFJK2Ze016308
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 19:20:03 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFJK2IZ007243
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 19:20:02 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFJK2iu000391; Thu, 15 Nov 2012 13:20:02 -0600
MIME-Version: 1.0
Message-ID: <ca76650f-4fd3-4a74-bd09-563784c84dcb@default>
Date: Thu, 15 Nov 2012 11:19:57 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Ian Campbell <Ian.Campbell@citrix.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<50A4F07F02000078000A8DBD@nat28.tlf.novell.com>
In-Reply-To: <50A4F07F02000078000A8DBD@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: xen-devel@lists.xen.org, "Keir \(Xen.org\)" <keir@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>, "Tim\(Xen.org\)" <tim@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Thursday, November 15, 2012 5:39 AM
> To: Ian Campbell; Dan Magenheimer
> Cc: xen-devel@lists.xen.org; Dave McCracken; KonradWilk; Zhigang Wang; Keir (Xen.org); Tim(Xen.org)
> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> 
> >>> On 15.11.12 at 13:25, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > Also doesn't this fail to make any sort of guarantee if you are building
> > a 32 bit PV guest, since they require memory under a certain host
> > address limit (160GB IIRC)?
> 
> This case is unreliable already, and has always been (I think we
> have a tools side hack in some of our trees in an attempt to deal
> with that), when ballooning is used to get at the memory, or
> when trying to start a 32-bit guest after having run 64-bit ones
> exhausting most of memory, and having terminated an early
> created one (as allocation is top down, ones created close to
> exhaustion, i.e. later, would eat up that "special" memory at
> lower addresses).
> 
> So this new functionality "only" makes a bad situation worse
> (which isn't meant to say I wouldn't prefer to see it get fixed).

Hmmm... I guess I don't see how claim makes the situation worse.
Well maybe a few microseconds worse.

Old model:
(1) Allocate a huge number of pages

New model:
(1) Claim a huge number of pages.  If successful...
(2) Allocate that huge number of pages

In either case, the failure conditions are the same
except that the claim mechanism checks one of the
failure conditions sooner.

Or am I misunderstanding?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 19:20:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 19:20:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ4yw-0004zE-Ay; Thu, 15 Nov 2012 19:20:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TZ4yv-0004z7-2K
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 19:20:09 +0000
Received: from [85.158.137.99:41837] by server-13.bemta-3.messagelabs.com id
	64/A2-24887-86045A05; Thu, 15 Nov 2012 19:20:08 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1353007205!19294932!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24569 invoked from network); 15 Nov 2012 19:20:07 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-13.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 19:20:07 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFJK2Ze016308
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 19:20:03 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFJK2IZ007243
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 19:20:02 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFJK2iu000391; Thu, 15 Nov 2012 13:20:02 -0600
MIME-Version: 1.0
Message-ID: <ca76650f-4fd3-4a74-bd09-563784c84dcb@default>
Date: Thu, 15 Nov 2012 11:19:57 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Ian Campbell <Ian.Campbell@citrix.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<50A4F07F02000078000A8DBD@nat28.tlf.novell.com>
In-Reply-To: <50A4F07F02000078000A8DBD@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: xen-devel@lists.xen.org, "Keir \(Xen.org\)" <keir@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>, "Tim\(Xen.org\)" <tim@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Thursday, November 15, 2012 5:39 AM
> To: Ian Campbell; Dan Magenheimer
> Cc: xen-devel@lists.xen.org; Dave McCracken; KonradWilk; Zhigang Wang; Keir (Xen.org); Tim(Xen.org)
> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> 
> >>> On 15.11.12 at 13:25, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > Also doesn't this fail to make any sort of guarantee if you are building
> > a 32 bit PV guest, since they require memory under a certain host
> > address limit (160GB IIRC)?
> 
> This case is unreliable already, and has always been (I think we
> have a tools side hack in some of our trees in an attempt to deal
> with that), when ballooning is used to get at the memory, or
> when trying to start a 32-bit guest after having run 64-bit ones
> exhausting most of memory, and having terminated an early
> created one (as allocation is top down, ones created close to
> exhaustion, i.e. later, would eat up that "special" memory at
> lower addresses).
> 
> So this new functionality "only" makes a bad situation worse
> (which isn't meant to say I wouldn't prefer to see it get fixed).

Hmmm... I guess I don't see how claim makes the situation worse.
Well maybe a few microseconds worse.

Old model:
(1) Allocate a huge number of pages

New model:
(1) Claim a huge number of pages.  If successful...
(2) Allocate that huge number of pages

In either case, the failure conditions are the same
except that the claim mechanism checks one of the
failure conditions sooner.

Or am I misunderstanding?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 19:36:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 19:36:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ5EQ-0005dL-Sc; Thu, 15 Nov 2012 19:36:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TZ5EO-0005dC-UY
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 19:36:09 +0000
Received: from [85.158.143.35:54537] by server-1.bemta-4.messagelabs.com id
	42/88-27934-82445A05; Thu, 15 Nov 2012 19:36:08 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1353008166!11697229!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5940 invoked from network); 15 Nov 2012 19:36:07 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 19:36:07 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFJa24Q032011
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 19:36:04 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFJa2aZ003502
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 19:36:02 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFJa1iV009727; Thu, 15 Nov 2012 13:36:02 -0600
MIME-Version: 1.0
Message-ID: <05bc8ee3-31e3-451e-ad6c-c6912b31f8e7@default>
Date: Thu, 15 Nov 2012 11:35:57 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Andres Lagar-Cavilla <andreslc@gridcentric.ca>, xen-devel@lists.xen.org
References: <mailman.16651.1353004500.1399.xen-devel@lists.xen.org>
	<99DE5B0D-391E-4845-B9CE-46319825CCD6@gridcentric.ca>
In-Reply-To: <99DE5B0D-391E-4845-B9CE-46319825CCD6@gridcentric.ca>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Zhigang Wang <zhigang.x.wang@oracle.com>,
	Tim Deegan <tim@xen.org>, Jan Beulich <JBeulich@suse.com>,
	Konrad Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop
	of	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Andres Lagar-Cavilla [mailto:andreslc@gridcentric.ca]
> Subject: Re: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> 
> > Ideally, allocation in the presence of existing claims should
> > behave as if the claiming domains had actually already allocated
> > the unclaimed-amount-of-memory.  So I'd argue that enforcing
> > the claim should be sacrosanct here.
> 
> Well, are we sure that failing an "anonymous" allocations is not going to trigger a BUG_ON? That's a
> lot of code review. If you get this wrong, now Xen suddenly crashes if allocating domains close to the
> max. It doesn't, today, afaict.

I'm not sure I understand your concern.  What I said is
that the behavior is the same whether the memory is
allocated for a domain (the pre-claim way) or claimed
and then allocated later.  Claim is neither improving
a low-memory situation or making it worse.  If Xen
crashes when a claim has been staked (but not yet
satisfied), it would crash the same if the memory
had already been fully allocated.

> >> Similarly, but perhaps of lower priority, there is no integration
> >> with the low-mem handling.
> >
> > I'd also consider this lower priority as Olaf and Andre
> > have argued that the claim mechanism is not needed for
> > sharing/paging so the two mechanisms may not
> > be used together, at least for the foreseeable future.
> > So I plan to skip this, unless you change your mind and
> > consider it a showstopper for acceptance.
> 
> This is a slippery slope. Let's not work out the interactions with existing subsystems before adding
> code to the tree. What could go wrong?

Indeed.

> As a data point for everyone, I've found the low men virq extremely useful as a sync interrupt
> signaling to our toolstack that it needs to get its act together and start rebalancing memory, if it
> hasn't yet. I don't see how that cannot be useful to any other toolstack.

Um... very different toolstack paradigm.

Besides (can't resist), in your toolstack, the toolstack is
omniscient about all hypervisor memory allocations, so why
would it _need_ to be notified? ;-) ;-) ;-) ;-) /me ducks

Dan "who holds out single daisy to Andre, previously withdrawn from George
in http://lists.xen.org/archives/html/xen-devel/2012-11/msg00150.html"

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 19:36:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 19:36:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ5EQ-0005dL-Sc; Thu, 15 Nov 2012 19:36:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TZ5EO-0005dC-UY
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 19:36:09 +0000
Received: from [85.158.143.35:54537] by server-1.bemta-4.messagelabs.com id
	42/88-27934-82445A05; Thu, 15 Nov 2012 19:36:08 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1353008166!11697229!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5940 invoked from network); 15 Nov 2012 19:36:07 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 19:36:07 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFJa24Q032011
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 19:36:04 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFJa2aZ003502
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 19:36:02 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFJa1iV009727; Thu, 15 Nov 2012 13:36:02 -0600
MIME-Version: 1.0
Message-ID: <05bc8ee3-31e3-451e-ad6c-c6912b31f8e7@default>
Date: Thu, 15 Nov 2012 11:35:57 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Andres Lagar-Cavilla <andreslc@gridcentric.ca>, xen-devel@lists.xen.org
References: <mailman.16651.1353004500.1399.xen-devel@lists.xen.org>
	<99DE5B0D-391E-4845-B9CE-46319825CCD6@gridcentric.ca>
In-Reply-To: <99DE5B0D-391E-4845-B9CE-46319825CCD6@gridcentric.ca>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Zhigang Wang <zhigang.x.wang@oracle.com>,
	Tim Deegan <tim@xen.org>, Jan Beulich <JBeulich@suse.com>,
	Konrad Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop
	of	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Andres Lagar-Cavilla [mailto:andreslc@gridcentric.ca]
> Subject: Re: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> 
> > Ideally, allocation in the presence of existing claims should
> > behave as if the claiming domains had actually already allocated
> > the unclaimed-amount-of-memory.  So I'd argue that enforcing
> > the claim should be sacrosanct here.
> 
> Well, are we sure that failing an "anonymous" allocations is not going to trigger a BUG_ON? That's a
> lot of code review. If you get this wrong, now Xen suddenly crashes if allocating domains close to the
> max. It doesn't, today, afaict.

I'm not sure I understand your concern.  What I said is
that the behavior is the same whether the memory is
allocated for a domain (the pre-claim way) or claimed
and then allocated later.  Claim is neither improving
a low-memory situation or making it worse.  If Xen
crashes when a claim has been staked (but not yet
satisfied), it would crash the same if the memory
had already been fully allocated.

> >> Similarly, but perhaps of lower priority, there is no integration
> >> with the low-mem handling.
> >
> > I'd also consider this lower priority as Olaf and Andre
> > have argued that the claim mechanism is not needed for
> > sharing/paging so the two mechanisms may not
> > be used together, at least for the foreseeable future.
> > So I plan to skip this, unless you change your mind and
> > consider it a showstopper for acceptance.
> 
> This is a slippery slope. Let's not work out the interactions with existing subsystems before adding
> code to the tree. What could go wrong?

Indeed.

> As a data point for everyone, I've found the low men virq extremely useful as a sync interrupt
> signaling to our toolstack that it needs to get its act together and start rebalancing memory, if it
> hasn't yet. I don't see how that cannot be useful to any other toolstack.

Um... very different toolstack paradigm.

Besides (can't resist), in your toolstack, the toolstack is
omniscient about all hypervisor memory allocations, so why
would it _need_ to be notified? ;-) ;-) ;-) ;-) /me ducks

Dan "who holds out single daisy to Andre, previously withdrawn from George
in http://lists.xen.org/archives/html/xen-devel/2012-11/msg00150.html"

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 19:59:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 19:59:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ5aG-00064H-Uf; Thu, 15 Nov 2012 19:58:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TZ5aE-00064C-Ka
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 19:58:43 +0000
Received: from [85.158.137.99:44296] by server-1.bemta-3.messagelabs.com id
	68/D5-12169-17945A05; Thu, 15 Nov 2012 19:58:41 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1353009517!14222835!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM4MzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9903 invoked from network); 15 Nov 2012 19:58:40 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-3.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 19:58:40 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208,217";a="44765891"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 19:58:24 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 14:58:24 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TZ5Zv-0005wP-DG;
	Thu, 15 Nov 2012 19:58:23 +0000
Message-ID: <50A54815.9010402@eu.citrix.com>
Date: Thu, 15 Nov 2012 19:52:53 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Michael Palmeter <michael.palmeter@oracle.com>
References: <c58a9d3a-99e4-42ac-86c9-fbec600dee14@default>
	<50A53479.5050901@eu.citrix.com>
	<27449f60-0433-4e5f-b1fb-06914b84c6f1@default>
In-Reply-To: <27449f60-0433-4e5f-b1fb-06914b84c6f1@default>
Cc: Ashok Aletty <ashok.aletty@oracle.com>, Dario Faggioli <raistlin@linux.it>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen credit scheduler question
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5647842968013421696=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5647842968013421696==
Content-Type: multipart/alternative;
	boundary="------------090604080201040700060707"

--------------090604080201040700060707
Content-Type: text/plain; charset="windows-1252"; format=flowed
Content-Transfer-Encoding: 8bit

On 15/11/12 19:03, Michael Palmeter wrote:
>
> Thank you for your answer, George.
>
> The origin of my question is more of a business concern than a 
> technical one.  Many software products are licensed based on a cost 
> per processor core.  It is desirable to sometimes allow customers to 
> pay a fraction of software license costs in exchange for running that 
> software using only a commensurate fraction of available compute power 
> (capacity sub-licensing).  If the cap is a means of making a vCPU 
> more-or-less deterministic (in terms of its effective computational 
> capacity) then that would be useful as a programmatic means of 
> enabling capacity sub-licensing.  My example below was based on a case 
> where I have a customer that would like to use ‘cap’ to constrain 
> their single vCPU VM to only ½ of a core worth of compute capacity 
> (logically 1/32 of the compute power) in exchange for only paying 1/32 
> of the license cost for the physical server.
>

Right -- I've seen the "limit cpu power for licensing purposes" thing 
before, but I think that only went down to cores, not sub-core.

> Below you answered:
>
> “You can use ‘cap’ to make the VM in question get 50% of logical vcpu 
> time, which on an idle system will give it 0.5 of the capacity of a 
> physical core (if we don't consider Intel's Turbo Boost technology).  
> But if the system becomes busy, it will get less than 0.5 of the 
> processing capacity of a physical core.”
>
> Are you saying that cap would be able to CONSTRAIN a vCPU to an 
> effective compute capacity equal to 50% of a physical core, but it 
> does not GUARANTEE effective compute capacity equal to 50% of a 
> physical core?
>

Theoretically, a cap at 50 will give your single-vcpu VM 50% of the time 
of one hyperthread.

So if C is "typicall throughput of a single non-hyperthreaded core 
running at standard requency", and we factor out Turbo Boost, then there 
are two cases to consider:

* Other thread is idle.  In that case, the VM will get 0.5C.
* The other thread is busy.  In this case, assuming a 0.7 factor, the VM 
will get 0.5 * (0.7 * C), or about 0.35C

So the total computing power available to the VM should be <= 0.5C 
(satisfying the licensing requirements), but on a busy system it may be 
significantly less than 0.5C (perhaps not so satisfying to the owner of 
the VM).

I don't think it should be terribly difficult to put a simple "shared 
hyperthread" multiplier on the credit burned -- if someone at Oracle 
wanted to help implement this, we'd be happy to point you in the right 
direction. :-)

If you have Turbo Boost, then (as I understand it) the CPU can raise the 
clock speed of the processor when threads or cores are idle; the 
wikipedia article seems to think some processors can increase the clock 
speed up to 1.6x over the baseline frequency.  That would throw a bit of 
a wrench in the works, as you might end up with 0.5 * 1.6 * C = 0.8 C > 
0.5 C; however, looking at Intel's website, it looks like only 2- and 
4-core processors have TurboBoost, so maybe on 8-core processors we can 
punt on that thorny issue for a little while yet. :-)

> Can you offer any guidance regarding real-world scheduler overhead 
> (when cap>0 is used) and precision (how variable is actual compute 
> power for a vCPU with a cap of 100%, for example)?
>

I have not done extensive testing with the cap; I mainly know the 
mechanism by which it works.  There is no extra accounting done in the 
scheduler for having a cap: all vcpus are assigned credit every 30ms 
according to their weight and cap.  The difference is that if a 
non-capped vcpu uses up its credits, it is allowed to go negative; 
whereas a capped vcpu will be paused until it receives more credits.  So 
there should be no extra hypervisor overhead from using a cap.

The cap fundamentally works by locking out a vcpu for very small amounts 
of time within the 30ms accounting window.  But this same effect might 
happen just by having other VMs competing for the cpu; so in theory 
shouldn't be any riskier than virtualizing in the first place.

Executive summary: Factoring out Turbo Boost, "cap" should be able to 
set a sub-core upper-bound on processing power.  But on a busy system, 
it may result in the VM getting less than its upper-bound in processing 
power.

However, scheduling is a very complex and dynamic system, and like 
economics, very simple changes can have unpredictable results.  So it's 
probably a good idea to do some testing before recommending it to 
customers. :-)

BTW, are you familiar with Xen's cpupool functionality?  The guys at 
Fujitsu wrote it so that a customer could rent a fixed number of cores 
to a customer, who could then run as many VMs on those cores as they 
wanted.  I think licensing restrictions had something to do with that as 
well.  More about that here, if you're interested:
  http://blog.xen.org/index.php/2012/04/23/xen-4-2-cpupools/

  -George

--------------090604080201040700060707
Content-Type: text/html; charset="windows-1252"
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 15/11/12 19:03, Michael Palmeter
      wrote:<br>
    </div>
    <blockquote cite="mid:27449f60-0433-4e5f-b1fb-06914b84c6f1@default"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 12 (filtered
        medium)">
      <!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
      <style><!--
/* Font Definitions */
@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:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
	{font-family:Verdana;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	color:black;}
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;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{mso-style-priority:99;
	mso-style-link:"Balloon Text Char";
	margin:0in;
	margin-bottom:.0001pt;
	font-size:8.0pt;
	font-family:"Tahoma","sans-serif";
	color:black;}
span.BalloonTextChar
	{mso-style-name:"Balloon Text Char";
	mso-style-priority:99;
	mso-style-link:"Balloon Text";
	font-family:"Tahoma","sans-serif";}
span.EmailStyle19
	{mso-style-type:personal;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
span.EmailStyle20
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
/* List Definitions */
@list l0
	{mso-list-id:599684598;
	mso-list-type:hybrid;
	mso-list-template-ids:1243763380 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Symbol;}
@list l0:level2
	{mso-level-tab-stop:1.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level3
	{mso-level-tab-stop:1.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level4
	{mso-level-tab-stop:2.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level5
	{mso-level-tab-stop:2.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level6
	{mso-level-tab-stop:3.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level7
	{mso-level-tab-stop:3.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level8
	{mso-level-tab-stop:4.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level9
	{mso-level-tab-stop:4.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l1
	{mso-list-id:1244485665;
	mso-list-template-ids:2139918180;}
@list l1:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="2050" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D">Thank you for
            your answer, George.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">The origin of
            my question is more of a business concern than a technical
            one.  Many software products are licensed based on a cost
            per processor core.  It is desirable to sometimes allow
            customers to pay a fraction of software license costs in
            exchange for running that software using only a commensurate
            fraction of available compute power (capacity
            sub-licensing).  If the cap is a means of making a vCPU
            more-or-less deterministic (in terms of its effective
            computational capacity) then that would be useful as a
            programmatic means of enabling capacity sub-licensing.  My
            example below was based on a case where I have a customer
            that would like to use ‘cap’ to constrain their single vCPU
            VM to only ½ of a core worth of compute capacity (logically
            1/32 of the compute power) in exchange for only paying 1/32
            of the license cost for the physical server.</span></p>
      </div>
    </blockquote>
    <br>
    Right -- I've seen the "limit cpu power for licensing purposes"
    thing before, but I think that only went down to cores, not
    sub-core.<br>
    <br>
    <blockquote cite="mid:27449f60-0433-4e5f-b1fb-06914b84c6f1@default"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D"><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Below you
            answered:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">“You can use
            ‘cap’ to make the VM in question get 50% of logical vcpu
            time, which on an idle system will give it 0.5 of the
            capacity of a physical core (if we don't consider Intel's
            Turbo Boost technology).  But if the system becomes busy, it
            will get less than 0.5 of the processing capacity of a
            physical core.”<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Are you saying
            that cap would be able to CONSTRAIN a vCPU to an effective
            compute capacity equal to 50% of a physical core, but it
            does not GUARANTEE effective compute capacity equal to 50%
            of a physical core? </span></p>
      </div>
    </blockquote>
    <br>
    Theoretically, a cap at 50 will give your single-vcpu VM 50% of the
    time of one hyperthread.<br>
    <br>
    So if C is "typicall throughput of a single non-hyperthreaded core
    running at standard requency", and we factor out Turbo Boost, then
    there are two cases to consider:<br>
    <br>
    * Other thread is idle.  In that case, the VM will get 0.5C.<br>
    * The other thread is busy.  In this case, assuming a 0.7 factor,
    the VM will get 0.5 * (0.7 * C), or about 0.35C<br>
    <br>
    So the total computing power available to the VM should be &lt;=
    0.5C (satisfying the licensing requirements), but on a busy system
    it may be significantly less than 0.5C (perhaps not so satisfying to
    the owner of the VM).<br>
    <br>
    I don't think it should be terribly difficult to put a simple
    "shared hyperthread" multiplier on the credit burned -- if someone
    at Oracle wanted to help implement this, we'd be happy to point you
    in the right direction. :-)<br>
    <br>
    If you have Turbo Boost, then (as I understand it) the CPU can raise
    the clock speed of the processor when threads or cores are idle; the
    wikipedia article seems to think some processors can increase the
    clock speed up to 1.6x over the baseline frequency.  That would
    throw a bit of a wrench in the works, as you might end up with 0.5 *
    1.6 * C = 0.8 C &gt; 0.5 C; however, looking at Intel's website, it
    looks like only 2- and 4-core processors have TurboBoost, so maybe
    on 8-core processors we can punt on that thorny issue for a little
    while yet. :-)<br>
    <br>
    <blockquote cite="mid:27449f60-0433-4e5f-b1fb-06914b84c6f1@default"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D"><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p></o:p>Can
            you offer any guidance regarding real-world scheduler
            overhead (when cap&gt;0 is used) and precision (how variable
            is actual compute power for a vCPU with a cap of 100%, for
            example)?</span></p>
      </div>
    </blockquote>
    <br>
    I have not done extensive testing with the cap; I mainly know the
    mechanism by which it works.  There is no extra accounting done in
    the scheduler for having a cap: all vcpus are assigned credit every
    30ms according to their weight and cap.  The difference is that if a
    non-capped vcpu uses up its credits, it is allowed to go negative;
    whereas a capped vcpu will be paused until it receives more
    credits.  So there should be no extra hypervisor overhead from using
    a cap.<br>
    <br>
    The cap fundamentally works by locking out a vcpu for very small
    amounts of time within the 30ms accounting window.  But this same
    effect might happen just by having other VMs competing for the cpu;
    so in theory shouldn't be any riskier than virtualizing in the first
    place.<br>
    <br>
    Executive summary: Factoring out Turbo Boost, "cap" should be able
    to set a sub-core upper-bound on processing power.  But on a busy
    system, it may result in the VM getting less than its upper-bound in
    processing power.<br>
    <br>
    However, scheduling is a very complex and dynamic system, and like
    economics, very simple changes can have unpredictable results.  So
    it's probably a good idea to do some testing before recommending it
    to customers. :-)<br>
    <br>
    BTW, are you familiar with Xen's cpupool functionality?  The guys at
    Fujitsu wrote it so that a customer could rent a fixed number of
    cores to a customer, who could then run as many VMs on those cores
    as they wanted.  I think licensing restrictions had something to do
    with that as well.  More about that here, if you're interested:<br>
     <a class="moz-txt-link-freetext" href="http://blog.xen.org/index.php/2012/04/23/xen-4-2-cpupools/">http://blog.xen.org/index.php/2012/04/23/xen-4-2-cpupools/</a><br>
    <br>
     -George<br>
  </body>
</html>

--------------090604080201040700060707--


--===============5647842968013421696==
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.xen.org
http://lists.xen.org/xen-devel

--===============5647842968013421696==--


From xen-devel-bounces@lists.xen.org Thu Nov 15 19:59:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 19:59:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ5aG-00064H-Uf; Thu, 15 Nov 2012 19:58:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TZ5aE-00064C-Ka
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 19:58:43 +0000
Received: from [85.158.137.99:44296] by server-1.bemta-3.messagelabs.com id
	68/D5-12169-17945A05; Thu, 15 Nov 2012 19:58:41 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1353009517!14222835!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODM4MzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9903 invoked from network); 15 Nov 2012 19:58:40 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-3.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 19:58:40 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208,217";a="44765891"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 19:58:24 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 15 Nov 2012 14:58:24 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TZ5Zv-0005wP-DG;
	Thu, 15 Nov 2012 19:58:23 +0000
Message-ID: <50A54815.9010402@eu.citrix.com>
Date: Thu, 15 Nov 2012 19:52:53 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Michael Palmeter <michael.palmeter@oracle.com>
References: <c58a9d3a-99e4-42ac-86c9-fbec600dee14@default>
	<50A53479.5050901@eu.citrix.com>
	<27449f60-0433-4e5f-b1fb-06914b84c6f1@default>
In-Reply-To: <27449f60-0433-4e5f-b1fb-06914b84c6f1@default>
Cc: Ashok Aletty <ashok.aletty@oracle.com>, Dario Faggioli <raistlin@linux.it>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen credit scheduler question
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5647842968013421696=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5647842968013421696==
Content-Type: multipart/alternative;
	boundary="------------090604080201040700060707"

--------------090604080201040700060707
Content-Type: text/plain; charset="windows-1252"; format=flowed
Content-Transfer-Encoding: 8bit

On 15/11/12 19:03, Michael Palmeter wrote:
>
> Thank you for your answer, George.
>
> The origin of my question is more of a business concern than a 
> technical one.  Many software products are licensed based on a cost 
> per processor core.  It is desirable to sometimes allow customers to 
> pay a fraction of software license costs in exchange for running that 
> software using only a commensurate fraction of available compute power 
> (capacity sub-licensing).  If the cap is a means of making a vCPU 
> more-or-less deterministic (in terms of its effective computational 
> capacity) then that would be useful as a programmatic means of 
> enabling capacity sub-licensing.  My example below was based on a case 
> where I have a customer that would like to use ‘cap’ to constrain 
> their single vCPU VM to only ½ of a core worth of compute capacity 
> (logically 1/32 of the compute power) in exchange for only paying 1/32 
> of the license cost for the physical server.
>

Right -- I've seen the "limit cpu power for licensing purposes" thing 
before, but I think that only went down to cores, not sub-core.

> Below you answered:
>
> “You can use ‘cap’ to make the VM in question get 50% of logical vcpu 
> time, which on an idle system will give it 0.5 of the capacity of a 
> physical core (if we don't consider Intel's Turbo Boost technology).  
> But if the system becomes busy, it will get less than 0.5 of the 
> processing capacity of a physical core.”
>
> Are you saying that cap would be able to CONSTRAIN a vCPU to an 
> effective compute capacity equal to 50% of a physical core, but it 
> does not GUARANTEE effective compute capacity equal to 50% of a 
> physical core?
>

Theoretically, a cap at 50 will give your single-vcpu VM 50% of the time 
of one hyperthread.

So if C is "typicall throughput of a single non-hyperthreaded core 
running at standard requency", and we factor out Turbo Boost, then there 
are two cases to consider:

* Other thread is idle.  In that case, the VM will get 0.5C.
* The other thread is busy.  In this case, assuming a 0.7 factor, the VM 
will get 0.5 * (0.7 * C), or about 0.35C

So the total computing power available to the VM should be <= 0.5C 
(satisfying the licensing requirements), but on a busy system it may be 
significantly less than 0.5C (perhaps not so satisfying to the owner of 
the VM).

I don't think it should be terribly difficult to put a simple "shared 
hyperthread" multiplier on the credit burned -- if someone at Oracle 
wanted to help implement this, we'd be happy to point you in the right 
direction. :-)

If you have Turbo Boost, then (as I understand it) the CPU can raise the 
clock speed of the processor when threads or cores are idle; the 
wikipedia article seems to think some processors can increase the clock 
speed up to 1.6x over the baseline frequency.  That would throw a bit of 
a wrench in the works, as you might end up with 0.5 * 1.6 * C = 0.8 C > 
0.5 C; however, looking at Intel's website, it looks like only 2- and 
4-core processors have TurboBoost, so maybe on 8-core processors we can 
punt on that thorny issue for a little while yet. :-)

> Can you offer any guidance regarding real-world scheduler overhead 
> (when cap>0 is used) and precision (how variable is actual compute 
> power for a vCPU with a cap of 100%, for example)?
>

I have not done extensive testing with the cap; I mainly know the 
mechanism by which it works.  There is no extra accounting done in the 
scheduler for having a cap: all vcpus are assigned credit every 30ms 
according to their weight and cap.  The difference is that if a 
non-capped vcpu uses up its credits, it is allowed to go negative; 
whereas a capped vcpu will be paused until it receives more credits.  So 
there should be no extra hypervisor overhead from using a cap.

The cap fundamentally works by locking out a vcpu for very small amounts 
of time within the 30ms accounting window.  But this same effect might 
happen just by having other VMs competing for the cpu; so in theory 
shouldn't be any riskier than virtualizing in the first place.

Executive summary: Factoring out Turbo Boost, "cap" should be able to 
set a sub-core upper-bound on processing power.  But on a busy system, 
it may result in the VM getting less than its upper-bound in processing 
power.

However, scheduling is a very complex and dynamic system, and like 
economics, very simple changes can have unpredictable results.  So it's 
probably a good idea to do some testing before recommending it to 
customers. :-)

BTW, are you familiar with Xen's cpupool functionality?  The guys at 
Fujitsu wrote it so that a customer could rent a fixed number of cores 
to a customer, who could then run as many VMs on those cores as they 
wanted.  I think licensing restrictions had something to do with that as 
well.  More about that here, if you're interested:
  http://blog.xen.org/index.php/2012/04/23/xen-4-2-cpupools/

  -George

--------------090604080201040700060707
Content-Type: text/html; charset="windows-1252"
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 15/11/12 19:03, Michael Palmeter
      wrote:<br>
    </div>
    <blockquote cite="mid:27449f60-0433-4e5f-b1fb-06914b84c6f1@default"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 12 (filtered
        medium)">
      <!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
      <style><!--
/* Font Definitions */
@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:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
	{font-family:Verdana;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	color:black;}
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;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{mso-style-priority:99;
	mso-style-link:"Balloon Text Char";
	margin:0in;
	margin-bottom:.0001pt;
	font-size:8.0pt;
	font-family:"Tahoma","sans-serif";
	color:black;}
span.BalloonTextChar
	{mso-style-name:"Balloon Text Char";
	mso-style-priority:99;
	mso-style-link:"Balloon Text";
	font-family:"Tahoma","sans-serif";}
span.EmailStyle19
	{mso-style-type:personal;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
span.EmailStyle20
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
/* List Definitions */
@list l0
	{mso-list-id:599684598;
	mso-list-type:hybrid;
	mso-list-template-ids:1243763380 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Symbol;}
@list l0:level2
	{mso-level-tab-stop:1.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level3
	{mso-level-tab-stop:1.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level4
	{mso-level-tab-stop:2.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level5
	{mso-level-tab-stop:2.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level6
	{mso-level-tab-stop:3.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level7
	{mso-level-tab-stop:3.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level8
	{mso-level-tab-stop:4.0in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level9
	{mso-level-tab-stop:4.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l1
	{mso-list-id:1244485665;
	mso-list-template-ids:2139918180;}
@list l1:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="2050" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D">Thank you for
            your answer, George.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">The origin of
            my question is more of a business concern than a technical
            one.  Many software products are licensed based on a cost
            per processor core.  It is desirable to sometimes allow
            customers to pay a fraction of software license costs in
            exchange for running that software using only a commensurate
            fraction of available compute power (capacity
            sub-licensing).  If the cap is a means of making a vCPU
            more-or-less deterministic (in terms of its effective
            computational capacity) then that would be useful as a
            programmatic means of enabling capacity sub-licensing.  My
            example below was based on a case where I have a customer
            that would like to use ‘cap’ to constrain their single vCPU
            VM to only ½ of a core worth of compute capacity (logically
            1/32 of the compute power) in exchange for only paying 1/32
            of the license cost for the physical server.</span></p>
      </div>
    </blockquote>
    <br>
    Right -- I've seen the "limit cpu power for licensing purposes"
    thing before, but I think that only went down to cores, not
    sub-core.<br>
    <br>
    <blockquote cite="mid:27449f60-0433-4e5f-b1fb-06914b84c6f1@default"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D"><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Below you
            answered:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">“You can use
            ‘cap’ to make the VM in question get 50% of logical vcpu
            time, which on an idle system will give it 0.5 of the
            capacity of a physical core (if we don't consider Intel's
            Turbo Boost technology).  But if the system becomes busy, it
            will get less than 0.5 of the processing capacity of a
            physical core.”<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Are you saying
            that cap would be able to CONSTRAIN a vCPU to an effective
            compute capacity equal to 50% of a physical core, but it
            does not GUARANTEE effective compute capacity equal to 50%
            of a physical core? </span></p>
      </div>
    </blockquote>
    <br>
    Theoretically, a cap at 50 will give your single-vcpu VM 50% of the
    time of one hyperthread.<br>
    <br>
    So if C is "typicall throughput of a single non-hyperthreaded core
    running at standard requency", and we factor out Turbo Boost, then
    there are two cases to consider:<br>
    <br>
    * Other thread is idle.  In that case, the VM will get 0.5C.<br>
    * The other thread is busy.  In this case, assuming a 0.7 factor,
    the VM will get 0.5 * (0.7 * C), or about 0.35C<br>
    <br>
    So the total computing power available to the VM should be &lt;=
    0.5C (satisfying the licensing requirements), but on a busy system
    it may be significantly less than 0.5C (perhaps not so satisfying to
    the owner of the VM).<br>
    <br>
    I don't think it should be terribly difficult to put a simple
    "shared hyperthread" multiplier on the credit burned -- if someone
    at Oracle wanted to help implement this, we'd be happy to point you
    in the right direction. :-)<br>
    <br>
    If you have Turbo Boost, then (as I understand it) the CPU can raise
    the clock speed of the processor when threads or cores are idle; the
    wikipedia article seems to think some processors can increase the
    clock speed up to 1.6x over the baseline frequency.  That would
    throw a bit of a wrench in the works, as you might end up with 0.5 *
    1.6 * C = 0.8 C &gt; 0.5 C; however, looking at Intel's website, it
    looks like only 2- and 4-core processors have TurboBoost, so maybe
    on 8-core processors we can punt on that thorny issue for a little
    while yet. :-)<br>
    <br>
    <blockquote cite="mid:27449f60-0433-4e5f-b1fb-06914b84c6f1@default"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D"><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p></o:p>Can
            you offer any guidance regarding real-world scheduler
            overhead (when cap&gt;0 is used) and precision (how variable
            is actual compute power for a vCPU with a cap of 100%, for
            example)?</span></p>
      </div>
    </blockquote>
    <br>
    I have not done extensive testing with the cap; I mainly know the
    mechanism by which it works.  There is no extra accounting done in
    the scheduler for having a cap: all vcpus are assigned credit every
    30ms according to their weight and cap.  The difference is that if a
    non-capped vcpu uses up its credits, it is allowed to go negative;
    whereas a capped vcpu will be paused until it receives more
    credits.  So there should be no extra hypervisor overhead from using
    a cap.<br>
    <br>
    The cap fundamentally works by locking out a vcpu for very small
    amounts of time within the 30ms accounting window.  But this same
    effect might happen just by having other VMs competing for the cpu;
    so in theory shouldn't be any riskier than virtualizing in the first
    place.<br>
    <br>
    Executive summary: Factoring out Turbo Boost, "cap" should be able
    to set a sub-core upper-bound on processing power.  But on a busy
    system, it may result in the VM getting less than its upper-bound in
    processing power.<br>
    <br>
    However, scheduling is a very complex and dynamic system, and like
    economics, very simple changes can have unpredictable results.  So
    it's probably a good idea to do some testing before recommending it
    to customers. :-)<br>
    <br>
    BTW, are you familiar with Xen's cpupool functionality?  The guys at
    Fujitsu wrote it so that a customer could rent a fixed number of
    cores to a customer, who could then run as many VMs on those cores
    as they wanted.  I think licensing restrictions had something to do
    with that as well.  More about that here, if you're interested:<br>
     <a class="moz-txt-link-freetext" href="http://blog.xen.org/index.php/2012/04/23/xen-4-2-cpupools/">http://blog.xen.org/index.php/2012/04/23/xen-4-2-cpupools/</a><br>
    <br>
     -George<br>
  </body>
</html>

--------------090604080201040700060707--


--===============5647842968013421696==
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.xen.org
http://lists.xen.org/xen-devel

--===============5647842968013421696==--


From xen-devel-bounces@lists.xen.org Thu Nov 15 21:04:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 21:04:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ6bk-0007gz-V9; Thu, 15 Nov 2012 21:04:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZ6bj-0007gu-2Q
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 21:04:19 +0000
Received: from [193.109.254.147:56894] by server-13.bemta-14.messagelabs.com
	id BC/FC-11239-2D855A05; Thu, 15 Nov 2012 21:04:18 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353013457!4125182!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10087 invoked from network); 15 Nov 2012 21:04:17 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 21:04:17 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208";a="15837821"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 21:04:16 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 21:04:16 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TZ6bg-0001Wk-91;
	Thu, 15 Nov 2012 21:04:16 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TZ6bf-0005FH-PK;
	Thu, 15 Nov 2012 21:04:16 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14401-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 15 Nov 2012 21:04:15 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14401: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14401 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14401/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14393
 test-amd64-amd64-xl-sedf     11 guest-localmigrate           fail   like 14393

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  9 guest-localmigrate         fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  003ac445eae6
baseline version:
 xen                  8ca6372315f8

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Dan Magenheimer <dan.magenheimer@oracle.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.2-testing
+ revision=003ac445eae6
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.2-testing 003ac445eae6
+ branch=xen-4.2-testing
+ revision=003ac445eae6
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.2-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.2-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
++ : daily-cron.xen-4.2-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.2-testing.git
+ info_linux_tree xen-4.2-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.2-testing.hg
+ hg push -r 003ac445eae6 ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 4 changesets with 5 changes to 5 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 21:04:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 21:04:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ6bk-0007gz-V9; Thu, 15 Nov 2012 21:04:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZ6bj-0007gu-2Q
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 21:04:19 +0000
Received: from [193.109.254.147:56894] by server-13.bemta-14.messagelabs.com
	id BC/FC-11239-2D855A05; Thu, 15 Nov 2012 21:04:18 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353013457!4125182!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg3MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10087 invoked from network); 15 Nov 2012 21:04:17 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 21:04:17 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208";a="15837821"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 21:04:16 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 21:04:16 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TZ6bg-0001Wk-91;
	Thu, 15 Nov 2012 21:04:16 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TZ6bf-0005FH-PK;
	Thu, 15 Nov 2012 21:04:16 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14401-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 15 Nov 2012 21:04:15 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14401: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14401 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14401/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14393
 test-amd64-amd64-xl-sedf     11 guest-localmigrate           fail   like 14393

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  9 guest-localmigrate         fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  003ac445eae6
baseline version:
 xen                  8ca6372315f8

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Dan Magenheimer <dan.magenheimer@oracle.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.2-testing
+ revision=003ac445eae6
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.2-testing 003ac445eae6
+ branch=xen-4.2-testing
+ revision=003ac445eae6
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.2-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.2-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
++ : daily-cron.xen-4.2-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.2-testing.git
+ info_linux_tree xen-4.2-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.2-testing.hg
+ hg push -r 003ac445eae6 ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 4 changesets with 5 changes to 5 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 21:08:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 21:08:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ6fW-0007ns-KV; Thu, 15 Nov 2012 21:08:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <michael.palmeter@oracle.com>) id 1TZ6fU-0007ni-JG
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 21:08:12 +0000
Received: from [85.158.143.35:21392] by server-2.bemta-4.messagelabs.com id
	C5/FA-28922-BB955A05; Thu, 15 Nov 2012 21:08:11 +0000
X-Env-Sender: michael.palmeter@oracle.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1353013682!14135888!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1921 invoked from network); 15 Nov 2012 21:08:03 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-15.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 21:08:03 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFL7ndn024270
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 21:07:50 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFL7mc9011706
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 21:07:49 GMT
Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFL7mIX009032; Thu, 15 Nov 2012 15:07:48 -0600
MIME-Version: 1.0
Message-ID: <f12127d1-c92e-4317-a3ea-bacf7bc42a7f@default>
Date: Thu, 15 Nov 2012 13:07:47 -0800 (PST)
From: Michael Palmeter <michael.palmeter@oracle.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
References: <c58a9d3a-99e4-42ac-86c9-fbec600dee14@default>
	<50A53479.5050901@eu.citrix.com>
	<27449f60-0433-4e5f-b1fb-06914b84c6f1@default>
	<50A54815.9010402@eu.citrix.com>
In-Reply-To: <50A54815.9010402@eu.citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__1353013668404174285abhmt114.oracle.com"
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: xen-devel@lists.xen.org, Dario Faggioli <raistlin@linux.it>,
	Ashok Aletty <ashok.aletty@oracle.com>
Subject: Re: [Xen-devel] Xen credit scheduler question
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__1353013668404174285abhmt114.oracle.com
Content-Type: multipart/alternative;
 boundary="__1353013668404174286abhmt114.oracle.com"

--__1353013668404174286abhmt114.oracle.com
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Thanks very much George.=A0 Very helpful indeed.

=A0

- Mike

HYPERLINK "http://www.oracle.com/" \nOracle
Michael Palmeter | Sr. Director of Product Management, Oracle Exalogic Elas=
tic Cloud
Phone: HYPERLINK "tel:+14153736497"+14153736497 | Mobile: HYPERLINK "tel:+1=
4156949573"+14156949573 | VOIP: HYPERLINK "tel:+14154027422"+14154027422=20
Oracle Exalogic Development
200 Oracle Parkway | Redwood Shores, California 94065=20

HYPERLINK "http://www.oracle.com/commitment" \nGreen Oracle

Oracle is committed to developing practices and products that help protect =
the environment

=A0

HYPERLINK "http://www.oracle.com/pls/ebn/swf_viewer.load?p_shows_id=3D12641=
667&p_referred=3D0&p_width=3D1000&p_height=3D675"Watch the Exalogic 5-minut=
e Demo at http://www.oracle.com/pls/ebn/swf_viewer.load?p_shows_id=3D126416=
67

=A0

From: George Dunlap [mailto:george.dunlap@eu.citrix.com]=20
Sent: November 15, 2012 11:53 AM
To: Michael Palmeter
Cc: Ashok Aletty; Dario Faggioli; xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Xen credit scheduler question

=A0

On 15/11/12 19:03, Michael Palmeter wrote:

Thank you for your answer, George.

=A0

The origin of my question is more of a business concern than a technical on=
e.=A0 Many software products are licensed based on a cost per processor cor=
e.=A0 It is desirable to sometimes allow customers to pay a fraction of sof=
tware license costs in exchange for running that software using only a comm=
ensurate fraction of available compute power (capacity sub-licensing).=A0 I=
f the cap is a means of making a vCPU more-or-less deterministic (in terms =
of its effective computational capacity) then that would be useful as a pro=
grammatic means of enabling capacity sub-licensing.=A0 My example below was=
 based on a case where I have a customer that would like to use 'cap' to co=
nstrain their single vCPU VM to only =BD of a core worth of compute capacit=
y (logically 1/32 of the compute power) in exchange for only paying 1/32 of=
 the license cost for the physical server.


Right -- I've seen the "limit cpu power for licensing purposes" thing befor=
e, but I think that only went down to cores, not sub-core.




=A0

Below you answered:

=A0

"You can use 'cap' to make the VM in question get 50% of logical vcpu time,=
 which on an idle system will give it 0.5 of the capacity of a physical cor=
e (if we don't consider Intel's Turbo Boost technology).=A0 But if the syst=
em becomes busy, it will get less than 0.5 of the processing capacity of a =
physical core."

=A0

Are you saying that cap would be able to CONSTRAIN a vCPU to an effective c=
ompute capacity equal to 50% of a physical core, but it does not GUARANTEE =
effective compute capacity equal to 50% of a physical core?=20


Theoretically, a cap at 50 will give your single-vcpu VM 50% of the time of=
 one hyperthread.

So if C is "typicall throughput of a single non-hyperthreaded core running =
at standard requency", and we factor out Turbo Boost, then there are two ca=
ses to consider:

* Other thread is idle.=A0 In that case, the VM will get 0.5C.
* The other thread is busy.=A0 In this case, assuming a 0.7 factor, the VM =
will get 0.5 * (0.7 * C), or about 0.35C

So the total computing power available to the VM should be <=3D 0.5C (satis=
fying the licensing requirements), but on a busy system it may be significa=
ntly less than 0.5C (perhaps not so satisfying to the owner of the VM).

I don't think it should be terribly difficult to put a simple "shared hyper=
thread" multiplier on the credit burned -- if someone at Oracle wanted to h=
elp implement this, we'd be happy to point you in the right direction. :-)

If you have Turbo Boost, then (as I understand it) the CPU can raise the cl=
ock speed of the processor when threads or cores are idle; the wikipedia ar=
ticle seems to think some processors can increase the clock speed up to 1.6=
x over the baseline frequency.=A0 That would throw a bit of a wrench in the=
 works, as you might end up with 0.5 * 1.6 * C =3D 0.8 C > 0.5 C; however, =
looking at Intel's website, it looks like only 2- and 4-core processors hav=
e TurboBoost, so maybe on 8-core processors we can punt on that thorny issu=
e for a little while yet. :-)




Can you offer any guidance regarding real-world scheduler overhead (when ca=
p>0 is used) and precision (how variable is actual compute power for a vCPU=
 with a cap of 100%, for example)?


I have not done extensive testing with the cap; I mainly know the mechanism=
 by which it works.=A0 There is no extra accounting done in the scheduler f=
or having a cap: all vcpus are assigned credit every 30ms according to thei=
r weight and cap.=A0 The difference is that if a non-capped vcpu uses up it=
s credits, it is allowed to go negative; whereas a capped vcpu will be paus=
ed until it receives more credits.=A0 So there should be no extra hyperviso=
r overhead from using a cap.

The cap fundamentally works by locking out a vcpu for very small amounts of=
 time within the 30ms accounting window.=A0 But this same effect might happ=
en just by having other VMs competing for the cpu; so in theory shouldn't b=
e any riskier than virtualizing in the first place.

Executive summary: Factoring out Turbo Boost, "cap" should be able to set a=
 sub-core upper-bound on processing power.=A0 But on a busy system, it may =
result in the VM getting less than its upper-bound in processing power.

However, scheduling is a very complex and dynamic system, and like economic=
s, very simple changes can have unpredictable results.=A0 So it's probably =
a good idea to do some testing before recommending it to customers. :-)

BTW, are you familiar with Xen's cpupool functionality?=A0 The guys at Fuji=
tsu wrote it so that a customer could rent a fixed number of cores to a cus=
tomer, who could then run as many VMs on those cores as they wanted.=A0 I t=
hink licensing restrictions had something to do with that as well.=A0 More =
about that here, if you're interested:
=A0http://blog.xen.org/index.php/2012/04/23/xen-4-2-cpupools/

=A0-George

--__1353013668404174286abhmt114.oracle.com
Content-Type: multipart/related;
 boundary="__1353013668404174287abhmt114.oracle.com"

--__1353013668404174287abhmt114.oracle.com
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Diso-8859-=
1">
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-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 name=3DGenerator content=3D"Microso=
ft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#defa=
ult#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
=09{font-family:"Cambria Math";
=09panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
=09{font-family:Calibri;
=09panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
=09{font-family:Tahoma;
=09panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
=09{font-family:Verdana;
=09panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
=09{margin:0in;
=09margin-bottom:.0001pt;
=09font-size:11.0pt;
=09font-family:"Calibri","sans-serif";
=09color:black;}
a:link, span.MsoHyperlink
=09{mso-style-priority:99;
=09color:blue;
=09text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
=09{mso-style-priority:99;
=09color:purple;
=09text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
=09{mso-style-priority:99;
=09mso-style-link:"Balloon Text Char";
=09margin:0in;
=09margin-bottom:.0001pt;
=09font-size:8.0pt;
=09font-family:"Tahoma","sans-serif";
=09color:black;}
span.BalloonTextChar
=09{mso-style-name:"Balloon Text Char";
=09mso-style-priority:99;
=09mso-style-link:"Balloon Text";
=09font-family:"Tahoma","sans-serif";}
span.EmailStyle19
=09{mso-style-type:personal;
=09font-family:"Calibri","sans-serif";
=09color:windowtext;}
span.EmailStyle20
=09{mso-style-type:personal;
=09font-family:"Calibri","sans-serif";
=09color:#1F497D;}
span.EmailStyle21
=09{mso-style-type:personal-reply;
=09font-family:"Calibri","sans-serif";
=09color:#1F497D;}
.MsoChpDefault
=09{mso-style-type:export-only;
=09font-size:10.0pt;}
@page WordSection1
=09{size:8.5in 11.0in;
=09margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
=09{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"2050" />
</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 bgcolor=3Dwhite lang=3DEN-US=
 link=3Dblue vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal>=
<span style=3D'color:#1F497D'>Thanks very much George.=A0 Very helpful inde=
ed.<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'color:#1F497D'=
><o:p>&nbsp;</o:p></span></p><div><p class=3DMsoNormal><span style=3D'color=
:#1F497D'>- Mike<o:p></o:p></span></p><p class=3DMsoNormal style=3D'mso-mar=
gin-top-alt:auto;mso-margin-bottom-alt:auto'><a href=3D"http://www.oracle.c=
om/" target=3D"_blank"><span style=3D'font-size:12.0pt;font-family:"Times N=
ew Roman","serif";color:black;text-decoration:none'><img border=3D0 width=
=3D114 height=3D26 id=3D"_x0000_i1026" src=3D"cid:image001.gif@01CDC332.348=
2A250" alt=3DOracle></span></a><span style=3D'font-size:12.0pt;font-family:=
"Times New Roman","serif";color:#1F497D'><br></span><span style=3D'font-siz=
e:10.0pt;font-family:"Verdana","sans-serif";color:#666666'>Michael Palmeter=
 | Sr. Director of Product Management, Oracle Exalogic Elastic Cloud<br>Pho=
ne: <a href=3D"tel:+14153736497"><span style=3D'color:black'>+14153736497</=
span></a> | Mobile: <a href=3D"tel:+14156949573"><span style=3D'color:black=
'>+14156949573</span></a> | VOIP: <a href=3D"tel:+14154027422"><span style=
=3D'color:black'>+14154027422</span></a> <br></span><span style=3D'font-siz=
e:10.0pt;font-family:"Verdana","sans-serif";color:red'>Oracle</span><span s=
tyle=3D'font-size:10.0pt;font-family:"Verdana","sans-serif";color:#666666'>=
 Exalogic Development<br>200 Oracle Parkway | Redwood Shores, California 94=
065</span><span style=3D'font-size:12.0pt;font-family:"Times New Roman","se=
rif";color:#1F497D'> <o:p></o:p></span></p></div><table class=3DMsoNormalTa=
ble border=3D0 cellspacing=3D3 cellpadding=3D0><tr><td style=3D'padding:.75=
pt .75pt .75pt .75pt'><p class=3DMsoNormal><a href=3D"http://www.oracle.com=
/commitment" target=3D"_blank"><span style=3D'color:black;text-decoration:n=
one'><img border=3D0 width=3D44 height=3D28 id=3D"_x0000_i1025" src=3D"cid:=
image002.gif@01CDC332.3482A250" alt=3D"Green Oracle"></span></a><span style=
=3D'font-size:12.0pt;color:#1F497D'><o:p></o:p></span></p></td><td style=3D=
'padding:.75pt .75pt .75pt .75pt'><p class=3DMsoNormal><span style=3D'font-=
size:7.5pt;font-family:"Verdana","sans-serif";color:#4B7D42'>Oracle is comm=
itted to developing practices and products that help protect the environmen=
t</span><span style=3D'font-size:12.0pt;color:#1F497D'><o:p></o:p></span></=
p></td></tr></table><p class=3DMsoNormal><span style=3D'color:#1F497D'><o:p=
>&nbsp;</o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:9.0pt=
;color:#1F497D'><a href=3D"http://www.oracle.com/pls/ebn/swf_viewer.load?p_=
shows_id=3D12641667&amp;p_referred=3D0&amp;p_width=3D1000&amp;p_height=3D67=
5"><span style=3D'color:black;text-decoration:none'>Watch the Exalogic 5-mi=
nute Demo at</span><span style=3D'color:#1F497D'> </span>http://www.oracle.=
com/pls/ebn/swf_viewer.load?p_shows_id=3D12641667</a><o:p></o:p></span></p>=
<p class=3DMsoNormal><span style=3D'color:#1F497D'><o:p>&nbsp;</o:p></span>=
</p><div><div style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3=
.0pt 0in 0in 0in'><p class=3DMsoNormal><b><span style=3D'font-size:10.0pt;f=
ont-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span st=
yle=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'=
> George Dunlap [mailto:george.dunlap@eu.citrix.com] <br><b>Sent:</b> Novem=
ber 15, 2012 11:53 AM<br><b>To:</b> Michael Palmeter<br><b>Cc:</b> Ashok Al=
etty; Dario Faggioli; xen-devel@lists.xen.org<br><b>Subject:</b> Re: [Xen-d=
evel] Xen credit scheduler question<o:p></o:p></span></p></div></div><p cla=
ss=3DMsoNormal><o:p>&nbsp;</o:p></p><div><p class=3DMsoNormal>On 15/11/12 1=
9:03, Michael Palmeter wrote:<o:p></o:p></p></div><blockquote style=3D'marg=
in-top:5.0pt;margin-bottom:5.0pt'><p class=3DMsoNormal><span style=3D'color=
:#1F497D'>Thank you for your answer, George.</span><o:p></o:p></p><p class=
=3DMsoNormal><span style=3D'color:#1F497D'>&nbsp;</span><o:p></o:p></p><p c=
lass=3DMsoNormal><span style=3D'color:#1F497D'>The origin of my question is=
 more of a business concern than a technical one.&nbsp; Many software produ=
cts are licensed based on a cost per processor core.&nbsp; It is desirable =
to sometimes allow customers to pay a fraction of software license costs in=
 exchange for running that software using only a commensurate fraction of a=
vailable compute power (capacity sub-licensing).&nbsp; If the cap is a mean=
s of making a vCPU more-or-less deterministic (in terms of its effective co=
mputational capacity) then that would be useful as a programmatic means of =
enabling capacity sub-licensing.&nbsp; My example below was based on a case=
 where I have a customer that would like to use &#8216;cap&#8217; to constr=
ain their single vCPU VM to only =BD of a core worth of compute capacity (l=
ogically 1/32 of the compute power) in exchange for only paying 1/32 of the=
 license cost for the physical server.</span><o:p></o:p></p></blockquote><p=
 class=3DMsoNormal><span style=3D'font-size:12.0pt;font-family:"Times New R=
oman","serif"'><br>Right -- I've seen the &quot;limit cpu power for licensi=
ng purposes&quot; thing before, but I think that only went down to cores, n=
ot sub-core.<br><br><br><o:p></o:p></span></p><p class=3DMsoNormal><span st=
yle=3D'color:#1F497D'>&nbsp;</span><o:p></o:p></p><p class=3DMsoNormal><spa=
n style=3D'color:#1F497D'>Below you answered:</span><o:p></o:p></p><p class=
=3DMsoNormal><span style=3D'color:#1F497D'>&nbsp;</span><o:p></o:p></p><p c=
lass=3DMsoNormal><span style=3D'color:#1F497D'>&#8220;You can use &#8216;ca=
p&#8217; to make the VM in question get 50% of logical vcpu time, which on =
an idle system will give it 0.5 of the capacity of a physical core (if we d=
on't consider Intel's Turbo Boost technology).&nbsp; But if the system beco=
mes busy, it will get less than 0.5 of the processing capacity of a physica=
l core.&#8221;</span><o:p></o:p></p><p class=3DMsoNormal><span style=3D'col=
or:#1F497D'>&nbsp;</span><o:p></o:p></p><p class=3DMsoNormal><span style=3D=
'color:#1F497D'>Are you saying that cap would be able to CONSTRAIN a vCPU t=
o an effective compute capacity equal to 50% of a physical core, but it doe=
s not GUARANTEE effective compute capacity equal to 50% of a physical core?=
 </span><o:p></o:p></p><p class=3DMsoNormal><span style=3D'font-size:12.0pt=
;font-family:"Times New Roman","serif"'><br>Theoretically, a cap at 50 will=
 give your single-vcpu VM 50% of the time of one hyperthread.<br><br>So if =
C is &quot;typicall throughput of a single non-hyperthreaded core running a=
t standard requency&quot;, and we factor out Turbo Boost, then there are tw=
o cases to consider:<br><br>* Other thread is idle.&nbsp; In that case, the=
 VM will get 0.5C.<br>* The other thread is busy.&nbsp; In this case, assum=
ing a 0.7 factor, the VM will get 0.5 * (0.7 * C), or about 0.35C<br><br>So=
 the total computing power available to the VM should be &lt;=3D 0.5C (sati=
sfying the licensing requirements), but on a busy system it may be signific=
antly less than 0.5C (perhaps not so satisfying to the owner of the VM).<br=
><br>I don't think it should be terribly difficult to put a simple &quot;sh=
ared hyperthread&quot; multiplier on the credit burned -- if someone at Ora=
cle wanted to help implement this, we'd be happy to point you in the right =
direction. :-)<br><br>If you have Turbo Boost, then (as I understand it) th=
e CPU can raise the clock speed of the processor when threads or cores are =
idle; the wikipedia article seems to think some processors can increase the=
 clock speed up to 1.6x over the baseline frequency.&nbsp; That would throw=
 a bit of a wrench in the works, as you might end up with 0.5 * 1.6 * C =3D=
 0.8 C &gt; 0.5 C; however, looking at Intel's website, it looks like only =
2- and 4-core processors have TurboBoost, so maybe on 8-core processors we =
can punt on that thorny issue for a little while yet. :-)<br><br><br><o:p><=
/o:p></span></p><p class=3DMsoNormal><span style=3D'color:#1F497D'>Can you =
offer any guidance regarding real-world scheduler overhead (when cap&gt;0 i=
s used) and precision (how variable is actual compute power for a vCPU with=
 a cap of 100%, for example)?</span><o:p></o:p></p><p class=3DMsoNormal><sp=
an style=3D'font-size:12.0pt;font-family:"Times New Roman","serif"'><br>I h=
ave not done extensive testing with the cap; I mainly know the mechanism by=
 which it works.&nbsp; There is no extra accounting done in the scheduler f=
or having a cap: all vcpus are assigned credit every 30ms according to thei=
r weight and cap.&nbsp; The difference is that if a non-capped vcpu uses up=
 its credits, it is allowed to go negative; whereas a capped vcpu will be p=
aused until it receives more credits.&nbsp; So there should be no extra hyp=
ervisor overhead from using a cap.<br><br>The cap fundamentally works by lo=
cking out a vcpu for very small amounts of time within the 30ms accounting =
window.&nbsp; But this same effect might happen just by having other VMs co=
mpeting for the cpu; so in theory shouldn't be any riskier than virtualizin=
g in the first place.<br><br>Executive summary: Factoring out Turbo Boost, =
&quot;cap&quot; should be able to set a sub-core upper-bound on processing =
power.&nbsp; But on a busy system, it may result in the VM getting less tha=
n its upper-bound in processing power.<br><br>However, scheduling is a very=
 complex and dynamic system, and like economics, very simple changes can ha=
ve unpredictable results.&nbsp; So it's probably a good idea to do some tes=
ting before recommending it to customers. :-)<br><br>BTW, are you familiar =
with Xen's cpupool functionality?&nbsp; The guys at Fujitsu wrote it so tha=
t a customer could rent a fixed number of cores to a customer, who could th=
en run as many VMs on those cores as they wanted.&nbsp; I think licensing r=
estrictions had something to do with that as well.&nbsp; More about that he=
re, if you're interested:<br>&nbsp;<a href=3D"http://blog.xen.org/index.php=
/2012/04/23/xen-4-2-cpupools/">http://blog.xen.org/index.php/2012/04/23/xen=
-4-2-cpupools/</a><br><br>&nbsp;-George<o:p></o:p></span></p></div></body><=
/html>
--__1353013668404174287abhmt114.oracle.com
Content-Type: image/gif; name="image001.gif"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="image001.gif"
Content-ID: <image001.gif@01CDC332.3482A250>

R0lGODlhcgAaAMQAAP8QEP/w8P/Q0P/g4P8wMP9gYP8gIP+goP9QUP+QkP+wsP9wcP+AgP9AQP/A
wP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAA
AAAALAAAAAByABoAAAX/ICSOZGmeaKqubOu+cCzPdC0GCqPvvBKUDp5wp1gFdIPVIDfcOQa6A8yR
aO4gweQoUHh4v2Bw4SdihM9egyBF8ALIpkEXDR44vA2XwkD/IgYGAAZbbX1nBGRmhl8AWiUJYicC
AIsPDFh4LXOGjQ4NAAhrEIUPBQcOqKmoB5sEZV4JqqoHhQVxlGAOJQG4AAunsqg/dw95KwdfBgzB
qKIEBMaQDwCiKpOwEIq6KANuJg14igZwEHPULMTGKbxetjF8D1ItxK7aKl8lCl8DAfALW1+2rUi3
QtqgGN2mwYCXzYvAON624LoEQZ9DEfRcEFSBIE2DjyBDfnyIqRgMcA8a/z5AZQWXOxEdHxwUgfIg
sX/zMqlAWclVCQFefLpAqdJBAFJn3owgtpJEQkslEWjUmYLnomokcDlS4s0eFzQNqvXDEyzmAwFP
yaXYmGJBuxlzELWIacueiE0AFGyF4HbaNTquUEpFRxUFUC9YXQzARYAkEJSNipKQ9kDu0i9SKKNZ
9iXswMIoYgI4oJYFskpgzkkmcdrviELqmPVt1HpRAaaLqCE1lBgjvEpqRtgl8Tevygd7TcCuiKvP
m8OVEkAIYLYPThSsRIpEQJr1x94QBIT09FH6QJC6AiRAoB1kEb7tRb4MvyB+AwSlbejfz7+///8A
BijggAQWaOCBCCao4A+CDDbo4IMQRijhhBQKGAIAOw==
--__1353013668404174287abhmt114.oracle.com
Content-Type: image/gif; name="image002.gif"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="image002.gif"
Content-ID: <image002.gif@01CDC332.3482A250>

R0lGODlhLAAcAMQAAP///0x9RHmec9Pf0aa+oleFULHGrmKNW+nv6I+uivT39N7n3W6VZ7zPuZu2
lsjXxYSmfwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAA
AAAALAAAAAAsABwAQAXhICCOZGmeaDoaReC+sKAMR7GopIA6boIvLgPAVSAgALxjSYdrOp/Q6NPg
YqIEPkTBV2taTwgGbEw+PAZo3FfKbqMQQfeJ8DoY0Hg0wxhAKBgHCl5XLgMqDwFCAAIFPIYDgidr
OUQGkSh0cQMJAQyXOXKhoqOkpaanI2aoIwMErq+uCY0BMlANKpxkYwQGBH82TpMicD0pAgQACToD
AchqhAG3KQ4HIlQNnErG0IYqB9EAiEQvwEsozC43hy0CAeXMwsLDLS8MAvf497ruCZ+gOA0gfNt3
AIK0J/JWKVzIsEQIADs=
--__1353013668404174287abhmt114.oracle.com--

--__1353013668404174286abhmt114.oracle.com--

--__1353013668404174285abhmt114.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__1353013668404174285abhmt114.oracle.com--


From xen-devel-bounces@lists.xen.org Thu Nov 15 21:08:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 21:08:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ6fW-0007ns-KV; Thu, 15 Nov 2012 21:08:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <michael.palmeter@oracle.com>) id 1TZ6fU-0007ni-JG
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 21:08:12 +0000
Received: from [85.158.143.35:21392] by server-2.bemta-4.messagelabs.com id
	C5/FA-28922-BB955A05; Thu, 15 Nov 2012 21:08:11 +0000
X-Env-Sender: michael.palmeter@oracle.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1353013682!14135888!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1921 invoked from network); 15 Nov 2012 21:08:03 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-15.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 21:08:03 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFL7ndn024270
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 21:07:50 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFL7mc9011706
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 21:07:49 GMT
Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFL7mIX009032; Thu, 15 Nov 2012 15:07:48 -0600
MIME-Version: 1.0
Message-ID: <f12127d1-c92e-4317-a3ea-bacf7bc42a7f@default>
Date: Thu, 15 Nov 2012 13:07:47 -0800 (PST)
From: Michael Palmeter <michael.palmeter@oracle.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
References: <c58a9d3a-99e4-42ac-86c9-fbec600dee14@default>
	<50A53479.5050901@eu.citrix.com>
	<27449f60-0433-4e5f-b1fb-06914b84c6f1@default>
	<50A54815.9010402@eu.citrix.com>
In-Reply-To: <50A54815.9010402@eu.citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__1353013668404174285abhmt114.oracle.com"
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: xen-devel@lists.xen.org, Dario Faggioli <raistlin@linux.it>,
	Ashok Aletty <ashok.aletty@oracle.com>
Subject: Re: [Xen-devel] Xen credit scheduler question
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__1353013668404174285abhmt114.oracle.com
Content-Type: multipart/alternative;
 boundary="__1353013668404174286abhmt114.oracle.com"

--__1353013668404174286abhmt114.oracle.com
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Thanks very much George.=A0 Very helpful indeed.

=A0

- Mike

HYPERLINK "http://www.oracle.com/" \nOracle
Michael Palmeter | Sr. Director of Product Management, Oracle Exalogic Elas=
tic Cloud
Phone: HYPERLINK "tel:+14153736497"+14153736497 | Mobile: HYPERLINK "tel:+1=
4156949573"+14156949573 | VOIP: HYPERLINK "tel:+14154027422"+14154027422=20
Oracle Exalogic Development
200 Oracle Parkway | Redwood Shores, California 94065=20

HYPERLINK "http://www.oracle.com/commitment" \nGreen Oracle

Oracle is committed to developing practices and products that help protect =
the environment

=A0

HYPERLINK "http://www.oracle.com/pls/ebn/swf_viewer.load?p_shows_id=3D12641=
667&p_referred=3D0&p_width=3D1000&p_height=3D675"Watch the Exalogic 5-minut=
e Demo at http://www.oracle.com/pls/ebn/swf_viewer.load?p_shows_id=3D126416=
67

=A0

From: George Dunlap [mailto:george.dunlap@eu.citrix.com]=20
Sent: November 15, 2012 11:53 AM
To: Michael Palmeter
Cc: Ashok Aletty; Dario Faggioli; xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Xen credit scheduler question

=A0

On 15/11/12 19:03, Michael Palmeter wrote:

Thank you for your answer, George.

=A0

The origin of my question is more of a business concern than a technical on=
e.=A0 Many software products are licensed based on a cost per processor cor=
e.=A0 It is desirable to sometimes allow customers to pay a fraction of sof=
tware license costs in exchange for running that software using only a comm=
ensurate fraction of available compute power (capacity sub-licensing).=A0 I=
f the cap is a means of making a vCPU more-or-less deterministic (in terms =
of its effective computational capacity) then that would be useful as a pro=
grammatic means of enabling capacity sub-licensing.=A0 My example below was=
 based on a case where I have a customer that would like to use 'cap' to co=
nstrain their single vCPU VM to only =BD of a core worth of compute capacit=
y (logically 1/32 of the compute power) in exchange for only paying 1/32 of=
 the license cost for the physical server.


Right -- I've seen the "limit cpu power for licensing purposes" thing befor=
e, but I think that only went down to cores, not sub-core.




=A0

Below you answered:

=A0

"You can use 'cap' to make the VM in question get 50% of logical vcpu time,=
 which on an idle system will give it 0.5 of the capacity of a physical cor=
e (if we don't consider Intel's Turbo Boost technology).=A0 But if the syst=
em becomes busy, it will get less than 0.5 of the processing capacity of a =
physical core."

=A0

Are you saying that cap would be able to CONSTRAIN a vCPU to an effective c=
ompute capacity equal to 50% of a physical core, but it does not GUARANTEE =
effective compute capacity equal to 50% of a physical core?=20


Theoretically, a cap at 50 will give your single-vcpu VM 50% of the time of=
 one hyperthread.

So if C is "typicall throughput of a single non-hyperthreaded core running =
at standard requency", and we factor out Turbo Boost, then there are two ca=
ses to consider:

* Other thread is idle.=A0 In that case, the VM will get 0.5C.
* The other thread is busy.=A0 In this case, assuming a 0.7 factor, the VM =
will get 0.5 * (0.7 * C), or about 0.35C

So the total computing power available to the VM should be <=3D 0.5C (satis=
fying the licensing requirements), but on a busy system it may be significa=
ntly less than 0.5C (perhaps not so satisfying to the owner of the VM).

I don't think it should be terribly difficult to put a simple "shared hyper=
thread" multiplier on the credit burned -- if someone at Oracle wanted to h=
elp implement this, we'd be happy to point you in the right direction. :-)

If you have Turbo Boost, then (as I understand it) the CPU can raise the cl=
ock speed of the processor when threads or cores are idle; the wikipedia ar=
ticle seems to think some processors can increase the clock speed up to 1.6=
x over the baseline frequency.=A0 That would throw a bit of a wrench in the=
 works, as you might end up with 0.5 * 1.6 * C =3D 0.8 C > 0.5 C; however, =
looking at Intel's website, it looks like only 2- and 4-core processors hav=
e TurboBoost, so maybe on 8-core processors we can punt on that thorny issu=
e for a little while yet. :-)




Can you offer any guidance regarding real-world scheduler overhead (when ca=
p>0 is used) and precision (how variable is actual compute power for a vCPU=
 with a cap of 100%, for example)?


I have not done extensive testing with the cap; I mainly know the mechanism=
 by which it works.=A0 There is no extra accounting done in the scheduler f=
or having a cap: all vcpus are assigned credit every 30ms according to thei=
r weight and cap.=A0 The difference is that if a non-capped vcpu uses up it=
s credits, it is allowed to go negative; whereas a capped vcpu will be paus=
ed until it receives more credits.=A0 So there should be no extra hyperviso=
r overhead from using a cap.

The cap fundamentally works by locking out a vcpu for very small amounts of=
 time within the 30ms accounting window.=A0 But this same effect might happ=
en just by having other VMs competing for the cpu; so in theory shouldn't b=
e any riskier than virtualizing in the first place.

Executive summary: Factoring out Turbo Boost, "cap" should be able to set a=
 sub-core upper-bound on processing power.=A0 But on a busy system, it may =
result in the VM getting less than its upper-bound in processing power.

However, scheduling is a very complex and dynamic system, and like economic=
s, very simple changes can have unpredictable results.=A0 So it's probably =
a good idea to do some testing before recommending it to customers. :-)

BTW, are you familiar with Xen's cpupool functionality?=A0 The guys at Fuji=
tsu wrote it so that a customer could rent a fixed number of cores to a cus=
tomer, who could then run as many VMs on those cores as they wanted.=A0 I t=
hink licensing restrictions had something to do with that as well.=A0 More =
about that here, if you're interested:
=A0http://blog.xen.org/index.php/2012/04/23/xen-4-2-cpupools/

=A0-George

--__1353013668404174286abhmt114.oracle.com
Content-Type: multipart/related;
 boundary="__1353013668404174287abhmt114.oracle.com"

--__1353013668404174287abhmt114.oracle.com
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Diso-8859-=
1">
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-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 name=3DGenerator content=3D"Microso=
ft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#defa=
ult#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
=09{font-family:"Cambria Math";
=09panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
=09{font-family:Calibri;
=09panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
=09{font-family:Tahoma;
=09panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
=09{font-family:Verdana;
=09panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
=09{margin:0in;
=09margin-bottom:.0001pt;
=09font-size:11.0pt;
=09font-family:"Calibri","sans-serif";
=09color:black;}
a:link, span.MsoHyperlink
=09{mso-style-priority:99;
=09color:blue;
=09text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
=09{mso-style-priority:99;
=09color:purple;
=09text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
=09{mso-style-priority:99;
=09mso-style-link:"Balloon Text Char";
=09margin:0in;
=09margin-bottom:.0001pt;
=09font-size:8.0pt;
=09font-family:"Tahoma","sans-serif";
=09color:black;}
span.BalloonTextChar
=09{mso-style-name:"Balloon Text Char";
=09mso-style-priority:99;
=09mso-style-link:"Balloon Text";
=09font-family:"Tahoma","sans-serif";}
span.EmailStyle19
=09{mso-style-type:personal;
=09font-family:"Calibri","sans-serif";
=09color:windowtext;}
span.EmailStyle20
=09{mso-style-type:personal;
=09font-family:"Calibri","sans-serif";
=09color:#1F497D;}
span.EmailStyle21
=09{mso-style-type:personal-reply;
=09font-family:"Calibri","sans-serif";
=09color:#1F497D;}
.MsoChpDefault
=09{mso-style-type:export-only;
=09font-size:10.0pt;}
@page WordSection1
=09{size:8.5in 11.0in;
=09margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
=09{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"2050" />
</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 bgcolor=3Dwhite lang=3DEN-US=
 link=3Dblue vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal>=
<span style=3D'color:#1F497D'>Thanks very much George.=A0 Very helpful inde=
ed.<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'color:#1F497D'=
><o:p>&nbsp;</o:p></span></p><div><p class=3DMsoNormal><span style=3D'color=
:#1F497D'>- Mike<o:p></o:p></span></p><p class=3DMsoNormal style=3D'mso-mar=
gin-top-alt:auto;mso-margin-bottom-alt:auto'><a href=3D"http://www.oracle.c=
om/" target=3D"_blank"><span style=3D'font-size:12.0pt;font-family:"Times N=
ew Roman","serif";color:black;text-decoration:none'><img border=3D0 width=
=3D114 height=3D26 id=3D"_x0000_i1026" src=3D"cid:image001.gif@01CDC332.348=
2A250" alt=3DOracle></span></a><span style=3D'font-size:12.0pt;font-family:=
"Times New Roman","serif";color:#1F497D'><br></span><span style=3D'font-siz=
e:10.0pt;font-family:"Verdana","sans-serif";color:#666666'>Michael Palmeter=
 | Sr. Director of Product Management, Oracle Exalogic Elastic Cloud<br>Pho=
ne: <a href=3D"tel:+14153736497"><span style=3D'color:black'>+14153736497</=
span></a> | Mobile: <a href=3D"tel:+14156949573"><span style=3D'color:black=
'>+14156949573</span></a> | VOIP: <a href=3D"tel:+14154027422"><span style=
=3D'color:black'>+14154027422</span></a> <br></span><span style=3D'font-siz=
e:10.0pt;font-family:"Verdana","sans-serif";color:red'>Oracle</span><span s=
tyle=3D'font-size:10.0pt;font-family:"Verdana","sans-serif";color:#666666'>=
 Exalogic Development<br>200 Oracle Parkway | Redwood Shores, California 94=
065</span><span style=3D'font-size:12.0pt;font-family:"Times New Roman","se=
rif";color:#1F497D'> <o:p></o:p></span></p></div><table class=3DMsoNormalTa=
ble border=3D0 cellspacing=3D3 cellpadding=3D0><tr><td style=3D'padding:.75=
pt .75pt .75pt .75pt'><p class=3DMsoNormal><a href=3D"http://www.oracle.com=
/commitment" target=3D"_blank"><span style=3D'color:black;text-decoration:n=
one'><img border=3D0 width=3D44 height=3D28 id=3D"_x0000_i1025" src=3D"cid:=
image002.gif@01CDC332.3482A250" alt=3D"Green Oracle"></span></a><span style=
=3D'font-size:12.0pt;color:#1F497D'><o:p></o:p></span></p></td><td style=3D=
'padding:.75pt .75pt .75pt .75pt'><p class=3DMsoNormal><span style=3D'font-=
size:7.5pt;font-family:"Verdana","sans-serif";color:#4B7D42'>Oracle is comm=
itted to developing practices and products that help protect the environmen=
t</span><span style=3D'font-size:12.0pt;color:#1F497D'><o:p></o:p></span></=
p></td></tr></table><p class=3DMsoNormal><span style=3D'color:#1F497D'><o:p=
>&nbsp;</o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:9.0pt=
;color:#1F497D'><a href=3D"http://www.oracle.com/pls/ebn/swf_viewer.load?p_=
shows_id=3D12641667&amp;p_referred=3D0&amp;p_width=3D1000&amp;p_height=3D67=
5"><span style=3D'color:black;text-decoration:none'>Watch the Exalogic 5-mi=
nute Demo at</span><span style=3D'color:#1F497D'> </span>http://www.oracle.=
com/pls/ebn/swf_viewer.load?p_shows_id=3D12641667</a><o:p></o:p></span></p>=
<p class=3DMsoNormal><span style=3D'color:#1F497D'><o:p>&nbsp;</o:p></span>=
</p><div><div style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3=
.0pt 0in 0in 0in'><p class=3DMsoNormal><b><span style=3D'font-size:10.0pt;f=
ont-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span st=
yle=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'=
> George Dunlap [mailto:george.dunlap@eu.citrix.com] <br><b>Sent:</b> Novem=
ber 15, 2012 11:53 AM<br><b>To:</b> Michael Palmeter<br><b>Cc:</b> Ashok Al=
etty; Dario Faggioli; xen-devel@lists.xen.org<br><b>Subject:</b> Re: [Xen-d=
evel] Xen credit scheduler question<o:p></o:p></span></p></div></div><p cla=
ss=3DMsoNormal><o:p>&nbsp;</o:p></p><div><p class=3DMsoNormal>On 15/11/12 1=
9:03, Michael Palmeter wrote:<o:p></o:p></p></div><blockquote style=3D'marg=
in-top:5.0pt;margin-bottom:5.0pt'><p class=3DMsoNormal><span style=3D'color=
:#1F497D'>Thank you for your answer, George.</span><o:p></o:p></p><p class=
=3DMsoNormal><span style=3D'color:#1F497D'>&nbsp;</span><o:p></o:p></p><p c=
lass=3DMsoNormal><span style=3D'color:#1F497D'>The origin of my question is=
 more of a business concern than a technical one.&nbsp; Many software produ=
cts are licensed based on a cost per processor core.&nbsp; It is desirable =
to sometimes allow customers to pay a fraction of software license costs in=
 exchange for running that software using only a commensurate fraction of a=
vailable compute power (capacity sub-licensing).&nbsp; If the cap is a mean=
s of making a vCPU more-or-less deterministic (in terms of its effective co=
mputational capacity) then that would be useful as a programmatic means of =
enabling capacity sub-licensing.&nbsp; My example below was based on a case=
 where I have a customer that would like to use &#8216;cap&#8217; to constr=
ain their single vCPU VM to only =BD of a core worth of compute capacity (l=
ogically 1/32 of the compute power) in exchange for only paying 1/32 of the=
 license cost for the physical server.</span><o:p></o:p></p></blockquote><p=
 class=3DMsoNormal><span style=3D'font-size:12.0pt;font-family:"Times New R=
oman","serif"'><br>Right -- I've seen the &quot;limit cpu power for licensi=
ng purposes&quot; thing before, but I think that only went down to cores, n=
ot sub-core.<br><br><br><o:p></o:p></span></p><p class=3DMsoNormal><span st=
yle=3D'color:#1F497D'>&nbsp;</span><o:p></o:p></p><p class=3DMsoNormal><spa=
n style=3D'color:#1F497D'>Below you answered:</span><o:p></o:p></p><p class=
=3DMsoNormal><span style=3D'color:#1F497D'>&nbsp;</span><o:p></o:p></p><p c=
lass=3DMsoNormal><span style=3D'color:#1F497D'>&#8220;You can use &#8216;ca=
p&#8217; to make the VM in question get 50% of logical vcpu time, which on =
an idle system will give it 0.5 of the capacity of a physical core (if we d=
on't consider Intel's Turbo Boost technology).&nbsp; But if the system beco=
mes busy, it will get less than 0.5 of the processing capacity of a physica=
l core.&#8221;</span><o:p></o:p></p><p class=3DMsoNormal><span style=3D'col=
or:#1F497D'>&nbsp;</span><o:p></o:p></p><p class=3DMsoNormal><span style=3D=
'color:#1F497D'>Are you saying that cap would be able to CONSTRAIN a vCPU t=
o an effective compute capacity equal to 50% of a physical core, but it doe=
s not GUARANTEE effective compute capacity equal to 50% of a physical core?=
 </span><o:p></o:p></p><p class=3DMsoNormal><span style=3D'font-size:12.0pt=
;font-family:"Times New Roman","serif"'><br>Theoretically, a cap at 50 will=
 give your single-vcpu VM 50% of the time of one hyperthread.<br><br>So if =
C is &quot;typicall throughput of a single non-hyperthreaded core running a=
t standard requency&quot;, and we factor out Turbo Boost, then there are tw=
o cases to consider:<br><br>* Other thread is idle.&nbsp; In that case, the=
 VM will get 0.5C.<br>* The other thread is busy.&nbsp; In this case, assum=
ing a 0.7 factor, the VM will get 0.5 * (0.7 * C), or about 0.35C<br><br>So=
 the total computing power available to the VM should be &lt;=3D 0.5C (sati=
sfying the licensing requirements), but on a busy system it may be signific=
antly less than 0.5C (perhaps not so satisfying to the owner of the VM).<br=
><br>I don't think it should be terribly difficult to put a simple &quot;sh=
ared hyperthread&quot; multiplier on the credit burned -- if someone at Ora=
cle wanted to help implement this, we'd be happy to point you in the right =
direction. :-)<br><br>If you have Turbo Boost, then (as I understand it) th=
e CPU can raise the clock speed of the processor when threads or cores are =
idle; the wikipedia article seems to think some processors can increase the=
 clock speed up to 1.6x over the baseline frequency.&nbsp; That would throw=
 a bit of a wrench in the works, as you might end up with 0.5 * 1.6 * C =3D=
 0.8 C &gt; 0.5 C; however, looking at Intel's website, it looks like only =
2- and 4-core processors have TurboBoost, so maybe on 8-core processors we =
can punt on that thorny issue for a little while yet. :-)<br><br><br><o:p><=
/o:p></span></p><p class=3DMsoNormal><span style=3D'color:#1F497D'>Can you =
offer any guidance regarding real-world scheduler overhead (when cap&gt;0 i=
s used) and precision (how variable is actual compute power for a vCPU with=
 a cap of 100%, for example)?</span><o:p></o:p></p><p class=3DMsoNormal><sp=
an style=3D'font-size:12.0pt;font-family:"Times New Roman","serif"'><br>I h=
ave not done extensive testing with the cap; I mainly know the mechanism by=
 which it works.&nbsp; There is no extra accounting done in the scheduler f=
or having a cap: all vcpus are assigned credit every 30ms according to thei=
r weight and cap.&nbsp; The difference is that if a non-capped vcpu uses up=
 its credits, it is allowed to go negative; whereas a capped vcpu will be p=
aused until it receives more credits.&nbsp; So there should be no extra hyp=
ervisor overhead from using a cap.<br><br>The cap fundamentally works by lo=
cking out a vcpu for very small amounts of time within the 30ms accounting =
window.&nbsp; But this same effect might happen just by having other VMs co=
mpeting for the cpu; so in theory shouldn't be any riskier than virtualizin=
g in the first place.<br><br>Executive summary: Factoring out Turbo Boost, =
&quot;cap&quot; should be able to set a sub-core upper-bound on processing =
power.&nbsp; But on a busy system, it may result in the VM getting less tha=
n its upper-bound in processing power.<br><br>However, scheduling is a very=
 complex and dynamic system, and like economics, very simple changes can ha=
ve unpredictable results.&nbsp; So it's probably a good idea to do some tes=
ting before recommending it to customers. :-)<br><br>BTW, are you familiar =
with Xen's cpupool functionality?&nbsp; The guys at Fujitsu wrote it so tha=
t a customer could rent a fixed number of cores to a customer, who could th=
en run as many VMs on those cores as they wanted.&nbsp; I think licensing r=
estrictions had something to do with that as well.&nbsp; More about that he=
re, if you're interested:<br>&nbsp;<a href=3D"http://blog.xen.org/index.php=
/2012/04/23/xen-4-2-cpupools/">http://blog.xen.org/index.php/2012/04/23/xen=
-4-2-cpupools/</a><br><br>&nbsp;-George<o:p></o:p></span></p></div></body><=
/html>
--__1353013668404174287abhmt114.oracle.com
Content-Type: image/gif; name="image001.gif"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="image001.gif"
Content-ID: <image001.gif@01CDC332.3482A250>

R0lGODlhcgAaAMQAAP8QEP/w8P/Q0P/g4P8wMP9gYP8gIP+goP9QUP+QkP+wsP9wcP+AgP9AQP/A
wP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAA
AAAALAAAAAByABoAAAX/ICSOZGmeaKqubOu+cCzPdC0GCqPvvBKUDp5wp1gFdIPVIDfcOQa6A8yR
aO4gweQoUHh4v2Bw4SdihM9egyBF8ALIpkEXDR44vA2XwkD/IgYGAAZbbX1nBGRmhl8AWiUJYicC
AIsPDFh4LXOGjQ4NAAhrEIUPBQcOqKmoB5sEZV4JqqoHhQVxlGAOJQG4AAunsqg/dw95KwdfBgzB
qKIEBMaQDwCiKpOwEIq6KANuJg14igZwEHPULMTGKbxetjF8D1ItxK7aKl8lCl8DAfALW1+2rUi3
QtqgGN2mwYCXzYvAON624LoEQZ9DEfRcEFSBIE2DjyBDfnyIqRgMcA8a/z5AZQWXOxEdHxwUgfIg
sX/zMqlAWclVCQFefLpAqdJBAFJn3owgtpJEQkslEWjUmYLnomokcDlS4s0eFzQNqvXDEyzmAwFP
yaXYmGJBuxlzELWIacueiE0AFGyF4HbaNTquUEpFRxUFUC9YXQzARYAkEJSNipKQ9kDu0i9SKKNZ
9iXswMIoYgI4oJYFskpgzkkmcdrviELqmPVt1HpRAaaLqCE1lBgjvEpqRtgl8Tevygd7TcCuiKvP
m8OVEkAIYLYPThSsRIpEQJr1x94QBIT09FH6QJC6AiRAoB1kEb7tRb4MvyB+AwSlbejfz7+///8A
BijggAQWaOCBCCao4A+CDDbo4IMQRijhhBQKGAIAOw==
--__1353013668404174287abhmt114.oracle.com
Content-Type: image/gif; name="image002.gif"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="image002.gif"
Content-ID: <image002.gif@01CDC332.3482A250>

R0lGODlhLAAcAMQAAP///0x9RHmec9Pf0aa+oleFULHGrmKNW+nv6I+uivT39N7n3W6VZ7zPuZu2
lsjXxYSmfwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAA
AAAALAAAAAAsABwAQAXhICCOZGmeaDoaReC+sKAMR7GopIA6boIvLgPAVSAgALxjSYdrOp/Q6NPg
YqIEPkTBV2taTwgGbEw+PAZo3FfKbqMQQfeJ8DoY0Hg0wxhAKBgHCl5XLgMqDwFCAAIFPIYDgidr
OUQGkSh0cQMJAQyXOXKhoqOkpaanI2aoIwMErq+uCY0BMlANKpxkYwQGBH82TpMicD0pAgQACToD
AchqhAG3KQ4HIlQNnErG0IYqB9EAiEQvwEsozC43hy0CAeXMwsLDLS8MAvf497ruCZ+gOA0gfNt3
AIK0J/JWKVzIsEQIADs=
--__1353013668404174287abhmt114.oracle.com--

--__1353013668404174286abhmt114.oracle.com--

--__1353013668404174285abhmt114.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__1353013668404174285abhmt114.oracle.com--


From xen-devel-bounces@lists.xen.org Thu Nov 15 21:27:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 21:27:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ6xb-0008P8-7I; Thu, 15 Nov 2012 21:26:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TZ6xZ-0008P3-1n
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 21:26:53 +0000
Received: from [85.158.143.35:22569] by server-2.bemta-4.messagelabs.com id
	11/23-28922-C1E55A05; Thu, 15 Nov 2012 21:26:52 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1353014808!5679096!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NzMxMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14647 invoked from network); 15 Nov 2012 21:26:50 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-4.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 21:26:50 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFLQjrP010743
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 21:26:46 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFLQim5018428
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 21:26:45 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFLQihN018812; Thu, 15 Nov 2012 15:26:44 -0600
MIME-Version: 1.0
Message-ID: <2025804e-1722-44f9-abdc-c8d0e13a23c3@default>
Date: Thu, 15 Nov 2012 13:26:39 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [RFC/PATCH v3] XENMEM_claim_pages (subop of existing)
	hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a third cut of the hypervisor patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account
feedback from Jan and Keir and IanC, plus some fixes found
via runtime debugging (using privcmd only) and some
added comments/cleanup.

[Logistical note: I will be out tomorrow (Friday) plus
US holidays next week so my responsiveness will be slower
for awhile. --djm]

v2->v3:
- Add per-domain and global "get" for unclaimed info [JBeulich]
- New hypercall(s) should fail for unpriv callers [IanC]
- Non-zero extent_order disallowed [JBeulich]
- Remove bonehead ASSERTs [JBeulich]
- Need not hold heaplock for decrease case too [JBeulich]
- More descriptive failure return values [JBeulich]
- Don't allow a claim to exceed max_pages [IanC]
- Subops must be in correct ifdef block in memory.c [keir]

v1->v2:
- Add reset-to-zero page claim in domain_kill [JBeulich]
- Proper handling of struct passed to hypercall [JBeulich]
- Fix alloc_heap_pages when a domain has a claim [JBeulich]
- Need not hold heap_lock if !d->unclaimed_pages [keir]
- Fix missed tot_pages call in donate_page [djm]
- Remove domain_reset_unclaimed_pages; use set with zero [djm]
- Bugfixes found through testing in set_unclaimed [djm]
- More comments in code [djm]
- Code formatting fixes [djm]

===

Motivation:

The goal of this hypercall
is to attempt to atomically and very quickly determine if
there are sufficient pages available in the system and, if
so, "set aside" that quantity of pages for future allocations
by that domain.  Unlike an existing hypercall such as
increase_reservation or populate_physmap, specific physical
pageframes are not assigned to the domain because this
cannot be done sufficiently quickly (especially for very large
allocations in an arbitrarily fragmented system) and so the
existing mechanisms result in classic time-of-check-time-of-use
(TOCTOU) races.  One can think of claiming as similar to a
"lazy" allocation, but subsequent hypercalls are required
to do the actual physical pageframe allocation.

I don't have a patch for the toolstack side, but I envision
a "xl create --claim" option to maximize backwards
compatibility while minimizing impact on existing toolstacks.
As a result, testing has (so far) only been done via privcmd.

Code overview:

Though the hypercall simply does arithmetic within locks,
some of the semantics in the code may be a bit subtle
so let me explain a bit.

The key variables (d->unclaimed_pages and total_unclaimed_pages)
start at zero if no claim has yet been staked for any domain.
(Perhaps a better name is "claimed_but_not_yet_possessed" but that's
a bit unwieldy.)  If no claim hypercalls are executed, there
should be no impact on existing usage.

When a claim is successfully staked by a domain, it is like a
watermark but there is no record kept of the size of the claim.
Instead, d->unclaimed_pages is set to the difference between
d->tot_pages and the claim (d->tot_pages may normally be zero
but see Note 1).  When d->tot_pages increases or decreases,
d->unclaimed_pages atomically decreases or increases.  Once
d->unclaimed_pages reaches zero, the claim is satisfied and
d->unclaimed pages stays at zero -- unless a new claim is
subsequently staked.  See Note 2.

The systemwide variable total_unclaimed_pages is always the sum
of d->unclaimed_pages, across all domains.  A non-domain-
specific heap allocation will fail if total_unclaimed_pages
exceeds free (plus, on tmem enabled systems, freeable) pages.

Claim semantics may be modified by flags.  The initial
implementation has one flag, which discerns whether the
caller would like tmem freeable pages to be considered
in determining whether or not the claim can be successfully
staked. Future flags may, for example, specify that the
caller would like the claim to be successful only if there
are sufficient pages available on a single node (per Dario's
suggestion).

Note 1: Tim: I'm thinking this may resolve your concern that
the claim mechanism must be more complicated to handle
restricted memory allocations and order>0 allocations.
The proposed claim mechanism only guarantees a quantity of
order==0 pages; if restricted allocations are required, these
are done first by the toolstack, and followed by the claim.
Order>0 allocations still work if memory is not fragmented,
but the claim mechanism doesn't guarantee anything but
a quantity of order==0 pages.

Note 2: Tim: This arithmetic also indirectly implements the
"claim auto-expire" discussed earlier.  We certainly don't
want a negative claim.  Unclaim is done by requesting
a claim of zero pages.

Note 3: There is currently no way to observe a staked claim,
so a staked claim will not survive a save/restore/migrate.
Not clear yet if this is needed but could be added.

Thanks for any feedback!

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 tools/libxc/xc_domain.c       |    1 
 tools/libxc/xenctrl.h         |    1 
 xen/arch/x86/mm.c             |    2 
 xen/arch/x86/mm/mem_sharing.c |    4 -
 xen/common/domain.c           |    1 
 xen/common/domctl.c           |    1 
 xen/common/grant_table.c      |    2 
 xen/common/memory.c           |   33 +++++++++++
 xen/common/page_alloc.c       |  120 +++++++++++++++++++++++++++++++++++++++++-
 xen/include/public/domctl.h   |    3 -
 xen/include/public/memory.h   |   39 +++++++++++++
 xen/include/xen/mm.h          |    7 ++
 xen/include/xen/sched.h       |    1 
 13 files changed, 207 insertions(+), 8 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index d98e68b..6d06f7c 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -234,6 +234,7 @@ int xc_domain_getinfo(xc_interface *xch,
 
         info->ssidref  = domctl.u.getdomaininfo.ssidref;
         info->nr_pages = domctl.u.getdomaininfo.tot_pages;
+        info->nr_unclaimed_pages = domctl.u.getdomaininfo.unclaimed_pages;
         info->nr_shared_pages = domctl.u.getdomaininfo.shr_pages;
         info->nr_paged_pages = domctl.u.getdomaininfo.paged_pages;
         info->max_memkb = domctl.u.getdomaininfo.max_pages << (PAGE_SHIFT-10);
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..325f4a3 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -364,6 +364,7 @@ typedef struct xc_dominfo {
                   hvm:1, debugged:1;
     unsigned int  shutdown_reason; /* only meaningful if shutdown==1 */
     unsigned long nr_pages; /* current number, not maximum */
+    unsigned long nr_unclaimed_pages;
     unsigned long nr_shared_pages;
     unsigned long nr_paged_pages;
     unsigned long shared_info_frame;
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fad3d33..7e55908 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3841,7 +3841,7 @@ int donate_page(
     {
         if ( d->tot_pages >= d->max_pages )
             goto fail;
-        d->tot_pages++;
+        domain_increase_tot_pages(d, 1);
     }
 
     page->count_info = PGC_allocated | 1;
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..943a3b5 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d,
     }
 
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_decrease_tot_pages(d, 1);
     drop_dom_ref = (d->tot_pages == 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct page_info *page)
     ASSERT(page_get_owner(page) == dom_cow);
     page_set_owner(page, d);
 
-    if ( d->tot_pages++ == 0 )
+    if ( domain_increase_tot_pages(d, 1) == 0 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0e3e36a..95509e2 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -492,6 +492,7 @@ int domain_kill(struct domain *d)
         evtchn_destroy(d);
         gnttab_release_mappings(d);
         tmem_destroy(d->tmem);
+        domain_set_unclaimed_pages(d, 0, 0);
         d->tmem = NULL;
         /* fallthrough */
     case DOMDYING_dying:
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index e153cb4..19e3930 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -154,6 +154,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
 
     info->tot_pages         = d->tot_pages;
     info->max_pages         = d->max_pages;
+    info->unclaimed_pages   = d->unclaimed_pages;
     info->shr_pages         = atomic_read(&d->shr_pages);
     info->paged_pages       = atomic_read(&d->paged_pages);
     info->shared_info_frame = mfn_to_gmfn(d, __pa(d->shared_info)>>PAGE_SHIFT);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..10ce78f 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1656,7 +1656,7 @@ gnttab_transfer(
         }
 
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ == 0) )
+        if ( unlikely(domain_increase_tot_pages(e, 1) == 0) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..a9d91c1 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
 
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -= dec_count;
+                domain_decrease_tot_pages(d, dec_count);
                 drop_dom_ref = (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
 
@@ -685,6 +685,37 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
     }
 
+    case XENMEM_claim_pages:
+        if ( !(IS_PRIV(current->domain)) )
+            return -EPERM;
+
+        if ( copy_from_guest(&reservation, arg, 1) )
+            return -EFAULT;
+
+        if ( !(guest_handle_is_null(reservation.extent_start)) )
+            return -EINVAL;
+
+        if ( reservation.extent_order != 0 )
+            return -EINVAL;
+
+        rc = rcu_lock_target_domain_by_id(reservation.domid, &d);
+        if ( rc )
+            return rc;
+
+        rc = domain_set_unclaimed_pages(d, reservation.nr_extents,
+                                        reservation.mem_flags);
+
+        rcu_unlock_domain(d);
+
+        break;
+
+    case XENMEM_get_unclaimed_pages:
+        if ( !(IS_PRIV(current->domain)) )
+            return -EPERM;
+
+        rc = get_total_unclaimed_pages();
+        break;
+
     default:
         rc = arch_memory_op(op, arg);
         break;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 15ebc66..79a2065 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -238,6 +238,113 @@ static long midsize_alloc_zone_pages;
 #define MIDSIZE_ALLOC_FRAC 128
 
 static DEFINE_SPINLOCK(heap_lock);
+static long total_unclaimed_pages; /* total outstanding claims by all domains */
+
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pages)
+{
+    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
+
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages += pages;
+    spin_lock(&heap_lock);
+    dom_before = d->unclaimed_pages;
+    dom_after = dom_before - pages;
+    if ( (dom_before > 0) && (dom_after < 0) )
+        dom_claimed = 0;
+    else
+        dom_claimed = dom_after;
+    sys_before = total_unclaimed_pages;
+    sys_after = sys_before - (dom_before - dom_claimed);
+    BUG_ON( (sys_before > 0) && (sys_after < 0) );
+    total_unclaimed_pages = sys_after;
+    d->unclaimed_pages = dom_claimed;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pages)
+{
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( d->unclaimed_pages )
+        return d->tot_pages -= pages;
+
+    spin_lock(&heap_lock);
+    d->tot_pages -= pages;
+    d->unclaimed_pages += pages;
+    total_unclaimed_pages += pages;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
+                                unsigned long flags)
+{
+    int ret = -ENOMEM;
+    unsigned long claim, avail_pages;
+
+    /*
+     * take the domain's page_alloc_lock, else all increases/decreases
+     * must always take the global heap_lock rather than only in the much
+     * rarer case that d->unclaimed_pages is non-zero
+     */
+    ASSERT(!spin_is_locked(&d->page_alloc_lock));
+    spin_lock(&d->page_alloc_lock);
+    ASSERT(!spin_is_locked(&heap_lock));
+    spin_lock(&heap_lock);
+
+    /* pages==0 means "unset" the claim (and flags is ignored) */
+    if ( pages == 0 )
+    {
+        total_unclaimed_pages -= d->unclaimed_pages;
+        d->unclaimed_pages = 0;
+        ret = 0;
+        goto out;
+    }
+
+    /* only one active claim per domain please */
+    if ( d->unclaimed_pages )
+    {
+        ret = -EINVAL;
+        goto out;
+    }
+
+    /* disallow a claim not exceeding current tot_pages or above max_pages */
+    if ( (pages <= d->tot_pages) || (pages > d->max_pages) )
+    {
+        ret = -EINVAL;
+        goto out;
+    }
+
+    /* how much memory is available? */
+    avail_pages = total_avail_pages;
+    if ( !(flags & XENMEM_CLAIMF_free_only) )
+        avail_pages += tmem_freeable_pages();
+    avail_pages -= total_unclaimed_pages;
+
+    /*
+     * note, if domain has already allocated memory before making a claim 
+     * then the claim must take tot_pages into account
+     */
+    claim = pages - d->tot_pages;
+    if ( claim > avail_pages )
+        goto out;
+
+    /* yay, claim fits in available memory, stake the claim, success! */
+    d->unclaimed_pages = claim;
+    total_unclaimed_pages += d->unclaimed_pages;
+    ret = 0;
+
+out:
+    spin_unlock(&heap_lock);
+    spin_unlock(&d->page_alloc_lock);
+    return ret;
+}
+
+long get_total_unclaimed_pages(void)
+{
+    return total_unclaimed_pages;
+}
 
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
@@ -443,6 +550,15 @@ static struct page_info *alloc_heap_pages(
     spin_lock(&heap_lock);
 
     /*
+     * Claimed memory is considered unavailable unless the request
+     * is made by a domain with sufficient unclaimed pages.
+     */
+    if ( (total_unclaimed_pages + request >
+           total_avail_pages + tmem_freeable_pages()) &&
+          (d == NULL || d->unclaimed_pages < request) )
+        goto not_found;
+
+    /*
      * TMEM: When available memory is scarce due to tmem absorbing it, allow
      * only mid-size allocations to avoid worst of fragmentation issues.
      * Others try tmem pools then fail.  This is a workaround until all
@@ -1291,7 +1407,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages == 0) )
             get_knownalive_domain(d);
 
-        d->tot_pages += 1 << order;
+        domain_increase_tot_pages(d, 1 << order);
     }
 
     for ( i = 0; i < (1 << order); i++ )
@@ -1375,7 +1491,7 @@ void free_domheap_pages(struct page_info *pg, unsigned int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
 
-        d->tot_pages -= 1 << order;
+        domain_decrease_tot_pages(d, 1 << order);
         drop_dom_ref = (d->tot_pages == 0);
 
         spin_unlock_recursive(&d->page_alloc_lock);
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index f2409ec..118f24a 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -36,7 +36,7 @@
 #include "grant_table.h"
 #include "hvm/save.h"
 
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000009
 
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -95,6 +95,7 @@ struct xen_domctl_getdomaininfo {
     uint32_t flags;              /* XEN_DOMINF_* */
     uint64_aligned_t tot_pages;
     uint64_aligned_t max_pages;
+    uint64_aligned_t unclaimed_pages;
     uint64_aligned_t shr_pages;
     uint64_aligned_t paged_pages;
     uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index f1ddbc0..15d6c72 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -68,6 +68,8 @@ struct xen_memory_reservation {
      *   IN:  GPFN bases of extents to populate with memory
      *   OUT: GMFN bases of extents that were allocated
      *   (NB. This command also updates the mach_to_phys translation table)
+     * XENMEM_claim_pages:
+     *   IN: must be zero
      */
     XEN_GUEST_HANDLE(xen_pfn_t) extent_start;
 
@@ -421,6 +423,43 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
 
+/*
+ * Attempt to stake a claim for a domain on a quantity of pages
+ * of system RAM, but _not_ assign specific pageframes.  Only
+ * arithmetic is performed so the hypercall is very fast and need
+ * not be preemptible, thus sidestepping time-of-check-time-of-use
+ * races for memory allocation.  Returns 0 if the hypervisor page
+ * allocator has atomically and successfully claimed the requested
+ * number of pages, else non-zero.
+ *
+ * Any domain may have only one active claim.  When sufficient memory
+ * has been allocated to resolve the claim, the claim silently expires.
+ * Claiming zero pages effectively resets any outstanding claim and
+ * is always successful.
+ *
+ * Note that a valid claim may be staked even after memory has been
+ * allocated for a domain.  In this case, the claim is not incremental,
+ * i.e. if the domain's tot_pages is 3, and a claim is staked for 10,
+ * only 7 additional pages are claimed.
+ *
+ * Caller must be privileged or the hypercall fails.
+ */
+#define XENMEM_claim_pages                  24
+/*
+ * XENMEM_claim_pages flags:
+ *  free_only: claim is successful only if sufficient free pages
+ *    are available.  If not set and tmem is enabled, hypervisor
+ *    may also consider tmem "freeable" pages to satisfy the claim.
+ */
+#define _XENMEM_CLAIMF_free_only            0
+#define XENMEM_CLAIMF_free_only             (1U<<_XENMEM_CLAIMF_free_only)
+/*
+ * Get the number of pages currently claimed (but not yet "possessed")
+ * across all domains.  The caller must be privileged but otherwise
+ * the call never fails. 
+ */
+#define XENMEM_get_unclaimed_pages            25
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
 
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 64a0cc1..b4dee92 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,13 @@ void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
 
+/* Claim handling */
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pages);
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pages);
+int domain_set_unclaimed_pages(
+    struct domain *d, unsigned long pages, unsigned long flags);
+long get_total_unclaimed_pages(void);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..480ef39 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -242,6 +242,7 @@ struct domain
     struct page_list_head page_list;  /* linked list */
     struct page_list_head xenpage_list; /* linked list (size xenheap_pages) */
     unsigned int     tot_pages;       /* number of pages currently possesed */
+    unsigned int     unclaimed_pages; /* pages claimed but not possessed    */
     unsigned int     max_pages;       /* maximum value for tot_pages        */
     atomic_t         shr_pages;       /* number of shared pages             */
     atomic_t         paged_pages;     /* number of paged-out pages          */


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 21:27:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 21:27:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ6xb-0008P8-7I; Thu, 15 Nov 2012 21:26:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TZ6xZ-0008P3-1n
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 21:26:53 +0000
Received: from [85.158.143.35:22569] by server-2.bemta-4.messagelabs.com id
	11/23-28922-C1E55A05; Thu, 15 Nov 2012 21:26:52 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1353014808!5679096!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NzMxMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14647 invoked from network); 15 Nov 2012 21:26:50 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-4.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 21:26:50 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFLQjrP010743
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 21:26:46 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFLQim5018428
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 21:26:45 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFLQihN018812; Thu, 15 Nov 2012 15:26:44 -0600
MIME-Version: 1.0
Message-ID: <2025804e-1722-44f9-abdc-c8d0e13a23c3@default>
Date: Thu, 15 Nov 2012 13:26:39 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [RFC/PATCH v3] XENMEM_claim_pages (subop of existing)
	hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a third cut of the hypervisor patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account
feedback from Jan and Keir and IanC, plus some fixes found
via runtime debugging (using privcmd only) and some
added comments/cleanup.

[Logistical note: I will be out tomorrow (Friday) plus
US holidays next week so my responsiveness will be slower
for awhile. --djm]

v2->v3:
- Add per-domain and global "get" for unclaimed info [JBeulich]
- New hypercall(s) should fail for unpriv callers [IanC]
- Non-zero extent_order disallowed [JBeulich]
- Remove bonehead ASSERTs [JBeulich]
- Need not hold heaplock for decrease case too [JBeulich]
- More descriptive failure return values [JBeulich]
- Don't allow a claim to exceed max_pages [IanC]
- Subops must be in correct ifdef block in memory.c [keir]

v1->v2:
- Add reset-to-zero page claim in domain_kill [JBeulich]
- Proper handling of struct passed to hypercall [JBeulich]
- Fix alloc_heap_pages when a domain has a claim [JBeulich]
- Need not hold heap_lock if !d->unclaimed_pages [keir]
- Fix missed tot_pages call in donate_page [djm]
- Remove domain_reset_unclaimed_pages; use set with zero [djm]
- Bugfixes found through testing in set_unclaimed [djm]
- More comments in code [djm]
- Code formatting fixes [djm]

===

Motivation:

The goal of this hypercall
is to attempt to atomically and very quickly determine if
there are sufficient pages available in the system and, if
so, "set aside" that quantity of pages for future allocations
by that domain.  Unlike an existing hypercall such as
increase_reservation or populate_physmap, specific physical
pageframes are not assigned to the domain because this
cannot be done sufficiently quickly (especially for very large
allocations in an arbitrarily fragmented system) and so the
existing mechanisms result in classic time-of-check-time-of-use
(TOCTOU) races.  One can think of claiming as similar to a
"lazy" allocation, but subsequent hypercalls are required
to do the actual physical pageframe allocation.

I don't have a patch for the toolstack side, but I envision
a "xl create --claim" option to maximize backwards
compatibility while minimizing impact on existing toolstacks.
As a result, testing has (so far) only been done via privcmd.

Code overview:

Though the hypercall simply does arithmetic within locks,
some of the semantics in the code may be a bit subtle
so let me explain a bit.

The key variables (d->unclaimed_pages and total_unclaimed_pages)
start at zero if no claim has yet been staked for any domain.
(Perhaps a better name is "claimed_but_not_yet_possessed" but that's
a bit unwieldy.)  If no claim hypercalls are executed, there
should be no impact on existing usage.

When a claim is successfully staked by a domain, it is like a
watermark but there is no record kept of the size of the claim.
Instead, d->unclaimed_pages is set to the difference between
d->tot_pages and the claim (d->tot_pages may normally be zero
but see Note 1).  When d->tot_pages increases or decreases,
d->unclaimed_pages atomically decreases or increases.  Once
d->unclaimed_pages reaches zero, the claim is satisfied and
d->unclaimed pages stays at zero -- unless a new claim is
subsequently staked.  See Note 2.

The systemwide variable total_unclaimed_pages is always the sum
of d->unclaimed_pages, across all domains.  A non-domain-
specific heap allocation will fail if total_unclaimed_pages
exceeds free (plus, on tmem enabled systems, freeable) pages.

Claim semantics may be modified by flags.  The initial
implementation has one flag, which discerns whether the
caller would like tmem freeable pages to be considered
in determining whether or not the claim can be successfully
staked. Future flags may, for example, specify that the
caller would like the claim to be successful only if there
are sufficient pages available on a single node (per Dario's
suggestion).

Note 1: Tim: I'm thinking this may resolve your concern that
the claim mechanism must be more complicated to handle
restricted memory allocations and order>0 allocations.
The proposed claim mechanism only guarantees a quantity of
order==0 pages; if restricted allocations are required, these
are done first by the toolstack, and followed by the claim.
Order>0 allocations still work if memory is not fragmented,
but the claim mechanism doesn't guarantee anything but
a quantity of order==0 pages.

Note 2: Tim: This arithmetic also indirectly implements the
"claim auto-expire" discussed earlier.  We certainly don't
want a negative claim.  Unclaim is done by requesting
a claim of zero pages.

Note 3: There is currently no way to observe a staked claim,
so a staked claim will not survive a save/restore/migrate.
Not clear yet if this is needed but could be added.

Thanks for any feedback!

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 tools/libxc/xc_domain.c       |    1 
 tools/libxc/xenctrl.h         |    1 
 xen/arch/x86/mm.c             |    2 
 xen/arch/x86/mm/mem_sharing.c |    4 -
 xen/common/domain.c           |    1 
 xen/common/domctl.c           |    1 
 xen/common/grant_table.c      |    2 
 xen/common/memory.c           |   33 +++++++++++
 xen/common/page_alloc.c       |  120 +++++++++++++++++++++++++++++++++++++++++-
 xen/include/public/domctl.h   |    3 -
 xen/include/public/memory.h   |   39 +++++++++++++
 xen/include/xen/mm.h          |    7 ++
 xen/include/xen/sched.h       |    1 
 13 files changed, 207 insertions(+), 8 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index d98e68b..6d06f7c 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -234,6 +234,7 @@ int xc_domain_getinfo(xc_interface *xch,
 
         info->ssidref  = domctl.u.getdomaininfo.ssidref;
         info->nr_pages = domctl.u.getdomaininfo.tot_pages;
+        info->nr_unclaimed_pages = domctl.u.getdomaininfo.unclaimed_pages;
         info->nr_shared_pages = domctl.u.getdomaininfo.shr_pages;
         info->nr_paged_pages = domctl.u.getdomaininfo.paged_pages;
         info->max_memkb = domctl.u.getdomaininfo.max_pages << (PAGE_SHIFT-10);
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..325f4a3 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -364,6 +364,7 @@ typedef struct xc_dominfo {
                   hvm:1, debugged:1;
     unsigned int  shutdown_reason; /* only meaningful if shutdown==1 */
     unsigned long nr_pages; /* current number, not maximum */
+    unsigned long nr_unclaimed_pages;
     unsigned long nr_shared_pages;
     unsigned long nr_paged_pages;
     unsigned long shared_info_frame;
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fad3d33..7e55908 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3841,7 +3841,7 @@ int donate_page(
     {
         if ( d->tot_pages >= d->max_pages )
             goto fail;
-        d->tot_pages++;
+        domain_increase_tot_pages(d, 1);
     }
 
     page->count_info = PGC_allocated | 1;
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..943a3b5 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d,
     }
 
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_decrease_tot_pages(d, 1);
     drop_dom_ref = (d->tot_pages == 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct page_info *page)
     ASSERT(page_get_owner(page) == dom_cow);
     page_set_owner(page, d);
 
-    if ( d->tot_pages++ == 0 )
+    if ( domain_increase_tot_pages(d, 1) == 0 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0e3e36a..95509e2 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -492,6 +492,7 @@ int domain_kill(struct domain *d)
         evtchn_destroy(d);
         gnttab_release_mappings(d);
         tmem_destroy(d->tmem);
+        domain_set_unclaimed_pages(d, 0, 0);
         d->tmem = NULL;
         /* fallthrough */
     case DOMDYING_dying:
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index e153cb4..19e3930 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -154,6 +154,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
 
     info->tot_pages         = d->tot_pages;
     info->max_pages         = d->max_pages;
+    info->unclaimed_pages   = d->unclaimed_pages;
     info->shr_pages         = atomic_read(&d->shr_pages);
     info->paged_pages       = atomic_read(&d->paged_pages);
     info->shared_info_frame = mfn_to_gmfn(d, __pa(d->shared_info)>>PAGE_SHIFT);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..10ce78f 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1656,7 +1656,7 @@ gnttab_transfer(
         }
 
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ == 0) )
+        if ( unlikely(domain_increase_tot_pages(e, 1) == 0) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..a9d91c1 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
 
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -= dec_count;
+                domain_decrease_tot_pages(d, dec_count);
                 drop_dom_ref = (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
 
@@ -685,6 +685,37 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
     }
 
+    case XENMEM_claim_pages:
+        if ( !(IS_PRIV(current->domain)) )
+            return -EPERM;
+
+        if ( copy_from_guest(&reservation, arg, 1) )
+            return -EFAULT;
+
+        if ( !(guest_handle_is_null(reservation.extent_start)) )
+            return -EINVAL;
+
+        if ( reservation.extent_order != 0 )
+            return -EINVAL;
+
+        rc = rcu_lock_target_domain_by_id(reservation.domid, &d);
+        if ( rc )
+            return rc;
+
+        rc = domain_set_unclaimed_pages(d, reservation.nr_extents,
+                                        reservation.mem_flags);
+
+        rcu_unlock_domain(d);
+
+        break;
+
+    case XENMEM_get_unclaimed_pages:
+        if ( !(IS_PRIV(current->domain)) )
+            return -EPERM;
+
+        rc = get_total_unclaimed_pages();
+        break;
+
     default:
         rc = arch_memory_op(op, arg);
         break;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 15ebc66..79a2065 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -238,6 +238,113 @@ static long midsize_alloc_zone_pages;
 #define MIDSIZE_ALLOC_FRAC 128
 
 static DEFINE_SPINLOCK(heap_lock);
+static long total_unclaimed_pages; /* total outstanding claims by all domains */
+
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pages)
+{
+    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
+
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages += pages;
+    spin_lock(&heap_lock);
+    dom_before = d->unclaimed_pages;
+    dom_after = dom_before - pages;
+    if ( (dom_before > 0) && (dom_after < 0) )
+        dom_claimed = 0;
+    else
+        dom_claimed = dom_after;
+    sys_before = total_unclaimed_pages;
+    sys_after = sys_before - (dom_before - dom_claimed);
+    BUG_ON( (sys_before > 0) && (sys_after < 0) );
+    total_unclaimed_pages = sys_after;
+    d->unclaimed_pages = dom_claimed;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pages)
+{
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( d->unclaimed_pages )
+        return d->tot_pages -= pages;
+
+    spin_lock(&heap_lock);
+    d->tot_pages -= pages;
+    d->unclaimed_pages += pages;
+    total_unclaimed_pages += pages;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
+                                unsigned long flags)
+{
+    int ret = -ENOMEM;
+    unsigned long claim, avail_pages;
+
+    /*
+     * take the domain's page_alloc_lock, else all increases/decreases
+     * must always take the global heap_lock rather than only in the much
+     * rarer case that d->unclaimed_pages is non-zero
+     */
+    ASSERT(!spin_is_locked(&d->page_alloc_lock));
+    spin_lock(&d->page_alloc_lock);
+    ASSERT(!spin_is_locked(&heap_lock));
+    spin_lock(&heap_lock);
+
+    /* pages==0 means "unset" the claim (and flags is ignored) */
+    if ( pages == 0 )
+    {
+        total_unclaimed_pages -= d->unclaimed_pages;
+        d->unclaimed_pages = 0;
+        ret = 0;
+        goto out;
+    }
+
+    /* only one active claim per domain please */
+    if ( d->unclaimed_pages )
+    {
+        ret = -EINVAL;
+        goto out;
+    }
+
+    /* disallow a claim not exceeding current tot_pages or above max_pages */
+    if ( (pages <= d->tot_pages) || (pages > d->max_pages) )
+    {
+        ret = -EINVAL;
+        goto out;
+    }
+
+    /* how much memory is available? */
+    avail_pages = total_avail_pages;
+    if ( !(flags & XENMEM_CLAIMF_free_only) )
+        avail_pages += tmem_freeable_pages();
+    avail_pages -= total_unclaimed_pages;
+
+    /*
+     * note, if domain has already allocated memory before making a claim 
+     * then the claim must take tot_pages into account
+     */
+    claim = pages - d->tot_pages;
+    if ( claim > avail_pages )
+        goto out;
+
+    /* yay, claim fits in available memory, stake the claim, success! */
+    d->unclaimed_pages = claim;
+    total_unclaimed_pages += d->unclaimed_pages;
+    ret = 0;
+
+out:
+    spin_unlock(&heap_lock);
+    spin_unlock(&d->page_alloc_lock);
+    return ret;
+}
+
+long get_total_unclaimed_pages(void)
+{
+    return total_unclaimed_pages;
+}
 
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
@@ -443,6 +550,15 @@ static struct page_info *alloc_heap_pages(
     spin_lock(&heap_lock);
 
     /*
+     * Claimed memory is considered unavailable unless the request
+     * is made by a domain with sufficient unclaimed pages.
+     */
+    if ( (total_unclaimed_pages + request >
+           total_avail_pages + tmem_freeable_pages()) &&
+          (d == NULL || d->unclaimed_pages < request) )
+        goto not_found;
+
+    /*
      * TMEM: When available memory is scarce due to tmem absorbing it, allow
      * only mid-size allocations to avoid worst of fragmentation issues.
      * Others try tmem pools then fail.  This is a workaround until all
@@ -1291,7 +1407,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages == 0) )
             get_knownalive_domain(d);
 
-        d->tot_pages += 1 << order;
+        domain_increase_tot_pages(d, 1 << order);
     }
 
     for ( i = 0; i < (1 << order); i++ )
@@ -1375,7 +1491,7 @@ void free_domheap_pages(struct page_info *pg, unsigned int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
 
-        d->tot_pages -= 1 << order;
+        domain_decrease_tot_pages(d, 1 << order);
         drop_dom_ref = (d->tot_pages == 0);
 
         spin_unlock_recursive(&d->page_alloc_lock);
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index f2409ec..118f24a 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -36,7 +36,7 @@
 #include "grant_table.h"
 #include "hvm/save.h"
 
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000009
 
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -95,6 +95,7 @@ struct xen_domctl_getdomaininfo {
     uint32_t flags;              /* XEN_DOMINF_* */
     uint64_aligned_t tot_pages;
     uint64_aligned_t max_pages;
+    uint64_aligned_t unclaimed_pages;
     uint64_aligned_t shr_pages;
     uint64_aligned_t paged_pages;
     uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index f1ddbc0..15d6c72 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -68,6 +68,8 @@ struct xen_memory_reservation {
      *   IN:  GPFN bases of extents to populate with memory
      *   OUT: GMFN bases of extents that were allocated
      *   (NB. This command also updates the mach_to_phys translation table)
+     * XENMEM_claim_pages:
+     *   IN: must be zero
      */
     XEN_GUEST_HANDLE(xen_pfn_t) extent_start;
 
@@ -421,6 +423,43 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
 
+/*
+ * Attempt to stake a claim for a domain on a quantity of pages
+ * of system RAM, but _not_ assign specific pageframes.  Only
+ * arithmetic is performed so the hypercall is very fast and need
+ * not be preemptible, thus sidestepping time-of-check-time-of-use
+ * races for memory allocation.  Returns 0 if the hypervisor page
+ * allocator has atomically and successfully claimed the requested
+ * number of pages, else non-zero.
+ *
+ * Any domain may have only one active claim.  When sufficient memory
+ * has been allocated to resolve the claim, the claim silently expires.
+ * Claiming zero pages effectively resets any outstanding claim and
+ * is always successful.
+ *
+ * Note that a valid claim may be staked even after memory has been
+ * allocated for a domain.  In this case, the claim is not incremental,
+ * i.e. if the domain's tot_pages is 3, and a claim is staked for 10,
+ * only 7 additional pages are claimed.
+ *
+ * Caller must be privileged or the hypercall fails.
+ */
+#define XENMEM_claim_pages                  24
+/*
+ * XENMEM_claim_pages flags:
+ *  free_only: claim is successful only if sufficient free pages
+ *    are available.  If not set and tmem is enabled, hypervisor
+ *    may also consider tmem "freeable" pages to satisfy the claim.
+ */
+#define _XENMEM_CLAIMF_free_only            0
+#define XENMEM_CLAIMF_free_only             (1U<<_XENMEM_CLAIMF_free_only)
+/*
+ * Get the number of pages currently claimed (but not yet "possessed")
+ * across all domains.  The caller must be privileged but otherwise
+ * the call never fails. 
+ */
+#define XENMEM_get_unclaimed_pages            25
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
 
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 64a0cc1..b4dee92 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,13 @@ void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
 
+/* Claim handling */
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pages);
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pages);
+int domain_set_unclaimed_pages(
+    struct domain *d, unsigned long pages, unsigned long flags);
+long get_total_unclaimed_pages(void);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..480ef39 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -242,6 +242,7 @@ struct domain
     struct page_list_head page_list;  /* linked list */
     struct page_list_head xenpage_list; /* linked list (size xenheap_pages) */
     unsigned int     tot_pages;       /* number of pages currently possesed */
+    unsigned int     unclaimed_pages; /* pages claimed but not possessed    */
     unsigned int     max_pages;       /* maximum value for tot_pages        */
     atomic_t         shr_pages;       /* number of shared pages             */
     atomic_t         paged_pages;     /* number of paged-out pages          */


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 22:42:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 22:42:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ87v-0001WJ-OU; Thu, 15 Nov 2012 22:41:39 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TZ87u-0001Vo-KO
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 22:41:38 +0000
Received: from [85.158.143.99:10994] by server-1.bemta-4.messagelabs.com id
	39/9C-27934-2AF65A05; Thu, 15 Nov 2012 22:41:38 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1353019296!26750957!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1747 invoked from network); 15 Nov 2012 22:41:37 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 22:41:37 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFMfWb1013422
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 22:41:34 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFMfWYc016059
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 22:41:32 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFMfV3D007656; Thu, 15 Nov 2012 16:41:31 -0600
MIME-Version: 1.0
Message-ID: <989cc975-a7e0-4a3e-8283-3cc3a772775b@default>
Date: Thu, 15 Nov 2012 14:41:27 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>, Jan Beulich
	<JBeulich@suse.com>, Keir Fraser <keir@xen.org>,
	TimDeegan <tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
References: <2025804e-1722-44f9-abdc-c8d0e13a23c3@default>
In-Reply-To: <2025804e-1722-44f9-abdc-c8d0e13a23c3@default>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH v3] XENMEM_claim_pages (subop of
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Dan Magenheimer
> Subject: [RFC/PATCH v3] XENMEM_claim_pages (subop of existing) hypercall
> 
> This is a third cut of the hypervisor patch of the proposed

Oops, very sorry, I accidentally cut/paste a slightly stale
version of this patch (a missing "!" and two !spin_is_lockeds()).
I will send out v4 shortly with these three lines fixed.

Sorry for any inconvenience!
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 22:42:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 22:42:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ87v-0001WJ-OU; Thu, 15 Nov 2012 22:41:39 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TZ87u-0001Vo-KO
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 22:41:38 +0000
Received: from [85.158.143.99:10994] by server-1.bemta-4.messagelabs.com id
	39/9C-27934-2AF65A05; Thu, 15 Nov 2012 22:41:38 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1353019296!26750957!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1747 invoked from network); 15 Nov 2012 22:41:37 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 15 Nov 2012 22:41:37 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFMfWb1013422
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 22:41:34 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFMfWYc016059
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 22:41:32 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFMfV3D007656; Thu, 15 Nov 2012 16:41:31 -0600
MIME-Version: 1.0
Message-ID: <989cc975-a7e0-4a3e-8283-3cc3a772775b@default>
Date: Thu, 15 Nov 2012 14:41:27 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>, Jan Beulich
	<JBeulich@suse.com>, Keir Fraser <keir@xen.org>,
	TimDeegan <tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
References: <2025804e-1722-44f9-abdc-c8d0e13a23c3@default>
In-Reply-To: <2025804e-1722-44f9-abdc-c8d0e13a23c3@default>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH v3] XENMEM_claim_pages (subop of
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Dan Magenheimer
> Subject: [RFC/PATCH v3] XENMEM_claim_pages (subop of existing) hypercall
> 
> This is a third cut of the hypervisor patch of the proposed

Oops, very sorry, I accidentally cut/paste a slightly stale
version of this patch (a missing "!" and two !spin_is_lockeds()).
I will send out v4 shortly with these three lines fixed.

Sorry for any inconvenience!
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 23:05:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 23:05:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ8UC-0001yQ-D0; Thu, 15 Nov 2012 23:04:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <aravindh@virtuata.com>) id 1TZ8UA-0001yL-Sl
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 23:04:39 +0000
Received: from [193.109.254.147:31156] by server-2.bemta-14.messagelabs.com id
	86/9A-20829-60575A05; Thu, 15 Nov 2012 23:04:38 +0000
X-Env-Sender: aravindh@virtuata.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353020676!8472709!1
X-Originating-IP: [209.85.216.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13530 invoked from network); 15 Nov 2012 23:04:37 -0000
Received: from mail-qa0-f43.google.com (HELO mail-qa0-f43.google.com)
	(209.85.216.43)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 23:04:37 -0000
Received: by mail-qa0-f43.google.com with SMTP id a16so3483928qae.9
	for <xen-devel@lists.xensource.com>;
	Thu, 15 Nov 2012 15:04:36 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:x-originating-ip:in-reply-to:references:date
	:message-id:subject:from:to:cc:content-type:x-gm-message-state;
	bh=I7EmDY8XBUHN0n10Xi+ENOh9Cj+2j6czSl7S8sLqj0o=;
	b=lqYF+RYv2FpeOQQ1gO8pRQnGLs4iVAp2b/R9xU/ik194nAVW5kgIRRDkMmb4fhQ2Gf
	UMNjEQx0Gqgem51nysD/hpS/2FZUrTH6Kg+uXEKrMBEqBCW2eXqX+ZhIlmk5OO5jZdub
	KZayL8A57PLSumdDJ5bWAc+SDPkEgATaAvxjRoGlz/rjDoa5IwGZnOddjYZ17eUsFKxs
	+YLOPemjH3xlH1ChmWjHXXVe6Ese23+5nQ0hnRz5qSPhkFE5ItYqAhnQ0HkmzztWWW/K
	LkM2K+FkvW5TeWYzLWG+cruNuWdiSFoAf2hBU4rVUTSgMA3PeQdQQ/SyfAcMSKtFagkC
	a7CA==
MIME-Version: 1.0
Received: by 10.49.51.7 with SMTP id g7mr2860655qeo.34.1353020676197; Thu, 15
	Nov 2012 15:04:36 -0800 (PST)
Received: by 10.49.13.42 with HTTP; Thu, 15 Nov 2012 15:04:36 -0800 (PST)
X-Originating-IP: [128.107.239.234]
In-Reply-To: <20121115120836.GA75988@ocelot.phlegethon.org>
References: <20121115120836.GA75988@ocelot.phlegethon.org>
Date: Thu, 15 Nov 2012 15:04:36 -0800
Message-ID: <CAB10MZD2vv=o-c3FQhz+hmF7omd3JhS=8SCaa1RqzhoZ6-orFg@mail.gmail.com>
From: Aravindh Puthiyaparambil <aravindh@virtuata.com>
To: Tim Deegan <tim@xen.org>
X-Gm-Message-State: ALoCoQlgEwkMZ8V1l2i8Yh80+qMd/QWZuI2dzj7w6HMG1bMEW5auSs64JeYSHG349u3/TNkoCoNU
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Cutter 409 <cutter409@gmail.com>
Subject: Re: [Xen-devel] (no subject)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 15, 2012 at 4:08 AM, Tim Deegan <tim@xen.org> wrote:
>
> Bcc: Tim Deegan <tjd-xen@phlegethon.org>
> Subject: Re: [Xen-devel] Guest memory access hooking
> Reply-To:
> In-Reply-To: <CAG4Ohu_p-vVF9ZS01PeMqHvscCrrO+UDawK-noaaP8k+MuqHrQ@mail.gmail.com>
>
> Hi,
>
> At 10:56 -0500 on 13 Nov (1352804161), Cutter 409 wrote:
> > I'm trying to do some research with malware, and I'm trying to get
> > notifications on arbitrary guest page accesses (similar to what Ether
> > does.) I've noticed the mem-event API and it seems like it might be close
> > to what I need, but I can't find much documentation about how it works or
> > how to use it.
>
> Yes, the mem-event api, and in particular the HVMOP_set_mem_access
> hypercall, looks like what you want.  As you say, there isn't much
> documentation for it, except the xen-access.c client and the mailing
> list archive.
>
> CC'ing Aravindh, who has worked on this code most recently and might be
> able to help with specific questions.

Sure, I can help with the specifics of the API usage.

> > I know that that mem-event API works only with EPT, but is the code to
> > change permissions modifying the guest page tables, or does it work via
> > EPT? (Can the guest detect it?)
>
> It works by EPT.  The guest can't detect it by looking at its pagetables
> or page fault patterns, though it might be able to detect it by looking
> at timings.
>
> > I'm also interested monitoring arbitrary page access via the shadow page
> > tables. I've been reading through the code, but if anyone has any insight
> > or some kind of push in the right direction, I'd really appreciate it.

It might be useful to get mem-event working with shadow by following
Tim's suggestions to achieve what you are after.

Thanks,
Aravindh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 23:05:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 23:05:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ8UC-0001yQ-D0; Thu, 15 Nov 2012 23:04:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <aravindh@virtuata.com>) id 1TZ8UA-0001yL-Sl
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 23:04:39 +0000
Received: from [193.109.254.147:31156] by server-2.bemta-14.messagelabs.com id
	86/9A-20829-60575A05; Thu, 15 Nov 2012 23:04:38 +0000
X-Env-Sender: aravindh@virtuata.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353020676!8472709!1
X-Originating-IP: [209.85.216.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13530 invoked from network); 15 Nov 2012 23:04:37 -0000
Received: from mail-qa0-f43.google.com (HELO mail-qa0-f43.google.com)
	(209.85.216.43)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 23:04:37 -0000
Received: by mail-qa0-f43.google.com with SMTP id a16so3483928qae.9
	for <xen-devel@lists.xensource.com>;
	Thu, 15 Nov 2012 15:04:36 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:x-originating-ip:in-reply-to:references:date
	:message-id:subject:from:to:cc:content-type:x-gm-message-state;
	bh=I7EmDY8XBUHN0n10Xi+ENOh9Cj+2j6czSl7S8sLqj0o=;
	b=lqYF+RYv2FpeOQQ1gO8pRQnGLs4iVAp2b/R9xU/ik194nAVW5kgIRRDkMmb4fhQ2Gf
	UMNjEQx0Gqgem51nysD/hpS/2FZUrTH6Kg+uXEKrMBEqBCW2eXqX+ZhIlmk5OO5jZdub
	KZayL8A57PLSumdDJ5bWAc+SDPkEgATaAvxjRoGlz/rjDoa5IwGZnOddjYZ17eUsFKxs
	+YLOPemjH3xlH1ChmWjHXXVe6Ese23+5nQ0hnRz5qSPhkFE5ItYqAhnQ0HkmzztWWW/K
	LkM2K+FkvW5TeWYzLWG+cruNuWdiSFoAf2hBU4rVUTSgMA3PeQdQQ/SyfAcMSKtFagkC
	a7CA==
MIME-Version: 1.0
Received: by 10.49.51.7 with SMTP id g7mr2860655qeo.34.1353020676197; Thu, 15
	Nov 2012 15:04:36 -0800 (PST)
Received: by 10.49.13.42 with HTTP; Thu, 15 Nov 2012 15:04:36 -0800 (PST)
X-Originating-IP: [128.107.239.234]
In-Reply-To: <20121115120836.GA75988@ocelot.phlegethon.org>
References: <20121115120836.GA75988@ocelot.phlegethon.org>
Date: Thu, 15 Nov 2012 15:04:36 -0800
Message-ID: <CAB10MZD2vv=o-c3FQhz+hmF7omd3JhS=8SCaa1RqzhoZ6-orFg@mail.gmail.com>
From: Aravindh Puthiyaparambil <aravindh@virtuata.com>
To: Tim Deegan <tim@xen.org>
X-Gm-Message-State: ALoCoQlgEwkMZ8V1l2i8Yh80+qMd/QWZuI2dzj7w6HMG1bMEW5auSs64JeYSHG349u3/TNkoCoNU
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Cutter 409 <cutter409@gmail.com>
Subject: Re: [Xen-devel] (no subject)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 15, 2012 at 4:08 AM, Tim Deegan <tim@xen.org> wrote:
>
> Bcc: Tim Deegan <tjd-xen@phlegethon.org>
> Subject: Re: [Xen-devel] Guest memory access hooking
> Reply-To:
> In-Reply-To: <CAG4Ohu_p-vVF9ZS01PeMqHvscCrrO+UDawK-noaaP8k+MuqHrQ@mail.gmail.com>
>
> Hi,
>
> At 10:56 -0500 on 13 Nov (1352804161), Cutter 409 wrote:
> > I'm trying to do some research with malware, and I'm trying to get
> > notifications on arbitrary guest page accesses (similar to what Ether
> > does.) I've noticed the mem-event API and it seems like it might be close
> > to what I need, but I can't find much documentation about how it works or
> > how to use it.
>
> Yes, the mem-event api, and in particular the HVMOP_set_mem_access
> hypercall, looks like what you want.  As you say, there isn't much
> documentation for it, except the xen-access.c client and the mailing
> list archive.
>
> CC'ing Aravindh, who has worked on this code most recently and might be
> able to help with specific questions.

Sure, I can help with the specifics of the API usage.

> > I know that that mem-event API works only with EPT, but is the code to
> > change permissions modifying the guest page tables, or does it work via
> > EPT? (Can the guest detect it?)
>
> It works by EPT.  The guest can't detect it by looking at its pagetables
> or page fault patterns, though it might be able to detect it by looking
> at timings.
>
> > I'm also interested monitoring arbitrary page access via the shadow page
> > tables. I've been reading through the code, but if anyone has any insight
> > or some kind of push in the right direction, I'd really appreciate it.

It might be useful to get mem-event working with shadow by following
Tim's suggestions to achieve what you are after.

Thanks,
Aravindh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 23:18:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 23:18:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ8hF-0002Gx-UP; Thu, 15 Nov 2012 23:18:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <raistlin.df@gmail.com>) id 1TZ8hE-0002Gs-Tf
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 23:18:09 +0000
Received: from [85.158.139.211:25845] by server-14.bemta-5.messagelabs.com id
	83/04-21768-03875A05; Thu, 15 Nov 2012 23:18:08 +0000
X-Env-Sender: raistlin.df@gmail.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353021487!20309053!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30040 invoked from network); 15 Nov 2012 23:18:07 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 23:18:07 -0000
Received: by mail-ee0-f45.google.com with SMTP id d49so1531987eek.32
	for <xen-devel@lists.xen.org>; Thu, 15 Nov 2012 15:18:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:subject:from:to:cc:date:in-reply-to:references
	:content-type:x-mailer:mime-version;
	bh=GTNva8fFSCGqTi0oeNFFCKHzpmioySfTlOkyNJyrBcw=;
	b=j/si8U2zt3tB41GoG+I2dqLFh805BgOhtf6Hw3n1pTt9CjF9JbP7mthykKUgmFY5Hi
	tS6RvGYQH6R1fVVsIOallmiQ2s+rLiARiBNDvK51KfCJcPVJlV94x2lrN+WLaVavc8t2
	/76t9nYyEQCHy9i6g6DjHSSk9uRbezZ40kgLeKwLFbGsmqBd5ix4dquWA8HBB//4lKzC
	JWX2p6QOwrI+IqhKMgWKszRh2eZyLPrCEnvrFtu299lG4TeV+f6WDX0FxDthdCugxyUg
	1yYAfwgYQOqJcerV4VDRyh9PWAyfFI0M4I0vBjI+rWjfzrdaPgGMJwaKeEoiSMfgDjqZ
	0YEw==
Received: by 10.14.221.9 with SMTP id q9mr8355069eep.3.1353021487333;
	Thu, 15 Nov 2012 15:18:07 -0800 (PST)
Received: from [192.168.0.40] (ip-176-53.sn2.eutelia.it. [83.211.176.53])
	by mx.google.com with ESMTPS id y44sm24540336eel.14.2012.11.15.15.18.05
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 15 Nov 2012 15:18:06 -0800 (PST)
Message-ID: <1353021478.5351.68.camel@Solace>
From: Dario Faggioli <raistlin@linux.it>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Fri, 16 Nov 2012 00:17:58 +0100
In-Reply-To: <50A54815.9010402@eu.citrix.com>
References: <c58a9d3a-99e4-42ac-86c9-fbec600dee14@default>
	<50A53479.5050901@eu.citrix.com>
	<27449f60-0433-4e5f-b1fb-06914b84c6f1@default>
	<50A54815.9010402@eu.citrix.com>
X-Mailer: Evolution 3.4.4-1
Mime-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ashok Aletty <ashok.aletty@oracle.com>,
	Michael Palmeter <michael.palmeter@oracle.com>
Subject: Re: [Xen-devel] Xen credit scheduler question
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0459434827073375237=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--===============0459434827073375237==
Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature";
	boundary="=-Wa8XFbVtXYwrDtKo9HkB"


--=-Wa8XFbVtXYwrDtKo9HkB
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, 2012-11-15 at 19:52 +0000, George Dunlap wrote:

>=20
> BTW, are you familiar with Xen's cpupool functionality?  The guys at
> Fujitsu wrote it so that a customer could rent a fixed number of cores
> to a customer, who could then run as many VMs on those cores as they
> wanted.  I think licensing restrictions had something to do with that
> as well.  More about that here, if you're interested:
>  http://blog.xen.org/index.php/2012/04/23/xen-4-2-cpupools/
>
That is true, and I was right about to suggest considering cpupools for
this discussion. However, since it seems you're interested in the
difference between 'core' and 'hyperthread', cpupools also see
hyperthreads as cpus (as almost every other piece of Xen, with the only
exception of that small bit of the load balancer, as explained by
George). So, if cpu0 and cpu1 are hyperthreads of the same core, and you
put them in the same pool, you're back to square 1 and you've got to
take the 0.7 factor into account.

It is probably possible to differentiate, during accounting, the time
spent on a (busy?) hyperthread wrt the time spent on a "regular" core,
but not without modifying the scheduler. Otherwise, if HT is disturbing
too much, I've seen people turning it off (different scope and purposes,
i.e., real-time, but still), provided the BIOS offers such an option.

Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-Wa8XFbVtXYwrDtKo9HkB
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCleCYACgkQk4XaBE3IOsRJCgCfbpT7u/11vOC9cQJsqXpH2K5G
2uYAn0Te0vsRqdBzF+FgKcuj7cQ9Othz
=cJk/
-----END PGP SIGNATURE-----

--=-Wa8XFbVtXYwrDtKo9HkB--



--===============0459434827073375237==
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.xen.org
http://lists.xen.org/xen-devel

--===============0459434827073375237==--



From xen-devel-bounces@lists.xen.org Thu Nov 15 23:18:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 23:18:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ8hF-0002Gx-UP; Thu, 15 Nov 2012 23:18:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <raistlin.df@gmail.com>) id 1TZ8hE-0002Gs-Tf
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 23:18:09 +0000
Received: from [85.158.139.211:25845] by server-14.bemta-5.messagelabs.com id
	83/04-21768-03875A05; Thu, 15 Nov 2012 23:18:08 +0000
X-Env-Sender: raistlin.df@gmail.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353021487!20309053!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30040 invoked from network); 15 Nov 2012 23:18:07 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 23:18:07 -0000
Received: by mail-ee0-f45.google.com with SMTP id d49so1531987eek.32
	for <xen-devel@lists.xen.org>; Thu, 15 Nov 2012 15:18:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:subject:from:to:cc:date:in-reply-to:references
	:content-type:x-mailer:mime-version;
	bh=GTNva8fFSCGqTi0oeNFFCKHzpmioySfTlOkyNJyrBcw=;
	b=j/si8U2zt3tB41GoG+I2dqLFh805BgOhtf6Hw3n1pTt9CjF9JbP7mthykKUgmFY5Hi
	tS6RvGYQH6R1fVVsIOallmiQ2s+rLiARiBNDvK51KfCJcPVJlV94x2lrN+WLaVavc8t2
	/76t9nYyEQCHy9i6g6DjHSSk9uRbezZ40kgLeKwLFbGsmqBd5ix4dquWA8HBB//4lKzC
	JWX2p6QOwrI+IqhKMgWKszRh2eZyLPrCEnvrFtu299lG4TeV+f6WDX0FxDthdCugxyUg
	1yYAfwgYQOqJcerV4VDRyh9PWAyfFI0M4I0vBjI+rWjfzrdaPgGMJwaKeEoiSMfgDjqZ
	0YEw==
Received: by 10.14.221.9 with SMTP id q9mr8355069eep.3.1353021487333;
	Thu, 15 Nov 2012 15:18:07 -0800 (PST)
Received: from [192.168.0.40] (ip-176-53.sn2.eutelia.it. [83.211.176.53])
	by mx.google.com with ESMTPS id y44sm24540336eel.14.2012.11.15.15.18.05
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 15 Nov 2012 15:18:06 -0800 (PST)
Message-ID: <1353021478.5351.68.camel@Solace>
From: Dario Faggioli <raistlin@linux.it>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Fri, 16 Nov 2012 00:17:58 +0100
In-Reply-To: <50A54815.9010402@eu.citrix.com>
References: <c58a9d3a-99e4-42ac-86c9-fbec600dee14@default>
	<50A53479.5050901@eu.citrix.com>
	<27449f60-0433-4e5f-b1fb-06914b84c6f1@default>
	<50A54815.9010402@eu.citrix.com>
X-Mailer: Evolution 3.4.4-1
Mime-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ashok Aletty <ashok.aletty@oracle.com>,
	Michael Palmeter <michael.palmeter@oracle.com>
Subject: Re: [Xen-devel] Xen credit scheduler question
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0459434827073375237=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--===============0459434827073375237==
Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature";
	boundary="=-Wa8XFbVtXYwrDtKo9HkB"


--=-Wa8XFbVtXYwrDtKo9HkB
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, 2012-11-15 at 19:52 +0000, George Dunlap wrote:

>=20
> BTW, are you familiar with Xen's cpupool functionality?  The guys at
> Fujitsu wrote it so that a customer could rent a fixed number of cores
> to a customer, who could then run as many VMs on those cores as they
> wanted.  I think licensing restrictions had something to do with that
> as well.  More about that here, if you're interested:
>  http://blog.xen.org/index.php/2012/04/23/xen-4-2-cpupools/
>
That is true, and I was right about to suggest considering cpupools for
this discussion. However, since it seems you're interested in the
difference between 'core' and 'hyperthread', cpupools also see
hyperthreads as cpus (as almost every other piece of Xen, with the only
exception of that small bit of the load balancer, as explained by
George). So, if cpu0 and cpu1 are hyperthreads of the same core, and you
put them in the same pool, you're back to square 1 and you've got to
take the 0.7 factor into account.

It is probably possible to differentiate, during accounting, the time
spent on a (busy?) hyperthread wrt the time spent on a "regular" core,
but not without modifying the scheduler. Otherwise, if HT is disturbing
too much, I've seen people turning it off (different scope and purposes,
i.e., real-time, but still), provided the BIOS offers such an option.

Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-Wa8XFbVtXYwrDtKo9HkB
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCleCYACgkQk4XaBE3IOsRJCgCfbpT7u/11vOC9cQJsqXpH2K5G
2uYAn0Te0vsRqdBzF+FgKcuj7cQ9Othz
=cJk/
-----END PGP SIGNATURE-----

--=-Wa8XFbVtXYwrDtKo9HkB--



--===============0459434827073375237==
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.xen.org
http://lists.xen.org/xen-devel

--===============0459434827073375237==--



From xen-devel-bounces@lists.xen.org Thu Nov 15 23:51:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 23:51:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ9Cn-0002nX-M8; Thu, 15 Nov 2012 23:50:45 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZ9Cm-0002nS-Hq
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 23:50:44 +0000
Received: from [85.158.143.99:12736] by server-2.bemta-4.messagelabs.com id
	76/1B-28922-3DF75A05; Thu, 15 Nov 2012 23:50:43 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1353023441!22598621!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg4NDY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14086 invoked from network); 15 Nov 2012 23:50:41 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 23:50:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208";a="15839106"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 23:50:41 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 23:50:40 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TZ9Ci-0002WA-OF;
	Thu, 15 Nov 2012 23:50:40 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TZ9Ci-000652-J0;
	Thu, 15 Nov 2012 23:50:40 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14403-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 15 Nov 2012 23:50:40 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14403: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14403 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14403/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-win7-amd64  7 windows-install   fail REGR. vs. 14399

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14399
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14399
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14399

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  321f8487379b
baseline version:
 xen                  d1d05cb59a76

------------------------------------------------------------
People who touched revisions under test:
  Andre Przywara <osp@andrep.de>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Boris Ostrovsky <boris.ostrovsky@amd.com>
  Christoph Egger <Christoph_Egger@gmx.de>
  Ian Campbell <ian.campbell@citrix.com>
  Jim Fehlig <jfehlig@suse.com>
  Keir Fraser <keir@xen.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
  Wei Huang <wei.huang2@amd.com>
  Wei Wang <weiwang.dd@gmail.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26160:321f8487379b
tag:         tip
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:29 2012 +0000
    
    xen/arm: wake up secondary cpus
    
    Secondary cpus are held by the firmware until we send an IPI to them.
    
    Reordered non-boot cpu wait loop to perform the check before waiting
    for an event, to handled the case where the event has already
    happened when we reach the loop.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26159:5718bbed558b
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:28 2012 +0000
    
    xen/arm: set the SMP bit in the ACTLR register
    
    "Enables the processor to receive instruction cache, BTB, and TLB maintenance
    operations from other processors"
    
    ...
    
    "You must set this bit before enabling the caches and MMU, or
    performing any cache and TLB maintenance operations. The only time
    you must clear this bit is during a processor power-down sequence"
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26158:999fae11df23
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:27 2012 +0000
    
    pl011: set baud and clock_hz to the right defaults for Versatile Express
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26157:2312d29744e3
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:26 2012 +0000
    
    xen/arm: setup the fixmap in head.S
    
    Setup the fixmap mapping directly in head.S rather than having a
    temporary mapping only to re-do it later in C.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26156:008726e63e7d
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:26 2012 +0000
    
    xen/arm: pass the correct bit-per-interrupt argument to vgic_irq_rank
    
    Use 1 for registers that have 1 bit per irq.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26155:babb84d9a82e
user:        Jim Fehlig <jfehlig@suse.com>
date:        Thu Nov 15 10:25:25 2012 +0000
    
    libxl: Fix passing of application data to timeout_deregister hook
    
    When deregistering a timeout, the address of application data was
    being passed to the timeout_deregister hook instead of the data
    itself.
    
    Signed-off-by: Jim Fehlig <jfehlig@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26154:b9b4456e12d1
user:        Andrew Cooper <andrew.cooper3@citrix.com>
date:        Thu Nov 15 09:54:38 2012 +0000
    
    x86/nmi: self_nmi() should not unconditionally enable interrupts
    
    It seems that all current callers have interrupts enabled, making the
    code currently safe but dangerous.  Also, fix a trailing whitespace
    issue.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Committed-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26153:f50e2f4278ab
user:        Andre Przywara <osp@andrep.de>
date:        Thu Nov 15 09:52:12 2012 +0000
    
    update MAINTAINERS file
    
    There have been some "organizational changes" within AMD.
    Update the MAINTAINERS file accordingly.
    Please also feel free to use the new email addresses if there are
    any inquires related to code authored by Wei Wang, Christoph Egger
    or Andre Przywara.
    
    Signed-off-by: Andre Przywara <osp@andrep.de>
    Acked-by: Wei Wang <weiwang.dd@gmail.com>
    Acked-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
    Acked-by: Wei Huang <wei.huang2@amd.com>
    Acked-by: Christoph Egger <Christoph_Egger@gmx.de>
    Committed-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26152:d1d05cb59a76
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Wed Nov 14 16:27:58 2012 +0000
    
    tools: rerun autoconf after 26144:170d45f7a2eb
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 23:51:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 23:51:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ9Cn-0002nX-M8; Thu, 15 Nov 2012 23:50:45 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZ9Cm-0002nS-Hq
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 23:50:44 +0000
Received: from [85.158.143.99:12736] by server-2.bemta-4.messagelabs.com id
	76/1B-28922-3DF75A05; Thu, 15 Nov 2012 23:50:43 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1353023441!22598621!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg4NDY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14086 invoked from network); 15 Nov 2012 23:50:41 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-11.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	15 Nov 2012 23:50:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,259,1352073600"; d="scan'208";a="15839106"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	15 Nov 2012 23:50:41 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 15 Nov 2012 23:50:40 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TZ9Ci-0002WA-OF;
	Thu, 15 Nov 2012 23:50:40 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TZ9Ci-000652-J0;
	Thu, 15 Nov 2012 23:50:40 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14403-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 15 Nov 2012 23:50:40 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14403: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14403 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14403/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-win7-amd64  7 windows-install   fail REGR. vs. 14399

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14399
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14399
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14399

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  321f8487379b
baseline version:
 xen                  d1d05cb59a76

------------------------------------------------------------
People who touched revisions under test:
  Andre Przywara <osp@andrep.de>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Boris Ostrovsky <boris.ostrovsky@amd.com>
  Christoph Egger <Christoph_Egger@gmx.de>
  Ian Campbell <ian.campbell@citrix.com>
  Jim Fehlig <jfehlig@suse.com>
  Keir Fraser <keir@xen.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
  Wei Huang <wei.huang2@amd.com>
  Wei Wang <weiwang.dd@gmail.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26160:321f8487379b
tag:         tip
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:29 2012 +0000
    
    xen/arm: wake up secondary cpus
    
    Secondary cpus are held by the firmware until we send an IPI to them.
    
    Reordered non-boot cpu wait loop to perform the check before waiting
    for an event, to handled the case where the event has already
    happened when we reach the loop.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26159:5718bbed558b
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:28 2012 +0000
    
    xen/arm: set the SMP bit in the ACTLR register
    
    "Enables the processor to receive instruction cache, BTB, and TLB maintenance
    operations from other processors"
    
    ...
    
    "You must set this bit before enabling the caches and MMU, or
    performing any cache and TLB maintenance operations. The only time
    you must clear this bit is during a processor power-down sequence"
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26158:999fae11df23
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:27 2012 +0000
    
    pl011: set baud and clock_hz to the right defaults for Versatile Express
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26157:2312d29744e3
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:26 2012 +0000
    
    xen/arm: setup the fixmap in head.S
    
    Setup the fixmap mapping directly in head.S rather than having a
    temporary mapping only to re-do it later in C.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26156:008726e63e7d
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:26 2012 +0000
    
    xen/arm: pass the correct bit-per-interrupt argument to vgic_irq_rank
    
    Use 1 for registers that have 1 bit per irq.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26155:babb84d9a82e
user:        Jim Fehlig <jfehlig@suse.com>
date:        Thu Nov 15 10:25:25 2012 +0000
    
    libxl: Fix passing of application data to timeout_deregister hook
    
    When deregistering a timeout, the address of application data was
    being passed to the timeout_deregister hook instead of the data
    itself.
    
    Signed-off-by: Jim Fehlig <jfehlig@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26154:b9b4456e12d1
user:        Andrew Cooper <andrew.cooper3@citrix.com>
date:        Thu Nov 15 09:54:38 2012 +0000
    
    x86/nmi: self_nmi() should not unconditionally enable interrupts
    
    It seems that all current callers have interrupts enabled, making the
    code currently safe but dangerous.  Also, fix a trailing whitespace
    issue.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Committed-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26153:f50e2f4278ab
user:        Andre Przywara <osp@andrep.de>
date:        Thu Nov 15 09:52:12 2012 +0000
    
    update MAINTAINERS file
    
    There have been some "organizational changes" within AMD.
    Update the MAINTAINERS file accordingly.
    Please also feel free to use the new email addresses if there are
    any inquires related to code authored by Wei Wang, Christoph Egger
    or Andre Przywara.
    
    Signed-off-by: Andre Przywara <osp@andrep.de>
    Acked-by: Wei Wang <weiwang.dd@gmail.com>
    Acked-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
    Acked-by: Wei Huang <wei.huang2@amd.com>
    Acked-by: Christoph Egger <Christoph_Egger@gmx.de>
    Committed-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26152:d1d05cb59a76
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Wed Nov 14 16:27:58 2012 +0000
    
    tools: rerun autoconf after 26144:170d45f7a2eb
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 15 23:53:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 23:53:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ9Es-0002zg-8P; Thu, 15 Nov 2012 23:52:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TZ9Eq-0002zY-EB
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 23:52:52 +0000
Received: from [85.158.139.211:43927] by server-14.bemta-5.messagelabs.com id
	3B/85-21768-35085A05; Thu, 15 Nov 2012 23:52:51 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353023569!20311047!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTY4MDE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17744 invoked from network); 15 Nov 2012 23:52:50 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-15.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 23:52:50 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFNqk7r003113
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 23:52:47 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFNqioe009759
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 23:52:46 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFNqiuO017811; Thu, 15 Nov 2012 17:52:44 -0600
MIME-Version: 1.0
Message-ID: <373a7ea3-fd9b-4bec-9ef3-d6b51ab433c9@default>
Date: Thu, 15 Nov 2012 15:52:38 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__1353023564547169741abhmt107.oracle.com"
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [RFC/PATCH v4] XENMEM_claim_pages (subop of existing)
	hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__1353023564547169741abhmt107.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This is a fourth cut of the hypervisor patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account
feedback from Jan and Keir and IanC, plus some fixes found
via runtime debugging (using privcmd only) and some
added comments/cleanup.

[Logistical note: I will be out tomorrow (Friday) plus US
holidays next week so my responsiveness to comments may be
slower for awhile. --djm]

v3->v4: (please ignore v3)
- Process error, sent stale patch, sorry [djm]

v2->v3:
- Add per-domain and global "get" for unclaimed info [JBeulich]
- New hypercall(s) should fail for unpriv callers [IanC]
- Non-zero extent_order disallowed [JBeulich]
- Remove bonehead ASSERTs [JBeulich]
- Need not hold heaplock for decrease case too [JBeulich]
- More descriptive failure return values [JBeulich]
- Don't allow a claim to exceed max_pages [IanC]
- Subops must be in correct ifdef block in memory.c [keir]

v1->v2:
- Add reset-to-zero page claim in domain_kill [JBeulich]
- Proper handling of struct passed to hypercall [JBeulich]
- Fix alloc_heap_pages when a domain has a claim [JBeulich]
- Need not hold heap_lock if !d->unclaimed_pages [keir]
- Fix missed tot_pages call in donate_page [djm]
- Remove domain_reset_unclaimed_pages; use set with zero [djm]
- Bugfixes found through testing in set_unclaimed [djm]
- More comments in code [djm]
- Code formatting fixes [djm]

=3D=3D=3D

Motivation:

The goal of this hypercall
is to attempt to atomically and very quickly determine if
there are sufficient pages available in the system and, if
so, "set aside" that quantity of pages for future allocations
by that domain.  Unlike an existing hypercall such as
increase_reservation or populate_physmap, specific physical
pageframes are not assigned to the domain because this
cannot be done sufficiently quickly (especially for very large
allocations in an arbitrarily fragmented system) and so the
existing mechanisms result in classic time-of-check-time-of-use
(TOCTOU) races.  One can think of claiming as similar to a
"lazy" allocation, but subsequent hypercalls are required
to do the actual physical pageframe allocation.

I don't have a patch for the toolstack side, but I envision
a "xl create --claim" option to maximize backwards
compatibility while minimizing impact on existing toolstacks.
As a result, testing has (so far) only been done via privcmd.

Code overview:

Though the hypercall simply does arithmetic within locks,
some of the semantics in the code may be a bit subtle
so let me explain a bit.

The key variables (d->unclaimed_pages and total_unclaimed_pages)
start at zero if no claim has yet been staked for any domain.
(Perhaps a better name is "claimed_but_not_yet_possessed" but that's
a bit unwieldy.)  If no claim hypercalls are executed, there
should be no impact on existing usage.

When a claim is successfully staked by a domain, it is like a
watermark but there is no record kept of the size of the claim.
Instead, d->unclaimed_pages is set to the difference between
d->tot_pages and the claim (d->tot_pages may normally be zero
but see Note 1).  When d->tot_pages increases or decreases,
d->unclaimed_pages atomically decreases or increases.  Once
d->unclaimed_pages reaches zero, the claim is satisfied and
d->unclaimed pages stays at zero -- unless a new claim is
subsequently staked.  See Note 2.

The systemwide variable total_unclaimed_pages is always the sum
of d->unclaimed_pages, across all domains.  A non-domain-
specific heap allocation will fail if total_unclaimed_pages
exceeds free (plus, on tmem enabled systems, freeable) pages.

Claim semantics may be modified by flags.  The initial
implementation has one flag, which discerns whether the
caller would like tmem freeable pages to be considered
in determining whether or not the claim can be successfully
staked. Future flags may, for example, specify that the
caller would like the claim to be successful only if there
are sufficient pages available on a single node (per Dario's
suggestion).

A claim can be cancelled by requesting a claim of zero pages.

A second subop returns the total outstanding claimed pages
systemwide.

Note 1: Tim: I'm thinking this may resolve your concern that
the claim mechanism must be more complicated to handle
restricted memory allocations and order>0 allocations.
The proposed claim mechanism only guarantees a quantity of
order=3D=3D0 pages; if restricted allocations are required, these
are done first by the toolstack, and followed by the claim.
Order>0 allocations still work if memory is not fragmented,
but the claim mechanism doesn't guarantee anything but
a quantity of order=3D=3D0 pages.

Note 2: Tim: This arithmetic also indirectly implements the
"claim auto-expire" discussed earlier.  We certainly don't
unclaimed_pages to go negative!

Note 3: Save/restore/migrate may need to be modified
or it can be documented that all claims are cancelled.

Thanks for any feedback!

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 tools/libxc/xc_domain.c       |    1=20
 tools/libxc/xenctrl.h         |    1=20
 xen/arch/x86/mm.c             |    2=20
 xen/arch/x86/mm/mem_sharing.c |    4 -
 xen/common/domain.c           |    1=20
 xen/common/domctl.c           |    1=20
 xen/common/grant_table.c      |    2=20
 xen/common/memory.c           |   33 +++++++++++
 xen/common/page_alloc.c       |  118 +++++++++++++++++++++++++++++++++++++=
++++-
 xen/include/public/domctl.h   |    3 -
 xen/include/public/memory.h   |   39 +++++++++++++
 xen/include/xen/mm.h          |    7 ++
 xen/include/xen/sched.h       |    1=20
 13 files changed, 205 insertions(+), 8 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index d98e68b..6d06f7c 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -234,6 +234,7 @@ int xc_domain_getinfo(xc_interface *xch,
=20
         info->ssidref  =3D domctl.u.getdomaininfo.ssidref;
         info->nr_pages =3D domctl.u.getdomaininfo.tot_pages;
+        info->nr_unclaimed_pages =3D domctl.u.getdomaininfo.unclaimed_page=
s;
         info->nr_shared_pages =3D domctl.u.getdomaininfo.shr_pages;
         info->nr_paged_pages =3D domctl.u.getdomaininfo.paged_pages;
         info->max_memkb =3D domctl.u.getdomaininfo.max_pages << (PAGE_SHIF=
T-10);
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..325f4a3 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -364,6 +364,7 @@ typedef struct xc_dominfo {
                   hvm:1, debugged:1;
     unsigned int  shutdown_reason; /* only meaningful if shutdown=3D=3D1 *=
/
     unsigned long nr_pages; /* current number, not maximum */
+    unsigned long nr_unclaimed_pages;
     unsigned long nr_shared_pages;
     unsigned long nr_paged_pages;
     unsigned long shared_info_frame;
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fad3d33..7e55908 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3841,7 +3841,7 @@ int donate_page(
     {
         if ( d->tot_pages >=3D d->max_pages )
             goto fail;
-        d->tot_pages++;
+        domain_increase_tot_pages(d, 1);
     }
=20
     page->count_info =3D PGC_allocated | 1;
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..943a3b5 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d,
     }
=20
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_decrease_tot_pages(d, 1);
     drop_dom_ref =3D (d->tot_pages =3D=3D 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct p=
age_info *page)
     ASSERT(page_get_owner(page) =3D=3D dom_cow);
     page_set_owner(page, d);
=20
-    if ( d->tot_pages++ =3D=3D 0 )
+    if ( domain_increase_tot_pages(d, 1) =3D=3D 0 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0e3e36a..95509e2 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -492,6 +492,7 @@ int domain_kill(struct domain *d)
         evtchn_destroy(d);
         gnttab_release_mappings(d);
         tmem_destroy(d->tmem);
+        domain_set_unclaimed_pages(d, 0, 0);
         d->tmem =3D NULL;
         /* fallthrough */
     case DOMDYING_dying:
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index e153cb4..19e3930 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -154,6 +154,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_=
getdomaininfo *info)
=20
     info->tot_pages         =3D d->tot_pages;
     info->max_pages         =3D d->max_pages;
+    info->unclaimed_pages   =3D d->unclaimed_pages;
     info->shr_pages         =3D atomic_read(&d->shr_pages);
     info->paged_pages       =3D atomic_read(&d->paged_pages);
     info->shared_info_frame =3D mfn_to_gmfn(d, __pa(d->shared_info)>>PAGE_=
SHIFT);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..10ce78f 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1656,7 +1656,7 @@ gnttab_transfer(
         }
=20
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ =3D=3D 0) )
+        if ( unlikely(domain_increase_tot_pages(e, 1) =3D=3D 0) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..a9d91c1 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_=
memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
=20
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -=3D dec_count;
+                domain_decrease_tot_pages(d, dec_count);
                 drop_dom_ref =3D (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
=20
@@ -685,6 +685,37 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_=
PARAM(void) arg)
         break;
     }
=20
+    case XENMEM_claim_pages:
+        if ( !(IS_PRIV(current->domain)) )
+            return -EPERM;
+
+        if ( copy_from_guest(&reservation, arg, 1) )
+            return -EFAULT;
+
+        if ( !(guest_handle_is_null(reservation.extent_start)) )
+            return -EINVAL;
+
+        if ( reservation.extent_order !=3D 0 )
+            return -EINVAL;
+
+        rc =3D rcu_lock_target_domain_by_id(reservation.domid, &d);
+        if ( rc )
+            return rc;
+
+        rc =3D domain_set_unclaimed_pages(d, reservation.nr_extents,
+                                        reservation.mem_flags);
+
+        rcu_unlock_domain(d);
+
+        break;
+
+    case XENMEM_get_unclaimed_pages:
+        if ( !(IS_PRIV(current->domain)) )
+            return -EPERM;
+
+        rc =3D get_total_unclaimed_pages();
+        break;
+
     default:
         rc =3D arch_memory_op(op, arg);
         break;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 15ebc66..33179fd 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -238,6 +238,111 @@ static long midsize_alloc_zone_pages;
 #define MIDSIZE_ALLOC_FRAC 128
=20
 static DEFINE_SPINLOCK(heap_lock);
+static long total_unclaimed_pages; /* total outstanding claims by all doma=
ins */
+
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
+
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages +=3D pages;
+    spin_lock(&heap_lock);
+    dom_before =3D d->unclaimed_pages;
+    dom_after =3D dom_before - pages;
+    if ( (dom_before > 0) && (dom_after < 0) )
+        dom_claimed =3D 0;
+    else
+        dom_claimed =3D dom_after;
+    sys_before =3D total_unclaimed_pages;
+    sys_after =3D sys_before - (dom_before - dom_claimed);
+    BUG_ON( (sys_before > 0) && (sys_after < 0) );
+    total_unclaimed_pages =3D sys_after;
+    d->unclaimed_pages =3D dom_claimed;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages -=3D pages;
+
+    spin_lock(&heap_lock);
+    d->tot_pages -=3D pages;
+    d->unclaimed_pages +=3D pages;
+    total_unclaimed_pages +=3D pages;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
+                                unsigned long flags)
+{
+    int ret =3D -ENOMEM;
+    unsigned long claim, avail_pages;
+
+    /*
+     * take the domain's page_alloc_lock, else all increases/decreases
+     * must always take the global heap_lock rather than only in the much
+     * rarer case that d->unclaimed_pages is non-zero
+     */
+    spin_lock(&d->page_alloc_lock);
+    spin_lock(&heap_lock);
+
+    /* pages=3D=3D0 means "unset" the claim (and flags is ignored) */
+    if ( pages =3D=3D 0 )
+    {
+        total_unclaimed_pages -=3D d->unclaimed_pages;
+        d->unclaimed_pages =3D 0;
+        ret =3D 0;
+        goto out;
+    }
+
+    /* only one active claim per domain please */
+    if ( d->unclaimed_pages )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* disallow a claim not exceeding current tot_pages or above max_pages=
 */
+    if ( (pages <=3D d->tot_pages) || (pages > d->max_pages) )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* how much memory is available? */
+    avail_pages =3D total_avail_pages;
+    if ( !(flags & XENMEM_CLAIMF_free_only) )
+        avail_pages +=3D tmem_freeable_pages();
+    avail_pages -=3D total_unclaimed_pages;
+
+    /*
+     * note, if domain has already allocated memory before making a claim=
=20
+     * then the claim must take tot_pages into account
+     */
+    claim =3D pages - d->tot_pages;
+    if ( claim > avail_pages )
+        goto out;
+
+    /* yay, claim fits in available memory, stake the claim, success! */
+    d->unclaimed_pages =3D claim;
+    total_unclaimed_pages +=3D d->unclaimed_pages;
+    ret =3D 0;
+
+out:
+    spin_unlock(&heap_lock);
+    spin_unlock(&d->page_alloc_lock);
+    return ret;
+}
+
+long get_total_unclaimed_pages(void)
+{
+    return total_unclaimed_pages;
+}
=20
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
@@ -443,6 +548,15 @@ static struct page_info *alloc_heap_pages(
     spin_lock(&heap_lock);
=20
     /*
+     * Claimed memory is considered unavailable unless the request
+     * is made by a domain with sufficient unclaimed pages.
+     */
+    if ( (total_unclaimed_pages + request >
+           total_avail_pages + tmem_freeable_pages()) &&
+          (d =3D=3D NULL || d->unclaimed_pages < request) )
+        goto not_found;
+
+    /*
      * TMEM: When available memory is scarce due to tmem absorbing it, all=
ow
      * only mid-size allocations to avoid worst of fragmentation issues.
      * Others try tmem pools then fail.  This is a workaround until all
@@ -1291,7 +1405,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages =3D=3D 0) )
             get_knownalive_domain(d);
=20
-        d->tot_pages +=3D 1 << order;
+        domain_increase_tot_pages(d, 1 << order);
     }
=20
     for ( i =3D 0; i < (1 << order); i++ )
@@ -1375,7 +1489,7 @@ void free_domheap_pages(struct page_info *pg, unsigne=
d int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
=20
-        d->tot_pages -=3D 1 << order;
+        domain_decrease_tot_pages(d, 1 << order);
         drop_dom_ref =3D (d->tot_pages =3D=3D 0);
=20
         spin_unlock_recursive(&d->page_alloc_lock);
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index f2409ec..118f24a 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -36,7 +36,7 @@
 #include "grant_table.h"
 #include "hvm/save.h"
=20
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000009
=20
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -95,6 +95,7 @@ struct xen_domctl_getdomaininfo {
     uint32_t flags;              /* XEN_DOMINF_* */
     uint64_aligned_t tot_pages;
     uint64_aligned_t max_pages;
+    uint64_aligned_t unclaimed_pages;
     uint64_aligned_t shr_pages;
     uint64_aligned_t paged_pages;
     uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index f1ddbc0..15d6c72 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -68,6 +68,8 @@ struct xen_memory_reservation {
      *   IN:  GPFN bases of extents to populate with memory
      *   OUT: GMFN bases of extents that were allocated
      *   (NB. This command also updates the mach_to_phys translation table=
)
+     * XENMEM_claim_pages:
+     *   IN: must be zero
      */
     XEN_GUEST_HANDLE(xen_pfn_t) extent_start;
=20
@@ -421,6 +423,43 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
=20
+/*
+ * Attempt to stake a claim for a domain on a quantity of pages
+ * of system RAM, but _not_ assign specific pageframes.  Only
+ * arithmetic is performed so the hypercall is very fast and need
+ * not be preemptible, thus sidestepping time-of-check-time-of-use
+ * races for memory allocation.  Returns 0 if the hypervisor page
+ * allocator has atomically and successfully claimed the requested
+ * number of pages, else non-zero.
+ *
+ * Any domain may have only one active claim.  When sufficient memory
+ * has been allocated to resolve the claim, the claim silently expires.
+ * Claiming zero pages effectively resets any outstanding claim and
+ * is always successful.
+ *
+ * Note that a valid claim may be staked even after memory has been
+ * allocated for a domain.  In this case, the claim is not incremental,
+ * i.e. if the domain's tot_pages is 3, and a claim is staked for 10,
+ * only 7 additional pages are claimed.
+ *
+ * Caller must be privileged or the hypercall fails.
+ */
+#define XENMEM_claim_pages                  24
+/*
+ * XENMEM_claim_pages flags:
+ *  free_only: claim is successful only if sufficient free pages
+ *    are available.  If not set and tmem is enabled, hypervisor
+ *    may also consider tmem "freeable" pages to satisfy the claim.
+ */
+#define _XENMEM_CLAIMF_free_only            0
+#define XENMEM_CLAIMF_free_only             (1U<<_XENMEM_CLAIMF_free_only)
+/*
+ * Get the number of pages currently claimed (but not yet "possessed")
+ * across all domains.  The caller must be privileged but otherwise
+ * the call never fails.=20
+ */
+#define XENMEM_get_unclaimed_pages            25
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
=20
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 64a0cc1..b4dee92 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,13 @@ void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
=20
+/* Claim handling */
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges);
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges);
+int domain_set_unclaimed_pages(
+    struct domain *d, unsigned long pages, unsigned long flags);
+long get_total_unclaimed_pages(void);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..480ef39 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -242,6 +242,7 @@ struct domain
     struct page_list_head page_list;  /* linked list */
     struct page_list_head xenpage_list; /* linked list (size xenheap_pages=
) */
     unsigned int     tot_pages;       /* number of pages currently possese=
d */
+    unsigned int     unclaimed_pages; /* pages claimed but not possessed  =
  */
     unsigned int     max_pages;       /* maximum value for tot_pages      =
  */
     atomic_t         shr_pages;       /* number of shared pages           =
  */
     atomic_t         paged_pages;     /* number of paged-out pages        =
  */

--__1353023564547169741abhmt107.oracle.com
Content-Type: application/octet-stream; name="claim-121115b.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-121115b.patch"

ZGlmZiAtLWdpdCBhL3Rvb2xzL2xpYnhjL3hjX2RvbWFpbi5jIGIvdG9vbHMvbGlieGMveGNfZG9t
YWluLmMKaW5kZXggZDk4ZTY4Yi4uNmQwNmY3YyAxMDA2NDQKLS0tIGEvdG9vbHMvbGlieGMveGNf
ZG9tYWluLmMKKysrIGIvdG9vbHMvbGlieGMveGNfZG9tYWluLmMKQEAgLTIzNCw2ICsyMzQsNyBA
QCBpbnQgeGNfZG9tYWluX2dldGluZm8oeGNfaW50ZXJmYWNlICp4Y2gsCiAKICAgICAgICAgaW5m
by0+c3NpZHJlZiAgPSBkb21jdGwudS5nZXRkb21haW5pbmZvLnNzaWRyZWY7CiAgICAgICAgIGlu
Zm8tPm5yX3BhZ2VzID0gZG9tY3RsLnUuZ2V0ZG9tYWluaW5mby50b3RfcGFnZXM7CisgICAgICAg
IGluZm8tPm5yX3VuY2xhaW1lZF9wYWdlcyA9IGRvbWN0bC51LmdldGRvbWFpbmluZm8udW5jbGFp
bWVkX3BhZ2VzOwogICAgICAgICBpbmZvLT5ucl9zaGFyZWRfcGFnZXMgPSBkb21jdGwudS5nZXRk
b21haW5pbmZvLnNocl9wYWdlczsKICAgICAgICAgaW5mby0+bn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X1BSSVYoY3VycmVudC0+ZG9t
YWluKSkgKQorICAgICAgICAgICAgcmV0dXJuIC1FUEVSTTsKKworICAgICAgICBpZiAoIGNvcHlf
ZnJvbV9ndWVzdCgmcmVzZXJ2YXRpb24sIGFyZywgMSkgKQorICAgICAgICAgICAgcmV0dXJuIC1F
RkFVTFQ7CisKKyAgICAgICAgaWYgKCAhKGd1ZXN0X2hhbmRsZV9pc19udWxsKHJlc2VydmF0aW9u
LmV4dGVudF9zdGFydCkpICkKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworCisgICAgICAg
IGlmICggcmVzZXJ2YXRpb24uZXh0ZW50X29yZGVyICE9IDAgKQorICAgICAgICAgICAgcmV0dXJu
IC1FSU5WQUw7CisKKyAgICAgICAgcmMgPSByY3VfbG9ja190YXJnZXRfZG9tYWluX2J5X2lkKHJl
c2VydmF0aW9uLmRvbWlkLCAmZCk7CisgICAgICAgIGlmICggcmMgKQorICAgICAgICAgICAgcmV0
dXJuIHJjOworCisgICAgICAgIHJjID0gZG9tYWluX3NldF91bmNsYWltZWRfcGFnZXMoZCwgcmVz
ZXJ2YXRpb24ubnJfZXh0ZW50cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICByZXNlcnZhdGlvbi5tZW1fZmxhZ3MpOworCisgICAgICAgIHJjdV91bmxvY2tfZG9tYWlu
KGQpOworCisgICAgICAgIGJyZWFrOworCisgICAgY2FzZSBYRU5NRU1fZ2V0X3VuY2xhaW1lZF9w
YWdlczoKKyAgICAgICAgaWYgKCAhKElTX1BSSVYoY3VycmVudC0+ZG9tYWluKSkgKQorICAgICAg
ICAgICAgcmV0dXJuIC1FUEVSTTsKKworICAgICAgICByYyA9IGdldF90b3RhbF91bmNsYWltZWRf
cGFnZXMoKTsKKyAgICAgICAgYnJlYWs7CisKICAgICBkZWZhdWx0OgogICAgICAgICByYyA9IGFy
Y2hfbWVtb3J5X29wKG9wLCBhcmcpOwogICAgICAgICBicmVhazsKZG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94ZW4vaW5jbHVkZS94
ZW4vc2NoZWQuaCBiL3hlbi9pbmNsdWRlL3hlbi9zY2hlZC5oCmluZGV4IDZjNTUwMzkuLjQ4MGVm
MzkgMTAwNjQ0Ci0tLSBhL3hlbi9pbmNsdWRlL3hlbi9zY2hlZC5oCisrKyBiL3hlbi9pbmNsdWRl
L3hlbi9zY2hlZC5oCkBAIC0yNDIsNiArMjQyLDcgQEAgc3RydWN0IGRvbWFpbgogICAgIHN0cnVj
dCBwYWdlX2xpc3RfaGVhZCBwYWdlX2xpc3Q7ICAvKiBsaW5rZWQgbGlzdCAqLwogICAgIHN0cnVj
dCBwYWdlX2xpc3RfaGVhZCB4ZW5wYWdlX2xpc3Q7IC8qIGxpbmtlZCBsaXN0IChzaXplIHhlbmhl
YXBfcGFnZXMpICovCiAgICAgdW5zaWduZWQgaW50ICAgICB0b3RfcGFnZXM7ICAgICAgIC8qIG51
bWJlciBvZiBwYWdlcyBjdXJyZW50bHkgcG9zc2VzZWQgKi8KKyAgICB1bnNpZ25lZCBpbnQgICAg
IHVuY2xhaW1lZF9wYWdlczsgLyogcGFnZXMgY2xhaW1lZCBidXQgbm90IHBvc3Nlc3NlZCAgICAq
LwogICAgIHVuc2lnbmVkIGludCAgICAgbWF4X3BhZ2VzOyAgICAgICAvKiBtYXhpbXVtIHZhbHVl
IGZvciB0b3RfcGFnZXMgICAgICAgICovCiAgICAgYXRvbWljX3QgICAgICAgICBzaHJfcGFnZXM7
ICAgICAgIC8qIG51bWJlciBvZiBzaGFyZWQgcGFnZXMgICAgICAgICAgICAgKi8KICAgICBhdG9t
aWNfdCAgICAgICAgIHBhZ2VkX3BhZ2VzOyAgICAgLyogbnVtYmVyIG9mIHBhZ2VkLW91dCBwYWdl
cyAgICAgICAgICAqLwo=
--__1353023564547169741abhmt107.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__1353023564547169741abhmt107.oracle.com--


From xen-devel-bounces@lists.xen.org Thu Nov 15 23:53:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Nov 2012 23:53:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ9Es-0002zg-8P; Thu, 15 Nov 2012 23:52:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TZ9Eq-0002zY-EB
	for xen-devel@lists.xen.org; Thu, 15 Nov 2012 23:52:52 +0000
Received: from [85.158.139.211:43927] by server-14.bemta-5.messagelabs.com id
	3B/85-21768-35085A05; Thu, 15 Nov 2012 23:52:51 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353023569!20311047!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTY4MDE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17744 invoked from network); 15 Nov 2012 23:52:50 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-15.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 15 Nov 2012 23:52:50 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAFNqk7r003113
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 15 Nov 2012 23:52:47 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAFNqioe009759
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 15 Nov 2012 23:52:46 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAFNqiuO017811; Thu, 15 Nov 2012 17:52:44 -0600
MIME-Version: 1.0
Message-ID: <373a7ea3-fd9b-4bec-9ef3-d6b51ab433c9@default>
Date: Thu, 15 Nov 2012 15:52:38 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__1353023564547169741abhmt107.oracle.com"
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [RFC/PATCH v4] XENMEM_claim_pages (subop of existing)
	hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__1353023564547169741abhmt107.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This is a fourth cut of the hypervisor patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account
feedback from Jan and Keir and IanC, plus some fixes found
via runtime debugging (using privcmd only) and some
added comments/cleanup.

[Logistical note: I will be out tomorrow (Friday) plus US
holidays next week so my responsiveness to comments may be
slower for awhile. --djm]

v3->v4: (please ignore v3)
- Process error, sent stale patch, sorry [djm]

v2->v3:
- Add per-domain and global "get" for unclaimed info [JBeulich]
- New hypercall(s) should fail for unpriv callers [IanC]
- Non-zero extent_order disallowed [JBeulich]
- Remove bonehead ASSERTs [JBeulich]
- Need not hold heaplock for decrease case too [JBeulich]
- More descriptive failure return values [JBeulich]
- Don't allow a claim to exceed max_pages [IanC]
- Subops must be in correct ifdef block in memory.c [keir]

v1->v2:
- Add reset-to-zero page claim in domain_kill [JBeulich]
- Proper handling of struct passed to hypercall [JBeulich]
- Fix alloc_heap_pages when a domain has a claim [JBeulich]
- Need not hold heap_lock if !d->unclaimed_pages [keir]
- Fix missed tot_pages call in donate_page [djm]
- Remove domain_reset_unclaimed_pages; use set with zero [djm]
- Bugfixes found through testing in set_unclaimed [djm]
- More comments in code [djm]
- Code formatting fixes [djm]

=3D=3D=3D

Motivation:

The goal of this hypercall
is to attempt to atomically and very quickly determine if
there are sufficient pages available in the system and, if
so, "set aside" that quantity of pages for future allocations
by that domain.  Unlike an existing hypercall such as
increase_reservation or populate_physmap, specific physical
pageframes are not assigned to the domain because this
cannot be done sufficiently quickly (especially for very large
allocations in an arbitrarily fragmented system) and so the
existing mechanisms result in classic time-of-check-time-of-use
(TOCTOU) races.  One can think of claiming as similar to a
"lazy" allocation, but subsequent hypercalls are required
to do the actual physical pageframe allocation.

I don't have a patch for the toolstack side, but I envision
a "xl create --claim" option to maximize backwards
compatibility while minimizing impact on existing toolstacks.
As a result, testing has (so far) only been done via privcmd.

Code overview:

Though the hypercall simply does arithmetic within locks,
some of the semantics in the code may be a bit subtle
so let me explain a bit.

The key variables (d->unclaimed_pages and total_unclaimed_pages)
start at zero if no claim has yet been staked for any domain.
(Perhaps a better name is "claimed_but_not_yet_possessed" but that's
a bit unwieldy.)  If no claim hypercalls are executed, there
should be no impact on existing usage.

When a claim is successfully staked by a domain, it is like a
watermark but there is no record kept of the size of the claim.
Instead, d->unclaimed_pages is set to the difference between
d->tot_pages and the claim (d->tot_pages may normally be zero
but see Note 1).  When d->tot_pages increases or decreases,
d->unclaimed_pages atomically decreases or increases.  Once
d->unclaimed_pages reaches zero, the claim is satisfied and
d->unclaimed pages stays at zero -- unless a new claim is
subsequently staked.  See Note 2.

The systemwide variable total_unclaimed_pages is always the sum
of d->unclaimed_pages, across all domains.  A non-domain-
specific heap allocation will fail if total_unclaimed_pages
exceeds free (plus, on tmem enabled systems, freeable) pages.

Claim semantics may be modified by flags.  The initial
implementation has one flag, which discerns whether the
caller would like tmem freeable pages to be considered
in determining whether or not the claim can be successfully
staked. Future flags may, for example, specify that the
caller would like the claim to be successful only if there
are sufficient pages available on a single node (per Dario's
suggestion).

A claim can be cancelled by requesting a claim of zero pages.

A second subop returns the total outstanding claimed pages
systemwide.

Note 1: Tim: I'm thinking this may resolve your concern that
the claim mechanism must be more complicated to handle
restricted memory allocations and order>0 allocations.
The proposed claim mechanism only guarantees a quantity of
order=3D=3D0 pages; if restricted allocations are required, these
are done first by the toolstack, and followed by the claim.
Order>0 allocations still work if memory is not fragmented,
but the claim mechanism doesn't guarantee anything but
a quantity of order=3D=3D0 pages.

Note 2: Tim: This arithmetic also indirectly implements the
"claim auto-expire" discussed earlier.  We certainly don't
unclaimed_pages to go negative!

Note 3: Save/restore/migrate may need to be modified
or it can be documented that all claims are cancelled.

Thanks for any feedback!

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 tools/libxc/xc_domain.c       |    1=20
 tools/libxc/xenctrl.h         |    1=20
 xen/arch/x86/mm.c             |    2=20
 xen/arch/x86/mm/mem_sharing.c |    4 -
 xen/common/domain.c           |    1=20
 xen/common/domctl.c           |    1=20
 xen/common/grant_table.c      |    2=20
 xen/common/memory.c           |   33 +++++++++++
 xen/common/page_alloc.c       |  118 +++++++++++++++++++++++++++++++++++++=
++++-
 xen/include/public/domctl.h   |    3 -
 xen/include/public/memory.h   |   39 +++++++++++++
 xen/include/xen/mm.h          |    7 ++
 xen/include/xen/sched.h       |    1=20
 13 files changed, 205 insertions(+), 8 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index d98e68b..6d06f7c 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -234,6 +234,7 @@ int xc_domain_getinfo(xc_interface *xch,
=20
         info->ssidref  =3D domctl.u.getdomaininfo.ssidref;
         info->nr_pages =3D domctl.u.getdomaininfo.tot_pages;
+        info->nr_unclaimed_pages =3D domctl.u.getdomaininfo.unclaimed_page=
s;
         info->nr_shared_pages =3D domctl.u.getdomaininfo.shr_pages;
         info->nr_paged_pages =3D domctl.u.getdomaininfo.paged_pages;
         info->max_memkb =3D domctl.u.getdomaininfo.max_pages << (PAGE_SHIF=
T-10);
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..325f4a3 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -364,6 +364,7 @@ typedef struct xc_dominfo {
                   hvm:1, debugged:1;
     unsigned int  shutdown_reason; /* only meaningful if shutdown=3D=3D1 *=
/
     unsigned long nr_pages; /* current number, not maximum */
+    unsigned long nr_unclaimed_pages;
     unsigned long nr_shared_pages;
     unsigned long nr_paged_pages;
     unsigned long shared_info_frame;
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fad3d33..7e55908 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3841,7 +3841,7 @@ int donate_page(
     {
         if ( d->tot_pages >=3D d->max_pages )
             goto fail;
-        d->tot_pages++;
+        domain_increase_tot_pages(d, 1);
     }
=20
     page->count_info =3D PGC_allocated | 1;
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..943a3b5 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d,
     }
=20
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_decrease_tot_pages(d, 1);
     drop_dom_ref =3D (d->tot_pages =3D=3D 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct p=
age_info *page)
     ASSERT(page_get_owner(page) =3D=3D dom_cow);
     page_set_owner(page, d);
=20
-    if ( d->tot_pages++ =3D=3D 0 )
+    if ( domain_increase_tot_pages(d, 1) =3D=3D 0 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0e3e36a..95509e2 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -492,6 +492,7 @@ int domain_kill(struct domain *d)
         evtchn_destroy(d);
         gnttab_release_mappings(d);
         tmem_destroy(d->tmem);
+        domain_set_unclaimed_pages(d, 0, 0);
         d->tmem =3D NULL;
         /* fallthrough */
     case DOMDYING_dying:
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index e153cb4..19e3930 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -154,6 +154,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_=
getdomaininfo *info)
=20
     info->tot_pages         =3D d->tot_pages;
     info->max_pages         =3D d->max_pages;
+    info->unclaimed_pages   =3D d->unclaimed_pages;
     info->shr_pages         =3D atomic_read(&d->shr_pages);
     info->paged_pages       =3D atomic_read(&d->paged_pages);
     info->shared_info_frame =3D mfn_to_gmfn(d, __pa(d->shared_info)>>PAGE_=
SHIFT);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..10ce78f 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1656,7 +1656,7 @@ gnttab_transfer(
         }
=20
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ =3D=3D 0) )
+        if ( unlikely(domain_increase_tot_pages(e, 1) =3D=3D 0) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..a9d91c1 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_=
memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
=20
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -=3D dec_count;
+                domain_decrease_tot_pages(d, dec_count);
                 drop_dom_ref =3D (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
=20
@@ -685,6 +685,37 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_=
PARAM(void) arg)
         break;
     }
=20
+    case XENMEM_claim_pages:
+        if ( !(IS_PRIV(current->domain)) )
+            return -EPERM;
+
+        if ( copy_from_guest(&reservation, arg, 1) )
+            return -EFAULT;
+
+        if ( !(guest_handle_is_null(reservation.extent_start)) )
+            return -EINVAL;
+
+        if ( reservation.extent_order !=3D 0 )
+            return -EINVAL;
+
+        rc =3D rcu_lock_target_domain_by_id(reservation.domid, &d);
+        if ( rc )
+            return rc;
+
+        rc =3D domain_set_unclaimed_pages(d, reservation.nr_extents,
+                                        reservation.mem_flags);
+
+        rcu_unlock_domain(d);
+
+        break;
+
+    case XENMEM_get_unclaimed_pages:
+        if ( !(IS_PRIV(current->domain)) )
+            return -EPERM;
+
+        rc =3D get_total_unclaimed_pages();
+        break;
+
     default:
         rc =3D arch_memory_op(op, arg);
         break;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 15ebc66..33179fd 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -238,6 +238,111 @@ static long midsize_alloc_zone_pages;
 #define MIDSIZE_ALLOC_FRAC 128
=20
 static DEFINE_SPINLOCK(heap_lock);
+static long total_unclaimed_pages; /* total outstanding claims by all doma=
ins */
+
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
+
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages +=3D pages;
+    spin_lock(&heap_lock);
+    dom_before =3D d->unclaimed_pages;
+    dom_after =3D dom_before - pages;
+    if ( (dom_before > 0) && (dom_after < 0) )
+        dom_claimed =3D 0;
+    else
+        dom_claimed =3D dom_after;
+    sys_before =3D total_unclaimed_pages;
+    sys_after =3D sys_before - (dom_before - dom_claimed);
+    BUG_ON( (sys_before > 0) && (sys_after < 0) );
+    total_unclaimed_pages =3D sys_after;
+    d->unclaimed_pages =3D dom_claimed;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages -=3D pages;
+
+    spin_lock(&heap_lock);
+    d->tot_pages -=3D pages;
+    d->unclaimed_pages +=3D pages;
+    total_unclaimed_pages +=3D pages;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
+                                unsigned long flags)
+{
+    int ret =3D -ENOMEM;
+    unsigned long claim, avail_pages;
+
+    /*
+     * take the domain's page_alloc_lock, else all increases/decreases
+     * must always take the global heap_lock rather than only in the much
+     * rarer case that d->unclaimed_pages is non-zero
+     */
+    spin_lock(&d->page_alloc_lock);
+    spin_lock(&heap_lock);
+
+    /* pages=3D=3D0 means "unset" the claim (and flags is ignored) */
+    if ( pages =3D=3D 0 )
+    {
+        total_unclaimed_pages -=3D d->unclaimed_pages;
+        d->unclaimed_pages =3D 0;
+        ret =3D 0;
+        goto out;
+    }
+
+    /* only one active claim per domain please */
+    if ( d->unclaimed_pages )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* disallow a claim not exceeding current tot_pages or above max_pages=
 */
+    if ( (pages <=3D d->tot_pages) || (pages > d->max_pages) )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* how much memory is available? */
+    avail_pages =3D total_avail_pages;
+    if ( !(flags & XENMEM_CLAIMF_free_only) )
+        avail_pages +=3D tmem_freeable_pages();
+    avail_pages -=3D total_unclaimed_pages;
+
+    /*
+     * note, if domain has already allocated memory before making a claim=
=20
+     * then the claim must take tot_pages into account
+     */
+    claim =3D pages - d->tot_pages;
+    if ( claim > avail_pages )
+        goto out;
+
+    /* yay, claim fits in available memory, stake the claim, success! */
+    d->unclaimed_pages =3D claim;
+    total_unclaimed_pages +=3D d->unclaimed_pages;
+    ret =3D 0;
+
+out:
+    spin_unlock(&heap_lock);
+    spin_unlock(&d->page_alloc_lock);
+    return ret;
+}
+
+long get_total_unclaimed_pages(void)
+{
+    return total_unclaimed_pages;
+}
=20
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
@@ -443,6 +548,15 @@ static struct page_info *alloc_heap_pages(
     spin_lock(&heap_lock);
=20
     /*
+     * Claimed memory is considered unavailable unless the request
+     * is made by a domain with sufficient unclaimed pages.
+     */
+    if ( (total_unclaimed_pages + request >
+           total_avail_pages + tmem_freeable_pages()) &&
+          (d =3D=3D NULL || d->unclaimed_pages < request) )
+        goto not_found;
+
+    /*
      * TMEM: When available memory is scarce due to tmem absorbing it, all=
ow
      * only mid-size allocations to avoid worst of fragmentation issues.
      * Others try tmem pools then fail.  This is a workaround until all
@@ -1291,7 +1405,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages =3D=3D 0) )
             get_knownalive_domain(d);
=20
-        d->tot_pages +=3D 1 << order;
+        domain_increase_tot_pages(d, 1 << order);
     }
=20
     for ( i =3D 0; i < (1 << order); i++ )
@@ -1375,7 +1489,7 @@ void free_domheap_pages(struct page_info *pg, unsigne=
d int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
=20
-        d->tot_pages -=3D 1 << order;
+        domain_decrease_tot_pages(d, 1 << order);
         drop_dom_ref =3D (d->tot_pages =3D=3D 0);
=20
         spin_unlock_recursive(&d->page_alloc_lock);
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index f2409ec..118f24a 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -36,7 +36,7 @@
 #include "grant_table.h"
 #include "hvm/save.h"
=20
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000009
=20
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -95,6 +95,7 @@ struct xen_domctl_getdomaininfo {
     uint32_t flags;              /* XEN_DOMINF_* */
     uint64_aligned_t tot_pages;
     uint64_aligned_t max_pages;
+    uint64_aligned_t unclaimed_pages;
     uint64_aligned_t shr_pages;
     uint64_aligned_t paged_pages;
     uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index f1ddbc0..15d6c72 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -68,6 +68,8 @@ struct xen_memory_reservation {
      *   IN:  GPFN bases of extents to populate with memory
      *   OUT: GMFN bases of extents that were allocated
      *   (NB. This command also updates the mach_to_phys translation table=
)
+     * XENMEM_claim_pages:
+     *   IN: must be zero
      */
     XEN_GUEST_HANDLE(xen_pfn_t) extent_start;
=20
@@ -421,6 +423,43 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
=20
+/*
+ * Attempt to stake a claim for a domain on a quantity of pages
+ * of system RAM, but _not_ assign specific pageframes.  Only
+ * arithmetic is performed so the hypercall is very fast and need
+ * not be preemptible, thus sidestepping time-of-check-time-of-use
+ * races for memory allocation.  Returns 0 if the hypervisor page
+ * allocator has atomically and successfully claimed the requested
+ * number of pages, else non-zero.
+ *
+ * Any domain may have only one active claim.  When sufficient memory
+ * has been allocated to resolve the claim, the claim silently expires.
+ * Claiming zero pages effectively resets any outstanding claim and
+ * is always successful.
+ *
+ * Note that a valid claim may be staked even after memory has been
+ * allocated for a domain.  In this case, the claim is not incremental,
+ * i.e. if the domain's tot_pages is 3, and a claim is staked for 10,
+ * only 7 additional pages are claimed.
+ *
+ * Caller must be privileged or the hypercall fails.
+ */
+#define XENMEM_claim_pages                  24
+/*
+ * XENMEM_claim_pages flags:
+ *  free_only: claim is successful only if sufficient free pages
+ *    are available.  If not set and tmem is enabled, hypervisor
+ *    may also consider tmem "freeable" pages to satisfy the claim.
+ */
+#define _XENMEM_CLAIMF_free_only            0
+#define XENMEM_CLAIMF_free_only             (1U<<_XENMEM_CLAIMF_free_only)
+/*
+ * Get the number of pages currently claimed (but not yet "possessed")
+ * across all domains.  The caller must be privileged but otherwise
+ * the call never fails.=20
+ */
+#define XENMEM_get_unclaimed_pages            25
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
=20
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 64a0cc1..b4dee92 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,13 @@ void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
=20
+/* Claim handling */
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges);
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges);
+int domain_set_unclaimed_pages(
+    struct domain *d, unsigned long pages, unsigned long flags);
+long get_total_unclaimed_pages(void);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..480ef39 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -242,6 +242,7 @@ struct domain
     struct page_list_head page_list;  /* linked list */
     struct page_list_head xenpage_list; /* linked list (size xenheap_pages=
) */
     unsigned int     tot_pages;       /* number of pages currently possese=
d */
+    unsigned int     unclaimed_pages; /* pages claimed but not possessed  =
  */
     unsigned int     max_pages;       /* maximum value for tot_pages      =
  */
     atomic_t         shr_pages;       /* number of shared pages           =
  */
     atomic_t         paged_pages;     /* number of paged-out pages        =
  */

--__1353023564547169741abhmt107.oracle.com
Content-Type: application/octet-stream; name="claim-121115b.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-121115b.patch"

ZGlmZiAtLWdpdCBhL3Rvb2xzL2xpYnhjL3hjX2RvbWFpbi5jIGIvdG9vbHMvbGlieGMveGNfZG9t
YWluLmMKaW5kZXggZDk4ZTY4Yi4uNmQwNmY3YyAxMDA2NDQKLS0tIGEvdG9vbHMvbGlieGMveGNf
ZG9tYWluLmMKKysrIGIvdG9vbHMvbGlieGMveGNfZG9tYWluLmMKQEAgLTIzNCw2ICsyMzQsNyBA
QCBpbnQgeGNfZG9tYWluX2dldGluZm8oeGNfaW50ZXJmYWNlICp4Y2gsCiAKICAgICAgICAgaW5m
by0+c3NpZHJlZiAgPSBkb21jdGwudS5nZXRkb21haW5pbmZvLnNzaWRyZWY7CiAgICAgICAgIGlu
Zm8tPm5yX3BhZ2VzID0gZG9tY3RsLnUuZ2V0ZG9tYWluaW5mby50b3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QEAgLTY4NSw2ICs2
ODUsMzcgQEAgbG9uZyBkb19tZW1vcnlfb3AodW5zaWduZWQgbG9uZyBjbWQsIFhFTl9HVUVTVF9I
QU5ETEVfUEFSQU0odm9pZCkgYXJnKQogICAgICAgICBicmVhazsKICAgICB9CiAKKyAgICBjYXNl
IFhFTk1FTV9jbGFpbV9wYWdlczoKKyAgICAgICAgaWYgKCAhKElTX1BSSVYoY3VycmVudC0+ZG9t
YWluKSkgKQorICAgICAgICAgICAgcmV0dXJuIC1FUEVSTTsKKworICAgICAgICBpZiAoIGNvcHlf
ZnJvbV9ndWVzdCgmcmVzZXJ2YXRpb24sIGFyZywgMSkgKQorICAgICAgICAgICAgcmV0dXJuIC1F
RkFVTFQ7CisKKyAgICAgICAgaWYgKCAhKGd1ZXN0X2hhbmRsZV9pc19udWxsKHJlc2VydmF0aW9u
LmV4dGVudF9zdGFydCkpICkKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworCisgICAgICAg
IGlmICggcmVzZXJ2YXRpb24uZXh0ZW50X29yZGVyICE9IDAgKQorICAgICAgICAgICAgcmV0dXJu
IC1FSU5WQUw7CisKKyAgICAgICAgcmMgPSByY3VfbG9ja190YXJnZXRfZG9tYWluX2J5X2lkKHJl
c2VydmF0aW9uLmRvbWlkLCAmZCk7CisgICAgICAgIGlmICggcmMgKQorICAgICAgICAgICAgcmV0
dXJuIHJjOworCisgICAgICAgIHJjID0gZG9tYWluX3NldF91bmNsYWltZWRfcGFnZXMoZCwgcmVz
ZXJ2YXRpb24ubnJfZXh0ZW50cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICByZXNlcnZhdGlvbi5tZW1fZmxhZ3MpOworCisgICAgICAgIHJjdV91bmxvY2tfZG9tYWlu
KGQpOworCisgICAgICAgIGJyZWFrOworCisgICAgY2FzZSBYRU5NRU1fZ2V0X3VuY2xhaW1lZF9w
YWdlczoKKyAgICAgICAgaWYgKCAhKElTX1BSSVYoY3VycmVud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9t
aWNfdCAgICAgICAgIHBhZ2VkX3BhZ2VzOyAgICAgLyogbnVtYmVyIG9mIHBhZ2VkLW91dCBwYWdl
cyAgICAgICAgICAqLwo=
--__1353023564547169741abhmt107.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__1353023564547169741abhmt107.oracle.com--


From xen-devel-bounces@lists.xen.org Fri Nov 16 00:08:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 00:08:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ9Te-0003n2-09; Fri, 16 Nov 2012 00:08:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TZ9Td-0003mx-7U
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 00:08:09 +0000
Received: from [85.158.143.99:3647] by server-3.bemta-4.messagelabs.com id
	2A/53-06841-8E385A05; Fri, 16 Nov 2012 00:08:08 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1353024486!29205555!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTUyOTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3677 invoked from network); 16 Nov 2012 00:08:07 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-13.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 00:08:07 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAG0734r014846
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 00:07:03 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAG072Wa018661
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 00:07:02 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAG072wI022744; Thu, 15 Nov 2012 18:07:02 -0600
MIME-Version: 1.0
Message-ID: <a667ce8c-29c3-4219-bd02-38a5a9f176e8@default>
Date: Thu, 15 Nov 2012 16:06:57 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>, Ian Campbell
	<Ian.Campbell@citrix.com>
References: <38bc9a60-827c-41f8-a667-e08960b8c135@default>
	<90421d4a-2b5e-49de-9c0f-e4c914980e7f@default>
	<1352888682.26873.23.camel@zakaz.uk.xensource.com>
	<20643.35236.734433.350743@mariner.uk.xensource.com>
In-Reply-To: <20643.35236.734433.350743@mariner.uk.xensource.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen-tmem-list-parse: fix ugly parse output
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Ian Jackson [mailto:Ian.Jackson@eu.citrix.com]
> Subject: Re: [PATCH] xen-tmem-list-parse: fix ugly parse output
> 
> Ian Campbell writes ("Re: [PATCH] xen-tmem-list-parse: fix ugly parse output"):
> > On Wed, 2012-11-14 at 00:08 +0000, Dan Magenheimer wrote:
> >
> > > > Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
> >
> > Acked-by: Ian Campbell <ian.campbell@citrix.com> and applied, sorry for
> > the delay.
> 
> I'm happy to backport this to 4.2.  Since none of this is tested by
> the autotests and the change is self-contained, there is no point
> waiting to see if it survives in -unstable and I have done so right
> away.
> 
> As for 4.1, I think that's really very much in the deep freeze and
> receiving essential bug/compatibility/security fixes only so I would
> be inclined to punt on this patch.
> 
> I have another comment though:
> 
>   The program xen-tmem-list-parse parses the output of xm/xl tmem-list
>   into human-readable format.  A missing NULL terminator sometimes
>   causes garbage to be spewed where the two-letter pool type
>   should be output.
> 
> Would it not be much better if  xl tmem-list  produced a sane format
> to start with ?  I haven't seen what the old and new formats are like
> but in general I think  xl foo-list  should produce information useful
> to humans.
> 
> In xl for the future we should be providing json output for things
> which need to be machine-readable.  This may need a transition plan of
> course.

The real consumer of the tmem-list is a toolstack.  It contains a wealth
of information that might be useful to automatic balancing tools
(for balancing across multiple machines, not so much VMs within a single
machine).  So a long-winded-hard-to-parse-but-human-readable format
didn't seem wise.  Also, because it was not clear at the time (and
still isn't) which of the listed data would be useful, or if more
would be even more useful, I chose a format where more or less
data could be provided forwards- and backwards-compatible across
multiple generations of tools parsing the data.

BUT, the data is also useful for debugging and for experimenters
trying tmem to observe what is going on (I often used
"watch -d 'xm tmem-list | xen-tmem-list-parse'"),
so I hacked up a parsing program to make it human readable.

That's just the history... I am very open to a different approach
as long as it meets the needs described above.  Someone with
a different set of skills than I will need to take it on though.

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 00:08:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 00:08:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZ9Te-0003n2-09; Fri, 16 Nov 2012 00:08:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TZ9Td-0003mx-7U
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 00:08:09 +0000
Received: from [85.158.143.99:3647] by server-3.bemta-4.messagelabs.com id
	2A/53-06841-8E385A05; Fri, 16 Nov 2012 00:08:08 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1353024486!29205555!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTUyOTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3677 invoked from network); 16 Nov 2012 00:08:07 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-13.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 00:08:07 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAG0734r014846
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 00:07:03 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAG072Wa018661
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 00:07:02 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAG072wI022744; Thu, 15 Nov 2012 18:07:02 -0600
MIME-Version: 1.0
Message-ID: <a667ce8c-29c3-4219-bd02-38a5a9f176e8@default>
Date: Thu, 15 Nov 2012 16:06:57 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>, Ian Campbell
	<Ian.Campbell@citrix.com>
References: <38bc9a60-827c-41f8-a667-e08960b8c135@default>
	<90421d4a-2b5e-49de-9c0f-e4c914980e7f@default>
	<1352888682.26873.23.camel@zakaz.uk.xensource.com>
	<20643.35236.734433.350743@mariner.uk.xensource.com>
In-Reply-To: <20643.35236.734433.350743@mariner.uk.xensource.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6661.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen-tmem-list-parse: fix ugly parse output
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Ian Jackson [mailto:Ian.Jackson@eu.citrix.com]
> Subject: Re: [PATCH] xen-tmem-list-parse: fix ugly parse output
> 
> Ian Campbell writes ("Re: [PATCH] xen-tmem-list-parse: fix ugly parse output"):
> > On Wed, 2012-11-14 at 00:08 +0000, Dan Magenheimer wrote:
> >
> > > > Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
> >
> > Acked-by: Ian Campbell <ian.campbell@citrix.com> and applied, sorry for
> > the delay.
> 
> I'm happy to backport this to 4.2.  Since none of this is tested by
> the autotests and the change is self-contained, there is no point
> waiting to see if it survives in -unstable and I have done so right
> away.
> 
> As for 4.1, I think that's really very much in the deep freeze and
> receiving essential bug/compatibility/security fixes only so I would
> be inclined to punt on this patch.
> 
> I have another comment though:
> 
>   The program xen-tmem-list-parse parses the output of xm/xl tmem-list
>   into human-readable format.  A missing NULL terminator sometimes
>   causes garbage to be spewed where the two-letter pool type
>   should be output.
> 
> Would it not be much better if  xl tmem-list  produced a sane format
> to start with ?  I haven't seen what the old and new formats are like
> but in general I think  xl foo-list  should produce information useful
> to humans.
> 
> In xl for the future we should be providing json output for things
> which need to be machine-readable.  This may need a transition plan of
> course.

The real consumer of the tmem-list is a toolstack.  It contains a wealth
of information that might be useful to automatic balancing tools
(for balancing across multiple machines, not so much VMs within a single
machine).  So a long-winded-hard-to-parse-but-human-readable format
didn't seem wise.  Also, because it was not clear at the time (and
still isn't) which of the listed data would be useful, or if more
would be even more useful, I chose a format where more or less
data could be provided forwards- and backwards-compatible across
multiple generations of tools parsing the data.

BUT, the data is also useful for debugging and for experimenters
trying tmem to observe what is going on (I often used
"watch -d 'xm tmem-list | xen-tmem-list-parse'"),
so I hacked up a parsing program to make it human readable.

That's just the history... I am very open to a different approach
as long as it meets the needs described above.  Someone with
a different set of skills than I will need to take it on though.

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 02:19:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 02:19:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZBWC-0001In-VY; Fri, 16 Nov 2012 02:18:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZBWB-0001Ii-Bt
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 02:18:55 +0000
Received: from [85.158.139.83:57004] by server-5.bemta-5.messagelabs.com id
	98/D0-11353-E82A5A05; Fri, 16 Nov 2012 02:18:54 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1353032332!29808692!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTY4MDE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2021 invoked from network); 16 Nov 2012 02:18:53 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 02:18:53 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAG2IntK004511
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 02:18:50 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAG2InwS005647
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 02:18:49 GMT
Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAG2InfL031645; Thu, 15 Nov 2012 20:18:49 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 18:18:48 -0800
Message-ID: <50A5A285.1030805@oracle.com>
Date: Fri, 16 Nov 2012 10:18:45 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963066-570-1-git-send-email-annie.li@oracle.com>
	<1352970612.3499.43.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352970612.3499.43.camel@zakaz.uk.xensource.com>
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent
 grant with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-15 17:10, Ian Campbell wrote:
> On Thu, 2012-11-15 at 07:04 +0000, Annie Li wrote:
>> This patch implements persistent grant in netback driver. Tx and rx
>> share the same page pool, this pool will be split into two parts
>> in next patch.
>>
>> Signed-off-by: Annie Li<annie.li@oracle.com>
>> ---
>>   drivers/net/xen-netback/common.h    |   18 +++-
>>   drivers/net/xen-netback/interface.c |   22 ++++
>>   drivers/net/xen-netback/netback.c   |  212 +++++++++++++++++++++++++++++++----
>>   drivers/net/xen-netback/xenbus.c    |   14 ++-
>>   4 files changed, 239 insertions(+), 27 deletions(-)
>>
>> diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
>> index 94b79c3..a85cac6 100644
>> --- a/drivers/net/xen-netback/common.h
>> +++ b/drivers/net/xen-netback/common.h
>> @@ -45,8 +45,19 @@
>>   #include<xen/grant_table.h>
>>   #include<xen/xenbus.h>
>>
>> +#define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE)
>> +#define XEN_NETIF_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE)
>> +#define MAXIMUM_OUTSTANDING_BLOCK_REQS \
> BLOCK?

Oh, an error when splitting the patch, will fix it, thanks.

>
>> +                       (XEN_NETIF_TX_RING_SIZE + XEN_NETIF_RX_RING_SIZE)
>> +
>>   struct xen_netbk;
>>
>> +struct persistent_entry {
>> +       grant_ref_t forgranted;
>> +       struct page *fpage;
>> +       struct gnttab_map_grant_ref map;
>> +};
> Isn't this duplicating a bunch of infrastructure which is also in
> blkback? Can we put it into some common helpers please?

Yes,

"struct gnttab_map_grant_ref map" can be changed to handle like blkback to keep same as blkback, and share them in common helpers.


>
>> +
>>   struct xenvif {
>>          /* Unique identifier for this interface. */
>>          domid_t          domid;
>> @@ -75,6 +86,7 @@ struct xenvif {
>>
>>          /* Internal feature information. */
>>          u8 can_queue:1;     /* can queue packets for receiver? */
>> +       u8 persistent_grant:1;
>>
>>          /*
>>           * Allow xenvif_start_xmit() to peek ahead in the rx request
>> @@ -98,6 +110,9 @@ struct xenvif {
>>          struct net_device *dev;
>>
>>          wait_queue_head_t waiting_to_free;
>> +
>> +       struct persistent_entry *persistent_gnt[MAXIMUM_OUTSTANDING_BLOCK_REQS];
> What is the per-vif memory overhead of this array?
In this patch,
The maximum of memory overhead is about

(XEN_NETIF_TX_RING_SIZE+XEN_NETIF_RX_RING_SIZE)*PAGE_SIZE  (plus size of grant_ref_t and handle)
which is about 512 PAGE_SIZE. Normally, without heavy network offload, this maximum can not be reached.

In next patch of splitting tx/rx pool, the maximum is about (256+512)PAGE_SIZE.

>
>> +static struct persistent_entry*
>> +get_per_gnt(struct persistent_entry **pers_entry,
>> +           unsigned int count, grant_ref_t gref)
>> +{
>> +       int i;
>> +
>> +       for (i = 0; i<  count; i++)
>> +               if (gref == pers_entry[i]->forgranted)
>> +                       return pers_entry[i];
> Isn't this linear scan rather expensive? I think Roger implemented some
> sort of hash lookup for blkback which I think is required here too (and
> should be easy if you make that code common).

Agree, thanks.

>
>> +
>> +       return NULL;
>> +}
>> +
>> @@ -1338,7 +1497,11 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
>>                  gop->source.domid = vif->domid;
>>                  gop->source.offset = txreq.offset;
>>
>> -               gop->dest.u.gmfn = virt_to_mfn(page_address(page));
>> +               if (!vif->persistent_grant)
>> +                       gop->dest.u.gmfn = virt_to_mfn(page_address(page));
>> +               else
>> +                       gop->dest.u.gmfn = (unsigned long)page_address(page);
> page_address doesn't return any sort of frame number, does it? This is
> rather confusing...

Yes. I only use dest.u.gmfn element to save the page_address here for 
future memcpy, and it does not mean to use frame number actually. To 
avoid confusion, here I can use

gop->dest.u.gmfn = virt_to_mfn(page_address(page));

and then call mfn_to_virt when doing memcpy.


>
>> @@ -453,7 +460,12 @@ static int connect_rings(struct backend_info *be)
>>                  val = 0;
>>          vif->csum = !val;
>>
>> -       /* Map the shared frame, irq etc. */
>> +       if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-persistent-grants",
>> +                        "%u",&val)<  0)
>> +               val = 0;
>> +       vif->persistent_grant = !!val;
>> +
>> +/* Map the shared frame, irq etc. */
> Please run the patches through checkpatch.pl

Yes, I run checkpatch.pl before posting them. The only warning exists in 
initial code netfront.c, it is a printk code in xennet_tx_buf_gc, I did 
not fix that.

Thanks
Annie
>
>>          err = xenvif_connect(vif, tx_ring_ref, rx_ring_ref, evtchn);
>>          if (err) {
>>                  xenbus_dev_fatal(dev, err,
>> --
>> 1.7.3.4
>>
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 02:19:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 02:19:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZBWC-0001In-VY; Fri, 16 Nov 2012 02:18:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZBWB-0001Ii-Bt
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 02:18:55 +0000
Received: from [85.158.139.83:57004] by server-5.bemta-5.messagelabs.com id
	98/D0-11353-E82A5A05; Fri, 16 Nov 2012 02:18:54 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1353032332!29808692!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTY4MDE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2021 invoked from network); 16 Nov 2012 02:18:53 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 02:18:53 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAG2IntK004511
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 02:18:50 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAG2InwS005647
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 02:18:49 GMT
Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAG2InfL031645; Thu, 15 Nov 2012 20:18:49 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 18:18:48 -0800
Message-ID: <50A5A285.1030805@oracle.com>
Date: Fri, 16 Nov 2012 10:18:45 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963066-570-1-git-send-email-annie.li@oracle.com>
	<1352970612.3499.43.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352970612.3499.43.camel@zakaz.uk.xensource.com>
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent
 grant with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-15 17:10, Ian Campbell wrote:
> On Thu, 2012-11-15 at 07:04 +0000, Annie Li wrote:
>> This patch implements persistent grant in netback driver. Tx and rx
>> share the same page pool, this pool will be split into two parts
>> in next patch.
>>
>> Signed-off-by: Annie Li<annie.li@oracle.com>
>> ---
>>   drivers/net/xen-netback/common.h    |   18 +++-
>>   drivers/net/xen-netback/interface.c |   22 ++++
>>   drivers/net/xen-netback/netback.c   |  212 +++++++++++++++++++++++++++++++----
>>   drivers/net/xen-netback/xenbus.c    |   14 ++-
>>   4 files changed, 239 insertions(+), 27 deletions(-)
>>
>> diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
>> index 94b79c3..a85cac6 100644
>> --- a/drivers/net/xen-netback/common.h
>> +++ b/drivers/net/xen-netback/common.h
>> @@ -45,8 +45,19 @@
>>   #include<xen/grant_table.h>
>>   #include<xen/xenbus.h>
>>
>> +#define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE)
>> +#define XEN_NETIF_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE)
>> +#define MAXIMUM_OUTSTANDING_BLOCK_REQS \
> BLOCK?

Oh, an error when splitting the patch, will fix it, thanks.

>
>> +                       (XEN_NETIF_TX_RING_SIZE + XEN_NETIF_RX_RING_SIZE)
>> +
>>   struct xen_netbk;
>>
>> +struct persistent_entry {
>> +       grant_ref_t forgranted;
>> +       struct page *fpage;
>> +       struct gnttab_map_grant_ref map;
>> +};
> Isn't this duplicating a bunch of infrastructure which is also in
> blkback? Can we put it into some common helpers please?

Yes,

"struct gnttab_map_grant_ref map" can be changed to handle like blkback to keep same as blkback, and share them in common helpers.


>
>> +
>>   struct xenvif {
>>          /* Unique identifier for this interface. */
>>          domid_t          domid;
>> @@ -75,6 +86,7 @@ struct xenvif {
>>
>>          /* Internal feature information. */
>>          u8 can_queue:1;     /* can queue packets for receiver? */
>> +       u8 persistent_grant:1;
>>
>>          /*
>>           * Allow xenvif_start_xmit() to peek ahead in the rx request
>> @@ -98,6 +110,9 @@ struct xenvif {
>>          struct net_device *dev;
>>
>>          wait_queue_head_t waiting_to_free;
>> +
>> +       struct persistent_entry *persistent_gnt[MAXIMUM_OUTSTANDING_BLOCK_REQS];
> What is the per-vif memory overhead of this array?
In this patch,
The maximum of memory overhead is about

(XEN_NETIF_TX_RING_SIZE+XEN_NETIF_RX_RING_SIZE)*PAGE_SIZE  (plus size of grant_ref_t and handle)
which is about 512 PAGE_SIZE. Normally, without heavy network offload, this maximum can not be reached.

In next patch of splitting tx/rx pool, the maximum is about (256+512)PAGE_SIZE.

>
>> +static struct persistent_entry*
>> +get_per_gnt(struct persistent_entry **pers_entry,
>> +           unsigned int count, grant_ref_t gref)
>> +{
>> +       int i;
>> +
>> +       for (i = 0; i<  count; i++)
>> +               if (gref == pers_entry[i]->forgranted)
>> +                       return pers_entry[i];
> Isn't this linear scan rather expensive? I think Roger implemented some
> sort of hash lookup for blkback which I think is required here too (and
> should be easy if you make that code common).

Agree, thanks.

>
>> +
>> +       return NULL;
>> +}
>> +
>> @@ -1338,7 +1497,11 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
>>                  gop->source.domid = vif->domid;
>>                  gop->source.offset = txreq.offset;
>>
>> -               gop->dest.u.gmfn = virt_to_mfn(page_address(page));
>> +               if (!vif->persistent_grant)
>> +                       gop->dest.u.gmfn = virt_to_mfn(page_address(page));
>> +               else
>> +                       gop->dest.u.gmfn = (unsigned long)page_address(page);
> page_address doesn't return any sort of frame number, does it? This is
> rather confusing...

Yes. I only use dest.u.gmfn element to save the page_address here for 
future memcpy, and it does not mean to use frame number actually. To 
avoid confusion, here I can use

gop->dest.u.gmfn = virt_to_mfn(page_address(page));

and then call mfn_to_virt when doing memcpy.


>
>> @@ -453,7 +460,12 @@ static int connect_rings(struct backend_info *be)
>>                  val = 0;
>>          vif->csum = !val;
>>
>> -       /* Map the shared frame, irq etc. */
>> +       if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-persistent-grants",
>> +                        "%u",&val)<  0)
>> +               val = 0;
>> +       vif->persistent_grant = !!val;
>> +
>> +/* Map the shared frame, irq etc. */
> Please run the patches through checkpatch.pl

Yes, I run checkpatch.pl before posting them. The only warning exists in 
initial code netfront.c, it is a printk code in xennet_tx_buf_gc, I did 
not fix that.

Thanks
Annie
>
>>          err = xenvif_connect(vif, tx_ring_ref, rx_ring_ref, evtchn);
>>          if (err) {
>>                  xenbus_dev_fatal(dev, err,
>> --
>> 1.7.3.4
>>
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 02:50:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 02:50:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZC0M-0001pO-Kr; Fri, 16 Nov 2012 02:50:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZC0K-0001pJ-Ky
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 02:50:05 +0000
Received: from [193.109.254.147:15824] by server-8.bemta-14.messagelabs.com id
	2F/61-05026-BD9A5A05; Fri, 16 Nov 2012 02:50:03 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353034199!11162192!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NzMxMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16231 invoked from network); 16 Nov 2012 02:50:01 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-8.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 02:50:01 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAG2nuJN001123
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 02:49:57 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAG2ntWt021271
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 02:49:56 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAG2ntIX012020; Thu, 15 Nov 2012 20:49:55 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 18:49:54 -0800
Message-ID: <50A5A9CF.8030008@oracle.com>
Date: Fri, 16 Nov 2012 10:49:51 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963066-570-1-git-send-email-annie.li@oracle.com>
	<50A4BC7D.6060707@citrix.com>
In-Reply-To: <50A4BC7D.6060707@citrix.com>
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent
 grant with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-15 17:57, Roger Pau Monn=E9 wrote:
> On 15/11/12 08:04, Annie Li wrote:
>> This patch implements persistent grant in netback driver. Tx and rx
>> share the same page pool, this pool will be split into two parts
>> in next patch.
>>
>> Signed-off-by: Annie Li<annie.li@oracle.com>
>> ---
>>   drivers/net/xen-netback/common.h    |   18 +++-
>>   drivers/net/xen-netback/interface.c |   22 ++++
>>   drivers/net/xen-netback/netback.c   |  212 +++++++++++++++++++++++++++=
++++----
>>   drivers/net/xen-netback/xenbus.c    |   14 ++-
>>   4 files changed, 239 insertions(+), 27 deletions(-)
>>
>> diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/=
common.h
>> index 94b79c3..a85cac6 100644
>> --- a/drivers/net/xen-netback/common.h
>> +++ b/drivers/net/xen-netback/common.h
>> @@ -45,8 +45,19 @@
>>   #include<xen/grant_table.h>
>>   #include<xen/xenbus.h>
>>
>> +#define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZ=
E)
>> +#define XEN_NETIF_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZ=
E)
>> +#define MAXIMUM_OUTSTANDING_BLOCK_REQS \
>> +                       (XEN_NETIF_TX_RING_SIZE + XEN_NETIF_RX_RING_SIZE)
>> +
>>   struct xen_netbk;
>>
>> +struct persistent_entry {
>> +       grant_ref_t forgranted;
>> +       struct page *fpage;
>> +       struct gnttab_map_grant_ref map;
>> +};
> This should be common with the blkback implementation, I think we should
> move some structures/functions from blkback to a common place. When I
> implementated some functions in blkback I though they could be reused by
> other backends that wanted to use persistent grants, so I keep them free
> of blkback specific structures.

Good idea, thanks.

>
>>   struct xenvif {
>>          /* Unique identifier for this interface. */
>>          domid_t          domid;
>> @@ -75,6 +86,7 @@ struct xenvif {
>>
>>          /* Internal feature information. */
>>          u8 can_queue:1;     /* can queue packets for receiver? */
>> +       u8 persistent_grant:1;
>>
>>          /*
>>           * Allow xenvif_start_xmit() to peek ahead in the rx request
>> @@ -98,6 +110,9 @@ struct xenvif {
>>          struct net_device *dev;
>>
>>          wait_queue_head_t waiting_to_free;
>> +
>> +       struct persistent_entry *persistent_gnt[MAXIMUM_OUTSTANDING_BLOC=
K_REQS];
>> +       unsigned int persistent_gntcnt;
> This should be a red-black tree, which has the property of a search time
> <=3D O(log n), using an array is more expensive in terms of memory and has
> a worse search time O(n), this is specially interesting for netback,
> which can have twice as much persistent grants as blkback (because two
> rings are used).

Right, thanks.

>
> Take a look at the following functions from blkback; foreach_grant,
> add_persistent_gnt and get_persistent_gnt. They are generic functions to
> deal with persistent grants.

Ok, thanks.
Or moving those functions into a separate common file?

>
>>   };
>>
>>   static inline struct xenbus_device *xenvif_to_xenbus_device(struct xen=
vif *vif)
>> @@ -105,9 +120,6 @@ static inline struct xenbus_device *xenvif_to_xenbus=
_device(struct xenvif *vif)
>>          return to_xenbus_device(vif->dev->dev.parent);
>>   }
>>
>> -#define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZ=
E)
>> -#define XEN_NETIF_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZ=
E)
>> -
>>   struct xenvif *xenvif_alloc(struct device *parent,
>>                              domid_t domid,
>>                              unsigned int handle);
>> diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netba=
ck/interface.c
>> index b7d41f8..226d159 100644
>> --- a/drivers/net/xen-netback/interface.c
>> +++ b/drivers/net/xen-netback/interface.c
>> @@ -300,6 +300,8 @@ struct xenvif *xenvif_alloc(struct device *parent, d=
omid_t domid,
>>                  return ERR_PTR(err);
>>          }
>>
>> +       vif->persistent_gntcnt =3D 0;
>> +
>>          netdev_dbg(dev, "Successfully created xenvif\n");
>>          return vif;
>>   }
>> @@ -343,6 +345,23 @@ err:
>>          return err;
>>   }
>>
>> +void xenvif_free_grants(struct persistent_entry **pers_entry,
>> +                       unsigned int count)
>> +{
>> +       int i, ret;
>> +       struct gnttab_unmap_grant_ref unmap;
>> +
>> +       for (i =3D 0; i<  count; i++) {
>> +               gnttab_set_unmap_op(&unmap,
>> +                       (unsigned long)page_to_pfn(pers_entry[i]->fpage),
>> +                       GNTMAP_host_map,
>> +                       pers_entry[i]->map.handle);
>> +               ret =3D gnttab_unmap_refs(&unmap,&pers_entry[i]->fpage,
>> +                                       1, false);
> This is not correct, you should call gnttab_set_unmap_op on a batch of
> grants (up to BLKIF_MAX_SEGMENTS_PER_REQUEST), and then call
> gnttab_unmap_refs on all of them. Here is a simple example (take a look
> at blkback.c function xen_blkif_schedule to see an example with a
> red-black tree, I think this part of the code should also be made common):
>
> for (i =3D 0, segs_to_unmap =3D 0; i<  count; i++) {
> 	gnttab_set_unmap_op(&unmap[segs_to_unmap],
> 		(unsigned long)page_to_pfn(pers_entry[i]->fpage),
> 		GNTMAP_host_map,
> 		pers_entry[i]->map.handle);
> 	pages[segs_to_unmap] =3D
> 		(unsigned long)page_to_pfn(pers_entry[i]->fpage);
> 	if (++segs_to_unmap =3D=3D BLKIF_MAX_SEGMENTS_PER_REQUEST ||
> 		(i + 1) =3D=3D count) {
> 		ret =3D gnttab_unmap_refs(unmap, NULL, pages,
> 			segs_to_unmap);
> 		BUG_ON(ret);
> 		segs_to_unmap =3D=3D 0;
> 	}
> }

Got it, thanks.

>
>> +               BUG_ON(ret);
>> +       }
>> +}
>> +
>>   void xenvif_disconnect(struct xenvif *vif)
>>   {
>>          struct net_device *dev =3D vif->dev;
>> @@ -366,6 +385,9 @@ void xenvif_disconnect(struct xenvif *vif)
>>          unregister_netdev(vif->dev);
>>
>>          xen_netbk_unmap_frontend_rings(vif);
>> +       if (vif->persistent_grant)
>> +               xenvif_free_grants(vif->persistent_gnt,
>> +                                  vif->persistent_gntcnt);
>>
>>          free_netdev(vif->dev);
>>   }
>> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback=
/netback.c
>> index 2596401..a26d3fc 100644
>> --- a/drivers/net/xen-netback/netback.c
>> +++ b/drivers/net/xen-netback/netback.c
>> @@ -80,6 +80,8 @@ union page_ext {
>>          void *mapping;
>>   };
>>
>> +struct xenvif;
>> +
>>   struct xen_netbk {
>>          wait_queue_head_t wq;
>>          struct task_struct *task;
>> @@ -102,6 +104,7 @@ struct xen_netbk {
>>
>>          struct pending_tx_info pending_tx_info[MAX_PENDING_REQS];
>>          struct gnttab_copy tx_copy_ops[MAX_PENDING_REQS];
>> +       struct xenvif *gnttab_tx_vif[MAX_PENDING_REQS];
>>
>>          u16 pending_ring[MAX_PENDING_REQS];
>>
>> @@ -111,12 +114,139 @@ struct xen_netbk {
>>           * straddles two buffers in the frontend.
>>           */
>>          struct gnttab_copy grant_copy_op[2*XEN_NETIF_RX_RING_SIZE];
>> +       struct xenvif *gnttab_rx_vif[2*XEN_NETIF_RX_RING_SIZE];
>>          struct netbk_rx_meta meta[2*XEN_NETIF_RX_RING_SIZE];
>>   };
>>
>>   static struct xen_netbk *xen_netbk;
>>   static int xen_netbk_group_nr;
>>
>> +static struct persistent_entry*
>> +get_per_gnt(struct persistent_entry **pers_entry,
>> +           unsigned int count, grant_ref_t gref)
>> +{
>> +       int i;
>> +
>> +       for (i =3D 0; i<  count; i++)
>> +               if (gref =3D=3D pers_entry[i]->forgranted)
>> +                       return pers_entry[i];
>> +
>> +       return NULL;
>> +}
> This should be replaced with common code shared with all persistent
> backends implementations.

Ok, thanks.

>
>> +
>> +static void*
>> +map_new_gnt(struct persistent_entry **pers_entry, unsigned int count,
>> +           grant_ref_t ref, domid_t domid)
>> +{
>> +       struct gnttab_map_grant_ref *map;
>> +       struct page *page;
>> +       unsigned long vaddr;
>> +       unsigned long pfn;
>> +       uint32_t flags;
>> +       int ret =3D 0;
>> +
>> +       pers_entry[count] =3D (struct persistent_entry *)
>> +                           kmalloc(sizeof(struct persistent_entry),
>> +                                   GFP_KERNEL);
>> +       if (!pers_entry[count])
>> +               return ERR_PTR(-ENOMEM);
>> +
>> +       map =3D&pers_entry[count]->map;
>> +       page =3D alloc_page(GFP_KERNEL);
>> +       if (!page) {
>> +               kfree(pers_entry[count]);
>> +               pers_entry[count] =3D NULL;
>> +               return ERR_PTR(-ENOMEM);
>> +       }
>> +
>> +       pers_entry[count]->fpage =3D page;
>> +       pfn =3D page_to_pfn(page);
>> +       vaddr =3D (unsigned long)pfn_to_kaddr(pfn);
>> +       flags =3D GNTMAP_host_map;
>> +
>> +       gnttab_set_map_op(map, vaddr, flags, ref, domid);
>> +       ret =3D gnttab_map_refs(map, NULL,&page, 1);
>> +       BUG_ON(ret);
> This is highly inefficient, one of the points of using gnttab_set_map_op
> is that you can queue a bunch of grants, and then map them at the same
> time using gnttab_map_refs, but here you are using it to map a single
> grant at a time. You should instead see how much grants you need to map
> to complete the request and map them all at the same time.

Yes, it is inefficient here. But this is limited by current netback =

implementation. Current netback is not per-VIF based(not like blkback =

does). After combining persistent grant and non persistent grant =

together, every vif request in the queue may/may not support persistent =

grant. I have to judge whether every vif in the queue supports =

persistent grant or not. If it support, memcpy is used, if not, =

grantcopy is used.
After making netback per-VIF works, this issue can be fixed.

>
>> +
>> +       pers_entry[count]->forgranted =3D ref;
>> +
>> +       return page_address(page);
>> +}
>> +
>> +static void*
>> +get_ref_page(struct persistent_entry **pers_entry, unsigned int *count,
>> +            grant_ref_t ref, domid_t domid, unsigned int total)
>> +{
>> +       struct persistent_entry *per_gnt;
>> +       void *vaddr;
>> +
>> +       per_gnt =3D get_per_gnt(pers_entry, *count, ref);
>> +
>> +       if (per_gnt !=3D NULL)
>> +               return page_address(per_gnt->fpage);
>> +       else {
>> +               BUG_ON(*count>=3D total);
>> +               vaddr =3D map_new_gnt(pers_entry, *count, ref, domid);
>> +               if (IS_ERR_OR_NULL(vaddr))
>> +                       return vaddr;
>> +               *count +=3D 1;
>> +               return vaddr;
>> +       }
>> +}
>> +
>> +static int
>> +grant_memory_copy_op(unsigned int cmd, void *vuop, unsigned int count,
>> +                    struct xen_netbk *netbk, bool tx_pool)
>> +{
>> +       int i;
>> +       struct xenvif *vif;
>> +       struct gnttab_copy *uop =3D vuop;
>> +       unsigned int *gnt_count;
>> +       unsigned int gnt_total;
>> +       struct persistent_entry **pers_entry;
>> +       int ret =3D 0;
>> +
>> +       BUG_ON(cmd !=3D GNTTABOP_copy);
>> +       for (i =3D 0; i<  count; i++) {
>> +               if (tx_pool)
>> +                       vif =3D netbk->gnttab_tx_vif[i];
>> +               else
>> +                       vif =3D netbk->gnttab_rx_vif[i];
>> +
>> +               pers_entry =3D vif->persistent_gnt;
>> +               gnt_count =3D&vif->persistent_gntcnt;
>> +               gnt_total =3D MAXIMUM_OUTSTANDING_BLOCK_REQS;
>> +
>> +               if (vif->persistent_grant) {
>> +                       void *saddr, *daddr;
>> +
>> +                       saddr =3D uop[i].source.domid =3D=3D DOMID_SELF ?
>> +                               (void *) uop[i].source.u.gmfn :
>> +                               get_ref_page(pers_entry, gnt_count,
>> +                                            uop[i].source.u.ref,
>> +                                            uop[i].source.domid,
>> +                                            gnt_total);
>> +                       if (IS_ERR_OR_NULL(saddr))
>> +                               return -ENOMEM;
>> +
>> +                       daddr =3D uop[i].dest.domid =3D=3D DOMID_SELF ?
>> +                               (void *) uop[i].dest.u.gmfn :
>> +                               get_ref_page(pers_entry, gnt_count,
>> +                                            uop[i].dest.u.ref,
>> +                                            uop[i].dest.domid,
>> +                                            gnt_total);
>> +                       if (IS_ERR_OR_NULL(daddr))
>> +                               return -ENOMEM;
>> +
>> +                       memcpy(daddr+uop[i].dest.offset,
>> +                              saddr+uop[i].source.offset, uop[i].len);
>> +               } else
>> +                       ret =3D HYPERVISOR_grant_table_op(cmd,&uop[i], 1=
);
>> +       }
>> +
>> +       return ret;
>> +}
>> +
>>   void xen_netbk_add_xenvif(struct xenvif *vif)
>>   {
>>          int i;
>> @@ -387,13 +517,15 @@ static struct netbk_rx_meta *get_next_rx_buffer(st=
ruct xenvif *vif,
>>    * Set up the grant operations for this fragment. If it's a flipping
>>    * interface, we also set up the unmap request from here.
>>    */
>> -static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
>> -                               struct netrx_pending_operations *npo,
>> -                               struct page *page, unsigned long size,
>> -                               unsigned long offset, int *head)
>> +static int netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
>> +                              struct netrx_pending_operations *npo,
>> +                              struct page *page, unsigned long size,
>> +                              unsigned long offset, int *head,
>> +                              struct xenvif **grxvif)
>>   {
>>          struct gnttab_copy *copy_gop;
>>          struct netbk_rx_meta *meta;
>> +       int count =3D 0;
>>          /*
>>           * These variables are used iff get_page_ext returns true,
>>           * in which case they are guaranteed to be initialized.
>> @@ -425,6 +557,10 @@ static void netbk_gop_frag_copy(struct xenvif *vif,=
 struct sk_buff *skb,
>>                          bytes =3D MAX_BUFFER_OFFSET - npo->copy_off;
>>
>>                  copy_gop =3D npo->copy + npo->copy_prod++;
>> +               *grxvif =3D vif;
>> +               grxvif++;
>> +               count++;
>> +
>>                  copy_gop->flags =3D GNTCOPY_dest_gref;
>>                  if (foreign) {
>>                          struct xen_netbk *netbk =3D&xen_netbk[group];
>> @@ -438,7 +574,10 @@ static void netbk_gop_frag_copy(struct xenvif *vif,=
 struct sk_buff *skb,
>>                  } else {
>>                          void *vaddr =3D page_address(page);
>>                          copy_gop->source.domid =3D DOMID_SELF;
>> -                       copy_gop->source.u.gmfn =3D virt_to_mfn(vaddr);
>> +                       if (!vif->persistent_grant)
>> +                               copy_gop->source.u.gmfn =3D virt_to_mfn(=
vaddr);
>> +                       else
>> +                               copy_gop->source.u.gmfn =3D (unsigned lo=
ng)vaddr;
>>                  }
>>                  copy_gop->source.offset =3D offset;
>>                  copy_gop->dest.domid =3D vif->domid;
>> @@ -460,6 +599,7 @@ static void netbk_gop_frag_copy(struct xenvif *vif, =
struct sk_buff *skb,
>>                  *head =3D 0; /* There must be something in this buffer =
now. */
>>
>>          }
>> +       return count;
>>   }
>>
>>   /*
>> @@ -474,8 +614,10 @@ static void netbk_gop_frag_copy(struct xenvif *vif,=
 struct sk_buff *skb,
>>    * zero GSO descriptors (for non-GSO packets) or one descriptor (for
>>    * frontend-side LRO).
>>    */
>> -static int netbk_gop_skb(struct sk_buff *skb,
>> -                        struct netrx_pending_operations *npo)
>> +static int netbk_gop_skb(struct xen_netbk *netbk,
>> +                        struct sk_buff *skb,
>> +                        struct netrx_pending_operations *npo,
>> +                        struct xenvif **grxvif)
>>   {
>>          struct xenvif *vif =3D netdev_priv(skb->dev);
>>          int nr_frags =3D skb_shinfo(skb)->nr_frags;
>> @@ -518,17 +660,19 @@ static int netbk_gop_skb(struct sk_buff *skb,
>>                  if (data + len>  skb_tail_pointer(skb))
>>                          len =3D skb_tail_pointer(skb) - data;
>>
>> -               netbk_gop_frag_copy(vif, skb, npo,
>> -                                   virt_to_page(data), len, offset,&hea=
d);
>> +               grxvif +=3D netbk_gop_frag_copy(vif, skb, npo,
>> +                                             virt_to_page(data), len,
>> +                                             offset,&head, grxvif);
>> +
>>                  data +=3D len;
>>          }
>>
>>          for (i =3D 0; i<  nr_frags; i++) {
>> -               netbk_gop_frag_copy(vif, skb, npo,
>> -                                   skb_frag_page(&skb_shinfo(skb)->frag=
s[i]),
>> -                                   skb_frag_size(&skb_shinfo(skb)->frag=
s[i]),
>> -                                   skb_shinfo(skb)->frags[i].page_offse=
t,
>> -&head);
>> +               grxvif +=3D netbk_gop_frag_copy(vif, skb, npo,
>> +                               skb_frag_page(&skb_shinfo(skb)->frags[i]=
),
>> +                               skb_frag_size(&skb_shinfo(skb)->frags[i]=
),
>> +                               skb_shinfo(skb)->frags[i].page_offset,
>> +&head, grxvif);
>>          }
>>
>>          return npo->meta_prod - old_meta_prod;
>> @@ -593,6 +737,8 @@ struct skb_cb_overlay {
>>   static void xen_netbk_rx_action(struct xen_netbk *netbk)
>>   {
>>          struct xenvif *vif =3D NULL, *tmp;
>> +       struct xenvif **grxvif =3D netbk->gnttab_rx_vif;
>> +       int old_copy_prod =3D 0;
>>          s8 status;
>>          u16 irq, flags;
>>          struct xen_netif_rx_response *resp;
>> @@ -619,7 +765,9 @@ static void xen_netbk_rx_action(struct xen_netbk *ne=
tbk)
>>                  nr_frags =3D skb_shinfo(skb)->nr_frags;
>>
>>                  sco =3D (struct skb_cb_overlay *)skb->cb;
>> -               sco->meta_slots_used =3D netbk_gop_skb(skb,&npo);
>> +               sco->meta_slots_used =3D netbk_gop_skb(netbk, skb,&npo, =
grxvif);
>> +               grxvif +=3D npo.copy_prod - old_copy_prod;
>> +               old_copy_prod =3D npo.copy_prod;
>>
>>                  count +=3D nr_frags + 1;
>>
>> @@ -636,8 +784,10 @@ static void xen_netbk_rx_action(struct xen_netbk *n=
etbk)
>>                  return;
>>
>>          BUG_ON(npo.copy_prod>  ARRAY_SIZE(netbk->grant_copy_op));
>> -       ret =3D HYPERVISOR_grant_table_op(GNTTABOP_copy,&netbk->grant_co=
py_op,
>> -                                       npo.copy_prod);
>> +       ret =3D grant_memory_copy_op(GNTTABOP_copy,
>> +&netbk->grant_copy_op,
>> +                                  npo.copy_prod, netbk,
>> +                                  false);
>>          BUG_ON(ret !=3D 0);
>>
>>          while ((skb =3D __skb_dequeue(&rxq)) !=3D NULL) {
>> @@ -918,7 +1068,8 @@ static struct gnttab_copy *xen_netbk_get_requests(s=
truct xen_netbk *netbk,
>>                                                    struct xenvif *vif,
>>                                                    struct sk_buff *skb,
>>                                                    struct xen_netif_tx_r=
equest *txp,
>> -                                                 struct gnttab_copy *go=
p)
>> +                                                 struct gnttab_copy *go=
p,
>> +                                                 struct xenvif **gtxvif)
>>   {
>>          struct skb_shared_info *shinfo =3D skb_shinfo(skb);
>>          skb_frag_t *frags =3D shinfo->frags;
>> @@ -944,7 +1095,11 @@ static struct gnttab_copy *xen_netbk_get_requests(=
struct xen_netbk *netbk,
>>                  gop->source.domid =3D vif->domid;
>>                  gop->source.offset =3D txp->offset;
>>
>> -               gop->dest.u.gmfn =3D virt_to_mfn(page_address(page));
>> +               if (!vif->persistent_grant)
>> +                       gop->dest.u.gmfn =3D virt_to_mfn(page_address(pa=
ge));
>> +               else
>> +                       gop->dest.u.gmfn =3D (unsigned long)page_address=
(page);
>> +
>>                  gop->dest.domid =3D DOMID_SELF;
>>                  gop->dest.offset =3D txp->offset;
>>
>> @@ -952,6 +1107,9 @@ static struct gnttab_copy *xen_netbk_get_requests(s=
truct xen_netbk *netbk,
>>                  gop->flags =3D GNTCOPY_source_gref;
>>
>>                  gop++;
>> +               *gtxvif =3D vif;
>> +               gtxvif++;
>> +
>>
>>                  memcpy(&pending_tx_info[pending_idx].req, txp, sizeof(*=
txp));
>>                  xenvif_get(vif);
>> @@ -1218,6 +1376,7 @@ static bool tx_credit_exceeded(struct xenvif *vif,=
 unsigned size)
>>   static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
>>   {
>>          struct gnttab_copy *gop =3D netbk->tx_copy_ops, *request_gop;
>> +       struct xenvif **gtxvif =3D netbk->gnttab_tx_vif;
>>          struct sk_buff *skb;
>>          int ret;
>>
>> @@ -1338,7 +1497,11 @@ static unsigned xen_netbk_tx_build_gops(struct xe=
n_netbk *netbk)
>>                  gop->source.domid =3D vif->domid;
>>                  gop->source.offset =3D txreq.offset;
>>
>> -               gop->dest.u.gmfn =3D virt_to_mfn(page_address(page));
>> +               if (!vif->persistent_grant)
>> +                       gop->dest.u.gmfn =3D virt_to_mfn(page_address(pa=
ge));
>> +               else
>> +                       gop->dest.u.gmfn =3D (unsigned long)page_address=
(page);
>> +
>>                  gop->dest.domid =3D DOMID_SELF;
>>                  gop->dest.offset =3D txreq.offset;
>>
>> @@ -1346,6 +1509,7 @@ static unsigned xen_netbk_tx_build_gops(struct xen=
_netbk *netbk)
>>                  gop->flags =3D GNTCOPY_source_gref;
>>
>>                  gop++;
>> +               *gtxvif++ =3D vif;
>>
>>                  memcpy(&netbk->pending_tx_info[pending_idx].req,
>>                         &txreq, sizeof(txreq));
>> @@ -1369,12 +1533,13 @@ static unsigned xen_netbk_tx_build_gops(struct x=
en_netbk *netbk)
>>                  netbk->pending_cons++;
>>
>>                  request_gop =3D xen_netbk_get_requests(netbk, vif,
>> -                                                    skb, txfrags, gop);
>> +                                                    skb, txfrags, gop, =
gtxvif);
>>                  if (request_gop =3D=3D NULL) {
>>                          kfree_skb(skb);
>>                          netbk_tx_err(vif,&txreq, idx);
>>                          continue;
>>                  }
>> +               gtxvif +=3D request_gop - gop;
>>                  gop =3D request_gop;
>>
>>                  vif->tx.req_cons =3D idx;
>> @@ -1467,8 +1632,9 @@ static void xen_netbk_tx_action(struct xen_netbk *=
netbk)
>>
>>          if (nr_gops =3D=3D 0)
>>                  return;
>> -       ret =3D HYPERVISOR_grant_table_op(GNTTABOP_copy,
>> -                                       netbk->tx_copy_ops, nr_gops);
>> +       ret =3D grant_memory_copy_op(GNTTABOP_copy,
>> +                                  netbk->tx_copy_ops, nr_gops,
>> +                                  netbk, true);
>>          BUG_ON(ret);
>>
>>          xen_netbk_tx_submit(netbk);
>> diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/=
xenbus.c
>> index 410018c..938e908 100644
>> --- a/drivers/net/xen-netback/xenbus.c
>> +++ b/drivers/net/xen-netback/xenbus.c
>> @@ -114,6 +114,13 @@ static int netback_probe(struct xenbus_device *dev,
>>                          goto abort_transaction;
>>                  }
>>
>> +               err =3D xenbus_printf(xbt, dev->nodename,
>> +                                   "feature-persistent-grants", "%u", 1=
);
>> +               if (err) {
>> +                       message =3D "writing feature-persistent-grants";
>> +                       goto abort_transaction;
>> +               }
>> +
>>                  err =3D xenbus_transaction_end(xbt, 0);
>>          } while (err =3D=3D -EAGAIN);
>>
>> @@ -453,7 +460,12 @@ static int connect_rings(struct backend_info *be)
>>                  val =3D 0;
>>          vif->csum =3D !val;
>>
>> -       /* Map the shared frame, irq etc. */
>> +       if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-persistent-gra=
nts",
>> +                        "%u",&val)<  0)
> In block devices "feature-persistent" is used, so I think that for
> clearness it should be announced the same way in net.
Is it  "feature-persistent" ? I checked your RFC patch, the key is =

"feature-persistent-grants".

Thanks
Annie
>
>> +               val =3D 0;
>> +       vif->persistent_grant =3D !!val;
>> +
>> +/* Map the shared frame, irq etc. */
>>          err =3D xenvif_connect(vif, tx_ring_ref, rx_ring_ref, evtchn);
>>          if (err) {
>>                  xenbus_dev_fatal(dev, err,
>> --
>> 1.7.3.4
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 02:50:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 02:50:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZC0M-0001pO-Kr; Fri, 16 Nov 2012 02:50:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZC0K-0001pJ-Ky
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 02:50:05 +0000
Received: from [193.109.254.147:15824] by server-8.bemta-14.messagelabs.com id
	2F/61-05026-BD9A5A05; Fri, 16 Nov 2012 02:50:03 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353034199!11162192!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NzMxMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16231 invoked from network); 16 Nov 2012 02:50:01 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-8.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 02:50:01 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAG2nuJN001123
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 02:49:57 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAG2ntWt021271
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 02:49:56 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAG2ntIX012020; Thu, 15 Nov 2012 20:49:55 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 18:49:54 -0800
Message-ID: <50A5A9CF.8030008@oracle.com>
Date: Fri, 16 Nov 2012 10:49:51 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963066-570-1-git-send-email-annie.li@oracle.com>
	<50A4BC7D.6060707@citrix.com>
In-Reply-To: <50A4BC7D.6060707@citrix.com>
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent
 grant with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-15 17:57, Roger Pau Monn=E9 wrote:
> On 15/11/12 08:04, Annie Li wrote:
>> This patch implements persistent grant in netback driver. Tx and rx
>> share the same page pool, this pool will be split into two parts
>> in next patch.
>>
>> Signed-off-by: Annie Li<annie.li@oracle.com>
>> ---
>>   drivers/net/xen-netback/common.h    |   18 +++-
>>   drivers/net/xen-netback/interface.c |   22 ++++
>>   drivers/net/xen-netback/netback.c   |  212 +++++++++++++++++++++++++++=
++++----
>>   drivers/net/xen-netback/xenbus.c    |   14 ++-
>>   4 files changed, 239 insertions(+), 27 deletions(-)
>>
>> diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/=
common.h
>> index 94b79c3..a85cac6 100644
>> --- a/drivers/net/xen-netback/common.h
>> +++ b/drivers/net/xen-netback/common.h
>> @@ -45,8 +45,19 @@
>>   #include<xen/grant_table.h>
>>   #include<xen/xenbus.h>
>>
>> +#define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZ=
E)
>> +#define XEN_NETIF_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZ=
E)
>> +#define MAXIMUM_OUTSTANDING_BLOCK_REQS \
>> +                       (XEN_NETIF_TX_RING_SIZE + XEN_NETIF_RX_RING_SIZE)
>> +
>>   struct xen_netbk;
>>
>> +struct persistent_entry {
>> +       grant_ref_t forgranted;
>> +       struct page *fpage;
>> +       struct gnttab_map_grant_ref map;
>> +};
> This should be common with the blkback implementation, I think we should
> move some structures/functions from blkback to a common place. When I
> implementated some functions in blkback I though they could be reused by
> other backends that wanted to use persistent grants, so I keep them free
> of blkback specific structures.

Good idea, thanks.

>
>>   struct xenvif {
>>          /* Unique identifier for this interface. */
>>          domid_t          domid;
>> @@ -75,6 +86,7 @@ struct xenvif {
>>
>>          /* Internal feature information. */
>>          u8 can_queue:1;     /* can queue packets for receiver? */
>> +       u8 persistent_grant:1;
>>
>>          /*
>>           * Allow xenvif_start_xmit() to peek ahead in the rx request
>> @@ -98,6 +110,9 @@ struct xenvif {
>>          struct net_device *dev;
>>
>>          wait_queue_head_t waiting_to_free;
>> +
>> +       struct persistent_entry *persistent_gnt[MAXIMUM_OUTSTANDING_BLOC=
K_REQS];
>> +       unsigned int persistent_gntcnt;
> This should be a red-black tree, which has the property of a search time
> <=3D O(log n), using an array is more expensive in terms of memory and has
> a worse search time O(n), this is specially interesting for netback,
> which can have twice as much persistent grants as blkback (because two
> rings are used).

Right, thanks.

>
> Take a look at the following functions from blkback; foreach_grant,
> add_persistent_gnt and get_persistent_gnt. They are generic functions to
> deal with persistent grants.

Ok, thanks.
Or moving those functions into a separate common file?

>
>>   };
>>
>>   static inline struct xenbus_device *xenvif_to_xenbus_device(struct xen=
vif *vif)
>> @@ -105,9 +120,6 @@ static inline struct xenbus_device *xenvif_to_xenbus=
_device(struct xenvif *vif)
>>          return to_xenbus_device(vif->dev->dev.parent);
>>   }
>>
>> -#define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZ=
E)
>> -#define XEN_NETIF_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZ=
E)
>> -
>>   struct xenvif *xenvif_alloc(struct device *parent,
>>                              domid_t domid,
>>                              unsigned int handle);
>> diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netba=
ck/interface.c
>> index b7d41f8..226d159 100644
>> --- a/drivers/net/xen-netback/interface.c
>> +++ b/drivers/net/xen-netback/interface.c
>> @@ -300,6 +300,8 @@ struct xenvif *xenvif_alloc(struct device *parent, d=
omid_t domid,
>>                  return ERR_PTR(err);
>>          }
>>
>> +       vif->persistent_gntcnt =3D 0;
>> +
>>          netdev_dbg(dev, "Successfully created xenvif\n");
>>          return vif;
>>   }
>> @@ -343,6 +345,23 @@ err:
>>          return err;
>>   }
>>
>> +void xenvif_free_grants(struct persistent_entry **pers_entry,
>> +                       unsigned int count)
>> +{
>> +       int i, ret;
>> +       struct gnttab_unmap_grant_ref unmap;
>> +
>> +       for (i =3D 0; i<  count; i++) {
>> +               gnttab_set_unmap_op(&unmap,
>> +                       (unsigned long)page_to_pfn(pers_entry[i]->fpage),
>> +                       GNTMAP_host_map,
>> +                       pers_entry[i]->map.handle);
>> +               ret =3D gnttab_unmap_refs(&unmap,&pers_entry[i]->fpage,
>> +                                       1, false);
> This is not correct, you should call gnttab_set_unmap_op on a batch of
> grants (up to BLKIF_MAX_SEGMENTS_PER_REQUEST), and then call
> gnttab_unmap_refs on all of them. Here is a simple example (take a look
> at blkback.c function xen_blkif_schedule to see an example with a
> red-black tree, I think this part of the code should also be made common):
>
> for (i =3D 0, segs_to_unmap =3D 0; i<  count; i++) {
> 	gnttab_set_unmap_op(&unmap[segs_to_unmap],
> 		(unsigned long)page_to_pfn(pers_entry[i]->fpage),
> 		GNTMAP_host_map,
> 		pers_entry[i]->map.handle);
> 	pages[segs_to_unmap] =3D
> 		(unsigned long)page_to_pfn(pers_entry[i]->fpage);
> 	if (++segs_to_unmap =3D=3D BLKIF_MAX_SEGMENTS_PER_REQUEST ||
> 		(i + 1) =3D=3D count) {
> 		ret =3D gnttab_unmap_refs(unmap, NULL, pages,
> 			segs_to_unmap);
> 		BUG_ON(ret);
> 		segs_to_unmap =3D=3D 0;
> 	}
> }

Got it, thanks.

>
>> +               BUG_ON(ret);
>> +       }
>> +}
>> +
>>   void xenvif_disconnect(struct xenvif *vif)
>>   {
>>          struct net_device *dev =3D vif->dev;
>> @@ -366,6 +385,9 @@ void xenvif_disconnect(struct xenvif *vif)
>>          unregister_netdev(vif->dev);
>>
>>          xen_netbk_unmap_frontend_rings(vif);
>> +       if (vif->persistent_grant)
>> +               xenvif_free_grants(vif->persistent_gnt,
>> +                                  vif->persistent_gntcnt);
>>
>>          free_netdev(vif->dev);
>>   }
>> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback=
/netback.c
>> index 2596401..a26d3fc 100644
>> --- a/drivers/net/xen-netback/netback.c
>> +++ b/drivers/net/xen-netback/netback.c
>> @@ -80,6 +80,8 @@ union page_ext {
>>          void *mapping;
>>   };
>>
>> +struct xenvif;
>> +
>>   struct xen_netbk {
>>          wait_queue_head_t wq;
>>          struct task_struct *task;
>> @@ -102,6 +104,7 @@ struct xen_netbk {
>>
>>          struct pending_tx_info pending_tx_info[MAX_PENDING_REQS];
>>          struct gnttab_copy tx_copy_ops[MAX_PENDING_REQS];
>> +       struct xenvif *gnttab_tx_vif[MAX_PENDING_REQS];
>>
>>          u16 pending_ring[MAX_PENDING_REQS];
>>
>> @@ -111,12 +114,139 @@ struct xen_netbk {
>>           * straddles two buffers in the frontend.
>>           */
>>          struct gnttab_copy grant_copy_op[2*XEN_NETIF_RX_RING_SIZE];
>> +       struct xenvif *gnttab_rx_vif[2*XEN_NETIF_RX_RING_SIZE];
>>          struct netbk_rx_meta meta[2*XEN_NETIF_RX_RING_SIZE];
>>   };
>>
>>   static struct xen_netbk *xen_netbk;
>>   static int xen_netbk_group_nr;
>>
>> +static struct persistent_entry*
>> +get_per_gnt(struct persistent_entry **pers_entry,
>> +           unsigned int count, grant_ref_t gref)
>> +{
>> +       int i;
>> +
>> +       for (i =3D 0; i<  count; i++)
>> +               if (gref =3D=3D pers_entry[i]->forgranted)
>> +                       return pers_entry[i];
>> +
>> +       return NULL;
>> +}
> This should be replaced with common code shared with all persistent
> backends implementations.

Ok, thanks.

>
>> +
>> +static void*
>> +map_new_gnt(struct persistent_entry **pers_entry, unsigned int count,
>> +           grant_ref_t ref, domid_t domid)
>> +{
>> +       struct gnttab_map_grant_ref *map;
>> +       struct page *page;
>> +       unsigned long vaddr;
>> +       unsigned long pfn;
>> +       uint32_t flags;
>> +       int ret =3D 0;
>> +
>> +       pers_entry[count] =3D (struct persistent_entry *)
>> +                           kmalloc(sizeof(struct persistent_entry),
>> +                                   GFP_KERNEL);
>> +       if (!pers_entry[count])
>> +               return ERR_PTR(-ENOMEM);
>> +
>> +       map =3D&pers_entry[count]->map;
>> +       page =3D alloc_page(GFP_KERNEL);
>> +       if (!page) {
>> +               kfree(pers_entry[count]);
>> +               pers_entry[count] =3D NULL;
>> +               return ERR_PTR(-ENOMEM);
>> +       }
>> +
>> +       pers_entry[count]->fpage =3D page;
>> +       pfn =3D page_to_pfn(page);
>> +       vaddr =3D (unsigned long)pfn_to_kaddr(pfn);
>> +       flags =3D GNTMAP_host_map;
>> +
>> +       gnttab_set_map_op(map, vaddr, flags, ref, domid);
>> +       ret =3D gnttab_map_refs(map, NULL,&page, 1);
>> +       BUG_ON(ret);
> This is highly inefficient, one of the points of using gnttab_set_map_op
> is that you can queue a bunch of grants, and then map them at the same
> time using gnttab_map_refs, but here you are using it to map a single
> grant at a time. You should instead see how much grants you need to map
> to complete the request and map them all at the same time.

Yes, it is inefficient here. But this is limited by current netback =

implementation. Current netback is not per-VIF based(not like blkback =

does). After combining persistent grant and non persistent grant =

together, every vif request in the queue may/may not support persistent =

grant. I have to judge whether every vif in the queue supports =

persistent grant or not. If it support, memcpy is used, if not, =

grantcopy is used.
After making netback per-VIF works, this issue can be fixed.

>
>> +
>> +       pers_entry[count]->forgranted =3D ref;
>> +
>> +       return page_address(page);
>> +}
>> +
>> +static void*
>> +get_ref_page(struct persistent_entry **pers_entry, unsigned int *count,
>> +            grant_ref_t ref, domid_t domid, unsigned int total)
>> +{
>> +       struct persistent_entry *per_gnt;
>> +       void *vaddr;
>> +
>> +       per_gnt =3D get_per_gnt(pers_entry, *count, ref);
>> +
>> +       if (per_gnt !=3D NULL)
>> +               return page_address(per_gnt->fpage);
>> +       else {
>> +               BUG_ON(*count>=3D total);
>> +               vaddr =3D map_new_gnt(pers_entry, *count, ref, domid);
>> +               if (IS_ERR_OR_NULL(vaddr))
>> +                       return vaddr;
>> +               *count +=3D 1;
>> +               return vaddr;
>> +       }
>> +}
>> +
>> +static int
>> +grant_memory_copy_op(unsigned int cmd, void *vuop, unsigned int count,
>> +                    struct xen_netbk *netbk, bool tx_pool)
>> +{
>> +       int i;
>> +       struct xenvif *vif;
>> +       struct gnttab_copy *uop =3D vuop;
>> +       unsigned int *gnt_count;
>> +       unsigned int gnt_total;
>> +       struct persistent_entry **pers_entry;
>> +       int ret =3D 0;
>> +
>> +       BUG_ON(cmd !=3D GNTTABOP_copy);
>> +       for (i =3D 0; i<  count; i++) {
>> +               if (tx_pool)
>> +                       vif =3D netbk->gnttab_tx_vif[i];
>> +               else
>> +                       vif =3D netbk->gnttab_rx_vif[i];
>> +
>> +               pers_entry =3D vif->persistent_gnt;
>> +               gnt_count =3D&vif->persistent_gntcnt;
>> +               gnt_total =3D MAXIMUM_OUTSTANDING_BLOCK_REQS;
>> +
>> +               if (vif->persistent_grant) {
>> +                       void *saddr, *daddr;
>> +
>> +                       saddr =3D uop[i].source.domid =3D=3D DOMID_SELF ?
>> +                               (void *) uop[i].source.u.gmfn :
>> +                               get_ref_page(pers_entry, gnt_count,
>> +                                            uop[i].source.u.ref,
>> +                                            uop[i].source.domid,
>> +                                            gnt_total);
>> +                       if (IS_ERR_OR_NULL(saddr))
>> +                               return -ENOMEM;
>> +
>> +                       daddr =3D uop[i].dest.domid =3D=3D DOMID_SELF ?
>> +                               (void *) uop[i].dest.u.gmfn :
>> +                               get_ref_page(pers_entry, gnt_count,
>> +                                            uop[i].dest.u.ref,
>> +                                            uop[i].dest.domid,
>> +                                            gnt_total);
>> +                       if (IS_ERR_OR_NULL(daddr))
>> +                               return -ENOMEM;
>> +
>> +                       memcpy(daddr+uop[i].dest.offset,
>> +                              saddr+uop[i].source.offset, uop[i].len);
>> +               } else
>> +                       ret =3D HYPERVISOR_grant_table_op(cmd,&uop[i], 1=
);
>> +       }
>> +
>> +       return ret;
>> +}
>> +
>>   void xen_netbk_add_xenvif(struct xenvif *vif)
>>   {
>>          int i;
>> @@ -387,13 +517,15 @@ static struct netbk_rx_meta *get_next_rx_buffer(st=
ruct xenvif *vif,
>>    * Set up the grant operations for this fragment. If it's a flipping
>>    * interface, we also set up the unmap request from here.
>>    */
>> -static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
>> -                               struct netrx_pending_operations *npo,
>> -                               struct page *page, unsigned long size,
>> -                               unsigned long offset, int *head)
>> +static int netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
>> +                              struct netrx_pending_operations *npo,
>> +                              struct page *page, unsigned long size,
>> +                              unsigned long offset, int *head,
>> +                              struct xenvif **grxvif)
>>   {
>>          struct gnttab_copy *copy_gop;
>>          struct netbk_rx_meta *meta;
>> +       int count =3D 0;
>>          /*
>>           * These variables are used iff get_page_ext returns true,
>>           * in which case they are guaranteed to be initialized.
>> @@ -425,6 +557,10 @@ static void netbk_gop_frag_copy(struct xenvif *vif,=
 struct sk_buff *skb,
>>                          bytes =3D MAX_BUFFER_OFFSET - npo->copy_off;
>>
>>                  copy_gop =3D npo->copy + npo->copy_prod++;
>> +               *grxvif =3D vif;
>> +               grxvif++;
>> +               count++;
>> +
>>                  copy_gop->flags =3D GNTCOPY_dest_gref;
>>                  if (foreign) {
>>                          struct xen_netbk *netbk =3D&xen_netbk[group];
>> @@ -438,7 +574,10 @@ static void netbk_gop_frag_copy(struct xenvif *vif,=
 struct sk_buff *skb,
>>                  } else {
>>                          void *vaddr =3D page_address(page);
>>                          copy_gop->source.domid =3D DOMID_SELF;
>> -                       copy_gop->source.u.gmfn =3D virt_to_mfn(vaddr);
>> +                       if (!vif->persistent_grant)
>> +                               copy_gop->source.u.gmfn =3D virt_to_mfn(=
vaddr);
>> +                       else
>> +                               copy_gop->source.u.gmfn =3D (unsigned lo=
ng)vaddr;
>>                  }
>>                  copy_gop->source.offset =3D offset;
>>                  copy_gop->dest.domid =3D vif->domid;
>> @@ -460,6 +599,7 @@ static void netbk_gop_frag_copy(struct xenvif *vif, =
struct sk_buff *skb,
>>                  *head =3D 0; /* There must be something in this buffer =
now. */
>>
>>          }
>> +       return count;
>>   }
>>
>>   /*
>> @@ -474,8 +614,10 @@ static void netbk_gop_frag_copy(struct xenvif *vif,=
 struct sk_buff *skb,
>>    * zero GSO descriptors (for non-GSO packets) or one descriptor (for
>>    * frontend-side LRO).
>>    */
>> -static int netbk_gop_skb(struct sk_buff *skb,
>> -                        struct netrx_pending_operations *npo)
>> +static int netbk_gop_skb(struct xen_netbk *netbk,
>> +                        struct sk_buff *skb,
>> +                        struct netrx_pending_operations *npo,
>> +                        struct xenvif **grxvif)
>>   {
>>          struct xenvif *vif =3D netdev_priv(skb->dev);
>>          int nr_frags =3D skb_shinfo(skb)->nr_frags;
>> @@ -518,17 +660,19 @@ static int netbk_gop_skb(struct sk_buff *skb,
>>                  if (data + len>  skb_tail_pointer(skb))
>>                          len =3D skb_tail_pointer(skb) - data;
>>
>> -               netbk_gop_frag_copy(vif, skb, npo,
>> -                                   virt_to_page(data), len, offset,&hea=
d);
>> +               grxvif +=3D netbk_gop_frag_copy(vif, skb, npo,
>> +                                             virt_to_page(data), len,
>> +                                             offset,&head, grxvif);
>> +
>>                  data +=3D len;
>>          }
>>
>>          for (i =3D 0; i<  nr_frags; i++) {
>> -               netbk_gop_frag_copy(vif, skb, npo,
>> -                                   skb_frag_page(&skb_shinfo(skb)->frag=
s[i]),
>> -                                   skb_frag_size(&skb_shinfo(skb)->frag=
s[i]),
>> -                                   skb_shinfo(skb)->frags[i].page_offse=
t,
>> -&head);
>> +               grxvif +=3D netbk_gop_frag_copy(vif, skb, npo,
>> +                               skb_frag_page(&skb_shinfo(skb)->frags[i]=
),
>> +                               skb_frag_size(&skb_shinfo(skb)->frags[i]=
),
>> +                               skb_shinfo(skb)->frags[i].page_offset,
>> +&head, grxvif);
>>          }
>>
>>          return npo->meta_prod - old_meta_prod;
>> @@ -593,6 +737,8 @@ struct skb_cb_overlay {
>>   static void xen_netbk_rx_action(struct xen_netbk *netbk)
>>   {
>>          struct xenvif *vif =3D NULL, *tmp;
>> +       struct xenvif **grxvif =3D netbk->gnttab_rx_vif;
>> +       int old_copy_prod =3D 0;
>>          s8 status;
>>          u16 irq, flags;
>>          struct xen_netif_rx_response *resp;
>> @@ -619,7 +765,9 @@ static void xen_netbk_rx_action(struct xen_netbk *ne=
tbk)
>>                  nr_frags =3D skb_shinfo(skb)->nr_frags;
>>
>>                  sco =3D (struct skb_cb_overlay *)skb->cb;
>> -               sco->meta_slots_used =3D netbk_gop_skb(skb,&npo);
>> +               sco->meta_slots_used =3D netbk_gop_skb(netbk, skb,&npo, =
grxvif);
>> +               grxvif +=3D npo.copy_prod - old_copy_prod;
>> +               old_copy_prod =3D npo.copy_prod;
>>
>>                  count +=3D nr_frags + 1;
>>
>> @@ -636,8 +784,10 @@ static void xen_netbk_rx_action(struct xen_netbk *n=
etbk)
>>                  return;
>>
>>          BUG_ON(npo.copy_prod>  ARRAY_SIZE(netbk->grant_copy_op));
>> -       ret =3D HYPERVISOR_grant_table_op(GNTTABOP_copy,&netbk->grant_co=
py_op,
>> -                                       npo.copy_prod);
>> +       ret =3D grant_memory_copy_op(GNTTABOP_copy,
>> +&netbk->grant_copy_op,
>> +                                  npo.copy_prod, netbk,
>> +                                  false);
>>          BUG_ON(ret !=3D 0);
>>
>>          while ((skb =3D __skb_dequeue(&rxq)) !=3D NULL) {
>> @@ -918,7 +1068,8 @@ static struct gnttab_copy *xen_netbk_get_requests(s=
truct xen_netbk *netbk,
>>                                                    struct xenvif *vif,
>>                                                    struct sk_buff *skb,
>>                                                    struct xen_netif_tx_r=
equest *txp,
>> -                                                 struct gnttab_copy *go=
p)
>> +                                                 struct gnttab_copy *go=
p,
>> +                                                 struct xenvif **gtxvif)
>>   {
>>          struct skb_shared_info *shinfo =3D skb_shinfo(skb);
>>          skb_frag_t *frags =3D shinfo->frags;
>> @@ -944,7 +1095,11 @@ static struct gnttab_copy *xen_netbk_get_requests(=
struct xen_netbk *netbk,
>>                  gop->source.domid =3D vif->domid;
>>                  gop->source.offset =3D txp->offset;
>>
>> -               gop->dest.u.gmfn =3D virt_to_mfn(page_address(page));
>> +               if (!vif->persistent_grant)
>> +                       gop->dest.u.gmfn =3D virt_to_mfn(page_address(pa=
ge));
>> +               else
>> +                       gop->dest.u.gmfn =3D (unsigned long)page_address=
(page);
>> +
>>                  gop->dest.domid =3D DOMID_SELF;
>>                  gop->dest.offset =3D txp->offset;
>>
>> @@ -952,6 +1107,9 @@ static struct gnttab_copy *xen_netbk_get_requests(s=
truct xen_netbk *netbk,
>>                  gop->flags =3D GNTCOPY_source_gref;
>>
>>                  gop++;
>> +               *gtxvif =3D vif;
>> +               gtxvif++;
>> +
>>
>>                  memcpy(&pending_tx_info[pending_idx].req, txp, sizeof(*=
txp));
>>                  xenvif_get(vif);
>> @@ -1218,6 +1376,7 @@ static bool tx_credit_exceeded(struct xenvif *vif,=
 unsigned size)
>>   static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
>>   {
>>          struct gnttab_copy *gop =3D netbk->tx_copy_ops, *request_gop;
>> +       struct xenvif **gtxvif =3D netbk->gnttab_tx_vif;
>>          struct sk_buff *skb;
>>          int ret;
>>
>> @@ -1338,7 +1497,11 @@ static unsigned xen_netbk_tx_build_gops(struct xe=
n_netbk *netbk)
>>                  gop->source.domid =3D vif->domid;
>>                  gop->source.offset =3D txreq.offset;
>>
>> -               gop->dest.u.gmfn =3D virt_to_mfn(page_address(page));
>> +               if (!vif->persistent_grant)
>> +                       gop->dest.u.gmfn =3D virt_to_mfn(page_address(pa=
ge));
>> +               else
>> +                       gop->dest.u.gmfn =3D (unsigned long)page_address=
(page);
>> +
>>                  gop->dest.domid =3D DOMID_SELF;
>>                  gop->dest.offset =3D txreq.offset;
>>
>> @@ -1346,6 +1509,7 @@ static unsigned xen_netbk_tx_build_gops(struct xen=
_netbk *netbk)
>>                  gop->flags =3D GNTCOPY_source_gref;
>>
>>                  gop++;
>> +               *gtxvif++ =3D vif;
>>
>>                  memcpy(&netbk->pending_tx_info[pending_idx].req,
>>                         &txreq, sizeof(txreq));
>> @@ -1369,12 +1533,13 @@ static unsigned xen_netbk_tx_build_gops(struct x=
en_netbk *netbk)
>>                  netbk->pending_cons++;
>>
>>                  request_gop =3D xen_netbk_get_requests(netbk, vif,
>> -                                                    skb, txfrags, gop);
>> +                                                    skb, txfrags, gop, =
gtxvif);
>>                  if (request_gop =3D=3D NULL) {
>>                          kfree_skb(skb);
>>                          netbk_tx_err(vif,&txreq, idx);
>>                          continue;
>>                  }
>> +               gtxvif +=3D request_gop - gop;
>>                  gop =3D request_gop;
>>
>>                  vif->tx.req_cons =3D idx;
>> @@ -1467,8 +1632,9 @@ static void xen_netbk_tx_action(struct xen_netbk *=
netbk)
>>
>>          if (nr_gops =3D=3D 0)
>>                  return;
>> -       ret =3D HYPERVISOR_grant_table_op(GNTTABOP_copy,
>> -                                       netbk->tx_copy_ops, nr_gops);
>> +       ret =3D grant_memory_copy_op(GNTTABOP_copy,
>> +                                  netbk->tx_copy_ops, nr_gops,
>> +                                  netbk, true);
>>          BUG_ON(ret);
>>
>>          xen_netbk_tx_submit(netbk);
>> diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/=
xenbus.c
>> index 410018c..938e908 100644
>> --- a/drivers/net/xen-netback/xenbus.c
>> +++ b/drivers/net/xen-netback/xenbus.c
>> @@ -114,6 +114,13 @@ static int netback_probe(struct xenbus_device *dev,
>>                          goto abort_transaction;
>>                  }
>>
>> +               err =3D xenbus_printf(xbt, dev->nodename,
>> +                                   "feature-persistent-grants", "%u", 1=
);
>> +               if (err) {
>> +                       message =3D "writing feature-persistent-grants";
>> +                       goto abort_transaction;
>> +               }
>> +
>>                  err =3D xenbus_transaction_end(xbt, 0);
>>          } while (err =3D=3D -EAGAIN);
>>
>> @@ -453,7 +460,12 @@ static int connect_rings(struct backend_info *be)
>>                  val =3D 0;
>>          vif->csum =3D !val;
>>
>> -       /* Map the shared frame, irq etc. */
>> +       if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-persistent-gra=
nts",
>> +                        "%u",&val)<  0)
> In block devices "feature-persistent" is used, so I think that for
> clearness it should be announced the same way in net.
Is it  "feature-persistent" ? I checked your RFC patch, the key is =

"feature-persistent-grants".

Thanks
Annie
>
>> +               val =3D 0;
>> +       vif->persistent_grant =3D !!val;
>> +
>> +/* Map the shared frame, irq etc. */
>>          err =3D xenvif_connect(vif, tx_ring_ref, rx_ring_ref, evtchn);
>>          if (err) {
>>                  xenbus_dev_fatal(dev, err,
>> --
>> 1.7.3.4
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 03:10:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 03:10:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZCJr-0002HV-KB; Fri, 16 Nov 2012 03:10:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZCJq-0002HQ-LX
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 03:10:14 +0000
Received: from [85.158.137.99:36760] by server-9.bemta-3.messagelabs.com id
	7B/A9-02388-59EA5A05; Fri, 16 Nov 2012 03:10:13 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1353035411!16163163!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTY4MDE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 726 invoked from network); 16 Nov 2012 03:10:12 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 03:10:12 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAG3A66L005302
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 03:10:07 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAG3A56Z001229
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 03:10:06 GMT
Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAG3A5bK021953; Thu, 15 Nov 2012 21:10:05 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 19:10:04 -0800
Message-ID: <50A5AE89.3090500@oracle.com>
Date: Fri, 16 Nov 2012 11:10:01 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963089-599-1-git-send-email-annie.li@oracle.com>
	<1352970913.3499.47.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352970913.3499.47.camel@zakaz.uk.xensource.com>
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 2/4] xen/netback: Split one page pool into
 two(tx/rx) page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-15 17:15, Ian Campbell wrote:
> On Thu, 2012-11-15 at 07:04 +0000, Annie Li wrote:
>> For tx path, this implementation simplifies the work of searching out
>> grant page from page pool based on grant reference.
> It's still a linear search though, and it doesn't look much simpler to
> me:
>    	for (i = 0; i<  count; i++) {
> 		if (tx_pool)
> 			vif = netbk->gnttab_tx_vif[i];
> 		else
> 			vif = netbk->gnttab_rx_vif[i];
>
> 		pers_entry = vif->persistent_gnt;
> 		gnt_count =&vif->persistent_gntcnt;
> 		gnt_total = MAXIMUM_OUTSTANDING_BLOCK_REQS;
> becomes:
> 	for (i = 0; i<  count; i++) {
> 		if (tx_pool) {
> 			vif = netbk->gnttab_tx_vif[i];
> 			gnt_count =&vif->persistent_tx_gntcnt;
> 			gnt_total = XEN_NETIF_TX_RING_SIZE;
> 			pers_entry = vif->persistent_tx_gnt;
> 		} else {
> 			vif = netbk->gnttab_rx_vif[i];
> 			gnt_count =&vif->persistent_rx_gntcnt;
> 			gnt_total = 2*XEN_NETIF_RX_RING_SIZE;
> 			pers_entry = vif->persistent_rx_gnt;
> 		}

Yes, the code is not simpler. If we make netback per-VIF based, then 
these code will disappear.
The simplifying here means for tx path, the max search index is 
XEN_NETIF_TX_RING_SIZE(256 here), and this change can save some time 
when searching out grant page for specific grant reference.

>
>> @@ -111,8 +109,16 @@ struct xenvif {
>>
>>   	wait_queue_head_t waiting_to_free;
>>
>> -	struct persistent_entry *persistent_gnt[MAXIMUM_OUTSTANDING_BLOCK_REQS];
>> -	unsigned int persistent_gntcnt;
>> +	struct persistent_entry *persistent_tx_gnt[XEN_NETIF_TX_RING_SIZE];
>> +
>> +	/*
>> +	 * 2*XEN_NETIF_RX_RING_SIZE is for the case of each head/fragment page
> Shouldn't that been incorporated into MAXIMUM_OUTSTANDING_BLOCK_REQS
> (sic) too?

Yes, the total value is same as MAXIMUM_OUTSTANDING_BLOCK_REQS. But here

2*XEN_NETIF_RX_RING_SIZE means it is only used by rx path, and it is used just like other elements in netback structure, such as grant_copy_op, meta, etc.


>> +	 * using 2 copy operations.
>> +	 */
>> +	struct persistent_entry *persistent_rx_gnt[2*XEN_NETIF_RX_RING_SIZE];
> What is the per-vif memory overhead after this change?

Per-vif memory overhead is following,
for tx path, it is about XEN_NETIF_RX_RING_SIZE*PAGE_SIZE  (256 
PAGE_SIZE here)
for rx path, it is about 2*XEN_NETIF_RX_RING_SIZE*PAGE_SIZE  (512 
PAGE_SIZE here)

I can add some comment here.

Thanks
Annie
>
> Ian.
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 03:10:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 03:10:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZCJr-0002HV-KB; Fri, 16 Nov 2012 03:10:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZCJq-0002HQ-LX
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 03:10:14 +0000
Received: from [85.158.137.99:36760] by server-9.bemta-3.messagelabs.com id
	7B/A9-02388-59EA5A05; Fri, 16 Nov 2012 03:10:13 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1353035411!16163163!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTY4MDE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 726 invoked from network); 16 Nov 2012 03:10:12 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 03:10:12 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAG3A66L005302
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 03:10:07 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAG3A56Z001229
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 03:10:06 GMT
Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAG3A5bK021953; Thu, 15 Nov 2012 21:10:05 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 19:10:04 -0800
Message-ID: <50A5AE89.3090500@oracle.com>
Date: Fri, 16 Nov 2012 11:10:01 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963089-599-1-git-send-email-annie.li@oracle.com>
	<1352970913.3499.47.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352970913.3499.47.camel@zakaz.uk.xensource.com>
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 2/4] xen/netback: Split one page pool into
 two(tx/rx) page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-15 17:15, Ian Campbell wrote:
> On Thu, 2012-11-15 at 07:04 +0000, Annie Li wrote:
>> For tx path, this implementation simplifies the work of searching out
>> grant page from page pool based on grant reference.
> It's still a linear search though, and it doesn't look much simpler to
> me:
>    	for (i = 0; i<  count; i++) {
> 		if (tx_pool)
> 			vif = netbk->gnttab_tx_vif[i];
> 		else
> 			vif = netbk->gnttab_rx_vif[i];
>
> 		pers_entry = vif->persistent_gnt;
> 		gnt_count =&vif->persistent_gntcnt;
> 		gnt_total = MAXIMUM_OUTSTANDING_BLOCK_REQS;
> becomes:
> 	for (i = 0; i<  count; i++) {
> 		if (tx_pool) {
> 			vif = netbk->gnttab_tx_vif[i];
> 			gnt_count =&vif->persistent_tx_gntcnt;
> 			gnt_total = XEN_NETIF_TX_RING_SIZE;
> 			pers_entry = vif->persistent_tx_gnt;
> 		} else {
> 			vif = netbk->gnttab_rx_vif[i];
> 			gnt_count =&vif->persistent_rx_gntcnt;
> 			gnt_total = 2*XEN_NETIF_RX_RING_SIZE;
> 			pers_entry = vif->persistent_rx_gnt;
> 		}

Yes, the code is not simpler. If we make netback per-VIF based, then 
these code will disappear.
The simplifying here means for tx path, the max search index is 
XEN_NETIF_TX_RING_SIZE(256 here), and this change can save some time 
when searching out grant page for specific grant reference.

>
>> @@ -111,8 +109,16 @@ struct xenvif {
>>
>>   	wait_queue_head_t waiting_to_free;
>>
>> -	struct persistent_entry *persistent_gnt[MAXIMUM_OUTSTANDING_BLOCK_REQS];
>> -	unsigned int persistent_gntcnt;
>> +	struct persistent_entry *persistent_tx_gnt[XEN_NETIF_TX_RING_SIZE];
>> +
>> +	/*
>> +	 * 2*XEN_NETIF_RX_RING_SIZE is for the case of each head/fragment page
> Shouldn't that been incorporated into MAXIMUM_OUTSTANDING_BLOCK_REQS
> (sic) too?

Yes, the total value is same as MAXIMUM_OUTSTANDING_BLOCK_REQS. But here

2*XEN_NETIF_RX_RING_SIZE means it is only used by rx path, and it is used just like other elements in netback structure, such as grant_copy_op, meta, etc.


>> +	 * using 2 copy operations.
>> +	 */
>> +	struct persistent_entry *persistent_rx_gnt[2*XEN_NETIF_RX_RING_SIZE];
> What is the per-vif memory overhead after this change?

Per-vif memory overhead is following,
for tx path, it is about XEN_NETIF_RX_RING_SIZE*PAGE_SIZE  (256 
PAGE_SIZE here)
for rx path, it is about 2*XEN_NETIF_RX_RING_SIZE*PAGE_SIZE  (512 
PAGE_SIZE here)

I can add some comment here.

Thanks
Annie
>
> Ian.
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 03:26:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 03:26:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZCZU-0002fp-5M; Fri, 16 Nov 2012 03:26:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZCZT-0002fk-84
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 03:26:23 +0000
Received: from [85.158.143.35:62591] by server-3.bemta-4.messagelabs.com id
	6F/28-06841-E52B5A05; Fri, 16 Nov 2012 03:26:22 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1353036367!17987650!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg4NDY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18741 invoked from network); 16 Nov 2012 03:26:08 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-14.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 03:26:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,261,1352073600"; d="scan'208";a="15840243"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 03:26:03 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 03:26:03 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TZCZ9-0003fD-J6;
	Fri, 16 Nov 2012 03:26:03 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TZCZ9-0006Fq-Ij;
	Fri, 16 Nov 2012 03:26:03 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14408-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 16 Nov 2012 03:26:03 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14408: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14408 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14408/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14399
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14399
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14399
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14399

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  321f8487379b
baseline version:
 xen                  d1d05cb59a76

------------------------------------------------------------
People who touched revisions under test:
  Andre Przywara <osp@andrep.de>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Boris Ostrovsky <boris.ostrovsky@amd.com>
  Christoph Egger <Christoph_Egger@gmx.de>
  Ian Campbell <ian.campbell@citrix.com>
  Jim Fehlig <jfehlig@suse.com>
  Keir Fraser <keir@xen.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
  Wei Huang <wei.huang2@amd.com>
  Wei Wang <weiwang.dd@gmail.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=321f8487379b
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 321f8487379b
+ branch=xen-unstable
+ revision=321f8487379b
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 321f8487379b ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 8 changesets with 19 changes to 17 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 03:26:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 03:26:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZCZU-0002fp-5M; Fri, 16 Nov 2012 03:26:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZCZT-0002fk-84
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 03:26:23 +0000
Received: from [85.158.143.35:62591] by server-3.bemta-4.messagelabs.com id
	6F/28-06841-E52B5A05; Fri, 16 Nov 2012 03:26:22 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1353036367!17987650!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg4NDY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18741 invoked from network); 16 Nov 2012 03:26:08 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-14.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 03:26:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,261,1352073600"; d="scan'208";a="15840243"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 03:26:03 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 03:26:03 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TZCZ9-0003fD-J6;
	Fri, 16 Nov 2012 03:26:03 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TZCZ9-0006Fq-Ij;
	Fri, 16 Nov 2012 03:26:03 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14408-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 16 Nov 2012 03:26:03 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14408: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14408 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14408/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14399
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14399
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14399
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14399

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  321f8487379b
baseline version:
 xen                  d1d05cb59a76

------------------------------------------------------------
People who touched revisions under test:
  Andre Przywara <osp@andrep.de>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Boris Ostrovsky <boris.ostrovsky@amd.com>
  Christoph Egger <Christoph_Egger@gmx.de>
  Ian Campbell <ian.campbell@citrix.com>
  Jim Fehlig <jfehlig@suse.com>
  Keir Fraser <keir@xen.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
  Wei Huang <wei.huang2@amd.com>
  Wei Wang <weiwang.dd@gmail.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=321f8487379b
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 321f8487379b
+ branch=xen-unstable
+ revision=321f8487379b
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 321f8487379b ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 8 changesets with 19 changes to 17 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 03:47:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 03:47:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZCtx-0003Jw-VM; Fri, 16 Nov 2012 03:47:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kgrace.liu@gmail.com>) id 1TZCtw-0003Jr-VL
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 03:47:33 +0000
Received: from [85.158.139.211:5228] by server-7.bemta-5.messagelabs.com id
	04/B6-23096-457B5A05; Fri, 16 Nov 2012 03:47:32 +0000
X-Env-Sender: kgrace.liu@gmail.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353037650!20325288!1
X-Originating-IP: [209.85.219.43]
X-SpamReason: No, hits=0.9 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_30_40,HTML_MESSAGE,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1432 invoked from network); 16 Nov 2012 03:47:31 -0000
Received: from mail-oa0-f43.google.com (HELO mail-oa0-f43.google.com)
	(209.85.219.43)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 03:47:31 -0000
Received: by mail-oa0-f43.google.com with SMTP id k1so3102506oag.30
	for <xen-devel@lists.xensource.com>;
	Thu, 15 Nov 2012 19:47:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=KYBK9c5b1ZVIaeB6fFDLqtW8OajCM+qqwxPUNK/Up48=;
	b=JEUAHMEtzGtLBJPgCtaYkoqymcREQzc5LupoW24HAlflEIT5qhLPbxToFoDoUE98Th
	Ik+cFUf3iW9moXYDbgQWJVh3iTTYn596nCh8HFNTRHOFwlPCxdoD92Khamwjg1y852Vo
	V4Gg3bjn64Jq46ss/q7nzPdUhDMbQ8gKgCowLakr6dDzbVTfF5JMe49Zvk6vumtsVlfl
	Fo3NcRMhKZh2Wp+TbkTh/EjC89UyJYKfqxA81AZusI1eE/WtUQ3NrWe6XPDdRDvUFS3y
	93alVnOw6k4uOUatv7mXwZ2SWgpeYWExEXiZeR1vsHOGQak1+S30jGjGDtaP1d1fe2ad
	aW3Q==
MIME-Version: 1.0
Received: by 10.182.116.6 with SMTP id js6mr2756218obb.82.1353037649926; Thu,
	15 Nov 2012 19:47:29 -0800 (PST)
Received: by 10.60.21.163 with HTTP; Thu, 15 Nov 2012 19:47:29 -0800 (PST)
In-Reply-To: <1352971089.3499.49.camel@zakaz.uk.xensource.com>
References: <CAERYnoYbLddzpE6729Nkx2YzMPcr09Do0f1rkob4U1h34NjQgQ@mail.gmail.com>
	<1352734133.27833.277.camel@zakaz.uk.xensource.com>
	<CAERYnoYg1iaM==-Gk__LtXLbQKaSpM-KAR-jr-cUPkt-WEe_aA@mail.gmail.com>
	<CAERYnoYgwRBycoc9+nV7uOk1Brwjs2r=QecpgKDQjASjwdkiew@mail.gmail.com>
	<1352971089.3499.49.camel@zakaz.uk.xensource.com>
Date: Fri, 16 Nov 2012 11:47:29 +0800
X-Google-Sender-Auth: wym9sccRwlhDvt1ePUN_RXGxg5Q
Message-ID: <CAERYnoYkApZLxNcGZww_H0vzAs26yic3=5ASJ96Se7qv0OiocQ@mail.gmail.com>
From: Chunyan Liu <cyliu@suse.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] question about xenstore-chmod MAX_PERMS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4386275432359445996=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4386275432359445996==
Content-Type: multipart/alternative; boundary=14dae9399d2b7ddbb404ce94a07c

--14dae9399d2b7ddbb404ce94a07c
Content-Type: text/plain; charset=UTF-8

2012/11/15 Ian Campbell <Ian.Campbell@citrix.com>

> On Thu, 2012-11-15 at 01:51 +0000, Chunyan Liu wrote:
> >
> >                 I can't see anything obvious in the underlying library
> >                 which would
> >                 prevent it handling essentially arbitrary length lists
> >                 of perms. If you
> >                 want to change the client to increase the number
> >                 supported I think you
> >                 should make it likewise handle arbitrary numbers
> >                 rather than just
> >                 increasing MAX_PERMS.
> >
> > In addition: there is a check for msg.len <=  XENSTORE_PAYLOAD_MAX
> > (which is 4096).
> > For chmod, the msg.len = path len + mode len. In current environments,
> > there won't be so many perms that could exceed the value. But it IS a
> > limitation.
>
> Do you know what it works out as?
>
> If atomicity matters you could do it as batches within a transaction,
>

Yeah. If exceeding 4096 happens, batches within a transaction is the way
out. Same to other commands.
But this is purely from coding's point, in current environments it's almost
impossible to happen :-)


> otherwise simple batching would do?
>
> Ian.
>
>
>

--14dae9399d2b7ddbb404ce94a07c
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">2012/11/15 Ian Campbell <span dir=3D"ltr=
">&lt;<a href=3D"mailto:Ian.Campbell@citrix.com" target=3D"_blank">Ian.Camp=
bell@citrix.com</a>&gt;</span><br><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class=3D"im">On Thu, 2012-11-15 at 01:51 +0000, Chunyan Liu wrote:<br>
&gt;<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 I can&#39;t se=
e anything obvious in the underlying library<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 which would<br=
>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 prevent it han=
dling essentially arbitrary length lists<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 of perms. If y=
ou<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 want to change=
 the client to increase the number<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 supported I th=
ink you<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 should make it=
 likewise handle arbitrary numbers<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rather than ju=
st<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 increasing MAX=
_PERMS.<br>
&gt;<br>
&gt; In addition: there is a check for msg.len &lt;=3D =C2=A0XENSTORE_PAYLO=
AD_MAX<br>
&gt; (which is 4096).<br>
&gt; For chmod, the msg.len =3D path len + mode len. In current environment=
s,<br>
&gt; there won&#39;t be so many perms that could exceed the value. But it I=
S a<br>
&gt; limitation.<br>
<br>
</div>Do you know what it works out as?<br>
<br>
If atomicity matters you could do it as batches within a transaction,<br></=
blockquote><div>=C2=A0</div><div>Yeah. If exceeding 4096 happens, batches w=
ithin a transaction is the way out. Same to other commands. <br>But this is=
 purely from coding&#39;s point, in current environments it&#39;s almost im=
possible to happen :-)<br>
=C2=A0<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8e=
x;border-left:1px #ccc solid;padding-left:1ex">
otherwise simple batching would do?<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
Ian.<br>
<br>
<br>
</font></span></blockquote></div><br>

--14dae9399d2b7ddbb404ce94a07c--


--===============4386275432359445996==
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.xen.org
http://lists.xen.org/xen-devel

--===============4386275432359445996==--


From xen-devel-bounces@lists.xen.org Fri Nov 16 03:47:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 03:47:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZCtx-0003Jw-VM; Fri, 16 Nov 2012 03:47:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kgrace.liu@gmail.com>) id 1TZCtw-0003Jr-VL
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 03:47:33 +0000
Received: from [85.158.139.211:5228] by server-7.bemta-5.messagelabs.com id
	04/B6-23096-457B5A05; Fri, 16 Nov 2012 03:47:32 +0000
X-Env-Sender: kgrace.liu@gmail.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353037650!20325288!1
X-Originating-IP: [209.85.219.43]
X-SpamReason: No, hits=0.9 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_30_40,HTML_MESSAGE,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1432 invoked from network); 16 Nov 2012 03:47:31 -0000
Received: from mail-oa0-f43.google.com (HELO mail-oa0-f43.google.com)
	(209.85.219.43)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 03:47:31 -0000
Received: by mail-oa0-f43.google.com with SMTP id k1so3102506oag.30
	for <xen-devel@lists.xensource.com>;
	Thu, 15 Nov 2012 19:47:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=KYBK9c5b1ZVIaeB6fFDLqtW8OajCM+qqwxPUNK/Up48=;
	b=JEUAHMEtzGtLBJPgCtaYkoqymcREQzc5LupoW24HAlflEIT5qhLPbxToFoDoUE98Th
	Ik+cFUf3iW9moXYDbgQWJVh3iTTYn596nCh8HFNTRHOFwlPCxdoD92Khamwjg1y852Vo
	V4Gg3bjn64Jq46ss/q7nzPdUhDMbQ8gKgCowLakr6dDzbVTfF5JMe49Zvk6vumtsVlfl
	Fo3NcRMhKZh2Wp+TbkTh/EjC89UyJYKfqxA81AZusI1eE/WtUQ3NrWe6XPDdRDvUFS3y
	93alVnOw6k4uOUatv7mXwZ2SWgpeYWExEXiZeR1vsHOGQak1+S30jGjGDtaP1d1fe2ad
	aW3Q==
MIME-Version: 1.0
Received: by 10.182.116.6 with SMTP id js6mr2756218obb.82.1353037649926; Thu,
	15 Nov 2012 19:47:29 -0800 (PST)
Received: by 10.60.21.163 with HTTP; Thu, 15 Nov 2012 19:47:29 -0800 (PST)
In-Reply-To: <1352971089.3499.49.camel@zakaz.uk.xensource.com>
References: <CAERYnoYbLddzpE6729Nkx2YzMPcr09Do0f1rkob4U1h34NjQgQ@mail.gmail.com>
	<1352734133.27833.277.camel@zakaz.uk.xensource.com>
	<CAERYnoYg1iaM==-Gk__LtXLbQKaSpM-KAR-jr-cUPkt-WEe_aA@mail.gmail.com>
	<CAERYnoYgwRBycoc9+nV7uOk1Brwjs2r=QecpgKDQjASjwdkiew@mail.gmail.com>
	<1352971089.3499.49.camel@zakaz.uk.xensource.com>
Date: Fri, 16 Nov 2012 11:47:29 +0800
X-Google-Sender-Auth: wym9sccRwlhDvt1ePUN_RXGxg5Q
Message-ID: <CAERYnoYkApZLxNcGZww_H0vzAs26yic3=5ASJ96Se7qv0OiocQ@mail.gmail.com>
From: Chunyan Liu <cyliu@suse.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] question about xenstore-chmod MAX_PERMS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4386275432359445996=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4386275432359445996==
Content-Type: multipart/alternative; boundary=14dae9399d2b7ddbb404ce94a07c

--14dae9399d2b7ddbb404ce94a07c
Content-Type: text/plain; charset=UTF-8

2012/11/15 Ian Campbell <Ian.Campbell@citrix.com>

> On Thu, 2012-11-15 at 01:51 +0000, Chunyan Liu wrote:
> >
> >                 I can't see anything obvious in the underlying library
> >                 which would
> >                 prevent it handling essentially arbitrary length lists
> >                 of perms. If you
> >                 want to change the client to increase the number
> >                 supported I think you
> >                 should make it likewise handle arbitrary numbers
> >                 rather than just
> >                 increasing MAX_PERMS.
> >
> > In addition: there is a check for msg.len <=  XENSTORE_PAYLOAD_MAX
> > (which is 4096).
> > For chmod, the msg.len = path len + mode len. In current environments,
> > there won't be so many perms that could exceed the value. But it IS a
> > limitation.
>
> Do you know what it works out as?
>
> If atomicity matters you could do it as batches within a transaction,
>

Yeah. If exceeding 4096 happens, batches within a transaction is the way
out. Same to other commands.
But this is purely from coding's point, in current environments it's almost
impossible to happen :-)


> otherwise simple batching would do?
>
> Ian.
>
>
>

--14dae9399d2b7ddbb404ce94a07c
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">2012/11/15 Ian Campbell <span dir=3D"ltr=
">&lt;<a href=3D"mailto:Ian.Campbell@citrix.com" target=3D"_blank">Ian.Camp=
bell@citrix.com</a>&gt;</span><br><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class=3D"im">On Thu, 2012-11-15 at 01:51 +0000, Chunyan Liu wrote:<br>
&gt;<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 I can&#39;t se=
e anything obvious in the underlying library<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 which would<br=
>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 prevent it han=
dling essentially arbitrary length lists<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 of perms. If y=
ou<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 want to change=
 the client to increase the number<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 supported I th=
ink you<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 should make it=
 likewise handle arbitrary numbers<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rather than ju=
st<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 increasing MAX=
_PERMS.<br>
&gt;<br>
&gt; In addition: there is a check for msg.len &lt;=3D =C2=A0XENSTORE_PAYLO=
AD_MAX<br>
&gt; (which is 4096).<br>
&gt; For chmod, the msg.len =3D path len + mode len. In current environment=
s,<br>
&gt; there won&#39;t be so many perms that could exceed the value. But it I=
S a<br>
&gt; limitation.<br>
<br>
</div>Do you know what it works out as?<br>
<br>
If atomicity matters you could do it as batches within a transaction,<br></=
blockquote><div>=C2=A0</div><div>Yeah. If exceeding 4096 happens, batches w=
ithin a transaction is the way out. Same to other commands. <br>But this is=
 purely from coding&#39;s point, in current environments it&#39;s almost im=
possible to happen :-)<br>
=C2=A0<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8e=
x;border-left:1px #ccc solid;padding-left:1ex">
otherwise simple batching would do?<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
Ian.<br>
<br>
<br>
</font></span></blockquote></div><br>

--14dae9399d2b7ddbb404ce94a07c--


--===============4386275432359445996==
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.xen.org
http://lists.xen.org/xen-devel

--===============4386275432359445996==--


From xen-devel-bounces@lists.xen.org Fri Nov 16 05:22:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 05:22:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZENg-0004wE-HJ; Fri, 16 Nov 2012 05:22:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZENe-0004w9-HF
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 05:22:18 +0000
Received: from [85.158.139.211:38415] by server-5.bemta-5.messagelabs.com id
	5E/1F-11353-98DC5A05; Fri, 16 Nov 2012 05:22:17 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1353043335!18891026!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NzMxMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9102 invoked from network); 16 Nov 2012 05:22:16 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 05:22:16 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAG5MCRk008367
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 05:22:13 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAG5MBsj021875
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 05:22:12 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAG5MBm4022396; Thu, 15 Nov 2012 23:22:11 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 21:22:10 -0800
Message-ID: <50A5CD7F.2010609@oracle.com>
Date: Fri, 16 Nov 2012 13:22:07 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963114-628-1-git-send-email-annie.li@oracle.com>
	<50A4C987.3020308@citrix.com>
In-Reply-To: <50A4C987.3020308@citrix.com>
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 3/4] Xen/netfront: Implement persistent
 grant in netfront.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-15 18:52, Roger Pau Monn=E9 wrote:
> On 15/11/12 08:05, Annie Li wrote:
>> Tx/rx page pool are maintained. New grant is mapped and put into
>> pool, unmap only happens when releasing/removing device.
>>
>> Signed-off-by: Annie Li<annie.li@oracle.com>
>> ---
>>   drivers/net/xen-netfront.c |  372 ++++++++++++++++++++++++++++++++++++=
+-------
>>   1 files changed, 315 insertions(+), 57 deletions(-)
>>
>> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
>> index 0ebbb19..17b81c0 100644
>> --- a/drivers/net/xen-netfront.c
>> +++ b/drivers/net/xen-netfront.c
>> @@ -79,6 +79,13 @@ struct netfront_stats {
>>          struct u64_stats_sync   syncp;
>>   };
>>
>> +struct gnt_list {
>> +       grant_ref_t             gref;
>> +       struct                  page *gnt_pages;
>> +       void                    *gnt_target;
>> +       struct                  gnt_list *tail;
>> +};
> This could also be shared with blkfront.

Netfront does not have the shadow like blkfront, and it needs the =

gnt_target to save skb address of rx path. So we can share this too? =

blkfront would not use it actually.

>
>> +
>>   struct netfront_info {
>>          struct list_head list;
>>          struct net_device *netdev;
>> @@ -109,6 +116,10 @@ struct netfront_info {
>>          grant_ref_t grant_tx_ref[NET_TX_RING_SIZE];
>>          unsigned tx_skb_freelist;
>>
>> +       struct gnt_list *tx_grant[NET_TX_RING_SIZE];
>> +       struct gnt_list *tx_gnt_list;
>> +       unsigned int tx_gnt_cnt;
> I don't understand this, why do you need both an array and a list?

The array tx_grant is just like other tx_skbs, grant_tx_ref. It saves =

grant entries corresponding every request in the ring. This is what =

netfront different from blkfront, netfront does not have shadow ring, =

and it only uses a ring size array to track every request in the ring.
The list is like a pool to save all available persistent grants.

> I'm
> not familiar with net code, so I don't know if this is some kind of
> special netfront thing?

Yes, this is different from blkfront. netfront uses ring size arrays to =

track every request in the ring.

>
> Anyway if you have to use a list I would recommend using one of the list
> constructions that's already in the kernel, it simplifies the code and
> makes it more easy to understand than creating your own list structure.

Ok, thanks.

>
>> +
>>          spinlock_t   rx_lock ____cacheline_aligned_in_smp;
>>          struct xen_netif_rx_front_ring rx;
>>          int rx_ring_ref;
>> @@ -126,6 +137,10 @@ struct netfront_info {
>>          grant_ref_t gref_rx_head;
>>          grant_ref_t grant_rx_ref[NET_RX_RING_SIZE];
>>
>> +       struct gnt_list *rx_grant[NET_RX_RING_SIZE];
>> +       struct gnt_list *rx_gnt_list;
>> +       unsigned int rx_gnt_cnt;
> Same comment above here.

Same as above.

>
>> +
>>          unsigned long rx_pfn_array[NET_RX_RING_SIZE];
>>          struct multicall_entry rx_mcl[NET_RX_RING_SIZE+1];
>>          struct mmu_update rx_mmu[NET_RX_RING_SIZE];
>> @@ -134,6 +149,7 @@ struct netfront_info {
>>          struct netfront_stats __percpu *stats;
>>
>>          unsigned long rx_gso_checksum_fixup;
>> +       u8 persistent_gnt:1;
>>   };
>>
>>   struct netfront_rx_info {
>> @@ -194,6 +210,16 @@ static grant_ref_t xennet_get_rx_ref(struct netfron=
t_info *np,
>>          return ref;
>>   }
>>
>> +static struct gnt_list *xennet_get_rx_grant(struct netfront_info *np,
>> +                                           RING_IDX ri)
>> +{
>> +       int i =3D xennet_rxidx(ri);
>> +       struct gnt_list *gntlist =3D np->rx_grant[i];
>> +       np->rx_grant[i] =3D NULL;
> Ok, I think I get why do you need both an array and a list, is that
> because netfront doesn't have some kind of shadow ring to keep track of
> issued requests?

Yes.

>
> So each issued request has an associated gnt_list with the list of used
> grants?

gnt_list is kind of free grants. It is like a pool of free grants. If =

free grants exist in this list, free grant will be gotten from this =

list. If no, new grant will be allocated. In xennet_tx_buf_gc, free =

grants will be put into the list again if response status is OK.

> If so it would be good to add a comment about it.
>
>> +       return gntlist;
>> +}
>> +
>>   #ifdef CONFIG_SYSFS
>>   static int xennet_sysfs_addif(struct net_device *netdev);
>>   static void xennet_sysfs_delif(struct net_device *netdev);
>> @@ -231,6 +257,68 @@ static void xennet_maybe_wake_tx(struct net_device =
*dev)
>>                  netif_wake_queue(dev);
>>   }
>>
>> +static grant_ref_t xennet_alloc_rx_ref(struct net_device *dev,
>> +                                      unsigned long mfn, void *vaddr,
>> +                                      unsigned int id,
>> +                                      grant_ref_t ref)
>> +{
>> +       struct netfront_info *np =3D netdev_priv(dev);
>> +       grant_ref_t gnt_ref;
>> +       struct gnt_list *gnt_list_entry;
>> +
>> +       if (np->persistent_gnt&&  np->rx_gnt_cnt) {
>> +               gnt_list_entry =3D np->rx_gnt_list;
>> +               np->rx_gnt_list =3D np->rx_gnt_list->tail;
>> +               np->rx_gnt_cnt--;
>> +
>> +               gnt_list_entry->gnt_target =3D vaddr;
>> +               gnt_ref =3D gnt_list_entry->gref;
>> +               np->rx_grant[id] =3D gnt_list_entry;
>> +       } else {
>> +               struct page *page;
>> +
>> +               BUG_ON(!np->persistent_gnt&&  np->rx_gnt_cnt);
>> +               if (!ref)
>> +                       gnt_ref =3D
>> +                               gnttab_claim_grant_reference(&np->gref_r=
x_head);
>> +               else
>> +                       gnt_ref =3D ref;
>> +               BUG_ON((signed short)gnt_ref<  0);
>> +
>> +               if (np->persistent_gnt) {
> So you are only using persistent grants if the backend also supports
> them.

Current implementation is:
If netback supports persistent grant, the frontend will work with =

persistent grant feature too.
If netback does not support persistent grant, the frontend will work =

without persistent grant feature.

> Have you benchmarked the performance of a persistent frontend with
> a non-persistent backend.

I  remember I did some test before, not so sure. Will check it.

>   In the block case, usign a persistent frontend
> with a non-persistent backend let to an overall performance improvement,
> so blkfront uses persistent grants even if blkback doesn't support them.
> Take a look at the following graph:
>
> http://xenbits.xen.org/people/royger/persistent_grants/nonpers_read.png

Good idea, that makes sense. I will change netfront too, thanks.

>
>> +                       page =3D alloc_page(GFP_KERNEL);
>> +                       if (!page) {
>> +                               if (!ref)
>> +                                       gnttab_release_grant_reference(
>> +&np->gref_rx_head, ref);
>> +                               return -ENOMEM;
>> +                       }
>> +                       mfn =3D pfn_to_mfn(page_to_pfn(page));
>> +
>> +                       gnt_list_entry =3D kmalloc(sizeof(struct gnt_lis=
t),
>> +                                                GFP_KERNEL);
>> +                       if (!gnt_list_entry) {
>> +                               __free_page(page);
>> +                               if (!ref)
>> +                                       gnttab_release_grant_reference(
>> +&np->gref_rx_head, ref);
>> +                               return -ENOMEM;
>> +                       }
>> +                       gnt_list_entry->gref =3D gnt_ref;
>> +                       gnt_list_entry->gnt_pages =3D page;
>> +                       gnt_list_entry->gnt_target =3D vaddr;
>> +
>> +                       np->rx_grant[id] =3D gnt_list_entry;
>> +               }
>> +
>> +               gnttab_grant_foreign_access_ref(gnt_ref, np->xbdev->othe=
rend_id,
>> +                                               mfn, 0);
>> +       }
>> +       np->grant_rx_ref[id] =3D gnt_ref;
>> +
>> +       return gnt_ref;
>> +}
>> +
>>   static void xennet_alloc_rx_buffers(struct net_device *dev)
>>   {
>>          unsigned short id;
>> @@ -240,8 +328,6 @@ static void xennet_alloc_rx_buffers(struct net_devic=
e *dev)
>>          int i, batch_target, notify;
>>          RING_IDX req_prod =3D np->rx.req_prod_pvt;
>>          grant_ref_t ref;
>> -       unsigned long pfn;
>> -       void *vaddr;
>>          struct xen_netif_rx_request *req;
>>
>>          if (unlikely(!netif_carrier_ok(dev)))
>> @@ -306,19 +392,16 @@ no_skb:
>>                  BUG_ON(np->rx_skbs[id]);
>>                  np->rx_skbs[id] =3D skb;
>>
>> -               ref =3D gnttab_claim_grant_reference(&np->gref_rx_head);
>> -               BUG_ON((signed short)ref<  0);
>> -               np->grant_rx_ref[id] =3D ref;
>> +               page =3D skb_frag_page(&skb_shinfo(skb)->frags[0]);
>>
>> -               pfn =3D page_to_pfn(skb_frag_page(&skb_shinfo(skb)->frag=
s[0]));
>> -               vaddr =3D page_address(skb_frag_page(&skb_shinfo(skb)->f=
rags[0]));
>> +               ref =3D xennet_alloc_rx_ref(dev, pfn_to_mfn(page_to_pfn(=
page)),
>> +                                         page_address(page), id, 0);
>> +               if ((signed short)ref<  0) {
>> +                       __skb_queue_tail(&np->rx_batch, skb);
>> +                       break;
>> +               }
>>
>>                  req =3D RING_GET_REQUEST(&np->rx, req_prod + i);
>> -               gnttab_grant_foreign_access_ref(ref,
>> -                                               np->xbdev->otherend_id,
>> -                                               pfn_to_mfn(pfn),
>> -                                               0);
>> -
>>                  req->id =3D id;
>>                  req->gref =3D ref;
>>          }
>> @@ -375,17 +458,30 @@ static void xennet_tx_buf_gc(struct net_device *de=
v)
>>
>>                          id  =3D txrsp->id;
>>                          skb =3D np->tx_skbs[id].skb;
>> -                       if (unlikely(gnttab_query_foreign_access(
>> -                               np->grant_tx_ref[id]) !=3D 0)) {
>> -                               printk(KERN_ALERT "xennet_tx_buf_gc: war=
ning "
>> -                                      "-- grant still in use by backend=
 "
>> -                                      "domain.\n");
>> -                               BUG();
>> +
>> +                       if (np->persistent_gnt) {
>> +                               struct gnt_list *gnt_list_entry;
>> +
>> +                               gnt_list_entry =3D np->tx_grant[id];
>> +                               BUG_ON(!gnt_list_entry);
>> +
>> +                               gnt_list_entry->tail =3D np->tx_gnt_list;
>> +                               np->tx_gnt_list =3D gnt_list_entry;
>> +                               np->tx_gnt_cnt++;
>> +                       } else {
>> +                               if (unlikely(gnttab_query_foreign_access(
>> +                                       np->grant_tx_ref[id]) !=3D 0)) {
>> +                                       printk(KERN_ALERT "xennet_tx_buf=
_gc: warning "
>> +                                              "-- grant still in use by=
 backend "
>> +                                              "domain.\n");
>> +                                       BUG();
>> +                               }
>> +
>> +                               gnttab_end_foreign_access_ref(
>> +                                       np->grant_tx_ref[id], GNTMAP_rea=
donly);
> If I've read the code correctly, you are giving this frame both
> read/write permissions to the other end on xennet_alloc_tx_ref, but then
> you are only removing the read permissions? (see comment below on the
> xennet_alloc_tx_ref function).

Yes, this is a bug.
For non persistent grant, it should remove the read permissions. For =

persistent grant, it should remove both.
As mentioned above, it is better to enable persistent grant, I will =

change code and not consider non persistent grant.
See comments below about why needing both permissions in =

xennet_alloc_tx_ref.

>
>> +                               gnttab_release_grant_reference(
>> +&np->gref_tx_head, np->grant_tx_ref[id]);
>>                          }
>> -                       gnttab_end_foreign_access_ref(
>> -                               np->grant_tx_ref[id], GNTMAP_readonly);
>> -                       gnttab_release_grant_reference(
>> -&np->gref_tx_head, np->grant_tx_ref[id]);
>>                          np->grant_tx_ref[id] =3D GRANT_INVALID_REF;
>>                          add_id_to_freelist(&np->tx_skb_freelist, np->tx=
_skbs, id);
>>                          dev_kfree_skb_irq(skb);
>> @@ -409,6 +505,59 @@ static void xennet_tx_buf_gc(struct net_device *dev)
>>          xennet_maybe_wake_tx(dev);
>>   }
>>
>> +static grant_ref_t xennet_alloc_tx_ref(struct net_device *dev,
>> +                                      unsigned long mfn,
>> +                                      unsigned int id)
>> +{
>> +       struct netfront_info *np =3D netdev_priv(dev);
>> +       grant_ref_t ref;
>> +       struct page *granted_page;
>> +
>> +       if (np->persistent_gnt&&  np->tx_gnt_cnt) {
>> +               struct gnt_list *gnt_list_entry;
>> +
>> +               gnt_list_entry =3D np->tx_gnt_list;
>> +               np->tx_gnt_list =3D np->tx_gnt_list->tail;
>> +               np->tx_gnt_cnt--;
>> +
>> +               ref =3D gnt_list_entry->gref;
>> +               np->tx_grant[id] =3D gnt_list_entry;
>> +       } else {
>> +               struct gnt_list *gnt_list_entry;
>> +
>> +               BUG_ON(!np->persistent_gnt&&  np->tx_gnt_cnt);
>> +               ref =3D gnttab_claim_grant_reference(&np->gref_tx_head);
>> +               BUG_ON((signed short)ref<  0);
>> +
>> +               if (np->persistent_gnt) {
>> +                       granted_page =3D alloc_page(GFP_KERNEL);
>> +                       if (!granted_page) {
>> +                               gnttab_release_grant_reference(
>> +&np->gref_tx_head, ref);
>> +                               return -ENOMEM;
>> +                       }
>> +
>> +                       mfn =3D pfn_to_mfn(page_to_pfn(granted_page));
>> +                       gnt_list_entry =3D kmalloc(sizeof(struct gnt_lis=
t),
>> +                                                GFP_KERNEL);
>> +                       if (!gnt_list_entry) {
>> +                               __free_page(granted_page);
>> +                               gnttab_release_grant_reference(
>> +&np->gref_tx_head, ref);
>> +                               return -ENOMEM;
>> +                       }
>> +
>> +                       gnt_list_entry->gref =3D ref;
>> +                       gnt_list_entry->gnt_pages =3D granted_page;
>> +                       np->tx_grant[id] =3D gnt_list_entry;
>> +               }
>> +               gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend=
_id,
>> +                                               mfn, 0);
> If you are not always using persistent grants I guess you need to give
> read only permissions to this frame (GNTMAP_readonly).

We can not use GNTMAP_readonly here because tx path packet data will be =

copied into these persistent grant pages. Mabbe it is better to use =

GNTMAP_readonly for nonpersistent and 0 for persistent grant.
As mentioned above, it is better to enable persistent grant, I will =

change code and not consider non persistent grant.

>   Also, for keeping
> things in logical order, isn't it best that this function comes before
> xennet_tx_buf_gc?

xennet_alloc_tx_ref is called by following function xennet_make_frags, =

so I assume xennet_alloc_tx_ref is better to be close to =

xennet_make_frags. Xennet_tx_buf_gc does not have any connection with =

xennet_alloc_tx_ref, did I miss something?

>
>> +       }
>> +
>> +       return ref;
>> +}
>> +
>> @@ -1132,8 +1357,10 @@ static void xennet_release_rx_bufs(struct netfron=
t_info *np)
>>                  }
>>
>>                  skb =3D np->rx_skbs[id];
>> -               mfn =3D gnttab_end_foreign_transfer_ref(ref);
>> -               gnttab_release_grant_reference(&np->gref_rx_head, ref);
>> +               if (!np->persistent_gnt) {
>> +                       mfn =3D gnttab_end_foreign_transfer_ref(ref);
>> +                       gnttab_release_grant_reference(&np->gref_rx_head=
, ref);
>> +               }
>>                  np->grant_rx_ref[id] =3D GRANT_INVALID_REF;
>>
>>                  if (0 =3D=3D mfn) {
>> @@ -1607,6 +1834,13 @@ again:
>>                  goto abort_transaction;
>>          }
>>
>> +       err =3D xenbus_printf(xbt, dev->nodename, "feature-persistent-gr=
ants",
>> +                           "%u", info->persistent_gnt);
> As in netback, I think "feature-persistent" should be used.

Same in blkback, I assume it is  "feature-persistent-grants", right?
I referred your RFC patch, did you change it later? Or I missed something?

Thanks
Annie
>
>> +       if (err) {
>> +               message =3D "writing feature-persistent-grants";
>> +               xenbus_dev_fatal(dev, err, "%s", message);
>> +       }
>> +
>>          err =3D xenbus_transaction_end(xbt, 0);
>>          if (err) {
>>                  if (err =3D=3D -EAGAIN)
>> @@ -1634,6 +1868,7 @@ static int xennet_connect(struct net_device *dev)
>>          grant_ref_t ref;
>>          struct xen_netif_rx_request *req;
>>          unsigned int feature_rx_copy;
>> +       int ret, val;
>>
>>          err =3D xenbus_scanf(XBT_NIL, np->xbdev->otherend,
>>                             "feature-rx-copy", "%u",&feature_rx_copy);
>> @@ -1646,6 +1881,13 @@ static int xennet_connect(struct net_device *dev)
>>                  return -ENODEV;
>>          }
>>
>> +       err =3D xenbus_scanf(XBT_NIL, np->xbdev->otherend,
>> +                          "feature-persistent-grants", "%u",&val);
>> +       if (err !=3D 1)
>> +               val =3D 0;
>> +
>> +       np->persistent_gnt =3D !!val;
>> +
>>          err =3D talk_to_netback(np->xbdev, np);
>>          if (err)
>>                  return err;
>> @@ -1657,9 +1899,24 @@ static int xennet_connect(struct net_device *dev)
>>          spin_lock_bh(&np->rx_lock);
>>          spin_lock_irq(&np->tx_lock);
>>
>> +       np->tx_gnt_cnt =3D 0;
>> +       np->rx_gnt_cnt =3D 0;
>> +
>>          /* Step 1: Discard all pending TX packet fragments. */
>>          xennet_release_tx_bufs(np);
>>
>> +       if (np->persistent_gnt) {
>> +               struct gnt_list *gnt_list_entry;
>> +
>> +               while (np->rx_gnt_list) {
>> +                       gnt_list_entry =3D np->rx_gnt_list;
>> +                       np->rx_gnt_list =3D np->rx_gnt_list->tail;
>> +                       gnttab_end_foreign_access(gnt_list_entry->gref, =
0, 0UL);
>> +                       __free_page(gnt_list_entry->gnt_pages);
>> +                       kfree(gnt_list_entry);
>> +               }
>> +       }
>> +
>>          /* Step 2: Rebuild the RX buffer freelist and the RX ring itsel=
f. */
>>          for (requeue_idx =3D 0, i =3D 0; i<  NET_RX_RING_SIZE; i++) {
>>                  skb_frag_t *frag;
>> @@ -1673,10 +1930,11 @@ static int xennet_connect(struct net_device *dev)
>>
>>                  frag =3D&skb_shinfo(skb)->frags[0];
>>                  page =3D skb_frag_page(frag);
>> -               gnttab_grant_foreign_access_ref(
>> -                       ref, np->xbdev->otherend_id,
>> -                       pfn_to_mfn(page_to_pfn(page)),
>> -                       0);
>> +               ret =3D xennet_alloc_rx_ref(dev, pfn_to_mfn(page_to_pfn(=
page)),
>> +                                         page_address(page), requeue_id=
x, ref);
>> +               if ((signed short)ret<  0)
>> +                       break;
>> +
>>                  req->gref =3D ref;
>>                  req->id   =3D requeue_idx;
>>
>> --
>> 1.7.3.4
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 05:22:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 05:22:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZENg-0004wE-HJ; Fri, 16 Nov 2012 05:22:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZENe-0004w9-HF
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 05:22:18 +0000
Received: from [85.158.139.211:38415] by server-5.bemta-5.messagelabs.com id
	5E/1F-11353-98DC5A05; Fri, 16 Nov 2012 05:22:17 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1353043335!18891026!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NzMxMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9102 invoked from network); 16 Nov 2012 05:22:16 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 05:22:16 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAG5MCRk008367
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 05:22:13 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAG5MBsj021875
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 05:22:12 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAG5MBm4022396; Thu, 15 Nov 2012 23:22:11 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 21:22:10 -0800
Message-ID: <50A5CD7F.2010609@oracle.com>
Date: Fri, 16 Nov 2012 13:22:07 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963114-628-1-git-send-email-annie.li@oracle.com>
	<50A4C987.3020308@citrix.com>
In-Reply-To: <50A4C987.3020308@citrix.com>
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 3/4] Xen/netfront: Implement persistent
 grant in netfront.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-15 18:52, Roger Pau Monn=E9 wrote:
> On 15/11/12 08:05, Annie Li wrote:
>> Tx/rx page pool are maintained. New grant is mapped and put into
>> pool, unmap only happens when releasing/removing device.
>>
>> Signed-off-by: Annie Li<annie.li@oracle.com>
>> ---
>>   drivers/net/xen-netfront.c |  372 ++++++++++++++++++++++++++++++++++++=
+-------
>>   1 files changed, 315 insertions(+), 57 deletions(-)
>>
>> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
>> index 0ebbb19..17b81c0 100644
>> --- a/drivers/net/xen-netfront.c
>> +++ b/drivers/net/xen-netfront.c
>> @@ -79,6 +79,13 @@ struct netfront_stats {
>>          struct u64_stats_sync   syncp;
>>   };
>>
>> +struct gnt_list {
>> +       grant_ref_t             gref;
>> +       struct                  page *gnt_pages;
>> +       void                    *gnt_target;
>> +       struct                  gnt_list *tail;
>> +};
> This could also be shared with blkfront.

Netfront does not have the shadow like blkfront, and it needs the =

gnt_target to save skb address of rx path. So we can share this too? =

blkfront would not use it actually.

>
>> +
>>   struct netfront_info {
>>          struct list_head list;
>>          struct net_device *netdev;
>> @@ -109,6 +116,10 @@ struct netfront_info {
>>          grant_ref_t grant_tx_ref[NET_TX_RING_SIZE];
>>          unsigned tx_skb_freelist;
>>
>> +       struct gnt_list *tx_grant[NET_TX_RING_SIZE];
>> +       struct gnt_list *tx_gnt_list;
>> +       unsigned int tx_gnt_cnt;
> I don't understand this, why do you need both an array and a list?

The array tx_grant is just like other tx_skbs, grant_tx_ref. It saves =

grant entries corresponding every request in the ring. This is what =

netfront different from blkfront, netfront does not have shadow ring, =

and it only uses a ring size array to track every request in the ring.
The list is like a pool to save all available persistent grants.

> I'm
> not familiar with net code, so I don't know if this is some kind of
> special netfront thing?

Yes, this is different from blkfront. netfront uses ring size arrays to =

track every request in the ring.

>
> Anyway if you have to use a list I would recommend using one of the list
> constructions that's already in the kernel, it simplifies the code and
> makes it more easy to understand than creating your own list structure.

Ok, thanks.

>
>> +
>>          spinlock_t   rx_lock ____cacheline_aligned_in_smp;
>>          struct xen_netif_rx_front_ring rx;
>>          int rx_ring_ref;
>> @@ -126,6 +137,10 @@ struct netfront_info {
>>          grant_ref_t gref_rx_head;
>>          grant_ref_t grant_rx_ref[NET_RX_RING_SIZE];
>>
>> +       struct gnt_list *rx_grant[NET_RX_RING_SIZE];
>> +       struct gnt_list *rx_gnt_list;
>> +       unsigned int rx_gnt_cnt;
> Same comment above here.

Same as above.

>
>> +
>>          unsigned long rx_pfn_array[NET_RX_RING_SIZE];
>>          struct multicall_entry rx_mcl[NET_RX_RING_SIZE+1];
>>          struct mmu_update rx_mmu[NET_RX_RING_SIZE];
>> @@ -134,6 +149,7 @@ struct netfront_info {
>>          struct netfront_stats __percpu *stats;
>>
>>          unsigned long rx_gso_checksum_fixup;
>> +       u8 persistent_gnt:1;
>>   };
>>
>>   struct netfront_rx_info {
>> @@ -194,6 +210,16 @@ static grant_ref_t xennet_get_rx_ref(struct netfron=
t_info *np,
>>          return ref;
>>   }
>>
>> +static struct gnt_list *xennet_get_rx_grant(struct netfront_info *np,
>> +                                           RING_IDX ri)
>> +{
>> +       int i =3D xennet_rxidx(ri);
>> +       struct gnt_list *gntlist =3D np->rx_grant[i];
>> +       np->rx_grant[i] =3D NULL;
> Ok, I think I get why do you need both an array and a list, is that
> because netfront doesn't have some kind of shadow ring to keep track of
> issued requests?

Yes.

>
> So each issued request has an associated gnt_list with the list of used
> grants?

gnt_list is kind of free grants. It is like a pool of free grants. If =

free grants exist in this list, free grant will be gotten from this =

list. If no, new grant will be allocated. In xennet_tx_buf_gc, free =

grants will be put into the list again if response status is OK.

> If so it would be good to add a comment about it.
>
>> +       return gntlist;
>> +}
>> +
>>   #ifdef CONFIG_SYSFS
>>   static int xennet_sysfs_addif(struct net_device *netdev);
>>   static void xennet_sysfs_delif(struct net_device *netdev);
>> @@ -231,6 +257,68 @@ static void xennet_maybe_wake_tx(struct net_device =
*dev)
>>                  netif_wake_queue(dev);
>>   }
>>
>> +static grant_ref_t xennet_alloc_rx_ref(struct net_device *dev,
>> +                                      unsigned long mfn, void *vaddr,
>> +                                      unsigned int id,
>> +                                      grant_ref_t ref)
>> +{
>> +       struct netfront_info *np =3D netdev_priv(dev);
>> +       grant_ref_t gnt_ref;
>> +       struct gnt_list *gnt_list_entry;
>> +
>> +       if (np->persistent_gnt&&  np->rx_gnt_cnt) {
>> +               gnt_list_entry =3D np->rx_gnt_list;
>> +               np->rx_gnt_list =3D np->rx_gnt_list->tail;
>> +               np->rx_gnt_cnt--;
>> +
>> +               gnt_list_entry->gnt_target =3D vaddr;
>> +               gnt_ref =3D gnt_list_entry->gref;
>> +               np->rx_grant[id] =3D gnt_list_entry;
>> +       } else {
>> +               struct page *page;
>> +
>> +               BUG_ON(!np->persistent_gnt&&  np->rx_gnt_cnt);
>> +               if (!ref)
>> +                       gnt_ref =3D
>> +                               gnttab_claim_grant_reference(&np->gref_r=
x_head);
>> +               else
>> +                       gnt_ref =3D ref;
>> +               BUG_ON((signed short)gnt_ref<  0);
>> +
>> +               if (np->persistent_gnt) {
> So you are only using persistent grants if the backend also supports
> them.

Current implementation is:
If netback supports persistent grant, the frontend will work with =

persistent grant feature too.
If netback does not support persistent grant, the frontend will work =

without persistent grant feature.

> Have you benchmarked the performance of a persistent frontend with
> a non-persistent backend.

I  remember I did some test before, not so sure. Will check it.

>   In the block case, usign a persistent frontend
> with a non-persistent backend let to an overall performance improvement,
> so blkfront uses persistent grants even if blkback doesn't support them.
> Take a look at the following graph:
>
> http://xenbits.xen.org/people/royger/persistent_grants/nonpers_read.png

Good idea, that makes sense. I will change netfront too, thanks.

>
>> +                       page =3D alloc_page(GFP_KERNEL);
>> +                       if (!page) {
>> +                               if (!ref)
>> +                                       gnttab_release_grant_reference(
>> +&np->gref_rx_head, ref);
>> +                               return -ENOMEM;
>> +                       }
>> +                       mfn =3D pfn_to_mfn(page_to_pfn(page));
>> +
>> +                       gnt_list_entry =3D kmalloc(sizeof(struct gnt_lis=
t),
>> +                                                GFP_KERNEL);
>> +                       if (!gnt_list_entry) {
>> +                               __free_page(page);
>> +                               if (!ref)
>> +                                       gnttab_release_grant_reference(
>> +&np->gref_rx_head, ref);
>> +                               return -ENOMEM;
>> +                       }
>> +                       gnt_list_entry->gref =3D gnt_ref;
>> +                       gnt_list_entry->gnt_pages =3D page;
>> +                       gnt_list_entry->gnt_target =3D vaddr;
>> +
>> +                       np->rx_grant[id] =3D gnt_list_entry;
>> +               }
>> +
>> +               gnttab_grant_foreign_access_ref(gnt_ref, np->xbdev->othe=
rend_id,
>> +                                               mfn, 0);
>> +       }
>> +       np->grant_rx_ref[id] =3D gnt_ref;
>> +
>> +       return gnt_ref;
>> +}
>> +
>>   static void xennet_alloc_rx_buffers(struct net_device *dev)
>>   {
>>          unsigned short id;
>> @@ -240,8 +328,6 @@ static void xennet_alloc_rx_buffers(struct net_devic=
e *dev)
>>          int i, batch_target, notify;
>>          RING_IDX req_prod =3D np->rx.req_prod_pvt;
>>          grant_ref_t ref;
>> -       unsigned long pfn;
>> -       void *vaddr;
>>          struct xen_netif_rx_request *req;
>>
>>          if (unlikely(!netif_carrier_ok(dev)))
>> @@ -306,19 +392,16 @@ no_skb:
>>                  BUG_ON(np->rx_skbs[id]);
>>                  np->rx_skbs[id] =3D skb;
>>
>> -               ref =3D gnttab_claim_grant_reference(&np->gref_rx_head);
>> -               BUG_ON((signed short)ref<  0);
>> -               np->grant_rx_ref[id] =3D ref;
>> +               page =3D skb_frag_page(&skb_shinfo(skb)->frags[0]);
>>
>> -               pfn =3D page_to_pfn(skb_frag_page(&skb_shinfo(skb)->frag=
s[0]));
>> -               vaddr =3D page_address(skb_frag_page(&skb_shinfo(skb)->f=
rags[0]));
>> +               ref =3D xennet_alloc_rx_ref(dev, pfn_to_mfn(page_to_pfn(=
page)),
>> +                                         page_address(page), id, 0);
>> +               if ((signed short)ref<  0) {
>> +                       __skb_queue_tail(&np->rx_batch, skb);
>> +                       break;
>> +               }
>>
>>                  req =3D RING_GET_REQUEST(&np->rx, req_prod + i);
>> -               gnttab_grant_foreign_access_ref(ref,
>> -                                               np->xbdev->otherend_id,
>> -                                               pfn_to_mfn(pfn),
>> -                                               0);
>> -
>>                  req->id =3D id;
>>                  req->gref =3D ref;
>>          }
>> @@ -375,17 +458,30 @@ static void xennet_tx_buf_gc(struct net_device *de=
v)
>>
>>                          id  =3D txrsp->id;
>>                          skb =3D np->tx_skbs[id].skb;
>> -                       if (unlikely(gnttab_query_foreign_access(
>> -                               np->grant_tx_ref[id]) !=3D 0)) {
>> -                               printk(KERN_ALERT "xennet_tx_buf_gc: war=
ning "
>> -                                      "-- grant still in use by backend=
 "
>> -                                      "domain.\n");
>> -                               BUG();
>> +
>> +                       if (np->persistent_gnt) {
>> +                               struct gnt_list *gnt_list_entry;
>> +
>> +                               gnt_list_entry =3D np->tx_grant[id];
>> +                               BUG_ON(!gnt_list_entry);
>> +
>> +                               gnt_list_entry->tail =3D np->tx_gnt_list;
>> +                               np->tx_gnt_list =3D gnt_list_entry;
>> +                               np->tx_gnt_cnt++;
>> +                       } else {
>> +                               if (unlikely(gnttab_query_foreign_access(
>> +                                       np->grant_tx_ref[id]) !=3D 0)) {
>> +                                       printk(KERN_ALERT "xennet_tx_buf=
_gc: warning "
>> +                                              "-- grant still in use by=
 backend "
>> +                                              "domain.\n");
>> +                                       BUG();
>> +                               }
>> +
>> +                               gnttab_end_foreign_access_ref(
>> +                                       np->grant_tx_ref[id], GNTMAP_rea=
donly);
> If I've read the code correctly, you are giving this frame both
> read/write permissions to the other end on xennet_alloc_tx_ref, but then
> you are only removing the read permissions? (see comment below on the
> xennet_alloc_tx_ref function).

Yes, this is a bug.
For non persistent grant, it should remove the read permissions. For =

persistent grant, it should remove both.
As mentioned above, it is better to enable persistent grant, I will =

change code and not consider non persistent grant.
See comments below about why needing both permissions in =

xennet_alloc_tx_ref.

>
>> +                               gnttab_release_grant_reference(
>> +&np->gref_tx_head, np->grant_tx_ref[id]);
>>                          }
>> -                       gnttab_end_foreign_access_ref(
>> -                               np->grant_tx_ref[id], GNTMAP_readonly);
>> -                       gnttab_release_grant_reference(
>> -&np->gref_tx_head, np->grant_tx_ref[id]);
>>                          np->grant_tx_ref[id] =3D GRANT_INVALID_REF;
>>                          add_id_to_freelist(&np->tx_skb_freelist, np->tx=
_skbs, id);
>>                          dev_kfree_skb_irq(skb);
>> @@ -409,6 +505,59 @@ static void xennet_tx_buf_gc(struct net_device *dev)
>>          xennet_maybe_wake_tx(dev);
>>   }
>>
>> +static grant_ref_t xennet_alloc_tx_ref(struct net_device *dev,
>> +                                      unsigned long mfn,
>> +                                      unsigned int id)
>> +{
>> +       struct netfront_info *np =3D netdev_priv(dev);
>> +       grant_ref_t ref;
>> +       struct page *granted_page;
>> +
>> +       if (np->persistent_gnt&&  np->tx_gnt_cnt) {
>> +               struct gnt_list *gnt_list_entry;
>> +
>> +               gnt_list_entry =3D np->tx_gnt_list;
>> +               np->tx_gnt_list =3D np->tx_gnt_list->tail;
>> +               np->tx_gnt_cnt--;
>> +
>> +               ref =3D gnt_list_entry->gref;
>> +               np->tx_grant[id] =3D gnt_list_entry;
>> +       } else {
>> +               struct gnt_list *gnt_list_entry;
>> +
>> +               BUG_ON(!np->persistent_gnt&&  np->tx_gnt_cnt);
>> +               ref =3D gnttab_claim_grant_reference(&np->gref_tx_head);
>> +               BUG_ON((signed short)ref<  0);
>> +
>> +               if (np->persistent_gnt) {
>> +                       granted_page =3D alloc_page(GFP_KERNEL);
>> +                       if (!granted_page) {
>> +                               gnttab_release_grant_reference(
>> +&np->gref_tx_head, ref);
>> +                               return -ENOMEM;
>> +                       }
>> +
>> +                       mfn =3D pfn_to_mfn(page_to_pfn(granted_page));
>> +                       gnt_list_entry =3D kmalloc(sizeof(struct gnt_lis=
t),
>> +                                                GFP_KERNEL);
>> +                       if (!gnt_list_entry) {
>> +                               __free_page(granted_page);
>> +                               gnttab_release_grant_reference(
>> +&np->gref_tx_head, ref);
>> +                               return -ENOMEM;
>> +                       }
>> +
>> +                       gnt_list_entry->gref =3D ref;
>> +                       gnt_list_entry->gnt_pages =3D granted_page;
>> +                       np->tx_grant[id] =3D gnt_list_entry;
>> +               }
>> +               gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend=
_id,
>> +                                               mfn, 0);
> If you are not always using persistent grants I guess you need to give
> read only permissions to this frame (GNTMAP_readonly).

We can not use GNTMAP_readonly here because tx path packet data will be =

copied into these persistent grant pages. Mabbe it is better to use =

GNTMAP_readonly for nonpersistent and 0 for persistent grant.
As mentioned above, it is better to enable persistent grant, I will =

change code and not consider non persistent grant.

>   Also, for keeping
> things in logical order, isn't it best that this function comes before
> xennet_tx_buf_gc?

xennet_alloc_tx_ref is called by following function xennet_make_frags, =

so I assume xennet_alloc_tx_ref is better to be close to =

xennet_make_frags. Xennet_tx_buf_gc does not have any connection with =

xennet_alloc_tx_ref, did I miss something?

>
>> +       }
>> +
>> +       return ref;
>> +}
>> +
>> @@ -1132,8 +1357,10 @@ static void xennet_release_rx_bufs(struct netfron=
t_info *np)
>>                  }
>>
>>                  skb =3D np->rx_skbs[id];
>> -               mfn =3D gnttab_end_foreign_transfer_ref(ref);
>> -               gnttab_release_grant_reference(&np->gref_rx_head, ref);
>> +               if (!np->persistent_gnt) {
>> +                       mfn =3D gnttab_end_foreign_transfer_ref(ref);
>> +                       gnttab_release_grant_reference(&np->gref_rx_head=
, ref);
>> +               }
>>                  np->grant_rx_ref[id] =3D GRANT_INVALID_REF;
>>
>>                  if (0 =3D=3D mfn) {
>> @@ -1607,6 +1834,13 @@ again:
>>                  goto abort_transaction;
>>          }
>>
>> +       err =3D xenbus_printf(xbt, dev->nodename, "feature-persistent-gr=
ants",
>> +                           "%u", info->persistent_gnt);
> As in netback, I think "feature-persistent" should be used.

Same in blkback, I assume it is  "feature-persistent-grants", right?
I referred your RFC patch, did you change it later? Or I missed something?

Thanks
Annie
>
>> +       if (err) {
>> +               message =3D "writing feature-persistent-grants";
>> +               xenbus_dev_fatal(dev, err, "%s", message);
>> +       }
>> +
>>          err =3D xenbus_transaction_end(xbt, 0);
>>          if (err) {
>>                  if (err =3D=3D -EAGAIN)
>> @@ -1634,6 +1868,7 @@ static int xennet_connect(struct net_device *dev)
>>          grant_ref_t ref;
>>          struct xen_netif_rx_request *req;
>>          unsigned int feature_rx_copy;
>> +       int ret, val;
>>
>>          err =3D xenbus_scanf(XBT_NIL, np->xbdev->otherend,
>>                             "feature-rx-copy", "%u",&feature_rx_copy);
>> @@ -1646,6 +1881,13 @@ static int xennet_connect(struct net_device *dev)
>>                  return -ENODEV;
>>          }
>>
>> +       err =3D xenbus_scanf(XBT_NIL, np->xbdev->otherend,
>> +                          "feature-persistent-grants", "%u",&val);
>> +       if (err !=3D 1)
>> +               val =3D 0;
>> +
>> +       np->persistent_gnt =3D !!val;
>> +
>>          err =3D talk_to_netback(np->xbdev, np);
>>          if (err)
>>                  return err;
>> @@ -1657,9 +1899,24 @@ static int xennet_connect(struct net_device *dev)
>>          spin_lock_bh(&np->rx_lock);
>>          spin_lock_irq(&np->tx_lock);
>>
>> +       np->tx_gnt_cnt =3D 0;
>> +       np->rx_gnt_cnt =3D 0;
>> +
>>          /* Step 1: Discard all pending TX packet fragments. */
>>          xennet_release_tx_bufs(np);
>>
>> +       if (np->persistent_gnt) {
>> +               struct gnt_list *gnt_list_entry;
>> +
>> +               while (np->rx_gnt_list) {
>> +                       gnt_list_entry =3D np->rx_gnt_list;
>> +                       np->rx_gnt_list =3D np->rx_gnt_list->tail;
>> +                       gnttab_end_foreign_access(gnt_list_entry->gref, =
0, 0UL);
>> +                       __free_page(gnt_list_entry->gnt_pages);
>> +                       kfree(gnt_list_entry);
>> +               }
>> +       }
>> +
>>          /* Step 2: Rebuild the RX buffer freelist and the RX ring itsel=
f. */
>>          for (requeue_idx =3D 0, i =3D 0; i<  NET_RX_RING_SIZE; i++) {
>>                  skb_frag_t *frag;
>> @@ -1673,10 +1930,11 @@ static int xennet_connect(struct net_device *dev)
>>
>>                  frag =3D&skb_shinfo(skb)->frags[0];
>>                  page =3D skb_frag_page(frag);
>> -               gnttab_grant_foreign_access_ref(
>> -                       ref, np->xbdev->otherend_id,
>> -                       pfn_to_mfn(page_to_pfn(page)),
>> -                       0);
>> +               ret =3D xennet_alloc_rx_ref(dev, pfn_to_mfn(page_to_pfn(=
page)),
>> +                                         page_address(page), requeue_id=
x, ref);
>> +               if ((signed short)ret<  0)
>> +                       break;
>> +
>>                  req->gref =3D ref;
>>                  req->id   =3D requeue_idx;
>>
>> --
>> 1.7.3.4
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 06:03:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 06:03:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZF0f-0005k4-Uz; Fri, 16 Nov 2012 06:02:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kgrace.liu@gmail.com>) id 1TZF0e-0005jz-Q4
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 06:02:37 +0000
Received: from [85.158.139.211:16594] by server-2.bemta-5.messagelabs.com id
	72/D4-04892-CF6D5A05; Fri, 16 Nov 2012 06:02:36 +0000
X-Env-Sender: kgrace.liu@gmail.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1353045754!20381306!1
X-Originating-IP: [209.85.219.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 776 invoked from network); 16 Nov 2012 06:02:35 -0000
Received: from mail-oa0-f43.google.com (HELO mail-oa0-f43.google.com)
	(209.85.219.43)
	by server-2.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 06:02:35 -0000
Received: by mail-oa0-f43.google.com with SMTP id k1so3191210oag.30
	for <xen-devel@lists.xensource.com>;
	Thu, 15 Nov 2012 22:02:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:content-type;
	bh=z6A0HOOjFM4ow4+lF5KE9EaLpkJecfwaYB3UvAPoAHg=;
	b=KRIcb1NH2SFoqni6TtisCP9fKY4R+jfVKoB1Nhh5qiUH12U23iFOKtPeLkERcUvIq2
	Pdxl6rI0vIZ0sgLEAbcOtQOMAMbKwNymkpbS1Y1Ku3+S8jnUfPhuAKtk+fBquhnVn8o4
	kYwdj1JNpgM5BVwHjsTakItRpzMDOSKMW7K6QLPLhJIxTR7hXcHcGb26NBEzeDsp2yTw
	ROlYPFSPxD9J9v5GBdxmnaoXSOnopuY+WB6U9aYNOMqCCsFBeg9lSjHk+91gyih33plM
	bAWNy8KYjQUBfX/lHc/yf8327AlDAu0Syy8OJNdWtkAeSmGeGWIUxSeS3IklYarCnTx7
	+FkA==
MIME-Version: 1.0
Received: by 10.182.212.35 with SMTP id nh3mr3050971obc.10.1353045753428; Thu,
	15 Nov 2012 22:02:33 -0800 (PST)
Received: by 10.60.21.163 with HTTP; Thu, 15 Nov 2012 22:02:33 -0800 (PST)
Date: Fri, 16 Nov 2012 14:02:33 +0800
X-Google-Sender-Auth: t2QT5CpbgEl66qG58pjIkQkx6Rs
Message-ID: <CAERYnoZOJ-9nMjEbNNqWfU0Co6ksOHqOCG+nErKMfsnqJ125=w@mail.gmail.com>
From: Chunyan Liu <cyliu@suse.com>
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH]xenstore-chmod: handle arbitrary number of perms
 rather than MAX_PERMS constant
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Constant MAX_PERMS 16 is too small to use in some occasions, e.g. if
there are more than 16 domU(s) on one hypervisor (it's easy to
achieve) and one wants to do xenstore-chmod PATH to all domU(s). So,
remove MAX_PERMS limitation and make it as arbitrary number of perms.

Signed-off-by: Chunyan Liu <cyliu@suse.com>

diff -r 8b93ac0c93f3 tools/xenstore/xenstore_client.c
--- a/tools/xenstore/xenstore_client.c  Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/xenstore/xenstore_client.c  Thu Nov 15 16:33:32 2012 +0800
@@ -25,7 +25,6 @@
 #define PATH_SEP '/'
 #define MAX_PATH_LEN 256

-#define MAX_PERMS 16

 enum mode {
     MODE_unknown,
@@ -416,31 +415,31 @@ perform(enum mode mode, int optind, int
            break;
         }
         case MODE_chmod: {
-            struct xs_permissions perms[MAX_PERMS];
-            int nperms = 0;
+            struct xs_permissions *perms;
             /* save path pointer: */
             char *path = argv[optind++];
+            int nperms = argc - optind;
+            int i;
+            perms = (struct xs_permissions *)malloc(nperms *
sizeof(struct xs_permissions));
+            if (!perms)
+               err(1, NULL);
-            for (; argv[optind]; optind++, nperms++)
+            for (i = 0; argv[optind]; optind++, i++)
             {
-                if (MAX_PERMS <= nperms)
-                    errx(1, "Too many permissions specified.  "
-                        "Maximum per invocation is %d.", MAX_PERMS);
-
-                perms[nperms].id = atoi(argv[optind]+1);
+                perms[i].id = atoi(argv[optind]+1);

                 switch (argv[optind][0])
                 {
                 case 'n':
-                    perms[nperms].perms = XS_PERM_NONE;
+                    perms[i].perms = XS_PERM_NONE;
                     break;
                 case 'r':
-                    perms[nperms].perms = XS_PERM_READ;
+                    perms[i].perms = XS_PERM_READ;
                     break;
                 case 'w':
-                    perms[nperms].perms = XS_PERM_WRITE;
+                    perms[i].perms = XS_PERM_WRITE;
                     break;
                 case 'b':
-                    perms[nperms].perms = XS_PERM_READ | XS_PERM_WRITE;
+                    perms[i].perms = XS_PERM_READ | XS_PERM_WRITE;
                     break;
                 default:
                     errx(1, "Invalid permission specification: '%c'",
@@ -449,6 +448,7 @@ perform(enum mode mode, int optind, int
             }

             do_chmod(path, perms, nperms, upto, recurse, xsh, xth);
+            free(perms);
             break;
         }
         case MODE_watch: {

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 06:03:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 06:03:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZF0f-0005k4-Uz; Fri, 16 Nov 2012 06:02:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kgrace.liu@gmail.com>) id 1TZF0e-0005jz-Q4
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 06:02:37 +0000
Received: from [85.158.139.211:16594] by server-2.bemta-5.messagelabs.com id
	72/D4-04892-CF6D5A05; Fri, 16 Nov 2012 06:02:36 +0000
X-Env-Sender: kgrace.liu@gmail.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1353045754!20381306!1
X-Originating-IP: [209.85.219.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 776 invoked from network); 16 Nov 2012 06:02:35 -0000
Received: from mail-oa0-f43.google.com (HELO mail-oa0-f43.google.com)
	(209.85.219.43)
	by server-2.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 06:02:35 -0000
Received: by mail-oa0-f43.google.com with SMTP id k1so3191210oag.30
	for <xen-devel@lists.xensource.com>;
	Thu, 15 Nov 2012 22:02:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:content-type;
	bh=z6A0HOOjFM4ow4+lF5KE9EaLpkJecfwaYB3UvAPoAHg=;
	b=KRIcb1NH2SFoqni6TtisCP9fKY4R+jfVKoB1Nhh5qiUH12U23iFOKtPeLkERcUvIq2
	Pdxl6rI0vIZ0sgLEAbcOtQOMAMbKwNymkpbS1Y1Ku3+S8jnUfPhuAKtk+fBquhnVn8o4
	kYwdj1JNpgM5BVwHjsTakItRpzMDOSKMW7K6QLPLhJIxTR7hXcHcGb26NBEzeDsp2yTw
	ROlYPFSPxD9J9v5GBdxmnaoXSOnopuY+WB6U9aYNOMqCCsFBeg9lSjHk+91gyih33plM
	bAWNy8KYjQUBfX/lHc/yf8327AlDAu0Syy8OJNdWtkAeSmGeGWIUxSeS3IklYarCnTx7
	+FkA==
MIME-Version: 1.0
Received: by 10.182.212.35 with SMTP id nh3mr3050971obc.10.1353045753428; Thu,
	15 Nov 2012 22:02:33 -0800 (PST)
Received: by 10.60.21.163 with HTTP; Thu, 15 Nov 2012 22:02:33 -0800 (PST)
Date: Fri, 16 Nov 2012 14:02:33 +0800
X-Google-Sender-Auth: t2QT5CpbgEl66qG58pjIkQkx6Rs
Message-ID: <CAERYnoZOJ-9nMjEbNNqWfU0Co6ksOHqOCG+nErKMfsnqJ125=w@mail.gmail.com>
From: Chunyan Liu <cyliu@suse.com>
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH]xenstore-chmod: handle arbitrary number of perms
 rather than MAX_PERMS constant
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Constant MAX_PERMS 16 is too small to use in some occasions, e.g. if
there are more than 16 domU(s) on one hypervisor (it's easy to
achieve) and one wants to do xenstore-chmod PATH to all domU(s). So,
remove MAX_PERMS limitation and make it as arbitrary number of perms.

Signed-off-by: Chunyan Liu <cyliu@suse.com>

diff -r 8b93ac0c93f3 tools/xenstore/xenstore_client.c
--- a/tools/xenstore/xenstore_client.c  Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/xenstore/xenstore_client.c  Thu Nov 15 16:33:32 2012 +0800
@@ -25,7 +25,6 @@
 #define PATH_SEP '/'
 #define MAX_PATH_LEN 256

-#define MAX_PERMS 16

 enum mode {
     MODE_unknown,
@@ -416,31 +415,31 @@ perform(enum mode mode, int optind, int
            break;
         }
         case MODE_chmod: {
-            struct xs_permissions perms[MAX_PERMS];
-            int nperms = 0;
+            struct xs_permissions *perms;
             /* save path pointer: */
             char *path = argv[optind++];
+            int nperms = argc - optind;
+            int i;
+            perms = (struct xs_permissions *)malloc(nperms *
sizeof(struct xs_permissions));
+            if (!perms)
+               err(1, NULL);
-            for (; argv[optind]; optind++, nperms++)
+            for (i = 0; argv[optind]; optind++, i++)
             {
-                if (MAX_PERMS <= nperms)
-                    errx(1, "Too many permissions specified.  "
-                        "Maximum per invocation is %d.", MAX_PERMS);
-
-                perms[nperms].id = atoi(argv[optind]+1);
+                perms[i].id = atoi(argv[optind]+1);

                 switch (argv[optind][0])
                 {
                 case 'n':
-                    perms[nperms].perms = XS_PERM_NONE;
+                    perms[i].perms = XS_PERM_NONE;
                     break;
                 case 'r':
-                    perms[nperms].perms = XS_PERM_READ;
+                    perms[i].perms = XS_PERM_READ;
                     break;
                 case 'w':
-                    perms[nperms].perms = XS_PERM_WRITE;
+                    perms[i].perms = XS_PERM_WRITE;
                     break;
                 case 'b':
-                    perms[nperms].perms = XS_PERM_READ | XS_PERM_WRITE;
+                    perms[i].perms = XS_PERM_READ | XS_PERM_WRITE;
                     break;
                 default:
                     errx(1, "Invalid permission specification: '%c'",
@@ -449,6 +448,7 @@ perform(enum mode mode, int optind, int
             }

             do_chmod(path, perms, nperms, upto, recurse, xsh, xth);
+            free(perms);
             break;
         }
         case MODE_watch: {

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 06:22:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 06:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZFJW-00065j-Ow; Fri, 16 Nov 2012 06:22:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TZFJV-00065W-6b
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 06:22:05 +0000
Received: from [85.158.143.99:10144] by server-3.bemta-4.messagelabs.com id
	97/48-06841-C8BD5A05; Fri, 16 Nov 2012 06:22:04 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1353046923!22623359!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0NDk2OQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25366 invoked from network); 16 Nov 2012 06:22:04 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-11.tower-216.messagelabs.com with SMTP;
	16 Nov 2012 06:22:04 -0000
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
	by fmsmga101.fm.intel.com with ESMTP; 15 Nov 2012 22:22:02 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,261,1352102400"; d="scan'208";a="250046872"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by fmsmga002.fm.intel.com with ESMTP; 15 Nov 2012 22:22:02 -0800
Received: from FMSMSX109.amr.corp.intel.com (10.19.9.28) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 15 Nov 2012 22:22:02 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	fmsmsx109.amr.corp.intel.com (10.19.9.28) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 15 Nov 2012 22:22:02 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Fri, 16 Nov 2012 14:22:00 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, "Zhang, Yang Z" <yang.z.zhang@intel.com>
Thread-Topic: [Xen-devel] iommu=dom0-passthrough behavior
Thread-Index: AQHNwXYJqLF+2AjHBkK5l/uG97/aIZfnbfFggAAyLdWAADp0YP//g6QAgAEdtPCAAFY0AIABvW7Q//+IJ4CAAeMggA==
Date: Fri, 16 Nov 2012 06:21:59 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A4834564403384F23@SHSMSX101.ccr.corp.intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
	<50A2755402000078000A837D@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
	<50A3AD4E02000078000A87BD@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403374F44@SHSMSX101.ccr.corp.intel.com>
	<50A4BE6D02000078000A8B89@nat28.tlf.novell.com>
In-Reply-To: <50A4BE6D02000078000A8B89@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>, "Zhang,
	Xiantao" <xiantao.zhang@intel.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> >> Which, if I'm not mistaken, could be implemented entirely independent
> >> of "iommu=dom0-passthrough". I'll see if that helps on the offending
> system.
> >
> > I mean this one:
> >>>c) we could provide a command line option to allow fake devices to be
> >>>create
> >
> > Yes,  I don't think "iommu=dom0-passthrough" can meet your requirement.
> >  We had better add a cmd line option to  pass the related information
> > to hypervisor and VT-d can create the pass-through context entry  for
> > the undetectable device.
> 
> You misunderstood: What I was saying (and seeking confirmation) is that I
> don't think the new command line option would need to have any
> connection to the existing, non-suitable one. In particular, for it to take effect,
> "iommu=dom0-passthrough"
> wouldn't need to be specified at all.
Okay.  Back to your customer's issue, I don't think we have a clean solution if the device can't be detected by hypervisor.   We only can figure out how to workaround this issue through a new command line option.  
BTW,   if the device can't be detected,  how to load its driver by OS ?  
Xiantao


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 06:22:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 06:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZFJW-00065j-Ow; Fri, 16 Nov 2012 06:22:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TZFJV-00065W-6b
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 06:22:05 +0000
Received: from [85.158.143.99:10144] by server-3.bemta-4.messagelabs.com id
	97/48-06841-C8BD5A05; Fri, 16 Nov 2012 06:22:04 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1353046923!22623359!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0NDk2OQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25366 invoked from network); 16 Nov 2012 06:22:04 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-11.tower-216.messagelabs.com with SMTP;
	16 Nov 2012 06:22:04 -0000
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
	by fmsmga101.fm.intel.com with ESMTP; 15 Nov 2012 22:22:02 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,261,1352102400"; d="scan'208";a="250046872"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by fmsmga002.fm.intel.com with ESMTP; 15 Nov 2012 22:22:02 -0800
Received: from FMSMSX109.amr.corp.intel.com (10.19.9.28) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 15 Nov 2012 22:22:02 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	fmsmsx109.amr.corp.intel.com (10.19.9.28) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 15 Nov 2012 22:22:02 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Fri, 16 Nov 2012 14:22:00 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, "Zhang, Yang Z" <yang.z.zhang@intel.com>
Thread-Topic: [Xen-devel] iommu=dom0-passthrough behavior
Thread-Index: AQHNwXYJqLF+2AjHBkK5l/uG97/aIZfnbfFggAAyLdWAADp0YP//g6QAgAEdtPCAAFY0AIABvW7Q//+IJ4CAAeMggA==
Date: Fri, 16 Nov 2012 06:21:59 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A4834564403384F23@SHSMSX101.ccr.corp.intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
	<50A2755402000078000A837D@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
	<50A3AD4E02000078000A87BD@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403374F44@SHSMSX101.ccr.corp.intel.com>
	<50A4BE6D02000078000A8B89@nat28.tlf.novell.com>
In-Reply-To: <50A4BE6D02000078000A8B89@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>, "Zhang,
	Xiantao" <xiantao.zhang@intel.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> >> Which, if I'm not mistaken, could be implemented entirely independent
> >> of "iommu=dom0-passthrough". I'll see if that helps on the offending
> system.
> >
> > I mean this one:
> >>>c) we could provide a command line option to allow fake devices to be
> >>>create
> >
> > Yes,  I don't think "iommu=dom0-passthrough" can meet your requirement.
> >  We had better add a cmd line option to  pass the related information
> > to hypervisor and VT-d can create the pass-through context entry  for
> > the undetectable device.
> 
> You misunderstood: What I was saying (and seeking confirmation) is that I
> don't think the new command line option would need to have any
> connection to the existing, non-suitable one. In particular, for it to take effect,
> "iommu=dom0-passthrough"
> wouldn't need to be specified at all.
Okay.  Back to your customer's issue, I don't think we have a clean solution if the device can't be detected by hypervisor.   We only can figure out how to workaround this issue through a new command line option.  
BTW,   if the device can't be detected,  how to load its driver by OS ?  
Xiantao


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 07:14:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 07:14:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZG86-0007E7-A6; Fri, 16 Nov 2012 07:14:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZG84-0007E2-SQ
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 07:14:21 +0000
Received: from [85.158.138.51:51779] by server-13.bemta-3.messagelabs.com id
	FA/26-24887-CC7E5A05; Fri, 16 Nov 2012 07:14:20 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1353050059!10526626!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg4NDY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4480 invoked from network); 16 Nov 2012 07:14:19 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 07:14:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,262,1352073600"; d="scan'208";a="15841654"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 07:14:19 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 07:14:18 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TZG82-0004tF-V5;
	Fri, 16 Nov 2012 07:14:19 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TZG82-00018e-JO;
	Fri, 16 Nov 2012 07:14:18 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14411-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 16 Nov 2012 07:14:18 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14411: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14411 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14411/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14408
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14408
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14408
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14408

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  321f8487379b
baseline version:
 xen                  321f8487379b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 07:14:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 07:14:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZG86-0007E7-A6; Fri, 16 Nov 2012 07:14:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZG84-0007E2-SQ
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 07:14:21 +0000
Received: from [85.158.138.51:51779] by server-13.bemta-3.messagelabs.com id
	FA/26-24887-CC7E5A05; Fri, 16 Nov 2012 07:14:20 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1353050059!10526626!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg4NDY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4480 invoked from network); 16 Nov 2012 07:14:19 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 07:14:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,262,1352073600"; d="scan'208";a="15841654"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 07:14:19 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 07:14:18 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TZG82-0004tF-V5;
	Fri, 16 Nov 2012 07:14:19 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TZG82-00018e-JO;
	Fri, 16 Nov 2012 07:14:18 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14411-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 16 Nov 2012 07:14:18 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14411: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14411 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14411/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14408
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14408
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14408
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14408

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  321f8487379b
baseline version:
 xen                  321f8487379b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 07:57:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 07:57:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZGnk-0007ud-Ct; Fri, 16 Nov 2012 07:57:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZGni-0007uY-Cx
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 07:57:22 +0000
Received: from [85.158.143.99:61567] by server-1.bemta-4.messagelabs.com id
	C8/00-27934-1E1F5A05; Fri, 16 Nov 2012 07:57:21 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1353052639!24888574!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NzMxMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19237 invoked from network); 16 Nov 2012 07:57:21 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-12.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 07:57:21 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAG7vH7l028821
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 07:57:17 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAG7vG87003518
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 07:57:16 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAG7vFxu018289; Fri, 16 Nov 2012 01:57:15 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 23:57:15 -0800
Message-ID: <50A5F1D8.20308@oracle.com>
Date: Fri, 16 Nov 2012 15:57:12 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963066-570-1-git-send-email-annie.li@oracle.com>
	<50A4BC7D.6060707@citrix.com> <50A5A9CF.8030008@oracle.com>
In-Reply-To: <50A5A9CF.8030008@oracle.com>
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent
 grant with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-16 10:49, ANNIE LI wrote:
>
>
> On 2012-11-15 17:57, Roger Pau Monn=E9 wrote:
>>>
>>> @@ -453,7 +460,12 @@ static int connect_rings(struct backend_info *be)
>>>                  val =3D 0;
>>>          vif->csum =3D !val;
>>>
>>> -       /* Map the shared frame, irq etc. */
>>> +       if (xenbus_scanf(XBT_NIL, dev->otherend, =

>>> "feature-persistent-grants",
>>> +                        "%u",&val)<  0)
>> In block devices "feature-persistent" is used, so I think that for
>> clearness it should be announced the same way in net.
> Is it  "feature-persistent" ? I checked your RFC patch, the key is =

> "feature-persistent-grants".
>
>
My mistake.
In your v2 patch, it is "feature-persistent". I will change the code as =

blkback/blkfront.

Thanks
Annie

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 07:57:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 07:57:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZGnk-0007ud-Ct; Fri, 16 Nov 2012 07:57:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZGni-0007uY-Cx
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 07:57:22 +0000
Received: from [85.158.143.99:61567] by server-1.bemta-4.messagelabs.com id
	C8/00-27934-1E1F5A05; Fri, 16 Nov 2012 07:57:21 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1353052639!24888574!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2NzMxMw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19237 invoked from network); 16 Nov 2012 07:57:21 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-12.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 07:57:21 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAG7vH7l028821
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 07:57:17 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAG7vG87003518
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 07:57:16 GMT
Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAG7vFxu018289; Fri, 16 Nov 2012 01:57:15 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 23:57:15 -0800
Message-ID: <50A5F1D8.20308@oracle.com>
Date: Fri, 16 Nov 2012 15:57:12 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963066-570-1-git-send-email-annie.li@oracle.com>
	<50A4BC7D.6060707@citrix.com> <50A5A9CF.8030008@oracle.com>
In-Reply-To: <50A5A9CF.8030008@oracle.com>
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent
 grant with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-16 10:49, ANNIE LI wrote:
>
>
> On 2012-11-15 17:57, Roger Pau Monn=E9 wrote:
>>>
>>> @@ -453,7 +460,12 @@ static int connect_rings(struct backend_info *be)
>>>                  val =3D 0;
>>>          vif->csum =3D !val;
>>>
>>> -       /* Map the shared frame, irq etc. */
>>> +       if (xenbus_scanf(XBT_NIL, dev->otherend, =

>>> "feature-persistent-grants",
>>> +                        "%u",&val)<  0)
>> In block devices "feature-persistent" is used, so I think that for
>> clearness it should be announced the same way in net.
> Is it  "feature-persistent" ? I checked your RFC patch, the key is =

> "feature-persistent-grants".
>
>
My mistake.
In your v2 patch, it is "feature-persistent". I will change the code as =

blkback/blkfront.

Thanks
Annie

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 07:59:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 07:59:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZGpM-0007z5-Sx; Fri, 16 Nov 2012 07:59:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZGpM-0007z0-59
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 07:59:04 +0000
Received: from [85.158.143.35:4016] by server-1.bemta-4.messagelabs.com id
	4F/B1-27934-742F5A05; Fri, 16 Nov 2012 07:59:03 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1353052741!6817390!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTY4MDE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4250 invoked from network); 16 Nov 2012 07:59:02 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-5.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 07:59:02 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAG7wwWM012391
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 07:58:59 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAG7wv1L004893
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 07:58:58 GMT
Received: from abhmt115.oracle.com (abhmt115.oracle.com [141.146.116.67])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAG7wvZo018422; Fri, 16 Nov 2012 01:58:57 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 23:58:57 -0800
Message-ID: <50A5F23E.4090506@oracle.com>
Date: Fri, 16 Nov 2012 15:58:54 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963114-628-1-git-send-email-annie.li@oracle.com>
	<50A4C987.3020308@citrix.com> <50A5CD7F.2010609@oracle.com>
In-Reply-To: <50A5CD7F.2010609@oracle.com>
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 3/4] Xen/netfront: Implement persistent
 grant in netfront.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-16 13:22, ANNIE LI wrote:
>
>
> On 2012-11-15 18:52, Roger Pau Monn=E9 wrote:
>>> +       err =3D xenbus_printf(xbt, dev->nodename, =

>>> "feature-persistent-grants",
>>> +                           "%u", info->persistent_gnt);
>> As in netback, I think "feature-persistent" should be used.
>
> Same in blkback, I assume it is  "feature-persistent-grants", right?
> I referred your RFC patch, did you change it later? Or I missed =

> something?
>
>
My mistake.
In your v2 patch, it is "feature-persistent". I will change the code as =

blkback/blkfront.

Thanks
Annie

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 07:59:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 07:59:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZGpM-0007z5-Sx; Fri, 16 Nov 2012 07:59:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZGpM-0007z0-59
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 07:59:04 +0000
Received: from [85.158.143.35:4016] by server-1.bemta-4.messagelabs.com id
	4F/B1-27934-742F5A05; Fri, 16 Nov 2012 07:59:03 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1353052741!6817390!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTY4MDE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4250 invoked from network); 16 Nov 2012 07:59:02 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-5.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 07:59:02 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAG7wwWM012391
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 07:58:59 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAG7wv1L004893
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 07:58:58 GMT
Received: from abhmt115.oracle.com (abhmt115.oracle.com [141.146.116.67])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAG7wvZo018422; Fri, 16 Nov 2012 01:58:57 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 15 Nov 2012 23:58:57 -0800
Message-ID: <50A5F23E.4090506@oracle.com>
Date: Fri, 16 Nov 2012 15:58:54 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963114-628-1-git-send-email-annie.li@oracle.com>
	<50A4C987.3020308@citrix.com> <50A5CD7F.2010609@oracle.com>
In-Reply-To: <50A5CD7F.2010609@oracle.com>
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 3/4] Xen/netfront: Implement persistent
 grant in netfront.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-16 13:22, ANNIE LI wrote:
>
>
> On 2012-11-15 18:52, Roger Pau Monn=E9 wrote:
>>> +       err =3D xenbus_printf(xbt, dev->nodename, =

>>> "feature-persistent-grants",
>>> +                           "%u", info->persistent_gnt);
>> As in netback, I think "feature-persistent" should be used.
>
> Same in blkback, I assume it is  "feature-persistent-grants", right?
> I referred your RFC patch, did you change it later? Or I missed =

> something?
>
>
My mistake.
In your v2 patch, it is "feature-persistent". I will change the code as =

blkback/blkfront.

Thanks
Annie

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 08:07:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 08:07:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZGxZ-0000JX-Hg; Fri, 16 Nov 2012 08:07:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZGxX-0000JS-9e
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 08:07:31 +0000
Received: from [85.158.143.35:2087] by server-2.bemta-4.messagelabs.com id
	92/05-28922-244F5A05; Fri, 16 Nov 2012 08:07:30 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1353053249!17318057!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwODk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29611 invoked from network); 16 Nov 2012 08:07:30 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-21.messagelabs.com with SMTP;
	16 Nov 2012 08:07:30 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 08:07:29 +0000
Message-Id: <50A6024F02000078000A9214@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 08:07:27 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
In-Reply-To: <20121115164156.GE75988@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>, eddie.dong@intel.com,
	Ian.Campbell@citrix.com, jun.nakajima@intel.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 17:41, Tim Deegan <tim@xen.org> wrote:
> At 10:06 +0000 on 14 Nov (1352887560), Jan Beulich wrote:
>> > +            asm volatile("int $2"); /* Real NMI, vector 2: normal 
> processing */
>> 
>> And I still don't like this use of "int $2" here: An aspect we didn't
>> consider so far is that a nested MCE would break things again
> 
> OK, I think I understand the problem[s], but I'm going to spell it out
> slowly so you can correct me. :)
> 
> [ tl;dr I agree that do_nmi() is better, and we should do that in this
>   patch, but maybe we need to solve the general problem too. ]
> 
> On a PV guest, we have to use dedicated stacks for NMI and MCE in case
> either of those things happens just before SYSRET when we're on the user
> stack (no other interrupt or exception can happen at that point).

Yes.

> On an AMD CPU we _don't_ have dedicated stacks for NMI or MCE when we're
> running a HVM guest, so the stack issue doesn't apply (but nested NMIs
> are still bad).

Yes, albeit that's a potential (separate) problem too (because we
don't distinguish the event having its origin in guest or hypervisor
context, i.e. an MCE due to a back stack page would be handled
on that same stack page, i.e. shutdown).

> On an Intel CPU, we _do_ use dedicated stacks for NMI and MCE in HVM
> guests.  We don't really have to but it saves time in the context switch
> not to update the IDT.  Using do_nmi() here means that the first NMI is
> handled on the normal stack instead.  It's also consistent with the way
> we call do_machine_check() for the MCE case.  But it needs an explicit
> IRET after the call to do_nmi() to make sure that NMIs get re-enabled.

Or have the subsequent VMRESUME take care of this. There is a
sentence in "26.6.1 Interruptibility State" to that effect: "NMIs are
not blocked in VMX nonroot operation (except for ordinary blocking
for other reasons, such as by the MOV SS instruction, the
wait-for-SIPI state, etc.)", so NMIs get unblocked implicitly with
the VMRESUME.

Hence the only problem is with ending the NMI context when not
exiting back to VMX guest.

I continue to not be in favor of special casing this in VMX code,
considering that the problem is generic (i.e. similarly affects PV).
I.e. either we handle the other case similarly (special code added
also to the PV code path), or we deal with this in a single place,
keeping the NMIs masked for an extended period of time.

> These dedicated stacks make the general problem of re-entrant MCE/NMI
> worse.  In the general case those handlers don't expect to be called in
> a reentrant way, but blatting the stack turns a possible problem into a
> definite one.

Yes. I think almost everyone agrees that this is a design flaw.

> ---
> 
> All of this would be moot except for the risk that we might take an MCE
> while in the NMI handler.  The IRET from the MCE handler re-enables NMIs
> while we're still in the NMI handler, and a second NMI arriving could
> break the NMI handler.  In the PV case, it will also clobber the NMI
> handler's stack.

No - the entry code switches away from the dedicated stacks when
the origin was in guest context (see handle_ist_exception in
xen/arch/x86/x86_64/entry.S).

> In the VMX case we would need to see something like
> (NMI (MCE) (NMI (MCE) (NMI))) for that to happen, but it could.
> 
> The inverse case, taking an NMI while in the MCE handler, is not very
> interesting.  There's no masking of MCEs so that handler already has to
> deal with nested entry, and the IRET from the NMI handler has no effect.

As already pointed out by Andrew, there is an in-progress bit
for this. The thing is that we'd have to switch away from the
dedicated stack before clearing that bit (which shouldn't be too
difficult; if the MCE was caused by the normal stack, we
shouldn't be getting to the point of trying to exit from the MCE
handler anyway).

> We could potentially solve the problem by having the MCE handler check
> whether it's returning to the NMI stack, and do a normal return in that
> case.  It's a bit of extra code but only in the MCE handler, which is
> not performance-critical. 

Yes, that could solve that nesting case (again not very difficult
to implement).

> If we do that, then the choice of 'int $2' vs 'do_nmi(); fake_iret()'
> is mostly one of taste.  do_nmi() saves an IDT indirection but
> unbalances the call/return stack.  I slightly prefer 'int $2' just
> because it makes the PV and non-PV cases more similar.

Once the nesting is dealt with properly, and if we decide to do
the NMI-disabled-window-exit early, then yes, I agree (apart
from the taste aspect, which would still tell me not to use "int $xx"
in hypervisor code). And, as I think Mats said, this might then be
done for the MCE the same way for consistency.

> But first, we should take the current fix, with do_nmi() and iret() 
> instead of 'int $2'.  The nested-MCE issue can be handled separately.

Leaving the PV case un-addressed...

> Does that make sense?

Of course.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 08:07:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 08:07:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZGxZ-0000JX-Hg; Fri, 16 Nov 2012 08:07:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZGxX-0000JS-9e
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 08:07:31 +0000
Received: from [85.158.143.35:2087] by server-2.bemta-4.messagelabs.com id
	92/05-28922-244F5A05; Fri, 16 Nov 2012 08:07:30 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1353053249!17318057!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwODk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29611 invoked from network); 16 Nov 2012 08:07:30 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-21.messagelabs.com with SMTP;
	16 Nov 2012 08:07:30 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 08:07:29 +0000
Message-Id: <50A6024F02000078000A9214@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 08:07:27 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
In-Reply-To: <20121115164156.GE75988@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>, eddie.dong@intel.com,
	Ian.Campbell@citrix.com, jun.nakajima@intel.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 17:41, Tim Deegan <tim@xen.org> wrote:
> At 10:06 +0000 on 14 Nov (1352887560), Jan Beulich wrote:
>> > +            asm volatile("int $2"); /* Real NMI, vector 2: normal 
> processing */
>> 
>> And I still don't like this use of "int $2" here: An aspect we didn't
>> consider so far is that a nested MCE would break things again
> 
> OK, I think I understand the problem[s], but I'm going to spell it out
> slowly so you can correct me. :)
> 
> [ tl;dr I agree that do_nmi() is better, and we should do that in this
>   patch, but maybe we need to solve the general problem too. ]
> 
> On a PV guest, we have to use dedicated stacks for NMI and MCE in case
> either of those things happens just before SYSRET when we're on the user
> stack (no other interrupt or exception can happen at that point).

Yes.

> On an AMD CPU we _don't_ have dedicated stacks for NMI or MCE when we're
> running a HVM guest, so the stack issue doesn't apply (but nested NMIs
> are still bad).

Yes, albeit that's a potential (separate) problem too (because we
don't distinguish the event having its origin in guest or hypervisor
context, i.e. an MCE due to a back stack page would be handled
on that same stack page, i.e. shutdown).

> On an Intel CPU, we _do_ use dedicated stacks for NMI and MCE in HVM
> guests.  We don't really have to but it saves time in the context switch
> not to update the IDT.  Using do_nmi() here means that the first NMI is
> handled on the normal stack instead.  It's also consistent with the way
> we call do_machine_check() for the MCE case.  But it needs an explicit
> IRET after the call to do_nmi() to make sure that NMIs get re-enabled.

Or have the subsequent VMRESUME take care of this. There is a
sentence in "26.6.1 Interruptibility State" to that effect: "NMIs are
not blocked in VMX nonroot operation (except for ordinary blocking
for other reasons, such as by the MOV SS instruction, the
wait-for-SIPI state, etc.)", so NMIs get unblocked implicitly with
the VMRESUME.

Hence the only problem is with ending the NMI context when not
exiting back to VMX guest.

I continue to not be in favor of special casing this in VMX code,
considering that the problem is generic (i.e. similarly affects PV).
I.e. either we handle the other case similarly (special code added
also to the PV code path), or we deal with this in a single place,
keeping the NMIs masked for an extended period of time.

> These dedicated stacks make the general problem of re-entrant MCE/NMI
> worse.  In the general case those handlers don't expect to be called in
> a reentrant way, but blatting the stack turns a possible problem into a
> definite one.

Yes. I think almost everyone agrees that this is a design flaw.

> ---
> 
> All of this would be moot except for the risk that we might take an MCE
> while in the NMI handler.  The IRET from the MCE handler re-enables NMIs
> while we're still in the NMI handler, and a second NMI arriving could
> break the NMI handler.  In the PV case, it will also clobber the NMI
> handler's stack.

No - the entry code switches away from the dedicated stacks when
the origin was in guest context (see handle_ist_exception in
xen/arch/x86/x86_64/entry.S).

> In the VMX case we would need to see something like
> (NMI (MCE) (NMI (MCE) (NMI))) for that to happen, but it could.
> 
> The inverse case, taking an NMI while in the MCE handler, is not very
> interesting.  There's no masking of MCEs so that handler already has to
> deal with nested entry, and the IRET from the NMI handler has no effect.

As already pointed out by Andrew, there is an in-progress bit
for this. The thing is that we'd have to switch away from the
dedicated stack before clearing that bit (which shouldn't be too
difficult; if the MCE was caused by the normal stack, we
shouldn't be getting to the point of trying to exit from the MCE
handler anyway).

> We could potentially solve the problem by having the MCE handler check
> whether it's returning to the NMI stack, and do a normal return in that
> case.  It's a bit of extra code but only in the MCE handler, which is
> not performance-critical. 

Yes, that could solve that nesting case (again not very difficult
to implement).

> If we do that, then the choice of 'int $2' vs 'do_nmi(); fake_iret()'
> is mostly one of taste.  do_nmi() saves an IDT indirection but
> unbalances the call/return stack.  I slightly prefer 'int $2' just
> because it makes the PV and non-PV cases more similar.

Once the nesting is dealt with properly, and if we decide to do
the NMI-disabled-window-exit early, then yes, I agree (apart
from the taste aspect, which would still tell me not to use "int $xx"
in hypervisor code). And, as I think Mats said, this might then be
done for the MCE the same way for consistency.

> But first, we should take the current fix, with do_nmi() and iret() 
> instead of 'int $2'.  The nested-MCE issue can be handled separately.

Leaving the PV case un-addressed...

> Does that make sense?

Of course.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 08:18:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 08:18:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZH7N-0000c7-TC; Fri, 16 Nov 2012 08:17:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZH7M-0000c2-Cf
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 08:17:40 +0000
Received: from [85.158.139.211:11445] by server-13.bemta-5.messagelabs.com id
	CB/E3-27809-3A6F5A05; Fri, 16 Nov 2012 08:17:39 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1353053859!20355316!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwODk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31353 invoked from network); 16 Nov 2012 08:17:39 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 08:17:39 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 08:17:38 +0000
Message-Id: <50A604B102000078000A9224@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 08:17:37 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>,
 "Tim Deegan" <tim@xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A51DC4.7040205@citrix.com>
	<20121115172514.GG75988@ocelot.phlegethon.org>
In-Reply-To: <20121115172514.GG75988@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 18:25, Tim Deegan <tim@xen.org> wrote:
> At 16:52 +0000 on 15 Nov (1352998340), Andrew Cooper wrote:
>> It is also possible to get a reentrant NMI if there is a pagefault (or
>> handful of other possible faults) when trying to execute the iret of
>> the NMI itself; NMIs can get re-enabled from the iret of the
>> pagefault, and we take a new NMI before attempting to retry the iret
>> from the original NMI.
> 
> Yes, I hadn't thought of that case.

But what would make a fault happen on that IRET? Oh, yes,
there is one case - the guest having its previous instruction end
exactly at the canonical/non-canonical boundary. But for the
sake of correctness, that's a #GP then. I would suppose this
would better be filtered (manually injecting a #GP into the guest)
than allowed to actually cause a #GP.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 08:18:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 08:18:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZH7N-0000c7-TC; Fri, 16 Nov 2012 08:17:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZH7M-0000c2-Cf
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 08:17:40 +0000
Received: from [85.158.139.211:11445] by server-13.bemta-5.messagelabs.com id
	CB/E3-27809-3A6F5A05; Fri, 16 Nov 2012 08:17:39 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1353053859!20355316!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwODk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31353 invoked from network); 16 Nov 2012 08:17:39 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 08:17:39 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 08:17:38 +0000
Message-Id: <50A604B102000078000A9224@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 08:17:37 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>,
 "Tim Deegan" <tim@xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A51DC4.7040205@citrix.com>
	<20121115172514.GG75988@ocelot.phlegethon.org>
In-Reply-To: <20121115172514.GG75988@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"eddie.dong@intel.com" <eddie.dong@intel.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 18:25, Tim Deegan <tim@xen.org> wrote:
> At 16:52 +0000 on 15 Nov (1352998340), Andrew Cooper wrote:
>> It is also possible to get a reentrant NMI if there is a pagefault (or
>> handful of other possible faults) when trying to execute the iret of
>> the NMI itself; NMIs can get re-enabled from the iret of the
>> pagefault, and we take a new NMI before attempting to retry the iret
>> from the original NMI.
> 
> Yes, I hadn't thought of that case.

But what would make a fault happen on that IRET? Oh, yes,
there is one case - the guest having its previous instruction end
exactly at the canonical/non-canonical boundary. But for the
sake of correctness, that's a #GP then. I would suppose this
would better be filtered (manually injecting a #GP into the guest)
than allowed to actually cause a #GP.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 08:22:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 08:22:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZHCD-0000qV-RN; Fri, 16 Nov 2012 08:22:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZHCC-0000qN-BT
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 08:22:40 +0000
Received: from [85.158.139.83:38422] by server-16.bemta-5.messagelabs.com id
	1E/BC-04786-FC7F5A05; Fri, 16 Nov 2012 08:22:39 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1353054159!23314947!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwODk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27693 invoked from network); 16 Nov 2012 08:22:39 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-182.messagelabs.com with SMTP;
	16 Nov 2012 08:22:39 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 08:22:38 +0000
Message-Id: <50A605DE02000078000A9230@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 08:22:38 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>,
	"Yang Z Zhang" <yang.z.zhang@intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
	<50A2755402000078000A837D@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
	<50A3AD4E02000078000A87BD@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403374F44@SHSMSX101.ccr.corp.intel.com>
	<50A4BE6D02000078000A8B89@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403384F23@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A4834564403384F23@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 07:21, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
>> >> Which, if I'm not mistaken, could be implemented entirely independent
>> >> of "iommu=dom0-passthrough". I'll see if that helps on the offending
>> system.
>> >
>> > I mean this one:
>> >>>c) we could provide a command line option to allow fake devices to be
>> >>>create
>> >
>> > Yes,  I don't think "iommu=dom0-passthrough" can meet your requirement.
>> >  We had better add a cmd line option to  pass the related information
>> > to hypervisor and VT-d can create the pass-through context entry  for
>> > the undetectable device.
>> 
>> You misunderstood: What I was saying (and seeking confirmation) is that I
>> don't think the new command line option would need to have any
>> connection to the existing, non-suitable one. In particular, for it to take 
> effect,
>> "iommu=dom0-passthrough"
>> wouldn't need to be specified at all.
> Okay.  Back to your customer's issue, I don't think we have a clean solution 
> if the device can't be detected by hypervisor.   We only can figure out how 
> to workaround this issue through a new command line option.  
> BTW,   if the device can't be detected,  how to load its driver by OS ?  

Once again - the device a function 0 is being detected, but when the
driver loads we see at least on DMA operation with a source ID of
function 1 under the same bus and slot. There's no driver needed for
the phantom device at function 1.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 08:22:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 08:22:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZHCD-0000qV-RN; Fri, 16 Nov 2012 08:22:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZHCC-0000qN-BT
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 08:22:40 +0000
Received: from [85.158.139.83:38422] by server-16.bemta-5.messagelabs.com id
	1E/BC-04786-FC7F5A05; Fri, 16 Nov 2012 08:22:39 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1353054159!23314947!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwODk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27693 invoked from network); 16 Nov 2012 08:22:39 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-182.messagelabs.com with SMTP;
	16 Nov 2012 08:22:39 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 08:22:38 +0000
Message-Id: <50A605DE02000078000A9230@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 08:22:38 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>,
	"Yang Z Zhang" <yang.z.zhang@intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
	<50A2755402000078000A837D@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
	<50A3AD4E02000078000A87BD@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403374F44@SHSMSX101.ccr.corp.intel.com>
	<50A4BE6D02000078000A8B89@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403384F23@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A4834564403384F23@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 07:21, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
>> >> Which, if I'm not mistaken, could be implemented entirely independent
>> >> of "iommu=dom0-passthrough". I'll see if that helps on the offending
>> system.
>> >
>> > I mean this one:
>> >>>c) we could provide a command line option to allow fake devices to be
>> >>>create
>> >
>> > Yes,  I don't think "iommu=dom0-passthrough" can meet your requirement.
>> >  We had better add a cmd line option to  pass the related information
>> > to hypervisor and VT-d can create the pass-through context entry  for
>> > the undetectable device.
>> 
>> You misunderstood: What I was saying (and seeking confirmation) is that I
>> don't think the new command line option would need to have any
>> connection to the existing, non-suitable one. In particular, for it to take 
> effect,
>> "iommu=dom0-passthrough"
>> wouldn't need to be specified at all.
> Okay.  Back to your customer's issue, I don't think we have a clean solution 
> if the device can't be detected by hypervisor.   We only can figure out how 
> to workaround this issue through a new command line option.  
> BTW,   if the device can't be detected,  how to load its driver by OS ?  

Once again - the device a function 0 is being detected, but when the
driver loads we see at least on DMA operation with a source ID of
function 1 under the same bus and slot. There's no driver needed for
the phantom device at function 1.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:17:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:17:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZI2Y-00024c-SX; Fri, 16 Nov 2012 09:16:46 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZI2X-00024W-8b
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 09:16:45 +0000
Received: from [193.109.254.147:50733] by server-7.bemta-14.messagelabs.com id
	56/C7-02272-C7406A05; Fri, 16 Nov 2012 09:16:44 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1353057396!3246012!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24022 invoked from network); 16 Nov 2012 09:16:37 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 09:16:37 -0000
X-IronPort-AV: E=Sophos;i="4.83,263,1352073600"; d="scan'208";a="15843610"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 09:16:36 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 09:16:36 +0000
Message-ID: <1353057394.3499.159.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tushar Behera <tushar.behera@linaro.org>
Date: Fri, 16 Nov 2012 09:16:34 +0000
In-Reply-To: <1353048646-10935-9-git-send-email-tushar.behera@linaro.org>
References: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
	<1353048646-10935-9-git-send-email-tushar.behera@linaro.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"patches@linaro.org" <patches@linaro.org>
Subject: Re: [Xen-devel] [PATCH 08/14] xen: netback: Remove redundant check
 on unsigned variable
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 06:50 +0000, Tushar Behera wrote:
> No need to check whether unsigned variable is less than 0.
> 
> CC: Ian Campbell <ian.campbell@citrix.com>
> CC: xen-devel@lists.xensource.com
> CC: netdev@vger.kernel.org
> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

Thanks.

> ---
>  drivers/net/xen-netback/netback.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
> index aab8677..515e10c 100644
> --- a/drivers/net/xen-netback/netback.c
> +++ b/drivers/net/xen-netback/netback.c
> @@ -190,14 +190,14 @@ static int get_page_ext(struct page *pg,
>  
>  	group = ext.e.group - 1;
>  
> -	if (group < 0 || group >= xen_netbk_group_nr)
> +	if (group >= xen_netbk_group_nr)
>  		return 0;
>  
>  	netbk = &xen_netbk[group];
>  
>  	idx = ext.e.idx;
>  
> -	if ((idx < 0) || (idx >= MAX_PENDING_REQS))
> +	if (idx >= MAX_PENDING_REQS)
>  		return 0;
>  
>  	if (netbk->mmap_pages[idx] != pg)



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:17:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:17:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZI2Y-00024c-SX; Fri, 16 Nov 2012 09:16:46 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZI2X-00024W-8b
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 09:16:45 +0000
Received: from [193.109.254.147:50733] by server-7.bemta-14.messagelabs.com id
	56/C7-02272-C7406A05; Fri, 16 Nov 2012 09:16:44 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1353057396!3246012!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24022 invoked from network); 16 Nov 2012 09:16:37 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 09:16:37 -0000
X-IronPort-AV: E=Sophos;i="4.83,263,1352073600"; d="scan'208";a="15843610"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 09:16:36 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 09:16:36 +0000
Message-ID: <1353057394.3499.159.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tushar Behera <tushar.behera@linaro.org>
Date: Fri, 16 Nov 2012 09:16:34 +0000
In-Reply-To: <1353048646-10935-9-git-send-email-tushar.behera@linaro.org>
References: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
	<1353048646-10935-9-git-send-email-tushar.behera@linaro.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"patches@linaro.org" <patches@linaro.org>
Subject: Re: [Xen-devel] [PATCH 08/14] xen: netback: Remove redundant check
 on unsigned variable
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 06:50 +0000, Tushar Behera wrote:
> No need to check whether unsigned variable is less than 0.
> 
> CC: Ian Campbell <ian.campbell@citrix.com>
> CC: xen-devel@lists.xensource.com
> CC: netdev@vger.kernel.org
> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

Thanks.

> ---
>  drivers/net/xen-netback/netback.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
> index aab8677..515e10c 100644
> --- a/drivers/net/xen-netback/netback.c
> +++ b/drivers/net/xen-netback/netback.c
> @@ -190,14 +190,14 @@ static int get_page_ext(struct page *pg,
>  
>  	group = ext.e.group - 1;
>  
> -	if (group < 0 || group >= xen_netbk_group_nr)
> +	if (group >= xen_netbk_group_nr)
>  		return 0;
>  
>  	netbk = &xen_netbk[group];
>  
>  	idx = ext.e.idx;
>  
> -	if ((idx < 0) || (idx >= MAX_PENDING_REQS))
> +	if (idx >= MAX_PENDING_REQS)
>  		return 0;
>  
>  	if (netbk->mmap_pages[idx] != pg)



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:26:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:26:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZIC4-0002Yx-J5; Fri, 16 Nov 2012 09:26:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZIC3-0002Yq-1b
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 09:26:35 +0000
Received: from [85.158.138.51:43619] by server-14.bemta-3.messagelabs.com id
	C0/89-12788-AC606A05; Fri, 16 Nov 2012 09:26:34 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353057988!30215673!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwODk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25816 invoked from network); 16 Nov 2012 09:26:28 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 09:26:28 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 09:26:27 +0000
Message-Id: <50A614D402000078000A9240@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 09:26:28 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>,
	"Yang Z Zhang" <yang.z.zhang@intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
	<50A2755402000078000A837D@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
	<50A3AD4E02000078000A87BD@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403374F44@SHSMSX101.ccr.corp.intel.com>
	<50A4BE6D02000078000A8B89@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403384F23@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A4834564403384F23@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 07:21, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
> Okay.  Back to your customer's issue, I don't think we have a clean solution 
> if the device can't be detected by hypervisor.   We only can figure out how 
> to workaround this issue through a new command line option.  

So after I implemented a draft patch for this yesterday, my
attention now was directed to phantom functions permitted by
the PCIe spec (of which I was entirely unaware so far). While
Linux to date doesn't enable them, I can't exclude that the BIOS
might be (requested respective data to find out). And even if it
doesn't, adding proper support for that functionality, and then
putting a quirk on top of that would seem the much cleaner
solution (pretty likely me_wifi_quirk() could then also be made
fit in there).

Thoughts?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:26:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:26:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZIC4-0002Yx-J5; Fri, 16 Nov 2012 09:26:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZIC3-0002Yq-1b
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 09:26:35 +0000
Received: from [85.158.138.51:43619] by server-14.bemta-3.messagelabs.com id
	C0/89-12788-AC606A05; Fri, 16 Nov 2012 09:26:34 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353057988!30215673!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQwODk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25816 invoked from network); 16 Nov 2012 09:26:28 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 09:26:28 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 09:26:27 +0000
Message-Id: <50A614D402000078000A9240@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 09:26:28 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>,
	"Yang Z Zhang" <yang.z.zhang@intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
	<50A2755402000078000A837D@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
	<50A3AD4E02000078000A87BD@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403374F44@SHSMSX101.ccr.corp.intel.com>
	<50A4BE6D02000078000A8B89@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403384F23@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A4834564403384F23@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 07:21, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
> Okay.  Back to your customer's issue, I don't think we have a clean solution 
> if the device can't be detected by hypervisor.   We only can figure out how 
> to workaround this issue through a new command line option.  

So after I implemented a draft patch for this yesterday, my
attention now was directed to phantom functions permitted by
the PCIe spec (of which I was entirely unaware so far). While
Linux to date doesn't enable them, I can't exclude that the BIOS
might be (requested respective data to find out). And even if it
doesn't, adding proper support for that functionality, and then
putting a quirk on top of that would seem the much cleaner
solution (pretty likely me_wifi_quirk() could then also be made
fit in there).

Thoughts?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:28:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:28:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZIDP-0002dm-26; Fri, 16 Nov 2012 09:27:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZIDN-0002dY-6i
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 09:27:57 +0000
Received: from [85.158.139.211:34249] by server-12.bemta-5.messagelabs.com id
	0C/D9-02886-C1706A05; Fri, 16 Nov 2012 09:27:56 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353058075!20355775!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26818 invoked from network); 16 Nov 2012 09:27:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 09:27:55 -0000
X-IronPort-AV: E=Sophos;i="4.83,263,1352073600"; d="scan'208";a="15843988"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 09:27:55 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 09:27:55 +0000
Message-ID: <1353058074.3499.166.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: ANNIE LI <annie.li@oracle.com>
Date: Fri, 16 Nov 2012 09:27:54 +0000
In-Reply-To: <50A5A285.1030805@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963066-570-1-git-send-email-annie.li@oracle.com>
	<1352970612.3499.43.camel@zakaz.uk.xensource.com>
	<50A5A285.1030805@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent
 grant with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 02:18 +0000, ANNIE LI wrote:
> In this patch,
> The maximum of memory overhead is about
> 
> (XEN_NETIF_TX_RING_SIZE+XEN_NETIF_RX_RING_SIZE)*PAGE_SIZE  (plus size of grant_ref_t and handle)
> which is about 512 PAGE_SIZE. Normally, without heavy network offload, this maximum can not be reached.
> 
> In next patch of splitting tx/rx pool, the maximum is about

"about" or just "is"?

>  (256+512)PAGE_SIZE.

IOW 3MB.

> >
> >> +
> >> +       return NULL;
> >> +}
> >> +
> >> @@ -1338,7 +1497,11 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
> >>                  gop->source.domid = vif->domid;
> >>                  gop->source.offset = txreq.offset;
> >>
> >> -               gop->dest.u.gmfn = virt_to_mfn(page_address(page));
> >> +               if (!vif->persistent_grant)
> >> +                       gop->dest.u.gmfn = virt_to_mfn(page_address(page));
> >> +               else
> >> +                       gop->dest.u.gmfn = (unsigned long)page_address(page);
> > page_address doesn't return any sort of frame number, does it? This is
> > rather confusing...
> 
> Yes. I only use dest.u.gmfn element to save the page_address here for 
> future memcpy, and it does not mean to use frame number actually. To 
> avoid confusion, here I can use
> 
> gop->dest.u.gmfn = virt_to_mfn(page_address(page));
> 
> and then call mfn_to_virt when doing memcpy.

It seems a bit odd to be using the gop structure in this way when you
aren't actually doing a grant op on it. 

While investigating I noticed:
+static int
+grant_memory_copy_op(unsigned int cmd, void *vuop, unsigned int count,
+                    struct xen_netbk *netbk, bool tx_pool)
...
+       struct gnttab_copy *uop = vuop;

Why void *vuop? Why not struct gnttab_copy * in the parameter?

I also noticed your new grant_memory_copy_op() seems to have unbatched
the grant ops in the non-persistent case, which is going to suck for
performance in non-persistent mode. You need to pull the conditional and
the HYPERVISOR_grant_table_op outside the loop and pass it full array
instead of doing them one at a time.

Ian


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:28:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:28:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZIDP-0002dm-26; Fri, 16 Nov 2012 09:27:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZIDN-0002dY-6i
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 09:27:57 +0000
Received: from [85.158.139.211:34249] by server-12.bemta-5.messagelabs.com id
	0C/D9-02886-C1706A05; Fri, 16 Nov 2012 09:27:56 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353058075!20355775!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26818 invoked from network); 16 Nov 2012 09:27:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 09:27:55 -0000
X-IronPort-AV: E=Sophos;i="4.83,263,1352073600"; d="scan'208";a="15843988"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 09:27:55 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 09:27:55 +0000
Message-ID: <1353058074.3499.166.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: ANNIE LI <annie.li@oracle.com>
Date: Fri, 16 Nov 2012 09:27:54 +0000
In-Reply-To: <50A5A285.1030805@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963066-570-1-git-send-email-annie.li@oracle.com>
	<1352970612.3499.43.camel@zakaz.uk.xensource.com>
	<50A5A285.1030805@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent
 grant with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 02:18 +0000, ANNIE LI wrote:
> In this patch,
> The maximum of memory overhead is about
> 
> (XEN_NETIF_TX_RING_SIZE+XEN_NETIF_RX_RING_SIZE)*PAGE_SIZE  (plus size of grant_ref_t and handle)
> which is about 512 PAGE_SIZE. Normally, without heavy network offload, this maximum can not be reached.
> 
> In next patch of splitting tx/rx pool, the maximum is about

"about" or just "is"?

>  (256+512)PAGE_SIZE.

IOW 3MB.

> >
> >> +
> >> +       return NULL;
> >> +}
> >> +
> >> @@ -1338,7 +1497,11 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
> >>                  gop->source.domid = vif->domid;
> >>                  gop->source.offset = txreq.offset;
> >>
> >> -               gop->dest.u.gmfn = virt_to_mfn(page_address(page));
> >> +               if (!vif->persistent_grant)
> >> +                       gop->dest.u.gmfn = virt_to_mfn(page_address(page));
> >> +               else
> >> +                       gop->dest.u.gmfn = (unsigned long)page_address(page);
> > page_address doesn't return any sort of frame number, does it? This is
> > rather confusing...
> 
> Yes. I only use dest.u.gmfn element to save the page_address here for 
> future memcpy, and it does not mean to use frame number actually. To 
> avoid confusion, here I can use
> 
> gop->dest.u.gmfn = virt_to_mfn(page_address(page));
> 
> and then call mfn_to_virt when doing memcpy.

It seems a bit odd to be using the gop structure in this way when you
aren't actually doing a grant op on it. 

While investigating I noticed:
+static int
+grant_memory_copy_op(unsigned int cmd, void *vuop, unsigned int count,
+                    struct xen_netbk *netbk, bool tx_pool)
...
+       struct gnttab_copy *uop = vuop;

Why void *vuop? Why not struct gnttab_copy * in the parameter?

I also noticed your new grant_memory_copy_op() seems to have unbatched
the grant ops in the non-persistent case, which is going to suck for
performance in non-persistent mode. You need to pull the conditional and
the HYPERVISOR_grant_table_op outside the loop and pass it full array
instead of doing them one at a time.

Ian


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:33:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:33:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZII3-0002z4-Oe; Fri, 16 Nov 2012 09:32:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZII2-0002yv-Nb
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 09:32:46 +0000
Received: from [85.158.143.99:37006] by server-1.bemta-4.messagelabs.com id
	21/AD-27934-E3806A05; Fri, 16 Nov 2012 09:32:46 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1353058365!24865369!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6346 invoked from network); 16 Nov 2012 09:32:45 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 09:32:45 -0000
X-IronPort-AV: E=Sophos;i="4.83,263,1352073600"; d="scan'208";a="15844088"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 09:32:45 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 09:32:44 +0000
Message-ID: <1353058363.3499.171.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: ANNIE LI <annie.li@oracle.com>
Date: Fri, 16 Nov 2012 09:32:43 +0000
In-Reply-To: <50A5A9CF.8030008@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963066-570-1-git-send-email-annie.li@oracle.com>
	<50A4BC7D.6060707@citrix.com> <50A5A9CF.8030008@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent
 grant with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 02:49 +0000, ANNIE LI wrote:
> >
> > Take a look at the following functions from blkback; foreach_grant,
> > add_persistent_gnt and get_persistent_gnt. They are generic functions to
> > deal with persistent grants.
> 
> Ok, thanks.
> Or moving those functions into a separate common file?

Please put them somewhere common.

> > This is highly inefficient, one of the points of using gnttab_set_map_op
> > is that you can queue a bunch of grants, and then map them at the same
> > time using gnttab_map_refs, but here you are using it to map a single
> > grant at a time. You should instead see how much grants you need to map
> > to complete the request and map them all at the same time.
> 
> Yes, it is inefficient here. But this is limited by current netback
> implementation. Current netback is not per-VIF based(not like blkback
> does). After combining persistent grant and non persistent grant
> together, every vif request in the queue may/may not support persistent
> grant. I have to judge whether every vif in the queue supports
> persistent grant or not. If it support, memcpy is used, if not,
> grantcopy is used.

You could (and should) still batch all the grant copies into one
hypercall, e.g. walk the list either doing memcpy or queuing up copyops
as appropriate, then at the end if the queue is non-zero length issue
the hypercall.

I'd expect this lack of batching here and in the other case I just
spotted to have a detrimental affect on guests running with this patch
but not using persistent grants. Did you benchmark that case?

> After making netback per-VIF works, this issue can be fixed.

You've mentioned improvements which are conditional on this work a few
times I think, perhaps it makes sense to make that change first?

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:33:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:33:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZII3-0002z4-Oe; Fri, 16 Nov 2012 09:32:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZII2-0002yv-Nb
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 09:32:46 +0000
Received: from [85.158.143.99:37006] by server-1.bemta-4.messagelabs.com id
	21/AD-27934-E3806A05; Fri, 16 Nov 2012 09:32:46 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1353058365!24865369!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6346 invoked from network); 16 Nov 2012 09:32:45 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 09:32:45 -0000
X-IronPort-AV: E=Sophos;i="4.83,263,1352073600"; d="scan'208";a="15844088"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 09:32:45 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 09:32:44 +0000
Message-ID: <1353058363.3499.171.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: ANNIE LI <annie.li@oracle.com>
Date: Fri, 16 Nov 2012 09:32:43 +0000
In-Reply-To: <50A5A9CF.8030008@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963066-570-1-git-send-email-annie.li@oracle.com>
	<50A4BC7D.6060707@citrix.com> <50A5A9CF.8030008@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent
 grant with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 02:49 +0000, ANNIE LI wrote:
> >
> > Take a look at the following functions from blkback; foreach_grant,
> > add_persistent_gnt and get_persistent_gnt. They are generic functions to
> > deal with persistent grants.
> 
> Ok, thanks.
> Or moving those functions into a separate common file?

Please put them somewhere common.

> > This is highly inefficient, one of the points of using gnttab_set_map_op
> > is that you can queue a bunch of grants, and then map them at the same
> > time using gnttab_map_refs, but here you are using it to map a single
> > grant at a time. You should instead see how much grants you need to map
> > to complete the request and map them all at the same time.
> 
> Yes, it is inefficient here. But this is limited by current netback
> implementation. Current netback is not per-VIF based(not like blkback
> does). After combining persistent grant and non persistent grant
> together, every vif request in the queue may/may not support persistent
> grant. I have to judge whether every vif in the queue supports
> persistent grant or not. If it support, memcpy is used, if not,
> grantcopy is used.

You could (and should) still batch all the grant copies into one
hypercall, e.g. walk the list either doing memcpy or queuing up copyops
as appropriate, then at the end if the queue is non-zero length issue
the hypercall.

I'd expect this lack of batching here and in the other case I just
spotted to have a detrimental affect on guests running with this patch
but not using persistent grants. Did you benchmark that case?

> After making netback per-VIF works, this issue can be fixed.

You've mentioned improvements which are conditional on this work a few
times I think, perhaps it makes sense to make that change first?

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:43:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:43:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZISE-0003DB-Sj; Fri, 16 Nov 2012 09:43:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TZISD-0003D6-KL
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 09:43:17 +0000
Received: from [85.158.143.35:28379] by server-1.bemta-4.messagelabs.com id
	1F/1F-27934-4BA06A05; Fri, 16 Nov 2012 09:43:16 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1353058995!18023303!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY2NTI0\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13190 invoked from network); 16 Nov 2012 09:43:15 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-14.tower-21.messagelabs.com with SMTP;
	16 Nov 2012 09:43:15 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 16 Nov 2012 01:42:36 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,263,1352102400"; d="scan'208";a="220570288"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by orsmga001.jf.intel.com with ESMTP; 16 Nov 2012 01:43:13 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 16 Nov 2012 01:43:12 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Fri, 16 Nov 2012 17:43:05 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, "Zhang, Yang Z" <yang.z.zhang@intel.com>
Thread-Topic: [Xen-devel] iommu=dom0-passthrough behavior
Thread-Index: AQHNwXYJqLF+2AjHBkK5l/uG97/aIZfnbfFggAAyLdWAADp0YP//g6QAgAEdtPCAAFY0AIABvW7Q//+IJ4CAAeMggP//tQ0AABD+vMA=
Date: Fri, 16 Nov 2012 09:43:04 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A48345644033861A2@SHSMSX101.ccr.corp.intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
	<50A2755402000078000A837D@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
	<50A3AD4E02000078000A87BD@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403374F44@SHSMSX101.ccr.corp.intel.com>
	<50A4BE6D02000078000A8B89@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403384F23@SHSMSX101.ccr.corp.intel.com>
	<50A614D402000078000A9240@nat28.tlf.novell.com>
In-Reply-To: <50A614D402000078000A9240@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>, "Zhang,
	Xiantao" <xiantao.zhang@intel.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> So after I implemented a draft patch for this yesterday, my attention now
> was directed to phantom functions permitted by the PCIe spec (of which I
> was entirely unaware so far). While Linux to date doesn't enable them, I can't
> exclude that the BIOS might be (requested respective data to find out). And
> even if it doesn't, adding proper support for that functionality, and then
> putting a quirk on top of that would seem the much cleaner solution (pretty
> likely me_wifi_quirk() could then also be made fit in there).
> 
> Thoughts?
Agree, Xen doesn't have phantom functions supported with VT-d, so it is  better to create a quirk to fix such issues.  
Xiantao

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:43:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:43:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZISE-0003DB-Sj; Fri, 16 Nov 2012 09:43:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TZISD-0003D6-KL
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 09:43:17 +0000
Received: from [85.158.143.35:28379] by server-1.bemta-4.messagelabs.com id
	1F/1F-27934-4BA06A05; Fri, 16 Nov 2012 09:43:16 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1353058995!18023303!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY2NTI0\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13190 invoked from network); 16 Nov 2012 09:43:15 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-14.tower-21.messagelabs.com with SMTP;
	16 Nov 2012 09:43:15 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 16 Nov 2012 01:42:36 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,263,1352102400"; d="scan'208";a="220570288"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by orsmga001.jf.intel.com with ESMTP; 16 Nov 2012 01:43:13 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 16 Nov 2012 01:43:12 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Fri, 16 Nov 2012 17:43:05 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, "Zhang, Yang Z" <yang.z.zhang@intel.com>
Thread-Topic: [Xen-devel] iommu=dom0-passthrough behavior
Thread-Index: AQHNwXYJqLF+2AjHBkK5l/uG97/aIZfnbfFggAAyLdWAADp0YP//g6QAgAEdtPCAAFY0AIABvW7Q//+IJ4CAAeMggP//tQ0AABD+vMA=
Date: Fri, 16 Nov 2012 09:43:04 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A48345644033861A2@SHSMSX101.ccr.corp.intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
	<50A2755402000078000A837D@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
	<50A3AD4E02000078000A87BD@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403374F44@SHSMSX101.ccr.corp.intel.com>
	<50A4BE6D02000078000A8B89@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403384F23@SHSMSX101.ccr.corp.intel.com>
	<50A614D402000078000A9240@nat28.tlf.novell.com>
In-Reply-To: <50A614D402000078000A9240@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>, "Zhang,
	Xiantao" <xiantao.zhang@intel.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> So after I implemented a draft patch for this yesterday, my attention now
> was directed to phantom functions permitted by the PCIe spec (of which I
> was entirely unaware so far). While Linux to date doesn't enable them, I can't
> exclude that the BIOS might be (requested respective data to find out). And
> even if it doesn't, adding proper support for that functionality, and then
> putting a quirk on top of that would seem the much cleaner solution (pretty
> likely me_wifi_quirk() could then also be made fit in there).
> 
> Thoughts?
Agree, Xen doesn't have phantom functions supported with VT-d, so it is  better to create a quirk to fix such issues.  
Xiantao

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:47:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:47:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZIVq-0003PN-H2; Fri, 16 Nov 2012 09:47:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1TZIVo-0003PD-8h
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 09:47:00 +0000
Received: from [85.158.143.99:52123] by server-3.bemta-4.messagelabs.com id
	5B/E2-06841-39B06A05; Fri, 16 Nov 2012 09:46:59 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-8.tower-216.messagelabs.com!1353059218!19234117!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13316 invoked from network); 16 Nov 2012 09:46:58 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-8.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Nov 2012 09:46:58 -0000
Received: from 68-64-ftth.on.nl ([88.159.64.68]:53428 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1TZIYg-0005Gz-2U; Fri, 16 Nov 2012 10:49:58 +0100
Date: Fri, 16 Nov 2012 10:46:52 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <739862954.20121116104652@eikelenboom.it>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
In-Reply-To: <20121114062451.GB24800@localhost.localdomain>
References: <20121110135931.GD23686@localhost.localdomain>
	<1352714084.27833.137.camel@zakaz.uk.xensource.com>
	<20121112142835.GG19860@phenom.dumpdata.com>
	<711956045.20121112155024@eikelenboom.it>
	<20121112163204.GB9575@phenom.dumpdata.com>
	<1945521669.20121112182055@eikelenboom.it>
	<20121114062451.GB24800@localhost.localdomain>
MIME-Version: 1.0
Cc: "annie.li@oracle.com" <annie.li@oracle.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"marcos.matsunaga@oracle.com" <marcos.matsunaga@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] domU to domU networking issues in v3.7?
	(netserver/netperf failing to communicate)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


Wednesday, November 14, 2012, 7:24:53 AM, you wrote:

> On Mon, Nov 12, 2012 at 06:20:55PM +0100, Sander Eikelenboom wrote:
>> 
>> Monday, November 12, 2012, 5:32:04 PM, you wrote:
>> 
>> > On Mon, Nov 12, 2012 at 03:50:24PM +0100, Sander Eikelenboom wrote:
>> >> 
>> >> Monday, November 12, 2012, 3:28:35 PM, you wrote:
>> >> 
>> >> > On Mon, Nov 12, 2012 at 09:54:44AM +0000, Ian Campbell wrote:
>> >> >> On Sat, 2012-11-10 at 13:59 +0000, Konrad Rzeszutek Wilk wrote:
>> >> >> > Hey Ian, Xen-devel mailingl list,
>> >> >> > 
>> >> >> > I think the issue of 70% traffic lost was actually introduced in v3.6 or
>> >> >> > perhaps v3.5. Annie and Marcos (CC-ed here) are looking to see which of
>> >> >> > the releases introduced this. The issue we are seeing is that a domU
>> >> >> > to domU communication breaks - this is with netperf/netserver talking to
>> >> >> > each other.
>> >> >> > 
>> >> >> > Anyhow, I think the 3.7 compound page exacerbated the problem and also
>> >> >> > (at least on some of my test hardware) exposed existing issues with
>> >> >> > drivers. The issue I have is that the 'skge' driver has a bug that has
>> >> >> > been there for ages (I tested way back to 3.0 and still saw it) were it
>> >> >> > can not work with SWIOTLB. It is probably missing an pci_dma_sync
>> >> >> > somewhere. 
>> >> >> > 
>> >> >> > Anyhow the compound page got me to look at Xen-SWIOTLB and that looks
>> >> >> > OK. Even with synthetic driver (the fake one I posted somewhere) it
>> >> >> > dealt with compound pages properly (with debug or non-debug Xen
>> >> >> > hypervisor).
>> >> >> 
>> >> >> The debug build is probably most interesting since it deliberately
>> >> >> allocates a non 1-1 p-to-m mapping so as to catch exactly these sorts of
>> >> >> issues.
>> >> 
>> >> > Right. My test env runs with that. And so far it only has issues
>> >> > with the skge one.
>> >> >> 
>> >> >> > So was wondering if you had looked at this in more details? Any
>> >> >> > ideas? Or would it be more prudent to ask that once we know for sure
>> >> >> > which Linux release introduced the communication failures between
>> >> >> > guests?
>> >> >> 
>> >> >> I've not looked at it any further I'm afraid.
>> >> >> 
>> >> >> If these changes (be they in 3.5 or later, or earlier) are exposing
>> >> >> driver bugs then I suspect the netdev chaps would want to know about it.
>> >> 
>> >> > Right. Annie (CC-ed here) mentioned to me that v3.5 looks to work ok.
>> >> > And is off checking v3.6. v3.7 is definitly a no go.
>> >> >> 
>> >> >> FWIW I see the issue with tg3.
>> >> 
>> >> After the issues with netback where fixed, I'm seeing the issues with net_front reverting the single commit 5640f7685831e088fe6c2e1f863a6805962f8e81 (that was pointed out for netback) also makes these disappear.
>> 
>> > Were you ever able to trigger the BUG_ON in the patch that Ian posted?
>> 
>> What exact patch (or any other patch that can help you ) ?
>> (so i can try again to be sure)

> This one:
> http://lists.xen.org/archives/html/xen-devel/2012-10/msg00893.html


Sorry for the late response!
I have changed the bug_on in a warn_on and applied it to a kernel with and without commit 5640f7685831e088fe6c2e1f863a6805962f8e81 reverted.
- With commit 5640f7685831e088fe6c2e1f863a6805962f8e81 reverted I don't see any warnings (also after loading domU's with a few GB of network traffic)
- With a vanilla kernel and the patch, i can just ssh to a domU to see the warnings, after which SSH locks up. So it happens immediately, even without giving the domU any serious network load.


[   85.447191]  <IRQ>  [<ffffffff8106750a>] warn_slowpath_common+0x7a/0xb0
[   85.447201]  [<ffffffff81067555>] warn_slowpath_null+0x15/0x20
[   85.447207]  [<ffffffff814b2b6e>] xennet_start_xmit+0x7fe/0x860
[   85.447213]  [<ffffffff816a6169>] dev_hard_start_xmit+0x209/0x460
[   85.447220]  [<ffffffff816c1e56>] sch_direct_xmit+0xf6/0x290
[   85.447225]  [<ffffffff816a6566>] dev_queue_xmit+0x1a6/0x5a0
[   85.447231]  [<ffffffff816a63c0>] ? dev_hard_start_xmit+0x460/0x460
[   85.447238]  [<ffffffff816b0897>] neigh_resolve_output+0x127/0x250
[   85.447244]  [<ffffffff817405ad>] ip_finish_output+0x39d/0x530
[   85.447250]  [<ffffffff817402dd>] ? ip_finish_output+0xcd/0x530
[   85.447256]  [<ffffffff81740799>] ip_output+0x59/0xe0
[   85.447262]  [<ffffffff8173f2b8>] ip_local_out+0x28/0x90
[   85.447267]  [<ffffffff8173f86f>] ip_queue_xmit+0x17f/0x4a0
[   85.447273]  [<ffffffff8173f6f0>] ? ip_send_unicast_reply+0x340/0x340
[   85.447282]  [<ffffffff810a1cf7>] ? getnstimeofday+0x47/0xe0
[   85.447288]  [<ffffffff816962c9>] ? __skb_clone+0x29/0x120
[   85.447294]  [<ffffffff81755940>] tcp_transmit_skb+0x400/0x8d0
[   85.447303]  [<ffffffff8113ad55>] ? kmem_cache_free+0x125/0x1c0
[   85.450359]  [<ffffffff8175891a>] tcp_write_xmit+0x21a/0xa50
[   85.450359]  [<ffffffff81698c82>] ? __kfree_skb+0x42/0xa0
[   85.450359]  [<ffffffff817591bd>] __tcp_push_pending_frames+0x2d/0x90
[   85.450359]  [<ffffffff817545c4>] tcp_rcv_established+0x164/0x640
[   85.450359]  [<ffffffff8175cdbf>] ? tcp_v4_rcv+0x6cf/0xb10
[   85.450359]  [<ffffffff8175c3a5>] tcp_v4_do_rcv+0x135/0x480
[   85.450359]  [<ffffffff817d0dc2>] ? _raw_spin_lock_nested+0x42/0x50
[   85.450359]  [<ffffffff8175cdbf>] ? tcp_v4_rcv+0x6cf/0xb10
[   85.450359]  [<ffffffff8175d04d>] tcp_v4_rcv+0x95d/0xb10
[   85.450359]  [<ffffffff810b2158>] ? lock_acquire+0xd8/0x100
[   85.450359]  [<ffffffff81739895>] ? ip_local_deliver_finish+0x45/0x230
[   85.450359]  [<ffffffff8173996a>] ip_local_deliver_finish+0x11a/0x230
[   85.450359]  [<ffffffff81739895>] ? ip_local_deliver_finish+0x45/0x230
[   85.450359]  [<ffffffff81739ab8>] ip_local_deliver+0x38/0x80
[   85.450359]  [<ffffffff8173907a>] ip_rcv_finish+0x15a/0x630
[   85.450359]  [<ffffffff81739768>] ip_rcv+0x218/0x300
[   85.450359]  [<ffffffff816a1a9d>] __netif_receive_skb+0x65d/0x8d0
[   85.450359]  [<ffffffff816a1585>] ? __netif_receive_skb+0x145/0x8d0
[   85.450359]  [<ffffffff810ae3fd>] ? trace_hardirqs_on+0xd/0x10
[   85.450359]  [<ffffffff810faf83>] ? free_hot_cold_page+0x1b3/0x1e0
[   85.450359]  [<ffffffff816a4008>] netif_receive_skb+0x28/0xf0
[   85.450359]  [<ffffffff81699b13>] ? __pskb_pull_tail+0x253/0x340
[   85.450359]  [<ffffffff814b3795>] xennet_poll+0xad5/0xe10
[   85.450359]  [<ffffffff816a4db6>] net_rx_action+0x136/0x260
[   85.450359]  [<ffffffff8106f3a1>] ? __do_softirq+0x71/0x1a0
[   85.450359]  [<ffffffff8106f3f9>] __do_softirq+0xc9/0x1a0
[   85.450359]  [<ffffffff817d393c>] call_softirq+0x1c/0x30
[   85.450359]  [<ffffffff8100fd95>] do_softirq+0x85/0xf0
[   85.450359]  [<ffffffff8106f26e>] irq_exit+0x9e/0xd0
[   85.450359]  [<ffffffff8134659f>] xen_evtchn_do_upcall+0x2f/0x40
[   85.450359]  [<ffffffff817d399e>] xen_do_hypervisor_callback+0x1e/0x30
[   85.450359]  <EOI>  [<ffffffff8100122a>] ? xen_hypercall_xen_version+0xa/0x20
[   85.450359]  [<ffffffff8100122a>] ? xen_hypercall_xen_version+0xa/0x20
[   85.450359]  [<ffffffff8100880d>] ? xen_force_evtchn_callback+0xd/0x10
[   85.450359]  [<ffffffff810091b2>] ? check_events+0x12/0x20
[   85.450359]  [<ffffffff8100919f>] ? xen_restore_fl_direct_reloc+0x4/0x4
[   85.450359]  [<ffffffff810adfc0>] ? lockdep_trace_alloc+0xa0/0x130
[   85.450359]  [<ffffffff810fc9ad>] ? __alloc_pages_nodemask+0x8d/0x9a0
[   85.450359]  [<ffffffff810b2158>] ? lock_acquire+0xd8/0x100
[   85.450359]  [<ffffffff810b25e7>] ? lock_release+0x117/0x250
[   85.450359]  [<ffffffff812a332e>] ? check_blkcg_changed+0x8e/0x180
[   85.450359]  [<ffffffff812a32a0>] ? cfq_put_queue+0x220/0x220
[   85.450359]  [<ffffffff810b2158>] ? lock_acquire+0xd8/0x100
[   85.450359]  [<ffffffff81132f21>] ? alloc_pages_vma+0xc1/0x1d0
[   85.450359]  [<ffffffff8110752a>] ? shmem_alloc_page+0x5a/0x70
[   85.450359]  [<ffffffff810b25e7>] ? lock_release+0x117/0x250
[   85.450359]  [<ffffffff810f40fd>] ? find_get_page+0xad/0x100
[   85.450359]  [<ffffffff810f4050>] ? find_get_pages+0x190/0x190
[   85.450359]  [<ffffffff810b171b>] ? __lock_acquire+0x46b/0xdd0
[   85.450359]  [<ffffffff810f43d1>] ? find_lock_page+0x21/0x80
[   85.450359]  [<ffffffff81107c3f>] ? shmem_getpage_gfp+0x33f/0x720
[   85.450359]  [<ffffffff811080f6>] ? shmem_fault+0x46/0x70
[   85.450359]  [<ffffffff812a2d33>] ? cfq_add_cfqq_rr+0x33/0x100
[   85.450359]  [<ffffffff81269f79>] ? shm_fault+0x19/0x20
[   85.450359]  [<ffffffff81114de7>] ? __do_fault+0x67/0x4f0
[   85.450359]  [<ffffffff8111885d>] ? handle_pte_fault+0xfd/0x820
[   85.450359]  [<ffffffff8100509f>] ? pte_mfn_to_pfn+0x8f/0xf0
[   85.450359]  [<ffffffff81005159>] ? xen_pmd_val+0x9/0x10
[   85.450359]  [<ffffffff81119208>] ? handle_mm_fault+0x288/0x360
[   85.450359]  [<ffffffff8103eafc>] ? __do_page_fault+0x15c/0x510
[   85.450359]  [<ffffffff8128e2f3>] ? blk_finish_plug+0x13/0x50
[   85.450359]  [<ffffffff810ffc99>] ? __do_page_cache_readahead+0x229/0x2b0
[   85.450359]  [<ffffffff810ffb25>] ? __do_page_cache_readahead+0xb5/0x2b0
[   85.450359]  [<ffffffff810ac927>] ? trace_hardirqs_off_caller+0x77/0x150
[   85.450359]  [<ffffffff812b55ad>] ? trace_hardirqs_off_thunk+0x3a/0x3c
[   85.450359]  [<ffffffff8103eeb9>] ? do_page_fault+0x9/0x10
[   85.450359]  [<ffffffff817d20b8>] ? page_fault+0x28/0x30
[   85.450359]  [<ffffffff810f39a6>] ? file_read_actor+0x66/0x190
[   85.450359]  [<ffffffff81100230>] ? page_cache_async_readahead+0x80/0xa0
[   85.450359]  [<ffffffff810f4050>] ? find_get_pages+0x190/0x190
[   85.450359]  [<ffffffff810f6050>] ? generic_file_aio_read+0x2e0/0x6f0
[   85.450359]  [<ffffffff81144c82>] ? do_sync_read+0xa2/0xe0
[   85.450359]  [<ffffffff811459f5>] ? vfs_read+0xc5/0x190
[   85.450359]  [<ffffffff81145bca>] ? sys_read+0x5a/0xa0
[   85.450359]  [<ffffffff812b556e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[   85.450359]  [<ffffffff817d26a9>] ? system_call_fastpath+0x16/0x1b
[   85.450359] ---[ end trace ce03efc8ae5a5e97 ]---
[   85.650129] ------------[ cut here ]------------
[   85.650147] WARNING: at drivers/net/xen-netfront.c:465 xennet_start_xmit+0x7fe/0x860()
[   85.650154] Modules linked in:
[   85.650161] Pid: 0, comm: swapper/0 Tainted: G        W    3.7.0-rc5-20121116-vanilla-warn #1
[   85.650167] Call Trace:
[   85.650171]  <IRQ>  [<ffffffff8106750a>] warn_slowpath_common+0x7a/0xb0
[   85.650183]  [<ffffffff81067555>] warn_slowpath_null+0x15/0x20
[   85.650189]  [<ffffffff814b2b6e>] xennet_start_xmit+0x7fe/0x860
[   85.650196]  [<ffffffff816a6169>] dev_hard_start_xmit+0x209/0x460
[   85.650203]  [<ffffffff816c1e56>] sch_direct_xmit+0xf6/0x290
[   85.650208]  [<ffffffff816a6566>] dev_queue_xmit+0x1a6/0x5a0
[   85.650214]  [<ffffffff816a63c0>] ? dev_hard_start_xmit+0x460/0x460
[   85.650221]  [<ffffffff810b25e7>] ? lock_release+0x117/0x250
[   85.650227]  [<ffffffff81740436>] ip_finish_output+0x226/0x530
[   85.650234]  [<ffffffff817402dd>] ? ip_finish_output+0xcd/0x530
[   85.650240]  [<ffffffff81740799>] ip_output+0x59/0xe0
[   85.650245]  [<ffffffff8173f2b8>] ip_local_out+0x28/0x90
[   85.650251]  [<ffffffff8173f86f>] ip_queue_xmit+0x17f/0x4a0
[   85.650256]  [<ffffffff8173f6f0>] ? ip_send_unicast_reply+0x340/0x340
[   85.650262]  [<ffffffff810a1cf7>] ? getnstimeofday+0x47/0xe0
[   85.650268]  [<ffffffff816962c9>] ? __skb_clone+0x29/0x120
[   85.650274]  [<ffffffff81755940>] tcp_transmit_skb+0x400/0x8d0
[   85.650280]  [<ffffffff81758026>] tcp_retransmit_skb+0x1c6/0x5a0
[   85.650290]  [<ffffffff8175a300>] ? tcp_write_timer_handler+0x1a0/0x1a0
[   85.650296]  [<ffffffff81759e70>] tcp_retransmit_timer+0x370/0x660
[   85.650303]  [<ffffffff8175a29d>] tcp_write_timer_handler+0x13d/0x1a0
[   85.650309]  [<ffffffff8175a378>] tcp_write_timer+0x78/0x80
[   85.650315]  [<ffffffff81074f9c>] call_timer_fn+0x7c/0x100
[   85.650321]  [<ffffffff81074f20>] ? cascade+0xa0/0xa0
[   85.650326]  [<ffffffff8175a300>] ? tcp_write_timer_handler+0x1a0/0x1a0
[   85.650332]  [<ffffffff8175a300>] ? tcp_write_timer_handler+0x1a0/0x1a0
[   85.650338]  [<ffffffff81075237>] run_timer_softirq+0x217/0x250
[   85.650344]  [<ffffffff8106f3f9>] __do_softirq+0xc9/0x1a0
[   85.650350]  [<ffffffff817d393c>] call_softirq+0x1c/0x30
[   85.650356]  [<ffffffff8100fd95>] do_softirq+0x85/0xf0
[   85.650362]  [<ffffffff8106f26e>] irq_exit+0x9e/0xd0
[   85.650369]  [<ffffffff8134659f>] xen_evtchn_do_upcall+0x2f/0x40
[   85.650374]  [<ffffffff817d399e>] xen_do_hypervisor_callback+0x1e/0x30
[   85.650379]  <EOI>  [<ffffffff810013aa>] ? xen_hypercall_sched_op+0xa/0x20
[   85.650389]  [<ffffffff810013aa>] ? xen_hypercall_sched_op+0xa/0x20
[   85.650396]  [<ffffffff81008850>] ? xen_safe_halt+0x10/0x20
[   85.650402]  [<ffffffff810170f0>] ? default_idle+0x40/0x90
[   85.650408]  [<ffffffff810174a6>] ? cpu_idle+0x96/0xf0
[   85.650415]  [<ffffffff817a9c8c>] ? rest_init+0xbc/0xd0
[   85.650420]  [<ffffffff817a9bd0>] ? csum_partial_copy_generic+0x170/0x170
[   85.650428]  [<ffffffff81ce4be7>] ? start_kernel+0x390/0x39d
[   85.650433]  [<ffffffff81ce4677>] ? repair_env_string+0x5b/0x5b
[   85.650440]  [<ffffffff81ce4356>] ? x86_64_start_reservations+0x131/0x136
[   85.650446]  [<ffffffff81ce7915>] ? xen_start_kernel+0x54e/0x550
[   85.650451] ---[ end trace ce03efc8ae5a5e98 ]---
[   85.806018] ------------[ cut here ]------------
[   85.806044] WARNING: at drivers/net/xen-netfront.c:465 xennet_start_xmit+0x7fe/0x860()
[   85.806051] Modules linked in:
[   85.806058] Pid: 2019, comm: postgres Tainted: G        W    3.7.0-rc5-20121116-vanilla-warn #1
[   85.806065] Call Trace:
[   85.806073]  [<ffffffff8106750a>] warn_slowpath_common+0x7a/0xb0
[   85.806080]  [<ffffffff81067555>] warn_slowpath_null+0x15/0x20
[   85.806086]  [<ffffffff814b2b6e>] xennet_start_xmit+0x7fe/0x860
[   85.806103]  [<ffffffff816a6169>] dev_hard_start_xmit+0x209/0x460
[   85.806109]  [<ffffffff816c1e56>] sch_direct_xmit+0xf6/0x290
[   85.806114]  [<ffffffff816a6566>] dev_queue_xmit+0x1a6/0x5a0
[   85.806119]  [<ffffffff816a63c0>] ? dev_hard_start_xmit+0x460/0x460
[   85.806125]  [<ffffffff810abab5>] ? trace_softirqs_off+0x85/0x1b0
[   85.806132]  [<ffffffff81740436>] ip_finish_output+0x226/0x530
[   85.806138]  [<ffffffff817402dd>] ? ip_finish_output+0xcd/0x530
[   85.806143]  [<ffffffff81740799>] ip_output+0x59/0xe0
[   85.806148]  [<ffffffff8173f2b8>] ip_local_out+0x28/0x90
[   85.806153]  [<ffffffff8173f86f>] ip_queue_xmit+0x17f/0x4a0
[   85.806157]  [<ffffffff8173f6f0>] ? ip_send_unicast_reply+0x340/0x340
[   85.806163]  [<ffffffff810a1cf7>] ? getnstimeofday+0x47/0xe0
[   85.806168]  [<ffffffff816962c9>] ? __skb_clone+0x29/0x120
[   85.806174]  [<ffffffff81755940>] tcp_transmit_skb+0x400/0x8d0
[   85.806179]  [<ffffffff8175891a>] tcp_write_xmit+0x21a/0xa50
[   85.806184]  [<ffffffff8175917b>] tcp_push_one+0x2b/0x40
[   85.806190]  [<ffffffff81749cdc>] tcp_sendmsg+0x8dc/0xe20
[   85.806195]  [<ffffffff8176fe09>] inet_sendmsg+0xa9/0x100
[   85.806200]  [<ffffffff8176fd60>] ? inet_autobind+0x70/0x70
[   85.806206]  [<ffffffff8168dd12>] sock_sendmsg+0x82/0xb0
[   85.806211]  [<ffffffff8168ddb5>] ? sockfd_lookup_light+0x25/0x80
[   85.806216]  [<ffffffff8168e5e4>] sys_sendto+0x104/0x140
[   85.806223]  [<ffffffff817d26a9>] system_call_fastpath+0x16/0x1b
[   85.806227] ---[ end trace ce03efc8ae5a5e99 ]---
[   85.806855] ------------[ cut here ]------------
[   85.806871] WARNING: at drivers/net/xen-netfront.c:465 xennet_start_xmit+0x7fe/0x860()
[   85.806879] Modules linked in:
[   85.806884] Pid: 2019, comm: postgres Tainted: G        W    3.7.0-rc5-20121116-vanilla-warn #1
[   85.806891] Call Trace:
[   85.806898]  [<ffffffff8106750a>] warn_slowpath_common+0x7a/0xb0
[   85.806905]  [<ffffffff81067555>] warn_slowpath_null+0x15/0x20
[   85.806911]  [<ffffffff814b2b6e>] xennet_start_xmit+0x7fe/0x860
[   85.806917]  [<ffffffff816a6169>] dev_hard_start_xmit+0x209/0x460
[   85.806923]  [<ffffffff816c1e56>] sch_direct_xmit+0xf6/0x290
[   85.806929]  [<ffffffff816a6566>] dev_queue_xmit+0x1a6/0x5a0
[   85.806935]  [<ffffffff816a63c0>] ? dev_hard_start_xmit+0x460/0x460
[   85.806941]  [<ffffffff810b25e7>] ? lock_release+0x117/0x250
[   85.806947]  [<ffffffff81740436>] ip_finish_output+0x226/0x530
[   85.806953]  [<ffffffff817402dd>] ? ip_finish_output+0xcd/0x530
[   85.806959]  [<ffffffff81740799>] ip_output+0x59/0xe0
[   85.806964]  [<ffffffff8173f2b8>] ip_local_out+0x28/0x90
[   85.806970]  [<ffffffff8173f86f>] ip_queue_xmit+0x17f/0x4a0
[   85.806975]  [<ffffffff8173f6f0>] ? ip_send_unicast_reply+0x340/0x340
[   85.806982]  [<ffffffff810a1cf7>] ? getnstimeofday+0x47/0xe0
[   85.806987]  [<ffffffff816962c9>] ? __skb_clone+0x29/0x120
[   85.806993]  [<ffffffff81755940>] tcp_transmit_skb+0x400/0x8d0
[   85.806999]  [<ffffffff81758026>] tcp_retransmit_skb+0x1c6/0x5a0
[   85.807005]  [<ffffffff81094806>] ? finish_task_switch+0x46/0xe0
[   85.807011]  [<ffffffff8175859e>] tcp_xmit_retransmit_queue+0x19e/0x300
[   85.807018]  [<ffffffff8175070b>] tcp_fastretrans_alert+0x76b/0xcb0
[   85.807024]  [<ffffffff817515fc>] tcp_ack+0x9ac/0x1150
[   85.807030]  [<ffffffff81752663>] ? tcp_validate_incoming+0x2d3/0x350
[   85.807036]  [<ffffffff81754778>] tcp_rcv_established+0x318/0x640
[   85.807042]  [<ffffffff8106f776>] ? local_bh_enable+0xc6/0x160
[   85.807048]  [<ffffffff8175c3a5>] tcp_v4_do_rcv+0x135/0x480
[   85.807054]  [<ffffffff8106f08f>] ? __local_bh_disable+0x8f/0xe0
[   85.807061]  [<ffffffff817483db>] tcp_prequeue_process+0x6b/0xa0
[   85.807067]  [<ffffffff81748e40>] tcp_recvmsg+0x8f0/0xb70
[   85.807072]  [<ffffffff810b25e7>] ? lock_release+0x117/0x250
[   85.807078]  [<ffffffff8176ec2a>] inet_recvmsg+0xba/0x100
[   85.807084]  [<ffffffff8176fd60>] ? inet_autobind+0x70/0x70
[   85.807090]  [<ffffffff8168dbf9>] sock_recvmsg+0x89/0xc0
[   85.807096]  [<ffffffff81116b0f>] ? tlb_flush_mmu+0x5f/0xa0
[   85.807102]  [<ffffffff810b171b>] ? __lock_acquire+0x46b/0xdd0
[   85.807108]  [<ffffffff8168ddb5>] ? sockfd_lookup_light+0x25/0x80
[   85.807114]  [<ffffffff8168e45f>] sys_recvfrom+0xbf/0x120
[   85.807120]  [<ffffffff811144db>] ? might_fault+0x3b/0x90
[   85.807126]  [<ffffffff810b25e7>] ? lock_release+0x117/0x250
[   85.807133]  [<ffffffff817d26a9>] system_call_fastpath+0x16/0x1b
[   85.807138] ---[ end trace ce03efc8ae5a5e9a ]---
[   85.807159] ------------[ cut here ]------------
[   85.807165] WARNING: at drivers/net/xen-netfront.c:465 xennet_start_xmit+0x7fe/0x860()
[   85.807171] Modules linked in:
[   85.807176] Pid: 2019, comm: postgres Tainted: G        W    3.7.0-rc5-20121116-vanilla-warn #1
[   85.807182] Call Trace:
[   85.807187]  [<ffffffff8106750a>] warn_slowpath_common+0x7a/0xb0
[   85.807193]  [<ffffffff81067555>] warn_slowpath_null+0x15/0x20
[   85.807199]  [<ffffffff814b2b6e>] xennet_start_xmit+0x7fe/0x860
[   85.807205]  [<ffffffff816a6169>] dev_hard_start_xmit+0x209/0x460
[   85.807211]  [<ffffffff816c1e56>] sch_direct_xmit+0xf6/0x290
[   85.807216]  [<ffffffff816a6566>] dev_queue_xmit+0x1a6/0x5a0
[   85.807222]  [<ffffffff816a63c0>] ? dev_hard_start_xmit+0x460/0x460
[   85.807228]  [<ffffffff810b25e7>] ? lock_release+0x117/0x250
[   85.807233]  [<ffffffff81740436>] ip_finish_output+0x226/0x530
[   85.807239]  [<ffffffff817402dd>] ? ip_finish_output+0xcd/0x530
[   85.807245]  [<ffffffff81740799>] ip_output+0x59/0xe0
[   85.807250]  [<ffffffff8173f2b8>] ip_local_out+0x28/0x90
[   85.807256]  [<ffffffff8173f86f>] ip_queue_xmit+0x17f/0x4a0
[   85.807261]  [<ffffffff8173f6f0>] ? ip_send_unicast_reply+0x340/0x340
[   85.807267]  [<ffffffff810a1cf7>] ? getnstimeofday+0x47/0xe0
[   85.807272]  [<ffffffff816962c9>] ? __skb_clone+0x29/0x120
[   85.807278]  [<ffffffff81755940>] tcp_transmit_skb+0x400/0x8d0
[   85.807283]  [<ffffffff81758026>] tcp_retransmit_skb+0x1c6/0x5a0
[   85.810124]  [<ffffffff81094806>] ? finish_task_switch+0x46/0xe0
[   85.810124]  [<ffffffff8175859e>] tcp_xmit_retransmit_queue+0x19e/0x300
[   85.810124]  [<ffffffff8175070b>] tcp_fastretrans_alert+0x76b/0xcb0
[   85.810124]  [<ffffffff817515fc>] tcp_ack+0x9ac/0x1150
[   85.810124]  [<ffffffff81752663>] ? tcp_validate_incoming+0x2d3/0x350
[   85.810124]  [<ffffffff81754778>] tcp_rcv_established+0x318/0x640
[   85.810124]  [<ffffffff8106f776>] ? local_bh_enable+0xc6/0x160
[   85.810124]  [<ffffffff8175c3a5>] tcp_v4_do_rcv+0x135/0x480
[   85.810124]  [<ffffffff8106f08f>] ? __local_bh_disable+0x8f/0xe0
[   85.810124]  [<ffffffff817483db>] tcp_prequeue_process+0x6b/0xa0
[   85.810124]  [<ffffffff81748e40>] tcp_recvmsg+0x8f0/0xb70
[   85.810124]  [<ffffffff810b25e7>] ? lock_release+0x117/0x250
[   85.810124]  [<ffffffff8176ec2a>] inet_recvmsg+0xba/0x100
[   85.810124]  [<ffffffff8176fd60>] ? inet_autobind+0x70/0x70
[   85.810124]  [<ffffffff8168dbf9>] sock_recvmsg+0x89/0xc0
[   85.810124]  [<ffffffff81116b0f>] ? tlb_flush_mmu+0x5f/0xa0
[   85.8


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:47:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:47:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZIVq-0003PN-H2; Fri, 16 Nov 2012 09:47:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1TZIVo-0003PD-8h
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 09:47:00 +0000
Received: from [85.158.143.99:52123] by server-3.bemta-4.messagelabs.com id
	5B/E2-06841-39B06A05; Fri, 16 Nov 2012 09:46:59 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-8.tower-216.messagelabs.com!1353059218!19234117!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13316 invoked from network); 16 Nov 2012 09:46:58 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-8.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Nov 2012 09:46:58 -0000
Received: from 68-64-ftth.on.nl ([88.159.64.68]:53428 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1TZIYg-0005Gz-2U; Fri, 16 Nov 2012 10:49:58 +0100
Date: Fri, 16 Nov 2012 10:46:52 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <739862954.20121116104652@eikelenboom.it>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
In-Reply-To: <20121114062451.GB24800@localhost.localdomain>
References: <20121110135931.GD23686@localhost.localdomain>
	<1352714084.27833.137.camel@zakaz.uk.xensource.com>
	<20121112142835.GG19860@phenom.dumpdata.com>
	<711956045.20121112155024@eikelenboom.it>
	<20121112163204.GB9575@phenom.dumpdata.com>
	<1945521669.20121112182055@eikelenboom.it>
	<20121114062451.GB24800@localhost.localdomain>
MIME-Version: 1.0
Cc: "annie.li@oracle.com" <annie.li@oracle.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"marcos.matsunaga@oracle.com" <marcos.matsunaga@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] domU to domU networking issues in v3.7?
	(netserver/netperf failing to communicate)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


Wednesday, November 14, 2012, 7:24:53 AM, you wrote:

> On Mon, Nov 12, 2012 at 06:20:55PM +0100, Sander Eikelenboom wrote:
>> 
>> Monday, November 12, 2012, 5:32:04 PM, you wrote:
>> 
>> > On Mon, Nov 12, 2012 at 03:50:24PM +0100, Sander Eikelenboom wrote:
>> >> 
>> >> Monday, November 12, 2012, 3:28:35 PM, you wrote:
>> >> 
>> >> > On Mon, Nov 12, 2012 at 09:54:44AM +0000, Ian Campbell wrote:
>> >> >> On Sat, 2012-11-10 at 13:59 +0000, Konrad Rzeszutek Wilk wrote:
>> >> >> > Hey Ian, Xen-devel mailingl list,
>> >> >> > 
>> >> >> > I think the issue of 70% traffic lost was actually introduced in v3.6 or
>> >> >> > perhaps v3.5. Annie and Marcos (CC-ed here) are looking to see which of
>> >> >> > the releases introduced this. The issue we are seeing is that a domU
>> >> >> > to domU communication breaks - this is with netperf/netserver talking to
>> >> >> > each other.
>> >> >> > 
>> >> >> > Anyhow, I think the 3.7 compound page exacerbated the problem and also
>> >> >> > (at least on some of my test hardware) exposed existing issues with
>> >> >> > drivers. The issue I have is that the 'skge' driver has a bug that has
>> >> >> > been there for ages (I tested way back to 3.0 and still saw it) were it
>> >> >> > can not work with SWIOTLB. It is probably missing an pci_dma_sync
>> >> >> > somewhere. 
>> >> >> > 
>> >> >> > Anyhow the compound page got me to look at Xen-SWIOTLB and that looks
>> >> >> > OK. Even with synthetic driver (the fake one I posted somewhere) it
>> >> >> > dealt with compound pages properly (with debug or non-debug Xen
>> >> >> > hypervisor).
>> >> >> 
>> >> >> The debug build is probably most interesting since it deliberately
>> >> >> allocates a non 1-1 p-to-m mapping so as to catch exactly these sorts of
>> >> >> issues.
>> >> 
>> >> > Right. My test env runs with that. And so far it only has issues
>> >> > with the skge one.
>> >> >> 
>> >> >> > So was wondering if you had looked at this in more details? Any
>> >> >> > ideas? Or would it be more prudent to ask that once we know for sure
>> >> >> > which Linux release introduced the communication failures between
>> >> >> > guests?
>> >> >> 
>> >> >> I've not looked at it any further I'm afraid.
>> >> >> 
>> >> >> If these changes (be they in 3.5 or later, or earlier) are exposing
>> >> >> driver bugs then I suspect the netdev chaps would want to know about it.
>> >> 
>> >> > Right. Annie (CC-ed here) mentioned to me that v3.5 looks to work ok.
>> >> > And is off checking v3.6. v3.7 is definitly a no go.
>> >> >> 
>> >> >> FWIW I see the issue with tg3.
>> >> 
>> >> After the issues with netback where fixed, I'm seeing the issues with net_front reverting the single commit 5640f7685831e088fe6c2e1f863a6805962f8e81 (that was pointed out for netback) also makes these disappear.
>> 
>> > Were you ever able to trigger the BUG_ON in the patch that Ian posted?
>> 
>> What exact patch (or any other patch that can help you ) ?
>> (so i can try again to be sure)

> This one:
> http://lists.xen.org/archives/html/xen-devel/2012-10/msg00893.html


Sorry for the late response!
I have changed the bug_on in a warn_on and applied it to a kernel with and without commit 5640f7685831e088fe6c2e1f863a6805962f8e81 reverted.
- With commit 5640f7685831e088fe6c2e1f863a6805962f8e81 reverted I don't see any warnings (also after loading domU's with a few GB of network traffic)
- With a vanilla kernel and the patch, i can just ssh to a domU to see the warnings, after which SSH locks up. So it happens immediately, even without giving the domU any serious network load.


[   85.447191]  <IRQ>  [<ffffffff8106750a>] warn_slowpath_common+0x7a/0xb0
[   85.447201]  [<ffffffff81067555>] warn_slowpath_null+0x15/0x20
[   85.447207]  [<ffffffff814b2b6e>] xennet_start_xmit+0x7fe/0x860
[   85.447213]  [<ffffffff816a6169>] dev_hard_start_xmit+0x209/0x460
[   85.447220]  [<ffffffff816c1e56>] sch_direct_xmit+0xf6/0x290
[   85.447225]  [<ffffffff816a6566>] dev_queue_xmit+0x1a6/0x5a0
[   85.447231]  [<ffffffff816a63c0>] ? dev_hard_start_xmit+0x460/0x460
[   85.447238]  [<ffffffff816b0897>] neigh_resolve_output+0x127/0x250
[   85.447244]  [<ffffffff817405ad>] ip_finish_output+0x39d/0x530
[   85.447250]  [<ffffffff817402dd>] ? ip_finish_output+0xcd/0x530
[   85.447256]  [<ffffffff81740799>] ip_output+0x59/0xe0
[   85.447262]  [<ffffffff8173f2b8>] ip_local_out+0x28/0x90
[   85.447267]  [<ffffffff8173f86f>] ip_queue_xmit+0x17f/0x4a0
[   85.447273]  [<ffffffff8173f6f0>] ? ip_send_unicast_reply+0x340/0x340
[   85.447282]  [<ffffffff810a1cf7>] ? getnstimeofday+0x47/0xe0
[   85.447288]  [<ffffffff816962c9>] ? __skb_clone+0x29/0x120
[   85.447294]  [<ffffffff81755940>] tcp_transmit_skb+0x400/0x8d0
[   85.447303]  [<ffffffff8113ad55>] ? kmem_cache_free+0x125/0x1c0
[   85.450359]  [<ffffffff8175891a>] tcp_write_xmit+0x21a/0xa50
[   85.450359]  [<ffffffff81698c82>] ? __kfree_skb+0x42/0xa0
[   85.450359]  [<ffffffff817591bd>] __tcp_push_pending_frames+0x2d/0x90
[   85.450359]  [<ffffffff817545c4>] tcp_rcv_established+0x164/0x640
[   85.450359]  [<ffffffff8175cdbf>] ? tcp_v4_rcv+0x6cf/0xb10
[   85.450359]  [<ffffffff8175c3a5>] tcp_v4_do_rcv+0x135/0x480
[   85.450359]  [<ffffffff817d0dc2>] ? _raw_spin_lock_nested+0x42/0x50
[   85.450359]  [<ffffffff8175cdbf>] ? tcp_v4_rcv+0x6cf/0xb10
[   85.450359]  [<ffffffff8175d04d>] tcp_v4_rcv+0x95d/0xb10
[   85.450359]  [<ffffffff810b2158>] ? lock_acquire+0xd8/0x100
[   85.450359]  [<ffffffff81739895>] ? ip_local_deliver_finish+0x45/0x230
[   85.450359]  [<ffffffff8173996a>] ip_local_deliver_finish+0x11a/0x230
[   85.450359]  [<ffffffff81739895>] ? ip_local_deliver_finish+0x45/0x230
[   85.450359]  [<ffffffff81739ab8>] ip_local_deliver+0x38/0x80
[   85.450359]  [<ffffffff8173907a>] ip_rcv_finish+0x15a/0x630
[   85.450359]  [<ffffffff81739768>] ip_rcv+0x218/0x300
[   85.450359]  [<ffffffff816a1a9d>] __netif_receive_skb+0x65d/0x8d0
[   85.450359]  [<ffffffff816a1585>] ? __netif_receive_skb+0x145/0x8d0
[   85.450359]  [<ffffffff810ae3fd>] ? trace_hardirqs_on+0xd/0x10
[   85.450359]  [<ffffffff810faf83>] ? free_hot_cold_page+0x1b3/0x1e0
[   85.450359]  [<ffffffff816a4008>] netif_receive_skb+0x28/0xf0
[   85.450359]  [<ffffffff81699b13>] ? __pskb_pull_tail+0x253/0x340
[   85.450359]  [<ffffffff814b3795>] xennet_poll+0xad5/0xe10
[   85.450359]  [<ffffffff816a4db6>] net_rx_action+0x136/0x260
[   85.450359]  [<ffffffff8106f3a1>] ? __do_softirq+0x71/0x1a0
[   85.450359]  [<ffffffff8106f3f9>] __do_softirq+0xc9/0x1a0
[   85.450359]  [<ffffffff817d393c>] call_softirq+0x1c/0x30
[   85.450359]  [<ffffffff8100fd95>] do_softirq+0x85/0xf0
[   85.450359]  [<ffffffff8106f26e>] irq_exit+0x9e/0xd0
[   85.450359]  [<ffffffff8134659f>] xen_evtchn_do_upcall+0x2f/0x40
[   85.450359]  [<ffffffff817d399e>] xen_do_hypervisor_callback+0x1e/0x30
[   85.450359]  <EOI>  [<ffffffff8100122a>] ? xen_hypercall_xen_version+0xa/0x20
[   85.450359]  [<ffffffff8100122a>] ? xen_hypercall_xen_version+0xa/0x20
[   85.450359]  [<ffffffff8100880d>] ? xen_force_evtchn_callback+0xd/0x10
[   85.450359]  [<ffffffff810091b2>] ? check_events+0x12/0x20
[   85.450359]  [<ffffffff8100919f>] ? xen_restore_fl_direct_reloc+0x4/0x4
[   85.450359]  [<ffffffff810adfc0>] ? lockdep_trace_alloc+0xa0/0x130
[   85.450359]  [<ffffffff810fc9ad>] ? __alloc_pages_nodemask+0x8d/0x9a0
[   85.450359]  [<ffffffff810b2158>] ? lock_acquire+0xd8/0x100
[   85.450359]  [<ffffffff810b25e7>] ? lock_release+0x117/0x250
[   85.450359]  [<ffffffff812a332e>] ? check_blkcg_changed+0x8e/0x180
[   85.450359]  [<ffffffff812a32a0>] ? cfq_put_queue+0x220/0x220
[   85.450359]  [<ffffffff810b2158>] ? lock_acquire+0xd8/0x100
[   85.450359]  [<ffffffff81132f21>] ? alloc_pages_vma+0xc1/0x1d0
[   85.450359]  [<ffffffff8110752a>] ? shmem_alloc_page+0x5a/0x70
[   85.450359]  [<ffffffff810b25e7>] ? lock_release+0x117/0x250
[   85.450359]  [<ffffffff810f40fd>] ? find_get_page+0xad/0x100
[   85.450359]  [<ffffffff810f4050>] ? find_get_pages+0x190/0x190
[   85.450359]  [<ffffffff810b171b>] ? __lock_acquire+0x46b/0xdd0
[   85.450359]  [<ffffffff810f43d1>] ? find_lock_page+0x21/0x80
[   85.450359]  [<ffffffff81107c3f>] ? shmem_getpage_gfp+0x33f/0x720
[   85.450359]  [<ffffffff811080f6>] ? shmem_fault+0x46/0x70
[   85.450359]  [<ffffffff812a2d33>] ? cfq_add_cfqq_rr+0x33/0x100
[   85.450359]  [<ffffffff81269f79>] ? shm_fault+0x19/0x20
[   85.450359]  [<ffffffff81114de7>] ? __do_fault+0x67/0x4f0
[   85.450359]  [<ffffffff8111885d>] ? handle_pte_fault+0xfd/0x820
[   85.450359]  [<ffffffff8100509f>] ? pte_mfn_to_pfn+0x8f/0xf0
[   85.450359]  [<ffffffff81005159>] ? xen_pmd_val+0x9/0x10
[   85.450359]  [<ffffffff81119208>] ? handle_mm_fault+0x288/0x360
[   85.450359]  [<ffffffff8103eafc>] ? __do_page_fault+0x15c/0x510
[   85.450359]  [<ffffffff8128e2f3>] ? blk_finish_plug+0x13/0x50
[   85.450359]  [<ffffffff810ffc99>] ? __do_page_cache_readahead+0x229/0x2b0
[   85.450359]  [<ffffffff810ffb25>] ? __do_page_cache_readahead+0xb5/0x2b0
[   85.450359]  [<ffffffff810ac927>] ? trace_hardirqs_off_caller+0x77/0x150
[   85.450359]  [<ffffffff812b55ad>] ? trace_hardirqs_off_thunk+0x3a/0x3c
[   85.450359]  [<ffffffff8103eeb9>] ? do_page_fault+0x9/0x10
[   85.450359]  [<ffffffff817d20b8>] ? page_fault+0x28/0x30
[   85.450359]  [<ffffffff810f39a6>] ? file_read_actor+0x66/0x190
[   85.450359]  [<ffffffff81100230>] ? page_cache_async_readahead+0x80/0xa0
[   85.450359]  [<ffffffff810f4050>] ? find_get_pages+0x190/0x190
[   85.450359]  [<ffffffff810f6050>] ? generic_file_aio_read+0x2e0/0x6f0
[   85.450359]  [<ffffffff81144c82>] ? do_sync_read+0xa2/0xe0
[   85.450359]  [<ffffffff811459f5>] ? vfs_read+0xc5/0x190
[   85.450359]  [<ffffffff81145bca>] ? sys_read+0x5a/0xa0
[   85.450359]  [<ffffffff812b556e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[   85.450359]  [<ffffffff817d26a9>] ? system_call_fastpath+0x16/0x1b
[   85.450359] ---[ end trace ce03efc8ae5a5e97 ]---
[   85.650129] ------------[ cut here ]------------
[   85.650147] WARNING: at drivers/net/xen-netfront.c:465 xennet_start_xmit+0x7fe/0x860()
[   85.650154] Modules linked in:
[   85.650161] Pid: 0, comm: swapper/0 Tainted: G        W    3.7.0-rc5-20121116-vanilla-warn #1
[   85.650167] Call Trace:
[   85.650171]  <IRQ>  [<ffffffff8106750a>] warn_slowpath_common+0x7a/0xb0
[   85.650183]  [<ffffffff81067555>] warn_slowpath_null+0x15/0x20
[   85.650189]  [<ffffffff814b2b6e>] xennet_start_xmit+0x7fe/0x860
[   85.650196]  [<ffffffff816a6169>] dev_hard_start_xmit+0x209/0x460
[   85.650203]  [<ffffffff816c1e56>] sch_direct_xmit+0xf6/0x290
[   85.650208]  [<ffffffff816a6566>] dev_queue_xmit+0x1a6/0x5a0
[   85.650214]  [<ffffffff816a63c0>] ? dev_hard_start_xmit+0x460/0x460
[   85.650221]  [<ffffffff810b25e7>] ? lock_release+0x117/0x250
[   85.650227]  [<ffffffff81740436>] ip_finish_output+0x226/0x530
[   85.650234]  [<ffffffff817402dd>] ? ip_finish_output+0xcd/0x530
[   85.650240]  [<ffffffff81740799>] ip_output+0x59/0xe0
[   85.650245]  [<ffffffff8173f2b8>] ip_local_out+0x28/0x90
[   85.650251]  [<ffffffff8173f86f>] ip_queue_xmit+0x17f/0x4a0
[   85.650256]  [<ffffffff8173f6f0>] ? ip_send_unicast_reply+0x340/0x340
[   85.650262]  [<ffffffff810a1cf7>] ? getnstimeofday+0x47/0xe0
[   85.650268]  [<ffffffff816962c9>] ? __skb_clone+0x29/0x120
[   85.650274]  [<ffffffff81755940>] tcp_transmit_skb+0x400/0x8d0
[   85.650280]  [<ffffffff81758026>] tcp_retransmit_skb+0x1c6/0x5a0
[   85.650290]  [<ffffffff8175a300>] ? tcp_write_timer_handler+0x1a0/0x1a0
[   85.650296]  [<ffffffff81759e70>] tcp_retransmit_timer+0x370/0x660
[   85.650303]  [<ffffffff8175a29d>] tcp_write_timer_handler+0x13d/0x1a0
[   85.650309]  [<ffffffff8175a378>] tcp_write_timer+0x78/0x80
[   85.650315]  [<ffffffff81074f9c>] call_timer_fn+0x7c/0x100
[   85.650321]  [<ffffffff81074f20>] ? cascade+0xa0/0xa0
[   85.650326]  [<ffffffff8175a300>] ? tcp_write_timer_handler+0x1a0/0x1a0
[   85.650332]  [<ffffffff8175a300>] ? tcp_write_timer_handler+0x1a0/0x1a0
[   85.650338]  [<ffffffff81075237>] run_timer_softirq+0x217/0x250
[   85.650344]  [<ffffffff8106f3f9>] __do_softirq+0xc9/0x1a0
[   85.650350]  [<ffffffff817d393c>] call_softirq+0x1c/0x30
[   85.650356]  [<ffffffff8100fd95>] do_softirq+0x85/0xf0
[   85.650362]  [<ffffffff8106f26e>] irq_exit+0x9e/0xd0
[   85.650369]  [<ffffffff8134659f>] xen_evtchn_do_upcall+0x2f/0x40
[   85.650374]  [<ffffffff817d399e>] xen_do_hypervisor_callback+0x1e/0x30
[   85.650379]  <EOI>  [<ffffffff810013aa>] ? xen_hypercall_sched_op+0xa/0x20
[   85.650389]  [<ffffffff810013aa>] ? xen_hypercall_sched_op+0xa/0x20
[   85.650396]  [<ffffffff81008850>] ? xen_safe_halt+0x10/0x20
[   85.650402]  [<ffffffff810170f0>] ? default_idle+0x40/0x90
[   85.650408]  [<ffffffff810174a6>] ? cpu_idle+0x96/0xf0
[   85.650415]  [<ffffffff817a9c8c>] ? rest_init+0xbc/0xd0
[   85.650420]  [<ffffffff817a9bd0>] ? csum_partial_copy_generic+0x170/0x170
[   85.650428]  [<ffffffff81ce4be7>] ? start_kernel+0x390/0x39d
[   85.650433]  [<ffffffff81ce4677>] ? repair_env_string+0x5b/0x5b
[   85.650440]  [<ffffffff81ce4356>] ? x86_64_start_reservations+0x131/0x136
[   85.650446]  [<ffffffff81ce7915>] ? xen_start_kernel+0x54e/0x550
[   85.650451] ---[ end trace ce03efc8ae5a5e98 ]---
[   85.806018] ------------[ cut here ]------------
[   85.806044] WARNING: at drivers/net/xen-netfront.c:465 xennet_start_xmit+0x7fe/0x860()
[   85.806051] Modules linked in:
[   85.806058] Pid: 2019, comm: postgres Tainted: G        W    3.7.0-rc5-20121116-vanilla-warn #1
[   85.806065] Call Trace:
[   85.806073]  [<ffffffff8106750a>] warn_slowpath_common+0x7a/0xb0
[   85.806080]  [<ffffffff81067555>] warn_slowpath_null+0x15/0x20
[   85.806086]  [<ffffffff814b2b6e>] xennet_start_xmit+0x7fe/0x860
[   85.806103]  [<ffffffff816a6169>] dev_hard_start_xmit+0x209/0x460
[   85.806109]  [<ffffffff816c1e56>] sch_direct_xmit+0xf6/0x290
[   85.806114]  [<ffffffff816a6566>] dev_queue_xmit+0x1a6/0x5a0
[   85.806119]  [<ffffffff816a63c0>] ? dev_hard_start_xmit+0x460/0x460
[   85.806125]  [<ffffffff810abab5>] ? trace_softirqs_off+0x85/0x1b0
[   85.806132]  [<ffffffff81740436>] ip_finish_output+0x226/0x530
[   85.806138]  [<ffffffff817402dd>] ? ip_finish_output+0xcd/0x530
[   85.806143]  [<ffffffff81740799>] ip_output+0x59/0xe0
[   85.806148]  [<ffffffff8173f2b8>] ip_local_out+0x28/0x90
[   85.806153]  [<ffffffff8173f86f>] ip_queue_xmit+0x17f/0x4a0
[   85.806157]  [<ffffffff8173f6f0>] ? ip_send_unicast_reply+0x340/0x340
[   85.806163]  [<ffffffff810a1cf7>] ? getnstimeofday+0x47/0xe0
[   85.806168]  [<ffffffff816962c9>] ? __skb_clone+0x29/0x120
[   85.806174]  [<ffffffff81755940>] tcp_transmit_skb+0x400/0x8d0
[   85.806179]  [<ffffffff8175891a>] tcp_write_xmit+0x21a/0xa50
[   85.806184]  [<ffffffff8175917b>] tcp_push_one+0x2b/0x40
[   85.806190]  [<ffffffff81749cdc>] tcp_sendmsg+0x8dc/0xe20
[   85.806195]  [<ffffffff8176fe09>] inet_sendmsg+0xa9/0x100
[   85.806200]  [<ffffffff8176fd60>] ? inet_autobind+0x70/0x70
[   85.806206]  [<ffffffff8168dd12>] sock_sendmsg+0x82/0xb0
[   85.806211]  [<ffffffff8168ddb5>] ? sockfd_lookup_light+0x25/0x80
[   85.806216]  [<ffffffff8168e5e4>] sys_sendto+0x104/0x140
[   85.806223]  [<ffffffff817d26a9>] system_call_fastpath+0x16/0x1b
[   85.806227] ---[ end trace ce03efc8ae5a5e99 ]---
[   85.806855] ------------[ cut here ]------------
[   85.806871] WARNING: at drivers/net/xen-netfront.c:465 xennet_start_xmit+0x7fe/0x860()
[   85.806879] Modules linked in:
[   85.806884] Pid: 2019, comm: postgres Tainted: G        W    3.7.0-rc5-20121116-vanilla-warn #1
[   85.806891] Call Trace:
[   85.806898]  [<ffffffff8106750a>] warn_slowpath_common+0x7a/0xb0
[   85.806905]  [<ffffffff81067555>] warn_slowpath_null+0x15/0x20
[   85.806911]  [<ffffffff814b2b6e>] xennet_start_xmit+0x7fe/0x860
[   85.806917]  [<ffffffff816a6169>] dev_hard_start_xmit+0x209/0x460
[   85.806923]  [<ffffffff816c1e56>] sch_direct_xmit+0xf6/0x290
[   85.806929]  [<ffffffff816a6566>] dev_queue_xmit+0x1a6/0x5a0
[   85.806935]  [<ffffffff816a63c0>] ? dev_hard_start_xmit+0x460/0x460
[   85.806941]  [<ffffffff810b25e7>] ? lock_release+0x117/0x250
[   85.806947]  [<ffffffff81740436>] ip_finish_output+0x226/0x530
[   85.806953]  [<ffffffff817402dd>] ? ip_finish_output+0xcd/0x530
[   85.806959]  [<ffffffff81740799>] ip_output+0x59/0xe0
[   85.806964]  [<ffffffff8173f2b8>] ip_local_out+0x28/0x90
[   85.806970]  [<ffffffff8173f86f>] ip_queue_xmit+0x17f/0x4a0
[   85.806975]  [<ffffffff8173f6f0>] ? ip_send_unicast_reply+0x340/0x340
[   85.806982]  [<ffffffff810a1cf7>] ? getnstimeofday+0x47/0xe0
[   85.806987]  [<ffffffff816962c9>] ? __skb_clone+0x29/0x120
[   85.806993]  [<ffffffff81755940>] tcp_transmit_skb+0x400/0x8d0
[   85.806999]  [<ffffffff81758026>] tcp_retransmit_skb+0x1c6/0x5a0
[   85.807005]  [<ffffffff81094806>] ? finish_task_switch+0x46/0xe0
[   85.807011]  [<ffffffff8175859e>] tcp_xmit_retransmit_queue+0x19e/0x300
[   85.807018]  [<ffffffff8175070b>] tcp_fastretrans_alert+0x76b/0xcb0
[   85.807024]  [<ffffffff817515fc>] tcp_ack+0x9ac/0x1150
[   85.807030]  [<ffffffff81752663>] ? tcp_validate_incoming+0x2d3/0x350
[   85.807036]  [<ffffffff81754778>] tcp_rcv_established+0x318/0x640
[   85.807042]  [<ffffffff8106f776>] ? local_bh_enable+0xc6/0x160
[   85.807048]  [<ffffffff8175c3a5>] tcp_v4_do_rcv+0x135/0x480
[   85.807054]  [<ffffffff8106f08f>] ? __local_bh_disable+0x8f/0xe0
[   85.807061]  [<ffffffff817483db>] tcp_prequeue_process+0x6b/0xa0
[   85.807067]  [<ffffffff81748e40>] tcp_recvmsg+0x8f0/0xb70
[   85.807072]  [<ffffffff810b25e7>] ? lock_release+0x117/0x250
[   85.807078]  [<ffffffff8176ec2a>] inet_recvmsg+0xba/0x100
[   85.807084]  [<ffffffff8176fd60>] ? inet_autobind+0x70/0x70
[   85.807090]  [<ffffffff8168dbf9>] sock_recvmsg+0x89/0xc0
[   85.807096]  [<ffffffff81116b0f>] ? tlb_flush_mmu+0x5f/0xa0
[   85.807102]  [<ffffffff810b171b>] ? __lock_acquire+0x46b/0xdd0
[   85.807108]  [<ffffffff8168ddb5>] ? sockfd_lookup_light+0x25/0x80
[   85.807114]  [<ffffffff8168e45f>] sys_recvfrom+0xbf/0x120
[   85.807120]  [<ffffffff811144db>] ? might_fault+0x3b/0x90
[   85.807126]  [<ffffffff810b25e7>] ? lock_release+0x117/0x250
[   85.807133]  [<ffffffff817d26a9>] system_call_fastpath+0x16/0x1b
[   85.807138] ---[ end trace ce03efc8ae5a5e9a ]---
[   85.807159] ------------[ cut here ]------------
[   85.807165] WARNING: at drivers/net/xen-netfront.c:465 xennet_start_xmit+0x7fe/0x860()
[   85.807171] Modules linked in:
[   85.807176] Pid: 2019, comm: postgres Tainted: G        W    3.7.0-rc5-20121116-vanilla-warn #1
[   85.807182] Call Trace:
[   85.807187]  [<ffffffff8106750a>] warn_slowpath_common+0x7a/0xb0
[   85.807193]  [<ffffffff81067555>] warn_slowpath_null+0x15/0x20
[   85.807199]  [<ffffffff814b2b6e>] xennet_start_xmit+0x7fe/0x860
[   85.807205]  [<ffffffff816a6169>] dev_hard_start_xmit+0x209/0x460
[   85.807211]  [<ffffffff816c1e56>] sch_direct_xmit+0xf6/0x290
[   85.807216]  [<ffffffff816a6566>] dev_queue_xmit+0x1a6/0x5a0
[   85.807222]  [<ffffffff816a63c0>] ? dev_hard_start_xmit+0x460/0x460
[   85.807228]  [<ffffffff810b25e7>] ? lock_release+0x117/0x250
[   85.807233]  [<ffffffff81740436>] ip_finish_output+0x226/0x530
[   85.807239]  [<ffffffff817402dd>] ? ip_finish_output+0xcd/0x530
[   85.807245]  [<ffffffff81740799>] ip_output+0x59/0xe0
[   85.807250]  [<ffffffff8173f2b8>] ip_local_out+0x28/0x90
[   85.807256]  [<ffffffff8173f86f>] ip_queue_xmit+0x17f/0x4a0
[   85.807261]  [<ffffffff8173f6f0>] ? ip_send_unicast_reply+0x340/0x340
[   85.807267]  [<ffffffff810a1cf7>] ? getnstimeofday+0x47/0xe0
[   85.807272]  [<ffffffff816962c9>] ? __skb_clone+0x29/0x120
[   85.807278]  [<ffffffff81755940>] tcp_transmit_skb+0x400/0x8d0
[   85.807283]  [<ffffffff81758026>] tcp_retransmit_skb+0x1c6/0x5a0
[   85.810124]  [<ffffffff81094806>] ? finish_task_switch+0x46/0xe0
[   85.810124]  [<ffffffff8175859e>] tcp_xmit_retransmit_queue+0x19e/0x300
[   85.810124]  [<ffffffff8175070b>] tcp_fastretrans_alert+0x76b/0xcb0
[   85.810124]  [<ffffffff817515fc>] tcp_ack+0x9ac/0x1150
[   85.810124]  [<ffffffff81752663>] ? tcp_validate_incoming+0x2d3/0x350
[   85.810124]  [<ffffffff81754778>] tcp_rcv_established+0x318/0x640
[   85.810124]  [<ffffffff8106f776>] ? local_bh_enable+0xc6/0x160
[   85.810124]  [<ffffffff8175c3a5>] tcp_v4_do_rcv+0x135/0x480
[   85.810124]  [<ffffffff8106f08f>] ? __local_bh_disable+0x8f/0xe0
[   85.810124]  [<ffffffff817483db>] tcp_prequeue_process+0x6b/0xa0
[   85.810124]  [<ffffffff81748e40>] tcp_recvmsg+0x8f0/0xb70
[   85.810124]  [<ffffffff810b25e7>] ? lock_release+0x117/0x250
[   85.810124]  [<ffffffff8176ec2a>] inet_recvmsg+0xba/0x100
[   85.810124]  [<ffffffff8176fd60>] ? inet_autobind+0x70/0x70
[   85.810124]  [<ffffffff8168dbf9>] sock_recvmsg+0x89/0xc0
[   85.810124]  [<ffffffff81116b0f>] ? tlb_flush_mmu+0x5f/0xa0
[   85.8


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:55:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:55:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZIdO-0003jS-KX; Fri, 16 Nov 2012 09:54:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZIdN-0003jN-3m
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 09:54:49 +0000
Received: from [85.158.143.35:23323] by server-2.bemta-4.messagelabs.com id
	9D/E8-28922-86D06A05; Fri, 16 Nov 2012 09:54:48 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1353059632!14196933!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1503 invoked from network); 16 Nov 2012 09:53:52 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-21.messagelabs.com with SMTP;
	16 Nov 2012 09:53:52 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 09:53:52 +0000
Message-Id: <50A61B3F02000078000A9272@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 09:53:51 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>,
	"Yang Z Zhang" <yang.z.zhang@intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
	<50A2755402000078000A837D@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
	<50A3AD4E02000078000A87BD@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403374F44@SHSMSX101.ccr.corp.intel.com>
	<50A4BE6D02000078000A8B89@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403384F23@SHSMSX101.ccr.corp.intel.com>
	<50A614D402000078000A9240@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033861A2@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A48345644033861A2@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 10:43, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
>>  So after I implemented a draft patch for this yesterday, my attention now
>> was directed to phantom functions permitted by the PCIe spec (of which I
>> was entirely unaware so far). While Linux to date doesn't enable them, I 
> can't
>> exclude that the BIOS might be (requested respective data to find out). And
>> even if it doesn't, adding proper support for that functionality, and then
>> putting a quirk on top of that would seem the much cleaner solution (pretty
>> likely me_wifi_quirk() could then also be made fit in there).
>> 
>> Thoughts?
> Agree, Xen doesn't have phantom functions supported with VT-d, so it is  
> better to create a quirk to fix such issues.  

Sorry, no, we should add phantom function support (and not
only to VT-d, but to the generic IOMMU code), and use that (if
necessary, i.e. if the device in question doesn't have phantom
functions turned on) to base a workaround on.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:55:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:55:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZIdO-0003jS-KX; Fri, 16 Nov 2012 09:54:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZIdN-0003jN-3m
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 09:54:49 +0000
Received: from [85.158.143.35:23323] by server-2.bemta-4.messagelabs.com id
	9D/E8-28922-86D06A05; Fri, 16 Nov 2012 09:54:48 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1353059632!14196933!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1503 invoked from network); 16 Nov 2012 09:53:52 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-21.messagelabs.com with SMTP;
	16 Nov 2012 09:53:52 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 09:53:52 +0000
Message-Id: <50A61B3F02000078000A9272@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 09:53:51 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>,
	"Yang Z Zhang" <yang.z.zhang@intel.com>
References: <5097DB9102000078000A65C7@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B0A42@SHSMSX101.ccr.corp.intel.com>
	<50A20DE302000078000A7F6B@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403370DFE@SHSMSX101.ccr.corp.intel.com>
	<50A223DE02000078000A7FE6@nat28.tlf.novell.com>
	<A9667DDFB95DB7438FA9D7D576C3D87E2B15EE@SHSMSX101.ccr.corp.intel.com>
	<50A23C0C02000078000A8085@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033714CD@SHSMSX101.ccr.corp.intel.com>
	<50A2755402000078000A837D@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403371EA4@SHSMSX101.ccr.corp.intel.com>
	<50A3AD4E02000078000A87BD@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403374F44@SHSMSX101.ccr.corp.intel.com>
	<50A4BE6D02000078000A8B89@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403384F23@SHSMSX101.ccr.corp.intel.com>
	<50A614D402000078000A9240@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033861A2@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A48345644033861A2@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "wei.huang2@amd.com" <wei.huang2@amd.com>,
	"weiwang.dd@gmail.com" <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] iommu=dom0-passthrough behavior
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 10:43, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
>>  So after I implemented a draft patch for this yesterday, my attention now
>> was directed to phantom functions permitted by the PCIe spec (of which I
>> was entirely unaware so far). While Linux to date doesn't enable them, I 
> can't
>> exclude that the BIOS might be (requested respective data to find out). And
>> even if it doesn't, adding proper support for that functionality, and then
>> putting a quirk on top of that would seem the much cleaner solution (pretty
>> likely me_wifi_quirk() could then also be made fit in there).
>> 
>> Thoughts?
> Agree, Xen doesn't have phantom functions supported with VT-d, so it is  
> better to create a quirk to fix such issues.  

Sorry, no, we should add phantom function support (and not
only to VT-d, but to the generic IOMMU code), and use that (if
necessary, i.e. if the device in question doesn't have phantom
functions turned on) to base a workaround on.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:56:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:56:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZIeQ-0003nP-31; Fri, 16 Nov 2012 09:55:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZIeO-0003nD-4V
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 09:55:52 +0000
Received: from [85.158.138.51:39679] by server-10.bemta-3.messagelabs.com id
	88/F8-19806-7AD06A05; Fri, 16 Nov 2012 09:55:51 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1353059748!30257015!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2ODgwNw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21530 invoked from network); 16 Nov 2012 09:55:49 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 09:55:49 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAG9tiwI001803
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 09:55:45 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAG9tiU4007145
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 09:55:44 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAG9thBT032101; Fri, 16 Nov 2012 03:55:43 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 01:55:43 -0800
Message-ID: <50A60D9D.80601@oracle.com>
Date: Fri, 16 Nov 2012 17:55:41 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963066-570-1-git-send-email-annie.li@oracle.com>
	<1352970612.3499.43.camel@zakaz.uk.xensource.com>
	<50A5A285.1030805@oracle.com>
	<1353058074.3499.166.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353058074.3499.166.camel@zakaz.uk.xensource.com>
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent
 grant with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-16 17:27, Ian Campbell wrote:
> On Fri, 2012-11-16 at 02:18 +0000, ANNIE LI wrote:
>> In this patch,
>> The maximum of memory overhead is about
>>
>> (XEN_NETIF_TX_RING_SIZE+XEN_NETIF_RX_RING_SIZE)*PAGE_SIZE  (plus size of grant_ref_t and handle)
>> which is about 512 PAGE_SIZE. Normally, without heavy network offload, this maximum can not be reached.
>>
>> In next patch of splitting tx/rx pool, the maximum is about
> "about" or just "is"?

For only grant pages, it is this value. I took into account other 
element of grant_ref_t and map(change to handle in future)....

>
>>   (256+512)PAGE_SIZE.
> IOW 3MB.
>
>>>> +
>>>> +       return NULL;
>>>> +}
>>>> +
>>>> @@ -1338,7 +1497,11 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
>>>>                   gop->source.domid = vif->domid;
>>>>                   gop->source.offset = txreq.offset;
>>>>
>>>> -               gop->dest.u.gmfn = virt_to_mfn(page_address(page));
>>>> +               if (!vif->persistent_grant)
>>>> +                       gop->dest.u.gmfn = virt_to_mfn(page_address(page));
>>>> +               else
>>>> +                       gop->dest.u.gmfn = (unsigned long)page_address(page);
>>> page_address doesn't return any sort of frame number, does it? This is
>>> rather confusing...
>> Yes. I only use dest.u.gmfn element to save the page_address here for
>> future memcpy, and it does not mean to use frame number actually. To
>> avoid confusion, here I can use
>>
>> gop->dest.u.gmfn = virt_to_mfn(page_address(page));
>>
>> and then call mfn_to_virt when doing memcpy.
> It seems a bit odd to be using the gop structure in this way when you
> aren't actually doing a grant op on it.
>
> While investigating I noticed:
> +static int
> +grant_memory_copy_op(unsigned int cmd, void *vuop, unsigned int count,
> +                    struct xen_netbk *netbk, bool tx_pool)
> ...
> +       struct gnttab_copy *uop = vuop;
>
> Why void *vuop? Why not struct gnttab_copy * in the parameter?

Sorry, my mistake.

>
> I also noticed your new grant_memory_copy_op() seems to have unbatched
> the grant ops in the non-persistent case, which is going to suck for
> performance in non-persistent mode. You need to pull the conditional and
> the HYPERVISOR_grant_table_op outside the loop and pass it full array
> instead of doing them one at a time.

This still connects with netback per-VIF implementation.
Currently, these could not be pulled out outside since netback queue may 
contains persistent and nonpersistent in the same queue. I did consider 
to implement per-VIF first and then the persistent grant,
but thinking of it is part of wei's patch combined with other patches, 
and finally decided to implement per-VIF later.

But this does limit implementation of persistent grant.

Thanks
Annie
>
> Ian
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:56:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:56:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZIeQ-0003nP-31; Fri, 16 Nov 2012 09:55:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZIeO-0003nD-4V
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 09:55:52 +0000
Received: from [85.158.138.51:39679] by server-10.bemta-3.messagelabs.com id
	88/F8-19806-7AD06A05; Fri, 16 Nov 2012 09:55:51 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1353059748!30257015!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2ODgwNw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21530 invoked from network); 16 Nov 2012 09:55:49 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 09:55:49 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAG9tiwI001803
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 09:55:45 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAG9tiU4007145
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 09:55:44 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAG9thBT032101; Fri, 16 Nov 2012 03:55:43 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 01:55:43 -0800
Message-ID: <50A60D9D.80601@oracle.com>
Date: Fri, 16 Nov 2012 17:55:41 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963066-570-1-git-send-email-annie.li@oracle.com>
	<1352970612.3499.43.camel@zakaz.uk.xensource.com>
	<50A5A285.1030805@oracle.com>
	<1353058074.3499.166.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353058074.3499.166.camel@zakaz.uk.xensource.com>
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent
 grant with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-16 17:27, Ian Campbell wrote:
> On Fri, 2012-11-16 at 02:18 +0000, ANNIE LI wrote:
>> In this patch,
>> The maximum of memory overhead is about
>>
>> (XEN_NETIF_TX_RING_SIZE+XEN_NETIF_RX_RING_SIZE)*PAGE_SIZE  (plus size of grant_ref_t and handle)
>> which is about 512 PAGE_SIZE. Normally, without heavy network offload, this maximum can not be reached.
>>
>> In next patch of splitting tx/rx pool, the maximum is about
> "about" or just "is"?

For only grant pages, it is this value. I took into account other 
element of grant_ref_t and map(change to handle in future)....

>
>>   (256+512)PAGE_SIZE.
> IOW 3MB.
>
>>>> +
>>>> +       return NULL;
>>>> +}
>>>> +
>>>> @@ -1338,7 +1497,11 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
>>>>                   gop->source.domid = vif->domid;
>>>>                   gop->source.offset = txreq.offset;
>>>>
>>>> -               gop->dest.u.gmfn = virt_to_mfn(page_address(page));
>>>> +               if (!vif->persistent_grant)
>>>> +                       gop->dest.u.gmfn = virt_to_mfn(page_address(page));
>>>> +               else
>>>> +                       gop->dest.u.gmfn = (unsigned long)page_address(page);
>>> page_address doesn't return any sort of frame number, does it? This is
>>> rather confusing...
>> Yes. I only use dest.u.gmfn element to save the page_address here for
>> future memcpy, and it does not mean to use frame number actually. To
>> avoid confusion, here I can use
>>
>> gop->dest.u.gmfn = virt_to_mfn(page_address(page));
>>
>> and then call mfn_to_virt when doing memcpy.
> It seems a bit odd to be using the gop structure in this way when you
> aren't actually doing a grant op on it.
>
> While investigating I noticed:
> +static int
> +grant_memory_copy_op(unsigned int cmd, void *vuop, unsigned int count,
> +                    struct xen_netbk *netbk, bool tx_pool)
> ...
> +       struct gnttab_copy *uop = vuop;
>
> Why void *vuop? Why not struct gnttab_copy * in the parameter?

Sorry, my mistake.

>
> I also noticed your new grant_memory_copy_op() seems to have unbatched
> the grant ops in the non-persistent case, which is going to suck for
> performance in non-persistent mode. You need to pull the conditional and
> the HYPERVISOR_grant_table_op outside the loop and pass it full array
> instead of doing them one at a time.

This still connects with netback per-VIF implementation.
Currently, these could not be pulled out outside since netback queue may 
contains persistent and nonpersistent in the same queue. I did consider 
to implement per-VIF first and then the persistent grant,
but thinking of it is part of wei's patch combined with other patches, 
and finally decided to implement per-VIF later.

But this does limit implementation of persistent grant.

Thanks
Annie
>
> Ian
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:57:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:57:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZIfc-0003tG-IE; Fri, 16 Nov 2012 09:57:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZIfa-0003t2-HC
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 09:57:06 +0000
Received: from [85.158.139.211:10989] by server-3.bemta-5.messagelabs.com id
	24/6E-18736-1FD06A05; Fri, 16 Nov 2012 09:57:05 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353059824!20367402!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22079 invoked from network); 16 Nov 2012 09:57:04 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 09:57:04 -0000
X-IronPort-AV: E=Sophos;i="4.83,263,1352073600"; d="scan'208";a="15844726"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 09:57:02 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 09:57:02 +0000
Message-ID: <1353059821.3499.190.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Annie Li <annie.li@oracle.com>
Date: Fri, 16 Nov 2012 09:57:01 +0000
In-Reply-To: <1352962987-541-1-git-send-email-annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 07:03 +0000, Annie Li wrote:
> This patch implements persistent grants for xen-netfront/netback.

Hang on a sec. It has just occurred to me that netfront/netback in the
current mainline kernels don't currently use grant maps at all, they use
grant copy on both the tx and rx paths.

The supposed benefit of persistent grants is to avoid the TLB shootdowns
on grant unmap, but in the current code there should be exactly zero of
those.

If I understand correctly this patch goes from using grant copy
operations to persistently mapping frames and then using memcpy on those
buffers to copy in/out to local buffers. I'm finding it hard to think of
a reason why this should perform any better, do you have a theory which
explains it? (my best theory is that it has a beneficial impact on where
the cache locality of the data, but netperf doesn't typically actually
access the data so I'm not sure why that would matter)

Also AIUI this is also doing persistent grants for both Tx and Rx
directions?

For guest Rx does this mean it now copies twice, in dom0 from the DMA
buffer to the guest provided buffer and then again in the guest from the
granted buffer to a normal one?

For guest Tx how do you handle the lifecycle of the grant mapped pages
which are being sent up into the dom0 network stack? Or are you also now
copying twice in this case? (i.e. guest copies into a granted buffer and
dom0 copies out into a local buffer?)

Did you do measurement of the Tx and Rx cases independently? Do you know
that they both benefit from this change (rather than for example an
improvement in one direction masking a regression in the other). Were
the numbers you previously posted in one particular direction or did you
measure both?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:57:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:57:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZIfc-0003tG-IE; Fri, 16 Nov 2012 09:57:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZIfa-0003t2-HC
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 09:57:06 +0000
Received: from [85.158.139.211:10989] by server-3.bemta-5.messagelabs.com id
	24/6E-18736-1FD06A05; Fri, 16 Nov 2012 09:57:05 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353059824!20367402!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22079 invoked from network); 16 Nov 2012 09:57:04 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 09:57:04 -0000
X-IronPort-AV: E=Sophos;i="4.83,263,1352073600"; d="scan'208";a="15844726"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 09:57:02 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 09:57:02 +0000
Message-ID: <1353059821.3499.190.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Annie Li <annie.li@oracle.com>
Date: Fri, 16 Nov 2012 09:57:01 +0000
In-Reply-To: <1352962987-541-1-git-send-email-annie.li@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 07:03 +0000, Annie Li wrote:
> This patch implements persistent grants for xen-netfront/netback.

Hang on a sec. It has just occurred to me that netfront/netback in the
current mainline kernels don't currently use grant maps at all, they use
grant copy on both the tx and rx paths.

The supposed benefit of persistent grants is to avoid the TLB shootdowns
on grant unmap, but in the current code there should be exactly zero of
those.

If I understand correctly this patch goes from using grant copy
operations to persistently mapping frames and then using memcpy on those
buffers to copy in/out to local buffers. I'm finding it hard to think of
a reason why this should perform any better, do you have a theory which
explains it? (my best theory is that it has a beneficial impact on where
the cache locality of the data, but netperf doesn't typically actually
access the data so I'm not sure why that would matter)

Also AIUI this is also doing persistent grants for both Tx and Rx
directions?

For guest Rx does this mean it now copies twice, in dom0 from the DMA
buffer to the guest provided buffer and then again in the guest from the
granted buffer to a normal one?

For guest Tx how do you handle the lifecycle of the grant mapped pages
which are being sent up into the dom0 network stack? Or are you also now
copying twice in this case? (i.e. guest copies into a granted buffer and
dom0 copies out into a local buffer?)

Did you do measurement of the Tx and Rx cases independently? Do you know
that they both benefit from this change (rather than for example an
improvement in one direction masking a regression in the other). Were
the numbers you previously posted in one particular direction or did you
measure both?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:59:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:59:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZIiA-00045g-4h; Fri, 16 Nov 2012 09:59:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZIi8-00045S-R8
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 09:59:45 +0000
Received: from [85.158.139.211:49773] by server-14.bemta-5.messagelabs.com id
	76/2D-21768-09E06A05; Fri, 16 Nov 2012 09:59:44 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1353059982!20429683!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23978 invoked from network); 16 Nov 2012 09:59:43 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 09:59:43 -0000
X-IronPort-AV: E=Sophos;i="4.83,263,1352073600"; d="scan'208";a="44822435"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	16 Nov 2012 09:59:41 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 16 Nov 2012 04:59:41 -0500
Message-ID: <50A60E8C.9070608@citrix.com>
Date: Fri, 16 Nov 2012 09:59:40 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>	<50A51DC4.7040205@citrix.com>
	<20121115172514.GG75988@ocelot.phlegethon.org>
	<50A604B102000078000A9224@nat28.tlf.novell.com>
In-Reply-To: <50A604B102000078000A9224@nat28.tlf.novell.com>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 08:17, Jan Beulich wrote:
>>>> On 15.11.12 at 18:25, Tim Deegan <tim@xen.org> wrote:
>> At 16:52 +0000 on 15 Nov (1352998340), Andrew Cooper wrote:
>>> It is also possible to get a reentrant NMI if there is a pagefault (or
>>> handful of other possible faults) when trying to execute the iret of
>>> the NMI itself; NMIs can get re-enabled from the iret of the
>>> pagefault, and we take a new NMI before attempting to retry the iret
>>> from the original NMI.
>> Yes, I hadn't thought of that case.
> But what would make a fault happen on that IRET? Oh, yes,
> there is one case - the guest having its previous instruction end
> exactly at the canonical/non-canonical boundary. But for the
> sake of correctness, that's a #GP then. I would suppose this
> would better be filtered (manually injecting a #GP into the guest)
> than allowed to actually cause a #GP.
Or, if for some reason the address we return to is "not present". Now, 
in the current Xen, Xen itself doesn't get paged out, but in a PV guest, 
I'm pretty certain the guest could decide to page out some code-page, 
which just happens to be the one we were about to return to?

--
Mats
>
> Jan
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 09:59:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 09:59:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZIiA-00045g-4h; Fri, 16 Nov 2012 09:59:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZIi8-00045S-R8
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 09:59:45 +0000
Received: from [85.158.139.211:49773] by server-14.bemta-5.messagelabs.com id
	76/2D-21768-09E06A05; Fri, 16 Nov 2012 09:59:44 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1353059982!20429683!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23978 invoked from network); 16 Nov 2012 09:59:43 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 09:59:43 -0000
X-IronPort-AV: E=Sophos;i="4.83,263,1352073600"; d="scan'208";a="44822435"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	16 Nov 2012 09:59:41 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 16 Nov 2012 04:59:41 -0500
Message-ID: <50A60E8C.9070608@citrix.com>
Date: Fri, 16 Nov 2012 09:59:40 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>	<50A51DC4.7040205@citrix.com>
	<20121115172514.GG75988@ocelot.phlegethon.org>
	<50A604B102000078000A9224@nat28.tlf.novell.com>
In-Reply-To: <50A604B102000078000A9224@nat28.tlf.novell.com>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 08:17, Jan Beulich wrote:
>>>> On 15.11.12 at 18:25, Tim Deegan <tim@xen.org> wrote:
>> At 16:52 +0000 on 15 Nov (1352998340), Andrew Cooper wrote:
>>> It is also possible to get a reentrant NMI if there is a pagefault (or
>>> handful of other possible faults) when trying to execute the iret of
>>> the NMI itself; NMIs can get re-enabled from the iret of the
>>> pagefault, and we take a new NMI before attempting to retry the iret
>>> from the original NMI.
>> Yes, I hadn't thought of that case.
> But what would make a fault happen on that IRET? Oh, yes,
> there is one case - the guest having its previous instruction end
> exactly at the canonical/non-canonical boundary. But for the
> sake of correctness, that's a #GP then. I would suppose this
> would better be filtered (manually injecting a #GP into the guest)
> than allowed to actually cause a #GP.
Or, if for some reason the address we return to is "not present". Now, 
in the current Xen, Xen itself doesn't get paged out, but in a PV guest, 
I'm pretty certain the guest could decide to page out some code-page, 
which just happens to be the one we were about to return to?

--
Mats
>
> Jan
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 10:18:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 10:18:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJ0I-0004cb-Tq; Fri, 16 Nov 2012 10:18:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TZJ0G-0004cW-Ue
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 10:18:29 +0000
Received: from [85.158.138.51:14421] by server-14.bemta-3.messagelabs.com id
	5C/60-12788-4F216A05; Fri, 16 Nov 2012 10:18:28 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1353061107!22190080!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28236 invoked from network); 16 Nov 2012 10:18:27 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-3.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 10:18:27 -0000
Received: by mail-wg0-f51.google.com with SMTP id ed3so981040wgb.32
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 02:18:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=NlcguWVYA75MkrxO0PFg3JruD6zooNnExtkJTrpMYqQ=;
	b=C4jW/II5YTwAeGMyxhdGPwE1997ewheK6ttB2rw07XD/vLl+Q7QcBJGQhJhBVG7nuk
	d5bb0z3He0DbBKrvpcdS/ZuwQeIIwDpwOm9MHQIJDFM9t+PBJpEghA3u9Q+4zGLyN+9y
	33H61stit2qrefdG7F3VsV1X2G2E9o3tbGITUFTWDMr3TNdv2nRIWdCGI8yyShNy3gPA
	1pl9ghotD1QeaaBHLMZ9GaAgqYPNTjPY9NXmnTYbT3qOLVm1nJSlI6zvNJFBTxzeOfaQ
	a/jJoJk/OBlTpd5Uo6vGPT0QayAHbBO/gxGjSYOq/9yHJVJSF6eImTfM/qEG3+FvSV/Q
	i8XA==
Received: by 10.216.210.16 with SMTP id t16mr1681410weo.175.1353061107252;
	Fri, 16 Nov 2012 02:18:27 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id hv4sm125108wib.0.2012.11.16.02.18.25
	(version=SSLv3 cipher=OTHER); Fri, 16 Nov 2012 02:18:26 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Fri, 16 Nov 2012 10:18:22 +0000
From: Keir Fraser <keir@xen.org>
To: Mats Petersson <mats.petersson@citrix.com>,
	<xen-devel@lists.xen.org>
Message-ID: <CCCBC36E.5256B%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
	real NMI's instead of self_nmi() in VMEXIT handler
Thread-Index: Ac3D47Sv7KN2kY7s4Umglc/lAeT6XQ==
In-Reply-To: <50A60E8C.9070608@citrix.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/2012 09:59, "Mats Petersson" <mats.petersson@citrix.com> wrote:

>>> Yes, I hadn't thought of that case.
>> But what would make a fault happen on that IRET? Oh, yes,
>> there is one case - the guest having its previous instruction end
>> exactly at the canonical/non-canonical boundary. But for the
>> sake of correctness, that's a #GP then. I would suppose this
>> would better be filtered (manually injecting a #GP into the guest)
>> than allowed to actually cause a #GP.
> Or, if for some reason the address we return to is "not present". Now,
> in the current Xen, Xen itself doesn't get paged out, but in a PV guest,
> I'm pretty certain the guest could decide to page out some code-page,
> which just happens to be the one we were about to return to?

That fault would occur in the context being returned to, with rIP == the
IRET return target.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 10:18:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 10:18:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJ0I-0004cb-Tq; Fri, 16 Nov 2012 10:18:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TZJ0G-0004cW-Ue
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 10:18:29 +0000
Received: from [85.158.138.51:14421] by server-14.bemta-3.messagelabs.com id
	5C/60-12788-4F216A05; Fri, 16 Nov 2012 10:18:28 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1353061107!22190080!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28236 invoked from network); 16 Nov 2012 10:18:27 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-3.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 10:18:27 -0000
Received: by mail-wg0-f51.google.com with SMTP id ed3so981040wgb.32
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 02:18:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=NlcguWVYA75MkrxO0PFg3JruD6zooNnExtkJTrpMYqQ=;
	b=C4jW/II5YTwAeGMyxhdGPwE1997ewheK6ttB2rw07XD/vLl+Q7QcBJGQhJhBVG7nuk
	d5bb0z3He0DbBKrvpcdS/ZuwQeIIwDpwOm9MHQIJDFM9t+PBJpEghA3u9Q+4zGLyN+9y
	33H61stit2qrefdG7F3VsV1X2G2E9o3tbGITUFTWDMr3TNdv2nRIWdCGI8yyShNy3gPA
	1pl9ghotD1QeaaBHLMZ9GaAgqYPNTjPY9NXmnTYbT3qOLVm1nJSlI6zvNJFBTxzeOfaQ
	a/jJoJk/OBlTpd5Uo6vGPT0QayAHbBO/gxGjSYOq/9yHJVJSF6eImTfM/qEG3+FvSV/Q
	i8XA==
Received: by 10.216.210.16 with SMTP id t16mr1681410weo.175.1353061107252;
	Fri, 16 Nov 2012 02:18:27 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id hv4sm125108wib.0.2012.11.16.02.18.25
	(version=SSLv3 cipher=OTHER); Fri, 16 Nov 2012 02:18:26 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Fri, 16 Nov 2012 10:18:22 +0000
From: Keir Fraser <keir@xen.org>
To: Mats Petersson <mats.petersson@citrix.com>,
	<xen-devel@lists.xen.org>
Message-ID: <CCCBC36E.5256B%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
	real NMI's instead of self_nmi() in VMEXIT handler
Thread-Index: Ac3D47Sv7KN2kY7s4Umglc/lAeT6XQ==
In-Reply-To: <50A60E8C.9070608@citrix.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/2012 09:59, "Mats Petersson" <mats.petersson@citrix.com> wrote:

>>> Yes, I hadn't thought of that case.
>> But what would make a fault happen on that IRET? Oh, yes,
>> there is one case - the guest having its previous instruction end
>> exactly at the canonical/non-canonical boundary. But for the
>> sake of correctness, that's a #GP then. I would suppose this
>> would better be filtered (manually injecting a #GP into the guest)
>> than allowed to actually cause a #GP.
> Or, if for some reason the address we return to is "not present". Now,
> in the current Xen, Xen itself doesn't get paged out, but in a PV guest,
> I'm pretty certain the guest could decide to page out some code-page,
> which just happens to be the one we were about to return to?

That fault would occur in the context being returned to, with rIP == the
IRET return target.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 10:34:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 10:34:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJFR-00052i-Nz; Fri, 16 Nov 2012 10:34:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1TZJFP-00052N-ON; Fri, 16 Nov 2012 10:34:07 +0000
Received: from [85.158.139.83:49578] by server-1.bemta-5.messagelabs.com id
	B4/BB-05877-E9616A05; Fri, 16 Nov 2012 10:34:06 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1353062045!29862401!1
X-Originating-IP: [209.85.217.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5221 invoked from network); 16 Nov 2012 10:34:05 -0000
Received: from mail-lb0-f173.google.com (HELO mail-lb0-f173.google.com)
	(209.85.217.173)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 10:34:05 -0000
Received: by mail-lb0-f173.google.com with SMTP id gj3so2344273lbb.32
	for <multiple recipients>; Fri, 16 Nov 2012 02:34:05 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:date:from:reply-to:user-agent:mime-version:to
	:subject:content-type:content-transfer-encoding;
	bh=CJTWy3+g8QBCuoKvo9FUiGK2ca1EYEHKimSTDfPIq2k=;
	b=xEpvTTYcVz/QZWgpMr4x7H6ffvcFwPwOciZJPb7cZ7Z0pw4/+mn3RuEA52d5EOfACU
	p2oM23v+Oe0ADgsmfkgRaPl0dF9oaM5dZdkR4p9RsksUoOI2967On8sbDuwfUZJrO1kJ
	rQpPezDWWrySLW+cOOAUTHuH4bjWA1IerGduFRvq0ANucpW3JAcw1aa7PZo75bYQHtu9
	zJ0IvgqEqtlgLhaO4P4pt5hWNSIb/VV48lJdcmyEtgl1F7DcyXnHwFtO2fR41xyhszsa
	fgPFjQbFSaoe5wfWyS7tg6Vv+ixUBcP23wfaHW//LOnYGenBVk4V5CUEK+qFRVgSpru0
	hGCw==
Received: by 10.152.105.44 with SMTP id gj12mr3867909lab.19.1353062044900;
	Fri, 16 Nov 2012 02:34:04 -0800 (PST)
Received: from [172.16.26.11] (b0fb37e5.bb.sky.com. [176.251.55.229])
	by mx.google.com with ESMTPS id y10sm537278lbg.4.2012.11.16.02.34.02
	(version=SSLv3 cipher=OTHER); Fri, 16 Nov 2012 02:34:03 -0800 (PST)
Message-ID: <50A61699.2040502@xen.org>
Date: Fri, 16 Nov 2012 10:34:01 +0000
From: Lars Kurth <lars.kurth@xen.org>
User-Agent: Mozilla/5.0 (Windows NT 6.1;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, 
	"xen-api@lists.xen.org" <xen-api@lists.xen.org>, xen-arm@lists.xen.org
Subject: [Xen-devel] [FOSDEM] Virtualization Devroom CFP @ FOSDEM 2013
 (Deadline December 16, 2012)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: lars.kurth@xen.org
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

See https://lists.fosdem.org/pipermail/fosdem/2012-November/001660.html

I am one of the Devroom organizers. Please do submit proposals to the
Devroom. For good proposals, that get accepted, I am always able to 
subsidize travel.

Regards
Lars
--------------------

Greetings,

The organizers of the Virtualization devroom at FOSDEM 2013
invite you to submit a session proposal. The purpose of this
devroom is to serve as a meeting point for virtualization
projects, including a unique opportunity for discussion and
collaboration between developers from different projects.

This devroom will focus on open source virtualization
projects. All developers who want to present their ideas and
software at Virtualization DevRoom 2013 are welcome, provided
that:

* Their project is related to virtualization
* They join the devroom as developers. Developers working for
    companies, public/private agencies or universities speak
    for themselves and not for their employer. OSVC2012 is
    about how to develop more effectivevirtualization
    solutions (ideas and code, not marketing)
* The code for their project must have been released under a
    free software or open source license (its license must meet
    the FSF definition of Free Software or the OSI definition
    of Open Source)

Topics covered will include, but not limited to:
* Machine virtualization (e.g. KVM, Xen, VirtualBox, ...)
* Network virtualization (e.g. openvstack, Open vSwitch,
    vale, vde, ...)
* Process level virtualization, flexible kernels (e.g. rump
    anykernel, view-os, ...)
* Virt management (e.g. ganeti, libvirt, ovirt, XCP, ...)

For more information seehttp://osvc.v2.cs.unibo.it

If you would like some help refining your proposal, or would
like to discuss what topics are most appropriate for this
devroom, please use the virt-devroom at lists.fosdem.org
<https://lists.fosdem.org/listinfo> mailing list.

The virt devroom will last for one day: Saturday, February 2,
2013. Talks will last 25 minutes (including Q&A) and will start
at every full half hour.

To submit a CFP send your proposal to virt-devroom at
lists.fosdem.org <https://lists.fosdem.org/listinfo>
and include the information listed in the requested in CFP
section ofhttp://osvc.v2.cs.unibo.it  to your proposal.

The deadline for submissions is Friday, December 16, 2012.

Thank you,

-- 
Virt Devroom Organizers



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 10:34:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 10:34:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJFR-00052i-Nz; Fri, 16 Nov 2012 10:34:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1TZJFP-00052N-ON; Fri, 16 Nov 2012 10:34:07 +0000
Received: from [85.158.139.83:49578] by server-1.bemta-5.messagelabs.com id
	B4/BB-05877-E9616A05; Fri, 16 Nov 2012 10:34:06 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1353062045!29862401!1
X-Originating-IP: [209.85.217.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5221 invoked from network); 16 Nov 2012 10:34:05 -0000
Received: from mail-lb0-f173.google.com (HELO mail-lb0-f173.google.com)
	(209.85.217.173)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 10:34:05 -0000
Received: by mail-lb0-f173.google.com with SMTP id gj3so2344273lbb.32
	for <multiple recipients>; Fri, 16 Nov 2012 02:34:05 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:date:from:reply-to:user-agent:mime-version:to
	:subject:content-type:content-transfer-encoding;
	bh=CJTWy3+g8QBCuoKvo9FUiGK2ca1EYEHKimSTDfPIq2k=;
	b=xEpvTTYcVz/QZWgpMr4x7H6ffvcFwPwOciZJPb7cZ7Z0pw4/+mn3RuEA52d5EOfACU
	p2oM23v+Oe0ADgsmfkgRaPl0dF9oaM5dZdkR4p9RsksUoOI2967On8sbDuwfUZJrO1kJ
	rQpPezDWWrySLW+cOOAUTHuH4bjWA1IerGduFRvq0ANucpW3JAcw1aa7PZo75bYQHtu9
	zJ0IvgqEqtlgLhaO4P4pt5hWNSIb/VV48lJdcmyEtgl1F7DcyXnHwFtO2fR41xyhszsa
	fgPFjQbFSaoe5wfWyS7tg6Vv+ixUBcP23wfaHW//LOnYGenBVk4V5CUEK+qFRVgSpru0
	hGCw==
Received: by 10.152.105.44 with SMTP id gj12mr3867909lab.19.1353062044900;
	Fri, 16 Nov 2012 02:34:04 -0800 (PST)
Received: from [172.16.26.11] (b0fb37e5.bb.sky.com. [176.251.55.229])
	by mx.google.com with ESMTPS id y10sm537278lbg.4.2012.11.16.02.34.02
	(version=SSLv3 cipher=OTHER); Fri, 16 Nov 2012 02:34:03 -0800 (PST)
Message-ID: <50A61699.2040502@xen.org>
Date: Fri, 16 Nov 2012 10:34:01 +0000
From: Lars Kurth <lars.kurth@xen.org>
User-Agent: Mozilla/5.0 (Windows NT 6.1;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, 
	"xen-api@lists.xen.org" <xen-api@lists.xen.org>, xen-arm@lists.xen.org
Subject: [Xen-devel] [FOSDEM] Virtualization Devroom CFP @ FOSDEM 2013
 (Deadline December 16, 2012)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: lars.kurth@xen.org
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

See https://lists.fosdem.org/pipermail/fosdem/2012-November/001660.html

I am one of the Devroom organizers. Please do submit proposals to the
Devroom. For good proposals, that get accepted, I am always able to 
subsidize travel.

Regards
Lars
--------------------

Greetings,

The organizers of the Virtualization devroom at FOSDEM 2013
invite you to submit a session proposal. The purpose of this
devroom is to serve as a meeting point for virtualization
projects, including a unique opportunity for discussion and
collaboration between developers from different projects.

This devroom will focus on open source virtualization
projects. All developers who want to present their ideas and
software at Virtualization DevRoom 2013 are welcome, provided
that:

* Their project is related to virtualization
* They join the devroom as developers. Developers working for
    companies, public/private agencies or universities speak
    for themselves and not for their employer. OSVC2012 is
    about how to develop more effectivevirtualization
    solutions (ideas and code, not marketing)
* The code for their project must have been released under a
    free software or open source license (its license must meet
    the FSF definition of Free Software or the OSI definition
    of Open Source)

Topics covered will include, but not limited to:
* Machine virtualization (e.g. KVM, Xen, VirtualBox, ...)
* Network virtualization (e.g. openvstack, Open vSwitch,
    vale, vde, ...)
* Process level virtualization, flexible kernels (e.g. rump
    anykernel, view-os, ...)
* Virt management (e.g. ganeti, libvirt, ovirt, XCP, ...)

For more information seehttp://osvc.v2.cs.unibo.it

If you would like some help refining your proposal, or would
like to discuss what topics are most appropriate for this
devroom, please use the virt-devroom at lists.fosdem.org
<https://lists.fosdem.org/listinfo> mailing list.

The virt devroom will last for one day: Saturday, February 2,
2013. Talks will last 25 minutes (including Q&A) and will start
at every full half hour.

To submit a CFP send your proposal to virt-devroom at
lists.fosdem.org <https://lists.fosdem.org/listinfo>
and include the information listed in the requested in CFP
section ofhttp://osvc.v2.cs.unibo.it  to your proposal.

The deadline for submissions is Friday, December 16, 2012.

Thank you,

-- 
Virt Devroom Organizers



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 10:36:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 10:36:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJHN-0005CP-BR; Fri, 16 Nov 2012 10:36:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZJHM-0005CG-0F
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 10:36:08 +0000
Received: from [85.158.143.99:61721] by server-3.bemta-4.messagelabs.com id
	4A/E8-06841-71716A05; Fri, 16 Nov 2012 10:36:07 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1353062166!30207520!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13580 invoked from network); 16 Nov 2012 10:36:06 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-216.messagelabs.com with SMTP;
	16 Nov 2012 10:36:06 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 10:36:06 +0000
Message-Id: <50A6252702000078000A92AE@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 10:36:07 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<50A4D12002000078000A8C68@nat28.tlf.novell.com>
	<c0905ad1-ed26-485b-9232-3475fd32e6a4@default>
In-Reply-To: <c0905ad1-ed26-485b-9232-3475fd32e6a4@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, TimDeegan <tim@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	ZhigangWang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 19:00, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  From: Jan Beulich [mailto:JBeulich@suse.com]
>> Similarly, but perhaps of lower priority, there is no integration
>> with the low-mem handling.
> 
> I'd also consider this lower priority as Olaf and Andre
> have argued that the claim mechanism is not needed for
> sharing/paging so the two mechanisms may not
> be used together, at least for the foreseeable future.
> So I plan to skip this, unless you change your mind and
> consider it a showstopper for acceptance.

Skipping for the initial implementation is likely fine, but that
shouldn't mean deferring the integration indefinitely. Also,
I see no close connection between the low-mem feature
and sharing/paging (apart from Andres working on both).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 10:36:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 10:36:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJHN-0005CP-BR; Fri, 16 Nov 2012 10:36:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZJHM-0005CG-0F
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 10:36:08 +0000
Received: from [85.158.143.99:61721] by server-3.bemta-4.messagelabs.com id
	4A/E8-06841-71716A05; Fri, 16 Nov 2012 10:36:07 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1353062166!30207520!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13580 invoked from network); 16 Nov 2012 10:36:06 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-216.messagelabs.com with SMTP;
	16 Nov 2012 10:36:06 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 10:36:06 +0000
Message-Id: <50A6252702000078000A92AE@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 10:36:07 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<50A4D12002000078000A8C68@nat28.tlf.novell.com>
	<c0905ad1-ed26-485b-9232-3475fd32e6a4@default>
In-Reply-To: <c0905ad1-ed26-485b-9232-3475fd32e6a4@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, TimDeegan <tim@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	ZhigangWang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 19:00, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  From: Jan Beulich [mailto:JBeulich@suse.com]
>> Similarly, but perhaps of lower priority, there is no integration
>> with the low-mem handling.
> 
> I'd also consider this lower priority as Olaf and Andre
> have argued that the claim mechanism is not needed for
> sharing/paging so the two mechanisms may not
> be used together, at least for the foreseeable future.
> So I plan to skip this, unless you change your mind and
> consider it a showstopper for acceptance.

Skipping for the initial implementation is likely fine, but that
shouldn't mean deferring the integration indefinitely. Also,
I see no close connection between the low-mem feature
and sharing/paging (apart from Andres working on both).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 10:39:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 10:39:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJKI-0005Pe-5w; Fri, 16 Nov 2012 10:39:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZJKG-0005PX-3s
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 10:39:08 +0000
Received: from [85.158.143.99:22705] by server-1.bemta-4.messagelabs.com id
	67/4B-27934-BC716A05; Fri, 16 Nov 2012 10:39:07 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1353062347!29612270!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1503 invoked from network); 16 Nov 2012 10:39:07 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-216.messagelabs.com with SMTP;
	16 Nov 2012 10:39:07 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 10:39:07 +0000
Message-Id: <50A625DB02000078000A92C0@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 10:39:07 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
In-Reply-To: <ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	KonradWilk <konrad.wilk@oracle.com>, "Tim\(Xen.org\)" <tim@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 20:15, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> For 32 bit PV guests, note that a claim does NOT have to be
> staked prior to any allocation.  So if a toolstack needs
> to enforce that some portion of allocated memory is under
> a host address limit, it can (attempt to) allocate those pages,
> then stake a claim for the rest.  Or just not use the claim
> mechanism at all.

I don't get what you're trying to tell us here.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 10:39:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 10:39:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJKI-0005Pe-5w; Fri, 16 Nov 2012 10:39:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZJKG-0005PX-3s
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 10:39:08 +0000
Received: from [85.158.143.99:22705] by server-1.bemta-4.messagelabs.com id
	67/4B-27934-BC716A05; Fri, 16 Nov 2012 10:39:07 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1353062347!29612270!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1503 invoked from network); 16 Nov 2012 10:39:07 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-216.messagelabs.com with SMTP;
	16 Nov 2012 10:39:07 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 10:39:07 +0000
Message-Id: <50A625DB02000078000A92C0@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 10:39:07 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
In-Reply-To: <ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	KonradWilk <konrad.wilk@oracle.com>, "Tim\(Xen.org\)" <tim@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 20:15, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> For 32 bit PV guests, note that a claim does NOT have to be
> staked prior to any allocation.  So if a toolstack needs
> to enforce that some portion of allocated memory is under
> a host address limit, it can (attempt to) allocate those pages,
> then stake a claim for the rest.  Or just not use the claim
> mechanism at all.

I don't get what you're trying to tell us here.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 10:41:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 10:41:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJMR-0005Yk-Px; Fri, 16 Nov 2012 10:41:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZJMP-0005YZ-Kh
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 10:41:21 +0000
Received: from [85.158.143.99:39071] by server-1.bemta-4.messagelabs.com id
	0F/3F-27934-05816A05; Fri, 16 Nov 2012 10:41:20 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1353062480!24912831!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21603 invoked from network); 16 Nov 2012 10:41:20 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-216.messagelabs.com with SMTP;
	16 Nov 2012 10:41:20 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 10:41:19 +0000
Message-Id: <50A6265F02000078000A92C3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 10:41:19 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<50A4F07F02000078000A8DBD@nat28.tlf.novell.com>
	<ca76650f-4fd3-4a74-bd09-563784c84dcb@default>
In-Reply-To: <ca76650f-4fd3-4a74-bd09-563784c84dcb@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, "Tim\(Xen.org\)" <tim@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 20:19, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  -----Original Message-----
>> From: Jan Beulich [mailto:JBeulich@suse.com]
>> Sent: Thursday, November 15, 2012 5:39 AM
>> To: Ian Campbell; Dan Magenheimer
>> Cc: xen-devel@lists.xen.org; Dave McCracken; KonradWilk; Zhigang Wang; Keir 
> (Xen.org); Tim(Xen.org)
>> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of 
> existing) hypercall
>> 
>> >>> On 15.11.12 at 13:25, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> > Also doesn't this fail to make any sort of guarantee if you are building
>> > a 32 bit PV guest, since they require memory under a certain host
>> > address limit (160GB IIRC)?
>> 
>> This case is unreliable already, and has always been (I think we
>> have a tools side hack in some of our trees in an attempt to deal
>> with that), when ballooning is used to get at the memory, or
>> when trying to start a 32-bit guest after having run 64-bit ones
>> exhausting most of memory, and having terminated an early
>> created one (as allocation is top down, ones created close to
>> exhaustion, i.e. later, would eat up that "special" memory at
>> lower addresses).
>> 
>> So this new functionality "only" makes a bad situation worse
>> (which isn't meant to say I wouldn't prefer to see it get fixed).
> 
> Hmmm... I guess I don't see how claim makes the situation worse.
> Well maybe a few microseconds worse.
> 
> Old model:
> (1) Allocate a huge number of pages
> 
> New model:
> (1) Claim a huge number of pages.  If successful...
> (2) Allocate that huge number of pages
> 
> In either case, the failure conditions are the same
> except that the claim mechanism checks one of the
> failure conditions sooner.
> 
> Or am I misunderstanding?

I think you are: Your new code adds one more thing that isn't
properly integrated with the creation of such guests. I.e. it's
not the user experience getting worse, but the state of the
code.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 10:41:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 10:41:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJMR-0005Yk-Px; Fri, 16 Nov 2012 10:41:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZJMP-0005YZ-Kh
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 10:41:21 +0000
Received: from [85.158.143.99:39071] by server-1.bemta-4.messagelabs.com id
	0F/3F-27934-05816A05; Fri, 16 Nov 2012 10:41:20 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1353062480!24912831!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21603 invoked from network); 16 Nov 2012 10:41:20 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-216.messagelabs.com with SMTP;
	16 Nov 2012 10:41:20 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 10:41:19 +0000
Message-Id: <50A6265F02000078000A92C3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 10:41:19 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<50A4F07F02000078000A8DBD@nat28.tlf.novell.com>
	<ca76650f-4fd3-4a74-bd09-563784c84dcb@default>
In-Reply-To: <ca76650f-4fd3-4a74-bd09-563784c84dcb@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, "Tim\(Xen.org\)" <tim@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 15.11.12 at 20:19, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  -----Original Message-----
>> From: Jan Beulich [mailto:JBeulich@suse.com]
>> Sent: Thursday, November 15, 2012 5:39 AM
>> To: Ian Campbell; Dan Magenheimer
>> Cc: xen-devel@lists.xen.org; Dave McCracken; KonradWilk; Zhigang Wang; Keir 
> (Xen.org); Tim(Xen.org)
>> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of 
> existing) hypercall
>> 
>> >>> On 15.11.12 at 13:25, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> > Also doesn't this fail to make any sort of guarantee if you are building
>> > a 32 bit PV guest, since they require memory under a certain host
>> > address limit (160GB IIRC)?
>> 
>> This case is unreliable already, and has always been (I think we
>> have a tools side hack in some of our trees in an attempt to deal
>> with that), when ballooning is used to get at the memory, or
>> when trying to start a 32-bit guest after having run 64-bit ones
>> exhausting most of memory, and having terminated an early
>> created one (as allocation is top down, ones created close to
>> exhaustion, i.e. later, would eat up that "special" memory at
>> lower addresses).
>> 
>> So this new functionality "only" makes a bad situation worse
>> (which isn't meant to say I wouldn't prefer to see it get fixed).
> 
> Hmmm... I guess I don't see how claim makes the situation worse.
> Well maybe a few microseconds worse.
> 
> Old model:
> (1) Allocate a huge number of pages
> 
> New model:
> (1) Claim a huge number of pages.  If successful...
> (2) Allocate that huge number of pages
> 
> In either case, the failure conditions are the same
> except that the claim mechanism checks one of the
> failure conditions sooner.
> 
> Or am I misunderstanding?

I think you are: Your new code adds one more thing that isn't
properly integrated with the creation of such guests. I.e. it's
not the user experience getting worse, but the state of the
code.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 10:48:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 10:48:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJTI-0005sG-M9; Fri, 16 Nov 2012 10:48:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZJTH-0005sB-GH
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 10:48:27 +0000
Received: from [85.158.139.83:3617] by server-12.bemta-5.messagelabs.com id
	0D/34-02886-AF916A05; Fri, 16 Nov 2012 10:48:26 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1353062899!25968998!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6003 invoked from network); 16 Nov 2012 10:48:21 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 10:48:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,264,1352073600"; d="scan'208";a="15846482"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 10:48:17 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 10:48:16 +0000
Message-ID: <1353062895.3499.205.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Date: Fri, 16 Nov 2012 10:48:15 +0000
In-Reply-To: <ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>, Konrad
	Wilk <konrad.wilk@oracle.com>, "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 19:15 +0000, Dan Magenheimer wrote:
> > From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> > Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> > 
> > On Wed, 2012-11-14 at 23:55 +0000, Dan Magenheimer wrote:
> > >
> > > Note 1: Tim: I'm thinking this may resolve your concern that
> > > the claim mechanism must be more complicated to handle
> > > restricted memory allocations and order>0 allocations.
> > > The proposed claim mechanism only guarantees a quantity of
> > > order==0 pages; if restricted allocations are required, these
> > > are done first by the toolstack, and followed by the claim.
> > > Order>0 allocations still work if memory is not fragmented,
> > > but the claim mechanism doesn't guarantee anything but
> > > a quantity of order==0 pages.
> > 
> > How does this interact with the feature which lets you create PV guests
> > using only superpages? I believe is something Oracle added and still
> > maintains (Dave added to the CC).
> > 
> > Also doesn't this fail to make any sort of guarantee if you are building
> > a 32 bit PV guest, since they require memory under a certain host
> > address limit (160GB IIRC)?
> > 
> > Basically neither of those cases benefit from this hypercall at all? I
> > don't know what the usecase for the superpage PV guests is (but I
> > suppose it is important to Oracle, at least). The 32 bit PV guest use
> > case is still a pretty significant one which I think ought to be
> > handled, otherwise any system built on top of this functionality will
> > only work reliably in a subset of cases.
> 
> The claim mechanism will not benefit PV superpages.  IIUC, the
> design of the PV superpages will cause a domain launch to fail
> if it requests 10000 superpages but Xen can only successfully
> allocate 9999.  That's already very fragile.  Since the only
> way currently to find out if there are 10000 superpages available
> is to start allocating them, claim can't really help.

Well, you could always account the number of free superpages in the
system, which would allow you to cover this case too.

> For 32 bit PV guests, note that a claim does NOT have to be
> staked prior to any allocation.  So if a toolstack needs
> to enforce that some portion of allocated memory is under
> a host address limit, it can (attempt to) allocate those pages,
> then stake a claim for the rest.

For 32 bit PV guests this is *all* of the pages needed to build any 32
bit PV guest.

> Or just not use the claim mechanism at all.

So your use case has no requirement to be able to start 32 bit domains?
Or whatever requirement you have the leads to the claim mechanism
somehow doesn't apply to those sorts of guests? If not then why not?

As it stands it seems that any toolstack which wants to use claim would
still have to cope with the fact that a potentially significant
proportion of guests may still fail to build even after a claim has been
successfully staked.

Even if these shortcomings are acceptable in your specific scenario I
don't see why we should be satisfied with a solution which is not more
generally applicable.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 10:48:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 10:48:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJTI-0005sG-M9; Fri, 16 Nov 2012 10:48:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZJTH-0005sB-GH
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 10:48:27 +0000
Received: from [85.158.139.83:3617] by server-12.bemta-5.messagelabs.com id
	0D/34-02886-AF916A05; Fri, 16 Nov 2012 10:48:26 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1353062899!25968998!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6003 invoked from network); 16 Nov 2012 10:48:21 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 10:48:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,264,1352073600"; d="scan'208";a="15846482"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 10:48:17 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 10:48:16 +0000
Message-ID: <1353062895.3499.205.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Date: Fri, 16 Nov 2012 10:48:15 +0000
In-Reply-To: <ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>, Konrad
	Wilk <konrad.wilk@oracle.com>, "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 19:15 +0000, Dan Magenheimer wrote:
> > From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> > Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> > 
> > On Wed, 2012-11-14 at 23:55 +0000, Dan Magenheimer wrote:
> > >
> > > Note 1: Tim: I'm thinking this may resolve your concern that
> > > the claim mechanism must be more complicated to handle
> > > restricted memory allocations and order>0 allocations.
> > > The proposed claim mechanism only guarantees a quantity of
> > > order==0 pages; if restricted allocations are required, these
> > > are done first by the toolstack, and followed by the claim.
> > > Order>0 allocations still work if memory is not fragmented,
> > > but the claim mechanism doesn't guarantee anything but
> > > a quantity of order==0 pages.
> > 
> > How does this interact with the feature which lets you create PV guests
> > using only superpages? I believe is something Oracle added and still
> > maintains (Dave added to the CC).
> > 
> > Also doesn't this fail to make any sort of guarantee if you are building
> > a 32 bit PV guest, since they require memory under a certain host
> > address limit (160GB IIRC)?
> > 
> > Basically neither of those cases benefit from this hypercall at all? I
> > don't know what the usecase for the superpage PV guests is (but I
> > suppose it is important to Oracle, at least). The 32 bit PV guest use
> > case is still a pretty significant one which I think ought to be
> > handled, otherwise any system built on top of this functionality will
> > only work reliably in a subset of cases.
> 
> The claim mechanism will not benefit PV superpages.  IIUC, the
> design of the PV superpages will cause a domain launch to fail
> if it requests 10000 superpages but Xen can only successfully
> allocate 9999.  That's already very fragile.  Since the only
> way currently to find out if there are 10000 superpages available
> is to start allocating them, claim can't really help.

Well, you could always account the number of free superpages in the
system, which would allow you to cover this case too.

> For 32 bit PV guests, note that a claim does NOT have to be
> staked prior to any allocation.  So if a toolstack needs
> to enforce that some portion of allocated memory is under
> a host address limit, it can (attempt to) allocate those pages,
> then stake a claim for the rest.

For 32 bit PV guests this is *all* of the pages needed to build any 32
bit PV guest.

> Or just not use the claim mechanism at all.

So your use case has no requirement to be able to start 32 bit domains?
Or whatever requirement you have the leads to the claim mechanism
somehow doesn't apply to those sorts of guests? If not then why not?

As it stands it seems that any toolstack which wants to use claim would
still have to cope with the fact that a potentially significant
proportion of guests may still fail to build even after a claim has been
successfully staked.

Even if these shortcomings are acceptable in your specific scenario I
don't see why we should be satisfied with a solution which is not more
generally applicable.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 10:50:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 10:50:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJUy-0005xS-5q; Fri, 16 Nov 2012 10:50:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZJUw-0005xK-SN
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 10:50:11 +0000
Received: from [85.158.143.99:51009] by server-1.bemta-4.messagelabs.com id
	DA/AE-27934-26A16A05; Fri, 16 Nov 2012 10:50:10 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1353063004!29614297!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13450 invoked from network); 16 Nov 2012 10:50:08 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-3.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 10:50:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,264,1352073600"; d="scan'208";a="44826254"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 10:50:03 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 05:50:04 -0500
Received: from [10.80.3.146] (helo=localmatsp-T3500.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<mats.petersson@citrix.com>)	id 1TZJSC-0002t3-AK;
	Fri, 16 Nov 2012 10:47:20 +0000
From: Mats Petersson <mats.petersson@citrix.com>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 10:47:08 +0000
Message-ID: <1353062828-5476-1-git-send-email-mats.petersson@citrix.com>
X-Mailer: git-send-email 1.7.9.5
MIME-Version: 1.0
Cc: Mats Petersson <mats.petersson@citrix.com>, konrad.wilk@oracle.com
Subject: [Xen-devel] [PATCH 1/2] Fix broken IOCTL_PRIVCMD_MMAPBATCH (old
	version).
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
that it broke. The return value is set early on to -EINVAL, and if all
goes well, the "set top bits of the MFN's" never gets called, so the
return value is still EINVAL when the function gets to the end, causing
the caller to think it went wrong (which it didn't!)

Signed off by: Mats Petersson <mats.petersson@citrix.com>
---
 drivers/xen/privcmd.c |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index 8adb9cc..b378343 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -347,6 +347,7 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
 
 	if (ret)
 		goto out;
+
 	if (list_empty(&pagelist)) {
 		ret = -EINVAL;
 		goto out;
@@ -383,12 +384,17 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
 
 	up_write(&mm->mmap_sem);
 
-	if (state.global_error && (version == 1)) {
-		/* Write back errors in second pass. */
-		state.user_mfn = (xen_pfn_t *)m.arr;
-		state.err      = err_array;
-		ret = traverse_pages(m.num, sizeof(xen_pfn_t),
-				     &pagelist, mmap_return_errors_v1, &state);
+	if (version == 1) {
+		if (state.global_error) {
+			/* Write back errors in second pass. */
+			state.user_mfn = (xen_pfn_t *)m.arr;
+			state.err      = err_array;
+			ret = traverse_pages(m.num, sizeof(xen_pfn_t),
+					     &pagelist, mmap_return_errors_v1, &state);
+		}
+		else
+			ret = 0;
+
 	} else if (version == 2) {
 		ret = __copy_to_user(m.err, err_array, m.num * sizeof(int));
 		if (ret)
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 10:50:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 10:50:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJUy-0005xS-5q; Fri, 16 Nov 2012 10:50:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZJUw-0005xK-SN
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 10:50:11 +0000
Received: from [85.158.143.99:51009] by server-1.bemta-4.messagelabs.com id
	DA/AE-27934-26A16A05; Fri, 16 Nov 2012 10:50:10 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1353063004!29614297!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13450 invoked from network); 16 Nov 2012 10:50:08 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-3.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 10:50:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,264,1352073600"; d="scan'208";a="44826254"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 10:50:03 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 05:50:04 -0500
Received: from [10.80.3.146] (helo=localmatsp-T3500.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<mats.petersson@citrix.com>)	id 1TZJSC-0002t3-AK;
	Fri, 16 Nov 2012 10:47:20 +0000
From: Mats Petersson <mats.petersson@citrix.com>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 10:47:08 +0000
Message-ID: <1353062828-5476-1-git-send-email-mats.petersson@citrix.com>
X-Mailer: git-send-email 1.7.9.5
MIME-Version: 1.0
Cc: Mats Petersson <mats.petersson@citrix.com>, konrad.wilk@oracle.com
Subject: [Xen-devel] [PATCH 1/2] Fix broken IOCTL_PRIVCMD_MMAPBATCH (old
	version).
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
that it broke. The return value is set early on to -EINVAL, and if all
goes well, the "set top bits of the MFN's" never gets called, so the
return value is still EINVAL when the function gets to the end, causing
the caller to think it went wrong (which it didn't!)

Signed off by: Mats Petersson <mats.petersson@citrix.com>
---
 drivers/xen/privcmd.c |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index 8adb9cc..b378343 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -347,6 +347,7 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
 
 	if (ret)
 		goto out;
+
 	if (list_empty(&pagelist)) {
 		ret = -EINVAL;
 		goto out;
@@ -383,12 +384,17 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
 
 	up_write(&mm->mmap_sem);
 
-	if (state.global_error && (version == 1)) {
-		/* Write back errors in second pass. */
-		state.user_mfn = (xen_pfn_t *)m.arr;
-		state.err      = err_array;
-		ret = traverse_pages(m.num, sizeof(xen_pfn_t),
-				     &pagelist, mmap_return_errors_v1, &state);
+	if (version == 1) {
+		if (state.global_error) {
+			/* Write back errors in second pass. */
+			state.user_mfn = (xen_pfn_t *)m.arr;
+			state.err      = err_array;
+			ret = traverse_pages(m.num, sizeof(xen_pfn_t),
+					     &pagelist, mmap_return_errors_v1, &state);
+		}
+		else
+			ret = 0;
+
 	} else if (version == 2) {
 		ret = __copy_to_user(m.err, err_array, m.num * sizeof(int));
 		if (ret)
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 10:54:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 10:54:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJYm-0006Bb-Uk; Fri, 16 Nov 2012 10:54:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <raistlin.df@gmail.com>) id 1TZJYk-0006BT-Nx
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 10:54:07 +0000
Received: from [85.158.138.51:30035] by server-6.bemta-3.messagelabs.com id
	CA/81-28265-D4B16A05; Fri, 16 Nov 2012 10:54:05 +0000
X-Env-Sender: raistlin.df@gmail.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1353063244!26241360!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24658 invoked from network); 16 Nov 2012 10:54:04 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-10.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 10:54:04 -0000
Received: by mail-wg0-f51.google.com with SMTP id ed3so991675wgb.32
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 02:54:04 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:subject:from:to:cc:date:in-reply-to:references
	:content-type:x-mailer:mime-version;
	bh=rpwluGGHaKdQzgTlsnfVO8ylLgPpIVzNhOeJ1f4wOm0=;
	b=bEJjSONQUF6ex9YsMiIuUH4/d9qT987R8tfXnGbSGpyvPn9HN22EsV4WrmMxJ2IJjC
	jYbU2gcJpGpzBWaFB+pbMo7U7ZE7yKwAlEruHoJ+NjP29qbv1vVnzJ0iD5hQu0OxnAFj
	uZj6DaxW3cm6DZX1LO/MDvW3DQIWwFb5VbyFDmKw9MLKHZ9JMPHglSS/cNuLQh5HkXLx
	+I89uogMQmgB3Nwu+yUld5x9PC65QfMx4UutFGASWdA5pirUk656V7w3z2m4qb4w84Vu
	djyHE2IIgHQ1jdZQRcu7WJwPA5gzb3EbBp9Jep/panIqMf6qRX2Jaa7cZPfHfyNSdMoi
	4HTw==
Received: by 10.180.19.71 with SMTP id c7mr4518776wie.2.1353063244474;
	Fri, 16 Nov 2012 02:54:04 -0800 (PST)
Received: from [192.168.0.40] (ip-176-53.sn2.eutelia.it. [83.211.176.53])
	by mx.google.com with ESMTPS id w5sm238979wiz.10.2012.11.16.02.54.01
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 16 Nov 2012 02:54:03 -0800 (PST)
Message-ID: <1353063234.5351.107.camel@Solace>
From: Dario Faggioli <raistlin@linux.it>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Fri, 16 Nov 2012 11:53:54 +0100
In-Reply-To: <50A4DD95.5020107@eu.citrix.com>
References: <1350999260.5064.56.camel@Solace>
	<5086B4DF.6060701@eu.citrix.com> <1352981447.5351.51.camel@Solace>
	<50A4DD95.5020107@eu.citrix.com>
X-Mailer: Evolution 3.4.4-1
Mime-Version: 1.0
Cc: Keir Fraser <keir.xen@gmail.com>, David Vrabel <david.vrabel@citrix.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] About vcpu wakeup and runq tickling in credit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7231670897189083106=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--===============7231670897189083106==
Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature";
	boundary="=-v5YesdCyogvCYj4ko/ra"


--=-v5YesdCyogvCYj4ko/ra
Content-Type: multipart/mixed; boundary="=-lSdy+MLWirKNyQYp3l8x"


--=-lSdy+MLWirKNyQYp3l8x
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

(Cc-ing David as it looks like he uses xenalyze quite a bit, and I'm=20
 seeking for any advice on how to squeeze data from there too :-P)

On Thu, 2012-11-15 at 12:18 +0000, George Dunlap wrote:
> Maybe what we should do is do the wake-up based on who is likely to run=
=20
> on the current cpu: i.e., if "current" is likely to be pre-empted, look=
=20
> at idlers based on "current"'s mask; if "new" is likely to be put on the=
=20
> queue, look at idlers based on "new"'s mask.
>=20
Ok, find attached the two (trivial) patches that I produced and am
testing in these days. Unfortunately, early results shows that I/we
might be missing something.

In fact, although I still don't yet have the numbers for the NUMA-aware
scheduling case (which is what originated all this! :-D), comparing
'upstream' and 'patched' (namely, 'upstream' plus the two attached
patches) I can spot some perf regressions. :-(

Here's the results of running some benchmarks on 2, 6 and 10 VMs. Each
VM has 2 VCPUs and they run and execute the benchmarks concurrently on a
16 CPUs host. (Each test is repeated 3 times, and avg+/-stddev is what
is reported).

Also, the VCPUs where statically pinned on the host's PCPUs. As already
said, numbers for no-pinning and NUMA-scheduling will follow.

+ sysbench --test=3Dmemory (throughput, higher is better)
 #VMs | upstream                | patched
    2 | 550.97667 +/- 2.3512355 | 540.185   +/- 21.416892
    6 | 443.15    +/- 5.7471797 | 442.66389 +/- 2.1071732
   10 | 313.89233 +/- 1.3237493 | 305.69567 +/- 0.3279853

+ sysbench --test=3Dcpu (time, lower is better)
 #VMs | upstream                | patched
    2 | 47.8211   +/- 0.0215503 | 47.816117 +/- 0.0174079
    6 | 62.689122 +/- 0.0877172 | 62.789883 +/- 0.1892171
   10 | 90.321097 +/- 1.4803867 | 91.197767 +/- 0.1032667

+ specjbb2005 (throughput, higher is better)
 #VMs | upstream                | patched
    2 | 49591.057 +/- 952.93384 | 50008.28  +/- 1502.4863
    6 | 33538.247 +/- 1089.2115 | 33647.873 +/- 1007.3538
   10 | 21927.87  +/- 831.88742 | 21869.654 +/- 578.236


So, as you can easily see, the numbers are very similar, with cases
where the patches produces some slight performance reduction, while I
was expecting the opposite, i.e., similar but a little bit better with
the patches.

For most of the runs of all the benchmarks, I have the full traces
(although, only for SCHED-* events, IIRC), so I can investigate more.
It's an huge amount of data, so it's really hard to make sense out of
it, and any advice and direction on that would be much appreciated.


For instance, looking at one of the runs of sysbench-memory, here's what
I found. With 10 VMs, the memory throughput reported by one of the VM
during one of the runs is as follows:

 upstream: 315.68 MB/s
 patched:  306.69 MB/s

I then went through the traces and I found out that the patched case
lasted longer (for transferring the same amount of memory, hence the
lower throughput), but with the following runstate related results:

 upstream: running for 73.67% of the time
           runnable for 24.94% of the time

 patched:  running for 74.57% of the time
           runnable for 24.10% of the time

And that is consistent with other random instances I checked. So, it
looks like the patches are, after all, doing their job in increasing (at
least a little) the running time, at the expenses of the runnable time,
of the various VCPUs, but the benefits of that is being all eaten by
some other effect --to the point that sometimes things go even worse--
that I'm not able to identify... For now! :-P

Any idea about what's going on and what I should check to better figure
that out?


Thanks a lot and Regards,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-lSdy+MLWirKNyQYp3l8x
Content-Disposition: attachment;
	filename="xen-sched_credit-clarify-cpumask-and-during-tickle.patch"
Content-Type: text/x-patch;
	name="xen-sched_credit-clarify-cpumask-and-during-tickle.patch";
	charset="UTF-8"
Content-Transfer-Encoding: base64

IyBIRyBjaGFuZ2VzZXQgcGF0Y2gNCiMgUGFyZW50IGIwYzM0MmI3NDk3NjViZjI1NGM2NjQ4ODNk
NGY1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gmbWFzaywgJm1hc2ssIG5ldy0+dmNwdS0+Y3B1X2FmZmluaXR5KTsN
CiAgICAgICAgIH0NCiAgICAgfQ0KIA0K


--=-lSdy+MLWirKNyQYp3l8x
Content-Disposition: attachment; filename="xen-sched_credit-fix-tickling"
Content-Type: text/plain; name="xen-sched_credit-fix-tickling"; charset="UTF-8"
Content-Transfer-Encoding: base64

IyBIRyBjaGFuZ2VzZXQgcGF0Y2gNCiMgUGFyZW50IDNhNzBiZDFkMDJjMTMzNDg1N2M4NGM5ZmI1
ZTFkZDIyYjY2MDNhMmMNCg0KZGlmZiAtciAzYTcwYmQxZDAyYzEgeGVuL2NvbW1vbi9zY2hlZF9j
cmVkaXQuYw0KLS0tIGEveGVuL2NvbW1vbi9zY2hlZF9jcmVkaXQuYwlUaHUgTm92IDE1IDE4OjIy
OjU2IDIwMTIgKzAxMDANCisrKyBiL3hlbi9jb21tb24vc2NoZWRfY3JlZGl0LmMJVGh1IE5vdiAx
NSAxOTowMzoxOSAyMDEyICswMTAwDQpAQCAtMjc0LDcgKzI3NCw3IEBAIHN0YXRpYyBpbmxpbmUg
dm9pZA0KICAgICB9DQogDQogICAgIC8qDQotICAgICAqIElmIHRoaXMgQ1BVIGhhcyBhdCBsZWFz
dCB0d28gcnVubmFibGUgVkNQVXMsIHdlIHRpY2tsZSBhbnkgaWRsZXJzIHRvDQorICAgICAqIElm
IHRoaXMgQ1BVIGhhcyBhdCBsZWFzdCB0d28gcnVubmFibGUgVkNQVXMsIHdlIHRpY2tsZSBzb21l
IGlkbGVycyB0bw0KICAgICAgKiBsZXQgdGhlbSBrbm93IHRoZXJlIGlzIHJ1bm5hYmxlIHdvcmsg
aW4gdGhlIHN5c3RlbS4uLg0KICAgICAgKi8NCiAgICAgaWYgKCBjdXItPnByaSA+IENTQ0hFRF9Q
UklfSURMRSApDQpAQCAtMjg3LDcgKzI4NywxNyBAQCBzdGF0aWMgaW5saW5lIHZvaWQNCiAgICAg
ICAgIHsNCiAgICAgICAgIC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ogvCYj4ko/ra
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCmG0IACgkQk4XaBE3IOsQ09gCdH+Kzg9V/t3cCX8Z5D8625XEo
n3gAoKMXf8empkHEQCajOOhB71HuOlko
=6K1e
-----END PGP SIGNATURE-----

--=-v5YesdCyogvCYj4ko/ra--



--===============7231670897189083106==
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.xen.org
http://lists.xen.org/xen-devel

--===============7231670897189083106==--



From xen-devel-bounces@lists.xen.org Fri Nov 16 10:54:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 10:54:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJYm-0006Bb-Uk; Fri, 16 Nov 2012 10:54:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <raistlin.df@gmail.com>) id 1TZJYk-0006BT-Nx
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 10:54:07 +0000
Received: from [85.158.138.51:30035] by server-6.bemta-3.messagelabs.com id
	CA/81-28265-D4B16A05; Fri, 16 Nov 2012 10:54:05 +0000
X-Env-Sender: raistlin.df@gmail.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1353063244!26241360!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24658 invoked from network); 16 Nov 2012 10:54:04 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-10.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 10:54:04 -0000
Received: by mail-wg0-f51.google.com with SMTP id ed3so991675wgb.32
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 02:54:04 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:subject:from:to:cc:date:in-reply-to:references
	:content-type:x-mailer:mime-version;
	bh=rpwluGGHaKdQzgTlsnfVO8ylLgPpIVzNhOeJ1f4wOm0=;
	b=bEJjSONQUF6ex9YsMiIuUH4/d9qT987R8tfXnGbSGpyvPn9HN22EsV4WrmMxJ2IJjC
	jYbU2gcJpGpzBWaFB+pbMo7U7ZE7yKwAlEruHoJ+NjP29qbv1vVnzJ0iD5hQu0OxnAFj
	uZj6DaxW3cm6DZX1LO/MDvW3DQIWwFb5VbyFDmKw9MLKHZ9JMPHglSS/cNuLQh5HkXLx
	+I89uogMQmgB3Nwu+yUld5x9PC65QfMx4UutFGASWdA5pirUk656V7w3z2m4qb4w84Vu
	djyHE2IIgHQ1jdZQRcu7WJwPA5gzb3EbBp9Jep/panIqMf6qRX2Jaa7cZPfHfyNSdMoi
	4HTw==
Received: by 10.180.19.71 with SMTP id c7mr4518776wie.2.1353063244474;
	Fri, 16 Nov 2012 02:54:04 -0800 (PST)
Received: from [192.168.0.40] (ip-176-53.sn2.eutelia.it. [83.211.176.53])
	by mx.google.com with ESMTPS id w5sm238979wiz.10.2012.11.16.02.54.01
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 16 Nov 2012 02:54:03 -0800 (PST)
Message-ID: <1353063234.5351.107.camel@Solace>
From: Dario Faggioli <raistlin@linux.it>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Fri, 16 Nov 2012 11:53:54 +0100
In-Reply-To: <50A4DD95.5020107@eu.citrix.com>
References: <1350999260.5064.56.camel@Solace>
	<5086B4DF.6060701@eu.citrix.com> <1352981447.5351.51.camel@Solace>
	<50A4DD95.5020107@eu.citrix.com>
X-Mailer: Evolution 3.4.4-1
Mime-Version: 1.0
Cc: Keir Fraser <keir.xen@gmail.com>, David Vrabel <david.vrabel@citrix.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] About vcpu wakeup and runq tickling in credit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7231670897189083106=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--===============7231670897189083106==
Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature";
	boundary="=-v5YesdCyogvCYj4ko/ra"


--=-v5YesdCyogvCYj4ko/ra
Content-Type: multipart/mixed; boundary="=-lSdy+MLWirKNyQYp3l8x"


--=-lSdy+MLWirKNyQYp3l8x
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

(Cc-ing David as it looks like he uses xenalyze quite a bit, and I'm=20
 seeking for any advice on how to squeeze data from there too :-P)

On Thu, 2012-11-15 at 12:18 +0000, George Dunlap wrote:
> Maybe what we should do is do the wake-up based on who is likely to run=
=20
> on the current cpu: i.e., if "current" is likely to be pre-empted, look=
=20
> at idlers based on "current"'s mask; if "new" is likely to be put on the=
=20
> queue, look at idlers based on "new"'s mask.
>=20
Ok, find attached the two (trivial) patches that I produced and am
testing in these days. Unfortunately, early results shows that I/we
might be missing something.

In fact, although I still don't yet have the numbers for the NUMA-aware
scheduling case (which is what originated all this! :-D), comparing
'upstream' and 'patched' (namely, 'upstream' plus the two attached
patches) I can spot some perf regressions. :-(

Here's the results of running some benchmarks on 2, 6 and 10 VMs. Each
VM has 2 VCPUs and they run and execute the benchmarks concurrently on a
16 CPUs host. (Each test is repeated 3 times, and avg+/-stddev is what
is reported).

Also, the VCPUs where statically pinned on the host's PCPUs. As already
said, numbers for no-pinning and NUMA-scheduling will follow.

+ sysbench --test=3Dmemory (throughput, higher is better)
 #VMs | upstream                | patched
    2 | 550.97667 +/- 2.3512355 | 540.185   +/- 21.416892
    6 | 443.15    +/- 5.7471797 | 442.66389 +/- 2.1071732
   10 | 313.89233 +/- 1.3237493 | 305.69567 +/- 0.3279853

+ sysbench --test=3Dcpu (time, lower is better)
 #VMs | upstream                | patched
    2 | 47.8211   +/- 0.0215503 | 47.816117 +/- 0.0174079
    6 | 62.689122 +/- 0.0877172 | 62.789883 +/- 0.1892171
   10 | 90.321097 +/- 1.4803867 | 91.197767 +/- 0.1032667

+ specjbb2005 (throughput, higher is better)
 #VMs | upstream                | patched
    2 | 49591.057 +/- 952.93384 | 50008.28  +/- 1502.4863
    6 | 33538.247 +/- 1089.2115 | 33647.873 +/- 1007.3538
   10 | 21927.87  +/- 831.88742 | 21869.654 +/- 578.236


So, as you can easily see, the numbers are very similar, with cases
where the patches produces some slight performance reduction, while I
was expecting the opposite, i.e., similar but a little bit better with
the patches.

For most of the runs of all the benchmarks, I have the full traces
(although, only for SCHED-* events, IIRC), so I can investigate more.
It's an huge amount of data, so it's really hard to make sense out of
it, and any advice and direction on that would be much appreciated.


For instance, looking at one of the runs of sysbench-memory, here's what
I found. With 10 VMs, the memory throughput reported by one of the VM
during one of the runs is as follows:

 upstream: 315.68 MB/s
 patched:  306.69 MB/s

I then went through the traces and I found out that the patched case
lasted longer (for transferring the same amount of memory, hence the
lower throughput), but with the following runstate related results:

 upstream: running for 73.67% of the time
           runnable for 24.94% of the time

 patched:  running for 74.57% of the time
           runnable for 24.10% of the time

And that is consistent with other random instances I checked. So, it
looks like the patches are, after all, doing their job in increasing (at
least a little) the running time, at the expenses of the runnable time,
of the various VCPUs, but the benefits of that is being all eaten by
some other effect --to the point that sometimes things go even worse--
that I'm not able to identify... For now! :-P

Any idea about what's going on and what I should check to better figure
that out?


Thanks a lot and Regards,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-lSdy+MLWirKNyQYp3l8x
Content-Disposition: attachment;
	filename="xen-sched_credit-clarify-cpumask-and-during-tickle.patch"
Content-Type: text/x-patch;
	name="xen-sched_credit-clarify-cpumask-and-during-tickle.patch";
	charset="UTF-8"
Content-Transfer-Encoding: base64

IyBIRyBjaGFuZ2VzZXQgcGF0Y2gNCiMgUGFyZW50IGIwYzM0MmI3NDk3NjViZjI1NGM2NjQ4ODNk
NGY1ZTI4OTFjMWZmMTgNCg0KZGlmZiAtciBiMGMzNDJiNzQ5NzYgeGVuL2NvbW1vbi9zY2hlZF9j
cmVkaXQuYw0KLS0tIGEveGVuL2NvbW1vbi9zY2hlZF9jcmVkaXQuYwlGcmkgTm92IDA5IDExOjAy
OjU0IDIwMTIgKzAxMDANCisrKyBiL3hlbi9jb21tb24vc2NoZWRfY3JlZGl0LmMJVGh1IE5vdiAx
NSAxODoyMjo1NiAyMDEyICswMTAwDQpAQCAtMjU0LDcgKzI1NCwxMSBAQCBzdGF0aWMgaW5saW5l
IHZvaWQNCiAgICAgQVNTRVJUKGN1cik7DQogICAgIGNwdW1hc2tfY2xlYXIoJm1hc2spOw0KIA0K
LSAgICAvKiBJZiBzdHJpY3RseSBoaWdoZXIgcHJpb3JpdHkgdGhhbiBjdXJyZW50IFZDUFUsIHNp
Z25hbCB0aGUgQ1BVICovDQorICAgIC8qDQorICAgICAqIElmIG5ldyBpcyBzdHJpY3RseSBoaWdo
ZXIgcHJpb3JpdHkgdGhhbiBjdXJyZW50IFZDUFUsIGxldCBDUFUNCisgICAgICoga25vdyB0aGF0
IHJlLXNjaGVkdWxpbmcgaXMgbmVlZGVkLiBUaGF0IHdpbGwgbGlrZWx5IHBpY2stdXAgbmV3DQor
ICAgICAqIGFuZCBwdXQgY3VyIGJhY2sgaW4gdGhlIHJ1bnF1ZXVlLg0KKyAgICAgKi8NCiAgICAg
aWYgKCBuZXctPnByaSA+IGN1ci0+cHJpICkNCiAgICAgew0KICAgICAgICAgaWYgKCBjdXItPnBy
aSA9PSBDU0NIRURfUFJJX0lETEUgKQ0KQEAgLTI5Niw3ICszMDAsNiBAQCBzdGF0aWMgaW5saW5l
IHZvaWQNCiAgICAgICAgICAgICAgICAgZWxzZQ0KICAgICAgICAgICAgICAgICAgICAgY3B1bWFz
a19vcigmbWFzaywgJm1hc2ssICZpZGxlX21hc2spOw0KICAgICAgICAgICAgIH0NCi0gICAgICAg
ICAgICBjcHVtYXNrX2FuZCgmbWFzaywgJm1hc2ssIG5ldy0+dmNwdS0+Y3B1X2FmZmluaXR5KTsN
CiAgICAgICAgIH0NCiAgICAgfQ0KIA0K


--=-lSdy+MLWirKNyQYp3l8x
Content-Disposition: attachment; filename="xen-sched_credit-fix-tickling"
Content-Type: text/plain; name="xen-sched_credit-fix-tickling"; charset="UTF-8"
Content-Transfer-Encoding: base64

IyBIRyBjaGFuZ2VzZXQgcGF0Y2gNCiMgUGFyZW50IDNhNzBiZDFkMDJjMTMzNDg1N2M4NGM5ZmI1
ZTFkZDIyYjY2MDNhMmMNCg0KZGlmZiAtciAzYTcwYmQxZDAyYzEgeGVuL2NvbW1vbi9zY2hlZF9j
cmVkaXQuYw0KLS0tIGEveGVuL2NvbW1vbi9zY2hlZF9jcmVkaXQuYwlUaHUgTm92IDE1IDE4OjIy
OjU2IDIwMTIgKzAx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pZiBpdCBpcw0KKyAgICAgICAgICAgICAqIGN1ciB0
aGF0IHN0YXlzLCB3ZSBwb2tlIGlkbGVycyB3aGVyZSBuZXcgY2FuIHJ1bi4NCisgICAgICAgICAg
ICAgKi8NCisgICAgICAgICAgICBpZiAoIG5ldy0+cHJpID4gY3VyLT5wcmkgKQ0KKyAgICAgICAg
ICAgICAgICBjcHVtYXNrX2FuZCgmaWRsZV9tYXNrLCBwcnYtPmlkbGVycywgY3VyLT52Y3B1LT5j
cHVfYWZmaW5pdHkpOw0KKyAgICAgICAgICAgIGVsc2UNCisgICAgICAgICAgICAgICAgY3B1bWFz
a19hbmQoJmlkbGVfbWFzaywgcHJ2LT5pZGxlcnMsIG5ldy0+dmNwdS0+Y3B1X2FmZmluaXR5KTsN
CisNCiAgICAgICAgICAgICBpZiAoICFjcHVtYXNrX2VtcHR5KCZpZGxlX21hc2spICkNCiAgICAg
ICAgICAgICB7DQogICAgICAgICAgICAgICAgIFNDSEVEX1NUQVRfQ1JBTksodGlja2xlX2lkbGVy
c19zb21lKTsNCg==


--=-lSdy+MLWirKNyQYp3l8x--

--=-v5YesdCyogvCYj4ko/ra
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCmG0IACgkQk4XaBE3IOsQ09gCdH+Kzg9V/t3cCX8Z5D8625XEo
n3gAoKMXf8empkHEQCajOOhB71HuOlko
=6K1e
-----END PGP SIGNATURE-----

--=-v5YesdCyogvCYj4ko/ra--



--===============7231670897189083106==
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.xen.org
http://lists.xen.org/xen-devel

--===============7231670897189083106==--



From xen-devel-bounces@lists.xen.org Fri Nov 16 10:56:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 10:56:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJb8-0006JV-Fw; Fri, 16 Nov 2012 10:56:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TZJb7-0006JQ-O5
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 10:56:33 +0000
Received: from [193.109.254.147:57849] by server-9.bemta-14.messagelabs.com id
	FE/C8-30773-1EB16A05; Fri, 16 Nov 2012 10:56:33 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353063389!4195062!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2320 invoked from network); 16 Nov 2012 10:56:30 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-6.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 10:56:30 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TZJaw-000NTR-7t; Fri, 16 Nov 2012 10:56:22 +0000
Date: Fri, 16 Nov 2012 10:56:22 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121116105622.GA89551@ocelot.phlegethon.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A6024F02000078000A9214@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A6024F02000078000A9214@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>, eddie.dong@intel.com,
	Ian.Campbell@citrix.com, jun.nakajima@intel.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
	real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 08:07 +0000 on 16 Nov (1353053247), Jan Beulich wrote:
> I continue to not be in favor of special casing this in VMX code,
> considering that the problem is generic (i.e. similarly affects PV).
> I.e. either we handle the other case similarly (special code added
> also to the PV code path), or we deal with this in a single place,
> keeping the NMIs masked for an extended period of time.

Affects PV because PV might use SYSRET to return from the NMI handler?
Right.

> > All of this would be moot except for the risk that we might take an MCE
> > while in the NMI handler.  The IRET from the MCE handler re-enables NMIs
> > while we're still in the NMI handler, and a second NMI arriving could
> > break the NMI handler.  In the PV case, it will also clobber the NMI
> > handler's stack.
> 
> No - the entry code switches away from the dedicated stacks when
> the origin was in guest context (see handle_ist_exception in
> xen/arch/x86/x86_64/entry.S).

I see, thanks.  So it's only if we take the NMI while in the hypervisor
that we stay on the NMI stack and risk getting the stack clobbered.

> > We could potentially solve the problem by having the MCE handler check
> > whether it's returning to the NMI stack, and do a normal return in that
> > case.  It's a bit of extra code but only in the MCE handler, which is
> > not performance-critical. 
> 
> Yes, that could solve that nesting case (again not very difficult
> to implement).

How about we just have the MCE handler return without IRET in _all_
cases where it's returning to ring 0?  I think that entirely solves the
MCE-in-NMI problem, without all the extra mechanism meeded for the
linux-style solution.  (Unless we want to allow other traps in either
the NMI or MCE handlers).

[And it occurs to me that the linux-style solution is tricky because
detecting the case where you've taken an NMI and not yet set the
nmi-in-progress flag is hard in both SVM (in the NMI handler but on the
normal stack) and VMX (in the _vmexit_ handler and on the normal
stack).]

So I guess now I'm suggesting:
 - MCE never returns to Xen with IRET;
 - NMI handling in handle_vmexit() moves to beside the MCE handling;
 - Explicit IRET-to-self at the end of do_nmi() to unmask NMIs; and
 - no int $2. :)

How's that?  I feel sure I must have missed a case - itt sounds too
easy.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 10:56:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 10:56:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJb8-0006JV-Fw; Fri, 16 Nov 2012 10:56:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TZJb7-0006JQ-O5
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 10:56:33 +0000
Received: from [193.109.254.147:57849] by server-9.bemta-14.messagelabs.com id
	FE/C8-30773-1EB16A05; Fri, 16 Nov 2012 10:56:33 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353063389!4195062!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2320 invoked from network); 16 Nov 2012 10:56:30 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-6.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 10:56:30 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TZJaw-000NTR-7t; Fri, 16 Nov 2012 10:56:22 +0000
Date: Fri, 16 Nov 2012 10:56:22 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121116105622.GA89551@ocelot.phlegethon.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A6024F02000078000A9214@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A6024F02000078000A9214@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>, eddie.dong@intel.com,
	Ian.Campbell@citrix.com, jun.nakajima@intel.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
	real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 08:07 +0000 on 16 Nov (1353053247), Jan Beulich wrote:
> I continue to not be in favor of special casing this in VMX code,
> considering that the problem is generic (i.e. similarly affects PV).
> I.e. either we handle the other case similarly (special code added
> also to the PV code path), or we deal with this in a single place,
> keeping the NMIs masked for an extended period of time.

Affects PV because PV might use SYSRET to return from the NMI handler?
Right.

> > All of this would be moot except for the risk that we might take an MCE
> > while in the NMI handler.  The IRET from the MCE handler re-enables NMIs
> > while we're still in the NMI handler, and a second NMI arriving could
> > break the NMI handler.  In the PV case, it will also clobber the NMI
> > handler's stack.
> 
> No - the entry code switches away from the dedicated stacks when
> the origin was in guest context (see handle_ist_exception in
> xen/arch/x86/x86_64/entry.S).

I see, thanks.  So it's only if we take the NMI while in the hypervisor
that we stay on the NMI stack and risk getting the stack clobbered.

> > We could potentially solve the problem by having the MCE handler check
> > whether it's returning to the NMI stack, and do a normal return in that
> > case.  It's a bit of extra code but only in the MCE handler, which is
> > not performance-critical. 
> 
> Yes, that could solve that nesting case (again not very difficult
> to implement).

How about we just have the MCE handler return without IRET in _all_
cases where it's returning to ring 0?  I think that entirely solves the
MCE-in-NMI problem, without all the extra mechanism meeded for the
linux-style solution.  (Unless we want to allow other traps in either
the NMI or MCE handlers).

[And it occurs to me that the linux-style solution is tricky because
detecting the case where you've taken an NMI and not yet set the
nmi-in-progress flag is hard in both SVM (in the NMI handler but on the
normal stack) and VMX (in the _vmexit_ handler and on the normal
stack).]

So I guess now I'm suggesting:
 - MCE never returns to Xen with IRET;
 - NMI handling in handle_vmexit() moves to beside the MCE handling;
 - Explicit IRET-to-self at the end of do_nmi() to unmask NMIs; and
 - no int $2. :)

How's that?  I feel sure I must have missed a case - itt sounds too
easy.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:03:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:03:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJhH-0006dv-GC; Fri, 16 Nov 2012 11:02:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZJhF-0006dp-PQ
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 11:02:53 +0000
Received: from [85.158.143.35:45077] by server-2.bemta-4.messagelabs.com id
	41/1F-28922-D5D16A05; Fri, 16 Nov 2012 11:02:53 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1353063691!10129083!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23924 invoked from network); 16 Nov 2012 11:01:31 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-21.messagelabs.com with SMTP;
	16 Nov 2012 11:01:31 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 11:01:31 +0000
Message-Id: <50A62B1A02000078000A9313@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 11:01:30 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>,
	"Dan Magenheimer" <dan.magenheimer@oracle.com>,
	"Keir Fraser" <keir@xen.org>,"TimDeegan" <tim@xen.org>
References: <373a7ea3-fd9b-4bec-9ef3-d6b51ab433c9@default>
In-Reply-To: <373a7ea3-fd9b-4bec-9ef3-d6b51ab433c9@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: KonradWilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH v4] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 00:52, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> --- a/tools/libxc/xc_domain.c
> +++ b/tools/libxc/xc_domain.c

Please put the tools side stuff in a separate second patch, even
if it's very small right now.

> @@ -685,6 +685,37 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>          break;
>      }
>  
> +    case XENMEM_claim_pages:
> +        if ( !(IS_PRIV(current->domain)) )

Pointless extra parens around a function call (or equivalent macro).

> +            return -EPERM;
> +
> +        if ( copy_from_guest(&reservation, arg, 1) )
> +            return -EFAULT;
> +
> +        if ( !(guest_handle_is_null(reservation.extent_start)) )

Pointless parens again.

> +            return -EINVAL;
> +
> +        if ( reservation.extent_order != 0 )
> +            return -EINVAL;
> +
> +        rc = rcu_lock_target_domain_by_id(reservation.domid, &d);

With the IS_PRIV() above, this ought to be
rcu_lock_domain_by_any_id() or, if creating claims for itself is
deemed pointless/bogus, rcu_lock_domain_by_id().

> +        if ( rc )
> +            return rc;

break;

> +
> +        rc = domain_set_unclaimed_pages(d, reservation.nr_extents,
> +                                        reservation.mem_flags);
> +
> +        rcu_unlock_domain(d);
> +
> +        break;
> +
> +    case XENMEM_get_unclaimed_pages:
> +        if ( !(IS_PRIV(current->domain)) )

Pointless parens again.

> +            return -EPERM;
> +
> +        rc = get_total_unclaimed_pages();
> +        break;
> +
>      default:
>          rc = arch_memory_op(op, arg);
>          break;
>...
> @@ -443,6 +548,15 @@ static struct page_info *alloc_heap_pages(
>      spin_lock(&heap_lock);
>  
>      /*
> +     * Claimed memory is considered unavailable unless the request
> +     * is made by a domain with sufficient unclaimed pages.
> +     */
> +    if ( (total_unclaimed_pages + request >
> +           total_avail_pages + tmem_freeable_pages()) &&

This line is indented on space too much (should align with the
first char inside the innermost common parens).

Jan

> +          (d == NULL || d->unclaimed_pages < request) )
> +        goto not_found;
> +
> +    /*
>       * TMEM: When available memory is scarce due to tmem absorbing it, allow
>       * only mid-size allocations to avoid worst of fragmentation issues.
>       * Others try tmem pools then fail.  This is a workaround until all



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:03:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:03:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJhH-0006dv-GC; Fri, 16 Nov 2012 11:02:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZJhF-0006dp-PQ
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 11:02:53 +0000
Received: from [85.158.143.35:45077] by server-2.bemta-4.messagelabs.com id
	41/1F-28922-D5D16A05; Fri, 16 Nov 2012 11:02:53 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1353063691!10129083!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23924 invoked from network); 16 Nov 2012 11:01:31 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-21.messagelabs.com with SMTP;
	16 Nov 2012 11:01:31 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 11:01:31 +0000
Message-Id: <50A62B1A02000078000A9313@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 11:01:30 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>,
	"Dan Magenheimer" <dan.magenheimer@oracle.com>,
	"Keir Fraser" <keir@xen.org>,"TimDeegan" <tim@xen.org>
References: <373a7ea3-fd9b-4bec-9ef3-d6b51ab433c9@default>
In-Reply-To: <373a7ea3-fd9b-4bec-9ef3-d6b51ab433c9@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: KonradWilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH v4] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 00:52, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> --- a/tools/libxc/xc_domain.c
> +++ b/tools/libxc/xc_domain.c

Please put the tools side stuff in a separate second patch, even
if it's very small right now.

> @@ -685,6 +685,37 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>          break;
>      }
>  
> +    case XENMEM_claim_pages:
> +        if ( !(IS_PRIV(current->domain)) )

Pointless extra parens around a function call (or equivalent macro).

> +            return -EPERM;
> +
> +        if ( copy_from_guest(&reservation, arg, 1) )
> +            return -EFAULT;
> +
> +        if ( !(guest_handle_is_null(reservation.extent_start)) )

Pointless parens again.

> +            return -EINVAL;
> +
> +        if ( reservation.extent_order != 0 )
> +            return -EINVAL;
> +
> +        rc = rcu_lock_target_domain_by_id(reservation.domid, &d);

With the IS_PRIV() above, this ought to be
rcu_lock_domain_by_any_id() or, if creating claims for itself is
deemed pointless/bogus, rcu_lock_domain_by_id().

> +        if ( rc )
> +            return rc;

break;

> +
> +        rc = domain_set_unclaimed_pages(d, reservation.nr_extents,
> +                                        reservation.mem_flags);
> +
> +        rcu_unlock_domain(d);
> +
> +        break;
> +
> +    case XENMEM_get_unclaimed_pages:
> +        if ( !(IS_PRIV(current->domain)) )

Pointless parens again.

> +            return -EPERM;
> +
> +        rc = get_total_unclaimed_pages();
> +        break;
> +
>      default:
>          rc = arch_memory_op(op, arg);
>          break;
>...
> @@ -443,6 +548,15 @@ static struct page_info *alloc_heap_pages(
>      spin_lock(&heap_lock);
>  
>      /*
> +     * Claimed memory is considered unavailable unless the request
> +     * is made by a domain with sufficient unclaimed pages.
> +     */
> +    if ( (total_unclaimed_pages + request >
> +           total_avail_pages + tmem_freeable_pages()) &&

This line is indented on space too much (should align with the
first char inside the innermost common parens).

Jan

> +          (d == NULL || d->unclaimed_pages < request) )
> +        goto not_found;
> +
> +    /*
>       * TMEM: When available memory is scarce due to tmem absorbing it, allow
>       * only mid-size allocations to avoid worst of fragmentation issues.
>       * Others try tmem pools then fail.  This is a workaround until all



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:13:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:13:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJqv-0006yb-NV; Fri, 16 Nov 2012 11:12:53 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <tushar.behera@linaro.org>) id 1TZFrm-0006iF-Av
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 06:57:30 +0000
Received: from [193.109.254.147:33342] by server-6.bemta-14.messagelabs.com id
	1B/50-02788-9D3E5A05; Fri, 16 Nov 2012 06:57:29 +0000
X-Env-Sender: tushar.behera@linaro.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353049047!4162923!1
X-Originating-IP: [209.85.160.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2615 invoked from network); 16 Nov 2012 06:57:28 -0000
Received: from mail-pb0-f43.google.com (HELO mail-pb0-f43.google.com)
	(209.85.160.43)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 06:57:28 -0000
Received: by mail-pb0-f43.google.com with SMTP id wz17so1849967pbc.30
	for <xen-devel@lists.xensource.com>;
	Thu, 15 Nov 2012 22:57:26 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references
	:x-gm-message-state;
	bh=uvplCML3OpI5Zo7pjs+XiT39MkRCujKMohinXnMuvA4=;
	b=Vu5/H9EEt5DmlGDEoWYTS9HIq+SPuYSKFwPuOdkoKw6CBEYbGDe2/zGVyhV0mpAhC2
	uz9izGeD4cRvKpyuRknS3gIzrqppPO84/bRsgqyjRg8r2S9vJWM7iv/ojuegUdI9nsxa
	Ex85iVkik2Lqf8ts0XTAIVXigZKwuIvz+j4qyeodlJuSL8Nm48VNz1UCVLR6G1+cdKVN
	AR2c/+4ocboanLnBxRHHY7qMz1JuPfyAk3UHko4ORsDbvOyGzIre/EujlSjf8dga/62J
	gxmSGncrnoxS4Em9yUPSfc/m1G6YQIyu/0D7GE5wqzj3tKrTpAtNUXSOqeymyEVjHc9q
	UNfg==
Received: by 10.66.80.166 with SMTP id s6mr10340982pax.21.1353049046845;
	Thu, 15 Nov 2012 22:57:26 -0800 (PST)
Received: from localhost.localdomain ([115.113.119.130])
	by mx.google.com with ESMTPS id mz10sm753915pbc.37.2012.11.15.22.57.23
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 15 Nov 2012 22:57:26 -0800 (PST)
From: Tushar Behera <tushar.behera@linaro.org>
To: linux-kernel@vger.kernel.org
Date: Fri, 16 Nov 2012 12:20:41 +0530
Message-Id: <1353048646-10935-10-git-send-email-tushar.behera@linaro.org>
X-Mailer: git-send-email 1.7.4.1
In-Reply-To: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
References: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
X-Gm-Message-State: ALoCoQl3n74cKLCYCSL5jRjIuJEwkhAvfaYcmXkWYpdq1TQ3EB+VBMOd8kIMupkCqKvKUV68rytL
X-Mailman-Approved-At: Fri, 16 Nov 2012 11:12:51 +0000
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com, patches@linaro.org
Subject: [Xen-devel] [PATCH 09/14] xen: events: Remove redundant check on
	unsigned variable
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

No need to check whether unsigned variable is less than 0.

CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: Jeremy Fitzhardinge <jeremy@goop.org>
CC: xen-devel@lists.xensource.com
CC: virtualization@lists.linux-foundation.org
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
 drivers/xen/events.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 4293c57..cadd7d1 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -216,7 +216,7 @@ static void xen_irq_info_pirq_init(unsigned irq,
  */
 static unsigned int evtchn_from_irq(unsigned irq)
 {
-	if (unlikely(WARN(irq < 0 || irq >= nr_irqs, "Invalid irq %d!\n", irq)))
+	if (unlikely(WARN(irq >= nr_irqs, "Invalid irq %d!\n", irq)))
 		return 0;
 
 	return info_for_irq(irq)->evtchn;
-- 
1.7.4.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:13:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:13:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJqv-0006yb-NV; Fri, 16 Nov 2012 11:12:53 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <tushar.behera@linaro.org>) id 1TZFrm-0006iF-Av
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 06:57:30 +0000
Received: from [193.109.254.147:33342] by server-6.bemta-14.messagelabs.com id
	1B/50-02788-9D3E5A05; Fri, 16 Nov 2012 06:57:29 +0000
X-Env-Sender: tushar.behera@linaro.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353049047!4162923!1
X-Originating-IP: [209.85.160.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2615 invoked from network); 16 Nov 2012 06:57:28 -0000
Received: from mail-pb0-f43.google.com (HELO mail-pb0-f43.google.com)
	(209.85.160.43)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 06:57:28 -0000
Received: by mail-pb0-f43.google.com with SMTP id wz17so1849967pbc.30
	for <xen-devel@lists.xensource.com>;
	Thu, 15 Nov 2012 22:57:26 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references
	:x-gm-message-state;
	bh=uvplCML3OpI5Zo7pjs+XiT39MkRCujKMohinXnMuvA4=;
	b=Vu5/H9EEt5DmlGDEoWYTS9HIq+SPuYSKFwPuOdkoKw6CBEYbGDe2/zGVyhV0mpAhC2
	uz9izGeD4cRvKpyuRknS3gIzrqppPO84/bRsgqyjRg8r2S9vJWM7iv/ojuegUdI9nsxa
	Ex85iVkik2Lqf8ts0XTAIVXigZKwuIvz+j4qyeodlJuSL8Nm48VNz1UCVLR6G1+cdKVN
	AR2c/+4ocboanLnBxRHHY7qMz1JuPfyAk3UHko4ORsDbvOyGzIre/EujlSjf8dga/62J
	gxmSGncrnoxS4Em9yUPSfc/m1G6YQIyu/0D7GE5wqzj3tKrTpAtNUXSOqeymyEVjHc9q
	UNfg==
Received: by 10.66.80.166 with SMTP id s6mr10340982pax.21.1353049046845;
	Thu, 15 Nov 2012 22:57:26 -0800 (PST)
Received: from localhost.localdomain ([115.113.119.130])
	by mx.google.com with ESMTPS id mz10sm753915pbc.37.2012.11.15.22.57.23
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 15 Nov 2012 22:57:26 -0800 (PST)
From: Tushar Behera <tushar.behera@linaro.org>
To: linux-kernel@vger.kernel.org
Date: Fri, 16 Nov 2012 12:20:41 +0530
Message-Id: <1353048646-10935-10-git-send-email-tushar.behera@linaro.org>
X-Mailer: git-send-email 1.7.4.1
In-Reply-To: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
References: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
X-Gm-Message-State: ALoCoQl3n74cKLCYCSL5jRjIuJEwkhAvfaYcmXkWYpdq1TQ3EB+VBMOd8kIMupkCqKvKUV68rytL
X-Mailman-Approved-At: Fri, 16 Nov 2012 11:12:51 +0000
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com, patches@linaro.org
Subject: [Xen-devel] [PATCH 09/14] xen: events: Remove redundant check on
	unsigned variable
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

No need to check whether unsigned variable is less than 0.

CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: Jeremy Fitzhardinge <jeremy@goop.org>
CC: xen-devel@lists.xensource.com
CC: virtualization@lists.linux-foundation.org
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
 drivers/xen/events.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 4293c57..cadd7d1 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -216,7 +216,7 @@ static void xen_irq_info_pirq_init(unsigned irq,
  */
 static unsigned int evtchn_from_irq(unsigned irq)
 {
-	if (unlikely(WARN(irq < 0 || irq >= nr_irqs, "Invalid irq %d!\n", irq)))
+	if (unlikely(WARN(irq >= nr_irqs, "Invalid irq %d!\n", irq)))
 		return 0;
 
 	return info_for_irq(irq)->evtchn;
-- 
1.7.4.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:13:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:13:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJqu-0006yN-Vo; Fri, 16 Nov 2012 11:12:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <tushar.behera@linaro.org>) id 1TZFrL-0006hc-DF
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 06:57:03 +0000
Received: from [85.158.143.35:23658] by server-3.bemta-4.messagelabs.com id
	CD/FA-06841-EB3E5A05; Fri, 16 Nov 2012 06:57:02 +0000
X-Env-Sender: tushar.behera@linaro.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1353049018!15465918!1
X-Originating-IP: [209.85.220.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16905 invoked from network); 16 Nov 2012 06:57:00 -0000
Received: from mail-pa0-f43.google.com (HELO mail-pa0-f43.google.com)
	(209.85.220.43)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 06:57:00 -0000
Received: by mail-pa0-f43.google.com with SMTP id fb1so1783701pad.30
	for <xen-devel@lists.xensource.com>;
	Thu, 15 Nov 2012 22:56:58 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state;
	bh=7GHimYhlXD5CIYSybRexPLXFypv1++BXckwMQqK4jts=;
	b=hE8457qWizcTlAtfN4+1dS/6ooRuGIHHR1t5QOmLKZR9R5vyofVIEdt60Ef0uh4SRn
	zCQkszUo2eXJIdRKB/qP5b9lqDAcFShVvz3Jvh6vKxOIdbR6vU79eBUfw1iNyRe6leTk
	LTXfpe+WCZn4EzUVKC8OKG37f7/DfZ8Pw3dtORu3zZ5OEkqy/Zthh+rEoMKthwI0tIuB
	3SZjTDHJvN7m59Ruk2CDUWScbjIMdVTlqMRFALu/P9M/ky4x0HfuaYhurQRBuarT9Lwy
	DFr9SE6hvlSx9UV3z76QmfP+TRQg1Ns/UxVIGSnbWpzl6RbdjpJUh5fkWcI99wBWxcfg
	vB2g==
Received: by 10.68.239.232 with SMTP id vv8mr6383414pbc.53.1353049017795;
	Thu, 15 Nov 2012 22:56:57 -0800 (PST)
Received: from localhost.localdomain ([115.113.119.130])
	by mx.google.com with ESMTPS id mz10sm753915pbc.37.2012.11.15.22.56.48
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 15 Nov 2012 22:56:56 -0800 (PST)
From: Tushar Behera <tushar.behera@linaro.org>
To: linux-kernel@vger.kernel.org
Date: Fri, 16 Nov 2012 12:20:32 +0530
Message-Id: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
X-Mailer: git-send-email 1.7.4.1
X-Gm-Message-State: ALoCoQnJYRmh2pcZZY/5TgVITe4yAaQzN9A6MzWUdT58ML5rkWD1hW0IFPSxOzERmMAUtJ9SlMs/
X-Mailman-Approved-At: Fri, 16 Nov 2012 11:12:51 +0000
Cc: Chas Williams <chas@cmf.nrl.navy.mil>, linux-input@vger.kernel.org,
	Jeremy Fitzhardinge <jeremy@goop.org>, Jack Steiner <steiner@sgi.com>,
	Ian Campbell <ian.campbell@citrix.com>, Arnd Bergmann <arnd@arndb.de>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Jiri Kosina <jkosina@suse.cz>,
	Linus Walleij <linus.walleij@linaro.org>, patches@linaro.org,
	linux-wireless@vger.kernel.org, ivtv-devel@ivtvdriver.org,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	linux-atm-general@lists.sourceforge.net,
	Luciano Coelho <coelho@ti.com>, netdev@vger.kernel.org,
	linux-usb@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com, linux-media@vger.kernel.org
Subject: [Xen-devel] [PATCH 00/14] Modify signed comparisons of unsigned
	variables
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The occurrences were identified through the coccinelle script at
following location.

http://www.emn.fr/z-info/coccinelle/rules/find_unsigned.cocci

Signed checks for unsigned variables are removed if it is also checked
for upper error limit. For error checks, IS_ERR_VALUE() macros is used.

Tushar Behera (14):
  [media] ivtv: Remove redundant check on unsigned variable
  [media] meye: Remove redundant check on unsigned variable
  [media] saa7134: Remove redundant check on unsigned variable
  [media] tlg2300: Remove redundant check on unsigned variable
  [media] atmel-isi: Update error check for unsigned variables
  pinctrl: samsung: Update error check for unsigned variables
  pinctrl: SPEAr: Update error check for unsigned variables
  xen: netback: Remove redundant check on unsigned variable
  xen: events: Remove redundant check on unsigned variable
  atm: Removed redundant check on unsigned variable
  HID: hiddev: Remove redundant check on unsigned variable
  gru: Remove redundant check on unsigned variable
  misc: tsl2550: Remove redundant check on unsigned variable
  wlcore: Remove redundant check on unsigned variable

 drivers/atm/fore200e.c                        |    2 +-
 drivers/hid/usbhid/hiddev.c                   |    2 +-
 drivers/media/pci/ivtv/ivtv-ioctl.c           |    2 +-
 drivers/media/pci/meye/meye.c                 |    2 +-
 drivers/media/pci/saa7134/saa7134-video.c     |    2 +-
 drivers/media/platform/soc_camera/atmel-isi.c |    2 +-
 drivers/media/usb/tlg2300/pd-video.c          |    2 +-
 drivers/misc/sgi-gru/grukdump.c               |    2 +-
 drivers/misc/tsl2550.c                        |    4 ++--
 drivers/net/wireless/ti/wlcore/debugfs.c      |    2 +-
 drivers/net/xen-netback/netback.c             |    4 ++--
 drivers/pinctrl/pinctrl-samsung.c             |    2 +-
 drivers/pinctrl/spear/pinctrl-plgpio.c        |    2 +-
 drivers/xen/events.c                          |    2 +-
 14 files changed, 16 insertions(+), 16 deletions(-)

-- 
1.7.4.1

CC: Mauro Carvalho Chehab <mchehab@infradead.org>
CC: Linus Walleij <linus.walleij@linaro.org>
CC: Ian Campbell <ian.campbell@citrix.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: Jeremy Fitzhardinge <jeremy@goop.org>
CC: Chas Williams <chas@cmf.nrl.navy.mil>
CC: Jack Steiner <steiner@sgi.com>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Luciano Coelho <coelho@ti.com>
CC: Jiri Kosina <jkosina@suse.cz>
CC: ivtv-devel@ivtvdriver.org
CC: linux-media@vger.kernel.org
CC: xen-devel@lists.xensource.com
CC: netdev@vger.kernel.org
CC: virtualization@lists.linux-foundation.org
CC: linux-atm-general@lists.sourceforge.net
CC: linux-usb@vger.kernel.org
CC: linux-input@vger.kernel.org
CC: linux-wireless@vger.kernel.org

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:13:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:13:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJqu-0006yN-Vo; Fri, 16 Nov 2012 11:12:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <tushar.behera@linaro.org>) id 1TZFrL-0006hc-DF
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 06:57:03 +0000
Received: from [85.158.143.35:23658] by server-3.bemta-4.messagelabs.com id
	CD/FA-06841-EB3E5A05; Fri, 16 Nov 2012 06:57:02 +0000
X-Env-Sender: tushar.behera@linaro.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1353049018!15465918!1
X-Originating-IP: [209.85.220.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16905 invoked from network); 16 Nov 2012 06:57:00 -0000
Received: from mail-pa0-f43.google.com (HELO mail-pa0-f43.google.com)
	(209.85.220.43)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 06:57:00 -0000
Received: by mail-pa0-f43.google.com with SMTP id fb1so1783701pad.30
	for <xen-devel@lists.xensource.com>;
	Thu, 15 Nov 2012 22:56:58 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state;
	bh=7GHimYhlXD5CIYSybRexPLXFypv1++BXckwMQqK4jts=;
	b=hE8457qWizcTlAtfN4+1dS/6ooRuGIHHR1t5QOmLKZR9R5vyofVIEdt60Ef0uh4SRn
	zCQkszUo2eXJIdRKB/qP5b9lqDAcFShVvz3Jvh6vKxOIdbR6vU79eBUfw1iNyRe6leTk
	LTXfpe+WCZn4EzUVKC8OKG37f7/DfZ8Pw3dtORu3zZ5OEkqy/Zthh+rEoMKthwI0tIuB
	3SZjTDHJvN7m59Ruk2CDUWScbjIMdVTlqMRFALu/P9M/ky4x0HfuaYhurQRBuarT9Lwy
	DFr9SE6hvlSx9UV3z76QmfP+TRQg1Ns/UxVIGSnbWpzl6RbdjpJUh5fkWcI99wBWxcfg
	vB2g==
Received: by 10.68.239.232 with SMTP id vv8mr6383414pbc.53.1353049017795;
	Thu, 15 Nov 2012 22:56:57 -0800 (PST)
Received: from localhost.localdomain ([115.113.119.130])
	by mx.google.com with ESMTPS id mz10sm753915pbc.37.2012.11.15.22.56.48
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 15 Nov 2012 22:56:56 -0800 (PST)
From: Tushar Behera <tushar.behera@linaro.org>
To: linux-kernel@vger.kernel.org
Date: Fri, 16 Nov 2012 12:20:32 +0530
Message-Id: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
X-Mailer: git-send-email 1.7.4.1
X-Gm-Message-State: ALoCoQnJYRmh2pcZZY/5TgVITe4yAaQzN9A6MzWUdT58ML5rkWD1hW0IFPSxOzERmMAUtJ9SlMs/
X-Mailman-Approved-At: Fri, 16 Nov 2012 11:12:51 +0000
Cc: Chas Williams <chas@cmf.nrl.navy.mil>, linux-input@vger.kernel.org,
	Jeremy Fitzhardinge <jeremy@goop.org>, Jack Steiner <steiner@sgi.com>,
	Ian Campbell <ian.campbell@citrix.com>, Arnd Bergmann <arnd@arndb.de>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Jiri Kosina <jkosina@suse.cz>,
	Linus Walleij <linus.walleij@linaro.org>, patches@linaro.org,
	linux-wireless@vger.kernel.org, ivtv-devel@ivtvdriver.org,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	linux-atm-general@lists.sourceforge.net,
	Luciano Coelho <coelho@ti.com>, netdev@vger.kernel.org,
	linux-usb@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com, linux-media@vger.kernel.org
Subject: [Xen-devel] [PATCH 00/14] Modify signed comparisons of unsigned
	variables
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The occurrences were identified through the coccinelle script at
following location.

http://www.emn.fr/z-info/coccinelle/rules/find_unsigned.cocci

Signed checks for unsigned variables are removed if it is also checked
for upper error limit. For error checks, IS_ERR_VALUE() macros is used.

Tushar Behera (14):
  [media] ivtv: Remove redundant check on unsigned variable
  [media] meye: Remove redundant check on unsigned variable
  [media] saa7134: Remove redundant check on unsigned variable
  [media] tlg2300: Remove redundant check on unsigned variable
  [media] atmel-isi: Update error check for unsigned variables
  pinctrl: samsung: Update error check for unsigned variables
  pinctrl: SPEAr: Update error check for unsigned variables
  xen: netback: Remove redundant check on unsigned variable
  xen: events: Remove redundant check on unsigned variable
  atm: Removed redundant check on unsigned variable
  HID: hiddev: Remove redundant check on unsigned variable
  gru: Remove redundant check on unsigned variable
  misc: tsl2550: Remove redundant check on unsigned variable
  wlcore: Remove redundant check on unsigned variable

 drivers/atm/fore200e.c                        |    2 +-
 drivers/hid/usbhid/hiddev.c                   |    2 +-
 drivers/media/pci/ivtv/ivtv-ioctl.c           |    2 +-
 drivers/media/pci/meye/meye.c                 |    2 +-
 drivers/media/pci/saa7134/saa7134-video.c     |    2 +-
 drivers/media/platform/soc_camera/atmel-isi.c |    2 +-
 drivers/media/usb/tlg2300/pd-video.c          |    2 +-
 drivers/misc/sgi-gru/grukdump.c               |    2 +-
 drivers/misc/tsl2550.c                        |    4 ++--
 drivers/net/wireless/ti/wlcore/debugfs.c      |    2 +-
 drivers/net/xen-netback/netback.c             |    4 ++--
 drivers/pinctrl/pinctrl-samsung.c             |    2 +-
 drivers/pinctrl/spear/pinctrl-plgpio.c        |    2 +-
 drivers/xen/events.c                          |    2 +-
 14 files changed, 16 insertions(+), 16 deletions(-)

-- 
1.7.4.1

CC: Mauro Carvalho Chehab <mchehab@infradead.org>
CC: Linus Walleij <linus.walleij@linaro.org>
CC: Ian Campbell <ian.campbell@citrix.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: Jeremy Fitzhardinge <jeremy@goop.org>
CC: Chas Williams <chas@cmf.nrl.navy.mil>
CC: Jack Steiner <steiner@sgi.com>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Luciano Coelho <coelho@ti.com>
CC: Jiri Kosina <jkosina@suse.cz>
CC: ivtv-devel@ivtvdriver.org
CC: linux-media@vger.kernel.org
CC: xen-devel@lists.xensource.com
CC: netdev@vger.kernel.org
CC: virtualization@lists.linux-foundation.org
CC: linux-atm-general@lists.sourceforge.net
CC: linux-usb@vger.kernel.org
CC: linux-input@vger.kernel.org
CC: linux-wireless@vger.kernel.org

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:13:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:13:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJqu-0006yG-Jd; Fri, 16 Nov 2012 11:12:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <topperxin@126.com>) id 1TYwIK-00086h-H0
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:03:36 +0000
Received: from [85.158.143.99:50497] by server-2.bemta-4.messagelabs.com id
	7A/FC-28922-7FDB4A05; Thu, 15 Nov 2012 10:03:35 +0000
X-Env-Sender: topperxin@126.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1352973791!22497633!1
X-Originating-IP: [220.181.15.35]
X-SpamReason: No, hits=0.6 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMjAuMTgxLjE1LjM1ID0+IDgwODQ=\n,sa_preprocessor: 
	QmFkIElQOiAyMjAuMTgxLjE1LjM1ID0+IDgwODQ=\n,HTML_40_50,HTML_MESSAGE
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23460 invoked from network); 15 Nov 2012 10:03:13 -0000
Received: from m15-35.126.com (HELO m15-35.126.com) (220.181.15.35)
	by server-11.tower-216.messagelabs.com with SMTP;
	15 Nov 2012 10:03:13 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com;
	s=s110527; h=Received:Date:From:To:Subject:Content-Type:
	MIME-Version:Message-ID; bh=2dIlp1G4+ZglBplXBZSigz7SnSUT9DZYv7GU
	9OhIHlE=; b=Hn4iPUhAJEG+tGtW+FNhi7XgnOF/SJy6CLLa9SasNZEbo7+eRvlB
	RCJK692b/Vw5KOfiPNxpo3gIDYI3pXcf3UXt/X4do833kxFnJN8w3np3YfsPx3G3
	IWA3xnqVUswpYQZNJeyvWnpWteC+TvrFkFShSDUILoe8dy4x1gkYPlQ=
Received: from topperxin$126.com ( [118.186.200.82] ) by
	ajax-webmail-wmsvr35 (Coremail) ; Thu, 15 Nov 2012 18:03:08 +0800 (CST)
X-Originating-IP: [118.186.200.82]
Date: Thu, 15 Nov 2012 18:03:08 +0800 (CST)
From: topperxin <topperxin@126.com>
To: xen-devel <xen-devel@lists.xensource.com>
X-Priority: 3
X-Mailer: Coremail Webmail Server Version SP_ntes V3.5 build
	20121107(20462.5035.5036) Copyright (c) 2002-2012 www.mailtech.cn
	126com
X-CM-CTRLDATA: aF1PS2Zvb3Rlcl9odG09MTk4MDo4MQ==
MIME-Version: 1.0
Message-ID: <441f73eb.139b7.13b0385a52a.Coremail.topperxin@126.com>
X-CM-TRANSID: I8qowEC5RkDdvaRQK+pmAA--.601W
X-CM-SenderInfo: xwrs1vhu0l0qqrswhudrp/1tbi4h1oDkkZtykRdAAAsy
X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU==
X-Mailman-Approved-At: Fri, 16 Nov 2012 11:12:51 +0000
Subject: [Xen-devel] Question about Virtual NIC I/O performance
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6435935127794309050=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6435935127794309050==
Content-Type: multipart/alternative; 
	boundary="----=_Part_300723_920511020.1352973788458"

------=_Part_300723_920511020.1352973788458
Content-Type: text/plain; charset=GBK
Content-Transfer-Encoding: 7bit

Hi all
       Now I'm studying the Virtual NIC I/O performance, I have some questions
       1:
       For 1G NIC, such as Intel 82576, if I use pv driver as the VM NIC driver, for the best case, 
       I can get a good performance, maybe 900M bps
       So we can say the pv driver's performance is very good.
       While when I use 10G NIC, such as Intel 82599,  still use the pv driver as the VM NIC driver,
       the I/O performance is very bad, there is only 2G bps, the testing environment is simple, one vm on one host.
       So, may I draw a conclusion that PV driver not suitable for 10G NIC?
       Who can tell me the reason?
       2:
       For 10G NIC, Intel 82599, if I open the SR-IOV function, I can get a good performance in the vm, 
       it's nearly to 9.2G bps
       3:
       We all know AWS's EC2 instance are based on XEN.
       I launched the instance which provide the 10G performance I/O
       I tested and got the best performance the 6.3G bps
       I checked the driver of the VM's NIC, it's PV driver, not the SR-IOV
       How does AWS can use PV driver on 10G NIC get 6.3G bps performance? It's very good, I think


       Any discussion are welcome
       Best Regards
       Lixin Niu   
------=_Part_300723_920511020.1352973788458
Content-Type: text/html; charset=GBK
Content-Transfer-Encoding: 7bit

<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">Hi all<div>&nbsp; &nbsp; &nbsp; &nbsp;Now I'm studying the Virtual NIC I/O performance, I have some questions</div><div>&nbsp; &nbsp; &nbsp; &nbsp;1:</div><div>&nbsp; &nbsp; &nbsp; &nbsp;For 1G NIC, such as Intel 82576, if I use pv driver as the VM NIC driver, for the best case,&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;I can get a good performance, maybe 900M bps</div><div>&nbsp; &nbsp; &nbsp; &nbsp;So we can say the pv driver's performance is very good.</div><div>&nbsp; &nbsp; &nbsp; &nbsp;While when I use 10G NIC, such as Intel 82599, &nbsp;still use the pv driver as the VM NIC driver,</div><div>&nbsp; &nbsp; &nbsp; &nbsp;the I/O performance is very bad, there is only 2G bps, the testing environment is simple, one vm on one host.</div><div>&nbsp; &nbsp; &nbsp; &nbsp;So, may I draw a conclusion that PV driver not suitable for 10G NIC?</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Who can tell me the reason?</div><div>&nbsp; &nbsp; &nbsp; &nbsp;2:</div><div>&nbsp; &nbsp; &nbsp; &nbsp;For 10G NIC, Intel 82599, if I open the SR-IOV function, I can get a good performance in the vm,&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;it's nearly to 9.2G bps</div><div>&nbsp; &nbsp; &nbsp; &nbsp;3:</div><div>&nbsp; &nbsp; &nbsp; &nbsp;We all know AWS's EC2 instance are based on XEN.</div><div>&nbsp; &nbsp; &nbsp; &nbsp;I launched the instance which provide the 10G performance I/O</div><div>&nbsp; &nbsp; &nbsp; &nbsp;I tested and got the best performance the 6.3G bps</div><div>&nbsp; &nbsp; &nbsp; &nbsp;I checked the driver of the VM's NIC, it's PV driver, not the SR-IOV</div><div>&nbsp; &nbsp; &nbsp; &nbsp;How does AWS can use PV driver on 10G NIC get 6.3G bps performance? It's very good, I think</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp;Any discussion are welcome</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Best Regards</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Lixin Niu &nbsp;&nbsp;</div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>
------=_Part_300723_920511020.1352973788458--



--===============6435935127794309050==
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.xen.org
http://lists.xen.org/xen-devel

--===============6435935127794309050==--



From xen-devel-bounces@lists.xen.org Fri Nov 16 11:13:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:13:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJqu-0006yG-Jd; Fri, 16 Nov 2012 11:12:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <topperxin@126.com>) id 1TYwIK-00086h-H0
	for xen-devel@lists.xensource.com; Thu, 15 Nov 2012 10:03:36 +0000
Received: from [85.158.143.99:50497] by server-2.bemta-4.messagelabs.com id
	7A/FC-28922-7FDB4A05; Thu, 15 Nov 2012 10:03:35 +0000
X-Env-Sender: topperxin@126.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1352973791!22497633!1
X-Originating-IP: [220.181.15.35]
X-SpamReason: No, hits=0.6 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMjAuMTgxLjE1LjM1ID0+IDgwODQ=\n,sa_preprocessor: 
	QmFkIElQOiAyMjAuMTgxLjE1LjM1ID0+IDgwODQ=\n,HTML_40_50,HTML_MESSAGE
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23460 invoked from network); 15 Nov 2012 10:03:13 -0000
Received: from m15-35.126.com (HELO m15-35.126.com) (220.181.15.35)
	by server-11.tower-216.messagelabs.com with SMTP;
	15 Nov 2012 10:03:13 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com;
	s=s110527; h=Received:Date:From:To:Subject:Content-Type:
	MIME-Version:Message-ID; bh=2dIlp1G4+ZglBplXBZSigz7SnSUT9DZYv7GU
	9OhIHlE=; b=Hn4iPUhAJEG+tGtW+FNhi7XgnOF/SJy6CLLa9SasNZEbo7+eRvlB
	RCJK692b/Vw5KOfiPNxpo3gIDYI3pXcf3UXt/X4do833kxFnJN8w3np3YfsPx3G3
	IWA3xnqVUswpYQZNJeyvWnpWteC+TvrFkFShSDUILoe8dy4x1gkYPlQ=
Received: from topperxin$126.com ( [118.186.200.82] ) by
	ajax-webmail-wmsvr35 (Coremail) ; Thu, 15 Nov 2012 18:03:08 +0800 (CST)
X-Originating-IP: [118.186.200.82]
Date: Thu, 15 Nov 2012 18:03:08 +0800 (CST)
From: topperxin <topperxin@126.com>
To: xen-devel <xen-devel@lists.xensource.com>
X-Priority: 3
X-Mailer: Coremail Webmail Server Version SP_ntes V3.5 build
	20121107(20462.5035.5036) Copyright (c) 2002-2012 www.mailtech.cn
	126com
X-CM-CTRLDATA: aF1PS2Zvb3Rlcl9odG09MTk4MDo4MQ==
MIME-Version: 1.0
Message-ID: <441f73eb.139b7.13b0385a52a.Coremail.topperxin@126.com>
X-CM-TRANSID: I8qowEC5RkDdvaRQK+pmAA--.601W
X-CM-SenderInfo: xwrs1vhu0l0qqrswhudrp/1tbi4h1oDkkZtykRdAAAsy
X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU==
X-Mailman-Approved-At: Fri, 16 Nov 2012 11:12:51 +0000
Subject: [Xen-devel] Question about Virtual NIC I/O performance
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6435935127794309050=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6435935127794309050==
Content-Type: multipart/alternative; 
	boundary="----=_Part_300723_920511020.1352973788458"

------=_Part_300723_920511020.1352973788458
Content-Type: text/plain; charset=GBK
Content-Transfer-Encoding: 7bit

Hi all
       Now I'm studying the Virtual NIC I/O performance, I have some questions
       1:
       For 1G NIC, such as Intel 82576, if I use pv driver as the VM NIC driver, for the best case, 
       I can get a good performance, maybe 900M bps
       So we can say the pv driver's performance is very good.
       While when I use 10G NIC, such as Intel 82599,  still use the pv driver as the VM NIC driver,
       the I/O performance is very bad, there is only 2G bps, the testing environment is simple, one vm on one host.
       So, may I draw a conclusion that PV driver not suitable for 10G NIC?
       Who can tell me the reason?
       2:
       For 10G NIC, Intel 82599, if I open the SR-IOV function, I can get a good performance in the vm, 
       it's nearly to 9.2G bps
       3:
       We all know AWS's EC2 instance are based on XEN.
       I launched the instance which provide the 10G performance I/O
       I tested and got the best performance the 6.3G bps
       I checked the driver of the VM's NIC, it's PV driver, not the SR-IOV
       How does AWS can use PV driver on 10G NIC get 6.3G bps performance? It's very good, I think


       Any discussion are welcome
       Best Regards
       Lixin Niu   
------=_Part_300723_920511020.1352973788458
Content-Type: text/html; charset=GBK
Content-Transfer-Encoding: 7bit

<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">Hi all<div>&nbsp; &nbsp; &nbsp; &nbsp;Now I'm studying the Virtual NIC I/O performance, I have some questions</div><div>&nbsp; &nbsp; &nbsp; &nbsp;1:</div><div>&nbsp; &nbsp; &nbsp; &nbsp;For 1G NIC, such as Intel 82576, if I use pv driver as the VM NIC driver, for the best case,&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;I can get a good performance, maybe 900M bps</div><div>&nbsp; &nbsp; &nbsp; &nbsp;So we can say the pv driver's performance is very good.</div><div>&nbsp; &nbsp; &nbsp; &nbsp;While when I use 10G NIC, such as Intel 82599, &nbsp;still use the pv driver as the VM NIC driver,</div><div>&nbsp; &nbsp; &nbsp; &nbsp;the I/O performance is very bad, there is only 2G bps, the testing environment is simple, one vm on one host.</div><div>&nbsp; &nbsp; &nbsp; &nbsp;So, may I draw a conclusion that PV driver not suitable for 10G NIC?</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Who can tell me the reason?</div><div>&nbsp; &nbsp; &nbsp; &nbsp;2:</div><div>&nbsp; &nbsp; &nbsp; &nbsp;For 10G NIC, Intel 82599, if I open the SR-IOV function, I can get a good performance in the vm,&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;it's nearly to 9.2G bps</div><div>&nbsp; &nbsp; &nbsp; &nbsp;3:</div><div>&nbsp; &nbsp; &nbsp; &nbsp;We all know AWS's EC2 instance are based on XEN.</div><div>&nbsp; &nbsp; &nbsp; &nbsp;I launched the instance which provide the 10G performance I/O</div><div>&nbsp; &nbsp; &nbsp; &nbsp;I tested and got the best performance the 6.3G bps</div><div>&nbsp; &nbsp; &nbsp; &nbsp;I checked the driver of the VM's NIC, it's PV driver, not the SR-IOV</div><div>&nbsp; &nbsp; &nbsp; &nbsp;How does AWS can use PV driver on 10G NIC get 6.3G bps performance? It's very good, I think</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp;Any discussion are welcome</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Best Regards</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Lixin Niu &nbsp;&nbsp;</div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>
------=_Part_300723_920511020.1352973788458--



--===============6435935127794309050==
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.xen.org
http://lists.xen.org/xen-devel

--===============6435935127794309050==--



From xen-devel-bounces@lists.xen.org Fri Nov 16 11:13:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:13:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJqv-0006yU-BB; Fri, 16 Nov 2012 11:12:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <tushar.behera@linaro.org>) id 1TZFrh-0006hx-95
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 06:57:25 +0000
Received: from [85.158.143.35:24301] by server-3.bemta-4.messagelabs.com id
	C4/4B-06841-4D3E5A05; Fri, 16 Nov 2012 06:57:24 +0000
X-Env-Sender: tushar.behera@linaro.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1353049018!15465918!2
X-Originating-IP: [209.85.220.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17494 invoked from network); 16 Nov 2012 06:57:23 -0000
Received: from mail-pa0-f43.google.com (HELO mail-pa0-f43.google.com)
	(209.85.220.43)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 06:57:23 -0000
Received: by mail-pa0-f43.google.com with SMTP id fb1so1783701pad.30
	for <xen-devel@lists.xensource.com>;
	Thu, 15 Nov 2012 22:57:23 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references
	:x-gm-message-state;
	bh=8yH5qS1oFroUW7Mo5h9czFq3lYMIRi+URgRadlXp2HM=;
	b=HNHlXtEYAx+g/giD3ok4s+WmwxK3+oRkyYv4qShKaJeDUxoS5RMM6iuFAORdw/80o5
	eNllx2ELsu1RIuTydPI3ebjzNlYqeZqZDiQ5z83skjLMuCWZljHh4P4YzJ9TJ659axdd
	qiE3sFFsj5PMknN8SvF6i5YvfN6s+O8z/aDUOXPp+Y0605Yg2LUaQMgUcaLBQ55/3M21
	8q64S7ZAE9UHTjjZjKAQwNUZbOyDmNbfu3YsL1eL7WQ956AxKWXjUoi2NRThPqs1BfPP
	b9BfTNKcMA0T2nQwUXIXpOoFSPgFEY8NLua+8uxTuhdD+dLLPjuUwQJ7yVKD+YfvOUWH
	u7sA==
Received: by 10.68.231.3 with SMTP id tc3mr12178530pbc.89.1353049043455;
	Thu, 15 Nov 2012 22:57:23 -0800 (PST)
Received: from localhost.localdomain ([115.113.119.130])
	by mx.google.com with ESMTPS id mz10sm753915pbc.37.2012.11.15.22.57.19
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 15 Nov 2012 22:57:22 -0800 (PST)
From: Tushar Behera <tushar.behera@linaro.org>
To: linux-kernel@vger.kernel.org
Date: Fri, 16 Nov 2012 12:20:40 +0530
Message-Id: <1353048646-10935-9-git-send-email-tushar.behera@linaro.org>
X-Mailer: git-send-email 1.7.4.1
In-Reply-To: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
References: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
X-Gm-Message-State: ALoCoQnRm1/xE/RYmRuEdWDqT8Wwn+std7ucFVcGx/Oc/mJiNGi8GVtPuzhN2uwwkkwhSMACzq+0
X-Mailman-Approved-At: Fri, 16 Nov 2012 11:12:51 +0000
Cc: netdev@vger.kernel.org, xen-devel@lists.xensource.com,
	Ian Campbell <ian.campbell@citrix.com>, patches@linaro.org
Subject: [Xen-devel] [PATCH 08/14] xen: netback: Remove redundant check on
	unsigned variable
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

No need to check whether unsigned variable is less than 0.

CC: Ian Campbell <ian.campbell@citrix.com>
CC: xen-devel@lists.xensource.com
CC: netdev@vger.kernel.org
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
 drivers/net/xen-netback/netback.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index aab8677..515e10c 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -190,14 +190,14 @@ static int get_page_ext(struct page *pg,
 
 	group = ext.e.group - 1;
 
-	if (group < 0 || group >= xen_netbk_group_nr)
+	if (group >= xen_netbk_group_nr)
 		return 0;
 
 	netbk = &xen_netbk[group];
 
 	idx = ext.e.idx;
 
-	if ((idx < 0) || (idx >= MAX_PENDING_REQS))
+	if (idx >= MAX_PENDING_REQS)
 		return 0;
 
 	if (netbk->mmap_pages[idx] != pg)
-- 
1.7.4.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:13:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:13:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZJqv-0006yU-BB; Fri, 16 Nov 2012 11:12:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <tushar.behera@linaro.org>) id 1TZFrh-0006hx-95
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 06:57:25 +0000
Received: from [85.158.143.35:24301] by server-3.bemta-4.messagelabs.com id
	C4/4B-06841-4D3E5A05; Fri, 16 Nov 2012 06:57:24 +0000
X-Env-Sender: tushar.behera@linaro.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1353049018!15465918!2
X-Originating-IP: [209.85.220.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17494 invoked from network); 16 Nov 2012 06:57:23 -0000
Received: from mail-pa0-f43.google.com (HELO mail-pa0-f43.google.com)
	(209.85.220.43)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 06:57:23 -0000
Received: by mail-pa0-f43.google.com with SMTP id fb1so1783701pad.30
	for <xen-devel@lists.xensource.com>;
	Thu, 15 Nov 2012 22:57:23 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references
	:x-gm-message-state;
	bh=8yH5qS1oFroUW7Mo5h9czFq3lYMIRi+URgRadlXp2HM=;
	b=HNHlXtEYAx+g/giD3ok4s+WmwxK3+oRkyYv4qShKaJeDUxoS5RMM6iuFAORdw/80o5
	eNllx2ELsu1RIuTydPI3ebjzNlYqeZqZDiQ5z83skjLMuCWZljHh4P4YzJ9TJ659axdd
	qiE3sFFsj5PMknN8SvF6i5YvfN6s+O8z/aDUOXPp+Y0605Yg2LUaQMgUcaLBQ55/3M21
	8q64S7ZAE9UHTjjZjKAQwNUZbOyDmNbfu3YsL1eL7WQ956AxKWXjUoi2NRThPqs1BfPP
	b9BfTNKcMA0T2nQwUXIXpOoFSPgFEY8NLua+8uxTuhdD+dLLPjuUwQJ7yVKD+YfvOUWH
	u7sA==
Received: by 10.68.231.3 with SMTP id tc3mr12178530pbc.89.1353049043455;
	Thu, 15 Nov 2012 22:57:23 -0800 (PST)
Received: from localhost.localdomain ([115.113.119.130])
	by mx.google.com with ESMTPS id mz10sm753915pbc.37.2012.11.15.22.57.19
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 15 Nov 2012 22:57:22 -0800 (PST)
From: Tushar Behera <tushar.behera@linaro.org>
To: linux-kernel@vger.kernel.org
Date: Fri, 16 Nov 2012 12:20:40 +0530
Message-Id: <1353048646-10935-9-git-send-email-tushar.behera@linaro.org>
X-Mailer: git-send-email 1.7.4.1
In-Reply-To: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
References: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
X-Gm-Message-State: ALoCoQnRm1/xE/RYmRuEdWDqT8Wwn+std7ucFVcGx/Oc/mJiNGi8GVtPuzhN2uwwkkwhSMACzq+0
X-Mailman-Approved-At: Fri, 16 Nov 2012 11:12:51 +0000
Cc: netdev@vger.kernel.org, xen-devel@lists.xensource.com,
	Ian Campbell <ian.campbell@citrix.com>, patches@linaro.org
Subject: [Xen-devel] [PATCH 08/14] xen: netback: Remove redundant check on
	unsigned variable
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

No need to check whether unsigned variable is less than 0.

CC: Ian Campbell <ian.campbell@citrix.com>
CC: xen-devel@lists.xensource.com
CC: netdev@vger.kernel.org
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
 drivers/net/xen-netback/netback.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index aab8677..515e10c 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -190,14 +190,14 @@ static int get_page_ext(struct page *pg,
 
 	group = ext.e.group - 1;
 
-	if (group < 0 || group >= xen_netbk_group_nr)
+	if (group >= xen_netbk_group_nr)
 		return 0;
 
 	netbk = &xen_netbk[group];
 
 	idx = ext.e.idx;
 
-	if ((idx < 0) || (idx >= MAX_PENDING_REQS))
+	if (idx >= MAX_PENDING_REQS)
 		return 0;
 
 	if (netbk->mmap_pages[idx] != pg)
-- 
1.7.4.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:23:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:23:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZK0p-0007fH-Se; Fri, 16 Nov 2012 11:23:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZK0n-0007fC-Vl
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 11:23:06 +0000
Received: from [85.158.138.51:59110] by server-7.bemta-3.messagelabs.com id
	28/4F-01713-91226A05; Fri, 16 Nov 2012 11:23:05 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353064984!30353283!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8132 invoked from network); 16 Nov 2012 11:23:04 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 11:23:04 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 11:23:04 +0000
Message-Id: <50A6302802000078000A933C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 11:23:04 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A6024F02000078000A9214@nat28.tlf.novell.com>
	<20121116105622.GA89551@ocelot.phlegethon.org>
In-Reply-To: <20121116105622.GA89551@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>, eddie.dong@intel.com,
	Ian.Campbell@citrix.com, jun.nakajima@intel.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 11:56, Tim Deegan <tim@xen.org> wrote:
> At 08:07 +0000 on 16 Nov (1353053247), Jan Beulich wrote:
>> > We could potentially solve the problem by having the MCE handler check
>> > whether it's returning to the NMI stack, and do a normal return in that
>> > case.  It's a bit of extra code but only in the MCE handler, which is
>> > not performance-critical. 
>> 
>> Yes, that could solve that nesting case (again not very difficult
>> to implement).
> 
> How about we just have the MCE handler return without IRET in _all_
> cases where it's returning to ring 0?  I think that entirely solves the
> MCE-in-NMI problem, without all the extra mechanism meeded for the
> linux-style solution.

Good suggestion.

>  (Unless we want to allow other traps in either
> the NMI or MCE handlers).

We should absolutely avoid that.

> [And it occurs to me that the linux-style solution is tricky because
> detecting the case where you've taken an NMI and not yet set the
> nmi-in-progress flag is hard in both SVM (in the NMI handler but on the
> normal stack) and VMX (in the _vmexit_ handler and on the normal
> stack).]

Agreed.

> So I guess now I'm suggesting:
>  - MCE never returns to Xen with IRET;

Yes. But that might need care with regard to EFI runtime services
(or maybe not, as we're, at least at present, not switching stacks
there). Nevertheless, to be on the safe side, we could restrict
avoiding the IRET to "Ring 0 and RIP in hypervisor space", as we
know we won't have interrupted the NMI handler if that's not the
case.

>  - NMI handling in handle_vmexit() moves to beside the MCE handling;

Yes.

>  - Explicit IRET-to-self at the end of do_nmi() to unmask NMIs; and

This IRET must then switch to the normal stack, if currently on
the NMI one, which might be a little tricky/fragile.

But then again we're on the NMI one only when we got there
from hypervisor context, and in that specific case we return
without handling softirqs anyway. So perhaps the stack switch
isn't needed, but the IRET-to-self must only be done when the
origin wasn't in hypervisor context.

>  - no int $2. :)

Yippee.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:23:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:23:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZK0p-0007fH-Se; Fri, 16 Nov 2012 11:23:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZK0n-0007fC-Vl
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 11:23:06 +0000
Received: from [85.158.138.51:59110] by server-7.bemta-3.messagelabs.com id
	28/4F-01713-91226A05; Fri, 16 Nov 2012 11:23:05 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353064984!30353283!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8132 invoked from network); 16 Nov 2012 11:23:04 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 11:23:04 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 11:23:04 +0000
Message-Id: <50A6302802000078000A933C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 11:23:04 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A6024F02000078000A9214@nat28.tlf.novell.com>
	<20121116105622.GA89551@ocelot.phlegethon.org>
In-Reply-To: <20121116105622.GA89551@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>, eddie.dong@intel.com,
	Ian.Campbell@citrix.com, jun.nakajima@intel.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 11:56, Tim Deegan <tim@xen.org> wrote:
> At 08:07 +0000 on 16 Nov (1353053247), Jan Beulich wrote:
>> > We could potentially solve the problem by having the MCE handler check
>> > whether it's returning to the NMI stack, and do a normal return in that
>> > case.  It's a bit of extra code but only in the MCE handler, which is
>> > not performance-critical. 
>> 
>> Yes, that could solve that nesting case (again not very difficult
>> to implement).
> 
> How about we just have the MCE handler return without IRET in _all_
> cases where it's returning to ring 0?  I think that entirely solves the
> MCE-in-NMI problem, without all the extra mechanism meeded for the
> linux-style solution.

Good suggestion.

>  (Unless we want to allow other traps in either
> the NMI or MCE handlers).

We should absolutely avoid that.

> [And it occurs to me that the linux-style solution is tricky because
> detecting the case where you've taken an NMI and not yet set the
> nmi-in-progress flag is hard in both SVM (in the NMI handler but on the
> normal stack) and VMX (in the _vmexit_ handler and on the normal
> stack).]

Agreed.

> So I guess now I'm suggesting:
>  - MCE never returns to Xen with IRET;

Yes. But that might need care with regard to EFI runtime services
(or maybe not, as we're, at least at present, not switching stacks
there). Nevertheless, to be on the safe side, we could restrict
avoiding the IRET to "Ring 0 and RIP in hypervisor space", as we
know we won't have interrupted the NMI handler if that's not the
case.

>  - NMI handling in handle_vmexit() moves to beside the MCE handling;

Yes.

>  - Explicit IRET-to-self at the end of do_nmi() to unmask NMIs; and

This IRET must then switch to the normal stack, if currently on
the NMI one, which might be a little tricky/fragile.

But then again we're on the NMI one only when we got there
from hypervisor context, and in that specific case we return
without handling softirqs anyway. So perhaps the stack switch
isn't needed, but the IRET-to-self must only be done when the
origin wasn't in hypervisor context.

>  - no int $2. :)

Yippee.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:35:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:35:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZKCG-00080o-9W; Fri, 16 Nov 2012 11:34:56 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZKCF-00080j-6I
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 11:34:55 +0000
Received: from [85.158.138.51:17059] by server-4.bemta-3.messagelabs.com id
	BE/5C-30023-ED426A05; Fri, 16 Nov 2012 11:34:54 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1353065692!22360424!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2ODgwNw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16536 invoked from network); 16 Nov 2012 11:34:53 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-12.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 11:34:53 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGBYnYZ023882
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 11:34:50 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGBYm60001714
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 11:34:49 GMT
Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGBYm1w003028; Fri, 16 Nov 2012 05:34:48 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 03:34:48 -0800
Message-ID: <50A624D6.2010905@oracle.com>
Date: Fri, 16 Nov 2012 19:34:46 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963066-570-1-git-send-email-annie.li@oracle.com>
	<50A4BC7D.6060707@citrix.com> <50A5A9CF.8030008@oracle.com>
	<1353058363.3499.171.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353058363.3499.171.camel@zakaz.uk.xensource.com>
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent
 grant with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-16 17:32, Ian Campbell wrote:
> On Fri, 2012-11-16 at 02:49 +0000, ANNIE LI wrote:
>>> Take a look at the following functions from blkback; foreach_grant,
>>> add_persistent_gnt and get_persistent_gnt. They are generic functions to
>>> deal with persistent grants.
>> Ok, thanks.
>> Or moving those functions into a separate common file?
> Please put them somewhere common.

Ok.

>>> This is highly inefficient, one of the points of using gnttab_set_map_op
>>> is that you can queue a bunch of grants, and then map them at the same
>>> time using gnttab_map_refs, but here you are using it to map a single
>>> grant at a time. You should instead see how much grants you need to map
>>> to complete the request and map them all at the same time.
>> Yes, it is inefficient here. But this is limited by current netback
>> implementation. Current netback is not per-VIF based(not like blkback
>> does). After combining persistent grant and non persistent grant
>> together, every vif request in the queue may/may not support persistent
>> grant. I have to judge whether every vif in the queue supports
>> persistent grant or not. If it support, memcpy is used, if not,
>> grantcopy is used.
> You could (and should) still batch all the grant copies into one
> hypercall, e.g. walk the list either doing memcpy or queuing up copyops
> as appropriate, then at the end if the queue is non-zero length issue
> the hypercall.

This still connects with netback per-VIF implementation.

> I'd expect this lack of batching here and in the other case I just
> spotted to have a detrimental affect on guests running with this patch
> but not using persistent grants. Did you benchmark that case?

I did some test before.
But I'd better to create more detailed result under in different case.

>> After making netback per-VIF works, this issue can be fixed.
> You've mentioned improvements which are conditional on this work a few
> times I think, perhaps it makes sense to make that change first?

Yes, I did consider to implement per-VIF first before persistent grant. 
But thinking of it is part of wei's patch and combined with other 
patches, and decided to implement it later. But making the change first 
would make things more clear.

Thanks
Annie
> Ian.
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message tomajordomo@vger.kernel.org
> More majordomo info athttp://vger.kernel.org/majordomo-info.html

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:35:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:35:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZKCG-00080o-9W; Fri, 16 Nov 2012 11:34:56 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZKCF-00080j-6I
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 11:34:55 +0000
Received: from [85.158.138.51:17059] by server-4.bemta-3.messagelabs.com id
	BE/5C-30023-ED426A05; Fri, 16 Nov 2012 11:34:54 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1353065692!22360424!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2ODgwNw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16536 invoked from network); 16 Nov 2012 11:34:53 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-12.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 11:34:53 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGBYnYZ023882
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 11:34:50 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGBYm60001714
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 11:34:49 GMT
Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGBYm1w003028; Fri, 16 Nov 2012 05:34:48 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 03:34:48 -0800
Message-ID: <50A624D6.2010905@oracle.com>
Date: Fri, 16 Nov 2012 19:34:46 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1352963066-570-1-git-send-email-annie.li@oracle.com>
	<50A4BC7D.6060707@citrix.com> <50A5A9CF.8030008@oracle.com>
	<1353058363.3499.171.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353058363.3499.171.camel@zakaz.uk.xensource.com>
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent
 grant with one page pool.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-16 17:32, Ian Campbell wrote:
> On Fri, 2012-11-16 at 02:49 +0000, ANNIE LI wrote:
>>> Take a look at the following functions from blkback; foreach_grant,
>>> add_persistent_gnt and get_persistent_gnt. They are generic functions to
>>> deal with persistent grants.
>> Ok, thanks.
>> Or moving those functions into a separate common file?
> Please put them somewhere common.

Ok.

>>> This is highly inefficient, one of the points of using gnttab_set_map_op
>>> is that you can queue a bunch of grants, and then map them at the same
>>> time using gnttab_map_refs, but here you are using it to map a single
>>> grant at a time. You should instead see how much grants you need to map
>>> to complete the request and map them all at the same time.
>> Yes, it is inefficient here. But this is limited by current netback
>> implementation. Current netback is not per-VIF based(not like blkback
>> does). After combining persistent grant and non persistent grant
>> together, every vif request in the queue may/may not support persistent
>> grant. I have to judge whether every vif in the queue supports
>> persistent grant or not. If it support, memcpy is used, if not,
>> grantcopy is used.
> You could (and should) still batch all the grant copies into one
> hypercall, e.g. walk the list either doing memcpy or queuing up copyops
> as appropriate, then at the end if the queue is non-zero length issue
> the hypercall.

This still connects with netback per-VIF implementation.

> I'd expect this lack of batching here and in the other case I just
> spotted to have a detrimental affect on guests running with this patch
> but not using persistent grants. Did you benchmark that case?

I did some test before.
But I'd better to create more detailed result under in different case.

>> After making netback per-VIF works, this issue can be fixed.
> You've mentioned improvements which are conditional on this work a few
> times I think, perhaps it makes sense to make that change first?

Yes, I did consider to implement per-VIF first before persistent grant. 
But thinking of it is part of wei's patch and combined with other 
patches, and decided to implement it later. But making the change first 
would make things more clear.

Thanks
Annie
> Ian.
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message tomajordomo@vger.kernel.org
> More majordomo info athttp://vger.kernel.org/majordomo-info.html

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:35:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:35:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZKCU-00081T-MR; Fri, 16 Nov 2012 11:35:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZKCT-00081L-DA
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 11:35:09 +0000
Received: from [85.158.143.35:60113] by server-2.bemta-4.messagelabs.com id
	F2/90-28922-CE426A05; Fri, 16 Nov 2012 11:35:08 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1353065707!13060085!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19871 invoked from network); 16 Nov 2012 11:35:07 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-21.messagelabs.com with SMTP;
	16 Nov 2012 11:35:07 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 11:35:06 +0000
Message-Id: <50A632FA02000078000A934C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 11:35:06 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Subject: [Xen-devel] Ping: [PATCH] implement vmap()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 09.11.12 at 14:28, Jan Beulich wrote:
> ... and use it as basis for a proper ioremap() on x86.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -100,6 +100,7 @@
>  #include <xen/iocap.h>
>  #include <xen/guest_access.h>
>  #include <xen/pfn.h>
> +#include <xen/vmap.h>
>  #include <xen/xmalloc.h>
>  #include <xen/efi.h>
>  #include <xen/grant_table.h>
> @@ -5460,6 +5561,32 @@ void __set_fixmap(
>      map_pages_to_xen(fix_to_virt(idx), mfn, 1, flags);
>  }
>  
> +void *__init arch_vmap_virt_end(void)
> +{
> +    return (void *)fix_to_virt(__end_of_fixed_addresses);
> +}
> +
> +void __iomem *ioremap(paddr_t pa, size_t len)
> +{
> +    unsigned long pfn = PFN_DOWN(pa);
> +    void *va;
> +
> +    WARN_ON(page_is_ram_type(pfn, RAM_TYPE_CONVENTIONAL));
> +
> +    /* The low first Mb is always mapped. */
> +    if ( !((pa + len - 1) >> 20) )
> +        va = __va(pa);
> +    else
> +    {
> +        unsigned int offs = pa & (PAGE_SIZE - 1);
> +        unsigned int nr = PFN_UP(offs + len);
> +
> +        va = __vmap(&pfn, nr, 1, 1, PAGE_HYPERVISOR_NOCACHE) + offs;
> +    }
> +
> +    return (void __force __iomem *)va;
> +}
> +
>  #ifdef MEMORY_GUARD
>  
>  void memguard_init(void)
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -1104,6 +1104,7 @@ void __init __start_xen(unsigned long mb
>      end_boot_allocator();
>      system_state = SYS_STATE_boot;
>  
> +    vm_init();
>      vesa_init();
>  
>      softirq_init();
> --- a/xen/common/Makefile
> +++ b/xen/common/Makefile
> @@ -36,6 +36,7 @@ obj-y += time.o
>  obj-y += timer.o
>  obj-y += trace.o
>  obj-y += version.o
> +obj-y += vmap.o
>  obj-y += vsprintf.o
>  obj-y += wait.o
>  obj-y += xmalloc_tlsf.o
> --- /dev/null
> +++ b/xen/common/vmap.c
> @@ -0,0 +1,204 @@
> +#ifdef VMAP_VIRT_START
> +#include <xen/bitmap.h>
> +#include <xen/cache.h>
> +#include <xen/init.h>
> +#include <xen/mm.h>
> +#include <xen/pfn.h>
> +#include <xen/spinlock.h>
> +#include <xen/types.h>
> +#include <xen/vmap.h>
> +#include <asm/page.h>
> +
> +static DEFINE_SPINLOCK(vm_lock);
> +static void *__read_mostly vm_base;
> +#define vm_bitmap ((unsigned long *)vm_base)
> +/* highest allocated bit in the bitmap */
> +static unsigned int __read_mostly vm_top;
> +/* total number of bits in the bitmap */
> +static unsigned int __read_mostly vm_end;
> +/* lowest known clear bit in the bitmap */
> +static unsigned int vm_low;
> +
> +void __init vm_init(void)
> +{
> +    unsigned int i, nr;
> +    unsigned long va;
> +
> +    vm_base = (void *)VMAP_VIRT_START;
> +    vm_end = PFN_DOWN(arch_vmap_virt_end() - vm_base);
> +    vm_low = PFN_UP((vm_end + 7) / 8);
> +    nr = PFN_UP((vm_low + 7) / 8);
> +    vm_top = nr * PAGE_SIZE * 8;
> +
> +    for ( i = 0, va = (unsigned long)vm_bitmap; i < nr; ++i, va += 
> PAGE_SIZE )
> +    {
> +        struct page_info *pg = alloc_domheap_page(NULL, 0);
> +
> +        map_pages_to_xen(va, page_to_mfn(pg), 1, PAGE_HYPERVISOR);
> +        clear_page((void *)va);
> +    }
> +    bitmap_fill(vm_bitmap, vm_low);
> +
> +    /* Populate page tables for the bitmap if necessary. */
> +    map_pages_to_xen(va, 0, vm_low - nr, MAP_SMALL_PAGES);
> +}
> +
> +void *vm_alloc(unsigned int nr, unsigned int align)
> +{
> +    unsigned int start, bit;
> +
> +    if ( !align )
> +        align = 1;
> +    else if ( align & (align - 1) )
> +        align &= -align;
> +
> +    spin_lock(&vm_lock);
> +    for ( ; ; )
> +    {
> +        struct page_info *pg;
> +
> +        ASSERT(!test_bit(vm_low, vm_bitmap));
> +        for ( start = vm_low; ; )
> +        {
> +            bit = find_next_bit(vm_bitmap, vm_top, start + 1);
> +            if ( bit > vm_top )
> +                bit = vm_top;
> +            /*
> +             * Note that this skips the first bit, making the
> +             * corresponding page a guard one.
> +             */
> +            start = (start + align) & ~(align - 1);
> +            if ( start + nr <= bit )
> +                break;
> +            start = bit < vm_top ?
> +                    find_next_zero_bit(vm_bitmap, vm_top, bit + 1) : bit;
> +            if ( start >= vm_top )
> +                break;
> +        }
> +
> +        if ( start < vm_top )
> +            break;
> +
> +        spin_unlock(&vm_lock);
> +
> +        if ( vm_top >= vm_end )
> +            return NULL;
> +
> +        pg = alloc_domheap_page(NULL, 0);
> +        if ( !pg )
> +            return NULL;
> +
> +        spin_lock(&vm_lock);
> +
> +        if ( start >= vm_top )
> +        {
> +            unsigned long va = (unsigned long)vm_bitmap + vm_top / 8;
> +
> +            if ( !map_pages_to_xen(va, page_to_mfn(pg), 1, PAGE_HYPERVISOR) 
> )
> +            {
> +                clear_page((void *)va);
> +                vm_top += PAGE_SIZE * 8;
> +                if ( vm_top > vm_end )
> +                    vm_top = vm_end;
> +                continue;
> +            }
> +        }
> +
> +        free_domheap_page(pg);
> +
> +        if ( start >= vm_top )
> +        {
> +            spin_unlock(&vm_lock);
> +            return NULL;
> +        }
> +    }
> +
> +    for ( bit = start; bit < start + nr; ++bit )
> +        __set_bit(bit, vm_bitmap);
> +    if ( start <= vm_low + 2 )
> +        vm_low = bit;
> +    spin_unlock(&vm_lock);
> +
> +    return vm_base + start * PAGE_SIZE;
> +}
> +
> +static unsigned int vm_index(const void *va)
> +{
> +    unsigned long addr = (unsigned long)va & ~(PAGE_SIZE - 1);
> +    unsigned int idx;
> +
> +    if ( addr < VMAP_VIRT_START + (vm_end / 8) ||
> +         addr >= VMAP_VIRT_START + vm_top * PAGE_SIZE )
> +        return 0;
> +
> +    idx = PFN_DOWN(va - vm_base);
> +    return !test_bit(idx - 1, vm_bitmap) &&
> +           test_bit(idx, vm_bitmap) ? idx : 0;
> +}
> +
> +static unsigned int vm_size(const void *va)
> +{
> +    unsigned int start = vm_index(va), end;
> +
> +    if ( !start )
> +        return 0;
> +
> +    end = find_next_zero_bit(vm_bitmap, vm_top, start + 1);
> +
> +    return min(end, vm_top) - start;
> +}
> +
> +void vm_free(const void *va)
> +{
> +    unsigned int bit = vm_index(va);
> +
> +    if ( !bit )
> +    {
> +        WARN_ON(va != NULL);
> +        return;
> +    }
> +
> +    spin_lock(&vm_lock);
> +    if ( bit < vm_low )
> +    {
> +        vm_low = bit - 1;
> +        while ( !test_bit(vm_low - 1, vm_bitmap) )
> +            --vm_low;
> +    }
> +    while ( __test_and_clear_bit(bit, vm_bitmap) )
> +        if ( ++bit == vm_top )
> +            break;
> +    spin_unlock(&vm_lock);
> +}
> +
> +void *__vmap(const unsigned long *mfn, unsigned int granularity,
> +             unsigned int nr, unsigned int align, unsigned int flags)
> +{
> +    void *va = vm_alloc(nr * granularity, align);
> +    unsigned long cur = (unsigned long)va;
> +
> +    for ( ; va && nr--; ++mfn, cur += PAGE_SIZE * granularity )
> +    {
> +        if ( map_pages_to_xen(cur, *mfn, granularity, flags) )
> +        {
> +            vunmap(va);
> +            va = NULL;
> +        }
> +    }
> +
> +    return va;
> +}
> +
> +void *vmap(const unsigned long *mfn, unsigned int nr)
> +{
> +    return __vmap(mfn, 1, nr, 1, PAGE_HYPERVISOR);
> +}
> +
> +void vunmap(const void *va)
> +{
> +    unsigned long addr = (unsigned long)va;
> +
> +    destroy_xen_mappings(addr, addr + PAGE_SIZE * vm_size(va));
> +    vm_free(va);
> +}
> +#endif
> --- a/xen/drivers/acpi/apei/erst.c
> +++ b/xen/drivers/acpi/apei/erst.c
> @@ -247,9 +247,6 @@ static int erst_exec_move_data(struct ap
>  {
>  	int rc;
>  	u64 offset;
> -#ifdef CONFIG_X86
> -	enum fixed_addresses idx;
> -#endif
>  	void *src, *dst;
>  
>  	/* ioremap does not work in interrupt context */
> @@ -263,39 +260,11 @@ static int erst_exec_move_data(struct ap
>  	if (rc)
>  		return rc;
>  
> -#ifdef CONFIG_X86
> -	switch (ctx->var2) {
> -	case 0:
> -		return 0;
> -	case 1 ... PAGE_SIZE:
> -		break;
> -	default:
> -		printk(KERN_WARNING
> -		       "MOVE_DATA cannot be used for %#"PRIx64" bytes of data\n",
> -		       ctx->var2);
> -		return -EOPNOTSUPP;
> -	}
> -
> -	src = __acpi_map_table(ctx->src_base + offset, ctx->var2);
> -#else
>  	src = ioremap(ctx->src_base + offset, ctx->var2);
> -#endif
>  	if (!src)
>  		return -ENOMEM;
>  
> -#ifdef CONFIG_X86
> -	BUILD_BUG_ON(FIX_ACPI_PAGES < 4);
> -	idx = virt_to_fix((unsigned long)src + 2 * PAGE_SIZE);
> -	offset += ctx->dst_base;
> -	dst = (void *)fix_to_virt(idx) + (offset & ~PAGE_MASK);
> -	set_fixmap(idx, offset);
> -	if (PFN_DOWN(offset) != PFN_DOWN(offset + ctx->var2 - 1)) {
> -		idx = virt_to_fix((unsigned long)dst + PAGE_SIZE);
> -		set_fixmap(idx, offset + PAGE_SIZE);
> -	}
> -#else
>  	dst = ioremap(ctx->dst_base + offset, ctx->var2);
> -#endif
>  	if (dst) {
>  		memmove(dst, src, ctx->var2);
>  		iounmap(dst);
> --- a/xen/drivers/video/vesa.c
> +++ b/xen/drivers/video/vesa.c
> @@ -10,6 +10,7 @@
>  #include <xen/xmalloc.h>
>  #include <xen/kernel.h>
>  #include <xen/vga.h>
> +#include <asm/io.h>
>  #include <asm/page.h>
>  #include "font.h"
>  
> @@ -101,13 +102,11 @@ void __init vesa_init(void)
>      if ( !line_len )
>          goto fail;
>  
> -    if ( map_pages_to_xen(IOREMAP_VIRT_START,
> -                          vlfb_info.lfb_base >> PAGE_SHIFT,
> -                          vram_remap >> PAGE_SHIFT,
> -                          PAGE_HYPERVISOR_NOCACHE) )
> +    lfb = ioremap(vlfb_info.lfb_base, vram_remap);
> +    if ( !lfb )
>          goto fail;
>  
> -    lfb = memset((void *)IOREMAP_VIRT_START, 0, vram_remap);
> +    memset(lfb, 0, vram_remap);
>  
>      vga_puts = vesa_redraw_puts;
>  
> --- a/xen/include/asm-x86/config.h
> +++ b/xen/include/asm-x86/config.h
> @@ -144,7 +144,7 @@ extern unsigned char boot_edid_info[128]
>   *  0xffff828000000000 - 0xffff82bfffffffff [256GB, 2^38 bytes, PML4:261]
>   *    Machine-to-phys translation table.
>   *  0xffff82c000000000 - 0xffff82c3ffffffff [16GB,  2^34 bytes, PML4:261]
> - *    ioremap()/fixmap area.
> + *    vmap()/ioremap()/fixmap area.
>   *  0xffff82c400000000 - 0xffff82c43fffffff [1GB,   2^30 bytes, PML4:261]
>   *    Compatibility machine-to-phys translation table.
>   *  0xffff82c440000000 - 0xffff82c47fffffff [1GB,   2^30 bytes, PML4:261]
> @@ -205,11 +205,11 @@ extern unsigned char boot_edid_info[128]
>  /* Slot 261: machine-to-phys conversion table (256GB). */
>  #define RDWR_MPT_VIRT_START     (PML4_ADDR(261))
>  #define RDWR_MPT_VIRT_END       (RDWR_MPT_VIRT_START + MPT_VIRT_SIZE)
> -/* Slot 261: ioremap()/fixmap area (16GB). */
> -#define IOREMAP_VIRT_START      RDWR_MPT_VIRT_END
> -#define IOREMAP_VIRT_END        (IOREMAP_VIRT_START + GB(16))
> +/* Slot 261: vmap()/ioremap()/fixmap area (16GB). */
> +#define VMAP_VIRT_START         RDWR_MPT_VIRT_END
> +#define VMAP_VIRT_END           (VMAP_VIRT_START + GB(16))
>  /* Slot 261: compatibility machine-to-phys conversion table (1GB). */
> -#define RDWR_COMPAT_MPT_VIRT_START IOREMAP_VIRT_END
> +#define RDWR_COMPAT_MPT_VIRT_START VMAP_VIRT_END
>  #define RDWR_COMPAT_MPT_VIRT_END (RDWR_COMPAT_MPT_VIRT_START + GB(1))
>  /* Slot 261: high read-only compat machine-to-phys conversion table (1GB). 
> */
>  #define HIRO_COMPAT_MPT_VIRT_START RDWR_COMPAT_MPT_VIRT_END
> --- a/xen/include/asm-x86/fixmap.h
> +++ b/xen/include/asm-x86/fixmap.h
> @@ -15,7 +15,7 @@
>  #include <xen/config.h>
>  #include <asm/page.h>
>  
> -#define FIXADDR_TOP (IOREMAP_VIRT_END - PAGE_SIZE)
> +#define FIXADDR_TOP (VMAP_VIRT_END - PAGE_SIZE)
>  
>  #ifndef __ASSEMBLY__
>  
> --- a/xen/include/asm-x86/io.h
> +++ b/xen/include/asm-x86/io.h
> @@ -1,14 +1,10 @@
>  #ifndef _ASM_IO_H
>  #define _ASM_IO_H
>  
> -#include <xen/config.h>
> +#include <xen/vmap.h>
>  #include <xen/types.h>
>  #include <asm/page.h>
>  
> -/* We don't need real ioremap() on Xen/x86. */
> -#define ioremap(x,l) (__va(x))
> -#define iounmap(p)   ((void)0)
> -
>  #define readb(x) (*(volatile char *)(x))
>  #define readw(x) (*(volatile short *)(x))
>  #define readl(x) (*(volatile int *)(x))
> --- /dev/null
> +++ b/xen/include/xen/vmap.h
> @@ -0,0 +1,24 @@
> +#if !defined(__XEN_VMAP_H__) && defined(VMAP_VIRT_START)
> +#define __XEN_VMAP_H__
> +
> +#include <xen/types.h>
> +
> +void *vm_alloc(unsigned int nr, unsigned int align);
> +void vm_free(const void *);
> +
> +void *__vmap(const unsigned long *mfn, unsigned int granularity,
> +             unsigned int nr, unsigned int align, unsigned int flags);
> +void *vmap(const unsigned long *mfn, unsigned int nr);
> +void vunmap(const void *);
> +
> +void __iomem *ioremap(paddr_t, size_t);
> +
> +static inline void iounmap(void __iomem *va)
> +{
> +    vunmap((void __force *)va);
> +}
> +
> +void vm_init(void);
> +void *arch_vmap_virt_end(void);
> +
> +#endif /* __XEN_VMAP_H__ */
> 
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:35:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:35:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZKCU-00081T-MR; Fri, 16 Nov 2012 11:35:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZKCT-00081L-DA
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 11:35:09 +0000
Received: from [85.158.143.35:60113] by server-2.bemta-4.messagelabs.com id
	F2/90-28922-CE426A05; Fri, 16 Nov 2012 11:35:08 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1353065707!13060085!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19871 invoked from network); 16 Nov 2012 11:35:07 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-21.messagelabs.com with SMTP;
	16 Nov 2012 11:35:07 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 11:35:06 +0000
Message-Id: <50A632FA02000078000A934C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 11:35:06 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Subject: [Xen-devel] Ping: [PATCH] implement vmap()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 09.11.12 at 14:28, Jan Beulich wrote:
> ... and use it as basis for a proper ioremap() on x86.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -100,6 +100,7 @@
>  #include <xen/iocap.h>
>  #include <xen/guest_access.h>
>  #include <xen/pfn.h>
> +#include <xen/vmap.h>
>  #include <xen/xmalloc.h>
>  #include <xen/efi.h>
>  #include <xen/grant_table.h>
> @@ -5460,6 +5561,32 @@ void __set_fixmap(
>      map_pages_to_xen(fix_to_virt(idx), mfn, 1, flags);
>  }
>  
> +void *__init arch_vmap_virt_end(void)
> +{
> +    return (void *)fix_to_virt(__end_of_fixed_addresses);
> +}
> +
> +void __iomem *ioremap(paddr_t pa, size_t len)
> +{
> +    unsigned long pfn = PFN_DOWN(pa);
> +    void *va;
> +
> +    WARN_ON(page_is_ram_type(pfn, RAM_TYPE_CONVENTIONAL));
> +
> +    /* The low first Mb is always mapped. */
> +    if ( !((pa + len - 1) >> 20) )
> +        va = __va(pa);
> +    else
> +    {
> +        unsigned int offs = pa & (PAGE_SIZE - 1);
> +        unsigned int nr = PFN_UP(offs + len);
> +
> +        va = __vmap(&pfn, nr, 1, 1, PAGE_HYPERVISOR_NOCACHE) + offs;
> +    }
> +
> +    return (void __force __iomem *)va;
> +}
> +
>  #ifdef MEMORY_GUARD
>  
>  void memguard_init(void)
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -1104,6 +1104,7 @@ void __init __start_xen(unsigned long mb
>      end_boot_allocator();
>      system_state = SYS_STATE_boot;
>  
> +    vm_init();
>      vesa_init();
>  
>      softirq_init();
> --- a/xen/common/Makefile
> +++ b/xen/common/Makefile
> @@ -36,6 +36,7 @@ obj-y += time.o
>  obj-y += timer.o
>  obj-y += trace.o
>  obj-y += version.o
> +obj-y += vmap.o
>  obj-y += vsprintf.o
>  obj-y += wait.o
>  obj-y += xmalloc_tlsf.o
> --- /dev/null
> +++ b/xen/common/vmap.c
> @@ -0,0 +1,204 @@
> +#ifdef VMAP_VIRT_START
> +#include <xen/bitmap.h>
> +#include <xen/cache.h>
> +#include <xen/init.h>
> +#include <xen/mm.h>
> +#include <xen/pfn.h>
> +#include <xen/spinlock.h>
> +#include <xen/types.h>
> +#include <xen/vmap.h>
> +#include <asm/page.h>
> +
> +static DEFINE_SPINLOCK(vm_lock);
> +static void *__read_mostly vm_base;
> +#define vm_bitmap ((unsigned long *)vm_base)
> +/* highest allocated bit in the bitmap */
> +static unsigned int __read_mostly vm_top;
> +/* total number of bits in the bitmap */
> +static unsigned int __read_mostly vm_end;
> +/* lowest known clear bit in the bitmap */
> +static unsigned int vm_low;
> +
> +void __init vm_init(void)
> +{
> +    unsigned int i, nr;
> +    unsigned long va;
> +
> +    vm_base = (void *)VMAP_VIRT_START;
> +    vm_end = PFN_DOWN(arch_vmap_virt_end() - vm_base);
> +    vm_low = PFN_UP((vm_end + 7) / 8);
> +    nr = PFN_UP((vm_low + 7) / 8);
> +    vm_top = nr * PAGE_SIZE * 8;
> +
> +    for ( i = 0, va = (unsigned long)vm_bitmap; i < nr; ++i, va += 
> PAGE_SIZE )
> +    {
> +        struct page_info *pg = alloc_domheap_page(NULL, 0);
> +
> +        map_pages_to_xen(va, page_to_mfn(pg), 1, PAGE_HYPERVISOR);
> +        clear_page((void *)va);
> +    }
> +    bitmap_fill(vm_bitmap, vm_low);
> +
> +    /* Populate page tables for the bitmap if necessary. */
> +    map_pages_to_xen(va, 0, vm_low - nr, MAP_SMALL_PAGES);
> +}
> +
> +void *vm_alloc(unsigned int nr, unsigned int align)
> +{
> +    unsigned int start, bit;
> +
> +    if ( !align )
> +        align = 1;
> +    else if ( align & (align - 1) )
> +        align &= -align;
> +
> +    spin_lock(&vm_lock);
> +    for ( ; ; )
> +    {
> +        struct page_info *pg;
> +
> +        ASSERT(!test_bit(vm_low, vm_bitmap));
> +        for ( start = vm_low; ; )
> +        {
> +            bit = find_next_bit(vm_bitmap, vm_top, start + 1);
> +            if ( bit > vm_top )
> +                bit = vm_top;
> +            /*
> +             * Note that this skips the first bit, making the
> +             * corresponding page a guard one.
> +             */
> +            start = (start + align) & ~(align - 1);
> +            if ( start + nr <= bit )
> +                break;
> +            start = bit < vm_top ?
> +                    find_next_zero_bit(vm_bitmap, vm_top, bit + 1) : bit;
> +            if ( start >= vm_top )
> +                break;
> +        }
> +
> +        if ( start < vm_top )
> +            break;
> +
> +        spin_unlock(&vm_lock);
> +
> +        if ( vm_top >= vm_end )
> +            return NULL;
> +
> +        pg = alloc_domheap_page(NULL, 0);
> +        if ( !pg )
> +            return NULL;
> +
> +        spin_lock(&vm_lock);
> +
> +        if ( start >= vm_top )
> +        {
> +            unsigned long va = (unsigned long)vm_bitmap + vm_top / 8;
> +
> +            if ( !map_pages_to_xen(va, page_to_mfn(pg), 1, PAGE_HYPERVISOR) 
> )
> +            {
> +                clear_page((void *)va);
> +                vm_top += PAGE_SIZE * 8;
> +                if ( vm_top > vm_end )
> +                    vm_top = vm_end;
> +                continue;
> +            }
> +        }
> +
> +        free_domheap_page(pg);
> +
> +        if ( start >= vm_top )
> +        {
> +            spin_unlock(&vm_lock);
> +            return NULL;
> +        }
> +    }
> +
> +    for ( bit = start; bit < start + nr; ++bit )
> +        __set_bit(bit, vm_bitmap);
> +    if ( start <= vm_low + 2 )
> +        vm_low = bit;
> +    spin_unlock(&vm_lock);
> +
> +    return vm_base + start * PAGE_SIZE;
> +}
> +
> +static unsigned int vm_index(const void *va)
> +{
> +    unsigned long addr = (unsigned long)va & ~(PAGE_SIZE - 1);
> +    unsigned int idx;
> +
> +    if ( addr < VMAP_VIRT_START + (vm_end / 8) ||
> +         addr >= VMAP_VIRT_START + vm_top * PAGE_SIZE )
> +        return 0;
> +
> +    idx = PFN_DOWN(va - vm_base);
> +    return !test_bit(idx - 1, vm_bitmap) &&
> +           test_bit(idx, vm_bitmap) ? idx : 0;
> +}
> +
> +static unsigned int vm_size(const void *va)
> +{
> +    unsigned int start = vm_index(va), end;
> +
> +    if ( !start )
> +        return 0;
> +
> +    end = find_next_zero_bit(vm_bitmap, vm_top, start + 1);
> +
> +    return min(end, vm_top) - start;
> +}
> +
> +void vm_free(const void *va)
> +{
> +    unsigned int bit = vm_index(va);
> +
> +    if ( !bit )
> +    {
> +        WARN_ON(va != NULL);
> +        return;
> +    }
> +
> +    spin_lock(&vm_lock);
> +    if ( bit < vm_low )
> +    {
> +        vm_low = bit - 1;
> +        while ( !test_bit(vm_low - 1, vm_bitmap) )
> +            --vm_low;
> +    }
> +    while ( __test_and_clear_bit(bit, vm_bitmap) )
> +        if ( ++bit == vm_top )
> +            break;
> +    spin_unlock(&vm_lock);
> +}
> +
> +void *__vmap(const unsigned long *mfn, unsigned int granularity,
> +             unsigned int nr, unsigned int align, unsigned int flags)
> +{
> +    void *va = vm_alloc(nr * granularity, align);
> +    unsigned long cur = (unsigned long)va;
> +
> +    for ( ; va && nr--; ++mfn, cur += PAGE_SIZE * granularity )
> +    {
> +        if ( map_pages_to_xen(cur, *mfn, granularity, flags) )
> +        {
> +            vunmap(va);
> +            va = NULL;
> +        }
> +    }
> +
> +    return va;
> +}
> +
> +void *vmap(const unsigned long *mfn, unsigned int nr)
> +{
> +    return __vmap(mfn, 1, nr, 1, PAGE_HYPERVISOR);
> +}
> +
> +void vunmap(const void *va)
> +{
> +    unsigned long addr = (unsigned long)va;
> +
> +    destroy_xen_mappings(addr, addr + PAGE_SIZE * vm_size(va));
> +    vm_free(va);
> +}
> +#endif
> --- a/xen/drivers/acpi/apei/erst.c
> +++ b/xen/drivers/acpi/apei/erst.c
> @@ -247,9 +247,6 @@ static int erst_exec_move_data(struct ap
>  {
>  	int rc;
>  	u64 offset;
> -#ifdef CONFIG_X86
> -	enum fixed_addresses idx;
> -#endif
>  	void *src, *dst;
>  
>  	/* ioremap does not work in interrupt context */
> @@ -263,39 +260,11 @@ static int erst_exec_move_data(struct ap
>  	if (rc)
>  		return rc;
>  
> -#ifdef CONFIG_X86
> -	switch (ctx->var2) {
> -	case 0:
> -		return 0;
> -	case 1 ... PAGE_SIZE:
> -		break;
> -	default:
> -		printk(KERN_WARNING
> -		       "MOVE_DATA cannot be used for %#"PRIx64" bytes of data\n",
> -		       ctx->var2);
> -		return -EOPNOTSUPP;
> -	}
> -
> -	src = __acpi_map_table(ctx->src_base + offset, ctx->var2);
> -#else
>  	src = ioremap(ctx->src_base + offset, ctx->var2);
> -#endif
>  	if (!src)
>  		return -ENOMEM;
>  
> -#ifdef CONFIG_X86
> -	BUILD_BUG_ON(FIX_ACPI_PAGES < 4);
> -	idx = virt_to_fix((unsigned long)src + 2 * PAGE_SIZE);
> -	offset += ctx->dst_base;
> -	dst = (void *)fix_to_virt(idx) + (offset & ~PAGE_MASK);
> -	set_fixmap(idx, offset);
> -	if (PFN_DOWN(offset) != PFN_DOWN(offset + ctx->var2 - 1)) {
> -		idx = virt_to_fix((unsigned long)dst + PAGE_SIZE);
> -		set_fixmap(idx, offset + PAGE_SIZE);
> -	}
> -#else
>  	dst = ioremap(ctx->dst_base + offset, ctx->var2);
> -#endif
>  	if (dst) {
>  		memmove(dst, src, ctx->var2);
>  		iounmap(dst);
> --- a/xen/drivers/video/vesa.c
> +++ b/xen/drivers/video/vesa.c
> @@ -10,6 +10,7 @@
>  #include <xen/xmalloc.h>
>  #include <xen/kernel.h>
>  #include <xen/vga.h>
> +#include <asm/io.h>
>  #include <asm/page.h>
>  #include "font.h"
>  
> @@ -101,13 +102,11 @@ void __init vesa_init(void)
>      if ( !line_len )
>          goto fail;
>  
> -    if ( map_pages_to_xen(IOREMAP_VIRT_START,
> -                          vlfb_info.lfb_base >> PAGE_SHIFT,
> -                          vram_remap >> PAGE_SHIFT,
> -                          PAGE_HYPERVISOR_NOCACHE) )
> +    lfb = ioremap(vlfb_info.lfb_base, vram_remap);
> +    if ( !lfb )
>          goto fail;
>  
> -    lfb = memset((void *)IOREMAP_VIRT_START, 0, vram_remap);
> +    memset(lfb, 0, vram_remap);
>  
>      vga_puts = vesa_redraw_puts;
>  
> --- a/xen/include/asm-x86/config.h
> +++ b/xen/include/asm-x86/config.h
> @@ -144,7 +144,7 @@ extern unsigned char boot_edid_info[128]
>   *  0xffff828000000000 - 0xffff82bfffffffff [256GB, 2^38 bytes, PML4:261]
>   *    Machine-to-phys translation table.
>   *  0xffff82c000000000 - 0xffff82c3ffffffff [16GB,  2^34 bytes, PML4:261]
> - *    ioremap()/fixmap area.
> + *    vmap()/ioremap()/fixmap area.
>   *  0xffff82c400000000 - 0xffff82c43fffffff [1GB,   2^30 bytes, PML4:261]
>   *    Compatibility machine-to-phys translation table.
>   *  0xffff82c440000000 - 0xffff82c47fffffff [1GB,   2^30 bytes, PML4:261]
> @@ -205,11 +205,11 @@ extern unsigned char boot_edid_info[128]
>  /* Slot 261: machine-to-phys conversion table (256GB). */
>  #define RDWR_MPT_VIRT_START     (PML4_ADDR(261))
>  #define RDWR_MPT_VIRT_END       (RDWR_MPT_VIRT_START + MPT_VIRT_SIZE)
> -/* Slot 261: ioremap()/fixmap area (16GB). */
> -#define IOREMAP_VIRT_START      RDWR_MPT_VIRT_END
> -#define IOREMAP_VIRT_END        (IOREMAP_VIRT_START + GB(16))
> +/* Slot 261: vmap()/ioremap()/fixmap area (16GB). */
> +#define VMAP_VIRT_START         RDWR_MPT_VIRT_END
> +#define VMAP_VIRT_END           (VMAP_VIRT_START + GB(16))
>  /* Slot 261: compatibility machine-to-phys conversion table (1GB). */
> -#define RDWR_COMPAT_MPT_VIRT_START IOREMAP_VIRT_END
> +#define RDWR_COMPAT_MPT_VIRT_START VMAP_VIRT_END
>  #define RDWR_COMPAT_MPT_VIRT_END (RDWR_COMPAT_MPT_VIRT_START + GB(1))
>  /* Slot 261: high read-only compat machine-to-phys conversion table (1GB). 
> */
>  #define HIRO_COMPAT_MPT_VIRT_START RDWR_COMPAT_MPT_VIRT_END
> --- a/xen/include/asm-x86/fixmap.h
> +++ b/xen/include/asm-x86/fixmap.h
> @@ -15,7 +15,7 @@
>  #include <xen/config.h>
>  #include <asm/page.h>
>  
> -#define FIXADDR_TOP (IOREMAP_VIRT_END - PAGE_SIZE)
> +#define FIXADDR_TOP (VMAP_VIRT_END - PAGE_SIZE)
>  
>  #ifndef __ASSEMBLY__
>  
> --- a/xen/include/asm-x86/io.h
> +++ b/xen/include/asm-x86/io.h
> @@ -1,14 +1,10 @@
>  #ifndef _ASM_IO_H
>  #define _ASM_IO_H
>  
> -#include <xen/config.h>
> +#include <xen/vmap.h>
>  #include <xen/types.h>
>  #include <asm/page.h>
>  
> -/* We don't need real ioremap() on Xen/x86. */
> -#define ioremap(x,l) (__va(x))
> -#define iounmap(p)   ((void)0)
> -
>  #define readb(x) (*(volatile char *)(x))
>  #define readw(x) (*(volatile short *)(x))
>  #define readl(x) (*(volatile int *)(x))
> --- /dev/null
> +++ b/xen/include/xen/vmap.h
> @@ -0,0 +1,24 @@
> +#if !defined(__XEN_VMAP_H__) && defined(VMAP_VIRT_START)
> +#define __XEN_VMAP_H__
> +
> +#include <xen/types.h>
> +
> +void *vm_alloc(unsigned int nr, unsigned int align);
> +void vm_free(const void *);
> +
> +void *__vmap(const unsigned long *mfn, unsigned int granularity,
> +             unsigned int nr, unsigned int align, unsigned int flags);
> +void *vmap(const unsigned long *mfn, unsigned int nr);
> +void vunmap(const void *);
> +
> +void __iomem *ioremap(paddr_t, size_t);
> +
> +static inline void iounmap(void __iomem *va)
> +{
> +    vunmap((void __force *)va);
> +}
> +
> +void vm_init(void);
> +void *arch_vmap_virt_end(void);
> +
> +#endif /* __XEN_VMAP_H__ */
> 
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:37:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:37:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZKEY-0008CG-7f; Fri, 16 Nov 2012 11:37:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZKEW-0008CA-Nl
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 11:37:16 +0000
Received: from [85.158.138.51:3064] by server-15.bemta-3.messagelabs.com id
	6C/06-09445-76526A05; Fri, 16 Nov 2012 11:37:11 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353065824!28379566!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTcyODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4990 invoked from network); 16 Nov 2012 11:37:06 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-15.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 11:37:06 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGBb2PE001625
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 11:37:03 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGBb2hk005501
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 11:37:02 GMT
Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGBb284004587; Fri, 16 Nov 2012 05:37:02 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 03:37:01 -0800
Message-ID: <50A6255C.10108@oracle.com>
Date: Fri, 16 Nov 2012 19:37:00 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1353059821.3499.190.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353059821.3499.190.camel@zakaz.uk.xensource.com>
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-16 17:57, Ian Campbell wrote:
> On Thu, 2012-11-15 at 07:03 +0000, Annie Li wrote:
>> This patch implements persistent grants for xen-netfront/netback.
> Hang on a sec. It has just occurred to me that netfront/netback in the
> current mainline kernels don't currently use grant maps at all, they use
> grant copy on both the tx and rx paths.

Ah, this patch is based on v3.4-rc3.
Current mainline kernel does not pass the netperf/netserver case. As I 
mentioned earlier, I hit BUG_ON with your debug patch too when testing 
mainline kernel with netperf/netserver.
This is interesting, I should have check the latest code.

>
> The supposed benefit of persistent grants is to avoid the TLB shootdowns
> on grant unmap, but in the current code there should be exactly zero of
> those.

Is there any performance document about current grant copy code in 
mainline kernel?

>
> If I understand correctly this patch goes from using grant copy
> operations to persistently mapping frames and then using memcpy on those
> buffers to copy in/out to local buffers. I'm finding it hard to think of
> a reason why this should perform any better, do you have a theory which
> explains it?

This patch is aiming to fix spin lock issue of grant operations, it 
comes out to avoid possible grant operations(including grant map and copy).

> (my best theory is that it has a beneficial impact on where
> the cache locality of the data, but netperf doesn't typically actually
> access the data so I'm not sure why that would matter)
>
> Also AIUI this is also doing persistent grants for both Tx and Rx
> directions?

Yes.

>
> For guest Rx does this mean it now copies twice, in dom0 from the DMA
> buffer to the guest provided buffer and then again in the guest from the
> granted buffer to a normal one?

Yes.

>
> For guest Tx how do you handle the lifecycle of the grant mapped pages
> which are being sent up into the dom0 network stack? Or are you also now
> copying twice in this case? (i.e. guest copies into a granted buffer and
> dom0 copies out into a local buffer?)

Copy twice: guest copies into a granted buffer and dom0 copies out into 
a local buffer.

>
> Did you do measurement of the Tx and Rx cases independently?

No.

> Do you know
> that they both benefit from this change (rather than for example an
> improvement in one direction masking a regression in the other).

On theory, this implementation avoid spinlock issue of grant operation, 
so they should both benefit from it.

> Were
> the numbers you previously posted in one particular direction or did you
> measure both?

One particular direction, one runs as server, the other runs as client.

Thanks
Annie
>
> Ian.
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:37:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:37:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZKEY-0008CG-7f; Fri, 16 Nov 2012 11:37:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZKEW-0008CA-Nl
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 11:37:16 +0000
Received: from [85.158.138.51:3064] by server-15.bemta-3.messagelabs.com id
	6C/06-09445-76526A05; Fri, 16 Nov 2012 11:37:11 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353065824!28379566!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTcyODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4990 invoked from network); 16 Nov 2012 11:37:06 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-15.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 11:37:06 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGBb2PE001625
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 11:37:03 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGBb2hk005501
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 11:37:02 GMT
Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGBb284004587; Fri, 16 Nov 2012 05:37:02 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 03:37:01 -0800
Message-ID: <50A6255C.10108@oracle.com>
Date: Fri, 16 Nov 2012 19:37:00 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1353059821.3499.190.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353059821.3499.190.camel@zakaz.uk.xensource.com>
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-16 17:57, Ian Campbell wrote:
> On Thu, 2012-11-15 at 07:03 +0000, Annie Li wrote:
>> This patch implements persistent grants for xen-netfront/netback.
> Hang on a sec. It has just occurred to me that netfront/netback in the
> current mainline kernels don't currently use grant maps at all, they use
> grant copy on both the tx and rx paths.

Ah, this patch is based on v3.4-rc3.
Current mainline kernel does not pass the netperf/netserver case. As I 
mentioned earlier, I hit BUG_ON with your debug patch too when testing 
mainline kernel with netperf/netserver.
This is interesting, I should have check the latest code.

>
> The supposed benefit of persistent grants is to avoid the TLB shootdowns
> on grant unmap, but in the current code there should be exactly zero of
> those.

Is there any performance document about current grant copy code in 
mainline kernel?

>
> If I understand correctly this patch goes from using grant copy
> operations to persistently mapping frames and then using memcpy on those
> buffers to copy in/out to local buffers. I'm finding it hard to think of
> a reason why this should perform any better, do you have a theory which
> explains it?

This patch is aiming to fix spin lock issue of grant operations, it 
comes out to avoid possible grant operations(including grant map and copy).

> (my best theory is that it has a beneficial impact on where
> the cache locality of the data, but netperf doesn't typically actually
> access the data so I'm not sure why that would matter)
>
> Also AIUI this is also doing persistent grants for both Tx and Rx
> directions?

Yes.

>
> For guest Rx does this mean it now copies twice, in dom0 from the DMA
> buffer to the guest provided buffer and then again in the guest from the
> granted buffer to a normal one?

Yes.

>
> For guest Tx how do you handle the lifecycle of the grant mapped pages
> which are being sent up into the dom0 network stack? Or are you also now
> copying twice in this case? (i.e. guest copies into a granted buffer and
> dom0 copies out into a local buffer?)

Copy twice: guest copies into a granted buffer and dom0 copies out into 
a local buffer.

>
> Did you do measurement of the Tx and Rx cases independently?

No.

> Do you know
> that they both benefit from this change (rather than for example an
> improvement in one direction masking a regression in the other).

On theory, this implementation avoid spinlock issue of grant operation, 
so they should both benefit from it.

> Were
> the numbers you previously posted in one particular direction or did you
> measure both?

One particular direction, one runs as server, the other runs as client.

Thanks
Annie
>
> Ian.
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:46:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:46:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZKNT-00005l-9G; Fri, 16 Nov 2012 11:46:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZKNR-00005g-QC
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 11:46:30 +0000
Received: from [85.158.139.83:38945] by server-12.bemta-5.messagelabs.com id
	1F/E9-02886-59726A05; Fri, 16 Nov 2012 11:46:29 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1353066383!28197239!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21600 invoked from network); 16 Nov 2012 11:46:24 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-10.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 11:46:24 -0000
X-IronPort-AV: E=Sophos;i="4.83,264,1352073600"; d="scan'208";a="15848217"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 11:46:23 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 11:46:23 +0000
Message-ID: <1353066382.3499.227.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: ANNIE LI <annie.li@oracle.com>
Date: Fri, 16 Nov 2012 11:46:22 +0000
In-Reply-To: <50A6255C.10108@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1353059821.3499.190.camel@zakaz.uk.xensource.com>
	<50A6255C.10108@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 11:37 +0000, ANNIE LI wrote:
> 
> On 2012-11-16 17:57, Ian Campbell wrote:
> > On Thu, 2012-11-15 at 07:03 +0000, Annie Li wrote:
> >> This patch implements persistent grants for xen-netfront/netback.
> > Hang on a sec. It has just occurred to me that netfront/netback in the
> > current mainline kernels don't currently use grant maps at all, they use
> > grant copy on both the tx and rx paths.
> 
> Ah, this patch is based on v3.4-rc3.

Nothing has changed in more recent kernels in this regard.

> >
> > The supposed benefit of persistent grants is to avoid the TLB shootdowns
> > on grant unmap, but in the current code there should be exactly zero of
> > those.
> 
> Is there any performance document about current grant copy code in 
> mainline kernel?

Not AFAIK.

> > If I understand correctly this patch goes from using grant copy
> > operations to persistently mapping frames and then using memcpy on those
> > buffers to copy in/out to local buffers. I'm finding it hard to think of
> > a reason why this should perform any better, do you have a theory which
> > explains it?
> 
> This patch is aiming to fix spin lock issue of grant operations, it 
> comes out to avoid possible grant operations(including grant map and copy).

Makes sense. This is the sort of thing which ought to feature
prominently in commit messages and/or introductory mails.

> > Do you know
> > that they both benefit from this change (rather than for example an
> > improvement in one direction masking a regression in the other).
> 
> On theory, this implementation avoid spinlock issue of grant operation, 
> so they should both benefit from it.

It seems like having netfront simply allocate itself a pool of grant
references which it reuses would give equivalent benefits whilst being a
smaller patch, with no protocol change and avoiding double copying. In
fact by avoiding the double copy I'd expect it to be even better.

> > Were
> > the numbers you previously posted in one particular direction or did you
> > measure both?
> 
> One particular direction, one runs as server, the other runs as client.

I think you need to measure both dom0->domU and domU->dom0 to get the
full picture since AIUI netperf sends the bulk data in only one
direction with just ACKs coming back the other way.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:46:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:46:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZKNT-00005l-9G; Fri, 16 Nov 2012 11:46:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZKNR-00005g-QC
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 11:46:30 +0000
Received: from [85.158.139.83:38945] by server-12.bemta-5.messagelabs.com id
	1F/E9-02886-59726A05; Fri, 16 Nov 2012 11:46:29 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1353066383!28197239!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21600 invoked from network); 16 Nov 2012 11:46:24 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-10.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 11:46:24 -0000
X-IronPort-AV: E=Sophos;i="4.83,264,1352073600"; d="scan'208";a="15848217"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 11:46:23 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 11:46:23 +0000
Message-ID: <1353066382.3499.227.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: ANNIE LI <annie.li@oracle.com>
Date: Fri, 16 Nov 2012 11:46:22 +0000
In-Reply-To: <50A6255C.10108@oracle.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<1353059821.3499.190.camel@zakaz.uk.xensource.com>
	<50A6255C.10108@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 11:37 +0000, ANNIE LI wrote:
> 
> On 2012-11-16 17:57, Ian Campbell wrote:
> > On Thu, 2012-11-15 at 07:03 +0000, Annie Li wrote:
> >> This patch implements persistent grants for xen-netfront/netback.
> > Hang on a sec. It has just occurred to me that netfront/netback in the
> > current mainline kernels don't currently use grant maps at all, they use
> > grant copy on both the tx and rx paths.
> 
> Ah, this patch is based on v3.4-rc3.

Nothing has changed in more recent kernels in this regard.

> >
> > The supposed benefit of persistent grants is to avoid the TLB shootdowns
> > on grant unmap, but in the current code there should be exactly zero of
> > those.
> 
> Is there any performance document about current grant copy code in 
> mainline kernel?

Not AFAIK.

> > If I understand correctly this patch goes from using grant copy
> > operations to persistently mapping frames and then using memcpy on those
> > buffers to copy in/out to local buffers. I'm finding it hard to think of
> > a reason why this should perform any better, do you have a theory which
> > explains it?
> 
> This patch is aiming to fix spin lock issue of grant operations, it 
> comes out to avoid possible grant operations(including grant map and copy).

Makes sense. This is the sort of thing which ought to feature
prominently in commit messages and/or introductory mails.

> > Do you know
> > that they both benefit from this change (rather than for example an
> > improvement in one direction masking a regression in the other).
> 
> On theory, this implementation avoid spinlock issue of grant operation, 
> so they should both benefit from it.

It seems like having netfront simply allocate itself a pool of grant
references which it reuses would give equivalent benefits whilst being a
smaller patch, with no protocol change and avoiding double copying. In
fact by avoiding the double copy I'd expect it to be even better.

> > Were
> > the numbers you previously posted in one particular direction or did you
> > measure both?
> 
> One particular direction, one runs as server, the other runs as client.

I think you need to measure both dom0->domU and domU->dom0 to get the
full picture since AIUI netperf sends the bulk data in only one
direction with just ACKs coming back the other way.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:53:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:53:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZKTz-0000LQ-BB; Fri, 16 Nov 2012 11:53:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TZKTx-0000LL-U7
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 11:53:14 +0000
Received: from [85.158.137.99:52027] by server-10.bemta-3.messagelabs.com id
	5A/0D-19806-52926A05; Fri, 16 Nov 2012 11:53:09 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353066781!19269712!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28700 invoked from network); 16 Nov 2012 11:53:02 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 11:53:02 -0000
X-IronPort-AV: E=Sophos;i="4.83,264,1352073600"; d="scan'208";a="44830670"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 11:53:00 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 06:53:00 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TZKTk-0003w0-18	for
	xen-devel@lists.xen.org; Fri, 16 Nov 2012 11:53:00 +0000
Message-ID: <50A6291B.2030208@citrix.com>
Date: Fri, 16 Nov 2012 11:52:59 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel@lists.xen.org
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A6024F02000078000A9214@nat28.tlf.novell.com>
	<20121116105622.GA89551@ocelot.phlegethon.org>
	<50A6302802000078000A933C@nat28.tlf.novell.com>
In-Reply-To: <50A6302802000078000A933C@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 16/11/12 11:23, Jan Beulich wrote:
>>>> On 16.11.12 at 11:56, Tim Deegan <tim@xen.org> wrote:
>> At 08:07 +0000 on 16 Nov (1353053247), Jan Beulich wrote:
>>>> We could potentially solve the problem by having the MCE handler check
>>>> whether it's returning to the NMI stack, and do a normal return in that
>>>> case.  It's a bit of extra code but only in the MCE handler, which is
>>>> not performance-critical. 
>>> Yes, that could solve that nesting case (again not very difficult
>>> to implement).
>> How about we just have the MCE handler return without IRET in _all_
>> cases where it's returning to ring 0?  I think that entirely solves the
>> MCE-in-NMI problem, without all the extra mechanism meeded for the
>> linux-style solution.
> Good suggestion.
>
>>  (Unless we want to allow other traps in either
>> the NMI or MCE handlers).
> We should absolutely avoid that.
>
>> [And it occurs to me that the linux-style solution is tricky because
>> detecting the case where you've taken an NMI and not yet set the
>> nmi-in-progress flag is hard in both SVM (in the NMI handler but on the
>> normal stack) and VMX (in the _vmexit_ handler and on the normal
>> stack).]
> Agreed.

But we never need to detect this case.  If we take an NMI and ensure
there is no possibility for a trap before setting the nmi-in-progress
flag (which is not very hard, with it being a handful of instructions in
the handler), then we guarantee that NMIs are still blocked, and thus
cant be reentrant.

Also, for what it is worth, we do have traps on the NMI path in the form
of BUG()s, WARN()s and panic gubbins, although the host is in a fairly
dire state if we actually ever hit any of these.

~Andrew

>
>> So I guess now I'm suggesting:
>>  - MCE never returns to Xen with IRET;
> Yes. But that might need care with regard to EFI runtime services
> (or maybe not, as we're, at least at present, not switching stacks
> there). Nevertheless, to be on the safe side, we could restrict
> avoiding the IRET to "Ring 0 and RIP in hypervisor space", as we
> know we won't have interrupted the NMI handler if that's not the
> case.
>
>>  - NMI handling in handle_vmexit() moves to beside the MCE handling;
> Yes.
>
>>  - Explicit IRET-to-self at the end of do_nmi() to unmask NMIs; and
> This IRET must then switch to the normal stack, if currently on
> the NMI one, which might be a little tricky/fragile.
>
> But then again we're on the NMI one only when we got there
> from hypervisor context, and in that specific case we return
> without handling softirqs anyway. So perhaps the stack switch
> isn't needed, but the IRET-to-self must only be done when the
> origin wasn't in hypervisor context.
>
>>  - no int $2. :)
> Yippee.
>
> Jan
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 11:53:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 11:53:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZKTz-0000LQ-BB; Fri, 16 Nov 2012 11:53:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TZKTx-0000LL-U7
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 11:53:14 +0000
Received: from [85.158.137.99:52027] by server-10.bemta-3.messagelabs.com id
	5A/0D-19806-52926A05; Fri, 16 Nov 2012 11:53:09 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353066781!19269712!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28700 invoked from network); 16 Nov 2012 11:53:02 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 11:53:02 -0000
X-IronPort-AV: E=Sophos;i="4.83,264,1352073600"; d="scan'208";a="44830670"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 11:53:00 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 06:53:00 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TZKTk-0003w0-18	for
	xen-devel@lists.xen.org; Fri, 16 Nov 2012 11:53:00 +0000
Message-ID: <50A6291B.2030208@citrix.com>
Date: Fri, 16 Nov 2012 11:52:59 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel@lists.xen.org
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A6024F02000078000A9214@nat28.tlf.novell.com>
	<20121116105622.GA89551@ocelot.phlegethon.org>
	<50A6302802000078000A933C@nat28.tlf.novell.com>
In-Reply-To: <50A6302802000078000A933C@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 16/11/12 11:23, Jan Beulich wrote:
>>>> On 16.11.12 at 11:56, Tim Deegan <tim@xen.org> wrote:
>> At 08:07 +0000 on 16 Nov (1353053247), Jan Beulich wrote:
>>>> We could potentially solve the problem by having the MCE handler check
>>>> whether it's returning to the NMI stack, and do a normal return in that
>>>> case.  It's a bit of extra code but only in the MCE handler, which is
>>>> not performance-critical. 
>>> Yes, that could solve that nesting case (again not very difficult
>>> to implement).
>> How about we just have the MCE handler return without IRET in _all_
>> cases where it's returning to ring 0?  I think that entirely solves the
>> MCE-in-NMI problem, without all the extra mechanism meeded for the
>> linux-style solution.
> Good suggestion.
>
>>  (Unless we want to allow other traps in either
>> the NMI or MCE handlers).
> We should absolutely avoid that.
>
>> [And it occurs to me that the linux-style solution is tricky because
>> detecting the case where you've taken an NMI and not yet set the
>> nmi-in-progress flag is hard in both SVM (in the NMI handler but on the
>> normal stack) and VMX (in the _vmexit_ handler and on the normal
>> stack).]
> Agreed.

But we never need to detect this case.  If we take an NMI and ensure
there is no possibility for a trap before setting the nmi-in-progress
flag (which is not very hard, with it being a handful of instructions in
the handler), then we guarantee that NMIs are still blocked, and thus
cant be reentrant.

Also, for what it is worth, we do have traps on the NMI path in the form
of BUG()s, WARN()s and panic gubbins, although the host is in a fairly
dire state if we actually ever hit any of these.

~Andrew

>
>> So I guess now I'm suggesting:
>>  - MCE never returns to Xen with IRET;
> Yes. But that might need care with regard to EFI runtime services
> (or maybe not, as we're, at least at present, not switching stacks
> there). Nevertheless, to be on the safe side, we could restrict
> avoiding the IRET to "Ring 0 and RIP in hypervisor space", as we
> know we won't have interrupted the NMI handler if that's not the
> case.
>
>>  - NMI handling in handle_vmexit() moves to beside the MCE handling;
> Yes.
>
>>  - Explicit IRET-to-self at the end of do_nmi() to unmask NMIs; and
> This IRET must then switch to the normal stack, if currently on
> the NMI one, which might be a little tricky/fragile.
>
> But then again we're on the NMI one only when we got there
> from hypervisor context, and in that specific case we return
> without handling softirqs anyway. So perhaps the stack switch
> isn't needed, but the IRET-to-self must only be done when the
> origin wasn't in hypervisor context.
>
>>  - no int $2. :)
> Yippee.
>
> Jan
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 12:01:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 12:01:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZKbZ-0000b8-Uu; Fri, 16 Nov 2012 12:01:05 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <raistlin.df@gmail.com>) id 1TZKbY-0000ay-Jo
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 12:01:04 +0000
Received: from [193.109.254.147:47554] by server-2.bemta-14.messagelabs.com id
	BB/39-20829-FFA26A05; Fri, 16 Nov 2012 12:01:03 +0000
X-Env-Sender: raistlin.df@gmail.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1353067262!9947961!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8843 invoked from network); 16 Nov 2012 12:01:02 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 12:01:02 -0000
Received: by mail-we0-f173.google.com with SMTP id r1so1154123wey.32
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 04:01:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:subject:from:to:cc:date:in-reply-to:references
	:content-type:x-mailer:mime-version;
	bh=FEYS9he7x3COzLMBijPImBTo6/1GtInzFMGeApDZsAw=;
	b=yjIPvDi88rt1a4jAmWqBaZw/lLF0dmpaITrcz2QCUr3/h+UjooNrhHiyaaSckAUwym
	6c4LixoD/yVgefHwf6fd/iWp9coVqTQWEdYxNUudYxpIn18rTvn51nI9Sd5mJdua7Pam
	b7OAnCYj5NHWjafnbq0yXF0tGQj3Kf+2mMwHiDt0PEW02spvsv2vYBci2ILe5MwAh8Rv
	MOJHb6waIp9DPYVU72ruKv0IZ4jmF48xF1NcA8tDFqMHj39nLBVnw7Poii6+YL7bU1jv
	g2YjcHdnreRIsp10gLdpdoEXL7mok+1oD/Uquj5Tfq3AKaggRqiXV9odisCm+YXz6x8L
	Tgbw==
Received: by 10.216.195.159 with SMTP id p31mr1664880wen.139.1353067262075;
	Fri, 16 Nov 2012 04:01:02 -0800 (PST)
Received: from [192.168.0.40] (ip-176-53.sn2.eutelia.it. [83.211.176.53])
	by mx.google.com with ESMTPS id d16sm448398wiw.8.2012.11.16.04.00.59
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 16 Nov 2012 04:01:00 -0800 (PST)
Message-ID: <1353067252.5351.124.camel@Solace>
From: Dario Faggioli <raistlin@linux.it>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Fri, 16 Nov 2012 13:00:52 +0100
In-Reply-To: <1353063234.5351.107.camel@Solace>
References: <1350999260.5064.56.camel@Solace>
	<5086B4DF.6060701@eu.citrix.com> <1352981447.5351.51.camel@Solace>
	<50A4DD95.5020107@eu.citrix.com> <1353063234.5351.107.camel@Solace>
X-Mailer: Evolution 3.4.4-1
Mime-Version: 1.0
Cc: Keir Fraser <keir.xen@gmail.com>, David Vrabel <david.vrabel@citrix.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] About vcpu wakeup and runq tickling in credit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2383207931543302055=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--===============2383207931543302055==
Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature";
	boundary="=-591mSKpjXB/GL/EzDm3n"


--=-591mSKpjXB/GL/EzDm3n
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, 2012-11-16 at 11:53 +0100, Dario Faggioli wrote:
> On Thu, 2012-11-15 at 12:18 +0000, George Dunlap wrote:
> > Maybe what we should do is do the wake-up based on who is likely to run=
=20
> > on the current cpu: i.e., if "current" is likely to be pre-empted, look=
=20
> > at idlers based on "current"'s mask; if "new" is likely to be put on th=
e=20
> > queue, look at idlers based on "new"'s mask.
> >=20
> Ok, find attached the two (trivial) patches that I produced and am
> testing in these days. Unfortunately, early results shows that I/we
> might be missing something.
>=20
I'm just came to thinking that this approach, although more, say,
correct, could have a bad impact on caches and locality in general.

In fact, suppose a new vcpu N wakes up on pcpu #x where another vcpu C
is running, with prio(N)>prio(C).

What upstream does is asking to #x and to all the idlers that can
execute N to reschedule. Doing both is, I think, wrong, as there's the
chance of ending up with N being scheduled on #x and C being runnable
but not running (in #x's runqueue) even if there are idle cpus that
could run it, as they're not poked (as already and repeatedly said).

What the patches do, in this case (remember (prio(N)>prio(C)), is asking
#x and all the idlers that can run C to reschedule, the effect being
that N will likely run on #x, after a context switch, and C will run
somewhere else, after a migration, potentially wasting its cache-hotness
(it is running after all!).

It looks like we can do better... Something like the below:
 + if there are no idlers where N can run, ask #x and the idlers where=20
   C can run to reschedule (exactly what the patches do, although, they=20
   do that _unconditionally_), as there isn't anything else we can do
   to try to make sure they both will run;
 + if *there*are* idlers where N can run, _do_not_ ask #x to reschedule=20
   and only poke them to come pick N up. In fact, in this case, it is=20
   not necessary to send C away for having both the vcpus ruunning, and=20
   it seems better to have N experience the migration as, since it's=20
   waking-up, it's more likely for him than for C to be cache-cold.

I'll run the benchmarks with this variant as soon as the one that I'm
running right now finish... In the meanwhile, any thoughts?

Thanks and Regards,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-591mSKpjXB/GL/EzDm3n
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCmKvQACgkQk4XaBE3IOsQCFQCfQMQYQ8D9jUKKn5WWzgUkACZD
PbsAnAuKcE8iHBoS/VzadHjedt6RFtPD
=i2k7
-----END PGP SIGNATURE-----

--=-591mSKpjXB/GL/EzDm3n--



--===============2383207931543302055==
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.xen.org
http://lists.xen.org/xen-devel

--===============2383207931543302055==--



From xen-devel-bounces@lists.xen.org Fri Nov 16 12:01:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 12:01:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZKbZ-0000b8-Uu; Fri, 16 Nov 2012 12:01:05 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <raistlin.df@gmail.com>) id 1TZKbY-0000ay-Jo
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 12:01:04 +0000
Received: from [193.109.254.147:47554] by server-2.bemta-14.messagelabs.com id
	BB/39-20829-FFA26A05; Fri, 16 Nov 2012 12:01:03 +0000
X-Env-Sender: raistlin.df@gmail.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1353067262!9947961!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8843 invoked from network); 16 Nov 2012 12:01:02 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 12:01:02 -0000
Received: by mail-we0-f173.google.com with SMTP id r1so1154123wey.32
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 04:01:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:subject:from:to:cc:date:in-reply-to:references
	:content-type:x-mailer:mime-version;
	bh=FEYS9he7x3COzLMBijPImBTo6/1GtInzFMGeApDZsAw=;
	b=yjIPvDi88rt1a4jAmWqBaZw/lLF0dmpaITrcz2QCUr3/h+UjooNrhHiyaaSckAUwym
	6c4LixoD/yVgefHwf6fd/iWp9coVqTQWEdYxNUudYxpIn18rTvn51nI9Sd5mJdua7Pam
	b7OAnCYj5NHWjafnbq0yXF0tGQj3Kf+2mMwHiDt0PEW02spvsv2vYBci2ILe5MwAh8Rv
	MOJHb6waIp9DPYVU72ruKv0IZ4jmF48xF1NcA8tDFqMHj39nLBVnw7Poii6+YL7bU1jv
	g2YjcHdnreRIsp10gLdpdoEXL7mok+1oD/Uquj5Tfq3AKaggRqiXV9odisCm+YXz6x8L
	Tgbw==
Received: by 10.216.195.159 with SMTP id p31mr1664880wen.139.1353067262075;
	Fri, 16 Nov 2012 04:01:02 -0800 (PST)
Received: from [192.168.0.40] (ip-176-53.sn2.eutelia.it. [83.211.176.53])
	by mx.google.com with ESMTPS id d16sm448398wiw.8.2012.11.16.04.00.59
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 16 Nov 2012 04:01:00 -0800 (PST)
Message-ID: <1353067252.5351.124.camel@Solace>
From: Dario Faggioli <raistlin@linux.it>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Fri, 16 Nov 2012 13:00:52 +0100
In-Reply-To: <1353063234.5351.107.camel@Solace>
References: <1350999260.5064.56.camel@Solace>
	<5086B4DF.6060701@eu.citrix.com> <1352981447.5351.51.camel@Solace>
	<50A4DD95.5020107@eu.citrix.com> <1353063234.5351.107.camel@Solace>
X-Mailer: Evolution 3.4.4-1
Mime-Version: 1.0
Cc: Keir Fraser <keir.xen@gmail.com>, David Vrabel <david.vrabel@citrix.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] About vcpu wakeup and runq tickling in credit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2383207931543302055=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--===============2383207931543302055==
Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature";
	boundary="=-591mSKpjXB/GL/EzDm3n"


--=-591mSKpjXB/GL/EzDm3n
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, 2012-11-16 at 11:53 +0100, Dario Faggioli wrote:
> On Thu, 2012-11-15 at 12:18 +0000, George Dunlap wrote:
> > Maybe what we should do is do the wake-up based on who is likely to run=
=20
> > on the current cpu: i.e., if "current" is likely to be pre-empted, look=
=20
> > at idlers based on "current"'s mask; if "new" is likely to be put on th=
e=20
> > queue, look at idlers based on "new"'s mask.
> >=20
> Ok, find attached the two (trivial) patches that I produced and am
> testing in these days. Unfortunately, early results shows that I/we
> might be missing something.
>=20
I'm just came to thinking that this approach, although more, say,
correct, could have a bad impact on caches and locality in general.

In fact, suppose a new vcpu N wakes up on pcpu #x where another vcpu C
is running, with prio(N)>prio(C).

What upstream does is asking to #x and to all the idlers that can
execute N to reschedule. Doing both is, I think, wrong, as there's the
chance of ending up with N being scheduled on #x and C being runnable
but not running (in #x's runqueue) even if there are idle cpus that
could run it, as they're not poked (as already and repeatedly said).

What the patches do, in this case (remember (prio(N)>prio(C)), is asking
#x and all the idlers that can run C to reschedule, the effect being
that N will likely run on #x, after a context switch, and C will run
somewhere else, after a migration, potentially wasting its cache-hotness
(it is running after all!).

It looks like we can do better... Something like the below:
 + if there are no idlers where N can run, ask #x and the idlers where=20
   C can run to reschedule (exactly what the patches do, although, they=20
   do that _unconditionally_), as there isn't anything else we can do
   to try to make sure they both will run;
 + if *there*are* idlers where N can run, _do_not_ ask #x to reschedule=20
   and only poke them to come pick N up. In fact, in this case, it is=20
   not necessary to send C away for having both the vcpus ruunning, and=20
   it seems better to have N experience the migration as, since it's=20
   waking-up, it's more likely for him than for C to be cache-cold.

I'll run the benchmarks with this variant as soon as the one that I'm
running right now finish... In the meanwhile, any thoughts?

Thanks and Regards,
Dario

--=20
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


--=-591mSKpjXB/GL/EzDm3n
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEABECAAYFAlCmKvQACgkQk4XaBE3IOsQCFQCfQMQYQ8D9jUKKn5WWzgUkACZD
PbsAnAuKcE8iHBoS/VzadHjedt6RFtPD
=i2k7
-----END PGP SIGNATURE-----

--=-591mSKpjXB/GL/EzDm3n--



--===============2383207931543302055==
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.xen.org
http://lists.xen.org/xen-devel

--===============2383207931543302055==--



From xen-devel-bounces@lists.xen.org Fri Nov 16 12:25:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 12:25:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZKyc-00016d-31; Fri, 16 Nov 2012 12:24:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TZKyZ-00016Y-Qm
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 12:24:51 +0000
Received: from [85.158.138.51:47508] by server-2.bemta-3.messagelabs.com id
	E0/FE-04744-E8036A05; Fri, 16 Nov 2012 12:24:46 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1353068685!30270082!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29693 invoked from network); 16 Nov 2012 12:24:45 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 12:24:45 -0000
X-IronPort-AV: E=Sophos;i="4.83,264,1352073600"; d="scan'208";a="15849392"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 12:24:44 +0000
Received: from [192.168.1.30] (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 12:24:43 +0000
Message-ID: <50A6308B.1010006@citrix.com>
Date: Fri, 16 Nov 2012 13:24:43 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel <xen-devel@lists.xen.org>
References: <1350661627-20775-1-git-send-email-roger.pau@citrix.com>
In-Reply-To: <1350661627-20775-1-git-send-email-roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: restore GNTTABOP_dump_table
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 19/10/12 17:47, Roger Pau Monne wrote:
> This operation was dropped long time ago, but I found it quite helpful
> for debugging purposes. This re-implementation uses the code already
> present in gnttab_usage_print and adds the maptrack-table dump.

Is there any interest on this patch?


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 12:25:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 12:25:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZKyc-00016d-31; Fri, 16 Nov 2012 12:24:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TZKyZ-00016Y-Qm
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 12:24:51 +0000
Received: from [85.158.138.51:47508] by server-2.bemta-3.messagelabs.com id
	E0/FE-04744-E8036A05; Fri, 16 Nov 2012 12:24:46 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1353068685!30270082!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29693 invoked from network); 16 Nov 2012 12:24:45 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 12:24:45 -0000
X-IronPort-AV: E=Sophos;i="4.83,264,1352073600"; d="scan'208";a="15849392"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 12:24:44 +0000
Received: from [192.168.1.30] (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 12:24:43 +0000
Message-ID: <50A6308B.1010006@citrix.com>
Date: Fri, 16 Nov 2012 13:24:43 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel <xen-devel@lists.xen.org>
References: <1350661627-20775-1-git-send-email-roger.pau@citrix.com>
In-Reply-To: <1350661627-20775-1-git-send-email-roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: restore GNTTABOP_dump_table
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 19/10/12 17:47, Roger Pau Monne wrote:
> This operation was dropped long time ago, but I found it quite helpful
> for debugging purposes. This re-implementation uses the code already
> present in gnttab_usage_print and adds the maptrack-table dump.

Is there any interest on this patch?


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 12:41:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 12:41:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZLEK-0001NB-LM; Fri, 16 Nov 2012 12:41:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1TZLEJ-0001N3-Q0
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 12:41:08 +0000
Received: from [85.158.138.51:9913] by server-1.bemta-3.messagelabs.com id
	B5/41-12169-E5436A05; Fri, 16 Nov 2012 12:41:02 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-10.tower-174.messagelabs.com!1353069661!26257188!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19404 invoked from network); 16 Nov 2012 12:41:02 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Nov 2012 12:41:02 -0000
Received: from 68-64-ftth.on.nl ([88.159.64.68]:56320 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1TZLH8-0006WF-3M; Fri, 16 Nov 2012 13:44:02 +0100
Date: Fri, 16 Nov 2012 13:40:56 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <791265057.20121116134056@eikelenboom.it>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: [Xen-devel] [ 3009.778974] mcelog:16842 map pfn expected mapping
	type write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi Konrad,

Sometime ago i reported this one at boot up:

[ 3009.778974] mcelog:16842 map pfn expected mapping type write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus
[ 3009.788570] ------------[ cut here ]------------
[ 3009.798175] WARNING: at arch/x86/mm/pat.c:774 untrack_pfn+0xa1/0xb0()
[ 3009.807966] Hardware name: MS-7640
[ 3009.817677] Modules linked in:
[ 3009.827524] Pid: 16842, comm: mcelog Tainted: G        W    3.7.0-rc5-20121116-reverted-persistent-warn-patwarn #1
[ 3009.837415] Call Trace:
[ 3009.847110]  [<ffffffff810674fa>] warn_slowpath_common+0x7a/0xb0
[ 3009.856857]  [<ffffffff81067545>] warn_slowpath_null+0x15/0x20
[ 3009.866562]  [<ffffffff81042041>] untrack_pfn+0xa1/0xb0
[ 3009.876201]  [<ffffffff8111a59b>] unmap_single_vma+0x86b/0x8e0
[ 3009.885895]  [<ffffffff81100f16>] ? release_pages+0x196/0x1f0
[ 3009.895488]  [<ffffffff8111a65c>] unmap_vmas+0x4c/0xa0
[ 3009.905134]  [<ffffffff8111c8fa>] exit_mmap+0x9a/0x180
[ 3009.914706]  [<ffffffff81064e72>] mmput+0x52/0xd0
[ 3009.924252]  [<ffffffff810652b7>] dup_mm+0x3c7/0x510
[ 3009.933839]  [<ffffffff81065fd5>] copy_process+0xac5/0x14a0
[ 3009.943430]  [<ffffffff81066af3>] do_fork+0x53/0x360
[ 3009.952843]  [<ffffffff810b25c7>] ? lock_release+0x117/0x250
[ 3009.962283]  [<ffffffff817d26c0>] ? _raw_spin_unlock+0x30/0x60
[ 3009.971532]  [<ffffffff817d3495>] ? sysret_check+0x22/0x5d
[ 3009.980820]  [<ffffffff81017523>] sys_clone+0x23/0x30
[ 3009.990046]  [<ffffffff817d37f3>] stub_clone+0x13/0x20
[ 3009.999335]  [<ffffffff817d3469>] ? system_call_fastpath+0x16/0x1b
[ 3010.008667] ---[ end trace 2d9694c2c0a24da8 ]---


It seems to be due to the "mcelog" userspace tool provided with Debian Squeeze (mcelog 1.0~pre3-3  x86-64 Machine Check Exceptions collector and decoder).
I can trigger this warning easily by restarting the mcelog tool with /etc/init.d/mcelog restart

Should that one also function with the xen mcelog driver, or is a newer version required ?

--
Sander


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 12:41:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 12:41:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZLEK-0001NB-LM; Fri, 16 Nov 2012 12:41:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1TZLEJ-0001N3-Q0
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 12:41:08 +0000
Received: from [85.158.138.51:9913] by server-1.bemta-3.messagelabs.com id
	B5/41-12169-E5436A05; Fri, 16 Nov 2012 12:41:02 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-10.tower-174.messagelabs.com!1353069661!26257188!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19404 invoked from network); 16 Nov 2012 12:41:02 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Nov 2012 12:41:02 -0000
Received: from 68-64-ftth.on.nl ([88.159.64.68]:56320 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1TZLH8-0006WF-3M; Fri, 16 Nov 2012 13:44:02 +0100
Date: Fri, 16 Nov 2012 13:40:56 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <791265057.20121116134056@eikelenboom.it>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: [Xen-devel] [ 3009.778974] mcelog:16842 map pfn expected mapping
	type write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi Konrad,

Sometime ago i reported this one at boot up:

[ 3009.778974] mcelog:16842 map pfn expected mapping type write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus
[ 3009.788570] ------------[ cut here ]------------
[ 3009.798175] WARNING: at arch/x86/mm/pat.c:774 untrack_pfn+0xa1/0xb0()
[ 3009.807966] Hardware name: MS-7640
[ 3009.817677] Modules linked in:
[ 3009.827524] Pid: 16842, comm: mcelog Tainted: G        W    3.7.0-rc5-20121116-reverted-persistent-warn-patwarn #1
[ 3009.837415] Call Trace:
[ 3009.847110]  [<ffffffff810674fa>] warn_slowpath_common+0x7a/0xb0
[ 3009.856857]  [<ffffffff81067545>] warn_slowpath_null+0x15/0x20
[ 3009.866562]  [<ffffffff81042041>] untrack_pfn+0xa1/0xb0
[ 3009.876201]  [<ffffffff8111a59b>] unmap_single_vma+0x86b/0x8e0
[ 3009.885895]  [<ffffffff81100f16>] ? release_pages+0x196/0x1f0
[ 3009.895488]  [<ffffffff8111a65c>] unmap_vmas+0x4c/0xa0
[ 3009.905134]  [<ffffffff8111c8fa>] exit_mmap+0x9a/0x180
[ 3009.914706]  [<ffffffff81064e72>] mmput+0x52/0xd0
[ 3009.924252]  [<ffffffff810652b7>] dup_mm+0x3c7/0x510
[ 3009.933839]  [<ffffffff81065fd5>] copy_process+0xac5/0x14a0
[ 3009.943430]  [<ffffffff81066af3>] do_fork+0x53/0x360
[ 3009.952843]  [<ffffffff810b25c7>] ? lock_release+0x117/0x250
[ 3009.962283]  [<ffffffff817d26c0>] ? _raw_spin_unlock+0x30/0x60
[ 3009.971532]  [<ffffffff817d3495>] ? sysret_check+0x22/0x5d
[ 3009.980820]  [<ffffffff81017523>] sys_clone+0x23/0x30
[ 3009.990046]  [<ffffffff817d37f3>] stub_clone+0x13/0x20
[ 3009.999335]  [<ffffffff817d3469>] ? system_call_fastpath+0x16/0x1b
[ 3010.008667] ---[ end trace 2d9694c2c0a24da8 ]---


It seems to be due to the "mcelog" userspace tool provided with Debian Squeeze (mcelog 1.0~pre3-3  x86-64 Machine Check Exceptions collector and decoder).
I can trigger this warning easily by restarting the mcelog tool with /etc/init.d/mcelog restart

Should that one also function with the xen mcelog driver, or is a newer version required ?

--
Sander


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 13:14:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 13:14:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZLki-0002Ce-V2; Fri, 16 Nov 2012 13:14:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZLkh-0002CZ-64
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 13:14:35 +0000
Received: from [85.158.143.35:64849] by server-1.bemta-4.messagelabs.com id
	45/49-27934-A3C36A05; Fri, 16 Nov 2012 13:14:34 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1353071663!11463095!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18368 invoked from network); 16 Nov 2012 13:14:23 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-21.messagelabs.com with SMTP;
	16 Nov 2012 13:14:23 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 13:14:24 +0000
Message-Id: <50A64A3E02000078000A93F0@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 13:14:22 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part9CAD673E.3__="
Cc: Yang Z Zhang <yang.z.zhang@intel.com>, Wei Huang <wei.huang2@amd.com>,
	Wei Wang <weiwang.dd@gmail.com>, xiantao.zhang@intel.com
Subject: [Xen-devel] [PATCH] passthrough/PCI: replace improper uses of
 pci_find_next_cap()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part9CAD673E.3__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Using pci_find_next_cap() without prior pci_find_cap_offset() is bogus
(and possibly wrong, given that the latter doesn't check the
PCI_STATUS_CAP_LIST flag, which so far was checked in an open-coded way
only for the non-bridge case).

Once at it, fold the two calls into one, as we need its result in any
case.

Question is whether, without any caller left, pci_find_next_cap()
should be purged as well.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -589,16 +589,13 @@ void pci_release_devices(struct domain *
=20
 int pdev_type(u16 seg, u8 bus, u8 devfn)
 {
-    u16 class_device;
-    u16 status, creg;
-    int pos;
+    u16 class_device, creg;
     u8 d =3D PCI_SLOT(devfn), f =3D PCI_FUNC(devfn);
+    int pos =3D pci_find_cap_offset(seg, bus, d, f, PCI_CAP_ID_EXP);
=20
     class_device =3D pci_conf_read16(seg, bus, d, f, PCI_CLASS_DEVICE);
     if ( class_device =3D=3D PCI_CLASS_BRIDGE_PCI )
     {
-        pos =3D pci_find_next_cap(seg, bus, devfn,
-                                PCI_CAPABILITY_LIST, PCI_CAP_ID_EXP);
         if ( !pos )
             return DEV_TYPE_LEGACY_PCI_BRIDGE;
         creg =3D pci_conf_read16(seg, bus, d, f, pos + PCI_EXP_FLAGS);
@@ -606,15 +603,7 @@ int pdev_type(u16 seg, u8 bus, u8 devfn)
             DEV_TYPE_PCIe2PCI_BRIDGE : DEV_TYPE_PCIe_BRIDGE;
     }
=20
-    status =3D pci_conf_read16(seg, bus, d, f, PCI_STATUS);
-    if ( !(status & PCI_STATUS_CAP_LIST) )
-        return DEV_TYPE_PCI;
-
-    if ( pci_find_next_cap(seg, bus, devfn, PCI_CAPABILITY_LIST,
-                           PCI_CAP_ID_EXP) )
-        return DEV_TYPE_PCIe_ENDPOINT;
-
-    return DEV_TYPE_PCI;
+    return pos ? DEV_TYPE_PCIe_ENDPOINT : DEV_TYPE_PCI;
 }
=20
 /*




--=__Part9CAD673E.3__=
Content-Type: text/plain; name="PCI-find-next-cap.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="PCI-find-next-cap.patch"

passthrough/PCI: replace improper uses of pci_find_next_cap()=0A=0AUsing =
pci_find_next_cap() without prior pci_find_cap_offset() is bogus=0A(and =
possibly wrong, given that the latter doesn't check the=0APCI_STATUS_CAP_LI=
ST flag, which so far was checked in an open-coded way=0Aonly for the =
non-bridge case).=0A=0AOnce at it, fold the two calls into one, as we need =
its result in any=0Acase.=0A=0AQuestion is whether, without any caller =
left, pci_find_next_cap()=0Ashould be purged as well.=0A=0ASigned-off-by: =
Jan Beulich <jbeulich@suse.com>=0A=0A--- a/xen/drivers/passthrough/pci.c=0A=
+++ b/xen/drivers/passthrough/pci.c=0A@@ -589,16 +589,13 @@ void pci_releas=
e_devices(struct domain *=0A =0A int pdev_type(u16 seg, u8 bus, u8 =
devfn)=0A {=0A-    u16 class_device;=0A-    u16 status, creg;=0A-    int =
pos;=0A+    u16 class_device, creg;=0A     u8 d =3D PCI_SLOT(devfn), f =3D =
PCI_FUNC(devfn);=0A+    int pos =3D pci_find_cap_offset(seg, bus, d, f, =
PCI_CAP_ID_EXP);=0A =0A     class_device =3D pci_conf_read16(seg, bus, d, =
f, PCI_CLASS_DEVICE);=0A     if ( class_device =3D=3D PCI_CLASS_BRIDGE_PCI =
)=0A     {=0A-        pos =3D pci_find_next_cap(seg, bus, devfn,=0A-       =
                         PCI_CAPABILITY_LIST, PCI_CAP_ID_EXP);=0A         =
if ( !pos )=0A             return DEV_TYPE_LEGACY_PCI_BRIDGE;=0A         =
creg =3D pci_conf_read16(seg, bus, d, f, pos + PCI_EXP_FLAGS);=0A@@ =
-606,15 +603,7 @@ int pdev_type(u16 seg, u8 bus, u8 devfn)=0A             =
DEV_TYPE_PCIe2PCI_BRIDGE : DEV_TYPE_PCIe_BRIDGE;=0A     }=0A =0A-    =
status =3D pci_conf_read16(seg, bus, d, f, PCI_STATUS);=0A-    if ( =
!(status & PCI_STATUS_CAP_LIST) )=0A-        return DEV_TYPE_PCI;=0A-=0A-  =
  if ( pci_find_next_cap(seg, bus, devfn, PCI_CAPABILITY_LIST,=0A-         =
                  PCI_CAP_ID_EXP) )=0A-        return DEV_TYPE_PCIe_ENDPOIN=
T;=0A-=0A-    return DEV_TYPE_PCI;=0A+    return pos ? DEV_TYPE_PCIe_ENDPOI=
NT : DEV_TYPE_PCI;=0A }=0A =0A /*=0A
--=__Part9CAD673E.3__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part9CAD673E.3__=--


From xen-devel-bounces@lists.xen.org Fri Nov 16 13:14:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 13:14:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZLki-0002Ce-V2; Fri, 16 Nov 2012 13:14:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZLkh-0002CZ-64
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 13:14:35 +0000
Received: from [85.158.143.35:64849] by server-1.bemta-4.messagelabs.com id
	45/49-27934-A3C36A05; Fri, 16 Nov 2012 13:14:34 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1353071663!11463095!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18368 invoked from network); 16 Nov 2012 13:14:23 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-21.messagelabs.com with SMTP;
	16 Nov 2012 13:14:23 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 13:14:24 +0000
Message-Id: <50A64A3E02000078000A93F0@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 13:14:22 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part9CAD673E.3__="
Cc: Yang Z Zhang <yang.z.zhang@intel.com>, Wei Huang <wei.huang2@amd.com>,
	Wei Wang <weiwang.dd@gmail.com>, xiantao.zhang@intel.com
Subject: [Xen-devel] [PATCH] passthrough/PCI: replace improper uses of
 pci_find_next_cap()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part9CAD673E.3__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Using pci_find_next_cap() without prior pci_find_cap_offset() is bogus
(and possibly wrong, given that the latter doesn't check the
PCI_STATUS_CAP_LIST flag, which so far was checked in an open-coded way
only for the non-bridge case).

Once at it, fold the two calls into one, as we need its result in any
case.

Question is whether, without any caller left, pci_find_next_cap()
should be purged as well.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -589,16 +589,13 @@ void pci_release_devices(struct domain *
=20
 int pdev_type(u16 seg, u8 bus, u8 devfn)
 {
-    u16 class_device;
-    u16 status, creg;
-    int pos;
+    u16 class_device, creg;
     u8 d =3D PCI_SLOT(devfn), f =3D PCI_FUNC(devfn);
+    int pos =3D pci_find_cap_offset(seg, bus, d, f, PCI_CAP_ID_EXP);
=20
     class_device =3D pci_conf_read16(seg, bus, d, f, PCI_CLASS_DEVICE);
     if ( class_device =3D=3D PCI_CLASS_BRIDGE_PCI )
     {
-        pos =3D pci_find_next_cap(seg, bus, devfn,
-                                PCI_CAPABILITY_LIST, PCI_CAP_ID_EXP);
         if ( !pos )
             return DEV_TYPE_LEGACY_PCI_BRIDGE;
         creg =3D pci_conf_read16(seg, bus, d, f, pos + PCI_EXP_FLAGS);
@@ -606,15 +603,7 @@ int pdev_type(u16 seg, u8 bus, u8 devfn)
             DEV_TYPE_PCIe2PCI_BRIDGE : DEV_TYPE_PCIe_BRIDGE;
     }
=20
-    status =3D pci_conf_read16(seg, bus, d, f, PCI_STATUS);
-    if ( !(status & PCI_STATUS_CAP_LIST) )
-        return DEV_TYPE_PCI;
-
-    if ( pci_find_next_cap(seg, bus, devfn, PCI_CAPABILITY_LIST,
-                           PCI_CAP_ID_EXP) )
-        return DEV_TYPE_PCIe_ENDPOINT;
-
-    return DEV_TYPE_PCI;
+    return pos ? DEV_TYPE_PCIe_ENDPOINT : DEV_TYPE_PCI;
 }
=20
 /*




--=__Part9CAD673E.3__=
Content-Type: text/plain; name="PCI-find-next-cap.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="PCI-find-next-cap.patch"

passthrough/PCI: replace improper uses of pci_find_next_cap()=0A=0AUsing =
pci_find_next_cap() without prior pci_find_cap_offset() is bogus=0A(and =
possibly wrong, given that the latter doesn't check the=0APCI_STATUS_CAP_LI=
ST flag, which so far was checked in an open-coded way=0Aonly for the =
non-bridge case).=0A=0AOnce at it, fold the two calls into one, as we need =
its result in any=0Acase.=0A=0AQuestion is whether, without any caller =
left, pci_find_next_cap()=0Ashould be purged as well.=0A=0ASigned-off-by: =
Jan Beulich <jbeulich@suse.com>=0A=0A--- a/xen/drivers/passthrough/pci.c=0A=
+++ b/xen/drivers/passthrough/pci.c=0A@@ -589,16 +589,13 @@ void pci_releas=
e_devices(struct domain *=0A =0A int pdev_type(u16 seg, u8 bus, u8 =
devfn)=0A {=0A-    u16 class_device;=0A-    u16 status, creg;=0A-    int =
pos;=0A+    u16 class_device, creg;=0A     u8 d =3D PCI_SLOT(devfn), f =3D =
PCI_FUNC(devfn);=0A+    int pos =3D pci_find_cap_offset(seg, bus, d, f, =
PCI_CAP_ID_EXP);=0A =0A     class_device =3D pci_conf_read16(seg, bus, d, =
f, PCI_CLASS_DEVICE);=0A     if ( class_device =3D=3D PCI_CLASS_BRIDGE_PCI =
)=0A     {=0A-        pos =3D pci_find_next_cap(seg, bus, devfn,=0A-       =
                         PCI_CAPABILITY_LIST, PCI_CAP_ID_EXP);=0A         =
if ( !pos )=0A             return DEV_TYPE_LEGACY_PCI_BRIDGE;=0A         =
creg =3D pci_conf_read16(seg, bus, d, f, pos + PCI_EXP_FLAGS);=0A@@ =
-606,15 +603,7 @@ int pdev_type(u16 seg, u8 bus, u8 devfn)=0A             =
DEV_TYPE_PCIe2PCI_BRIDGE : DEV_TYPE_PCIe_BRIDGE;=0A     }=0A =0A-    =
status =3D pci_conf_read16(seg, bus, d, f, PCI_STATUS);=0A-    if ( =
!(status & PCI_STATUS_CAP_LIST) )=0A-        return DEV_TYPE_PCI;=0A-=0A-  =
  if ( pci_find_next_cap(seg, bus, devfn, PCI_CAPABILITY_LIST,=0A-         =
                  PCI_CAP_ID_EXP) )=0A-        return DEV_TYPE_PCIe_ENDPOIN=
T;=0A-=0A-    return DEV_TYPE_PCI;=0A+    return pos ? DEV_TYPE_PCIe_ENDPOI=
NT : DEV_TYPE_PCI;=0A }=0A =0A /*=0A
--=__Part9CAD673E.3__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part9CAD673E.3__=--


From xen-devel-bounces@lists.xen.org Fri Nov 16 13:15:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 13:15:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZLkx-0002DK-BT; Fri, 16 Nov 2012 13:14:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZLkv-0002DE-S2
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 13:14:50 +0000
Received: from [85.158.143.35:61872] by server-2.bemta-4.messagelabs.com id
	52/1A-28922-94C36A05; Fri, 16 Nov 2012 13:14:49 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1353071688!14227109!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16967 invoked from network); 16 Nov 2012 13:14:48 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-21.messagelabs.com with SMTP;
	16 Nov 2012 13:14:48 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 13:14:51 +0000
Message-Id: <50A64A5802000078000A93F4@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 13:14:48 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartFACB0158.0__="
Subject: [Xen-devel] [PATCH] vscsiif: minor cleanup
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartFACB0158.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Remove a definition not belonging into the interface, and correct a
few typos in comments.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/public/io/vscsiif.h
+++ b/xen/include/public/io/vscsiif.h
@@ -30,25 +30,22 @@
 #include "ring.h"
 #include "../grant_table.h"
=20
-/* command between backend and frontend */
+/* commands between backend and frontend */
 #define VSCSIIF_ACT_SCSI_CDB         1    /* SCSI CDB command */
 #define VSCSIIF_ACT_SCSI_ABORT       2    /* SCSI Device(Lun) Abort*/
 #define VSCSIIF_ACT_SCSI_RESET       3    /* SCSI Device(Lun) Reset*/
=20
-
-#define VSCSIIF_BACK_MAX_PENDING_REQS    128
-
 /*
  * Maximum scatter/gather segments per request.
  *
- * Considering balance between allocating al least 16 "vscsiif_request"
- * structures on one page (4096bytes) and number of scatter gather=20
- * needed, we decided to use 26 as a magic number.
+ * Considering balance between allocating at least 16 "vscsiif_request"
+ * structures on one page (4096 bytes) and the number of scatter/gather
+ * elements needed, we decided to use 26 as a magic number.
  */
 #define VSCSIIF_SG_TABLESIZE             26
=20
 /*
- * base on linux kernel 2.6.18
+ * based on Linux kernel 2.6.18
  */
 #define VSCSIIF_MAX_COMMAND_SIZE         16
 #define VSCSIIF_SENSE_BUFFERSIZE         96




--=__PartFACB0158.0__=
Content-Type: text/plain; name="vscsiif-cleanup.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="vscsiif-cleanup.patch"

vscsiif: minor cleanup=0A=0ARemove a definition not belonging into the =
interface, and correct a=0Afew typos in comments.=0A=0ASigned-off-by: Jan =
Beulich <jbeulich@suse.com>=0A=0A--- a/xen/include/public/io/vscsiif.h=0A++=
+ b/xen/include/public/io/vscsiif.h=0A@@ -30,25 +30,22 @@=0A #include =
"ring.h"=0A #include "../grant_table.h"=0A =0A-/* command between backend =
and frontend */=0A+/* commands between backend and frontend */=0A #define =
VSCSIIF_ACT_SCSI_CDB         1    /* SCSI CDB command */=0A #define =
VSCSIIF_ACT_SCSI_ABORT       2    /* SCSI Device(Lun) Abort*/=0A #define =
VSCSIIF_ACT_SCSI_RESET       3    /* SCSI Device(Lun) Reset*/=0A =0A-=0A-#d=
efine VSCSIIF_BACK_MAX_PENDING_REQS    128=0A-=0A /*=0A  * Maximum =
scatter/gather segments per request.=0A  *=0A- * Considering balance =
between allocating al least 16 "vscsiif_request"=0A- * structures on one =
page (4096bytes) and number of scatter gather =0A- * needed, we decided to =
use 26 as a magic number.=0A+ * Considering balance between allocating at =
least 16 "vscsiif_request"=0A+ * structures on one page (4096 bytes) and =
the number of scatter/gather=0A+ * elements needed, we decided to use 26 =
as a magic number.=0A  */=0A #define VSCSIIF_SG_TABLESIZE             =
26=0A =0A /*=0A- * base on linux kernel 2.6.18=0A+ * based on Linux kernel =
2.6.18=0A  */=0A #define VSCSIIF_MAX_COMMAND_SIZE         16=0A #define =
VSCSIIF_SENSE_BUFFERSIZE         96=0A
--=__PartFACB0158.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.xen.org
http://lists.xen.org/xen-devel

--=__PartFACB0158.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 16 13:15:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 13:15:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZLkx-0002DK-BT; Fri, 16 Nov 2012 13:14:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TZLkv-0002DE-S2
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 13:14:50 +0000
Received: from [85.158.143.35:61872] by server-2.bemta-4.messagelabs.com id
	52/1A-28922-94C36A05; Fri, 16 Nov 2012 13:14:49 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1353071688!14227109!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQxMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16967 invoked from network); 16 Nov 2012 13:14:48 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-21.messagelabs.com with SMTP;
	16 Nov 2012 13:14:48 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 16 Nov 2012 13:14:51 +0000
Message-Id: <50A64A5802000078000A93F4@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.0 
Date: Fri, 16 Nov 2012 13:14:48 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartFACB0158.0__="
Subject: [Xen-devel] [PATCH] vscsiif: minor cleanup
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartFACB0158.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Remove a definition not belonging into the interface, and correct a
few typos in comments.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/public/io/vscsiif.h
+++ b/xen/include/public/io/vscsiif.h
@@ -30,25 +30,22 @@
 #include "ring.h"
 #include "../grant_table.h"
=20
-/* command between backend and frontend */
+/* commands between backend and frontend */
 #define VSCSIIF_ACT_SCSI_CDB         1    /* SCSI CDB command */
 #define VSCSIIF_ACT_SCSI_ABORT       2    /* SCSI Device(Lun) Abort*/
 #define VSCSIIF_ACT_SCSI_RESET       3    /* SCSI Device(Lun) Reset*/
=20
-
-#define VSCSIIF_BACK_MAX_PENDING_REQS    128
-
 /*
  * Maximum scatter/gather segments per request.
  *
- * Considering balance between allocating al least 16 "vscsiif_request"
- * structures on one page (4096bytes) and number of scatter gather=20
- * needed, we decided to use 26 as a magic number.
+ * Considering balance between allocating at least 16 "vscsiif_request"
+ * structures on one page (4096 bytes) and the number of scatter/gather
+ * elements needed, we decided to use 26 as a magic number.
  */
 #define VSCSIIF_SG_TABLESIZE             26
=20
 /*
- * base on linux kernel 2.6.18
+ * based on Linux kernel 2.6.18
  */
 #define VSCSIIF_MAX_COMMAND_SIZE         16
 #define VSCSIIF_SENSE_BUFFERSIZE         96




--=__PartFACB0158.0__=
Content-Type: text/plain; name="vscsiif-cleanup.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="vscsiif-cleanup.patch"

vscsiif: minor cleanup=0A=0ARemove a definition not belonging into the =
interface, and correct a=0Afew typos in comments.=0A=0ASigned-off-by: Jan =
Beulich <jbeulich@suse.com>=0A=0A--- a/xen/include/public/io/vscsiif.h=0A++=
+ b/xen/include/public/io/vscsiif.h=0A@@ -30,25 +30,22 @@=0A #include =
"ring.h"=0A #include "../grant_table.h"=0A =0A-/* command between backend =
and frontend */=0A+/* commands between backend and frontend */=0A #define =
VSCSIIF_ACT_SCSI_CDB         1    /* SCSI CDB command */=0A #define =
VSCSIIF_ACT_SCSI_ABORT       2    /* SCSI Device(Lun) Abort*/=0A #define =
VSCSIIF_ACT_SCSI_RESET       3    /* SCSI Device(Lun) Reset*/=0A =0A-=0A-#d=
efine VSCSIIF_BACK_MAX_PENDING_REQS    128=0A-=0A /*=0A  * Maximum =
scatter/gather segments per request.=0A  *=0A- * Considering balance =
between allocating al least 16 "vscsiif_request"=0A- * structures on one =
page (4096bytes) and number of scatter gather =0A- * needed, we decided to =
use 26 as a magic number.=0A+ * Considering balance between allocating at =
least 16 "vscsiif_request"=0A+ * structures on one page (4096 bytes) and =
the number of scatter/gather=0A+ * elements needed, we decided to use 26 =
as a magic number.=0A  */=0A #define VSCSIIF_SG_TABLESIZE             =
26=0A =0A /*=0A- * base on linux kernel 2.6.18=0A+ * based on Linux kernel =
2.6.18=0A  */=0A #define VSCSIIF_MAX_COMMAND_SIZE         16=0A #define =
VSCSIIF_SENSE_BUFFERSIZE         96=0A
--=__PartFACB0158.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.xen.org
http://lists.xen.org/xen-devel

--=__PartFACB0158.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 16 13:53:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 13:53:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZMMM-0002qc-KY; Fri, 16 Nov 2012 13:53:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TZMMK-0002qX-QG
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 13:53:29 +0000
Received: from [193.109.254.147:60836] by server-5.bemta-14.messagelabs.com id
	6F/73-10257-85546A05; Fri, 16 Nov 2012 13:53:28 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1353074006!9637935!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29796 invoked from network); 16 Nov 2012 13:53:26 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-2.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 13:53:26 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TZMMI-000Nvc-CQ; Fri, 16 Nov 2012 13:53:26 +0000
Date: Fri, 16 Nov 2012 13:53:26 +0000
From: Tim Deegan <tim@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121116135326.GB89551@ocelot.phlegethon.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A6024F02000078000A9214@nat28.tlf.novell.com>
	<20121116105622.GA89551@ocelot.phlegethon.org>
	<50A6302802000078000A933C@nat28.tlf.novell.com>
	<50A6291B.2030208@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A6291B.2030208@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
	real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 11:52 +0000 on 16 Nov (1353066779), Andrew Cooper wrote:
> 
> On 16/11/12 11:23, Jan Beulich wrote:
> >>>> On 16.11.12 at 11:56, Tim Deegan <tim@xen.org> wrote:
> >> At 08:07 +0000 on 16 Nov (1353053247), Jan Beulich wrote:
> >>>> We could potentially solve the problem by having the MCE handler check
> >>>> whether it's returning to the NMI stack, and do a normal return in that
> >>>> case.  It's a bit of extra code but only in the MCE handler, which is
> >>>> not performance-critical. 
> >>> Yes, that could solve that nesting case (again not very difficult
> >>> to implement).
> >> How about we just have the MCE handler return without IRET in _all_
> >> cases where it's returning to ring 0?  I think that entirely solves the
> >> MCE-in-NMI problem, without all the extra mechanism meeded for the
> >> linux-style solution.
> > Good suggestion.
> >
> >>  (Unless we want to allow other traps in either
> >> the NMI or MCE handlers).
> > We should absolutely avoid that.
> >
> >> [And it occurs to me that the linux-style solution is tricky because
> >> detecting the case where you've taken an NMI and not yet set the
> >> nmi-in-progress flag is hard in both SVM (in the NMI handler but on the
> >> normal stack) and VMX (in the _vmexit_ handler and on the normal
> >> stack).]
> > Agreed.
> 
> But we never need to detect this case.  If we take an NMI and ensure
> there is no possibility for a trap before setting the nmi-in-progress
> flag

The problem is that there is no way to do that -- the trap we're worried
about is MCE, which can happen at any time.  That's why linux has the
backstop check for the case where the flag's not set but the return
address is on the NMI stack.

> (which is not very hard, with it being a handful of instructions in
> the handler),

It's quite a bit more than that in the VMX case.  I guess we need to
audit that code for possible faults.

> then we guarantee that NMIs are still blocked, and thus
> cant be reentrant.
> 
> Also, for what it is worth, we do have traps on the NMI path in the form
> of BUG()s, WARN()s and panic gubbins, although the host is in a fairly
> dire state if we actually ever hit any of these.

Ergh.  If there are any WARN()s we should get rid of them.  BUG()s are
fine. :)

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 13:53:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 13:53:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZMMM-0002qc-KY; Fri, 16 Nov 2012 13:53:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TZMMK-0002qX-QG
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 13:53:29 +0000
Received: from [193.109.254.147:60836] by server-5.bemta-14.messagelabs.com id
	6F/73-10257-85546A05; Fri, 16 Nov 2012 13:53:28 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1353074006!9637935!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29796 invoked from network); 16 Nov 2012 13:53:26 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-2.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 13:53:26 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TZMMI-000Nvc-CQ; Fri, 16 Nov 2012 13:53:26 +0000
Date: Fri, 16 Nov 2012 13:53:26 +0000
From: Tim Deegan <tim@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121116135326.GB89551@ocelot.phlegethon.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A6024F02000078000A9214@nat28.tlf.novell.com>
	<20121116105622.GA89551@ocelot.phlegethon.org>
	<50A6302802000078000A933C@nat28.tlf.novell.com>
	<50A6291B.2030208@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A6291B.2030208@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
	real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 11:52 +0000 on 16 Nov (1353066779), Andrew Cooper wrote:
> 
> On 16/11/12 11:23, Jan Beulich wrote:
> >>>> On 16.11.12 at 11:56, Tim Deegan <tim@xen.org> wrote:
> >> At 08:07 +0000 on 16 Nov (1353053247), Jan Beulich wrote:
> >>>> We could potentially solve the problem by having the MCE handler check
> >>>> whether it's returning to the NMI stack, and do a normal return in that
> >>>> case.  It's a bit of extra code but only in the MCE handler, which is
> >>>> not performance-critical. 
> >>> Yes, that could solve that nesting case (again not very difficult
> >>> to implement).
> >> How about we just have the MCE handler return without IRET in _all_
> >> cases where it's returning to ring 0?  I think that entirely solves the
> >> MCE-in-NMI problem, without all the extra mechanism meeded for the
> >> linux-style solution.
> > Good suggestion.
> >
> >>  (Unless we want to allow other traps in either
> >> the NMI or MCE handlers).
> > We should absolutely avoid that.
> >
> >> [And it occurs to me that the linux-style solution is tricky because
> >> detecting the case where you've taken an NMI and not yet set the
> >> nmi-in-progress flag is hard in both SVM (in the NMI handler but on the
> >> normal stack) and VMX (in the _vmexit_ handler and on the normal
> >> stack).]
> > Agreed.
> 
> But we never need to detect this case.  If we take an NMI and ensure
> there is no possibility for a trap before setting the nmi-in-progress
> flag

The problem is that there is no way to do that -- the trap we're worried
about is MCE, which can happen at any time.  That's why linux has the
backstop check for the case where the flag's not set but the return
address is on the NMI stack.

> (which is not very hard, with it being a handful of instructions in
> the handler),

It's quite a bit more than that in the VMX case.  I guess we need to
audit that code for possible faults.

> then we guarantee that NMIs are still blocked, and thus
> cant be reentrant.
> 
> Also, for what it is worth, we do have traps on the NMI path in the form
> of BUG()s, WARN()s and panic gubbins, although the host is in a fairly
> dire state if we actually ever hit any of these.

Ergh.  If there are any WARN()s we should get rid of them.  BUG()s are
fine. :)

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 13:58:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 13:58:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZMQf-00031H-AL; Fri, 16 Nov 2012 13:57:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZMQd-00031B-TL
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 13:57:56 +0000
Received: from [85.158.138.51:60283] by server-15.bemta-3.messagelabs.com id
	41/22-09445-36646A05; Fri, 16 Nov 2012 13:57:55 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353074273!30376904!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 905 invoked from network); 16 Nov 2012 13:57:54 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 13:57:54 -0000
X-IronPort-AV: E=Sophos;i="4.83,264,1352073600"; d="scan'208";a="15851474"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 13:57:41 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 13:57:40 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TZMQO-0007cI-Ns	for xen-devel@lists.xen.org;
	Fri, 16 Nov 2012 13:57:40 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TZMQO-0005J0-Kc	for
	xen-devel@lists.xen.org; Fri, 16 Nov 2012 13:57:40 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20646.18004.540288.625849@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 13:57:40 +0000
To: xen-devel@lists.xen.org
Subject: [Xen-devel] Addition of ITL/QubesOS to the Xen security
	predisclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The Xen.org security team received a request from Invisible Things Lab
to join the security predisclosure list.

ITL provided references to the following information regarding their
security processes:
  http://wiki.qubes-os.org/trac/wiki/SecurityPage
  http://wiki.qubes-os.org/trac/wiki/SecurityBulletins

Additionally we have previous good experiences working together with
ITL when they discovered security issues and disclosed them to us.

We therefore decided to accept this request, on the grounds that ITL
were a well-established organisation with a mature security response
process, and felt that that was a proper exercise of the discretion
granted to the security team by the process document.[1]

Since we are exercising our discretion, we felt it appropriate to make
a public statement of this particular decision.  If you have any
comments please make them here, or by emailing the team at
security@xen.org.

Thanks,
Ian.

[1] http://www.xen.org/projects/security_vulnerability_process.html

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 13:58:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 13:58:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZMQf-00031H-AL; Fri, 16 Nov 2012 13:57:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZMQd-00031B-TL
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 13:57:56 +0000
Received: from [85.158.138.51:60283] by server-15.bemta-3.messagelabs.com id
	41/22-09445-36646A05; Fri, 16 Nov 2012 13:57:55 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353074273!30376904!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 905 invoked from network); 16 Nov 2012 13:57:54 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 13:57:54 -0000
X-IronPort-AV: E=Sophos;i="4.83,264,1352073600"; d="scan'208";a="15851474"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 13:57:41 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 13:57:40 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TZMQO-0007cI-Ns	for xen-devel@lists.xen.org;
	Fri, 16 Nov 2012 13:57:40 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TZMQO-0005J0-Kc	for
	xen-devel@lists.xen.org; Fri, 16 Nov 2012 13:57:40 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20646.18004.540288.625849@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 13:57:40 +0000
To: xen-devel@lists.xen.org
Subject: [Xen-devel] Addition of ITL/QubesOS to the Xen security
	predisclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The Xen.org security team received a request from Invisible Things Lab
to join the security predisclosure list.

ITL provided references to the following information regarding their
security processes:
  http://wiki.qubes-os.org/trac/wiki/SecurityPage
  http://wiki.qubes-os.org/trac/wiki/SecurityBulletins

Additionally we have previous good experiences working together with
ITL when they discovered security issues and disclosed them to us.

We therefore decided to accept this request, on the grounds that ITL
were a well-established organisation with a mature security response
process, and felt that that was a proper exercise of the discretion
granted to the security team by the process document.[1]

Since we are exercising our discretion, we felt it appropriate to make
a public statement of this particular decision.  If you have any
comments please make them here, or by emailing the team at
security@xen.org.

Thanks,
Ian.

[1] http://www.xen.org/projects/security_vulnerability_process.html

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 14:11:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 14:11:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZMdU-0003R5-Qq; Fri, 16 Nov 2012 14:11:12 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TZMdT-0003Qq-Qa
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 14:11:12 +0000
Received: from [193.109.254.147:37044] by server-1.bemta-14.messagelabs.com id
	6F/4B-25314-F7946A05; Fri, 16 Nov 2012 14:11:11 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1353075069!1687615!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODY5MjY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10159 invoked from network); 16 Nov 2012 14:11:10 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 14:11:10 -0000
X-IronPort-AV: E=Sophos;i="4.83,264,1352073600"; d="scan'208";a="214744798"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 14:11:08 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 09:11:08 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TZMdQ-00061T-3r;
	Fri, 16 Nov 2012 14:11:08 +0000
Message-ID: <50A6497C.0@citrix.com>
Date: Fri, 16 Nov 2012 14:11:08 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A6024F02000078000A9214@nat28.tlf.novell.com>
	<20121116105622.GA89551@ocelot.phlegethon.org>
	<50A6302802000078000A933C@nat28.tlf.novell.com>
	<50A6291B.2030208@citrix.com>
	<20121116135326.GB89551@ocelot.phlegethon.org>
In-Reply-To: <20121116135326.GB89551@ocelot.phlegethon.org>
X-Enigmail-Version: 1.4.6
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 13:53, Tim Deegan wrote:
> At 11:52 +0000 on 16 Nov (1353066779), Andrew Cooper wrote:
>> On 16/11/12 11:23, Jan Beulich wrote:
>>>>>> On 16.11.12 at 11:56, Tim Deegan <tim@xen.org> wrote:
>>>> At 08:07 +0000 on 16 Nov (1353053247), Jan Beulich wrote:
>>>>>> We could potentially solve the problem by having the MCE handler check
>>>>>> whether it's returning to the NMI stack, and do a normal return in that
>>>>>> case.  It's a bit of extra code but only in the MCE handler, which is
>>>>>> not performance-critical. 
>>>>> Yes, that could solve that nesting case (again not very difficult
>>>>> to implement).
>>>> How about we just have the MCE handler return without IRET in _all_
>>>> cases where it's returning to ring 0?  I think that entirely solves the
>>>> MCE-in-NMI problem, without all the extra mechanism meeded for the
>>>> linux-style solution.
>>> Good suggestion.
>>>
>>>>  (Unless we want to allow other traps in either
>>>> the NMI or MCE handlers).
>>> We should absolutely avoid that.
>>>
>>>> [And it occurs to me that the linux-style solution is tricky because
>>>> detecting the case where you've taken an NMI and not yet set the
>>>> nmi-in-progress flag is hard in both SVM (in the NMI handler but on the
>>>> normal stack) and VMX (in the _vmexit_ handler and on the normal
>>>> stack).]
>>> Agreed.
>> But we never need to detect this case.  If we take an NMI and ensure
>> there is no possibility for a trap before setting the nmi-in-progress
>> flag
> The problem is that there is no way to do that -- the trap we're worried
> about is MCE, which can happen at any time.  That's why linux has the
> backstop check for the case where the flag's not set but the return
> address is on the NMI stack.

D'oh - your quite correct.  I overlooked that possibility.

>
>> (which is not very hard, with it being a handful of instructions in
>> the handler),
> It's quite a bit more than that in the VMX case.  I guess we need to
> audit that code for possible faults.

But if we fix the underlying NMI/MCE reentrant problem, then faults on
the vmexit patch cease to be an issue, do they not?  If and when
MCEs/NMIs/interrupts occur, they will be dealt with in the same manor as
any other interruption to hypervisor code.

~Andrew

>> then we guarantee that NMIs are still blocked, and thus
>> cant be reentrant.
>>
>> Also, for what it is worth, we do have traps on the NMI path in the form
>> of BUG()s, WARN()s and panic gubbins, although the host is in a fairly
>> dire state if we actually ever hit any of these.
> Ergh.  If there are any WARN()s we should get rid of them.  BUG()s are
> fine. :)
>
> Tim.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 14:11:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 14:11:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZMdU-0003R5-Qq; Fri, 16 Nov 2012 14:11:12 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TZMdT-0003Qq-Qa
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 14:11:12 +0000
Received: from [193.109.254.147:37044] by server-1.bemta-14.messagelabs.com id
	6F/4B-25314-F7946A05; Fri, 16 Nov 2012 14:11:11 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1353075069!1687615!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODY5MjY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10159 invoked from network); 16 Nov 2012 14:11:10 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 14:11:10 -0000
X-IronPort-AV: E=Sophos;i="4.83,264,1352073600"; d="scan'208";a="214744798"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 14:11:08 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 09:11:08 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TZMdQ-00061T-3r;
	Fri, 16 Nov 2012 14:11:08 +0000
Message-ID: <50A6497C.0@citrix.com>
Date: Fri, 16 Nov 2012 14:11:08 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50A37B1802000078000A86D5@nat28.tlf.novell.com>
	<20121115164156.GE75988@ocelot.phlegethon.org>
	<50A6024F02000078000A9214@nat28.tlf.novell.com>
	<20121116105622.GA89551@ocelot.phlegethon.org>
	<50A6302802000078000A933C@nat28.tlf.novell.com>
	<50A6291B.2030208@citrix.com>
	<20121116135326.GB89551@ocelot.phlegethon.org>
In-Reply-To: <20121116135326.GB89551@ocelot.phlegethon.org>
X-Enigmail-Version: 1.4.6
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 13:53, Tim Deegan wrote:
> At 11:52 +0000 on 16 Nov (1353066779), Andrew Cooper wrote:
>> On 16/11/12 11:23, Jan Beulich wrote:
>>>>>> On 16.11.12 at 11:56, Tim Deegan <tim@xen.org> wrote:
>>>> At 08:07 +0000 on 16 Nov (1353053247), Jan Beulich wrote:
>>>>>> We could potentially solve the problem by having the MCE handler check
>>>>>> whether it's returning to the NMI stack, and do a normal return in that
>>>>>> case.  It's a bit of extra code but only in the MCE handler, which is
>>>>>> not performance-critical. 
>>>>> Yes, that could solve that nesting case (again not very difficult
>>>>> to implement).
>>>> How about we just have the MCE handler return without IRET in _all_
>>>> cases where it's returning to ring 0?  I think that entirely solves the
>>>> MCE-in-NMI problem, without all the extra mechanism meeded for the
>>>> linux-style solution.
>>> Good suggestion.
>>>
>>>>  (Unless we want to allow other traps in either
>>>> the NMI or MCE handlers).
>>> We should absolutely avoid that.
>>>
>>>> [And it occurs to me that the linux-style solution is tricky because
>>>> detecting the case where you've taken an NMI and not yet set the
>>>> nmi-in-progress flag is hard in both SVM (in the NMI handler but on the
>>>> normal stack) and VMX (in the _vmexit_ handler and on the normal
>>>> stack).]
>>> Agreed.
>> But we never need to detect this case.  If we take an NMI and ensure
>> there is no possibility for a trap before setting the nmi-in-progress
>> flag
> The problem is that there is no way to do that -- the trap we're worried
> about is MCE, which can happen at any time.  That's why linux has the
> backstop check for the case where the flag's not set but the return
> address is on the NMI stack.

D'oh - your quite correct.  I overlooked that possibility.

>
>> (which is not very hard, with it being a handful of instructions in
>> the handler),
> It's quite a bit more than that in the VMX case.  I guess we need to
> audit that code for possible faults.

But if we fix the underlying NMI/MCE reentrant problem, then faults on
the vmexit patch cease to be an issue, do they not?  If and when
MCEs/NMIs/interrupts occur, they will be dealt with in the same manor as
any other interruption to hypervisor code.

~Andrew

>> then we guarantee that NMIs are still blocked, and thus
>> cant be reentrant.
>>
>> Also, for what it is worth, we do have traps on the NMI path in the form
>> of BUG()s, WARN()s and panic gubbins, although the host is in a fairly
>> dire state if we actually ever hit any of these.
> Ergh.  If there are any WARN()s we should get rid of them.  BUG()s are
> fine. :)
>
> Tim.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 14:47:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 14:47:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNCH-0003y0-AO; Fri, 16 Nov 2012 14:47:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZNCF-0003xk-11
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 14:47:07 +0000
Received: from [193.109.254.147:42613] by server-2.bemta-14.messagelabs.com id
	2F/B9-20829-AE156A05; Fri, 16 Nov 2012 14:47:06 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353077219!4229093!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30506 invoked from network); 16 Nov 2012 14:47:00 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 14:47:00 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="44848030"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 14:46:43 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 09:46:39 -0500
Received: from [10.80.3.146] (helo=localmatsp-T3500.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<mats.petersson@citrix.com>)	id 1TZNBm-0006Vn-S1;
	Fri, 16 Nov 2012 14:46:38 +0000
From: Mats Petersson <mats.petersson@citrix.com>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 14:45:51 +0000
Message-ID: <1353077152-29630-1-git-send-email-mats.petersson@citrix.com>
X-Mailer: git-send-email 1.7.9.5
MIME-Version: 1.0
Cc: Mats Petersson <mats.petersson@citrix.com>, konrad.wilk@oracle.com
Subject: [Xen-devel] [PATCH] Improve performance of
	IOCTL_PRIVCMD_MMAPBATCH_V2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch makes the IOCTL_PRIVCMD_MMAPBATCH_V2 (and older V1 version)
map multiple (typically 1024) pages at a time rather than one page at a
time, despite the pages being non-consecutive MFNs. The main change is
to pass a pointer to an array of mfns, rather than one mfn. To support
error reporting, we also pass an err_ptr. If err_ptr is NULL, it indicates
we want the contiguous pages behaviour, so the mfn value is incremented
rather than the pointer itself. Performance of mapping guest memory into
Dom0 is improved by a factor of around 6 with this change.

Signed-off-by: Mats Petersson <mats.petersson@citrix.com>
---
 arch/x86/xen/mmu.c    |   47 ++++++++++++++++++++++++++-------
 drivers/xen/privcmd.c |   70 ++++++++++++++++++++++++++++++++++++++++++-------
 include/xen/xen-ops.h |    5 ++--
 3 files changed, 100 insertions(+), 22 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index dcf5f2d..c5e23ba 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -2477,7 +2477,8 @@ void __init xen_hvm_init_mmu_ops(void)
 #define REMAP_BATCH_SIZE 16
 
 struct remap_data {
-	unsigned long mfn;
+	unsigned long *mfn;
+	int contiguous;
 	pgprot_t prot;
 	struct mmu_update *mmu_update;
 };
@@ -2486,7 +2487,13 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
 				 unsigned long addr, void *data)
 {
 	struct remap_data *rmd = data;
-	pte_t pte = pte_mkspecial(pfn_pte(rmd->mfn++, rmd->prot));
+	pte_t pte = pte_mkspecial(pfn_pte(*rmd->mfn, rmd->prot));
+	/* If we have a contigious range, just update the mfn itself,
+	   else update pointer to be "next mfn". */
+	if (rmd->contiguous)
+		(*rmd->mfn)++;
+	else
+		rmd->mfn++;
 
 	rmd->mmu_update->ptr = virt_to_machine(ptep).maddr;
 	rmd->mmu_update->val = pte_val_ma(pte);
@@ -2495,16 +2502,17 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
 	return 0;
 }
 
+
 int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
 			       unsigned long addr,
-			       unsigned long mfn, int nr,
-			       pgprot_t prot, unsigned domid)
+			       unsigned long *mfn, int nr,
+			       int *err_ptr, pgprot_t prot,
+			       unsigned domid)
 {
+	int err;
 	struct remap_data rmd;
 	struct mmu_update mmu_update[REMAP_BATCH_SIZE];
-	int batch;
 	unsigned long range;
-	int err = 0;
 
 	if (xen_feature(XENFEAT_auto_translated_physmap))
 		return -EINVAL;
@@ -2515,9 +2523,15 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
 
 	rmd.mfn = mfn;
 	rmd.prot = prot;
+	/* We use the err_ptr to indicate if there we are doing a contigious
+	 * mapping or a discontigious mapping. */
+	rmd.contiguous = !err_ptr;
 
 	while (nr) {
-		batch = min(REMAP_BATCH_SIZE, nr);
+		int index = 0;
+		int done = 0;
+		int batch = min(REMAP_BATCH_SIZE, nr);
+		int batch_left = batch;
 		range = (unsigned long)batch << PAGE_SHIFT;
 
 		rmd.mmu_update = mmu_update;
@@ -2526,12 +2540,25 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
 		if (err)
 			goto out;
 
-		err = HYPERVISOR_mmu_update(mmu_update, batch, NULL, domid);
-		if (err < 0)
-			goto out;
+		/* We record the error for each page that gives an error, but
+		 * continue mapping until the whole set is done */
+		do {
+			err = HYPERVISOR_mmu_update(&mmu_update[index],
+						    batch_left, &done, domid);
+			if (err < 0) {
+				if (err_ptr)
+					err_ptr[index] = err;
+				else /* exit if error and no err_ptr */
+					goto out;
+			}
+			batch_left -= done;
+			index += done;
+		} while (batch_left);
 
 		nr -= batch;
 		addr += range;
+		if (err_ptr)
+			err_ptr += batch;
 	}
 
 	err = 0;
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index 24aec2f..68bc619 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -151,6 +151,41 @@ static int traverse_pages(unsigned nelem, size_t size,
 	return ret;
 }
 
+
+/*
+ * Similar to traverse_pages, but use each page as a "block" of
+ * data to be processed as one unit.
+ */
+static int traverse_pages_block(unsigned nelem, size_t size,
+				struct list_head *pos,
+				int (*fn)(void *data, int nr, void *state),
+				void *state)
+{
+	void *pagedata;
+	unsigned pageidx;
+	int ret = 0;
+
+	BUG_ON(size > PAGE_SIZE);
+
+	pageidx = PAGE_SIZE;
+
+	while (nelem) {
+		int nr = (PAGE_SIZE/size);
+		struct page *page;
+		if (nr > nelem)
+			nr = nelem;
+		pos = pos->next;
+		page = list_entry(pos, struct page, lru);
+		pagedata = page_address(page);
+		ret = (*fn)(pagedata, nr, state);
+		if (ret)
+			break;
+		nelem -= nr;
+	}
+
+	return ret;
+}
+
 struct mmap_mfn_state {
 	unsigned long va;
 	struct vm_area_struct *vma;
@@ -163,6 +198,7 @@ static int mmap_mfn_range(void *data, void *state)
 	struct mmap_mfn_state *st = state;
 	struct vm_area_struct *vma = st->vma;
 	int rc;
+	xen_pfn_t mfn;
 
 	/* Do not allow range to wrap the address space. */
 	if ((msg->npages > (LONG_MAX >> PAGE_SHIFT)) ||
@@ -174,9 +210,15 @@ static int mmap_mfn_range(void *data, void *state)
 	    ((msg->va+(msg->npages<<PAGE_SHIFT)) > vma->vm_end))
 		return -EINVAL;
 
+	/* We need to pass a xen_pfn_t. Check that it fits, or pass EINVAL! */
+	mfn = (xen_pfn_t)msg->mfn;
+	if (mfn != msg->mfn)
+		return -EINVAL;
+
 	rc = xen_remap_domain_mfn_range(vma,
 					msg->va & PAGE_MASK,
-					msg->mfn, msg->npages,
+					&mfn, msg->npages,
+					NULL,
 					vma->vm_page_prot,
 					st->domain);
 	if (rc < 0)
@@ -250,7 +292,7 @@ struct mmap_batch_state {
 	 *      0 for no errors
 	 *      1 if at least one error has happened (and no
 	 *          -ENOENT errors have happened)
-	 *      -ENOENT if at least 1 -ENOENT has happened.
+	 *      -ENOENT if at least one -ENOENT has happened.
 	 */
 	int global_error;
 	/* An array for individual errors */
@@ -260,17 +302,21 @@ struct mmap_batch_state {
 	xen_pfn_t __user *user_mfn;
 };
 
-static int mmap_batch_fn(void *data, void *state)
+static int mmap_batch_fn(void *data, int nr, void *state)
 {
 	xen_pfn_t *mfnp = data;
+
 	struct mmap_batch_state *st = state;
 	int ret;
 
-	ret = xen_remap_domain_mfn_range(st->vma, st->va & PAGE_MASK, *mfnp, 1,
-					 st->vma->vm_page_prot, st->domain);
+	BUG_ON(nr < 0);
 
-	/* Store error code for second pass. */
-	*(st->err++) = ret;
+	ret = xen_remap_domain_mfn_range(st->vma,
+					 st->va & PAGE_MASK,
+					 mfnp, nr,
+					 st->err,
+					 st->vma->vm_page_prot,
+					 st->domain);
 
 	/* And see if it affects the global_error. */
 	if (ret < 0) {
@@ -282,7 +328,7 @@ static int mmap_batch_fn(void *data, void *state)
 				st->global_error = 1;
 		}
 	}
-	st->va += PAGE_SIZE;
+	st->va += PAGE_SIZE * nr;
 
 	return 0;
 }
@@ -303,6 +349,8 @@ static int mmap_return_errors_v1(void *data, void *state)
 	return __put_user(*mfnp, st->user_mfn++);
 }
 
+
+
 static struct vm_operations_struct privcmd_vm_ops;
 
 static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
@@ -319,6 +367,8 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
 	if (!xen_initial_domain())
 		return -EPERM;
 
+
+
 	switch (version) {
 	case 1:
 		if (copy_from_user(&m, udata, sizeof(struct privcmd_mmapbatch)))
@@ -378,8 +428,8 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
 	state.err           = err_array;
 
 	/* mmap_batch_fn guarantees ret == 0 */
-	BUG_ON(traverse_pages(m.num, sizeof(xen_pfn_t),
-			     &pagelist, mmap_batch_fn, &state));
+	BUG_ON(traverse_pages_block(m.num, sizeof(xen_pfn_t),
+				    &pagelist, mmap_batch_fn, &state));
 
 	up_write(&mm->mmap_sem);
 
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
index 6a198e4..1bcda39 100644
--- a/include/xen/xen-ops.h
+++ b/include/xen/xen-ops.h
@@ -26,7 +26,8 @@ void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order);
 struct vm_area_struct;
 int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
 			       unsigned long addr,
-			       unsigned long mfn, int nr,
-			       pgprot_t prot, unsigned domid);
+			       unsigned long *mfn, int nr,
+			       int *err_ptr, pgprot_t prot,
+			       unsigned domid);
 
 #endif /* INCLUDE_XEN_OPS_H */
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 14:47:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 14:47:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNCH-0003y0-AO; Fri, 16 Nov 2012 14:47:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZNCF-0003xk-11
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 14:47:07 +0000
Received: from [193.109.254.147:42613] by server-2.bemta-14.messagelabs.com id
	2F/B9-20829-AE156A05; Fri, 16 Nov 2012 14:47:06 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353077219!4229093!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30506 invoked from network); 16 Nov 2012 14:47:00 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 14:47:00 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="44848030"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 14:46:43 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 09:46:39 -0500
Received: from [10.80.3.146] (helo=localmatsp-T3500.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<mats.petersson@citrix.com>)	id 1TZNBm-0006Vn-S1;
	Fri, 16 Nov 2012 14:46:38 +0000
From: Mats Petersson <mats.petersson@citrix.com>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 14:45:51 +0000
Message-ID: <1353077152-29630-1-git-send-email-mats.petersson@citrix.com>
X-Mailer: git-send-email 1.7.9.5
MIME-Version: 1.0
Cc: Mats Petersson <mats.petersson@citrix.com>, konrad.wilk@oracle.com
Subject: [Xen-devel] [PATCH] Improve performance of
	IOCTL_PRIVCMD_MMAPBATCH_V2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch makes the IOCTL_PRIVCMD_MMAPBATCH_V2 (and older V1 version)
map multiple (typically 1024) pages at a time rather than one page at a
time, despite the pages being non-consecutive MFNs. The main change is
to pass a pointer to an array of mfns, rather than one mfn. To support
error reporting, we also pass an err_ptr. If err_ptr is NULL, it indicates
we want the contiguous pages behaviour, so the mfn value is incremented
rather than the pointer itself. Performance of mapping guest memory into
Dom0 is improved by a factor of around 6 with this change.

Signed-off-by: Mats Petersson <mats.petersson@citrix.com>
---
 arch/x86/xen/mmu.c    |   47 ++++++++++++++++++++++++++-------
 drivers/xen/privcmd.c |   70 ++++++++++++++++++++++++++++++++++++++++++-------
 include/xen/xen-ops.h |    5 ++--
 3 files changed, 100 insertions(+), 22 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index dcf5f2d..c5e23ba 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -2477,7 +2477,8 @@ void __init xen_hvm_init_mmu_ops(void)
 #define REMAP_BATCH_SIZE 16
 
 struct remap_data {
-	unsigned long mfn;
+	unsigned long *mfn;
+	int contiguous;
 	pgprot_t prot;
 	struct mmu_update *mmu_update;
 };
@@ -2486,7 +2487,13 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
 				 unsigned long addr, void *data)
 {
 	struct remap_data *rmd = data;
-	pte_t pte = pte_mkspecial(pfn_pte(rmd->mfn++, rmd->prot));
+	pte_t pte = pte_mkspecial(pfn_pte(*rmd->mfn, rmd->prot));
+	/* If we have a contigious range, just update the mfn itself,
+	   else update pointer to be "next mfn". */
+	if (rmd->contiguous)
+		(*rmd->mfn)++;
+	else
+		rmd->mfn++;
 
 	rmd->mmu_update->ptr = virt_to_machine(ptep).maddr;
 	rmd->mmu_update->val = pte_val_ma(pte);
@@ -2495,16 +2502,17 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
 	return 0;
 }
 
+
 int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
 			       unsigned long addr,
-			       unsigned long mfn, int nr,
-			       pgprot_t prot, unsigned domid)
+			       unsigned long *mfn, int nr,
+			       int *err_ptr, pgprot_t prot,
+			       unsigned domid)
 {
+	int err;
 	struct remap_data rmd;
 	struct mmu_update mmu_update[REMAP_BATCH_SIZE];
-	int batch;
 	unsigned long range;
-	int err = 0;
 
 	if (xen_feature(XENFEAT_auto_translated_physmap))
 		return -EINVAL;
@@ -2515,9 +2523,15 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
 
 	rmd.mfn = mfn;
 	rmd.prot = prot;
+	/* We use the err_ptr to indicate if there we are doing a contigious
+	 * mapping or a discontigious mapping. */
+	rmd.contiguous = !err_ptr;
 
 	while (nr) {
-		batch = min(REMAP_BATCH_SIZE, nr);
+		int index = 0;
+		int done = 0;
+		int batch = min(REMAP_BATCH_SIZE, nr);
+		int batch_left = batch;
 		range = (unsigned long)batch << PAGE_SHIFT;
 
 		rmd.mmu_update = mmu_update;
@@ -2526,12 +2540,25 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
 		if (err)
 			goto out;
 
-		err = HYPERVISOR_mmu_update(mmu_update, batch, NULL, domid);
-		if (err < 0)
-			goto out;
+		/* We record the error for each page that gives an error, but
+		 * continue mapping until the whole set is done */
+		do {
+			err = HYPERVISOR_mmu_update(&mmu_update[index],
+						    batch_left, &done, domid);
+			if (err < 0) {
+				if (err_ptr)
+					err_ptr[index] = err;
+				else /* exit if error and no err_ptr */
+					goto out;
+			}
+			batch_left -= done;
+			index += done;
+		} while (batch_left);
 
 		nr -= batch;
 		addr += range;
+		if (err_ptr)
+			err_ptr += batch;
 	}
 
 	err = 0;
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index 24aec2f..68bc619 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -151,6 +151,41 @@ static int traverse_pages(unsigned nelem, size_t size,
 	return ret;
 }
 
+
+/*
+ * Similar to traverse_pages, but use each page as a "block" of
+ * data to be processed as one unit.
+ */
+static int traverse_pages_block(unsigned nelem, size_t size,
+				struct list_head *pos,
+				int (*fn)(void *data, int nr, void *state),
+				void *state)
+{
+	void *pagedata;
+	unsigned pageidx;
+	int ret = 0;
+
+	BUG_ON(size > PAGE_SIZE);
+
+	pageidx = PAGE_SIZE;
+
+	while (nelem) {
+		int nr = (PAGE_SIZE/size);
+		struct page *page;
+		if (nr > nelem)
+			nr = nelem;
+		pos = pos->next;
+		page = list_entry(pos, struct page, lru);
+		pagedata = page_address(page);
+		ret = (*fn)(pagedata, nr, state);
+		if (ret)
+			break;
+		nelem -= nr;
+	}
+
+	return ret;
+}
+
 struct mmap_mfn_state {
 	unsigned long va;
 	struct vm_area_struct *vma;
@@ -163,6 +198,7 @@ static int mmap_mfn_range(void *data, void *state)
 	struct mmap_mfn_state *st = state;
 	struct vm_area_struct *vma = st->vma;
 	int rc;
+	xen_pfn_t mfn;
 
 	/* Do not allow range to wrap the address space. */
 	if ((msg->npages > (LONG_MAX >> PAGE_SHIFT)) ||
@@ -174,9 +210,15 @@ static int mmap_mfn_range(void *data, void *state)
 	    ((msg->va+(msg->npages<<PAGE_SHIFT)) > vma->vm_end))
 		return -EINVAL;
 
+	/* We need to pass a xen_pfn_t. Check that it fits, or pass EINVAL! */
+	mfn = (xen_pfn_t)msg->mfn;
+	if (mfn != msg->mfn)
+		return -EINVAL;
+
 	rc = xen_remap_domain_mfn_range(vma,
 					msg->va & PAGE_MASK,
-					msg->mfn, msg->npages,
+					&mfn, msg->npages,
+					NULL,
 					vma->vm_page_prot,
 					st->domain);
 	if (rc < 0)
@@ -250,7 +292,7 @@ struct mmap_batch_state {
 	 *      0 for no errors
 	 *      1 if at least one error has happened (and no
 	 *          -ENOENT errors have happened)
-	 *      -ENOENT if at least 1 -ENOENT has happened.
+	 *      -ENOENT if at least one -ENOENT has happened.
 	 */
 	int global_error;
 	/* An array for individual errors */
@@ -260,17 +302,21 @@ struct mmap_batch_state {
 	xen_pfn_t __user *user_mfn;
 };
 
-static int mmap_batch_fn(void *data, void *state)
+static int mmap_batch_fn(void *data, int nr, void *state)
 {
 	xen_pfn_t *mfnp = data;
+
 	struct mmap_batch_state *st = state;
 	int ret;
 
-	ret = xen_remap_domain_mfn_range(st->vma, st->va & PAGE_MASK, *mfnp, 1,
-					 st->vma->vm_page_prot, st->domain);
+	BUG_ON(nr < 0);
 
-	/* Store error code for second pass. */
-	*(st->err++) = ret;
+	ret = xen_remap_domain_mfn_range(st->vma,
+					 st->va & PAGE_MASK,
+					 mfnp, nr,
+					 st->err,
+					 st->vma->vm_page_prot,
+					 st->domain);
 
 	/* And see if it affects the global_error. */
 	if (ret < 0) {
@@ -282,7 +328,7 @@ static int mmap_batch_fn(void *data, void *state)
 				st->global_error = 1;
 		}
 	}
-	st->va += PAGE_SIZE;
+	st->va += PAGE_SIZE * nr;
 
 	return 0;
 }
@@ -303,6 +349,8 @@ static int mmap_return_errors_v1(void *data, void *state)
 	return __put_user(*mfnp, st->user_mfn++);
 }
 
+
+
 static struct vm_operations_struct privcmd_vm_ops;
 
 static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
@@ -319,6 +367,8 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
 	if (!xen_initial_domain())
 		return -EPERM;
 
+
+
 	switch (version) {
 	case 1:
 		if (copy_from_user(&m, udata, sizeof(struct privcmd_mmapbatch)))
@@ -378,8 +428,8 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
 	state.err           = err_array;
 
 	/* mmap_batch_fn guarantees ret == 0 */
-	BUG_ON(traverse_pages(m.num, sizeof(xen_pfn_t),
-			     &pagelist, mmap_batch_fn, &state));
+	BUG_ON(traverse_pages_block(m.num, sizeof(xen_pfn_t),
+				    &pagelist, mmap_batch_fn, &state));
 
 	up_write(&mm->mmap_sem);
 
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
index 6a198e4..1bcda39 100644
--- a/include/xen/xen-ops.h
+++ b/include/xen/xen-ops.h
@@ -26,7 +26,8 @@ void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order);
 struct vm_area_struct;
 int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
 			       unsigned long addr,
-			       unsigned long mfn, int nr,
-			       pgprot_t prot, unsigned domid);
+			       unsigned long *mfn, int nr,
+			       int *err_ptr, pgprot_t prot,
+			       unsigned domid);
 
 #endif /* INCLUDE_XEN_OPS_H */
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 14:47:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 14:47:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNCG-0003xt-VD; Fri, 16 Nov 2012 14:47:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TZNCF-0003xj-1U
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 14:47:07 +0000
Received: from [193.109.254.147:53275] by server-5.bemta-14.messagelabs.com id
	3D/D1-10257-AE156A05; Fri, 16 Nov 2012 14:47:06 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353077219!4229093!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30625 invoked from network); 16 Nov 2012 14:47:03 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 14:47:03 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="44848049"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	16 Nov 2012 14:46:57 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL03.citrite.net
	(10.13.107.80) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 16 Nov 2012 09:46:56 -0500
Message-ID: <50A651DF.8010103@citrix.com>
Date: Fri, 16 Nov 2012 14:46:55 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Mats Petersson <mats.petersson@citrix.com>
References: <1353062828-5476-1-git-send-email-mats.petersson@citrix.com>
In-Reply-To: <1353062828-5476-1-git-send-email-mats.petersson@citrix.com>
X-Originating-IP: [10.80.2.76]
Cc: konrad.wilk@oracle.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 1/2] Fix broken IOCTL_PRIVCMD_MMAPBATCH (old
 version).
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 10:47, Mats Petersson wrote:
> Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
> that it broke. The return value is set early on to -EINVAL, and if all
> goes well, the "set top bits of the MFN's" never gets called, so the
> return value is still EINVAL when the function gets to the end, causing
> the caller to think it went wrong (which it didn't!)

Better subject line:

"xen/privcmd: correctly return success from IOCTL_PRIVCMD_MMAPBATCH."

This is a regression introduced by ceb90fa0 (xen/privcmd: add
PRIVCMD_MMAPBATCH_V2 ioctl).  It broke xentrace as it used
xc_map_foreign() instead of xc_map_foreign_bulk().  It would be nice if
the commit message mentioned this.

> Signed off by: Mats Petersson <mats.petersson@citrix.com>

If the subject/commit message is improved:

Acked-by: David Vrabel <david.vrabel@citrix.com>

> --- a/drivers/xen/privcmd.c
> +++ b/drivers/xen/privcmd.c
> @@ -347,6 +347,7 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
>  
>  	if (ret)
>  		goto out;
> +

Stray change, please remove.

>  	if (list_empty(&pagelist)) {
>  		ret = -EINVAL;
>  		goto out;

David

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 14:47:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 14:47:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNCG-0003xt-VD; Fri, 16 Nov 2012 14:47:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TZNCF-0003xj-1U
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 14:47:07 +0000
Received: from [193.109.254.147:53275] by server-5.bemta-14.messagelabs.com id
	3D/D1-10257-AE156A05; Fri, 16 Nov 2012 14:47:06 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353077219!4229093!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30625 invoked from network); 16 Nov 2012 14:47:03 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 14:47:03 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="44848049"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	16 Nov 2012 14:46:57 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL03.citrite.net
	(10.13.107.80) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 16 Nov 2012 09:46:56 -0500
Message-ID: <50A651DF.8010103@citrix.com>
Date: Fri, 16 Nov 2012 14:46:55 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Mats Petersson <mats.petersson@citrix.com>
References: <1353062828-5476-1-git-send-email-mats.petersson@citrix.com>
In-Reply-To: <1353062828-5476-1-git-send-email-mats.petersson@citrix.com>
X-Originating-IP: [10.80.2.76]
Cc: konrad.wilk@oracle.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 1/2] Fix broken IOCTL_PRIVCMD_MMAPBATCH (old
 version).
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 10:47, Mats Petersson wrote:
> Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
> that it broke. The return value is set early on to -EINVAL, and if all
> goes well, the "set top bits of the MFN's" never gets called, so the
> return value is still EINVAL when the function gets to the end, causing
> the caller to think it went wrong (which it didn't!)

Better subject line:

"xen/privcmd: correctly return success from IOCTL_PRIVCMD_MMAPBATCH."

This is a regression introduced by ceb90fa0 (xen/privcmd: add
PRIVCMD_MMAPBATCH_V2 ioctl).  It broke xentrace as it used
xc_map_foreign() instead of xc_map_foreign_bulk().  It would be nice if
the commit message mentioned this.

> Signed off by: Mats Petersson <mats.petersson@citrix.com>

If the subject/commit message is improved:

Acked-by: David Vrabel <david.vrabel@citrix.com>

> --- a/drivers/xen/privcmd.c
> +++ b/drivers/xen/privcmd.c
> @@ -347,6 +347,7 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
>  
>  	if (ret)
>  		goto out;
> +

Stray change, please remove.

>  	if (list_empty(&pagelist)) {
>  		ret = -EINVAL;
>  		goto out;

David

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 14:53:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 14:53:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNHm-0004Jt-42; Fri, 16 Nov 2012 14:52:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TZNHk-0004Jj-Tc
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 14:52:49 +0000
Received: from [85.158.138.51:59299] by server-16.bemta-3.messagelabs.com id
	27/0D-07461-B3356A05; Fri, 16 Nov 2012 14:52:43 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1353077561!22231959!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17338 invoked from network); 16 Nov 2012 14:52:43 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-3.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 14:52:43 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="44848776"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	16 Nov 2012 14:52:41 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 16 Nov 2012 09:52:41 -0500
Message-ID: <50A65338.2050002@citrix.com>
Date: Fri, 16 Nov 2012 14:52:40 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Roger Pau Monne <roger.pau@citrix.com>
References: <1350661627-20775-1-git-send-email-roger.pau@citrix.com>
In-Reply-To: <1350661627-20775-1-git-send-email-roger.pau@citrix.com>
X-Originating-IP: [10.80.2.76]
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: restore GNTTABOP_dump_table
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 19/10/12 16:47, Roger Pau Monne wrote:
> This operation was dropped long time ago, but I found it quite helpful
> for debugging purposes. This re-implementation uses the code already
> present in gnttab_usage_print and adds the maptrack-table dump.

Why is the operation useful?  Isn't the debug key sufficient?

# xl debug-key g
(XEN) gnttab_usage_print_all [ key 'g' pressed
(XEN)       -------- active --------       -------- shared --------
(XEN) [ref] localdom mfn      pin          localdom gmfn     flags
(XEN) grant-table for remote domain:    0 ... no active grant table entries
(XEN) gnttab_usage_print_all ] done

David


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 14:53:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 14:53:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNHm-0004Jt-42; Fri, 16 Nov 2012 14:52:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TZNHk-0004Jj-Tc
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 14:52:49 +0000
Received: from [85.158.138.51:59299] by server-16.bemta-3.messagelabs.com id
	27/0D-07461-B3356A05; Fri, 16 Nov 2012 14:52:43 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1353077561!22231959!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17338 invoked from network); 16 Nov 2012 14:52:43 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-3.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 14:52:43 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="44848776"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	16 Nov 2012 14:52:41 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 16 Nov 2012 09:52:41 -0500
Message-ID: <50A65338.2050002@citrix.com>
Date: Fri, 16 Nov 2012 14:52:40 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Roger Pau Monne <roger.pau@citrix.com>
References: <1350661627-20775-1-git-send-email-roger.pau@citrix.com>
In-Reply-To: <1350661627-20775-1-git-send-email-roger.pau@citrix.com>
X-Originating-IP: [10.80.2.76]
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: restore GNTTABOP_dump_table
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 19/10/12 16:47, Roger Pau Monne wrote:
> This operation was dropped long time ago, but I found it quite helpful
> for debugging purposes. This re-implementation uses the code already
> present in gnttab_usage_print and adds the maptrack-table dump.

Why is the operation useful?  Isn't the debug key sufficient?

# xl debug-key g
(XEN) gnttab_usage_print_all [ key 'g' pressed
(XEN)       -------- active --------       -------- shared --------
(XEN) [ref] localdom mfn      pin          localdom gmfn     flags
(XEN) grant-table for remote domain:    0 ... no active grant table entries
(XEN) gnttab_usage_print_all ] done

David


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:02:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:02:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNQs-0004bI-5L; Fri, 16 Nov 2012 15:02:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TZNQq-0004bD-M4
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:02:12 +0000
Received: from [85.158.139.211:9638] by server-12.bemta-5.messagelabs.com id
	17/42-02886-37556A05; Fri, 16 Nov 2012 15:02:11 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1353078131!20029803!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14150 invoked from network); 16 Nov 2012 15:02:11 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:02:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="15853373"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:02:11 +0000
Received: from [192.168.1.30] (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 15:02:10 +0000
Message-ID: <50A65571.2060502@citrix.com>
Date: Fri, 16 Nov 2012 16:02:09 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: David Vrabel <david.vrabel@citrix.com>
References: <1350661627-20775-1-git-send-email-roger.pau@citrix.com>
	<50A65338.2050002@citrix.com>
In-Reply-To: <50A65338.2050002@citrix.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: restore GNTTABOP_dump_table
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 15:52, David Vrabel wrote:
> On 19/10/12 16:47, Roger Pau Monne wrote:
>> This operation was dropped long time ago, but I found it quite helpful
>> for debugging purposes. This re-implementation uses the code already
>> present in gnttab_usage_print and adds the maptrack-table dump.
> 
> Why is the operation useful?  Isn't the debug key sufficient?

The debug key doesn't print the maptrack, and also I found it quite
useful to be able to call this from the guest kernel itself at certain
specific points (like before and after cleaning the list of persistent
grants), which is not possible when using the debug key.

> # xl debug-key g
> (XEN) gnttab_usage_print_all [ key 'g' pressed
> (XEN)       -------- active --------       -------- shared --------
> (XEN) [ref] localdom mfn      pin          localdom gmfn     flags
> (XEN) grant-table for remote domain:    0 ... no active grant table entries
> (XEN) gnttab_usage_print_all ] done
> 
> David
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:02:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:02:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNQs-0004bI-5L; Fri, 16 Nov 2012 15:02:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TZNQq-0004bD-M4
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:02:12 +0000
Received: from [85.158.139.211:9638] by server-12.bemta-5.messagelabs.com id
	17/42-02886-37556A05; Fri, 16 Nov 2012 15:02:11 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1353078131!20029803!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14150 invoked from network); 16 Nov 2012 15:02:11 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:02:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="15853373"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:02:11 +0000
Received: from [192.168.1.30] (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 15:02:10 +0000
Message-ID: <50A65571.2060502@citrix.com>
Date: Fri, 16 Nov 2012 16:02:09 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: David Vrabel <david.vrabel@citrix.com>
References: <1350661627-20775-1-git-send-email-roger.pau@citrix.com>
	<50A65338.2050002@citrix.com>
In-Reply-To: <50A65338.2050002@citrix.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: restore GNTTABOP_dump_table
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 15:52, David Vrabel wrote:
> On 19/10/12 16:47, Roger Pau Monne wrote:
>> This operation was dropped long time ago, but I found it quite helpful
>> for debugging purposes. This re-implementation uses the code already
>> present in gnttab_usage_print and adds the maptrack-table dump.
> 
> Why is the operation useful?  Isn't the debug key sufficient?

The debug key doesn't print the maptrack, and also I found it quite
useful to be able to call this from the guest kernel itself at certain
specific points (like before and after cleaning the list of persistent
grants), which is not possible when using the debug key.

> # xl debug-key g
> (XEN) gnttab_usage_print_all [ key 'g' pressed
> (XEN)       -------- active --------       -------- shared --------
> (XEN) [ref] localdom mfn      pin          localdom gmfn     flags
> (XEN) grant-table for remote domain:    0 ... no active grant table entries
> (XEN) gnttab_usage_print_all ] done
> 
> David
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:02:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:02:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNRB-0004cX-U6; Fri, 16 Nov 2012 15:02:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZNRB-0004cC-3J
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:02:33 +0000
Received: from [85.158.137.99:30835] by server-6.bemta-3.messagelabs.com id
	F0/96-28265-88556A05; Fri, 16 Nov 2012 15:02:32 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1353078150!17054290!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7654 invoked from network); 16 Nov 2012 15:02:31 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:02:31 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="44849877"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:02:29 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 10:02:29 -0500
Received: from [10.80.3.146] (helo=localmatsp-T3500.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<mats.petersson@citrix.com>)	id 1TZNR7-0006kN-43;
	Fri, 16 Nov 2012 15:02:29 +0000
From: Mats Petersson <mats.petersson@citrix.com>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 15:02:02 +0000
Message-ID: <1353078123-29828-1-git-send-email-mats.petersson@citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <1353062828-5476-1-git-send-email-mats.petersson@citrix.com>
References: <1353062828-5476-1-git-send-email-mats.petersson@citrix.com>
MIME-Version: 1.0
Cc: konrad.wilk@oracle.com
Subject: [Xen-devel] [PATCH] Correctly return success from
	IOCTL_PRIVCMD_MMAPBATCH
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Updated according to David Vrabel's comments. 

--
Mats


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:02:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:02:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNRB-0004cX-U6; Fri, 16 Nov 2012 15:02:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZNRB-0004cC-3J
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:02:33 +0000
Received: from [85.158.137.99:30835] by server-6.bemta-3.messagelabs.com id
	F0/96-28265-88556A05; Fri, 16 Nov 2012 15:02:32 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1353078150!17054290!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7654 invoked from network); 16 Nov 2012 15:02:31 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:02:31 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="44849877"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:02:29 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 10:02:29 -0500
Received: from [10.80.3.146] (helo=localmatsp-T3500.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<mats.petersson@citrix.com>)	id 1TZNR7-0006kN-43;
	Fri, 16 Nov 2012 15:02:29 +0000
From: Mats Petersson <mats.petersson@citrix.com>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 15:02:02 +0000
Message-ID: <1353078123-29828-1-git-send-email-mats.petersson@citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <1353062828-5476-1-git-send-email-mats.petersson@citrix.com>
References: <1353062828-5476-1-git-send-email-mats.petersson@citrix.com>
MIME-Version: 1.0
Cc: konrad.wilk@oracle.com
Subject: [Xen-devel] [PATCH] Correctly return success from
	IOCTL_PRIVCMD_MMAPBATCH
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Updated according to David Vrabel's comments. 

--
Mats


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:02:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:02:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNRB-0004cO-Ix; Fri, 16 Nov 2012 15:02:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZNRA-0004c9-N5
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:02:32 +0000
Received: from [85.158.137.99:56346] by server-4.bemta-3.messagelabs.com id
	A7/D6-30023-78556A05; Fri, 16 Nov 2012 15:02:31 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1353078150!19416661!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1460 invoked from network); 16 Nov 2012 15:02:31 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:02:31 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="15853379"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:02:30 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 15:02:30 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TZNR8-0008Hq-Dg; Fri, 16 Nov 2012 15:02:30 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TZNR8-0005P2-96;
	Fri, 16 Nov 2012 15:02:30 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20646.21893.898086.36438@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 15:02:29 +0000
To: George Dunlap <george.dunlap@eu.citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
References: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH RFC] Make all public hosting providers
	eligible	for the pre-disclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap writes ("[Xen-devel] [PATCH RFC] Make all public hosting providers eligible for the pre-disclosure list"):
> NOTE: This RFC is meant to be a way to start a discussion on the exact
> wording which will be voted on.  Once it has gone through review from
> the xen-devel mailing list, I will post an "RC" and announce it on the
> Xen blog, as well as on xen-users.  Once discussion seems to have
> converged, I will post a "FINAL" one, which I will put up for a vote.

Thanks for this.  Something along these lines is probably the best
compromise between the available options.

...
> -      <li>Large-scale hosting providers;</li>
> +      <li>Public hosting providers;</li>
>        <li>Large-scale organisational users of Xen;</li>
>        <li>Vendors of widely-deployed Xen-based systems;</li>
>        <li>Distributors of widely-deployed operating systems with
>        Xen support...
> +    <p>Here as a rule of thumb, "public hosting provider" means
 +    "selling virtualization services to the general public";
> +    "large-scale" and "widely deployed" means an installed base of
> +    300,000 or more Xen guests.  Other well-established organisations
> +    with a mature security response process will be considered on a
> +    case-by-case basis.</p>

If we are allowing any cloud provider, not matter how small, to sign
up, then we should probably substantially relax the rules on software
vendors too.  I'm not sure exactly what the rule should be but
certainly we should be requiring no more than 1,000 deployed
instances.

> +    <p>We prefer that a role address be used for each organisation, rather than one or more individual's direct email address. This helps to ensure that changes of personnel do not end up effectively dropping an organisation from the list</p>

We should insist on this I think.  Otherwise it will be unmanageable.


I have another comment: given that predisclosure list members are
allowed to reveal the fact that there is an advisory and the release
date, would it be sensible for there to be a public list of
forthcoming public advisories ?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:02:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:02:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNRB-0004cO-Ix; Fri, 16 Nov 2012 15:02:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZNRA-0004c9-N5
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:02:32 +0000
Received: from [85.158.137.99:56346] by server-4.bemta-3.messagelabs.com id
	A7/D6-30023-78556A05; Fri, 16 Nov 2012 15:02:31 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1353078150!19416661!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1460 invoked from network); 16 Nov 2012 15:02:31 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:02:31 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="15853379"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:02:30 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 15:02:30 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TZNR8-0008Hq-Dg; Fri, 16 Nov 2012 15:02:30 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TZNR8-0005P2-96;
	Fri, 16 Nov 2012 15:02:30 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20646.21893.898086.36438@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 15:02:29 +0000
To: George Dunlap <george.dunlap@eu.citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
References: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH RFC] Make all public hosting providers
	eligible	for the pre-disclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap writes ("[Xen-devel] [PATCH RFC] Make all public hosting providers eligible for the pre-disclosure list"):
> NOTE: This RFC is meant to be a way to start a discussion on the exact
> wording which will be voted on.  Once it has gone through review from
> the xen-devel mailing list, I will post an "RC" and announce it on the
> Xen blog, as well as on xen-users.  Once discussion seems to have
> converged, I will post a "FINAL" one, which I will put up for a vote.

Thanks for this.  Something along these lines is probably the best
compromise between the available options.

...
> -      <li>Large-scale hosting providers;</li>
> +      <li>Public hosting providers;</li>
>        <li>Large-scale organisational users of Xen;</li>
>        <li>Vendors of widely-deployed Xen-based systems;</li>
>        <li>Distributors of widely-deployed operating systems with
>        Xen support...
> +    <p>Here as a rule of thumb, "public hosting provider" means
 +    "selling virtualization services to the general public";
> +    "large-scale" and "widely deployed" means an installed base of
> +    300,000 or more Xen guests.  Other well-established organisations
> +    with a mature security response process will be considered on a
> +    case-by-case basis.</p>

If we are allowing any cloud provider, not matter how small, to sign
up, then we should probably substantially relax the rules on software
vendors too.  I'm not sure exactly what the rule should be but
certainly we should be requiring no more than 1,000 deployed
instances.

> +    <p>We prefer that a role address be used for each organisation, rather than one or more individual's direct email address. This helps to ensure that changes of personnel do not end up effectively dropping an organisation from the list</p>

We should insist on this I think.  Otherwise it will be unmanageable.


I have another comment: given that predisclosure list members are
allowed to reveal the fact that there is an advisory and the release
date, would it be sensible for there to be a public list of
forthcoming public advisories ?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:04:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:04:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNSj-0004qa-It; Fri, 16 Nov 2012 15:04:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TZNSh-0004qK-Jq
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:04:07 +0000
Received: from [85.158.143.99:60881] by server-2.bemta-4.messagelabs.com id
	33/80-28922-6E556A05; Fri, 16 Nov 2012 15:04:06 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1353078246!27556812!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9179 invoked from network); 16 Nov 2012 15:04:06 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:04:06 -0000
Received: by mail-wi0-f173.google.com with SMTP id hm2so4939762wib.14
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 07:04:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=qwr9bD6MPeJZJyEJwYIfITjH2iiQmZWJ76ekI2dLXig=;
	b=KtDI1n9t1Vi7o0aUX5lhDBjytjrsRZet6xiCgSCuMc4dTKNCOKSthbyuPisdd7e+GD
	DY8P3ppGKor3/wYvcv1ov2lav8hXQjW6b1QCQk/qoEa17zTwB1DmW1+NrL23e8MyXito
	ElBBQ7R/8KXp4XvxOs57HLFCUvckWoZrooSzeMgfdGtphVXaIleVQsXva0ZnbVrMJbjC
	LVTPpSVyurGSiCqG0WOoj1GWnXOxXXNmFtxoYuMSVJowb5/Zyrq6Sd5bmH4c63RA34e/
	dU741pZk2iMQTHRLwCQzUiPx5wjoya6e9iCNahmx/7gKD9LQVZkESxmwY2jn/l9soy0F
	VeTg==
Received: by 10.216.193.158 with SMTP id k30mr2107846wen.89.1353078246102;
	Fri, 16 Nov 2012 07:04:06 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id j18sm1094273wiv.9.2012.11.16.07.04.03
	(version=SSLv3 cipher=OTHER); Fri, 16 Nov 2012 07:04:05 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Fri, 16 Nov 2012 15:03:56 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCCC065C.5262F%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] vscsiif: minor cleanup
Thread-Index: Ac3EC5lYm1/+XIvgb0ub9RtV69X8XA==
In-Reply-To: <50A64A5802000078000A93F4@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] vscsiif: minor cleanup
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/2012 13:14, "Jan Beulich" <JBeulich@suse.com> wrote:

> Remove a definition not belonging into the interface, and correct a
> few typos in comments.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/include/public/io/vscsiif.h
> +++ b/xen/include/public/io/vscsiif.h
> @@ -30,25 +30,22 @@
>  #include "ring.h"
>  #include "../grant_table.h"
>  
> -/* command between backend and frontend */
> +/* commands between backend and frontend */
>  #define VSCSIIF_ACT_SCSI_CDB         1    /* SCSI CDB command */
>  #define VSCSIIF_ACT_SCSI_ABORT       2    /* SCSI Device(Lun) Abort*/
>  #define VSCSIIF_ACT_SCSI_RESET       3    /* SCSI Device(Lun) Reset*/
>  
> -
> -#define VSCSIIF_BACK_MAX_PENDING_REQS    128
> -
>  /*
>   * Maximum scatter/gather segments per request.
>   *
> - * Considering balance between allocating al least 16 "vscsiif_request"
> - * structures on one page (4096bytes) and number of scatter gather
> - * needed, we decided to use 26 as a magic number.
> + * Considering balance between allocating at least 16 "vscsiif_request"
> + * structures on one page (4096 bytes) and the number of scatter/gather
> + * elements needed, we decided to use 26 as a magic number.
>   */
>  #define VSCSIIF_SG_TABLESIZE             26
>  
>  /*
> - * base on linux kernel 2.6.18
> + * based on Linux kernel 2.6.18
>   */
>  #define VSCSIIF_MAX_COMMAND_SIZE         16
>  #define VSCSIIF_SENSE_BUFFERSIZE         96
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:04:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:04:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNSj-0004qa-It; Fri, 16 Nov 2012 15:04:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TZNSh-0004qK-Jq
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:04:07 +0000
Received: from [85.158.143.99:60881] by server-2.bemta-4.messagelabs.com id
	33/80-28922-6E556A05; Fri, 16 Nov 2012 15:04:06 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1353078246!27556812!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9179 invoked from network); 16 Nov 2012 15:04:06 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:04:06 -0000
Received: by mail-wi0-f173.google.com with SMTP id hm2so4939762wib.14
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 07:04:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=qwr9bD6MPeJZJyEJwYIfITjH2iiQmZWJ76ekI2dLXig=;
	b=KtDI1n9t1Vi7o0aUX5lhDBjytjrsRZet6xiCgSCuMc4dTKNCOKSthbyuPisdd7e+GD
	DY8P3ppGKor3/wYvcv1ov2lav8hXQjW6b1QCQk/qoEa17zTwB1DmW1+NrL23e8MyXito
	ElBBQ7R/8KXp4XvxOs57HLFCUvckWoZrooSzeMgfdGtphVXaIleVQsXva0ZnbVrMJbjC
	LVTPpSVyurGSiCqG0WOoj1GWnXOxXXNmFtxoYuMSVJowb5/Zyrq6Sd5bmH4c63RA34e/
	dU741pZk2iMQTHRLwCQzUiPx5wjoya6e9iCNahmx/7gKD9LQVZkESxmwY2jn/l9soy0F
	VeTg==
Received: by 10.216.193.158 with SMTP id k30mr2107846wen.89.1353078246102;
	Fri, 16 Nov 2012 07:04:06 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id j18sm1094273wiv.9.2012.11.16.07.04.03
	(version=SSLv3 cipher=OTHER); Fri, 16 Nov 2012 07:04:05 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Fri, 16 Nov 2012 15:03:56 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCCC065C.5262F%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] vscsiif: minor cleanup
Thread-Index: Ac3EC5lYm1/+XIvgb0ub9RtV69X8XA==
In-Reply-To: <50A64A5802000078000A93F4@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] vscsiif: minor cleanup
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/2012 13:14, "Jan Beulich" <JBeulich@suse.com> wrote:

> Remove a definition not belonging into the interface, and correct a
> few typos in comments.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/include/public/io/vscsiif.h
> +++ b/xen/include/public/io/vscsiif.h
> @@ -30,25 +30,22 @@
>  #include "ring.h"
>  #include "../grant_table.h"
>  
> -/* command between backend and frontend */
> +/* commands between backend and frontend */
>  #define VSCSIIF_ACT_SCSI_CDB         1    /* SCSI CDB command */
>  #define VSCSIIF_ACT_SCSI_ABORT       2    /* SCSI Device(Lun) Abort*/
>  #define VSCSIIF_ACT_SCSI_RESET       3    /* SCSI Device(Lun) Reset*/
>  
> -
> -#define VSCSIIF_BACK_MAX_PENDING_REQS    128
> -
>  /*
>   * Maximum scatter/gather segments per request.
>   *
> - * Considering balance between allocating al least 16 "vscsiif_request"
> - * structures on one page (4096bytes) and number of scatter gather
> - * needed, we decided to use 26 as a magic number.
> + * Considering balance between allocating at least 16 "vscsiif_request"
> + * structures on one page (4096 bytes) and the number of scatter/gather
> + * elements needed, we decided to use 26 as a magic number.
>   */
>  #define VSCSIIF_SG_TABLESIZE             26
>  
>  /*
> - * base on linux kernel 2.6.18
> + * based on Linux kernel 2.6.18
>   */
>  #define VSCSIIF_MAX_COMMAND_SIZE         16
>  #define VSCSIIF_SENSE_BUFFERSIZE         96
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:11:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:11:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNa5-0005Gy-GI; Fri, 16 Nov 2012 15:11:45 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TZNa4-0005Gt-EF
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:11:44 +0000
Received: from [85.158.143.35:25435] by server-1.bemta-4.messagelabs.com id
	DB/A9-27934-FA756A05; Fri, 16 Nov 2012 15:11:43 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1353078627!13092292!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8040 invoked from network); 16 Nov 2012 15:10:28 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-8.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:10:28 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl15so3554451vcb.32
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 07:10:26 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=hsM2dT239K7QTvSzQnc69LNjY82wAOM6j5E5zz1PBdA=;
	b=04nqYVql18fNG5ronQRiUUYfS4t3w0mEBZUxav3PTkefPbojWeHCF/0FIcO8utwZME
	1aSyxmZTihZ4skfQt4BYi8r6BEJey5uNhipvbA72z7Vm6oA1DNkVZ34NlxGT0grGFE0i
	Q3D3k1BdJRwGhWLVtSi3iE+xV9rkBq0hCExRvnH72nGl6H4e7sU5z1p4EMP3iiS3W5u2
	d8RgNmKys5P57nMAUB5hjHXJUIGpwb9q+7EFcba/CSvjxAXYhJOcjWqkM3PdPnWbHqOz
	5hxVfVI7a7sM+RLjSpTFK52JqxkH3xrlNqyOcuwLgpy9ndcdgVKEWdQSo39Xg7bz3L2G
	MSsQ==
MIME-Version: 1.0
Received: by 10.52.16.110 with SMTP id f14mr4023218vdd.8.1353078626415; Fri,
	16 Nov 2012 07:10:26 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Fri, 16 Nov 2012 07:10:26 -0800 (PST)
In-Reply-To: <20646.21893.898086.36438@mariner.uk.xensource.com>
References: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
	<20646.21893.898086.36438@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 15:10:26 +0000
X-Google-Sender-Auth: kPXgnwJnTZ-tNIm1yQfS9X9fFUs
Message-ID: <CAFLBxZYNzTQf6zp9VW75aQAJ=P=gjN9pU44QqsS0X+h_vEVW5Q@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] Make all public hosting providers
 eligible for the pre-disclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5012411136211881671=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5012411136211881671==
Content-Type: multipart/alternative; boundary=bcaec5040ca6e174db04ce9e2a16

--bcaec5040ca6e174db04ce9e2a16
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Nov 16, 2012 at 3:02 PM, Ian Jackson <Ian.Jackson@eu.citrix.com>wrote:

> If we are allowing any cloud provider, not matter how small, to sign
> up, then we should probably substantially relax the rules on software
> vendors too.  I'm not sure exactly what the rule should be but
> certainly we should be requiring no more than 1,000 deployed
> instances.
>

What kind of vendors / projects might fit that kind of profile?

I suppose (for example) if there was a botique software dev house selling
high-value-add XenClient-like solutions to a relatively small number of
customers, it might make sense to allow them to join.


>
> > +    <p>We prefer that a role address be used for each organisation,
> rather than one or more individual's direct email address. This helps to
> ensure that changes of personnel do not end up effectively dropping an
> organisation from the list</p>
>
> We should insist on this I think.  Otherwise it will be unmanageable.
>

Heh -- my early drafts did have this ("No personal e-mail addresses"), but
I took it out to minimize the change.  I'm happy to put it back in. :-)


> I have another comment: given that predisclosure list members are
> allowed to reveal the fact that there is an advisory and the release
> date, would it be sensible for there to be a public list of
> forthcoming public advisories ?
>

That makes sense, but maybe should be in a separate patch?

 -George

--bcaec5040ca6e174db04ce9e2a16
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 16, 2012 at 3:02 PM, Ian Jackson <span dir=3D"ltr">&lt;<a href=
=3D"mailto:Ian.Jackson@eu.citrix.com" target=3D"_blank">Ian.Jackson@eu.citr=
ix.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gm=
ail_quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">If we are allowing any cloud provider, not m=
atter how small, to sign<br>
up, then we should probably substantially relax the rules on software<br>
vendors too. =A0I&#39;m not sure exactly what the rule should be but<br>
certainly we should be requiring no more than 1,000 deployed<br>
instances.<br></blockquote><div><br>What kind of vendors / projects might f=
it that kind of profile?<br><br>I suppose (for example) if there was a boti=
que software dev house selling high-value-add XenClient-like solutions to a=
 relatively small number of customers, it might make sense to allow them to=
 join.<br>
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex">
<div class=3D"im"><br>
&gt; + =A0 =A0&lt;p&gt;We prefer that a role address be used for each organ=
isation, rather than one or more individual&#39;s direct email address. Thi=
s helps to ensure that changes of personnel do not end up effectively dropp=
ing an organisation from the list&lt;/p&gt;<br>

<br>
</div>We should insist on this I think. =A0Otherwise it will be unmanageabl=
e.<br></blockquote><div><br>Heh -- my early drafts did have this (&quot;No =
personal e-mail addresses&quot;), but I took it out to minimize the change.=
=A0 I&#39;m happy to put it back in. :-)<br>
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex">
I have another comment: given that predisclosure list members are<br>
allowed to reveal the fact that there is an advisory and the release<br>
date, would it be sensible for there to be a public list of<br>
forthcoming public advisories ?<br></blockquote><div><br>That makes sense, =
but maybe should be in a separate patch?<br><br>=A0-George<br></div></div><=
/div>

--bcaec5040ca6e174db04ce9e2a16--


--===============5012411136211881671==
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.xen.org
http://lists.xen.org/xen-devel

--===============5012411136211881671==--


From xen-devel-bounces@lists.xen.org Fri Nov 16 15:11:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:11:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNa5-0005Gy-GI; Fri, 16 Nov 2012 15:11:45 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TZNa4-0005Gt-EF
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:11:44 +0000
Received: from [85.158.143.35:25435] by server-1.bemta-4.messagelabs.com id
	DB/A9-27934-FA756A05; Fri, 16 Nov 2012 15:11:43 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1353078627!13092292!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8040 invoked from network); 16 Nov 2012 15:10:28 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-8.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:10:28 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl15so3554451vcb.32
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 07:10:26 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=hsM2dT239K7QTvSzQnc69LNjY82wAOM6j5E5zz1PBdA=;
	b=04nqYVql18fNG5ronQRiUUYfS4t3w0mEBZUxav3PTkefPbojWeHCF/0FIcO8utwZME
	1aSyxmZTihZ4skfQt4BYi8r6BEJey5uNhipvbA72z7Vm6oA1DNkVZ34NlxGT0grGFE0i
	Q3D3k1BdJRwGhWLVtSi3iE+xV9rkBq0hCExRvnH72nGl6H4e7sU5z1p4EMP3iiS3W5u2
	d8RgNmKys5P57nMAUB5hjHXJUIGpwb9q+7EFcba/CSvjxAXYhJOcjWqkM3PdPnWbHqOz
	5hxVfVI7a7sM+RLjSpTFK52JqxkH3xrlNqyOcuwLgpy9ndcdgVKEWdQSo39Xg7bz3L2G
	MSsQ==
MIME-Version: 1.0
Received: by 10.52.16.110 with SMTP id f14mr4023218vdd.8.1353078626415; Fri,
	16 Nov 2012 07:10:26 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Fri, 16 Nov 2012 07:10:26 -0800 (PST)
In-Reply-To: <20646.21893.898086.36438@mariner.uk.xensource.com>
References: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
	<20646.21893.898086.36438@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 15:10:26 +0000
X-Google-Sender-Auth: kPXgnwJnTZ-tNIm1yQfS9X9fFUs
Message-ID: <CAFLBxZYNzTQf6zp9VW75aQAJ=P=gjN9pU44QqsS0X+h_vEVW5Q@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] Make all public hosting providers
 eligible for the pre-disclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5012411136211881671=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5012411136211881671==
Content-Type: multipart/alternative; boundary=bcaec5040ca6e174db04ce9e2a16

--bcaec5040ca6e174db04ce9e2a16
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Nov 16, 2012 at 3:02 PM, Ian Jackson <Ian.Jackson@eu.citrix.com>wrote:

> If we are allowing any cloud provider, not matter how small, to sign
> up, then we should probably substantially relax the rules on software
> vendors too.  I'm not sure exactly what the rule should be but
> certainly we should be requiring no more than 1,000 deployed
> instances.
>

What kind of vendors / projects might fit that kind of profile?

I suppose (for example) if there was a botique software dev house selling
high-value-add XenClient-like solutions to a relatively small number of
customers, it might make sense to allow them to join.


>
> > +    <p>We prefer that a role address be used for each organisation,
> rather than one or more individual's direct email address. This helps to
> ensure that changes of personnel do not end up effectively dropping an
> organisation from the list</p>
>
> We should insist on this I think.  Otherwise it will be unmanageable.
>

Heh -- my early drafts did have this ("No personal e-mail addresses"), but
I took it out to minimize the change.  I'm happy to put it back in. :-)


> I have another comment: given that predisclosure list members are
> allowed to reveal the fact that there is an advisory and the release
> date, would it be sensible for there to be a public list of
> forthcoming public advisories ?
>

That makes sense, but maybe should be in a separate patch?

 -George

--bcaec5040ca6e174db04ce9e2a16
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 16, 2012 at 3:02 PM, Ian Jackson <span dir=3D"ltr">&lt;<a href=
=3D"mailto:Ian.Jackson@eu.citrix.com" target=3D"_blank">Ian.Jackson@eu.citr=
ix.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gm=
ail_quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">If we are allowing any cloud provider, not m=
atter how small, to sign<br>
up, then we should probably substantially relax the rules on software<br>
vendors too. =A0I&#39;m not sure exactly what the rule should be but<br>
certainly we should be requiring no more than 1,000 deployed<br>
instances.<br></blockquote><div><br>What kind of vendors / projects might f=
it that kind of profile?<br><br>I suppose (for example) if there was a boti=
que software dev house selling high-value-add XenClient-like solutions to a=
 relatively small number of customers, it might make sense to allow them to=
 join.<br>
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex">
<div class=3D"im"><br>
&gt; + =A0 =A0&lt;p&gt;We prefer that a role address be used for each organ=
isation, rather than one or more individual&#39;s direct email address. Thi=
s helps to ensure that changes of personnel do not end up effectively dropp=
ing an organisation from the list&lt;/p&gt;<br>

<br>
</div>We should insist on this I think. =A0Otherwise it will be unmanageabl=
e.<br></blockquote><div><br>Heh -- my early drafts did have this (&quot;No =
personal e-mail addresses&quot;), but I took it out to minimize the change.=
=A0 I&#39;m happy to put it back in. :-)<br>
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex">
I have another comment: given that predisclosure list members are<br>
allowed to reveal the fact that there is an advisory and the release<br>
date, would it be sensible for there to be a public list of<br>
forthcoming public advisories ?<br></blockquote><div><br>That makes sense, =
but maybe should be in a separate patch?<br><br>=A0-George<br></div></div><=
/div>

--bcaec5040ca6e174db04ce9e2a16--


--===============5012411136211881671==
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.xen.org
http://lists.xen.org/xen-devel

--===============5012411136211881671==--


From xen-devel-bounces@lists.xen.org Fri Nov 16 15:13:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:13:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNbA-0005Kx-VE; Fri, 16 Nov 2012 15:12:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZNb9-0005Kp-Vz
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:12:52 +0000
Received: from [85.158.143.99:41389] by server-3.bemta-4.messagelabs.com id
	39/10-06841-3F756A05; Fri, 16 Nov 2012 15:12:51 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1353078769!22696123!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODY5MjY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13548 invoked from network); 16 Nov 2012 15:12:50 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-11.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:12:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="214753512"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:12:49 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 10:12:49 -0500
Received: from [10.80.3.146] (helo=localmatsp-T3500.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<mats.petersson@citrix.com>)	id 1TZNb6-0006t4-Lz;
	Fri, 16 Nov 2012 15:12:48 +0000
From: Mats Petersson <mats.petersson@citrix.com>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 15:12:42 +0000
Message-ID: <1353078762-30067-1-git-send-email-mats.petersson@citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <1353062828-5476-1-git-send-email-mats.petersson@citrix.com>
References: <1353062828-5476-1-git-send-email-mats.petersson@citrix.com>
MIME-Version: 1.0
Cc: Mats Petersson <mats.petersson@citrix.com>, konrad.wilk@oracle.com
Subject: [Xen-devel] [PATCH] Correctly return success from
	IOCTL_PRIVCMD_MMAPBATCH
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a regression introduced by ceb90fa0 (xen/privcmd: add
PRIVCMD_MMAPBATCH_V2 ioctl).  It broke xentrace as it used
xc_map_foreign() instead of xc_map_foreign_bulk().

Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
that it broke. The return value is set early on to -EINVAL, and if all
goes well, the "set top bits of the MFN's" never gets called, so the
return value is still EINVAL when the function gets to the end, causing
the caller to think it went wrong (which it didn't!)

Signed off by: Mats Petersson <mats.petersson@citrix.com>
Acked-by: David Vrabel <david.vrabel@citrix.com>

---
 drivers/xen/privcmd.c |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index 8adb9cc..24aec2f 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -383,12 +383,16 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
 
 	up_write(&mm->mmap_sem);
 
-	if (state.global_error && (version == 1)) {
-		/* Write back errors in second pass. */
-		state.user_mfn = (xen_pfn_t *)m.arr;
-		state.err      = err_array;
-		ret = traverse_pages(m.num, sizeof(xen_pfn_t),
-				     &pagelist, mmap_return_errors_v1, &state);
+	if (version == 1) {
+		if (state.global_error) {
+			/* Write back errors in second pass. */
+			state.user_mfn = (xen_pfn_t *)m.arr;
+			state.err      = err_array;
+			ret = traverse_pages(m.num, sizeof(xen_pfn_t),
+					     &pagelist, mmap_return_errors_v1, &state);
+		} else
+			ret = 0;
+
 	} else if (version == 2) {
 		ret = __copy_to_user(m.err, err_array, m.num * sizeof(int));
 		if (ret)
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:13:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:13:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNbA-0005Kx-VE; Fri, 16 Nov 2012 15:12:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZNb9-0005Kp-Vz
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:12:52 +0000
Received: from [85.158.143.99:41389] by server-3.bemta-4.messagelabs.com id
	39/10-06841-3F756A05; Fri, 16 Nov 2012 15:12:51 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1353078769!22696123!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODY5MjY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13548 invoked from network); 16 Nov 2012 15:12:50 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-11.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:12:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="214753512"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:12:49 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 10:12:49 -0500
Received: from [10.80.3.146] (helo=localmatsp-T3500.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<mats.petersson@citrix.com>)	id 1TZNb6-0006t4-Lz;
	Fri, 16 Nov 2012 15:12:48 +0000
From: Mats Petersson <mats.petersson@citrix.com>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 15:12:42 +0000
Message-ID: <1353078762-30067-1-git-send-email-mats.petersson@citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <1353062828-5476-1-git-send-email-mats.petersson@citrix.com>
References: <1353062828-5476-1-git-send-email-mats.petersson@citrix.com>
MIME-Version: 1.0
Cc: Mats Petersson <mats.petersson@citrix.com>, konrad.wilk@oracle.com
Subject: [Xen-devel] [PATCH] Correctly return success from
	IOCTL_PRIVCMD_MMAPBATCH
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a regression introduced by ceb90fa0 (xen/privcmd: add
PRIVCMD_MMAPBATCH_V2 ioctl).  It broke xentrace as it used
xc_map_foreign() instead of xc_map_foreign_bulk().

Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
that it broke. The return value is set early on to -EINVAL, and if all
goes well, the "set top bits of the MFN's" never gets called, so the
return value is still EINVAL when the function gets to the end, causing
the caller to think it went wrong (which it didn't!)

Signed off by: Mats Petersson <mats.petersson@citrix.com>
Acked-by: David Vrabel <david.vrabel@citrix.com>

---
 drivers/xen/privcmd.c |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index 8adb9cc..24aec2f 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -383,12 +383,16 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
 
 	up_write(&mm->mmap_sem);
 
-	if (state.global_error && (version == 1)) {
-		/* Write back errors in second pass. */
-		state.user_mfn = (xen_pfn_t *)m.arr;
-		state.err      = err_array;
-		ret = traverse_pages(m.num, sizeof(xen_pfn_t),
-				     &pagelist, mmap_return_errors_v1, &state);
+	if (version == 1) {
+		if (state.global_error) {
+			/* Write back errors in second pass. */
+			state.user_mfn = (xen_pfn_t *)m.arr;
+			state.err      = err_array;
+			ret = traverse_pages(m.num, sizeof(xen_pfn_t),
+					     &pagelist, mmap_return_errors_v1, &state);
+		} else
+			ret = 0;
+
 	} else if (version == 2) {
 		ret = __copy_to_user(m.err, err_array, m.num * sizeof(int));
 		if (ret)
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:19:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:19:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNgy-0005Yg-P8; Fri, 16 Nov 2012 15:18:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZNgx-0005Yb-4w
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 15:18:51 +0000
Received: from [85.158.139.211:11825] by server-14.bemta-5.messagelabs.com id
	01/FB-21768-A5956A05; Fri, 16 Nov 2012 15:18:50 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1353079128!16466695!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2ODgwNw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1317 invoked from network); 16 Nov 2012 15:18:49 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-13.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 15:18:49 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGFIjxl014636
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 15:18:46 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGFIiYQ003818
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 15:18:44 GMT
Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGFIiZw030976; Fri, 16 Nov 2012 09:18:44 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 07:18:44 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 5F21140C0D; Fri, 16 Nov 2012 10:18:40 -0500 (EST)
Date: Fri, 16 Nov 2012 10:18:40 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Annie Li <annie.li@oracle.com>
Message-ID: <20121116151840.GE22320@phenom.dumpdata.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352962987-541-1-git-send-email-annie.li@oracle.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: netdev@vger.kernel.org, xen-devel@lists.xensource.com,
	Ian.Campbell@citrix.com
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
> This patch implements persistent grants for xen-netfront/netback. This
> mechanism maintains page pools in netback/netfront, these page pools is used to
> save grant pages which are mapped. This way improve performance which is wasted
> when doing grant operations.
> 
> Current netback/netfront does map/unmap grant operations frequently when
> transmitting/receiving packets, and grant operations costs much cpu clock. In
> this patch, netfront/netback maps grant pages when needed and then saves them
> into a page pool for future use. All these pages will be unmapped when
> removing/releasing the net device.
> 
> In netfront, two pools are maintained for transmitting and receiving packets.
> When new grant pages are needed, the driver gets grant pages from this pool
> first. If no free grant page exists, it allocates new page, maps it and then
> saves it into the pool. The pool size for transmit/receive is exactly tx/rx
> ring size. The driver uses memcpy(not grantcopy) to copy data grant pages.
> Here, memcpy is copying the whole page size data. I tried to copy len size data
> from offset, but network does not seem work well. I am trying to find the root
> cause now.
> 
> In netback, it also maintains two page pools for tx/rx. When netback gets a
> request, it does a search first to find out whether the grant reference of
> this request is already mapped into its page pool. If the grant ref is mapped,
> the address of this mapped page is gotten and memcpy is used to copy data
> between grant pages. However, if the grant ref is not mapped, a new page is
> allocated, mapped with this grant ref, and then saved into page pool for
> future use. Similarly, memcpy replaces grant copy to copy data between grant
> pages. In this implementation, two arrays(gnttab_tx_vif,gnttab_rx_vif) are
> used to save vif pointer for every request because current netback is not
> per-vif based. This would be changed after implementing 1:1 model in netback.
> 
> This patch supports both persistent-grant and non persistent grant. A new
> xenstore key "feature-persistent-grants" is used to represent this feature.
> 
> This patch is based on linux3.4-rc3. I hit netperf/netserver failure on
> linux latest version v3.7-rc1, v3.7-rc2 and v3.7-rc4. Not sure whether this
> netperf/netserver failure connects compound page commit in v3.7-rc1, but I did
> hit BUG_ON with debug patch from thread
> http://lists.xen.org/archives/html/xen-devel/2012-10/msg00893.html

FYI, I get this:

 477.814511] BUG: sleeping function called from invalid context at /home/konrad/ssd/linux/mm/page_alloc.c:2487
[  477.815281] in_atomic(): 1, irqs_disabled(): 1, pid: 3017, name: netperf
[  477.815281] Pid: 3017, comm: netperf Not tainted 3.5.0upstream-00004-g69047bb #1
[  477.815281] Call Trace:
[  477.815281]  [<ffffffff810b990a>] __might_sleep+0xda/0x100
[  477.815281]  [<ffffffff81142e93>] __alloc_pages_nodemask+0x223/0x920
[  477.815281]  [<ffffffff81158439>] ? zone_statistics+0x99/0xc0
[  477.815281]  [<ffffffff81076e79>] ? default_spin_lock_flags+0x9/0x10
[  477.815281]  [<ffffffff81615e3a>] ? _raw_spin_lock_irqsave+0x3a/0x50
[  477.815281]  [<ffffffff81076e79>] ? default_spin_lock_flags+0x9/0x10
[  477.815281]  [<ffffffff81098977>] ? lock_timer_base+0x37/0x70
[  477.815281]  [<ffffffff8109a03d>] ? mod_timer_pending+0x11d/0x230
[  477.815281]  [<ffffffff81616144>] ? _raw_spin_unlock_bh+0x24/0x30
[  477.815281]  [<ffffffff8117e7e1>] alloc_pages_current+0xb1/0x110
[  477.815281]  [<ffffffffa0034238>] xennet_alloc_tx_ref+0x78/0x1c0 [xen_netfront]
[  477.815281]  [<ffffffffa00344eb>] xennet_start_xmit+0x16b/0x9f0 [xen_netfront]
[  477.815281]  [<ffffffff814c69eb>] dev_hard_start_xmit+0x2fb/0x6f0
[  477.815281]  [<ffffffff814e4566>] sch_direct_xmit+0x116/0x1e0
[  477.815281]  [<ffffffff814c6f6a>] dev_queue_xmit+0x18a/0x6b0
[  477.815281]  [<ffffffff8151264e>] ip_finish_output+0x18e/0x300
[  477.815281]  [<ffffffff81512821>] ip_output+0x61/0xa0
[  477.815281]  [<ffffffff81511b82>] ? __ip_local_out+0xa2/0xb0
[  477.815281]  [<ffffffff81511bb4>] ip_local_out+0x24/0x30
[  477.815281]  [<ffffffff81511ffe>] ip_queue_xmit+0x15e/0x410
[  477.815281]  [<ffffffff81528354>] tcp_transmit_skb+0x424/0x8f0
[  477.815281]  [<ffffffff8152a8c2>] tcp_write_xmit+0x1f2/0x9c0
[  477.815281]  [<ffffffff81182194>] ? ksize+0x14/0x70
[  477.815281]  [<ffffffff8152b711>] __tcp_push_pending_frames+0x21/0x90
[  477.815281]  [<ffffffff8151db23>] tcp_sendmsg+0x983/0xcd0
[  477.815281]  [<ffffffff81540daf>] inet_sendmsg+0x7f/0xd0
[  477.815281]  [<ffffffff81290dde>] ? selinux_socket_sendmsg+0x1e/0x20
[  477.815281]  [<ffffffff814aed13>] sock_sendmsg+0xf3/0x120
[  477.815281]  [<ffffffff81076f48>] ? pvclock_clocksource_read+0x58/0xd0
[  477.815281]  [<ffffffff812de7c0>] ? timerqueue_add+0x60/0xb0
[  477.815281]  [<ffffffff810b0b85>] ? enqueue_hrtimer+0x25/0xb0
[  477.815281]  [<ffffffff814af4d4>] sys_sendto+0x104/0x140
[  477.815281]  [<ffffffff81041279>] ? xen_clocksource_read+0x39/0x50
[  477.815281]  [<ffffffff81041419>] ? xen_clocksource_get_cycles+0x9/0x10
[  477.815281]  [<ffffffff810d3242>] ? getnstimeofday+0x52/0xe0
[  477.815281]  [<ffffffff8161dfb9>] system_call_fastpath+0x16/0x1b

> 
> 
> Annie Li (4):
>   xen/netback: implements persistent grant with one page pool.
>   xen/netback: Split one page pool into two(tx/rx) page pool.
>   Xen/netfront: Implement persistent grant in netfront.
>   fix code indent issue in xen-netfront.
> 
>  drivers/net/xen-netback/common.h    |   24 ++-
>  drivers/net/xen-netback/interface.c |   26 +++
>  drivers/net/xen-netback/netback.c   |  215 ++++++++++++++++++--
>  drivers/net/xen-netback/xenbus.c    |   14 ++-
>  drivers/net/xen-netfront.c          |  378 +++++++++++++++++++++++++++++------
>  5 files changed, 570 insertions(+), 87 deletions(-)
> 
> -- 
> 1.7.3.4

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:19:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:19:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNgy-0005Yg-P8; Fri, 16 Nov 2012 15:18:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZNgx-0005Yb-4w
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 15:18:51 +0000
Received: from [85.158.139.211:11825] by server-14.bemta-5.messagelabs.com id
	01/FB-21768-A5956A05; Fri, 16 Nov 2012 15:18:50 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1353079128!16466695!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2ODgwNw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1317 invoked from network); 16 Nov 2012 15:18:49 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-13.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 15:18:49 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGFIjxl014636
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 15:18:46 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGFIiYQ003818
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 15:18:44 GMT
Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGFIiZw030976; Fri, 16 Nov 2012 09:18:44 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 07:18:44 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 5F21140C0D; Fri, 16 Nov 2012 10:18:40 -0500 (EST)
Date: Fri, 16 Nov 2012 10:18:40 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Annie Li <annie.li@oracle.com>
Message-ID: <20121116151840.GE22320@phenom.dumpdata.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352962987-541-1-git-send-email-annie.li@oracle.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: netdev@vger.kernel.org, xen-devel@lists.xensource.com,
	Ian.Campbell@citrix.com
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
> This patch implements persistent grants for xen-netfront/netback. This
> mechanism maintains page pools in netback/netfront, these page pools is used to
> save grant pages which are mapped. This way improve performance which is wasted
> when doing grant operations.
> 
> Current netback/netfront does map/unmap grant operations frequently when
> transmitting/receiving packets, and grant operations costs much cpu clock. In
> this patch, netfront/netback maps grant pages when needed and then saves them
> into a page pool for future use. All these pages will be unmapped when
> removing/releasing the net device.
> 
> In netfront, two pools are maintained for transmitting and receiving packets.
> When new grant pages are needed, the driver gets grant pages from this pool
> first. If no free grant page exists, it allocates new page, maps it and then
> saves it into the pool. The pool size for transmit/receive is exactly tx/rx
> ring size. The driver uses memcpy(not grantcopy) to copy data grant pages.
> Here, memcpy is copying the whole page size data. I tried to copy len size data
> from offset, but network does not seem work well. I am trying to find the root
> cause now.
> 
> In netback, it also maintains two page pools for tx/rx. When netback gets a
> request, it does a search first to find out whether the grant reference of
> this request is already mapped into its page pool. If the grant ref is mapped,
> the address of this mapped page is gotten and memcpy is used to copy data
> between grant pages. However, if the grant ref is not mapped, a new page is
> allocated, mapped with this grant ref, and then saved into page pool for
> future use. Similarly, memcpy replaces grant copy to copy data between grant
> pages. In this implementation, two arrays(gnttab_tx_vif,gnttab_rx_vif) are
> used to save vif pointer for every request because current netback is not
> per-vif based. This would be changed after implementing 1:1 model in netback.
> 
> This patch supports both persistent-grant and non persistent grant. A new
> xenstore key "feature-persistent-grants" is used to represent this feature.
> 
> This patch is based on linux3.4-rc3. I hit netperf/netserver failure on
> linux latest version v3.7-rc1, v3.7-rc2 and v3.7-rc4. Not sure whether this
> netperf/netserver failure connects compound page commit in v3.7-rc1, but I did
> hit BUG_ON with debug patch from thread
> http://lists.xen.org/archives/html/xen-devel/2012-10/msg00893.html

FYI, I get this:

 477.814511] BUG: sleeping function called from invalid context at /home/konrad/ssd/linux/mm/page_alloc.c:2487
[  477.815281] in_atomic(): 1, irqs_disabled(): 1, pid: 3017, name: netperf
[  477.815281] Pid: 3017, comm: netperf Not tainted 3.5.0upstream-00004-g69047bb #1
[  477.815281] Call Trace:
[  477.815281]  [<ffffffff810b990a>] __might_sleep+0xda/0x100
[  477.815281]  [<ffffffff81142e93>] __alloc_pages_nodemask+0x223/0x920
[  477.815281]  [<ffffffff81158439>] ? zone_statistics+0x99/0xc0
[  477.815281]  [<ffffffff81076e79>] ? default_spin_lock_flags+0x9/0x10
[  477.815281]  [<ffffffff81615e3a>] ? _raw_spin_lock_irqsave+0x3a/0x50
[  477.815281]  [<ffffffff81076e79>] ? default_spin_lock_flags+0x9/0x10
[  477.815281]  [<ffffffff81098977>] ? lock_timer_base+0x37/0x70
[  477.815281]  [<ffffffff8109a03d>] ? mod_timer_pending+0x11d/0x230
[  477.815281]  [<ffffffff81616144>] ? _raw_spin_unlock_bh+0x24/0x30
[  477.815281]  [<ffffffff8117e7e1>] alloc_pages_current+0xb1/0x110
[  477.815281]  [<ffffffffa0034238>] xennet_alloc_tx_ref+0x78/0x1c0 [xen_netfront]
[  477.815281]  [<ffffffffa00344eb>] xennet_start_xmit+0x16b/0x9f0 [xen_netfront]
[  477.815281]  [<ffffffff814c69eb>] dev_hard_start_xmit+0x2fb/0x6f0
[  477.815281]  [<ffffffff814e4566>] sch_direct_xmit+0x116/0x1e0
[  477.815281]  [<ffffffff814c6f6a>] dev_queue_xmit+0x18a/0x6b0
[  477.815281]  [<ffffffff8151264e>] ip_finish_output+0x18e/0x300
[  477.815281]  [<ffffffff81512821>] ip_output+0x61/0xa0
[  477.815281]  [<ffffffff81511b82>] ? __ip_local_out+0xa2/0xb0
[  477.815281]  [<ffffffff81511bb4>] ip_local_out+0x24/0x30
[  477.815281]  [<ffffffff81511ffe>] ip_queue_xmit+0x15e/0x410
[  477.815281]  [<ffffffff81528354>] tcp_transmit_skb+0x424/0x8f0
[  477.815281]  [<ffffffff8152a8c2>] tcp_write_xmit+0x1f2/0x9c0
[  477.815281]  [<ffffffff81182194>] ? ksize+0x14/0x70
[  477.815281]  [<ffffffff8152b711>] __tcp_push_pending_frames+0x21/0x90
[  477.815281]  [<ffffffff8151db23>] tcp_sendmsg+0x983/0xcd0
[  477.815281]  [<ffffffff81540daf>] inet_sendmsg+0x7f/0xd0
[  477.815281]  [<ffffffff81290dde>] ? selinux_socket_sendmsg+0x1e/0x20
[  477.815281]  [<ffffffff814aed13>] sock_sendmsg+0xf3/0x120
[  477.815281]  [<ffffffff81076f48>] ? pvclock_clocksource_read+0x58/0xd0
[  477.815281]  [<ffffffff812de7c0>] ? timerqueue_add+0x60/0xb0
[  477.815281]  [<ffffffff810b0b85>] ? enqueue_hrtimer+0x25/0xb0
[  477.815281]  [<ffffffff814af4d4>] sys_sendto+0x104/0x140
[  477.815281]  [<ffffffff81041279>] ? xen_clocksource_read+0x39/0x50
[  477.815281]  [<ffffffff81041419>] ? xen_clocksource_get_cycles+0x9/0x10
[  477.815281]  [<ffffffff810d3242>] ? getnstimeofday+0x52/0xe0
[  477.815281]  [<ffffffff8161dfb9>] system_call_fastpath+0x16/0x1b

> 
> 
> Annie Li (4):
>   xen/netback: implements persistent grant with one page pool.
>   xen/netback: Split one page pool into two(tx/rx) page pool.
>   Xen/netfront: Implement persistent grant in netfront.
>   fix code indent issue in xen-netfront.
> 
>  drivers/net/xen-netback/common.h    |   24 ++-
>  drivers/net/xen-netback/interface.c |   26 +++
>  drivers/net/xen-netback/netback.c   |  215 ++++++++++++++++++--
>  drivers/net/xen-netback/xenbus.c    |   14 ++-
>  drivers/net/xen-netfront.c          |  378 +++++++++++++++++++++++++++++------
>  5 files changed, 570 insertions(+), 87 deletions(-)
> 
> -- 
> 1.7.3.4

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:23:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:23:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNl8-0005li-FP; Fri, 16 Nov 2012 15:23:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZNl7-0005ld-2U
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 15:23:09 +0000
Received: from [85.158.143.35:9050] by server-2.bemta-4.messagelabs.com id
	BA/5D-28922-C5A56A05; Fri, 16 Nov 2012 15:23:08 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1353079352!18004149!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2ODgwNw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27993 invoked from network); 16 Nov 2012 15:22:37 -0000
Received: from unknown (HELO userp1040.oracle.com) (156.151.31.81)
	by server-6.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 15:22:37 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGFLJuu017577
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 15:21:20 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGFLJel008775
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 15:21:19 GMT
Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGFLID8027459; Fri, 16 Nov 2012 09:21:18 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 07:21:18 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 4256540C0E; Fri, 16 Nov 2012 10:21:15 -0500 (EST)
Date: Fri, 16 Nov 2012 10:21:15 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Message-ID: <20121116152115.GF22320@phenom.dumpdata.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
	<50A4CA51.8080208@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A4CA51.8080208@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
 xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 15, 2012 at 11:56:17AM +0100, Roger Pau Monn=E9 wrote:
> On 15/11/12 09:38, ANNIE LI wrote:
> > =

> > =

> > On 2012-11-15 15:40, Pasi K=E4rkk=E4inen wrote:
> >> Hello,
> >>
> >> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
> >>> This patch implements persistent grants for xen-netfront/netback. This
> >>> mechanism maintains page pools in netback/netfront, these page pools =
is used to
> >>> save grant pages which are mapped. This way improve performance which=
 is wasted
> >>> when doing grant operations.
> >>>
> >>> Current netback/netfront does map/unmap grant operations frequently w=
hen
> >>> transmitting/receiving packets, and grant operations costs much cpu c=
lock. In
> >>> this patch, netfront/netback maps grant pages when needed and then sa=
ves them
> >>> into a page pool for future use. All these pages will be unmapped when
> >>> removing/releasing the net device.
> >>>
> >> Do you have performance numbers available already? with/without persis=
tent grants?
> > I have some simple netperf/netserver test result with/without persisten=
t =

> > grants,
> > =

> > Following is result of with persistent grant patch,
> > =

> > Guests, Sum,      Avg,     Min,     Max
> >   1,  15106.4,  15106.4, 15106.36, 15106.36
> >   2,  13052.7,  6526.34,  6261.81,  6790.86
> >   3,  12675.1,  6337.53,  6220.24,  6454.83
> >   4,  13194,  6596.98,  6274.70,  6919.25
> > =

> > =

> > Following are result of without persistent patch
> > =

> > Guests, Sum,     Avg,    Min,        Max
> >   1,  10864.1,  10864.1, 10864.10, 10864.10
> >   2,  10898.5,  5449.24,  4862.08,  6036.40
> >   3,  10734.5,  5367.26,  5261.43,  5473.08
> >   4,  10924,    5461.99,  5314.84,  5609.14
> =

> In the block case, performance improvement is seen when using a large
> number of guests, could you perform the same benchmark increasing the
> number of guests to 15?

Keep in mind that one of the things that is limiting these numbers is
that netback is very CPU intensive. So I think it could get much much
faster - but netback pegs at 100%. With Wei Liu's patches the CPU usage
did drop by 40% (this is when I tested the old netback with Wei's
netback patches)- so we should see even a further speed increase.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:23:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:23:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNl8-0005li-FP; Fri, 16 Nov 2012 15:23:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZNl7-0005ld-2U
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 15:23:09 +0000
Received: from [85.158.143.35:9050] by server-2.bemta-4.messagelabs.com id
	BA/5D-28922-C5A56A05; Fri, 16 Nov 2012 15:23:08 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1353079352!18004149!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2ODgwNw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27993 invoked from network); 16 Nov 2012 15:22:37 -0000
Received: from unknown (HELO userp1040.oracle.com) (156.151.31.81)
	by server-6.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 15:22:37 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGFLJuu017577
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 15:21:20 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGFLJel008775
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 15:21:19 GMT
Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGFLID8027459; Fri, 16 Nov 2012 09:21:18 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 07:21:18 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 4256540C0E; Fri, 16 Nov 2012 10:21:15 -0500 (EST)
Date: Fri, 16 Nov 2012 10:21:15 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Message-ID: <20121116152115.GF22320@phenom.dumpdata.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
	<50A4CA51.8080208@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A4CA51.8080208@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
 xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 15, 2012 at 11:56:17AM +0100, Roger Pau Monn=E9 wrote:
> On 15/11/12 09:38, ANNIE LI wrote:
> > =

> > =

> > On 2012-11-15 15:40, Pasi K=E4rkk=E4inen wrote:
> >> Hello,
> >>
> >> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
> >>> This patch implements persistent grants for xen-netfront/netback. This
> >>> mechanism maintains page pools in netback/netfront, these page pools =
is used to
> >>> save grant pages which are mapped. This way improve performance which=
 is wasted
> >>> when doing grant operations.
> >>>
> >>> Current netback/netfront does map/unmap grant operations frequently w=
hen
> >>> transmitting/receiving packets, and grant operations costs much cpu c=
lock. In
> >>> this patch, netfront/netback maps grant pages when needed and then sa=
ves them
> >>> into a page pool for future use. All these pages will be unmapped when
> >>> removing/releasing the net device.
> >>>
> >> Do you have performance numbers available already? with/without persis=
tent grants?
> > I have some simple netperf/netserver test result with/without persisten=
t =

> > grants,
> > =

> > Following is result of with persistent grant patch,
> > =

> > Guests, Sum,      Avg,     Min,     Max
> >   1,  15106.4,  15106.4, 15106.36, 15106.36
> >   2,  13052.7,  6526.34,  6261.81,  6790.86
> >   3,  12675.1,  6337.53,  6220.24,  6454.83
> >   4,  13194,  6596.98,  6274.70,  6919.25
> > =

> > =

> > Following are result of without persistent patch
> > =

> > Guests, Sum,     Avg,    Min,        Max
> >   1,  10864.1,  10864.1, 10864.10, 10864.10
> >   2,  10898.5,  5449.24,  4862.08,  6036.40
> >   3,  10734.5,  5367.26,  5261.43,  5473.08
> >   4,  10924,    5461.99,  5314.84,  5609.14
> =

> In the block case, performance improvement is seen when using a large
> number of guests, could you perform the same benchmark increasing the
> number of guests to 15?

Keep in mind that one of the things that is limiting these numbers is
that netback is very CPU intensive. So I think it could get much much
faster - but netback pegs at 100%. With Wei Liu's patches the CPU usage
did drop by 40% (this is when I tested the old netback with Wei's
netback patches)- so we should see even a further speed increase.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:23:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:23:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNli-0005pA-2O; Fri, 16 Nov 2012 15:23:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZNlg-0005p0-Q6
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 15:23:45 +0000
Received: from [85.158.137.99:19113] by server-13.bemta-3.messagelabs.com id
	BA/C0-24887-08A56A05; Fri, 16 Nov 2012 15:23:44 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1353079421!16270383!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2ODgwNw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27470 invoked from network); 16 Nov 2012 15:23:43 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 15:23:43 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGFNUFK019950
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 15:23:31 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGFNTLs005986
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 15:23:30 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGFNTxf002872; Fri, 16 Nov 2012 09:23:29 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 07:23:29 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 98CD940C0E; Fri, 16 Nov 2012 10:23:25 -0500 (EST)
Date: Fri, 16 Nov 2012 10:23:25 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121116152325.GG22320@phenom.dumpdata.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
	<50A4CA51.8080208@citrix.com>
	<1352978106.3499.101.camel@zakaz.uk.xensource.com>
	<20121115182928.GB22320@phenom.dumpdata.com>
	<1353006667.26243.6.camel@dagon.hellion.org.uk>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353006667.26243.6.camel@dagon.hellion.org.uk>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
 xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 15, 2012 at 07:11:07PM +0000, Ian Campbell wrote:
> On Thu, 2012-11-15 at 18:29 +0000, Konrad Rzeszutek Wilk wrote:
> > On Thu, Nov 15, 2012 at 11:15:06AM +0000, Ian Campbell wrote:
> > > On Thu, 2012-11-15 at 10:56 +0000, Roger Pau Monne wrote:
> > > > On 15/11/12 09:38, ANNIE LI wrote:
> > > > > =

> > > > > =

> > > > > On 2012-11-15 15:40, Pasi K=E4rkk=E4inen wrote:
> > > > >> Hello,
> > > > >>
> > > > >> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
> > > > >>> This patch implements persistent grants for xen-netfront/netbac=
k. This
> > > > >>> mechanism maintains page pools in netback/netfront, these page =
pools is used to
> > > > >>> save grant pages which are mapped. This way improve performance=
 which is wasted
> > > > >>> when doing grant operations.
> > > > >>>
> > > > >>> Current netback/netfront does map/unmap grant operations freque=
ntly when
> > > > >>> transmitting/receiving packets, and grant operations costs much=
 cpu clock. In
> > > > >>> this patch, netfront/netback maps grant pages when needed and t=
hen saves them
> > > > >>> into a page pool for future use. All these pages will be unmapp=
ed when
> > > > >>> removing/releasing the net device.
> > > > >>>
> > > > >> Do you have performance numbers available already? with/without =
persistent grants?
> > > > > I have some simple netperf/netserver test result with/without per=
sistent =

> > > > > grants,
> > > > > =

> > > > > Following is result of with persistent grant patch,
> > > > > =

> > > > > Guests, Sum,      Avg,     Min,     Max
> > > > >   1,  15106.4,  15106.4, 15106.36, 15106.36
> > > > >   2,  13052.7,  6526.34,  6261.81,  6790.86
> > > > >   3,  12675.1,  6337.53,  6220.24,  6454.83
> > > > >   4,  13194,  6596.98,  6274.70,  6919.25
> > > > > =

> > > > > =

> > > > > Following are result of without persistent patch
> > > > > =

> > > > > Guests, Sum,     Avg,    Min,        Max
> > > > >   1,  10864.1,  10864.1, 10864.10, 10864.10
> > > > >   2,  10898.5,  5449.24,  4862.08,  6036.40
> > > > >   3,  10734.5,  5367.26,  5261.43,  5473.08
> > > > >   4,  10924,    5461.99,  5314.84,  5609.14
> > > > =

> > > > In the block case, performance improvement is seen when using a lar=
ge
> > > > number of guests, could you perform the same benchmark increasing t=
he
> > > > number of guests to 15?
> > > =

> > > It would also be nice to see some analysis of the numbers which justi=
fy
> > > why this change is a good one without every reviewer having to evalua=
te
> > > the raw data themselves. In fact this should really be part of the
> > > commit message.
> > =

> > You mean like a nice graph, eh?
> =

> Together with an analysis of what it means and why it is a good thing,
> yes.

OK, lets put that on the TODO list for the next posting. In the meantime -
it sounds like you (the maintainer) are happy with the direction this is go=
ing.

The other things we want to do _after_ these patches is to look at the Wei
Liu patches and try to address the different reviewers comments.

The neat thing about them is that they have a concept of a page pool system.
And with persistent pages in both blkback and netback this gets more exciti=
ng.


> =

> Ian.
> =

> > =

> > I will run these patches on my 32GB box and see if I can give you
> > a nice PDF/jpg.
> > =

> > > =

> > > Ian.
> > > =

> =


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:23:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:23:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNli-0005pA-2O; Fri, 16 Nov 2012 15:23:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZNlg-0005p0-Q6
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 15:23:45 +0000
Received: from [85.158.137.99:19113] by server-13.bemta-3.messagelabs.com id
	BA/C0-24887-08A56A05; Fri, 16 Nov 2012 15:23:44 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1353079421!16270383!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2ODgwNw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27470 invoked from network); 16 Nov 2012 15:23:43 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 15:23:43 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGFNUFK019950
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 15:23:31 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGFNTLs005986
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 15:23:30 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGFNTxf002872; Fri, 16 Nov 2012 09:23:29 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 07:23:29 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 98CD940C0E; Fri, 16 Nov 2012 10:23:25 -0500 (EST)
Date: Fri, 16 Nov 2012 10:23:25 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121116152325.GG22320@phenom.dumpdata.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
	<50A4CA51.8080208@citrix.com>
	<1352978106.3499.101.camel@zakaz.uk.xensource.com>
	<20121115182928.GB22320@phenom.dumpdata.com>
	<1353006667.26243.6.camel@dagon.hellion.org.uk>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353006667.26243.6.camel@dagon.hellion.org.uk>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
 xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 15, 2012 at 07:11:07PM +0000, Ian Campbell wrote:
> On Thu, 2012-11-15 at 18:29 +0000, Konrad Rzeszutek Wilk wrote:
> > On Thu, Nov 15, 2012 at 11:15:06AM +0000, Ian Campbell wrote:
> > > On Thu, 2012-11-15 at 10:56 +0000, Roger Pau Monne wrote:
> > > > On 15/11/12 09:38, ANNIE LI wrote:
> > > > > =

> > > > > =

> > > > > On 2012-11-15 15:40, Pasi K=E4rkk=E4inen wrote:
> > > > >> Hello,
> > > > >>
> > > > >> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
> > > > >>> This patch implements persistent grants for xen-netfront/netbac=
k. This
> > > > >>> mechanism maintains page pools in netback/netfront, these page =
pools is used to
> > > > >>> save grant pages which are mapped. This way improve performance=
 which is wasted
> > > > >>> when doing grant operations.
> > > > >>>
> > > > >>> Current netback/netfront does map/unmap grant operations freque=
ntly when
> > > > >>> transmitting/receiving packets, and grant operations costs much=
 cpu clock. In
> > > > >>> this patch, netfront/netback maps grant pages when needed and t=
hen saves them
> > > > >>> into a page pool for future use. All these pages will be unmapp=
ed when
> > > > >>> removing/releasing the net device.
> > > > >>>
> > > > >> Do you have performance numbers available already? with/without =
persistent grants?
> > > > > I have some simple netperf/netserver test result with/without per=
sistent =

> > > > > grants,
> > > > > =

> > > > > Following is result of with persistent grant patch,
> > > > > =

> > > > > Guests, Sum,      Avg,     Min,     Max
> > > > >   1,  15106.4,  15106.4, 15106.36, 15106.36
> > > > >   2,  13052.7,  6526.34,  6261.81,  6790.86
> > > > >   3,  12675.1,  6337.53,  6220.24,  6454.83
> > > > >   4,  13194,  6596.98,  6274.70,  6919.25
> > > > > =

> > > > > =

> > > > > Following are result of without persistent patch
> > > > > =

> > > > > Guests, Sum,     Avg,    Min,        Max
> > > > >   1,  10864.1,  10864.1, 10864.10, 10864.10
> > > > >   2,  10898.5,  5449.24,  4862.08,  6036.40
> > > > >   3,  10734.5,  5367.26,  5261.43,  5473.08
> > > > >   4,  10924,    5461.99,  5314.84,  5609.14
> > > > =

> > > > In the block case, performance improvement is seen when using a lar=
ge
> > > > number of guests, could you perform the same benchmark increasing t=
he
> > > > number of guests to 15?
> > > =

> > > It would also be nice to see some analysis of the numbers which justi=
fy
> > > why this change is a good one without every reviewer having to evalua=
te
> > > the raw data themselves. In fact this should really be part of the
> > > commit message.
> > =

> > You mean like a nice graph, eh?
> =

> Together with an analysis of what it means and why it is a good thing,
> yes.

OK, lets put that on the TODO list for the next posting. In the meantime -
it sounds like you (the maintainer) are happy with the direction this is go=
ing.

The other things we want to do _after_ these patches is to look at the Wei
Liu patches and try to address the different reviewers comments.

The neat thing about them is that they have a concept of a page pool system.
And with persistent pages in both blkback and netback this gets more exciti=
ng.


> =

> Ian.
> =

> > =

> > I will run these patches on my 32GB box and see if I can give you
> > a nice PDF/jpg.
> > =

> > > =

> > > Ian.
> > > =

> =


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:34:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:34:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNwA-0006DH-AA; Fri, 16 Nov 2012 15:34:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZNw8-0006DC-DT
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 15:34:32 +0000
Received: from [85.158.143.35:9990] by server-1.bemta-4.messagelabs.com id
	83/6A-27934-70D56A05; Fri, 16 Nov 2012 15:34:31 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1353080069!7601641!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTcyODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20771 invoked from network); 16 Nov 2012 15:34:30 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 15:34:30 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGFYHSx002664
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 15:34:18 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGFYHWR026663
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 15:34:17 GMT
Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGFYG3N011398; Fri, 16 Nov 2012 09:34:16 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 07:34:16 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 0464B40C10; Fri, 16 Nov 2012 10:34:13 -0500 (EST)
Date: Fri, 16 Nov 2012 10:34:12 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Wei Liu <liuw@liuw.name>
Message-ID: <20121116153412.GJ22320@phenom.dumpdata.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
	<CAOsiSVU+9fkGQhVhnrx=xxUD8hej55XXJGpKGWAxe1USPEhiEQ@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CAOsiSVU+9fkGQhVhnrx=xxUD8hej55XXJGpKGWAxe1USPEhiEQ@mail.gmail.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: netdev@vger.kernel.org, ANNIE LI <annie.li@oracle.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
 xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 15, 2012 at 05:35:13PM +0800, Wei Liu wrote:
> On Thu, Nov 15, 2012 at 4:38 PM, ANNIE LI <annie.li@oracle.com> wrote:
> =

> >
> >
> > On 2012-11-15 15:40, Pasi K=E4rkk=E4inen wrote:
> >
> >> Hello,
> >>
> >> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
> >>
> >>> This patch implements persistent grants for xen-netfront/netback. This
> >>> mechanism maintains page pools in netback/netfront, these page pools =
is
> >>> used to
> >>> save grant pages which are mapped. This way improve performance which=
 is
> >>> wasted
> >>> when doing grant operations.
> >>>
> >>> Current netback/netfront does map/unmap grant operations frequently w=
hen
> >>> transmitting/receiving packets, and grant operations costs much cpu
> >>> clock. In
> >>> this patch, netfront/netback maps grant pages when needed and then sa=
ves
> >>> them
> >>> into a page pool for future use. All these pages will be unmapped when
> >>> removing/releasing the net device.
> >>>
> >>>  Do you have performance numbers available already? with/without
> >> persistent grants?
> >>
> > I have some simple netperf/netserver test result with/without persistent
> > grants,
> >
> > Following is result of with persistent grant patch,
> >
> > Guests, Sum,      Avg,     Min,     Max
> >  1,  15106.4,  15106.4, 15106.36, 15106.36
> >  2,  13052.7,  6526.34,  6261.81,  6790.86
> >  3,  12675.1,  6337.53,  6220.24,  6454.83
> >  4,  13194,  6596.98,  6274.70,  6919.25
> >
> >
> > Following are result of without persistent patch
> >
> > Guests, Sum,     Avg,    Min,        Max
> >  1,  10864.1,  10864.1, 10864.10, 10864.10
> >  2,  10898.5,  5449.24,  4862.08,  6036.40
> >  3,  10734.5,  5367.26,  5261.43,  5473.08
> >  4,  10924,    5461.99,  5314.84,  5609.14
> >
> >
> >
> Interesting results. Have you tested how good it is on a 10G nic, i.e.
> guest sending packets
> through physical network to another host.

Not yet. This was done with two guests pounding each other. I am
setting two machines up for Annie so she can do that type of testing
and also with more guests.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:34:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:34:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNwA-0006DH-AA; Fri, 16 Nov 2012 15:34:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZNw8-0006DC-DT
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 15:34:32 +0000
Received: from [85.158.143.35:9990] by server-1.bemta-4.messagelabs.com id
	83/6A-27934-70D56A05; Fri, 16 Nov 2012 15:34:31 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1353080069!7601641!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTcyODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20771 invoked from network); 16 Nov 2012 15:34:30 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 15:34:30 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGFYHSx002664
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 15:34:18 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGFYHWR026663
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 15:34:17 GMT
Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGFYG3N011398; Fri, 16 Nov 2012 09:34:16 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 07:34:16 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 0464B40C10; Fri, 16 Nov 2012 10:34:13 -0500 (EST)
Date: Fri, 16 Nov 2012 10:34:12 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Wei Liu <liuw@liuw.name>
Message-ID: <20121116153412.GJ22320@phenom.dumpdata.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>
	<20121115074057.GO8912@reaktio.net> <50A4AA06.8080900@oracle.com>
	<CAOsiSVU+9fkGQhVhnrx=xxUD8hej55XXJGpKGWAxe1USPEhiEQ@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CAOsiSVU+9fkGQhVhnrx=xxUD8hej55XXJGpKGWAxe1USPEhiEQ@mail.gmail.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: netdev@vger.kernel.org, ANNIE LI <annie.li@oracle.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
 xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 15, 2012 at 05:35:13PM +0800, Wei Liu wrote:
> On Thu, Nov 15, 2012 at 4:38 PM, ANNIE LI <annie.li@oracle.com> wrote:
> =

> >
> >
> > On 2012-11-15 15:40, Pasi K=E4rkk=E4inen wrote:
> >
> >> Hello,
> >>
> >> On Thu, Nov 15, 2012 at 03:03:07PM +0800, Annie Li wrote:
> >>
> >>> This patch implements persistent grants for xen-netfront/netback. This
> >>> mechanism maintains page pools in netback/netfront, these page pools =
is
> >>> used to
> >>> save grant pages which are mapped. This way improve performance which=
 is
> >>> wasted
> >>> when doing grant operations.
> >>>
> >>> Current netback/netfront does map/unmap grant operations frequently w=
hen
> >>> transmitting/receiving packets, and grant operations costs much cpu
> >>> clock. In
> >>> this patch, netfront/netback maps grant pages when needed and then sa=
ves
> >>> them
> >>> into a page pool for future use. All these pages will be unmapped when
> >>> removing/releasing the net device.
> >>>
> >>>  Do you have performance numbers available already? with/without
> >> persistent grants?
> >>
> > I have some simple netperf/netserver test result with/without persistent
> > grants,
> >
> > Following is result of with persistent grant patch,
> >
> > Guests, Sum,      Avg,     Min,     Max
> >  1,  15106.4,  15106.4, 15106.36, 15106.36
> >  2,  13052.7,  6526.34,  6261.81,  6790.86
> >  3,  12675.1,  6337.53,  6220.24,  6454.83
> >  4,  13194,  6596.98,  6274.70,  6919.25
> >
> >
> > Following are result of without persistent patch
> >
> > Guests, Sum,     Avg,    Min,        Max
> >  1,  10864.1,  10864.1, 10864.10, 10864.10
> >  2,  10898.5,  5449.24,  4862.08,  6036.40
> >  3,  10734.5,  5367.26,  5261.43,  5473.08
> >  4,  10924,    5461.99,  5314.84,  5609.14
> >
> >
> >
> Interesting results. Have you tested how good it is on a 10G nic, i.e.
> guest sending packets
> through physical network to another host.

Not yet. This was done with two guests pounding each other. I am
setting two machines up for Annie so she can do that type of testing
and also with more guests.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:36:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:36:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNxa-0006I3-QI; Fri, 16 Nov 2012 15:36:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZNxZ-0006Hx-LG
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:36:01 +0000
Received: from [85.158.143.99:22061] by server-2.bemta-4.messagelabs.com id
	63/9F-28922-06D56A05; Fri, 16 Nov 2012 15:36:00 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1353080158!24920855!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2ODgwNw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4716 invoked from network); 16 Nov 2012 15:36:00 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-2.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 15:36:00 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGFZu9E002480
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 15:35:57 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGFZutE000039
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 15:35:56 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGFZtuL012859; Fri, 16 Nov 2012 09:35:55 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 07:35:55 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 8160D40C10; Fri, 16 Nov 2012 10:35:52 -0500 (EST)
Date: Fri, 16 Nov 2012 10:35:52 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Mats Petersson <mats.petersson@citrix.com>
Message-ID: <20121116153552.GK22320@phenom.dumpdata.com>
References: <1353062828-5476-1-git-send-email-mats.petersson@citrix.com>
	<1353078123-29828-1-git-send-email-mats.petersson@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353078123-29828-1-git-send-email-mats.petersson@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] Correctly return success from
	IOCTL_PRIVCMD_MMAPBATCH
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 16, 2012 at 03:02:02PM +0000, Mats Petersson wrote:
> Updated according to David Vrabel's comments. 

Huh? Where is the patch?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:36:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:36:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNxa-0006I3-QI; Fri, 16 Nov 2012 15:36:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZNxZ-0006Hx-LG
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:36:01 +0000
Received: from [85.158.143.99:22061] by server-2.bemta-4.messagelabs.com id
	63/9F-28922-06D56A05; Fri, 16 Nov 2012 15:36:00 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1353080158!24920855!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2ODgwNw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4716 invoked from network); 16 Nov 2012 15:36:00 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-2.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 15:36:00 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGFZu9E002480
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 15:35:57 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGFZutE000039
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 15:35:56 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGFZtuL012859; Fri, 16 Nov 2012 09:35:55 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 07:35:55 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 8160D40C10; Fri, 16 Nov 2012 10:35:52 -0500 (EST)
Date: Fri, 16 Nov 2012 10:35:52 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Mats Petersson <mats.petersson@citrix.com>
Message-ID: <20121116153552.GK22320@phenom.dumpdata.com>
References: <1353062828-5476-1-git-send-email-mats.petersson@citrix.com>
	<1353078123-29828-1-git-send-email-mats.petersson@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353078123-29828-1-git-send-email-mats.petersson@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] Correctly return success from
	IOCTL_PRIVCMD_MMAPBATCH
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 16, 2012 at 03:02:02PM +0000, Mats Petersson wrote:
> Updated according to David Vrabel's comments. 

Huh? Where is the patch?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:37:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:37:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNyw-0006OH-C8; Fri, 16 Nov 2012 15:37:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TZNyu-0006O8-Q9
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 15:37:25 +0000
Received: from [85.158.138.51:3030] by server-3.bemta-3.messagelabs.com id
	7B/21-31566-3BD56A05; Fri, 16 Nov 2012 15:37:23 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1353080241!10600136!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODY5MjY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6881 invoked from network); 16 Nov 2012 15:37:23 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:37:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="214757692"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:37:10 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 10:37:10 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TZNyf-0007ER-Sg;
	Fri, 16 Nov 2012 15:37:09 +0000
Date: Fri, 16 Nov 2012 15:36:34 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1352973753.3499.81.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211151529540.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-6-git-send-email-stefano.stabellini@eu.citrix.com>
	<1352973753.3499.81.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 6/7] xen/arm: flush D-cache and I-cache when
 appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 15 Nov 2012, Ian Campbell wrote:
> On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> > - invalidate tlb after setting WXN;
> > - flush D-cache and I-cache after relocation;
> > - flush D-cache after writing to smp_up_cpu;
> > - flush TLB before changing HTTBR;
> > - flush I-cache after changing HTTBR;
> > - flush I-cache and branch predictor after writing Xen text ptes.
> 
> Since the reasoning is pretty subtle I wonder if you could say a few
> words in each case about why these flushes are necessary? Either here on
> in the comments in the code.

I'll remove the TLB flush before changing HTTBR because it isn't
actually needed.
I'll write comments in the code regarding the D-cache flush after
changing smp_up_cpu. I think that the others are self explanatory (they
are a consequence of the fact that we are modifying the code we are
running on or the mapping of it).


> > @@ -244,10 +245,17 @@ void __init setup_pagetables(unsigned long
> > boot_phys_offset, paddr_t xen_paddr)
> >  
> >      /* Change pagetables to the copy in the relocated Xen */
> >      boot_httbr = (unsigned long) xen_pgtable + phys_offset;
> > +    flush_xen_dcache_va(&boot_httbr);
> > +    flush_xen_dcache_va_range((void*)dest_va, _end - _start);
> > +    isb();
> > +    flush_xen_text_tlb();
> > +
> >      asm volatile (
> >          STORE_CP64(0, HTTBR)          /* Change translation base */
> >          "dsb;"                        /* Ensure visibility of HTTBR
> > update */
> > +        "isb;"
> >          STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
> > +        STORE_CP32(0, ICIALLU)        /* Flush I-cache */
> >          STORE_CP32(0, BPIALL)         /* Flush branch predictor */
> 
> This now looks exactly like flush_xen_text_tlb() -- shall we call it
> instead of open coding?

Yeah


> >          "dsb;"                        /* Ensure completion of TLB+BP
> > flush */
> >          "isb;"
> > @@ -256,6 +264,7 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
> >      /* Undo the temporary map */
> >      pte.bits = 0;
> >      write_pte(xen_second + second_table_offset(dest_va), pte);
> > +    isb();
> >      flush_xen_text_tlb();
> 
> Do any calls to flush_xen_text_tlb() not require a preceding isb? I'd
> have thought that by its nature an isb would be required every time --
> in which case it may as well go in the macro.

OK


> >      /* Link in the fixmap pagetable */
> > @@ -291,11 +300,14 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
> >                             >> PAGE_SHIFT);
> >      pte.pt.table = 1;
> >      write_pte(xen_second + second_linear_offset(XEN_VIRT_START), pte);
> > -    /* Have changed a mapping used for .text. Flush everything for safety. */
> > -    flush_xen_text_tlb();
> > +    /* ISB is needed because we changed the text mappings */
> > +    isb();
> 
> Why is the text TLB flush is not also required in this case?

You are right, it is required, but we wait a bit longer and delay it
until setting the WXN bit.
In fact we can also delay the isb. I'll make that change and add a
comment.


> >      /* From now on, no mapping may be both writable and executable. */
> >      WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
> > +    isb();
> > +    /* Flush everything after setting WXN bit. */
> > +    flush_xen_text_tlb();
> >  }
> >  
> >  /* MMU setup for secondary CPUS (which already have paging enabled) */
> > @@ -303,6 +315,8 @@ void __cpuinit mmu_init_secondary_cpu(void)
> >  {
> >      /* From now on, no mapping may be both writable and executable. */
> >      WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
> > +    isb();
> > +    flush_xen_text_tlb();
> >  }
> >  
> >  /* Create Xen's mappings of memory.
> 
> > diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
> > index 9511c45..1b1d556 100644
> > --- a/xen/include/asm-arm/page.h
> > +++ b/xen/include/asm-arm/page.h
> > @@ -228,27 +228,72 @@ static inline lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr)
> >      return e;
> >  }
> >  
> > -/* Write a pagetable entry */
> > +/* Write a pagetable entry.
> > + *
> > + * If the table entry is changing a text mapping, it is responsibility
> > + * of the caller to issue an ISB after write_pte.
> > + */
> >  static inline void write_pte(lpae_t *p, lpae_t pte)
> >  {
> >      asm volatile (
> > +        /* Ensure any writes have completed with the old mappings. */
> > +        "dsb;"
> >          /* Safely write the entry (STRD is atomic on CPUs that support LPAE) */
> >          "strd %0, %H0, [%1];"
> > +        "dsb;"
> >          /* Push this cacheline to the PoC so the rest of the system sees it. */
> >          STORE_CP32(1, DCCMVAC)
> > +        /* Ensure that the data flush is completed before proceeding */
> > +        "dsb;"
> >          : : "r" (pte.bits), "r" (p) : "memory");
> >  }
> >  
> > +
> > +#define MIN_CACHELINE_BYTES 32
> > +extern int cacheline_bytes;
> > +
> > +/* Function for flushing medium-sized areas.
> > + * if 'range' is large enough we might want to use model-specific
> > + * full-cache flushes. */
> > +static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
> > +{
> > +    void *end;
> > +    dsb();           /* So the CPU issues all writes to the range */ 
> > +    for ( end = p + size; p < end; p += cacheline_bytes )
> 
> Tim asked if this memory read of the cached cacheline_bytes might not be
> more expensive than hitting the (on-core) cp register every time, which
> I also suspect will be the case. Looking at Linux it seems to reread the
> register each time in v7_flush_dcache_all which suggests that reading
> the register is faster or at least preferable.

OK


> > +        WRITE_CP32((uint32_t) p, DCCMVAC);
> > +    dsb();           /* So we know the flushes happen before continuing */
> > +}
> > +
> > +
> > +/* Macro for flushing a single small item.  The predicate is always 
> > + * compile-time constant so this will compile down to 3 instructions in
> > + * the common case.  Make sure to call it with the correct type of
> > + * pointer! */
> 
> Do we need to worry about pointers to things which cross a cacheline
> boundary? i.e. a 4 byte thing at offset 30 in a 32-byte cache line.
> 
> Or do ARMs C alignment rules ensure this can never happen? (I suspect
> the answer is yes).

I think you are right, we need to take this into consideration.
I couldn't find in the ARM C specs anything about cacheline alignment,
but reading the gcc docs it seems pretty clear that cachelines are
expected to be aligned to the cacheline size.
I think we should change the macro into:

#define flush_xen_dcache_va(p) do {                       \
    int cacheline_bytes  = READ_CP32(CCSIDR);             \
    typeof(p) _p = (p);                                   \
    if ( ((unsigned long)_p & ~(cacheline_bytes - 1)) !=             \
        (((unsigned long)_p + (sizeof *_p)) & ~(cacheline_bytes - 1)) ) \
        flush_xen_dcache_va_range(_p, sizeof *_p);        \
    else                                                  \
        asm volatile (                                    \
            "dsb;"   /* Finish all earlier writes */      \
            STORE_CP32(0, DCCMVAC)                        \
            "dsb;"   /* Finish flush before continuing */ \
            : : "r" (_p), "m" (*_p));                     \
} while (0)


> > +#define flush_xen_dcache_va(p) do {                       \
> > +    typeof(p) _p = (p);                                   \
> > +    if ( (sizeof *_p) > MIN_CACHELINE_BYTES )             \
> > +        flush_xen_dcache_va_range(_p, sizeof *_p);        \
> > +    else                                                  \
> > +        asm volatile (                                    \
> > +            "dsb;"   /* Finish all earlier writes */      \
> > +            STORE_CP32(0, DCCMVAC)                        \
> > +            "dsb;"   /* Finish flush before continuing */ \
> > +            : : "r" (_p), "m" (*_p));                     \
> > +} while (0)
> > +
> > +
> >  /*
> >   * Flush all hypervisor mappings from the TLB and branch predictor.
> > - * This is needed after changing Xen code mappings. 
> > + * This is needed after changing Xen code mappings.
> > + *
> > + * The caller needs to issue the necessary barriers before this functions.
> 
> Worth commenting on what those are and when they are needed?

Given that we are moving isb inside flush_xen_text_tlb, it is only DSB
and D-cache flushes. I'll write that down.


> >   */
> >  static inline void flush_xen_text_tlb(void)
> >  {
> >      register unsigned long r0 asm ("r0");
> >      asm volatile (
> > -        "dsb;"                        /* Ensure visibility of PTE writes */
> >          STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
> > +        STORE_CP32(0, ICIALLU)        /* Flush I-cache */
> >          STORE_CP32(0, BPIALL)         /* Flush branch predictor */
> >          "dsb;"                        /* Ensure completion of TLB+BP flush */
> >          "isb;"
> 
> 
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:37:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:37:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNyw-0006OH-C8; Fri, 16 Nov 2012 15:37:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TZNyu-0006O8-Q9
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 15:37:25 +0000
Received: from [85.158.138.51:3030] by server-3.bemta-3.messagelabs.com id
	7B/21-31566-3BD56A05; Fri, 16 Nov 2012 15:37:23 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1353080241!10600136!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODY5MjY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6881 invoked from network); 16 Nov 2012 15:37:23 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:37:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="214757692"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:37:10 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 10:37:10 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TZNyf-0007ER-Sg;
	Fri, 16 Nov 2012 15:37:09 +0000
Date: Fri, 16 Nov 2012 15:36:34 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1352973753.3499.81.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211151529540.28049@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
	<1352821336-25837-6-git-send-email-stefano.stabellini@eu.citrix.com>
	<1352973753.3499.81.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 6/7] xen/arm: flush D-cache and I-cache when
 appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 15 Nov 2012, Ian Campbell wrote:
> On Tue, 2012-11-13 at 15:42 +0000, Stefano Stabellini wrote:
> > - invalidate tlb after setting WXN;
> > - flush D-cache and I-cache after relocation;
> > - flush D-cache after writing to smp_up_cpu;
> > - flush TLB before changing HTTBR;
> > - flush I-cache after changing HTTBR;
> > - flush I-cache and branch predictor after writing Xen text ptes.
> 
> Since the reasoning is pretty subtle I wonder if you could say a few
> words in each case about why these flushes are necessary? Either here on
> in the comments in the code.

I'll remove the TLB flush before changing HTTBR because it isn't
actually needed.
I'll write comments in the code regarding the D-cache flush after
changing smp_up_cpu. I think that the others are self explanatory (they
are a consequence of the fact that we are modifying the code we are
running on or the mapping of it).


> > @@ -244,10 +245,17 @@ void __init setup_pagetables(unsigned long
> > boot_phys_offset, paddr_t xen_paddr)
> >  
> >      /* Change pagetables to the copy in the relocated Xen */
> >      boot_httbr = (unsigned long) xen_pgtable + phys_offset;
> > +    flush_xen_dcache_va(&boot_httbr);
> > +    flush_xen_dcache_va_range((void*)dest_va, _end - _start);
> > +    isb();
> > +    flush_xen_text_tlb();
> > +
> >      asm volatile (
> >          STORE_CP64(0, HTTBR)          /* Change translation base */
> >          "dsb;"                        /* Ensure visibility of HTTBR
> > update */
> > +        "isb;"
> >          STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
> > +        STORE_CP32(0, ICIALLU)        /* Flush I-cache */
> >          STORE_CP32(0, BPIALL)         /* Flush branch predictor */
> 
> This now looks exactly like flush_xen_text_tlb() -- shall we call it
> instead of open coding?

Yeah


> >          "dsb;"                        /* Ensure completion of TLB+BP
> > flush */
> >          "isb;"
> > @@ -256,6 +264,7 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
> >      /* Undo the temporary map */
> >      pte.bits = 0;
> >      write_pte(xen_second + second_table_offset(dest_va), pte);
> > +    isb();
> >      flush_xen_text_tlb();
> 
> Do any calls to flush_xen_text_tlb() not require a preceding isb? I'd
> have thought that by its nature an isb would be required every time --
> in which case it may as well go in the macro.

OK


> >      /* Link in the fixmap pagetable */
> > @@ -291,11 +300,14 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
> >                             >> PAGE_SHIFT);
> >      pte.pt.table = 1;
> >      write_pte(xen_second + second_linear_offset(XEN_VIRT_START), pte);
> > -    /* Have changed a mapping used for .text. Flush everything for safety. */
> > -    flush_xen_text_tlb();
> > +    /* ISB is needed because we changed the text mappings */
> > +    isb();
> 
> Why is the text TLB flush is not also required in this case?

You are right, it is required, but we wait a bit longer and delay it
until setting the WXN bit.
In fact we can also delay the isb. I'll make that change and add a
comment.


> >      /* From now on, no mapping may be both writable and executable. */
> >      WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
> > +    isb();
> > +    /* Flush everything after setting WXN bit. */
> > +    flush_xen_text_tlb();
> >  }
> >  
> >  /* MMU setup for secondary CPUS (which already have paging enabled) */
> > @@ -303,6 +315,8 @@ void __cpuinit mmu_init_secondary_cpu(void)
> >  {
> >      /* From now on, no mapping may be both writable and executable. */
> >      WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
> > +    isb();
> > +    flush_xen_text_tlb();
> >  }
> >  
> >  /* Create Xen's mappings of memory.
> 
> > diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
> > index 9511c45..1b1d556 100644
> > --- a/xen/include/asm-arm/page.h
> > +++ b/xen/include/asm-arm/page.h
> > @@ -228,27 +228,72 @@ static inline lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr)
> >      return e;
> >  }
> >  
> > -/* Write a pagetable entry */
> > +/* Write a pagetable entry.
> > + *
> > + * If the table entry is changing a text mapping, it is responsibility
> > + * of the caller to issue an ISB after write_pte.
> > + */
> >  static inline void write_pte(lpae_t *p, lpae_t pte)
> >  {
> >      asm volatile (
> > +        /* Ensure any writes have completed with the old mappings. */
> > +        "dsb;"
> >          /* Safely write the entry (STRD is atomic on CPUs that support LPAE) */
> >          "strd %0, %H0, [%1];"
> > +        "dsb;"
> >          /* Push this cacheline to the PoC so the rest of the system sees it. */
> >          STORE_CP32(1, DCCMVAC)
> > +        /* Ensure that the data flush is completed before proceeding */
> > +        "dsb;"
> >          : : "r" (pte.bits), "r" (p) : "memory");
> >  }
> >  
> > +
> > +#define MIN_CACHELINE_BYTES 32
> > +extern int cacheline_bytes;
> > +
> > +/* Function for flushing medium-sized areas.
> > + * if 'range' is large enough we might want to use model-specific
> > + * full-cache flushes. */
> > +static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
> > +{
> > +    void *end;
> > +    dsb();           /* So the CPU issues all writes to the range */ 
> > +    for ( end = p + size; p < end; p += cacheline_bytes )
> 
> Tim asked if this memory read of the cached cacheline_bytes might not be
> more expensive than hitting the (on-core) cp register every time, which
> I also suspect will be the case. Looking at Linux it seems to reread the
> register each time in v7_flush_dcache_all which suggests that reading
> the register is faster or at least preferable.

OK


> > +        WRITE_CP32((uint32_t) p, DCCMVAC);
> > +    dsb();           /* So we know the flushes happen before continuing */
> > +}
> > +
> > +
> > +/* Macro for flushing a single small item.  The predicate is always 
> > + * compile-time constant so this will compile down to 3 instructions in
> > + * the common case.  Make sure to call it with the correct type of
> > + * pointer! */
> 
> Do we need to worry about pointers to things which cross a cacheline
> boundary? i.e. a 4 byte thing at offset 30 in a 32-byte cache line.
> 
> Or do ARMs C alignment rules ensure this can never happen? (I suspect
> the answer is yes).

I think you are right, we need to take this into consideration.
I couldn't find in the ARM C specs anything about cacheline alignment,
but reading the gcc docs it seems pretty clear that cachelines are
expected to be aligned to the cacheline size.
I think we should change the macro into:

#define flush_xen_dcache_va(p) do {                       \
    int cacheline_bytes  = READ_CP32(CCSIDR);             \
    typeof(p) _p = (p);                                   \
    if ( ((unsigned long)_p & ~(cacheline_bytes - 1)) !=             \
        (((unsigned long)_p + (sizeof *_p)) & ~(cacheline_bytes - 1)) ) \
        flush_xen_dcache_va_range(_p, sizeof *_p);        \
    else                                                  \
        asm volatile (                                    \
            "dsb;"   /* Finish all earlier writes */      \
            STORE_CP32(0, DCCMVAC)                        \
            "dsb;"   /* Finish flush before continuing */ \
            : : "r" (_p), "m" (*_p));                     \
} while (0)


> > +#define flush_xen_dcache_va(p) do {                       \
> > +    typeof(p) _p = (p);                                   \
> > +    if ( (sizeof *_p) > MIN_CACHELINE_BYTES )             \
> > +        flush_xen_dcache_va_range(_p, sizeof *_p);        \
> > +    else                                                  \
> > +        asm volatile (                                    \
> > +            "dsb;"   /* Finish all earlier writes */      \
> > +            STORE_CP32(0, DCCMVAC)                        \
> > +            "dsb;"   /* Finish flush before continuing */ \
> > +            : : "r" (_p), "m" (*_p));                     \
> > +} while (0)
> > +
> > +
> >  /*
> >   * Flush all hypervisor mappings from the TLB and branch predictor.
> > - * This is needed after changing Xen code mappings. 
> > + * This is needed after changing Xen code mappings.
> > + *
> > + * The caller needs to issue the necessary barriers before this functions.
> 
> Worth commenting on what those are and when they are needed?

Given that we are moving isb inside flush_xen_text_tlb, it is only DSB
and D-cache flushes. I'll write that down.


> >   */
> >  static inline void flush_xen_text_tlb(void)
> >  {
> >      register unsigned long r0 asm ("r0");
> >      asm volatile (
> > -        "dsb;"                        /* Ensure visibility of PTE writes */
> >          STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
> > +        STORE_CP32(0, ICIALLU)        /* Flush I-cache */
> >          STORE_CP32(0, BPIALL)         /* Flush branch predictor */
> >          "dsb;"                        /* Ensure completion of TLB+BP flush */
> >          "isb;"
> 
> 
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:38:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:38:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNzO-0006S3-Q4; Fri, 16 Nov 2012 15:37:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andres.lagarcavilla@gmail.com>) id 1TZNzN-0006Ri-7n
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:37:53 +0000
Received: from [85.158.139.211:30996] by server-10.bemta-5.messagelabs.com id
	B8/A1-09257-0DD56A05; Fri, 16 Nov 2012 15:37:52 +0000
X-Env-Sender: andres.lagarcavilla@gmail.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1353080262!20462181!1
X-Originating-IP: [209.85.210.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21263 invoked from network); 16 Nov 2012 15:37:45 -0000
Received: from mail-ia0-f173.google.com (HELO mail-ia0-f173.google.com)
	(209.85.210.173)
	by server-2.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:37:45 -0000
Received: by mail-ia0-f173.google.com with SMTP id w21so648858iac.32
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 07:37:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer;
	bh=6SZWD5+cNa7lTJ9mGyuh4nHNw4hSsyCCTiOrSdPxLKo=;
	b=B16sIgBHZ8R0VeVdt27KlBqSj+Px6CLKeVSGd70tC39NKS2bi5RjvY5H77r/URTUnr
	48npAS9VC+NwQsT0pm/5tk62tXmMmRMDf61GW53QaDXJl8DitZqtwf7JKIe31YDKk6tr
	5akpdKDpCte/c48xFQy5oOjJJ/adm7k7RrT2EL/FREl/sKbRh3pKxc/laPrvwF7Fj0CH
	oFVAt6NyX9wwmqK544Jty1hV/u6JjvDb94vswtXmbAv+8+bmjtAwjBAxuTidvPcdiqyW
	qv+Si+PPxs7TK8A/1SkRbE59ZY15+N4w1l04GZ9+RWz8LFh7S2moTU+7Pwcp+extvoYt
	Dgsw==
Received: by 10.43.60.212 with SMTP id wt20mr4053651icb.51.1353080262221;
	Fri, 16 Nov 2012 07:37:42 -0800 (PST)
Received: from [192.168.15.1] ([206.223.182.18])
	by mx.google.com with ESMTPS id eo7sm563323igc.12.2012.11.16.07.37.39
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 16 Nov 2012 07:37:40 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Andres Lagar-Cavilla <andres.lagarcavilla@gmail.com>
In-Reply-To: <mailman.16724.1353079390.1399.xen-devel@lists.xen.org>
Date: Fri, 16 Nov 2012 10:37:40 -0500
Message-Id: <840353AF-6BD3-4BAB-994C-7F784BF8227E@gmail.com>
References: <mailman.16724.1353079390.1399.xen-devel@lists.xen.org>
To: xen-devel@lists.xen.org
X-Mailer: Apple Mail (2.1499)
Cc: Mats Petersson <mats.petersson@citrix.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH] Correctly return success from
	IOCTL_PRIVCMD_MMAPBATCH
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> This is a regression introduced by ceb90fa0 (xen/privcmd: add
> PRIVCMD_MMAPBATCH_V2 ioctl).  It broke xentrace as it used
> xc_map_foreign() instead of xc_map_foreign_bulk().
> 
> Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
> that it broke. The return value is set early on to -EINVAL, and if all
> goes well, the "set top bits of the MFN's" never gets called, so the
> return value is still EINVAL when the function gets to the end, causing
> the caller to think it went wrong (which it didn't!)
> 
> Signed off by: Mats Petersson <mats.petersson@citrix.com>
> Acked-by: David Vrabel <david.vrabel@citrix.com>

Uggh. What a complicated API. Good catch, thanks.

Now, isn't this a simpler fix? (and by only changing ret to non-zero in error paths, less prone to allow for inadvertent errors in the future)

If this is preferred I can prepare a proper patch.
Andres

diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index ef63895..4a6bcb2 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -361,13 +361,13 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
        down_write(&mm->mmap_sem);
 
        vma = find_vma(mm, m.addr);
-       ret = -EINVAL;
        if (!vma ||
            vma->vm_ops != &privcmd_vm_ops ||
            (m.addr != vma->vm_start) ||
            ((m.addr + (nr_pages << PAGE_SHIFT)) != vma->vm_end) ||
            !privcmd_enforce_singleshot_mapping(vma)) {
                up_write(&mm->mmap_sem);
+        ret = -EINVAL;
                goto out;
        }
 

> 
> ---
> drivers/xen/privcmd.c |   16 ++++++++++------
> 1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
> index 8adb9cc..24aec2f 100644
> --- a/drivers/xen/privcmd.c
> +++ b/drivers/xen/privcmd.c
> @@ -383,12 +383,16 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
> 
> 	up_write(&mm->mmap_sem);
> 
> -	if (state.global_error && (version == 1)) {
> -		/* Write back errors in second pass. */
> -		state.user_mfn = (xen_pfn_t *)m.arr;
> -		state.err      = err_array;
> -		ret = traverse_pages(m.num, sizeof(xen_pfn_t),
> -				     &pagelist, mmap_return_errors_v1, &state);
> +	if (version == 1) {
> +		if (state.global_error) {
> +			/* Write back errors in second pass. */
> +			state.user_mfn = (xen_pfn_t *)m.arr;
> +			state.err      = err_array;
> +			ret = traverse_pages(m.num, sizeof(xen_pfn_t),
> +					     &pagelist, mmap_return_errors_v1, &state);
> +		} else
> +			ret = 0;
> +
> 	} else if (version == 2) {
> 		ret = __copy_to_user(m.err, err_array, m.num * sizeof(int));
> 		if (ret)
> -- 
> 1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:38:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:38:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZNzO-0006S3-Q4; Fri, 16 Nov 2012 15:37:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andres.lagarcavilla@gmail.com>) id 1TZNzN-0006Ri-7n
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:37:53 +0000
Received: from [85.158.139.211:30996] by server-10.bemta-5.messagelabs.com id
	B8/A1-09257-0DD56A05; Fri, 16 Nov 2012 15:37:52 +0000
X-Env-Sender: andres.lagarcavilla@gmail.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1353080262!20462181!1
X-Originating-IP: [209.85.210.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21263 invoked from network); 16 Nov 2012 15:37:45 -0000
Received: from mail-ia0-f173.google.com (HELO mail-ia0-f173.google.com)
	(209.85.210.173)
	by server-2.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:37:45 -0000
Received: by mail-ia0-f173.google.com with SMTP id w21so648858iac.32
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 07:37:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer;
	bh=6SZWD5+cNa7lTJ9mGyuh4nHNw4hSsyCCTiOrSdPxLKo=;
	b=B16sIgBHZ8R0VeVdt27KlBqSj+Px6CLKeVSGd70tC39NKS2bi5RjvY5H77r/URTUnr
	48npAS9VC+NwQsT0pm/5tk62tXmMmRMDf61GW53QaDXJl8DitZqtwf7JKIe31YDKk6tr
	5akpdKDpCte/c48xFQy5oOjJJ/adm7k7RrT2EL/FREl/sKbRh3pKxc/laPrvwF7Fj0CH
	oFVAt6NyX9wwmqK544Jty1hV/u6JjvDb94vswtXmbAv+8+bmjtAwjBAxuTidvPcdiqyW
	qv+Si+PPxs7TK8A/1SkRbE59ZY15+N4w1l04GZ9+RWz8LFh7S2moTU+7Pwcp+extvoYt
	Dgsw==
Received: by 10.43.60.212 with SMTP id wt20mr4053651icb.51.1353080262221;
	Fri, 16 Nov 2012 07:37:42 -0800 (PST)
Received: from [192.168.15.1] ([206.223.182.18])
	by mx.google.com with ESMTPS id eo7sm563323igc.12.2012.11.16.07.37.39
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 16 Nov 2012 07:37:40 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Andres Lagar-Cavilla <andres.lagarcavilla@gmail.com>
In-Reply-To: <mailman.16724.1353079390.1399.xen-devel@lists.xen.org>
Date: Fri, 16 Nov 2012 10:37:40 -0500
Message-Id: <840353AF-6BD3-4BAB-994C-7F784BF8227E@gmail.com>
References: <mailman.16724.1353079390.1399.xen-devel@lists.xen.org>
To: xen-devel@lists.xen.org
X-Mailer: Apple Mail (2.1499)
Cc: Mats Petersson <mats.petersson@citrix.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH] Correctly return success from
	IOCTL_PRIVCMD_MMAPBATCH
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> This is a regression introduced by ceb90fa0 (xen/privcmd: add
> PRIVCMD_MMAPBATCH_V2 ioctl).  It broke xentrace as it used
> xc_map_foreign() instead of xc_map_foreign_bulk().
> 
> Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
> that it broke. The return value is set early on to -EINVAL, and if all
> goes well, the "set top bits of the MFN's" never gets called, so the
> return value is still EINVAL when the function gets to the end, causing
> the caller to think it went wrong (which it didn't!)
> 
> Signed off by: Mats Petersson <mats.petersson@citrix.com>
> Acked-by: David Vrabel <david.vrabel@citrix.com>

Uggh. What a complicated API. Good catch, thanks.

Now, isn't this a simpler fix? (and by only changing ret to non-zero in error paths, less prone to allow for inadvertent errors in the future)

If this is preferred I can prepare a proper patch.
Andres

diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index ef63895..4a6bcb2 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -361,13 +361,13 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
        down_write(&mm->mmap_sem);
 
        vma = find_vma(mm, m.addr);
-       ret = -EINVAL;
        if (!vma ||
            vma->vm_ops != &privcmd_vm_ops ||
            (m.addr != vma->vm_start) ||
            ((m.addr + (nr_pages << PAGE_SHIFT)) != vma->vm_end) ||
            !privcmd_enforce_singleshot_mapping(vma)) {
                up_write(&mm->mmap_sem);
+        ret = -EINVAL;
                goto out;
        }
 

> 
> ---
> drivers/xen/privcmd.c |   16 ++++++++++------
> 1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
> index 8adb9cc..24aec2f 100644
> --- a/drivers/xen/privcmd.c
> +++ b/drivers/xen/privcmd.c
> @@ -383,12 +383,16 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
> 
> 	up_write(&mm->mmap_sem);
> 
> -	if (state.global_error && (version == 1)) {
> -		/* Write back errors in second pass. */
> -		state.user_mfn = (xen_pfn_t *)m.arr;
> -		state.err      = err_array;
> -		ret = traverse_pages(m.num, sizeof(xen_pfn_t),
> -				     &pagelist, mmap_return_errors_v1, &state);
> +	if (version == 1) {
> +		if (state.global_error) {
> +			/* Write back errors in second pass. */
> +			state.user_mfn = (xen_pfn_t *)m.arr;
> +			state.err      = err_array;
> +			ret = traverse_pages(m.num, sizeof(xen_pfn_t),
> +					     &pagelist, mmap_return_errors_v1, &state);
> +		} else
> +			ret = 0;
> +
> 	} else if (version == 2) {
> 		ret = __copy_to_user(m.err, err_array, m.num * sizeof(int));
> 		if (ret)
> -- 
> 1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:43:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:43:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZO52-0006tB-Oc; Fri, 16 Nov 2012 15:43:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TZO51-0006t6-EZ
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 15:43:43 +0000
Received: from [85.158.143.99:53117] by server-1.bemta-4.messagelabs.com id
	3E/E6-27934-E2F56A05; Fri, 16 Nov 2012 15:43:42 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1353080620!19431583!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17167 invoked from network); 16 Nov 2012 15:43:41 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:43:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="44857378"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:43:40 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 10:43:40 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TZO4s-0007Km-Im;
	Fri, 16 Nov 2012 15:43:34 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <xen-devel@lists.xensource.com>
Date: Fri, 16 Nov 2012 15:42:58 +0000
Message-ID: <1353080578-1487-1-git-send-email-stefano.stabellini@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
MIME-Version: 1.0
Cc: tim@xen.org, Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH v3] xen/arm: flush D-cache and I-cache when
	appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

- invalidate tlb after setting WXN
- flush D-cache and I-cache after relocation;
- invalidate D-cache after writing to smp_up_cpu;
- flush I-cache after changing HTTBR;
- flush I-cache and branch predictor after writing Xen text ptes.


Changes in v3:
- remove flush before HTTBR change;
- added more comments through the code;
- remove asm volatile to change HTTBR and replace it with C functions
calls and macros;
- add an isb at the beginning of flush_xen_text_tlb;
- remove isb after write_pte and before setting WXN;
- change flush_xen_dcache_va to take into account pointers that cross a
cacheline boundary.

Changes in v2:
- fix a wrong comment;
- add a comment to described why we need a DSB at the beginning of
write_pte;
- do not issue ISB within write_pte, call isb() afterwards whenever
appropriate;
- issue DSB after DCCMVAC in write_pte to make sure that the data flush
is completed before proceeding;
- make flush_xen_dcache_va take a void* as argument;
- introduce flush_xen_dcache_va_range.


Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/head.S        |    6 +++++
 xen/arch/arm/mm.c          |   21 +++++++++--------
 xen/arch/arm/smpboot.c     |    4 +++
 xen/include/asm-arm/page.h |   53 +++++++++++++++++++++++++++++++++++++++++--
 4 files changed, 71 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 3fe6412..25c4cfe 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -278,8 +278,12 @@ paging:
 	ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
 	add   r4, r4, r10            /* PA of it */
 	ldrd  r4, r5, [r4]           /* Actual value */
+	dsb
 	mcrr  CP64(r4, r5, HTTBR)
+	dsb
+	isb
 	mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
+	mcr   CP32(r0, ICIALLU)      /* Flush I-cache */
 	mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
 	dsb                          /* Ensure completion of TLB+BP flush */
 	isb
@@ -292,6 +296,8 @@ paging:
 	teq   r2, #0
 	bne   1b
 	dsb
+	mcr   CP32(r0, DCCMVAC)      /* flush D-Cache */
+	dsb
 
 	/* Here, the non-boot CPUs must wait again -- they're now running on
 	 * the boot CPU's pagetables so it's safe for the boot CPU to
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index d0cd2c9..1680f4d 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -244,14 +244,13 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
 
     /* Change pagetables to the copy in the relocated Xen */
     boot_httbr = (unsigned long) xen_pgtable + phys_offset;
-    asm volatile (
-        STORE_CP64(0, HTTBR)          /* Change translation base */
-        "dsb;"                        /* Ensure visibility of HTTBR update */
-        STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
-        STORE_CP32(0, BPIALL)         /* Flush branch predictor */
-        "dsb;"                        /* Ensure completion of TLB+BP flush */
-        "isb;"
-        : : "r" (boot_httbr) : "memory");
+    flush_xen_dcache_va(&boot_httbr);
+    flush_xen_dcache_va_range((void*)dest_va, _end - _start);
+    flush_xen_text_tlb();
+
+    WRITE_CP64(boot_httbr, HTTBR); /* Change translation base */
+    dsb();                         /* Ensure visibility of HTTBR update */
+    flush_xen_text_tlb();
 
     /* Undo the temporary map */
     pte.bits = 0;
@@ -291,11 +290,12 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
                            >> PAGE_SHIFT);
     pte.pt.table = 1;
     write_pte(xen_second + second_linear_offset(XEN_VIRT_START), pte);
-    /* Have changed a mapping used for .text. Flush everything for safety. */
-    flush_xen_text_tlb();
+    /* TLBFLUSH and ISB would be needed here, but wait until we set WXN */
 
     /* From now on, no mapping may be both writable and executable. */
     WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
+    /* Flush everything after setting WXN bit. */
+    flush_xen_text_tlb();
 }
 
 /* MMU setup for secondary CPUS (which already have paging enabled) */
@@ -303,6 +303,7 @@ void __cpuinit mmu_init_secondary_cpu(void)
 {
     /* From now on, no mapping may be both writable and executable. */
     WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
+    flush_xen_text_tlb();
 }
 
 /* Create Xen's mappings of memory.
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index c0750c0..1b52e22 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -105,6 +105,7 @@ make_cpus_ready(unsigned int max_cpus, unsigned long boot_phys_offset)
         /* Tell the next CPU to get ready */
         /* TODO: handle boards where CPUIDs are not contiguous */
         *gate = i;
+        flush_xen_dcache_va(gate);
         asm volatile("dsb; isb; sev");
         /* And wait for it to respond */
         while ( ready_cpus < i )
@@ -201,6 +202,9 @@ int __cpu_up(unsigned int cpu)
     /* Unblock the CPU.  It should be waiting in the loop in head.S
      * for an event to arrive when smp_up_cpu matches its cpuid. */
     smp_up_cpu = cpu;
+    /* we need to make sure that the change to smp_up_cpu is visible to
+     * secondary cpus with D-cache off */
+    flush_xen_dcache_va(&smp_up_cpu);
     asm volatile("dsb; isb; sev");
 
     while ( !cpu_online(cpu) )
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 9511c45..3e77281 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -228,27 +228,74 @@ static inline lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr)
     return e;
 }
 
-/* Write a pagetable entry */
+/* Write a pagetable entry.
+ *
+ * If the table entry is changing a text mapping, it is responsibility
+ * of the caller to issue an ISB after write_pte.
+ */
 static inline void write_pte(lpae_t *p, lpae_t pte)
 {
     asm volatile (
+        /* Ensure any writes have completed with the old mappings. */
+        "dsb;"
         /* Safely write the entry (STRD is atomic on CPUs that support LPAE) */
         "strd %0, %H0, [%1];"
+        "dsb;"
         /* Push this cacheline to the PoC so the rest of the system sees it. */
         STORE_CP32(1, DCCMVAC)
+        /* Ensure that the data flush is completed before proceeding */
+        "dsb;"
         : : "r" (pte.bits), "r" (p) : "memory");
 }
 
+
+/* Function for flushing medium-sized areas.
+ * if 'range' is large enough we might want to use model-specific
+ * full-cache flushes. */
+static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
+{
+    int cacheline_bytes  = READ_CP32(CCSIDR);
+    void *end;
+    dsb();           /* So the CPU issues all writes to the range */ 
+    for ( end = p + size; p < end; p += cacheline_bytes )
+        WRITE_CP32((uint32_t) p, DCCMVAC);
+    dsb();           /* So we know the flushes happen before continuing */
+}
+
+
+/* Macro for flushing a single small item.  The predicate is always 
+ * compile-time constant so this will compile down to 3 instructions in
+ * the common case.  Make sure to call it with the correct type of
+ * pointer! */
+#define flush_xen_dcache_va(p) do {                                     \
+    int cacheline_bytes  = READ_CP32(CCSIDR);                           \
+    typeof(p) _p = (p);                                                 \
+    if ( ((unsigned long)_p & ~(cacheline_bytes - 1)) !=                \
+        (((unsigned long)_p + (sizeof *_p)) & ~(cacheline_bytes - 1)) ) \
+        flush_xen_dcache_va_range(_p, sizeof *_p);                      \
+    else                                                                \
+        asm volatile (                                                  \
+            "dsb;"   /* Finish all earlier writes */                    \
+            STORE_CP32(0, DCCMVAC)                                      \
+            "dsb;"   /* Finish flush before continuing */               \
+            : : "r" (_p), "m" (*_p));                                   \
+} while (0)
+
+
 /*
  * Flush all hypervisor mappings from the TLB and branch predictor.
- * This is needed after changing Xen code mappings. 
+ * This is needed after changing Xen code mappings.
+ *
+ * The caller needs to issue the necessary DSB and D-cache flushes
+ * before calling flush_xen_text_tlb.
  */
 static inline void flush_xen_text_tlb(void)
 {
     register unsigned long r0 asm ("r0");
     asm volatile (
-        "dsb;"                        /* Ensure visibility of PTE writes */
+        "isb;"                        /* Ensure synchronization with previous changes to text */
         STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
+        STORE_CP32(0, ICIALLU)        /* Flush I-cache */
         STORE_CP32(0, BPIALL)         /* Flush branch predictor */
         "dsb;"                        /* Ensure completion of TLB+BP flush */
         "isb;"
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:43:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:43:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZO52-0006tB-Oc; Fri, 16 Nov 2012 15:43:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TZO51-0006t6-EZ
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 15:43:43 +0000
Received: from [85.158.143.99:53117] by server-1.bemta-4.messagelabs.com id
	3E/E6-27934-E2F56A05; Fri, 16 Nov 2012 15:43:42 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1353080620!19431583!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17167 invoked from network); 16 Nov 2012 15:43:41 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:43:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="44857378"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:43:40 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 10:43:40 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TZO4s-0007Km-Im;
	Fri, 16 Nov 2012 15:43:34 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <xen-devel@lists.xensource.com>
Date: Fri, 16 Nov 2012 15:42:58 +0000
Message-ID: <1353080578-1487-1-git-send-email-stefano.stabellini@eu.citrix.com>
X-Mailer: git-send-email 1.7.9.5
MIME-Version: 1.0
Cc: tim@xen.org, Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH v3] xen/arm: flush D-cache and I-cache when
	appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

- invalidate tlb after setting WXN
- flush D-cache and I-cache after relocation;
- invalidate D-cache after writing to smp_up_cpu;
- flush I-cache after changing HTTBR;
- flush I-cache and branch predictor after writing Xen text ptes.


Changes in v3:
- remove flush before HTTBR change;
- added more comments through the code;
- remove asm volatile to change HTTBR and replace it with C functions
calls and macros;
- add an isb at the beginning of flush_xen_text_tlb;
- remove isb after write_pte and before setting WXN;
- change flush_xen_dcache_va to take into account pointers that cross a
cacheline boundary.

Changes in v2:
- fix a wrong comment;
- add a comment to described why we need a DSB at the beginning of
write_pte;
- do not issue ISB within write_pte, call isb() afterwards whenever
appropriate;
- issue DSB after DCCMVAC in write_pte to make sure that the data flush
is completed before proceeding;
- make flush_xen_dcache_va take a void* as argument;
- introduce flush_xen_dcache_va_range.


Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/head.S        |    6 +++++
 xen/arch/arm/mm.c          |   21 +++++++++--------
 xen/arch/arm/smpboot.c     |    4 +++
 xen/include/asm-arm/page.h |   53 +++++++++++++++++++++++++++++++++++++++++--
 4 files changed, 71 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 3fe6412..25c4cfe 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -278,8 +278,12 @@ paging:
 	ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
 	add   r4, r4, r10            /* PA of it */
 	ldrd  r4, r5, [r4]           /* Actual value */
+	dsb
 	mcrr  CP64(r4, r5, HTTBR)
+	dsb
+	isb
 	mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
+	mcr   CP32(r0, ICIALLU)      /* Flush I-cache */
 	mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
 	dsb                          /* Ensure completion of TLB+BP flush */
 	isb
@@ -292,6 +296,8 @@ paging:
 	teq   r2, #0
 	bne   1b
 	dsb
+	mcr   CP32(r0, DCCMVAC)      /* flush D-Cache */
+	dsb
 
 	/* Here, the non-boot CPUs must wait again -- they're now running on
 	 * the boot CPU's pagetables so it's safe for the boot CPU to
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index d0cd2c9..1680f4d 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -244,14 +244,13 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
 
     /* Change pagetables to the copy in the relocated Xen */
     boot_httbr = (unsigned long) xen_pgtable + phys_offset;
-    asm volatile (
-        STORE_CP64(0, HTTBR)          /* Change translation base */
-        "dsb;"                        /* Ensure visibility of HTTBR update */
-        STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
-        STORE_CP32(0, BPIALL)         /* Flush branch predictor */
-        "dsb;"                        /* Ensure completion of TLB+BP flush */
-        "isb;"
-        : : "r" (boot_httbr) : "memory");
+    flush_xen_dcache_va(&boot_httbr);
+    flush_xen_dcache_va_range((void*)dest_va, _end - _start);
+    flush_xen_text_tlb();
+
+    WRITE_CP64(boot_httbr, HTTBR); /* Change translation base */
+    dsb();                         /* Ensure visibility of HTTBR update */
+    flush_xen_text_tlb();
 
     /* Undo the temporary map */
     pte.bits = 0;
@@ -291,11 +290,12 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
                            >> PAGE_SHIFT);
     pte.pt.table = 1;
     write_pte(xen_second + second_linear_offset(XEN_VIRT_START), pte);
-    /* Have changed a mapping used for .text. Flush everything for safety. */
-    flush_xen_text_tlb();
+    /* TLBFLUSH and ISB would be needed here, but wait until we set WXN */
 
     /* From now on, no mapping may be both writable and executable. */
     WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
+    /* Flush everything after setting WXN bit. */
+    flush_xen_text_tlb();
 }
 
 /* MMU setup for secondary CPUS (which already have paging enabled) */
@@ -303,6 +303,7 @@ void __cpuinit mmu_init_secondary_cpu(void)
 {
     /* From now on, no mapping may be both writable and executable. */
     WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
+    flush_xen_text_tlb();
 }
 
 /* Create Xen's mappings of memory.
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index c0750c0..1b52e22 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -105,6 +105,7 @@ make_cpus_ready(unsigned int max_cpus, unsigned long boot_phys_offset)
         /* Tell the next CPU to get ready */
         /* TODO: handle boards where CPUIDs are not contiguous */
         *gate = i;
+        flush_xen_dcache_va(gate);
         asm volatile("dsb; isb; sev");
         /* And wait for it to respond */
         while ( ready_cpus < i )
@@ -201,6 +202,9 @@ int __cpu_up(unsigned int cpu)
     /* Unblock the CPU.  It should be waiting in the loop in head.S
      * for an event to arrive when smp_up_cpu matches its cpuid. */
     smp_up_cpu = cpu;
+    /* we need to make sure that the change to smp_up_cpu is visible to
+     * secondary cpus with D-cache off */
+    flush_xen_dcache_va(&smp_up_cpu);
     asm volatile("dsb; isb; sev");
 
     while ( !cpu_online(cpu) )
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 9511c45..3e77281 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -228,27 +228,74 @@ static inline lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr)
     return e;
 }
 
-/* Write a pagetable entry */
+/* Write a pagetable entry.
+ *
+ * If the table entry is changing a text mapping, it is responsibility
+ * of the caller to issue an ISB after write_pte.
+ */
 static inline void write_pte(lpae_t *p, lpae_t pte)
 {
     asm volatile (
+        /* Ensure any writes have completed with the old mappings. */
+        "dsb;"
         /* Safely write the entry (STRD is atomic on CPUs that support LPAE) */
         "strd %0, %H0, [%1];"
+        "dsb;"
         /* Push this cacheline to the PoC so the rest of the system sees it. */
         STORE_CP32(1, DCCMVAC)
+        /* Ensure that the data flush is completed before proceeding */
+        "dsb;"
         : : "r" (pte.bits), "r" (p) : "memory");
 }
 
+
+/* Function for flushing medium-sized areas.
+ * if 'range' is large enough we might want to use model-specific
+ * full-cache flushes. */
+static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
+{
+    int cacheline_bytes  = READ_CP32(CCSIDR);
+    void *end;
+    dsb();           /* So the CPU issues all writes to the range */ 
+    for ( end = p + size; p < end; p += cacheline_bytes )
+        WRITE_CP32((uint32_t) p, DCCMVAC);
+    dsb();           /* So we know the flushes happen before continuing */
+}
+
+
+/* Macro for flushing a single small item.  The predicate is always 
+ * compile-time constant so this will compile down to 3 instructions in
+ * the common case.  Make sure to call it with the correct type of
+ * pointer! */
+#define flush_xen_dcache_va(p) do {                                     \
+    int cacheline_bytes  = READ_CP32(CCSIDR);                           \
+    typeof(p) _p = (p);                                                 \
+    if ( ((unsigned long)_p & ~(cacheline_bytes - 1)) !=                \
+        (((unsigned long)_p + (sizeof *_p)) & ~(cacheline_bytes - 1)) ) \
+        flush_xen_dcache_va_range(_p, sizeof *_p);                      \
+    else                                                                \
+        asm volatile (                                                  \
+            "dsb;"   /* Finish all earlier writes */                    \
+            STORE_CP32(0, DCCMVAC)                                      \
+            "dsb;"   /* Finish flush before continuing */               \
+            : : "r" (_p), "m" (*_p));                                   \
+} while (0)
+
+
 /*
  * Flush all hypervisor mappings from the TLB and branch predictor.
- * This is needed after changing Xen code mappings. 
+ * This is needed after changing Xen code mappings.
+ *
+ * The caller needs to issue the necessary DSB and D-cache flushes
+ * before calling flush_xen_text_tlb.
  */
 static inline void flush_xen_text_tlb(void)
 {
     register unsigned long r0 asm ("r0");
     asm volatile (
-        "dsb;"                        /* Ensure visibility of PTE writes */
+        "isb;"                        /* Ensure synchronization with previous changes to text */
         STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
+        STORE_CP32(0, ICIALLU)        /* Flush I-cache */
         STORE_CP32(0, BPIALL)         /* Flush branch predictor */
         "dsb;"                        /* Ensure completion of TLB+BP flush */
         "isb;"
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:44:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZO5L-0006uX-53; Fri, 16 Nov 2012 15:44:03 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TZO5J-0006uM-VG
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:44:02 +0000
Received: from [85.158.139.83:36196] by server-5.bemta-5.messagelabs.com id
	5C/B5-11353-14F56A05; Fri, 16 Nov 2012 15:44:01 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1353080638!28238634!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18713 invoked from network); 16 Nov 2012 15:44:00 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-10.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:44:00 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="44857526"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	16 Nov 2012 15:43:58 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 16 Nov 2012 10:43:57 -0500
Message-ID: <50A65F3C.5070307@citrix.com>
Date: Fri, 16 Nov 2012 15:43:56 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Andres Lagar-Cavilla <andres.lagarcavilla@gmail.com>
References: <mailman.16724.1353079390.1399.xen-devel@lists.xen.org>
	<840353AF-6BD3-4BAB-994C-7F784BF8227E@gmail.com>
In-Reply-To: <840353AF-6BD3-4BAB-994C-7F784BF8227E@gmail.com>
X-Originating-IP: [10.80.2.76]
Cc: Mats Petersson <mats.petersson@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Correctly return success from
	IOCTL_PRIVCMD_MMAPBATCH
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 15:37, Andres Lagar-Cavilla wrote:
>> This is a regression introduced by ceb90fa0 (xen/privcmd: add
>> PRIVCMD_MMAPBATCH_V2 ioctl).  It broke xentrace as it used
>> xc_map_foreign() instead of xc_map_foreign_bulk().
>>
>> Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
>> that it broke. The return value is set early on to -EINVAL, and if all
>> goes well, the "set top bits of the MFN's" never gets called, so the
>> return value is still EINVAL when the function gets to the end, causing
>> the caller to think it went wrong (which it didn't!)
>>
>> Signed off by: Mats Petersson <mats.petersson@citrix.com>
>> Acked-by: David Vrabel <david.vrabel@citrix.com>
> 
> Uggh. What a complicated API. Good catch, thanks.
> 
> Now, isn't this a simpler fix? (and by only changing ret to non-zero
> in error paths, less prone to allow for inadvertent errors in the future)

I had considered this, but I think Mats patch is clearer overall as it
makes the v1 and the v2 paths more similar.

David

> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
> index ef63895..4a6bcb2 100644
> --- a/drivers/xen/privcmd.c
> +++ b/drivers/xen/privcmd.c
> @@ -361,13 +361,13 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
>         down_write(&mm->mmap_sem);
>  
>         vma = find_vma(mm, m.addr);
> -       ret = -EINVAL;
>         if (!vma ||
>             vma->vm_ops != &privcmd_vm_ops ||
>             (m.addr != vma->vm_start) ||
>             ((m.addr + (nr_pages << PAGE_SHIFT)) != vma->vm_end) ||
>             !privcmd_enforce_singleshot_mapping(vma)) {
>                 up_write(&mm->mmap_sem);
> +        ret = -EINVAL;
>                 goto out;
>         }
>  
> 
>>
>> ---
>> drivers/xen/privcmd.c |   16 ++++++++++------
>> 1 file changed, 10 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
>> index 8adb9cc..24aec2f 100644
>> --- a/drivers/xen/privcmd.c
>> +++ b/drivers/xen/privcmd.c
>> @@ -383,12 +383,16 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
>>
>> 	up_write(&mm->mmap_sem);
>>
>> -	if (state.global_error && (version == 1)) {
>> -		/* Write back errors in second pass. */
>> -		state.user_mfn = (xen_pfn_t *)m.arr;
>> -		state.err      = err_array;
>> -		ret = traverse_pages(m.num, sizeof(xen_pfn_t),
>> -				     &pagelist, mmap_return_errors_v1, &state);
>> +	if (version == 1) {
>> +		if (state.global_error) {
>> +			/* Write back errors in second pass. */
>> +			state.user_mfn = (xen_pfn_t *)m.arr;
>> +			state.err      = err_array;
>> +			ret = traverse_pages(m.num, sizeof(xen_pfn_t),
>> +					     &pagelist, mmap_return_errors_v1, &state);
>> +		} else
>> +			ret = 0;
>> +
>> 	} else if (version == 2) {
>> 		ret = __copy_to_user(m.err, err_array, m.num * sizeof(int));
>> 		if (ret)
>> -- 
>> 1.7.9.5
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:44:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZO5L-0006uX-53; Fri, 16 Nov 2012 15:44:03 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TZO5J-0006uM-VG
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:44:02 +0000
Received: from [85.158.139.83:36196] by server-5.bemta-5.messagelabs.com id
	5C/B5-11353-14F56A05; Fri, 16 Nov 2012 15:44:01 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1353080638!28238634!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18713 invoked from network); 16 Nov 2012 15:44:00 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-10.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:44:00 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="44857526"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	16 Nov 2012 15:43:58 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 16 Nov 2012 10:43:57 -0500
Message-ID: <50A65F3C.5070307@citrix.com>
Date: Fri, 16 Nov 2012 15:43:56 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Andres Lagar-Cavilla <andres.lagarcavilla@gmail.com>
References: <mailman.16724.1353079390.1399.xen-devel@lists.xen.org>
	<840353AF-6BD3-4BAB-994C-7F784BF8227E@gmail.com>
In-Reply-To: <840353AF-6BD3-4BAB-994C-7F784BF8227E@gmail.com>
X-Originating-IP: [10.80.2.76]
Cc: Mats Petersson <mats.petersson@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Correctly return success from
	IOCTL_PRIVCMD_MMAPBATCH
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 15:37, Andres Lagar-Cavilla wrote:
>> This is a regression introduced by ceb90fa0 (xen/privcmd: add
>> PRIVCMD_MMAPBATCH_V2 ioctl).  It broke xentrace as it used
>> xc_map_foreign() instead of xc_map_foreign_bulk().
>>
>> Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
>> that it broke. The return value is set early on to -EINVAL, and if all
>> goes well, the "set top bits of the MFN's" never gets called, so the
>> return value is still EINVAL when the function gets to the end, causing
>> the caller to think it went wrong (which it didn't!)
>>
>> Signed off by: Mats Petersson <mats.petersson@citrix.com>
>> Acked-by: David Vrabel <david.vrabel@citrix.com>
> 
> Uggh. What a complicated API. Good catch, thanks.
> 
> Now, isn't this a simpler fix? (and by only changing ret to non-zero
> in error paths, less prone to allow for inadvertent errors in the future)

I had considered this, but I think Mats patch is clearer overall as it
makes the v1 and the v2 paths more similar.

David

> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
> index ef63895..4a6bcb2 100644
> --- a/drivers/xen/privcmd.c
> +++ b/drivers/xen/privcmd.c
> @@ -361,13 +361,13 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
>         down_write(&mm->mmap_sem);
>  
>         vma = find_vma(mm, m.addr);
> -       ret = -EINVAL;
>         if (!vma ||
>             vma->vm_ops != &privcmd_vm_ops ||
>             (m.addr != vma->vm_start) ||
>             ((m.addr + (nr_pages << PAGE_SHIFT)) != vma->vm_end) ||
>             !privcmd_enforce_singleshot_mapping(vma)) {
>                 up_write(&mm->mmap_sem);
> +        ret = -EINVAL;
>                 goto out;
>         }
>  
> 
>>
>> ---
>> drivers/xen/privcmd.c |   16 ++++++++++------
>> 1 file changed, 10 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
>> index 8adb9cc..24aec2f 100644
>> --- a/drivers/xen/privcmd.c
>> +++ b/drivers/xen/privcmd.c
>> @@ -383,12 +383,16 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
>>
>> 	up_write(&mm->mmap_sem);
>>
>> -	if (state.global_error && (version == 1)) {
>> -		/* Write back errors in second pass. */
>> -		state.user_mfn = (xen_pfn_t *)m.arr;
>> -		state.err      = err_array;
>> -		ret = traverse_pages(m.num, sizeof(xen_pfn_t),
>> -				     &pagelist, mmap_return_errors_v1, &state);
>> +	if (version == 1) {
>> +		if (state.global_error) {
>> +			/* Write back errors in second pass. */
>> +			state.user_mfn = (xen_pfn_t *)m.arr;
>> +			state.err      = err_array;
>> +			ret = traverse_pages(m.num, sizeof(xen_pfn_t),
>> +					     &pagelist, mmap_return_errors_v1, &state);
>> +		} else
>> +			ret = 0;
>> +
>> 	} else if (version == 2) {
>> 		ret = __copy_to_user(m.err, err_array, m.num * sizeof(int));
>> 		if (ret)
>> -- 
>> 1.7.9.5
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:46:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:46:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZO7k-00075j-NG; Fri, 16 Nov 2012 15:46:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZO7j-00075X-GT
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 15:46:31 +0000
Received: from [85.158.143.99:59049] by server-3.bemta-4.messagelabs.com id
	03/D0-06841-6DF56A05; Fri, 16 Nov 2012 15:46:30 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1353080788!26856563!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTcyODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5630 invoked from network); 16 Nov 2012 15:46:29 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-7.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 15:46:29 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGFj9hw014926
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 15:45:12 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGFj2vt017123
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 15:45:05 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGFitAF020107; Fri, 16 Nov 2012 09:44:57 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 07:44:55 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 9365C40C0E; Fri, 16 Nov 2012 10:44:51 -0500 (EST)
Date: Fri, 16 Nov 2012 10:44:51 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121116154451.GM22320@phenom.dumpdata.com>
References: <1352730598-13904-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121112163052.GA9575@phenom.dumpdata.com>
	<50A13039.2070909@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A13039.2070909@jhuapl.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"tpmdd@selhorst.net" <tpmdd@selhorst.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	"key@linux.vnet.ibm.com" <key@linux.vnet.ibm.com>,
	"tpmdd@sirrix.com" <tpmdd@sirrix.com>
Subject: Re: [Xen-devel] [PATCH v2] add xen-tpmfront.ko: Xen Virtual TPM
	frontend driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 12, 2012 at 12:22:01PM -0500, Matthew Fioravante wrote:
> On 11/12/2012 11:30 AM, Konrad Rzeszutek Wilk wrote:
> >On Mon, Nov 12, 2012 at 09:29:58AM -0500, Matthew Fioravante wrote:
> >>This patch ports the xen vtpm frontend driver for linux
> >>from the linux-2.6.18-xen.hg tree to linux-stable. This
> >>driver is designed be used with the mini-os tpmback driver
> >>in Xen as part of the new mini-os virtual tpm subsystem.
> >>See docs/misc/vtpm.txt in Xen and the xen-devel mailing list
> >>for details.
> >I didn't look in details but off the bat - you are missing
> >the Documentation/../sysfs file.
> It looks like Kent submitted a patch that documents sysfs generically
> for all of the TPM drivers.

Great!
> >
> >I still think you should include the full vtpm.txt in this
> >patch description and refer at the end to the docs/misc/vtpm.txt
> >in Xen as the source for the up-to-date version.
> The current docs/misc/vtpm.txt in Xen is still the old version. I've
> just written a new one and am reviewing it. It will come in the next
> resubmission of my vtpm patches to xen. I'll include the text here
> for the next resubmission of this patch as well.

Fantastic. Thank you.
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:46:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:46:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZO7k-00075j-NG; Fri, 16 Nov 2012 15:46:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZO7j-00075X-GT
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 15:46:31 +0000
Received: from [85.158.143.99:59049] by server-3.bemta-4.messagelabs.com id
	03/D0-06841-6DF56A05; Fri, 16 Nov 2012 15:46:30 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1353080788!26856563!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTcyODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5630 invoked from network); 16 Nov 2012 15:46:29 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-7.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 15:46:29 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGFj9hw014926
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 15:45:12 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGFj2vt017123
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 15:45:05 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGFitAF020107; Fri, 16 Nov 2012 09:44:57 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 07:44:55 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 9365C40C0E; Fri, 16 Nov 2012 10:44:51 -0500 (EST)
Date: Fri, 16 Nov 2012 10:44:51 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121116154451.GM22320@phenom.dumpdata.com>
References: <1352730598-13904-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<20121112163052.GA9575@phenom.dumpdata.com>
	<50A13039.2070909@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A13039.2070909@jhuapl.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"tpmdd@selhorst.net" <tpmdd@selhorst.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd-devel@lists.sourceforge.net" <tpmdd-devel@lists.sourceforge.net>,
	"key@linux.vnet.ibm.com" <key@linux.vnet.ibm.com>,
	"tpmdd@sirrix.com" <tpmdd@sirrix.com>
Subject: Re: [Xen-devel] [PATCH v2] add xen-tpmfront.ko: Xen Virtual TPM
	frontend driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 12, 2012 at 12:22:01PM -0500, Matthew Fioravante wrote:
> On 11/12/2012 11:30 AM, Konrad Rzeszutek Wilk wrote:
> >On Mon, Nov 12, 2012 at 09:29:58AM -0500, Matthew Fioravante wrote:
> >>This patch ports the xen vtpm frontend driver for linux
> >>from the linux-2.6.18-xen.hg tree to linux-stable. This
> >>driver is designed be used with the mini-os tpmback driver
> >>in Xen as part of the new mini-os virtual tpm subsystem.
> >>See docs/misc/vtpm.txt in Xen and the xen-devel mailing list
> >>for details.
> >I didn't look in details but off the bat - you are missing
> >the Documentation/../sysfs file.
> It looks like Kent submitted a patch that documents sysfs generically
> for all of the TPM drivers.

Great!
> >
> >I still think you should include the full vtpm.txt in this
> >patch description and refer at the end to the docs/misc/vtpm.txt
> >in Xen as the source for the up-to-date version.
> The current docs/misc/vtpm.txt in Xen is still the old version. I've
> just written a new one and am reviewing it. It will come in the next
> resubmission of my vtpm patches to xen. I'll include the text here
> for the next resubmission of this patch as well.

Fantastic. Thank you.
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:48:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:48:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZO9I-0007EF-7O; Fri, 16 Nov 2012 15:48:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TZO9H-0007E7-Jd
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:48:07 +0000
Received: from [193.109.254.147:29151] by server-3.bemta-14.messagelabs.com id
	65/E8-01317-63066A05; Fri, 16 Nov 2012 15:48:06 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1353080884!9380280!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4295 invoked from network); 16 Nov 2012 15:48:05 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:48:05 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="44858113"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	16 Nov 2012 15:48:03 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 16 Nov 2012 10:48:03 -0500
Message-ID: <50A66032.8090703@citrix.com>
Date: Fri, 16 Nov 2012 15:48:02 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Mats Petersson <mats.petersson@citrix.com>
References: <1353077152-29630-1-git-send-email-mats.petersson@citrix.com>
In-Reply-To: <1353077152-29630-1-git-send-email-mats.petersson@citrix.com>
X-Originating-IP: [10.80.2.76]
Cc: konrad.wilk@oracle.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] Improve performance
	of	IOCTL_PRIVCMD_MMAPBATCH_V2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 14:45, Mats Petersson wrote:

Add "xen/privcmd:" prefix to subject.

> This patch makes the IOCTL_PRIVCMD_MMAPBATCH_V2 (and older V1 version)
> map multiple (typically 1024) pages at a time rather than one page at a
> time, despite the pages being non-consecutive MFNs. The main change is
> to pass a pointer to an array of mfns, rather than one mfn. To support
> error reporting, we also pass an err_ptr. If err_ptr is NULL, it indicates
> we want the contiguous pages behaviour, so the mfn value is incremented
> rather than the pointer itself. Performance of mapping guest memory into
> Dom0 is improved by a factor of around 6 with this change.

Can you include details on the test and the raw figures as well?

> Signed-off-by: Mats Petersson <mats.petersson@citrix.com>
> ---
>  arch/x86/xen/mmu.c    |   47 ++++++++++++++++++++++++++-------
>  drivers/xen/privcmd.c |   70 ++++++++++++++++++++++++++++++++++++++++++-------
>  include/xen/xen-ops.h |    5 ++--
>  3 files changed, 100 insertions(+), 22 deletions(-)
> 
> diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
> index dcf5f2d..c5e23ba 100644
> --- a/arch/x86/xen/mmu.c
> +++ b/arch/x86/xen/mmu.c
> @@ -2477,7 +2477,8 @@ void __init xen_hvm_init_mmu_ops(void)
>  #define REMAP_BATCH_SIZE 16
>  
>  struct remap_data {
> -	unsigned long mfn;
> +	unsigned long *mfn;
> +	int contiguous;

bool.

>  	pgprot_t prot;
>  	struct mmu_update *mmu_update;
>  };
> @@ -2486,7 +2487,13 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
>  				 unsigned long addr, void *data)
>  {
>  	struct remap_data *rmd = data;
> -	pte_t pte = pte_mkspecial(pfn_pte(rmd->mfn++, rmd->prot));
> +	pte_t pte = pte_mkspecial(pfn_pte(*rmd->mfn, rmd->prot));
> +	/* If we have a contigious range, just update the mfn itself,
> +	   else update pointer to be "next mfn". */
> +	if (rmd->contiguous)
> +		(*rmd->mfn)++;
> +	else
> +		rmd->mfn++;
>  
>  	rmd->mmu_update->ptr = virt_to_machine(ptep).maddr;
>  	rmd->mmu_update->val = pte_val_ma(pte);
> @@ -2495,16 +2502,17 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
>  	return 0;
>  }
>  
> +
>  int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
>  			       unsigned long addr,
> -			       unsigned long mfn, int nr,
> -			       pgprot_t prot, unsigned domid)
> +			       unsigned long *mfn, int nr,
> +			       int *err_ptr, pgprot_t prot,
> +			       unsigned domid)
>  {
> +	int err;
>  	struct remap_data rmd;
>  	struct mmu_update mmu_update[REMAP_BATCH_SIZE];
> -	int batch;
>  	unsigned long range;
> -	int err = 0;
>  
>  	if (xen_feature(XENFEAT_auto_translated_physmap))
>  		return -EINVAL;
> @@ -2515,9 +2523,15 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
>  
>  	rmd.mfn = mfn;
>  	rmd.prot = prot;
> +	/* We use the err_ptr to indicate if there we are doing a contigious
> +	 * mapping or a discontigious mapping. */
> +	rmd.contiguous = !err_ptr;

This is non-obvious for an API call.  Suggest having two wrapper
functions for the two different use cases that share a common internal
implementation.

e.g.,

int xen_remap_domain_mfn_array(struct vm_area_struct *vma,
		       unsigned long addr,
		       unsigned long *mfns, int nr,
		       int *err_ptr,
                       pgprot_t prot, unsigned domid)

int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
		       unsigned long addr,
		       unsigned long start_mfn, unsigned long end_mfn,
		       pgprot_t prot, unsigned domid)

It would be nice if the API calls had some docs as well (e.g., in
kernel-doc style).

David

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:48:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:48:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZO9I-0007EF-7O; Fri, 16 Nov 2012 15:48:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TZO9H-0007E7-Jd
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:48:07 +0000
Received: from [193.109.254.147:29151] by server-3.bemta-14.messagelabs.com id
	65/E8-01317-63066A05; Fri, 16 Nov 2012 15:48:06 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1353080884!9380280!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4295 invoked from network); 16 Nov 2012 15:48:05 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:48:05 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="44858113"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	16 Nov 2012 15:48:03 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 16 Nov 2012 10:48:03 -0500
Message-ID: <50A66032.8090703@citrix.com>
Date: Fri, 16 Nov 2012 15:48:02 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Mats Petersson <mats.petersson@citrix.com>
References: <1353077152-29630-1-git-send-email-mats.petersson@citrix.com>
In-Reply-To: <1353077152-29630-1-git-send-email-mats.petersson@citrix.com>
X-Originating-IP: [10.80.2.76]
Cc: konrad.wilk@oracle.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] Improve performance
	of	IOCTL_PRIVCMD_MMAPBATCH_V2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 14:45, Mats Petersson wrote:

Add "xen/privcmd:" prefix to subject.

> This patch makes the IOCTL_PRIVCMD_MMAPBATCH_V2 (and older V1 version)
> map multiple (typically 1024) pages at a time rather than one page at a
> time, despite the pages being non-consecutive MFNs. The main change is
> to pass a pointer to an array of mfns, rather than one mfn. To support
> error reporting, we also pass an err_ptr. If err_ptr is NULL, it indicates
> we want the contiguous pages behaviour, so the mfn value is incremented
> rather than the pointer itself. Performance of mapping guest memory into
> Dom0 is improved by a factor of around 6 with this change.

Can you include details on the test and the raw figures as well?

> Signed-off-by: Mats Petersson <mats.petersson@citrix.com>
> ---
>  arch/x86/xen/mmu.c    |   47 ++++++++++++++++++++++++++-------
>  drivers/xen/privcmd.c |   70 ++++++++++++++++++++++++++++++++++++++++++-------
>  include/xen/xen-ops.h |    5 ++--
>  3 files changed, 100 insertions(+), 22 deletions(-)
> 
> diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
> index dcf5f2d..c5e23ba 100644
> --- a/arch/x86/xen/mmu.c
> +++ b/arch/x86/xen/mmu.c
> @@ -2477,7 +2477,8 @@ void __init xen_hvm_init_mmu_ops(void)
>  #define REMAP_BATCH_SIZE 16
>  
>  struct remap_data {
> -	unsigned long mfn;
> +	unsigned long *mfn;
> +	int contiguous;

bool.

>  	pgprot_t prot;
>  	struct mmu_update *mmu_update;
>  };
> @@ -2486,7 +2487,13 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
>  				 unsigned long addr, void *data)
>  {
>  	struct remap_data *rmd = data;
> -	pte_t pte = pte_mkspecial(pfn_pte(rmd->mfn++, rmd->prot));
> +	pte_t pte = pte_mkspecial(pfn_pte(*rmd->mfn, rmd->prot));
> +	/* If we have a contigious range, just update the mfn itself,
> +	   else update pointer to be "next mfn". */
> +	if (rmd->contiguous)
> +		(*rmd->mfn)++;
> +	else
> +		rmd->mfn++;
>  
>  	rmd->mmu_update->ptr = virt_to_machine(ptep).maddr;
>  	rmd->mmu_update->val = pte_val_ma(pte);
> @@ -2495,16 +2502,17 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
>  	return 0;
>  }
>  
> +
>  int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
>  			       unsigned long addr,
> -			       unsigned long mfn, int nr,
> -			       pgprot_t prot, unsigned domid)
> +			       unsigned long *mfn, int nr,
> +			       int *err_ptr, pgprot_t prot,
> +			       unsigned domid)
>  {
> +	int err;
>  	struct remap_data rmd;
>  	struct mmu_update mmu_update[REMAP_BATCH_SIZE];
> -	int batch;
>  	unsigned long range;
> -	int err = 0;
>  
>  	if (xen_feature(XENFEAT_auto_translated_physmap))
>  		return -EINVAL;
> @@ -2515,9 +2523,15 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
>  
>  	rmd.mfn = mfn;
>  	rmd.prot = prot;
> +	/* We use the err_ptr to indicate if there we are doing a contigious
> +	 * mapping or a discontigious mapping. */
> +	rmd.contiguous = !err_ptr;

This is non-obvious for an API call.  Suggest having two wrapper
functions for the two different use cases that share a common internal
implementation.

e.g.,

int xen_remap_domain_mfn_array(struct vm_area_struct *vma,
		       unsigned long addr,
		       unsigned long *mfns, int nr,
		       int *err_ptr,
                       pgprot_t prot, unsigned domid)

int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
		       unsigned long addr,
		       unsigned long start_mfn, unsigned long end_mfn,
		       pgprot_t prot, unsigned domid)

It would be nice if the API calls had some docs as well (e.g., in
kernel-doc style).

David

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:49:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:49:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOA7-0007K3-MY; Fri, 16 Nov 2012 15:48:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZOA6-0007Jn-C6
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 15:48:58 +0000
Received: from [85.158.139.83:11313] by server-5.bemta-5.messagelabs.com id
	22/FD-11353-96066A05; Fri, 16 Nov 2012 15:48:57 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1353080936!27914975!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15253 invoked from network); 16 Nov 2012 15:48:57 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:48:57 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208,217";a="15854420"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:48:56 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 15:48:56 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TZOA4-0000HE-Dc; Fri, 16 Nov 2012 15:48:56 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TZOA4-0005Sk-A0;
	Fri, 16 Nov 2012 15:48:56 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20646.24679.998078.183038@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 15:48:55 +0000
To: Juergen Gross <juergen.gross@ts.fujitsu.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <7c02a22ef82161c3930f.1352886775@nehalem1>
References: <7c02a22ef82161c3930f.1352886775@nehalem1>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH] Support user domain create extensions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Juergen Gross writes ("[Xen-devel] [PATCH] Support user domain create extensions"):
> This patch supports arbitrary extensions to xl create by being able
> to specify a script which is run at domain creation. The script is
> specified in the xl config file and will be started at domain
> creation with following parameters:
> 
> <script> restore|create <domid> <path of config file>

Thanks.  I think this is a reasonable idea.
I wonder if this might be profitably moved down into libxl.

Also the interface needs work.  At the very least there needs to be a
corresponding "destroy" script invocation.

> To be able to use non-standard devices a new device class "NSTD" is defined.
> The xl framework will remove all NSTD devices when destroying a domain.

Did I miss the implementation of this ?

> +const char *libxl_userdata_path(libxl_ctx *ctx, uint32_t domid,
> +                                const char *userdata_userid,
> +                                const char *wh)

I don't think this is correct.  We shouldn't be exposing the userdata
path like this.  But anyway if we are moving this into libxl then the
config file won't be exposed to the script anyway.

What does your script need the config file for ?  Writing a separate
parser for it is clearly a mistake...

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:49:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:49:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOA7-0007K3-MY; Fri, 16 Nov 2012 15:48:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZOA6-0007Jn-C6
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 15:48:58 +0000
Received: from [85.158.139.83:11313] by server-5.bemta-5.messagelabs.com id
	22/FD-11353-96066A05; Fri, 16 Nov 2012 15:48:57 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1353080936!27914975!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15253 invoked from network); 16 Nov 2012 15:48:57 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:48:57 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208,217";a="15854420"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:48:56 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 15:48:56 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TZOA4-0000HE-Dc; Fri, 16 Nov 2012 15:48:56 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TZOA4-0005Sk-A0;
	Fri, 16 Nov 2012 15:48:56 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20646.24679.998078.183038@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 15:48:55 +0000
To: Juergen Gross <juergen.gross@ts.fujitsu.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <7c02a22ef82161c3930f.1352886775@nehalem1>
References: <7c02a22ef82161c3930f.1352886775@nehalem1>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH] Support user domain create extensions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Juergen Gross writes ("[Xen-devel] [PATCH] Support user domain create extensions"):
> This patch supports arbitrary extensions to xl create by being able
> to specify a script which is run at domain creation. The script is
> specified in the xl config file and will be started at domain
> creation with following parameters:
> 
> <script> restore|create <domid> <path of config file>

Thanks.  I think this is a reasonable idea.
I wonder if this might be profitably moved down into libxl.

Also the interface needs work.  At the very least there needs to be a
corresponding "destroy" script invocation.

> To be able to use non-standard devices a new device class "NSTD" is defined.
> The xl framework will remove all NSTD devices when destroying a domain.

Did I miss the implementation of this ?

> +const char *libxl_userdata_path(libxl_ctx *ctx, uint32_t domid,
> +                                const char *userdata_userid,
> +                                const char *wh)

I don't think this is correct.  We shouldn't be exposing the userdata
path like this.  But anyway if we are moving this into libxl then the
config file won't be exposed to the script anyway.

What does your script need the config file for ?  Writing a separate
parser for it is clearly a mistake...

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:49:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:49:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOAl-0007QB-8q; Fri, 16 Nov 2012 15:49:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TZOAj-0007Pr-Mw
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:49:37 +0000
Received: from [85.158.137.99:29651] by server-13.bemta-3.messagelabs.com id
	95/BE-24887-09066A05; Fri, 16 Nov 2012 15:49:36 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1353080974!19419357!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2359 invoked from network); 16 Nov 2012 15:49:36 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:49:36 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="44858260"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:49:34 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 10:49:34 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TZOAf-0007PU-Me;
	Fri, 16 Nov 2012 15:49:33 +0000
Message-ID: <50A65F43.1030309@eu.citrix.com>
Date: Fri, 16 Nov 2012 15:44:03 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Dario Faggioli <raistlin@linux.it>
References: <1350999260.5064.56.camel@Solace> <5086B4DF.6060701@eu.citrix.com>
	<1352981447.5351.51.camel@Solace> <50A4DD95.5020107@eu.citrix.com>
	<1353063234.5351.107.camel@Solace>
	<1353067252.5351.124.camel@Solace>
In-Reply-To: <1353067252.5351.124.camel@Solace>
Cc: Keir Fraser <keir.xen@gmail.com>, David Vrabel <david.vrabel@citrix.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] About vcpu wakeup and runq tickling in credit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 12:00, Dario Faggioli wrote:
> On Fri, 2012-11-16 at 11:53 +0100, Dario Faggioli wrote:
>> On Thu, 2012-11-15 at 12:18 +0000, George Dunlap wrote:
>>> Maybe what we should do is do the wake-up based on who is likely to run
>>> on the current cpu: i.e., if "current" is likely to be pre-empted, look
>>> at idlers based on "current"'s mask; if "new" is likely to be put on the
>>> queue, look at idlers based on "new"'s mask.
>>>
>> Ok, find attached the two (trivial) patches that I produced and am
>> testing in these days. Unfortunately, early results shows that I/we
>> might be missing something.
>>
> I'm just came to thinking that this approach, although more, say,
> correct, could have a bad impact on caches and locality in general.

One thing that xenalyze will already tell you is statistics on how a 
vcpu migrates over pcpus.  For example:

  cpu affinity:     242 7009916158 {621089444|5643356292|19752063006}
    [0]:      15 6940230676 {400952|5643531152|27013831272}
    [1]:      19 6366861827 {117462|5031404806|19751998114}
    [2]:      31 6888557514 {1410800684|5643015454|19752100009}
    [3]:      18 7790887470 {109764|5920027975|25395539566}
...

The general format is: "$number $average_cycles {5th percentile|50th 
percentile|95th percentile}".  The first line includes samples from 
*all* cpus (i.e,. so it migrated a total of 242 times, averaging 7 
billion cycles each time); the subsequent numbers show statistics on 
specific pcpus (i.e., it had 15 sessions on pcpu 0, averaging 6.94 
billion cycles, &c).

You should be able to use this to do a basic verification of your 
hypothesis that vcpus are migrating more often.

> In fact, suppose a new vcpu N wakes up on pcpu #x where another vcpu C
> is running, with prio(N)>prio(C).
>
> What upstream does is asking to #x and to all the idlers that can
> execute N to reschedule. Doing both is, I think, wrong, as there's the
> chance of ending up with N being scheduled on #x and C being runnable
> but not running (in #x's runqueue) even if there are idle cpus that
> could run it, as they're not poked (as already and repeatedly said).
>
> What the patches do, in this case (remember (prio(N)>prio(C)), is asking
> #x and all the idlers that can run C to reschedule, the effect being
> that N will likely run on #x, after a context switch, and C will run
> somewhere else, after a migration, potentially wasting its cache-hotness
> (it is running after all!).
>
> It looks like we can do better... Something like the below:
>   + if there are no idlers where N can run, ask #x and the idlers where
>     C can run to reschedule (exactly what the patches do, although, they
>     do that _unconditionally_), as there isn't anything else we can do
>     to try to make sure they both will run;
>   + if *there*are* idlers where N can run, _do_not_ ask #x to reschedule
>     and only poke them to come pick N up. In fact, in this case, it is
>     not necessary to send C away for having both the vcpus ruunning, and
>     it seems better to have N experience the migration as, since it's
>     waking-up, it's more likely for him than for C to be cache-cold.

I think that makes a lot of sense -- look forward to seeing the results. :-)

There may be some other tricks we could look at.  For example, if N and 
C are both going to do a significant chunk of computation, then this 
strategy will work best.  But suppose that C does a significant junk of 
computation, but N is only going to run for a few hundred microseconds 
and then go to sleep again?  In that case, it may be easier to just run 
N on the current processor and not bother with IPIs and such; C will run 
again in a few microseconds.   Conversely, if N will do a significant 
chunk of work but C is fairly short, we might as well let C continue 
running, as N will shortly get to run.

How to know if the next time this vcpu runs will be long or short? We 
could try tracking the runtimes of the last N (maybe 3 or 5) this was 
scheduled, and using that to predict the results.

Do you have traces for any of those runs you did?  I might just take a 
look at them and see if I can make an analysis of cache "temperature" 
wrt scheduling. :-)

  -George

  -George




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:49:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:49:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOAl-0007QB-8q; Fri, 16 Nov 2012 15:49:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TZOAj-0007Pr-Mw
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:49:37 +0000
Received: from [85.158.137.99:29651] by server-13.bemta-3.messagelabs.com id
	95/BE-24887-09066A05; Fri, 16 Nov 2012 15:49:36 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1353080974!19419357!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2359 invoked from network); 16 Nov 2012 15:49:36 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:49:36 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="44858260"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:49:34 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 10:49:34 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TZOAf-0007PU-Me;
	Fri, 16 Nov 2012 15:49:33 +0000
Message-ID: <50A65F43.1030309@eu.citrix.com>
Date: Fri, 16 Nov 2012 15:44:03 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Dario Faggioli <raistlin@linux.it>
References: <1350999260.5064.56.camel@Solace> <5086B4DF.6060701@eu.citrix.com>
	<1352981447.5351.51.camel@Solace> <50A4DD95.5020107@eu.citrix.com>
	<1353063234.5351.107.camel@Solace>
	<1353067252.5351.124.camel@Solace>
In-Reply-To: <1353067252.5351.124.camel@Solace>
Cc: Keir Fraser <keir.xen@gmail.com>, David Vrabel <david.vrabel@citrix.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] About vcpu wakeup and runq tickling in credit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 12:00, Dario Faggioli wrote:
> On Fri, 2012-11-16 at 11:53 +0100, Dario Faggioli wrote:
>> On Thu, 2012-11-15 at 12:18 +0000, George Dunlap wrote:
>>> Maybe what we should do is do the wake-up based on who is likely to run
>>> on the current cpu: i.e., if "current" is likely to be pre-empted, look
>>> at idlers based on "current"'s mask; if "new" is likely to be put on the
>>> queue, look at idlers based on "new"'s mask.
>>>
>> Ok, find attached the two (trivial) patches that I produced and am
>> testing in these days. Unfortunately, early results shows that I/we
>> might be missing something.
>>
> I'm just came to thinking that this approach, although more, say,
> correct, could have a bad impact on caches and locality in general.

One thing that xenalyze will already tell you is statistics on how a 
vcpu migrates over pcpus.  For example:

  cpu affinity:     242 7009916158 {621089444|5643356292|19752063006}
    [0]:      15 6940230676 {400952|5643531152|27013831272}
    [1]:      19 6366861827 {117462|5031404806|19751998114}
    [2]:      31 6888557514 {1410800684|5643015454|19752100009}
    [3]:      18 7790887470 {109764|5920027975|25395539566}
...

The general format is: "$number $average_cycles {5th percentile|50th 
percentile|95th percentile}".  The first line includes samples from 
*all* cpus (i.e,. so it migrated a total of 242 times, averaging 7 
billion cycles each time); the subsequent numbers show statistics on 
specific pcpus (i.e., it had 15 sessions on pcpu 0, averaging 6.94 
billion cycles, &c).

You should be able to use this to do a basic verification of your 
hypothesis that vcpus are migrating more often.

> In fact, suppose a new vcpu N wakes up on pcpu #x where another vcpu C
> is running, with prio(N)>prio(C).
>
> What upstream does is asking to #x and to all the idlers that can
> execute N to reschedule. Doing both is, I think, wrong, as there's the
> chance of ending up with N being scheduled on #x and C being runnable
> but not running (in #x's runqueue) even if there are idle cpus that
> could run it, as they're not poked (as already and repeatedly said).
>
> What the patches do, in this case (remember (prio(N)>prio(C)), is asking
> #x and all the idlers that can run C to reschedule, the effect being
> that N will likely run on #x, after a context switch, and C will run
> somewhere else, after a migration, potentially wasting its cache-hotness
> (it is running after all!).
>
> It looks like we can do better... Something like the below:
>   + if there are no idlers where N can run, ask #x and the idlers where
>     C can run to reschedule (exactly what the patches do, although, they
>     do that _unconditionally_), as there isn't anything else we can do
>     to try to make sure they both will run;
>   + if *there*are* idlers where N can run, _do_not_ ask #x to reschedule
>     and only poke them to come pick N up. In fact, in this case, it is
>     not necessary to send C away for having both the vcpus ruunning, and
>     it seems better to have N experience the migration as, since it's
>     waking-up, it's more likely for him than for C to be cache-cold.

I think that makes a lot of sense -- look forward to seeing the results. :-)

There may be some other tricks we could look at.  For example, if N and 
C are both going to do a significant chunk of computation, then this 
strategy will work best.  But suppose that C does a significant junk of 
computation, but N is only going to run for a few hundred microseconds 
and then go to sleep again?  In that case, it may be easier to just run 
N on the current processor and not bother with IPIs and such; C will run 
again in a few microseconds.   Conversely, if N will do a significant 
chunk of work but C is fairly short, we might as well let C continue 
running, as N will shortly get to run.

How to know if the next time this vcpu runs will be long or short? We 
could try tracking the runtimes of the last N (maybe 3 or 5) this was 
scheduled, and using that to predict the results.

Do you have traces for any of those runs you did?  I might just take a 
look at them and see if I can make an analysis of cache "temperature" 
wrt scheduling. :-)

  -George

  -George




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:57:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:57:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOID-0007qo-6y; Fri, 16 Nov 2012 15:57:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZOIC-0007qj-Cc
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 15:57:20 +0000
Received: from [85.158.139.83:64219] by server-1.bemta-5.messagelabs.com id
	DC/7C-05877-F5266A05; Fri, 16 Nov 2012 15:57:19 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1353081437!30611582!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3368 invoked from network); 16 Nov 2012 15:57:19 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:57:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="15854570"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:56:34 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 15:56:33 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TZOHR-0000LS-Lz; Fri, 16 Nov 2012 15:56:33 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TZOHR-0005Uf-IG;
	Fri, 16 Nov 2012 15:56:33 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20646.25137.446329.803417@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 15:56:33 +0000
To: Ian Campbell <Ian.Campbell@citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <1352975175.3499.88.camel@zakaz.uk.xensource.com>
References: <1352945011-2847-1-git-send-email-jfehlig@suse.com>
	<1352975175.3499.88.camel@zakaz.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Jim Fehlig <jfehlig@suse.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Fix passing of application data to
 timeout_deregister hook
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("Re: [Xen-devel] [PATCH] libxl: Fix passing of application data to timeout_deregister hook"):
> On Thu, 2012-11-15 at 02:03 +0000, Jim Fehlig wrote:
> > When deregistering a timeout, the address of application data was
> > being passed to the timeout_deregister hook instead of the data
> > itself.
> > 
> >     Signed-off-by: Jim Fehlig <jfehlig@suse.com>
> 
> Acked + applied, thanks.
> 
> Ian, this should be a candidate for the next 4.2.1 rc IMHO.

I have pushed it to 4.2-testing.hg.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:57:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:57:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOID-0007qo-6y; Fri, 16 Nov 2012 15:57:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZOIC-0007qj-Cc
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 15:57:20 +0000
Received: from [85.158.139.83:64219] by server-1.bemta-5.messagelabs.com id
	DC/7C-05877-F5266A05; Fri, 16 Nov 2012 15:57:19 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1353081437!30611582!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3368 invoked from network); 16 Nov 2012 15:57:19 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:57:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="15854570"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:56:34 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 15:56:33 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TZOHR-0000LS-Lz; Fri, 16 Nov 2012 15:56:33 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TZOHR-0005Uf-IG;
	Fri, 16 Nov 2012 15:56:33 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20646.25137.446329.803417@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 15:56:33 +0000
To: Ian Campbell <Ian.Campbell@citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <1352975175.3499.88.camel@zakaz.uk.xensource.com>
References: <1352945011-2847-1-git-send-email-jfehlig@suse.com>
	<1352975175.3499.88.camel@zakaz.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Jim Fehlig <jfehlig@suse.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Fix passing of application data to
 timeout_deregister hook
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("Re: [Xen-devel] [PATCH] libxl: Fix passing of application data to timeout_deregister hook"):
> On Thu, 2012-11-15 at 02:03 +0000, Jim Fehlig wrote:
> > When deregistering a timeout, the address of application data was
> > being passed to the timeout_deregister hook instead of the data
> > itself.
> > 
> >     Signed-off-by: Jim Fehlig <jfehlig@suse.com>
> 
> Acked + applied, thanks.
> 
> Ian, this should be a candidate for the next 4.2.1 rc IMHO.

I have pushed it to 4.2-testing.hg.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:58:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:58:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOJX-0007vK-Mg; Fri, 16 Nov 2012 15:58:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZOJV-0007vA-QN
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:58:42 +0000
Received: from [85.158.138.51:5727] by server-7.bemta-3.messagelabs.com id
	03/51-01713-0B266A05; Fri, 16 Nov 2012 15:58:40 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353081520!28420046!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23431 invoked from network); 16 Nov 2012 15:58:40 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:58:40 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="15854616"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:58:39 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 15:58:39 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TZOJT-0000Mb-Aj; Fri, 16 Nov 2012 15:58:39 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TZOJT-0005Uz-75;
	Fri, 16 Nov 2012 15:58:39 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20646.25263.85526.83456@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 15:58:39 +0000
To: George Dunlap <George.Dunlap@eu.citrix.com>
In-Reply-To: <CAFLBxZYNzTQf6zp9VW75aQAJ=P=gjN9pU44QqsS0X+h_vEVW5Q@mail.gmail.com>
References: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
	<20646.21893.898086.36438@mariner.uk.xensource.com>
	<CAFLBxZYNzTQf6zp9VW75aQAJ=P=gjN9pU44QqsS0X+h_vEVW5Q@mail.gmail.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] Make all public hosting providers
 eligible for the pre-disclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap writes ("Re: [Xen-devel] [PATCH RFC] Make all public hosting providers eligible for the pre-disclosure list"):
> What kind of vendors / projects might fit that kind of profile?
>
> I suppose (for example) if there was a botique software dev house
> selling high-value-add XenClient-like solutions to a relatively
> small number of customers, it might make sense to allow them to
> join.

Yes.  Another possibility is more minor Linux distributions.

Many distros, particularly non-corporate ones, will not have reliable
usage statistics.  So we need some criterion for inclusion.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 15:58:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 15:58:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOJX-0007vK-Mg; Fri, 16 Nov 2012 15:58:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZOJV-0007vA-QN
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 15:58:42 +0000
Received: from [85.158.138.51:5727] by server-7.bemta-3.messagelabs.com id
	03/51-01713-0B266A05; Fri, 16 Nov 2012 15:58:40 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353081520!28420046!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23431 invoked from network); 16 Nov 2012 15:58:40 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-15.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 15:58:40 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="15854616"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 15:58:39 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 15:58:39 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TZOJT-0000Mb-Aj; Fri, 16 Nov 2012 15:58:39 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TZOJT-0005Uz-75;
	Fri, 16 Nov 2012 15:58:39 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20646.25263.85526.83456@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 15:58:39 +0000
To: George Dunlap <George.Dunlap@eu.citrix.com>
In-Reply-To: <CAFLBxZYNzTQf6zp9VW75aQAJ=P=gjN9pU44QqsS0X+h_vEVW5Q@mail.gmail.com>
References: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
	<20646.21893.898086.36438@mariner.uk.xensource.com>
	<CAFLBxZYNzTQf6zp9VW75aQAJ=P=gjN9pU44QqsS0X+h_vEVW5Q@mail.gmail.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] Make all public hosting providers
 eligible for the pre-disclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap writes ("Re: [Xen-devel] [PATCH RFC] Make all public hosting providers eligible for the pre-disclosure list"):
> What kind of vendors / projects might fit that kind of profile?
>
> I suppose (for example) if there was a botique software dev house
> selling high-value-add XenClient-like solutions to a relatively
> small number of customers, it might make sense to allow them to
> join.

Yes.  Another possibility is more minor Linux distributions.

Many distros, particularly non-corporate ones, will not have reliable
usage statistics.  So we need some criterion for inclusion.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:00:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:00:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOLU-0008SW-7g; Fri, 16 Nov 2012 16:00:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1TZOLS-0008SR-Ck
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 16:00:42 +0000
Received: from [85.158.138.51:27157] by server-16.bemta-3.messagelabs.com id
	5A/66-07461-92366A05; Fri, 16 Nov 2012 16:00:41 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-4.tower-174.messagelabs.com!1353081638!30302074!1
X-Originating-IP: [209.85.210.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26676 invoked from network); 16 Nov 2012 16:00:40 -0000
Received: from mail-ia0-f173.google.com (HELO mail-ia0-f173.google.com)
	(209.85.210.173)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 16:00:40 -0000
Received: by mail-ia0-f173.google.com with SMTP id w21so669199iac.32
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 08:00:38 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer
	:x-gm-message-state;
	bh=wE0JoVzNGgsoHXSRHN+ndniYZQ9ZDxR/2hh8FPE/zJs=;
	b=PWb9fmC/PApADGG5iuiHmwOWuRgm/AHif8q9vOrnuk5Afj1i/6PwbdPW4JzGBTjxeY
	OBJOk/0xlPts0RJbkNPgHaYtUWbT410lDgQACSUJZaqCfQwb2bg9J9bOjNqx1tS4k8Ne
	ktUYfxk4dse6wCfXRtVfgog/k1BVARqDMqrW7+zEVEceWifXM3hDWKGB0DG4rpiwUOiV
	a195SY6qwtOYDCcItFvFqhAT8UR0UXtvzAcc0Hz+RiMP6oJYYEyGVPXKRvr199mt0aVa
	DEotov1pF7DiYPih7yoI0CZk2JFUcTnpbIU2dZAk3NkHzYxqzeVrVDhjx4aXdiUUK+r3
	BB1Q==
Received: by 10.50.41.165 with SMTP id g5mr3609750igl.66.1353081638288;
	Fri, 16 Nov 2012 08:00:38 -0800 (PST)
Received: from [192.168.15.1] ([206.223.182.18])
	by mx.google.com with ESMTPS id gs6sm610747igc.11.2012.11.16.08.00.36
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 16 Nov 2012 08:00:36 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
In-Reply-To: <50A65F3C.5070307@citrix.com>
Date: Fri, 16 Nov 2012 11:00:36 -0500
Message-Id: <8B9D55E5-F520-4872-B402-1A1084A89246@gridcentric.ca>
References: <mailman.16724.1353079390.1399.xen-devel@lists.xen.org>
	<840353AF-6BD3-4BAB-994C-7F784BF8227E@gmail.com>
	<50A65F3C.5070307@citrix.com>
To: David Vrabel <david.vrabel@citrix.com>
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQmczWPy3am+WTx6K1f3vfkKjIiCjXItkhndgFmZmAbxv8vn1Jxlp1xaT+Os6sxIgZAANzM2
Cc: Mats Petersson <mats.petersson@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Correctly return success from
	IOCTL_PRIVCMD_MMAPBATCH
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="windows-1252"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Nov 16, 2012, at 10:43 AM, David Vrabel <david.vrabel@citrix.com> wrote:

> On 16/11/12 15:37, Andres Lagar-Cavilla wrote:
>>> This is a regression introduced by ceb90fa0 (xen/privcmd: add
>>> PRIVCMD_MMAPBATCH_V2 ioctl).  It broke xentrace as it used
>>> xc_map_foreign() instead of xc_map_foreign_bulk().
>>> =

>>> Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
>>> that it broke. The return value is set early on to -EINVAL, and if all
>>> goes well, the "set top bits of the MFN's" never gets called, so the
>>> return value is still EINVAL when the function gets to the end, causing
>>> the caller to think it went wrong (which it didn't!)
>>> =

>>> Signed off by: Mats Petersson <mats.petersson@citrix.com>
>>> Acked-by: David Vrabel <david.vrabel@citrix.com>
>> =

>> Uggh. What a complicated API. Good catch, thanks.
>> =

>> Now, isn't this a simpler fix? (and by only changing ret to non-zero
>> in error paths, less prone to allow for inadvertent errors in the future)
> =

> I had considered this, but I think Mats patch is clearer overall as it
> makes the v1 and the v2 paths more similar.

You mean the code structure becoming similar to a switch (version) { =85 },=
 instead of collapsing multiple conditions in the first if?

Ok, I guess.

Both patches are fine, I

acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>

Mats's patch, and they should be merged imho to make the logic clearer.

Andres
> =

> David
> =

>> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
>> index ef63895..4a6bcb2 100644
>> --- a/drivers/xen/privcmd.c
>> +++ b/drivers/xen/privcmd.c
>> @@ -361,13 +361,13 @@ static long privcmd_ioctl_mmap_batch(void __user *=
udata, int version)
>>        down_write(&mm->mmap_sem);
>> =

>>        vma =3D find_vma(mm, m.addr);
>> -       ret =3D -EINVAL;
>>        if (!vma ||
>>            vma->vm_ops !=3D &privcmd_vm_ops ||
>>            (m.addr !=3D vma->vm_start) ||
>>            ((m.addr + (nr_pages << PAGE_SHIFT)) !=3D vma->vm_end) ||
>>            !privcmd_enforce_singleshot_mapping(vma)) {
>>                up_write(&mm->mmap_sem);
>> +        ret =3D -EINVAL;
>>                goto out;
>>        }
>> =

>> =

>>> =

>>> ---
>>> drivers/xen/privcmd.c |   16 ++++++++++------
>>> 1 file changed, 10 insertions(+), 6 deletions(-)
>>> =

>>> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
>>> index 8adb9cc..24aec2f 100644
>>> --- a/drivers/xen/privcmd.c
>>> +++ b/drivers/xen/privcmd.c
>>> @@ -383,12 +383,16 @@ static long privcmd_ioctl_mmap_batch(void __user =
*udata, int version)
>>> =

>>> 	up_write(&mm->mmap_sem);
>>> =

>>> -	if (state.global_error && (version =3D=3D 1)) {
>>> -		/* Write back errors in second pass. */
>>> -		state.user_mfn =3D (xen_pfn_t *)m.arr;
>>> -		state.err      =3D err_array;
>>> -		ret =3D traverse_pages(m.num, sizeof(xen_pfn_t),
>>> -				     &pagelist, mmap_return_errors_v1, &state);
>>> +	if (version =3D=3D 1) {
>>> +		if (state.global_error) {
>>> +			/* Write back errors in second pass. */
>>> +			state.user_mfn =3D (xen_pfn_t *)m.arr;
>>> +			state.err      =3D err_array;
>>> +			ret =3D traverse_pages(m.num, sizeof(xen_pfn_t),
>>> +					     &pagelist, mmap_return_errors_v1, &state);
>>> +		} else
>>> +			ret =3D 0;
>>> +
>>> 	} else if (version =3D=3D 2) {
>>> 		ret =3D __copy_to_user(m.err, err_array, m.num * sizeof(int));
>>> 		if (ret)
>>> -- =

>>> 1.7.9.5
>> =

> =



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:00:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:00:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOLU-0008SW-7g; Fri, 16 Nov 2012 16:00:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1TZOLS-0008SR-Ck
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 16:00:42 +0000
Received: from [85.158.138.51:27157] by server-16.bemta-3.messagelabs.com id
	5A/66-07461-92366A05; Fri, 16 Nov 2012 16:00:41 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-4.tower-174.messagelabs.com!1353081638!30302074!1
X-Originating-IP: [209.85.210.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26676 invoked from network); 16 Nov 2012 16:00:40 -0000
Received: from mail-ia0-f173.google.com (HELO mail-ia0-f173.google.com)
	(209.85.210.173)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 16:00:40 -0000
Received: by mail-ia0-f173.google.com with SMTP id w21so669199iac.32
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 08:00:38 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer
	:x-gm-message-state;
	bh=wE0JoVzNGgsoHXSRHN+ndniYZQ9ZDxR/2hh8FPE/zJs=;
	b=PWb9fmC/PApADGG5iuiHmwOWuRgm/AHif8q9vOrnuk5Afj1i/6PwbdPW4JzGBTjxeY
	OBJOk/0xlPts0RJbkNPgHaYtUWbT410lDgQACSUJZaqCfQwb2bg9J9bOjNqx1tS4k8Ne
	ktUYfxk4dse6wCfXRtVfgog/k1BVARqDMqrW7+zEVEceWifXM3hDWKGB0DG4rpiwUOiV
	a195SY6qwtOYDCcItFvFqhAT8UR0UXtvzAcc0Hz+RiMP6oJYYEyGVPXKRvr199mt0aVa
	DEotov1pF7DiYPih7yoI0CZk2JFUcTnpbIU2dZAk3NkHzYxqzeVrVDhjx4aXdiUUK+r3
	BB1Q==
Received: by 10.50.41.165 with SMTP id g5mr3609750igl.66.1353081638288;
	Fri, 16 Nov 2012 08:00:38 -0800 (PST)
Received: from [192.168.15.1] ([206.223.182.18])
	by mx.google.com with ESMTPS id gs6sm610747igc.11.2012.11.16.08.00.36
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 16 Nov 2012 08:00:36 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
In-Reply-To: <50A65F3C.5070307@citrix.com>
Date: Fri, 16 Nov 2012 11:00:36 -0500
Message-Id: <8B9D55E5-F520-4872-B402-1A1084A89246@gridcentric.ca>
References: <mailman.16724.1353079390.1399.xen-devel@lists.xen.org>
	<840353AF-6BD3-4BAB-994C-7F784BF8227E@gmail.com>
	<50A65F3C.5070307@citrix.com>
To: David Vrabel <david.vrabel@citrix.com>
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQmczWPy3am+WTx6K1f3vfkKjIiCjXItkhndgFmZmAbxv8vn1Jxlp1xaT+Os6sxIgZAANzM2
Cc: Mats Petersson <mats.petersson@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Correctly return success from
	IOCTL_PRIVCMD_MMAPBATCH
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="windows-1252"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Nov 16, 2012, at 10:43 AM, David Vrabel <david.vrabel@citrix.com> wrote:

> On 16/11/12 15:37, Andres Lagar-Cavilla wrote:
>>> This is a regression introduced by ceb90fa0 (xen/privcmd: add
>>> PRIVCMD_MMAPBATCH_V2 ioctl).  It broke xentrace as it used
>>> xc_map_foreign() instead of xc_map_foreign_bulk().
>>> =

>>> Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
>>> that it broke. The return value is set early on to -EINVAL, and if all
>>> goes well, the "set top bits of the MFN's" never gets called, so the
>>> return value is still EINVAL when the function gets to the end, causing
>>> the caller to think it went wrong (which it didn't!)
>>> =

>>> Signed off by: Mats Petersson <mats.petersson@citrix.com>
>>> Acked-by: David Vrabel <david.vrabel@citrix.com>
>> =

>> Uggh. What a complicated API. Good catch, thanks.
>> =

>> Now, isn't this a simpler fix? (and by only changing ret to non-zero
>> in error paths, less prone to allow for inadvertent errors in the future)
> =

> I had considered this, but I think Mats patch is clearer overall as it
> makes the v1 and the v2 paths more similar.

You mean the code structure becoming similar to a switch (version) { =85 },=
 instead of collapsing multiple conditions in the first if?

Ok, I guess.

Both patches are fine, I

acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>

Mats's patch, and they should be merged imho to make the logic clearer.

Andres
> =

> David
> =

>> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
>> index ef63895..4a6bcb2 100644
>> --- a/drivers/xen/privcmd.c
>> +++ b/drivers/xen/privcmd.c
>> @@ -361,13 +361,13 @@ static long privcmd_ioctl_mmap_batch(void __user *=
udata, int version)
>>        down_write(&mm->mmap_sem);
>> =

>>        vma =3D find_vma(mm, m.addr);
>> -       ret =3D -EINVAL;
>>        if (!vma ||
>>            vma->vm_ops !=3D &privcmd_vm_ops ||
>>            (m.addr !=3D vma->vm_start) ||
>>            ((m.addr + (nr_pages << PAGE_SHIFT)) !=3D vma->vm_end) ||
>>            !privcmd_enforce_singleshot_mapping(vma)) {
>>                up_write(&mm->mmap_sem);
>> +        ret =3D -EINVAL;
>>                goto out;
>>        }
>> =

>> =

>>> =

>>> ---
>>> drivers/xen/privcmd.c |   16 ++++++++++------
>>> 1 file changed, 10 insertions(+), 6 deletions(-)
>>> =

>>> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
>>> index 8adb9cc..24aec2f 100644
>>> --- a/drivers/xen/privcmd.c
>>> +++ b/drivers/xen/privcmd.c
>>> @@ -383,12 +383,16 @@ static long privcmd_ioctl_mmap_batch(void __user =
*udata, int version)
>>> =

>>> 	up_write(&mm->mmap_sem);
>>> =

>>> -	if (state.global_error && (version =3D=3D 1)) {
>>> -		/* Write back errors in second pass. */
>>> -		state.user_mfn =3D (xen_pfn_t *)m.arr;
>>> -		state.err      =3D err_array;
>>> -		ret =3D traverse_pages(m.num, sizeof(xen_pfn_t),
>>> -				     &pagelist, mmap_return_errors_v1, &state);
>>> +	if (version =3D=3D 1) {
>>> +		if (state.global_error) {
>>> +			/* Write back errors in second pass. */
>>> +			state.user_mfn =3D (xen_pfn_t *)m.arr;
>>> +			state.err      =3D err_array;
>>> +			ret =3D traverse_pages(m.num, sizeof(xen_pfn_t),
>>> +					     &pagelist, mmap_return_errors_v1, &state);
>>> +		} else
>>> +			ret =3D 0;
>>> +
>>> 	} else if (version =3D=3D 2) {
>>> 		ret =3D __copy_to_user(m.err, err_array, m.num * sizeof(int));
>>> 		if (ret)
>>> -- =

>>> 1.7.9.5
>> =

> =



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:03:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:03:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOO4-0000I3-Rw; Fri, 16 Nov 2012 16:03:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZOO3-0000Hs-K2
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 16:03:23 +0000
Received: from [85.158.139.211:6556] by server-8.bemta-5.messagelabs.com id
	1A/2F-06050-AC366A05; Fri, 16 Nov 2012 16:03:22 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353081801!20423345!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12835 invoked from network); 16 Nov 2012 16:03:22 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 16:03:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="44860012"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	16 Nov 2012 16:03:10 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 16 Nov 2012 11:03:09 -0500
Message-ID: <50A663BC.5070703@citrix.com>
Date: Fri, 16 Nov 2012 16:03:08 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: David Vrabel <david.vrabel@citrix.com>
References: <1353077152-29630-1-git-send-email-mats.petersson@citrix.com>
	<50A66032.8090703@citrix.com>
In-Reply-To: <50A66032.8090703@citrix.com>
X-Originating-IP: [10.80.3.146]
Cc: "konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Improve performance of
	IOCTL_PRIVCMD_MMAPBATCH_V2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 15:48, David Vrabel wrote:
> On 16/11/12 14:45, Mats Petersson wrote:
>
> Add "xen/privcmd:" prefix to subject.
>
>> This patch makes the IOCTL_PRIVCMD_MMAPBATCH_V2 (and older V1 version)
>> map multiple (typically 1024) pages at a time rather than one page at a
>> time, despite the pages being non-consecutive MFNs. The main change is
>> to pass a pointer to an array of mfns, rather than one mfn. To support
>> error reporting, we also pass an err_ptr. If err_ptr is NULL, it indicates
>> we want the contiguous pages behaviour, so the mfn value is incremented
>> rather than the pointer itself. Performance of mapping guest memory into
>> Dom0 is improved by a factor of around 6 with this change.
> Can you include details on the test and the raw figures as well?
>
>> Signed-off-by: Mats Petersson <mats.petersson@citrix.com>
>> ---
>>   arch/x86/xen/mmu.c    |   47 ++++++++++++++++++++++++++-------
>>   drivers/xen/privcmd.c |   70 ++++++++++++++++++++++++++++++++++++++++++-------
>>   include/xen/xen-ops.h |    5 ++--
>>   3 files changed, 100 insertions(+), 22 deletions(-)
>>
>> diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
>> index dcf5f2d..c5e23ba 100644
>> --- a/arch/x86/xen/mmu.c
>> +++ b/arch/x86/xen/mmu.c
>> @@ -2477,7 +2477,8 @@ void __init xen_hvm_init_mmu_ops(void)
>>   #define REMAP_BATCH_SIZE 16
>>   
>>   struct remap_data {
>> -	unsigned long mfn;
>> +	unsigned long *mfn;
>> +	int contiguous;
> bool.
>
>>   	pgprot_t prot;
>>   	struct mmu_update *mmu_update;
>>   };
>> @@ -2486,7 +2487,13 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
>>   				 unsigned long addr, void *data)
>>   {
>>   	struct remap_data *rmd = data;
>> -	pte_t pte = pte_mkspecial(pfn_pte(rmd->mfn++, rmd->prot));
>> +	pte_t pte = pte_mkspecial(pfn_pte(*rmd->mfn, rmd->prot));
>> +	/* If we have a contigious range, just update the mfn itself,
>> +	   else update pointer to be "next mfn". */
>> +	if (rmd->contiguous)
>> +		(*rmd->mfn)++;
>> +	else
>> +		rmd->mfn++;
>>   
>>   	rmd->mmu_update->ptr = virt_to_machine(ptep).maddr;
>>   	rmd->mmu_update->val = pte_val_ma(pte);
>> @@ -2495,16 +2502,17 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
>>   	return 0;
>>   }
>>   
>> +
>>   int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
>>   			       unsigned long addr,
>> -			       unsigned long mfn, int nr,
>> -			       pgprot_t prot, unsigned domid)
>> +			       unsigned long *mfn, int nr,
>> +			       int *err_ptr, pgprot_t prot,
>> +			       unsigned domid)
>>   {
>> +	int err;
>>   	struct remap_data rmd;
>>   	struct mmu_update mmu_update[REMAP_BATCH_SIZE];
>> -	int batch;
>>   	unsigned long range;
>> -	int err = 0;
>>   
>>   	if (xen_feature(XENFEAT_auto_translated_physmap))
>>   		return -EINVAL;
>> @@ -2515,9 +2523,15 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
>>   
>>   	rmd.mfn = mfn;
>>   	rmd.prot = prot;
>> +	/* We use the err_ptr to indicate if there we are doing a contigious
>> +	 * mapping or a discontigious mapping. */
>> +	rmd.contiguous = !err_ptr;
> This is non-obvious for an API call.  Suggest having two wrapper
> functions for the two different use cases that share a common internal
> implementation.
I originally had another argument to the function of "contiguous" - but 
found that in both places this function is called, it had both 
contiguous and err_ptr either "1, NULL" or "0, not-NULL". So I thought 
"why not save one argument".

Do you foresee these functions being called from many other places?
>
> e.g.,
>
> int xen_remap_domain_mfn_array(struct vm_area_struct *vma,
> 		       unsigned long addr,
> 		       unsigned long *mfns, int nr,
> 		       int *err_ptr,
>                         pgprot_t prot, unsigned domid)
>
> int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
> 		       unsigned long addr,
> 		       unsigned long start_mfn, unsigned long end_mfn,
> 		       pgprot_t prot, unsigned domid)
The original xen_remap_mfn_range() takes mfn and nr, so I think if we 
have two functions, the original function should remain as before (to 
reduce the amount of changes). It also makes the common function more 
symmetrical between the two cases, as we'd have to back-calculate the 
"nr" argument - we clearly can't know "end_mfn" in the array case.

>
> It would be nice if the API calls had some docs as well (e.g., in
> kernel-doc style).
Yes, that would be nice, wouldn't it. I'll add something.

--
Mats
>
> David
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:03:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:03:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOO4-0000I3-Rw; Fri, 16 Nov 2012 16:03:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZOO3-0000Hs-K2
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 16:03:23 +0000
Received: from [85.158.139.211:6556] by server-8.bemta-5.messagelabs.com id
	1A/2F-06050-AC366A05; Fri, 16 Nov 2012 16:03:22 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353081801!20423345!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12835 invoked from network); 16 Nov 2012 16:03:22 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 16:03:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="44860012"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	16 Nov 2012 16:03:10 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 16 Nov 2012 11:03:09 -0500
Message-ID: <50A663BC.5070703@citrix.com>
Date: Fri, 16 Nov 2012 16:03:08 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: David Vrabel <david.vrabel@citrix.com>
References: <1353077152-29630-1-git-send-email-mats.petersson@citrix.com>
	<50A66032.8090703@citrix.com>
In-Reply-To: <50A66032.8090703@citrix.com>
X-Originating-IP: [10.80.3.146]
Cc: "konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Improve performance of
	IOCTL_PRIVCMD_MMAPBATCH_V2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 15:48, David Vrabel wrote:
> On 16/11/12 14:45, Mats Petersson wrote:
>
> Add "xen/privcmd:" prefix to subject.
>
>> This patch makes the IOCTL_PRIVCMD_MMAPBATCH_V2 (and older V1 version)
>> map multiple (typically 1024) pages at a time rather than one page at a
>> time, despite the pages being non-consecutive MFNs. The main change is
>> to pass a pointer to an array of mfns, rather than one mfn. To support
>> error reporting, we also pass an err_ptr. If err_ptr is NULL, it indicates
>> we want the contiguous pages behaviour, so the mfn value is incremented
>> rather than the pointer itself. Performance of mapping guest memory into
>> Dom0 is improved by a factor of around 6 with this change.
> Can you include details on the test and the raw figures as well?
>
>> Signed-off-by: Mats Petersson <mats.petersson@citrix.com>
>> ---
>>   arch/x86/xen/mmu.c    |   47 ++++++++++++++++++++++++++-------
>>   drivers/xen/privcmd.c |   70 ++++++++++++++++++++++++++++++++++++++++++-------
>>   include/xen/xen-ops.h |    5 ++--
>>   3 files changed, 100 insertions(+), 22 deletions(-)
>>
>> diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
>> index dcf5f2d..c5e23ba 100644
>> --- a/arch/x86/xen/mmu.c
>> +++ b/arch/x86/xen/mmu.c
>> @@ -2477,7 +2477,8 @@ void __init xen_hvm_init_mmu_ops(void)
>>   #define REMAP_BATCH_SIZE 16
>>   
>>   struct remap_data {
>> -	unsigned long mfn;
>> +	unsigned long *mfn;
>> +	int contiguous;
> bool.
>
>>   	pgprot_t prot;
>>   	struct mmu_update *mmu_update;
>>   };
>> @@ -2486,7 +2487,13 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
>>   				 unsigned long addr, void *data)
>>   {
>>   	struct remap_data *rmd = data;
>> -	pte_t pte = pte_mkspecial(pfn_pte(rmd->mfn++, rmd->prot));
>> +	pte_t pte = pte_mkspecial(pfn_pte(*rmd->mfn, rmd->prot));
>> +	/* If we have a contigious range, just update the mfn itself,
>> +	   else update pointer to be "next mfn". */
>> +	if (rmd->contiguous)
>> +		(*rmd->mfn)++;
>> +	else
>> +		rmd->mfn++;
>>   
>>   	rmd->mmu_update->ptr = virt_to_machine(ptep).maddr;
>>   	rmd->mmu_update->val = pte_val_ma(pte);
>> @@ -2495,16 +2502,17 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
>>   	return 0;
>>   }
>>   
>> +
>>   int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
>>   			       unsigned long addr,
>> -			       unsigned long mfn, int nr,
>> -			       pgprot_t prot, unsigned domid)
>> +			       unsigned long *mfn, int nr,
>> +			       int *err_ptr, pgprot_t prot,
>> +			       unsigned domid)
>>   {
>> +	int err;
>>   	struct remap_data rmd;
>>   	struct mmu_update mmu_update[REMAP_BATCH_SIZE];
>> -	int batch;
>>   	unsigned long range;
>> -	int err = 0;
>>   
>>   	if (xen_feature(XENFEAT_auto_translated_physmap))
>>   		return -EINVAL;
>> @@ -2515,9 +2523,15 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
>>   
>>   	rmd.mfn = mfn;
>>   	rmd.prot = prot;
>> +	/* We use the err_ptr to indicate if there we are doing a contigious
>> +	 * mapping or a discontigious mapping. */
>> +	rmd.contiguous = !err_ptr;
> This is non-obvious for an API call.  Suggest having two wrapper
> functions for the two different use cases that share a common internal
> implementation.
I originally had another argument to the function of "contiguous" - but 
found that in both places this function is called, it had both 
contiguous and err_ptr either "1, NULL" or "0, not-NULL". So I thought 
"why not save one argument".

Do you foresee these functions being called from many other places?
>
> e.g.,
>
> int xen_remap_domain_mfn_array(struct vm_area_struct *vma,
> 		       unsigned long addr,
> 		       unsigned long *mfns, int nr,
> 		       int *err_ptr,
>                         pgprot_t prot, unsigned domid)
>
> int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
> 		       unsigned long addr,
> 		       unsigned long start_mfn, unsigned long end_mfn,
> 		       pgprot_t prot, unsigned domid)
The original xen_remap_mfn_range() takes mfn and nr, so I think if we 
have two functions, the original function should remain as before (to 
reduce the amount of changes). It also makes the common function more 
symmetrical between the two cases, as we'd have to back-calculate the 
"nr" argument - we clearly can't know "end_mfn" in the array case.

>
> It would be nice if the API calls had some docs as well (e.g., in
> kernel-doc style).
Yes, that would be nice, wouldn't it. I'll add something.

--
Mats
>
> David
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:07:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:07:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOSI-0000Sc-Ic; Fri, 16 Nov 2012 16:07:46 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZOSH-0000SX-KE
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 16:07:45 +0000
Received: from [193.109.254.147:25586] by server-16.bemta-14.messagelabs.com
	id DC/40-09215-0D466A05; Fri, 16 Nov 2012 16:07:44 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1353082062!4396586!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTcyODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10406 invoked from network); 16 Nov 2012 16:07:43 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-11.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 16:07:43 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGG7ck6009085
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 16:07:38 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGG7b9d014805
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 16:07:38 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGG7bne007131; Fri, 16 Nov 2012 10:07:37 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 08:07:37 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id D9F6140C0E; Fri, 16 Nov 2012 11:07:33 -0500 (EST)
Date: Fri, 16 Nov 2012 11:07:33 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Sander Eikelenboom <linux@eikelenboom.it>
Message-ID: <20121116160733.GO22320@phenom.dumpdata.com>
References: <791265057.20121116134056@eikelenboom.it>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <791265057.20121116134056@eikelenboom.it>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [ 3009.778974] mcelog:16842 map pfn expected
 mapping type write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 16, 2012 at 01:40:56PM +0100, Sander Eikelenboom wrote:
> Hi Konrad,
> 
> Sometime ago i reported this one at boot up:
> 
> [ 3009.778974] mcelog:16842 map pfn expected mapping type write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus
> [ 3009.788570] ------------[ cut here ]------------
> [ 3009.798175] WARNING: at arch/x86/mm/pat.c:774 untrack_pfn+0xa1/0xb0()
> [ 3009.807966] Hardware name: MS-7640
> [ 3009.817677] Modules linked in:
> [ 3009.827524] Pid: 16842, comm: mcelog Tainted: G        W    3.7.0-rc5-20121116-reverted-persistent-warn-patwarn #1
> [ 3009.837415] Call Trace:
> [ 3009.847110]  [<ffffffff810674fa>] warn_slowpath_common+0x7a/0xb0
> [ 3009.856857]  [<ffffffff81067545>] warn_slowpath_null+0x15/0x20
> [ 3009.866562]  [<ffffffff81042041>] untrack_pfn+0xa1/0xb0
> [ 3009.876201]  [<ffffffff8111a59b>] unmap_single_vma+0x86b/0x8e0
> [ 3009.885895]  [<ffffffff81100f16>] ? release_pages+0x196/0x1f0
> [ 3009.895488]  [<ffffffff8111a65c>] unmap_vmas+0x4c/0xa0
> [ 3009.905134]  [<ffffffff8111c8fa>] exit_mmap+0x9a/0x180
> [ 3009.914706]  [<ffffffff81064e72>] mmput+0x52/0xd0
> [ 3009.924252]  [<ffffffff810652b7>] dup_mm+0x3c7/0x510
> [ 3009.933839]  [<ffffffff81065fd5>] copy_process+0xac5/0x14a0
> [ 3009.943430]  [<ffffffff81066af3>] do_fork+0x53/0x360
> [ 3009.952843]  [<ffffffff810b25c7>] ? lock_release+0x117/0x250
> [ 3009.962283]  [<ffffffff817d26c0>] ? _raw_spin_unlock+0x30/0x60
> [ 3009.971532]  [<ffffffff817d3495>] ? sysret_check+0x22/0x5d
> [ 3009.980820]  [<ffffffff81017523>] sys_clone+0x23/0x30
> [ 3009.990046]  [<ffffffff817d37f3>] stub_clone+0x13/0x20
> [ 3009.999335]  [<ffffffff817d3469>] ? system_call_fastpath+0x16/0x1b
> [ 3010.008667] ---[ end trace 2d9694c2c0a24da8 ]---
> 
> 
> It seems to be due to the "mcelog" userspace tool provided with Debian Squeeze (mcelog 1.0~pre3-3  x86-64 Machine Check Exceptions collector and decoder).
> I can trigger this warning easily by restarting the mcelog tool with /etc/init.d/mcelog restart
> 
> Should that one also function with the xen mcelog driver, or is a newer version required ?

The reason we get is b/c I had to disable the PAT functionality in the Linux kernel for Xen.
This is b/c it only worked one way - meaning you could convert a page from
WriteBack to WriteCombine or WriteBack to Uncached. But you could not
do WriteCombine back to WriteBack - due to one of the functions that
changes the bits was using an "unfiltered" way to identify the bits on the
page.

Anyhow, we had a disaster b/c some of these pages that used to WriteBack (WB)
got converted to WriteCombine (WC) and then were returned back as such
to the page pool. And if they were re-used by filesystem invariably we got
corruptions.

So until the PAT table lookup thing that Peter H. Anvin suggested
gets implemented this splat gotta show up :-(

Does mcelog still work even with this warning?
> 
> --
> Sander

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:07:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:07:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOSI-0000Sc-Ic; Fri, 16 Nov 2012 16:07:46 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZOSH-0000SX-KE
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 16:07:45 +0000
Received: from [193.109.254.147:25586] by server-16.bemta-14.messagelabs.com
	id DC/40-09215-0D466A05; Fri, 16 Nov 2012 16:07:44 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1353082062!4396586!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTcyODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10406 invoked from network); 16 Nov 2012 16:07:43 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-11.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 16:07:43 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGG7ck6009085
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 16:07:38 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGG7b9d014805
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 16:07:38 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGG7bne007131; Fri, 16 Nov 2012 10:07:37 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 08:07:37 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id D9F6140C0E; Fri, 16 Nov 2012 11:07:33 -0500 (EST)
Date: Fri, 16 Nov 2012 11:07:33 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Sander Eikelenboom <linux@eikelenboom.it>
Message-ID: <20121116160733.GO22320@phenom.dumpdata.com>
References: <791265057.20121116134056@eikelenboom.it>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <791265057.20121116134056@eikelenboom.it>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [ 3009.778974] mcelog:16842 map pfn expected
 mapping type write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 16, 2012 at 01:40:56PM +0100, Sander Eikelenboom wrote:
> Hi Konrad,
> 
> Sometime ago i reported this one at boot up:
> 
> [ 3009.778974] mcelog:16842 map pfn expected mapping type write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus
> [ 3009.788570] ------------[ cut here ]------------
> [ 3009.798175] WARNING: at arch/x86/mm/pat.c:774 untrack_pfn+0xa1/0xb0()
> [ 3009.807966] Hardware name: MS-7640
> [ 3009.817677] Modules linked in:
> [ 3009.827524] Pid: 16842, comm: mcelog Tainted: G        W    3.7.0-rc5-20121116-reverted-persistent-warn-patwarn #1
> [ 3009.837415] Call Trace:
> [ 3009.847110]  [<ffffffff810674fa>] warn_slowpath_common+0x7a/0xb0
> [ 3009.856857]  [<ffffffff81067545>] warn_slowpath_null+0x15/0x20
> [ 3009.866562]  [<ffffffff81042041>] untrack_pfn+0xa1/0xb0
> [ 3009.876201]  [<ffffffff8111a59b>] unmap_single_vma+0x86b/0x8e0
> [ 3009.885895]  [<ffffffff81100f16>] ? release_pages+0x196/0x1f0
> [ 3009.895488]  [<ffffffff8111a65c>] unmap_vmas+0x4c/0xa0
> [ 3009.905134]  [<ffffffff8111c8fa>] exit_mmap+0x9a/0x180
> [ 3009.914706]  [<ffffffff81064e72>] mmput+0x52/0xd0
> [ 3009.924252]  [<ffffffff810652b7>] dup_mm+0x3c7/0x510
> [ 3009.933839]  [<ffffffff81065fd5>] copy_process+0xac5/0x14a0
> [ 3009.943430]  [<ffffffff81066af3>] do_fork+0x53/0x360
> [ 3009.952843]  [<ffffffff810b25c7>] ? lock_release+0x117/0x250
> [ 3009.962283]  [<ffffffff817d26c0>] ? _raw_spin_unlock+0x30/0x60
> [ 3009.971532]  [<ffffffff817d3495>] ? sysret_check+0x22/0x5d
> [ 3009.980820]  [<ffffffff81017523>] sys_clone+0x23/0x30
> [ 3009.990046]  [<ffffffff817d37f3>] stub_clone+0x13/0x20
> [ 3009.999335]  [<ffffffff817d3469>] ? system_call_fastpath+0x16/0x1b
> [ 3010.008667] ---[ end trace 2d9694c2c0a24da8 ]---
> 
> 
> It seems to be due to the "mcelog" userspace tool provided with Debian Squeeze (mcelog 1.0~pre3-3  x86-64 Machine Check Exceptions collector and decoder).
> I can trigger this warning easily by restarting the mcelog tool with /etc/init.d/mcelog restart
> 
> Should that one also function with the xen mcelog driver, or is a newer version required ?

The reason we get is b/c I had to disable the PAT functionality in the Linux kernel for Xen.
This is b/c it only worked one way - meaning you could convert a page from
WriteBack to WriteCombine or WriteBack to Uncached. But you could not
do WriteCombine back to WriteBack - due to one of the functions that
changes the bits was using an "unfiltered" way to identify the bits on the
page.

Anyhow, we had a disaster b/c some of these pages that used to WriteBack (WB)
got converted to WriteCombine (WC) and then were returned back as such
to the page pool. And if they were re-used by filesystem invariably we got
corruptions.

So until the PAT table lookup thing that Peter H. Anvin suggested
gets implemented this splat gotta show up :-(

Does mcelog still work even with this warning?
> 
> --
> Sander

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:09:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:09:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOU7-0000aR-8Z; Fri, 16 Nov 2012 16:09:39 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZOU5-0000aJ-BC
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 16:09:37 +0000
Received: from [85.158.143.35:36806] by server-3.bemta-4.messagelabs.com id
	58/43-06841-04566A05; Fri, 16 Nov 2012 16:09:36 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1353082174!10173713!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2ODgwNw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18602 invoked from network); 16 Nov 2012 16:09:35 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-10.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 16:09:35 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGG9SYt010285
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 16:09:29 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGG9SaI007626
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 16:09:28 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGG9R3R008527; Fri, 16 Nov 2012 10:09:27 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 08:09:27 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id DA1A140C0E; Fri, 16 Nov 2012 11:09:23 -0500 (EST)
Date: Fri, 16 Nov 2012 11:09:23 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Tushar Behera <tushar.behera@linaro.org>
Message-ID: <20121116160923.GP22320@phenom.dumpdata.com>
References: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
	<1353048646-10935-10-git-send-email-tushar.behera@linaro.org>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353048646-10935-10-git-send-email-tushar.behera@linaro.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Jeremy Fitzhardinge <jeremy@goop.org>, xen-devel@lists.xensource.com,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, patches@linaro.org
Subject: Re: [Xen-devel] [PATCH 09/14] xen: events: Remove redundant check
 on unsigned variable
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 16, 2012 at 12:20:41PM +0530, Tushar Behera wrote:
> No need to check whether unsigned variable is less than 0.
> 
> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

> CC: Jeremy Fitzhardinge <jeremy@goop.org>
> CC: xen-devel@lists.xensource.com
> CC: virtualization@lists.linux-foundation.org
> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
> ---
>  drivers/xen/events.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
> index 4293c57..cadd7d1 100644
> --- a/drivers/xen/events.c
> +++ b/drivers/xen/events.c
> @@ -216,7 +216,7 @@ static void xen_irq_info_pirq_init(unsigned irq,
>   */
>  static unsigned int evtchn_from_irq(unsigned irq)
>  {
> -	if (unlikely(WARN(irq < 0 || irq >= nr_irqs, "Invalid irq %d!\n", irq)))
> +	if (unlikely(WARN(irq >= nr_irqs, "Invalid irq %d!\n", irq)))
>  		return 0;
>  
>  	return info_for_irq(irq)->evtchn;
> -- 
> 1.7.4.1

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:09:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:09:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOU7-0000aR-8Z; Fri, 16 Nov 2012 16:09:39 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZOU5-0000aJ-BC
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 16:09:37 +0000
Received: from [85.158.143.35:36806] by server-3.bemta-4.messagelabs.com id
	58/43-06841-04566A05; Fri, 16 Nov 2012 16:09:36 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1353082174!10173713!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2ODgwNw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18602 invoked from network); 16 Nov 2012 16:09:35 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-10.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 16:09:35 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGG9SYt010285
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 16:09:29 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGG9SaI007626
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 16:09:28 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGG9R3R008527; Fri, 16 Nov 2012 10:09:27 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 08:09:27 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id DA1A140C0E; Fri, 16 Nov 2012 11:09:23 -0500 (EST)
Date: Fri, 16 Nov 2012 11:09:23 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Tushar Behera <tushar.behera@linaro.org>
Message-ID: <20121116160923.GP22320@phenom.dumpdata.com>
References: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
	<1353048646-10935-10-git-send-email-tushar.behera@linaro.org>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353048646-10935-10-git-send-email-tushar.behera@linaro.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Jeremy Fitzhardinge <jeremy@goop.org>, xen-devel@lists.xensource.com,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, patches@linaro.org
Subject: Re: [Xen-devel] [PATCH 09/14] xen: events: Remove redundant check
 on unsigned variable
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 16, 2012 at 12:20:41PM +0530, Tushar Behera wrote:
> No need to check whether unsigned variable is less than 0.
> 
> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

> CC: Jeremy Fitzhardinge <jeremy@goop.org>
> CC: xen-devel@lists.xensource.com
> CC: virtualization@lists.linux-foundation.org
> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
> ---
>  drivers/xen/events.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
> index 4293c57..cadd7d1 100644
> --- a/drivers/xen/events.c
> +++ b/drivers/xen/events.c
> @@ -216,7 +216,7 @@ static void xen_irq_info_pirq_init(unsigned irq,
>   */
>  static unsigned int evtchn_from_irq(unsigned irq)
>  {
> -	if (unlikely(WARN(irq < 0 || irq >= nr_irqs, "Invalid irq %d!\n", irq)))
> +	if (unlikely(WARN(irq >= nr_irqs, "Invalid irq %d!\n", irq)))
>  		return 0;
>  
>  	return info_for_irq(irq)->evtchn;
> -- 
> 1.7.4.1

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:16:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:16:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOac-00013Q-Pb; Fri, 16 Nov 2012 16:16:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZOaa-00013K-R9
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 16:16:21 +0000
Received: from [85.158.137.99:21427] by server-7.bemta-3.messagelabs.com id
	1F/AB-01713-3D666A05; Fri, 16 Nov 2012 16:16:19 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353082578!19308896!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3189 invoked from network); 16 Nov 2012 16:16:18 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 16:16:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="15855024"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 16:16:17 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 16:16:17 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TZOaX-0000SU-Hh; Fri, 16 Nov 2012 16:16:17 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TZOaX-0005Wy-D7;
	Fri, 16 Nov 2012 16:16:17 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20646.26321.290469.760236@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 16:16:17 +0000
To: Andrew Cooper <andrew.cooper3@citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <50A24757.30402@citrix.com>
References: <E1TYG2A-0000z4-Uh@xenbits.xen.org>
	<50A24757.30402@citrix.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] Re: Xen Security Advisory 20 (CVE-2012-4535) -
 Timer overflow DoS vulnerability - Further bugfixes
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Andrew Cooper writes ("Re: [Xen-devel] Xen Security Advisory 20 (CVE-2012-4535) - Timer overflow DoS vulnerability - Further bugfixes"):
> Now this vulnerability has been publicly disclosed, here are 3 further
> related bugfixes which are not security problems themselves.

This seems to have been dropped.  I have added [PATCH] to the Subject.

Ian.

> common/timers: Prevent guests timeouts which would overflow timer calculations
> 
> None of these have security implications, but will cause the timers to
> expire instantly, rather than a long time into the future.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> diff -r e0361d2401bb xen/common/domain.c
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -896,6 +896,9 @@ long do_vcpu_op(int cmd, int vcpuid, XEN
>          if ( copy_from_guest(&set, arg, 1) )
>              return -EFAULT;
>  
> +        if ( set.timeout_abs_ns > STIME_MAX )
> +            return -EINVAL;
> +
>          if ( (set.flags & VCPU_SSHOTTMR_future) &&
>               (set.timeout_abs_ns < NOW()) )
>              return -ETIME;
> diff -r e0361d2401bb xen/common/schedule.c
> --- a/xen/common/schedule.c
> +++ b/xen/common/schedule.c
> @@ -739,6 +739,9 @@ static long do_poll(struct sched_poll *s
>      if ( sched_poll->nr_ports > 128 )
>          return -EINVAL;
>  
> +    if ( sched_poll->timeout > STIME_MAX )
> +        return -EINVAL;
> +
>      if ( !guest_handle_okay(sched_poll->ports, sched_poll->nr_ports) )
>          return -EFAULT;
>  
> @@ -829,6 +832,9 @@ static long domain_watchdog(struct domai
>      if ( id > NR_DOMAIN_WATCHDOG_TIMERS )
>          return -EINVAL;
>  
> +    if ( SECONDS(timeout) > STIME_DELTA_MAX )
> +        return -EINVAL;
> +
>      spin_lock(&d->watchdog_lock);
>  
>      if ( id == 0 )
> 
> ----------------------------------------------------------------------
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:16:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:16:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOac-00013Q-Pb; Fri, 16 Nov 2012 16:16:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZOaa-00013K-R9
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 16:16:21 +0000
Received: from [85.158.137.99:21427] by server-7.bemta-3.messagelabs.com id
	1F/AB-01713-3D666A05; Fri, 16 Nov 2012 16:16:19 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353082578!19308896!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3189 invoked from network); 16 Nov 2012 16:16:18 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 16:16:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="15855024"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 16:16:17 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 16:16:17 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TZOaX-0000SU-Hh; Fri, 16 Nov 2012 16:16:17 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TZOaX-0005Wy-D7;
	Fri, 16 Nov 2012 16:16:17 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20646.26321.290469.760236@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 16:16:17 +0000
To: Andrew Cooper <andrew.cooper3@citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <50A24757.30402@citrix.com>
References: <E1TYG2A-0000z4-Uh@xenbits.xen.org>
	<50A24757.30402@citrix.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] Re: Xen Security Advisory 20 (CVE-2012-4535) -
 Timer overflow DoS vulnerability - Further bugfixes
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Andrew Cooper writes ("Re: [Xen-devel] Xen Security Advisory 20 (CVE-2012-4535) - Timer overflow DoS vulnerability - Further bugfixes"):
> Now this vulnerability has been publicly disclosed, here are 3 further
> related bugfixes which are not security problems themselves.

This seems to have been dropped.  I have added [PATCH] to the Subject.

Ian.

> common/timers: Prevent guests timeouts which would overflow timer calculations
> 
> None of these have security implications, but will cause the timers to
> expire instantly, rather than a long time into the future.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> diff -r e0361d2401bb xen/common/domain.c
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -896,6 +896,9 @@ long do_vcpu_op(int cmd, int vcpuid, XEN
>          if ( copy_from_guest(&set, arg, 1) )
>              return -EFAULT;
>  
> +        if ( set.timeout_abs_ns > STIME_MAX )
> +            return -EINVAL;
> +
>          if ( (set.flags & VCPU_SSHOTTMR_future) &&
>               (set.timeout_abs_ns < NOW()) )
>              return -ETIME;
> diff -r e0361d2401bb xen/common/schedule.c
> --- a/xen/common/schedule.c
> +++ b/xen/common/schedule.c
> @@ -739,6 +739,9 @@ static long do_poll(struct sched_poll *s
>      if ( sched_poll->nr_ports > 128 )
>          return -EINVAL;
>  
> +    if ( sched_poll->timeout > STIME_MAX )
> +        return -EINVAL;
> +
>      if ( !guest_handle_okay(sched_poll->ports, sched_poll->nr_ports) )
>          return -EFAULT;
>  
> @@ -829,6 +832,9 @@ static long domain_watchdog(struct domai
>      if ( id > NR_DOMAIN_WATCHDOG_TIMERS )
>          return -EINVAL;
>  
> +    if ( SECONDS(timeout) > STIME_DELTA_MAX )
> +        return -EINVAL;
> +
>      spin_lock(&d->watchdog_lock);
>  
>      if ( id == 0 )
> 
> ----------------------------------------------------------------------
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:18:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:18:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOcc-0001Da-F0; Fri, 16 Nov 2012 16:18:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZOcb-0001DP-SF
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 16:18:26 +0000
Received: from [85.158.139.83:22861] by server-14.bemta-5.messagelabs.com id
	9D/D2-21768-15766A05; Fri, 16 Nov 2012 16:18:25 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1353082704!30629766!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11037 invoked from network); 16 Nov 2012 16:18:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 16:18:24 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="15855082"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 16:18:24 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 16:18:23 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TZOcZ-0000TL-UL; Fri, 16 Nov 2012 16:18:23 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TZOcZ-0005XN-Pw;
	Fri, 16 Nov 2012 16:18:23 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20646.26443.690228.204535@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 16:18:19 +0000
To: Roger Pau Monne <roger.pau@citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <1352822539-56930-1-git-send-email-roger.pau@citrix.com>
References: <1352822539-56930-1-git-send-email-roger.pau@citrix.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] qemu-stubdom: prevent useless medium change
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Roger Pau Monne writes ("[Xen-devel] [PATCH] qemu-stubdom: prevent useless medium change"):
> qemu-stubdom was stripping the prefix from the "params" xenstore
> key in xenstore_parse_domain_config, which was then saved stripped in
> a variable. In xenstore_process_event we compare the "param" from
> xenstore (not stripped) with the stripped "param" saved in the
> variable, which leads to a medium change (even if there isn't any),
> since we are comparing something like aio:/path/to/file with
> /path/to/file. This only happens one time, since
> xenstore_parse_domain_config is the only place where we strip the
> prefix. The result of this bug is the following:

I have been thinking about this.

The reason I'm reluctant to apply this patch is that I'm worried it
might cause some non-stubdom-related breakage.  I know it feels EBW,
but perhaps the answer is _more_ #ifdef STUBDOM rather than less ?

Or do you think I should just read the code closely enough to
understand it and your patch ?  I suspect it's a can of worms...

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:18:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:18:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZOcc-0001Da-F0; Fri, 16 Nov 2012 16:18:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZOcb-0001DP-SF
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 16:18:26 +0000
Received: from [85.158.139.83:22861] by server-14.bemta-5.messagelabs.com id
	9D/D2-21768-15766A05; Fri, 16 Nov 2012 16:18:25 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1353082704!30629766!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11037 invoked from network); 16 Nov 2012 16:18:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-3.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 16:18:24 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="15855082"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 16:18:24 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 16:18:23 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TZOcZ-0000TL-UL; Fri, 16 Nov 2012 16:18:23 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TZOcZ-0005XN-Pw;
	Fri, 16 Nov 2012 16:18:23 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20646.26443.690228.204535@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 16:18:19 +0000
To: Roger Pau Monne <roger.pau@citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <1352822539-56930-1-git-send-email-roger.pau@citrix.com>
References: <1352822539-56930-1-git-send-email-roger.pau@citrix.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] qemu-stubdom: prevent useless medium change
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Roger Pau Monne writes ("[Xen-devel] [PATCH] qemu-stubdom: prevent useless medium change"):
> qemu-stubdom was stripping the prefix from the "params" xenstore
> key in xenstore_parse_domain_config, which was then saved stripped in
> a variable. In xenstore_process_event we compare the "param" from
> xenstore (not stripped) with the stripped "param" saved in the
> variable, which leads to a medium change (even if there isn't any),
> since we are comparing something like aio:/path/to/file with
> /path/to/file. This only happens one time, since
> xenstore_parse_domain_config is the only place where we strip the
> prefix. The result of this bug is the following:

I have been thinking about this.

The reason I'm reluctant to apply this patch is that I'm worried it
might cause some non-stubdom-related breakage.  I know it feels EBW,
but perhaps the answer is _more_ #ifdef STUBDOM rather than less ?

Or do you think I should just read the code closely enough to
understand it and your patch ?  I suspect it's a can of worms...

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:48:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:48:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZP5H-00022H-5z; Fri, 16 Nov 2012 16:48:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1TZP5F-00022C-9o
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 16:48:02 +0000
Received: from [85.158.138.51:22302] by server-16.bemta-3.messagelabs.com id
	82/45-07461-04E66A05; Fri, 16 Nov 2012 16:48:00 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-11.tower-174.messagelabs.com!1353084479!30330459!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2591 invoked from network); 16 Nov 2012 16:47:59 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-11.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Nov 2012 16:47:59 -0000
Received: from 68-64-ftth.on.nl ([88.159.64.68]:57569 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1TZP88-0007ko-Sx; Fri, 16 Nov 2012 17:51:01 +0100
Date: Fri, 16 Nov 2012 17:47:54 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <1422434855.20121116174754@eikelenboom.it>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
In-Reply-To: <20121116160733.GO22320@phenom.dumpdata.com>
References: <791265057.20121116134056@eikelenboom.it>
	<20121116160733.GO22320@phenom.dumpdata.com>
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [ 3009.778974] mcelog:16842 map pfn expected
	mapping type write-back for [mem 0x0009f000-0x000a0fff],
	got uncached-minus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


Friday, November 16, 2012, 5:07:33 PM, you wrote:

> On Fri, Nov 16, 2012 at 01:40:56PM +0100, Sander Eikelenboom wrote:
>> Hi Konrad,
>> 
>> Sometime ago i reported this one at boot up:
>> 
>> [ 3009.778974] mcelog:16842 map pfn expected mapping type write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus
>> [ 3009.788570] ------------[ cut here ]------------
>> [ 3009.798175] WARNING: at arch/x86/mm/pat.c:774 untrack_pfn+0xa1/0xb0()
>> [ 3009.807966] Hardware name: MS-7640
>> [ 3009.817677] Modules linked in:
>> [ 3009.827524] Pid: 16842, comm: mcelog Tainted: G        W    3.7.0-rc5-20121116-reverted-persistent-warn-patwarn #1
>> [ 3009.837415] Call Trace:
>> [ 3009.847110]  [<ffffffff810674fa>] warn_slowpath_common+0x7a/0xb0
>> [ 3009.856857]  [<ffffffff81067545>] warn_slowpath_null+0x15/0x20
>> [ 3009.866562]  [<ffffffff81042041>] untrack_pfn+0xa1/0xb0
>> [ 3009.876201]  [<ffffffff8111a59b>] unmap_single_vma+0x86b/0x8e0
>> [ 3009.885895]  [<ffffffff81100f16>] ? release_pages+0x196/0x1f0
>> [ 3009.895488]  [<ffffffff8111a65c>] unmap_vmas+0x4c/0xa0
>> [ 3009.905134]  [<ffffffff8111c8fa>] exit_mmap+0x9a/0x180
>> [ 3009.914706]  [<ffffffff81064e72>] mmput+0x52/0xd0
>> [ 3009.924252]  [<ffffffff810652b7>] dup_mm+0x3c7/0x510
>> [ 3009.933839]  [<ffffffff81065fd5>] copy_process+0xac5/0x14a0
>> [ 3009.943430]  [<ffffffff81066af3>] do_fork+0x53/0x360
>> [ 3009.952843]  [<ffffffff810b25c7>] ? lock_release+0x117/0x250
>> [ 3009.962283]  [<ffffffff817d26c0>] ? _raw_spin_unlock+0x30/0x60
>> [ 3009.971532]  [<ffffffff817d3495>] ? sysret_check+0x22/0x5d
>> [ 3009.980820]  [<ffffffff81017523>] sys_clone+0x23/0x30
>> [ 3009.990046]  [<ffffffff817d37f3>] stub_clone+0x13/0x20
>> [ 3009.999335]  [<ffffffff817d3469>] ? system_call_fastpath+0x16/0x1b
>> [ 3010.008667] ---[ end trace 2d9694c2c0a24da8 ]---
>> 
>> 
>> It seems to be due to the "mcelog" userspace tool provided with Debian Squeeze (mcelog 1.0~pre3-3  x86-64 Machine Check Exceptions collector and decoder).
>> I can trigger this warning easily by restarting the mcelog tool with /etc/init.d/mcelog restart
>> 
>> Should that one also function with the xen mcelog driver, or is a newer version required ?

> The reason we get is b/c I had to disable the PAT functionality in the Linux kernel for Xen.
> This is b/c it only worked one way - meaning you could convert a page from
> WriteBack to WriteCombine or WriteBack to Uncached. But you could not
> do WriteCombine back to WriteBack - due to one of the functions that
> changes the bits was using an "unfiltered" way to identify the bits on the
> page.

> Anyhow, we had a disaster b/c some of these pages that used to WriteBack (WB)
> got converted to WriteCombine (WC) and then were returned back as such
> to the page pool. And if they were re-used by filesystem invariably we got
> corruptions.

> So until the PAT table lookup thing that Peter H. Anvin suggested
> gets implemented this splat gotta show up :-(

Not a big problem for me, i was just wondering :-)
I'm more interested in the netfront troubles, since it's already rc5.

> Does mcelog still work even with this warning?

Not the daemon:

serveerstertje:~# sh /etc/init.d/mcelog start
Starting Machine Check Exceptions decoder: daemon: Cannot allocate memory


>> 
>> --
>> Sander



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:48:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:48:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZP5H-00022H-5z; Fri, 16 Nov 2012 16:48:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1TZP5F-00022C-9o
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 16:48:02 +0000
Received: from [85.158.138.51:22302] by server-16.bemta-3.messagelabs.com id
	82/45-07461-04E66A05; Fri, 16 Nov 2012 16:48:00 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-11.tower-174.messagelabs.com!1353084479!30330459!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2591 invoked from network); 16 Nov 2012 16:47:59 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-11.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Nov 2012 16:47:59 -0000
Received: from 68-64-ftth.on.nl ([88.159.64.68]:57569 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1TZP88-0007ko-Sx; Fri, 16 Nov 2012 17:51:01 +0100
Date: Fri, 16 Nov 2012 17:47:54 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <1422434855.20121116174754@eikelenboom.it>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
In-Reply-To: <20121116160733.GO22320@phenom.dumpdata.com>
References: <791265057.20121116134056@eikelenboom.it>
	<20121116160733.GO22320@phenom.dumpdata.com>
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [ 3009.778974] mcelog:16842 map pfn expected
	mapping type write-back for [mem 0x0009f000-0x000a0fff],
	got uncached-minus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


Friday, November 16, 2012, 5:07:33 PM, you wrote:

> On Fri, Nov 16, 2012 at 01:40:56PM +0100, Sander Eikelenboom wrote:
>> Hi Konrad,
>> 
>> Sometime ago i reported this one at boot up:
>> 
>> [ 3009.778974] mcelog:16842 map pfn expected mapping type write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus
>> [ 3009.788570] ------------[ cut here ]------------
>> [ 3009.798175] WARNING: at arch/x86/mm/pat.c:774 untrack_pfn+0xa1/0xb0()
>> [ 3009.807966] Hardware name: MS-7640
>> [ 3009.817677] Modules linked in:
>> [ 3009.827524] Pid: 16842, comm: mcelog Tainted: G        W    3.7.0-rc5-20121116-reverted-persistent-warn-patwarn #1
>> [ 3009.837415] Call Trace:
>> [ 3009.847110]  [<ffffffff810674fa>] warn_slowpath_common+0x7a/0xb0
>> [ 3009.856857]  [<ffffffff81067545>] warn_slowpath_null+0x15/0x20
>> [ 3009.866562]  [<ffffffff81042041>] untrack_pfn+0xa1/0xb0
>> [ 3009.876201]  [<ffffffff8111a59b>] unmap_single_vma+0x86b/0x8e0
>> [ 3009.885895]  [<ffffffff81100f16>] ? release_pages+0x196/0x1f0
>> [ 3009.895488]  [<ffffffff8111a65c>] unmap_vmas+0x4c/0xa0
>> [ 3009.905134]  [<ffffffff8111c8fa>] exit_mmap+0x9a/0x180
>> [ 3009.914706]  [<ffffffff81064e72>] mmput+0x52/0xd0
>> [ 3009.924252]  [<ffffffff810652b7>] dup_mm+0x3c7/0x510
>> [ 3009.933839]  [<ffffffff81065fd5>] copy_process+0xac5/0x14a0
>> [ 3009.943430]  [<ffffffff81066af3>] do_fork+0x53/0x360
>> [ 3009.952843]  [<ffffffff810b25c7>] ? lock_release+0x117/0x250
>> [ 3009.962283]  [<ffffffff817d26c0>] ? _raw_spin_unlock+0x30/0x60
>> [ 3009.971532]  [<ffffffff817d3495>] ? sysret_check+0x22/0x5d
>> [ 3009.980820]  [<ffffffff81017523>] sys_clone+0x23/0x30
>> [ 3009.990046]  [<ffffffff817d37f3>] stub_clone+0x13/0x20
>> [ 3009.999335]  [<ffffffff817d3469>] ? system_call_fastpath+0x16/0x1b
>> [ 3010.008667] ---[ end trace 2d9694c2c0a24da8 ]---
>> 
>> 
>> It seems to be due to the "mcelog" userspace tool provided with Debian Squeeze (mcelog 1.0~pre3-3  x86-64 Machine Check Exceptions collector and decoder).
>> I can trigger this warning easily by restarting the mcelog tool with /etc/init.d/mcelog restart
>> 
>> Should that one also function with the xen mcelog driver, or is a newer version required ?

> The reason we get is b/c I had to disable the PAT functionality in the Linux kernel for Xen.
> This is b/c it only worked one way - meaning you could convert a page from
> WriteBack to WriteCombine or WriteBack to Uncached. But you could not
> do WriteCombine back to WriteBack - due to one of the functions that
> changes the bits was using an "unfiltered" way to identify the bits on the
> page.

> Anyhow, we had a disaster b/c some of these pages that used to WriteBack (WB)
> got converted to WriteCombine (WC) and then were returned back as such
> to the page pool. And if they were re-used by filesystem invariably we got
> corruptions.

> So until the PAT table lookup thing that Peter H. Anvin suggested
> gets implemented this splat gotta show up :-(

Not a big problem for me, i was just wondering :-)
I'm more interested in the netfront troubles, since it's already rc5.

> Does mcelog still work even with this warning?

Not the daemon:

serveerstertje:~# sh /etc/init.d/mcelog start
Starting Machine Check Exceptions decoder: daemon: Cannot allocate memory


>> 
>> --
>> Sander



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:52:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:52:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZP8r-0002FX-Tt; Fri, 16 Nov 2012 16:51:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TZP8q-0002FQ-DT
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 16:51:44 +0000
Received: from [85.158.139.83:57520] by server-9.bemta-5.messagelabs.com id
	D5/88-29295-F1F66A05; Fri, 16 Nov 2012 16:51:43 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1353084702!22027654!1
X-Originating-IP: [209.85.214.45]
X-SpamReason: No, hits=0.5 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,RCVD_ILLEGAL_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4565 invoked from network); 16 Nov 2012 16:51:42 -0000
Received: from mail-bk0-f45.google.com (HELO mail-bk0-f45.google.com)
	(209.85.214.45)
	by server-16.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 16:51:42 -0000
Received: by mail-bk0-f45.google.com with SMTP id jk13so408563bkc.32
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 08:51:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	bh=RKqrg8WEbDZEUr8OCBHu0N/ZTdCYvsNHzp+BOVe0XXc=;
	b=pL9z2G9fWEysG21rpnAAN437r7DSEUjrBFcF73Vf8vWig+hN6aKvC2U7xp2Gbzsiqi
	mz2E2WeF7VR7gjddYS82SjQHgixPxOdl64q+Mi0iQfyPHSjqVY6DQNZE2ZGUjM2+ftt2
	wmXK4L1Q7F2Z9GmXq15upbaEu2gR0ttFCCKuvxjq2gV0hvK2AtVsUvxgVFviKf2Pcn6v
	HvFspWLeB1G45hG7nC6+CJPcrMVbxSu68cfw7owaKh/p5HlIJBbK30Awb51SvGIcaFw4
	yWWoEAVJn9HrmVQOuK14+oFSJ5h4zJhv8yJ1F7bHUaFhu5urwjmPz0A4FvCQ7HdDer9o
	WcSA==
Received: by 10.204.3.211 with SMTP id 19mr2197192bko.99.1353084702478;
	Fri, 16 Nov 2012 08:51:42 -0800 (PST)
Received: from [192.168.0.101] (5-14-136-174.residential.rdsnet.ro.
	[5.14.136.174])
	by mx.google.com with ESMTPS id go4sm1626954bkc.15.2012.11.16.08.51.41
	(version=SSLv3 cipher=OTHER); Fri, 16 Nov 2012 08:51:41 -0800 (PST)
Message-ID: <50A66F1D.1060304@gmail.com>
Date: Fri, 16 Nov 2012 18:51:41 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.10) Gecko/20121106 Thunderbird/10.0.10
MIME-Version: 1.0
To: Steven Maresca <steve@zentific.com>
References: <50A16639.2090209@gmail.com>
	<1352800791.7491.21.camel@zakaz.uk.xensource.com>
	<50A22044.6060608@gmail.com>
	<1352802973.7491.40.camel@zakaz.uk.xensource.com>
	<50A225CA.2080705@gmail.com>
	<1352805173.7491.57.camel@zakaz.uk.xensource.com>
	<50A22DD7.7020901@gmail.com>
	<CANSvah4437FvmZe-uvcrZOvC2NJ7hZUE8y9DUFUd29BWPHRc6g@mail.gmail.com>
In-Reply-To: <CANSvah4437FvmZe-uvcrZOvC2NJ7hZUE8y9DUFUd29BWPHRc6g@mail.gmail.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> FYI, vmitools (LibVMI) does have support for memory events, just not
> in the main branch. The events branch works properly for 4.1.x; I have
> updated it to support 4.2, but due to other more pressing matters, I
> have not had time to commit it to the main branch.

It compiled fine on my Gentoo box, I think the problem I reported before
(compilation errors on an up-to-date Arch Linux box) were due to the
fact that the default Xen version on Arch Linux is 4.2, and I've got Xen
4.1 installed on my home Gentoo machine.

Please let us know when event support for Xen 4.2 is added, I'm sure
there are quite a few of us interested in that.

Thanks,
Razvan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:52:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:52:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZP8r-0002FX-Tt; Fri, 16 Nov 2012 16:51:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TZP8q-0002FQ-DT
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 16:51:44 +0000
Received: from [85.158.139.83:57520] by server-9.bemta-5.messagelabs.com id
	D5/88-29295-F1F66A05; Fri, 16 Nov 2012 16:51:43 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1353084702!22027654!1
X-Originating-IP: [209.85.214.45]
X-SpamReason: No, hits=0.5 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,RCVD_ILLEGAL_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4565 invoked from network); 16 Nov 2012 16:51:42 -0000
Received: from mail-bk0-f45.google.com (HELO mail-bk0-f45.google.com)
	(209.85.214.45)
	by server-16.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 16:51:42 -0000
Received: by mail-bk0-f45.google.com with SMTP id jk13so408563bkc.32
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 08:51:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	bh=RKqrg8WEbDZEUr8OCBHu0N/ZTdCYvsNHzp+BOVe0XXc=;
	b=pL9z2G9fWEysG21rpnAAN437r7DSEUjrBFcF73Vf8vWig+hN6aKvC2U7xp2Gbzsiqi
	mz2E2WeF7VR7gjddYS82SjQHgixPxOdl64q+Mi0iQfyPHSjqVY6DQNZE2ZGUjM2+ftt2
	wmXK4L1Q7F2Z9GmXq15upbaEu2gR0ttFCCKuvxjq2gV0hvK2AtVsUvxgVFviKf2Pcn6v
	HvFspWLeB1G45hG7nC6+CJPcrMVbxSu68cfw7owaKh/p5HlIJBbK30Awb51SvGIcaFw4
	yWWoEAVJn9HrmVQOuK14+oFSJ5h4zJhv8yJ1F7bHUaFhu5urwjmPz0A4FvCQ7HdDer9o
	WcSA==
Received: by 10.204.3.211 with SMTP id 19mr2197192bko.99.1353084702478;
	Fri, 16 Nov 2012 08:51:42 -0800 (PST)
Received: from [192.168.0.101] (5-14-136-174.residential.rdsnet.ro.
	[5.14.136.174])
	by mx.google.com with ESMTPS id go4sm1626954bkc.15.2012.11.16.08.51.41
	(version=SSLv3 cipher=OTHER); Fri, 16 Nov 2012 08:51:41 -0800 (PST)
Message-ID: <50A66F1D.1060304@gmail.com>
Date: Fri, 16 Nov 2012 18:51:41 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.10) Gecko/20121106 Thunderbird/10.0.10
MIME-Version: 1.0
To: Steven Maresca <steve@zentific.com>
References: <50A16639.2090209@gmail.com>
	<1352800791.7491.21.camel@zakaz.uk.xensource.com>
	<50A22044.6060608@gmail.com>
	<1352802973.7491.40.camel@zakaz.uk.xensource.com>
	<50A225CA.2080705@gmail.com>
	<1352805173.7491.57.camel@zakaz.uk.xensource.com>
	<50A22DD7.7020901@gmail.com>
	<CANSvah4437FvmZe-uvcrZOvC2NJ7hZUE8y9DUFUd29BWPHRc6g@mail.gmail.com>
In-Reply-To: <CANSvah4437FvmZe-uvcrZOvC2NJ7hZUE8y9DUFUd29BWPHRc6g@mail.gmail.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Hypervisor to dom0 communication
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> FYI, vmitools (LibVMI) does have support for memory events, just not
> in the main branch. The events branch works properly for 4.1.x; I have
> updated it to support 4.2, but due to other more pressing matters, I
> have not had time to commit it to the main branch.

It compiled fine on my Gentoo box, I think the problem I reported before
(compilation errors on an up-to-date Arch Linux box) were due to the
fact that the default Xen version on Arch Linux is 4.2, and I've got Xen
4.1 installed on my home Gentoo machine.

Please let us know when event support for Xen 4.2 is added, I'm sure
there are quite a few of us interested in that.

Thanks,
Razvan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:53:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:53:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZPAd-0002LW-ED; Fri, 16 Nov 2012 16:53:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jeremy@goop.org>) id 1TZPAc-0002LM-80
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 16:53:34 +0000
Received: from [85.158.139.83:6621] by server-11.bemta-5.messagelabs.com id
	09/60-03409-D8F66A05; Fri, 16 Nov 2012 16:53:33 +0000
X-Env-Sender: jeremy@goop.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1353084811!26671449!1
X-Originating-IP: [74.207.240.146]
X-SpamReason: No, hits=2.3 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	HTML_TAG_BALANCE_HEAD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23555 invoked from network); 16 Nov 2012 16:53:32 -0000
Received: from claw.goop.org (HELO claw.goop.org) (74.207.240.146)
	by server-7.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 16:53:32 -0000
Received: from android-a50d262541415170 (m8f0536d0.tmodns.net [208.54.5.143])
	(using TLSv1 with cipher RC4-MD5 (128/128 bits))
	(No client certificate requested) (Authenticated sender: jeremy)
	by claw.goop.org (Postfix) with ESMTPSA id 3D3A63D2;
	Fri, 16 Nov 2012 08:53:29 -0800 (PST)
User-Agent: K-9 Mail for Android
In-Reply-To: <20121116160923.GP22320@phenom.dumpdata.com>
References: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
	<1353048646-10935-10-git-send-email-tushar.behera@linaro.org>
	<20121116160923.GP22320@phenom.dumpdata.com>
MIME-Version: 1.0
From: Jeremy Fitzhardinge <jeremy@goop.org>
Date: Fri, 16 Nov 2012 08:53:21 -0800
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Tushar Behera <tushar.behera@linaro.org>
Message-ID: <b0cd27cf-919f-46b0-afa1-4566f6ea0f61@email.android.com>
Cc: xen-devel@lists.xensource.com, virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, patches@linaro.org
Subject: Re: [Xen-devel] [PATCH 09/14] xen: events: Remove redundant check
	on unsigned variable
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7639547959690164149=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============7639547959690164149==
Content-Type: multipart/alternative; boundary="----I3LDVZ2VLUSA4GSWOKOQ023V3XCOJH"

------I3LDVZ2VLUSA4GSWOKOQ023V3XCOJH
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: 8bit

To be honest I'd nack this kind of patch. The test is only redundant in the most trivial sense that the compiler can easily optimise away. The point of the test is to make sure that the range is OK even if the type subsequently becomes signed (to hold a -ve error, for example).

J

Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:

>On Fri, Nov 16, 2012 at 12:20:41PM +0530, Tushar Behera wrote:
>> No need to check whether unsigned variable is less than 0.
>> 
>> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>
>Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>
>> CC: Jeremy Fitzhardinge <jeremy@goop.org>
>> CC: xen-devel@lists.xensource.com
>> CC: virtualization@lists.linux-foundation.org
>> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
>> ---
>>  drivers/xen/events.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>> 
>> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
>> index 4293c57..cadd7d1 100644
>> --- a/drivers/xen/events.c
>> +++ b/drivers/xen/events.c
>> @@ -216,7 +216,7 @@ static void xen_irq_info_pirq_init(unsigned irq,
>>   */
>>  static unsigned int evtchn_from_irq(unsigned irq)
>>  {
>> -	if (unlikely(WARN(irq < 0 || irq >= nr_irqs, "Invalid irq %d!\n",
>irq)))
>> +	if (unlikely(WARN(irq >= nr_irqs, "Invalid irq %d!\n", irq)))
>>  		return 0;
>>  
>>  	return info_for_irq(irq)->evtchn;
>> -- 
>> 1.7.4.1

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
------I3LDVZ2VLUSA4GSWOKOQ023V3XCOJH
Content-Type: text/html;
 charset=utf-8
Content-Transfer-Encoding: 8bit

<html><head/><body><html><head></head><body>To be honest I&#39;d nack this kind of patch. The test is only redundant in the most trivial sense that the compiler can easily optimise away. The point of the test is to make sure that the range is OK even if the type subsequently becomes signed (to hold a -ve error, for example).<br>
<br>
J<br><br><div class="gmail_quote">Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt; wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre style="white-space: pre-wrap; word-wrap:break-word; font-family: sans-serif; margin-top: 0px">On Fri, Nov 16, 2012 at 12:20:41PM +0530, Tushar Behera wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">No need to check whether unsigned variable is less than 0.<br /><br />CC: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;</blockquote><br />Acked-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;<br /><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">CC: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;<br />CC: xen-devel@lists.xensource.com<br />CC: virtualization@lists.linux-foundation.org<br />Signed-off-by: Tushar Behera &lt;tushar.behera@linaro.org&gt;<br />---<br />drivers/xen/events.c |    2 +-<br />1 files changed, 1 insertions(+), 1 deletions(-)<br /><br />diff --git a/drivers/xen/events.c b/drivers/xen/events.c<br
/>index 4293c57..cadd7d1 100644<br />--- a/drivers/xen/events.c<br />+++ b/drivers/xen/events.c<br />@@ -216,7 +216,7 @@ static void xen_irq_info_pirq_init(unsigned irq,<br />*/<br />static unsigned int evtchn_from_irq(unsigned irq)<br />{<br />- if (unlikely(WARN(irq &lt; 0 || irq &gt;= nr_irqs, "Invalid irq %d!\n", irq)))<br />+ if (unlikely(WARN(irq &gt;= nr_irqs, "Invalid irq %d!\n", irq)))<br />  return 0;<br /><br /> return info_for_irq(irq)-&gt;evtchn;<br />-- <br /><a href="http://1.7.4.1">1.7.4.1</a></blockquote><br /></pre></blockquote></div><br>
-- <br>
Sent from my Android phone with K-9 Mail. Please excuse my brevity.</body></html></body></html>
------I3LDVZ2VLUSA4GSWOKOQ023V3XCOJH--



--===============7639547959690164149==
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.xen.org
http://lists.xen.org/xen-devel

--===============7639547959690164149==--



From xen-devel-bounces@lists.xen.org Fri Nov 16 16:53:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:53:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZPAd-0002LW-ED; Fri, 16 Nov 2012 16:53:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jeremy@goop.org>) id 1TZPAc-0002LM-80
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 16:53:34 +0000
Received: from [85.158.139.83:6621] by server-11.bemta-5.messagelabs.com id
	09/60-03409-D8F66A05; Fri, 16 Nov 2012 16:53:33 +0000
X-Env-Sender: jeremy@goop.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1353084811!26671449!1
X-Originating-IP: [74.207.240.146]
X-SpamReason: No, hits=2.3 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	HTML_TAG_BALANCE_HEAD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23555 invoked from network); 16 Nov 2012 16:53:32 -0000
Received: from claw.goop.org (HELO claw.goop.org) (74.207.240.146)
	by server-7.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 16 Nov 2012 16:53:32 -0000
Received: from android-a50d262541415170 (m8f0536d0.tmodns.net [208.54.5.143])
	(using TLSv1 with cipher RC4-MD5 (128/128 bits))
	(No client certificate requested) (Authenticated sender: jeremy)
	by claw.goop.org (Postfix) with ESMTPSA id 3D3A63D2;
	Fri, 16 Nov 2012 08:53:29 -0800 (PST)
User-Agent: K-9 Mail for Android
In-Reply-To: <20121116160923.GP22320@phenom.dumpdata.com>
References: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
	<1353048646-10935-10-git-send-email-tushar.behera@linaro.org>
	<20121116160923.GP22320@phenom.dumpdata.com>
MIME-Version: 1.0
From: Jeremy Fitzhardinge <jeremy@goop.org>
Date: Fri, 16 Nov 2012 08:53:21 -0800
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Tushar Behera <tushar.behera@linaro.org>
Message-ID: <b0cd27cf-919f-46b0-afa1-4566f6ea0f61@email.android.com>
Cc: xen-devel@lists.xensource.com, virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, patches@linaro.org
Subject: Re: [Xen-devel] [PATCH 09/14] xen: events: Remove redundant check
	on unsigned variable
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7639547959690164149=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============7639547959690164149==
Content-Type: multipart/alternative; boundary="----I3LDVZ2VLUSA4GSWOKOQ023V3XCOJH"

------I3LDVZ2VLUSA4GSWOKOQ023V3XCOJH
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: 8bit

To be honest I'd nack this kind of patch. The test is only redundant in the most trivial sense that the compiler can easily optimise away. The point of the test is to make sure that the range is OK even if the type subsequently becomes signed (to hold a -ve error, for example).

J

Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:

>On Fri, Nov 16, 2012 at 12:20:41PM +0530, Tushar Behera wrote:
>> No need to check whether unsigned variable is less than 0.
>> 
>> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>
>Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>
>> CC: Jeremy Fitzhardinge <jeremy@goop.org>
>> CC: xen-devel@lists.xensource.com
>> CC: virtualization@lists.linux-foundation.org
>> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
>> ---
>>  drivers/xen/events.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>> 
>> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
>> index 4293c57..cadd7d1 100644
>> --- a/drivers/xen/events.c
>> +++ b/drivers/xen/events.c
>> @@ -216,7 +216,7 @@ static void xen_irq_info_pirq_init(unsigned irq,
>>   */
>>  static unsigned int evtchn_from_irq(unsigned irq)
>>  {
>> -	if (unlikely(WARN(irq < 0 || irq >= nr_irqs, "Invalid irq %d!\n",
>irq)))
>> +	if (unlikely(WARN(irq >= nr_irqs, "Invalid irq %d!\n", irq)))
>>  		return 0;
>>  
>>  	return info_for_irq(irq)->evtchn;
>> -- 
>> 1.7.4.1

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
------I3LDVZ2VLUSA4GSWOKOQ023V3XCOJH
Content-Type: text/html;
 charset=utf-8
Content-Transfer-Encoding: 8bit

<html><head/><body><html><head></head><body>To be honest I&#39;d nack this kind of patch. The test is only redundant in the most trivial sense that the compiler can easily optimise away. The point of the test is to make sure that the range is OK even if the type subsequently becomes signed (to hold a -ve error, for example).<br>
<br>
J<br><br><div class="gmail_quote">Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt; wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre style="white-space: pre-wrap; word-wrap:break-word; font-family: sans-serif; margin-top: 0px">On Fri, Nov 16, 2012 at 12:20:41PM +0530, Tushar Behera wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">No need to check whether unsigned variable is less than 0.<br /><br />CC: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;</blockquote><br />Acked-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;<br /><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">CC: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;<br />CC: xen-devel@lists.xensource.com<br />CC: virtualization@lists.linux-foundation.org<br />Signed-off-by: Tushar Behera &lt;tushar.behera@linaro.org&gt;<br />---<br />drivers/xen/events.c |    2 +-<br />1 files changed, 1 insertions(+), 1 deletions(-)<br /><br />diff --git a/drivers/xen/events.c b/drivers/xen/events.c<br
/>index 4293c57..cadd7d1 100644<br />--- a/drivers/xen/events.c<br />+++ b/drivers/xen/events.c<br />@@ -216,7 +216,7 @@ static void xen_irq_info_pirq_init(unsigned irq,<br />*/<br />static unsigned int evtchn_from_irq(unsigned irq)<br />{<br />- if (unlikely(WARN(irq &lt; 0 || irq &gt;= nr_irqs, "Invalid irq %d!\n", irq)))<br />+ if (unlikely(WARN(irq &gt;= nr_irqs, "Invalid irq %d!\n", irq)))<br />  return 0;<br /><br /> return info_for_irq(irq)-&gt;evtchn;<br />-- <br /><a href="http://1.7.4.1">1.7.4.1</a></blockquote><br /></pre></blockquote></div><br>
-- <br>
Sent from my Android phone with K-9 Mail. Please excuse my brevity.</body></html></body></html>
------I3LDVZ2VLUSA4GSWOKOQ023V3XCOJH--



--===============7639547959690164149==
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.xen.org
http://lists.xen.org/xen-devel

--===============7639547959690164149==--



From xen-devel-bounces@lists.xen.org Fri Nov 16 16:55:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:55:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZPCN-0002TT-Ub; Fri, 16 Nov 2012 16:55:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZPCM-0002TJ-3D
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 16:55:22 +0000
Received: from [85.158.137.99:36748] by server-11.bemta-3.messagelabs.com id
	45/05-19361-9FF66A05; Fri, 16 Nov 2012 16:55:21 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1353084915!14682018!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21735 invoked from network); 16 Nov 2012 16:55:15 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 16:55:15 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="15856403"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 16:55:15 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 16:55:15 +0000
Message-ID: <1353084913.3499.240.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Date: Fri, 16 Nov 2012 16:55:13 +0000
In-Reply-To: <patchbomb.1351855134@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 0 of 5] docs: x86 PV MMU related functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-02 at 11:18 +0000, Ian Campbell wrote:
> 
> I also have a draft of a wiki article on the subject which references
> the information in the public headers which I hope to post soon. 

I realised I forgot to do this...

It needs some polish but the majority of the XXX's are placeholder for
links to the result of this applying this series.

8<------------------------------------

Paravirtualised X86 Memory Management

= Intro =

One of the original innovations of the Xen hypervisor was the a
paravirtualisation of the memory management unit (MMU). This allowed
for fas and efficient virtualisation of Operating Systems which used
paging compared to contemporary techniques.

In this article we will describe the functionality of the PV MMU for
X86 Xen guests. A familiarity with X86 paging and related concepts
will be assumed.

Other guest types, such as HVM or PVH guests on X86 or guest on ARM
achieve virtualisation of the MMU usaing other techniques, such as the
use of hardware assisted or shadow paging.

= Direct Paging =

In order to virtualised the memory subsystem all hypervisors introduce
an additional level of abstraction between what the guest sees as
physical memory (pseudo-physical) and the underlying memory of the
machine (called machine addresses in Xen). This is usually done
through the introduction of a physical to machine (P2M)
mapping. Typically this would be maintained within the hypervisor and
hidden from the guest Operating System through techniques such as
Shadow Paging.

The Xen paravirtualised MMU model instead requires that the guest be
aware of the P2M mapping and be modified such that instead of writing
page table entries mapping virtual addresses to the physical address
space it would instead write entries mapping virtual addresses
directly to the machine address space by mapping from pseudo physical
to machine addresses using the P2M as it writes its page tables. This
technique is known as direct paging.

= Page Types and Invariants =

In order to ensure that the guest cannot subvert the system Xen
requires that certain invariants are met and therefore that all
updates to the page table updates are performed by Xen through the use
of hypercalls.

To this end Xen defines a number of page types and ensures that any
given page has exactly one type at any given time. The type of a page
is reference counted and can only be changed when the "type count" is
zero.

The basic types are:

* None: No special uses.
* Page table page: Pages used as page tables (there are separate types
  for each of the 4 levels on 64 bit and 3 levels on 32 bit PAE
  guests).
* Segment descriptor page: Page is used as part of the Global or Local
  Descriptor table (GDT/LDT).
* Writeable: Page is writable.

Xen enforces the invariant that only pages with the writable type have
a writable mapping in the page tables. Likewise it ensures that no
writable mapping exists of a page with any other type. It also
enforces other invariants such as requiring that no page table page
can make a non-privlieged mapping of the hypervisor's virutal address
space etc. By doing this it can ensure that the guest OS is not able
to directly modify any critical data structures and therefore subvert
the safety of the system, for example to map machine addresses which
do not belong to it.

Whenever a set of page-tables is loaded into the hardware page-table
base register ('cr3') the hypervisor must take an appropriate type
reference with the root page-table type (that is, an L4 reference on
64-bit or an L3 reference on 32-bit). If the page is not already of
the required type then in order to take the initial reference it must
first have a type count of zero (remember, a pages' type only be
change while the type count is zero) and must be validated to ensure
that it respects the invariants. This in turn means that the pages
referenced by the root page-table must be validates as having the
correct type (i.e. L3 or L2 on 64- or 32-bit repsectively), and so on
down to the data pages at the leafs of the page-table, thereby
ensuring that the page table as a whole is safe to load into 'cr3'.

XXX link to appropriate header.

In order to maintain the necessary invariants Xen must be involved in
all updates to the page tables, as well as various other privileged
operations. These are covered in the following sections.

In order to prevent guest operating systems from subverting these
mechanisms it is also necessary for guest kernels to run without the
normal privileges associated with running in processor ring-0. For this
reason Xen PV guest kernels usually run in either ring-1 (32-bit
guests) or ring-3 (64-bit guests).

= Updating Page Tables =

Since the page tables are not writable by the guest Xen provides
several machanisms by which the guest can update a page table entry.

== mmu_update hypercall ==

The first mechanism provided by Xen is the HYPERVISOR_mmu_update
hypercall [XXX link]. This hypercall has the prototype:

  struct mmu_update {
      uint64_t ptr;       /* Machine address of PTE. */
      uint64_t val;       /* New contents of PTE.    */
  };

  long HYPERVISOR_mmu_update(const struct mmu_update reqs[],
                             unsigned count, unsigned *done_out,
                             unsigned foreigndom)

The operation takes an array of 'count' requests 'reqs'. The
'done_out' paramter returns an indication of the number of successful
operations. 'foreigndom' can be used by a suitably privileged domain
to access memory belonging to other domains (this usage is not covered
here).

Each request is a ('ptr','value') pair. The 'ptr' field is further
divides into 'ptr[1:0]' indicating the type of update to perform and
'ptr[:2]' which indicates the the address to update.
 
The valid values for 'ptr[1:0]' are:

* MMU_NORMAL_PT_UPDATE: A normal page table update. 'ptr[:2]' contains
  the machine address of the entry to update while 'val' is the Page
  Table Entry to write. This effectively implements '*ptr = val' with
  checks to ensure that the required invariants aree preserved.
* MMU_MACHPHYS_UPDATE: Update the machine to physical address
  mapping. This is covered below, see [XXX link]
* MMU_PT_UPDATE_PRESERVE_AD: As per MMU_NORMAL_PT_UPDATE but
  preserving the Accessed and Dirty bits in the page table entry. The
  'val' here is almost a standard Page Table Entry but with some
  special handling. See the [XXX link hypercall documentation] for more
  information.

== update_va_mapping hypercall ==

The second mechanism provided by Xen is the
HYPERVISOR_update_va_mapping hypercall [XXX link]. This hypercall has
the prototype:

  long
  HYPERVISOR_update_va_mapping(unsigned long va, u64 val,
                               enum update_va_mapping_flags flags)

This operation simply updates the leaf PTE entry (called and L1 in
Xen) which maps the virtual address 'va' with the given value
'val', while of course performing the expected checks to ensure that
the invariants are maintained. This can be though of as updating the
PTE using a [XXX link linear mapping].

The flags parameter can be used to request that Xen flush the TLB
entries associated with the update. See the [XXX link hypercall
documentation for more].

== Trap and emulate of page table writes ==

As well as the above Xen can also trap and emulate updates to leaf
page table entries (L1) only. This trapping and emulating is
relatively expensive and is best avoided but for little used code
paths can provide a reasonable trade off vs.the requirement to modify
the callsite in the guest OS.

= Other privileged operations =

As well as moderating page table updates in order to maintain the
necessary invariants Xen must also be involved in certain other
privileged operations, such as setting a new page table base
('cr3'). Because the guest kernel no longer runs in ring-0 certain
other privleged operations must also be done by the hypervisor, such
as flushing the TLB.

These operations are performed via the HYPERVISOR_mmuext_op hypercall
[XXX link]. This hypercall has the following prototype:

  struct mmuext_op {
      unsigned int cmd; /* => enum mmuext_cmd */
      union {
          /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR
           * CLEAR_PAGE, COPY_PAGE, [UN]MARK_SUPER */
          xen_pfn_t     mfn;
          /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */
          unsigned long linear_addr;
      } arg1;
      union {
          /* SET_LDT */
          unsigned int nr_ents;
          /* TLB_FLUSH_MULTI, INVLPG_MULTI */
          const void *vcpumask;
          /* COPY_PAGE */
          xen_pfn_t src_mfn;
      } arg2;
  };

  long
  HYPERVISOR_mmuext_op(struct mmuext_op uops[],
                       unsigned int count,
                       unsigned int *pdone,
                       unsigned int foreigndom)

The hypercall takes an array of 'count' operations each specified by
the 'mmuext_op' struct. This hypercall allows access to various
operations which must be performed via the hypervisor either because
the guest kernel is no longer privileged or because the hypervisor
must be involed in order to maintain safety, in general each available
command corresponds to a low-level processor function. The include
NEWBASE_PTR (write cr3), various types of TLB and cache flush and to
set the LDT table address (see below). For more information on the
available operations please see [XXX link the hypercall
documentation].

= Pinning Page Tables =

As discussed above Xen ensures that various invariants are met
concerning whether certain pages are mapped writable or not. This
in turn means that Xen needs to validate the page tables whenever they
are loaded into 'cr3'. However this is a potentially expensive
operation since Xen needs to walk the complete set of page-tables and
validate each one recursivley.

In order to avoid this expense every time 'cr3' changes (i.e. on every
context switch). Xen allows a page to be explictly ''pinned'' to a
give type. This effectively means taking an extra reference of the
relevant page table type, thereby forcing Xen to validate the
page-table up front and to maintain the invariants for as long as the
pin remains in place. By doing this the guest ensures that when a new
'cr3' is loaded the referenced page already has the appropriate type
(L4 or L3) and therefore the type count can simply be incremented
without the need to validate.

For maximum performance a guest OS kernel will usually want to perform
a pin operation as late as possible during the setup of a new set of
page tables, so as to be able to construct them using normal writable
mappings before blessing them as a set of page tables. Likewise on
page-table teardown a guest OS will usually want to unpin the pages as
soon as possible such that it can teardown the page tables without the
use of hypercalls. These operations are usually refered to as 'late
pin' and 'early unpin'.

= The Physical-to-machine and machine-to-physical mapping tables =

As discussed above direct paging requires that the guest Operating
System be aware of the mapping between (pseudo-physical) and machine
addresses (the P2M table). In addition in order to be able to read PTE
entries (which contain machine addresses) and convert them back into
pseudo-physical addresses a translation between, this is done using
the M2P table.

Each table is a simple array of frame numbers, indexed by either
physical or machine frames and looking up the other.

Since the P2M is sized according to the guest's pseudo-physical
address it is left entirely up to the guest to provide and maintain in
its own pages.

However the M2P must be sized according to the total amount of RAM in
the host and therefore could be of considerable ize compared to the
amount of RAM available to the guest, not to mention sparse from the
guest's point of view since the majority of machine pages will not
belong to it.

For this reason Xen exposes a read-only M2P of the entire host to the
guest and allows guests to update this table using the
MMU_MACHPHYS_UPDATE sub-op of the HYPERVISOR_mmu_update hypercall [XXX
link].

= Descriptor Tables =

As well as protecting page tables from being writable by the guest Xen
also requires that various descriptor tables must be made unavailable
to the guest.

== Interrupt Descriptor Table ==

A Xen guest cannot access the IDT directly. Instead Xen maintains its
own IDT and allows guest to write entries using the
HYPERVISOR_set_trap_table hypercall. This has the following prototype:
XXX link.

  struct trap_info {
      uint8_t       vector;  /* exception vector
*/
      uint8_t       flags;   /* 0-3: privilege level; 4: clear event
enable?  */
      uint16_t      cs;      /* code selector
*/
      unsigned long address; /* code offset
*/
  };
  long HYPERVISOR_set_trap_table(const struct trap_info traps[]);

The entires of the ''trap_info'' struct correspond to the fields of a
native IDT entry and each will be validated by Xen before it is
used. The hypercall takes an array of traps terminated by an entry
where ''address'' is zero.

== Global/Local Descriptor Tables ==

A Xen guest is not able to access the Global or Local descriptor
tables directly. Pages which are in use as part of either table are
given their own distinct type and must therefore be mapped as
read-only in the guest. 


The guest is also not privileged to update the descriptor base
registers and must therefore do so using a hypercall. The hypercall to
update the GDT is:

  long HYPERVISOR_set_gdt(const xen_pfn_t frames[], unsigned int
entries);

This takes an array of machine frame numbers which are validated and
loaded into the virtual GDTR. Note that unlike native X86 these are
machine frames and not virtual addresses. These frames will be mapped
by Xen into the virtual address which it reserves for this purpose.

The LDT is set using the MMUEXT_SET_LDT sub-op of the
HYPERVISOR_mmuext_op hypercall. [XXX link.] XXX a single page?

Finally since the pages cannot be mapped as writable by the guest the
HYPERVISOR_update_descriptor hypercall is provided:

  long HYPERVISOR_update_descriptor(u64 pa, u64 desc);

It takes a machine physical address of a descriptor entry to update
and the requested contents of the descriptor itself, in the same
format as the native descriptors.

= Start Of Day = 

The initial boot time environment of a Xen PV guest is somewhat
different to the normal initial mode of an X86 processor. Rather than
starting out in 16-bit mode with paging disabled a PV guest is
started in either 32- or 64- bit mode with paging enabled running on
an initial set of page tables provided by the hypervisor. These pages
will be setup so as to meet the required invariants and will be loaded
into the 'cr3' register but will not be explicitly pinned (in other
words their type count is effectively one)

The initial virtual and pseudo-physical layout of a new guest is
described in XXX
file:///home/ijc/devel/xen-unstable.hg/docs/html/hypercall/include,public,xen.h.html#incontents_startofday

= Virtual Address Space =

Xen enforces certain restrictions on the virtual addresses which are
available to PV guests. These are enforced as part of the machinery for
typing and writing page tables.

Xen uses this to reserve certain addresses for its own use. Certain
areas are also read-only for guests and contain shared datastructures
such as the Macine-to-physical address lookup table.

For a 64-bit guest Xen the virtual address space is setout as follows:

0x0000000000000000-0x00007fffffffffff Fully available to guests
0x0000800000000000-0xffff7fffffffffff Inaccessible (addresses are 48-bit
sign extended)
0xffff800000000000-0xffff807fffffffff Read only to guests.
0xffff808000000000-0xffff87ffffffffff Reserved for Xen use
0xffff880000000000-0xffffffffffffffff Fully Available to guests

For 32-bit guests running on a 64-bit hypervisor guests the virtual
address space under 4G (which is all such guests can access is:
0x00000000-0xf57fffff Fully available to guests
0xf5800000-0xffffffff Read only to guests.

For more information see "Memory Layout" under [XXX link
xen/include/asm-x86/config.h]

= Batching =

For some memory management operations the overhead of making many
hypercalls can become prohibively expensive. For this reason many of
the hypercalls described above take a list of operations to
perform. In addition Xen provides the concept of a multicall which can
allow several different hypercalls to be batched
together. HYPERVISOR_multicall has this prototype:

  struct multicall_entry {
      unsigned long op, result;
      unsigned long args[6];
  };
  long HYPERVISOR_multicall(multicall_entry_t call_list[],
                            unsigned int nr_calls);

Each entry represents a hypercall and its associated arguments in the
(hopefully) obvious way.

= Guest Specific Details

== Linux paravirt_ops ==

=== General PV MMU operation ===

The Linux ''paravirt_ops'' infrastructure provides a mechanism by
which the low-level MMU operations are abstracted into function
pointers allowing the native operations where necessary.

>From the point of view of MMU operations the main entry point is
''struct pv_mmu_ops''. This contains entry points for low level
operations such as:

 * Allocating/freeing page table entries. These allow the kernel to
   mark the pages read-only and read-write as the pages are reused.
 * Creating, writing and reading PTE entries. These allow the kernel
   to make the necessary translations between pseudo-physical and
   machine addressing as well as using hypercalls instead of direct
   writes.
 * Reading and writing of control registers, e.g. cr3, to allow
   hypercalls to be inserted.
 * Various TLB flush operations, again to allow their replacement by
   hypercalls.

As well as these the interface includes some higher-level operations
which allow for more efficient batching of compound operations such as
duplicating (forking) a memory map. This is achieved by using the
''lazy_mmu_ops'' hooks to implement buffering of operations
and flushing of larger batches or upon completion.

The Xen paravirt_ops backend uses an additional page flag,
''PG_pinned'' in order to track whether a page has been pinned or not
and implemented the late-pin early-unpin scheme described above.

=== Start of Day issues ===

XXX get someone to describe these...

= References =

[XXX Xen and the art of virtualisation.]
[XXX The hypercall interface documentation.]
[XXX others? Chisnal Book?]



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:55:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:55:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZPCN-0002TT-Ub; Fri, 16 Nov 2012 16:55:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TZPCM-0002TJ-3D
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 16:55:22 +0000
Received: from [85.158.137.99:36748] by server-11.bemta-3.messagelabs.com id
	45/05-19361-9FF66A05; Fri, 16 Nov 2012 16:55:21 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1353084915!14682018!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21735 invoked from network); 16 Nov 2012 16:55:15 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 16:55:15 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="15856403"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 16:55:15 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 16:55:15 +0000
Message-ID: <1353084913.3499.240.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Date: Fri, 16 Nov 2012 16:55:13 +0000
In-Reply-To: <patchbomb.1351855134@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 0 of 5] docs: x86 PV MMU related functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-02 at 11:18 +0000, Ian Campbell wrote:
> 
> I also have a draft of a wiki article on the subject which references
> the information in the public headers which I hope to post soon. 

I realised I forgot to do this...

It needs some polish but the majority of the XXX's are placeholder for
links to the result of this applying this series.

8<------------------------------------

Paravirtualised X86 Memory Management

= Intro =

One of the original innovations of the Xen hypervisor was the a
paravirtualisation of the memory management unit (MMU). This allowed
for fas and efficient virtualisation of Operating Systems which used
paging compared to contemporary techniques.

In this article we will describe the functionality of the PV MMU for
X86 Xen guests. A familiarity with X86 paging and related concepts
will be assumed.

Other guest types, such as HVM or PVH guests on X86 or guest on ARM
achieve virtualisation of the MMU usaing other techniques, such as the
use of hardware assisted or shadow paging.

= Direct Paging =

In order to virtualised the memory subsystem all hypervisors introduce
an additional level of abstraction between what the guest sees as
physical memory (pseudo-physical) and the underlying memory of the
machine (called machine addresses in Xen). This is usually done
through the introduction of a physical to machine (P2M)
mapping. Typically this would be maintained within the hypervisor and
hidden from the guest Operating System through techniques such as
Shadow Paging.

The Xen paravirtualised MMU model instead requires that the guest be
aware of the P2M mapping and be modified such that instead of writing
page table entries mapping virtual addresses to the physical address
space it would instead write entries mapping virtual addresses
directly to the machine address space by mapping from pseudo physical
to machine addresses using the P2M as it writes its page tables. This
technique is known as direct paging.

= Page Types and Invariants =

In order to ensure that the guest cannot subvert the system Xen
requires that certain invariants are met and therefore that all
updates to the page table updates are performed by Xen through the use
of hypercalls.

To this end Xen defines a number of page types and ensures that any
given page has exactly one type at any given time. The type of a page
is reference counted and can only be changed when the "type count" is
zero.

The basic types are:

* None: No special uses.
* Page table page: Pages used as page tables (there are separate types
  for each of the 4 levels on 64 bit and 3 levels on 32 bit PAE
  guests).
* Segment descriptor page: Page is used as part of the Global or Local
  Descriptor table (GDT/LDT).
* Writeable: Page is writable.

Xen enforces the invariant that only pages with the writable type have
a writable mapping in the page tables. Likewise it ensures that no
writable mapping exists of a page with any other type. It also
enforces other invariants such as requiring that no page table page
can make a non-privlieged mapping of the hypervisor's virutal address
space etc. By doing this it can ensure that the guest OS is not able
to directly modify any critical data structures and therefore subvert
the safety of the system, for example to map machine addresses which
do not belong to it.

Whenever a set of page-tables is loaded into the hardware page-table
base register ('cr3') the hypervisor must take an appropriate type
reference with the root page-table type (that is, an L4 reference on
64-bit or an L3 reference on 32-bit). If the page is not already of
the required type then in order to take the initial reference it must
first have a type count of zero (remember, a pages' type only be
change while the type count is zero) and must be validated to ensure
that it respects the invariants. This in turn means that the pages
referenced by the root page-table must be validates as having the
correct type (i.e. L3 or L2 on 64- or 32-bit repsectively), and so on
down to the data pages at the leafs of the page-table, thereby
ensuring that the page table as a whole is safe to load into 'cr3'.

XXX link to appropriate header.

In order to maintain the necessary invariants Xen must be involved in
all updates to the page tables, as well as various other privileged
operations. These are covered in the following sections.

In order to prevent guest operating systems from subverting these
mechanisms it is also necessary for guest kernels to run without the
normal privileges associated with running in processor ring-0. For this
reason Xen PV guest kernels usually run in either ring-1 (32-bit
guests) or ring-3 (64-bit guests).

= Updating Page Tables =

Since the page tables are not writable by the guest Xen provides
several machanisms by which the guest can update a page table entry.

== mmu_update hypercall ==

The first mechanism provided by Xen is the HYPERVISOR_mmu_update
hypercall [XXX link]. This hypercall has the prototype:

  struct mmu_update {
      uint64_t ptr;       /* Machine address of PTE. */
      uint64_t val;       /* New contents of PTE.    */
  };

  long HYPERVISOR_mmu_update(const struct mmu_update reqs[],
                             unsigned count, unsigned *done_out,
                             unsigned foreigndom)

The operation takes an array of 'count' requests 'reqs'. The
'done_out' paramter returns an indication of the number of successful
operations. 'foreigndom' can be used by a suitably privileged domain
to access memory belonging to other domains (this usage is not covered
here).

Each request is a ('ptr','value') pair. The 'ptr' field is further
divides into 'ptr[1:0]' indicating the type of update to perform and
'ptr[:2]' which indicates the the address to update.
 
The valid values for 'ptr[1:0]' are:

* MMU_NORMAL_PT_UPDATE: A normal page table update. 'ptr[:2]' contains
  the machine address of the entry to update while 'val' is the Page
  Table Entry to write. This effectively implements '*ptr = val' with
  checks to ensure that the required invariants aree preserved.
* MMU_MACHPHYS_UPDATE: Update the machine to physical address
  mapping. This is covered below, see [XXX link]
* MMU_PT_UPDATE_PRESERVE_AD: As per MMU_NORMAL_PT_UPDATE but
  preserving the Accessed and Dirty bits in the page table entry. The
  'val' here is almost a standard Page Table Entry but with some
  special handling. See the [XXX link hypercall documentation] for more
  information.

== update_va_mapping hypercall ==

The second mechanism provided by Xen is the
HYPERVISOR_update_va_mapping hypercall [XXX link]. This hypercall has
the prototype:

  long
  HYPERVISOR_update_va_mapping(unsigned long va, u64 val,
                               enum update_va_mapping_flags flags)

This operation simply updates the leaf PTE entry (called and L1 in
Xen) which maps the virtual address 'va' with the given value
'val', while of course performing the expected checks to ensure that
the invariants are maintained. This can be though of as updating the
PTE using a [XXX link linear mapping].

The flags parameter can be used to request that Xen flush the TLB
entries associated with the update. See the [XXX link hypercall
documentation for more].

== Trap and emulate of page table writes ==

As well as the above Xen can also trap and emulate updates to leaf
page table entries (L1) only. This trapping and emulating is
relatively expensive and is best avoided but for little used code
paths can provide a reasonable trade off vs.the requirement to modify
the callsite in the guest OS.

= Other privileged operations =

As well as moderating page table updates in order to maintain the
necessary invariants Xen must also be involved in certain other
privileged operations, such as setting a new page table base
('cr3'). Because the guest kernel no longer runs in ring-0 certain
other privleged operations must also be done by the hypervisor, such
as flushing the TLB.

These operations are performed via the HYPERVISOR_mmuext_op hypercall
[XXX link]. This hypercall has the following prototype:

  struct mmuext_op {
      unsigned int cmd; /* => enum mmuext_cmd */
      union {
          /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR
           * CLEAR_PAGE, COPY_PAGE, [UN]MARK_SUPER */
          xen_pfn_t     mfn;
          /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */
          unsigned long linear_addr;
      } arg1;
      union {
          /* SET_LDT */
          unsigned int nr_ents;
          /* TLB_FLUSH_MULTI, INVLPG_MULTI */
          const void *vcpumask;
          /* COPY_PAGE */
          xen_pfn_t src_mfn;
      } arg2;
  };

  long
  HYPERVISOR_mmuext_op(struct mmuext_op uops[],
                       unsigned int count,
                       unsigned int *pdone,
                       unsigned int foreigndom)

The hypercall takes an array of 'count' operations each specified by
the 'mmuext_op' struct. This hypercall allows access to various
operations which must be performed via the hypervisor either because
the guest kernel is no longer privileged or because the hypervisor
must be involed in order to maintain safety, in general each available
command corresponds to a low-level processor function. The include
NEWBASE_PTR (write cr3), various types of TLB and cache flush and to
set the LDT table address (see below). For more information on the
available operations please see [XXX link the hypercall
documentation].

= Pinning Page Tables =

As discussed above Xen ensures that various invariants are met
concerning whether certain pages are mapped writable or not. This
in turn means that Xen needs to validate the page tables whenever they
are loaded into 'cr3'. However this is a potentially expensive
operation since Xen needs to walk the complete set of page-tables and
validate each one recursivley.

In order to avoid this expense every time 'cr3' changes (i.e. on every
context switch). Xen allows a page to be explictly ''pinned'' to a
give type. This effectively means taking an extra reference of the
relevant page table type, thereby forcing Xen to validate the
page-table up front and to maintain the invariants for as long as the
pin remains in place. By doing this the guest ensures that when a new
'cr3' is loaded the referenced page already has the appropriate type
(L4 or L3) and therefore the type count can simply be incremented
without the need to validate.

For maximum performance a guest OS kernel will usually want to perform
a pin operation as late as possible during the setup of a new set of
page tables, so as to be able to construct them using normal writable
mappings before blessing them as a set of page tables. Likewise on
page-table teardown a guest OS will usually want to unpin the pages as
soon as possible such that it can teardown the page tables without the
use of hypercalls. These operations are usually refered to as 'late
pin' and 'early unpin'.

= The Physical-to-machine and machine-to-physical mapping tables =

As discussed above direct paging requires that the guest Operating
System be aware of the mapping between (pseudo-physical) and machine
addresses (the P2M table). In addition in order to be able to read PTE
entries (which contain machine addresses) and convert them back into
pseudo-physical addresses a translation between, this is done using
the M2P table.

Each table is a simple array of frame numbers, indexed by either
physical or machine frames and looking up the other.

Since the P2M is sized according to the guest's pseudo-physical
address it is left entirely up to the guest to provide and maintain in
its own pages.

However the M2P must be sized according to the total amount of RAM in
the host and therefore could be of considerable ize compared to the
amount of RAM available to the guest, not to mention sparse from the
guest's point of view since the majority of machine pages will not
belong to it.

For this reason Xen exposes a read-only M2P of the entire host to the
guest and allows guests to update this table using the
MMU_MACHPHYS_UPDATE sub-op of the HYPERVISOR_mmu_update hypercall [XXX
link].

= Descriptor Tables =

As well as protecting page tables from being writable by the guest Xen
also requires that various descriptor tables must be made unavailable
to the guest.

== Interrupt Descriptor Table ==

A Xen guest cannot access the IDT directly. Instead Xen maintains its
own IDT and allows guest to write entries using the
HYPERVISOR_set_trap_table hypercall. This has the following prototype:
XXX link.

  struct trap_info {
      uint8_t       vector;  /* exception vector
*/
      uint8_t       flags;   /* 0-3: privilege level; 4: clear event
enable?  */
      uint16_t      cs;      /* code selector
*/
      unsigned long address; /* code offset
*/
  };
  long HYPERVISOR_set_trap_table(const struct trap_info traps[]);

The entires of the ''trap_info'' struct correspond to the fields of a
native IDT entry and each will be validated by Xen before it is
used. The hypercall takes an array of traps terminated by an entry
where ''address'' is zero.

== Global/Local Descriptor Tables ==

A Xen guest is not able to access the Global or Local descriptor
tables directly. Pages which are in use as part of either table are
given their own distinct type and must therefore be mapped as
read-only in the guest. 


The guest is also not privileged to update the descriptor base
registers and must therefore do so using a hypercall. The hypercall to
update the GDT is:

  long HYPERVISOR_set_gdt(const xen_pfn_t frames[], unsigned int
entries);

This takes an array of machine frame numbers which are validated and
loaded into the virtual GDTR. Note that unlike native X86 these are
machine frames and not virtual addresses. These frames will be mapped
by Xen into the virtual address which it reserves for this purpose.

The LDT is set using the MMUEXT_SET_LDT sub-op of the
HYPERVISOR_mmuext_op hypercall. [XXX link.] XXX a single page?

Finally since the pages cannot be mapped as writable by the guest the
HYPERVISOR_update_descriptor hypercall is provided:

  long HYPERVISOR_update_descriptor(u64 pa, u64 desc);

It takes a machine physical address of a descriptor entry to update
and the requested contents of the descriptor itself, in the same
format as the native descriptors.

= Start Of Day = 

The initial boot time environment of a Xen PV guest is somewhat
different to the normal initial mode of an X86 processor. Rather than
starting out in 16-bit mode with paging disabled a PV guest is
started in either 32- or 64- bit mode with paging enabled running on
an initial set of page tables provided by the hypervisor. These pages
will be setup so as to meet the required invariants and will be loaded
into the 'cr3' register but will not be explicitly pinned (in other
words their type count is effectively one)

The initial virtual and pseudo-physical layout of a new guest is
described in XXX
file:///home/ijc/devel/xen-unstable.hg/docs/html/hypercall/include,public,xen.h.html#incontents_startofday

= Virtual Address Space =

Xen enforces certain restrictions on the virtual addresses which are
available to PV guests. These are enforced as part of the machinery for
typing and writing page tables.

Xen uses this to reserve certain addresses for its own use. Certain
areas are also read-only for guests and contain shared datastructures
such as the Macine-to-physical address lookup table.

For a 64-bit guest Xen the virtual address space is setout as follows:

0x0000000000000000-0x00007fffffffffff Fully available to guests
0x0000800000000000-0xffff7fffffffffff Inaccessible (addresses are 48-bit
sign extended)
0xffff800000000000-0xffff807fffffffff Read only to guests.
0xffff808000000000-0xffff87ffffffffff Reserved for Xen use
0xffff880000000000-0xffffffffffffffff Fully Available to guests

For 32-bit guests running on a 64-bit hypervisor guests the virtual
address space under 4G (which is all such guests can access is:
0x00000000-0xf57fffff Fully available to guests
0xf5800000-0xffffffff Read only to guests.

For more information see "Memory Layout" under [XXX link
xen/include/asm-x86/config.h]

= Batching =

For some memory management operations the overhead of making many
hypercalls can become prohibively expensive. For this reason many of
the hypercalls described above take a list of operations to
perform. In addition Xen provides the concept of a multicall which can
allow several different hypercalls to be batched
together. HYPERVISOR_multicall has this prototype:

  struct multicall_entry {
      unsigned long op, result;
      unsigned long args[6];
  };
  long HYPERVISOR_multicall(multicall_entry_t call_list[],
                            unsigned int nr_calls);

Each entry represents a hypercall and its associated arguments in the
(hopefully) obvious way.

= Guest Specific Details

== Linux paravirt_ops ==

=== General PV MMU operation ===

The Linux ''paravirt_ops'' infrastructure provides a mechanism by
which the low-level MMU operations are abstracted into function
pointers allowing the native operations where necessary.

>From the point of view of MMU operations the main entry point is
''struct pv_mmu_ops''. This contains entry points for low level
operations such as:

 * Allocating/freeing page table entries. These allow the kernel to
   mark the pages read-only and read-write as the pages are reused.
 * Creating, writing and reading PTE entries. These allow the kernel
   to make the necessary translations between pseudo-physical and
   machine addressing as well as using hypercalls instead of direct
   writes.
 * Reading and writing of control registers, e.g. cr3, to allow
   hypercalls to be inserted.
 * Various TLB flush operations, again to allow their replacement by
   hypercalls.

As well as these the interface includes some higher-level operations
which allow for more efficient batching of compound operations such as
duplicating (forking) a memory map. This is achieved by using the
''lazy_mmu_ops'' hooks to implement buffering of operations
and flushing of larger batches or upon completion.

The Xen paravirt_ops backend uses an additional page flag,
''PG_pinned'' in order to track whether a page has been pinned or not
and implemented the late-pin early-unpin scheme described above.

=== Start of Day issues ===

XXX get someone to describe these...

= References =

[XXX Xen and the art of virtualisation.]
[XXX The hypercall interface documentation.]
[XXX others? Chisnal Book?]



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:58:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:58:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZPFe-0002q5-Ct; Fri, 16 Nov 2012 16:58:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZPFd-0002pp-Er
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 16:58:45 +0000
Received: from [85.158.138.51:16370] by server-15.bemta-3.messagelabs.com id
	1B/90-09445-4C076A05; Fri, 16 Nov 2012 16:58:44 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1353085122!30331703!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTcyODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29202 invoked from network); 16 Nov 2012 16:58:44 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-11.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 16:58:44 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGGwc0U032060
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 16:58:39 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGGwcjD023752
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 16:58:38 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGGwbPf014485; Fri, 16 Nov 2012 10:58:37 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 08:58:37 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 568C640C12; Fri, 16 Nov 2012 11:58:34 -0500 (EST)
Date: Fri, 16 Nov 2012 11:58:34 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Sander Eikelenboom <linux@eikelenboom.it>, jinsong.liu@intel.com
Message-ID: <20121116165834.GA18725@phenom.dumpdata.com>
References: <791265057.20121116134056@eikelenboom.it>
	<20121116160733.GO22320@phenom.dumpdata.com>
	<1422434855.20121116174754@eikelenboom.it>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1422434855.20121116174754@eikelenboom.it>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [ 3009.778974] mcelog:16842 map pfn expected
 mapping type write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 16, 2012 at 05:47:54PM +0100, Sander Eikelenboom wrote:
> 
> Friday, November 16, 2012, 5:07:33 PM, you wrote:
> 
> > On Fri, Nov 16, 2012 at 01:40:56PM +0100, Sander Eikelenboom wrote:
> >> Hi Konrad,
> >> 
> >> Sometime ago i reported this one at boot up:
> >> 
> >> [ 3009.778974] mcelog:16842 map pfn expected mapping type write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus
> >> [ 3009.788570] ------------[ cut here ]------------
> >> [ 3009.798175] WARNING: at arch/x86/mm/pat.c:774 untrack_pfn+0xa1/0xb0()
> >> [ 3009.807966] Hardware name: MS-7640
> >> [ 3009.817677] Modules linked in:
> >> [ 3009.827524] Pid: 16842, comm: mcelog Tainted: G        W    3.7.0-rc5-20121116-reverted-persistent-warn-patwarn #1
> >> [ 3009.837415] Call Trace:
> >> [ 3009.847110]  [<ffffffff810674fa>] warn_slowpath_common+0x7a/0xb0
> >> [ 3009.856857]  [<ffffffff81067545>] warn_slowpath_null+0x15/0x20
> >> [ 3009.866562]  [<ffffffff81042041>] untrack_pfn+0xa1/0xb0
> >> [ 3009.876201]  [<ffffffff8111a59b>] unmap_single_vma+0x86b/0x8e0
> >> [ 3009.885895]  [<ffffffff81100f16>] ? release_pages+0x196/0x1f0
> >> [ 3009.895488]  [<ffffffff8111a65c>] unmap_vmas+0x4c/0xa0
> >> [ 3009.905134]  [<ffffffff8111c8fa>] exit_mmap+0x9a/0x180
> >> [ 3009.914706]  [<ffffffff81064e72>] mmput+0x52/0xd0
> >> [ 3009.924252]  [<ffffffff810652b7>] dup_mm+0x3c7/0x510
> >> [ 3009.933839]  [<ffffffff81065fd5>] copy_process+0xac5/0x14a0
> >> [ 3009.943430]  [<ffffffff81066af3>] do_fork+0x53/0x360
> >> [ 3009.952843]  [<ffffffff810b25c7>] ? lock_release+0x117/0x250
> >> [ 3009.962283]  [<ffffffff817d26c0>] ? _raw_spin_unlock+0x30/0x60
> >> [ 3009.971532]  [<ffffffff817d3495>] ? sysret_check+0x22/0x5d
> >> [ 3009.980820]  [<ffffffff81017523>] sys_clone+0x23/0x30
> >> [ 3009.990046]  [<ffffffff817d37f3>] stub_clone+0x13/0x20
> >> [ 3009.999335]  [<ffffffff817d3469>] ? system_call_fastpath+0x16/0x1b
> >> [ 3010.008667] ---[ end trace 2d9694c2c0a24da8 ]---
> >> 
> >> 
> >> It seems to be due to the "mcelog" userspace tool provided with Debian Squeeze (mcelog 1.0~pre3-3  x86-64 Machine Check Exceptions collector and decoder).
> >> I can trigger this warning easily by restarting the mcelog tool with /etc/init.d/mcelog restart
> >> 
> >> Should that one also function with the xen mcelog driver, or is a newer version required ?
> 
> > The reason we get is b/c I had to disable the PAT functionality in the Linux kernel for Xen.
> > This is b/c it only worked one way - meaning you could convert a page from
> > WriteBack to WriteCombine or WriteBack to Uncached. But you could not
> > do WriteCombine back to WriteBack - due to one of the functions that
> > changes the bits was using an "unfiltered" way to identify the bits on the
> > page.
> 
> > Anyhow, we had a disaster b/c some of these pages that used to WriteBack (WB)
> > got converted to WriteCombine (WC) and then were returned back as such
> > to the page pool. And if they were re-used by filesystem invariably we got
> > corruptions.
> 
> > So until the PAT table lookup thing that Peter H. Anvin suggested
> > gets implemented this splat gotta show up :-(
> 
> Not a big problem for me, i was just wondering :-)
> I'm more interested in the netfront troubles, since it's already rc5.
> 
> > Does mcelog still work even with this warning?
> 
> Not the daemon:
> 
> serveerstertje:~# sh /etc/init.d/mcelog start
> Starting Machine Check Exceptions decoder: daemon: Cannot allocate memory
> 
Ugh.
CC-ing Liu here.

> 
> >> 
> >> --
> >> Sander
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 16:58:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 16:58:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZPFe-0002q5-Ct; Fri, 16 Nov 2012 16:58:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZPFd-0002pp-Er
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 16:58:45 +0000
Received: from [85.158.138.51:16370] by server-15.bemta-3.messagelabs.com id
	1B/90-09445-4C076A05; Fri, 16 Nov 2012 16:58:44 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1353085122!30331703!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTcyODc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29202 invoked from network); 16 Nov 2012 16:58:44 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-11.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 16:58:44 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGGwc0U032060
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 16:58:39 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGGwcjD023752
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 16:58:38 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGGwbPf014485; Fri, 16 Nov 2012 10:58:37 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 08:58:37 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 568C640C12; Fri, 16 Nov 2012 11:58:34 -0500 (EST)
Date: Fri, 16 Nov 2012 11:58:34 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Sander Eikelenboom <linux@eikelenboom.it>, jinsong.liu@intel.com
Message-ID: <20121116165834.GA18725@phenom.dumpdata.com>
References: <791265057.20121116134056@eikelenboom.it>
	<20121116160733.GO22320@phenom.dumpdata.com>
	<1422434855.20121116174754@eikelenboom.it>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1422434855.20121116174754@eikelenboom.it>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [ 3009.778974] mcelog:16842 map pfn expected
 mapping type write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 16, 2012 at 05:47:54PM +0100, Sander Eikelenboom wrote:
> 
> Friday, November 16, 2012, 5:07:33 PM, you wrote:
> 
> > On Fri, Nov 16, 2012 at 01:40:56PM +0100, Sander Eikelenboom wrote:
> >> Hi Konrad,
> >> 
> >> Sometime ago i reported this one at boot up:
> >> 
> >> [ 3009.778974] mcelog:16842 map pfn expected mapping type write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus
> >> [ 3009.788570] ------------[ cut here ]------------
> >> [ 3009.798175] WARNING: at arch/x86/mm/pat.c:774 untrack_pfn+0xa1/0xb0()
> >> [ 3009.807966] Hardware name: MS-7640
> >> [ 3009.817677] Modules linked in:
> >> [ 3009.827524] Pid: 16842, comm: mcelog Tainted: G        W    3.7.0-rc5-20121116-reverted-persistent-warn-patwarn #1
> >> [ 3009.837415] Call Trace:
> >> [ 3009.847110]  [<ffffffff810674fa>] warn_slowpath_common+0x7a/0xb0
> >> [ 3009.856857]  [<ffffffff81067545>] warn_slowpath_null+0x15/0x20
> >> [ 3009.866562]  [<ffffffff81042041>] untrack_pfn+0xa1/0xb0
> >> [ 3009.876201]  [<ffffffff8111a59b>] unmap_single_vma+0x86b/0x8e0
> >> [ 3009.885895]  [<ffffffff81100f16>] ? release_pages+0x196/0x1f0
> >> [ 3009.895488]  [<ffffffff8111a65c>] unmap_vmas+0x4c/0xa0
> >> [ 3009.905134]  [<ffffffff8111c8fa>] exit_mmap+0x9a/0x180
> >> [ 3009.914706]  [<ffffffff81064e72>] mmput+0x52/0xd0
> >> [ 3009.924252]  [<ffffffff810652b7>] dup_mm+0x3c7/0x510
> >> [ 3009.933839]  [<ffffffff81065fd5>] copy_process+0xac5/0x14a0
> >> [ 3009.943430]  [<ffffffff81066af3>] do_fork+0x53/0x360
> >> [ 3009.952843]  [<ffffffff810b25c7>] ? lock_release+0x117/0x250
> >> [ 3009.962283]  [<ffffffff817d26c0>] ? _raw_spin_unlock+0x30/0x60
> >> [ 3009.971532]  [<ffffffff817d3495>] ? sysret_check+0x22/0x5d
> >> [ 3009.980820]  [<ffffffff81017523>] sys_clone+0x23/0x30
> >> [ 3009.990046]  [<ffffffff817d37f3>] stub_clone+0x13/0x20
> >> [ 3009.999335]  [<ffffffff817d3469>] ? system_call_fastpath+0x16/0x1b
> >> [ 3010.008667] ---[ end trace 2d9694c2c0a24da8 ]---
> >> 
> >> 
> >> It seems to be due to the "mcelog" userspace tool provided with Debian Squeeze (mcelog 1.0~pre3-3  x86-64 Machine Check Exceptions collector and decoder).
> >> I can trigger this warning easily by restarting the mcelog tool with /etc/init.d/mcelog restart
> >> 
> >> Should that one also function with the xen mcelog driver, or is a newer version required ?
> 
> > The reason we get is b/c I had to disable the PAT functionality in the Linux kernel for Xen.
> > This is b/c it only worked one way - meaning you could convert a page from
> > WriteBack to WriteCombine or WriteBack to Uncached. But you could not
> > do WriteCombine back to WriteBack - due to one of the functions that
> > changes the bits was using an "unfiltered" way to identify the bits on the
> > page.
> 
> > Anyhow, we had a disaster b/c some of these pages that used to WriteBack (WB)
> > got converted to WriteCombine (WC) and then were returned back as such
> > to the page pool. And if they were re-used by filesystem invariably we got
> > corruptions.
> 
> > So until the PAT table lookup thing that Peter H. Anvin suggested
> > gets implemented this splat gotta show up :-(
> 
> Not a big problem for me, i was just wondering :-)
> I'm more interested in the netfront troubles, since it's already rc5.
> 
> > Does mcelog still work even with this warning?
> 
> Not the daemon:
> 
> serveerstertje:~# sh /etc/init.d/mcelog start
> Starting Machine Check Exceptions decoder: daemon: Cannot allocate memory
> 
Ugh.
CC-ing Liu here.

> 
> >> 
> >> --
> >> Sander
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 17:01:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 17:01:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZPI8-00033U-VX; Fri, 16 Nov 2012 17:01:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZPI7-00033G-PH
	for Xen-devel@lists.xen.org; Fri, 16 Nov 2012 17:01:19 +0000
Received: from [85.158.143.99:7006] by server-2.bemta-4.messagelabs.com id
	D6/60-28922-F5176A05; Fri, 16 Nov 2012 17:01:19 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1353085278!29318780!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18164 invoked from network); 16 Nov 2012 17:01:18 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 17:01:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="15856587"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 17:01:18 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 17:01:17 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TZPI5-0000jB-UR; Fri, 16 Nov 2012 17:01:17 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TZPI5-0005aH-Qh;
	Fri, 16 Nov 2012 17:01:17 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20646.29021.714271.894762@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 17:01:17 +0000
To: George Dunlap <George.Dunlap@eu.citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <CAFLBxZbpXLhX8ij4YqAm+3oEJbeAGEZz2=O8YVfc4tj8pRBCbg@mail.gmail.com>
References: <CAN=sCCEuPqhapvBR2eSTvALQeKbwshmT5=MvSiX3FoMW+vg_aA@mail.gmail.com>
	<1349263669.650.131.camel@zakaz.uk.xensource.com>
	<CAN=sCCGSvu9_xLXnMRhKY6fr1WD+ittsjpKRF6fVFnwtgB9niQ@mail.gmail.com>
	<1349266207.650.137.camel@zakaz.uk.xensource.com>
	<CAN=sCCEtV1PS-a7MtSjsX=XKRqQCoabvNUY-F1xD-sjMmrJE+A@mail.gmail.com>
	<CAN=sCCFcsZUZYKiOVqOF=DzM8VpSEEOSUfmjLh2+DKOrkG+b2g@mail.gmail.com>
	<CAN=sCCGWU4Wpg9QfFaoPLUBmo_rXTf4h=F4g+ES0CHFhGU=0KQ@mail.gmail.com>
	<1349278604.650.162.camel@zakaz.uk.xensource.com>
	<CAN=sCCEO63JgWCUbosP5+exL4aU=yjaM_VPOxbjh6=C6r8CAhg@mail.gmail.com>
	<1349282150.650.181.camel@zakaz.uk.xensource.com>
	<20121014110311.GD8912@reaktio.net>
	<1350287790.14440.1.camel@dagon.hellion.org.uk>
	<CAFLBxZbpXLhX8ij4YqAm+3oEJbeAGEZz2=O8YVfc4tj8pRBCbg@mail.gmail.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: "Xen-devel@lists.xen.org" <Xen-devel@lists.xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Valtteri Kiviniemi <kiviniemi.valtteri@gmail.com>
Subject: Re: [Xen-devel] Xen 4.2.0, xl toolstack cant launch older domUs
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap writes ("Re: [Xen-devel] Xen 4.2.0, xl toolstack cant launch older domUs"):
> On Mon, Oct 15, 2012 at 8:56 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> >> > It appears that xend includes some sort of workaround for this which xl
> >> > does not.
...

This relates to writing
  /local/domain/$(xl domid lightning)/device/vbd/51713/protocol x86_32-abi

> I suppose this kind of thing should be tracked, to make sure it
> doesn't fall on the floor.  I'll add it to my list (with no owner
> ATM).

Did this ever get fixed ?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 17:01:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 17:01:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZPI8-00033U-VX; Fri, 16 Nov 2012 17:01:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZPI7-00033G-PH
	for Xen-devel@lists.xen.org; Fri, 16 Nov 2012 17:01:19 +0000
Received: from [85.158.143.99:7006] by server-2.bemta-4.messagelabs.com id
	D6/60-28922-F5176A05; Fri, 16 Nov 2012 17:01:19 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1353085278!29318780!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18164 invoked from network); 16 Nov 2012 17:01:18 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-13.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 17:01:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,265,1352073600"; d="scan'208";a="15856587"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 17:01:18 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 17:01:17 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TZPI5-0000jB-UR; Fri, 16 Nov 2012 17:01:17 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TZPI5-0005aH-Qh;
	Fri, 16 Nov 2012 17:01:17 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20646.29021.714271.894762@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 17:01:17 +0000
To: George Dunlap <George.Dunlap@eu.citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <CAFLBxZbpXLhX8ij4YqAm+3oEJbeAGEZz2=O8YVfc4tj8pRBCbg@mail.gmail.com>
References: <CAN=sCCEuPqhapvBR2eSTvALQeKbwshmT5=MvSiX3FoMW+vg_aA@mail.gmail.com>
	<1349263669.650.131.camel@zakaz.uk.xensource.com>
	<CAN=sCCGSvu9_xLXnMRhKY6fr1WD+ittsjpKRF6fVFnwtgB9niQ@mail.gmail.com>
	<1349266207.650.137.camel@zakaz.uk.xensource.com>
	<CAN=sCCEtV1PS-a7MtSjsX=XKRqQCoabvNUY-F1xD-sjMmrJE+A@mail.gmail.com>
	<CAN=sCCFcsZUZYKiOVqOF=DzM8VpSEEOSUfmjLh2+DKOrkG+b2g@mail.gmail.com>
	<CAN=sCCGWU4Wpg9QfFaoPLUBmo_rXTf4h=F4g+ES0CHFhGU=0KQ@mail.gmail.com>
	<1349278604.650.162.camel@zakaz.uk.xensource.com>
	<CAN=sCCEO63JgWCUbosP5+exL4aU=yjaM_VPOxbjh6=C6r8CAhg@mail.gmail.com>
	<1349282150.650.181.camel@zakaz.uk.xensource.com>
	<20121014110311.GD8912@reaktio.net>
	<1350287790.14440.1.camel@dagon.hellion.org.uk>
	<CAFLBxZbpXLhX8ij4YqAm+3oEJbeAGEZz2=O8YVfc4tj8pRBCbg@mail.gmail.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: "Xen-devel@lists.xen.org" <Xen-devel@lists.xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Valtteri Kiviniemi <kiviniemi.valtteri@gmail.com>
Subject: Re: [Xen-devel] Xen 4.2.0, xl toolstack cant launch older domUs
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap writes ("Re: [Xen-devel] Xen 4.2.0, xl toolstack cant launch older domUs"):
> On Mon, Oct 15, 2012 at 8:56 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> >> > It appears that xend includes some sort of workaround for this which xl
> >> > does not.
...

This relates to writing
  /local/domain/$(xl domid lightning)/device/vbd/51713/protocol x86_32-abi

> I suppose this kind of thing should be tracked, to make sure it
> doesn't fall on the floor.  I'll add it to my list (with no owner
> ATM).

Did this ever get fixed ?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 17:36:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 17:36:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZPq0-0003oS-1n; Fri, 16 Nov 2012 17:36:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ricardo.pfitscher@gmail.com>) id 1TZPpx-0003oN-VV
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 17:36:18 +0000
Received: from [85.158.139.83:47604] by server-3.bemta-5.messagelabs.com id
	D7/F9-18736-19976A05; Fri, 16 Nov 2012 17:36:17 +0000
X-Env-Sender: ricardo.pfitscher@gmail.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1353087370!26352017!1
X-Originating-IP: [209.85.215.45]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2566 invoked from network); 16 Nov 2012 17:36:10 -0000
Received: from mail-la0-f45.google.com (HELO mail-la0-f45.google.com)
	(209.85.215.45)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 17:36:10 -0000
Received: by mail-la0-f45.google.com with SMTP id p9so823253laa.32
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 09:36:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=iugkdDZkf2/WFgqGRVBVLredHXSJf4+A5UuCJk5BDmE=;
	b=wlY0pVz4L45pfJ/uKCafW+az7SSaNSnRMqVVSDx9dJd1NLClcTDwkRbzd6FqVLgWc0
	RlAPILdhKPSjhUfagKj4njwk1Bge4spx3mN2f4IEGLvJmi9GGOC7UP+bE34wCCZ0GEoR
	Ew3FY8bvPIMEV/+nToUZTT7y9euOjyKTtZWRkRxL8fDPlhwKE0jJrVoM54gXzkhrdovB
	xMpJiFoSuLETE57foUpuAU8eWULGzg33miAdvHzZmCjnvepMjBIomgKH2GVPr6afOmX4
	ONmaW58m2bzPUvmI8xQHPkyBZT48IxgyPL+9JXdj9FXvPoDMzSVqSETDf83gy1nKSn53
	iMLQ==
MIME-Version: 1.0
Received: by 10.152.147.100 with SMTP id tj4mr4855167lab.42.1353087369666;
	Fri, 16 Nov 2012 09:36:09 -0800 (PST)
Received: by 10.112.26.70 with HTTP; Fri, 16 Nov 2012 09:36:09 -0800 (PST)
Date: Fri, 16 Nov 2012 15:36:09 -0200
Message-ID: <CABA9-+qM6_qfbpZF9tcuHW5pbMovhfeJ8uOn5Vp-x_kq8oqMxg@mail.gmail.com>
From: Ricardo Jose Pfitscher <ricardo.pfitscher@gmail.com>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] sar incorrect network measurement in DomU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8011439395201353072=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============8011439395201353072==
Content-Type: multipart/alternative; boundary=e89a8f22bd8904e03404cea0347d

--e89a8f22bd8904e03404cea0347d
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello Everyone,

I'm reposting this from Xen-Users since I didn't get any
answers there, sorry for cross-posting.

I'm using sar to monitor network throughput in a paravirtualized DomU and
I'm seeing some odd values.

For example, if I run iperf on a 100 MBps network with another machine as
the client and either dom0 or domU as the server, I get the same results:

DomU$ iperf -s
[  4] local 192.168.0.1 port 5001 connected with 10.20.129.175 port 37766
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.1 sec    114 MBytes  94.1 Mbits/sec

Dom0$ iperf -s
[  4] local 10.20.129.178 port 5001 connected with 10.20.129.175 port 58763
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.1 sec    113 MBytes  94.1 Mbits/sec

But when measure the throughput with sar while running iperf, the results
are wrong in DomU:

DomU$ sar -n DEV 1 15

15:24:37        IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s rxcmp/s
txcmp/s  rxmcst/s
15:24:38         eth0   3177.30   1591.41   4651.67    102.58 0.00     0.00
     0.00
15:24:39         eth0   5641.67   2822.22   8264.16    181.90 0.00     0.00
     0.00
15:24:40         eth0   5684.62   2840.56   8327.07    183.08 0.00     0.00
     0.00
15:24:41         eth0   5722.54   2856.34   8382.62    184.10 0.00     0.00
     0.00
15:24:42         eth0   5684.62   2825.17   8327.07    182.09 0.00     0.00
     0.00
15:24:43         eth0   5682.52   2843.36   8324.00    183.26 0.00     0.00
     0.00
15:24:44         eth0   5721.83   2857.04   8381.59    184.15 0.00     0.00
     0.00
15:24:45         eth0   5764.54   2878.01   8444.15    185.50 0.00     0.00
     0.00
15:24:46         eth0   5641.67   2808.33   8264.16    181.01 0.00     0.00
     0.00
15:24:47         eth0   5802.86   2892.14   8500.28    186.41 0.00     0.00
     0.00
15:24:48         eth0   2343.27   1171.35   3430.90     75.50 0.00     0.00
     0.00
15:24:49         eth0      0.00      0.00      0.00         0.00 0.00
 0.00      0.00
15:24:50         eth0      0.00      0.00      0.00      0.00 0.00     0.00
     0.00
15:24:51         eth0      0.00      0.00      0.00      0.00 0.00     0.00
     0.00
15:24:52         eth0      0.50      0.50      0.01      0.02 0.00     0.00
     0.00
Average:         eth0   3410.19   1702.32   4995.05    109.72 0.00     0.00
     0.00

During the test, sar gives roughly 8,5MB/s in rxkB/s, while it should be
11,76MB/s (94Mbps), as measured by iperf.

When I run the same measurements in Dom0 I get far better results:

15:29:02        IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s rxcmp/s
 txcmp/s  rxmcst/s
15:29:02         eth0     20,00      0,00      2,38      0,00 0,00     0,00
     0,00
15:29:03         eth0   5856,00   2938,00   8667,55    200,89     0,00
0,00      0,00
15:29:04         eth0   8125,00   4069,00  12029,87    278,15    0,00
0,00      0,00
15:29:05         eth0   8145,00   4073,00  12066,25    278,43    0,00
0,00      0,00
15:29:06         eth0   8121,00   4063,00  12027,94    277,74    0,00
0,00      0,00
15:29:07         eth0   8150,00   4055,00  12065,41    277,20    0,00
0,00      0,00
15:29:08         eth0   8122,00   4064,00  12029,42    277,81    0,00
0,00      0,00
15:29:09         eth0   8147,00   4079,00  12063,73    278,77    0,00
0,00      0,00
15:29:10         eth0   8123,00   4064,00  12029,34    277,88    0,00
0,00      0,00
15:29:11         eth0   8155,00   4096,00  12066,30    280,00    0,00
0,00      0,00
15:29:12         eth0   8129,00   4111,00  12029,02    281,03    0,00
0,00      0,00
15:29:13         eth0   3213,00   1631,00   4741,51    111,49     0,00
0,00      0,00
15:29:14         eth0     17,00      0,00      1,88      0,00
  0,00     0,00      0,00
15:29:15         eth0     12,00      0,00      1,46      0,00
 0,00     0,00      0,00
15:29:16         eth0     19,00      0,00      2,44      0,00
 0,00     0,00      0,00
Average:         eth0   5490,27   2749,53   8121,63    187,96     0,00
0,00      0,00

Has anyone seen something like this?

DomU executes a Debian Squeeze 64 bits OS. Dom0 is provided by Xen 4.0.1.

Thanks,

Ricardo Jos=E9 Pfitscher

--e89a8f22bd8904e03404cea0347d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div><div style=3D"font-family:arial,sans-serif;font-size:13px">Hello Every=
one,<br></div><div style=3D"font-family:arial,sans-serif;font-size:13px"><b=
r></div><span style=3D"font-family:arial,sans-serif;font-size:13px">I&#39;m=
 reposting this from Xen-Users since I didn&#39;t get any</span><br style=
=3D"font-family:arial,sans-serif;font-size:13px">
<span style=3D"font-family:arial,sans-serif;font-size:13px">answers there, =
sorry for cross-posting.</span><br style=3D"font-family:arial,sans-serif;fo=
nt-size:13px"><div style=3D"font-family:arial,sans-serif;font-size:13px"><b=
r>
</div><div style=3D"font-family:arial,sans-serif;font-size:13px">I&#39;m us=
ing sar to monitor network throughput in a paravirtualized DomU=A0and I&#39=
;m seeing some odd values.<br><br>For example, if I run iperf on a 100 MBps=
 network with another machine=A0as the client and either dom0 or domU as th=
e server, I get the same=A0results:<div>
<div><br></div>DomU$ iperf -s<br>[ =A04] local 192.168.0.1 port 5001 connec=
ted with 10.20.129.175 port 37766<br>[ ID] Interval =A0 =A0 =A0 Transfer =
=A0 =A0 Bandwidth<br>[ =A04] =A00.0-10.1 sec =A0 =A0114 MBytes =A094.1 Mbit=
s/sec<br><br>Dom0$ iperf -s<br>
[ =A04] local 10.20.129.178 port 5001 connected with 10.20.129.175 port 587=
63<br>[ ID] Interval =A0 =A0 =A0 Transfer =A0 =A0 Bandwidth<br>[ =A04] =A00=
.0-10.1 sec =A0 =A0113 MBytes =A094.1 Mbits/sec<br><div><br></div>But when =
measure the throughput with sar while running iperf, the=A0results are wron=
g in DomU:</div>
<div><br></div>DomU$ sar -n DEV 1 15<br><br>15:24:37 =A0 =A0 =A0 =A0IFACE =
=A0 rxpck/s =A0 txpck/s =A0 =A0rxkB/s =A0 =A0txkB/s rxcmp/s =A0 txcmp/s =A0=
rxmcst/s<br>15:24:38 =A0 =A0 =A0 =A0 eth0 =A0 3177.30 =A0 1591.41 =A0 4651.=
67 =A0 =A0102.58 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>
15:24:39 =A0 =A0 =A0 =A0 eth0 =A0 5641.67 =A0 2822.22 =A0 8264.16 =A0 =A018=
1.90 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>15:24:40 =A0 =A0 =A0 =A0 eth0 =A0=
 5684.62 =A0 2840.56 =A0 8327.07 =A0 =A0183.08 0.00 =A0 =A0 0.00 =A0 =A0 =
=A00.00<br>15:24:41 =A0 =A0 =A0 =A0 eth0 =A0 5722.54 =A0 2856.34 =A0 8382.6=
2 =A0 =A0184.10 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>
15:24:42 =A0 =A0 =A0 =A0 eth0 =A0 5684.62 =A0 2825.17 =A0 8327.07 =A0 =A018=
2.09 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>15:24:43 =A0 =A0 =A0 =A0 eth0 =A0=
 5682.52 =A0 2843.36 =A0 8324.00 =A0 =A0183.26 0.00 =A0 =A0 0.00 =A0 =A0 =
=A00.00<br>15:24:44 =A0 =A0 =A0 =A0 eth0 =A0 5721.83 =A0 2857.04 =A0 8381.5=
9 =A0 =A0184.15 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>
15:24:45 =A0 =A0 =A0 =A0 eth0 =A0 5764.54 =A0 2878.01 =A0 8444.15 =A0 =A018=
5.50 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>15:24:46 =A0 =A0 =A0 =A0 eth0 =A0=
 5641.67 =A0 2808.33 =A0 8264.16 =A0 =A0181.01 0.00 =A0 =A0 0.00 =A0 =A0 =
=A00.00<br>15:24:47 =A0 =A0 =A0 =A0 eth0 =A0 5802.86 =A0 2892.14 =A0 8500.2=
8 =A0 =A0186.41 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>
15:24:48 =A0 =A0 =A0 =A0 eth0 =A0 2343.27 =A0 1171.35 =A0 3430.90 =A0 =A0 7=
5.50 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>15:24:49 =A0 =A0 =A0 =A0 eth0 =A0=
 =A0 =A00.00 =A0 =A0 =A00.00 =A0 =A0 =A00.00 =A0 =A0 =A0 =A0 0.00 0.00 =A0 =
=A0 =A00.00 =A0 =A0 =A00.00<br>15:24:50 =A0 =A0 =A0 =A0 eth0 =A0 =A0 =A00.0=
0 =A0 =A0 =A00.00 =A0 =A0 =A00.00 =A0 =A0 =A00.00 0.00 =A0 =A0 0.00 =A0 =A0=
 =A00.00<br>
15:24:51 =A0 =A0 =A0 =A0 eth0 =A0 =A0 =A00.00 =A0 =A0 =A00.00 =A0 =A0 =A00.=
00 =A0 =A0 =A00.00 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>15:24:52 =A0 =A0 =
=A0 =A0 eth0 =A0 =A0 =A00.50 =A0 =A0 =A00.50 =A0 =A0 =A00.01 =A0 =A0 =A00.0=
2 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>Average: =A0 =A0 =A0 =A0 eth0 =A0 34=
10.19 =A0 1702.32 =A0 4995.05 =A0 =A0109.72 0.00 =A0 =A0 0.00 =A0 =A0 =A00.=
00<div>
<br></div><div>During the test, sar gives roughly 8,5MB/s in rxkB/s, while =
it should=A0be 11,76MB/s (94Mbps), as measured by iperf.<br><br>When I run =
the same measurements in Dom0 I get far better results:</div><div><br></div=
>
<div>15:29:02 =A0 =A0 =A0 =A0IFACE =A0 rxpck/s =A0 txpck/s =A0 =A0rxkB/s =
=A0 =A0txkB/s=A0rxcmp/s =A0txcmp/s =A0rxmcst/s<br>15:29:02 =A0 =A0 =A0 =A0 =
eth0 =A0 =A0 20,00 =A0 =A0 =A00,00 =A0 =A0 =A02,38 =A0 =A0 =A00,00=A00,00 =
=A0 =A0 0,00 =A0 =A0 =A00,00<br>15:29:03 =A0 =A0 =A0 =A0 eth0 =A0 5856,00 =
=A0 2938,00 =A0 8667,55 =A0 =A0200,89 =A0 =A0=A00,00 =A0 =A0 0,00 =A0 =A0 =
=A00,00<br>
15:29:04 =A0 =A0 =A0 =A0 eth0 =A0 8125,00 =A0 4069,00 =A012029,87 =A0 =A027=
8,15 =A0 =A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<br>15:29:05 =A0 =A0 =A0 =A0 e=
th0 =A0 8145,00 =A0 4073,00 =A012066,25 =A0 =A0278,43 =A0 =A00,00 =A0 =A0 0=
,00 =A0 =A0 =A00,00<br>15:29:06 =A0 =A0 =A0 =A0 eth0 =A0 8121,00 =A0 4063,0=
0 =A012027,94 =A0 =A0277,74 =A0 =A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<br>
15:29:07 =A0 =A0 =A0 =A0 eth0 =A0 8150,00 =A0 4055,00 =A012065,41 =A0 =A027=
7,20 =A0 =A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<br>15:29:08 =A0 =A0 =A0 =A0 e=
th0 =A0 8122,00 =A0 4064,00 =A012029,42 =A0 =A0277,81 =A0 =A00,00 =A0 =A0 0=
,00 =A0 =A0 =A00,00<br>15:29:09 =A0 =A0 =A0 =A0 eth0 =A0 8147,00 =A0 4079,0=
0 =A012063,73 =A0 =A0278,77 =A0 =A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<br>
15:29:10 =A0 =A0 =A0 =A0 eth0 =A0 8123,00 =A0 4064,00 =A012029,34 =A0 =A027=
7,88 =A0 =A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<br>15:29:11 =A0 =A0 =A0 =A0 e=
th0 =A0 8155,00 =A0 4096,00 =A012066,30 =A0 =A0280,00 =A0 =A00,00 =A0 =A0 0=
,00 =A0 =A0 =A00,00<br>15:29:12 =A0 =A0 =A0 =A0 eth0 =A0 8129,00 =A0 4111,0=
0 =A012029,02 =A0 =A0281,03 =A0 =A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<br>
15:29:13 =A0 =A0 =A0 =A0 eth0 =A0 3213,00 =A0 1631,00 =A0 4741,51 =A0 =A011=
1,49 =A0 =A0=A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<br>15:29:14 =A0 =A0 =A0 =
=A0 eth0 =A0 =A0 17,00 =A0 =A0 =A00,00 =A0 =A0 =A01,88 =A0 =A0 =A00,00 =A0 =
=A0 =A0 =A0 =A0 =A0=A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<br>15:29:15 =A0 =A0=
 =A0 =A0 eth0 =A0 =A0 12,00 =A0 =A0 =A00,00 =A0 =A0 =A01,46 =A0 =A0 =A00,00=
 =A0 =A0 =A0 =A0 =A0 =A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<br>
15:29:16 =A0 =A0 =A0 =A0 eth0 =A0 =A0 19,00 =A0 =A0 =A00,00 =A0 =A0 =A02,44=
 =A0 =A0 =A00,00 =A0 =A0 =A0 =A0 =A0 =A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<b=
r>Average: =A0 =A0 =A0 =A0 eth0 =A0 5490,27 =A0 2749,53 =A0 8121,63 =A0 =A0=
187,96 =A0 =A0=A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<font face=3D"arial, sans=
-serif"><br>
</font><div><br></div><div>Has anyone seen something like this?<br></div><d=
iv><br></div>DomU executes a Debian Squeeze 64 bits OS. Dom0 is provided by=
 Xen 4.0.1.<br><br>Thanks,<div><br>Ricardo Jos=E9 Pfitscher</div></div></di=
v>
</div><br>

--e89a8f22bd8904e03404cea0347d--


--===============8011439395201353072==
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.xen.org
http://lists.xen.org/xen-devel

--===============8011439395201353072==--


From xen-devel-bounces@lists.xen.org Fri Nov 16 17:36:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 17:36:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZPq0-0003oS-1n; Fri, 16 Nov 2012 17:36:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ricardo.pfitscher@gmail.com>) id 1TZPpx-0003oN-VV
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 17:36:18 +0000
Received: from [85.158.139.83:47604] by server-3.bemta-5.messagelabs.com id
	D7/F9-18736-19976A05; Fri, 16 Nov 2012 17:36:17 +0000
X-Env-Sender: ricardo.pfitscher@gmail.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1353087370!26352017!1
X-Originating-IP: [209.85.215.45]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2566 invoked from network); 16 Nov 2012 17:36:10 -0000
Received: from mail-la0-f45.google.com (HELO mail-la0-f45.google.com)
	(209.85.215.45)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 17:36:10 -0000
Received: by mail-la0-f45.google.com with SMTP id p9so823253laa.32
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 09:36:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=iugkdDZkf2/WFgqGRVBVLredHXSJf4+A5UuCJk5BDmE=;
	b=wlY0pVz4L45pfJ/uKCafW+az7SSaNSnRMqVVSDx9dJd1NLClcTDwkRbzd6FqVLgWc0
	RlAPILdhKPSjhUfagKj4njwk1Bge4spx3mN2f4IEGLvJmi9GGOC7UP+bE34wCCZ0GEoR
	Ew3FY8bvPIMEV/+nToUZTT7y9euOjyKTtZWRkRxL8fDPlhwKE0jJrVoM54gXzkhrdovB
	xMpJiFoSuLETE57foUpuAU8eWULGzg33miAdvHzZmCjnvepMjBIomgKH2GVPr6afOmX4
	ONmaW58m2bzPUvmI8xQHPkyBZT48IxgyPL+9JXdj9FXvPoDMzSVqSETDf83gy1nKSn53
	iMLQ==
MIME-Version: 1.0
Received: by 10.152.147.100 with SMTP id tj4mr4855167lab.42.1353087369666;
	Fri, 16 Nov 2012 09:36:09 -0800 (PST)
Received: by 10.112.26.70 with HTTP; Fri, 16 Nov 2012 09:36:09 -0800 (PST)
Date: Fri, 16 Nov 2012 15:36:09 -0200
Message-ID: <CABA9-+qM6_qfbpZF9tcuHW5pbMovhfeJ8uOn5Vp-x_kq8oqMxg@mail.gmail.com>
From: Ricardo Jose Pfitscher <ricardo.pfitscher@gmail.com>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] sar incorrect network measurement in DomU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8011439395201353072=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============8011439395201353072==
Content-Type: multipart/alternative; boundary=e89a8f22bd8904e03404cea0347d

--e89a8f22bd8904e03404cea0347d
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello Everyone,

I'm reposting this from Xen-Users since I didn't get any
answers there, sorry for cross-posting.

I'm using sar to monitor network throughput in a paravirtualized DomU and
I'm seeing some odd values.

For example, if I run iperf on a 100 MBps network with another machine as
the client and either dom0 or domU as the server, I get the same results:

DomU$ iperf -s
[  4] local 192.168.0.1 port 5001 connected with 10.20.129.175 port 37766
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.1 sec    114 MBytes  94.1 Mbits/sec

Dom0$ iperf -s
[  4] local 10.20.129.178 port 5001 connected with 10.20.129.175 port 58763
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.1 sec    113 MBytes  94.1 Mbits/sec

But when measure the throughput with sar while running iperf, the results
are wrong in DomU:

DomU$ sar -n DEV 1 15

15:24:37        IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s rxcmp/s
txcmp/s  rxmcst/s
15:24:38         eth0   3177.30   1591.41   4651.67    102.58 0.00     0.00
     0.00
15:24:39         eth0   5641.67   2822.22   8264.16    181.90 0.00     0.00
     0.00
15:24:40         eth0   5684.62   2840.56   8327.07    183.08 0.00     0.00
     0.00
15:24:41         eth0   5722.54   2856.34   8382.62    184.10 0.00     0.00
     0.00
15:24:42         eth0   5684.62   2825.17   8327.07    182.09 0.00     0.00
     0.00
15:24:43         eth0   5682.52   2843.36   8324.00    183.26 0.00     0.00
     0.00
15:24:44         eth0   5721.83   2857.04   8381.59    184.15 0.00     0.00
     0.00
15:24:45         eth0   5764.54   2878.01   8444.15    185.50 0.00     0.00
     0.00
15:24:46         eth0   5641.67   2808.33   8264.16    181.01 0.00     0.00
     0.00
15:24:47         eth0   5802.86   2892.14   8500.28    186.41 0.00     0.00
     0.00
15:24:48         eth0   2343.27   1171.35   3430.90     75.50 0.00     0.00
     0.00
15:24:49         eth0      0.00      0.00      0.00         0.00 0.00
 0.00      0.00
15:24:50         eth0      0.00      0.00      0.00      0.00 0.00     0.00
     0.00
15:24:51         eth0      0.00      0.00      0.00      0.00 0.00     0.00
     0.00
15:24:52         eth0      0.50      0.50      0.01      0.02 0.00     0.00
     0.00
Average:         eth0   3410.19   1702.32   4995.05    109.72 0.00     0.00
     0.00

During the test, sar gives roughly 8,5MB/s in rxkB/s, while it should be
11,76MB/s (94Mbps), as measured by iperf.

When I run the same measurements in Dom0 I get far better results:

15:29:02        IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s rxcmp/s
 txcmp/s  rxmcst/s
15:29:02         eth0     20,00      0,00      2,38      0,00 0,00     0,00
     0,00
15:29:03         eth0   5856,00   2938,00   8667,55    200,89     0,00
0,00      0,00
15:29:04         eth0   8125,00   4069,00  12029,87    278,15    0,00
0,00      0,00
15:29:05         eth0   8145,00   4073,00  12066,25    278,43    0,00
0,00      0,00
15:29:06         eth0   8121,00   4063,00  12027,94    277,74    0,00
0,00      0,00
15:29:07         eth0   8150,00   4055,00  12065,41    277,20    0,00
0,00      0,00
15:29:08         eth0   8122,00   4064,00  12029,42    277,81    0,00
0,00      0,00
15:29:09         eth0   8147,00   4079,00  12063,73    278,77    0,00
0,00      0,00
15:29:10         eth0   8123,00   4064,00  12029,34    277,88    0,00
0,00      0,00
15:29:11         eth0   8155,00   4096,00  12066,30    280,00    0,00
0,00      0,00
15:29:12         eth0   8129,00   4111,00  12029,02    281,03    0,00
0,00      0,00
15:29:13         eth0   3213,00   1631,00   4741,51    111,49     0,00
0,00      0,00
15:29:14         eth0     17,00      0,00      1,88      0,00
  0,00     0,00      0,00
15:29:15         eth0     12,00      0,00      1,46      0,00
 0,00     0,00      0,00
15:29:16         eth0     19,00      0,00      2,44      0,00
 0,00     0,00      0,00
Average:         eth0   5490,27   2749,53   8121,63    187,96     0,00
0,00      0,00

Has anyone seen something like this?

DomU executes a Debian Squeeze 64 bits OS. Dom0 is provided by Xen 4.0.1.

Thanks,

Ricardo Jos=E9 Pfitscher

--e89a8f22bd8904e03404cea0347d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div><div style=3D"font-family:arial,sans-serif;font-size:13px">Hello Every=
one,<br></div><div style=3D"font-family:arial,sans-serif;font-size:13px"><b=
r></div><span style=3D"font-family:arial,sans-serif;font-size:13px">I&#39;m=
 reposting this from Xen-Users since I didn&#39;t get any</span><br style=
=3D"font-family:arial,sans-serif;font-size:13px">
<span style=3D"font-family:arial,sans-serif;font-size:13px">answers there, =
sorry for cross-posting.</span><br style=3D"font-family:arial,sans-serif;fo=
nt-size:13px"><div style=3D"font-family:arial,sans-serif;font-size:13px"><b=
r>
</div><div style=3D"font-family:arial,sans-serif;font-size:13px">I&#39;m us=
ing sar to monitor network throughput in a paravirtualized DomU=A0and I&#39=
;m seeing some odd values.<br><br>For example, if I run iperf on a 100 MBps=
 network with another machine=A0as the client and either dom0 or domU as th=
e server, I get the same=A0results:<div>
<div><br></div>DomU$ iperf -s<br>[ =A04] local 192.168.0.1 port 5001 connec=
ted with 10.20.129.175 port 37766<br>[ ID] Interval =A0 =A0 =A0 Transfer =
=A0 =A0 Bandwidth<br>[ =A04] =A00.0-10.1 sec =A0 =A0114 MBytes =A094.1 Mbit=
s/sec<br><br>Dom0$ iperf -s<br>
[ =A04] local 10.20.129.178 port 5001 connected with 10.20.129.175 port 587=
63<br>[ ID] Interval =A0 =A0 =A0 Transfer =A0 =A0 Bandwidth<br>[ =A04] =A00=
.0-10.1 sec =A0 =A0113 MBytes =A094.1 Mbits/sec<br><div><br></div>But when =
measure the throughput with sar while running iperf, the=A0results are wron=
g in DomU:</div>
<div><br></div>DomU$ sar -n DEV 1 15<br><br>15:24:37 =A0 =A0 =A0 =A0IFACE =
=A0 rxpck/s =A0 txpck/s =A0 =A0rxkB/s =A0 =A0txkB/s rxcmp/s =A0 txcmp/s =A0=
rxmcst/s<br>15:24:38 =A0 =A0 =A0 =A0 eth0 =A0 3177.30 =A0 1591.41 =A0 4651.=
67 =A0 =A0102.58 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>
15:24:39 =A0 =A0 =A0 =A0 eth0 =A0 5641.67 =A0 2822.22 =A0 8264.16 =A0 =A018=
1.90 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>15:24:40 =A0 =A0 =A0 =A0 eth0 =A0=
 5684.62 =A0 2840.56 =A0 8327.07 =A0 =A0183.08 0.00 =A0 =A0 0.00 =A0 =A0 =
=A00.00<br>15:24:41 =A0 =A0 =A0 =A0 eth0 =A0 5722.54 =A0 2856.34 =A0 8382.6=
2 =A0 =A0184.10 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>
15:24:42 =A0 =A0 =A0 =A0 eth0 =A0 5684.62 =A0 2825.17 =A0 8327.07 =A0 =A018=
2.09 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>15:24:43 =A0 =A0 =A0 =A0 eth0 =A0=
 5682.52 =A0 2843.36 =A0 8324.00 =A0 =A0183.26 0.00 =A0 =A0 0.00 =A0 =A0 =
=A00.00<br>15:24:44 =A0 =A0 =A0 =A0 eth0 =A0 5721.83 =A0 2857.04 =A0 8381.5=
9 =A0 =A0184.15 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>
15:24:45 =A0 =A0 =A0 =A0 eth0 =A0 5764.54 =A0 2878.01 =A0 8444.15 =A0 =A018=
5.50 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>15:24:46 =A0 =A0 =A0 =A0 eth0 =A0=
 5641.67 =A0 2808.33 =A0 8264.16 =A0 =A0181.01 0.00 =A0 =A0 0.00 =A0 =A0 =
=A00.00<br>15:24:47 =A0 =A0 =A0 =A0 eth0 =A0 5802.86 =A0 2892.14 =A0 8500.2=
8 =A0 =A0186.41 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>
15:24:48 =A0 =A0 =A0 =A0 eth0 =A0 2343.27 =A0 1171.35 =A0 3430.90 =A0 =A0 7=
5.50 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>15:24:49 =A0 =A0 =A0 =A0 eth0 =A0=
 =A0 =A00.00 =A0 =A0 =A00.00 =A0 =A0 =A00.00 =A0 =A0 =A0 =A0 0.00 0.00 =A0 =
=A0 =A00.00 =A0 =A0 =A00.00<br>15:24:50 =A0 =A0 =A0 =A0 eth0 =A0 =A0 =A00.0=
0 =A0 =A0 =A00.00 =A0 =A0 =A00.00 =A0 =A0 =A00.00 0.00 =A0 =A0 0.00 =A0 =A0=
 =A00.00<br>
15:24:51 =A0 =A0 =A0 =A0 eth0 =A0 =A0 =A00.00 =A0 =A0 =A00.00 =A0 =A0 =A00.=
00 =A0 =A0 =A00.00 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>15:24:52 =A0 =A0 =
=A0 =A0 eth0 =A0 =A0 =A00.50 =A0 =A0 =A00.50 =A0 =A0 =A00.01 =A0 =A0 =A00.0=
2 0.00 =A0 =A0 0.00 =A0 =A0 =A00.00<br>Average: =A0 =A0 =A0 =A0 eth0 =A0 34=
10.19 =A0 1702.32 =A0 4995.05 =A0 =A0109.72 0.00 =A0 =A0 0.00 =A0 =A0 =A00.=
00<div>
<br></div><div>During the test, sar gives roughly 8,5MB/s in rxkB/s, while =
it should=A0be 11,76MB/s (94Mbps), as measured by iperf.<br><br>When I run =
the same measurements in Dom0 I get far better results:</div><div><br></div=
>
<div>15:29:02 =A0 =A0 =A0 =A0IFACE =A0 rxpck/s =A0 txpck/s =A0 =A0rxkB/s =
=A0 =A0txkB/s=A0rxcmp/s =A0txcmp/s =A0rxmcst/s<br>15:29:02 =A0 =A0 =A0 =A0 =
eth0 =A0 =A0 20,00 =A0 =A0 =A00,00 =A0 =A0 =A02,38 =A0 =A0 =A00,00=A00,00 =
=A0 =A0 0,00 =A0 =A0 =A00,00<br>15:29:03 =A0 =A0 =A0 =A0 eth0 =A0 5856,00 =
=A0 2938,00 =A0 8667,55 =A0 =A0200,89 =A0 =A0=A00,00 =A0 =A0 0,00 =A0 =A0 =
=A00,00<br>
15:29:04 =A0 =A0 =A0 =A0 eth0 =A0 8125,00 =A0 4069,00 =A012029,87 =A0 =A027=
8,15 =A0 =A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<br>15:29:05 =A0 =A0 =A0 =A0 e=
th0 =A0 8145,00 =A0 4073,00 =A012066,25 =A0 =A0278,43 =A0 =A00,00 =A0 =A0 0=
,00 =A0 =A0 =A00,00<br>15:29:06 =A0 =A0 =A0 =A0 eth0 =A0 8121,00 =A0 4063,0=
0 =A012027,94 =A0 =A0277,74 =A0 =A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<br>
15:29:07 =A0 =A0 =A0 =A0 eth0 =A0 8150,00 =A0 4055,00 =A012065,41 =A0 =A027=
7,20 =A0 =A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<br>15:29:08 =A0 =A0 =A0 =A0 e=
th0 =A0 8122,00 =A0 4064,00 =A012029,42 =A0 =A0277,81 =A0 =A00,00 =A0 =A0 0=
,00 =A0 =A0 =A00,00<br>15:29:09 =A0 =A0 =A0 =A0 eth0 =A0 8147,00 =A0 4079,0=
0 =A012063,73 =A0 =A0278,77 =A0 =A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<br>
15:29:10 =A0 =A0 =A0 =A0 eth0 =A0 8123,00 =A0 4064,00 =A012029,34 =A0 =A027=
7,88 =A0 =A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<br>15:29:11 =A0 =A0 =A0 =A0 e=
th0 =A0 8155,00 =A0 4096,00 =A012066,30 =A0 =A0280,00 =A0 =A00,00 =A0 =A0 0=
,00 =A0 =A0 =A00,00<br>15:29:12 =A0 =A0 =A0 =A0 eth0 =A0 8129,00 =A0 4111,0=
0 =A012029,02 =A0 =A0281,03 =A0 =A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<br>
15:29:13 =A0 =A0 =A0 =A0 eth0 =A0 3213,00 =A0 1631,00 =A0 4741,51 =A0 =A011=
1,49 =A0 =A0=A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<br>15:29:14 =A0 =A0 =A0 =
=A0 eth0 =A0 =A0 17,00 =A0 =A0 =A00,00 =A0 =A0 =A01,88 =A0 =A0 =A00,00 =A0 =
=A0 =A0 =A0 =A0 =A0=A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<br>15:29:15 =A0 =A0=
 =A0 =A0 eth0 =A0 =A0 12,00 =A0 =A0 =A00,00 =A0 =A0 =A01,46 =A0 =A0 =A00,00=
 =A0 =A0 =A0 =A0 =A0 =A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<br>
15:29:16 =A0 =A0 =A0 =A0 eth0 =A0 =A0 19,00 =A0 =A0 =A00,00 =A0 =A0 =A02,44=
 =A0 =A0 =A00,00 =A0 =A0 =A0 =A0 =A0 =A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<b=
r>Average: =A0 =A0 =A0 =A0 eth0 =A0 5490,27 =A0 2749,53 =A0 8121,63 =A0 =A0=
187,96 =A0 =A0=A00,00 =A0 =A0 0,00 =A0 =A0 =A00,00<font face=3D"arial, sans=
-serif"><br>
</font><div><br></div><div>Has anyone seen something like this?<br></div><d=
iv><br></div>DomU executes a Debian Squeeze 64 bits OS. Dom0 is provided by=
 Xen 4.0.1.<br><br>Thanks,<div><br>Ricardo Jos=E9 Pfitscher</div></div></di=
v>
</div><br>

--e89a8f22bd8904e03404cea0347d--


--===============8011439395201353072==
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.xen.org
http://lists.xen.org/xen-devel

--===============8011439395201353072==--


From xen-devel-bounces@lists.xen.org Fri Nov 16 17:59:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 17:59:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQCG-00045D-6A; Fri, 16 Nov 2012 17:59:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TZQCE-000458-Om
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 17:59:19 +0000
Received: from [85.158.143.99:60445] by server-3.bemta-4.messagelabs.com id
	98/23-06841-6FE76A05; Fri, 16 Nov 2012 17:59:18 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353088756!23206693!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzIzMDk1\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26664 invoked from network); 16 Nov 2012 17:59:16 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-6.tower-216.messagelabs.com with SMTP;
	16 Nov 2012 17:59:16 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga101.jf.intel.com with ESMTP; 16 Nov 2012 09:59:11 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,266,1352102400"; d="scan'208";a="220748932"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by orsmga001.jf.intel.com with ESMTP; 16 Nov 2012 09:59:11 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 16 Nov 2012 09:59:10 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Sat, 17 Nov 2012 01:59:08 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Thread-Topic: [PATCH V2] X86/vMCE: handle broken page with regard to migration
Thread-Index: AQHNwxOja/8d/5CcCU+RhogRGZhHOJfswMgg
Date: Fri, 16 Nov 2012 17:59:08 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233538DE00@SHSMSX101.ccr.corp.intel.com>
References: <da7faf53790e661cb6c4.1352944365@ljsromley.bj.intel.com>
	<1352971714.3499.57.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352971714.3499.57.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V2] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell wrote:
> On Thu, 2012-11-15 at 01:52 +0000, Liu Jinsong wrote:
>> Generally, there are 2 cases:
>> 1. broken page occurs before migration
>> 2. broken page occurs during migration
>> 
>> At the sender
>>   For case 1, the broken page would be mapped but not copied to
>> target 
> 
> Do you mean "will be mapped"? "would be" is past tense which suggests
> it was the behaviour before this patch, which I don't think is what
> you meant (here and elsewhere in the commit message).

Yes.

> 
>>   (otherwise it may trigger more serious error, say, SRAR error).
>>   While its pfn_type and pfn number would be transferred to target
>>   so that target take appropriate action.
>> 
>>   For case 2, mce handler marks the broken page to dirty bitmap, so
>>   that at copypages stage of migration, its pfn_type and pfn number
>>   would be transferred to target and then take appropriate action.
> 
> What happens if the page is marked broken during the final pass?
> 

Have updated the patch to handle this case, by doing one more iteration so that the broken page's pfn_type and pfn number got chance to be transferred to the target. Will send out soon.

>> At the target
>>   When migration target would populate pages for guest. As for the
>>   case of broken page wrt migration, we prefer keep the
>>   corresponding page, for the sake of seamless migration.
> 
> I don't understanding this paragraph, what do you mean by "keep the
> corresponding page"? My understanding is the patch explicitly doesn't
> keep the page, it marks it as broken.
> 
> Did you perhaps mean "... we prefer to keep the type of the page for
> the sake..." ?
> 

Yes.

Thanks,
Jinsong

>>   At target it would set p2m as p2m_ram_broken for broken page.
>>   Guest MCE may have good chance to handle its broken page, while if
>>   guest access the broken page again it would kill itself as
>> expected. 
>> 
>> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
>> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
>> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
>> Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
>> Acked-by: Jan Beulich <JBeulich@suse.com>
>> 
>> diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xc_domain.c
>> --- a/tools/libxc/xc_domain.c	Tue Nov 13 11:19:17 2012 +0000
>> +++ b/tools/libxc/xc_domain.c	Thu Nov 15 09:42:24 2012 +0800 @@
>>      -283,6 +283,22 @@ return ret;
>>  }
>> 
>> +/* set broken page p2m */
>> +int xc_set_broken_page_p2m(xc_interface *xch,
>> +                           uint32_t domid,
>> +                           unsigned long pfn)
>> +{
>> +    int ret;
>> +    DECLARE_DOMCTL;
>> +
>> +    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
>> +    domctl.domain = (domid_t)domid;
>> +    domctl.u.set_broken_page_p2m.pfn = pfn;
>> +    ret = do_domctl(xch, &domctl);
>> +
>> +    return ret ? -1 : 0;
>> +}
>> +
>>  /* get info from hvm guest for save */
>>  int xc_domain_hvm_getcontext(xc_interface *xch,
>>                               uint32_t domid,
>> diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xc_domain_restore.c
>> --- a/tools/libxc/xc_domain_restore.c	Tue Nov 13 11:19:17 2012 +0000
>> +++ b/tools/libxc/xc_domain_restore.c	Thu Nov 15 09:42:24 2012 +0800
>> @@ -1023,9 +1023,15 @@ 
>> 
>>      countpages = count;
>>      for (i = oldcount; i < buf->nr_pages; ++i)
>> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
>> XEN_DOMCTL_PFINFO_XTAB 
>> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
>> XEN_DOMCTL_PFINFO_XALLOC) +    { +        unsigned long pagetype;
>> +
>> +        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
>> +        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
>> +             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
>> +             pagetype == XEN_DOMCTL_PFINFO_XALLOC )             
>> --countpages; +    }
>> 
>>      if (!countpages)
>>          return count;
>> @@ -1267,6 +1273,17 @@
>>              /* a bogus/unmapped/allocate-only page: skip it */     
>> continue; 
>> 
>> +        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN ) +        {
>> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) ) +         
>> { +                ERROR("Set p2m for broken page failed, "
>> +                      "dom=%d, pfn=%lx\n", dom, pfn);
>> +                goto err_mapped;
>> +            }
>> +            continue;
>> +        }
>> +
>>          if (pfn_err[i])
>>          {
>>              ERROR("unexpected PFN mapping failure pfn %lx map_mfn
>> %lx p2m_mfn %lx", 
>> diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xc_domain_save.c
>> --- a/tools/libxc/xc_domain_save.c	Tue Nov 13 11:19:17 2012 +0000
>> +++ b/tools/libxc/xc_domain_save.c	Thu Nov 15 09:42:24 2012 +0800 @@
>>                  -1277,6 +1277,13 @@ if ( !hvm )
>>                      gmfn = pfn_to_mfn(gmfn);
>> 
>> +                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN ) +   
>> { +                    pfn_type[j] |= pfn_batch[j];
>> +                    ++run;
>> +                    continue;
>> +                }
>> +
>>                  if ( pfn_err[j] )
>>                  {
>>                      if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB ) @@
>>                      -1371,8 +1378,12 @@ }
>>                  }
>> 
>> -                /* skip pages that aren't present or are alloc-only
>> */ +                /* +                 * skip pages that aren't
>> present, +                 * or are broken, or are alloc-only +     
>>                  */ if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
>> +                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
>>                      || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>>                      continue;
>> 
>> diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xenctrl.h
>> --- a/tools/libxc/xenctrl.h	Tue Nov 13 11:19:17 2012 +0000
>> +++ b/tools/libxc/xenctrl.h	Thu Nov 15 09:42:24 2012 +0800 @@ -575,6
>>                            +575,17 @@ xc_domaininfo_t *info);
>> 
>>  /**
>> + * This function set p2m for broken page
>> + * &parm xch a handle to an open hypervisor interface
>> + * @parm domid the domain id which broken page belong to
>> + * @parm pfn the pfn number of the broken page
>> + * @return 0 on success, -1 on failure
>> + */
>> +int xc_set_broken_page_p2m(xc_interface *xch,
>> +                           uint32_t domid,
>> +                           unsigned long pfn);
>> +
>> +/**
>>   * This function returns information about the context of a hvm
>> domain 
>>   * @parm xch a handle to an open hypervisor interface
>>   * @parm domid the domain to get information from
>> diff -r 8b93ac0c93f3 -r da7faf53790e
>> xen/arch/x86/cpu/mcheck/mcaction.c ---
>> a/xen/arch/x86/cpu/mcheck/mcaction.c	Tue Nov 13 11:19:17 2012 +0000
>>  +++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Thu Nov 15 09:42:24 2012
>>  +0800 @@ -1,5 +1,6 @@ #include <xen/types.h> #include <xen/sched.h>
>> +#include <asm/p2m.h>
>>  #include "mcaction.h"
>>  #include "vmce.h"
>>  #include "mce.h"
>> @@ -91,6 +92,24 @@
>>                      goto vmce_failed;
>>                  }
>> 
>> +                if ( is_hvm_domain(d) &&
>> !d->arch.hvm_domain.dirty_vram && +                    
>> paging_mode_log_dirty(d) ) +                {
>> +                    /*
>> +                     * vMCE occur during migration +               
>> * +                     *   At sender, it marks broken page to dirty
>> bitmap, +                     *   so that at copypages stage of
>> migration, broken +                     *   page's pfn_type and pfn
>> number would be transferred +                     *   to target and
>> then take appropriate action. +                     * +             
>> *   At target, it would set p2m as p2m_ram_broken for +             
>> *   broken page, so that if guest access the broken page +          
>> *   again, it would kill itself as expected. +                    
>> */ +                    paging_mark_dirty(d, mfn); +                }
>> +
>>                  if ( unmmap_broken_page(d, _mfn(mfn), gfn) )       
>>                      { printk("Unmap broken memory %lx for DOM%d
>> failed\n", 
>> diff -r 8b93ac0c93f3 -r da7faf53790e xen/arch/x86/domctl.c
>> --- a/xen/arch/x86/domctl.c	Tue Nov 13 11:19:17 2012 +0000
>> +++ b/xen/arch/x86/domctl.c	Thu Nov 15 09:42:24 2012 +0800 @@
>>                  -209,12 +209,18 @@ for ( j = 0; j < k; j++ )
>>                  {
>>                      unsigned long type = 0;
>> +                    p2m_type_t t;
>> 
>> -                    page = get_page_from_gfn(d, arr[j], NULL,
>> P2M_ALLOC); +                    page = get_page_from_gfn(d, arr[j],
>> &t, P2M_ALLOC); 
>> 
>>                      if ( unlikely(!page) ||
>>                           unlikely(is_xen_heap_page(page)) )
>> -                        type = XEN_DOMCTL_PFINFO_XTAB; +           
>> { +                        if ( p2m_is_broken(t) )
>> +                            type = XEN_DOMCTL_PFINFO_BROKEN; +     
>> else +                            type = XEN_DOMCTL_PFINFO_XTAB; +  
>>                      } else
>>                      {
>>                          switch( page->u.inuse.type_info &
>> PGT_type_mask ) @@ -235,6 +241,9 @@ 
>> 
>>                          if ( page->u.inuse.type_info & PGT_pinned )
>>                              type |= XEN_DOMCTL_PFINFO_LPINTAB; +
>> +                        if ( page->count_info & PGC_broken )
>> +                            type = XEN_DOMCTL_PFINFO_BROKEN;       
>> } 
>> 
>>                      if ( page )
>> @@ -1568,6 +1577,29 @@
>>      }
>>      break;
>> 
>> +    case XEN_DOMCTL_set_broken_page_p2m:
>> +    {
>> +        struct domain *d;
>> +
>> +        d = rcu_lock_domain_by_id(domctl->domain); +        if ( d
>> != NULL ) +        {
>> +            p2m_type_t pt;
>> +            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
>> +            mfn_t mfn = get_gfn_query(d, pfn, &pt); +
>> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt)
>> || +                         (p2m_change_type(d, pfn, pt,
>> p2m_ram_broken) != pt)) ) +                ret = -EINVAL;
>> +
>> +            put_gfn(d, pfn);
>> +            rcu_unlock_domain(d);
>> +        }
>> +        else
>> +            ret = -ESRCH;
>> +    }
>> +    break;
>> +
>>      default:
>>          ret = iommu_do_domctl(domctl, u_domctl);
>>          break;
>> diff -r 8b93ac0c93f3 -r da7faf53790e xen/include/public/domctl.h
>> --- a/xen/include/public/domctl.h	Tue Nov 13 11:19:17 2012 +0000
>> +++ b/xen/include/public/domctl.h	Thu Nov 15 09:42:24 2012 +0800 @@
>>  -136,6 +136,7 @@ #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
>>  #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
>>  #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page
>> */ +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
>>  #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
>> 
>>  struct xen_domctl_getpageframeinfo {
>> @@ -834,6 +835,12 @@
>>  typedef struct xen_domctl_set_access_required
>>  xen_domctl_set_access_required_t;
>> DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t); 
>> 
>> +struct xen_domctl_set_broken_page_p2m {
>> +    uint64_aligned_t pfn;
>> +};
>> +typedef struct xen_domctl_set_broken_page_p2m
>> xen_domctl_set_broken_page_p2m_t;
>>  +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t); +
>>      struct xen_domctl { uint32_t cmd;
>>  #define XEN_DOMCTL_createdomain                   1 @@ -899,6
>>  +906,7 @@ #define XEN_DOMCTL_set_access_required           64
>>  #define XEN_DOMCTL_audit_p2m                     65
>>  #define XEN_DOMCTL_set_virq_handler              66
>> +#define XEN_DOMCTL_set_broken_page_p2m           67
>>  #define XEN_DOMCTL_gdbsx_guestmemio            1000
>>  #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>>  #define XEN_DOMCTL_gdbsx_unpausevcpu           1002 @@ -954,6
>>          +962,7 @@ struct xen_domctl_audit_p2m         audit_p2m;
>>          struct xen_domctl_set_virq_handler  set_virq_handler;
>>          struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
>> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>>          struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>>          struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>>          uint8_t                             pad[128];


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 17:59:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 17:59:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQCG-00045D-6A; Fri, 16 Nov 2012 17:59:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TZQCE-000458-Om
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 17:59:19 +0000
Received: from [85.158.143.99:60445] by server-3.bemta-4.messagelabs.com id
	98/23-06841-6FE76A05; Fri, 16 Nov 2012 17:59:18 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353088756!23206693!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzIzMDk1\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26664 invoked from network); 16 Nov 2012 17:59:16 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-6.tower-216.messagelabs.com with SMTP;
	16 Nov 2012 17:59:16 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga101.jf.intel.com with ESMTP; 16 Nov 2012 09:59:11 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,266,1352102400"; d="scan'208";a="220748932"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by orsmga001.jf.intel.com with ESMTP; 16 Nov 2012 09:59:11 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 16 Nov 2012 09:59:10 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Sat, 17 Nov 2012 01:59:08 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Thread-Topic: [PATCH V2] X86/vMCE: handle broken page with regard to migration
Thread-Index: AQHNwxOja/8d/5CcCU+RhogRGZhHOJfswMgg
Date: Fri, 16 Nov 2012 17:59:08 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233538DE00@SHSMSX101.ccr.corp.intel.com>
References: <da7faf53790e661cb6c4.1352944365@ljsromley.bj.intel.com>
	<1352971714.3499.57.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352971714.3499.57.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V2] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell wrote:
> On Thu, 2012-11-15 at 01:52 +0000, Liu Jinsong wrote:
>> Generally, there are 2 cases:
>> 1. broken page occurs before migration
>> 2. broken page occurs during migration
>> 
>> At the sender
>>   For case 1, the broken page would be mapped but not copied to
>> target 
> 
> Do you mean "will be mapped"? "would be" is past tense which suggests
> it was the behaviour before this patch, which I don't think is what
> you meant (here and elsewhere in the commit message).

Yes.

> 
>>   (otherwise it may trigger more serious error, say, SRAR error).
>>   While its pfn_type and pfn number would be transferred to target
>>   so that target take appropriate action.
>> 
>>   For case 2, mce handler marks the broken page to dirty bitmap, so
>>   that at copypages stage of migration, its pfn_type and pfn number
>>   would be transferred to target and then take appropriate action.
> 
> What happens if the page is marked broken during the final pass?
> 

Have updated the patch to handle this case, by doing one more iteration so that the broken page's pfn_type and pfn number got chance to be transferred to the target. Will send out soon.

>> At the target
>>   When migration target would populate pages for guest. As for the
>>   case of broken page wrt migration, we prefer keep the
>>   corresponding page, for the sake of seamless migration.
> 
> I don't understanding this paragraph, what do you mean by "keep the
> corresponding page"? My understanding is the patch explicitly doesn't
> keep the page, it marks it as broken.
> 
> Did you perhaps mean "... we prefer to keep the type of the page for
> the sake..." ?
> 

Yes.

Thanks,
Jinsong

>>   At target it would set p2m as p2m_ram_broken for broken page.
>>   Guest MCE may have good chance to handle its broken page, while if
>>   guest access the broken page again it would kill itself as
>> expected. 
>> 
>> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
>> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
>> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
>> Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
>> Acked-by: Jan Beulich <JBeulich@suse.com>
>> 
>> diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xc_domain.c
>> --- a/tools/libxc/xc_domain.c	Tue Nov 13 11:19:17 2012 +0000
>> +++ b/tools/libxc/xc_domain.c	Thu Nov 15 09:42:24 2012 +0800 @@
>>      -283,6 +283,22 @@ return ret;
>>  }
>> 
>> +/* set broken page p2m */
>> +int xc_set_broken_page_p2m(xc_interface *xch,
>> +                           uint32_t domid,
>> +                           unsigned long pfn)
>> +{
>> +    int ret;
>> +    DECLARE_DOMCTL;
>> +
>> +    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
>> +    domctl.domain = (domid_t)domid;
>> +    domctl.u.set_broken_page_p2m.pfn = pfn;
>> +    ret = do_domctl(xch, &domctl);
>> +
>> +    return ret ? -1 : 0;
>> +}
>> +
>>  /* get info from hvm guest for save */
>>  int xc_domain_hvm_getcontext(xc_interface *xch,
>>                               uint32_t domid,
>> diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xc_domain_restore.c
>> --- a/tools/libxc/xc_domain_restore.c	Tue Nov 13 11:19:17 2012 +0000
>> +++ b/tools/libxc/xc_domain_restore.c	Thu Nov 15 09:42:24 2012 +0800
>> @@ -1023,9 +1023,15 @@ 
>> 
>>      countpages = count;
>>      for (i = oldcount; i < buf->nr_pages; ++i)
>> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
>> XEN_DOMCTL_PFINFO_XTAB 
>> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
>> XEN_DOMCTL_PFINFO_XALLOC) +    { +        unsigned long pagetype;
>> +
>> +        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
>> +        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
>> +             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
>> +             pagetype == XEN_DOMCTL_PFINFO_XALLOC )             
>> --countpages; +    }
>> 
>>      if (!countpages)
>>          return count;
>> @@ -1267,6 +1273,17 @@
>>              /* a bogus/unmapped/allocate-only page: skip it */     
>> continue; 
>> 
>> +        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN ) +        {
>> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) ) +         
>> { +                ERROR("Set p2m for broken page failed, "
>> +                      "dom=%d, pfn=%lx\n", dom, pfn);
>> +                goto err_mapped;
>> +            }
>> +            continue;
>> +        }
>> +
>>          if (pfn_err[i])
>>          {
>>              ERROR("unexpected PFN mapping failure pfn %lx map_mfn
>> %lx p2m_mfn %lx", 
>> diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xc_domain_save.c
>> --- a/tools/libxc/xc_domain_save.c	Tue Nov 13 11:19:17 2012 +0000
>> +++ b/tools/libxc/xc_domain_save.c	Thu Nov 15 09:42:24 2012 +0800 @@
>>                  -1277,6 +1277,13 @@ if ( !hvm )
>>                      gmfn = pfn_to_mfn(gmfn);
>> 
>> +                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN ) +   
>> { +                    pfn_type[j] |= pfn_batch[j];
>> +                    ++run;
>> +                    continue;
>> +                }
>> +
>>                  if ( pfn_err[j] )
>>                  {
>>                      if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB ) @@
>>                      -1371,8 +1378,12 @@ }
>>                  }
>> 
>> -                /* skip pages that aren't present or are alloc-only
>> */ +                /* +                 * skip pages that aren't
>> present, +                 * or are broken, or are alloc-only +     
>>                  */ if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
>> +                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
>>                      || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>>                      continue;
>> 
>> diff -r 8b93ac0c93f3 -r da7faf53790e tools/libxc/xenctrl.h
>> --- a/tools/libxc/xenctrl.h	Tue Nov 13 11:19:17 2012 +0000
>> +++ b/tools/libxc/xenctrl.h	Thu Nov 15 09:42:24 2012 +0800 @@ -575,6
>>                            +575,17 @@ xc_domaininfo_t *info);
>> 
>>  /**
>> + * This function set p2m for broken page
>> + * &parm xch a handle to an open hypervisor interface
>> + * @parm domid the domain id which broken page belong to
>> + * @parm pfn the pfn number of the broken page
>> + * @return 0 on success, -1 on failure
>> + */
>> +int xc_set_broken_page_p2m(xc_interface *xch,
>> +                           uint32_t domid,
>> +                           unsigned long pfn);
>> +
>> +/**
>>   * This function returns information about the context of a hvm
>> domain 
>>   * @parm xch a handle to an open hypervisor interface
>>   * @parm domid the domain to get information from
>> diff -r 8b93ac0c93f3 -r da7faf53790e
>> xen/arch/x86/cpu/mcheck/mcaction.c ---
>> a/xen/arch/x86/cpu/mcheck/mcaction.c	Tue Nov 13 11:19:17 2012 +0000
>>  +++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Thu Nov 15 09:42:24 2012
>>  +0800 @@ -1,5 +1,6 @@ #include <xen/types.h> #include <xen/sched.h>
>> +#include <asm/p2m.h>
>>  #include "mcaction.h"
>>  #include "vmce.h"
>>  #include "mce.h"
>> @@ -91,6 +92,24 @@
>>                      goto vmce_failed;
>>                  }
>> 
>> +                if ( is_hvm_domain(d) &&
>> !d->arch.hvm_domain.dirty_vram && +                    
>> paging_mode_log_dirty(d) ) +                {
>> +                    /*
>> +                     * vMCE occur during migration +               
>> * +                     *   At sender, it marks broken page to dirty
>> bitmap, +                     *   so that at copypages stage of
>> migration, broken +                     *   page's pfn_type and pfn
>> number would be transferred +                     *   to target and
>> then take appropriate action. +                     * +             
>> *   At target, it would set p2m as p2m_ram_broken for +             
>> *   broken page, so that if guest access the broken page +          
>> *   again, it would kill itself as expected. +                    
>> */ +                    paging_mark_dirty(d, mfn); +                }
>> +
>>                  if ( unmmap_broken_page(d, _mfn(mfn), gfn) )       
>>                      { printk("Unmap broken memory %lx for DOM%d
>> failed\n", 
>> diff -r 8b93ac0c93f3 -r da7faf53790e xen/arch/x86/domctl.c
>> --- a/xen/arch/x86/domctl.c	Tue Nov 13 11:19:17 2012 +0000
>> +++ b/xen/arch/x86/domctl.c	Thu Nov 15 09:42:24 2012 +0800 @@
>>                  -209,12 +209,18 @@ for ( j = 0; j < k; j++ )
>>                  {
>>                      unsigned long type = 0;
>> +                    p2m_type_t t;
>> 
>> -                    page = get_page_from_gfn(d, arr[j], NULL,
>> P2M_ALLOC); +                    page = get_page_from_gfn(d, arr[j],
>> &t, P2M_ALLOC); 
>> 
>>                      if ( unlikely(!page) ||
>>                           unlikely(is_xen_heap_page(page)) )
>> -                        type = XEN_DOMCTL_PFINFO_XTAB; +           
>> { +                        if ( p2m_is_broken(t) )
>> +                            type = XEN_DOMCTL_PFINFO_BROKEN; +     
>> else +                            type = XEN_DOMCTL_PFINFO_XTAB; +  
>>                      } else
>>                      {
>>                          switch( page->u.inuse.type_info &
>> PGT_type_mask ) @@ -235,6 +241,9 @@ 
>> 
>>                          if ( page->u.inuse.type_info & PGT_pinned )
>>                              type |= XEN_DOMCTL_PFINFO_LPINTAB; +
>> +                        if ( page->count_info & PGC_broken )
>> +                            type = XEN_DOMCTL_PFINFO_BROKEN;       
>> } 
>> 
>>                      if ( page )
>> @@ -1568,6 +1577,29 @@
>>      }
>>      break;
>> 
>> +    case XEN_DOMCTL_set_broken_page_p2m:
>> +    {
>> +        struct domain *d;
>> +
>> +        d = rcu_lock_domain_by_id(domctl->domain); +        if ( d
>> != NULL ) +        {
>> +            p2m_type_t pt;
>> +            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
>> +            mfn_t mfn = get_gfn_query(d, pfn, &pt); +
>> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt)
>> || +                         (p2m_change_type(d, pfn, pt,
>> p2m_ram_broken) != pt)) ) +                ret = -EINVAL;
>> +
>> +            put_gfn(d, pfn);
>> +            rcu_unlock_domain(d);
>> +        }
>> +        else
>> +            ret = -ESRCH;
>> +    }
>> +    break;
>> +
>>      default:
>>          ret = iommu_do_domctl(domctl, u_domctl);
>>          break;
>> diff -r 8b93ac0c93f3 -r da7faf53790e xen/include/public/domctl.h
>> --- a/xen/include/public/domctl.h	Tue Nov 13 11:19:17 2012 +0000
>> +++ b/xen/include/public/domctl.h	Thu Nov 15 09:42:24 2012 +0800 @@
>>  -136,6 +136,7 @@ #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
>>  #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
>>  #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page
>> */ +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
>>  #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
>> 
>>  struct xen_domctl_getpageframeinfo {
>> @@ -834,6 +835,12 @@
>>  typedef struct xen_domctl_set_access_required
>>  xen_domctl_set_access_required_t;
>> DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t); 
>> 
>> +struct xen_domctl_set_broken_page_p2m {
>> +    uint64_aligned_t pfn;
>> +};
>> +typedef struct xen_domctl_set_broken_page_p2m
>> xen_domctl_set_broken_page_p2m_t;
>>  +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t); +
>>      struct xen_domctl { uint32_t cmd;
>>  #define XEN_DOMCTL_createdomain                   1 @@ -899,6
>>  +906,7 @@ #define XEN_DOMCTL_set_access_required           64
>>  #define XEN_DOMCTL_audit_p2m                     65
>>  #define XEN_DOMCTL_set_virq_handler              66
>> +#define XEN_DOMCTL_set_broken_page_p2m           67
>>  #define XEN_DOMCTL_gdbsx_guestmemio            1000
>>  #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>>  #define XEN_DOMCTL_gdbsx_unpausevcpu           1002 @@ -954,6
>>          +962,7 @@ struct xen_domctl_audit_p2m         audit_p2m;
>>          struct xen_domctl_set_virq_handler  set_virq_handler;
>>          struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
>> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>>          struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>>          struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>>          uint8_t                             pad[128];


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:01:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:01:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQDc-0004F3-SQ; Fri, 16 Nov 2012 18:00:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TZQDb-0004En-6r
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:00:43 +0000
Received: from [193.109.254.147:8335] by server-14.bemta-14.messagelabs.com id
	EE/53-14517-A4F76A05; Fri, 16 Nov 2012 18:00:42 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353088840!8590607!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzIzMDk1\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5819 invoked from network); 16 Nov 2012 18:00:40 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-5.tower-27.messagelabs.com with SMTP;
	16 Nov 2012 18:00:40 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga101.jf.intel.com with ESMTP; 16 Nov 2012 10:00:39 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,266,1352102400"; d="scan'208";a="220749584"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by orsmga001.jf.intel.com with ESMTP; 16 Nov 2012 10:00:38 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 16 Nov 2012 10:00:38 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Sat, 17 Nov 2012 02:00:37 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Jan Beulich <JBeulich@suse.com>
Thread-Topic: [PATCH V2] X86/vMCE: handle broken page with regard to migration
Thread-Index: AQHNwxX9a/8d/5CcCU+RhogRGZhHOJfswhcg
Date: Fri, 16 Nov 2012 18:00:36 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233538DE0A@SHSMSX101.ccr.corp.intel.com>
References: <da7faf53790e661cb6c4.1352944365@ljsromley.bj.intel.com>
	<50A4C7BC02000078000A8BF0@nat28.tlf.novell.com>
In-Reply-To: <50A4C7BC02000078000A8BF0@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>,
	"Ian.Jackson@eu.citrix.com" <Ian.Jackson@eu.citrix.com>,
	"ian.campbell@citrix.com" <ian.campbell@citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Jan Beulich wrote:
>>>> On 15.11.12 at 02:52, Liu Jinsong <jinsong.liu@intel.com> wrote:
>> Generally, there are 2 cases:
>> 1. broken page occurs before migration
>> 2. broken page occurs during migration
>> 
>> At the sender
>>   For case 1, the broken page would be mapped but not copied to
>>   target (otherwise it may trigger more serious error, say, SRAR
>>   error). While its pfn_type and pfn number would be transferred to
>>   target so that target take appropriate action.
>> 
>>   For case 2, mce handler marks the broken page to dirty bitmap, so
>>   that at copypages stage of migration, its pfn_type and pfn number
>>   would be transferred to target and then take appropriate action.
>> 
>> At the target
>>   When migration target would populate pages for guest. As for the
>>   case of broken page wrt migration, we prefer keep the
>>   corresponding page, for the sake of seamless migration.
>> 
>>   At target it would set p2m as p2m_ram_broken for broken page.
>>   Guest MCE may have good chance to handle its broken page, while if
>>   guest access the broken page again it would kill itself as
>> expected. 
>> 
>> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
>> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
>> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
>> Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
>> Acked-by: Jan Beulich <JBeulich@suse.com>
> 
> We're getting closer, but given that this is a re-submission _and_
> the subject says v2 (albeit it really is v3 or higher), briefly
> mentioning what changed from earlier versions would greatly
> help with reviewing.
> 
> Jan

Will send out V3 soon, w/ briefly mention V1/V2 history.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:01:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:01:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQDc-0004F3-SQ; Fri, 16 Nov 2012 18:00:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TZQDb-0004En-6r
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:00:43 +0000
Received: from [193.109.254.147:8335] by server-14.bemta-14.messagelabs.com id
	EE/53-14517-A4F76A05; Fri, 16 Nov 2012 18:00:42 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353088840!8590607!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzIzMDk1\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5819 invoked from network); 16 Nov 2012 18:00:40 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-5.tower-27.messagelabs.com with SMTP;
	16 Nov 2012 18:00:40 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga101.jf.intel.com with ESMTP; 16 Nov 2012 10:00:39 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,266,1352102400"; d="scan'208";a="220749584"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by orsmga001.jf.intel.com with ESMTP; 16 Nov 2012 10:00:38 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 16 Nov 2012 10:00:38 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Sat, 17 Nov 2012 02:00:37 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Jan Beulich <JBeulich@suse.com>
Thread-Topic: [PATCH V2] X86/vMCE: handle broken page with regard to migration
Thread-Index: AQHNwxX9a/8d/5CcCU+RhogRGZhHOJfswhcg
Date: Fri, 16 Nov 2012 18:00:36 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233538DE0A@SHSMSX101.ccr.corp.intel.com>
References: <da7faf53790e661cb6c4.1352944365@ljsromley.bj.intel.com>
	<50A4C7BC02000078000A8BF0@nat28.tlf.novell.com>
In-Reply-To: <50A4C7BC02000078000A8BF0@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>,
	"Ian.Jackson@eu.citrix.com" <Ian.Jackson@eu.citrix.com>,
	"ian.campbell@citrix.com" <ian.campbell@citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Jan Beulich wrote:
>>>> On 15.11.12 at 02:52, Liu Jinsong <jinsong.liu@intel.com> wrote:
>> Generally, there are 2 cases:
>> 1. broken page occurs before migration
>> 2. broken page occurs during migration
>> 
>> At the sender
>>   For case 1, the broken page would be mapped but not copied to
>>   target (otherwise it may trigger more serious error, say, SRAR
>>   error). While its pfn_type and pfn number would be transferred to
>>   target so that target take appropriate action.
>> 
>>   For case 2, mce handler marks the broken page to dirty bitmap, so
>>   that at copypages stage of migration, its pfn_type and pfn number
>>   would be transferred to target and then take appropriate action.
>> 
>> At the target
>>   When migration target would populate pages for guest. As for the
>>   case of broken page wrt migration, we prefer keep the
>>   corresponding page, for the sake of seamless migration.
>> 
>>   At target it would set p2m as p2m_ram_broken for broken page.
>>   Guest MCE may have good chance to handle its broken page, while if
>>   guest access the broken page again it would kill itself as
>> expected. 
>> 
>> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
>> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
>> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
>> Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
>> Acked-by: Jan Beulich <JBeulich@suse.com>
> 
> We're getting closer, but given that this is a re-submission _and_
> the subject says v2 (albeit it really is v3 or higher), briefly
> mentioning what changed from earlier versions would greatly
> help with reviewing.
> 
> Jan

Will send out V3 soon, w/ briefly mention V1/V2 history.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:10:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:10:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQMQ-0004Xa-UX; Fri, 16 Nov 2012 18:09:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <okhalid.cern@gmail.com>)
	id 1TZQMP-0004XS-8h; Fri, 16 Nov 2012 18:09:49 +0000
Received: from [85.158.139.211:58605] by server-9.bemta-5.messagelabs.com id
	53/A3-29295-B6186A05; Fri, 16 Nov 2012 18:09:47 +0000
X-Env-Sender: okhalid.cern@gmail.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1353089384!18990877!1
X-Originating-IP: [209.85.160.43]
X-SpamReason: No, hits=1.5 required=7.0 tests=HTML_00_10,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20208 invoked from network); 16 Nov 2012 18:09:46 -0000
Received: from mail-pb0-f43.google.com (HELO mail-pb0-f43.google.com)
	(209.85.160.43)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:09:46 -0000
Received: by mail-pb0-f43.google.com with SMTP id wz17so2248124pbc.30
	for <multiple recipients>; Fri, 16 Nov 2012 10:09:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:reply-to:date:message-id:subject:from:to:content-type;
	bh=ADaDNq6TzaPxbyCMDoztvdIN/Z3wErnsVXexelBceks=;
	b=hZIDelhKew4W3F/RnkFYln6GpUGuSUDQ3/eCl3ggCpluXYsuc2gjVz6TVZ62IC9IBe
	vSVi5aBcrd1hxMgieD8noAcgZ/fOhOCPF8VGJctJDnL8Jxx4CxW0gOqSgQmWdUUcIvHc
	CI05aNDeDBJS79yJKcswo7R3ptmhkCUXL5ejBjOR8wxdzaKppFm0M57ABi+XfHnivYt4
	c7iI3+yzMk3Bpw6yhEIGYyc/IxxD+3WKBUI95MA2SXX+oOGNdcN50weI8kai5r4tT0r5
	in8A0bzquFEc7VnW308vwDlu5lq7GIaBS2bl8L2AqLHIUSskK/S5W3k6UuBesoYw+ciS
	ZVRQ==
MIME-Version: 1.0
Received: by 10.66.83.67 with SMTP id o3mr15161654pay.5.1353089383824; Fri, 16
	Nov 2012 10:09:43 -0800 (PST)
Received: by 10.66.189.234 with HTTP; Fri, 16 Nov 2012 10:09:43 -0800 (PST)
Date: Fri, 16 Nov 2012 18:09:43 +0000
Message-ID: <CAPM9MsQsggsBAL948ZJ31bVnSNH+Q4kGr4d0Na+_RgPBpcgypA@mail.gmail.com>
From: "Omer K." <okhalid.cern@gmail.com>
To: xen-users list <xen-users@lists.xensource.com>, 
	xen-devel list <xen-devel@lists.xensource.com>
Subject: [Xen-devel] How to activate all VPCUS for a domU?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: okhalid.cern@gmail.com
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0153601500056840612=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0153601500056840612==
Content-Type: multipart/alternative; boundary=f46d042ef49b127c0504cea0acd2

--f46d042ef49b127c0504cea0acd2
Content-Type: text/plain; charset=UTF-8

Hi,

I have set maxvcpus and vcpus options in my domU configuration file, and I
can see that X number of vcpu are set for the domU.

I tried to activate all the vpcus by using vpcu_avail option (using decimal
to represent vpcu bitmask e.g. 24=11000) but it doesn't seem to work, and
only the first vpcu is activated (i.e. has -b- state) while all other
vpcu's set for the domU are in the paused state.

Can any one share more insights on how to activate all the vpcu's for the
guest domain ?

Thanks

--f46d042ef49b127c0504cea0acd2
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,<br><br>I have set maxvcpus and vcpus options in my domU configuration f=
ile, and I can see that X number of vcpu are set for the domU.<br><br>I tri=
ed to activate all the vpcus by using vpcu_avail option (using decimal to r=
epresent vpcu bitmask e.g. 24=3D11000) but it doesn&#39;t seem to work, and=
 only the first vpcu is activated (i.e. has -b- state) while all other vpcu=
&#39;s set for the domU are in the paused state.<br>
<br>Can any one share more insights on how to activate all the vpcu&#39;s f=
or the guest domain ?<br><br>Thanks<br>

--f46d042ef49b127c0504cea0acd2--


--===============0153601500056840612==
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.xen.org
http://lists.xen.org/xen-devel

--===============0153601500056840612==--


From xen-devel-bounces@lists.xen.org Fri Nov 16 18:10:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:10:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQMQ-0004Xa-UX; Fri, 16 Nov 2012 18:09:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <okhalid.cern@gmail.com>)
	id 1TZQMP-0004XS-8h; Fri, 16 Nov 2012 18:09:49 +0000
Received: from [85.158.139.211:58605] by server-9.bemta-5.messagelabs.com id
	53/A3-29295-B6186A05; Fri, 16 Nov 2012 18:09:47 +0000
X-Env-Sender: okhalid.cern@gmail.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1353089384!18990877!1
X-Originating-IP: [209.85.160.43]
X-SpamReason: No, hits=1.5 required=7.0 tests=HTML_00_10,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20208 invoked from network); 16 Nov 2012 18:09:46 -0000
Received: from mail-pb0-f43.google.com (HELO mail-pb0-f43.google.com)
	(209.85.160.43)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:09:46 -0000
Received: by mail-pb0-f43.google.com with SMTP id wz17so2248124pbc.30
	for <multiple recipients>; Fri, 16 Nov 2012 10:09:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:reply-to:date:message-id:subject:from:to:content-type;
	bh=ADaDNq6TzaPxbyCMDoztvdIN/Z3wErnsVXexelBceks=;
	b=hZIDelhKew4W3F/RnkFYln6GpUGuSUDQ3/eCl3ggCpluXYsuc2gjVz6TVZ62IC9IBe
	vSVi5aBcrd1hxMgieD8noAcgZ/fOhOCPF8VGJctJDnL8Jxx4CxW0gOqSgQmWdUUcIvHc
	CI05aNDeDBJS79yJKcswo7R3ptmhkCUXL5ejBjOR8wxdzaKppFm0M57ABi+XfHnivYt4
	c7iI3+yzMk3Bpw6yhEIGYyc/IxxD+3WKBUI95MA2SXX+oOGNdcN50weI8kai5r4tT0r5
	in8A0bzquFEc7VnW308vwDlu5lq7GIaBS2bl8L2AqLHIUSskK/S5W3k6UuBesoYw+ciS
	ZVRQ==
MIME-Version: 1.0
Received: by 10.66.83.67 with SMTP id o3mr15161654pay.5.1353089383824; Fri, 16
	Nov 2012 10:09:43 -0800 (PST)
Received: by 10.66.189.234 with HTTP; Fri, 16 Nov 2012 10:09:43 -0800 (PST)
Date: Fri, 16 Nov 2012 18:09:43 +0000
Message-ID: <CAPM9MsQsggsBAL948ZJ31bVnSNH+Q4kGr4d0Na+_RgPBpcgypA@mail.gmail.com>
From: "Omer K." <okhalid.cern@gmail.com>
To: xen-users list <xen-users@lists.xensource.com>, 
	xen-devel list <xen-devel@lists.xensource.com>
Subject: [Xen-devel] How to activate all VPCUS for a domU?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: okhalid.cern@gmail.com
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0153601500056840612=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0153601500056840612==
Content-Type: multipart/alternative; boundary=f46d042ef49b127c0504cea0acd2

--f46d042ef49b127c0504cea0acd2
Content-Type: text/plain; charset=UTF-8

Hi,

I have set maxvcpus and vcpus options in my domU configuration file, and I
can see that X number of vcpu are set for the domU.

I tried to activate all the vpcus by using vpcu_avail option (using decimal
to represent vpcu bitmask e.g. 24=11000) but it doesn't seem to work, and
only the first vpcu is activated (i.e. has -b- state) while all other
vpcu's set for the domU are in the paused state.

Can any one share more insights on how to activate all the vpcu's for the
guest domain ?

Thanks

--f46d042ef49b127c0504cea0acd2
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,<br><br>I have set maxvcpus and vcpus options in my domU configuration f=
ile, and I can see that X number of vcpu are set for the domU.<br><br>I tri=
ed to activate all the vpcus by using vpcu_avail option (using decimal to r=
epresent vpcu bitmask e.g. 24=3D11000) but it doesn&#39;t seem to work, and=
 only the first vpcu is activated (i.e. has -b- state) while all other vpcu=
&#39;s set for the domU are in the paused state.<br>
<br>Can any one share more insights on how to activate all the vpcu&#39;s f=
or the guest domain ?<br><br>Thanks<br>

--f46d042ef49b127c0504cea0acd2--


--===============0153601500056840612==
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.xen.org
http://lists.xen.org/xen-devel

--===============0153601500056840612==--


From xen-devel-bounces@lists.xen.org Fri Nov 16 18:12:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:12:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQP5-0004o6-57; Fri, 16 Nov 2012 18:12:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TZQP4-0004nr-1F
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:12:34 +0000
Received: from [193.109.254.147:28112] by server-8.bemta-14.messagelabs.com id
	7B/A1-05026-11286A05; Fri, 16 Nov 2012 18:12:33 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1353089548!9128694!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4MTUxOA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25367 invoked from network); 16 Nov 2012 18:12:29 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-12.tower-27.messagelabs.com with SMTP;
	16 Nov 2012 18:12:29 -0000
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
	by fmsmga102.fm.intel.com with ESMTP; 16 Nov 2012 10:12:24 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,266,1352102400"; d="scan'208";a="250366656"
Received: from ljsromley.bj.intel.com ([10.240.192.102])
	by fmsmga002.fm.intel.com with ESMTP; 16 Nov 2012 10:12:22 -0800
MIME-Version: 1.0
X-Mercurial-Node: 446f6b9bfc89137e1aa090b3e50d79b4e72c1e9d
Message-Id: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
User-Agent: Mercurial-patchbomb/1.4
Date: Sat, 17 Nov 2012 10:04:41 +0800
From: Liu Jinsong <jinsong.liu@intel.com>
To: ian.campbell@citrix.com, george.dunlap@eu.citrix.com,
	Ian.Jackson@eu.citrix.com, JBeulich@suse.com
Cc: jinsong.liu@intel.com, xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard to
	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Generally, there are 2 cases:
1. broken page occurs before migration
2. broken page occurs during migration

We had submitted 2 versions of patches. Their difference is how to handle case 2:
V1 patch aborted migration for the case 'broken page occurs during migration';
V2 patch marked broken page to dirty bitmap then got handled next round and no abort;

This is V3 patch, adding handle for vMCE occur at last iteration of migration:
At the sender
  For case 1, the broken page will be mapped but not copied to target
  (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number will be transferred to target
  so that target take appropriate action.

  For case 2, mce handler marks the broken page to dirty bitmap, so that
  at copypages stage of migration, its pfn_type and pfn number will be
  transferred to target and then take appropriate action.

At the target
  When migration target populates pages for guest. As for the case
  of broken page wrt migration, we prefer to keep the type of the page,
  for the sake of seamless migration.

  At target it will set p2m as p2m_ram_broken for broken page. Guest MCE
  may have good chance to handle its broken page, while if guest access
  the broken page again it will kill itself as expected.

If vMCE occur at the last memory copy iteration of migration, we do one more
iteration so that the broken page's pfn_type and pfn number has chance to
be transferred to target.

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

- for tools part of the patch
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

- for hypervisor part of the patch
Acked-by: Jan Beulich <JBeulich@suse.com>

diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain.c	Sat Nov 17 09:46:05 2012 +0800
@@ -283,6 +283,22 @@
     return ret;
 }
 
+/* set broken page p2m */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn)
+{
+    int ret;
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
+    domctl.domain = (domid_t)domid;
+    domctl.u.set_broken_page_p2m.pfn = pfn;
+    ret = do_domctl(xch, &domctl);
+
+    return ret ? -1 : 0;
+}
+
 /* get info from hvm guest for save */
 int xc_domain_hvm_getcontext(xc_interface *xch,
                              uint32_t domid,
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_restore.c	Sat Nov 17 09:46:05 2012 +0800
@@ -1023,9 +1023,15 @@
 
     countpages = count;
     for (i = oldcount; i < buf->nr_pages; ++i)
-        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
-            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
+    {
+        unsigned long pagetype;
+
+        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
+        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
+             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
+             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
             --countpages;
+    }
 
     if (!countpages)
         return count;
@@ -1267,6 +1273,17 @@
             /* a bogus/unmapped/allocate-only page: skip it */
             continue;
 
+        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
+        {
+            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
+            {
+                ERROR("Set p2m for broken page failed, "
+                      "dom=%d, pfn=%lx\n", dom, pfn);
+                goto err_mapped;
+            }
+            continue;
+        }
+
         if (pfn_err[i])
         {
             ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_save.c	Sat Nov 17 09:46:05 2012 +0800
@@ -1118,7 +1118,7 @@
     /* Now write out each data page, canonicalising page tables as we go... */
     for ( ; ; )
     {
-        unsigned int N, batch, run;
+        unsigned int N, batch, run, broken_page_num1, broken_page_num2;
         char reportbuf[80];
 
         snprintf(reportbuf, sizeof(reportbuf),
@@ -1270,6 +1270,7 @@
                 goto out;
             }
 
+            broken_page_num1 = 0;
             for ( run = j = 0; j < batch; j++ )
             {
                 unsigned long gmfn = pfn_batch[j];
@@ -1277,6 +1278,14 @@
                 if ( !hvm )
                     gmfn = pfn_to_mfn(gmfn);
 
+                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                {
+                    pfn_type[j] |= pfn_batch[j];
+                    ++broken_page_num1;
+                    ++run;
+                    continue;
+                }
+
                 if ( pfn_err[j] )
                 {
                     if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
@@ -1371,8 +1380,12 @@
                     }
                 }
 
-                /* skip pages that aren't present or are alloc-only */
+                /*
+                 * skip pages that aren't present,
+                 * or are broken, or are alloc-only
+                 */
                 if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
+                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
                     || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
                     continue;
 
@@ -1484,6 +1497,35 @@
 
             munmap(region_base, batch*PAGE_SIZE);
 
+            /*
+             * if vMCE occur at last iter, do one more iter so that it get
+             * chance to transfer broken page's pfn_type and pfn number to
+             * target and then take appropriate action
+             */
+            if ( last_iter )
+            {
+                for ( j = 0; j < batch; j++ )
+                {
+                    if ( hvm )
+                        pfn_type[j] = pfn_batch[j];
+                    else
+                        pfn_type[j] = pfn_to_mfn(pfn_batch[j]);
+                }
+
+                if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
+                {
+                    PERROR("get_pfn_type_batch failed");
+                    goto out;
+                }
+
+                broken_page_num2 = 0;
+                for ( j = 0; j < batch; j++ )
+                    if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                        broken_page_num2++;
+
+                if ( broken_page_num1 < broken_page_num2 )
+                    last_iter = 0;
+            }
         } /* end of this while loop for this iteration */
 
       skip:
@@ -1550,23 +1592,22 @@
                     PERROR("Error when writing to state file (tsc)");
                     goto out;
                 }
+            }
+        }
+        else
+            last_iter = 1;
 
+        if ( xc_shadow_control(xch, dom,
+                               XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),
+                               dinfo->p2m_size, NULL, 0, &shadow_stats) != dinfo->p2m_size )
+        {
+            PERROR("Error flushing shadow PT");
+            goto out;
+        }
 
-            }
+        sent_last_iter = sent_this_iter;
 
-            if ( xc_shadow_control(xch, dom,
-                                   XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),
-                                   dinfo->p2m_size, NULL, 0, &shadow_stats) != dinfo->p2m_size )
-            {
-                PERROR("Error flushing shadow PT");
-                goto out;
-            }
-
-            sent_last_iter = sent_this_iter;
-
-            print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, 1);
-
-        }
+        print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, 1);
     } /* end of infinite for loop */
 
     DPRINTF("All memory is saved\n");
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xenctrl.h	Sat Nov 17 09:46:05 2012 +0800
@@ -575,6 +575,17 @@
                           xc_domaininfo_t *info);
 
 /**
+ * This function set p2m for broken page
+ * &parm xch a handle to an open hypervisor interface
+ * @parm domid the domain id which broken page belong to
+ * @parm pfn the pfn number of the broken page
+ * @return 0 on success, -1 on failure
+ */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn);
+
+/**
  * This function returns information about the context of a hvm domain
  * @parm xch a handle to an open hypervisor interface
  * @parm domid the domain to get information from
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 xen/arch/x86/cpu/mcheck/mcaction.c
--- a/xen/arch/x86/cpu/mcheck/mcaction.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Sat Nov 17 09:46:05 2012 +0800
@@ -1,5 +1,6 @@
 #include <xen/types.h>
 #include <xen/sched.h>
+#include <asm/p2m.h>
 #include "mcaction.h"
 #include "vmce.h"
 #include "mce.h"
@@ -91,6 +92,24 @@
                     goto vmce_failed;
                 }
 
+                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram &&
+                     paging_mode_log_dirty(d) )
+                {
+                    /*
+                     * vMCE occur during migration
+                     *
+                     *   At sender, it marks broken page to dirty bitmap,
+                     *   so that at copypages stage of migration, broken
+                     *   page's pfn_type and pfn number would be transferred
+                     *   to target and then take appropriate action.
+                     *
+                     *   At target, it would set p2m as p2m_ram_broken for
+                     *   broken page, so that if guest access the broken page
+                     *   again, it would kill itself as expected.
+                     */
+                    paging_mark_dirty(d, mfn);
+                }
+
                 if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
                 {
                     printk("Unmap broken memory %lx for DOM%d failed\n",
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/arch/x86/domctl.c	Sat Nov 17 09:46:05 2012 +0800
@@ -209,12 +209,18 @@
                 for ( j = 0; j < k; j++ )
                 {
                     unsigned long type = 0;
+                    p2m_type_t t;
 
-                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
+                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
 
                     if ( unlikely(!page) ||
                          unlikely(is_xen_heap_page(page)) )
-                        type = XEN_DOMCTL_PFINFO_XTAB;
+                    {
+                        if ( p2m_is_broken(t) )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
+                        else
+                            type = XEN_DOMCTL_PFINFO_XTAB;
+                    }
                     else
                     {
                         switch( page->u.inuse.type_info & PGT_type_mask )
@@ -235,6 +241,9 @@
 
                         if ( page->u.inuse.type_info & PGT_pinned )
                             type |= XEN_DOMCTL_PFINFO_LPINTAB;
+
+                        if ( page->count_info & PGC_broken )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
                     }
 
                     if ( page )
@@ -1568,6 +1577,29 @@
     }
     break;
 
+    case XEN_DOMCTL_set_broken_page_p2m:
+    {
+        struct domain *d;
+
+        d = rcu_lock_domain_by_id(domctl->domain);
+        if ( d != NULL )
+        {
+            p2m_type_t pt;
+            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
+            mfn_t mfn = get_gfn_query(d, pfn, &pt);
+
+            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
+                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
+                ret = -EINVAL;
+
+            put_gfn(d, pfn);
+            rcu_unlock_domain(d);
+        }
+        else
+            ret = -ESRCH;
+    }
+    break;
+
     default:
         ret = iommu_do_domctl(domctl, u_domctl);
         break;
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/include/public/domctl.h	Sat Nov 17 09:46:05 2012 +0800
@@ -136,6 +136,7 @@
 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
 #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
 #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
+#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
 
 struct xen_domctl_getpageframeinfo {
@@ -834,6 +835,12 @@
 typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
 
+struct xen_domctl_set_broken_page_p2m {
+    uint64_aligned_t pfn;
+};
+typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -899,6 +906,7 @@
 #define XEN_DOMCTL_set_access_required           64
 #define XEN_DOMCTL_audit_p2m                     65
 #define XEN_DOMCTL_set_virq_handler              66
+#define XEN_DOMCTL_set_broken_page_p2m           67
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -954,6 +962,7 @@
         struct xen_domctl_audit_p2m         audit_p2m;
         struct xen_domctl_set_virq_handler  set_virq_handler;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
+        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
         uint8_t                             pad[128];

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:12:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:12:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQP5-0004o6-57; Fri, 16 Nov 2012 18:12:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TZQP4-0004nr-1F
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:12:34 +0000
Received: from [193.109.254.147:28112] by server-8.bemta-14.messagelabs.com id
	7B/A1-05026-11286A05; Fri, 16 Nov 2012 18:12:33 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1353089548!9128694!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4MTUxOA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25367 invoked from network); 16 Nov 2012 18:12:29 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-12.tower-27.messagelabs.com with SMTP;
	16 Nov 2012 18:12:29 -0000
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
	by fmsmga102.fm.intel.com with ESMTP; 16 Nov 2012 10:12:24 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,266,1352102400"; d="scan'208";a="250366656"
Received: from ljsromley.bj.intel.com ([10.240.192.102])
	by fmsmga002.fm.intel.com with ESMTP; 16 Nov 2012 10:12:22 -0800
MIME-Version: 1.0
X-Mercurial-Node: 446f6b9bfc89137e1aa090b3e50d79b4e72c1e9d
Message-Id: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
User-Agent: Mercurial-patchbomb/1.4
Date: Sat, 17 Nov 2012 10:04:41 +0800
From: Liu Jinsong <jinsong.liu@intel.com>
To: ian.campbell@citrix.com, george.dunlap@eu.citrix.com,
	Ian.Jackson@eu.citrix.com, JBeulich@suse.com
Cc: jinsong.liu@intel.com, xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard to
	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Generally, there are 2 cases:
1. broken page occurs before migration
2. broken page occurs during migration

We had submitted 2 versions of patches. Their difference is how to handle case 2:
V1 patch aborted migration for the case 'broken page occurs during migration';
V2 patch marked broken page to dirty bitmap then got handled next round and no abort;

This is V3 patch, adding handle for vMCE occur at last iteration of migration:
At the sender
  For case 1, the broken page will be mapped but not copied to target
  (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number will be transferred to target
  so that target take appropriate action.

  For case 2, mce handler marks the broken page to dirty bitmap, so that
  at copypages stage of migration, its pfn_type and pfn number will be
  transferred to target and then take appropriate action.

At the target
  When migration target populates pages for guest. As for the case
  of broken page wrt migration, we prefer to keep the type of the page,
  for the sake of seamless migration.

  At target it will set p2m as p2m_ram_broken for broken page. Guest MCE
  may have good chance to handle its broken page, while if guest access
  the broken page again it will kill itself as expected.

If vMCE occur at the last memory copy iteration of migration, we do one more
iteration so that the broken page's pfn_type and pfn number has chance to
be transferred to target.

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

- for tools part of the patch
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

- for hypervisor part of the patch
Acked-by: Jan Beulich <JBeulich@suse.com>

diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain.c	Sat Nov 17 09:46:05 2012 +0800
@@ -283,6 +283,22 @@
     return ret;
 }
 
+/* set broken page p2m */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn)
+{
+    int ret;
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
+    domctl.domain = (domid_t)domid;
+    domctl.u.set_broken_page_p2m.pfn = pfn;
+    ret = do_domctl(xch, &domctl);
+
+    return ret ? -1 : 0;
+}
+
 /* get info from hvm guest for save */
 int xc_domain_hvm_getcontext(xc_interface *xch,
                              uint32_t domid,
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_restore.c	Sat Nov 17 09:46:05 2012 +0800
@@ -1023,9 +1023,15 @@
 
     countpages = count;
     for (i = oldcount; i < buf->nr_pages; ++i)
-        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
-            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
+    {
+        unsigned long pagetype;
+
+        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
+        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
+             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
+             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
             --countpages;
+    }
 
     if (!countpages)
         return count;
@@ -1267,6 +1273,17 @@
             /* a bogus/unmapped/allocate-only page: skip it */
             continue;
 
+        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
+        {
+            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
+            {
+                ERROR("Set p2m for broken page failed, "
+                      "dom=%d, pfn=%lx\n", dom, pfn);
+                goto err_mapped;
+            }
+            continue;
+        }
+
         if (pfn_err[i])
         {
             ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_save.c	Sat Nov 17 09:46:05 2012 +0800
@@ -1118,7 +1118,7 @@
     /* Now write out each data page, canonicalising page tables as we go... */
     for ( ; ; )
     {
-        unsigned int N, batch, run;
+        unsigned int N, batch, run, broken_page_num1, broken_page_num2;
         char reportbuf[80];
 
         snprintf(reportbuf, sizeof(reportbuf),
@@ -1270,6 +1270,7 @@
                 goto out;
             }
 
+            broken_page_num1 = 0;
             for ( run = j = 0; j < batch; j++ )
             {
                 unsigned long gmfn = pfn_batch[j];
@@ -1277,6 +1278,14 @@
                 if ( !hvm )
                     gmfn = pfn_to_mfn(gmfn);
 
+                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                {
+                    pfn_type[j] |= pfn_batch[j];
+                    ++broken_page_num1;
+                    ++run;
+                    continue;
+                }
+
                 if ( pfn_err[j] )
                 {
                     if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
@@ -1371,8 +1380,12 @@
                     }
                 }
 
-                /* skip pages that aren't present or are alloc-only */
+                /*
+                 * skip pages that aren't present,
+                 * or are broken, or are alloc-only
+                 */
                 if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
+                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
                     || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
                     continue;
 
@@ -1484,6 +1497,35 @@
 
             munmap(region_base, batch*PAGE_SIZE);
 
+            /*
+             * if vMCE occur at last iter, do one more iter so that it get
+             * chance to transfer broken page's pfn_type and pfn number to
+             * target and then take appropriate action
+             */
+            if ( last_iter )
+            {
+                for ( j = 0; j < batch; j++ )
+                {
+                    if ( hvm )
+                        pfn_type[j] = pfn_batch[j];
+                    else
+                        pfn_type[j] = pfn_to_mfn(pfn_batch[j]);
+                }
+
+                if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
+                {
+                    PERROR("get_pfn_type_batch failed");
+                    goto out;
+                }
+
+                broken_page_num2 = 0;
+                for ( j = 0; j < batch; j++ )
+                    if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                        broken_page_num2++;
+
+                if ( broken_page_num1 < broken_page_num2 )
+                    last_iter = 0;
+            }
         } /* end of this while loop for this iteration */
 
       skip:
@@ -1550,23 +1592,22 @@
                     PERROR("Error when writing to state file (tsc)");
                     goto out;
                 }
+            }
+        }
+        else
+            last_iter = 1;
 
+        if ( xc_shadow_control(xch, dom,
+                               XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),
+                               dinfo->p2m_size, NULL, 0, &shadow_stats) != dinfo->p2m_size )
+        {
+            PERROR("Error flushing shadow PT");
+            goto out;
+        }
 
-            }
+        sent_last_iter = sent_this_iter;
 
-            if ( xc_shadow_control(xch, dom,
-                                   XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),
-                                   dinfo->p2m_size, NULL, 0, &shadow_stats) != dinfo->p2m_size )
-            {
-                PERROR("Error flushing shadow PT");
-                goto out;
-            }
-
-            sent_last_iter = sent_this_iter;
-
-            print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, 1);
-
-        }
+        print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, 1);
     } /* end of infinite for loop */
 
     DPRINTF("All memory is saved\n");
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xenctrl.h	Sat Nov 17 09:46:05 2012 +0800
@@ -575,6 +575,17 @@
                           xc_domaininfo_t *info);
 
 /**
+ * This function set p2m for broken page
+ * &parm xch a handle to an open hypervisor interface
+ * @parm domid the domain id which broken page belong to
+ * @parm pfn the pfn number of the broken page
+ * @return 0 on success, -1 on failure
+ */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn);
+
+/**
  * This function returns information about the context of a hvm domain
  * @parm xch a handle to an open hypervisor interface
  * @parm domid the domain to get information from
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 xen/arch/x86/cpu/mcheck/mcaction.c
--- a/xen/arch/x86/cpu/mcheck/mcaction.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Sat Nov 17 09:46:05 2012 +0800
@@ -1,5 +1,6 @@
 #include <xen/types.h>
 #include <xen/sched.h>
+#include <asm/p2m.h>
 #include "mcaction.h"
 #include "vmce.h"
 #include "mce.h"
@@ -91,6 +92,24 @@
                     goto vmce_failed;
                 }
 
+                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram &&
+                     paging_mode_log_dirty(d) )
+                {
+                    /*
+                     * vMCE occur during migration
+                     *
+                     *   At sender, it marks broken page to dirty bitmap,
+                     *   so that at copypages stage of migration, broken
+                     *   page's pfn_type and pfn number would be transferred
+                     *   to target and then take appropriate action.
+                     *
+                     *   At target, it would set p2m as p2m_ram_broken for
+                     *   broken page, so that if guest access the broken page
+                     *   again, it would kill itself as expected.
+                     */
+                    paging_mark_dirty(d, mfn);
+                }
+
                 if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
                 {
                     printk("Unmap broken memory %lx for DOM%d failed\n",
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/arch/x86/domctl.c	Sat Nov 17 09:46:05 2012 +0800
@@ -209,12 +209,18 @@
                 for ( j = 0; j < k; j++ )
                 {
                     unsigned long type = 0;
+                    p2m_type_t t;
 
-                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
+                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
 
                     if ( unlikely(!page) ||
                          unlikely(is_xen_heap_page(page)) )
-                        type = XEN_DOMCTL_PFINFO_XTAB;
+                    {
+                        if ( p2m_is_broken(t) )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
+                        else
+                            type = XEN_DOMCTL_PFINFO_XTAB;
+                    }
                     else
                     {
                         switch( page->u.inuse.type_info & PGT_type_mask )
@@ -235,6 +241,9 @@
 
                         if ( page->u.inuse.type_info & PGT_pinned )
                             type |= XEN_DOMCTL_PFINFO_LPINTAB;
+
+                        if ( page->count_info & PGC_broken )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
                     }
 
                     if ( page )
@@ -1568,6 +1577,29 @@
     }
     break;
 
+    case XEN_DOMCTL_set_broken_page_p2m:
+    {
+        struct domain *d;
+
+        d = rcu_lock_domain_by_id(domctl->domain);
+        if ( d != NULL )
+        {
+            p2m_type_t pt;
+            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
+            mfn_t mfn = get_gfn_query(d, pfn, &pt);
+
+            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
+                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
+                ret = -EINVAL;
+
+            put_gfn(d, pfn);
+            rcu_unlock_domain(d);
+        }
+        else
+            ret = -ESRCH;
+    }
+    break;
+
     default:
         ret = iommu_do_domctl(domctl, u_domctl);
         break;
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/include/public/domctl.h	Sat Nov 17 09:46:05 2012 +0800
@@ -136,6 +136,7 @@
 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
 #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
 #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
+#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
 
 struct xen_domctl_getpageframeinfo {
@@ -834,6 +835,12 @@
 typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
 
+struct xen_domctl_set_broken_page_p2m {
+    uint64_aligned_t pfn;
+};
+typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -899,6 +906,7 @@
 #define XEN_DOMCTL_set_access_required           64
 #define XEN_DOMCTL_audit_p2m                     65
 #define XEN_DOMCTL_set_virq_handler              66
+#define XEN_DOMCTL_set_broken_page_p2m           67
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -954,6 +962,7 @@
         struct xen_domctl_audit_p2m         audit_p2m;
         struct xen_domctl_set_virq_handler  set_virq_handler;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
+        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
         uint8_t                             pad[128];

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:19:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:19:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQVM-00057d-0N; Fri, 16 Nov 2012 18:19:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZQVL-00057X-2A
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:19:03 +0000
Received: from [85.158.138.51:40253] by server-15.bemta-3.messagelabs.com id
	F8/5B-09445-69386A05; Fri, 16 Nov 2012 18:19:02 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1353089941!30244312!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24858 invoked from network); 16 Nov 2012 18:19:01 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:19:01 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857876"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:19:01 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 18:19:00 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TZQVI-0001Ge-KJ; Fri, 16 Nov 2012 18:19:00 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TZQVI-0005fJ-Ge;
	Fri, 16 Nov 2012 18:19:00 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20646.33684.410414.579210@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 18:19:00 +0000
To: Liu Jinsong <jinsong.liu@intel.com>
In-Reply-To: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Liu Jinsong writes ("[PATCH V3] X86/vMCE: handle broken page with regard to migration"):
> This is V3 patch, adding handle for vMCE occur at last iteration of migration:

I think you should take off my ack, having added significant new code
in the tools section.

About that code:

> +            /*
> +             * if vMCE occur at last iter, do one more iter so that it get
> +             * chance to transfer broken page's pfn_type and pfn number to
> +             * target and then take appropriate action
> +             */
> +            if ( last_iter )
> +            {
> +                for ( j = 0; j < batch; j++ )
> +                {
> +                    if ( hvm )
> +                        pfn_type[j] = pfn_batch[j];
> +                    else
> +                        pfn_type[j] = pfn_to_mfn(pfn_batch[j]);
> +                }
> +
> +                if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
> +                {
> +                    PERROR("get_pfn_type_batch failed");
> +                    goto out;
> +                }
> +
> +                broken_page_num2 = 0;
> +                for ( j = 0; j < batch; j++ )
> +                    if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                        broken_page_num2++;
> +
> +                if ( broken_page_num1 < broken_page_num2 )
> +                    last_iter = 0;
> +            }

Is this really the best way of doing this ?  Isn't there some single
flag the hypervisor sets somewhere ?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:19:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:19:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQVM-00057d-0N; Fri, 16 Nov 2012 18:19:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZQVL-00057X-2A
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:19:03 +0000
Received: from [85.158.138.51:40253] by server-15.bemta-3.messagelabs.com id
	F8/5B-09445-69386A05; Fri, 16 Nov 2012 18:19:02 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1353089941!30244312!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24858 invoked from network); 16 Nov 2012 18:19:01 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:19:01 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857876"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:19:01 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 18:19:00 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TZQVI-0001Ge-KJ; Fri, 16 Nov 2012 18:19:00 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TZQVI-0005fJ-Ge;
	Fri, 16 Nov 2012 18:19:00 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20646.33684.410414.579210@mariner.uk.xensource.com>
Date: Fri, 16 Nov 2012 18:19:00 +0000
To: Liu Jinsong <jinsong.liu@intel.com>
In-Reply-To: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Liu Jinsong writes ("[PATCH V3] X86/vMCE: handle broken page with regard to migration"):
> This is V3 patch, adding handle for vMCE occur at last iteration of migration:

I think you should take off my ack, having added significant new code
in the tools section.

About that code:

> +            /*
> +             * if vMCE occur at last iter, do one more iter so that it get
> +             * chance to transfer broken page's pfn_type and pfn number to
> +             * target and then take appropriate action
> +             */
> +            if ( last_iter )
> +            {
> +                for ( j = 0; j < batch; j++ )
> +                {
> +                    if ( hvm )
> +                        pfn_type[j] = pfn_batch[j];
> +                    else
> +                        pfn_type[j] = pfn_to_mfn(pfn_batch[j]);
> +                }
> +
> +                if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
> +                {
> +                    PERROR("get_pfn_type_batch failed");
> +                    goto out;
> +                }
> +
> +                broken_page_num2 = 0;
> +                for ( j = 0; j < batch; j++ )
> +                    if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                        broken_page_num2++;
> +
> +                if ( broken_page_num1 < broken_page_num2 )
> +                    last_iter = 0;
> +            }

Is this really the best way of doing this ?  Isn't there some single
flag the hypervisor sets somewhere ?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:22:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:22:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQY8-0005Ix-Iy; Fri, 16 Nov 2012 18:21:56 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZQY7-0005In-90
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:21:55 +0000
Received: from [85.158.137.99:14360] by server-14.bemta-3.messagelabs.com id
	16/16-12788-24486A05; Fri, 16 Nov 2012 18:21:54 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1353090112!18550102!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26202 invoked from network); 16 Nov 2012 18:21:53 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:21:53 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="44879506"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	16 Nov 2012 18:21:52 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL03.citrite.net
	(10.13.107.80) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 16 Nov 2012 13:21:51 -0500
Message-ID: <50A6843F.5050000@citrix.com>
Date: Fri, 16 Nov 2012 18:21:51 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <CAPM9MsQsggsBAL948ZJ31bVnSNH+Q4kGr4d0Na+_RgPBpcgypA@mail.gmail.com>
In-Reply-To: <CAPM9MsQsggsBAL948ZJ31bVnSNH+Q4kGr4d0Na+_RgPBpcgypA@mail.gmail.com>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] How to activate all VPCUS for a domU?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 18:09, Omer K. wrote:
> Hi,
>
> I have set maxvcpus and vcpus options in my domU configuration file, 
> and I can see that X number of vcpu are set for the domU.
>
> I tried to activate all the vpcus by using vpcu_avail option (using 
> decimal to represent vpcu bitmask e.g. 24=11000) but it doesn't seem 
> to work, and only the first vpcu is activated (i.e. has -b- state) 
> while all other vpcu's set for the domU are in the paused state.
>
> Can any one share more insights on how to activate all the vpcu's for 
> the guest domain ?
>
> Thanks
This definitely belongs to the Xen-Users list, not on Xen-Devel. Please 
don't post to both lists, it just confuses people.

--
Mats

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:22:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:22:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQY8-0005Ix-Iy; Fri, 16 Nov 2012 18:21:56 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZQY7-0005In-90
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:21:55 +0000
Received: from [85.158.137.99:14360] by server-14.bemta-3.messagelabs.com id
	16/16-12788-24486A05; Fri, 16 Nov 2012 18:21:54 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1353090112!18550102!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQyOTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26202 invoked from network); 16 Nov 2012 18:21:53 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:21:53 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="44879506"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	16 Nov 2012 18:21:52 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL03.citrite.net
	(10.13.107.80) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 16 Nov 2012 13:21:51 -0500
Message-ID: <50A6843F.5050000@citrix.com>
Date: Fri, 16 Nov 2012 18:21:51 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <CAPM9MsQsggsBAL948ZJ31bVnSNH+Q4kGr4d0Na+_RgPBpcgypA@mail.gmail.com>
In-Reply-To: <CAPM9MsQsggsBAL948ZJ31bVnSNH+Q4kGr4d0Na+_RgPBpcgypA@mail.gmail.com>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] How to activate all VPCUS for a domU?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 18:09, Omer K. wrote:
> Hi,
>
> I have set maxvcpus and vcpus options in my domU configuration file, 
> and I can see that X number of vcpu are set for the domU.
>
> I tried to activate all the vpcus by using vpcu_avail option (using 
> decimal to represent vpcu bitmask e.g. 24=11000) but it doesn't seem 
> to work, and only the first vpcu is activated (i.e. has -b- state) 
> while all other vpcu's set for the domU are in the paused state.
>
> Can any one share more insights on how to activate all the vpcu's for 
> the guest domain ?
>
> Thanks
This definitely belongs to the Xen-Users list, not on Xen-Devel. Please 
don't post to both lists, it just confuses people.

--
Mats

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQdg-0005jI-Dr; Fri, 16 Nov 2012 18:27:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdd-0005hY-Ia
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:37 +0000
Received: from [85.158.143.99:16589] by server-2.bemta-4.messagelabs.com id
	6E/81-28922-89586A05; Fri, 16 Nov 2012 18:27:36 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353090456!23208928!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20302 invoked from network); 16 Nov 2012 18:27:36 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:36 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857984"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:05 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:05 +0000
MIME-Version: 1.0
X-Mercurial-Node: 060900bd1a218587b6a1edcf0eed436af4b727bd
Message-ID: <060900bd1a218587b6a1.1353090346@makatos-desktop>
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:46 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 6 of 9 RFC] blktap3: Introduce tapdisk control
 information retrieval functionality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch introduces files control/tap-ctl-info.[ch]. Function tap_ctl_info is
used by the xenio daemon to retrieve the size of the block device, as well as
the sector size,  in order to communicate it to blkfront so that it can create
the virtual block device.

diff --git a/tools/blktap3/control/tap-ctl-info.c b/tools/blktap3/control/tap-ctl-info.c
new file mode 100644
--- /dev/null
+++ b/tools/blktap3/control/tap-ctl-info.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include "tap-ctl.h"
+#include "tap-ctl-info.h"
+
+int tap_ctl_info(pid_t pid, int minor, unsigned long long *sectors,
+        unsigned int *sector_size, unsigned int *info)
+{
+    tapdisk_message_t message;
+    int err;
+
+    memset(&message, 0, sizeof(message));
+    message.type = TAPDISK_MESSAGE_DISK_INFO;
+    message.cookie = minor;
+
+    err = tap_ctl_connect_send_and_receive(pid, &message, NULL);
+    if (err)
+        return err;
+
+    if (message.type != TAPDISK_MESSAGE_DISK_INFO_RSP)
+        return -EINVAL;
+
+    *sectors = message.u.image.sectors;
+    *sector_size = message.u.image.sector_size;
+    *info = message.u.image.info;
+    return err;
+}
diff --git a/tools/blktap3/control/tap-ctl-info.h b/tools/blktap3/control/tap-ctl-info.h
new file mode 100644
--- /dev/null
+++ b/tools/blktap3/control/tap-ctl-info.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ */
+
+#ifndef __TAP_CTL_INFO_H__
+#define __TAP_CTL_INFO_H__
+
+/**
+ * Retrieves virtual disk information from a tapdisk.
+ *
+ * @pid the process ID of the tapdisk process
+ * @minor the minor device number
+ * @sectors output parameter that receives the number of sectors
+ * @sector_size output parameter that receives the size of the sector
+ * @info TODO ?
+ * 
+ */
+int tap_ctl_info(pid_t pid, int minor, unsigned long long *sectors,
+        unsigned int *sector_size, unsigned int *info);
+
+#endif /* __TAP_CTL_INFO_H__ */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQdg-0005jI-Dr; Fri, 16 Nov 2012 18:27:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdd-0005hY-Ia
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:37 +0000
Received: from [85.158.143.99:16589] by server-2.bemta-4.messagelabs.com id
	6E/81-28922-89586A05; Fri, 16 Nov 2012 18:27:36 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353090456!23208928!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20302 invoked from network); 16 Nov 2012 18:27:36 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:36 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857984"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:05 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:05 +0000
MIME-Version: 1.0
X-Mercurial-Node: 060900bd1a218587b6a1edcf0eed436af4b727bd
Message-ID: <060900bd1a218587b6a1.1353090346@makatos-desktop>
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:46 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 6 of 9 RFC] blktap3: Introduce tapdisk control
 information retrieval functionality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch introduces files control/tap-ctl-info.[ch]. Function tap_ctl_info is
used by the xenio daemon to retrieve the size of the block device, as well as
the sector size,  in order to communicate it to blkfront so that it can create
the virtual block device.

diff --git a/tools/blktap3/control/tap-ctl-info.c b/tools/blktap3/control/tap-ctl-info.c
new file mode 100644
--- /dev/null
+++ b/tools/blktap3/control/tap-ctl-info.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include "tap-ctl.h"
+#include "tap-ctl-info.h"
+
+int tap_ctl_info(pid_t pid, int minor, unsigned long long *sectors,
+        unsigned int *sector_size, unsigned int *info)
+{
+    tapdisk_message_t message;
+    int err;
+
+    memset(&message, 0, sizeof(message));
+    message.type = TAPDISK_MESSAGE_DISK_INFO;
+    message.cookie = minor;
+
+    err = tap_ctl_connect_send_and_receive(pid, &message, NULL);
+    if (err)
+        return err;
+
+    if (message.type != TAPDISK_MESSAGE_DISK_INFO_RSP)
+        return -EINVAL;
+
+    *sectors = message.u.image.sectors;
+    *sector_size = message.u.image.sector_size;
+    *info = message.u.image.info;
+    return err;
+}
diff --git a/tools/blktap3/control/tap-ctl-info.h b/tools/blktap3/control/tap-ctl-info.h
new file mode 100644
--- /dev/null
+++ b/tools/blktap3/control/tap-ctl-info.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ */
+
+#ifndef __TAP_CTL_INFO_H__
+#define __TAP_CTL_INFO_H__
+
+/**
+ * Retrieves virtual disk information from a tapdisk.
+ *
+ * @pid the process ID of the tapdisk process
+ * @minor the minor device number
+ * @sectors output parameter that receives the number of sectors
+ * @sector_size output parameter that receives the size of the sector
+ * @info TODO ?
+ * 
+ */
+int tap_ctl_info(pid_t pid, int minor, unsigned long long *sectors,
+        unsigned int *sector_size, unsigned int *info);
+
+#endif /* __TAP_CTL_INFO_H__ */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQdh-0005kG-S2; Fri, 16 Nov 2012 18:27:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdd-0005hL-R6
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:38 +0000
Received: from [193.109.254.147:45830] by server-13.bemta-14.messagelabs.com
	id D6/70-11239-89586A05; Fri, 16 Nov 2012 18:27:36 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353090455!8550695!5
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22432 invoked from network); 16 Nov 2012 18:27:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857982"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:05 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:04 +0000
MIME-Version: 1.0
X-Mercurial-Node: 697a9eab0dce9284115452872aa7d64e008c0621
Message-ID: <697a9eab0dce92841154.1353090344@makatos-desktop>
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:44 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 4 of 9 RFC] blktap3: Introduce listing running
 tapdisks functionality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch introduces tap-ctl-list.c, the file where listing tapdisks
functionality is implemented. It is based on the existing blktap2 file with
most changes coming from blktap2 living in github. I have not examined the
changes in detail but it seems they are minor.

Function tap_ctl_list needs to be amended because minors are not retrieved
from sysfs (there's no sysfs blktap directory any more).

diff --git a/tools/blktap2/control/tap-ctl-list.c b/tools/blktap3/control/tap-ctl-list.c
copy from tools/blktap2/control/tap-ctl-list.c
copy to tools/blktap3/control/tap-ctl-list.c
--- a/tools/blktap2/control/tap-ctl-list.c
+++ b/tools/blktap3/control/tap-ctl-list.c
@@ -34,23 +34,47 @@
 #include <glob.h>
 
 #include "tap-ctl.h"
-#include "blktap2.h"
-#include "list.h"
+#include "blktap3.h"
+
+/**
+ * Allocates and initializes a tap_list_t.
+ */
+static tap_list_t *
+_tap_list_alloc(void)
+{
+	const size_t sz = sizeof(tap_list_t);
+	tap_list_t *tl;
+
+	tl = malloc(sz);
+	if (!tl)
+		return NULL;
+
+	tl->pid = -1;
+	tl->minor = -1;
+	tl->state = -1;
+	tl->type = NULL;
+	tl->path = NULL;
+
+	return tl;
+}
 
 static void
-free_list(tap_list_t *entry)
+_tap_list_free(tap_list_t * tl, struct tqh_tap_list *list)
 {
-	if (entry->type) {
-		free(entry->type);
-		entry->type = NULL;
+	if (tl->type) {
+		free(tl->type);
+		tl->type = NULL;
 	}
 
-	if (entry->path) {
-		free(entry->path);
-		entry->path = NULL;
+	if (tl->path) {
+		free(tl->path);
+		tl->path = NULL;
 	}
 
-	free(entry);
+	if (list)
+		TAILQ_REMOVE(list, tl, entry);
+
+	free(tl);
 }
 
 int
@@ -66,7 +90,7 @@ int
 	len = ptr - params;
 
 	*type = strndup(params, len);
-	*path =  strdup(params + len + 1);
+	*path = strdup(params + len + 1);
 
 	if (!*type || !*path) {
 		free(*type);
@@ -81,102 +105,26 @@ int
 	return 0;
 }
 
-static int
-init_list(tap_list_t *entry,
-	  int tap_id, pid_t tap_pid, int vbd_minor, int vbd_state,
-	  const char *params)
+void
+tap_ctl_list_free(struct tqh_tap_list *list)
 {
-	int err = 0;
+	tap_list_t *tl, *n;
 
-	entry->id     = tap_id;
-	entry->pid    = tap_pid;
-	entry->minor  = vbd_minor;
-	entry->state  = vbd_state;
-
-	if (params)
-		err = _parse_params(params, &entry->type, &entry->path);
-
-	return err;
-}
-
-void
-tap_ctl_free_list(tap_list_t **list)
-{
-	tap_list_t **_entry;
-
-	for (_entry = list; *_entry != NULL; ++_entry)
-		free_list(*_entry);
-
-	free(list);
-}
-
-static tap_list_t**
-tap_ctl_alloc_list(int n)
-{
-	tap_list_t **list, *entry;
-	size_t size;
-	int i;
-
-	size = sizeof(tap_list_t*) * (n+1);
-	list = malloc(size);
-	if (!list)
-		goto fail;
-
-	memset(list, 0, size);
-
-	for (i = 0; i < n; ++i) {
-		tap_list_t *entry;
-
-		entry = malloc(sizeof(tap_list_t));
-		if (!entry)
-			goto fail;
-
-		memset(entry, 0, sizeof(tap_list_t));
-
-		list[i] = entry;
-	}
-
-	return list;
-
-fail:
-	if (list)
-		tap_ctl_free_list(list);
-
-	return NULL;
-}
-
-static int
-tap_ctl_list_length(const tap_list_t **list)
-{
-	const tap_list_t **_entry;
-	int n;
-
-	n = 0;
-	for (_entry = list; *_entry != NULL; ++_entry)
-		n++;
-
-	return n;
-}
-
-static int
-_tap_minor_cmp(const void *a, const void *b)
-{
-	return *(int*)a - *(int*)b;
+	tap_list_for_each_entry_safe(tl, n, list)
+		_tap_list_free(tl, list);
 }
 
 int
-_tap_ctl_find_minors(int **_minorv)
+_tap_ctl_find_tapdisks(struct tqh_tap_list *list)
 {
-	glob_t glbuf = { 0 };
+	glob_t glbuf = { 0 };	
 	const char *pattern, *format;
-	int *minorv = NULL, n_minors = 0;
-	int err, i;
+	int err, i, n_taps = 0;
 
-	pattern = BLKTAP2_SYSFS_DIR"/blktap*";
-	format  = BLKTAP2_SYSFS_DIR"/blktap%d";
+	pattern = BLKTAP3_CONTROL_DIR "/" BLKTAP3_CONTROL_SOCKET "*";
+	format = BLKTAP3_CONTROL_DIR "/" BLKTAP3_CONTROL_SOCKET "%d";
 
-	n_minors = 0;
-	minorv   = NULL;
+	TAILQ_INIT(list);
 
 	err = glob(pattern, 0, NULL, &glbuf);
 	switch (err) {
@@ -186,337 +134,231 @@ int
 	case GLOB_ABORTED:
 	case GLOB_NOSPACE:
 		err = -errno;
-		EPRINTF("%s: glob failed, err %d", pattern, err);
-		goto fail;
-	}
-
-	minorv = malloc(sizeof(int) * glbuf.gl_pathc);
-	if (!minorv) {
-		err = -errno;
+		EPRINTF("%s: glob failed: %s", pattern, strerror(err));
 		goto fail;
 	}
 
 	for (i = 0; i < glbuf.gl_pathc; ++i) {
+		tap_list_t *tl;
 		int n;
 
-		n = sscanf(glbuf.gl_pathv[i], format, &minorv[n_minors]);
+		tl = _tap_list_alloc();
+		if (!tl) {
+			err = -ENOMEM;
+			goto fail;
+		}
+
+		n = sscanf(glbuf.gl_pathv[i], format, &tl->pid);
 		if (n != 1)
-			continue;
+			goto skip;
 
-		n_minors++;
+		tl->pid = tap_ctl_get_pid(tl->pid);
+		if (tl->pid < 0)
+			goto skip;
+
+		TAILQ_INSERT_TAIL(list, tl, entry);
+		n_taps++;
+		continue;
+
+	  skip:
+		_tap_list_free(tl, NULL);
 	}
 
-	qsort(minorv, n_minors, sizeof(int), _tap_minor_cmp);
-
-done:
-	*_minorv = minorv;
+  done:
 	err = 0;
-
-out:
-	if (glbuf.gl_pathv)
-		globfree(&glbuf);
-
-	return err ? : n_minors;
-
-fail:
-	if (minorv)
-		free(minorv);
-
-	goto out;
-}
-
-struct tapdisk {
-	int    id;
-	pid_t  pid;
-	struct list_head list;
-};
-
-static int
-_tap_tapdisk_cmp(const void *a, const void *b)
-{
-	return ((struct tapdisk*)a)->id - ((struct tapdisk*)b)->id;
-}
-
-int
-_tap_ctl_find_tapdisks(struct tapdisk **_tapv)
-{
-	glob_t glbuf = { 0 };
-	const char *pattern, *format;
-	struct tapdisk *tapv = NULL;
-	int err, i, n_taps = 0;
-
-	pattern = BLKTAP2_CONTROL_DIR"/"BLKTAP2_CONTROL_SOCKET"*";
-	format  = BLKTAP2_CONTROL_DIR"/"BLKTAP2_CONTROL_SOCKET"%d";
-
-	n_taps = 0;
-	tapv   = NULL;
-
-	err = glob(pattern, 0, NULL, &glbuf);
-	switch (err) {
-	case GLOB_NOMATCH:
-		goto done;
-
-	case GLOB_ABORTED:
-	case GLOB_NOSPACE:
-		err = -errno;
-		EPRINTF("%s: glob failed, err %d", pattern, err);
-		goto fail;
-	}
-
-	tapv = malloc(sizeof(struct tapdisk) * glbuf.gl_pathc);
-	if (!tapv) {
-		err = -errno;
-		goto fail;
-	}
-
-	for (i = 0; i < glbuf.gl_pathc; ++i) {
-		struct tapdisk *tap;
-		int n;
-
-		tap = &tapv[n_taps];
-
-		err = sscanf(glbuf.gl_pathv[i], format, &tap->id);
-		if (err != 1)
-			continue;
-
-		tap->pid = tap_ctl_get_pid(tap->id);
-		if (tap->pid < 0)
-			continue;
-
-		n_taps++;
-	}
-
-	qsort(tapv, n_taps, sizeof(struct tapdisk), _tap_tapdisk_cmp);
-
-	for (i = 0; i < n_taps; ++i)
-		INIT_LIST_HEAD(&tapv[i].list);
-
-done:
-	*_tapv = tapv;
-	err = 0;
-
-out:
+  out:
 	if (glbuf.gl_pathv)
 		globfree(&glbuf);
 
 	return err ? : n_taps;
 
-fail:
-	if (tapv)
-		free(tapv);
-
+  fail:
+	tap_ctl_list_free(list);
 	goto out;
 }
 
-struct tapdisk_list {
-	int  minor;
-	int  state;
-	char *params;
-	struct list_head entry;
-};
-
-int
-_tap_ctl_list_tapdisk(int id, struct list_head *_list)
+/**
+ * Retrieves all the VBDs a tapdisk is serving.
+ *
+ * @param pid the process ID of the tapdisk whose VBDs should be retrieved
+ * @param list output parameter that receives the list of VBD
+ * @returns 0 on success, an error code otherwise
+ */
+static int
+_tap_ctl_list_tapdisk(pid_t pid, struct tqh_tap_list *list)
 {
+	struct timeval timeout = {.tv_sec = 10,.tv_usec = 0 };
 	tapdisk_message_t message;
-	struct list_head list;
-	struct tapdisk_list *tl, *next;
+	tap_list_t *tl;
 	int err, sfd;
 
-	err = tap_ctl_connect_id(id, &sfd);
+	err = tap_ctl_connect_id(pid, &sfd);
 	if (err)
 		return err;
 
 	memset(&message, 0, sizeof(message));
-	message.type   = TAPDISK_MESSAGE_LIST;
+	message.type = TAPDISK_MESSAGE_LIST;
 	message.cookie = -1;
 
-	err = tap_ctl_write_message(sfd, &message, 2);
+	err = tap_ctl_write_message(sfd, &message, &timeout);
 	if (err)
 		return err;
 
-	INIT_LIST_HEAD(&list);
+	TAILQ_INIT(list);
+
 	do {
-		err = tap_ctl_read_message(sfd, &message, 2);
+		err = tap_ctl_read_message(sfd, &message, &timeout);
 		if (err) {
 			err = -EPROTO;
-			break;
+			goto fail;
 		}
 
 		if (message.u.list.count == 0)
 			break;
 
-		tl = malloc(sizeof(struct tapdisk_list));
+		tl = _tap_list_alloc();
 		if (!tl) {
 			err = -ENOMEM;
-			break;
+			goto fail;
 		}
 
-		tl->minor  = message.u.list.minor;
-		tl->state  = message.u.list.state;
+		tl->pid = pid;
+		tl->minor = message.u.list.minor;
+		tl->state = message.u.list.state;
+
 		if (message.u.list.path[0] != 0) {
-			tl->params = strndup(message.u.list.path,
-					     sizeof(message.u.list.path));
-			if (!tl->params) {
-				err = -errno;
-				break;
+			err = _parse_params(message.u.list.path, &tl->type, &tl->path);
+			if (err) {
+				_tap_list_free(tl, NULL);
+				goto fail;
 			}
-		} else
-			tl->params = NULL;
+		}
 
-		list_add(&tl->entry, &list);
+		TAILQ_INSERT_HEAD(list, tl, entry);
 	} while (1);
 
-	if (err)
-		list_for_each_entry_safe(tl, next, &list, entry) {
-			list_del(&tl->entry);
-			free(tl->params);
-			free(tl);
-		}
+	err = 0;
+  out:
+	close(sfd);
+	return 0;
 
-	close(sfd);
-	list_splice(&list, _list);
-	return err;
-}
-
-void
-_tap_ctl_free_tapdisks(struct tapdisk *tapv, int n_taps)
-{
-	struct tapdisk *tap;
-
-	for (tap = tapv; tap < &tapv[n_taps]; ++tap) {
-		struct tapdisk_list *tl, *next;
-
-		list_for_each_entry_safe(tl, next, &tap->list, entry) {
-			free(tl->params);
-			free(tl);
-		}
-	}
-
-	free(tapv);
+  fail:
+	tap_ctl_list_free(list);
+	goto out;
 }
 
 int
-_tap_list_join3(int n_minors, int *minorv, int n_taps, struct tapdisk *tapv,
-		tap_list_t ***_list)
+tap_ctl_list(struct tqh_tap_list *list)
 {
-	tap_list_t **list, **_entry, *entry;
-	int i, _m, err;
+	struct tqh_tap_list minors, tapdisks, vbds;
+	tap_list_t *t, *next_t, *v, *next_v, *m, *next_m;
+	int err;
 
-	list = tap_ctl_alloc_list(n_minors + n_taps);
-	if (!list) {
-		err = -ENOMEM;
+	/*
+	 * Find all minors, find all tapdisks, then list all minors
+	 * they attached to. Output is a 3-way outer join.
+	 */
+	TAILQ_INIT(&minors);
+
+	/*
+	 * TODO There's no blktap sysfs entry anymore, get rid of minors and
+	 * rationalise the rest of this function.
+	 */
+#if 0
+	err = _tap_ctl_find_minors(&minors);
+	if (err < 0) {
+		EPRINTF("error finding minors: %s\n", strerror(err));
+		goto fail;
+	}
+#endif
+
+	err = _tap_ctl_find_tapdisks(&tapdisks);
+	if (err < 0) {
+		EPRINTF("error finding tapdisks: %s\n", strerror(err));
 		goto fail;
 	}
 
-	_entry = list;
+	TAILQ_INIT(list);
 
-	for (i = 0; i < n_taps; ++i) {
-		struct tapdisk *tap = &tapv[i];
-		struct tapdisk_list *tl;
+	tap_list_for_each_entry_safe(t, next_t, &tapdisks) {
 
-		/* orphaned tapdisk */
-		if (list_empty(&tap->list)) {
-			err = init_list(*_entry++, tap->id, tap->pid, -1, -1, NULL);
-			if (err)
-				goto fail;
+		err = _tap_ctl_list_tapdisk(t->pid, &vbds);
+
+		/*
+		 * TODO Don't just swallow the error, print a warning, at least.
+		 */
+		if (err || TAILQ_EMPTY(&vbds)) {
+			TAILQ_MOVE_TAIL(t, &tapdisks, list, entry);
 			continue;
 		}
 
-		list_for_each_entry(tl, &tap->list, entry) {
+		tap_list_for_each_entry_safe(v, next_v, &vbds) {
 
-			err = init_list(*_entry++,
-					tap->id, tap->pid,
-					tl->minor, tl->state, tl->params);
-			if (err)
-				goto fail;
+			tap_list_for_each_entry_safe(m, next_m, &minors)
+				if (m->minor == v->minor) {
+				_tap_list_free(m, &minors);
+				break;
+			}
 
-			if (tl->minor >= 0) {
-				/* clear minor */
-				for (_m = 0; _m < n_minors; ++_m) {
-					if (minorv[_m] == tl->minor) {
-						minorv[_m] = -1;
-						break;
-					}
-				}
-			}
+			TAILQ_MOVE_TAIL(v, &vbds, list, entry);
 		}
+
+		_tap_list_free(t, &tapdisks);
 	}
 
 	/* orphaned minors */
-	for (_m = 0; _m < n_minors; ++_m) {
-		int minor = minorv[_m];
-		if (minor >= 0) {
-			err = init_list(*_entry++, -1, -1, minor, -1, NULL);
-			if (err)
-				goto fail;
-		}
-	}
-
-	/* free extraneous list entries */
-	for (; *_entry != NULL; ++entry) {
-		free_list(*_entry);
-		*_entry = NULL;
-	}
-
-	*_list = list;
+	TAILQ_CONCAT(list, &minors, entry);
 
 	return 0;
 
 fail:
-	if (list)
-		tap_ctl_free_list(list);
+	tap_ctl_list_free(list);
+
+	tap_ctl_list_free(&vbds);
+	tap_ctl_list_free(&tapdisks);
+	tap_ctl_list_free(&minors);
 
 	return err;
 }
 
 int
-tap_ctl_list(tap_list_t ***list)
+tap_ctl_list_pid(pid_t pid, struct tqh_tap_list *list)
 {
-	int n_taps, n_minors, err, *minorv;
-	struct tapdisk *tapv, *tap;
+	tap_list_t *t;
+	int err;
 
-	n_taps   = -1;
-	n_minors = -1;
+	t = _tap_list_alloc();
+	if (!t)
+		return -ENOMEM;
 
-	err = n_minors = _tap_ctl_find_minors(&minorv);
-	if (err < 0)
-		goto out;
-
-	err = n_taps = _tap_ctl_find_tapdisks(&tapv);
-	if (err < 0)
-		goto out;
-
-	for (tap = tapv; tap < &tapv[n_taps]; ++tap) {
-		err = _tap_ctl_list_tapdisk(tap->id, &tap->list);
-		if (err)
-			goto out;
+	t->pid = tap_ctl_get_pid(pid);
+	if (t->pid < 0) {
+		_tap_list_free(t, NULL);
+		return 0;
 	}
 
-	err = _tap_list_join3(n_minors, minorv, n_taps, tapv, list);
+	err = _tap_ctl_list_tapdisk(t->pid, list);
 
-out:
-	if (n_taps > 0)
-		_tap_ctl_free_tapdisks(tapv, n_taps);
+	if (err || TAILQ_EMPTY(list))
+		TAILQ_INSERT_TAIL(list, t, entry);
 
-	if (n_minors > 0)
-		free(minorv);
-
-	return err;
+	return 0;
 }
 
 int
-tap_ctl_find(const char *type, const char *path, tap_list_t *tap)
+tap_ctl_find_minor(const char *type, const char *path)
 {
-	tap_list_t **list, **_entry;
-	int ret = -ENOENT, err;
+	struct tqh_tap_list list = TAILQ_HEAD_INITIALIZER(list);
+	tap_list_t *entry;
+	int minor, err;
 
 	err = tap_ctl_list(&list);
 	if (err)
 		return err;
 
-	for (_entry = list; *_entry != NULL; ++_entry) {
-		tap_list_t *entry  = *_entry;
+	minor = -1;
+
+	tap_list_for_each_entry(entry, &list) {
 
 		if (type && (!entry->type || strcmp(entry->type, type)))
 			continue;
@@ -524,13 +366,11 @@ tap_ctl_find(const char *type, const cha
 		if (path && (!entry->path || strcmp(entry->path, path)))
 			continue;
 
-		*tap = *entry;
-		tap->type = tap->path = NULL;
-		ret = 0;
+		minor = entry->minor;
 		break;
 	}
 
-	tap_ctl_free_list(list);
+	tap_ctl_list_free(&list);
 
-	return ret;
+	return minor >= 0 ? minor : -ENOENT;
 }

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQdh-0005kG-S2; Fri, 16 Nov 2012 18:27:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdd-0005hL-R6
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:38 +0000
Received: from [193.109.254.147:45830] by server-13.bemta-14.messagelabs.com
	id D6/70-11239-89586A05; Fri, 16 Nov 2012 18:27:36 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353090455!8550695!5
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22432 invoked from network); 16 Nov 2012 18:27:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857982"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:05 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:04 +0000
MIME-Version: 1.0
X-Mercurial-Node: 697a9eab0dce9284115452872aa7d64e008c0621
Message-ID: <697a9eab0dce92841154.1353090344@makatos-desktop>
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:44 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 4 of 9 RFC] blktap3: Introduce listing running
 tapdisks functionality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch introduces tap-ctl-list.c, the file where listing tapdisks
functionality is implemented. It is based on the existing blktap2 file with
most changes coming from blktap2 living in github. I have not examined the
changes in detail but it seems they are minor.

Function tap_ctl_list needs to be amended because minors are not retrieved
from sysfs (there's no sysfs blktap directory any more).

diff --git a/tools/blktap2/control/tap-ctl-list.c b/tools/blktap3/control/tap-ctl-list.c
copy from tools/blktap2/control/tap-ctl-list.c
copy to tools/blktap3/control/tap-ctl-list.c
--- a/tools/blktap2/control/tap-ctl-list.c
+++ b/tools/blktap3/control/tap-ctl-list.c
@@ -34,23 +34,47 @@
 #include <glob.h>
 
 #include "tap-ctl.h"
-#include "blktap2.h"
-#include "list.h"
+#include "blktap3.h"
+
+/**
+ * Allocates and initializes a tap_list_t.
+ */
+static tap_list_t *
+_tap_list_alloc(void)
+{
+	const size_t sz = sizeof(tap_list_t);
+	tap_list_t *tl;
+
+	tl = malloc(sz);
+	if (!tl)
+		return NULL;
+
+	tl->pid = -1;
+	tl->minor = -1;
+	tl->state = -1;
+	tl->type = NULL;
+	tl->path = NULL;
+
+	return tl;
+}
 
 static void
-free_list(tap_list_t *entry)
+_tap_list_free(tap_list_t * tl, struct tqh_tap_list *list)
 {
-	if (entry->type) {
-		free(entry->type);
-		entry->type = NULL;
+	if (tl->type) {
+		free(tl->type);
+		tl->type = NULL;
 	}
 
-	if (entry->path) {
-		free(entry->path);
-		entry->path = NULL;
+	if (tl->path) {
+		free(tl->path);
+		tl->path = NULL;
 	}
 
-	free(entry);
+	if (list)
+		TAILQ_REMOVE(list, tl, entry);
+
+	free(tl);
 }
 
 int
@@ -66,7 +90,7 @@ int
 	len = ptr - params;
 
 	*type = strndup(params, len);
-	*path =  strdup(params + len + 1);
+	*path = strdup(params + len + 1);
 
 	if (!*type || !*path) {
 		free(*type);
@@ -81,102 +105,26 @@ int
 	return 0;
 }
 
-static int
-init_list(tap_list_t *entry,
-	  int tap_id, pid_t tap_pid, int vbd_minor, int vbd_state,
-	  const char *params)
+void
+tap_ctl_list_free(struct tqh_tap_list *list)
 {
-	int err = 0;
+	tap_list_t *tl, *n;
 
-	entry->id     = tap_id;
-	entry->pid    = tap_pid;
-	entry->minor  = vbd_minor;
-	entry->state  = vbd_state;
-
-	if (params)
-		err = _parse_params(params, &entry->type, &entry->path);
-
-	return err;
-}
-
-void
-tap_ctl_free_list(tap_list_t **list)
-{
-	tap_list_t **_entry;
-
-	for (_entry = list; *_entry != NULL; ++_entry)
-		free_list(*_entry);
-
-	free(list);
-}
-
-static tap_list_t**
-tap_ctl_alloc_list(int n)
-{
-	tap_list_t **list, *entry;
-	size_t size;
-	int i;
-
-	size = sizeof(tap_list_t*) * (n+1);
-	list = malloc(size);
-	if (!list)
-		goto fail;
-
-	memset(list, 0, size);
-
-	for (i = 0; i < n; ++i) {
-		tap_list_t *entry;
-
-		entry = malloc(sizeof(tap_list_t));
-		if (!entry)
-			goto fail;
-
-		memset(entry, 0, sizeof(tap_list_t));
-
-		list[i] = entry;
-	}
-
-	return list;
-
-fail:
-	if (list)
-		tap_ctl_free_list(list);
-
-	return NULL;
-}
-
-static int
-tap_ctl_list_length(const tap_list_t **list)
-{
-	const tap_list_t **_entry;
-	int n;
-
-	n = 0;
-	for (_entry = list; *_entry != NULL; ++_entry)
-		n++;
-
-	return n;
-}
-
-static int
-_tap_minor_cmp(const void *a, const void *b)
-{
-	return *(int*)a - *(int*)b;
+	tap_list_for_each_entry_safe(tl, n, list)
+		_tap_list_free(tl, list);
 }
 
 int
-_tap_ctl_find_minors(int **_minorv)
+_tap_ctl_find_tapdisks(struct tqh_tap_list *list)
 {
-	glob_t glbuf = { 0 };
+	glob_t glbuf = { 0 };	
 	const char *pattern, *format;
-	int *minorv = NULL, n_minors = 0;
-	int err, i;
+	int err, i, n_taps = 0;
 
-	pattern = BLKTAP2_SYSFS_DIR"/blktap*";
-	format  = BLKTAP2_SYSFS_DIR"/blktap%d";
+	pattern = BLKTAP3_CONTROL_DIR "/" BLKTAP3_CONTROL_SOCKET "*";
+	format = BLKTAP3_CONTROL_DIR "/" BLKTAP3_CONTROL_SOCKET "%d";
 
-	n_minors = 0;
-	minorv   = NULL;
+	TAILQ_INIT(list);
 
 	err = glob(pattern, 0, NULL, &glbuf);
 	switch (err) {
@@ -186,337 +134,231 @@ int
 	case GLOB_ABORTED:
 	case GLOB_NOSPACE:
 		err = -errno;
-		EPRINTF("%s: glob failed, err %d", pattern, err);
-		goto fail;
-	}
-
-	minorv = malloc(sizeof(int) * glbuf.gl_pathc);
-	if (!minorv) {
-		err = -errno;
+		EPRINTF("%s: glob failed: %s", pattern, strerror(err));
 		goto fail;
 	}
 
 	for (i = 0; i < glbuf.gl_pathc; ++i) {
+		tap_list_t *tl;
 		int n;
 
-		n = sscanf(glbuf.gl_pathv[i], format, &minorv[n_minors]);
+		tl = _tap_list_alloc();
+		if (!tl) {
+			err = -ENOMEM;
+			goto fail;
+		}
+
+		n = sscanf(glbuf.gl_pathv[i], format, &tl->pid);
 		if (n != 1)
-			continue;
+			goto skip;
 
-		n_minors++;
+		tl->pid = tap_ctl_get_pid(tl->pid);
+		if (tl->pid < 0)
+			goto skip;
+
+		TAILQ_INSERT_TAIL(list, tl, entry);
+		n_taps++;
+		continue;
+
+	  skip:
+		_tap_list_free(tl, NULL);
 	}
 
-	qsort(minorv, n_minors, sizeof(int), _tap_minor_cmp);
-
-done:
-	*_minorv = minorv;
+  done:
 	err = 0;
-
-out:
-	if (glbuf.gl_pathv)
-		globfree(&glbuf);
-
-	return err ? : n_minors;
-
-fail:
-	if (minorv)
-		free(minorv);
-
-	goto out;
-}
-
-struct tapdisk {
-	int    id;
-	pid_t  pid;
-	struct list_head list;
-};
-
-static int
-_tap_tapdisk_cmp(const void *a, const void *b)
-{
-	return ((struct tapdisk*)a)->id - ((struct tapdisk*)b)->id;
-}
-
-int
-_tap_ctl_find_tapdisks(struct tapdisk **_tapv)
-{
-	glob_t glbuf = { 0 };
-	const char *pattern, *format;
-	struct tapdisk *tapv = NULL;
-	int err, i, n_taps = 0;
-
-	pattern = BLKTAP2_CONTROL_DIR"/"BLKTAP2_CONTROL_SOCKET"*";
-	format  = BLKTAP2_CONTROL_DIR"/"BLKTAP2_CONTROL_SOCKET"%d";
-
-	n_taps = 0;
-	tapv   = NULL;
-
-	err = glob(pattern, 0, NULL, &glbuf);
-	switch (err) {
-	case GLOB_NOMATCH:
-		goto done;
-
-	case GLOB_ABORTED:
-	case GLOB_NOSPACE:
-		err = -errno;
-		EPRINTF("%s: glob failed, err %d", pattern, err);
-		goto fail;
-	}
-
-	tapv = malloc(sizeof(struct tapdisk) * glbuf.gl_pathc);
-	if (!tapv) {
-		err = -errno;
-		goto fail;
-	}
-
-	for (i = 0; i < glbuf.gl_pathc; ++i) {
-		struct tapdisk *tap;
-		int n;
-
-		tap = &tapv[n_taps];
-
-		err = sscanf(glbuf.gl_pathv[i], format, &tap->id);
-		if (err != 1)
-			continue;
-
-		tap->pid = tap_ctl_get_pid(tap->id);
-		if (tap->pid < 0)
-			continue;
-
-		n_taps++;
-	}
-
-	qsort(tapv, n_taps, sizeof(struct tapdisk), _tap_tapdisk_cmp);
-
-	for (i = 0; i < n_taps; ++i)
-		INIT_LIST_HEAD(&tapv[i].list);
-
-done:
-	*_tapv = tapv;
-	err = 0;
-
-out:
+  out:
 	if (glbuf.gl_pathv)
 		globfree(&glbuf);
 
 	return err ? : n_taps;
 
-fail:
-	if (tapv)
-		free(tapv);
-
+  fail:
+	tap_ctl_list_free(list);
 	goto out;
 }
 
-struct tapdisk_list {
-	int  minor;
-	int  state;
-	char *params;
-	struct list_head entry;
-};
-
-int
-_tap_ctl_list_tapdisk(int id, struct list_head *_list)
+/**
+ * Retrieves all the VBDs a tapdisk is serving.
+ *
+ * @param pid the process ID of the tapdisk whose VBDs should be retrieved
+ * @param list output parameter that receives the list of VBD
+ * @returns 0 on success, an error code otherwise
+ */
+static int
+_tap_ctl_list_tapdisk(pid_t pid, struct tqh_tap_list *list)
 {
+	struct timeval timeout = {.tv_sec = 10,.tv_usec = 0 };
 	tapdisk_message_t message;
-	struct list_head list;
-	struct tapdisk_list *tl, *next;
+	tap_list_t *tl;
 	int err, sfd;
 
-	err = tap_ctl_connect_id(id, &sfd);
+	err = tap_ctl_connect_id(pid, &sfd);
 	if (err)
 		return err;
 
 	memset(&message, 0, sizeof(message));
-	message.type   = TAPDISK_MESSAGE_LIST;
+	message.type = TAPDISK_MESSAGE_LIST;
 	message.cookie = -1;
 
-	err = tap_ctl_write_message(sfd, &message, 2);
+	err = tap_ctl_write_message(sfd, &message, &timeout);
 	if (err)
 		return err;
 
-	INIT_LIST_HEAD(&list);
+	TAILQ_INIT(list);
+
 	do {
-		err = tap_ctl_read_message(sfd, &message, 2);
+		err = tap_ctl_read_message(sfd, &message, &timeout);
 		if (err) {
 			err = -EPROTO;
-			break;
+			goto fail;
 		}
 
 		if (message.u.list.count == 0)
 			break;
 
-		tl = malloc(sizeof(struct tapdisk_list));
+		tl = _tap_list_alloc();
 		if (!tl) {
 			err = -ENOMEM;
-			break;
+			goto fail;
 		}
 
-		tl->minor  = message.u.list.minor;
-		tl->state  = message.u.list.state;
+		tl->pid = pid;
+		tl->minor = message.u.list.minor;
+		tl->state = message.u.list.state;
+
 		if (message.u.list.path[0] != 0) {
-			tl->params = strndup(message.u.list.path,
-					     sizeof(message.u.list.path));
-			if (!tl->params) {
-				err = -errno;
-				break;
+			err = _parse_params(message.u.list.path, &tl->type, &tl->path);
+			if (err) {
+				_tap_list_free(tl, NULL);
+				goto fail;
 			}
-		} else
-			tl->params = NULL;
+		}
 
-		list_add(&tl->entry, &list);
+		TAILQ_INSERT_HEAD(list, tl, entry);
 	} while (1);
 
-	if (err)
-		list_for_each_entry_safe(tl, next, &list, entry) {
-			list_del(&tl->entry);
-			free(tl->params);
-			free(tl);
-		}
+	err = 0;
+  out:
+	close(sfd);
+	return 0;
 
-	close(sfd);
-	list_splice(&list, _list);
-	return err;
-}
-
-void
-_tap_ctl_free_tapdisks(struct tapdisk *tapv, int n_taps)
-{
-	struct tapdisk *tap;
-
-	for (tap = tapv; tap < &tapv[n_taps]; ++tap) {
-		struct tapdisk_list *tl, *next;
-
-		list_for_each_entry_safe(tl, next, &tap->list, entry) {
-			free(tl->params);
-			free(tl);
-		}
-	}
-
-	free(tapv);
+  fail:
+	tap_ctl_list_free(list);
+	goto out;
 }
 
 int
-_tap_list_join3(int n_minors, int *minorv, int n_taps, struct tapdisk *tapv,
-		tap_list_t ***_list)
+tap_ctl_list(struct tqh_tap_list *list)
 {
-	tap_list_t **list, **_entry, *entry;
-	int i, _m, err;
+	struct tqh_tap_list minors, tapdisks, vbds;
+	tap_list_t *t, *next_t, *v, *next_v, *m, *next_m;
+	int err;
 
-	list = tap_ctl_alloc_list(n_minors + n_taps);
-	if (!list) {
-		err = -ENOMEM;
+	/*
+	 * Find all minors, find all tapdisks, then list all minors
+	 * they attached to. Output is a 3-way outer join.
+	 */
+	TAILQ_INIT(&minors);
+
+	/*
+	 * TODO There's no blktap sysfs entry anymore, get rid of minors and
+	 * rationalise the rest of this function.
+	 */
+#if 0
+	err = _tap_ctl_find_minors(&minors);
+	if (err < 0) {
+		EPRINTF("error finding minors: %s\n", strerror(err));
+		goto fail;
+	}
+#endif
+
+	err = _tap_ctl_find_tapdisks(&tapdisks);
+	if (err < 0) {
+		EPRINTF("error finding tapdisks: %s\n", strerror(err));
 		goto fail;
 	}
 
-	_entry = list;
+	TAILQ_INIT(list);
 
-	for (i = 0; i < n_taps; ++i) {
-		struct tapdisk *tap = &tapv[i];
-		struct tapdisk_list *tl;
+	tap_list_for_each_entry_safe(t, next_t, &tapdisks) {
 
-		/* orphaned tapdisk */
-		if (list_empty(&tap->list)) {
-			err = init_list(*_entry++, tap->id, tap->pid, -1, -1, NULL);
-			if (err)
-				goto fail;
+		err = _tap_ctl_list_tapdisk(t->pid, &vbds);
+
+		/*
+		 * TODO Don't just swallow the error, print a warning, at least.
+		 */
+		if (err || TAILQ_EMPTY(&vbds)) {
+			TAILQ_MOVE_TAIL(t, &tapdisks, list, entry);
 			continue;
 		}
 
-		list_for_each_entry(tl, &tap->list, entry) {
+		tap_list_for_each_entry_safe(v, next_v, &vbds) {
 
-			err = init_list(*_entry++,
-					tap->id, tap->pid,
-					tl->minor, tl->state, tl->params);
-			if (err)
-				goto fail;
+			tap_list_for_each_entry_safe(m, next_m, &minors)
+				if (m->minor == v->minor) {
+				_tap_list_free(m, &minors);
+				break;
+			}
 
-			if (tl->minor >= 0) {
-				/* clear minor */
-				for (_m = 0; _m < n_minors; ++_m) {
-					if (minorv[_m] == tl->minor) {
-						minorv[_m] = -1;
-						break;
-					}
-				}
-			}
+			TAILQ_MOVE_TAIL(v, &vbds, list, entry);
 		}
+
+		_tap_list_free(t, &tapdisks);
 	}
 
 	/* orphaned minors */
-	for (_m = 0; _m < n_minors; ++_m) {
-		int minor = minorv[_m];
-		if (minor >= 0) {
-			err = init_list(*_entry++, -1, -1, minor, -1, NULL);
-			if (err)
-				goto fail;
-		}
-	}
-
-	/* free extraneous list entries */
-	for (; *_entry != NULL; ++entry) {
-		free_list(*_entry);
-		*_entry = NULL;
-	}
-
-	*_list = list;
+	TAILQ_CONCAT(list, &minors, entry);
 
 	return 0;
 
 fail:
-	if (list)
-		tap_ctl_free_list(list);
+	tap_ctl_list_free(list);
+
+	tap_ctl_list_free(&vbds);
+	tap_ctl_list_free(&tapdisks);
+	tap_ctl_list_free(&minors);
 
 	return err;
 }
 
 int
-tap_ctl_list(tap_list_t ***list)
+tap_ctl_list_pid(pid_t pid, struct tqh_tap_list *list)
 {
-	int n_taps, n_minors, err, *minorv;
-	struct tapdisk *tapv, *tap;
+	tap_list_t *t;
+	int err;
 
-	n_taps   = -1;
-	n_minors = -1;
+	t = _tap_list_alloc();
+	if (!t)
+		return -ENOMEM;
 
-	err = n_minors = _tap_ctl_find_minors(&minorv);
-	if (err < 0)
-		goto out;
-
-	err = n_taps = _tap_ctl_find_tapdisks(&tapv);
-	if (err < 0)
-		goto out;
-
-	for (tap = tapv; tap < &tapv[n_taps]; ++tap) {
-		err = _tap_ctl_list_tapdisk(tap->id, &tap->list);
-		if (err)
-			goto out;
+	t->pid = tap_ctl_get_pid(pid);
+	if (t->pid < 0) {
+		_tap_list_free(t, NULL);
+		return 0;
 	}
 
-	err = _tap_list_join3(n_minors, minorv, n_taps, tapv, list);
+	err = _tap_ctl_list_tapdisk(t->pid, list);
 
-out:
-	if (n_taps > 0)
-		_tap_ctl_free_tapdisks(tapv, n_taps);
+	if (err || TAILQ_EMPTY(list))
+		TAILQ_INSERT_TAIL(list, t, entry);
 
-	if (n_minors > 0)
-		free(minorv);
-
-	return err;
+	return 0;
 }
 
 int
-tap_ctl_find(const char *type, const char *path, tap_list_t *tap)
+tap_ctl_find_minor(const char *type, const char *path)
 {
-	tap_list_t **list, **_entry;
-	int ret = -ENOENT, err;
+	struct tqh_tap_list list = TAILQ_HEAD_INITIALIZER(list);
+	tap_list_t *entry;
+	int minor, err;
 
 	err = tap_ctl_list(&list);
 	if (err)
 		return err;
 
-	for (_entry = list; *_entry != NULL; ++_entry) {
-		tap_list_t *entry  = *_entry;
+	minor = -1;
+
+	tap_list_for_each_entry(entry, &list) {
 
 		if (type && (!entry->type || strcmp(entry->type, type)))
 			continue;
@@ -524,13 +366,11 @@ tap_ctl_find(const char *type, const cha
 		if (path && (!entry->path || strcmp(entry->path, path)))
 			continue;
 
-		*tap = *entry;
-		tap->type = tap->path = NULL;
-		ret = 0;
+		minor = entry->minor;
 		break;
 	}
 
-	tap_ctl_free_list(list);
+	tap_ctl_list_free(&list);
 
-	return ret;
+	return minor >= 0 ? minor : -ENOENT;
 }

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQdg-0005j5-2F; Fri, 16 Nov 2012 18:27:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdd-0005hR-F7
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:37 +0000
Received: from [193.109.254.147:45846] by server-11.bemta-14.messagelabs.com
	id 62/EA-29027-89586A05; Fri, 16 Nov 2012 18:27:36 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353090455!8550695!7
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22466 invoked from network); 16 Nov 2012 18:27:36 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:36 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857985"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:06 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:05 +0000
MIME-Version: 1.0
X-Mercurial-Node: 1e0bac59c4bb8bfe12a1881e405c97300a88e9ed
Message-ID: <1e0bac59c4bb8bfe12a1.1353090347@makatos-desktop>
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:47 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 7 of 9 RFC] blktap3: Introduce tapdisk message
 exchange functionality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch introduces file conrol/tap-ctl-ipc.c, where the functionality of
talking to a tapdisk process is implemented. This file is imported from the
existing blktap2 implementation, with most changes coming from blktap2 living
in github.

diff --git a/tools/blktap2/control/tap-ctl-ipc.c b/tools/blktap3/control/tap-ctl-ipc.c
copy from tools/blktap2/control/tap-ctl-ipc.c
copy to tools/blktap3/control/tap-ctl-ipc.c
--- a/tools/blktap2/control/tap-ctl-ipc.c
+++ b/tools/blktap3/control/tap-ctl-ipc.c
@@ -30,44 +30,33 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
+#include <fcntl.h>
 #include <sys/un.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 
 #include "tap-ctl.h"
-#include "blktap2.h"
+#include "blktap3.h"
 
 int tap_ctl_debug = 0;
 
 int
-tap_ctl_read_message(int fd, tapdisk_message_t *message, int timeout)
+tap_ctl_read_raw(int fd, void *buf, size_t size, struct timeval *timeout)
 {
 	fd_set readfds;
-	int ret, len, offset;
-	struct timeval tv, *t;
+	size_t offset = 0;
+	int ret;
 
-	t      = NULL;
-	offset = 0;
-	len    = sizeof(tapdisk_message_t);
-
-	if (timeout) {
-		tv.tv_sec  = timeout;
-		tv.tv_usec = 0;
-		t = &tv;
-	}
-
-	memset(message, 0, sizeof(tapdisk_message_t));
-
-	while (offset < len) {
+	while (offset < size) {
 		FD_ZERO(&readfds);
 		FD_SET(fd, &readfds);
 
-		ret = select(fd + 1, &readfds, NULL, NULL, t);
+		ret = select(fd + 1, &readfds, NULL, NULL, timeout);
 		if (ret == -1)
 			break;
 		else if (FD_ISSET(fd, &readfds)) {
-			ret = read(fd, message + offset, len - offset);
+			ret = read(fd, buf + offset, size - offset);
 			if (ret <= 0)
 				break;
 			offset += ret;
@@ -75,34 +64,24 @@ tap_ctl_read_message(int fd, tapdisk_mes
 			break;
 	}
 
-	if (offset != len) {
-		EPRINTF("failure reading message\n");
+	if (offset != size) {
+		EPRINTF("failure reading data %zd/%zd\n", offset, size);
 		return -EIO;
 	}
 
-	DBG("received '%s' message (uuid = %u)\n",
-	    tapdisk_message_name(message->type), message->cookie);
-
 	return 0;
 }
 
 int
-tap_ctl_write_message(int fd, tapdisk_message_t *message, int timeout)
+tap_ctl_write_message(int fd, tapdisk_message_t * message,
+					  struct timeval *timeout)
 {
 	fd_set writefds;
 	int ret, len, offset;
-	struct timeval tv, *t;
 
-	t      = NULL;
 	offset = 0;
 	len    = sizeof(tapdisk_message_t);
 
-	if (timeout) {
-		tv.tv_sec  = timeout;
-		tv.tv_usec = 0;
-		t = &tv;
-	}
-
 	DBG("sending '%s' message (uuid = %u)\n",
 	    tapdisk_message_name(message->type), message->cookie);
 
@@ -113,7 +92,7 @@ tap_ctl_write_message(int fd, tapdisk_me
 		/* we don't bother reinitializing tv. at worst, it will wait a
 		 * bit more time than expected. */
 
-		ret = select(fd + 1, NULL, &writefds, NULL, t);
+		ret = select(fd + 1, NULL, &writefds, NULL, timeout);
 		if (ret == -1)
 			break;
 		else if (FD_ISSET(fd, &writefds)) {
@@ -134,7 +113,8 @@ tap_ctl_write_message(int fd, tapdisk_me
 }
 
 int
-tap_ctl_send_and_receive(int sfd, tapdisk_message_t *message, int timeout)
+tap_ctl_send_and_receive(int sfd, tapdisk_message_t * message,
+						 struct timeval *timeout)
 {
 	int err;
 
@@ -161,7 +141,7 @@ tap_ctl_socket_name(int id)
 	char *name;
 
 	if (asprintf(&name, "%s/%s%d",
-		     BLKTAP2_CONTROL_DIR, BLKTAP2_CONTROL_SOCKET, id) == -1)
+				 BLKTAP3_CONTROL_DIR, BLKTAP3_CONTROL_SOCKET, id) == -1)
 		return NULL;
 
 	return name;
@@ -216,13 +196,15 @@ tap_ctl_connect_id(int id, int *sfd)
 	}
 
 	err = tap_ctl_connect(name, sfd);
+
 	free(name);
 
 	return err;
 }
 
 int
-tap_ctl_connect_send_and_receive(int id, tapdisk_message_t *message, int timeout)
+tap_ctl_connect_send_and_receive(int id, tapdisk_message_t * message,
+								 struct timeval *timeout)
 {
 	int err, sfd;
 
@@ -235,3 +217,20 @@ tap_ctl_connect_send_and_receive(int id,
 	close(sfd);
 	return err;
 }
+
+int
+tap_ctl_read_message(int fd, tapdisk_message_t * message,
+					 struct timeval *timeout)
+{
+	size_t size = sizeof(tapdisk_message_t);
+	int err;
+
+	err = tap_ctl_read_raw(fd, message, size, timeout);
+	if (err)
+		return err;
+
+	DBG("received '%s' message (uuid = %u)\n",
+		tapdisk_message_name(message->type), message->cookie);
+
+	return 0;
+}

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQdg-0005j5-2F; Fri, 16 Nov 2012 18:27:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdd-0005hR-F7
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:37 +0000
Received: from [193.109.254.147:45846] by server-11.bemta-14.messagelabs.com
	id 62/EA-29027-89586A05; Fri, 16 Nov 2012 18:27:36 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353090455!8550695!7
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22466 invoked from network); 16 Nov 2012 18:27:36 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:36 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857985"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:06 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:05 +0000
MIME-Version: 1.0
X-Mercurial-Node: 1e0bac59c4bb8bfe12a1881e405c97300a88e9ed
Message-ID: <1e0bac59c4bb8bfe12a1.1353090347@makatos-desktop>
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:47 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 7 of 9 RFC] blktap3: Introduce tapdisk message
 exchange functionality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch introduces file conrol/tap-ctl-ipc.c, where the functionality of
talking to a tapdisk process is implemented. This file is imported from the
existing blktap2 implementation, with most changes coming from blktap2 living
in github.

diff --git a/tools/blktap2/control/tap-ctl-ipc.c b/tools/blktap3/control/tap-ctl-ipc.c
copy from tools/blktap2/control/tap-ctl-ipc.c
copy to tools/blktap3/control/tap-ctl-ipc.c
--- a/tools/blktap2/control/tap-ctl-ipc.c
+++ b/tools/blktap3/control/tap-ctl-ipc.c
@@ -30,44 +30,33 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
+#include <fcntl.h>
 #include <sys/un.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 
 #include "tap-ctl.h"
-#include "blktap2.h"
+#include "blktap3.h"
 
 int tap_ctl_debug = 0;
 
 int
-tap_ctl_read_message(int fd, tapdisk_message_t *message, int timeout)
+tap_ctl_read_raw(int fd, void *buf, size_t size, struct timeval *timeout)
 {
 	fd_set readfds;
-	int ret, len, offset;
-	struct timeval tv, *t;
+	size_t offset = 0;
+	int ret;
 
-	t      = NULL;
-	offset = 0;
-	len    = sizeof(tapdisk_message_t);
-
-	if (timeout) {
-		tv.tv_sec  = timeout;
-		tv.tv_usec = 0;
-		t = &tv;
-	}
-
-	memset(message, 0, sizeof(tapdisk_message_t));
-
-	while (offset < len) {
+	while (offset < size) {
 		FD_ZERO(&readfds);
 		FD_SET(fd, &readfds);
 
-		ret = select(fd + 1, &readfds, NULL, NULL, t);
+		ret = select(fd + 1, &readfds, NULL, NULL, timeout);
 		if (ret == -1)
 			break;
 		else if (FD_ISSET(fd, &readfds)) {
-			ret = read(fd, message + offset, len - offset);
+			ret = read(fd, buf + offset, size - offset);
 			if (ret <= 0)
 				break;
 			offset += ret;
@@ -75,34 +64,24 @@ tap_ctl_read_message(int fd, tapdisk_mes
 			break;
 	}
 
-	if (offset != len) {
-		EPRINTF("failure reading message\n");
+	if (offset != size) {
+		EPRINTF("failure reading data %zd/%zd\n", offset, size);
 		return -EIO;
 	}
 
-	DBG("received '%s' message (uuid = %u)\n",
-	    tapdisk_message_name(message->type), message->cookie);
-
 	return 0;
 }
 
 int
-tap_ctl_write_message(int fd, tapdisk_message_t *message, int timeout)
+tap_ctl_write_message(int fd, tapdisk_message_t * message,
+					  struct timeval *timeout)
 {
 	fd_set writefds;
 	int ret, len, offset;
-	struct timeval tv, *t;
 
-	t      = NULL;
 	offset = 0;
 	len    = sizeof(tapdisk_message_t);
 
-	if (timeout) {
-		tv.tv_sec  = timeout;
-		tv.tv_usec = 0;
-		t = &tv;
-	}
-
 	DBG("sending '%s' message (uuid = %u)\n",
 	    tapdisk_message_name(message->type), message->cookie);
 
@@ -113,7 +92,7 @@ tap_ctl_write_message(int fd, tapdisk_me
 		/* we don't bother reinitializing tv. at worst, it will wait a
 		 * bit more time than expected. */
 
-		ret = select(fd + 1, NULL, &writefds, NULL, t);
+		ret = select(fd + 1, NULL, &writefds, NULL, timeout);
 		if (ret == -1)
 			break;
 		else if (FD_ISSET(fd, &writefds)) {
@@ -134,7 +113,8 @@ tap_ctl_write_message(int fd, tapdisk_me
 }
 
 int
-tap_ctl_send_and_receive(int sfd, tapdisk_message_t *message, int timeout)
+tap_ctl_send_and_receive(int sfd, tapdisk_message_t * message,
+						 struct timeval *timeout)
 {
 	int err;
 
@@ -161,7 +141,7 @@ tap_ctl_socket_name(int id)
 	char *name;
 
 	if (asprintf(&name, "%s/%s%d",
-		     BLKTAP2_CONTROL_DIR, BLKTAP2_CONTROL_SOCKET, id) == -1)
+				 BLKTAP3_CONTROL_DIR, BLKTAP3_CONTROL_SOCKET, id) == -1)
 		return NULL;
 
 	return name;
@@ -216,13 +196,15 @@ tap_ctl_connect_id(int id, int *sfd)
 	}
 
 	err = tap_ctl_connect(name, sfd);
+
 	free(name);
 
 	return err;
 }
 
 int
-tap_ctl_connect_send_and_receive(int id, tapdisk_message_t *message, int timeout)
+tap_ctl_connect_send_and_receive(int id, tapdisk_message_t * message,
+								 struct timeval *timeout)
 {
 	int err, sfd;
 
@@ -235,3 +217,20 @@ tap_ctl_connect_send_and_receive(int id,
 	close(sfd);
 	return err;
 }
+
+int
+tap_ctl_read_message(int fd, tapdisk_message_t * message,
+					 struct timeval *timeout)
+{
+	size_t size = sizeof(tapdisk_message_t);
+	int err;
+
+	err = tap_ctl_read_raw(fd, message, size, timeout);
+	if (err)
+		return err;
+
+	DBG("received '%s' message (uuid = %u)\n",
+		tapdisk_message_name(message->type), message->cookie);
+
+	return 0;
+}

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQde-0005iO-Rx; Fri, 16 Nov 2012 18:27:38 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdc-0005hI-Tw
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:37 +0000
Received: from [193.109.254.147:45806] by server-4.bemta-14.messagelabs.com id
	79/08-18856-89586A05; Fri, 16 Nov 2012 18:27:36 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353090455!8550695!4
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22421 invoked from network); 16 Nov 2012 18:27:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857983"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:05 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:05 +0000
MIME-Version: 1.0
X-Mercurial-Node: 2fa4f91d991b7a4ce9021e6258fbc5663f5944f9
Message-ID: <2fa4f91d991b7a4ce902.1353090345@makatos-desktop>
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:45 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 5 of 9 RFC] blktap3: Introduce functions used by
 xenio to instruct the tapdisk to connect to the shared ring
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch introduces functions tap_ctl_connect_xenblkif and
tap_ctl_disconnect_xenblkif, that are used by the xenio daemon to instruct a
tapdisk to connect/disconnect to/from the shared ring.

diff --git a/tools/blktap3/control/tap-ctl-xen.c b/tools/blktap3/control/tap-ctl-xen.c
new file mode 100644
--- /dev/null
+++ b/tools/blktap3/control/tap-ctl-xen.c
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include "tap-ctl.h"
+#include "tap-ctl-xen.h"
+
+int tap_ctl_connect_xenblkif(pid_t pid, int minor, domid_t domid,
+        int devid, const grant_ref_t * grefs, int order,
+        const evtchn_port_t port, int proto, const char *pool)
+{
+    tapdisk_message_t message;
+    int i, err;
+
+    memset(&message, 0, sizeof(message));
+    message.type = TAPDISK_MESSAGE_XENBLKIF_CONNECT;
+    message.cookie = minor;
+
+    message.u.blkif.domid = domid;
+    message.u.blkif.devid = devid;
+    for (i = 0; i < 1 << order; i++)
+        message.u.blkif.gref[i] = grefs[i];
+    message.u.blkif.order = order;
+    message.u.blkif.port = port;
+    message.u.blkif.proto = proto;
+    if (pool)
+        strncpy(message.u.blkif.pool, pool, sizeof(message.u.blkif.pool));
+    else
+        message.u.blkif.pool[0] = 0;
+
+    err = tap_ctl_connect_send_and_receive(pid, &message, NULL);
+    if (err)
+        return err;
+
+    if (message.type == TAPDISK_MESSAGE_XENBLKIF_CONNECT_RSP)
+        err = -message.u.response.error;
+    else
+        err = -EINVAL;
+
+    return err;
+}
+
+int tap_ctl_disconnect_xenblkif(pid_t pid, int minor, domid_t domid,
+        int devid, struct timeval *timeout)
+{
+    tapdisk_message_t message;
+    int err;
+
+    memset(&message, 0, sizeof(message));
+    message.type = TAPDISK_MESSAGE_XENBLKIF_DISCONNECT;
+    message.cookie = minor;
+    message.u.blkif.domid = domid;
+    message.u.blkif.devid = devid;
+
+    err = tap_ctl_connect_send_and_receive(pid, &message, timeout);
+    if (message.type == TAPDISK_MESSAGE_XENBLKIF_CONNECT_RSP)
+        err = -message.u.response.error;
+    else
+        err = -EINVAL;
+
+    return err;
+}
diff --git a/tools/blktap3/control/tap-ctl-xen.h b/tools/blktap3/control/tap-ctl-xen.h
new file mode 100644
--- /dev/null
+++ b/tools/blktap3/control/tap-ctl-xen.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ */
+
+#ifndef __TAP_CTL_XEN_H__
+#define __TAP_CTL_XEN_H__
+
+#include <xen/xen.h>
+#include <xen/grant_table.h>
+#include <xen/event_channel.h>
+
+/**
+ * Instructs a tapdisk to connect to the shared ring.
+ *
+ * TODO further explain parameters
+ *
+ * @param pid the process ID of the tapdisk that should connect to the shared
+ * ring
+ * @param minor the minor number of the virtual block device
+ * @param domid the domain ID of the guest VM
+ * @param devid the device ID
+ * @param grefs the grant references
+ * @param order number of grant references, expressed as a 2's order
+ * @param port event channel port
+ * @param proto the protocol: native (XENIO_BLKIF_PROTO_NATIVE),
+ * x86 (XENIO_BLKIF_PROTO_X86_32), or x64 (XENIO_BLKIF_PROTO_X86_64)
+ * @param pool TODO page pool?
+ * @returns 0 on success, an error code otherwise
+ */
+int tap_ctl_connect_xenblkif(pid_t pid, int minor, domid_t domid, int devid,
+        const grant_ref_t * grefs, int order, evtchn_port_t port, int proto,
+        const char *pool);
+
+/**
+ * Instructs a tapdisk to disconnect from the shared ring.
+ *
+ * @param pid the process ID of the tapdisk that should disconnect
+ * @param minor the minor number of the virtual block device
+ * @param domid the ID of the guest VM
+ * @param devid the device ID of the virtual block device
+ * @param timeout timeout to wait, if NULL the function will wait indefinitely
+ */
+int tap_ctl_disconnect_xenblkif(pid_t pid, int minor, domid_t domid,
+        int devid, struct timeval *timeout);
+
+#endif /* __TAP_CTL_XEN_H__ */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQde-0005iO-Rx; Fri, 16 Nov 2012 18:27:38 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdc-0005hI-Tw
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:37 +0000
Received: from [193.109.254.147:45806] by server-4.bemta-14.messagelabs.com id
	79/08-18856-89586A05; Fri, 16 Nov 2012 18:27:36 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353090455!8550695!4
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22421 invoked from network); 16 Nov 2012 18:27:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857983"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:05 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:05 +0000
MIME-Version: 1.0
X-Mercurial-Node: 2fa4f91d991b7a4ce9021e6258fbc5663f5944f9
Message-ID: <2fa4f91d991b7a4ce902.1353090345@makatos-desktop>
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:45 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 5 of 9 RFC] blktap3: Introduce functions used by
 xenio to instruct the tapdisk to connect to the shared ring
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch introduces functions tap_ctl_connect_xenblkif and
tap_ctl_disconnect_xenblkif, that are used by the xenio daemon to instruct a
tapdisk to connect/disconnect to/from the shared ring.

diff --git a/tools/blktap3/control/tap-ctl-xen.c b/tools/blktap3/control/tap-ctl-xen.c
new file mode 100644
--- /dev/null
+++ b/tools/blktap3/control/tap-ctl-xen.c
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include "tap-ctl.h"
+#include "tap-ctl-xen.h"
+
+int tap_ctl_connect_xenblkif(pid_t pid, int minor, domid_t domid,
+        int devid, const grant_ref_t * grefs, int order,
+        const evtchn_port_t port, int proto, const char *pool)
+{
+    tapdisk_message_t message;
+    int i, err;
+
+    memset(&message, 0, sizeof(message));
+    message.type = TAPDISK_MESSAGE_XENBLKIF_CONNECT;
+    message.cookie = minor;
+
+    message.u.blkif.domid = domid;
+    message.u.blkif.devid = devid;
+    for (i = 0; i < 1 << order; i++)
+        message.u.blkif.gref[i] = grefs[i];
+    message.u.blkif.order = order;
+    message.u.blkif.port = port;
+    message.u.blkif.proto = proto;
+    if (pool)
+        strncpy(message.u.blkif.pool, pool, sizeof(message.u.blkif.pool));
+    else
+        message.u.blkif.pool[0] = 0;
+
+    err = tap_ctl_connect_send_and_receive(pid, &message, NULL);
+    if (err)
+        return err;
+
+    if (message.type == TAPDISK_MESSAGE_XENBLKIF_CONNECT_RSP)
+        err = -message.u.response.error;
+    else
+        err = -EINVAL;
+
+    return err;
+}
+
+int tap_ctl_disconnect_xenblkif(pid_t pid, int minor, domid_t domid,
+        int devid, struct timeval *timeout)
+{
+    tapdisk_message_t message;
+    int err;
+
+    memset(&message, 0, sizeof(message));
+    message.type = TAPDISK_MESSAGE_XENBLKIF_DISCONNECT;
+    message.cookie = minor;
+    message.u.blkif.domid = domid;
+    message.u.blkif.devid = devid;
+
+    err = tap_ctl_connect_send_and_receive(pid, &message, timeout);
+    if (message.type == TAPDISK_MESSAGE_XENBLKIF_CONNECT_RSP)
+        err = -message.u.response.error;
+    else
+        err = -EINVAL;
+
+    return err;
+}
diff --git a/tools/blktap3/control/tap-ctl-xen.h b/tools/blktap3/control/tap-ctl-xen.h
new file mode 100644
--- /dev/null
+++ b/tools/blktap3/control/tap-ctl-xen.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ */
+
+#ifndef __TAP_CTL_XEN_H__
+#define __TAP_CTL_XEN_H__
+
+#include <xen/xen.h>
+#include <xen/grant_table.h>
+#include <xen/event_channel.h>
+
+/**
+ * Instructs a tapdisk to connect to the shared ring.
+ *
+ * TODO further explain parameters
+ *
+ * @param pid the process ID of the tapdisk that should connect to the shared
+ * ring
+ * @param minor the minor number of the virtual block device
+ * @param domid the domain ID of the guest VM
+ * @param devid the device ID
+ * @param grefs the grant references
+ * @param order number of grant references, expressed as a 2's order
+ * @param port event channel port
+ * @param proto the protocol: native (XENIO_BLKIF_PROTO_NATIVE),
+ * x86 (XENIO_BLKIF_PROTO_X86_32), or x64 (XENIO_BLKIF_PROTO_X86_64)
+ * @param pool TODO page pool?
+ * @returns 0 on success, an error code otherwise
+ */
+int tap_ctl_connect_xenblkif(pid_t pid, int minor, domid_t domid, int devid,
+        const grant_ref_t * grefs, int order, evtchn_port_t port, int proto,
+        const char *pool);
+
+/**
+ * Instructs a tapdisk to disconnect from the shared ring.
+ *
+ * @param pid the process ID of the tapdisk that should disconnect
+ * @param minor the minor number of the virtual block device
+ * @param domid the ID of the guest VM
+ * @param devid the device ID of the virtual block device
+ * @param timeout timeout to wait, if NULL the function will wait indefinitely
+ */
+int tap_ctl_disconnect_xenblkif(pid_t pid, int minor, domid_t domid,
+        int devid, struct timeval *timeout);
+
+#endif /* __TAP_CTL_XEN_H__ */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQdi-0005lA-Pw; Fri, 16 Nov 2012 18:27:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TZQde-0005iE-SG
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:27:38 +0000
Received: from [85.158.143.99:16635] by server-2.bemta-4.messagelabs.com id
	A0/91-28922-A9586A05; Fri, 16 Nov 2012 18:27:38 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1353090457!27579960!2
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4531 invoked from network); 16 Nov 2012 18:27:37 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:37 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857991"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:12 +0000
Received: from mac.citrite.net (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:11 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>, <linux-kernel@vger.kernel.org>,
	<konrad.wilk@oracle.com>
Date: Fri, 16 Nov 2012 19:26:47 +0100
Message-ID: <1353090408-66400-1-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH 1/2] xen-blkfront: free allocated page
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

RnJlZSB0aGUgcGFnZSBhbGxvY2F0ZWQgZm9yIHRoZSBwZXJzaXN0ZW50IGdyYW50LgoKU2lnbmVk
LW9mZi1ieTogUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+Ci0tLQogZHJp
dmVycy9ibG9jay94ZW4tYmxrZnJvbnQuYyB8ICAgIDEgKwogMSBmaWxlcyBjaGFuZ2VkLCAxIGlu
c2VydGlvbnMoKyksIDAgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvZHJpdmVycy9ibG9jay94
ZW4tYmxrZnJvbnQuYyBiL2RyaXZlcnMvYmxvY2sveGVuLWJsa2Zyb250LmMKaW5kZXggZjFkZTgw
Ni4uOTZlOWIwMCAxMDA2NDQKLS0tIGEvZHJpdmVycy9ibG9jay94ZW4tYmxrZnJvbnQuYworKysg
Yi9kcml2ZXJzL2Jsb2NrL3hlbi1ibGtmcm9udC5jCkBAIC04MDYsNiArODA2LDcgQEAgc3RhdGlj
IHZvaWQgYmxraWZfZnJlZShzdHJ1Y3QgYmxrZnJvbnRfaW5mbyAqaW5mbywgaW50IHN1c3BlbmQp
CiAJCWFsbF9nbnRzID0gbGxpc3RfZGVsX2FsbCgmaW5mby0+cGVyc2lzdGVudF9nbnRzKTsKIAkJ
bGxpc3RfZm9yX2VhY2hfZW50cnkocGVyc2lzdGVudF9nbnQsIGFsbF9nbnRzLCBub2RlKSB7CiAJ
CQlnbnR0YWJfZW5kX2ZvcmVpZ25fYWNjZXNzKHBlcnNpc3RlbnRfZ250LT5ncmVmLCAwLCAwVUwp
OworCQkJX19mcmVlX3BhZ2UocGZuX3RvX3BhZ2UocGVyc2lzdGVudF9nbnQtPnBmbikpOwogCQkJ
a2ZyZWUocGVyc2lzdGVudF9nbnQpOwogCQl9CiAJCWluZm8tPnBlcnNpc3RlbnRfZ250c19jID0g
MDsKLS0gCjEuNy43LjUgKEFwcGxlIEdpdC0yNikKCgpfX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBs
aXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQdi-0005lA-Pw; Fri, 16 Nov 2012 18:27:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TZQde-0005iE-SG
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:27:38 +0000
Received: from [85.158.143.99:16635] by server-2.bemta-4.messagelabs.com id
	A0/91-28922-A9586A05; Fri, 16 Nov 2012 18:27:38 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1353090457!27579960!2
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4531 invoked from network); 16 Nov 2012 18:27:37 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:37 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857991"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:12 +0000
Received: from mac.citrite.net (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:11 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>, <linux-kernel@vger.kernel.org>,
	<konrad.wilk@oracle.com>
Date: Fri, 16 Nov 2012 19:26:47 +0100
Message-ID: <1353090408-66400-1-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH 1/2] xen-blkfront: free allocated page
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

RnJlZSB0aGUgcGFnZSBhbGxvY2F0ZWQgZm9yIHRoZSBwZXJzaXN0ZW50IGdyYW50LgoKU2lnbmVk
LW9mZi1ieTogUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+Ci0tLQogZHJp
dmVycy9ibG9jay94ZW4tYmxrZnJvbnQuYyB8ICAgIDEgKwogMSBmaWxlcyBjaGFuZ2VkLCAxIGlu
c2VydGlvbnMoKyksIDAgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvZHJpdmVycy9ibG9jay94
ZW4tYmxrZnJvbnQuYyBiL2RyaXZlcnMvYmxvY2sveGVuLWJsa2Zyb250LmMKaW5kZXggZjFkZTgw
Ni4uOTZlOWIwMCAxMDA2NDQKLS0tIGEvZHJpdmVycy9ibG9jay94ZW4tYmxrZnJvbnQuYworKysg
Yi9kcml2ZXJzL2Jsb2NrL3hlbi1ibGtmcm9udC5jCkBAIC04MDYsNiArODA2LDcgQEAgc3RhdGlj
IHZvaWQgYmxraWZfZnJlZShzdHJ1Y3QgYmxrZnJvbnRfaW5mbyAqaW5mbywgaW50IHN1c3BlbmQp
CiAJCWFsbF9nbnRzID0gbGxpc3RfZGVsX2FsbCgmaW5mby0+cGVyc2lzdGVudF9nbnRzKTsKIAkJ
bGxpc3RfZm9yX2VhY2hfZW50cnkocGVyc2lzdGVudF9nbnQsIGFsbF9nbnRzLCBub2RlKSB7CiAJ
CQlnbnR0YWJfZW5kX2ZvcmVpZ25fYWNjZXNzKHBlcnNpc3RlbnRfZ250LT5ncmVmLCAwLCAwVUwp
OworCQkJX19mcmVlX3BhZ2UocGZuX3RvX3BhZ2UocGVyc2lzdGVudF9nbnQtPnBmbikpOwogCQkJ
a2ZyZWUocGVyc2lzdGVudF9nbnQpOwogCQl9CiAJCWluZm8tPnBlcnNpc3RlbnRfZ250c19jID0g
MDsKLS0gCjEuNy43LjUgKEFwcGxlIEdpdC0yNikKCgpfX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBs
aXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQdf-0005iq-Mb; Fri, 16 Nov 2012 18:27:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdd-0005hL-7g
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:37 +0000
Received: from [193.109.254.147:36660] by server-13.bemta-14.messagelabs.com
	id E6/70-11239-89586A05; Fri, 16 Nov 2012 18:27:36 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353090455!8550695!6
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22452 invoked from network); 16 Nov 2012 18:27:36 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:36 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857981"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:05 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:04 +0000
MIME-Version: 1.0
X-Mercurial-Node: 6f4dc408c963c2ef0183be7eaf032c898db5b635
Message-ID: <6f4dc408c963c2ef0183.1353090343@makatos-desktop>
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:43 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 3 of 9 RFC] blktap3: Introduce the tapdisk
	control header
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch introduces the header file where tapdisk control-related structures
and functions are declared. This file is based on the existing blktap2, with
most changes coming from blktap2 living in github. Linux lists are replaced by
BSD tail queues. Few functions are partly documented, most of them are not
documented at all, this will be addressed by a future patch.

diff --git a/tools/blktap2/control/tap-ctl.h b/tools/blktap3/control/tap-ctl.h
copy from tools/blktap2/control/tap-ctl.h
copy to tools/blktap3/control/tap-ctl.h
--- a/tools/blktap2/control/tap-ctl.h
+++ b/tools/blktap3/control/tap-ctl.h
@@ -30,72 +30,180 @@
 
 #include <syslog.h>
 #include <errno.h>
+#include <sys/time.h>
 #include <tapdisk-message.h>
+#include "blktap3.h"
 
+/*
+ * TODO These are private, move to an internal header.
+ */
 extern int tap_ctl_debug;
 
 #ifdef TAPCTL
-#define DBG(_f, _a...)				\
-	do {					\
+#define DBG(_f, _a...)			\
+	do {						\
 		if (tap_ctl_debug)		\
 			printf(_f, ##_a);	\
 	} while (0)
 
 #define DPRINTF(_f, _a...) syslog(LOG_INFO, _f, ##_a)
 #define EPRINTF(_f, _a...) syslog(LOG_ERR, "tap-err:%s: " _f, __func__, ##_a)
-#define  PERROR(_f, _a...) syslog(LOG_ERR, "tap-err:%s: " _f ": %s", __func__, ##_a, \
-				  strerror(errno))
+#define PERROR(_f, _a...) syslog(LOG_ERR, "tap-err:%s: " _f ": %s", \
+        __func__, ##_a, strerror(errno))
 #endif
 
-void tap_ctl_version(int *major, int *minor);
-int tap_ctl_kernel_version(int *major, int *minor);
+/**
+ * Contains information about a tapdisk process.
+ */
+typedef struct tap_list {
 
-int tap_ctl_check_blktap(const char **message);
-int tap_ctl_check_version(const char **message);
-int tap_ctl_check(const char **message);
+    /**
+     * The process ID.
+     */
+    pid_t pid;
 
+    /**
+     * TODO
+     */
+    int minor;
+
+    /**
+     * State of the VBD, specified in drivers/tapdisk-vbd.h.
+     */
+    int state;
+
+    /**
+     * TODO
+     */
+    char *type;
+
+    /**
+     * /path/to/file
+     */
+    char *path;
+
+    /**
+     * for linked lists
+     */
+    TAILQ_ENTRY(tap_list) entry;
+} tap_list_t;
+
+TAILQ_HEAD(tqh_tap_list, tap_list);
+
+/**
+ * Iterate over a list of struct tap_list elements.
+ */
+#define tap_list_for_each_entry(_pos, _head) \
+    TAILQ_FOREACH(_pos, _head, entry)
+
+/**
+ * Iterate over a list of struct tap_list elements allowing deletions without
+ * having to restart the iteration.
+ */
+#define tap_list_for_each_entry_safe(_pos, _n, _head) \
+    TAILQ_FOREACH_SAFE(_pos, _head, entry, _n)
+
+/**
+ * Connects to a tapdisk.
+ *
+ * @param /path/to/file of the control socket (e.g. 
+ * /var/run/blktap-control/ctl/<pid>
+ * @param socket output parameter that receives the connection
+ * @returns 0 on success, an error code otherwise
+ */
 int tap_ctl_connect(const char *path, int *socket);
-int tap_ctl_connect_id(int id, int *socket);
-int tap_ctl_read_message(int fd, tapdisk_message_t *message, int timeout);
-int tap_ctl_write_message(int fd, tapdisk_message_t *message, int timeout);
-int tap_ctl_send_and_receive(int fd, tapdisk_message_t *message, int timeout);
-int tap_ctl_connect_send_and_receive(int id,
-				     tapdisk_message_t *message, int timeout);
+
+/**
+ * Connects to a tapdisk.
+ *
+ * @param id the process ID of the tapdisk to connect to
+ * @param socket output parameter that receives the connection
+ * @returns 0 on success, an error code otherwise
+ */
+int tap_ctl_connect_id(const int id, int *socket);
+
+/**
+ * Reads from the tapdisk connection to the buffer.
+ *
+ * @param fd the file descriptor of the socket to read from
+ * @param buf buffer that receives the output
+ * @param sz size, in bytes, of the buffer
+ * @param timeout (optional) specifies the maximum time to wait for reading
+ * @returns 0 on success, an error code otherwise
+ */
+int tap_ctl_read_raw(const int fd, void *buf, const size_t sz,
+        struct timeval *timeout);
+
+int tap_ctl_read_message(int fd, tapdisk_message_t * message,
+        struct timeval *timeout);
+
+int tap_ctl_write_message(int fd, tapdisk_message_t * message,
+        struct timeval *timeout);
+
+int tap_ctl_send_and_receive(int fd, tapdisk_message_t * message,
+        struct timeval *timeout);
+
+int tap_ctl_connect_send_and_receive(int id, tapdisk_message_t * message,
+        struct timeval *timeout);
+
 char *tap_ctl_socket_name(int id);
 
-typedef struct {
-	int         id;
-	pid_t       pid;
-	int         minor;
-	int         state;
-	char       *type;
-	char       *path;
-} tap_list_t;
+int tap_ctl_list_pid(pid_t pid, struct tqh_tap_list *list);
 
-int tap_ctl_get_driver_id(const char *handle);
+/**
+ * Retrieves a list of all tapdisks.
+ *
+ * @param list output parameter that receives the list of tapdisks
+ * @returns 0 on success, an error code otherwise
+ */
+int tap_ctl_list(struct tqh_tap_list *list);
 
-int tap_ctl_list(tap_list_t ***list);
-void tap_ctl_free_list(tap_list_t **list);
-int tap_ctl_find(const char *type, const char *path, tap_list_t *tap);
+/**
+ * Deallocates a list of struct tap_list.
+ *
+ * @param list the tapdisk information structure to deallocate.
+ */
+void tap_ctl_list_free(struct tqh_tap_list *list);
 
-int tap_ctl_allocate(int *minor, char **devname);
-int tap_ctl_free(const int minor);
+/**
+ * Creates a tapdisk process.
+ *
+ * TODO document parameters
+ * @param params
+ * @param flags
+ * @param prt_minor
+ * @param secondary
+ * @returns 0 on success, en error code otherwise
+ */
+int tap_ctl_create(const char *params, int flags, int prt_minor,
+        char *secondary);
 
-int tap_ctl_create(const char *params, char **devname);
-int tap_ctl_destroy(const int id, const int minor);
+int tap_ctl_destroy(const int id, const int minor, int force,
+        struct timeval *timeout);
 
+/*
+ * TODO The following functions are not currently used by anything else
+ * other than the tapdisk itself. Move to a private header?
+ */
 int tap_ctl_spawn(void);
 pid_t tap_ctl_get_pid(const int id);
 
 int tap_ctl_attach(const int id, const int minor);
 int tap_ctl_detach(const int id, const int minor);
 
-int tap_ctl_open(const int id, const int minor, const char *params);
-int tap_ctl_close(const int id, const int minor, const int force);
+int tap_ctl_open(const int id, const int minor, const char *params,
+        int flags, const int prt_minor, const char *secondary);
 
-int tap_ctl_pause(const int id, const int minor);
+int tap_ctl_close(const int id, const int minor, const int force,
+        struct timeval *timeout);
+
+int tap_ctl_pause(const int id, const int minor, struct timeval 
+        *timeout);
+
 int tap_ctl_unpause(const int id, const int minor, const char *params);
 
-int tap_ctl_blk_major(void);
+ssize_t tap_ctl_stats(pid_t pid, int minor, char *buf, size_t size); 
 
-#endif
+int tap_ctl_stats_fwrite(pid_t pid, int minor, FILE * out);
+
+#endif /* __TAP_CTL_H__ */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQdf-0005iq-Mb; Fri, 16 Nov 2012 18:27:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdd-0005hL-7g
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:37 +0000
Received: from [193.109.254.147:36660] by server-13.bemta-14.messagelabs.com
	id E6/70-11239-89586A05; Fri, 16 Nov 2012 18:27:36 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353090455!8550695!6
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22452 invoked from network); 16 Nov 2012 18:27:36 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:36 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857981"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:05 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:04 +0000
MIME-Version: 1.0
X-Mercurial-Node: 6f4dc408c963c2ef0183be7eaf032c898db5b635
Message-ID: <6f4dc408c963c2ef0183.1353090343@makatos-desktop>
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:43 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 3 of 9 RFC] blktap3: Introduce the tapdisk
	control header
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch introduces the header file where tapdisk control-related structures
and functions are declared. This file is based on the existing blktap2, with
most changes coming from blktap2 living in github. Linux lists are replaced by
BSD tail queues. Few functions are partly documented, most of them are not
documented at all, this will be addressed by a future patch.

diff --git a/tools/blktap2/control/tap-ctl.h b/tools/blktap3/control/tap-ctl.h
copy from tools/blktap2/control/tap-ctl.h
copy to tools/blktap3/control/tap-ctl.h
--- a/tools/blktap2/control/tap-ctl.h
+++ b/tools/blktap3/control/tap-ctl.h
@@ -30,72 +30,180 @@
 
 #include <syslog.h>
 #include <errno.h>
+#include <sys/time.h>
 #include <tapdisk-message.h>
+#include "blktap3.h"
 
+/*
+ * TODO These are private, move to an internal header.
+ */
 extern int tap_ctl_debug;
 
 #ifdef TAPCTL
-#define DBG(_f, _a...)				\
-	do {					\
+#define DBG(_f, _a...)			\
+	do {						\
 		if (tap_ctl_debug)		\
 			printf(_f, ##_a);	\
 	} while (0)
 
 #define DPRINTF(_f, _a...) syslog(LOG_INFO, _f, ##_a)
 #define EPRINTF(_f, _a...) syslog(LOG_ERR, "tap-err:%s: " _f, __func__, ##_a)
-#define  PERROR(_f, _a...) syslog(LOG_ERR, "tap-err:%s: " _f ": %s", __func__, ##_a, \
-				  strerror(errno))
+#define PERROR(_f, _a...) syslog(LOG_ERR, "tap-err:%s: " _f ": %s", \
+        __func__, ##_a, strerror(errno))
 #endif
 
-void tap_ctl_version(int *major, int *minor);
-int tap_ctl_kernel_version(int *major, int *minor);
+/**
+ * Contains information about a tapdisk process.
+ */
+typedef struct tap_list {
 
-int tap_ctl_check_blktap(const char **message);
-int tap_ctl_check_version(const char **message);
-int tap_ctl_check(const char **message);
+    /**
+     * The process ID.
+     */
+    pid_t pid;
 
+    /**
+     * TODO
+     */
+    int minor;
+
+    /**
+     * State of the VBD, specified in drivers/tapdisk-vbd.h.
+     */
+    int state;
+
+    /**
+     * TODO
+     */
+    char *type;
+
+    /**
+     * /path/to/file
+     */
+    char *path;
+
+    /**
+     * for linked lists
+     */
+    TAILQ_ENTRY(tap_list) entry;
+} tap_list_t;
+
+TAILQ_HEAD(tqh_tap_list, tap_list);
+
+/**
+ * Iterate over a list of struct tap_list elements.
+ */
+#define tap_list_for_each_entry(_pos, _head) \
+    TAILQ_FOREACH(_pos, _head, entry)
+
+/**
+ * Iterate over a list of struct tap_list elements allowing deletions without
+ * having to restart the iteration.
+ */
+#define tap_list_for_each_entry_safe(_pos, _n, _head) \
+    TAILQ_FOREACH_SAFE(_pos, _head, entry, _n)
+
+/**
+ * Connects to a tapdisk.
+ *
+ * @param /path/to/file of the control socket (e.g. 
+ * /var/run/blktap-control/ctl/<pid>
+ * @param socket output parameter that receives the connection
+ * @returns 0 on success, an error code otherwise
+ */
 int tap_ctl_connect(const char *path, int *socket);
-int tap_ctl_connect_id(int id, int *socket);
-int tap_ctl_read_message(int fd, tapdisk_message_t *message, int timeout);
-int tap_ctl_write_message(int fd, tapdisk_message_t *message, int timeout);
-int tap_ctl_send_and_receive(int fd, tapdisk_message_t *message, int timeout);
-int tap_ctl_connect_send_and_receive(int id,
-				     tapdisk_message_t *message, int timeout);
+
+/**
+ * Connects to a tapdisk.
+ *
+ * @param id the process ID of the tapdisk to connect to
+ * @param socket output parameter that receives the connection
+ * @returns 0 on success, an error code otherwise
+ */
+int tap_ctl_connect_id(const int id, int *socket);
+
+/**
+ * Reads from the tapdisk connection to the buffer.
+ *
+ * @param fd the file descriptor of the socket to read from
+ * @param buf buffer that receives the output
+ * @param sz size, in bytes, of the buffer
+ * @param timeout (optional) specifies the maximum time to wait for reading
+ * @returns 0 on success, an error code otherwise
+ */
+int tap_ctl_read_raw(const int fd, void *buf, const size_t sz,
+        struct timeval *timeout);
+
+int tap_ctl_read_message(int fd, tapdisk_message_t * message,
+        struct timeval *timeout);
+
+int tap_ctl_write_message(int fd, tapdisk_message_t * message,
+        struct timeval *timeout);
+
+int tap_ctl_send_and_receive(int fd, tapdisk_message_t * message,
+        struct timeval *timeout);
+
+int tap_ctl_connect_send_and_receive(int id, tapdisk_message_t * message,
+        struct timeval *timeout);
+
 char *tap_ctl_socket_name(int id);
 
-typedef struct {
-	int         id;
-	pid_t       pid;
-	int         minor;
-	int         state;
-	char       *type;
-	char       *path;
-} tap_list_t;
+int tap_ctl_list_pid(pid_t pid, struct tqh_tap_list *list);
 
-int tap_ctl_get_driver_id(const char *handle);
+/**
+ * Retrieves a list of all tapdisks.
+ *
+ * @param list output parameter that receives the list of tapdisks
+ * @returns 0 on success, an error code otherwise
+ */
+int tap_ctl_list(struct tqh_tap_list *list);
 
-int tap_ctl_list(tap_list_t ***list);
-void tap_ctl_free_list(tap_list_t **list);
-int tap_ctl_find(const char *type, const char *path, tap_list_t *tap);
+/**
+ * Deallocates a list of struct tap_list.
+ *
+ * @param list the tapdisk information structure to deallocate.
+ */
+void tap_ctl_list_free(struct tqh_tap_list *list);
 
-int tap_ctl_allocate(int *minor, char **devname);
-int tap_ctl_free(const int minor);
+/**
+ * Creates a tapdisk process.
+ *
+ * TODO document parameters
+ * @param params
+ * @param flags
+ * @param prt_minor
+ * @param secondary
+ * @returns 0 on success, en error code otherwise
+ */
+int tap_ctl_create(const char *params, int flags, int prt_minor,
+        char *secondary);
 
-int tap_ctl_create(const char *params, char **devname);
-int tap_ctl_destroy(const int id, const int minor);
+int tap_ctl_destroy(const int id, const int minor, int force,
+        struct timeval *timeout);
 
+/*
+ * TODO The following functions are not currently used by anything else
+ * other than the tapdisk itself. Move to a private header?
+ */
 int tap_ctl_spawn(void);
 pid_t tap_ctl_get_pid(const int id);
 
 int tap_ctl_attach(const int id, const int minor);
 int tap_ctl_detach(const int id, const int minor);
 
-int tap_ctl_open(const int id, const int minor, const char *params);
-int tap_ctl_close(const int id, const int minor, const int force);
+int tap_ctl_open(const int id, const int minor, const char *params,
+        int flags, const int prt_minor, const char *secondary);
 
-int tap_ctl_pause(const int id, const int minor);
+int tap_ctl_close(const int id, const int minor, const int force,
+        struct timeval *timeout);
+
+int tap_ctl_pause(const int id, const int minor, struct timeval 
+        *timeout);
+
 int tap_ctl_unpause(const int id, const int minor, const char *params);
 
-int tap_ctl_blk_major(void);
+ssize_t tap_ctl_stats(pid_t pid, int minor, char *buf, size_t size); 
 
-#endif
+int tap_ctl_stats_fwrite(pid_t pid, int minor, FILE * out);
+
+#endif /* __TAP_CTL_H__ */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQdg-0005jW-Sr; Fri, 16 Nov 2012 18:27:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdd-0005hb-JA
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:37 +0000
Received: from [193.109.254.147:50981] by server-16.bemta-14.messagelabs.com
	id FF/D2-09215-89586A05; Fri, 16 Nov 2012 18:27:36 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353090455!8550695!8
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22477 invoked from network); 16 Nov 2012 18:27:36 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:36 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857986"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:06 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:05 +0000
MIME-Version: 1.0
X-Mercurial-Node: c336b6c55054bba016dfaaaf10dc5bbd99128cec
Message-ID: <c336b6c55054bba016df.1353090348@makatos-desktop>
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:48 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 8 of 9 RFC] blktap3: Introduce tapdisk spawn
	functionality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch imports file control/tap-ctl-spawn.c from the existing blktap2
implementation, with most changes coming from blktap2 living in github.
Function tap-ctl-spawn is used for spawning a new tapdisk process in order to
serve a new virtual block device.

diff --git a/tools/blktap2/control/tap-ctl-spawn.c b/tools/blktap3/control/tap-ctl-spawn.c
copy from tools/blktap2/control/tap-ctl-spawn.c
copy to tools/blktap3/control/tap-ctl-spawn.c
--- a/tools/blktap2/control/tap-ctl-spawn.c
+++ b/tools/blktap3/control/tap-ctl-spawn.c
@@ -31,15 +31,16 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
+#include <signal.h>
 #include <sys/wait.h>
 
 #include "tap-ctl.h"
-#include "blktap2.h"
+#include "blktap3.h"
 
 static pid_t
 __tap_ctl_spawn(int *readfd)
 {
-	int err, child, channel[2];
+	int child, channel[2];
 	char *tapdisk;
 
 	if (pipe(channel)) {
@@ -71,14 +72,21 @@ static pid_t
 	close(channel[0]);
 	close(channel[1]);
 
-	tapdisk = getenv("TAPDISK2");
+	tapdisk = getenv("TAPDISK");
 	if (!tapdisk)
-		tapdisk = "tapdisk2";
+		tapdisk = getenv("TAPDISK2");
 
-	execlp(tapdisk, tapdisk, NULL);
+	if (tapdisk) {
+		execlp(tapdisk, tapdisk, NULL);
+		exit(errno);
+	}
 
-	EPRINTF("exec failed\n");
-	exit(1);
+	execl(TAPDISK_EXECDIR "/" TAPDISK_EXEC, TAPDISK_EXEC, NULL);
+
+	if (errno == ENOENT)
+		execl(TAPDISK_BUILDDIR "/" TAPDISK_EXEC, TAPDISK_EXEC, NULL);
+
+	exit(errno);
 }
 
 pid_t
@@ -90,7 +98,7 @@ tap_ctl_get_pid(const int id)
 	memset(&message, 0, sizeof(message));
 	message.type = TAPDISK_MESSAGE_PID;
 
-	err = tap_ctl_connect_send_and_receive(id, &message, 2);
+	err = tap_ctl_connect_send_and_receive(id, &message, NULL);
 	if (err)
 		return err;
 
@@ -119,6 +127,12 @@ tap_ctl_wait(pid_t child)
 	if (WIFSIGNALED(status)) {
 		int signo = WTERMSIG(status);
 		EPRINTF("tapdisk2[%d] killed by signal %d\n", child, signo);
+		if (signo == SIGUSR1)
+			/* NB. there's a race between tapdisk's
+			 * sigaction init and xen-bugtool shooting
+			 * debug signals. If killed by something as
+			 * innocuous as USR1, then retry. */
+			return -EAGAIN;
 		return -EINTR;
 	}
 
@@ -139,8 +153,8 @@ tap_ctl_get_child_id(int readfd)
 	}
 
 	errno = 0;
-	if (fscanf(f, BLKTAP2_CONTROL_DIR"/"
-		   BLKTAP2_CONTROL_SOCKET"%d", &id) != 1) {
+	if (fscanf(f, BLKTAP3_CONTROL_DIR "/"
+			   BLKTAP3_CONTROL_SOCKET "%d", &id) != 1) {
 		errno = (errno ? : EINVAL);
 		EPRINTF("parsing id failed: %d\n", errno);
 		id = -1;
@@ -158,13 +172,17 @@ tap_ctl_spawn(void)
 
 	readfd = -1;
 
+  again:
 	child = __tap_ctl_spawn(&readfd);
 	if (child < 0)
 		return child;
 
 	err = tap_ctl_wait(child);
-	if (err)
+	if (err) {
+		if (err == -EAGAIN)
+			goto again;
 		return err;
+	}
 
 	id = tap_ctl_get_child_id(readfd);
 	if (id < 0)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQdg-0005jW-Sr; Fri, 16 Nov 2012 18:27:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdd-0005hb-JA
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:37 +0000
Received: from [193.109.254.147:50981] by server-16.bemta-14.messagelabs.com
	id FF/D2-09215-89586A05; Fri, 16 Nov 2012 18:27:36 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353090455!8550695!8
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22477 invoked from network); 16 Nov 2012 18:27:36 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:36 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857986"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:06 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:05 +0000
MIME-Version: 1.0
X-Mercurial-Node: c336b6c55054bba016dfaaaf10dc5bbd99128cec
Message-ID: <c336b6c55054bba016df.1353090348@makatos-desktop>
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:48 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 8 of 9 RFC] blktap3: Introduce tapdisk spawn
	functionality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch imports file control/tap-ctl-spawn.c from the existing blktap2
implementation, with most changes coming from blktap2 living in github.
Function tap-ctl-spawn is used for spawning a new tapdisk process in order to
serve a new virtual block device.

diff --git a/tools/blktap2/control/tap-ctl-spawn.c b/tools/blktap3/control/tap-ctl-spawn.c
copy from tools/blktap2/control/tap-ctl-spawn.c
copy to tools/blktap3/control/tap-ctl-spawn.c
--- a/tools/blktap2/control/tap-ctl-spawn.c
+++ b/tools/blktap3/control/tap-ctl-spawn.c
@@ -31,15 +31,16 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
+#include <signal.h>
 #include <sys/wait.h>
 
 #include "tap-ctl.h"
-#include "blktap2.h"
+#include "blktap3.h"
 
 static pid_t
 __tap_ctl_spawn(int *readfd)
 {
-	int err, child, channel[2];
+	int child, channel[2];
 	char *tapdisk;
 
 	if (pipe(channel)) {
@@ -71,14 +72,21 @@ static pid_t
 	close(channel[0]);
 	close(channel[1]);
 
-	tapdisk = getenv("TAPDISK2");
+	tapdisk = getenv("TAPDISK");
 	if (!tapdisk)
-		tapdisk = "tapdisk2";
+		tapdisk = getenv("TAPDISK2");
 
-	execlp(tapdisk, tapdisk, NULL);
+	if (tapdisk) {
+		execlp(tapdisk, tapdisk, NULL);
+		exit(errno);
+	}
 
-	EPRINTF("exec failed\n");
-	exit(1);
+	execl(TAPDISK_EXECDIR "/" TAPDISK_EXEC, TAPDISK_EXEC, NULL);
+
+	if (errno == ENOENT)
+		execl(TAPDISK_BUILDDIR "/" TAPDISK_EXEC, TAPDISK_EXEC, NULL);
+
+	exit(errno);
 }
 
 pid_t
@@ -90,7 +98,7 @@ tap_ctl_get_pid(const int id)
 	memset(&message, 0, sizeof(message));
 	message.type = TAPDISK_MESSAGE_PID;
 
-	err = tap_ctl_connect_send_and_receive(id, &message, 2);
+	err = tap_ctl_connect_send_and_receive(id, &message, NULL);
 	if (err)
 		return err;
 
@@ -119,6 +127,12 @@ tap_ctl_wait(pid_t child)
 	if (WIFSIGNALED(status)) {
 		int signo = WTERMSIG(status);
 		EPRINTF("tapdisk2[%d] killed by signal %d\n", child, signo);
+		if (signo == SIGUSR1)
+			/* NB. there's a race between tapdisk's
+			 * sigaction init and xen-bugtool shooting
+			 * debug signals. If killed by something as
+			 * innocuous as USR1, then retry. */
+			return -EAGAIN;
 		return -EINTR;
 	}
 
@@ -139,8 +153,8 @@ tap_ctl_get_child_id(int readfd)
 	}
 
 	errno = 0;
-	if (fscanf(f, BLKTAP2_CONTROL_DIR"/"
-		   BLKTAP2_CONTROL_SOCKET"%d", &id) != 1) {
+	if (fscanf(f, BLKTAP3_CONTROL_DIR "/"
+			   BLKTAP3_CONTROL_SOCKET "%d", &id) != 1) {
 		errno = (errno ? : EINVAL);
 		EPRINTF("parsing id failed: %d\n", errno);
 		id = -1;
@@ -158,13 +172,17 @@ tap_ctl_spawn(void)
 
 	readfd = -1;
 
+  again:
 	child = __tap_ctl_spawn(&readfd);
 	if (child < 0)
 		return child;
 
 	err = tap_ctl_wait(child);
-	if (err)
+	if (err) {
+		if (err == -EAGAIN)
+			goto again;
 		return err;
+	}
 
 	id = tap_ctl_get_child_id(readfd);
 	if (id < 0)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQdf-0005ij-9m; Fri, 16 Nov 2012 18:27:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdd-0005hG-0w
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:37 +0000
Received: from [193.109.254.147:45794] by server-5.bemta-14.messagelabs.com id
	58/90-10257-89586A05; Fri, 16 Nov 2012 18:27:36 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353090455!8550695!2
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22406 invoked from network); 16 Nov 2012 18:27:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857980"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:05 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:04 +0000
MIME-Version: 1.0
X-Mercurial-Node: b10e572ec1214109e5ef1525ec71b7d5ea004ef8
Message-ID: <b10e572ec1214109e5ef.1353090342@makatos-desktop>
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:42 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 2 of 9 RFC] blktap3: Introduce tapdisk message
 types and structures
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch introduces functions and structures required for the tap-ctl utility
and the xenio daemon to talk to a tapdisk process. This file is based on the
existing blktap2 file, with some changes coming from blktap2 living in github
(the STATS message, support for mirroring).

tapdisk_message_name is now neater and uses a look up table instead of a big
switch.

blktap3 introduces the following messages:
	- DISK_INFO: used by xenio to communicate to blkfront via XenStore the
	  number of sectors and the sector size so that it can create the virtual
	  block device.
	- XENBLKIF_CONNECT/DISCONNECT: used by the xenio daemon to instruct a
	  running tapdisk process to connect to the ring. The
	  tapdisk_message_blkif structure is used to convey such messages.

The ATTACH message has been removed since it is now superseded by
XENBLKIF_CONNECT (this probably means that DETACH must be removed as well in
favour of XENBLKIF_DISCONNECT). However, it would probably be nicer to keep the
ATTACH/DETACH identifiers in order to minimize interface changes.

diff --git a/tools/blktap2/include/tapdisk-message.h b/tools/blktap3/include/tapdisk-message.h
copy from tools/blktap2/include/tapdisk-message.h
copy to tools/blktap3/include/tapdisk-message.h
--- a/tools/blktap2/include/tapdisk-message.h
+++ b/tools/blktap3/include/tapdisk-message.h
@@ -36,29 +36,35 @@
 #define TAPDISK_MESSAGE_MAX_MINORS \
 	((TAPDISK_MESSAGE_MAX_PATH_LENGTH / sizeof(int)) - 1)
 
-#define TAPDISK_MESSAGE_FLAG_SHARED      0x01
-#define TAPDISK_MESSAGE_FLAG_RDONLY      0x02
-#define TAPDISK_MESSAGE_FLAG_ADD_CACHE   0x04
-#define TAPDISK_MESSAGE_FLAG_VHD_INDEX   0x08
-#define TAPDISK_MESSAGE_FLAG_LOG_DIRTY   0x10
+#define TAPDISK_MESSAGE_FLAG_SHARED      0x001
+#define TAPDISK_MESSAGE_FLAG_RDONLY      0x002
+#define TAPDISK_MESSAGE_FLAG_ADD_CACHE   0x004
+#define TAPDISK_MESSAGE_FLAG_VHD_INDEX   0x008
+#define TAPDISK_MESSAGE_FLAG_LOG_DIRTY   0x010
+#define TAPDISK_MESSAGE_FLAG_ADD_LCACHE  0x020
+#define TAPDISK_MESSAGE_FLAG_REUSE_PRT   0x040
+#define TAPDISK_MESSAGE_FLAG_SECONDARY   0x080
+#define TAPDISK_MESSAGE_FLAG_STANDBY     0x100
 
 typedef struct tapdisk_message           tapdisk_message_t;
-typedef uint8_t                          tapdisk_message_flag_t;
+typedef uint32_t                         tapdisk_message_flag_t;
 typedef struct tapdisk_message_image     tapdisk_message_image_t;
 typedef struct tapdisk_message_params    tapdisk_message_params_t;
 typedef struct tapdisk_message_string    tapdisk_message_string_t;
 typedef struct tapdisk_message_response  tapdisk_message_response_t;
 typedef struct tapdisk_message_minors    tapdisk_message_minors_t;
 typedef struct tapdisk_message_list      tapdisk_message_list_t;
+typedef struct tapdisk_message_stat      tapdisk_message_stat_t;
+typedef struct tapdisk_message_blkif     tapdisk_message_blkif_t;
 
 struct tapdisk_message_params {
 	tapdisk_message_flag_t           flags;
 
-	uint8_t                          storage;
 	uint32_t                         devnum;
 	uint32_t                         domid;
-	uint16_t                         path_len;
 	char                             path[TAPDISK_MESSAGE_MAX_PATH_LENGTH];
+	uint32_t                         prt_devnum;
+	char                             secondary[TAPDISK_MESSAGE_MAX_PATH_LENGTH];
 };
 
 struct tapdisk_message_image {
@@ -88,6 +94,55 @@ struct tapdisk_message_list {
 	char                             path[TAPDISK_MESSAGE_MAX_PATH_LENGTH];
 };
 
+struct tapdisk_message_stat {
+	uint16_t type;
+	uint16_t cookie;
+	size_t length;
+};
+
+/**
+ * Tapdisk message containing all the necessary information required for the
+ * tapdisk to connect to a guest's blkfront.
+ */
+struct tapdisk_message_blkif {
+	/**
+	 * The domain ID of the guest to connect to.
+	 */
+	uint32_t domid;
+
+	/**
+	 * The device ID of the virtual block device.
+	 */
+	uint32_t devid;
+
+	/**
+	 * Grant references for the shared ring.
+	 * TODO Why 8 specifically?
+	 */
+	uint32_t gref[8];
+
+	/**
+	 * Number of pages in the ring, expressed as a page order.
+	 */
+	uint32_t order;
+
+	/**
+	 * Protocol to use: native, 32 bit, or 64 bit.
+	 * TODO Is this used for supporting a 32 bit guest on a 64 bit hypervisor?
+	 */
+	uint32_t proto;
+
+	/**
+	 * TODO Page pool? Can be NULL.
+	 */
+	char pool[TAPDISK_MESSAGE_STRING_LENGTH];
+
+	/**
+	 * The event channel port.
+	 */
+	uint32_t port;
+};
+
 struct tapdisk_message {
 	uint16_t                         type;
 	uint16_t                         cookie;
@@ -100,10 +155,15 @@ struct tapdisk_message {
 		tapdisk_message_minors_t minors;
 		tapdisk_message_response_t response;
 		tapdisk_message_list_t   list;
+		tapdisk_message_stat_t   info;
+		tapdisk_message_blkif_t  blkif;
 	} u;
 };
 
 enum tapdisk_message_id {
+	/*
+	 * TODO Why start from 1 and not from 0?
+	 */
 	TAPDISK_MESSAGE_ERROR = 1,
 	TAPDISK_MESSAGE_RUNTIME_ERROR,
 	TAPDISK_MESSAGE_PID,
@@ -120,84 +180,70 @@ enum tapdisk_message_id {
 	TAPDISK_MESSAGE_CLOSE_RSP,
 	TAPDISK_MESSAGE_DETACH,
 	TAPDISK_MESSAGE_DETACH_RSP,
-	TAPDISK_MESSAGE_LIST_MINORS,
-	TAPDISK_MESSAGE_LIST_MINORS_RSP,
+	TAPDISK_MESSAGE_LIST_MINORS,		/* TODO still valid? */
+	TAPDISK_MESSAGE_LIST_MINORS_RSP,	/* TODO still valid? */
 	TAPDISK_MESSAGE_LIST,
 	TAPDISK_MESSAGE_LIST_RSP,
+	TAPDISK_MESSAGE_STATS,
+	TAPDISK_MESSAGE_STATS_RSP,
 	TAPDISK_MESSAGE_FORCE_SHUTDOWN,
+	TAPDISK_MESSAGE_DISK_INFO,
+	TAPDISK_MESSAGE_DISK_INFO_RSP,
+	TAPDISK_MESSAGE_XENBLKIF_CONNECT,
+	TAPDISK_MESSAGE_XENBLKIF_CONNECT_RSP,
+	TAPDISK_MESSAGE_XENBLKIF_DISCONNECT,
+	TAPDISK_MESSAGE_XENBLKIF_DISCONNECT_RSP,
 	TAPDISK_MESSAGE_EXIT,
 };
 
-static inline char *
-tapdisk_message_name(enum tapdisk_message_id id)
-{
-	switch (id) {
-	case TAPDISK_MESSAGE_ERROR:
-		return "error";
+#define TAPDISK_MESSAGE_MAX TAPDISK_MESSAGE_EXIT
 
-	case TAPDISK_MESSAGE_PID:
-		return "pid";
+/**
+ * Retrieves a message's human-readable representation.
+ *
+ * @param id the message ID to translate
+ * @return the name of the message 
+ */
+static inline char const *
+tapdisk_message_name(const enum tapdisk_message_id id) {
+	static char const *msg_names[(TAPDISK_MESSAGE_MAX + 1)] = {
+		[TAPDISK_MESSAGE_ERROR] = "error",
+		[TAPDISK_MESSAGE_RUNTIME_ERROR] = "runtime error",
+		[TAPDISK_MESSAGE_PID] = "pid",
+		[TAPDISK_MESSAGE_PID_RSP] = "pid response",
+		[TAPDISK_MESSAGE_OPEN] = "open",
+		[TAPDISK_MESSAGE_OPEN_RSP] = "open response",
+		[TAPDISK_MESSAGE_PAUSE] = "pause",
+		[TAPDISK_MESSAGE_PAUSE_RSP] = "pause response",
+		[TAPDISK_MESSAGE_RESUME] = "resume",
+		[TAPDISK_MESSAGE_RESUME_RSP] = "resume response",
+		[TAPDISK_MESSAGE_CLOSE] = "close",
+		[TAPDISK_MESSAGE_FORCE_SHUTDOWN] = "force shutdown",
+		[TAPDISK_MESSAGE_CLOSE_RSP] = "close response",
+		[TAPDISK_MESSAGE_ATTACH] = "attach",
+		[TAPDISK_MESSAGE_ATTACH_RSP] = "attach response",
+		[TAPDISK_MESSAGE_DETACH] = "detach",
+		[TAPDISK_MESSAGE_DETACH_RSP] = "detach response",
+		[TAPDISK_MESSAGE_LIST_MINORS] = "list minors",
+		[TAPDISK_MESSAGE_LIST_MINORS_RSP] = "list minors response",
+		[TAPDISK_MESSAGE_LIST] = "list",
+		[TAPDISK_MESSAGE_LIST_RSP] = "list response",
+		[TAPDISK_MESSAGE_STATS] = "stats",
+		[TAPDISK_MESSAGE_STATS_RSP] = "stats response",
+		[TAPDISK_MESSAGE_DISK_INFO] = "disk info",
+		[TAPDISK_MESSAGE_DISK_INFO_RSP] = "disk info response",
+		[TAPDISK_MESSAGE_XENBLKIF_CONNECT] = "blkif connect",
+		[TAPDISK_MESSAGE_XENBLKIF_CONNECT_RSP] = "blkif connect response",
+		[TAPDISK_MESSAGE_XENBLKIF_DISCONNECT] = "blkif disconnect",
+		[TAPDISK_MESSAGE_XENBLKIF_DISCONNECT_RSP]
+			= "blkif disconnect response",
+		[TAPDISK_MESSAGE_EXIT] = "exit"
+	};
 
-	case TAPDISK_MESSAGE_PID_RSP:
-		return "pid response";
-
-	case TAPDISK_MESSAGE_OPEN:
-		return "open";
-
-	case TAPDISK_MESSAGE_OPEN_RSP:
-		return "open response";
-
-	case TAPDISK_MESSAGE_PAUSE:
-		return "pause";
-
-	case TAPDISK_MESSAGE_PAUSE_RSP:
-		return "pause response";
-
-	case TAPDISK_MESSAGE_RESUME:
-		return "resume";
-
-	case TAPDISK_MESSAGE_RESUME_RSP:
-		return "resume response";
-
-	case TAPDISK_MESSAGE_CLOSE:
-		return "close";
-
-	case TAPDISK_MESSAGE_FORCE_SHUTDOWN:
-		return "force shutdown";
-
-	case TAPDISK_MESSAGE_CLOSE_RSP:
-		return "close response";
-
-	case TAPDISK_MESSAGE_ATTACH:
-		return "attach";
-
-	case TAPDISK_MESSAGE_ATTACH_RSP:
-		return "attach response";
-
-	case TAPDISK_MESSAGE_DETACH:
-		return "detach";
-
-	case TAPDISK_MESSAGE_DETACH_RSP:
-		return "detach response";
-
-	case TAPDISK_MESSAGE_LIST_MINORS:
-		return "list minors";
-
-	case TAPDISK_MESSAGE_LIST_MINORS_RSP:
-		return "list minors response";
-
-	case TAPDISK_MESSAGE_LIST:
-		return "list";
-
-	case TAPDISK_MESSAGE_LIST_RSP:
-		return "list response";
-
-	case TAPDISK_MESSAGE_EXIT:
-		return "exit";
-
-	default:
+	if (id < 1 || id > TAPDISK_MESSAGE_MAX) {
 		return "unknown";
 	}
+	return msg_names[id];
 }
 
-#endif
+#endif /* _TAPDISK_MESSAGE_H_ */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQdf-0005ij-9m; Fri, 16 Nov 2012 18:27:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdd-0005hG-0w
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:37 +0000
Received: from [193.109.254.147:45794] by server-5.bemta-14.messagelabs.com id
	58/90-10257-89586A05; Fri, 16 Nov 2012 18:27:36 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353090455!8550695!2
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22406 invoked from network); 16 Nov 2012 18:27:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857980"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:05 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:04 +0000
MIME-Version: 1.0
X-Mercurial-Node: b10e572ec1214109e5ef1525ec71b7d5ea004ef8
Message-ID: <b10e572ec1214109e5ef.1353090342@makatos-desktop>
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:42 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 2 of 9 RFC] blktap3: Introduce tapdisk message
 types and structures
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch introduces functions and structures required for the tap-ctl utility
and the xenio daemon to talk to a tapdisk process. This file is based on the
existing blktap2 file, with some changes coming from blktap2 living in github
(the STATS message, support for mirroring).

tapdisk_message_name is now neater and uses a look up table instead of a big
switch.

blktap3 introduces the following messages:
	- DISK_INFO: used by xenio to communicate to blkfront via XenStore the
	  number of sectors and the sector size so that it can create the virtual
	  block device.
	- XENBLKIF_CONNECT/DISCONNECT: used by the xenio daemon to instruct a
	  running tapdisk process to connect to the ring. The
	  tapdisk_message_blkif structure is used to convey such messages.

The ATTACH message has been removed since it is now superseded by
XENBLKIF_CONNECT (this probably means that DETACH must be removed as well in
favour of XENBLKIF_DISCONNECT). However, it would probably be nicer to keep the
ATTACH/DETACH identifiers in order to minimize interface changes.

diff --git a/tools/blktap2/include/tapdisk-message.h b/tools/blktap3/include/tapdisk-message.h
copy from tools/blktap2/include/tapdisk-message.h
copy to tools/blktap3/include/tapdisk-message.h
--- a/tools/blktap2/include/tapdisk-message.h
+++ b/tools/blktap3/include/tapdisk-message.h
@@ -36,29 +36,35 @@
 #define TAPDISK_MESSAGE_MAX_MINORS \
 	((TAPDISK_MESSAGE_MAX_PATH_LENGTH / sizeof(int)) - 1)
 
-#define TAPDISK_MESSAGE_FLAG_SHARED      0x01
-#define TAPDISK_MESSAGE_FLAG_RDONLY      0x02
-#define TAPDISK_MESSAGE_FLAG_ADD_CACHE   0x04
-#define TAPDISK_MESSAGE_FLAG_VHD_INDEX   0x08
-#define TAPDISK_MESSAGE_FLAG_LOG_DIRTY   0x10
+#define TAPDISK_MESSAGE_FLAG_SHARED      0x001
+#define TAPDISK_MESSAGE_FLAG_RDONLY      0x002
+#define TAPDISK_MESSAGE_FLAG_ADD_CACHE   0x004
+#define TAPDISK_MESSAGE_FLAG_VHD_INDEX   0x008
+#define TAPDISK_MESSAGE_FLAG_LOG_DIRTY   0x010
+#define TAPDISK_MESSAGE_FLAG_ADD_LCACHE  0x020
+#define TAPDISK_MESSAGE_FLAG_REUSE_PRT   0x040
+#define TAPDISK_MESSAGE_FLAG_SECONDARY   0x080
+#define TAPDISK_MESSAGE_FLAG_STANDBY     0x100
 
 typedef struct tapdisk_message           tapdisk_message_t;
-typedef uint8_t                          tapdisk_message_flag_t;
+typedef uint32_t                         tapdisk_message_flag_t;
 typedef struct tapdisk_message_image     tapdisk_message_image_t;
 typedef struct tapdisk_message_params    tapdisk_message_params_t;
 typedef struct tapdisk_message_string    tapdisk_message_string_t;
 typedef struct tapdisk_message_response  tapdisk_message_response_t;
 typedef struct tapdisk_message_minors    tapdisk_message_minors_t;
 typedef struct tapdisk_message_list      tapdisk_message_list_t;
+typedef struct tapdisk_message_stat      tapdisk_message_stat_t;
+typedef struct tapdisk_message_blkif     tapdisk_message_blkif_t;
 
 struct tapdisk_message_params {
 	tapdisk_message_flag_t           flags;
 
-	uint8_t                          storage;
 	uint32_t                         devnum;
 	uint32_t                         domid;
-	uint16_t                         path_len;
 	char                             path[TAPDISK_MESSAGE_MAX_PATH_LENGTH];
+	uint32_t                         prt_devnum;
+	char                             secondary[TAPDISK_MESSAGE_MAX_PATH_LENGTH];
 };
 
 struct tapdisk_message_image {
@@ -88,6 +94,55 @@ struct tapdisk_message_list {
 	char                             path[TAPDISK_MESSAGE_MAX_PATH_LENGTH];
 };
 
+struct tapdisk_message_stat {
+	uint16_t type;
+	uint16_t cookie;
+	size_t length;
+};
+
+/**
+ * Tapdisk message containing all the necessary information required for the
+ * tapdisk to connect to a guest's blkfront.
+ */
+struct tapdisk_message_blkif {
+	/**
+	 * The domain ID of the guest to connect to.
+	 */
+	uint32_t domid;
+
+	/**
+	 * The device ID of the virtual block device.
+	 */
+	uint32_t devid;
+
+	/**
+	 * Grant references for the shared ring.
+	 * TODO Why 8 specifically?
+	 */
+	uint32_t gref[8];
+
+	/**
+	 * Number of pages in the ring, expressed as a page order.
+	 */
+	uint32_t order;
+
+	/**
+	 * Protocol to use: native, 32 bit, or 64 bit.
+	 * TODO Is this used for supporting a 32 bit guest on a 64 bit hypervisor?
+	 */
+	uint32_t proto;
+
+	/**
+	 * TODO Page pool? Can be NULL.
+	 */
+	char pool[TAPDISK_MESSAGE_STRING_LENGTH];
+
+	/**
+	 * The event channel port.
+	 */
+	uint32_t port;
+};
+
 struct tapdisk_message {
 	uint16_t                         type;
 	uint16_t                         cookie;
@@ -100,10 +155,15 @@ struct tapdisk_message {
 		tapdisk_message_minors_t minors;
 		tapdisk_message_response_t response;
 		tapdisk_message_list_t   list;
+		tapdisk_message_stat_t   info;
+		tapdisk_message_blkif_t  blkif;
 	} u;
 };
 
 enum tapdisk_message_id {
+	/*
+	 * TODO Why start from 1 and not from 0?
+	 */
 	TAPDISK_MESSAGE_ERROR = 1,
 	TAPDISK_MESSAGE_RUNTIME_ERROR,
 	TAPDISK_MESSAGE_PID,
@@ -120,84 +180,70 @@ enum tapdisk_message_id {
 	TAPDISK_MESSAGE_CLOSE_RSP,
 	TAPDISK_MESSAGE_DETACH,
 	TAPDISK_MESSAGE_DETACH_RSP,
-	TAPDISK_MESSAGE_LIST_MINORS,
-	TAPDISK_MESSAGE_LIST_MINORS_RSP,
+	TAPDISK_MESSAGE_LIST_MINORS,		/* TODO still valid? */
+	TAPDISK_MESSAGE_LIST_MINORS_RSP,	/* TODO still valid? */
 	TAPDISK_MESSAGE_LIST,
 	TAPDISK_MESSAGE_LIST_RSP,
+	TAPDISK_MESSAGE_STATS,
+	TAPDISK_MESSAGE_STATS_RSP,
 	TAPDISK_MESSAGE_FORCE_SHUTDOWN,
+	TAPDISK_MESSAGE_DISK_INFO,
+	TAPDISK_MESSAGE_DISK_INFO_RSP,
+	TAPDISK_MESSAGE_XENBLKIF_CONNECT,
+	TAPDISK_MESSAGE_XENBLKIF_CONNECT_RSP,
+	TAPDISK_MESSAGE_XENBLKIF_DISCONNECT,
+	TAPDISK_MESSAGE_XENBLKIF_DISCONNECT_RSP,
 	TAPDISK_MESSAGE_EXIT,
 };
 
-static inline char *
-tapdisk_message_name(enum tapdisk_message_id id)
-{
-	switch (id) {
-	case TAPDISK_MESSAGE_ERROR:
-		return "error";
+#define TAPDISK_MESSAGE_MAX TAPDISK_MESSAGE_EXIT
 
-	case TAPDISK_MESSAGE_PID:
-		return "pid";
+/**
+ * Retrieves a message's human-readable representation.
+ *
+ * @param id the message ID to translate
+ * @return the name of the message 
+ */
+static inline char const *
+tapdisk_message_name(const enum tapdisk_message_id id) {
+	static char const *msg_names[(TAPDISK_MESSAGE_MAX + 1)] = {
+		[TAPDISK_MESSAGE_ERROR] = "error",
+		[TAPDISK_MESSAGE_RUNTIME_ERROR] = "runtime error",
+		[TAPDISK_MESSAGE_PID] = "pid",
+		[TAPDISK_MESSAGE_PID_RSP] = "pid response",
+		[TAPDISK_MESSAGE_OPEN] = "open",
+		[TAPDISK_MESSAGE_OPEN_RSP] = "open response",
+		[TAPDISK_MESSAGE_PAUSE] = "pause",
+		[TAPDISK_MESSAGE_PAUSE_RSP] = "pause response",
+		[TAPDISK_MESSAGE_RESUME] = "resume",
+		[TAPDISK_MESSAGE_RESUME_RSP] = "resume response",
+		[TAPDISK_MESSAGE_CLOSE] = "close",
+		[TAPDISK_MESSAGE_FORCE_SHUTDOWN] = "force shutdown",
+		[TAPDISK_MESSAGE_CLOSE_RSP] = "close response",
+		[TAPDISK_MESSAGE_ATTACH] = "attach",
+		[TAPDISK_MESSAGE_ATTACH_RSP] = "attach response",
+		[TAPDISK_MESSAGE_DETACH] = "detach",
+		[TAPDISK_MESSAGE_DETACH_RSP] = "detach response",
+		[TAPDISK_MESSAGE_LIST_MINORS] = "list minors",
+		[TAPDISK_MESSAGE_LIST_MINORS_RSP] = "list minors response",
+		[TAPDISK_MESSAGE_LIST] = "list",
+		[TAPDISK_MESSAGE_LIST_RSP] = "list response",
+		[TAPDISK_MESSAGE_STATS] = "stats",
+		[TAPDISK_MESSAGE_STATS_RSP] = "stats response",
+		[TAPDISK_MESSAGE_DISK_INFO] = "disk info",
+		[TAPDISK_MESSAGE_DISK_INFO_RSP] = "disk info response",
+		[TAPDISK_MESSAGE_XENBLKIF_CONNECT] = "blkif connect",
+		[TAPDISK_MESSAGE_XENBLKIF_CONNECT_RSP] = "blkif connect response",
+		[TAPDISK_MESSAGE_XENBLKIF_DISCONNECT] = "blkif disconnect",
+		[TAPDISK_MESSAGE_XENBLKIF_DISCONNECT_RSP]
+			= "blkif disconnect response",
+		[TAPDISK_MESSAGE_EXIT] = "exit"
+	};
 
-	case TAPDISK_MESSAGE_PID_RSP:
-		return "pid response";
-
-	case TAPDISK_MESSAGE_OPEN:
-		return "open";
-
-	case TAPDISK_MESSAGE_OPEN_RSP:
-		return "open response";
-
-	case TAPDISK_MESSAGE_PAUSE:
-		return "pause";
-
-	case TAPDISK_MESSAGE_PAUSE_RSP:
-		return "pause response";
-
-	case TAPDISK_MESSAGE_RESUME:
-		return "resume";
-
-	case TAPDISK_MESSAGE_RESUME_RSP:
-		return "resume response";
-
-	case TAPDISK_MESSAGE_CLOSE:
-		return "close";
-
-	case TAPDISK_MESSAGE_FORCE_SHUTDOWN:
-		return "force shutdown";
-
-	case TAPDISK_MESSAGE_CLOSE_RSP:
-		return "close response";
-
-	case TAPDISK_MESSAGE_ATTACH:
-		return "attach";
-
-	case TAPDISK_MESSAGE_ATTACH_RSP:
-		return "attach response";
-
-	case TAPDISK_MESSAGE_DETACH:
-		return "detach";
-
-	case TAPDISK_MESSAGE_DETACH_RSP:
-		return "detach response";
-
-	case TAPDISK_MESSAGE_LIST_MINORS:
-		return "list minors";
-
-	case TAPDISK_MESSAGE_LIST_MINORS_RSP:
-		return "list minors response";
-
-	case TAPDISK_MESSAGE_LIST:
-		return "list";
-
-	case TAPDISK_MESSAGE_LIST_RSP:
-		return "list response";
-
-	case TAPDISK_MESSAGE_EXIT:
-		return "exit";
-
-	default:
+	if (id < 1 || id > TAPDISK_MESSAGE_MAX) {
 		return "unknown";
 	}
+	return msg_names[id];
 }
 
-#endif
+#endif /* _TAPDISK_MESSAGE_H_ */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQde-0005iG-G4; Fri, 16 Nov 2012 18:27:38 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdc-0005hH-TN
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:37 +0000
Received: from [193.109.254.147:45790] by server-8.bemta-14.messagelabs.com id
	36/BA-05026-89586A05; Fri, 16 Nov 2012 18:27:36 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353090455!8550695!3
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22411 invoked from network); 16 Nov 2012 18:27:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857978"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:04 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:04 +0000
MIME-Version: 1.0
Message-ID: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:40 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 0 of 9 RFC] blktap3: Introduce a small subset of
	blktap3 files
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

blktap3 is a disk backend driver. It is based on blktap2 but does not require
the blktap/blkback kernel modules as it allows tapdisk to talk directly to
blkfront. This primarily simplifies maintenance, and _may_ lead to performance
improvements. This patch series introduces a small subset of files required by
blktap3. blktap3 is based on a blktap2 fork maintained mostly by Citrix (it
lives in github), so these changes are also imported, apart from the blktap3
ones.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQde-0005iG-G4; Fri, 16 Nov 2012 18:27:38 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdc-0005hH-TN
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:37 +0000
Received: from [193.109.254.147:45790] by server-8.bemta-14.messagelabs.com id
	36/BA-05026-89586A05; Fri, 16 Nov 2012 18:27:36 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353090455!8550695!3
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22411 invoked from network); 16 Nov 2012 18:27:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857978"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:04 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:04 +0000
MIME-Version: 1.0
Message-ID: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:40 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 0 of 9 RFC] blktap3: Introduce a small subset of
	blktap3 files
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

blktap3 is a disk backend driver. It is based on blktap2 but does not require
the blktap/blkback kernel modules as it allows tapdisk to talk directly to
blkfront. This primarily simplifies maintenance, and _may_ lead to performance
improvements. This patch series introduces a small subset of files required by
blktap3. blktap3 is based on a blktap2 fork maintained mostly by Citrix (it
lives in github), so these changes are also imported, apart from the blktap3
ones.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQde-0005i3-4k; Fri, 16 Nov 2012 18:27:38 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdc-0005hG-Hz
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:36 +0000
Received: from [193.109.254.147:36616] by server-5.bemta-14.messagelabs.com id
	F7/90-10257-79586A05; Fri, 16 Nov 2012 18:27:35 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353090455!8550695!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22403 invoked from network); 16 Nov 2012 18:27:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857979"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:04 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:04 +0000
MIME-Version: 1.0
X-Mercurial-Node: 28d57229042b9fe04a6ddd29a2bf14c247ce459b
Message-ID: <28d57229042b9fe04a6d.1353090341@makatos-desktop>
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:41 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 1 of 9 RFC] blktap3: Introduce blktap3 headers
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch introduces basic blktap3 header files. It also provides an plain
Makefile so that the build system doesn't complain.

diff --git a/tools/blktap3/include/Makefile b/tools/blktap3/include/Makefile
new file mode 100644
--- /dev/null
+++ b/tools/blktap3/include/Makefile
@@ -0,0 +1,14 @@
+XEN_ROOT := $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+.PHONY: all
+all:
+
+.PHONY: install
+install:
+	$(INSTALL_DIR) -p $(DESTDIR)$(INCLUDEDIR)
+
+
+.PHONY: clean
+clean:
+	@:
diff --git a/tools/blktap3/include/blktap3.h b/tools/blktap3/include/blktap3.h
new file mode 100644
--- /dev/null
+++ b/tools/blktap3/include/blktap3.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ *
+ * Commonly used headers and definitions.
+ */
+
+#ifndef __BLKTAP_3_H__
+#define __BLKTAP_3_H__
+
+#include "compiler.h"
+
+/* TODO remove from other files */
+#include <xen-external/bsd-sys-queue.h>
+
+#define BLKTAP3_CONTROL_NAME        "blktap-control"
+#define BLKTAP3_CONTROL_DIR         "/var/run/"BLKTAP3_CONTROL_NAME
+#define BLKTAP3_CONTROL_SOCKET      "ctl"
+
+#define BLKTAP3_ENOSPC_SIGNAL_FILE  "/var/run/tapdisk3-enospc"
+
+/*
+ * TODO They may have to change due to macro namespacing.
+ */
+#define TAILQ_MOVE_HEAD(node, src, dst, entry)	\
+	TAILQ_REMOVE(src, node, entry);				\
+	TAILQ_INSERT_HEAD(dst, node, entry);
+
+#define TAILQ_MOVE_TAIL(node, src, dst, entry)	\
+	TAILQ_REMOVE(src, node, entry);				\
+	TAILQ_INSERT_TAIL(dst, node, entry);
+
+#endif /* __BLKTAP_3_H__ */
diff --git a/tools/blktap3/include/compiler.h b/tools/blktap3/include/compiler.h
new file mode 100644
--- /dev/null
+++ b/tools/blktap3/include/compiler.h
@@ -0,0 +1,26 @@
+/*
+ * TODO Do we need a license for this file?
+ */
+#ifndef __COMPILER_H__
+#define __COMPILER_H__
+
+#define likely(_cond)	__builtin_expect(!!(_cond), 1)
+#define unlikely(_cond)	__builtin_expect(!!(_cond), 0)
+
+/*
+ * FIXME taken from list.h, do we need to mention anything about the license?
+ */
+#define containerof(_ptr, _type, _memb) \
+	((_type*)((void*)(_ptr) - offsetof(_type, _memb)))
+
+#define __printf(a, b)	__attribute__((format(printf, a, b)))
+#define __scanf(_f, _a) __attribute__((format (scanf, _f, _a)))
+
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#endif /* ARRAY_SIZE */
+
+#define UNUSED_PARAMETER(x) \
+    (void)(x);
+
+#endif /* __COMPILER_H__ */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQde-0005i3-4k; Fri, 16 Nov 2012 18:27:38 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdc-0005hG-Hz
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:36 +0000
Received: from [193.109.254.147:36616] by server-5.bemta-14.messagelabs.com id
	F7/90-10257-79586A05; Fri, 16 Nov 2012 18:27:35 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353090455!8550695!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22403 invoked from network); 16 Nov 2012 18:27:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857979"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:04 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:04 +0000
MIME-Version: 1.0
X-Mercurial-Node: 28d57229042b9fe04a6ddd29a2bf14c247ce459b
Message-ID: <28d57229042b9fe04a6d.1353090341@makatos-desktop>
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:41 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 1 of 9 RFC] blktap3: Introduce blktap3 headers
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch introduces basic blktap3 header files. It also provides an plain
Makefile so that the build system doesn't complain.

diff --git a/tools/blktap3/include/Makefile b/tools/blktap3/include/Makefile
new file mode 100644
--- /dev/null
+++ b/tools/blktap3/include/Makefile
@@ -0,0 +1,14 @@
+XEN_ROOT := $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+.PHONY: all
+all:
+
+.PHONY: install
+install:
+	$(INSTALL_DIR) -p $(DESTDIR)$(INCLUDEDIR)
+
+
+.PHONY: clean
+clean:
+	@:
diff --git a/tools/blktap3/include/blktap3.h b/tools/blktap3/include/blktap3.h
new file mode 100644
--- /dev/null
+++ b/tools/blktap3/include/blktap3.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ *
+ * Commonly used headers and definitions.
+ */
+
+#ifndef __BLKTAP_3_H__
+#define __BLKTAP_3_H__
+
+#include "compiler.h"
+
+/* TODO remove from other files */
+#include <xen-external/bsd-sys-queue.h>
+
+#define BLKTAP3_CONTROL_NAME        "blktap-control"
+#define BLKTAP3_CONTROL_DIR         "/var/run/"BLKTAP3_CONTROL_NAME
+#define BLKTAP3_CONTROL_SOCKET      "ctl"
+
+#define BLKTAP3_ENOSPC_SIGNAL_FILE  "/var/run/tapdisk3-enospc"
+
+/*
+ * TODO They may have to change due to macro namespacing.
+ */
+#define TAILQ_MOVE_HEAD(node, src, dst, entry)	\
+	TAILQ_REMOVE(src, node, entry);				\
+	TAILQ_INSERT_HEAD(dst, node, entry);
+
+#define TAILQ_MOVE_TAIL(node, src, dst, entry)	\
+	TAILQ_REMOVE(src, node, entry);				\
+	TAILQ_INSERT_TAIL(dst, node, entry);
+
+#endif /* __BLKTAP_3_H__ */
diff --git a/tools/blktap3/include/compiler.h b/tools/blktap3/include/compiler.h
new file mode 100644
--- /dev/null
+++ b/tools/blktap3/include/compiler.h
@@ -0,0 +1,26 @@
+/*
+ * TODO Do we need a license for this file?
+ */
+#ifndef __COMPILER_H__
+#define __COMPILER_H__
+
+#define likely(_cond)	__builtin_expect(!!(_cond), 1)
+#define unlikely(_cond)	__builtin_expect(!!(_cond), 0)
+
+/*
+ * FIXME taken from list.h, do we need to mention anything about the license?
+ */
+#define containerof(_ptr, _type, _memb) \
+	((_type*)((void*)(_ptr) - offsetof(_type, _memb)))
+
+#define __printf(a, b)	__attribute__((format(printf, a, b)))
+#define __scanf(_f, _a) __attribute__((format (scanf, _f, _a)))
+
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#endif /* ARRAY_SIZE */
+
+#define UNUSED_PARAMETER(x) \
+    (void)(x);
+
+#endif /* __COMPILER_H__ */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQdi-0005kn-Dg; Fri, 16 Nov 2012 18:27:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TZQde-0005iB-OM
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:27:38 +0000
Received: from [85.158.143.99:16618] by server-1.bemta-4.messagelabs.com id
	A8/1E-27934-A9586A05; Fri, 16 Nov 2012 18:27:38 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1353090457!27579960!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4525 invoked from network); 16 Nov 2012 18:27:37 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:37 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857992"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:13 +0000
Received: from mac.citrite.net (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:12 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>, <linux-kernel@vger.kernel.org>,
	<konrad.wilk@oracle.com>
Date: Fri, 16 Nov 2012 19:26:48 +0100
Message-ID: <1353090408-66400-2-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
In-Reply-To: <1353090408-66400-1-git-send-email-roger.pau@citrix.com>
References: <1353090408-66400-1-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH 2/2] xen-blkback: move free persistent grants
	code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-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JfRU1QVFlfUk9PVCgmYmxraWYtPnBlcnNp
c3RlbnRfZ250cykpOworCWJsa2lmLT5wZXJzaXN0ZW50X2dudF9jID0gMDsKIAogCWlmIChsb2df
c3RhdHMpCiAJCXByaW50X3N0YXRzKGJsa2lmKTsKLS0gCjEuNy43LjUgKEFwcGxlIEdpdC0yNikK
CgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2
ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4u
b3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQdi-0005kn-Dg; Fri, 16 Nov 2012 18:27:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TZQde-0005iB-OM
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:27:38 +0000
Received: from [85.158.143.99:16618] by server-1.bemta-4.messagelabs.com id
	A8/1E-27934-A9586A05; Fri, 16 Nov 2012 18:27:38 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1353090457!27579960!1
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4525 invoked from network); 16 Nov 2012 18:27:37 -0000
Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:37 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857992"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:13 +0000
Received: from mac.citrite.net (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:12 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>, <linux-kernel@vger.kernel.org>,
	<konrad.wilk@oracle.com>
Date: Fri, 16 Nov 2012 19:26:48 +0100
Message-ID: <1353090408-66400-2-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
In-Reply-To: <1353090408-66400-1-git-send-email-roger.pau@citrix.com>
References: <1353090408-66400-1-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH 2/2] xen-blkback: move free persistent grants
	code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@l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LT5wZXJzaXN0ZW50X2dudF9jID0gMDsKIAogCWlmIChsb2df
c3RhdHMpCiAJCXByaW50X3N0YXRzKGJsa2lmKTsKLS0gCjEuNy43LjUgKEFwcGxlIEdpdC0yNikK
CgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2
ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4u
b3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQdh-0005jo-B1; Fri, 16 Nov 2012 18:27:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdd-0005hZ-LK
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:37 +0000
Received: from [85.158.143.99:56565] by server-1.bemta-4.messagelabs.com id
	56/1E-27934-89586A05; Fri, 16 Nov 2012 18:27:36 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353090456!23208928!2
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20304 invoked from network); 16 Nov 2012 18:27:36 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:36 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857988"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:06 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:06 +0000
MIME-Version: 1.0
X-Mercurial-Node: 99866fac1445feaf3c397014039339b96c65f4e1
Message-ID: <99866fac1445feaf3c39.1353090349@makatos-desktop>
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:49 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 9 of 9 RFC] blktap3: Introduce makefile that
 builds xenio-required tap-ctl functionality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch imports control/Makefile from the existing blktap2 implementation,
building only the binaries required by the xenio daemon. The rest of the
binaries will be re-introduced by a later patch.

Defines TAPDISK_EXEC, TAPDISK_EXECDIR, and TAPDISK_BUILDDIR are used by
tap-ctl-spawn, as it needs to know where the tapdisk binary is located in order
to spawn a tapdisk process

diff --git a/tools/blktap2/control/Makefile b/tools/blktap3/control/Makefile
copy from tools/blktap2/control/Makefile
copy to tools/blktap3/control/Makefile
--- a/tools/blktap2/control/Makefile
+++ b/tools/blktap3/control/Makefile
@@ -6,40 +6,36 @@ MINOR              = 0
 LIBNAME            = libblktapctl
 LIBSONAME          = $(LIBNAME).so.$(MAJOR)
 
-IBIN               = tap-ctl
+override CFLAGS += \
+	-I../include \
+	-DTAPDISK_EXEC='"tapdisk"' \
+	-DTAPDISK_EXECDIR='"/usr/local/libexec"' \
+	-DTAPDISK_BUILDDIR='"../drivers"' \
+	$(CFLAGS_xeninclude) \
+	$(CFLAGS_libxenctrl) \
+	-D_GNU_SOURCE \
+	-DTAPCTL \
+    -Wall \
+    -Wextra \
+    -Werror
+# FIXME cause trouble
+override CFLAGS += \
+    -Wno-type-limits \
+    -Wno-missing-field-initializers \
+    -Wno-sign-compare
 
-CFLAGS            += -Werror
-CFLAGS            += -Wno-unused
-CFLAGS            += -I../include -I../drivers
-CFLAGS            += $(CFLAGS_xeninclude)
-CFLAGS            += $(CFLAGS_libxenctrl)
-CFLAGS            += -D_GNU_SOURCE
-CFLAGS            += -DTAPCTL
-
-CTL_OBJS  := tap-ctl-ipc.o
 CTL_OBJS  += tap-ctl-list.o
-CTL_OBJS  += tap-ctl-allocate.o
-CTL_OBJS  += tap-ctl-free.o
-CTL_OBJS  += tap-ctl-create.o
-CTL_OBJS  += tap-ctl-destroy.o
+CTL_OBJS  += tap-ctl-info.o
+CTL_OBJS  += tap-ctl-xen.o
+CTL_OBJS  += tap-ctl-ipc.o
 CTL_OBJS  += tap-ctl-spawn.o
-CTL_OBJS  += tap-ctl-attach.o
-CTL_OBJS  += tap-ctl-detach.o
-CTL_OBJS  += tap-ctl-open.o
-CTL_OBJS  += tap-ctl-close.o
-CTL_OBJS  += tap-ctl-pause.o
-CTL_OBJS  += tap-ctl-unpause.o
-CTL_OBJS  += tap-ctl-major.o
-CTL_OBJS  += tap-ctl-check.o
 
 CTL_PICS  = $(patsubst %.o,%.opic,$(CTL_OBJS))
 
-OBJS = $(CTL_OBJS) tap-ctl.o
 PICS = $(CTL_PICS)
 
 LIB_STATIC = $(LIBNAME).a
 LIB_SHARED = $(LIBSONAME).$(MINOR)
-IBIN = tap-ctl
 
 all: build
 
@@ -51,25 +47,21 @@ build: $(IBIN) $(LIB_STATIC) $(LIB_SHARE
 $(LIBSONAME): $(LIB_SHARED)
 	ln -sf $< $@
 
-tap-ctl: tap-ctl.o $(LIBNAME).so
-	$(CC) $(LDFLAGS) -o $@ $^
-
 $(LIB_STATIC): $(CTL_OBJS)
 	$(AR) r $@ $^
 
 $(LIB_SHARED): $(CTL_PICS)
 	$(CC) $(LDFLAGS) -fPIC  -Wl,$(SONAME_LDFLAG) -Wl,$(LIBSONAME) $(SHLIB_LDFLAGS) -rdynamic $^ -o $@
 
-install: $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
+install: $(LIB_STATIC) $(LIB_SHARED)
 	$(INSTALL_DIR) -p $(DESTDIR)$(SBINDIR)
-	$(INSTALL_PROG) $(IBIN) $(DESTDIR)$(SBINDIR)
 	$(INSTALL_DATA) $(LIB_STATIC) $(DESTDIR)$(LIBDIR)
 	$(INSTALL_PROG) $(LIB_SHARED) $(DESTDIR)$(LIBDIR)
 	ln -sf $(LIBSONAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME).so
 	ln -sf $(LIB_SHARED) $(DESTDIR)$(LIBDIR)/$(LIBSONAME)
 
 clean:
-	rm -f $(OBJS) $(PICS) $(DEPS) $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
+	rm -f $(PICS) $(DEPS) $(LIB_STATIC) $(LIB_SHARED)
 	rm -f $(LIBNAME).so $(LIBSONAME)
 	rm -f *~
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:27:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:27:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQdh-0005jo-B1; Fri, 16 Nov 2012 18:27:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TZQdd-0005hZ-LK
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:27:37 +0000
Received: from [85.158.143.99:56565] by server-1.bemta-4.messagelabs.com id
	56/1E-27934-89586A05; Fri, 16 Nov 2012 18:27:36 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353090456!23208928!2
X-Originating-IP: [62.200.22.115]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjIuMjAwLjIyLjExNSA9PiAxMTg5ODg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20304 invoked from network); 16 Nov 2012 18:27:36 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (62.200.22.115)
	by server-6.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:27:36 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15857988"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:27:06 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 18:27:06 +0000
MIME-Version: 1.0
X-Mercurial-Node: 99866fac1445feaf3c397014039339b96c65f4e1
Message-ID: <99866fac1445feaf3c39.1353090349@makatos-desktop>
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 16 Nov 2012 18:25:49 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 9 of 9 RFC] blktap3: Introduce makefile that
 builds xenio-required tap-ctl functionality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch imports control/Makefile from the existing blktap2 implementation,
building only the binaries required by the xenio daemon. The rest of the
binaries will be re-introduced by a later patch.

Defines TAPDISK_EXEC, TAPDISK_EXECDIR, and TAPDISK_BUILDDIR are used by
tap-ctl-spawn, as it needs to know where the tapdisk binary is located in order
to spawn a tapdisk process

diff --git a/tools/blktap2/control/Makefile b/tools/blktap3/control/Makefile
copy from tools/blktap2/control/Makefile
copy to tools/blktap3/control/Makefile
--- a/tools/blktap2/control/Makefile
+++ b/tools/blktap3/control/Makefile
@@ -6,40 +6,36 @@ MINOR              = 0
 LIBNAME            = libblktapctl
 LIBSONAME          = $(LIBNAME).so.$(MAJOR)
 
-IBIN               = tap-ctl
+override CFLAGS += \
+	-I../include \
+	-DTAPDISK_EXEC='"tapdisk"' \
+	-DTAPDISK_EXECDIR='"/usr/local/libexec"' \
+	-DTAPDISK_BUILDDIR='"../drivers"' \
+	$(CFLAGS_xeninclude) \
+	$(CFLAGS_libxenctrl) \
+	-D_GNU_SOURCE \
+	-DTAPCTL \
+    -Wall \
+    -Wextra \
+    -Werror
+# FIXME cause trouble
+override CFLAGS += \
+    -Wno-type-limits \
+    -Wno-missing-field-initializers \
+    -Wno-sign-compare
 
-CFLAGS            += -Werror
-CFLAGS            += -Wno-unused
-CFLAGS            += -I../include -I../drivers
-CFLAGS            += $(CFLAGS_xeninclude)
-CFLAGS            += $(CFLAGS_libxenctrl)
-CFLAGS            += -D_GNU_SOURCE
-CFLAGS            += -DTAPCTL
-
-CTL_OBJS  := tap-ctl-ipc.o
 CTL_OBJS  += tap-ctl-list.o
-CTL_OBJS  += tap-ctl-allocate.o
-CTL_OBJS  += tap-ctl-free.o
-CTL_OBJS  += tap-ctl-create.o
-CTL_OBJS  += tap-ctl-destroy.o
+CTL_OBJS  += tap-ctl-info.o
+CTL_OBJS  += tap-ctl-xen.o
+CTL_OBJS  += tap-ctl-ipc.o
 CTL_OBJS  += tap-ctl-spawn.o
-CTL_OBJS  += tap-ctl-attach.o
-CTL_OBJS  += tap-ctl-detach.o
-CTL_OBJS  += tap-ctl-open.o
-CTL_OBJS  += tap-ctl-close.o
-CTL_OBJS  += tap-ctl-pause.o
-CTL_OBJS  += tap-ctl-unpause.o
-CTL_OBJS  += tap-ctl-major.o
-CTL_OBJS  += tap-ctl-check.o
 
 CTL_PICS  = $(patsubst %.o,%.opic,$(CTL_OBJS))
 
-OBJS = $(CTL_OBJS) tap-ctl.o
 PICS = $(CTL_PICS)
 
 LIB_STATIC = $(LIBNAME).a
 LIB_SHARED = $(LIBSONAME).$(MINOR)
-IBIN = tap-ctl
 
 all: build
 
@@ -51,25 +47,21 @@ build: $(IBIN) $(LIB_STATIC) $(LIB_SHARE
 $(LIBSONAME): $(LIB_SHARED)
 	ln -sf $< $@
 
-tap-ctl: tap-ctl.o $(LIBNAME).so
-	$(CC) $(LDFLAGS) -o $@ $^
-
 $(LIB_STATIC): $(CTL_OBJS)
 	$(AR) r $@ $^
 
 $(LIB_SHARED): $(CTL_PICS)
 	$(CC) $(LDFLAGS) -fPIC  -Wl,$(SONAME_LDFLAG) -Wl,$(LIBSONAME) $(SHLIB_LDFLAGS) -rdynamic $^ -o $@
 
-install: $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
+install: $(LIB_STATIC) $(LIB_SHARED)
 	$(INSTALL_DIR) -p $(DESTDIR)$(SBINDIR)
-	$(INSTALL_PROG) $(IBIN) $(DESTDIR)$(SBINDIR)
 	$(INSTALL_DATA) $(LIB_STATIC) $(DESTDIR)$(LIBDIR)
 	$(INSTALL_PROG) $(LIB_SHARED) $(DESTDIR)$(LIBDIR)
 	ln -sf $(LIBSONAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME).so
 	ln -sf $(LIB_SHARED) $(DESTDIR)$(LIBDIR)/$(LIBSONAME)
 
 clean:
-	rm -f $(OBJS) $(PICS) $(DEPS) $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
+	rm -f $(PICS) $(DEPS) $(LIB_STATIC) $(LIB_SHARED)
 	rm -f $(LIBNAME).so $(LIBSONAME)
 	rm -f *~
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:28:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:28:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQeu-0006f5-Aq; Fri, 16 Nov 2012 18:28:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQes-0006eK-SD
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:28:55 +0000
Received: from [85.158.139.211:2117] by server-2.bemta-5.messagelabs.com id
	58/2D-04892-6E586A05; Fri, 16 Nov 2012 18:28:54 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353090532!20438113!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30848 invoked from network); 16 Nov 2012 18:28:53 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-14.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 18:28:53 -0000
X-TM-IMSS-Message-ID: <8924c4f9000aed58@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8924c4f9000aed58 ;
	Fri, 16 Nov 2012 13:31:33 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3X031862; 
	Fri, 16 Nov 2012 13:28:51 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:16 -0500
Message-Id: <1353090514-18537-2-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH 01/19] libxl: introduce XSM relabel on build
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Allow a domain to be built under one security label and run using a
different label. This can be used to prevent the domain builder or
control domain from having the ability to access a guest domain's memory
via map_foreign_range except during the build process where this is
required.

Note: this does not provide complete protection from a malicious dom0;
mappings created during the build process may persist after the relabel,
and could be used to indirectly access the guest's memory.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_flask.c      | 10 ++++++++++
 tools/libxc/xenctrl.h       |  1 +
 tools/libxl/libxl_create.c  |  4 ++++
 tools/libxl/libxl_types.idl |  1 +
 tools/libxl/xl_cmdimpl.c    | 20 +++++++++++++++++++-
 5 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/tools/libxc/xc_flask.c b/tools/libxc/xc_flask.c
index 80c5a2d..face1e0 100644
--- a/tools/libxc/xc_flask.c
+++ b/tools/libxc/xc_flask.c
@@ -422,6 +422,16 @@ int xc_flask_setavc_threshold(xc_interface *xch, int threshold)
     return xc_flask_op(xch, &op);
 }
 
+int xc_flask_relabel_domain(xc_interface *xch, int domid, uint32_t sid)
+{
+    DECLARE_FLASK_OP;
+    op.cmd = FLASK_RELABEL_DOMAIN;
+    op.u.relabel.domid = domid;
+    op.u.relabel.sid = sid;
+
+    return xc_flask_op(xch, &op);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..60391c6 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -2158,6 +2158,7 @@ int xc_flask_policyvers(xc_interface *xc_handle);
 int xc_flask_avc_hashstats(xc_interface *xc_handle, char *buf, int size);
 int xc_flask_getavc_threshold(xc_interface *xc_handle);
 int xc_flask_setavc_threshold(xc_interface *xc_handle, int threshold);
+int xc_flask_relabel_domain(xc_interface *xch, int domid, uint32_t sid);
 
 struct elf_binary;
 void xc_elf_set_logfile(xc_interface *xch, struct elf_binary *elf,
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 9d20086..b183255 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -1182,6 +1182,10 @@ static void domcreate_complete(libxl__egc *egc,
                                int rc)
 {
     STATE_AO_GC(dcs->ao);
+    libxl_domain_config *const d_config = dcs->guest_config;
+
+    if (!rc && d_config->b_info.exec_ssidref)
+        rc = xc_flask_relabel_domain(CTX->xch, dcs->guest_domid, d_config->b_info.exec_ssidref);
 
     if (rc) {
         if (dcs->guest_domid) {
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 7eac4a8..93524f0 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -268,6 +268,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("video_memkb",     MemKB),
     ("shadow_memkb",    MemKB),
     ("rtc_timeoffset",  uint32),
+    ("exec_ssidref",    uint32),
     ("localtime",       libxl_defbool),
     ("disable_migrate", libxl_defbool),
     ("cpuid",           libxl_cpuid_policy_list),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 5d444a8..4d67fdf 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -596,16 +596,34 @@ static void parse_config_data(const char *config_source,
         exit(1);
     }
 
-    if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
+    if (!xlu_cfg_get_string (config, "init_seclabel", &buf, 0)) {
         e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
                                     &c_info->ssidref);
         if (e) {
             if (errno == ENOSYS) {
+                fprintf(stderr, "XSM Disabled: init_seclabel not supported\n");
+            } else {
+                fprintf(stderr, "Invalid init_seclabel: %s\n", buf);
+                exit(1);
+            }
+        }
+    }
+
+    if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
+        uint32_t ssidref;
+        e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
+                                    &ssidref);
+        if (e) {
+            if (errno == ENOSYS) {
                 fprintf(stderr, "XSM Disabled: seclabel not supported\n");
             } else {
                 fprintf(stderr, "Invalid seclabel: %s\n", buf);
                 exit(1);
             }
+        } else if (c_info->ssidref) {
+            b_info->exec_ssidref = ssidref;
+        } else {
+            c_info->ssidref = ssidref;
         }
     }
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:28:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:28:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQeu-0006f5-Aq; Fri, 16 Nov 2012 18:28:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQes-0006eK-SD
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:28:55 +0000
Received: from [85.158.139.211:2117] by server-2.bemta-5.messagelabs.com id
	58/2D-04892-6E586A05; Fri, 16 Nov 2012 18:28:54 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353090532!20438113!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30848 invoked from network); 16 Nov 2012 18:28:53 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-14.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 18:28:53 -0000
X-TM-IMSS-Message-ID: <8924c4f9000aed58@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8924c4f9000aed58 ;
	Fri, 16 Nov 2012 13:31:33 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3X031862; 
	Fri, 16 Nov 2012 13:28:51 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:16 -0500
Message-Id: <1353090514-18537-2-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH 01/19] libxl: introduce XSM relabel on build
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Allow a domain to be built under one security label and run using a
different label. This can be used to prevent the domain builder or
control domain from having the ability to access a guest domain's memory
via map_foreign_range except during the build process where this is
required.

Note: this does not provide complete protection from a malicious dom0;
mappings created during the build process may persist after the relabel,
and could be used to indirectly access the guest's memory.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_flask.c      | 10 ++++++++++
 tools/libxc/xenctrl.h       |  1 +
 tools/libxl/libxl_create.c  |  4 ++++
 tools/libxl/libxl_types.idl |  1 +
 tools/libxl/xl_cmdimpl.c    | 20 +++++++++++++++++++-
 5 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/tools/libxc/xc_flask.c b/tools/libxc/xc_flask.c
index 80c5a2d..face1e0 100644
--- a/tools/libxc/xc_flask.c
+++ b/tools/libxc/xc_flask.c
@@ -422,6 +422,16 @@ int xc_flask_setavc_threshold(xc_interface *xch, int threshold)
     return xc_flask_op(xch, &op);
 }
 
+int xc_flask_relabel_domain(xc_interface *xch, int domid, uint32_t sid)
+{
+    DECLARE_FLASK_OP;
+    op.cmd = FLASK_RELABEL_DOMAIN;
+    op.u.relabel.domid = domid;
+    op.u.relabel.sid = sid;
+
+    return xc_flask_op(xch, &op);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..60391c6 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -2158,6 +2158,7 @@ int xc_flask_policyvers(xc_interface *xc_handle);
 int xc_flask_avc_hashstats(xc_interface *xc_handle, char *buf, int size);
 int xc_flask_getavc_threshold(xc_interface *xc_handle);
 int xc_flask_setavc_threshold(xc_interface *xc_handle, int threshold);
+int xc_flask_relabel_domain(xc_interface *xch, int domid, uint32_t sid);
 
 struct elf_binary;
 void xc_elf_set_logfile(xc_interface *xch, struct elf_binary *elf,
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 9d20086..b183255 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -1182,6 +1182,10 @@ static void domcreate_complete(libxl__egc *egc,
                                int rc)
 {
     STATE_AO_GC(dcs->ao);
+    libxl_domain_config *const d_config = dcs->guest_config;
+
+    if (!rc && d_config->b_info.exec_ssidref)
+        rc = xc_flask_relabel_domain(CTX->xch, dcs->guest_domid, d_config->b_info.exec_ssidref);
 
     if (rc) {
         if (dcs->guest_domid) {
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 7eac4a8..93524f0 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -268,6 +268,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("video_memkb",     MemKB),
     ("shadow_memkb",    MemKB),
     ("rtc_timeoffset",  uint32),
+    ("exec_ssidref",    uint32),
     ("localtime",       libxl_defbool),
     ("disable_migrate", libxl_defbool),
     ("cpuid",           libxl_cpuid_policy_list),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 5d444a8..4d67fdf 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -596,16 +596,34 @@ static void parse_config_data(const char *config_source,
         exit(1);
     }
 
-    if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
+    if (!xlu_cfg_get_string (config, "init_seclabel", &buf, 0)) {
         e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
                                     &c_info->ssidref);
         if (e) {
             if (errno == ENOSYS) {
+                fprintf(stderr, "XSM Disabled: init_seclabel not supported\n");
+            } else {
+                fprintf(stderr, "Invalid init_seclabel: %s\n", buf);
+                exit(1);
+            }
+        }
+    }
+
+    if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
+        uint32_t ssidref;
+        e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
+                                    &ssidref);
+        if (e) {
+            if (errno == ENOSYS) {
                 fprintf(stderr, "XSM Disabled: seclabel not supported\n");
             } else {
                 fprintf(stderr, "Invalid seclabel: %s\n", buf);
                 exit(1);
             }
+        } else if (c_info->ssidref) {
+            b_info->exec_ssidref = ssidref;
+        } else {
+            c_info->ssidref = ssidref;
         }
     }
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQey-0006hV-61; Fri, 16 Nov 2012 18:29:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQev-0006fR-E6
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:28:57 +0000
Received: from [85.158.139.211:17374] by server-9.bemta-5.messagelabs.com id
	93/94-29295-8E586A05; Fri, 16 Nov 2012 18:28:56 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-7.tower-206.messagelabs.com!1353090534!20053716!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16711 invoked from network); 16 Nov 2012 18:28:55 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-7.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 18:28:55 -0000
X-TM-IMSS-Message-ID: <8924ce1d000aed5e@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8924ce1d000aed5e ;
	Fri, 16 Nov 2012 13:31:35 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3d031862; 
	Fri, 16 Nov 2012 13:28:53 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:22 -0500
Message-Id: <1353090514-18537-8-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 07/19] xen: avoid calling
	rcu_lock_*target_domain when an XSM hook exists
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The rcu_lock_{,remote_}target_domain_by_id functions are wrappers around
an IS_PRIV_FOR check for the current domain. This is now redundant with
XSM hooks, so replace these calls with rcu_lock_domain_by_any_id or
rcu_lock_remote_domain_by_id to remove the duplicate permission checks.

When XSM_ENABLE is not defined or when the dummy XSM module is used,
this patch should not change any functionality. Because the locations of
privilege checks have sometimes moved below argument validation, error
returns of some functions may change from EPERM to EINVAL when called
with invalid arguments and from a domain without permission to perform
the operation.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c     | 38 +++++++++++++++----------------
 xen/arch/x86/mm.c          | 22 ++++++++----------
 xen/common/event_channel.c | 18 +++++++--------
 xen/common/grant_table.c   | 57 +++++++++++++++-------------------------------
 xen/common/memory.c        | 15 ++++++------
 xen/include/xsm/dummy.h    | 34 +++++++++++++++++++++++++++
 6 files changed, 97 insertions(+), 87 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 34da2f5..5bdde8d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3392,7 +3392,7 @@ static int hvmop_set_pci_intx_level(
     if ( (op.domain > 0) || (op.bus > 0) || (op.device > 31) || (op.intx > 3) )
         return -EINVAL;
 
-    rc = rcu_lock_remote_target_domain_by_id(op.domid, &d);
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
     if ( rc != 0 )
         return rc;
 
@@ -3559,7 +3559,7 @@ static int hvmop_set_isa_irq_level(
     if ( op.isa_irq > 15 )
         return -EINVAL;
 
-    rc = rcu_lock_remote_target_domain_by_id(op.domid, &d);
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
     if ( rc != 0 )
         return rc;
 
@@ -3603,7 +3603,7 @@ static int hvmop_set_pci_link_route(
     if ( (op.link > 3) || (op.isa_irq > 15) )
         return -EINVAL;
 
-    rc = rcu_lock_remote_target_domain_by_id(op.domid, &d);
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
     if ( rc != 0 )
         return rc;
 
@@ -3633,7 +3633,7 @@ static int hvmop_inject_msi(
     if ( copy_from_guest(&op, uop, 1) )
         return -EFAULT;
 
-    rc = rcu_lock_remote_target_domain_by_id(op.domid, &d);
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
     if ( rc != 0 )
         return rc;
 
@@ -3730,9 +3730,9 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( a.index >= HVM_NR_PARAMS )
             return -EINVAL;
 
-        rc = rcu_lock_target_domain_by_id(a.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(a.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = -EINVAL;
         if ( !is_hvm_domain(d) )
@@ -3976,7 +3976,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4015,7 +4015,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4065,9 +4065,9 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(a.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(a.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = xsm_hvm_param(d, op);
         if ( rc )
@@ -4116,7 +4116,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4195,7 +4195,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4230,7 +4230,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4266,9 +4266,9 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(a.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(a.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = -EINVAL;
         if ( !is_hvm_domain(d) || !paging_mode_shadow(d) )
@@ -4320,7 +4320,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&tr, arg, 1 ) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(tr.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(tr.domid, &d);
         if ( rc != 0 )
             return rc;
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 9c90067..b065bcf 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4389,9 +4389,9 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&xatp, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(xatp.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(xatp.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         if ( xsm_add_to_physmap(current->domain, d) )
         {
@@ -4428,9 +4428,9 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( fmap.map.nr_entries > E820MAX )
             return -EINVAL;
 
-        rc = rcu_lock_target_domain_by_id(fmap.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(fmap.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = xsm_domain_memory_map(d);
         if ( rc )
@@ -4583,16 +4583,12 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct domain *d;
         struct p2m_domain *p2m;
 
-        /* Support DOMID_SELF? */
-        if ( !IS_PRIV(current->domain) )
-            return -EPERM;
-
         if ( copy_from_guest(&target, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(target.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(target.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         if ( op == XENMEM_set_pod_target )
             rc = xsm_set_pod_target(d);
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index a80a0d1..37947a9 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -165,9 +165,9 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     domid_t        dom = alloc->dom;
     long           rc;
 
-    rc = rcu_lock_target_domain_by_id(dom, &d);
-    if ( rc )
-        return rc;
+    d = rcu_lock_domain_by_any_id(dom);
+    if ( d == NULL )
+        return -ESRCH;
 
     spin_lock(&d->event_lock);
 
@@ -798,9 +798,9 @@ static long evtchn_status(evtchn_status_t *status)
     struct evtchn   *chn;
     long             rc = 0;
 
-    rc = rcu_lock_target_domain_by_id(dom, &d);
-    if ( rc )
-        return rc;
+    d = rcu_lock_domain_by_any_id(dom);
+    if ( d == NULL )
+        return -ESRCH;
 
     spin_lock(&d->event_lock);
 
@@ -950,9 +950,9 @@ static long evtchn_reset(evtchn_reset_t *r)
     struct domain *d;
     int i, rc;
 
-    rc = rcu_lock_target_domain_by_id(dom, &d);
-    if ( rc )
-        return rc;
+    d = rcu_lock_domain_by_any_id(dom);
+    if ( d == NULL )
+        return -ESRCH;
 
     rc = xsm_evtchn_reset(current->domain, d);
     if ( rc )
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..eae9518 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -230,30 +230,6 @@ double_gt_unlock(struct grant_table *lgt, struct grant_table *rgt)
         spin_unlock(&rgt->lock);
 }
 
-static struct domain *gt_lock_target_domain_by_id(domid_t dom)
-{
-    struct domain *d;
-    int rc = GNTST_general_error;
-
-    switch ( rcu_lock_target_domain_by_id(dom, &d) )
-    {
-    case 0:
-        return d;
-
-    case -ESRCH:
-        gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
-        rc = GNTST_bad_domain;
-        break;
-
-    case -EPERM:
-        rc = GNTST_permission_denied;
-        break;
-    }
-
-    ASSERT(rc < 0 && -rc <= MAX_ERRNO);
-    return ERR_PTR(rc);
-}
-
 static inline int
 __get_maptrack_handle(
     struct grant_table *t)
@@ -1342,11 +1318,12 @@ gnttab_setup_table(
         goto out1;
     }
 
-    d = gt_lock_target_domain_by_id(op.dom);
-    if ( IS_ERR(d) )
+    d = rcu_lock_domain_by_any_id(op.dom);
+    if ( d == NULL )
     {
-        op.status = PTR_ERR(d);
-        goto out1;
+        gdprintk(XENLOG_INFO, "Bad domid %d.\n", op.dom);
+        op.status = GNTST_bad_domain;
+        goto out2;
     }
 
     if ( xsm_grant_setup(current->domain, d) )
@@ -1410,10 +1387,11 @@ gnttab_query_size(
         return -EFAULT;
     }
 
-    d = gt_lock_target_domain_by_id(op.dom);
-    if ( IS_ERR(d) )
+    d = rcu_lock_domain_by_any_id(op.dom);
+    if ( d == NULL )
     {
-        op.status = PTR_ERR(d);
+        gdprintk(XENLOG_INFO, "Bad domid %d.\n", op.dom);
+        op.status = GNTST_bad_domain;
         goto query_out;
     }
 
@@ -2283,10 +2261,10 @@ gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop,
         return -EFAULT;
     }
 
-    d = gt_lock_target_domain_by_id(op.dom);
-    if ( IS_ERR(d) )
+    d = rcu_lock_domain_by_any_id(op.dom);
+    if ( d == NULL )
     {
-        op.status = PTR_ERR(d);
+        op.status = GNTST_bad_domain;
         goto out1;
     }
     rc = xsm_grant_setup(current->domain, d);
@@ -2336,14 +2314,15 @@ gnttab_get_version(XEN_GUEST_HANDLE_PARAM(gnttab_get_version_t uop))
     if ( copy_from_guest(&op, uop, 1) )
         return -EFAULT;
 
-    rc = rcu_lock_target_domain_by_id(op.dom, &d);
-    if ( rc < 0 )
-        return rc;
+    d = rcu_lock_domain_by_any_id(op.dom);
+    if ( d == NULL )
+        return -ESRCH;
 
-    if ( xsm_grant_query_size(current->domain, d) )
+    rc = xsm_grant_query_size(current->domain, d);
+    if ( rc )
     {
         rcu_unlock_domain(d);
-        return -EPERM;
+        return rc;
     }
 
     op.version = d->grant_table->gt_version;
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..dd36b83 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -570,7 +570,8 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
              && (reservation.mem_flags & XENMEMF_populate_on_demand) )
             args.memflags |= MEMF_populate_on_demand;
 
-        if ( unlikely(rcu_lock_target_domain_by_id(reservation.domid, &d)) )
+        d = rcu_lock_domain_by_any_id(reservation.domid);
+        if ( d == NULL )
             return start_extent;
         args.domain = d;
 
@@ -619,9 +620,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&domid, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(domid, &d);
-        if ( rc )
-            return rc;
+        d = rcu_lock_domain_by_any_id(domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = xsm_memory_stat_reservation(current->domain, d);
         if ( rc )
@@ -657,9 +658,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&xrfp, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(xrfp.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(xrfp.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         if ( xsm_remove_from_physmap(current->domain, d) )
         {
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 12b1508..17128f5 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -194,6 +194,8 @@ static XSM_DEFAULT(int, grant_unmapref) (struct domain *d1, struct domain *d2)
 
 static XSM_DEFAULT(int, grant_setup) (struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
@@ -209,17 +211,23 @@ static XSM_DEFAULT(int, grant_copy) (struct domain *d1, struct domain *d2)
 
 static XSM_DEFAULT(int, grant_query_size) (struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, memory_adjust_reservation) (struct domain *d1,
                                                             struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, memory_stat_reservation) (struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
@@ -260,6 +268,8 @@ static XSM_DEFAULT(int, memory_pin_page) (struct domain *d1, struct domain *d2,
 static XSM_DEFAULT(int, evtchn_unbound) (struct domain *d, struct evtchn *chn,
                                          domid_t id2)
 {
+    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
@@ -281,11 +291,15 @@ static XSM_DEFAULT(int, evtchn_send) (struct domain *d, struct evtchn *chn)
 
 static XSM_DEFAULT(int, evtchn_status) (struct domain *d, struct evtchn *chn)
 {
+    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, evtchn_reset) (struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
@@ -306,11 +320,15 @@ static XSM_DEFAULT(char *, show_security_evtchn) (struct domain *d, const struct
 
 static XSM_DEFAULT(int, get_pod_target)(struct domain *d)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, set_pod_target)(struct domain *d)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
@@ -481,26 +499,36 @@ static XSM_DEFAULT(int, machine_address_size) (struct domain *d, uint32_t cmd)
 
 static XSM_DEFAULT(int, hvm_param) (struct domain *d, unsigned long op)
 {
+    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, hvm_set_pci_intx_level) (struct domain *d)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, hvm_set_isa_irq_level) (struct domain *d)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, hvm_set_pci_link_route) (struct domain *d)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, hvm_inject_msi) (struct domain *d)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
@@ -582,6 +610,8 @@ static XSM_DEFAULT(int, machine_memory_map) (void)
 
 static XSM_DEFAULT(int, domain_memory_map) (struct domain *d)
 {
+    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
@@ -605,11 +635,15 @@ static XSM_DEFAULT(int, update_va_mapping) (struct domain *d, struct domain *f,
 
 static XSM_DEFAULT(int, add_to_physmap) (struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, remove_from_physmap) (struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQey-0006hV-61; Fri, 16 Nov 2012 18:29:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQev-0006fR-E6
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:28:57 +0000
Received: from [85.158.139.211:17374] by server-9.bemta-5.messagelabs.com id
	93/94-29295-8E586A05; Fri, 16 Nov 2012 18:28:56 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-7.tower-206.messagelabs.com!1353090534!20053716!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16711 invoked from network); 16 Nov 2012 18:28:55 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-7.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 18:28:55 -0000
X-TM-IMSS-Message-ID: <8924ce1d000aed5e@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8924ce1d000aed5e ;
	Fri, 16 Nov 2012 13:31:35 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3d031862; 
	Fri, 16 Nov 2012 13:28:53 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:22 -0500
Message-Id: <1353090514-18537-8-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 07/19] xen: avoid calling
	rcu_lock_*target_domain when an XSM hook exists
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The rcu_lock_{,remote_}target_domain_by_id functions are wrappers around
an IS_PRIV_FOR check for the current domain. This is now redundant with
XSM hooks, so replace these calls with rcu_lock_domain_by_any_id or
rcu_lock_remote_domain_by_id to remove the duplicate permission checks.

When XSM_ENABLE is not defined or when the dummy XSM module is used,
this patch should not change any functionality. Because the locations of
privilege checks have sometimes moved below argument validation, error
returns of some functions may change from EPERM to EINVAL when called
with invalid arguments and from a domain without permission to perform
the operation.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c     | 38 +++++++++++++++----------------
 xen/arch/x86/mm.c          | 22 ++++++++----------
 xen/common/event_channel.c | 18 +++++++--------
 xen/common/grant_table.c   | 57 +++++++++++++++-------------------------------
 xen/common/memory.c        | 15 ++++++------
 xen/include/xsm/dummy.h    | 34 +++++++++++++++++++++++++++
 6 files changed, 97 insertions(+), 87 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 34da2f5..5bdde8d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3392,7 +3392,7 @@ static int hvmop_set_pci_intx_level(
     if ( (op.domain > 0) || (op.bus > 0) || (op.device > 31) || (op.intx > 3) )
         return -EINVAL;
 
-    rc = rcu_lock_remote_target_domain_by_id(op.domid, &d);
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
     if ( rc != 0 )
         return rc;
 
@@ -3559,7 +3559,7 @@ static int hvmop_set_isa_irq_level(
     if ( op.isa_irq > 15 )
         return -EINVAL;
 
-    rc = rcu_lock_remote_target_domain_by_id(op.domid, &d);
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
     if ( rc != 0 )
         return rc;
 
@@ -3603,7 +3603,7 @@ static int hvmop_set_pci_link_route(
     if ( (op.link > 3) || (op.isa_irq > 15) )
         return -EINVAL;
 
-    rc = rcu_lock_remote_target_domain_by_id(op.domid, &d);
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
     if ( rc != 0 )
         return rc;
 
@@ -3633,7 +3633,7 @@ static int hvmop_inject_msi(
     if ( copy_from_guest(&op, uop, 1) )
         return -EFAULT;
 
-    rc = rcu_lock_remote_target_domain_by_id(op.domid, &d);
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
     if ( rc != 0 )
         return rc;
 
@@ -3730,9 +3730,9 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( a.index >= HVM_NR_PARAMS )
             return -EINVAL;
 
-        rc = rcu_lock_target_domain_by_id(a.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(a.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = -EINVAL;
         if ( !is_hvm_domain(d) )
@@ -3976,7 +3976,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4015,7 +4015,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4065,9 +4065,9 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(a.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(a.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = xsm_hvm_param(d, op);
         if ( rc )
@@ -4116,7 +4116,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4195,7 +4195,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4230,7 +4230,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4266,9 +4266,9 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(a.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(a.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = -EINVAL;
         if ( !is_hvm_domain(d) || !paging_mode_shadow(d) )
@@ -4320,7 +4320,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&tr, arg, 1 ) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(tr.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(tr.domid, &d);
         if ( rc != 0 )
             return rc;
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 9c90067..b065bcf 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4389,9 +4389,9 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&xatp, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(xatp.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(xatp.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         if ( xsm_add_to_physmap(current->domain, d) )
         {
@@ -4428,9 +4428,9 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( fmap.map.nr_entries > E820MAX )
             return -EINVAL;
 
-        rc = rcu_lock_target_domain_by_id(fmap.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(fmap.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = xsm_domain_memory_map(d);
         if ( rc )
@@ -4583,16 +4583,12 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct domain *d;
         struct p2m_domain *p2m;
 
-        /* Support DOMID_SELF? */
-        if ( !IS_PRIV(current->domain) )
-            return -EPERM;
-
         if ( copy_from_guest(&target, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(target.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(target.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         if ( op == XENMEM_set_pod_target )
             rc = xsm_set_pod_target(d);
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index a80a0d1..37947a9 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -165,9 +165,9 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     domid_t        dom = alloc->dom;
     long           rc;
 
-    rc = rcu_lock_target_domain_by_id(dom, &d);
-    if ( rc )
-        return rc;
+    d = rcu_lock_domain_by_any_id(dom);
+    if ( d == NULL )
+        return -ESRCH;
 
     spin_lock(&d->event_lock);
 
@@ -798,9 +798,9 @@ static long evtchn_status(evtchn_status_t *status)
     struct evtchn   *chn;
     long             rc = 0;
 
-    rc = rcu_lock_target_domain_by_id(dom, &d);
-    if ( rc )
-        return rc;
+    d = rcu_lock_domain_by_any_id(dom);
+    if ( d == NULL )
+        return -ESRCH;
 
     spin_lock(&d->event_lock);
 
@@ -950,9 +950,9 @@ static long evtchn_reset(evtchn_reset_t *r)
     struct domain *d;
     int i, rc;
 
-    rc = rcu_lock_target_domain_by_id(dom, &d);
-    if ( rc )
-        return rc;
+    d = rcu_lock_domain_by_any_id(dom);
+    if ( d == NULL )
+        return -ESRCH;
 
     rc = xsm_evtchn_reset(current->domain, d);
     if ( rc )
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..eae9518 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -230,30 +230,6 @@ double_gt_unlock(struct grant_table *lgt, struct grant_table *rgt)
         spin_unlock(&rgt->lock);
 }
 
-static struct domain *gt_lock_target_domain_by_id(domid_t dom)
-{
-    struct domain *d;
-    int rc = GNTST_general_error;
-
-    switch ( rcu_lock_target_domain_by_id(dom, &d) )
-    {
-    case 0:
-        return d;
-
-    case -ESRCH:
-        gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
-        rc = GNTST_bad_domain;
-        break;
-
-    case -EPERM:
-        rc = GNTST_permission_denied;
-        break;
-    }
-
-    ASSERT(rc < 0 && -rc <= MAX_ERRNO);
-    return ERR_PTR(rc);
-}
-
 static inline int
 __get_maptrack_handle(
     struct grant_table *t)
@@ -1342,11 +1318,12 @@ gnttab_setup_table(
         goto out1;
     }
 
-    d = gt_lock_target_domain_by_id(op.dom);
-    if ( IS_ERR(d) )
+    d = rcu_lock_domain_by_any_id(op.dom);
+    if ( d == NULL )
     {
-        op.status = PTR_ERR(d);
-        goto out1;
+        gdprintk(XENLOG_INFO, "Bad domid %d.\n", op.dom);
+        op.status = GNTST_bad_domain;
+        goto out2;
     }
 
     if ( xsm_grant_setup(current->domain, d) )
@@ -1410,10 +1387,11 @@ gnttab_query_size(
         return -EFAULT;
     }
 
-    d = gt_lock_target_domain_by_id(op.dom);
-    if ( IS_ERR(d) )
+    d = rcu_lock_domain_by_any_id(op.dom);
+    if ( d == NULL )
     {
-        op.status = PTR_ERR(d);
+        gdprintk(XENLOG_INFO, "Bad domid %d.\n", op.dom);
+        op.status = GNTST_bad_domain;
         goto query_out;
     }
 
@@ -2283,10 +2261,10 @@ gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop,
         return -EFAULT;
     }
 
-    d = gt_lock_target_domain_by_id(op.dom);
-    if ( IS_ERR(d) )
+    d = rcu_lock_domain_by_any_id(op.dom);
+    if ( d == NULL )
     {
-        op.status = PTR_ERR(d);
+        op.status = GNTST_bad_domain;
         goto out1;
     }
     rc = xsm_grant_setup(current->domain, d);
@@ -2336,14 +2314,15 @@ gnttab_get_version(XEN_GUEST_HANDLE_PARAM(gnttab_get_version_t uop))
     if ( copy_from_guest(&op, uop, 1) )
         return -EFAULT;
 
-    rc = rcu_lock_target_domain_by_id(op.dom, &d);
-    if ( rc < 0 )
-        return rc;
+    d = rcu_lock_domain_by_any_id(op.dom);
+    if ( d == NULL )
+        return -ESRCH;
 
-    if ( xsm_grant_query_size(current->domain, d) )
+    rc = xsm_grant_query_size(current->domain, d);
+    if ( rc )
     {
         rcu_unlock_domain(d);
-        return -EPERM;
+        return rc;
     }
 
     op.version = d->grant_table->gt_version;
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..dd36b83 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -570,7 +570,8 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
              && (reservation.mem_flags & XENMEMF_populate_on_demand) )
             args.memflags |= MEMF_populate_on_demand;
 
-        if ( unlikely(rcu_lock_target_domain_by_id(reservation.domid, &d)) )
+        d = rcu_lock_domain_by_any_id(reservation.domid);
+        if ( d == NULL )
             return start_extent;
         args.domain = d;
 
@@ -619,9 +620,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&domid, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(domid, &d);
-        if ( rc )
-            return rc;
+        d = rcu_lock_domain_by_any_id(domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = xsm_memory_stat_reservation(current->domain, d);
         if ( rc )
@@ -657,9 +658,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&xrfp, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(xrfp.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(xrfp.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         if ( xsm_remove_from_physmap(current->domain, d) )
         {
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 12b1508..17128f5 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -194,6 +194,8 @@ static XSM_DEFAULT(int, grant_unmapref) (struct domain *d1, struct domain *d2)
 
 static XSM_DEFAULT(int, grant_setup) (struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
@@ -209,17 +211,23 @@ static XSM_DEFAULT(int, grant_copy) (struct domain *d1, struct domain *d2)
 
 static XSM_DEFAULT(int, grant_query_size) (struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, memory_adjust_reservation) (struct domain *d1,
                                                             struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, memory_stat_reservation) (struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
@@ -260,6 +268,8 @@ static XSM_DEFAULT(int, memory_pin_page) (struct domain *d1, struct domain *d2,
 static XSM_DEFAULT(int, evtchn_unbound) (struct domain *d, struct evtchn *chn,
                                          domid_t id2)
 {
+    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
@@ -281,11 +291,15 @@ static XSM_DEFAULT(int, evtchn_send) (struct domain *d, struct evtchn *chn)
 
 static XSM_DEFAULT(int, evtchn_status) (struct domain *d, struct evtchn *chn)
 {
+    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, evtchn_reset) (struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
@@ -306,11 +320,15 @@ static XSM_DEFAULT(char *, show_security_evtchn) (struct domain *d, const struct
 
 static XSM_DEFAULT(int, get_pod_target)(struct domain *d)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, set_pod_target)(struct domain *d)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
@@ -481,26 +499,36 @@ static XSM_DEFAULT(int, machine_address_size) (struct domain *d, uint32_t cmd)
 
 static XSM_DEFAULT(int, hvm_param) (struct domain *d, unsigned long op)
 {
+    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, hvm_set_pci_intx_level) (struct domain *d)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, hvm_set_isa_irq_level) (struct domain *d)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, hvm_set_pci_link_route) (struct domain *d)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, hvm_inject_msi) (struct domain *d)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
@@ -582,6 +610,8 @@ static XSM_DEFAULT(int, machine_memory_map) (void)
 
 static XSM_DEFAULT(int, domain_memory_map) (struct domain *d)
 {
+    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
@@ -605,11 +635,15 @@ static XSM_DEFAULT(int, update_va_mapping) (struct domain *d, struct domain *f,
 
 static XSM_DEFAULT(int, add_to_physmap) (struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, remove_from_physmap) (struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQex-0006h6-PZ; Fri, 16 Nov 2012 18:28:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQev-0006fP-D0
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:28:57 +0000
Received: from [85.158.139.211:23792] by server-4.bemta-5.messagelabs.com id
	CA/71-15011-8E586A05; Fri, 16 Nov 2012 18:28:56 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353090534!20429510!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3717 invoked from network); 16 Nov 2012 18:28:55 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-15.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 18:28:55 -0000
X-TM-IMSS-Message-ID: <8924ccb6000aed5c@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8924ccb6000aed5c ;
	Fri, 16 Nov 2012 13:31:35 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3c031862; 
	Fri, 16 Nov 2012 13:28:52 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:21 -0500
Message-Id: <1353090514-18537-7-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 06/19] xen: use XSM instead of IS_PRIV where
	duplicated
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The Xen hypervisor has two basic access control function calls: IS_PRIV
and the xsm_* functions. Most privileged operations currently require
that both checks succeed, and many times the checks are at different
locations in the code. This patch eliminates the explicit and implicit
IS_PRIV checks that are duplicated in XSM hooks.

When XSM_ENABLE is not defined or when the dummy XSM module is used,
this patch should not change any functionality. Because the locations of
privilege checks have sometimes moved below argument validation, error
returns of some functions may change from EPERM to EINVAL or ESRCH if
called with invalid arguments and from a domain without permission to
perform the operation.

Some checks are removed due to non-obvious duplicates in their callers:

 * acpi_enter_sleep is checked in XENPF_enter_acpi_sleep
 * map_domain_pirq has IS_PRIV_FOR checked in its callers:
   * physdev_map_pirq checks when acquiring the RCU lock
   * ioapic_guest_write is checked in PHYSDEVOP_apic_write
 * PHYSDEVOP_{manage_pci_add,manage_pci_add_ext,pci_device_add} are
   checked by xsm_resource_plug_pci in pci_add_device
 * PHYSDEVOP_manage_pci_remove is checked by xsm_resource_unplug_pci
   in pci_remove_device
 * PHYSDEVOP_{restore_msi,restore_msi_ext} are checked by
   xsm_resource_setup_pci in pci_restore_msi_state
 * do_console_io has changed to IS_PRIV from an explicit domid==0

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/acpi/power.c     |  2 +-
 xen/arch/x86/cpu/mcheck/mce.c |  3 ---
 xen/arch/x86/irq.c            |  3 +--
 xen/arch/x86/mm.c             |  3 ---
 xen/arch/x86/physdev.c        | 54 ++-----------------------------------------
 xen/common/kexec.c            |  3 ---
 xen/common/schedule.c         |  6 -----
 xen/drivers/char/console.c    |  6 -----
 xen/include/xsm/dummy.h       | 28 ++++++++++++++++++++++
 xen/xsm/flask/hooks.c         |  5 ++--
 10 files changed, 35 insertions(+), 78 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 9e1f989..c7b37ef 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -238,7 +238,7 @@ static long enter_state_helper(void *data)
  */
 int acpi_enter_sleep(struct xenpf_enter_acpi_sleep *sleep)
 {
-    if ( !IS_PRIV(current->domain) || !acpi_sinfo.pm1a_cnt_blk.address )
+    if ( !acpi_sinfo.pm1a_cnt_blk.address )
         return -EPERM;
 
     /* Sanity check */
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 8b54240..658774a 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1293,9 +1293,6 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
     struct xen_mc_msrinject *mc_msrinject;
     struct xen_mc_mceinject *mc_mceinject;
 
-    if (!IS_PRIV(v->domain) )
-        return x86_mcerr(NULL, -EPERM);
-
     ret = xsm_do_mca();
     if ( ret )
         return x86_mcerr(NULL, ret);
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 05cede5..238600a 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1853,8 +1853,7 @@ int map_domain_pirq(
     ASSERT(spin_is_locked(&d->event_lock));
 
     if ( !IS_PRIV(current->domain) &&
-         !(IS_PRIV_FOR(current->domain, d) &&
-           irq_access_permitted(current->domain, pirq)))
+         !irq_access_permitted(current->domain, pirq))
         return -EPERM;
 
     if ( pirq < 0 || pirq >= d->nr_pirqs || irq < 0 || irq >= nr_irqs )
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fad3d33..9c90067 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4507,9 +4507,6 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         XEN_GUEST_HANDLE_PARAM(e820entry_t) buffer_param;
         unsigned int i;
 
-        if ( !IS_PRIV(current->domain) )
-            return -EINVAL;
-
         rc = xsm_machine_memory_map();
         if ( rc )
             return rc;
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 2928f1c..3f3ac0d 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -109,12 +109,6 @@ int physdev_map_pirq(domid_t domid, int type, int *index, int *pirq_p,
     if ( ret )
         return ret;
 
-    if ( !IS_PRIV_FOR(current->domain, d) )
-    {
-        ret = -EPERM;
-        goto free_domain;
-    }
-
     /* Verify or get irq. */
     switch ( type )
     {
@@ -238,10 +232,6 @@ int physdev_unmap_pirq(domid_t domid, int pirq)
             goto free_domain;
     }
 
-    ret = -EPERM;
-    if ( !IS_PRIV_FOR(current->domain, d) )
-        goto free_domain;
-
     ret = xsm_unmap_domain_pirq(d, domain_pirq_to_irq(d, pirq));
     if ( ret )
         goto free_domain;
@@ -433,9 +423,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
         ret = xsm_apic(v->domain, cmd);
         if ( ret )
             break;
@@ -450,9 +437,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
         ret = xsm_apic(v->domain, cmd);
         if ( ret )
             break;
@@ -467,8 +451,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&irq_op, arg, 1) != 0 )
             break;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
+        ret = xsm_apic(v->domain, cmd);
+        if ( ret )
             break;
 
         /* Vector is only used by hypervisor, and dom0 shouldn't
@@ -517,9 +501,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     case PHYSDEVOP_manage_pci_add: {
         struct physdev_manage_pci manage_pci;
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
         ret = -EFAULT;
         if ( copy_from_guest(&manage_pci, arg, 1) != 0 )
             break;
@@ -530,9 +511,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     case PHYSDEVOP_manage_pci_remove: {
         struct physdev_manage_pci manage_pci;
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
         ret = -EFAULT;
         if ( copy_from_guest(&manage_pci, arg, 1) != 0 )
             break;
@@ -545,10 +523,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct physdev_manage_pci_ext manage_pci_ext;
         struct pci_dev_info pdev_info;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(current->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&manage_pci_ext, arg, 1) != 0 )
             break;
@@ -571,10 +545,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct physdev_pci_device_add add;
         struct pci_dev_info pdev_info;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(current->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&add, arg, 1) != 0 )
             break;
@@ -595,10 +565,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_pci_device_remove: {
         struct physdev_pci_device dev;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&dev, arg, 1) != 0 )
             break;
@@ -610,10 +576,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_pci_mmcfg_reserved: {
         struct physdev_pci_mmcfg_reserved info;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(current->domain) )
-            break;
-
         ret = xsm_resource_setup_misc();
         if ( ret )
             break;
@@ -631,10 +593,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct physdev_restore_msi restore_msi;
         struct pci_dev *pdev;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&restore_msi, arg, 1) != 0 )
             break;
@@ -650,10 +608,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct physdev_pci_device dev;
         struct pci_dev *pdev;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&dev, arg, 1) != 0 )
             break;
@@ -668,10 +622,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_setup_gsi: {
         struct physdev_setup_gsi setup_gsi;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&setup_gsi, arg, 1) != 0 )
             break;
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 25ebd6a..d4f6332 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -852,9 +852,6 @@ static int do_kexec_op_internal(unsigned long op,
     unsigned long flags;
     int ret = -EINVAL;
 
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-
     ret = xsm_kexec();
     if ( ret )
         return ret;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 231e097..cfd173d 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -921,12 +921,6 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             break;
 
-        if ( !IS_PRIV_FOR(current->domain, d) )
-        {
-            rcu_unlock_domain(d);
-            return -EPERM;
-        }
-
         ret = xsm_schedop_shutdown(current->domain, d);
         if ( ret )
         {
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index ff360fe..b2c3ee3 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -406,12 +406,6 @@ long do_console_io(int cmd, int count, XEN_GUEST_HANDLE_PARAM(char) buffer)
     long rc;
     unsigned int idx, len;
 
-#ifndef VERBOSE
-    /* Only domain 0 may access the emergency console. */
-    if ( current->domain->domain_id != 0 )
-        return -EPERM;
-#endif
-
     rc = xsm_console_io(current->domain, cmd);
     if ( rc )
         return rc;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 264f44b..12b1508 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -161,6 +161,8 @@ static XSM_DEFAULT(int, pm_op) (void)
 
 static XSM_DEFAULT(int, do_mca) (void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
@@ -223,6 +225,10 @@ static XSM_DEFAULT(int, memory_stat_reservation) (struct domain *d1, struct doma
 
 static XSM_DEFAULT(int, console_io) (struct domain *d, int cmd)
 {
+#ifndef VERBOSE
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+#endif
     return 0;
 }
 
@@ -233,11 +239,15 @@ static XSM_DEFAULT(int, profile) (struct domain *d, int op)
 
 static XSM_DEFAULT(int, kexec) (void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, schedop_shutdown) (struct domain *d1, struct domain *d2)
 {
+    if ( !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
@@ -336,26 +346,36 @@ static XSM_DEFAULT(int, resource_unplug_core) (void)
 
 static XSM_DEFAULT(int, resource_plug_pci) (uint32_t machine_bdf)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, resource_unplug_pci) (uint32_t machine_bdf)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, resource_setup_pci) (uint32_t machine_bdf)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, resource_setup_gsi) (int gsi)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, resource_setup_misc) (void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
@@ -396,6 +416,8 @@ static XSM_DEFAULT(int, map_domain_pirq) (struct domain *d, int irq, void *data)
 
 static XSM_DEFAULT(int, unmap_domain_pirq) (struct domain *d, int irq)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
@@ -494,6 +516,8 @@ static XSM_DEFAULT(int, mem_sharing) (struct domain *d)
 
 static XSM_DEFAULT(int, apic) (struct domain *d, int cmd)
 {
+    if ( !IS_PRIV(d) )
+        return -EPERM;
     return 0;
 }
 
@@ -534,6 +558,8 @@ static XSM_DEFAULT(int, efi_call) (void)
 
 static XSM_DEFAULT(int, acpi_sleep) (void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
@@ -549,6 +575,8 @@ static XSM_DEFAULT(int, getidletime) (void)
 
 static XSM_DEFAULT(int, machine_memory_map) (void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 31572c5..cb8cf96 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1147,10 +1147,11 @@ static int flask_apic(struct domain *d, int cmd)
 
     switch ( cmd )
     {
-    case PHYSDEVOP_APIC_READ:
+    case PHYSDEVOP_apic_read:
+    case PHYSDEVOP_alloc_irq_vector:
         perm = XEN__READAPIC;
         break;
-    case PHYSDEVOP_APIC_WRITE:
+    case PHYSDEVOP_apic_write:
         perm = XEN__WRITEAPIC;
         break;
     default:
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQex-0006h6-PZ; Fri, 16 Nov 2012 18:28:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQev-0006fP-D0
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:28:57 +0000
Received: from [85.158.139.211:23792] by server-4.bemta-5.messagelabs.com id
	CA/71-15011-8E586A05; Fri, 16 Nov 2012 18:28:56 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353090534!20429510!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3717 invoked from network); 16 Nov 2012 18:28:55 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-15.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 18:28:55 -0000
X-TM-IMSS-Message-ID: <8924ccb6000aed5c@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8924ccb6000aed5c ;
	Fri, 16 Nov 2012 13:31:35 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3c031862; 
	Fri, 16 Nov 2012 13:28:52 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:21 -0500
Message-Id: <1353090514-18537-7-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 06/19] xen: use XSM instead of IS_PRIV where
	duplicated
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The Xen hypervisor has two basic access control function calls: IS_PRIV
and the xsm_* functions. Most privileged operations currently require
that both checks succeed, and many times the checks are at different
locations in the code. This patch eliminates the explicit and implicit
IS_PRIV checks that are duplicated in XSM hooks.

When XSM_ENABLE is not defined or when the dummy XSM module is used,
this patch should not change any functionality. Because the locations of
privilege checks have sometimes moved below argument validation, error
returns of some functions may change from EPERM to EINVAL or ESRCH if
called with invalid arguments and from a domain without permission to
perform the operation.

Some checks are removed due to non-obvious duplicates in their callers:

 * acpi_enter_sleep is checked in XENPF_enter_acpi_sleep
 * map_domain_pirq has IS_PRIV_FOR checked in its callers:
   * physdev_map_pirq checks when acquiring the RCU lock
   * ioapic_guest_write is checked in PHYSDEVOP_apic_write
 * PHYSDEVOP_{manage_pci_add,manage_pci_add_ext,pci_device_add} are
   checked by xsm_resource_plug_pci in pci_add_device
 * PHYSDEVOP_manage_pci_remove is checked by xsm_resource_unplug_pci
   in pci_remove_device
 * PHYSDEVOP_{restore_msi,restore_msi_ext} are checked by
   xsm_resource_setup_pci in pci_restore_msi_state
 * do_console_io has changed to IS_PRIV from an explicit domid==0

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/acpi/power.c     |  2 +-
 xen/arch/x86/cpu/mcheck/mce.c |  3 ---
 xen/arch/x86/irq.c            |  3 +--
 xen/arch/x86/mm.c             |  3 ---
 xen/arch/x86/physdev.c        | 54 ++-----------------------------------------
 xen/common/kexec.c            |  3 ---
 xen/common/schedule.c         |  6 -----
 xen/drivers/char/console.c    |  6 -----
 xen/include/xsm/dummy.h       | 28 ++++++++++++++++++++++
 xen/xsm/flask/hooks.c         |  5 ++--
 10 files changed, 35 insertions(+), 78 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 9e1f989..c7b37ef 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -238,7 +238,7 @@ static long enter_state_helper(void *data)
  */
 int acpi_enter_sleep(struct xenpf_enter_acpi_sleep *sleep)
 {
-    if ( !IS_PRIV(current->domain) || !acpi_sinfo.pm1a_cnt_blk.address )
+    if ( !acpi_sinfo.pm1a_cnt_blk.address )
         return -EPERM;
 
     /* Sanity check */
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 8b54240..658774a 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1293,9 +1293,6 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
     struct xen_mc_msrinject *mc_msrinject;
     struct xen_mc_mceinject *mc_mceinject;
 
-    if (!IS_PRIV(v->domain) )
-        return x86_mcerr(NULL, -EPERM);
-
     ret = xsm_do_mca();
     if ( ret )
         return x86_mcerr(NULL, ret);
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 05cede5..238600a 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1853,8 +1853,7 @@ int map_domain_pirq(
     ASSERT(spin_is_locked(&d->event_lock));
 
     if ( !IS_PRIV(current->domain) &&
-         !(IS_PRIV_FOR(current->domain, d) &&
-           irq_access_permitted(current->domain, pirq)))
+         !irq_access_permitted(current->domain, pirq))
         return -EPERM;
 
     if ( pirq < 0 || pirq >= d->nr_pirqs || irq < 0 || irq >= nr_irqs )
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fad3d33..9c90067 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4507,9 +4507,6 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         XEN_GUEST_HANDLE_PARAM(e820entry_t) buffer_param;
         unsigned int i;
 
-        if ( !IS_PRIV(current->domain) )
-            return -EINVAL;
-
         rc = xsm_machine_memory_map();
         if ( rc )
             return rc;
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 2928f1c..3f3ac0d 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -109,12 +109,6 @@ int physdev_map_pirq(domid_t domid, int type, int *index, int *pirq_p,
     if ( ret )
         return ret;
 
-    if ( !IS_PRIV_FOR(current->domain, d) )
-    {
-        ret = -EPERM;
-        goto free_domain;
-    }
-
     /* Verify or get irq. */
     switch ( type )
     {
@@ -238,10 +232,6 @@ int physdev_unmap_pirq(domid_t domid, int pirq)
             goto free_domain;
     }
 
-    ret = -EPERM;
-    if ( !IS_PRIV_FOR(current->domain, d) )
-        goto free_domain;
-
     ret = xsm_unmap_domain_pirq(d, domain_pirq_to_irq(d, pirq));
     if ( ret )
         goto free_domain;
@@ -433,9 +423,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
         ret = xsm_apic(v->domain, cmd);
         if ( ret )
             break;
@@ -450,9 +437,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
         ret = xsm_apic(v->domain, cmd);
         if ( ret )
             break;
@@ -467,8 +451,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&irq_op, arg, 1) != 0 )
             break;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
+        ret = xsm_apic(v->domain, cmd);
+        if ( ret )
             break;
 
         /* Vector is only used by hypervisor, and dom0 shouldn't
@@ -517,9 +501,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     case PHYSDEVOP_manage_pci_add: {
         struct physdev_manage_pci manage_pci;
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
         ret = -EFAULT;
         if ( copy_from_guest(&manage_pci, arg, 1) != 0 )
             break;
@@ -530,9 +511,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     case PHYSDEVOP_manage_pci_remove: {
         struct physdev_manage_pci manage_pci;
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
         ret = -EFAULT;
         if ( copy_from_guest(&manage_pci, arg, 1) != 0 )
             break;
@@ -545,10 +523,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct physdev_manage_pci_ext manage_pci_ext;
         struct pci_dev_info pdev_info;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(current->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&manage_pci_ext, arg, 1) != 0 )
             break;
@@ -571,10 +545,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct physdev_pci_device_add add;
         struct pci_dev_info pdev_info;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(current->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&add, arg, 1) != 0 )
             break;
@@ -595,10 +565,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_pci_device_remove: {
         struct physdev_pci_device dev;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&dev, arg, 1) != 0 )
             break;
@@ -610,10 +576,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_pci_mmcfg_reserved: {
         struct physdev_pci_mmcfg_reserved info;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(current->domain) )
-            break;
-
         ret = xsm_resource_setup_misc();
         if ( ret )
             break;
@@ -631,10 +593,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct physdev_restore_msi restore_msi;
         struct pci_dev *pdev;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&restore_msi, arg, 1) != 0 )
             break;
@@ -650,10 +608,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct physdev_pci_device dev;
         struct pci_dev *pdev;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&dev, arg, 1) != 0 )
             break;
@@ -668,10 +622,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_setup_gsi: {
         struct physdev_setup_gsi setup_gsi;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&setup_gsi, arg, 1) != 0 )
             break;
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 25ebd6a..d4f6332 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -852,9 +852,6 @@ static int do_kexec_op_internal(unsigned long op,
     unsigned long flags;
     int ret = -EINVAL;
 
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-
     ret = xsm_kexec();
     if ( ret )
         return ret;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 231e097..cfd173d 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -921,12 +921,6 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             break;
 
-        if ( !IS_PRIV_FOR(current->domain, d) )
-        {
-            rcu_unlock_domain(d);
-            return -EPERM;
-        }
-
         ret = xsm_schedop_shutdown(current->domain, d);
         if ( ret )
         {
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index ff360fe..b2c3ee3 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -406,12 +406,6 @@ long do_console_io(int cmd, int count, XEN_GUEST_HANDLE_PARAM(char) buffer)
     long rc;
     unsigned int idx, len;
 
-#ifndef VERBOSE
-    /* Only domain 0 may access the emergency console. */
-    if ( current->domain->domain_id != 0 )
-        return -EPERM;
-#endif
-
     rc = xsm_console_io(current->domain, cmd);
     if ( rc )
         return rc;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 264f44b..12b1508 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -161,6 +161,8 @@ static XSM_DEFAULT(int, pm_op) (void)
 
 static XSM_DEFAULT(int, do_mca) (void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
@@ -223,6 +225,10 @@ static XSM_DEFAULT(int, memory_stat_reservation) (struct domain *d1, struct doma
 
 static XSM_DEFAULT(int, console_io) (struct domain *d, int cmd)
 {
+#ifndef VERBOSE
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+#endif
     return 0;
 }
 
@@ -233,11 +239,15 @@ static XSM_DEFAULT(int, profile) (struct domain *d, int op)
 
 static XSM_DEFAULT(int, kexec) (void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, schedop_shutdown) (struct domain *d1, struct domain *d2)
 {
+    if ( !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
@@ -336,26 +346,36 @@ static XSM_DEFAULT(int, resource_unplug_core) (void)
 
 static XSM_DEFAULT(int, resource_plug_pci) (uint32_t machine_bdf)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, resource_unplug_pci) (uint32_t machine_bdf)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, resource_setup_pci) (uint32_t machine_bdf)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, resource_setup_gsi) (int gsi)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, resource_setup_misc) (void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
@@ -396,6 +416,8 @@ static XSM_DEFAULT(int, map_domain_pirq) (struct domain *d, int irq, void *data)
 
 static XSM_DEFAULT(int, unmap_domain_pirq) (struct domain *d, int irq)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
@@ -494,6 +516,8 @@ static XSM_DEFAULT(int, mem_sharing) (struct domain *d)
 
 static XSM_DEFAULT(int, apic) (struct domain *d, int cmd)
 {
+    if ( !IS_PRIV(d) )
+        return -EPERM;
     return 0;
 }
 
@@ -534,6 +558,8 @@ static XSM_DEFAULT(int, efi_call) (void)
 
 static XSM_DEFAULT(int, acpi_sleep) (void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
@@ -549,6 +575,8 @@ static XSM_DEFAULT(int, getidletime) (void)
 
 static XSM_DEFAULT(int, machine_memory_map) (void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 31572c5..cb8cf96 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1147,10 +1147,11 @@ static int flask_apic(struct domain *d, int cmd)
 
     switch ( cmd )
     {
-    case PHYSDEVOP_APIC_READ:
+    case PHYSDEVOP_apic_read:
+    case PHYSDEVOP_alloc_irq_vector:
         perm = XEN__READAPIC;
         break;
-    case PHYSDEVOP_APIC_WRITE:
+    case PHYSDEVOP_apic_write:
         perm = XEN__WRITEAPIC;
         break;
     default:
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQey-0006i1-Kh; Fri, 16 Nov 2012 18:29:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQew-0006fa-3T
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:28:58 +0000
Received: from [85.158.138.51:9099] by server-9.bemta-3.messagelabs.com id
	1A/20-02388-9E586A05; Fri, 16 Nov 2012 18:28:57 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353090535!28435458!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5658 invoked from network); 16 Nov 2012 18:28:55 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-15.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:55 -0000
X-TM-IMSS-Message-ID: <89253113000aa5d3@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 89253113000aa5d3 ;
	Fri, 16 Nov 2012 13:28:29 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3f031862; 
	Fri, 16 Nov 2012 13:28:53 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:24 -0500
Message-Id: <1353090514-18537-10-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 09/19] xen: lock target domain in do_domctl
	common code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Because almost all domctls need to lock the target domain, do this by
default instead of repeating it in each domctl. This is not currently
extended to the arch-specific domctls, but RCU locks are safe to take
recursively so this only causes duplicate but correct locking.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/common/domctl.c | 268 ++++++++++++----------------------------------------
 1 file changed, 59 insertions(+), 209 deletions(-)

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 2f49eb2..536bef5 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -243,6 +243,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
     struct xen_domctl curop, *op = &curop;
+    struct domain *d;
 
     if ( copy_from_guest(op, u_domctl, 1) )
         return -EFAULT;
@@ -252,19 +253,29 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     switch ( op->cmd )
     {
+    case XEN_DOMCTL_createdomain:
+    case XEN_DOMCTL_getdomaininfo:
+    case XEN_DOMCTL_test_assign_device:
+        d = NULL;
+        break;
+    default:
+        d = rcu_lock_domain_by_id(op->domain);
+        if ( d == NULL )
+            return -ESRCH;
+    }
+
+    switch ( op->cmd )
+    {
     case XEN_DOMCTL_ioport_mapping:
     case XEN_DOMCTL_memory_mapping:
     case XEN_DOMCTL_bind_pt_irq:
     case XEN_DOMCTL_unbind_pt_irq: {
-        struct domain *d;
-        bool_t is_priv = IS_PRIV(current->domain);
-        if ( !is_priv && ((d = rcu_lock_domain_by_id(op->domain)) != NULL) )
+        bool_t is_priv = IS_PRIV_FOR(current->domain, d);
+        if ( !is_priv )
         {
-            is_priv = IS_PRIV_FOR(current->domain, d);
-            rcu_unlock_domain(d);
+            ret = -EPERM;
+            goto domctl_out_unlock;
         }
-        if ( !is_priv )
-            return -EPERM;
         break;
     }
     case XEN_DOMCTL_getdomaininfo:
@@ -276,15 +287,18 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     }
 
     if ( !domctl_lock_acquire() )
+    {
+        if ( d )
+            rcu_unlock_domain(d);
         return hypercall_create_continuation(
             __HYPERVISOR_domctl, "h", u_domctl);
+    }
 
     switch ( op->cmd )
     {
 
     case XEN_DOMCTL_setvcpucontext:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
         vcpu_guest_context_u c = { .nat = NULL };
         unsigned int vcpu = op->u.vcpucontext.vcpu;
         struct vcpu *v;
@@ -338,77 +352,48 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     svc_out:
         free_vcpu_guest_context(c.nat);
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_pausedomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-        ret = -ESRCH;
-        if ( d != NULL )
-        {
-            ret = xsm_pausedomain(d);
-            if ( ret )
-                goto pausedomain_out;
+        ret = xsm_pausedomain(d);
+        if ( ret )
+            break;
 
-            ret = -EINVAL;
-            if ( d != current->domain )
-            {
-                domain_pause_by_systemcontroller(d);
-                ret = 0;
-            }
-        pausedomain_out:
-            rcu_unlock_domain(d);
+        ret = -EINVAL;
+        if ( d != current->domain )
+        {
+            domain_pause_by_systemcontroller(d);
+            ret = 0;
         }
     }
     break;
 
     case XEN_DOMCTL_unpausedomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-
-        ret = -ESRCH;
-        if ( d == NULL )
-            break;
-
         ret = xsm_unpausedomain(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domain_unpause_by_systemcontroller(d);
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_resumedomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-
-        ret = -ESRCH;
-        if ( d == NULL )
-            break;
-
         ret = xsm_resumedomain(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domain_resume(d);
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_createdomain:
     {
-        struct domain *d;
         domid_t        dom;
         static domid_t rover = 0;
         unsigned int domcr_flags;
@@ -458,6 +443,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( IS_ERR(d) )
         {
             ret = PTR_ERR(d);
+            d = NULL;
             break;
         }
 
@@ -469,39 +455,28 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         op->domain = d->domain_id;
         if ( copy_to_guest(u_domctl, op, 1) )
             ret = -EFAULT;
+        d = NULL;
     }
     break;
 
     case XEN_DOMCTL_max_vcpus:
     {
-        struct domain *d;
         unsigned int i, max = op->u.max_vcpus.max, cpu;
         cpumask_t *online;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = -EINVAL;
         if ( (d == current->domain) || /* no domain_pause() */
              (max > MAX_VIRT_CPUS) ||
              (is_hvm_domain(d) && (max > MAX_HVM_VCPUS)) )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         ret = xsm_max_vcpus(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         /* Until Xenoprof can dynamically grow its vcpu-s array... */
         if ( d->xenoprof )
         {
-            rcu_unlock_domain(d);
             ret = -EAGAIN;
             break;
         }
@@ -576,44 +551,31 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     maxvcpu_out_novcpulock:
         domain_unpause(d);
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_destroydomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-        ret = -ESRCH;
-        if ( d != NULL )
-        {
-            ret = xsm_destroydomain(d) ? : domain_kill(d);
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_destroydomain(d) ? : domain_kill(d);
     }
     break;
 
     case XEN_DOMCTL_setvcpuaffinity:
     case XEN_DOMCTL_getvcpuaffinity:
     {
-        domid_t dom = op->domain;
-        struct domain *d = rcu_lock_domain_by_id(dom);
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( d == NULL )
-            break;
-
         ret = xsm_vcpuaffinity(op->cmd, d);
         if ( ret )
-            goto vcpuaffinity_out;
+            break;
 
         ret = -EINVAL;
         if ( op->u.vcpuaffinity.vcpu >= d->max_vcpus )
-            goto vcpuaffinity_out;
+            break;
 
         ret = -ESRCH;
         if ( (v = d->vcpu[op->u.vcpuaffinity.vcpu]) == NULL )
-            goto vcpuaffinity_out;
+            break;
 
         if ( op->cmd == XEN_DOMCTL_setvcpuaffinity )
         {
@@ -632,36 +594,23 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             ret = cpumask_to_xenctl_cpumap(
                 &op->u.vcpuaffinity.cpumap, v->cpu_affinity);
         }
-
-    vcpuaffinity_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_scheduler_op:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = xsm_scheduler(d);
         if ( ret )
-            goto scheduler_op_out;
+            break;
 
         ret = sched_adjust(d, &op->u.scheduler_op);
         if ( copy_to_guest(u_domctl, op, 1) )
             ret = -EFAULT;
-
-    scheduler_op_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_getdomaininfo:
     { 
-        struct domain *d;
         domid_t dom = op->domain;
 
         rcu_read_lock(&domlist_read_lock);
@@ -689,19 +638,15 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     getdomaininfo_out:
         rcu_read_unlock(&domlist_read_lock);
+        d = NULL;
     }
     break;
 
     case XEN_DOMCTL_getvcpucontext:
     { 
         vcpu_guest_context_u c = { .nat = NULL };
-        struct domain       *d;
         struct vcpu         *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = xsm_getvcpucontext(d);
         if ( ret )
             goto getvcpucontext_out;
@@ -750,31 +695,25 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     getvcpucontext_out:
         xfree(c.nat);
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_getvcpuinfo:
     { 
-        struct domain *d;
         struct vcpu   *v;
         struct vcpu_runstate_info runstate;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = xsm_getvcpuinfo(d);
         if ( ret )
-            goto getvcpuinfo_out;
+            break;
 
         ret = -EINVAL;
         if ( op->u.getvcpuinfo.vcpu >= d->max_vcpus )
-            goto getvcpuinfo_out;
+            break;
 
         ret = -ESRCH;
         if ( (v = d->vcpu[op->u.getvcpuinfo.vcpu]) == NULL )
-            goto getvcpuinfo_out;
+            break;
 
         vcpu_runstate_get(v, &runstate);
 
@@ -787,25 +726,16 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
         if ( copy_to_guest(u_domctl, op, 1) )
             ret = -EFAULT;
-
-    getvcpuinfo_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_max_mem:
     {
-        struct domain *d;
         unsigned long new_max;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_setdomainmaxmem(d);
         if ( ret )
-            goto max_mem_out;
+            break;
 
         ret = -EINVAL;
         new_max = op->u.max_mem.max_memkb >> (PAGE_SHIFT-10);
@@ -819,77 +749,43 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         d->max_pages = new_max;
         ret = 0;
         spin_unlock(&d->page_alloc_lock);
-
-    max_mem_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_setdomainhandle:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_setdomainhandle(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         memcpy(d->handle, op->u.setdomainhandle.handle,
                sizeof(xen_domain_handle_t));
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_setdebugging:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = -EINVAL;
         if ( d == current->domain ) /* no domain_pause() */
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         ret = xsm_setdebugging(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domain_pause(d);
         d->debugger_attached = !!op->u.setdebugging.enable;
         domain_unpause(d); /* causes guest to latch new status */
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_irq_permission:
     {
-        struct domain *d;
         unsigned int pirq = op->u.irq_permission.pirq;
         int allow = op->u.irq_permission.allow_access;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         if ( pirq >= d->nr_pirqs )
             ret = -EINVAL;
         else if ( xsm_irq_permission(d, pirq, allow) )
@@ -898,14 +794,11 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             ret = irq_permit_access(d, pirq);
         else
             ret = irq_deny_access(d, pirq);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_iomem_permission:
     {
-        struct domain *d;
         unsigned long mfn = op->u.iomem_permission.first_mfn;
         unsigned long nr_mfns = op->u.iomem_permission.nr_mfns;
         int allow = op->u.iomem_permission.allow_access;
@@ -914,125 +807,78 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
             break;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         if ( xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
         else
             ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_settimeoffset:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_domain_settime(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domain_set_time_offset(d, op->u.settimeoffset.time_offset_seconds);
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_set_target:
     {
-        struct domain *d, *e;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
+        struct domain *e;
 
         ret = -ESRCH;
         e = get_domain_by_id(op->u.set_target.target);
         if ( e == NULL )
-            goto set_target_out;
+            break;
 
         ret = -EINVAL;
         if ( (d == e) || (d->target != NULL) )
         {
             put_domain(e);
-            goto set_target_out;
+            break;
         }
 
         ret = xsm_set_target(d, e);
         if ( ret ) {
             put_domain(e);
-            goto set_target_out;            
+            break;
         }
 
         /* Hold reference on @e until we destroy @d. */
         d->target = e;
 
         ret = 0;
-
-    set_target_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_subscribe:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_domctl(d, op->cmd);
-            if ( !ret )
-                d->suspend_evtchn = op->u.subscribe.port;
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_domctl(d, op->cmd);
+        if ( !ret )
+            d->suspend_evtchn = op->u.subscribe.port;
     }
     break;
 
     case XEN_DOMCTL_disable_migrate:
     {
-        struct domain *d;
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) != NULL )
-        {
-            ret = xsm_domctl(d, op->cmd);
-            if ( !ret )
-                d->disable_migrate = op->u.disable_migrate.disable;
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_domctl(d, op->cmd);
+        if ( !ret )
+            d->disable_migrate = op->u.disable_migrate.disable;
     }
     break;
 
     case XEN_DOMCTL_set_virq_handler:
     {
-        struct domain *d;
         uint32_t virq = op->u.set_virq_handler.virq;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_set_virq_handler(d, virq);
-            if ( !ret )
-                ret = set_global_virq_handler(d, virq);
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_set_virq_handler(d, virq);
+        if ( !ret )
+            ret = set_global_virq_handler(d, virq);
     }
     break;
 
@@ -1043,6 +889,10 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     domctl_lock_release();
 
+ domctl_out_unlock:
+    if ( d )
+        rcu_unlock_domain(d);
+
     return ret;
 }
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQey-0006i1-Kh; Fri, 16 Nov 2012 18:29:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQew-0006fa-3T
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:28:58 +0000
Received: from [85.158.138.51:9099] by server-9.bemta-3.messagelabs.com id
	1A/20-02388-9E586A05; Fri, 16 Nov 2012 18:28:57 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353090535!28435458!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5658 invoked from network); 16 Nov 2012 18:28:55 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-15.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:55 -0000
X-TM-IMSS-Message-ID: <89253113000aa5d3@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 89253113000aa5d3 ;
	Fri, 16 Nov 2012 13:28:29 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3f031862; 
	Fri, 16 Nov 2012 13:28:53 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:24 -0500
Message-Id: <1353090514-18537-10-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 09/19] xen: lock target domain in do_domctl
	common code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Because almost all domctls need to lock the target domain, do this by
default instead of repeating it in each domctl. This is not currently
extended to the arch-specific domctls, but RCU locks are safe to take
recursively so this only causes duplicate but correct locking.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/common/domctl.c | 268 ++++++++++++----------------------------------------
 1 file changed, 59 insertions(+), 209 deletions(-)

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 2f49eb2..536bef5 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -243,6 +243,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
     struct xen_domctl curop, *op = &curop;
+    struct domain *d;
 
     if ( copy_from_guest(op, u_domctl, 1) )
         return -EFAULT;
@@ -252,19 +253,29 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     switch ( op->cmd )
     {
+    case XEN_DOMCTL_createdomain:
+    case XEN_DOMCTL_getdomaininfo:
+    case XEN_DOMCTL_test_assign_device:
+        d = NULL;
+        break;
+    default:
+        d = rcu_lock_domain_by_id(op->domain);
+        if ( d == NULL )
+            return -ESRCH;
+    }
+
+    switch ( op->cmd )
+    {
     case XEN_DOMCTL_ioport_mapping:
     case XEN_DOMCTL_memory_mapping:
     case XEN_DOMCTL_bind_pt_irq:
     case XEN_DOMCTL_unbind_pt_irq: {
-        struct domain *d;
-        bool_t is_priv = IS_PRIV(current->domain);
-        if ( !is_priv && ((d = rcu_lock_domain_by_id(op->domain)) != NULL) )
+        bool_t is_priv = IS_PRIV_FOR(current->domain, d);
+        if ( !is_priv )
         {
-            is_priv = IS_PRIV_FOR(current->domain, d);
-            rcu_unlock_domain(d);
+            ret = -EPERM;
+            goto domctl_out_unlock;
         }
-        if ( !is_priv )
-            return -EPERM;
         break;
     }
     case XEN_DOMCTL_getdomaininfo:
@@ -276,15 +287,18 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     }
 
     if ( !domctl_lock_acquire() )
+    {
+        if ( d )
+            rcu_unlock_domain(d);
         return hypercall_create_continuation(
             __HYPERVISOR_domctl, "h", u_domctl);
+    }
 
     switch ( op->cmd )
     {
 
     case XEN_DOMCTL_setvcpucontext:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
         vcpu_guest_context_u c = { .nat = NULL };
         unsigned int vcpu = op->u.vcpucontext.vcpu;
         struct vcpu *v;
@@ -338,77 +352,48 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     svc_out:
         free_vcpu_guest_context(c.nat);
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_pausedomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-        ret = -ESRCH;
-        if ( d != NULL )
-        {
-            ret = xsm_pausedomain(d);
-            if ( ret )
-                goto pausedomain_out;
+        ret = xsm_pausedomain(d);
+        if ( ret )
+            break;
 
-            ret = -EINVAL;
-            if ( d != current->domain )
-            {
-                domain_pause_by_systemcontroller(d);
-                ret = 0;
-            }
-        pausedomain_out:
-            rcu_unlock_domain(d);
+        ret = -EINVAL;
+        if ( d != current->domain )
+        {
+            domain_pause_by_systemcontroller(d);
+            ret = 0;
         }
     }
     break;
 
     case XEN_DOMCTL_unpausedomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-
-        ret = -ESRCH;
-        if ( d == NULL )
-            break;
-
         ret = xsm_unpausedomain(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domain_unpause_by_systemcontroller(d);
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_resumedomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-
-        ret = -ESRCH;
-        if ( d == NULL )
-            break;
-
         ret = xsm_resumedomain(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domain_resume(d);
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_createdomain:
     {
-        struct domain *d;
         domid_t        dom;
         static domid_t rover = 0;
         unsigned int domcr_flags;
@@ -458,6 +443,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( IS_ERR(d) )
         {
             ret = PTR_ERR(d);
+            d = NULL;
             break;
         }
 
@@ -469,39 +455,28 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         op->domain = d->domain_id;
         if ( copy_to_guest(u_domctl, op, 1) )
             ret = -EFAULT;
+        d = NULL;
     }
     break;
 
     case XEN_DOMCTL_max_vcpus:
     {
-        struct domain *d;
         unsigned int i, max = op->u.max_vcpus.max, cpu;
         cpumask_t *online;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = -EINVAL;
         if ( (d == current->domain) || /* no domain_pause() */
              (max > MAX_VIRT_CPUS) ||
              (is_hvm_domain(d) && (max > MAX_HVM_VCPUS)) )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         ret = xsm_max_vcpus(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         /* Until Xenoprof can dynamically grow its vcpu-s array... */
         if ( d->xenoprof )
         {
-            rcu_unlock_domain(d);
             ret = -EAGAIN;
             break;
         }
@@ -576,44 +551,31 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     maxvcpu_out_novcpulock:
         domain_unpause(d);
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_destroydomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-        ret = -ESRCH;
-        if ( d != NULL )
-        {
-            ret = xsm_destroydomain(d) ? : domain_kill(d);
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_destroydomain(d) ? : domain_kill(d);
     }
     break;
 
     case XEN_DOMCTL_setvcpuaffinity:
     case XEN_DOMCTL_getvcpuaffinity:
     {
-        domid_t dom = op->domain;
-        struct domain *d = rcu_lock_domain_by_id(dom);
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( d == NULL )
-            break;
-
         ret = xsm_vcpuaffinity(op->cmd, d);
         if ( ret )
-            goto vcpuaffinity_out;
+            break;
 
         ret = -EINVAL;
         if ( op->u.vcpuaffinity.vcpu >= d->max_vcpus )
-            goto vcpuaffinity_out;
+            break;
 
         ret = -ESRCH;
         if ( (v = d->vcpu[op->u.vcpuaffinity.vcpu]) == NULL )
-            goto vcpuaffinity_out;
+            break;
 
         if ( op->cmd == XEN_DOMCTL_setvcpuaffinity )
         {
@@ -632,36 +594,23 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             ret = cpumask_to_xenctl_cpumap(
                 &op->u.vcpuaffinity.cpumap, v->cpu_affinity);
         }
-
-    vcpuaffinity_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_scheduler_op:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = xsm_scheduler(d);
         if ( ret )
-            goto scheduler_op_out;
+            break;
 
         ret = sched_adjust(d, &op->u.scheduler_op);
         if ( copy_to_guest(u_domctl, op, 1) )
             ret = -EFAULT;
-
-    scheduler_op_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_getdomaininfo:
     { 
-        struct domain *d;
         domid_t dom = op->domain;
 
         rcu_read_lock(&domlist_read_lock);
@@ -689,19 +638,15 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     getdomaininfo_out:
         rcu_read_unlock(&domlist_read_lock);
+        d = NULL;
     }
     break;
 
     case XEN_DOMCTL_getvcpucontext:
     { 
         vcpu_guest_context_u c = { .nat = NULL };
-        struct domain       *d;
         struct vcpu         *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = xsm_getvcpucontext(d);
         if ( ret )
             goto getvcpucontext_out;
@@ -750,31 +695,25 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     getvcpucontext_out:
         xfree(c.nat);
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_getvcpuinfo:
     { 
-        struct domain *d;
         struct vcpu   *v;
         struct vcpu_runstate_info runstate;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = xsm_getvcpuinfo(d);
         if ( ret )
-            goto getvcpuinfo_out;
+            break;
 
         ret = -EINVAL;
         if ( op->u.getvcpuinfo.vcpu >= d->max_vcpus )
-            goto getvcpuinfo_out;
+            break;
 
         ret = -ESRCH;
         if ( (v = d->vcpu[op->u.getvcpuinfo.vcpu]) == NULL )
-            goto getvcpuinfo_out;
+            break;
 
         vcpu_runstate_get(v, &runstate);
 
@@ -787,25 +726,16 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
         if ( copy_to_guest(u_domctl, op, 1) )
             ret = -EFAULT;
-
-    getvcpuinfo_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_max_mem:
     {
-        struct domain *d;
         unsigned long new_max;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_setdomainmaxmem(d);
         if ( ret )
-            goto max_mem_out;
+            break;
 
         ret = -EINVAL;
         new_max = op->u.max_mem.max_memkb >> (PAGE_SHIFT-10);
@@ -819,77 +749,43 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         d->max_pages = new_max;
         ret = 0;
         spin_unlock(&d->page_alloc_lock);
-
-    max_mem_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_setdomainhandle:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_setdomainhandle(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         memcpy(d->handle, op->u.setdomainhandle.handle,
                sizeof(xen_domain_handle_t));
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_setdebugging:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = -EINVAL;
         if ( d == current->domain ) /* no domain_pause() */
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         ret = xsm_setdebugging(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domain_pause(d);
         d->debugger_attached = !!op->u.setdebugging.enable;
         domain_unpause(d); /* causes guest to latch new status */
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_irq_permission:
     {
-        struct domain *d;
         unsigned int pirq = op->u.irq_permission.pirq;
         int allow = op->u.irq_permission.allow_access;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         if ( pirq >= d->nr_pirqs )
             ret = -EINVAL;
         else if ( xsm_irq_permission(d, pirq, allow) )
@@ -898,14 +794,11 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             ret = irq_permit_access(d, pirq);
         else
             ret = irq_deny_access(d, pirq);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_iomem_permission:
     {
-        struct domain *d;
         unsigned long mfn = op->u.iomem_permission.first_mfn;
         unsigned long nr_mfns = op->u.iomem_permission.nr_mfns;
         int allow = op->u.iomem_permission.allow_access;
@@ -914,125 +807,78 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
             break;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         if ( xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
         else
             ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_settimeoffset:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_domain_settime(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domain_set_time_offset(d, op->u.settimeoffset.time_offset_seconds);
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_set_target:
     {
-        struct domain *d, *e;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
+        struct domain *e;
 
         ret = -ESRCH;
         e = get_domain_by_id(op->u.set_target.target);
         if ( e == NULL )
-            goto set_target_out;
+            break;
 
         ret = -EINVAL;
         if ( (d == e) || (d->target != NULL) )
         {
             put_domain(e);
-            goto set_target_out;
+            break;
         }
 
         ret = xsm_set_target(d, e);
         if ( ret ) {
             put_domain(e);
-            goto set_target_out;            
+            break;
         }
 
         /* Hold reference on @e until we destroy @d. */
         d->target = e;
 
         ret = 0;
-
-    set_target_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_subscribe:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_domctl(d, op->cmd);
-            if ( !ret )
-                d->suspend_evtchn = op->u.subscribe.port;
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_domctl(d, op->cmd);
+        if ( !ret )
+            d->suspend_evtchn = op->u.subscribe.port;
     }
     break;
 
     case XEN_DOMCTL_disable_migrate:
     {
-        struct domain *d;
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) != NULL )
-        {
-            ret = xsm_domctl(d, op->cmd);
-            if ( !ret )
-                d->disable_migrate = op->u.disable_migrate.disable;
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_domctl(d, op->cmd);
+        if ( !ret )
+            d->disable_migrate = op->u.disable_migrate.disable;
     }
     break;
 
     case XEN_DOMCTL_set_virq_handler:
     {
-        struct domain *d;
         uint32_t virq = op->u.set_virq_handler.virq;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_set_virq_handler(d, virq);
-            if ( !ret )
-                ret = set_global_virq_handler(d, virq);
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_set_virq_handler(d, virq);
+        if ( !ret )
+            ret = set_global_virq_handler(d, virq);
     }
     break;
 
@@ -1043,6 +889,10 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     domctl_lock_release();
 
+ domctl_out_unlock:
+    if ( d )
+        rcu_unlock_domain(d);
+
     return ret;
 }
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQez-0006iQ-4m; Fri, 16 Nov 2012 18:29:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQew-0006g1-RZ
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:28:59 +0000
Received: from [85.158.139.211:2261] by server-13.bemta-5.messagelabs.com id
	EC/B9-27809-AE586A05; Fri, 16 Nov 2012 18:28:58 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353090534!20430900!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29503 invoked from network); 16 Nov 2012 18:28:55 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-12.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 18:28:55 -0000
X-TM-IMSS-Message-ID: <8924cb8d000aed5a@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8924cb8d000aed5a ;
	Fri, 16 Nov 2012 13:31:34 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3b031862; 
	Fri, 16 Nov 2012 13:28:52 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:20 -0500
Message-Id: <1353090514-18537-6-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 05/19] xsm: Use the dummy XSM module if XSM is
	disabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch moves the implementation of the dummy XSM module to a header
file that provides inline functions when XSM_ENABLE is not defined. This
reduces duplication between the dummy module and callers when the
implementation of the dummy return is not just "return 0", and also
provides better compile-time checking for completeness of the XSM
implementations in the dummy module.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/common/domctl.c     |   2 -
 xen/include/xsm/dummy.h | 628 ++++++++++++++++++++++++++++++++++++++++++++++++
 xen/include/xsm/xsm.h   | 294 +++++++++++------------
 xen/xsm/dummy.c         | 619 +----------------------------------------------
 xen/xsm/flask/hooks.c   |   2 +-
 xen/xsm/xsm_core.c      |   2 +-
 6 files changed, 776 insertions(+), 771 deletions(-)
 create mode 100644 xen/include/xsm/dummy.h

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index a7a6b9f..2f49eb2 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -267,10 +267,8 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             return -EPERM;
         break;
     }
-#ifdef XSM_ENABLE
     case XEN_DOMCTL_getdomaininfo:
         break;
-#endif
     default:
         if ( !IS_PRIV(current->domain) )
             return -EPERM;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
new file mode 100644
index 0000000..264f44b
--- /dev/null
+++ b/xen/include/xsm/dummy.h
@@ -0,0 +1,628 @@
+/*
+ *  Default XSM hooks - IS_PRIV and IS_PRIV_FOR checks
+ *
+ *  Author: Daniel De Graaf <dgdegra@tyhco.nsa.gov>
+ *
+ *  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.
+ */
+
+#include <xen/sched.h>
+#include <xsm/xsm.h>
+
+static XSM_DEFAULT(void, security_domaininfo)(struct domain *d,
+                                    struct xen_domctl_getdomaininfo *info)
+{
+    return;
+}
+
+static XSM_DEFAULT(int, setvcpucontext)(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, pausedomain) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, unpausedomain) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, resumedomain) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, domain_create)(struct domain *d, u32 ssidref)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, max_vcpus)(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, destroydomain) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, vcpuaffinity) (int cmd, struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, scheduler) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, getdomaininfo) (struct domain *d)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
+static XSM_DEFAULT(int, getvcpucontext) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, getvcpuinfo) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, domain_settime) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, set_target) (struct domain *d, struct domain *e)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, domctl)(struct domain *d, int cmd)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, set_virq_handler)(struct domain *d, uint32_t virq)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, tbufcontrol) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, readconsole) (uint32_t clear)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, sched_id) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, setdomainmaxmem) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, setdomainhandle) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, setdebugging) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, perfcontrol) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, debug_keys) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, getcpuinfo) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, get_pmstat) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, setpminfo) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, pm_op) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, do_mca) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, availheap) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, alloc_security_domain) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(void, free_security_domain) (struct domain *d)
+{
+    return;
+}
+
+static XSM_DEFAULT(int, grant_mapref) (struct domain *d1, struct domain *d2,
+                                                                uint32_t flags)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, grant_unmapref) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, grant_setup) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, grant_transfer) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, grant_copy) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, grant_query_size) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, memory_adjust_reservation) (struct domain *d1,
+                                                            struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, memory_stat_reservation) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, console_io) (struct domain *d, int cmd)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, profile) (struct domain *d, int op)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, kexec) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, schedop_shutdown) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, memory_pin_page) (struct domain *d1, struct domain *d2,
+                                          struct page_info *page)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, evtchn_unbound) (struct domain *d, struct evtchn *chn,
+                                         domid_t id2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, evtchn_interdomain) (struct domain *d1, struct evtchn
+                                *chan1, struct domain *d2, struct evtchn *chan2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(void, evtchn_close_post) (struct evtchn *chn)
+{
+    return;
+}
+
+static XSM_DEFAULT(int, evtchn_send) (struct domain *d, struct evtchn *chn)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, evtchn_status) (struct domain *d, struct evtchn *chn)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, evtchn_reset) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, alloc_security_evtchn) (struct evtchn *chn)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(void, free_security_evtchn) (struct evtchn *chn)
+{
+    return;
+}
+
+static XSM_DEFAULT(char *, show_security_evtchn) (struct domain *d, const struct evtchn *chn)
+{
+    return NULL;
+}
+
+static XSM_DEFAULT(int, get_pod_target)(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, set_pod_target)(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, get_device_group) (uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, test_assign_device) (uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, assign_device) (struct domain *d, uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, deassign_device) (struct domain *d, uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, resource_plug_core) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, resource_unplug_core) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, resource_plug_pci) (uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, resource_unplug_pci) (uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, resource_setup_pci) (uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, resource_setup_gsi) (int gsi)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, resource_setup_misc) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, page_offline) (uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, lockprof) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, cpupool_op) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, sched_op) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(long, do_xsm_op)(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
+{
+    return -ENOSYS;
+}
+
+static XSM_DEFAULT(char *, show_irq_sid) (int irq)
+{
+    return NULL;
+}
+
+static XSM_DEFAULT(int, map_domain_pirq) (struct domain *d, int irq, void *data)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, unmap_domain_pirq) (struct domain *d, int irq)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, irq_permission) (struct domain *d, int pirq, uint8_t allow)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, iomem_permission) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, pci_config_permission) (struct domain *d, uint32_t machine_bdf,
+                                        uint16_t start, uint16_t end,
+                                        uint8_t access)
+{
+    return 0;
+}
+
+#ifdef CONFIG_X86
+static XSM_DEFAULT(int, shadow_control) (struct domain *d, uint32_t op)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, getpageframeinfo) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, getmemlist) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, hypercall_init) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, hvmcontext) (struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, address_size) (struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, machine_address_size) (struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, hvm_param) (struct domain *d, unsigned long op)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, hvm_set_pci_intx_level) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, hvm_set_isa_irq_level) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, hvm_set_pci_link_route) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, hvm_inject_msi) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, mem_event) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, mem_sharing) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, apic) (struct domain *d, int cmd)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, xen_settime) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, memtype) (uint32_t access)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, microcode) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, physinfo) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, platform_quirk) (uint32_t quirk)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, firmware_info) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, efi_call) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, acpi_sleep) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, change_freq) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, getidletime) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, machine_memory_map) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, domain_memory_map) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, mmu_normal_update) (struct domain *d, struct domain *t,
+                                            struct domain *f, intpte_t fpte)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, mmu_machphys_update) (struct domain *d, struct domain *f,
+                                              unsigned long mfn)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, update_va_mapping) (struct domain *d, struct domain *f, 
+                                                            l1_pgentry_t pte)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, add_to_physmap) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, remove_from_physmap) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, sendtrigger) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, pin_mem_cacheattr) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, ext_vcpucontext) (struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, vcpuextstate) (struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+{
+    return 0;
+}
+
+#endif
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 2560229..5c3065b 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -21,12 +21,6 @@
 typedef void xsm_op_t;
 DEFINE_XEN_GUEST_HANDLE(xsm_op_t);
 
-#ifdef XSM_ENABLE
-    #define xsm_call(fn) xsm_ops->fn
-#else
-    #define xsm_call(fn) 0
-#endif
-
 /* policy magic number (defined by XSM_MAGIC) */
 typedef u32 xsm_magic_t;
 #ifndef XSM_MAGIC
@@ -141,7 +135,7 @@ struct xsm_operations {
     int (*cpupool_op)(void);
     int (*sched_op)(void);
 
-    long (*__do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
+    long (*do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
 
 #ifdef CONFIG_X86
     int (*shadow_control) (struct domain *d, uint32_t op);
@@ -187,645 +181,643 @@ struct xsm_operations {
 #endif
 };
 
-#endif
-
 extern struct xsm_operations *xsm_ops;
 
 static inline void xsm_security_domaininfo (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info)
 {
-    (void)xsm_call(security_domaininfo(d, info));
+    xsm_ops->security_domaininfo(d, info);
 }
 
 static inline int xsm_setvcpucontext(struct domain *d)
 {
-    return xsm_call(setvcpucontext(d));
+    return xsm_ops->setvcpucontext(d);
 }
 
 static inline int xsm_pausedomain (struct domain *d)
 {
-    return xsm_call(pausedomain(d));
+    return xsm_ops->pausedomain(d);
 }
 
 static inline int xsm_unpausedomain (struct domain *d)
 {
-    return xsm_call(unpausedomain(d));
+    return xsm_ops->unpausedomain(d);
 }
 
 static inline int xsm_resumedomain (struct domain *d)
 {
-    return xsm_call(resumedomain(d));
+    return xsm_ops->resumedomain(d);
 }
 
 static inline int xsm_domain_create (struct domain *d, u32 ssidref)
 {
-    return xsm_call(domain_create(d, ssidref));
+    return xsm_ops->domain_create(d, ssidref);
 }
 
 static inline int xsm_max_vcpus(struct domain *d)
 {
-    return xsm_call(max_vcpus(d));
+    return xsm_ops->max_vcpus(d);
 }
 
 static inline int xsm_destroydomain (struct domain *d)
 {
-    return xsm_call(destroydomain(d));
+    return xsm_ops->destroydomain(d);
 }
 
 static inline int xsm_vcpuaffinity (int cmd, struct domain *d)
 {
-    return xsm_call(vcpuaffinity(cmd, d));
+    return xsm_ops->vcpuaffinity(cmd, d);
 }
 
 static inline int xsm_scheduler (struct domain *d)
 {
-    return xsm_call(scheduler(d));
+    return xsm_ops->scheduler(d);
 }
 
 static inline int xsm_getdomaininfo (struct domain *d)
 {
-    return xsm_call(getdomaininfo(d));
+    return xsm_ops->getdomaininfo(d);
 }
 
 static inline int xsm_getvcpucontext (struct domain *d)
 {
-    return xsm_call(getvcpucontext(d));
+    return xsm_ops->getvcpucontext(d);
 }
 
 static inline int xsm_getvcpuinfo (struct domain *d)
 {
-    return xsm_call(getvcpuinfo(d));
+    return xsm_ops->getvcpuinfo(d);
 }
 
 static inline int xsm_domain_settime (struct domain *d)
 {
-    return xsm_call(domain_settime(d));
+    return xsm_ops->domain_settime(d);
 }
 
 static inline int xsm_set_target (struct domain *d, struct domain *e)
 {
-    return xsm_call(set_target(d, e));
+    return xsm_ops->set_target(d, e);
 }
 
 static inline int xsm_domctl (struct domain *d, int cmd)
 {
-    return xsm_call(domctl(d, cmd));
+    return xsm_ops->domctl(d, cmd);
 }
 
 static inline int xsm_set_virq_handler (struct domain *d, uint32_t virq)
 {
-    return xsm_call(set_virq_handler(d, virq));
+    return xsm_ops->set_virq_handler(d, virq);
 }
 
 static inline int xsm_tbufcontrol (void)
 {
-    return xsm_call(tbufcontrol());
+    return xsm_ops->tbufcontrol();
 }
 
 static inline int xsm_readconsole (uint32_t clear)
 {
-    return xsm_call(readconsole(clear));
+    return xsm_ops->readconsole(clear);
 }
 
 static inline int xsm_sched_id (void)
 {
-    return xsm_call(sched_id());
+    return xsm_ops->sched_id();
 }
 
 static inline int xsm_setdomainmaxmem (struct domain *d)
 {
-    return xsm_call(setdomainmaxmem(d));
+    return xsm_ops->setdomainmaxmem(d);
 }
 
 static inline int xsm_setdomainhandle (struct domain *d)
 {
-    return xsm_call(setdomainhandle(d));
+    return xsm_ops->setdomainhandle(d);
 }
 
 static inline int xsm_setdebugging (struct domain *d)
 {
-    return xsm_call(setdebugging(d));
+    return xsm_ops->setdebugging(d);
 }
 
 static inline int xsm_perfcontrol (void)
 {
-    return xsm_call(perfcontrol());
+    return xsm_ops->perfcontrol();
 }
 
 static inline int xsm_debug_keys (void)
 {
-    return xsm_call(debug_keys());
+    return xsm_ops->debug_keys();
 }
 
 static inline int xsm_availheap (void)
 {
-    return xsm_call(availheap());
+    return xsm_ops->availheap();
 }
 
 static inline int xsm_getcpuinfo (void)
 {
-    return xsm_call(getcpuinfo());
+    return xsm_ops->getcpuinfo();
 }
 
 static inline int xsm_get_pmstat(void)
 {
-    return xsm_call(get_pmstat());
+    return xsm_ops->get_pmstat();
 }
 
 static inline int xsm_setpminfo(void)
 {
-	return xsm_call(setpminfo());
+    return xsm_ops->setpminfo();
 }
 
 static inline int xsm_pm_op(void)
 {
-    return xsm_call(pm_op());
+    return xsm_ops->pm_op();
 }
 
 static inline int xsm_do_mca(void)
 {
-    return xsm_call(do_mca());
+    return xsm_ops->do_mca();
 }
 
 static inline int xsm_evtchn_unbound (struct domain *d1, struct evtchn *chn,
                                                                     domid_t id2)
 {
-    return xsm_call(evtchn_unbound(d1, chn, id2));
+    return xsm_ops->evtchn_unbound(d1, chn, id2);
 }
 
 static inline int xsm_evtchn_interdomain (struct domain *d1, 
                 struct evtchn *chan1, struct domain *d2, struct evtchn *chan2)
 {
-    return xsm_call(evtchn_interdomain(d1, chan1, d2, chan2));
+    return xsm_ops->evtchn_interdomain(d1, chan1, d2, chan2);
 }
 
 static inline void xsm_evtchn_close_post (struct evtchn *chn)
 {
-    (void)xsm_call(evtchn_close_post(chn));
+    xsm_ops->evtchn_close_post(chn);
 }
 
 static inline int xsm_evtchn_send (struct domain *d, struct evtchn *chn)
 {
-    return xsm_call(evtchn_send(d, chn));
+    return xsm_ops->evtchn_send(d, chn);
 }
 
 static inline int xsm_evtchn_status (struct domain *d, struct evtchn *chn)
 {
-    return xsm_call(evtchn_status(d, chn));
+    return xsm_ops->evtchn_status(d, chn);
 }
 
 static inline int xsm_evtchn_reset (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(evtchn_reset(d1, d2));
+    return xsm_ops->evtchn_reset(d1, d2);
 }
 
 static inline int xsm_grant_mapref (struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
-    return xsm_call(grant_mapref(d1, d2, flags));
+    return xsm_ops->grant_mapref(d1, d2, flags);
 }
 
 static inline int xsm_grant_unmapref (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_unmapref(d1, d2));
+    return xsm_ops->grant_unmapref(d1, d2);
 }
 
 static inline int xsm_grant_setup (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_setup(d1, d2));
+    return xsm_ops->grant_setup(d1, d2);
 }
 
 static inline int xsm_grant_transfer (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_transfer(d1, d2));
+    return xsm_ops->grant_transfer(d1, d2);
 }
 
 static inline int xsm_grant_copy (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_copy(d1, d2));
+    return xsm_ops->grant_copy(d1, d2);
 }
 
 static inline int xsm_grant_query_size (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_query_size(d1, d2));
+    return xsm_ops->grant_query_size(d1, d2);
 }
 
 static inline int xsm_alloc_security_domain (struct domain *d)
 {
-    return xsm_call(alloc_security_domain(d));
+    return xsm_ops->alloc_security_domain(d);
 }
 
 static inline void xsm_free_security_domain (struct domain *d)
 {
-    (void)xsm_call(free_security_domain(d));
+    xsm_ops->free_security_domain(d);
 }
 
 static inline int xsm_alloc_security_evtchn (struct evtchn *chn)
 {
-    return xsm_call(alloc_security_evtchn(chn));
+    return xsm_ops->alloc_security_evtchn(chn);
 }
 
 static inline void xsm_free_security_evtchn (struct evtchn *chn)
 {
-    (void)xsm_call(free_security_evtchn(chn));
+    (void)xsm_ops->free_security_evtchn(chn);
 }
 
 static inline char *xsm_show_security_evtchn (struct domain *d, const struct evtchn *chn)
 {
-    return xsm_call(show_security_evtchn(d, chn));
+    return xsm_ops->show_security_evtchn(d, chn);
 }
 
 static inline int xsm_get_pod_target (struct domain *d)
 {
-    return xsm_call(get_pod_target(d));
+    return xsm_ops->get_pod_target(d);
 }
 
 static inline int xsm_set_pod_target (struct domain *d)
 {
-    return xsm_call(set_pod_target(d));
+    return xsm_ops->set_pod_target(d);
 }
 
 static inline int xsm_memory_adjust_reservation (struct domain *d1, struct
                                                                     domain *d2)
 {
-    return xsm_call(memory_adjust_reservation(d1, d2));
+    return xsm_ops->memory_adjust_reservation(d1, d2);
 }
 
 static inline int xsm_memory_stat_reservation (struct domain *d1,
                                                             struct domain *d2)
 {
-    return xsm_call(memory_stat_reservation(d1, d2));
+    return xsm_ops->memory_stat_reservation(d1, d2);
 }
 
 static inline int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
                                       struct page_info *page)
 {
-    return xsm_call(memory_pin_page(d1, d2, page));
+    return xsm_ops->memory_pin_page(d1, d2, page);
 }
 
 static inline int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
-    return xsm_call(remove_from_physmap(d1, d2));
+    return xsm_ops->remove_from_physmap(d1, d2);
 }
 
 static inline int xsm_console_io (struct domain *d, int cmd)
 {
-    return xsm_call(console_io(d, cmd));
+    return xsm_ops->console_io(d, cmd);
 }
 
 static inline int xsm_profile (struct domain *d, int op)
 {
-    return xsm_call(profile(d, op));
+    return xsm_ops->profile(d, op);
 }
 
 static inline int xsm_kexec (void)
 {
-    return xsm_call(kexec());
+    return xsm_ops->kexec();
 }
 
 static inline int xsm_schedop_shutdown (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(schedop_shutdown(d1, d2));
+    return xsm_ops->schedop_shutdown(d1, d2);
 }
 
 static inline char *xsm_show_irq_sid (int irq)
 {
-    return xsm_call(show_irq_sid(irq));
+    return xsm_ops->show_irq_sid(irq);
 }
 
 static inline int xsm_map_domain_pirq (struct domain *d, int irq, void *data)
 {
-    return xsm_call(map_domain_pirq(d, irq, data));
+    return xsm_ops->map_domain_pirq(d, irq, data);
 }
 
 static inline int xsm_unmap_domain_pirq (struct domain *d, int irq)
 {
-    return xsm_call(unmap_domain_pirq(d, irq));
+    return xsm_ops->unmap_domain_pirq(d, irq);
 }
 
 static inline int xsm_irq_permission (struct domain *d, int pirq, uint8_t allow)
 {
-    return xsm_call(irq_permission(d, pirq, allow));
+    return xsm_ops->irq_permission(d, pirq, allow);
 }
 
 static inline int xsm_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return xsm_call(iomem_permission(d, s, e, allow));
+    return xsm_ops->iomem_permission(d, s, e, allow);
 }
 
 static inline int xsm_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return xsm_call(iomem_mapping(d, s, e, allow));
+    return xsm_ops->iomem_mapping(d, s, e, allow);
 }
 
 static inline int xsm_pci_config_permission (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
-    return xsm_call(pci_config_permission(d, machine_bdf, start, end, access));
+    return xsm_ops->pci_config_permission(d, machine_bdf, start, end, access);
 }
 
 static inline int xsm_get_device_group(uint32_t machine_bdf)
 {
-    return xsm_call(get_device_group(machine_bdf));
+    return xsm_ops->get_device_group(machine_bdf);
 }
 
 static inline int xsm_test_assign_device(uint32_t machine_bdf)
 {
-    return xsm_call(test_assign_device(machine_bdf));
+    return xsm_ops->test_assign_device(machine_bdf);
 }
 
 static inline int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
 {
-    return xsm_call(assign_device(d, machine_bdf));
+    return xsm_ops->assign_device(d, machine_bdf);
 }
 
 static inline int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
-    return xsm_call(deassign_device(d, machine_bdf));
+    return xsm_ops->deassign_device(d, machine_bdf);
 }
 
 static inline int xsm_resource_plug_pci (uint32_t machine_bdf)
 {
-    return xsm_call(resource_plug_pci(machine_bdf));
+    return xsm_ops->resource_plug_pci(machine_bdf);
 }
 
 static inline int xsm_resource_unplug_pci (uint32_t machine_bdf)
 {
-    return xsm_call(resource_unplug_pci(machine_bdf));
+    return xsm_ops->resource_unplug_pci(machine_bdf);
 }
 
 static inline int xsm_resource_plug_core (void)
 {
-    return xsm_call(resource_plug_core());
+    return xsm_ops->resource_plug_core();
 }
 
 static inline int xsm_resource_unplug_core (void)
 {
-    return xsm_call(resource_unplug_core());
+    return xsm_ops->resource_unplug_core();
 }
 
 static inline int xsm_resource_setup_pci (uint32_t machine_bdf)
 {
-    return xsm_call(resource_setup_pci(machine_bdf));
+    return xsm_ops->resource_setup_pci(machine_bdf);
 }
 
 static inline int xsm_resource_setup_gsi (int gsi)
 {
-    return xsm_call(resource_setup_gsi(gsi));
+    return xsm_ops->resource_setup_gsi(gsi);
 }
 
 static inline int xsm_resource_setup_misc (void)
 {
-    return xsm_call(resource_setup_misc());
+    return xsm_ops->resource_setup_misc();
 }
 
 static inline int xsm_page_offline(uint32_t cmd)
 {
-    return xsm_call(page_offline(cmd));
+    return xsm_ops->page_offline(cmd);
 }
 
 static inline int xsm_lockprof(void)
 {
-    return xsm_call(lockprof());
+    return xsm_ops->lockprof();
 }
 
 static inline int xsm_cpupool_op(void)
 {
-    return xsm_call(cpupool_op());
+    return xsm_ops->cpupool_op();
 }
 
 static inline int xsm_sched_op(void)
 {
-    return xsm_call(sched_op());
-}
-
-static inline long __do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
-{
-#ifdef XSM_ENABLE
-    return xsm_ops->__do_xsm_op(op);
-#else
-    return -ENOSYS;
-#endif
+    return xsm_ops->sched_op();
 }
 
-#ifdef XSM_ENABLE
-extern int xsm_init(unsigned long *module_map, const multiboot_info_t *mbi,
-                    void *(*bootstrap_map)(const module_t *));
-extern int xsm_policy_init(unsigned long *module_map,
-                           const multiboot_info_t *mbi,
-                           void *(*bootstrap_map)(const module_t *));
-extern int register_xsm(struct xsm_operations *ops);
-extern int unregister_xsm(struct xsm_operations *ops);
-#else
-static inline int xsm_init (unsigned long *module_map,
-                            const multiboot_info_t *mbi,
-                            void *(*bootstrap_map)(const module_t *))
+static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
-    return 0;
+    return xsm_ops->do_xsm_op(op);
 }
-#endif
 
 #ifdef CONFIG_X86
 static inline int xsm_shadow_control (struct domain *d, uint32_t op)
 {
-    return xsm_call(shadow_control(d, op));
+    return xsm_ops->shadow_control(d, op);
 }
 
 static inline int xsm_getpageframeinfo (struct domain *d)
 {
-    return xsm_call(getpageframeinfo(d));
+    return xsm_ops->getpageframeinfo(d);
 }
 
 static inline int xsm_getmemlist (struct domain *d)
 {
-    return xsm_call(getmemlist(d));
+    return xsm_ops->getmemlist(d);
 }
 
 static inline int xsm_hypercall_init (struct domain *d)
 {
-    return xsm_call(hypercall_init(d));
+    return xsm_ops->hypercall_init(d);
 }
 
 static inline int xsm_hvmcontext (struct domain *d, uint32_t cmd)
 {
-    return xsm_call(hvmcontext(d, cmd));
+    return xsm_ops->hvmcontext(d, cmd);
 }
 
 static inline int xsm_address_size (struct domain *d, uint32_t cmd)
 {
-    return xsm_call(address_size(d, cmd));
+    return xsm_ops->address_size(d, cmd);
 }
 
 static inline int xsm_machine_address_size (struct domain *d, uint32_t cmd)
 {
-    return xsm_call(machine_address_size(d, cmd));
+    return xsm_ops->machine_address_size(d, cmd);
 }
 
 static inline int xsm_hvm_param (struct domain *d, unsigned long op)
 {
-    return xsm_call(hvm_param(d, op));
+    return xsm_ops->hvm_param(d, op);
 }
 
 static inline int xsm_hvm_set_pci_intx_level (struct domain *d)
 {
-    return xsm_call(hvm_set_pci_intx_level(d));
+    return xsm_ops->hvm_set_pci_intx_level(d);
 }
 
 static inline int xsm_hvm_set_isa_irq_level (struct domain *d)
 {
-    return xsm_call(hvm_set_isa_irq_level(d));
+    return xsm_ops->hvm_set_isa_irq_level(d);
 }
 
 static inline int xsm_hvm_set_pci_link_route (struct domain *d)
 {
-    return xsm_call(hvm_set_pci_link_route(d));
+    return xsm_ops->hvm_set_pci_link_route(d);
 }
 
 static inline int xsm_hvm_inject_msi (struct domain *d)
 {
-    return xsm_call(hvm_inject_msi(d));
+    return xsm_ops->hvm_inject_msi(d);
 }
 
 static inline int xsm_mem_event (struct domain *d)
 {
-    return xsm_call(mem_event(d));
+    return xsm_ops->mem_event(d);
 }
 
 static inline int xsm_mem_sharing (struct domain *d)
 {
-    return xsm_call(mem_sharing(d));
+    return xsm_ops->mem_sharing(d);
 }
 
 static inline int xsm_apic (struct domain *d, int cmd)
 {
-    return xsm_call(apic(d, cmd));
+    return xsm_ops->apic(d, cmd);
 }
 
 static inline int xsm_xen_settime (void)
 {
-    return xsm_call(xen_settime());
+    return xsm_ops->xen_settime();
 }
 
 static inline int xsm_memtype (uint32_t access)
 {
-    return xsm_call(memtype(access));
+    return xsm_ops->memtype(access);
 }
 
 static inline int xsm_microcode (void)
 {
-    return xsm_call(microcode());
+    return xsm_ops->microcode();
 }
 
 static inline int xsm_physinfo (void)
 {
-    return xsm_call(physinfo());
+    return xsm_ops->physinfo();
 }
 
 static inline int xsm_platform_quirk (uint32_t quirk)
 {
-    return xsm_call(platform_quirk(quirk));
+    return xsm_ops->platform_quirk(quirk);
 }
 
 static inline int xsm_firmware_info (void)
 {
-    return xsm_call(firmware_info());
+    return xsm_ops->firmware_info();
 }
 
 static inline int xsm_efi_call (void)
 {
-    return xsm_call(efi_call());
+    return xsm_ops->efi_call();
 }
 
 static inline int xsm_acpi_sleep (void)
 {
-    return xsm_call(acpi_sleep());
+    return xsm_ops->acpi_sleep();
 }
 
 static inline int xsm_change_freq (void)
 {
-    return xsm_call(change_freq());
+    return xsm_ops->change_freq();
 }
 
 static inline int xsm_getidletime (void)
 {
-    return xsm_call(getidletime());
+    return xsm_ops->getidletime();
 }
 
 static inline int xsm_machine_memory_map(void)
 {
-    return xsm_call(machine_memory_map());
+    return xsm_ops->machine_memory_map();
 }
 
 static inline int xsm_domain_memory_map(struct domain *d)
 {
-    return xsm_call(domain_memory_map(d));
+    return xsm_ops->domain_memory_map(d);
 }
 
 static inline int xsm_mmu_normal_update (struct domain *d, struct domain *t,
                                          struct domain *f, intpte_t fpte)
 {
-    return xsm_call(mmu_normal_update(d, t, f, fpte));
+    return xsm_ops->mmu_normal_update(d, t, f, fpte);
 }
 
 static inline int xsm_mmu_machphys_update (struct domain *d1, struct domain *d2,
                                            unsigned long mfn)
 {
-    return xsm_call(mmu_machphys_update(d1, d2, mfn));
+    return xsm_ops->mmu_machphys_update(d1, d2, mfn);
 }
 
 static inline int xsm_update_va_mapping(struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
-    return xsm_call(update_va_mapping(d, f, pte));
+    return xsm_ops->update_va_mapping(d, f, pte);
 }
 
 static inline int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
 {
-    return xsm_call(add_to_physmap(d1, d2));
+    return xsm_ops->add_to_physmap(d1, d2);
 }
 
 static inline int xsm_sendtrigger(struct domain *d)
 {
-    return xsm_call(sendtrigger(d));
+    return xsm_ops->sendtrigger(d);
 }
 
 static inline int xsm_bind_pt_irq(struct domain *d, 
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_call(bind_pt_irq(d, bind));
+    return xsm_ops->bind_pt_irq(d, bind);
 }
 
 static inline int xsm_unbind_pt_irq(struct domain *d,
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_call(unbind_pt_irq(d, bind));
+    return xsm_ops->unbind_pt_irq(d, bind);
 }
 
 static inline int xsm_pin_mem_cacheattr(struct domain *d)
 {
-    return xsm_call(pin_mem_cacheattr(d));
+    return xsm_ops->pin_mem_cacheattr(d);
 }
 
 static inline int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
 {
-    return xsm_call(ext_vcpucontext(d, cmd));
+    return xsm_ops->ext_vcpucontext(d, cmd);
 }
 static inline int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
 {
-    return xsm_call(vcpuextstate(d, cmd));
+    return xsm_ops->vcpuextstate(d, cmd);
 }
 
 static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return xsm_call(ioport_permission(d, s, e, allow));
+    return xsm_ops->ioport_permission(d, s, e, allow);
 }
 
 static inline int xsm_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return xsm_call(ioport_mapping(d, s, e, allow));
+    return xsm_ops->ioport_mapping(d, s, e, allow);
 }
 #endif /* CONFIG_X86 */
 
+extern int xsm_init(unsigned long *module_map, const multiboot_info_t *mbi,
+                    void *(*bootstrap_map)(const module_t *));
+extern int xsm_policy_init(unsigned long *module_map,
+                           const multiboot_info_t *mbi,
+                           void *(*bootstrap_map)(const module_t *));
+extern int register_xsm(struct xsm_operations *ops);
+extern int unregister_xsm(struct xsm_operations *ops);
+
 extern struct xsm_operations dummy_xsm_ops;
 extern void xsm_fixup_ops(struct xsm_operations *ops);
 
+#else /* XSM_ENABLE */
+
+#define XSM_DEFAULT(type, name) inline type xsm_ ## name
+#include <xsm/dummy.h>
+
+static inline int xsm_init (unsigned long *module_map,
+                            const multiboot_info_t *mbi,
+                            void *(*bootstrap_map)(const module_t *))
+{
+    return 0;
+}
+#endif /* XSM_ENABLE */
+
 #endif /* __XSM_H */
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 5f078d2..47192d7 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -10,621 +10,8 @@
  *  as published by the Free Software Foundation.
  */
 
-#include <xen/sched.h>
-#include <xsm/xsm.h>
-
-static void dummy_security_domaininfo(struct domain *d,
-                                    struct xen_domctl_getdomaininfo *info)
-{
-    return;
-}
-
-static int dummy_setvcpucontext(struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_pausedomain (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_unpausedomain (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_resumedomain (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_domain_create(struct domain *d, u32 ssidref)
-{
-    return 0;
-}
-
-static int dummy_max_vcpus(struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_destroydomain (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_vcpuaffinity (int cmd, struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_scheduler (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_getdomaininfo (struct domain *d)
-{
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
-}
-
-static int dummy_getvcpucontext (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_getvcpuinfo (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_domain_settime (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_set_target (struct domain *d, struct domain *e)
-{
-    return 0;
-}
-
-static int dummy_domctl(struct domain *d, int cmd)
-{
-    return 0;
-}
-
-static int dummy_set_virq_handler(struct domain *d, uint32_t virq)
-{
-    return 0;
-}
-
-static int dummy_tbufcontrol (void)
-{
-    return 0;
-}
-
-static int dummy_readconsole (uint32_t clear)
-{
-    return 0;
-}
-
-static int dummy_sched_id (void)
-{
-    return 0;
-}
-
-static int dummy_setdomainmaxmem (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_setdomainhandle (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_setdebugging (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_perfcontrol (void)
-{
-    return 0;
-}
-
-static int dummy_debug_keys (void)
-{
-    return 0;
-}
-
-static int dummy_getcpuinfo (void)
-{
-    return 0;
-}
-
-static int dummy_get_pmstat (void)
-{
-    return 0;
-}
-
-static int dummy_setpminfo (void)
-{
-    return 0;
-}
-
-static int dummy_pm_op (void)
-{
-    return 0;
-}
-
-static int dummy_do_mca (void)
-{
-    return 0;
-}
-
-static int dummy_availheap (void)
-{
-    return 0;
-}
-
-static int dummy_alloc_security_domain (struct domain *d)
-{
-    return 0;
-}
-
-static void dummy_free_security_domain (struct domain *d)
-{
-    return;
-}
-
-static int dummy_grant_mapref (struct domain *d1, struct domain *d2,
-                                                                uint32_t flags)
-{
-    return 0;
-}
-
-static int dummy_grant_unmapref (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_grant_setup (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_grant_transfer (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_grant_copy (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_grant_query_size (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_memory_adjust_reservation (struct domain *d1,
-                                                            struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_memory_stat_reservation (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_console_io (struct domain *d, int cmd)
-{
-    return 0;
-}
-
-static int dummy_profile (struct domain *d, int op)
-{
-    return 0;
-}
-
-static int dummy_kexec (void)
-{
-    return 0;
-}
-
-static int dummy_schedop_shutdown (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_memory_pin_page(struct domain *d1, struct domain *d2, struct page_info *page)
-{
-    return 0;
-}
-
-static int dummy_evtchn_unbound (struct domain *d, struct evtchn *chn,
-                                                                    domid_t id2)
-{
-    return 0;
-}
-
-static int dummy_evtchn_interdomain (struct domain *d1, struct evtchn
-                                *chan1, struct domain *d2, struct evtchn *chan2)
-{
-    return 0;
-}
-
-static void dummy_evtchn_close_post (struct evtchn *chn)
-{
-    return;
-}
-
-static int dummy_evtchn_send (struct domain *d, struct evtchn *chn)
-{
-    return 0;
-}
-
-static int dummy_evtchn_status (struct domain *d, struct evtchn *chn)
-{
-    return 0;
-}
-
-static int dummy_evtchn_reset (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_alloc_security_evtchn (struct evtchn *chn)
-{
-    return 0;
-}
-
-static void dummy_free_security_evtchn (struct evtchn *chn)
-{
-    return;
-}
-
-static char *dummy_show_security_evtchn (struct domain *d, const struct evtchn *chn)
-{
-    return NULL;
-}
-
-static int dummy_get_pod_target(struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_set_pod_target(struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_get_device_group (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_test_assign_device (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_assign_device (struct domain *d, uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_deassign_device (struct domain *d, uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_resource_plug_core (void)
-{
-    return 0;
-}
-
-static int dummy_resource_unplug_core (void)
-{
-    return 0;
-}
-
-static int dummy_resource_plug_pci (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_resource_unplug_pci (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_resource_setup_pci (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_resource_setup_gsi (int gsi)
-{
-    return 0;
-}
-
-static int dummy_resource_setup_misc (void)
-{
-    return 0;
-}
-
-static int dummy_page_offline (uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_lockprof (void)
-{
-    return 0;
-}
-
-static int dummy_cpupool_op (void)
-{
-    return 0;
-}
-
-static int dummy_sched_op (void)
-{
-    return 0;
-}
-
-static long dummy___do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
-{
-    return -ENOSYS;
-}
-
-static char *dummy_show_irq_sid (int irq)
-{
-    return NULL;
-}
-
-static int dummy_map_domain_pirq (struct domain *d, int irq, void *data)
-{
-    return 0;
-}
-
-static int dummy_unmap_domain_pirq (struct domain *d, int irq)
-{
-    return 0;
-}
-
-static int dummy_irq_permission (struct domain *d, int pirq, uint8_t allow)
-{
-    return 0;
-}
-
-static int dummy_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
-{
-    return 0;
-}
-
-static int dummy_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
-{
-    return 0;
-}
-
-static int dummy_pci_config_permission (struct domain *d, uint32_t machine_bdf,
-                                        uint16_t start, uint16_t end,
-                                        uint8_t access)
-{
-    return 0;
-}
-
-#ifdef CONFIG_X86
-static int dummy_shadow_control (struct domain *d, uint32_t op)
-{
-    return 0;
-}
-
-static int dummy_getpageframeinfo (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_getmemlist (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hypercall_init (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hvmcontext (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_address_size (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_machine_address_size (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_hvm_param (struct domain *d, unsigned long op)
-{
-    return 0;
-}
-
-static int dummy_hvm_set_pci_intx_level (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hvm_set_isa_irq_level (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hvm_set_pci_link_route (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hvm_inject_msi (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_mem_event (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_mem_sharing (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_apic (struct domain *d, int cmd)
-{
-    return 0;
-}
-
-static int dummy_xen_settime (void)
-{
-    return 0;
-}
-
-static int dummy_memtype (uint32_t access)
-{
-    return 0;
-}
-
-static int dummy_microcode (void)
-{
-    return 0;
-}
-
-static int dummy_physinfo (void)
-{
-    return 0;
-}
-
-static int dummy_platform_quirk (uint32_t quirk)
-{
-    return 0;
-}
-
-static int dummy_firmware_info (void)
-{
-    return 0;
-}
-
-static int dummy_efi_call(void)
-{
-    return 0;
-}
-
-static int dummy_acpi_sleep (void)
-{
-    return 0;
-}
-
-static int dummy_change_freq (void)
-{
-    return 0;
-}
-
-static int dummy_getidletime (void)
-{
-    return 0;
-}
-
-static int dummy_machine_memory_map (void)
-{
-    return 0;
-}
-
-static int dummy_domain_memory_map (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_mmu_normal_update (struct domain *d, struct domain *t,
-                                    struct domain *f, intpte_t fpte)
-{
-    return 0;
-}
-
-static int dummy_mmu_machphys_update (struct domain *d, struct domain *f, unsigned long mfn)
-{
-    return 0;
-}
-
-static int dummy_update_va_mapping (struct domain *d, struct domain *f, 
-                                                            l1_pgentry_t pte)
-{
-    return 0;
-}
-
-static int dummy_add_to_physmap (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_remove_from_physmap (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_sendtrigger (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
-{
-    return 0;
-}
-
-static int dummy_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
-{
-    return 0;
-}
-
-static int dummy_pin_mem_cacheattr (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_ext_vcpucontext (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_vcpuextstate (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
-{
-    return 0;
-}
-
-static int dummy_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
-{
-    return 0;
-}
-#endif
+#define XSM_DEFAULT(type, name) type dummy_ ## name
+#include <xsm/dummy.h>
 
 struct xsm_operations dummy_xsm_ops;
 
@@ -732,7 +119,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, cpupool_op);
     set_to_dummy_if_null(ops, sched_op);
 
-    set_to_dummy_if_null(ops, __do_xsm_op);
+    set_to_dummy_if_null(ops, do_xsm_op);
 
 #ifdef CONFIG_X86
     set_to_dummy_if_null(ops, shadow_control);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 81ff5ac..31572c5 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1555,7 +1555,7 @@ static struct xsm_operations flask_ops = {
     .cpupool_op = flask_cpupool_op,
     .sched_op = flask_sched_op,
 
-    .__do_xsm_op = do_flask_op,
+    .do_xsm_op = do_flask_op,
 
 #ifdef CONFIG_X86
     .shadow_control = flask_shadow_control,
diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index 46287cb..ca28f91 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -113,7 +113,7 @@ int unregister_xsm(struct xsm_operations *ops)
 
 long do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
-    return __do_xsm_op(op);
+    return xsm_do_xsm_op(op);
 }
 
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQez-0006j4-Kc; Fri, 16 Nov 2012 18:29:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQex-0006eK-Ek
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:28:59 +0000
Received: from [85.158.139.211:17423] by server-2.bemta-5.messagelabs.com id
	06/3D-04892-9E586A05; Fri, 16 Nov 2012 18:28:57 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353090536!20438120!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31001 invoked from network); 16 Nov 2012 18:28:57 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-14.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 18:28:57 -0000
X-TM-IMSS-Message-ID: <8924d444000aed5f@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8924d444000aed5f ;
	Fri, 16 Nov 2012 13:31:37 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3h031862; 
	Fri, 16 Nov 2012 13:28:54 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:26 -0500
Message-Id: <1353090514-18537-12-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org
Subject: [Xen-devel] [PATCH 11/19] xen: convert do_sysctl to use XSM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The xsm_sysctl hook now covers every sysctl, in addition to the more
fine-grained XSM hooks in most sub-functions.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/common/sysctl.c     |  7 ++++---
 xen/include/xsm/dummy.h |  7 +++++++
 xen/include/xsm/xsm.h   |  6 ++++++
 xen/xsm/dummy.c         |  1 +
 xen/xsm/flask/hooks.c   | 33 +++++++++++++++++++++++++++++++++
 5 files changed, 51 insertions(+), 3 deletions(-)

diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 47142f4..599430e 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -33,15 +33,16 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     struct xen_sysctl curop, *op = &curop;
     static DEFINE_SPINLOCK(sysctl_lock);
 
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-
     if ( copy_from_guest(op, u_sysctl, 1) )
         return -EFAULT;
 
     if ( op->interface_version != XEN_SYSCTL_INTERFACE_VERSION )
         return -EACCES;
 
+    ret = xsm_sysctl(op->cmd);
+    if ( ret )
+        return ret;
+
     /*
      * Trylock here avoids deadlock with an existing sysctl critical section
      * which might (for some current or future reason) want to synchronise
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index f5fe89f..073217a 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -106,6 +106,13 @@ static XSM_DEFAULT(int, domctl)(struct domain *d, int cmd)
     return 0;
 }
 
+static XSM_DEFAULT(int, sysctl)(int cmd)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_DEFAULT(int, set_virq_handler)(struct domain *d, uint32_t virq)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index a0c97cb..4900d1f 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -58,6 +58,7 @@ struct xsm_operations {
     int (*domain_settime) (struct domain *d);
     int (*set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
+    int (*sysctl) (int cmd);
     int (*set_virq_handler) (struct domain *d, uint32_t virq);
     int (*tbufcontrol) (void);
     int (*readconsole) (uint32_t clear);
@@ -265,6 +266,11 @@ static inline int xsm_domctl (struct domain *d, int cmd)
     return xsm_ops->domctl(d, cmd);
 }
 
+static inline int xsm_sysctl (int cmd)
+{
+    return xsm_ops->sysctl(cmd);
+}
+
 static inline int xsm_set_virq_handler (struct domain *d, uint32_t virq)
 {
     return xsm_ops->set_virq_handler(d, virq);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 10f9c47..43e8617 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -44,6 +44,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, domain_settime);
     set_to_dummy_if_null(ops, set_target);
     set_to_dummy_if_null(ops, domctl);
+    set_to_dummy_if_null(ops, sysctl);
     set_to_dummy_if_null(ops, set_virq_handler);
     set_to_dummy_if_null(ops, tbufcontrol);
     set_to_dummy_if_null(ops, readconsole);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 2e002f0..e25dd1c 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -675,6 +675,38 @@ static int flask_domctl(struct domain *d, int cmd)
     }
 }
 
+static int flask_sysctl(int cmd)
+{
+    switch ( cmd )
+    {
+    /* These have individual XSM hooks */
+    case XEN_SYSCTL_readconsole:
+    case XEN_SYSCTL_tbuf_op:
+    case XEN_SYSCTL_sched_id:
+    case XEN_SYSCTL_perfc_op:
+    case XEN_SYSCTL_getdomaininfolist:
+    case XEN_SYSCTL_debug_keys:
+    case XEN_SYSCTL_getcpuinfo:
+    case XEN_SYSCTL_availheap:
+    case XEN_SYSCTL_get_pmstat:
+    case XEN_SYSCTL_pm_op:
+    case XEN_SYSCTL_page_offline_op:
+    case XEN_SYSCTL_lockprof_op:
+    case XEN_SYSCTL_cpupool_op:
+    case XEN_SYSCTL_scheduler_op:
+#ifdef CONFIG_X86
+    case XEN_SYSCTL_physinfo:
+    case XEN_SYSCTL_cpu_hotplug:
+    case XEN_SYSCTL_topologyinfo:
+    case XEN_SYSCTL_numainfo:
+#endif
+        return 0;
+    default:
+        printk("flask_sysctl: Unknown op %d\n", cmd);
+        return -EPERM;
+    }
+}
+
 static int flask_set_virq_handler(struct domain *d, uint32_t virq)
 {
     return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
@@ -1601,6 +1633,7 @@ static struct xsm_operations flask_ops = {
     .domain_settime = flask_domain_settime,
     .set_target = flask_set_target,
     .domctl = flask_domctl,
+    .sysctl = flask_sysctl,
     .set_virq_handler = flask_set_virq_handler,
     .tbufcontrol = flask_tbufcontrol,
     .readconsole = flask_readconsole,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQez-0006iQ-4m; Fri, 16 Nov 2012 18:29:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQew-0006g1-RZ
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:28:59 +0000
Received: from [85.158.139.211:2261] by server-13.bemta-5.messagelabs.com id
	EC/B9-27809-AE586A05; Fri, 16 Nov 2012 18:28:58 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353090534!20430900!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29503 invoked from network); 16 Nov 2012 18:28:55 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-12.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 18:28:55 -0000
X-TM-IMSS-Message-ID: <8924cb8d000aed5a@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8924cb8d000aed5a ;
	Fri, 16 Nov 2012 13:31:34 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3b031862; 
	Fri, 16 Nov 2012 13:28:52 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:20 -0500
Message-Id: <1353090514-18537-6-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 05/19] xsm: Use the dummy XSM module if XSM is
	disabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch moves the implementation of the dummy XSM module to a header
file that provides inline functions when XSM_ENABLE is not defined. This
reduces duplication between the dummy module and callers when the
implementation of the dummy return is not just "return 0", and also
provides better compile-time checking for completeness of the XSM
implementations in the dummy module.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/common/domctl.c     |   2 -
 xen/include/xsm/dummy.h | 628 ++++++++++++++++++++++++++++++++++++++++++++++++
 xen/include/xsm/xsm.h   | 294 +++++++++++------------
 xen/xsm/dummy.c         | 619 +----------------------------------------------
 xen/xsm/flask/hooks.c   |   2 +-
 xen/xsm/xsm_core.c      |   2 +-
 6 files changed, 776 insertions(+), 771 deletions(-)
 create mode 100644 xen/include/xsm/dummy.h

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index a7a6b9f..2f49eb2 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -267,10 +267,8 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             return -EPERM;
         break;
     }
-#ifdef XSM_ENABLE
     case XEN_DOMCTL_getdomaininfo:
         break;
-#endif
     default:
         if ( !IS_PRIV(current->domain) )
             return -EPERM;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
new file mode 100644
index 0000000..264f44b
--- /dev/null
+++ b/xen/include/xsm/dummy.h
@@ -0,0 +1,628 @@
+/*
+ *  Default XSM hooks - IS_PRIV and IS_PRIV_FOR checks
+ *
+ *  Author: Daniel De Graaf <dgdegra@tyhco.nsa.gov>
+ *
+ *  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.
+ */
+
+#include <xen/sched.h>
+#include <xsm/xsm.h>
+
+static XSM_DEFAULT(void, security_domaininfo)(struct domain *d,
+                                    struct xen_domctl_getdomaininfo *info)
+{
+    return;
+}
+
+static XSM_DEFAULT(int, setvcpucontext)(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, pausedomain) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, unpausedomain) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, resumedomain) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, domain_create)(struct domain *d, u32 ssidref)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, max_vcpus)(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, destroydomain) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, vcpuaffinity) (int cmd, struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, scheduler) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, getdomaininfo) (struct domain *d)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
+static XSM_DEFAULT(int, getvcpucontext) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, getvcpuinfo) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, domain_settime) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, set_target) (struct domain *d, struct domain *e)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, domctl)(struct domain *d, int cmd)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, set_virq_handler)(struct domain *d, uint32_t virq)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, tbufcontrol) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, readconsole) (uint32_t clear)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, sched_id) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, setdomainmaxmem) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, setdomainhandle) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, setdebugging) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, perfcontrol) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, debug_keys) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, getcpuinfo) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, get_pmstat) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, setpminfo) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, pm_op) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, do_mca) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, availheap) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, alloc_security_domain) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(void, free_security_domain) (struct domain *d)
+{
+    return;
+}
+
+static XSM_DEFAULT(int, grant_mapref) (struct domain *d1, struct domain *d2,
+                                                                uint32_t flags)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, grant_unmapref) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, grant_setup) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, grant_transfer) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, grant_copy) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, grant_query_size) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, memory_adjust_reservation) (struct domain *d1,
+                                                            struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, memory_stat_reservation) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, console_io) (struct domain *d, int cmd)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, profile) (struct domain *d, int op)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, kexec) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, schedop_shutdown) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, memory_pin_page) (struct domain *d1, struct domain *d2,
+                                          struct page_info *page)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, evtchn_unbound) (struct domain *d, struct evtchn *chn,
+                                         domid_t id2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, evtchn_interdomain) (struct domain *d1, struct evtchn
+                                *chan1, struct domain *d2, struct evtchn *chan2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(void, evtchn_close_post) (struct evtchn *chn)
+{
+    return;
+}
+
+static XSM_DEFAULT(int, evtchn_send) (struct domain *d, struct evtchn *chn)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, evtchn_status) (struct domain *d, struct evtchn *chn)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, evtchn_reset) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, alloc_security_evtchn) (struct evtchn *chn)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(void, free_security_evtchn) (struct evtchn *chn)
+{
+    return;
+}
+
+static XSM_DEFAULT(char *, show_security_evtchn) (struct domain *d, const struct evtchn *chn)
+{
+    return NULL;
+}
+
+static XSM_DEFAULT(int, get_pod_target)(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, set_pod_target)(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, get_device_group) (uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, test_assign_device) (uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, assign_device) (struct domain *d, uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, deassign_device) (struct domain *d, uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, resource_plug_core) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, resource_unplug_core) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, resource_plug_pci) (uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, resource_unplug_pci) (uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, resource_setup_pci) (uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, resource_setup_gsi) (int gsi)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, resource_setup_misc) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, page_offline) (uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, lockprof) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, cpupool_op) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, sched_op) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(long, do_xsm_op)(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
+{
+    return -ENOSYS;
+}
+
+static XSM_DEFAULT(char *, show_irq_sid) (int irq)
+{
+    return NULL;
+}
+
+static XSM_DEFAULT(int, map_domain_pirq) (struct domain *d, int irq, void *data)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, unmap_domain_pirq) (struct domain *d, int irq)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, irq_permission) (struct domain *d, int pirq, uint8_t allow)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, iomem_permission) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, pci_config_permission) (struct domain *d, uint32_t machine_bdf,
+                                        uint16_t start, uint16_t end,
+                                        uint8_t access)
+{
+    return 0;
+}
+
+#ifdef CONFIG_X86
+static XSM_DEFAULT(int, shadow_control) (struct domain *d, uint32_t op)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, getpageframeinfo) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, getmemlist) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, hypercall_init) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, hvmcontext) (struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, address_size) (struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, machine_address_size) (struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, hvm_param) (struct domain *d, unsigned long op)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, hvm_set_pci_intx_level) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, hvm_set_isa_irq_level) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, hvm_set_pci_link_route) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, hvm_inject_msi) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, mem_event) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, mem_sharing) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, apic) (struct domain *d, int cmd)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, xen_settime) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, memtype) (uint32_t access)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, microcode) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, physinfo) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, platform_quirk) (uint32_t quirk)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, firmware_info) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, efi_call) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, acpi_sleep) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, change_freq) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, getidletime) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, machine_memory_map) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, domain_memory_map) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, mmu_normal_update) (struct domain *d, struct domain *t,
+                                            struct domain *f, intpte_t fpte)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, mmu_machphys_update) (struct domain *d, struct domain *f,
+                                              unsigned long mfn)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, update_va_mapping) (struct domain *d, struct domain *f, 
+                                                            l1_pgentry_t pte)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, add_to_physmap) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, remove_from_physmap) (struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, sendtrigger) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, pin_mem_cacheattr) (struct domain *d)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, ext_vcpucontext) (struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, vcpuextstate) (struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+{
+    return 0;
+}
+
+#endif
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 2560229..5c3065b 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -21,12 +21,6 @@
 typedef void xsm_op_t;
 DEFINE_XEN_GUEST_HANDLE(xsm_op_t);
 
-#ifdef XSM_ENABLE
-    #define xsm_call(fn) xsm_ops->fn
-#else
-    #define xsm_call(fn) 0
-#endif
-
 /* policy magic number (defined by XSM_MAGIC) */
 typedef u32 xsm_magic_t;
 #ifndef XSM_MAGIC
@@ -141,7 +135,7 @@ struct xsm_operations {
     int (*cpupool_op)(void);
     int (*sched_op)(void);
 
-    long (*__do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
+    long (*do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
 
 #ifdef CONFIG_X86
     int (*shadow_control) (struct domain *d, uint32_t op);
@@ -187,645 +181,643 @@ struct xsm_operations {
 #endif
 };
 
-#endif
-
 extern struct xsm_operations *xsm_ops;
 
 static inline void xsm_security_domaininfo (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info)
 {
-    (void)xsm_call(security_domaininfo(d, info));
+    xsm_ops->security_domaininfo(d, info);
 }
 
 static inline int xsm_setvcpucontext(struct domain *d)
 {
-    return xsm_call(setvcpucontext(d));
+    return xsm_ops->setvcpucontext(d);
 }
 
 static inline int xsm_pausedomain (struct domain *d)
 {
-    return xsm_call(pausedomain(d));
+    return xsm_ops->pausedomain(d);
 }
 
 static inline int xsm_unpausedomain (struct domain *d)
 {
-    return xsm_call(unpausedomain(d));
+    return xsm_ops->unpausedomain(d);
 }
 
 static inline int xsm_resumedomain (struct domain *d)
 {
-    return xsm_call(resumedomain(d));
+    return xsm_ops->resumedomain(d);
 }
 
 static inline int xsm_domain_create (struct domain *d, u32 ssidref)
 {
-    return xsm_call(domain_create(d, ssidref));
+    return xsm_ops->domain_create(d, ssidref);
 }
 
 static inline int xsm_max_vcpus(struct domain *d)
 {
-    return xsm_call(max_vcpus(d));
+    return xsm_ops->max_vcpus(d);
 }
 
 static inline int xsm_destroydomain (struct domain *d)
 {
-    return xsm_call(destroydomain(d));
+    return xsm_ops->destroydomain(d);
 }
 
 static inline int xsm_vcpuaffinity (int cmd, struct domain *d)
 {
-    return xsm_call(vcpuaffinity(cmd, d));
+    return xsm_ops->vcpuaffinity(cmd, d);
 }
 
 static inline int xsm_scheduler (struct domain *d)
 {
-    return xsm_call(scheduler(d));
+    return xsm_ops->scheduler(d);
 }
 
 static inline int xsm_getdomaininfo (struct domain *d)
 {
-    return xsm_call(getdomaininfo(d));
+    return xsm_ops->getdomaininfo(d);
 }
 
 static inline int xsm_getvcpucontext (struct domain *d)
 {
-    return xsm_call(getvcpucontext(d));
+    return xsm_ops->getvcpucontext(d);
 }
 
 static inline int xsm_getvcpuinfo (struct domain *d)
 {
-    return xsm_call(getvcpuinfo(d));
+    return xsm_ops->getvcpuinfo(d);
 }
 
 static inline int xsm_domain_settime (struct domain *d)
 {
-    return xsm_call(domain_settime(d));
+    return xsm_ops->domain_settime(d);
 }
 
 static inline int xsm_set_target (struct domain *d, struct domain *e)
 {
-    return xsm_call(set_target(d, e));
+    return xsm_ops->set_target(d, e);
 }
 
 static inline int xsm_domctl (struct domain *d, int cmd)
 {
-    return xsm_call(domctl(d, cmd));
+    return xsm_ops->domctl(d, cmd);
 }
 
 static inline int xsm_set_virq_handler (struct domain *d, uint32_t virq)
 {
-    return xsm_call(set_virq_handler(d, virq));
+    return xsm_ops->set_virq_handler(d, virq);
 }
 
 static inline int xsm_tbufcontrol (void)
 {
-    return xsm_call(tbufcontrol());
+    return xsm_ops->tbufcontrol();
 }
 
 static inline int xsm_readconsole (uint32_t clear)
 {
-    return xsm_call(readconsole(clear));
+    return xsm_ops->readconsole(clear);
 }
 
 static inline int xsm_sched_id (void)
 {
-    return xsm_call(sched_id());
+    return xsm_ops->sched_id();
 }
 
 static inline int xsm_setdomainmaxmem (struct domain *d)
 {
-    return xsm_call(setdomainmaxmem(d));
+    return xsm_ops->setdomainmaxmem(d);
 }
 
 static inline int xsm_setdomainhandle (struct domain *d)
 {
-    return xsm_call(setdomainhandle(d));
+    return xsm_ops->setdomainhandle(d);
 }
 
 static inline int xsm_setdebugging (struct domain *d)
 {
-    return xsm_call(setdebugging(d));
+    return xsm_ops->setdebugging(d);
 }
 
 static inline int xsm_perfcontrol (void)
 {
-    return xsm_call(perfcontrol());
+    return xsm_ops->perfcontrol();
 }
 
 static inline int xsm_debug_keys (void)
 {
-    return xsm_call(debug_keys());
+    return xsm_ops->debug_keys();
 }
 
 static inline int xsm_availheap (void)
 {
-    return xsm_call(availheap());
+    return xsm_ops->availheap();
 }
 
 static inline int xsm_getcpuinfo (void)
 {
-    return xsm_call(getcpuinfo());
+    return xsm_ops->getcpuinfo();
 }
 
 static inline int xsm_get_pmstat(void)
 {
-    return xsm_call(get_pmstat());
+    return xsm_ops->get_pmstat();
 }
 
 static inline int xsm_setpminfo(void)
 {
-	return xsm_call(setpminfo());
+    return xsm_ops->setpminfo();
 }
 
 static inline int xsm_pm_op(void)
 {
-    return xsm_call(pm_op());
+    return xsm_ops->pm_op();
 }
 
 static inline int xsm_do_mca(void)
 {
-    return xsm_call(do_mca());
+    return xsm_ops->do_mca();
 }
 
 static inline int xsm_evtchn_unbound (struct domain *d1, struct evtchn *chn,
                                                                     domid_t id2)
 {
-    return xsm_call(evtchn_unbound(d1, chn, id2));
+    return xsm_ops->evtchn_unbound(d1, chn, id2);
 }
 
 static inline int xsm_evtchn_interdomain (struct domain *d1, 
                 struct evtchn *chan1, struct domain *d2, struct evtchn *chan2)
 {
-    return xsm_call(evtchn_interdomain(d1, chan1, d2, chan2));
+    return xsm_ops->evtchn_interdomain(d1, chan1, d2, chan2);
 }
 
 static inline void xsm_evtchn_close_post (struct evtchn *chn)
 {
-    (void)xsm_call(evtchn_close_post(chn));
+    xsm_ops->evtchn_close_post(chn);
 }
 
 static inline int xsm_evtchn_send (struct domain *d, struct evtchn *chn)
 {
-    return xsm_call(evtchn_send(d, chn));
+    return xsm_ops->evtchn_send(d, chn);
 }
 
 static inline int xsm_evtchn_status (struct domain *d, struct evtchn *chn)
 {
-    return xsm_call(evtchn_status(d, chn));
+    return xsm_ops->evtchn_status(d, chn);
 }
 
 static inline int xsm_evtchn_reset (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(evtchn_reset(d1, d2));
+    return xsm_ops->evtchn_reset(d1, d2);
 }
 
 static inline int xsm_grant_mapref (struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
-    return xsm_call(grant_mapref(d1, d2, flags));
+    return xsm_ops->grant_mapref(d1, d2, flags);
 }
 
 static inline int xsm_grant_unmapref (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_unmapref(d1, d2));
+    return xsm_ops->grant_unmapref(d1, d2);
 }
 
 static inline int xsm_grant_setup (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_setup(d1, d2));
+    return xsm_ops->grant_setup(d1, d2);
 }
 
 static inline int xsm_grant_transfer (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_transfer(d1, d2));
+    return xsm_ops->grant_transfer(d1, d2);
 }
 
 static inline int xsm_grant_copy (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_copy(d1, d2));
+    return xsm_ops->grant_copy(d1, d2);
 }
 
 static inline int xsm_grant_query_size (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_query_size(d1, d2));
+    return xsm_ops->grant_query_size(d1, d2);
 }
 
 static inline int xsm_alloc_security_domain (struct domain *d)
 {
-    return xsm_call(alloc_security_domain(d));
+    return xsm_ops->alloc_security_domain(d);
 }
 
 static inline void xsm_free_security_domain (struct domain *d)
 {
-    (void)xsm_call(free_security_domain(d));
+    xsm_ops->free_security_domain(d);
 }
 
 static inline int xsm_alloc_security_evtchn (struct evtchn *chn)
 {
-    return xsm_call(alloc_security_evtchn(chn));
+    return xsm_ops->alloc_security_evtchn(chn);
 }
 
 static inline void xsm_free_security_evtchn (struct evtchn *chn)
 {
-    (void)xsm_call(free_security_evtchn(chn));
+    (void)xsm_ops->free_security_evtchn(chn);
 }
 
 static inline char *xsm_show_security_evtchn (struct domain *d, const struct evtchn *chn)
 {
-    return xsm_call(show_security_evtchn(d, chn));
+    return xsm_ops->show_security_evtchn(d, chn);
 }
 
 static inline int xsm_get_pod_target (struct domain *d)
 {
-    return xsm_call(get_pod_target(d));
+    return xsm_ops->get_pod_target(d);
 }
 
 static inline int xsm_set_pod_target (struct domain *d)
 {
-    return xsm_call(set_pod_target(d));
+    return xsm_ops->set_pod_target(d);
 }
 
 static inline int xsm_memory_adjust_reservation (struct domain *d1, struct
                                                                     domain *d2)
 {
-    return xsm_call(memory_adjust_reservation(d1, d2));
+    return xsm_ops->memory_adjust_reservation(d1, d2);
 }
 
 static inline int xsm_memory_stat_reservation (struct domain *d1,
                                                             struct domain *d2)
 {
-    return xsm_call(memory_stat_reservation(d1, d2));
+    return xsm_ops->memory_stat_reservation(d1, d2);
 }
 
 static inline int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
                                       struct page_info *page)
 {
-    return xsm_call(memory_pin_page(d1, d2, page));
+    return xsm_ops->memory_pin_page(d1, d2, page);
 }
 
 static inline int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
-    return xsm_call(remove_from_physmap(d1, d2));
+    return xsm_ops->remove_from_physmap(d1, d2);
 }
 
 static inline int xsm_console_io (struct domain *d, int cmd)
 {
-    return xsm_call(console_io(d, cmd));
+    return xsm_ops->console_io(d, cmd);
 }
 
 static inline int xsm_profile (struct domain *d, int op)
 {
-    return xsm_call(profile(d, op));
+    return xsm_ops->profile(d, op);
 }
 
 static inline int xsm_kexec (void)
 {
-    return xsm_call(kexec());
+    return xsm_ops->kexec();
 }
 
 static inline int xsm_schedop_shutdown (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(schedop_shutdown(d1, d2));
+    return xsm_ops->schedop_shutdown(d1, d2);
 }
 
 static inline char *xsm_show_irq_sid (int irq)
 {
-    return xsm_call(show_irq_sid(irq));
+    return xsm_ops->show_irq_sid(irq);
 }
 
 static inline int xsm_map_domain_pirq (struct domain *d, int irq, void *data)
 {
-    return xsm_call(map_domain_pirq(d, irq, data));
+    return xsm_ops->map_domain_pirq(d, irq, data);
 }
 
 static inline int xsm_unmap_domain_pirq (struct domain *d, int irq)
 {
-    return xsm_call(unmap_domain_pirq(d, irq));
+    return xsm_ops->unmap_domain_pirq(d, irq);
 }
 
 static inline int xsm_irq_permission (struct domain *d, int pirq, uint8_t allow)
 {
-    return xsm_call(irq_permission(d, pirq, allow));
+    return xsm_ops->irq_permission(d, pirq, allow);
 }
 
 static inline int xsm_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return xsm_call(iomem_permission(d, s, e, allow));
+    return xsm_ops->iomem_permission(d, s, e, allow);
 }
 
 static inline int xsm_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return xsm_call(iomem_mapping(d, s, e, allow));
+    return xsm_ops->iomem_mapping(d, s, e, allow);
 }
 
 static inline int xsm_pci_config_permission (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
-    return xsm_call(pci_config_permission(d, machine_bdf, start, end, access));
+    return xsm_ops->pci_config_permission(d, machine_bdf, start, end, access);
 }
 
 static inline int xsm_get_device_group(uint32_t machine_bdf)
 {
-    return xsm_call(get_device_group(machine_bdf));
+    return xsm_ops->get_device_group(machine_bdf);
 }
 
 static inline int xsm_test_assign_device(uint32_t machine_bdf)
 {
-    return xsm_call(test_assign_device(machine_bdf));
+    return xsm_ops->test_assign_device(machine_bdf);
 }
 
 static inline int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
 {
-    return xsm_call(assign_device(d, machine_bdf));
+    return xsm_ops->assign_device(d, machine_bdf);
 }
 
 static inline int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
-    return xsm_call(deassign_device(d, machine_bdf));
+    return xsm_ops->deassign_device(d, machine_bdf);
 }
 
 static inline int xsm_resource_plug_pci (uint32_t machine_bdf)
 {
-    return xsm_call(resource_plug_pci(machine_bdf));
+    return xsm_ops->resource_plug_pci(machine_bdf);
 }
 
 static inline int xsm_resource_unplug_pci (uint32_t machine_bdf)
 {
-    return xsm_call(resource_unplug_pci(machine_bdf));
+    return xsm_ops->resource_unplug_pci(machine_bdf);
 }
 
 static inline int xsm_resource_plug_core (void)
 {
-    return xsm_call(resource_plug_core());
+    return xsm_ops->resource_plug_core();
 }
 
 static inline int xsm_resource_unplug_core (void)
 {
-    return xsm_call(resource_unplug_core());
+    return xsm_ops->resource_unplug_core();
 }
 
 static inline int xsm_resource_setup_pci (uint32_t machine_bdf)
 {
-    return xsm_call(resource_setup_pci(machine_bdf));
+    return xsm_ops->resource_setup_pci(machine_bdf);
 }
 
 static inline int xsm_resource_setup_gsi (int gsi)
 {
-    return xsm_call(resource_setup_gsi(gsi));
+    return xsm_ops->resource_setup_gsi(gsi);
 }
 
 static inline int xsm_resource_setup_misc (void)
 {
-    return xsm_call(resource_setup_misc());
+    return xsm_ops->resource_setup_misc();
 }
 
 static inline int xsm_page_offline(uint32_t cmd)
 {
-    return xsm_call(page_offline(cmd));
+    return xsm_ops->page_offline(cmd);
 }
 
 static inline int xsm_lockprof(void)
 {
-    return xsm_call(lockprof());
+    return xsm_ops->lockprof();
 }
 
 static inline int xsm_cpupool_op(void)
 {
-    return xsm_call(cpupool_op());
+    return xsm_ops->cpupool_op();
 }
 
 static inline int xsm_sched_op(void)
 {
-    return xsm_call(sched_op());
-}
-
-static inline long __do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
-{
-#ifdef XSM_ENABLE
-    return xsm_ops->__do_xsm_op(op);
-#else
-    return -ENOSYS;
-#endif
+    return xsm_ops->sched_op();
 }
 
-#ifdef XSM_ENABLE
-extern int xsm_init(unsigned long *module_map, const multiboot_info_t *mbi,
-                    void *(*bootstrap_map)(const module_t *));
-extern int xsm_policy_init(unsigned long *module_map,
-                           const multiboot_info_t *mbi,
-                           void *(*bootstrap_map)(const module_t *));
-extern int register_xsm(struct xsm_operations *ops);
-extern int unregister_xsm(struct xsm_operations *ops);
-#else
-static inline int xsm_init (unsigned long *module_map,
-                            const multiboot_info_t *mbi,
-                            void *(*bootstrap_map)(const module_t *))
+static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
-    return 0;
+    return xsm_ops->do_xsm_op(op);
 }
-#endif
 
 #ifdef CONFIG_X86
 static inline int xsm_shadow_control (struct domain *d, uint32_t op)
 {
-    return xsm_call(shadow_control(d, op));
+    return xsm_ops->shadow_control(d, op);
 }
 
 static inline int xsm_getpageframeinfo (struct domain *d)
 {
-    return xsm_call(getpageframeinfo(d));
+    return xsm_ops->getpageframeinfo(d);
 }
 
 static inline int xsm_getmemlist (struct domain *d)
 {
-    return xsm_call(getmemlist(d));
+    return xsm_ops->getmemlist(d);
 }
 
 static inline int xsm_hypercall_init (struct domain *d)
 {
-    return xsm_call(hypercall_init(d));
+    return xsm_ops->hypercall_init(d);
 }
 
 static inline int xsm_hvmcontext (struct domain *d, uint32_t cmd)
 {
-    return xsm_call(hvmcontext(d, cmd));
+    return xsm_ops->hvmcontext(d, cmd);
 }
 
 static inline int xsm_address_size (struct domain *d, uint32_t cmd)
 {
-    return xsm_call(address_size(d, cmd));
+    return xsm_ops->address_size(d, cmd);
 }
 
 static inline int xsm_machine_address_size (struct domain *d, uint32_t cmd)
 {
-    return xsm_call(machine_address_size(d, cmd));
+    return xsm_ops->machine_address_size(d, cmd);
 }
 
 static inline int xsm_hvm_param (struct domain *d, unsigned long op)
 {
-    return xsm_call(hvm_param(d, op));
+    return xsm_ops->hvm_param(d, op);
 }
 
 static inline int xsm_hvm_set_pci_intx_level (struct domain *d)
 {
-    return xsm_call(hvm_set_pci_intx_level(d));
+    return xsm_ops->hvm_set_pci_intx_level(d);
 }
 
 static inline int xsm_hvm_set_isa_irq_level (struct domain *d)
 {
-    return xsm_call(hvm_set_isa_irq_level(d));
+    return xsm_ops->hvm_set_isa_irq_level(d);
 }
 
 static inline int xsm_hvm_set_pci_link_route (struct domain *d)
 {
-    return xsm_call(hvm_set_pci_link_route(d));
+    return xsm_ops->hvm_set_pci_link_route(d);
 }
 
 static inline int xsm_hvm_inject_msi (struct domain *d)
 {
-    return xsm_call(hvm_inject_msi(d));
+    return xsm_ops->hvm_inject_msi(d);
 }
 
 static inline int xsm_mem_event (struct domain *d)
 {
-    return xsm_call(mem_event(d));
+    return xsm_ops->mem_event(d);
 }
 
 static inline int xsm_mem_sharing (struct domain *d)
 {
-    return xsm_call(mem_sharing(d));
+    return xsm_ops->mem_sharing(d);
 }
 
 static inline int xsm_apic (struct domain *d, int cmd)
 {
-    return xsm_call(apic(d, cmd));
+    return xsm_ops->apic(d, cmd);
 }
 
 static inline int xsm_xen_settime (void)
 {
-    return xsm_call(xen_settime());
+    return xsm_ops->xen_settime();
 }
 
 static inline int xsm_memtype (uint32_t access)
 {
-    return xsm_call(memtype(access));
+    return xsm_ops->memtype(access);
 }
 
 static inline int xsm_microcode (void)
 {
-    return xsm_call(microcode());
+    return xsm_ops->microcode();
 }
 
 static inline int xsm_physinfo (void)
 {
-    return xsm_call(physinfo());
+    return xsm_ops->physinfo();
 }
 
 static inline int xsm_platform_quirk (uint32_t quirk)
 {
-    return xsm_call(platform_quirk(quirk));
+    return xsm_ops->platform_quirk(quirk);
 }
 
 static inline int xsm_firmware_info (void)
 {
-    return xsm_call(firmware_info());
+    return xsm_ops->firmware_info();
 }
 
 static inline int xsm_efi_call (void)
 {
-    return xsm_call(efi_call());
+    return xsm_ops->efi_call();
 }
 
 static inline int xsm_acpi_sleep (void)
 {
-    return xsm_call(acpi_sleep());
+    return xsm_ops->acpi_sleep();
 }
 
 static inline int xsm_change_freq (void)
 {
-    return xsm_call(change_freq());
+    return xsm_ops->change_freq();
 }
 
 static inline int xsm_getidletime (void)
 {
-    return xsm_call(getidletime());
+    return xsm_ops->getidletime();
 }
 
 static inline int xsm_machine_memory_map(void)
 {
-    return xsm_call(machine_memory_map());
+    return xsm_ops->machine_memory_map();
 }
 
 static inline int xsm_domain_memory_map(struct domain *d)
 {
-    return xsm_call(domain_memory_map(d));
+    return xsm_ops->domain_memory_map(d);
 }
 
 static inline int xsm_mmu_normal_update (struct domain *d, struct domain *t,
                                          struct domain *f, intpte_t fpte)
 {
-    return xsm_call(mmu_normal_update(d, t, f, fpte));
+    return xsm_ops->mmu_normal_update(d, t, f, fpte);
 }
 
 static inline int xsm_mmu_machphys_update (struct domain *d1, struct domain *d2,
                                            unsigned long mfn)
 {
-    return xsm_call(mmu_machphys_update(d1, d2, mfn));
+    return xsm_ops->mmu_machphys_update(d1, d2, mfn);
 }
 
 static inline int xsm_update_va_mapping(struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
-    return xsm_call(update_va_mapping(d, f, pte));
+    return xsm_ops->update_va_mapping(d, f, pte);
 }
 
 static inline int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
 {
-    return xsm_call(add_to_physmap(d1, d2));
+    return xsm_ops->add_to_physmap(d1, d2);
 }
 
 static inline int xsm_sendtrigger(struct domain *d)
 {
-    return xsm_call(sendtrigger(d));
+    return xsm_ops->sendtrigger(d);
 }
 
 static inline int xsm_bind_pt_irq(struct domain *d, 
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_call(bind_pt_irq(d, bind));
+    return xsm_ops->bind_pt_irq(d, bind);
 }
 
 static inline int xsm_unbind_pt_irq(struct domain *d,
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_call(unbind_pt_irq(d, bind));
+    return xsm_ops->unbind_pt_irq(d, bind);
 }
 
 static inline int xsm_pin_mem_cacheattr(struct domain *d)
 {
-    return xsm_call(pin_mem_cacheattr(d));
+    return xsm_ops->pin_mem_cacheattr(d);
 }
 
 static inline int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
 {
-    return xsm_call(ext_vcpucontext(d, cmd));
+    return xsm_ops->ext_vcpucontext(d, cmd);
 }
 static inline int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
 {
-    return xsm_call(vcpuextstate(d, cmd));
+    return xsm_ops->vcpuextstate(d, cmd);
 }
 
 static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return xsm_call(ioport_permission(d, s, e, allow));
+    return xsm_ops->ioport_permission(d, s, e, allow);
 }
 
 static inline int xsm_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return xsm_call(ioport_mapping(d, s, e, allow));
+    return xsm_ops->ioport_mapping(d, s, e, allow);
 }
 #endif /* CONFIG_X86 */
 
+extern int xsm_init(unsigned long *module_map, const multiboot_info_t *mbi,
+                    void *(*bootstrap_map)(const module_t *));
+extern int xsm_policy_init(unsigned long *module_map,
+                           const multiboot_info_t *mbi,
+                           void *(*bootstrap_map)(const module_t *));
+extern int register_xsm(struct xsm_operations *ops);
+extern int unregister_xsm(struct xsm_operations *ops);
+
 extern struct xsm_operations dummy_xsm_ops;
 extern void xsm_fixup_ops(struct xsm_operations *ops);
 
+#else /* XSM_ENABLE */
+
+#define XSM_DEFAULT(type, name) inline type xsm_ ## name
+#include <xsm/dummy.h>
+
+static inline int xsm_init (unsigned long *module_map,
+                            const multiboot_info_t *mbi,
+                            void *(*bootstrap_map)(const module_t *))
+{
+    return 0;
+}
+#endif /* XSM_ENABLE */
+
 #endif /* __XSM_H */
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 5f078d2..47192d7 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -10,621 +10,8 @@
  *  as published by the Free Software Foundation.
  */
 
-#include <xen/sched.h>
-#include <xsm/xsm.h>
-
-static void dummy_security_domaininfo(struct domain *d,
-                                    struct xen_domctl_getdomaininfo *info)
-{
-    return;
-}
-
-static int dummy_setvcpucontext(struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_pausedomain (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_unpausedomain (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_resumedomain (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_domain_create(struct domain *d, u32 ssidref)
-{
-    return 0;
-}
-
-static int dummy_max_vcpus(struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_destroydomain (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_vcpuaffinity (int cmd, struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_scheduler (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_getdomaininfo (struct domain *d)
-{
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
-}
-
-static int dummy_getvcpucontext (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_getvcpuinfo (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_domain_settime (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_set_target (struct domain *d, struct domain *e)
-{
-    return 0;
-}
-
-static int dummy_domctl(struct domain *d, int cmd)
-{
-    return 0;
-}
-
-static int dummy_set_virq_handler(struct domain *d, uint32_t virq)
-{
-    return 0;
-}
-
-static int dummy_tbufcontrol (void)
-{
-    return 0;
-}
-
-static int dummy_readconsole (uint32_t clear)
-{
-    return 0;
-}
-
-static int dummy_sched_id (void)
-{
-    return 0;
-}
-
-static int dummy_setdomainmaxmem (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_setdomainhandle (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_setdebugging (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_perfcontrol (void)
-{
-    return 0;
-}
-
-static int dummy_debug_keys (void)
-{
-    return 0;
-}
-
-static int dummy_getcpuinfo (void)
-{
-    return 0;
-}
-
-static int dummy_get_pmstat (void)
-{
-    return 0;
-}
-
-static int dummy_setpminfo (void)
-{
-    return 0;
-}
-
-static int dummy_pm_op (void)
-{
-    return 0;
-}
-
-static int dummy_do_mca (void)
-{
-    return 0;
-}
-
-static int dummy_availheap (void)
-{
-    return 0;
-}
-
-static int dummy_alloc_security_domain (struct domain *d)
-{
-    return 0;
-}
-
-static void dummy_free_security_domain (struct domain *d)
-{
-    return;
-}
-
-static int dummy_grant_mapref (struct domain *d1, struct domain *d2,
-                                                                uint32_t flags)
-{
-    return 0;
-}
-
-static int dummy_grant_unmapref (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_grant_setup (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_grant_transfer (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_grant_copy (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_grant_query_size (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_memory_adjust_reservation (struct domain *d1,
-                                                            struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_memory_stat_reservation (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_console_io (struct domain *d, int cmd)
-{
-    return 0;
-}
-
-static int dummy_profile (struct domain *d, int op)
-{
-    return 0;
-}
-
-static int dummy_kexec (void)
-{
-    return 0;
-}
-
-static int dummy_schedop_shutdown (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_memory_pin_page(struct domain *d1, struct domain *d2, struct page_info *page)
-{
-    return 0;
-}
-
-static int dummy_evtchn_unbound (struct domain *d, struct evtchn *chn,
-                                                                    domid_t id2)
-{
-    return 0;
-}
-
-static int dummy_evtchn_interdomain (struct domain *d1, struct evtchn
-                                *chan1, struct domain *d2, struct evtchn *chan2)
-{
-    return 0;
-}
-
-static void dummy_evtchn_close_post (struct evtchn *chn)
-{
-    return;
-}
-
-static int dummy_evtchn_send (struct domain *d, struct evtchn *chn)
-{
-    return 0;
-}
-
-static int dummy_evtchn_status (struct domain *d, struct evtchn *chn)
-{
-    return 0;
-}
-
-static int dummy_evtchn_reset (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_alloc_security_evtchn (struct evtchn *chn)
-{
-    return 0;
-}
-
-static void dummy_free_security_evtchn (struct evtchn *chn)
-{
-    return;
-}
-
-static char *dummy_show_security_evtchn (struct domain *d, const struct evtchn *chn)
-{
-    return NULL;
-}
-
-static int dummy_get_pod_target(struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_set_pod_target(struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_get_device_group (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_test_assign_device (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_assign_device (struct domain *d, uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_deassign_device (struct domain *d, uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_resource_plug_core (void)
-{
-    return 0;
-}
-
-static int dummy_resource_unplug_core (void)
-{
-    return 0;
-}
-
-static int dummy_resource_plug_pci (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_resource_unplug_pci (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_resource_setup_pci (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_resource_setup_gsi (int gsi)
-{
-    return 0;
-}
-
-static int dummy_resource_setup_misc (void)
-{
-    return 0;
-}
-
-static int dummy_page_offline (uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_lockprof (void)
-{
-    return 0;
-}
-
-static int dummy_cpupool_op (void)
-{
-    return 0;
-}
-
-static int dummy_sched_op (void)
-{
-    return 0;
-}
-
-static long dummy___do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
-{
-    return -ENOSYS;
-}
-
-static char *dummy_show_irq_sid (int irq)
-{
-    return NULL;
-}
-
-static int dummy_map_domain_pirq (struct domain *d, int irq, void *data)
-{
-    return 0;
-}
-
-static int dummy_unmap_domain_pirq (struct domain *d, int irq)
-{
-    return 0;
-}
-
-static int dummy_irq_permission (struct domain *d, int pirq, uint8_t allow)
-{
-    return 0;
-}
-
-static int dummy_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
-{
-    return 0;
-}
-
-static int dummy_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
-{
-    return 0;
-}
-
-static int dummy_pci_config_permission (struct domain *d, uint32_t machine_bdf,
-                                        uint16_t start, uint16_t end,
-                                        uint8_t access)
-{
-    return 0;
-}
-
-#ifdef CONFIG_X86
-static int dummy_shadow_control (struct domain *d, uint32_t op)
-{
-    return 0;
-}
-
-static int dummy_getpageframeinfo (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_getmemlist (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hypercall_init (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hvmcontext (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_address_size (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_machine_address_size (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_hvm_param (struct domain *d, unsigned long op)
-{
-    return 0;
-}
-
-static int dummy_hvm_set_pci_intx_level (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hvm_set_isa_irq_level (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hvm_set_pci_link_route (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hvm_inject_msi (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_mem_event (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_mem_sharing (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_apic (struct domain *d, int cmd)
-{
-    return 0;
-}
-
-static int dummy_xen_settime (void)
-{
-    return 0;
-}
-
-static int dummy_memtype (uint32_t access)
-{
-    return 0;
-}
-
-static int dummy_microcode (void)
-{
-    return 0;
-}
-
-static int dummy_physinfo (void)
-{
-    return 0;
-}
-
-static int dummy_platform_quirk (uint32_t quirk)
-{
-    return 0;
-}
-
-static int dummy_firmware_info (void)
-{
-    return 0;
-}
-
-static int dummy_efi_call(void)
-{
-    return 0;
-}
-
-static int dummy_acpi_sleep (void)
-{
-    return 0;
-}
-
-static int dummy_change_freq (void)
-{
-    return 0;
-}
-
-static int dummy_getidletime (void)
-{
-    return 0;
-}
-
-static int dummy_machine_memory_map (void)
-{
-    return 0;
-}
-
-static int dummy_domain_memory_map (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_mmu_normal_update (struct domain *d, struct domain *t,
-                                    struct domain *f, intpte_t fpte)
-{
-    return 0;
-}
-
-static int dummy_mmu_machphys_update (struct domain *d, struct domain *f, unsigned long mfn)
-{
-    return 0;
-}
-
-static int dummy_update_va_mapping (struct domain *d, struct domain *f, 
-                                                            l1_pgentry_t pte)
-{
-    return 0;
-}
-
-static int dummy_add_to_physmap (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_remove_from_physmap (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_sendtrigger (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
-{
-    return 0;
-}
-
-static int dummy_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
-{
-    return 0;
-}
-
-static int dummy_pin_mem_cacheattr (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_ext_vcpucontext (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_vcpuextstate (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
-{
-    return 0;
-}
-
-static int dummy_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
-{
-    return 0;
-}
-#endif
+#define XSM_DEFAULT(type, name) type dummy_ ## name
+#include <xsm/dummy.h>
 
 struct xsm_operations dummy_xsm_ops;
 
@@ -732,7 +119,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, cpupool_op);
     set_to_dummy_if_null(ops, sched_op);
 
-    set_to_dummy_if_null(ops, __do_xsm_op);
+    set_to_dummy_if_null(ops, do_xsm_op);
 
 #ifdef CONFIG_X86
     set_to_dummy_if_null(ops, shadow_control);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 81ff5ac..31572c5 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1555,7 +1555,7 @@ static struct xsm_operations flask_ops = {
     .cpupool_op = flask_cpupool_op,
     .sched_op = flask_sched_op,
 
-    .__do_xsm_op = do_flask_op,
+    .do_xsm_op = do_flask_op,
 
 #ifdef CONFIG_X86
     .shadow_control = flask_shadow_control,
diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index 46287cb..ca28f91 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -113,7 +113,7 @@ int unregister_xsm(struct xsm_operations *ops)
 
 long do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
-    return __do_xsm_op(op);
+    return xsm_do_xsm_op(op);
 }
 
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQez-0006j4-Kc; Fri, 16 Nov 2012 18:29:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQex-0006eK-Ek
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:28:59 +0000
Received: from [85.158.139.211:17423] by server-2.bemta-5.messagelabs.com id
	06/3D-04892-9E586A05; Fri, 16 Nov 2012 18:28:57 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353090536!20438120!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31001 invoked from network); 16 Nov 2012 18:28:57 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-14.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 18:28:57 -0000
X-TM-IMSS-Message-ID: <8924d444000aed5f@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8924d444000aed5f ;
	Fri, 16 Nov 2012 13:31:37 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3h031862; 
	Fri, 16 Nov 2012 13:28:54 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:26 -0500
Message-Id: <1353090514-18537-12-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org
Subject: [Xen-devel] [PATCH 11/19] xen: convert do_sysctl to use XSM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The xsm_sysctl hook now covers every sysctl, in addition to the more
fine-grained XSM hooks in most sub-functions.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/common/sysctl.c     |  7 ++++---
 xen/include/xsm/dummy.h |  7 +++++++
 xen/include/xsm/xsm.h   |  6 ++++++
 xen/xsm/dummy.c         |  1 +
 xen/xsm/flask/hooks.c   | 33 +++++++++++++++++++++++++++++++++
 5 files changed, 51 insertions(+), 3 deletions(-)

diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 47142f4..599430e 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -33,15 +33,16 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     struct xen_sysctl curop, *op = &curop;
     static DEFINE_SPINLOCK(sysctl_lock);
 
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-
     if ( copy_from_guest(op, u_sysctl, 1) )
         return -EFAULT;
 
     if ( op->interface_version != XEN_SYSCTL_INTERFACE_VERSION )
         return -EACCES;
 
+    ret = xsm_sysctl(op->cmd);
+    if ( ret )
+        return ret;
+
     /*
      * Trylock here avoids deadlock with an existing sysctl critical section
      * which might (for some current or future reason) want to synchronise
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index f5fe89f..073217a 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -106,6 +106,13 @@ static XSM_DEFAULT(int, domctl)(struct domain *d, int cmd)
     return 0;
 }
 
+static XSM_DEFAULT(int, sysctl)(int cmd)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_DEFAULT(int, set_virq_handler)(struct domain *d, uint32_t virq)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index a0c97cb..4900d1f 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -58,6 +58,7 @@ struct xsm_operations {
     int (*domain_settime) (struct domain *d);
     int (*set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
+    int (*sysctl) (int cmd);
     int (*set_virq_handler) (struct domain *d, uint32_t virq);
     int (*tbufcontrol) (void);
     int (*readconsole) (uint32_t clear);
@@ -265,6 +266,11 @@ static inline int xsm_domctl (struct domain *d, int cmd)
     return xsm_ops->domctl(d, cmd);
 }
 
+static inline int xsm_sysctl (int cmd)
+{
+    return xsm_ops->sysctl(cmd);
+}
+
 static inline int xsm_set_virq_handler (struct domain *d, uint32_t virq)
 {
     return xsm_ops->set_virq_handler(d, virq);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 10f9c47..43e8617 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -44,6 +44,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, domain_settime);
     set_to_dummy_if_null(ops, set_target);
     set_to_dummy_if_null(ops, domctl);
+    set_to_dummy_if_null(ops, sysctl);
     set_to_dummy_if_null(ops, set_virq_handler);
     set_to_dummy_if_null(ops, tbufcontrol);
     set_to_dummy_if_null(ops, readconsole);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 2e002f0..e25dd1c 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -675,6 +675,38 @@ static int flask_domctl(struct domain *d, int cmd)
     }
 }
 
+static int flask_sysctl(int cmd)
+{
+    switch ( cmd )
+    {
+    /* These have individual XSM hooks */
+    case XEN_SYSCTL_readconsole:
+    case XEN_SYSCTL_tbuf_op:
+    case XEN_SYSCTL_sched_id:
+    case XEN_SYSCTL_perfc_op:
+    case XEN_SYSCTL_getdomaininfolist:
+    case XEN_SYSCTL_debug_keys:
+    case XEN_SYSCTL_getcpuinfo:
+    case XEN_SYSCTL_availheap:
+    case XEN_SYSCTL_get_pmstat:
+    case XEN_SYSCTL_pm_op:
+    case XEN_SYSCTL_page_offline_op:
+    case XEN_SYSCTL_lockprof_op:
+    case XEN_SYSCTL_cpupool_op:
+    case XEN_SYSCTL_scheduler_op:
+#ifdef CONFIG_X86
+    case XEN_SYSCTL_physinfo:
+    case XEN_SYSCTL_cpu_hotplug:
+    case XEN_SYSCTL_topologyinfo:
+    case XEN_SYSCTL_numainfo:
+#endif
+        return 0;
+    default:
+        printk("flask_sysctl: Unknown op %d\n", cmd);
+        return -EPERM;
+    }
+}
+
 static int flask_set_virq_handler(struct domain *d, uint32_t virq)
 {
     return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
@@ -1601,6 +1633,7 @@ static struct xsm_operations flask_ops = {
     .domain_settime = flask_domain_settime,
     .set_target = flask_set_target,
     .domctl = flask_domctl,
+    .sysctl = flask_sysctl,
     .set_virq_handler = flask_set_virq_handler,
     .tbufcontrol = flask_tbufcontrol,
     .readconsole = flask_readconsole,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf0-0006kJ-TN; Fri, 16 Nov 2012 18:29:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQex-0006gV-N0
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:28:59 +0000
Received: from [85.158.138.51:8981] by server-12.bemta-3.messagelabs.com id
	57/62-22757-6E586A05; Fri, 16 Nov 2012 18:28:54 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-9.tower-174.messagelabs.com!1353090533!30329596!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15615 invoked from network); 16 Nov 2012 18:28:53 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-9.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:53 -0000
X-TM-IMSS-Message-ID: <892524a5000aa5cc@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 892524a5000aa5cc ;
	Fri, 16 Nov 2012 13:28:25 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3W031862; 
	Fri, 16 Nov 2012 13:28:50 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:15 -0500
Message-Id: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
Cc: keir@xen.org
Subject: [Xen-devel] [PATCH v5] Merge IS_PRIV checks into XSM hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Changes from v4:
 * Removed patches that have been applied
 * Rename __do_xsm_op to do_xsm_op
 * Rebased on current xen-unstable
 * Policy headers moved under hypervisor

Changes from v3:
 * Moved x86-specific sysctls inside #ifdef CONFIG_X86
 * Removed pt_domain parameter from mmu_update hook when unused
 * Renamed xsm___do_xsm_op to xsm_do_xsm_op
 * Added struct domain* argument to arch_do_domctl
 * Cleaned up mem_event code duplication

Changes from v2:
 * Added overall hooks for domctl, sysctl, and platform_hypercall so
   that new sub-operations are protected by IS_PRIV checks
 * Reorganized the IS_PRIV additions to dummy.h so they are added in the
   same patch that removes the IS_PRIV they are replacing
 * Reworked hooks in the MM hotpath to increase efficiency
 * Dropped some unneeded XSM hook additions due to do_domctl hook
 * Dropped the rcu_lock*target_domain_by_id function removal patch
 * Restore IS_PRIV check in PHYSDEVOP_alloc_irq_vector
 * Use the existing hook function structure for tmem

Miscellaneous updates to FLASK:
    [PATCH 01/19] libxl: introduce XSM relabel on build
    [PATCH 02/19] flask/policy: Add domain relabel example
    [PATCH 03/19] arch/x86: add distinct XSM hooks for map/unmap
    [PATCH 04/19] xsm/flask: Add checks on the domain performing set_target

IS_PRIV Refactoring:
    [PATCH 05/19] xsm: Use the dummy XSM module if XSM is disabled
    [PATCH 06/19] xen: use XSM instead of IS_PRIV where duplicated
    [PATCH 07/19] xen: avoid calling rcu_lock_*target_domain when an XSM
    [PATCH 08/19] arch/x86: convert platform_hypercall to use XSM
    [PATCH 09/19] xen: lock target domain in do_domctl common code
    [PATCH 10/19] xen: convert do_domctl to use XSM
    [PATCH 11/19] xen: convert do_sysctl to use XSM

Additional new/updated hooks:
    [PATCH 12/19] xsm/flask: add missing hooks
    [PATCH 13/19] xsm/flask: add distinct SIDs for self/target access
    [PATCH 14/19] arch/x86: Add missing mem_sharing XSM hooks
    [PATCH 15/19] arch/x86: use XSM hooks for get_pg_owner access checks
    [PATCH 16/19] xen: Add XSM hook for XENMEM_exchange
    [PATCH 17/19] tmem: add XSM hooks

Other cleanup:
    [PATCH 18/19] xen/arch/*: add struct domain parameter to
    [PATCH 19/19] flask: move policy headers into hypervisor

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf0-0006kJ-TN; Fri, 16 Nov 2012 18:29:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQex-0006gV-N0
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:28:59 +0000
Received: from [85.158.138.51:8981] by server-12.bemta-3.messagelabs.com id
	57/62-22757-6E586A05; Fri, 16 Nov 2012 18:28:54 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-9.tower-174.messagelabs.com!1353090533!30329596!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15615 invoked from network); 16 Nov 2012 18:28:53 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-9.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:53 -0000
X-TM-IMSS-Message-ID: <892524a5000aa5cc@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 892524a5000aa5cc ;
	Fri, 16 Nov 2012 13:28:25 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3W031862; 
	Fri, 16 Nov 2012 13:28:50 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:15 -0500
Message-Id: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
Cc: keir@xen.org
Subject: [Xen-devel] [PATCH v5] Merge IS_PRIV checks into XSM hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Changes from v4:
 * Removed patches that have been applied
 * Rename __do_xsm_op to do_xsm_op
 * Rebased on current xen-unstable
 * Policy headers moved under hypervisor

Changes from v3:
 * Moved x86-specific sysctls inside #ifdef CONFIG_X86
 * Removed pt_domain parameter from mmu_update hook when unused
 * Renamed xsm___do_xsm_op to xsm_do_xsm_op
 * Added struct domain* argument to arch_do_domctl
 * Cleaned up mem_event code duplication

Changes from v2:
 * Added overall hooks for domctl, sysctl, and platform_hypercall so
   that new sub-operations are protected by IS_PRIV checks
 * Reorganized the IS_PRIV additions to dummy.h so they are added in the
   same patch that removes the IS_PRIV they are replacing
 * Reworked hooks in the MM hotpath to increase efficiency
 * Dropped some unneeded XSM hook additions due to do_domctl hook
 * Dropped the rcu_lock*target_domain_by_id function removal patch
 * Restore IS_PRIV check in PHYSDEVOP_alloc_irq_vector
 * Use the existing hook function structure for tmem

Miscellaneous updates to FLASK:
    [PATCH 01/19] libxl: introduce XSM relabel on build
    [PATCH 02/19] flask/policy: Add domain relabel example
    [PATCH 03/19] arch/x86: add distinct XSM hooks for map/unmap
    [PATCH 04/19] xsm/flask: Add checks on the domain performing set_target

IS_PRIV Refactoring:
    [PATCH 05/19] xsm: Use the dummy XSM module if XSM is disabled
    [PATCH 06/19] xen: use XSM instead of IS_PRIV where duplicated
    [PATCH 07/19] xen: avoid calling rcu_lock_*target_domain when an XSM
    [PATCH 08/19] arch/x86: convert platform_hypercall to use XSM
    [PATCH 09/19] xen: lock target domain in do_domctl common code
    [PATCH 10/19] xen: convert do_domctl to use XSM
    [PATCH 11/19] xen: convert do_sysctl to use XSM

Additional new/updated hooks:
    [PATCH 12/19] xsm/flask: add missing hooks
    [PATCH 13/19] xsm/flask: add distinct SIDs for self/target access
    [PATCH 14/19] arch/x86: Add missing mem_sharing XSM hooks
    [PATCH 15/19] arch/x86: use XSM hooks for get_pg_owner access checks
    [PATCH 16/19] xen: Add XSM hook for XENMEM_exchange
    [PATCH 17/19] tmem: add XSM hooks

Other cleanup:
    [PATCH 18/19] xen/arch/*: add struct domain parameter to
    [PATCH 19/19] flask: move policy headers into hypervisor

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf1-0006m9-U4; Fri, 16 Nov 2012 18:29:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQex-0006gU-Mu
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:00 +0000
Received: from [85.158.138.51:10947] by server-15.bemta-3.messagelabs.com id
	06/C2-09445-6E586A05; Fri, 16 Nov 2012 18:28:54 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-2.tower-174.messagelabs.com!1353090533!30320942!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15921 invoked from network); 16 Nov 2012 18:28:53 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-2.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:53 -0000
X-TM-IMSS-Message-ID: <892528f8000aa5cd@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 892528f8000aa5cd ;
	Fri, 16 Nov 2012 13:28:27 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3Y031862; 
	Fri, 16 Nov 2012 13:28:51 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:17 -0500
Message-Id: <1353090514-18537-3-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org
Subject: [Xen-devel] [PATCH 02/19] flask/policy: Add domain relabel example
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This adds the nomigrate_t type to the example FLASK policy which allows
domains to be created that dom0 cannot access after building.

Example domain configuration snippet:
  seclabel='customer_1:vm_r:nomigrate_t'
  init_seclabel='customer_1:vm_r:nomigrate_t_building'

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 docs/misc/xsm-flask.txt                      |  2 +
 tools/flask/policy/policy/modules/xen/xen.if | 56 +++++++++++++++++++++-------
 tools/flask/policy/policy/modules/xen/xen.te | 10 +++++
 3 files changed, 55 insertions(+), 13 deletions(-)

diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index 6b0d327..0778a28 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -60,6 +60,8 @@ that can be used without dom0 disaggregation. The main types for domUs are:
  - domU_t is a domain that can communicate with any other domU_t
  - isolated_domU_t can only communicate with dom0
  - prot_domU_t is a domain type whose creation can be disabled with a boolean
+ - nomigrate_t is a domain that must be created via the nomigrate_t_building
+   type, and whose memory cannot be read by dom0 once created
 
 HVM domains with stubdomain device models use two types (one per domain):
  - domHVM_t is an HVM domain that uses a stubdomain device model
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 3f58909..2ad11b2 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -9,24 +9,47 @@
 #   Declare a type as a domain type, and allow basic domain setup
 define(`declare_domain', `
 	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
+	type $1_channel, event_type;
+	type_transition $1 domain_type:event $1_channel;
 	allow $1 $1:grant { query setup };
 	allow $1 $1:mmu { adjust physmap map_read map_write stat pinpage };
 	allow $1 $1:hvm { getparam setparam };
 ')
 
-# create_domain(priv, target)
-#   Allow a domain to be created
-define(`create_domain', `
+# declare_build_label(type)
+#   Declare a paired _building type for the given domain type
+define(`declare_build_label', `
+	type $1_building, domain_type;
+	type_transition $1_building domain_type:event $1_channel;
+	allow $1_building $1 : domain transition;
+')
+
+define(`create_domain_common', `
 	allow $1 $2:domain { create max_vcpus setdomainmaxmem setaddrsize
-			getdomaininfo hypercall setvcpucontext scheduler
-			unpause getvcpuinfo getvcpuextstate getaddrsize
-			getvcpuaffinity };
+			getdomaininfo hypercall setvcpucontext setextvcpucontext
+			scheduler getvcpuinfo getvcpuextstate getaddrsize
+			getvcpuaffinity setvcpuaffinity };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
 	allow $1 $2:mmu {map_read map_write adjust memorymap physmap pinpage};
 	allow $1 $2:grant setup;
-	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute setparam pcilevel trackdirtyvram };
-	allow $1 $2_$1_channel:event create;
+	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc setparam pcilevel trackdirtyvram };
+')
+
+# create_domain(priv, target)
+#   Allow a domain to be created directly
+define(`create_domain', `
+	create_domain_common($1, $2)
+	allow $1 $2_channel:event create;
+')
+
+# create_domain_build_label(priv, target)
+#   Allow a domain to be created via its domain build label
+define(`create_domain_build_label', `
+	create_domain_common($1, $2_building)
+	allow $1 $2_channel:event create;
+	allow $1 $2_building:domain2 relabelfrom;
+	allow $1 $2:domain2 relabelto;
 ')
 
 # manage_domain(priv, target)
@@ -37,6 +60,15 @@ define(`manage_domain', `
 			setvcpuaffinity setdomainmaxmem };
 ')
 
+# migrate_domain_out(priv, target)
+#   Allow creation of a snapshot or migration image from a domain
+#   (inbound migration is the same as domain creation)
+define(`migrate_domain_out', `
+	allow $1 $2:hvm { gethvmc getparam irqlevel };
+	allow $1 $2:mmu { stat pageinfo map_read };
+	allow $1 $2:domain { getaddrsize getvcpucontext getextvcpucontext getvcpuextstate pause destroy };
+')
+
 ################################################################################
 #
 # Inter-domain communication
@@ -47,8 +79,6 @@ define(`manage_domain', `
 #   This allows an event channel to be created from domains with labels
 #   <source> to <dest> and will label it <chan-label>
 define(`create_channel', `
-	type $3, event_type;
-	type_transition $1 $2:event $3;
 	allow $1 $3:event { create send status };
 	allow $3 $2:event { bind };
 ')
@@ -56,8 +86,8 @@ define(`create_channel', `
 # domain_event_comms(dom1, dom2)
 #   Allow two domain types to communicate using event channels
 define(`domain_event_comms', `
-	create_channel($1, $2, $1_$2_channel)
-	create_channel($2, $1, $2_$1_channel)
+	create_channel($1, $2, $1_channel)
+	create_channel($2, $1, $2_channel)
 ')
 
 # domain_comms(dom1, dom2)
@@ -72,7 +102,7 @@ define(`domain_comms', `
 #   Allow a domain types to communicate with others of its type using grants
 #   and event channels (this includes event channels to DOMID_SELF)
 define(`domain_self_comms', `
-	create_channel($1, $1, $1_self_channel)
+	create_channel($1, $1, $1_channel)
 	allow $1 $1:grant { map_read map_write copy unmap };
 ')
 
diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
index 9550397..1162153 100644
--- a/tools/flask/policy/policy/modules/xen/xen.te
+++ b/tools/flask/policy/policy/modules/xen/xen.te
@@ -90,6 +90,7 @@ create_domain(dom0_t, isolated_domU_t)
 manage_domain(dom0_t, isolated_domU_t)
 domain_comms(dom0_t, isolated_domU_t)
 
+# Declare a boolean that denies creation of prot_domU_t domains
 gen_bool(prot_doms_locked, false)
 declare_domain(prot_domU_t)
 if (!prot_doms_locked) {
@@ -111,6 +112,15 @@ manage_domain(dom0_t, dm_dom_t)
 domain_comms(dom0_t, dm_dom_t)
 device_model(dm_dom_t, domHVM_t)
 
+# nomigrate_t must be built via the nomigrate_t_building label; once built,
+# dom0 cannot read its memory.
+declare_domain(nomigrate_t)
+declare_build_label(nomigrate_t)
+create_domain_build_label(dom0_t, nomigrate_t)
+manage_domain(dom0_t, nomigrate_t)
+domain_comms(dom0_t, nomigrate_t)
+domain_self_comms(nomigrate_t)
+
 ###############################################################################
 #
 # Device delegation
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf1-0006m9-U4; Fri, 16 Nov 2012 18:29:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQex-0006gU-Mu
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:00 +0000
Received: from [85.158.138.51:10947] by server-15.bemta-3.messagelabs.com id
	06/C2-09445-6E586A05; Fri, 16 Nov 2012 18:28:54 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-2.tower-174.messagelabs.com!1353090533!30320942!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15921 invoked from network); 16 Nov 2012 18:28:53 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-2.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:53 -0000
X-TM-IMSS-Message-ID: <892528f8000aa5cd@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 892528f8000aa5cd ;
	Fri, 16 Nov 2012 13:28:27 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3Y031862; 
	Fri, 16 Nov 2012 13:28:51 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:17 -0500
Message-Id: <1353090514-18537-3-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org
Subject: [Xen-devel] [PATCH 02/19] flask/policy: Add domain relabel example
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This adds the nomigrate_t type to the example FLASK policy which allows
domains to be created that dom0 cannot access after building.

Example domain configuration snippet:
  seclabel='customer_1:vm_r:nomigrate_t'
  init_seclabel='customer_1:vm_r:nomigrate_t_building'

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 docs/misc/xsm-flask.txt                      |  2 +
 tools/flask/policy/policy/modules/xen/xen.if | 56 +++++++++++++++++++++-------
 tools/flask/policy/policy/modules/xen/xen.te | 10 +++++
 3 files changed, 55 insertions(+), 13 deletions(-)

diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index 6b0d327..0778a28 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -60,6 +60,8 @@ that can be used without dom0 disaggregation. The main types for domUs are:
  - domU_t is a domain that can communicate with any other domU_t
  - isolated_domU_t can only communicate with dom0
  - prot_domU_t is a domain type whose creation can be disabled with a boolean
+ - nomigrate_t is a domain that must be created via the nomigrate_t_building
+   type, and whose memory cannot be read by dom0 once created
 
 HVM domains with stubdomain device models use two types (one per domain):
  - domHVM_t is an HVM domain that uses a stubdomain device model
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 3f58909..2ad11b2 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -9,24 +9,47 @@
 #   Declare a type as a domain type, and allow basic domain setup
 define(`declare_domain', `
 	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
+	type $1_channel, event_type;
+	type_transition $1 domain_type:event $1_channel;
 	allow $1 $1:grant { query setup };
 	allow $1 $1:mmu { adjust physmap map_read map_write stat pinpage };
 	allow $1 $1:hvm { getparam setparam };
 ')
 
-# create_domain(priv, target)
-#   Allow a domain to be created
-define(`create_domain', `
+# declare_build_label(type)
+#   Declare a paired _building type for the given domain type
+define(`declare_build_label', `
+	type $1_building, domain_type;
+	type_transition $1_building domain_type:event $1_channel;
+	allow $1_building $1 : domain transition;
+')
+
+define(`create_domain_common', `
 	allow $1 $2:domain { create max_vcpus setdomainmaxmem setaddrsize
-			getdomaininfo hypercall setvcpucontext scheduler
-			unpause getvcpuinfo getvcpuextstate getaddrsize
-			getvcpuaffinity };
+			getdomaininfo hypercall setvcpucontext setextvcpucontext
+			scheduler getvcpuinfo getvcpuextstate getaddrsize
+			getvcpuaffinity setvcpuaffinity };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
 	allow $1 $2:mmu {map_read map_write adjust memorymap physmap pinpage};
 	allow $1 $2:grant setup;
-	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute setparam pcilevel trackdirtyvram };
-	allow $1 $2_$1_channel:event create;
+	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc setparam pcilevel trackdirtyvram };
+')
+
+# create_domain(priv, target)
+#   Allow a domain to be created directly
+define(`create_domain', `
+	create_domain_common($1, $2)
+	allow $1 $2_channel:event create;
+')
+
+# create_domain_build_label(priv, target)
+#   Allow a domain to be created via its domain build label
+define(`create_domain_build_label', `
+	create_domain_common($1, $2_building)
+	allow $1 $2_channel:event create;
+	allow $1 $2_building:domain2 relabelfrom;
+	allow $1 $2:domain2 relabelto;
 ')
 
 # manage_domain(priv, target)
@@ -37,6 +60,15 @@ define(`manage_domain', `
 			setvcpuaffinity setdomainmaxmem };
 ')
 
+# migrate_domain_out(priv, target)
+#   Allow creation of a snapshot or migration image from a domain
+#   (inbound migration is the same as domain creation)
+define(`migrate_domain_out', `
+	allow $1 $2:hvm { gethvmc getparam irqlevel };
+	allow $1 $2:mmu { stat pageinfo map_read };
+	allow $1 $2:domain { getaddrsize getvcpucontext getextvcpucontext getvcpuextstate pause destroy };
+')
+
 ################################################################################
 #
 # Inter-domain communication
@@ -47,8 +79,6 @@ define(`manage_domain', `
 #   This allows an event channel to be created from domains with labels
 #   <source> to <dest> and will label it <chan-label>
 define(`create_channel', `
-	type $3, event_type;
-	type_transition $1 $2:event $3;
 	allow $1 $3:event { create send status };
 	allow $3 $2:event { bind };
 ')
@@ -56,8 +86,8 @@ define(`create_channel', `
 # domain_event_comms(dom1, dom2)
 #   Allow two domain types to communicate using event channels
 define(`domain_event_comms', `
-	create_channel($1, $2, $1_$2_channel)
-	create_channel($2, $1, $2_$1_channel)
+	create_channel($1, $2, $1_channel)
+	create_channel($2, $1, $2_channel)
 ')
 
 # domain_comms(dom1, dom2)
@@ -72,7 +102,7 @@ define(`domain_comms', `
 #   Allow a domain types to communicate with others of its type using grants
 #   and event channels (this includes event channels to DOMID_SELF)
 define(`domain_self_comms', `
-	create_channel($1, $1, $1_self_channel)
+	create_channel($1, $1, $1_channel)
 	allow $1 $1:grant { map_read map_write copy unmap };
 ')
 
diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
index 9550397..1162153 100644
--- a/tools/flask/policy/policy/modules/xen/xen.te
+++ b/tools/flask/policy/policy/modules/xen/xen.te
@@ -90,6 +90,7 @@ create_domain(dom0_t, isolated_domU_t)
 manage_domain(dom0_t, isolated_domU_t)
 domain_comms(dom0_t, isolated_domU_t)
 
+# Declare a boolean that denies creation of prot_domU_t domains
 gen_bool(prot_doms_locked, false)
 declare_domain(prot_domU_t)
 if (!prot_doms_locked) {
@@ -111,6 +112,15 @@ manage_domain(dom0_t, dm_dom_t)
 domain_comms(dom0_t, dm_dom_t)
 device_model(dm_dom_t, domHVM_t)
 
+# nomigrate_t must be built via the nomigrate_t_building label; once built,
+# dom0 cannot read its memory.
+declare_domain(nomigrate_t)
+declare_build_label(nomigrate_t)
+create_domain_build_label(dom0_t, nomigrate_t)
+manage_domain(dom0_t, nomigrate_t)
+domain_comms(dom0_t, nomigrate_t)
+domain_self_comms(nomigrate_t)
+
 ###############################################################################
 #
 # Device delegation
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf3-0006oe-3E; Fri, 16 Nov 2012 18:29:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQey-0006hb-PG
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:01 +0000
Received: from [85.158.138.51:9008] by server-8.bemta-3.messagelabs.com id
	B1/EC-07786-7E586A05; Fri, 16 Nov 2012 18:28:55 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353090533!28435456!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5632 invoked from network); 16 Nov 2012 18:28:54 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-15.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:54 -0000
X-TM-IMSS-Message-ID: <892529d3000aa5ce@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 892529d3000aa5ce ;
	Fri, 16 Nov 2012 13:28:27 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3Z031862; 
	Fri, 16 Nov 2012 13:28:52 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:18 -0500
Message-Id: <1353090514-18537-4-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 03/19] arch/x86: add distinct XSM hooks for
	map/unmap
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The xsm_iomem_permission and xsm_ioport_permission hooks are intended to
be called by the domain builder, while the calls in arch/x86/domctl.c
which control mapping are also performed by the device model. Because of
this, they should not use the same XSM hooks.

This also adds a missing XSM hook in the unbind IRQ domctl.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c  |  8 ++++++--
 xen/arch/x86/physdev.c |  2 +-
 xen/include/xsm/xsm.h  | 25 ++++++++++++++++++++++---
 xen/xsm/dummy.c        | 20 +++++++++++++++++++-
 xen/xsm/flask/hooks.c  | 42 ++++++++++++++++++++----------------------
 5 files changed, 68 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 508c77c..7069d7a 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -803,6 +803,10 @@ long arch_do_domctl(
              !irq_access_permitted(current->domain, bind->machine_irq) )
             goto unbind_out;
 
+        ret = xsm_unbind_pt_irq(d, bind);
+        if ( ret )
+            goto unbind_out;
+
         if ( iommu_enabled )
         {
             spin_lock(&pcidevs_lock);
@@ -842,7 +846,7 @@ long arch_do_domctl(
         if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
             break;
 
-        ret = xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, add);
+        ret = xsm_iomem_mapping(d, mfn, mfn + nr_mfns - 1, add);
         if ( ret ) {
             rcu_unlock_domain(d);
             break;
@@ -929,7 +933,7 @@ long arch_do_domctl(
         if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
             break;
 
-        ret = xsm_ioport_permission(d, fmp, fmp + np - 1, add);
+        ret = xsm_ioport_mapping(d, fmp, fmp + np - 1, add);
         if ( ret ) {
             rcu_unlock_domain(d);
             break;
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 751cbd4..2928f1c 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -242,7 +242,7 @@ int physdev_unmap_pirq(domid_t domid, int pirq)
     if ( !IS_PRIV_FOR(current->domain, d) )
         goto free_domain;
 
-    ret = xsm_irq_permission(d, domain_pirq_to_irq(d, pirq), 0);
+    ret = xsm_unmap_domain_pirq(d, domain_pirq_to_irq(d, pirq));
     if ( ret )
         goto free_domain;
 
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index a949c1e..2560229 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -117,8 +117,10 @@ struct xsm_operations {
 
     char *(*show_irq_sid) (int irq);
     int (*map_domain_pirq) (struct domain *d, int irq, void *data);
+    int (*unmap_domain_pirq) (struct domain *d, int irq);
     int (*irq_permission) (struct domain *d, int pirq, uint8_t allow);
     int (*iomem_permission) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
+    int (*iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
     int (*pci_config_permission) (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access);
 
     int (*get_device_group) (uint32_t machine_bdf);
@@ -176,11 +178,12 @@ struct xsm_operations {
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
     int (*sendtrigger) (struct domain *d);
     int (*bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*unbind_pt_irq) (struct domain *d);
+    int (*unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
     int (*pin_mem_cacheattr) (struct domain *d);
     int (*ext_vcpucontext) (struct domain *d, uint32_t cmd);
     int (*vcpuextstate) (struct domain *d, uint32_t cmd);
     int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
+    int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
 #endif
 };
 
@@ -495,6 +498,11 @@ static inline int xsm_map_domain_pirq (struct domain *d, int irq, void *data)
     return xsm_call(map_domain_pirq(d, irq, data));
 }
 
+static inline int xsm_unmap_domain_pirq (struct domain *d, int irq)
+{
+    return xsm_call(unmap_domain_pirq(d, irq));
+}
+
 static inline int xsm_irq_permission (struct domain *d, int pirq, uint8_t allow)
 {
     return xsm_call(irq_permission(d, pirq, allow));
@@ -505,6 +513,11 @@ static inline int xsm_iomem_permission (struct domain *d, uint64_t s, uint64_t e
     return xsm_call(iomem_permission(d, s, e, allow));
 }
 
+static inline int xsm_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+{
+    return xsm_call(iomem_mapping(d, s, e, allow));
+}
+
 static inline int xsm_pci_config_permission (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
     return xsm_call(pci_config_permission(d, machine_bdf, start, end, access));
@@ -781,9 +794,10 @@ static inline int xsm_bind_pt_irq(struct domain *d,
     return xsm_call(bind_pt_irq(d, bind));
 }
 
-static inline int xsm_unbind_pt_irq(struct domain *d)
+static inline int xsm_unbind_pt_irq(struct domain *d,
+                                                struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_call(unbind_pt_irq(d));
+    return xsm_call(unbind_pt_irq(d, bind));
 }
 
 static inline int xsm_pin_mem_cacheattr(struct domain *d)
@@ -804,6 +818,11 @@ static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t
 {
     return xsm_call(ioport_permission(d, s, e, allow));
 }
+
+static inline int xsm_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+{
+    return xsm_call(ioport_mapping(d, s, e, allow));
+}
 #endif /* CONFIG_X86 */
 
 extern struct xsm_operations dummy_xsm_ops;
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index b726eaf..5f078d2 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -395,6 +395,11 @@ static int dummy_map_domain_pirq (struct domain *d, int irq, void *data)
     return 0;
 }
 
+static int dummy_unmap_domain_pirq (struct domain *d, int irq)
+{
+    return 0;
+}
+
 static int dummy_irq_permission (struct domain *d, int pirq, uint8_t allow)
 {
     return 0;
@@ -405,6 +410,11 @@ static int dummy_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uin
     return 0;
 }
 
+static int dummy_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+{
+    return 0;
+}
+
 static int dummy_pci_config_permission (struct domain *d, uint32_t machine_bdf,
                                         uint16_t start, uint16_t end,
                                         uint8_t access)
@@ -585,7 +595,7 @@ static int dummy_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *b
     return 0;
 }
 
-static int dummy_unbind_pt_irq (struct domain *d)
+static int dummy_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
@@ -609,6 +619,11 @@ static int dummy_ioport_permission (struct domain *d, uint32_t s, uint32_t e, ui
 {
     return 0;
 }
+
+static int dummy_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+{
+    return 0;
+}
 #endif
 
 struct xsm_operations dummy_xsm_ops;
@@ -693,8 +708,10 @@ void xsm_fixup_ops (struct xsm_operations *ops)
 
     set_to_dummy_if_null(ops, show_irq_sid);
     set_to_dummy_if_null(ops, map_domain_pirq);
+    set_to_dummy_if_null(ops, unmap_domain_pirq);
     set_to_dummy_if_null(ops, irq_permission);
     set_to_dummy_if_null(ops, iomem_permission);
+    set_to_dummy_if_null(ops, iomem_mapping);
     set_to_dummy_if_null(ops, pci_config_permission);
 
     set_to_dummy_if_null(ops, get_device_group);
@@ -757,5 +774,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, ext_vcpucontext);
     set_to_dummy_if_null(ops, vcpuextstate);
     set_to_dummy_if_null(ops, ioport_permission);
+    set_to_dummy_if_null(ops, ioport_mapping);
 #endif
 }
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 0ca10d0..d4635d0 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -721,43 +721,40 @@ static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
     return rc;
 }
 
-static int flask_irq_permission (struct domain *d, int irq, uint8_t access)
+static int flask_unmap_domain_pirq (struct domain *d, int irq)
 {
-    u32 perm;
-    u32 rsid;
+    u32 sid;
     int rc = -EPERM;
 
-    struct domain_security_struct *ssec, *tsec;
+    struct domain_security_struct *ssec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
-                         resource_to_perm(access));
-
+    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
     if ( rc )
         return rc;
 
-    if ( access )
-        perm = RESOURCE__ADD_IRQ;
-    else
-        perm = RESOURCE__REMOVE_IRQ;
-
     ssec = current->domain->ssid;
-    tsec = d->ssid;
 
-    rc = get_irq_sid(irq, &rsid, &ad);
-    if ( rc )
-        return rc;
-
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
+    if ( irq >= nr_irqs_gsi ) {
+        /* TODO support for MSI here */
+        return 0;
+    } else {
+        rc = get_irq_sid(irq, &sid, &ad);
+    }
     if ( rc )
         return rc;
 
-    if ( access )
-        rc = avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, 
-                            RESOURCE__USE, &ad);
+    rc = avc_has_perm(ssec->sid, sid, SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, &ad);
     return rc;
 }
 
+static int flask_irq_permission (struct domain *d, int pirq, uint8_t access)
+{
+    /* the PIRQ number is not useful; real IRQ is checked during mapping */
+    return domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
+                           resource_to_perm(access));
+}
+
 struct iomem_has_perm_data {
     struct domain_security_struct *ssec, *tsec;
     u32 perm;
@@ -1413,7 +1410,7 @@ static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *b
     return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_unbind_pt_irq (struct domain *d)
+static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
@@ -1533,6 +1530,7 @@ static struct xsm_operations flask_ops = {
     .show_irq_sid = flask_show_irq_sid,
 
     .map_domain_pirq = flask_map_domain_pirq,
+    .unmap_domain_pirq = flask_unmap_domain_pirq,
     .irq_permission = flask_irq_permission,
     .iomem_permission = flask_iomem_permission,
     .pci_config_permission = flask_pci_config_permission,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf3-0006oe-3E; Fri, 16 Nov 2012 18:29:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQey-0006hb-PG
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:01 +0000
Received: from [85.158.138.51:9008] by server-8.bemta-3.messagelabs.com id
	B1/EC-07786-7E586A05; Fri, 16 Nov 2012 18:28:55 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353090533!28435456!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5632 invoked from network); 16 Nov 2012 18:28:54 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-15.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:54 -0000
X-TM-IMSS-Message-ID: <892529d3000aa5ce@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 892529d3000aa5ce ;
	Fri, 16 Nov 2012 13:28:27 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3Z031862; 
	Fri, 16 Nov 2012 13:28:52 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:18 -0500
Message-Id: <1353090514-18537-4-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 03/19] arch/x86: add distinct XSM hooks for
	map/unmap
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The xsm_iomem_permission and xsm_ioport_permission hooks are intended to
be called by the domain builder, while the calls in arch/x86/domctl.c
which control mapping are also performed by the device model. Because of
this, they should not use the same XSM hooks.

This also adds a missing XSM hook in the unbind IRQ domctl.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c  |  8 ++++++--
 xen/arch/x86/physdev.c |  2 +-
 xen/include/xsm/xsm.h  | 25 ++++++++++++++++++++++---
 xen/xsm/dummy.c        | 20 +++++++++++++++++++-
 xen/xsm/flask/hooks.c  | 42 ++++++++++++++++++++----------------------
 5 files changed, 68 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 508c77c..7069d7a 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -803,6 +803,10 @@ long arch_do_domctl(
              !irq_access_permitted(current->domain, bind->machine_irq) )
             goto unbind_out;
 
+        ret = xsm_unbind_pt_irq(d, bind);
+        if ( ret )
+            goto unbind_out;
+
         if ( iommu_enabled )
         {
             spin_lock(&pcidevs_lock);
@@ -842,7 +846,7 @@ long arch_do_domctl(
         if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
             break;
 
-        ret = xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, add);
+        ret = xsm_iomem_mapping(d, mfn, mfn + nr_mfns - 1, add);
         if ( ret ) {
             rcu_unlock_domain(d);
             break;
@@ -929,7 +933,7 @@ long arch_do_domctl(
         if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
             break;
 
-        ret = xsm_ioport_permission(d, fmp, fmp + np - 1, add);
+        ret = xsm_ioport_mapping(d, fmp, fmp + np - 1, add);
         if ( ret ) {
             rcu_unlock_domain(d);
             break;
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 751cbd4..2928f1c 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -242,7 +242,7 @@ int physdev_unmap_pirq(domid_t domid, int pirq)
     if ( !IS_PRIV_FOR(current->domain, d) )
         goto free_domain;
 
-    ret = xsm_irq_permission(d, domain_pirq_to_irq(d, pirq), 0);
+    ret = xsm_unmap_domain_pirq(d, domain_pirq_to_irq(d, pirq));
     if ( ret )
         goto free_domain;
 
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index a949c1e..2560229 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -117,8 +117,10 @@ struct xsm_operations {
 
     char *(*show_irq_sid) (int irq);
     int (*map_domain_pirq) (struct domain *d, int irq, void *data);
+    int (*unmap_domain_pirq) (struct domain *d, int irq);
     int (*irq_permission) (struct domain *d, int pirq, uint8_t allow);
     int (*iomem_permission) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
+    int (*iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
     int (*pci_config_permission) (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access);
 
     int (*get_device_group) (uint32_t machine_bdf);
@@ -176,11 +178,12 @@ struct xsm_operations {
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
     int (*sendtrigger) (struct domain *d);
     int (*bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*unbind_pt_irq) (struct domain *d);
+    int (*unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
     int (*pin_mem_cacheattr) (struct domain *d);
     int (*ext_vcpucontext) (struct domain *d, uint32_t cmd);
     int (*vcpuextstate) (struct domain *d, uint32_t cmd);
     int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
+    int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
 #endif
 };
 
@@ -495,6 +498,11 @@ static inline int xsm_map_domain_pirq (struct domain *d, int irq, void *data)
     return xsm_call(map_domain_pirq(d, irq, data));
 }
 
+static inline int xsm_unmap_domain_pirq (struct domain *d, int irq)
+{
+    return xsm_call(unmap_domain_pirq(d, irq));
+}
+
 static inline int xsm_irq_permission (struct domain *d, int pirq, uint8_t allow)
 {
     return xsm_call(irq_permission(d, pirq, allow));
@@ -505,6 +513,11 @@ static inline int xsm_iomem_permission (struct domain *d, uint64_t s, uint64_t e
     return xsm_call(iomem_permission(d, s, e, allow));
 }
 
+static inline int xsm_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+{
+    return xsm_call(iomem_mapping(d, s, e, allow));
+}
+
 static inline int xsm_pci_config_permission (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
     return xsm_call(pci_config_permission(d, machine_bdf, start, end, access));
@@ -781,9 +794,10 @@ static inline int xsm_bind_pt_irq(struct domain *d,
     return xsm_call(bind_pt_irq(d, bind));
 }
 
-static inline int xsm_unbind_pt_irq(struct domain *d)
+static inline int xsm_unbind_pt_irq(struct domain *d,
+                                                struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_call(unbind_pt_irq(d));
+    return xsm_call(unbind_pt_irq(d, bind));
 }
 
 static inline int xsm_pin_mem_cacheattr(struct domain *d)
@@ -804,6 +818,11 @@ static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t
 {
     return xsm_call(ioport_permission(d, s, e, allow));
 }
+
+static inline int xsm_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+{
+    return xsm_call(ioport_mapping(d, s, e, allow));
+}
 #endif /* CONFIG_X86 */
 
 extern struct xsm_operations dummy_xsm_ops;
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index b726eaf..5f078d2 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -395,6 +395,11 @@ static int dummy_map_domain_pirq (struct domain *d, int irq, void *data)
     return 0;
 }
 
+static int dummy_unmap_domain_pirq (struct domain *d, int irq)
+{
+    return 0;
+}
+
 static int dummy_irq_permission (struct domain *d, int pirq, uint8_t allow)
 {
     return 0;
@@ -405,6 +410,11 @@ static int dummy_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uin
     return 0;
 }
 
+static int dummy_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+{
+    return 0;
+}
+
 static int dummy_pci_config_permission (struct domain *d, uint32_t machine_bdf,
                                         uint16_t start, uint16_t end,
                                         uint8_t access)
@@ -585,7 +595,7 @@ static int dummy_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *b
     return 0;
 }
 
-static int dummy_unbind_pt_irq (struct domain *d)
+static int dummy_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
@@ -609,6 +619,11 @@ static int dummy_ioport_permission (struct domain *d, uint32_t s, uint32_t e, ui
 {
     return 0;
 }
+
+static int dummy_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+{
+    return 0;
+}
 #endif
 
 struct xsm_operations dummy_xsm_ops;
@@ -693,8 +708,10 @@ void xsm_fixup_ops (struct xsm_operations *ops)
 
     set_to_dummy_if_null(ops, show_irq_sid);
     set_to_dummy_if_null(ops, map_domain_pirq);
+    set_to_dummy_if_null(ops, unmap_domain_pirq);
     set_to_dummy_if_null(ops, irq_permission);
     set_to_dummy_if_null(ops, iomem_permission);
+    set_to_dummy_if_null(ops, iomem_mapping);
     set_to_dummy_if_null(ops, pci_config_permission);
 
     set_to_dummy_if_null(ops, get_device_group);
@@ -757,5 +774,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, ext_vcpucontext);
     set_to_dummy_if_null(ops, vcpuextstate);
     set_to_dummy_if_null(ops, ioport_permission);
+    set_to_dummy_if_null(ops, ioport_mapping);
 #endif
 }
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 0ca10d0..d4635d0 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -721,43 +721,40 @@ static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
     return rc;
 }
 
-static int flask_irq_permission (struct domain *d, int irq, uint8_t access)
+static int flask_unmap_domain_pirq (struct domain *d, int irq)
 {
-    u32 perm;
-    u32 rsid;
+    u32 sid;
     int rc = -EPERM;
 
-    struct domain_security_struct *ssec, *tsec;
+    struct domain_security_struct *ssec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
-                         resource_to_perm(access));
-
+    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
     if ( rc )
         return rc;
 
-    if ( access )
-        perm = RESOURCE__ADD_IRQ;
-    else
-        perm = RESOURCE__REMOVE_IRQ;
-
     ssec = current->domain->ssid;
-    tsec = d->ssid;
 
-    rc = get_irq_sid(irq, &rsid, &ad);
-    if ( rc )
-        return rc;
-
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
+    if ( irq >= nr_irqs_gsi ) {
+        /* TODO support for MSI here */
+        return 0;
+    } else {
+        rc = get_irq_sid(irq, &sid, &ad);
+    }
     if ( rc )
         return rc;
 
-    if ( access )
-        rc = avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, 
-                            RESOURCE__USE, &ad);
+    rc = avc_has_perm(ssec->sid, sid, SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, &ad);
     return rc;
 }
 
+static int flask_irq_permission (struct domain *d, int pirq, uint8_t access)
+{
+    /* the PIRQ number is not useful; real IRQ is checked during mapping */
+    return domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
+                           resource_to_perm(access));
+}
+
 struct iomem_has_perm_data {
     struct domain_security_struct *ssec, *tsec;
     u32 perm;
@@ -1413,7 +1410,7 @@ static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *b
     return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_unbind_pt_irq (struct domain *d)
+static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
@@ -1533,6 +1530,7 @@ static struct xsm_operations flask_ops = {
     .show_irq_sid = flask_show_irq_sid,
 
     .map_domain_pirq = flask_map_domain_pirq,
+    .unmap_domain_pirq = flask_unmap_domain_pirq,
     .irq_permission = flask_irq_permission,
     .iomem_permission = flask_iomem_permission,
     .pci_config_permission = flask_pci_config_permission,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf3-0006pr-Me; Fri, 16 Nov 2012 18:29:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQez-0006gV-18
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:01 +0000
Received: from [85.158.138.51:11227] by server-12.bemta-3.messagelabs.com id
	CB/72-22757-CE586A05; Fri, 16 Nov 2012 18:29:00 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-174.messagelabs.com!1353090539!23991289!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16822 invoked from network); 16 Nov 2012 18:28:59 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-14.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:59 -0000
X-TM-IMSS-Message-ID: <89253f27000aa5d8@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 89253f27000aa5d8 ;
	Fri, 16 Nov 2012 13:28:32 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3n031862; 
	Fri, 16 Nov 2012 13:28:57 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:32 -0500
Message-Id: <1353090514-18537-18-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org
Subject: [Xen-devel] [PATCH 17/19] tmem: add XSM hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This adds a pair of XSM hooks for tmem operations: xsm_tmem_op which
controls any use of tmem, and xsm_tmem_control which allows use of the
TMEM_CONTROL operations. By default, all domains can use tmem while only
IS_PRIV domains can use control operations.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
---
 tools/flask/policy/policy/flask/access_vectors |  2 ++
 xen/common/tmem.c                              |  3 +++
 xen/include/xen/tmem_xen.h                     |  8 +++++++-
 xen/include/xsm/dummy.h                        | 12 ++++++++++++
 xen/include/xsm/xsm.h                          | 12 ++++++++++++
 xen/xsm/dummy.c                                |  2 ++
 xen/xsm/flask/hooks.c                          | 12 ++++++++++++
 xen/xsm/flask/include/av_perm_to_string.h      |  2 ++
 xen/xsm/flask/include/av_permissions.h         |  2 ++
 9 files changed, 54 insertions(+), 1 deletion(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index caf65d2..7a7e253 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -35,6 +35,8 @@ class xen
 	lockprof
 	cpupool_op
 	sched_op
+	tmem_op
+	tmem_control
 }
 
 class domain
diff --git a/xen/common/tmem.c b/xen/common/tmem.c
index 44e2772..ca70e86 100644
--- a/xen/common/tmem.c
+++ b/xen/common/tmem.c
@@ -2644,6 +2644,9 @@ EXPORT long do_tmem_op(tmem_cli_op_t uops)
     if ( !tmem_initialized )
         return -ENODEV;
 
+    if ( !tmh_current_permitted() )
+        return -EPERM;
+
     total_tmem_ops++;
 
     if ( tmh_lock_all )
diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h
index 36a8d9f..8dec5aa 100644
--- a/xen/include/xen/tmem_xen.h
+++ b/xen/include/xen/tmem_xen.h
@@ -16,6 +16,7 @@
 #include <xen/guest_access.h> /* copy_from_guest */
 #include <xen/hash.h> /* hash_long */
 #include <xen/domain_page.h> /* __map_domain_page */
+#include <xsm/xsm.h> /* xsm_tmem_control */
 #include <public/tmem.h>
 #ifdef CONFIG_COMPAT
 #include <compat/tmem.h>
@@ -326,9 +327,14 @@ static inline bool_t tmh_set_client_from_id(
     return rc;
 }
 
+static inline bool_t tmh_current_permitted(void)
+{
+    return !xsm_tmem_op();
+}
+
 static inline bool_t tmh_current_is_privileged(void)
 {
-    return IS_PRIV(current->domain);
+    return !xsm_tmem_control();
 }
 
 static inline uint8_t tmh_get_first_byte(pfp_t *pfp)
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index f115151..040b463 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -443,6 +443,18 @@ static XSM_DEFAULT(int, sched_op) (void)
     return 0;
 }
 
+static XSM_DEFAULT(int, tmem_op) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, tmem_control) (void)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_DEFAULT(long, do_xsm_op)(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
     return -ENOSYS;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 628ddd6..748f5ff 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -134,6 +134,8 @@ struct xsm_operations {
     int (*lockprof)(void);
     int (*cpupool_op)(void);
     int (*sched_op)(void);
+    int (*tmem_op)(void);
+    int (*tmem_control)(void);
 
     long (*do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
 
@@ -610,6 +612,16 @@ static inline int xsm_sched_op(void)
     return xsm_ops->sched_op();
 }
 
+static inline int xsm_tmem_op(void)
+{
+    return xsm_ops->tmem_op();
+}
+
+static inline int xsm_tmem_control(void)
+{
+    return xsm_ops->tmem_control();
+}
+
 static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
     return xsm_ops->do_xsm_op(op);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 26e04d5..6e113fb 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -120,6 +120,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, lockprof);
     set_to_dummy_if_null(ops, cpupool_op);
     set_to_dummy_if_null(ops, sched_op);
+    set_to_dummy_if_null(ops, tmem_op);
+    set_to_dummy_if_null(ops, tmem_control);
 
     set_to_dummy_if_null(ops, do_xsm_op);
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 167f8e6..e815ea5 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1079,6 +1079,16 @@ static inline int flask_sched_op(void)
     return domain_has_xen(current->domain, XEN__SCHED_OP);
 }
 
+static inline int flask_tmem_op(void)
+{
+    return domain_has_xen(current->domain, XEN__TMEM_OP);
+}
+
+static inline int flask_tmem_control(void)
+{
+    return domain_has_xen(current->domain, XEN__TMEM_CONTROL);
+}
+
 static int flask_perfcontrol(void)
 {
     return domain_has_xen(current->domain, XEN__PERFCONTROL);
@@ -1723,6 +1733,8 @@ static struct xsm_operations flask_ops = {
     .lockprof = flask_lockprof,
     .cpupool_op = flask_cpupool_op,
     .sched_op = flask_sched_op,
+    .tmem_op = flask_tmem_op,
+    .tmem_control = flask_tmem_control,
 
     .do_xsm_op = do_flask_op,
 
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 79d5939..c3f2370 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -29,6 +29,8 @@
    S_(SECCLASS_XEN, XEN__LOCKPROF, "lockprof")
    S_(SECCLASS_XEN, XEN__CPUPOOL_OP, "cpupool_op")
    S_(SECCLASS_XEN, XEN__SCHED_OP, "sched_op")
+   S_(SECCLASS_XEN, XEN__TMEM_OP, "tmem_op")
+   S_(SECCLASS_XEN, XEN__TMEM_CONTROL, "tmem_control")
    S_(SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT, "setvcpucontext")
    S_(SECCLASS_DOMAIN, DOMAIN__PAUSE, "pause")
    S_(SECCLASS_DOMAIN, DOMAIN__UNPAUSE, "unpause")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index d982328..65302e8 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -29,6 +29,8 @@
 #define XEN__LOCKPROF                             0x08000000UL
 #define XEN__CPUPOOL_OP                           0x10000000UL
 #define XEN__SCHED_OP                             0x20000000UL
+#define XEN__TMEM_OP                              0x40000000UL
+#define XEN__TMEM_CONTROL                         0x80000000UL
 
 #define DOMAIN__SETVCPUCONTEXT                    0x00000001UL
 #define DOMAIN__PAUSE                             0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf3-0006pr-Me; Fri, 16 Nov 2012 18:29:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQez-0006gV-18
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:01 +0000
Received: from [85.158.138.51:11227] by server-12.bemta-3.messagelabs.com id
	CB/72-22757-CE586A05; Fri, 16 Nov 2012 18:29:00 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-174.messagelabs.com!1353090539!23991289!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16822 invoked from network); 16 Nov 2012 18:28:59 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-14.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:59 -0000
X-TM-IMSS-Message-ID: <89253f27000aa5d8@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 89253f27000aa5d8 ;
	Fri, 16 Nov 2012 13:28:32 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3n031862; 
	Fri, 16 Nov 2012 13:28:57 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:32 -0500
Message-Id: <1353090514-18537-18-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org
Subject: [Xen-devel] [PATCH 17/19] tmem: add XSM hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This adds a pair of XSM hooks for tmem operations: xsm_tmem_op which
controls any use of tmem, and xsm_tmem_control which allows use of the
TMEM_CONTROL operations. By default, all domains can use tmem while only
IS_PRIV domains can use control operations.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
---
 tools/flask/policy/policy/flask/access_vectors |  2 ++
 xen/common/tmem.c                              |  3 +++
 xen/include/xen/tmem_xen.h                     |  8 +++++++-
 xen/include/xsm/dummy.h                        | 12 ++++++++++++
 xen/include/xsm/xsm.h                          | 12 ++++++++++++
 xen/xsm/dummy.c                                |  2 ++
 xen/xsm/flask/hooks.c                          | 12 ++++++++++++
 xen/xsm/flask/include/av_perm_to_string.h      |  2 ++
 xen/xsm/flask/include/av_permissions.h         |  2 ++
 9 files changed, 54 insertions(+), 1 deletion(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index caf65d2..7a7e253 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -35,6 +35,8 @@ class xen
 	lockprof
 	cpupool_op
 	sched_op
+	tmem_op
+	tmem_control
 }
 
 class domain
diff --git a/xen/common/tmem.c b/xen/common/tmem.c
index 44e2772..ca70e86 100644
--- a/xen/common/tmem.c
+++ b/xen/common/tmem.c
@@ -2644,6 +2644,9 @@ EXPORT long do_tmem_op(tmem_cli_op_t uops)
     if ( !tmem_initialized )
         return -ENODEV;
 
+    if ( !tmh_current_permitted() )
+        return -EPERM;
+
     total_tmem_ops++;
 
     if ( tmh_lock_all )
diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h
index 36a8d9f..8dec5aa 100644
--- a/xen/include/xen/tmem_xen.h
+++ b/xen/include/xen/tmem_xen.h
@@ -16,6 +16,7 @@
 #include <xen/guest_access.h> /* copy_from_guest */
 #include <xen/hash.h> /* hash_long */
 #include <xen/domain_page.h> /* __map_domain_page */
+#include <xsm/xsm.h> /* xsm_tmem_control */
 #include <public/tmem.h>
 #ifdef CONFIG_COMPAT
 #include <compat/tmem.h>
@@ -326,9 +327,14 @@ static inline bool_t tmh_set_client_from_id(
     return rc;
 }
 
+static inline bool_t tmh_current_permitted(void)
+{
+    return !xsm_tmem_op();
+}
+
 static inline bool_t tmh_current_is_privileged(void)
 {
-    return IS_PRIV(current->domain);
+    return !xsm_tmem_control();
 }
 
 static inline uint8_t tmh_get_first_byte(pfp_t *pfp)
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index f115151..040b463 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -443,6 +443,18 @@ static XSM_DEFAULT(int, sched_op) (void)
     return 0;
 }
 
+static XSM_DEFAULT(int, tmem_op) (void)
+{
+    return 0;
+}
+
+static XSM_DEFAULT(int, tmem_control) (void)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_DEFAULT(long, do_xsm_op)(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
     return -ENOSYS;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 628ddd6..748f5ff 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -134,6 +134,8 @@ struct xsm_operations {
     int (*lockprof)(void);
     int (*cpupool_op)(void);
     int (*sched_op)(void);
+    int (*tmem_op)(void);
+    int (*tmem_control)(void);
 
     long (*do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
 
@@ -610,6 +612,16 @@ static inline int xsm_sched_op(void)
     return xsm_ops->sched_op();
 }
 
+static inline int xsm_tmem_op(void)
+{
+    return xsm_ops->tmem_op();
+}
+
+static inline int xsm_tmem_control(void)
+{
+    return xsm_ops->tmem_control();
+}
+
 static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
     return xsm_ops->do_xsm_op(op);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 26e04d5..6e113fb 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -120,6 +120,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, lockprof);
     set_to_dummy_if_null(ops, cpupool_op);
     set_to_dummy_if_null(ops, sched_op);
+    set_to_dummy_if_null(ops, tmem_op);
+    set_to_dummy_if_null(ops, tmem_control);
 
     set_to_dummy_if_null(ops, do_xsm_op);
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 167f8e6..e815ea5 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1079,6 +1079,16 @@ static inline int flask_sched_op(void)
     return domain_has_xen(current->domain, XEN__SCHED_OP);
 }
 
+static inline int flask_tmem_op(void)
+{
+    return domain_has_xen(current->domain, XEN__TMEM_OP);
+}
+
+static inline int flask_tmem_control(void)
+{
+    return domain_has_xen(current->domain, XEN__TMEM_CONTROL);
+}
+
 static int flask_perfcontrol(void)
 {
     return domain_has_xen(current->domain, XEN__PERFCONTROL);
@@ -1723,6 +1733,8 @@ static struct xsm_operations flask_ops = {
     .lockprof = flask_lockprof,
     .cpupool_op = flask_cpupool_op,
     .sched_op = flask_sched_op,
+    .tmem_op = flask_tmem_op,
+    .tmem_control = flask_tmem_control,
 
     .do_xsm_op = do_flask_op,
 
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 79d5939..c3f2370 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -29,6 +29,8 @@
    S_(SECCLASS_XEN, XEN__LOCKPROF, "lockprof")
    S_(SECCLASS_XEN, XEN__CPUPOOL_OP, "cpupool_op")
    S_(SECCLASS_XEN, XEN__SCHED_OP, "sched_op")
+   S_(SECCLASS_XEN, XEN__TMEM_OP, "tmem_op")
+   S_(SECCLASS_XEN, XEN__TMEM_CONTROL, "tmem_control")
    S_(SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT, "setvcpucontext")
    S_(SECCLASS_DOMAIN, DOMAIN__PAUSE, "pause")
    S_(SECCLASS_DOMAIN, DOMAIN__UNPAUSE, "unpause")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index d982328..65302e8 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -29,6 +29,8 @@
 #define XEN__LOCKPROF                             0x08000000UL
 #define XEN__CPUPOOL_OP                           0x10000000UL
 #define XEN__SCHED_OP                             0x20000000UL
+#define XEN__TMEM_OP                              0x40000000UL
+#define XEN__TMEM_CONTROL                         0x80000000UL
 
 #define DOMAIN__SETVCPUCONTEXT                    0x00000001UL
 #define DOMAIN__PAUSE                             0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf4-0006rH-CX; Fri, 16 Nov 2012 18:29:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQez-0006fP-64
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:01 +0000
Received: from [85.158.139.211:17546] by server-4.bemta-5.messagelabs.com id
	47/81-15011-CE586A05; Fri, 16 Nov 2012 18:29:00 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-9.tower-206.messagelabs.com!1353090538!18992237!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25337 invoked from network); 16 Nov 2012 18:28:59 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-9.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 18:28:59 -0000
X-TM-IMSS-Message-ID: <8924dba4000aed64@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8924dba4000aed64 ;
	Fri, 16 Nov 2012 13:31:39 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3l031862; 
	Fri, 16 Nov 2012 13:28:56 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:30 -0500
Message-Id: <1353090514-18537-16-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Tim Deegan <tim@xen.org>, Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	keir@xen.org, Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 15/19] arch/x86: use XSM hooks for get_pg_owner
	access checks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

There are three callers of get_pg_owner:
 * do_mmuext_op, which does not have XSM hooks on all subfunctions
 * do_mmu_update, which has hooks that are inefficient
 * do_update_va_mapping_otherdomain, which has a simple XSM hook

In order to preserve return values for the do_mmuext_op hypercall, an
additional XSM hook is required to check the operation even for those
subfunctions that do not use the pg_owner field. This also covers the
MMUEXT_UNPIN_TABLE operation which did previously have an XSM hook.

The XSM hooks in do_mmu_update were capable of replacing the checks in
get_pg_owner; however, the hooks are buried in the inner loop of the
function - not very good for performance when XSM is enabled and these
turn in to indirect function calls. This patch removes the PTE from the
hooks and replaces it with a bitfield describing what accesses are being
requested. The XSM hook can then be called only when additional bits are
set instead of once per iteration of the loop.

This patch results in a change in the FLASK permissions used for mapping
an MMIO page: the target for the permisison check on the memory mapping
is no longer resolved to the device-specific type, and is instead either
the domain's own type or domio_t (depending on if the domain uses
DOMID_SELF or DOMID_IO in the map command). Device-specific access is
still controlled via the "resource use" permisison checked at domain
creation (or device hotplug).

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Tim Deegan <tim@xen.org>
---
 tools/flask/policy/policy/flask/access_vectors |  1 +
 tools/flask/policy/policy/modules/xen/xen.if   |  6 +--
 tools/flask/policy/policy/modules/xen/xen.te   |  5 +-
 xen/arch/x86/mm.c                              | 53 +++++++++++--------
 xen/include/xsm/dummy.h                        | 15 ++++--
 xen/include/xsm/xsm.h                          | 25 +++++----
 xen/xsm/dummy.c                                |  4 +-
 xen/xsm/flask/hooks.c                          | 71 +++++++++-----------------
 xen/xsm/flask/include/av_perm_to_string.h      |  1 +
 xen/xsm/flask/include/av_permissions.h         |  1 +
 10 files changed, 91 insertions(+), 91 deletions(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index 45ac437..8324725 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -141,6 +141,7 @@ class mmu
     mfnlist
     memorymap
     remote_remap
+	mmuext_op
 }
 
 class shadow
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index d630f47..fda5cb5 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -7,7 +7,7 @@
 ################################################################################
 define(`declare_domain_common', `
 	allow $1 $2:grant { query setup };
-	allow $1 $2:mmu { adjust physmap map_read map_write stat pinpage updatemp };
+	allow $1 $2:mmu { adjust physmap map_read map_write stat pinpage updatemp mmuext_op };
 	allow $1 $2:hvm { getparam setparam };
 ')
 
@@ -51,7 +51,7 @@ define(`create_domain_common', `
 	allow $1 $2:domain2 { set_cpuid settsc };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
-	allow $1 $2:mmu {map_read map_write adjust memorymap physmap pinpage};
+	allow $1 $2:mmu { map_read map_write adjust memorymap physmap pinpage mmuext_op };
 	allow $1 $2:grant setup;
 	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc setparam pcilevel trackdirtyvram };
 ')
@@ -162,7 +162,7 @@ define(`make_device_model', `
 #   Allow a device to be used by a domain
 define(`use_device', `
     allow $1 $2:resource use;
-    allow $1 $2:mmu { map_read map_write };
+    allow $1 domio_t:mmu { map_read map_write };
 ')
 
 # admin_device(domain, device)
diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
index 8d33285..8c77e6b 100644
--- a/tools/flask/policy/policy/modules/xen/xen.te
+++ b/tools/flask/policy/policy/modules/xen/xen.te
@@ -29,10 +29,10 @@ type xen_t, xen_type, mls_priv;
 # Domain 0
 declare_singleton_domain(dom0_t, mls_priv);
 
-# Untracked I/O memory (pseudo-domain)
+# I/O memory (DOMID_IO pseudo-domain)
 type domio_t, xen_type;
 
-# Xen heap (pseudo-domain)
+# Xen heap (DOMID_XEN pseudo-domain)
 type domxen_t, xen_type;
 
 # Unlabeled objects
@@ -69,7 +69,6 @@ admin_device(dom0_t, device_t)
 admin_device(dom0_t, irq_t)
 admin_device(dom0_t, ioport_t)
 admin_device(dom0_t, iomem_t)
-allow dom0_t domio_t:mmu { map_read map_write };
 
 domain_comms(dom0_t, dom0_t)
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b065bcf..39b2cc7 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2620,11 +2620,6 @@ static struct domain *get_pg_owner(domid_t domid)
         pg_owner = rcu_lock_domain(dom_io);
         break;
     case DOMID_XEN:
-        if ( !IS_PRIV(curr) )
-        {
-            MEM_LOG("Cannot set foreign dom");
-            break;
-        }
         pg_owner = rcu_lock_domain(dom_xen);
         break;
     default:
@@ -2633,12 +2628,6 @@ static struct domain *get_pg_owner(domid_t domid)
             MEM_LOG("Unknown domain '%u'", domid);
             break;
         }
-        if ( !IS_PRIV_FOR(curr, pg_owner) )
-        {
-            MEM_LOG("Cannot set foreign dom");
-            rcu_unlock_domain(pg_owner);
-            pg_owner = NULL;
-        }
         break;
     }
 
@@ -2726,6 +2715,13 @@ long do_mmuext_op(
         goto out;
     }
 
+    rc = xsm_mmuext_op(d, pg_owner);
+    if ( rc )
+    {
+        rcu_unlock_domain(pg_owner);
+        goto out;
+    }
+
     for ( i = 0; i < count; i++ )
     {
         if ( hypercall_preempt_check() )
@@ -3167,6 +3163,8 @@ long do_mmu_update(
     struct vcpu *v = current;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     struct domain_mmap_cache mapcache;
+    uint32_t xsm_needed = 0;
+    uint32_t xsm_checked = 0;
 
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
@@ -3198,11 +3196,6 @@ long do_mmu_update(
             rc = -EINVAL;
             goto out;
         }
-        if ( !IS_PRIV_FOR(d, pt_owner) )
-        {
-            rc = -ESRCH;
-            goto out;
-        }
     }
 
     if ( (pg_owner = get_pg_owner((uint16_t)foreigndom)) == NULL )
@@ -3242,9 +3235,20 @@ long do_mmu_update(
         {
             p2m_type_t p2mt;
 
-            rc = xsm_mmu_normal_update(d, pt_owner, pg_owner, req.val);
-            if ( rc )
-                break;
+            xsm_needed |= XSM_MMU_NORMAL_UPDATE;
+            if ( get_pte_flags(req.val) & _PAGE_PRESENT )
+            {
+                xsm_needed |= XSM_MMU_UPDATE_READ;
+                if ( get_pte_flags(req.val) & _PAGE_RW )
+                    xsm_needed |= XSM_MMU_UPDATE_WRITE;
+            }
+            if ( xsm_needed != xsm_checked )
+            {
+                rc = xsm_mmu_update(d, pt_owner, pg_owner, xsm_needed);
+                if ( rc )
+                    break;
+                xsm_checked = xsm_needed;
+            }
             rc = -EINVAL;
 
             req.ptr -= cmd;
@@ -3356,9 +3360,14 @@ long do_mmu_update(
             mfn = req.ptr >> PAGE_SHIFT;
             gpfn = req.val;
 
-            rc = xsm_mmu_machphys_update(d, pg_owner, mfn);
-            if ( rc )
-                break;
+            xsm_needed |= XSM_MMU_MACHPHYS_UPDATE;
+            if ( xsm_needed != xsm_checked )
+            {
+                rc = xsm_mmu_update(d, NULL, pg_owner, xsm_needed);
+                if ( rc )
+                    break;
+                xsm_checked = xsm_needed;
+            }
 
             if ( unlikely(!get_page_from_pagenr(mfn, pg_owner)) )
             {
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index ee381a8..8131a57 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -662,21 +662,28 @@ static XSM_DEFAULT(int, domain_memory_map) (struct domain *d)
     return 0;
 }
 
-static XSM_DEFAULT(int, mmu_normal_update) (struct domain *d, struct domain *t,
-                                            struct domain *f, intpte_t fpte)
+static XSM_DEFAULT(int, mmu_update) (struct domain *d, struct domain *t,
+                                     struct domain *f, uint32_t flags)
 {
+    if ( t && d != t && !IS_PRIV_FOR(d, t) )
+        return -EPERM;
+    if ( d != f && !IS_PRIV_FOR(d, f) )
+        return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, mmu_machphys_update) (struct domain *d, struct domain *f,
-                                              unsigned long mfn)
+static XSM_DEFAULT(int, mmuext_op) (struct domain *d, struct domain *f)
 {
+    if ( d != f && !IS_PRIV_FOR(d, f) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, update_va_mapping) (struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
+    if ( d != f && !IS_PRIV_FOR(d, f) )
+        return -EPERM;
     return 0;
 }
 
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 1b9f939..092efdc 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -27,8 +27,6 @@ typedef u32 xsm_magic_t;
 #define XSM_MAGIC 0x00000000
 #endif
 
-#ifdef XSM_ENABLE
-
 extern char *policy_buffer;
 extern u32 policy_size;
 
@@ -170,9 +168,13 @@ struct xsm_operations {
     int (*getidletime) (void);
     int (*machine_memory_map) (void);
     int (*domain_memory_map) (struct domain *d);
-    int (*mmu_normal_update) (struct domain *d, struct domain *t,
-                              struct domain *f, intpte_t fpte);
-    int (*mmu_machphys_update) (struct domain *d1, struct domain *d2, unsigned long mfn);
+#define XSM_MMU_UPDATE_READ      1
+#define XSM_MMU_UPDATE_WRITE     2
+#define XSM_MMU_NORMAL_UPDATE    4
+#define XSM_MMU_MACHPHYS_UPDATE  8
+    int (*mmu_update) (struct domain *d, struct domain *t,
+                       struct domain *f, uint32_t flags);
+    int (*mmuext_op) (struct domain *d, struct domain *f);
     int (*update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
     int (*sendtrigger) (struct domain *d);
@@ -186,6 +188,8 @@ struct xsm_operations {
 #endif
 };
 
+#ifdef XSM_ENABLE
+
 extern struct xsm_operations *xsm_ops;
 
 static inline void xsm_security_domaininfo (struct domain *d,
@@ -761,16 +765,15 @@ static inline int xsm_domain_memory_map(struct domain *d)
     return xsm_ops->domain_memory_map(d);
 }
 
-static inline int xsm_mmu_normal_update (struct domain *d, struct domain *t,
-                                         struct domain *f, intpte_t fpte)
+static inline int xsm_mmu_update (struct domain *d, struct domain *t,
+                                  struct domain *f, uint32_t flags)
 {
-    return xsm_ops->mmu_normal_update(d, t, f, fpte);
+    return xsm_ops->mmu_update(d, t, f, flags);
 }
 
-static inline int xsm_mmu_machphys_update (struct domain *d1, struct domain *d2,
-                                           unsigned long mfn)
+static inline int xsm_mmuext_op (struct domain *d, struct domain *f)
 {
-    return xsm_ops->mmu_machphys_update(d1, d2, mfn);
+    return xsm_ops->mmuext_op(d, f);
 }
 
 static inline int xsm_update_va_mapping(struct domain *d, struct domain *f, 
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 3926b2b..588f367 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -154,8 +154,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, getidletime);
     set_to_dummy_if_null(ops, machine_memory_map);
     set_to_dummy_if_null(ops, domain_memory_map);
-    set_to_dummy_if_null(ops, mmu_normal_update);
-    set_to_dummy_if_null(ops, mmu_machphys_update);
+    set_to_dummy_if_null(ops, mmu_update);
+    set_to_dummy_if_null(ops, mmuext_op);
     set_to_dummy_if_null(ops, update_va_mapping);
     set_to_dummy_if_null(ops, add_to_physmap);
     set_to_dummy_if_null(ops, remove_from_physmap);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 99d3e21..b2f00d8 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1434,65 +1434,44 @@ static int flask_domain_memory_map(struct domain *d)
     return current_has_perm(d, SECCLASS_MMU, MMU__MEMORYMAP);
 }
 
-static int domain_memory_perm(struct domain *d, struct domain *f, l1_pgentry_t pte)
+static int flask_mmu_update(struct domain *d, struct domain *t,
+                            struct domain *f, uint32_t flags)
 {
     int rc = 0;
-    u32 map_perms = MMU__MAP_READ;
-    unsigned long fgfn, fmfn;
-    p2m_type_t p2mt;
-
-    if ( !(l1e_get_flags(pte) & _PAGE_PRESENT) )
-        return 0;
-
-    if ( l1e_get_flags(pte) & _PAGE_RW )
-        map_perms |= MMU__MAP_WRITE;
-
-    fgfn = l1e_get_pfn(pte);
-    fmfn = mfn_x(get_gfn_query(f, fgfn, &p2mt));
-    put_gfn(f, fgfn);
+    u32 map_perms = 0;
 
-    if ( f->domain_id == DOMID_IO || !mfn_valid(fmfn) )
-    {
-        struct avc_audit_data ad;
-        u32 dsid, fsid;
-        rc = security_iomem_sid(fmfn, &fsid);
-        if ( rc )
-            return rc;
-        AVC_AUDIT_DATA_INIT(&ad, MEMORY);
-        ad.sdom = d;
-        ad.tdom = f;
-        ad.memory.pte = pte.l1;
-        ad.memory.mfn = fmfn;
-        dsid = domain_sid(d);
-        return avc_has_perm(dsid, fsid, SECCLASS_MMU, map_perms, &ad);
-    }
-
-    return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
-}
-
-static int flask_mmu_normal_update(struct domain *d, struct domain *t,
-                                   struct domain *f, intpte_t fpte)
-{
-    int rc = 0;
-
-    if (d != t)
+    if ( t && d != t )
         rc = domain_has_perm(d, t, SECCLASS_MMU, MMU__REMOTE_REMAP);
     if ( rc )
         return rc;
 
-    return domain_memory_perm(d, f, l1e_from_intpte(fpte));
+    if ( flags & XSM_MMU_UPDATE_READ )
+        map_perms |= MMU__MAP_READ;
+    if ( flags & XSM_MMU_UPDATE_WRITE )
+        map_perms |= MMU__MAP_WRITE;
+    if ( flags & XSM_MMU_MACHPHYS_UPDATE )
+        map_perms |= MMU__UPDATEMP;
+
+    if ( map_perms )
+        rc = domain_has_perm(d, f, SECCLASS_MMU, map_perms);
+    return rc;
 }
 
-static int flask_mmu_machphys_update(struct domain *d1, struct domain *d2,
-                                     unsigned long mfn)
+static int flask_mmuext_op(struct domain *d, struct domain *f)
 {
-    return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__UPDATEMP);
+    return domain_has_perm(d, f, SECCLASS_MMU, MMU__MMUEXT_OP);
 }
 
 static int flask_update_va_mapping(struct domain *d, struct domain *f,
                                    l1_pgentry_t pte)
 {
-    return domain_memory_perm(d, f, pte);
+    u32 map_perms = MMU__MAP_READ;
+    if ( !(l1e_get_flags(pte) & _PAGE_PRESENT) )
+        return 0;
+    if ( l1e_get_flags(pte) & _PAGE_RW )
+        map_perms |= MMU__MAP_WRITE;
+
+    return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
 }
 
 static int flask_add_to_physmap(struct domain *d1, struct domain *d2)
@@ -1773,8 +1752,8 @@ static struct xsm_operations flask_ops = {
     .getidletime = flask_getidletime,
     .machine_memory_map = flask_machine_memory_map,
     .domain_memory_map = flask_domain_memory_map,
-    .mmu_normal_update = flask_mmu_normal_update,
-    .mmu_machphys_update = flask_mmu_machphys_update,
+    .mmu_update = flask_mmu_update,
+    .mmuext_op = flask_mmuext_op,
     .update_va_mapping = flask_update_va_mapping,
     .add_to_physmap = flask_add_to_physmap,
     .remove_from_physmap = flask_remove_from_physmap,
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 186f1fa..8f65b96 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -111,6 +111,7 @@
    S_(SECCLASS_MMU, MMU__MFNLIST, "mfnlist")
    S_(SECCLASS_MMU, MMU__MEMORYMAP, "memorymap")
    S_(SECCLASS_MMU, MMU__REMOTE_REMAP, "remote_remap")
+   S_(SECCLASS_MMU, MMU__MMUEXT_OP, "mmuext_op")
    S_(SECCLASS_SHADOW, SHADOW__DISABLE, "disable")
    S_(SECCLASS_SHADOW, SHADOW__ENABLE, "enable")
    S_(SECCLASS_SHADOW, SHADOW__LOGDIRTY, "logdirty")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index b3831f6..18454fd 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -117,6 +117,7 @@
 #define MMU__MFNLIST                              0x00000400UL
 #define MMU__MEMORYMAP                            0x00000800UL
 #define MMU__REMOTE_REMAP                         0x00001000UL
+#define MMU__MMUEXT_OP                            0x00002000UL
 
 #define SHADOW__DISABLE                           0x00000001UL
 #define SHADOW__ENABLE                            0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf4-0006rH-CX; Fri, 16 Nov 2012 18:29:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQez-0006fP-64
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:01 +0000
Received: from [85.158.139.211:17546] by server-4.bemta-5.messagelabs.com id
	47/81-15011-CE586A05; Fri, 16 Nov 2012 18:29:00 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-9.tower-206.messagelabs.com!1353090538!18992237!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25337 invoked from network); 16 Nov 2012 18:28:59 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-9.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 18:28:59 -0000
X-TM-IMSS-Message-ID: <8924dba4000aed64@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8924dba4000aed64 ;
	Fri, 16 Nov 2012 13:31:39 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3l031862; 
	Fri, 16 Nov 2012 13:28:56 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:30 -0500
Message-Id: <1353090514-18537-16-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Tim Deegan <tim@xen.org>, Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	keir@xen.org, Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 15/19] arch/x86: use XSM hooks for get_pg_owner
	access checks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

There are three callers of get_pg_owner:
 * do_mmuext_op, which does not have XSM hooks on all subfunctions
 * do_mmu_update, which has hooks that are inefficient
 * do_update_va_mapping_otherdomain, which has a simple XSM hook

In order to preserve return values for the do_mmuext_op hypercall, an
additional XSM hook is required to check the operation even for those
subfunctions that do not use the pg_owner field. This also covers the
MMUEXT_UNPIN_TABLE operation which did previously have an XSM hook.

The XSM hooks in do_mmu_update were capable of replacing the checks in
get_pg_owner; however, the hooks are buried in the inner loop of the
function - not very good for performance when XSM is enabled and these
turn in to indirect function calls. This patch removes the PTE from the
hooks and replaces it with a bitfield describing what accesses are being
requested. The XSM hook can then be called only when additional bits are
set instead of once per iteration of the loop.

This patch results in a change in the FLASK permissions used for mapping
an MMIO page: the target for the permisison check on the memory mapping
is no longer resolved to the device-specific type, and is instead either
the domain's own type or domio_t (depending on if the domain uses
DOMID_SELF or DOMID_IO in the map command). Device-specific access is
still controlled via the "resource use" permisison checked at domain
creation (or device hotplug).

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Tim Deegan <tim@xen.org>
---
 tools/flask/policy/policy/flask/access_vectors |  1 +
 tools/flask/policy/policy/modules/xen/xen.if   |  6 +--
 tools/flask/policy/policy/modules/xen/xen.te   |  5 +-
 xen/arch/x86/mm.c                              | 53 +++++++++++--------
 xen/include/xsm/dummy.h                        | 15 ++++--
 xen/include/xsm/xsm.h                          | 25 +++++----
 xen/xsm/dummy.c                                |  4 +-
 xen/xsm/flask/hooks.c                          | 71 +++++++++-----------------
 xen/xsm/flask/include/av_perm_to_string.h      |  1 +
 xen/xsm/flask/include/av_permissions.h         |  1 +
 10 files changed, 91 insertions(+), 91 deletions(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index 45ac437..8324725 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -141,6 +141,7 @@ class mmu
     mfnlist
     memorymap
     remote_remap
+	mmuext_op
 }
 
 class shadow
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index d630f47..fda5cb5 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -7,7 +7,7 @@
 ################################################################################
 define(`declare_domain_common', `
 	allow $1 $2:grant { query setup };
-	allow $1 $2:mmu { adjust physmap map_read map_write stat pinpage updatemp };
+	allow $1 $2:mmu { adjust physmap map_read map_write stat pinpage updatemp mmuext_op };
 	allow $1 $2:hvm { getparam setparam };
 ')
 
@@ -51,7 +51,7 @@ define(`create_domain_common', `
 	allow $1 $2:domain2 { set_cpuid settsc };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
-	allow $1 $2:mmu {map_read map_write adjust memorymap physmap pinpage};
+	allow $1 $2:mmu { map_read map_write adjust memorymap physmap pinpage mmuext_op };
 	allow $1 $2:grant setup;
 	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc setparam pcilevel trackdirtyvram };
 ')
@@ -162,7 +162,7 @@ define(`make_device_model', `
 #   Allow a device to be used by a domain
 define(`use_device', `
     allow $1 $2:resource use;
-    allow $1 $2:mmu { map_read map_write };
+    allow $1 domio_t:mmu { map_read map_write };
 ')
 
 # admin_device(domain, device)
diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
index 8d33285..8c77e6b 100644
--- a/tools/flask/policy/policy/modules/xen/xen.te
+++ b/tools/flask/policy/policy/modules/xen/xen.te
@@ -29,10 +29,10 @@ type xen_t, xen_type, mls_priv;
 # Domain 0
 declare_singleton_domain(dom0_t, mls_priv);
 
-# Untracked I/O memory (pseudo-domain)
+# I/O memory (DOMID_IO pseudo-domain)
 type domio_t, xen_type;
 
-# Xen heap (pseudo-domain)
+# Xen heap (DOMID_XEN pseudo-domain)
 type domxen_t, xen_type;
 
 # Unlabeled objects
@@ -69,7 +69,6 @@ admin_device(dom0_t, device_t)
 admin_device(dom0_t, irq_t)
 admin_device(dom0_t, ioport_t)
 admin_device(dom0_t, iomem_t)
-allow dom0_t domio_t:mmu { map_read map_write };
 
 domain_comms(dom0_t, dom0_t)
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b065bcf..39b2cc7 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2620,11 +2620,6 @@ static struct domain *get_pg_owner(domid_t domid)
         pg_owner = rcu_lock_domain(dom_io);
         break;
     case DOMID_XEN:
-        if ( !IS_PRIV(curr) )
-        {
-            MEM_LOG("Cannot set foreign dom");
-            break;
-        }
         pg_owner = rcu_lock_domain(dom_xen);
         break;
     default:
@@ -2633,12 +2628,6 @@ static struct domain *get_pg_owner(domid_t domid)
             MEM_LOG("Unknown domain '%u'", domid);
             break;
         }
-        if ( !IS_PRIV_FOR(curr, pg_owner) )
-        {
-            MEM_LOG("Cannot set foreign dom");
-            rcu_unlock_domain(pg_owner);
-            pg_owner = NULL;
-        }
         break;
     }
 
@@ -2726,6 +2715,13 @@ long do_mmuext_op(
         goto out;
     }
 
+    rc = xsm_mmuext_op(d, pg_owner);
+    if ( rc )
+    {
+        rcu_unlock_domain(pg_owner);
+        goto out;
+    }
+
     for ( i = 0; i < count; i++ )
     {
         if ( hypercall_preempt_check() )
@@ -3167,6 +3163,8 @@ long do_mmu_update(
     struct vcpu *v = current;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     struct domain_mmap_cache mapcache;
+    uint32_t xsm_needed = 0;
+    uint32_t xsm_checked = 0;
 
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
@@ -3198,11 +3196,6 @@ long do_mmu_update(
             rc = -EINVAL;
             goto out;
         }
-        if ( !IS_PRIV_FOR(d, pt_owner) )
-        {
-            rc = -ESRCH;
-            goto out;
-        }
     }
 
     if ( (pg_owner = get_pg_owner((uint16_t)foreigndom)) == NULL )
@@ -3242,9 +3235,20 @@ long do_mmu_update(
         {
             p2m_type_t p2mt;
 
-            rc = xsm_mmu_normal_update(d, pt_owner, pg_owner, req.val);
-            if ( rc )
-                break;
+            xsm_needed |= XSM_MMU_NORMAL_UPDATE;
+            if ( get_pte_flags(req.val) & _PAGE_PRESENT )
+            {
+                xsm_needed |= XSM_MMU_UPDATE_READ;
+                if ( get_pte_flags(req.val) & _PAGE_RW )
+                    xsm_needed |= XSM_MMU_UPDATE_WRITE;
+            }
+            if ( xsm_needed != xsm_checked )
+            {
+                rc = xsm_mmu_update(d, pt_owner, pg_owner, xsm_needed);
+                if ( rc )
+                    break;
+                xsm_checked = xsm_needed;
+            }
             rc = -EINVAL;
 
             req.ptr -= cmd;
@@ -3356,9 +3360,14 @@ long do_mmu_update(
             mfn = req.ptr >> PAGE_SHIFT;
             gpfn = req.val;
 
-            rc = xsm_mmu_machphys_update(d, pg_owner, mfn);
-            if ( rc )
-                break;
+            xsm_needed |= XSM_MMU_MACHPHYS_UPDATE;
+            if ( xsm_needed != xsm_checked )
+            {
+                rc = xsm_mmu_update(d, NULL, pg_owner, xsm_needed);
+                if ( rc )
+                    break;
+                xsm_checked = xsm_needed;
+            }
 
             if ( unlikely(!get_page_from_pagenr(mfn, pg_owner)) )
             {
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index ee381a8..8131a57 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -662,21 +662,28 @@ static XSM_DEFAULT(int, domain_memory_map) (struct domain *d)
     return 0;
 }
 
-static XSM_DEFAULT(int, mmu_normal_update) (struct domain *d, struct domain *t,
-                                            struct domain *f, intpte_t fpte)
+static XSM_DEFAULT(int, mmu_update) (struct domain *d, struct domain *t,
+                                     struct domain *f, uint32_t flags)
 {
+    if ( t && d != t && !IS_PRIV_FOR(d, t) )
+        return -EPERM;
+    if ( d != f && !IS_PRIV_FOR(d, f) )
+        return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, mmu_machphys_update) (struct domain *d, struct domain *f,
-                                              unsigned long mfn)
+static XSM_DEFAULT(int, mmuext_op) (struct domain *d, struct domain *f)
 {
+    if ( d != f && !IS_PRIV_FOR(d, f) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_DEFAULT(int, update_va_mapping) (struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
+    if ( d != f && !IS_PRIV_FOR(d, f) )
+        return -EPERM;
     return 0;
 }
 
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 1b9f939..092efdc 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -27,8 +27,6 @@ typedef u32 xsm_magic_t;
 #define XSM_MAGIC 0x00000000
 #endif
 
-#ifdef XSM_ENABLE
-
 extern char *policy_buffer;
 extern u32 policy_size;
 
@@ -170,9 +168,13 @@ struct xsm_operations {
     int (*getidletime) (void);
     int (*machine_memory_map) (void);
     int (*domain_memory_map) (struct domain *d);
-    int (*mmu_normal_update) (struct domain *d, struct domain *t,
-                              struct domain *f, intpte_t fpte);
-    int (*mmu_machphys_update) (struct domain *d1, struct domain *d2, unsigned long mfn);
+#define XSM_MMU_UPDATE_READ      1
+#define XSM_MMU_UPDATE_WRITE     2
+#define XSM_MMU_NORMAL_UPDATE    4
+#define XSM_MMU_MACHPHYS_UPDATE  8
+    int (*mmu_update) (struct domain *d, struct domain *t,
+                       struct domain *f, uint32_t flags);
+    int (*mmuext_op) (struct domain *d, struct domain *f);
     int (*update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
     int (*sendtrigger) (struct domain *d);
@@ -186,6 +188,8 @@ struct xsm_operations {
 #endif
 };
 
+#ifdef XSM_ENABLE
+
 extern struct xsm_operations *xsm_ops;
 
 static inline void xsm_security_domaininfo (struct domain *d,
@@ -761,16 +765,15 @@ static inline int xsm_domain_memory_map(struct domain *d)
     return xsm_ops->domain_memory_map(d);
 }
 
-static inline int xsm_mmu_normal_update (struct domain *d, struct domain *t,
-                                         struct domain *f, intpte_t fpte)
+static inline int xsm_mmu_update (struct domain *d, struct domain *t,
+                                  struct domain *f, uint32_t flags)
 {
-    return xsm_ops->mmu_normal_update(d, t, f, fpte);
+    return xsm_ops->mmu_update(d, t, f, flags);
 }
 
-static inline int xsm_mmu_machphys_update (struct domain *d1, struct domain *d2,
-                                           unsigned long mfn)
+static inline int xsm_mmuext_op (struct domain *d, struct domain *f)
 {
-    return xsm_ops->mmu_machphys_update(d1, d2, mfn);
+    return xsm_ops->mmuext_op(d, f);
 }
 
 static inline int xsm_update_va_mapping(struct domain *d, struct domain *f, 
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 3926b2b..588f367 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -154,8 +154,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, getidletime);
     set_to_dummy_if_null(ops, machine_memory_map);
     set_to_dummy_if_null(ops, domain_memory_map);
-    set_to_dummy_if_null(ops, mmu_normal_update);
-    set_to_dummy_if_null(ops, mmu_machphys_update);
+    set_to_dummy_if_null(ops, mmu_update);
+    set_to_dummy_if_null(ops, mmuext_op);
     set_to_dummy_if_null(ops, update_va_mapping);
     set_to_dummy_if_null(ops, add_to_physmap);
     set_to_dummy_if_null(ops, remove_from_physmap);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 99d3e21..b2f00d8 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1434,65 +1434,44 @@ static int flask_domain_memory_map(struct domain *d)
     return current_has_perm(d, SECCLASS_MMU, MMU__MEMORYMAP);
 }
 
-static int domain_memory_perm(struct domain *d, struct domain *f, l1_pgentry_t pte)
+static int flask_mmu_update(struct domain *d, struct domain *t,
+                            struct domain *f, uint32_t flags)
 {
     int rc = 0;
-    u32 map_perms = MMU__MAP_READ;
-    unsigned long fgfn, fmfn;
-    p2m_type_t p2mt;
-
-    if ( !(l1e_get_flags(pte) & _PAGE_PRESENT) )
-        return 0;
-
-    if ( l1e_get_flags(pte) & _PAGE_RW )
-        map_perms |= MMU__MAP_WRITE;
-
-    fgfn = l1e_get_pfn(pte);
-    fmfn = mfn_x(get_gfn_query(f, fgfn, &p2mt));
-    put_gfn(f, fgfn);
+    u32 map_perms = 0;
 
-    if ( f->domain_id == DOMID_IO || !mfn_valid(fmfn) )
-    {
-        struct avc_audit_data ad;
-        u32 dsid, fsid;
-        rc = security_iomem_sid(fmfn, &fsid);
-        if ( rc )
-            return rc;
-        AVC_AUDIT_DATA_INIT(&ad, MEMORY);
-        ad.sdom = d;
-        ad.tdom = f;
-        ad.memory.pte = pte.l1;
-        ad.memory.mfn = fmfn;
-        dsid = domain_sid(d);
-        return avc_has_perm(dsid, fsid, SECCLASS_MMU, map_perms, &ad);
-    }
-
-    return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
-}
-
-static int flask_mmu_normal_update(struct domain *d, struct domain *t,
-                                   struct domain *f, intpte_t fpte)
-{
-    int rc = 0;
-
-    if (d != t)
+    if ( t && d != t )
         rc = domain_has_perm(d, t, SECCLASS_MMU, MMU__REMOTE_REMAP);
     if ( rc )
         return rc;
 
-    return domain_memory_perm(d, f, l1e_from_intpte(fpte));
+    if ( flags & XSM_MMU_UPDATE_READ )
+        map_perms |= MMU__MAP_READ;
+    if ( flags & XSM_MMU_UPDATE_WRITE )
+        map_perms |= MMU__MAP_WRITE;
+    if ( flags & XSM_MMU_MACHPHYS_UPDATE )
+        map_perms |= MMU__UPDATEMP;
+
+    if ( map_perms )
+        rc = domain_has_perm(d, f, SECCLASS_MMU, map_perms);
+    return rc;
 }
 
-static int flask_mmu_machphys_update(struct domain *d1, struct domain *d2,
-                                     unsigned long mfn)
+static int flask_mmuext_op(struct domain *d, struct domain *f)
 {
-    return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__UPDATEMP);
+    return domain_has_perm(d, f, SECCLASS_MMU, MMU__MMUEXT_OP);
 }
 
 static int flask_update_va_mapping(struct domain *d, struct domain *f,
                                    l1_pgentry_t pte)
 {
-    return domain_memory_perm(d, f, pte);
+    u32 map_perms = MMU__MAP_READ;
+    if ( !(l1e_get_flags(pte) & _PAGE_PRESENT) )
+        return 0;
+    if ( l1e_get_flags(pte) & _PAGE_RW )
+        map_perms |= MMU__MAP_WRITE;
+
+    return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
 }
 
 static int flask_add_to_physmap(struct domain *d1, struct domain *d2)
@@ -1773,8 +1752,8 @@ static struct xsm_operations flask_ops = {
     .getidletime = flask_getidletime,
     .machine_memory_map = flask_machine_memory_map,
     .domain_memory_map = flask_domain_memory_map,
-    .mmu_normal_update = flask_mmu_normal_update,
-    .mmu_machphys_update = flask_mmu_machphys_update,
+    .mmu_update = flask_mmu_update,
+    .mmuext_op = flask_mmuext_op,
     .update_va_mapping = flask_update_va_mapping,
     .add_to_physmap = flask_add_to_physmap,
     .remove_from_physmap = flask_remove_from_physmap,
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 186f1fa..8f65b96 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -111,6 +111,7 @@
    S_(SECCLASS_MMU, MMU__MFNLIST, "mfnlist")
    S_(SECCLASS_MMU, MMU__MEMORYMAP, "memorymap")
    S_(SECCLASS_MMU, MMU__REMOTE_REMAP, "remote_remap")
+   S_(SECCLASS_MMU, MMU__MMUEXT_OP, "mmuext_op")
    S_(SECCLASS_SHADOW, SHADOW__DISABLE, "disable")
    S_(SECCLASS_SHADOW, SHADOW__ENABLE, "enable")
    S_(SECCLASS_SHADOW, SHADOW__LOGDIRTY, "logdirty")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index b3831f6..18454fd 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -117,6 +117,7 @@
 #define MMU__MFNLIST                              0x00000400UL
 #define MMU__MEMORYMAP                            0x00000800UL
 #define MMU__REMOTE_REMAP                         0x00001000UL
+#define MMU__MMUEXT_OP                            0x00002000UL
 
 #define SHADOW__DISABLE                           0x00000001UL
 #define SHADOW__ENABLE                            0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf5-0006sM-12; Fri, 16 Nov 2012 18:29:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQez-0006i5-9W
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:01 +0000
Received: from [85.158.139.211:2341] by server-10.bemta-5.messagelabs.com id
	C7/C9-09257-CE586A05; Fri, 16 Nov 2012 18:29:00 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353090538!20429517!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3887 invoked from network); 16 Nov 2012 18:28:59 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-15.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 18:28:59 -0000
X-TM-IMSS-Message-ID: <8924dc6f000aed65@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8924dc6f000aed65 ;
	Fri, 16 Nov 2012 13:31:39 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3m031862; 
	Fri, 16 Nov 2012 13:28:57 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:31 -0500
Message-Id: <1353090514-18537-17-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org
Subject: [Xen-devel] [PATCH 16/19] xen: Add XSM hook for XENMEM_exchange
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
---
 tools/flask/policy/policy/flask/access_vectors |  1 +
 tools/flask/policy/policy/modules/xen/xen.if   |  2 ++
 xen/common/memory.c                            | 12 +++++++++++-
 xen/include/xsm/dummy.h                        |  7 +++++++
 xen/include/xsm/xsm.h                          |  6 ++++++
 xen/xsm/dummy.c                                |  1 +
 xen/xsm/flask/hooks.c                          |  6 ++++++
 xen/xsm/flask/include/av_perm_to_string.h      |  1 +
 xen/xsm/flask/include/av_permissions.h         |  1 +
 9 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index 8324725..caf65d2 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -142,6 +142,7 @@ class mmu
     memorymap
     remote_remap
 	mmuext_op
+	exchange
 }
 
 class shadow
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index fda5cb5..d9d5344 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -30,6 +30,7 @@ define(`declare_domain', `
 #   containing at most one domain. This is not enforced by policy.
 define(`declare_singleton_domain', `
 	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
+	define(`$1_self', `$1')
 	type $1_channel, event_type;
 	type_transition $1 domain_type:event $1_channel;
 	declare_domain_common($1, $1)
@@ -161,6 +162,7 @@ define(`make_device_model', `
 # use_device(domain, device)
 #   Allow a device to be used by a domain
 define(`use_device', `
+    allow $1 $1_self:mmu exchange;
     allow $1 $2:resource use;
     allow $1 domio_t:mmu { map_read map_write };
 ')
diff --git a/xen/common/memory.c b/xen/common/memory.c
index dd36b83..7d3c326 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -329,9 +329,19 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
         out_chunk_order = exch.in.extent_order - exch.out.extent_order;
     }
 
-    rc = rcu_lock_target_domain_by_id(exch.in.domid, &d);
+    d = rcu_lock_domain_by_any_id(exch.in.domid);
+    if ( d == NULL )
+    {
+        rc = -ESRCH;
+        goto fail_early;
+    }
+
+    rc = xsm_memory_exchange(d);
     if ( rc )
+    {
+        rcu_unlock_domain(d);
         goto fail_early;
+    }
 
     memflags |= MEMF_bits(domain_clamp_alloc_bitsize(
         d,
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 8131a57..f115151 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -235,6 +235,13 @@ static XSM_DEFAULT(int, grant_query_size) (struct domain *d1, struct domain *d2)
     return 0;
 }
 
+static XSM_DEFAULT(int, memory_exchange) (struct domain *d)
+{
+    if ( d != current->domain && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_DEFAULT(int, memory_adjust_reservation) (struct domain *d1,
                                                             struct domain *d2)
 {
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 092efdc..628ddd6 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -96,6 +96,7 @@ struct xsm_operations {
 
     int (*get_pod_target) (struct domain *d);
     int (*set_pod_target) (struct domain *d);
+    int (*memory_exchange) (struct domain *d);
     int (*memory_adjust_reservation) (struct domain *d1, struct domain *d2);
     int (*memory_stat_reservation) (struct domain *d1, struct domain *d2);
     int (*memory_pin_page) (struct domain *d1, struct domain *d2, struct page_info *page);
@@ -451,6 +452,11 @@ static inline int xsm_set_pod_target (struct domain *d)
     return xsm_ops->set_pod_target(d);
 }
 
+static inline int xsm_memory_exchange (struct domain *d)
+{
+    return xsm_ops->memory_exchange(d);
+}
+
 static inline int xsm_memory_adjust_reservation (struct domain *d1, struct
                                                                     domain *d2)
 {
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 588f367..26e04d5 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -83,6 +83,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, get_pod_target);
     set_to_dummy_if_null(ops, set_pod_target);
 
+    set_to_dummy_if_null(ops, memory_exchange);
     set_to_dummy_if_null(ops, memory_adjust_reservation);
     set_to_dummy_if_null(ops, memory_stat_reservation);
     set_to_dummy_if_null(ops, memory_pin_page);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index b2f00d8..167f8e6 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -396,6 +396,11 @@ static int flask_set_pod_target(struct domain *d)
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETPODTARGET);
 }
 
+static int flask_memory_exchange(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_MMU, MMU__EXCHANGE);
+}
+
 static int flask_memory_adjust_reservation(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__ADJUST);
@@ -1685,6 +1690,7 @@ static struct xsm_operations flask_ops = {
 
     .get_pod_target = flask_get_pod_target,
     .set_pod_target = flask_set_pod_target,
+    .memory_exchange = flask_memory_exchange,
     .memory_adjust_reservation = flask_memory_adjust_reservation,
     .memory_stat_reservation = flask_memory_stat_reservation,
     .memory_pin_page = flask_memory_pin_page,
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 8f65b96..79d5939 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -112,6 +112,7 @@
    S_(SECCLASS_MMU, MMU__MEMORYMAP, "memorymap")
    S_(SECCLASS_MMU, MMU__REMOTE_REMAP, "remote_remap")
    S_(SECCLASS_MMU, MMU__MMUEXT_OP, "mmuext_op")
+   S_(SECCLASS_MMU, MMU__EXCHANGE, "exchange")
    S_(SECCLASS_SHADOW, SHADOW__DISABLE, "disable")
    S_(SECCLASS_SHADOW, SHADOW__ENABLE, "enable")
    S_(SECCLASS_SHADOW, SHADOW__LOGDIRTY, "logdirty")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index 18454fd..d982328 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -118,6 +118,7 @@
 #define MMU__MEMORYMAP                            0x00000800UL
 #define MMU__REMOTE_REMAP                         0x00001000UL
 #define MMU__MMUEXT_OP                            0x00002000UL
+#define MMU__EXCHANGE                             0x00004000UL
 
 #define SHADOW__DISABLE                           0x00000001UL
 #define SHADOW__ENABLE                            0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf6-0006uR-32; Fri, 16 Nov 2012 18:29:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQez-0006iY-Qd
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:02 +0000
Received: from [85.158.138.51:9040] by server-6.bemta-3.messagelabs.com id
	E5/68-28265-8E586A05; Fri, 16 Nov 2012 18:28:56 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353090533!30291337!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17587 invoked from network); 16 Nov 2012 18:28:54 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-8.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:54 -0000
X-TM-IMSS-Message-ID: <89252adc000aa5cf@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 89252adc000aa5cf ;
	Fri, 16 Nov 2012 13:28:27 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3a031862; 
	Fri, 16 Nov 2012 13:28:52 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:19 -0500
Message-Id: <1353090514-18537-5-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org
Subject: [Xen-devel] [PATCH 04/19] xsm/flask: Add checks on the domain
	performing the set_target operation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The existing domain__set_target check only verifies that the source and
target domains can be associated. We also need to check that the
privileged domain making this association is allowed to do so.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 tools/flask/policy/policy/flask/access_vectors | 2 ++
 xen/xsm/flask/hooks.c                          | 7 +++++++
 xen/xsm/flask/include/av_perm_to_string.h      | 2 ++
 xen/xsm/flask/include/av_permissions.h         | 2 ++
 4 files changed, 13 insertions(+)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index c7e29ab..11d02da 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -78,6 +78,8 @@ class domain2
 	relabelfrom
 	relabelto
 	relabelself
+	make_priv_for
+	set_as_target
 }
 
 class hvm
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index d4635d0..81ff5ac 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -577,6 +577,13 @@ static int flask_domain_settime(struct domain *d)
 
 static int flask_set_target(struct domain *d, struct domain *e)
 {
+    int rc;
+    rc = domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR);
+    if ( rc )
+        return rc;
+    rc = domain_has_perm(current->domain, e, SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET);
+    if ( rc )
+        return rc;
     return domain_has_perm(d, e, SECCLASS_DOMAIN, DOMAIN__SET_TARGET);
 }
 
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index e7e2058..10f8e80 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -64,6 +64,8 @@
    S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELFROM, "relabelfrom")
    S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELTO, "relabelto")
    S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELSELF, "relabelself")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR, "make_priv_for")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET, "set_as_target")
    S_(SECCLASS_HVM, HVM__SETHVMC, "sethvmc")
    S_(SECCLASS_HVM, HVM__GETHVMC, "gethvmc")
    S_(SECCLASS_HVM, HVM__SETPARAM, "setparam")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index cb1c5dc..f7cfee1 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -66,6 +66,8 @@
 #define DOMAIN2__RELABELFROM                      0x00000001UL
 #define DOMAIN2__RELABELTO                        0x00000002UL
 #define DOMAIN2__RELABELSELF                      0x00000004UL
+#define DOMAIN2__MAKE_PRIV_FOR                    0x00000008UL
+#define DOMAIN2__SET_AS_TARGET                    0x00000010UL
 
 #define HVM__SETHVMC                              0x00000001UL
 #define HVM__GETHVMC                              0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf5-0006sM-12; Fri, 16 Nov 2012 18:29:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQez-0006i5-9W
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:01 +0000
Received: from [85.158.139.211:2341] by server-10.bemta-5.messagelabs.com id
	C7/C9-09257-CE586A05; Fri, 16 Nov 2012 18:29:00 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353090538!20429517!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3887 invoked from network); 16 Nov 2012 18:28:59 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-15.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 18:28:59 -0000
X-TM-IMSS-Message-ID: <8924dc6f000aed65@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8924dc6f000aed65 ;
	Fri, 16 Nov 2012 13:31:39 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3m031862; 
	Fri, 16 Nov 2012 13:28:57 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:31 -0500
Message-Id: <1353090514-18537-17-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org
Subject: [Xen-devel] [PATCH 16/19] xen: Add XSM hook for XENMEM_exchange
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
---
 tools/flask/policy/policy/flask/access_vectors |  1 +
 tools/flask/policy/policy/modules/xen/xen.if   |  2 ++
 xen/common/memory.c                            | 12 +++++++++++-
 xen/include/xsm/dummy.h                        |  7 +++++++
 xen/include/xsm/xsm.h                          |  6 ++++++
 xen/xsm/dummy.c                                |  1 +
 xen/xsm/flask/hooks.c                          |  6 ++++++
 xen/xsm/flask/include/av_perm_to_string.h      |  1 +
 xen/xsm/flask/include/av_permissions.h         |  1 +
 9 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index 8324725..caf65d2 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -142,6 +142,7 @@ class mmu
     memorymap
     remote_remap
 	mmuext_op
+	exchange
 }
 
 class shadow
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index fda5cb5..d9d5344 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -30,6 +30,7 @@ define(`declare_domain', `
 #   containing at most one domain. This is not enforced by policy.
 define(`declare_singleton_domain', `
 	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
+	define(`$1_self', `$1')
 	type $1_channel, event_type;
 	type_transition $1 domain_type:event $1_channel;
 	declare_domain_common($1, $1)
@@ -161,6 +162,7 @@ define(`make_device_model', `
 # use_device(domain, device)
 #   Allow a device to be used by a domain
 define(`use_device', `
+    allow $1 $1_self:mmu exchange;
     allow $1 $2:resource use;
     allow $1 domio_t:mmu { map_read map_write };
 ')
diff --git a/xen/common/memory.c b/xen/common/memory.c
index dd36b83..7d3c326 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -329,9 +329,19 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
         out_chunk_order = exch.in.extent_order - exch.out.extent_order;
     }
 
-    rc = rcu_lock_target_domain_by_id(exch.in.domid, &d);
+    d = rcu_lock_domain_by_any_id(exch.in.domid);
+    if ( d == NULL )
+    {
+        rc = -ESRCH;
+        goto fail_early;
+    }
+
+    rc = xsm_memory_exchange(d);
     if ( rc )
+    {
+        rcu_unlock_domain(d);
         goto fail_early;
+    }
 
     memflags |= MEMF_bits(domain_clamp_alloc_bitsize(
         d,
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 8131a57..f115151 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -235,6 +235,13 @@ static XSM_DEFAULT(int, grant_query_size) (struct domain *d1, struct domain *d2)
     return 0;
 }
 
+static XSM_DEFAULT(int, memory_exchange) (struct domain *d)
+{
+    if ( d != current->domain && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_DEFAULT(int, memory_adjust_reservation) (struct domain *d1,
                                                             struct domain *d2)
 {
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 092efdc..628ddd6 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -96,6 +96,7 @@ struct xsm_operations {
 
     int (*get_pod_target) (struct domain *d);
     int (*set_pod_target) (struct domain *d);
+    int (*memory_exchange) (struct domain *d);
     int (*memory_adjust_reservation) (struct domain *d1, struct domain *d2);
     int (*memory_stat_reservation) (struct domain *d1, struct domain *d2);
     int (*memory_pin_page) (struct domain *d1, struct domain *d2, struct page_info *page);
@@ -451,6 +452,11 @@ static inline int xsm_set_pod_target (struct domain *d)
     return xsm_ops->set_pod_target(d);
 }
 
+static inline int xsm_memory_exchange (struct domain *d)
+{
+    return xsm_ops->memory_exchange(d);
+}
+
 static inline int xsm_memory_adjust_reservation (struct domain *d1, struct
                                                                     domain *d2)
 {
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 588f367..26e04d5 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -83,6 +83,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, get_pod_target);
     set_to_dummy_if_null(ops, set_pod_target);
 
+    set_to_dummy_if_null(ops, memory_exchange);
     set_to_dummy_if_null(ops, memory_adjust_reservation);
     set_to_dummy_if_null(ops, memory_stat_reservation);
     set_to_dummy_if_null(ops, memory_pin_page);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index b2f00d8..167f8e6 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -396,6 +396,11 @@ static int flask_set_pod_target(struct domain *d)
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETPODTARGET);
 }
 
+static int flask_memory_exchange(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_MMU, MMU__EXCHANGE);
+}
+
 static int flask_memory_adjust_reservation(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__ADJUST);
@@ -1685,6 +1690,7 @@ static struct xsm_operations flask_ops = {
 
     .get_pod_target = flask_get_pod_target,
     .set_pod_target = flask_set_pod_target,
+    .memory_exchange = flask_memory_exchange,
     .memory_adjust_reservation = flask_memory_adjust_reservation,
     .memory_stat_reservation = flask_memory_stat_reservation,
     .memory_pin_page = flask_memory_pin_page,
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 8f65b96..79d5939 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -112,6 +112,7 @@
    S_(SECCLASS_MMU, MMU__MEMORYMAP, "memorymap")
    S_(SECCLASS_MMU, MMU__REMOTE_REMAP, "remote_remap")
    S_(SECCLASS_MMU, MMU__MMUEXT_OP, "mmuext_op")
+   S_(SECCLASS_MMU, MMU__EXCHANGE, "exchange")
    S_(SECCLASS_SHADOW, SHADOW__DISABLE, "disable")
    S_(SECCLASS_SHADOW, SHADOW__ENABLE, "enable")
    S_(SECCLASS_SHADOW, SHADOW__LOGDIRTY, "logdirty")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index 18454fd..d982328 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -118,6 +118,7 @@
 #define MMU__MEMORYMAP                            0x00000800UL
 #define MMU__REMOTE_REMAP                         0x00001000UL
 #define MMU__MMUEXT_OP                            0x00002000UL
+#define MMU__EXCHANGE                             0x00004000UL
 
 #define SHADOW__DISABLE                           0x00000001UL
 #define SHADOW__ENABLE                            0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf6-0006uR-32; Fri, 16 Nov 2012 18:29:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQez-0006iY-Qd
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:02 +0000
Received: from [85.158.138.51:9040] by server-6.bemta-3.messagelabs.com id
	E5/68-28265-8E586A05; Fri, 16 Nov 2012 18:28:56 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353090533!30291337!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17587 invoked from network); 16 Nov 2012 18:28:54 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-8.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:54 -0000
X-TM-IMSS-Message-ID: <89252adc000aa5cf@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 89252adc000aa5cf ;
	Fri, 16 Nov 2012 13:28:27 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3a031862; 
	Fri, 16 Nov 2012 13:28:52 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:19 -0500
Message-Id: <1353090514-18537-5-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org
Subject: [Xen-devel] [PATCH 04/19] xsm/flask: Add checks on the domain
	performing the set_target operation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The existing domain__set_target check only verifies that the source and
target domains can be associated. We also need to check that the
privileged domain making this association is allowed to do so.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 tools/flask/policy/policy/flask/access_vectors | 2 ++
 xen/xsm/flask/hooks.c                          | 7 +++++++
 xen/xsm/flask/include/av_perm_to_string.h      | 2 ++
 xen/xsm/flask/include/av_permissions.h         | 2 ++
 4 files changed, 13 insertions(+)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index c7e29ab..11d02da 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -78,6 +78,8 @@ class domain2
 	relabelfrom
 	relabelto
 	relabelself
+	make_priv_for
+	set_as_target
 }
 
 class hvm
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index d4635d0..81ff5ac 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -577,6 +577,13 @@ static int flask_domain_settime(struct domain *d)
 
 static int flask_set_target(struct domain *d, struct domain *e)
 {
+    int rc;
+    rc = domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR);
+    if ( rc )
+        return rc;
+    rc = domain_has_perm(current->domain, e, SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET);
+    if ( rc )
+        return rc;
     return domain_has_perm(d, e, SECCLASS_DOMAIN, DOMAIN__SET_TARGET);
 }
 
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index e7e2058..10f8e80 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -64,6 +64,8 @@
    S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELFROM, "relabelfrom")
    S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELTO, "relabelto")
    S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELSELF, "relabelself")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR, "make_priv_for")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET, "set_as_target")
    S_(SECCLASS_HVM, HVM__SETHVMC, "sethvmc")
    S_(SECCLASS_HVM, HVM__GETHVMC, "gethvmc")
    S_(SECCLASS_HVM, HVM__SETPARAM, "setparam")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index cb1c5dc..f7cfee1 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -66,6 +66,8 @@
 #define DOMAIN2__RELABELFROM                      0x00000001UL
 #define DOMAIN2__RELABELTO                        0x00000002UL
 #define DOMAIN2__RELABELSELF                      0x00000004UL
+#define DOMAIN2__MAKE_PRIV_FOR                    0x00000008UL
+#define DOMAIN2__SET_AS_TARGET                    0x00000010UL
 
 #define HVM__SETHVMC                              0x00000001UL
 #define HVM__GETHVMC                              0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf8-0006y5-77; Fri, 16 Nov 2012 18:29:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQf0-0006jP-Mn
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:03 +0000
Received: from [85.158.138.51:9114] by server-7.bemta-3.messagelabs.com id
	27/D6-01713-9E586A05; Fri, 16 Nov 2012 18:28:57 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-174.messagelabs.com!1353090536!23991284!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16746 invoked from network); 16 Nov 2012 18:28:56 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-14.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:56 -0000
X-TM-IMSS-Message-ID: <89253400000aa5d5@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 89253400000aa5d5 ;
	Fri, 16 Nov 2012 13:28:29 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3g031862; 
	Fri, 16 Nov 2012 13:28:54 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:25 -0500
Message-Id: <1353090514-18537-11-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org
Subject: [Xen-devel] [PATCH 10/19] xen: convert do_domctl to use XSM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The xsm_domctl hook now covers every domctl, in addition to the more
fine-grained XSM hooks in most sub-functions. This also removes the need
to special-case XEN_DOMCTL_getdomaininfo.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/domctl.c   |  2 +-
 xen/common/domctl.c     | 32 +++----------------
 xen/include/xsm/dummy.h | 16 ++++++++--
 xen/xsm/flask/hooks.c   | 85 ++++++++++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 104 insertions(+), 31 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 7069d7a..30518aa 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1534,7 +1534,7 @@ long arch_do_domctl(
     {
         struct domain *d;
 
-        ret = rcu_lock_remote_target_domain_by_id(domctl->domain, &d);
+        ret = rcu_lock_remote_domain_by_id(domctl->domain, &d);
         if ( ret != 0 )
             break;
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 536bef5..46bb0e3 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -264,27 +264,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             return -ESRCH;
     }
 
-    switch ( op->cmd )
-    {
-    case XEN_DOMCTL_ioport_mapping:
-    case XEN_DOMCTL_memory_mapping:
-    case XEN_DOMCTL_bind_pt_irq:
-    case XEN_DOMCTL_unbind_pt_irq: {
-        bool_t is_priv = IS_PRIV_FOR(current->domain, d);
-        if ( !is_priv )
-        {
-            ret = -EPERM;
-            goto domctl_out_unlock;
-        }
-        break;
-    }
-    case XEN_DOMCTL_getdomaininfo:
-        break;
-    default:
-        if ( !IS_PRIV(current->domain) )
-            return -EPERM;
-        break;
-    }
+    ret = xsm_domctl(d, op->cmd);
+    if ( ret )
+        goto domctl_out_unlock;
 
     if ( !domctl_lock_acquire() )
     {
@@ -858,17 +840,13 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_subscribe:
     {
-        ret = xsm_domctl(d, op->cmd);
-        if ( !ret )
-            d->suspend_evtchn = op->u.subscribe.port;
+        d->suspend_evtchn = op->u.subscribe.port;
     }
     break;
 
     case XEN_DOMCTL_disable_migrate:
     {
-        ret = xsm_domctl(d, op->cmd);
-        if ( !ret )
-            d->disable_migrate = op->u.disable_migrate.disable;
+        d->disable_migrate = op->u.disable_migrate.disable;
     }
     break;
 
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index b77ab4a..f5fe89f 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -64,8 +64,6 @@ static XSM_DEFAULT(int, scheduler) (struct domain *d)
 
 static XSM_DEFAULT(int, getdomaininfo) (struct domain *d)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
     return 0;
 }
 
@@ -91,6 +89,20 @@ static XSM_DEFAULT(int, set_target) (struct domain *d, struct domain *e)
 
 static XSM_DEFAULT(int, domctl)(struct domain *d, int cmd)
 {
+    switch ( cmd )
+    {
+    case XEN_DOMCTL_ioport_mapping:
+    case XEN_DOMCTL_memory_mapping:
+    case XEN_DOMCTL_bind_pt_irq:
+    case XEN_DOMCTL_unbind_pt_irq: {
+        if ( !IS_PRIV_FOR(current->domain, d) )
+            return -EPERM;
+        break;
+    }
+    default:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+    }
     return 0;
 }
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index f9a2596..2e002f0 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -589,7 +589,90 @@ static int flask_set_target(struct domain *d, struct domain *e)
 
 static int flask_domctl(struct domain *d, int cmd)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO);
+    switch ( cmd )
+    {
+    /* These have individual XSM hooks (common/domctl.c) */
+    case XEN_DOMCTL_createdomain:
+    case XEN_DOMCTL_destroydomain:
+    case XEN_DOMCTL_pausedomain:
+    case XEN_DOMCTL_unpausedomain:
+    case XEN_DOMCTL_getdomaininfo:
+    case XEN_DOMCTL_setvcpuaffinity:
+    case XEN_DOMCTL_max_mem:
+    case XEN_DOMCTL_setvcpucontext:
+    case XEN_DOMCTL_getvcpucontext:
+    case XEN_DOMCTL_getvcpuinfo:
+    case XEN_DOMCTL_max_vcpus:
+    case XEN_DOMCTL_scheduler_op:
+    case XEN_DOMCTL_setdomainhandle:
+    case XEN_DOMCTL_setdebugging:
+    case XEN_DOMCTL_irq_permission:
+    case XEN_DOMCTL_iomem_permission:
+    case XEN_DOMCTL_settimeoffset:
+    case XEN_DOMCTL_getvcpuaffinity:
+    case XEN_DOMCTL_resumedomain:
+    case XEN_DOMCTL_set_target:
+    case XEN_DOMCTL_set_virq_handler:
+#ifdef CONFIG_X86
+    /* These have individual XSM hooks (arch/x86/domctl.c) */
+    case XEN_DOMCTL_shadow_op:
+    case XEN_DOMCTL_ioport_permission:
+    case XEN_DOMCTL_getpageframeinfo:
+    case XEN_DOMCTL_getpageframeinfo2:
+    case XEN_DOMCTL_getpageframeinfo3:
+    case XEN_DOMCTL_getmemlist:
+    case XEN_DOMCTL_hypercall_init:
+    case XEN_DOMCTL_sethvmcontext:
+    case XEN_DOMCTL_gethvmcontext:
+    case XEN_DOMCTL_gethvmcontext_partial:
+    case XEN_DOMCTL_set_address_size:
+    case XEN_DOMCTL_get_address_size:
+    case XEN_DOMCTL_set_machine_address_size:
+    case XEN_DOMCTL_get_machine_address_size:
+    case XEN_DOMCTL_sendtrigger:
+    case XEN_DOMCTL_bind_pt_irq:
+    case XEN_DOMCTL_unbind_pt_irq:
+    case XEN_DOMCTL_memory_mapping:
+    case XEN_DOMCTL_ioport_mapping:
+    case XEN_DOMCTL_pin_mem_cacheattr:
+    case XEN_DOMCTL_set_ext_vcpucontext:
+    case XEN_DOMCTL_get_ext_vcpucontext:
+    case XEN_DOMCTL_setvcpuextstate:
+    case XEN_DOMCTL_getvcpuextstate:
+    case XEN_DOMCTL_mem_event_op:
+    case XEN_DOMCTL_mem_sharing_op:
+    case XEN_DOMCTL_set_access_required:
+    /* These have individual XSM hooks (drivers/passthrough/iommu.c) */
+    case XEN_DOMCTL_get_device_group:
+    case XEN_DOMCTL_test_assign_device:
+    case XEN_DOMCTL_assign_device:
+    case XEN_DOMCTL_deassign_device:
+#endif
+        return 0;
+
+    case XEN_DOMCTL_subscribe:
+    case XEN_DOMCTL_disable_migrate:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
+                               DOMAIN__SET_MISC_INFO);
+
+    case XEN_DOMCTL_set_cpuid:
+    case XEN_DOMCTL_suppress_spurious_page_faults:
+    case XEN_DOMCTL_debug_op:
+    case XEN_DOMCTL_gettscinfo:
+    case XEN_DOMCTL_settscinfo:
+    case XEN_DOMCTL_audit_p2m:
+    case XEN_DOMCTL_gdbsx_guestmemio:
+    case XEN_DOMCTL_gdbsx_pausevcpu:
+    case XEN_DOMCTL_gdbsx_unpausevcpu:
+    case XEN_DOMCTL_gdbsx_domstatus:
+        /* TODO add per-subfunction hooks */
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+        return 0;
+    default:
+        printk("flask_domctl: Unknown op %d\n", cmd);
+        return -EPERM;
+    }
 }
 
 static int flask_set_virq_handler(struct domain *d, uint32_t virq)
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf8-0006y5-77; Fri, 16 Nov 2012 18:29:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQf0-0006jP-Mn
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:03 +0000
Received: from [85.158.138.51:9114] by server-7.bemta-3.messagelabs.com id
	27/D6-01713-9E586A05; Fri, 16 Nov 2012 18:28:57 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-174.messagelabs.com!1353090536!23991284!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16746 invoked from network); 16 Nov 2012 18:28:56 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-14.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:56 -0000
X-TM-IMSS-Message-ID: <89253400000aa5d5@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 89253400000aa5d5 ;
	Fri, 16 Nov 2012 13:28:29 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3g031862; 
	Fri, 16 Nov 2012 13:28:54 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:25 -0500
Message-Id: <1353090514-18537-11-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org
Subject: [Xen-devel] [PATCH 10/19] xen: convert do_domctl to use XSM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The xsm_domctl hook now covers every domctl, in addition to the more
fine-grained XSM hooks in most sub-functions. This also removes the need
to special-case XEN_DOMCTL_getdomaininfo.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/domctl.c   |  2 +-
 xen/common/domctl.c     | 32 +++----------------
 xen/include/xsm/dummy.h | 16 ++++++++--
 xen/xsm/flask/hooks.c   | 85 ++++++++++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 104 insertions(+), 31 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 7069d7a..30518aa 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1534,7 +1534,7 @@ long arch_do_domctl(
     {
         struct domain *d;
 
-        ret = rcu_lock_remote_target_domain_by_id(domctl->domain, &d);
+        ret = rcu_lock_remote_domain_by_id(domctl->domain, &d);
         if ( ret != 0 )
             break;
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 536bef5..46bb0e3 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -264,27 +264,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             return -ESRCH;
     }
 
-    switch ( op->cmd )
-    {
-    case XEN_DOMCTL_ioport_mapping:
-    case XEN_DOMCTL_memory_mapping:
-    case XEN_DOMCTL_bind_pt_irq:
-    case XEN_DOMCTL_unbind_pt_irq: {
-        bool_t is_priv = IS_PRIV_FOR(current->domain, d);
-        if ( !is_priv )
-        {
-            ret = -EPERM;
-            goto domctl_out_unlock;
-        }
-        break;
-    }
-    case XEN_DOMCTL_getdomaininfo:
-        break;
-    default:
-        if ( !IS_PRIV(current->domain) )
-            return -EPERM;
-        break;
-    }
+    ret = xsm_domctl(d, op->cmd);
+    if ( ret )
+        goto domctl_out_unlock;
 
     if ( !domctl_lock_acquire() )
     {
@@ -858,17 +840,13 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_subscribe:
     {
-        ret = xsm_domctl(d, op->cmd);
-        if ( !ret )
-            d->suspend_evtchn = op->u.subscribe.port;
+        d->suspend_evtchn = op->u.subscribe.port;
     }
     break;
 
     case XEN_DOMCTL_disable_migrate:
     {
-        ret = xsm_domctl(d, op->cmd);
-        if ( !ret )
-            d->disable_migrate = op->u.disable_migrate.disable;
+        d->disable_migrate = op->u.disable_migrate.disable;
     }
     break;
 
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index b77ab4a..f5fe89f 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -64,8 +64,6 @@ static XSM_DEFAULT(int, scheduler) (struct domain *d)
 
 static XSM_DEFAULT(int, getdomaininfo) (struct domain *d)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
     return 0;
 }
 
@@ -91,6 +89,20 @@ static XSM_DEFAULT(int, set_target) (struct domain *d, struct domain *e)
 
 static XSM_DEFAULT(int, domctl)(struct domain *d, int cmd)
 {
+    switch ( cmd )
+    {
+    case XEN_DOMCTL_ioport_mapping:
+    case XEN_DOMCTL_memory_mapping:
+    case XEN_DOMCTL_bind_pt_irq:
+    case XEN_DOMCTL_unbind_pt_irq: {
+        if ( !IS_PRIV_FOR(current->domain, d) )
+            return -EPERM;
+        break;
+    }
+    default:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+    }
     return 0;
 }
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index f9a2596..2e002f0 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -589,7 +589,90 @@ static int flask_set_target(struct domain *d, struct domain *e)
 
 static int flask_domctl(struct domain *d, int cmd)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO);
+    switch ( cmd )
+    {
+    /* These have individual XSM hooks (common/domctl.c) */
+    case XEN_DOMCTL_createdomain:
+    case XEN_DOMCTL_destroydomain:
+    case XEN_DOMCTL_pausedomain:
+    case XEN_DOMCTL_unpausedomain:
+    case XEN_DOMCTL_getdomaininfo:
+    case XEN_DOMCTL_setvcpuaffinity:
+    case XEN_DOMCTL_max_mem:
+    case XEN_DOMCTL_setvcpucontext:
+    case XEN_DOMCTL_getvcpucontext:
+    case XEN_DOMCTL_getvcpuinfo:
+    case XEN_DOMCTL_max_vcpus:
+    case XEN_DOMCTL_scheduler_op:
+    case XEN_DOMCTL_setdomainhandle:
+    case XEN_DOMCTL_setdebugging:
+    case XEN_DOMCTL_irq_permission:
+    case XEN_DOMCTL_iomem_permission:
+    case XEN_DOMCTL_settimeoffset:
+    case XEN_DOMCTL_getvcpuaffinity:
+    case XEN_DOMCTL_resumedomain:
+    case XEN_DOMCTL_set_target:
+    case XEN_DOMCTL_set_virq_handler:
+#ifdef CONFIG_X86
+    /* These have individual XSM hooks (arch/x86/domctl.c) */
+    case XEN_DOMCTL_shadow_op:
+    case XEN_DOMCTL_ioport_permission:
+    case XEN_DOMCTL_getpageframeinfo:
+    case XEN_DOMCTL_getpageframeinfo2:
+    case XEN_DOMCTL_getpageframeinfo3:
+    case XEN_DOMCTL_getmemlist:
+    case XEN_DOMCTL_hypercall_init:
+    case XEN_DOMCTL_sethvmcontext:
+    case XEN_DOMCTL_gethvmcontext:
+    case XEN_DOMCTL_gethvmcontext_partial:
+    case XEN_DOMCTL_set_address_size:
+    case XEN_DOMCTL_get_address_size:
+    case XEN_DOMCTL_set_machine_address_size:
+    case XEN_DOMCTL_get_machine_address_size:
+    case XEN_DOMCTL_sendtrigger:
+    case XEN_DOMCTL_bind_pt_irq:
+    case XEN_DOMCTL_unbind_pt_irq:
+    case XEN_DOMCTL_memory_mapping:
+    case XEN_DOMCTL_ioport_mapping:
+    case XEN_DOMCTL_pin_mem_cacheattr:
+    case XEN_DOMCTL_set_ext_vcpucontext:
+    case XEN_DOMCTL_get_ext_vcpucontext:
+    case XEN_DOMCTL_setvcpuextstate:
+    case XEN_DOMCTL_getvcpuextstate:
+    case XEN_DOMCTL_mem_event_op:
+    case XEN_DOMCTL_mem_sharing_op:
+    case XEN_DOMCTL_set_access_required:
+    /* These have individual XSM hooks (drivers/passthrough/iommu.c) */
+    case XEN_DOMCTL_get_device_group:
+    case XEN_DOMCTL_test_assign_device:
+    case XEN_DOMCTL_assign_device:
+    case XEN_DOMCTL_deassign_device:
+#endif
+        return 0;
+
+    case XEN_DOMCTL_subscribe:
+    case XEN_DOMCTL_disable_migrate:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
+                               DOMAIN__SET_MISC_INFO);
+
+    case XEN_DOMCTL_set_cpuid:
+    case XEN_DOMCTL_suppress_spurious_page_faults:
+    case XEN_DOMCTL_debug_op:
+    case XEN_DOMCTL_gettscinfo:
+    case XEN_DOMCTL_settscinfo:
+    case XEN_DOMCTL_audit_p2m:
+    case XEN_DOMCTL_gdbsx_guestmemio:
+    case XEN_DOMCTL_gdbsx_pausevcpu:
+    case XEN_DOMCTL_gdbsx_unpausevcpu:
+    case XEN_DOMCTL_gdbsx_domstatus:
+        /* TODO add per-subfunction hooks */
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+        return 0;
+    default:
+        printk("flask_domctl: Unknown op %d\n", cmd);
+        return -EPERM;
+    }
 }
 
 static int flask_set_virq_handler(struct domain *d, uint32_t virq)
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf9-00071L-4y; Fri, 16 Nov 2012 18:29:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQf0-0006jL-IB
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:02 +0000
Received: from [85.158.139.211:17514] by server-12.bemta-5.messagelabs.com id
	48/94-02886-DE586A05; Fri, 16 Nov 2012 18:29:01 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-206.messagelabs.com!1353090537!20500757!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28076 invoked from network); 16 Nov 2012 18:28:58 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-11.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 18:28:58 -0000
X-TM-IMSS-Message-ID: <8924da5c000aed63@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8924da5c000aed63 ;
	Fri, 16 Nov 2012 13:31:38 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3k031862; 
	Fri, 16 Nov 2012 13:28:56 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:29 -0500
Message-Id: <1353090514-18537-15-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 14/19] arch/x86: Add missing mem_sharing XSM
	hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch adds splits up the mem_sharing and mem_event XSM hooks to
better cover what the code is doing. It also changes the utility
function get_mem_event_op_target to rcu_lock_live_remote_domain_by_id
because there is no mm-specific logic in there.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Tim Deegan <tim@xen.org>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 tools/flask/policy/policy/flask/access_vectors |  1 +
 xen/arch/x86/domctl.c                          |  8 ++---
 xen/arch/x86/mm/mem_event.c                    | 41 ++++++++------------------
 xen/arch/x86/mm/mem_sharing.c                  | 25 +++++++++++++---
 xen/common/domain.c                            | 15 ++++++++++
 xen/include/asm-x86/mem_event.h                |  1 -
 xen/include/xen/sched.h                        |  6 ++++
 xen/include/xsm/dummy.h                        | 23 ++++++++++++++-
 xen/include/xsm/xsm.h                          | 24 +++++++++++++--
 xen/xsm/dummy.c                                |  5 +++-
 xen/xsm/flask/hooks.c                          | 25 ++++++++++++++--
 xen/xsm/flask/include/av_perm_to_string.h      |  1 +
 xen/xsm/flask/include/av_permissions.h         |  1 +
 13 files changed, 130 insertions(+), 46 deletions(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index ea65e45..45ac437 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -102,6 +102,7 @@ class hvm
     mem_sharing
     audit_p2m
     send_irq
+    share_mem
 }
 
 class event
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 30518aa..34e6223 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1503,10 +1503,8 @@ long arch_do_domctl(
         d = rcu_lock_domain_by_id(domctl->domain);
         if ( d != NULL )
         {
-            ret = xsm_mem_event(d);
-            if ( !ret )
-                ret = mem_event_domctl(d, &domctl->u.mem_event_op,
-                                       guest_handle_cast(u_domctl, void));
+            ret = mem_event_domctl(d, &domctl->u.mem_event_op,
+                                   guest_handle_cast(u_domctl, void));
             rcu_unlock_domain(d);
             copy_to_guest(u_domctl, domctl, 1);
         } 
@@ -1562,7 +1560,7 @@ long arch_do_domctl(
         d = rcu_lock_domain_by_id(domctl->domain);
         if ( d != NULL )
         {
-            ret = xsm_mem_event(d);
+            ret = xsm_mem_event_setup(d);
             if ( !ret ) {
                 p2m = p2m_get_hostp2m(d);
                 p2m->access_required = domctl->u.access_required.access_required;
diff --git a/xen/arch/x86/mm/mem_event.c b/xen/arch/x86/mm/mem_event.c
index 27d1cf4..c2b3670 100644
--- a/xen/arch/x86/mm/mem_event.c
+++ b/xen/arch/x86/mm/mem_event.c
@@ -29,6 +29,7 @@
 #include <asm/mem_paging.h>
 #include <asm/mem_access.h>
 #include <asm/mem_sharing.h>
+#include <xsm/xsm.h>
 
 /* for public/io/ring.h macros */
 #define xen_mb()   mb()
@@ -439,35 +440,19 @@ static void mem_sharing_notification(struct vcpu *v, unsigned int port)
         mem_sharing_sharing_resume(v->domain);
 }
 
-struct domain *get_mem_event_op_target(uint32_t domain, int *rc)
-{
-    struct domain *d;
-
-    /* Get the target domain */
-    *rc = rcu_lock_remote_target_domain_by_id(domain, &d);
-    if ( *rc != 0 )
-        return NULL;
-
-    /* Not dying? */
-    if ( d->is_dying )
-    {
-        rcu_unlock_domain(d);
-        *rc = -EINVAL;
-        return NULL;
-    }
-    
-    return d;
-}
-
 int do_mem_event_op(int op, uint32_t domain, void *arg)
 {
     int ret;
     struct domain *d;
 
-    d = get_mem_event_op_target(domain, &ret);
-    if ( !d )
+    ret = rcu_lock_live_remote_domain_by_id(domain, &d);
+    if ( ret )
         return ret;
 
+    ret = xsm_mem_event_op(d, op);
+    if ( ret )
+        goto out;
+
     switch (op)
     {
         case XENMEM_paging_op:
@@ -483,6 +468,7 @@ int do_mem_event_op(int op, uint32_t domain, void *arg)
             ret = -ENOSYS;
     }
 
+ out:
     rcu_unlock_domain(d);
     return ret;
 }
@@ -516,6 +502,10 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
 {
     int rc;
 
+    rc = xsm_mem_event_control(d, mec->mode, mec->op);
+    if ( rc )
+        return rc;
+
     if ( unlikely(d == current->domain) )
     {
         gdprintk(XENLOG_INFO, "Tried to do a memory event op on itself.\n");
@@ -537,13 +527,6 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
         return -EINVAL;
     }
 
-    /* TODO: XSM hook */
-#if 0
-    rc = xsm_mem_event_control(d, mec->op);
-    if ( rc )
-        return rc;
-#endif
-
     rc = -ENOSYS;
 
     switch ( mec->mode )
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..9229b83 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -34,6 +34,7 @@
 #include <asm/atomic.h>
 #include <xen/rcupdate.h>
 #include <asm/event.h>
+#include <xsm/xsm.h>
 
 #include "mm-locks.h"
 
@@ -1345,10 +1346,18 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( !mem_sharing_enabled(d) )
                 return -EINVAL;
 
-            cd = get_mem_event_op_target(mec->u.share.client_domain, &rc);
-            if ( !cd )
+            rc = rcu_lock_live_remote_domain_by_id(mec->u.share.client_domain,
+                                                   &cd);
+            if ( rc )
                 return rc;
 
+            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            if ( rc )
+            {
+                rcu_unlock_domain(cd);
+                return rc;
+            }
+
             if ( !mem_sharing_enabled(cd) )
             {
                 rcu_unlock_domain(cd);
@@ -1401,10 +1410,18 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( !mem_sharing_enabled(d) )
                 return -EINVAL;
 
-            cd = get_mem_event_op_target(mec->u.share.client_domain, &rc);
-            if ( !cd )
+            rc = rcu_lock_live_remote_domain_by_id(mec->u.share.client_domain,
+                                                   &cd);
+            if ( rc )
                 return rc;
 
+            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            if ( rc )
+            {
+                rcu_unlock_domain(cd);
+                return rc;
+            }
+
             if ( !mem_sharing_enabled(cd) )
             {
                 rcu_unlock_domain(cd);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 12c8e24..fcf24e2 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -475,6 +475,21 @@ int rcu_lock_remote_domain_by_id(domid_t dom, struct domain **d)
     return 0;
 }
 
+int rcu_lock_live_remote_domain_by_id(domid_t dom, struct domain **d)
+{
+    int rv;
+    rv = rcu_lock_remote_domain_by_id(dom, d);
+    if ( rv )
+        return rv;
+    if ( (*d)->is_dying )
+    {
+        rcu_unlock_domain(*d);
+        return -EINVAL;
+    }
+
+    return 0;
+}
+
 int domain_kill(struct domain *d)
 {
     int rc = 0;
diff --git a/xen/include/asm-x86/mem_event.h b/xen/include/asm-x86/mem_event.h
index e17f36b..5959621 100644
--- a/xen/include/asm-x86/mem_event.h
+++ b/xen/include/asm-x86/mem_event.h
@@ -62,7 +62,6 @@ void mem_event_put_request(struct domain *d, struct mem_event_domain *med,
 int mem_event_get_response(struct domain *d, struct mem_event_domain *med,
                            mem_event_response_t *rsp);
 
-struct domain *get_mem_event_op_target(uint32_t domain, int *rc);
 int do_mem_event_op(int op, uint32_t domain, void *arg);
 int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
                      XEN_GUEST_HANDLE_PARAM(void) u_domctl);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..90a6537 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -484,6 +484,12 @@ int rcu_lock_remote_target_domain_by_id(domid_t dom, struct domain **d);
  */
 int rcu_lock_remote_domain_by_id(domid_t dom, struct domain **d);
 
+/*
+ * As rcu_lock_remote_domain_by_id() but will fail EINVAL if the domain is
+ * dying.
+ */
+int rcu_lock_live_remote_domain_by_id(domid_t dom, struct domain **d);
+
 /* Finish a RCU critical region started by rcu_lock_domain_by_id(). */
 static inline void rcu_unlock_domain(struct domain *d)
 {
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 073217a..ee381a8 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -551,16 +551,37 @@ static XSM_DEFAULT(int, hvm_inject_msi) (struct domain *d)
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_event) (struct domain *d)
+static XSM_DEFAULT(int, mem_event_setup) (struct domain *d)
 {
     return 0;
 }
 
+static XSM_DEFAULT(int, mem_event_control) (struct domain *d, int mode, int op)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
+static XSM_DEFAULT(int, mem_event_op) (struct domain *d, int op)
+{
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_DEFAULT(int, mem_sharing) (struct domain *d)
 {
     return 0;
 }
 
+static XSM_DEFAULT(int, mem_sharing_op) (struct domain *d, struct domain *cd, int op)
+{
+    if ( !IS_PRIV_FOR(current->domain, cd) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_DEFAULT(int, apic) (struct domain *d, int cmd)
 {
     if ( !IS_PRIV(d) )
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 4900d1f..1b9f939 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -151,8 +151,11 @@ struct xsm_operations {
     int (*hvm_set_isa_irq_level) (struct domain *d);
     int (*hvm_set_pci_link_route) (struct domain *d);
     int (*hvm_inject_msi) (struct domain *d);
-    int (*mem_event) (struct domain *d);
+    int (*mem_event_setup) (struct domain *d);
+    int (*mem_event_control) (struct domain *d, int mode, int op);
+    int (*mem_event_op) (struct domain *d, int op);
     int (*mem_sharing) (struct domain *d);
+    int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
     int (*apic) (struct domain *d, int cmd);
     int (*xen_settime) (void);
     int (*memtype) (uint32_t access);
@@ -663,9 +666,19 @@ static inline int xsm_hvm_inject_msi (struct domain *d)
     return xsm_ops->hvm_inject_msi(d);
 }
 
-static inline int xsm_mem_event (struct domain *d)
+static inline int xsm_mem_event_setup (struct domain *d)
 {
-    return xsm_ops->mem_event(d);
+    return xsm_ops->mem_event_setup(d);
+}
+
+static inline int xsm_mem_event_control (struct domain *d, int mode, int op)
+{
+    return xsm_ops->mem_event_control(d, mode, op);
+}
+
+static inline int xsm_mem_event_op (struct domain *d, int op)
+{
+    return xsm_ops->mem_event_op(d, op);
 }
 
 static inline int xsm_mem_sharing (struct domain *d)
@@ -673,6 +686,11 @@ static inline int xsm_mem_sharing (struct domain *d)
     return xsm_ops->mem_sharing(d);
 }
 
+static inline int xsm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
+{
+    return xsm_ops->mem_sharing_op(d, cd, op);
+}
+
 static inline int xsm_apic (struct domain *d, int cmd)
 {
     return xsm_ops->apic(d, cmd);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 43e8617..3926b2b 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -135,8 +135,11 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, hvm_set_isa_irq_level);
     set_to_dummy_if_null(ops, hvm_set_pci_link_route);
     set_to_dummy_if_null(ops, hvm_inject_msi);
-    set_to_dummy_if_null(ops, mem_event);
+    set_to_dummy_if_null(ops, mem_event_setup);
+    set_to_dummy_if_null(ops, mem_event_control);
+    set_to_dummy_if_null(ops, mem_event_op);
     set_to_dummy_if_null(ops, mem_sharing);
+    set_to_dummy_if_null(ops, mem_sharing_op);
     set_to_dummy_if_null(ops, apic);
     set_to_dummy_if_null(ops, xen_settime);
     set_to_dummy_if_null(ops, memtype);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index a8475ea..99d3e21 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1277,7 +1277,17 @@ static int flask_hvm_inject_msi(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
-static int flask_mem_event(struct domain *d)
+static int flask_mem_event_setup(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
+}
+
+static int flask_mem_event_control(struct domain *d, int mode, int op)
+{
+    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
+}
+
+static int flask_mem_event_op(struct domain *d, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
@@ -1287,6 +1297,14 @@ static int flask_mem_sharing(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
 }
 
+static int flask_mem_sharing_op(struct domain *d, struct domain *cd, int op)
+{
+    int rc = current_has_perm(cd, SECCLASS_HVM, HVM__MEM_SHARING);
+    if ( rc )
+        return rc;
+    return domain_has_perm(d, cd, SECCLASS_HVM, HVM__SHARE_MEM);
+}
+
 static int flask_apic(struct domain *d, int cmd)
 {
     u32 perm;
@@ -1736,8 +1754,11 @@ static struct xsm_operations flask_ops = {
     .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
     .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
     .hvm_inject_msi = flask_hvm_inject_msi,
-    .mem_event = flask_mem_event,
+    .mem_event_setup = flask_mem_event_setup,
+    .mem_event_control = flask_mem_event_control,
+    .mem_event_op = flask_mem_event_op,
     .mem_sharing = flask_mem_sharing,
+    .mem_sharing_op = flask_mem_sharing_op,
     .apic = flask_apic,
     .xen_settime = flask_xen_settime,
     .memtype = flask_memtype,
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 894910c..186f1fa 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -84,6 +84,7 @@
    S_(SECCLASS_HVM, HVM__MEM_SHARING, "mem_sharing")
    S_(SECCLASS_HVM, HVM__AUDIT_P2M, "audit_p2m")
    S_(SECCLASS_HVM, HVM__SEND_IRQ, "send_irq")
+   S_(SECCLASS_HVM, HVM__SHARE_MEM, "share_mem")
    S_(SECCLASS_EVENT, EVENT__BIND, "bind")
    S_(SECCLASS_EVENT, EVENT__SEND, "send")
    S_(SECCLASS_EVENT, EVENT__STATUS, "status")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index 1bdb515..b3831f6 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -87,6 +87,7 @@
 #define HVM__MEM_SHARING                          0x00001000UL
 #define HVM__AUDIT_P2M                            0x00002000UL
 #define HVM__SEND_IRQ                             0x00004000UL
+#define HVM__SHARE_MEM                            0x00008000UL
 
 #define EVENT__BIND                               0x00000001UL
 #define EVENT__SEND                               0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf9-00071L-4y; Fri, 16 Nov 2012 18:29:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQf0-0006jL-IB
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:02 +0000
Received: from [85.158.139.211:17514] by server-12.bemta-5.messagelabs.com id
	48/94-02886-DE586A05; Fri, 16 Nov 2012 18:29:01 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-206.messagelabs.com!1353090537!20500757!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28076 invoked from network); 16 Nov 2012 18:28:58 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-11.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 18:28:58 -0000
X-TM-IMSS-Message-ID: <8924da5c000aed63@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8924da5c000aed63 ;
	Fri, 16 Nov 2012 13:31:38 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3k031862; 
	Fri, 16 Nov 2012 13:28:56 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:29 -0500
Message-Id: <1353090514-18537-15-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 14/19] arch/x86: Add missing mem_sharing XSM
	hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch adds splits up the mem_sharing and mem_event XSM hooks to
better cover what the code is doing. It also changes the utility
function get_mem_event_op_target to rcu_lock_live_remote_domain_by_id
because there is no mm-specific logic in there.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Tim Deegan <tim@xen.org>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 tools/flask/policy/policy/flask/access_vectors |  1 +
 xen/arch/x86/domctl.c                          |  8 ++---
 xen/arch/x86/mm/mem_event.c                    | 41 ++++++++------------------
 xen/arch/x86/mm/mem_sharing.c                  | 25 +++++++++++++---
 xen/common/domain.c                            | 15 ++++++++++
 xen/include/asm-x86/mem_event.h                |  1 -
 xen/include/xen/sched.h                        |  6 ++++
 xen/include/xsm/dummy.h                        | 23 ++++++++++++++-
 xen/include/xsm/xsm.h                          | 24 +++++++++++++--
 xen/xsm/dummy.c                                |  5 +++-
 xen/xsm/flask/hooks.c                          | 25 ++++++++++++++--
 xen/xsm/flask/include/av_perm_to_string.h      |  1 +
 xen/xsm/flask/include/av_permissions.h         |  1 +
 13 files changed, 130 insertions(+), 46 deletions(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index ea65e45..45ac437 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -102,6 +102,7 @@ class hvm
     mem_sharing
     audit_p2m
     send_irq
+    share_mem
 }
 
 class event
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 30518aa..34e6223 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1503,10 +1503,8 @@ long arch_do_domctl(
         d = rcu_lock_domain_by_id(domctl->domain);
         if ( d != NULL )
         {
-            ret = xsm_mem_event(d);
-            if ( !ret )
-                ret = mem_event_domctl(d, &domctl->u.mem_event_op,
-                                       guest_handle_cast(u_domctl, void));
+            ret = mem_event_domctl(d, &domctl->u.mem_event_op,
+                                   guest_handle_cast(u_domctl, void));
             rcu_unlock_domain(d);
             copy_to_guest(u_domctl, domctl, 1);
         } 
@@ -1562,7 +1560,7 @@ long arch_do_domctl(
         d = rcu_lock_domain_by_id(domctl->domain);
         if ( d != NULL )
         {
-            ret = xsm_mem_event(d);
+            ret = xsm_mem_event_setup(d);
             if ( !ret ) {
                 p2m = p2m_get_hostp2m(d);
                 p2m->access_required = domctl->u.access_required.access_required;
diff --git a/xen/arch/x86/mm/mem_event.c b/xen/arch/x86/mm/mem_event.c
index 27d1cf4..c2b3670 100644
--- a/xen/arch/x86/mm/mem_event.c
+++ b/xen/arch/x86/mm/mem_event.c
@@ -29,6 +29,7 @@
 #include <asm/mem_paging.h>
 #include <asm/mem_access.h>
 #include <asm/mem_sharing.h>
+#include <xsm/xsm.h>
 
 /* for public/io/ring.h macros */
 #define xen_mb()   mb()
@@ -439,35 +440,19 @@ static void mem_sharing_notification(struct vcpu *v, unsigned int port)
         mem_sharing_sharing_resume(v->domain);
 }
 
-struct domain *get_mem_event_op_target(uint32_t domain, int *rc)
-{
-    struct domain *d;
-
-    /* Get the target domain */
-    *rc = rcu_lock_remote_target_domain_by_id(domain, &d);
-    if ( *rc != 0 )
-        return NULL;
-
-    /* Not dying? */
-    if ( d->is_dying )
-    {
-        rcu_unlock_domain(d);
-        *rc = -EINVAL;
-        return NULL;
-    }
-    
-    return d;
-}
-
 int do_mem_event_op(int op, uint32_t domain, void *arg)
 {
     int ret;
     struct domain *d;
 
-    d = get_mem_event_op_target(domain, &ret);
-    if ( !d )
+    ret = rcu_lock_live_remote_domain_by_id(domain, &d);
+    if ( ret )
         return ret;
 
+    ret = xsm_mem_event_op(d, op);
+    if ( ret )
+        goto out;
+
     switch (op)
     {
         case XENMEM_paging_op:
@@ -483,6 +468,7 @@ int do_mem_event_op(int op, uint32_t domain, void *arg)
             ret = -ENOSYS;
     }
 
+ out:
     rcu_unlock_domain(d);
     return ret;
 }
@@ -516,6 +502,10 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
 {
     int rc;
 
+    rc = xsm_mem_event_control(d, mec->mode, mec->op);
+    if ( rc )
+        return rc;
+
     if ( unlikely(d == current->domain) )
     {
         gdprintk(XENLOG_INFO, "Tried to do a memory event op on itself.\n");
@@ -537,13 +527,6 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
         return -EINVAL;
     }
 
-    /* TODO: XSM hook */
-#if 0
-    rc = xsm_mem_event_control(d, mec->op);
-    if ( rc )
-        return rc;
-#endif
-
     rc = -ENOSYS;
 
     switch ( mec->mode )
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..9229b83 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -34,6 +34,7 @@
 #include <asm/atomic.h>
 #include <xen/rcupdate.h>
 #include <asm/event.h>
+#include <xsm/xsm.h>
 
 #include "mm-locks.h"
 
@@ -1345,10 +1346,18 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( !mem_sharing_enabled(d) )
                 return -EINVAL;
 
-            cd = get_mem_event_op_target(mec->u.share.client_domain, &rc);
-            if ( !cd )
+            rc = rcu_lock_live_remote_domain_by_id(mec->u.share.client_domain,
+                                                   &cd);
+            if ( rc )
                 return rc;
 
+            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            if ( rc )
+            {
+                rcu_unlock_domain(cd);
+                return rc;
+            }
+
             if ( !mem_sharing_enabled(cd) )
             {
                 rcu_unlock_domain(cd);
@@ -1401,10 +1410,18 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( !mem_sharing_enabled(d) )
                 return -EINVAL;
 
-            cd = get_mem_event_op_target(mec->u.share.client_domain, &rc);
-            if ( !cd )
+            rc = rcu_lock_live_remote_domain_by_id(mec->u.share.client_domain,
+                                                   &cd);
+            if ( rc )
                 return rc;
 
+            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            if ( rc )
+            {
+                rcu_unlock_domain(cd);
+                return rc;
+            }
+
             if ( !mem_sharing_enabled(cd) )
             {
                 rcu_unlock_domain(cd);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 12c8e24..fcf24e2 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -475,6 +475,21 @@ int rcu_lock_remote_domain_by_id(domid_t dom, struct domain **d)
     return 0;
 }
 
+int rcu_lock_live_remote_domain_by_id(domid_t dom, struct domain **d)
+{
+    int rv;
+    rv = rcu_lock_remote_domain_by_id(dom, d);
+    if ( rv )
+        return rv;
+    if ( (*d)->is_dying )
+    {
+        rcu_unlock_domain(*d);
+        return -EINVAL;
+    }
+
+    return 0;
+}
+
 int domain_kill(struct domain *d)
 {
     int rc = 0;
diff --git a/xen/include/asm-x86/mem_event.h b/xen/include/asm-x86/mem_event.h
index e17f36b..5959621 100644
--- a/xen/include/asm-x86/mem_event.h
+++ b/xen/include/asm-x86/mem_event.h
@@ -62,7 +62,6 @@ void mem_event_put_request(struct domain *d, struct mem_event_domain *med,
 int mem_event_get_response(struct domain *d, struct mem_event_domain *med,
                            mem_event_response_t *rsp);
 
-struct domain *get_mem_event_op_target(uint32_t domain, int *rc);
 int do_mem_event_op(int op, uint32_t domain, void *arg);
 int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
                      XEN_GUEST_HANDLE_PARAM(void) u_domctl);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..90a6537 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -484,6 +484,12 @@ int rcu_lock_remote_target_domain_by_id(domid_t dom, struct domain **d);
  */
 int rcu_lock_remote_domain_by_id(domid_t dom, struct domain **d);
 
+/*
+ * As rcu_lock_remote_domain_by_id() but will fail EINVAL if the domain is
+ * dying.
+ */
+int rcu_lock_live_remote_domain_by_id(domid_t dom, struct domain **d);
+
 /* Finish a RCU critical region started by rcu_lock_domain_by_id(). */
 static inline void rcu_unlock_domain(struct domain *d)
 {
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 073217a..ee381a8 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -551,16 +551,37 @@ static XSM_DEFAULT(int, hvm_inject_msi) (struct domain *d)
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_event) (struct domain *d)
+static XSM_DEFAULT(int, mem_event_setup) (struct domain *d)
 {
     return 0;
 }
 
+static XSM_DEFAULT(int, mem_event_control) (struct domain *d, int mode, int op)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
+static XSM_DEFAULT(int, mem_event_op) (struct domain *d, int op)
+{
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_DEFAULT(int, mem_sharing) (struct domain *d)
 {
     return 0;
 }
 
+static XSM_DEFAULT(int, mem_sharing_op) (struct domain *d, struct domain *cd, int op)
+{
+    if ( !IS_PRIV_FOR(current->domain, cd) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_DEFAULT(int, apic) (struct domain *d, int cmd)
 {
     if ( !IS_PRIV(d) )
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 4900d1f..1b9f939 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -151,8 +151,11 @@ struct xsm_operations {
     int (*hvm_set_isa_irq_level) (struct domain *d);
     int (*hvm_set_pci_link_route) (struct domain *d);
     int (*hvm_inject_msi) (struct domain *d);
-    int (*mem_event) (struct domain *d);
+    int (*mem_event_setup) (struct domain *d);
+    int (*mem_event_control) (struct domain *d, int mode, int op);
+    int (*mem_event_op) (struct domain *d, int op);
     int (*mem_sharing) (struct domain *d);
+    int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
     int (*apic) (struct domain *d, int cmd);
     int (*xen_settime) (void);
     int (*memtype) (uint32_t access);
@@ -663,9 +666,19 @@ static inline int xsm_hvm_inject_msi (struct domain *d)
     return xsm_ops->hvm_inject_msi(d);
 }
 
-static inline int xsm_mem_event (struct domain *d)
+static inline int xsm_mem_event_setup (struct domain *d)
 {
-    return xsm_ops->mem_event(d);
+    return xsm_ops->mem_event_setup(d);
+}
+
+static inline int xsm_mem_event_control (struct domain *d, int mode, int op)
+{
+    return xsm_ops->mem_event_control(d, mode, op);
+}
+
+static inline int xsm_mem_event_op (struct domain *d, int op)
+{
+    return xsm_ops->mem_event_op(d, op);
 }
 
 static inline int xsm_mem_sharing (struct domain *d)
@@ -673,6 +686,11 @@ static inline int xsm_mem_sharing (struct domain *d)
     return xsm_ops->mem_sharing(d);
 }
 
+static inline int xsm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
+{
+    return xsm_ops->mem_sharing_op(d, cd, op);
+}
+
 static inline int xsm_apic (struct domain *d, int cmd)
 {
     return xsm_ops->apic(d, cmd);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 43e8617..3926b2b 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -135,8 +135,11 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, hvm_set_isa_irq_level);
     set_to_dummy_if_null(ops, hvm_set_pci_link_route);
     set_to_dummy_if_null(ops, hvm_inject_msi);
-    set_to_dummy_if_null(ops, mem_event);
+    set_to_dummy_if_null(ops, mem_event_setup);
+    set_to_dummy_if_null(ops, mem_event_control);
+    set_to_dummy_if_null(ops, mem_event_op);
     set_to_dummy_if_null(ops, mem_sharing);
+    set_to_dummy_if_null(ops, mem_sharing_op);
     set_to_dummy_if_null(ops, apic);
     set_to_dummy_if_null(ops, xen_settime);
     set_to_dummy_if_null(ops, memtype);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index a8475ea..99d3e21 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1277,7 +1277,17 @@ static int flask_hvm_inject_msi(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
-static int flask_mem_event(struct domain *d)
+static int flask_mem_event_setup(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
+}
+
+static int flask_mem_event_control(struct domain *d, int mode, int op)
+{
+    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
+}
+
+static int flask_mem_event_op(struct domain *d, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
@@ -1287,6 +1297,14 @@ static int flask_mem_sharing(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
 }
 
+static int flask_mem_sharing_op(struct domain *d, struct domain *cd, int op)
+{
+    int rc = current_has_perm(cd, SECCLASS_HVM, HVM__MEM_SHARING);
+    if ( rc )
+        return rc;
+    return domain_has_perm(d, cd, SECCLASS_HVM, HVM__SHARE_MEM);
+}
+
 static int flask_apic(struct domain *d, int cmd)
 {
     u32 perm;
@@ -1736,8 +1754,11 @@ static struct xsm_operations flask_ops = {
     .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
     .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
     .hvm_inject_msi = flask_hvm_inject_msi,
-    .mem_event = flask_mem_event,
+    .mem_event_setup = flask_mem_event_setup,
+    .mem_event_control = flask_mem_event_control,
+    .mem_event_op = flask_mem_event_op,
     .mem_sharing = flask_mem_sharing,
+    .mem_sharing_op = flask_mem_sharing_op,
     .apic = flask_apic,
     .xen_settime = flask_xen_settime,
     .memtype = flask_memtype,
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 894910c..186f1fa 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -84,6 +84,7 @@
    S_(SECCLASS_HVM, HVM__MEM_SHARING, "mem_sharing")
    S_(SECCLASS_HVM, HVM__AUDIT_P2M, "audit_p2m")
    S_(SECCLASS_HVM, HVM__SEND_IRQ, "send_irq")
+   S_(SECCLASS_HVM, HVM__SHARE_MEM, "share_mem")
    S_(SECCLASS_EVENT, EVENT__BIND, "bind")
    S_(SECCLASS_EVENT, EVENT__SEND, "send")
    S_(SECCLASS_EVENT, EVENT__STATUS, "status")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index 1bdb515..b3831f6 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -87,6 +87,7 @@
 #define HVM__MEM_SHARING                          0x00001000UL
 #define HVM__AUDIT_P2M                            0x00002000UL
 #define HVM__SEND_IRQ                             0x00004000UL
+#define HVM__SHARE_MEM                            0x00008000UL
 
 #define EVENT__BIND                               0x00000001UL
 #define EVENT__SEND                               0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf9-00072T-O7; Fri, 16 Nov 2012 18:29:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQf0-0006jI-I0
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:03 +0000
Received: from [85.158.139.211:27903] by server-1.bemta-5.messagelabs.com id
	F7/C6-05877-DE586A05; Fri, 16 Nov 2012 18:29:01 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353090537!20499496!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9140 invoked from network); 16 Nov 2012 18:28:58 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-6.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 18:28:58 -0000
X-TM-IMSS-Message-ID: <8924d8d6000aed61@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8924d8d6000aed61 ;
	Fri, 16 Nov 2012 13:31:38 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3j031862; 
	Fri, 16 Nov 2012 13:28:55 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:28 -0500
Message-Id: <1353090514-18537-14-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org
Subject: [Xen-devel] [PATCH 13/19] xsm/flask: add distinct SIDs for
	self/target access
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Because the FLASK XSM module no longer checks IS_PRIV for remote domain
accesses covered by XSM permissions, domains now have the ability to
perform memory management and other functions on all domains that have
the same type. While it is possible to prevent this by only creating one
domain per type, this solution significantly limits the flexibility of
the type system.

This patch introduces a domain type transition to represent a domain
that is operating on itself. In the example policy, this is demonstrated
by creating a type with _self appended when declaring a domain type
which will be used for reflexive operations. AVCs for a domain of type
domU_t will look like the following:

scontext=system_u:system_r:domU_t tcontext=system_u:system_r:domU_t_self

This change also allows policy to distinguish between event channels a
domain creates to itself and event channels created between domains of
the same type.

The IS_PRIV_FOR check used for device model domains is also no longer
checked by FLASK; a similar transition is performed when the target is
set and used when the device model accesses its target domain.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 docs/misc/xsm-flask.txt                      |  43 ++-
 tools/flask/policy/policy/modules/xen/xen.if |  60 +++-
 tools/flask/policy/policy/modules/xen/xen.te |  13 +-
 xen/xsm/flask/flask_op.c                     |   9 +
 xen/xsm/flask/hooks.c                        | 422 +++++++++++++--------------
 xen/xsm/flask/include/objsec.h               |   2 +
 6 files changed, 307 insertions(+), 242 deletions(-)

diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index 0778a28..ff81b01 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -68,9 +68,43 @@ HVM domains with stubdomain device models use two types (one per domain):
  - dm_dom_t is the device model for a domain with type domHVM_t
 
 One disadvantage of using type enforcement to enforce isolation is that a new
-type is needed for each group of domains. In addition, it is not possible to
-allow isolated_domU_t cannot to create loopback event channels without allowing
-two domains of type isolated_domU_t to communicate with one another.
+type is needed for each group of domains. The user field can be used to address
+this for the most common case of groups that can communicate internally but not
+externally; see "Users and roles" below.
+
+Type transitions
+----------------
+
+Xen defines a number of operations such as memory mapping that are necessary for
+a domain to perform on itself, but are also undesirable to allow a domain to
+perform on every other domain of the same label. While it is possible to address
+this by only creating one domain per type, this solution significantly limits
+the flexibility of the type system. Another method to address this issue is to
+duplicate the permission names for every operation that can be performed on the
+current domain or on other domains; however, this significantly increases the
+necessary number of permissions and complicates the XSM hooks. Instead, this is
+addressed by allowing a distinct type to be used for a domain's access to
+itself. The same applies for a device model domain's access to its designated
+target, allowing the IS_PRIV_FOR checks used in Xen's DAC model to be
+implemented in FLASK.
+
+Upon domain creation (or relabel), a type transition is computed using the
+domain's label as the source and target. The result of this computation is used
+as the target when the domain accesses itself. In the example policy, this
+computed type is the result of appending _self to a domain's type: domU_t_self
+for domU_t. If no type transition rule exists, the domain will continue to use
+its own label for both the source and target. An AVC message will look like:
+
+    scontext=system_u:system_r:domU_t tcontext=system_u:system_r:domU_t_self
+
+A similar type transition is done when a device model domain is associated with
+its target using the set_target operation. The transition is computed with the
+target domain as the source and the device model domain as the target: this
+ordering was chosen in order to preserve the original label for the target when
+no type transition rule exists. In the example policy, these computed types are
+the result of appending _target to the domain.
+
+Type transitions are also used to compute the labels of event channels.
 
 Users and roles
 ---------------
@@ -84,7 +118,8 @@ the customer_1 user.
 Access control rules involving users and roles are defined in the policy
 constraints file (tools/flask/policy/policy/constraints). The example policy
 provides constraints that prevent different users from communicating using
-grants or event channels, while still allowing communication with dom0.
+grants or event channels, while still allowing communication with the system_u
+user where dom0 resides.
 
 Resource Policy
 ---------------
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 59ba171..d630f47 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -5,15 +5,34 @@
 # Domain creation and setup
 #
 ################################################################################
+define(`declare_domain_common', `
+	allow $1 $2:grant { query setup };
+	allow $1 $2:mmu { adjust physmap map_read map_write stat pinpage updatemp };
+	allow $1 $2:hvm { getparam setparam };
+')
+
 # declare_domain(type, attrs...)
-#   Declare a type as a domain type, and allow basic domain setup
+#   Declare a domain type, along with associated _self and _channel types
+#   Allow the domain to perform basic operations on itself
 define(`declare_domain', `
 	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
+	type $1_self, domain_type, domain_self_type;
+	type_transition $1 $1:domain $1_self;
+	type $1_channel, event_type;
+	type_transition $1 domain_type:event $1_channel;
+	declare_domain_common($1, $1_self)
+')
+
+# declare_singleton_domain(type, attrs...)
+#   Declare a domain type and associated _channel types.
+#   Note: Because the domain can perform basic operations on itself and any
+#   other domain of the same type, this constructor should be used for types
+#   containing at most one domain. This is not enforced by policy.
+define(`declare_singleton_domain', `
+	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
 	type $1_channel, event_type;
 	type_transition $1 domain_type:event $1_channel;
-	allow $1 $1:grant { query setup };
-	allow $1 $1:mmu { adjust physmap map_read map_write stat pinpage };
-	allow $1 $1:hvm { getparam setparam };
+	declare_domain_common($1, $1)
 ')
 
 # declare_build_label(type)
@@ -51,6 +70,7 @@ define(`create_domain_build_label', `
 	allow $1 $2_channel:event create;
 	allow $1 $2_building:domain2 relabelfrom;
 	allow $1 $2:domain2 relabelto;
+	allow $2_building $2:domain transition;
 ')
 
 # manage_domain(priv, target)
@@ -101,20 +121,36 @@ define(`domain_comms', `
 ')
 
 # domain_self_comms(domain)
-#   Allow a domain types to communicate with others of its type using grants
-#   and event channels (this includes event channels to DOMID_SELF)
+#   Allow a non-singleton domain type to communicate with itself using grants
+#   and event channels
 define(`domain_self_comms', `
-	create_channel($1, $1, $1_channel)
-	allow $1 $1:grant { map_read map_write copy unmap };
+	create_channel($1, $1_self, $1_channel)
+	allow $1 $1_self:grant { map_read map_write copy unmap };
 ')
 
 # device_model(dm_dom, hvm_dom)
 #   Define how a device model domain interacts with its target
 define(`device_model', `
-	domain_comms($1, $2)
-	allow $1 $2:domain { set_target shutdown };
-	allow $1 $2:mmu { map_read map_write adjust physmap };
-	allow $1 $2:hvm { getparam setparam trackdirtyvram hvmctl irqlevel pciroute cacheattr send_irq };
+	type $2_target, domain_type, domain_target_type;
+	type_transition $2 $1:domain $2_target;
+	allow $1 $2:domain set_target;
+
+	type_transition $2_target domain_type:event $2_channel;
+	create_channel($1, $2_target, $1_channel)
+	create_channel($2, $1, $2_channel)
+	allow $1 $2_channel:event create;
+
+	allow $1 $2_target:domain shutdown;
+	allow $1 $2_target:mmu { map_read map_write adjust physmap };
+	allow $1 $2_target:hvm { getparam setparam trackdirtyvram hvmctl irqlevel pciroute cacheattr send_irq };
+')
+
+# make_device_model(priv, dm_dom, hvm_dom)
+#   Allow creation of a device model and HVM domain pair
+define(`make_device_model', `
+	device_model($2, $3)
+	allow $1 $2:domain2 make_priv_for;
+	allow $1 $3:domain2 set_as_target;
 ')
 ################################################################################
 #
diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
index 1162153..8d33285 100644
--- a/tools/flask/policy/policy/modules/xen/xen.te
+++ b/tools/flask/policy/policy/modules/xen/xen.te
@@ -8,6 +8,8 @@
 ################################################################################
 attribute xen_type;
 attribute domain_type;
+attribute domain_self_type;
+attribute domain_target_type;
 attribute resource_type;
 attribute event_type;
 attribute mls_priv;
@@ -25,7 +27,7 @@ attribute mls_priv;
 type xen_t, xen_type, mls_priv;
 
 # Domain 0
-declare_domain(dom0_t, mls_priv);
+declare_singleton_domain(dom0_t, mls_priv);
 
 # Untracked I/O memory (pseudo-domain)
 type domio_t, xen_type;
@@ -69,7 +71,7 @@ admin_device(dom0_t, ioport_t)
 admin_device(dom0_t, iomem_t)
 allow dom0_t domio_t:mmu { map_read map_write };
 
-domain_self_comms(dom0_t)
+domain_comms(dom0_t, dom0_t)
 
 auditallow dom0_t security_t:security { load_policy setenforce setbool };
 
@@ -84,11 +86,14 @@ domain_self_comms(domU_t)
 create_domain(dom0_t, domU_t)
 manage_domain(dom0_t, domU_t)
 domain_comms(dom0_t, domU_t)
+domain_comms(domU_t, domU_t)
+domain_self_comms(domU_t)
 
 declare_domain(isolated_domU_t)
 create_domain(dom0_t, isolated_domU_t)
 manage_domain(dom0_t, isolated_domU_t)
 domain_comms(dom0_t, isolated_domU_t)
+domain_self_comms(isolated_domU_t)
 
 # Declare a boolean that denies creation of prot_domU_t domains
 gen_bool(prot_doms_locked, false)
@@ -98,6 +103,8 @@ if (!prot_doms_locked) {
 }
 domain_comms(dom0_t, prot_domU_t)
 domain_comms(domU_t, prot_domU_t)
+domain_comms(prot_domU_t, prot_domU_t)
+domain_self_comms(prot_domU_t)
 
 # domHVM_t is meant to be paired with a qemu-dm stub domain of type dm_dom_t
 declare_domain(domHVM_t)
@@ -110,7 +117,7 @@ declare_domain(dm_dom_t)
 create_domain(dom0_t, dm_dom_t)
 manage_domain(dom0_t, dm_dom_t)
 domain_comms(dom0_t, dm_dom_t)
-device_model(dm_dom_t, domHVM_t)
+make_device_model(dom0_t, dm_dom_t, domHVM_t)
 
 # nomigrate_t must be built via the nomigrate_t_building label; once built,
 # dom0 cannot read its memory.
diff --git a/xen/xsm/flask/flask_op.c b/xen/xsm/flask/flask_op.c
index a5d7748..4426ab9 100644
--- a/xen/xsm/flask/flask_op.c
+++ b/xen/xsm/flask/flask_op.c
@@ -612,6 +612,15 @@ static int flask_relabel_domain(struct xen_flask_relabel *arg)
         goto out;
 
     dsec->sid = arg->sid;
+    dsec->self_sid = arg->sid;
+    security_transition_sid(dsec->sid, dsec->sid, SECCLASS_DOMAIN,
+                            &dsec->self_sid);
+    if ( d->target )
+    {
+        struct domain_security_struct *tsec = d->target->ssid;
+        security_transition_sid(tsec->sid, dsec->sid, SECCLASS_DOMAIN,
+                                &dsec->target_sid);
+    }
 
  out:
     rcu_unlock_domain(d);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index dbbf34f..a8475ea 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -33,38 +33,69 @@
 
 struct xsm_operations *original_ops = NULL;
 
+static u32 domain_sid(struct domain *dom)
+{
+    struct domain_security_struct *dsec = dom->ssid;
+    return dsec->sid;
+}
+
+static u32 domain_target_sid(struct domain *src, struct domain *dst)
+{
+    struct domain_security_struct *ssec = src->ssid;
+    struct domain_security_struct *dsec = dst->ssid;
+    if (src == dst)
+        return ssec->self_sid;
+    if (src->target == dst)
+        return ssec->target_sid;
+    return dsec->sid;
+}
+
+static u32 evtchn_sid(const struct evtchn *chn)
+{
+    struct evtchn_security_struct *esec = chn->ssid;
+    return esec->sid;
+}
+
 static int domain_has_perm(struct domain *dom1, struct domain *dom2, 
                            u16 class, u32 perms)
 {
-    struct domain_security_struct *dsec1, *dsec2;
+    u32 ssid, tsid;
     struct avc_audit_data ad;
     AVC_AUDIT_DATA_INIT(&ad, NONE);
     ad.sdom = dom1;
     ad.tdom = dom2;
 
-    dsec1 = dom1->ssid;
-    dsec2 = dom2->ssid;
+    ssid = domain_sid(dom1);
+    tsid = domain_target_sid(dom1, dom2);
 
-    return avc_has_perm(dsec1->sid, dsec2->sid, class, perms, &ad);
+    return avc_has_perm(ssid, tsid, class, perms, &ad);
 }
 
-static int domain_has_evtchn(struct domain *d, struct evtchn *chn, u32 perms)
+static int avc_current_has_perm(u32 tsid, u16 class, u32 perm,
+                                struct avc_audit_data *ad)
 {
-    struct domain_security_struct *dsec;
-    struct evtchn_security_struct *esec;
+    u32 csid = domain_sid(current->domain);
+    return avc_has_perm(csid, tsid, class, perm, ad);
+}
 
-    dsec = d->ssid;
-    esec = chn->ssid;
+static int current_has_perm(struct domain *d, u16 class, u32 perms)
+{
+    return domain_has_perm(current->domain, d, class, perms);
+}
 
-    return avc_has_perm(dsec->sid, esec->sid, SECCLASS_EVENT, perms, NULL);
+static int domain_has_evtchn(struct domain *d, struct evtchn *chn, u32 perms)
+{
+    u32 dsid = domain_sid(d);
+    u32 esid = evtchn_sid(chn);
+
+    return avc_has_perm(dsid, esid, SECCLASS_EVENT, perms, NULL);
 }
 
 static int domain_has_xen(struct domain *d, u32 perms)
 {
-    struct domain_security_struct *dsec;
-    dsec = d->ssid;
+    u32 dsid = domain_sid(d);
 
-    return avc_has_perm(dsec->sid, SECINITSID_XEN, SECCLASS_XEN, perms, NULL);
+    return avc_has_perm(dsid, SECINITSID_XEN, SECCLASS_XEN, perms, NULL);
 }
 
 static int get_irq_sid(int irq, u32 *sid, struct avc_audit_data *ad)
@@ -123,6 +154,7 @@ static int flask_domain_alloc_security(struct domain *d)
         dsec->sid = SECINITSID_UNLABELED;
     }
 
+    dsec->self_sid = dsec->sid;
     d->ssid = dsec;
 
     return 0;
@@ -142,68 +174,55 @@ static void flask_domain_free_security(struct domain *d)
 static int flask_evtchn_unbound(struct domain *d1, struct evtchn *chn, 
                                 domid_t id2)
 {
-    u32 newsid;
+    u32 sid1, sid2, newsid;
     int rc;
-    domid_t id;
     struct domain *d2;
-    struct domain_security_struct *dsec, *dsec1, *dsec2;
     struct evtchn_security_struct *esec;
 
-    dsec = current->domain->ssid;
-    dsec1 = d1->ssid;
-    esec = chn->ssid;
-
-    if ( id2 == DOMID_SELF )
-        id = current->domain->domain_id;
-    else
-        id = id2;
-
-    d2 = get_domain_by_id(id);
+    d2 = rcu_lock_domain_by_any_id(id2);
     if ( d2 == NULL )
         return -EPERM;
 
-    dsec2 = d2->ssid;
-    rc = security_transition_sid(dsec1->sid, dsec2->sid, SECCLASS_EVENT, 
-                                 &newsid);
+    sid1 = domain_sid(d1);
+    sid2 = domain_target_sid(d1, d2);
+    esec = chn->ssid;
+
+    rc = security_transition_sid(sid1, sid2, SECCLASS_EVENT, &newsid);
     if ( rc )
         goto out;
 
-    rc = avc_has_perm(dsec->sid, newsid, SECCLASS_EVENT, EVENT__CREATE, NULL);
+    rc = avc_current_has_perm(newsid, SECCLASS_EVENT, EVENT__CREATE, NULL);
     if ( rc )
         goto out;
 
-    rc = avc_has_perm(newsid, dsec2->sid, SECCLASS_EVENT, EVENT__BIND, NULL);
+    rc = avc_has_perm(newsid, sid2, SECCLASS_EVENT, EVENT__BIND, NULL);
     if ( rc )
         goto out;
-    else
-        esec->sid = newsid;
+
+    esec->sid = newsid;
 
  out:
-    put_domain(d2);
+    rcu_unlock_domain(d2);
     return rc;
 }
 
 static int flask_evtchn_interdomain(struct domain *d1, struct evtchn *chn1, 
                                     struct domain *d2, struct evtchn *chn2)
 {
-    u32 newsid;
+    u32 sid1, sid2, newsid, reverse_sid;
     int rc;
-    struct domain_security_struct *dsec, *dsec1, *dsec2;
-    struct evtchn_security_struct *esec1, *esec2;
+    struct evtchn_security_struct *esec1;
     struct avc_audit_data ad;
     AVC_AUDIT_DATA_INIT(&ad, NONE);
     ad.sdom = d1;
     ad.tdom = d2;
 
-    dsec = current->domain->ssid;
-    dsec1 = d1->ssid;
-    dsec2 = d2->ssid;
+    sid1 = domain_sid(d1);
+    sid2 = domain_target_sid(d1, d2);
 
     esec1 = chn1->ssid;
-    esec2 = chn2->ssid;
 
-    rc = security_transition_sid(dsec1->sid, dsec2->sid, 
-                                 SECCLASS_EVENT, &newsid);
+    rc = security_transition_sid(sid1, sid2, SECCLASS_EVENT, &newsid);
     if ( rc )
     {
         printk("%s: security_transition_sid failed, rc=%d (domain=%d)\n",
@@ -211,15 +230,20 @@ static int flask_evtchn_interdomain(struct domain *d1, struct evtchn *chn1,
         return rc;
     }
 
-    rc = avc_has_perm(dsec->sid, newsid, SECCLASS_EVENT, EVENT__CREATE, &ad);
+    rc = avc_current_has_perm(newsid, SECCLASS_EVENT, EVENT__CREATE, &ad);
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(newsid, dsec2->sid, SECCLASS_EVENT, EVENT__BIND, &ad);
+    rc = avc_has_perm(newsid, sid2, SECCLASS_EVENT, EVENT__BIND, &ad);
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(esec2->sid, dsec1->sid, SECCLASS_EVENT, EVENT__BIND, &ad);
+    /* It's possible the target domain has changed (relabel or destroy/create)
+     * since the unbound part was created; re-validate this binding now.
+     */
+    reverse_sid = evtchn_sid(chn2);
+    sid1 = domain_target_sid(d2, d1);
+    rc = avc_has_perm(reverse_sid, sid1, SECCLASS_EVENT, EVENT__BIND, &ad);
     if ( rc )
         return rc;
 
@@ -302,7 +326,6 @@ static void flask_free_security_evtchn(struct evtchn *chn)
 
 static char *flask_show_security_evtchn(struct domain *d, const struct evtchn *chn)
 {
-    struct evtchn_security_struct *esec;
     int irq;
     u32 sid = 0;
     char *ctx;
@@ -312,9 +335,7 @@ static char *flask_show_security_evtchn(struct domain *d, const struct evtchn *c
     {
     case ECS_UNBOUND:
     case ECS_INTERDOMAIN:
-        esec = chn->ssid;
-        if ( esec )
-            sid = esec->sid;
+        sid = evtchn_sid(chn);
         break;
     case ECS_PIRQ:
         irq = domain_pirq_to_irq(d, chn->u.pirq.irq);
@@ -367,12 +388,12 @@ static int flask_grant_query_size(struct domain *d1, struct domain *d2)
 
 static int flask_get_pod_target(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__GETPODTARGET);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETPODTARGET);
 }
 
 static int flask_set_pod_target(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SETPODTARGET);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETPODTARGET);
 }
 
 static int flask_memory_adjust_reservation(struct domain *d1, struct domain *d2)
@@ -455,70 +476,65 @@ static int flask_schedop_shutdown(struct domain *d1, struct domain *d2)
 static void flask_security_domaininfo(struct domain *d, 
                                       struct xen_domctl_getdomaininfo *info)
 {
-    struct domain_security_struct *dsec;
-
-    dsec = d->ssid;
-    info->ssidref = dsec->sid;
+    info->ssidref = domain_sid(d);
 }
 
 static int flask_setvcpucontext(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__SETVCPUCONTEXT);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT);
 }
 
 static int flask_pausedomain(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
 }
 
 static int flask_unpausedomain(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
 }
 
 static int flask_resumedomain(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__RESUME);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__RESUME);
 }
 
 static int flask_domain_create(struct domain *d, u32 ssidref)
 {
     int rc;
-    struct domain_security_struct *dsec1;
-    struct domain_security_struct *dsec2;
+    struct domain_security_struct *dsec = d->ssid;
     static int dom0_created = 0;
 
-    dsec1 = current->domain->ssid;
-    dsec2 = d->ssid;
-
     if ( is_idle_domain(current->domain) && !dom0_created )
     {
-        dsec2->sid = SECINITSID_DOM0;
+        dsec->sid = SECINITSID_DOM0;
         dom0_created = 1;
-        return 0;
     }
+    else
+    {
+        rc = avc_current_has_perm(ssidref, SECCLASS_DOMAIN,
+                          DOMAIN__CREATE, NULL);
+        if ( rc )
+            return rc;
 
-    rc = avc_has_perm(dsec1->sid, ssidref, SECCLASS_DOMAIN,
-                      DOMAIN__CREATE, NULL);
-    if ( rc )
-        return rc;
+        dsec->sid = ssidref;
+    }
+    dsec->self_sid = dsec->sid;
 
-    dsec2->sid = ssidref;
+    rc = security_transition_sid(dsec->sid, dsec->sid, SECCLASS_DOMAIN,
+                                 &dsec->self_sid);
 
     return rc;
 }
 
 static int flask_max_vcpus(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__MAX_VCPUS);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS);
 }
 
 static int flask_destroydomain(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__DESTROY);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__DESTROY);
 }
 
 static int flask_vcpuaffinity(int cmd, struct domain *d)
@@ -537,7 +553,7 @@ static int flask_vcpuaffinity(int cmd, struct domain *d)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm );
+    return current_has_perm(d, SECCLASS_DOMAIN, perm );
 }
 
 static int flask_scheduler(struct domain *d)
@@ -548,43 +564,51 @@ static int flask_scheduler(struct domain *d)
     if ( rc )
         return rc;
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__SCHEDULER);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SCHEDULER);
 }
 
 static int flask_getdomaininfo(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__GETDOMAININFO);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO);
 }
 
 static int flask_getvcpucontext(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__GETVCPUCONTEXT);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT);
 }
 
 static int flask_getvcpuinfo(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__GETVCPUINFO);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO);
 }
 
 static int flask_domain_settime(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
 }
 
-static int flask_set_target(struct domain *d, struct domain *e)
+static int flask_set_target(struct domain *d, struct domain *t)
 {
     int rc;
-    rc = domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR);
+    struct domain_security_struct *dsec, *tsec;
+    dsec = d->ssid;
+    tsec = t->ssid;
+
+    rc = current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR);
     if ( rc )
         return rc;
-    rc = domain_has_perm(current->domain, e, SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET);
+    rc = current_has_perm(t, SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET);
     if ( rc )
         return rc;
-    return domain_has_perm(d, e, SECCLASS_DOMAIN, DOMAIN__SET_TARGET);
+    /* Use avc_has_perm to avoid resolving target/current SID */
+    rc = avc_has_perm(dsec->sid, tsec->sid, SECCLASS_DOMAIN, DOMAIN__SET_TARGET, NULL);
+    if ( rc )
+        return rc;
+
+    /* (tsec, dsec) defaults the label to tsec, as it should here */
+    rc = security_transition_sid(tsec->sid, dsec->sid, SECCLASS_DOMAIN,
+                                 &dsec->target_sid);
+    return rc;
 }
 
 static int flask_domctl(struct domain *d, int cmd)
@@ -655,26 +679,24 @@ static int flask_domctl(struct domain *d, int cmd)
     case XEN_DOMCTL_gdbsx_pausevcpu:
     case XEN_DOMCTL_gdbsx_unpausevcpu:
     case XEN_DOMCTL_gdbsx_domstatus:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                               DOMAIN__SETDEBUGGING);
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
 
     case XEN_DOMCTL_subscribe:
     case XEN_DOMCTL_disable_migrate:
     case XEN_DOMCTL_suppress_spurious_page_faults:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                               DOMAIN__SET_MISC_INFO);
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO);
 
     case XEN_DOMCTL_set_cpuid:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID);
+        return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID);
 
     case XEN_DOMCTL_gettscinfo:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__GETTSC);
+        return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__GETTSC);
 
     case XEN_DOMCTL_settscinfo:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__SETTSC);
+        return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SETTSC);
 
     case XEN_DOMCTL_audit_p2m:
-        return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__AUDIT_P2M);
+        return current_has_perm(d, SECCLASS_HVM, HVM__AUDIT_P2M);
 
     default:
         printk("flask_domctl: Unknown op %d\n", cmd);
@@ -716,7 +738,7 @@ static int flask_sysctl(int cmd)
 
 static int flask_set_virq_handler(struct domain *d, uint32_t virq)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
 }
 
 static int flask_tbufcontrol(void)
@@ -741,20 +763,17 @@ static int flask_sched_id(void)
 
 static int flask_setdomainmaxmem(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__SETDOMAINMAXMEM);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM);
 }
 
 static int flask_setdomainhandle(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__SETDOMAINHANDLE);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE);
 }
 
 static int flask_setdebugging(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__SETDEBUGGING);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
 }
 
 static int flask_debug_keys(void)
@@ -816,14 +835,12 @@ static char *flask_show_irq_sid (int irq)
 
 static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
 {
-    u32 sid;
+    u32 sid, dsid;
     int rc = -EPERM;
     struct msi_info *msi = data;
-
-    struct domain_security_struct *ssec, *tsec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__ADD);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
 
     if ( rc )
         return rc;
@@ -839,14 +856,13 @@ static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
     if ( rc )
         return rc;
 
-    ssec = current->domain->ssid;
-    tsec = d->ssid;
+    dsid = domain_sid(d);
 
-    rc = avc_has_perm(ssec->sid, sid, SECCLASS_RESOURCE, RESOURCE__ADD_IRQ, &ad);
+    rc = avc_current_has_perm(sid, SECCLASS_RESOURCE, RESOURCE__ADD_IRQ, &ad);
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    rc = avc_has_perm(dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
     return rc;
 }
 
@@ -854,16 +870,12 @@ static int flask_unmap_domain_pirq (struct domain *d, int irq)
 {
     u32 sid;
     int rc = -EPERM;
-
-    struct domain_security_struct *ssec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
     if ( rc )
         return rc;
 
-    ssec = current->domain->ssid;
-
     if ( irq >= nr_irqs_gsi ) {
         /* TODO support for MSI here */
         return 0;
@@ -873,19 +885,19 @@ static int flask_unmap_domain_pirq (struct domain *d, int irq)
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(ssec->sid, sid, SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, &ad);
+    rc = avc_current_has_perm(sid, SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, &ad);
     return rc;
 }
 
 static int flask_irq_permission (struct domain *d, int pirq, uint8_t access)
 {
     /* the PIRQ number is not useful; real IRQ is checked during mapping */
-    return domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
-                           resource_to_perm(access));
+    return current_has_perm(d, SECCLASS_RESOURCE, resource_to_perm(access));
 }
 
 struct iomem_has_perm_data {
-    struct domain_security_struct *ssec, *tsec;
+    u32 ssid;
+    u32 dsid;
     u32 perm;
 };
 
@@ -899,12 +911,12 @@ static int _iomem_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     ad.range.start = start;
     ad.range.end = end;
 
-    rc = avc_has_perm(data->ssec->sid, sid, SECCLASS_RESOURCE, data->perm, &ad);
+    rc = avc_has_perm(data->ssid, sid, SECCLASS_RESOURCE, data->perm, &ad);
 
     if ( rc )
         return rc;
 
-    return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    return avc_has_perm(data->dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
 static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
@@ -912,7 +924,7 @@ static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end
     struct iomem_has_perm_data data;
     int rc;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
+    rc = current_has_perm(d, SECCLASS_RESOURCE,
                          resource_to_perm(access));
     if ( rc )
         return rc;
@@ -922,8 +934,8 @@ static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end
     else
         data.perm = RESOURCE__REMOVE_IOMEM;
 
-    data.ssec = current->domain->ssid;
-    data.tsec = d->ssid;
+    data.ssid = domain_sid(current->domain);
+    data.dsid = domain_sid(d);
 
     return security_iterate_iomem_sids(start, end, _iomem_has_perm, &data);
 }
@@ -935,10 +947,9 @@ static int flask_iomem_mapping(struct domain *d, uint64_t start, uint64_t end, u
 
 static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
-    u32 rsid;
+    u32 dsid, rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
     u32 perm = RESOURCE__USE;
 
     rc = security_device_sid(machine_bdf, &rsid);
@@ -951,33 +962,24 @@ static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, u
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = d->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
+    dsid = domain_sid(d);
+    return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, perm, &ad);
 
 }
 
 static int flask_resource_plug_core(void)
 {
-    struct domain_security_struct *ssec;
-
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__PLUG, NULL);
+    return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__PLUG, NULL);
 }
 
 static int flask_resource_unplug_core(void)
 {
-    struct domain_security_struct *ssec;
-
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__UNPLUG, NULL);
+    return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__UNPLUG, NULL);
 }
 
 static int flask_resource_use_core(void)
 {
-    struct domain_security_struct *ssec;
-
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__USE, NULL);
+    return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__USE, NULL);
 }
 
 static int flask_resource_plug_pci(uint32_t machine_bdf)
@@ -985,7 +987,6 @@ static int flask_resource_plug_pci(uint32_t machine_bdf)
     u32 rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
@@ -993,8 +994,7 @@ static int flask_resource_plug_pci(uint32_t machine_bdf)
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__PLUG, &ad);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__PLUG, &ad);
 }
 
 static int flask_resource_unplug_pci(uint32_t machine_bdf)
@@ -1002,7 +1002,6 @@ static int flask_resource_unplug_pci(uint32_t machine_bdf)
     u32 rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
@@ -1010,8 +1009,7 @@ static int flask_resource_unplug_pci(uint32_t machine_bdf)
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__UNPLUG, &ad);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__UNPLUG, &ad);
 }
 
 static int flask_resource_setup_pci(uint32_t machine_bdf)
@@ -1019,7 +1017,6 @@ static int flask_resource_setup_pci(uint32_t machine_bdf)
     u32 rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
@@ -1027,8 +1024,7 @@ static int flask_resource_setup_pci(uint32_t machine_bdf)
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
 static int flask_resource_setup_gsi(int gsi)
@@ -1036,22 +1032,17 @@ static int flask_resource_setup_gsi(int gsi)
     u32 rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
 
     rc = get_irq_sid(gsi, &rsid, &ad);
     if ( rc )
         return rc;
 
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
 static int flask_resource_setup_misc(void)
 {
-    struct domain_security_struct *ssec;
-
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);
+    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);
 }
 
 static inline int flask_page_offline(uint32_t cmd)
@@ -1114,11 +1105,12 @@ static int flask_shadow_control(struct domain *d, uint32_t op)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_SHADOW, perm);
+    return current_has_perm(d, SECCLASS_SHADOW, perm);
 }
 
 struct ioport_has_perm_data {
-    struct domain_security_struct *ssec, *tsec;
+    u32 ssid;
+    u32 dsid;
     u32 perm;
 };
 
@@ -1132,12 +1124,12 @@ static int _ioport_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     ad.range.start = start;
     ad.range.end = end;
 
-    rc = avc_has_perm(data->ssec->sid, sid, SECCLASS_RESOURCE, data->perm, &ad);
+    rc = avc_has_perm(data->ssid, sid, SECCLASS_RESOURCE, data->perm, &ad);
 
     if ( rc )
         return rc;
 
-    return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    return avc_has_perm(data->dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
 static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
@@ -1145,7 +1137,7 @@ static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t en
     int rc;
     struct ioport_has_perm_data data;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
+    rc = current_has_perm(d, SECCLASS_RESOURCE,
                          resource_to_perm(access));
 
     if ( rc )
@@ -1156,8 +1148,8 @@ static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t en
     else
         data.perm = RESOURCE__REMOVE_IOPORT;
 
-    data.ssec = current->domain->ssid;
-    data.tsec = d->ssid;
+    data.ssid = domain_sid(current->domain);
+    data.dsid = domain_sid(d);
 
     return security_iterate_ioport_sids(start, end, _ioport_has_perm, &data);
 }
@@ -1169,18 +1161,17 @@ static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end,
 
 static int flask_getpageframeinfo(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_MMU, MMU__PAGEINFO);
+    return current_has_perm(d, SECCLASS_MMU, MMU__PAGEINFO);
 }
 
 static int flask_getmemlist(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_MMU, MMU__PAGELIST);
+    return current_has_perm(d, SECCLASS_MMU, MMU__PAGELIST);
 }
 
 static int flask_hypercall_init(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__HYPERCALL);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__HYPERCALL);
 }
 
 static int flask_hvmcontext(struct domain *d, uint32_t cmd)
@@ -1203,7 +1194,7 @@ static int flask_hvmcontext(struct domain *d, uint32_t cmd)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, perm);
+    return current_has_perm(d, SECCLASS_HVM, perm);
 }
 
 static int flask_address_size(struct domain *d, uint32_t cmd)
@@ -1222,7 +1213,7 @@ static int flask_address_size(struct domain *d, uint32_t cmd)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
+    return current_has_perm(d, SECCLASS_DOMAIN, perm);
 }
 
 static int flask_machine_address_size(struct domain *d, uint32_t cmd)
@@ -1263,37 +1254,37 @@ static int flask_hvm_param(struct domain *d, unsigned long op)
         perm = HVM__HVMCTL;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, perm);
+    return current_has_perm(d, SECCLASS_HVM, perm);
 }
 
 static int flask_hvm_set_pci_intx_level(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__PCILEVEL);
+    return current_has_perm(d, SECCLASS_HVM, HVM__PCILEVEL);
 }
 
 static int flask_hvm_set_isa_irq_level(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__IRQLEVEL);
+    return current_has_perm(d, SECCLASS_HVM, HVM__IRQLEVEL);
 }
 
 static int flask_hvm_set_pci_link_route(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__PCIROUTE);
+    return current_has_perm(d, SECCLASS_HVM, HVM__PCIROUTE);
 }
 
 static int flask_hvm_inject_msi(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__SEND_IRQ);
+    return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
 static int flask_mem_event(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__MEM_EVENT);
+    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
 
 static int flask_mem_sharing(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__MEM_SHARING);
+    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
 }
 
 static int flask_apic(struct domain *d, int cmd)
@@ -1355,11 +1346,7 @@ static int flask_physinfo(void)
 
 static int flask_platform_quirk(uint32_t quirk)
 {
-    struct domain_security_struct *dsec;
-    dsec = current->domain->ssid;
-
-    return avc_has_perm(dsec->sid, SECINITSID_XEN, SECCLASS_XEN, 
-                        XEN__QUIRK, NULL);
+    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN, XEN__QUIRK, NULL);
 }
 
 static int flask_platform_op(uint32_t op)
@@ -1421,16 +1408,12 @@ static int flask_getidletime(void)
 
 static int flask_machine_memory_map(void)
 {
-    struct domain_security_struct *dsec;
-    dsec = current->domain->ssid;
-
-    return avc_has_perm(dsec->sid, SECINITSID_XEN, SECCLASS_MMU, 
-                        MMU__MEMORYMAP, NULL);
+    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_MMU, MMU__MEMORYMAP, NULL);
 }
 
 static int flask_domain_memory_map(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_MMU, MMU__MEMORYMAP);
+    return current_has_perm(d, SECCLASS_MMU, MMU__MEMORYMAP);
 }
 
 static int domain_memory_perm(struct domain *d, struct domain *f, l1_pgentry_t pte)
@@ -1453,17 +1436,17 @@ static int domain_memory_perm(struct domain *d, struct domain *f, l1_pgentry_t p
     if ( f->domain_id == DOMID_IO || !mfn_valid(fmfn) )
     {
         struct avc_audit_data ad;
-        struct domain_security_struct *dsec = d->ssid;
-        u32 fsid;
+        u32 dsid, fsid;
+        rc = security_iomem_sid(fmfn, &fsid);
+        if ( rc )
+            return rc;
         AVC_AUDIT_DATA_INIT(&ad, MEMORY);
         ad.sdom = d;
         ad.tdom = f;
         ad.memory.pte = pte.l1;
         ad.memory.mfn = fmfn;
-        rc = security_iomem_sid(fmfn, &fsid);
-        if ( rc )
-            return rc;
-        return avc_has_perm(dsec->sid, fsid, SECCLASS_MMU, map_perms, &ad);
+        dsid = domain_sid(d);
+        return avc_has_perm(dsid, fsid, SECCLASS_MMU, map_perms, &ad);
     }
 
     return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
@@ -1506,43 +1489,40 @@ static int flask_remove_from_physmap(struct domain *d1, struct domain *d2)
 
 static int flask_sendtrigger(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
 }
 
 static int flask_get_device_group(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
-    struct domain_security_struct *ssec = current->domain->ssid;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
         return rc;
 
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
 }
 
 static int flask_test_assign_device(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
-    struct domain_security_struct *ssec = current->domain->ssid;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
         return rc;
 
-    return rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
 }
 
 static int flask_assign_device(struct domain *d, uint32_t machine_bdf)
 {
-    u32 rsid;
+    u32 dsid, rsid;
     int rc = -EPERM;
-    struct domain_security_struct *ssec, *tsec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__ADD);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
     if ( rc )
         return rc;
 
@@ -1552,22 +1532,20 @@ static int flask_assign_device(struct domain *d, uint32_t machine_bdf)
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = current->domain->ssid;
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__ADD_DEVICE, &ad);
+    rc = avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__ADD_DEVICE, &ad);
     if ( rc )
         return rc;
 
-    tsec = d->ssid;
-    return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    dsid = domain_sid(d);
+    return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
 static int flask_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
-    struct domain_security_struct *ssec = current->domain->ssid;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
     if ( rc )
         return rc;
 
@@ -1575,18 +1553,17 @@ static int flask_deassign_device(struct domain *d, uint32_t machine_bdf)
     if ( rc )
         return rc;
 
-    return rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__REMOVE_DEVICE, NULL);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__REMOVE_DEVICE, NULL);
 }
 
 static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
-    u32 rsid;
+    u32 dsid, rsid;
     int rc = -EPERM;
     int irq;
-    struct domain_security_struct *ssec, *tsec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__ADD);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
     if ( rc )
         return rc;
 
@@ -1596,23 +1573,22 @@ static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *b
     if ( rc )
         return rc;
 
-    ssec = current->domain->ssid;
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_HVM, HVM__BIND_IRQ, &ad);
+    rc = avc_current_has_perm(rsid, SECCLASS_HVM, HVM__BIND_IRQ, &ad);
     if ( rc )
         return rc;
 
-    tsec = d->ssid;
-    return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    dsid = domain_sid(d);
+    return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
 static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
+    return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
 
 static int flask_pin_mem_cacheattr (struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__CACHEATTR);
+    return current_has_perm(d, SECCLASS_HVM, HVM__CACHEATTR);
 }
 
 static int flask_ext_vcpucontext (struct domain *d, uint32_t cmd)
@@ -1631,7 +1607,7 @@ static int flask_ext_vcpucontext (struct domain *d, uint32_t cmd)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
+    return current_has_perm(d, SECCLASS_DOMAIN, perm);
 }
 
 static int flask_vcpuextstate (struct domain *d, uint32_t cmd)
@@ -1650,7 +1626,7 @@ static int flask_vcpuextstate (struct domain *d, uint32_t cmd)
             return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
+    return current_has_perm(d, SECCLASS_DOMAIN, perm);
 }
 #endif
 
diff --git a/xen/xsm/flask/include/objsec.h b/xen/xsm/flask/include/objsec.h
index 4ff52be..6595dc3 100644
--- a/xen/xsm/flask/include/objsec.h
+++ b/xen/xsm/flask/include/objsec.h
@@ -19,6 +19,8 @@
 
 struct domain_security_struct {
     u32 sid;               /* current SID */
+    u32 self_sid;          /* SID for target when operating on DOMID_SELF */
+    u32 target_sid;        /* SID for device model target domain */
 };
 
 struct evtchn_security_struct {
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQf9-00072T-O7; Fri, 16 Nov 2012 18:29:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQf0-0006jI-I0
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:03 +0000
Received: from [85.158.139.211:27903] by server-1.bemta-5.messagelabs.com id
	F7/C6-05877-DE586A05; Fri, 16 Nov 2012 18:29:01 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353090537!20499496!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9140 invoked from network); 16 Nov 2012 18:28:58 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-6.tower-206.messagelabs.com with SMTP;
	16 Nov 2012 18:28:58 -0000
X-TM-IMSS-Message-ID: <8924d8d6000aed61@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8924d8d6000aed61 ;
	Fri, 16 Nov 2012 13:31:38 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3j031862; 
	Fri, 16 Nov 2012 13:28:55 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:28 -0500
Message-Id: <1353090514-18537-14-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org
Subject: [Xen-devel] [PATCH 13/19] xsm/flask: add distinct SIDs for
	self/target access
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Because the FLASK XSM module no longer checks IS_PRIV for remote domain
accesses covered by XSM permissions, domains now have the ability to
perform memory management and other functions on all domains that have
the same type. While it is possible to prevent this by only creating one
domain per type, this solution significantly limits the flexibility of
the type system.

This patch introduces a domain type transition to represent a domain
that is operating on itself. In the example policy, this is demonstrated
by creating a type with _self appended when declaring a domain type
which will be used for reflexive operations. AVCs for a domain of type
domU_t will look like the following:

scontext=system_u:system_r:domU_t tcontext=system_u:system_r:domU_t_self

This change also allows policy to distinguish between event channels a
domain creates to itself and event channels created between domains of
the same type.

The IS_PRIV_FOR check used for device model domains is also no longer
checked by FLASK; a similar transition is performed when the target is
set and used when the device model accesses its target domain.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 docs/misc/xsm-flask.txt                      |  43 ++-
 tools/flask/policy/policy/modules/xen/xen.if |  60 +++-
 tools/flask/policy/policy/modules/xen/xen.te |  13 +-
 xen/xsm/flask/flask_op.c                     |   9 +
 xen/xsm/flask/hooks.c                        | 422 +++++++++++++--------------
 xen/xsm/flask/include/objsec.h               |   2 +
 6 files changed, 307 insertions(+), 242 deletions(-)

diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index 0778a28..ff81b01 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -68,9 +68,43 @@ HVM domains with stubdomain device models use two types (one per domain):
  - dm_dom_t is the device model for a domain with type domHVM_t
 
 One disadvantage of using type enforcement to enforce isolation is that a new
-type is needed for each group of domains. In addition, it is not possible to
-allow isolated_domU_t cannot to create loopback event channels without allowing
-two domains of type isolated_domU_t to communicate with one another.
+type is needed for each group of domains. The user field can be used to address
+this for the most common case of groups that can communicate internally but not
+externally; see "Users and roles" below.
+
+Type transitions
+----------------
+
+Xen defines a number of operations such as memory mapping that are necessary for
+a domain to perform on itself, but are also undesirable to allow a domain to
+perform on every other domain of the same label. While it is possible to address
+this by only creating one domain per type, this solution significantly limits
+the flexibility of the type system. Another method to address this issue is to
+duplicate the permission names for every operation that can be performed on the
+current domain or on other domains; however, this significantly increases the
+necessary number of permissions and complicates the XSM hooks. Instead, this is
+addressed by allowing a distinct type to be used for a domain's access to
+itself. The same applies for a device model domain's access to its designated
+target, allowing the IS_PRIV_FOR checks used in Xen's DAC model to be
+implemented in FLASK.
+
+Upon domain creation (or relabel), a type transition is computed using the
+domain's label as the source and target. The result of this computation is used
+as the target when the domain accesses itself. In the example policy, this
+computed type is the result of appending _self to a domain's type: domU_t_self
+for domU_t. If no type transition rule exists, the domain will continue to use
+its own label for both the source and target. An AVC message will look like:
+
+    scontext=system_u:system_r:domU_t tcontext=system_u:system_r:domU_t_self
+
+A similar type transition is done when a device model domain is associated with
+its target using the set_target operation. The transition is computed with the
+target domain as the source and the device model domain as the target: this
+ordering was chosen in order to preserve the original label for the target when
+no type transition rule exists. In the example policy, these computed types are
+the result of appending _target to the domain.
+
+Type transitions are also used to compute the labels of event channels.
 
 Users and roles
 ---------------
@@ -84,7 +118,8 @@ the customer_1 user.
 Access control rules involving users and roles are defined in the policy
 constraints file (tools/flask/policy/policy/constraints). The example policy
 provides constraints that prevent different users from communicating using
-grants or event channels, while still allowing communication with dom0.
+grants or event channels, while still allowing communication with the system_u
+user where dom0 resides.
 
 Resource Policy
 ---------------
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 59ba171..d630f47 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -5,15 +5,34 @@
 # Domain creation and setup
 #
 ################################################################################
+define(`declare_domain_common', `
+	allow $1 $2:grant { query setup };
+	allow $1 $2:mmu { adjust physmap map_read map_write stat pinpage updatemp };
+	allow $1 $2:hvm { getparam setparam };
+')
+
 # declare_domain(type, attrs...)
-#   Declare a type as a domain type, and allow basic domain setup
+#   Declare a domain type, along with associated _self and _channel types
+#   Allow the domain to perform basic operations on itself
 define(`declare_domain', `
 	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
+	type $1_self, domain_type, domain_self_type;
+	type_transition $1 $1:domain $1_self;
+	type $1_channel, event_type;
+	type_transition $1 domain_type:event $1_channel;
+	declare_domain_common($1, $1_self)
+')
+
+# declare_singleton_domain(type, attrs...)
+#   Declare a domain type and associated _channel types.
+#   Note: Because the domain can perform basic operations on itself and any
+#   other domain of the same type, this constructor should be used for types
+#   containing at most one domain. This is not enforced by policy.
+define(`declare_singleton_domain', `
+	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
 	type $1_channel, event_type;
 	type_transition $1 domain_type:event $1_channel;
-	allow $1 $1:grant { query setup };
-	allow $1 $1:mmu { adjust physmap map_read map_write stat pinpage };
-	allow $1 $1:hvm { getparam setparam };
+	declare_domain_common($1, $1)
 ')
 
 # declare_build_label(type)
@@ -51,6 +70,7 @@ define(`create_domain_build_label', `
 	allow $1 $2_channel:event create;
 	allow $1 $2_building:domain2 relabelfrom;
 	allow $1 $2:domain2 relabelto;
+	allow $2_building $2:domain transition;
 ')
 
 # manage_domain(priv, target)
@@ -101,20 +121,36 @@ define(`domain_comms', `
 ')
 
 # domain_self_comms(domain)
-#   Allow a domain types to communicate with others of its type using grants
-#   and event channels (this includes event channels to DOMID_SELF)
+#   Allow a non-singleton domain type to communicate with itself using grants
+#   and event channels
 define(`domain_self_comms', `
-	create_channel($1, $1, $1_channel)
-	allow $1 $1:grant { map_read map_write copy unmap };
+	create_channel($1, $1_self, $1_channel)
+	allow $1 $1_self:grant { map_read map_write copy unmap };
 ')
 
 # device_model(dm_dom, hvm_dom)
 #   Define how a device model domain interacts with its target
 define(`device_model', `
-	domain_comms($1, $2)
-	allow $1 $2:domain { set_target shutdown };
-	allow $1 $2:mmu { map_read map_write adjust physmap };
-	allow $1 $2:hvm { getparam setparam trackdirtyvram hvmctl irqlevel pciroute cacheattr send_irq };
+	type $2_target, domain_type, domain_target_type;
+	type_transition $2 $1:domain $2_target;
+	allow $1 $2:domain set_target;
+
+	type_transition $2_target domain_type:event $2_channel;
+	create_channel($1, $2_target, $1_channel)
+	create_channel($2, $1, $2_channel)
+	allow $1 $2_channel:event create;
+
+	allow $1 $2_target:domain shutdown;
+	allow $1 $2_target:mmu { map_read map_write adjust physmap };
+	allow $1 $2_target:hvm { getparam setparam trackdirtyvram hvmctl irqlevel pciroute cacheattr send_irq };
+')
+
+# make_device_model(priv, dm_dom, hvm_dom)
+#   Allow creation of a device model and HVM domain pair
+define(`make_device_model', `
+	device_model($2, $3)
+	allow $1 $2:domain2 make_priv_for;
+	allow $1 $3:domain2 set_as_target;
 ')
 ################################################################################
 #
diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
index 1162153..8d33285 100644
--- a/tools/flask/policy/policy/modules/xen/xen.te
+++ b/tools/flask/policy/policy/modules/xen/xen.te
@@ -8,6 +8,8 @@
 ################################################################################
 attribute xen_type;
 attribute domain_type;
+attribute domain_self_type;
+attribute domain_target_type;
 attribute resource_type;
 attribute event_type;
 attribute mls_priv;
@@ -25,7 +27,7 @@ attribute mls_priv;
 type xen_t, xen_type, mls_priv;
 
 # Domain 0
-declare_domain(dom0_t, mls_priv);
+declare_singleton_domain(dom0_t, mls_priv);
 
 # Untracked I/O memory (pseudo-domain)
 type domio_t, xen_type;
@@ -69,7 +71,7 @@ admin_device(dom0_t, ioport_t)
 admin_device(dom0_t, iomem_t)
 allow dom0_t domio_t:mmu { map_read map_write };
 
-domain_self_comms(dom0_t)
+domain_comms(dom0_t, dom0_t)
 
 auditallow dom0_t security_t:security { load_policy setenforce setbool };
 
@@ -84,11 +86,14 @@ domain_self_comms(domU_t)
 create_domain(dom0_t, domU_t)
 manage_domain(dom0_t, domU_t)
 domain_comms(dom0_t, domU_t)
+domain_comms(domU_t, domU_t)
+domain_self_comms(domU_t)
 
 declare_domain(isolated_domU_t)
 create_domain(dom0_t, isolated_domU_t)
 manage_domain(dom0_t, isolated_domU_t)
 domain_comms(dom0_t, isolated_domU_t)
+domain_self_comms(isolated_domU_t)
 
 # Declare a boolean that denies creation of prot_domU_t domains
 gen_bool(prot_doms_locked, false)
@@ -98,6 +103,8 @@ if (!prot_doms_locked) {
 }
 domain_comms(dom0_t, prot_domU_t)
 domain_comms(domU_t, prot_domU_t)
+domain_comms(prot_domU_t, prot_domU_t)
+domain_self_comms(prot_domU_t)
 
 # domHVM_t is meant to be paired with a qemu-dm stub domain of type dm_dom_t
 declare_domain(domHVM_t)
@@ -110,7 +117,7 @@ declare_domain(dm_dom_t)
 create_domain(dom0_t, dm_dom_t)
 manage_domain(dom0_t, dm_dom_t)
 domain_comms(dom0_t, dm_dom_t)
-device_model(dm_dom_t, domHVM_t)
+make_device_model(dom0_t, dm_dom_t, domHVM_t)
 
 # nomigrate_t must be built via the nomigrate_t_building label; once built,
 # dom0 cannot read its memory.
diff --git a/xen/xsm/flask/flask_op.c b/xen/xsm/flask/flask_op.c
index a5d7748..4426ab9 100644
--- a/xen/xsm/flask/flask_op.c
+++ b/xen/xsm/flask/flask_op.c
@@ -612,6 +612,15 @@ static int flask_relabel_domain(struct xen_flask_relabel *arg)
         goto out;
 
     dsec->sid = arg->sid;
+    dsec->self_sid = arg->sid;
+    security_transition_sid(dsec->sid, dsec->sid, SECCLASS_DOMAIN,
+                            &dsec->self_sid);
+    if ( d->target )
+    {
+        struct domain_security_struct *tsec = d->target->ssid;
+        security_transition_sid(tsec->sid, dsec->sid, SECCLASS_DOMAIN,
+                                &dsec->target_sid);
+    }
 
  out:
     rcu_unlock_domain(d);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index dbbf34f..a8475ea 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -33,38 +33,69 @@
 
 struct xsm_operations *original_ops = NULL;
 
+static u32 domain_sid(struct domain *dom)
+{
+    struct domain_security_struct *dsec = dom->ssid;
+    return dsec->sid;
+}
+
+static u32 domain_target_sid(struct domain *src, struct domain *dst)
+{
+    struct domain_security_struct *ssec = src->ssid;
+    struct domain_security_struct *dsec = dst->ssid;
+    if (src == dst)
+        return ssec->self_sid;
+    if (src->target == dst)
+        return ssec->target_sid;
+    return dsec->sid;
+}
+
+static u32 evtchn_sid(const struct evtchn *chn)
+{
+    struct evtchn_security_struct *esec = chn->ssid;
+    return esec->sid;
+}
+
 static int domain_has_perm(struct domain *dom1, struct domain *dom2, 
                            u16 class, u32 perms)
 {
-    struct domain_security_struct *dsec1, *dsec2;
+    u32 ssid, tsid;
     struct avc_audit_data ad;
     AVC_AUDIT_DATA_INIT(&ad, NONE);
     ad.sdom = dom1;
     ad.tdom = dom2;
 
-    dsec1 = dom1->ssid;
-    dsec2 = dom2->ssid;
+    ssid = domain_sid(dom1);
+    tsid = domain_target_sid(dom1, dom2);
 
-    return avc_has_perm(dsec1->sid, dsec2->sid, class, perms, &ad);
+    return avc_has_perm(ssid, tsid, class, perms, &ad);
 }
 
-static int domain_has_evtchn(struct domain *d, struct evtchn *chn, u32 perms)
+static int avc_current_has_perm(u32 tsid, u16 class, u32 perm,
+                                struct avc_audit_data *ad)
 {
-    struct domain_security_struct *dsec;
-    struct evtchn_security_struct *esec;
+    u32 csid = domain_sid(current->domain);
+    return avc_has_perm(csid, tsid, class, perm, ad);
+}
 
-    dsec = d->ssid;
-    esec = chn->ssid;
+static int current_has_perm(struct domain *d, u16 class, u32 perms)
+{
+    return domain_has_perm(current->domain, d, class, perms);
+}
 
-    return avc_has_perm(dsec->sid, esec->sid, SECCLASS_EVENT, perms, NULL);
+static int domain_has_evtchn(struct domain *d, struct evtchn *chn, u32 perms)
+{
+    u32 dsid = domain_sid(d);
+    u32 esid = evtchn_sid(chn);
+
+    return avc_has_perm(dsid, esid, SECCLASS_EVENT, perms, NULL);
 }
 
 static int domain_has_xen(struct domain *d, u32 perms)
 {
-    struct domain_security_struct *dsec;
-    dsec = d->ssid;
+    u32 dsid = domain_sid(d);
 
-    return avc_has_perm(dsec->sid, SECINITSID_XEN, SECCLASS_XEN, perms, NULL);
+    return avc_has_perm(dsid, SECINITSID_XEN, SECCLASS_XEN, perms, NULL);
 }
 
 static int get_irq_sid(int irq, u32 *sid, struct avc_audit_data *ad)
@@ -123,6 +154,7 @@ static int flask_domain_alloc_security(struct domain *d)
         dsec->sid = SECINITSID_UNLABELED;
     }
 
+    dsec->self_sid = dsec->sid;
     d->ssid = dsec;
 
     return 0;
@@ -142,68 +174,55 @@ static void flask_domain_free_security(struct domain *d)
 static int flask_evtchn_unbound(struct domain *d1, struct evtchn *chn, 
                                 domid_t id2)
 {
-    u32 newsid;
+    u32 sid1, sid2, newsid;
     int rc;
-    domid_t id;
     struct domain *d2;
-    struct domain_security_struct *dsec, *dsec1, *dsec2;
     struct evtchn_security_struct *esec;
 
-    dsec = current->domain->ssid;
-    dsec1 = d1->ssid;
-    esec = chn->ssid;
-
-    if ( id2 == DOMID_SELF )
-        id = current->domain->domain_id;
-    else
-        id = id2;
-
-    d2 = get_domain_by_id(id);
+    d2 = rcu_lock_domain_by_any_id(id2);
     if ( d2 == NULL )
         return -EPERM;
 
-    dsec2 = d2->ssid;
-    rc = security_transition_sid(dsec1->sid, dsec2->sid, SECCLASS_EVENT, 
-                                 &newsid);
+    sid1 = domain_sid(d1);
+    sid2 = domain_target_sid(d1, d2);
+    esec = chn->ssid;
+
+    rc = security_transition_sid(sid1, sid2, SECCLASS_EVENT, &newsid);
     if ( rc )
         goto out;
 
-    rc = avc_has_perm(dsec->sid, newsid, SECCLASS_EVENT, EVENT__CREATE, NULL);
+    rc = avc_current_has_perm(newsid, SECCLASS_EVENT, EVENT__CREATE, NULL);
     if ( rc )
         goto out;
 
-    rc = avc_has_perm(newsid, dsec2->sid, SECCLASS_EVENT, EVENT__BIND, NULL);
+    rc = avc_has_perm(newsid, sid2, SECCLASS_EVENT, EVENT__BIND, NULL);
     if ( rc )
         goto out;
-    else
-        esec->sid = newsid;
+
+    esec->sid = newsid;
 
  out:
-    put_domain(d2);
+    rcu_unlock_domain(d2);
     return rc;
 }
 
 static int flask_evtchn_interdomain(struct domain *d1, struct evtchn *chn1, 
                                     struct domain *d2, struct evtchn *chn2)
 {
-    u32 newsid;
+    u32 sid1, sid2, newsid, reverse_sid;
     int rc;
-    struct domain_security_struct *dsec, *dsec1, *dsec2;
-    struct evtchn_security_struct *esec1, *esec2;
+    struct evtchn_security_struct *esec1;
     struct avc_audit_data ad;
     AVC_AUDIT_DATA_INIT(&ad, NONE);
     ad.sdom = d1;
     ad.tdom = d2;
 
-    dsec = current->domain->ssid;
-    dsec1 = d1->ssid;
-    dsec2 = d2->ssid;
+    sid1 = domain_sid(d1);
+    sid2 = domain_target_sid(d1, d2);
 
     esec1 = chn1->ssid;
-    esec2 = chn2->ssid;
 
-    rc = security_transition_sid(dsec1->sid, dsec2->sid, 
-                                 SECCLASS_EVENT, &newsid);
+    rc = security_transition_sid(sid1, sid2, SECCLASS_EVENT, &newsid);
     if ( rc )
     {
         printk("%s: security_transition_sid failed, rc=%d (domain=%d)\n",
@@ -211,15 +230,20 @@ static int flask_evtchn_interdomain(struct domain *d1, struct evtchn *chn1,
         return rc;
     }
 
-    rc = avc_has_perm(dsec->sid, newsid, SECCLASS_EVENT, EVENT__CREATE, &ad);
+    rc = avc_current_has_perm(newsid, SECCLASS_EVENT, EVENT__CREATE, &ad);
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(newsid, dsec2->sid, SECCLASS_EVENT, EVENT__BIND, &ad);
+    rc = avc_has_perm(newsid, sid2, SECCLASS_EVENT, EVENT__BIND, &ad);
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(esec2->sid, dsec1->sid, SECCLASS_EVENT, EVENT__BIND, &ad);
+    /* It's possible the target domain has changed (relabel or destroy/create)
+     * since the unbound part was created; re-validate this binding now.
+     */
+    reverse_sid = evtchn_sid(chn2);
+    sid1 = domain_target_sid(d2, d1);
+    rc = avc_has_perm(reverse_sid, sid1, SECCLASS_EVENT, EVENT__BIND, &ad);
     if ( rc )
         return rc;
 
@@ -302,7 +326,6 @@ static void flask_free_security_evtchn(struct evtchn *chn)
 
 static char *flask_show_security_evtchn(struct domain *d, const struct evtchn *chn)
 {
-    struct evtchn_security_struct *esec;
     int irq;
     u32 sid = 0;
     char *ctx;
@@ -312,9 +335,7 @@ static char *flask_show_security_evtchn(struct domain *d, const struct evtchn *c
     {
     case ECS_UNBOUND:
     case ECS_INTERDOMAIN:
-        esec = chn->ssid;
-        if ( esec )
-            sid = esec->sid;
+        sid = evtchn_sid(chn);
         break;
     case ECS_PIRQ:
         irq = domain_pirq_to_irq(d, chn->u.pirq.irq);
@@ -367,12 +388,12 @@ static int flask_grant_query_size(struct domain *d1, struct domain *d2)
 
 static int flask_get_pod_target(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__GETPODTARGET);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETPODTARGET);
 }
 
 static int flask_set_pod_target(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SETPODTARGET);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETPODTARGET);
 }
 
 static int flask_memory_adjust_reservation(struct domain *d1, struct domain *d2)
@@ -455,70 +476,65 @@ static int flask_schedop_shutdown(struct domain *d1, struct domain *d2)
 static void flask_security_domaininfo(struct domain *d, 
                                       struct xen_domctl_getdomaininfo *info)
 {
-    struct domain_security_struct *dsec;
-
-    dsec = d->ssid;
-    info->ssidref = dsec->sid;
+    info->ssidref = domain_sid(d);
 }
 
 static int flask_setvcpucontext(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__SETVCPUCONTEXT);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT);
 }
 
 static int flask_pausedomain(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
 }
 
 static int flask_unpausedomain(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
 }
 
 static int flask_resumedomain(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__RESUME);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__RESUME);
 }
 
 static int flask_domain_create(struct domain *d, u32 ssidref)
 {
     int rc;
-    struct domain_security_struct *dsec1;
-    struct domain_security_struct *dsec2;
+    struct domain_security_struct *dsec = d->ssid;
     static int dom0_created = 0;
 
-    dsec1 = current->domain->ssid;
-    dsec2 = d->ssid;
-
     if ( is_idle_domain(current->domain) && !dom0_created )
     {
-        dsec2->sid = SECINITSID_DOM0;
+        dsec->sid = SECINITSID_DOM0;
         dom0_created = 1;
-        return 0;
     }
+    else
+    {
+        rc = avc_current_has_perm(ssidref, SECCLASS_DOMAIN,
+                          DOMAIN__CREATE, NULL);
+        if ( rc )
+            return rc;
 
-    rc = avc_has_perm(dsec1->sid, ssidref, SECCLASS_DOMAIN,
-                      DOMAIN__CREATE, NULL);
-    if ( rc )
-        return rc;
+        dsec->sid = ssidref;
+    }
+    dsec->self_sid = dsec->sid;
 
-    dsec2->sid = ssidref;
+    rc = security_transition_sid(dsec->sid, dsec->sid, SECCLASS_DOMAIN,
+                                 &dsec->self_sid);
 
     return rc;
 }
 
 static int flask_max_vcpus(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__MAX_VCPUS);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS);
 }
 
 static int flask_destroydomain(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__DESTROY);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__DESTROY);
 }
 
 static int flask_vcpuaffinity(int cmd, struct domain *d)
@@ -537,7 +553,7 @@ static int flask_vcpuaffinity(int cmd, struct domain *d)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm );
+    return current_has_perm(d, SECCLASS_DOMAIN, perm );
 }
 
 static int flask_scheduler(struct domain *d)
@@ -548,43 +564,51 @@ static int flask_scheduler(struct domain *d)
     if ( rc )
         return rc;
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__SCHEDULER);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SCHEDULER);
 }
 
 static int flask_getdomaininfo(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__GETDOMAININFO);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO);
 }
 
 static int flask_getvcpucontext(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__GETVCPUCONTEXT);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT);
 }
 
 static int flask_getvcpuinfo(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__GETVCPUINFO);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO);
 }
 
 static int flask_domain_settime(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
 }
 
-static int flask_set_target(struct domain *d, struct domain *e)
+static int flask_set_target(struct domain *d, struct domain *t)
 {
     int rc;
-    rc = domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR);
+    struct domain_security_struct *dsec, *tsec;
+    dsec = d->ssid;
+    tsec = t->ssid;
+
+    rc = current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR);
     if ( rc )
         return rc;
-    rc = domain_has_perm(current->domain, e, SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET);
+    rc = current_has_perm(t, SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET);
     if ( rc )
         return rc;
-    return domain_has_perm(d, e, SECCLASS_DOMAIN, DOMAIN__SET_TARGET);
+    /* Use avc_has_perm to avoid resolving target/current SID */
+    rc = avc_has_perm(dsec->sid, tsec->sid, SECCLASS_DOMAIN, DOMAIN__SET_TARGET, NULL);
+    if ( rc )
+        return rc;
+
+    /* (tsec, dsec) defaults the label to tsec, as it should here */
+    rc = security_transition_sid(tsec->sid, dsec->sid, SECCLASS_DOMAIN,
+                                 &dsec->target_sid);
+    return rc;
 }
 
 static int flask_domctl(struct domain *d, int cmd)
@@ -655,26 +679,24 @@ static int flask_domctl(struct domain *d, int cmd)
     case XEN_DOMCTL_gdbsx_pausevcpu:
     case XEN_DOMCTL_gdbsx_unpausevcpu:
     case XEN_DOMCTL_gdbsx_domstatus:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                               DOMAIN__SETDEBUGGING);
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
 
     case XEN_DOMCTL_subscribe:
     case XEN_DOMCTL_disable_migrate:
     case XEN_DOMCTL_suppress_spurious_page_faults:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                               DOMAIN__SET_MISC_INFO);
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO);
 
     case XEN_DOMCTL_set_cpuid:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID);
+        return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID);
 
     case XEN_DOMCTL_gettscinfo:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__GETTSC);
+        return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__GETTSC);
 
     case XEN_DOMCTL_settscinfo:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__SETTSC);
+        return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SETTSC);
 
     case XEN_DOMCTL_audit_p2m:
-        return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__AUDIT_P2M);
+        return current_has_perm(d, SECCLASS_HVM, HVM__AUDIT_P2M);
 
     default:
         printk("flask_domctl: Unknown op %d\n", cmd);
@@ -716,7 +738,7 @@ static int flask_sysctl(int cmd)
 
 static int flask_set_virq_handler(struct domain *d, uint32_t virq)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
 }
 
 static int flask_tbufcontrol(void)
@@ -741,20 +763,17 @@ static int flask_sched_id(void)
 
 static int flask_setdomainmaxmem(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__SETDOMAINMAXMEM);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM);
 }
 
 static int flask_setdomainhandle(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__SETDOMAINHANDLE);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE);
 }
 
 static int flask_setdebugging(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__SETDEBUGGING);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
 }
 
 static int flask_debug_keys(void)
@@ -816,14 +835,12 @@ static char *flask_show_irq_sid (int irq)
 
 static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
 {
-    u32 sid;
+    u32 sid, dsid;
     int rc = -EPERM;
     struct msi_info *msi = data;
-
-    struct domain_security_struct *ssec, *tsec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__ADD);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
 
     if ( rc )
         return rc;
@@ -839,14 +856,13 @@ static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
     if ( rc )
         return rc;
 
-    ssec = current->domain->ssid;
-    tsec = d->ssid;
+    dsid = domain_sid(d);
 
-    rc = avc_has_perm(ssec->sid, sid, SECCLASS_RESOURCE, RESOURCE__ADD_IRQ, &ad);
+    rc = avc_current_has_perm(sid, SECCLASS_RESOURCE, RESOURCE__ADD_IRQ, &ad);
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    rc = avc_has_perm(dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
     return rc;
 }
 
@@ -854,16 +870,12 @@ static int flask_unmap_domain_pirq (struct domain *d, int irq)
 {
     u32 sid;
     int rc = -EPERM;
-
-    struct domain_security_struct *ssec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
     if ( rc )
         return rc;
 
-    ssec = current->domain->ssid;
-
     if ( irq >= nr_irqs_gsi ) {
         /* TODO support for MSI here */
         return 0;
@@ -873,19 +885,19 @@ static int flask_unmap_domain_pirq (struct domain *d, int irq)
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(ssec->sid, sid, SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, &ad);
+    rc = avc_current_has_perm(sid, SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, &ad);
     return rc;
 }
 
 static int flask_irq_permission (struct domain *d, int pirq, uint8_t access)
 {
     /* the PIRQ number is not useful; real IRQ is checked during mapping */
-    return domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
-                           resource_to_perm(access));
+    return current_has_perm(d, SECCLASS_RESOURCE, resource_to_perm(access));
 }
 
 struct iomem_has_perm_data {
-    struct domain_security_struct *ssec, *tsec;
+    u32 ssid;
+    u32 dsid;
     u32 perm;
 };
 
@@ -899,12 +911,12 @@ static int _iomem_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     ad.range.start = start;
     ad.range.end = end;
 
-    rc = avc_has_perm(data->ssec->sid, sid, SECCLASS_RESOURCE, data->perm, &ad);
+    rc = avc_has_perm(data->ssid, sid, SECCLASS_RESOURCE, data->perm, &ad);
 
     if ( rc )
         return rc;
 
-    return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    return avc_has_perm(data->dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
 static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
@@ -912,7 +924,7 @@ static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end
     struct iomem_has_perm_data data;
     int rc;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
+    rc = current_has_perm(d, SECCLASS_RESOURCE,
                          resource_to_perm(access));
     if ( rc )
         return rc;
@@ -922,8 +934,8 @@ static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end
     else
         data.perm = RESOURCE__REMOVE_IOMEM;
 
-    data.ssec = current->domain->ssid;
-    data.tsec = d->ssid;
+    data.ssid = domain_sid(current->domain);
+    data.dsid = domain_sid(d);
 
     return security_iterate_iomem_sids(start, end, _iomem_has_perm, &data);
 }
@@ -935,10 +947,9 @@ static int flask_iomem_mapping(struct domain *d, uint64_t start, uint64_t end, u
 
 static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
-    u32 rsid;
+    u32 dsid, rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
     u32 perm = RESOURCE__USE;
 
     rc = security_device_sid(machine_bdf, &rsid);
@@ -951,33 +962,24 @@ static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, u
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = d->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
+    dsid = domain_sid(d);
+    return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, perm, &ad);
 
 }
 
 static int flask_resource_plug_core(void)
 {
-    struct domain_security_struct *ssec;
-
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__PLUG, NULL);
+    return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__PLUG, NULL);
 }
 
 static int flask_resource_unplug_core(void)
 {
-    struct domain_security_struct *ssec;
-
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__UNPLUG, NULL);
+    return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__UNPLUG, NULL);
 }
 
 static int flask_resource_use_core(void)
 {
-    struct domain_security_struct *ssec;
-
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__USE, NULL);
+    return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__USE, NULL);
 }
 
 static int flask_resource_plug_pci(uint32_t machine_bdf)
@@ -985,7 +987,6 @@ static int flask_resource_plug_pci(uint32_t machine_bdf)
     u32 rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
@@ -993,8 +994,7 @@ static int flask_resource_plug_pci(uint32_t machine_bdf)
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__PLUG, &ad);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__PLUG, &ad);
 }
 
 static int flask_resource_unplug_pci(uint32_t machine_bdf)
@@ -1002,7 +1002,6 @@ static int flask_resource_unplug_pci(uint32_t machine_bdf)
     u32 rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
@@ -1010,8 +1009,7 @@ static int flask_resource_unplug_pci(uint32_t machine_bdf)
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__UNPLUG, &ad);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__UNPLUG, &ad);
 }
 
 static int flask_resource_setup_pci(uint32_t machine_bdf)
@@ -1019,7 +1017,6 @@ static int flask_resource_setup_pci(uint32_t machine_bdf)
     u32 rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
@@ -1027,8 +1024,7 @@ static int flask_resource_setup_pci(uint32_t machine_bdf)
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
 static int flask_resource_setup_gsi(int gsi)
@@ -1036,22 +1032,17 @@ static int flask_resource_setup_gsi(int gsi)
     u32 rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
 
     rc = get_irq_sid(gsi, &rsid, &ad);
     if ( rc )
         return rc;
 
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
 static int flask_resource_setup_misc(void)
 {
-    struct domain_security_struct *ssec;
-
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);
+    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);
 }
 
 static inline int flask_page_offline(uint32_t cmd)
@@ -1114,11 +1105,12 @@ static int flask_shadow_control(struct domain *d, uint32_t op)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_SHADOW, perm);
+    return current_has_perm(d, SECCLASS_SHADOW, perm);
 }
 
 struct ioport_has_perm_data {
-    struct domain_security_struct *ssec, *tsec;
+    u32 ssid;
+    u32 dsid;
     u32 perm;
 };
 
@@ -1132,12 +1124,12 @@ static int _ioport_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     ad.range.start = start;
     ad.range.end = end;
 
-    rc = avc_has_perm(data->ssec->sid, sid, SECCLASS_RESOURCE, data->perm, &ad);
+    rc = avc_has_perm(data->ssid, sid, SECCLASS_RESOURCE, data->perm, &ad);
 
     if ( rc )
         return rc;
 
-    return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    return avc_has_perm(data->dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
 static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
@@ -1145,7 +1137,7 @@ static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t en
     int rc;
     struct ioport_has_perm_data data;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
+    rc = current_has_perm(d, SECCLASS_RESOURCE,
                          resource_to_perm(access));
 
     if ( rc )
@@ -1156,8 +1148,8 @@ static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t en
     else
         data.perm = RESOURCE__REMOVE_IOPORT;
 
-    data.ssec = current->domain->ssid;
-    data.tsec = d->ssid;
+    data.ssid = domain_sid(current->domain);
+    data.dsid = domain_sid(d);
 
     return security_iterate_ioport_sids(start, end, _ioport_has_perm, &data);
 }
@@ -1169,18 +1161,17 @@ static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end,
 
 static int flask_getpageframeinfo(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_MMU, MMU__PAGEINFO);
+    return current_has_perm(d, SECCLASS_MMU, MMU__PAGEINFO);
 }
 
 static int flask_getmemlist(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_MMU, MMU__PAGELIST);
+    return current_has_perm(d, SECCLASS_MMU, MMU__PAGELIST);
 }
 
 static int flask_hypercall_init(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__HYPERCALL);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__HYPERCALL);
 }
 
 static int flask_hvmcontext(struct domain *d, uint32_t cmd)
@@ -1203,7 +1194,7 @@ static int flask_hvmcontext(struct domain *d, uint32_t cmd)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, perm);
+    return current_has_perm(d, SECCLASS_HVM, perm);
 }
 
 static int flask_address_size(struct domain *d, uint32_t cmd)
@@ -1222,7 +1213,7 @@ static int flask_address_size(struct domain *d, uint32_t cmd)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
+    return current_has_perm(d, SECCLASS_DOMAIN, perm);
 }
 
 static int flask_machine_address_size(struct domain *d, uint32_t cmd)
@@ -1263,37 +1254,37 @@ static int flask_hvm_param(struct domain *d, unsigned long op)
         perm = HVM__HVMCTL;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, perm);
+    return current_has_perm(d, SECCLASS_HVM, perm);
 }
 
 static int flask_hvm_set_pci_intx_level(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__PCILEVEL);
+    return current_has_perm(d, SECCLASS_HVM, HVM__PCILEVEL);
 }
 
 static int flask_hvm_set_isa_irq_level(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__IRQLEVEL);
+    return current_has_perm(d, SECCLASS_HVM, HVM__IRQLEVEL);
 }
 
 static int flask_hvm_set_pci_link_route(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__PCIROUTE);
+    return current_has_perm(d, SECCLASS_HVM, HVM__PCIROUTE);
 }
 
 static int flask_hvm_inject_msi(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__SEND_IRQ);
+    return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
 static int flask_mem_event(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__MEM_EVENT);
+    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
 
 static int flask_mem_sharing(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__MEM_SHARING);
+    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
 }
 
 static int flask_apic(struct domain *d, int cmd)
@@ -1355,11 +1346,7 @@ static int flask_physinfo(void)
 
 static int flask_platform_quirk(uint32_t quirk)
 {
-    struct domain_security_struct *dsec;
-    dsec = current->domain->ssid;
-
-    return avc_has_perm(dsec->sid, SECINITSID_XEN, SECCLASS_XEN, 
-                        XEN__QUIRK, NULL);
+    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN, XEN__QUIRK, NULL);
 }
 
 static int flask_platform_op(uint32_t op)
@@ -1421,16 +1408,12 @@ static int flask_getidletime(void)
 
 static int flask_machine_memory_map(void)
 {
-    struct domain_security_struct *dsec;
-    dsec = current->domain->ssid;
-
-    return avc_has_perm(dsec->sid, SECINITSID_XEN, SECCLASS_MMU, 
-                        MMU__MEMORYMAP, NULL);
+    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_MMU, MMU__MEMORYMAP, NULL);
 }
 
 static int flask_domain_memory_map(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_MMU, MMU__MEMORYMAP);
+    return current_has_perm(d, SECCLASS_MMU, MMU__MEMORYMAP);
 }
 
 static int domain_memory_perm(struct domain *d, struct domain *f, l1_pgentry_t pte)
@@ -1453,17 +1436,17 @@ static int domain_memory_perm(struct domain *d, struct domain *f, l1_pgentry_t p
     if ( f->domain_id == DOMID_IO || !mfn_valid(fmfn) )
     {
         struct avc_audit_data ad;
-        struct domain_security_struct *dsec = d->ssid;
-        u32 fsid;
+        u32 dsid, fsid;
+        rc = security_iomem_sid(fmfn, &fsid);
+        if ( rc )
+            return rc;
         AVC_AUDIT_DATA_INIT(&ad, MEMORY);
         ad.sdom = d;
         ad.tdom = f;
         ad.memory.pte = pte.l1;
         ad.memory.mfn = fmfn;
-        rc = security_iomem_sid(fmfn, &fsid);
-        if ( rc )
-            return rc;
-        return avc_has_perm(dsec->sid, fsid, SECCLASS_MMU, map_perms, &ad);
+        dsid = domain_sid(d);
+        return avc_has_perm(dsid, fsid, SECCLASS_MMU, map_perms, &ad);
     }
 
     return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
@@ -1506,43 +1489,40 @@ static int flask_remove_from_physmap(struct domain *d1, struct domain *d2)
 
 static int flask_sendtrigger(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
 }
 
 static int flask_get_device_group(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
-    struct domain_security_struct *ssec = current->domain->ssid;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
         return rc;
 
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
 }
 
 static int flask_test_assign_device(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
-    struct domain_security_struct *ssec = current->domain->ssid;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
         return rc;
 
-    return rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
 }
 
 static int flask_assign_device(struct domain *d, uint32_t machine_bdf)
 {
-    u32 rsid;
+    u32 dsid, rsid;
     int rc = -EPERM;
-    struct domain_security_struct *ssec, *tsec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__ADD);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
     if ( rc )
         return rc;
 
@@ -1552,22 +1532,20 @@ static int flask_assign_device(struct domain *d, uint32_t machine_bdf)
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = current->domain->ssid;
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__ADD_DEVICE, &ad);
+    rc = avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__ADD_DEVICE, &ad);
     if ( rc )
         return rc;
 
-    tsec = d->ssid;
-    return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    dsid = domain_sid(d);
+    return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
 static int flask_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
-    struct domain_security_struct *ssec = current->domain->ssid;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
     if ( rc )
         return rc;
 
@@ -1575,18 +1553,17 @@ static int flask_deassign_device(struct domain *d, uint32_t machine_bdf)
     if ( rc )
         return rc;
 
-    return rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__REMOVE_DEVICE, NULL);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__REMOVE_DEVICE, NULL);
 }
 
 static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
-    u32 rsid;
+    u32 dsid, rsid;
     int rc = -EPERM;
     int irq;
-    struct domain_security_struct *ssec, *tsec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__ADD);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
     if ( rc )
         return rc;
 
@@ -1596,23 +1573,22 @@ static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *b
     if ( rc )
         return rc;
 
-    ssec = current->domain->ssid;
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_HVM, HVM__BIND_IRQ, &ad);
+    rc = avc_current_has_perm(rsid, SECCLASS_HVM, HVM__BIND_IRQ, &ad);
     if ( rc )
         return rc;
 
-    tsec = d->ssid;
-    return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    dsid = domain_sid(d);
+    return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
 static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
+    return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
 
 static int flask_pin_mem_cacheattr (struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__CACHEATTR);
+    return current_has_perm(d, SECCLASS_HVM, HVM__CACHEATTR);
 }
 
 static int flask_ext_vcpucontext (struct domain *d, uint32_t cmd)
@@ -1631,7 +1607,7 @@ static int flask_ext_vcpucontext (struct domain *d, uint32_t cmd)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
+    return current_has_perm(d, SECCLASS_DOMAIN, perm);
 }
 
 static int flask_vcpuextstate (struct domain *d, uint32_t cmd)
@@ -1650,7 +1626,7 @@ static int flask_vcpuextstate (struct domain *d, uint32_t cmd)
             return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
+    return current_has_perm(d, SECCLASS_DOMAIN, perm);
 }
 #endif
 
diff --git a/xen/xsm/flask/include/objsec.h b/xen/xsm/flask/include/objsec.h
index 4ff52be..6595dc3 100644
--- a/xen/xsm/flask/include/objsec.h
+++ b/xen/xsm/flask/include/objsec.h
@@ -19,6 +19,8 @@
 
 struct domain_security_struct {
     u32 sid;               /* current SID */
+    u32 self_sid;          /* SID for target when operating on DOMID_SELF */
+    u32 target_sid;        /* SID for device model target domain */
 };
 
 struct evtchn_security_struct {
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQfC-00078V-4I; Fri, 16 Nov 2012 18:29:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQf1-0006iZ-2Y
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:03 +0000
Received: from [85.158.138.51:9077] by server-14.bemta-3.messagelabs.com id
	13/6B-12788-8E586A05; Fri, 16 Nov 2012 18:28:56 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-174.messagelabs.com!1353090535!23991281!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16721 invoked from network); 16 Nov 2012 18:28:55 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-14.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:55 -0000
X-TM-IMSS-Message-ID: <89252ffa000aa5d1@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 89252ffa000aa5d1 ;
	Fri, 16 Nov 2012 13:28:28 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3e031862; 
	Fri, 16 Nov 2012 13:28:53 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:23 -0500
Message-Id: <1353090514-18537-9-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 08/19] arch/x86: convert platform_hypercall to
	use XSM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The newly introduced xsm_platform_op hook addresses new sub-ops, while
most ops already have their own XSM hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/platform_hypercall.c | 11 ++++++++---
 xen/include/xsm/dummy.h           |  7 +++++++
 xen/include/xsm/xsm.h             |  6 ++++++
 xen/xsm/dummy.c                   |  1 +
 xen/xsm/flask/hooks.c             | 33 +++++++++++++++++++++++++++++++++
 5 files changed, 55 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index a3b5a6b..738bed0 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -66,15 +66,16 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     ret_t ret = 0;
     struct xen_platform_op curop, *op = &curop;
 
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-
     if ( copy_from_guest(op, u_xenpf_op, 1) )
         return -EFAULT;
 
     if ( op->interface_version != XENPF_INTERFACE_VERSION )
         return -EACCES;
 
+    ret = xsm_platform_op(op->cmd);
+    if ( ret )
+        return ret;
+
     /*
      * Trylock here avoids deadlock with an existing platform critical section
      * which might (for some current or future reason) want to synchronise
@@ -511,6 +512,10 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         struct xenpf_pcpu_version *ver = &op->u.pcpu_version;
 
+        ret = xsm_getcpuinfo();
+        if ( ret )
+            break;
+
         if ( !get_cpu_maps() )
         {
             ret = -EBUSY;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 17128f5..b77ab4a 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -574,6 +574,13 @@ static XSM_DEFAULT(int, platform_quirk) (uint32_t quirk)
     return 0;
 }
 
+static XSM_DEFAULT(int, platform_op) (uint32_t op)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_DEFAULT(int, firmware_info) (void)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 5c3065b..a0c97cb 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -158,6 +158,7 @@ struct xsm_operations {
     int (*microcode) (void);
     int (*physinfo) (void);
     int (*platform_quirk) (uint32_t);
+    int (*platform_op) (uint32_t cmd);
     int (*firmware_info) (void);
     int (*efi_call) (void);
     int (*acpi_sleep) (void);
@@ -696,6 +697,11 @@ static inline int xsm_platform_quirk (uint32_t quirk)
     return xsm_ops->platform_quirk(quirk);
 }
 
+static inline int xsm_platform_op (uint32_t op)
+{
+    return xsm_ops->platform_op(op);
+}
+
 static inline int xsm_firmware_info (void)
 {
     return xsm_ops->firmware_info();
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 47192d7..10f9c47 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -142,6 +142,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, microcode);
     set_to_dummy_if_null(ops, physinfo);
     set_to_dummy_if_null(ops, platform_quirk);
+    set_to_dummy_if_null(ops, platform_op);
     set_to_dummy_if_null(ops, firmware_info);
     set_to_dummy_if_null(ops, efi_call);
     set_to_dummy_if_null(ops, acpi_sleep);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index cb8cf96..f9a2596 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1207,6 +1207,38 @@ static int flask_platform_quirk(uint32_t quirk)
                         XEN__QUIRK, NULL);
 }
 
+static int flask_platform_op(uint32_t op)
+{
+    switch ( op )
+    {
+    case XENPF_settime:
+    case XENPF_add_memtype:
+    case XENPF_del_memtype:
+    case XENPF_read_memtype:
+    case XENPF_microcode_update:
+    case XENPF_platform_quirk:
+    case XENPF_firmware_info:
+    case XENPF_efi_runtime_call:
+    case XENPF_enter_acpi_sleep:
+    case XENPF_change_freq:
+    case XENPF_getidletime:
+    case XENPF_set_processor_pminfo:
+    case XENPF_get_cpuinfo:
+    case XENPF_get_cpu_version:
+    case XENPF_cpu_online:
+    case XENPF_cpu_offline:
+    case XENPF_cpu_hotadd:
+    case XENPF_mem_hotadd:
+        /* These operations have their own XSM hooks */
+        return 0;
+    case XENPF_core_parking:
+        return domain_has_xen(current->domain, XEN__PM_OP);
+    default:
+        printk("flask_platform_op: Unknown op %d\n", op);
+        return -EPERM;
+    }
+}
+
 static int flask_firmware_info(void)
 {
     return domain_has_xen(current->domain, XEN__FIRMWARE);
@@ -1577,6 +1609,7 @@ static struct xsm_operations flask_ops = {
     .microcode = flask_microcode,
     .physinfo = flask_physinfo,
     .platform_quirk = flask_platform_quirk,
+    .platform_op = flask_platform_op,
     .firmware_info = flask_firmware_info,
     .efi_call = flask_efi_call,
     .acpi_sleep = flask_acpi_sleep,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQfC-00078V-4I; Fri, 16 Nov 2012 18:29:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQf1-0006iZ-2Y
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:03 +0000
Received: from [85.158.138.51:9077] by server-14.bemta-3.messagelabs.com id
	13/6B-12788-8E586A05; Fri, 16 Nov 2012 18:28:56 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-174.messagelabs.com!1353090535!23991281!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16721 invoked from network); 16 Nov 2012 18:28:55 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-14.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:55 -0000
X-TM-IMSS-Message-ID: <89252ffa000aa5d1@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 89252ffa000aa5d1 ;
	Fri, 16 Nov 2012 13:28:28 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3e031862; 
	Fri, 16 Nov 2012 13:28:53 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:23 -0500
Message-Id: <1353090514-18537-9-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 08/19] arch/x86: convert platform_hypercall to
	use XSM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The newly introduced xsm_platform_op hook addresses new sub-ops, while
most ops already have their own XSM hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/platform_hypercall.c | 11 ++++++++---
 xen/include/xsm/dummy.h           |  7 +++++++
 xen/include/xsm/xsm.h             |  6 ++++++
 xen/xsm/dummy.c                   |  1 +
 xen/xsm/flask/hooks.c             | 33 +++++++++++++++++++++++++++++++++
 5 files changed, 55 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index a3b5a6b..738bed0 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -66,15 +66,16 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     ret_t ret = 0;
     struct xen_platform_op curop, *op = &curop;
 
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-
     if ( copy_from_guest(op, u_xenpf_op, 1) )
         return -EFAULT;
 
     if ( op->interface_version != XENPF_INTERFACE_VERSION )
         return -EACCES;
 
+    ret = xsm_platform_op(op->cmd);
+    if ( ret )
+        return ret;
+
     /*
      * Trylock here avoids deadlock with an existing platform critical section
      * which might (for some current or future reason) want to synchronise
@@ -511,6 +512,10 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         struct xenpf_pcpu_version *ver = &op->u.pcpu_version;
 
+        ret = xsm_getcpuinfo();
+        if ( ret )
+            break;
+
         if ( !get_cpu_maps() )
         {
             ret = -EBUSY;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 17128f5..b77ab4a 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -574,6 +574,13 @@ static XSM_DEFAULT(int, platform_quirk) (uint32_t quirk)
     return 0;
 }
 
+static XSM_DEFAULT(int, platform_op) (uint32_t op)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_DEFAULT(int, firmware_info) (void)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 5c3065b..a0c97cb 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -158,6 +158,7 @@ struct xsm_operations {
     int (*microcode) (void);
     int (*physinfo) (void);
     int (*platform_quirk) (uint32_t);
+    int (*platform_op) (uint32_t cmd);
     int (*firmware_info) (void);
     int (*efi_call) (void);
     int (*acpi_sleep) (void);
@@ -696,6 +697,11 @@ static inline int xsm_platform_quirk (uint32_t quirk)
     return xsm_ops->platform_quirk(quirk);
 }
 
+static inline int xsm_platform_op (uint32_t op)
+{
+    return xsm_ops->platform_op(op);
+}
+
 static inline int xsm_firmware_info (void)
 {
     return xsm_ops->firmware_info();
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 47192d7..10f9c47 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -142,6 +142,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, microcode);
     set_to_dummy_if_null(ops, physinfo);
     set_to_dummy_if_null(ops, platform_quirk);
+    set_to_dummy_if_null(ops, platform_op);
     set_to_dummy_if_null(ops, firmware_info);
     set_to_dummy_if_null(ops, efi_call);
     set_to_dummy_if_null(ops, acpi_sleep);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index cb8cf96..f9a2596 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1207,6 +1207,38 @@ static int flask_platform_quirk(uint32_t quirk)
                         XEN__QUIRK, NULL);
 }
 
+static int flask_platform_op(uint32_t op)
+{
+    switch ( op )
+    {
+    case XENPF_settime:
+    case XENPF_add_memtype:
+    case XENPF_del_memtype:
+    case XENPF_read_memtype:
+    case XENPF_microcode_update:
+    case XENPF_platform_quirk:
+    case XENPF_firmware_info:
+    case XENPF_efi_runtime_call:
+    case XENPF_enter_acpi_sleep:
+    case XENPF_change_freq:
+    case XENPF_getidletime:
+    case XENPF_set_processor_pminfo:
+    case XENPF_get_cpuinfo:
+    case XENPF_get_cpu_version:
+    case XENPF_cpu_online:
+    case XENPF_cpu_offline:
+    case XENPF_cpu_hotadd:
+    case XENPF_mem_hotadd:
+        /* These operations have their own XSM hooks */
+        return 0;
+    case XENPF_core_parking:
+        return domain_has_xen(current->domain, XEN__PM_OP);
+    default:
+        printk("flask_platform_op: Unknown op %d\n", op);
+        return -EPERM;
+    }
+}
+
 static int flask_firmware_info(void)
 {
     return domain_has_xen(current->domain, XEN__FIRMWARE);
@@ -1577,6 +1609,7 @@ static struct xsm_operations flask_ops = {
     .microcode = flask_microcode,
     .physinfo = flask_physinfo,
     .platform_quirk = flask_platform_quirk,
+    .platform_op = flask_platform_op,
     .firmware_info = flask_firmware_info,
     .efi_call = flask_efi_call,
     .acpi_sleep = flask_acpi_sleep,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQfE-0007EA-MS; Fri, 16 Nov 2012 18:29:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQf2-0006n7-Tb
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:05 +0000
Received: from [85.158.138.51:11155] by server-1.bemta-3.messagelabs.com id
	95/9F-12169-BE586A05; Fri, 16 Nov 2012 18:28:59 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-9.tower-174.messagelabs.com!1353090537!30329604!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=2.5 required=7.0 tests=BODY_RANDOM_LONG,LONGWORDS
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15814 invoked from network); 16 Nov 2012 18:28:57 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-9.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:57 -0000
X-TM-IMSS-Message-ID: <89253882000aa5d7@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 89253882000aa5d7 ;
	Fri, 16 Nov 2012 13:28:30 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3i031862; 
	Fri, 16 Nov 2012 13:28:55 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:27 -0500
Message-Id: <1353090514-18537-13-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org
Subject: [Xen-devel] [PATCH 12/19] xsm/flask: add missing hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The FLASK module was missing implementations of some hooks and did not
have access vectors defined for 10 domctls; define these now.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 tools/flask/policy/policy/flask/access_vectors |  5 ++
 tools/flask/policy/policy/modules/xen/xen.if   |  4 +-
 xen/xsm/flask/hooks.c                          | 66 +++++++++++++++++++++-----
 xen/xsm/flask/include/av_perm_to_string.h      |  5 ++
 xen/xsm/flask/include/av_permissions.h         |  5 ++
 5 files changed, 73 insertions(+), 12 deletions(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index 11d02da..ea65e45 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -80,6 +80,9 @@ class domain2
 	relabelself
 	make_priv_for
 	set_as_target
+	set_cpuid
+	gettsc
+	settsc
 }
 
 class hvm
@@ -97,6 +100,8 @@ class hvm
     hvmctl
     mem_event
     mem_sharing
+    audit_p2m
+    send_irq
 }
 
 class event
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 2ad11b2..59ba171 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -29,6 +29,7 @@ define(`create_domain_common', `
 			getdomaininfo hypercall setvcpucontext setextvcpucontext
 			scheduler getvcpuinfo getvcpuextstate getaddrsize
 			getvcpuaffinity setvcpuaffinity };
+	allow $1 $2:domain2 { set_cpuid settsc };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
 	allow $1 $2:mmu {map_read map_write adjust memorymap physmap pinpage};
@@ -67,6 +68,7 @@ define(`migrate_domain_out', `
 	allow $1 $2:hvm { gethvmc getparam irqlevel };
 	allow $1 $2:mmu { stat pageinfo map_read };
 	allow $1 $2:domain { getaddrsize getvcpucontext getextvcpucontext getvcpuextstate pause destroy };
+	allow $1 $2:domain2 gettsc;
 ')
 
 ################################################################################
@@ -112,7 +114,7 @@ define(`device_model', `
 	domain_comms($1, $2)
 	allow $1 $2:domain { set_target shutdown };
 	allow $1 $2:mmu { map_read map_write adjust physmap };
-	allow $1 $2:hvm { getparam setparam trackdirtyvram hvmctl irqlevel pciroute };
+	allow $1 $2:hvm { getparam setparam trackdirtyvram hvmctl irqlevel pciroute cacheattr send_irq };
 ')
 ################################################################################
 #
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index e25dd1c..dbbf34f 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -650,25 +650,32 @@ static int flask_domctl(struct domain *d, int cmd)
 #endif
         return 0;
 
+    case XEN_DOMCTL_debug_op:
+    case XEN_DOMCTL_gdbsx_guestmemio:
+    case XEN_DOMCTL_gdbsx_pausevcpu:
+    case XEN_DOMCTL_gdbsx_unpausevcpu:
+    case XEN_DOMCTL_gdbsx_domstatus:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
+                               DOMAIN__SETDEBUGGING);
+
     case XEN_DOMCTL_subscribe:
     case XEN_DOMCTL_disable_migrate:
+    case XEN_DOMCTL_suppress_spurious_page_faults:
         return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
                                DOMAIN__SET_MISC_INFO);
 
     case XEN_DOMCTL_set_cpuid:
-    case XEN_DOMCTL_suppress_spurious_page_faults:
-    case XEN_DOMCTL_debug_op:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID);
+
     case XEN_DOMCTL_gettscinfo:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__GETTSC);
+
     case XEN_DOMCTL_settscinfo:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__SETTSC);
+
     case XEN_DOMCTL_audit_p2m:
-    case XEN_DOMCTL_gdbsx_guestmemio:
-    case XEN_DOMCTL_gdbsx_pausevcpu:
-    case XEN_DOMCTL_gdbsx_unpausevcpu:
-    case XEN_DOMCTL_gdbsx_domstatus:
-        /* TODO add per-subfunction hooks */
-        if ( !IS_PRIV(current->domain) )
-            return -EPERM;
-        return 0;
+        return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__AUDIT_P2M);
+
     default:
         printk("flask_domctl: Unknown op %d\n", cmd);
         return -EPERM;
@@ -921,6 +928,11 @@ static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end
     return security_iterate_iomem_sids(start, end, _iomem_has_perm, &data);
 }
 
+static int flask_iomem_mapping(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
+{
+    return flask_iomem_permission(d, start, end, access);
+}
+
 static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
     u32 rsid;
@@ -1128,7 +1140,6 @@ static int _ioport_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-
 static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
 {
     int rc;
@@ -1151,6 +1162,11 @@ static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t en
     return security_iterate_ioport_sids(start, end, _ioport_has_perm, &data);
 }
 
+static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
+{
+    return flask_ioport_permission(d, start, end, access);
+}
+
 static int flask_getpageframeinfo(struct domain *d)
 {
     return domain_has_perm(current->domain, d, SECCLASS_MMU, MMU__PAGEINFO);
@@ -1209,6 +1225,25 @@ static int flask_address_size(struct domain *d, uint32_t cmd)
     return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
 }
 
+static int flask_machine_address_size(struct domain *d, uint32_t cmd)
+{
+    u32 perm;
+
+    switch ( cmd )
+    {
+    case XEN_DOMCTL_set_machine_address_size:
+        perm = DOMAIN__SETADDRSIZE;
+        break;
+    case XEN_DOMCTL_get_machine_address_size:
+        perm = DOMAIN__GETADDRSIZE;
+        break;
+    default:
+        return -EPERM;
+    }
+
+    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
+}
+
 static int flask_hvm_param(struct domain *d, unsigned long op)
 {
     u32 perm;
@@ -1246,6 +1281,11 @@ static int flask_hvm_set_pci_link_route(struct domain *d)
     return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__PCIROUTE);
 }
 
+static int flask_hvm_inject_msi(struct domain *d)
+{
+    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__SEND_IRQ);
+}
+
 static int flask_mem_event(struct domain *d)
 {
     return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__MEM_EVENT);
@@ -1689,6 +1729,7 @@ static struct xsm_operations flask_ops = {
     .unmap_domain_pirq = flask_unmap_domain_pirq,
     .irq_permission = flask_irq_permission,
     .iomem_permission = flask_iomem_permission,
+    .iomem_mapping = flask_iomem_mapping,
     .pci_config_permission = flask_pci_config_permission,
 
     .resource_plug_core = flask_resource_plug_core,
@@ -1713,10 +1754,12 @@ static struct xsm_operations flask_ops = {
     .hypercall_init = flask_hypercall_init,
     .hvmcontext = flask_hvmcontext,
     .address_size = flask_address_size,
+    .machine_address_size = flask_machine_address_size,
     .hvm_param = flask_hvm_param,
     .hvm_set_pci_intx_level = flask_hvm_set_pci_intx_level,
     .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
     .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
+    .hvm_inject_msi = flask_hvm_inject_msi,
     .mem_event = flask_mem_event,
     .mem_sharing = flask_mem_sharing,
     .apic = flask_apic,
@@ -1749,6 +1792,7 @@ static struct xsm_operations flask_ops = {
     .ext_vcpucontext = flask_ext_vcpucontext,
     .vcpuextstate = flask_vcpuextstate,
     .ioport_permission = flask_ioport_permission,
+    .ioport_mapping = flask_ioport_mapping,
 #endif
 };
 
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 10f8e80..894910c 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -66,6 +66,9 @@
    S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELSELF, "relabelself")
    S_(SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR, "make_priv_for")
    S_(SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET, "set_as_target")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID, "set_cpuid")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__GETTSC, "gettsc")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__SETTSC, "settsc")
    S_(SECCLASS_HVM, HVM__SETHVMC, "sethvmc")
    S_(SECCLASS_HVM, HVM__GETHVMC, "gethvmc")
    S_(SECCLASS_HVM, HVM__SETPARAM, "setparam")
@@ -79,6 +82,8 @@
    S_(SECCLASS_HVM, HVM__HVMCTL, "hvmctl")
    S_(SECCLASS_HVM, HVM__MEM_EVENT, "mem_event")
    S_(SECCLASS_HVM, HVM__MEM_SHARING, "mem_sharing")
+   S_(SECCLASS_HVM, HVM__AUDIT_P2M, "audit_p2m")
+   S_(SECCLASS_HVM, HVM__SEND_IRQ, "send_irq")
    S_(SECCLASS_EVENT, EVENT__BIND, "bind")
    S_(SECCLASS_EVENT, EVENT__SEND, "send")
    S_(SECCLASS_EVENT, EVENT__STATUS, "status")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index f7cfee1..1bdb515 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -68,6 +68,9 @@
 #define DOMAIN2__RELABELSELF                      0x00000004UL
 #define DOMAIN2__MAKE_PRIV_FOR                    0x00000008UL
 #define DOMAIN2__SET_AS_TARGET                    0x00000010UL
+#define DOMAIN2__SET_CPUID                        0x00000020UL
+#define DOMAIN2__GETTSC                           0x00000040UL
+#define DOMAIN2__SETTSC                           0x00000080UL
 
 #define HVM__SETHVMC                              0x00000001UL
 #define HVM__GETHVMC                              0x00000002UL
@@ -82,6 +85,8 @@
 #define HVM__HVMCTL                               0x00000400UL
 #define HVM__MEM_EVENT                            0x00000800UL
 #define HVM__MEM_SHARING                          0x00001000UL
+#define HVM__AUDIT_P2M                            0x00002000UL
+#define HVM__SEND_IRQ                             0x00004000UL
 
 #define EVENT__BIND                               0x00000001UL
 #define EVENT__SEND                               0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQfE-0007EA-MS; Fri, 16 Nov 2012 18:29:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQf2-0006n7-Tb
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:05 +0000
Received: from [85.158.138.51:11155] by server-1.bemta-3.messagelabs.com id
	95/9F-12169-BE586A05; Fri, 16 Nov 2012 18:28:59 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-9.tower-174.messagelabs.com!1353090537!30329604!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=2.5 required=7.0 tests=BODY_RANDOM_LONG,LONGWORDS
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15814 invoked from network); 16 Nov 2012 18:28:57 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-9.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:57 -0000
X-TM-IMSS-Message-ID: <89253882000aa5d7@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 89253882000aa5d7 ;
	Fri, 16 Nov 2012 13:28:30 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3i031862; 
	Fri, 16 Nov 2012 13:28:55 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:27 -0500
Message-Id: <1353090514-18537-13-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org
Subject: [Xen-devel] [PATCH 12/19] xsm/flask: add missing hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The FLASK module was missing implementations of some hooks and did not
have access vectors defined for 10 domctls; define these now.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 tools/flask/policy/policy/flask/access_vectors |  5 ++
 tools/flask/policy/policy/modules/xen/xen.if   |  4 +-
 xen/xsm/flask/hooks.c                          | 66 +++++++++++++++++++++-----
 xen/xsm/flask/include/av_perm_to_string.h      |  5 ++
 xen/xsm/flask/include/av_permissions.h         |  5 ++
 5 files changed, 73 insertions(+), 12 deletions(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index 11d02da..ea65e45 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -80,6 +80,9 @@ class domain2
 	relabelself
 	make_priv_for
 	set_as_target
+	set_cpuid
+	gettsc
+	settsc
 }
 
 class hvm
@@ -97,6 +100,8 @@ class hvm
     hvmctl
     mem_event
     mem_sharing
+    audit_p2m
+    send_irq
 }
 
 class event
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 2ad11b2..59ba171 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -29,6 +29,7 @@ define(`create_domain_common', `
 			getdomaininfo hypercall setvcpucontext setextvcpucontext
 			scheduler getvcpuinfo getvcpuextstate getaddrsize
 			getvcpuaffinity setvcpuaffinity };
+	allow $1 $2:domain2 { set_cpuid settsc };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
 	allow $1 $2:mmu {map_read map_write adjust memorymap physmap pinpage};
@@ -67,6 +68,7 @@ define(`migrate_domain_out', `
 	allow $1 $2:hvm { gethvmc getparam irqlevel };
 	allow $1 $2:mmu { stat pageinfo map_read };
 	allow $1 $2:domain { getaddrsize getvcpucontext getextvcpucontext getvcpuextstate pause destroy };
+	allow $1 $2:domain2 gettsc;
 ')
 
 ################################################################################
@@ -112,7 +114,7 @@ define(`device_model', `
 	domain_comms($1, $2)
 	allow $1 $2:domain { set_target shutdown };
 	allow $1 $2:mmu { map_read map_write adjust physmap };
-	allow $1 $2:hvm { getparam setparam trackdirtyvram hvmctl irqlevel pciroute };
+	allow $1 $2:hvm { getparam setparam trackdirtyvram hvmctl irqlevel pciroute cacheattr send_irq };
 ')
 ################################################################################
 #
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index e25dd1c..dbbf34f 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -650,25 +650,32 @@ static int flask_domctl(struct domain *d, int cmd)
 #endif
         return 0;
 
+    case XEN_DOMCTL_debug_op:
+    case XEN_DOMCTL_gdbsx_guestmemio:
+    case XEN_DOMCTL_gdbsx_pausevcpu:
+    case XEN_DOMCTL_gdbsx_unpausevcpu:
+    case XEN_DOMCTL_gdbsx_domstatus:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
+                               DOMAIN__SETDEBUGGING);
+
     case XEN_DOMCTL_subscribe:
     case XEN_DOMCTL_disable_migrate:
+    case XEN_DOMCTL_suppress_spurious_page_faults:
         return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
                                DOMAIN__SET_MISC_INFO);
 
     case XEN_DOMCTL_set_cpuid:
-    case XEN_DOMCTL_suppress_spurious_page_faults:
-    case XEN_DOMCTL_debug_op:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID);
+
     case XEN_DOMCTL_gettscinfo:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__GETTSC);
+
     case XEN_DOMCTL_settscinfo:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__SETTSC);
+
     case XEN_DOMCTL_audit_p2m:
-    case XEN_DOMCTL_gdbsx_guestmemio:
-    case XEN_DOMCTL_gdbsx_pausevcpu:
-    case XEN_DOMCTL_gdbsx_unpausevcpu:
-    case XEN_DOMCTL_gdbsx_domstatus:
-        /* TODO add per-subfunction hooks */
-        if ( !IS_PRIV(current->domain) )
-            return -EPERM;
-        return 0;
+        return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__AUDIT_P2M);
+
     default:
         printk("flask_domctl: Unknown op %d\n", cmd);
         return -EPERM;
@@ -921,6 +928,11 @@ static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end
     return security_iterate_iomem_sids(start, end, _iomem_has_perm, &data);
 }
 
+static int flask_iomem_mapping(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
+{
+    return flask_iomem_permission(d, start, end, access);
+}
+
 static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
     u32 rsid;
@@ -1128,7 +1140,6 @@ static int _ioport_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-
 static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
 {
     int rc;
@@ -1151,6 +1162,11 @@ static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t en
     return security_iterate_ioport_sids(start, end, _ioport_has_perm, &data);
 }
 
+static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
+{
+    return flask_ioport_permission(d, start, end, access);
+}
+
 static int flask_getpageframeinfo(struct domain *d)
 {
     return domain_has_perm(current->domain, d, SECCLASS_MMU, MMU__PAGEINFO);
@@ -1209,6 +1225,25 @@ static int flask_address_size(struct domain *d, uint32_t cmd)
     return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
 }
 
+static int flask_machine_address_size(struct domain *d, uint32_t cmd)
+{
+    u32 perm;
+
+    switch ( cmd )
+    {
+    case XEN_DOMCTL_set_machine_address_size:
+        perm = DOMAIN__SETADDRSIZE;
+        break;
+    case XEN_DOMCTL_get_machine_address_size:
+        perm = DOMAIN__GETADDRSIZE;
+        break;
+    default:
+        return -EPERM;
+    }
+
+    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
+}
+
 static int flask_hvm_param(struct domain *d, unsigned long op)
 {
     u32 perm;
@@ -1246,6 +1281,11 @@ static int flask_hvm_set_pci_link_route(struct domain *d)
     return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__PCIROUTE);
 }
 
+static int flask_hvm_inject_msi(struct domain *d)
+{
+    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__SEND_IRQ);
+}
+
 static int flask_mem_event(struct domain *d)
 {
     return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__MEM_EVENT);
@@ -1689,6 +1729,7 @@ static struct xsm_operations flask_ops = {
     .unmap_domain_pirq = flask_unmap_domain_pirq,
     .irq_permission = flask_irq_permission,
     .iomem_permission = flask_iomem_permission,
+    .iomem_mapping = flask_iomem_mapping,
     .pci_config_permission = flask_pci_config_permission,
 
     .resource_plug_core = flask_resource_plug_core,
@@ -1713,10 +1754,12 @@ static struct xsm_operations flask_ops = {
     .hypercall_init = flask_hypercall_init,
     .hvmcontext = flask_hvmcontext,
     .address_size = flask_address_size,
+    .machine_address_size = flask_machine_address_size,
     .hvm_param = flask_hvm_param,
     .hvm_set_pci_intx_level = flask_hvm_set_pci_intx_level,
     .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
     .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
+    .hvm_inject_msi = flask_hvm_inject_msi,
     .mem_event = flask_mem_event,
     .mem_sharing = flask_mem_sharing,
     .apic = flask_apic,
@@ -1749,6 +1792,7 @@ static struct xsm_operations flask_ops = {
     .ext_vcpucontext = flask_ext_vcpucontext,
     .vcpuextstate = flask_vcpuextstate,
     .ioport_permission = flask_ioport_permission,
+    .ioport_mapping = flask_ioport_mapping,
 #endif
 };
 
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 10f8e80..894910c 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -66,6 +66,9 @@
    S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELSELF, "relabelself")
    S_(SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR, "make_priv_for")
    S_(SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET, "set_as_target")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID, "set_cpuid")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__GETTSC, "gettsc")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__SETTSC, "settsc")
    S_(SECCLASS_HVM, HVM__SETHVMC, "sethvmc")
    S_(SECCLASS_HVM, HVM__GETHVMC, "gethvmc")
    S_(SECCLASS_HVM, HVM__SETPARAM, "setparam")
@@ -79,6 +82,8 @@
    S_(SECCLASS_HVM, HVM__HVMCTL, "hvmctl")
    S_(SECCLASS_HVM, HVM__MEM_EVENT, "mem_event")
    S_(SECCLASS_HVM, HVM__MEM_SHARING, "mem_sharing")
+   S_(SECCLASS_HVM, HVM__AUDIT_P2M, "audit_p2m")
+   S_(SECCLASS_HVM, HVM__SEND_IRQ, "send_irq")
    S_(SECCLASS_EVENT, EVENT__BIND, "bind")
    S_(SECCLASS_EVENT, EVENT__SEND, "send")
    S_(SECCLASS_EVENT, EVENT__STATUS, "status")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index f7cfee1..1bdb515 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -68,6 +68,9 @@
 #define DOMAIN2__RELABELSELF                      0x00000004UL
 #define DOMAIN2__MAKE_PRIV_FOR                    0x00000008UL
 #define DOMAIN2__SET_AS_TARGET                    0x00000010UL
+#define DOMAIN2__SET_CPUID                        0x00000020UL
+#define DOMAIN2__GETTSC                           0x00000040UL
+#define DOMAIN2__SETTSC                           0x00000080UL
 
 #define HVM__SETHVMC                              0x00000001UL
 #define HVM__GETHVMC                              0x00000002UL
@@ -82,6 +85,8 @@
 #define HVM__HVMCTL                               0x00000400UL
 #define HVM__MEM_EVENT                            0x00000800UL
 #define HVM__MEM_SHARING                          0x00001000UL
+#define HVM__AUDIT_P2M                            0x00002000UL
+#define HVM__SEND_IRQ                             0x00004000UL
 
 #define EVENT__BIND                               0x00000001UL
 #define EVENT__SEND                               0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQfF-0007Fz-ES; Fri, 16 Nov 2012 18:29:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQf3-0006n7-J6
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:05 +0000
Received: from [85.158.138.51:11281] by server-1.bemta-3.messagelabs.com id
	1C/9F-12169-EE586A05; Fri, 16 Nov 2012 18:29:02 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-3.tower-174.messagelabs.com!1353090539!22256878!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20506 invoked from network); 16 Nov 2012 18:28:59 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-3.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:59 -0000
X-TM-IMSS-Message-ID: <8925409d000aa5d9@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8925409d000aa5d9 ;
	Fri, 16 Nov 2012 13:28:33 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3o031862; 
	Fri, 16 Nov 2012 13:28:57 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:33 -0500
Message-Id: <1353090514-18537-19-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: keir@xen.org, Ian Campbell <ian.campbell@citrix.com>,
	Tim Deegan <tim@xen.org>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Jan Beulich <jbeulich@suse.com>, Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: [Xen-devel] [PATCH 18/19] xen/arch/*: add struct domain parameter
	to arch_do_domctl
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Since the arch-independent do_domctl function now RCU locks the domain
specified by op->domain, pass the struct domain to the arch-specific
domctl function and remove the duplicate per-subfunction locking.

This also removes two get_domain/put_domain call pairs (in
XEN_DOMCTL_assign_device and XEN_DOMCTL_deassign_device), replacing them
with RCU locking.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@citrix.com>
Cc: Tim Deegan <tim@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/domctl.c           |   2 +-
 xen/arch/x86/domctl.c           | 434 +++++++---------------------------------
 xen/common/domctl.c             |   2 +-
 xen/drivers/passthrough/iommu.c |  31 +--
 xen/include/xen/hypercall.h     |   2 +-
 xen/include/xen/iommu.h         |   3 +-
 6 files changed, 76 insertions(+), 398 deletions(-)

diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c
index cf16791..d54a387 100644
--- a/xen/arch/arm/domctl.c
+++ b/xen/arch/arm/domctl.c
@@ -10,7 +10,7 @@
 #include <xen/errno.h>
 #include <public/domctl.h>
 
-long arch_do_domctl(struct xen_domctl *domctl,
+long arch_do_domctl(struct xen_domctl *domctl, struct domain *d,
                     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     return -ENOSYS;
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 34e6223..5e224fc 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -47,7 +47,7 @@ static int gdbsx_guest_mem_io(
 }
 
 long arch_do_domctl(
-    struct xen_domctl *domctl,
+    struct xen_domctl *domctl, struct domain *d,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
@@ -57,23 +57,15 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_shadow_op:
     {
-        struct domain *d;
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = paging_domctl(d,
-                                &domctl->u.shadow_op,
-                                guest_handle_cast(u_domctl, void));
-            rcu_unlock_domain(d);
-            copy_to_guest(u_domctl, domctl, 1);
-        } 
+        ret = paging_domctl(d,
+                            &domctl->u.shadow_op,
+                            guest_handle_cast(u_domctl, void));
+        copy_to_guest(u_domctl, domctl, 1);
     }
     break;
 
     case XEN_DOMCTL_ioport_permission:
     {
-        struct domain *d;
         unsigned int fp = domctl->u.ioport_permission.first_port;
         unsigned int np = domctl->u.ioport_permission.nr_ports;
         int allow = domctl->u.ioport_permission.allow_access;
@@ -82,10 +74,6 @@ long arch_do_domctl(
         if ( (fp + np) > 65536 )
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
-            break;
-
         if ( np == 0 )
             ret = 0;
         else if ( xsm_ioport_permission(d, fp, fp + np - 1, allow) )
@@ -94,8 +82,6 @@ long arch_do_domctl(
             ret = ioports_permit_access(d, fp, fp + np - 1);
         else
             ret = ioports_deny_access(d, fp, fp + np - 1);
-
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -103,23 +89,16 @@ long arch_do_domctl(
     {
         struct page_info *page;
         unsigned long mfn = domctl->u.getpageframeinfo.gmfn;
-        domid_t dom = domctl->domain;
-        struct domain *d;
 
         ret = -EINVAL;
-
-        if ( unlikely(!mfn_valid(mfn)) ||
-             unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
+        if ( unlikely(!mfn_valid(mfn)) )
             break;
 
         page = mfn_to_page(mfn);
 
         ret = xsm_getpageframeinfo(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         if ( likely(get_page(page, d)) )
         {
@@ -149,8 +128,6 @@ long arch_do_domctl(
             put_page(page);
         }
 
-        rcu_unlock_domain(d);
-
         copy_to_guest(u_domctl, domctl, 1);
     }
     break;
@@ -160,27 +137,17 @@ long arch_do_domctl(
         {
             unsigned int n, j;
             unsigned int num = domctl->u.getpageframeinfo3.num;
-            domid_t dom = domctl->domain;
-            struct domain *d;
             struct page_info *page;
             xen_pfn_t *arr;
 
-            ret = -ESRCH;
-            if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-                break;
-
             ret = xsm_getpageframeinfo(d);
             if ( ret )
-            {
-                rcu_unlock_domain(d);
                 break;
-            }
 
             if ( unlikely(num > 1024) ||
                  unlikely(num != domctl->u.getpageframeinfo3.num) )
             {
                 ret = -E2BIG;
-                rcu_unlock_domain(d);
                 break;
             }
 
@@ -188,7 +155,6 @@ long arch_do_domctl(
             if ( !page )
             {
                 ret = -ENOMEM;
-                rcu_unlock_domain(d);
                 break;
             }
             arr = page_to_virt(page);
@@ -254,7 +220,6 @@ long arch_do_domctl(
 
             free_domheap_page(virt_to_page(arr));
 
-            rcu_unlock_domain(d);
             break;
         }
         /* fall thru */
@@ -262,25 +227,15 @@ long arch_do_domctl(
     {
         int n,j;
         int num = domctl->u.getpageframeinfo2.num;
-        domid_t dom = domctl->domain;
-        struct domain *d;
         uint32_t *arr32;
-        ret = -ESRCH;
-
-        if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-            break;
 
         ret = xsm_getpageframeinfo(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         if ( unlikely(num > 1024) )
         {
             ret = -E2BIG;
-            rcu_unlock_domain(d);
             break;
         }
 
@@ -288,7 +243,6 @@ long arch_do_domctl(
         if ( !arr32 )
         {
             ret = -ENOMEM;
-            rcu_unlock_domain(d);
             break;
         }
  
@@ -360,78 +314,58 @@ long arch_do_domctl(
         }
 
         free_xenheap_page(arr32);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_getmemlist:
     {
         int i;
-        struct domain *d = rcu_lock_domain_by_id(domctl->domain);
         unsigned long max_pfns = domctl->u.getmemlist.max_pfns;
         uint64_t mfn;
         struct page_info *page;
 
-        ret = -EINVAL;
-        if ( d != NULL )
-        {
-            ret = xsm_getmemlist(d);
-            if ( ret )
-            {
-                rcu_unlock_domain(d);
-                break;
-            }
+        ret = xsm_getmemlist(d);
+        if ( ret )
+            break;
 
-            spin_lock(&d->page_alloc_lock);
+        if ( unlikely(d->is_dying) ) {
+            ret = -EINVAL;
+            break;
+        }
 
-            if ( unlikely(d->is_dying) ) {
-                spin_unlock(&d->page_alloc_lock);
-                goto getmemlist_out;
-            }
+        spin_lock(&d->page_alloc_lock);
 
-            ret = i = 0;
-            page_list_for_each(page, &d->page_list)
+        ret = i = 0;
+        page_list_for_each(page, &d->page_list)
+        {
+            if ( i >= max_pfns )
+                break;
+            mfn = page_to_mfn(page);
+            if ( copy_to_guest_offset(domctl->u.getmemlist.buffer,
+                                      i, &mfn, 1) )
             {
-                if ( i >= max_pfns )
-                    break;
-                mfn = page_to_mfn(page);
-                if ( copy_to_guest_offset(domctl->u.getmemlist.buffer,
-                                          i, &mfn, 1) )
-                {
-                    ret = -EFAULT;
-                    break;
-                }
-                ++i;
+                ret = -EFAULT;
+                break;
             }
-            
-            spin_unlock(&d->page_alloc_lock);
-
-            domctl->u.getmemlist.num_pfns = i;
-            copy_to_guest(u_domctl, domctl, 1);
-        getmemlist_out:
-            rcu_unlock_domain(d);
+            ++i;
         }
+
+        spin_unlock(&d->page_alloc_lock);
+
+        domctl->u.getmemlist.num_pfns = i;
+        copy_to_guest(u_domctl, domctl, 1);
     }
     break;
 
     case XEN_DOMCTL_hypercall_init:
     {
-        struct domain *d = rcu_lock_domain_by_id(domctl->domain);
         unsigned long gmfn = domctl->u.hypercall_init.gmfn;
         struct page_info *page;
         void *hypercall_page;
 
-        ret = -ESRCH;
-        if ( unlikely(d == NULL) )
-            break;
-
         ret = xsm_hypercall_init(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
 
@@ -440,7 +374,6 @@ long arch_do_domctl(
         {
             if ( page )
                 put_page(page);
-            rcu_unlock_domain(d);
             break;
         }
 
@@ -451,19 +384,12 @@ long arch_do_domctl(
         unmap_domain_page(hypercall_page);
 
         put_page_and_type(page);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_sethvmcontext:
     { 
         struct hvm_domain_context c = { .size = domctl->u.hvmcontext.size };
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
 
         ret = xsm_hvmcontext(d, domctl->cmd);
         if ( ret )
@@ -488,19 +414,12 @@ long arch_do_domctl(
     sethvmcontext_out:
         if ( c.data != NULL )
             xfree(c.data);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gethvmcontext:
     { 
         struct hvm_domain_context c = { 0 };
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
 
         ret = xsm_hvmcontext(d, domctl->cmd);
         if ( ret )
@@ -544,53 +463,33 @@ long arch_do_domctl(
 
         if ( c.data != NULL )
             xfree(c.data);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gethvmcontext_partial:
     { 
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_hvmcontext(d, domctl->cmd);
         if ( ret )
-            goto gethvmcontext_partial_out;
+            break;
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
-            goto gethvmcontext_partial_out;
+            break;
 
         domain_pause(d);
         ret = hvm_save_one(d, domctl->u.hvmcontext_partial.type,
                            domctl->u.hvmcontext_partial.instance,
                            domctl->u.hvmcontext_partial.buffer);
         domain_unpause(d);
-
-    gethvmcontext_partial_out:
-        rcu_unlock_domain(d);
     }
     break;
 
 
     case XEN_DOMCTL_set_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_address_size(d, domctl->cmd);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         switch ( domctl->u.address_size.size )
         {
@@ -604,31 +503,19 @@ long arch_do_domctl(
             ret = (domctl->u.address_size.size == BITS_PER_LONG) ? 0 : -EINVAL;
             break;
         }
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_get_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_address_size(d, domctl->cmd);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domctl->u.address_size.size =
             is_pv_32on64_domain(d) ? 32 : BITS_PER_LONG;
 
         ret = 0;
-        rcu_unlock_domain(d);
 
         if ( copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
@@ -637,76 +524,51 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_machine_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_machine_address_size(d, domctl->cmd);
         if ( ret )
-            goto set_machine_address_size_out;
+            break;
 
         ret = -EBUSY;
         if ( d->tot_pages > 0 )
-            goto set_machine_address_size_out;
+            break;
 
         d->arch.physaddr_bitsize = domctl->u.address_size.size;
 
         ret = 0;
-    set_machine_address_size_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_get_machine_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_machine_address_size(d, domctl->cmd);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domctl->u.address_size.size = d->arch.physaddr_bitsize;
 
         ret = 0;
-        rcu_unlock_domain(d);
 
         if ( copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
-
-
     }
     break;
 
     case XEN_DOMCTL_sendtrigger:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_sendtrigger(d);
         if ( ret )
-            goto sendtrigger_out;
+            break;
 
         ret = -EINVAL;
         if ( domctl->u.sendtrigger.vcpu >= MAX_VIRT_CPUS )
-            goto sendtrigger_out;
+            break;
 
         ret = -ESRCH;
         if ( domctl->u.sendtrigger.vcpu >= d->max_vcpus ||
              (v = d->vcpu[domctl->u.sendtrigger.vcpu]) == NULL )
-            goto sendtrigger_out;
+            break;
 
         switch ( domctl->u.sendtrigger.trigger )
         {
@@ -743,34 +605,27 @@ long arch_do_domctl(
         default:
             ret = -ENOSYS;
         }
-
-    sendtrigger_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_bind_pt_irq:
     {
-        struct domain * d;
         xen_domctl_bind_pt_irq_t * bind;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
         bind = &(domctl->u.bind_pt_irq);
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d) )
-            goto bind_out;
+            break;
 
         ret = xsm_bind_pt_irq(d, bind);
         if ( ret )
-            goto bind_out;
+            break;
 
         ret = -EPERM;
         if ( !IS_PRIV(current->domain) &&
              !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto bind_out;
+            break;
 
         ret = -ESRCH;
         if ( iommu_enabled )
@@ -782,30 +637,23 @@ long arch_do_domctl(
         if ( ret < 0 )
             printk(XENLOG_G_ERR "pt_irq_create_bind failed (%ld) for dom%d\n",
                    ret, d->domain_id);
-
-    bind_out:
-        rcu_unlock_domain(d);
     }
     break;    
 
     case XEN_DOMCTL_unbind_pt_irq:
     {
-        struct domain * d;
         xen_domctl_bind_pt_irq_t * bind;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
         bind = &(domctl->u.bind_pt_irq);
 
         ret = -EPERM;
         if ( !IS_PRIV(current->domain) &&
              !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto unbind_out;
+            break;
 
         ret = xsm_unbind_pt_irq(d, bind);
         if ( ret )
-            goto unbind_out;
+            break;
 
         if ( iommu_enabled )
         {
@@ -816,15 +664,11 @@ long arch_do_domctl(
         if ( ret < 0 )
             printk(XENLOG_G_ERR "pt_irq_destroy_bind failed (%ld) for dom%d\n",
                    ret, d->domain_id);
-
-    unbind_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_memory_mapping:
     {
-        struct domain *d;
         unsigned long gfn = domctl->u.memory_mapping.first_gfn;
         unsigned long mfn = domctl->u.memory_mapping.first_mfn;
         unsigned long nr_mfns = domctl->u.memory_mapping.nr_mfns;
@@ -842,15 +686,9 @@ long arch_do_domctl(
              !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
-            break;
-
         ret = xsm_iomem_mapping(d, mfn, mfn + nr_mfns - 1, add);
-        if ( ret ) {
-            rcu_unlock_domain(d);
+        if ( ret )
             break;
-        }
 
         if ( add )
         {
@@ -897,15 +735,12 @@ long arch_do_domctl(
                        ret, add ? "removing" : "denying", d->domain_id,
                        mfn, mfn + nr_mfns - 1);
         }
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_ioport_mapping:
     {
 #define MAX_IOPORTS    0x10000
-        struct domain *d;
         struct hvm_iommu *hd;
         unsigned int fgp = domctl->u.ioport_mapping.first_gport;
         unsigned int fmp = domctl->u.ioport_mapping.first_mport;
@@ -929,15 +764,9 @@ long arch_do_domctl(
              !ioports_access_permitted(current->domain, fmp, fmp + np - 1) )
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
-            break;
-
         ret = xsm_ioport_mapping(d, fmp, fmp + np - 1, add);
-        if ( ret ) {
-            rcu_unlock_domain(d);
+        if ( ret )
             break;
-        }
 
         hd = domain_hvm_iommu(d);
         if ( add )
@@ -993,30 +822,19 @@ long arch_do_domctl(
                        "ioport_map: error %ld denying dom%d access to [%x,%x]\n",
                        ret, d->domain_id, fmp, fmp + np - 1);
         }
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_pin_mem_cacheattr:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_pin_mem_cacheattr(d);
         if ( ret )
-            goto pin_out;
+            break;
 
         ret = hvm_set_mem_pinned_cacheattr(
             d, domctl->u.pin_mem_cacheattr.start,
             domctl->u.pin_mem_cacheattr.end,
             domctl->u.pin_mem_cacheattr.type);
-
-    pin_out:
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -1024,19 +842,13 @@ long arch_do_domctl(
     case XEN_DOMCTL_get_ext_vcpucontext:
     {
         struct xen_domctl_ext_vcpucontext *evc;
-        struct domain *d;
         struct vcpu *v;
 
         evc = &domctl->u.ext_vcpucontext;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_ext_vcpucontext(d, domctl->cmd);
         if ( ret )
-            goto ext_vcpucontext_out;
+            break;
 
         ret = -ESRCH;
         if ( (evc->vcpu >= d->max_vcpus) ||
@@ -1127,7 +939,6 @@ long arch_do_domctl(
         ret = 0;
 
     ext_vcpucontext_out:
-        rcu_unlock_domain(d);
         if ( (domctl->cmd == XEN_DOMCTL_get_ext_vcpucontext) &&
              copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
@@ -1136,16 +947,10 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_cpuid:
     {
-        struct domain *d;
         xen_domctl_cpuid_t *ctl = &domctl->u.cpuid;
         cpuid_input_t *cpuid = NULL; 
         int i;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         for ( i = 0; i < MAX_CPUID_INPUT; i++ )
         {
             cpuid = &d->arch.cpuids[i];
@@ -1168,21 +973,13 @@ long arch_do_domctl(
             memcpy(cpuid, ctl, sizeof(cpuid_input_t));
             ret = 0;
         }
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gettscinfo:
     {
-        struct domain *d;
         xen_guest_tsc_info_t info;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         domain_pause(d);
         tsc_get_info(d, &info.tsc_mode,
                         &info.elapsed_nsec,
@@ -1193,20 +990,11 @@ long arch_do_domctl(
         else
             ret = 0;
         domain_unpause(d);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_settscinfo:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         domain_pause(d);
         tsc_set_info(d, domctl->u.tsc_info.info.tsc_mode,
                      domctl->u.tsc_info.info.elapsed_nsec,
@@ -1214,138 +1002,83 @@ long arch_do_domctl(
                      domctl->u.tsc_info.info.incarnation);
         domain_unpause(d);
 
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_suppress_spurious_page_faults:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            d->arch.suppress_spurious_page_faults = 1;
-            rcu_unlock_domain(d);
-            ret = 0;
-        }
+        d->arch.suppress_spurious_page_faults = 1;
+        ret = 0;
     }
     break;
 
     case XEN_DOMCTL_debug_op:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = -EINVAL;
         if ( (domctl->u.debug_op.vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[domctl->u.debug_op.vcpu]) == NULL) )
-            goto debug_op_out;
+            break;
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d))
-            goto debug_op_out;
+            break;
 
         ret = hvm_debug_op(v, domctl->u.debug_op.op);
-
-    debug_op_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_guestmemio:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         domctl->u.gdbsx_guest_memio.remain =
             domctl->u.gdbsx_guest_memio.len;
 
         ret = gdbsx_guest_mem_io(domctl->domain, &domctl->u.gdbsx_guest_memio);
         if ( !ret && copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_pausevcpu:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = -EBUSY;
         if ( !d->is_paused_by_controller )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         ret = -EINVAL;
         if ( domctl->u.gdbsx_pauseunp_vcpu.vcpu >= MAX_VIRT_CPUS ||
              (v = d->vcpu[domctl->u.gdbsx_pauseunp_vcpu.vcpu]) == NULL )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         vcpu_pause(v);
         ret = 0;
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_unpausevcpu:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = -EBUSY;
         if ( !d->is_paused_by_controller )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         ret = -EINVAL;
         if ( domctl->u.gdbsx_pauseunp_vcpu.vcpu >= MAX_VIRT_CPUS ||
              (v = d->vcpu[domctl->u.gdbsx_pauseunp_vcpu.vcpu]) == NULL )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         if ( !atomic_read(&v->pause_count) )
             printk("WARN: Unpausing vcpu:%d which is not paused\n", v->vcpu_id);
         vcpu_unpause(v);
         ret = 0;
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_domstatus:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         domctl->u.gdbsx_domstatus.vcpu_id = -1;
         domctl->u.gdbsx_domstatus.paused = d->is_paused_by_controller;
         if ( domctl->u.gdbsx_domstatus.paused )
@@ -1365,7 +1098,6 @@ long arch_do_domctl(
         ret = 0;
         if ( copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -1373,7 +1105,6 @@ long arch_do_domctl(
     case XEN_DOMCTL_getvcpuextstate:
     {
         struct xen_domctl_vcpuextstate *evc;
-        struct domain *d;
         struct vcpu *v;
         uint32_t offset = 0;
         uint64_t _xfeature_mask = 0;
@@ -1384,12 +1115,6 @@ long arch_do_domctl(
 
         evc = &domctl->u.vcpuextstate;
 
-        ret = -ESRCH;
-
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_vcpuextstate(d, domctl->cmd);
         if ( ret )
             goto vcpuextstate_out;
@@ -1488,7 +1213,6 @@ long arch_do_domctl(
         ret = 0;
 
     vcpuextstate_out:
-        rcu_unlock_domain(d);
         if ( (domctl->cmd == XEN_DOMCTL_getvcpuextstate) &&
              copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
@@ -1497,50 +1221,33 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_mem_event_op:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = mem_event_domctl(d, &domctl->u.mem_event_op,
-                                   guest_handle_cast(u_domctl, void));
-            rcu_unlock_domain(d);
-            copy_to_guest(u_domctl, domctl, 1);
-        } 
+        ret = mem_event_domctl(d, &domctl->u.mem_event_op,
+                               guest_handle_cast(u_domctl, void));
+        copy_to_guest(u_domctl, domctl, 1);
     }
     break;
 
     case XEN_DOMCTL_mem_sharing_op:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_mem_sharing(d);
-            if ( !ret )
-                ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
-            rcu_unlock_domain(d);
-        } 
+        ret = xsm_mem_sharing(d);
+        if ( !ret )
+            ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
     }
     break;
 
 #if P2M_AUDIT
     case XEN_DOMCTL_audit_p2m:
     {
-        struct domain *d;
-
-        ret = rcu_lock_remote_domain_by_id(domctl->domain, &d);
-        if ( ret != 0 )
+        if ( d == current->domain )
+        {
+            ret = -EPERM;
             break;
+        }
 
         audit_p2m(d,
                   &domctl->u.audit_p2m.orphans,
                   &domctl->u.audit_p2m.m2p_bad,
                   &domctl->u.audit_p2m.p2m_bad);
-        rcu_unlock_domain(d);
         if ( copy_to_guest(u_domctl, domctl, 1) ) 
             ret = -EFAULT;
     }
@@ -1549,29 +1256,22 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_access_required:
     {
-        struct domain *d;
         struct p2m_domain* p2m;
         
         ret = -EPERM;
-        if ( current->domain->domain_id == domctl->domain )
+        if ( current->domain == d )
             break;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_mem_event_setup(d);
-            if ( !ret ) {
-                p2m = p2m_get_hostp2m(d);
-                p2m->access_required = domctl->u.access_required.access_required;
-            }
-            rcu_unlock_domain(d);
-        } 
+        ret = xsm_mem_event_setup(d);
+        if ( !ret ) {
+            p2m = p2m_get_hostp2m(d);
+            p2m->access_required = domctl->u.access_required.access_required;
+        }
     }
     break;
 
     default:
-        ret = iommu_do_domctl(domctl, u_domctl);
+        ret = iommu_do_domctl(domctl, d, u_domctl);
         break;
     }
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 46bb0e3..2a42a5f 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -861,7 +861,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     break;
 
     default:
-        ret = arch_do_domctl(op, u_domctl);
+        ret = arch_do_domctl(op, d, u_domctl);
         break;
     }
 
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 47408f2..9d13185 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -538,10 +538,9 @@ void iommu_crash_shutdown(void)
 }
 
 int iommu_do_domctl(
-    struct xen_domctl *domctl,
+    struct xen_domctl *domctl, struct domain *d,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
-    struct domain *d;
     u16 seg;
     u8 bus, devfn;
     int ret = 0;
@@ -560,10 +559,6 @@ int iommu_do_domctl(
         if ( ret )
             break;
 
-        ret = -EINVAL;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         seg = domctl->u.get_device_group.machine_sbdf >> 16;
         bus = (domctl->u.get_device_group.machine_sbdf >> 8) & 0xff;
         devfn = domctl->u.get_device_group.machine_sbdf & 0xff;
@@ -584,7 +579,6 @@ int iommu_do_domctl(
         }
         if ( copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -607,20 +601,15 @@ int iommu_do_domctl(
         break;
 
     case XEN_DOMCTL_assign_device:
-        if ( unlikely((d = get_domain_by_id(domctl->domain)) == NULL) ||
-             unlikely(d->is_dying) )
+        if ( unlikely(d->is_dying) )
         {
-            printk(XENLOG_G_ERR
-                   "XEN_DOMCTL_assign_device: get_domain_by_id() failed\n");
             ret = -EINVAL;
-            if ( d )
-                goto assign_device_out;
             break;
         }
 
         ret = xsm_assign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
-            goto assign_device_out;
+            break;
 
         seg = domctl->u.get_device_group.machine_sbdf >> 16;
         bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff;
@@ -634,22 +623,12 @@ int iommu_do_domctl(
                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
                    d->domain_id, ret);
 
-    assign_device_out:
-        put_domain(d);
         break;
 
     case XEN_DOMCTL_deassign_device:
-        if ( unlikely((d = get_domain_by_id(domctl->domain)) == NULL) )
-        {
-            printk(XENLOG_G_ERR
-                   "XEN_DOMCTL_deassign_device: get_domain_by_id() failed\n");
-            ret = -EINVAL;
-            break;
-        }
-
         ret = xsm_deassign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
-            goto deassign_device_out;
+            break;
 
         seg = domctl->u.get_device_group.machine_sbdf >> 16;
         bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff;
@@ -664,8 +643,6 @@ int iommu_do_domctl(
                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
                    d->domain_id, ret);
 
-    deassign_device_out:
-        put_domain(d);
         break;
 
     default:
diff --git a/xen/include/xen/hypercall.h b/xen/include/xen/hypercall.h
index e315523..7c3d719 100644
--- a/xen/include/xen/hypercall.h
+++ b/xen/include/xen/hypercall.h
@@ -37,7 +37,7 @@ do_domctl(
 
 extern long
 arch_do_domctl(
-    struct xen_domctl *domctl,
+    struct xen_domctl *domctl, struct domain *d,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
 
 extern long
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 3026e54..55e5cc9 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -132,7 +132,8 @@ void iommu_crash_shutdown(void);
 void iommu_set_dom0_mapping(struct domain *d);
 void iommu_share_p2m_table(struct domain *d);
 
-int iommu_do_domctl(struct xen_domctl *, XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
+int iommu_do_domctl(struct xen_domctl *, struct domain *d,
+                    XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
 
 void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int page_count);
 void iommu_iotlb_flush_all(struct domain *d);
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQfF-0007Fz-ES; Fri, 16 Nov 2012 18:29:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQf3-0006n7-J6
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:05 +0000
Received: from [85.158.138.51:11281] by server-1.bemta-3.messagelabs.com id
	1C/9F-12169-EE586A05; Fri, 16 Nov 2012 18:29:02 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-3.tower-174.messagelabs.com!1353090539!22256878!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20506 invoked from network); 16 Nov 2012 18:28:59 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-3.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:59 -0000
X-TM-IMSS-Message-ID: <8925409d000aa5d9@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 8925409d000aa5d9 ;
	Fri, 16 Nov 2012 13:28:33 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3o031862; 
	Fri, 16 Nov 2012 13:28:57 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:33 -0500
Message-Id: <1353090514-18537-19-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: keir@xen.org, Ian Campbell <ian.campbell@citrix.com>,
	Tim Deegan <tim@xen.org>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Jan Beulich <jbeulich@suse.com>, Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: [Xen-devel] [PATCH 18/19] xen/arch/*: add struct domain parameter
	to arch_do_domctl
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Since the arch-independent do_domctl function now RCU locks the domain
specified by op->domain, pass the struct domain to the arch-specific
domctl function and remove the duplicate per-subfunction locking.

This also removes two get_domain/put_domain call pairs (in
XEN_DOMCTL_assign_device and XEN_DOMCTL_deassign_device), replacing them
with RCU locking.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@citrix.com>
Cc: Tim Deegan <tim@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/domctl.c           |   2 +-
 xen/arch/x86/domctl.c           | 434 +++++++---------------------------------
 xen/common/domctl.c             |   2 +-
 xen/drivers/passthrough/iommu.c |  31 +--
 xen/include/xen/hypercall.h     |   2 +-
 xen/include/xen/iommu.h         |   3 +-
 6 files changed, 76 insertions(+), 398 deletions(-)

diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c
index cf16791..d54a387 100644
--- a/xen/arch/arm/domctl.c
+++ b/xen/arch/arm/domctl.c
@@ -10,7 +10,7 @@
 #include <xen/errno.h>
 #include <public/domctl.h>
 
-long arch_do_domctl(struct xen_domctl *domctl,
+long arch_do_domctl(struct xen_domctl *domctl, struct domain *d,
                     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     return -ENOSYS;
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 34e6223..5e224fc 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -47,7 +47,7 @@ static int gdbsx_guest_mem_io(
 }
 
 long arch_do_domctl(
-    struct xen_domctl *domctl,
+    struct xen_domctl *domctl, struct domain *d,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
@@ -57,23 +57,15 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_shadow_op:
     {
-        struct domain *d;
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = paging_domctl(d,
-                                &domctl->u.shadow_op,
-                                guest_handle_cast(u_domctl, void));
-            rcu_unlock_domain(d);
-            copy_to_guest(u_domctl, domctl, 1);
-        } 
+        ret = paging_domctl(d,
+                            &domctl->u.shadow_op,
+                            guest_handle_cast(u_domctl, void));
+        copy_to_guest(u_domctl, domctl, 1);
     }
     break;
 
     case XEN_DOMCTL_ioport_permission:
     {
-        struct domain *d;
         unsigned int fp = domctl->u.ioport_permission.first_port;
         unsigned int np = domctl->u.ioport_permission.nr_ports;
         int allow = domctl->u.ioport_permission.allow_access;
@@ -82,10 +74,6 @@ long arch_do_domctl(
         if ( (fp + np) > 65536 )
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
-            break;
-
         if ( np == 0 )
             ret = 0;
         else if ( xsm_ioport_permission(d, fp, fp + np - 1, allow) )
@@ -94,8 +82,6 @@ long arch_do_domctl(
             ret = ioports_permit_access(d, fp, fp + np - 1);
         else
             ret = ioports_deny_access(d, fp, fp + np - 1);
-
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -103,23 +89,16 @@ long arch_do_domctl(
     {
         struct page_info *page;
         unsigned long mfn = domctl->u.getpageframeinfo.gmfn;
-        domid_t dom = domctl->domain;
-        struct domain *d;
 
         ret = -EINVAL;
-
-        if ( unlikely(!mfn_valid(mfn)) ||
-             unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
+        if ( unlikely(!mfn_valid(mfn)) )
             break;
 
         page = mfn_to_page(mfn);
 
         ret = xsm_getpageframeinfo(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         if ( likely(get_page(page, d)) )
         {
@@ -149,8 +128,6 @@ long arch_do_domctl(
             put_page(page);
         }
 
-        rcu_unlock_domain(d);
-
         copy_to_guest(u_domctl, domctl, 1);
     }
     break;
@@ -160,27 +137,17 @@ long arch_do_domctl(
         {
             unsigned int n, j;
             unsigned int num = domctl->u.getpageframeinfo3.num;
-            domid_t dom = domctl->domain;
-            struct domain *d;
             struct page_info *page;
             xen_pfn_t *arr;
 
-            ret = -ESRCH;
-            if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-                break;
-
             ret = xsm_getpageframeinfo(d);
             if ( ret )
-            {
-                rcu_unlock_domain(d);
                 break;
-            }
 
             if ( unlikely(num > 1024) ||
                  unlikely(num != domctl->u.getpageframeinfo3.num) )
             {
                 ret = -E2BIG;
-                rcu_unlock_domain(d);
                 break;
             }
 
@@ -188,7 +155,6 @@ long arch_do_domctl(
             if ( !page )
             {
                 ret = -ENOMEM;
-                rcu_unlock_domain(d);
                 break;
             }
             arr = page_to_virt(page);
@@ -254,7 +220,6 @@ long arch_do_domctl(
 
             free_domheap_page(virt_to_page(arr));
 
-            rcu_unlock_domain(d);
             break;
         }
         /* fall thru */
@@ -262,25 +227,15 @@ long arch_do_domctl(
     {
         int n,j;
         int num = domctl->u.getpageframeinfo2.num;
-        domid_t dom = domctl->domain;
-        struct domain *d;
         uint32_t *arr32;
-        ret = -ESRCH;
-
-        if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-            break;
 
         ret = xsm_getpageframeinfo(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         if ( unlikely(num > 1024) )
         {
             ret = -E2BIG;
-            rcu_unlock_domain(d);
             break;
         }
 
@@ -288,7 +243,6 @@ long arch_do_domctl(
         if ( !arr32 )
         {
             ret = -ENOMEM;
-            rcu_unlock_domain(d);
             break;
         }
  
@@ -360,78 +314,58 @@ long arch_do_domctl(
         }
 
         free_xenheap_page(arr32);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_getmemlist:
     {
         int i;
-        struct domain *d = rcu_lock_domain_by_id(domctl->domain);
         unsigned long max_pfns = domctl->u.getmemlist.max_pfns;
         uint64_t mfn;
         struct page_info *page;
 
-        ret = -EINVAL;
-        if ( d != NULL )
-        {
-            ret = xsm_getmemlist(d);
-            if ( ret )
-            {
-                rcu_unlock_domain(d);
-                break;
-            }
+        ret = xsm_getmemlist(d);
+        if ( ret )
+            break;
 
-            spin_lock(&d->page_alloc_lock);
+        if ( unlikely(d->is_dying) ) {
+            ret = -EINVAL;
+            break;
+        }
 
-            if ( unlikely(d->is_dying) ) {
-                spin_unlock(&d->page_alloc_lock);
-                goto getmemlist_out;
-            }
+        spin_lock(&d->page_alloc_lock);
 
-            ret = i = 0;
-            page_list_for_each(page, &d->page_list)
+        ret = i = 0;
+        page_list_for_each(page, &d->page_list)
+        {
+            if ( i >= max_pfns )
+                break;
+            mfn = page_to_mfn(page);
+            if ( copy_to_guest_offset(domctl->u.getmemlist.buffer,
+                                      i, &mfn, 1) )
             {
-                if ( i >= max_pfns )
-                    break;
-                mfn = page_to_mfn(page);
-                if ( copy_to_guest_offset(domctl->u.getmemlist.buffer,
-                                          i, &mfn, 1) )
-                {
-                    ret = -EFAULT;
-                    break;
-                }
-                ++i;
+                ret = -EFAULT;
+                break;
             }
-            
-            spin_unlock(&d->page_alloc_lock);
-
-            domctl->u.getmemlist.num_pfns = i;
-            copy_to_guest(u_domctl, domctl, 1);
-        getmemlist_out:
-            rcu_unlock_domain(d);
+            ++i;
         }
+
+        spin_unlock(&d->page_alloc_lock);
+
+        domctl->u.getmemlist.num_pfns = i;
+        copy_to_guest(u_domctl, domctl, 1);
     }
     break;
 
     case XEN_DOMCTL_hypercall_init:
     {
-        struct domain *d = rcu_lock_domain_by_id(domctl->domain);
         unsigned long gmfn = domctl->u.hypercall_init.gmfn;
         struct page_info *page;
         void *hypercall_page;
 
-        ret = -ESRCH;
-        if ( unlikely(d == NULL) )
-            break;
-
         ret = xsm_hypercall_init(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
 
@@ -440,7 +374,6 @@ long arch_do_domctl(
         {
             if ( page )
                 put_page(page);
-            rcu_unlock_domain(d);
             break;
         }
 
@@ -451,19 +384,12 @@ long arch_do_domctl(
         unmap_domain_page(hypercall_page);
 
         put_page_and_type(page);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_sethvmcontext:
     { 
         struct hvm_domain_context c = { .size = domctl->u.hvmcontext.size };
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
 
         ret = xsm_hvmcontext(d, domctl->cmd);
         if ( ret )
@@ -488,19 +414,12 @@ long arch_do_domctl(
     sethvmcontext_out:
         if ( c.data != NULL )
             xfree(c.data);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gethvmcontext:
     { 
         struct hvm_domain_context c = { 0 };
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
 
         ret = xsm_hvmcontext(d, domctl->cmd);
         if ( ret )
@@ -544,53 +463,33 @@ long arch_do_domctl(
 
         if ( c.data != NULL )
             xfree(c.data);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gethvmcontext_partial:
     { 
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_hvmcontext(d, domctl->cmd);
         if ( ret )
-            goto gethvmcontext_partial_out;
+            break;
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
-            goto gethvmcontext_partial_out;
+            break;
 
         domain_pause(d);
         ret = hvm_save_one(d, domctl->u.hvmcontext_partial.type,
                            domctl->u.hvmcontext_partial.instance,
                            domctl->u.hvmcontext_partial.buffer);
         domain_unpause(d);
-
-    gethvmcontext_partial_out:
-        rcu_unlock_domain(d);
     }
     break;
 
 
     case XEN_DOMCTL_set_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_address_size(d, domctl->cmd);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         switch ( domctl->u.address_size.size )
         {
@@ -604,31 +503,19 @@ long arch_do_domctl(
             ret = (domctl->u.address_size.size == BITS_PER_LONG) ? 0 : -EINVAL;
             break;
         }
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_get_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_address_size(d, domctl->cmd);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domctl->u.address_size.size =
             is_pv_32on64_domain(d) ? 32 : BITS_PER_LONG;
 
         ret = 0;
-        rcu_unlock_domain(d);
 
         if ( copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
@@ -637,76 +524,51 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_machine_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_machine_address_size(d, domctl->cmd);
         if ( ret )
-            goto set_machine_address_size_out;
+            break;
 
         ret = -EBUSY;
         if ( d->tot_pages > 0 )
-            goto set_machine_address_size_out;
+            break;
 
         d->arch.physaddr_bitsize = domctl->u.address_size.size;
 
         ret = 0;
-    set_machine_address_size_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_get_machine_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_machine_address_size(d, domctl->cmd);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domctl->u.address_size.size = d->arch.physaddr_bitsize;
 
         ret = 0;
-        rcu_unlock_domain(d);
 
         if ( copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
-
-
     }
     break;
 
     case XEN_DOMCTL_sendtrigger:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_sendtrigger(d);
         if ( ret )
-            goto sendtrigger_out;
+            break;
 
         ret = -EINVAL;
         if ( domctl->u.sendtrigger.vcpu >= MAX_VIRT_CPUS )
-            goto sendtrigger_out;
+            break;
 
         ret = -ESRCH;
         if ( domctl->u.sendtrigger.vcpu >= d->max_vcpus ||
              (v = d->vcpu[domctl->u.sendtrigger.vcpu]) == NULL )
-            goto sendtrigger_out;
+            break;
 
         switch ( domctl->u.sendtrigger.trigger )
         {
@@ -743,34 +605,27 @@ long arch_do_domctl(
         default:
             ret = -ENOSYS;
         }
-
-    sendtrigger_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_bind_pt_irq:
     {
-        struct domain * d;
         xen_domctl_bind_pt_irq_t * bind;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
         bind = &(domctl->u.bind_pt_irq);
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d) )
-            goto bind_out;
+            break;
 
         ret = xsm_bind_pt_irq(d, bind);
         if ( ret )
-            goto bind_out;
+            break;
 
         ret = -EPERM;
         if ( !IS_PRIV(current->domain) &&
              !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto bind_out;
+            break;
 
         ret = -ESRCH;
         if ( iommu_enabled )
@@ -782,30 +637,23 @@ long arch_do_domctl(
         if ( ret < 0 )
             printk(XENLOG_G_ERR "pt_irq_create_bind failed (%ld) for dom%d\n",
                    ret, d->domain_id);
-
-    bind_out:
-        rcu_unlock_domain(d);
     }
     break;    
 
     case XEN_DOMCTL_unbind_pt_irq:
     {
-        struct domain * d;
         xen_domctl_bind_pt_irq_t * bind;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
         bind = &(domctl->u.bind_pt_irq);
 
         ret = -EPERM;
         if ( !IS_PRIV(current->domain) &&
              !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto unbind_out;
+            break;
 
         ret = xsm_unbind_pt_irq(d, bind);
         if ( ret )
-            goto unbind_out;
+            break;
 
         if ( iommu_enabled )
         {
@@ -816,15 +664,11 @@ long arch_do_domctl(
         if ( ret < 0 )
             printk(XENLOG_G_ERR "pt_irq_destroy_bind failed (%ld) for dom%d\n",
                    ret, d->domain_id);
-
-    unbind_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_memory_mapping:
     {
-        struct domain *d;
         unsigned long gfn = domctl->u.memory_mapping.first_gfn;
         unsigned long mfn = domctl->u.memory_mapping.first_mfn;
         unsigned long nr_mfns = domctl->u.memory_mapping.nr_mfns;
@@ -842,15 +686,9 @@ long arch_do_domctl(
              !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
-            break;
-
         ret = xsm_iomem_mapping(d, mfn, mfn + nr_mfns - 1, add);
-        if ( ret ) {
-            rcu_unlock_domain(d);
+        if ( ret )
             break;
-        }
 
         if ( add )
         {
@@ -897,15 +735,12 @@ long arch_do_domctl(
                        ret, add ? "removing" : "denying", d->domain_id,
                        mfn, mfn + nr_mfns - 1);
         }
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_ioport_mapping:
     {
 #define MAX_IOPORTS    0x10000
-        struct domain *d;
         struct hvm_iommu *hd;
         unsigned int fgp = domctl->u.ioport_mapping.first_gport;
         unsigned int fmp = domctl->u.ioport_mapping.first_mport;
@@ -929,15 +764,9 @@ long arch_do_domctl(
              !ioports_access_permitted(current->domain, fmp, fmp + np - 1) )
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
-            break;
-
         ret = xsm_ioport_mapping(d, fmp, fmp + np - 1, add);
-        if ( ret ) {
-            rcu_unlock_domain(d);
+        if ( ret )
             break;
-        }
 
         hd = domain_hvm_iommu(d);
         if ( add )
@@ -993,30 +822,19 @@ long arch_do_domctl(
                        "ioport_map: error %ld denying dom%d access to [%x,%x]\n",
                        ret, d->domain_id, fmp, fmp + np - 1);
         }
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_pin_mem_cacheattr:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_pin_mem_cacheattr(d);
         if ( ret )
-            goto pin_out;
+            break;
 
         ret = hvm_set_mem_pinned_cacheattr(
             d, domctl->u.pin_mem_cacheattr.start,
             domctl->u.pin_mem_cacheattr.end,
             domctl->u.pin_mem_cacheattr.type);
-
-    pin_out:
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -1024,19 +842,13 @@ long arch_do_domctl(
     case XEN_DOMCTL_get_ext_vcpucontext:
     {
         struct xen_domctl_ext_vcpucontext *evc;
-        struct domain *d;
         struct vcpu *v;
 
         evc = &domctl->u.ext_vcpucontext;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_ext_vcpucontext(d, domctl->cmd);
         if ( ret )
-            goto ext_vcpucontext_out;
+            break;
 
         ret = -ESRCH;
         if ( (evc->vcpu >= d->max_vcpus) ||
@@ -1127,7 +939,6 @@ long arch_do_domctl(
         ret = 0;
 
     ext_vcpucontext_out:
-        rcu_unlock_domain(d);
         if ( (domctl->cmd == XEN_DOMCTL_get_ext_vcpucontext) &&
              copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
@@ -1136,16 +947,10 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_cpuid:
     {
-        struct domain *d;
         xen_domctl_cpuid_t *ctl = &domctl->u.cpuid;
         cpuid_input_t *cpuid = NULL; 
         int i;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         for ( i = 0; i < MAX_CPUID_INPUT; i++ )
         {
             cpuid = &d->arch.cpuids[i];
@@ -1168,21 +973,13 @@ long arch_do_domctl(
             memcpy(cpuid, ctl, sizeof(cpuid_input_t));
             ret = 0;
         }
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gettscinfo:
     {
-        struct domain *d;
         xen_guest_tsc_info_t info;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         domain_pause(d);
         tsc_get_info(d, &info.tsc_mode,
                         &info.elapsed_nsec,
@@ -1193,20 +990,11 @@ long arch_do_domctl(
         else
             ret = 0;
         domain_unpause(d);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_settscinfo:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         domain_pause(d);
         tsc_set_info(d, domctl->u.tsc_info.info.tsc_mode,
                      domctl->u.tsc_info.info.elapsed_nsec,
@@ -1214,138 +1002,83 @@ long arch_do_domctl(
                      domctl->u.tsc_info.info.incarnation);
         domain_unpause(d);
 
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_suppress_spurious_page_faults:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            d->arch.suppress_spurious_page_faults = 1;
-            rcu_unlock_domain(d);
-            ret = 0;
-        }
+        d->arch.suppress_spurious_page_faults = 1;
+        ret = 0;
     }
     break;
 
     case XEN_DOMCTL_debug_op:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = -EINVAL;
         if ( (domctl->u.debug_op.vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[domctl->u.debug_op.vcpu]) == NULL) )
-            goto debug_op_out;
+            break;
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d))
-            goto debug_op_out;
+            break;
 
         ret = hvm_debug_op(v, domctl->u.debug_op.op);
-
-    debug_op_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_guestmemio:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         domctl->u.gdbsx_guest_memio.remain =
             domctl->u.gdbsx_guest_memio.len;
 
         ret = gdbsx_guest_mem_io(domctl->domain, &domctl->u.gdbsx_guest_memio);
         if ( !ret && copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_pausevcpu:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = -EBUSY;
         if ( !d->is_paused_by_controller )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         ret = -EINVAL;
         if ( domctl->u.gdbsx_pauseunp_vcpu.vcpu >= MAX_VIRT_CPUS ||
              (v = d->vcpu[domctl->u.gdbsx_pauseunp_vcpu.vcpu]) == NULL )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         vcpu_pause(v);
         ret = 0;
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_unpausevcpu:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = -EBUSY;
         if ( !d->is_paused_by_controller )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         ret = -EINVAL;
         if ( domctl->u.gdbsx_pauseunp_vcpu.vcpu >= MAX_VIRT_CPUS ||
              (v = d->vcpu[domctl->u.gdbsx_pauseunp_vcpu.vcpu]) == NULL )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         if ( !atomic_read(&v->pause_count) )
             printk("WARN: Unpausing vcpu:%d which is not paused\n", v->vcpu_id);
         vcpu_unpause(v);
         ret = 0;
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_domstatus:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         domctl->u.gdbsx_domstatus.vcpu_id = -1;
         domctl->u.gdbsx_domstatus.paused = d->is_paused_by_controller;
         if ( domctl->u.gdbsx_domstatus.paused )
@@ -1365,7 +1098,6 @@ long arch_do_domctl(
         ret = 0;
         if ( copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -1373,7 +1105,6 @@ long arch_do_domctl(
     case XEN_DOMCTL_getvcpuextstate:
     {
         struct xen_domctl_vcpuextstate *evc;
-        struct domain *d;
         struct vcpu *v;
         uint32_t offset = 0;
         uint64_t _xfeature_mask = 0;
@@ -1384,12 +1115,6 @@ long arch_do_domctl(
 
         evc = &domctl->u.vcpuextstate;
 
-        ret = -ESRCH;
-
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_vcpuextstate(d, domctl->cmd);
         if ( ret )
             goto vcpuextstate_out;
@@ -1488,7 +1213,6 @@ long arch_do_domctl(
         ret = 0;
 
     vcpuextstate_out:
-        rcu_unlock_domain(d);
         if ( (domctl->cmd == XEN_DOMCTL_getvcpuextstate) &&
              copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
@@ -1497,50 +1221,33 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_mem_event_op:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = mem_event_domctl(d, &domctl->u.mem_event_op,
-                                   guest_handle_cast(u_domctl, void));
-            rcu_unlock_domain(d);
-            copy_to_guest(u_domctl, domctl, 1);
-        } 
+        ret = mem_event_domctl(d, &domctl->u.mem_event_op,
+                               guest_handle_cast(u_domctl, void));
+        copy_to_guest(u_domctl, domctl, 1);
     }
     break;
 
     case XEN_DOMCTL_mem_sharing_op:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_mem_sharing(d);
-            if ( !ret )
-                ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
-            rcu_unlock_domain(d);
-        } 
+        ret = xsm_mem_sharing(d);
+        if ( !ret )
+            ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
     }
     break;
 
 #if P2M_AUDIT
     case XEN_DOMCTL_audit_p2m:
     {
-        struct domain *d;
-
-        ret = rcu_lock_remote_domain_by_id(domctl->domain, &d);
-        if ( ret != 0 )
+        if ( d == current->domain )
+        {
+            ret = -EPERM;
             break;
+        }
 
         audit_p2m(d,
                   &domctl->u.audit_p2m.orphans,
                   &domctl->u.audit_p2m.m2p_bad,
                   &domctl->u.audit_p2m.p2m_bad);
-        rcu_unlock_domain(d);
         if ( copy_to_guest(u_domctl, domctl, 1) ) 
             ret = -EFAULT;
     }
@@ -1549,29 +1256,22 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_access_required:
     {
-        struct domain *d;
         struct p2m_domain* p2m;
         
         ret = -EPERM;
-        if ( current->domain->domain_id == domctl->domain )
+        if ( current->domain == d )
             break;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_mem_event_setup(d);
-            if ( !ret ) {
-                p2m = p2m_get_hostp2m(d);
-                p2m->access_required = domctl->u.access_required.access_required;
-            }
-            rcu_unlock_domain(d);
-        } 
+        ret = xsm_mem_event_setup(d);
+        if ( !ret ) {
+            p2m = p2m_get_hostp2m(d);
+            p2m->access_required = domctl->u.access_required.access_required;
+        }
     }
     break;
 
     default:
-        ret = iommu_do_domctl(domctl, u_domctl);
+        ret = iommu_do_domctl(domctl, d, u_domctl);
         break;
     }
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 46bb0e3..2a42a5f 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -861,7 +861,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     break;
 
     default:
-        ret = arch_do_domctl(op, u_domctl);
+        ret = arch_do_domctl(op, d, u_domctl);
         break;
     }
 
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 47408f2..9d13185 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -538,10 +538,9 @@ void iommu_crash_shutdown(void)
 }
 
 int iommu_do_domctl(
-    struct xen_domctl *domctl,
+    struct xen_domctl *domctl, struct domain *d,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
-    struct domain *d;
     u16 seg;
     u8 bus, devfn;
     int ret = 0;
@@ -560,10 +559,6 @@ int iommu_do_domctl(
         if ( ret )
             break;
 
-        ret = -EINVAL;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         seg = domctl->u.get_device_group.machine_sbdf >> 16;
         bus = (domctl->u.get_device_group.machine_sbdf >> 8) & 0xff;
         devfn = domctl->u.get_device_group.machine_sbdf & 0xff;
@@ -584,7 +579,6 @@ int iommu_do_domctl(
         }
         if ( copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -607,20 +601,15 @@ int iommu_do_domctl(
         break;
 
     case XEN_DOMCTL_assign_device:
-        if ( unlikely((d = get_domain_by_id(domctl->domain)) == NULL) ||
-             unlikely(d->is_dying) )
+        if ( unlikely(d->is_dying) )
         {
-            printk(XENLOG_G_ERR
-                   "XEN_DOMCTL_assign_device: get_domain_by_id() failed\n");
             ret = -EINVAL;
-            if ( d )
-                goto assign_device_out;
             break;
         }
 
         ret = xsm_assign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
-            goto assign_device_out;
+            break;
 
         seg = domctl->u.get_device_group.machine_sbdf >> 16;
         bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff;
@@ -634,22 +623,12 @@ int iommu_do_domctl(
                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
                    d->domain_id, ret);
 
-    assign_device_out:
-        put_domain(d);
         break;
 
     case XEN_DOMCTL_deassign_device:
-        if ( unlikely((d = get_domain_by_id(domctl->domain)) == NULL) )
-        {
-            printk(XENLOG_G_ERR
-                   "XEN_DOMCTL_deassign_device: get_domain_by_id() failed\n");
-            ret = -EINVAL;
-            break;
-        }
-
         ret = xsm_deassign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
-            goto deassign_device_out;
+            break;
 
         seg = domctl->u.get_device_group.machine_sbdf >> 16;
         bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff;
@@ -664,8 +643,6 @@ int iommu_do_domctl(
                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
                    d->domain_id, ret);
 
-    deassign_device_out:
-        put_domain(d);
         break;
 
     default:
diff --git a/xen/include/xen/hypercall.h b/xen/include/xen/hypercall.h
index e315523..7c3d719 100644
--- a/xen/include/xen/hypercall.h
+++ b/xen/include/xen/hypercall.h
@@ -37,7 +37,7 @@ do_domctl(
 
 extern long
 arch_do_domctl(
-    struct xen_domctl *domctl,
+    struct xen_domctl *domctl, struct domain *d,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
 
 extern long
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 3026e54..55e5cc9 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -132,7 +132,8 @@ void iommu_crash_shutdown(void);
 void iommu_set_dom0_mapping(struct domain *d);
 void iommu_share_p2m_table(struct domain *d);
 
-int iommu_do_domctl(struct xen_domctl *, XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
+int iommu_do_domctl(struct xen_domctl *, struct domain *d,
+                    XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
 
 void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int page_count);
 void iommu_iotlb_flush_all(struct domain *d);
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQfG-0007He-BB; Fri, 16 Nov 2012 18:29:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQf4-0006r4-NV
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:07 +0000
Received: from [85.158.138.51:9301] by server-4.bemta-3.messagelabs.com id
	3C/5A-30023-DE586A05; Fri, 16 Nov 2012 18:29:01 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353090539!28435467!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5749 invoked from network); 16 Nov 2012 18:28:59 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-15.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:59 -0000
X-TM-IMSS-Message-ID: <89254178000aa5da@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 89254178000aa5da ;
	Fri, 16 Nov 2012 13:28:33 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3p031862; 
	Fri, 16 Nov 2012 13:28:58 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:34 -0500
Message-Id: <1353090514-18537-20-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org
Subject: [Xen-devel] [PATCH 19/19] flask: move policy headers into hypervisor
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Rather than keeping around headers that are autogenerated in order to
avoid adding build dependencies from xen/ to files in tools/, move the
relevant parts of the FLASK policy into the hypervisor tree and generate
the headers as part of the hypervisor's build.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 .gitignore                                         |   5 +
 .hgignore                                          |   5 +
 tools/flask/policy/Makefile                        |   2 +-
 tools/flask/policy/policy/flask/Makefile           |  41 ------
 xen/xsm/flask/Makefile                             |  25 ++++
 xen/xsm/flask/include/av_perm_to_string.h          | 147 -------------------
 xen/xsm/flask/include/av_permissions.h             | 157 ---------------------
 xen/xsm/flask/include/class_to_string.h            |  15 --
 xen/xsm/flask/include/flask.h                      |  35 -----
 xen/xsm/flask/include/initial_sid_to_string.h      |  16 ---
 .../flask => xen/xsm/flask/policy}/access_vectors  |   0
 .../flask => xen/xsm/flask/policy}/initial_sids    |   0
 .../xsm/flask/policy}/mkaccess_vector.sh           |   4 +-
 .../flask => xen/xsm/flask/policy}/mkflask.sh      |   6 +-
 .../xsm/flask/policy}/security_classes             |   0
 15 files changed, 41 insertions(+), 417 deletions(-)
 delete mode 100644 tools/flask/policy/policy/flask/Makefile
 delete mode 100644 xen/xsm/flask/include/av_perm_to_string.h
 delete mode 100644 xen/xsm/flask/include/av_permissions.h
 delete mode 100644 xen/xsm/flask/include/class_to_string.h
 delete mode 100644 xen/xsm/flask/include/flask.h
 delete mode 100644 xen/xsm/flask/include/initial_sid_to_string.h
 rename {tools/flask/policy/policy/flask => xen/xsm/flask/policy}/access_vectors (100%)
 rename {tools/flask/policy/policy/flask => xen/xsm/flask/policy}/initial_sids (100%)
 rename {tools/flask/policy/policy/flask => xen/xsm/flask/policy}/mkaccess_vector.sh (97%)
 rename {tools/flask/policy/policy/flask => xen/xsm/flask/policy}/mkflask.sh (95%)
 rename {tools/flask/policy/policy/flask => xen/xsm/flask/policy}/security_classes (100%)

diff --git a/.gitignore b/.gitignore
index f6edc43..aac7a14 100644
--- a/.gitignore
+++ b/.gitignore
@@ -309,6 +309,11 @@ xen/include/xen/banner.h
 xen/include/xen/compile.h
 xen/tools/figlet/figlet
 xen/tools/symbols
+xen/xsm/flask/include/av_perm_to_string.h
+xen/xsm/flask/include/av_permissions.h
+xen/xsm/flask/include/class_to_string.h
+xen/xsm/flask/include/flask.h
+xen/xsm/flask/include/initial_sid_to_string.h
 xen/xen
 xen/xen-syms
 xen/xen.*
diff --git a/.hgignore b/.hgignore
index 344792a..5ed903f 100644
--- a/.hgignore
+++ b/.hgignore
@@ -339,6 +339,11 @@
 ^xen/include/xen/compile\.h$
 ^xen/tools/figlet/figlet$
 ^xen/tools/symbols$
+^xen/xsm/flask/include/av_perm_to_string\.h$
+^xen/xsm/flask/include/av_permissions\.h$
+^xen/xsm/flask/include/class_to_string\.h$
+^xen/xsm/flask/include/flask\.h$
+^xen/xsm/flask/include/initial_sid_to_string\.h$
 ^xen/xen$
 ^xen/xen-syms$
 ^xen/xen\..*$
diff --git a/tools/flask/policy/Makefile b/tools/flask/policy/Makefile
index 5c25cbe..3f5aa38 100644
--- a/tools/flask/policy/Makefile
+++ b/tools/flask/policy/Makefile
@@ -61,7 +61,7 @@ LOADPOLICY := $(SBINDIR)/flask-loadpolicy
 # policy source layout
 POLDIR := policy
 MODDIR := $(POLDIR)/modules
-FLASKDIR := $(POLDIR)/flask
+FLASKDIR := ../../../xen/xsm/flask/policy
 SECCLASS := $(FLASKDIR)/security_classes
 ISIDS := $(FLASKDIR)/initial_sids
 AVS := $(FLASKDIR)/access_vectors
diff --git a/tools/flask/policy/policy/flask/Makefile b/tools/flask/policy/policy/flask/Makefile
deleted file mode 100644
index 5f57e88..0000000
--- a/tools/flask/policy/policy/flask/Makefile
+++ /dev/null
@@ -1,41 +0,0 @@
-# flask needs to know where to export the libselinux headers.
-LIBSEL ?= ../../libselinux
-
-# flask needs to know where to export the kernel headers.
-LINUXDIR ?= ../../../linux-2.6
-
-AWK = awk
-
-CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
-          else if [ -x /bin/bash ]; then echo /bin/bash; \
-          else echo sh; fi ; fi)
-
-FLASK_H_DEPEND = security_classes initial_sids
-AV_H_DEPEND = access_vectors
-
-FLASK_H_FILES = class_to_string.h flask.h initial_sid_to_string.h
-AV_H_FILES = av_perm_to_string.h av_permissions.h
-ALL_H_FILES = $(FLASK_H_FILES) $(AV_H_FILES)
-
-all:  $(ALL_H_FILES)
-
-$(FLASK_H_FILES): $(FLASK_H_DEPEND)
-	$(CONFIG_SHELL) mkflask.sh $(AWK) $(FLASK_H_DEPEND)
-
-$(AV_H_FILES): $(AV_H_DEPEND)
-	$(CONFIG_SHELL) mkaccess_vector.sh $(AWK) $(AV_H_DEPEND)
-
-tolib: all
-	install -m 644 flask.h av_permissions.h $(LIBSEL)/include/selinux
-	install -m 644 class_to_string.h av_inherit.h common_perm_to_string.h av_perm_to_string.h $(LIBSEL)/src
-
-tokern: all
-	install -m 644 $(ALL_H_FILES) $(LINUXDIR)/security/selinux/include
-
-install: all
-
-relabel:
-
-clean:  
-	rm -f $(FLASK_H_FILES)
-	rm -f $(AV_H_FILES)
diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile
index 92fb410..1256512 100644
--- a/xen/xsm/flask/Makefile
+++ b/xen/xsm/flask/Makefile
@@ -5,3 +5,28 @@ obj-y += flask_op.o
 subdir-y += ss
 
 CFLAGS += -I./include
+
+AWK = awk
+
+CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
+          else if [ -x /bin/bash ]; then echo /bin/bash; \
+          else echo sh; fi ; fi)
+
+FLASK_H_DEPEND = policy/security_classes policy/initial_sids
+AV_H_DEPEND = policy/access_vectors
+
+FLASK_H_FILES = include/flask.h include/class_to_string.h include/initial_sid_to_string.h
+AV_H_FILES = include/av_perm_to_string.h include/av_permissions.h
+ALL_H_FILES = $(FLASK_H_FILES) $(AV_H_FILES)
+
+$(obj-y) ss/built_in.o: $(ALL_H_FILES)
+
+$(FLASK_H_FILES): $(FLASK_H_DEPEND)
+	$(CONFIG_SHELL) policy/mkflask.sh $(AWK) $(FLASK_H_DEPEND)
+
+$(AV_H_FILES): $(AV_H_DEPEND)
+	$(CONFIG_SHELL) policy/mkaccess_vector.sh $(AWK) $(AV_H_DEPEND)
+
+.PHONY: clean
+clean::
+	rm -f $(ALL_H_FILES) *.o $(DEPS)
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
deleted file mode 100644
index c3f2370..0000000
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-   S_(SECCLASS_XEN, XEN__SCHEDULER, "scheduler")
-   S_(SECCLASS_XEN, XEN__SETTIME, "settime")
-   S_(SECCLASS_XEN, XEN__TBUFCONTROL, "tbufcontrol")
-   S_(SECCLASS_XEN, XEN__READCONSOLE, "readconsole")
-   S_(SECCLASS_XEN, XEN__CLEARCONSOLE, "clearconsole")
-   S_(SECCLASS_XEN, XEN__PERFCONTROL, "perfcontrol")
-   S_(SECCLASS_XEN, XEN__MTRR_ADD, "mtrr_add")
-   S_(SECCLASS_XEN, XEN__MTRR_DEL, "mtrr_del")
-   S_(SECCLASS_XEN, XEN__MTRR_READ, "mtrr_read")
-   S_(SECCLASS_XEN, XEN__MICROCODE, "microcode")
-   S_(SECCLASS_XEN, XEN__PHYSINFO, "physinfo")
-   S_(SECCLASS_XEN, XEN__QUIRK, "quirk")
-   S_(SECCLASS_XEN, XEN__WRITECONSOLE, "writeconsole")
-   S_(SECCLASS_XEN, XEN__READAPIC, "readapic")
-   S_(SECCLASS_XEN, XEN__WRITEAPIC, "writeapic")
-   S_(SECCLASS_XEN, XEN__PRIVPROFILE, "privprofile")
-   S_(SECCLASS_XEN, XEN__NONPRIVPROFILE, "nonprivprofile")
-   S_(SECCLASS_XEN, XEN__KEXEC, "kexec")
-   S_(SECCLASS_XEN, XEN__FIRMWARE, "firmware")
-   S_(SECCLASS_XEN, XEN__SLEEP, "sleep")
-   S_(SECCLASS_XEN, XEN__FREQUENCY, "frequency")
-   S_(SECCLASS_XEN, XEN__GETIDLE, "getidle")
-   S_(SECCLASS_XEN, XEN__DEBUG, "debug")
-   S_(SECCLASS_XEN, XEN__GETCPUINFO, "getcpuinfo")
-   S_(SECCLASS_XEN, XEN__HEAP, "heap")
-   S_(SECCLASS_XEN, XEN__PM_OP, "pm_op")
-   S_(SECCLASS_XEN, XEN__MCA_OP, "mca_op")
-   S_(SECCLASS_XEN, XEN__LOCKPROF, "lockprof")
-   S_(SECCLASS_XEN, XEN__CPUPOOL_OP, "cpupool_op")
-   S_(SECCLASS_XEN, XEN__SCHED_OP, "sched_op")
-   S_(SECCLASS_XEN, XEN__TMEM_OP, "tmem_op")
-   S_(SECCLASS_XEN, XEN__TMEM_CONTROL, "tmem_control")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT, "setvcpucontext")
-   S_(SECCLASS_DOMAIN, DOMAIN__PAUSE, "pause")
-   S_(SECCLASS_DOMAIN, DOMAIN__UNPAUSE, "unpause")
-   S_(SECCLASS_DOMAIN, DOMAIN__RESUME, "resume")
-   S_(SECCLASS_DOMAIN, DOMAIN__CREATE, "create")
-   S_(SECCLASS_DOMAIN, DOMAIN__TRANSITION, "transition")
-   S_(SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS, "max_vcpus")
-   S_(SECCLASS_DOMAIN, DOMAIN__DESTROY, "destroy")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETVCPUAFFINITY, "setvcpuaffinity")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETVCPUAFFINITY, "getvcpuaffinity")
-   S_(SECCLASS_DOMAIN, DOMAIN__SCHEDULER, "scheduler")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO, "getdomaininfo")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO, "getvcpuinfo")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT, "getvcpucontext")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM, "setdomainmaxmem")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE, "setdomainhandle")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING, "setdebugging")
-   S_(SECCLASS_DOMAIN, DOMAIN__HYPERCALL, "hypercall")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETTIME, "settime")
-   S_(SECCLASS_DOMAIN, DOMAIN__SET_TARGET, "set_target")
-   S_(SECCLASS_DOMAIN, DOMAIN__SHUTDOWN, "shutdown")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETADDRSIZE, "setaddrsize")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETADDRSIZE, "getaddrsize")
-   S_(SECCLASS_DOMAIN, DOMAIN__TRIGGER, "trigger")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETEXTVCPUCONTEXT, "getextvcpucontext")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETEXTVCPUCONTEXT, "setextvcpucontext")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETVCPUEXTSTATE, "getvcpuextstate")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETVCPUEXTSTATE, "setvcpuextstate")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETPODTARGET, "getpodtarget")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETPODTARGET, "setpodtarget")
-   S_(SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO, "set_misc_info")
-   S_(SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER, "set_virq_handler")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELFROM, "relabelfrom")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELTO, "relabelto")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELSELF, "relabelself")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR, "make_priv_for")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET, "set_as_target")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID, "set_cpuid")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__GETTSC, "gettsc")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__SETTSC, "settsc")
-   S_(SECCLASS_HVM, HVM__SETHVMC, "sethvmc")
-   S_(SECCLASS_HVM, HVM__GETHVMC, "gethvmc")
-   S_(SECCLASS_HVM, HVM__SETPARAM, "setparam")
-   S_(SECCLASS_HVM, HVM__GETPARAM, "getparam")
-   S_(SECCLASS_HVM, HVM__PCILEVEL, "pcilevel")
-   S_(SECCLASS_HVM, HVM__IRQLEVEL, "irqlevel")
-   S_(SECCLASS_HVM, HVM__PCIROUTE, "pciroute")
-   S_(SECCLASS_HVM, HVM__BIND_IRQ, "bind_irq")
-   S_(SECCLASS_HVM, HVM__CACHEATTR, "cacheattr")
-   S_(SECCLASS_HVM, HVM__TRACKDIRTYVRAM, "trackdirtyvram")
-   S_(SECCLASS_HVM, HVM__HVMCTL, "hvmctl")
-   S_(SECCLASS_HVM, HVM__MEM_EVENT, "mem_event")
-   S_(SECCLASS_HVM, HVM__MEM_SHARING, "mem_sharing")
-   S_(SECCLASS_HVM, HVM__AUDIT_P2M, "audit_p2m")
-   S_(SECCLASS_HVM, HVM__SEND_IRQ, "send_irq")
-   S_(SECCLASS_HVM, HVM__SHARE_MEM, "share_mem")
-   S_(SECCLASS_EVENT, EVENT__BIND, "bind")
-   S_(SECCLASS_EVENT, EVENT__SEND, "send")
-   S_(SECCLASS_EVENT, EVENT__STATUS, "status")
-   S_(SECCLASS_EVENT, EVENT__NOTIFY, "notify")
-   S_(SECCLASS_EVENT, EVENT__CREATE, "create")
-   S_(SECCLASS_EVENT, EVENT__RESET, "reset")
-   S_(SECCLASS_GRANT, GRANT__MAP_READ, "map_read")
-   S_(SECCLASS_GRANT, GRANT__MAP_WRITE, "map_write")
-   S_(SECCLASS_GRANT, GRANT__UNMAP, "unmap")
-   S_(SECCLASS_GRANT, GRANT__TRANSFER, "transfer")
-   S_(SECCLASS_GRANT, GRANT__SETUP, "setup")
-   S_(SECCLASS_GRANT, GRANT__COPY, "copy")
-   S_(SECCLASS_GRANT, GRANT__QUERY, "query")
-   S_(SECCLASS_MMU, MMU__MAP_READ, "map_read")
-   S_(SECCLASS_MMU, MMU__MAP_WRITE, "map_write")
-   S_(SECCLASS_MMU, MMU__PAGEINFO, "pageinfo")
-   S_(SECCLASS_MMU, MMU__PAGELIST, "pagelist")
-   S_(SECCLASS_MMU, MMU__ADJUST, "adjust")
-   S_(SECCLASS_MMU, MMU__STAT, "stat")
-   S_(SECCLASS_MMU, MMU__TRANSLATEGP, "translategp")
-   S_(SECCLASS_MMU, MMU__UPDATEMP, "updatemp")
-   S_(SECCLASS_MMU, MMU__PHYSMAP, "physmap")
-   S_(SECCLASS_MMU, MMU__PINPAGE, "pinpage")
-   S_(SECCLASS_MMU, MMU__MFNLIST, "mfnlist")
-   S_(SECCLASS_MMU, MMU__MEMORYMAP, "memorymap")
-   S_(SECCLASS_MMU, MMU__REMOTE_REMAP, "remote_remap")
-   S_(SECCLASS_MMU, MMU__MMUEXT_OP, "mmuext_op")
-   S_(SECCLASS_MMU, MMU__EXCHANGE, "exchange")
-   S_(SECCLASS_SHADOW, SHADOW__DISABLE, "disable")
-   S_(SECCLASS_SHADOW, SHADOW__ENABLE, "enable")
-   S_(SECCLASS_SHADOW, SHADOW__LOGDIRTY, "logdirty")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD, "add")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE, "remove")
-   S_(SECCLASS_RESOURCE, RESOURCE__USE, "use")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD_IRQ, "add_irq")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, "remove_irq")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD_IOPORT, "add_ioport")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE_IOPORT, "remove_ioport")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD_IOMEM, "add_iomem")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE_IOMEM, "remove_iomem")
-   S_(SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, "stat_device")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD_DEVICE, "add_device")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE_DEVICE, "remove_device")
-   S_(SECCLASS_RESOURCE, RESOURCE__PLUG, "plug")
-   S_(SECCLASS_RESOURCE, RESOURCE__UNPLUG, "unplug")
-   S_(SECCLASS_RESOURCE, RESOURCE__SETUP, "setup")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_AV, "compute_av")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_CREATE, "compute_create")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_MEMBER, "compute_member")
-   S_(SECCLASS_SECURITY, SECURITY__CHECK_CONTEXT, "check_context")
-   S_(SECCLASS_SECURITY, SECURITY__LOAD_POLICY, "load_policy")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_RELABEL, "compute_relabel")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_USER, "compute_user")
-   S_(SECCLASS_SECURITY, SECURITY__SETENFORCE, "setenforce")
-   S_(SECCLASS_SECURITY, SECURITY__SETBOOL, "setbool")
-   S_(SECCLASS_SECURITY, SECURITY__SETSECPARAM, "setsecparam")
-   S_(SECCLASS_SECURITY, SECURITY__ADD_OCONTEXT, "add_ocontext")
-   S_(SECCLASS_SECURITY, SECURITY__DEL_OCONTEXT, "del_ocontext")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
deleted file mode 100644
index 65302e8..0000000
--- a/xen/xsm/flask/include/av_permissions.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-#define XEN__SCHEDULER                            0x00000001UL
-#define XEN__SETTIME                              0x00000002UL
-#define XEN__TBUFCONTROL                          0x00000004UL
-#define XEN__READCONSOLE                          0x00000008UL
-#define XEN__CLEARCONSOLE                         0x00000010UL
-#define XEN__PERFCONTROL                          0x00000020UL
-#define XEN__MTRR_ADD                             0x00000040UL
-#define XEN__MTRR_DEL                             0x00000080UL
-#define XEN__MTRR_READ                            0x00000100UL
-#define XEN__MICROCODE                            0x00000200UL
-#define XEN__PHYSINFO                             0x00000400UL
-#define XEN__QUIRK                                0x00000800UL
-#define XEN__WRITECONSOLE                         0x00001000UL
-#define XEN__READAPIC                             0x00002000UL
-#define XEN__WRITEAPIC                            0x00004000UL
-#define XEN__PRIVPROFILE                          0x00008000UL
-#define XEN__NONPRIVPROFILE                       0x00010000UL
-#define XEN__KEXEC                                0x00020000UL
-#define XEN__FIRMWARE                             0x00040000UL
-#define XEN__SLEEP                                0x00080000UL
-#define XEN__FREQUENCY                            0x00100000UL
-#define XEN__GETIDLE                              0x00200000UL
-#define XEN__DEBUG                                0x00400000UL
-#define XEN__GETCPUINFO                           0x00800000UL
-#define XEN__HEAP                                 0x01000000UL
-#define XEN__PM_OP                                0x02000000UL
-#define XEN__MCA_OP                               0x04000000UL
-#define XEN__LOCKPROF                             0x08000000UL
-#define XEN__CPUPOOL_OP                           0x10000000UL
-#define XEN__SCHED_OP                             0x20000000UL
-#define XEN__TMEM_OP                              0x40000000UL
-#define XEN__TMEM_CONTROL                         0x80000000UL
-
-#define DOMAIN__SETVCPUCONTEXT                    0x00000001UL
-#define DOMAIN__PAUSE                             0x00000002UL
-#define DOMAIN__UNPAUSE                           0x00000004UL
-#define DOMAIN__RESUME                            0x00000008UL
-#define DOMAIN__CREATE                            0x00000010UL
-#define DOMAIN__TRANSITION                        0x00000020UL
-#define DOMAIN__MAX_VCPUS                         0x00000040UL
-#define DOMAIN__DESTROY                           0x00000080UL
-#define DOMAIN__SETVCPUAFFINITY                   0x00000100UL
-#define DOMAIN__GETVCPUAFFINITY                   0x00000200UL
-#define DOMAIN__SCHEDULER                         0x00000400UL
-#define DOMAIN__GETDOMAININFO                     0x00000800UL
-#define DOMAIN__GETVCPUINFO                       0x00001000UL
-#define DOMAIN__GETVCPUCONTEXT                    0x00002000UL
-#define DOMAIN__SETDOMAINMAXMEM                   0x00004000UL
-#define DOMAIN__SETDOMAINHANDLE                   0x00008000UL
-#define DOMAIN__SETDEBUGGING                      0x00010000UL
-#define DOMAIN__HYPERCALL                         0x00020000UL
-#define DOMAIN__SETTIME                           0x00040000UL
-#define DOMAIN__SET_TARGET                        0x00080000UL
-#define DOMAIN__SHUTDOWN                          0x00100000UL
-#define DOMAIN__SETADDRSIZE                       0x00200000UL
-#define DOMAIN__GETADDRSIZE                       0x00400000UL
-#define DOMAIN__TRIGGER                           0x00800000UL
-#define DOMAIN__GETEXTVCPUCONTEXT                 0x01000000UL
-#define DOMAIN__SETEXTVCPUCONTEXT                 0x02000000UL
-#define DOMAIN__GETVCPUEXTSTATE                   0x04000000UL
-#define DOMAIN__SETVCPUEXTSTATE                   0x08000000UL
-#define DOMAIN__GETPODTARGET                      0x10000000UL
-#define DOMAIN__SETPODTARGET                      0x20000000UL
-#define DOMAIN__SET_MISC_INFO                     0x40000000UL
-#define DOMAIN__SET_VIRQ_HANDLER                  0x80000000UL
-
-#define DOMAIN2__RELABELFROM                      0x00000001UL
-#define DOMAIN2__RELABELTO                        0x00000002UL
-#define DOMAIN2__RELABELSELF                      0x00000004UL
-#define DOMAIN2__MAKE_PRIV_FOR                    0x00000008UL
-#define DOMAIN2__SET_AS_TARGET                    0x00000010UL
-#define DOMAIN2__SET_CPUID                        0x00000020UL
-#define DOMAIN2__GETTSC                           0x00000040UL
-#define DOMAIN2__SETTSC                           0x00000080UL
-
-#define HVM__SETHVMC                              0x00000001UL
-#define HVM__GETHVMC                              0x00000002UL
-#define HVM__SETPARAM                             0x00000004UL
-#define HVM__GETPARAM                             0x00000008UL
-#define HVM__PCILEVEL                             0x00000010UL
-#define HVM__IRQLEVEL                             0x00000020UL
-#define HVM__PCIROUTE                             0x00000040UL
-#define HVM__BIND_IRQ                             0x00000080UL
-#define HVM__CACHEATTR                            0x00000100UL
-#define HVM__TRACKDIRTYVRAM                       0x00000200UL
-#define HVM__HVMCTL                               0x00000400UL
-#define HVM__MEM_EVENT                            0x00000800UL
-#define HVM__MEM_SHARING                          0x00001000UL
-#define HVM__AUDIT_P2M                            0x00002000UL
-#define HVM__SEND_IRQ                             0x00004000UL
-#define HVM__SHARE_MEM                            0x00008000UL
-
-#define EVENT__BIND                               0x00000001UL
-#define EVENT__SEND                               0x00000002UL
-#define EVENT__STATUS                             0x00000004UL
-#define EVENT__NOTIFY                             0x00000008UL
-#define EVENT__CREATE                             0x00000010UL
-#define EVENT__RESET                              0x00000020UL
-
-#define GRANT__MAP_READ                           0x00000001UL
-#define GRANT__MAP_WRITE                          0x00000002UL
-#define GRANT__UNMAP                              0x00000004UL
-#define GRANT__TRANSFER                           0x00000008UL
-#define GRANT__SETUP                              0x00000010UL
-#define GRANT__COPY                               0x00000020UL
-#define GRANT__QUERY                              0x00000040UL
-
-#define MMU__MAP_READ                             0x00000001UL
-#define MMU__MAP_WRITE                            0x00000002UL
-#define MMU__PAGEINFO                             0x00000004UL
-#define MMU__PAGELIST                             0x00000008UL
-#define MMU__ADJUST                               0x00000010UL
-#define MMU__STAT                                 0x00000020UL
-#define MMU__TRANSLATEGP                          0x00000040UL
-#define MMU__UPDATEMP                             0x00000080UL
-#define MMU__PHYSMAP                              0x00000100UL
-#define MMU__PINPAGE                              0x00000200UL
-#define MMU__MFNLIST                              0x00000400UL
-#define MMU__MEMORYMAP                            0x00000800UL
-#define MMU__REMOTE_REMAP                         0x00001000UL
-#define MMU__MMUEXT_OP                            0x00002000UL
-#define MMU__EXCHANGE                             0x00004000UL
-
-#define SHADOW__DISABLE                           0x00000001UL
-#define SHADOW__ENABLE                            0x00000002UL
-#define SHADOW__LOGDIRTY                          0x00000004UL
-
-#define RESOURCE__ADD                             0x00000001UL
-#define RESOURCE__REMOVE                          0x00000002UL
-#define RESOURCE__USE                             0x00000004UL
-#define RESOURCE__ADD_IRQ                         0x00000008UL
-#define RESOURCE__REMOVE_IRQ                      0x00000010UL
-#define RESOURCE__ADD_IOPORT                      0x00000020UL
-#define RESOURCE__REMOVE_IOPORT                   0x00000040UL
-#define RESOURCE__ADD_IOMEM                       0x00000080UL
-#define RESOURCE__REMOVE_IOMEM                    0x00000100UL
-#define RESOURCE__STAT_DEVICE                     0x00000200UL
-#define RESOURCE__ADD_DEVICE                      0x00000400UL
-#define RESOURCE__REMOVE_DEVICE                   0x00000800UL
-#define RESOURCE__PLUG                            0x00001000UL
-#define RESOURCE__UNPLUG                          0x00002000UL
-#define RESOURCE__SETUP                           0x00004000UL
-
-#define SECURITY__COMPUTE_AV                      0x00000001UL
-#define SECURITY__COMPUTE_CREATE                  0x00000002UL
-#define SECURITY__COMPUTE_MEMBER                  0x00000004UL
-#define SECURITY__CHECK_CONTEXT                   0x00000008UL
-#define SECURITY__LOAD_POLICY                     0x00000010UL
-#define SECURITY__COMPUTE_RELABEL                 0x00000020UL
-#define SECURITY__COMPUTE_USER                    0x00000040UL
-#define SECURITY__SETENFORCE                      0x00000080UL
-#define SECURITY__SETBOOL                         0x00000100UL
-#define SECURITY__SETSECPARAM                     0x00000200UL
-#define SECURITY__ADD_OCONTEXT                    0x00000400UL
-#define SECURITY__DEL_OCONTEXT                    0x00000800UL
-
diff --git a/xen/xsm/flask/include/class_to_string.h b/xen/xsm/flask/include/class_to_string.h
deleted file mode 100644
index 7716645..0000000
--- a/xen/xsm/flask/include/class_to_string.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-/*
- * Security object class definitions
- */
-    S_("null")
-    S_("xen")
-    S_("domain")
-    S_("domain2")
-    S_("hvm")
-    S_("mmu")
-    S_("resource")
-    S_("shadow")
-    S_("event")
-    S_("grant")
-    S_("security")
diff --git a/xen/xsm/flask/include/flask.h b/xen/xsm/flask/include/flask.h
deleted file mode 100644
index 3bff998..0000000
--- a/xen/xsm/flask/include/flask.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-#ifndef _SELINUX_FLASK_H_
-#define _SELINUX_FLASK_H_
-
-/*
- * Security object class definitions
- */
-#define SECCLASS_XEN                                     1
-#define SECCLASS_DOMAIN                                  2
-#define SECCLASS_DOMAIN2                                 3
-#define SECCLASS_HVM                                     4
-#define SECCLASS_MMU                                     5
-#define SECCLASS_RESOURCE                                6
-#define SECCLASS_SHADOW                                  7
-#define SECCLASS_EVENT                                   8
-#define SECCLASS_GRANT                                   9
-#define SECCLASS_SECURITY                                10
-
-/*
- * Security identifier indices for initial entities
- */
-#define SECINITSID_XEN                                  1
-#define SECINITSID_DOM0                                 2
-#define SECINITSID_DOMIO                                3
-#define SECINITSID_DOMXEN                               4
-#define SECINITSID_UNLABELED                            5
-#define SECINITSID_SECURITY                             6
-#define SECINITSID_IOPORT                               7
-#define SECINITSID_IOMEM                                8
-#define SECINITSID_IRQ                                  9
-#define SECINITSID_DEVICE                               10
-
-#define SECINITSID_NUM                                  10
-
-#endif
diff --git a/xen/xsm/flask/include/initial_sid_to_string.h b/xen/xsm/flask/include/initial_sid_to_string.h
deleted file mode 100644
index 814f4bf..0000000
--- a/xen/xsm/flask/include/initial_sid_to_string.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-static char *initial_sid_to_string[] =
-{
-    "null",
-    "xen",
-    "dom0",
-    "domio",
-    "domxen",
-    "unlabeled",
-    "security",
-    "ioport",
-    "iomem",
-    "irq",
-    "device",
-};
-
diff --git a/tools/flask/policy/policy/flask/access_vectors b/xen/xsm/flask/policy/access_vectors
similarity index 100%
rename from tools/flask/policy/policy/flask/access_vectors
rename to xen/xsm/flask/policy/access_vectors
diff --git a/tools/flask/policy/policy/flask/initial_sids b/xen/xsm/flask/policy/initial_sids
similarity index 100%
rename from tools/flask/policy/policy/flask/initial_sids
rename to xen/xsm/flask/policy/initial_sids
diff --git a/tools/flask/policy/policy/flask/mkaccess_vector.sh b/xen/xsm/flask/policy/mkaccess_vector.sh
similarity index 97%
rename from tools/flask/policy/policy/flask/mkaccess_vector.sh
rename to xen/xsm/flask/policy/mkaccess_vector.sh
index 43a60a7..8ec87f7 100644
--- a/tools/flask/policy/policy/flask/mkaccess_vector.sh
+++ b/xen/xsm/flask/policy/mkaccess_vector.sh
@@ -9,8 +9,8 @@ awk=$1
 shift
 
 # output files
-av_permissions="av_permissions.h"
-av_perm_to_string="av_perm_to_string.h"
+av_permissions="include/av_permissions.h"
+av_perm_to_string="include/av_perm_to_string.h"
 
 cat $* | $awk "
 BEGIN	{
diff --git a/tools/flask/policy/policy/flask/mkflask.sh b/xen/xsm/flask/policy/mkflask.sh
similarity index 95%
rename from tools/flask/policy/policy/flask/mkflask.sh
rename to xen/xsm/flask/policy/mkflask.sh
index 9c84754..e8d8fb5 100644
--- a/tools/flask/policy/policy/flask/mkflask.sh
+++ b/xen/xsm/flask/policy/mkflask.sh
@@ -9,9 +9,9 @@ awk=$1
 shift 1
 
 # output file
-output_file="flask.h"
-debug_file="class_to_string.h"
-debug_file2="initial_sid_to_string.h"
+output_file="include/flask.h"
+debug_file="include/class_to_string.h"
+debug_file2="include/initial_sid_to_string.h"
 
 cat $* | $awk "
 BEGIN	{
diff --git a/tools/flask/policy/policy/flask/security_classes b/xen/xsm/flask/policy/security_classes
similarity index 100%
rename from tools/flask/policy/policy/flask/security_classes
rename to xen/xsm/flask/policy/security_classes
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:29:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:29:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQfG-0007He-BB; Fri, 16 Nov 2012 18:29:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TZQf4-0006r4-NV
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:29:07 +0000
Received: from [85.158.138.51:9301] by server-4.bemta-3.messagelabs.com id
	3C/5A-30023-DE586A05; Fri, 16 Nov 2012 18:29:01 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353090539!28435467!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5749 invoked from network); 16 Nov 2012 18:28:59 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-15.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:28:59 -0000
X-TM-IMSS-Message-ID: <89254178000aa5da@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 89254178000aa5da ;
	Fri, 16 Nov 2012 13:28:33 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAGISo3p031862; 
	Fri, 16 Nov 2012 13:28:58 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 13:28:34 -0500
Message-Id: <1353090514-18537-20-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org
Subject: [Xen-devel] [PATCH 19/19] flask: move policy headers into hypervisor
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Rather than keeping around headers that are autogenerated in order to
avoid adding build dependencies from xen/ to files in tools/, move the
relevant parts of the FLASK policy into the hypervisor tree and generate
the headers as part of the hypervisor's build.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 .gitignore                                         |   5 +
 .hgignore                                          |   5 +
 tools/flask/policy/Makefile                        |   2 +-
 tools/flask/policy/policy/flask/Makefile           |  41 ------
 xen/xsm/flask/Makefile                             |  25 ++++
 xen/xsm/flask/include/av_perm_to_string.h          | 147 -------------------
 xen/xsm/flask/include/av_permissions.h             | 157 ---------------------
 xen/xsm/flask/include/class_to_string.h            |  15 --
 xen/xsm/flask/include/flask.h                      |  35 -----
 xen/xsm/flask/include/initial_sid_to_string.h      |  16 ---
 .../flask => xen/xsm/flask/policy}/access_vectors  |   0
 .../flask => xen/xsm/flask/policy}/initial_sids    |   0
 .../xsm/flask/policy}/mkaccess_vector.sh           |   4 +-
 .../flask => xen/xsm/flask/policy}/mkflask.sh      |   6 +-
 .../xsm/flask/policy}/security_classes             |   0
 15 files changed, 41 insertions(+), 417 deletions(-)
 delete mode 100644 tools/flask/policy/policy/flask/Makefile
 delete mode 100644 xen/xsm/flask/include/av_perm_to_string.h
 delete mode 100644 xen/xsm/flask/include/av_permissions.h
 delete mode 100644 xen/xsm/flask/include/class_to_string.h
 delete mode 100644 xen/xsm/flask/include/flask.h
 delete mode 100644 xen/xsm/flask/include/initial_sid_to_string.h
 rename {tools/flask/policy/policy/flask => xen/xsm/flask/policy}/access_vectors (100%)
 rename {tools/flask/policy/policy/flask => xen/xsm/flask/policy}/initial_sids (100%)
 rename {tools/flask/policy/policy/flask => xen/xsm/flask/policy}/mkaccess_vector.sh (97%)
 rename {tools/flask/policy/policy/flask => xen/xsm/flask/policy}/mkflask.sh (95%)
 rename {tools/flask/policy/policy/flask => xen/xsm/flask/policy}/security_classes (100%)

diff --git a/.gitignore b/.gitignore
index f6edc43..aac7a14 100644
--- a/.gitignore
+++ b/.gitignore
@@ -309,6 +309,11 @@ xen/include/xen/banner.h
 xen/include/xen/compile.h
 xen/tools/figlet/figlet
 xen/tools/symbols
+xen/xsm/flask/include/av_perm_to_string.h
+xen/xsm/flask/include/av_permissions.h
+xen/xsm/flask/include/class_to_string.h
+xen/xsm/flask/include/flask.h
+xen/xsm/flask/include/initial_sid_to_string.h
 xen/xen
 xen/xen-syms
 xen/xen.*
diff --git a/.hgignore b/.hgignore
index 344792a..5ed903f 100644
--- a/.hgignore
+++ b/.hgignore
@@ -339,6 +339,11 @@
 ^xen/include/xen/compile\.h$
 ^xen/tools/figlet/figlet$
 ^xen/tools/symbols$
+^xen/xsm/flask/include/av_perm_to_string\.h$
+^xen/xsm/flask/include/av_permissions\.h$
+^xen/xsm/flask/include/class_to_string\.h$
+^xen/xsm/flask/include/flask\.h$
+^xen/xsm/flask/include/initial_sid_to_string\.h$
 ^xen/xen$
 ^xen/xen-syms$
 ^xen/xen\..*$
diff --git a/tools/flask/policy/Makefile b/tools/flask/policy/Makefile
index 5c25cbe..3f5aa38 100644
--- a/tools/flask/policy/Makefile
+++ b/tools/flask/policy/Makefile
@@ -61,7 +61,7 @@ LOADPOLICY := $(SBINDIR)/flask-loadpolicy
 # policy source layout
 POLDIR := policy
 MODDIR := $(POLDIR)/modules
-FLASKDIR := $(POLDIR)/flask
+FLASKDIR := ../../../xen/xsm/flask/policy
 SECCLASS := $(FLASKDIR)/security_classes
 ISIDS := $(FLASKDIR)/initial_sids
 AVS := $(FLASKDIR)/access_vectors
diff --git a/tools/flask/policy/policy/flask/Makefile b/tools/flask/policy/policy/flask/Makefile
deleted file mode 100644
index 5f57e88..0000000
--- a/tools/flask/policy/policy/flask/Makefile
+++ /dev/null
@@ -1,41 +0,0 @@
-# flask needs to know where to export the libselinux headers.
-LIBSEL ?= ../../libselinux
-
-# flask needs to know where to export the kernel headers.
-LINUXDIR ?= ../../../linux-2.6
-
-AWK = awk
-
-CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
-          else if [ -x /bin/bash ]; then echo /bin/bash; \
-          else echo sh; fi ; fi)
-
-FLASK_H_DEPEND = security_classes initial_sids
-AV_H_DEPEND = access_vectors
-
-FLASK_H_FILES = class_to_string.h flask.h initial_sid_to_string.h
-AV_H_FILES = av_perm_to_string.h av_permissions.h
-ALL_H_FILES = $(FLASK_H_FILES) $(AV_H_FILES)
-
-all:  $(ALL_H_FILES)
-
-$(FLASK_H_FILES): $(FLASK_H_DEPEND)
-	$(CONFIG_SHELL) mkflask.sh $(AWK) $(FLASK_H_DEPEND)
-
-$(AV_H_FILES): $(AV_H_DEPEND)
-	$(CONFIG_SHELL) mkaccess_vector.sh $(AWK) $(AV_H_DEPEND)
-
-tolib: all
-	install -m 644 flask.h av_permissions.h $(LIBSEL)/include/selinux
-	install -m 644 class_to_string.h av_inherit.h common_perm_to_string.h av_perm_to_string.h $(LIBSEL)/src
-
-tokern: all
-	install -m 644 $(ALL_H_FILES) $(LINUXDIR)/security/selinux/include
-
-install: all
-
-relabel:
-
-clean:  
-	rm -f $(FLASK_H_FILES)
-	rm -f $(AV_H_FILES)
diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile
index 92fb410..1256512 100644
--- a/xen/xsm/flask/Makefile
+++ b/xen/xsm/flask/Makefile
@@ -5,3 +5,28 @@ obj-y += flask_op.o
 subdir-y += ss
 
 CFLAGS += -I./include
+
+AWK = awk
+
+CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
+          else if [ -x /bin/bash ]; then echo /bin/bash; \
+          else echo sh; fi ; fi)
+
+FLASK_H_DEPEND = policy/security_classes policy/initial_sids
+AV_H_DEPEND = policy/access_vectors
+
+FLASK_H_FILES = include/flask.h include/class_to_string.h include/initial_sid_to_string.h
+AV_H_FILES = include/av_perm_to_string.h include/av_permissions.h
+ALL_H_FILES = $(FLASK_H_FILES) $(AV_H_FILES)
+
+$(obj-y) ss/built_in.o: $(ALL_H_FILES)
+
+$(FLASK_H_FILES): $(FLASK_H_DEPEND)
+	$(CONFIG_SHELL) policy/mkflask.sh $(AWK) $(FLASK_H_DEPEND)
+
+$(AV_H_FILES): $(AV_H_DEPEND)
+	$(CONFIG_SHELL) policy/mkaccess_vector.sh $(AWK) $(AV_H_DEPEND)
+
+.PHONY: clean
+clean::
+	rm -f $(ALL_H_FILES) *.o $(DEPS)
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
deleted file mode 100644
index c3f2370..0000000
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-   S_(SECCLASS_XEN, XEN__SCHEDULER, "scheduler")
-   S_(SECCLASS_XEN, XEN__SETTIME, "settime")
-   S_(SECCLASS_XEN, XEN__TBUFCONTROL, "tbufcontrol")
-   S_(SECCLASS_XEN, XEN__READCONSOLE, "readconsole")
-   S_(SECCLASS_XEN, XEN__CLEARCONSOLE, "clearconsole")
-   S_(SECCLASS_XEN, XEN__PERFCONTROL, "perfcontrol")
-   S_(SECCLASS_XEN, XEN__MTRR_ADD, "mtrr_add")
-   S_(SECCLASS_XEN, XEN__MTRR_DEL, "mtrr_del")
-   S_(SECCLASS_XEN, XEN__MTRR_READ, "mtrr_read")
-   S_(SECCLASS_XEN, XEN__MICROCODE, "microcode")
-   S_(SECCLASS_XEN, XEN__PHYSINFO, "physinfo")
-   S_(SECCLASS_XEN, XEN__QUIRK, "quirk")
-   S_(SECCLASS_XEN, XEN__WRITECONSOLE, "writeconsole")
-   S_(SECCLASS_XEN, XEN__READAPIC, "readapic")
-   S_(SECCLASS_XEN, XEN__WRITEAPIC, "writeapic")
-   S_(SECCLASS_XEN, XEN__PRIVPROFILE, "privprofile")
-   S_(SECCLASS_XEN, XEN__NONPRIVPROFILE, "nonprivprofile")
-   S_(SECCLASS_XEN, XEN__KEXEC, "kexec")
-   S_(SECCLASS_XEN, XEN__FIRMWARE, "firmware")
-   S_(SECCLASS_XEN, XEN__SLEEP, "sleep")
-   S_(SECCLASS_XEN, XEN__FREQUENCY, "frequency")
-   S_(SECCLASS_XEN, XEN__GETIDLE, "getidle")
-   S_(SECCLASS_XEN, XEN__DEBUG, "debug")
-   S_(SECCLASS_XEN, XEN__GETCPUINFO, "getcpuinfo")
-   S_(SECCLASS_XEN, XEN__HEAP, "heap")
-   S_(SECCLASS_XEN, XEN__PM_OP, "pm_op")
-   S_(SECCLASS_XEN, XEN__MCA_OP, "mca_op")
-   S_(SECCLASS_XEN, XEN__LOCKPROF, "lockprof")
-   S_(SECCLASS_XEN, XEN__CPUPOOL_OP, "cpupool_op")
-   S_(SECCLASS_XEN, XEN__SCHED_OP, "sched_op")
-   S_(SECCLASS_XEN, XEN__TMEM_OP, "tmem_op")
-   S_(SECCLASS_XEN, XEN__TMEM_CONTROL, "tmem_control")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT, "setvcpucontext")
-   S_(SECCLASS_DOMAIN, DOMAIN__PAUSE, "pause")
-   S_(SECCLASS_DOMAIN, DOMAIN__UNPAUSE, "unpause")
-   S_(SECCLASS_DOMAIN, DOMAIN__RESUME, "resume")
-   S_(SECCLASS_DOMAIN, DOMAIN__CREATE, "create")
-   S_(SECCLASS_DOMAIN, DOMAIN__TRANSITION, "transition")
-   S_(SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS, "max_vcpus")
-   S_(SECCLASS_DOMAIN, DOMAIN__DESTROY, "destroy")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETVCPUAFFINITY, "setvcpuaffinity")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETVCPUAFFINITY, "getvcpuaffinity")
-   S_(SECCLASS_DOMAIN, DOMAIN__SCHEDULER, "scheduler")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO, "getdomaininfo")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO, "getvcpuinfo")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT, "getvcpucontext")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM, "setdomainmaxmem")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE, "setdomainhandle")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING, "setdebugging")
-   S_(SECCLASS_DOMAIN, DOMAIN__HYPERCALL, "hypercall")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETTIME, "settime")
-   S_(SECCLASS_DOMAIN, DOMAIN__SET_TARGET, "set_target")
-   S_(SECCLASS_DOMAIN, DOMAIN__SHUTDOWN, "shutdown")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETADDRSIZE, "setaddrsize")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETADDRSIZE, "getaddrsize")
-   S_(SECCLASS_DOMAIN, DOMAIN__TRIGGER, "trigger")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETEXTVCPUCONTEXT, "getextvcpucontext")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETEXTVCPUCONTEXT, "setextvcpucontext")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETVCPUEXTSTATE, "getvcpuextstate")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETVCPUEXTSTATE, "setvcpuextstate")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETPODTARGET, "getpodtarget")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETPODTARGET, "setpodtarget")
-   S_(SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO, "set_misc_info")
-   S_(SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER, "set_virq_handler")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELFROM, "relabelfrom")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELTO, "relabelto")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELSELF, "relabelself")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR, "make_priv_for")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET, "set_as_target")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID, "set_cpuid")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__GETTSC, "gettsc")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__SETTSC, "settsc")
-   S_(SECCLASS_HVM, HVM__SETHVMC, "sethvmc")
-   S_(SECCLASS_HVM, HVM__GETHVMC, "gethvmc")
-   S_(SECCLASS_HVM, HVM__SETPARAM, "setparam")
-   S_(SECCLASS_HVM, HVM__GETPARAM, "getparam")
-   S_(SECCLASS_HVM, HVM__PCILEVEL, "pcilevel")
-   S_(SECCLASS_HVM, HVM__IRQLEVEL, "irqlevel")
-   S_(SECCLASS_HVM, HVM__PCIROUTE, "pciroute")
-   S_(SECCLASS_HVM, HVM__BIND_IRQ, "bind_irq")
-   S_(SECCLASS_HVM, HVM__CACHEATTR, "cacheattr")
-   S_(SECCLASS_HVM, HVM__TRACKDIRTYVRAM, "trackdirtyvram")
-   S_(SECCLASS_HVM, HVM__HVMCTL, "hvmctl")
-   S_(SECCLASS_HVM, HVM__MEM_EVENT, "mem_event")
-   S_(SECCLASS_HVM, HVM__MEM_SHARING, "mem_sharing")
-   S_(SECCLASS_HVM, HVM__AUDIT_P2M, "audit_p2m")
-   S_(SECCLASS_HVM, HVM__SEND_IRQ, "send_irq")
-   S_(SECCLASS_HVM, HVM__SHARE_MEM, "share_mem")
-   S_(SECCLASS_EVENT, EVENT__BIND, "bind")
-   S_(SECCLASS_EVENT, EVENT__SEND, "send")
-   S_(SECCLASS_EVENT, EVENT__STATUS, "status")
-   S_(SECCLASS_EVENT, EVENT__NOTIFY, "notify")
-   S_(SECCLASS_EVENT, EVENT__CREATE, "create")
-   S_(SECCLASS_EVENT, EVENT__RESET, "reset")
-   S_(SECCLASS_GRANT, GRANT__MAP_READ, "map_read")
-   S_(SECCLASS_GRANT, GRANT__MAP_WRITE, "map_write")
-   S_(SECCLASS_GRANT, GRANT__UNMAP, "unmap")
-   S_(SECCLASS_GRANT, GRANT__TRANSFER, "transfer")
-   S_(SECCLASS_GRANT, GRANT__SETUP, "setup")
-   S_(SECCLASS_GRANT, GRANT__COPY, "copy")
-   S_(SECCLASS_GRANT, GRANT__QUERY, "query")
-   S_(SECCLASS_MMU, MMU__MAP_READ, "map_read")
-   S_(SECCLASS_MMU, MMU__MAP_WRITE, "map_write")
-   S_(SECCLASS_MMU, MMU__PAGEINFO, "pageinfo")
-   S_(SECCLASS_MMU, MMU__PAGELIST, "pagelist")
-   S_(SECCLASS_MMU, MMU__ADJUST, "adjust")
-   S_(SECCLASS_MMU, MMU__STAT, "stat")
-   S_(SECCLASS_MMU, MMU__TRANSLATEGP, "translategp")
-   S_(SECCLASS_MMU, MMU__UPDATEMP, "updatemp")
-   S_(SECCLASS_MMU, MMU__PHYSMAP, "physmap")
-   S_(SECCLASS_MMU, MMU__PINPAGE, "pinpage")
-   S_(SECCLASS_MMU, MMU__MFNLIST, "mfnlist")
-   S_(SECCLASS_MMU, MMU__MEMORYMAP, "memorymap")
-   S_(SECCLASS_MMU, MMU__REMOTE_REMAP, "remote_remap")
-   S_(SECCLASS_MMU, MMU__MMUEXT_OP, "mmuext_op")
-   S_(SECCLASS_MMU, MMU__EXCHANGE, "exchange")
-   S_(SECCLASS_SHADOW, SHADOW__DISABLE, "disable")
-   S_(SECCLASS_SHADOW, SHADOW__ENABLE, "enable")
-   S_(SECCLASS_SHADOW, SHADOW__LOGDIRTY, "logdirty")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD, "add")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE, "remove")
-   S_(SECCLASS_RESOURCE, RESOURCE__USE, "use")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD_IRQ, "add_irq")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, "remove_irq")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD_IOPORT, "add_ioport")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE_IOPORT, "remove_ioport")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD_IOMEM, "add_iomem")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE_IOMEM, "remove_iomem")
-   S_(SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, "stat_device")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD_DEVICE, "add_device")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE_DEVICE, "remove_device")
-   S_(SECCLASS_RESOURCE, RESOURCE__PLUG, "plug")
-   S_(SECCLASS_RESOURCE, RESOURCE__UNPLUG, "unplug")
-   S_(SECCLASS_RESOURCE, RESOURCE__SETUP, "setup")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_AV, "compute_av")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_CREATE, "compute_create")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_MEMBER, "compute_member")
-   S_(SECCLASS_SECURITY, SECURITY__CHECK_CONTEXT, "check_context")
-   S_(SECCLASS_SECURITY, SECURITY__LOAD_POLICY, "load_policy")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_RELABEL, "compute_relabel")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_USER, "compute_user")
-   S_(SECCLASS_SECURITY, SECURITY__SETENFORCE, "setenforce")
-   S_(SECCLASS_SECURITY, SECURITY__SETBOOL, "setbool")
-   S_(SECCLASS_SECURITY, SECURITY__SETSECPARAM, "setsecparam")
-   S_(SECCLASS_SECURITY, SECURITY__ADD_OCONTEXT, "add_ocontext")
-   S_(SECCLASS_SECURITY, SECURITY__DEL_OCONTEXT, "del_ocontext")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
deleted file mode 100644
index 65302e8..0000000
--- a/xen/xsm/flask/include/av_permissions.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-#define XEN__SCHEDULER                            0x00000001UL
-#define XEN__SETTIME                              0x00000002UL
-#define XEN__TBUFCONTROL                          0x00000004UL
-#define XEN__READCONSOLE                          0x00000008UL
-#define XEN__CLEARCONSOLE                         0x00000010UL
-#define XEN__PERFCONTROL                          0x00000020UL
-#define XEN__MTRR_ADD                             0x00000040UL
-#define XEN__MTRR_DEL                             0x00000080UL
-#define XEN__MTRR_READ                            0x00000100UL
-#define XEN__MICROCODE                            0x00000200UL
-#define XEN__PHYSINFO                             0x00000400UL
-#define XEN__QUIRK                                0x00000800UL
-#define XEN__WRITECONSOLE                         0x00001000UL
-#define XEN__READAPIC                             0x00002000UL
-#define XEN__WRITEAPIC                            0x00004000UL
-#define XEN__PRIVPROFILE                          0x00008000UL
-#define XEN__NONPRIVPROFILE                       0x00010000UL
-#define XEN__KEXEC                                0x00020000UL
-#define XEN__FIRMWARE                             0x00040000UL
-#define XEN__SLEEP                                0x00080000UL
-#define XEN__FREQUENCY                            0x00100000UL
-#define XEN__GETIDLE                              0x00200000UL
-#define XEN__DEBUG                                0x00400000UL
-#define XEN__GETCPUINFO                           0x00800000UL
-#define XEN__HEAP                                 0x01000000UL
-#define XEN__PM_OP                                0x02000000UL
-#define XEN__MCA_OP                               0x04000000UL
-#define XEN__LOCKPROF                             0x08000000UL
-#define XEN__CPUPOOL_OP                           0x10000000UL
-#define XEN__SCHED_OP                             0x20000000UL
-#define XEN__TMEM_OP                              0x40000000UL
-#define XEN__TMEM_CONTROL                         0x80000000UL
-
-#define DOMAIN__SETVCPUCONTEXT                    0x00000001UL
-#define DOMAIN__PAUSE                             0x00000002UL
-#define DOMAIN__UNPAUSE                           0x00000004UL
-#define DOMAIN__RESUME                            0x00000008UL
-#define DOMAIN__CREATE                            0x00000010UL
-#define DOMAIN__TRANSITION                        0x00000020UL
-#define DOMAIN__MAX_VCPUS                         0x00000040UL
-#define DOMAIN__DESTROY                           0x00000080UL
-#define DOMAIN__SETVCPUAFFINITY                   0x00000100UL
-#define DOMAIN__GETVCPUAFFINITY                   0x00000200UL
-#define DOMAIN__SCHEDULER                         0x00000400UL
-#define DOMAIN__GETDOMAININFO                     0x00000800UL
-#define DOMAIN__GETVCPUINFO                       0x00001000UL
-#define DOMAIN__GETVCPUCONTEXT                    0x00002000UL
-#define DOMAIN__SETDOMAINMAXMEM                   0x00004000UL
-#define DOMAIN__SETDOMAINHANDLE                   0x00008000UL
-#define DOMAIN__SETDEBUGGING                      0x00010000UL
-#define DOMAIN__HYPERCALL                         0x00020000UL
-#define DOMAIN__SETTIME                           0x00040000UL
-#define DOMAIN__SET_TARGET                        0x00080000UL
-#define DOMAIN__SHUTDOWN                          0x00100000UL
-#define DOMAIN__SETADDRSIZE                       0x00200000UL
-#define DOMAIN__GETADDRSIZE                       0x00400000UL
-#define DOMAIN__TRIGGER                           0x00800000UL
-#define DOMAIN__GETEXTVCPUCONTEXT                 0x01000000UL
-#define DOMAIN__SETEXTVCPUCONTEXT                 0x02000000UL
-#define DOMAIN__GETVCPUEXTSTATE                   0x04000000UL
-#define DOMAIN__SETVCPUEXTSTATE                   0x08000000UL
-#define DOMAIN__GETPODTARGET                      0x10000000UL
-#define DOMAIN__SETPODTARGET                      0x20000000UL
-#define DOMAIN__SET_MISC_INFO                     0x40000000UL
-#define DOMAIN__SET_VIRQ_HANDLER                  0x80000000UL
-
-#define DOMAIN2__RELABELFROM                      0x00000001UL
-#define DOMAIN2__RELABELTO                        0x00000002UL
-#define DOMAIN2__RELABELSELF                      0x00000004UL
-#define DOMAIN2__MAKE_PRIV_FOR                    0x00000008UL
-#define DOMAIN2__SET_AS_TARGET                    0x00000010UL
-#define DOMAIN2__SET_CPUID                        0x00000020UL
-#define DOMAIN2__GETTSC                           0x00000040UL
-#define DOMAIN2__SETTSC                           0x00000080UL
-
-#define HVM__SETHVMC                              0x00000001UL
-#define HVM__GETHVMC                              0x00000002UL
-#define HVM__SETPARAM                             0x00000004UL
-#define HVM__GETPARAM                             0x00000008UL
-#define HVM__PCILEVEL                             0x00000010UL
-#define HVM__IRQLEVEL                             0x00000020UL
-#define HVM__PCIROUTE                             0x00000040UL
-#define HVM__BIND_IRQ                             0x00000080UL
-#define HVM__CACHEATTR                            0x00000100UL
-#define HVM__TRACKDIRTYVRAM                       0x00000200UL
-#define HVM__HVMCTL                               0x00000400UL
-#define HVM__MEM_EVENT                            0x00000800UL
-#define HVM__MEM_SHARING                          0x00001000UL
-#define HVM__AUDIT_P2M                            0x00002000UL
-#define HVM__SEND_IRQ                             0x00004000UL
-#define HVM__SHARE_MEM                            0x00008000UL
-
-#define EVENT__BIND                               0x00000001UL
-#define EVENT__SEND                               0x00000002UL
-#define EVENT__STATUS                             0x00000004UL
-#define EVENT__NOTIFY                             0x00000008UL
-#define EVENT__CREATE                             0x00000010UL
-#define EVENT__RESET                              0x00000020UL
-
-#define GRANT__MAP_READ                           0x00000001UL
-#define GRANT__MAP_WRITE                          0x00000002UL
-#define GRANT__UNMAP                              0x00000004UL
-#define GRANT__TRANSFER                           0x00000008UL
-#define GRANT__SETUP                              0x00000010UL
-#define GRANT__COPY                               0x00000020UL
-#define GRANT__QUERY                              0x00000040UL
-
-#define MMU__MAP_READ                             0x00000001UL
-#define MMU__MAP_WRITE                            0x00000002UL
-#define MMU__PAGEINFO                             0x00000004UL
-#define MMU__PAGELIST                             0x00000008UL
-#define MMU__ADJUST                               0x00000010UL
-#define MMU__STAT                                 0x00000020UL
-#define MMU__TRANSLATEGP                          0x00000040UL
-#define MMU__UPDATEMP                             0x00000080UL
-#define MMU__PHYSMAP                              0x00000100UL
-#define MMU__PINPAGE                              0x00000200UL
-#define MMU__MFNLIST                              0x00000400UL
-#define MMU__MEMORYMAP                            0x00000800UL
-#define MMU__REMOTE_REMAP                         0x00001000UL
-#define MMU__MMUEXT_OP                            0x00002000UL
-#define MMU__EXCHANGE                             0x00004000UL
-
-#define SHADOW__DISABLE                           0x00000001UL
-#define SHADOW__ENABLE                            0x00000002UL
-#define SHADOW__LOGDIRTY                          0x00000004UL
-
-#define RESOURCE__ADD                             0x00000001UL
-#define RESOURCE__REMOVE                          0x00000002UL
-#define RESOURCE__USE                             0x00000004UL
-#define RESOURCE__ADD_IRQ                         0x00000008UL
-#define RESOURCE__REMOVE_IRQ                      0x00000010UL
-#define RESOURCE__ADD_IOPORT                      0x00000020UL
-#define RESOURCE__REMOVE_IOPORT                   0x00000040UL
-#define RESOURCE__ADD_IOMEM                       0x00000080UL
-#define RESOURCE__REMOVE_IOMEM                    0x00000100UL
-#define RESOURCE__STAT_DEVICE                     0x00000200UL
-#define RESOURCE__ADD_DEVICE                      0x00000400UL
-#define RESOURCE__REMOVE_DEVICE                   0x00000800UL
-#define RESOURCE__PLUG                            0x00001000UL
-#define RESOURCE__UNPLUG                          0x00002000UL
-#define RESOURCE__SETUP                           0x00004000UL
-
-#define SECURITY__COMPUTE_AV                      0x00000001UL
-#define SECURITY__COMPUTE_CREATE                  0x00000002UL
-#define SECURITY__COMPUTE_MEMBER                  0x00000004UL
-#define SECURITY__CHECK_CONTEXT                   0x00000008UL
-#define SECURITY__LOAD_POLICY                     0x00000010UL
-#define SECURITY__COMPUTE_RELABEL                 0x00000020UL
-#define SECURITY__COMPUTE_USER                    0x00000040UL
-#define SECURITY__SETENFORCE                      0x00000080UL
-#define SECURITY__SETBOOL                         0x00000100UL
-#define SECURITY__SETSECPARAM                     0x00000200UL
-#define SECURITY__ADD_OCONTEXT                    0x00000400UL
-#define SECURITY__DEL_OCONTEXT                    0x00000800UL
-
diff --git a/xen/xsm/flask/include/class_to_string.h b/xen/xsm/flask/include/class_to_string.h
deleted file mode 100644
index 7716645..0000000
--- a/xen/xsm/flask/include/class_to_string.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-/*
- * Security object class definitions
- */
-    S_("null")
-    S_("xen")
-    S_("domain")
-    S_("domain2")
-    S_("hvm")
-    S_("mmu")
-    S_("resource")
-    S_("shadow")
-    S_("event")
-    S_("grant")
-    S_("security")
diff --git a/xen/xsm/flask/include/flask.h b/xen/xsm/flask/include/flask.h
deleted file mode 100644
index 3bff998..0000000
--- a/xen/xsm/flask/include/flask.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-#ifndef _SELINUX_FLASK_H_
-#define _SELINUX_FLASK_H_
-
-/*
- * Security object class definitions
- */
-#define SECCLASS_XEN                                     1
-#define SECCLASS_DOMAIN                                  2
-#define SECCLASS_DOMAIN2                                 3
-#define SECCLASS_HVM                                     4
-#define SECCLASS_MMU                                     5
-#define SECCLASS_RESOURCE                                6
-#define SECCLASS_SHADOW                                  7
-#define SECCLASS_EVENT                                   8
-#define SECCLASS_GRANT                                   9
-#define SECCLASS_SECURITY                                10
-
-/*
- * Security identifier indices for initial entities
- */
-#define SECINITSID_XEN                                  1
-#define SECINITSID_DOM0                                 2
-#define SECINITSID_DOMIO                                3
-#define SECINITSID_DOMXEN                               4
-#define SECINITSID_UNLABELED                            5
-#define SECINITSID_SECURITY                             6
-#define SECINITSID_IOPORT                               7
-#define SECINITSID_IOMEM                                8
-#define SECINITSID_IRQ                                  9
-#define SECINITSID_DEVICE                               10
-
-#define SECINITSID_NUM                                  10
-
-#endif
diff --git a/xen/xsm/flask/include/initial_sid_to_string.h b/xen/xsm/flask/include/initial_sid_to_string.h
deleted file mode 100644
index 814f4bf..0000000
--- a/xen/xsm/flask/include/initial_sid_to_string.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-static char *initial_sid_to_string[] =
-{
-    "null",
-    "xen",
-    "dom0",
-    "domio",
-    "domxen",
-    "unlabeled",
-    "security",
-    "ioport",
-    "iomem",
-    "irq",
-    "device",
-};
-
diff --git a/tools/flask/policy/policy/flask/access_vectors b/xen/xsm/flask/policy/access_vectors
similarity index 100%
rename from tools/flask/policy/policy/flask/access_vectors
rename to xen/xsm/flask/policy/access_vectors
diff --git a/tools/flask/policy/policy/flask/initial_sids b/xen/xsm/flask/policy/initial_sids
similarity index 100%
rename from tools/flask/policy/policy/flask/initial_sids
rename to xen/xsm/flask/policy/initial_sids
diff --git a/tools/flask/policy/policy/flask/mkaccess_vector.sh b/xen/xsm/flask/policy/mkaccess_vector.sh
similarity index 97%
rename from tools/flask/policy/policy/flask/mkaccess_vector.sh
rename to xen/xsm/flask/policy/mkaccess_vector.sh
index 43a60a7..8ec87f7 100644
--- a/tools/flask/policy/policy/flask/mkaccess_vector.sh
+++ b/xen/xsm/flask/policy/mkaccess_vector.sh
@@ -9,8 +9,8 @@ awk=$1
 shift
 
 # output files
-av_permissions="av_permissions.h"
-av_perm_to_string="av_perm_to_string.h"
+av_permissions="include/av_permissions.h"
+av_perm_to_string="include/av_perm_to_string.h"
 
 cat $* | $awk "
 BEGIN	{
diff --git a/tools/flask/policy/policy/flask/mkflask.sh b/xen/xsm/flask/policy/mkflask.sh
similarity index 95%
rename from tools/flask/policy/policy/flask/mkflask.sh
rename to xen/xsm/flask/policy/mkflask.sh
index 9c84754..e8d8fb5 100644
--- a/tools/flask/policy/policy/flask/mkflask.sh
+++ b/xen/xsm/flask/policy/mkflask.sh
@@ -9,9 +9,9 @@ awk=$1
 shift 1
 
 # output file
-output_file="flask.h"
-debug_file="class_to_string.h"
-debug_file2="initial_sid_to_string.h"
+output_file="include/flask.h"
+debug_file="include/class_to_string.h"
+debug_file2="include/initial_sid_to_string.h"
 
 cat $* | $awk "
 BEGIN	{
diff --git a/tools/flask/policy/policy/flask/security_classes b/xen/xsm/flask/policy/security_classes
similarity index 100%
rename from tools/flask/policy/policy/flask/security_classes
rename to xen/xsm/flask/policy/security_classes
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:32:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:32:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQht-0001J3-J8; Fri, 16 Nov 2012 18:32:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TZQhr-0001HP-3Q
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:31:59 +0000
Received: from [85.158.138.51:32120] by server-10.bemta-3.messagelabs.com id
	3B/26-19806-E9686A05; Fri, 16 Nov 2012 18:31:58 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1353090717!30340858!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0NTE4OA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23548 invoked from network); 16 Nov 2012 18:31:57 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-11.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:31:57 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga101.fm.intel.com with ESMTP; 16 Nov 2012 10:31:53 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,266,1352102400"; d="scan'208";a="248363049"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by fmsmga001.fm.intel.com with ESMTP; 16 Nov 2012 10:31:53 -0800
Received: from fmsmsx151.amr.corp.intel.com (10.19.17.220) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 16 Nov 2012 10:31:52 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX151.amr.corp.intel.com (10.19.17.220) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 16 Nov 2012 10:31:52 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Sat, 17 Nov 2012 02:31:51 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Thread-Topic: [PATCH V3] X86/vMCE: handle broken page with regard to migration
Thread-Index: AQHNxCbggIBs/Elka0CkW2KriS9nNJfsxhjg
Date: Fri, 16 Nov 2012 18:31:50 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
In-Reply-To: <20646.33684.410414.579210@mariner.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Jackson wrote:
> Liu Jinsong writes ("[PATCH V3] X86/vMCE: handle broken page with
> regard to migration"): 
>> This is V3 patch, adding handle for vMCE occur at last iteration of
>> migration: 
> 
> I think you should take off my ack, having added significant new code
> in the tools section.

OK.

> 
> About that code:
> 
>> +            /*
>> +             * if vMCE occur at last iter, do one more iter so that
>> it get +             * chance to transfer broken page's pfn_type and
>> pfn number to +             * target and then take appropriate
>> action +             */ +            if ( last_iter )
>> +            {
>> +                for ( j = 0; j < batch; j++ )
>> +                {
>> +                    if ( hvm )
>> +                        pfn_type[j] = pfn_batch[j]; +              
>> else +                        pfn_type[j] =
>> pfn_to_mfn(pfn_batch[j]); +                } +
>> +                if ( xc_get_pfn_type_batch(xch, dom, batch,
>> pfn_type) ) +                { +                   
>> PERROR("get_pfn_type_batch failed"); +                    goto out;
>> +                }
>> +
>> +                broken_page_num2 = 0;
>> +                for ( j = 0; j < batch; j++ )
>> +                    if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
>> +                        broken_page_num2++;
>> +
>> +                if ( broken_page_num1 < broken_page_num2 )
>> +                    last_iter = 0;
>> +            }
> 
> Is this really the best way of doing this ?  Isn't there some single
> flag the hypervisor sets somewhere ?
> 
> Ian.

That will involve adding new hypercall, and notifying hypervisor whether tools side is at the last iter round.
This patch just re-use existed mechanism.

Thanks,
Jinsong

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:32:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:32:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQht-0001J3-J8; Fri, 16 Nov 2012 18:32:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TZQhr-0001HP-3Q
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 18:31:59 +0000
Received: from [85.158.138.51:32120] by server-10.bemta-3.messagelabs.com id
	3B/26-19806-E9686A05; Fri, 16 Nov 2012 18:31:58 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1353090717!30340858!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0NTE4OA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23548 invoked from network); 16 Nov 2012 18:31:57 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-11.tower-174.messagelabs.com with SMTP;
	16 Nov 2012 18:31:57 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga101.fm.intel.com with ESMTP; 16 Nov 2012 10:31:53 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,266,1352102400"; d="scan'208";a="248363049"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by fmsmga001.fm.intel.com with ESMTP; 16 Nov 2012 10:31:53 -0800
Received: from fmsmsx151.amr.corp.intel.com (10.19.17.220) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 16 Nov 2012 10:31:52 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX151.amr.corp.intel.com (10.19.17.220) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 16 Nov 2012 10:31:52 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Sat, 17 Nov 2012 02:31:51 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Thread-Topic: [PATCH V3] X86/vMCE: handle broken page with regard to migration
Thread-Index: AQHNxCbggIBs/Elka0CkW2KriS9nNJfsxhjg
Date: Fri, 16 Nov 2012 18:31:50 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
In-Reply-To: <20646.33684.410414.579210@mariner.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Jackson wrote:
> Liu Jinsong writes ("[PATCH V3] X86/vMCE: handle broken page with
> regard to migration"): 
>> This is V3 patch, adding handle for vMCE occur at last iteration of
>> migration: 
> 
> I think you should take off my ack, having added significant new code
> in the tools section.

OK.

> 
> About that code:
> 
>> +            /*
>> +             * if vMCE occur at last iter, do one more iter so that
>> it get +             * chance to transfer broken page's pfn_type and
>> pfn number to +             * target and then take appropriate
>> action +             */ +            if ( last_iter )
>> +            {
>> +                for ( j = 0; j < batch; j++ )
>> +                {
>> +                    if ( hvm )
>> +                        pfn_type[j] = pfn_batch[j]; +              
>> else +                        pfn_type[j] =
>> pfn_to_mfn(pfn_batch[j]); +                } +
>> +                if ( xc_get_pfn_type_batch(xch, dom, batch,
>> pfn_type) ) +                { +                   
>> PERROR("get_pfn_type_batch failed"); +                    goto out;
>> +                }
>> +
>> +                broken_page_num2 = 0;
>> +                for ( j = 0; j < batch; j++ )
>> +                    if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
>> +                        broken_page_num2++;
>> +
>> +                if ( broken_page_num1 < broken_page_num2 )
>> +                    last_iter = 0;
>> +            }
> 
> Is this really the best way of doing this ?  Isn't there some single
> flag the hypervisor sets somewhere ?
> 
> Ian.

That will involve adding new hypercall, and notifying hypervisor whether tools side is at the last iter round.
This patch just re-use existed mechanism.

Thanks,
Jinsong

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:37:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:37:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQn4-0002NJ-D5; Fri, 16 Nov 2012 18:37:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZQn3-0002NB-1v
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:37:21 +0000
Received: from [193.109.254.147:31838] by server-9.bemta-14.messagelabs.com id
	C3/AE-30773-0E786A05; Fri, 16 Nov 2012 18:37:20 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1353091038!9670736!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODY5MjY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26653 invoked from network); 16 Nov 2012 18:37:19 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:37:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="214781519"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:37:04 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 13:37:03 -0500
Received: from [10.80.3.146] (helo=localmatsp-T3500.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<mats.petersson@citrix.com>)	id 1TZQml-0001QT-Cw;
	Fri, 16 Nov 2012 18:37:03 +0000
From: Mats Petersson <mats.petersson@citrix.com>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 18:36:49 +0000
Message-ID: <1353091009-10564-1-git-send-email-mats.petersson@citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <mailman.16724.1353079390.1399.xen-devel@lists.xen.org>
References: <mailman.16724.1353079390.1399.xen-devel@lists.xen.org>
MIME-Version: 1.0
Cc: Mats Petersson <mats.petersson@citrix.com>, konrad.wilk@oracle.com
Subject: [Xen-devel] [PATCH V3] Correctly return success from
	IOCTL_PRIVCMD_MMAPBATCH
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a regression introduced by ceb90fa0 (xen/privcmd: add
PRIVCMD_MMAPBATCH_V2 ioctl).  It broke xentrace as it used
xc_map_foreign() instead of xc_map_foreign_bulk().

Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
that it broke. The return value is set early on to -EINVAL, and if all
goes well, the "set top bits of the MFN's" never gets called, so the
return value is still EINVAL when the function gets to the end, causing
the caller to think it went wrong (which it didn't!)

Now also including Andres "move the ret = -EINVAL into the error handling 
path, as this avoids other similar errors in future.

Signed off by: Mats Petersson <mats.petersson@citrix.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: David Vrabel <david.vrabel@citrix.com>
---
 drivers/xen/privcmd.c |   18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index 8adb9cc..71f5c45 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -361,13 +361,13 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
 	down_write(&mm->mmap_sem);
 
 	vma = find_vma(mm, m.addr);
-	ret = -EINVAL;
 	if (!vma ||
 	    vma->vm_ops != &privcmd_vm_ops ||
 	    (m.addr != vma->vm_start) ||
 	    ((m.addr + (nr_pages << PAGE_SHIFT)) != vma->vm_end) ||
 	    !privcmd_enforce_singleshot_mapping(vma)) {
 		up_write(&mm->mmap_sem);
+		ret = -EINVAL;
 		goto out;
 	}
 
@@ -383,12 +383,16 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
 
 	up_write(&mm->mmap_sem);
 
-	if (state.global_error && (version == 1)) {
-		/* Write back errors in second pass. */
-		state.user_mfn = (xen_pfn_t *)m.arr;
-		state.err      = err_array;
-		ret = traverse_pages(m.num, sizeof(xen_pfn_t),
-				     &pagelist, mmap_return_errors_v1, &state);
+	if (version == 1) {
+		if (state.global_error) {
+			/* Write back errors in second pass. */
+			state.user_mfn = (xen_pfn_t *)m.arr;
+			state.err      = err_array;
+			ret = traverse_pages(m.num, sizeof(xen_pfn_t),
+					     &pagelist, mmap_return_errors_v1, &state);
+		} else
+			ret = 0;
+
 	} else if (version == 2) {
 		ret = __copy_to_user(m.err, err_array, m.num * sizeof(int));
 		if (ret)
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:37:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:37:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQn4-0002NJ-D5; Fri, 16 Nov 2012 18:37:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TZQn3-0002NB-1v
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:37:21 +0000
Received: from [193.109.254.147:31838] by server-9.bemta-14.messagelabs.com id
	C3/AE-30773-0E786A05; Fri, 16 Nov 2012 18:37:20 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1353091038!9670736!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODY5MjY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26653 invoked from network); 16 Nov 2012 18:37:19 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 18:37:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="214781519"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 18:37:04 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 16 Nov 2012 13:37:03 -0500
Received: from [10.80.3.146] (helo=localmatsp-T3500.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<mats.petersson@citrix.com>)	id 1TZQml-0001QT-Cw;
	Fri, 16 Nov 2012 18:37:03 +0000
From: Mats Petersson <mats.petersson@citrix.com>
To: xen-devel@lists.xen.org
Date: Fri, 16 Nov 2012 18:36:49 +0000
Message-ID: <1353091009-10564-1-git-send-email-mats.petersson@citrix.com>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <mailman.16724.1353079390.1399.xen-devel@lists.xen.org>
References: <mailman.16724.1353079390.1399.xen-devel@lists.xen.org>
MIME-Version: 1.0
Cc: Mats Petersson <mats.petersson@citrix.com>, konrad.wilk@oracle.com
Subject: [Xen-devel] [PATCH V3] Correctly return success from
	IOCTL_PRIVCMD_MMAPBATCH
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a regression introduced by ceb90fa0 (xen/privcmd: add
PRIVCMD_MMAPBATCH_V2 ioctl).  It broke xentrace as it used
xc_map_foreign() instead of xc_map_foreign_bulk().

Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
that it broke. The return value is set early on to -EINVAL, and if all
goes well, the "set top bits of the MFN's" never gets called, so the
return value is still EINVAL when the function gets to the end, causing
the caller to think it went wrong (which it didn't!)

Now also including Andres "move the ret = -EINVAL into the error handling 
path, as this avoids other similar errors in future.

Signed off by: Mats Petersson <mats.petersson@citrix.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: David Vrabel <david.vrabel@citrix.com>
---
 drivers/xen/privcmd.c |   18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index 8adb9cc..71f5c45 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -361,13 +361,13 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
 	down_write(&mm->mmap_sem);
 
 	vma = find_vma(mm, m.addr);
-	ret = -EINVAL;
 	if (!vma ||
 	    vma->vm_ops != &privcmd_vm_ops ||
 	    (m.addr != vma->vm_start) ||
 	    ((m.addr + (nr_pages << PAGE_SHIFT)) != vma->vm_end) ||
 	    !privcmd_enforce_singleshot_mapping(vma)) {
 		up_write(&mm->mmap_sem);
+		ret = -EINVAL;
 		goto out;
 	}
 
@@ -383,12 +383,16 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
 
 	up_write(&mm->mmap_sem);
 
-	if (state.global_error && (version == 1)) {
-		/* Write back errors in second pass. */
-		state.user_mfn = (xen_pfn_t *)m.arr;
-		state.err      = err_array;
-		ret = traverse_pages(m.num, sizeof(xen_pfn_t),
-				     &pagelist, mmap_return_errors_v1, &state);
+	if (version == 1) {
+		if (state.global_error) {
+			/* Write back errors in second pass. */
+			state.user_mfn = (xen_pfn_t *)m.arr;
+			state.err      = err_array;
+			ret = traverse_pages(m.num, sizeof(xen_pfn_t),
+					     &pagelist, mmap_return_errors_v1, &state);
+		} else
+			ret = 0;
+
 	} else if (version == 2) {
 		ret = __copy_to_user(m.err, err_array, m.num * sizeof(int));
 		if (ret)
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 18:42:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:42:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQsJ-0002dd-5s; Fri, 16 Nov 2012 18:42:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <zhigang.x.wang@oracle.com>) id 1TZQsG-0002dY-Fj
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:42:44 +0000
Received: from [85.158.138.51:54374] by server-1.bemta-3.messagelabs.com id
	D3/78-12169-32986A05; Fri, 16 Nov 2012 18:42:43 +0000
X-Env-Sender: zhigang.x.wang@oracle.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1353091361!10619499!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2ODgwNw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24664 invoked from network); 16 Nov 2012 18:42:42 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-13.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 18:42:42 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGIgcCo013093
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 18:42:39 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGIgbx3006290
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 18:42:38 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGIgbdi028515; Fri, 16 Nov 2012 12:42:37 -0600
Received: from zhigang.us.oracle.com (/10.149.236.110)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 10:42:37 -0800
Message-ID: <50A68921.4010202@oracle.com>
Date: Fri, 16 Nov 2012 13:42:41 -0500
From: Zhigang Wang <zhigang.x.wang@oracle.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120827 Thunderbird/15.0
MIME-Version: 1.0
To: Keir Fraser <keir.xen@gmail.com>
References: <CCC6EFAD.44728%keir.xen@gmail.com> <50A26B50.5090109@oracle.com>
In-Reply-To: <50A26B50.5090109@oracle.com>
Content-Type: multipart/mixed; boundary="------------070907050300030006080807"
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Jan Beulich <jbeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] VM memory allocation speed with cs 26056
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.
--------------070907050300030006080807
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On 11/13/2012 10:46 AM, Zhigang Wang wrote:
> On 11/12/2012 01:25 PM, Keir Fraser wrote:
>> On 12/11/2012 15:01, "Zhigang Wang" <zhigang.x.wang@oracle.com> wrote:
>>
>>> Hi Keir/Jan,
>>>
>>> Recently I got a chance to access a big machine (2T mem/160 cpus) and I tested
>>> your patch: http://xenbits.xen.org/hg/xen-unstable.hg/rev/177fdda0be56
>>>
>>> Attached is the result.
>> The PVM result is weird, there is a small-ish slowdown for small domains,
>> becoming a very large %age slowdown as domain memory increases, and then
>> turning into a *speedup* as the memory size gets very large indeed.
>>
>> What are the error bars like on these measurements I wonder? One thing we
>> could do to allow PV guests doing 4k-at-a-time allocations through
>> alloc_heap_pages() to benefit from the TLB-flush improvements, is pull the
>> filtering-and-flush out into populate_physmap() and increase_reservation().
>> This is listed as a todo in the original patch (26056).
>>
>> To be honest I don't know why the original patch would make PV domain
>> creation slower, and certainly not by a varying %age depending on domain
>> memory size!
>>
>>  -- Keir
> I did it second time. It seems the result (attached) is promising.
>
> I think the strange result is due to the order of testing:
> start_physical_machine -> test_hvm -> test_pvm.
>
> This time, I did: start_physical_machine -> test_pvm -> test_hvm.
>
> You can see the pvm memory allocation speed is not affected by your patch this time.
>
> So I believe this patch is excellent now.

I get another chance to run the test without (old) and with (new) cs 25056 with
order:

start_physical_machine -> test_hvm -> test_pvm

It seems PV guest memory allocation is not affected by this patch, although it
makes a big difference if testing with order:

start_physical_machine -> test_pvm -> test_hvm

Thanks for the patch.

Zhigang


--------------070907050300030006080807
Content-Type: application/pdf;
 name="result.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="result.pdf"

JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0ZpbHRlci9GbGF0
ZURlY29kZT4+CnN0cmVhbQp4nK1Zy47rNgzd5yu8LjCpKFl+AEEAT5wsurtAgC4uuuttgS4K
3Lvp71cPxkNbJGVPiwGMIBMdHZKHD0vmDM0/p++NCX/9aJsObPPj2+nXn5q/T1+a743vzl3j
Wxd+1vXD2Tdgw8fXL/I60/z48/T+PN2fpy+br9xgzzas78Lz+Xvz8wOaIQA+//h6MXB1F2Ov
b3Axjjzb9PTX356/cIjpqw9m3Xn4NDHX+PE8Fry6yKtPLAbCa5QYtaYNJEqoaMTzL9UG+iVY
33gYzu1eFOi78GNmSbBhSpTf0/OGDo3PWTLCtnEtD3YnYI/4BKODOejOvQDmC2YZEkSwYQie
rYIhJ6+DtR3EWFWZ3dFA1Uzvhl1mTgRS1HUHIAZAYAZWBBtiRuxl5jEYAlgSpulLYU6SMAeI
SV8u+XoBR3afkYMuSQ6GkaStqChLkgWbtx5Blo+KJFkwknkLJ9W9KEkWzBdgRjcTJXkIzFQk
WQPDNL7p0URJ7gNDn4mZFyXZjl0AXEsyBE6rlcySr6/CQbUEKAJVmCwYFWZ28mKQKkwe7LFl
hnkvRiwLs27mRPiJFSkLk2c2FT4zOlgW5jEwMf+yMPeCvcIggY0uTAJVsJq3kiQHX0gykJAk
CWd2ySshaK1cPKJqCYUpQ9IegjVA7CEuOHlUwW5FW3rU6mYbZjQNci5YGr2soEg5SCwi616j
SgFFyvKjxt529eAs0hpYjjL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bSAvMEQ0
NjUzNEMwRkYzMkM3NUFBQjBCMEIwM0ZBNDc5NjkKPj4Kc3RhcnR4cmVmCjE1MjQ1CiUlRU9G
Cg==
--------------070907050300030006080807
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.xen.org
http://lists.xen.org/xen-devel

--------------070907050300030006080807--


From xen-devel-bounces@lists.xen.org Fri Nov 16 18:42:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 18:42:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZQsJ-0002dd-5s; Fri, 16 Nov 2012 18:42:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <zhigang.x.wang@oracle.com>) id 1TZQsG-0002dY-Fj
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 18:42:44 +0000
Received: from [85.158.138.51:54374] by server-1.bemta-3.messagelabs.com id
	D3/78-12169-32986A05; Fri, 16 Nov 2012 18:42:43 +0000
X-Env-Sender: zhigang.x.wang@oracle.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1353091361!10619499!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA2ODgwNw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24664 invoked from network); 16 Nov 2012 18:42:42 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-13.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 16 Nov 2012 18:42:42 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAGIgcCo013093
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 16 Nov 2012 18:42:39 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAGIgbx3006290
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 16 Nov 2012 18:42:38 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAGIgbdi028515; Fri, 16 Nov 2012 12:42:37 -0600
Received: from zhigang.us.oracle.com (/10.149.236.110)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 10:42:37 -0800
Message-ID: <50A68921.4010202@oracle.com>
Date: Fri, 16 Nov 2012 13:42:41 -0500
From: Zhigang Wang <zhigang.x.wang@oracle.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:15.0) Gecko/20120827 Thunderbird/15.0
MIME-Version: 1.0
To: Keir Fraser <keir.xen@gmail.com>
References: <CCC6EFAD.44728%keir.xen@gmail.com> <50A26B50.5090109@oracle.com>
In-Reply-To: <50A26B50.5090109@oracle.com>
Content-Type: multipart/mixed; boundary="------------070907050300030006080807"
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Jan Beulich <jbeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] VM memory allocation speed with cs 26056
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.
--------------070907050300030006080807
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On 11/13/2012 10:46 AM, Zhigang Wang wrote:
> On 11/12/2012 01:25 PM, Keir Fraser wrote:
>> On 12/11/2012 15:01, "Zhigang Wang" <zhigang.x.wang@oracle.com> wrote:
>>
>>> Hi Keir/Jan,
>>>
>>> Recently I got a chance to access a big machine (2T mem/160 cpus) and I tested
>>> your patch: http://xenbits.xen.org/hg/xen-unstable.hg/rev/177fdda0be56
>>>
>>> Attached is the result.
>> The PVM result is weird, there is a small-ish slowdown for small domains,
>> becoming a very large %age slowdown as domain memory increases, and then
>> turning into a *speedup* as the memory size gets very large indeed.
>>
>> What are the error bars like on these measurements I wonder? One thing we
>> could do to allow PV guests doing 4k-at-a-time allocations through
>> alloc_heap_pages() to benefit from the TLB-flush improvements, is pull the
>> filtering-and-flush out into populate_physmap() and increase_reservation().
>> This is listed as a todo in the original patch (26056).
>>
>> To be honest I don't know why the original patch would make PV domain
>> creation slower, and certainly not by a varying %age depending on domain
>> memory size!
>>
>>  -- Keir
> I did it second time. It seems the result (attached) is promising.
>
> I think the strange result is due to the order of testing:
> start_physical_machine -> test_hvm -> test_pvm.
>
> This time, I did: start_physical_machine -> test_pvm -> test_hvm.
>
> You can see the pvm memory allocation speed is not affected by your patch this time.
>
> So I believe this patch is excellent now.

I get another chance to run the test without (old) and with (new) cs 25056 with
order:

start_physical_machine -> test_hvm -> test_pvm

It seems PV guest memory allocation is not affected by this patch, although it
makes a big difference if testing with order:

start_physical_machine -> test_pvm -> test_hvm

Thanks for the patch.

Zhigang


--------------070907050300030006080807
Content-Type: application/pdf;
 name="result.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="result.pdf"

JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0ZpbHRlci9GbGF0
ZURlY29kZT4+CnN0cmVhbQp4nK1Zy47rNgzd5yu8LjCpKFl+AEEAT5wsurtAgC4uuuttgS4K
3Lvp71cPxkNbJGVPiwGMIBMdHZKHD0vmDM0/p++NCX/9aJsObPPj2+nXn5q/T1+a743vzl3j
Wxd+1vXD2Tdgw8fXL/I60/z48/T+PN2fpy+br9xgzzas78Lz+Xvz8wOaIQA+//h6MXB1F2Ov
b3Axjjzb9PTX356/cIjpqw9m3Xn4NDHX+PE8Fry6yKtPLAbCa5QYtaYNJEqoaMTzL9UG+iVY
33gYzu1eFOi78GNmSbBhSpTf0/OGDo3PWTLCtnEtD3YnYI/4BKODOejOvQDmC2YZEkSwYQie
rYIhJ6+DtR3EWFWZ3dFA1Uzvhl1mTgRS1HUHIAZAYAZWBBtiRuxl5jEYAlgSpulLYU6SMAeI
SV8u+XoBR3afkYMuSQ6GkaStqChLkgWbtx5Blo+KJFkwknkLJ9W9KEkWzBdgRjcTJXkIzFQk
WQPDNL7p0URJ7gNDn4mZFyXZjl0AXEsyBE6rlcySr6/CQbUEKAJVmCwYFWZ28mKQKkwe7LFl
hnkvRiwLs27mRPiJFSkLk2c2FT4zOlgW5jEwMf+yMPeCvcIggY0uTAJVsJq3kiQHX0gykJAk
CWd2ySshaK1cPKJqCYUpQ9IegjVA7CEuOHlUwW5FW3rU6mYbZjQNci5YGr2soEg5SCwi616j
SgFFyvKjxt529eAs0hpYjjLGWix4KNKdzMQAgDWhM7d9G9cKMZWWZrmySycS/HLkqcycGhsK
Nle0leXKgs2E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3RhcnR4cmVmCjE1MjQ1CiUlRU9G
Cg==
--------------070907050300030006080807
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.xen.org
http://lists.xen.org/xen-devel

--------------070907050300030006080807--


From xen-devel-bounces@lists.xen.org Fri Nov 16 19:36:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 19:36:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZRho-0003vs-Ri; Fri, 16 Nov 2012 19:36:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jaceksburghardt@gmail.com>) id 1TZRhn-0003vn-R5
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 19:36:00 +0000
Received: from [85.158.139.83:57843] by server-12.bemta-5.messagelabs.com id
	ED/85-02886-F9596A05; Fri, 16 Nov 2012 19:35:59 +0000
X-Env-Sender: jaceksburghardt@gmail.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1353094557!30360368!1
X-Originating-IP: [209.85.219.43]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_10_20,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15224 invoked from network); 16 Nov 2012 19:35:58 -0000
Received: from mail-oa0-f43.google.com (HELO mail-oa0-f43.google.com)
	(209.85.219.43)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 19:35:58 -0000
Received: by mail-oa0-f43.google.com with SMTP id k1so4106018oag.30
	for <xen-devel@lists.xensource.com>;
	Fri, 16 Nov 2012 11:35:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=xDFhdhLLvFwa4B1WbTnmOZhKoYHU+RtwXcZmwOkUsT4=;
	b=jpaGsmkG02Awha18M8/sBiQvG3BmHpiChReo2eft46l7l7QVMZ/+g6AgPFORncNTXN
	en21mqsQ7BNgEM5eOzwWkpRJkiAuQYpwmq4ysqrDAnSli4tQcQSCjhlL0i8CgFriq6W0
	IQPfS6Y8qsCY7uJ+lzNfAB5jwGD9XiyjtS1LYlL1cS8IekrvRg64Eze3sjXrpSQJzKL1
	vrZPkvrddIukCSjnKWLPW9r0bStDa+Xgtdr9DJz25+6TUwx7YcewrUg+OtUp85dElNoL
	6536Ln/TDLdDmXFwpVI8yUtJ6Nm9BLGicnm23QtL7F6MMVHqDtoRg68gpSmpAviV8dGz
	pq2Q==
MIME-Version: 1.0
Received: by 10.60.13.132 with SMTP id h4mr4881324oec.72.1353094556781; Fri,
	16 Nov 2012 11:35:56 -0800 (PST)
Received: by 10.76.73.38 with HTTP; Fri, 16 Nov 2012 11:35:56 -0800 (PST)
Date: Fri, 16 Nov 2012 12:35:56 -0700
Message-ID: <CAHyyzzRWhCZh2uThzZwnuG+aVcJf4D+vmgFX_i1G6L_zyJBOgg@mail.gmail.com>
From: jacek burghardt <jaceksburghardt@gmail.com>
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] bug in xl shutdown, reboot ignored
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0202351341693474955=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0202351341693474955==
Content-Type: multipart/alternative; boundary=e89a8fb20418678bff04cea1e03e

--e89a8fb20418678bff04cea1e03e
Content-Type: text/plain; charset=ISO-8859-1

it seems that xl ignores
on_poweroff = 'destroy'
 on_reboot   = 'restart'
 on_crash    = 'restart'
When i issue xl reboot the virtual host shows shuting down and then just
stops with screen showing shutdown.
Also when i issue shutdown or reboot from within guess os the guess os will
freeze at shutdown screen.
it seems that xl ignores the rules in config no matter what chances i made
they are ignored. the guest shows it status as  sr.
I have the same issue with windows 2012 2008 win 7 and pvlinux

--e89a8fb20418678bff04cea1e03e
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>it seems that xl ignores </div>
<div>on_poweroff =3D &#39;destroy&#39;<br>=A0on_reboot=A0=A0 =3D &#39;resta=
rt&#39;<br>=A0on_crash=A0=A0=A0 =3D &#39;restart&#39;</div>
<div>When i issue xl reboot the virtual host shows shuting down and then=A0=
just stops with screen showing shutdown.</div>
<div>Also when i issue shutdown or reboot from within guess os the=A0guess =
os will freeze at shutdown screen.</div>
<div>it seems that xl ignores=A0the rules in config no matter what chances =
i made they are ignored. the guest shows it status as =A0sr.</div>
<div>I have the same issue with windows 2012 2008 win 7 and=A0pvlinux=A0</d=
iv>

--e89a8fb20418678bff04cea1e03e--


--===============0202351341693474955==
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.xen.org
http://lists.xen.org/xen-devel

--===============0202351341693474955==--


From xen-devel-bounces@lists.xen.org Fri Nov 16 19:36:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 19:36:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZRho-0003vs-Ri; Fri, 16 Nov 2012 19:36:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jaceksburghardt@gmail.com>) id 1TZRhn-0003vn-R5
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 19:36:00 +0000
Received: from [85.158.139.83:57843] by server-12.bemta-5.messagelabs.com id
	ED/85-02886-F9596A05; Fri, 16 Nov 2012 19:35:59 +0000
X-Env-Sender: jaceksburghardt@gmail.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1353094557!30360368!1
X-Originating-IP: [209.85.219.43]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_10_20,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15224 invoked from network); 16 Nov 2012 19:35:58 -0000
Received: from mail-oa0-f43.google.com (HELO mail-oa0-f43.google.com)
	(209.85.219.43)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 19:35:58 -0000
Received: by mail-oa0-f43.google.com with SMTP id k1so4106018oag.30
	for <xen-devel@lists.xensource.com>;
	Fri, 16 Nov 2012 11:35:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=xDFhdhLLvFwa4B1WbTnmOZhKoYHU+RtwXcZmwOkUsT4=;
	b=jpaGsmkG02Awha18M8/sBiQvG3BmHpiChReo2eft46l7l7QVMZ/+g6AgPFORncNTXN
	en21mqsQ7BNgEM5eOzwWkpRJkiAuQYpwmq4ysqrDAnSli4tQcQSCjhlL0i8CgFriq6W0
	IQPfS6Y8qsCY7uJ+lzNfAB5jwGD9XiyjtS1LYlL1cS8IekrvRg64Eze3sjXrpSQJzKL1
	vrZPkvrddIukCSjnKWLPW9r0bStDa+Xgtdr9DJz25+6TUwx7YcewrUg+OtUp85dElNoL
	6536Ln/TDLdDmXFwpVI8yUtJ6Nm9BLGicnm23QtL7F6MMVHqDtoRg68gpSmpAviV8dGz
	pq2Q==
MIME-Version: 1.0
Received: by 10.60.13.132 with SMTP id h4mr4881324oec.72.1353094556781; Fri,
	16 Nov 2012 11:35:56 -0800 (PST)
Received: by 10.76.73.38 with HTTP; Fri, 16 Nov 2012 11:35:56 -0800 (PST)
Date: Fri, 16 Nov 2012 12:35:56 -0700
Message-ID: <CAHyyzzRWhCZh2uThzZwnuG+aVcJf4D+vmgFX_i1G6L_zyJBOgg@mail.gmail.com>
From: jacek burghardt <jaceksburghardt@gmail.com>
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] bug in xl shutdown, reboot ignored
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0202351341693474955=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0202351341693474955==
Content-Type: multipart/alternative; boundary=e89a8fb20418678bff04cea1e03e

--e89a8fb20418678bff04cea1e03e
Content-Type: text/plain; charset=ISO-8859-1

it seems that xl ignores
on_poweroff = 'destroy'
 on_reboot   = 'restart'
 on_crash    = 'restart'
When i issue xl reboot the virtual host shows shuting down and then just
stops with screen showing shutdown.
Also when i issue shutdown or reboot from within guess os the guess os will
freeze at shutdown screen.
it seems that xl ignores the rules in config no matter what chances i made
they are ignored. the guest shows it status as  sr.
I have the same issue with windows 2012 2008 win 7 and pvlinux

--e89a8fb20418678bff04cea1e03e
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>it seems that xl ignores </div>
<div>on_poweroff =3D &#39;destroy&#39;<br>=A0on_reboot=A0=A0 =3D &#39;resta=
rt&#39;<br>=A0on_crash=A0=A0=A0 =3D &#39;restart&#39;</div>
<div>When i issue xl reboot the virtual host shows shuting down and then=A0=
just stops with screen showing shutdown.</div>
<div>Also when i issue shutdown or reboot from within guess os the=A0guess =
os will freeze at shutdown screen.</div>
<div>it seems that xl ignores=A0the rules in config no matter what chances =
i made they are ignored. the guest shows it status as =A0sr.</div>
<div>I have the same issue with windows 2012 2008 win 7 and=A0pvlinux=A0</d=
iv>

--e89a8fb20418678bff04cea1e03e--


--===============0202351341693474955==
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.xen.org
http://lists.xen.org/xen-devel

--===============0202351341693474955==--


From xen-devel-bounces@lists.xen.org Fri Nov 16 20:19:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 20:19:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZSNe-0004bF-1i; Fri, 16 Nov 2012 20:19:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <okhalid.cern@gmail.com>) id 1TZSNc-0004ax-2N
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 20:19:12 +0000
Received: from [85.158.137.99:4424] by server-2.bemta-3.messagelabs.com id
	7F/AD-04744-FBF96A05; Fri, 16 Nov 2012 20:19:11 +0000
X-Env-Sender: okhalid.cern@gmail.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353097148!14310199!1
X-Originating-IP: [209.85.210.45]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5527 invoked from network); 16 Nov 2012 20:19:10 -0000
Received: from mail-da0-f45.google.com (HELO mail-da0-f45.google.com)
	(209.85.210.45)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 20:19:10 -0000
Received: by mail-da0-f45.google.com with SMTP id n15so1330005dad.32
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 12:19:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:reply-to:in-reply-to:references:date:message-id
	:subject:from:to:cc:content-type;
	bh=xz0ZOp9nf2bJz3e8PjPmKQ/lXHOxH6+YkjkTUV3tzzA=;
	b=PBHCQF+AavWsoebWKxH5XYhC6d2fR1mz7CHd+SDw8Acpx50IYwX7rsHifhHV9KDhCS
	40itGTnaa9smhASN1IuzZw5a5k7KSE4O/1IxDQOAw0UQcrvcZz6scx1RfRsomDia4S2u
	JzxNL+CIPY1jJTQV6W25LsROHpau3q1XZyXJg3qQVha1Uyel488LsYzfQof2rbboghmb
	Z2bWFPIRoQpya8U69eMBrcmdXP2ddHJYHJQez/5j07nLo6fEbCCOi/yB8AAWSoPzpFYz
	275gsvmZBpl/zvUv6o8t9pNcgqvjXCo6OBYVfipUARtwpO4QHHOrJ7KLV+PJJRyGhuRk
	Wyow==
MIME-Version: 1.0
Received: by 10.66.83.67 with SMTP id o3mr16105788pay.5.1353097147886; Fri, 16
	Nov 2012 12:19:07 -0800 (PST)
Received: by 10.66.189.234 with HTTP; Fri, 16 Nov 2012 12:19:07 -0800 (PST)
In-Reply-To: <50A6843F.5050000@citrix.com>
References: <CAPM9MsQsggsBAL948ZJ31bVnSNH+Q4kGr4d0Na+_RgPBpcgypA@mail.gmail.com>
	<50A6843F.5050000@citrix.com>
Date: Fri, 16 Nov 2012 20:19:07 +0000
Message-ID: <CAPM9MsSrmoG4RLJjNDNn+j=hWuU-r+WbckT-UJXPfJ-J8gbvOQ@mail.gmail.com>
From: "Omer K." <okhalid.cern@gmail.com>
To: Mats Petersson <mats.petersson@citrix.com>
Cc: xen-users list <xen-users@lists.xensource.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] How to activate all VPCUS for a domU?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: okhalid.cern@gmail.com
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6861011683075659954=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6861011683075659954==
Content-Type: multipart/alternative; boundary=f46d042ef49bd8ad6504cea27ab8

--f46d042ef49bd8ad6504cea27ab8
Content-Type: text/plain; charset=UTF-8

Hi,

Apologies for earlier spamming the xen-devel list but this message might be
relevant as I think there is a bug in xm/create.py where 'vcpu_avail'
option doesn't get properly set.

I manage to solve the issue of activating all of the vcpus by apply  a
modified version of the patch earlier discussed:

http://old-list-archives.xen.org/archives/html/xen-users/2010-09/msg00353.html

The following patch fixed the issue for me and after this bitmask value was
activating required vpcu's read from the xen configuration file. Prior to
that, vpcu_avail was always set to '1' (also verified from 'xenstore-ls -f'
output).

--- create.py
+++ create.py.af

         if maxvcpus and vcpus:
             config.append(['vcpus', vcpus])
-            config.append(['vcpu_avail', (1 << vcpus) -1)])
+            config.append(['vcpu_avail', getattr(vals, 'vcpu_avail'])

     def add_conf(n):
         if hasattr(vals, n):

Regards.
Omer


On Fri, Nov 16, 2012 at 6:21 PM, Mats Petersson
<mats.petersson@citrix.com>wrote:

> On 16/11/12 18:09, Omer K. wrote:
>
>> Hi,
>>
>> I have set maxvcpus and vcpus options in my domU configuration file, and
>> I can see that X number of vcpu are set for the domU.
>>
>> I tried to activate all the vpcus by using vpcu_avail option (using
>> decimal to represent vpcu bitmask e.g. 24=11000) but it doesn't seem to
>> work, and only the first vpcu is activated (i.e. has -b- state) while all
>> other vpcu's set for the domU are in the paused state.
>>
>> Can any one share more insights on how to activate all the vpcu's for the
>> guest domain ?
>>
>> Thanks
>>
> This definitely belongs to the Xen-Users list, not on Xen-Devel. Please
> don't post to both lists, it just confuses people.
>
> --
> Mats
>
> ______________________________**_________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>

--f46d042ef49bd8ad6504cea27ab8
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,<br><br>Apologies for earlier spamming the xen-devel list but this messa=
ge might be relevant as I think there is a bug in xm/create.py where &#39;v=
cpu_avail&#39; option doesn&#39;t get properly set.<br><br>I manage to solv=
e the issue of activating all of the vcpus by apply=C2=A0 a modified versio=
n of the patch earlier discussed:<br>
<br><a href=3D"http://old-list-archives.xen.org/archives/html/xen-users/201=
0-09/msg00353.html">http://old-list-archives.xen.org/archives/html/xen-user=
s/2010-09/msg00353.html</a><br><br>The following patch fixed the issue for =
me and after this bitmask value was activating required vpcu&#39;s read fro=
m the xen configuration file. Prior to that, vpcu_avail was always set to &=
#39;1&#39; (also verified from &#39;xenstore-ls -f&#39; output).<br>
<pre>--- create.py  =20
+++ <a href=3D"http://create.py.af">create.py.af</a> =20

         if maxvcpus and vcpus:
             config.append([&#39;vcpus&#39;, vcpus])<br>-            config=
.append([&#39;vcpu_avail&#39;, (1 &lt;&lt; vcpus) -1)])<br>+            con=
fig.append([&#39;vcpu_avail&#39;, getattr(vals, &#39;vcpu_avail&#39;])

     def add_conf(n):
         if hasattr(vals, n):</pre>Regards.<br>Omer<br><div class=3D"gmail_=
extra"><br><br><div class=3D"gmail_quote">On Fri, Nov 16, 2012 at 6:21 PM, =
Mats Petersson <span dir=3D"ltr">&lt;<a href=3D"mailto:mats.petersson@citri=
x.com" target=3D"_blank">mats.petersson@citrix.com</a>&gt;</span> wrote:<br=
>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"HOEnZb"><div class=3D"h5">On 1=
6/11/12 18:09, Omer K. wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I have set maxvcpus and vcpus options in my domU configuration file, and I =
can see that X number of vcpu are set for the domU.<br>
<br>
I tried to activate all the vpcus by using vpcu_avail option (using decimal=
 to represent vpcu bitmask e.g. 24=3D11000) but it doesn&#39;t seem to work=
, and only the first vpcu is activated (i.e. has -b- state) while all other=
 vpcu&#39;s set for the domU are in the paused state.<br>

<br>
Can any one share more insights on how to activate all the vpcu&#39;s for t=
he guest domain ?<br>
<br>
Thanks<br>
</blockquote></div></div>
This definitely belongs to the Xen-Users list, not on Xen-Devel. Please don=
&#39;t post to both lists, it just confuses people.<br>
<br>
--<br>
Mats<br>
<br>
______________________________<u></u>_________________<br>
Xen-devel mailing list<br>
<a href=3D"mailto:Xen-devel@lists.xen.org" target=3D"_blank">Xen-devel@list=
s.xen.org</a><br>
<a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://lists.x=
en.org/xen-devel</a><br>
</blockquote></div><br></div>

--f46d042ef49bd8ad6504cea27ab8--


--===============6861011683075659954==
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.xen.org
http://lists.xen.org/xen-devel

--===============6861011683075659954==--


From xen-devel-bounces@lists.xen.org Fri Nov 16 20:19:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 20:19:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZSNe-0004bF-1i; Fri, 16 Nov 2012 20:19:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <okhalid.cern@gmail.com>) id 1TZSNc-0004ax-2N
	for xen-devel@lists.xen.org; Fri, 16 Nov 2012 20:19:12 +0000
Received: from [85.158.137.99:4424] by server-2.bemta-3.messagelabs.com id
	7F/AD-04744-FBF96A05; Fri, 16 Nov 2012 20:19:11 +0000
X-Env-Sender: okhalid.cern@gmail.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353097148!14310199!1
X-Originating-IP: [209.85.210.45]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5527 invoked from network); 16 Nov 2012 20:19:10 -0000
Received: from mail-da0-f45.google.com (HELO mail-da0-f45.google.com)
	(209.85.210.45)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	16 Nov 2012 20:19:10 -0000
Received: by mail-da0-f45.google.com with SMTP id n15so1330005dad.32
	for <xen-devel@lists.xen.org>; Fri, 16 Nov 2012 12:19:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:reply-to:in-reply-to:references:date:message-id
	:subject:from:to:cc:content-type;
	bh=xz0ZOp9nf2bJz3e8PjPmKQ/lXHOxH6+YkjkTUV3tzzA=;
	b=PBHCQF+AavWsoebWKxH5XYhC6d2fR1mz7CHd+SDw8Acpx50IYwX7rsHifhHV9KDhCS
	40itGTnaa9smhASN1IuzZw5a5k7KSE4O/1IxDQOAw0UQcrvcZz6scx1RfRsomDia4S2u
	JzxNL+CIPY1jJTQV6W25LsROHpau3q1XZyXJg3qQVha1Uyel488LsYzfQof2rbboghmb
	Z2bWFPIRoQpya8U69eMBrcmdXP2ddHJYHJQez/5j07nLo6fEbCCOi/yB8AAWSoPzpFYz
	275gsvmZBpl/zvUv6o8t9pNcgqvjXCo6OBYVfipUARtwpO4QHHOrJ7KLV+PJJRyGhuRk
	Wyow==
MIME-Version: 1.0
Received: by 10.66.83.67 with SMTP id o3mr16105788pay.5.1353097147886; Fri, 16
	Nov 2012 12:19:07 -0800 (PST)
Received: by 10.66.189.234 with HTTP; Fri, 16 Nov 2012 12:19:07 -0800 (PST)
In-Reply-To: <50A6843F.5050000@citrix.com>
References: <CAPM9MsQsggsBAL948ZJ31bVnSNH+Q4kGr4d0Na+_RgPBpcgypA@mail.gmail.com>
	<50A6843F.5050000@citrix.com>
Date: Fri, 16 Nov 2012 20:19:07 +0000
Message-ID: <CAPM9MsSrmoG4RLJjNDNn+j=hWuU-r+WbckT-UJXPfJ-J8gbvOQ@mail.gmail.com>
From: "Omer K." <okhalid.cern@gmail.com>
To: Mats Petersson <mats.petersson@citrix.com>
Cc: xen-users list <xen-users@lists.xensource.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] How to activate all VPCUS for a domU?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: okhalid.cern@gmail.com
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6861011683075659954=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6861011683075659954==
Content-Type: multipart/alternative; boundary=f46d042ef49bd8ad6504cea27ab8

--f46d042ef49bd8ad6504cea27ab8
Content-Type: text/plain; charset=UTF-8

Hi,

Apologies for earlier spamming the xen-devel list but this message might be
relevant as I think there is a bug in xm/create.py where 'vcpu_avail'
option doesn't get properly set.

I manage to solve the issue of activating all of the vcpus by apply  a
modified version of the patch earlier discussed:

http://old-list-archives.xen.org/archives/html/xen-users/2010-09/msg00353.html

The following patch fixed the issue for me and after this bitmask value was
activating required vpcu's read from the xen configuration file. Prior to
that, vpcu_avail was always set to '1' (also verified from 'xenstore-ls -f'
output).

--- create.py
+++ create.py.af

         if maxvcpus and vcpus:
             config.append(['vcpus', vcpus])
-            config.append(['vcpu_avail', (1 << vcpus) -1)])
+            config.append(['vcpu_avail', getattr(vals, 'vcpu_avail'])

     def add_conf(n):
         if hasattr(vals, n):

Regards.
Omer


On Fri, Nov 16, 2012 at 6:21 PM, Mats Petersson
<mats.petersson@citrix.com>wrote:

> On 16/11/12 18:09, Omer K. wrote:
>
>> Hi,
>>
>> I have set maxvcpus and vcpus options in my domU configuration file, and
>> I can see that X number of vcpu are set for the domU.
>>
>> I tried to activate all the vpcus by using vpcu_avail option (using
>> decimal to represent vpcu bitmask e.g. 24=11000) but it doesn't seem to
>> work, and only the first vpcu is activated (i.e. has -b- state) while all
>> other vpcu's set for the domU are in the paused state.
>>
>> Can any one share more insights on how to activate all the vpcu's for the
>> guest domain ?
>>
>> Thanks
>>
> This definitely belongs to the Xen-Users list, not on Xen-Devel. Please
> don't post to both lists, it just confuses people.
>
> --
> Mats
>
> ______________________________**_________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>

--f46d042ef49bd8ad6504cea27ab8
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,<br><br>Apologies for earlier spamming the xen-devel list but this messa=
ge might be relevant as I think there is a bug in xm/create.py where &#39;v=
cpu_avail&#39; option doesn&#39;t get properly set.<br><br>I manage to solv=
e the issue of activating all of the vcpus by apply=C2=A0 a modified versio=
n of the patch earlier discussed:<br>
<br><a href=3D"http://old-list-archives.xen.org/archives/html/xen-users/201=
0-09/msg00353.html">http://old-list-archives.xen.org/archives/html/xen-user=
s/2010-09/msg00353.html</a><br><br>The following patch fixed the issue for =
me and after this bitmask value was activating required vpcu&#39;s read fro=
m the xen configuration file. Prior to that, vpcu_avail was always set to &=
#39;1&#39; (also verified from &#39;xenstore-ls -f&#39; output).<br>
<pre>--- create.py  =20
+++ <a href=3D"http://create.py.af">create.py.af</a> =20

         if maxvcpus and vcpus:
             config.append([&#39;vcpus&#39;, vcpus])<br>-            config=
.append([&#39;vcpu_avail&#39;, (1 &lt;&lt; vcpus) -1)])<br>+            con=
fig.append([&#39;vcpu_avail&#39;, getattr(vals, &#39;vcpu_avail&#39;])

     def add_conf(n):
         if hasattr(vals, n):</pre>Regards.<br>Omer<br><div class=3D"gmail_=
extra"><br><br><div class=3D"gmail_quote">On Fri, Nov 16, 2012 at 6:21 PM, =
Mats Petersson <span dir=3D"ltr">&lt;<a href=3D"mailto:mats.petersson@citri=
x.com" target=3D"_blank">mats.petersson@citrix.com</a>&gt;</span> wrote:<br=
>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"HOEnZb"><div class=3D"h5">On 1=
6/11/12 18:09, Omer K. wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I have set maxvcpus and vcpus options in my domU configuration file, and I =
can see that X number of vcpu are set for the domU.<br>
<br>
I tried to activate all the vpcus by using vpcu_avail option (using decimal=
 to represent vpcu bitmask e.g. 24=3D11000) but it doesn&#39;t seem to work=
, and only the first vpcu is activated (i.e. has -b- state) while all other=
 vpcu&#39;s set for the domU are in the paused state.<br>

<br>
Can any one share more insights on how to activate all the vpcu&#39;s for t=
he guest domain ?<br>
<br>
Thanks<br>
</blockquote></div></div>
This definitely belongs to the Xen-Users list, not on Xen-Devel. Please don=
&#39;t post to both lists, it just confuses people.<br>
<br>
--<br>
Mats<br>
<br>
______________________________<u></u>_________________<br>
Xen-devel mailing list<br>
<a href=3D"mailto:Xen-devel@lists.xen.org" target=3D"_blank">Xen-devel@list=
s.xen.org</a><br>
<a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://lists.x=
en.org/xen-devel</a><br>
</blockquote></div><br></div>

--f46d042ef49bd8ad6504cea27ab8--


--===============6861011683075659954==
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.xen.org
http://lists.xen.org/xen-devel

--===============6861011683075659954==--


From xen-devel-bounces@lists.xen.org Fri Nov 16 21:47:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 21:47:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZTkG-00060h-MT; Fri, 16 Nov 2012 21:46:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <alexander.h.duyck@intel.com>) id 1TZTkF-00060c-Ko
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 21:46:39 +0000
Received: from [85.158.139.83:46756] by server-15.bemta-5.messagelabs.com id
	17/65-26920-E34B6A05; Fri, 16 Nov 2012 21:46:38 +0000
X-Env-Sender: alexander.h.duyck@intel.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1353102397!30109613!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjMxNDUz\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8590 invoked from network); 16 Nov 2012 21:46:38 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-13.tower-182.messagelabs.com with SMTP;
	16 Nov 2012 21:46:38 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga101.ch.intel.com with ESMTP; 16 Nov 2012 13:46:35 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,266,1352102400"; d="scan'208";a="218889922"
Received: from ahduyck-cp1.jf.intel.com ([10.23.152.162])
	by azsmga001.ch.intel.com with ESMTP; 16 Nov 2012 13:46:35 -0800
To: jeremy@goop.org, konrad.wilk@oracle.com
From: Alexander Duyck <alexander.h.duyck@intel.com>
Date: Fri, 16 Nov 2012 13:45:25 -0800
Message-ID: <20121116214217.8308.55518.stgit@ahduyck-cp1.jf.intel.com>
User-Agent: StGit/0.16
MIME-Version: 1.0
Cc: linux-kernel@vger.kernel.org, x86@kernel.org, xen-devel@lists.xensource.com,
	virtualization@lists.linux-foundation.org
Subject: [Xen-devel] [PATCH v4] x86/xen: Use __pa_symbol instead of __pa on
 C visible symbols
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This change updates a few of the functions to use __pa_symbol when
translating C visible symbols instead of __pa.  By using __pa_symbol we are
able to drop a few extra lines of code as don't have to test to see if the
virtual pointer is a part of the kernel text or just standard virtual memory.

Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
---

v4:  I have spun this patch off as a separate patch for v4 due to the fact that
     this patch doesn't apply cleanly to Linus's tree.  As such I am
     submitting it based off of the linux-next tree to be accepted in the Xen
     tree since this patch can actually exist on its own without the need
     for the other patches in the original __phys_addr performance series.

 arch/x86/xen/mmu.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 4a05b39..a63e5f9 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -1486,7 +1486,8 @@ static int xen_pgd_alloc(struct mm_struct *mm)
 
 		if (user_pgd != NULL) {
 			user_pgd[pgd_index(VSYSCALL_START)] =
-				__pgd(__pa(level3_user_vsyscall) | _PAGE_TABLE);
+				__pgd(__pa_symbol(level3_user_vsyscall) |
+				      _PAGE_TABLE);
 			ret = 0;
 		}
 
@@ -1958,10 +1959,10 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
 	 * pgd.
 	 */
 	if (xen_feature(XENFEAT_writable_page_tables)) {
-		native_write_cr3(__pa(init_level4_pgt));
+		native_write_cr3(__pa_symbol(init_level4_pgt));
 	} else {
 		xen_mc_batch();
-		__xen_write_cr3(true, __pa(init_level4_pgt));
+		__xen_write_cr3(true, __pa_symbol(init_level4_pgt));
 		xen_mc_issue(PARAVIRT_LAZY_CPU);
 	}
 	/* We can't that easily rip out L3 and L2, as the Xen pagetables are
@@ -1984,10 +1985,10 @@ static RESERVE_BRK_ARRAY(pmd_t, swapper_kernel_pmd, PTRS_PER_PMD);
 
 static void __init xen_write_cr3_init(unsigned long cr3)
 {
-	unsigned long pfn = PFN_DOWN(__pa(swapper_pg_dir));
+	unsigned long pfn = PFN_DOWN(__pa_symbol(swapper_pg_dir));
 
-	BUG_ON(read_cr3() != __pa(initial_page_table));
-	BUG_ON(cr3 != __pa(swapper_pg_dir));
+	BUG_ON(read_cr3() != __pa_symbol(initial_page_table));
+	BUG_ON(cr3 != __pa_symbol(swapper_pg_dir));
 
 	/*
 	 * We are switching to swapper_pg_dir for the first time (from
@@ -2011,7 +2012,7 @@ static void __init xen_write_cr3_init(unsigned long cr3)
 	pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, pfn);
 
 	pin_pagetable_pfn(MMUEXT_UNPIN_TABLE,
-			  PFN_DOWN(__pa(initial_page_table)));
+			  PFN_DOWN(__pa_symbol(initial_page_table)));
 	set_page_prot(initial_page_table, PAGE_KERNEL);
 	set_page_prot(initial_kernel_pmd, PAGE_KERNEL);
 
@@ -2036,7 +2037,7 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
 
 	copy_page(initial_page_table, pgd);
 	initial_page_table[KERNEL_PGD_BOUNDARY] =
-		__pgd(__pa(initial_kernel_pmd) | _PAGE_PRESENT);
+		__pgd(__pa_symbol(initial_kernel_pmd) | _PAGE_PRESENT);
 
 	set_page_prot(initial_kernel_pmd, PAGE_KERNEL_RO);
 	set_page_prot(initial_page_table, PAGE_KERNEL_RO);
@@ -2045,8 +2046,8 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
 	pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd)));
 
 	pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE,
-			  PFN_DOWN(__pa(initial_page_table)));
-	xen_write_cr3(__pa(initial_page_table));
+			  PFN_DOWN(__pa_symbol(initial_page_table)));
+	xen_write_cr3(__pa_symbol(initial_page_table));
 
 	memblock_reserve(__pa(xen_start_info->pt_base),
 			 xen_start_info->nr_pt_frames * PAGE_SIZE);


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 16 21:47:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Nov 2012 21:47:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZTkG-00060h-MT; Fri, 16 Nov 2012 21:46:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <alexander.h.duyck@intel.com>) id 1TZTkF-00060c-Ko
	for xen-devel@lists.xensource.com; Fri, 16 Nov 2012 21:46:39 +0000
Received: from [85.158.139.83:46756] by server-15.bemta-5.messagelabs.com id
	17/65-26920-E34B6A05; Fri, 16 Nov 2012 21:46:38 +0000
X-Env-Sender: alexander.h.duyck@intel.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1353102397!30109613!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjMxNDUz\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8590 invoked from network); 16 Nov 2012 21:46:38 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-13.tower-182.messagelabs.com with SMTP;
	16 Nov 2012 21:46:38 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga101.ch.intel.com with ESMTP; 16 Nov 2012 13:46:35 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,266,1352102400"; d="scan'208";a="218889922"
Received: from ahduyck-cp1.jf.intel.com ([10.23.152.162])
	by azsmga001.ch.intel.com with ESMTP; 16 Nov 2012 13:46:35 -0800
To: jeremy@goop.org, konrad.wilk@oracle.com
From: Alexander Duyck <alexander.h.duyck@intel.com>
Date: Fri, 16 Nov 2012 13:45:25 -0800
Message-ID: <20121116214217.8308.55518.stgit@ahduyck-cp1.jf.intel.com>
User-Agent: StGit/0.16
MIME-Version: 1.0
Cc: linux-kernel@vger.kernel.org, x86@kernel.org, xen-devel@lists.xensource.com,
	virtualization@lists.linux-foundation.org
Subject: [Xen-devel] [PATCH v4] x86/xen: Use __pa_symbol instead of __pa on
 C visible symbols
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This change updates a few of the functions to use __pa_symbol when
translating C visible symbols instead of __pa.  By using __pa_symbol we are
able to drop a few extra lines of code as don't have to test to see if the
virtual pointer is a part of the kernel text or just standard virtual memory.

Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
---

v4:  I have spun this patch off as a separate patch for v4 due to the fact that
     this patch doesn't apply cleanly to Linus's tree.  As such I am
     submitting it based off of the linux-next tree to be accepted in the Xen
     tree since this patch can actually exist on its own without the need
     for the other patches in the original __phys_addr performance series.

 arch/x86/xen/mmu.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 4a05b39..a63e5f9 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -1486,7 +1486,8 @@ static int xen_pgd_alloc(struct mm_struct *mm)
 
 		if (user_pgd != NULL) {
 			user_pgd[pgd_index(VSYSCALL_START)] =
-				__pgd(__pa(level3_user_vsyscall) | _PAGE_TABLE);
+				__pgd(__pa_symbol(level3_user_vsyscall) |
+				      _PAGE_TABLE);
 			ret = 0;
 		}
 
@@ -1958,10 +1959,10 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
 	 * pgd.
 	 */
 	if (xen_feature(XENFEAT_writable_page_tables)) {
-		native_write_cr3(__pa(init_level4_pgt));
+		native_write_cr3(__pa_symbol(init_level4_pgt));
 	} else {
 		xen_mc_batch();
-		__xen_write_cr3(true, __pa(init_level4_pgt));
+		__xen_write_cr3(true, __pa_symbol(init_level4_pgt));
 		xen_mc_issue(PARAVIRT_LAZY_CPU);
 	}
 	/* We can't that easily rip out L3 and L2, as the Xen pagetables are
@@ -1984,10 +1985,10 @@ static RESERVE_BRK_ARRAY(pmd_t, swapper_kernel_pmd, PTRS_PER_PMD);
 
 static void __init xen_write_cr3_init(unsigned long cr3)
 {
-	unsigned long pfn = PFN_DOWN(__pa(swapper_pg_dir));
+	unsigned long pfn = PFN_DOWN(__pa_symbol(swapper_pg_dir));
 
-	BUG_ON(read_cr3() != __pa(initial_page_table));
-	BUG_ON(cr3 != __pa(swapper_pg_dir));
+	BUG_ON(read_cr3() != __pa_symbol(initial_page_table));
+	BUG_ON(cr3 != __pa_symbol(swapper_pg_dir));
 
 	/*
 	 * We are switching to swapper_pg_dir for the first time (from
@@ -2011,7 +2012,7 @@ static void __init xen_write_cr3_init(unsigned long cr3)
 	pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, pfn);
 
 	pin_pagetable_pfn(MMUEXT_UNPIN_TABLE,
-			  PFN_DOWN(__pa(initial_page_table)));
+			  PFN_DOWN(__pa_symbol(initial_page_table)));
 	set_page_prot(initial_page_table, PAGE_KERNEL);
 	set_page_prot(initial_kernel_pmd, PAGE_KERNEL);
 
@@ -2036,7 +2037,7 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
 
 	copy_page(initial_page_table, pgd);
 	initial_page_table[KERNEL_PGD_BOUNDARY] =
-		__pgd(__pa(initial_kernel_pmd) | _PAGE_PRESENT);
+		__pgd(__pa_symbol(initial_kernel_pmd) | _PAGE_PRESENT);
 
 	set_page_prot(initial_kernel_pmd, PAGE_KERNEL_RO);
 	set_page_prot(initial_page_table, PAGE_KERNEL_RO);
@@ -2045,8 +2046,8 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
 	pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd)));
 
 	pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE,
-			  PFN_DOWN(__pa(initial_page_table)));
-	xen_write_cr3(__pa(initial_page_table));
+			  PFN_DOWN(__pa_symbol(initial_page_table)));
+	xen_write_cr3(__pa_symbol(initial_page_table));
 
 	memblock_reserve(__pa(xen_start_info->pt_base),
 			 xen_start_info->nr_pt_frames * PAGE_SIZE);


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 17 00:23:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Nov 2012 00:23:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZWBo-0007jK-Qc; Sat, 17 Nov 2012 00:23:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZWBn-0007jF-2R
	for xen-devel@lists.xensource.com; Sat, 17 Nov 2012 00:23:15 +0000
Received: from [85.158.139.211:17494] by server-10.bemta-5.messagelabs.com id
	15/CA-09257-2F8D6A05; Sat, 17 Nov 2012 00:23:14 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353111792!20520202!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTg3NzM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22139 invoked from network); 17 Nov 2012 00:23:13 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 17 Nov 2012 00:23:13 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAH0N0fj020183
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Sat, 17 Nov 2012 00:23:03 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAH0MuSv021001
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 17 Nov 2012 00:22:58 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAH0Mqgq012277; Fri, 16 Nov 2012 18:22:52 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 16:22:52 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id C2DBF40C16; Fri, 16 Nov 2012 19:22:48 -0500 (EST)
Date: Fri, 16 Nov 2012 19:22:48 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Alexander Duyck <alexander.h.duyck@intel.com>
Message-ID: <20121117002248.GA7124@phenom.dumpdata.com>
References: <20121116214217.8308.55518.stgit@ahduyck-cp1.jf.intel.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121116214217.8308.55518.stgit@ahduyck-cp1.jf.intel.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: linux-kernel@vger.kernel.org, jeremy@goop.org, x86@kernel.org,
	xen-devel@lists.xensource.com, virtualization@lists.linux-foundation.org
Subject: Re: [Xen-devel] [PATCH v4] x86/xen: Use __pa_symbol instead of __pa
 on C visible symbols
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 16, 2012 at 01:45:25PM -0800, Alexander Duyck wrote:
> This change updates a few of the functions to use __pa_symbol when
> translating C visible symbols instead of __pa.  By using __pa_symbol we are
> able to drop a few extra lines of code as don't have to test to see if the
> virtual pointer is a part of the kernel text or just standard virtual memory.
> 
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> ---
> 
> v4:  I have spun this patch off as a separate patch for v4 due to the fact that
>      this patch doesn't apply cleanly to Linus's tree.  As such I am
>      submitting it based off of the linux-next tree to be accepted in the Xen
>      tree since this patch can actually exist on its own without the need
>      for the other patches in the original __phys_addr performance series.

OK, let me stick it in my tree then.

> 
>  arch/x86/xen/mmu.c |   21 +++++++++++----------
>  1 files changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
> index 4a05b39..a63e5f9 100644
> --- a/arch/x86/xen/mmu.c
> +++ b/arch/x86/xen/mmu.c
> @@ -1486,7 +1486,8 @@ static int xen_pgd_alloc(struct mm_struct *mm)
>  
>  		if (user_pgd != NULL) {
>  			user_pgd[pgd_index(VSYSCALL_START)] =
> -				__pgd(__pa(level3_user_vsyscall) | _PAGE_TABLE);
> +				__pgd(__pa_symbol(level3_user_vsyscall) |
> +				      _PAGE_TABLE);
>  			ret = 0;
>  		}
>  
> @@ -1958,10 +1959,10 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
>  	 * pgd.
>  	 */
>  	if (xen_feature(XENFEAT_writable_page_tables)) {
> -		native_write_cr3(__pa(init_level4_pgt));
> +		native_write_cr3(__pa_symbol(init_level4_pgt));
>  	} else {
>  		xen_mc_batch();
> -		__xen_write_cr3(true, __pa(init_level4_pgt));
> +		__xen_write_cr3(true, __pa_symbol(init_level4_pgt));
>  		xen_mc_issue(PARAVIRT_LAZY_CPU);
>  	}
>  	/* We can't that easily rip out L3 and L2, as the Xen pagetables are
> @@ -1984,10 +1985,10 @@ static RESERVE_BRK_ARRAY(pmd_t, swapper_kernel_pmd, PTRS_PER_PMD);
>  
>  static void __init xen_write_cr3_init(unsigned long cr3)
>  {
> -	unsigned long pfn = PFN_DOWN(__pa(swapper_pg_dir));
> +	unsigned long pfn = PFN_DOWN(__pa_symbol(swapper_pg_dir));
>  
> -	BUG_ON(read_cr3() != __pa(initial_page_table));
> -	BUG_ON(cr3 != __pa(swapper_pg_dir));
> +	BUG_ON(read_cr3() != __pa_symbol(initial_page_table));
> +	BUG_ON(cr3 != __pa_symbol(swapper_pg_dir));
>  
>  	/*
>  	 * We are switching to swapper_pg_dir for the first time (from
> @@ -2011,7 +2012,7 @@ static void __init xen_write_cr3_init(unsigned long cr3)
>  	pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, pfn);
>  
>  	pin_pagetable_pfn(MMUEXT_UNPIN_TABLE,
> -			  PFN_DOWN(__pa(initial_page_table)));
> +			  PFN_DOWN(__pa_symbol(initial_page_table)));
>  	set_page_prot(initial_page_table, PAGE_KERNEL);
>  	set_page_prot(initial_kernel_pmd, PAGE_KERNEL);
>  
> @@ -2036,7 +2037,7 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
>  
>  	copy_page(initial_page_table, pgd);
>  	initial_page_table[KERNEL_PGD_BOUNDARY] =
> -		__pgd(__pa(initial_kernel_pmd) | _PAGE_PRESENT);
> +		__pgd(__pa_symbol(initial_kernel_pmd) | _PAGE_PRESENT);
>  
>  	set_page_prot(initial_kernel_pmd, PAGE_KERNEL_RO);
>  	set_page_prot(initial_page_table, PAGE_KERNEL_RO);
> @@ -2045,8 +2046,8 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
>  	pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd)));
>  
>  	pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE,
> -			  PFN_DOWN(__pa(initial_page_table)));
> -	xen_write_cr3(__pa(initial_page_table));
> +			  PFN_DOWN(__pa_symbol(initial_page_table)));
> +	xen_write_cr3(__pa_symbol(initial_page_table));
>  
>  	memblock_reserve(__pa(xen_start_info->pt_base),
>  			 xen_start_info->nr_pt_frames * PAGE_SIZE);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 17 00:23:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Nov 2012 00:23:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZWBo-0007jK-Qc; Sat, 17 Nov 2012 00:23:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TZWBn-0007jF-2R
	for xen-devel@lists.xensource.com; Sat, 17 Nov 2012 00:23:15 +0000
Received: from [85.158.139.211:17494] by server-10.bemta-5.messagelabs.com id
	15/CA-09257-2F8D6A05; Sat, 17 Nov 2012 00:23:14 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353111792!20520202!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTg3NzM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22139 invoked from network); 17 Nov 2012 00:23:13 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 17 Nov 2012 00:23:13 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAH0N0fj020183
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Sat, 17 Nov 2012 00:23:03 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAH0MuSv021001
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 17 Nov 2012 00:22:58 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAH0Mqgq012277; Fri, 16 Nov 2012 18:22:52 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 16:22:52 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id C2DBF40C16; Fri, 16 Nov 2012 19:22:48 -0500 (EST)
Date: Fri, 16 Nov 2012 19:22:48 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Alexander Duyck <alexander.h.duyck@intel.com>
Message-ID: <20121117002248.GA7124@phenom.dumpdata.com>
References: <20121116214217.8308.55518.stgit@ahduyck-cp1.jf.intel.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121116214217.8308.55518.stgit@ahduyck-cp1.jf.intel.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: linux-kernel@vger.kernel.org, jeremy@goop.org, x86@kernel.org,
	xen-devel@lists.xensource.com, virtualization@lists.linux-foundation.org
Subject: Re: [Xen-devel] [PATCH v4] x86/xen: Use __pa_symbol instead of __pa
 on C visible symbols
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 16, 2012 at 01:45:25PM -0800, Alexander Duyck wrote:
> This change updates a few of the functions to use __pa_symbol when
> translating C visible symbols instead of __pa.  By using __pa_symbol we are
> able to drop a few extra lines of code as don't have to test to see if the
> virtual pointer is a part of the kernel text or just standard virtual memory.
> 
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> ---
> 
> v4:  I have spun this patch off as a separate patch for v4 due to the fact that
>      this patch doesn't apply cleanly to Linus's tree.  As such I am
>      submitting it based off of the linux-next tree to be accepted in the Xen
>      tree since this patch can actually exist on its own without the need
>      for the other patches in the original __phys_addr performance series.

OK, let me stick it in my tree then.

> 
>  arch/x86/xen/mmu.c |   21 +++++++++++----------
>  1 files changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
> index 4a05b39..a63e5f9 100644
> --- a/arch/x86/xen/mmu.c
> +++ b/arch/x86/xen/mmu.c
> @@ -1486,7 +1486,8 @@ static int xen_pgd_alloc(struct mm_struct *mm)
>  
>  		if (user_pgd != NULL) {
>  			user_pgd[pgd_index(VSYSCALL_START)] =
> -				__pgd(__pa(level3_user_vsyscall) | _PAGE_TABLE);
> +				__pgd(__pa_symbol(level3_user_vsyscall) |
> +				      _PAGE_TABLE);
>  			ret = 0;
>  		}
>  
> @@ -1958,10 +1959,10 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
>  	 * pgd.
>  	 */
>  	if (xen_feature(XENFEAT_writable_page_tables)) {
> -		native_write_cr3(__pa(init_level4_pgt));
> +		native_write_cr3(__pa_symbol(init_level4_pgt));
>  	} else {
>  		xen_mc_batch();
> -		__xen_write_cr3(true, __pa(init_level4_pgt));
> +		__xen_write_cr3(true, __pa_symbol(init_level4_pgt));
>  		xen_mc_issue(PARAVIRT_LAZY_CPU);
>  	}
>  	/* We can't that easily rip out L3 and L2, as the Xen pagetables are
> @@ -1984,10 +1985,10 @@ static RESERVE_BRK_ARRAY(pmd_t, swapper_kernel_pmd, PTRS_PER_PMD);
>  
>  static void __init xen_write_cr3_init(unsigned long cr3)
>  {
> -	unsigned long pfn = PFN_DOWN(__pa(swapper_pg_dir));
> +	unsigned long pfn = PFN_DOWN(__pa_symbol(swapper_pg_dir));
>  
> -	BUG_ON(read_cr3() != __pa(initial_page_table));
> -	BUG_ON(cr3 != __pa(swapper_pg_dir));
> +	BUG_ON(read_cr3() != __pa_symbol(initial_page_table));
> +	BUG_ON(cr3 != __pa_symbol(swapper_pg_dir));
>  
>  	/*
>  	 * We are switching to swapper_pg_dir for the first time (from
> @@ -2011,7 +2012,7 @@ static void __init xen_write_cr3_init(unsigned long cr3)
>  	pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, pfn);
>  
>  	pin_pagetable_pfn(MMUEXT_UNPIN_TABLE,
> -			  PFN_DOWN(__pa(initial_page_table)));
> +			  PFN_DOWN(__pa_symbol(initial_page_table)));
>  	set_page_prot(initial_page_table, PAGE_KERNEL);
>  	set_page_prot(initial_kernel_pmd, PAGE_KERNEL);
>  
> @@ -2036,7 +2037,7 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
>  
>  	copy_page(initial_page_table, pgd);
>  	initial_page_table[KERNEL_PGD_BOUNDARY] =
> -		__pgd(__pa(initial_kernel_pmd) | _PAGE_PRESENT);
> +		__pgd(__pa_symbol(initial_kernel_pmd) | _PAGE_PRESENT);
>  
>  	set_page_prot(initial_kernel_pmd, PAGE_KERNEL_RO);
>  	set_page_prot(initial_page_table, PAGE_KERNEL_RO);
> @@ -2045,8 +2046,8 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
>  	pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd)));
>  
>  	pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE,
> -			  PFN_DOWN(__pa(initial_page_table)));
> -	xen_write_cr3(__pa(initial_page_table));
> +			  PFN_DOWN(__pa_symbol(initial_page_table)));
> +	xen_write_cr3(__pa_symbol(initial_page_table));
>  
>  	memblock_reserve(__pa(xen_start_info->pt_base),
>  			 xen_start_info->nr_pt_frames * PAGE_SIZE);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 17 00:45:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Nov 2012 00:45:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZWWh-0008DS-Bc; Sat, 17 Nov 2012 00:44:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZWWf-0008DN-PI
	for xen-devel@lists.xensource.com; Sat, 17 Nov 2012 00:44:50 +0000
Received: from [85.158.137.99:22523] by server-11.bemta-3.messagelabs.com id
	25/D7-19361-CFDD6A05; Sat, 17 Nov 2012 00:44:44 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1353113080!19336830!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2263 invoked from network); 17 Nov 2012 00:44:41 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	17 Nov 2012 00:44:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15859153"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 22:56:37 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 22:56:37 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TZUpx-00038i-1y;
	Fri, 16 Nov 2012 22:56:37 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TZUpw-0005QS-TQ;
	Fri, 16 Nov 2012 22:56:36 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14412-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 16 Nov 2012 22:56:36 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14412: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14412 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14412/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14401
 test-amd64-amd64-xl-sedf     11 guest-localmigrate           fail   like 14401

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  9 guest-localmigrate         fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  7c4d806b3753
baseline version:
 xen                  003ac445eae6

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jim Fehlig <jfehlig@suse.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.2-testing
+ revision=7c4d806b3753
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.2-testing 7c4d806b3753
+ branch=xen-4.2-testing
+ revision=7c4d806b3753
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.2-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.2-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
++ : daily-cron.xen-4.2-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.2-testing.git
+ info_linux_tree xen-4.2-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.2-testing.hg
+ hg push -r 7c4d806b3753 ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 17 00:45:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Nov 2012 00:45:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZWWh-0008DS-Bc; Sat, 17 Nov 2012 00:44:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZWWf-0008DN-PI
	for xen-devel@lists.xensource.com; Sat, 17 Nov 2012 00:44:50 +0000
Received: from [85.158.137.99:22523] by server-11.bemta-3.messagelabs.com id
	25/D7-19361-CFDD6A05; Sat, 17 Nov 2012 00:44:44 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1353113080!19336830!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2263 invoked from network); 17 Nov 2012 00:44:41 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	17 Nov 2012 00:44:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,266,1352073600"; d="scan'208";a="15859153"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	16 Nov 2012 22:56:37 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 16 Nov 2012 22:56:37 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TZUpx-00038i-1y;
	Fri, 16 Nov 2012 22:56:37 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TZUpw-0005QS-TQ;
	Fri, 16 Nov 2012 22:56:36 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14412-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 16 Nov 2012 22:56:36 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14412: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14412 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14412/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14401
 test-amd64-amd64-xl-sedf     11 guest-localmigrate           fail   like 14401

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  9 guest-localmigrate         fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  7c4d806b3753
baseline version:
 xen                  003ac445eae6

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jim Fehlig <jfehlig@suse.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.2-testing
+ revision=7c4d806b3753
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.2-testing 7c4d806b3753
+ branch=xen-4.2-testing
+ revision=7c4d806b3753
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.2-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.2-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
++ : daily-cron.xen-4.2-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.2-testing.git
+ info_linux_tree xen-4.2-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.2-testing.hg
+ hg push -r 7c4d806b3753 ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 17 04:40:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Nov 2012 04:40:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZaBv-0006J1-Tr; Sat, 17 Nov 2012 04:39:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZaBt-0006Iw-UF
	for xen-devel@lists.xensource.com; Sat, 17 Nov 2012 04:39:38 +0000
Received: from [85.158.138.51:7631] by server-2.bemta-3.messagelabs.com id
	07/E4-04744-90517A05; Sat, 17 Nov 2012 04:39:37 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353127175!22343114!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTg3NzM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8569 invoked from network); 17 Nov 2012 04:39:36 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 17 Nov 2012 04:39:36 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAH4dWgt032408
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Sat, 17 Nov 2012 04:39:33 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAH4dWsG009963
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 17 Nov 2012 04:39:32 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAH4dVOm028268; Fri, 16 Nov 2012 22:39:31 -0600
Received: from [10.191.6.177] (/10.191.6.177)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 20:39:31 -0800
Message-ID: <50A714F9.4040206@oracle.com>
Date: Sat, 17 Nov 2012 12:39:21 +0800
From: annie li <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>	
	<1353059821.3499.190.camel@zakaz.uk.xensource.com>	
	<50A6255C.10108@oracle.com>
	<1353066382.3499.227.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353066382.3499.227.camel@zakaz.uk.xensource.com>
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-16 19:46, Ian Campbell wrote:
>
> It seems like having netfront simply allocate itself a pool of grant
> references which it reuses would give equivalent benefits whilst being a
> smaller patch, with no protocol change and avoiding double copying. In
> fact by avoiding the double copy I'd expect it to be even better.
>
>   

OK, I can try this implementation.
And I'd better to compare the performance between double copy and this 
implementation to see how much grant lock affects grant copy too.

> I think you need to measure both dom0->domU and domU->dom0 to get the
> full picture since AIUI netperf sends the bulk data in only one
> direction with just ACKs coming back the other way.
>   
Yes.
My environment does not meet requirement of more VMs, I would do more 
thorough test after Konrad setups the environment.

Thanks
Annie

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 17 04:40:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Nov 2012 04:40:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZaBv-0006J1-Tr; Sat, 17 Nov 2012 04:39:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1TZaBt-0006Iw-UF
	for xen-devel@lists.xensource.com; Sat, 17 Nov 2012 04:39:38 +0000
Received: from [85.158.138.51:7631] by server-2.bemta-3.messagelabs.com id
	07/E4-04744-90517A05; Sat, 17 Nov 2012 04:39:37 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353127175!22343114!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNTg3NzM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8569 invoked from network); 17 Nov 2012 04:39:36 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 17 Nov 2012 04:39:36 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAH4dWgt032408
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Sat, 17 Nov 2012 04:39:33 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAH4dWsG009963
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 17 Nov 2012 04:39:32 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAH4dVOm028268; Fri, 16 Nov 2012 22:39:31 -0600
Received: from [10.191.6.177] (/10.191.6.177)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 16 Nov 2012 20:39:31 -0800
Message-ID: <50A714F9.4040206@oracle.com>
Date: Sat, 17 Nov 2012 12:39:21 +0800
From: annie li <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352962987-541-1-git-send-email-annie.li@oracle.com>	
	<1353059821.3499.190.camel@zakaz.uk.xensource.com>	
	<50A6255C.10108@oracle.com>
	<1353066382.3499.227.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353066382.3499.227.camel@zakaz.uk.xensource.com>
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 0/4] Implement persistent grant in
	xen-netfront/netback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-16 19:46, Ian Campbell wrote:
>
> It seems like having netfront simply allocate itself a pool of grant
> references which it reuses would give equivalent benefits whilst being a
> smaller patch, with no protocol change and avoiding double copying. In
> fact by avoiding the double copy I'd expect it to be even better.
>
>   

OK, I can try this implementation.
And I'd better to compare the performance between double copy and this 
implementation to see how much grant lock affects grant copy too.

> I think you need to measure both dom0->domU and domU->dom0 to get the
> full picture since AIUI netperf sends the bulk data in only one
> direction with just ACKs coming back the other way.
>   
Yes.
My environment does not meet requirement of more VMs, I would do more 
thorough test after Konrad setups the environment.

Thanks
Annie

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 17 05:31:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Nov 2012 05:31:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZazd-0006ze-DS; Sat, 17 Nov 2012 05:31:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZazc-0006zZ-00
	for xen-devel@lists.xensource.com; Sat, 17 Nov 2012 05:31:00 +0000
Received: from [85.158.138.51:21929] by server-11.bemta-3.messagelabs.com id
	3F/6C-19361-E0127A05; Sat, 17 Nov 2012 05:30:54 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353130253!30327270!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22620 invoked from network); 17 Nov 2012 05:30:53 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	17 Nov 2012 05:30:53 -0000
X-IronPort-AV: E=Sophos;i="4.83,268,1352073600"; d="scan'208";a="15859971"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	17 Nov 2012 05:30:52 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sat, 17 Nov 2012 05:30:52 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TZazU-0005TA-M8;
	Sat, 17 Nov 2012 05:30:52 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TZazU-00021o-Br;
	Sat, 17 Nov 2012 05:30:52 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14413-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sat, 17 Nov 2012 05:30:52 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14413: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14413 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14413/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-qemuu-rhel6hvm-intel 11 leak-check/check    fail pass in 14411

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14411
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14411
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14411
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14411

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  321f8487379b
baseline version:
 xen                  321f8487379b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         fail    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 17 05:31:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Nov 2012 05:31:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZazd-0006ze-DS; Sat, 17 Nov 2012 05:31:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZazc-0006zZ-00
	for xen-devel@lists.xensource.com; Sat, 17 Nov 2012 05:31:00 +0000
Received: from [85.158.138.51:21929] by server-11.bemta-3.messagelabs.com id
	3F/6C-19361-E0127A05; Sat, 17 Nov 2012 05:30:54 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353130253!30327270!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22620 invoked from network); 17 Nov 2012 05:30:53 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	17 Nov 2012 05:30:53 -0000
X-IronPort-AV: E=Sophos;i="4.83,268,1352073600"; d="scan'208";a="15859971"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	17 Nov 2012 05:30:52 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sat, 17 Nov 2012 05:30:52 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TZazU-0005TA-M8;
	Sat, 17 Nov 2012 05:30:52 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TZazU-00021o-Br;
	Sat, 17 Nov 2012 05:30:52 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14413-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sat, 17 Nov 2012 05:30:52 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14413: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14413 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14413/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-qemuu-rhel6hvm-intel 11 leak-check/check    fail pass in 14411

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14411
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14411
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14411
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14411

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  321f8487379b
baseline version:
 xen                  321f8487379b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         fail    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 17 14:14:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Nov 2012 14:14:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZjA2-000319-1S; Sat, 17 Nov 2012 14:14:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TZjA0-000314-Dc
	for xen-devel@lists.xen.org; Sat, 17 Nov 2012 14:14:16 +0000
Received: from [193.109.254.147:53555] by server-15.bemta-14.messagelabs.com
	id 84/7C-12105-7BB97A05; Sat, 17 Nov 2012 14:14:15 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1353161653!9456577!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4MjQ2MQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15856 invoked from network); 17 Nov 2012 14:14:14 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-9.tower-27.messagelabs.com with SMTP;
	17 Nov 2012 14:14:14 -0000
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
	by fmsmga102.fm.intel.com with ESMTP; 17 Nov 2012 06:14:13 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,270,1352102400"; d="scan'208";a="250674677"
Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35])
	by fmsmga002.fm.intel.com with ESMTP; 17 Nov 2012 06:14:12 -0800
Received: from fmsmsx151.amr.corp.intel.com (10.19.17.220) by
	FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Sat, 17 Nov 2012 06:14:12 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX151.amr.corp.intel.com (10.19.17.220) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Sat, 17 Nov 2012 06:14:12 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Sat, 17 Nov 2012 22:14:10 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, Sander Eikelenboom
	<linux@eikelenboom.it>
Thread-Topic: [ 3009.778974] mcelog:16842 map pfn expected mapping type
	write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus
Thread-Index: AQHNxBuu15VBKwan9ka7+XGDG79Vd5fuEt6g
Date: Sat, 17 Nov 2012 14:14:10 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233538E31B@SHSMSX101.ccr.corp.intel.com>
References: <791265057.20121116134056@eikelenboom.it>
	<20121116160733.GO22320@phenom.dumpdata.com>
	<1422434855.20121116174754@eikelenboom.it>
	<20121116165834.GA18725@phenom.dumpdata.com>
In-Reply-To: <20121116165834.GA18725@phenom.dumpdata.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [ 3009.778974] mcelog:16842 map pfn expected
 mapping type write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Konrad Rzeszutek Wilk wrote:
> On Fri, Nov 16, 2012 at 05:47:54PM +0100, Sander Eikelenboom wrote:
>> 
>> Friday, November 16, 2012, 5:07:33 PM, you wrote:
>> 
>>> On Fri, Nov 16, 2012 at 01:40:56PM +0100, Sander Eikelenboom wrote:
>>>> Hi Konrad,
>>>> 
>>>> Sometime ago i reported this one at boot up:
>>>> 
>>>> [ 3009.778974] mcelog:16842 map pfn expected mapping type
>>>> write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus [
>>>> 3009.788570] ------------[ cut here ]------------ [ 3009.798175]
>>>> WARNING: at arch/x86/mm/pat.c:774 untrack_pfn+0xa1/0xb0() [
>>>> 3009.807966] Hardware name: MS-7640 [ 3009.817677] Modules linked
>>>> in: [ 3009.827524] Pid: 16842, comm: mcelog Tainted: G        W   
>>>> 3.7.0-rc5-20121116-reverted-persistent-warn-patwarn #1 [
>>>> 3009.837415] Call Trace: [ 3009.847110]  [<ffffffff810674fa>]
>>>> warn_slowpath_common+0x7a/0xb0 [ 3009.856857] 
>>>> [<ffffffff81067545>] warn_slowpath_null+0x15/0x20 [ 3009.866562] 
>>>> [<ffffffff81042041>] untrack_pfn+0xa1/0xb0 [ 3009.876201] 
>>>> [<ffffffff8111a59b>] unmap_single_vma+0x86b/0x8e0 [ 3009.885895] 
>>>> [<ffffffff81100f16>] ? release_pages+0x196/0x1f0 [ 3009.895488] 
>>>> [<ffffffff8111a65c>] unmap_vmas+0x4c/0xa0 [ 3009.905134] 
>>>> [<ffffffff8111c8fa>] exit_mmap+0x9a/0x180 [ 3009.914706] 
>>>> [<ffffffff81064e72>] mmput+0x52/0xd0 [ 3009.924252] 
>>>> [<ffffffff810652b7>] dup_mm+0x3c7/0x510 [ 3009.933839] 
>>>> [<ffffffff81065fd5>] copy_process+0xac5/0x14a0 [ 3009.943430] 
>>>> [<ffffffff81066af3>] do_fork+0x53/0x360 [ 3009.952843] 
>>>> [<ffffffff810b25c7>] ? lock_release+0x117/0x250 [ 3009.962283] 
>>>> [<ffffffff817d26c0>] ? _raw_spin_unlock+0x30/0x60 [ 3009.971532] 
>>>> [<ffffffff817d3495>] ? sysret_check+0x22/0x5d [ 3009.980820] 
>>>> [<ffffffff81017523>] sys_clone+0x23/0x30 [ 3009.990046] 
>>>> [<ffffffff817d37f3>] stub_clone+0x13/0x20 [ 3009.999335] 
>>>> [<ffffffff817d3469>] ? system_call_fastpath+0x16/0x1b [
>>>> 3010.008667] ---[ end trace 2d9694c2c0a24da8 ]---  
>>>> 
>>>> 
>>>> It seems to be due to the "mcelog" userspace tool provided with
>>>> Debian Squeeze (mcelog 1.0~pre3-3  x86-64 Machine Check Exceptions
>>>> collector and decoder). I can trigger this warning easily by
>>>> restarting the mcelog tool with /etc/init.d/mcelog restart  
>>>> 
>>>> Should that one also function with the xen mcelog driver, or is a
>>>> newer version required ? 
>> 
>>> The reason we get is b/c I had to disable the PAT functionality in
>>> the Linux kernel for Xen. This is b/c it only worked one way -
>>> meaning you could convert a page from 
>>> WriteBack to WriteCombine or WriteBack to Uncached. But you could
>>> not 
>>> do WriteCombine back to WriteBack - due to one of the functions that
>>> changes the bits was using an "unfiltered" way to identify the bits
>>> on the 
>>> page.
>> 
>>> Anyhow, we had a disaster b/c some of these pages that used to
>>> WriteBack (WB) 
>>> got converted to WriteCombine (WC) and then were returned back as
>>> such 
>>> to the page pool. And if they were re-used by filesystem invariably
>>> we got 
>>> corruptions.
>> 
>>> So until the PAT table lookup thing that Peter H. Anvin suggested
>>> gets implemented this splat gotta show up :-(
>> 
>> Not a big problem for me, i was just wondering :-)
>> I'm more interested in the netfront troubles, since it's already rc5.
>> 
>>> Does mcelog still work even with this warning?
>> 
>> Not the daemon:
>> 
>> serveerstertje:~# sh /etc/init.d/mcelog start
>> Starting Machine Check Exceptions decoder: daemon: Cannot allocate
>> memory 
>> 
> Ugh.
> CC-ing Liu here.
> 

How to reproduce it (sorry I miss the history of this thread)?
I have a try at Xen side, w/ kernel 3.6.0-rc7+, no problem at my side.

Thanks,
Jinsong

>> 
>>>> 
>>>> --
>>>> Sander


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 17 14:14:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Nov 2012 14:14:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZjA2-000319-1S; Sat, 17 Nov 2012 14:14:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TZjA0-000314-Dc
	for xen-devel@lists.xen.org; Sat, 17 Nov 2012 14:14:16 +0000
Received: from [193.109.254.147:53555] by server-15.bemta-14.messagelabs.com
	id 84/7C-12105-7BB97A05; Sat, 17 Nov 2012 14:14:15 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1353161653!9456577!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4MjQ2MQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15856 invoked from network); 17 Nov 2012 14:14:14 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-9.tower-27.messagelabs.com with SMTP;
	17 Nov 2012 14:14:14 -0000
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
	by fmsmga102.fm.intel.com with ESMTP; 17 Nov 2012 06:14:13 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,270,1352102400"; d="scan'208";a="250674677"
Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35])
	by fmsmga002.fm.intel.com with ESMTP; 17 Nov 2012 06:14:12 -0800
Received: from fmsmsx151.amr.corp.intel.com (10.19.17.220) by
	FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Sat, 17 Nov 2012 06:14:12 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX151.amr.corp.intel.com (10.19.17.220) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Sat, 17 Nov 2012 06:14:12 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Sat, 17 Nov 2012 22:14:10 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, Sander Eikelenboom
	<linux@eikelenboom.it>
Thread-Topic: [ 3009.778974] mcelog:16842 map pfn expected mapping type
	write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus
Thread-Index: AQHNxBuu15VBKwan9ka7+XGDG79Vd5fuEt6g
Date: Sat, 17 Nov 2012 14:14:10 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233538E31B@SHSMSX101.ccr.corp.intel.com>
References: <791265057.20121116134056@eikelenboom.it>
	<20121116160733.GO22320@phenom.dumpdata.com>
	<1422434855.20121116174754@eikelenboom.it>
	<20121116165834.GA18725@phenom.dumpdata.com>
In-Reply-To: <20121116165834.GA18725@phenom.dumpdata.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [ 3009.778974] mcelog:16842 map pfn expected
 mapping type write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Konrad Rzeszutek Wilk wrote:
> On Fri, Nov 16, 2012 at 05:47:54PM +0100, Sander Eikelenboom wrote:
>> 
>> Friday, November 16, 2012, 5:07:33 PM, you wrote:
>> 
>>> On Fri, Nov 16, 2012 at 01:40:56PM +0100, Sander Eikelenboom wrote:
>>>> Hi Konrad,
>>>> 
>>>> Sometime ago i reported this one at boot up:
>>>> 
>>>> [ 3009.778974] mcelog:16842 map pfn expected mapping type
>>>> write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus [
>>>> 3009.788570] ------------[ cut here ]------------ [ 3009.798175]
>>>> WARNING: at arch/x86/mm/pat.c:774 untrack_pfn+0xa1/0xb0() [
>>>> 3009.807966] Hardware name: MS-7640 [ 3009.817677] Modules linked
>>>> in: [ 3009.827524] Pid: 16842, comm: mcelog Tainted: G        W   
>>>> 3.7.0-rc5-20121116-reverted-persistent-warn-patwarn #1 [
>>>> 3009.837415] Call Trace: [ 3009.847110]  [<ffffffff810674fa>]
>>>> warn_slowpath_common+0x7a/0xb0 [ 3009.856857] 
>>>> [<ffffffff81067545>] warn_slowpath_null+0x15/0x20 [ 3009.866562] 
>>>> [<ffffffff81042041>] untrack_pfn+0xa1/0xb0 [ 3009.876201] 
>>>> [<ffffffff8111a59b>] unmap_single_vma+0x86b/0x8e0 [ 3009.885895] 
>>>> [<ffffffff81100f16>] ? release_pages+0x196/0x1f0 [ 3009.895488] 
>>>> [<ffffffff8111a65c>] unmap_vmas+0x4c/0xa0 [ 3009.905134] 
>>>> [<ffffffff8111c8fa>] exit_mmap+0x9a/0x180 [ 3009.914706] 
>>>> [<ffffffff81064e72>] mmput+0x52/0xd0 [ 3009.924252] 
>>>> [<ffffffff810652b7>] dup_mm+0x3c7/0x510 [ 3009.933839] 
>>>> [<ffffffff81065fd5>] copy_process+0xac5/0x14a0 [ 3009.943430] 
>>>> [<ffffffff81066af3>] do_fork+0x53/0x360 [ 3009.952843] 
>>>> [<ffffffff810b25c7>] ? lock_release+0x117/0x250 [ 3009.962283] 
>>>> [<ffffffff817d26c0>] ? _raw_spin_unlock+0x30/0x60 [ 3009.971532] 
>>>> [<ffffffff817d3495>] ? sysret_check+0x22/0x5d [ 3009.980820] 
>>>> [<ffffffff81017523>] sys_clone+0x23/0x30 [ 3009.990046] 
>>>> [<ffffffff817d37f3>] stub_clone+0x13/0x20 [ 3009.999335] 
>>>> [<ffffffff817d3469>] ? system_call_fastpath+0x16/0x1b [
>>>> 3010.008667] ---[ end trace 2d9694c2c0a24da8 ]---  
>>>> 
>>>> 
>>>> It seems to be due to the "mcelog" userspace tool provided with
>>>> Debian Squeeze (mcelog 1.0~pre3-3  x86-64 Machine Check Exceptions
>>>> collector and decoder). I can trigger this warning easily by
>>>> restarting the mcelog tool with /etc/init.d/mcelog restart  
>>>> 
>>>> Should that one also function with the xen mcelog driver, or is a
>>>> newer version required ? 
>> 
>>> The reason we get is b/c I had to disable the PAT functionality in
>>> the Linux kernel for Xen. This is b/c it only worked one way -
>>> meaning you could convert a page from 
>>> WriteBack to WriteCombine or WriteBack to Uncached. But you could
>>> not 
>>> do WriteCombine back to WriteBack - due to one of the functions that
>>> changes the bits was using an "unfiltered" way to identify the bits
>>> on the 
>>> page.
>> 
>>> Anyhow, we had a disaster b/c some of these pages that used to
>>> WriteBack (WB) 
>>> got converted to WriteCombine (WC) and then were returned back as
>>> such 
>>> to the page pool. And if they were re-used by filesystem invariably
>>> we got 
>>> corruptions.
>> 
>>> So until the PAT table lookup thing that Peter H. Anvin suggested
>>> gets implemented this splat gotta show up :-(
>> 
>> Not a big problem for me, i was just wondering :-)
>> I'm more interested in the netfront troubles, since it's already rc5.
>> 
>>> Does mcelog still work even with this warning?
>> 
>> Not the daemon:
>> 
>> serveerstertje:~# sh /etc/init.d/mcelog start
>> Starting Machine Check Exceptions decoder: daemon: Cannot allocate
>> memory 
>> 
> Ugh.
> CC-ing Liu here.
> 

How to reproduce it (sorry I miss the history of this thread)?
I have a try at Xen side, w/ kernel 3.6.0-rc7+, no problem at my side.

Thanks,
Jinsong

>> 
>>>> 
>>>> --
>>>> Sander


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 17 15:18:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Nov 2012 15:18:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZk9R-0003Gv-Uc; Sat, 17 Nov 2012 15:17:45 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg@wind.enjellic.com>) id 1TZk9Q-0003Gq-Bj
	for xen-devel@lists.xen.org; Sat, 17 Nov 2012 15:17:44 +0000
Received: from [85.158.143.99:51747] by server-1.bemta-4.messagelabs.com id
	AA/F5-27934-79AA7A05; Sat, 17 Nov 2012 15:17:43 +0000
X-Env-Sender: greg@wind.enjellic.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1353165461!29393236!1
X-Originating-IP: [76.10.64.91]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 643 invoked from network); 17 Nov 2012 15:17:42 -0000
Received: from wind.enjellic.com (HELO wind.enjellic.com) (76.10.64.91)
	by server-13.tower-216.messagelabs.com with SMTP;
	17 Nov 2012 15:17:42 -0000
Received: from wind.enjellic.com (localhost [127.0.0.1])
	by wind.enjellic.com (8.14.3/8.14.3) with ESMTP id qAHFHbZi011444;
	Sat, 17 Nov 2012 09:17:37 -0600
Received: (from greg@localhost)
	by wind.enjellic.com (8.14.3/8.14.3/Submit) id qAHFHaCC011443;
	Sat, 17 Nov 2012 09:17:36 -0600
Date: Sat, 17 Nov 2012 09:17:36 -0600
From: "Dr. Greg Wettstein" <greg@wind.enjellic.com>
Message-Id: <201211171517.qAHFHaCC011443@wind.enjellic.com>
In-Reply-To: "Dr. Greg Wettstein" <greg@wind.enjellic.com>
	"Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the
	virtual machine created by xl command?" (Nov 14, 3:40pm)
X-Mailer: Mail User's Shell (7.2.6-ESD1.0 03/31/2012)
To: greg@enjellic.com, Ian Campbell <Ian.Campbell@citrix.com>,
	Qian Hu <qianhu2011@gmail.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.3
	(wind.enjellic.com [0.0.0.0]);
	Sat, 17 Nov 2012 09:17:37 -0600 (CST)
Cc: konrad.wilk@oracle.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the
	virtual machine created by xl command?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: greg@enjellic.com
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Nov 14,  3:40pm, "Dr. Greg Wettstein" wrote:
} Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the v

Good morning, hope the day is going well for everyone.

> On Nov 13, 10:02am, Ian Campbell wrote:
> } Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the v
> 
> Good afternoon, hope the week is going well for everyone.
> 
> > On Tue, 2012-11-13 at 06:30 +0000, Qian Hu wrote:
> > 
> > > With spice tool, I have to create a VM by xl command, and now I am
> > > wondering if it supports VGA passghrouth?
> 
> > This list is for the development of Xen. You';d probably have more
> > luck with these sorts of support requests on the xen-users list.
> 
> That would normally be the case but I'm suspicious there are issues
> with VGA passthrough in 4.2.0.

I just wanted to follow up to the list on the status of passthrough
issues.

We reverted our test machine back to the 2.6.32.45 kernel which we had
been using in production.  That kernel was based on Jeremy's GIT
tree.  Using xm and the updated ATI patches which I referenced in my
original mail passthrough works as it should.

Passthrough does not work with xl.  Windows started but fell into its
text mode rescue screen and registered a crash dump.  It flashed the
screen back and forth between a stipled blue/grey and totally black
screen a few times and then locked the physical machine up solidly.

On the next boot I thought about it but declined to register the crash
dump with Microsoft.... :-)

We then went back and tested the 3.4.18 kernel and with both xm and xl
the guest faults on the first attempt to do an I/O port access.  All
factors (windows image, hardware, xen guest config) are held identical
so the difference would seem to be linked to the PCI passthrough
implementation between the two kernels.  I've copied Konrad on the
note since he would seem to be the person most familiar with this
area.

I'm including below a diff between a successful qemu-dm passthrough
session (2.6.32.45) and an unsuccessful session (3.4.18).  It would
appear 3.4.18 is getting the both the I/O port and memory ranges
wrong.

Let me know if I can forward any additional information or run any
additional tests.

Have a good weekend.

Greg

qemu-dm log diff: ---------------------------------------------------------
1c1
< domid: 3
---
> domid: 1
3,5c3,5
< Watching /local/domain/0/device-model/3/logdirty/cmd
< Watching /local/domain/0/device-model/3/command
< Watching /local/domain/3/cpu
---
> Watching /local/domain/0/device-model/1/logdirty/cmd
> Watching /local/domain/0/device-model/1/command
> Watching /local/domain/1/cpu
9c9
< Guest uuid = 7fcefb13-d1ef-105b-e38c-1e1454411e80
---
> Guest uuid = eab6bbbb-4819-b970-a83c-03288a1541ad
14c14
< xs_read(/local/domain/0/device-model/3/xen_extended_power_mgmt): read error
---
> xs_read(/local/domain/0/device-model/1/xen_extended_power_mgmt): read error
18,20c18,20
< xs_read(/local/domain/3/log-throttling): read error
< qemu: ignoring not-understood drive `/local/domain/3/log-throttling'
< medium change watch on `/local/domain/3/log-throttling' - unknown device, ignored
---
> xs_read(/local/domain/1/log-throttling): read error
> qemu: ignoring not-understood drive `/local/domain/1/log-throttling'
> medium change watch on `/local/domain/1/log-throttling' - unknown device, ignored
69,106c69,77
< pt_iomem_map: e_phys=f1020000 maddr=c1a00000 type=0 len=131072 index=2 first_map=1
< pt_iomem_map: e_phys=f1060000 maddr=c1b22000 type=0 len=4096 index=0 first_map=1
< pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=1
< pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=0
< ati_gfx_init: guest_pio_bar = 0xc600, host_pio_bar = 0x3000, pio_size=0x100 guest_mmio_bar1=0xe0000000, guest_mmio_bar2=0x0
< platform_fixed_ioport: changed ro/rw state of ROM memory area. now is rw state.
< platform_fixed_ioport: changed ro/rw state of ROM memory area. now is ro state.
< pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
< pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
< pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
< pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
< pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
< pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
< pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
< pt_iomem_map: e_phys=ffffffff maddr=b0000000 type=8 len=268435456 index=0 first_map=0
< pt_iomem_map: e_phys=ffffffff maddr=c1a00000 type=0 len=131072 index=2 first_map=0
< pt_iomem_map: e_phys=e0000000 maddr=b0000000 type=8 len=268435456 index=0 first_map=0
< pt_iomem_map: e_phys=f1020000 maddr=c1a00000 type=0 len=131072 index=2 first_map=0
< pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=0
< pt_iomem_map: e_phys=ffffffff maddr=c1b22000 type=0 len=4096 index=0 first_map=0
< pt_iomem_map: e_phys=f1060000 maddr=c1b22000 type=0 len=4096 index=0 first_map=0
< pt_iomem_map: e_phys=ffffffff maddr=b0000000 type=8 len=268435456 index=0 first_map=0
< pt_iomem_map: e_phys=ffffffff maddr=c1a00000 type=0 len=131072 index=2 first_map=0
< pt_iomem_map: e_phys=e0000000 maddr=b0000000 type=8 len=268435456 index=0 first_map=0
< pt_iomem_map: e_phys=f1020000 maddr=c1a00000 type=0 len=131072 index=2 first_map=0
< pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=0
< pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=0
< pt_msgctrl_reg_write: guest enabling MSI, disable MSI-INTx translation
< pci_intx: intx=1
< pt_msi_disable: Unmap msi with pirq 37
< pt_msgctrl_reg_write: setup msi for dev 30
< pt_msi_setup: msi mapped with pirq 37
< pt_msi_update: Update msi with pirq 37 gvec b0 gflags 0
< pt_iomem_map: e_phys=ffffffff maddr=c1b22000 type=0 len=4096 index=0 first_map=0
< pt_iomem_map: e_phys=f1060000 maddr=c1b22000 type=0 len=4096 index=0 first_map=0
< pt_iomem_map: e_phys=ffffffff maddr=c1b22000 type=0 len=4096 index=0 first_map=0
< shutdown requested in cpu_handle_ioreq
< Issued domain 3 poweroff
---
> pt_iomem_map: e_phys=f1000000 maddr=c1a00000 type=0 len=131072 index=2 first_map=1
> pt_iomem_map: e_phys=f1040000 maddr=c1b22000 type=0 len=4096 index=0 first_map=1
> pt_ioport_map: e_phys=c700 pio_base=3000 len=256 index=4 first_map=1
> pt_ioport_map: e_phys=c700 pio_base=3000 len=256 index=4 first_map=0
> ati_gfx_init: guest_pio_bar = 0xc700, host_pio_bar = 0x3000, pio_size=0x100 guest_mmio_bar1=0xe0000000, guest_mmio_bar2=0x0
> ati_io_regs_read: Requested read of c74c/51020, mapped: 304c/12364
> ati_hw_in: port I/O: 304c, base: 3000, size: 100
> ati_hw_in: ioperm successful
> ati_hw_in: Read: 0
---------------------------------------------------------------------------

}-- End of excerpt from "Dr. Greg Wettstein"

As always,
Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
4206 N. 19th Ave.           Specializing in information infra-structure
Fargo, ND  58102            development.
PH: 701-281-1686
FAX: 701-281-3949           EMAIL: greg@enjellic.com
------------------------------------------------------------------------------
"Boy, it must not take much to make a phone work.  Looking at
 everthing else here it must be the same way with the INTERNET."
                                -- Francis 'Fritz' Wettstein

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 17 15:18:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Nov 2012 15:18:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZk9R-0003Gv-Uc; Sat, 17 Nov 2012 15:17:45 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg@wind.enjellic.com>) id 1TZk9Q-0003Gq-Bj
	for xen-devel@lists.xen.org; Sat, 17 Nov 2012 15:17:44 +0000
Received: from [85.158.143.99:51747] by server-1.bemta-4.messagelabs.com id
	AA/F5-27934-79AA7A05; Sat, 17 Nov 2012 15:17:43 +0000
X-Env-Sender: greg@wind.enjellic.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1353165461!29393236!1
X-Originating-IP: [76.10.64.91]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 643 invoked from network); 17 Nov 2012 15:17:42 -0000
Received: from wind.enjellic.com (HELO wind.enjellic.com) (76.10.64.91)
	by server-13.tower-216.messagelabs.com with SMTP;
	17 Nov 2012 15:17:42 -0000
Received: from wind.enjellic.com (localhost [127.0.0.1])
	by wind.enjellic.com (8.14.3/8.14.3) with ESMTP id qAHFHbZi011444;
	Sat, 17 Nov 2012 09:17:37 -0600
Received: (from greg@localhost)
	by wind.enjellic.com (8.14.3/8.14.3/Submit) id qAHFHaCC011443;
	Sat, 17 Nov 2012 09:17:36 -0600
Date: Sat, 17 Nov 2012 09:17:36 -0600
From: "Dr. Greg Wettstein" <greg@wind.enjellic.com>
Message-Id: <201211171517.qAHFHaCC011443@wind.enjellic.com>
In-Reply-To: "Dr. Greg Wettstein" <greg@wind.enjellic.com>
	"Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the
	virtual machine created by xl command?" (Nov 14, 3:40pm)
X-Mailer: Mail User's Shell (7.2.6-ESD1.0 03/31/2012)
To: greg@enjellic.com, Ian Campbell <Ian.Campbell@citrix.com>,
	Qian Hu <qianhu2011@gmail.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.3
	(wind.enjellic.com [0.0.0.0]);
	Sat, 17 Nov 2012 09:17:37 -0600 (CST)
Cc: konrad.wilk@oracle.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the
	virtual machine created by xl command?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: greg@enjellic.com
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Nov 14,  3:40pm, "Dr. Greg Wettstein" wrote:
} Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the v

Good morning, hope the day is going well for everyone.

> On Nov 13, 10:02am, Ian Campbell wrote:
> } Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the v
> 
> Good afternoon, hope the week is going well for everyone.
> 
> > On Tue, 2012-11-13 at 06:30 +0000, Qian Hu wrote:
> > 
> > > With spice tool, I have to create a VM by xl command, and now I am
> > > wondering if it supports VGA passghrouth?
> 
> > This list is for the development of Xen. You';d probably have more
> > luck with these sorts of support requests on the xen-users list.
> 
> That would normally be the case but I'm suspicious there are issues
> with VGA passthrough in 4.2.0.

I just wanted to follow up to the list on the status of passthrough
issues.

We reverted our test machine back to the 2.6.32.45 kernel which we had
been using in production.  That kernel was based on Jeremy's GIT
tree.  Using xm and the updated ATI patches which I referenced in my
original mail passthrough works as it should.

Passthrough does not work with xl.  Windows started but fell into its
text mode rescue screen and registered a crash dump.  It flashed the
screen back and forth between a stipled blue/grey and totally black
screen a few times and then locked the physical machine up solidly.

On the next boot I thought about it but declined to register the crash
dump with Microsoft.... :-)

We then went back and tested the 3.4.18 kernel and with both xm and xl
the guest faults on the first attempt to do an I/O port access.  All
factors (windows image, hardware, xen guest config) are held identical
so the difference would seem to be linked to the PCI passthrough
implementation between the two kernels.  I've copied Konrad on the
note since he would seem to be the person most familiar with this
area.

I'm including below a diff between a successful qemu-dm passthrough
session (2.6.32.45) and an unsuccessful session (3.4.18).  It would
appear 3.4.18 is getting the both the I/O port and memory ranges
wrong.

Let me know if I can forward any additional information or run any
additional tests.

Have a good weekend.

Greg

qemu-dm log diff: ---------------------------------------------------------
1c1
< domid: 3
---
> domid: 1
3,5c3,5
< Watching /local/domain/0/device-model/3/logdirty/cmd
< Watching /local/domain/0/device-model/3/command
< Watching /local/domain/3/cpu
---
> Watching /local/domain/0/device-model/1/logdirty/cmd
> Watching /local/domain/0/device-model/1/command
> Watching /local/domain/1/cpu
9c9
< Guest uuid = 7fcefb13-d1ef-105b-e38c-1e1454411e80
---
> Guest uuid = eab6bbbb-4819-b970-a83c-03288a1541ad
14c14
< xs_read(/local/domain/0/device-model/3/xen_extended_power_mgmt): read error
---
> xs_read(/local/domain/0/device-model/1/xen_extended_power_mgmt): read error
18,20c18,20
< xs_read(/local/domain/3/log-throttling): read error
< qemu: ignoring not-understood drive `/local/domain/3/log-throttling'
< medium change watch on `/local/domain/3/log-throttling' - unknown device, ignored
---
> xs_read(/local/domain/1/log-throttling): read error
> qemu: ignoring not-understood drive `/local/domain/1/log-throttling'
> medium change watch on `/local/domain/1/log-throttling' - unknown device, ignored
69,106c69,77
< pt_iomem_map: e_phys=f1020000 maddr=c1a00000 type=0 len=131072 index=2 first_map=1
< pt_iomem_map: e_phys=f1060000 maddr=c1b22000 type=0 len=4096 index=0 first_map=1
< pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=1
< pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=0
< ati_gfx_init: guest_pio_bar = 0xc600, host_pio_bar = 0x3000, pio_size=0x100 guest_mmio_bar1=0xe0000000, guest_mmio_bar2=0x0
< platform_fixed_ioport: changed ro/rw state of ROM memory area. now is rw state.
< platform_fixed_ioport: changed ro/rw state of ROM memory area. now is ro state.
< pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
< pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
< pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
< pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
< pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
< pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
< pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
< pt_iomem_map: e_phys=ffffffff maddr=b0000000 type=8 len=268435456 index=0 first_map=0
< pt_iomem_map: e_phys=ffffffff maddr=c1a00000 type=0 len=131072 index=2 first_map=0
< pt_iomem_map: e_phys=e0000000 maddr=b0000000 type=8 len=268435456 index=0 first_map=0
< pt_iomem_map: e_phys=f1020000 maddr=c1a00000 type=0 len=131072 index=2 first_map=0
< pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=0
< pt_iomem_map: e_phys=ffffffff maddr=c1b22000 type=0 len=4096 index=0 first_map=0
< pt_iomem_map: e_phys=f1060000 maddr=c1b22000 type=0 len=4096 index=0 first_map=0
< pt_iomem_map: e_phys=ffffffff maddr=b0000000 type=8 len=268435456 index=0 first_map=0
< pt_iomem_map: e_phys=ffffffff maddr=c1a00000 type=0 len=131072 index=2 first_map=0
< pt_iomem_map: e_phys=e0000000 maddr=b0000000 type=8 len=268435456 index=0 first_map=0
< pt_iomem_map: e_phys=f1020000 maddr=c1a00000 type=0 len=131072 index=2 first_map=0
< pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=0
< pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=0
< pt_msgctrl_reg_write: guest enabling MSI, disable MSI-INTx translation
< pci_intx: intx=1
< pt_msi_disable: Unmap msi with pirq 37
< pt_msgctrl_reg_write: setup msi for dev 30
< pt_msi_setup: msi mapped with pirq 37
< pt_msi_update: Update msi with pirq 37 gvec b0 gflags 0
< pt_iomem_map: e_phys=ffffffff maddr=c1b22000 type=0 len=4096 index=0 first_map=0
< pt_iomem_map: e_phys=f1060000 maddr=c1b22000 type=0 len=4096 index=0 first_map=0
< pt_iomem_map: e_phys=ffffffff maddr=c1b22000 type=0 len=4096 index=0 first_map=0
< shutdown requested in cpu_handle_ioreq
< Issued domain 3 poweroff
---
> pt_iomem_map: e_phys=f1000000 maddr=c1a00000 type=0 len=131072 index=2 first_map=1
> pt_iomem_map: e_phys=f1040000 maddr=c1b22000 type=0 len=4096 index=0 first_map=1
> pt_ioport_map: e_phys=c700 pio_base=3000 len=256 index=4 first_map=1
> pt_ioport_map: e_phys=c700 pio_base=3000 len=256 index=4 first_map=0
> ati_gfx_init: guest_pio_bar = 0xc700, host_pio_bar = 0x3000, pio_size=0x100 guest_mmio_bar1=0xe0000000, guest_mmio_bar2=0x0
> ati_io_regs_read: Requested read of c74c/51020, mapped: 304c/12364
> ati_hw_in: port I/O: 304c, base: 3000, size: 100
> ati_hw_in: ioperm successful
> ati_hw_in: Read: 0
---------------------------------------------------------------------------

}-- End of excerpt from "Dr. Greg Wettstein"

As always,
Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
4206 N. 19th Ave.           Specializing in information infra-structure
Fargo, ND  58102            development.
PH: 701-281-1686
FAX: 701-281-3949           EMAIL: greg@enjellic.com
------------------------------------------------------------------------------
"Boy, it must not take much to make a phone work.  Looking at
 everthing else here it must be the same way with the INTERNET."
                                -- Francis 'Fritz' Wettstein

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 18 05:58:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Nov 2012 05:58:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZxsz-0001Dz-M8; Sun, 18 Nov 2012 05:57:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZxsy-0001Du-AT
	for xen-devel@lists.xensource.com; Sun, 18 Nov 2012 05:57:40 +0000
Received: from [85.158.143.35:63030] by server-1.bemta-4.messagelabs.com id
	20/71-27934-3D878A05; Sun, 18 Nov 2012 05:57:39 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1353218258!10299943!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8266 invoked from network); 18 Nov 2012 05:57:38 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	18 Nov 2012 05:57:38 -0000
X-IronPort-AV: E=Sophos;i="4.83,273,1352073600"; d="scan'208";a="15864405"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	18 Nov 2012 05:57:31 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sun, 18 Nov 2012 05:57:31 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TZxsp-00051A-AV;
	Sun, 18 Nov 2012 05:57:31 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TZxsp-00050u-55;
	Sun, 18 Nov 2012 05:57:31 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14414-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sun, 18 Nov 2012 05:57:31 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14414: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14414 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14414/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14413
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14413
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14413
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14413

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  321f8487379b
baseline version:
 xen                  321f8487379b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 18 05:58:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Nov 2012 05:58:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TZxsz-0001Dz-M8; Sun, 18 Nov 2012 05:57:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TZxsy-0001Du-AT
	for xen-devel@lists.xensource.com; Sun, 18 Nov 2012 05:57:40 +0000
Received: from [85.158.143.35:63030] by server-1.bemta-4.messagelabs.com id
	20/71-27934-3D878A05; Sun, 18 Nov 2012 05:57:39 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1353218258!10299943!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8266 invoked from network); 18 Nov 2012 05:57:38 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	18 Nov 2012 05:57:38 -0000
X-IronPort-AV: E=Sophos;i="4.83,273,1352073600"; d="scan'208";a="15864405"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	18 Nov 2012 05:57:31 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sun, 18 Nov 2012 05:57:31 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TZxsp-00051A-AV;
	Sun, 18 Nov 2012 05:57:31 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TZxsp-00050u-55;
	Sun, 18 Nov 2012 05:57:31 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14414-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sun, 18 Nov 2012 05:57:31 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14414: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14414 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14414/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14413
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14413
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14413
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14413

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  321f8487379b
baseline version:
 xen                  321f8487379b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 18 15:49:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Nov 2012 15:49:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Ta76p-00030s-1t; Sun, 18 Nov 2012 15:48:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Ta76n-00030n-Ea
	for xen-devel@lists.xensource.com; Sun, 18 Nov 2012 15:48:33 +0000
Received: from [193.109.254.147:22060] by server-14.bemta-14.messagelabs.com
	id 1D/A9-14517-05309A05; Sun, 18 Nov 2012 15:48:32 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1353253711!9534475!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26855 invoked from network); 18 Nov 2012 15:48:31 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	18 Nov 2012 15:48:31 -0000
X-IronPort-AV: E=Sophos;i="4.83,275,1352073600"; d="scan'208";a="15867098"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	18 Nov 2012 15:48:29 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sun, 18 Nov 2012 15:48:28 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1Ta76i-0008Hz-Ge;
	Sun, 18 Nov 2012 15:48:28 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1Ta76i-000062-8l;
	Sun, 18 Nov 2012 15:48:28 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14415-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sun, 18 Nov 2012 15:48:28 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [linux-3.0 test] 14415: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14415 linux-3.0 real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14415/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14372
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14372
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14372
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14372

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass

version targeted for testing:
 linux                89d2d133c6947c04a8ab539b997f266535beaafe
baseline version:
 linux                ac7b56f4149a2f0e331a9b640f65aed57ed15eb4

------------------------------------------------------------
People who touched revisions under test:
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=linux-3.0
+ revision=89d2d133c6947c04a8ab539b997f266535beaafe
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push linux-3.0 89d2d133c6947c04a8ab539b997f266535beaafe
+ branch=linux-3.0
+ revision=89d2d133c6947c04a8ab539b997f266535beaafe
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=linux
+ xenbranch=xen-unstable
+ '[' xlinux = xlinux ']'
+ linuxbranch=linux-3.0
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.linux-3.0
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.linux-3.0
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree linux-3.0
+ case $1 in
+ : git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
+ : linux-3.0.y
+ : linux-3.0.y
+ : git
+ : git
+ : git://xenbits.xen.org/linux-pvops.git
+ : xen@xenbits.xensource.com:git/linux-pvops.git
+ : tested/linux-3.0
+ : tested/linux-3.0
+ return 0
+ cd /export/home/osstest/repos/linux
+ git push xen@xenbits.xensource.com:git/linux-pvops.git 89d2d133c6947c04a8ab539b997f266535beaafe:tested/linux-3.0
Counting objects: 1   
Counting objects: 314   
Counting objects: 353, done.
Compressing objects:   2% (1/47)   
Compressing objects:   4% (2/47)   
Compressing objects:   6% (3/47)   
Compressing objects:   8% (4/47)   
Compressing objects:  10% (5/47)   
Compressing objects:  12% (6/47)   
Compressing objects:  14% (7/47)   
Compressing objects:  17% (8/47)   
Compressing objects:  19% (9/47)   
Compressing objects:  21% (10/47)   
Compressing objects:  23% (11/47)   
Compressing objects:  25% (12/47)   
Compressing objects:  27% (13/47)   
Compressing objects:  29% (14/47)   
Compressing objects:  31% (15/47)   
Compressing objects:  34% (16/47)   
Compressing objects:  36% (17/47)   
Compressing objects:  38% (18/47)   
Compressing objects:  40% (19/47)   
Compressing objects:  42% (20/47)   
Compressing objects:  44% (21/47)   
Compressing objects:  46% (22/47)   
Compressing objects:  48% (23/47)   
Compressing objects:  51% (24/47)   
Compressing objects:  53% (25/47)   
Compressing objects:  55% (26/47)   
Compressing objects:  57% (27/47)   
Compressing objects:  59% (28/47)   
Compressing objects:  61% (29/47)   
Compressing objects:  63% (30/47)   
Compressing objects:  65% (31/47)   
Compressing objects:  68% (32/47)   
Compressing objects:  70% (33/47)   
Compressing objects:  72% (34/47)   
Compressing objects:  74% (35/47)   
Compressing objects:  76% (36/47)   
Compressing objects:  78% (37/47)   
Compressing objects:  80% (38/47)   
Compressing objects:  82% (39/47)   
Compressing objects:  85% (40/47)   
Compressing objects:  87% (41/47)   
Compressing objects:  89% (42/47)   
Compressing objects:  91% (43/47)   
Compressing objects:  93% (44/47)   
Compressing objects:  95% (45/47)   
Compressing objects:  97% (46/47)   
Compressing objects: 100% (47/47)   
Compressing objects: 100% (47/47), done.
Writing objects:   0% (1/258)   
Writing objects:   1% (3/258)   
Writing objects:   2% (6/258)   
Writing objects:   3% (8/258)   
Writing objects:   4% (11/258)   
Writing objects:   5% (13/258)   
Writing objects:   6% (16/258)   
Writing objects:   7% (19/258)   
Writing objects:   8% (21/258)   
Writing objects:   9% (24/258)   
Writing objects:  10% (26/258)   
Writing objects:  11% (29/258)   
Writing objects:  12% (31/258)   
Writing objects:  13% (34/258)   
Writing objects:  14% (37/258)   
Writing objects:  15% (39/258)   
Writing objects:  16% (42/258)   
Writing objects:  17% (44/258)   
Writing objects:  18% (47/258)   
Writing objects:  19% (50/258)   
Writing objects:  20% (52/258)   
Writing objects:  21% (55/258)   
Writing objects:  22% (57/258)   
Writing objects:  23% (60/258)   
Writing objects:  24% (62/258)   
Writing objects:  25% (65/258)   
Writing objects:  26% (68/258)   
Writing objects:  27% (70/258)   
Writing objects:  28% (73/258)   
Writing objects:  29% (75/258)   
Writing objects:  30% (78/258)   
Writing objects:  31% (80/258)   
Writing objects:  32% (83/258)   
Writing objects:  33% (86/258)   
Writing objects:  34% (88/258)   
Writing objects:  35% (91/258)   
Writing objects:  36% (93/258)   
Writing objects:  37% (96/258)   
Writing objects:  38% (99/258)   
Writing objects:  39% (101/258)   
Writing objects:  40% (104/258)   
Writing objects:  41% (106/258)   
Writing objects:  42% (109/258)   
Writing objects:  43% (111/258)   
Writing objects:  44% (114/258)   
Writing objects:  45% (117/258)   
Writing objects:  46% (119/258)   
Writing objects:  47% (122/258)   
Writing objects:  48% (124/258)   
Writing objects:  49% (127/258)   
Writing objects:  50% (130/258)   
Writing objects:  51% (133/258)   
Writing objects:  52% (136/258)   
Writing objects:  53% (137/258)   
Writing objects:  54% (140/258)   
Writing objects:  55% (142/258)   
Writing objects:  56% (145/258)   
Writing objects:  57% (148/258)   
Writing objects:  58% (150/258)   
Writing objects:  59% (153/258)   
Writing objects:  60% (155/258)   
Writing objects:  61% (158/258)   
Writing objects:  62% (160/258)   
Writing objects:  63% (163/258)   
Writing objects:  64% (166/258)   
Writing objects:  65% (168/258)   
Writing objects:  66% (171/258)   
Writing objects:  67% (173/258)   
Writing objects:  68% (176/258)   
Writing objects:  69% (179/258)   
Writing objects:  70% (181/258)   
Writing objects:  71% (184/258)   
Writing objects:  72% (186/258)   
Writing objects:  73% (189/258)   
Writing objects:  74% (191/258)   
Writing objects:  75% (194/258)   
Writing objects:  76% (197/258)   
Writing objects:  77% (199/258)   
Writing objects:  78% (202/258)   
Writing objects:  79% (204/258)   
Writing objects:  80% (207/258)   
Writing objects:  81% (209/258)   
Writing objects:  82% (212/258)   
Writing objects:  83% (215/258)   
Writing objects:  84% (217/258)   
Writing objects:  85% (220/258)   
Writing objects:  86% (222/258)   
Writing objects:  87% (225/258)   
Writing objects:  88% (228/258)   
Writing objects:  89% (230/258)   
Writing objects:  90% (233/258)   
Writing objects:  91% (235/258)   
Writing objects:  92% (238/258)   
Writing objects:  93% (240/258)   
Writing objects:  94% (243/258)   
Writing objects:  95% (246/258)   
Writing objects:  96% (248/258)   
Writing objects:  97% (251/258)   
Writing objects:  98% (253/258)   
Writing objects:  99% (256/258)   
Writing objects: 100% (258/258)   
Writing objects: 100% (258/258), 46.37 KiB, done.
Total 258 (delta 211), reused 258 (delta 211)
To xen@xenbits.xensource.com:git/linux-pvops.git
   ac7b56f..89d2d13  89d2d133c6947c04a8ab539b997f266535beaafe -> tested/linux-3.0
+ exit 0

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 18 15:49:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Nov 2012 15:49:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Ta76p-00030s-1t; Sun, 18 Nov 2012 15:48:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Ta76n-00030n-Ea
	for xen-devel@lists.xensource.com; Sun, 18 Nov 2012 15:48:33 +0000
Received: from [193.109.254.147:22060] by server-14.bemta-14.messagelabs.com
	id 1D/A9-14517-05309A05; Sun, 18 Nov 2012 15:48:32 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1353253711!9534475!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26855 invoked from network); 18 Nov 2012 15:48:31 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	18 Nov 2012 15:48:31 -0000
X-IronPort-AV: E=Sophos;i="4.83,275,1352073600"; d="scan'208";a="15867098"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	18 Nov 2012 15:48:29 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sun, 18 Nov 2012 15:48:28 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1Ta76i-0008Hz-Ge;
	Sun, 18 Nov 2012 15:48:28 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1Ta76i-000062-8l;
	Sun, 18 Nov 2012 15:48:28 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14415-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sun, 18 Nov 2012 15:48:28 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [linux-3.0 test] 14415: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14415 linux-3.0 real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14415/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14372
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14372
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14372
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14372

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass

version targeted for testing:
 linux                89d2d133c6947c04a8ab539b997f266535beaafe
baseline version:
 linux                ac7b56f4149a2f0e331a9b640f65aed57ed15eb4

------------------------------------------------------------
People who touched revisions under test:
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=linux-3.0
+ revision=89d2d133c6947c04a8ab539b997f266535beaafe
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push linux-3.0 89d2d133c6947c04a8ab539b997f266535beaafe
+ branch=linux-3.0
+ revision=89d2d133c6947c04a8ab539b997f266535beaafe
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=linux
+ xenbranch=xen-unstable
+ '[' xlinux = xlinux ']'
+ linuxbranch=linux-3.0
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.linux-3.0
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.linux-3.0
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree linux-3.0
+ case $1 in
+ : git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
+ : linux-3.0.y
+ : linux-3.0.y
+ : git
+ : git
+ : git://xenbits.xen.org/linux-pvops.git
+ : xen@xenbits.xensource.com:git/linux-pvops.git
+ : tested/linux-3.0
+ : tested/linux-3.0
+ return 0
+ cd /export/home/osstest/repos/linux
+ git push xen@xenbits.xensource.com:git/linux-pvops.git 89d2d133c6947c04a8ab539b997f266535beaafe:tested/linux-3.0
Counting objects: 1   
Counting objects: 314   
Counting objects: 353, done.
Compressing objects:   2% (1/47)   
Compressing objects:   4% (2/47)   
Compressing objects:   6% (3/47)   
Compressing objects:   8% (4/47)   
Compressing objects:  10% (5/47)   
Compressing objects:  12% (6/47)   
Compressing objects:  14% (7/47)   
Compressing objects:  17% (8/47)   
Compressing objects:  19% (9/47)   
Compressing objects:  21% (10/47)   
Compressing objects:  23% (11/47)   
Compressing objects:  25% (12/47)   
Compressing objects:  27% (13/47)   
Compressing objects:  29% (14/47)   
Compressing objects:  31% (15/47)   
Compressing objects:  34% (16/47)   
Compressing objects:  36% (17/47)   
Compressing objects:  38% (18/47)   
Compressing objects:  40% (19/47)   
Compressing objects:  42% (20/47)   
Compressing objects:  44% (21/47)   
Compressing objects:  46% (22/47)   
Compressing objects:  48% (23/47)   
Compressing objects:  51% (24/47)   
Compressing objects:  53% (25/47)   
Compressing objects:  55% (26/47)   
Compressing objects:  57% (27/47)   
Compressing objects:  59% (28/47)   
Compressing objects:  61% (29/47)   
Compressing objects:  63% (30/47)   
Compressing objects:  65% (31/47)   
Compressing objects:  68% (32/47)   
Compressing objects:  70% (33/47)   
Compressing objects:  72% (34/47)   
Compressing objects:  74% (35/47)   
Compressing objects:  76% (36/47)   
Compressing objects:  78% (37/47)   
Compressing objects:  80% (38/47)   
Compressing objects:  82% (39/47)   
Compressing objects:  85% (40/47)   
Compressing objects:  87% (41/47)   
Compressing objects:  89% (42/47)   
Compressing objects:  91% (43/47)   
Compressing objects:  93% (44/47)   
Compressing objects:  95% (45/47)   
Compressing objects:  97% (46/47)   
Compressing objects: 100% (47/47)   
Compressing objects: 100% (47/47), done.
Writing objects:   0% (1/258)   
Writing objects:   1% (3/258)   
Writing objects:   2% (6/258)   
Writing objects:   3% (8/258)   
Writing objects:   4% (11/258)   
Writing objects:   5% (13/258)   
Writing objects:   6% (16/258)   
Writing objects:   7% (19/258)   
Writing objects:   8% (21/258)   
Writing objects:   9% (24/258)   
Writing objects:  10% (26/258)   
Writing objects:  11% (29/258)   
Writing objects:  12% (31/258)   
Writing objects:  13% (34/258)   
Writing objects:  14% (37/258)   
Writing objects:  15% (39/258)   
Writing objects:  16% (42/258)   
Writing objects:  17% (44/258)   
Writing objects:  18% (47/258)   
Writing objects:  19% (50/258)   
Writing objects:  20% (52/258)   
Writing objects:  21% (55/258)   
Writing objects:  22% (57/258)   
Writing objects:  23% (60/258)   
Writing objects:  24% (62/258)   
Writing objects:  25% (65/258)   
Writing objects:  26% (68/258)   
Writing objects:  27% (70/258)   
Writing objects:  28% (73/258)   
Writing objects:  29% (75/258)   
Writing objects:  30% (78/258)   
Writing objects:  31% (80/258)   
Writing objects:  32% (83/258)   
Writing objects:  33% (86/258)   
Writing objects:  34% (88/258)   
Writing objects:  35% (91/258)   
Writing objects:  36% (93/258)   
Writing objects:  37% (96/258)   
Writing objects:  38% (99/258)   
Writing objects:  39% (101/258)   
Writing objects:  40% (104/258)   
Writing objects:  41% (106/258)   
Writing objects:  42% (109/258)   
Writing objects:  43% (111/258)   
Writing objects:  44% (114/258)   
Writing objects:  45% (117/258)   
Writing objects:  46% (119/258)   
Writing objects:  47% (122/258)   
Writing objects:  48% (124/258)   
Writing objects:  49% (127/258)   
Writing objects:  50% (130/258)   
Writing objects:  51% (133/258)   
Writing objects:  52% (136/258)   
Writing objects:  53% (137/258)   
Writing objects:  54% (140/258)   
Writing objects:  55% (142/258)   
Writing objects:  56% (145/258)   
Writing objects:  57% (148/258)   
Writing objects:  58% (150/258)   
Writing objects:  59% (153/258)   
Writing objects:  60% (155/258)   
Writing objects:  61% (158/258)   
Writing objects:  62% (160/258)   
Writing objects:  63% (163/258)   
Writing objects:  64% (166/258)   
Writing objects:  65% (168/258)   
Writing objects:  66% (171/258)   
Writing objects:  67% (173/258)   
Writing objects:  68% (176/258)   
Writing objects:  69% (179/258)   
Writing objects:  70% (181/258)   
Writing objects:  71% (184/258)   
Writing objects:  72% (186/258)   
Writing objects:  73% (189/258)   
Writing objects:  74% (191/258)   
Writing objects:  75% (194/258)   
Writing objects:  76% (197/258)   
Writing objects:  77% (199/258)   
Writing objects:  78% (202/258)   
Writing objects:  79% (204/258)   
Writing objects:  80% (207/258)   
Writing objects:  81% (209/258)   
Writing objects:  82% (212/258)   
Writing objects:  83% (215/258)   
Writing objects:  84% (217/258)   
Writing objects:  85% (220/258)   
Writing objects:  86% (222/258)   
Writing objects:  87% (225/258)   
Writing objects:  88% (228/258)   
Writing objects:  89% (230/258)   
Writing objects:  90% (233/258)   
Writing objects:  91% (235/258)   
Writing objects:  92% (238/258)   
Writing objects:  93% (240/258)   
Writing objects:  94% (243/258)   
Writing objects:  95% (246/258)   
Writing objects:  96% (248/258)   
Writing objects:  97% (251/258)   
Writing objects:  98% (253/258)   
Writing objects:  99% (256/258)   
Writing objects: 100% (258/258)   
Writing objects: 100% (258/258), 46.37 KiB, done.
Total 258 (delta 211), reused 258 (delta 211)
To xen@xenbits.xensource.com:git/linux-pvops.git
   ac7b56f..89d2d13  89d2d133c6947c04a8ab539b997f266535beaafe -> tested/linux-3.0
+ exit 0

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 18 17:45:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Nov 2012 17:45:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Ta8vX-0004Np-89; Sun, 18 Nov 2012 17:45:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1Ta8vV-0004Nk-PY
	for xen-devel@lists.xen.org; Sun, 18 Nov 2012 17:45:02 +0000
Received: from [193.109.254.147:21120] by server-11.bemta-14.messagelabs.com
	id 53/04-29027-D9E19A05; Sun, 18 Nov 2012 17:45:01 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353260700!8740274!1
X-Originating-IP: [147.210.8.143]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32742 invoked from network); 18 Nov 2012 17:45:00 -0000
Received: from iona.labri.fr (HELO iona.labri.fr) (147.210.8.143)
	by server-5.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 18 Nov 2012 17:45:00 -0000
Received: from localhost (localhost [127.0.0.1])
	by iona.labri.fr (Postfix) with ESMTP id BE7AF6B82;
	Sun, 18 Nov 2012 18:44:59 +0100 (CET)
X-Virus-Scanned: amavisd-new at labri.fr
Received: from iona.labri.fr ([127.0.0.1])
	by localhost (iona.labri.fr [127.0.0.1]) (amavisd-new, port 10027)
	with LMTP id nLk9ybVRXa+R; Sun, 18 Nov 2012 18:44:59 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(Client did not present a certificate)
	by iona.labri.fr (Postfix) with ESMTPSA id 3F0DC4E86;
	Sun, 18 Nov 2012 18:44:58 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1Ta8uD-0002mr-4s; Sun, 18 Nov 2012 18:43:41 +0100
Date: Sun, 18 Nov 2012 18:43:41 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Xu Zhang <xzhang@cs.uic.edu>
Message-ID: <20121118174341.GB6017@type>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Xu Zhang <xzhang@cs.uic.edu>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	gm281@cam.ac.uk
References: <50871D90.50606@gmail.com> <20121025205653.GW5925@type.chello.at>
	<5098A674.5090203@cs.uic.edu> <20121110135218.GA5436@type>
	<509FC5F6.4050506@cs.uic.edu> <50A2F8A7.5000202@cs.uic.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A2F8A7.5000202@cs.uic.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: gm281@cam.ac.uk, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Nested events in 64bit mini-OS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Xu Zhang, le Tue 13 Nov 2012 19:49:27 -0600, a =E9crit :
> 1. if event is disabled: doesn't hurt to mask it again;
> 2. if event is enabled: we disable event, and jumps to hypercall_page to
> make a hypercall iret, which eventually calls do_iret:
> =

> In do_iret, line 309:
>      /* Restore upcall mask from supplied EFLAGS.IF. */
>      vcpu_info(v, evtchn_upcall_mask) =3D !(iret_saved.rflags &
> X86_EFLAGS_IF);

Ah, right. Disabling events just before the jmp seems all right to me
then.

> Correct me if I am wrong, I think hypercall_page is mapped at runtime to
> guest OS by Xen. It's not actually part of the critical section of guest =
OS,
> at least not at compile time.

Sure. I meant it'd mean a second fixup table, but who knows what code is
there, it could be tampering with the stack.

> Following the discussion above, we could easily avoid such fixup table
> by mask out the events.

Completely.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 18 17:45:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Nov 2012 17:45:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Ta8vX-0004Np-89; Sun, 18 Nov 2012 17:45:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1Ta8vV-0004Nk-PY
	for xen-devel@lists.xen.org; Sun, 18 Nov 2012 17:45:02 +0000
Received: from [193.109.254.147:21120] by server-11.bemta-14.messagelabs.com
	id 53/04-29027-D9E19A05; Sun, 18 Nov 2012 17:45:01 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353260700!8740274!1
X-Originating-IP: [147.210.8.143]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32742 invoked from network); 18 Nov 2012 17:45:00 -0000
Received: from iona.labri.fr (HELO iona.labri.fr) (147.210.8.143)
	by server-5.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 18 Nov 2012 17:45:00 -0000
Received: from localhost (localhost [127.0.0.1])
	by iona.labri.fr (Postfix) with ESMTP id BE7AF6B82;
	Sun, 18 Nov 2012 18:44:59 +0100 (CET)
X-Virus-Scanned: amavisd-new at labri.fr
Received: from iona.labri.fr ([127.0.0.1])
	by localhost (iona.labri.fr [127.0.0.1]) (amavisd-new, port 10027)
	with LMTP id nLk9ybVRXa+R; Sun, 18 Nov 2012 18:44:59 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(Client did not present a certificate)
	by iona.labri.fr (Postfix) with ESMTPSA id 3F0DC4E86;
	Sun, 18 Nov 2012 18:44:58 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1Ta8uD-0002mr-4s; Sun, 18 Nov 2012 18:43:41 +0100
Date: Sun, 18 Nov 2012 18:43:41 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Xu Zhang <xzhang@cs.uic.edu>
Message-ID: <20121118174341.GB6017@type>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Xu Zhang <xzhang@cs.uic.edu>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	gm281@cam.ac.uk
References: <50871D90.50606@gmail.com> <20121025205653.GW5925@type.chello.at>
	<5098A674.5090203@cs.uic.edu> <20121110135218.GA5436@type>
	<509FC5F6.4050506@cs.uic.edu> <50A2F8A7.5000202@cs.uic.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A2F8A7.5000202@cs.uic.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: gm281@cam.ac.uk, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Nested events in 64bit mini-OS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Xu Zhang, le Tue 13 Nov 2012 19:49:27 -0600, a =E9crit :
> 1. if event is disabled: doesn't hurt to mask it again;
> 2. if event is enabled: we disable event, and jumps to hypercall_page to
> make a hypercall iret, which eventually calls do_iret:
> =

> In do_iret, line 309:
>      /* Restore upcall mask from supplied EFLAGS.IF. */
>      vcpu_info(v, evtchn_upcall_mask) =3D !(iret_saved.rflags &
> X86_EFLAGS_IF);

Ah, right. Disabling events just before the jmp seems all right to me
then.

> Correct me if I am wrong, I think hypercall_page is mapped at runtime to
> guest OS by Xen. It's not actually part of the critical section of guest =
OS,
> at least not at compile time.

Sure. I meant it'd mean a second fixup table, but who knows what code is
there, it could be tampering with the stack.

> Following the discussion above, we could easily avoid such fixup table
> by mask out the events.

Completely.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 18 20:50:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Nov 2012 20:50:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaBom-0004ng-6u; Sun, 18 Nov 2012 20:50:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TaBok-0004na-Rn
	for Xen-devel@lists.xen.org; Sun, 18 Nov 2012 20:50:15 +0000
Received: from [193.109.254.147:5900] by server-12.bemta-14.messagelabs.com id
	EE/B3-00510-60A49A05; Sun, 18 Nov 2012 20:50:14 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353271812!11416951!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDI3MTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27148 invoked from network); 18 Nov 2012 20:50:13 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-3.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 18 Nov 2012 20:50:13 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id D968B2DA8;
	Sun, 18 Nov 2012 22:50:11 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 92EC6EC027; Sun, 18 Nov 2012 22:50:11 +0200 (EET)
Date: Sun, 18 Nov 2012 22:50:11 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Message-ID: <20121118205011.GP8912@reaktio.net>
References: <CAN=sCCEtV1PS-a7MtSjsX=XKRqQCoabvNUY-F1xD-sjMmrJE+A@mail.gmail.com>
	<CAN=sCCFcsZUZYKiOVqOF=DzM8VpSEEOSUfmjLh2+DKOrkG+b2g@mail.gmail.com>
	<CAN=sCCGWU4Wpg9QfFaoPLUBmo_rXTf4h=F4g+ES0CHFhGU=0KQ@mail.gmail.com>
	<1349278604.650.162.camel@zakaz.uk.xensource.com>
	<CAN=sCCEO63JgWCUbosP5+exL4aU=yjaM_VPOxbjh6=C6r8CAhg@mail.gmail.com>
	<1349282150.650.181.camel@zakaz.uk.xensource.com>
	<20121014110311.GD8912@reaktio.net>
	<1350287790.14440.1.camel@dagon.hellion.org.uk>
	<CAFLBxZbpXLhX8ij4YqAm+3oEJbeAGEZz2=O8YVfc4tj8pRBCbg@mail.gmail.com>
	<20646.29021.714271.894762@mariner.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20646.29021.714271.894762@mariner.uk.xensource.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Valtteri Kiviniemi <kiviniemi.valtteri@gmail.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"Xen-devel@lists.xen.org" <Xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen 4.2.0, xl toolstack cant launch older domUs
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 16, 2012 at 05:01:17PM +0000, Ian Jackson wrote:
> George Dunlap writes ("Re: [Xen-devel] Xen 4.2.0, xl toolstack cant launch older domUs"):
> > On Mon, Oct 15, 2012 at 8:56 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > >> > It appears that xend includes some sort of workaround for this which xl
> > >> > does not.
> ...
> 
> This relates to writing
>   /local/domain/$(xl domid lightning)/device/vbd/51713/protocol x86_32-abi
> 
> > I suppose this kind of thing should be tracked, to make sure it
> > doesn't fall on the floor.  I'll add it to my list (with no owner
> > ATM).
> 
> Did this ever get fixed ?
> 

I don't think it's fixed yet..

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 18 20:50:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Nov 2012 20:50:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaBom-0004ng-6u; Sun, 18 Nov 2012 20:50:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TaBok-0004na-Rn
	for Xen-devel@lists.xen.org; Sun, 18 Nov 2012 20:50:15 +0000
Received: from [193.109.254.147:5900] by server-12.bemta-14.messagelabs.com id
	EE/B3-00510-60A49A05; Sun, 18 Nov 2012 20:50:14 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353271812!11416951!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDI3MTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27148 invoked from network); 18 Nov 2012 20:50:13 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-3.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 18 Nov 2012 20:50:13 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id D968B2DA8;
	Sun, 18 Nov 2012 22:50:11 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 92EC6EC027; Sun, 18 Nov 2012 22:50:11 +0200 (EET)
Date: Sun, 18 Nov 2012 22:50:11 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Message-ID: <20121118205011.GP8912@reaktio.net>
References: <CAN=sCCEtV1PS-a7MtSjsX=XKRqQCoabvNUY-F1xD-sjMmrJE+A@mail.gmail.com>
	<CAN=sCCFcsZUZYKiOVqOF=DzM8VpSEEOSUfmjLh2+DKOrkG+b2g@mail.gmail.com>
	<CAN=sCCGWU4Wpg9QfFaoPLUBmo_rXTf4h=F4g+ES0CHFhGU=0KQ@mail.gmail.com>
	<1349278604.650.162.camel@zakaz.uk.xensource.com>
	<CAN=sCCEO63JgWCUbosP5+exL4aU=yjaM_VPOxbjh6=C6r8CAhg@mail.gmail.com>
	<1349282150.650.181.camel@zakaz.uk.xensource.com>
	<20121014110311.GD8912@reaktio.net>
	<1350287790.14440.1.camel@dagon.hellion.org.uk>
	<CAFLBxZbpXLhX8ij4YqAm+3oEJbeAGEZz2=O8YVfc4tj8pRBCbg@mail.gmail.com>
	<20646.29021.714271.894762@mariner.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20646.29021.714271.894762@mariner.uk.xensource.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Valtteri Kiviniemi <kiviniemi.valtteri@gmail.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"Xen-devel@lists.xen.org" <Xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen 4.2.0, xl toolstack cant launch older domUs
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 16, 2012 at 05:01:17PM +0000, Ian Jackson wrote:
> George Dunlap writes ("Re: [Xen-devel] Xen 4.2.0, xl toolstack cant launch older domUs"):
> > On Mon, Oct 15, 2012 at 8:56 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > >> > It appears that xend includes some sort of workaround for this which xl
> > >> > does not.
> ...
> 
> This relates to writing
>   /local/domain/$(xl domid lightning)/device/vbd/51713/protocol x86_32-abi
> 
> > I suppose this kind of thing should be tracked, to make sure it
> > doesn't fall on the floor.  I'll add it to my list (with no owner
> > ATM).
> 
> Did this ever get fixed ?
> 

I don't think it's fixed yet..

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 18 21:02:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Nov 2012 21:02:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaC0R-0004yY-Dv; Sun, 18 Nov 2012 21:02:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TaC0P-0004yT-JL
	for xen-devel@lists.xen.org; Sun, 18 Nov 2012 21:02:18 +0000
Received: from [85.158.139.211:19441] by server-13.bemta-5.messagelabs.com id
	CC/5F-27809-8DC49A05; Sun, 18 Nov 2012 21:02:16 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353272535!20590282!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDMxNTg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3926 invoked from network); 18 Nov 2012 21:02:15 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-12.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 18 Nov 2012 21:02:15 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id F00411723;
	Sun, 18 Nov 2012 23:02:14 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 592D3EC027; Sun, 18 Nov 2012 23:02:14 +0200 (EET)
Date: Sun, 18 Nov 2012 23:02:14 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121118210214.GQ8912@reaktio.net>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
	<1353084913.3499.240.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353084913.3499.240.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 0 of 5] docs: x86 PV MMU related functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 16, 2012 at 04:55:13PM +0000, Ian Campbell wrote:
> On Fri, 2012-11-02 at 11:18 +0000, Ian Campbell wrote:
> > 
> > I also have a draft of a wiki article on the subject which references
> > the information in the public headers which I hope to post soon. 
> 
> I realised I forgot to do this...
> 
> It needs some polish but the majority of the XXX's are placeholder for
> links to the result of this applying this series.
> 

Hello,

Comments about some small typos..


> 8<------------------------------------
> 
> Paravirtualised X86 Memory Management
> 
> = Intro =
> 
> One of the original innovations of the Xen hypervisor was the a
                                                            ^^^^^

"was the a paravirtualisation". Extra "a" ? 


> paravirtualisation of the memory management unit (MMU). This allowed
> for fas and efficient virtualisation of Operating Systems which used
        ^^

"fast".

> paging compared to contemporary techniques.
> 
> In this article we will describe the functionality of the PV MMU for
> X86 Xen guests. A familiarity with X86 paging and related concepts
> will be assumed.
> 
> Other guest types, such as HVM or PVH guests on X86 or guest on ARM
> achieve virtualisation of the MMU usaing other techniques, such as the
                                    ^^^^^^

"using".

> use of hardware assisted or shadow paging.
> 
> = Direct Paging =
> 
> In order to virtualised the memory subsystem all hypervisors introduce
                      ^^^

"to virtualise" ? 


-- Pasi


> an additional level of abstraction between what the guest sees as
> physical memory (pseudo-physical) and the underlying memory of the
> machine (called machine addresses in Xen). This is usually done
> through the introduction of a physical to machine (P2M)
> mapping. Typically this would be maintained within the hypervisor and
> hidden from the guest Operating System through techniques such as
> Shadow Paging.
> 
> The Xen paravirtualised MMU model instead requires that the guest be
> aware of the P2M mapping and be modified such that instead of writing
> page table entries mapping virtual addresses to the physical address
> space it would instead write entries mapping virtual addresses
> directly to the machine address space by mapping from pseudo physical
> to machine addresses using the P2M as it writes its page tables. This
> technique is known as direct paging.
> 
> = Page Types and Invariants =
> 
> In order to ensure that the guest cannot subvert the system Xen
> requires that certain invariants are met and therefore that all
> updates to the page table updates are performed by Xen through the use
> of hypercalls.
> 
> To this end Xen defines a number of page types and ensures that any
> given page has exactly one type at any given time. The type of a page
> is reference counted and can only be changed when the "type count" is
> zero.
> 
> The basic types are:
> 
> * None: No special uses.
> * Page table page: Pages used as page tables (there are separate types
>   for each of the 4 levels on 64 bit and 3 levels on 32 bit PAE
>   guests).
> * Segment descriptor page: Page is used as part of the Global or Local
>   Descriptor table (GDT/LDT).
> * Writeable: Page is writable.
> 
> Xen enforces the invariant that only pages with the writable type have
> a writable mapping in the page tables. Likewise it ensures that no
> writable mapping exists of a page with any other type. It also
> enforces other invariants such as requiring that no page table page
> can make a non-privlieged mapping of the hypervisor's virutal address
> space etc. By doing this it can ensure that the guest OS is not able
> to directly modify any critical data structures and therefore subvert
> the safety of the system, for example to map machine addresses which
> do not belong to it.
> 
> Whenever a set of page-tables is loaded into the hardware page-table
> base register ('cr3') the hypervisor must take an appropriate type
> reference with the root page-table type (that is, an L4 reference on
> 64-bit or an L3 reference on 32-bit). If the page is not already of
> the required type then in order to take the initial reference it must
> first have a type count of zero (remember, a pages' type only be
> change while the type count is zero) and must be validated to ensure
> that it respects the invariants. This in turn means that the pages
> referenced by the root page-table must be validates as having the
> correct type (i.e. L3 or L2 on 64- or 32-bit repsectively), and so on
> down to the data pages at the leafs of the page-table, thereby
> ensuring that the page table as a whole is safe to load into 'cr3'.
> 
> XXX link to appropriate header.
> 
> In order to maintain the necessary invariants Xen must be involved in
> all updates to the page tables, as well as various other privileged
> operations. These are covered in the following sections.
> 
> In order to prevent guest operating systems from subverting these
> mechanisms it is also necessary for guest kernels to run without the
> normal privileges associated with running in processor ring-0. For this
> reason Xen PV guest kernels usually run in either ring-1 (32-bit
> guests) or ring-3 (64-bit guests).
> 
> = Updating Page Tables =
> 
> Since the page tables are not writable by the guest Xen provides
> several machanisms by which the guest can update a page table entry.
> 
> == mmu_update hypercall ==
> 
> The first mechanism provided by Xen is the HYPERVISOR_mmu_update
> hypercall [XXX link]. This hypercall has the prototype:
> 
>   struct mmu_update {
>       uint64_t ptr;       /* Machine address of PTE. */
>       uint64_t val;       /* New contents of PTE.    */
>   };
> 
>   long HYPERVISOR_mmu_update(const struct mmu_update reqs[],
>                              unsigned count, unsigned *done_out,
>                              unsigned foreigndom)
> 
> The operation takes an array of 'count' requests 'reqs'. The
> 'done_out' paramter returns an indication of the number of successful
> operations. 'foreigndom' can be used by a suitably privileged domain
> to access memory belonging to other domains (this usage is not covered
> here).
> 
> Each request is a ('ptr','value') pair. The 'ptr' field is further
> divides into 'ptr[1:0]' indicating the type of update to perform and
> 'ptr[:2]' which indicates the the address to update.
>  
> The valid values for 'ptr[1:0]' are:
> 
> * MMU_NORMAL_PT_UPDATE: A normal page table update. 'ptr[:2]' contains
>   the machine address of the entry to update while 'val' is the Page
>   Table Entry to write. This effectively implements '*ptr = val' with
>   checks to ensure that the required invariants aree preserved.
> * MMU_MACHPHYS_UPDATE: Update the machine to physical address
>   mapping. This is covered below, see [XXX link]
> * MMU_PT_UPDATE_PRESERVE_AD: As per MMU_NORMAL_PT_UPDATE but
>   preserving the Accessed and Dirty bits in the page table entry. The
>   'val' here is almost a standard Page Table Entry but with some
>   special handling. See the [XXX link hypercall documentation] for more
>   information.
> 
> == update_va_mapping hypercall ==
> 
> The second mechanism provided by Xen is the
> HYPERVISOR_update_va_mapping hypercall [XXX link]. This hypercall has
> the prototype:
> 
>   long
>   HYPERVISOR_update_va_mapping(unsigned long va, u64 val,
>                                enum update_va_mapping_flags flags)
> 
> This operation simply updates the leaf PTE entry (called and L1 in
> Xen) which maps the virtual address 'va' with the given value
> 'val', while of course performing the expected checks to ensure that
> the invariants are maintained. This can be though of as updating the
> PTE using a [XXX link linear mapping].
> 
> The flags parameter can be used to request that Xen flush the TLB
> entries associated with the update. See the [XXX link hypercall
> documentation for more].
> 
> == Trap and emulate of page table writes ==
> 
> As well as the above Xen can also trap and emulate updates to leaf
> page table entries (L1) only. This trapping and emulating is
> relatively expensive and is best avoided but for little used code
> paths can provide a reasonable trade off vs.the requirement to modify
> the callsite in the guest OS.
> 
> = Other privileged operations =
> 
> As well as moderating page table updates in order to maintain the
> necessary invariants Xen must also be involved in certain other
> privileged operations, such as setting a new page table base
> ('cr3'). Because the guest kernel no longer runs in ring-0 certain
> other privleged operations must also be done by the hypervisor, such
> as flushing the TLB.
> 
> These operations are performed via the HYPERVISOR_mmuext_op hypercall
> [XXX link]. This hypercall has the following prototype:
> 
>   struct mmuext_op {
>       unsigned int cmd; /* => enum mmuext_cmd */
>       union {
>           /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR
>            * CLEAR_PAGE, COPY_PAGE, [UN]MARK_SUPER */
>           xen_pfn_t     mfn;
>           /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */
>           unsigned long linear_addr;
>       } arg1;
>       union {
>           /* SET_LDT */
>           unsigned int nr_ents;
>           /* TLB_FLUSH_MULTI, INVLPG_MULTI */
>           const void *vcpumask;
>           /* COPY_PAGE */
>           xen_pfn_t src_mfn;
>       } arg2;
>   };
> 
>   long
>   HYPERVISOR_mmuext_op(struct mmuext_op uops[],
>                        unsigned int count,
>                        unsigned int *pdone,
>                        unsigned int foreigndom)
> 
> The hypercall takes an array of 'count' operations each specified by
> the 'mmuext_op' struct. This hypercall allows access to various
> operations which must be performed via the hypervisor either because
> the guest kernel is no longer privileged or because the hypervisor
> must be involed in order to maintain safety, in general each available
> command corresponds to a low-level processor function. The include
> NEWBASE_PTR (write cr3), various types of TLB and cache flush and to
> set the LDT table address (see below). For more information on the
> available operations please see [XXX link the hypercall
> documentation].
> 
> = Pinning Page Tables =
> 
> As discussed above Xen ensures that various invariants are met
> concerning whether certain pages are mapped writable or not. This
> in turn means that Xen needs to validate the page tables whenever they
> are loaded into 'cr3'. However this is a potentially expensive
> operation since Xen needs to walk the complete set of page-tables and
> validate each one recursivley.
> 
> In order to avoid this expense every time 'cr3' changes (i.e. on every
> context switch). Xen allows a page to be explictly ''pinned'' to a
> give type. This effectively means taking an extra reference of the
> relevant page table type, thereby forcing Xen to validate the
> page-table up front and to maintain the invariants for as long as the
> pin remains in place. By doing this the guest ensures that when a new
> 'cr3' is loaded the referenced page already has the appropriate type
> (L4 or L3) and therefore the type count can simply be incremented
> without the need to validate.
> 
> For maximum performance a guest OS kernel will usually want to perform
> a pin operation as late as possible during the setup of a new set of
> page tables, so as to be able to construct them using normal writable
> mappings before blessing them as a set of page tables. Likewise on
> page-table teardown a guest OS will usually want to unpin the pages as
> soon as possible such that it can teardown the page tables without the
> use of hypercalls. These operations are usually refered to as 'late
> pin' and 'early unpin'.
> 
> = The Physical-to-machine and machine-to-physical mapping tables =
> 
> As discussed above direct paging requires that the guest Operating
> System be aware of the mapping between (pseudo-physical) and machine
> addresses (the P2M table). In addition in order to be able to read PTE
> entries (which contain machine addresses) and convert them back into
> pseudo-physical addresses a translation between, this is done using
> the M2P table.
> 
> Each table is a simple array of frame numbers, indexed by either
> physical or machine frames and looking up the other.
> 
> Since the P2M is sized according to the guest's pseudo-physical
> address it is left entirely up to the guest to provide and maintain in
> its own pages.
> 
> However the M2P must be sized according to the total amount of RAM in
> the host and therefore could be of considerable ize compared to the
> amount of RAM available to the guest, not to mention sparse from the
> guest's point of view since the majority of machine pages will not
> belong to it.
> 
> For this reason Xen exposes a read-only M2P of the entire host to the
> guest and allows guests to update this table using the
> MMU_MACHPHYS_UPDATE sub-op of the HYPERVISOR_mmu_update hypercall [XXX
> link].
> 
> = Descriptor Tables =
> 
> As well as protecting page tables from being writable by the guest Xen
> also requires that various descriptor tables must be made unavailable
> to the guest.
> 
> == Interrupt Descriptor Table ==
> 
> A Xen guest cannot access the IDT directly. Instead Xen maintains its
> own IDT and allows guest to write entries using the
> HYPERVISOR_set_trap_table hypercall. This has the following prototype:
> XXX link.
> 
>   struct trap_info {
>       uint8_t       vector;  /* exception vector
> */
>       uint8_t       flags;   /* 0-3: privilege level; 4: clear event
> enable?  */
>       uint16_t      cs;      /* code selector
> */
>       unsigned long address; /* code offset
> */
>   };
>   long HYPERVISOR_set_trap_table(const struct trap_info traps[]);
> 
> The entires of the ''trap_info'' struct correspond to the fields of a
> native IDT entry and each will be validated by Xen before it is
> used. The hypercall takes an array of traps terminated by an entry
> where ''address'' is zero.
> 
> == Global/Local Descriptor Tables ==
> 
> A Xen guest is not able to access the Global or Local descriptor
> tables directly. Pages which are in use as part of either table are
> given their own distinct type and must therefore be mapped as
> read-only in the guest. 
> 
> 
> The guest is also not privileged to update the descriptor base
> registers and must therefore do so using a hypercall. The hypercall to
> update the GDT is:
> 
>   long HYPERVISOR_set_gdt(const xen_pfn_t frames[], unsigned int
> entries);
> 
> This takes an array of machine frame numbers which are validated and
> loaded into the virtual GDTR. Note that unlike native X86 these are
> machine frames and not virtual addresses. These frames will be mapped
> by Xen into the virtual address which it reserves for this purpose.
> 
> The LDT is set using the MMUEXT_SET_LDT sub-op of the
> HYPERVISOR_mmuext_op hypercall. [XXX link.] XXX a single page?
> 
> Finally since the pages cannot be mapped as writable by the guest the
> HYPERVISOR_update_descriptor hypercall is provided:
> 
>   long HYPERVISOR_update_descriptor(u64 pa, u64 desc);
> 
> It takes a machine physical address of a descriptor entry to update
> and the requested contents of the descriptor itself, in the same
> format as the native descriptors.
> 
> = Start Of Day = 
> 
> The initial boot time environment of a Xen PV guest is somewhat
> different to the normal initial mode of an X86 processor. Rather than
> starting out in 16-bit mode with paging disabled a PV guest is
> started in either 32- or 64- bit mode with paging enabled running on
> an initial set of page tables provided by the hypervisor. These pages
> will be setup so as to meet the required invariants and will be loaded
> into the 'cr3' register but will not be explicitly pinned (in other
> words their type count is effectively one)
> 
> The initial virtual and pseudo-physical layout of a new guest is
> described in XXX
> file:///home/ijc/devel/xen-unstable.hg/docs/html/hypercall/include,public,xen.h.html#incontents_startofday
> 
> = Virtual Address Space =
> 
> Xen enforces certain restrictions on the virtual addresses which are
> available to PV guests. These are enforced as part of the machinery for
> typing and writing page tables.
> 
> Xen uses this to reserve certain addresses for its own use. Certain
> areas are also read-only for guests and contain shared datastructures
> such as the Macine-to-physical address lookup table.
> 
> For a 64-bit guest Xen the virtual address space is setout as follows:
> 
> 0x0000000000000000-0x00007fffffffffff Fully available to guests
> 0x0000800000000000-0xffff7fffffffffff Inaccessible (addresses are 48-bit
> sign extended)
> 0xffff800000000000-0xffff807fffffffff Read only to guests.
> 0xffff808000000000-0xffff87ffffffffff Reserved for Xen use
> 0xffff880000000000-0xffffffffffffffff Fully Available to guests
> 
> For 32-bit guests running on a 64-bit hypervisor guests the virtual
> address space under 4G (which is all such guests can access is:
> 0x00000000-0xf57fffff Fully available to guests
> 0xf5800000-0xffffffff Read only to guests.
> 
> For more information see "Memory Layout" under [XXX link
> xen/include/asm-x86/config.h]
> 
> = Batching =
> 
> For some memory management operations the overhead of making many
> hypercalls can become prohibively expensive. For this reason many of
> the hypercalls described above take a list of operations to
> perform. In addition Xen provides the concept of a multicall which can
> allow several different hypercalls to be batched
> together. HYPERVISOR_multicall has this prototype:
> 
>   struct multicall_entry {
>       unsigned long op, result;
>       unsigned long args[6];
>   };
>   long HYPERVISOR_multicall(multicall_entry_t call_list[],
>                             unsigned int nr_calls);
> 
> Each entry represents a hypercall and its associated arguments in the
> (hopefully) obvious way.
> 
> = Guest Specific Details
> 
> == Linux paravirt_ops ==
> 
> === General PV MMU operation ===
> 
> The Linux ''paravirt_ops'' infrastructure provides a mechanism by
> which the low-level MMU operations are abstracted into function
> pointers allowing the native operations where necessary.
> 
> From the point of view of MMU operations the main entry point is
> ''struct pv_mmu_ops''. This contains entry points for low level
> operations such as:
> 
>  * Allocating/freeing page table entries. These allow the kernel to
>    mark the pages read-only and read-write as the pages are reused.
>  * Creating, writing and reading PTE entries. These allow the kernel
>    to make the necessary translations between pseudo-physical and
>    machine addressing as well as using hypercalls instead of direct
>    writes.
>  * Reading and writing of control registers, e.g. cr3, to allow
>    hypercalls to be inserted.
>  * Various TLB flush operations, again to allow their replacement by
>    hypercalls.
> 
> As well as these the interface includes some higher-level operations
> which allow for more efficient batching of compound operations such as
> duplicating (forking) a memory map. This is achieved by using the
> ''lazy_mmu_ops'' hooks to implement buffering of operations
> and flushing of larger batches or upon completion.
> 
> The Xen paravirt_ops backend uses an additional page flag,
> ''PG_pinned'' in order to track whether a page has been pinned or not
> and implemented the late-pin early-unpin scheme described above.
> 
> === Start of Day issues ===
> 
> XXX get someone to describe these...
> 
> = References =
> 
> [XXX Xen and the art of virtualisation.]
> [XXX The hypercall interface documentation.]
> [XXX others? Chisnal Book?]
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 18 21:02:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Nov 2012 21:02:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaC0R-0004yY-Dv; Sun, 18 Nov 2012 21:02:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TaC0P-0004yT-JL
	for xen-devel@lists.xen.org; Sun, 18 Nov 2012 21:02:18 +0000
Received: from [85.158.139.211:19441] by server-13.bemta-5.messagelabs.com id
	CC/5F-27809-8DC49A05; Sun, 18 Nov 2012 21:02:16 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353272535!20590282!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDMxNTg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3926 invoked from network); 18 Nov 2012 21:02:15 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-12.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 18 Nov 2012 21:02:15 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id F00411723;
	Sun, 18 Nov 2012 23:02:14 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 592D3EC027; Sun, 18 Nov 2012 23:02:14 +0200 (EET)
Date: Sun, 18 Nov 2012 23:02:14 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121118210214.GQ8912@reaktio.net>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
	<1353084913.3499.240.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353084913.3499.240.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 0 of 5] docs: x86 PV MMU related functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 16, 2012 at 04:55:13PM +0000, Ian Campbell wrote:
> On Fri, 2012-11-02 at 11:18 +0000, Ian Campbell wrote:
> > 
> > I also have a draft of a wiki article on the subject which references
> > the information in the public headers which I hope to post soon. 
> 
> I realised I forgot to do this...
> 
> It needs some polish but the majority of the XXX's are placeholder for
> links to the result of this applying this series.
> 

Hello,

Comments about some small typos..


> 8<------------------------------------
> 
> Paravirtualised X86 Memory Management
> 
> = Intro =
> 
> One of the original innovations of the Xen hypervisor was the a
                                                            ^^^^^

"was the a paravirtualisation". Extra "a" ? 


> paravirtualisation of the memory management unit (MMU). This allowed
> for fas and efficient virtualisation of Operating Systems which used
        ^^

"fast".

> paging compared to contemporary techniques.
> 
> In this article we will describe the functionality of the PV MMU for
> X86 Xen guests. A familiarity with X86 paging and related concepts
> will be assumed.
> 
> Other guest types, such as HVM or PVH guests on X86 or guest on ARM
> achieve virtualisation of the MMU usaing other techniques, such as the
                                    ^^^^^^

"using".

> use of hardware assisted or shadow paging.
> 
> = Direct Paging =
> 
> In order to virtualised the memory subsystem all hypervisors introduce
                      ^^^

"to virtualise" ? 


-- Pasi


> an additional level of abstraction between what the guest sees as
> physical memory (pseudo-physical) and the underlying memory of the
> machine (called machine addresses in Xen). This is usually done
> through the introduction of a physical to machine (P2M)
> mapping. Typically this would be maintained within the hypervisor and
> hidden from the guest Operating System through techniques such as
> Shadow Paging.
> 
> The Xen paravirtualised MMU model instead requires that the guest be
> aware of the P2M mapping and be modified such that instead of writing
> page table entries mapping virtual addresses to the physical address
> space it would instead write entries mapping virtual addresses
> directly to the machine address space by mapping from pseudo physical
> to machine addresses using the P2M as it writes its page tables. This
> technique is known as direct paging.
> 
> = Page Types and Invariants =
> 
> In order to ensure that the guest cannot subvert the system Xen
> requires that certain invariants are met and therefore that all
> updates to the page table updates are performed by Xen through the use
> of hypercalls.
> 
> To this end Xen defines a number of page types and ensures that any
> given page has exactly one type at any given time. The type of a page
> is reference counted and can only be changed when the "type count" is
> zero.
> 
> The basic types are:
> 
> * None: No special uses.
> * Page table page: Pages used as page tables (there are separate types
>   for each of the 4 levels on 64 bit and 3 levels on 32 bit PAE
>   guests).
> * Segment descriptor page: Page is used as part of the Global or Local
>   Descriptor table (GDT/LDT).
> * Writeable: Page is writable.
> 
> Xen enforces the invariant that only pages with the writable type have
> a writable mapping in the page tables. Likewise it ensures that no
> writable mapping exists of a page with any other type. It also
> enforces other invariants such as requiring that no page table page
> can make a non-privlieged mapping of the hypervisor's virutal address
> space etc. By doing this it can ensure that the guest OS is not able
> to directly modify any critical data structures and therefore subvert
> the safety of the system, for example to map machine addresses which
> do not belong to it.
> 
> Whenever a set of page-tables is loaded into the hardware page-table
> base register ('cr3') the hypervisor must take an appropriate type
> reference with the root page-table type (that is, an L4 reference on
> 64-bit or an L3 reference on 32-bit). If the page is not already of
> the required type then in order to take the initial reference it must
> first have a type count of zero (remember, a pages' type only be
> change while the type count is zero) and must be validated to ensure
> that it respects the invariants. This in turn means that the pages
> referenced by the root page-table must be validates as having the
> correct type (i.e. L3 or L2 on 64- or 32-bit repsectively), and so on
> down to the data pages at the leafs of the page-table, thereby
> ensuring that the page table as a whole is safe to load into 'cr3'.
> 
> XXX link to appropriate header.
> 
> In order to maintain the necessary invariants Xen must be involved in
> all updates to the page tables, as well as various other privileged
> operations. These are covered in the following sections.
> 
> In order to prevent guest operating systems from subverting these
> mechanisms it is also necessary for guest kernels to run without the
> normal privileges associated with running in processor ring-0. For this
> reason Xen PV guest kernels usually run in either ring-1 (32-bit
> guests) or ring-3 (64-bit guests).
> 
> = Updating Page Tables =
> 
> Since the page tables are not writable by the guest Xen provides
> several machanisms by which the guest can update a page table entry.
> 
> == mmu_update hypercall ==
> 
> The first mechanism provided by Xen is the HYPERVISOR_mmu_update
> hypercall [XXX link]. This hypercall has the prototype:
> 
>   struct mmu_update {
>       uint64_t ptr;       /* Machine address of PTE. */
>       uint64_t val;       /* New contents of PTE.    */
>   };
> 
>   long HYPERVISOR_mmu_update(const struct mmu_update reqs[],
>                              unsigned count, unsigned *done_out,
>                              unsigned foreigndom)
> 
> The operation takes an array of 'count' requests 'reqs'. The
> 'done_out' paramter returns an indication of the number of successful
> operations. 'foreigndom' can be used by a suitably privileged domain
> to access memory belonging to other domains (this usage is not covered
> here).
> 
> Each request is a ('ptr','value') pair. The 'ptr' field is further
> divides into 'ptr[1:0]' indicating the type of update to perform and
> 'ptr[:2]' which indicates the the address to update.
>  
> The valid values for 'ptr[1:0]' are:
> 
> * MMU_NORMAL_PT_UPDATE: A normal page table update. 'ptr[:2]' contains
>   the machine address of the entry to update while 'val' is the Page
>   Table Entry to write. This effectively implements '*ptr = val' with
>   checks to ensure that the required invariants aree preserved.
> * MMU_MACHPHYS_UPDATE: Update the machine to physical address
>   mapping. This is covered below, see [XXX link]
> * MMU_PT_UPDATE_PRESERVE_AD: As per MMU_NORMAL_PT_UPDATE but
>   preserving the Accessed and Dirty bits in the page table entry. The
>   'val' here is almost a standard Page Table Entry but with some
>   special handling. See the [XXX link hypercall documentation] for more
>   information.
> 
> == update_va_mapping hypercall ==
> 
> The second mechanism provided by Xen is the
> HYPERVISOR_update_va_mapping hypercall [XXX link]. This hypercall has
> the prototype:
> 
>   long
>   HYPERVISOR_update_va_mapping(unsigned long va, u64 val,
>                                enum update_va_mapping_flags flags)
> 
> This operation simply updates the leaf PTE entry (called and L1 in
> Xen) which maps the virtual address 'va' with the given value
> 'val', while of course performing the expected checks to ensure that
> the invariants are maintained. This can be though of as updating the
> PTE using a [XXX link linear mapping].
> 
> The flags parameter can be used to request that Xen flush the TLB
> entries associated with the update. See the [XXX link hypercall
> documentation for more].
> 
> == Trap and emulate of page table writes ==
> 
> As well as the above Xen can also trap and emulate updates to leaf
> page table entries (L1) only. This trapping and emulating is
> relatively expensive and is best avoided but for little used code
> paths can provide a reasonable trade off vs.the requirement to modify
> the callsite in the guest OS.
> 
> = Other privileged operations =
> 
> As well as moderating page table updates in order to maintain the
> necessary invariants Xen must also be involved in certain other
> privileged operations, such as setting a new page table base
> ('cr3'). Because the guest kernel no longer runs in ring-0 certain
> other privleged operations must also be done by the hypervisor, such
> as flushing the TLB.
> 
> These operations are performed via the HYPERVISOR_mmuext_op hypercall
> [XXX link]. This hypercall has the following prototype:
> 
>   struct mmuext_op {
>       unsigned int cmd; /* => enum mmuext_cmd */
>       union {
>           /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR
>            * CLEAR_PAGE, COPY_PAGE, [UN]MARK_SUPER */
>           xen_pfn_t     mfn;
>           /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */
>           unsigned long linear_addr;
>       } arg1;
>       union {
>           /* SET_LDT */
>           unsigned int nr_ents;
>           /* TLB_FLUSH_MULTI, INVLPG_MULTI */
>           const void *vcpumask;
>           /* COPY_PAGE */
>           xen_pfn_t src_mfn;
>       } arg2;
>   };
> 
>   long
>   HYPERVISOR_mmuext_op(struct mmuext_op uops[],
>                        unsigned int count,
>                        unsigned int *pdone,
>                        unsigned int foreigndom)
> 
> The hypercall takes an array of 'count' operations each specified by
> the 'mmuext_op' struct. This hypercall allows access to various
> operations which must be performed via the hypervisor either because
> the guest kernel is no longer privileged or because the hypervisor
> must be involed in order to maintain safety, in general each available
> command corresponds to a low-level processor function. The include
> NEWBASE_PTR (write cr3), various types of TLB and cache flush and to
> set the LDT table address (see below). For more information on the
> available operations please see [XXX link the hypercall
> documentation].
> 
> = Pinning Page Tables =
> 
> As discussed above Xen ensures that various invariants are met
> concerning whether certain pages are mapped writable or not. This
> in turn means that Xen needs to validate the page tables whenever they
> are loaded into 'cr3'. However this is a potentially expensive
> operation since Xen needs to walk the complete set of page-tables and
> validate each one recursivley.
> 
> In order to avoid this expense every time 'cr3' changes (i.e. on every
> context switch). Xen allows a page to be explictly ''pinned'' to a
> give type. This effectively means taking an extra reference of the
> relevant page table type, thereby forcing Xen to validate the
> page-table up front and to maintain the invariants for as long as the
> pin remains in place. By doing this the guest ensures that when a new
> 'cr3' is loaded the referenced page already has the appropriate type
> (L4 or L3) and therefore the type count can simply be incremented
> without the need to validate.
> 
> For maximum performance a guest OS kernel will usually want to perform
> a pin operation as late as possible during the setup of a new set of
> page tables, so as to be able to construct them using normal writable
> mappings before blessing them as a set of page tables. Likewise on
> page-table teardown a guest OS will usually want to unpin the pages as
> soon as possible such that it can teardown the page tables without the
> use of hypercalls. These operations are usually refered to as 'late
> pin' and 'early unpin'.
> 
> = The Physical-to-machine and machine-to-physical mapping tables =
> 
> As discussed above direct paging requires that the guest Operating
> System be aware of the mapping between (pseudo-physical) and machine
> addresses (the P2M table). In addition in order to be able to read PTE
> entries (which contain machine addresses) and convert them back into
> pseudo-physical addresses a translation between, this is done using
> the M2P table.
> 
> Each table is a simple array of frame numbers, indexed by either
> physical or machine frames and looking up the other.
> 
> Since the P2M is sized according to the guest's pseudo-physical
> address it is left entirely up to the guest to provide and maintain in
> its own pages.
> 
> However the M2P must be sized according to the total amount of RAM in
> the host and therefore could be of considerable ize compared to the
> amount of RAM available to the guest, not to mention sparse from the
> guest's point of view since the majority of machine pages will not
> belong to it.
> 
> For this reason Xen exposes a read-only M2P of the entire host to the
> guest and allows guests to update this table using the
> MMU_MACHPHYS_UPDATE sub-op of the HYPERVISOR_mmu_update hypercall [XXX
> link].
> 
> = Descriptor Tables =
> 
> As well as protecting page tables from being writable by the guest Xen
> also requires that various descriptor tables must be made unavailable
> to the guest.
> 
> == Interrupt Descriptor Table ==
> 
> A Xen guest cannot access the IDT directly. Instead Xen maintains its
> own IDT and allows guest to write entries using the
> HYPERVISOR_set_trap_table hypercall. This has the following prototype:
> XXX link.
> 
>   struct trap_info {
>       uint8_t       vector;  /* exception vector
> */
>       uint8_t       flags;   /* 0-3: privilege level; 4: clear event
> enable?  */
>       uint16_t      cs;      /* code selector
> */
>       unsigned long address; /* code offset
> */
>   };
>   long HYPERVISOR_set_trap_table(const struct trap_info traps[]);
> 
> The entires of the ''trap_info'' struct correspond to the fields of a
> native IDT entry and each will be validated by Xen before it is
> used. The hypercall takes an array of traps terminated by an entry
> where ''address'' is zero.
> 
> == Global/Local Descriptor Tables ==
> 
> A Xen guest is not able to access the Global or Local descriptor
> tables directly. Pages which are in use as part of either table are
> given their own distinct type and must therefore be mapped as
> read-only in the guest. 
> 
> 
> The guest is also not privileged to update the descriptor base
> registers and must therefore do so using a hypercall. The hypercall to
> update the GDT is:
> 
>   long HYPERVISOR_set_gdt(const xen_pfn_t frames[], unsigned int
> entries);
> 
> This takes an array of machine frame numbers which are validated and
> loaded into the virtual GDTR. Note that unlike native X86 these are
> machine frames and not virtual addresses. These frames will be mapped
> by Xen into the virtual address which it reserves for this purpose.
> 
> The LDT is set using the MMUEXT_SET_LDT sub-op of the
> HYPERVISOR_mmuext_op hypercall. [XXX link.] XXX a single page?
> 
> Finally since the pages cannot be mapped as writable by the guest the
> HYPERVISOR_update_descriptor hypercall is provided:
> 
>   long HYPERVISOR_update_descriptor(u64 pa, u64 desc);
> 
> It takes a machine physical address of a descriptor entry to update
> and the requested contents of the descriptor itself, in the same
> format as the native descriptors.
> 
> = Start Of Day = 
> 
> The initial boot time environment of a Xen PV guest is somewhat
> different to the normal initial mode of an X86 processor. Rather than
> starting out in 16-bit mode with paging disabled a PV guest is
> started in either 32- or 64- bit mode with paging enabled running on
> an initial set of page tables provided by the hypervisor. These pages
> will be setup so as to meet the required invariants and will be loaded
> into the 'cr3' register but will not be explicitly pinned (in other
> words their type count is effectively one)
> 
> The initial virtual and pseudo-physical layout of a new guest is
> described in XXX
> file:///home/ijc/devel/xen-unstable.hg/docs/html/hypercall/include,public,xen.h.html#incontents_startofday
> 
> = Virtual Address Space =
> 
> Xen enforces certain restrictions on the virtual addresses which are
> available to PV guests. These are enforced as part of the machinery for
> typing and writing page tables.
> 
> Xen uses this to reserve certain addresses for its own use. Certain
> areas are also read-only for guests and contain shared datastructures
> such as the Macine-to-physical address lookup table.
> 
> For a 64-bit guest Xen the virtual address space is setout as follows:
> 
> 0x0000000000000000-0x00007fffffffffff Fully available to guests
> 0x0000800000000000-0xffff7fffffffffff Inaccessible (addresses are 48-bit
> sign extended)
> 0xffff800000000000-0xffff807fffffffff Read only to guests.
> 0xffff808000000000-0xffff87ffffffffff Reserved for Xen use
> 0xffff880000000000-0xffffffffffffffff Fully Available to guests
> 
> For 32-bit guests running on a 64-bit hypervisor guests the virtual
> address space under 4G (which is all such guests can access is:
> 0x00000000-0xf57fffff Fully available to guests
> 0xf5800000-0xffffffff Read only to guests.
> 
> For more information see "Memory Layout" under [XXX link
> xen/include/asm-x86/config.h]
> 
> = Batching =
> 
> For some memory management operations the overhead of making many
> hypercalls can become prohibively expensive. For this reason many of
> the hypercalls described above take a list of operations to
> perform. In addition Xen provides the concept of a multicall which can
> allow several different hypercalls to be batched
> together. HYPERVISOR_multicall has this prototype:
> 
>   struct multicall_entry {
>       unsigned long op, result;
>       unsigned long args[6];
>   };
>   long HYPERVISOR_multicall(multicall_entry_t call_list[],
>                             unsigned int nr_calls);
> 
> Each entry represents a hypercall and its associated arguments in the
> (hopefully) obvious way.
> 
> = Guest Specific Details
> 
> == Linux paravirt_ops ==
> 
> === General PV MMU operation ===
> 
> The Linux ''paravirt_ops'' infrastructure provides a mechanism by
> which the low-level MMU operations are abstracted into function
> pointers allowing the native operations where necessary.
> 
> From the point of view of MMU operations the main entry point is
> ''struct pv_mmu_ops''. This contains entry points for low level
> operations such as:
> 
>  * Allocating/freeing page table entries. These allow the kernel to
>    mark the pages read-only and read-write as the pages are reused.
>  * Creating, writing and reading PTE entries. These allow the kernel
>    to make the necessary translations between pseudo-physical and
>    machine addressing as well as using hypercalls instead of direct
>    writes.
>  * Reading and writing of control registers, e.g. cr3, to allow
>    hypercalls to be inserted.
>  * Various TLB flush operations, again to allow their replacement by
>    hypercalls.
> 
> As well as these the interface includes some higher-level operations
> which allow for more efficient batching of compound operations such as
> duplicating (forking) a memory map. This is achieved by using the
> ''lazy_mmu_ops'' hooks to implement buffering of operations
> and flushing of larger batches or upon completion.
> 
> The Xen paravirt_ops backend uses an additional page flag,
> ''PG_pinned'' in order to track whether a page has been pinned or not
> and implemented the late-pin early-unpin scheme described above.
> 
> === Start of Day issues ===
> 
> XXX get someone to describe these...
> 
> = References =
> 
> [XXX Xen and the art of virtualisation.]
> [XXX The hypercall interface documentation.]
> [XXX others? Chisnal Book?]
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 18 21:14:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Nov 2012 21:14:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaCBY-00059G-Qe; Sun, 18 Nov 2012 21:13:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TaCBW-00059B-W3
	for xen-devel@lists.xensource.com; Sun, 18 Nov 2012 21:13:47 +0000
Received: from [85.158.137.99:4452] by server-3.bemta-3.messagelabs.com id
	3E/C1-31566-58F49A05; Sun, 18 Nov 2012 21:13:41 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-10.tower-217.messagelabs.com!1353273220!17916296!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDI3MTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4693 invoked from network); 18 Nov 2012 21:13:40 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-10.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 18 Nov 2012 21:13:40 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 088CD2EB7;
	Sun, 18 Nov 2012 23:13:38 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 1572FEC027; Sun, 18 Nov 2012 23:13:38 +0200 (EET)
Date: Sun, 18 Nov 2012 23:13:37 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: topperxin <topperxin@126.com>
Message-ID: <20121118211337.GR8912@reaktio.net>
References: <441f73eb.139b7.13b0385a52a.Coremail.topperxin@126.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <441f73eb.139b7.13b0385a52a.Coremail.topperxin@126.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: xen-devel <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] Question about Virtual NIC I/O performance
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 15, 2012 at 06:03:08PM +0800, topperxin wrote:
>    Hi all

Hello,

>           Now I'm studying the Virtual NIC I/O performance, I have some
>    questions
>           1:
>           For 1G NIC, such as Intel 82576, if I use pv driver as the VM NIC
>    driver, for the best case,
>           I can get a good performance, maybe 900M bps
>           So we can say the pv driver's performance is very good.
>           While when I use 10G NIC, such as Intel 82599,  still use the pv
>    driver as the VM NIC driver,
>           the I/O performance is very bad, there is only 2G bps, the testing
>    environment is simple, one vm on one host.
>           So, may I draw a conclusion that PV driver not suitable for 10G
>    NIC?
>

You didn't provide enough information..

What Xen version? What dom0 kernel version? What domU kernel version? 
What Intel NIC driver version? 

How did you configure/tune your system/settings? 


>           Who can tell me the reason! ?
>           2:
>           For 10G NIC, Intel 82599, if I open the SR-IOV function, I can get
>    a good performance in the vm,
>           it's nearly to 9.2G bps
>           3:
>           We all know AWS's EC2 instance are based on XEN.
>           I launched the instance which provide the 10G performance I/O
>           I tested and got the best performance the 6.3G bps
>           I checked the driver of the VM's NIC, it's PV driver, not the
>    SR-IOV
>           How does AWS can use PV driver on 10G NIC get 6.3G bps performance?
>    It's very good, I think
>

They've probably properly optimized and tuned the settings.


-- Pasi


>           Any discussion are welcome
>           Best Regards
>           Lixin Niu
>    </d! iv>

> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 18 21:14:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Nov 2012 21:14:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaCBY-00059G-Qe; Sun, 18 Nov 2012 21:13:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TaCBW-00059B-W3
	for xen-devel@lists.xensource.com; Sun, 18 Nov 2012 21:13:47 +0000
Received: from [85.158.137.99:4452] by server-3.bemta-3.messagelabs.com id
	3E/C1-31566-58F49A05; Sun, 18 Nov 2012 21:13:41 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-10.tower-217.messagelabs.com!1353273220!17916296!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDI3MTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4693 invoked from network); 18 Nov 2012 21:13:40 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-10.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 18 Nov 2012 21:13:40 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 088CD2EB7;
	Sun, 18 Nov 2012 23:13:38 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 1572FEC027; Sun, 18 Nov 2012 23:13:38 +0200 (EET)
Date: Sun, 18 Nov 2012 23:13:37 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: topperxin <topperxin@126.com>
Message-ID: <20121118211337.GR8912@reaktio.net>
References: <441f73eb.139b7.13b0385a52a.Coremail.topperxin@126.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <441f73eb.139b7.13b0385a52a.Coremail.topperxin@126.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: xen-devel <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] Question about Virtual NIC I/O performance
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 15, 2012 at 06:03:08PM +0800, topperxin wrote:
>    Hi all

Hello,

>           Now I'm studying the Virtual NIC I/O performance, I have some
>    questions
>           1:
>           For 1G NIC, such as Intel 82576, if I use pv driver as the VM NIC
>    driver, for the best case,
>           I can get a good performance, maybe 900M bps
>           So we can say the pv driver's performance is very good.
>           While when I use 10G NIC, such as Intel 82599,  still use the pv
>    driver as the VM NIC driver,
>           the I/O performance is very bad, there is only 2G bps, the testing
>    environment is simple, one vm on one host.
>           So, may I draw a conclusion that PV driver not suitable for 10G
>    NIC?
>

You didn't provide enough information..

What Xen version? What dom0 kernel version? What domU kernel version? 
What Intel NIC driver version? 

How did you configure/tune your system/settings? 


>           Who can tell me the reason! ?
>           2:
>           For 10G NIC, Intel 82599, if I open the SR-IOV function, I can get
>    a good performance in the vm,
>           it's nearly to 9.2G bps
>           3:
>           We all know AWS's EC2 instance are based on XEN.
>           I launched the instance which provide the 10G performance I/O
>           I tested and got the best performance the 6.3G bps
>           I checked the driver of the VM's NIC, it's PV driver, not the
>    SR-IOV
>           How does AWS can use PV driver on 10G NIC get 6.3G bps performance?
>    It's very good, I think
>

They've probably properly optimized and tuned the settings.


-- Pasi


>           Any discussion are welcome
>           Best Regards
>           Lixin Niu
>    </d! iv>

> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 05:55:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 05:55:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaKJU-0002pC-3k; Mon, 19 Nov 2012 05:54:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaKJR-0002p7-Qr
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 05:54:30 +0000
Received: from [85.158.139.211:22680] by server-3.bemta-5.messagelabs.com id
	1C/09-18736-599C9A05; Mon, 19 Nov 2012 05:54:29 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353304468!20619327!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31957 invoked from network); 19 Nov 2012 05:54:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 05:54:28 -0000
X-IronPort-AV: E=Sophos;i="4.83,276,1352073600"; d="scan'208";a="15869766"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 05:54:27 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 05:54:27 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TaKJP-0004FA-G0;
	Mon, 19 Nov 2012 05:54:27 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TaKJP-0007QT-C1;
	Mon, 19 Nov 2012 05:54:27 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14416-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 19 Nov 2012 05:54:27 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14416: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14416 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14416/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14414
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14414
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14414
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14414

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  321f8487379b
baseline version:
 xen                  321f8487379b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 05:55:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 05:55:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaKJU-0002pC-3k; Mon, 19 Nov 2012 05:54:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaKJR-0002p7-Qr
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 05:54:30 +0000
Received: from [85.158.139.211:22680] by server-3.bemta-5.messagelabs.com id
	1C/09-18736-599C9A05; Mon, 19 Nov 2012 05:54:29 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353304468!20619327!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31957 invoked from network); 19 Nov 2012 05:54:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 05:54:28 -0000
X-IronPort-AV: E=Sophos;i="4.83,276,1352073600"; d="scan'208";a="15869766"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 05:54:27 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 05:54:27 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TaKJP-0004FA-G0;
	Mon, 19 Nov 2012 05:54:27 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TaKJP-0007QT-C1;
	Mon, 19 Nov 2012 05:54:27 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14416-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 19 Nov 2012 05:54:27 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14416: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14416 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14416/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14414
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14414
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14414
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14414

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  321f8487379b
baseline version:
 xen                  321f8487379b

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 06:19:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 06:19:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaKgj-00032d-9l; Mon, 19 Nov 2012 06:18:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <tushar.behera@linaro.org>) id 1TaIP6-0002AC-3p
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 03:52:12 +0000
Received: from [85.158.138.51:46282] by server-5.bemta-3.messagelabs.com id
	FF/C2-26311-BECA9A05; Mon, 19 Nov 2012 03:52:11 +0000
X-Env-Sender: tushar.behera@linaro.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1353297128!22604396!1
X-Originating-IP: [209.85.160.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4226 invoked from network); 19 Nov 2012 03:52:10 -0000
Received: from mail-pb0-f43.google.com (HELO mail-pb0-f43.google.com)
	(209.85.160.43)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 03:52:10 -0000
Received: by mail-pb0-f43.google.com with SMTP id wz17so3294540pbc.30
	for <xen-devel@lists.xensource.com>;
	Sun, 18 Nov 2012 19:52:08 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding
	:x-gm-message-state;
	bh=oJzXbYlldNr9/MTht6fHPVwGQjB9McUQdwO/2CegK68=;
	b=mqbgOcZIcEs4BoKqvBOh421ZSqeff4Rb33mfoM7PclOGVOr0BHMlkRTLpORmssGZ8F
	bpMcNSRKifqPrMqSjBjOnm51eYKsJZfSnM0J7zkftZUE17uBS9/DV8dQaEf/X8icDBbW
	95OBAcrfrfFfL79OpVTjRp7t31UxhjWJ7/hzQCpmgfH+U7ByjpJ9mLhkVxm4vKnuyfBa
	WRCBdNS2REfBi1HMjz7C331aaPKqdmlO0Y0cE+eIO4FmRi/Luz8+LHqikK2lr8NMWMRr
	RbgBULwVsySaZiIyqu7J9+QqtQMlVGCG7ujwky9tJVdxOKscgmYt+Nmi1PzJCz69v3VP
	79zg==
Received: by 10.66.75.162 with SMTP id d2mr32307546paw.27.1353297128199;
	Sun, 18 Nov 2012 19:52:08 -0800 (PST)
Received: from [10.10.10.29] ([115.113.119.130])
	by mx.google.com with ESMTPS id zv10sm5440322pbc.76.2012.11.18.19.52.04
	(version=SSLv3 cipher=OTHER); Sun, 18 Nov 2012 19:52:07 -0800 (PST)
Message-ID: <50A9AD05.5080201@linaro.org>
Date: Mon, 19 Nov 2012 09:22:37 +0530
From: Tushar Behera <tushar.behera@linaro.org>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jeremy Fitzhardinge <jeremy@goop.org>
References: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
	<1353048646-10935-10-git-send-email-tushar.behera@linaro.org>
	<20121116160923.GP22320@phenom.dumpdata.com>
	<b0cd27cf-919f-46b0-afa1-4566f6ea0f61@email.android.com>
In-Reply-To: <b0cd27cf-919f-46b0-afa1-4566f6ea0f61@email.android.com>
X-Gm-Message-State: ALoCoQklf0/jI1RYrmoczE5IL7pClp7ZmO3HAHNAxjYyEssqqEqkQdPeXzK5gSBmGAbjbDXMyDFE
X-Mailman-Approved-At: Mon, 19 Nov 2012 06:18:31 +0000
Cc: xen-devel@lists.xensource.com, patches@linaro.org,
	virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 09/14] xen: events: Remove redundant check
 on unsigned variable
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/16/2012 10:23 PM, Jeremy Fitzhardinge wrote:
> To be honest I'd nack this kind of patch. The test is only redundant in the most trivial sense that the compiler can easily optimise away. The point of the test is to make sure that the range is OK even if the type subsequently becomes signed (to hold a -ve error, for example).
> 
> J
> 

The check is on the function argument which is unsigned, so checking '<
0' doesn't make sense. We should force signed check only if the argument
is of signed type. In any case, even if irq has been assigned some error
value, that would be caught by the check irq >= nr_irqs.

> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> 
>> On Fri, Nov 16, 2012 at 12:20:41PM +0530, Tushar Behera wrote:
>>> No need to check whether unsigned variable is less than 0.
>>>
>>> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>>
>> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>>
>>> CC: Jeremy Fitzhardinge <jeremy@goop.org>
>>> CC: xen-devel@lists.xensource.com
>>> CC: virtualization@lists.linux-foundation.org
>>> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
>>> ---
>>>  drivers/xen/events.c |    2 +-
>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
>>> index 4293c57..cadd7d1 100644
>>> --- a/drivers/xen/events.c
>>> +++ b/drivers/xen/events.c
>>> @@ -216,7 +216,7 @@ static void xen_irq_info_pirq_init(unsigned irq,
>>>   */
>>>  static unsigned int evtchn_from_irq(unsigned irq)
>>>  {
>>> -	if (unlikely(WARN(irq < 0 || irq >= nr_irqs, "Invalid irq %d!\n",
>> irq)))
>>> +	if (unlikely(WARN(irq >= nr_irqs, "Invalid irq %d!\n", irq)))
>>>  		return 0;
>>>  
>>>  	return info_for_irq(irq)->evtchn;
>>> -- 
>>> 1.7.4.1
> 


-- 
Tushar Behera

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 06:19:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 06:19:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaKgj-00032d-9l; Mon, 19 Nov 2012 06:18:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <tushar.behera@linaro.org>) id 1TaIP6-0002AC-3p
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 03:52:12 +0000
Received: from [85.158.138.51:46282] by server-5.bemta-3.messagelabs.com id
	FF/C2-26311-BECA9A05; Mon, 19 Nov 2012 03:52:11 +0000
X-Env-Sender: tushar.behera@linaro.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1353297128!22604396!1
X-Originating-IP: [209.85.160.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4226 invoked from network); 19 Nov 2012 03:52:10 -0000
Received: from mail-pb0-f43.google.com (HELO mail-pb0-f43.google.com)
	(209.85.160.43)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 03:52:10 -0000
Received: by mail-pb0-f43.google.com with SMTP id wz17so3294540pbc.30
	for <xen-devel@lists.xensource.com>;
	Sun, 18 Nov 2012 19:52:08 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding
	:x-gm-message-state;
	bh=oJzXbYlldNr9/MTht6fHPVwGQjB9McUQdwO/2CegK68=;
	b=mqbgOcZIcEs4BoKqvBOh421ZSqeff4Rb33mfoM7PclOGVOr0BHMlkRTLpORmssGZ8F
	bpMcNSRKifqPrMqSjBjOnm51eYKsJZfSnM0J7zkftZUE17uBS9/DV8dQaEf/X8icDBbW
	95OBAcrfrfFfL79OpVTjRp7t31UxhjWJ7/hzQCpmgfH+U7ByjpJ9mLhkVxm4vKnuyfBa
	WRCBdNS2REfBi1HMjz7C331aaPKqdmlO0Y0cE+eIO4FmRi/Luz8+LHqikK2lr8NMWMRr
	RbgBULwVsySaZiIyqu7J9+QqtQMlVGCG7ujwky9tJVdxOKscgmYt+Nmi1PzJCz69v3VP
	79zg==
Received: by 10.66.75.162 with SMTP id d2mr32307546paw.27.1353297128199;
	Sun, 18 Nov 2012 19:52:08 -0800 (PST)
Received: from [10.10.10.29] ([115.113.119.130])
	by mx.google.com with ESMTPS id zv10sm5440322pbc.76.2012.11.18.19.52.04
	(version=SSLv3 cipher=OTHER); Sun, 18 Nov 2012 19:52:07 -0800 (PST)
Message-ID: <50A9AD05.5080201@linaro.org>
Date: Mon, 19 Nov 2012 09:22:37 +0530
From: Tushar Behera <tushar.behera@linaro.org>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jeremy Fitzhardinge <jeremy@goop.org>
References: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
	<1353048646-10935-10-git-send-email-tushar.behera@linaro.org>
	<20121116160923.GP22320@phenom.dumpdata.com>
	<b0cd27cf-919f-46b0-afa1-4566f6ea0f61@email.android.com>
In-Reply-To: <b0cd27cf-919f-46b0-afa1-4566f6ea0f61@email.android.com>
X-Gm-Message-State: ALoCoQklf0/jI1RYrmoczE5IL7pClp7ZmO3HAHNAxjYyEssqqEqkQdPeXzK5gSBmGAbjbDXMyDFE
X-Mailman-Approved-At: Mon, 19 Nov 2012 06:18:31 +0000
Cc: xen-devel@lists.xensource.com, patches@linaro.org,
	virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 09/14] xen: events: Remove redundant check
 on unsigned variable
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/16/2012 10:23 PM, Jeremy Fitzhardinge wrote:
> To be honest I'd nack this kind of patch. The test is only redundant in the most trivial sense that the compiler can easily optimise away. The point of the test is to make sure that the range is OK even if the type subsequently becomes signed (to hold a -ve error, for example).
> 
> J
> 

The check is on the function argument which is unsigned, so checking '<
0' doesn't make sense. We should force signed check only if the argument
is of signed type. In any case, even if irq has been assigned some error
value, that would be caught by the check irq >= nr_irqs.

> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> 
>> On Fri, Nov 16, 2012 at 12:20:41PM +0530, Tushar Behera wrote:
>>> No need to check whether unsigned variable is less than 0.
>>>
>>> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>>
>> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>>
>>> CC: Jeremy Fitzhardinge <jeremy@goop.org>
>>> CC: xen-devel@lists.xensource.com
>>> CC: virtualization@lists.linux-foundation.org
>>> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
>>> ---
>>>  drivers/xen/events.c |    2 +-
>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
>>> index 4293c57..cadd7d1 100644
>>> --- a/drivers/xen/events.c
>>> +++ b/drivers/xen/events.c
>>> @@ -216,7 +216,7 @@ static void xen_irq_info_pirq_init(unsigned irq,
>>>   */
>>>  static unsigned int evtchn_from_irq(unsigned irq)
>>>  {
>>> -	if (unlikely(WARN(irq < 0 || irq >= nr_irqs, "Invalid irq %d!\n",
>> irq)))
>>> +	if (unlikely(WARN(irq >= nr_irqs, "Invalid irq %d!\n", irq)))
>>>  		return 0;
>>>  
>>>  	return info_for_irq(irq)->evtchn;
>>> -- 
>>> 1.7.4.1
> 


-- 
Tushar Behera

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 08:59:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 08:59:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaNC2-0004LV-Gg; Mon, 19 Nov 2012 08:59:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TaNC1-0004LQ-1y
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 08:59:01 +0000
Received: from [85.158.137.99:9558] by server-5.bemta-3.messagelabs.com id
	FE/0C-26311-4D4F9A05; Mon, 19 Nov 2012 08:59:00 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1353315539!19660551!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18562 invoked from network); 19 Nov 2012 08:58:59 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-217.messagelabs.com with SMTP;
	19 Nov 2012 08:58:59 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 19 Nov 2012 08:58:58 +0000
Message-Id: <50AA031802000078000A9935@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 19 Nov 2012 08:59:52 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-4-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1353090514-18537-4-git-send-email-dgdegra@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 03/19] arch/x86: add distinct XSM hooks for
 map/unmap
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> -static int flask_irq_permission (struct domain *d, int irq, uint8_t access)
> +static int flask_unmap_domain_pirq (struct domain *d, int irq)
>  {
> -    u32 perm;
> -    u32 rsid;
> +    u32 sid;
>      int rc = -EPERM;
>  
> -    struct domain_security_struct *ssec, *tsec;
> +    struct domain_security_struct *ssec;
>      struct avc_audit_data ad;
>  
> -    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
> -                         resource_to_perm(access));
> -
> +    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
>      if ( rc )
>          return rc;
>  
> -    if ( access )
> -        perm = RESOURCE__ADD_IRQ;
> -    else
> -        perm = RESOURCE__REMOVE_IRQ;
> -
>      ssec = current->domain->ssid;
> -    tsec = d->ssid;
>  
> -    rc = get_irq_sid(irq, &rsid, &ad);
> -    if ( rc )
> -        return rc;
> -
> -    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
> +    if ( irq >= nr_irqs_gsi ) {

Isn't the use of nr_irqs_gsi x86-specific?

Jan

> +        /* TODO support for MSI here */
> +        return 0;
> +    } else {
> +        rc = get_irq_sid(irq, &sid, &ad);
> +    }
>      if ( rc )
>          return rc;
>  
> -    if ( access )
> -        rc = avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, 
> -                            RESOURCE__USE, &ad);
> +    rc = avc_has_perm(ssec->sid, sid, SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, &ad);
>      return rc;
>  }



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 08:59:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 08:59:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaNC2-0004LV-Gg; Mon, 19 Nov 2012 08:59:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TaNC1-0004LQ-1y
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 08:59:01 +0000
Received: from [85.158.137.99:9558] by server-5.bemta-3.messagelabs.com id
	FE/0C-26311-4D4F9A05; Mon, 19 Nov 2012 08:59:00 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1353315539!19660551!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18562 invoked from network); 19 Nov 2012 08:58:59 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-217.messagelabs.com with SMTP;
	19 Nov 2012 08:58:59 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 19 Nov 2012 08:58:58 +0000
Message-Id: <50AA031802000078000A9935@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 19 Nov 2012 08:59:52 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-4-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1353090514-18537-4-git-send-email-dgdegra@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 03/19] arch/x86: add distinct XSM hooks for
 map/unmap
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> -static int flask_irq_permission (struct domain *d, int irq, uint8_t access)
> +static int flask_unmap_domain_pirq (struct domain *d, int irq)
>  {
> -    u32 perm;
> -    u32 rsid;
> +    u32 sid;
>      int rc = -EPERM;
>  
> -    struct domain_security_struct *ssec, *tsec;
> +    struct domain_security_struct *ssec;
>      struct avc_audit_data ad;
>  
> -    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
> -                         resource_to_perm(access));
> -
> +    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
>      if ( rc )
>          return rc;
>  
> -    if ( access )
> -        perm = RESOURCE__ADD_IRQ;
> -    else
> -        perm = RESOURCE__REMOVE_IRQ;
> -
>      ssec = current->domain->ssid;
> -    tsec = d->ssid;
>  
> -    rc = get_irq_sid(irq, &rsid, &ad);
> -    if ( rc )
> -        return rc;
> -
> -    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
> +    if ( irq >= nr_irqs_gsi ) {

Isn't the use of nr_irqs_gsi x86-specific?

Jan

> +        /* TODO support for MSI here */
> +        return 0;
> +    } else {
> +        rc = get_irq_sid(irq, &sid, &ad);
> +    }
>      if ( rc )
>          return rc;
>  
> -    if ( access )
> -        rc = avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, 
> -                            RESOURCE__USE, &ad);
> +    rc = avc_has_perm(ssec->sid, sid, SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, &ad);
>      return rc;
>  }



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 09:07:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 09:07:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaNK4-0004WX-L7; Mon, 19 Nov 2012 09:07:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TaNK4-0004WS-1a
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 09:07:20 +0000
Received: from [85.158.143.35:3015] by server-3.bemta-4.messagelabs.com id
	F5/4E-06841-7C6F9A05; Mon, 19 Nov 2012 09:07:19 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1353316038!13334024!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16252 invoked from network); 19 Nov 2012 09:07:18 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-21.messagelabs.com with SMTP;
	19 Nov 2012 09:07:18 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 19 Nov 2012 09:07:17 +0000
Message-Id: <50AA050A02000078000A9940@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 19 Nov 2012 09:08:10 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-7-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1353090514-18537-7-git-send-email-dgdegra@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 06/19] xen: use XSM instead of IS_PRIV where
 duplicated
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> @@ -467,8 +451,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>          if ( copy_from_guest(&irq_op, arg, 1) != 0 )
>              break;
>  
> -        ret = -EPERM;
> -        if ( !IS_PRIV(v->domain) )
> +        ret = xsm_apic(v->domain, cmd);

Is that the right hook? There's nothing APIC related here.

Jan

> +        if ( ret )
>              break;
>  
>          /* Vector is only used by hypervisor, and dom0 shouldn't



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 09:07:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 09:07:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaNK4-0004WX-L7; Mon, 19 Nov 2012 09:07:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TaNK4-0004WS-1a
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 09:07:20 +0000
Received: from [85.158.143.35:3015] by server-3.bemta-4.messagelabs.com id
	F5/4E-06841-7C6F9A05; Mon, 19 Nov 2012 09:07:19 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1353316038!13334024!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16252 invoked from network); 19 Nov 2012 09:07:18 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-21.messagelabs.com with SMTP;
	19 Nov 2012 09:07:18 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 19 Nov 2012 09:07:17 +0000
Message-Id: <50AA050A02000078000A9940@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 19 Nov 2012 09:08:10 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-7-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1353090514-18537-7-git-send-email-dgdegra@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 06/19] xen: use XSM instead of IS_PRIV where
 duplicated
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> @@ -467,8 +451,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>          if ( copy_from_guest(&irq_op, arg, 1) != 0 )
>              break;
>  
> -        ret = -EPERM;
> -        if ( !IS_PRIV(v->domain) )
> +        ret = xsm_apic(v->domain, cmd);

Is that the right hook? There's nothing APIC related here.

Jan

> +        if ( ret )
>              break;
>  
>          /* Vector is only used by hypervisor, and dom0 shouldn't



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 09:23:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 09:23:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaNZf-0004gS-8E; Mon, 19 Nov 2012 09:23:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TaNZe-0004gN-D5
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 09:23:26 +0000
Received: from [85.158.139.83:27404] by server-15.bemta-5.messagelabs.com id
	98/DA-26920-D8AF9A05; Mon, 19 Nov 2012 09:23:25 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353317004!19611515!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1612 invoked from network); 19 Nov 2012 09:23:25 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-182.messagelabs.com with SMTP;
	19 Nov 2012 09:23:25 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 19 Nov 2012 09:23:24 +0000
Message-Id: <50AA08D102000078000A9957@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 19 Nov 2012 09:24:17 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-10-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1353090514-18537-10-git-send-email-dgdegra@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 09/19] xen: lock target domain in do_domctl
 common code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> @@ -458,6 +443,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
>          if ( IS_ERR(d) )
>          {
>              ret = PTR_ERR(d);
> +            d = NULL;

Considering that in the common code you already set d to NULL,
is there a specific reason why you do so again here ...

>              break;
>          }
>  
> @@ -469,39 +455,28 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
>          op->domain = d->domain_id;
>          if ( copy_to_guest(u_domctl, op, 1) )
>              ret = -EFAULT;
> +        d = NULL;

... and here?

Same further down for XEN_DOMCTL_getdomaininfo.

Jan

>      }
>      break;
>  



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 09:23:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 09:23:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaNZf-0004gS-8E; Mon, 19 Nov 2012 09:23:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TaNZe-0004gN-D5
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 09:23:26 +0000
Received: from [85.158.139.83:27404] by server-15.bemta-5.messagelabs.com id
	98/DA-26920-D8AF9A05; Mon, 19 Nov 2012 09:23:25 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353317004!19611515!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1612 invoked from network); 19 Nov 2012 09:23:25 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-182.messagelabs.com with SMTP;
	19 Nov 2012 09:23:25 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 19 Nov 2012 09:23:24 +0000
Message-Id: <50AA08D102000078000A9957@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 19 Nov 2012 09:24:17 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-10-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1353090514-18537-10-git-send-email-dgdegra@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 09/19] xen: lock target domain in do_domctl
 common code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> @@ -458,6 +443,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
>          if ( IS_ERR(d) )
>          {
>              ret = PTR_ERR(d);
> +            d = NULL;

Considering that in the common code you already set d to NULL,
is there a specific reason why you do so again here ...

>              break;
>          }
>  
> @@ -469,39 +455,28 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
>          op->domain = d->domain_id;
>          if ( copy_to_guest(u_domctl, op, 1) )
>              ret = -EFAULT;
> +        d = NULL;

... and here?

Same further down for XEN_DOMCTL_getdomaininfo.

Jan

>      }
>      break;
>  



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 09:45:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 09:45:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaNuG-0004qD-5c; Mon, 19 Nov 2012 09:44:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TaNuE-0004q8-Ir
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 09:44:42 +0000
Received: from [85.158.139.83:39939] by server-9.bemta-5.messagelabs.com id
	CD/25-29295-98FF9A05; Mon, 19 Nov 2012 09:44:41 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1353318280!30889526!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9967 invoked from network); 19 Nov 2012 09:44:40 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-182.messagelabs.com with SMTP;
	19 Nov 2012 09:44:40 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 19 Nov 2012 09:44:39 +0000
Message-Id: <50AA0DCE02000078000A9972@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 19 Nov 2012 09:45:34 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH v5] Merge IS_PRIV checks into XSM hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> Changes from v4:
>  * Removed patches that have been applied
>  * Rename __do_xsm_op to do_xsm_op
>  * Rebased on current xen-unstable
>  * Policy headers moved under hypervisor
> 
> Changes from v3:
>  * Moved x86-specific sysctls inside #ifdef CONFIG_X86
>  * Removed pt_domain parameter from mmu_update hook when unused
>  * Renamed xsm___do_xsm_op to xsm_do_xsm_op
>  * Added struct domain* argument to arch_do_domctl
>  * Cleaned up mem_event code duplication
> 
> Changes from v2:
>  * Added overall hooks for domctl, sysctl, and platform_hypercall so
>    that new sub-operations are protected by IS_PRIV checks
>  * Reorganized the IS_PRIV additions to dummy.h so they are added in the
>    same patch that removes the IS_PRIV they are replacing
>  * Reworked hooks in the MM hotpath to increase efficiency
>  * Dropped some unneeded XSM hook additions due to do_domctl hook
>  * Dropped the rcu_lock*target_domain_by_id function removal patch
>  * Restore IS_PRIV check in PHYSDEVOP_alloc_irq_vector
>  * Use the existing hook function structure for tmem
> 
> Miscellaneous updates to FLASK:
>     [PATCH 01/19] libxl: introduce XSM relabel on build
>     [PATCH 02/19] flask/policy: Add domain relabel example
>     [PATCH 03/19] arch/x86: add distinct XSM hooks for map/unmap
>     [PATCH 04/19] xsm/flask: Add checks on the domain performing set_target
> 
> IS_PRIV Refactoring:
>     [PATCH 05/19] xsm: Use the dummy XSM module if XSM is disabled
>     [PATCH 06/19] xen: use XSM instead of IS_PRIV where duplicated
>     [PATCH 07/19] xen: avoid calling rcu_lock_*target_domain when an XSM
>     [PATCH 08/19] arch/x86: convert platform_hypercall to use XSM
>     [PATCH 09/19] xen: lock target domain in do_domctl common code
>     [PATCH 10/19] xen: convert do_domctl to use XSM
>     [PATCH 11/19] xen: convert do_sysctl to use XSM
> 
> Additional new/updated hooks:
>     [PATCH 12/19] xsm/flask: add missing hooks
>     [PATCH 13/19] xsm/flask: add distinct SIDs for self/target access
>     [PATCH 14/19] arch/x86: Add missing mem_sharing XSM hooks
>     [PATCH 15/19] arch/x86: use XSM hooks for get_pg_owner access checks
>     [PATCH 16/19] xen: Add XSM hook for XENMEM_exchange
>     [PATCH 17/19] tmem: add XSM hooks
> 
> Other cleanup:
>     [PATCH 18/19] xen/arch/*: add struct domain parameter to
>     [PATCH 19/19] flask: move policy headers into hypervisor

Except for patch 14, once we dealt with the few review comment
I gave on the patches I was explicitly Cc-ed on, feel free to change
the Cc-s into Acked-by-s (unless, of course, you make non-trivial
changes to them down the road); for patches 15 and 18 the acks
would be limited to the x86 (and, for the latter, iommu) pieces.

As to getting the series applied, I suppose that'll be a little difficult,
as it mixes changes to various parts of the tree, and hence no
single maintainer would generally be able to apply the whole series
without respective other parts fully acked by the corresponding
maintainers. Is there a way to either indicate eventual fully
standalone patches, or order/split it so that at least tools side and
hypervisor side changes are separated from one another, or mixed
patches all go at the beginning or end of the series?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 09:45:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 09:45:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaNuG-0004qD-5c; Mon, 19 Nov 2012 09:44:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TaNuE-0004q8-Ir
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 09:44:42 +0000
Received: from [85.158.139.83:39939] by server-9.bemta-5.messagelabs.com id
	CD/25-29295-98FF9A05; Mon, 19 Nov 2012 09:44:41 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1353318280!30889526!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9967 invoked from network); 19 Nov 2012 09:44:40 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-182.messagelabs.com with SMTP;
	19 Nov 2012 09:44:40 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 19 Nov 2012 09:44:39 +0000
Message-Id: <50AA0DCE02000078000A9972@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 19 Nov 2012 09:45:34 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH v5] Merge IS_PRIV checks into XSM hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> Changes from v4:
>  * Removed patches that have been applied
>  * Rename __do_xsm_op to do_xsm_op
>  * Rebased on current xen-unstable
>  * Policy headers moved under hypervisor
> 
> Changes from v3:
>  * Moved x86-specific sysctls inside #ifdef CONFIG_X86
>  * Removed pt_domain parameter from mmu_update hook when unused
>  * Renamed xsm___do_xsm_op to xsm_do_xsm_op
>  * Added struct domain* argument to arch_do_domctl
>  * Cleaned up mem_event code duplication
> 
> Changes from v2:
>  * Added overall hooks for domctl, sysctl, and platform_hypercall so
>    that new sub-operations are protected by IS_PRIV checks
>  * Reorganized the IS_PRIV additions to dummy.h so they are added in the
>    same patch that removes the IS_PRIV they are replacing
>  * Reworked hooks in the MM hotpath to increase efficiency
>  * Dropped some unneeded XSM hook additions due to do_domctl hook
>  * Dropped the rcu_lock*target_domain_by_id function removal patch
>  * Restore IS_PRIV check in PHYSDEVOP_alloc_irq_vector
>  * Use the existing hook function structure for tmem
> 
> Miscellaneous updates to FLASK:
>     [PATCH 01/19] libxl: introduce XSM relabel on build
>     [PATCH 02/19] flask/policy: Add domain relabel example
>     [PATCH 03/19] arch/x86: add distinct XSM hooks for map/unmap
>     [PATCH 04/19] xsm/flask: Add checks on the domain performing set_target
> 
> IS_PRIV Refactoring:
>     [PATCH 05/19] xsm: Use the dummy XSM module if XSM is disabled
>     [PATCH 06/19] xen: use XSM instead of IS_PRIV where duplicated
>     [PATCH 07/19] xen: avoid calling rcu_lock_*target_domain when an XSM
>     [PATCH 08/19] arch/x86: convert platform_hypercall to use XSM
>     [PATCH 09/19] xen: lock target domain in do_domctl common code
>     [PATCH 10/19] xen: convert do_domctl to use XSM
>     [PATCH 11/19] xen: convert do_sysctl to use XSM
> 
> Additional new/updated hooks:
>     [PATCH 12/19] xsm/flask: add missing hooks
>     [PATCH 13/19] xsm/flask: add distinct SIDs for self/target access
>     [PATCH 14/19] arch/x86: Add missing mem_sharing XSM hooks
>     [PATCH 15/19] arch/x86: use XSM hooks for get_pg_owner access checks
>     [PATCH 16/19] xen: Add XSM hook for XENMEM_exchange
>     [PATCH 17/19] tmem: add XSM hooks
> 
> Other cleanup:
>     [PATCH 18/19] xen/arch/*: add struct domain parameter to
>     [PATCH 19/19] flask: move policy headers into hypervisor

Except for patch 14, once we dealt with the few review comment
I gave on the patches I was explicitly Cc-ed on, feel free to change
the Cc-s into Acked-by-s (unless, of course, you make non-trivial
changes to them down the road); for patches 15 and 18 the acks
would be limited to the x86 (and, for the latter, iommu) pieces.

As to getting the series applied, I suppose that'll be a little difficult,
as it mixes changes to various parts of the tree, and hence no
single maintainer would generally be able to apply the whole series
without respective other parts fully acked by the corresponding
maintainers. Is there a way to either indicate eventual fully
standalone patches, or order/split it so that at least tools side and
hypervisor side changes are separated from one another, or mixed
patches all go at the beginning or end of the series?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 09:55:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 09:55:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaO4a-00051K-D9; Mon, 19 Nov 2012 09:55:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaO4Z-00051F-8p
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 09:55:23 +0000
Received: from [85.158.143.99:4888] by server-2.bemta-4.messagelabs.com id
	9F/B7-28922-A020AA05; Mon, 19 Nov 2012 09:55:22 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1353318921!30431344!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23164 invoked from network); 19 Nov 2012 09:55:21 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 09:55:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,278,1352073600"; d="scan'208";a="15873634"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 09:55:20 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 09:55:20 +0000
Message-ID: <1353318919.18229.7.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Date: Mon, 19 Nov 2012 09:55:19 +0000
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 18:31 +0000, Liu, Jinsong wrote:
> >> +            /*
> >> +             * if vMCE occur at last iter, do one more iter so that it get
> >> +             * chance to transfer broken page's pfn_type and pfn number to
> >> +             * target and then take appropriate action
[...]
> >> +            }
> > 
> > Is this really the best way of doing this ?  Isn't there some single
> > flag the hypervisor sets somewhere ?

> That will involve adding new hypercall, and notifying hypervisor
> whether tools side is at the last iter round.

If we get to this stage then haven't we either already sent something
over the wire for this page or marked it as dirty when we tried and
failed to send it?

In the former case we don't care that the page is now broken on the
source since the target has got a good pre-breakage copy.

In the latter case could we not set a flag at the same time as we mark
the page dirty which means "go round at least one more time"?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 09:55:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 09:55:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaO4a-00051K-D9; Mon, 19 Nov 2012 09:55:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaO4Z-00051F-8p
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 09:55:23 +0000
Received: from [85.158.143.99:4888] by server-2.bemta-4.messagelabs.com id
	9F/B7-28922-A020AA05; Mon, 19 Nov 2012 09:55:22 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1353318921!30431344!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23164 invoked from network); 19 Nov 2012 09:55:21 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 09:55:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,278,1352073600"; d="scan'208";a="15873634"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 09:55:20 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 09:55:20 +0000
Message-ID: <1353318919.18229.7.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Date: Mon, 19 Nov 2012 09:55:19 +0000
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 18:31 +0000, Liu, Jinsong wrote:
> >> +            /*
> >> +             * if vMCE occur at last iter, do one more iter so that it get
> >> +             * chance to transfer broken page's pfn_type and pfn number to
> >> +             * target and then take appropriate action
[...]
> >> +            }
> > 
> > Is this really the best way of doing this ?  Isn't there some single
> > flag the hypervisor sets somewhere ?

> That will involve adding new hypercall, and notifying hypervisor
> whether tools side is at the last iter round.

If we get to this stage then haven't we either already sent something
over the wire for this page or marked it as dirty when we tried and
failed to send it?

In the former case we don't care that the page is now broken on the
source since the target has got a good pre-breakage copy.

In the latter case could we not set a flag at the same time as we mark
the page dirty which means "go round at least one more time"?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 10:11:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 10:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaOJj-0005FW-DX; Mon, 19 Nov 2012 10:11:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaOJh-0005FN-VH
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 10:11:02 +0000
Received: from [85.158.137.99:30451] by server-4.bemta-3.messagelabs.com id
	A7/48-30023-4B50AA05; Mon, 19 Nov 2012 10:11:00 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1353319859!14925315!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29500 invoked from network); 19 Nov 2012 10:11:00 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 10:11:00 -0000
X-IronPort-AV: E=Sophos;i="4.83,278,1352073600"; d="scan'208";a="15874090"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 10:10:59 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 10:10:59 +0000
Message-ID: <1353319857.18229.12.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: jacek burghardt <jaceksburghardt@gmail.com>
Date: Mon, 19 Nov 2012 10:10:57 +0000
In-Reply-To: <CAHyyzzRWhCZh2uThzZwnuG+aVcJf4D+vmgFX_i1G6L_zyJBOgg@mail.gmail.com>
References: <CAHyyzzRWhCZh2uThzZwnuG+aVcJf4D+vmgFX_i1G6L_zyJBOgg@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] bug in xl shutdown, reboot ignored
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 19:35 +0000, jacek burghardt wrote:
> it seems that xl ignores 
> on_poweroff = 'destroy'
>  on_reboot   = 'restart'
>  on_crash    = 'restart'
> When i issue xl reboot the virtual host shows shuting down and
> then just stops with screen showing shutdown.
> Also when i issue shutdown or reboot from within guess os the guess os
> will freeze at shutdown screen.
> it seems that xl ignores the rules in config no matter what chances i
> made they are ignored. the guest shows it status as  sr.
> I have the same issue with windows 2012 2008 win 7 and pvlinux 

I'm afraid this bug report is missing critical information which would
help us to respond, such as the version of Xen you are running, any
toolstack logs, your guest configuration and the command used to start
the vm.

Please take a read through
http://wiki.xen.org/wiki/Reporting_Bugs_against_Xen
and provide the relevant logs etc.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 10:11:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 10:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaOJj-0005FW-DX; Mon, 19 Nov 2012 10:11:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaOJh-0005FN-VH
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 10:11:02 +0000
Received: from [85.158.137.99:30451] by server-4.bemta-3.messagelabs.com id
	A7/48-30023-4B50AA05; Mon, 19 Nov 2012 10:11:00 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1353319859!14925315!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29500 invoked from network); 19 Nov 2012 10:11:00 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 10:11:00 -0000
X-IronPort-AV: E=Sophos;i="4.83,278,1352073600"; d="scan'208";a="15874090"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 10:10:59 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 10:10:59 +0000
Message-ID: <1353319857.18229.12.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: jacek burghardt <jaceksburghardt@gmail.com>
Date: Mon, 19 Nov 2012 10:10:57 +0000
In-Reply-To: <CAHyyzzRWhCZh2uThzZwnuG+aVcJf4D+vmgFX_i1G6L_zyJBOgg@mail.gmail.com>
References: <CAHyyzzRWhCZh2uThzZwnuG+aVcJf4D+vmgFX_i1G6L_zyJBOgg@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] bug in xl shutdown, reboot ignored
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 19:35 +0000, jacek burghardt wrote:
> it seems that xl ignores 
> on_poweroff = 'destroy'
>  on_reboot   = 'restart'
>  on_crash    = 'restart'
> When i issue xl reboot the virtual host shows shuting down and
> then just stops with screen showing shutdown.
> Also when i issue shutdown or reboot from within guess os the guess os
> will freeze at shutdown screen.
> it seems that xl ignores the rules in config no matter what chances i
> made they are ignored. the guest shows it status as  sr.
> I have the same issue with windows 2012 2008 win 7 and pvlinux 

I'm afraid this bug report is missing critical information which would
help us to respond, such as the version of Xen you are running, any
toolstack logs, your guest configuration and the command used to start
the vm.

Please take a read through
http://wiki.xen.org/wiki/Reporting_Bugs_against_Xen
and provide the relevant logs etc.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 10:21:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 10:21:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaOTb-0005P1-Fv; Mon, 19 Nov 2012 10:21:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaOTa-0005Ow-SR
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 10:21:15 +0000
Received: from [85.158.137.99:45966] by server-16.bemta-3.messagelabs.com id
	01/DC-07461-9180AA05; Mon, 19 Nov 2012 10:21:13 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1353320471!12823888!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13266 invoked from network); 19 Nov 2012 10:21:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 10:21:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,278,1352073600"; d="scan'208";a="15874408"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 10:21:11 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 10:21:11 +0000
Message-ID: <1353320470.18229.20.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Mon, 19 Nov 2012 10:21:10 +0000
In-Reply-To: <20121110135218.GA5436@type>
References: <50871D90.50606@gmail.com>
	<20121025205653.GW5925@type.chello.at>	<5098A674.5090203@cs.uic.edu>
	<20121110135218.GA5436@type>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Xu Zhang <xzhang@cs.uic.edu>, "gm281@cam.ac.uk" <gm281@cam.ac.uk>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Nested events in 64bit mini-OS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, 2012-11-10 at 13:52 +0000, Samuel Thibault wrote:
> > +    .byte 0x78,0x78,0x78,0x78,0x78            # jmp    hypercall_page + (__HYPERVISOR_iret * 32)
> 
> Here we would also need a fixup table for the code at hypercall_page!
> A nicer fix would be to inline the hypercall code here.  That said, I
> have to say I don't know any detail about the NMI flag, I don't see it
> defined in the Intel manual, and I don't see it being set in the Xen
> hypervisor.

It's a "software defined" bit (i.e. stolen out of eflags :-() used in
the classic-Xen Linux guest to indicate that return must go via
HYPERVISOR_iret (rather than direct iret), I think in order to let the
hypervisor implement the correct semantics wrt NMI masking. The
hypervisor itself doesn't actually know anything about the bit and the
guest could implement this some other way if it wanted (doesn't 64 bit
minios *always* use HYPERVISOR_iret?).

>   Unless somebody knows more about it, I would assume that it
> currently never happens,

That's probably a pretty good assumption, you would expect NMIs only in
dom0 (real NMIs getting forwarded) or in a guest which you explicitly
sent an NMI to via the toolstack, which I doubt you would do to an
unsuspecting mini-os domain (not in the expectation of anything good
happening at least).

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 10:21:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 10:21:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaOTb-0005P1-Fv; Mon, 19 Nov 2012 10:21:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaOTa-0005Ow-SR
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 10:21:15 +0000
Received: from [85.158.137.99:45966] by server-16.bemta-3.messagelabs.com id
	01/DC-07461-9180AA05; Mon, 19 Nov 2012 10:21:13 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1353320471!12823888!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13266 invoked from network); 19 Nov 2012 10:21:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 10:21:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,278,1352073600"; d="scan'208";a="15874408"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 10:21:11 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 10:21:11 +0000
Message-ID: <1353320470.18229.20.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Mon, 19 Nov 2012 10:21:10 +0000
In-Reply-To: <20121110135218.GA5436@type>
References: <50871D90.50606@gmail.com>
	<20121025205653.GW5925@type.chello.at>	<5098A674.5090203@cs.uic.edu>
	<20121110135218.GA5436@type>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Xu Zhang <xzhang@cs.uic.edu>, "gm281@cam.ac.uk" <gm281@cam.ac.uk>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Nested events in 64bit mini-OS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, 2012-11-10 at 13:52 +0000, Samuel Thibault wrote:
> > +    .byte 0x78,0x78,0x78,0x78,0x78            # jmp    hypercall_page + (__HYPERVISOR_iret * 32)
> 
> Here we would also need a fixup table for the code at hypercall_page!
> A nicer fix would be to inline the hypercall code here.  That said, I
> have to say I don't know any detail about the NMI flag, I don't see it
> defined in the Intel manual, and I don't see it being set in the Xen
> hypervisor.

It's a "software defined" bit (i.e. stolen out of eflags :-() used in
the classic-Xen Linux guest to indicate that return must go via
HYPERVISOR_iret (rather than direct iret), I think in order to let the
hypervisor implement the correct semantics wrt NMI masking. The
hypervisor itself doesn't actually know anything about the bit and the
guest could implement this some other way if it wanted (doesn't 64 bit
minios *always* use HYPERVISOR_iret?).

>   Unless somebody knows more about it, I would assume that it
> currently never happens,

That's probably a pretty good assumption, you would expect NMIs only in
dom0 (real NMIs getting forwarded) or in a guest which you explicitly
sent an NMI to via the toolstack, which I doubt you would do to an
unsuspecting mini-os domain (not in the expectation of anything good
happening at least).

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 10:23:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 10:23:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaOVh-0005U7-0V; Mon, 19 Nov 2012 10:23:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaOVg-0005U0-AP
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 10:23:24 +0000
Received: from [193.109.254.147:65154] by server-1.bemta-14.messagelabs.com id
	92/20-25314-B980AA05; Mon, 19 Nov 2012 10:23:23 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353320589!4472930!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10938 invoked from network); 19 Nov 2012 10:23:09 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 10:23:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,278,1352073600"; d="scan'208";a="15874462"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 10:22:46 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 10:22:46 +0000
Message-ID: <1353320565.18229.22.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Mon, 19 Nov 2012 10:22:45 +0000
In-Reply-To: <20121118174341.GB6017@type>
References: <50871D90.50606@gmail.com>
	<20121025205653.GW5925@type.chello.at>	<5098A674.5090203@cs.uic.edu>
	<20121110135218.GA5436@type>	<509FC5F6.4050506@cs.uic.edu>
	<50A2F8A7.5000202@cs.uic.edu> <20121118174341.GB6017@type>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Keir Fraser <keir@xen.org>, Xu Zhang <xzhang@cs.uic.edu>,
	"gm281@cam.ac.uk" <gm281@cam.ac.uk>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Nested events in 64bit mini-OS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sun, 2012-11-18 at 17:43 +0000, Samuel Thibault wrote:
> > Correct me if I am wrong, I think hypercall_page is mapped at runtime to
> > guest OS by Xen. It's not actually part of the critical section of guest OS,
> > at least not at compile time.
> 
> Sure. I meant it'd mean a second fixup table, but who knows what code is
> there, it could be tampering with the stack.

In practice it isn't. Since the hypercall page is a blackbox to the
guest I don't think it is really reasonable for it to be messing with
the stack without makings its own arrangements for correctness of
nesting etc.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 10:23:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 10:23:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaOVh-0005U7-0V; Mon, 19 Nov 2012 10:23:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaOVg-0005U0-AP
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 10:23:24 +0000
Received: from [193.109.254.147:65154] by server-1.bemta-14.messagelabs.com id
	92/20-25314-B980AA05; Mon, 19 Nov 2012 10:23:23 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353320589!4472930!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10938 invoked from network); 19 Nov 2012 10:23:09 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 10:23:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,278,1352073600"; d="scan'208";a="15874462"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 10:22:46 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 10:22:46 +0000
Message-ID: <1353320565.18229.22.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Mon, 19 Nov 2012 10:22:45 +0000
In-Reply-To: <20121118174341.GB6017@type>
References: <50871D90.50606@gmail.com>
	<20121025205653.GW5925@type.chello.at>	<5098A674.5090203@cs.uic.edu>
	<20121110135218.GA5436@type>	<509FC5F6.4050506@cs.uic.edu>
	<50A2F8A7.5000202@cs.uic.edu> <20121118174341.GB6017@type>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Keir Fraser <keir@xen.org>, Xu Zhang <xzhang@cs.uic.edu>,
	"gm281@cam.ac.uk" <gm281@cam.ac.uk>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Nested events in 64bit mini-OS
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sun, 2012-11-18 at 17:43 +0000, Samuel Thibault wrote:
> > Correct me if I am wrong, I think hypercall_page is mapped at runtime to
> > guest OS by Xen. It's not actually part of the critical section of guest OS,
> > at least not at compile time.
> 
> Sure. I meant it'd mean a second fixup table, but who knows what code is
> there, it could be tampering with the stack.

In practice it isn't. Since the hypercall page is a blackbox to the
guest I don't think it is really reasonable for it to be messing with
the stack without makings its own arrangements for correctness of
nesting etc.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 10:28:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 10:28:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaOaG-0005fV-Qz; Mon, 19 Nov 2012 10:28:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TaOaE-0005fO-Pc
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 10:28:06 +0000
Received: from [85.158.143.35:15084] by server-2.bemta-4.messagelabs.com id
	F1/42-28922-6B90AA05; Mon, 19 Nov 2012 10:28:06 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1353320811!18327754!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12575 invoked from network); 19 Nov 2012 10:26:52 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 19 Nov 2012 10:26:52 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TaOYy-0008J5-1i; Mon, 19 Nov 2012 10:26:48 +0000
Date: Mon, 19 Nov 2012 10:26:47 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121119102647.GA31411@ocelot.phlegethon.org>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA0DCE02000078000A9972@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50AA0DCE02000078000A9972@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH v5] Merge IS_PRIV checks into XSM hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 09:45 +0000 on 19 Nov (1353318334), Jan Beulich wrote:
> As to getting the series applied, I suppose that'll be a little difficult,
> as it mixes changes to various parts of the tree, and hence no
> single maintainer would generally be able to apply the whole series
> without respective other parts fully acked by the corresponding
> maintainers. Is there a way to either indicate eventual fully
> standalone patches, or order/split it so that at least tools side and
> hypervisor side changes are separated from one another, or mixed
> patches all go at the beginning or end of the series?

This whole series makes me very uncomfortable.  I can see its usefulness,
and as a supporter of disaggregations I like the idea of fine-grained
control, but it really does obscure the security checks, and makes it
less likely that people implementing new operations will get their
security checks right.

Since there are only a small number of default checks (IS_PRIV,
IS_PRIV_FOR, self-only, ???), I wonder whether they could be explicitly
included in the xsm invocation (as some sort of 'enum
xsm-default-policy' argument), to make it clear what's going on without
the reader having to grobble around in xsm files?

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 10:28:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 10:28:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaOaG-0005fV-Qz; Mon, 19 Nov 2012 10:28:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TaOaE-0005fO-Pc
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 10:28:06 +0000
Received: from [85.158.143.35:15084] by server-2.bemta-4.messagelabs.com id
	F1/42-28922-6B90AA05; Mon, 19 Nov 2012 10:28:06 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1353320811!18327754!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12575 invoked from network); 19 Nov 2012 10:26:52 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 19 Nov 2012 10:26:52 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TaOYy-0008J5-1i; Mon, 19 Nov 2012 10:26:48 +0000
Date: Mon, 19 Nov 2012 10:26:47 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121119102647.GA31411@ocelot.phlegethon.org>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA0DCE02000078000A9972@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50AA0DCE02000078000A9972@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH v5] Merge IS_PRIV checks into XSM hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 09:45 +0000 on 19 Nov (1353318334), Jan Beulich wrote:
> As to getting the series applied, I suppose that'll be a little difficult,
> as it mixes changes to various parts of the tree, and hence no
> single maintainer would generally be able to apply the whole series
> without respective other parts fully acked by the corresponding
> maintainers. Is there a way to either indicate eventual fully
> standalone patches, or order/split it so that at least tools side and
> hypervisor side changes are separated from one another, or mixed
> patches all go at the beginning or end of the series?

This whole series makes me very uncomfortable.  I can see its usefulness,
and as a supporter of disaggregations I like the idea of fine-grained
control, but it really does obscure the security checks, and makes it
less likely that people implementing new operations will get their
security checks right.

Since there are only a small number of default checks (IS_PRIV,
IS_PRIV_FOR, self-only, ???), I wonder whether they could be explicitly
included in the xsm invocation (as some sort of 'enum
xsm-default-policy' argument), to make it clear what's going on without
the reader having to grobble around in xsm files?

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 10:28:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 10:28:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaOah-0005hh-7c; Mon, 19 Nov 2012 10:28:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaOag-0005hX-D3
	for Xen-devel@lists.xen.org; Mon, 19 Nov 2012 10:28:34 +0000
Received: from [193.109.254.147:5235] by server-3.bemta-14.messagelabs.com id
	29/A5-01317-1D90AA05; Mon, 19 Nov 2012 10:28:33 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353320895!8813832!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1351 invoked from network); 19 Nov 2012 10:28:16 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 10:28:16 -0000
X-IronPort-AV: E=Sophos;i="4.83,278,1352073600"; d="scan'208";a="15874651"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 10:28:14 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 10:28:14 +0000
Message-ID: <1353320893.18229.26.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Date: Mon, 19 Nov 2012 10:28:13 +0000
In-Reply-To: <20646.29021.714271.894762@mariner.uk.xensource.com>
References: <CAN=sCCEuPqhapvBR2eSTvALQeKbwshmT5=MvSiX3FoMW+vg_aA@mail.gmail.com>
	<1349263669.650.131.camel@zakaz.uk.xensource.com>
	<CAN=sCCGSvu9_xLXnMRhKY6fr1WD+ittsjpKRF6fVFnwtgB9niQ@mail.gmail.com>
	<1349266207.650.137.camel@zakaz.uk.xensource.com>
	<CAN=sCCEtV1PS-a7MtSjsX=XKRqQCoabvNUY-F1xD-sjMmrJE+A@mail.gmail.com>
	<CAN=sCCFcsZUZYKiOVqOF=DzM8VpSEEOSUfmjLh2+DKOrkG+b2g@mail.gmail.com>
	<CAN=sCCGWU4Wpg9QfFaoPLUBmo_rXTf4h=F4g+ES0CHFhGU=0KQ@mail.gmail.com>
	<1349278604.650.162.camel@zakaz.uk.xensource.com>
	<CAN=sCCEO63JgWCUbosP5+exL4aU=yjaM_VPOxbjh6=C6r8CAhg@mail.gmail.com>
	<1349282150.650.181.camel@zakaz.uk.xensource.com>
	<20121014110311.GD8912@reaktio.net>
	<1350287790.14440.1.camel@dagon.hellion.org.uk>
	<CAFLBxZbpXLhX8ij4YqAm+3oEJbeAGEZz2=O8YVfc4tj8pRBCbg@mail.gmail.com>
	<20646.29021.714271.894762@mariner.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Valtteri Kiviniemi <kiviniemi.valtteri@gmail.com>,
	"Xen-devel@lists.xen.org" <Xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen 4.2.0, xl toolstack cant launch older domUs
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 17:01 +0000, Ian Jackson wrote:
> George Dunlap writes ("Re: [Xen-devel] Xen 4.2.0, xl toolstack cant launch older domUs"):
> > On Mon, Oct 15, 2012 at 8:56 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > >> > It appears that xend includes some sort of workaround for this which xl
> > >> > does not.
> ...
> 
> This relates to writing
>   /local/domain/$(xl domid lightning)/device/vbd/51713/protocol x86_32-abi
> 
> > I suppose this kind of thing should be tracked, to make sure it
> > doesn't fall on the floor.  I'll add it to my list (with no owner
> > ATM).
> 
> Did this ever get fixed ?

Not AFAIK.

The xc dombuild has a concept of the "native_protocol" for the guest
which it has just built, you'd want to add a mechanism to feed this back
out to libxl and remember it somewhere for use when adding the devices.

A bit of a pain but not too hard I don't think.

e.g. in libxl__build_pv you have struct xc_dom_image *dom and can read
dom->arch_hooks->native_protocol (this is what xend does).

I'm not sure what the equivalent for hvm guests would be. Perhaps they
are required to right it themselves, since you can't know a priori what
sort of kernel they will load. Actually a PV guest is expected to right
it to and doing it in the toolstack is just a workaround for broken
guests.


Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 10:28:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 10:28:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaOah-0005hh-7c; Mon, 19 Nov 2012 10:28:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaOag-0005hX-D3
	for Xen-devel@lists.xen.org; Mon, 19 Nov 2012 10:28:34 +0000
Received: from [193.109.254.147:5235] by server-3.bemta-14.messagelabs.com id
	29/A5-01317-1D90AA05; Mon, 19 Nov 2012 10:28:33 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353320895!8813832!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1351 invoked from network); 19 Nov 2012 10:28:16 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 10:28:16 -0000
X-IronPort-AV: E=Sophos;i="4.83,278,1352073600"; d="scan'208";a="15874651"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 10:28:14 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 10:28:14 +0000
Message-ID: <1353320893.18229.26.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Date: Mon, 19 Nov 2012 10:28:13 +0000
In-Reply-To: <20646.29021.714271.894762@mariner.uk.xensource.com>
References: <CAN=sCCEuPqhapvBR2eSTvALQeKbwshmT5=MvSiX3FoMW+vg_aA@mail.gmail.com>
	<1349263669.650.131.camel@zakaz.uk.xensource.com>
	<CAN=sCCGSvu9_xLXnMRhKY6fr1WD+ittsjpKRF6fVFnwtgB9niQ@mail.gmail.com>
	<1349266207.650.137.camel@zakaz.uk.xensource.com>
	<CAN=sCCEtV1PS-a7MtSjsX=XKRqQCoabvNUY-F1xD-sjMmrJE+A@mail.gmail.com>
	<CAN=sCCFcsZUZYKiOVqOF=DzM8VpSEEOSUfmjLh2+DKOrkG+b2g@mail.gmail.com>
	<CAN=sCCGWU4Wpg9QfFaoPLUBmo_rXTf4h=F4g+ES0CHFhGU=0KQ@mail.gmail.com>
	<1349278604.650.162.camel@zakaz.uk.xensource.com>
	<CAN=sCCEO63JgWCUbosP5+exL4aU=yjaM_VPOxbjh6=C6r8CAhg@mail.gmail.com>
	<1349282150.650.181.camel@zakaz.uk.xensource.com>
	<20121014110311.GD8912@reaktio.net>
	<1350287790.14440.1.camel@dagon.hellion.org.uk>
	<CAFLBxZbpXLhX8ij4YqAm+3oEJbeAGEZz2=O8YVfc4tj8pRBCbg@mail.gmail.com>
	<20646.29021.714271.894762@mariner.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Valtteri Kiviniemi <kiviniemi.valtteri@gmail.com>,
	"Xen-devel@lists.xen.org" <Xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen 4.2.0, xl toolstack cant launch older domUs
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 17:01 +0000, Ian Jackson wrote:
> George Dunlap writes ("Re: [Xen-devel] Xen 4.2.0, xl toolstack cant launch older domUs"):
> > On Mon, Oct 15, 2012 at 8:56 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > >> > It appears that xend includes some sort of workaround for this which xl
> > >> > does not.
> ...
> 
> This relates to writing
>   /local/domain/$(xl domid lightning)/device/vbd/51713/protocol x86_32-abi
> 
> > I suppose this kind of thing should be tracked, to make sure it
> > doesn't fall on the floor.  I'll add it to my list (with no owner
> > ATM).
> 
> Did this ever get fixed ?

Not AFAIK.

The xc dombuild has a concept of the "native_protocol" for the guest
which it has just built, you'd want to add a mechanism to feed this back
out to libxl and remember it somewhere for use when adding the devices.

A bit of a pain but not too hard I don't think.

e.g. in libxl__build_pv you have struct xc_dom_image *dom and can read
dom->arch_hooks->native_protocol (this is what xend does).

I'm not sure what the equivalent for hvm guests would be. Perhaps they
are required to right it themselves, since you can't know a priori what
sort of kernel they will load. Actually a PV guest is expected to right
it to and doing it in the toolstack is just a workaround for broken
guests.


Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 10:30:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 10:30:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaObq-0005pV-Md; Mon, 19 Nov 2012 10:29:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaObq-0005pN-2b
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 10:29:46 +0000
Received: from [85.158.143.99:20961] by server-1.bemta-4.messagelabs.com id
	56/74-27934-91A0AA05; Mon, 19 Nov 2012 10:29:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1353320974!29904856!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31899 invoked from network); 19 Nov 2012 10:29:36 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 10:29:36 -0000
X-IronPort-AV: E=Sophos;i="4.83,278,1352073600"; d="scan'208";a="15874687"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 10:29:34 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 10:29:34 +0000
Message-ID: <1353320973.18229.27.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Pasi =?ISO-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
Date: Mon, 19 Nov 2012 10:29:33 +0000
In-Reply-To: <20121118210214.GQ8912@reaktio.net>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
	<1353084913.3499.240.camel@zakaz.uk.xensource.com>
	<20121118210214.GQ8912@reaktio.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 0 of 5] docs: x86 PV MMU related functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gU3VuLCAyMDEyLTExLTE4IGF0IDIxOjAyICswMDAwLCBQYXNpIEvDpHJra8OkaW5lbiB3cm90
ZToKPiBPbiBGcmksIE5vdiAxNiwgMjAxMiBhdCAwNDo1NToxM1BNICswMDAwLCBJYW4gQ2FtcGJl
bGwgd3JvdGU6Cj4gPiBPbiBGcmksIDIwMTItMTEtMDIgYXQgMTE6MTggKzAwMDAsIElhbiBDYW1w
YmVsbCB3cm90ZToKPiA+ID4KPiA+ID4gSSBhbHNvIGhhdmUgYSBkcmFmdCBvZiBhIHdpa2kgYXJ0
aWNsZSBvbiB0aGUgc3ViamVjdCB3aGljaCByZWZlcmVuY2VzCj4gPiA+IHRoZSBpbmZvcm1hdGlv
biBpbiB0aGUgcHVibGljIGhlYWRlcnMgd2hpY2ggSSBob3BlIHRvIHBvc3Qgc29vbi4KPiA+Cj4g
PiBJIHJlYWxpc2VkIEkgZm9yZ290IHRvIGRvIHRoaXMuLi4KPiA+Cj4gPiBJdCBuZWVkcyBzb21l
IHBvbGlzaCBidXQgdGhlIG1ham9yaXR5IG9mIHRoZSBYWFgncyBhcmUgcGxhY2Vob2xkZXIgZm9y
Cj4gPiBsaW5rcyB0byB0aGUgcmVzdWx0IG9mIHRoaXMgYXBwbHlpbmcgdGhpcyBzZXJpZXMuCj4g
Pgo+IAo+IEhlbGxvLAo+IAo+IENvbW1lbnRzIGFib3V0IHNvbWUgc21hbGwgdHlwb3MuCgpUaGFu
a3MsIEkndmUgaW5jb3Jwb3JhdGVkIHRoZXNlIGludG8gbXkgbG9jYWwgY29weS4KCihPYnZpb3Vz
bHkgSSBkaWRuJ3QgcHJvb2YtcmVhZCBvciBldmVuIHNwZWxsY2hlY2sgdGhpcyB5ZXQgOy0pKQoK
SWFuLgoKCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpY
ZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0
cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Mon Nov 19 10:30:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 10:30:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaObq-0005pV-Md; Mon, 19 Nov 2012 10:29:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaObq-0005pN-2b
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 10:29:46 +0000
Received: from [85.158.143.99:20961] by server-1.bemta-4.messagelabs.com id
	56/74-27934-91A0AA05; Mon, 19 Nov 2012 10:29:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1353320974!29904856!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31899 invoked from network); 19 Nov 2012 10:29:36 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 10:29:36 -0000
X-IronPort-AV: E=Sophos;i="4.83,278,1352073600"; d="scan'208";a="15874687"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 10:29:34 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 10:29:34 +0000
Message-ID: <1353320973.18229.27.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Pasi =?ISO-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
Date: Mon, 19 Nov 2012 10:29:33 +0000
In-Reply-To: <20121118210214.GQ8912@reaktio.net>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
	<1353084913.3499.240.camel@zakaz.uk.xensource.com>
	<20121118210214.GQ8912@reaktio.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 0 of 5] docs: x86 PV MMU related functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gU3VuLCAyMDEyLTExLTE4IGF0IDIxOjAyICswMDAwLCBQYXNpIEvDpHJra8OkaW5lbiB3cm90
ZToKPiBPbiBGcmksIE5vdiAxNiwgMjAxMiBhdCAwNDo1NToxM1BNICswMDAwLCBJYW4gQ2FtcGJl
bGwgd3JvdGU6Cj4gPiBPbiBGcmksIDIwMTItMTEtMDIgYXQgMTE6MTggKzAwMDAsIElhbiBDYW1w
YmVsbCB3cm90ZToKPiA+ID4KPiA+ID4gSSBhbHNvIGhhdmUgYSBkcmFmdCBvZiBhIHdpa2kgYXJ0
aWNsZSBvbiB0aGUgc3ViamVjdCB3aGljaCByZWZlcmVuY2VzCj4gPiA+IHRoZSBpbmZvcm1hdGlv
biBpbiB0aGUgcHVibGljIGhlYWRlcnMgd2hpY2ggSSBob3BlIHRvIHBvc3Qgc29vbi4KPiA+Cj4g
PiBJIHJlYWxpc2VkIEkgZm9yZ290IHRvIGRvIHRoaXMuLi4KPiA+Cj4gPiBJdCBuZWVkcyBzb21l
IHBvbGlzaCBidXQgdGhlIG1ham9yaXR5IG9mIHRoZSBYWFgncyBhcmUgcGxhY2Vob2xkZXIgZm9y
Cj4gPiBsaW5rcyB0byB0aGUgcmVzdWx0IG9mIHRoaXMgYXBwbHlpbmcgdGhpcyBzZXJpZXMuCj4g
Pgo+IAo+IEhlbGxvLAo+IAo+IENvbW1lbnRzIGFib3V0IHNvbWUgc21hbGwgdHlwb3MuCgpUaGFu
a3MsIEkndmUgaW5jb3Jwb3JhdGVkIHRoZXNlIGludG8gbXkgbG9jYWwgY29weS4KCihPYnZpb3Vz
bHkgSSBkaWRuJ3QgcHJvb2YtcmVhZCBvciBldmVuIHNwZWxsY2hlY2sgdGhpcyB5ZXQgOy0pKQoK
SWFuLgoKCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpY
ZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0
cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Mon Nov 19 10:31:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 10:31:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaOdN-0005z4-6K; Mon, 19 Nov 2012 10:31:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaOdL-0005yn-QZ
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 10:31:20 +0000
Received: from [85.158.139.211:22056] by server-3.bemta-5.messagelabs.com id
	D9/87-18736-57A0AA05; Mon, 19 Nov 2012 10:31:17 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1353321076!20727085!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 972 invoked from network); 19 Nov 2012 10:31:17 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 10:31:17 -0000
X-IronPort-AV: E=Sophos;i="4.83,278,1352073600"; d="scan'208";a="15874730"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 10:31:16 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 10:31:16 +0000
Message-ID: <1353321075.18229.29.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tushar Behera <tushar.behera@linaro.org>
Date: Mon, 19 Nov 2012 10:31:15 +0000
In-Reply-To: <50A9AD05.5080201@linaro.org>
References: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
	<1353048646-10935-10-git-send-email-tushar.behera@linaro.org>
	<20121116160923.GP22320@phenom.dumpdata.com>
	<b0cd27cf-919f-46b0-afa1-4566f6ea0f61@email.android.com>
	<50A9AD05.5080201@linaro.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"patches@linaro.org" <patches@linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>
Subject: Re: [Xen-devel] [PATCH 09/14] xen: events: Remove redundant check
 on unsigned variable
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 03:52 +0000, Tushar Behera wrote:
> On 11/16/2012 10:23 PM, Jeremy Fitzhardinge wrote:
> > To be honest I'd nack this kind of patch. The test is only redundant in the most trivial sense that the compiler can easily optimise away. The point of the test is to make sure that the range is OK even if the type subsequently becomes signed (to hold a -ve error, for example).
> > 
> > J
> > 
> 
> The check is on the function argument which is unsigned, so checking '<
> 0' doesn't make sense. We should force signed check only if the argument
> is of signed type. In any case, even if irq has been assigned some error
> value, that would be caught by the check irq >= nr_irqs.

Jeremy is (I think) arguing that this check is not redundant because
someone might change the type of the argument to be signed and until
then the compiler can trivially optimise the check away, so what's the
harm in it?

I'm somewhat inclined to agree with him.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 10:31:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 10:31:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaOdN-0005z4-6K; Mon, 19 Nov 2012 10:31:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaOdL-0005yn-QZ
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 10:31:20 +0000
Received: from [85.158.139.211:22056] by server-3.bemta-5.messagelabs.com id
	D9/87-18736-57A0AA05; Mon, 19 Nov 2012 10:31:17 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1353321076!20727085!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 972 invoked from network); 19 Nov 2012 10:31:17 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 10:31:17 -0000
X-IronPort-AV: E=Sophos;i="4.83,278,1352073600"; d="scan'208";a="15874730"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 10:31:16 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 10:31:16 +0000
Message-ID: <1353321075.18229.29.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tushar Behera <tushar.behera@linaro.org>
Date: Mon, 19 Nov 2012 10:31:15 +0000
In-Reply-To: <50A9AD05.5080201@linaro.org>
References: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
	<1353048646-10935-10-git-send-email-tushar.behera@linaro.org>
	<20121116160923.GP22320@phenom.dumpdata.com>
	<b0cd27cf-919f-46b0-afa1-4566f6ea0f61@email.android.com>
	<50A9AD05.5080201@linaro.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"patches@linaro.org" <patches@linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>
Subject: Re: [Xen-devel] [PATCH 09/14] xen: events: Remove redundant check
 on unsigned variable
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 03:52 +0000, Tushar Behera wrote:
> On 11/16/2012 10:23 PM, Jeremy Fitzhardinge wrote:
> > To be honest I'd nack this kind of patch. The test is only redundant in the most trivial sense that the compiler can easily optimise away. The point of the test is to make sure that the range is OK even if the type subsequently becomes signed (to hold a -ve error, for example).
> > 
> > J
> > 
> 
> The check is on the function argument which is unsigned, so checking '<
> 0' doesn't make sense. We should force signed check only if the argument
> is of signed type. In any case, even if irq has been assigned some error
> value, that would be caught by the check irq >= nr_irqs.

Jeremy is (I think) arguing that this check is not redundant because
someone might change the type of the argument to be signed and until
then the compiler can trivially optimise the check away, so what's the
harm in it?

I'm somewhat inclined to agree with him.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 10:43:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 10:43:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaOp1-0006H7-Gd; Mon, 19 Nov 2012 10:43:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaOp0-0006H2-72
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 10:43:22 +0000
Received: from [193.109.254.147:27357] by server-14.bemta-14.messagelabs.com
	id DC/77-14517-94D0AA05; Mon, 19 Nov 2012 10:43:21 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1353321727!1057630!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2578 invoked from network); 19 Nov 2012 10:42:08 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 10:42:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,278,1352073600"; d="scan'208";a="15875084"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 10:42:07 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 10:42:07 +0000
Message-ID: <1353321726.18229.32.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Date: Mon, 19 Nov 2012 10:42:06 +0000
In-Reply-To: <1353090514-18537-2-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-2-git-send-email-dgdegra@tycho.nsa.gov>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 01/19] libxl: introduce XSM relabel on build
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 18:28 +0000, Daniel De Graaf wrote:
> Allow a domain to be built under one security label and run using a
> different label. This can be used to prevent the domain builder or
> control domain from having the ability to access a guest domain's memory
> via map_foreign_range except during the build process where this is
> required.
> 
> Note: this does not provide complete protection from a malicious dom0;
> mappings created during the build process may persist after the relabel,
> and could be used to indirectly access the guest's memory.
> 
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> ---
>  tools/libxc/xc_flask.c      | 10 ++++++++++
>  tools/libxc/xenctrl.h       |  1 +
>  tools/libxl/libxl_create.c  |  4 ++++
>  tools/libxl/libxl_types.idl |  1 +
>  tools/libxl/xl_cmdimpl.c    | 20 +++++++++++++++++++-

   docs/man... please

> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index 7eac4a8..93524f0 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -268,6 +268,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
>      ("video_memkb",     MemKB),
>      ("shadow_memkb",    MemKB),
>      ("rtc_timeoffset",  uint32),
> +    ("exec_ssidref",    uint32),

What is the significance of the "exec_" bit of the name?

>      ("localtime",       libxl_defbool),
>      ("disable_migrate", libxl_defbool),
>      ("cpuid",           libxl_cpuid_policy_list),

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 10:43:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 10:43:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaOp1-0006H7-Gd; Mon, 19 Nov 2012 10:43:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaOp0-0006H2-72
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 10:43:22 +0000
Received: from [193.109.254.147:27357] by server-14.bemta-14.messagelabs.com
	id DC/77-14517-94D0AA05; Mon, 19 Nov 2012 10:43:21 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1353321727!1057630!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2578 invoked from network); 19 Nov 2012 10:42:08 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 10:42:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,278,1352073600"; d="scan'208";a="15875084"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 10:42:07 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 10:42:07 +0000
Message-ID: <1353321726.18229.32.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Date: Mon, 19 Nov 2012 10:42:06 +0000
In-Reply-To: <1353090514-18537-2-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-2-git-send-email-dgdegra@tycho.nsa.gov>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 01/19] libxl: introduce XSM relabel on build
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 18:28 +0000, Daniel De Graaf wrote:
> Allow a domain to be built under one security label and run using a
> different label. This can be used to prevent the domain builder or
> control domain from having the ability to access a guest domain's memory
> via map_foreign_range except during the build process where this is
> required.
> 
> Note: this does not provide complete protection from a malicious dom0;
> mappings created during the build process may persist after the relabel,
> and could be used to indirectly access the guest's memory.
> 
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> ---
>  tools/libxc/xc_flask.c      | 10 ++++++++++
>  tools/libxc/xenctrl.h       |  1 +
>  tools/libxl/libxl_create.c  |  4 ++++
>  tools/libxl/libxl_types.idl |  1 +
>  tools/libxl/xl_cmdimpl.c    | 20 +++++++++++++++++++-

   docs/man... please

> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index 7eac4a8..93524f0 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -268,6 +268,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
>      ("video_memkb",     MemKB),
>      ("shadow_memkb",    MemKB),
>      ("rtc_timeoffset",  uint32),
> +    ("exec_ssidref",    uint32),

What is the significance of the "exec_" bit of the name?

>      ("localtime",       libxl_defbool),
>      ("disable_migrate", libxl_defbool),
>      ("cpuid",           libxl_cpuid_policy_list),

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 10:47:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 10:47:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaOsa-0006PE-9C; Mon, 19 Nov 2012 10:47:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaOsZ-0006P6-3j
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 10:47:03 +0000
Received: from [85.158.139.83:9259] by server-13.bemta-5.messagelabs.com id
	BC/9D-27809-62E0AA05; Mon, 19 Nov 2012 10:47:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1353322020!28192317!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27998 invoked from network); 19 Nov 2012 10:47:01 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 10:47:01 -0000
X-IronPort-AV: E=Sophos;i="4.83,278,1352073600"; d="scan'208";a="15875230"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 10:47:00 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 10:47:00 +0000
Message-ID: <1353322019.18229.35.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Date: Mon, 19 Nov 2012 10:46:59 +0000
In-Reply-To: <1353090514-18537-3-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-3-git-send-email-dgdegra@tycho.nsa.gov>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 02/19] flask/policy: Add domain relabel
 example
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 18:28 +0000, Daniel De Graaf wrote:
> This adds the nomigrate_t type to the example FLASK policy which allows
> domains to be created that dom0 cannot access after building.

This is a very cool example of how even dom0's privileges can be
curtailed, I like it!

The fact that the domain can't be migrated is more of a side-effect
though I guess, but I can't really think of a better name (e.g.
"securedom_t" suggests other domains aren't etc...)

I'd ack it but this stuff is all Greek to me ;-)

> 
> Example domain configuration snippet:
>   seclabel='customer_1:vm_r:nomigrate_t'
>   init_seclabel='customer_1:vm_r:nomigrate_t_building'
> 
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>  docs/misc/xsm-flask.txt                      |  2 +
>  tools/flask/policy/policy/modules/xen/xen.if | 56 +++++++++++++++++++++-------
>  tools/flask/policy/policy/modules/xen/xen.te | 10 +++++
>  3 files changed, 55 insertions(+), 13 deletions(-)
> 
> diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
> index 6b0d327..0778a28 100644
> --- a/docs/misc/xsm-flask.txt
> +++ b/docs/misc/xsm-flask.txt
> @@ -60,6 +60,8 @@ that can be used without dom0 disaggregation. The main types for domUs are:
>   - domU_t is a domain that can communicate with any other domU_t
>   - isolated_domU_t can only communicate with dom0
>   - prot_domU_t is a domain type whose creation can be disabled with a boolean
> + - nomigrate_t is a domain that must be created via the nomigrate_t_building
> +   type, and whose memory cannot be read by dom0 once created
>  
>  HVM domains with stubdomain device models use two types (one per domain):
>   - domHVM_t is an HVM domain that uses a stubdomain device model
> diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
> index 3f58909..2ad11b2 100644
> --- a/tools/flask/policy/policy/modules/xen/xen.if
> +++ b/tools/flask/policy/policy/modules/xen/xen.if
> @@ -9,24 +9,47 @@
>  #   Declare a type as a domain type, and allow basic domain setup
>  define(`declare_domain', `
>  	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
> +	type $1_channel, event_type;
> +	type_transition $1 domain_type:event $1_channel;
>  	allow $1 $1:grant { query setup };
>  	allow $1 $1:mmu { adjust physmap map_read map_write stat pinpage };
>  	allow $1 $1:hvm { getparam setparam };
>  ')
>  
> -# create_domain(priv, target)
> -#   Allow a domain to be created
> -define(`create_domain', `
> +# declare_build_label(type)
> +#   Declare a paired _building type for the given domain type
> +define(`declare_build_label', `
> +	type $1_building, domain_type;
> +	type_transition $1_building domain_type:event $1_channel;
> +	allow $1_building $1 : domain transition;
> +')
> +
> +define(`create_domain_common', `
>  	allow $1 $2:domain { create max_vcpus setdomainmaxmem setaddrsize
> -			getdomaininfo hypercall setvcpucontext scheduler
> -			unpause getvcpuinfo getvcpuextstate getaddrsize
> -			getvcpuaffinity };
> +			getdomaininfo hypercall setvcpucontext setextvcpucontext
> +			scheduler getvcpuinfo getvcpuextstate getaddrsize
> +			getvcpuaffinity setvcpuaffinity };
>  	allow $1 $2:security check_context;
>  	allow $1 $2:shadow enable;
>  	allow $1 $2:mmu {map_read map_write adjust memorymap physmap pinpage};
>  	allow $1 $2:grant setup;
> -	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute setparam pcilevel trackdirtyvram };
> -	allow $1 $2_$1_channel:event create;
> +	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc setparam pcilevel trackdirtyvram };
> +')
> +
> +# create_domain(priv, target)
> +#   Allow a domain to be created directly
> +define(`create_domain', `
> +	create_domain_common($1, $2)
> +	allow $1 $2_channel:event create;
> +')
> +
> +# create_domain_build_label(priv, target)
> +#   Allow a domain to be created via its domain build label
> +define(`create_domain_build_label', `
> +	create_domain_common($1, $2_building)
> +	allow $1 $2_channel:event create;
> +	allow $1 $2_building:domain2 relabelfrom;
> +	allow $1 $2:domain2 relabelto;
>  ')
>  
>  # manage_domain(priv, target)
> @@ -37,6 +60,15 @@ define(`manage_domain', `
>  			setvcpuaffinity setdomainmaxmem };
>  ')
>  
> +# migrate_domain_out(priv, target)
> +#   Allow creation of a snapshot or migration image from a domain
> +#   (inbound migration is the same as domain creation)
> +define(`migrate_domain_out', `
> +	allow $1 $2:hvm { gethvmc getparam irqlevel };
> +	allow $1 $2:mmu { stat pageinfo map_read };
> +	allow $1 $2:domain { getaddrsize getvcpucontext getextvcpucontext getvcpuextstate pause destroy };
> +')
> +
>  ################################################################################
>  #
>  # Inter-domain communication
> @@ -47,8 +79,6 @@ define(`manage_domain', `
>  #   This allows an event channel to be created from domains with labels
>  #   <source> to <dest> and will label it <chan-label>
>  define(`create_channel', `
> -	type $3, event_type;
> -	type_transition $1 $2:event $3;
>  	allow $1 $3:event { create send status };
>  	allow $3 $2:event { bind };
>  ')
> @@ -56,8 +86,8 @@ define(`create_channel', `
>  # domain_event_comms(dom1, dom2)
>  #   Allow two domain types to communicate using event channels
>  define(`domain_event_comms', `
> -	create_channel($1, $2, $1_$2_channel)
> -	create_channel($2, $1, $2_$1_channel)
> +	create_channel($1, $2, $1_channel)
> +	create_channel($2, $1, $2_channel)
>  ')
>  
>  # domain_comms(dom1, dom2)
> @@ -72,7 +102,7 @@ define(`domain_comms', `
>  #   Allow a domain types to communicate with others of its type using grants
>  #   and event channels (this includes event channels to DOMID_SELF)
>  define(`domain_self_comms', `
> -	create_channel($1, $1, $1_self_channel)
> +	create_channel($1, $1, $1_channel)
>  	allow $1 $1:grant { map_read map_write copy unmap };
>  ')
>  
> diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
> index 9550397..1162153 100644
> --- a/tools/flask/policy/policy/modules/xen/xen.te
> +++ b/tools/flask/policy/policy/modules/xen/xen.te
> @@ -90,6 +90,7 @@ create_domain(dom0_t, isolated_domU_t)
>  manage_domain(dom0_t, isolated_domU_t)
>  domain_comms(dom0_t, isolated_domU_t)
>  
> +# Declare a boolean that denies creation of prot_domU_t domains
>  gen_bool(prot_doms_locked, false)
>  declare_domain(prot_domU_t)
>  if (!prot_doms_locked) {
> @@ -111,6 +112,15 @@ manage_domain(dom0_t, dm_dom_t)
>  domain_comms(dom0_t, dm_dom_t)
>  device_model(dm_dom_t, domHVM_t)
>  
> +# nomigrate_t must be built via the nomigrate_t_building label; once built,
> +# dom0 cannot read its memory.
> +declare_domain(nomigrate_t)
> +declare_build_label(nomigrate_t)
> +create_domain_build_label(dom0_t, nomigrate_t)
> +manage_domain(dom0_t, nomigrate_t)
> +domain_comms(dom0_t, nomigrate_t)
> +domain_self_comms(nomigrate_t)
> +
>  ###############################################################################
>  #
>  # Device delegation



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 10:47:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 10:47:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaOsa-0006PE-9C; Mon, 19 Nov 2012 10:47:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaOsZ-0006P6-3j
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 10:47:03 +0000
Received: from [85.158.139.83:9259] by server-13.bemta-5.messagelabs.com id
	BC/9D-27809-62E0AA05; Mon, 19 Nov 2012 10:47:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1353322020!28192317!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27998 invoked from network); 19 Nov 2012 10:47:01 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 10:47:01 -0000
X-IronPort-AV: E=Sophos;i="4.83,278,1352073600"; d="scan'208";a="15875230"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 10:47:00 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 10:47:00 +0000
Message-ID: <1353322019.18229.35.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Date: Mon, 19 Nov 2012 10:46:59 +0000
In-Reply-To: <1353090514-18537-3-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-3-git-send-email-dgdegra@tycho.nsa.gov>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 02/19] flask/policy: Add domain relabel
 example
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 18:28 +0000, Daniel De Graaf wrote:
> This adds the nomigrate_t type to the example FLASK policy which allows
> domains to be created that dom0 cannot access after building.

This is a very cool example of how even dom0's privileges can be
curtailed, I like it!

The fact that the domain can't be migrated is more of a side-effect
though I guess, but I can't really think of a better name (e.g.
"securedom_t" suggests other domains aren't etc...)

I'd ack it but this stuff is all Greek to me ;-)

> 
> Example domain configuration snippet:
>   seclabel='customer_1:vm_r:nomigrate_t'
>   init_seclabel='customer_1:vm_r:nomigrate_t_building'
> 
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>  docs/misc/xsm-flask.txt                      |  2 +
>  tools/flask/policy/policy/modules/xen/xen.if | 56 +++++++++++++++++++++-------
>  tools/flask/policy/policy/modules/xen/xen.te | 10 +++++
>  3 files changed, 55 insertions(+), 13 deletions(-)
> 
> diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
> index 6b0d327..0778a28 100644
> --- a/docs/misc/xsm-flask.txt
> +++ b/docs/misc/xsm-flask.txt
> @@ -60,6 +60,8 @@ that can be used without dom0 disaggregation. The main types for domUs are:
>   - domU_t is a domain that can communicate with any other domU_t
>   - isolated_domU_t can only communicate with dom0
>   - prot_domU_t is a domain type whose creation can be disabled with a boolean
> + - nomigrate_t is a domain that must be created via the nomigrate_t_building
> +   type, and whose memory cannot be read by dom0 once created
>  
>  HVM domains with stubdomain device models use two types (one per domain):
>   - domHVM_t is an HVM domain that uses a stubdomain device model
> diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
> index 3f58909..2ad11b2 100644
> --- a/tools/flask/policy/policy/modules/xen/xen.if
> +++ b/tools/flask/policy/policy/modules/xen/xen.if
> @@ -9,24 +9,47 @@
>  #   Declare a type as a domain type, and allow basic domain setup
>  define(`declare_domain', `
>  	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
> +	type $1_channel, event_type;
> +	type_transition $1 domain_type:event $1_channel;
>  	allow $1 $1:grant { query setup };
>  	allow $1 $1:mmu { adjust physmap map_read map_write stat pinpage };
>  	allow $1 $1:hvm { getparam setparam };
>  ')
>  
> -# create_domain(priv, target)
> -#   Allow a domain to be created
> -define(`create_domain', `
> +# declare_build_label(type)
> +#   Declare a paired _building type for the given domain type
> +define(`declare_build_label', `
> +	type $1_building, domain_type;
> +	type_transition $1_building domain_type:event $1_channel;
> +	allow $1_building $1 : domain transition;
> +')
> +
> +define(`create_domain_common', `
>  	allow $1 $2:domain { create max_vcpus setdomainmaxmem setaddrsize
> -			getdomaininfo hypercall setvcpucontext scheduler
> -			unpause getvcpuinfo getvcpuextstate getaddrsize
> -			getvcpuaffinity };
> +			getdomaininfo hypercall setvcpucontext setextvcpucontext
> +			scheduler getvcpuinfo getvcpuextstate getaddrsize
> +			getvcpuaffinity setvcpuaffinity };
>  	allow $1 $2:security check_context;
>  	allow $1 $2:shadow enable;
>  	allow $1 $2:mmu {map_read map_write adjust memorymap physmap pinpage};
>  	allow $1 $2:grant setup;
> -	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute setparam pcilevel trackdirtyvram };
> -	allow $1 $2_$1_channel:event create;
> +	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc setparam pcilevel trackdirtyvram };
> +')
> +
> +# create_domain(priv, target)
> +#   Allow a domain to be created directly
> +define(`create_domain', `
> +	create_domain_common($1, $2)
> +	allow $1 $2_channel:event create;
> +')
> +
> +# create_domain_build_label(priv, target)
> +#   Allow a domain to be created via its domain build label
> +define(`create_domain_build_label', `
> +	create_domain_common($1, $2_building)
> +	allow $1 $2_channel:event create;
> +	allow $1 $2_building:domain2 relabelfrom;
> +	allow $1 $2:domain2 relabelto;
>  ')
>  
>  # manage_domain(priv, target)
> @@ -37,6 +60,15 @@ define(`manage_domain', `
>  			setvcpuaffinity setdomainmaxmem };
>  ')
>  
> +# migrate_domain_out(priv, target)
> +#   Allow creation of a snapshot or migration image from a domain
> +#   (inbound migration is the same as domain creation)
> +define(`migrate_domain_out', `
> +	allow $1 $2:hvm { gethvmc getparam irqlevel };
> +	allow $1 $2:mmu { stat pageinfo map_read };
> +	allow $1 $2:domain { getaddrsize getvcpucontext getextvcpucontext getvcpuextstate pause destroy };
> +')
> +
>  ################################################################################
>  #
>  # Inter-domain communication
> @@ -47,8 +79,6 @@ define(`manage_domain', `
>  #   This allows an event channel to be created from domains with labels
>  #   <source> to <dest> and will label it <chan-label>
>  define(`create_channel', `
> -	type $3, event_type;
> -	type_transition $1 $2:event $3;
>  	allow $1 $3:event { create send status };
>  	allow $3 $2:event { bind };
>  ')
> @@ -56,8 +86,8 @@ define(`create_channel', `
>  # domain_event_comms(dom1, dom2)
>  #   Allow two domain types to communicate using event channels
>  define(`domain_event_comms', `
> -	create_channel($1, $2, $1_$2_channel)
> -	create_channel($2, $1, $2_$1_channel)
> +	create_channel($1, $2, $1_channel)
> +	create_channel($2, $1, $2_channel)
>  ')
>  
>  # domain_comms(dom1, dom2)
> @@ -72,7 +102,7 @@ define(`domain_comms', `
>  #   Allow a domain types to communicate with others of its type using grants
>  #   and event channels (this includes event channels to DOMID_SELF)
>  define(`domain_self_comms', `
> -	create_channel($1, $1, $1_self_channel)
> +	create_channel($1, $1, $1_channel)
>  	allow $1 $1:grant { map_read map_write copy unmap };
>  ')
>  
> diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
> index 9550397..1162153 100644
> --- a/tools/flask/policy/policy/modules/xen/xen.te
> +++ b/tools/flask/policy/policy/modules/xen/xen.te
> @@ -90,6 +90,7 @@ create_domain(dom0_t, isolated_domU_t)
>  manage_domain(dom0_t, isolated_domU_t)
>  domain_comms(dom0_t, isolated_domU_t)
>  
> +# Declare a boolean that denies creation of prot_domU_t domains
>  gen_bool(prot_doms_locked, false)
>  declare_domain(prot_domU_t)
>  if (!prot_doms_locked) {
> @@ -111,6 +112,15 @@ manage_domain(dom0_t, dm_dom_t)
>  domain_comms(dom0_t, dm_dom_t)
>  device_model(dm_dom_t, domHVM_t)
>  
> +# nomigrate_t must be built via the nomigrate_t_building label; once built,
> +# dom0 cannot read its memory.
> +declare_domain(nomigrate_t)
> +declare_build_label(nomigrate_t)
> +create_domain_build_label(dom0_t, nomigrate_t)
> +manage_domain(dom0_t, nomigrate_t)
> +domain_comms(dom0_t, nomigrate_t)
> +domain_self_comms(nomigrate_t)
> +
>  ###############################################################################
>  #
>  # Device delegation



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:00:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:00:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaP4y-0006cB-KF; Mon, 19 Nov 2012 10:59:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <tushar.behera@linaro.org>) id 1TaP4x-0006c6-FI
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 10:59:51 +0000
Received: from [85.158.139.211:25694] by server-7.bemta-5.messagelabs.com id
	05/3A-23096-6211AA05; Mon, 19 Nov 2012 10:59:50 +0000
X-Env-Sender: tushar.behera@linaro.org
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353322788!20659841!1
X-Originating-IP: [209.85.160.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8342 invoked from network); 19 Nov 2012 10:59:49 -0000
Received: from mail-pb0-f43.google.com (HELO mail-pb0-f43.google.com)
	(209.85.160.43)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 10:59:49 -0000
Received: by mail-pb0-f43.google.com with SMTP id wz17so3544413pbc.30
	for <xen-devel@lists.xensource.com>;
	Mon, 19 Nov 2012 02:59:48 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding
	:x-gm-message-state;
	bh=IDFceqYQ6VYiO8yw6SaKZ/ly4shBKEK2rrJUfPVNxs4=;
	b=VX1T0NQCHUI8PExHQxRhmWPEE02HdXD1w47eJWavukigwOalzDjzmu8Noiy2P/4Fv9
	/0stEKIiC/D5aG4/fO7SQpyauw0cqSRHW8SAbXtYEbJmQ/5H8CoaFOh4/cD9WwwXkp+8
	kS3u6QKh7SGSTCIh70xWqI57WxfUQLGPWlkj8EW81v7pl4DGbn0IjSl5ZymXAo53/vqH
	5/uLyVMXqUn3lMyu8gwqo5d8j3hUO77gsXBq8i4N76616zJh7WXeykkWek+WLufHp2Kq
	eHTMJvuYlMWC3gCKsHmdkC8WQHoYPeili20cgKz/f8FDY34E8NfOIJltYKnik4Kn+BVk
	RY2g==
Received: by 10.68.233.201 with SMTP id ty9mr38602388pbc.14.1353322787863;
	Mon, 19 Nov 2012 02:59:47 -0800 (PST)
Received: from [10.10.10.29] ([115.113.119.130])
	by mx.google.com with ESMTPS id x8sm6015540paw.16.2012.11.19.02.59.44
	(version=SSLv3 cipher=OTHER); Mon, 19 Nov 2012 02:59:46 -0800 (PST)
Message-ID: <50AA1140.70103@linaro.org>
Date: Mon, 19 Nov 2012 16:30:16 +0530
From: Tushar Behera <tushar.behera@linaro.org>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
	<1353048646-10935-10-git-send-email-tushar.behera@linaro.org>
	<20121116160923.GP22320@phenom.dumpdata.com>
	<b0cd27cf-919f-46b0-afa1-4566f6ea0f61@email.android.com>
	<50A9AD05.5080201@linaro.org>
	<1353321075.18229.29.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353321075.18229.29.camel@zakaz.uk.xensource.com>
X-Gm-Message-State: ALoCoQlOnXH/+gG1y3kuKX/vS1vLWfbcu2zqtLm85CHYokeu59nhoOg4spVoZQ8tYs/JIwAy5g8K
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"patches@linaro.org" <patches@linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>
Subject: Re: [Xen-devel] [PATCH 09/14] xen: events: Remove redundant check
 on unsigned variable
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/19/2012 04:01 PM, Ian Campbell wrote:
> On Mon, 2012-11-19 at 03:52 +0000, Tushar Behera wrote:
>> On 11/16/2012 10:23 PM, Jeremy Fitzhardinge wrote:
>>> To be honest I'd nack this kind of patch. The test is only redundant in the most trivial sense that the compiler can easily optimise away. The point of the test is to make sure that the range is OK even if the type subsequently becomes signed (to hold a -ve error, for example).
>>>
>>> J
>>>
>>
>> The check is on the function argument which is unsigned, so checking '<
>> 0' doesn't make sense. We should force signed check only if the argument
>> is of signed type. In any case, even if irq has been assigned some error
>> value, that would be caught by the check irq >= nr_irqs.
> 
> Jeremy is (I think) arguing that this check is not redundant because
> someone might change the type of the argument to be signed and until
> then the compiler can trivially optimise the check away, so what's the
> harm in it?
> 
> I'm somewhat inclined to agree with him.
> 
> Ian.
> 
Ok, I don't have much argument against this.

-- 
Tushar Behera

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:00:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:00:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaP4y-0006cB-KF; Mon, 19 Nov 2012 10:59:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <tushar.behera@linaro.org>) id 1TaP4x-0006c6-FI
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 10:59:51 +0000
Received: from [85.158.139.211:25694] by server-7.bemta-5.messagelabs.com id
	05/3A-23096-6211AA05; Mon, 19 Nov 2012 10:59:50 +0000
X-Env-Sender: tushar.behera@linaro.org
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353322788!20659841!1
X-Originating-IP: [209.85.160.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8342 invoked from network); 19 Nov 2012 10:59:49 -0000
Received: from mail-pb0-f43.google.com (HELO mail-pb0-f43.google.com)
	(209.85.160.43)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 10:59:49 -0000
Received: by mail-pb0-f43.google.com with SMTP id wz17so3544413pbc.30
	for <xen-devel@lists.xensource.com>;
	Mon, 19 Nov 2012 02:59:48 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding
	:x-gm-message-state;
	bh=IDFceqYQ6VYiO8yw6SaKZ/ly4shBKEK2rrJUfPVNxs4=;
	b=VX1T0NQCHUI8PExHQxRhmWPEE02HdXD1w47eJWavukigwOalzDjzmu8Noiy2P/4Fv9
	/0stEKIiC/D5aG4/fO7SQpyauw0cqSRHW8SAbXtYEbJmQ/5H8CoaFOh4/cD9WwwXkp+8
	kS3u6QKh7SGSTCIh70xWqI57WxfUQLGPWlkj8EW81v7pl4DGbn0IjSl5ZymXAo53/vqH
	5/uLyVMXqUn3lMyu8gwqo5d8j3hUO77gsXBq8i4N76616zJh7WXeykkWek+WLufHp2Kq
	eHTMJvuYlMWC3gCKsHmdkC8WQHoYPeili20cgKz/f8FDY34E8NfOIJltYKnik4Kn+BVk
	RY2g==
Received: by 10.68.233.201 with SMTP id ty9mr38602388pbc.14.1353322787863;
	Mon, 19 Nov 2012 02:59:47 -0800 (PST)
Received: from [10.10.10.29] ([115.113.119.130])
	by mx.google.com with ESMTPS id x8sm6015540paw.16.2012.11.19.02.59.44
	(version=SSLv3 cipher=OTHER); Mon, 19 Nov 2012 02:59:46 -0800 (PST)
Message-ID: <50AA1140.70103@linaro.org>
Date: Mon, 19 Nov 2012 16:30:16 +0530
From: Tushar Behera <tushar.behera@linaro.org>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org>
	<1353048646-10935-10-git-send-email-tushar.behera@linaro.org>
	<20121116160923.GP22320@phenom.dumpdata.com>
	<b0cd27cf-919f-46b0-afa1-4566f6ea0f61@email.android.com>
	<50A9AD05.5080201@linaro.org>
	<1353321075.18229.29.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353321075.18229.29.camel@zakaz.uk.xensource.com>
X-Gm-Message-State: ALoCoQlOnXH/+gG1y3kuKX/vS1vLWfbcu2zqtLm85CHYokeu59nhoOg4spVoZQ8tYs/JIwAy5g8K
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"patches@linaro.org" <patches@linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>
Subject: Re: [Xen-devel] [PATCH 09/14] xen: events: Remove redundant check
 on unsigned variable
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/19/2012 04:01 PM, Ian Campbell wrote:
> On Mon, 2012-11-19 at 03:52 +0000, Tushar Behera wrote:
>> On 11/16/2012 10:23 PM, Jeremy Fitzhardinge wrote:
>>> To be honest I'd nack this kind of patch. The test is only redundant in the most trivial sense that the compiler can easily optimise away. The point of the test is to make sure that the range is OK even if the type subsequently becomes signed (to hold a -ve error, for example).
>>>
>>> J
>>>
>>
>> The check is on the function argument which is unsigned, so checking '<
>> 0' doesn't make sense. We should force signed check only if the argument
>> is of signed type. In any case, even if irq has been assigned some error
>> value, that would be caught by the check irq >= nr_irqs.
> 
> Jeremy is (I think) arguing that this check is not redundant because
> someone might change the type of the argument to be signed and until
> then the compiler can trivially optimise the check away, so what's the
> harm in it?
> 
> I'm somewhat inclined to agree with him.
> 
> Ian.
> 
Ok, I don't have much argument against this.

-- 
Tushar Behera

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:02:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:02:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaP7P-0006kM-6F; Mon, 19 Nov 2012 11:02:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaP7N-0006kG-Gn
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 11:02:21 +0000
Received: from [193.109.254.147:5888] by server-1.bemta-14.messagelabs.com id
	57/63-25314-CB11AA05; Mon, 19 Nov 2012 11:02:20 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1353322820!10218069!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31551 invoked from network); 19 Nov 2012 11:00:20 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:00:20 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15875636"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 11:00:06 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 11:00:06 +0000
Message-ID: <1353322804.18229.43.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Date: Mon, 19 Nov 2012 11:00:04 +0000
In-Reply-To: <1353090514-18537-7-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-7-git-send-email-dgdegra@tycho.nsa.gov>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 06/19] xen: use XSM instead of IS_PRIV where
 duplicated
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 18:28 +0000, Daniel De Graaf wrote:
> The Xen hypervisor has two basic access control function calls: IS_PRIV
> and the xsm_* functions. Most privileged operations currently require
> that both checks succeed, and many times the checks are at different
> locations in the code. This patch eliminates the explicit and implicit
> IS_PRIV checks that are duplicated in XSM hooks.

The downside is that you loose some context in the hypercall
implementation, i.e. the hint about whether a hypercall is available
only to the toolstack, or to only stubdomains or more generally to all
guests etc which is useful to have in front of you when changing the
code.

IOW I worry that we may end up introducing bugs due to hiding this
context away behind the xsm wrapper, e.g. you think a function is
privileged guest only but actually it is guest accessible.

I wonder if there is any way we can get the benefits of this change
without this downside?

Perhaps in the name of the hook? e.g. For each existing xsm_<foo> we
instead define exactly one of xsm_guest_<foo>, xsm_stubdom_<foo> or
xsm_priv_<foo>. This might also let us define some macros for use in
dummy.[ch] which simultaneously construct the correct function name and
include the appropriate boilerplate perm check thus ensuring they don't
get out of sync.

> Some checks are removed due to non-obvious duplicates in their callers:

If the duplicates are non-obvious wouldn't it be better to keep them as
a belt-and-braces measure?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:02:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:02:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaP7P-0006kM-6F; Mon, 19 Nov 2012 11:02:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaP7N-0006kG-Gn
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 11:02:21 +0000
Received: from [193.109.254.147:5888] by server-1.bemta-14.messagelabs.com id
	57/63-25314-CB11AA05; Mon, 19 Nov 2012 11:02:20 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1353322820!10218069!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31551 invoked from network); 19 Nov 2012 11:00:20 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:00:20 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15875636"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 11:00:06 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 11:00:06 +0000
Message-ID: <1353322804.18229.43.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Date: Mon, 19 Nov 2012 11:00:04 +0000
In-Reply-To: <1353090514-18537-7-git-send-email-dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-7-git-send-email-dgdegra@tycho.nsa.gov>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 06/19] xen: use XSM instead of IS_PRIV where
 duplicated
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 18:28 +0000, Daniel De Graaf wrote:
> The Xen hypervisor has two basic access control function calls: IS_PRIV
> and the xsm_* functions. Most privileged operations currently require
> that both checks succeed, and many times the checks are at different
> locations in the code. This patch eliminates the explicit and implicit
> IS_PRIV checks that are duplicated in XSM hooks.

The downside is that you loose some context in the hypercall
implementation, i.e. the hint about whether a hypercall is available
only to the toolstack, or to only stubdomains or more generally to all
guests etc which is useful to have in front of you when changing the
code.

IOW I worry that we may end up introducing bugs due to hiding this
context away behind the xsm wrapper, e.g. you think a function is
privileged guest only but actually it is guest accessible.

I wonder if there is any way we can get the benefits of this change
without this downside?

Perhaps in the name of the hook? e.g. For each existing xsm_<foo> we
instead define exactly one of xsm_guest_<foo>, xsm_stubdom_<foo> or
xsm_priv_<foo>. This might also let us define some macros for use in
dummy.[ch] which simultaneously construct the correct function name and
include the appropriate boilerplate perm check thus ensuring they don't
get out of sync.

> Some checks are removed due to non-obvious duplicates in their callers:

If the duplicates are non-obvious wouldn't it be better to keep them as
a belt-and-braces measure?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:25:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:25:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPTe-0006yI-Cc; Mon, 19 Nov 2012 11:25:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaPTd-0006yD-5m
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 11:25:21 +0000
Received: from [193.109.254.147:14552] by server-6.bemta-14.messagelabs.com id
	3E/B0-02788-0271AA05; Mon, 19 Nov 2012 11:25:20 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1353324242!4648476!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16875 invoked from network); 19 Nov 2012 11:24:03 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:24:03 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15876501"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 11:24:02 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 11:24:02 +0000
Message-ID: <1353324241.18229.47.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Chunyan Liu <cyliu@suse.com>
Date: Mon, 19 Nov 2012 11:24:01 +0000
In-Reply-To: <CAERYnoZOJ-9nMjEbNNqWfU0Co6ksOHqOCG+nErKMfsnqJ125=w@mail.gmail.com>
References: <CAERYnoZOJ-9nMjEbNNqWfU0Co6ksOHqOCG+nErKMfsnqJ125=w@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH]xenstore-chmod: handle arbitrary number of
 perms rather than MAX_PERMS constant
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 06:02 +0000, Chunyan Liu wrote:
> Constant MAX_PERMS 16 is too small to use in some occasions, e.g. if
> there are more than 16 domU(s) on one hypervisor (it's easy to
> achieve) and one wants to do xenstore-chmod PATH to all domU(s). So,
> remove MAX_PERMS limitation and make it as arbitrary number of perms.
> 
> Signed-off-by: Chunyan Liu <cyliu@suse.com>
> 
> diff -r 8b93ac0c93f3 tools/xenstore/xenstore_client.c
> --- a/tools/xenstore/xenstore_client.c  Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/xenstore/xenstore_client.c  Thu Nov 15 16:33:32 2012 +0800
> @@ -25,7 +25,6 @@
>  #define PATH_SEP '/'
>  #define MAX_PATH_LEN 256
> 
> -#define MAX_PERMS 16
> 
>  enum mode {
>      MODE_unknown,
> @@ -416,31 +415,31 @@ perform(enum mode mode, int optind, int
>             break;
>          }
>          case MODE_chmod: {
> -            struct xs_permissions perms[MAX_PERMS];
> -            int nperms = 0;
> +            struct xs_permissions *perms;
>              /* save path pointer: */
>              char *path = argv[optind++];
> +            int nperms = argc - optind;
> +            int i;
> +            perms = (struct xs_permissions *)malloc(nperms *
> sizeof(struct xs_permissions));

You could just do:
		struct xs_permissions perms[nperms];
and let the compiler allocate enough space on the stack.

> +            if (!perms)
> +               err(1, NULL);
> -            for (; argv[optind]; optind++, nperms++)
> +            for (i = 0; argv[optind]; optind++, i++)
>              {
> -                if (MAX_PERMS <= nperms)
> -                    errx(1, "Too many permissions specified.  "
> -                        "Maximum per invocation is %d.", MAX_PERMS);
> -
> -                perms[nperms].id = atoi(argv[optind]+1);
> +                perms[i].id = atoi(argv[optind]+1);
> 
>                  switch (argv[optind][0])
>                  {
>                  case 'n':
> -                    perms[nperms].perms = XS_PERM_NONE;
> +                    perms[i].perms = XS_PERM_NONE;
>                      break;
>                  case 'r':
> -                    perms[nperms].perms = XS_PERM_READ;
> +                    perms[i].perms = XS_PERM_READ;
>                      break;
>                  case 'w':
> -                    perms[nperms].perms = XS_PERM_WRITE;
> +                    perms[i].perms = XS_PERM_WRITE;
>                      break;
>                  case 'b':
> -                    perms[nperms].perms = XS_PERM_READ | XS_PERM_WRITE;
> +                    perms[i].perms = XS_PERM_READ | XS_PERM_WRITE;
>                      break;
>                  default:
>                      errx(1, "Invalid permission specification: '%c'",
> @@ -449,6 +448,7 @@ perform(enum mode mode, int optind, int
>              }
> 
>              do_chmod(path, perms, nperms, upto, recurse, xsh, xth);
> +            free(perms);
>              break;
>          }
>          case MODE_watch: {
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:25:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:25:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPTe-0006yI-Cc; Mon, 19 Nov 2012 11:25:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaPTd-0006yD-5m
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 11:25:21 +0000
Received: from [193.109.254.147:14552] by server-6.bemta-14.messagelabs.com id
	3E/B0-02788-0271AA05; Mon, 19 Nov 2012 11:25:20 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1353324242!4648476!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16875 invoked from network); 19 Nov 2012 11:24:03 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:24:03 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15876501"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 11:24:02 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 11:24:02 +0000
Message-ID: <1353324241.18229.47.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Chunyan Liu <cyliu@suse.com>
Date: Mon, 19 Nov 2012 11:24:01 +0000
In-Reply-To: <CAERYnoZOJ-9nMjEbNNqWfU0Co6ksOHqOCG+nErKMfsnqJ125=w@mail.gmail.com>
References: <CAERYnoZOJ-9nMjEbNNqWfU0Co6ksOHqOCG+nErKMfsnqJ125=w@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH]xenstore-chmod: handle arbitrary number of
 perms rather than MAX_PERMS constant
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 06:02 +0000, Chunyan Liu wrote:
> Constant MAX_PERMS 16 is too small to use in some occasions, e.g. if
> there are more than 16 domU(s) on one hypervisor (it's easy to
> achieve) and one wants to do xenstore-chmod PATH to all domU(s). So,
> remove MAX_PERMS limitation and make it as arbitrary number of perms.
> 
> Signed-off-by: Chunyan Liu <cyliu@suse.com>
> 
> diff -r 8b93ac0c93f3 tools/xenstore/xenstore_client.c
> --- a/tools/xenstore/xenstore_client.c  Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/xenstore/xenstore_client.c  Thu Nov 15 16:33:32 2012 +0800
> @@ -25,7 +25,6 @@
>  #define PATH_SEP '/'
>  #define MAX_PATH_LEN 256
> 
> -#define MAX_PERMS 16
> 
>  enum mode {
>      MODE_unknown,
> @@ -416,31 +415,31 @@ perform(enum mode mode, int optind, int
>             break;
>          }
>          case MODE_chmod: {
> -            struct xs_permissions perms[MAX_PERMS];
> -            int nperms = 0;
> +            struct xs_permissions *perms;
>              /* save path pointer: */
>              char *path = argv[optind++];
> +            int nperms = argc - optind;
> +            int i;
> +            perms = (struct xs_permissions *)malloc(nperms *
> sizeof(struct xs_permissions));

You could just do:
		struct xs_permissions perms[nperms];
and let the compiler allocate enough space on the stack.

> +            if (!perms)
> +               err(1, NULL);
> -            for (; argv[optind]; optind++, nperms++)
> +            for (i = 0; argv[optind]; optind++, i++)
>              {
> -                if (MAX_PERMS <= nperms)
> -                    errx(1, "Too many permissions specified.  "
> -                        "Maximum per invocation is %d.", MAX_PERMS);
> -
> -                perms[nperms].id = atoi(argv[optind]+1);
> +                perms[i].id = atoi(argv[optind]+1);
> 
>                  switch (argv[optind][0])
>                  {
>                  case 'n':
> -                    perms[nperms].perms = XS_PERM_NONE;
> +                    perms[i].perms = XS_PERM_NONE;
>                      break;
>                  case 'r':
> -                    perms[nperms].perms = XS_PERM_READ;
> +                    perms[i].perms = XS_PERM_READ;
>                      break;
>                  case 'w':
> -                    perms[nperms].perms = XS_PERM_WRITE;
> +                    perms[i].perms = XS_PERM_WRITE;
>                      break;
>                  case 'b':
> -                    perms[nperms].perms = XS_PERM_READ | XS_PERM_WRITE;
> +                    perms[i].perms = XS_PERM_READ | XS_PERM_WRITE;
>                      break;
>                  default:
>                      errx(1, "Invalid permission specification: '%c'",
> @@ -449,6 +448,7 @@ perform(enum mode mode, int optind, int
>              }
> 
>              do_chmod(path, perms, nperms, upto, recurse, xsh, xth);
> +            free(perms);
>              break;
>          }
>          case MODE_watch: {
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:31:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:31:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPZU-00077H-9k; Mon, 19 Nov 2012 11:31:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaPZT-00077A-3z
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 11:31:23 +0000
Received: from [85.158.138.51:59412] by server-2.bemta-3.messagelabs.com id
	A2/AB-04744-A881AA05; Mon, 19 Nov 2012 11:31:22 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1353324678!30571338!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9059 invoked from network); 19 Nov 2012 11:31:19 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:31:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15876659"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 11:31:17 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 11:31:18 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TaPZN-0006MA-Kg; Mon, 19 Nov 2012 11:31:17 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TaPZN-0000hm-Fj;
	Mon, 19 Nov 2012 11:31:17 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20650.6277.378113.895594@mariner.uk.xensource.com>
Date: Mon, 19 Nov 2012 11:31:17 +0000
To: Ian Campbell <ian.campbell@citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <bb43f655bcc863d681fe.1351855138@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
	<bb43f655bcc863d681fe.1351855138@hastur.hellion.org.uk>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 4 of 5] docs:
	Document	HYPERVISOR_update_descriptor
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("[Xen-devel] [PATCH 4 of 5] docs: Document HYPERVISOR_update_descriptor"):
> docs: Document HYPERVISOR_update_descriptor

I have verified that this is a pure documentation patch, but not
checked it for accuracy.  That seems like the right level of review,
so:

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:31:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:31:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPZU-00077H-9k; Mon, 19 Nov 2012 11:31:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaPZT-00077A-3z
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 11:31:23 +0000
Received: from [85.158.138.51:59412] by server-2.bemta-3.messagelabs.com id
	A2/AB-04744-A881AA05; Mon, 19 Nov 2012 11:31:22 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1353324678!30571338!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9059 invoked from network); 19 Nov 2012 11:31:19 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:31:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15876659"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 11:31:17 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 11:31:18 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TaPZN-0006MA-Kg; Mon, 19 Nov 2012 11:31:17 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TaPZN-0000hm-Fj;
	Mon, 19 Nov 2012 11:31:17 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20650.6277.378113.895594@mariner.uk.xensource.com>
Date: Mon, 19 Nov 2012 11:31:17 +0000
To: Ian Campbell <ian.campbell@citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <bb43f655bcc863d681fe.1351855138@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
	<bb43f655bcc863d681fe.1351855138@hastur.hellion.org.uk>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 4 of 5] docs:
	Document	HYPERVISOR_update_descriptor
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("[Xen-devel] [PATCH 4 of 5] docs: Document HYPERVISOR_update_descriptor"):
> docs: Document HYPERVISOR_update_descriptor

I have verified that this is a pure documentation patch, but not
checked it for accuracy.  That seems like the right level of review,
so:

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:31:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:31:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPZj-00078B-MU; Mon, 19 Nov 2012 11:31:39 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaPZi-000782-Nf
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 11:31:38 +0000
Received: from [85.158.143.35:13064] by server-3.bemta-4.messagelabs.com id
	24/C3-06841-9981AA05; Mon, 19 Nov 2012 11:31:37 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1353324697!14509831!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22798 invoked from network); 19 Nov 2012 11:31:37 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:31:37 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15876668"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 11:31:37 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 11:31:37 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TaPZg-0006MI-Ue; Mon, 19 Nov 2012 11:31:36 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TaPZg-0000hu-Qa;
	Mon, 19 Nov 2012 11:31:36 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20650.6296.706126.167857@mariner.uk.xensource.com>
Date: Mon, 19 Nov 2012 11:31:36 +0000
To: Ian Campbell <ian.campbell@citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <afb8de49d9a8f91cf1b0.1351855139@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
	<afb8de49d9a8f91cf1b0.1351855139@hastur.hellion.org.uk>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 5 of 5] docs: Include prototype
	for	HYPERVISOR_multicall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("[Xen-devel] [PATCH 5 of 5] docs: Include prototype for HYPERVISOR_multicall"):
> docs: Include prototype for HYPERVISOR_multicall

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:31:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:31:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPZj-00078B-MU; Mon, 19 Nov 2012 11:31:39 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaPZi-000782-Nf
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 11:31:38 +0000
Received: from [85.158.143.35:13064] by server-3.bemta-4.messagelabs.com id
	24/C3-06841-9981AA05; Mon, 19 Nov 2012 11:31:37 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1353324697!14509831!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22798 invoked from network); 19 Nov 2012 11:31:37 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:31:37 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15876668"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 11:31:37 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 11:31:37 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TaPZg-0006MI-Ue; Mon, 19 Nov 2012 11:31:36 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TaPZg-0000hu-Qa;
	Mon, 19 Nov 2012 11:31:36 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20650.6296.706126.167857@mariner.uk.xensource.com>
Date: Mon, 19 Nov 2012 11:31:36 +0000
To: Ian Campbell <ian.campbell@citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <afb8de49d9a8f91cf1b0.1351855139@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
	<afb8de49d9a8f91cf1b0.1351855139@hastur.hellion.org.uk>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 5 of 5] docs: Include prototype
	for	HYPERVISOR_multicall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("[Xen-devel] [PATCH 5 of 5] docs: Include prototype for HYPERVISOR_multicall"):
> docs: Include prototype for HYPERVISOR_multicall

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:32:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:32:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPaU-0007Ee-9s; Mon, 19 Nov 2012 11:32:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaPaT-0007EJ-09
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 11:32:25 +0000
Received: from [193.109.254.147:48410] by server-4.bemta-14.messagelabs.com id
	13/8D-18856-8C81AA05; Mon, 19 Nov 2012 11:32:24 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353324711!8782567!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25726 invoked from network); 19 Nov 2012 11:31:52 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:31:52 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15876677"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 11:31:51 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 11:31:51 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TaPZv-0006MQ-2Q; Mon, 19 Nov 2012 11:31:51 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TaPZu-0000i0-Sy;
	Mon, 19 Nov 2012 11:31:50 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20650.6308.490159.369617@mariner.uk.xensource.com>
Date: Mon, 19 Nov 2012 11:31:48 +0000
To: Ian Campbell <ian.campbell@citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <1351861627.25014.50.camel@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
	<e8e1191aef208fbe2f4d.1351855135@hastur.hellion.org.uk>
	<5093AFA5.4000107@citrix.com>
	<1351861627.25014.50.camel@hastur.hellion.org.uk>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: David Vrabel <david.vrabel@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1 of 5] docs: document
 HYPERVISOR_update_va_mapping(_other_domain)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("Re: [Xen-devel] [PATCH 1 of 5] docs: document HYPERVISOR_update_va_mapping(_other_domain)"):
> docs: document HYPERVISOR_update_va_mapping(_other_domain)

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:32:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:32:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPaU-0007Ee-9s; Mon, 19 Nov 2012 11:32:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaPaT-0007EJ-09
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 11:32:25 +0000
Received: from [193.109.254.147:48410] by server-4.bemta-14.messagelabs.com id
	13/8D-18856-8C81AA05; Mon, 19 Nov 2012 11:32:24 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353324711!8782567!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25726 invoked from network); 19 Nov 2012 11:31:52 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:31:52 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15876677"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 11:31:51 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 11:31:51 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TaPZv-0006MQ-2Q; Mon, 19 Nov 2012 11:31:51 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TaPZu-0000i0-Sy;
	Mon, 19 Nov 2012 11:31:50 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20650.6308.490159.369617@mariner.uk.xensource.com>
Date: Mon, 19 Nov 2012 11:31:48 +0000
To: Ian Campbell <ian.campbell@citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <1351861627.25014.50.camel@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
	<e8e1191aef208fbe2f4d.1351855135@hastur.hellion.org.uk>
	<5093AFA5.4000107@citrix.com>
	<1351861627.25014.50.camel@hastur.hellion.org.uk>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: David Vrabel <david.vrabel@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1 of 5] docs: document
 HYPERVISOR_update_va_mapping(_other_domain)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("Re: [Xen-devel] [PATCH 1 of 5] docs: document HYPERVISOR_update_va_mapping(_other_domain)"):
> docs: document HYPERVISOR_update_va_mapping(_other_domain)

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:32:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:32:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPaX-0007FG-N9; Mon, 19 Nov 2012 11:32:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaPaW-0007Ex-9v
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 11:32:28 +0000
Received: from [193.109.254.147:10377] by server-15.bemta-14.messagelabs.com
	id 94/15-12105-BC81AA05; Mon, 19 Nov 2012 11:32:27 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353324711!8782567!2
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26176 invoked from network); 19 Nov 2012 11:31:58 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:31:58 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15876683"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 11:31:58 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 11:31:58 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TaPa2-0006MY-Ep; Mon, 19 Nov 2012 11:31:58 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TaPa2-0000i4-An;
	Mon, 19 Nov 2012 11:31:58 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20650.6318.218113.114410@mariner.uk.xensource.com>
Date: Mon, 19 Nov 2012 11:31:58 +0000
To: Ian Campbell <ian.campbell@citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <e6880358eba346c386b9.1351855136@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
	<e6880358eba346c386b9.1351855136@hastur.hellion.org.uk>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 2 of 5] docs: Document HYPERVISOR_mmuext_op
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("[Xen-devel] [PATCH 2 of 5] docs: Document HYPERVISOR_mmuext_op"):
> docs: Document HYPERVISOR_mmuext_op

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:32:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:32:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPaX-0007FG-N9; Mon, 19 Nov 2012 11:32:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaPaW-0007Ex-9v
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 11:32:28 +0000
Received: from [193.109.254.147:10377] by server-15.bemta-14.messagelabs.com
	id 94/15-12105-BC81AA05; Mon, 19 Nov 2012 11:32:27 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353324711!8782567!2
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26176 invoked from network); 19 Nov 2012 11:31:58 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:31:58 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15876683"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 11:31:58 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 11:31:58 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TaPa2-0006MY-Ep; Mon, 19 Nov 2012 11:31:58 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TaPa2-0000i4-An;
	Mon, 19 Nov 2012 11:31:58 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20650.6318.218113.114410@mariner.uk.xensource.com>
Date: Mon, 19 Nov 2012 11:31:58 +0000
To: Ian Campbell <ian.campbell@citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <e6880358eba346c386b9.1351855136@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
	<e6880358eba346c386b9.1351855136@hastur.hellion.org.uk>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 2 of 5] docs: Document HYPERVISOR_mmuext_op
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("[Xen-devel] [PATCH 2 of 5] docs: Document HYPERVISOR_mmuext_op"):
> docs: Document HYPERVISOR_mmuext_op

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:33:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPb7-0007NC-5j; Mon, 19 Nov 2012 11:33:05 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaPb5-0007Mn-4I
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 11:33:03 +0000
Received: from [193.109.254.147:18545] by server-10.bemta-14.messagelabs.com
	id D9/87-31741-EE81AA05; Mon, 19 Nov 2012 11:33:02 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353324711!8782567!3
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27378 invoked from network); 19 Nov 2012 11:32:05 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:32:05 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15876685"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 11:32:05 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 11:32:05 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TaPa9-0006Mc-DT; Mon, 19 Nov 2012 11:32:05 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TaPa9-0000iJ-9E;
	Mon, 19 Nov 2012 11:32:05 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20650.6325.174360.711841@mariner.uk.xensource.com>
Date: Mon, 19 Nov 2012 11:32:05 +0000
To: Ian Campbell <ian.campbell@citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <433d5d988e30e66a9c1f.1351855137@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
	<433d5d988e30e66a9c1f.1351855137@hastur.hellion.org.uk>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 3 of 5] docs: Add ToC entry for start of
	day	memory layout
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("[Xen-devel] [PATCH 3 of 5] docs: Add ToC entry for start of day memory layout"):
> docs: Add ToC entry for start of day memory layout.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:33:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPb7-0007NC-5j; Mon, 19 Nov 2012 11:33:05 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaPb5-0007Mn-4I
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 11:33:03 +0000
Received: from [193.109.254.147:18545] by server-10.bemta-14.messagelabs.com
	id D9/87-31741-EE81AA05; Mon, 19 Nov 2012 11:33:02 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353324711!8782567!3
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27378 invoked from network); 19 Nov 2012 11:32:05 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:32:05 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15876685"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 11:32:05 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 11:32:05 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TaPa9-0006Mc-DT; Mon, 19 Nov 2012 11:32:05 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TaPa9-0000iJ-9E;
	Mon, 19 Nov 2012 11:32:05 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20650.6325.174360.711841@mariner.uk.xensource.com>
Date: Mon, 19 Nov 2012 11:32:05 +0000
To: Ian Campbell <ian.campbell@citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <433d5d988e30e66a9c1f.1351855137@hastur.hellion.org.uk>
References: <patchbomb.1351855134@hastur.hellion.org.uk>
	<433d5d988e30e66a9c1f.1351855137@hastur.hellion.org.uk>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 3 of 5] docs: Add ToC entry for start of
	day	memory layout
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("[Xen-devel] [PATCH 3 of 5] docs: Add ToC entry for start of day memory layout"):
> docs: Add ToC entry for start of day memory layout.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:33:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPb8-0007Nc-JP; Mon, 19 Nov 2012 11:33:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <sachin.kamat@linaro.org>) id 1TaPWq-00074e-MD
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 11:28:40 +0000
Received: from [193.109.254.147:63499] by server-14.bemta-14.messagelabs.com
	id C5/C2-14517-8E71AA05; Mon, 19 Nov 2012 11:28:40 +0000
X-Env-Sender: sachin.kamat@linaro.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353324517!11490999!1
X-Originating-IP: [209.85.160.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19546 invoked from network); 19 Nov 2012 11:28:39 -0000
Received: from mail-pb0-f43.google.com (HELO mail-pb0-f43.google.com)
	(209.85.160.43)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:28:39 -0000
Received: by mail-pb0-f43.google.com with SMTP id wz17so3562339pbc.30
	for <xen-devel@lists.xensource.com>;
	Mon, 19 Nov 2012 03:28:37 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state;
	bh=jPbDzDZYESOtmCGDDtR/fyd25hNs8e/BJ9dynQH/ELo=;
	b=pFNWGk+GrR95LL8nIBX4OLhWFpjVDX3cK+DmDkI+kUt7hYkvbchhS8v0mP0XCI6Cxw
	e41FKikDWr/20ClNA3xd75xVVQ5MS9EcSVrIGURMWulZS2+wQmc3+t3I36Vx8ym8ANIV
	ndrHaotW1n1bewEhGyxrxAZfTHqn0M9Kj5of0ALJReyOFMD1eAfM8MRlGu306NbV/nM7
	+XuD9ztjpluyf7B8rVmMbFhgFmYDfqk+qTOaMX7NxcSU9Xa4Utqj3Fk6CPkHkJOwskfK
	yNSI36njJGK6aNNVTixYz9nyjILHur9ktXUfBKIdm6XVCVgYuXI0JnXcb5tmB1GO3JSN
	ukUQ==
Received: by 10.66.77.39 with SMTP id p7mr34982501paw.8.1353324517208;
	Mon, 19 Nov 2012 03:28:37 -0800 (PST)
Received: from localhost.localdomain ([115.113.119.130])
	by mx.google.com with ESMTPS id mz10sm6087745pbc.37.2012.11.19.03.28.34
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 19 Nov 2012 03:28:36 -0800 (PST)
From: Sachin Kamat <sachin.kamat@linaro.org>
To: xen-devel@lists.xensource.com,
	virtualization@lists.linux-foundation.org
Date: Mon, 19 Nov 2012 16:52:30 +0530
Message-Id: <1353324150-21785-1-git-send-email-sachin.kamat@linaro.org>
X-Mailer: git-send-email 1.7.4.1
X-Gm-Message-State: ALoCoQlKxCpgdixz64BDPa5Lcny+bDE2SKvEzH44IPf5KhwZ+psuX4L7/mqC/A4CMNLjxWvL1spV
X-Mailman-Approved-At: Mon, 19 Nov 2012 11:33:05 +0000
Cc: sachin.kamat@linaro.org, patches@linaro.org, konrad.wilk@oracle.com
Subject: [Xen-devel] [PATCH 1/1] xen/xenbus: Remove duplicate inclusion of
	asm/xen/hypervisor.h
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

asm/xen/hypervisor.h was included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/xen/xenbus/xenbus_xs.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
index acedeab..88e677b 100644
--- a/drivers/xen/xenbus/xenbus_xs.c
+++ b/drivers/xen/xenbus/xenbus_xs.c
@@ -48,7 +48,6 @@
 #include <xen/xenbus.h>
 #include <xen/xen.h>
 #include "xenbus_comms.h"
-#include <asm/xen/hypervisor.h>
 
 struct xs_stored_msg {
 	struct list_head list;
-- 
1.7.4.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:33:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPb8-0007Nc-JP; Mon, 19 Nov 2012 11:33:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <sachin.kamat@linaro.org>) id 1TaPWq-00074e-MD
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 11:28:40 +0000
Received: from [193.109.254.147:63499] by server-14.bemta-14.messagelabs.com
	id C5/C2-14517-8E71AA05; Mon, 19 Nov 2012 11:28:40 +0000
X-Env-Sender: sachin.kamat@linaro.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353324517!11490999!1
X-Originating-IP: [209.85.160.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19546 invoked from network); 19 Nov 2012 11:28:39 -0000
Received: from mail-pb0-f43.google.com (HELO mail-pb0-f43.google.com)
	(209.85.160.43)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:28:39 -0000
Received: by mail-pb0-f43.google.com with SMTP id wz17so3562339pbc.30
	for <xen-devel@lists.xensource.com>;
	Mon, 19 Nov 2012 03:28:37 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state;
	bh=jPbDzDZYESOtmCGDDtR/fyd25hNs8e/BJ9dynQH/ELo=;
	b=pFNWGk+GrR95LL8nIBX4OLhWFpjVDX3cK+DmDkI+kUt7hYkvbchhS8v0mP0XCI6Cxw
	e41FKikDWr/20ClNA3xd75xVVQ5MS9EcSVrIGURMWulZS2+wQmc3+t3I36Vx8ym8ANIV
	ndrHaotW1n1bewEhGyxrxAZfTHqn0M9Kj5of0ALJReyOFMD1eAfM8MRlGu306NbV/nM7
	+XuD9ztjpluyf7B8rVmMbFhgFmYDfqk+qTOaMX7NxcSU9Xa4Utqj3Fk6CPkHkJOwskfK
	yNSI36njJGK6aNNVTixYz9nyjILHur9ktXUfBKIdm6XVCVgYuXI0JnXcb5tmB1GO3JSN
	ukUQ==
Received: by 10.66.77.39 with SMTP id p7mr34982501paw.8.1353324517208;
	Mon, 19 Nov 2012 03:28:37 -0800 (PST)
Received: from localhost.localdomain ([115.113.119.130])
	by mx.google.com with ESMTPS id mz10sm6087745pbc.37.2012.11.19.03.28.34
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 19 Nov 2012 03:28:36 -0800 (PST)
From: Sachin Kamat <sachin.kamat@linaro.org>
To: xen-devel@lists.xensource.com,
	virtualization@lists.linux-foundation.org
Date: Mon, 19 Nov 2012 16:52:30 +0530
Message-Id: <1353324150-21785-1-git-send-email-sachin.kamat@linaro.org>
X-Mailer: git-send-email 1.7.4.1
X-Gm-Message-State: ALoCoQlKxCpgdixz64BDPa5Lcny+bDE2SKvEzH44IPf5KhwZ+psuX4L7/mqC/A4CMNLjxWvL1spV
X-Mailman-Approved-At: Mon, 19 Nov 2012 11:33:05 +0000
Cc: sachin.kamat@linaro.org, patches@linaro.org, konrad.wilk@oracle.com
Subject: [Xen-devel] [PATCH 1/1] xen/xenbus: Remove duplicate inclusion of
	asm/xen/hypervisor.h
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

asm/xen/hypervisor.h was included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/xen/xenbus/xenbus_xs.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
index acedeab..88e677b 100644
--- a/drivers/xen/xenbus/xenbus_xs.c
+++ b/drivers/xen/xenbus/xenbus_xs.c
@@ -48,7 +48,6 @@
 #include <xen/xenbus.h>
 #include <xen/xen.h>
 #include "xenbus_comms.h"
-#include <asm/xen/hypervisor.h>
 
 struct xs_stored_msg {
 	struct list_head list;
-- 
1.7.4.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:36:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:36:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPeh-0007t9-8r; Mon, 19 Nov 2012 11:36:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaPef-0007sr-NQ
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 11:36:45 +0000
Received: from [85.158.143.99:8661] by server-3.bemta-4.messagelabs.com id
	F8/FC-06841-DC91AA05; Mon, 19 Nov 2012 11:36:45 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1353325004!21357800!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22780 invoked from network); 19 Nov 2012 11:36:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:36:44 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15876798"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 11:36:44 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 11:36:44 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TaPee-0006O6-53; Mon, 19 Nov 2012 11:36:44 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TaPee-0000ia-0S;
	Mon, 19 Nov 2012 11:36:44 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20650.6603.914330.994040@mariner.uk.xensource.com>
Date: Mon, 19 Nov 2012 11:36:43 +0000
To: Ian Campbell <ian.campbell@citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <1348487103-2113-1-git-send-email-ian.campbell@citrix.com>
References: <1348487103-2113-1-git-send-email-ian.campbell@citrix.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [DOCDAY PATCH V2] docs: document/mark-up SCHEDOP_*
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("[Xen-devel] [DOCDAY PATCH V2] docs: document/mark-up SCHEDOP_*"):
> The biggest subtlety here is there additional argument when op ==
> SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
> xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
> 
> This patch moves some structs around but there is no functional change
> other than improved documentation.

I have verified that this is a pure documentation patch, but not
checked it for accuracy.  That seems like the right level of review,
so:

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:36:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:36:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPeh-0007t9-8r; Mon, 19 Nov 2012 11:36:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaPef-0007sr-NQ
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 11:36:45 +0000
Received: from [85.158.143.99:8661] by server-3.bemta-4.messagelabs.com id
	F8/FC-06841-DC91AA05; Mon, 19 Nov 2012 11:36:45 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1353325004!21357800!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22780 invoked from network); 19 Nov 2012 11:36:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:36:44 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15876798"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 11:36:44 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 11:36:44 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TaPee-0006O6-53; Mon, 19 Nov 2012 11:36:44 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TaPee-0000ia-0S;
	Mon, 19 Nov 2012 11:36:44 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20650.6603.914330.994040@mariner.uk.xensource.com>
Date: Mon, 19 Nov 2012 11:36:43 +0000
To: Ian Campbell <ian.campbell@citrix.com>
Newsgroups: chiark.mail.xen.devel
In-Reply-To: <1348487103-2113-1-git-send-email-ian.campbell@citrix.com>
References: <1348487103-2113-1-git-send-email-ian.campbell@citrix.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [DOCDAY PATCH V2] docs: document/mark-up SCHEDOP_*
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("[Xen-devel] [DOCDAY PATCH V2] docs: document/mark-up SCHEDOP_*"):
> The biggest subtlety here is there additional argument when op ==
> SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
> xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
> 
> This patch moves some structs around but there is no functional change
> other than improved documentation.

I have verified that this is a pure documentation patch, but not
checked it for accuracy.  That seems like the right level of review,
so:

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:37:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:37:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPfI-0007yc-O7; Mon, 19 Nov 2012 11:37:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaPfG-0007yF-R1
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 11:37:23 +0000
Received: from [85.158.138.51:43208] by server-13.bemta-3.messagelabs.com id
	36/7F-24887-2F91AA05; Mon, 19 Nov 2012 11:37:22 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1353325040!24234048!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18392 invoked from network); 19 Nov 2012 11:37:21 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:37:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15876809"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 11:37:20 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 11:37:20 +0000
Message-ID: <1353325039.18229.49.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: ZhouPeng <zpengxen@gmail.com>
Date: Mon, 19 Nov 2012 11:37:19 +0000
In-Reply-To: <CAAh7U5PjF7c3mg3C7WZ2uphZaYLRTzwphiobDG+t-2Q-BpnTKQ@mail.gmail.com>
References: <CAAh7U5MHRnwwK-X==Hh7F2uy94i4yYU3oFFQEesowUtPQGf6Eg@mail.gmail.com>
	<1338987918.32319.84.camel@zakaz.uk.xensource.com>
	<CAAh7U5PYuJJcrAVCzVPLR0vZ1PLpS5mNqsrBmToTsm2KW46_wQ@mail.gmail.com>
	<1339049291.6557.11.camel@dagon.hellion.org.uk>
	<CAAh7U5O2FCeT7Mzp5KNkxqcX5B037YUmqef=TJTrQ9b=JgsHZA@mail.gmail.com>
	<1341325462.21547.20.camel@zakaz.uk.xensource.com>
	<CAFLBxZZfh0eXszeVvZ6WYDuGV6cDcvcgpOByf8FWz9EOvOUorQ@mail.gmail.com>
	<CAAh7U5PBASWB6Y6P-Sz3yg2Z1xv-JYAMtFSYGWe=3oov3h32dQ@mail.gmail.com>
	<CAAh7U5MMmAz047KzHVMRkUF=hGZKGfDfM1KM41jF8g6bZAXq7g@mail.gmail.com>
	<508559E8.10102@eu.citrix.com>
	<CAAh7U5PjF7c3mg3C7WZ2uphZaYLRTzwphiobDG+t-2Q-BpnTKQ@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"Xen-Devel \(E-mail\)" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 2/3] tools:libxl: Add qxl vga interface
 support v2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-10-24 at 09:06 +0100, ZhouPeng wrote:

> >> +For B<qxl> option, the default is 128MB. If B<videoram> is set greater
> >> +than 128MB, it will be trimmed to 128MB; if set less than 128MB, an
> >> +error will be triggered.
> >
> >
> > Is this a fixed value in qemu, or is this something that can be changed via
> > the command-line?
> Can be changed.
> 
> But Ian Campbell and me have talked on sth related with this
> closely before. And we both agree to just support the default is
> enough in most time. You can get it from the url below quickly, pls
> read from bottom up, which can save time.
> 
> http://lists.xen.org/archives/html/xen-devel/2012-07/msg00098.html

We discussed what to do if the supplied value was too small but I don't
recall this behaviour of clamping a value which is larger to a specific
value.

If we reject values which are <128M, and clamp anything which is >128M
to 128M then what is the point of the option?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:37:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:37:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPfI-0007yc-O7; Mon, 19 Nov 2012 11:37:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaPfG-0007yF-R1
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 11:37:23 +0000
Received: from [85.158.138.51:43208] by server-13.bemta-3.messagelabs.com id
	36/7F-24887-2F91AA05; Mon, 19 Nov 2012 11:37:22 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1353325040!24234048!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18392 invoked from network); 19 Nov 2012 11:37:21 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:37:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15876809"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 11:37:20 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 11:37:20 +0000
Message-ID: <1353325039.18229.49.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: ZhouPeng <zpengxen@gmail.com>
Date: Mon, 19 Nov 2012 11:37:19 +0000
In-Reply-To: <CAAh7U5PjF7c3mg3C7WZ2uphZaYLRTzwphiobDG+t-2Q-BpnTKQ@mail.gmail.com>
References: <CAAh7U5MHRnwwK-X==Hh7F2uy94i4yYU3oFFQEesowUtPQGf6Eg@mail.gmail.com>
	<1338987918.32319.84.camel@zakaz.uk.xensource.com>
	<CAAh7U5PYuJJcrAVCzVPLR0vZ1PLpS5mNqsrBmToTsm2KW46_wQ@mail.gmail.com>
	<1339049291.6557.11.camel@dagon.hellion.org.uk>
	<CAAh7U5O2FCeT7Mzp5KNkxqcX5B037YUmqef=TJTrQ9b=JgsHZA@mail.gmail.com>
	<1341325462.21547.20.camel@zakaz.uk.xensource.com>
	<CAFLBxZZfh0eXszeVvZ6WYDuGV6cDcvcgpOByf8FWz9EOvOUorQ@mail.gmail.com>
	<CAAh7U5PBASWB6Y6P-Sz3yg2Z1xv-JYAMtFSYGWe=3oov3h32dQ@mail.gmail.com>
	<CAAh7U5MMmAz047KzHVMRkUF=hGZKGfDfM1KM41jF8g6bZAXq7g@mail.gmail.com>
	<508559E8.10102@eu.citrix.com>
	<CAAh7U5PjF7c3mg3C7WZ2uphZaYLRTzwphiobDG+t-2Q-BpnTKQ@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"Xen-Devel \(E-mail\)" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 2/3] tools:libxl: Add qxl vga interface
 support v2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-10-24 at 09:06 +0100, ZhouPeng wrote:

> >> +For B<qxl> option, the default is 128MB. If B<videoram> is set greater
> >> +than 128MB, it will be trimmed to 128MB; if set less than 128MB, an
> >> +error will be triggered.
> >
> >
> > Is this a fixed value in qemu, or is this something that can be changed via
> > the command-line?
> Can be changed.
> 
> But Ian Campbell and me have talked on sth related with this
> closely before. And we both agree to just support the default is
> enough in most time. You can get it from the url below quickly, pls
> read from bottom up, which can save time.
> 
> http://lists.xen.org/archives/html/xen-devel/2012-07/msg00098.html

We discussed what to do if the supplied value was too small but I don't
recall this behaviour of clamping a value which is larger to a specific
value.

If we reject values which are <128M, and clamp anything which is >128M
to 128M then what is the point of the option?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:52:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:52:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPta-0008Hp-7E; Mon, 19 Nov 2012 11:52:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TaPtX-0008Hk-Ta
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 11:52:08 +0000
Received: from [85.158.139.211:15340] by server-2.bemta-5.messagelabs.com id
	B4/32-04892-76D1AA05; Mon, 19 Nov 2012 11:52:07 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1353325924!20743285!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcyNzU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19166 invoked from network); 19 Nov 2012 11:52:05 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:52:05 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="214909288"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	19 Nov 2012 11:52:04 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.318.1;
	Mon, 19 Nov 2012 06:52:04 -0500
Message-ID: <50AA1D62.6090209@citrix.com>
Date: Mon, 19 Nov 2012 11:52:02 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Mats Petersson <mats.petersson@citrix.com>
References: <mailman.16724.1353079390.1399.xen-devel@lists.xen.org>
	<1353091009-10564-1-git-send-email-mats.petersson@citrix.com>
In-Reply-To: <1353091009-10564-1-git-send-email-mats.petersson@citrix.com>
X-Originating-IP: [10.80.2.76]
Cc: konrad.r.wilk@gmail.com, konrad.wilk@oracle.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH V3] Correctly return success
	from	IOCTL_PRIVCMD_MMAPBATCH
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 18:36, Mats Petersson wrote:
> This is a regression introduced by ceb90fa0 (xen/privcmd: add
> PRIVCMD_MMAPBATCH_V2 ioctl).  It broke xentrace as it used
> xc_map_foreign() instead of xc_map_foreign_bulk().

Konrad,

This is a regression introduced in 3.7-rc1.  Can you pick this one up
for 3.7?  Thanks.

David

> 
> Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
> that it broke. The return value is set early on to -EINVAL, and if all
> goes well, the "set top bits of the MFN's" never gets called, so the
> return value is still EINVAL when the function gets to the end, causing
> the caller to think it went wrong (which it didn't!)
> 
> Now also including Andres "move the ret = -EINVAL into the error handling 
> path, as this avoids other similar errors in future.
> 
> Signed off by: Mats Petersson <mats.petersson@citrix.com>
> Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
> Acked-by: David Vrabel <david.vrabel@citrix.com>
> ---
>  drivers/xen/privcmd.c |   18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
> index 8adb9cc..71f5c45 100644
> --- a/drivers/xen/privcmd.c
> +++ b/drivers/xen/privcmd.c
> @@ -361,13 +361,13 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
>  	down_write(&mm->mmap_sem);
>  
>  	vma = find_vma(mm, m.addr);
> -	ret = -EINVAL;
>  	if (!vma ||
>  	    vma->vm_ops != &privcmd_vm_ops ||
>  	    (m.addr != vma->vm_start) ||
>  	    ((m.addr + (nr_pages << PAGE_SHIFT)) != vma->vm_end) ||
>  	    !privcmd_enforce_singleshot_mapping(vma)) {
>  		up_write(&mm->mmap_sem);
> +		ret = -EINVAL;
>  		goto out;
>  	}
>  
> @@ -383,12 +383,16 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
>  
>  	up_write(&mm->mmap_sem);
>  
> -	if (state.global_error && (version == 1)) {
> -		/* Write back errors in second pass. */
> -		state.user_mfn = (xen_pfn_t *)m.arr;
> -		state.err      = err_array;
> -		ret = traverse_pages(m.num, sizeof(xen_pfn_t),
> -				     &pagelist, mmap_return_errors_v1, &state);
> +	if (version == 1) {
> +		if (state.global_error) {
> +			/* Write back errors in second pass. */
> +			state.user_mfn = (xen_pfn_t *)m.arr;
> +			state.err      = err_array;
> +			ret = traverse_pages(m.num, sizeof(xen_pfn_t),
> +					     &pagelist, mmap_return_errors_v1, &state);
> +		} else
> +			ret = 0;
> +
>  	} else if (version == 2) {
>  		ret = __copy_to_user(m.err, err_array, m.num * sizeof(int));
>  		if (ret)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 11:52:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 11:52:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaPta-0008Hp-7E; Mon, 19 Nov 2012 11:52:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TaPtX-0008Hk-Ta
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 11:52:08 +0000
Received: from [85.158.139.211:15340] by server-2.bemta-5.messagelabs.com id
	B4/32-04892-76D1AA05; Mon, 19 Nov 2012 11:52:07 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1353325924!20743285!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcyNzU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19166 invoked from network); 19 Nov 2012 11:52:05 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 11:52:05 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="214909288"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	19 Nov 2012 11:52:04 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.318.1;
	Mon, 19 Nov 2012 06:52:04 -0500
Message-ID: <50AA1D62.6090209@citrix.com>
Date: Mon, 19 Nov 2012 11:52:02 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Mats Petersson <mats.petersson@citrix.com>
References: <mailman.16724.1353079390.1399.xen-devel@lists.xen.org>
	<1353091009-10564-1-git-send-email-mats.petersson@citrix.com>
In-Reply-To: <1353091009-10564-1-git-send-email-mats.petersson@citrix.com>
X-Originating-IP: [10.80.2.76]
Cc: konrad.r.wilk@gmail.com, konrad.wilk@oracle.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH V3] Correctly return success
	from	IOCTL_PRIVCMD_MMAPBATCH
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 16/11/12 18:36, Mats Petersson wrote:
> This is a regression introduced by ceb90fa0 (xen/privcmd: add
> PRIVCMD_MMAPBATCH_V2 ioctl).  It broke xentrace as it used
> xc_map_foreign() instead of xc_map_foreign_bulk().

Konrad,

This is a regression introduced in 3.7-rc1.  Can you pick this one up
for 3.7?  Thanks.

David

> 
> Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
> that it broke. The return value is set early on to -EINVAL, and if all
> goes well, the "set top bits of the MFN's" never gets called, so the
> return value is still EINVAL when the function gets to the end, causing
> the caller to think it went wrong (which it didn't!)
> 
> Now also including Andres "move the ret = -EINVAL into the error handling 
> path, as this avoids other similar errors in future.
> 
> Signed off by: Mats Petersson <mats.petersson@citrix.com>
> Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
> Acked-by: David Vrabel <david.vrabel@citrix.com>
> ---
>  drivers/xen/privcmd.c |   18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
> index 8adb9cc..71f5c45 100644
> --- a/drivers/xen/privcmd.c
> +++ b/drivers/xen/privcmd.c
> @@ -361,13 +361,13 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
>  	down_write(&mm->mmap_sem);
>  
>  	vma = find_vma(mm, m.addr);
> -	ret = -EINVAL;
>  	if (!vma ||
>  	    vma->vm_ops != &privcmd_vm_ops ||
>  	    (m.addr != vma->vm_start) ||
>  	    ((m.addr + (nr_pages << PAGE_SHIFT)) != vma->vm_end) ||
>  	    !privcmd_enforce_singleshot_mapping(vma)) {
>  		up_write(&mm->mmap_sem);
> +		ret = -EINVAL;
>  		goto out;
>  	}
>  
> @@ -383,12 +383,16 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
>  
>  	up_write(&mm->mmap_sem);
>  
> -	if (state.global_error && (version == 1)) {
> -		/* Write back errors in second pass. */
> -		state.user_mfn = (xen_pfn_t *)m.arr;
> -		state.err      = err_array;
> -		ret = traverse_pages(m.num, sizeof(xen_pfn_t),
> -				     &pagelist, mmap_return_errors_v1, &state);
> +	if (version == 1) {
> +		if (state.global_error) {
> +			/* Write back errors in second pass. */
> +			state.user_mfn = (xen_pfn_t *)m.arr;
> +			state.err      = err_array;
> +			ret = traverse_pages(m.num, sizeof(xen_pfn_t),
> +					     &pagelist, mmap_return_errors_v1, &state);
> +		} else
> +			ret = 0;
> +
>  	} else if (version == 2) {
>  		ret = __copy_to_user(m.err, err_array, m.num * sizeof(int));
>  		if (ret)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 12:27:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 12:27:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaQRS-0000JE-BZ; Mon, 19 Nov 2012 12:27:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaQRQ-0000J9-7y
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 12:27:08 +0000
Received: from [85.158.137.99:9126] by server-11.bemta-3.messagelabs.com id
	20/7A-19361-B952AA05; Mon, 19 Nov 2012 12:27:07 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1353328026!18003786!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17988 invoked from network); 19 Nov 2012 12:27:06 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 12:27:06 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15878097"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 12:27:05 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 12:27:05 +0000
Message-ID: <1353328024.18229.72.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Mon, 19 Nov 2012 12:27:04 +0000
In-Reply-To: <1352992629-5850-4-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352992629-5850-4-git-send-email-matthew.fioravante@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 03/10] Remove old vtpm support from
	xm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 15:17 +0000, Matthew Fioravante wrote:
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> ---
>  docs/man/xm.pod.1                           |   11 ---
>  tools/python/README.XendConfig              |    2 -
>  tools/python/README.sxpcfg                  |    4 -
>  tools/python/scripts/xapi.py                |   20 ----
>  tools/python/xen/xend/XendAPI.py            |  128 ------------------------
>  tools/python/xen/xend/XendConfig.py         |   19 +---
>  tools/python/xen/xend/XendConstants.py      |    8 +-
>  tools/python/xen/xend/XendDevices.py        |    4 +-
>  tools/python/xen/xend/XendDomainInfo.py     |   29 ------
>  tools/python/xen/xend/XendError.py          |    1 -
>  tools/python/xen/xend/XendOptions.py        |    4 -
>  tools/python/xen/xend/server/tpmif.py       |  141 ---------------------------
>  tools/python/xen/xend/tests/xend-config.sxp |    2 -
>  tools/python/xen/xm/create.dtd              |    4 -
>  tools/python/xen/xm/create.py               |   69 -------------
>  tools/python/xen/xm/main.py                 |   37 -------
>  tools/python/xen/xm/xenapi_create.py        |   39 --------
>  17 files changed, 4 insertions(+), 518 deletions(-)
>  delete mode 100644 tools/python/xen/xend/server/tpmif.py

I know I guided you down this path in the first place but I'm starting
to wonder if removing the process model is/was the right thing to do for
xend. It's one thing for xend to be deprecated and unmaintained, but
actively removing features is a bit more than that.

Looking back at 26144:170d45f7a2eb I see in the commit message:
        Remove the old vtpm process model. It doesn't work very well and
        is no longer supported.

Also looking back in the previous mail threads I see:
        The vtpm_manager code is full of bugs and actually needs a
        complete rewrite. The amount of careless memory leaks and other
        bugs I found when trying to use it were pretty astounding. The
        first manager patch fixes most of the ones I could find to get
        the manager to work properly.
        
        The managers current form in the xen tree is actually pretty
        unusable. I don't have time to rewrite the manager, but what I'm
        offering here is at least a huge improvement over the old code.
        
and also:
        I don't know if there is anyone who would want to still use
        vtpms as
        processes when the stub domains are now available. Security
        research
        people like the domain model because it guarantees a better
        separation of components guaranteed by the hypervisor and
        doesn't have to trust the dom0 OS.

Which suggests that the number of people using the process model stuff
with xend is likely to be indistinguishable from zero. Do you have any
idea if there is anyone actually using it?

In any case it does seem like anyone who is using the vtpm with xend is
playing with fire since it is unmaintained and full of bugs, which isn't
a good thing in a component which is supposed to be *increasing*
security.

Daniel/Pasi, I've CCd you since I thought you might have some insights
into how much use the process model vtpm stuff in xend is getting in the
field etc.

BTW I'm not suggesting that we (or you) maintain or even update the
process model stuff or xm/xend, just that we leave it as it was (i.e. in
a poor state + lagging behind the libxl based stubdom stuff) until xend
fully goes away.

Anyhow, since we need to revert 26144:170d45f7a2eb if we decide to go
back on this decision I'm going to apply this anyway, what's one more
revert ;-). Same applies to a bunch of the following patches which build
on this removal.

Ian


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 12:27:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 12:27:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaQRS-0000JE-BZ; Mon, 19 Nov 2012 12:27:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaQRQ-0000J9-7y
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 12:27:08 +0000
Received: from [85.158.137.99:9126] by server-11.bemta-3.messagelabs.com id
	20/7A-19361-B952AA05; Mon, 19 Nov 2012 12:27:07 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1353328026!18003786!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17988 invoked from network); 19 Nov 2012 12:27:06 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 12:27:06 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15878097"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 12:27:05 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 12:27:05 +0000
Message-ID: <1353328024.18229.72.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Mon, 19 Nov 2012 12:27:04 +0000
In-Reply-To: <1352992629-5850-4-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352992629-5850-4-git-send-email-matthew.fioravante@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 03/10] Remove old vtpm support from
	xm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 15:17 +0000, Matthew Fioravante wrote:
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> ---
>  docs/man/xm.pod.1                           |   11 ---
>  tools/python/README.XendConfig              |    2 -
>  tools/python/README.sxpcfg                  |    4 -
>  tools/python/scripts/xapi.py                |   20 ----
>  tools/python/xen/xend/XendAPI.py            |  128 ------------------------
>  tools/python/xen/xend/XendConfig.py         |   19 +---
>  tools/python/xen/xend/XendConstants.py      |    8 +-
>  tools/python/xen/xend/XendDevices.py        |    4 +-
>  tools/python/xen/xend/XendDomainInfo.py     |   29 ------
>  tools/python/xen/xend/XendError.py          |    1 -
>  tools/python/xen/xend/XendOptions.py        |    4 -
>  tools/python/xen/xend/server/tpmif.py       |  141 ---------------------------
>  tools/python/xen/xend/tests/xend-config.sxp |    2 -
>  tools/python/xen/xm/create.dtd              |    4 -
>  tools/python/xen/xm/create.py               |   69 -------------
>  tools/python/xen/xm/main.py                 |   37 -------
>  tools/python/xen/xm/xenapi_create.py        |   39 --------
>  17 files changed, 4 insertions(+), 518 deletions(-)
>  delete mode 100644 tools/python/xen/xend/server/tpmif.py

I know I guided you down this path in the first place but I'm starting
to wonder if removing the process model is/was the right thing to do for
xend. It's one thing for xend to be deprecated and unmaintained, but
actively removing features is a bit more than that.

Looking back at 26144:170d45f7a2eb I see in the commit message:
        Remove the old vtpm process model. It doesn't work very well and
        is no longer supported.

Also looking back in the previous mail threads I see:
        The vtpm_manager code is full of bugs and actually needs a
        complete rewrite. The amount of careless memory leaks and other
        bugs I found when trying to use it were pretty astounding. The
        first manager patch fixes most of the ones I could find to get
        the manager to work properly.
        
        The managers current form in the xen tree is actually pretty
        unusable. I don't have time to rewrite the manager, but what I'm
        offering here is at least a huge improvement over the old code.
        
and also:
        I don't know if there is anyone who would want to still use
        vtpms as
        processes when the stub domains are now available. Security
        research
        people like the domain model because it guarantees a better
        separation of components guaranteed by the hypervisor and
        doesn't have to trust the dom0 OS.

Which suggests that the number of people using the process model stuff
with xend is likely to be indistinguishable from zero. Do you have any
idea if there is anyone actually using it?

In any case it does seem like anyone who is using the vtpm with xend is
playing with fire since it is unmaintained and full of bugs, which isn't
a good thing in a component which is supposed to be *increasing*
security.

Daniel/Pasi, I've CCd you since I thought you might have some insights
into how much use the process model vtpm stuff in xend is getting in the
field etc.

BTW I'm not suggesting that we (or you) maintain or even update the
process model stuff or xm/xend, just that we leave it as it was (i.e. in
a poor state + lagging behind the libxl based stubdom stuff) until xend
fully goes away.

Anyhow, since we need to revert 26144:170d45f7a2eb if we decide to go
back on this decision I'm going to apply this anyway, what's one more
revert ;-). Same applies to a bunch of the following patches which build
on this removal.

Ian


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 12:50:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 12:50:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaQnz-0000ZV-Iz; Mon, 19 Nov 2012 12:50:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TaQny-0000ZO-Bv
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 12:50:26 +0000
Received: from [85.158.143.35:50896] by server-1.bemta-4.messagelabs.com id
	C0/9F-27934-11B2AA05; Mon, 19 Nov 2012 12:50:25 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-15.tower-21.messagelabs.com!1353329358!14523580!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDM0ODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 359 invoked from network); 19 Nov 2012 12:49:19 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-15.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 12:49:19 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 2D8B027EC;
	Mon, 19 Nov 2012 14:49:16 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 0DE9BEC027; Mon, 19 Nov 2012 14:49:16 +0200 (EET)
Date: Mon, 19 Nov 2012 14:49:15 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121119124915.GS8912@reaktio.net>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352992629-5850-4-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353328024.18229.72.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353328024.18229.72.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 03/10] Remove old vtpm support from
	xm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 19, 2012 at 12:27:04PM +0000, Ian Campbell wrote:
> On Thu, 2012-11-15 at 15:17 +0000, Matthew Fioravante wrote:
> > Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> > ---
> >  docs/man/xm.pod.1                           |   11 ---
> >  tools/python/README.XendConfig              |    2 -
> >  tools/python/README.sxpcfg                  |    4 -
> >  tools/python/scripts/xapi.py                |   20 ----
> >  tools/python/xen/xend/XendAPI.py            |  128 ------------------------
> >  tools/python/xen/xend/XendConfig.py         |   19 +---
> >  tools/python/xen/xend/XendConstants.py      |    8 +-
> >  tools/python/xen/xend/XendDevices.py        |    4 +-
> >  tools/python/xen/xend/XendDomainInfo.py     |   29 ------
> >  tools/python/xen/xend/XendError.py          |    1 -
> >  tools/python/xen/xend/XendOptions.py        |    4 -
> >  tools/python/xen/xend/server/tpmif.py       |  141 ---------------------------
> >  tools/python/xen/xend/tests/xend-config.sxp |    2 -
> >  tools/python/xen/xm/create.dtd              |    4 -
> >  tools/python/xen/xm/create.py               |   69 -------------
> >  tools/python/xen/xm/main.py                 |   37 -------
> >  tools/python/xen/xm/xenapi_create.py        |   39 --------
> >  17 files changed, 4 insertions(+), 518 deletions(-)
> >  delete mode 100644 tools/python/xen/xend/server/tpmif.py
> 
> I know I guided you down this path in the first place but I'm starting
> to wonder if removing the process model is/was the right thing to do for
> xend. It's one thing for xend to be deprecated and unmaintained, but
> actively removing features is a bit more than that.
> 
> Looking back at 26144:170d45f7a2eb I see in the commit message:
>         Remove the old vtpm process model. It doesn't work very well and
>         is no longer supported.
> 
> Also looking back in the previous mail threads I see:
>         The vtpm_manager code is full of bugs and actually needs a
>         complete rewrite. The amount of careless memory leaks and other
>         bugs I found when trying to use it were pretty astounding. The
>         first manager patch fixes most of the ones I could find to get
>         the manager to work properly.
>         
>         The managers current form in the xen tree is actually pretty
>         unusable. I don't have time to rewrite the manager, but what I'm
>         offering here is at least a huge improvement over the old code.
>         
> and also:
>         I don't know if there is anyone who would want to still use
>         vtpms as
>         processes when the stub domains are now available. Security
>         research
>         people like the domain model because it guarantees a better
>         separation of components guaranteed by the hypervisor and
>         doesn't have to trust the dom0 OS.
> 
> Which suggests that the number of people using the process model stuff
> with xend is likely to be indistinguishable from zero. Do you have any
> idea if there is anyone actually using it?
> 
> In any case it does seem like anyone who is using the vtpm with xend is
> playing with fire since it is unmaintained and full of bugs, which isn't
> a good thing in a component which is supposed to be *increasing*
> security.
> 
> Daniel/Pasi, I've CCd you since I thought you might have some insights
> into how much use the process model vtpm stuff in xend is getting in the
> field etc.
> 

Hmm.. I can only remember one or two people asking for vtpm stuff during past couple of years.
So based on that I don't think it's actively used out there..

Or then it works very well and people don't need to ask about it ;)

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 12:50:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 12:50:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaQnz-0000ZV-Iz; Mon, 19 Nov 2012 12:50:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TaQny-0000ZO-Bv
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 12:50:26 +0000
Received: from [85.158.143.35:50896] by server-1.bemta-4.messagelabs.com id
	C0/9F-27934-11B2AA05; Mon, 19 Nov 2012 12:50:25 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-15.tower-21.messagelabs.com!1353329358!14523580!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDM0ODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 359 invoked from network); 19 Nov 2012 12:49:19 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-15.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 12:49:19 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 2D8B027EC;
	Mon, 19 Nov 2012 14:49:16 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 0DE9BEC027; Mon, 19 Nov 2012 14:49:16 +0200 (EET)
Date: Mon, 19 Nov 2012 14:49:15 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121119124915.GS8912@reaktio.net>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352992629-5850-4-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353328024.18229.72.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353328024.18229.72.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 03/10] Remove old vtpm support from
	xm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 19, 2012 at 12:27:04PM +0000, Ian Campbell wrote:
> On Thu, 2012-11-15 at 15:17 +0000, Matthew Fioravante wrote:
> > Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> > ---
> >  docs/man/xm.pod.1                           |   11 ---
> >  tools/python/README.XendConfig              |    2 -
> >  tools/python/README.sxpcfg                  |    4 -
> >  tools/python/scripts/xapi.py                |   20 ----
> >  tools/python/xen/xend/XendAPI.py            |  128 ------------------------
> >  tools/python/xen/xend/XendConfig.py         |   19 +---
> >  tools/python/xen/xend/XendConstants.py      |    8 +-
> >  tools/python/xen/xend/XendDevices.py        |    4 +-
> >  tools/python/xen/xend/XendDomainInfo.py     |   29 ------
> >  tools/python/xen/xend/XendError.py          |    1 -
> >  tools/python/xen/xend/XendOptions.py        |    4 -
> >  tools/python/xen/xend/server/tpmif.py       |  141 ---------------------------
> >  tools/python/xen/xend/tests/xend-config.sxp |    2 -
> >  tools/python/xen/xm/create.dtd              |    4 -
> >  tools/python/xen/xm/create.py               |   69 -------------
> >  tools/python/xen/xm/main.py                 |   37 -------
> >  tools/python/xen/xm/xenapi_create.py        |   39 --------
> >  17 files changed, 4 insertions(+), 518 deletions(-)
> >  delete mode 100644 tools/python/xen/xend/server/tpmif.py
> 
> I know I guided you down this path in the first place but I'm starting
> to wonder if removing the process model is/was the right thing to do for
> xend. It's one thing for xend to be deprecated and unmaintained, but
> actively removing features is a bit more than that.
> 
> Looking back at 26144:170d45f7a2eb I see in the commit message:
>         Remove the old vtpm process model. It doesn't work very well and
>         is no longer supported.
> 
> Also looking back in the previous mail threads I see:
>         The vtpm_manager code is full of bugs and actually needs a
>         complete rewrite. The amount of careless memory leaks and other
>         bugs I found when trying to use it were pretty astounding. The
>         first manager patch fixes most of the ones I could find to get
>         the manager to work properly.
>         
>         The managers current form in the xen tree is actually pretty
>         unusable. I don't have time to rewrite the manager, but what I'm
>         offering here is at least a huge improvement over the old code.
>         
> and also:
>         I don't know if there is anyone who would want to still use
>         vtpms as
>         processes when the stub domains are now available. Security
>         research
>         people like the domain model because it guarantees a better
>         separation of components guaranteed by the hypervisor and
>         doesn't have to trust the dom0 OS.
> 
> Which suggests that the number of people using the process model stuff
> with xend is likely to be indistinguishable from zero. Do you have any
> idea if there is anyone actually using it?
> 
> In any case it does seem like anyone who is using the vtpm with xend is
> playing with fire since it is unmaintained and full of bugs, which isn't
> a good thing in a component which is supposed to be *increasing*
> security.
> 
> Daniel/Pasi, I've CCd you since I thought you might have some insights
> into how much use the process model vtpm stuff in xend is getting in the
> field etc.
> 

Hmm.. I can only remember one or two people asking for vtpm stuff during past couple of years.
So based on that I don't think it's actively used out there..

Or then it works very well and people don't need to ask about it ;)

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 12:56:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 12:56:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaQtM-0000hu-B7; Mon, 19 Nov 2012 12:56:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaQtK-0000hn-P4
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 12:55:59 +0000
Received: from [85.158.143.99:31255] by server-1.bemta-4.messagelabs.com id
	2B/49-27934-E5C2AA05; Mon, 19 Nov 2012 12:55:58 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353329756!23463865!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16365 invoked from network); 19 Nov 2012 12:55:56 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 12:55:56 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15878775"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 12:55:56 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 12:55:56 +0000
Message-ID: <1353329754.18229.80.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Mon, 19 Nov 2012 12:55:54 +0000
In-Reply-To: <1353001687-3560-1-git-send-email-stefano.stabellini@eu.citrix.com>
References: <1353001687-3560-1-git-send-email-stefano.stabellini@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH v3] xen/arm: get the number of cpus from
	device tree
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 17:48 +0000, Stefano Stabellini wrote:
> The system might have fewer cpus than the GIC supports.
> 
> Changes in v3:
> - get cpu nodes matching the device_type property on the DT;
> - get the cpu ID from the reg property on the DT;
> - hook the DT cpu parsing in early_scan_node.
> 
> Changes in v2:
> - return always at least 1 cpu;
> - skip nodes with names that don't start with "cpu".
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Acked + applied, thanks.

Small reject in xen/arch/arm/setup.c due to changes in the flush D-cache
patch (the panic on preposterous cahceline size at the start of
start_xen is gone). Please check I did the right thing!

> ---
>  xen/arch/arm/gic.c        |    4 +---
>  xen/arch/arm/gic.h        |    2 +-
>  xen/arch/arm/setup.c      |    5 ++++-
>  xen/arch/arm/smpboot.c    |   27 ++++++++++++++++++++-------
>  xen/common/device_tree.c  |   43 +++++++++++++++++++++++++++++++++++++++++++
>  xen/include/asm-arm/smp.h |    2 ++
>  6 files changed, 71 insertions(+), 12 deletions(-)
> 
> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> index 5f06e08..0c6fab9 100644
> --- a/xen/arch/arm/gic.c
> +++ b/xen/arch/arm/gic.c
> @@ -304,7 +304,7 @@ static void __cpuinit gic_hyp_disable(void)
>  }
>  
>  /* Set up the GIC */
> -int __init gic_init(void)
> +void __init gic_init(void)
>  {
>      /* XXX FIXME get this from devicetree */
>      gic.dbase = GIC_BASE_ADDRESS + GIC_DR_OFFSET;
> @@ -328,8 +328,6 @@ int __init gic_init(void)
>      gic.lr_mask = 0ULL;
>  
>      spin_unlock(&gic.lock);
> -
> -    return gic.cpus;
>  }
>  
>  /* Set up the per-CPU parts of the GIC for a secondary CPU */
> diff --git a/xen/arch/arm/gic.h b/xen/arch/arm/gic.h
> index b2e1d7f..1bf1b02 100644
> --- a/xen/arch/arm/gic.h
> +++ b/xen/arch/arm/gic.h
> @@ -147,7 +147,7 @@ extern int gic_route_irq_to_guest(struct domain *d, unsigned int irq,
>  /* Accept an interrupt from the GIC and dispatch its handler */
>  extern void gic_interrupt(struct cpu_user_regs *regs, int is_fiq);
>  /* Bring up the interrupt controller, and report # cpus attached */
> -extern int gic_init(void);
> +extern void gic_init(void);
>  /* Bring up a secondary CPU's per-CPU GIC interface */
>  extern void gic_init_secondary_cpu(void);
>  /* Take down a CPU's per-CPU GIC interface */
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index a579a56..d5d845a 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -189,10 +189,13 @@ void __init start_xen(unsigned long boot_phys_offset,
>      if ( cacheline_bytes < MIN_CACHELINE_BYTES )
>          panic("CPU has preposterously small cache lines");
>  
> +    smp_clear_cpu_maps();
> +
>      fdt = (void *)BOOT_MISC_VIRT_START
>          + (atag_paddr & ((1 << SECOND_SHIFT) - 1));
>      fdt_size = device_tree_early_init(fdt);
>  
> +    cpus = smp_get_max_cpus();
>      cmdline_parse(device_tree_bootargs(fdt));
>  
>      setup_pagetables(boot_phys_offset, get_xen_paddr());
> @@ -203,7 +206,7 @@ void __init start_xen(unsigned long boot_phys_offset,
>      console_init_preirq();
>  #endif
>  
> -    cpus = gic_init();
> +    gic_init();
>      make_cpus_ready(cpus, boot_phys_offset);
>  
>      percpu_init_areas();
> diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
> index f4fd512..93b7ded 100644
> --- a/xen/arch/arm/smpboot.c
> +++ b/xen/arch/arm/smpboot.c
> @@ -71,18 +71,31 @@ static void setup_cpu_sibling_map(int cpu)
>      cpumask_set_cpu(cpu, per_cpu(cpu_core_mask, cpu));
>  }
>  
> -
>  void __init
> -smp_prepare_cpus (unsigned int max_cpus)
> +smp_clear_cpu_maps (void)
>  {
> -    int i;
> -
> +    cpumask_clear(&cpu_possible_map);
>      cpumask_clear(&cpu_online_map);
>      cpumask_set_cpu(0, &cpu_online_map);
> +    cpumask_set_cpu(0, &cpu_possible_map);
> +}
>  
> -    cpumask_clear(&cpu_possible_map);
> -    for ( i = 0; i < max_cpus; i++ )
> -        cpumask_set_cpu(i, &cpu_possible_map);
> +int __init
> +smp_get_max_cpus (void)
> +{
> +    int i, max_cpus = 0;
> +
> +    for ( i = 0; i < nr_cpu_ids; i++ )
> +        if ( cpu_possible(i) )
> +            max_cpus++;
> +
> +    return max_cpus;
> +}
> +
> +
> +void __init
> +smp_prepare_cpus (unsigned int max_cpus)
> +{
>      cpumask_copy(&cpu_present_map, &cpu_possible_map);
>  
>      setup_cpu_sibling_map(0);
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 3d1f0f4..da0af77 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -18,6 +18,7 @@
>  #include <xen/mm.h>
>  #include <xen/stdarg.h>
>  #include <xen/string.h>
> +#include <xen/cpumask.h>
>  #include <asm/early_printk.h>
>  
>  struct dt_early_info __initdata early_info;
> @@ -41,6 +42,18 @@ bool_t device_tree_node_matches(const void *fdt, int node, const char *match)
>          && (name[match_len] == '@' || name[match_len] == '\0');
>  }
>  
> +bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
> +{
> +    int len;
> +    const void *prop;
> +
> +    prop = fdt_getprop(fdt, node, "device_type", &len);
> +    if ( prop == NULL )
> +        return 0;
> +
> +    return !strncmp(prop, match, len);
> +}
> +
>  static void __init get_val(const u32 **cell, u32 cells, u64 *val)
>  {
>      *val = 0;
> @@ -229,6 +242,34 @@ static void __init process_memory_node(const void *fdt, int node,
>      }
>  }
>  
> +static void __init process_cpu_node(const void *fdt, int node,
> +                                    const char *name,
> +                                    u32 address_cells, u32 size_cells)
> +{
> +    const struct fdt_property *prop;
> +    const u32 *cell;
> +    paddr_t start, size;
> +
> +    if ( address_cells != 1 || size_cells != 0 )
> +    {
> +        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
> +                     name);
> +        return;
> +    }
> +
> +    prop = fdt_get_property(fdt, node, "reg", NULL);
> +    if ( !prop )
> +    {
> +        early_printk("fdt: node `%s': missing `reg' property\n", name);
> +        return;
> +    }
> +
> +    cell = (const u32 *)prop->data;
> +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> +
> +    cpumask_set_cpu(start, &cpu_possible_map);
> +}
> +
>  static int __init early_scan_node(const void *fdt,
>                                    int node, const char *name, int depth,
>                                    u32 address_cells, u32 size_cells,
> @@ -236,6 +277,8 @@ static int __init early_scan_node(const void *fdt,
>  {
>      if ( device_tree_node_matches(fdt, node, "memory") )
>          process_memory_node(fdt, node, name, address_cells, size_cells);
> +    else if ( device_tree_type_matches(fdt, node, "cpu") )
> +        process_cpu_node(fdt, node, name, address_cells, size_cells);
>  
>      return 0;
>  }
> diff --git a/xen/include/asm-arm/smp.h b/xen/include/asm-arm/smp.h
> index a98032d..d4ed1cb 100644
> --- a/xen/include/asm-arm/smp.h
> +++ b/xen/include/asm-arm/smp.h
> @@ -22,6 +22,8 @@ extern void stop_cpu(void);
>  extern void
>  make_cpus_ready(unsigned int max_cpus, unsigned long boot_phys_offset);
>  
> +extern void smp_clear_cpu_maps (void);
> +extern int smp_get_max_cpus (void);
>  #endif
>  /*
>   * Local variables:



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 12:56:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 12:56:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaQtM-0000hu-B7; Mon, 19 Nov 2012 12:56:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaQtK-0000hn-P4
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 12:55:59 +0000
Received: from [85.158.143.99:31255] by server-1.bemta-4.messagelabs.com id
	2B/49-27934-E5C2AA05; Mon, 19 Nov 2012 12:55:58 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353329756!23463865!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16365 invoked from network); 19 Nov 2012 12:55:56 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 12:55:56 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15878775"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 12:55:56 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 12:55:56 +0000
Message-ID: <1353329754.18229.80.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Mon, 19 Nov 2012 12:55:54 +0000
In-Reply-To: <1353001687-3560-1-git-send-email-stefano.stabellini@eu.citrix.com>
References: <1353001687-3560-1-git-send-email-stefano.stabellini@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH v3] xen/arm: get the number of cpus from
	device tree
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 17:48 +0000, Stefano Stabellini wrote:
> The system might have fewer cpus than the GIC supports.
> 
> Changes in v3:
> - get cpu nodes matching the device_type property on the DT;
> - get the cpu ID from the reg property on the DT;
> - hook the DT cpu parsing in early_scan_node.
> 
> Changes in v2:
> - return always at least 1 cpu;
> - skip nodes with names that don't start with "cpu".
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Acked + applied, thanks.

Small reject in xen/arch/arm/setup.c due to changes in the flush D-cache
patch (the panic on preposterous cahceline size at the start of
start_xen is gone). Please check I did the right thing!

> ---
>  xen/arch/arm/gic.c        |    4 +---
>  xen/arch/arm/gic.h        |    2 +-
>  xen/arch/arm/setup.c      |    5 ++++-
>  xen/arch/arm/smpboot.c    |   27 ++++++++++++++++++++-------
>  xen/common/device_tree.c  |   43 +++++++++++++++++++++++++++++++++++++++++++
>  xen/include/asm-arm/smp.h |    2 ++
>  6 files changed, 71 insertions(+), 12 deletions(-)
> 
> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> index 5f06e08..0c6fab9 100644
> --- a/xen/arch/arm/gic.c
> +++ b/xen/arch/arm/gic.c
> @@ -304,7 +304,7 @@ static void __cpuinit gic_hyp_disable(void)
>  }
>  
>  /* Set up the GIC */
> -int __init gic_init(void)
> +void __init gic_init(void)
>  {
>      /* XXX FIXME get this from devicetree */
>      gic.dbase = GIC_BASE_ADDRESS + GIC_DR_OFFSET;
> @@ -328,8 +328,6 @@ int __init gic_init(void)
>      gic.lr_mask = 0ULL;
>  
>      spin_unlock(&gic.lock);
> -
> -    return gic.cpus;
>  }
>  
>  /* Set up the per-CPU parts of the GIC for a secondary CPU */
> diff --git a/xen/arch/arm/gic.h b/xen/arch/arm/gic.h
> index b2e1d7f..1bf1b02 100644
> --- a/xen/arch/arm/gic.h
> +++ b/xen/arch/arm/gic.h
> @@ -147,7 +147,7 @@ extern int gic_route_irq_to_guest(struct domain *d, unsigned int irq,
>  /* Accept an interrupt from the GIC and dispatch its handler */
>  extern void gic_interrupt(struct cpu_user_regs *regs, int is_fiq);
>  /* Bring up the interrupt controller, and report # cpus attached */
> -extern int gic_init(void);
> +extern void gic_init(void);
>  /* Bring up a secondary CPU's per-CPU GIC interface */
>  extern void gic_init_secondary_cpu(void);
>  /* Take down a CPU's per-CPU GIC interface */
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index a579a56..d5d845a 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -189,10 +189,13 @@ void __init start_xen(unsigned long boot_phys_offset,
>      if ( cacheline_bytes < MIN_CACHELINE_BYTES )
>          panic("CPU has preposterously small cache lines");
>  
> +    smp_clear_cpu_maps();
> +
>      fdt = (void *)BOOT_MISC_VIRT_START
>          + (atag_paddr & ((1 << SECOND_SHIFT) - 1));
>      fdt_size = device_tree_early_init(fdt);
>  
> +    cpus = smp_get_max_cpus();
>      cmdline_parse(device_tree_bootargs(fdt));
>  
>      setup_pagetables(boot_phys_offset, get_xen_paddr());
> @@ -203,7 +206,7 @@ void __init start_xen(unsigned long boot_phys_offset,
>      console_init_preirq();
>  #endif
>  
> -    cpus = gic_init();
> +    gic_init();
>      make_cpus_ready(cpus, boot_phys_offset);
>  
>      percpu_init_areas();
> diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
> index f4fd512..93b7ded 100644
> --- a/xen/arch/arm/smpboot.c
> +++ b/xen/arch/arm/smpboot.c
> @@ -71,18 +71,31 @@ static void setup_cpu_sibling_map(int cpu)
>      cpumask_set_cpu(cpu, per_cpu(cpu_core_mask, cpu));
>  }
>  
> -
>  void __init
> -smp_prepare_cpus (unsigned int max_cpus)
> +smp_clear_cpu_maps (void)
>  {
> -    int i;
> -
> +    cpumask_clear(&cpu_possible_map);
>      cpumask_clear(&cpu_online_map);
>      cpumask_set_cpu(0, &cpu_online_map);
> +    cpumask_set_cpu(0, &cpu_possible_map);
> +}
>  
> -    cpumask_clear(&cpu_possible_map);
> -    for ( i = 0; i < max_cpus; i++ )
> -        cpumask_set_cpu(i, &cpu_possible_map);
> +int __init
> +smp_get_max_cpus (void)
> +{
> +    int i, max_cpus = 0;
> +
> +    for ( i = 0; i < nr_cpu_ids; i++ )
> +        if ( cpu_possible(i) )
> +            max_cpus++;
> +
> +    return max_cpus;
> +}
> +
> +
> +void __init
> +smp_prepare_cpus (unsigned int max_cpus)
> +{
>      cpumask_copy(&cpu_present_map, &cpu_possible_map);
>  
>      setup_cpu_sibling_map(0);
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 3d1f0f4..da0af77 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -18,6 +18,7 @@
>  #include <xen/mm.h>
>  #include <xen/stdarg.h>
>  #include <xen/string.h>
> +#include <xen/cpumask.h>
>  #include <asm/early_printk.h>
>  
>  struct dt_early_info __initdata early_info;
> @@ -41,6 +42,18 @@ bool_t device_tree_node_matches(const void *fdt, int node, const char *match)
>          && (name[match_len] == '@' || name[match_len] == '\0');
>  }
>  
> +bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
> +{
> +    int len;
> +    const void *prop;
> +
> +    prop = fdt_getprop(fdt, node, "device_type", &len);
> +    if ( prop == NULL )
> +        return 0;
> +
> +    return !strncmp(prop, match, len);
> +}
> +
>  static void __init get_val(const u32 **cell, u32 cells, u64 *val)
>  {
>      *val = 0;
> @@ -229,6 +242,34 @@ static void __init process_memory_node(const void *fdt, int node,
>      }
>  }
>  
> +static void __init process_cpu_node(const void *fdt, int node,
> +                                    const char *name,
> +                                    u32 address_cells, u32 size_cells)
> +{
> +    const struct fdt_property *prop;
> +    const u32 *cell;
> +    paddr_t start, size;
> +
> +    if ( address_cells != 1 || size_cells != 0 )
> +    {
> +        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
> +                     name);
> +        return;
> +    }
> +
> +    prop = fdt_get_property(fdt, node, "reg", NULL);
> +    if ( !prop )
> +    {
> +        early_printk("fdt: node `%s': missing `reg' property\n", name);
> +        return;
> +    }
> +
> +    cell = (const u32 *)prop->data;
> +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> +
> +    cpumask_set_cpu(start, &cpu_possible_map);
> +}
> +
>  static int __init early_scan_node(const void *fdt,
>                                    int node, const char *name, int depth,
>                                    u32 address_cells, u32 size_cells,
> @@ -236,6 +277,8 @@ static int __init early_scan_node(const void *fdt,
>  {
>      if ( device_tree_node_matches(fdt, node, "memory") )
>          process_memory_node(fdt, node, name, address_cells, size_cells);
> +    else if ( device_tree_type_matches(fdt, node, "cpu") )
> +        process_cpu_node(fdt, node, name, address_cells, size_cells);
>  
>      return 0;
>  }
> diff --git a/xen/include/asm-arm/smp.h b/xen/include/asm-arm/smp.h
> index a98032d..d4ed1cb 100644
> --- a/xen/include/asm-arm/smp.h
> +++ b/xen/include/asm-arm/smp.h
> @@ -22,6 +22,8 @@ extern void stop_cpu(void);
>  extern void
>  make_cpus_ready(unsigned int max_cpus, unsigned long boot_phys_offset);
>  
> +extern void smp_clear_cpu_maps (void);
> +extern int smp_get_max_cpus (void);
>  #endif
>  /*
>   * Local variables:



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 12:57:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 12:57:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaQuB-0000lC-PU; Mon, 19 Nov 2012 12:56:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaQuA-0000l0-7R
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 12:56:50 +0000
Received: from [85.158.143.35:43705] by server-1.bemta-4.messagelabs.com id
	5F/4A-27934-19C2AA05; Mon, 19 Nov 2012 12:56:49 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1353329807!18289567!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3996 invoked from network); 19 Nov 2012 12:56:47 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 12:56:47 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15878784"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 12:56:06 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 12:56:06 +0000
Message-ID: <1353329757.18229.81.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Mon, 19 Nov 2012 12:55:57 +0000
In-Reply-To: <1353080578-1487-1-git-send-email-stefano.stabellini@eu.citrix.com>
References: <1353080578-1487-1-git-send-email-stefano.stabellini@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH v3] xen/arm: flush D-cache and I-cache when
	appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 15:42 +0000, Stefano Stabellini wrote:
> - invalidate tlb after setting WXN
> - flush D-cache and I-cache after relocation;
> - invalidate D-cache after writing to smp_up_cpu;
> - flush I-cache after changing HTTBR;
> - flush I-cache and branch predictor after writing Xen text ptes.
> 
> 
> Changes in v3:
> - remove flush before HTTBR change;
> - added more comments through the code;
> - remove asm volatile to change HTTBR and replace it with C functions
> calls and macros;
> - add an isb at the beginning of flush_xen_text_tlb;
> - remove isb after write_pte and before setting WXN;
> - change flush_xen_dcache_va to take into account pointers that cross a
> cacheline boundary.
> 
> Changes in v2:
> - fix a wrong comment;
> - add a comment to described why we need a DSB at the beginning of
> write_pte;
> - do not issue ISB within write_pte, call isb() afterwards whenever
> appropriate;
> - issue DSB after DCCMVAC in write_pte to make sure that the data flush
> is completed before proceeding;
> - make flush_xen_dcache_va take a void* as argument;
> - introduce flush_xen_dcache_va_range.
> 
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Acked-by: Ian Campbell <Ian.campbell@citrix.com> and applied, thanks,

> ---
>  xen/arch/arm/head.S        |    6 +++++
>  xen/arch/arm/mm.c          |   21 +++++++++--------
>  xen/arch/arm/smpboot.c     |    4 +++
>  xen/include/asm-arm/page.h |   53 +++++++++++++++++++++++++++++++++++++++++--
>  4 files changed, 71 insertions(+), 13 deletions(-)
> 
> diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> index 3fe6412..25c4cfe 100644
> --- a/xen/arch/arm/head.S
> +++ b/xen/arch/arm/head.S
> @@ -278,8 +278,12 @@ paging:
>  	ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
>  	add   r4, r4, r10            /* PA of it */
>  	ldrd  r4, r5, [r4]           /* Actual value */
> +	dsb
>  	mcrr  CP64(r4, r5, HTTBR)
> +	dsb
> +	isb
>  	mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
> +	mcr   CP32(r0, ICIALLU)      /* Flush I-cache */
>  	mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
>  	dsb                          /* Ensure completion of TLB+BP flush */
>  	isb
> @@ -292,6 +296,8 @@ paging:
>  	teq   r2, #0
>  	bne   1b
>  	dsb
> +	mcr   CP32(r0, DCCMVAC)      /* flush D-Cache */
> +	dsb
>  
>  	/* Here, the non-boot CPUs must wait again -- they're now running on
>  	 * the boot CPU's pagetables so it's safe for the boot CPU to
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index d0cd2c9..1680f4d 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -244,14 +244,13 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
>  
>      /* Change pagetables to the copy in the relocated Xen */
>      boot_httbr = (unsigned long) xen_pgtable + phys_offset;
> -    asm volatile (
> -        STORE_CP64(0, HTTBR)          /* Change translation base */
> -        "dsb;"                        /* Ensure visibility of HTTBR update */
> -        STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
> -        STORE_CP32(0, BPIALL)         /* Flush branch predictor */
> -        "dsb;"                        /* Ensure completion of TLB+BP flush */
> -        "isb;"
> -        : : "r" (boot_httbr) : "memory");
> +    flush_xen_dcache_va(&boot_httbr);
> +    flush_xen_dcache_va_range((void*)dest_va, _end - _start);
> +    flush_xen_text_tlb();
> +
> +    WRITE_CP64(boot_httbr, HTTBR); /* Change translation base */
> +    dsb();                         /* Ensure visibility of HTTBR update */
> +    flush_xen_text_tlb();
>  
>      /* Undo the temporary map */
>      pte.bits = 0;
> @@ -291,11 +290,12 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
>                             >> PAGE_SHIFT);
>      pte.pt.table = 1;
>      write_pte(xen_second + second_linear_offset(XEN_VIRT_START), pte);
> -    /* Have changed a mapping used for .text. Flush everything for safety. */
> -    flush_xen_text_tlb();
> +    /* TLBFLUSH and ISB would be needed here, but wait until we set WXN */
>  
>      /* From now on, no mapping may be both writable and executable. */
>      WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
> +    /* Flush everything after setting WXN bit. */
> +    flush_xen_text_tlb();
>  }
>  
>  /* MMU setup for secondary CPUS (which already have paging enabled) */
> @@ -303,6 +303,7 @@ void __cpuinit mmu_init_secondary_cpu(void)
>  {
>      /* From now on, no mapping may be both writable and executable. */
>      WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
> +    flush_xen_text_tlb();
>  }
>  
>  /* Create Xen's mappings of memory.
> diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
> index c0750c0..1b52e22 100644
> --- a/xen/arch/arm/smpboot.c
> +++ b/xen/arch/arm/smpboot.c
> @@ -105,6 +105,7 @@ make_cpus_ready(unsigned int max_cpus, unsigned long boot_phys_offset)
>          /* Tell the next CPU to get ready */
>          /* TODO: handle boards where CPUIDs are not contiguous */
>          *gate = i;
> +        flush_xen_dcache_va(gate);
>          asm volatile("dsb; isb; sev");
>          /* And wait for it to respond */
>          while ( ready_cpus < i )
> @@ -201,6 +202,9 @@ int __cpu_up(unsigned int cpu)
>      /* Unblock the CPU.  It should be waiting in the loop in head.S
>       * for an event to arrive when smp_up_cpu matches its cpuid. */
>      smp_up_cpu = cpu;
> +    /* we need to make sure that the change to smp_up_cpu is visible to
> +     * secondary cpus with D-cache off */
> +    flush_xen_dcache_va(&smp_up_cpu);
>      asm volatile("dsb; isb; sev");
>  
>      while ( !cpu_online(cpu) )
> diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
> index 9511c45..3e77281 100644
> --- a/xen/include/asm-arm/page.h
> +++ b/xen/include/asm-arm/page.h
> @@ -228,27 +228,74 @@ static inline lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr)
>      return e;
>  }
>  
> -/* Write a pagetable entry */
> +/* Write a pagetable entry.
> + *
> + * If the table entry is changing a text mapping, it is responsibility
> + * of the caller to issue an ISB after write_pte.
> + */
>  static inline void write_pte(lpae_t *p, lpae_t pte)
>  {
>      asm volatile (
> +        /* Ensure any writes have completed with the old mappings. */
> +        "dsb;"
>          /* Safely write the entry (STRD is atomic on CPUs that support LPAE) */
>          "strd %0, %H0, [%1];"
> +        "dsb;"
>          /* Push this cacheline to the PoC so the rest of the system sees it. */
>          STORE_CP32(1, DCCMVAC)
> +        /* Ensure that the data flush is completed before proceeding */
> +        "dsb;"
>          : : "r" (pte.bits), "r" (p) : "memory");
>  }
>  
> +
> +/* Function for flushing medium-sized areas.
> + * if 'range' is large enough we might want to use model-specific
> + * full-cache flushes. */
> +static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
> +{
> +    int cacheline_bytes  = READ_CP32(CCSIDR);
> +    void *end;
> +    dsb();           /* So the CPU issues all writes to the range */ 
> +    for ( end = p + size; p < end; p += cacheline_bytes )
> +        WRITE_CP32((uint32_t) p, DCCMVAC);
> +    dsb();           /* So we know the flushes happen before continuing */
> +}
> +
> +
> +/* Macro for flushing a single small item.  The predicate is always 
> + * compile-time constant so this will compile down to 3 instructions in
> + * the common case.  Make sure to call it with the correct type of
> + * pointer! */
> +#define flush_xen_dcache_va(p) do {                                     \
> +    int cacheline_bytes  = READ_CP32(CCSIDR);                           \
> +    typeof(p) _p = (p);                                                 \
> +    if ( ((unsigned long)_p & ~(cacheline_bytes - 1)) !=                \
> +        (((unsigned long)_p + (sizeof *_p)) & ~(cacheline_bytes - 1)) ) \
> +        flush_xen_dcache_va_range(_p, sizeof *_p);                      \
> +    else                                                                \
> +        asm volatile (                                                  \
> +            "dsb;"   /* Finish all earlier writes */                    \
> +            STORE_CP32(0, DCCMVAC)                                      \
> +            "dsb;"   /* Finish flush before continuing */               \
> +            : : "r" (_p), "m" (*_p));                                   \
> +} while (0)
> +
> +
>  /*
>   * Flush all hypervisor mappings from the TLB and branch predictor.
> - * This is needed after changing Xen code mappings. 
> + * This is needed after changing Xen code mappings.
> + *
> + * The caller needs to issue the necessary DSB and D-cache flushes
> + * before calling flush_xen_text_tlb.
>   */
>  static inline void flush_xen_text_tlb(void)
>  {
>      register unsigned long r0 asm ("r0");
>      asm volatile (
> -        "dsb;"                        /* Ensure visibility of PTE writes */
> +        "isb;"                        /* Ensure synchronization with previous changes to text */
>          STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
> +        STORE_CP32(0, ICIALLU)        /* Flush I-cache */
>          STORE_CP32(0, BPIALL)         /* Flush branch predictor */
>          "dsb;"                        /* Ensure completion of TLB+BP flush */
>          "isb;"



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 12:57:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 12:57:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaQuB-0000lC-PU; Mon, 19 Nov 2012 12:56:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaQuA-0000l0-7R
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 12:56:50 +0000
Received: from [85.158.143.35:43705] by server-1.bemta-4.messagelabs.com id
	5F/4A-27934-19C2AA05; Mon, 19 Nov 2012 12:56:49 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1353329807!18289567!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3996 invoked from network); 19 Nov 2012 12:56:47 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 12:56:47 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15878784"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 12:56:06 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 12:56:06 +0000
Message-ID: <1353329757.18229.81.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Mon, 19 Nov 2012 12:55:57 +0000
In-Reply-To: <1353080578-1487-1-git-send-email-stefano.stabellini@eu.citrix.com>
References: <1353080578-1487-1-git-send-email-stefano.stabellini@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH v3] xen/arm: flush D-cache and I-cache when
	appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 15:42 +0000, Stefano Stabellini wrote:
> - invalidate tlb after setting WXN
> - flush D-cache and I-cache after relocation;
> - invalidate D-cache after writing to smp_up_cpu;
> - flush I-cache after changing HTTBR;
> - flush I-cache and branch predictor after writing Xen text ptes.
> 
> 
> Changes in v3:
> - remove flush before HTTBR change;
> - added more comments through the code;
> - remove asm volatile to change HTTBR and replace it with C functions
> calls and macros;
> - add an isb at the beginning of flush_xen_text_tlb;
> - remove isb after write_pte and before setting WXN;
> - change flush_xen_dcache_va to take into account pointers that cross a
> cacheline boundary.
> 
> Changes in v2:
> - fix a wrong comment;
> - add a comment to described why we need a DSB at the beginning of
> write_pte;
> - do not issue ISB within write_pte, call isb() afterwards whenever
> appropriate;
> - issue DSB after DCCMVAC in write_pte to make sure that the data flush
> is completed before proceeding;
> - make flush_xen_dcache_va take a void* as argument;
> - introduce flush_xen_dcache_va_range.
> 
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Acked-by: Ian Campbell <Ian.campbell@citrix.com> and applied, thanks,

> ---
>  xen/arch/arm/head.S        |    6 +++++
>  xen/arch/arm/mm.c          |   21 +++++++++--------
>  xen/arch/arm/smpboot.c     |    4 +++
>  xen/include/asm-arm/page.h |   53 +++++++++++++++++++++++++++++++++++++++++--
>  4 files changed, 71 insertions(+), 13 deletions(-)
> 
> diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> index 3fe6412..25c4cfe 100644
> --- a/xen/arch/arm/head.S
> +++ b/xen/arch/arm/head.S
> @@ -278,8 +278,12 @@ paging:
>  	ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
>  	add   r4, r4, r10            /* PA of it */
>  	ldrd  r4, r5, [r4]           /* Actual value */
> +	dsb
>  	mcrr  CP64(r4, r5, HTTBR)
> +	dsb
> +	isb
>  	mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
> +	mcr   CP32(r0, ICIALLU)      /* Flush I-cache */
>  	mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
>  	dsb                          /* Ensure completion of TLB+BP flush */
>  	isb
> @@ -292,6 +296,8 @@ paging:
>  	teq   r2, #0
>  	bne   1b
>  	dsb
> +	mcr   CP32(r0, DCCMVAC)      /* flush D-Cache */
> +	dsb
>  
>  	/* Here, the non-boot CPUs must wait again -- they're now running on
>  	 * the boot CPU's pagetables so it's safe for the boot CPU to
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index d0cd2c9..1680f4d 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -244,14 +244,13 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
>  
>      /* Change pagetables to the copy in the relocated Xen */
>      boot_httbr = (unsigned long) xen_pgtable + phys_offset;
> -    asm volatile (
> -        STORE_CP64(0, HTTBR)          /* Change translation base */
> -        "dsb;"                        /* Ensure visibility of HTTBR update */
> -        STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
> -        STORE_CP32(0, BPIALL)         /* Flush branch predictor */
> -        "dsb;"                        /* Ensure completion of TLB+BP flush */
> -        "isb;"
> -        : : "r" (boot_httbr) : "memory");
> +    flush_xen_dcache_va(&boot_httbr);
> +    flush_xen_dcache_va_range((void*)dest_va, _end - _start);
> +    flush_xen_text_tlb();
> +
> +    WRITE_CP64(boot_httbr, HTTBR); /* Change translation base */
> +    dsb();                         /* Ensure visibility of HTTBR update */
> +    flush_xen_text_tlb();
>  
>      /* Undo the temporary map */
>      pte.bits = 0;
> @@ -291,11 +290,12 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
>                             >> PAGE_SHIFT);
>      pte.pt.table = 1;
>      write_pte(xen_second + second_linear_offset(XEN_VIRT_START), pte);
> -    /* Have changed a mapping used for .text. Flush everything for safety. */
> -    flush_xen_text_tlb();
> +    /* TLBFLUSH and ISB would be needed here, but wait until we set WXN */
>  
>      /* From now on, no mapping may be both writable and executable. */
>      WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
> +    /* Flush everything after setting WXN bit. */
> +    flush_xen_text_tlb();
>  }
>  
>  /* MMU setup for secondary CPUS (which already have paging enabled) */
> @@ -303,6 +303,7 @@ void __cpuinit mmu_init_secondary_cpu(void)
>  {
>      /* From now on, no mapping may be both writable and executable. */
>      WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
> +    flush_xen_text_tlb();
>  }
>  
>  /* Create Xen's mappings of memory.
> diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
> index c0750c0..1b52e22 100644
> --- a/xen/arch/arm/smpboot.c
> +++ b/xen/arch/arm/smpboot.c
> @@ -105,6 +105,7 @@ make_cpus_ready(unsigned int max_cpus, unsigned long boot_phys_offset)
>          /* Tell the next CPU to get ready */
>          /* TODO: handle boards where CPUIDs are not contiguous */
>          *gate = i;
> +        flush_xen_dcache_va(gate);
>          asm volatile("dsb; isb; sev");
>          /* And wait for it to respond */
>          while ( ready_cpus < i )
> @@ -201,6 +202,9 @@ int __cpu_up(unsigned int cpu)
>      /* Unblock the CPU.  It should be waiting in the loop in head.S
>       * for an event to arrive when smp_up_cpu matches its cpuid. */
>      smp_up_cpu = cpu;
> +    /* we need to make sure that the change to smp_up_cpu is visible to
> +     * secondary cpus with D-cache off */
> +    flush_xen_dcache_va(&smp_up_cpu);
>      asm volatile("dsb; isb; sev");
>  
>      while ( !cpu_online(cpu) )
> diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
> index 9511c45..3e77281 100644
> --- a/xen/include/asm-arm/page.h
> +++ b/xen/include/asm-arm/page.h
> @@ -228,27 +228,74 @@ static inline lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr)
>      return e;
>  }
>  
> -/* Write a pagetable entry */
> +/* Write a pagetable entry.
> + *
> + * If the table entry is changing a text mapping, it is responsibility
> + * of the caller to issue an ISB after write_pte.
> + */
>  static inline void write_pte(lpae_t *p, lpae_t pte)
>  {
>      asm volatile (
> +        /* Ensure any writes have completed with the old mappings. */
> +        "dsb;"
>          /* Safely write the entry (STRD is atomic on CPUs that support LPAE) */
>          "strd %0, %H0, [%1];"
> +        "dsb;"
>          /* Push this cacheline to the PoC so the rest of the system sees it. */
>          STORE_CP32(1, DCCMVAC)
> +        /* Ensure that the data flush is completed before proceeding */
> +        "dsb;"
>          : : "r" (pte.bits), "r" (p) : "memory");
>  }
>  
> +
> +/* Function for flushing medium-sized areas.
> + * if 'range' is large enough we might want to use model-specific
> + * full-cache flushes. */
> +static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
> +{
> +    int cacheline_bytes  = READ_CP32(CCSIDR);
> +    void *end;
> +    dsb();           /* So the CPU issues all writes to the range */ 
> +    for ( end = p + size; p < end; p += cacheline_bytes )
> +        WRITE_CP32((uint32_t) p, DCCMVAC);
> +    dsb();           /* So we know the flushes happen before continuing */
> +}
> +
> +
> +/* Macro for flushing a single small item.  The predicate is always 
> + * compile-time constant so this will compile down to 3 instructions in
> + * the common case.  Make sure to call it with the correct type of
> + * pointer! */
> +#define flush_xen_dcache_va(p) do {                                     \
> +    int cacheline_bytes  = READ_CP32(CCSIDR);                           \
> +    typeof(p) _p = (p);                                                 \
> +    if ( ((unsigned long)_p & ~(cacheline_bytes - 1)) !=                \
> +        (((unsigned long)_p + (sizeof *_p)) & ~(cacheline_bytes - 1)) ) \
> +        flush_xen_dcache_va_range(_p, sizeof *_p);                      \
> +    else                                                                \
> +        asm volatile (                                                  \
> +            "dsb;"   /* Finish all earlier writes */                    \
> +            STORE_CP32(0, DCCMVAC)                                      \
> +            "dsb;"   /* Finish flush before continuing */               \
> +            : : "r" (_p), "m" (*_p));                                   \
> +} while (0)
> +
> +
>  /*
>   * Flush all hypervisor mappings from the TLB and branch predictor.
> - * This is needed after changing Xen code mappings. 
> + * This is needed after changing Xen code mappings.
> + *
> + * The caller needs to issue the necessary DSB and D-cache flushes
> + * before calling flush_xen_text_tlb.
>   */
>  static inline void flush_xen_text_tlb(void)
>  {
>      register unsigned long r0 asm ("r0");
>      asm volatile (
> -        "dsb;"                        /* Ensure visibility of PTE writes */
> +        "isb;"                        /* Ensure synchronization with previous changes to text */
>          STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
> +        STORE_CP32(0, ICIALLU)        /* Flush I-cache */
>          STORE_CP32(0, BPIALL)         /* Flush branch predictor */
>          "dsb;"                        /* Ensure completion of TLB+BP flush */
>          "isb;"



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 12:57:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 12:57:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaQuP-0000nH-CG; Mon, 19 Nov 2012 12:57:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaQuN-0000mt-RC
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 12:57:04 +0000
Received: from [85.158.139.83:56555] by server-10.bemta-5.messagelabs.com id
	7A/67-09257-E9C2AA05; Mon, 19 Nov 2012 12:57:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1353329821!30929370!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10352 invoked from network); 19 Nov 2012 12:57:01 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 12:57:01 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15878804"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 12:57:00 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 12:57:00 +0000
Message-ID: <1353329819.18229.83.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Mon, 19 Nov 2012 12:56:59 +0000
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 15:16 +0000, Matthew Fioravante wrote:
> THese are the remaining patches to add vtpm mini-os support to xen.
> Documentation internal review is taking a bit longer so I will
> send out a final patch with docs next week.
> 
> Matthew Fioravante (10):
>   fix bug in lseek for mini-os
>   Update mini-os license to support GPL features
>   Remove old vtpm support from xm
>   Remove VTPM_TOOLS from config/Tools.mk.in
>   Remove old vtpm stuff from tools/libxen
>   Remove tools/vtpm* from MAINTAINERS file

I have acked and applied all of these, although please see my reply to
"Remove old vtpm support from xm".

>   Regenerate configure script after removing vtpm

I think this wasn't necessary because you don't change configure.ac here
and I already refreshed configure after missing it after the update in
the last batch. I reran autogen.sh and didn't see any changes.

>   add vtpm-stubdom code
>   add stubdom/vtpmmgr code
>   vtpm/vtpmmgr and required libs to stubdom/Makefile

Applied these.

> 
>  MAINTAINERS                                  |    2 -
>  config/Tools.mk.in                           |    1 -
>  docs/man/xm.pod.1                            |   11 -
>  extras/mini-os/COPYING                       |   13 +
>  extras/mini-os/lib/sys.c                     |   67 +-
>  stubdom/Makefile                             |  138 +++-
>  stubdom/polarssl.patch                       |   64 ++
>  stubdom/tpmemu-0.7.4.patch                   |   12 +
>  stubdom/vtpm/Makefile                        |   37 +
>  stubdom/vtpm/minios.cfg                      |   14 +
>  stubdom/vtpm/vtpm.c                          |  404 +++++++++++
>  stubdom/vtpm/vtpm.h                          |   36 +
>  stubdom/vtpm/vtpm_cmd.c                      |  256 +++++++
>  stubdom/vtpm/vtpm_cmd.h                      |   31 +
>  stubdom/vtpm/vtpm_pcrs.c                     |   43 ++
>  stubdom/vtpm/vtpm_pcrs.h                     |   53 ++
>  stubdom/vtpm/vtpmblk.c                       |  307 +++++++++
>  stubdom/vtpm/vtpmblk.h                       |   31 +
>  stubdom/vtpmmgr/Makefile                     |   32 +
>  stubdom/vtpmmgr/init.c                       |  553 +++++++++++++++
>  stubdom/vtpmmgr/log.c                        |  151 +++++
>  stubdom/vtpmmgr/log.h                        |   85 +++
>  stubdom/vtpmmgr/marshal.h                    |  528 +++++++++++++++
>  stubdom/vtpmmgr/minios.cfg                   |   14 +
>  stubdom/vtpmmgr/tcg.h                        |  707 +++++++++++++++++++
>  stubdom/vtpmmgr/tpm.c                        |  938 ++++++++++++++++++++++++++
>  stubdom/vtpmmgr/tpm.h                        |  218 ++++++
>  stubdom/vtpmmgr/tpmrsa.c                     |  175 +++++
>  stubdom/vtpmmgr/tpmrsa.h                     |   67 ++
>  stubdom/vtpmmgr/uuid.h                       |   50 ++
>  stubdom/vtpmmgr/vtpm_cmd_handler.c           |  152 +++++
>  stubdom/vtpmmgr/vtpm_manager.h               |   64 ++
>  stubdom/vtpmmgr/vtpm_storage.c               |  783 +++++++++++++++++++++
>  stubdom/vtpmmgr/vtpm_storage.h               |   68 ++
>  stubdom/vtpmmgr/vtpmmgr.c                    |   93 +++
>  stubdom/vtpmmgr/vtpmmgr.h                    |   77 +++
>  tools/configure                              |  603 ++++++++---------
>  tools/libxen/include/xen/api/xen_all.h       |    1 -
>  tools/libxen/include/xen/api/xen_vm.h        |    9 -
>  tools/libxen/include/xen/api/xen_vtpm.h      |  218 ------
>  tools/libxen/include/xen/api/xen_vtpm_decl.h |   31 -
>  tools/libxen/src/xen_vm.c                    |   22 -
>  tools/libxen/src/xen_vtpm.c                  |  235 -------
>  tools/python/README.XendConfig               |    2 -
>  tools/python/README.sxpcfg                   |    4 -
>  tools/python/scripts/xapi.py                 |   20 -
>  tools/python/xen/xend/XendAPI.py             |  128 ----
>  tools/python/xen/xend/XendConfig.py          |   19 +-
>  tools/python/xen/xend/XendConstants.py       |    8 +-
>  tools/python/xen/xend/XendDevices.py         |    4 +-
>  tools/python/xen/xend/XendDomainInfo.py      |   29 -
>  tools/python/xen/xend/XendError.py           |    1 -
>  tools/python/xen/xend/XendOptions.py         |    4 -
>  tools/python/xen/xend/server/tpmif.py        |  141 ----
>  tools/python/xen/xend/tests/xend-config.sxp  |    2 -
>  tools/python/xen/xm/create.dtd               |    4 -
>  tools/python/xen/xm/create.py                |   69 --
>  tools/python/xen/xm/main.py                  |   37 -
>  tools/python/xen/xm/xenapi_create.py         |   39 --
>  59 files changed, 6535 insertions(+), 1370 deletions(-)
>  create mode 100644 stubdom/polarssl.patch
>  create mode 100644 stubdom/tpmemu-0.7.4.patch
>  create mode 100644 stubdom/vtpm/Makefile
>  create mode 100644 stubdom/vtpm/minios.cfg
>  create mode 100644 stubdom/vtpm/vtpm.c
>  create mode 100644 stubdom/vtpm/vtpm.h
>  create mode 100644 stubdom/vtpm/vtpm_cmd.c
>  create mode 100644 stubdom/vtpm/vtpm_cmd.h
>  create mode 100644 stubdom/vtpm/vtpm_pcrs.c
>  create mode 100644 stubdom/vtpm/vtpm_pcrs.h
>  create mode 100644 stubdom/vtpm/vtpmblk.c
>  create mode 100644 stubdom/vtpm/vtpmblk.h
>  create mode 100644 stubdom/vtpmmgr/Makefile
>  create mode 100644 stubdom/vtpmmgr/init.c
>  create mode 100644 stubdom/vtpmmgr/log.c
>  create mode 100644 stubdom/vtpmmgr/log.h
>  create mode 100644 stubdom/vtpmmgr/marshal.h
>  create mode 100644 stubdom/vtpmmgr/minios.cfg
>  create mode 100644 stubdom/vtpmmgr/tcg.h
>  create mode 100644 stubdom/vtpmmgr/tpm.c
>  create mode 100644 stubdom/vtpmmgr/tpm.h
>  create mode 100644 stubdom/vtpmmgr/tpmrsa.c
>  create mode 100644 stubdom/vtpmmgr/tpmrsa.h
>  create mode 100644 stubdom/vtpmmgr/uuid.h
>  create mode 100644 stubdom/vtpmmgr/vtpm_cmd_handler.c
>  create mode 100644 stubdom/vtpmmgr/vtpm_manager.h
>  create mode 100644 stubdom/vtpmmgr/vtpm_storage.c
>  create mode 100644 stubdom/vtpmmgr/vtpm_storage.h
>  create mode 100644 stubdom/vtpmmgr/vtpmmgr.c
>  create mode 100644 stubdom/vtpmmgr/vtpmmgr.h
>  delete mode 100644 tools/libxen/include/xen/api/xen_vtpm.h
>  delete mode 100644 tools/libxen/include/xen/api/xen_vtpm_decl.h
>  delete mode 100644 tools/libxen/src/xen_vtpm.c
>  delete mode 100644 tools/python/xen/xend/server/tpmif.py
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 12:57:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 12:57:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaQuP-0000nH-CG; Mon, 19 Nov 2012 12:57:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaQuN-0000mt-RC
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 12:57:04 +0000
Received: from [85.158.139.83:56555] by server-10.bemta-5.messagelabs.com id
	7A/67-09257-E9C2AA05; Mon, 19 Nov 2012 12:57:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1353329821!30929370!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10352 invoked from network); 19 Nov 2012 12:57:01 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 12:57:01 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15878804"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 12:57:00 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 12:57:00 +0000
Message-ID: <1353329819.18229.83.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Mon, 19 Nov 2012 12:56:59 +0000
In-Reply-To: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 15:16 +0000, Matthew Fioravante wrote:
> THese are the remaining patches to add vtpm mini-os support to xen.
> Documentation internal review is taking a bit longer so I will
> send out a final patch with docs next week.
> 
> Matthew Fioravante (10):
>   fix bug in lseek for mini-os
>   Update mini-os license to support GPL features
>   Remove old vtpm support from xm
>   Remove VTPM_TOOLS from config/Tools.mk.in
>   Remove old vtpm stuff from tools/libxen
>   Remove tools/vtpm* from MAINTAINERS file

I have acked and applied all of these, although please see my reply to
"Remove old vtpm support from xm".

>   Regenerate configure script after removing vtpm

I think this wasn't necessary because you don't change configure.ac here
and I already refreshed configure after missing it after the update in
the last batch. I reran autogen.sh and didn't see any changes.

>   add vtpm-stubdom code
>   add stubdom/vtpmmgr code
>   vtpm/vtpmmgr and required libs to stubdom/Makefile

Applied these.

> 
>  MAINTAINERS                                  |    2 -
>  config/Tools.mk.in                           |    1 -
>  docs/man/xm.pod.1                            |   11 -
>  extras/mini-os/COPYING                       |   13 +
>  extras/mini-os/lib/sys.c                     |   67 +-
>  stubdom/Makefile                             |  138 +++-
>  stubdom/polarssl.patch                       |   64 ++
>  stubdom/tpmemu-0.7.4.patch                   |   12 +
>  stubdom/vtpm/Makefile                        |   37 +
>  stubdom/vtpm/minios.cfg                      |   14 +
>  stubdom/vtpm/vtpm.c                          |  404 +++++++++++
>  stubdom/vtpm/vtpm.h                          |   36 +
>  stubdom/vtpm/vtpm_cmd.c                      |  256 +++++++
>  stubdom/vtpm/vtpm_cmd.h                      |   31 +
>  stubdom/vtpm/vtpm_pcrs.c                     |   43 ++
>  stubdom/vtpm/vtpm_pcrs.h                     |   53 ++
>  stubdom/vtpm/vtpmblk.c                       |  307 +++++++++
>  stubdom/vtpm/vtpmblk.h                       |   31 +
>  stubdom/vtpmmgr/Makefile                     |   32 +
>  stubdom/vtpmmgr/init.c                       |  553 +++++++++++++++
>  stubdom/vtpmmgr/log.c                        |  151 +++++
>  stubdom/vtpmmgr/log.h                        |   85 +++
>  stubdom/vtpmmgr/marshal.h                    |  528 +++++++++++++++
>  stubdom/vtpmmgr/minios.cfg                   |   14 +
>  stubdom/vtpmmgr/tcg.h                        |  707 +++++++++++++++++++
>  stubdom/vtpmmgr/tpm.c                        |  938 ++++++++++++++++++++++++++
>  stubdom/vtpmmgr/tpm.h                        |  218 ++++++
>  stubdom/vtpmmgr/tpmrsa.c                     |  175 +++++
>  stubdom/vtpmmgr/tpmrsa.h                     |   67 ++
>  stubdom/vtpmmgr/uuid.h                       |   50 ++
>  stubdom/vtpmmgr/vtpm_cmd_handler.c           |  152 +++++
>  stubdom/vtpmmgr/vtpm_manager.h               |   64 ++
>  stubdom/vtpmmgr/vtpm_storage.c               |  783 +++++++++++++++++++++
>  stubdom/vtpmmgr/vtpm_storage.h               |   68 ++
>  stubdom/vtpmmgr/vtpmmgr.c                    |   93 +++
>  stubdom/vtpmmgr/vtpmmgr.h                    |   77 +++
>  tools/configure                              |  603 ++++++++---------
>  tools/libxen/include/xen/api/xen_all.h       |    1 -
>  tools/libxen/include/xen/api/xen_vm.h        |    9 -
>  tools/libxen/include/xen/api/xen_vtpm.h      |  218 ------
>  tools/libxen/include/xen/api/xen_vtpm_decl.h |   31 -
>  tools/libxen/src/xen_vm.c                    |   22 -
>  tools/libxen/src/xen_vtpm.c                  |  235 -------
>  tools/python/README.XendConfig               |    2 -
>  tools/python/README.sxpcfg                   |    4 -
>  tools/python/scripts/xapi.py                 |   20 -
>  tools/python/xen/xend/XendAPI.py             |  128 ----
>  tools/python/xen/xend/XendConfig.py          |   19 +-
>  tools/python/xen/xend/XendConstants.py       |    8 +-
>  tools/python/xen/xend/XendDevices.py         |    4 +-
>  tools/python/xen/xend/XendDomainInfo.py      |   29 -
>  tools/python/xen/xend/XendError.py           |    1 -
>  tools/python/xen/xend/XendOptions.py         |    4 -
>  tools/python/xen/xend/server/tpmif.py        |  141 ----
>  tools/python/xen/xend/tests/xend-config.sxp  |    2 -
>  tools/python/xen/xm/create.dtd               |    4 -
>  tools/python/xen/xm/create.py                |   69 --
>  tools/python/xen/xm/main.py                  |   37 -
>  tools/python/xen/xm/xenapi_create.py         |   39 --
>  59 files changed, 6535 insertions(+), 1370 deletions(-)
>  create mode 100644 stubdom/polarssl.patch
>  create mode 100644 stubdom/tpmemu-0.7.4.patch
>  create mode 100644 stubdom/vtpm/Makefile
>  create mode 100644 stubdom/vtpm/minios.cfg
>  create mode 100644 stubdom/vtpm/vtpm.c
>  create mode 100644 stubdom/vtpm/vtpm.h
>  create mode 100644 stubdom/vtpm/vtpm_cmd.c
>  create mode 100644 stubdom/vtpm/vtpm_cmd.h
>  create mode 100644 stubdom/vtpm/vtpm_pcrs.c
>  create mode 100644 stubdom/vtpm/vtpm_pcrs.h
>  create mode 100644 stubdom/vtpm/vtpmblk.c
>  create mode 100644 stubdom/vtpm/vtpmblk.h
>  create mode 100644 stubdom/vtpmmgr/Makefile
>  create mode 100644 stubdom/vtpmmgr/init.c
>  create mode 100644 stubdom/vtpmmgr/log.c
>  create mode 100644 stubdom/vtpmmgr/log.h
>  create mode 100644 stubdom/vtpmmgr/marshal.h
>  create mode 100644 stubdom/vtpmmgr/minios.cfg
>  create mode 100644 stubdom/vtpmmgr/tcg.h
>  create mode 100644 stubdom/vtpmmgr/tpm.c
>  create mode 100644 stubdom/vtpmmgr/tpm.h
>  create mode 100644 stubdom/vtpmmgr/tpmrsa.c
>  create mode 100644 stubdom/vtpmmgr/tpmrsa.h
>  create mode 100644 stubdom/vtpmmgr/uuid.h
>  create mode 100644 stubdom/vtpmmgr/vtpm_cmd_handler.c
>  create mode 100644 stubdom/vtpmmgr/vtpm_manager.h
>  create mode 100644 stubdom/vtpmmgr/vtpm_storage.c
>  create mode 100644 stubdom/vtpmmgr/vtpm_storage.h
>  create mode 100644 stubdom/vtpmmgr/vtpmmgr.c
>  create mode 100644 stubdom/vtpmmgr/vtpmmgr.h
>  delete mode 100644 tools/libxen/include/xen/api/xen_vtpm.h
>  delete mode 100644 tools/libxen/include/xen/api/xen_vtpm_decl.h
>  delete mode 100644 tools/libxen/src/xen_vtpm.c
>  delete mode 100644 tools/python/xen/xend/server/tpmif.py
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 13:00:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 13:00:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaQxQ-00016k-0B; Mon, 19 Nov 2012 13:00:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaQxO-00016c-OV
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 13:00:10 +0000
Received: from [85.158.139.83:31246] by server-3.bemta-5.messagelabs.com id
	97/63-18736-95D2AA05; Mon, 19 Nov 2012 13:00:09 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1353330009!30962390!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11678 invoked from network); 19 Nov 2012 13:00:09 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 13:00:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15878891"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 13:00:08 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 13:00:08 +0000
Message-ID: <1353330007.18229.85.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Pasi =?ISO-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
Date: Mon, 19 Nov 2012 13:00:07 +0000
In-Reply-To: <20121119124915.GS8912@reaktio.net>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352992629-5850-4-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353328024.18229.72.camel@zakaz.uk.xensource.com>
	<20121119124915.GS8912@reaktio.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>, George
	Dunlap <George.Dunlap@eu.citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 03/10] Remove old vtpm support from
	xm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gTW9uLCAyMDEyLTExLTE5IGF0IDEyOjQ5ICswMDAwLCBQYXNpIEvDpHJra8OkaW5lbiB3cm90
ZToKPiBIbW0uLiBJIGNhbiBvbmx5IHJlbWVtYmVyIG9uZSBvciB0d28gcGVvcGxlIGFza2luZyBm
b3IgdnRwbSBzdHVmZiBkdXJpbmcgcGFzdCBjb3VwbGUgb2YgeWVhcnMuCj4gU28gYmFzZWQgb24g
dGhhdCBJIGRvbid0IHRoaW5rIGl0J3MgYWN0aXZlbHkgdXNlZCBvdXQgdGhlcmUuLgoKR3JlYXQs
IHRoYW5rcyEKCj4gT3IgdGhlbiBpdCB3b3JrcyB2ZXJ5IHdlbGwgYW5kIHBlb3BsZSBkb24ndCBu
ZWVkIHRvIGFzayBhYm91dCBpdCA7KQoKSGF2aW5nIGxvb2tlZCBhdCB0aGUgY29kZSB3aGlsZSBy
ZXZpZXdpbmcgTWF0dGhldydzIGVhcmxpZXIgcGF0Y2hlcyBJCnRoaW5rIHdlIGNhbiBiZSBwcmV0
dHkgY29uZmlkZW50IHRoaXMgaXNuJ3QgdGhlIGNhc2UhCgpJYW4uCgoKCl9fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QK
WGVuLWRldmVsQGxpc3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Mon Nov 19 13:00:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 13:00:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaQxQ-00016k-0B; Mon, 19 Nov 2012 13:00:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaQxO-00016c-OV
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 13:00:10 +0000
Received: from [85.158.139.83:31246] by server-3.bemta-5.messagelabs.com id
	97/63-18736-95D2AA05; Mon, 19 Nov 2012 13:00:09 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1353330009!30962390!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11678 invoked from network); 19 Nov 2012 13:00:09 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 13:00:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15878891"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 13:00:08 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 13:00:08 +0000
Message-ID: <1353330007.18229.85.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Pasi =?ISO-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
Date: Mon, 19 Nov 2012 13:00:07 +0000
In-Reply-To: <20121119124915.GS8912@reaktio.net>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352992629-5850-4-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353328024.18229.72.camel@zakaz.uk.xensource.com>
	<20121119124915.GS8912@reaktio.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>, George
	Dunlap <George.Dunlap@eu.citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 03/10] Remove old vtpm support from
	xm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gTW9uLCAyMDEyLTExLTE5IGF0IDEyOjQ5ICswMDAwLCBQYXNpIEvDpHJra8OkaW5lbiB3cm90
ZToKPiBIbW0uLiBJIGNhbiBvbmx5IHJlbWVtYmVyIG9uZSBvciB0d28gcGVvcGxlIGFza2luZyBm
b3IgdnRwbSBzdHVmZiBkdXJpbmcgcGFzdCBjb3VwbGUgb2YgeWVhcnMuCj4gU28gYmFzZWQgb24g
dGhhdCBJIGRvbid0IHRoaW5rIGl0J3MgYWN0aXZlbHkgdXNlZCBvdXQgdGhlcmUuLgoKR3JlYXQs
IHRoYW5rcyEKCj4gT3IgdGhlbiBpdCB3b3JrcyB2ZXJ5IHdlbGwgYW5kIHBlb3BsZSBkb24ndCBu
ZWVkIHRvIGFzayBhYm91dCBpdCA7KQoKSGF2aW5nIGxvb2tlZCBhdCB0aGUgY29kZSB3aGlsZSBy
ZXZpZXdpbmcgTWF0dGhldydzIGVhcmxpZXIgcGF0Y2hlcyBJCnRoaW5rIHdlIGNhbiBiZSBwcmV0
dHkgY29uZmlkZW50IHRoaXMgaXNuJ3QgdGhlIGNhc2UhCgpJYW4uCgoKCl9fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QK
WGVuLWRldmVsQGxpc3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Mon Nov 19 13:08:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 13:08:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaR5V-0001Kt-0V; Mon, 19 Nov 2012 13:08:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TaR5T-0001Ko-1R
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 13:08:31 +0000
Received: from [85.158.138.51:38815] by server-14.bemta-3.messagelabs.com id
	5F/B1-12788-E4F2AA05; Mon, 19 Nov 2012 13:08:30 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353330509!30550243!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10605 invoked from network); 19 Nov 2012 13:08:29 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-8.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 19 Nov 2012 13:08:29 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TaR5O-0008pg-Dc; Mon, 19 Nov 2012 13:08:26 +0000
Date: Mon, 19 Nov 2012 13:08:26 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121119130826.GB31411@ocelot.phlegethon.org>
References: <1353080578-1487-1-git-send-email-stefano.stabellini@eu.citrix.com>
	<1353329757.18229.81.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353329757.18229.81.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH v3] xen/arm: flush D-cache and I-cache when
	appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Sorry for the late review - I meant to get to these on Thursday but
hadn't time.  

At 12:55 +0000 on 19 Nov (1353329757), Ian Campbell wrote:
> > +/* Macro for flushing a single small item.  The predicate is always 
> > + * compile-time constant so this will compile down to 3 instructions in
> > + * the common case. 

This is no longer true!  The predicate now depends on the alignment of
the pointer, so this will compile to quite a bit of code, including the
memory barrier I was trying to avoid.

If we can sensibly restrict this to naturally-aligned objects smaller
than a cacheline, we should go back to the previous version of this
macro.  If not, I think we might as well just use
flush_xen_dcache_va_range(_p, sizeof *_p) and be done with it.

Tim.

> >                       Make sure to call it with the correct type of
> > + * pointer! */
> > +#define flush_xen_dcache_va(p) do {                                     \
> > +    int cacheline_bytes  = READ_CP32(CCSIDR);                           \
> > +    typeof(p) _p = (p);                                                 \
> > +    if ( ((unsigned long)_p & ~(cacheline_bytes - 1)) !=                \
> > +        (((unsigned long)_p + (sizeof *_p)) & ~(cacheline_bytes - 1)) ) \
> > +        flush_xen_dcache_va_range(_p, sizeof *_p);                      \
> > +    else                                                                \
> > +        asm volatile (                                                  \
> > +            "dsb;"   /* Finish all earlier writes */                    \
> > +            STORE_CP32(0, DCCMVAC)                                      \
> > +            "dsb;"   /* Finish flush before continuing */               \
> > +            : : "r" (_p), "m" (*_p));                                   \
> > +} while (0)
> > +
> > +
> >  /*
> >   * Flush all hypervisor mappings from the TLB and branch predictor.
> > - * This is needed after changing Xen code mappings. 
> > + * This is needed after changing Xen code mappings.
> > + *
> > + * The caller needs to issue the necessary DSB and D-cache flushes
> > + * before calling flush_xen_text_tlb.
> >   */
> >  static inline void flush_xen_text_tlb(void)
> >  {
> >      register unsigned long r0 asm ("r0");
> >      asm volatile (
> > -        "dsb;"                        /* Ensure visibility of PTE writes */
> > +        "isb;"                        /* Ensure synchronization with previous changes to text */
> >          STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
> > +        STORE_CP32(0, ICIALLU)        /* Flush I-cache */
> >          STORE_CP32(0, BPIALL)         /* Flush branch predictor */
> >          "dsb;"                        /* Ensure completion of TLB+BP flush */
> >          "isb;"
> 
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 13:08:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 13:08:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaR5V-0001Kt-0V; Mon, 19 Nov 2012 13:08:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TaR5T-0001Ko-1R
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 13:08:31 +0000
Received: from [85.158.138.51:38815] by server-14.bemta-3.messagelabs.com id
	5F/B1-12788-E4F2AA05; Mon, 19 Nov 2012 13:08:30 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353330509!30550243!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10605 invoked from network); 19 Nov 2012 13:08:29 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-8.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 19 Nov 2012 13:08:29 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TaR5O-0008pg-Dc; Mon, 19 Nov 2012 13:08:26 +0000
Date: Mon, 19 Nov 2012 13:08:26 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121119130826.GB31411@ocelot.phlegethon.org>
References: <1353080578-1487-1-git-send-email-stefano.stabellini@eu.citrix.com>
	<1353329757.18229.81.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353329757.18229.81.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH v3] xen/arm: flush D-cache and I-cache when
	appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Sorry for the late review - I meant to get to these on Thursday but
hadn't time.  

At 12:55 +0000 on 19 Nov (1353329757), Ian Campbell wrote:
> > +/* Macro for flushing a single small item.  The predicate is always 
> > + * compile-time constant so this will compile down to 3 instructions in
> > + * the common case. 

This is no longer true!  The predicate now depends on the alignment of
the pointer, so this will compile to quite a bit of code, including the
memory barrier I was trying to avoid.

If we can sensibly restrict this to naturally-aligned objects smaller
than a cacheline, we should go back to the previous version of this
macro.  If not, I think we might as well just use
flush_xen_dcache_va_range(_p, sizeof *_p) and be done with it.

Tim.

> >                       Make sure to call it with the correct type of
> > + * pointer! */
> > +#define flush_xen_dcache_va(p) do {                                     \
> > +    int cacheline_bytes  = READ_CP32(CCSIDR);                           \
> > +    typeof(p) _p = (p);                                                 \
> > +    if ( ((unsigned long)_p & ~(cacheline_bytes - 1)) !=                \
> > +        (((unsigned long)_p + (sizeof *_p)) & ~(cacheline_bytes - 1)) ) \
> > +        flush_xen_dcache_va_range(_p, sizeof *_p);                      \
> > +    else                                                                \
> > +        asm volatile (                                                  \
> > +            "dsb;"   /* Finish all earlier writes */                    \
> > +            STORE_CP32(0, DCCMVAC)                                      \
> > +            "dsb;"   /* Finish flush before continuing */               \
> > +            : : "r" (_p), "m" (*_p));                                   \
> > +} while (0)
> > +
> > +
> >  /*
> >   * Flush all hypervisor mappings from the TLB and branch predictor.
> > - * This is needed after changing Xen code mappings. 
> > + * This is needed after changing Xen code mappings.
> > + *
> > + * The caller needs to issue the necessary DSB and D-cache flushes
> > + * before calling flush_xen_text_tlb.
> >   */
> >  static inline void flush_xen_text_tlb(void)
> >  {
> >      register unsigned long r0 asm ("r0");
> >      asm volatile (
> > -        "dsb;"                        /* Ensure visibility of PTE writes */
> > +        "isb;"                        /* Ensure synchronization with previous changes to text */
> >          STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
> > +        STORE_CP32(0, ICIALLU)        /* Flush I-cache */
> >          STORE_CP32(0, BPIALL)         /* Flush branch predictor */
> >          "dsb;"                        /* Ensure completion of TLB+BP flush */
> >          "isb;"
> 
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 13:33:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 13:33:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaRTY-0001XL-US; Mon, 19 Nov 2012 13:33:24 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TaRTW-0001XC-Tx
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 13:33:23 +0000
Received: from [193.109.254.147:19273] by server-14.bemta-14.messagelabs.com
	id 50/4A-14517-2253AA05; Mon, 19 Nov 2012 13:33:22 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1353332000!4659631!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcyNzU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6800 invoked from network); 19 Nov 2012 13:33:21 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 13:33:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="214916994"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 13:33:19 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 08:33:19 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TaRTT-0005AU-5w;
	Mon, 19 Nov 2012 13:33:19 +0000
Message-ID: <50AA351F.5030301@citrix.com>
Date: Mon, 19 Nov 2012 13:33:19 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <jbeulich@suse.com>, Wei Wang <wei.wang2@amd.com>
X-Enigmail-Version: 1.4.6
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: [Xen-devel] Concern about AMD IOMMU HPET msi remapping
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

In the committed patch
http://xenbits.xen.org/hg/staging/xen-unstable.hg/rev/9025a10c0561

The bdf parameter to update_intremap_entry_from_msi_msg() is declared as
u8.  The single caller of this function passes bdf as an int (which is
only ever filled with a u16), while the this function passes bdf to
get_{dma,intremap}_requestor_id(), which expect u16's

Is there not a truncation issue by doing this, or am I missing something?

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 13:33:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 13:33:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaRTY-0001XL-US; Mon, 19 Nov 2012 13:33:24 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TaRTW-0001XC-Tx
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 13:33:23 +0000
Received: from [193.109.254.147:19273] by server-14.bemta-14.messagelabs.com
	id 50/4A-14517-2253AA05; Mon, 19 Nov 2012 13:33:22 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1353332000!4659631!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcyNzU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6800 invoked from network); 19 Nov 2012 13:33:21 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 13:33:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="214916994"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 13:33:19 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 08:33:19 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TaRTT-0005AU-5w;
	Mon, 19 Nov 2012 13:33:19 +0000
Message-ID: <50AA351F.5030301@citrix.com>
Date: Mon, 19 Nov 2012 13:33:19 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <jbeulich@suse.com>, Wei Wang <wei.wang2@amd.com>
X-Enigmail-Version: 1.4.6
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: [Xen-devel] Concern about AMD IOMMU HPET msi remapping
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

In the committed patch
http://xenbits.xen.org/hg/staging/xen-unstable.hg/rev/9025a10c0561

The bdf parameter to update_intremap_entry_from_msi_msg() is declared as
u8.  The single caller of this function passes bdf as an int (which is
only ever filled with a u16), while the this function passes bdf to
get_{dma,intremap}_requestor_id(), which expect u16's

Is there not a truncation issue by doing this, or am I missing something?

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 13:51:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 13:51:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaRkr-0001zX-JO; Mon, 19 Nov 2012 13:51:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaRkq-0001zR-L3
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 13:51:16 +0000
Received: from [85.158.143.99:22993] by server-1.bemta-4.messagelabs.com id
	42/E1-27934-4593AA05; Mon, 19 Nov 2012 13:51:16 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353333072!23472635!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26615 invoked from network); 19 Nov 2012 13:51:14 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 13:51:14 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157591565;
	Mon, 19 Nov 2012 08:50:53 -0500
Message-ID: <50AA393A.5050505@jhuapl.edu>
Date: Mon, 19 Nov 2012 08:50:50 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352992629-5850-4-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353328024.18229.72.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353328024.18229.72.camel@zakaz.uk.xensource.com>
Cc: "george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 03/10] Remove old vtpm support from
	xm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3310616696759634650=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============3310616696759634650==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms090805070503080100060706"

This is a cryptographically signed message in MIME format.

--------------ms090805070503080100060706
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Well I think you could keep the original removal patch and just not=20
apply this one if you don't want to mess with xm and xend. The original=20
patch doesn't touch xm or xend and just removes the vtpm and=20
vtpm_manager code. The only reason I'm more inclined to remove all of=20
the old vtpm stuff is because its going to be confusing for users=20
grepping through the tree trying to figure out how to use vtpm.

On 11/19/2012 07:27 AM, Ian Campbell wrote:
> On Thu, 2012-11-15 at 15:17 +0000, Matthew Fioravante wrote:
>> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>> ---
>>   docs/man/xm.pod.1                           |   11 ---
>>   tools/python/README.XendConfig              |    2 -
>>   tools/python/README.sxpcfg                  |    4 -
>>   tools/python/scripts/xapi.py                |   20 ----
>>   tools/python/xen/xend/XendAPI.py            |  128 -----------------=
-------
>>   tools/python/xen/xend/XendConfig.py         |   19 +---
>>   tools/python/xen/xend/XendConstants.py      |    8 +-
>>   tools/python/xen/xend/XendDevices.py        |    4 +-
>>   tools/python/xen/xend/XendDomainInfo.py     |   29 ------
>>   tools/python/xen/xend/XendError.py          |    1 -
>>   tools/python/xen/xend/XendOptions.py        |    4 -
>>   tools/python/xen/xend/server/tpmif.py       |  141 -----------------=
----------
>>   tools/python/xen/xend/tests/xend-config.sxp |    2 -
>>   tools/python/xen/xm/create.dtd              |    4 -
>>   tools/python/xen/xm/create.py               |   69 -------------
>>   tools/python/xen/xm/main.py                 |   37 -------
>>   tools/python/xen/xm/xenapi_create.py        |   39 --------
>>   17 files changed, 4 insertions(+), 518 deletions(-)
>>   delete mode 100644 tools/python/xen/xend/server/tpmif.py
> I know I guided you down this path in the first place but I'm starting
> to wonder if removing the process model is/was the right thing to do fo=
r
> xend. It's one thing for xend to be deprecated and unmaintained, but
> actively removing features is a bit more than that.
>
> Looking back at 26144:170d45f7a2eb I see in the commit message:
>          Remove the old vtpm process model. It doesn't work very well a=
nd
>          is no longer supported.
>
> Also looking back in the previous mail threads I see:
>          The vtpm_manager code is full of bugs and actually needs a
>          complete rewrite. The amount of careless memory leaks and othe=
r
>          bugs I found when trying to use it were pretty astounding. The=

>          first manager patch fixes most of the ones I could find to get=

>          the manager to work properly.
>         =20
>          The managers current form in the xen tree is actually pretty
>          unusable. I don't have time to rewrite the manager, but what I=
'm
>          offering here is at least a huge improvement over the old code=
=2E
>         =20
> and also:
>          I don't know if there is anyone who would want to still use
>          vtpms as
>          processes when the stub domains are now available. Security
>          research
>          people like the domain model because it guarantees a better
>          separation of components guaranteed by the hypervisor and
>          doesn't have to trust the dom0 OS.
>
> Which suggests that the number of people using the process model stuff
> with xend is likely to be indistinguishable from zero. Do you have any
> idea if there is anyone actually using it?
>
> In any case it does seem like anyone who is using the vtpm with xend is=

> playing with fire since it is unmaintained and full of bugs, which isn'=
t
> a good thing in a component which is supposed to be *increasing*
> security.
>
> Daniel/Pasi, I've CCd you since I thought you might have some insights
> into how much use the process model vtpm stuff in xend is getting in th=
e
> field etc.
>
> BTW I'm not suggesting that we (or you) maintain or even update the
> process model stuff or xm/xend, just that we leave it as it was (i.e. i=
n
> a poor state + lagging behind the libxl based stubdom stuff) until xend=

> fully goes away.
>
> Anyhow, since we need to revert 26144:170d45f7a2eb if we decide to go
> back on this decision I'm going to apply this anyway, what's one more
> revert ;-). Same applies to a bunch of the following patches which buil=
d
> on this removal.
>
> Ian
>




--------------ms090805070503080100060706
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo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JBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTExOTEzNTA1MFowIwYJKoZIhvcNAQkEMRYEFJaT4GNSKJ6ZZe1D
drui1hY/u5OzMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYA7tMNLfMBJjZyV7kLnnOMFi0YM+D9X3WQe
/YIotnx8lV4qRh0oQMVp9gOhWp/I7EBcrOYx4tmjxWOWTY/U0AMDcu0DYjg/M0fk68OR+A5K
ymcEpQ17/v4iIlli+948wRbio+eyp+dw/KBGVC/9JdZtkGbYh7Ry8/+JWuH7q5VXSQAAAAAA
AA==
--------------ms090805070503080100060706--


--===============3310616696759634650==
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.xen.org
http://lists.xen.org/xen-devel

--===============3310616696759634650==--


From xen-devel-bounces@lists.xen.org Mon Nov 19 13:51:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 13:51:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaRkr-0001zX-JO; Mon, 19 Nov 2012 13:51:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaRkq-0001zR-L3
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 13:51:16 +0000
Received: from [85.158.143.99:22993] by server-1.bemta-4.messagelabs.com id
	42/E1-27934-4593AA05; Mon, 19 Nov 2012 13:51:16 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353333072!23472635!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26615 invoked from network); 19 Nov 2012 13:51:14 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 13:51:14 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157591565;
	Mon, 19 Nov 2012 08:50:53 -0500
Message-ID: <50AA393A.5050505@jhuapl.edu>
Date: Mon, 19 Nov 2012 08:50:50 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352992629-5850-4-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353328024.18229.72.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353328024.18229.72.camel@zakaz.uk.xensource.com>
Cc: "george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 03/10] Remove old vtpm support from
	xm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3310616696759634650=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============3310616696759634650==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms090805070503080100060706"

This is a cryptographically signed message in MIME format.

--------------ms090805070503080100060706
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Well I think you could keep the original removal patch and just not=20
apply this one if you don't want to mess with xm and xend. The original=20
patch doesn't touch xm or xend and just removes the vtpm and=20
vtpm_manager code. The only reason I'm more inclined to remove all of=20
the old vtpm stuff is because its going to be confusing for users=20
grepping through the tree trying to figure out how to use vtpm.

On 11/19/2012 07:27 AM, Ian Campbell wrote:
> On Thu, 2012-11-15 at 15:17 +0000, Matthew Fioravante wrote:
>> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>> ---
>>   docs/man/xm.pod.1                           |   11 ---
>>   tools/python/README.XendConfig              |    2 -
>>   tools/python/README.sxpcfg                  |    4 -
>>   tools/python/scripts/xapi.py                |   20 ----
>>   tools/python/xen/xend/XendAPI.py            |  128 -----------------=
-------
>>   tools/python/xen/xend/XendConfig.py         |   19 +---
>>   tools/python/xen/xend/XendConstants.py      |    8 +-
>>   tools/python/xen/xend/XendDevices.py        |    4 +-
>>   tools/python/xen/xend/XendDomainInfo.py     |   29 ------
>>   tools/python/xen/xend/XendError.py          |    1 -
>>   tools/python/xen/xend/XendOptions.py        |    4 -
>>   tools/python/xen/xend/server/tpmif.py       |  141 -----------------=
----------
>>   tools/python/xen/xend/tests/xend-config.sxp |    2 -
>>   tools/python/xen/xm/create.dtd              |    4 -
>>   tools/python/xen/xm/create.py               |   69 -------------
>>   tools/python/xen/xm/main.py                 |   37 -------
>>   tools/python/xen/xm/xenapi_create.py        |   39 --------
>>   17 files changed, 4 insertions(+), 518 deletions(-)
>>   delete mode 100644 tools/python/xen/xend/server/tpmif.py
> I know I guided you down this path in the first place but I'm starting
> to wonder if removing the process model is/was the right thing to do fo=
r
> xend. It's one thing for xend to be deprecated and unmaintained, but
> actively removing features is a bit more than that.
>
> Looking back at 26144:170d45f7a2eb I see in the commit message:
>          Remove the old vtpm process model. It doesn't work very well a=
nd
>          is no longer supported.
>
> Also looking back in the previous mail threads I see:
>          The vtpm_manager code is full of bugs and actually needs a
>          complete rewrite. The amount of careless memory leaks and othe=
r
>          bugs I found when trying to use it were pretty astounding. The=

>          first manager patch fixes most of the ones I could find to get=

>          the manager to work properly.
>         =20
>          The managers current form in the xen tree is actually pretty
>          unusable. I don't have time to rewrite the manager, but what I=
'm
>          offering here is at least a huge improvement over the old code=
=2E
>         =20
> and also:
>          I don't know if there is anyone who would want to still use
>          vtpms as
>          processes when the stub domains are now available. Security
>          research
>          people like the domain model because it guarantees a better
>          separation of components guaranteed by the hypervisor and
>          doesn't have to trust the dom0 OS.
>
> Which suggests that the number of people using the process model stuff
> with xend is likely to be indistinguishable from zero. Do you have any
> idea if there is anyone actually using it?
>
> In any case it does seem like anyone who is using the vtpm with xend is=

> playing with fire since it is unmaintained and full of bugs, which isn'=
t
> a good thing in a component which is supposed to be *increasing*
> security.
>
> Daniel/Pasi, I've CCd you since I thought you might have some insights
> into how much use the process model vtpm stuff in xend is getting in th=
e
> field etc.
>
> BTW I'm not suggesting that we (or you) maintain or even update the
> process model stuff or xm/xend, just that we leave it as it was (i.e. i=
n
> a poor state + lagging behind the libxl based stubdom stuff) until xend=

> fully goes away.
>
> Anyhow, since we need to revert 26144:170d45f7a2eb if we decide to go
> back on this decision I'm going to apply this anyway, what's one more
> revert ;-). Same applies to a bunch of the following patches which buil=
d
> on this removal.
>
> Ian
>




--------------ms090805070503080100060706
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlCwMBAQEBBAoWCGZpb3JhbWUxMBsGDSsGAQQBsyUL
AwEBAQIEChIIMDAxMDQyNjEwWAYJYIZIAYb6ax4BBEsMSVRoZSBwcml2YXRlIGtleSBjb3Jy
ZXNwb25kaW5nIHRvIHRoaXMgY2VydGlmaWNhdGUgbWF5IGhhdmUgYmVlbiBleHBvcnRlZC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+948wRbio+eyp+dw/KBGVC/9JdZtkGbYh7Ry8/+JWuH7q5VXSQAAAAAA
AA==
--------------ms090805070503080100060706--


--===============3310616696759634650==
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.xen.org
http://lists.xen.org/xen-devel

--===============3310616696759634650==--


From xen-devel-bounces@lists.xen.org Mon Nov 19 13:52:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 13:52:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaRlp-000236-28; Mon, 19 Nov 2012 13:52:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaRln-00022r-Dk
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 13:52:15 +0000
Received: from [85.158.138.51:29806] by server-16.bemta-3.messagelabs.com id
	13/F8-07461-E893AA05; Mon, 19 Nov 2012 13:52:14 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-7.tower-174.messagelabs.com!1353333131!21716743!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14036 invoked from network); 19 Nov 2012 13:52:12 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-7.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 13:52:12 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157591718;
	Mon, 19 Nov 2012 08:52:07 -0500
Message-ID: <50AA3984.4060903@jhuapl.edu>
Date: Mon, 19 Nov 2012 08:52:04 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353329819.18229.83.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2003213384357243142=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============2003213384357243142==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms090103040604070700040502"

This is a cryptographically signed message in MIME format.

--------------ms090103040604070700040502
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/19/2012 07:56 AM, Ian Campbell wrote:
> On Thu, 2012-11-15 at 15:16 +0000, Matthew Fioravante wrote:
>> THese are the remaining patches to add vtpm mini-os support to xen.
>> Documentation internal review is taking a bit longer so I will
>> send out a final patch with docs next week.
>>
>> Matthew Fioravante (10):
>>    fix bug in lseek for mini-os
>>    Update mini-os license to support GPL features
>>    Remove old vtpm support from xm
>>    Remove VTPM_TOOLS from config/Tools.mk.in
>>    Remove old vtpm stuff from tools/libxen
>>    Remove tools/vtpm* from MAINTAINERS file
> I have acked and applied all of these, although please see my reply to
> "Remove old vtpm support from xm".
>
>>    Regenerate configure script after removing vtpm
> I think this wasn't necessary because you don't change configure.ac her=
e
> and I already refreshed configure after missing it after the update in
> the last batch. I reran autogen.sh and didn't see any changes.
After I submitted this one I saw that you went ahead and ran autoconf=20
yourself. So yes this patch is redundant.
>
>>    add vtpm-stubdom code
>>    add stubdom/vtpmmgr code
>>    vtpm/vtpmmgr and required libs to stubdom/Makefile
> Applied these.
Great! :)
>
>>   MAINTAINERS                                  |    2 -
>>   config/Tools.mk.in                           |    1 -
>>   docs/man/xm.pod.1                            |   11 -
>>   extras/mini-os/COPYING                       |   13 +
>>   extras/mini-os/lib/sys.c                     |   67 +-
>>   stubdom/Makefile                             |  138 +++-
>>   stubdom/polarssl.patch                       |   64 ++
>>   stubdom/tpmemu-0.7.4.patch                   |   12 +
>>   stubdom/vtpm/Makefile                        |   37 +
>>   stubdom/vtpm/minios.cfg                      |   14 +
>>   stubdom/vtpm/vtpm.c                          |  404 +++++++++++
>>   stubdom/vtpm/vtpm.h                          |   36 +
>>   stubdom/vtpm/vtpm_cmd.c                      |  256 +++++++
>>   stubdom/vtpm/vtpm_cmd.h                      |   31 +
>>   stubdom/vtpm/vtpm_pcrs.c                     |   43 ++
>>   stubdom/vtpm/vtpm_pcrs.h                     |   53 ++
>>   stubdom/vtpm/vtpmblk.c                       |  307 +++++++++
>>   stubdom/vtpm/vtpmblk.h                       |   31 +
>>   stubdom/vtpmmgr/Makefile                     |   32 +
>>   stubdom/vtpmmgr/init.c                       |  553 +++++++++++++++
>>   stubdom/vtpmmgr/log.c                        |  151 +++++
>>   stubdom/vtpmmgr/log.h                        |   85 +++
>>   stubdom/vtpmmgr/marshal.h                    |  528 +++++++++++++++
>>   stubdom/vtpmmgr/minios.cfg                   |   14 +
>>   stubdom/vtpmmgr/tcg.h                        |  707 ++++++++++++++++=
+++
>>   stubdom/vtpmmgr/tpm.c                        |  938 ++++++++++++++++=
++++++++++
>>   stubdom/vtpmmgr/tpm.h                        |  218 ++++++
>>   stubdom/vtpmmgr/tpmrsa.c                     |  175 +++++
>>   stubdom/vtpmmgr/tpmrsa.h                     |   67 ++
>>   stubdom/vtpmmgr/uuid.h                       |   50 ++
>>   stubdom/vtpmmgr/vtpm_cmd_handler.c           |  152 +++++
>>   stubdom/vtpmmgr/vtpm_manager.h               |   64 ++
>>   stubdom/vtpmmgr/vtpm_storage.c               |  783 ++++++++++++++++=
+++++
>>   stubdom/vtpmmgr/vtpm_storage.h               |   68 ++
>>   stubdom/vtpmmgr/vtpmmgr.c                    |   93 +++
>>   stubdom/vtpmmgr/vtpmmgr.h                    |   77 +++
>>   tools/configure                              |  603 ++++++++--------=
-
>>   tools/libxen/include/xen/api/xen_all.h       |    1 -
>>   tools/libxen/include/xen/api/xen_vm.h        |    9 -
>>   tools/libxen/include/xen/api/xen_vtpm.h      |  218 ------
>>   tools/libxen/include/xen/api/xen_vtpm_decl.h |   31 -
>>   tools/libxen/src/xen_vm.c                    |   22 -
>>   tools/libxen/src/xen_vtpm.c                  |  235 -------
>>   tools/python/README.XendConfig               |    2 -
>>   tools/python/README.sxpcfg                   |    4 -
>>   tools/python/scripts/xapi.py                 |   20 -
>>   tools/python/xen/xend/XendAPI.py             |  128 ----
>>   tools/python/xen/xend/XendConfig.py          |   19 +-
>>   tools/python/xen/xend/XendConstants.py       |    8 +-
>>   tools/python/xen/xend/XendDevices.py         |    4 +-
>>   tools/python/xen/xend/XendDomainInfo.py      |   29 -
>>   tools/python/xen/xend/XendError.py           |    1 -
>>   tools/python/xen/xend/XendOptions.py         |    4 -
>>   tools/python/xen/xend/server/tpmif.py        |  141 ----
>>   tools/python/xen/xend/tests/xend-config.sxp  |    2 -
>>   tools/python/xen/xm/create.dtd               |    4 -
>>   tools/python/xen/xm/create.py                |   69 --
>>   tools/python/xen/xm/main.py                  |   37 -
>>   tools/python/xen/xm/xenapi_create.py         |   39 --
>>   59 files changed, 6535 insertions(+), 1370 deletions(-)
>>   create mode 100644 stubdom/polarssl.patch
>>   create mode 100644 stubdom/tpmemu-0.7.4.patch
>>   create mode 100644 stubdom/vtpm/Makefile
>>   create mode 100644 stubdom/vtpm/minios.cfg
>>   create mode 100644 stubdom/vtpm/vtpm.c
>>   create mode 100644 stubdom/vtpm/vtpm.h
>>   create mode 100644 stubdom/vtpm/vtpm_cmd.c
>>   create mode 100644 stubdom/vtpm/vtpm_cmd.h
>>   create mode 100644 stubdom/vtpm/vtpm_pcrs.c
>>   create mode 100644 stubdom/vtpm/vtpm_pcrs.h
>>   create mode 100644 stubdom/vtpm/vtpmblk.c
>>   create mode 100644 stubdom/vtpm/vtpmblk.h
>>   create mode 100644 stubdom/vtpmmgr/Makefile
>>   create mode 100644 stubdom/vtpmmgr/init.c
>>   create mode 100644 stubdom/vtpmmgr/log.c
>>   create mode 100644 stubdom/vtpmmgr/log.h
>>   create mode 100644 stubdom/vtpmmgr/marshal.h
>>   create mode 100644 stubdom/vtpmmgr/minios.cfg
>>   create mode 100644 stubdom/vtpmmgr/tcg.h
>>   create mode 100644 stubdom/vtpmmgr/tpm.c
>>   create mode 100644 stubdom/vtpmmgr/tpm.h
>>   create mode 100644 stubdom/vtpmmgr/tpmrsa.c
>>   create mode 100644 stubdom/vtpmmgr/tpmrsa.h
>>   create mode 100644 stubdom/vtpmmgr/uuid.h
>>   create mode 100644 stubdom/vtpmmgr/vtpm_cmd_handler.c
>>   create mode 100644 stubdom/vtpmmgr/vtpm_manager.h
>>   create mode 100644 stubdom/vtpmmgr/vtpm_storage.c
>>   create mode 100644 stubdom/vtpmmgr/vtpm_storage.h
>>   create mode 100644 stubdom/vtpmmgr/vtpmmgr.c
>>   create mode 100644 stubdom/vtpmmgr/vtpmmgr.h
>>   delete mode 100644 tools/libxen/include/xen/api/xen_vtpm.h
>>   delete mode 100644 tools/libxen/include/xen/api/xen_vtpm_decl.h
>>   delete mode 100644 tools/libxen/src/xen_vtpm.c
>>   delete mode 100644 tools/python/xen/xend/server/tpmif.py
>>
>



--------------ms090103040604070700040502
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlCwMBAQEBBAoWCGZpb3JhbWUxMBsGDSsGAQQBsyUL
AwEBAQIEChIIMDAxMDQyNjEwWAYJYIZIAYb6ax4BBEsMSV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zs1M3
UcyKmaghvXhFe8YZDJXuwCKaTnciYfVVK2a1FWmI8LnuEKd6V57sqGlA0e8k5DXiyjtG94YJ
I3Jd366ydyjFtHGpuNHfSq5AfgDK+tRO7tMSOytoyHm6GRFUsYYYWqcVepONe4GrkAAAAAAA
AA==
--------------ms090103040604070700040502--


--===============2003213384357243142==
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.xen.org
http://lists.xen.org/xen-devel

--===============2003213384357243142==--


From xen-devel-bounces@lists.xen.org Mon Nov 19 13:52:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 13:52:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaRlp-000236-28; Mon, 19 Nov 2012 13:52:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaRln-00022r-Dk
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 13:52:15 +0000
Received: from [85.158.138.51:29806] by server-16.bemta-3.messagelabs.com id
	13/F8-07461-E893AA05; Mon, 19 Nov 2012 13:52:14 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-7.tower-174.messagelabs.com!1353333131!21716743!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14036 invoked from network); 19 Nov 2012 13:52:12 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-7.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 13:52:12 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157591718;
	Mon, 19 Nov 2012 08:52:07 -0500
Message-ID: <50AA3984.4060903@jhuapl.edu>
Date: Mon, 19 Nov 2012 08:52:04 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353329819.18229.83.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2003213384357243142=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============2003213384357243142==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms090103040604070700040502"

This is a cryptographically signed message in MIME format.

--------------ms090103040604070700040502
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/19/2012 07:56 AM, Ian Campbell wrote:
> On Thu, 2012-11-15 at 15:16 +0000, Matthew Fioravante wrote:
>> THese are the remaining patches to add vtpm mini-os support to xen.
>> Documentation internal review is taking a bit longer so I will
>> send out a final patch with docs next week.
>>
>> Matthew Fioravante (10):
>>    fix bug in lseek for mini-os
>>    Update mini-os license to support GPL features
>>    Remove old vtpm support from xm
>>    Remove VTPM_TOOLS from config/Tools.mk.in
>>    Remove old vtpm stuff from tools/libxen
>>    Remove tools/vtpm* from MAINTAINERS file
> I have acked and applied all of these, although please see my reply to
> "Remove old vtpm support from xm".
>
>>    Regenerate configure script after removing vtpm
> I think this wasn't necessary because you don't change configure.ac her=
e
> and I already refreshed configure after missing it after the update in
> the last batch. I reran autogen.sh and didn't see any changes.
After I submitted this one I saw that you went ahead and ran autoconf=20
yourself. So yes this patch is redundant.
>
>>    add vtpm-stubdom code
>>    add stubdom/vtpmmgr code
>>    vtpm/vtpmmgr and required libs to stubdom/Makefile
> Applied these.
Great! :)
>
>>   MAINTAINERS                                  |    2 -
>>   config/Tools.mk.in                           |    1 -
>>   docs/man/xm.pod.1                            |   11 -
>>   extras/mini-os/COPYING                       |   13 +
>>   extras/mini-os/lib/sys.c                     |   67 +-
>>   stubdom/Makefile                             |  138 +++-
>>   stubdom/polarssl.patch                       |   64 ++
>>   stubdom/tpmemu-0.7.4.patch                   |   12 +
>>   stubdom/vtpm/Makefile                        |   37 +
>>   stubdom/vtpm/minios.cfg                      |   14 +
>>   stubdom/vtpm/vtpm.c                          |  404 +++++++++++
>>   stubdom/vtpm/vtpm.h                          |   36 +
>>   stubdom/vtpm/vtpm_cmd.c                      |  256 +++++++
>>   stubdom/vtpm/vtpm_cmd.h                      |   31 +
>>   stubdom/vtpm/vtpm_pcrs.c                     |   43 ++
>>   stubdom/vtpm/vtpm_pcrs.h                     |   53 ++
>>   stubdom/vtpm/vtpmblk.c                       |  307 +++++++++
>>   stubdom/vtpm/vtpmblk.h                       |   31 +
>>   stubdom/vtpmmgr/Makefile                     |   32 +
>>   stubdom/vtpmmgr/init.c                       |  553 +++++++++++++++
>>   stubdom/vtpmmgr/log.c                        |  151 +++++
>>   stubdom/vtpmmgr/log.h                        |   85 +++
>>   stubdom/vtpmmgr/marshal.h                    |  528 +++++++++++++++
>>   stubdom/vtpmmgr/minios.cfg                   |   14 +
>>   stubdom/vtpmmgr/tcg.h                        |  707 ++++++++++++++++=
+++
>>   stubdom/vtpmmgr/tpm.c                        |  938 ++++++++++++++++=
++++++++++
>>   stubdom/vtpmmgr/tpm.h                        |  218 ++++++
>>   stubdom/vtpmmgr/tpmrsa.c                     |  175 +++++
>>   stubdom/vtpmmgr/tpmrsa.h                     |   67 ++
>>   stubdom/vtpmmgr/uuid.h                       |   50 ++
>>   stubdom/vtpmmgr/vtpm_cmd_handler.c           |  152 +++++
>>   stubdom/vtpmmgr/vtpm_manager.h               |   64 ++
>>   stubdom/vtpmmgr/vtpm_storage.c               |  783 ++++++++++++++++=
+++++
>>   stubdom/vtpmmgr/vtpm_storage.h               |   68 ++
>>   stubdom/vtpmmgr/vtpmmgr.c                    |   93 +++
>>   stubdom/vtpmmgr/vtpmmgr.h                    |   77 +++
>>   tools/configure                              |  603 ++++++++--------=
-
>>   tools/libxen/include/xen/api/xen_all.h       |    1 -
>>   tools/libxen/include/xen/api/xen_vm.h        |    9 -
>>   tools/libxen/include/xen/api/xen_vtpm.h      |  218 ------
>>   tools/libxen/include/xen/api/xen_vtpm_decl.h |   31 -
>>   tools/libxen/src/xen_vm.c                    |   22 -
>>   tools/libxen/src/xen_vtpm.c                  |  235 -------
>>   tools/python/README.XendConfig               |    2 -
>>   tools/python/README.sxpcfg                   |    4 -
>>   tools/python/scripts/xapi.py                 |   20 -
>>   tools/python/xen/xend/XendAPI.py             |  128 ----
>>   tools/python/xen/xend/XendConfig.py          |   19 +-
>>   tools/python/xen/xend/XendConstants.py       |    8 +-
>>   tools/python/xen/xend/XendDevices.py         |    4 +-
>>   tools/python/xen/xend/XendDomainInfo.py      |   29 -
>>   tools/python/xen/xend/XendError.py           |    1 -
>>   tools/python/xen/xend/XendOptions.py         |    4 -
>>   tools/python/xen/xend/server/tpmif.py        |  141 ----
>>   tools/python/xen/xend/tests/xend-config.sxp  |    2 -
>>   tools/python/xen/xm/create.dtd               |    4 -
>>   tools/python/xen/xm/create.py                |   69 --
>>   tools/python/xen/xm/main.py                  |   37 -
>>   tools/python/xen/xm/xenapi_create.py         |   39 --
>>   59 files changed, 6535 insertions(+), 1370 deletions(-)
>>   create mode 100644 stubdom/polarssl.patch
>>   create mode 100644 stubdom/tpmemu-0.7.4.patch
>>   create mode 100644 stubdom/vtpm/Makefile
>>   create mode 100644 stubdom/vtpm/minios.cfg
>>   create mode 100644 stubdom/vtpm/vtpm.c
>>   create mode 100644 stubdom/vtpm/vtpm.h
>>   create mode 100644 stubdom/vtpm/vtpm_cmd.c
>>   create mode 100644 stubdom/vtpm/vtpm_cmd.h
>>   create mode 100644 stubdom/vtpm/vtpm_pcrs.c
>>   create mode 100644 stubdom/vtpm/vtpm_pcrs.h
>>   create mode 100644 stubdom/vtpm/vtpmblk.c
>>   create mode 100644 stubdom/vtpm/vtpmblk.h
>>   create mode 100644 stubdom/vtpmmgr/Makefile
>>   create mode 100644 stubdom/vtpmmgr/init.c
>>   create mode 100644 stubdom/vtpmmgr/log.c
>>   create mode 100644 stubdom/vtpmmgr/log.h
>>   create mode 100644 stubdom/vtpmmgr/marshal.h
>>   create mode 100644 stubdom/vtpmmgr/minios.cfg
>>   create mode 100644 stubdom/vtpmmgr/tcg.h
>>   create mode 100644 stubdom/vtpmmgr/tpm.c
>>   create mode 100644 stubdom/vtpmmgr/tpm.h
>>   create mode 100644 stubdom/vtpmmgr/tpmrsa.c
>>   create mode 100644 stubdom/vtpmmgr/tpmrsa.h
>>   create mode 100644 stubdom/vtpmmgr/uuid.h
>>   create mode 100644 stubdom/vtpmmgr/vtpm_cmd_handler.c
>>   create mode 100644 stubdom/vtpmmgr/vtpm_manager.h
>>   create mode 100644 stubdom/vtpmmgr/vtpm_storage.c
>>   create mode 100644 stubdom/vtpmmgr/vtpm_storage.h
>>   create mode 100644 stubdom/vtpmmgr/vtpmmgr.c
>>   create mode 100644 stubdom/vtpmmgr/vtpmmgr.h
>>   delete mode 100644 tools/libxen/include/xen/api/xen_vtpm.h
>>   delete mode 100644 tools/libxen/include/xen/api/xen_vtpm_decl.h
>>   delete mode 100644 tools/libxen/src/xen_vtpm.c
>>   delete mode 100644 tools/python/xen/xend/server/tpmif.py
>>
>



--------------ms090103040604070700040502
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEE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wICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYBq7ikQ6wpv2OJ+NUE5UQYWrnJVqWXzs1M3
UcyKmaghvXhFe8YZDJXuwCKaTnciYfVVK2a1FWmI8LnuEKd6V57sqGlA0e8k5DXiyjtG94YJ
I3Jd366ydyjFtHGpuNHfSq5AfgDK+tRO7tMSOytoyHm6GRFUsYYYWqcVepONe4GrkAAAAAAA
AA==
--------------ms090103040604070700040502--


--===============2003213384357243142==
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.xen.org
http://lists.xen.org/xen-devel

--===============2003213384357243142==--


From xen-devel-bounces@lists.xen.org Mon Nov 19 13:54:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 13:54:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaRnj-0002DE-Or; Mon, 19 Nov 2012 13:54:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaRnh-0002D5-WF
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 13:54:14 +0000
Received: from [193.109.254.147:64163] by server-8.bemta-14.messagelabs.com id
	22/9C-05026-50A3AA05; Mon, 19 Nov 2012 13:54:13 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353333249!11512829!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25219 invoked from network); 19 Nov 2012 13:54:11 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 13:54:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15880445"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 13:54:08 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 13:54:08 +0000
Message-ID: <1353333247.18229.88.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Mon, 19 Nov 2012 13:54:07 +0000
In-Reply-To: <1353329819.18229.83.camel@zakaz.uk.xensource.com>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 12:56 +0000, Ian Campbell wrote:

> >   add vtpm-stubdom code
> >   add stubdom/vtpmmgr code
> >   vtpm/vtpmmgr and required libs to stubdom/Makefile
> 
> Applied these.

Looks like we've grown a dependency on cmake. I vaguely recall
discussing before, can you remind me if this is a hard requirement on
the end user system or not. 

So I've held off on these three for now, if we do need cmake then we
need to get the test system in shape and also we could do with a patch
to README to add this new requirement.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 13:54:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 13:54:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaRnj-0002DE-Or; Mon, 19 Nov 2012 13:54:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaRnh-0002D5-WF
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 13:54:14 +0000
Received: from [193.109.254.147:64163] by server-8.bemta-14.messagelabs.com id
	22/9C-05026-50A3AA05; Mon, 19 Nov 2012 13:54:13 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353333249!11512829!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25219 invoked from network); 19 Nov 2012 13:54:11 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 13:54:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15880445"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 13:54:08 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 13:54:08 +0000
Message-ID: <1353333247.18229.88.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Mon, 19 Nov 2012 13:54:07 +0000
In-Reply-To: <1353329819.18229.83.camel@zakaz.uk.xensource.com>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 12:56 +0000, Ian Campbell wrote:

> >   add vtpm-stubdom code
> >   add stubdom/vtpmmgr code
> >   vtpm/vtpmmgr and required libs to stubdom/Makefile
> 
> Applied these.

Looks like we've grown a dependency on cmake. I vaguely recall
discussing before, can you remind me if this is a hard requirement on
the end user system or not. 

So I've held off on these three for now, if we do need cmake then we
need to get the test system in shape and also we could do with a patch
to README to add this new requirement.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 13:58:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 13:58:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaRrh-0002Tf-M6; Mon, 19 Nov 2012 13:58:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaRrg-0002TZ-Dc
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 13:58:20 +0000
Received: from [85.158.143.35:44149] by server-1.bemta-4.messagelabs.com id
	DF/CC-27934-BFA3AA05; Mon, 19 Nov 2012 13:58:19 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1353333382!6072844!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27779 invoked from network); 19 Nov 2012 13:56:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 13:56:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15880502"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 13:56:22 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 13:56:22 +0000
Message-ID: <1353333381.18229.90.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Mon, 19 Nov 2012 13:56:21 +0000
In-Reply-To: <20121119130826.GB31411@ocelot.phlegethon.org>
References: <1353080578-1487-1-git-send-email-stefano.stabellini@eu.citrix.com>
	<1353329757.18229.81.camel@zakaz.uk.xensource.com>
	<20121119130826.GB31411@ocelot.phlegethon.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH v3] xen/arm: flush D-cache and I-cache when
	appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 13:08 +0000, Tim Deegan wrote:
> Sorry for the late review - I meant to get to these on Thursday but
> hadn't time.  
> 
> At 12:55 +0000 on 19 Nov (1353329757), Ian Campbell wrote:
> > > +/* Macro for flushing a single small item.  The predicate is always 
> > > + * compile-time constant so this will compile down to 3 instructions in
> > > + * the common case. 
> 
> This is no longer true!  The predicate now depends on the alignment of
> the pointer, so this will compile to quite a bit of code, including the
> memory barrier I was trying to avoid.

If p is static then isn't p + sizeof(*p) etc static and therefore the
compiler can figure it out?

Stefano, what does it actually compile down to in practice?

> If we can sensibly restrict this to naturally-aligned objects smaller
> than a cacheline, we should go back to the previous version of this
> macro.  If not, I think we might as well just use
> flush_xen_dcache_va_range(_p, sizeof *_p) and be done with it.

I've already committed it, so please send a followup patch of whichever
sort is needed.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 13:58:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 13:58:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaRrh-0002Tf-M6; Mon, 19 Nov 2012 13:58:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaRrg-0002TZ-Dc
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 13:58:20 +0000
Received: from [85.158.143.35:44149] by server-1.bemta-4.messagelabs.com id
	DF/CC-27934-BFA3AA05; Mon, 19 Nov 2012 13:58:19 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1353333382!6072844!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27779 invoked from network); 19 Nov 2012 13:56:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 13:56:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15880502"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 13:56:22 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 13:56:22 +0000
Message-ID: <1353333381.18229.90.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Mon, 19 Nov 2012 13:56:21 +0000
In-Reply-To: <20121119130826.GB31411@ocelot.phlegethon.org>
References: <1353080578-1487-1-git-send-email-stefano.stabellini@eu.citrix.com>
	<1353329757.18229.81.camel@zakaz.uk.xensource.com>
	<20121119130826.GB31411@ocelot.phlegethon.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH v3] xen/arm: flush D-cache and I-cache when
	appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 13:08 +0000, Tim Deegan wrote:
> Sorry for the late review - I meant to get to these on Thursday but
> hadn't time.  
> 
> At 12:55 +0000 on 19 Nov (1353329757), Ian Campbell wrote:
> > > +/* Macro for flushing a single small item.  The predicate is always 
> > > + * compile-time constant so this will compile down to 3 instructions in
> > > + * the common case. 
> 
> This is no longer true!  The predicate now depends on the alignment of
> the pointer, so this will compile to quite a bit of code, including the
> memory barrier I was trying to avoid.

If p is static then isn't p + sizeof(*p) etc static and therefore the
compiler can figure it out?

Stefano, what does it actually compile down to in practice?

> If we can sensibly restrict this to naturally-aligned objects smaller
> than a cacheline, we should go back to the previous version of this
> macro.  If not, I think we might as well just use
> flush_xen_dcache_va_range(_p, sizeof *_p) and be done with it.

I've already committed it, so please send a followup patch of whichever
sort is needed.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:02:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:02:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaRvR-0002gb-BK; Mon, 19 Nov 2012 14:02:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaRvQ-0002gV-9u
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:02:12 +0000
Received: from [85.158.143.35:48827] by server-3.bemta-4.messagelabs.com id
	8F/50-06841-3EB3AA05; Mon, 19 Nov 2012 14:02:11 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-5.tower-21.messagelabs.com!1353333629!7172978!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3460 invoked from network); 19 Nov 2012 14:00:31 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-5.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 14:00:31 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157592519;
	Mon, 19 Nov 2012 09:00:23 -0500
Message-ID: <50AA3B74.4090907@jhuapl.edu>
Date: Mon, 19 Nov 2012 09:00:20 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353333247.18229.88.camel@zakaz.uk.xensource.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8816410280893408856=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============8816410280893408856==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms080307090900070207090502"

This is a cryptographically signed message in MIME format.

--------------ms080307090900070207090502
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/19/2012 08:54 AM, Ian Campbell wrote:
> On Mon, 2012-11-19 at 12:56 +0000, Ian Campbell wrote:
>
>>>    add vtpm-stubdom code
>>>    add stubdom/vtpmmgr code
>>>    vtpm/vtpmmgr and required libs to stubdom/Makefile
>> Applied these.
> Looks like we've grown a dependency on cmake. I vaguely recall
> discussing before, can you remind me if this is a hard requirement on
> the end user system or not.
Unfortunately it is a hard requirement. Its used to pass the stubdom=20
build flags to the tpm_emulator.
>
> So I've held off on these three for now, if we do need cmake then we
> need to get the test system in shape and also we could do with a patch
> to README to add this new requirement.
>
> Ian.
>
I'll send a patch with this.



--------------ms080307090900070207090502
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhM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DjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTExOTE0MDAyMFowIwYJKoZIhvcNAQkEMRYEFNYKR3dJoFmyFfu2
8FRSbDRPb7DQMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAxjlRTnzHOzIwKnYYMWUXq0MLp71BiAzTh
sOWXyUFERYWGJWuXFEa9KUg8eptYt7fOXyYWki6eCXHVHfDFNFBL5DupN56E2imnfApE7HMu
w7+N7lH3YnaFkEjwfC+RR6QOmw0fGoyMtsEhW2MRFGbqt1ezjGgLRVV+rNnx3Pw6xwAAAAAA
AA==
--------------ms080307090900070207090502--


--===============8816410280893408856==
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.xen.org
http://lists.xen.org/xen-devel

--===============8816410280893408856==--


From xen-devel-bounces@lists.xen.org Mon Nov 19 14:02:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:02:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaRvR-0002gb-BK; Mon, 19 Nov 2012 14:02:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaRvQ-0002gV-9u
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:02:12 +0000
Received: from [85.158.143.35:48827] by server-3.bemta-4.messagelabs.com id
	8F/50-06841-3EB3AA05; Mon, 19 Nov 2012 14:02:11 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-5.tower-21.messagelabs.com!1353333629!7172978!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3460 invoked from network); 19 Nov 2012 14:00:31 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-5.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 14:00:31 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157592519;
	Mon, 19 Nov 2012 09:00:23 -0500
Message-ID: <50AA3B74.4090907@jhuapl.edu>
Date: Mon, 19 Nov 2012 09:00:20 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353333247.18229.88.camel@zakaz.uk.xensource.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8816410280893408856=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============8816410280893408856==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms080307090900070207090502"

This is a cryptographically signed message in MIME format.

--------------ms080307090900070207090502
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/19/2012 08:54 AM, Ian Campbell wrote:
> On Mon, 2012-11-19 at 12:56 +0000, Ian Campbell wrote:
>
>>>    add vtpm-stubdom code
>>>    add stubdom/vtpmmgr code
>>>    vtpm/vtpmmgr and required libs to stubdom/Makefile
>> Applied these.
> Looks like we've grown a dependency on cmake. I vaguely recall
> discussing before, can you remind me if this is a hard requirement on
> the end user system or not.
Unfortunately it is a hard requirement. Its used to pass the stubdom=20
build flags to the tpm_emulator.
>
> So I've held off on these three for now, if we do need cmake then we
> need to get the test system in shape and also we could do with a patch
> to README to add this new requirement.
>
> Ian.
>
I'll send a patch with this.



--------------ms080307090900070207090502
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgU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OBBYEFO6LYxg6r9wHZ+zdQtBHn1dZ/YTNMAkGA1UdEwQCMAAwGQYJKoZIhvZ9B0EABAww
ChsEVjcuMQMCBLAwDQYJKoZIhvcNAQEFBQADgYEAJO9HQh4YNChVLzuZqK5ARJARD8JoujGZ
fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTExOTE0MDAyMFowIwYJKoZIhvcNAQkEMRYEFNYKR3dJoFmyFfu2
8FRSbDRPb7DQMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAxjlRTnzHOzIwKnYYMWUXq0MLp71BiAzTh
sOWXyUFERYWGJWuXFEa9KUg8eptYt7fOXyYWki6eCXHVHfDFNFBL5DupN56E2imnfApE7HMu
w7+N7lH3YnaFkEjwfC+RR6QOmw0fGoyMtsEhW2MRFGbqt1ezjGgLRVV+rNnx3Pw6xwAAAAAA
AA==
--------------ms080307090900070207090502--


--===============8816410280893408856==
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.xen.org
http://lists.xen.org/xen-devel

--===============8816410280893408856==--


From xen-devel-bounces@lists.xen.org Mon Nov 19 14:03:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:03:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaRwS-0002ke-Pw; Mon, 19 Nov 2012 14:03:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaRwR-0002kV-1X
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:03:15 +0000
Received: from [85.158.139.211:42821] by server-10.bemta-5.messagelabs.com id
	B5/3A-09257-22C3AA05; Mon, 19 Nov 2012 14:03:14 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353333792!20798269!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31635 invoked from network); 19 Nov 2012 14:03:13 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 19 Nov 2012 14:03:13 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157592829;
	Mon, 19 Nov 2012 09:03:02 -0500
Message-ID: <50AA3C13.7090601@jhuapl.edu>
Date: Mon, 19 Nov 2012 09:02:59 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353333247.18229.88.camel@zakaz.uk.xensource.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6189150579711817287=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============6189150579711817287==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms010901010305090708010706"

This is a cryptographically signed message in MIME format.

--------------ms010901010305090708010706
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Another option also would be to remove vtpm-stubdom and vtpmmgrdom from=20
the stubdom install target. This would make them optional components and =

then cmake becomes an optional dependency.

On 11/19/2012 08:54 AM, Ian Campbell wrote:
> On Mon, 2012-11-19 at 12:56 +0000, Ian Campbell wrote:
>
>>>    add vtpm-stubdom code
>>>    add stubdom/vtpmmgr code
>>>    vtpm/vtpmmgr and required libs to stubdom/Makefile
>> Applied these.
> Looks like we've grown a dependency on cmake. I vaguely recall
> discussing before, can you remind me if this is a hard requirement on
> the end user system or not.
>
> So I've held off on these three for now, if we do need cmake then we
> need to get the test system in shape and also we could do with a patch
> to README to add this new requirement.
>
> Ian.
>



--------------ms010901010305090708010706
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlCwMBAQEBBAoWCGZpb3JhbWUxMBsGDSsGAQQBsyUL
AwEBAQIEChIIMDAxMDQyNjEwWAYJYIZIAYb6ax4BBEsMSVRoZSBwcml2YXRlIGtleSBjb3Jy
ZXNwb25kaW5nIHRvIHRoaXMgY2VydGlmaWNhdGUgbWF5IGhhdmUgYmVlbiBleHBvcnRlZC4w
KAYDVR0RBCEwH4EdTWF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oxe2OMty4SkJobke38YwAAAAAA
AA==
--------------ms010901010305090708010706--


--===============6189150579711817287==
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.xen.org
http://lists.xen.org/xen-devel

--===============6189150579711817287==--


From xen-devel-bounces@lists.xen.org Mon Nov 19 14:03:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:03:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaRwS-0002ke-Pw; Mon, 19 Nov 2012 14:03:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaRwR-0002kV-1X
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:03:15 +0000
Received: from [85.158.139.211:42821] by server-10.bemta-5.messagelabs.com id
	B5/3A-09257-22C3AA05; Mon, 19 Nov 2012 14:03:14 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353333792!20798269!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31635 invoked from network); 19 Nov 2012 14:03:13 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 19 Nov 2012 14:03:13 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157592829;
	Mon, 19 Nov 2012 09:03:02 -0500
Message-ID: <50AA3C13.7090601@jhuapl.edu>
Date: Mon, 19 Nov 2012 09:02:59 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353333247.18229.88.camel@zakaz.uk.xensource.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6189150579711817287=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============6189150579711817287==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms010901010305090708010706"

This is a cryptographically signed message in MIME format.

--------------ms010901010305090708010706
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Another option also would be to remove vtpm-stubdom and vtpmmgrdom from=20
the stubdom install target. This would make them optional components and =

then cmake becomes an optional dependency.

On 11/19/2012 08:54 AM, Ian Campbell wrote:
> On Mon, 2012-11-19 at 12:56 +0000, Ian Campbell wrote:
>
>>>    add vtpm-stubdom code
>>>    add stubdom/vtpmmgr code
>>>    vtpm/vtpmmgr and required libs to stubdom/Makefile
>> Applied these.
> Looks like we've grown a dependency on cmake. I vaguely recall
> discussing before, can you remind me if this is a hard requirement on
> the end user system or not.
>
> So I've held off on these three for now, if we do need cmake then we
> need to get the test system in shape and also we could do with a patch
> to README to add this new requirement.
>
> Ian.
>



--------------ms010901010305090708010706
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlCwMBAQEBBA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DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYBA2iXOklOg44d/7y0jdxP9CrdDfophNmyD
HjR1GuaaAKzOS9ndXFpoS66KbY+6CKy6V/cp7JJRtl8/WIxaDacnS9Pia3zTx13lf1pED4gm
tUKkUZcz8m+jjlX7fCgnr+dKMON3zOZ/HD5w2IAAeXXMWeoxe2OMty4SkJobke38YwAAAAAA
AA==
--------------ms010901010305090708010706--


--===============6189150579711817287==
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.xen.org
http://lists.xen.org/xen-devel

--===============6189150579711817287==--


From xen-devel-bounces@lists.xen.org Mon Nov 19 14:08:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:08:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaS1h-0002yX-Iv; Mon, 19 Nov 2012 14:08:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TaS1g-0002yS-Ms
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:08:40 +0000
Received: from [85.158.139.211:32978] by server-6.bemta-5.messagelabs.com id
	3D/E9-19321-76D3AA05; Mon, 19 Nov 2012 14:08:39 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353334118!20799358!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26992 invoked from network); 19 Nov 2012 14:08:39 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-206.messagelabs.com with SMTP;
	19 Nov 2012 14:08:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 19 Nov 2012 14:08:37 +0000
Message-Id: <50AA4BAB02000078000A9B2C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 19 Nov 2012 14:09:31 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Wei Wang" <wei.wang2@amd.com>, "Andrew Cooper" <andrew.cooper3@citrix.com>
References: <50AA351F.5030301@citrix.com>
In-Reply-To: <50AA351F.5030301@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Concern about AMD IOMMU HPET msi remapping
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 19.11.12 at 14:33, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> Hello,
> 
> In the committed patch
> http://xenbits.xen.org/hg/staging/xen-unstable.hg/rev/9025a10c0561 
> 
> The bdf parameter to update_intremap_entry_from_msi_msg() is declared as
> u8.  The single caller of this function passes bdf as an int (which is
> only ever filled with a u16), while the this function passes bdf to
> get_{dma,intremap}_requestor_id(), which expect u16's
> 
> Is there not a truncation issue by doing this, or am I missing something?

Oh, indeed - thanks for spotting. Will fix this right away.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:08:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:08:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaS1h-0002yX-Iv; Mon, 19 Nov 2012 14:08:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TaS1g-0002yS-Ms
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:08:40 +0000
Received: from [85.158.139.211:32978] by server-6.bemta-5.messagelabs.com id
	3D/E9-19321-76D3AA05; Mon, 19 Nov 2012 14:08:39 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353334118!20799358!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26992 invoked from network); 19 Nov 2012 14:08:39 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-206.messagelabs.com with SMTP;
	19 Nov 2012 14:08:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 19 Nov 2012 14:08:37 +0000
Message-Id: <50AA4BAB02000078000A9B2C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 19 Nov 2012 14:09:31 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Wei Wang" <wei.wang2@amd.com>, "Andrew Cooper" <andrew.cooper3@citrix.com>
References: <50AA351F.5030301@citrix.com>
In-Reply-To: <50AA351F.5030301@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Concern about AMD IOMMU HPET msi remapping
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 19.11.12 at 14:33, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> Hello,
> 
> In the committed patch
> http://xenbits.xen.org/hg/staging/xen-unstable.hg/rev/9025a10c0561 
> 
> The bdf parameter to update_intremap_entry_from_msi_msg() is declared as
> u8.  The single caller of this function passes bdf as an int (which is
> only ever filled with a u16), while the this function passes bdf to
> get_{dma,intremap}_requestor_id(), which expect u16's
> 
> Is there not a truncation issue by doing this, or am I missing something?

Oh, indeed - thanks for spotting. Will fix this right away.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:13:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:13:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaS6V-000380-A2; Mon, 19 Nov 2012 14:13:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TaS6T-00037s-Ua
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:13:38 +0000
Received: from [85.158.139.83:64362] by server-7.bemta-5.messagelabs.com id
	6F/8F-23096-19E3AA05; Mon, 19 Nov 2012 14:13:37 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1353334415!26655964!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27815 invoked from network); 19 Nov 2012 14:13:36 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-182.messagelabs.com with SMTP;
	19 Nov 2012 14:13:36 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 19 Nov 2012 14:13:35 +0000
Message-Id: <50AA4CD402000078000A9B3B@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 19 Nov 2012 14:14:28 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Huang <wei.huang2@amd.com>,
	Wei Wang <weiwang.dd@gmail.com>
Subject: [Xen-devel] [PATCH] AMD IOMMU: fix type of "bdf" parameter of
 update_intremap_entry_from_msi_msg()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -263,7 +263,7 @@ void amd_iommu_ioapic_update_ire(
 }
 
 static void update_intremap_entry_from_msi_msg(
-    struct amd_iommu *iommu, u8 bdf,
+    struct amd_iommu *iommu, u16 bdf,
     struct msi_desc *msi_desc, struct msi_msg *msg)
 {
     unsigned long flags;




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:13:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:13:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaS6V-000380-A2; Mon, 19 Nov 2012 14:13:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TaS6T-00037s-Ua
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:13:38 +0000
Received: from [85.158.139.83:64362] by server-7.bemta-5.messagelabs.com id
	6F/8F-23096-19E3AA05; Mon, 19 Nov 2012 14:13:37 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1353334415!26655964!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27815 invoked from network); 19 Nov 2012 14:13:36 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-182.messagelabs.com with SMTP;
	19 Nov 2012 14:13:36 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 19 Nov 2012 14:13:35 +0000
Message-Id: <50AA4CD402000078000A9B3B@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 19 Nov 2012 14:14:28 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Huang <wei.huang2@amd.com>,
	Wei Wang <weiwang.dd@gmail.com>
Subject: [Xen-devel] [PATCH] AMD IOMMU: fix type of "bdf" parameter of
 update_intremap_entry_from_msi_msg()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -263,7 +263,7 @@ void amd_iommu_ioapic_update_ire(
 }
 
 static void update_intremap_entry_from_msi_msg(
-    struct amd_iommu *iommu, u8 bdf,
+    struct amd_iommu *iommu, u16 bdf,
     struct msi_desc *msi_desc, struct msi_msg *msg)
 {
     unsigned long flags;




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:15:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:15:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaS8U-0003Dy-RC; Mon, 19 Nov 2012 14:15:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TaS8T-0003Dq-DN
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:15:41 +0000
Received: from [193.109.254.147:32538] by server-10.bemta-14.messagelabs.com
	id 76/53-31741-C0F3AA05; Mon, 19 Nov 2012 14:15:40 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1353334538!10247260!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ2Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11925 invoked from network); 19 Nov 2012 14:15:40 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 14:15:40 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="45029226"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 14:15:38 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 09:15:38 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TaS8P-0005nO-M4;
	Mon, 19 Nov 2012 14:15:37 +0000
Message-ID: <50AA3F09.9000505@citrix.com>
Date: Mon, 19 Nov 2012 14:15:37 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <50AA4CD402000078000A9B3B@nat28.tlf.novell.com>
In-Reply-To: <50AA4CD402000078000A9B3B@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] AMD IOMMU: fix type of "bdf" parameter of
	update_intremap_entry_from_msi_msg()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 19/11/12 14:14, Jan Beulich wrote:
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Looks good to me.

>
> --- a/xen/drivers/passthrough/amd/iommu_intr.c
> +++ b/xen/drivers/passthrough/amd/iommu_intr.c
> @@ -263,7 +263,7 @@ void amd_iommu_ioapic_update_ire(
>  }
>  
>  static void update_intremap_entry_from_msi_msg(
> -    struct amd_iommu *iommu, u8 bdf,
> +    struct amd_iommu *iommu, u16 bdf,
>      struct msi_desc *msi_desc, struct msi_msg *msg)
>  {
>      unsigned long flags;
>
>
>

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:15:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:15:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaS8U-0003Dy-RC; Mon, 19 Nov 2012 14:15:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TaS8T-0003Dq-DN
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:15:41 +0000
Received: from [193.109.254.147:32538] by server-10.bemta-14.messagelabs.com
	id 76/53-31741-C0F3AA05; Mon, 19 Nov 2012 14:15:40 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1353334538!10247260!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ2Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11925 invoked from network); 19 Nov 2012 14:15:40 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 14:15:40 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="45029226"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 14:15:38 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 09:15:38 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TaS8P-0005nO-M4;
	Mon, 19 Nov 2012 14:15:37 +0000
Message-ID: <50AA3F09.9000505@citrix.com>
Date: Mon, 19 Nov 2012 14:15:37 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <50AA4CD402000078000A9B3B@nat28.tlf.novell.com>
In-Reply-To: <50AA4CD402000078000A9B3B@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] AMD IOMMU: fix type of "bdf" parameter of
	update_intremap_entry_from_msi_msg()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 19/11/12 14:14, Jan Beulich wrote:
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Looks good to me.

>
> --- a/xen/drivers/passthrough/amd/iommu_intr.c
> +++ b/xen/drivers/passthrough/amd/iommu_intr.c
> @@ -263,7 +263,7 @@ void amd_iommu_ioapic_update_ire(
>  }
>  
>  static void update_intremap_entry_from_msi_msg(
> -    struct amd_iommu *iommu, u8 bdf,
> +    struct amd_iommu *iommu, u16 bdf,
>      struct msi_desc *msi_desc, struct msi_msg *msg)
>  {
>      unsigned long flags;
>
>
>

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:27:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:27:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSJV-0003Vb-Ft; Mon, 19 Nov 2012 14:27:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaSJU-0003VW-N2
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:27:04 +0000
Received: from [85.158.139.211:9707] by server-8.bemta-5.messagelabs.com id
	9C/89-06050-8B14AA05; Mon, 19 Nov 2012 14:27:04 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353335220!20802564!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2949 invoked from network); 19 Nov 2012 14:27:00 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 14:27:00 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15881653"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 14:25:50 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 14:25:50 +0000
Message-ID: <1353335149.18229.103.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Date: Mon, 19 Nov 2012 14:25:49 +0000
In-Reply-To: <20650.6603.914330.994040@mariner.uk.xensource.com>
References: <1348487103-2113-1-git-send-email-ian.campbell@citrix.com>
	<20650.6603.914330.994040@mariner.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY PATCH V2] docs: document/mark-up SCHEDOP_*
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 11:36 +0000, Ian Jackson wrote:
> Ian Campbell writes ("[Xen-devel] [DOCDAY PATCH V2] docs: document/mark-up SCHEDOP_*"):
> > The biggest subtlety here is there additional argument when op ==
> > SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
> > xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
> > 
> > This patch moves some structs around but there is no functional change
> > other than improved documentation.
> 
> I have verified that this is a pure documentation patch, but not
> checked it for accuracy.  That seems like the right level of review,
> so:
> 
> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Thanks, I have applied this and the 5 patches from "docs: x86 PV MMU
related functions" which you also acked this morning.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:27:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:27:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSJV-0003Vb-Ft; Mon, 19 Nov 2012 14:27:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaSJU-0003VW-N2
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:27:04 +0000
Received: from [85.158.139.211:9707] by server-8.bemta-5.messagelabs.com id
	9C/89-06050-8B14AA05; Mon, 19 Nov 2012 14:27:04 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353335220!20802564!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2949 invoked from network); 19 Nov 2012 14:27:00 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 14:27:00 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15881653"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 14:25:50 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 14:25:50 +0000
Message-ID: <1353335149.18229.103.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Date: Mon, 19 Nov 2012 14:25:49 +0000
In-Reply-To: <20650.6603.914330.994040@mariner.uk.xensource.com>
References: <1348487103-2113-1-git-send-email-ian.campbell@citrix.com>
	<20650.6603.914330.994040@mariner.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY PATCH V2] docs: document/mark-up SCHEDOP_*
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 11:36 +0000, Ian Jackson wrote:
> Ian Campbell writes ("[Xen-devel] [DOCDAY PATCH V2] docs: document/mark-up SCHEDOP_*"):
> > The biggest subtlety here is there additional argument when op ==
> > SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
> > xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
> > 
> > This patch moves some structs around but there is no functional change
> > other than improved documentation.
> 
> I have verified that this is a pure documentation patch, but not
> checked it for accuracy.  That seems like the right level of review,
> so:
> 
> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Thanks, I have applied this and the 5 patches from "docs: x86 PV MMU
related functions" which you also acked this morning.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:30:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:30:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSMD-0003cB-7u; Mon, 19 Nov 2012 14:29:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaSMB-0003c5-VJ
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:29:52 +0000
Received: from [85.158.143.99:55369] by server-2.bemta-4.messagelabs.com id
	DB/A5-28922-F524AA05; Mon, 19 Nov 2012 14:29:51 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1353335390!19308613!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31164 invoked from network); 19 Nov 2012 14:29:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 14:29:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15881768"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 14:29:50 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 14:29:50 +0000
Message-ID: <1353335388.18229.104.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau =?ISO-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Date: Mon, 19 Nov 2012 14:29:48 +0000
In-Reply-To: <50A65571.2060502@citrix.com>
References: <1350661627-20775-1-git-send-email-roger.pau@citrix.com>
	<50A65338.2050002@citrix.com> <50A65571.2060502@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: David Vrabel <david.vrabel@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: restore GNTTABOP_dump_table
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gRnJpLCAyMDEyLTExLTE2IGF0IDE1OjAyICswMDAwLCBSb2dlciBQYXUgTW9ubsOpIHdyb3Rl
Ogo+IE9uIDE2LzExLzEyIDE1OjUyLCBEYXZpZCBWcmFiZWwgd3JvdGU6Cj4gPiBPbiAxOS8xMC8x
MiAxNjo0NywgUm9nZXIgUGF1IE1vbm5lIHdyb3RlOgo+ID4+IFRoaXMgb3BlcmF0aW9uIHdhcyBk
cm9wcGVkIGxvbmcgdGltZSBhZ28sIGJ1dCBJIGZvdW5kIGl0IHF1aXRlIGhlbHBmdWwKPiA+PiBm
b3IgZ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-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:30:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSMD-0003cB-7u; Mon, 19 Nov 2012 14:29:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaSMB-0003c5-VJ
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:29:52 +0000
Received: from [85.158.143.99:55369] by server-2.bemta-4.messagelabs.com id
	DB/A5-28922-F524AA05; Mon, 19 Nov 2012 14:29:51 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1353335390!19308613!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31164 invoked from network); 19 Nov 2012 14:29:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 14:29:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15881768"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 14:29:50 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 14:29:50 +0000
Message-ID: <1353335388.18229.104.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau =?ISO-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Date: Mon, 19 Nov 2012 14:29:48 +0000
In-Reply-To: <50A65571.2060502@citrix.com>
References: <1350661627-20775-1-git-send-email-roger.pau@citrix.com>
	<50A65338.2050002@citrix.com> <50A65571.2060502@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: David Vrabel <david.vrabel@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: restore GNTTABOP_dump_table
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gRnJpLCAyMDEyLTExLTE2IGF0IDE1OjAyICswMDAwLCBSb2dlciBQYXUgTW9ubsOpIHdyb3Rl
Ogo+IE9uIDE2LzExLzEyIDE1OjUyLCBEYXZpZCBWcmFiZWwgd3JvdGU6Cj4gPiBPbiAxOS8xMC8x
MiAxNjo0NywgUm9nZXIgUGF1IE1vbm5lIHdyb3RlOgo+ID4+IFRoaXMgb3BlcmF0aW9uIHdhcyBk
cm9wcGVkIGxvbmcgdGltZSBhZ28sIGJ1dCBJIGZvdW5kIGl0IHF1aXRlIGhlbHBmdWwKPiA+PiBm
b3IgZGVidWdnaW5nIHB1cnBvc2VzLiBUaGlzIHJlLWltcGxlbWVudGF0aW9uIHVzZXMgdGhlIGNv
ZGUgYWxyZWFkeQo+ID4+IHByZXNlbnQgaW4gZ250dGFiX3VzYWdlX3ByaW50IGFuZCBhZGRzIHRo
ZSBtYXB0cmFjay10YWJsZSBkdW1wLgo+ID4gCj4gPiBXaHkgaXMgdGhlIG9wZXJhdGlvbiB1c2Vm
dWw/ICBJc24ndCB0aGUgZGVidWcga2V5IHN1ZmZpY2llbnQ/Cj4gCj4gVGhlIGRlYnVnIGtleSBk
b2Vzbid0IHByaW50IHRoZSBtYXB0cmFjaywgYW5kIGFsc28gSSBmb3VuZCBpdCBxdWl0ZQo+IHVz
ZWZ1bCB0byBiZSBhYmxlIHRvIGNhbGwgdGhpcyBmcm9tIHRoZSBndWVzdCBrZXJuZWwgaXRzZWxm
IGF0IGNlcnRhaW4KPiBzcGVjaWZpYyBwb2ludHMgKGxpa2UgYmVmb3JlIGFuZCBhZnRlciBjbGVh
bmluZyB0aGUgbGlzdCBvZiBwZXJzaXN0ZW50Cj4gZ3JhbnRzKSwgd2hpY2ggaXMgbm90IHBvc3Np
YmxlIHdoZW4gdXNpbmcgdGhlIGRlYnVnIGtleS4KCkkgcHJlc3VtZSB0aGlzIGludm9sdmVkIHRl
bXBvcmFyaWx5IHBhdGNoaW5nIFhlbiB0byBhbGxvdyB0aGlzIHNpbmNlIHlvdQp3b3VsZG4ndCB3
YW50IHRoaXMgZnVuY3Rpb24gdG8gYmUgY2FsbGFibGUgYnkgZ3Vlc3RzIGluIGdlbmVyYWwuCgpJ
YW4uCgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVu
LWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMu
eGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:39:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:39:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSVU-0003sA-OF; Mon, 19 Nov 2012 14:39:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TaSVS-0003s5-ML
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:39:26 +0000
Received: from [85.158.137.99:40502] by server-10.bemta-3.messagelabs.com id
	04/CB-19806-D944AA05; Mon, 19 Nov 2012 14:39:25 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1353335964!18027604!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26522 invoked from network); 19 Nov 2012 14:39:25 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 14:39:25 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15882021"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 14:38:48 +0000
Received: from [192.168.1.30] (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 14:38:48 +0000
Message-ID: <50AA4477.7060508@citrix.com>
Date: Mon, 19 Nov 2012 15:38:47 +0100
From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1350661627-20775-1-git-send-email-roger.pau@citrix.com>
	<50A65338.2050002@citrix.com> <50A65571.2060502@citrix.com>
	<1353335388.18229.104.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353335388.18229.104.camel@zakaz.uk.xensource.com>
Cc: David Vrabel <david.vrabel@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: restore GNTTABOP_dump_table
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gMTkvMTEvMTIgMTU6MjksIElhbiBDYW1wYmVsbCB3cm90ZToKPiBPbiBGcmksIDIwMTItMTEt
MTYgYXQgMTU6MDIgKzAwMDAsIFJvZ2VyIFBhdSBNb25uw6kgd3JvdGU6Cj4+IE9uIDE2LzExLzEy
IDE1OjUyLCBEYXZpZCBWcmFiZWwgd3JvdGU6Cj4+PiBPbiAxOS8xMC8xMiAxNjo0NywgUm9nZXIg
UGF1IE1vbm5lIHdyb3RlOgo+Pj4+IFRoaXMgb3BlcmF0aW9uIHdhcyBkcm9wcGVkIGxvbmcgdGlt
ZSBhZ28sIGJ1dCBJIGZvdW5kIGl0IHF1aXRlIGhlbHBmdWwKPj4+PiBmb3IgZGVidWdnaW5nIH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dGlvbjoKCisgICAgaWYgKCAhSVNfUFJJ
VihjdXJyZW50LT5kb21haW4pICkKKyAgICAgICAgcmV0dXJuIC1FUEVSTTsKCgpfX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwgbWFpbGluZyBs
aXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZl
bAo=

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:39:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:39:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSVU-0003sA-OF; Mon, 19 Nov 2012 14:39:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TaSVS-0003s5-ML
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:39:26 +0000
Received: from [85.158.137.99:40502] by server-10.bemta-3.messagelabs.com id
	04/CB-19806-D944AA05; Mon, 19 Nov 2012 14:39:25 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1353335964!18027604!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26522 invoked from network); 19 Nov 2012 14:39:25 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 14:39:25 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15882021"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 14:38:48 +0000
Received: from [192.168.1.30] (10.31.3.235) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 14:38:48 +0000
Message-ID: <50AA4477.7060508@citrix.com>
Date: Mon, 19 Nov 2012 15:38:47 +0100
From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1350661627-20775-1-git-send-email-roger.pau@citrix.com>
	<50A65338.2050002@citrix.com> <50A65571.2060502@citrix.com>
	<1353335388.18229.104.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353335388.18229.104.camel@zakaz.uk.xensource.com>
Cc: David Vrabel <david.vrabel@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: restore GNTTABOP_dump_table
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gMTkvMTEvMTIgMTU6MjksIElhbiBD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1wb3Jhcmls
eSBwYXRjaGluZyBYZW4gdG8gYWxsb3cgdGhpcyBzaW5jZSB5b3UKPiB3b3VsZG4ndCB3YW50IHRo
aXMgZnVuY3Rpb24gdG8gYmUgY2FsbGFibGUgYnkgZ3Vlc3RzIGluIGdlbmVyYWwuCgpCeSBndWVz
dCBrZXJuZWwgSSBtZWFudCBEb20wIGtlcm5lbCwgc29ycnkgZm9yIHRoZSBjb25mdXNpb24uIEkn
dmUKYWx3YXlzIHVzZWQgdGhlIGNoZWNrIGJlbG93IHRvIHByZXZlbnQgbm9uIHByaXZpbGVnZWQg
a2VybmVscyBmcm9tCmdldHRpbmcgdGhpcyBpbmZvcm1hdGlvbjoKCisgICAgaWYgKCAhSVNfUFJJ
VihjdXJyZW50LT5kb21haW4pICkKKyAgICAgICAgcmV0dXJuIC1FUEVSTTsKCgpfX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwgbWFpbGluZyBs
aXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZl
bAo=

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:42:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:42:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSY9-0003zP-Hq; Mon, 19 Nov 2012 14:42:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaSY8-0003zI-MG
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:42:12 +0000
Received: from [85.158.143.99:44058] by server-3.bemta-4.messagelabs.com id
	71/39-06841-3454AA05; Mon, 19 Nov 2012 14:42:11 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1353336131!25210008!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29967 invoked from network); 19 Nov 2012 14:42:11 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 14:42:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15882068"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 14:39:45 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 14:39:44 +0000
Message-ID: <1353335983.18229.110.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Mon, 19 Nov 2012 14:39:43 +0000
In-Reply-To: <50AA393A.5050505@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352992629-5850-4-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353328024.18229.72.camel@zakaz.uk.xensource.com>
	<50AA393A.5050505@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 03/10] Remove old vtpm support from
	xm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 13:50 +0000, Matthew Fioravante wrote:
> Well I think you could keep the original removal patch and just not 
> apply this one if you don't want to mess with xm and xend.

The original one was the one which effectively (indirectly) removed the
xend feature though (unless somehow vtpm still works in xend after
that?)

>  The original 
> patch doesn't touch xm or xend and just removes the vtpm and 
> vtpm_manager code. The only reason I'm more inclined to remove all of 
> the old vtpm stuff is because its going to be confusing for users 
> grepping through the tree trying to figure out how to use vtpm.

Yes, we should either do all or nothing.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:42:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:42:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSY9-0003zP-Hq; Mon, 19 Nov 2012 14:42:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaSY8-0003zI-MG
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:42:12 +0000
Received: from [85.158.143.99:44058] by server-3.bemta-4.messagelabs.com id
	71/39-06841-3454AA05; Mon, 19 Nov 2012 14:42:11 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1353336131!25210008!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29967 invoked from network); 19 Nov 2012 14:42:11 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 14:42:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,279,1352073600"; d="scan'208";a="15882068"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 14:39:45 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 14:39:44 +0000
Message-ID: <1353335983.18229.110.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Mon, 19 Nov 2012 14:39:43 +0000
In-Reply-To: <50AA393A.5050505@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352992629-5850-4-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353328024.18229.72.camel@zakaz.uk.xensource.com>
	<50AA393A.5050505@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 03/10] Remove old vtpm support from
	xm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 13:50 +0000, Matthew Fioravante wrote:
> Well I think you could keep the original removal patch and just not 
> apply this one if you don't want to mess with xm and xend.

The original one was the one which effectively (indirectly) removed the
xend feature though (unless somehow vtpm still works in xend after
that?)

>  The original 
> patch doesn't touch xm or xend and just removes the vtpm and 
> vtpm_manager code. The only reason I'm more inclined to remove all of 
> the old vtpm stuff is because its going to be confusing for users 
> grepping through the tree trying to figure out how to use vtpm.

Yes, we should either do all or nothing.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:43:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:43:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSZG-00045A-0P; Mon, 19 Nov 2012 14:43:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TaSZE-00044y-A2
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 14:43:20 +0000
Received: from [85.158.137.99:24386] by server-14.bemta-3.messagelabs.com id
	45/1A-12788-7854AA05; Mon, 19 Nov 2012 14:43:19 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1353336198!19594169!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2336 invoked from network); 19 Nov 2012 14:43:18 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 19 Nov 2012 14:43:18 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TaSZB-00093G-79; Mon, 19 Nov 2012 14:43:17 +0000
Date: Mon, 19 Nov 2012 14:43:17 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121119144317.GC31411@ocelot.phlegethon.org>
References: <1353080578-1487-1-git-send-email-stefano.stabellini@eu.citrix.com>
	<1353329757.18229.81.camel@zakaz.uk.xensource.com>
	<20121119130826.GB31411@ocelot.phlegethon.org>
	<1353333381.18229.90.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353333381.18229.90.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH v3] xen/arm: flush D-cache and I-cache when
	appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 13:56 +0000 on 19 Nov (1353333381), Ian Campbell wrote:
> On Mon, 2012-11-19 at 13:08 +0000, Tim Deegan wrote:
> > Sorry for the late review - I meant to get to these on Thursday but
> > hadn't time.  
> > 
> > At 12:55 +0000 on 19 Nov (1353329757), Ian Campbell wrote:
> > > > +/* Macro for flushing a single small item.  The predicate is always 
> > > > + * compile-time constant so this will compile down to 3 instructions in
> > > > + * the common case. 
> > 
> > This is no longer true!  The predicate now depends on the alignment of
> > the pointer, so this will compile to quite a bit of code, including the
> > memory barrier I was trying to avoid.
> 
> If p is static then isn't p + sizeof(*p) etc static and therefore the
> compiler can figure it out?

No.  Cacheline_bytes isn't known until run time, and even if p is
static, its value isn't known until link time. :(

> Stefano, what does it actually compile down to in practice?
> 
> > If we can sensibly restrict this to naturally-aligned objects smaller
> > than a cacheline, we should go back to the previous version of this
> > macro.  If not, I think we might as well just use
> > flush_xen_dcache_va_range(_p, sizeof *_p) and be done with it.
> 
> I've already committed it, so please send a followup patch of whichever
> sort is needed.

Will do.  Again, probably Thursday before I can get to it.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:43:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:43:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSZG-00045A-0P; Mon, 19 Nov 2012 14:43:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TaSZE-00044y-A2
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 14:43:20 +0000
Received: from [85.158.137.99:24386] by server-14.bemta-3.messagelabs.com id
	45/1A-12788-7854AA05; Mon, 19 Nov 2012 14:43:19 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1353336198!19594169!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2336 invoked from network); 19 Nov 2012 14:43:18 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 19 Nov 2012 14:43:18 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TaSZB-00093G-79; Mon, 19 Nov 2012 14:43:17 +0000
Date: Mon, 19 Nov 2012 14:43:17 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121119144317.GC31411@ocelot.phlegethon.org>
References: <1353080578-1487-1-git-send-email-stefano.stabellini@eu.citrix.com>
	<1353329757.18229.81.camel@zakaz.uk.xensource.com>
	<20121119130826.GB31411@ocelot.phlegethon.org>
	<1353333381.18229.90.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353333381.18229.90.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH v3] xen/arm: flush D-cache and I-cache when
	appropriate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 13:56 +0000 on 19 Nov (1353333381), Ian Campbell wrote:
> On Mon, 2012-11-19 at 13:08 +0000, Tim Deegan wrote:
> > Sorry for the late review - I meant to get to these on Thursday but
> > hadn't time.  
> > 
> > At 12:55 +0000 on 19 Nov (1353329757), Ian Campbell wrote:
> > > > +/* Macro for flushing a single small item.  The predicate is always 
> > > > + * compile-time constant so this will compile down to 3 instructions in
> > > > + * the common case. 
> > 
> > This is no longer true!  The predicate now depends on the alignment of
> > the pointer, so this will compile to quite a bit of code, including the
> > memory barrier I was trying to avoid.
> 
> If p is static then isn't p + sizeof(*p) etc static and therefore the
> compiler can figure it out?

No.  Cacheline_bytes isn't known until run time, and even if p is
static, its value isn't known until link time. :(

> Stefano, what does it actually compile down to in practice?
> 
> > If we can sensibly restrict this to naturally-aligned objects smaller
> > than a cacheline, we should go back to the previous version of this
> > macro.  If not, I think we might as well just use
> > flush_xen_dcache_va_range(_p, sizeof *_p) and be done with it.
> 
> I've already committed it, so please send a followup patch of whichever
> sort is needed.

Will do.  Again, probably Thursday before I can get to it.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:57:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:57:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSms-0004Ln-He; Mon, 19 Nov 2012 14:57:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Wei.Huang2@amd.com>) id 1TaSmq-0004Li-Q5
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:57:24 +0000
Received: from [193.109.254.147:8874] by server-1.bemta-14.messagelabs.com id
	0D/78-25314-3D84AA05; Mon, 19 Nov 2012 14:57:23 +0000
X-Env-Sender: Wei.Huang2@amd.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353337043!8855737!1
X-Originating-IP: [213.199.154.208]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5873 invoked from network); 19 Nov 2012 14:57:23 -0000
Received: from am1ehsobe005.messaging.microsoft.com (HELO
	am1outboundpool.messaging.microsoft.com) (213.199.154.208)
	by server-5.tower-27.messagelabs.com with AES128-SHA encrypted SMTP;
	19 Nov 2012 14:57:23 -0000
Received: from mail69-am1-R.bigfish.com (10.3.201.252) by
	AM1EHSOBE003.bigfish.com (10.3.204.23) with Microsoft SMTP Server id
	14.1.225.23; Mon, 19 Nov 2012 14:57:22 +0000
Received: from mail69-am1 (localhost [127.0.0.1])	by mail69-am1-R.bigfish.com
	(Postfix) with ESMTP id 4342F2A02BE;
	Mon, 19 Nov 2012 14:57:22 +0000 (UTC)
X-Forefront-Antispam-Report: CIP:163.181.249.108; KIP:(null); UIP:(null);
	IPV:NLI; H:ausb3twp01.amd.com; RD:none; EFVD:NLI
X-SpamScore: -2
X-BigFish: VPS-2(zz9371I542Mzz1de0h1202h1d1ah1d2ahzz8275bhz2dh668h839h944hd25hf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h14ddh1504h1537h153bh162dh1631h15d0l1155h)
Received: from mail69-am1 (localhost.localdomain [127.0.0.1]) by mail69-am1
	(MessageSwitch) id 1353337039350267_13440;
	Mon, 19 Nov 2012 14:57:19 +0000 (UTC)
Received: from AM1EHSMHS006.bigfish.com (unknown [10.3.201.249])	by
	mail69-am1.bigfish.com (Postfix) with ESMTP id 513EB3C004B;
	Mon, 19 Nov 2012 14:57:19 +0000 (UTC)
Received: from ausb3twp01.amd.com (163.181.249.108) by
	AM1EHSMHS006.bigfish.com (10.3.207.106) with Microsoft SMTP Server id
	14.1.225.23; Mon, 19 Nov 2012 14:57:18 +0000
X-WSS-ID: 0MDQPJF-01-933-02
X-M-MSG: 
Received: from sausexedgep01.amd.com (sausexedgep01-ext.amd.com
	[163.181.249.72])	(using TLSv1 with cipher AES128-SHA (128/128
	bits))	(No
	client certificate requested)	by ausb3twp01.amd.com (Axway MailGate
	3.8.1)
	with ESMTP id 21C05102840F;	Mon, 19 Nov 2012 08:57:14 -0600 (CST)
Received: from SAUSEXDAG03.amd.com (163.181.55.3) by sausexedgep01.amd.com
	(163.181.36.54) with Microsoft SMTP Server (TLS) id 8.3.192.1;
	Mon, 19 Nov 2012 08:57:32 -0600
Received: from SAUSEXDAG04.amd.com ([fe80::9143:6575:e649:e862]) by
	sausexdag03.amd.com ([fe80::85b5:3838:d8b4:20ba%19]) with mapi id
	14.02.0318.004; Mon, 19 Nov 2012 08:57:14 -0600
From: "Huang2, Wei" <Wei.Huang2@amd.com>
To: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Thread-Topic: [PATCH] AMD IOMMU: fix type of "bdf" parameter of
	update_intremap_entry_from_msi_msg()
Thread-Index: AQHNxmAV//WbzQ5p20WZQSP9SN0wGZfxP3fQ
Date: Mon, 19 Nov 2012 14:57:13 +0000
Message-ID: <4400B41FB768044EA720935D0808176C219897B0@sausexdag04.amd.com>
References: <50AA4CD402000078000A9B3B@nat28.tlf.novell.com>
In-Reply-To: <50AA4CD402000078000A9B3B@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.224.10.135]
MIME-Version: 1.0
X-OriginatorOrg: amd.com
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Wang <weiwang.dd@gmail.com>
Subject: Re: [Xen-devel] [PATCH] AMD IOMMU: fix type of "bdf" parameter of
 update_intremap_entry_from_msi_msg()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Acked-by: Wei Huang <wei.huang2@amd.com>

-Wei

-----Original Message-----
From: Jan Beulich [mailto:JBeulich@suse.com] 
Sent: Monday, November 19, 2012 8:14 AM
To: xen-devel
Cc: Huang2, Wei; Andrew Cooper; Wei Wang
Subject: [PATCH] AMD IOMMU: fix type of "bdf" parameter of update_intremap_entry_from_msi_msg()

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -263,7 +263,7 @@ void amd_iommu_ioapic_update_ire(  }
 
 static void update_intremap_entry_from_msi_msg(
-    struct amd_iommu *iommu, u8 bdf,
+    struct amd_iommu *iommu, u16 bdf,
     struct msi_desc *msi_desc, struct msi_msg *msg)  {
     unsigned long flags;






_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:57:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:57:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSms-0004Ln-He; Mon, 19 Nov 2012 14:57:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Wei.Huang2@amd.com>) id 1TaSmq-0004Li-Q5
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:57:24 +0000
Received: from [193.109.254.147:8874] by server-1.bemta-14.messagelabs.com id
	0D/78-25314-3D84AA05; Mon, 19 Nov 2012 14:57:23 +0000
X-Env-Sender: Wei.Huang2@amd.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353337043!8855737!1
X-Originating-IP: [213.199.154.208]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5873 invoked from network); 19 Nov 2012 14:57:23 -0000
Received: from am1ehsobe005.messaging.microsoft.com (HELO
	am1outboundpool.messaging.microsoft.com) (213.199.154.208)
	by server-5.tower-27.messagelabs.com with AES128-SHA encrypted SMTP;
	19 Nov 2012 14:57:23 -0000
Received: from mail69-am1-R.bigfish.com (10.3.201.252) by
	AM1EHSOBE003.bigfish.com (10.3.204.23) with Microsoft SMTP Server id
	14.1.225.23; Mon, 19 Nov 2012 14:57:22 +0000
Received: from mail69-am1 (localhost [127.0.0.1])	by mail69-am1-R.bigfish.com
	(Postfix) with ESMTP id 4342F2A02BE;
	Mon, 19 Nov 2012 14:57:22 +0000 (UTC)
X-Forefront-Antispam-Report: CIP:163.181.249.108; KIP:(null); UIP:(null);
	IPV:NLI; H:ausb3twp01.amd.com; RD:none; EFVD:NLI
X-SpamScore: -2
X-BigFish: VPS-2(zz9371I542Mzz1de0h1202h1d1ah1d2ahzz8275bhz2dh668h839h944hd25hf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h14ddh1504h1537h153bh162dh1631h15d0l1155h)
Received: from mail69-am1 (localhost.localdomain [127.0.0.1]) by mail69-am1
	(MessageSwitch) id 1353337039350267_13440;
	Mon, 19 Nov 2012 14:57:19 +0000 (UTC)
Received: from AM1EHSMHS006.bigfish.com (unknown [10.3.201.249])	by
	mail69-am1.bigfish.com (Postfix) with ESMTP id 513EB3C004B;
	Mon, 19 Nov 2012 14:57:19 +0000 (UTC)
Received: from ausb3twp01.amd.com (163.181.249.108) by
	AM1EHSMHS006.bigfish.com (10.3.207.106) with Microsoft SMTP Server id
	14.1.225.23; Mon, 19 Nov 2012 14:57:18 +0000
X-WSS-ID: 0MDQPJF-01-933-02
X-M-MSG: 
Received: from sausexedgep01.amd.com (sausexedgep01-ext.amd.com
	[163.181.249.72])	(using TLSv1 with cipher AES128-SHA (128/128
	bits))	(No
	client certificate requested)	by ausb3twp01.amd.com (Axway MailGate
	3.8.1)
	with ESMTP id 21C05102840F;	Mon, 19 Nov 2012 08:57:14 -0600 (CST)
Received: from SAUSEXDAG03.amd.com (163.181.55.3) by sausexedgep01.amd.com
	(163.181.36.54) with Microsoft SMTP Server (TLS) id 8.3.192.1;
	Mon, 19 Nov 2012 08:57:32 -0600
Received: from SAUSEXDAG04.amd.com ([fe80::9143:6575:e649:e862]) by
	sausexdag03.amd.com ([fe80::85b5:3838:d8b4:20ba%19]) with mapi id
	14.02.0318.004; Mon, 19 Nov 2012 08:57:14 -0600
From: "Huang2, Wei" <Wei.Huang2@amd.com>
To: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Thread-Topic: [PATCH] AMD IOMMU: fix type of "bdf" parameter of
	update_intremap_entry_from_msi_msg()
Thread-Index: AQHNxmAV//WbzQ5p20WZQSP9SN0wGZfxP3fQ
Date: Mon, 19 Nov 2012 14:57:13 +0000
Message-ID: <4400B41FB768044EA720935D0808176C219897B0@sausexdag04.amd.com>
References: <50AA4CD402000078000A9B3B@nat28.tlf.novell.com>
In-Reply-To: <50AA4CD402000078000A9B3B@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.224.10.135]
MIME-Version: 1.0
X-OriginatorOrg: amd.com
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Wang <weiwang.dd@gmail.com>
Subject: Re: [Xen-devel] [PATCH] AMD IOMMU: fix type of "bdf" parameter of
 update_intremap_entry_from_msi_msg()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Acked-by: Wei Huang <wei.huang2@amd.com>

-Wei

-----Original Message-----
From: Jan Beulich [mailto:JBeulich@suse.com] 
Sent: Monday, November 19, 2012 8:14 AM
To: xen-devel
Cc: Huang2, Wei; Andrew Cooper; Wei Wang
Subject: [PATCH] AMD IOMMU: fix type of "bdf" parameter of update_intremap_entry_from_msi_msg()

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -263,7 +263,7 @@ void amd_iommu_ioapic_update_ire(  }
 
 static void update_intremap_entry_from_msi_msg(
-    struct amd_iommu *iommu, u8 bdf,
+    struct amd_iommu *iommu, u16 bdf,
     struct msi_desc *msi_desc, struct msi_msg *msg)  {
     unsigned long flags;






_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:59:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:59:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSof-0004Qi-1T; Mon, 19 Nov 2012 14:59:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TaSoe-0004Qc-AM
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:59:16 +0000
Received: from [85.158.137.99:38978] by server-5.bemta-3.messagelabs.com id
	5F/04-26311-3494AA05; Mon, 19 Nov 2012 14:59:15 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353337154!19607362!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4892 invoked from network); 19 Nov 2012 14:59:14 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-2.tower-217.messagelabs.com with SMTP;
	19 Nov 2012 14:59:14 -0000
X-TM-IMSS-Message-ID: <97d82c31000b47e9@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 97d82c31000b47e9 ;
	Mon, 19 Nov 2012 09:58:39 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJEx9mU022608; 
	Mon, 19 Nov 2012 09:59:10 -0500
Message-ID: <50AA493D.5030805@tycho.nsa.gov>
Date: Mon, 19 Nov 2012 09:59:09 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-7-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA050A02000078000A9940@nat28.tlf.novell.com>
In-Reply-To: <50AA050A02000078000A9940@nat28.tlf.novell.com>
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 06/19] xen: use XSM instead of IS_PRIV where
	duplicated
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/19/2012 04:08 AM, Jan Beulich wrote:
>>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>> @@ -467,8 +451,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>>          if ( copy_from_guest(&irq_op, arg, 1) != 0 )
>>              break;
>>  
>> -        ret = -EPERM;
>> -        if ( !IS_PRIV(v->domain) )
>> +        ret = xsm_apic(v->domain, cmd);
> 
> Is that the right hook? There's nothing APIC related here.
> 
> Jan

There's nothing here at all: the hypercall is a noop. However, when I 
posted the patch without the XSM check I was told that a check still
needs to be performed in order to preserve compatability, and the 
comment below implies that this operation is done prior to programming 
the ioapic.

> 
>> +        if ( ret )
>>              break;
>>  
        /* Vector is only used by hypervisor, and dom0 shouldn't
           touch it in its world, return irq_op.irq as the vecotr,
           and make this hypercall dummy, and also defer the vector 
           allocation when dom0 tries to programe ioapic entry. */
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 14:59:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 14:59:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSof-0004Qi-1T; Mon, 19 Nov 2012 14:59:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TaSoe-0004Qc-AM
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 14:59:16 +0000
Received: from [85.158.137.99:38978] by server-5.bemta-3.messagelabs.com id
	5F/04-26311-3494AA05; Mon, 19 Nov 2012 14:59:15 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353337154!19607362!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4892 invoked from network); 19 Nov 2012 14:59:14 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-2.tower-217.messagelabs.com with SMTP;
	19 Nov 2012 14:59:14 -0000
X-TM-IMSS-Message-ID: <97d82c31000b47e9@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 97d82c31000b47e9 ;
	Mon, 19 Nov 2012 09:58:39 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJEx9mU022608; 
	Mon, 19 Nov 2012 09:59:10 -0500
Message-ID: <50AA493D.5030805@tycho.nsa.gov>
Date: Mon, 19 Nov 2012 09:59:09 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-7-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA050A02000078000A9940@nat28.tlf.novell.com>
In-Reply-To: <50AA050A02000078000A9940@nat28.tlf.novell.com>
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 06/19] xen: use XSM instead of IS_PRIV where
	duplicated
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/19/2012 04:08 AM, Jan Beulich wrote:
>>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>> @@ -467,8 +451,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>>          if ( copy_from_guest(&irq_op, arg, 1) != 0 )
>>              break;
>>  
>> -        ret = -EPERM;
>> -        if ( !IS_PRIV(v->domain) )
>> +        ret = xsm_apic(v->domain, cmd);
> 
> Is that the right hook? There's nothing APIC related here.
> 
> Jan

There's nothing here at all: the hypercall is a noop. However, when I 
posted the patch without the XSM check I was told that a check still
needs to be performed in order to preserve compatability, and the 
comment below implies that this operation is done prior to programming 
the ioapic.

> 
>> +        if ( ret )
>>              break;
>>  
        /* Vector is only used by hypervisor, and dom0 shouldn't
           touch it in its world, return irq_op.irq as the vecotr,
           and make this hypercall dummy, and also defer the vector 
           allocation when dom0 tries to programe ioapic entry. */
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 15:06:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:06:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSvi-0004ft-Tt; Mon, 19 Nov 2012 15:06:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaSvh-0004fo-Iy
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:06:33 +0000
Received: from [85.158.139.211:12904] by server-11.bemta-5.messagelabs.com id
	2D/6E-03409-8FA4AA05; Mon, 19 Nov 2012 15:06:32 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353337587!20699346!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17468 invoked from network); 19 Nov 2012 15:06:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 15:06:28 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15882842"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 15:06:27 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 15:06:27 +0000
Message-ID: <1353337586.18229.112.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Mon, 19 Nov 2012 15:06:26 +0000
In-Reply-To: <50AA3C13.7090601@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
	<50AA3C13.7090601@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 14:02 +0000, Matthew Fioravante wrote:
> Another option also would be to remove vtpm-stubdom and vtpmmgrdom from 
> the stubdom install target. This would make them optional components and 
> then cmake becomes an optional dependency.

If we were to do this then we'd probably want to add it as an option
configure.ac and plumb it through etc. Wecould make it autodetect cmake
and build if it can.

Actually, even if we don't do this then configure.ac needs to check for
cmake as well as updating the README.

>From the other mail:
> > Looks like we've grown a dependency on cmake. I vaguely recall
> > discussing before, can you remind me if this is a hard requirement on
> > the end user system or not.
> Unfortunately it is a hard requirement. Its used to pass the stubdom 
> build flags to the tpm_emulator.

This is this line:
        cd $@/build; cmake .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"

I took a look and the affect of doing this is not something we can
encode in the tpm_emulator.patch

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 15:06:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:06:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSvi-0004ft-Tt; Mon, 19 Nov 2012 15:06:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaSvh-0004fo-Iy
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:06:33 +0000
Received: from [85.158.139.211:12904] by server-11.bemta-5.messagelabs.com id
	2D/6E-03409-8FA4AA05; Mon, 19 Nov 2012 15:06:32 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353337587!20699346!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17468 invoked from network); 19 Nov 2012 15:06:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 15:06:28 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15882842"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 15:06:27 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 15:06:27 +0000
Message-ID: <1353337586.18229.112.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Mon, 19 Nov 2012 15:06:26 +0000
In-Reply-To: <50AA3C13.7090601@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
	<50AA3C13.7090601@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 14:02 +0000, Matthew Fioravante wrote:
> Another option also would be to remove vtpm-stubdom and vtpmmgrdom from 
> the stubdom install target. This would make them optional components and 
> then cmake becomes an optional dependency.

If we were to do this then we'd probably want to add it as an option
configure.ac and plumb it through etc. Wecould make it autodetect cmake
and build if it can.

Actually, even if we don't do this then configure.ac needs to check for
cmake as well as updating the README.

>From the other mail:
> > Looks like we've grown a dependency on cmake. I vaguely recall
> > discussing before, can you remind me if this is a hard requirement on
> > the end user system or not.
> Unfortunately it is a hard requirement. Its used to pass the stubdom 
> build flags to the tpm_emulator.

This is this line:
        cd $@/build; cmake .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"

I took a look and the affect of doing this is not something we can
encode in the tpm_emulator.patch

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 15:07:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:07:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSwJ-0004iF-BT; Mon, 19 Nov 2012 15:07:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaSwH-0004i3-4m
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:07:09 +0000
Received: from [85.158.138.51:5624] by server-12.bemta-3.messagelabs.com id
	8A/B9-22757-C1B4AA05; Mon, 19 Nov 2012 15:07:08 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353337626!30689961!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10779 invoked from network); 19 Nov 2012 15:07:07 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-5.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 15:07:07 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157600399;
	Mon, 19 Nov 2012 10:06:49 -0500
Message-ID: <50AA4B06.9020605@jhuapl.edu>
Date: Mon, 19 Nov 2012 10:06:46 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352992629-5850-4-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353328024.18229.72.camel@zakaz.uk.xensource.com>
	<50AA393A.5050505@jhuapl.edu>
	<1353335983.18229.110.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353335983.18229.110.camel@zakaz.uk.xensource.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 03/10] Remove old vtpm support from
	xm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4225332142499701088=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============4225332142499701088==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms050608060900060302000005"

This is a cryptographically signed message in MIME format.

--------------ms050608060900060302000005
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/19/2012 09:39 AM, Ian Campbell wrote:
> On Mon, 2012-11-19 at 13:50 +0000, Matthew Fioravante wrote:
>> Well I think you could keep the original removal patch and just not
>> apply this one if you don't want to mess with xm and xend.
> The original one was the one which effectively (indirectly) removed the=

> xend feature though (unless somehow vtpm still works in xend after
> that?)
It doesn't work in xend after the big removal patch because the files=20
xen tries to read will no longer exist. The user can specify vtpm=20
devices for xm but the results will be unpredictable. If the user uses=20
xm on domains without vtpm everything works like before.

The difference is that the xend and xm code have not been touched. This=20
means we have much lower but non-zero chance that xend/xm was somehow=20
broken by the removal. The last thing anyone here wants to do is solve=20
bug reports on deprecated xend/xm because of a change to the code. That=20
being said I'm pretty confident about my vtpm feature removals from xm=20
and did some preliminary testing. Still, theres no way to be 100% sure.
>>   The original
>> patch doesn't touch xm or xend and just removes the vtpm and
>> vtpm_manager code. The only reason I'm more inclined to remove all of
>> the old vtpm stuff is because its going to be confusing for users
>> grepping through the tree trying to figure out how to use vtpm.
> Yes, we should either do all or nothing.
>
> Ian.
>
>



--------------ms050608060900060302000005
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACA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EJMB1yqeswHQYD
VR0OBBYEFO6LYxg6r9wHZ+zdQtBHn1dZ/YTNMAkGA1UdEwQCMAAwGQYJKoZIhvZ9B0EABAww
ChsEVjcuMQMCBLAwDQYJKoZIhvcNAQEFBQADgYEAJO9HQh4YNChVLzuZqK5ARJARD8JoujGZ
fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTExOTE1MDY0NlowIwYJKoZIhvcNAQkEMRYEFOowYSYAyF+Zl5K5
Ronrj4I2u2TxMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYADhCfpHziVGp+YP2MpaDkbcUWh5tubrZrn
VkpoMEhUMl3raohtdZu9DQ3vq9v7AKl4XU7O5mw7Hkd3q2McN/XCPbTm6s9jaHoJKoZ12JcG
ZLLd7bbjnS568wHiZ5VYOpoK7nSPKT6aWnU2/hMyWnQAvSpYGd/ixZf4+Zuyx+r3ngAAAAAA
AA==
--------------ms050608060900060302000005--


--===============4225332142499701088==
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.xen.org
http://lists.xen.org/xen-devel

--===============4225332142499701088==--


From xen-devel-bounces@lists.xen.org Mon Nov 19 15:07:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:07:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSwJ-0004iF-BT; Mon, 19 Nov 2012 15:07:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaSwH-0004i3-4m
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:07:09 +0000
Received: from [85.158.138.51:5624] by server-12.bemta-3.messagelabs.com id
	8A/B9-22757-C1B4AA05; Mon, 19 Nov 2012 15:07:08 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353337626!30689961!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10779 invoked from network); 19 Nov 2012 15:07:07 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-5.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 15:07:07 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157600399;
	Mon, 19 Nov 2012 10:06:49 -0500
Message-ID: <50AA4B06.9020605@jhuapl.edu>
Date: Mon, 19 Nov 2012 10:06:46 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352992629-5850-4-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353328024.18229.72.camel@zakaz.uk.xensource.com>
	<50AA393A.5050505@jhuapl.edu>
	<1353335983.18229.110.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353335983.18229.110.camel@zakaz.uk.xensource.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 03/10] Remove old vtpm support from
	xm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4225332142499701088=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============4225332142499701088==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms050608060900060302000005"

This is a cryptographically signed message in MIME format.

--------------ms050608060900060302000005
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/19/2012 09:39 AM, Ian Campbell wrote:
> On Mon, 2012-11-19 at 13:50 +0000, Matthew Fioravante wrote:
>> Well I think you could keep the original removal patch and just not
>> apply this one if you don't want to mess with xm and xend.
> The original one was the one which effectively (indirectly) removed the=

> xend feature though (unless somehow vtpm still works in xend after
> that?)
It doesn't work in xend after the big removal patch because the files=20
xen tries to read will no longer exist. The user can specify vtpm=20
devices for xm but the results will be unpredictable. If the user uses=20
xm on domains without vtpm everything works like before.

The difference is that the xend and xm code have not been touched. This=20
means we have much lower but non-zero chance that xend/xm was somehow=20
broken by the removal. The last thing anyone here wants to do is solve=20
bug reports on deprecated xend/xm because of a change to the code. That=20
being said I'm pretty confident about my vtpm feature removals from xm=20
and did some preliminary testing. Still, theres no way to be 100% sure.
>>   The original
>> patch doesn't touch xm or xend and just removes the vtpm and
>> vtpm_manager code. The only reason I'm more inclined to remove all of
>> the old vtpm stuff is because its going to be confusing for users
>> grepping through the tree trying to figure out how to use vtpm.
> Yes, we should either do all or nothing.
>
> Ian.
>
>



--------------ms050608060900060302000005
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zS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AQkEMRYEFOowYSYAyF+Zl5K5
Ronrj4I2u2TxMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYADhCfpHziVGp+YP2MpaDkbcUWh5tubrZrn
VkpoMEhUMl3raohtdZu9DQ3vq9v7AKl4XU7O5mw7Hkd3q2McN/XCPbTm6s9jaHoJKoZ12JcG
ZLLd7bbjnS568wHiZ5VYOpoK7nSPKT6aWnU2/hMyWnQAvSpYGd/ixZf4+Zuyx+r3ngAAAAAA
AA==
--------------ms050608060900060302000005--


--===============4225332142499701088==
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.xen.org
http://lists.xen.org/xen-devel

--===============4225332142499701088==--


From xen-devel-bounces@lists.xen.org Mon Nov 19 15:10:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:10:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSzC-0004t1-UM; Mon, 19 Nov 2012 15:10:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaSzC-0004su-Bz
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:10:10 +0000
Received: from [85.158.137.99:55343] by server-14.bemta-3.messagelabs.com id
	89/17-12788-1DB4AA05; Mon, 19 Nov 2012 15:10:09 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-8.tower-217.messagelabs.com!1353337806!12875071!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14821 invoked from network); 19 Nov 2012 15:10:08 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-8.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 15:10:08 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157600751;
	Mon, 19 Nov 2012 10:09:58 -0500
Message-ID: <50AA4BC3.9050402@jhuapl.edu>
Date: Mon, 19 Nov 2012 10:09:55 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
	<50AA3C13.7090601@jhuapl.edu>
	<1353337586.18229.112.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353337586.18229.112.camel@zakaz.uk.xensource.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0577974082381296916=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============0577974082381296916==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms080204030502010501050304"

This is a cryptographically signed message in MIME format.

--------------ms080204030502010501050304
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/19/2012 10:06 AM, Ian Campbell wrote:
> On Mon, 2012-11-19 at 14:02 +0000, Matthew Fioravante wrote:
>> Another option also would be to remove vtpm-stubdom and vtpmmgrdom fro=
m
>> the stubdom install target. This would make them optional components a=
nd
>> then cmake becomes an optional dependency.
> If we were to do this then we'd probably want to add it as an option
> configure.ac and plumb it through etc. Wecould make it autodetect cmake=

> and build if it can.
>
> Actually, even if we don't do this then configure.ac needs to check for=

> cmake as well as updating the README.
I was under the assumption that configure.ac was only for building=20
tools, not stubdoms. Still an additional cmake check to configure.ac=20
might not be a bad idea.
>
>  From the other mail:
>>> Looks like we've grown a dependency on cmake. I vaguely recall
>>> discussing before, can you remind me if this is a hard requirement on=

>>> the end user system or not.
>> Unfortunately it is a hard requirement. Its used to pass the stubdom
>> build flags to the tpm_emulator.
> This is this line:
>          cd $@/build; cmake .. -DCMAKE_C_COMPILER=3D${CC} -DCMAKE_C_FLA=
GS=3D"-std=3Dc99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno=
-declaration-after-statement"
>
> I took a look and the affect of doing this is not something we can
> encode in the tpm_emulator.patch
Especially considering that the TARGET_CPPFLAGS etc.. change whether or=20
not you're on 32 or 64 and also may change if someone changes the=20
stubdom cross compiler setup.
>
> Ian.
>



--------------ms080204030502010501050304
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlCwMBAQEBBAoWCGZpb3JhbWUxMBsGDSsGAQQBsyUL
AwEBAQIEChIIMDAxMDQyNjEwWAYJYIZIAYb6ax4BBEsMSVRoZSBwcml2YXRlIGtleSBjb3Jy
ZXNwb25kaW5nIHRvIHRoaXMgY2VydGlmaWNhdGUgbWF5IGhhdmUgYmVlbiBleHBvcnRlZC4w
KAYDVR0RBCEwH4EdTWF0dGhldy5GaW9yYXZhbnRlQGpodWFwbC5lZHUwUgYDVR0fBEswSTBH
oEWgQ6RBMD8xCzAJBgNVBAYTAlVTMQ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us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

--===============0577974082381296916==--


From xen-devel-bounces@lists.xen.org Mon Nov 19 15:10:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:10:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaSzC-0004t1-UM; Mon, 19 Nov 2012 15:10:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaSzC-0004su-Bz
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:10:10 +0000
Received: from [85.158.137.99:55343] by server-14.bemta-3.messagelabs.com id
	89/17-12788-1DB4AA05; Mon, 19 Nov 2012 15:10:09 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-8.tower-217.messagelabs.com!1353337806!12875071!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14821 invoked from network); 19 Nov 2012 15:10:08 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-8.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 15:10:08 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157600751;
	Mon, 19 Nov 2012 10:09:58 -0500
Message-ID: <50AA4BC3.9050402@jhuapl.edu>
Date: Mon, 19 Nov 2012 10:09:55 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
	<50AA3C13.7090601@jhuapl.edu>
	<1353337586.18229.112.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353337586.18229.112.camel@zakaz.uk.xensource.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0577974082381296916=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============0577974082381296916==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms080204030502010501050304"

This is a cryptographically signed message in MIME format.

--------------ms080204030502010501050304
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/19/2012 10:06 AM, Ian Campbell wrote:
> On Mon, 2012-11-19 at 14:02 +0000, Matthew Fioravante wrote:
>> Another option also would be to remove vtpm-stubdom and vtpmmgrdom fro=
m
>> the stubdom install target. This would make them optional components a=
nd
>> then cmake becomes an optional dependency.
> If we were to do this then we'd probably want to add it as an option
> configure.ac and plumb it through etc. Wecould make it autodetect cmake=

> and build if it can.
>
> Actually, even if we don't do this then configure.ac needs to check for=

> cmake as well as updating the README.
I was under the assumption that configure.ac was only for building=20
tools, not stubdoms. Still an additional cmake check to configure.ac=20
might not be a bad idea.
>
>  From the other mail:
>>> Looks like we've grown a dependency on cmake. I vaguely recall
>>> discussing before, can you remind me if this is a hard requirement on=

>>> the end user system or not.
>> Unfortunately it is a hard requirement. Its used to pass the stubdom
>> build flags to the tpm_emulator.
> This is this line:
>          cd $@/build; cmake .. -DCMAKE_C_COMPILER=3D${CC} -DCMAKE_C_FLA=
GS=3D"-std=3Dc99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno=
-declaration-after-statement"
>
> I took a look and the affect of doing this is not something we can
> encode in the tpm_emulator.patch
Especially considering that the TARGET_CPPFLAGS etc.. change whether or=20
not you're on 32 or 64 and also may change if someone changes the=20
stubdom cross compiler setup.
>
> Ian.
>



--------------ms080204030502010501050304
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50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AYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTExOTE1MDk1NVowIwYJKoZIhvcNAQkEMRYEFKc+7rOSPQAMZnwr
0sWEvjjfG/IWMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAS4xvPC9bdPQ1YTp2ZJCxCA46qmMMhBXRE
m298Nb35s47/HQuaeDOlVJ3Kcss8GfqM6GbkVQ4Nu12CujP9ZLCN6FMtiAfrCh5dVkHeYjqy
bZgIh+teLv8X2qPhhWmewBzc4qnsZ/kM/LKZqOnIRaZaNUTkTcHjYD/4JrGhrmWkzgAAAAAA
AA==
--------------ms080204030502010501050304--


--===============0577974082381296916==
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.xen.org
http://lists.xen.org/xen-devel

--===============0577974082381296916==--


From xen-devel-bounces@lists.xen.org Mon Nov 19 15:11:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:11:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaT0Q-00051J-Js; Mon, 19 Nov 2012 15:11:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaT0P-00051A-Ii
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:11:25 +0000
Received: from [85.158.143.35:50273] by server-3.bemta-4.messagelabs.com id
	7B/4D-06841-C1C4AA05; Mon, 19 Nov 2012 15:11:24 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1353337869!10417752!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2955 invoked from network); 19 Nov 2012 15:11:09 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 15:11:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15883084"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 15:11:09 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 15:11:09 +0000
Message-ID: <1353337867.18229.116.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Mon, 19 Nov 2012 15:11:07 +0000
In-Reply-To: <50AA4B06.9020605@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352992629-5850-4-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353328024.18229.72.camel@zakaz.uk.xensource.com>
	<50AA393A.5050505@jhuapl.edu>
	<1353335983.18229.110.camel@zakaz.uk.xensource.com>
	<50AA4B06.9020605@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 03/10] Remove old vtpm support from
	xm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 15:06 +0000, Matthew Fioravante wrote:
> On 11/19/2012 09:39 AM, Ian Campbell wrote:
> > On Mon, 2012-11-19 at 13:50 +0000, Matthew Fioravante wrote:
> >> Well I think you could keep the original removal patch and just not
> >> apply this one if you don't want to mess with xm and xend.
> > The original one was the one which effectively (indirectly) removed the
> > xend feature though (unless somehow vtpm still works in xend after
> > that?)
> It doesn't work in xend after the big removal patch because the files 
> xen tries to read will no longer exist. The user can specify vtpm 
> devices for xm but the results will be unpredictable. If the user uses 
> xm on domains without vtpm everything works like before.
>
> The difference is that the xend and xm code have not been touched. This 
> means we have much lower but non-zero chance that xend/xm was somehow 
> broken by the removal. The last thing anyone here wants to do is solve 
> bug reports on deprecated xend/xm because of a change to the code. That 
> being said I'm pretty confident about my vtpm feature removals from xm 
> and did some preliminary testing. Still, theres no way to be 100% sure.

My question in this thread is whether it is ok to remove the feature of
using vtpm with xend in this release, not whether the risk of changing
xend here is worth it etc.

As I said a few posts back: being deprecated and unmaintained is
different to actively removing features, which is what we effective did
with the patch which removed the vtpm process model stuff. We want to be
sure this is actually an ok thing to be doing -- i.e. are we pulling the
rug out from under someone prematurely.

Based on Pasi's reply it seems like no one is using the tpm stuff with
xend, so we are fine.

> >>   The original
> >> patch doesn't touch xm or xend and just removes the vtpm and
> >> vtpm_manager code. The only reason I'm more inclined to remove all of
> >> the old vtpm stuff is because its going to be confusing for users
> >> grepping through the tree trying to figure out how to use vtpm.
> > Yes, we should either do all or nothing.
> >
> > Ian.
> >
> >
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 15:11:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:11:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaT0Q-00051J-Js; Mon, 19 Nov 2012 15:11:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaT0P-00051A-Ii
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:11:25 +0000
Received: from [85.158.143.35:50273] by server-3.bemta-4.messagelabs.com id
	7B/4D-06841-C1C4AA05; Mon, 19 Nov 2012 15:11:24 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1353337869!10417752!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2955 invoked from network); 19 Nov 2012 15:11:09 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 15:11:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15883084"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 15:11:09 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 15:11:09 +0000
Message-ID: <1353337867.18229.116.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Mon, 19 Nov 2012 15:11:07 +0000
In-Reply-To: <50AA4B06.9020605@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1352992629-5850-4-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353328024.18229.72.camel@zakaz.uk.xensource.com>
	<50AA393A.5050505@jhuapl.edu>
	<1353335983.18229.110.camel@zakaz.uk.xensource.com>
	<50AA4B06.9020605@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 03/10] Remove old vtpm support from
	xm
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 15:06 +0000, Matthew Fioravante wrote:
> On 11/19/2012 09:39 AM, Ian Campbell wrote:
> > On Mon, 2012-11-19 at 13:50 +0000, Matthew Fioravante wrote:
> >> Well I think you could keep the original removal patch and just not
> >> apply this one if you don't want to mess with xm and xend.
> > The original one was the one which effectively (indirectly) removed the
> > xend feature though (unless somehow vtpm still works in xend after
> > that?)
> It doesn't work in xend after the big removal patch because the files 
> xen tries to read will no longer exist. The user can specify vtpm 
> devices for xm but the results will be unpredictable. If the user uses 
> xm on domains without vtpm everything works like before.
>
> The difference is that the xend and xm code have not been touched. This 
> means we have much lower but non-zero chance that xend/xm was somehow 
> broken by the removal. The last thing anyone here wants to do is solve 
> bug reports on deprecated xend/xm because of a change to the code. That 
> being said I'm pretty confident about my vtpm feature removals from xm 
> and did some preliminary testing. Still, theres no way to be 100% sure.

My question in this thread is whether it is ok to remove the feature of
using vtpm with xend in this release, not whether the risk of changing
xend here is worth it etc.

As I said a few posts back: being deprecated and unmaintained is
different to actively removing features, which is what we effective did
with the patch which removed the vtpm process model stuff. We want to be
sure this is actually an ok thing to be doing -- i.e. are we pulling the
rug out from under someone prematurely.

Based on Pasi's reply it seems like no one is using the tpm stuff with
xend, so we are fine.

> >>   The original
> >> patch doesn't touch xm or xend and just removes the vtpm and
> >> vtpm_manager code. The only reason I'm more inclined to remove all of
> >> the old vtpm stuff is because its going to be confusing for users
> >> grepping through the tree trying to figure out how to use vtpm.
> > Yes, we should either do all or nothing.
> >
> > Ian.
> >
> >
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 15:14:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:14:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaT34-0005Do-72; Mon, 19 Nov 2012 15:14:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaT32-0005Dh-UE
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:14:09 +0000
Received: from [85.158.143.99:53093] by server-2.bemta-4.messagelabs.com id
	30/CE-28922-0CC4AA05; Mon, 19 Nov 2012 15:14:08 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1353338047!30485894!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10804 invoked from network); 19 Nov 2012 15:14:07 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 15:14:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15883145"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 15:12:45 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 15:12:45 +0000
Message-ID: <1353337964.18229.118.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Mon, 19 Nov 2012 15:12:44 +0000
In-Reply-To: <50AA4BC3.9050402@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
	<50AA3C13.7090601@jhuapl.edu>
	<1353337586.18229.112.camel@zakaz.uk.xensource.com>
	<50AA4BC3.9050402@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 15:09 +0000, Matthew Fioravante wrote:
> On 11/19/2012 10:06 AM, Ian Campbell wrote:
> > On Mon, 2012-11-19 at 14:02 +0000, Matthew Fioravante wrote:
> >> Another option also would be to remove vtpm-stubdom and vtpmmgrdom from
> >> the stubdom install target. This would make them optional components and
> >> then cmake becomes an optional dependency.
> > If we were to do this then we'd probably want to add it as an option
> > configure.ac and plumb it through etc. Wecould make it autodetect cmake
> > and build if it can.
> >
> > Actually, even if we don't do this then configure.ac needs to check for
> > cmake as well as updating the README.
> I was under the assumption that configure.ac was only for building 
> tools, not stubdoms.

Yes, that's true.

>  Still an additional cmake check to configure.ac 
> might not be a bad idea.

Another option would be to add stubdom/configure.ac I suppose. We were
considering something like that for the docs subtree for example.

> >  From the other mail:
> >>> Looks like we've grown a dependency on cmake. I vaguely recall
> >>> discussing before, can you remind me if this is a hard requirement on
> >>> the end user system or not.
> >> Unfortunately it is a hard requirement. Its used to pass the stubdom
> >> build flags to the tpm_emulator.
> > This is this line:
> >          cd $@/build; cmake .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
> >
> > I took a look and the affect of doing this is not something we can
> > encode in the tpm_emulator.patch
> Especially considering that the TARGET_CPPFLAGS etc.. change whether or 
> not you're on 32 or 64 and also may change if someone changes the 
> stubdom cross compiler setup.

I half expected that ${CC} and $(TARGET_...) would end up unexpanded in
the output, but no.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 15:14:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:14:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaT34-0005Do-72; Mon, 19 Nov 2012 15:14:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaT32-0005Dh-UE
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:14:09 +0000
Received: from [85.158.143.99:53093] by server-2.bemta-4.messagelabs.com id
	30/CE-28922-0CC4AA05; Mon, 19 Nov 2012 15:14:08 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1353338047!30485894!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10804 invoked from network); 19 Nov 2012 15:14:07 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 15:14:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15883145"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 15:12:45 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 15:12:45 +0000
Message-ID: <1353337964.18229.118.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Mon, 19 Nov 2012 15:12:44 +0000
In-Reply-To: <50AA4BC3.9050402@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
	<50AA3C13.7090601@jhuapl.edu>
	<1353337586.18229.112.camel@zakaz.uk.xensource.com>
	<50AA4BC3.9050402@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 15:09 +0000, Matthew Fioravante wrote:
> On 11/19/2012 10:06 AM, Ian Campbell wrote:
> > On Mon, 2012-11-19 at 14:02 +0000, Matthew Fioravante wrote:
> >> Another option also would be to remove vtpm-stubdom and vtpmmgrdom from
> >> the stubdom install target. This would make them optional components and
> >> then cmake becomes an optional dependency.
> > If we were to do this then we'd probably want to add it as an option
> > configure.ac and plumb it through etc. Wecould make it autodetect cmake
> > and build if it can.
> >
> > Actually, even if we don't do this then configure.ac needs to check for
> > cmake as well as updating the README.
> I was under the assumption that configure.ac was only for building 
> tools, not stubdoms.

Yes, that's true.

>  Still an additional cmake check to configure.ac 
> might not be a bad idea.

Another option would be to add stubdom/configure.ac I suppose. We were
considering something like that for the docs subtree for example.

> >  From the other mail:
> >>> Looks like we've grown a dependency on cmake. I vaguely recall
> >>> discussing before, can you remind me if this is a hard requirement on
> >>> the end user system or not.
> >> Unfortunately it is a hard requirement. Its used to pass the stubdom
> >> build flags to the tpm_emulator.
> > This is this line:
> >          cd $@/build; cmake .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
> >
> > I took a look and the affect of doing this is not something we can
> > encode in the tpm_emulator.patch
> Especially considering that the TARGET_CPPFLAGS etc.. change whether or 
> not you're on 32 or 64 and also may change if someone changes the 
> stubdom cross compiler setup.

I half expected that ${CC} and $(TARGET_...) would end up unexpanded in
the output, but no.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 15:17:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:17:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaT5y-0005NO-Q0; Mon, 19 Nov 2012 15:17:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TaT5x-0005NC-QB
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:17:09 +0000
Received: from [193.109.254.147:56022] by server-1.bemta-14.messagelabs.com id
	B1/E4-25314-57D4AA05; Mon, 19 Nov 2012 15:17:09 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-12.tower-27.messagelabs.com!1353338208!9395165!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14823 invoked from network); 19 Nov 2012 15:16:49 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-12.tower-27.messagelabs.com with SMTP;
	19 Nov 2012 15:16:49 -0000
X-TM-IMSS-Message-ID: <97e84674000b4c10@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 97e84674000b4c10 ;
	Mon, 19 Nov 2012 10:16:14 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJFGhZX024012; 
	Mon, 19 Nov 2012 10:16:44 -0500
Message-ID: <50AA4D5B.2020909@tycho.nsa.gov>
Date: Mon, 19 Nov 2012 10:16:43 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-7-git-send-email-dgdegra@tycho.nsa.gov>
	<1353322804.18229.43.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353322804.18229.43.camel@zakaz.uk.xensource.com>
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 06/19] xen: use XSM instead of IS_PRIV where
 duplicated
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/19/2012 06:00 AM, Ian Campbell wrote:
> On Fri, 2012-11-16 at 18:28 +0000, Daniel De Graaf wrote:
>> The Xen hypervisor has two basic access control function calls: IS_PRIV
>> and the xsm_* functions. Most privileged operations currently require
>> that both checks succeed, and many times the checks are at different
>> locations in the code. This patch eliminates the explicit and implicit
>> IS_PRIV checks that are duplicated in XSM hooks.
> 
> The downside is that you loose some context in the hypercall
> implementation, i.e. the hint about whether a hypercall is available
> only to the toolstack, or to only stubdomains or more generally to all
> guests etc which is useful to have in front of you when changing the
> code.
> 
> IOW I worry that we may end up introducing bugs due to hiding this
> context away behind the xsm wrapper, e.g. you think a function is
> privileged guest only but actually it is guest accessible.
> 
> I wonder if there is any way we can get the benefits of this change
> without this downside?
> 
> Perhaps in the name of the hook? e.g. For each existing xsm_<foo> we
> instead define exactly one of xsm_guest_<foo>, xsm_stubdom_<foo> or
> xsm_priv_<foo>. This might also let us define some macros for use in
> dummy.[ch] which simultaneously construct the correct function name and
> include the appropriate boilerplate perm check thus ensuring they don't
> get out of sync.

I think something like this would help clarify the intended purpose of the
access control check. I think it may also be useful to split "priv" further
into "dom0" for hardware functionality and "ctl" for domain administration;
without looking at the hooks in detail, that should cover most categories.

One other problem that I would like to resolve is that the XSM functions
in dummy.h aren't visible to ctags; it might be useful to name the dummy
functions identically to the XSM hooks and construct dummy.c to avoid
including the duplicate definitions.

>> Some checks are removed due to non-obvious duplicates in their callers:
> 
> If the duplicates are non-obvious wouldn't it be better to keep them as
> a belt-and-braces measure?
> 
> Ian.

In this case, "non-obvious" meant "not obvious from a patch context". Keeping
the duplicated calls would require either leaving the IS_PRIV checks (where
the whole point of this patch is to remove them) or creating new, redundant
XSM hooks.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 15:17:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:17:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaT5y-0005NO-Q0; Mon, 19 Nov 2012 15:17:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TaT5x-0005NC-QB
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:17:09 +0000
Received: from [193.109.254.147:56022] by server-1.bemta-14.messagelabs.com id
	B1/E4-25314-57D4AA05; Mon, 19 Nov 2012 15:17:09 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-12.tower-27.messagelabs.com!1353338208!9395165!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14823 invoked from network); 19 Nov 2012 15:16:49 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-12.tower-27.messagelabs.com with SMTP;
	19 Nov 2012 15:16:49 -0000
X-TM-IMSS-Message-ID: <97e84674000b4c10@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 97e84674000b4c10 ;
	Mon, 19 Nov 2012 10:16:14 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJFGhZX024012; 
	Mon, 19 Nov 2012 10:16:44 -0500
Message-ID: <50AA4D5B.2020909@tycho.nsa.gov>
Date: Mon, 19 Nov 2012 10:16:43 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-7-git-send-email-dgdegra@tycho.nsa.gov>
	<1353322804.18229.43.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353322804.18229.43.camel@zakaz.uk.xensource.com>
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 06/19] xen: use XSM instead of IS_PRIV where
 duplicated
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/19/2012 06:00 AM, Ian Campbell wrote:
> On Fri, 2012-11-16 at 18:28 +0000, Daniel De Graaf wrote:
>> The Xen hypervisor has two basic access control function calls: IS_PRIV
>> and the xsm_* functions. Most privileged operations currently require
>> that both checks succeed, and many times the checks are at different
>> locations in the code. This patch eliminates the explicit and implicit
>> IS_PRIV checks that are duplicated in XSM hooks.
> 
> The downside is that you loose some context in the hypercall
> implementation, i.e. the hint about whether a hypercall is available
> only to the toolstack, or to only stubdomains or more generally to all
> guests etc which is useful to have in front of you when changing the
> code.
> 
> IOW I worry that we may end up introducing bugs due to hiding this
> context away behind the xsm wrapper, e.g. you think a function is
> privileged guest only but actually it is guest accessible.
> 
> I wonder if there is any way we can get the benefits of this change
> without this downside?
> 
> Perhaps in the name of the hook? e.g. For each existing xsm_<foo> we
> instead define exactly one of xsm_guest_<foo>, xsm_stubdom_<foo> or
> xsm_priv_<foo>. This might also let us define some macros for use in
> dummy.[ch] which simultaneously construct the correct function name and
> include the appropriate boilerplate perm check thus ensuring they don't
> get out of sync.

I think something like this would help clarify the intended purpose of the
access control check. I think it may also be useful to split "priv" further
into "dom0" for hardware functionality and "ctl" for domain administration;
without looking at the hooks in detail, that should cover most categories.

One other problem that I would like to resolve is that the XSM functions
in dummy.h aren't visible to ctags; it might be useful to name the dummy
functions identically to the XSM hooks and construct dummy.c to avoid
including the duplicate definitions.

>> Some checks are removed due to non-obvious duplicates in their callers:
> 
> If the duplicates are non-obvious wouldn't it be better to keep them as
> a belt-and-braces measure?
> 
> Ian.

In this case, "non-obvious" meant "not obvious from a patch context". Keeping
the duplicated calls would require either leaving the IS_PRIV checks (where
the whole point of this patch is to remove them) or creating new, redundant
XSM hooks.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 15:22:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:22:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaTAm-0005Y1-Gl; Mon, 19 Nov 2012 15:22:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaTAk-0005Xr-UV
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:22:07 +0000
Received: from [85.158.139.83:51818] by server-8.bemta-5.messagelabs.com id
	43/44-06050-E9E4AA05; Mon, 19 Nov 2012 15:22:06 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-4.tower-182.messagelabs.com!1353338519!28244998!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6752 invoked from network); 19 Nov 2012 15:22:02 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-4.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 15:22:02 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157602114;
	Mon, 19 Nov 2012 10:21:52 -0500
Message-ID: <50AA4E8D.7030702@jhuapl.edu>
Date: Mon, 19 Nov 2012 10:21:49 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
	<50AA3C13.7090601@jhuapl.edu>
	<1353337586.18229.112.camel@zakaz.uk.xensource.com>
	<50AA4BC3.9050402@jhuapl.edu>
	<1353337964.18229.118.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353337964.18229.118.camel@zakaz.uk.xensource.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6403525823283579327=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============6403525823283579327==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms050101010608020801060909"

This is a cryptographically signed message in MIME format.

--------------ms050101010608020801060909
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/19/2012 10:12 AM, Ian Campbell wrote:
> On Mon, 2012-11-19 at 15:09 +0000, Matthew Fioravante wrote:
>> On 11/19/2012 10:06 AM, Ian Campbell wrote:
>>> On Mon, 2012-11-19 at 14:02 +0000, Matthew Fioravante wrote:
>>>> Another option also would be to remove vtpm-stubdom and vtpmmgrdom f=
rom
>>>> the stubdom install target. This would make them optional components=
 and
>>>> then cmake becomes an optional dependency.
>>> If we were to do this then we'd probably want to add it as an option
>>> configure.ac and plumb it through etc. Wecould make it autodetect cma=
ke
>>> and build if it can.
>>>
>>> Actually, even if we don't do this then configure.ac needs to check f=
or
>>> cmake as well as updating the README.
>> I was under the assumption that configure.ac was only for building
>> tools, not stubdoms.
> Yes, that's true.
>
>>   Still an additional cmake check to configure.ac
>> might not be a bad idea.
> Another option would be to add stubdom/configure.ac I suppose. We were
> considering something like that for the docs subtree for example.
Why not a global configure.ac to setup everything instead of a bunch of=20
separate ones spread out all over the place? You could for example do=20
--enable-tools --enable-stubdom --enable-docs, etc.. to compile specific =

pieces and enable/disable their dependencies.

Either way this is a rather large change to the build system and I think =

it's digressing from the original topic. For now I'll just document the=20
cmake dependency unless anyone requests something stronger than that.

>
>>>   From the other mail:
>>>>> Looks like we've grown a dependency on cmake. I vaguely recall
>>>>> discussing before, can you remind me if this is a hard requirement =
on
>>>>> the end user system or not.
>>>> Unfortunately it is a hard requirement. Its used to pass the stubdom=

>>>> build flags to the tpm_emulator.
>>> This is this line:
>>>           cd $@/build; cmake .. -DCMAKE_C_COMPILER=3D${CC} -DCMAKE_C_=
FLAGS=3D"-std=3Dc99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -=
Wno-declaration-after-statement"
>>>
>>> I took a look and the affect of doing this is not something we can
>>> encode in the tpm_emulator.patch
>> Especially considering that the TARGET_CPPFLAGS etc.. change whether o=
r
>> not you're on 32 or 64 and also may change if someone changes the
>> stubdom cross compiler setup.
> I half expected that ${CC} and $(TARGET_...) would end up unexpanded in=

> the output, but no.
>
> Ian.
>



--------------ms050101010608020801060909
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl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aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTExOTE1MjE0OVowIwYJKoZIhvcNAQkEMRYEFMbSrgMH9gpSJC9L
YL4scul3UmbtMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYBUbiDxMkju1KkJOcukCVgVbTL47buDHyIT
T0rQHBg06QIygObKaXF+kHQI+oqMHgvv8ravPt5Bb0aBul/ECxrRzqMBQ+ZVf01JC6RpSlEo
DcnYY71VO+3WV4uhYN/ziwjTSvn3aSe2zQaanwG2jK6t1K3AZ2tJk980QlnhS/p6ygAAAAAA
AA==
--------------ms050101010608020801060909--


--===============6403525823283579327==
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.xen.org
http://lists.xen.org/xen-devel

--===============6403525823283579327==--


From xen-devel-bounces@lists.xen.org Mon Nov 19 15:22:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:22:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaTAm-0005Y1-Gl; Mon, 19 Nov 2012 15:22:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaTAk-0005Xr-UV
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:22:07 +0000
Received: from [85.158.139.83:51818] by server-8.bemta-5.messagelabs.com id
	43/44-06050-E9E4AA05; Mon, 19 Nov 2012 15:22:06 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-4.tower-182.messagelabs.com!1353338519!28244998!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6752 invoked from network); 19 Nov 2012 15:22:02 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-4.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 15:22:02 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157602114;
	Mon, 19 Nov 2012 10:21:52 -0500
Message-ID: <50AA4E8D.7030702@jhuapl.edu>
Date: Mon, 19 Nov 2012 10:21:49 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
	<50AA3C13.7090601@jhuapl.edu>
	<1353337586.18229.112.camel@zakaz.uk.xensource.com>
	<50AA4BC3.9050402@jhuapl.edu>
	<1353337964.18229.118.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353337964.18229.118.camel@zakaz.uk.xensource.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6403525823283579327=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============6403525823283579327==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms050101010608020801060909"

This is a cryptographically signed message in MIME format.

--------------ms050101010608020801060909
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/19/2012 10:12 AM, Ian Campbell wrote:
> On Mon, 2012-11-19 at 15:09 +0000, Matthew Fioravante wrote:
>> On 11/19/2012 10:06 AM, Ian Campbell wrote:
>>> On Mon, 2012-11-19 at 14:02 +0000, Matthew Fioravante wrote:
>>>> Another option also would be to remove vtpm-stubdom and vtpmmgrdom f=
rom
>>>> the stubdom install target. This would make them optional components=
 and
>>>> then cmake becomes an optional dependency.
>>> If we were to do this then we'd probably want to add it as an option
>>> configure.ac and plumb it through etc. Wecould make it autodetect cma=
ke
>>> and build if it can.
>>>
>>> Actually, even if we don't do this then configure.ac needs to check f=
or
>>> cmake as well as updating the README.
>> I was under the assumption that configure.ac was only for building
>> tools, not stubdoms.
> Yes, that's true.
>
>>   Still an additional cmake check to configure.ac
>> might not be a bad idea.
> Another option would be to add stubdom/configure.ac I suppose. We were
> considering something like that for the docs subtree for example.
Why not a global configure.ac to setup everything instead of a bunch of=20
separate ones spread out all over the place? You could for example do=20
--enable-tools --enable-stubdom --enable-docs, etc.. to compile specific =

pieces and enable/disable their dependencies.

Either way this is a rather large change to the build system and I think =

it's digressing from the original topic. For now I'll just document the=20
cmake dependency unless anyone requests something stronger than that.

>
>>>   From the other mail:
>>>>> Looks like we've grown a dependency on cmake. I vaguely recall
>>>>> discussing before, can you remind me if this is a hard requirement =
on
>>>>> the end user system or not.
>>>> Unfortunately it is a hard requirement. Its used to pass the stubdom=

>>>> build flags to the tpm_emulator.
>>> This is this line:
>>>           cd $@/build; cmake .. -DCMAKE_C_COMPILER=3D${CC} -DCMAKE_C_=
FLAGS=3D"-std=3Dc99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -=
Wno-declaration-after-statement"
>>>
>>> I took a look and the affect of doing this is not something we can
>>> encode in the tpm_emulator.patch
>> Especially considering that the TARGET_CPPFLAGS etc.. change whether o=
r
>> not you're on 32 or 64 and also may change if someone changes the
>> stubdom cross compiler setup.
> I half expected that ${CC} and $(TARGET_...) would end up unexpanded in=

> the output, but no.
>
> Ian.
>



--------------ms050101010608020801060909
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1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NLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTExOTE1MjE0OVowIwYJKoZIhvcNAQkEMRYEFMbSrgMH9gpSJC9L
YL4scul3UmbtMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYBUbiDxMkju1KkJOcukCVgVbTL47buDHyIT
T0rQHBg06QIygObKaXF+kHQI+oqMHgvv8ravPt5Bb0aBul/ECxrRzqMBQ+ZVf01JC6RpSlEo
DcnYY71VO+3WV4uhYN/ziwjTSvn3aSe2zQaanwG2jK6t1K3AZ2tJk980QlnhS/p6ygAAAAAA
AA==
--------------ms050101010608020801060909--


--===============6403525823283579327==
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.xen.org
http://lists.xen.org/xen-devel

--===============6403525823283579327==--


From xen-devel-bounces@lists.xen.org Mon Nov 19 15:36:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:36:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaTOZ-0005lQ-2K; Mon, 19 Nov 2012 15:36:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TaTOY-0005lL-2c
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 15:36:22 +0000
Received: from [193.109.254.147:14900] by server-11.bemta-14.messagelabs.com
	id 30/BA-29027-5F15AA05; Mon, 19 Nov 2012 15:36:21 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1353339372!9397866!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ2Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17003 invoked from network); 19 Nov 2012 15:36:15 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 15:36:15 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="45041935"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 15:35:09 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 10:35:09 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TaTNM-0007Ae-Rk;
	Mon, 19 Nov 2012 15:35:08 +0000
Message-ID: <50AA5061.7040103@eu.citrix.com>
Date: Mon, 19 Nov 2012 15:29:37 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353318919.18229.7.camel@zakaz.uk.xensource.com>
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 19/11/12 09:55, Ian Campbell wrote:
> If we get to this stage then haven't we either already sent something
> over the wire for this page or marked it as dirty when we tried and
> failed to send it?
>
> In the former case we don't care that the page is now broken on the
> source since the target has got a good pre-breakage copy.
>
> In the latter case could we not set a flag at the same time as we mark
> the page dirty which means "go round at least one more time"?

Yeah -- on the last iteration, the VM itself has to be paused; if any 
pages get broken after that, it doesn't really matter, does it? The real 
thing is to have a consistent "snapshot" of behavior.

I guess the one potentially tricky case to worry about is whether to 
deliver an MCE to the guest on restore.  Consider the following scenario:

- Page A is modified (and marked dirty)
- VM paused for last iteration
- Page breaks, is marked broken in the p2m
- Save code sends page A

In that case, the save code would send a "broken" page, and the restore 
code would mark a page as broken, and we *would* want to deliver an MCE 
on the far side.  But suppose the last two steps were reversed:

- Page A modified
- VM paused for last iteration
- Save code sends page A
- Page breaks, marked broken in the p2m

In that case, when the save code sends page A, it will send a good page; 
there's no need to mark it broken, or to send the guest an MCE.

Am I understanding the situation correctly, Jinsong?

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 15:36:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:36:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaTOZ-0005lQ-2K; Mon, 19 Nov 2012 15:36:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TaTOY-0005lL-2c
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 15:36:22 +0000
Received: from [193.109.254.147:14900] by server-11.bemta-14.messagelabs.com
	id 30/BA-29027-5F15AA05; Mon, 19 Nov 2012 15:36:21 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1353339372!9397866!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ2Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17003 invoked from network); 19 Nov 2012 15:36:15 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 15:36:15 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="45041935"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 15:35:09 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 10:35:09 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TaTNM-0007Ae-Rk;
	Mon, 19 Nov 2012 15:35:08 +0000
Message-ID: <50AA5061.7040103@eu.citrix.com>
Date: Mon, 19 Nov 2012 15:29:37 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353318919.18229.7.camel@zakaz.uk.xensource.com>
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 19/11/12 09:55, Ian Campbell wrote:
> If we get to this stage then haven't we either already sent something
> over the wire for this page or marked it as dirty when we tried and
> failed to send it?
>
> In the former case we don't care that the page is now broken on the
> source since the target has got a good pre-breakage copy.
>
> In the latter case could we not set a flag at the same time as we mark
> the page dirty which means "go round at least one more time"?

Yeah -- on the last iteration, the VM itself has to be paused; if any 
pages get broken after that, it doesn't really matter, does it? The real 
thing is to have a consistent "snapshot" of behavior.

I guess the one potentially tricky case to worry about is whether to 
deliver an MCE to the guest on restore.  Consider the following scenario:

- Page A is modified (and marked dirty)
- VM paused for last iteration
- Page breaks, is marked broken in the p2m
- Save code sends page A

In that case, the save code would send a "broken" page, and the restore 
code would mark a page as broken, and we *would* want to deliver an MCE 
on the far side.  But suppose the last two steps were reversed:

- Page A modified
- VM paused for last iteration
- Save code sends page A
- Page breaks, marked broken in the p2m

In that case, when the save code sends page A, it will send a good page; 
there's no need to mark it broken, or to send the guest an MCE.

Am I understanding the situation correctly, Jinsong?

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 15:40:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:40:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaTS3-0005tf-P3; Mon, 19 Nov 2012 15:39:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1TaTS1-0005tV-Mc
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:39:58 +0000
Received: from [85.158.143.35:61818] by server-3.bemta-4.messagelabs.com id
	44/6D-06841-DC25AA05; Mon, 19 Nov 2012 15:39:57 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-6.tower-21.messagelabs.com!1353339595!18320896!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2958 invoked from network); 19 Nov 2012 15:39:55 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Nov 2012 15:39:55 -0000
Received: from 136-70-ftth.on.nl ([88.159.70.136]:54160 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1TaTV0-0004xB-J9; Mon, 19 Nov 2012 16:43:02 +0100
Date: Mon, 19 Nov 2012 16:39:51 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <368730331.20121119163951@eikelenboom.it>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233538E31B@SHSMSX101.ccr.corp.intel.com>
References: <791265057.20121116134056@eikelenboom.it>
	<20121116160733.GO22320@phenom.dumpdata.com>
	<1422434855.20121116174754@eikelenboom.it>
	<20121116165834.GA18725@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC829233538E31B@SHSMSX101.ccr.corp.intel.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="----------0F806B23E04D37875"
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [ 3009.778974] mcelog:16842 map pfn expected
	mapping type write-back for [mem 0x0009f000-0x000a0fff],
	got uncached-minus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

------------0F806B23E04D37875
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


Saturday, November 17, 2012, 3:14:10 PM, you wrote:

> Konrad Rzeszutek Wilk wrote:
>> On Fri, Nov 16, 2012 at 05:47:54PM +0100, Sander Eikelenboom wrote:
>>> 
>>> Friday, November 16, 2012, 5:07:33 PM, you wrote:
>>> 
>>>> On Fri, Nov 16, 2012 at 01:40:56PM +0100, Sander Eikelenboom wrote:
>>>>> Hi Konrad,
>>>>> 
>>>>> Sometime ago i reported this one at boot up:
>>>>> 
>>>>> [ 3009.778974] mcelog:16842 map pfn expected mapping type
>>>>> write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus [
>>>>> 3009.788570] ------------[ cut here ]------------ [ 3009.798175]
>>>>> WARNING: at arch/x86/mm/pat.c:774 untrack_pfn+0xa1/0xb0() [
>>>>> 3009.807966] Hardware name: MS-7640 [ 3009.817677] Modules linked
>>>>> in: [ 3009.827524] Pid: 16842, comm: mcelog Tainted: G        W   
>>>>> 3.7.0-rc5-20121116-reverted-persistent-warn-patwarn #1 [
>>>>> 3009.837415] Call Trace: [ 3009.847110]  [<ffffffff810674fa>]
>>>>> warn_slowpath_common+0x7a/0xb0 [ 3009.856857] 
>>>>> [<ffffffff81067545>] warn_slowpath_null+0x15/0x20 [ 3009.866562] 
>>>>> [<ffffffff81042041>] untrack_pfn+0xa1/0xb0 [ 3009.876201] 
>>>>> [<ffffffff8111a59b>] unmap_single_vma+0x86b/0x8e0 [ 3009.885895] 
>>>>> [<ffffffff81100f16>] ? release_pages+0x196/0x1f0 [ 3009.895488] 
>>>>> [<ffffffff8111a65c>] unmap_vmas+0x4c/0xa0 [ 3009.905134] 
>>>>> [<ffffffff8111c8fa>] exit_mmap+0x9a/0x180 [ 3009.914706] 
>>>>> [<ffffffff81064e72>] mmput+0x52/0xd0 [ 3009.924252] 
>>>>> [<ffffffff810652b7>] dup_mm+0x3c7/0x510 [ 3009.933839] 
>>>>> [<ffffffff81065fd5>] copy_process+0xac5/0x14a0 [ 3009.943430] 
>>>>> [<ffffffff81066af3>] do_fork+0x53/0x360 [ 3009.952843] 
>>>>> [<ffffffff810b25c7>] ? lock_release+0x117/0x250 [ 3009.962283] 
>>>>> [<ffffffff817d26c0>] ? _raw_spin_unlock+0x30/0x60 [ 3009.971532] 
>>>>> [<ffffffff817d3495>] ? sysret_check+0x22/0x5d [ 3009.980820] 
>>>>> [<ffffffff81017523>] sys_clone+0x23/0x30 [ 3009.990046] 
>>>>> [<ffffffff817d37f3>] stub_clone+0x13/0x20 [ 3009.999335] 
>>>>> [<ffffffff817d3469>] ? system_call_fastpath+0x16/0x1b [
>>>>> 3010.008667] ---[ end trace 2d9694c2c0a24da8 ]---  
>>>>> 
>>>>> 
>>>>> It seems to be due to the "mcelog" userspace tool provided with
>>>>> Debian Squeeze (mcelog 1.0~pre3-3  x86-64 Machine Check Exceptions
>>>>> collector and decoder). I can trigger this warning easily by
>>>>> restarting the mcelog tool with /etc/init.d/mcelog restart  
>>>>> 
>>>>> Should that one also function with the xen mcelog driver, or is a
>>>>> newer version required ? 
>>> 
>>>> The reason we get is b/c I had to disable the PAT functionality in
>>>> the Linux kernel for Xen. This is b/c it only worked one way -
>>>> meaning you could convert a page from 
>>>> WriteBack to WriteCombine or WriteBack to Uncached. But you could
>>>> not 
>>>> do WriteCombine back to WriteBack - due to one of the functions that
>>>> changes the bits was using an "unfiltered" way to identify the bits
>>>> on the 
>>>> page.
>>> 
>>>> Anyhow, we had a disaster b/c some of these pages that used to
>>>> WriteBack (WB) 
>>>> got converted to WriteCombine (WC) and then were returned back as
>>>> such 
>>>> to the page pool. And if they were re-used by filesystem invariably
>>>> we got 
>>>> corruptions.
>>> 
>>>> So until the PAT table lookup thing that Peter H. Anvin suggested
>>>> gets implemented this splat gotta show up :-(
>>> 
>>> Not a big problem for me, i was just wondering :-)
>>> I'm more interested in the netfront troubles, since it's already rc5.
>>> 
>>>> Does mcelog still work even with this warning?
>>> 
>>> Not the daemon:
>>> 
>>> serveerstertje:~# sh /etc/init.d/mcelog start
>>> Starting Machine Check Exceptions decoder: daemon: Cannot allocate
>>> memory 
>>> 
>> Ugh.
>> CC-ing Liu here.
>> 

> How to reproduce it (sorry I miss the history of this thread)?
> I have a try at Xen side, w/ kernel 3.6.0-rc7+, no problem at my side.

I'm using:
- Xen-unstable, latest changeset=26152
- Linux 3.7.0-rc5 kernel latest changeset=79e979eae0df58831e85281e3285f63663f3cf76
- Dom0 OS = Debian Squeeze
- mcelog package: 1.0~pre3-3  x86-64 Machine Check Exceptions collector and decoder)

I don't have particular interest in mcelog, but i just encountered this warn on boot.
The warn (see above) is shown when the mcelog daemon (from the debian package) tries to start (for example on boot)

I have attached the .config from the used kernel.

If you need any more info, please ask !

--
Sander


> Thanks,
> Jinsong

>>> 
>>>>> 
>>>>> --
>>>>> Sander


------------0F806B23E04D37875
Content-Type: application/octet-stream;
 name=dotconfig
Content-transfer-encoding: base64
Content-Disposition: attachment;
 filename=dotconfig

IwojIEF1dG9tYXRpY2FsbHkgZ2VuZXJhdGVkIGZpbGU7IERPIE5PVCBFRElULgojIExpbnV4
L3g4Nl82NCAzLjcuMC1yYzUtMjAxMjExMTYtcmV2ZXJ0ZWQtcGVyc2lzdGVudC1idCBLZXJu
ZWwgQ29uZmlndXJhdGlvbgojCkNPTkZJR182NEJJVD15CkNPTkZJR19YODZfNjQ9eQpDT05G
SUdfWDg2PXkKQ09ORklHX0lOU1RSVUNUSU9OX0RFQ09ERVI9eQpDT05GSUdfT1VUUFVUX0ZP
Uk1BVD0iZWxmNjQteDg2LTY0IgpDT05GSUdfQVJDSF9ERUZDT05GSUc9ImFyY2gveDg2L2Nv
bmZpZ3MveDg2XzY0X2RlZmNvbmZpZyIKQ09ORklHX0xPQ0tERVBfU1VQUE9SVD15CkNPTkZJ
R19TVEFDS1RSQUNFX1NVUFBPUlQ9eQpDT05GSUdfSEFWRV9MQVRFTkNZVE9QX1NVUFBPUlQ9
eQpDT05GSUdfTU1VPXkKQ09ORklHX05FRURfRE1BX01BUF9TVEFURT15CkNPTkZJR19ORUVE
X1NHX0RNQV9MRU5HVEg9eQpDT05GSUdfR0VORVJJQ19JU0FfRE1BPXkKQ09ORklHX0dFTkVS
SUNfQlVHPXkKQ09ORklHX0dFTkVSSUNfQlVHX1JFTEFUSVZFX1BPSU5URVJTPXkKQ09ORklH
X0dFTkVSSUNfSFdFSUdIVD15CkNPTkZJR19BUkNIX01BWV9IQVZFX1BDX0ZEQz15CkNPTkZJ
R19SV1NFTV9YQ0hHQUREX0FMR09SSVRITT15CkNPTkZJR19HRU5FUklDX0NBTElCUkFURV9E
RUxBWT15CkNPTkZJR19BUkNIX0hBU19DUFVfUkVMQVg9e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g
Q09ORklHX1NORF9JTlRFTDhYME0gaXMgbm90IHNldAojIENPTkZJR19TTkRfS09SRzEyMTIg
aXMgbm90IHNldAojIENPTkZJR19TTkRfTE9MQSBpcyBub3Qgc2V0CiMgQ09ORklHX1NORF9M
WDY0NjRFUyBpcyBub3Qgc2V0CiMgQ09ORklHX1NORF9NQUVTVFJPMyBpcyBub3Qgc2V0CiMg
Q09ORklHX1NORF9NSVhBUlQgaXMgbm90IHNldAojIENPTkZJR19TTkRfTk0yNTYgaXMgbm90
IHNldAojIENPTkZJR19TTkRfUENYSFIgaXMgbm90IHNldAojIENPTkZJR19TTkRfUklQVElE
RSBpcyBub3Qgc2V0CiMgQ09ORklHX1NORF9STUUzMiBpcyBub3Qgc2V0CiMgQ09ORklHX1NO
RF9STUU5NiBpcyBub3Qgc2V0CiMgQ09ORklHX1NORF9STUU5NjUyIGlzIG5vdCBzZXQKIyBD
T05GSUdfU05EX1NPTklDVklCRVMgaXMgbm90IHNldAojIENPTkZJR19TTkRfVFJJREVOVCBp
cyBub3Qgc2V0CiMgQ09ORklHX1NORF9WSUE4MlhYIGlzIG5vdCBzZXQKIyBDT05GSUdfU05E
X1ZJQTgyWFhfTU9ERU0gaXMgbm90IHNldAojIENPTkZJR19TTkRfVklSVFVPU08gaXMgbm90
IHNldAojIENPTkZJR19TTkRfVlgyMjIgaXMgbm90IHNldAojIENPTkZJR19TTkRfWU1GUENJ
IGlzIG5vdCBzZXQKQ09ORklHX1NORF9VU0I9eQpDT05GSUdfU05EX1VTQl9BVURJTz15CkNP
TkZJR19TTkRfVVNCX1VBMTAxPXkKQ09ORklHX1NORF9VU0JfVVNYMlk9eQpDT05GSUdfU05E
X1VTQl9DQUlBUT15CkNPTkZJR19TTkRfVVNCX0NBSUFRX0lOUFVUPXkKIyBDT05GSUdfU05E
X1VTQl9VUzEyMkwgaXMgbm90IHNldApDT05GSUdfU05EX1VTQl82RklSRT15CiMgQ09ORklH
X1NORF9TT0MgaXMgbm90IHNldAojIENP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q09ORklHX1haX0RFQz15CkNPTkZJR19YWl9ERUNfWDg2PXkKQ09ORklHX1haX0RFQ19QT1dF
UlBDPXkKQ09ORklHX1haX0RFQ19JQTY0PXkKQ09ORklHX1haX0RFQ19BUk09eQpDT05GSUdf
WFpfREVDX0FSTVRIVU1CPXkKQ09ORklHX1haX0RFQ19TUEFSQz15CkNPTkZJR19YWl9ERUNf
QkNKPXkKIyBDT05GSUdfWFpfREVDX1RFU1QgaXMgbm90IHNldApDT05GSUdfREVDT01QUkVT
U19HWklQPXkKQ09ORklHX0RFQ09NUFJFU1NfQlpJUDI9eQpDT05GSUdfREVDT01QUkVTU19M
Wk1BPXkKQ09ORklHX0RFQ09NUFJFU1NfWFo9eQpDT05GSUdfREVDT01QUkVTU19MWk89eQpD
T05GSUdfVEVYVFNFQVJDSD15CkNPTkZJR19URVhUU0VBUkNIX0tNUD15CkNPTkZJR19URVhU
U0VBUkNIX0JNPXkKQ09ORklHX1RFWFRTRUFSQ0hfRlNNPXkKQ09ORklHX0hBU19JT01FTT15
CkNPTkZJR19IQVNfSU9QT1JUPXkKQ09ORklHX0hBU19ETUE9eQpDT05GSUdfQ0hFQ0tfU0lH
TkFUVVJFPXkKQ09ORklHX0NQVV9STUFQPXkKQ09ORklHX0RRTD15CkNPTkZJR19OTEFUVFI9
eQpDT05GSUdfQVJDSF9IQVNfQVRPTUlDNjRfREVDX0lGX1BPU0lUSVZFPXkKQ09ORklHX0FW
RVJBR0U9eQojIENPTkZJR19DT1JESUMgaXMgbm90IHNldAojIENPTkZJR19ERFIgaXMgbm90
IHNldAo=
------------0F806B23E04D37875
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.xen.org
http://lists.xen.org/xen-devel

------------0F806B23E04D37875--



From xen-devel-bounces@lists.xen.org Mon Nov 19 15:40:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:40:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaTS3-0005tf-P3; Mon, 19 Nov 2012 15:39:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1TaTS1-0005tV-Mc
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:39:58 +0000
Received: from [85.158.143.35:61818] by server-3.bemta-4.messagelabs.com id
	44/6D-06841-DC25AA05; Mon, 19 Nov 2012 15:39:57 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-6.tower-21.messagelabs.com!1353339595!18320896!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2958 invoked from network); 19 Nov 2012 15:39:55 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Nov 2012 15:39:55 -0000
Received: from 136-70-ftth.on.nl ([88.159.70.136]:54160 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1TaTV0-0004xB-J9; Mon, 19 Nov 2012 16:43:02 +0100
Date: Mon, 19 Nov 2012 16:39:51 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <368730331.20121119163951@eikelenboom.it>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233538E31B@SHSMSX101.ccr.corp.intel.com>
References: <791265057.20121116134056@eikelenboom.it>
	<20121116160733.GO22320@phenom.dumpdata.com>
	<1422434855.20121116174754@eikelenboom.it>
	<20121116165834.GA18725@phenom.dumpdata.com>
	<DE8DF0795D48FD4CA783C40EC829233538E31B@SHSMSX101.ccr.corp.intel.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="----------0F806B23E04D37875"
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [ 3009.778974] mcelog:16842 map pfn expected
	mapping type write-back for [mem 0x0009f000-0x000a0fff],
	got uncached-minus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

------------0F806B23E04D37875
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


Saturday, November 17, 2012, 3:14:10 PM, you wrote:

> Konrad Rzeszutek Wilk wrote:
>> On Fri, Nov 16, 2012 at 05:47:54PM +0100, Sander Eikelenboom wrote:
>>> 
>>> Friday, November 16, 2012, 5:07:33 PM, you wrote:
>>> 
>>>> On Fri, Nov 16, 2012 at 01:40:56PM +0100, Sander Eikelenboom wrote:
>>>>> Hi Konrad,
>>>>> 
>>>>> Sometime ago i reported this one at boot up:
>>>>> 
>>>>> [ 3009.778974] mcelog:16842 map pfn expected mapping type
>>>>> write-back for [mem 0x0009f000-0x000a0fff], got uncached-minus [
>>>>> 3009.788570] ------------[ cut here ]------------ [ 3009.798175]
>>>>> WARNING: at arch/x86/mm/pat.c:774 untrack_pfn+0xa1/0xb0() [
>>>>> 3009.807966] Hardware name: MS-7640 [ 3009.817677] Modules linked
>>>>> in: [ 3009.827524] Pid: 16842, comm: mcelog Tainted: G        W   
>>>>> 3.7.0-rc5-20121116-reverted-persistent-warn-patwarn #1 [
>>>>> 3009.837415] Call Trace: [ 3009.847110]  [<ffffffff810674fa>]
>>>>> warn_slowpath_common+0x7a/0xb0 [ 3009.856857] 
>>>>> [<ffffffff81067545>] warn_slowpath_null+0x15/0x20 [ 3009.866562] 
>>>>> [<ffffffff81042041>] untrack_pfn+0xa1/0xb0 [ 3009.876201] 
>>>>> [<ffffffff8111a59b>] unmap_single_vma+0x86b/0x8e0 [ 3009.885895] 
>>>>> [<ffffffff81100f16>] ? release_pages+0x196/0x1f0 [ 3009.895488] 
>>>>> [<ffffffff8111a65c>] unmap_vmas+0x4c/0xa0 [ 3009.905134] 
>>>>> [<ffffffff8111c8fa>] exit_mmap+0x9a/0x180 [ 3009.914706] 
>>>>> [<ffffffff81064e72>] mmput+0x52/0xd0 [ 3009.924252] 
>>>>> [<ffffffff810652b7>] dup_mm+0x3c7/0x510 [ 3009.933839] 
>>>>> [<ffffffff81065fd5>] copy_process+0xac5/0x14a0 [ 3009.943430] 
>>>>> [<ffffffff81066af3>] do_fork+0x53/0x360 [ 3009.952843] 
>>>>> [<ffffffff810b25c7>] ? lock_release+0x117/0x250 [ 3009.962283] 
>>>>> [<ffffffff817d26c0>] ? _raw_spin_unlock+0x30/0x60 [ 3009.971532] 
>>>>> [<ffffffff817d3495>] ? sysret_check+0x22/0x5d [ 3009.980820] 
>>>>> [<ffffffff81017523>] sys_clone+0x23/0x30 [ 3009.990046] 
>>>>> [<ffffffff817d37f3>] stub_clone+0x13/0x20 [ 3009.999335] 
>>>>> [<ffffffff817d3469>] ? system_call_fastpath+0x16/0x1b [
>>>>> 3010.008667] ---[ end trace 2d9694c2c0a24da8 ]---  
>>>>> 
>>>>> 
>>>>> It seems to be due to the "mcelog" userspace tool provided with
>>>>> Debian Squeeze (mcelog 1.0~pre3-3  x86-64 Machine Check Exceptions
>>>>> collector and decoder). I can trigger this warning easily by
>>>>> restarting the mcelog tool with /etc/init.d/mcelog restart  
>>>>> 
>>>>> Should that one also function with the xen mcelog driver, or is a
>>>>> newer version required ? 
>>> 
>>>> The reason we get is b/c I had to disable the PAT functionality in
>>>> the Linux kernel for Xen. This is b/c it only worked one way -
>>>> meaning you could convert a page from 
>>>> WriteBack to WriteCombine or WriteBack to Uncached. But you could
>>>> not 
>>>> do WriteCombine back to WriteBack - due to one of the functions that
>>>> changes the bits was using an "unfiltered" way to identify the bits
>>>> on the 
>>>> page.
>>> 
>>>> Anyhow, we had a disaster b/c some of these pages that used to
>>>> WriteBack (WB) 
>>>> got converted to WriteCombine (WC) and then were returned back as
>>>> such 
>>>> to the page pool. And if they were re-used by filesystem invariably
>>>> we got 
>>>> corruptions.
>>> 
>>>> So until the PAT table lookup thing that Peter H. Anvin suggested
>>>> gets implemented this splat gotta show up :-(
>>> 
>>> Not a big problem for me, i was just wondering :-)
>>> I'm more interested in the netfront troubles, since it's already rc5.
>>> 
>>>> Does mcelog still work even with this warning?
>>> 
>>> Not the daemon:
>>> 
>>> serveerstertje:~# sh /etc/init.d/mcelog start
>>> Starting Machine Check Exceptions decoder: daemon: Cannot allocate
>>> memory 
>>> 
>> Ugh.
>> CC-ing Liu here.
>> 

> How to reproduce it (sorry I miss the history of this thread)?
> I have a try at Xen side, w/ kernel 3.6.0-rc7+, no problem at my side.

I'm using:
- Xen-unstable, latest changeset=26152
- Linux 3.7.0-rc5 kernel latest changeset=79e979eae0df58831e85281e3285f63663f3cf76
- Dom0 OS = Debian Squeeze
- mcelog package: 1.0~pre3-3  x86-64 Machine Check Exceptions collector and decoder)

I don't have particular interest in mcelog, but i just encountered this warn on boot.
The warn (see above) is shown when the mcelog daemon (from the debian package) tries to start (for example on boot)

I have attached the .config from the used kernel.

If you need any more info, please ask !

--
Sander


> Thanks,
> Jinsong

>>> 
>>>>> 
>>>>> --
>>>>> Sander


------------0F806B23E04D37875
Content-Type: application/octet-stream;
 name=dotconfig
Content-transfer-encoding: base64
Content-Disposition: attachment;
 filename=dotconfig

IwojIEF1dG9tYXRpY2FsbHkgZ2VuZXJhdGVkIGZpbGU7IERPIE5PVCBFRElULgojIExpbnV4
L3g4Nl82NCAzLjcuMC1yYzUtMjAxMjExMTYtcmV2ZXJ0ZWQtcGVyc2lzdGVudC1idCBLZXJu
ZWwgQ29uZmlndXJhdGlvbgojCkNPTkZJR182NEJJVD15CkNPTkZJR19YODZfNjQ9eQpDT05G
SUdfWDg2PXkKQ09ORklHX0lOU1RSVUNUSU9OX0RFQ09ERVI9eQpDT05GSUdfT1VUUFVUX0ZP
Uk1BVD0iZWxmNjQteDg2LTY0IgpDT05GSUdfQVJDSF9ERUZDT05GSUc9ImFyY2gveDg2L2Nv
bmZpZ3MveDg2XzY0X2RlZmNvbmZpZyIKQ09ORklHX0xPQ0tERVBfU1VQUE9SVD15CkNPTkZJ
R19TVEFDS1RSQUNFX1NVUFBPUlQ9eQpDT05GSUdfSEFWRV9MQVRFTkNZVE9QX1NVUFBPUlQ9
eQpDT05GSUdfTU1VPXkKQ09ORklHX05FRURfRE1BX01BUF9TVEFURT15CkNPTkZJR19ORUVE
X1NHX0RNQV9MRU5HVEg9eQpDT05GSUdfR0VORVJJQ19JU0FfRE1BPXkKQ09ORklHX0dFTkVS
SUNfQlVHPXkKQ09ORklHX0dFTkVSSUNfQlVHX1JFTEFUSVZFX1BPSU5URVJTPXkKQ09ORklH
X0dFTkVSSUNfSFdFSUdIVD15CkNPTkZJR19BUkNIX01BWV9IQVZFX1BDX0ZEQz15CkNPTkZJ
R19SV1NFTV9YQ0hHQUREX0FMR09SSVRITT15CkNPTkZJR19HRU5FUklDX0NBTElCUkFURV9E
RUxBWT15CkNPTkZJR19BUkNIX0hBU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PTVBSRVNTPXkK
Q09ORklHX1haX0RFQz15CkNPTkZJR19YWl9ERUNfWDg2PXkKQ09ORklHX1haX0RFQ19QT1dF
UlBDPXkKQ09ORklHX1haX0RFQ19JQTY0PXkKQ09ORklHX1haX0RFQ19BUk09eQpDT05GSUdf
WFpfREVDX0FSTVRIVU1CPXkKQ09ORklHX1haX0RFQ19TUEFSQz15CkNPTkZJR19YWl9ERUNf
QkNKPXkKIyBDT05GSUdfWFpfREVDX1RFU1QgaXMgbm90IHNldApDT05GSUdfREVDT01QUkVT
U19HWklQPXkKQ09ORklHX0RFQ09NUFJFU1NfQlpJUDI9eQpDT05GSUdfREVDT01QUkVTU19M
Wk1BPXkKQ09ORklHX0RFQ09NUFJFU1NfWFo9eQpDT05GSUdfREVDT01QUkVTU19MWk89eQpD
T05GSUdfVEVYVFNFQVJDSD15CkNPTkZJR19URVhUU0VBUkNIX0tNUD15CkNPTkZJR19URVhU
U0VBUkNIX0JNPXkKQ09ORklHX1RFWFRTRUFSQ0hfRlNNPXkKQ09ORklHX0hBU19JT01FTT15
CkNPTkZJR19IQVNfSU9QT1JUPXkKQ09ORklHX0hBU19ETUE9eQpDT05GSUdfQ0hFQ0tfU0lH
TkFUVVJFPXkKQ09ORklHX0NQVV9STUFQPXkKQ09ORklHX0RRTD15CkNPTkZJR19OTEFUVFI9
eQpDT05GSUdfQVJDSF9IQVNfQVRPTUlDNjRfREVDX0lGX1BPU0lUSVZFPXkKQ09ORklHX0FW
RVJBR0U9eQojIENPTkZJR19DT1JESUMgaXMgbm90IHNldAojIENPTkZJR19ERFIgaXMgbm90
IHNldAo=
------------0F806B23E04D37875
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.xen.org
http://lists.xen.org/xen-devel

------------0F806B23E04D37875--



From xen-devel-bounces@lists.xen.org Mon Nov 19 15:43:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:43:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaTUw-00064T-KS; Mon, 19 Nov 2012 15:42:58 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TaTUv-00064M-I0
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:42:57 +0000
Received: from [193.109.254.147:10705] by server-15.bemta-14.messagelabs.com
	id 40/93-12105-0835AA05; Mon, 19 Nov 2012 15:42:56 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353339776!8862974!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12578 invoked from network); 19 Nov 2012 15:42:56 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-27.messagelabs.com with SMTP;
	19 Nov 2012 15:42:56 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 19 Nov 2012 15:42:55 +0000
Message-Id: <50AA61C702000078000A9BD0@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 19 Nov 2012 15:43:51 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-7-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA050A02000078000A9940@nat28.tlf.novell.com>
	<50AA493D.5030805@tycho.nsa.gov>
In-Reply-To: <50AA493D.5030805@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 06/19] xen: use XSM instead of IS_PRIV where
 duplicated
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 19.11.12 at 15:59, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> On 11/19/2012 04:08 AM, Jan Beulich wrote:
>>>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>>> @@ -467,8 +451,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) 
> arg)
>>>          if ( copy_from_guest(&irq_op, arg, 1) != 0 )
>>>              break;
>>>  
>>> -        ret = -EPERM;
>>> -        if ( !IS_PRIV(v->domain) )
>>> +        ret = xsm_apic(v->domain, cmd);
>> 
>> Is that the right hook? There's nothing APIC related here.
> 
> There's nothing here at all: the hypercall is a noop. However, when I 
> posted the patch without the XSM check I was told that a check still
> needs to be performed in order to preserve compatability, and the 
> comment below implies that this operation is done prior to programming 
> the ioapic.

But still - this is misleading without at least a code comment.

Jan

>> 
>>> +        if ( ret )
>>>              break;
>>>  
>         /* Vector is only used by hypervisor, and dom0 shouldn't
>            touch it in its world, return irq_op.irq as the vecotr,
>            and make this hypercall dummy, and also defer the vector 
>            allocation when dom0 tries to programe ioapic entry. */
>  




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 15:43:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:43:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaTUw-00064T-KS; Mon, 19 Nov 2012 15:42:58 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TaTUv-00064M-I0
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:42:57 +0000
Received: from [193.109.254.147:10705] by server-15.bemta-14.messagelabs.com
	id 40/93-12105-0835AA05; Mon, 19 Nov 2012 15:42:56 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353339776!8862974!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12578 invoked from network); 19 Nov 2012 15:42:56 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-27.messagelabs.com with SMTP;
	19 Nov 2012 15:42:56 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 19 Nov 2012 15:42:55 +0000
Message-Id: <50AA61C702000078000A9BD0@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 19 Nov 2012 15:43:51 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-7-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA050A02000078000A9940@nat28.tlf.novell.com>
	<50AA493D.5030805@tycho.nsa.gov>
In-Reply-To: <50AA493D.5030805@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 06/19] xen: use XSM instead of IS_PRIV where
 duplicated
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 19.11.12 at 15:59, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> On 11/19/2012 04:08 AM, Jan Beulich wrote:
>>>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>>> @@ -467,8 +451,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) 
> arg)
>>>          if ( copy_from_guest(&irq_op, arg, 1) != 0 )
>>>              break;
>>>  
>>> -        ret = -EPERM;
>>> -        if ( !IS_PRIV(v->domain) )
>>> +        ret = xsm_apic(v->domain, cmd);
>> 
>> Is that the right hook? There's nothing APIC related here.
> 
> There's nothing here at all: the hypercall is a noop. However, when I 
> posted the patch without the XSM check I was told that a check still
> needs to be performed in order to preserve compatability, and the 
> comment below implies that this operation is done prior to programming 
> the ioapic.

But still - this is misleading without at least a code comment.

Jan

>> 
>>> +        if ( ret )
>>>              break;
>>>  
>         /* Vector is only used by hypervisor, and dom0 shouldn't
>            touch it in its world, return irq_op.irq as the vecotr,
>            and make this hypercall dummy, and also defer the vector 
>            allocation when dom0 tries to programe ioapic entry. */
>  




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 15:43:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:43:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaTVJ-00066f-0s; Mon, 19 Nov 2012 15:43:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1TaTVH-00066U-Ob
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:43:19 +0000
Received: from [193.109.254.147:23668] by server-16.bemta-14.messagelabs.com
	id 0E/5A-09215-7935AA05; Mon, 19 Nov 2012 15:43:19 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-2.tower-27.messagelabs.com!1353339796!9938944!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16435 invoked from network); 19 Nov 2012 15:43:16 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Nov 2012 15:43:16 -0000
Received: from 136-70-ftth.on.nl ([88.159.70.136]:54162 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1TaTY6-0004yS-Gu; Mon, 19 Nov 2012 16:46:14 +0100
Date: Mon, 19 Nov 2012 16:43:04 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <1333495676.20121119164304@eikelenboom.it>
To: ANNIE LI <annie.li@oracle.com>
In-Reply-To: <50A4540E.1010601@oracle.com>
References: <1349790467.21847.185.camel@zakaz.uk.xensource.com>
	<1349790863.21172.4406.camel@edumazet-glaptop>
	<1349792241.21847.199.camel@zakaz.uk.xensource.com>
	<1349792847.21172.4479.camel@edumazet-glaptop>
	<1349793630.21847.208.camel@zakaz.uk.xensource.com>
	<1349863984.10070.26.camel@zakaz.uk.xensource.com>
	<1349874598.10070.39.camel@zakaz.uk.xensource.com>
	<748966751.20121010164949@eikelenboom.it>
	<1349942546.14806.7.camel@zakaz.uk.xensource.com>
	<151954917.20121011120004@eikelenboom.it>
	<1349949924.21172.8462.camel@edumazet-glaptop>
	<1349950494.14806.29.camel@zakaz.uk.xensource.com>
	<50A4540E.1010601@oracle.com>
MIME-Version: 1.0
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Marcos E. Matsunaga" <Marcos.Matsunaga@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] compound skb frag pages appearing in start_xmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


Thursday, November 15, 2012, 3:31:42 AM, you wrote:

> On 2012-10-11 18:14, Ian Campbell wrote:
>> On Thu, 2012-10-11 at 11:05 +0100, Eric Dumazet wrote:
>>> On Thu, 2012-10-11 at 12:00 +0200, Sander Eikelenboom wrote:
>>>
>>>> Probably due to the BUG_ON from the patch below, i changed it into a WARN_ON.
>>>> And i seem to hit it, but only in one of the guests at the moment and it triggers quite irregularly.
>>> xennet_make_frags() is able to split the skb->head in multiple page-size
>>> chunks.
>>>
>>> It should do the same for fragments
>> Right, I just want to be reproduce the issue so I can know I've fixed it
>> properly ;-)
> Hi Ian,

> I can reproduce this BUG_ON when running netperf/netserver test between 
> two domus running on the same dom0. The domu and dom0 all use v3.7-rc1.

> When I tried to rebase my persistent grant netfront/netback patch on 
> latest kernel, netperf/netserver test never succeeded. I did some test 
> to find out that v3.6-rc7 works fine, but v3.7-rc1, v3.7-rc2 and 
> v3.7-rc4 does not succeed in netperf/netserver test. So I keep my 
> persistent grant patch only based on v3.4-rc3 now.

> Konrad thought about commit 6a8ed462f16b8455eec5ae00eb6014159a6721f0 in 
> v3.7-rc1, and suggested me to test your debug patch in netfront. This 
> BUG_ON happens soon after running the netperf/netserver test case.

> Thanks
> Annie

Is there any progression with this bug (rc6 is out the door, so the release of 3.7-final seems to be eminent and this bug completely cripples any networking with guests) ?

--
Sander

>>
>> Ian.
>>
>>
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 15:43:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:43:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaTVJ-00066f-0s; Mon, 19 Nov 2012 15:43:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1TaTVH-00066U-Ob
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:43:19 +0000
Received: from [193.109.254.147:23668] by server-16.bemta-14.messagelabs.com
	id 0E/5A-09215-7935AA05; Mon, 19 Nov 2012 15:43:19 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-2.tower-27.messagelabs.com!1353339796!9938944!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16435 invoked from network); 19 Nov 2012 15:43:16 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Nov 2012 15:43:16 -0000
Received: from 136-70-ftth.on.nl ([88.159.70.136]:54162 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1TaTY6-0004yS-Gu; Mon, 19 Nov 2012 16:46:14 +0100
Date: Mon, 19 Nov 2012 16:43:04 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <1333495676.20121119164304@eikelenboom.it>
To: ANNIE LI <annie.li@oracle.com>
In-Reply-To: <50A4540E.1010601@oracle.com>
References: <1349790467.21847.185.camel@zakaz.uk.xensource.com>
	<1349790863.21172.4406.camel@edumazet-glaptop>
	<1349792241.21847.199.camel@zakaz.uk.xensource.com>
	<1349792847.21172.4479.camel@edumazet-glaptop>
	<1349793630.21847.208.camel@zakaz.uk.xensource.com>
	<1349863984.10070.26.camel@zakaz.uk.xensource.com>
	<1349874598.10070.39.camel@zakaz.uk.xensource.com>
	<748966751.20121010164949@eikelenboom.it>
	<1349942546.14806.7.camel@zakaz.uk.xensource.com>
	<151954917.20121011120004@eikelenboom.it>
	<1349949924.21172.8462.camel@edumazet-glaptop>
	<1349950494.14806.29.camel@zakaz.uk.xensource.com>
	<50A4540E.1010601@oracle.com>
MIME-Version: 1.0
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Marcos E. Matsunaga" <Marcos.Matsunaga@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] compound skb frag pages appearing in start_xmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


Thursday, November 15, 2012, 3:31:42 AM, you wrote:

> On 2012-10-11 18:14, Ian Campbell wrote:
>> On Thu, 2012-10-11 at 11:05 +0100, Eric Dumazet wrote:
>>> On Thu, 2012-10-11 at 12:00 +0200, Sander Eikelenboom wrote:
>>>
>>>> Probably due to the BUG_ON from the patch below, i changed it into a WARN_ON.
>>>> And i seem to hit it, but only in one of the guests at the moment and it triggers quite irregularly.
>>> xennet_make_frags() is able to split the skb->head in multiple page-size
>>> chunks.
>>>
>>> It should do the same for fragments
>> Right, I just want to be reproduce the issue so I can know I've fixed it
>> properly ;-)
> Hi Ian,

> I can reproduce this BUG_ON when running netperf/netserver test between 
> two domus running on the same dom0. The domu and dom0 all use v3.7-rc1.

> When I tried to rebase my persistent grant netfront/netback patch on 
> latest kernel, netperf/netserver test never succeeded. I did some test 
> to find out that v3.6-rc7 works fine, but v3.7-rc1, v3.7-rc2 and 
> v3.7-rc4 does not succeed in netperf/netserver test. So I keep my 
> persistent grant patch only based on v3.4-rc3 now.

> Konrad thought about commit 6a8ed462f16b8455eec5ae00eb6014159a6721f0 in 
> v3.7-rc1, and suggested me to test your debug patch in netfront. This 
> BUG_ON happens soon after running the netperf/netserver test case.

> Thanks
> Annie

Is there any progression with this bug (rc6 is out the door, so the release of 3.7-final seems to be eminent and this bug completely cripples any networking with guests) ?

--
Sander

>>
>> Ian.
>>
>>
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 15:50:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:50:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaTbq-0006O6-T3; Mon, 19 Nov 2012 15:50:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TaTbp-0006O1-4P
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:50:05 +0000
Received: from [85.158.143.35:43054] by server-3.bemta-4.messagelabs.com id
	E0/2E-06841-C255AA05; Mon, 19 Nov 2012 15:50:04 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-2.tower-21.messagelabs.com!1353340202!5441726!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28244 invoked from network); 19 Nov 2012 15:50:03 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-2.tower-21.messagelabs.com with SMTP;
	19 Nov 2012 15:50:03 -0000
X-TM-IMSS-Message-ID: <9806a7c6000b539e@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9806a7c6000b539e ;
	Mon, 19 Nov 2012 10:49:25 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJFnrMO026012; 
	Mon, 19 Nov 2012 10:49:55 -0500
Message-ID: <50AA5521.6080907@tycho.nsa.gov>
Date: Mon, 19 Nov 2012 10:49:53 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>, Jan Beulich <JBeulich@suse.com>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA0DCE02000078000A9972@nat28.tlf.novell.com>
	<20121119102647.GA31411@ocelot.phlegethon.org>
In-Reply-To: <20121119102647.GA31411@ocelot.phlegethon.org>
Cc: keir@xen.org, Ian Campbell <ian.campbell@citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH v5] Merge IS_PRIV checks into XSM hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/19/2012 04:45 AM, Jan Beulich wrote:
> As to getting the series applied, I suppose that'll be a little difficult,
> as it mixes changes to various parts of the tree, and hence no
> single maintainer would generally be able to apply the whole series
> without respective other parts fully acked by the corresponding
> maintainers. Is there a way to either indicate eventual fully
> standalone patches, or order/split it so that at least tools side and
> hypervisor side changes are separated from one another, or mixed
> patches all go at the beginning or end of the series?

The only patch related to tools is patch #1; the other patches only touch
the hypervisor or the example FLASK policy (which is under tools/). The
hypervisor patch that #1 relies on is already in 4.3, none of the rest of
the series depends on it (except where someone might want to use the
functionality it adds).

On 11/19/2012 05:26 AM, Tim Deegan wrote: 
> This whole series makes me very uncomfortable.  I can see its usefulness,
> and as a supporter of disaggregations I like the idea of fine-grained
> control, but it really does obscure the security checks, and makes it
> less likely that people implementing new operations will get their
> security checks right.

I agree about the increased possibility to get things wrong, but I think
that's going regardless of how you move away from a simple binary permission
check. I have tried to address this by adding generic checks where possible
(domctl, sysctl) so that new code added there has sane default protection.
Another thing I can think of is to make the existing code as easy to
understand as possible so people copying "how it's currently done" get it
right; suggestions here would be appreciated as I tend to understand my
own code too well to see how it's confusing - the construction of new hooks
in dummy.h is one part that I hope to improve on.

> Since there are only a small number of default checks (IS_PRIV,
> IS_PRIV_FOR, self-only, ???), I wonder whether they could be explicitly
> included in the xsm invocation (as some sort of 'enum
> xsm-default-policy' argument), to make it clear what's going on without
> the reader having to grobble around in xsm files?

Ian made a similar suggestion in reply to #6, suggesting adding the type
(guest, stubdom, toolstack, dom0/hardware) to the XSM hook's name so that
one can get a quick idea of what the hook is for at a glance. This seems
like a useful addition, although the handling of more complex hooks like
xsm_mmu_update may still require the reader to look in the XSM code to
figure out what is being checked.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 15:50:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 15:50:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaTbq-0006O6-T3; Mon, 19 Nov 2012 15:50:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TaTbp-0006O1-4P
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 15:50:05 +0000
Received: from [85.158.143.35:43054] by server-3.bemta-4.messagelabs.com id
	E0/2E-06841-C255AA05; Mon, 19 Nov 2012 15:50:04 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-2.tower-21.messagelabs.com!1353340202!5441726!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28244 invoked from network); 19 Nov 2012 15:50:03 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-2.tower-21.messagelabs.com with SMTP;
	19 Nov 2012 15:50:03 -0000
X-TM-IMSS-Message-ID: <9806a7c6000b539e@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9806a7c6000b539e ;
	Mon, 19 Nov 2012 10:49:25 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJFnrMO026012; 
	Mon, 19 Nov 2012 10:49:55 -0500
Message-ID: <50AA5521.6080907@tycho.nsa.gov>
Date: Mon, 19 Nov 2012 10:49:53 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>, Jan Beulich <JBeulich@suse.com>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA0DCE02000078000A9972@nat28.tlf.novell.com>
	<20121119102647.GA31411@ocelot.phlegethon.org>
In-Reply-To: <20121119102647.GA31411@ocelot.phlegethon.org>
Cc: keir@xen.org, Ian Campbell <ian.campbell@citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH v5] Merge IS_PRIV checks into XSM hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/19/2012 04:45 AM, Jan Beulich wrote:
> As to getting the series applied, I suppose that'll be a little difficult,
> as it mixes changes to various parts of the tree, and hence no
> single maintainer would generally be able to apply the whole series
> without respective other parts fully acked by the corresponding
> maintainers. Is there a way to either indicate eventual fully
> standalone patches, or order/split it so that at least tools side and
> hypervisor side changes are separated from one another, or mixed
> patches all go at the beginning or end of the series?

The only patch related to tools is patch #1; the other patches only touch
the hypervisor or the example FLASK policy (which is under tools/). The
hypervisor patch that #1 relies on is already in 4.3, none of the rest of
the series depends on it (except where someone might want to use the
functionality it adds).

On 11/19/2012 05:26 AM, Tim Deegan wrote: 
> This whole series makes me very uncomfortable.  I can see its usefulness,
> and as a supporter of disaggregations I like the idea of fine-grained
> control, but it really does obscure the security checks, and makes it
> less likely that people implementing new operations will get their
> security checks right.

I agree about the increased possibility to get things wrong, but I think
that's going regardless of how you move away from a simple binary permission
check. I have tried to address this by adding generic checks where possible
(domctl, sysctl) so that new code added there has sane default protection.
Another thing I can think of is to make the existing code as easy to
understand as possible so people copying "how it's currently done" get it
right; suggestions here would be appreciated as I tend to understand my
own code too well to see how it's confusing - the construction of new hooks
in dummy.h is one part that I hope to improve on.

> Since there are only a small number of default checks (IS_PRIV,
> IS_PRIV_FOR, self-only, ???), I wonder whether they could be explicitly
> included in the xsm invocation (as some sort of 'enum
> xsm-default-policy' argument), to make it clear what's going on without
> the reader having to grobble around in xsm files?

Ian made a similar suggestion in reply to #6, suggesting adding the type
(guest, stubdom, toolstack, dom0/hardware) to the XSM hook's name so that
one can get a quick idea of what the hook is for at a glance. This seems
like a useful addition, although the handling of more complex hooks like
xsm_mmu_update may still require the reader to look in the XSM code to
figure out what is being checked.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 16:05:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 16:05:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaTpx-00074R-FH; Mon, 19 Nov 2012 16:04:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaTpw-00074M-BW
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 16:04:40 +0000
Received: from [85.158.143.35:59443] by server-3.bemta-4.messagelabs.com id
	45/55-06841-7985AA05; Mon, 19 Nov 2012 16:04:39 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1353341079!18324772!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25910 invoked from network); 19 Nov 2012 16:04:39 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 16:04:39 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15884943"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 16:04:39 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 16:04:39 +0000
Message-ID: <1353341077.18229.121.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Mon, 19 Nov 2012 16:04:37 +0000
In-Reply-To: <50AA4E8D.7030702@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
	<50AA3C13.7090601@jhuapl.edu>
	<1353337586.18229.112.camel@zakaz.uk.xensource.com>
	<50AA4BC3.9050402@jhuapl.edu>
	<1353337964.18229.118.camel@zakaz.uk.xensource.com>
	<50AA4E8D.7030702@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 15:21 +0000, Matthew Fioravante wrote:
> >>   Still an additional cmake check to configure.ac
> >> might not be a bad idea.
> > Another option would be to add stubdom/configure.ac I suppose. We were
> > considering something like that for the docs subtree for example.
> Why not a global configure.ac to setup everything instead of a bunch of 
> separate ones spread out all over the place? You could for example do 
> --enable-tools --enable-stubdom --enable-docs, etc.. to compile specific 
> pieces and enable/disable their dependencies.

Mainly to avoid needing configure for the hypervisor.

Note that autoconf handles the concept of a sub-configure pretty well (I
think) so you can have a top-level configure which simply calls down to
the various stubdom, tools, docs configure by default.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 16:05:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 16:05:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaTpx-00074R-FH; Mon, 19 Nov 2012 16:04:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaTpw-00074M-BW
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 16:04:40 +0000
Received: from [85.158.143.35:59443] by server-3.bemta-4.messagelabs.com id
	45/55-06841-7985AA05; Mon, 19 Nov 2012 16:04:39 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1353341079!18324772!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25910 invoked from network); 19 Nov 2012 16:04:39 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 16:04:39 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15884943"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 16:04:39 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 16:04:39 +0000
Message-ID: <1353341077.18229.121.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Mon, 19 Nov 2012 16:04:37 +0000
In-Reply-To: <50AA4E8D.7030702@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
	<50AA3C13.7090601@jhuapl.edu>
	<1353337586.18229.112.camel@zakaz.uk.xensource.com>
	<50AA4BC3.9050402@jhuapl.edu>
	<1353337964.18229.118.camel@zakaz.uk.xensource.com>
	<50AA4E8D.7030702@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 15:21 +0000, Matthew Fioravante wrote:
> >>   Still an additional cmake check to configure.ac
> >> might not be a bad idea.
> > Another option would be to add stubdom/configure.ac I suppose. We were
> > considering something like that for the docs subtree for example.
> Why not a global configure.ac to setup everything instead of a bunch of 
> separate ones spread out all over the place? You could for example do 
> --enable-tools --enable-stubdom --enable-docs, etc.. to compile specific 
> pieces and enable/disable their dependencies.

Mainly to avoid needing configure for the hypervisor.

Note that autoconf handles the concept of a sub-configure pretty well (I
think) so you can have a top-level configure which simply calls down to
the various stubdom, tools, docs configure by default.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 16:18:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 16:18:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaU3D-0007FS-SX; Mon, 19 Nov 2012 16:18:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaU3C-0007FN-5W
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 16:18:22 +0000
Received: from [85.158.137.99:6783] by server-12.bemta-3.messagelabs.com id
	97/BA-22757-DCB5AA05; Mon, 19 Nov 2012 16:18:21 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1353341900!14661416!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5115 invoked from network); 19 Nov 2012 16:18:20 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 16:18:20 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15885289"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 16:17:21 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 16:17:20 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TaU2C-00006B-BI; Mon, 19 Nov 2012 16:17:20 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TaU2C-0000gj-6a;
	Mon, 19 Nov 2012 16:17:20 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20650.23440.50240.311533@mariner.uk.xensource.com>
Date: Mon, 19 Nov 2012 16:17:20 +0000
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
In-Reply-To: <50AA3B74.4090907@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
	<50AA3B74.4090907@jhuapl.edu>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante writes ("Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches"):
> On 11/19/2012 08:54 AM, Ian Campbell wrote:
> > Looks like we've grown a dependency on cmake. I vaguely recall
> > discussing before, can you remind me if this is a hard requirement on
> > the end user system or not.
>
> Unfortunately it is a hard requirement. Its used to pass the stubdom 
> build flags to the tpm_emulator.

Is tpm built by default ?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 16:18:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 16:18:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaU3D-0007FS-SX; Mon, 19 Nov 2012 16:18:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaU3C-0007FN-5W
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 16:18:22 +0000
Received: from [85.158.137.99:6783] by server-12.bemta-3.messagelabs.com id
	97/BA-22757-DCB5AA05; Mon, 19 Nov 2012 16:18:21 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1353341900!14661416!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5115 invoked from network); 19 Nov 2012 16:18:20 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 16:18:20 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15885289"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 16:17:21 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 16:17:20 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TaU2C-00006B-BI; Mon, 19 Nov 2012 16:17:20 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TaU2C-0000gj-6a;
	Mon, 19 Nov 2012 16:17:20 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20650.23440.50240.311533@mariner.uk.xensource.com>
Date: Mon, 19 Nov 2012 16:17:20 +0000
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
In-Reply-To: <50AA3B74.4090907@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
	<50AA3B74.4090907@jhuapl.edu>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante writes ("Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches"):
> On 11/19/2012 08:54 AM, Ian Campbell wrote:
> > Looks like we've grown a dependency on cmake. I vaguely recall
> > discussing before, can you remind me if this is a hard requirement on
> > the end user system or not.
>
> Unfortunately it is a hard requirement. Its used to pass the stubdom 
> build flags to the tpm_emulator.

Is tpm built by default ?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 16:30:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 16:30:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaUEj-0007RH-4O; Mon, 19 Nov 2012 16:30:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TaUEh-0007RC-1P
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 16:30:15 +0000
Received: from [85.158.137.99:48050] by server-6.bemta-3.messagelabs.com id
	4F/07-28265-69E5AA05; Mon, 19 Nov 2012 16:30:14 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1353342611!12887525!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=1.7 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_10_20,HTML_MESSAGE,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1115 invoked from network); 19 Nov 2012 16:30:12 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 16:30:12 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl15so6333093vcb.32
	for <xen-devel@lists.xen.org>; Mon, 19 Nov 2012 08:29:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:content-type;
	bh=tesl/bI/ycpmQpD92Ia4oGc2YeGGdy3p7cFmMwqAXgk=;
	b=hgl/DnAECaciNjD5WH5MbVWZteWI1IS/CQiD9tcyO3FnZMg9uYRRSIR66SBF9nXLQz
	cfO4ECk2ke+zki2bZZjoxHkHCVbAoW0gONdWUS3pVTzkiVlI6nFUfxpHRY/7l7+nLJt+
	9JOKwJuhuQCTh4hfZBF4l31tzvOkCalTRCohzrL4OnEEoW4w5MF/sDS2rSxdSPee8sF4
	naG44QwbWvpYkF9oyJ8PSsQPLQCZIdgNT42vdeaBn+xiqrvzuNNQGq7s/OFgHRmyA6Or
	MVdXdznRVTL5V21OjMvAEGrWNCqMVonn2BZuYYfpLM5Ve1VoLOlM1t3xFQly/YFNWYDm
	0UgQ==
MIME-Version: 1.0
Received: by 10.52.179.130 with SMTP id dg2mr3325862vdc.8.1353342551587; Mon,
	19 Nov 2012 08:29:11 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Mon, 19 Nov 2012 08:29:11 -0800 (PST)
Date: Mon, 19 Nov 2012 16:29:11 +0000
X-Google-Sender-Auth: _mQ2f0aVYFpYO7nD7OgZ6wrGbIk
Message-ID: <CAFLBxZaB46yiUBd8dj3QLtJQP5WCkdbhK9fvwHvCRNA_x8N1Ug@mail.gmail.com>
From: George Dunlap <dunlapg@umich.edu>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: [Xen-devel] Xen 4.3 development update, 19 Nov
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6990085667426271439=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6990085667426271439==
Content-Type: multipart/alternative; boundary=bcaec5171ecd0bfd1504cedb9ec6

--bcaec5171ecd0bfd1504cedb9ec6
Content-Type: text/plain; charset=ISO-8859-1

It's been a few weeks since I've sent one out, so please send updates!

This information will be mirrored on the Xen 4.3 Roadmap wiki page:
 http://wiki.xen.org/wiki/Xen_Roadmap/4.3

= Timeline =

We are planning on a 9-month release cycle.  Based on that, below are
our estimated dates:
* Feature Freeze: 25 March 2013
* First RC: 6 May 2013
* Release: 17 June 2013

The RCs and release will of course depend on stability and bugs, and
will therefore be fairly unpredictable.  The feature freeze may be
slipped for especially important features which are near completion.

= Feature tracking =

Below is a list of features we're tracking for this release. Please
respond to this mail with any updates to the status.

There are a number of items whose owners are marked as "?".  If you
are working on this, or know who is working on it, please respond and
let me know.  Alternately, if you would *like* to work on it, please
let me know as well.

And if there is something you're working on you'd like tracked, please
respond, and I will add it to the list.

NB: Several of the items on this list are from external projects:
linux, qemu, and libvirt.  These are not part of the Xen tree, but are
directly related to our users' experience (e.g., work in Linux or
qemu) or to integration with other important projects (e.g., libvirt
bindings).  Since all of these are part of the Xen community work, and
comes from the same pool of labor, it makes sense to track the
progress here, even though they won't explicitly be released as part
of 4.3.

== Completed ==

* Serial console improvements
  -EHCI debug port

* Default to QEMU upstream (partial)
 - pci pass-thru (external)
 - enable dirtybit tracking during migration (external)

* CPUID-based idle (don't rely on ACPI info f/ dom0)

== Bugs ==

* xl, compat mode, and older kernels
  owner: ?
  Many older 32-bit PV kernels that can run on a 64-bit hypervisor with
  xend do not work when started with xl.  The following work-around seems to
  work:
    xl create -p lightning.cfg
    xenstore-write /local/domain/$(xl domid
lightning)/device/vbd/51713/protocol x86_32-abi
    xl unpause lightning
  This node is normally written by the guest kernel, but for older kernels
  seems not to be.  xend must have a work-around; port this work-around to
xl.

== Not yet complete ==

* PVH mode (w/ Linux)
  owner: mukesh@oracle
  status (Linux): 3rd draft patches posted.
  status (Xen): Patches being cleaned up for submission

* Event channel scalability
  owner: attilio@citrix
  status: initial design proposed
  Increase limit on event channels (currently 1024 for 32-bit guests,
  4096 for 64-bit guests)

* ARM server port
  owner: ijc@citrix
  status: Core hypervisor patches accepted; Linux paches pending

* NUMA scheduler affinity
  critical
  owner: dario@citrix
  status: Patches posted

* NUMA Memory migration
  owner: dario@citrix
  status: ?

* blktap3
  owner: thanos@citrix
  status: RFCs posted

* Default to QEMU upstream
 > Add "intel-hda" to xmexample file, since it works with 64-bit Win7/8
 - qemu-based stubdom (Linux or BSD libc)
   owner: anthony@citrix
   status: in progress
   qemu-upstream needs a more fully-featured libc than exists in
   mini-os.  Either work on a minimalist linux-based stubdom with
   glibc, or port one of the BSD libcs to minios.

 - xl cd-{insert,eject} (external)
   status: intilal implementation submitted

* Persistent grants for blk (external)
  owner: roger.pau@citrix
  status: Initial implementation posted

* Persistent grants for net
  owner: annie.li@citrix
  status: Initial implementation posted

* Multi-page blk rings (external)
 - blkback in kernel (konrad@oracle, ?@intel)
 - qemu blkback
  status: Not started.

* Multi-page net protocol (external)
  owner: ijc@citrix or annie.li@oracle
  status: Initial patches posted (by Wei Liu)
  expand the network ring protocol to allow multiple pages for
  increased throughput

* Scalability: 16TiB of RAM
  owner: jan@suse
  status: Not started

* vTPM updates
  owner: Matthew Fioravante @ Johns Hopkins
  status: some patches submitted, more in progress
  - Allow all vTPM components to run in stub domains for increased security
  - Update vtpm to 0.7.1 from 0.5.x

* libvirt/libxl integration (external)
 - Migration
   owner: cyliu@suse (?)
   status: first draft implemented, not yet submitted
 - Itemize other things that need work
   To begin with, we need someone to go and make some lists:
   - Features available in libvirt/KVM not available in libvirt/libxl
     See http://libvirt.org/hvsupport.html
   - Features available in xl/Xen but not available in libvirt/Xen

* V4V: Inter-domain communication
  owner (Xen): jean.guyader@citrix.com
  status (Xen): patches submitted
  owner (Linux driver):  stefano.panella@citrix
  status (Linux driver): in progress

* Wait queues for mm
  owner: ?
  status: Draft posted Feb 2012; more work to do.

* xl vm-{export,import}
  owner: ?
  status: ?
  Allow xl to import and export VMs to other formats; particularly
  ovf, perhaps the XenServer format, or more.

* xl PVUSB pass-through for both PV and HVM guests
  owner: ?
  status: ?
  xm/xend supports PVUSB pass-through to guests with PVUSB drivers (both PV
and HVM guests).
  - port the xm/xend functionality to xl.
  - this PVUSB feature does not require support or emulation from Qemu.
  - upstream the Linux frontend/backend drivers. Current work-in-progress
versions are in Konrad's git tree.
  - James Harper's GPLPV drivers for Windows include PVUSB frontend drivers.

* xl USB pass-through for HVM guests using Qemu USB emulation
  owner: ?
  status: ?
  xm/xend with qemu-traditional supports USB passthrough to HVM guests
using the Qemu emulated USB controller.
  The HVM guest does not need any special drivers for this feature.
  So basicly the qemu cmdline needs to have:
     -usb -usbdevice host:xxxx:yyyy
  - port the xm/xend functionality to xl.
  - make sure USB passthrough with xl works with both qemu-traditional and
qemu-upstream.

* xl QXL Spice support
  owner: Zhou Peng
  status: Patches against 4.3-unstable posted, awaiting approval

* openvswitch toostack integration
  owner: roger@citrix
  status: Sample script posted by Bastian ("[RFC] openvswitch support
script")

* Rationalized backend scripts (incl. driver domains)
  owner: roger@citrix
  status: ?

* Serial console improvements
  owner: ?
  status: Stalled (see below)
  -xHCI debug port (Needs hardware)
  -Firewire (needs hardware)

* Remove hardcoded mobprobe's in xencommons
  owner: ?
  status: ?

* Make storage migration possible
  owner: ?
  status: ?
  There needs to be a way, either via command-line or via some hooks,
  that someone can build a "storage migration" feature on top of libxl
  or xl.

* Full-VM snapshotting
  owner: ?
  status: ?
  Have a way of coordinating the taking and restoring of VM memory and
  disk snapshots.  This would involve some investigation into the best
  way to accomplish this.

* VM Cloning
  owner: ?
  status: May need review
  Again, a way of coordinating the memory and disk aspects.  Research
  into the best way to do this would probably go along with the
  snapshotting feature.

* Memory: Replace PoD with paging mechanism
  owner: george@citrix
  status: May need review

* PV audio (audio for stubdom qemu)
  owner: stefano.panella@citrix
  status: ?

* IllumOS support
  owner: Igor Kozhukov
  status: In progress

* Managed domains?

--bcaec5171ecd0bfd1504cedb9ec6
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

It&#39;s been a few weeks since I&#39;ve sent one out, so please send updat=
es!<br><br>This information will be mirrored on the Xen 4.3 Roadmap wiki pa=
ge:<br>=A0<a href=3D"http://wiki.xen.org/wiki/Xen_Roadmap/4.3">http://wiki.=
xen.org/wiki/Xen_Roadmap/4.3</a><br>
<br>=3D Timeline =3D<br><br>We are planning on a 9-month release cycle.=A0 =
Based on that, below are<br>our estimated dates:<br>* Feature Freeze: 25 Ma=
rch 2013<br>* First RC: 6 May 2013<br>* Release: 17 June 2013<br><br>The RC=
s and release will of course depend on stability and bugs, and<br>
will therefore be fairly unpredictable.=A0 The feature freeze may be<br>sli=
pped for especially important features which are near completion.<br><br>=
=3D Feature tracking =3D<br><br>Below is a list of features we&#39;re track=
ing for this release. Please<br>
respond to this mail with any updates to the status.<br><br>There are a num=
ber of items whose owners are marked as &quot;?&quot;.=A0 If you<br>are wor=
king on this, or know who is working on it, please respond and<br>let me kn=
ow.=A0 Alternately, if you would *like* to work on it, please<br>
let me know as well.<br><br>And if there is something you&#39;re working on=
 you&#39;d like tracked, please<br>respond, and I will add it to the list.<=
br><br>NB: Several of the items on this list are from external projects:<br=
>
linux, qemu, and libvirt.=A0 These are not part of the Xen tree, but are<br=
>directly related to our users&#39; experience (e.g., work in Linux or<br>q=
emu) or to integration with other important projects (e.g., libvirt<br>bind=
ings).=A0 Since all of these are part of the Xen community work, and<br>
comes from the same pool of labor, it makes sense to track the<br>progress =
here, even though they won&#39;t explicitly be released as part<br>of 4.3.<=
br><br>=3D=3D Completed =3D=3D<br><br>* Serial console improvements<br>=A0 =
-EHCI debug port<br>
<br>* Default to QEMU upstream (partial)<br>=A0- pci pass-thru (external)<b=
r>=A0- enable dirtybit tracking during migration (external)<br><br>* CPUID-=
based idle (don&#39;t rely on ACPI info f/ dom0)<br><br>=3D=3D Bugs =3D=3D<=
br><br>* xl, compat mode, and older kernels<br>
=A0 owner: ?<br>=A0 Many older 32-bit PV kernels that can run on a 64-bit h=
ypervisor with<br>=A0 xend do not work when started with xl.=A0 The followi=
ng work-around seems to<br>=A0 work:<br>=A0=A0=A0 xl create -p lightning.cf=
g<br>=A0=A0=A0 xenstore-write /local/domain/$(xl domid lightning)/device/vb=
d/51713/protocol x86_32-abi<br>
=A0=A0=A0 xl unpause lightning<br>=A0 This node is normally written by the =
guest kernel, but for older kernels<br>=A0 seems not to be.=A0 xend must ha=
ve a work-around; port this work-around to xl.<br><br>=3D=3D Not yet comple=
te =3D=3D<br><br>
* PVH mode (w/ Linux)<br>=A0 owner: mukesh@oracle<br>=A0 status (Linux): 3r=
d draft patches posted.=A0 <br>=A0 status (Xen): Patches being cleaned up f=
or submission<br><br>* Event channel scalability<br>=A0 owner: attilio@citr=
ix<br>
=A0 status: initial design proposed<br>=A0 Increase limit on event channels=
 (currently 1024 for 32-bit guests,<br>=A0 4096 for 64-bit guests)<br><br>*=
 ARM server port<br>=A0 owner: ijc@citrix<br>=A0 status: Core hypervisor pa=
tches accepted; Linux paches pending<br>
<br>* NUMA scheduler affinity<br>=A0 critical<br>=A0 owner: dario@citrix<br=
>=A0 status: Patches posted<br><br>* NUMA Memory migration <br>=A0 owner: d=
ario@citrix<br>=A0 status: ?<br><br>* blktap3 <br>=A0 owner: thanos@citrix<=
br>=A0 status: RFCs posted<br>
<br>* Default to QEMU upstream<br>=A0&gt; Add &quot;intel-hda&quot; to xmex=
ample file, since it works with 64-bit Win7/8<br>=A0- qemu-based stubdom (L=
inux or BSD libc)<br>=A0=A0 owner: anthony@citrix<br>=A0=A0 status: in prog=
ress<br>
=A0=A0 qemu-upstream needs a more fully-featured libc than exists in<br>=A0=
=A0 mini-os.=A0 Either work on a minimalist linux-based stubdom with<br>=A0=
=A0 glibc, or port one of the BSD libcs to minios.<br><br>=A0- xl cd-{inser=
t,eject} (external)<br>
=A0=A0 status: intilal implementation submitted<br><br>* Persistent grants =
for blk (external)<br>=A0 owner: roger.pau@citrix<br>=A0 status: Initial im=
plementation posted<br><br>* Persistent grants for net<br>=A0 owner: annie.=
li@citrix<br>
=A0 status: Initial implementation posted<br><br>* Multi-page blk rings (ex=
ternal)<br>=A0- blkback in kernel (konrad@oracle, ?@intel)<br>=A0- qemu blk=
back<br>=A0 status: Not started.<br><br>* Multi-page net protocol (external=
)<br>
=A0 owner: ijc@citrix or annie.li@oracle<br>=A0 status: Initial patches pos=
ted (by Wei Liu)<br>=A0 expand the network ring protocol to allow multiple =
pages for<br>=A0 increased throughput<br><br>* Scalability: 16TiB of RAM<br=
>=A0 owner: jan@suse<br>
=A0 status: Not started<br><br>* vTPM updates<br>=A0 owner: Matthew Fiorava=
nte @ Johns Hopkins<br>=A0 status: some patches submitted, more in progress=
<br>=A0 - Allow all vTPM components to run in stub domains for increased se=
curity<br>
=A0 - Update vtpm to 0.7.1 from 0.5.x<br><br>* libvirt/libxl integration (e=
xternal)<br>=A0- Migration<br>=A0=A0 owner: cyliu@suse (?)<br>=A0=A0 status=
: first draft implemented, not yet submitted<br>=A0- Itemize other things t=
hat need work<br>
=A0=A0 To begin with, we need someone to go and make some lists:<br>=A0=A0 =
- Features available in libvirt/KVM not available in libvirt/libxl<br>=A0=
=A0=A0=A0 See <a href=3D"http://libvirt.org/hvsupport.html">http://libvirt.=
org/hvsupport.html</a><br>
=A0=A0 - Features available in xl/Xen but not available in libvirt/Xen<br><=
br>* V4V: Inter-domain communication<br>=A0 owner (Xen): <a href=3D"mailto:=
jean.guyader@citrix.com">jean.guyader@citrix.com</a><br>=A0 status (Xen): p=
atches submitted<br>
=A0 owner (Linux driver):=A0 stefano.panella@citrix<br>=A0 status (Linux dr=
iver): in progress<br><br>* Wait queues for mm<br>=A0 owner: ?<br>=A0 statu=
s: Draft posted Feb 2012; more work to do.<br><br>* xl vm-{export,import}<b=
r>=A0 owner: ?<br>
=A0 status: ?<br>=A0 Allow xl to import and export VMs to other formats; pa=
rticularly<br>=A0 ovf, perhaps the XenServer format, or more.<br>=A0 <br>* =
xl PVUSB pass-through for both PV and HVM guests<br>=A0 owner: ?<br>=A0 sta=
tus: ?<br>
=A0 xm/xend supports PVUSB pass-through to guests with PVUSB drivers (both =
PV and HVM guests).<br>=A0 - port the xm/xend functionality to xl.<br>=A0 -=
 this PVUSB feature does not require support or emulation from Qemu.<br>=A0=
 - upstream the Linux frontend/backend drivers. Current work-in-progress ve=
rsions are in Konrad&#39;s git tree.<br>
=A0 - James Harper&#39;s GPLPV drivers for Windows include PVUSB frontend d=
rivers.<br><br>* xl USB pass-through for HVM guests using Qemu USB emulatio=
n<br>=A0 owner: ?<br>=A0 status: ?<br>=A0 xm/xend with qemu-traditional sup=
ports USB passthrough to HVM guests using the Qemu emulated USB controller.=
<br>
=A0 The HVM guest does not need any special drivers for this feature.<br>=
=A0 So basicly the qemu cmdline needs to have:<br>=A0=A0=A0=A0 -usb -usbdev=
ice host:xxxx:yyyy<br>=A0 - port the xm/xend functionality to xl.<br>=A0 - =
make sure USB passthrough with xl works with both qemu-traditional and qemu=
-upstream.<br>
<br>* xl QXL Spice support<br>=A0 owner: Zhou Peng<br>=A0 status: Patches a=
gainst 4.3-unstable posted, awaiting approval<br><br>* openvswitch toostack=
 integration<br>=A0 owner: roger@citrix<br>=A0 status: Sample script posted=
 by Bastian (&quot;[RFC] openvswitch support script&quot;)<br>
<br>* Rationalized backend scripts (incl. driver domains)<br>=A0 owner: rog=
er@citrix<br>=A0 status: ?<br><br>* Serial console improvements<br>=A0 owne=
r: ?<br>=A0 status: Stalled (see below)<br>=A0 -xHCI debug port (Needs hard=
ware)<br>
=A0 -Firewire (needs hardware)<br><br>* Remove hardcoded mobprobe&#39;s in =
xencommons<br>=A0 owner: ?<br>=A0 status: ?<br><br>* Make storage migration=
 possible<br>=A0 owner: ?<br>=A0 status: ?<br>=A0 There needs to be a way, =
either via command-line or via some hooks,<br>
=A0 that someone can build a &quot;storage migration&quot; feature on top o=
f libxl<br>=A0 or xl.<br><br>* Full-VM snapshotting<br>=A0 owner: ?<br>=A0 =
status: ?<br>=A0 Have a way of coordinating the taking and restoring of VM =
memory and<br>
=A0 disk snapshots.=A0 This would involve some investigation into the best<=
br>=A0 way to accomplish this.<br><br>* VM Cloning<br>=A0 owner: ?<br>=A0 s=
tatus: May need review<br>=A0 Again, a way of coordinating the memory and d=
isk aspects.=A0 Research<br>
=A0 into the best way to do this would probably go along with the<br>=A0 sn=
apshotting feature.<br><br>* Memory: Replace PoD with paging mechanism<br>=
=A0 owner: george@citrix<br>=A0 status: May need review<br><br>* PV audio (=
audio for stubdom qemu)<br>
=A0 owner: stefano.panella@citrix<br>=A0 status: ?<br><br>* IllumOS support=
<br>=A0 owner: Igor Kozhukov<br>=A0 status: In progress<br><br>* Managed do=
mains?<br><br>

--bcaec5171ecd0bfd1504cedb9ec6--


--===============6990085667426271439==
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.xen.org
http://lists.xen.org/xen-devel

--===============6990085667426271439==--


From xen-devel-bounces@lists.xen.org Mon Nov 19 16:30:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 16:30:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaUEj-0007RH-4O; Mon, 19 Nov 2012 16:30:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TaUEh-0007RC-1P
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 16:30:15 +0000
Received: from [85.158.137.99:48050] by server-6.bemta-3.messagelabs.com id
	4F/07-28265-69E5AA05; Mon, 19 Nov 2012 16:30:14 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1353342611!12887525!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=1.7 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_10_20,HTML_MESSAGE,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1115 invoked from network); 19 Nov 2012 16:30:12 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 16:30:12 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl15so6333093vcb.32
	for <xen-devel@lists.xen.org>; Mon, 19 Nov 2012 08:29:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:content-type;
	bh=tesl/bI/ycpmQpD92Ia4oGc2YeGGdy3p7cFmMwqAXgk=;
	b=hgl/DnAECaciNjD5WH5MbVWZteWI1IS/CQiD9tcyO3FnZMg9uYRRSIR66SBF9nXLQz
	cfO4ECk2ke+zki2bZZjoxHkHCVbAoW0gONdWUS3pVTzkiVlI6nFUfxpHRY/7l7+nLJt+
	9JOKwJuhuQCTh4hfZBF4l31tzvOkCalTRCohzrL4OnEEoW4w5MF/sDS2rSxdSPee8sF4
	naG44QwbWvpYkF9oyJ8PSsQPLQCZIdgNT42vdeaBn+xiqrvzuNNQGq7s/OFgHRmyA6Or
	MVdXdznRVTL5V21OjMvAEGrWNCqMVonn2BZuYYfpLM5Ve1VoLOlM1t3xFQly/YFNWYDm
	0UgQ==
MIME-Version: 1.0
Received: by 10.52.179.130 with SMTP id dg2mr3325862vdc.8.1353342551587; Mon,
	19 Nov 2012 08:29:11 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Mon, 19 Nov 2012 08:29:11 -0800 (PST)
Date: Mon, 19 Nov 2012 16:29:11 +0000
X-Google-Sender-Auth: _mQ2f0aVYFpYO7nD7OgZ6wrGbIk
Message-ID: <CAFLBxZaB46yiUBd8dj3QLtJQP5WCkdbhK9fvwHvCRNA_x8N1Ug@mail.gmail.com>
From: George Dunlap <dunlapg@umich.edu>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: [Xen-devel] Xen 4.3 development update, 19 Nov
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6990085667426271439=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6990085667426271439==
Content-Type: multipart/alternative; boundary=bcaec5171ecd0bfd1504cedb9ec6

--bcaec5171ecd0bfd1504cedb9ec6
Content-Type: text/plain; charset=ISO-8859-1

It's been a few weeks since I've sent one out, so please send updates!

This information will be mirrored on the Xen 4.3 Roadmap wiki page:
 http://wiki.xen.org/wiki/Xen_Roadmap/4.3

= Timeline =

We are planning on a 9-month release cycle.  Based on that, below are
our estimated dates:
* Feature Freeze: 25 March 2013
* First RC: 6 May 2013
* Release: 17 June 2013

The RCs and release will of course depend on stability and bugs, and
will therefore be fairly unpredictable.  The feature freeze may be
slipped for especially important features which are near completion.

= Feature tracking =

Below is a list of features we're tracking for this release. Please
respond to this mail with any updates to the status.

There are a number of items whose owners are marked as "?".  If you
are working on this, or know who is working on it, please respond and
let me know.  Alternately, if you would *like* to work on it, please
let me know as well.

And if there is something you're working on you'd like tracked, please
respond, and I will add it to the list.

NB: Several of the items on this list are from external projects:
linux, qemu, and libvirt.  These are not part of the Xen tree, but are
directly related to our users' experience (e.g., work in Linux or
qemu) or to integration with other important projects (e.g., libvirt
bindings).  Since all of these are part of the Xen community work, and
comes from the same pool of labor, it makes sense to track the
progress here, even though they won't explicitly be released as part
of 4.3.

== Completed ==

* Serial console improvements
  -EHCI debug port

* Default to QEMU upstream (partial)
 - pci pass-thru (external)
 - enable dirtybit tracking during migration (external)

* CPUID-based idle (don't rely on ACPI info f/ dom0)

== Bugs ==

* xl, compat mode, and older kernels
  owner: ?
  Many older 32-bit PV kernels that can run on a 64-bit hypervisor with
  xend do not work when started with xl.  The following work-around seems to
  work:
    xl create -p lightning.cfg
    xenstore-write /local/domain/$(xl domid
lightning)/device/vbd/51713/protocol x86_32-abi
    xl unpause lightning
  This node is normally written by the guest kernel, but for older kernels
  seems not to be.  xend must have a work-around; port this work-around to
xl.

== Not yet complete ==

* PVH mode (w/ Linux)
  owner: mukesh@oracle
  status (Linux): 3rd draft patches posted.
  status (Xen): Patches being cleaned up for submission

* Event channel scalability
  owner: attilio@citrix
  status: initial design proposed
  Increase limit on event channels (currently 1024 for 32-bit guests,
  4096 for 64-bit guests)

* ARM server port
  owner: ijc@citrix
  status: Core hypervisor patches accepted; Linux paches pending

* NUMA scheduler affinity
  critical
  owner: dario@citrix
  status: Patches posted

* NUMA Memory migration
  owner: dario@citrix
  status: ?

* blktap3
  owner: thanos@citrix
  status: RFCs posted

* Default to QEMU upstream
 > Add "intel-hda" to xmexample file, since it works with 64-bit Win7/8
 - qemu-based stubdom (Linux or BSD libc)
   owner: anthony@citrix
   status: in progress
   qemu-upstream needs a more fully-featured libc than exists in
   mini-os.  Either work on a minimalist linux-based stubdom with
   glibc, or port one of the BSD libcs to minios.

 - xl cd-{insert,eject} (external)
   status: intilal implementation submitted

* Persistent grants for blk (external)
  owner: roger.pau@citrix
  status: Initial implementation posted

* Persistent grants for net
  owner: annie.li@citrix
  status: Initial implementation posted

* Multi-page blk rings (external)
 - blkback in kernel (konrad@oracle, ?@intel)
 - qemu blkback
  status: Not started.

* Multi-page net protocol (external)
  owner: ijc@citrix or annie.li@oracle
  status: Initial patches posted (by Wei Liu)
  expand the network ring protocol to allow multiple pages for
  increased throughput

* Scalability: 16TiB of RAM
  owner: jan@suse
  status: Not started

* vTPM updates
  owner: Matthew Fioravante @ Johns Hopkins
  status: some patches submitted, more in progress
  - Allow all vTPM components to run in stub domains for increased security
  - Update vtpm to 0.7.1 from 0.5.x

* libvirt/libxl integration (external)
 - Migration
   owner: cyliu@suse (?)
   status: first draft implemented, not yet submitted
 - Itemize other things that need work
   To begin with, we need someone to go and make some lists:
   - Features available in libvirt/KVM not available in libvirt/libxl
     See http://libvirt.org/hvsupport.html
   - Features available in xl/Xen but not available in libvirt/Xen

* V4V: Inter-domain communication
  owner (Xen): jean.guyader@citrix.com
  status (Xen): patches submitted
  owner (Linux driver):  stefano.panella@citrix
  status (Linux driver): in progress

* Wait queues for mm
  owner: ?
  status: Draft posted Feb 2012; more work to do.

* xl vm-{export,import}
  owner: ?
  status: ?
  Allow xl to import and export VMs to other formats; particularly
  ovf, perhaps the XenServer format, or more.

* xl PVUSB pass-through for both PV and HVM guests
  owner: ?
  status: ?
  xm/xend supports PVUSB pass-through to guests with PVUSB drivers (both PV
and HVM guests).
  - port the xm/xend functionality to xl.
  - this PVUSB feature does not require support or emulation from Qemu.
  - upstream the Linux frontend/backend drivers. Current work-in-progress
versions are in Konrad's git tree.
  - James Harper's GPLPV drivers for Windows include PVUSB frontend drivers.

* xl USB pass-through for HVM guests using Qemu USB emulation
  owner: ?
  status: ?
  xm/xend with qemu-traditional supports USB passthrough to HVM guests
using the Qemu emulated USB controller.
  The HVM guest does not need any special drivers for this feature.
  So basicly the qemu cmdline needs to have:
     -usb -usbdevice host:xxxx:yyyy
  - port the xm/xend functionality to xl.
  - make sure USB passthrough with xl works with both qemu-traditional and
qemu-upstream.

* xl QXL Spice support
  owner: Zhou Peng
  status: Patches against 4.3-unstable posted, awaiting approval

* openvswitch toostack integration
  owner: roger@citrix
  status: Sample script posted by Bastian ("[RFC] openvswitch support
script")

* Rationalized backend scripts (incl. driver domains)
  owner: roger@citrix
  status: ?

* Serial console improvements
  owner: ?
  status: Stalled (see below)
  -xHCI debug port (Needs hardware)
  -Firewire (needs hardware)

* Remove hardcoded mobprobe's in xencommons
  owner: ?
  status: ?

* Make storage migration possible
  owner: ?
  status: ?
  There needs to be a way, either via command-line or via some hooks,
  that someone can build a "storage migration" feature on top of libxl
  or xl.

* Full-VM snapshotting
  owner: ?
  status: ?
  Have a way of coordinating the taking and restoring of VM memory and
  disk snapshots.  This would involve some investigation into the best
  way to accomplish this.

* VM Cloning
  owner: ?
  status: May need review
  Again, a way of coordinating the memory and disk aspects.  Research
  into the best way to do this would probably go along with the
  snapshotting feature.

* Memory: Replace PoD with paging mechanism
  owner: george@citrix
  status: May need review

* PV audio (audio for stubdom qemu)
  owner: stefano.panella@citrix
  status: ?

* IllumOS support
  owner: Igor Kozhukov
  status: In progress

* Managed domains?

--bcaec5171ecd0bfd1504cedb9ec6
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

It&#39;s been a few weeks since I&#39;ve sent one out, so please send updat=
es!<br><br>This information will be mirrored on the Xen 4.3 Roadmap wiki pa=
ge:<br>=A0<a href=3D"http://wiki.xen.org/wiki/Xen_Roadmap/4.3">http://wiki.=
xen.org/wiki/Xen_Roadmap/4.3</a><br>
<br>=3D Timeline =3D<br><br>We are planning on a 9-month release cycle.=A0 =
Based on that, below are<br>our estimated dates:<br>* Feature Freeze: 25 Ma=
rch 2013<br>* First RC: 6 May 2013<br>* Release: 17 June 2013<br><br>The RC=
s and release will of course depend on stability and bugs, and<br>
will therefore be fairly unpredictable.=A0 The feature freeze may be<br>sli=
pped for especially important features which are near completion.<br><br>=
=3D Feature tracking =3D<br><br>Below is a list of features we&#39;re track=
ing for this release. Please<br>
respond to this mail with any updates to the status.<br><br>There are a num=
ber of items whose owners are marked as &quot;?&quot;.=A0 If you<br>are wor=
king on this, or know who is working on it, please respond and<br>let me kn=
ow.=A0 Alternately, if you would *like* to work on it, please<br>
let me know as well.<br><br>And if there is something you&#39;re working on=
 you&#39;d like tracked, please<br>respond, and I will add it to the list.<=
br><br>NB: Several of the items on this list are from external projects:<br=
>
linux, qemu, and libvirt.=A0 These are not part of the Xen tree, but are<br=
>directly related to our users&#39; experience (e.g., work in Linux or<br>q=
emu) or to integration with other important projects (e.g., libvirt<br>bind=
ings).=A0 Since all of these are part of the Xen community work, and<br>
comes from the same pool of labor, it makes sense to track the<br>progress =
here, even though they won&#39;t explicitly be released as part<br>of 4.3.<=
br><br>=3D=3D Completed =3D=3D<br><br>* Serial console improvements<br>=A0 =
-EHCI debug port<br>
<br>* Default to QEMU upstream (partial)<br>=A0- pci pass-thru (external)<b=
r>=A0- enable dirtybit tracking during migration (external)<br><br>* CPUID-=
based idle (don&#39;t rely on ACPI info f/ dom0)<br><br>=3D=3D Bugs =3D=3D<=
br><br>* xl, compat mode, and older kernels<br>
=A0 owner: ?<br>=A0 Many older 32-bit PV kernels that can run on a 64-bit h=
ypervisor with<br>=A0 xend do not work when started with xl.=A0 The followi=
ng work-around seems to<br>=A0 work:<br>=A0=A0=A0 xl create -p lightning.cf=
g<br>=A0=A0=A0 xenstore-write /local/domain/$(xl domid lightning)/device/vb=
d/51713/protocol x86_32-abi<br>
=A0=A0=A0 xl unpause lightning<br>=A0 This node is normally written by the =
guest kernel, but for older kernels<br>=A0 seems not to be.=A0 xend must ha=
ve a work-around; port this work-around to xl.<br><br>=3D=3D Not yet comple=
te =3D=3D<br><br>
* PVH mode (w/ Linux)<br>=A0 owner: mukesh@oracle<br>=A0 status (Linux): 3r=
d draft patches posted.=A0 <br>=A0 status (Xen): Patches being cleaned up f=
or submission<br><br>* Event channel scalability<br>=A0 owner: attilio@citr=
ix<br>
=A0 status: initial design proposed<br>=A0 Increase limit on event channels=
 (currently 1024 for 32-bit guests,<br>=A0 4096 for 64-bit guests)<br><br>*=
 ARM server port<br>=A0 owner: ijc@citrix<br>=A0 status: Core hypervisor pa=
tches accepted; Linux paches pending<br>
<br>* NUMA scheduler affinity<br>=A0 critical<br>=A0 owner: dario@citrix<br=
>=A0 status: Patches posted<br><br>* NUMA Memory migration <br>=A0 owner: d=
ario@citrix<br>=A0 status: ?<br><br>* blktap3 <br>=A0 owner: thanos@citrix<=
br>=A0 status: RFCs posted<br>
<br>* Default to QEMU upstream<br>=A0&gt; Add &quot;intel-hda&quot; to xmex=
ample file, since it works with 64-bit Win7/8<br>=A0- qemu-based stubdom (L=
inux or BSD libc)<br>=A0=A0 owner: anthony@citrix<br>=A0=A0 status: in prog=
ress<br>
=A0=A0 qemu-upstream needs a more fully-featured libc than exists in<br>=A0=
=A0 mini-os.=A0 Either work on a minimalist linux-based stubdom with<br>=A0=
=A0 glibc, or port one of the BSD libcs to minios.<br><br>=A0- xl cd-{inser=
t,eject} (external)<br>
=A0=A0 status: intilal implementation submitted<br><br>* Persistent grants =
for blk (external)<br>=A0 owner: roger.pau@citrix<br>=A0 status: Initial im=
plementation posted<br><br>* Persistent grants for net<br>=A0 owner: annie.=
li@citrix<br>
=A0 status: Initial implementation posted<br><br>* Multi-page blk rings (ex=
ternal)<br>=A0- blkback in kernel (konrad@oracle, ?@intel)<br>=A0- qemu blk=
back<br>=A0 status: Not started.<br><br>* Multi-page net protocol (external=
)<br>
=A0 owner: ijc@citrix or annie.li@oracle<br>=A0 status: Initial patches pos=
ted (by Wei Liu)<br>=A0 expand the network ring protocol to allow multiple =
pages for<br>=A0 increased throughput<br><br>* Scalability: 16TiB of RAM<br=
>=A0 owner: jan@suse<br>
=A0 status: Not started<br><br>* vTPM updates<br>=A0 owner: Matthew Fiorava=
nte @ Johns Hopkins<br>=A0 status: some patches submitted, more in progress=
<br>=A0 - Allow all vTPM components to run in stub domains for increased se=
curity<br>
=A0 - Update vtpm to 0.7.1 from 0.5.x<br><br>* libvirt/libxl integration (e=
xternal)<br>=A0- Migration<br>=A0=A0 owner: cyliu@suse (?)<br>=A0=A0 status=
: first draft implemented, not yet submitted<br>=A0- Itemize other things t=
hat need work<br>
=A0=A0 To begin with, we need someone to go and make some lists:<br>=A0=A0 =
- Features available in libvirt/KVM not available in libvirt/libxl<br>=A0=
=A0=A0=A0 See <a href=3D"http://libvirt.org/hvsupport.html">http://libvirt.=
org/hvsupport.html</a><br>
=A0=A0 - Features available in xl/Xen but not available in libvirt/Xen<br><=
br>* V4V: Inter-domain communication<br>=A0 owner (Xen): <a href=3D"mailto:=
jean.guyader@citrix.com">jean.guyader@citrix.com</a><br>=A0 status (Xen): p=
atches submitted<br>
=A0 owner (Linux driver):=A0 stefano.panella@citrix<br>=A0 status (Linux dr=
iver): in progress<br><br>* Wait queues for mm<br>=A0 owner: ?<br>=A0 statu=
s: Draft posted Feb 2012; more work to do.<br><br>* xl vm-{export,import}<b=
r>=A0 owner: ?<br>
=A0 status: ?<br>=A0 Allow xl to import and export VMs to other formats; pa=
rticularly<br>=A0 ovf, perhaps the XenServer format, or more.<br>=A0 <br>* =
xl PVUSB pass-through for both PV and HVM guests<br>=A0 owner: ?<br>=A0 sta=
tus: ?<br>
=A0 xm/xend supports PVUSB pass-through to guests with PVUSB drivers (both =
PV and HVM guests).<br>=A0 - port the xm/xend functionality to xl.<br>=A0 -=
 this PVUSB feature does not require support or emulation from Qemu.<br>=A0=
 - upstream the Linux frontend/backend drivers. Current work-in-progress ve=
rsions are in Konrad&#39;s git tree.<br>
=A0 - James Harper&#39;s GPLPV drivers for Windows include PVUSB frontend d=
rivers.<br><br>* xl USB pass-through for HVM guests using Qemu USB emulatio=
n<br>=A0 owner: ?<br>=A0 status: ?<br>=A0 xm/xend with qemu-traditional sup=
ports USB passthrough to HVM guests using the Qemu emulated USB controller.=
<br>
=A0 The HVM guest does not need any special drivers for this feature.<br>=
=A0 So basicly the qemu cmdline needs to have:<br>=A0=A0=A0=A0 -usb -usbdev=
ice host:xxxx:yyyy<br>=A0 - port the xm/xend functionality to xl.<br>=A0 - =
make sure USB passthrough with xl works with both qemu-traditional and qemu=
-upstream.<br>
<br>* xl QXL Spice support<br>=A0 owner: Zhou Peng<br>=A0 status: Patches a=
gainst 4.3-unstable posted, awaiting approval<br><br>* openvswitch toostack=
 integration<br>=A0 owner: roger@citrix<br>=A0 status: Sample script posted=
 by Bastian (&quot;[RFC] openvswitch support script&quot;)<br>
<br>* Rationalized backend scripts (incl. driver domains)<br>=A0 owner: rog=
er@citrix<br>=A0 status: ?<br><br>* Serial console improvements<br>=A0 owne=
r: ?<br>=A0 status: Stalled (see below)<br>=A0 -xHCI debug port (Needs hard=
ware)<br>
=A0 -Firewire (needs hardware)<br><br>* Remove hardcoded mobprobe&#39;s in =
xencommons<br>=A0 owner: ?<br>=A0 status: ?<br><br>* Make storage migration=
 possible<br>=A0 owner: ?<br>=A0 status: ?<br>=A0 There needs to be a way, =
either via command-line or via some hooks,<br>
=A0 that someone can build a &quot;storage migration&quot; feature on top o=
f libxl<br>=A0 or xl.<br><br>* Full-VM snapshotting<br>=A0 owner: ?<br>=A0 =
status: ?<br>=A0 Have a way of coordinating the taking and restoring of VM =
memory and<br>
=A0 disk snapshots.=A0 This would involve some investigation into the best<=
br>=A0 way to accomplish this.<br><br>* VM Cloning<br>=A0 owner: ?<br>=A0 s=
tatus: May need review<br>=A0 Again, a way of coordinating the memory and d=
isk aspects.=A0 Research<br>
=A0 into the best way to do this would probably go along with the<br>=A0 sn=
apshotting feature.<br><br>* Memory: Replace PoD with paging mechanism<br>=
=A0 owner: george@citrix<br>=A0 status: May need review<br><br>* PV audio (=
audio for stubdom qemu)<br>
=A0 owner: stefano.panella@citrix<br>=A0 status: ?<br><br>* IllumOS support=
<br>=A0 owner: Igor Kozhukov<br>=A0 status: In progress<br><br>* Managed do=
mains?<br><br>

--bcaec5171ecd0bfd1504cedb9ec6--


--===============6990085667426271439==
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.xen.org
http://lists.xen.org/xen-devel

--===============6990085667426271439==--


From xen-devel-bounces@lists.xen.org Mon Nov 19 16:49:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 16:49:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaUXT-0007hp-6H; Mon, 19 Nov 2012 16:49:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaUXR-0007hk-LU
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 16:49:37 +0000
Received: from [85.158.137.99:55546] by server-15.bemta-3.messagelabs.com id
	44/39-09445-0236AA05; Mon, 19 Nov 2012 16:49:36 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353343774!19624002!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11279 invoked from network); 19 Nov 2012 16:49:36 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-2.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 16:49:36 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157612759;
	Mon, 19 Nov 2012 11:49:28 -0500
Message-ID: <50AA6315.1060607@jhuapl.edu>
Date: Mon, 19 Nov 2012 11:49:25 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
	<50AA3B74.4090907@jhuapl.edu>
	<20650.23440.50240.311533@mariner.uk.xensource.com>
In-Reply-To: <20650.23440.50240.311533@mariner.uk.xensource.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3291801554700510091=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============3291801554700510091==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms070601060100080302010302"

This is a cryptographically signed message in MIME format.

--------------ms070601060100080302010302
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/19/2012 11:17 AM, Ian Jackson wrote:
> Matthew Fioravante writes ("Re: [Xen-devel] [PATCH VTPM v3 00/10] Remai=
ning vtpm patches"):
>> On 11/19/2012 08:54 AM, Ian Campbell wrote:
>>> Looks like we've grown a dependency on cmake. I vaguely recall
>>> discussing before, can you remind me if this is a hard requirement on=

>>> the end user system or not.
>> Unfortunately it is a hard requirement. Its used to pass the stubdom
>> build flags to the tpm_emulator.
> Is tpm built by default ?
Currently in my patches vtpm-stubdom and vtpmmgrdom are built by default =

when you do a make stubdom, so yes.
> Ian.



--------------ms070601060100080302010302
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlCwMBAQEBBAoWCGZpb3JhbWUxMBsGDSsGAQQBsyUL
AwEBAQIEChIIMDAxMDQyNj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tpnnqna7PL66KuLIi+Zvu1h+2/yikP
6VzPIEx4CRtf18/ip/1qltZm30/HneCBIPAB2JDKUpLK1dOxdsZk+ZZ/GVHx3yg7tre9kKYq
7drLiEf1/yKRi7GxG5tsA6EbyC7DxmdAvRdu9xegY9gzWxcWmgYSPstGg8cW+ovVOAAAAAAA
AA==
--------------ms070601060100080302010302--


--===============3291801554700510091==
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.xen.org
http://lists.xen.org/xen-devel

--===============3291801554700510091==--


From xen-devel-bounces@lists.xen.org Mon Nov 19 16:49:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 16:49:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaUXT-0007hp-6H; Mon, 19 Nov 2012 16:49:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaUXR-0007hk-LU
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 16:49:37 +0000
Received: from [85.158.137.99:55546] by server-15.bemta-3.messagelabs.com id
	44/39-09445-0236AA05; Mon, 19 Nov 2012 16:49:36 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353343774!19624002!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11279 invoked from network); 19 Nov 2012 16:49:36 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-2.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 16:49:36 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157612759;
	Mon, 19 Nov 2012 11:49:28 -0500
Message-ID: <50AA6315.1060607@jhuapl.edu>
Date: Mon, 19 Nov 2012 11:49:25 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
	<50AA3B74.4090907@jhuapl.edu>
	<20650.23440.50240.311533@mariner.uk.xensource.com>
In-Reply-To: <20650.23440.50240.311533@mariner.uk.xensource.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3291801554700510091=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============3291801554700510091==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms070601060100080302010302"

This is a cryptographically signed message in MIME format.

--------------ms070601060100080302010302
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/19/2012 11:17 AM, Ian Jackson wrote:
> Matthew Fioravante writes ("Re: [Xen-devel] [PATCH VTPM v3 00/10] Remai=
ning vtpm patches"):
>> On 11/19/2012 08:54 AM, Ian Campbell wrote:
>>> Looks like we've grown a dependency on cmake. I vaguely recall
>>> discussing before, can you remind me if this is a hard requirement on=

>>> the end user system or not.
>> Unfortunately it is a hard requirement. Its used to pass the stubdom
>> build flags to the tpm_emulator.
> Is tpm built by default ?
Currently in my patches vtpm-stubdom and vtpmmgrdom are built by default =

when you do a make stubdom, so yes.
> Ian.



--------------ms070601060100080302010302
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zS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AQkEMRYEFN/x4VYf5nBBM6EV
0ETz0Tqp97i1MGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYBN48tpnnqna7PL66KuLIi+Zvu1h+2/yikP
6VzPIEx4CRtf18/ip/1qltZm30/HneCBIPAB2JDKUpLK1dOxdsZk+ZZ/GVHx3yg7tre9kKYq
7drLiEf1/yKRi7GxG5tsA6EbyC7DxmdAvRdu9xegY9gzWxcWmgYSPstGg8cW+ovVOAAAAAAA
AA==
--------------ms070601060100080302010302--


--===============3291801554700510091==
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.xen.org
http://lists.xen.org/xen-devel

--===============3291801554700510091==--


From xen-devel-bounces@lists.xen.org Mon Nov 19 16:55:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 16:55:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaUd4-0007ss-W4; Mon, 19 Nov 2012 16:55:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaUd3-0007sl-Jv
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 16:55:25 +0000
Received: from [85.158.139.211:52208] by server-13.bemta-5.messagelabs.com id
	61/7A-27809-C746AA05; Mon, 19 Nov 2012 16:55:24 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353344123!20716539!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20531 invoked from network); 19 Nov 2012 16:55:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 16:55:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15886122"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 16:55:07 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 16:55:07 +0000
Message-ID: <1353344105.18229.127.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Mon, 19 Nov 2012 16:55:05 +0000
In-Reply-To: <50AA6315.1060607@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
	<50AA3B74.4090907@jhuapl.edu>
	<20650.23440.50240.311533@mariner.uk.xensource.com>
	<50AA6315.1060607@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 16:49 +0000, Matthew Fioravante wrote:
> On 11/19/2012 11:17 AM, Ian Jackson wrote:
> > Matthew Fioravante writes ("Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches"):
> >> On 11/19/2012 08:54 AM, Ian Campbell wrote:
> >>> Looks like we've grown a dependency on cmake. I vaguely recall
> >>> discussing before, can you remind me if this is a hard requirement on
> >>> the end user system or not.
> >> Unfortunately it is a hard requirement. Its used to pass the stubdom
> >> build flags to the tpm_emulator.
> > Is tpm built by default ?
> Currently in my patches vtpm-stubdom and vtpmmgrdom are built by default 
> when you do a make stubdom, so yes.

It's worth mentioning that in a different subthread we are considering
changing that though.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 16:55:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 16:55:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaUd4-0007ss-W4; Mon, 19 Nov 2012 16:55:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaUd3-0007sl-Jv
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 16:55:25 +0000
Received: from [85.158.139.211:52208] by server-13.bemta-5.messagelabs.com id
	61/7A-27809-C746AA05; Mon, 19 Nov 2012 16:55:24 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353344123!20716539!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20531 invoked from network); 19 Nov 2012 16:55:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 16:55:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15886122"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 16:55:07 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 16:55:07 +0000
Message-ID: <1353344105.18229.127.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Mon, 19 Nov 2012 16:55:05 +0000
In-Reply-To: <50AA6315.1060607@jhuapl.edu>
References: <1352992629-5850-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353329819.18229.83.camel@zakaz.uk.xensource.com>
	<1353333247.18229.88.camel@zakaz.uk.xensource.com>
	<50AA3B74.4090907@jhuapl.edu>
	<20650.23440.50240.311533@mariner.uk.xensource.com>
	<50AA6315.1060607@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 16:49 +0000, Matthew Fioravante wrote:
> On 11/19/2012 11:17 AM, Ian Jackson wrote:
> > Matthew Fioravante writes ("Re: [Xen-devel] [PATCH VTPM v3 00/10] Remaining vtpm patches"):
> >> On 11/19/2012 08:54 AM, Ian Campbell wrote:
> >>> Looks like we've grown a dependency on cmake. I vaguely recall
> >>> discussing before, can you remind me if this is a hard requirement on
> >>> the end user system or not.
> >> Unfortunately it is a hard requirement. Its used to pass the stubdom
> >> build flags to the tpm_emulator.
> > Is tpm built by default ?
> Currently in my patches vtpm-stubdom and vtpmmgrdom are built by default 
> when you do a make stubdom, so yes.

It's worth mentioning that in a different subthread we are considering
changing that though.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 16:58:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 16:58:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaUfM-0007zF-G8; Mon, 19 Nov 2012 16:57:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaUfL-0007z8-Dy
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 16:57:47 +0000
Received: from [85.158.143.35:59296] by server-3.bemta-4.messagelabs.com id
	2F/5D-06841-A056AA05; Mon, 19 Nov 2012 16:57:46 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1353344258!14564339!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25643 invoked from network); 19 Nov 2012 16:57:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 16:57:44 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15886180"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 16:57:38 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 16:57:38 +0000
Message-ID: <1353344256.18229.129.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Mon, 19 Nov 2012 16:57:36 +0000
In-Reply-To: <50AA5061.7040103@eu.citrix.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 15:29 +0000, George Dunlap wrote:
> On 19/11/12 09:55, Ian Campbell wrote:
> > If we get to this stage then haven't we either already sent something
> > over the wire for this page or marked it as dirty when we tried and
> > failed to send it?
> >
> > In the former case we don't care that the page is now broken on the
> > source since the target has got a good pre-breakage copy.
> >
> > In the latter case could we not set a flag at the same time as we mark
> > the page dirty which means "go round at least one more time"?
> 
> Yeah -- on the last iteration, the VM itself has to be paused; if any 
> pages get broken after that, it doesn't really matter, does it? The real 
> thing is to have a consistent "snapshot" of behavior.
> 
> I guess the one potentially tricky case to worry about is whether to 
> deliver an MCE to the guest on restore.  Consider the following scenario:
> 
> - Page A is modified (and marked dirty)
> - VM paused for last iteration
> - Page breaks, is marked broken in the p2m
> - Save code sends page A
> 
> In that case, the save code would send a "broken" page, and the restore 
> code would mark a page as broken, and we *would* want to deliver an MCE 
> on the far side.  But suppose the last two steps were reversed:
> 
> - Page A modified
> - VM paused for last iteration
> - Save code sends page A
> - Page breaks, marked broken in the p2m
> 
> In that case, when the save code sends page A, it will send a good page; 
> there's no need to mark it broken, or to send the guest an MCE.

I guess you'd want to err on the side of stopping using a good page, as
opposed to continuing to use a bad page? i.e. its better to take a
spurious vMCE than to not take an actual one.

I'm not actually sure what a guest does with a vMCE, I guess it does
some sort of memory exchange to give the bad page back to the h/v and
get a good page in return? If the hypervisor thinks the old page is ok
rather than bad I guess it'll just put it in the free list instead of
the bad list?

> 
> Am I understanding the situation correctly, Jinsong?
> 
>   -George



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 16:58:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 16:58:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaUfM-0007zF-G8; Mon, 19 Nov 2012 16:57:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaUfL-0007z8-Dy
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 16:57:47 +0000
Received: from [85.158.143.35:59296] by server-3.bemta-4.messagelabs.com id
	2F/5D-06841-A056AA05; Mon, 19 Nov 2012 16:57:46 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1353344258!14564339!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25643 invoked from network); 19 Nov 2012 16:57:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 16:57:44 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15886180"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 16:57:38 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 16:57:38 +0000
Message-ID: <1353344256.18229.129.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Mon, 19 Nov 2012 16:57:36 +0000
In-Reply-To: <50AA5061.7040103@eu.citrix.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 15:29 +0000, George Dunlap wrote:
> On 19/11/12 09:55, Ian Campbell wrote:
> > If we get to this stage then haven't we either already sent something
> > over the wire for this page or marked it as dirty when we tried and
> > failed to send it?
> >
> > In the former case we don't care that the page is now broken on the
> > source since the target has got a good pre-breakage copy.
> >
> > In the latter case could we not set a flag at the same time as we mark
> > the page dirty which means "go round at least one more time"?
> 
> Yeah -- on the last iteration, the VM itself has to be paused; if any 
> pages get broken after that, it doesn't really matter, does it? The real 
> thing is to have a consistent "snapshot" of behavior.
> 
> I guess the one potentially tricky case to worry about is whether to 
> deliver an MCE to the guest on restore.  Consider the following scenario:
> 
> - Page A is modified (and marked dirty)
> - VM paused for last iteration
> - Page breaks, is marked broken in the p2m
> - Save code sends page A
> 
> In that case, the save code would send a "broken" page, and the restore 
> code would mark a page as broken, and we *would* want to deliver an MCE 
> on the far side.  But suppose the last two steps were reversed:
> 
> - Page A modified
> - VM paused for last iteration
> - Save code sends page A
> - Page breaks, marked broken in the p2m
> 
> In that case, when the save code sends page A, it will send a good page; 
> there's no need to mark it broken, or to send the guest an MCE.

I guess you'd want to err on the side of stopping using a good page, as
opposed to continuing to use a bad page? i.e. its better to take a
spurious vMCE than to not take an actual one.

I'm not actually sure what a guest does with a vMCE, I guess it does
some sort of memory exchange to give the bad page back to the h/v and
get a good page in return? If the hypervisor thinks the old page is ok
rather than bad I guess it'll just put it in the free list instead of
the bad list?

> 
> Am I understanding the situation correctly, Jinsong?
> 
>   -George



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 17:01:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 17:01:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaUj2-0008D9-5h; Mon, 19 Nov 2012 17:01:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaUj0-0008D4-LB
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 17:01:34 +0000
Received: from [85.158.143.35:3768] by server-3.bemta-4.messagelabs.com id
	3C/22-06841-EE56AA05; Mon, 19 Nov 2012 17:01:34 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1353344491!11255771!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27599 invoked from network); 19 Nov 2012 17:01:31 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 17:01:31 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15886241"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 17:01:31 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 17:01:31 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TaUiw-0000W8-Uu;
	Mon, 19 Nov 2012 17:01:30 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TaUiw-0003M9-F9;
	Mon, 19 Nov 2012 17:01:30 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14417-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 19 Nov 2012 17:01:30 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.1-testing test] 14417: trouble: broken/fail/pass
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14417 xen-4.1-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14417/

Failures and problems with tests :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-pv            3 host-install(3)         broken REGR. vs. 14400

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail like 14400

Tests which did not succeed, but are not blocking:
 test-amd64-i386-qemuu-rhel6hvm-intel 11 leak-check/check       fail never pass
 test-amd64-i386-qemuu-rhel6hvm-amd 11 leak-check/check         fail never pass
 test-amd64-i386-rhel6hvm-intel 11 leak-check/check             fail never pass
 test-amd64-i386-rhel6hvm-amd 11 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-i386-i386-xl-qemuu-winxpsp3 13 guest-stop                 fail never pass

version targeted for testing:
 xen                  5639047d6c9f
baseline version:
 xen                  ce405f5fd5ee

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               fail    
 test-amd64-i386-qemuu-rhel6hvm-intel                         fail    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 pass    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           broken  
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     pass    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   23414:5639047d6c9f
tag:         tip
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 09:43:48 2012 +0100
    
    fix backport oversight in 23383:addf106cc90f
    
    This fixes an omission in said backport (of -unstable
    25931:149805919569): While the XEN_DOMCTL_memory_mapping code
    pointlessly sets "ret" to zero, the XEN_DOMCTL_ioport_mapping code
    needs to because of an XSM call (leaving ret set to zero when reaching
    the code in question) present in -unstable, but absent in 4.1-testing.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   23413:ce405f5fd5ee
user:        Keir Fraser <keir@xen.org>
date:        Thu Nov 15 09:41:51 2012 +0000
    
    Added signature for changeset 500194a883bd
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 17:01:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 17:01:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaUj2-0008D9-5h; Mon, 19 Nov 2012 17:01:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaUj0-0008D4-LB
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 17:01:34 +0000
Received: from [85.158.143.35:3768] by server-3.bemta-4.messagelabs.com id
	3C/22-06841-EE56AA05; Mon, 19 Nov 2012 17:01:34 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1353344491!11255771!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27599 invoked from network); 19 Nov 2012 17:01:31 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 17:01:31 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15886241"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 17:01:31 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 17:01:31 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TaUiw-0000W8-Uu;
	Mon, 19 Nov 2012 17:01:30 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TaUiw-0003M9-F9;
	Mon, 19 Nov 2012 17:01:30 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14417-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 19 Nov 2012 17:01:30 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.1-testing test] 14417: trouble: broken/fail/pass
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14417 xen-4.1-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14417/

Failures and problems with tests :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-pv            3 host-install(3)         broken REGR. vs. 14400

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail like 14400

Tests which did not succeed, but are not blocking:
 test-amd64-i386-qemuu-rhel6hvm-intel 11 leak-check/check       fail never pass
 test-amd64-i386-qemuu-rhel6hvm-amd 11 leak-check/check         fail never pass
 test-amd64-i386-rhel6hvm-intel 11 leak-check/check             fail never pass
 test-amd64-i386-rhel6hvm-amd 11 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-i386-i386-xl-qemuu-winxpsp3 13 guest-stop                 fail never pass

version targeted for testing:
 xen                  5639047d6c9f
baseline version:
 xen                  ce405f5fd5ee

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               fail    
 test-amd64-i386-qemuu-rhel6hvm-intel                         fail    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 pass    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           broken  
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     pass    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   23414:5639047d6c9f
tag:         tip
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 09:43:48 2012 +0100
    
    fix backport oversight in 23383:addf106cc90f
    
    This fixes an omission in said backport (of -unstable
    25931:149805919569): While the XEN_DOMCTL_memory_mapping code
    pointlessly sets "ret" to zero, the XEN_DOMCTL_ioport_mapping code
    needs to because of an XSM call (leaving ret set to zero when reaching
    the code in question) present in -unstable, but absent in 4.1-testing.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   23413:ce405f5fd5ee
user:        Keir Fraser <keir@xen.org>
date:        Thu Nov 15 09:41:51 2012 +0000
    
    Added signature for changeset 500194a883bd
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 17:43:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 17:43:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaVMw-00009U-Sj; Mon, 19 Nov 2012 17:42:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaVMu-00009P-Vj
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 17:42:49 +0000
Received: from [85.158.137.99:24650] by server-2.bemta-3.messagelabs.com id
	2A/F3-04744-89F6AA05; Mon, 19 Nov 2012 17:42:48 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1353346966!16589315!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2910 invoked from network); 19 Nov 2012 17:42:46 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 17:42:46 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15887322"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 17:42:46 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 17:42:46 +0000
Message-ID: <1353346964.18229.151.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Mon, 19 Nov 2012 17:42:44 +0000
In-Reply-To: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
References: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] Make all public hosting providers
 eligible for the pre-disclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 17:14 +0000, George Dunlap wrote:
> As discussed on the xen-devel mailing list, allow any public hosting
> provider to join the pre-disclosure list:

Thanks for doing this.

> * Change "Large hosting providers" to "Public hosting providers"
> * Add rule of thumb for what "public hosting provider" means
> * Add an itemized list of information to be included in the application,
> to make expectations clear and (hopefully) applications more streamlined.
> 
> NOTE: This RFC is meant to be a way to start a discussion on the exact
> wording which will be voted on.  Once it has gone through review from
> the xen-devel mailing list, I will post an "RC" and announce it on the
> Xen blog, as well as on xen-users.  Once discussion seems to have
> converged, I will post a "FINAL" one, which I will put up for a vote.
> 
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
> ---
>  security_vulnerability_process.html |   27 ++++++++++++++++++++-------
>  1 file changed, 20 insertions(+), 7 deletions(-)
> 
> diff --git a/security_vulnerability_process.html b/security_vulnerability_process.html
> index e305371..35236c9 100644
> --- a/security_vulnerability_process.html
> +++ b/security_vulnerability_process.html
> @@ -194,16 +194,18 @@ if(ns4)_d.write("<scr"+"ipt type=text/javascript src=/globals/mmenuns4.js><\/scr
>      addresses (ideally, role addresses) of the security response teams for
>      significant Xen operators and distributors.</p>
>      <p>This includes:<ul>
> -      <li>Large-scale hosting providers;</li>
> +      <li>Public hosting providers;</li>
>        <li>Large-scale organisational users of Xen;</li>
>        <li>Vendors of widely-deployed Xen-based systems;</li>
>        <li>Distributors of widely-deployed operating systems with Xen support.</li>
>      </ul></p>
>      <p>This includes both corporations and community institutions.</p>    
> -    <p>Here as a rule of thumb "large scale" and "widely deployed" means an
> -    installed base of 300,000 or more Xen guests; other well-established
> -    organisations with a mature security response process will be considered on
> -    a case-by-case basis.</p>    
> +    <p>Here as a rule of thumb, "public hosting provider" means
> +    "selling virtualization services to the general public";
> +    "large-scale" and "widely deployed" means an installed base of
> +    300,000 or more Xen guests.  Other well-established organisations
> +    with a mature security response process will be considered on a
> +    case-by-case basis.</p>

I agree with Ian that relaxing this for software vendors also seems the
correct thing to do.

>      <p>The list of entities on the pre-disclosure list is public. (Just the list
>      of projects and organisations, not the actual email addresses.)</p>  
>      <p>If there is an embargo, the pre-disclosure list will receive
> @@ -229,8 +231,19 @@ if(ns4)_d.write("<scr"+"ipt type=text/javascript src=/globals/mmenuns4.js><\/scr
>         <li>The planned disclosure date</li>
>      </ul></p>
>  
> -    <p>Organisations who meet the criteria should contact security@xen if they wish to receive pre-disclosure of advisories. Organisations should not request subscription via the mailing list web interface, any such subscription requests will be rejected and ignored.</p>
> -    <p>Normally we would prefer that a role address be used for each organisation, rather than one or more individual's direct email address. This helps to ensure that changes of personnel do not end up effectively dropping an organisation from the list</p>
> +    <p>Organisations who meet the criteria should contact security@xen
> +      if they wish to receive pre-disclosure of advisories.  Please
> +      include in the e-mail: <ul>
> +	<li>The name of your organization</li>
> +	<li>A brief description of why you fit the criteria</li>
> +	<li>A security alias e-mail address (see below)</li>
> +	<li>A web page with your security policy statement</li>
> +	<li>If you are a public hosting provider, a web page with your public rates</li>

For the last two "a link to ...". Seems obvious but some people are very
literal ;-)

I think it would be good to also include something like:
                <li>A statement to the effect that you have read this
                policy and agree to abide by the terms for inclusion in
                the list, specifically the requirements to regarding
                confidentiality during an embargo period</li>

Or something like that.

I wonder if we shouldn't also include under the list of "pre-disclosure
list members should not make available," include "Failure to adhere to
this will be grounds for removal from the list".

I suppose then we need an appeals process though. How about
"Reinstatement will require a post to the xen-devel mailing list
explaining the procedures which have been put in place to prevent any
further breach of confidentiality" + a three strikes rule (any org who
managed so mess this up three times isn't likely to stay in business
long enough to require an appeals process against that ;-)).

Also, and I understand this is most likely taking things way too far, I
was wondering about requiring the request to be signed by a key which
itself has a signature from a key in the "strong
set" (http://pgp.cs.uu.nl/plot/) of PGP keys (implemented by me being
able to find a path from my key to it). This is just another hurdle
which serves to ensure that list members are in some sense legitimate.
(NB I'm not sure I buy this argument, surely there are corrupt types in
the strong set). This hurdle might be too big in practice? It doesn't
seem so to me but then I hang around with a lot of Debian types ;-)

What are we going to do for existing members? Ask them to requalify by
some deadline? I wouldn't normally bother but the statement about
agreeing to the confidentiality terms (if we do that) seems like a
worthwhile thing to require?

> +      </ul>
> +      Organisations should not request subscription via the mailing
> +      list web interface, any such subscription requests will be
> +      rejected and ignored.</p>
> +    <p>We prefer that a role address be used for each organisation, rather than one or more individual's direct email address. This helps to ensure that changes of personnel do not end up effectively dropping an organisation from the list</p>

Ack on /prefer/require/ suggestion.

>  
>      
>      <h3>Organizations on the pre-disclosure list:</h3>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 17:43:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 17:43:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaVMw-00009U-Sj; Mon, 19 Nov 2012 17:42:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaVMu-00009P-Vj
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 17:42:49 +0000
Received: from [85.158.137.99:24650] by server-2.bemta-3.messagelabs.com id
	2A/F3-04744-89F6AA05; Mon, 19 Nov 2012 17:42:48 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1353346966!16589315!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2910 invoked from network); 19 Nov 2012 17:42:46 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 17:42:46 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15887322"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 17:42:46 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 17:42:46 +0000
Message-ID: <1353346964.18229.151.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Mon, 19 Nov 2012 17:42:44 +0000
In-Reply-To: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
References: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] Make all public hosting providers
 eligible for the pre-disclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-15 at 17:14 +0000, George Dunlap wrote:
> As discussed on the xen-devel mailing list, allow any public hosting
> provider to join the pre-disclosure list:

Thanks for doing this.

> * Change "Large hosting providers" to "Public hosting providers"
> * Add rule of thumb for what "public hosting provider" means
> * Add an itemized list of information to be included in the application,
> to make expectations clear and (hopefully) applications more streamlined.
> 
> NOTE: This RFC is meant to be a way to start a discussion on the exact
> wording which will be voted on.  Once it has gone through review from
> the xen-devel mailing list, I will post an "RC" and announce it on the
> Xen blog, as well as on xen-users.  Once discussion seems to have
> converged, I will post a "FINAL" one, which I will put up for a vote.
> 
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
> ---
>  security_vulnerability_process.html |   27 ++++++++++++++++++++-------
>  1 file changed, 20 insertions(+), 7 deletions(-)
> 
> diff --git a/security_vulnerability_process.html b/security_vulnerability_process.html
> index e305371..35236c9 100644
> --- a/security_vulnerability_process.html
> +++ b/security_vulnerability_process.html
> @@ -194,16 +194,18 @@ if(ns4)_d.write("<scr"+"ipt type=text/javascript src=/globals/mmenuns4.js><\/scr
>      addresses (ideally, role addresses) of the security response teams for
>      significant Xen operators and distributors.</p>
>      <p>This includes:<ul>
> -      <li>Large-scale hosting providers;</li>
> +      <li>Public hosting providers;</li>
>        <li>Large-scale organisational users of Xen;</li>
>        <li>Vendors of widely-deployed Xen-based systems;</li>
>        <li>Distributors of widely-deployed operating systems with Xen support.</li>
>      </ul></p>
>      <p>This includes both corporations and community institutions.</p>    
> -    <p>Here as a rule of thumb "large scale" and "widely deployed" means an
> -    installed base of 300,000 or more Xen guests; other well-established
> -    organisations with a mature security response process will be considered on
> -    a case-by-case basis.</p>    
> +    <p>Here as a rule of thumb, "public hosting provider" means
> +    "selling virtualization services to the general public";
> +    "large-scale" and "widely deployed" means an installed base of
> +    300,000 or more Xen guests.  Other well-established organisations
> +    with a mature security response process will be considered on a
> +    case-by-case basis.</p>

I agree with Ian that relaxing this for software vendors also seems the
correct thing to do.

>      <p>The list of entities on the pre-disclosure list is public. (Just the list
>      of projects and organisations, not the actual email addresses.)</p>  
>      <p>If there is an embargo, the pre-disclosure list will receive
> @@ -229,8 +231,19 @@ if(ns4)_d.write("<scr"+"ipt type=text/javascript src=/globals/mmenuns4.js><\/scr
>         <li>The planned disclosure date</li>
>      </ul></p>
>  
> -    <p>Organisations who meet the criteria should contact security@xen if they wish to receive pre-disclosure of advisories. Organisations should not request subscription via the mailing list web interface, any such subscription requests will be rejected and ignored.</p>
> -    <p>Normally we would prefer that a role address be used for each organisation, rather than one or more individual's direct email address. This helps to ensure that changes of personnel do not end up effectively dropping an organisation from the list</p>
> +    <p>Organisations who meet the criteria should contact security@xen
> +      if they wish to receive pre-disclosure of advisories.  Please
> +      include in the e-mail: <ul>
> +	<li>The name of your organization</li>
> +	<li>A brief description of why you fit the criteria</li>
> +	<li>A security alias e-mail address (see below)</li>
> +	<li>A web page with your security policy statement</li>
> +	<li>If you are a public hosting provider, a web page with your public rates</li>

For the last two "a link to ...". Seems obvious but some people are very
literal ;-)

I think it would be good to also include something like:
                <li>A statement to the effect that you have read this
                policy and agree to abide by the terms for inclusion in
                the list, specifically the requirements to regarding
                confidentiality during an embargo period</li>

Or something like that.

I wonder if we shouldn't also include under the list of "pre-disclosure
list members should not make available," include "Failure to adhere to
this will be grounds for removal from the list".

I suppose then we need an appeals process though. How about
"Reinstatement will require a post to the xen-devel mailing list
explaining the procedures which have been put in place to prevent any
further breach of confidentiality" + a three strikes rule (any org who
managed so mess this up three times isn't likely to stay in business
long enough to require an appeals process against that ;-)).

Also, and I understand this is most likely taking things way too far, I
was wondering about requiring the request to be signed by a key which
itself has a signature from a key in the "strong
set" (http://pgp.cs.uu.nl/plot/) of PGP keys (implemented by me being
able to find a path from my key to it). This is just another hurdle
which serves to ensure that list members are in some sense legitimate.
(NB I'm not sure I buy this argument, surely there are corrupt types in
the strong set). This hurdle might be too big in practice? It doesn't
seem so to me but then I hang around with a lot of Debian types ;-)

What are we going to do for existing members? Ask them to requalify by
some deadline? I wouldn't normally bother but the statement about
agreeing to the confidentiality terms (if we do that) seems like a
worthwhile thing to require?

> +      </ul>
> +      Organisations should not request subscription via the mailing
> +      list web interface, any such subscription requests will be
> +      rejected and ignored.</p>
> +    <p>We prefer that a role address be used for each organisation, rather than one or more individual's direct email address. This helps to ensure that changes of personnel do not end up effectively dropping an organisation from the list</p>

Ack on /prefer/require/ suggestion.

>  
>      
>      <h3>Organizations on the pre-disclosure list:</h3>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 18:23:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 18:23:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaVzr-0000tv-Dz; Mon, 19 Nov 2012 18:23:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaVzp-0000tq-FN
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 18:23:01 +0000
Received: from [85.158.143.35:45580] by server-1.bemta-4.messagelabs.com id
	32/A5-27934-4097AA05; Mon, 19 Nov 2012 18:23:00 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1353349379!18342685!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19864 invoked from network); 19 Nov 2012 18:22:59 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 18:22:59 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15887993"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 18:22:56 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 18:22:56 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TaVzk-0001BT-EQ;
	Mon, 19 Nov 2012 18:22:56 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TaVzk-0006MI-B4;
	Mon, 19 Nov 2012 18:22:56 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14418-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 19 Nov 2012 18:22:56 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14418: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14418 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14418/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-win7-amd64 12 guest-localmigrate/x10  fail REGR. vs. 14416

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14416
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14416
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14416
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14416

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  9da9781cc3fb
baseline version:
 xen                  321f8487379b

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Wei Wang <wei.wang2@amd.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26162:9da9781cc3fb
tag:         tip
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 09:48:22 2012 +0100
    
    vscsiif: minor cleanup
    
    Remove a definition not belonging into the interface, and correct a
    few typos in comments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26161:9025a10c0561
user:        Wei Wang <wei.wang2@amd.com>
date:        Mon Nov 19 09:46:46 2012 +0100
    
    AMD IOMMU: Enable HPET broadcast msi remapping
    
    This patch enables hpet msi remapping for amd iommu.
    
    Signed-off-by: Wei Wang <wei.wang2@amd.com>
    
    - use the existing ACPI_IVHD_* #define-s
    - warn on finding more than one IVHD HPET entry
    - consolidate parameters of update_intremap_entry_from_msi_msg()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Committed-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26160:321f8487379b
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:29 2012 +0000
    
    xen/arm: wake up secondary cpus
    
    Secondary cpus are held by the firmware until we send an IPI to them.
    
    Reordered non-boot cpu wait loop to perform the check before waiting
    for an event, to handled the case where the event has already
    happened when we reach the loop.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 18:23:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 18:23:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaVzr-0000tv-Dz; Mon, 19 Nov 2012 18:23:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaVzp-0000tq-FN
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 18:23:01 +0000
Received: from [85.158.143.35:45580] by server-1.bemta-4.messagelabs.com id
	32/A5-27934-4097AA05; Mon, 19 Nov 2012 18:23:00 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1353349379!18342685!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19864 invoked from network); 19 Nov 2012 18:22:59 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 18:22:59 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15887993"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 18:22:56 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 18:22:56 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TaVzk-0001BT-EQ;
	Mon, 19 Nov 2012 18:22:56 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TaVzk-0006MI-B4;
	Mon, 19 Nov 2012 18:22:56 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14418-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 19 Nov 2012 18:22:56 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14418: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14418 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14418/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-win7-amd64 12 guest-localmigrate/x10  fail REGR. vs. 14416

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14416
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14416
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14416
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14416

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  9da9781cc3fb
baseline version:
 xen                  321f8487379b

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Wei Wang <wei.wang2@amd.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26162:9da9781cc3fb
tag:         tip
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 09:48:22 2012 +0100
    
    vscsiif: minor cleanup
    
    Remove a definition not belonging into the interface, and correct a
    few typos in comments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26161:9025a10c0561
user:        Wei Wang <wei.wang2@amd.com>
date:        Mon Nov 19 09:46:46 2012 +0100
    
    AMD IOMMU: Enable HPET broadcast msi remapping
    
    This patch enables hpet msi remapping for amd iommu.
    
    Signed-off-by: Wei Wang <wei.wang2@amd.com>
    
    - use the existing ACPI_IVHD_* #define-s
    - warn on finding more than one IVHD HPET entry
    - consolidate parameters of update_intremap_entry_from_msi_msg()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Committed-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26160:321f8487379b
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:29 2012 +0000
    
    xen/arm: wake up secondary cpus
    
    Secondary cpus are held by the firmware until we send an IPI to them.
    
    Reordered non-boot cpu wait loop to perform the check before waiting
    for an event, to handled the case where the event has already
    happened when we reach the loop.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 18:27:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 18:27:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaW4E-00010r-44; Mon, 19 Nov 2012 18:27:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <wfp5p@viridian.itc.virginia.edu>) id 1TaW4C-00010k-27
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 18:27:32 +0000
Received: from [85.158.139.83:55600] by server-3.bemta-5.messagelabs.com id
	3E/70-18736-31A7AA05; Mon, 19 Nov 2012 18:27:31 +0000
X-Env-Sender: wfp5p@viridian.itc.virginia.edu
X-Msg-Ref: server-13.tower-182.messagelabs.com!1353349649!30436132!1
X-Originating-IP: [128.143.12.139]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15143 invoked from network); 19 Nov 2012 18:27:29 -0000
Received: from viridian.itc.virginia.edu (HELO viridian.itc.virginia.edu)
	(128.143.12.139) by server-13.tower-182.messagelabs.com with SMTP;
	19 Nov 2012 18:27:29 -0000
Received: by viridian.itc.virginia.edu (Postfix, from userid 1249)
	id EE66680233; Mon, 19 Nov 2012 13:27:27 -0500 (EST)
From: Bill Pemberton <wfp5p@virginia.edu>
To: gregkh@linuxfoundation.org
Date: Mon, 19 Nov 2012 13:20:35 -0500
Message-Id: <1353349642-3677-86-git-send-email-wfp5p@virginia.edu>
X-Mailer: git-send-email 1.8.0
In-Reply-To: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
Cc: xen-devel@lists.xensource.com, "Michael S. Tsirkin" <mst@redhat.com>,
	"VMware, Inc." <pv-drivers@vmware.com>, netdev@vger.kernel.org,
	Rusty Russell <rusty@rustcorp.com.au>,
	Shreyas Bhatewara <sbhatewara@vmware.com>,
	virtualization@lists.linux-foundation.org,
	Francois Romieu <romieu@fr.zoreil.com>
Subject: [Xen-devel] [PATCH 086/493] net: remove use of __devexit_p
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Rusty Russell <rusty@rustcorp.com.au> 
Cc: "Michael S. Tsirkin" <mst@redhat.com> 
Cc: Shreyas Bhatewara <sbhatewara@vmware.com> 
Cc: "VMware, Inc." <pv-drivers@vmware.com> 
Cc: Francois Romieu <romieu@fr.zoreil.com> 
Cc: virtualization@lists.linux-foundation.org 
Cc: netdev@vger.kernel.org 
Cc: xen-devel@lists.xensource.com 
---
 drivers/net/virtio_net.c          | 2 +-
 drivers/net/vmxnet3/vmxnet3_drv.c | 2 +-
 drivers/net/wan/dscc4.c           | 2 +-
 drivers/net/wan/farsync.c         | 2 +-
 drivers/net/wan/lmc/lmc_main.c    | 2 +-
 drivers/net/xen-netfront.c        | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 97f4ff8..b0c1630 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1285,7 +1285,7 @@ static struct virtio_driver virtio_net_driver = {
 	.driver.owner =	THIS_MODULE,
 	.id_table =	id_table,
 	.probe =	virtnet_probe,
-	.remove =	__devexit_p(virtnet_remove),
+	.remove =	virtnet_remove,
 	.config_changed = virtnet_config_changed,
 #ifdef CONFIG_PM
 	.freeze =	virtnet_freeze,
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 7e9622f..aa1bde8 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -3302,7 +3302,7 @@ static struct pci_driver vmxnet3_driver = {
 	.name		= vmxnet3_driver_name,
 	.id_table	= vmxnet3_pciid_table,
 	.probe		= vmxnet3_probe_device,
-	.remove		= __devexit_p(vmxnet3_remove_device),
+	.remove		= vmxnet3_remove_device,
 #ifdef CONFIG_PM
 	.driver.pm	= &vmxnet3_pm_ops,
 #endif
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index ef36caf..2eddbbf 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -2053,7 +2053,7 @@ static struct pci_driver dscc4_driver = {
 	.name		= DRV_NAME,
 	.id_table	= dscc4_pci_tbl,
 	.probe		= dscc4_init_one,
-	.remove		= __devexit_p(dscc4_remove_one),
+	.remove		= dscc4_remove_one,
 };
 
 module_pci_driver(dscc4_driver);
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index b627132..0397544 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -2652,7 +2652,7 @@ static struct pci_driver fst_driver = {
         .name		= FST_NAME,
         .id_table	= fst_pci_dev_id,
         .probe		= fst_add_one,
-        .remove	= __devexit_p(fst_remove_one),
+	.remove		= fst_remove_one,
         .suspend	= NULL,
         .resume	= NULL,
 };
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index f5d533a..358e25f 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -1733,7 +1733,7 @@ static struct pci_driver lmc_driver = {
 	.name		= "lmc",
 	.id_table	= lmc_pci_tbl,
 	.probe		= lmc_init_one,
-	.remove		= __devexit_p(lmc_remove_one),
+	.remove		= lmc_remove_one,
 };
 
 module_pci_driver(lmc_driver);
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index caa0110..3c3b93e 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1934,7 +1934,7 @@ static int __devexit xennet_remove(struct xenbus_device *dev)
 
 static DEFINE_XENBUS_DRIVER(netfront, ,
 	.probe = netfront_probe,
-	.remove = __devexit_p(xennet_remove),
+	.remove = xennet_remove,
 	.resume = netfront_resume,
 	.otherend_changed = netback_changed,
 );
-- 
1.8.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 18:27:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 18:27:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaW4E-00010r-44; Mon, 19 Nov 2012 18:27:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <wfp5p@viridian.itc.virginia.edu>) id 1TaW4C-00010k-27
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 18:27:32 +0000
Received: from [85.158.139.83:55600] by server-3.bemta-5.messagelabs.com id
	3E/70-18736-31A7AA05; Mon, 19 Nov 2012 18:27:31 +0000
X-Env-Sender: wfp5p@viridian.itc.virginia.edu
X-Msg-Ref: server-13.tower-182.messagelabs.com!1353349649!30436132!1
X-Originating-IP: [128.143.12.139]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15143 invoked from network); 19 Nov 2012 18:27:29 -0000
Received: from viridian.itc.virginia.edu (HELO viridian.itc.virginia.edu)
	(128.143.12.139) by server-13.tower-182.messagelabs.com with SMTP;
	19 Nov 2012 18:27:29 -0000
Received: by viridian.itc.virginia.edu (Postfix, from userid 1249)
	id EE66680233; Mon, 19 Nov 2012 13:27:27 -0500 (EST)
From: Bill Pemberton <wfp5p@virginia.edu>
To: gregkh@linuxfoundation.org
Date: Mon, 19 Nov 2012 13:20:35 -0500
Message-Id: <1353349642-3677-86-git-send-email-wfp5p@virginia.edu>
X-Mailer: git-send-email 1.8.0
In-Reply-To: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
Cc: xen-devel@lists.xensource.com, "Michael S. Tsirkin" <mst@redhat.com>,
	"VMware, Inc." <pv-drivers@vmware.com>, netdev@vger.kernel.org,
	Rusty Russell <rusty@rustcorp.com.au>,
	Shreyas Bhatewara <sbhatewara@vmware.com>,
	virtualization@lists.linux-foundation.org,
	Francois Romieu <romieu@fr.zoreil.com>
Subject: [Xen-devel] [PATCH 086/493] net: remove use of __devexit_p
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Rusty Russell <rusty@rustcorp.com.au> 
Cc: "Michael S. Tsirkin" <mst@redhat.com> 
Cc: Shreyas Bhatewara <sbhatewara@vmware.com> 
Cc: "VMware, Inc." <pv-drivers@vmware.com> 
Cc: Francois Romieu <romieu@fr.zoreil.com> 
Cc: virtualization@lists.linux-foundation.org 
Cc: netdev@vger.kernel.org 
Cc: xen-devel@lists.xensource.com 
---
 drivers/net/virtio_net.c          | 2 +-
 drivers/net/vmxnet3/vmxnet3_drv.c | 2 +-
 drivers/net/wan/dscc4.c           | 2 +-
 drivers/net/wan/farsync.c         | 2 +-
 drivers/net/wan/lmc/lmc_main.c    | 2 +-
 drivers/net/xen-netfront.c        | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 97f4ff8..b0c1630 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1285,7 +1285,7 @@ static struct virtio_driver virtio_net_driver = {
 	.driver.owner =	THIS_MODULE,
 	.id_table =	id_table,
 	.probe =	virtnet_probe,
-	.remove =	__devexit_p(virtnet_remove),
+	.remove =	virtnet_remove,
 	.config_changed = virtnet_config_changed,
 #ifdef CONFIG_PM
 	.freeze =	virtnet_freeze,
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 7e9622f..aa1bde8 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -3302,7 +3302,7 @@ static struct pci_driver vmxnet3_driver = {
 	.name		= vmxnet3_driver_name,
 	.id_table	= vmxnet3_pciid_table,
 	.probe		= vmxnet3_probe_device,
-	.remove		= __devexit_p(vmxnet3_remove_device),
+	.remove		= vmxnet3_remove_device,
 #ifdef CONFIG_PM
 	.driver.pm	= &vmxnet3_pm_ops,
 #endif
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index ef36caf..2eddbbf 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -2053,7 +2053,7 @@ static struct pci_driver dscc4_driver = {
 	.name		= DRV_NAME,
 	.id_table	= dscc4_pci_tbl,
 	.probe		= dscc4_init_one,
-	.remove		= __devexit_p(dscc4_remove_one),
+	.remove		= dscc4_remove_one,
 };
 
 module_pci_driver(dscc4_driver);
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index b627132..0397544 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -2652,7 +2652,7 @@ static struct pci_driver fst_driver = {
         .name		= FST_NAME,
         .id_table	= fst_pci_dev_id,
         .probe		= fst_add_one,
-        .remove	= __devexit_p(fst_remove_one),
+	.remove		= fst_remove_one,
         .suspend	= NULL,
         .resume	= NULL,
 };
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index f5d533a..358e25f 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -1733,7 +1733,7 @@ static struct pci_driver lmc_driver = {
 	.name		= "lmc",
 	.id_table	= lmc_pci_tbl,
 	.probe		= lmc_init_one,
-	.remove		= __devexit_p(lmc_remove_one),
+	.remove		= lmc_remove_one,
 };
 
 module_pci_driver(lmc_driver);
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index caa0110..3c3b93e 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1934,7 +1934,7 @@ static int __devexit xennet_remove(struct xenbus_device *dev)
 
 static DEFINE_XENBUS_DRIVER(netfront, ,
 	.probe = netfront_probe,
-	.remove = __devexit_p(xennet_remove),
+	.remove = xennet_remove,
 	.resume = netfront_resume,
 	.otherend_changed = netback_changed,
 );
-- 
1.8.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 18:28:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 18:28:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaW4M-00011P-GI; Mon, 19 Nov 2012 18:27:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <wfp5p@viridian.itc.virginia.edu>) id 1TaW4L-00011C-3n
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 18:27:41 +0000
Received: from [85.158.143.35:18022] by server-3.bemta-4.messagelabs.com id
	BA/83-06841-C1A7AA05; Mon, 19 Nov 2012 18:27:40 +0000
X-Env-Sender: wfp5p@viridian.itc.virginia.edu
X-Msg-Ref: server-14.tower-21.messagelabs.com!1353349659!18401567!1
X-Originating-IP: [128.143.12.139]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24797 invoked from network); 19 Nov 2012 18:27:39 -0000
Received: from viridian.itc.virginia.edu (HELO viridian.itc.virginia.edu)
	(128.143.12.139) by server-14.tower-21.messagelabs.com with SMTP;
	19 Nov 2012 18:27:39 -0000
Received: by viridian.itc.virginia.edu (Postfix, from userid 1249)
	id E953B802E4; Mon, 19 Nov 2012 13:27:31 -0500 (EST)
From: Bill Pemberton <wfp5p@virginia.edu>
To: gregkh@linuxfoundation.org
Date: Mon, 19 Nov 2012 13:21:42 -0500
Message-Id: <1353349642-3677-153-git-send-email-wfp5p@virginia.edu>
X-Mailer: git-send-email 1.8.0
In-Reply-To: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
Cc: xen-devel@lists.xensource.com, virtualization@lists.linux-foundation.org
Subject: [Xen-devel] [PATCH 153/493] xen: remove use of __devinit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: xen-devel@lists.xensource.com 
Cc: virtualization@lists.linux-foundation.org 
---
 drivers/xen/grant-table.c          |  2 +-
 drivers/xen/platform-pci.c         |  2 +-
 drivers/xen/xen-pciback/pci_stub.c | 10 +++++-----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index 043bf07..a4982a3 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -1205,7 +1205,7 @@ int gnttab_init(void)
 }
 EXPORT_SYMBOL_GPL(gnttab_init);
 
-static int __devinit __gnttab_init(void)
+static int __gnttab_init(void)
 {
 	/* Delay grant-table initialization in the PV on HVM case */
 	if (xen_hvm_domain())
diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
index 97ca359..017f66d 100644
--- a/drivers/xen/platform-pci.c
+++ b/drivers/xen/platform-pci.c
@@ -101,7 +101,7 @@ static int platform_pci_resume(struct pci_dev *pdev)
 	return 0;
 }
 
-static int __devinit platform_pci_init(struct pci_dev *pdev,
+static int platform_pci_init(struct pci_dev *pdev,
 				       const struct pci_device_id *ent)
 {
 	int i, ret;
diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
index 961d664..4ac9da7 100644
--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -270,7 +270,7 @@ void pcistub_put_pci_dev(struct pci_dev *dev)
 	up_write(&pcistub_sem);
 }
 
-static int __devinit pcistub_match_one(struct pci_dev *dev,
+static int pcistub_match_one(struct pci_dev *dev,
 				       struct pcistub_device_id *pdev_id)
 {
 	/* Match the specified device by domain, bus, slot, func and also if
@@ -290,7 +290,7 @@ static int __devinit pcistub_match_one(struct pci_dev *dev,
 	return 0;
 }
 
-static int __devinit pcistub_match(struct pci_dev *dev)
+static int pcistub_match(struct pci_dev *dev)
 {
 	struct pcistub_device_id *pdev_id;
 	unsigned long flags;
@@ -308,7 +308,7 @@ static int __devinit pcistub_match(struct pci_dev *dev)
 	return found;
 }
 
-static int __devinit pcistub_init_device(struct pci_dev *dev)
+static int pcistub_init_device(struct pci_dev *dev)
 {
 	struct xen_pcibk_dev_data *dev_data;
 	int err = 0;
@@ -426,7 +426,7 @@ static int __init pcistub_init_devices_late(void)
 	return 0;
 }
 
-static int __devinit pcistub_seize(struct pci_dev *dev)
+static int pcistub_seize(struct pci_dev *dev)
 {
 	struct pcistub_device *psdev;
 	unsigned long flags;
@@ -461,7 +461,7 @@ static int __devinit pcistub_seize(struct pci_dev *dev)
 	return err;
 }
 
-static int __devinit pcistub_probe(struct pci_dev *dev,
+static int pcistub_probe(struct pci_dev *dev,
 				   const struct pci_device_id *id)
 {
 	int err = 0;
-- 
1.8.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 18:28:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 18:28:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaW4M-00011P-GI; Mon, 19 Nov 2012 18:27:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <wfp5p@viridian.itc.virginia.edu>) id 1TaW4L-00011C-3n
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 18:27:41 +0000
Received: from [85.158.143.35:18022] by server-3.bemta-4.messagelabs.com id
	BA/83-06841-C1A7AA05; Mon, 19 Nov 2012 18:27:40 +0000
X-Env-Sender: wfp5p@viridian.itc.virginia.edu
X-Msg-Ref: server-14.tower-21.messagelabs.com!1353349659!18401567!1
X-Originating-IP: [128.143.12.139]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24797 invoked from network); 19 Nov 2012 18:27:39 -0000
Received: from viridian.itc.virginia.edu (HELO viridian.itc.virginia.edu)
	(128.143.12.139) by server-14.tower-21.messagelabs.com with SMTP;
	19 Nov 2012 18:27:39 -0000
Received: by viridian.itc.virginia.edu (Postfix, from userid 1249)
	id E953B802E4; Mon, 19 Nov 2012 13:27:31 -0500 (EST)
From: Bill Pemberton <wfp5p@virginia.edu>
To: gregkh@linuxfoundation.org
Date: Mon, 19 Nov 2012 13:21:42 -0500
Message-Id: <1353349642-3677-153-git-send-email-wfp5p@virginia.edu>
X-Mailer: git-send-email 1.8.0
In-Reply-To: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
Cc: xen-devel@lists.xensource.com, virtualization@lists.linux-foundation.org
Subject: [Xen-devel] [PATCH 153/493] xen: remove use of __devinit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: xen-devel@lists.xensource.com 
Cc: virtualization@lists.linux-foundation.org 
---
 drivers/xen/grant-table.c          |  2 +-
 drivers/xen/platform-pci.c         |  2 +-
 drivers/xen/xen-pciback/pci_stub.c | 10 +++++-----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index 043bf07..a4982a3 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -1205,7 +1205,7 @@ int gnttab_init(void)
 }
 EXPORT_SYMBOL_GPL(gnttab_init);
 
-static int __devinit __gnttab_init(void)
+static int __gnttab_init(void)
 {
 	/* Delay grant-table initialization in the PV on HVM case */
 	if (xen_hvm_domain())
diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
index 97ca359..017f66d 100644
--- a/drivers/xen/platform-pci.c
+++ b/drivers/xen/platform-pci.c
@@ -101,7 +101,7 @@ static int platform_pci_resume(struct pci_dev *pdev)
 	return 0;
 }
 
-static int __devinit platform_pci_init(struct pci_dev *pdev,
+static int platform_pci_init(struct pci_dev *pdev,
 				       const struct pci_device_id *ent)
 {
 	int i, ret;
diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
index 961d664..4ac9da7 100644
--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -270,7 +270,7 @@ void pcistub_put_pci_dev(struct pci_dev *dev)
 	up_write(&pcistub_sem);
 }
 
-static int __devinit pcistub_match_one(struct pci_dev *dev,
+static int pcistub_match_one(struct pci_dev *dev,
 				       struct pcistub_device_id *pdev_id)
 {
 	/* Match the specified device by domain, bus, slot, func and also if
@@ -290,7 +290,7 @@ static int __devinit pcistub_match_one(struct pci_dev *dev,
 	return 0;
 }
 
-static int __devinit pcistub_match(struct pci_dev *dev)
+static int pcistub_match(struct pci_dev *dev)
 {
 	struct pcistub_device_id *pdev_id;
 	unsigned long flags;
@@ -308,7 +308,7 @@ static int __devinit pcistub_match(struct pci_dev *dev)
 	return found;
 }
 
-static int __devinit pcistub_init_device(struct pci_dev *dev)
+static int pcistub_init_device(struct pci_dev *dev)
 {
 	struct xen_pcibk_dev_data *dev_data;
 	int err = 0;
@@ -426,7 +426,7 @@ static int __init pcistub_init_devices_late(void)
 	return 0;
 }
 
-static int __devinit pcistub_seize(struct pci_dev *dev)
+static int pcistub_seize(struct pci_dev *dev)
 {
 	struct pcistub_device *psdev;
 	unsigned long flags;
@@ -461,7 +461,7 @@ static int __devinit pcistub_seize(struct pci_dev *dev)
 	return err;
 }
 
-static int __devinit pcistub_probe(struct pci_dev *dev,
+static int pcistub_probe(struct pci_dev *dev,
 				   const struct pci_device_id *id)
 {
 	int err = 0;
-- 
1.8.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 18:28:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 18:28:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaW4a-00013O-TC; Mon, 19 Nov 2012 18:27:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <wfp5p@viridian.itc.virginia.edu>) id 1TaW4Y-00012i-Sm
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 18:27:55 +0000
Received: from [85.158.139.211:16811] by server-9.bemta-5.messagelabs.com id
	40/77-29295-A2A7AA05; Mon, 19 Nov 2012 18:27:54 +0000
X-Env-Sender: wfp5p@viridian.itc.virginia.edu
X-Msg-Ref: server-7.tower-206.messagelabs.com!1353349671!20350409!1
X-Originating-IP: [128.143.12.139]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23984 invoked from network); 19 Nov 2012 18:27:51 -0000
Received: from viridian.itc.virginia.edu (HELO viridian.itc.virginia.edu)
	(128.143.12.139) by server-7.tower-206.messagelabs.com with SMTP;
	19 Nov 2012 18:27:51 -0000
Received: by viridian.itc.virginia.edu (Postfix, from userid 1249)
	id E201B80346; Mon, 19 Nov 2012 13:27:34 -0500 (EST)
From: Bill Pemberton <wfp5p@virginia.edu>
To: gregkh@linuxfoundation.org
Date: Mon, 19 Nov 2012 13:22:32 -0500
Message-Id: <1353349642-3677-203-git-send-email-wfp5p@virginia.edu>
X-Mailer: git-send-email 1.8.0
In-Reply-To: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
Cc: Jes Sorensen <jes@trained-monkey.org>, xen-devel@lists.xensource.com,
	"VMware, Inc." <pv-drivers@vmware.com>, netdev@vger.kernel.org,
	Shreyas Bhatewara <sbhatewara@vmware.com>,
	virtualization@lists.linux-foundation.org, linux-hippi@sunsite.dk,
	"Maciej W. Rozycki" <macro@linux-mips.org>,
	Francois Romieu <romieu@fr.zoreil.com>, Krzysztof Halasa <khc@pm.waw.pl>
Subject: [Xen-devel] [PATCH 203/493] net: remove use of __devinit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: "Maciej W. Rozycki" <macro@linux-mips.org> 
Cc: Jes Sorensen <jes@trained-monkey.org> 
Cc: Shreyas Bhatewara <sbhatewara@vmware.com> 
Cc: "VMware, Inc." <pv-drivers@vmware.com> 
Cc: Francois Romieu <romieu@fr.zoreil.com> 
Cc: Krzysztof Halasa <khc@pm.waw.pl> 
Cc: netdev@vger.kernel.org 
Cc: linux-hippi@sunsite.dk 
Cc: xen-devel@lists.xensource.com 
Cc: virtualization@lists.linux-foundation.org 
---
 drivers/net/arcnet/com20020-pci.c  |  2 +-
 drivers/net/fddi/defxx.c           | 18 +++++++++---------
 drivers/net/hippi/rrunner.c        |  4 ++--
 drivers/net/ieee802154/at86rf230.c |  2 +-
 drivers/net/ieee802154/fakehard.c  |  2 +-
 drivers/net/ieee802154/fakelb.c    |  2 +-
 drivers/net/ieee802154/mrf24j40.c  |  2 +-
 drivers/net/vmxnet3/vmxnet3_drv.c  |  2 +-
 drivers/net/wan/dscc4.c            |  2 +-
 drivers/net/wan/farsync.c          |  4 ++--
 drivers/net/wan/hd64570.c          |  4 ++--
 drivers/net/wan/hd64572.c          |  4 ++--
 drivers/net/wan/ixp4xx_hss.c       |  2 +-
 drivers/net/wan/lmc/lmc_main.c     |  2 +-
 drivers/net/wan/pc300too.c         |  2 +-
 drivers/net/wan/pci200syn.c        |  2 +-
 drivers/net/wan/wanxl.c            |  2 +-
 drivers/net/xen-netfront.c         |  4 ++--
 18 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
index dcedba8..e80f04b 100644
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -61,7 +61,7 @@ module_param(clockp, int, 0);
 module_param(clockm, int, 0);
 MODULE_LICENSE("GPL");
 
-static int __devinit com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+static int com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
 	struct net_device *dev;
 	struct arcnet_local *lp;
diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c
index 538f8bb..13f42cc 100644
--- a/drivers/net/fddi/defxx.c
+++ b/drivers/net/fddi/defxx.c
@@ -515,7 +515,7 @@ static const struct net_device_ops dfx_netdev_ops = {
  *   initialized and the board resources are read and stored in
  *   the device structure.
  */
-static int __devinit dfx_register(struct device *bdev)
+static int dfx_register(struct device *bdev)
 {
 	static int version_disp;
 	int dfx_bus_pci = DFX_BUS_PCI(bdev);
@@ -663,7 +663,7 @@ err_out:
  *   enabled yet.
  */
 
-static void __devinit dfx_bus_init(struct net_device *dev)
+static void dfx_bus_init(struct net_device *dev)
 {
 	DFX_board_t *bp = netdev_priv(dev);
 	struct device *bdev = bp->bus_dev;
@@ -866,7 +866,7 @@ static void __devexit dfx_bus_uninit(struct net_device *dev)
  *   None
  */
 
-static void __devinit dfx_bus_config_check(DFX_board_t *bp)
+static void dfx_bus_config_check(DFX_board_t *bp)
 {
 	struct device __maybe_unused *bdev = bp->bus_dev;
 	int dfx_bus_eisa = DFX_BUS_EISA(bdev);
@@ -962,7 +962,7 @@ static void __devinit dfx_bus_config_check(DFX_board_t *bp)
  *   returning from this routine.
  */
 
-static int __devinit dfx_driver_init(struct net_device *dev,
+static int dfx_driver_init(struct net_device *dev,
 				     const char *print_name,
 				     resource_size_t bar_start)
 {
@@ -3619,11 +3619,11 @@ static void __devexit dfx_unregister(struct device *bdev)
 }
 
 
-static int __devinit __maybe_unused dfx_dev_register(struct device *);
+static int __maybe_unused dfx_dev_register(struct device *);
 static int __devexit __maybe_unused dfx_dev_unregister(struct device *);
 
 #ifdef CONFIG_PCI
-static int __devinit dfx_pci_register(struct pci_dev *,
+static int dfx_pci_register(struct pci_dev *,
 				      const struct pci_device_id *);
 static void __devexit dfx_pci_unregister(struct pci_dev *);
 
@@ -3640,7 +3640,7 @@ static struct pci_driver dfx_pci_driver = {
 	.remove		= dfx_pci_unregister,
 };
 
-static __devinit int dfx_pci_register(struct pci_dev *pdev,
+static int dfx_pci_register(struct pci_dev *pdev,
 				      const struct pci_device_id *ent)
 {
 	return dfx_register(&pdev->dev);
@@ -3694,7 +3694,7 @@ static struct tc_driver dfx_tc_driver = {
 };
 #endif /* CONFIG_TC */
 
-static int __devinit __maybe_unused dfx_dev_register(struct device *dev)
+static int __maybe_unused dfx_dev_register(struct device *dev)
 {
 	int status;
 
@@ -3712,7 +3712,7 @@ static int __devexit __maybe_unused dfx_dev_unregister(struct device *dev)
 }
 
 
-static int __devinit dfx_init(void)
+static int dfx_init(void)
 {
 	int status;
 
diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c
index 4802b46..164d845 100644
--- a/drivers/net/hippi/rrunner.c
+++ b/drivers/net/hippi/rrunner.c
@@ -88,7 +88,7 @@ static const struct net_device_ops rr_netdev_ops = {
  * stack will need to know about I/O vectors or something similar.
  */
 
-static int __devinit rr_init_one(struct pci_dev *pdev,
+static int rr_init_one(struct pci_dev *pdev,
 	const struct pci_device_id *ent)
 {
 	struct net_device *dev;
@@ -503,7 +503,7 @@ static unsigned int write_eeprom(struct rr_private *rrpriv,
 }
 
 
-static int __devinit rr_init(struct net_device *dev)
+static int rr_init(struct net_device *dev)
 {
 	struct rr_private *rrpriv;
 	struct rr_regs __iomem *regs;
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index cbb08de..1198c6b 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -778,7 +778,7 @@ static int at86rf230_fill_data(struct spi_device *spi)
 	return 0;
 }
 
-static int __devinit at86rf230_probe(struct spi_device *spi)
+static int at86rf230_probe(struct spi_device *spi)
 {
 	struct ieee802154_dev *dev;
 	struct at86rf230_local *lp;
diff --git a/drivers/net/ieee802154/fakehard.c b/drivers/net/ieee802154/fakehard.c
index 8c719e0..fd0438c 100644
--- a/drivers/net/ieee802154/fakehard.c
+++ b/drivers/net/ieee802154/fakehard.c
@@ -354,7 +354,7 @@ static void ieee802154_fake_setup(struct net_device *dev)
 }
 
 
-static int __devinit ieee802154fake_probe(struct platform_device *pdev)
+static int ieee802154fake_probe(struct platform_device *pdev)
 {
 	struct net_device *dev;
 	struct fakehard_priv *priv;
diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c
index 2d2e027..e4b0e38 100644
--- a/drivers/net/ieee802154/fakelb.c
+++ b/drivers/net/ieee802154/fakelb.c
@@ -221,7 +221,7 @@ static void fakelb_del(struct fakelb_dev_priv *priv)
 	ieee802154_free_device(priv->dev);
 }
 
-static int __devinit fakelb_probe(struct platform_device *pdev)
+static int fakelb_probe(struct platform_device *pdev)
 {
 	struct fakelb_priv *priv;
 	struct fakelb_dev_priv *dp;
diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
index 90b5467..ef41051 100644
--- a/drivers/net/ieee802154/mrf24j40.c
+++ b/drivers/net/ieee802154/mrf24j40.c
@@ -618,7 +618,7 @@ out:
 	enable_irq(devrec->spi->irq);
 }
 
-static int __devinit mrf24j40_probe(struct spi_device *spi)
+static int mrf24j40_probe(struct spi_device *spi)
 {
 	int ret = -ENOMEM;
 	u8 val;
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index aa1bde8..ac322e5 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -2885,7 +2885,7 @@ vmxnet3_reset_work(struct work_struct *data)
 }
 
 
-static int __devinit
+static int
 vmxnet3_probe_device(struct pci_dev *pdev,
 		     const struct pci_device_id *id)
 {
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index 2eddbbf..863df17 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -707,7 +707,7 @@ static void dscc4_free1(struct pci_dev *pdev)
 	kfree(ppriv);
 }
 
-static int __devinit dscc4_init_one(struct pci_dev *pdev,
+static int dscc4_init_one(struct pci_dev *pdev,
 				  const struct pci_device_id *ent)
 {
 	struct dscc4_pci_priv *priv;
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index 0397544..dc529aa 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -2371,7 +2371,7 @@ static char *type_strings[] __devinitdata = {
 	"FarSync TE1"
 };
 
-static void __devinit
+static void
 fst_init_card(struct fst_card_info *card)
 {
 	int i;
@@ -2415,7 +2415,7 @@ static const struct net_device_ops fst_ops = {
  *      Initialise card when detected.
  *      Returns 0 to indicate success, or errno otherwise.
  */
-static int __devinit
+static int
 fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	static int no_of_cards_added = 0;
diff --git a/drivers/net/wan/hd64570.c b/drivers/net/wan/hd64570.c
index cf49033..c6e1a4b 100644
--- a/drivers/net/wan/hd64570.c
+++ b/drivers/net/wan/hd64570.c
@@ -676,7 +676,7 @@ static netdev_tx_t sca_xmit(struct sk_buff *skb, struct net_device *dev)
 
 
 #ifdef NEED_DETECT_RAM
-static u32 __devinit sca_detect_ram(card_t *card, u8 __iomem *rambase,
+static u32 sca_detect_ram(card_t *card, u8 __iomem *rambase,
 				    u32 ramsize)
 {
 	/* Round RAM size to 32 bits, fill from end to start */
@@ -705,7 +705,7 @@ static u32 __devinit sca_detect_ram(card_t *card, u8 __iomem *rambase,
 #endif /* NEED_DETECT_RAM */
 
 
-static void __devinit sca_init(card_t *card, int wait_states)
+static void sca_init(card_t *card, int wait_states)
 {
 	sca_out(wait_states, WCRL, card); /* Wait Control */
 	sca_out(wait_states, WCRM, card);
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c
index e2779fa..f1685d9 100644
--- a/drivers/net/wan/hd64572.c
+++ b/drivers/net/wan/hd64572.c
@@ -605,7 +605,7 @@ static netdev_tx_t sca_xmit(struct sk_buff *skb, struct net_device *dev)
 }
 
 
-static u32 __devinit sca_detect_ram(card_t *card, u8 __iomem *rambase,
+static u32 sca_detect_ram(card_t *card, u8 __iomem *rambase,
 				    u32 ramsize)
 {
 	/* Round RAM size to 32 bits, fill from end to start */
@@ -625,7 +625,7 @@ static u32 __devinit sca_detect_ram(card_t *card, u8 __iomem *rambase,
 }
 
 
-static void __devinit sca_init(card_t *card, int wait_states)
+static void sca_init(card_t *card, int wait_states)
 {
 	sca_out(wait_states, WCRL, card); /* Wait Control */
 	sca_out(wait_states, WCRM, card);
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
index 0fe36d7..beecbe8 100644
--- a/drivers/net/wan/ixp4xx_hss.c
+++ b/drivers/net/wan/ixp4xx_hss.c
@@ -1324,7 +1324,7 @@ static const struct net_device_ops hss_hdlc_ops = {
 	.ndo_do_ioctl   = hss_hdlc_ioctl,
 };
 
-static int __devinit hss_init_one(struct platform_device *pdev)
+static int hss_init_one(struct platform_device *pdev)
 {
 	struct port *port;
 	struct net_device *dev;
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index 358e25f..41a401a 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -816,7 +816,7 @@ static const struct net_device_ops lmc_ops = {
 	.ndo_get_stats  = lmc_get_stats,
 };
 
-static int __devinit lmc_init_one(struct pci_dev *pdev,
+static int lmc_init_one(struct pci_dev *pdev,
 				  const struct pci_device_id *ent)
 {
 	lmc_softc_t *sc;
diff --git a/drivers/net/wan/pc300too.c b/drivers/net/wan/pc300too.c
index 5fe246e..a51cfa7 100644
--- a/drivers/net/wan/pc300too.c
+++ b/drivers/net/wan/pc300too.c
@@ -297,7 +297,7 @@ static const struct net_device_ops pc300_ops = {
 	.ndo_do_ioctl   = pc300_ioctl,
 };
 
-static int __devinit pc300_pci_init_one(struct pci_dev *pdev,
+static int pc300_pci_init_one(struct pci_dev *pdev,
 					const struct pci_device_id *ent)
 {
 	card_t *card;
diff --git a/drivers/net/wan/pci200syn.c b/drivers/net/wan/pci200syn.c
index 9659fca..037c423 100644
--- a/drivers/net/wan/pci200syn.c
+++ b/drivers/net/wan/pci200syn.c
@@ -276,7 +276,7 @@ static const struct net_device_ops pci200_ops = {
 	.ndo_do_ioctl   = pci200_ioctl,
 };
 
-static int __devinit pci200_pci_init_one(struct pci_dev *pdev,
+static int pci200_pci_init_one(struct pci_dev *pdev,
 					 const struct pci_device_id *ent)
 {
 	card_t *card;
diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c
index feb7541..b72be12 100644
--- a/drivers/net/wan/wanxl.c
+++ b/drivers/net/wan/wanxl.c
@@ -557,7 +557,7 @@ static const struct net_device_ops wanxl_ops = {
 	.ndo_get_stats  = wanxl_get_stats,
 };
 
-static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
+static int wanxl_pci_init_one(struct pci_dev *pdev,
 					const struct pci_device_id *ent)
 {
 	card_t *card;
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 3c3b93e..6f695fc 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1255,7 +1255,7 @@ static const struct net_device_ops xennet_netdev_ops = {
 #endif
 };
 
-static struct net_device * __devinit xennet_create_dev(struct xenbus_device *dev)
+static struct net_device *xennet_create_dev(struct xenbus_device *dev)
 {
 	int i, err;
 	struct net_device *netdev;
@@ -1351,7 +1351,7 @@ static struct net_device * __devinit xennet_create_dev(struct xenbus_device *dev
  * structures and the ring buffers for communication with the backend, and
  * inform the backend of the appropriate details for those.
  */
-static int __devinit netfront_probe(struct xenbus_device *dev,
+static int netfront_probe(struct xenbus_device *dev,
 				    const struct xenbus_device_id *id)
 {
 	int err;
-- 
1.8.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 18:28:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 18:28:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaW4a-00013O-TC; Mon, 19 Nov 2012 18:27:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <wfp5p@viridian.itc.virginia.edu>) id 1TaW4Y-00012i-Sm
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 18:27:55 +0000
Received: from [85.158.139.211:16811] by server-9.bemta-5.messagelabs.com id
	40/77-29295-A2A7AA05; Mon, 19 Nov 2012 18:27:54 +0000
X-Env-Sender: wfp5p@viridian.itc.virginia.edu
X-Msg-Ref: server-7.tower-206.messagelabs.com!1353349671!20350409!1
X-Originating-IP: [128.143.12.139]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23984 invoked from network); 19 Nov 2012 18:27:51 -0000
Received: from viridian.itc.virginia.edu (HELO viridian.itc.virginia.edu)
	(128.143.12.139) by server-7.tower-206.messagelabs.com with SMTP;
	19 Nov 2012 18:27:51 -0000
Received: by viridian.itc.virginia.edu (Postfix, from userid 1249)
	id E201B80346; Mon, 19 Nov 2012 13:27:34 -0500 (EST)
From: Bill Pemberton <wfp5p@virginia.edu>
To: gregkh@linuxfoundation.org
Date: Mon, 19 Nov 2012 13:22:32 -0500
Message-Id: <1353349642-3677-203-git-send-email-wfp5p@virginia.edu>
X-Mailer: git-send-email 1.8.0
In-Reply-To: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
Cc: Jes Sorensen <jes@trained-monkey.org>, xen-devel@lists.xensource.com,
	"VMware, Inc." <pv-drivers@vmware.com>, netdev@vger.kernel.org,
	Shreyas Bhatewara <sbhatewara@vmware.com>,
	virtualization@lists.linux-foundation.org, linux-hippi@sunsite.dk,
	"Maciej W. Rozycki" <macro@linux-mips.org>,
	Francois Romieu <romieu@fr.zoreil.com>, Krzysztof Halasa <khc@pm.waw.pl>
Subject: [Xen-devel] [PATCH 203/493] net: remove use of __devinit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: "Maciej W. Rozycki" <macro@linux-mips.org> 
Cc: Jes Sorensen <jes@trained-monkey.org> 
Cc: Shreyas Bhatewara <sbhatewara@vmware.com> 
Cc: "VMware, Inc." <pv-drivers@vmware.com> 
Cc: Francois Romieu <romieu@fr.zoreil.com> 
Cc: Krzysztof Halasa <khc@pm.waw.pl> 
Cc: netdev@vger.kernel.org 
Cc: linux-hippi@sunsite.dk 
Cc: xen-devel@lists.xensource.com 
Cc: virtualization@lists.linux-foundation.org 
---
 drivers/net/arcnet/com20020-pci.c  |  2 +-
 drivers/net/fddi/defxx.c           | 18 +++++++++---------
 drivers/net/hippi/rrunner.c        |  4 ++--
 drivers/net/ieee802154/at86rf230.c |  2 +-
 drivers/net/ieee802154/fakehard.c  |  2 +-
 drivers/net/ieee802154/fakelb.c    |  2 +-
 drivers/net/ieee802154/mrf24j40.c  |  2 +-
 drivers/net/vmxnet3/vmxnet3_drv.c  |  2 +-
 drivers/net/wan/dscc4.c            |  2 +-
 drivers/net/wan/farsync.c          |  4 ++--
 drivers/net/wan/hd64570.c          |  4 ++--
 drivers/net/wan/hd64572.c          |  4 ++--
 drivers/net/wan/ixp4xx_hss.c       |  2 +-
 drivers/net/wan/lmc/lmc_main.c     |  2 +-
 drivers/net/wan/pc300too.c         |  2 +-
 drivers/net/wan/pci200syn.c        |  2 +-
 drivers/net/wan/wanxl.c            |  2 +-
 drivers/net/xen-netfront.c         |  4 ++--
 18 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
index dcedba8..e80f04b 100644
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -61,7 +61,7 @@ module_param(clockp, int, 0);
 module_param(clockm, int, 0);
 MODULE_LICENSE("GPL");
 
-static int __devinit com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+static int com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
 	struct net_device *dev;
 	struct arcnet_local *lp;
diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c
index 538f8bb..13f42cc 100644
--- a/drivers/net/fddi/defxx.c
+++ b/drivers/net/fddi/defxx.c
@@ -515,7 +515,7 @@ static const struct net_device_ops dfx_netdev_ops = {
  *   initialized and the board resources are read and stored in
  *   the device structure.
  */
-static int __devinit dfx_register(struct device *bdev)
+static int dfx_register(struct device *bdev)
 {
 	static int version_disp;
 	int dfx_bus_pci = DFX_BUS_PCI(bdev);
@@ -663,7 +663,7 @@ err_out:
  *   enabled yet.
  */
 
-static void __devinit dfx_bus_init(struct net_device *dev)
+static void dfx_bus_init(struct net_device *dev)
 {
 	DFX_board_t *bp = netdev_priv(dev);
 	struct device *bdev = bp->bus_dev;
@@ -866,7 +866,7 @@ static void __devexit dfx_bus_uninit(struct net_device *dev)
  *   None
  */
 
-static void __devinit dfx_bus_config_check(DFX_board_t *bp)
+static void dfx_bus_config_check(DFX_board_t *bp)
 {
 	struct device __maybe_unused *bdev = bp->bus_dev;
 	int dfx_bus_eisa = DFX_BUS_EISA(bdev);
@@ -962,7 +962,7 @@ static void __devinit dfx_bus_config_check(DFX_board_t *bp)
  *   returning from this routine.
  */
 
-static int __devinit dfx_driver_init(struct net_device *dev,
+static int dfx_driver_init(struct net_device *dev,
 				     const char *print_name,
 				     resource_size_t bar_start)
 {
@@ -3619,11 +3619,11 @@ static void __devexit dfx_unregister(struct device *bdev)
 }
 
 
-static int __devinit __maybe_unused dfx_dev_register(struct device *);
+static int __maybe_unused dfx_dev_register(struct device *);
 static int __devexit __maybe_unused dfx_dev_unregister(struct device *);
 
 #ifdef CONFIG_PCI
-static int __devinit dfx_pci_register(struct pci_dev *,
+static int dfx_pci_register(struct pci_dev *,
 				      const struct pci_device_id *);
 static void __devexit dfx_pci_unregister(struct pci_dev *);
 
@@ -3640,7 +3640,7 @@ static struct pci_driver dfx_pci_driver = {
 	.remove		= dfx_pci_unregister,
 };
 
-static __devinit int dfx_pci_register(struct pci_dev *pdev,
+static int dfx_pci_register(struct pci_dev *pdev,
 				      const struct pci_device_id *ent)
 {
 	return dfx_register(&pdev->dev);
@@ -3694,7 +3694,7 @@ static struct tc_driver dfx_tc_driver = {
 };
 #endif /* CONFIG_TC */
 
-static int __devinit __maybe_unused dfx_dev_register(struct device *dev)
+static int __maybe_unused dfx_dev_register(struct device *dev)
 {
 	int status;
 
@@ -3712,7 +3712,7 @@ static int __devexit __maybe_unused dfx_dev_unregister(struct device *dev)
 }
 
 
-static int __devinit dfx_init(void)
+static int dfx_init(void)
 {
 	int status;
 
diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c
index 4802b46..164d845 100644
--- a/drivers/net/hippi/rrunner.c
+++ b/drivers/net/hippi/rrunner.c
@@ -88,7 +88,7 @@ static const struct net_device_ops rr_netdev_ops = {
  * stack will need to know about I/O vectors or something similar.
  */
 
-static int __devinit rr_init_one(struct pci_dev *pdev,
+static int rr_init_one(struct pci_dev *pdev,
 	const struct pci_device_id *ent)
 {
 	struct net_device *dev;
@@ -503,7 +503,7 @@ static unsigned int write_eeprom(struct rr_private *rrpriv,
 }
 
 
-static int __devinit rr_init(struct net_device *dev)
+static int rr_init(struct net_device *dev)
 {
 	struct rr_private *rrpriv;
 	struct rr_regs __iomem *regs;
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index cbb08de..1198c6b 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -778,7 +778,7 @@ static int at86rf230_fill_data(struct spi_device *spi)
 	return 0;
 }
 
-static int __devinit at86rf230_probe(struct spi_device *spi)
+static int at86rf230_probe(struct spi_device *spi)
 {
 	struct ieee802154_dev *dev;
 	struct at86rf230_local *lp;
diff --git a/drivers/net/ieee802154/fakehard.c b/drivers/net/ieee802154/fakehard.c
index 8c719e0..fd0438c 100644
--- a/drivers/net/ieee802154/fakehard.c
+++ b/drivers/net/ieee802154/fakehard.c
@@ -354,7 +354,7 @@ static void ieee802154_fake_setup(struct net_device *dev)
 }
 
 
-static int __devinit ieee802154fake_probe(struct platform_device *pdev)
+static int ieee802154fake_probe(struct platform_device *pdev)
 {
 	struct net_device *dev;
 	struct fakehard_priv *priv;
diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c
index 2d2e027..e4b0e38 100644
--- a/drivers/net/ieee802154/fakelb.c
+++ b/drivers/net/ieee802154/fakelb.c
@@ -221,7 +221,7 @@ static void fakelb_del(struct fakelb_dev_priv *priv)
 	ieee802154_free_device(priv->dev);
 }
 
-static int __devinit fakelb_probe(struct platform_device *pdev)
+static int fakelb_probe(struct platform_device *pdev)
 {
 	struct fakelb_priv *priv;
 	struct fakelb_dev_priv *dp;
diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
index 90b5467..ef41051 100644
--- a/drivers/net/ieee802154/mrf24j40.c
+++ b/drivers/net/ieee802154/mrf24j40.c
@@ -618,7 +618,7 @@ out:
 	enable_irq(devrec->spi->irq);
 }
 
-static int __devinit mrf24j40_probe(struct spi_device *spi)
+static int mrf24j40_probe(struct spi_device *spi)
 {
 	int ret = -ENOMEM;
 	u8 val;
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index aa1bde8..ac322e5 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -2885,7 +2885,7 @@ vmxnet3_reset_work(struct work_struct *data)
 }
 
 
-static int __devinit
+static int
 vmxnet3_probe_device(struct pci_dev *pdev,
 		     const struct pci_device_id *id)
 {
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index 2eddbbf..863df17 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -707,7 +707,7 @@ static void dscc4_free1(struct pci_dev *pdev)
 	kfree(ppriv);
 }
 
-static int __devinit dscc4_init_one(struct pci_dev *pdev,
+static int dscc4_init_one(struct pci_dev *pdev,
 				  const struct pci_device_id *ent)
 {
 	struct dscc4_pci_priv *priv;
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index 0397544..dc529aa 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -2371,7 +2371,7 @@ static char *type_strings[] __devinitdata = {
 	"FarSync TE1"
 };
 
-static void __devinit
+static void
 fst_init_card(struct fst_card_info *card)
 {
 	int i;
@@ -2415,7 +2415,7 @@ static const struct net_device_ops fst_ops = {
  *      Initialise card when detected.
  *      Returns 0 to indicate success, or errno otherwise.
  */
-static int __devinit
+static int
 fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	static int no_of_cards_added = 0;
diff --git a/drivers/net/wan/hd64570.c b/drivers/net/wan/hd64570.c
index cf49033..c6e1a4b 100644
--- a/drivers/net/wan/hd64570.c
+++ b/drivers/net/wan/hd64570.c
@@ -676,7 +676,7 @@ static netdev_tx_t sca_xmit(struct sk_buff *skb, struct net_device *dev)
 
 
 #ifdef NEED_DETECT_RAM
-static u32 __devinit sca_detect_ram(card_t *card, u8 __iomem *rambase,
+static u32 sca_detect_ram(card_t *card, u8 __iomem *rambase,
 				    u32 ramsize)
 {
 	/* Round RAM size to 32 bits, fill from end to start */
@@ -705,7 +705,7 @@ static u32 __devinit sca_detect_ram(card_t *card, u8 __iomem *rambase,
 #endif /* NEED_DETECT_RAM */
 
 
-static void __devinit sca_init(card_t *card, int wait_states)
+static void sca_init(card_t *card, int wait_states)
 {
 	sca_out(wait_states, WCRL, card); /* Wait Control */
 	sca_out(wait_states, WCRM, card);
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c
index e2779fa..f1685d9 100644
--- a/drivers/net/wan/hd64572.c
+++ b/drivers/net/wan/hd64572.c
@@ -605,7 +605,7 @@ static netdev_tx_t sca_xmit(struct sk_buff *skb, struct net_device *dev)
 }
 
 
-static u32 __devinit sca_detect_ram(card_t *card, u8 __iomem *rambase,
+static u32 sca_detect_ram(card_t *card, u8 __iomem *rambase,
 				    u32 ramsize)
 {
 	/* Round RAM size to 32 bits, fill from end to start */
@@ -625,7 +625,7 @@ static u32 __devinit sca_detect_ram(card_t *card, u8 __iomem *rambase,
 }
 
 
-static void __devinit sca_init(card_t *card, int wait_states)
+static void sca_init(card_t *card, int wait_states)
 {
 	sca_out(wait_states, WCRL, card); /* Wait Control */
 	sca_out(wait_states, WCRM, card);
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
index 0fe36d7..beecbe8 100644
--- a/drivers/net/wan/ixp4xx_hss.c
+++ b/drivers/net/wan/ixp4xx_hss.c
@@ -1324,7 +1324,7 @@ static const struct net_device_ops hss_hdlc_ops = {
 	.ndo_do_ioctl   = hss_hdlc_ioctl,
 };
 
-static int __devinit hss_init_one(struct platform_device *pdev)
+static int hss_init_one(struct platform_device *pdev)
 {
 	struct port *port;
 	struct net_device *dev;
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index 358e25f..41a401a 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -816,7 +816,7 @@ static const struct net_device_ops lmc_ops = {
 	.ndo_get_stats  = lmc_get_stats,
 };
 
-static int __devinit lmc_init_one(struct pci_dev *pdev,
+static int lmc_init_one(struct pci_dev *pdev,
 				  const struct pci_device_id *ent)
 {
 	lmc_softc_t *sc;
diff --git a/drivers/net/wan/pc300too.c b/drivers/net/wan/pc300too.c
index 5fe246e..a51cfa7 100644
--- a/drivers/net/wan/pc300too.c
+++ b/drivers/net/wan/pc300too.c
@@ -297,7 +297,7 @@ static const struct net_device_ops pc300_ops = {
 	.ndo_do_ioctl   = pc300_ioctl,
 };
 
-static int __devinit pc300_pci_init_one(struct pci_dev *pdev,
+static int pc300_pci_init_one(struct pci_dev *pdev,
 					const struct pci_device_id *ent)
 {
 	card_t *card;
diff --git a/drivers/net/wan/pci200syn.c b/drivers/net/wan/pci200syn.c
index 9659fca..037c423 100644
--- a/drivers/net/wan/pci200syn.c
+++ b/drivers/net/wan/pci200syn.c
@@ -276,7 +276,7 @@ static const struct net_device_ops pci200_ops = {
 	.ndo_do_ioctl   = pci200_ioctl,
 };
 
-static int __devinit pci200_pci_init_one(struct pci_dev *pdev,
+static int pci200_pci_init_one(struct pci_dev *pdev,
 					 const struct pci_device_id *ent)
 {
 	card_t *card;
diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c
index feb7541..b72be12 100644
--- a/drivers/net/wan/wanxl.c
+++ b/drivers/net/wan/wanxl.c
@@ -557,7 +557,7 @@ static const struct net_device_ops wanxl_ops = {
 	.ndo_get_stats  = wanxl_get_stats,
 };
 
-static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
+static int wanxl_pci_init_one(struct pci_dev *pdev,
 					const struct pci_device_id *ent)
 {
 	card_t *card;
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 3c3b93e..6f695fc 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1255,7 +1255,7 @@ static const struct net_device_ops xennet_netdev_ops = {
 #endif
 };
 
-static struct net_device * __devinit xennet_create_dev(struct xenbus_device *dev)
+static struct net_device *xennet_create_dev(struct xenbus_device *dev)
 {
 	int i, err;
 	struct net_device *netdev;
@@ -1351,7 +1351,7 @@ static struct net_device * __devinit xennet_create_dev(struct xenbus_device *dev
  * structures and the ring buffers for communication with the backend, and
  * inform the backend of the appropriate details for those.
  */
-static int __devinit netfront_probe(struct xenbus_device *dev,
+static int netfront_probe(struct xenbus_device *dev,
 				    const struct xenbus_device_id *id)
 {
 	int err;
-- 
1.8.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 18:28:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 18:28:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaW4r-00018E-Ie; Mon, 19 Nov 2012 18:28:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <wfp5p@viridian.itc.virginia.edu>) id 1TaW4q-00017Y-96
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 18:28:12 +0000
Received: from [85.158.138.51:4666] by server-5.bemta-3.messagelabs.com id
	5F/CD-26311-B3A7AA05; Mon, 19 Nov 2012 18:28:11 +0000
X-Env-Sender: wfp5p@viridian.itc.virginia.edu
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353349689!30597101!1
X-Originating-IP: [128.143.12.139]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5859 invoked from network); 19 Nov 2012 18:28:10 -0000
Received: from viridian.itc.virginia.edu (HELO viridian.itc.virginia.edu)
	(128.143.12.139) by server-8.tower-174.messagelabs.com with SMTP;
	19 Nov 2012 18:28:10 -0000
Received: by viridian.itc.virginia.edu (Postfix, from userid 1249)
	id 5CBC5803A4; Mon, 19 Nov 2012 13:27:40 -0500 (EST)
From: Bill Pemberton <wfp5p@virginia.edu>
To: gregkh@linuxfoundation.org
Date: Mon, 19 Nov 2012 13:24:06 -0500
Message-Id: <1353349642-3677-297-git-send-email-wfp5p@virginia.edu>
X-Mailer: git-send-email 1.8.0
In-Reply-To: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
Cc: xen-devel@lists.xensource.com, virtualization@lists.linux-foundation.org
Subject: [Xen-devel] [PATCH 297/493] xen: remove use of __devinitdata
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CONFIG_HOTPLUG is going away as an option so __devinitdata is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: xen-devel@lists.xensource.com 
Cc: virtualization@lists.linux-foundation.org 
---
 drivers/xen/platform-pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
index 017f66d..361aae3 100644
--- a/drivers/xen/platform-pci.c
+++ b/drivers/xen/platform-pci.c
@@ -170,7 +170,7 @@ pci_out:
 	return ret;
 }
 
-static struct pci_device_id platform_pci_tbl[] __devinitdata = {
+static struct pci_device_id platform_pci_tbl[] = {
 	{PCI_VENDOR_ID_XEN, PCI_DEVICE_ID_XEN_PLATFORM,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{0,}
-- 
1.8.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 18:28:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 18:28:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaW4r-00018E-Ie; Mon, 19 Nov 2012 18:28:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <wfp5p@viridian.itc.virginia.edu>) id 1TaW4q-00017Y-96
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 18:28:12 +0000
Received: from [85.158.138.51:4666] by server-5.bemta-3.messagelabs.com id
	5F/CD-26311-B3A7AA05; Mon, 19 Nov 2012 18:28:11 +0000
X-Env-Sender: wfp5p@viridian.itc.virginia.edu
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353349689!30597101!1
X-Originating-IP: [128.143.12.139]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5859 invoked from network); 19 Nov 2012 18:28:10 -0000
Received: from viridian.itc.virginia.edu (HELO viridian.itc.virginia.edu)
	(128.143.12.139) by server-8.tower-174.messagelabs.com with SMTP;
	19 Nov 2012 18:28:10 -0000
Received: by viridian.itc.virginia.edu (Postfix, from userid 1249)
	id 5CBC5803A4; Mon, 19 Nov 2012 13:27:40 -0500 (EST)
From: Bill Pemberton <wfp5p@virginia.edu>
To: gregkh@linuxfoundation.org
Date: Mon, 19 Nov 2012 13:24:06 -0500
Message-Id: <1353349642-3677-297-git-send-email-wfp5p@virginia.edu>
X-Mailer: git-send-email 1.8.0
In-Reply-To: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
Cc: xen-devel@lists.xensource.com, virtualization@lists.linux-foundation.org
Subject: [Xen-devel] [PATCH 297/493] xen: remove use of __devinitdata
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CONFIG_HOTPLUG is going away as an option so __devinitdata is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: xen-devel@lists.xensource.com 
Cc: virtualization@lists.linux-foundation.org 
---
 drivers/xen/platform-pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
index 017f66d..361aae3 100644
--- a/drivers/xen/platform-pci.c
+++ b/drivers/xen/platform-pci.c
@@ -170,7 +170,7 @@ pci_out:
 	return ret;
 }
 
-static struct pci_device_id platform_pci_tbl[] __devinitdata = {
+static struct pci_device_id platform_pci_tbl[] = {
 	{PCI_VENDOR_ID_XEN, PCI_DEVICE_ID_XEN_PLATFORM,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{0,}
-- 
1.8.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 18:28:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 18:28:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaW5A-0001DM-0U; Mon, 19 Nov 2012 18:28:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <wfp5p@viridian.itc.virginia.edu>) id 1TaW58-0001Cb-C6
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 18:28:30 +0000
Received: from [193.109.254.147:44255] by server-11.bemta-14.messagelabs.com
	id 71/C9-29027-D4A7AA05; Mon, 19 Nov 2012 18:28:29 +0000
X-Env-Sender: wfp5p@viridian.itc.virginia.edu
X-Msg-Ref: server-11.tower-27.messagelabs.com!1353349694!4701320!1
X-Originating-IP: [128.143.12.139]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10421 invoked from network); 19 Nov 2012 18:28:15 -0000
Received: from viridian.itc.virginia.edu (HELO viridian.itc.virginia.edu)
	(128.143.12.139) by server-11.tower-27.messagelabs.com with SMTP;
	19 Nov 2012 18:28:15 -0000
Received: by viridian.itc.virginia.edu (Postfix, from userid 1249)
	id 4459D80369; Mon, 19 Nov 2012 13:27:37 -0500 (EST)
From: Bill Pemberton <wfp5p@virginia.edu>
To: gregkh@linuxfoundation.org
Date: Mon, 19 Nov 2012 13:23:11 -0500
Message-Id: <1353349642-3677-242-git-send-email-wfp5p@virginia.edu>
X-Mailer: git-send-email 1.8.0
In-Reply-To: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
Cc: linux-pci@vger.kernel.org, xen-devel@lists.xensource.com,
	virtualization@lists.linux-foundation.org
Subject: [Xen-devel] [PATCH 242/493] pci: remove use of __devinit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: linux-pci@vger.kernel.org 
Cc: xen-devel@lists.xensource.com 
Cc: virtualization@lists.linux-foundation.org 
---
 drivers/pci/ioapic.c           |   2 +-
 drivers/pci/pci.c              |   2 +-
 drivers/pci/pcie/aer/aerdrv.c  |   4 +-
 drivers/pci/pcie/portdrv_pci.c |   2 +-
 drivers/pci/probe.c            |  18 +++---
 drivers/pci/quirks.c           | 134 ++++++++++++++++++++---------------------
 drivers/pci/xen-pcifront.c     |  10 +--
 include/linux/pci.h            |   2 +-
 8 files changed, 87 insertions(+), 87 deletions(-)

diff --git a/drivers/pci/ioapic.c b/drivers/pci/ioapic.c
index 2b24fb4..4fdc61e 100644
--- a/drivers/pci/ioapic.c
+++ b/drivers/pci/ioapic.c
@@ -27,7 +27,7 @@ struct ioapic {
 	u32		gsi_base;
 };
 
-static int __devinit ioapic_probe(struct pci_dev *dev, const struct pci_device_id *ent)
+static int ioapic_probe(struct pci_dev *dev, const struct pci_device_id *ent)
 {
 	acpi_handle handle;
 	acpi_status status;
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index adffc6f..133ffd1 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3867,7 +3867,7 @@ static int __init pci_resource_alignment_sysfs_init(void)
 
 late_initcall(pci_resource_alignment_sysfs_init);
 
-static void __devinit pci_no_domains(void)
+static void pci_no_domains(void)
 {
 #ifdef CONFIG_PCI_DOMAINS
 	pci_domains_supported = 0;
diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c
index 030cf12..76ef634 100644
--- a/drivers/pci/pcie/aer/aerdrv.c
+++ b/drivers/pci/pcie/aer/aerdrv.c
@@ -41,7 +41,7 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
-static int __devinit aer_probe(struct pcie_device *dev);
+static int aer_probe(struct pcie_device *dev);
 static void aer_remove(struct pcie_device *dev);
 static pci_ers_result_t aer_error_detected(struct pci_dev *dev,
 	enum pci_channel_state error);
@@ -300,7 +300,7 @@ static void aer_remove(struct pcie_device *dev)
  *
  * Invoked when PCI Express bus loads AER service driver.
  */
-static int __devinit aer_probe(struct pcie_device *dev)
+static int aer_probe(struct pcie_device *dev)
 {
 	int status;
 	struct aer_rpc *rpc;
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index 0761d90..d4824cb 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -182,7 +182,7 @@ static const struct pci_device_id port_runtime_pm_black_list[] = {
  * this port device.
  *
  */
-static int __devinit pcie_portdrv_probe(struct pci_dev *dev,
+static int pcie_portdrv_probe(struct pci_dev *dev,
 					const struct pci_device_id *id)
 {
 	int status;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 3d17641..edc3d12 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -305,7 +305,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
 	}
 }
 
-static void __devinit pci_read_bridge_io(struct pci_bus *child)
+static void pci_read_bridge_io(struct pci_bus *child)
 {
 	struct pci_dev *dev = child->self;
 	u8 io_base_lo, io_limit_lo;
@@ -345,7 +345,7 @@ static void __devinit pci_read_bridge_io(struct pci_bus *child)
 	}
 }
 
-static void __devinit pci_read_bridge_mmio(struct pci_bus *child)
+static void pci_read_bridge_mmio(struct pci_bus *child)
 {
 	struct pci_dev *dev = child->self;
 	u16 mem_base_lo, mem_limit_lo;
@@ -367,7 +367,7 @@ static void __devinit pci_read_bridge_mmio(struct pci_bus *child)
 	}
 }
 
-static void __devinit pci_read_bridge_mmio_pref(struct pci_bus *child)
+static void pci_read_bridge_mmio_pref(struct pci_bus *child)
 {
 	struct pci_dev *dev = child->self;
 	u16 mem_base_lo, mem_limit_lo;
@@ -417,7 +417,7 @@ static void __devinit pci_read_bridge_mmio_pref(struct pci_bus *child)
 	}
 }
 
-void __devinit pci_read_bridge_bases(struct pci_bus *child)
+void pci_read_bridge_bases(struct pci_bus *child)
 {
 	struct pci_dev *dev = child->self;
 	struct resource *res;
@@ -705,7 +705,7 @@ static void pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max)
  * them, we proceed to assigning numbers to the remaining buses in
  * order to avoid overlaps between old and new bus numbers.
  */
-int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass)
+int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass)
 {
 	struct pci_bus *child;
 	int is_cardbus = (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS);
@@ -1587,7 +1587,7 @@ void pcie_bus_configure_settings(struct pci_bus *bus, u8 mpss)
 }
 EXPORT_SYMBOL_GPL(pcie_bus_configure_settings);
 
-unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus)
+unsigned int pci_scan_child_bus(struct pci_bus *bus)
 {
 	unsigned int devfn, pass, max = bus->busn_res.start;
 	struct pci_dev *dev;
@@ -1791,7 +1791,7 @@ void pci_bus_release_busn_res(struct pci_bus *b)
 			res, ret ? "can not be" : "is");
 }
 
-struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus,
+struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,
 		struct pci_ops *ops, void *sysdata, struct list_head *resources)
 {
 	struct pci_host_bridge_window *window;
@@ -1827,7 +1827,7 @@ struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus,
 EXPORT_SYMBOL(pci_scan_root_bus);
 
 /* Deprecated; use pci_scan_root_bus() instead */
-struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent,
+struct pci_bus *pci_scan_bus_parented(struct device *parent,
 		int bus, struct pci_ops *ops, void *sysdata)
 {
 	LIST_HEAD(resources);
@@ -1845,7 +1845,7 @@ struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent,
 }
 EXPORT_SYMBOL(pci_scan_bus_parented);
 
-struct pci_bus * __devinit pci_scan_bus(int bus, struct pci_ops *ops,
+struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops,
 					void *sysdata)
 {
 	LIST_HEAD(resources);
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 0c59f7a..ed4b0bd 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -37,7 +37,7 @@
  * key system devices. For devices that need to have mmio decoding always-on,
  * we need to set the dev->mmio_always_on bit.
  */
-static void __devinit quirk_mmio_always_on(struct pci_dev *dev)
+static void quirk_mmio_always_on(struct pci_dev *dev)
 {
 	dev->mmio_always_on = 1;
 }
@@ -48,7 +48,7 @@ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_ANY_ID, PCI_ANY_ID,
  * Mark this device with a broken_parity_status, to allow
  * PCI scanning code to "skip" this now blacklisted device.
  */
-static void __devinit quirk_mellanox_tavor(struct pci_dev *dev)
+static void quirk_mellanox_tavor(struct pci_dev *dev)
 {
 	dev->broken_parity_status = 1;	/* This device gives false positives */
 }
@@ -83,7 +83,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82441,	quirk_p
     This appears to be BIOS not version dependent. So presumably there is a 
     chipset level fix */
     
-static void __devinit quirk_isa_dma_hangs(struct pci_dev *dev)
+static void quirk_isa_dma_hangs(struct pci_dev *dev)
 {
 	if (!isa_dma_bridge_buggy) {
 		isa_dma_bridge_buggy=1;
@@ -106,7 +106,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC,	PCI_DEVICE_ID_NEC_CBUS_3,	quirk_isa_d
  * Intel NM10 "TigerPoint" LPC PM1a_STS.BM_STS must be clear
  * for some HT machines to use C4 w/o hanging.
  */
-static void __devinit quirk_tigerpoint_bm_sts(struct pci_dev *dev)
+static void quirk_tigerpoint_bm_sts(struct pci_dev *dev)
 {
 	u32 pmbase;
 	u16 pm1a;
@@ -125,7 +125,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TGP_LPC, quirk
 /*
  *	Chipsets where PCI->PCI transfers vanish or hang
  */
-static void __devinit quirk_nopcipci(struct pci_dev *dev)
+static void quirk_nopcipci(struct pci_dev *dev)
 {
 	if ((pci_pci_problems & PCIPCI_FAIL)==0) {
 		dev_info(&dev->dev, "Disabling direct PCI/PCI transfers\n");
@@ -135,7 +135,7 @@ static void __devinit quirk_nopcipci(struct pci_dev *dev)
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_5597,		quirk_nopcipci);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_496,		quirk_nopcipci);
 
-static void __devinit quirk_nopciamd(struct pci_dev *dev)
+static void quirk_nopciamd(struct pci_dev *dev)
 {
 	u8 rev;
 	pci_read_config_byte(dev, 0x08, &rev);
@@ -150,7 +150,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD,	PCI_DEVICE_ID_AMD_8151_0,	quirk_nopci
 /*
  *	Triton requires workarounds to be used by the drivers
  */
-static void __devinit quirk_triton(struct pci_dev *dev)
+static void quirk_triton(struct pci_dev *dev)
 {
 	if ((pci_pci_problems&PCIPCI_TRITON)==0) {
 		dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n");
@@ -229,7 +229,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8361,		quirk_viala
 /*
  *	VIA Apollo VP3 needs ETBF on BT848/878
  */
-static void __devinit quirk_viaetbf(struct pci_dev *dev)
+static void quirk_viaetbf(struct pci_dev *dev)
 {
 	if ((pci_pci_problems&PCIPCI_VIAETBF)==0) {
 		dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n");
@@ -238,7 +238,7 @@ static void __devinit quirk_viaetbf(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C597_0,	quirk_viaetbf);
 
-static void __devinit quirk_vsfx(struct pci_dev *dev)
+static void quirk_vsfx(struct pci_dev *dev)
 {
 	if ((pci_pci_problems&PCIPCI_VSFX)==0) {
 		dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n");
@@ -253,7 +253,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C576,	quirk_vsfx)
  *	workaround applied too
  *	[Info kindly provided by ALi]
  */	
-static void __devinit quirk_alimagik(struct pci_dev *dev)
+static void quirk_alimagik(struct pci_dev *dev)
 {
 	if ((pci_pci_problems&PCIPCI_ALIMAGIK)==0) {
 		dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n");
@@ -267,7 +267,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 	PCI_DEVICE_ID_AL_M1651, 	quirk_alimag
  *	Natoma has some interesting boundary conditions with Zoran stuff
  *	at least
  */
-static void __devinit quirk_natoma(struct pci_dev *dev)
+static void quirk_natoma(struct pci_dev *dev)
 {
 	if ((pci_pci_problems&PCIPCI_NATOMA)==0) {
 		dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n");
@@ -285,7 +285,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 	PCI_DEVICE_ID_INTEL_82443BX_2, 	qu
  *  This chip can cause PCI parity errors if config register 0xA0 is read
  *  while DMAs are occurring.
  */
-static void __devinit quirk_citrine(struct pci_dev *dev)
+static void quirk_citrine(struct pci_dev *dev)
 {
 	dev->cfg_size = 0xA0;
 }
@@ -295,7 +295,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM,	PCI_DEVICE_ID_IBM_CITRINE,	quirk_cit
  *  S3 868 and 968 chips report region size equal to 32M, but they decode 64M.
  *  If it's needed, re-allocate the region.
  */
-static void __devinit quirk_s3_64M(struct pci_dev *dev)
+static void quirk_s3_64M(struct pci_dev *dev)
 {
 	struct resource *r = &dev->resource[0];
 
@@ -313,7 +313,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_S3,	PCI_DEVICE_ID_S3_968,		quirk_s3_64M);
  * BAR0 should be 8 bytes; instead, it may be set to something like 8k
  * (which conflicts w/ BAR1's memory range).
  */
-static void __devinit quirk_cs5536_vsa(struct pci_dev *dev)
+static void quirk_cs5536_vsa(struct pci_dev *dev)
 {
 	if (pci_resource_len(dev, 0) != 8) {
 		struct resource *res = &dev->resource[0];
@@ -324,7 +324,7 @@ static void __devinit quirk_cs5536_vsa(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_ISA, quirk_cs5536_vsa);
 
-static void __devinit quirk_io_region(struct pci_dev *dev, unsigned region,
+static void quirk_io_region(struct pci_dev *dev, unsigned region,
 	unsigned size, int nr, const char *name)
 {
 	region &= ~(size-1);
@@ -352,7 +352,7 @@ static void __devinit quirk_io_region(struct pci_dev *dev, unsigned region,
  *	ATI Northbridge setups MCE the processor if you even
  *	read somewhere between 0x3b0->0x3bb or read 0x3d3
  */
-static void __devinit quirk_ati_exploding_mce(struct pci_dev *dev)
+static void quirk_ati_exploding_mce(struct pci_dev *dev)
 {
 	dev_info(&dev->dev, "ATI Northbridge, reserving I/O ports 0x3b0 to 0x3bb\n");
 	/* Mae rhaid i ni beidio ag edrych ar y lleoliadiau I/O hyn */
@@ -372,7 +372,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI,	PCI_DEVICE_ID_ATI_RS100,   quirk_ati_
  *	0xE0 (64 bytes of ACPI registers)
  *	0xE2 (32 bytes of SMB registers)
  */
-static void __devinit quirk_ali7101_acpi(struct pci_dev *dev)
+static void quirk_ali7101_acpi(struct pci_dev *dev)
 {
 	u16 region;
 
@@ -440,7 +440,7 @@ static void piix4_mem_quirk(struct pci_dev *dev, const char *name, unsigned int
  *	0x90 (16 bytes of SMB registers)
  * and a few strange programmable PIIX4 device resources.
  */
-static void __devinit quirk_piix4_acpi(struct pci_dev *dev)
+static void quirk_piix4_acpi(struct pci_dev *dev)
 {
 	u32 region, res_a;
 
@@ -489,7 +489,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82443MX_3,	qui
  *	0x40 (128 bytes of ACPI, GPIO & TCO registers)
  *	0x58 (64 bytes of GPIO I/O space)
  */
-static void __devinit quirk_ich4_lpc_acpi(struct pci_dev *dev)
+static void quirk_ich4_lpc_acpi(struct pci_dev *dev)
 {
 	u32 region;
 	u8 enable;
@@ -531,7 +531,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_82801DB_12,
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_82801EB_0,		quirk_ich4_lpc_acpi);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_ESB_1,		quirk_ich4_lpc_acpi);
 
-static void __devinit ich6_lpc_acpi_gpio(struct pci_dev *dev)
+static void ich6_lpc_acpi_gpio(struct pci_dev *dev)
 {
 	u32 region;
 	u8 enable;
@@ -555,7 +555,7 @@ static void __devinit ich6_lpc_acpi_gpio(struct pci_dev *dev)
 	}
 }
 
-static void __devinit ich6_lpc_generic_decode(struct pci_dev *dev, unsigned reg, const char *name, int dynsize)
+static void ich6_lpc_generic_decode(struct pci_dev *dev, unsigned reg, const char *name, int dynsize)
 {
 	u32 val;
 	u32 size, base;
@@ -583,7 +583,7 @@ static void __devinit ich6_lpc_generic_decode(struct pci_dev *dev, unsigned reg,
 	dev_info(&dev->dev, "%s PIO at %04x-%04x\n", name, base, base+size-1);
 }
 
-static void __devinit quirk_ich6_lpc(struct pci_dev *dev)
+static void quirk_ich6_lpc(struct pci_dev *dev)
 {
 	/* Shared ACPI/GPIO decode with all ICH6+ */
 	ich6_lpc_acpi_gpio(dev);
@@ -595,7 +595,7 @@ static void __devinit quirk_ich6_lpc(struct pci_dev *dev)
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_ICH6_0, quirk_ich6_lpc);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_ICH6_1, quirk_ich6_lpc);
 
-static void __devinit ich7_lpc_generic_decode(struct pci_dev *dev, unsigned reg, const char *name)
+static void ich7_lpc_generic_decode(struct pci_dev *dev, unsigned reg, const char *name)
 {
 	u32 val;
 	u32 mask, base;
@@ -619,7 +619,7 @@ static void __devinit ich7_lpc_generic_decode(struct pci_dev *dev, unsigned reg,
 }
 
 /* ICH7-10 has the same common LPC generic IO decode registers */
-static void __devinit quirk_ich7_lpc(struct pci_dev *dev)
+static void quirk_ich7_lpc(struct pci_dev *dev)
 {
 	/* We share the common ACPI/GPIO decode with ICH6 */
 	ich6_lpc_acpi_gpio(dev);
@@ -648,7 +648,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_ICH10_1, qui
  * VIA ACPI: One IO region pointed to by longword at
  *	0x48 or 0x20 (256 bytes of ACPI registers)
  */
-static void __devinit quirk_vt82c586_acpi(struct pci_dev *dev)
+static void quirk_vt82c586_acpi(struct pci_dev *dev)
 {
 	u32 region;
 
@@ -666,7 +666,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C586_3,	quirk_vt
  *	0x70 (128 bytes of hardware monitoring register)
  *	0x90 (16 bytes of SMB registers)
  */
-static void __devinit quirk_vt82c686_acpi(struct pci_dev *dev)
+static void quirk_vt82c686_acpi(struct pci_dev *dev)
 {
 	u16 hm;
 	u32 smb;
@@ -688,7 +688,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C686_4,	quirk_vt
  *	0x88 (128 bytes of power management registers)
  *	0xd0 (16 bytes of SMB registers)
  */
-static void __devinit quirk_vt8235_acpi(struct pci_dev *dev)
+static void quirk_vt8235_acpi(struct pci_dev *dev)
 {
 	u16 pm, smb;
 
@@ -706,7 +706,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8235,	quirk_vt8235
  * TI XIO2000a PCIe-PCI Bridge erroneously reports it supports fast back-to-back:
  *	Disable fast back-to-back on the secondary bus segment
  */
-static void __devinit quirk_xio2000a(struct pci_dev *dev)
+static void quirk_xio2000a(struct pci_dev *dev)
 {
 	struct pci_dev *pdev;
 	u16 command;
@@ -780,7 +780,7 @@ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8237,		quirk
  * noapic specified. For the moment we assume it's the erratum. We may be wrong
  * of course. However the advice is demonstrably good even if so..
  */
-static void __devinit quirk_amd_ioapic(struct pci_dev *dev)
+static void quirk_amd_ioapic(struct pci_dev *dev)
 {
 	if (dev->revision >= 0x02) {
 		dev_warn(&dev->dev, "I/O APIC: AMD Erratum #22 may be present. In the event of instability try\n");
@@ -789,7 +789,7 @@ static void __devinit quirk_amd_ioapic(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD,	PCI_DEVICE_ID_AMD_VIPER_7410,	quirk_amd_ioapic);
 
-static void __devinit quirk_ioapic_rmw(struct pci_dev *dev)
+static void quirk_ioapic_rmw(struct pci_dev *dev)
 {
 	if (dev->devfn == 0 && dev->bus->number == 0)
 		sis_apic_bug = 1;
@@ -801,7 +801,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI,	PCI_ANY_ID,			quirk_ioapic_rmw);
  * Some settings of MMRBC can lead to data corruption so block changes.
  * See AMD 8131 HyperTransport PCI-X Tunnel Revision Guide
  */
-static void __devinit quirk_amd_8131_mmrbc(struct pci_dev *dev)
+static void quirk_amd_8131_mmrbc(struct pci_dev *dev)
 {
 	if (dev->subordinate && dev->revision <= 0x12) {
 		dev_info(&dev->dev, "AMD8131 rev %x detected; "
@@ -819,7 +819,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_
  * value of the ACPI SCI interrupt is only done for convenience.
  *	-jgarzik
  */
-static void __devinit quirk_via_acpi(struct pci_dev *d)
+static void quirk_via_acpi(struct pci_dev *d)
 {
 	/*
 	 * VIA ACPI device: SCI IRQ line in PCI config byte 0x42
@@ -926,7 +926,7 @@ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_vlink);
  * We need to switch it off to be able to recognize the real
  * type of the chip.
  */
-static void __devinit quirk_vt82c598_id(struct pci_dev *dev)
+static void quirk_vt82c598_id(struct pci_dev *dev)
 {
 	pci_write_config_byte(dev, 0xfc, 0);
 	pci_read_config_word(dev, PCI_DEVICE_ID, &dev->device);
@@ -978,7 +978,7 @@ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD,	PCI_DEVICE_ID_AMD_FE_GATE_700C
  *	assigned to it. We force a larger allocation to ensure that
  *	nothing gets put too close to it.
  */
-static void __devinit quirk_dunord ( struct pci_dev * dev )
+static void quirk_dunord ( struct pci_dev * dev )
 {
 	struct resource *r = &dev->resource [1];
 	r->start = 0;
@@ -992,7 +992,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_DUNORD,	PCI_DEVICE_ID_DUNORD_I3000,	quirk
  * in the ProgIf. Unfortunately, the ProgIf value is wrong - 0x80
  * instead of 0x01.
  */
-static void __devinit quirk_transparent_bridge(struct pci_dev *dev)
+static void quirk_transparent_bridge(struct pci_dev *dev)
 {
 	dev->transparent = 1;
 }
@@ -1066,7 +1066,7 @@ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SATA
 /*
  *	Serverworks CSB5 IDE does not fully support native mode
  */
-static void __devinit quirk_svwks_csb5ide(struct pci_dev *pdev)
+static void quirk_svwks_csb5ide(struct pci_dev *pdev)
 {
 	u8 prog;
 	pci_read_config_byte(pdev, PCI_CLASS_PROG, &prog);
@@ -1082,7 +1082,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB
 /*
  *	Intel 82801CAM ICH3-M datasheet says IDE modes must be the same
  */
-static void __devinit quirk_ide_samemode(struct pci_dev *pdev)
+static void quirk_ide_samemode(struct pci_dev *pdev)
 {
 	u8 prog;
 
@@ -1101,7 +1101,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_10, qui
  * Some ATA devices break if put into D3
  */
 
-static void __devinit quirk_no_ata_d3(struct pci_dev *pdev)
+static void quirk_no_ata_d3(struct pci_dev *pdev)
 {
 	pdev->dev_flags |= PCI_DEV_FLAGS_NO_D3;
 }
@@ -1121,7 +1121,7 @@ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_VIA, PCI_ANY_ID,
 /* This was originally an Alpha specific thing, but it really fits here.
  * The i82375 PCI/EISA bridge appears as non-classified. Fix that.
  */
-static void __devinit quirk_eisa_bridge(struct pci_dev *dev)
+static void quirk_eisa_bridge(struct pci_dev *dev)
 {
 	dev->class = PCI_CLASS_BRIDGE_EISA << 8;
 }
@@ -1155,7 +1155,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82375,	quirk_e
  */
 static int asus_hides_smbus;
 
-static void __devinit asus_hides_smbus_hostbridge(struct pci_dev *dev)
+static void asus_hides_smbus_hostbridge(struct pci_dev *dev)
 {
 	if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK)) {
 		if (dev->device == PCI_DEVICE_ID_INTEL_82845_HB)
@@ -1538,7 +1538,7 @@ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB3
 #endif
 
 #ifdef CONFIG_X86_IO_APIC
-static void __devinit quirk_alder_ioapic(struct pci_dev *pdev)
+static void quirk_alder_ioapic(struct pci_dev *pdev)
 {
 	int i;
 
@@ -1561,7 +1561,7 @@ static void __devinit quirk_alder_ioapic(struct pci_dev *pdev)
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_EESSC,	quirk_alder_ioapic);
 #endif
 
-static void __devinit quirk_pcie_mch(struct pci_dev *pdev)
+static void quirk_pcie_mch(struct pci_dev *pdev)
 {
 	pci_msi_off(pdev);
 	pdev->no_msi = 1;
@@ -1575,7 +1575,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_E7525_MCH,	quir
  * It's possible for the MSI to get corrupted if shpc and acpi
  * are used together on certain PXH-based systems.
  */
-static void __devinit quirk_pcie_pxh(struct pci_dev *dev)
+static void quirk_pcie_pxh(struct pci_dev *dev)
 {
 	pci_msi_off(dev);
 	dev->no_msi = 1;
@@ -1777,7 +1777,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AMD,   PCI_DEVICE_ID_AMD_8111_SMBUS, 	qui
  * but the PIO transfers won't work if BAR0 falls at the odd 8 bytes.
  * Re-allocate the region if needed...
  */
-static void __devinit quirk_tc86c001_ide(struct pci_dev *dev)
+static void quirk_tc86c001_ide(struct pci_dev *dev)
 {
 	struct resource *r = &dev->resource[0];
 
@@ -1797,7 +1797,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TOSHIBA_2,
  * The BAR0 or BAR1 region may be disabled (size 0) or enabled (size 128).
  * Re-allocate the regions to a 256-byte boundary if necessary.
  */
-static void __devinit quirk_plx_pci9050(struct pci_dev *dev)
+static void quirk_plx_pci9050(struct pci_dev *dev)
 {
 	unsigned int bar;
 
@@ -1829,7 +1829,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
 DECLARE_PCI_FIXUP_HEADER(0x1402, 0x2000, quirk_plx_pci9050);
 DECLARE_PCI_FIXUP_HEADER(0x1402, 0x2600, quirk_plx_pci9050);
 
-static void __devinit quirk_netmos(struct pci_dev *dev)
+static void quirk_netmos(struct pci_dev *dev)
 {
 	unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4;
 	unsigned int num_serial = dev->subsystem_device & 0xf;
@@ -1867,7 +1867,7 @@ static void __devinit quirk_netmos(struct pci_dev *dev)
 DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_NETMOS, PCI_ANY_ID,
 			 PCI_CLASS_COMMUNICATION_SERIAL, 8, quirk_netmos);
 
-static void __devinit quirk_e100_interrupt(struct pci_dev *dev)
+static void quirk_e100_interrupt(struct pci_dev *dev)
 {
 	u16 command, pmcsr;
 	u8 __iomem *csr;
@@ -1940,7 +1940,7 @@ DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_INTEL, PCI_ANY_ID,
  * The 82575 and 82598 may experience data corruption issues when transitioning
  * out of L0S.  To prevent this we need to disable L0S on the pci-e link
  */
-static void __devinit quirk_disable_aspm_l0s(struct pci_dev *dev)
+static void quirk_disable_aspm_l0s(struct pci_dev *dev)
 {
 	dev_info(&dev->dev, "Disabling L0s\n");
 	pci_disable_link_state(dev, PCIE_LINK_STATE_L0S);
@@ -1960,7 +1960,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10f1, quirk_disable_aspm_l0s);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10f4, quirk_disable_aspm_l0s);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1508, quirk_disable_aspm_l0s);
 
-static void __devinit fixup_rev1_53c810(struct pci_dev* dev)
+static void fixup_rev1_53c810(struct pci_dev* dev)
 {
 	/* rev 1 ncr53c810 chips don't set the class at all which means
 	 * they don't get their resources remapped. Fix that here.
@@ -1974,7 +1974,7 @@ static void __devinit fixup_rev1_53c810(struct pci_dev* dev)
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, fixup_rev1_53c810);
 
 /* Enable 1k I/O space granularity on the Intel P64H2 */
-static void __devinit quirk_p64h2_1k_io(struct pci_dev *dev)
+static void quirk_p64h2_1k_io(struct pci_dev *dev)
 {
 	u16 en1k;
 
@@ -2007,7 +2007,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA,  PCI_DEVICE_ID_NVIDIA_CK804_PCIE,
 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_NVIDIA,  PCI_DEVICE_ID_NVIDIA_CK804_PCIE,
 			quirk_nvidia_ck804_pcie_aer_ext_cap);
 
-static void __devinit quirk_via_cx700_pci_parking_caching(struct pci_dev *dev)
+static void quirk_via_cx700_pci_parking_caching(struct pci_dev *dev)
 {
 	/*
 	 * Disable PCI Bus Parking and PCI Master read caching on CX700
@@ -2070,7 +2070,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, 0x324e, quirk_via_cx700_pci_parking_c
  * We believe that it is legal to read beyond the end tag and
  * therefore the solution is to limit the read/write length.
  */
-static void __devinit quirk_brcm_570x_limit_vpd(struct pci_dev *dev)
+static void quirk_brcm_570x_limit_vpd(struct pci_dev *dev)
 {
 	/*
 	 * Only disable the VPD capability for 5706, 5706S, 5708,
@@ -2130,7 +2130,7 @@ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_BROADCOM,
  * the DRBs - this is where we expose device 6.
  * http://www.x86-secret.com/articles/tweak/pat/patsecrets-2.htm
  */
-static void __devinit quirk_unhide_mch_dev6(struct pci_dev *dev)
+static void quirk_unhide_mch_dev6(struct pci_dev *dev)
 {
 	u8 reg;
 
@@ -2154,7 +2154,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82875_HB,
  * supports link speed auto negotiation, but falsely sets
  * the link speed to 5GT/s.
  */
-static void __devinit quirk_tile_plx_gen1(struct pci_dev *dev)
+static void quirk_tile_plx_gen1(struct pci_dev *dev)
 {
 	if (tile_plx_gen1) {
 		pci_write_config_dword(dev, 0x98, 0x1);
@@ -2171,7 +2171,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8624, quirk_tile_plx_gen1);
  * aware of it.  Instead of setting the flag on all busses in the
  * machine, simply disable MSI globally.
  */
-static void __devinit quirk_disable_all_msi(struct pci_dev *dev)
+static void quirk_disable_all_msi(struct pci_dev *dev)
 {
 	pci_no_msi();
 	dev_warn(&dev->dev, "MSI quirk detected; MSI disabled\n");
@@ -2185,7 +2185,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3364, quirk_disab
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8380_0, quirk_disable_all_msi);
 
 /* Disable MSI on chipsets that are known to not support it */
-static void __devinit quirk_disable_msi(struct pci_dev *dev)
+static void quirk_disable_msi(struct pci_dev *dev)
 {
 	if (dev->subordinate) {
 		dev_warn(&dev->dev, "MSI quirk detected; "
@@ -2203,7 +2203,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x5a3f, quirk_disable_msi);
  * we use the possible vendor/device IDs of the host bridge for the
  * declared quirk, and search for the APC bridge by slot number.
  */
-static void __devinit quirk_amd_780_apc_msi(struct pci_dev *host_bridge)
+static void quirk_amd_780_apc_msi(struct pci_dev *host_bridge)
 {
 	struct pci_dev *apc_bridge;
 
@@ -2311,7 +2311,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8132_BRIDGE,
  * for the MCP55 NIC. It is not yet determined whether the msi problem
  * also affects other devices. As for now, turn off msi for this device.
  */
-static void __devinit nvenet_msi_disable(struct pci_dev *dev)
+static void nvenet_msi_disable(struct pci_dev *dev)
 {
 	const char *board_name = dmi_get_system_info(DMI_BOARD_NAME);
 
@@ -2337,7 +2337,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA,
  * we have it set correctly.
  * Note this is an undocumented register.
  */
-static void __devinit nvbridge_check_legacy_irq_routing(struct pci_dev *dev)
+static void nvbridge_check_legacy_irq_routing(struct pci_dev *dev)
 {
 	u32 cfg;
 
@@ -2573,11 +2573,11 @@ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, nv_msi_ht_cap_q
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, PCI_ANY_ID, nv_msi_ht_cap_quirk_all);
 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AL, PCI_ANY_ID, nv_msi_ht_cap_quirk_all);
 
-static void __devinit quirk_msi_intx_disable_bug(struct pci_dev *dev)
+static void quirk_msi_intx_disable_bug(struct pci_dev *dev)
 {
 	dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG;
 }
-static void __devinit quirk_msi_intx_disable_ati_bug(struct pci_dev *dev)
+static void quirk_msi_intx_disable_ati_bug(struct pci_dev *dev)
 {
 	struct pci_dev *p;
 
@@ -2651,7 +2651,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATTANSIC, 0x1083,
  * kernel fails to allocate resources when hotplug device is 
  * inserted and PCI bus is rescanned.
  */
-static void __devinit quirk_hotplug_bridge(struct pci_dev *dev)
+static void quirk_hotplug_bridge(struct pci_dev *dev)
 {
 	dev->is_hotplug_bridge = 1;
 }
@@ -2791,7 +2791,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x342e, vtd_mask_spec_errors);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x3c28, vtd_mask_spec_errors);
 #endif
 
-static void __devinit fixup_ti816x_class(struct pci_dev* dev)
+static void fixup_ti816x_class(struct pci_dev* dev)
 {
 	/* TI 816x devices do not have class code set when in PCIe boot mode */
 	dev_info(&dev->dev, "Setting PCI class for 816x PCIe device\n");
@@ -2803,7 +2803,7 @@ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_TI, 0xb800,
 /* Some PCIe devices do not work reliably with the claimed maximum
  * payload size supported.
  */
-static void __devinit fixup_mpss_256(struct pci_dev *dev)
+static void fixup_mpss_256(struct pci_dev *dev)
 {
 	dev->pcie_mpss = 1; /* 256 bytes */
 }
@@ -2821,7 +2821,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SOLARFLARE,
  * coalescing must be disabled.  Unfortunately, it cannot be re-enabled because
  * it is possible to hotplug a device with MPS of 256B.
  */
-static void __devinit quirk_intel_mc_errata(struct pci_dev *dev)
+static void quirk_intel_mc_errata(struct pci_dev *dev)
 {
 	int err;
 	u16 rcc;
@@ -2927,7 +2927,7 @@ static void fixup_debug_report(struct pci_dev *dev, ktime_t calltime,
  * This resolves crashes often seen on monitor unplug.
  */
 #define I915_DEIER_REG 0x4400c
-static void __devinit disable_igfx_irq(struct pci_dev *dev)
+static void disable_igfx_irq(struct pci_dev *dev)
 {
 	void __iomem *regs = pci_iomap(dev, 0, 0);
 	if (regs == NULL) {
@@ -2953,7 +2953,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq);
  * PCI_COMMAND_INTX_DISABLE works though they actually do not properly
  * support this feature.
  */
-static void __devinit quirk_broken_intx_masking(struct pci_dev *dev)
+static void quirk_broken_intx_masking(struct pci_dev *dev)
 {
 	dev->broken_intx_masking = 1;
 }
diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index 0aab85a..db542f4 100644
--- a/drivers/pci/xen-pcifront.c
+++ b/drivers/pci/xen-pcifront.c
@@ -412,7 +412,7 @@ static int pcifront_claim_resource(struct pci_dev *dev, void *data)
 	return 0;
 }
 
-static int __devinit pcifront_scan_bus(struct pcifront_device *pdev,
+static int pcifront_scan_bus(struct pcifront_device *pdev,
 				unsigned int domain, unsigned int bus,
 				struct pci_bus *b)
 {
@@ -441,7 +441,7 @@ static int __devinit pcifront_scan_bus(struct pcifront_device *pdev,
 	return 0;
 }
 
-static int __devinit pcifront_scan_root(struct pcifront_device *pdev,
+static int pcifront_scan_root(struct pcifront_device *pdev,
 				 unsigned int domain, unsigned int bus)
 {
 	struct pci_bus *b;
@@ -503,7 +503,7 @@ err_out:
 	return err;
 }
 
-static int __devinit pcifront_rescan_root(struct pcifront_device *pdev,
+static int pcifront_rescan_root(struct pcifront_device *pdev,
 				   unsigned int domain, unsigned int bus)
 {
 	int err;
@@ -834,7 +834,7 @@ out:
 	return err;
 }
 
-static int __devinit pcifront_try_connect(struct pcifront_device *pdev)
+static int pcifront_try_connect(struct pcifront_device *pdev)
 {
 	int err = -EFAULT;
 	int i, num_roots, len;
@@ -924,7 +924,7 @@ out:
 	return err;
 }
 
-static int __devinit pcifront_attach_devices(struct pcifront_device *pdev)
+static int pcifront_attach_devices(struct pcifront_device *pdev)
 {
 	int err = -EFAULT;
 	int i, num_roots, len;
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 9f99c59..eb9d5e9 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -687,7 +687,7 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
 int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int busmax);
 int pci_bus_update_busn_res_end(struct pci_bus *b, int busmax);
 void pci_bus_release_busn_res(struct pci_bus *b);
-struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus,
+struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,
 					     struct pci_ops *ops, void *sysdata,
 					     struct list_head *resources);
 struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
-- 
1.8.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 18:28:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 18:28:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaW5A-0001DM-0U; Mon, 19 Nov 2012 18:28:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <wfp5p@viridian.itc.virginia.edu>) id 1TaW58-0001Cb-C6
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 18:28:30 +0000
Received: from [193.109.254.147:44255] by server-11.bemta-14.messagelabs.com
	id 71/C9-29027-D4A7AA05; Mon, 19 Nov 2012 18:28:29 +0000
X-Env-Sender: wfp5p@viridian.itc.virginia.edu
X-Msg-Ref: server-11.tower-27.messagelabs.com!1353349694!4701320!1
X-Originating-IP: [128.143.12.139]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10421 invoked from network); 19 Nov 2012 18:28:15 -0000
Received: from viridian.itc.virginia.edu (HELO viridian.itc.virginia.edu)
	(128.143.12.139) by server-11.tower-27.messagelabs.com with SMTP;
	19 Nov 2012 18:28:15 -0000
Received: by viridian.itc.virginia.edu (Postfix, from userid 1249)
	id 4459D80369; Mon, 19 Nov 2012 13:27:37 -0500 (EST)
From: Bill Pemberton <wfp5p@virginia.edu>
To: gregkh@linuxfoundation.org
Date: Mon, 19 Nov 2012 13:23:11 -0500
Message-Id: <1353349642-3677-242-git-send-email-wfp5p@virginia.edu>
X-Mailer: git-send-email 1.8.0
In-Reply-To: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
Cc: linux-pci@vger.kernel.org, xen-devel@lists.xensource.com,
	virtualization@lists.linux-foundation.org
Subject: [Xen-devel] [PATCH 242/493] pci: remove use of __devinit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: linux-pci@vger.kernel.org 
Cc: xen-devel@lists.xensource.com 
Cc: virtualization@lists.linux-foundation.org 
---
 drivers/pci/ioapic.c           |   2 +-
 drivers/pci/pci.c              |   2 +-
 drivers/pci/pcie/aer/aerdrv.c  |   4 +-
 drivers/pci/pcie/portdrv_pci.c |   2 +-
 drivers/pci/probe.c            |  18 +++---
 drivers/pci/quirks.c           | 134 ++++++++++++++++++++---------------------
 drivers/pci/xen-pcifront.c     |  10 +--
 include/linux/pci.h            |   2 +-
 8 files changed, 87 insertions(+), 87 deletions(-)

diff --git a/drivers/pci/ioapic.c b/drivers/pci/ioapic.c
index 2b24fb4..4fdc61e 100644
--- a/drivers/pci/ioapic.c
+++ b/drivers/pci/ioapic.c
@@ -27,7 +27,7 @@ struct ioapic {
 	u32		gsi_base;
 };
 
-static int __devinit ioapic_probe(struct pci_dev *dev, const struct pci_device_id *ent)
+static int ioapic_probe(struct pci_dev *dev, const struct pci_device_id *ent)
 {
 	acpi_handle handle;
 	acpi_status status;
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index adffc6f..133ffd1 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3867,7 +3867,7 @@ static int __init pci_resource_alignment_sysfs_init(void)
 
 late_initcall(pci_resource_alignment_sysfs_init);
 
-static void __devinit pci_no_domains(void)
+static void pci_no_domains(void)
 {
 #ifdef CONFIG_PCI_DOMAINS
 	pci_domains_supported = 0;
diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c
index 030cf12..76ef634 100644
--- a/drivers/pci/pcie/aer/aerdrv.c
+++ b/drivers/pci/pcie/aer/aerdrv.c
@@ -41,7 +41,7 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
-static int __devinit aer_probe(struct pcie_device *dev);
+static int aer_probe(struct pcie_device *dev);
 static void aer_remove(struct pcie_device *dev);
 static pci_ers_result_t aer_error_detected(struct pci_dev *dev,
 	enum pci_channel_state error);
@@ -300,7 +300,7 @@ static void aer_remove(struct pcie_device *dev)
  *
  * Invoked when PCI Express bus loads AER service driver.
  */
-static int __devinit aer_probe(struct pcie_device *dev)
+static int aer_probe(struct pcie_device *dev)
 {
 	int status;
 	struct aer_rpc *rpc;
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index 0761d90..d4824cb 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -182,7 +182,7 @@ static const struct pci_device_id port_runtime_pm_black_list[] = {
  * this port device.
  *
  */
-static int __devinit pcie_portdrv_probe(struct pci_dev *dev,
+static int pcie_portdrv_probe(struct pci_dev *dev,
 					const struct pci_device_id *id)
 {
 	int status;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 3d17641..edc3d12 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -305,7 +305,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
 	}
 }
 
-static void __devinit pci_read_bridge_io(struct pci_bus *child)
+static void pci_read_bridge_io(struct pci_bus *child)
 {
 	struct pci_dev *dev = child->self;
 	u8 io_base_lo, io_limit_lo;
@@ -345,7 +345,7 @@ static void __devinit pci_read_bridge_io(struct pci_bus *child)
 	}
 }
 
-static void __devinit pci_read_bridge_mmio(struct pci_bus *child)
+static void pci_read_bridge_mmio(struct pci_bus *child)
 {
 	struct pci_dev *dev = child->self;
 	u16 mem_base_lo, mem_limit_lo;
@@ -367,7 +367,7 @@ static void __devinit pci_read_bridge_mmio(struct pci_bus *child)
 	}
 }
 
-static void __devinit pci_read_bridge_mmio_pref(struct pci_bus *child)
+static void pci_read_bridge_mmio_pref(struct pci_bus *child)
 {
 	struct pci_dev *dev = child->self;
 	u16 mem_base_lo, mem_limit_lo;
@@ -417,7 +417,7 @@ static void __devinit pci_read_bridge_mmio_pref(struct pci_bus *child)
 	}
 }
 
-void __devinit pci_read_bridge_bases(struct pci_bus *child)
+void pci_read_bridge_bases(struct pci_bus *child)
 {
 	struct pci_dev *dev = child->self;
 	struct resource *res;
@@ -705,7 +705,7 @@ static void pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max)
  * them, we proceed to assigning numbers to the remaining buses in
  * order to avoid overlaps between old and new bus numbers.
  */
-int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass)
+int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass)
 {
 	struct pci_bus *child;
 	int is_cardbus = (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS);
@@ -1587,7 +1587,7 @@ void pcie_bus_configure_settings(struct pci_bus *bus, u8 mpss)
 }
 EXPORT_SYMBOL_GPL(pcie_bus_configure_settings);
 
-unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus)
+unsigned int pci_scan_child_bus(struct pci_bus *bus)
 {
 	unsigned int devfn, pass, max = bus->busn_res.start;
 	struct pci_dev *dev;
@@ -1791,7 +1791,7 @@ void pci_bus_release_busn_res(struct pci_bus *b)
 			res, ret ? "can not be" : "is");
 }
 
-struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus,
+struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,
 		struct pci_ops *ops, void *sysdata, struct list_head *resources)
 {
 	struct pci_host_bridge_window *window;
@@ -1827,7 +1827,7 @@ struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus,
 EXPORT_SYMBOL(pci_scan_root_bus);
 
 /* Deprecated; use pci_scan_root_bus() instead */
-struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent,
+struct pci_bus *pci_scan_bus_parented(struct device *parent,
 		int bus, struct pci_ops *ops, void *sysdata)
 {
 	LIST_HEAD(resources);
@@ -1845,7 +1845,7 @@ struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent,
 }
 EXPORT_SYMBOL(pci_scan_bus_parented);
 
-struct pci_bus * __devinit pci_scan_bus(int bus, struct pci_ops *ops,
+struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops,
 					void *sysdata)
 {
 	LIST_HEAD(resources);
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 0c59f7a..ed4b0bd 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -37,7 +37,7 @@
  * key system devices. For devices that need to have mmio decoding always-on,
  * we need to set the dev->mmio_always_on bit.
  */
-static void __devinit quirk_mmio_always_on(struct pci_dev *dev)
+static void quirk_mmio_always_on(struct pci_dev *dev)
 {
 	dev->mmio_always_on = 1;
 }
@@ -48,7 +48,7 @@ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_ANY_ID, PCI_ANY_ID,
  * Mark this device with a broken_parity_status, to allow
  * PCI scanning code to "skip" this now blacklisted device.
  */
-static void __devinit quirk_mellanox_tavor(struct pci_dev *dev)
+static void quirk_mellanox_tavor(struct pci_dev *dev)
 {
 	dev->broken_parity_status = 1;	/* This device gives false positives */
 }
@@ -83,7 +83,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82441,	quirk_p
     This appears to be BIOS not version dependent. So presumably there is a 
     chipset level fix */
     
-static void __devinit quirk_isa_dma_hangs(struct pci_dev *dev)
+static void quirk_isa_dma_hangs(struct pci_dev *dev)
 {
 	if (!isa_dma_bridge_buggy) {
 		isa_dma_bridge_buggy=1;
@@ -106,7 +106,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC,	PCI_DEVICE_ID_NEC_CBUS_3,	quirk_isa_d
  * Intel NM10 "TigerPoint" LPC PM1a_STS.BM_STS must be clear
  * for some HT machines to use C4 w/o hanging.
  */
-static void __devinit quirk_tigerpoint_bm_sts(struct pci_dev *dev)
+static void quirk_tigerpoint_bm_sts(struct pci_dev *dev)
 {
 	u32 pmbase;
 	u16 pm1a;
@@ -125,7 +125,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TGP_LPC, quirk
 /*
  *	Chipsets where PCI->PCI transfers vanish or hang
  */
-static void __devinit quirk_nopcipci(struct pci_dev *dev)
+static void quirk_nopcipci(struct pci_dev *dev)
 {
 	if ((pci_pci_problems & PCIPCI_FAIL)==0) {
 		dev_info(&dev->dev, "Disabling direct PCI/PCI transfers\n");
@@ -135,7 +135,7 @@ static void __devinit quirk_nopcipci(struct pci_dev *dev)
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_5597,		quirk_nopcipci);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_496,		quirk_nopcipci);
 
-static void __devinit quirk_nopciamd(struct pci_dev *dev)
+static void quirk_nopciamd(struct pci_dev *dev)
 {
 	u8 rev;
 	pci_read_config_byte(dev, 0x08, &rev);
@@ -150,7 +150,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD,	PCI_DEVICE_ID_AMD_8151_0,	quirk_nopci
 /*
  *	Triton requires workarounds to be used by the drivers
  */
-static void __devinit quirk_triton(struct pci_dev *dev)
+static void quirk_triton(struct pci_dev *dev)
 {
 	if ((pci_pci_problems&PCIPCI_TRITON)==0) {
 		dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n");
@@ -229,7 +229,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8361,		quirk_viala
 /*
  *	VIA Apollo VP3 needs ETBF on BT848/878
  */
-static void __devinit quirk_viaetbf(struct pci_dev *dev)
+static void quirk_viaetbf(struct pci_dev *dev)
 {
 	if ((pci_pci_problems&PCIPCI_VIAETBF)==0) {
 		dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n");
@@ -238,7 +238,7 @@ static void __devinit quirk_viaetbf(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C597_0,	quirk_viaetbf);
 
-static void __devinit quirk_vsfx(struct pci_dev *dev)
+static void quirk_vsfx(struct pci_dev *dev)
 {
 	if ((pci_pci_problems&PCIPCI_VSFX)==0) {
 		dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n");
@@ -253,7 +253,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C576,	quirk_vsfx)
  *	workaround applied too
  *	[Info kindly provided by ALi]
  */	
-static void __devinit quirk_alimagik(struct pci_dev *dev)
+static void quirk_alimagik(struct pci_dev *dev)
 {
 	if ((pci_pci_problems&PCIPCI_ALIMAGIK)==0) {
 		dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n");
@@ -267,7 +267,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 	PCI_DEVICE_ID_AL_M1651, 	quirk_alimag
  *	Natoma has some interesting boundary conditions with Zoran stuff
  *	at least
  */
-static void __devinit quirk_natoma(struct pci_dev *dev)
+static void quirk_natoma(struct pci_dev *dev)
 {
 	if ((pci_pci_problems&PCIPCI_NATOMA)==0) {
 		dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n");
@@ -285,7 +285,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 	PCI_DEVICE_ID_INTEL_82443BX_2, 	qu
  *  This chip can cause PCI parity errors if config register 0xA0 is read
  *  while DMAs are occurring.
  */
-static void __devinit quirk_citrine(struct pci_dev *dev)
+static void quirk_citrine(struct pci_dev *dev)
 {
 	dev->cfg_size = 0xA0;
 }
@@ -295,7 +295,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM,	PCI_DEVICE_ID_IBM_CITRINE,	quirk_cit
  *  S3 868 and 968 chips report region size equal to 32M, but they decode 64M.
  *  If it's needed, re-allocate the region.
  */
-static void __devinit quirk_s3_64M(struct pci_dev *dev)
+static void quirk_s3_64M(struct pci_dev *dev)
 {
 	struct resource *r = &dev->resource[0];
 
@@ -313,7 +313,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_S3,	PCI_DEVICE_ID_S3_968,		quirk_s3_64M);
  * BAR0 should be 8 bytes; instead, it may be set to something like 8k
  * (which conflicts w/ BAR1's memory range).
  */
-static void __devinit quirk_cs5536_vsa(struct pci_dev *dev)
+static void quirk_cs5536_vsa(struct pci_dev *dev)
 {
 	if (pci_resource_len(dev, 0) != 8) {
 		struct resource *res = &dev->resource[0];
@@ -324,7 +324,7 @@ static void __devinit quirk_cs5536_vsa(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_ISA, quirk_cs5536_vsa);
 
-static void __devinit quirk_io_region(struct pci_dev *dev, unsigned region,
+static void quirk_io_region(struct pci_dev *dev, unsigned region,
 	unsigned size, int nr, const char *name)
 {
 	region &= ~(size-1);
@@ -352,7 +352,7 @@ static void __devinit quirk_io_region(struct pci_dev *dev, unsigned region,
  *	ATI Northbridge setups MCE the processor if you even
  *	read somewhere between 0x3b0->0x3bb or read 0x3d3
  */
-static void __devinit quirk_ati_exploding_mce(struct pci_dev *dev)
+static void quirk_ati_exploding_mce(struct pci_dev *dev)
 {
 	dev_info(&dev->dev, "ATI Northbridge, reserving I/O ports 0x3b0 to 0x3bb\n");
 	/* Mae rhaid i ni beidio ag edrych ar y lleoliadiau I/O hyn */
@@ -372,7 +372,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI,	PCI_DEVICE_ID_ATI_RS100,   quirk_ati_
  *	0xE0 (64 bytes of ACPI registers)
  *	0xE2 (32 bytes of SMB registers)
  */
-static void __devinit quirk_ali7101_acpi(struct pci_dev *dev)
+static void quirk_ali7101_acpi(struct pci_dev *dev)
 {
 	u16 region;
 
@@ -440,7 +440,7 @@ static void piix4_mem_quirk(struct pci_dev *dev, const char *name, unsigned int
  *	0x90 (16 bytes of SMB registers)
  * and a few strange programmable PIIX4 device resources.
  */
-static void __devinit quirk_piix4_acpi(struct pci_dev *dev)
+static void quirk_piix4_acpi(struct pci_dev *dev)
 {
 	u32 region, res_a;
 
@@ -489,7 +489,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82443MX_3,	qui
  *	0x40 (128 bytes of ACPI, GPIO & TCO registers)
  *	0x58 (64 bytes of GPIO I/O space)
  */
-static void __devinit quirk_ich4_lpc_acpi(struct pci_dev *dev)
+static void quirk_ich4_lpc_acpi(struct pci_dev *dev)
 {
 	u32 region;
 	u8 enable;
@@ -531,7 +531,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_82801DB_12,
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_82801EB_0,		quirk_ich4_lpc_acpi);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_ESB_1,		quirk_ich4_lpc_acpi);
 
-static void __devinit ich6_lpc_acpi_gpio(struct pci_dev *dev)
+static void ich6_lpc_acpi_gpio(struct pci_dev *dev)
 {
 	u32 region;
 	u8 enable;
@@ -555,7 +555,7 @@ static void __devinit ich6_lpc_acpi_gpio(struct pci_dev *dev)
 	}
 }
 
-static void __devinit ich6_lpc_generic_decode(struct pci_dev *dev, unsigned reg, const char *name, int dynsize)
+static void ich6_lpc_generic_decode(struct pci_dev *dev, unsigned reg, const char *name, int dynsize)
 {
 	u32 val;
 	u32 size, base;
@@ -583,7 +583,7 @@ static void __devinit ich6_lpc_generic_decode(struct pci_dev *dev, unsigned reg,
 	dev_info(&dev->dev, "%s PIO at %04x-%04x\n", name, base, base+size-1);
 }
 
-static void __devinit quirk_ich6_lpc(struct pci_dev *dev)
+static void quirk_ich6_lpc(struct pci_dev *dev)
 {
 	/* Shared ACPI/GPIO decode with all ICH6+ */
 	ich6_lpc_acpi_gpio(dev);
@@ -595,7 +595,7 @@ static void __devinit quirk_ich6_lpc(struct pci_dev *dev)
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_ICH6_0, quirk_ich6_lpc);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_ICH6_1, quirk_ich6_lpc);
 
-static void __devinit ich7_lpc_generic_decode(struct pci_dev *dev, unsigned reg, const char *name)
+static void ich7_lpc_generic_decode(struct pci_dev *dev, unsigned reg, const char *name)
 {
 	u32 val;
 	u32 mask, base;
@@ -619,7 +619,7 @@ static void __devinit ich7_lpc_generic_decode(struct pci_dev *dev, unsigned reg,
 }
 
 /* ICH7-10 has the same common LPC generic IO decode registers */
-static void __devinit quirk_ich7_lpc(struct pci_dev *dev)
+static void quirk_ich7_lpc(struct pci_dev *dev)
 {
 	/* We share the common ACPI/GPIO decode with ICH6 */
 	ich6_lpc_acpi_gpio(dev);
@@ -648,7 +648,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_ICH10_1, qui
  * VIA ACPI: One IO region pointed to by longword at
  *	0x48 or 0x20 (256 bytes of ACPI registers)
  */
-static void __devinit quirk_vt82c586_acpi(struct pci_dev *dev)
+static void quirk_vt82c586_acpi(struct pci_dev *dev)
 {
 	u32 region;
 
@@ -666,7 +666,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C586_3,	quirk_vt
  *	0x70 (128 bytes of hardware monitoring register)
  *	0x90 (16 bytes of SMB registers)
  */
-static void __devinit quirk_vt82c686_acpi(struct pci_dev *dev)
+static void quirk_vt82c686_acpi(struct pci_dev *dev)
 {
 	u16 hm;
 	u32 smb;
@@ -688,7 +688,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C686_4,	quirk_vt
  *	0x88 (128 bytes of power management registers)
  *	0xd0 (16 bytes of SMB registers)
  */
-static void __devinit quirk_vt8235_acpi(struct pci_dev *dev)
+static void quirk_vt8235_acpi(struct pci_dev *dev)
 {
 	u16 pm, smb;
 
@@ -706,7 +706,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8235,	quirk_vt8235
  * TI XIO2000a PCIe-PCI Bridge erroneously reports it supports fast back-to-back:
  *	Disable fast back-to-back on the secondary bus segment
  */
-static void __devinit quirk_xio2000a(struct pci_dev *dev)
+static void quirk_xio2000a(struct pci_dev *dev)
 {
 	struct pci_dev *pdev;
 	u16 command;
@@ -780,7 +780,7 @@ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8237,		quirk
  * noapic specified. For the moment we assume it's the erratum. We may be wrong
  * of course. However the advice is demonstrably good even if so..
  */
-static void __devinit quirk_amd_ioapic(struct pci_dev *dev)
+static void quirk_amd_ioapic(struct pci_dev *dev)
 {
 	if (dev->revision >= 0x02) {
 		dev_warn(&dev->dev, "I/O APIC: AMD Erratum #22 may be present. In the event of instability try\n");
@@ -789,7 +789,7 @@ static void __devinit quirk_amd_ioapic(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD,	PCI_DEVICE_ID_AMD_VIPER_7410,	quirk_amd_ioapic);
 
-static void __devinit quirk_ioapic_rmw(struct pci_dev *dev)
+static void quirk_ioapic_rmw(struct pci_dev *dev)
 {
 	if (dev->devfn == 0 && dev->bus->number == 0)
 		sis_apic_bug = 1;
@@ -801,7 +801,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI,	PCI_ANY_ID,			quirk_ioapic_rmw);
  * Some settings of MMRBC can lead to data corruption so block changes.
  * See AMD 8131 HyperTransport PCI-X Tunnel Revision Guide
  */
-static void __devinit quirk_amd_8131_mmrbc(struct pci_dev *dev)
+static void quirk_amd_8131_mmrbc(struct pci_dev *dev)
 {
 	if (dev->subordinate && dev->revision <= 0x12) {
 		dev_info(&dev->dev, "AMD8131 rev %x detected; "
@@ -819,7 +819,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_
  * value of the ACPI SCI interrupt is only done for convenience.
  *	-jgarzik
  */
-static void __devinit quirk_via_acpi(struct pci_dev *d)
+static void quirk_via_acpi(struct pci_dev *d)
 {
 	/*
 	 * VIA ACPI device: SCI IRQ line in PCI config byte 0x42
@@ -926,7 +926,7 @@ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_vlink);
  * We need to switch it off to be able to recognize the real
  * type of the chip.
  */
-static void __devinit quirk_vt82c598_id(struct pci_dev *dev)
+static void quirk_vt82c598_id(struct pci_dev *dev)
 {
 	pci_write_config_byte(dev, 0xfc, 0);
 	pci_read_config_word(dev, PCI_DEVICE_ID, &dev->device);
@@ -978,7 +978,7 @@ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD,	PCI_DEVICE_ID_AMD_FE_GATE_700C
  *	assigned to it. We force a larger allocation to ensure that
  *	nothing gets put too close to it.
  */
-static void __devinit quirk_dunord ( struct pci_dev * dev )
+static void quirk_dunord ( struct pci_dev * dev )
 {
 	struct resource *r = &dev->resource [1];
 	r->start = 0;
@@ -992,7 +992,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_DUNORD,	PCI_DEVICE_ID_DUNORD_I3000,	quirk
  * in the ProgIf. Unfortunately, the ProgIf value is wrong - 0x80
  * instead of 0x01.
  */
-static void __devinit quirk_transparent_bridge(struct pci_dev *dev)
+static void quirk_transparent_bridge(struct pci_dev *dev)
 {
 	dev->transparent = 1;
 }
@@ -1066,7 +1066,7 @@ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SATA
 /*
  *	Serverworks CSB5 IDE does not fully support native mode
  */
-static void __devinit quirk_svwks_csb5ide(struct pci_dev *pdev)
+static void quirk_svwks_csb5ide(struct pci_dev *pdev)
 {
 	u8 prog;
 	pci_read_config_byte(pdev, PCI_CLASS_PROG, &prog);
@@ -1082,7 +1082,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB
 /*
  *	Intel 82801CAM ICH3-M datasheet says IDE modes must be the same
  */
-static void __devinit quirk_ide_samemode(struct pci_dev *pdev)
+static void quirk_ide_samemode(struct pci_dev *pdev)
 {
 	u8 prog;
 
@@ -1101,7 +1101,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_10, qui
  * Some ATA devices break if put into D3
  */
 
-static void __devinit quirk_no_ata_d3(struct pci_dev *pdev)
+static void quirk_no_ata_d3(struct pci_dev *pdev)
 {
 	pdev->dev_flags |= PCI_DEV_FLAGS_NO_D3;
 }
@@ -1121,7 +1121,7 @@ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_VIA, PCI_ANY_ID,
 /* This was originally an Alpha specific thing, but it really fits here.
  * The i82375 PCI/EISA bridge appears as non-classified. Fix that.
  */
-static void __devinit quirk_eisa_bridge(struct pci_dev *dev)
+static void quirk_eisa_bridge(struct pci_dev *dev)
 {
 	dev->class = PCI_CLASS_BRIDGE_EISA << 8;
 }
@@ -1155,7 +1155,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82375,	quirk_e
  */
 static int asus_hides_smbus;
 
-static void __devinit asus_hides_smbus_hostbridge(struct pci_dev *dev)
+static void asus_hides_smbus_hostbridge(struct pci_dev *dev)
 {
 	if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK)) {
 		if (dev->device == PCI_DEVICE_ID_INTEL_82845_HB)
@@ -1538,7 +1538,7 @@ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB3
 #endif
 
 #ifdef CONFIG_X86_IO_APIC
-static void __devinit quirk_alder_ioapic(struct pci_dev *pdev)
+static void quirk_alder_ioapic(struct pci_dev *pdev)
 {
 	int i;
 
@@ -1561,7 +1561,7 @@ static void __devinit quirk_alder_ioapic(struct pci_dev *pdev)
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_EESSC,	quirk_alder_ioapic);
 #endif
 
-static void __devinit quirk_pcie_mch(struct pci_dev *pdev)
+static void quirk_pcie_mch(struct pci_dev *pdev)
 {
 	pci_msi_off(pdev);
 	pdev->no_msi = 1;
@@ -1575,7 +1575,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_E7525_MCH,	quir
  * It's possible for the MSI to get corrupted if shpc and acpi
  * are used together on certain PXH-based systems.
  */
-static void __devinit quirk_pcie_pxh(struct pci_dev *dev)
+static void quirk_pcie_pxh(struct pci_dev *dev)
 {
 	pci_msi_off(dev);
 	dev->no_msi = 1;
@@ -1777,7 +1777,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AMD,   PCI_DEVICE_ID_AMD_8111_SMBUS, 	qui
  * but the PIO transfers won't work if BAR0 falls at the odd 8 bytes.
  * Re-allocate the region if needed...
  */
-static void __devinit quirk_tc86c001_ide(struct pci_dev *dev)
+static void quirk_tc86c001_ide(struct pci_dev *dev)
 {
 	struct resource *r = &dev->resource[0];
 
@@ -1797,7 +1797,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TOSHIBA_2,
  * The BAR0 or BAR1 region may be disabled (size 0) or enabled (size 128).
  * Re-allocate the regions to a 256-byte boundary if necessary.
  */
-static void __devinit quirk_plx_pci9050(struct pci_dev *dev)
+static void quirk_plx_pci9050(struct pci_dev *dev)
 {
 	unsigned int bar;
 
@@ -1829,7 +1829,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
 DECLARE_PCI_FIXUP_HEADER(0x1402, 0x2000, quirk_plx_pci9050);
 DECLARE_PCI_FIXUP_HEADER(0x1402, 0x2600, quirk_plx_pci9050);
 
-static void __devinit quirk_netmos(struct pci_dev *dev)
+static void quirk_netmos(struct pci_dev *dev)
 {
 	unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4;
 	unsigned int num_serial = dev->subsystem_device & 0xf;
@@ -1867,7 +1867,7 @@ static void __devinit quirk_netmos(struct pci_dev *dev)
 DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_NETMOS, PCI_ANY_ID,
 			 PCI_CLASS_COMMUNICATION_SERIAL, 8, quirk_netmos);
 
-static void __devinit quirk_e100_interrupt(struct pci_dev *dev)
+static void quirk_e100_interrupt(struct pci_dev *dev)
 {
 	u16 command, pmcsr;
 	u8 __iomem *csr;
@@ -1940,7 +1940,7 @@ DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_INTEL, PCI_ANY_ID,
  * The 82575 and 82598 may experience data corruption issues when transitioning
  * out of L0S.  To prevent this we need to disable L0S on the pci-e link
  */
-static void __devinit quirk_disable_aspm_l0s(struct pci_dev *dev)
+static void quirk_disable_aspm_l0s(struct pci_dev *dev)
 {
 	dev_info(&dev->dev, "Disabling L0s\n");
 	pci_disable_link_state(dev, PCIE_LINK_STATE_L0S);
@@ -1960,7 +1960,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10f1, quirk_disable_aspm_l0s);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10f4, quirk_disable_aspm_l0s);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1508, quirk_disable_aspm_l0s);
 
-static void __devinit fixup_rev1_53c810(struct pci_dev* dev)
+static void fixup_rev1_53c810(struct pci_dev* dev)
 {
 	/* rev 1 ncr53c810 chips don't set the class at all which means
 	 * they don't get their resources remapped. Fix that here.
@@ -1974,7 +1974,7 @@ static void __devinit fixup_rev1_53c810(struct pci_dev* dev)
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, fixup_rev1_53c810);
 
 /* Enable 1k I/O space granularity on the Intel P64H2 */
-static void __devinit quirk_p64h2_1k_io(struct pci_dev *dev)
+static void quirk_p64h2_1k_io(struct pci_dev *dev)
 {
 	u16 en1k;
 
@@ -2007,7 +2007,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA,  PCI_DEVICE_ID_NVIDIA_CK804_PCIE,
 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_NVIDIA,  PCI_DEVICE_ID_NVIDIA_CK804_PCIE,
 			quirk_nvidia_ck804_pcie_aer_ext_cap);
 
-static void __devinit quirk_via_cx700_pci_parking_caching(struct pci_dev *dev)
+static void quirk_via_cx700_pci_parking_caching(struct pci_dev *dev)
 {
 	/*
 	 * Disable PCI Bus Parking and PCI Master read caching on CX700
@@ -2070,7 +2070,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, 0x324e, quirk_via_cx700_pci_parking_c
  * We believe that it is legal to read beyond the end tag and
  * therefore the solution is to limit the read/write length.
  */
-static void __devinit quirk_brcm_570x_limit_vpd(struct pci_dev *dev)
+static void quirk_brcm_570x_limit_vpd(struct pci_dev *dev)
 {
 	/*
 	 * Only disable the VPD capability for 5706, 5706S, 5708,
@@ -2130,7 +2130,7 @@ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_BROADCOM,
  * the DRBs - this is where we expose device 6.
  * http://www.x86-secret.com/articles/tweak/pat/patsecrets-2.htm
  */
-static void __devinit quirk_unhide_mch_dev6(struct pci_dev *dev)
+static void quirk_unhide_mch_dev6(struct pci_dev *dev)
 {
 	u8 reg;
 
@@ -2154,7 +2154,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82875_HB,
  * supports link speed auto negotiation, but falsely sets
  * the link speed to 5GT/s.
  */
-static void __devinit quirk_tile_plx_gen1(struct pci_dev *dev)
+static void quirk_tile_plx_gen1(struct pci_dev *dev)
 {
 	if (tile_plx_gen1) {
 		pci_write_config_dword(dev, 0x98, 0x1);
@@ -2171,7 +2171,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8624, quirk_tile_plx_gen1);
  * aware of it.  Instead of setting the flag on all busses in the
  * machine, simply disable MSI globally.
  */
-static void __devinit quirk_disable_all_msi(struct pci_dev *dev)
+static void quirk_disable_all_msi(struct pci_dev *dev)
 {
 	pci_no_msi();
 	dev_warn(&dev->dev, "MSI quirk detected; MSI disabled\n");
@@ -2185,7 +2185,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3364, quirk_disab
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8380_0, quirk_disable_all_msi);
 
 /* Disable MSI on chipsets that are known to not support it */
-static void __devinit quirk_disable_msi(struct pci_dev *dev)
+static void quirk_disable_msi(struct pci_dev *dev)
 {
 	if (dev->subordinate) {
 		dev_warn(&dev->dev, "MSI quirk detected; "
@@ -2203,7 +2203,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x5a3f, quirk_disable_msi);
  * we use the possible vendor/device IDs of the host bridge for the
  * declared quirk, and search for the APC bridge by slot number.
  */
-static void __devinit quirk_amd_780_apc_msi(struct pci_dev *host_bridge)
+static void quirk_amd_780_apc_msi(struct pci_dev *host_bridge)
 {
 	struct pci_dev *apc_bridge;
 
@@ -2311,7 +2311,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8132_BRIDGE,
  * for the MCP55 NIC. It is not yet determined whether the msi problem
  * also affects other devices. As for now, turn off msi for this device.
  */
-static void __devinit nvenet_msi_disable(struct pci_dev *dev)
+static void nvenet_msi_disable(struct pci_dev *dev)
 {
 	const char *board_name = dmi_get_system_info(DMI_BOARD_NAME);
 
@@ -2337,7 +2337,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA,
  * we have it set correctly.
  * Note this is an undocumented register.
  */
-static void __devinit nvbridge_check_legacy_irq_routing(struct pci_dev *dev)
+static void nvbridge_check_legacy_irq_routing(struct pci_dev *dev)
 {
 	u32 cfg;
 
@@ -2573,11 +2573,11 @@ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, nv_msi_ht_cap_q
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, PCI_ANY_ID, nv_msi_ht_cap_quirk_all);
 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AL, PCI_ANY_ID, nv_msi_ht_cap_quirk_all);
 
-static void __devinit quirk_msi_intx_disable_bug(struct pci_dev *dev)
+static void quirk_msi_intx_disable_bug(struct pci_dev *dev)
 {
 	dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG;
 }
-static void __devinit quirk_msi_intx_disable_ati_bug(struct pci_dev *dev)
+static void quirk_msi_intx_disable_ati_bug(struct pci_dev *dev)
 {
 	struct pci_dev *p;
 
@@ -2651,7 +2651,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATTANSIC, 0x1083,
  * kernel fails to allocate resources when hotplug device is 
  * inserted and PCI bus is rescanned.
  */
-static void __devinit quirk_hotplug_bridge(struct pci_dev *dev)
+static void quirk_hotplug_bridge(struct pci_dev *dev)
 {
 	dev->is_hotplug_bridge = 1;
 }
@@ -2791,7 +2791,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x342e, vtd_mask_spec_errors);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x3c28, vtd_mask_spec_errors);
 #endif
 
-static void __devinit fixup_ti816x_class(struct pci_dev* dev)
+static void fixup_ti816x_class(struct pci_dev* dev)
 {
 	/* TI 816x devices do not have class code set when in PCIe boot mode */
 	dev_info(&dev->dev, "Setting PCI class for 816x PCIe device\n");
@@ -2803,7 +2803,7 @@ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_TI, 0xb800,
 /* Some PCIe devices do not work reliably with the claimed maximum
  * payload size supported.
  */
-static void __devinit fixup_mpss_256(struct pci_dev *dev)
+static void fixup_mpss_256(struct pci_dev *dev)
 {
 	dev->pcie_mpss = 1; /* 256 bytes */
 }
@@ -2821,7 +2821,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SOLARFLARE,
  * coalescing must be disabled.  Unfortunately, it cannot be re-enabled because
  * it is possible to hotplug a device with MPS of 256B.
  */
-static void __devinit quirk_intel_mc_errata(struct pci_dev *dev)
+static void quirk_intel_mc_errata(struct pci_dev *dev)
 {
 	int err;
 	u16 rcc;
@@ -2927,7 +2927,7 @@ static void fixup_debug_report(struct pci_dev *dev, ktime_t calltime,
  * This resolves crashes often seen on monitor unplug.
  */
 #define I915_DEIER_REG 0x4400c
-static void __devinit disable_igfx_irq(struct pci_dev *dev)
+static void disable_igfx_irq(struct pci_dev *dev)
 {
 	void __iomem *regs = pci_iomap(dev, 0, 0);
 	if (regs == NULL) {
@@ -2953,7 +2953,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq);
  * PCI_COMMAND_INTX_DISABLE works though they actually do not properly
  * support this feature.
  */
-static void __devinit quirk_broken_intx_masking(struct pci_dev *dev)
+static void quirk_broken_intx_masking(struct pci_dev *dev)
 {
 	dev->broken_intx_masking = 1;
 }
diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index 0aab85a..db542f4 100644
--- a/drivers/pci/xen-pcifront.c
+++ b/drivers/pci/xen-pcifront.c
@@ -412,7 +412,7 @@ static int pcifront_claim_resource(struct pci_dev *dev, void *data)
 	return 0;
 }
 
-static int __devinit pcifront_scan_bus(struct pcifront_device *pdev,
+static int pcifront_scan_bus(struct pcifront_device *pdev,
 				unsigned int domain, unsigned int bus,
 				struct pci_bus *b)
 {
@@ -441,7 +441,7 @@ static int __devinit pcifront_scan_bus(struct pcifront_device *pdev,
 	return 0;
 }
 
-static int __devinit pcifront_scan_root(struct pcifront_device *pdev,
+static int pcifront_scan_root(struct pcifront_device *pdev,
 				 unsigned int domain, unsigned int bus)
 {
 	struct pci_bus *b;
@@ -503,7 +503,7 @@ err_out:
 	return err;
 }
 
-static int __devinit pcifront_rescan_root(struct pcifront_device *pdev,
+static int pcifront_rescan_root(struct pcifront_device *pdev,
 				   unsigned int domain, unsigned int bus)
 {
 	int err;
@@ -834,7 +834,7 @@ out:
 	return err;
 }
 
-static int __devinit pcifront_try_connect(struct pcifront_device *pdev)
+static int pcifront_try_connect(struct pcifront_device *pdev)
 {
 	int err = -EFAULT;
 	int i, num_roots, len;
@@ -924,7 +924,7 @@ out:
 	return err;
 }
 
-static int __devinit pcifront_attach_devices(struct pcifront_device *pdev)
+static int pcifront_attach_devices(struct pcifront_device *pdev)
 {
 	int err = -EFAULT;
 	int i, num_roots, len;
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 9f99c59..eb9d5e9 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -687,7 +687,7 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
 int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int busmax);
 int pci_bus_update_busn_res_end(struct pci_bus *b, int busmax);
 void pci_bus_release_busn_res(struct pci_bus *b);
-struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus,
+struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,
 					     struct pci_ops *ops, void *sysdata,
 					     struct list_head *resources);
 struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
-- 
1.8.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 19:10:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 19:10:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaWjO-00027o-QT; Mon, 19 Nov 2012 19:10:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <wfp5p@viridian.itc.virginia.edu>) id 1TaW4d-00013s-1p
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 18:28:00 +0000
Received: from [85.158.139.83:13645] by server-6.bemta-5.messagelabs.com id
	20/34-19321-E2A7AA05; Mon, 19 Nov 2012 18:27:58 +0000
X-Env-Sender: wfp5p@viridian.itc.virginia.edu
X-Msg-Ref: server-10.tower-182.messagelabs.com!1353349660!28601668!1
X-Originating-IP: [128.143.12.139]
X-SpamReason: No, hits=2.2 required=7.0 tests=BIZ_TLD,BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8645 invoked from network); 19 Nov 2012 18:27:40 -0000
Received: from viridian.itc.virginia.edu (HELO viridian.itc.virginia.edu)
	(128.143.12.139) by server-10.tower-182.messagelabs.com with SMTP;
	19 Nov 2012 18:27:40 -0000
Received: by viridian.itc.virginia.edu (Postfix, from userid 1249)
	id 4042D80318; Mon, 19 Nov 2012 13:27:32 -0500 (EST)
From: Bill Pemberton <wfp5p@virginia.edu>
To: gregkh@linuxfoundation.org
Date: Mon, 19 Nov 2012 13:21:47 -0500
Message-Id: <1353349642-3677-158-git-send-email-wfp5p@virginia.edu>
X-Mailer: git-send-email 1.8.0
In-Reply-To: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
X-Mailman-Approved-At: Mon, 19 Nov 2012 19:10:06 +0000
Cc: linux-fbdev@vger.kernel.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	virtualization@lists.linux-foundation.org,
	Michal Januszewski <spock@gentoo.org>, Paul Mackerras <paulus@samba.org>,
	linux-nvidia@lists.surfsouth.com, Daniel Walker <dwalker@fifo99.com>,
	Kukjin Kim <kgene.kim@samsung.com>, Russell King <linux@arm.linux.org.uk>,
	Wan ZongShun <mcuos.com@gmail.com>,
	Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
	Jingoo Han <jg1.han@samsung.com>, Tomi Valkeinen <tomi.valkeinen@ti.com>,
	David Brown <davidb@codeaurora.org>,
	Jaya Kumar <jayalk@intworks.biz>, cbe-oss-dev@lists.ozlabs.org,
	Antonino Daplas <adaplas@gmail.com>, linux-arm-msm@vger.kernel.org,
	Thomas Winischhofer <thomas@winischhofer.net>,
	linux-geode@lists.infradead.org, linux-samsung-soc@vger.kernel.org,
	Ben Dooks <ben-linux@fluff.org>, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Maik Broemme <mbroemme@plusserver.de>, Geoff Levand <geoff@infradead.org>,
	Ferenc Bakonyi <fero@drama.obuda.kando.hu>,
	Tony Prisk <linux@prisktech.co.nz>, Bryan Huntsman <bryanh@codeaurora.org>,
	Kristoffer Ericson <kristoffer.ericson@gmail.com>,
	linuxppc-dev@lists.ozlabs.org, xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH 158/493] video: remove use of __devinit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> 
Cc: Jaya Kumar <jayalk@intworks.biz> 
Cc: Paul Mackerras <paulus@samba.org> 
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> 
Cc: Russell King <linux@arm.linux.org.uk> 
Cc: Jingoo Han <jg1.han@samsung.com> 
Cc: Ferenc Bakonyi <fero@drama.obuda.kando.hu> 
Cc: Antonino Daplas <adaplas@gmail.com> 
Cc: Maik Broemme <mbroemme@plusserver.de> 
Cc: David Brown <davidb@codeaurora.org> 
Cc: Daniel Walker <dwalker@fifo99.com> 
Cc: Bryan Huntsman <bryanh@codeaurora.org> 
Cc: Wan ZongShun <mcuos.com@gmail.com> 
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> 
Cc: Geoff Levand <geoff@infradead.org> 
Cc: Kristoffer Ericson <kristoffer.ericson@gmail.com> 
Cc: Ben Dooks <ben-linux@fluff.org> 
Cc: Kukjin Kim <kgene.kim@samsung.com> 
Cc: Thomas Winischhofer <thomas@winischhofer.net> 
Cc: Michal Januszewski <spock@gentoo.org> 
Cc: Tony Prisk <linux@prisktech.co.nz> 
Cc: linux-fbdev@vger.kernel.org 
Cc: linux-arm-kernel@lists.infradead.org 
Cc: linux-geode@lists.infradead.org 
Cc: linux-nvidia@lists.surfsouth.com 
Cc: linux-arm-msm@vger.kernel.org 
Cc: linux-omap@vger.kernel.org 
Cc: linuxppc-dev@lists.ozlabs.org 
Cc: cbe-oss-dev@lists.ozlabs.org 
Cc: linux-samsung-soc@vger.kernel.org 
Cc: xen-devel@lists.xensource.com 
Cc: virtualization@lists.linux-foundation.org 
---
 drivers/video/acornfb.c                            | 14 ++--
 drivers/video/arcfb.c                              |  2 +-
 drivers/video/arkfb.c                              |  2 +-
 drivers/video/asiliantfb.c                         |  6 +-
 drivers/video/aty/aty128fb.c                       | 22 +++---
 drivers/video/aty/atyfb_base.c                     | 22 +++---
 drivers/video/aty/mach64_ct.c                      |  4 +-
 drivers/video/aty/mach64_cursor.c                  |  2 +-
 drivers/video/aty/radeon_base.c                    | 14 ++--
 drivers/video/aty/radeon_monitor.c                 | 16 ++---
 drivers/video/au1100fb.c                           |  2 +-
 drivers/video/au1200fb.c                           |  2 +-
 drivers/video/auo_k1900fb.c                        |  2 +-
 drivers/video/auo_k1901fb.c                        |  2 +-
 drivers/video/auo_k190x.c                          |  2 +-
 drivers/video/bf537-lq035.c                        |  6 +-
 drivers/video/bf54x-lq043fb.c                      |  2 +-
 drivers/video/bfin-lq035q1-fb.c                    |  6 +-
 drivers/video/bfin-t350mcqb-fb.c                   |  2 +-
 drivers/video/bfin_adv7393fb.c                     |  2 +-
 drivers/video/broadsheetfb.c                       |  8 +--
 drivers/video/bw2.c                                |  6 +-
 drivers/video/carminefb.c                          |  4 +-
 drivers/video/cg14.c                               |  4 +-
 drivers/video/cg3.c                                |  8 +--
 drivers/video/cg6.c                                |  8 +--
 drivers/video/chipsfb.c                            |  4 +-
 drivers/video/cirrusfb.c                           | 10 +--
 drivers/video/cobalt_lcdfb.c                       |  2 +-
 drivers/video/console/sticore.c                    | 47 ++++++-------
 drivers/video/cyber2000fb.c                        | 12 ++--
 drivers/video/da8xx-fb.c                           |  2 +-
 drivers/video/dnfb.c                               |  2 +-
 drivers/video/ep93xx-fb.c                          |  4 +-
 drivers/video/exynos/exynos_dp_core.c              |  2 +-
 drivers/video/ffb.c                                |  2 +-
 drivers/video/fm2fb.c                              |  4 +-
 drivers/video/fsl-diu-fb.c                         |  4 +-
 drivers/video/gbefb.c                              |  4 +-
 drivers/video/geode/gx1fb_core.c                   |  6 +-
 drivers/video/geode/gxfb_core.c                    | 10 +--
 drivers/video/geode/lxfb_core.c                    | 10 +--
 drivers/video/grvga.c                              |  4 +-
 drivers/video/gxt4500.c                            |  4 +-
 drivers/video/hecubafb.c                           |  2 +-
 drivers/video/hgafb.c                              |  4 +-
 drivers/video/hitfb.c                              |  2 +-
 drivers/video/hpfb.c                               |  4 +-
 drivers/video/i740fb.c                             |  4 +-
 drivers/video/i810/i810_main.c                     | 26 +++----
 drivers/video/i810/i810_main.h                     |  2 +-
 drivers/video/imsttfb.c                            |  4 +-
 drivers/video/intelfb/intelfbdrv.c                 | 16 ++---
 drivers/video/jz4740_fb.c                          |  2 +-
 drivers/video/kyro/fbdev.c                         |  2 +-
 drivers/video/leo.c                                |  2 +-
 drivers/video/mb862xx/mb862xxfbdrv.c               |  6 +-
 drivers/video/mbx/mbxdebugfs.c                     |  2 +-
 drivers/video/mbx/mbxfb.c                          | 10 +--
 drivers/video/metronomefb.c                        | 12 ++--
 drivers/video/msm/mddi.c                           |  6 +-
 drivers/video/mxsfb.c                              |  6 +-
 drivers/video/neofb.c                              | 12 ++--
 drivers/video/nuc900fb.c                           |  4 +-
 drivers/video/nvidia/nvidia.c                      | 12 ++--
 .../omap2/displays/panel-lgphilips-lb035q02.c      |  2 +-
 drivers/video/p9100.c                              |  2 +-
 drivers/video/platinumfb.c                         |  6 +-
 drivers/video/pm2fb.c                              |  2 +-
 drivers/video/pm3fb.c                              |  4 +-
 drivers/video/pmag-ba-fb.c                         |  2 +-
 drivers/video/pmagb-b-fb.c                         |  6 +-
 drivers/video/ps3fb.c                              |  2 +-
 drivers/video/pvr2fb.c                             |  6 +-
 drivers/video/pxa168fb.c                           |  4 +-
 drivers/video/pxa3xx-gcu.c                         |  2 +-
 drivers/video/pxafb.c                              | 20 +++---
 drivers/video/q40fb.c                              |  2 +-
 drivers/video/riva/fbdev.c                         | 20 +++---
 drivers/video/riva/rivafb-i2c.c                    |  6 +-
 drivers/video/s1d13xxxfb.c                         |  4 +-
 drivers/video/s3c-fb.c                             |  6 +-
 drivers/video/s3c2410fb.c                          |  8 +--
 drivers/video/s3fb.c                               |  6 +-
 drivers/video/sa1100fb.c                           |  6 +-
 drivers/video/savage/savagefb_driver.c             |  8 +--
 drivers/video/sgivwfb.c                            |  2 +-
 drivers/video/sh7760fb.c                           |  2 +-
 drivers/video/sh_mobile_lcdcfb.c                   | 16 ++---
 drivers/video/sh_mobile_meram.c                    |  2 +-
 drivers/video/sis/sis_main.c                       | 82 +++++++++++-----------
 drivers/video/skeletonfb.c                         |  2 +-
 drivers/video/sm501fb.c                            |  8 +--
 drivers/video/sstfb.c                              | 18 ++---
 drivers/video/sunxvr1000.c                         |  6 +-
 drivers/video/sunxvr2500.c                         |  6 +-
 drivers/video/sunxvr500.c                          |  6 +-
 drivers/video/tcx.c                                |  2 +-
 drivers/video/tdfxfb.c                             | 10 +--
 drivers/video/tgafb.c                              | 16 ++---
 drivers/video/tmiofb.c                             |  2 +-
 drivers/video/tridentfb.c                          |  8 +--
 drivers/video/uvesafb.c                            | 30 ++++----
 drivers/video/vermilion/vermilion.c                |  2 +-
 drivers/video/vfb.c                                |  2 +-
 drivers/video/vga16fb.c                            |  2 +-
 drivers/video/via/dvi.c                            |  8 +--
 drivers/video/via/dvi.h                            |  4 +-
 drivers/video/via/hw.c                             | 16 ++---
 drivers/video/via/hw.h                             |  4 +-
 drivers/video/via/lcd.c                            | 10 +--
 drivers/video/via/lcd.h                            |  6 +-
 drivers/video/via/via-core.c                       | 10 +--
 drivers/video/via/via-gpio.c                       |  2 +-
 drivers/video/via/viafbdev.c                       | 10 +--
 drivers/video/vt8500lcdfb.c                        |  2 +-
 drivers/video/vt8623fb.c                           |  2 +-
 drivers/video/w100fb.c                             |  6 +-
 drivers/video/wm8505fb.c                           |  2 +-
 drivers/video/wmt_ge_rops.c                        |  2 +-
 drivers/video/xen-fbfront.c                        |  4 +-
 drivers/video/xilinxfb.c                           |  2 +-
 122 files changed, 438 insertions(+), 443 deletions(-)

diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c
index b303f17..772f1ce 100644
--- a/drivers/video/acornfb.c
+++ b/drivers/video/acornfb.c
@@ -942,7 +942,7 @@ static struct fb_videomode acornfb_default_mode __devinitdata = {
 	.vmode =	FB_VMODE_NONINTERLACED
 };
 
-static void __devinit acornfb_init_fbinfo(void)
+static void acornfb_init_fbinfo(void)
 {
 	static int first = 1;
 
@@ -1018,7 +1018,7 @@ static void __devinit acornfb_init_fbinfo(void)
  *	size can optionally be followed by 'M' or 'K' for
  *	MB or KB respectively.
  */
-static void __devinit acornfb_parse_mon(char *opt)
+static void acornfb_parse_mon(char *opt)
 {
 	char *p = opt;
 
@@ -1065,7 +1065,7 @@ bad:
 	current_par.montype = -1;
 }
 
-static void __devinit acornfb_parse_montype(char *opt)
+static void acornfb_parse_montype(char *opt)
 {
 	current_par.montype = -2;
 
@@ -1106,7 +1106,7 @@ static void __devinit acornfb_parse_montype(char *opt)
 	}
 }
 
-static void __devinit acornfb_parse_dram(char *opt)
+static void acornfb_parse_dram(char *opt)
 {
 	unsigned int size;
 
@@ -1138,7 +1138,7 @@ static struct options {
 	{ NULL, NULL }
 };
 
-static int __devinit acornfb_setup(char *options)
+static int acornfb_setup(char *options)
 {
 	struct options *optp;
 	char *opt;
@@ -1175,7 +1175,7 @@ static int __devinit acornfb_setup(char *options)
  * Detect type of monitor connected
  *  For now, we just assume SVGA
  */
-static int __devinit acornfb_detect_monitortype(void)
+static int acornfb_detect_monitortype(void)
 {
 	return 4;
 }
@@ -1216,7 +1216,7 @@ free_unused_pages(unsigned int virtual_start, unsigned int virtual_end)
 	printk("acornfb: freed %dK memory\n", mb_freed);
 }
 
-static int __devinit acornfb_probe(struct platform_device *dev)
+static int acornfb_probe(struct platform_device *dev)
 {
 	unsigned long size;
 	u_int h_sync, v_sync;
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index 00967d2..964431a 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -502,7 +502,7 @@ static struct fb_ops arcfb_ops = {
 	.fb_ioctl 	= arcfb_ioctl,
 };
 
-static int __devinit arcfb_probe(struct platform_device *dev)
+static int arcfb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	int retval = -ENOMEM;
diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c
index 6bcb6c1..750efbc 100644
--- a/drivers/video/arkfb.c
+++ b/drivers/video/arkfb.c
@@ -950,7 +950,7 @@ static struct fb_ops arkfb_ops = {
 
 
 /* PCI probe */
-static int __devinit ark_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
+static int ark_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 {
 	struct pci_bus_region bus_reg;
 	struct resource vga_res;
diff --git a/drivers/video/asiliantfb.c b/drivers/video/asiliantfb.c
index 640cc69..21744e9 100644
--- a/drivers/video/asiliantfb.c
+++ b/drivers/video/asiliantfb.c
@@ -451,7 +451,7 @@ static struct chips_init_reg chips_init_xr[] =
 	{0xd1, 0x01},
 };
 
-static void __devinit chips_hw_init(struct fb_info *p)
+static void chips_hw_init(struct fb_info *p)
 {
 	int i;
 
@@ -504,7 +504,7 @@ static struct fb_var_screeninfo asiliantfb_var __devinitdata = {
 	.vsync_len 	= 2,
 };
 
-static int __devinit init_asiliant(struct fb_info *p, unsigned long addr)
+static int init_asiliant(struct fb_info *p, unsigned long addr)
 {
 	int err;
 
@@ -535,7 +535,7 @@ static int __devinit init_asiliant(struct fb_info *p, unsigned long addr)
 	return 0;
 }
 
-static int __devinit
+static int
 asiliantfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
 {
 	unsigned long addr, size;
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index 426e3f2..d9f88cc 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -449,9 +449,9 @@ static int aty128_encode_var(struct fb_var_screeninfo *var,
 static int aty128_decode_var(struct fb_var_screeninfo *var,
                              struct aty128fb_par *par);
 #if 0
-static void __devinit aty128_get_pllinfo(struct aty128fb_par *par,
+static void aty128_get_pllinfo(struct aty128fb_par *par,
 					 void __iomem *bios);
-static void __devinit __iomem *aty128_map_ROM(struct pci_dev *pdev,
+static void __iomem *aty128_map_ROM(struct pci_dev *pdev,
 					      const struct aty128fb_par *par);
 #endif
 static void aty128_timings(struct aty128fb_par *par);
@@ -582,7 +582,7 @@ static void aty_pll_writeupdate(const struct aty128fb_par *par)
 
 
 /* write to the scratch register to test r/w functionality */
-static int __devinit register_test(const struct aty128fb_par *par)
+static int register_test(const struct aty128fb_par *par)
 {
 	u32 val;
 	int flag = 0;
@@ -781,7 +781,7 @@ static u32 depth_to_dst(u32 depth)
 
 
 #ifndef __sparc__
-static void __iomem * __devinit aty128_map_ROM(const struct aty128fb_par *par,
+static void __iomem *aty128_map_ROM(const struct aty128fb_par *par,
 					       struct pci_dev *dev)
 {
 	u16 dptr;
@@ -868,7 +868,7 @@ static void __iomem * __devinit aty128_map_ROM(const struct aty128fb_par *par,
 	return NULL;
 }
 
-static void __devinit aty128_get_pllinfo(struct aty128fb_par *par,
+static void aty128_get_pllinfo(struct aty128fb_par *par,
 					 unsigned char __iomem *bios)
 {
 	unsigned int bios_hdr;
@@ -891,7 +891,7 @@ static void __devinit aty128_get_pllinfo(struct aty128fb_par *par,
 }           
 
 #ifdef CONFIG_X86
-static void __iomem *  __devinit aty128_find_mem_vbios(struct aty128fb_par *par)
+static void __iomem *aty128_find_mem_vbios(struct aty128fb_par *par)
 {
 	/* I simplified this code as we used to miss the signatures in
 	 * a lot of case. It's now closer to XFree, we just don't check
@@ -916,7 +916,7 @@ static void __iomem *  __devinit aty128_find_mem_vbios(struct aty128fb_par *par)
 #endif /* ndef(__sparc__) */
 
 /* fill in known card constants if pll_block is not available */
-static void __devinit aty128_timings(struct aty128fb_par *par)
+static void aty128_timings(struct aty128fb_par *par)
 {
 #ifdef CONFIG_PPC_OF
 	/* instead of a table lookup, assume OF has properly
@@ -1658,7 +1658,7 @@ static int aty128fb_sync(struct fb_info *info)
 }
 
 #ifndef MODULE
-static int __devinit aty128fb_setup(char *options)
+static int aty128fb_setup(char *options)
 {
 	char *this_opt;
 
@@ -1888,7 +1888,7 @@ static void aty128_early_resume(void *data)
 }
 #endif /* CONFIG_PPC_PMAC */
 
-static int __devinit aty128_init(struct pci_dev *pdev,
+static int aty128_init(struct pci_dev *pdev,
 				 const struct pci_device_id *ent)
 {
 	struct fb_info *info = pci_get_drvdata(pdev);
@@ -2039,7 +2039,7 @@ static int __devinit aty128_init(struct pci_dev *pdev,
 
 #ifdef CONFIG_PCI
 /* register a card    ++ajoshi */
-static int __devinit aty128_probe(struct pci_dev *pdev,
+static int aty128_probe(struct pci_dev *pdev,
 				  const struct pci_device_id *ent)
 {
 	unsigned long fb_addr, reg_addr;
@@ -2558,7 +2558,7 @@ static int aty128_pci_resume(struct pci_dev *pdev)
 }
 
 
-static int __devinit aty128fb_init(void)
+static int aty128fb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index bab571b..ae75dd3 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -426,7 +426,7 @@ static struct {
 #endif /* CONFIG_FB_ATY_CT */
 };
 
-static int __devinit correct_chipset(struct atyfb_par *par)
+static int correct_chipset(struct atyfb_par *par)
 {
 	u8 rev;
 	u16 type;
@@ -588,7 +588,7 @@ static u32 atyfb_get_pixclock(struct fb_var_screeninfo *var,
  * Apple monitor sense
  */
 
-static int __devinit read_aty_sense(const struct atyfb_par *par)
+static int read_aty_sense(const struct atyfb_par *par)
 {
 	int sense, i;
 
@@ -2273,7 +2273,7 @@ static void aty_bl_exit(struct backlight_device *bd)
 
 #endif /* CONFIG_FB_ATY_BACKLIGHT */
 
-static void __devinit aty_calc_mem_refresh(struct atyfb_par *par, int xclk)
+static void aty_calc_mem_refresh(struct atyfb_par *par, int xclk)
 {
 	const int ragepro_tbl[] = {
 		44, 50, 55, 66, 75, 80, 100
@@ -2307,7 +2307,7 @@ static void __devinit aty_calc_mem_refresh(struct atyfb_par *par, int xclk)
 static struct fb_info *fb_list = NULL;
 
 #if defined(__i386__) && defined(CONFIG_FB_ATY_GENERIC_LCD)
-static int __devinit atyfb_get_timings_from_lcd(struct atyfb_par *par,
+static int atyfb_get_timings_from_lcd(struct atyfb_par *par,
 						struct fb_var_screeninfo *var)
 {
 	int ret = -EINVAL;
@@ -2333,7 +2333,7 @@ static int __devinit atyfb_get_timings_from_lcd(struct atyfb_par *par,
 }
 #endif /* defined(__i386__) && defined(CONFIG_FB_ATY_GENERIC_LCD) */
 
-static int __devinit aty_init(struct fb_info *info)
+static int aty_init(struct fb_info *info)
 {
 	struct atyfb_par *par = (struct atyfb_par *) info->par;
 	const char *ramname = NULL, *xtal;
@@ -2787,7 +2787,7 @@ aty_init_exit:
 }
 
 #if defined(CONFIG_ATARI) && !defined(MODULE)
-static int __devinit store_video_par(char *video_str, unsigned char m64_num)
+static int store_video_par(char *video_str, unsigned char m64_num)
 {
 	char *p;
 	unsigned long vmembase, size, guiregbase;
@@ -2961,7 +2961,7 @@ static int atyfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
 
 #ifdef __sparc__
 
-static int __devinit atyfb_setup_sparc(struct pci_dev *pdev,
+static int atyfb_setup_sparc(struct pci_dev *pdev,
 				       struct fb_info *info,
 				       unsigned long addr)
 {
@@ -3161,7 +3161,7 @@ static int __devinit atyfb_setup_sparc(struct pci_dev *pdev,
 
 #ifdef __i386__
 #ifdef CONFIG_FB_ATY_GENERIC_LCD
-static void __devinit aty_init_lcd(struct atyfb_par *par, u32 bios_base)
+static void aty_init_lcd(struct atyfb_par *par, u32 bios_base)
 {
 	u32 driv_inf_tab, sig;
 	u16 lcd_ofs;
@@ -3392,7 +3392,7 @@ static void __devinit aty_init_lcd(struct atyfb_par *par, u32 bios_base)
 }
 #endif /* CONFIG_FB_ATY_GENERIC_LCD */
 
-static int __devinit init_from_bios(struct atyfb_par *par)
+static int init_from_bios(struct atyfb_par *par)
 {
 	u32 bios_base, rom_addr;
 	int ret;
@@ -3445,7 +3445,7 @@ static int __devinit init_from_bios(struct atyfb_par *par)
 }
 #endif /* __i386__ */
 
-static int __devinit atyfb_setup_generic(struct pci_dev *pdev,
+static int atyfb_setup_generic(struct pci_dev *pdev,
 					 struct fb_info *info,
 					 unsigned long addr)
 {
@@ -3525,7 +3525,7 @@ atyfb_setup_generic_fail:
 
 #endif /* !__sparc__ */
 
-static int __devinit atyfb_pci_probe(struct pci_dev *pdev,
+static int atyfb_pci_probe(struct pci_dev *pdev,
 				     const struct pci_device_id *ent)
 {
 	unsigned long addr, res_start, res_size;
diff --git a/drivers/video/aty/mach64_ct.c b/drivers/video/aty/mach64_ct.c
index 2745b85..31dd017 100644
--- a/drivers/video/aty/mach64_ct.c
+++ b/drivers/video/aty/mach64_ct.c
@@ -373,7 +373,7 @@ void aty_set_pll_ct(const struct fb_info *info, const union aty_pll *pll)
 #endif
 }
 
-static void __devinit aty_get_pll_ct(const struct fb_info *info,
+static void aty_get_pll_ct(const struct fb_info *info,
 				     union aty_pll *pll)
 {
 	struct atyfb_par *par = (struct atyfb_par *) info->par;
@@ -397,7 +397,7 @@ static void __devinit aty_get_pll_ct(const struct fb_info *info,
 	}
 }
 
-static int __devinit aty_init_pll_ct(const struct fb_info *info,
+static int aty_init_pll_ct(const struct fb_info *info,
 				     union aty_pll *pll)
 {
 	struct atyfb_par *par = (struct atyfb_par *) info->par;
diff --git a/drivers/video/aty/mach64_cursor.c b/drivers/video/aty/mach64_cursor.c
index 46f72ed..95ec042 100644
--- a/drivers/video/aty/mach64_cursor.c
+++ b/drivers/video/aty/mach64_cursor.c
@@ -183,7 +183,7 @@ static int atyfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
 	return 0;
 }
 
-int __devinit aty_init_cursor(struct fb_info *info)
+int aty_init_cursor(struct fb_info *info)
 {
 	unsigned long addr;
 
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index dacaa4e..7687179 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -293,7 +293,7 @@ static void radeon_unmap_ROM(struct radeonfb_info *rinfo, struct pci_dev *dev)
 	pci_unmap_rom(dev, rinfo->bios_seg);
 }
 
-static int __devinit radeon_map_ROM(struct radeonfb_info *rinfo, struct pci_dev *dev)
+static int radeon_map_ROM(struct radeonfb_info *rinfo, struct pci_dev *dev)
 {
 	void __iomem *rom;
 	u16 dptr;
@@ -388,7 +388,7 @@ static int __devinit radeon_map_ROM(struct radeonfb_info *rinfo, struct pci_dev
 }
 
 #ifdef CONFIG_X86
-static int  __devinit radeon_find_mem_vbios(struct radeonfb_info *rinfo)
+static int  radeon_find_mem_vbios(struct radeonfb_info *rinfo)
 {
 	/* I simplified this code as we used to miss the signatures in
 	 * a lot of case. It's now closer to XFree, we just don't check
@@ -423,7 +423,7 @@ static int  __devinit radeon_find_mem_vbios(struct radeonfb_info *rinfo)
  * Read XTAL (ref clock), SCLK and MCLK from Open Firmware device
  * tree. Hopefully, ATI OF driver is kind enough to fill these
  */
-static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo)
+static int radeon_read_xtal_OF (struct radeonfb_info *rinfo)
 {
 	struct device_node *dp = rinfo->of_node;
 	const u32 *val;
@@ -453,7 +453,7 @@ static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo)
 /*
  * Read PLL infos from chip registers
  */
-static int __devinit radeon_probe_pll_params(struct radeonfb_info *rinfo)
+static int radeon_probe_pll_params(struct radeonfb_info *rinfo)
 {
 	unsigned char ppll_div_sel;
 	unsigned Ns, Nm, M;
@@ -591,7 +591,7 @@ static int __devinit radeon_probe_pll_params(struct radeonfb_info *rinfo)
 /*
  * Retrieve PLL infos by different means (BIOS, Open Firmware, register probing...)
  */
-static void __devinit radeon_get_pllinfo(struct radeonfb_info *rinfo)
+static void radeon_get_pllinfo(struct radeonfb_info *rinfo)
 {
 	/*
 	 * In the case nothing works, these are defaults; they are mostly
@@ -1868,7 +1868,7 @@ static struct fb_ops radeonfb_ops = {
 };
 
 
-static int __devinit radeon_set_fbinfo (struct radeonfb_info *rinfo)
+static int radeon_set_fbinfo (struct radeonfb_info *rinfo)
 {
 	struct fb_info *info = rinfo->info;
 
@@ -2143,7 +2143,7 @@ static struct bin_attribute edid2_attr = {
 };
 
 
-static int __devinit radeonfb_pci_register (struct pci_dev *pdev,
+static int radeonfb_pci_register (struct pci_dev *pdev,
 				  const struct pci_device_id *ent)
 {
 	struct fb_info *info;
diff --git a/drivers/video/aty/radeon_monitor.c b/drivers/video/aty/radeon_monitor.c
index 5c23eac..d6d861b 100644
--- a/drivers/video/aty/radeon_monitor.c
+++ b/drivers/video/aty/radeon_monitor.c
@@ -62,7 +62,7 @@ static char *radeon_get_mon_name(int type)
  * models with broken OF probing by hard-coding known EDIDs for some Mac
  * laptops internal LVDS panel. (XXX: not done yet)
  */
-static int __devinit radeon_parse_montype_prop(struct device_node *dp, u8 **out_EDID,
+static int radeon_parse_montype_prop(struct device_node *dp, u8 **out_EDID,
 					       int hdno)
 {
         static char *propnames[] = { "DFP,EDID", "LCD,EDID", "EDID",
@@ -115,7 +115,7 @@ static int __devinit radeon_parse_montype_prop(struct device_node *dp, u8 **out_
 	return mt;
 }
 
-static int __devinit radeon_probe_OF_head(struct radeonfb_info *rinfo, int head_no,
+static int radeon_probe_OF_head(struct radeonfb_info *rinfo, int head_no,
 					  u8 **out_EDID)
 {
         struct device_node *dp;
@@ -163,7 +163,7 @@ static int __devinit radeon_probe_OF_head(struct radeonfb_info *rinfo, int head_
 #endif /* CONFIG_PPC_OF || CONFIG_SPARC */
 
 
-static int __devinit radeon_get_panel_info_BIOS(struct radeonfb_info *rinfo)
+static int radeon_get_panel_info_BIOS(struct radeonfb_info *rinfo)
 {
 	unsigned long tmp, tmp0;
 	char stmp[30];
@@ -251,7 +251,7 @@ static int __devinit radeon_get_panel_info_BIOS(struct radeonfb_info *rinfo)
  * doesn't quite work yet, but it's output is still useful for
  * debugging
  */
-static void __devinit radeon_parse_connector_info(struct radeonfb_info *rinfo)
+static void radeon_parse_connector_info(struct radeonfb_info *rinfo)
 {
 	int offset, chips, connectors, tmp, i, conn, type;
 
@@ -297,7 +297,7 @@ static void __devinit radeon_parse_connector_info(struct radeonfb_info *rinfo)
  * as well and currently is only implemented for the CRT DAC, the
  * code for the TVDAC is commented out in XFree as "non working"
  */
-static int __devinit radeon_crt_is_connected(struct radeonfb_info *rinfo, int is_crt_dac)
+static int radeon_crt_is_connected(struct radeonfb_info *rinfo, int is_crt_dac)
 {
     int	          connected = 0;
 
@@ -369,7 +369,7 @@ static int __devinit radeon_crt_is_connected(struct radeonfb_info *rinfo, int is
  * Parse the "monitor_layout" string if any. This code is mostly
  * copied from XFree's radeon driver
  */
-static int __devinit radeon_parse_monitor_layout(struct radeonfb_info *rinfo,
+static int radeon_parse_monitor_layout(struct radeonfb_info *rinfo,
 						 const char *monitor_layout)
 {
 	char s1[5], s2[5];
@@ -433,7 +433,7 @@ static int __devinit radeon_parse_monitor_layout(struct radeonfb_info *rinfo,
  * try to retrieve EDID. The algorithm here comes from XFree's radeon
  * driver
  */
-void __devinit radeon_probe_screens(struct radeonfb_info *rinfo,
+void radeon_probe_screens(struct radeonfb_info *rinfo,
 				    const char *monitor_layout, int ignore_edid)
 {
 #ifdef CONFIG_FB_RADEON_I2C
@@ -753,7 +753,7 @@ static int is_powerblade(const char *model)
  * Build the modedb for head 1 (head 2 will come later), check panel infos
  * from either BIOS or EDID, and pick up the default mode
  */
-void __devinit radeon_check_modes(struct radeonfb_info *rinfo, const char *mode_option)
+void radeon_check_modes(struct radeonfb_info *rinfo, const char *mode_option)
 {
 	struct fb_info * info = rinfo->info;
 	int has_default_mode = 0;
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c
index fe3b6ec..b4b76dc 100644
--- a/drivers/video/au1100fb.c
+++ b/drivers/video/au1100fb.c
@@ -469,7 +469,7 @@ static int au1100fb_setup(struct au1100fb_device *fbdev)
 	return 0;
 }
 
-static int __devinit au1100fb_drv_probe(struct platform_device *dev)
+static int au1100fb_drv_probe(struct platform_device *dev)
 {
 	struct au1100fb_device *fbdev = NULL;
 	struct resource *regs_res;
diff --git a/drivers/video/au1200fb.c b/drivers/video/au1200fb.c
index 4538b07..b270a5c 100644
--- a/drivers/video/au1200fb.c
+++ b/drivers/video/au1200fb.c
@@ -1673,7 +1673,7 @@ out:
 }
 
 /* AU1200 LCD controller device driver */
-static int __devinit au1200fb_drv_probe(struct platform_device *dev)
+static int au1200fb_drv_probe(struct platform_device *dev)
 {
 	struct au1200fb_device *fbdev;
 	struct au1200fb_platdata *pd;
diff --git a/drivers/video/auo_k1900fb.c b/drivers/video/auo_k1900fb.c
index 1581dbf..46ec47b 100644
--- a/drivers/video/auo_k1900fb.c
+++ b/drivers/video/auo_k1900fb.c
@@ -156,7 +156,7 @@ static bool auok1900fb_need_refresh(struct auok190xfb_par *par)
 	return (par->update_cnt > 10);
 }
 
-static int __devinit auok1900fb_probe(struct platform_device *pdev)
+static int auok1900fb_probe(struct platform_device *pdev)
 {
 	struct auok190x_init_data init;
 	struct auok190x_board *board;
diff --git a/drivers/video/auo_k1901fb.c b/drivers/video/auo_k1901fb.c
index 94a0e01..9eb7eeb 100644
--- a/drivers/video/auo_k1901fb.c
+++ b/drivers/video/auo_k1901fb.c
@@ -209,7 +209,7 @@ static bool auok1901fb_need_refresh(struct auok190xfb_par *par)
 	return (par->update_cnt > 10);
 }
 
-static int __devinit auok1901fb_probe(struct platform_device *pdev)
+static int auok1901fb_probe(struct platform_device *pdev)
 {
 	struct auok190x_init_data init;
 	struct auok190x_board *board;
diff --git a/drivers/video/auo_k190x.c b/drivers/video/auo_k190x.c
index c03ecdd..70aa5d4 100644
--- a/drivers/video/auo_k190x.c
+++ b/drivers/video/auo_k190x.c
@@ -773,7 +773,7 @@ EXPORT_SYMBOL_GPL(auok190x_pm);
  * Common probe and remove code
  */
 
-int __devinit auok190x_common_probe(struct platform_device *pdev,
+int auok190x_common_probe(struct platform_device *pdev,
 				    struct auok190x_init_data *init)
 {
 	struct auok190x_board *board = init->board;
diff --git a/drivers/video/bf537-lq035.c b/drivers/video/bf537-lq035.c
index 8081c7b..0b7c757 100644
--- a/drivers/video/bf537-lq035.c
+++ b/drivers/video/bf537-lq035.c
@@ -87,7 +87,7 @@ static void set_vcomm(void)
 		pr_err("i2c_smbus_write_byte_data fail: %d\n", nr);
 }
 
-static int __devinit ad5280_probe(struct i2c_client *client,
+static int ad5280_probe(struct i2c_client *client,
 				  const struct i2c_device_id *id)
 {
 	int ret;
@@ -360,7 +360,7 @@ static int config_dma(void)
 	return 0;
 }
 
-static int __devinit request_ports(void)
+static int request_ports(void)
 {
 	u16 tmr_req[] = TIMERS;
 
@@ -686,7 +686,7 @@ static struct lcd_ops bfin_lcd_ops = {
 
 static struct lcd_device *lcd_dev;
 
-static int __devinit bfin_lq035_probe(struct platform_device *pdev)
+static int bfin_lq035_probe(struct platform_device *pdev)
 {
 	struct backlight_properties props;
 	dma_addr_t dma_handle;
diff --git a/drivers/video/bf54x-lq043fb.c b/drivers/video/bf54x-lq043fb.c
index aff8520..9f72580 100644
--- a/drivers/video/bf54x-lq043fb.c
+++ b/drivers/video/bf54x-lq043fb.c
@@ -497,7 +497,7 @@ static irqreturn_t bfin_bf54x_irq_error(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static int __devinit bfin_bf54x_probe(struct platform_device *pdev)
+static int bfin_bf54x_probe(struct platform_device *pdev)
 {
 #ifndef NO_BL_SUPPORT
 	struct backlight_properties props;
diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c
index acd438c..353fb7c 100644
--- a/drivers/video/bfin-lq035q1-fb.c
+++ b/drivers/video/bfin-lq035q1-fb.c
@@ -137,7 +137,7 @@ static int lq035q1_control(struct spi_device *spi, unsigned char reg, unsigned s
 	return ret;
 }
 
-static int __devinit lq035q1_spidev_probe(struct spi_device *spi)
+static int lq035q1_spidev_probe(struct spi_device *spi)
 {
 	int ret;
 	struct spi_control *ctl;
@@ -358,7 +358,7 @@ static inline void bfin_lq035q1_free_ports(unsigned ppi16)
 		gpio_free(P_IDENT(P_PPI0_FS3));
 }
 
-static int __devinit bfin_lq035q1_request_ports(struct platform_device *pdev,
+static int bfin_lq035q1_request_ports(struct platform_device *pdev,
 						unsigned ppi16)
 {
 	int ret;
@@ -555,7 +555,7 @@ static irqreturn_t bfin_lq035q1_irq_error(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static int __devinit bfin_lq035q1_probe(struct platform_device *pdev)
+static int bfin_lq035q1_probe(struct platform_device *pdev)
 {
 	struct bfin_lq035q1fb_info *info;
 	struct fb_info *fbinfo;
diff --git a/drivers/video/bfin-t350mcqb-fb.c b/drivers/video/bfin-t350mcqb-fb.c
index c753abd..9456865 100644
--- a/drivers/video/bfin-t350mcqb-fb.c
+++ b/drivers/video/bfin-t350mcqb-fb.c
@@ -418,7 +418,7 @@ static irqreturn_t bfin_t350mcqb_irq_error(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev)
+static int bfin_t350mcqb_probe(struct platform_device *pdev)
 {
 #ifndef NO_BL_SUPPORT
 	struct backlight_properties props;
diff --git a/drivers/video/bfin_adv7393fb.c b/drivers/video/bfin_adv7393fb.c
index a32ef5a..85e9659 100644
--- a/drivers/video/bfin_adv7393fb.c
+++ b/drivers/video/bfin_adv7393fb.c
@@ -368,7 +368,7 @@ adv7393_write_proc(struct file *file, const char __user * buffer,
 	return count;
 }
 
-static int __devinit bfin_adv7393_fb_probe(struct i2c_client *client,
+static int bfin_adv7393_fb_probe(struct i2c_client *client,
 					   const struct i2c_device_id *id)
 {
 	int ret = 0;
diff --git a/drivers/video/broadsheetfb.c b/drivers/video/broadsheetfb.c
index 377dde3..bd15a9b 100644
--- a/drivers/video/broadsheetfb.c
+++ b/drivers/video/broadsheetfb.c
@@ -774,7 +774,7 @@ static DEVICE_ATTR(loadstore_waveform, S_IWUSR, NULL,
 			broadsheet_loadstore_waveform);
 
 /* upper level functions that manipulate the display and other stuff */
-static void __devinit broadsheet_init_display(struct broadsheetfb_par *par)
+static void broadsheet_init_display(struct broadsheetfb_par *par)
 {
 	u16 args[5];
 	int xres = par->info->var.xres;
@@ -834,7 +834,7 @@ static void __devinit broadsheet_init_display(struct broadsheetfb_par *par)
 	par->board->wait_for_rdy(par);
 }
 
-static void __devinit broadsheet_identify(struct broadsheetfb_par *par)
+static void broadsheet_identify(struct broadsheetfb_par *par)
 {
 	u16 rev, prc;
 	struct device *dev = par->info->device;
@@ -849,7 +849,7 @@ static void __devinit broadsheet_identify(struct broadsheetfb_par *par)
 		dev_warn(dev, "Unrecognized Broadsheet Revision\n");
 }
 
-static void __devinit broadsheet_init(struct broadsheetfb_par *par)
+static void broadsheet_init(struct broadsheetfb_par *par)
 {
 	broadsheet_send_command(par, BS_CMD_INIT_SYS_RUN);
 	/* the controller needs a second */
@@ -1058,7 +1058,7 @@ static struct fb_deferred_io broadsheetfb_defio = {
 	.deferred_io	= broadsheetfb_dpy_deferred_io,
 };
 
-static int __devinit broadsheetfb_probe(struct platform_device *dev)
+static int broadsheetfb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	struct broadsheet_board *board;
diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c
index bc88682..21a8587 100644
--- a/drivers/video/bw2.c
+++ b/drivers/video/bw2.c
@@ -179,7 +179,7 @@ static int bw2_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
  *  Initialisation
  */
 
-static void __devinit bw2_init_fix(struct fb_info *info, int linebytes)
+static void bw2_init_fix(struct fb_info *info, int linebytes)
 {
 	strlcpy(info->fix.id, "bwtwo", sizeof(info->fix.id));
 
@@ -226,7 +226,7 @@ static u8 bw2regs_66hz[] __devinitdata = {
 	0x10, 0x20,	0
 };
 
-static int __devinit bw2_do_default_mode(struct bw2_par *par,
+static int bw2_do_default_mode(struct bw2_par *par,
 					 struct fb_info *info,
 					 int *linebytes)
 {
@@ -273,7 +273,7 @@ static int __devinit bw2_do_default_mode(struct bw2_par *par,
 	return 0;
 }
 
-static int __devinit bw2_probe(struct platform_device *op)
+static int bw2_probe(struct platform_device *op)
 {
 	struct device_node *dp = op->dev.of_node;
 	struct fb_info *info;
diff --git a/drivers/video/carminefb.c b/drivers/video/carminefb.c
index 27561cc..9d9eb08 100644
--- a/drivers/video/carminefb.c
+++ b/drivers/video/carminefb.c
@@ -537,7 +537,7 @@ static struct fb_ops carminefb_ops = {
 	.fb_setcolreg	= carmine_setcolreg,
 };
 
-static int __devinit alloc_carmine_fb(void __iomem *regs, void __iomem *smem_base,
+static int alloc_carmine_fb(void __iomem *regs, void __iomem *smem_base,
 		int smem_offset, struct device *device, struct fb_info **rinfo)
 {
 	int ret;
@@ -606,7 +606,7 @@ static void cleanup_fb_device(struct fb_info *info)
 	}
 }
 
-static int __devinit carminefb_probe(struct pci_dev *dev,
+static int carminefb_probe(struct pci_dev *dev,
 		const struct pci_device_id *ent)
 {
 	struct carmine_hw *hw;
diff --git a/drivers/video/cg14.c b/drivers/video/cg14.c
index 6889f0c..e9d80c1 100644
--- a/drivers/video/cg14.c
+++ b/drivers/video/cg14.c
@@ -352,7 +352,7 @@ static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
  *  Initialisation
  */
 
-static void __devinit cg14_init_fix(struct fb_info *info, int linebytes,
+static void cg14_init_fix(struct fb_info *info, int linebytes,
 				    struct device_node *dp)
 {
 	const char *name = dp->name;
@@ -463,7 +463,7 @@ static void cg14_unmap_regs(struct platform_device *op, struct fb_info *info,
 			   info->screen_base, info->fix.smem_len);
 }
 
-static int __devinit cg14_probe(struct platform_device *op)
+static int cg14_probe(struct platform_device *op)
 {
 	struct device_node *dp = op->dev.of_node;
 	struct fb_info *info;
diff --git a/drivers/video/cg3.c b/drivers/video/cg3.c
index 0bd94d4..6102d57 100644
--- a/drivers/video/cg3.c
+++ b/drivers/video/cg3.c
@@ -243,7 +243,7 @@ static int cg3_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
  *  Initialisation
  */
 
-static void __devinit cg3_init_fix(struct fb_info *info, int linebytes,
+static void cg3_init_fix(struct fb_info *info, int linebytes,
 				   struct device_node *dp)
 {
 	strlcpy(info->fix.id, dp->name, sizeof(info->fix.id));
@@ -256,7 +256,7 @@ static void __devinit cg3_init_fix(struct fb_info *info, int linebytes,
 	info->fix.accel = FB_ACCEL_SUN_CGTHREE;
 }
 
-static void __devinit cg3_rdi_maybe_fixup_var(struct fb_var_screeninfo *var,
+static void cg3_rdi_maybe_fixup_var(struct fb_var_screeninfo *var,
 					      struct device_node *dp)
 {
 	const char *params;
@@ -308,7 +308,7 @@ static u_char cg3_dacvals[] __devinitdata = {
 	4, 0xff,	5, 0x00,	6, 0x70,	7, 0x00,	0
 };
 
-static int __devinit cg3_do_default_mode(struct cg3_par *par)
+static int cg3_do_default_mode(struct cg3_par *par)
 {
 	enum cg3_type type;
 	u8 *p;
@@ -346,7 +346,7 @@ static int __devinit cg3_do_default_mode(struct cg3_par *par)
 	return 0;
 }
 
-static int __devinit cg3_probe(struct platform_device *op)
+static int cg3_probe(struct platform_device *op)
 {
 	struct device_node *dp = op->dev.of_node;
 	struct fb_info *info;
diff --git a/drivers/video/cg6.c b/drivers/video/cg6.c
index 70c7013..3204e5a 100644
--- a/drivers/video/cg6.c
+++ b/drivers/video/cg6.c
@@ -607,7 +607,7 @@ static int cg6_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
  *  Initialisation
  */
 
-static void __devinit cg6_init_fix(struct fb_info *info, int linebytes)
+static void cg6_init_fix(struct fb_info *info, int linebytes)
 {
 	struct cg6_par *par = (struct cg6_par *)info->par;
 	const char *cg6_cpu_name, *cg6_card_name;
@@ -649,7 +649,7 @@ static void __devinit cg6_init_fix(struct fb_info *info, int linebytes)
 }
 
 /* Initialize Brooktree DAC */
-static void __devinit cg6_bt_init(struct cg6_par *par)
+static void cg6_bt_init(struct cg6_par *par)
 {
 	struct bt_regs __iomem *bt = par->bt;
 
@@ -663,7 +663,7 @@ static void __devinit cg6_bt_init(struct cg6_par *par)
 	sbus_writel(0x00 << 24, &bt->control);
 }
 
-static void __devinit cg6_chip_init(struct fb_info *info)
+static void cg6_chip_init(struct fb_info *info)
 {
 	struct cg6_par *par = (struct cg6_par *)info->par;
 	struct cg6_tec __iomem *tec = par->tec;
@@ -737,7 +737,7 @@ static void cg6_unmap_regs(struct platform_device *op, struct fb_info *info,
 			   info->fix.smem_len);
 }
 
-static int __devinit cg6_probe(struct platform_device *op)
+static int cg6_probe(struct platform_device *op)
 {
 	struct device_node *dp = op->dev.of_node;
 	struct fb_info *info;
diff --git a/drivers/video/chipsfb.c b/drivers/video/chipsfb.c
index 809857d..bf131f2 100644
--- a/drivers/video/chipsfb.c
+++ b/drivers/video/chipsfb.c
@@ -330,7 +330,7 @@ static struct fb_var_screeninfo chipsfb_var __devinitdata = {
 	.vsync_len = 8,
 };
 
-static void __devinit init_chips(struct fb_info *p, unsigned long addr)
+static void init_chips(struct fb_info *p, unsigned long addr)
 {
 	memset(p->screen_base, 0, 0x100000);
 
@@ -347,7 +347,7 @@ static void __devinit init_chips(struct fb_info *p, unsigned long addr)
 	chips_hw_init();
 }
 
-static int __devinit
+static int
 chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
 {
 	struct fb_info *p;
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
index 3ce6e55..0e73200 100644
--- a/drivers/video/cirrusfb.c
+++ b/drivers/video/cirrusfb.c
@@ -1892,7 +1892,7 @@ static int release_io_ports;
  * based on the DRAM bandwidth bit and DRAM bank switching bit.  This
  * works with 1MB, 2MB and 4MB configurations (which the Motorola boards
  * seem to have. */
-static unsigned int __devinit cirrusfb_get_memsize(struct fb_info *info,
+static unsigned int cirrusfb_get_memsize(struct fb_info *info,
 						   u8 __iomem *regbase)
 {
 	unsigned long mem;
@@ -2003,7 +2003,7 @@ static struct fb_ops cirrusfb_ops = {
 	.fb_imageblit	= cirrusfb_imageblit,
 };
 
-static int __devinit cirrusfb_set_fbinfo(struct fb_info *info)
+static int cirrusfb_set_fbinfo(struct fb_info *info)
 {
 	struct cirrusfb_info *cinfo = info->par;
 	struct fb_var_screeninfo *var = &info->var;
@@ -2052,7 +2052,7 @@ static int __devinit cirrusfb_set_fbinfo(struct fb_info *info)
 	return 0;
 }
 
-static int __devinit cirrusfb_register(struct fb_info *info)
+static int cirrusfb_register(struct fb_info *info)
 {
 	struct cirrusfb_info *cinfo = info->par;
 	int err;
@@ -2109,7 +2109,7 @@ static void __devexit cirrusfb_cleanup(struct fb_info *info)
 }
 
 #ifdef CONFIG_PCI
-static int __devinit cirrusfb_pci_register(struct pci_dev *pdev,
+static int cirrusfb_pci_register(struct pci_dev *pdev,
 					   const struct pci_device_id *ent)
 {
 	struct cirrusfb_info *cinfo;
@@ -2237,7 +2237,7 @@ static struct pci_driver cirrusfb_pci_driver = {
 #endif /* CONFIG_PCI */
 
 #ifdef CONFIG_ZORRO
-static int __devinit cirrusfb_zorro_register(struct zorro_dev *z,
+static int cirrusfb_zorro_register(struct zorro_dev *z,
 					     const struct zorro_device_id *ent)
 {
 	struct fb_info *info;
diff --git a/drivers/video/cobalt_lcdfb.c b/drivers/video/cobalt_lcdfb.c
index 9f2dc21..9e1e5d2 100644
--- a/drivers/video/cobalt_lcdfb.c
+++ b/drivers/video/cobalt_lcdfb.c
@@ -331,7 +331,7 @@ static struct fb_ops cobalt_lcd_fbops = {
 	.fb_cursor	= cobalt_lcdfb_cursor,
 };
 
-static int __devinit cobalt_lcdfb_probe(struct platform_device *dev)
+static int cobalt_lcdfb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	struct resource *res;
diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c
index 39571f9..0fbc03c 100644
--- a/drivers/video/console/sticore.c
+++ b/drivers/video/console/sticore.c
@@ -238,7 +238,7 @@ static void sti_flush(unsigned long start, unsigned long end)
 	flush_icache_range(start, end);
 }
 
-static void __devinit sti_rom_copy(unsigned long base, unsigned long count,
+static void sti_rom_copy(unsigned long base, unsigned long count,
 				   void *dest)
 {
 	unsigned long dest_start = (unsigned long) dest;
@@ -266,7 +266,7 @@ static void __devinit sti_rom_copy(unsigned long base, unsigned long count,
 static char default_sti_path[21] __read_mostly;
 
 #ifndef MODULE
-static int __devinit sti_setup(char *str)
+static int sti_setup(char *str)
 {
 	if (str)
 		strlcpy (default_sti_path, str, sizeof (default_sti_path));
@@ -290,7 +290,7 @@ static int __devinitdata	font_index[MAX_STI_ROMS],
 				font_height[MAX_STI_ROMS],
 				font_width[MAX_STI_ROMS];
 #ifndef MODULE
-static int __devinit sti_font_setup(char *str)
+static int sti_font_setup(char *str)
 {
 	char *x;
 	int i = 0;
@@ -343,7 +343,7 @@ __setup("sti_font=", sti_font_setup);
 
 
 	
-static void __devinit
+static void
 sti_dump_globcfg(struct sti_glob_cfg *glob_cfg, unsigned int sti_mem_request)
 {
 	struct sti_glob_cfg_ext *cfg;
@@ -383,7 +383,7 @@ sti_dump_globcfg(struct sti_glob_cfg *glob_cfg, unsigned int sti_mem_request)
 		cfg->sti_mem_addr, sti_mem_request));
 }
 
-static void __devinit
+static void
 sti_dump_outptr(struct sti_struct *sti)
 {
 	DPRINTK((KERN_INFO
@@ -397,7 +397,7 @@ sti_dump_outptr(struct sti_struct *sti)
 		 sti->outptr.attributes));
 }
 
-static int __devinit
+static int
 sti_init_glob_cfg(struct sti_struct *sti,
 	    unsigned long rom_address, unsigned long hpa)
 {
@@ -479,7 +479,7 @@ sti_init_glob_cfg(struct sti_struct *sti,
 }
 
 #ifdef CONFIG_FB
-static struct sti_cooked_font __devinit
+static struct sti_cooked_font
 *sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name)
 {
 	const struct font_desc *fbfont;
@@ -535,14 +535,14 @@ static struct sti_cooked_font __devinit
 	return cooked_font;
 }
 #else
-static struct sti_cooked_font __devinit
+static struct sti_cooked_font
 *sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name)
 {
 	return NULL;
 }
 #endif
 
-static struct sti_cooked_font __devinit
+static struct sti_cooked_font
 *sti_select_font(struct sti_cooked_rom *rom,
 		 int (*search_font_fnc)(struct sti_cooked_rom *, int, int))
 {
@@ -569,7 +569,7 @@ static struct sti_cooked_font __devinit
 }
 
 
-static void __devinit
+static void
 sti_dump_rom(struct sti_rom *rom)
 {
 	printk(KERN_INFO "    id %04x-%04x, conforms to spec rev. %d.%02x\n",
@@ -587,7 +587,7 @@ sti_dump_rom(struct sti_rom *rom)
 }
 
 
-static int __devinit
+static int
 sti_cook_fonts(struct sti_cooked_rom *cooked_rom,
 			struct sti_rom *raw_rom)
 {
@@ -622,7 +622,7 @@ sti_cook_fonts(struct sti_cooked_rom *cooked_rom,
 }
 
 
-static int __devinit
+static int
 sti_search_font(struct sti_cooked_rom *rom, int height, int width)
 {
 	struct sti_cooked_font *font;
@@ -639,8 +639,7 @@ sti_search_font(struct sti_cooked_rom *rom, int height, int width)
 #define BMODE_RELOCATE(offset)		offset = (offset) / 4;
 #define BMODE_LAST_ADDR_OFFS		0x50
 
-static void * __devinit
-sti_bmode_font_raw(struct sti_cooked_font *f)
+static void *sti_bmode_font_raw(struct sti_cooked_font *f)
 {
 	unsigned char *n, *p, *q;
 	int size = f->raw->bytes_per_char*256+sizeof(struct sti_rom_font);
@@ -657,7 +656,7 @@ sti_bmode_font_raw(struct sti_cooked_font *f)
 	return n + 3;
 }
 
-static void __devinit
+static void
 sti_bmode_rom_copy(unsigned long base, unsigned long count, void *dest)
 {
 	unsigned long dest_start = (unsigned long) dest;
@@ -672,8 +671,7 @@ sti_bmode_rom_copy(unsigned long base, unsigned long count, void *dest)
 	sti_flush(dest_start, (unsigned long)dest);
 }
 
-static struct sti_rom * __devinit
-sti_get_bmode_rom (unsigned long address)
+static struct sti_rom *sti_get_bmode_rom (unsigned long address)
 {
 	struct sti_rom *raw;
 	u32 size;
@@ -708,7 +706,7 @@ sti_get_bmode_rom (unsigned long address)
 	return raw;
 }
 
-static struct sti_rom __devinit *sti_get_wmode_rom(unsigned long address)
+static struct sti_rom *sti_get_wmode_rom(unsigned long address)
 {
 	struct sti_rom *raw;
 	unsigned long size;
@@ -723,7 +721,7 @@ static struct sti_rom __devinit *sti_get_wmode_rom(unsigned long address)
 	return raw;
 }
 
-static int __devinit sti_read_rom(int wordmode, struct sti_struct *sti,
+static int sti_read_rom(int wordmode, struct sti_struct *sti,
 				  unsigned long address)
 {
 	struct sti_cooked_rom *cooked;
@@ -806,8 +804,7 @@ out_err:
 	return 0;
 }
 
-static struct sti_struct * __devinit
-sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd)
+static struct sti_struct *sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd)
 {
 	struct sti_struct *sti;
 	int ok;
@@ -921,7 +918,7 @@ out_err:
 	return NULL;
 }
 
-static void __devinit sticore_check_for_default_sti(struct sti_struct *sti, char *path)
+static void sticore_check_for_default_sti(struct sti_struct *sti, char *path)
 {
 	if (strcmp (path, default_sti_path) == 0)
 		default_sti = sti;
@@ -932,7 +929,7 @@ static void __devinit sticore_check_for_default_sti(struct sti_struct *sti, char
  * in the additional address field addr[1] while on
  * older Systems the PDC stores it in page0->proc_sti 
  */
-static int __devinit sticore_pa_init(struct parisc_device *dev)
+static int sticore_pa_init(struct parisc_device *dev)
 {
 	char pa_path[21];
 	struct sti_struct *sti = NULL;
@@ -953,7 +950,7 @@ static int __devinit sticore_pa_init(struct parisc_device *dev)
 }
 
 
-static int __devinit sticore_pci_init(struct pci_dev *pd,
+static int sticore_pci_init(struct pci_dev *pd,
 		const struct pci_device_id *ent)
 {
 #ifdef CONFIG_PCI
@@ -1043,7 +1040,7 @@ static struct parisc_driver pa_sti_driver = {
 
 static int sticore_initialized __read_mostly;
 
-static void __devinit sti_init_roms(void)
+static void sti_init_roms(void)
 {
 	if (sticore_initialized)
 		return;
diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c
index 9b75b29..78bb6be 100644
--- a/drivers/video/cyber2000fb.c
+++ b/drivers/video/cyber2000fb.c
@@ -1230,7 +1230,7 @@ static int cyber2000fb_ddc_getsda(void *data)
 	return retval;
 }
 
-static int __devinit cyber2000fb_setup_ddc_bus(struct cfb_info *cfb)
+static int cyber2000fb_setup_ddc_bus(struct cfb_info *cfb)
 {
 	strlcpy(cfb->ddc_adapter.name, cfb->fb.fix.id,
 		sizeof(cfb->ddc_adapter.name));
@@ -1305,7 +1305,7 @@ static int cyber2000fb_i2c_getscl(void *data)
 	return ret;
 }
 
-static int __devinit cyber2000fb_i2c_register(struct cfb_info *cfb)
+static int cyber2000fb_i2c_register(struct cfb_info *cfb)
 {
 	strlcpy(cfb->i2c_adapter.name, cfb->fb.fix.id,
 		sizeof(cfb->i2c_adapter.name));
@@ -1404,7 +1404,7 @@ static void cyberpro_init_hw(struct cfb_info *cfb)
 	}
 }
 
-static struct cfb_info __devinit *cyberpro_alloc_fb_info(unsigned int id,
+static struct cfb_info *cyberpro_alloc_fb_info(unsigned int id,
 							 char *name)
 {
 	struct cfb_info *cfb;
@@ -1524,7 +1524,7 @@ static int cyber2000fb_setup(char *options)
  *  - memory mapped access to the registers
  *  - initialised mem_ctl1 and mem_ctl2 appropriately.
  */
-static int __devinit cyberpro_common_probe(struct cfb_info *cfb)
+static int cyberpro_common_probe(struct cfb_info *cfb)
 {
 	u_long smem_size;
 	u_int h_sync, v_sync;
@@ -1646,7 +1646,7 @@ static void cyberpro_common_resume(struct cfb_info *cfb)
 
 #include <mach/framebuffer.h>
 
-static int __devinit cyberpro_vl_probe(void)
+static int cyberpro_vl_probe(void)
 {
 	struct cfb_info *cfb;
 	int err = -ENOMEM;
@@ -1780,7 +1780,7 @@ static int cyberpro_pci_enable_mmio(struct cfb_info *cfb)
 	return 0;
 }
 
-static int __devinit
+static int
 cyberpro_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 {
 	struct cfb_info *cfb;
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index b3aaf3b..1face18 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -1230,7 +1230,7 @@ static unsigned int da8xxfb_pixel_clk_period(struct da8xx_fb_par *par)
 	return pix_clk_period_picosec;
 }
 
-static int __devinit fb_probe(struct platform_device *device)
+static int fb_probe(struct platform_device *device)
 {
 	struct da8xx_lcdc_platform_data *fb_pdata =
 						device->dev.platform_data;
diff --git a/drivers/video/dnfb.c b/drivers/video/dnfb.c
index 49e3dda..182b199 100644
--- a/drivers/video/dnfb.c
+++ b/drivers/video/dnfb.c
@@ -224,7 +224,7 @@ void dnfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
  * Initialization
  */
 
-static int __devinit dnfb_probe(struct platform_device *dev)
+static int dnfb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	int err = 0;
diff --git a/drivers/video/ep93xx-fb.c b/drivers/video/ep93xx-fb.c
index 2f08122..ef4ca55 100644
--- a/drivers/video/ep93xx-fb.c
+++ b/drivers/video/ep93xx-fb.c
@@ -484,7 +484,7 @@ static void ep93xxfb_dealloc_videomem(struct fb_info *info)
 				  info->screen_base, info->fix.smem_start);
 }
 
-static int __devinit ep93xxfb_probe(struct platform_device *pdev)
+static int ep93xxfb_probe(struct platform_device *pdev)
 {
 	struct ep93xxfb_mach_info *mach_info = pdev->dev.platform_data;
 	struct fb_info *info;
@@ -627,7 +627,7 @@ static struct platform_driver ep93xxfb_driver = {
 	},
 };
 
-static int __devinit ep93xxfb_init(void)
+static int ep93xxfb_init(void)
 {
 	return platform_driver_register(&ep93xxfb_driver);
 }
diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c
index 07c0453..47f0448 100644
--- a/drivers/video/exynos/exynos_dp_core.c
+++ b/drivers/video/exynos/exynos_dp_core.c
@@ -856,7 +856,7 @@ static irqreturn_t exynos_dp_irq_handler(int irq, void *arg)
 	return IRQ_HANDLED;
 }
 
-static int __devinit exynos_dp_probe(struct platform_device *pdev)
+static int exynos_dp_probe(struct platform_device *pdev)
 {
 	struct resource *res;
 	struct exynos_dp_device *dp;
diff --git a/drivers/video/ffb.c b/drivers/video/ffb.c
index d78dc9a..46aee0e 100644
--- a/drivers/video/ffb.c
+++ b/drivers/video/ffb.c
@@ -893,7 +893,7 @@ static void ffb_init_fix(struct fb_info *info)
 	info->fix.accel = FB_ACCEL_SUN_CREATOR;
 }
 
-static int __devinit ffb_probe(struct platform_device *op)
+static int ffb_probe(struct platform_device *op)
 {
 	struct device_node *dp = op->dev.of_node;
 	struct ffb_fbc __iomem *fbc;
diff --git a/drivers/video/fm2fb.c b/drivers/video/fm2fb.c
index d0533b7..a64c3ef 100644
--- a/drivers/video/fm2fb.c
+++ b/drivers/video/fm2fb.c
@@ -211,7 +211,7 @@ static int fm2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
      *  Initialisation
      */
 
-static int __devinit fm2fb_probe(struct zorro_dev *z,
+static int fm2fb_probe(struct zorro_dev *z,
 				 const struct zorro_device_id *id);
 
 static struct zorro_device_id fm2fb_devices[] __devinitdata = {
@@ -227,7 +227,7 @@ static struct zorro_driver fm2fb_driver = {
 	.probe		= fm2fb_probe,
 };
 
-static int __devinit fm2fb_probe(struct zorro_dev *z,
+static int fm2fb_probe(struct zorro_dev *z,
 				 const struct zorro_device_id *id)
 {
 	struct fb_info *info;
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index ede9e55..6bdf805 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -1244,7 +1244,7 @@ static struct fb_ops fsl_diu_ops = {
 	.fb_release = fsl_diu_release,
 };
 
-static int __devinit install_fb(struct fb_info *info)
+static int install_fb(struct fb_info *info)
 {
 	int rc;
 	struct mfb_info *mfbi = info->par;
@@ -1491,7 +1491,7 @@ static ssize_t show_monitor(struct device *device,
 	return 0;
 }
 
-static int __devinit fsl_diu_probe(struct platform_device *pdev)
+static int fsl_diu_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
 	struct mfb_info *mfbi;
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c
index f19571b..2971511 100644
--- a/drivers/video/gbefb.c
+++ b/drivers/video/gbefb.c
@@ -1098,7 +1098,7 @@ static void gbefb_create_sysfs(struct device *dev)
  * Initialization
  */
 
-static int __devinit gbefb_setup(char *options)
+static int gbefb_setup(char *options)
 {
 	char *this_opt;
 
@@ -1129,7 +1129,7 @@ static int __devinit gbefb_setup(char *options)
 	return 0;
 }
 
-static int __devinit gbefb_probe(struct platform_device *p_dev)
+static int gbefb_probe(struct platform_device *p_dev)
 {
 	int i, ret = 0;
 	struct fb_info *info;
diff --git a/drivers/video/geode/gx1fb_core.c b/drivers/video/geode/gx1fb_core.c
index 094c352..4bdd47f 100644
--- a/drivers/video/geode/gx1fb_core.c
+++ b/drivers/video/geode/gx1fb_core.c
@@ -195,7 +195,7 @@ static int gx1fb_blank(int blank_mode, struct fb_info *info)
 	return par->vid_ops->blank_display(info, blank_mode);
 }
 
-static int __devinit gx1fb_map_video_memory(struct fb_info *info, struct pci_dev *dev)
+static int gx1fb_map_video_memory(struct fb_info *info, struct pci_dev *dev)
 {
 	struct geodefb_par *par = info->par;
 	unsigned gx_base;
@@ -268,7 +268,7 @@ static struct fb_ops gx1fb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-static struct fb_info * __devinit gx1fb_init_fbinfo(struct device *dev)
+static struct fb_info *gx1fb_init_fbinfo(struct device *dev)
 {
 	struct geodefb_par *par;
 	struct fb_info *info;
@@ -318,7 +318,7 @@ static struct fb_info * __devinit gx1fb_init_fbinfo(struct device *dev)
 	return info;
 }
 
-static int __devinit gx1fb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+static int gx1fb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
 	struct geodefb_par *par;
 	struct fb_info *info;
diff --git a/drivers/video/geode/gxfb_core.c b/drivers/video/geode/gxfb_core.c
index b4f19db..d3ad1a0 100644
--- a/drivers/video/geode/gxfb_core.c
+++ b/drivers/video/geode/gxfb_core.c
@@ -117,7 +117,7 @@ static struct fb_videomode gx_dcon_modedb[] __devinitdata = {
 	  FB_VMODE_NONINTERLACED, 0 }
 };
 
-static void __devinit get_modedb(struct fb_videomode **modedb,
+static void get_modedb(struct fb_videomode **modedb,
 		unsigned int *size)
 {
 	if (olpc_has_dcon()) {
@@ -130,7 +130,7 @@ static void __devinit get_modedb(struct fb_videomode **modedb,
 }
 
 #else
-static void __devinit get_modedb(struct fb_videomode **modedb,
+static void get_modedb(struct fb_videomode **modedb,
 		unsigned int *size)
 {
 	*modedb = (struct fb_videomode *) gx_modedb;
@@ -228,7 +228,7 @@ static int gxfb_blank(int blank_mode, struct fb_info *info)
 	return gx_blank_display(info, blank_mode);
 }
 
-static int __devinit gxfb_map_video_memory(struct fb_info *info,
+static int gxfb_map_video_memory(struct fb_info *info,
 		struct pci_dev *dev)
 {
 	struct gxfb_par *par = info->par;
@@ -293,7 +293,7 @@ static struct fb_ops gxfb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-static struct fb_info *__devinit gxfb_init_fbinfo(struct device *dev)
+static struct fb_info *gxfb_init_fbinfo(struct device *dev)
 {
 	struct gxfb_par *par;
 	struct fb_info *info;
@@ -374,7 +374,7 @@ static int gxfb_resume(struct pci_dev *pdev)
 }
 #endif
 
-static int __devinit gxfb_probe(struct pci_dev *pdev,
+static int gxfb_probe(struct pci_dev *pdev,
 		const struct pci_device_id *id)
 {
 	struct gxfb_par *par;
diff --git a/drivers/video/geode/lxfb_core.c b/drivers/video/geode/lxfb_core.c
index 416851c..7428366 100644
--- a/drivers/video/geode/lxfb_core.c
+++ b/drivers/video/geode/lxfb_core.c
@@ -226,7 +226,7 @@ static struct fb_videomode olpc_dcon_modedb[] __devinitdata = {
 	  FB_VMODE_NONINTERLACED, 0 }
 };
 
-static void __devinit get_modedb(struct fb_videomode **modedb,
+static void get_modedb(struct fb_videomode **modedb,
 		unsigned int *size)
 {
 	if (olpc_has_dcon()) {
@@ -239,7 +239,7 @@ static void __devinit get_modedb(struct fb_videomode **modedb,
 }
 
 #else
-static void __devinit get_modedb(struct fb_videomode **modedb,
+static void get_modedb(struct fb_videomode **modedb,
 		unsigned int *size)
 {
 	*modedb = (struct fb_videomode *) geode_modedb;
@@ -336,7 +336,7 @@ static int lxfb_blank(int blank_mode, struct fb_info *info)
 }
 
 
-static int __devinit lxfb_map_video_memory(struct fb_info *info,
+static int lxfb_map_video_memory(struct fb_info *info,
 					struct pci_dev *dev)
 {
 	struct lxfb_par *par = info->par;
@@ -414,7 +414,7 @@ static struct fb_ops lxfb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-static struct fb_info * __devinit lxfb_init_fbinfo(struct device *dev)
+static struct fb_info *lxfb_init_fbinfo(struct device *dev)
 {
 	struct lxfb_par *par;
 	struct fb_info *info;
@@ -498,7 +498,7 @@ static int lxfb_resume(struct pci_dev *pdev)
 #define lxfb_resume NULL
 #endif
 
-static int __devinit lxfb_probe(struct pci_dev *pdev,
+static int lxfb_probe(struct pci_dev *pdev,
 			     const struct pci_device_id *id)
 {
 	struct lxfb_par *par;
diff --git a/drivers/video/grvga.c b/drivers/video/grvga.c
index 3ddf206..bf7ea95 100644
--- a/drivers/video/grvga.c
+++ b/drivers/video/grvga.c
@@ -267,7 +267,7 @@ static struct fb_ops grvga_ops = {
 	.fb_imageblit	= cfb_imageblit
 };
 
-static int __devinit grvga_parse_custom(char *options,
+static int grvga_parse_custom(char *options,
 				     struct fb_var_screeninfo *screendata)
 {
 	char *this_opt;
@@ -329,7 +329,7 @@ static int __devinit grvga_parse_custom(char *options,
 	return 0;
 }
 
-static int __devinit grvga_probe(struct platform_device *dev)
+static int grvga_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	int retval = -ENOMEM;
diff --git a/drivers/video/gxt4500.c b/drivers/video/gxt4500.c
index d4f103e..c0130a4 100644
--- a/drivers/video/gxt4500.c
+++ b/drivers/video/gxt4500.c
@@ -610,7 +610,7 @@ static struct fb_ops gxt4500_ops = {
 };
 
 /* PCI functions */
-static int __devinit gxt4500_probe(struct pci_dev *pdev,
+static int gxt4500_probe(struct pci_dev *pdev,
 				   const struct pci_device_id *ent)
 {
 	int err;
@@ -761,7 +761,7 @@ static struct pci_driver gxt4500_driver = {
 	.remove = gxt4500_remove,
 };
 
-static int __devinit gxt4500_init(void)
+static int gxt4500_init(void)
 {
 #ifndef MODULE
 	if (fb_get_options("gxt4500", &mode_option))
diff --git a/drivers/video/hecubafb.c b/drivers/video/hecubafb.c
index b28a520..f8746a3f 100644
--- a/drivers/video/hecubafb.c
+++ b/drivers/video/hecubafb.c
@@ -211,7 +211,7 @@ static struct fb_deferred_io hecubafb_defio = {
 	.deferred_io	= hecubafb_dpy_deferred_io,
 };
 
-static int __devinit hecubafb_probe(struct platform_device *dev)
+static int hecubafb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	struct hecuba_board *board;
diff --git a/drivers/video/hgafb.c b/drivers/video/hgafb.c
index f8a7036..20bbeb4 100644
--- a/drivers/video/hgafb.c
+++ b/drivers/video/hgafb.c
@@ -276,7 +276,7 @@ static void hga_blank(int blank_mode)
 	spin_unlock_irqrestore(&hga_reg_lock, flags);
 }
 
-static int __devinit hga_card_detect(void)
+static int hga_card_detect(void)
 {
 	int count = 0;
 	void __iomem *p, *q;
@@ -546,7 +546,7 @@ static struct fb_ops hgafb_ops = {
 	 *  Initialization
 	 */
 
-static int __devinit hgafb_probe(struct platform_device *pdev)
+static int hgafb_probe(struct platform_device *pdev)
 {
 	struct fb_info *info;
 
diff --git a/drivers/video/hitfb.c b/drivers/video/hitfb.c
index 4ceb978..20d8a56 100644
--- a/drivers/video/hitfb.c
+++ b/drivers/video/hitfb.c
@@ -324,7 +324,7 @@ static struct fb_ops hitfb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-static int __devinit hitfb_probe(struct platform_device *dev)
+static int hitfb_probe(struct platform_device *dev)
 {
 	unsigned short lcdclor, ldr3, ldvndr;
 	struct fb_info *info;
diff --git a/drivers/video/hpfb.c b/drivers/video/hpfb.c
index 1f15523..aa2abe8 100644
--- a/drivers/video/hpfb.c
+++ b/drivers/video/hpfb.c
@@ -206,7 +206,7 @@ static struct fb_ops hpfb_ops = {
 #define HPFB_FBOMSB	0x5d	/* Frame buffer offset		*/
 #define HPFB_FBOLSB	0x5f
 
-static int __devinit hpfb_init_one(unsigned long phys_base,
+static int hpfb_init_one(unsigned long phys_base,
 				   unsigned long virt_base)
 {
 	unsigned long fboff, fb_width, fb_height, fb_start;
@@ -327,7 +327,7 @@ unmap_screen_base:
 /* 
  * Initialise the framebuffer
  */
-static int __devinit hpfb_dio_probe(struct dio_dev * d, const struct dio_device_id * ent)
+static int hpfb_dio_probe(struct dio_dev * d, const struct dio_device_id * ent)
 {
 	unsigned long paddr, vaddr;
 
diff --git a/drivers/video/i740fb.c b/drivers/video/i740fb.c
index 1d3c8ee..1109617 100644
--- a/drivers/video/i740fb.c
+++ b/drivers/video/i740fb.c
@@ -163,7 +163,7 @@ static int i740fb_ddc_getsda(void *data)
 	return !!(i740inreg(par, XRX, REG_DDC_STATE) & DDC_SDA);
 }
 
-static int __devinit i740fb_setup_ddc_bus(struct fb_info *info)
+static int i740fb_setup_ddc_bus(struct fb_info *info)
 {
 	struct i740fb_par *par = info->par;
 
@@ -1007,7 +1007,7 @@ static struct fb_ops i740fb_ops = {
 
 /* ------------------------------------------------------------------------- */
 
-static int __devinit i740fb_probe(struct pci_dev *dev,
+static int i740fb_probe(struct pci_dev *dev,
 				  const struct pci_device_id *ent)
 {
 	struct fb_info *info;
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
index 5c06781..8c50b96 100644
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -78,7 +78,7 @@ static u32 v_offset_default __devinitdata; /* For 32 MiB Aper size, 8 should be
 static u32 voffset          __devinitdata;
 
 static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor);
-static int  __devinit i810fb_init_pci (struct pci_dev *dev,
+static int  i810fb_init_pci (struct pci_dev *dev,
 				       const struct pci_device_id *entry);
 static void __exit i810fb_remove_pci(struct pci_dev *dev);
 static int i810fb_resume(struct pci_dev *dev);
@@ -1628,7 +1628,7 @@ fail:
  *                  AGP resource allocation                            *
  ***********************************************************************/
   
-static void __devinit i810_fix_pointers(struct i810fb_par *par)
+static void i810_fix_pointers(struct i810fb_par *par)
 {
       	par->fb.physical = par->aperture.physical+(par->fb.offset << 12);
 	par->fb.virtual = par->aperture.virtual+(par->fb.offset << 12);
@@ -1640,7 +1640,7 @@ static void __devinit i810_fix_pointers(struct i810fb_par *par)
 		(par->cursor_heap.offset << 12);
 }
 
-static void __devinit i810_fix_offsets(struct i810fb_par *par)
+static void i810_fix_offsets(struct i810fb_par *par)
 {
 	if (vram + 1 > par->aperture.size >> 20)
 		vram = (par->aperture.size >> 20) - 1;
@@ -1660,7 +1660,7 @@ static void __devinit i810_fix_offsets(struct i810fb_par *par)
 	par->cursor_heap.size = 4096;
 }
 
-static int __devinit i810_alloc_agp_mem(struct fb_info *info)
+static int i810_alloc_agp_mem(struct fb_info *info)
 {
 	struct i810fb_par *par = info->par;
 	int size;
@@ -1723,7 +1723,7 @@ static int __devinit i810_alloc_agp_mem(struct fb_info *info)
  * Sets the user monitor's horizontal and vertical
  * frequency limits
  */
-static void __devinit i810_init_monspecs(struct fb_info *info)
+static void i810_init_monspecs(struct fb_info *info)
 {
 	if (!hsync1)
 		hsync1 = HFMIN;
@@ -1755,7 +1755,7 @@ static void __devinit i810_init_monspecs(struct fb_info *info)
  * @par: pointer to i810fb_par structure
  * @info: pointer to current fb_info structure
  */
-static void __devinit i810_init_defaults(struct i810fb_par *par, 
+static void i810_init_defaults(struct i810fb_par *par,
 				      struct fb_info *info)
 {
 	mutex_init(&par->open_lock);
@@ -1812,7 +1812,7 @@ static void __devinit i810_init_defaults(struct i810fb_par *par,
  * i810_init_device - initialize device
  * @par: pointer to i810fb_par structure
  */
-static void __devinit i810_init_device(struct i810fb_par *par)
+static void i810_init_device(struct i810fb_par *par)
 {
 	u8 reg;
 	u8 __iomem *mmio = par->mmio_start_virtual;
@@ -1833,7 +1833,7 @@ static void __devinit i810_init_device(struct i810fb_par *par)
 
 }
 
-static int __devinit 
+static int
 i810_allocate_pci_resource(struct i810fb_par *par, 
 			   const struct pci_device_id *entry)
 {
@@ -1892,7 +1892,7 @@ i810_allocate_pci_resource(struct i810fb_par *par,
 	return 0;
 }
 
-static void __devinit i810fb_find_init_mode(struct fb_info *info)
+static void i810fb_find_init_mode(struct fb_info *info)
 {
 	struct fb_videomode mode;
 	struct fb_var_screeninfo var;
@@ -1956,7 +1956,7 @@ static void __devinit i810fb_find_init_mode(struct fb_info *info)
 }
 
 #ifndef MODULE
-static int __devinit i810fb_setup(char *options)
+static int i810fb_setup(char *options)
 {
 	char *this_opt, *suffix = NULL;
 
@@ -2007,7 +2007,7 @@ static int __devinit i810fb_setup(char *options)
 }
 #endif
 
-static int __devinit i810fb_init_pci (struct pci_dev *dev, 
+static int i810fb_init_pci (struct pci_dev *dev,
 				   const struct pci_device_id *entry)
 {
 	struct fb_info    *info;
@@ -2136,7 +2136,7 @@ static void __exit i810fb_remove_pci(struct pci_dev *dev)
 }                                                	
 
 #ifndef MODULE
-static int __devinit i810fb_init(void)
+static int i810fb_init(void)
 {
 	char *option = NULL;
 
@@ -2154,7 +2154,7 @@ static int __devinit i810fb_init(void)
 
 #ifdef MODULE
 
-static int __devinit i810fb_init(void)
+static int i810fb_init(void)
 {
 	hsync1 *= 1000;
 	hsync2 *= 1000;
diff --git a/drivers/video/i810/i810_main.h b/drivers/video/i810/i810_main.h
index 51d4f3d4..a25afaa 100644
--- a/drivers/video/i810/i810_main.h
+++ b/drivers/video/i810/i810_main.h
@@ -64,7 +64,7 @@ static inline void flush_cache(void)
 
 #include <asm/mtrr.h>
 
-static inline void __devinit set_mtrr(struct i810fb_par *par)
+static inline void set_mtrr(struct i810fb_par *par)
 {
 	par->mtrr_reg = mtrr_add((u32) par->aperture.physical, 
 		 par->aperture.size, MTRR_TYPE_WRCOMB, 1);
diff --git a/drivers/video/imsttfb.c b/drivers/video/imsttfb.c
index 1bb3934..a7e8477 100644
--- a/drivers/video/imsttfb.c
+++ b/drivers/video/imsttfb.c
@@ -1349,7 +1349,7 @@ static struct fb_ops imsttfb_ops = {
 	.fb_ioctl 	= imsttfb_ioctl,
 };
 
-static void __devinit
+static void
 init_imstt(struct fb_info *info)
 {
 	struct imstt_par *par = info->par;
@@ -1466,7 +1466,7 @@ init_imstt(struct fb_info *info)
 		info->node, info->fix.id, info->fix.smem_len >> 20, tmp);
 }
 
-static int __devinit
+static int
 imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	unsigned long addr, size;
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index 971b5d0..860820c 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -132,7 +132,7 @@
 #include "intelfbhw.h"
 #include "../edid.h"
 
-static void __devinit get_initial_mode(struct intelfb_info *dinfo);
+static void get_initial_mode(struct intelfb_info *dinfo);
 static void update_dinfo(struct intelfb_info *dinfo,
 			 struct fb_var_screeninfo *var);
 static int intelfb_open(struct fb_info *info, int user);
@@ -162,10 +162,10 @@ static int intelfb_sync(struct fb_info *info);
 static int intelfb_ioctl(struct fb_info *info,
 			 unsigned int cmd, unsigned long arg);
 
-static int __devinit intelfb_pci_register(struct pci_dev *pdev,
+static int intelfb_pci_register(struct pci_dev *pdev,
 					  const struct pci_device_id *ent);
 static void __devexit intelfb_pci_unregister(struct pci_dev *pdev);
-static int __devinit intelfb_set_fbinfo(struct intelfb_info *dinfo);
+static int intelfb_set_fbinfo(struct intelfb_info *dinfo);
 
 /*
  * Limiting the class to PCI_CLASS_DISPLAY_VGA prevents function 1 of the
@@ -415,7 +415,7 @@ module_exit(intelfb_exit);
  ***************************************************************/
 
 #ifdef CONFIG_MTRR
-static inline void __devinit set_mtrr(struct intelfb_info *dinfo)
+static inline void set_mtrr(struct intelfb_info *dinfo)
 {
 	dinfo->mtrr_reg = mtrr_add(dinfo->aperture.physical,
 				   dinfo->aperture.size, MTRR_TYPE_WRCOMB, 1);
@@ -497,7 +497,7 @@ static void cleanup(struct intelfb_info *dinfo)
 } while (0)
 
 
-static int __devinit intelfb_pci_register(struct pci_dev *pdev,
+static int intelfb_pci_register(struct pci_dev *pdev,
 					  const struct pci_device_id *ent)
 {
 	struct fb_info *info;
@@ -970,7 +970,7 @@ static __inline__ int var_to_refresh(const struct fb_var_screeninfo *var)
  *                Various intialisation functions              *
  ***************************************************************/
 
-static void __devinit get_initial_mode(struct intelfb_info *dinfo)
+static void get_initial_mode(struct intelfb_info *dinfo)
 {
 	struct fb_var_screeninfo *var;
 	int xtot, ytot;
@@ -1037,7 +1037,7 @@ static void __devinit get_initial_mode(struct intelfb_info *dinfo)
 	}
 }
 
-static int __devinit intelfb_init_var(struct intelfb_info *dinfo)
+static int intelfb_init_var(struct intelfb_info *dinfo)
 {
 	struct fb_var_screeninfo *var;
 	int msrc = 0;
@@ -1118,7 +1118,7 @@ static int __devinit intelfb_init_var(struct intelfb_info *dinfo)
 	return 0;
 }
 
-static int __devinit intelfb_set_fbinfo(struct intelfb_info *dinfo)
+static int intelfb_set_fbinfo(struct intelfb_info *dinfo)
 {
 	struct fb_info *info = dinfo->info;
 
diff --git a/drivers/video/jz4740_fb.c b/drivers/video/jz4740_fb.c
index cb867b6..f5c645a 100644
--- a/drivers/video/jz4740_fb.c
+++ b/drivers/video/jz4740_fb.c
@@ -619,7 +619,7 @@ static struct  fb_ops jzfb_ops = {
 	.fb_setcolreg = jzfb_setcolreg,
 };
 
-static int __devinit jzfb_probe(struct platform_device *pdev)
+static int jzfb_probe(struct platform_device *pdev)
 {
 	int ret;
 	struct jzfb *jzfb;
diff --git a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c
index 2293f6a..2c498d8 100644
--- a/drivers/video/kyro/fbdev.c
+++ b/drivers/video/kyro/fbdev.c
@@ -667,7 +667,7 @@ static struct fb_ops kyrofb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-static int __devinit kyrofb_probe(struct pci_dev *pdev,
+static int kyrofb_probe(struct pci_dev *pdev,
 				  const struct pci_device_id *ent)
 {
 	struct fb_info *info;
diff --git a/drivers/video/leo.c b/drivers/video/leo.c
index 52a8678..8c64c79 100644
--- a/drivers/video/leo.c
+++ b/drivers/video/leo.c
@@ -547,7 +547,7 @@ static void leo_unmap_regs(struct platform_device *op, struct fb_info *info,
 		of_iounmap(&op->resource[0], info->screen_base, 0x800000);
 }
 
-static int __devinit leo_probe(struct platform_device *op)
+static int leo_probe(struct platform_device *op)
 {
 	struct device_node *dp = op->dev.of_node;
 	struct fb_info *info;
diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c b/drivers/video/mb862xx/mb862xxfbdrv.c
index 3025cbb..9f88328 100644
--- a/drivers/video/mb862xx/mb862xxfbdrv.c
+++ b/drivers/video/mb862xx/mb862xxfbdrv.c
@@ -668,7 +668,7 @@ static int mb862xx_gdc_init(struct mb862xxfb_par *par)
 	return 0;
 }
 
-static int __devinit of_platform_mb862xx_probe(struct platform_device *ofdev)
+static int of_platform_mb862xx_probe(struct platform_device *ofdev)
 {
 	struct device_node *np = ofdev->dev.of_node;
 	struct device *dev = &ofdev->dev;
@@ -995,7 +995,7 @@ static struct pci_device_id mb862xx_pci_tbl[] __devinitdata = {
 
 MODULE_DEVICE_TABLE(pci, mb862xx_pci_tbl);
 
-static int __devinit mb862xx_pci_probe(struct pci_dev *pdev,
+static int mb862xx_pci_probe(struct pci_dev *pdev,
 				       const struct pci_device_id *ent)
 {
 	struct mb862xxfb_par *par;
@@ -1178,7 +1178,7 @@ static struct pci_driver mb862xxfb_pci_driver = {
 };
 #endif
 
-static int __devinit mb862xxfb_init(void)
+static int mb862xxfb_init(void)
 {
 	int ret = -ENODEV;
 
diff --git a/drivers/video/mbx/mbxdebugfs.c b/drivers/video/mbx/mbxdebugfs.c
index 12dec76..474f94f 100644
--- a/drivers/video/mbx/mbxdebugfs.c
+++ b/drivers/video/mbx/mbxdebugfs.c
@@ -213,7 +213,7 @@ static const struct file_operations misc_fops = {
 	.llseek = default_llseek,
 };
 
-static void __devinit mbxfb_debugfs_init(struct fb_info *fbi)
+static void mbxfb_debugfs_init(struct fb_info *fbi)
 {
 	struct mbxfb_info *mfbi = fbi->par;
 	struct mbxfb_debugfs_data *dbg;
diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c
index a8ba922..91bf913 100644
--- a/drivers/video/mbx/mbxfb.c
+++ b/drivers/video/mbx/mbxfb.c
@@ -687,7 +687,7 @@ static struct fb_ops mbxfb_ops = {
   Enable external SDRAM controller. Assume that all clocks are active
   by now.
 */
-static void __devinit setup_memc(struct fb_info *fbi)
+static void setup_memc(struct fb_info *fbi)
 {
 	unsigned long tmp;
 	int i;
@@ -747,7 +747,7 @@ static void enable_clocks(struct fb_info *fbi)
 	write_reg_dly(0x00000001, PIXCLKDIV);
 }
 
-static void __devinit setup_graphics(struct fb_info *fbi)
+static void setup_graphics(struct fb_info *fbi)
 {
 	unsigned long gsctrl;
 	unsigned long vscadr;
@@ -781,7 +781,7 @@ static void __devinit setup_graphics(struct fb_info *fbi)
 	write_reg_dly(vscadr, VSCADR);
 }
 
-static void __devinit setup_display(struct fb_info *fbi)
+static void setup_display(struct fb_info *fbi)
 {
 	unsigned long dsctrl = 0;
 
@@ -795,7 +795,7 @@ static void __devinit setup_display(struct fb_info *fbi)
 	write_reg_dly((readl(DSCTRL) | DSCTRL_SYNCGEN_EN), DSCTRL);
 }
 
-static void __devinit enable_controller(struct fb_info *fbi)
+static void enable_controller(struct fb_info *fbi)
 {
 	u32 svctrl, shctrl;
 
@@ -881,7 +881,7 @@ static int mbxfb_resume(struct platform_device *dev)
 
 #define res_size(_r) (((_r)->end - (_r)->start) + 1)
 
-static int __devinit mbxfb_probe(struct platform_device *dev)
+static int mbxfb_probe(struct platform_device *dev)
 {
 	int ret;
 	struct fb_info *fbi;
diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c
index c0c358c..d148067 100644
--- a/drivers/video/metronomefb.c
+++ b/drivers/video/metronomefb.c
@@ -167,7 +167,7 @@ static u16 calc_img_cksum(u16 *start, int length)
 }
 
 /* here we decode the incoming waveform file and populate metromem */
-static int __devinit load_waveform(u8 *mem, size_t size, int m, int t,
+static int load_waveform(u8 *mem, size_t size, int m, int t,
 				struct metronomefb_par *par)
 {
 	int tta;
@@ -338,7 +338,7 @@ static int metronome_display_cmd(struct metronomefb_par *par)
 	return par->board->met_wait_event_intr(par);
 }
 
-static int __devinit metronome_powerup_cmd(struct metronomefb_par *par)
+static int metronome_powerup_cmd(struct metronomefb_par *par)
 {
 	int i;
 	u16 cs;
@@ -367,7 +367,7 @@ static int __devinit metronome_powerup_cmd(struct metronomefb_par *par)
 	return par->board->met_wait_event(par);
 }
 
-static int __devinit metronome_config_cmd(struct metronomefb_par *par)
+static int metronome_config_cmd(struct metronomefb_par *par)
 {
 	/* setup config command
 	we can't immediately set the opcode since the controller
@@ -385,7 +385,7 @@ static int __devinit metronome_config_cmd(struct metronomefb_par *par)
 	return par->board->met_wait_event(par);
 }
 
-static int __devinit metronome_init_cmd(struct metronomefb_par *par)
+static int metronome_init_cmd(struct metronomefb_par *par)
 {
 	int i;
 	u16 cs;
@@ -411,7 +411,7 @@ static int __devinit metronome_init_cmd(struct metronomefb_par *par)
 	return par->board->met_wait_event(par);
 }
 
-static int __devinit metronome_init_regs(struct metronomefb_par *par)
+static int metronome_init_regs(struct metronomefb_par *par)
 {
 	int res;
 
@@ -569,7 +569,7 @@ static struct fb_deferred_io metronomefb_defio = {
 	.deferred_io	= metronomefb_dpy_deferred_io,
 };
 
-static int __devinit metronomefb_probe(struct platform_device *dev)
+static int metronomefb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	struct metronome_board *board;
diff --git a/drivers/video/msm/mddi.c b/drivers/video/msm/mddi.c
index 35ac9e8..88e9f41c 100644
--- a/drivers/video/msm/mddi.c
+++ b/drivers/video/msm/mddi.c
@@ -417,7 +417,7 @@ static void mddi_resume(struct msm_mddi_client_data *cdata)
 	mddi_set_auto_hibernate(&mddi->client_data, 1);
 }
 
-static int __devinit mddi_get_client_caps(struct mddi_info *mddi)
+static int mddi_get_client_caps(struct mddi_info *mddi)
 {
 	int i, j;
 
@@ -619,7 +619,7 @@ uint32_t mddi_remote_read(struct msm_mddi_client_data *cdata, uint32_t reg)
 
 static struct mddi_info mddi_info[2];
 
-static int __devinit mddi_clk_setup(struct platform_device *pdev,
+static int mddi_clk_setup(struct platform_device *pdev,
 				    struct mddi_info *mddi,
 				    unsigned long clk_rate)
 {
@@ -664,7 +664,7 @@ static int __init mddi_rev_data_setup(struct mddi_info *mddi)
 	return 0;
 }
 
-static int __devinit mddi_probe(struct platform_device *pdev)
+static int mddi_probe(struct platform_device *pdev)
 {
 	struct msm_mddi_platform_data *pdata = pdev->dev.platform_data;
 	struct mddi_info *mddi = &mddi_info[pdev->id];
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index ddac96d..be26b36 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -586,7 +586,7 @@ static struct fb_ops mxsfb_ops = {
 	.fb_imageblit = cfb_imageblit,
 };
 
-static int __devinit mxsfb_restore_mode(struct mxsfb_info *host)
+static int mxsfb_restore_mode(struct mxsfb_info *host)
 {
 	struct fb_info *fb_info = &host->fb_info;
 	unsigned line_count;
@@ -677,7 +677,7 @@ static int __devinit mxsfb_restore_mode(struct mxsfb_info *host)
 	return 0;
 }
 
-static int __devinit mxsfb_init_fbinfo(struct mxsfb_info *host)
+static int mxsfb_init_fbinfo(struct mxsfb_info *host)
 {
 	struct fb_info *fb_info = &host->fb_info;
 	struct fb_var_screeninfo *var = &fb_info->var;
@@ -772,7 +772,7 @@ static const struct of_device_id mxsfb_dt_ids[] = {
 };
 MODULE_DEVICE_TABLE(of, mxsfb_dt_ids);
 
-static int __devinit mxsfb_probe(struct platform_device *pdev)
+static int mxsfb_probe(struct platform_device *pdev)
 {
 	const struct of_device_id *of_id =
 			of_match_device(mxsfb_dt_ids, &pdev->dev);
diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
index 15c3bef..4cd9e6d 100644
--- a/drivers/video/neofb.c
+++ b/drivers/video/neofb.c
@@ -1646,7 +1646,7 @@ static struct fb_videomode __devinitdata mode800x480 = {
 	.vmode          = FB_VMODE_NONINTERLACED
 };
 
-static int __devinit neo_map_mmio(struct fb_info *info,
+static int neo_map_mmio(struct fb_info *info,
 				  struct pci_dev *dev)
 {
 	struct neofb_par *par = info->par;
@@ -1707,7 +1707,7 @@ static void neo_unmap_mmio(struct fb_info *info)
 			   info->fix.mmio_len);
 }
 
-static int __devinit neo_map_video(struct fb_info *info,
+static int neo_map_video(struct fb_info *info,
 				   struct pci_dev *dev, int video_len)
 {
 	//unsigned long addr;
@@ -1772,7 +1772,7 @@ static void neo_unmap_video(struct fb_info *info)
 			   info->fix.smem_len);
 }
 
-static int __devinit neo_scan_monitor(struct fb_info *info)
+static int neo_scan_monitor(struct fb_info *info)
 {
 	struct neofb_par *par = info->par;
 	unsigned char type, display;
@@ -1851,7 +1851,7 @@ static int __devinit neo_scan_monitor(struct fb_info *info)
 	return 0;
 }
 
-static int __devinit neo_init_hw(struct fb_info *info)
+static int neo_init_hw(struct fb_info *info)
 {
 	struct neofb_par *par = info->par;
 	int videoRam = 896;
@@ -1939,7 +1939,7 @@ static int __devinit neo_init_hw(struct fb_info *info)
 }
 
 
-static struct fb_info *__devinit neo_alloc_fb_info(struct pci_dev *dev, const struct
+static struct fb_info *neo_alloc_fb_info(struct pci_dev *dev, const struct
 						   pci_device_id *id)
 {
 	struct fb_info *info;
@@ -2038,7 +2038,7 @@ static void neo_free_fb_info(struct fb_info *info)
 
 /* --------------------------------------------------------------------- */
 
-static int __devinit neofb_probe(struct pci_dev *dev,
+static int neofb_probe(struct pci_dev *dev,
 				 const struct pci_device_id *id)
 {
 	struct fb_info *info;
diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c
index 475dfee..32581c7 100644
--- a/drivers/video/nuc900fb.c
+++ b/drivers/video/nuc900fb.c
@@ -387,7 +387,7 @@ static int nuc900fb_init_registers(struct fb_info *info)
  *    The buffer should be a non-cached, non-buffered, memory region
  *    to allow palette and pixel writes without flushing the cache.
  */
-static int __devinit nuc900fb_map_video_memory(struct fb_info *info)
+static int nuc900fb_map_video_memory(struct fb_info *info)
 {
 	struct nuc900fb_info *fbi = info->par;
 	dma_addr_t map_dma;
@@ -499,7 +499,7 @@ static inline void nuc900fb_cpufreq_deregister(struct nuc900fb_info *info)
 
 static char driver_name[] = "nuc900fb";
 
-static int __devinit nuc900fb_probe(struct platform_device *pdev)
+static int nuc900fb_probe(struct platform_device *pdev)
 {
 	struct nuc900fb_info *fbi;
 	struct nuc900fb_display *display;
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c
index 0bbed28..ca8963c 100644
--- a/drivers/video/nvidia/nvidia.c
+++ b/drivers/video/nvidia/nvidia.c
@@ -1105,7 +1105,7 @@ fail:
 #define nvidiafb_resume NULL
 #endif
 
-static int __devinit nvidia_set_fbinfo(struct fb_info *info)
+static int nvidia_set_fbinfo(struct fb_info *info)
 {
 	struct fb_monspecs *specs = &info->monspecs;
 	struct fb_videomode modedb;
@@ -1201,7 +1201,7 @@ static int __devinit nvidia_set_fbinfo(struct fb_info *info)
 	return nvidiafb_check_var(&info->var, info);
 }
 
-static u32 __devinit nvidia_get_chipset(struct fb_info *info)
+static u32 nvidia_get_chipset(struct fb_info *info)
 {
 	struct nvidia_par *par = info->par;
 	u32 id = (par->pci_dev->vendor << 16) | par->pci_dev->device;
@@ -1224,7 +1224,7 @@ static u32 __devinit nvidia_get_chipset(struct fb_info *info)
 	return id;
 }
 
-static u32 __devinit nvidia_get_arch(struct fb_info *info)
+static u32 nvidia_get_arch(struct fb_info *info)
 {
 	struct nvidia_par *par = info->par;
 	u32 arch = 0;
@@ -1276,7 +1276,7 @@ static u32 __devinit nvidia_get_arch(struct fb_info *info)
 	return arch;
 }
 
-static int __devinit nvidiafb_probe(struct pci_dev *pd,
+static int nvidiafb_probe(struct pci_dev *pd,
 				    const struct pci_device_id *ent)
 {
 	struct nvidia_par *par;
@@ -1473,7 +1473,7 @@ static void __devexit nvidiafb_remove(struct pci_dev *pd)
  * ------------------------------------------------------------------------- */
 
 #ifndef MODULE
-static int __devinit nvidiafb_setup(char *options)
+static int nvidiafb_setup(char *options)
 {
 	char *this_opt;
 
@@ -1538,7 +1538,7 @@ static struct pci_driver nvidiafb_driver = {
  *
  * ------------------------------------------------------------------------- */
 
-static int __devinit nvidiafb_init(void)
+static int nvidiafb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
diff --git a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
index bae244f..4ed48af 100644
--- a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
+++ b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
@@ -250,7 +250,7 @@ static void init_lb035q02_panel(struct spi_device *spi)
 	lb035q02_write_reg(spi, 0x3b, 0x0806);
 }
 
-static int __devinit lb035q02_panel_spi_probe(struct spi_device *spi)
+static int lb035q02_panel_spi_probe(struct spi_device *spi)
 {
 	init_lb035q02_panel(spi);
 	return omap_dss_register_driver(&lb035q02_driver);
diff --git a/drivers/video/p9100.c b/drivers/video/p9100.c
index f402a69..62d8339 100644
--- a/drivers/video/p9100.c
+++ b/drivers/video/p9100.c
@@ -249,7 +249,7 @@ static void p9100_init_fix(struct fb_info *info, int linebytes, struct device_no
 	info->fix.accel = FB_ACCEL_SUN_CGTHREE;
 }
 
-static int __devinit p9100_probe(struct platform_device *op)
+static int p9100_probe(struct platform_device *op)
 {
 	struct device_node *dp = op->dev.of_node;
 	struct fb_info *info;
diff --git a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c
index 6694923..f638002 100644
--- a/drivers/video/platinumfb.c
+++ b/drivers/video/platinumfb.c
@@ -313,7 +313,7 @@ static void platinum_set_hardware(struct fb_info_platinum *pinfo)
 /*
  * Set misc info vars for this driver
  */
-static void __devinit platinum_init_info(struct fb_info *info, struct fb_info_platinum *pinfo)
+static void platinum_init_info(struct fb_info *info, struct fb_info_platinum *pinfo)
 {
 	/* Fill fb_info */
 	info->fbops = &platinumfb_ops;
@@ -338,7 +338,7 @@ static void __devinit platinum_init_info(struct fb_info *info, struct fb_info_pl
 }
 
 
-static int __devinit platinum_init_fb(struct fb_info *info)
+static int platinum_init_fb(struct fb_info *info)
 {
 	struct fb_info_platinum *pinfo = info->par;
 	struct fb_var_screeninfo var;
@@ -533,7 +533,7 @@ static int __init platinumfb_setup(char *options)
 #define invalidate_cache(addr)
 #endif
 
-static int __devinit platinumfb_probe(struct platform_device* odev)
+static int platinumfb_probe(struct platform_device* odev)
 {
 	struct device_node	*dp = odev->dev.of_node;
 	struct fb_info		*info;
diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c
index c4f639a..70192ba 100644
--- a/drivers/video/pm2fb.c
+++ b/drivers/video/pm2fb.c
@@ -1515,7 +1515,7 @@ static struct fb_ops pm2fb_ops = {
  * @param	pdev	PCI device.
  * @param	id	PCI device ID.
  */
-static int __devinit pm2fb_probe(struct pci_dev *pdev,
+static int pm2fb_probe(struct pci_dev *pdev,
 				 const struct pci_device_id *id)
 {
 	struct pm2fb_par *default_par;
diff --git a/drivers/video/pm3fb.c b/drivers/video/pm3fb.c
index e9d8e23..1fdae1d 100644
--- a/drivers/video/pm3fb.c
+++ b/drivers/video/pm3fb.c
@@ -1229,7 +1229,7 @@ static struct fb_ops pm3fb_ops = {
 
 /* mmio register are already mapped when this function is called */
 /* the pm3fb_fix.smem_start is also set */
-static unsigned long __devinit pm3fb_size_memory(struct pm3_par *par)
+static unsigned long pm3fb_size_memory(struct pm3_par *par)
 {
 	unsigned long	memsize = 0;
 	unsigned long	tempBypass, i, temp1, temp2;
@@ -1314,7 +1314,7 @@ static unsigned long __devinit pm3fb_size_memory(struct pm3_par *par)
 	return memsize;
 }
 
-static int __devinit pm3fb_probe(struct pci_dev *dev,
+static int pm3fb_probe(struct pci_dev *dev,
 				  const struct pci_device_id *ent)
 {
 	struct fb_info *info;
diff --git a/drivers/video/pmag-ba-fb.c b/drivers/video/pmag-ba-fb.c
index 9b4a60b..e5d2994 100644
--- a/drivers/video/pmag-ba-fb.c
+++ b/drivers/video/pmag-ba-fb.c
@@ -141,7 +141,7 @@ static void __init pmagbafb_erase_cursor(struct fb_info *info)
 }
 
 
-static int __devinit pmagbafb_probe(struct device *dev)
+static int pmagbafb_probe(struct device *dev)
 {
 	struct tc_dev *tdev = to_tc_dev(dev);
 	resource_size_t start, len;
diff --git a/drivers/video/pmagb-b-fb.c b/drivers/video/pmagb-b-fb.c
index 4e7a9c4..e731baf 100644
--- a/drivers/video/pmagb-b-fb.c
+++ b/drivers/video/pmagb-b-fb.c
@@ -147,7 +147,7 @@ static void __init pmagbbfb_erase_cursor(struct fb_info *info)
 /*
  * Set up screen parameters.
  */
-static void __devinit pmagbbfb_screen_setup(struct fb_info *info)
+static void pmagbbfb_screen_setup(struct fb_info *info)
 {
 	struct pmagbbfb_par *par = info->par;
 
@@ -179,7 +179,7 @@ static void __devinit pmagbbfb_screen_setup(struct fb_info *info)
 /*
  * Determine oscillator configuration.
  */
-static void __devinit pmagbbfb_osc_setup(struct fb_info *info)
+static void pmagbbfb_osc_setup(struct fb_info *info)
 {
 	static unsigned int pmagbbfb_freqs[] __devinitdata = {
 		130808, 119843, 104000, 92980, 74370, 72800,
@@ -246,7 +246,7 @@ static void __devinit pmagbbfb_osc_setup(struct fb_info *info)
 };
 
 
-static int __devinit pmagbbfb_probe(struct device *dev)
+static int pmagbbfb_probe(struct device *dev)
 {
 	struct tc_dev *tdev = to_tc_dev(dev);
 	resource_size_t start, len;
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index 0b340d6..536a098 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -965,7 +965,7 @@ static struct fb_fix_screeninfo ps3fb_fix __initdata = {
 	.accel =	FB_ACCEL_NONE,
 };
 
-static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev)
+static int ps3fb_probe(struct ps3_system_bus_device *dev)
 {
 	struct fb_info *info;
 	struct ps3fb_par *par;
diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c
index 69fc2c3..1192343 100644
--- a/drivers/video/pvr2fb.c
+++ b/drivers/video/pvr2fb.c
@@ -763,7 +763,7 @@ out_unmap:
  * in for flexibility anyways. Who knows, maybe someone has tv-out on a
  * PCI-based version of these things ;-)
  */
-static int __devinit pvr2fb_common_init(void)
+static int pvr2fb_common_init(void)
 {
 	struct pvr2fb_par *par = currentpar;
 	unsigned long modememused, rev;
@@ -922,7 +922,7 @@ static void __exit pvr2fb_dc_exit(void)
 #endif /* CONFIG_SH_DREAMCAST */
 
 #ifdef CONFIG_PCI
-static int __devinit pvr2fb_pci_probe(struct pci_dev *pdev,
+static int pvr2fb_pci_probe(struct pci_dev *pdev,
 				      const struct pci_device_id *ent)
 {
 	int ret;
@@ -993,7 +993,7 @@ static void __exit pvr2fb_pci_exit(void)
 }
 #endif /* CONFIG_PCI */
 
-static int __devinit pvr2_get_param(const struct pvr2_params *p, const char *s,
+static int pvr2_get_param(const struct pvr2_params *p, const char *s,
                                    int val, int size)
 {
 	int i;
diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c
index a8fd898..49af862 100644
--- a/drivers/video/pxa168fb.c
+++ b/drivers/video/pxa168fb.c
@@ -560,7 +560,7 @@ static struct fb_ops pxa168fb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-static int __devinit pxa168fb_init_mode(struct fb_info *info,
+static int pxa168fb_init_mode(struct fb_info *info,
 			      struct pxa168fb_mach_info *mi)
 {
 	struct pxa168fb_info *fbi = info->par;
@@ -600,7 +600,7 @@ static int __devinit pxa168fb_init_mode(struct fb_info *info,
 	return ret;
 }
 
-static int __devinit pxa168fb_probe(struct platform_device *pdev)
+static int pxa168fb_probe(struct platform_device *pdev)
 {
 	struct pxa168fb_mach_info *mi;
 	struct fb_info *info = 0;
diff --git a/drivers/video/pxa3xx-gcu.c b/drivers/video/pxa3xx-gcu.c
index 4493a47..f163474 100644
--- a/drivers/video/pxa3xx-gcu.c
+++ b/drivers/video/pxa3xx-gcu.c
@@ -574,7 +574,7 @@ free_buffers(struct platform_device *dev,
 	priv->free = NULL;
 }
 
-static int __devinit
+static int
 pxa3xx_gcu_probe(struct platform_device *dev)
 {
 	int i, ret, irq;
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index ffa62e2..1ff1a16 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -869,7 +869,7 @@ static struct fb_ops overlay_fb_ops = {
 	.fb_set_par		= overlayfb_set_par,
 };
 
-static void __devinit init_pxafb_overlay(struct pxafb_info *fbi,
+static void init_pxafb_overlay(struct pxafb_info *fbi,
 					 struct pxafb_layer *ofb, int id)
 {
 	sprintf(ofb->fb.fix.id, "overlay%d", id + 1);
@@ -903,7 +903,7 @@ static inline int pxafb_overlay_supported(void)
 	return 0;
 }
 
-static int __devinit pxafb_overlay_map_video_memory(struct pxafb_info *pxafb,
+static int pxafb_overlay_map_video_memory(struct pxafb_info *pxafb,
 	struct pxafb_layer *ofb)
 {
 	/* We assume that user will use at most video_mem_size for overlay fb,
@@ -927,7 +927,7 @@ static int __devinit pxafb_overlay_map_video_memory(struct pxafb_info *pxafb,
 	return 0;
 }
 
-static void __devinit pxafb_overlay_init(struct pxafb_info *fbi)
+static void pxafb_overlay_init(struct pxafb_info *fbi)
 {
 	int i, ret;
 
@@ -1706,7 +1706,7 @@ static const struct dev_pm_ops pxafb_pm_ops = {
 };
 #endif
 
-static int __devinit pxafb_init_video_memory(struct pxafb_info *fbi)
+static int pxafb_init_video_memory(struct pxafb_info *fbi)
 {
 	int size = PAGE_ALIGN(fbi->video_mem_size);
 
@@ -1789,7 +1789,7 @@ decode_mode:
 		fbi->video_mem_size = video_mem_size;
 }
 
-static struct pxafb_info * __devinit pxafb_init_fbinfo(struct device *dev)
+static struct pxafb_info *pxafb_init_fbinfo(struct device *dev)
 {
 	struct pxafb_info *fbi;
 	void *addr;
@@ -1853,7 +1853,7 @@ static struct pxafb_info * __devinit pxafb_init_fbinfo(struct device *dev)
 }
 
 #ifdef CONFIG_FB_PXA_PARAMETERS
-static int __devinit parse_opt_mode(struct device *dev, const char *this_opt)
+static int parse_opt_mode(struct device *dev, const char *this_opt)
 {
 	struct pxafb_mach_info *inf = dev->platform_data;
 
@@ -1912,7 +1912,7 @@ done:
 	return 0;
 }
 
-static int __devinit parse_opt(struct device *dev, char *this_opt)
+static int parse_opt(struct device *dev, char *this_opt)
 {
 	struct pxafb_mach_info *inf = dev->platform_data;
 	struct pxafb_mode_info *mode = &inf->modes[0];
@@ -2012,7 +2012,7 @@ static int __devinit parse_opt(struct device *dev, char *this_opt)
 	return 0;
 }
 
-static int __devinit pxafb_parse_options(struct device *dev, char *options)
+static int pxafb_parse_options(struct device *dev, char *options)
 {
 	char *this_opt;
 	int ret;
@@ -2061,7 +2061,7 @@ MODULE_PARM_DESC(options, "LCD parameters (see Documentation/fb/pxafb.txt)");
 #ifdef DEBUG_VAR
 /* Check for various illegal bit-combinations. Currently only
  * a warning is given. */
-static void __devinit pxafb_check_options(struct device *dev,
+static void pxafb_check_options(struct device *dev,
 					  struct pxafb_mach_info *inf)
 {
 	if (inf->lcd_conn)
@@ -2094,7 +2094,7 @@ static void __devinit pxafb_check_options(struct device *dev,
 #define pxafb_check_options(...)	do {} while (0)
 #endif
 
-static int __devinit pxafb_probe(struct platform_device *dev)
+static int pxafb_probe(struct platform_device *dev)
 {
 	struct pxafb_info *fbi;
 	struct pxafb_mach_info *inf;
diff --git a/drivers/video/q40fb.c b/drivers/video/q40fb.c
index a104e8c..d1a7529 100644
--- a/drivers/video/q40fb.c
+++ b/drivers/video/q40fb.c
@@ -83,7 +83,7 @@ static struct fb_ops q40fb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-static int __devinit q40fb_probe(struct platform_device *dev)
+static int q40fb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 693ed5e..49caea2 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -1709,7 +1709,7 @@ static struct fb_ops riva_fb_ops = {
 	.fb_sync 	= rivafb_sync,
 };
 
-static int __devinit riva_set_fbinfo(struct fb_info *info)
+static int riva_set_fbinfo(struct fb_info *info)
 {
 	unsigned int cmap_len;
 	struct riva_par *par = info->par;
@@ -1747,7 +1747,7 @@ static int __devinit riva_set_fbinfo(struct fb_info *info)
 }
 
 #ifdef CONFIG_PPC_OF
-static int __devinit riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
+static int riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
 {
 	struct riva_par *par = info->par;
 	struct device_node *dp;
@@ -1780,7 +1780,7 @@ static int __devinit riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
 #endif /* CONFIG_PPC_OF */
 
 #if defined(CONFIG_FB_RIVA_I2C) && !defined(CONFIG_PPC_OF)
-static int __devinit riva_get_EDID_i2c(struct fb_info *info)
+static int riva_get_EDID_i2c(struct fb_info *info)
 {
 	struct riva_par *par = info->par;
 	struct fb_var_screeninfo var;
@@ -1803,7 +1803,7 @@ static int __devinit riva_get_EDID_i2c(struct fb_info *info)
 }
 #endif /* CONFIG_FB_RIVA_I2C */
 
-static void __devinit riva_update_default_var(struct fb_var_screeninfo *var,
+static void riva_update_default_var(struct fb_var_screeninfo *var,
 					      struct fb_info *info)
 {
 	struct fb_monspecs *specs = &info->monspecs;
@@ -1836,7 +1836,7 @@ static void __devinit riva_update_default_var(struct fb_var_screeninfo *var,
 }
 
 
-static void __devinit riva_get_EDID(struct fb_info *info, struct pci_dev *pdev)
+static void riva_get_EDID(struct fb_info *info, struct pci_dev *pdev)
 {
 	NVTRACE_ENTER();
 #ifdef CONFIG_PPC_OF
@@ -1850,7 +1850,7 @@ static void __devinit riva_get_EDID(struct fb_info *info, struct pci_dev *pdev)
 }
 
 
-static void __devinit riva_get_edidinfo(struct fb_info *info)
+static void riva_get_edidinfo(struct fb_info *info)
 {
 	struct fb_var_screeninfo *var = &rivafb_default_var;
 	struct riva_par *par = info->par;
@@ -1871,7 +1871,7 @@ static void __devinit riva_get_edidinfo(struct fb_info *info)
  *
  * ------------------------------------------------------------------------- */
 
-static u32 __devinit riva_get_arch(struct pci_dev *pd)
+static u32 riva_get_arch(struct pci_dev *pd)
 {
     	u32 arch = 0;
 
@@ -1909,7 +1909,7 @@ static u32 __devinit riva_get_arch(struct pci_dev *pd)
 	return arch;
 }
 
-static int __devinit rivafb_probe(struct pci_dev *pd,
+static int rivafb_probe(struct pci_dev *pd,
 			     	const struct pci_device_id *ent)
 {
 	struct riva_par *default_par;
@@ -2145,7 +2145,7 @@ static void __devexit rivafb_remove(struct pci_dev *pd)
  * ------------------------------------------------------------------------- */
 
 #ifndef MODULE
-static int __devinit rivafb_setup(char *options)
+static int rivafb_setup(char *options)
 {
 	char *this_opt;
 
@@ -2197,7 +2197,7 @@ static struct pci_driver rivafb_driver = {
  *
  * ------------------------------------------------------------------------- */
 
-static int __devinit rivafb_init(void)
+static int rivafb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
diff --git a/drivers/video/riva/rivafb-i2c.c b/drivers/video/riva/rivafb-i2c.c
index 167400e..db78ac8 100644
--- a/drivers/video/riva/rivafb-i2c.c
+++ b/drivers/video/riva/rivafb-i2c.c
@@ -86,7 +86,7 @@ static int riva_gpio_getsda(void* data)
 	return val;
 }
 
-static int __devinit riva_setup_i2c_bus(struct riva_i2c_chan *chan,
+static int riva_setup_i2c_bus(struct riva_i2c_chan *chan,
 					const char *name,
 					unsigned int i2c_class)
 {
@@ -124,7 +124,7 @@ static int __devinit riva_setup_i2c_bus(struct riva_i2c_chan *chan,
 	return rc;
 }
 
-void __devinit riva_create_i2c_busses(struct riva_par *par)
+void riva_create_i2c_busses(struct riva_par *par)
 {
 	par->chan[0].par	= par;
 	par->chan[1].par	= par;
@@ -150,7 +150,7 @@ void riva_delete_i2c_busses(struct riva_par *par)
 	}
 }
 
-int __devinit riva_probe_i2c_connector(struct riva_par *par, int conn, u8 **out_edid)
+int riva_probe_i2c_connector(struct riva_par *par, int conn, u8 **out_edid)
 {
 	u8 *edid = NULL;
 
diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c
index 28b1c6c..f7839e1 100644
--- a/drivers/video/s1d13xxxfb.c
+++ b/drivers/video/s1d13xxxfb.c
@@ -642,7 +642,7 @@ static int s1d13xxxfb_width_tab[2][4] __devinitdata = {
  *	Note: some of the hardcoded values here might need some love to
  *	work on various chips, and might need to no longer be hardcoded.
  */
-static void __devinit
+static void
 s1d13xxxfb_fetch_hw_state(struct fb_info *info)
 {
 	struct fb_var_screeninfo *var = &info->var;
@@ -764,7 +764,7 @@ s1d13xxxfb_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int __devinit
+static int
 s1d13xxxfb_probe(struct platform_device *pdev)
 {
 	struct s1d13xxxfb_par *default_par;
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 71981a5..141fefd 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -1079,7 +1079,7 @@ static void s3c_fb_missing_pixclock(struct fb_videomode *mode)
  *
  * Allocate memory for the given framebuffer.
  */
-static int __devinit s3c_fb_alloc_memory(struct s3c_fb *sfb,
+static int s3c_fb_alloc_memory(struct s3c_fb *sfb,
 					 struct s3c_fb_win *win)
 {
 	struct s3c_fb_pd_win *windata = win->windata;
@@ -1170,7 +1170,7 @@ static void s3c_fb_release_win(struct s3c_fb *sfb, struct s3c_fb_win *win)
  * Allocate and do the basic initialisation for one of the hardware's graphics
  * windows.
  */
-static int __devinit s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
+static int s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
 				      struct s3c_fb_win_variant *variant,
 				      struct s3c_fb_win **res)
 {
@@ -1358,7 +1358,7 @@ static void s3c_fb_clear_win(struct s3c_fb *sfb, int win)
 	}
 }
 
-static int __devinit s3c_fb_probe(struct platform_device *pdev)
+static int s3c_fb_probe(struct platform_device *pdev)
 {
 	const struct platform_device_id *platid;
 	struct s3c_fb_driverdata *fbdrv;
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index fbf3cea..528cec6 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -637,7 +637,7 @@ static struct fb_ops s3c2410fb_ops = {
  *	cache.  Once this area is remapped, all virtual memory
  *	access to the video memory should occur at the new region.
  */
-static int __devinit s3c2410fb_map_video_memory(struct fb_info *info)
+static int s3c2410fb_map_video_memory(struct fb_info *info)
 {
 	struct s3c2410fb_info *fbi = info->par;
 	dma_addr_t map_dma;
@@ -819,7 +819,7 @@ static inline void s3c2410fb_cpufreq_deregister(struct s3c2410fb_info *info)
 
 static const char driver_name[] = "s3c2410fb";
 
-static int __devinit s3c24xxfb_probe(struct platform_device *pdev,
+static int s3c24xxfb_probe(struct platform_device *pdev,
 				  enum s3c_drv_type drv_type)
 {
 	struct s3c2410fb_info *info;
@@ -1010,12 +1010,12 @@ dealloc_fb:
 	return ret;
 }
 
-static int __devinit s3c2410fb_probe(struct platform_device *pdev)
+static int s3c2410fb_probe(struct platform_device *pdev)
 {
 	return s3c24xxfb_probe(pdev, DRV_S3C2410);
 }
 
-static int __devinit s3c2412fb_probe(struct platform_device *pdev)
+static int s3c2412fb_probe(struct platform_device *pdev)
 {
 	return s3c24xxfb_probe(pdev, DRV_S3C2412);
 }
diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c
index 1b4f146..e66ecbb 100644
--- a/drivers/video/s3fb.c
+++ b/drivers/video/s3fb.c
@@ -255,7 +255,7 @@ static int s3fb_ddc_getsda(void *data)
 	return !!(s3fb_ddc_read(par) & DDC_SDA_IN);
 }
 
-static int __devinit s3fb_setup_ddc_bus(struct fb_info *info)
+static int s3fb_setup_ddc_bus(struct fb_info *info)
 {
 	struct s3fb_info *par = info->par;
 
@@ -1066,7 +1066,7 @@ static struct fb_ops s3fb_ops = {
 
 /* ------------------------------------------------------------------------- */
 
-static int __devinit s3_identification(struct s3fb_info *par)
+static int s3_identification(struct s3fb_info *par)
 {
 	int chip = par->chip;
 
@@ -1122,7 +1122,7 @@ static int __devinit s3_identification(struct s3fb_info *par)
 
 /* PCI probe */
 
-static int __devinit s3_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
+static int s3_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 {
 	struct pci_bus_region bus_reg;
 	struct resource vga_res;
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index b632584..5e79fea 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -1090,7 +1090,7 @@ static int sa1100fb_resume(struct platform_device *dev)
  *      cache.  Once this area is remapped, all virtual memory
  *      access to the video memory should occur at the new region.
  */
-static int __devinit sa1100fb_map_video_memory(struct sa1100fb_info *fbi)
+static int sa1100fb_map_video_memory(struct sa1100fb_info *fbi)
 {
 	/*
 	 * We reserve one page for the palette, plus the size
@@ -1124,7 +1124,7 @@ static struct fb_monspecs monspecs __devinitdata = {
 };
 
 
-static struct sa1100fb_info * __devinit sa1100fb_init_fbinfo(struct device *dev)
+static struct sa1100fb_info *sa1100fb_init_fbinfo(struct device *dev)
 {
 	struct sa1100fb_mach_info *inf = dev->platform_data;
 	struct sa1100fb_info *fbi;
@@ -1205,7 +1205,7 @@ static struct sa1100fb_info * __devinit sa1100fb_init_fbinfo(struct device *dev)
 	return fbi;
 }
 
-static int __devinit sa1100fb_probe(struct platform_device *pdev)
+static int sa1100fb_probe(struct platform_device *pdev)
 {
 	struct sa1100fb_info *fbi;
 	struct resource *res;
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index a1cc484..dbf8d62 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -1715,7 +1715,7 @@ static void savage_disable_mmio(struct savagefb_par *par)
 }
 
 
-static int __devinit savage_map_mmio(struct fb_info *info)
+static int savage_map_mmio(struct fb_info *info)
 {
 	struct savagefb_par *par = info->par;
 	DBG("savage_map_mmio");
@@ -1761,7 +1761,7 @@ static void savage_unmap_mmio(struct fb_info *info)
 	}
 }
 
-static int __devinit savage_map_video(struct fb_info *info,
+static int savage_map_video(struct fb_info *info,
 				      int video_len)
 {
 	struct savagefb_par *par = info->par;
@@ -2052,7 +2052,7 @@ static int savage_init_hw(struct savagefb_par *par)
 	return videoRambytes;
 }
 
-static int __devinit savage_init_fb_info(struct fb_info *info,
+static int savage_init_fb_info(struct fb_info *info,
 					 struct pci_dev *dev,
 					 const struct pci_device_id *id)
 {
@@ -2178,7 +2178,7 @@ static int __devinit savage_init_fb_info(struct fb_info *info,
 
 /* --------------------------------------------------------------------- */
 
-static int __devinit savagefb_probe(struct pci_dev* dev,
+static int savagefb_probe(struct pci_dev* dev,
 				    const struct pci_device_id* id)
 {
 	struct fb_info *info;
diff --git a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c
index b5c30b9..c65ab22 100644
--- a/drivers/video/sgivwfb.c
+++ b/drivers/video/sgivwfb.c
@@ -745,7 +745,7 @@ int __init sgivwfb_setup(char *options)
 /*
  *  Initialisation
  */
-static int __devinit sgivwfb_probe(struct platform_device *dev)
+static int sgivwfb_probe(struct platform_device *dev)
 {
 	struct sgivw_par *par;
 	struct fb_info *info;
diff --git a/drivers/video/sh7760fb.c b/drivers/video/sh7760fb.c
index ff93339..0ad44d1 100644
--- a/drivers/video/sh7760fb.c
+++ b/drivers/video/sh7760fb.c
@@ -431,7 +431,7 @@ static int sh7760fb_alloc_mem(struct fb_info *info)
 	return 0;
 }
 
-static int __devinit sh7760fb_probe(struct platform_device *pdev)
+static int sh7760fb_probe(struct platform_device *pdev)
 {
 	struct fb_info *info;
 	struct resource *res;
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index 699487c..d776bfe 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -1639,7 +1639,7 @@ sh_mobile_lcdc_overlay_fb_unregister(struct sh_mobile_lcdc_overlay *ovl)
 	unregister_framebuffer(ovl->info);
 }
 
-static int __devinit
+static int
 sh_mobile_lcdc_overlay_fb_register(struct sh_mobile_lcdc_overlay *ovl)
 {
 	struct sh_mobile_lcdc_priv *lcdc = ovl->channel->lcdc;
@@ -1678,7 +1678,7 @@ sh_mobile_lcdc_overlay_fb_cleanup(struct sh_mobile_lcdc_overlay *ovl)
 	framebuffer_release(info);
 }
 
-static int __devinit
+static int
 sh_mobile_lcdc_overlay_fb_init(struct sh_mobile_lcdc_overlay *ovl)
 {
 	struct sh_mobile_lcdc_priv *priv = ovl->channel->lcdc;
@@ -2117,7 +2117,7 @@ sh_mobile_lcdc_channel_fb_unregister(struct sh_mobile_lcdc_chan *ch)
 		unregister_framebuffer(ch->info);
 }
 
-static int __devinit
+static int
 sh_mobile_lcdc_channel_fb_register(struct sh_mobile_lcdc_chan *ch)
 {
 	struct fb_info *info = ch->info;
@@ -2165,7 +2165,7 @@ sh_mobile_lcdc_channel_fb_cleanup(struct sh_mobile_lcdc_chan *ch)
 	framebuffer_release(info);
 }
 
-static int __devinit
+static int
 sh_mobile_lcdc_channel_fb_init(struct sh_mobile_lcdc_chan *ch,
 			       const struct fb_videomode *mode,
 			       unsigned int num_modes)
@@ -2475,7 +2475,7 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int __devinit sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *ch)
+static int sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *ch)
 {
 	int interface_type = ch->cfg->interface_type;
 
@@ -2515,7 +2515,7 @@ static int __devinit sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *
 	return 0;
 }
 
-static int __devinit
+static int
 sh_mobile_lcdc_overlay_init(struct sh_mobile_lcdc_priv *priv,
 			  struct sh_mobile_lcdc_overlay *ovl)
 {
@@ -2570,7 +2570,7 @@ sh_mobile_lcdc_overlay_init(struct sh_mobile_lcdc_priv *priv,
 	return 0;
 }
 
-static int __devinit
+static int
 sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
 			    struct sh_mobile_lcdc_chan *ch)
 {
@@ -2675,7 +2675,7 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
 	return sh_mobile_lcdc_channel_fb_init(ch, mode, num_modes);
 }
 
-static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
+static int sh_mobile_lcdc_probe(struct platform_device *pdev)
 {
 	struct sh_mobile_lcdc_info *pdata = pdev->dev.platform_data;
 	struct sh_mobile_lcdc_priv *priv;
diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
index 7a0ba8b..e0f0985 100644
--- a/drivers/video/sh_mobile_meram.c
+++ b/drivers/video/sh_mobile_meram.c
@@ -620,7 +620,7 @@ static UNIVERSAL_DEV_PM_OPS(sh_mobile_meram_dev_pm_ops,
  * Probe/remove and driver init/exit
  */
 
-static int __devinit sh_mobile_meram_probe(struct platform_device *pdev)
+static int sh_mobile_meram_probe(struct platform_device *pdev)
 {
 	struct sh_mobile_meram_priv *priv;
 	struct sh_mobile_meram_info *pdata = pdev->dev.platform_data;
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
index 5193138..820a002 100644
--- a/drivers/video/sis/sis_main.c
+++ b/drivers/video/sis/sis_main.c
@@ -106,7 +106,7 @@ sisfb_setdefaultparms(void)
 
 /* ------------- Parameter parsing -------------- */
 
-static void __devinit
+static void
 sisfb_search_vesamode(unsigned int vesamode, bool quiet)
 {
 	int i = 0, j = 0;
@@ -146,7 +146,7 @@ sisfb_search_vesamode(unsigned int vesamode, bool quiet)
 		printk(KERN_ERR "sisfb: Invalid VESA mode 0x%x'\n", vesamode);
 }
 
-static void __devinit
+static void
 sisfb_search_mode(char *name, bool quiet)
 {
 	unsigned int j = 0, xres = 0, yres = 0, depth = 0, rate = 0;
@@ -225,7 +225,7 @@ sisfb_search_mode(char *name, bool quiet)
 }
 
 #ifndef MODULE
-static void __devinit
+static void
 sisfb_get_vga_mode_from_kernel(void)
 {
 #ifdef CONFIG_X86
@@ -345,7 +345,7 @@ sisfb_search_specialtiming(const char *name)
 
 /* ----------- Various detection routines ----------- */
 
-static void __devinit
+static void
 sisfb_detect_custom_timing(struct sis_video_info *ivideo)
 {
 	unsigned char *biosver = NULL;
@@ -403,7 +403,7 @@ sisfb_detect_custom_timing(struct sis_video_info *ivideo)
 	} while(mycustomttable[i].chipID);
 }
 
-static bool __devinit
+static bool
 sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
 {
 	int i, j, xres, yres, refresh, index;
@@ -505,7 +505,7 @@ sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
 	return monitor->datavalid;
 }
 
-static void __devinit
+static void
 sisfb_handle_ddc(struct sis_video_info *ivideo, struct sisfb_monitor *monitor, int crtno)
 {
 	unsigned short temp, i, realcrtno = crtno;
@@ -1898,8 +1898,7 @@ static struct fb_ops sisfb_ops = {
 
 /* ---------------- Chip generation dependent routines ---------------- */
 
-static struct pci_dev * __devinit
-sisfb_get_northbridge(int basechipid)
+static struct pci_dev *sisfb_get_northbridge(int basechipid)
 {
 	struct pci_dev *pdev = NULL;
 	int nbridgenum, nbridgeidx, i;
@@ -1938,7 +1937,7 @@ sisfb_get_northbridge(int basechipid)
 	return pdev;
 }
 
-static int __devinit
+static int
 sisfb_get_dram_size(struct sis_video_info *ivideo)
 {
 #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315)
@@ -2038,7 +2037,7 @@ sisfb_get_dram_size(struct sis_video_info *ivideo)
 
 /* -------------- video bridge device detection --------------- */
 
-static void __devinit
+static void
 sisfb_detect_VB_connect(struct sis_video_info *ivideo)
 {
 	u8 cr32, temp;
@@ -2164,7 +2163,7 @@ sisfb_detect_VB_connect(struct sis_video_info *ivideo)
 
 /* ------------------ Sensing routines ------------------ */
 
-static bool __devinit
+static bool
 sisfb_test_DDC1(struct sis_video_info *ivideo)
 {
     unsigned short old;
@@ -2177,7 +2176,7 @@ sisfb_test_DDC1(struct sis_video_info *ivideo)
     return (count != -1);
 }
 
-static void __devinit
+static void
 sisfb_sense_crt1(struct sis_video_info *ivideo)
 {
     bool mustwait = false;
@@ -2259,7 +2258,7 @@ sisfb_sense_crt1(struct sis_video_info *ivideo)
 }
 
 /* Determine and detect attached devices on SiS30x */
-static void __devinit
+static void
 SiS_SenseLCD(struct sis_video_info *ivideo)
 {
 	unsigned char buffer[256];
@@ -2347,7 +2346,7 @@ SiS_SenseLCD(struct sis_video_info *ivideo)
 	ivideo->SiS_Pr.PanelSelfDetected = true;
 }
 
-static int __devinit
+static int
 SISDoSense(struct sis_video_info *ivideo, u16 type, u16 test)
 {
     int temp, mytest, result, i, j;
@@ -2377,7 +2376,7 @@ SISDoSense(struct sis_video_info *ivideo, u16 type, u16 test)
     return result;
 }
 
-static void __devinit
+static void
 SiS_Sense30x(struct sis_video_info *ivideo)
 {
     u8  backupP4_0d,backupP2_00,backupP2_4d,backupSR_1e,biosflag=0;
@@ -2518,7 +2517,7 @@ SiS_Sense30x(struct sis_video_info *ivideo)
 }
 
 /* Determine and detect attached TV's on Chrontel */
-static void __devinit
+static void
 SiS_SenseCh(struct sis_video_info *ivideo)
 {
 #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315)
@@ -2643,7 +2642,7 @@ SiS_SenseCh(struct sis_video_info *ivideo)
     }
 }
 
-static void __devinit
+static void
 sisfb_get_VB_type(struct sis_video_info *ivideo)
 {
 	char stdstr[]    = "sisfb: Detected";
@@ -2906,7 +2905,7 @@ sisfb_engine_init(struct sis_video_info *ivideo)
 	ivideo->engineok = 1;
 }
 
-static void __devinit
+static void
 sisfb_detect_lcd_type(struct sis_video_info *ivideo)
 {
 	u8 reg;
@@ -2962,7 +2961,7 @@ sisfb_detect_lcd_type(struct sis_video_info *ivideo)
 			ivideo->lcdxres, ivideo->lcdyres);
 }
 
-static void __devinit
+static void
 sisfb_save_pdc_emi(struct sis_video_info *ivideo)
 {
 #ifdef CONFIG_FB_SIS_300
@@ -3081,7 +3080,7 @@ sisfb_save_pdc_emi(struct sis_video_info *ivideo)
 
 /* -------------------- Memory manager routines ---------------------- */
 
-static u32 __devinit
+static u32
 sisfb_getheapstart(struct sis_video_info *ivideo)
 {
 	u32 ret = ivideo->sisfb_parm_mem * 1024;
@@ -3128,7 +3127,7 @@ sisfb_getheapstart(struct sis_video_info *ivideo)
 	return ret;
 }
 
-static u32 __devinit
+static u32
 sisfb_getheapsize(struct sis_video_info *ivideo)
 {
 	u32 max = ivideo->video_size - ivideo->hwcursor_size - ivideo->cmdQueueSize;
@@ -3154,7 +3153,7 @@ sisfb_getheapsize(struct sis_video_info *ivideo)
 	return ret;
 }
 
-static int __devinit
+static int
 sisfb_heap_init(struct sis_video_info *ivideo)
 {
 	struct SIS_OH *poh;
@@ -4061,7 +4060,7 @@ static int __init sisfb_setup(char *options)
 }
 #endif
 
-static int __devinit
+static int
 sisfb_check_rom(void __iomem *rom_base, struct sis_video_info *ivideo)
 {
 	void __iomem *rom;
@@ -4089,8 +4088,7 @@ sisfb_check_rom(void __iomem *rom_base, struct sis_video_info *ivideo)
 	return 1;
 }
 
-static unsigned char * __devinit
-sisfb_find_rom(struct pci_dev *pdev)
+static unsigned char *sisfb_find_rom(struct pci_dev *pdev)
 {
 	struct sis_video_info *ivideo = pci_get_drvdata(pdev);
 	void __iomem *rom_base;
@@ -4149,7 +4147,7 @@ sisfb_find_rom(struct pci_dev *pdev)
 	return myrombase;
 }
 
-static void __devinit
+static void
 sisfb_post_map_vram(struct sis_video_info *ivideo, unsigned int *mapsize,
 			unsigned int min)
 {
@@ -4176,7 +4174,7 @@ sisfb_post_map_vram(struct sis_video_info *ivideo, unsigned int *mapsize,
 }
 
 #ifdef CONFIG_FB_SIS_300
-static int __devinit
+static int
 sisfb_post_300_buswidth(struct sis_video_info *ivideo)
 {
 	void __iomem *FBAddress = ivideo->video_vbase;
@@ -4242,7 +4240,7 @@ static const unsigned short __devinitconst SiS_DRAMType[17][5] = {
 	{0x09,0x08,0x01,0x01,0x00}
 };
 
-static int __devinit
+static int
 sisfb_post_300_rwtest(struct sis_video_info *ivideo, int iteration, int buswidth,
 			int PseudoRankCapacity, int PseudoAdrPinCount,
 			unsigned int mapsize)
@@ -4309,7 +4307,7 @@ sisfb_post_300_rwtest(struct sis_video_info *ivideo, int iteration, int buswidth
 	return 0;
 }
 
-static void __devinit
+static void
 sisfb_post_300_ramsize(struct pci_dev *pdev, unsigned int mapsize)
 {
 	struct	sis_video_info *ivideo = pci_get_drvdata(pdev);
@@ -4335,7 +4333,7 @@ sisfb_post_300_ramsize(struct pci_dev *pdev, unsigned int mapsize)
 	}
 }
 
-static void __devinit
+static void
 sisfb_post_sis300(struct pci_dev *pdev)
 {
 	struct sis_video_info *ivideo = pci_get_drvdata(pdev);
@@ -4547,7 +4545,7 @@ sisfb_post_sis300(struct pci_dev *pdev)
 
 #ifdef CONFIG_FB_SIS_315
 #if 0
-static void __devinit
+static void
 sisfb_post_sis315330(struct pci_dev *pdev)
 {
 	/* TODO */
@@ -4559,7 +4557,7 @@ static inline int sisfb_xgi_is21(struct sis_video_info *ivideo)
 	return ivideo->chip_real_id == XGI_21;
 }
 
-static void __devinit
+static void
 sisfb_post_xgi_delay(struct sis_video_info *ivideo, int delay)
 {
 	unsigned int i;
@@ -4571,7 +4569,7 @@ sisfb_post_xgi_delay(struct sis_video_info *ivideo, int delay)
 	}
 }
 
-static int __devinit
+static int
 sisfb_find_host_bridge(struct sis_video_info *ivideo, struct pci_dev *mypdev,
 				unsigned short pcivendor)
 {
@@ -4591,7 +4589,7 @@ sisfb_find_host_bridge(struct sis_video_info *ivideo, struct pci_dev *mypdev,
 	return ret;
 }
 
-static int __devinit
+static int
 sisfb_post_xgi_rwtest(struct sis_video_info *ivideo, int starta,
 			unsigned int enda, unsigned int mapsize)
 {
@@ -4623,7 +4621,7 @@ sisfb_post_xgi_rwtest(struct sis_video_info *ivideo, int starta,
 	return 1;
 }
 
-static int __devinit
+static int
 sisfb_post_xgi_ramsize(struct sis_video_info *ivideo)
 {
 	unsigned int buswidth, ranksize, channelab, mapsize;
@@ -4876,7 +4874,7 @@ bail_out:
 	return status;
 }
 
-static void __devinit
+static void
 sisfb_post_xgi_setclocks(struct sis_video_info *ivideo, u8 regb)
 {
 	u8 v1, v2, v3;
@@ -4932,7 +4930,7 @@ sisfb_post_xgi_setclocks(struct sis_video_info *ivideo, u8 regb)
 	sisfb_post_xgi_delay(ivideo, 0x43);
 }
 
-static void __devinit
+static void
 sisfb_post_xgi_ddr2_mrs_default(struct sis_video_info *ivideo, u8 regb)
 {
 	unsigned char *bios = ivideo->bios_abase;
@@ -4973,7 +4971,7 @@ sisfb_post_xgi_ddr2_mrs_default(struct sis_video_info *ivideo, u8 regb)
 	sisfb_post_xgi_delay(ivideo, 1);
 }
 
-static void __devinit
+static void
 sisfb_post_xgi_ddr2_mrs_xg21(struct sis_video_info *ivideo)
 {
 	sisfb_post_xgi_setclocks(ivideo, 1);
@@ -5015,7 +5013,7 @@ sisfb_post_xgi_ddr2_mrs_xg21(struct sis_video_info *ivideo)
 	sisfb_post_xgi_delay(ivideo, 1);
 }
 
-static void __devinit
+static void
 sisfb_post_xgi_ddr2(struct sis_video_info *ivideo, u8 regb)
 {
 	unsigned char *bios = ivideo->bios_abase;
@@ -5061,7 +5059,7 @@ sisfb_post_xgi_ddr2(struct sis_video_info *ivideo, u8 regb)
 		sisfb_post_xgi_ddr2_mrs_default(ivideo, regb);
 }
 
-static u8 __devinit
+static u8
 sisfb_post_xgi_ramtype(struct sis_video_info *ivideo)
 {
 	unsigned char *bios = ivideo->bios_abase;
@@ -5101,7 +5099,7 @@ sisfb_post_xgi_ramtype(struct sis_video_info *ivideo)
 	return ramtype;
 }
 
-static int __devinit
+static int
 sisfb_post_xgi(struct pci_dev *pdev)
 {
 	struct sis_video_info *ivideo = pci_get_drvdata(pdev);
@@ -5839,7 +5837,7 @@ sisfb_post_xgi(struct pci_dev *pdev)
 }
 #endif
 
-static int __devinit
+static int
 sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	struct sisfb_chip_info	*chipinfo = &sisfb_chip_info[ent->driver_data];
diff --git a/drivers/video/skeletonfb.c b/drivers/video/skeletonfb.c
index ce61d9d..28a38ba 100644
--- a/drivers/video/skeletonfb.c
+++ b/drivers/video/skeletonfb.c
@@ -678,7 +678,7 @@ static struct fb_ops xxxfb_ops = {
      */
 
 /* static int __init xxfb_probe (struct platform_device *pdev) -- for platform devs */
-static int __devinit xxxfb_probe(struct pci_dev *dev,
+static int xxxfb_probe(struct pci_dev *dev,
 			      const struct pci_device_id *ent)
 {
     struct fb_info *info;
diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c
index 3690eff..6703712 100644
--- a/drivers/video/sm501fb.c
+++ b/drivers/video/sm501fb.c
@@ -1664,7 +1664,7 @@ static void sm501fb_stop(struct sm501fb_info *info)
 			   resource_size(info->regs_res));
 }
 
-static int __devinit sm501fb_init_fb(struct fb_info *fb,
+static int sm501fb_init_fb(struct fb_info *fb,
 			   enum sm501_controller head,
 			   const char *fbname)
 {
@@ -1850,7 +1850,7 @@ static struct sm501_platdata_fb sm501fb_def_pdata = {
 static char driver_name_crt[] = "sm501fb-crt";
 static char driver_name_pnl[] = "sm501fb-panel";
 
-static int __devinit sm501fb_probe_one(struct sm501fb_info *info,
+static int sm501fb_probe_one(struct sm501fb_info *info,
 				       enum sm501_controller head)
 {
 	unsigned char *name = (head == HEAD_CRT) ? "crt" : "panel";
@@ -1892,7 +1892,7 @@ static void sm501_free_init_fb(struct sm501fb_info *info,
 	fb_dealloc_cmap(&fbi->cmap);
 }
 
-static int __devinit sm501fb_start_one(struct sm501fb_info *info,
+static int sm501fb_start_one(struct sm501fb_info *info,
 				       enum sm501_controller head,
 				       const char *drvname)
 {
@@ -1922,7 +1922,7 @@ static int __devinit sm501fb_start_one(struct sm501fb_info *info,
 	return 0;
 }
 
-static int __devinit sm501fb_probe(struct platform_device *pdev)
+static int sm501fb_probe(struct platform_device *pdev)
 {
 	struct sm501fb_info *info;
 	struct device *dev = &pdev->dev;
diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c
index 871e074..c4ce3ef 100644
--- a/drivers/video/sstfb.c
+++ b/drivers/video/sstfb.c
@@ -822,7 +822,7 @@ static void sstfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
 /* 
  * get lfb size 
  */
-static int __devinit sst_get_memsize(struct fb_info *info, __u32 *memsize)
+static int sst_get_memsize(struct fb_info *info, __u32 *memsize)
 {
 	u8 __iomem *fbbase_virt = info->screen_base;
 
@@ -865,7 +865,7 @@ static int __devinit sst_get_memsize(struct fb_info *info, __u32 *memsize)
 /* fbi should be idle, and fifo emty and mem disabled */
 /* supposed to detect AT&T ATT20C409 and Ti TVP3409 ramdacs */
 
-static int __devinit sst_detect_att(struct fb_info *info)
+static int sst_detect_att(struct fb_info *info)
 {
 	struct sstfb_par *par = info->par;
 	int i, mir, dir;
@@ -890,7 +890,7 @@ static int __devinit sst_detect_att(struct fb_info *info)
 	return 0;
 }
 
-static int __devinit sst_detect_ti(struct fb_info *info)
+static int sst_detect_ti(struct fb_info *info)
 {
 	struct sstfb_par *par = info->par;
 	int i, mir, dir;
@@ -926,7 +926,7 @@ static int __devinit sst_detect_ti(struct fb_info *info)
  * touched...
  * is it really safe ? how can i reset this ramdac ? geee...
  */
-static int __devinit sst_detect_ics(struct fb_info *info)
+static int sst_detect_ics(struct fb_info *info)
 {
 	struct sstfb_par *par = info->par;
 	int m_clk0_1, m_clk0_7, m_clk1_b;
@@ -1121,7 +1121,7 @@ static struct dac_switch dacs[] __devinitdata = {
 		.set_vidmod	= sst_set_vidmod_ics },
 };
 
-static int __devinit sst_detect_dactype(struct fb_info *info, struct sstfb_par *par)
+static int sst_detect_dactype(struct fb_info *info, struct sstfb_par *par)
 {
 	int i, ret = 0;
 
@@ -1140,7 +1140,7 @@ static int __devinit sst_detect_dactype(struct fb_info *info, struct sstfb_par *
 /*
  * Internal Routines
  */
-static int __devinit sst_init(struct fb_info *info, struct sstfb_par *par)
+static int sst_init(struct fb_info *info, struct sstfb_par *par)
 {
 	u32 fbiinit0, fbiinit1, fbiinit4;
 	struct pci_dev *dev = par->dev;
@@ -1271,7 +1271,7 @@ static void  __devexit sst_shutdown(struct fb_info *info)
 /*
  * Interface to the world
  */
-static int  __devinit sstfb_setup(char *options)
+static int  sstfb_setup(char *options)
 {
 	char *this_opt;
 
@@ -1317,7 +1317,7 @@ static struct fb_ops sstfb_ops = {
 	.fb_ioctl	= sstfb_ioctl,
 };
 
-static int __devinit sstfb_probe(struct pci_dev *pdev,
+static int sstfb_probe(struct pci_dev *pdev,
 			const struct pci_device_id *id)
 {
 	struct fb_info *info;
@@ -1494,7 +1494,7 @@ static struct pci_driver sstfb_driver = {
 };
 
 
-static int __devinit sstfb_init(void)
+static int sstfb_init(void)
 {
 	char *option = NULL;
 
diff --git a/drivers/video/sunxvr1000.c b/drivers/video/sunxvr1000.c
index cc9bf5f..9e86e3c 100644
--- a/drivers/video/sunxvr1000.c
+++ b/drivers/video/sunxvr1000.c
@@ -25,7 +25,7 @@ struct gfb_info {
 	u32			pseudo_palette[16];
 };
 
-static int __devinit gfb_get_props(struct gfb_info *gp)
+static int gfb_get_props(struct gfb_info *gp)
 {
 	gp->width = of_getintprop_default(gp->of_node, "width", 0);
 	gp->height = of_getintprop_default(gp->of_node, "height", 0);
@@ -66,7 +66,7 @@ static struct fb_ops gfb_ops = {
 	.fb_imageblit		= cfb_imageblit,
 };
 
-static int __devinit gfb_set_fbinfo(struct gfb_info *gp)
+static int gfb_set_fbinfo(struct gfb_info *gp)
 {
 	struct fb_info *info = gp->info;
 	struct fb_var_screeninfo *var = &info->var;
@@ -111,7 +111,7 @@ static int __devinit gfb_set_fbinfo(struct gfb_info *gp)
         return 0;
 }
 
-static int __devinit gfb_probe(struct platform_device *op)
+static int gfb_probe(struct platform_device *op)
 {
 	struct device_node *dp = op->dev.of_node;
 	struct fb_info *info;
diff --git a/drivers/video/sunxvr2500.c b/drivers/video/sunxvr2500.c
index 49bd77a..b6a14d2 100644
--- a/drivers/video/sunxvr2500.c
+++ b/drivers/video/sunxvr2500.c
@@ -29,7 +29,7 @@ struct s3d_info {
 	u32			pseudo_palette[16];
 };
 
-static int __devinit s3d_get_props(struct s3d_info *sp)
+static int s3d_get_props(struct s3d_info *sp)
 {
 	sp->width = of_getintprop_default(sp->of_node, "width", 0);
 	sp->height = of_getintprop_default(sp->of_node, "height", 0);
@@ -70,7 +70,7 @@ static struct fb_ops s3d_ops = {
 	.fb_imageblit		= cfb_imageblit,
 };
 
-static int __devinit s3d_set_fbinfo(struct s3d_info *sp)
+static int s3d_set_fbinfo(struct s3d_info *sp)
 {
 	struct fb_info *info = sp->info;
 	struct fb_var_screeninfo *var = &info->var;
@@ -115,7 +115,7 @@ static int __devinit s3d_set_fbinfo(struct s3d_info *sp)
         return 0;
 }
 
-static int __devinit s3d_pci_register(struct pci_dev *pdev,
+static int s3d_pci_register(struct pci_dev *pdev,
 				      const struct pci_device_id *ent)
 {
 	struct fb_info *info;
diff --git a/drivers/video/sunxvr500.c b/drivers/video/sunxvr500.c
index e94c799..afcdab1 100644
--- a/drivers/video/sunxvr500.c
+++ b/drivers/video/sunxvr500.c
@@ -51,7 +51,7 @@ struct e3d_info {
 	u32			pseudo_palette[16];
 };
 
-static int __devinit e3d_get_props(struct e3d_info *ep)
+static int e3d_get_props(struct e3d_info *ep)
 {
 	ep->width = of_getintprop_default(ep->of_node, "width", 0);
 	ep->height = of_getintprop_default(ep->of_node, "height", 0);
@@ -193,7 +193,7 @@ static struct fb_ops e3d_ops = {
 	.fb_imageblit		= e3d_imageblit,
 };
 
-static int __devinit e3d_set_fbinfo(struct e3d_info *ep)
+static int e3d_set_fbinfo(struct e3d_info *ep)
 {
 	struct fb_info *info = ep->info;
 	struct fb_var_screeninfo *var = &info->var;
@@ -238,7 +238,7 @@ static int __devinit e3d_set_fbinfo(struct e3d_info *ep)
         return 0;
 }
 
-static int __devinit e3d_pci_register(struct pci_dev *pdev,
+static int e3d_pci_register(struct pci_dev *pdev,
 				      const struct pci_device_id *ent)
 {
 	struct device_node *of_node;
diff --git a/drivers/video/tcx.c b/drivers/video/tcx.c
index 9f57539..cfdc1bb 100644
--- a/drivers/video/tcx.c
+++ b/drivers/video/tcx.c
@@ -362,7 +362,7 @@ static void tcx_unmap_regs(struct platform_device *op, struct fb_info *info,
 			   info->screen_base, info->fix.smem_len);
 }
 
-static int __devinit tcx_probe(struct platform_device *op)
+static int tcx_probe(struct platform_device *op)
 {
 	struct device_node *dp = op->dev.of_node;
 	struct fb_info *info;
diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c
index bbb0d95..efbf5c9 100644
--- a/drivers/video/tdfxfb.c
+++ b/drivers/video/tdfxfb.c
@@ -135,7 +135,7 @@ static struct fb_var_screeninfo tdfx_var __devinitdata = {
 /*
  * PCI driver prototypes
  */
-static int __devinit tdfxfb_probe(struct pci_dev *pdev,
+static int tdfxfb_probe(struct pci_dev *pdev,
 				  const struct pci_device_id *id);
 static void __devexit tdfxfb_remove(struct pci_dev *pdev);
 
@@ -1279,7 +1279,7 @@ static int tdfxfb_ddc_getsda(void *data)
 	return (0 != (tdfx_inl(par, VIDSERPARPORT) & DDC_SDA_IN));
 }
 
-static int __devinit tdfxfb_setup_ddc_bus(struct tdfxfb_i2c_chan *chan,
+static int tdfxfb_setup_ddc_bus(struct tdfxfb_i2c_chan *chan,
 					  const char *name, struct device *dev)
 {
 	int rc;
@@ -1308,7 +1308,7 @@ static int __devinit tdfxfb_setup_ddc_bus(struct tdfxfb_i2c_chan *chan,
 	return rc;
 }
 
-static int __devinit tdfxfb_setup_i2c_bus(struct tdfxfb_i2c_chan *chan,
+static int tdfxfb_setup_i2c_bus(struct tdfxfb_i2c_chan *chan,
 					  const char *name, struct device *dev)
 {
 	int rc;
@@ -1336,7 +1336,7 @@ static int __devinit tdfxfb_setup_i2c_bus(struct tdfxfb_i2c_chan *chan,
 	return rc;
 }
 
-static void __devinit tdfxfb_create_i2c_busses(struct fb_info *info)
+static void tdfxfb_create_i2c_busses(struct fb_info *info)
 {
 	struct tdfx_par *par = info->par;
 
@@ -1388,7 +1388,7 @@ static int tdfxfb_probe_i2c_connector(struct tdfx_par *par,
  *      Initializes and allocates resources for PCI device @pdev.
  *
  */
-static int __devinit tdfxfb_probe(struct pci_dev *pdev,
+static int tdfxfb_probe(struct pci_dev *pdev,
 				  const struct pci_device_id *id)
 {
 	struct tdfx_par *default_par;
diff --git a/drivers/video/tgafb.c b/drivers/video/tgafb.c
index 7333152..63fc5ba 100644
--- a/drivers/video/tgafb.c
+++ b/drivers/video/tgafb.c
@@ -61,7 +61,7 @@ static void tgafb_fillrect(struct fb_info *, const struct fb_fillrect *);
 static void tgafb_copyarea(struct fb_info *, const struct fb_copyarea *);
 static int tgafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info);
 
-static int __devinit tgafb_register(struct device *dev);
+static int tgafb_register(struct device *dev);
 static void __devexit tgafb_unregister(struct device *dev);
 
 static const char *mode_option;
@@ -93,7 +93,7 @@ static struct fb_ops tgafb_ops = {
 /*
  *  PCI registration operations
  */
-static int __devinit tgafb_pci_register(struct pci_dev *,
+static int tgafb_pci_register(struct pci_dev *,
 					const struct pci_device_id *);
 static void __devexit tgafb_pci_unregister(struct pci_dev *);
 
@@ -110,7 +110,7 @@ static struct pci_driver tgafb_pci_driver = {
 	.remove			= tgafb_pci_unregister,
 };
 
-static int __devinit
+static int
 tgafb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	return tgafb_register(&pdev->dev);
@@ -127,7 +127,7 @@ tgafb_pci_unregister(struct pci_dev *pdev)
 /*
  *  TC registration operations
  */
-static int __devinit tgafb_tc_register(struct device *);
+static int tgafb_tc_register(struct device *);
 static int __devexit tgafb_tc_unregister(struct device *);
 
 static struct tc_device_id const tgafb_tc_table[] = {
@@ -147,7 +147,7 @@ static struct tc_driver tgafb_tc_driver = {
 	},
 };
 
-static int __devinit
+static int
 tgafb_tc_register(struct device *dev)
 {
 	int status = tgafb_register(dev);
@@ -1546,7 +1546,7 @@ static int tgafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info
 	return 0;
 }
 
-static int __devinit
+static int
 tgafb_register(struct device *dev)
 {
 	static const struct fb_videomode modedb_tc = {
@@ -1729,7 +1729,7 @@ tgafb_exit(void)
 }
 
 #ifndef MODULE
-static int __devinit
+static int
 tgafb_setup(char *arg)
 {
 	char *this_opt;
@@ -1751,7 +1751,7 @@ tgafb_setup(char *arg)
 }
 #endif /* !MODULE */
 
-static int __devinit
+static int
 tgafb_init(void)
 {
 	int status;
diff --git a/drivers/video/tmiofb.c b/drivers/video/tmiofb.c
index 7c8133e..3f7527a 100644
--- a/drivers/video/tmiofb.c
+++ b/drivers/video/tmiofb.c
@@ -675,7 +675,7 @@ static struct fb_ops tmiofb_ops = {
 
 /*--------------------------------------------------------------------------*/
 
-static int __devinit tmiofb_probe(struct platform_device *dev)
+static int tmiofb_probe(struct platform_device *dev)
 {
 	const struct mfd_cell *cell = mfd_get_cell(dev);
 	struct tmio_fb_data *data = dev->dev.platform_data;
diff --git a/drivers/video/tridentfb.c b/drivers/video/tridentfb.c
index a3f207b..f1a8495 100644
--- a/drivers/video/tridentfb.c
+++ b/drivers/video/tridentfb.c
@@ -637,7 +637,7 @@ static inline void crtc_unlock(struct tridentfb_par *par)
 }
 
 /*  Return flat panel's maximum x resolution */
-static int __devinit get_nativex(struct tridentfb_par *par)
+static int get_nativex(struct tridentfb_par *par)
 {
 	int x, y, tmp;
 
@@ -771,7 +771,7 @@ static void set_number_of_lines(struct tridentfb_par *par, int lines)
  * If we see that FP is active we assume we have one.
  * Otherwise we have a CRT display. User can override.
  */
-static int __devinit is_flatpanel(struct tridentfb_par *par)
+static int is_flatpanel(struct tridentfb_par *par)
 {
 	if (fp)
 		return 1;
@@ -781,7 +781,7 @@ static int __devinit is_flatpanel(struct tridentfb_par *par)
 }
 
 /* Try detecting the video memory size */
-static unsigned int __devinit get_memsize(struct tridentfb_par *par)
+static unsigned int get_memsize(struct tridentfb_par *par)
 {
 	unsigned char tmp, tmp2;
 	unsigned int k;
@@ -1331,7 +1331,7 @@ static struct fb_ops tridentfb_ops = {
 	.fb_sync = tridentfb_sync,
 };
 
-static int __devinit trident_pci_probe(struct pci_dev *dev,
+static int trident_pci_probe(struct pci_dev *dev,
 				       const struct pci_device_id *id)
 {
 	int err;
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
index 2f8f82d..a776c8e 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -418,7 +418,7 @@ static void uvesafb_vbe_state_restore(struct uvesafb_par *par, u8 *state_buf)
 	uvesafb_free(task);
 }
 
-static int __devinit uvesafb_vbe_getinfo(struct uvesafb_ktask *task,
+static int uvesafb_vbe_getinfo(struct uvesafb_ktask *task,
 		struct uvesafb_par *par)
 {
 	int err;
@@ -477,7 +477,7 @@ static int __devinit uvesafb_vbe_getinfo(struct uvesafb_ktask *task,
 	return 0;
 }
 
-static int __devinit uvesafb_vbe_getmodes(struct uvesafb_ktask *task,
+static int uvesafb_vbe_getmodes(struct uvesafb_ktask *task,
 		struct uvesafb_par *par)
 {
 	int off = 0, err;
@@ -556,7 +556,7 @@ static int __devinit uvesafb_vbe_getmodes(struct uvesafb_ktask *task,
  * x86 and not x86_64.
  */
 #ifdef CONFIG_X86_32
-static int __devinit uvesafb_vbe_getpmi(struct uvesafb_ktask *task,
+static int uvesafb_vbe_getpmi(struct uvesafb_ktask *task,
 		struct uvesafb_par *par)
 {
 	int i, err;
@@ -602,7 +602,7 @@ static int __devinit uvesafb_vbe_getpmi(struct uvesafb_ktask *task,
  * Check whether a video mode is supported by the Video BIOS and is
  * compatible with the monitor limits.
  */
-static int __devinit uvesafb_is_valid_mode(struct fb_videomode *mode,
+static int uvesafb_is_valid_mode(struct fb_videomode *mode,
 		struct fb_info *info)
 {
 	if (info->monspecs.gtf) {
@@ -618,7 +618,7 @@ static int __devinit uvesafb_is_valid_mode(struct fb_videomode *mode,
 	return 1;
 }
 
-static int __devinit uvesafb_vbe_getedid(struct uvesafb_ktask *task,
+static int uvesafb_vbe_getedid(struct uvesafb_ktask *task,
 		struct fb_info *info)
 {
 	struct uvesafb_par *par = info->par;
@@ -684,7 +684,7 @@ static int __devinit uvesafb_vbe_getedid(struct uvesafb_ktask *task,
 	return err;
 }
 
-static void __devinit uvesafb_vbe_getmonspecs(struct uvesafb_ktask *task,
+static void uvesafb_vbe_getmonspecs(struct uvesafb_ktask *task,
 		struct fb_info *info)
 {
 	struct uvesafb_par *par = info->par;
@@ -765,7 +765,7 @@ static void __devinit uvesafb_vbe_getmonspecs(struct uvesafb_ktask *task,
 	return;
 }
 
-static void __devinit uvesafb_vbe_getstatesize(struct uvesafb_ktask *task,
+static void uvesafb_vbe_getstatesize(struct uvesafb_ktask *task,
 		struct uvesafb_par *par)
 {
 	int err;
@@ -794,7 +794,7 @@ static void __devinit uvesafb_vbe_getstatesize(struct uvesafb_ktask *task,
 	par->vbe_state_size = 64 * (task->t.regs.ebx & 0xffff);
 }
 
-static int __devinit uvesafb_vbe_init(struct fb_info *info)
+static int uvesafb_vbe_init(struct fb_info *info)
 {
 	struct uvesafb_ktask *task = NULL;
 	struct uvesafb_par *par = info->par;
@@ -839,7 +839,7 @@ out:	uvesafb_free(task);
 	return err;
 }
 
-static int __devinit uvesafb_vbe_init_mode(struct fb_info *info)
+static int uvesafb_vbe_init_mode(struct fb_info *info)
 {
 	struct list_head *pos;
 	struct fb_modelist *modelist;
@@ -1444,7 +1444,7 @@ static struct fb_ops uvesafb_ops = {
 	.fb_set_par	= uvesafb_set_par,
 };
 
-static void __devinit uvesafb_init_info(struct fb_info *info,
+static void uvesafb_init_info(struct fb_info *info,
 		struct vbe_mode_ib *mode)
 {
 	unsigned int size_vmode;
@@ -1540,7 +1540,7 @@ static void __devinit uvesafb_init_info(struct fb_info *info,
 		info->fbops->fb_pan_display = NULL;
 }
 
-static void __devinit uvesafb_init_mtrr(struct fb_info *info)
+static void uvesafb_init_mtrr(struct fb_info *info)
 {
 #ifdef CONFIG_MTRR
 	if (mtrr && !(info->fix.smem_start & (PAGE_SIZE - 1))) {
@@ -1582,7 +1582,7 @@ static void __devinit uvesafb_init_mtrr(struct fb_info *info)
 #endif /* CONFIG_MTRR */
 }
 
-static void __devinit uvesafb_ioremap(struct fb_info *info)
+static void uvesafb_ioremap(struct fb_info *info)
 {
 #ifdef CONFIG_X86
 	switch (mtrr) {
@@ -1738,7 +1738,7 @@ static struct attribute_group uvesafb_dev_attgrp = {
 	.attrs = uvesafb_dev_attrs,
 };
 
-static int __devinit uvesafb_probe(struct platform_device *dev)
+static int uvesafb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	struct vbe_mode_ib *mode = NULL;
@@ -1882,7 +1882,7 @@ static struct platform_driver uvesafb_driver = {
 static struct platform_device *uvesafb_device;
 
 #ifndef MODULE
-static int __devinit uvesafb_setup(char *options)
+static int uvesafb_setup(char *options)
 {
 	char *this_opt;
 
@@ -1950,7 +1950,7 @@ static ssize_t store_v86d(struct device_driver *dev, const char *buf,
 
 static DRIVER_ATTR(v86d, S_IRUGO | S_IWUSR, show_v86d, store_v86d);
 
-static int __devinit uvesafb_init(void)
+static int uvesafb_init(void)
 {
 	int err;
 
diff --git a/drivers/video/vermilion/vermilion.c b/drivers/video/vermilion/vermilion.c
index a2bacf8..3e92d0e 100644
--- a/drivers/video/vermilion/vermilion.c
+++ b/drivers/video/vermilion/vermilion.c
@@ -452,7 +452,7 @@ static void vmlfb_set_pref_pixel_format(struct fb_var_screeninfo *var)
  * struct per pipe. Currently we have only one pipe.
  */
 
-static int __devinit vml_pci_probe(struct pci_dev *dev,
+static int vml_pci_probe(struct pci_dev *dev,
 				   const struct pci_device_id *id)
 {
 	struct vml_info *vinfo;
diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c
index c7f69252..f4cb015 100644
--- a/drivers/video/vfb.c
+++ b/drivers/video/vfb.c
@@ -477,7 +477,7 @@ static int __init vfb_setup(char *options)
      *  Initialisation
      */
 
-static int __devinit vfb_probe(struct platform_device *dev)
+static int vfb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	int retval = -ENOMEM;
diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c
index 1ab146a..0e53f39 100644
--- a/drivers/video/vga16fb.c
+++ b/drivers/video/vga16fb.c
@@ -1303,7 +1303,7 @@ static int __init vga16fb_setup(char *options)
 }
 #endif
 
-static int __devinit vga16fb_probe(struct platform_device *dev)
+static int vga16fb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	struct vga16fb_par *par;
diff --git a/drivers/video/via/dvi.c b/drivers/video/via/dvi.c
index 6be72f0..1c9b68c 100644
--- a/drivers/video/via/dvi.c
+++ b/drivers/video/via/dvi.c
@@ -25,7 +25,7 @@
 static void tmds_register_write(int index, u8 data);
 static int tmds_register_read(int index);
 static int tmds_register_read_bytes(int index, u8 *buff, int buff_len);
-static void __devinit dvi_get_panel_size_from_DDCv1(
+static void dvi_get_panel_size_from_DDCv1(
 	struct tmds_chip_information *tmds_chip,
 	struct tmds_setting_information *tmds_setting);
 static int viafb_dvi_query_EDID(void);
@@ -35,7 +35,7 @@ static inline bool check_tmds_chip(int device_id_subaddr, int device_id)
 	return tmds_register_read(device_id_subaddr) == device_id;
 }
 
-void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
+void viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
 	struct tmds_setting_information *tmds_setting)
 {
 	DEBUG_MSG(KERN_INFO "viafb_init_dvi_size()\n");
@@ -47,7 +47,7 @@ void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
 	return;
 }
 
-bool __devinit viafb_tmds_trasmitter_identify(void)
+bool viafb_tmds_trasmitter_identify(void)
 {
 	unsigned char sr2a = 0, sr1e = 0, sr3e = 0;
 
@@ -285,7 +285,7 @@ static int viafb_dvi_query_EDID(void)
 }
 
 /* Get Panel Size Using EDID1 Table */
-static void __devinit dvi_get_panel_size_from_DDCv1(
+static void dvi_get_panel_size_from_DDCv1(
 	struct tmds_chip_information *tmds_chip,
 	struct tmds_setting_information *tmds_setting)
 {
diff --git a/drivers/video/via/dvi.h b/drivers/video/via/dvi.h
index db75785..4c6bfba 100644
--- a/drivers/video/via/dvi.h
+++ b/drivers/video/via/dvi.h
@@ -56,8 +56,8 @@
 int viafb_dvi_sense(void);
 void viafb_dvi_disable(void);
 void viafb_dvi_enable(void);
-bool __devinit viafb_tmds_trasmitter_identify(void);
-void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
+bool viafb_tmds_trasmitter_identify(void);
+void viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
 	struct tmds_setting_information *tmds_setting);
 void viafb_dvi_set_mode(const struct fb_var_screeninfo *var,
 	u16 cxres, u16 cyres, int iga);
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index 898590d..80233da 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -465,9 +465,9 @@ static struct via_device_mapping device_mapping[] = {
 static struct via_clock clock;
 
 static void load_fix_bit_crtc_reg(void);
-static void __devinit init_gfx_chip_info(int chip_type);
-static void __devinit init_tmds_chip_info(void);
-static void __devinit init_lvds_chip_info(void);
+static void init_gfx_chip_info(int chip_type);
+static void init_tmds_chip_info(void);
+static void init_lvds_chip_info(void);
 static void device_screen_off(void);
 static void device_screen_on(void);
 static void set_display_channel(void);
@@ -1507,7 +1507,7 @@ void viafb_fill_crtc_timing(const struct fb_var_screeninfo *var,
 	viafb_set_vclock(PICOS2KHZ(var->pixclock) * 1000, iga);
 }
 
-void __devinit viafb_init_chip_info(int chip_type)
+void viafb_init_chip_info(int chip_type)
 {
 	via_clock_init(&clock, chip_type);
 	init_gfx_chip_info(chip_type);
@@ -1540,7 +1540,7 @@ void viafb_update_device_setting(int hres, int vres, int bpp, int flag)
 	}
 }
 
-static void __devinit init_gfx_chip_info(int chip_type)
+static void init_gfx_chip_info(int chip_type)
 {
 	u8 tmp;
 
@@ -1593,7 +1593,7 @@ static void __devinit init_gfx_chip_info(int chip_type)
 	}
 }
 
-static void __devinit init_tmds_chip_info(void)
+static void init_tmds_chip_info(void)
 {
 	viafb_tmds_trasmitter_identify();
 
@@ -1638,7 +1638,7 @@ static void __devinit init_tmds_chip_info(void)
 		&viaparinfo->shared->tmds_setting_info);
 }
 
-static void __devinit init_lvds_chip_info(void)
+static void init_lvds_chip_info(void)
 {
 	viafb_lvds_trasmitter_identify();
 	viafb_init_lcd_size();
@@ -1672,7 +1672,7 @@ static void __devinit init_lvds_chip_info(void)
 		  viaparinfo->chip_info->lvds_chip_info.output_interface);
 }
 
-void __devinit viafb_init_dac(int set_iga)
+void viafb_init_dac(int set_iga)
 {
 	int i;
 	u8 tmp;
diff --git a/drivers/video/via/hw.h b/drivers/video/via/hw.h
index 6be243c..a820575 100644
--- a/drivers/video/via/hw.h
+++ b/drivers/video/via/hw.h
@@ -663,8 +663,8 @@ void viafb_set_dpa_gfx(int output_interface, struct GFX_DPA_SETTING\
 int viafb_setmode(void);
 void viafb_fill_var_timing_info(struct fb_var_screeninfo *var,
 	const struct fb_videomode *mode);
-void __devinit viafb_init_chip_info(int chip_type);
-void __devinit viafb_init_dac(int set_iga);
+void viafb_init_chip_info(int chip_type);
+void viafb_init_dac(int set_iga);
 int viafb_get_refresh(int hres, int vres, u32 float_refresh);
 void viafb_update_device_setting(int hres, int vres, int bpp, int flag);
 
diff --git a/drivers/video/via/lcd.c b/drivers/video/via/lcd.c
index 1650379..980ee1b 100644
--- a/drivers/video/via/lcd.c
+++ b/drivers/video/via/lcd.c
@@ -49,7 +49,7 @@ static struct _lcd_scaling_factor lcd_scaling_factor_CLE = {
 };
 
 static bool lvds_identify_integratedlvds(void);
-static void __devinit fp_id_to_vindex(int panel_id);
+static void fp_id_to_vindex(int panel_id);
 static int lvds_register_read(int index);
 static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres,
 		      int panel_vres);
@@ -81,7 +81,7 @@ static inline bool check_lvds_chip(int device_id_subaddr, int device_id)
 	return lvds_register_read(device_id_subaddr) == device_id;
 }
 
-void __devinit viafb_init_lcd_size(void)
+void viafb_init_lcd_size(void)
 {
 	DEBUG_MSG(KERN_INFO "viafb_init_lcd_size()\n");
 
@@ -139,7 +139,7 @@ static bool lvds_identify_integratedlvds(void)
 	return true;
 }
 
-bool __devinit viafb_lvds_trasmitter_identify(void)
+bool viafb_lvds_trasmitter_identify(void)
 {
 	if (viafb_lvds_identify_vt1636(VIA_PORT_31)) {
 		viaparinfo->chip_info->lvds_chip_info.i2c_port = VIA_PORT_31;
@@ -180,7 +180,7 @@ bool __devinit viafb_lvds_trasmitter_identify(void)
 	return false;
 }
 
-static void __devinit fp_id_to_vindex(int panel_id)
+static void fp_id_to_vindex(int panel_id)
 {
 	DEBUG_MSG(KERN_INFO "fp_get_panel_id()\n");
 
@@ -914,7 +914,7 @@ static void check_diport_of_integrated_lvds(
 		  plvds_chip_info->output_interface);
 }
 
-void __devinit viafb_init_lvds_output_interface(struct lvds_chip_information
+void viafb_init_lvds_output_interface(struct lvds_chip_information
 				*plvds_chip_info,
 				struct lvds_setting_information
 				*plvds_setting_info)
diff --git a/drivers/video/via/lcd.h b/drivers/video/via/lcd.h
index 8f3e4e0..5c988a0 100644
--- a/drivers/video/via/lcd.h
+++ b/drivers/video/via/lcd.h
@@ -71,15 +71,15 @@ void viafb_enable_lvds_vt1636(struct lvds_setting_information
 			struct lvds_chip_information *plvds_chip_info);
 void viafb_lcd_disable(void);
 void viafb_lcd_enable(void);
-void __devinit viafb_init_lcd_size(void);
-void __devinit viafb_init_lvds_output_interface(struct lvds_chip_information
+void viafb_init_lcd_size(void);
+void viafb_init_lvds_output_interface(struct lvds_chip_information
 				*plvds_chip_info,
 				struct lvds_setting_information
 				*plvds_setting_info);
 void viafb_lcd_set_mode(const struct fb_var_screeninfo *var, u16 cxres,
 	u16 cyres, struct lvds_setting_information *plvds_setting_info,
 	struct lvds_chip_information *plvds_chip_info);
-bool __devinit viafb_lvds_trasmitter_identify(void);
+bool viafb_lvds_trasmitter_identify(void);
 void viafb_init_lvds_output_interface(struct lvds_chip_information
 				*plvds_chip_info,
 				struct lvds_setting_information
diff --git a/drivers/video/via/via-core.c b/drivers/video/via/via-core.c
index 29b3af8..abbcb1b 100644
--- a/drivers/video/via/via-core.c
+++ b/drivers/video/via/via-core.c
@@ -80,7 +80,7 @@ static inline int viafb_mmio_read(int reg)
  */
 static u32 viafb_enabled_ints;
 
-static void __devinit viafb_int_init(void)
+static void viafb_int_init(void)
 {
 	viafb_enabled_ints = 0;
 
@@ -475,7 +475,7 @@ static int viafb_get_fb_size_from_pci(int chip_type)
 /*
  * Figure out and map our MMIO regions.
  */
-static int __devinit via_pci_setup_mmio(struct viafb_dev *vdev)
+static int via_pci_setup_mmio(struct viafb_dev *vdev)
 {
 	int ret;
 	/*
@@ -550,7 +550,7 @@ static struct viafb_subdev_info {
 };
 #define N_SUBDEVS ARRAY_SIZE(viafb_subdevs)
 
-static int __devinit via_create_subdev(struct viafb_dev *vdev,
+static int via_create_subdev(struct viafb_dev *vdev,
 		struct viafb_subdev_info *info)
 {
 	int ret;
@@ -573,7 +573,7 @@ static int __devinit via_create_subdev(struct viafb_dev *vdev,
 	return ret;
 }
 
-static int __devinit via_setup_subdevs(struct viafb_dev *vdev)
+static int via_setup_subdevs(struct viafb_dev *vdev)
 {
 	int i;
 
@@ -671,7 +671,7 @@ static int via_resume(struct pci_dev *pdev)
 }
 #endif /* CONFIG_PM */
 
-static int __devinit via_pci_probe(struct pci_dev *pdev,
+static int via_pci_probe(struct pci_dev *pdev,
 		const struct pci_device_id *ent)
 {
 	int ret;
diff --git a/drivers/video/via/via-gpio.c b/drivers/video/via/via-gpio.c
index d69cfef..e408679 100644
--- a/drivers/video/via/via-gpio.c
+++ b/drivers/video/via/via-gpio.c
@@ -212,7 +212,7 @@ EXPORT_SYMBOL_GPL(viafb_gpio_lookup);
 /*
  * Platform device stuff.
  */
-static __devinit int viafb_gpio_probe(struct platform_device *platdev)
+static int viafb_gpio_probe(struct platform_device *platdev)
 {
 	struct viafb_dev *vdev = platdev->dev.platform_data;
 	struct via_port_cfg *port_cfg = vdev->port_cfg;
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index c80e770..bb41017 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -1072,7 +1072,7 @@ static int __init parse_active_dev(void)
 	return 0;
 }
 
-static int __devinit parse_port(char *opt_str, int *output_interface)
+static int parse_port(char *opt_str, int *output_interface)
 {
 	if (!strncmp(opt_str, "DVP0", 4))
 		*output_interface = INTERFACE_DVP0;
@@ -1089,7 +1089,7 @@ static int __devinit parse_port(char *opt_str, int *output_interface)
 	return 0;
 }
 
-static void __devinit parse_lcd_port(void)
+static void parse_lcd_port(void)
 {
 	parse_port(viafb_lcd_port, &viaparinfo->chip_info->lvds_chip_info.
 		output_interface);
@@ -1102,7 +1102,7 @@ static void __devinit parse_lcd_port(void)
 		  output_interface);
 }
 
-static void __devinit parse_dvi_port(void)
+static void parse_dvi_port(void)
 {
 	parse_port(viafb_dvi_port, &viaparinfo->chip_info->tmds_chip_info.
 		output_interface);
@@ -1727,7 +1727,7 @@ static struct viafb_pm_hooks viafb_fb_pm_hooks = {
 
 #endif
 
-static void __devinit i2c_bus_probe(struct viafb_shared *shared)
+static void i2c_bus_probe(struct viafb_shared *shared)
 {
 	/* should be always CRT */
 	printk(KERN_INFO "viafb: Probing I2C bus 0x26\n");
@@ -1753,7 +1753,7 @@ static void i2c_bus_free(struct viafb_shared *shared)
 	via_aux_free(shared->i2c_2C);
 }
 
-int __devinit via_fb_pci_probe(struct viafb_dev *vdev)
+int via_fb_pci_probe(struct viafb_dev *vdev)
 {
 	u32 default_xres, default_yres;
 	struct fb_var_screeninfo default_var;
diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c
index 22063bb..1b94610 100644
--- a/drivers/video/vt8500lcdfb.c
+++ b/drivers/video/vt8500lcdfb.c
@@ -273,7 +273,7 @@ static irqreturn_t vt8500lcd_handle_irq(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static int __devinit vt8500lcd_probe(struct platform_device *pdev)
+static int vt8500lcd_probe(struct platform_device *pdev)
 {
 	struct vt8500lcd_info *fbi;
 	struct resource *res;
diff --git a/drivers/video/vt8623fb.c b/drivers/video/vt8623fb.c
index f0bce7a..c23c8c7 100644
--- a/drivers/video/vt8623fb.c
+++ b/drivers/video/vt8623fb.c
@@ -660,7 +660,7 @@ static struct fb_ops vt8623fb_ops = {
 
 /* PCI probe */
 
-static int __devinit vt8623_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
+static int vt8623_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 {
 	struct pci_bus_region bus_reg;
 	struct resource vga_res;
diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c
index 614e1bd..1c2eaf2 100644
--- a/drivers/video/w100fb.c
+++ b/drivers/video/w100fb.c
@@ -54,7 +54,7 @@ static void w100_update_enable(void);
 static void w100_update_disable(void);
 static void calc_hsync(struct w100fb_par *par);
 static void w100_init_graphic_engine(struct w100fb_par *par);
-struct w100_pll_info *w100_get_xtal_table(unsigned int freq) __devinit;
+struct w100_pll_info *w100_get_xtal_table(unsigned int freq);
 
 /* Pseudo palette size */
 #define MAX_PALETTES      16
@@ -630,7 +630,7 @@ static int w100fb_resume(struct platform_device *dev)
 #endif
 
 
-int __devinit w100fb_probe(struct platform_device *pdev)
+int w100fb_probe(struct platform_device *pdev)
 {
 	int err = -EIO;
 	struct w100fb_mach_info *inf;
@@ -1021,7 +1021,7 @@ static struct pll_entries {
 	{ 0 },
 };
 
-struct w100_pll_info __devinit *w100_get_xtal_table(unsigned int freq)
+struct w100_pll_info *w100_get_xtal_table(unsigned int freq)
 {
 	struct pll_entries *pll_entry = w100_pll_tables;
 
diff --git a/drivers/video/wm8505fb.c b/drivers/video/wm8505fb.c
index 5c126af..456694a 100644
--- a/drivers/video/wm8505fb.c
+++ b/drivers/video/wm8505fb.c
@@ -260,7 +260,7 @@ static struct fb_ops wm8505fb_ops = {
 	.fb_blank	= wm8505fb_blank,
 };
 
-static int __devinit wm8505fb_probe(struct platform_device *pdev)
+static int wm8505fb_probe(struct platform_device *pdev)
 {
 	struct wm8505fb_info	*fbi;
 	struct resource		*res;
diff --git a/drivers/video/wmt_ge_rops.c b/drivers/video/wmt_ge_rops.c
index 46b7a09..e65361d 100644
--- a/drivers/video/wmt_ge_rops.c
+++ b/drivers/video/wmt_ge_rops.c
@@ -124,7 +124,7 @@ int wmt_ge_sync(struct fb_info *p)
 }
 EXPORT_SYMBOL_GPL(wmt_ge_sync);
 
-static int __devinit wmt_ge_rops_probe(struct platform_device *pdev)
+static int wmt_ge_rops_probe(struct platform_device *pdev)
 {
 	struct resource *res;
 
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index 917bb56..ee44be8 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -358,7 +358,7 @@ static irqreturn_t xenfb_event_handler(int rq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static int __devinit xenfb_probe(struct xenbus_device *dev,
+static int xenfb_probe(struct xenbus_device *dev,
 				 const struct xenbus_device_id *id)
 {
 	struct xenfb_info *info;
@@ -487,7 +487,7 @@ error:
 	return ret;
 }
 
-static __devinit void
+static void
 xenfb_make_preferred_console(void)
 {
 	struct console *c;
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 20a7c0e..b5d317c 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -403,7 +403,7 @@ static int xilinxfb_release(struct device *dev)
  * OF bus binding
  */
 
-static int __devinit xilinxfb_of_probe(struct platform_device *op)
+static int xilinxfb_of_probe(struct platform_device *op)
 {
 	const u32 *prop;
 	u32 *p;
-- 
1.8.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 19:10:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 19:10:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaWjO-00027o-QT; Mon, 19 Nov 2012 19:10:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <wfp5p@viridian.itc.virginia.edu>) id 1TaW4d-00013s-1p
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 18:28:00 +0000
Received: from [85.158.139.83:13645] by server-6.bemta-5.messagelabs.com id
	20/34-19321-E2A7AA05; Mon, 19 Nov 2012 18:27:58 +0000
X-Env-Sender: wfp5p@viridian.itc.virginia.edu
X-Msg-Ref: server-10.tower-182.messagelabs.com!1353349660!28601668!1
X-Originating-IP: [128.143.12.139]
X-SpamReason: No, hits=2.2 required=7.0 tests=BIZ_TLD,BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8645 invoked from network); 19 Nov 2012 18:27:40 -0000
Received: from viridian.itc.virginia.edu (HELO viridian.itc.virginia.edu)
	(128.143.12.139) by server-10.tower-182.messagelabs.com with SMTP;
	19 Nov 2012 18:27:40 -0000
Received: by viridian.itc.virginia.edu (Postfix, from userid 1249)
	id 4042D80318; Mon, 19 Nov 2012 13:27:32 -0500 (EST)
From: Bill Pemberton <wfp5p@virginia.edu>
To: gregkh@linuxfoundation.org
Date: Mon, 19 Nov 2012 13:21:47 -0500
Message-Id: <1353349642-3677-158-git-send-email-wfp5p@virginia.edu>
X-Mailer: git-send-email 1.8.0
In-Reply-To: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
X-Mailman-Approved-At: Mon, 19 Nov 2012 19:10:06 +0000
Cc: linux-fbdev@vger.kernel.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	virtualization@lists.linux-foundation.org,
	Michal Januszewski <spock@gentoo.org>, Paul Mackerras <paulus@samba.org>,
	linux-nvidia@lists.surfsouth.com, Daniel Walker <dwalker@fifo99.com>,
	Kukjin Kim <kgene.kim@samsung.com>, Russell King <linux@arm.linux.org.uk>,
	Wan ZongShun <mcuos.com@gmail.com>,
	Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
	Jingoo Han <jg1.han@samsung.com>, Tomi Valkeinen <tomi.valkeinen@ti.com>,
	David Brown <davidb@codeaurora.org>,
	Jaya Kumar <jayalk@intworks.biz>, cbe-oss-dev@lists.ozlabs.org,
	Antonino Daplas <adaplas@gmail.com>, linux-arm-msm@vger.kernel.org,
	Thomas Winischhofer <thomas@winischhofer.net>,
	linux-geode@lists.infradead.org, linux-samsung-soc@vger.kernel.org,
	Ben Dooks <ben-linux@fluff.org>, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Maik Broemme <mbroemme@plusserver.de>, Geoff Levand <geoff@infradead.org>,
	Ferenc Bakonyi <fero@drama.obuda.kando.hu>,
	Tony Prisk <linux@prisktech.co.nz>, Bryan Huntsman <bryanh@codeaurora.org>,
	Kristoffer Ericson <kristoffer.ericson@gmail.com>,
	linuxppc-dev@lists.ozlabs.org, xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH 158/493] video: remove use of __devinit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> 
Cc: Jaya Kumar <jayalk@intworks.biz> 
Cc: Paul Mackerras <paulus@samba.org> 
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> 
Cc: Russell King <linux@arm.linux.org.uk> 
Cc: Jingoo Han <jg1.han@samsung.com> 
Cc: Ferenc Bakonyi <fero@drama.obuda.kando.hu> 
Cc: Antonino Daplas <adaplas@gmail.com> 
Cc: Maik Broemme <mbroemme@plusserver.de> 
Cc: David Brown <davidb@codeaurora.org> 
Cc: Daniel Walker <dwalker@fifo99.com> 
Cc: Bryan Huntsman <bryanh@codeaurora.org> 
Cc: Wan ZongShun <mcuos.com@gmail.com> 
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> 
Cc: Geoff Levand <geoff@infradead.org> 
Cc: Kristoffer Ericson <kristoffer.ericson@gmail.com> 
Cc: Ben Dooks <ben-linux@fluff.org> 
Cc: Kukjin Kim <kgene.kim@samsung.com> 
Cc: Thomas Winischhofer <thomas@winischhofer.net> 
Cc: Michal Januszewski <spock@gentoo.org> 
Cc: Tony Prisk <linux@prisktech.co.nz> 
Cc: linux-fbdev@vger.kernel.org 
Cc: linux-arm-kernel@lists.infradead.org 
Cc: linux-geode@lists.infradead.org 
Cc: linux-nvidia@lists.surfsouth.com 
Cc: linux-arm-msm@vger.kernel.org 
Cc: linux-omap@vger.kernel.org 
Cc: linuxppc-dev@lists.ozlabs.org 
Cc: cbe-oss-dev@lists.ozlabs.org 
Cc: linux-samsung-soc@vger.kernel.org 
Cc: xen-devel@lists.xensource.com 
Cc: virtualization@lists.linux-foundation.org 
---
 drivers/video/acornfb.c                            | 14 ++--
 drivers/video/arcfb.c                              |  2 +-
 drivers/video/arkfb.c                              |  2 +-
 drivers/video/asiliantfb.c                         |  6 +-
 drivers/video/aty/aty128fb.c                       | 22 +++---
 drivers/video/aty/atyfb_base.c                     | 22 +++---
 drivers/video/aty/mach64_ct.c                      |  4 +-
 drivers/video/aty/mach64_cursor.c                  |  2 +-
 drivers/video/aty/radeon_base.c                    | 14 ++--
 drivers/video/aty/radeon_monitor.c                 | 16 ++---
 drivers/video/au1100fb.c                           |  2 +-
 drivers/video/au1200fb.c                           |  2 +-
 drivers/video/auo_k1900fb.c                        |  2 +-
 drivers/video/auo_k1901fb.c                        |  2 +-
 drivers/video/auo_k190x.c                          |  2 +-
 drivers/video/bf537-lq035.c                        |  6 +-
 drivers/video/bf54x-lq043fb.c                      |  2 +-
 drivers/video/bfin-lq035q1-fb.c                    |  6 +-
 drivers/video/bfin-t350mcqb-fb.c                   |  2 +-
 drivers/video/bfin_adv7393fb.c                     |  2 +-
 drivers/video/broadsheetfb.c                       |  8 +--
 drivers/video/bw2.c                                |  6 +-
 drivers/video/carminefb.c                          |  4 +-
 drivers/video/cg14.c                               |  4 +-
 drivers/video/cg3.c                                |  8 +--
 drivers/video/cg6.c                                |  8 +--
 drivers/video/chipsfb.c                            |  4 +-
 drivers/video/cirrusfb.c                           | 10 +--
 drivers/video/cobalt_lcdfb.c                       |  2 +-
 drivers/video/console/sticore.c                    | 47 ++++++-------
 drivers/video/cyber2000fb.c                        | 12 ++--
 drivers/video/da8xx-fb.c                           |  2 +-
 drivers/video/dnfb.c                               |  2 +-
 drivers/video/ep93xx-fb.c                          |  4 +-
 drivers/video/exynos/exynos_dp_core.c              |  2 +-
 drivers/video/ffb.c                                |  2 +-
 drivers/video/fm2fb.c                              |  4 +-
 drivers/video/fsl-diu-fb.c                         |  4 +-
 drivers/video/gbefb.c                              |  4 +-
 drivers/video/geode/gx1fb_core.c                   |  6 +-
 drivers/video/geode/gxfb_core.c                    | 10 +--
 drivers/video/geode/lxfb_core.c                    | 10 +--
 drivers/video/grvga.c                              |  4 +-
 drivers/video/gxt4500.c                            |  4 +-
 drivers/video/hecubafb.c                           |  2 +-
 drivers/video/hgafb.c                              |  4 +-
 drivers/video/hitfb.c                              |  2 +-
 drivers/video/hpfb.c                               |  4 +-
 drivers/video/i740fb.c                             |  4 +-
 drivers/video/i810/i810_main.c                     | 26 +++----
 drivers/video/i810/i810_main.h                     |  2 +-
 drivers/video/imsttfb.c                            |  4 +-
 drivers/video/intelfb/intelfbdrv.c                 | 16 ++---
 drivers/video/jz4740_fb.c                          |  2 +-
 drivers/video/kyro/fbdev.c                         |  2 +-
 drivers/video/leo.c                                |  2 +-
 drivers/video/mb862xx/mb862xxfbdrv.c               |  6 +-
 drivers/video/mbx/mbxdebugfs.c                     |  2 +-
 drivers/video/mbx/mbxfb.c                          | 10 +--
 drivers/video/metronomefb.c                        | 12 ++--
 drivers/video/msm/mddi.c                           |  6 +-
 drivers/video/mxsfb.c                              |  6 +-
 drivers/video/neofb.c                              | 12 ++--
 drivers/video/nuc900fb.c                           |  4 +-
 drivers/video/nvidia/nvidia.c                      | 12 ++--
 .../omap2/displays/panel-lgphilips-lb035q02.c      |  2 +-
 drivers/video/p9100.c                              |  2 +-
 drivers/video/platinumfb.c                         |  6 +-
 drivers/video/pm2fb.c                              |  2 +-
 drivers/video/pm3fb.c                              |  4 +-
 drivers/video/pmag-ba-fb.c                         |  2 +-
 drivers/video/pmagb-b-fb.c                         |  6 +-
 drivers/video/ps3fb.c                              |  2 +-
 drivers/video/pvr2fb.c                             |  6 +-
 drivers/video/pxa168fb.c                           |  4 +-
 drivers/video/pxa3xx-gcu.c                         |  2 +-
 drivers/video/pxafb.c                              | 20 +++---
 drivers/video/q40fb.c                              |  2 +-
 drivers/video/riva/fbdev.c                         | 20 +++---
 drivers/video/riva/rivafb-i2c.c                    |  6 +-
 drivers/video/s1d13xxxfb.c                         |  4 +-
 drivers/video/s3c-fb.c                             |  6 +-
 drivers/video/s3c2410fb.c                          |  8 +--
 drivers/video/s3fb.c                               |  6 +-
 drivers/video/sa1100fb.c                           |  6 +-
 drivers/video/savage/savagefb_driver.c             |  8 +--
 drivers/video/sgivwfb.c                            |  2 +-
 drivers/video/sh7760fb.c                           |  2 +-
 drivers/video/sh_mobile_lcdcfb.c                   | 16 ++---
 drivers/video/sh_mobile_meram.c                    |  2 +-
 drivers/video/sis/sis_main.c                       | 82 +++++++++++-----------
 drivers/video/skeletonfb.c                         |  2 +-
 drivers/video/sm501fb.c                            |  8 +--
 drivers/video/sstfb.c                              | 18 ++---
 drivers/video/sunxvr1000.c                         |  6 +-
 drivers/video/sunxvr2500.c                         |  6 +-
 drivers/video/sunxvr500.c                          |  6 +-
 drivers/video/tcx.c                                |  2 +-
 drivers/video/tdfxfb.c                             | 10 +--
 drivers/video/tgafb.c                              | 16 ++---
 drivers/video/tmiofb.c                             |  2 +-
 drivers/video/tridentfb.c                          |  8 +--
 drivers/video/uvesafb.c                            | 30 ++++----
 drivers/video/vermilion/vermilion.c                |  2 +-
 drivers/video/vfb.c                                |  2 +-
 drivers/video/vga16fb.c                            |  2 +-
 drivers/video/via/dvi.c                            |  8 +--
 drivers/video/via/dvi.h                            |  4 +-
 drivers/video/via/hw.c                             | 16 ++---
 drivers/video/via/hw.h                             |  4 +-
 drivers/video/via/lcd.c                            | 10 +--
 drivers/video/via/lcd.h                            |  6 +-
 drivers/video/via/via-core.c                       | 10 +--
 drivers/video/via/via-gpio.c                       |  2 +-
 drivers/video/via/viafbdev.c                       | 10 +--
 drivers/video/vt8500lcdfb.c                        |  2 +-
 drivers/video/vt8623fb.c                           |  2 +-
 drivers/video/w100fb.c                             |  6 +-
 drivers/video/wm8505fb.c                           |  2 +-
 drivers/video/wmt_ge_rops.c                        |  2 +-
 drivers/video/xen-fbfront.c                        |  4 +-
 drivers/video/xilinxfb.c                           |  2 +-
 122 files changed, 438 insertions(+), 443 deletions(-)

diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c
index b303f17..772f1ce 100644
--- a/drivers/video/acornfb.c
+++ b/drivers/video/acornfb.c
@@ -942,7 +942,7 @@ static struct fb_videomode acornfb_default_mode __devinitdata = {
 	.vmode =	FB_VMODE_NONINTERLACED
 };
 
-static void __devinit acornfb_init_fbinfo(void)
+static void acornfb_init_fbinfo(void)
 {
 	static int first = 1;
 
@@ -1018,7 +1018,7 @@ static void __devinit acornfb_init_fbinfo(void)
  *	size can optionally be followed by 'M' or 'K' for
  *	MB or KB respectively.
  */
-static void __devinit acornfb_parse_mon(char *opt)
+static void acornfb_parse_mon(char *opt)
 {
 	char *p = opt;
 
@@ -1065,7 +1065,7 @@ bad:
 	current_par.montype = -1;
 }
 
-static void __devinit acornfb_parse_montype(char *opt)
+static void acornfb_parse_montype(char *opt)
 {
 	current_par.montype = -2;
 
@@ -1106,7 +1106,7 @@ static void __devinit acornfb_parse_montype(char *opt)
 	}
 }
 
-static void __devinit acornfb_parse_dram(char *opt)
+static void acornfb_parse_dram(char *opt)
 {
 	unsigned int size;
 
@@ -1138,7 +1138,7 @@ static struct options {
 	{ NULL, NULL }
 };
 
-static int __devinit acornfb_setup(char *options)
+static int acornfb_setup(char *options)
 {
 	struct options *optp;
 	char *opt;
@@ -1175,7 +1175,7 @@ static int __devinit acornfb_setup(char *options)
  * Detect type of monitor connected
  *  For now, we just assume SVGA
  */
-static int __devinit acornfb_detect_monitortype(void)
+static int acornfb_detect_monitortype(void)
 {
 	return 4;
 }
@@ -1216,7 +1216,7 @@ free_unused_pages(unsigned int virtual_start, unsigned int virtual_end)
 	printk("acornfb: freed %dK memory\n", mb_freed);
 }
 
-static int __devinit acornfb_probe(struct platform_device *dev)
+static int acornfb_probe(struct platform_device *dev)
 {
 	unsigned long size;
 	u_int h_sync, v_sync;
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index 00967d2..964431a 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -502,7 +502,7 @@ static struct fb_ops arcfb_ops = {
 	.fb_ioctl 	= arcfb_ioctl,
 };
 
-static int __devinit arcfb_probe(struct platform_device *dev)
+static int arcfb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	int retval = -ENOMEM;
diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c
index 6bcb6c1..750efbc 100644
--- a/drivers/video/arkfb.c
+++ b/drivers/video/arkfb.c
@@ -950,7 +950,7 @@ static struct fb_ops arkfb_ops = {
 
 
 /* PCI probe */
-static int __devinit ark_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
+static int ark_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 {
 	struct pci_bus_region bus_reg;
 	struct resource vga_res;
diff --git a/drivers/video/asiliantfb.c b/drivers/video/asiliantfb.c
index 640cc69..21744e9 100644
--- a/drivers/video/asiliantfb.c
+++ b/drivers/video/asiliantfb.c
@@ -451,7 +451,7 @@ static struct chips_init_reg chips_init_xr[] =
 	{0xd1, 0x01},
 };
 
-static void __devinit chips_hw_init(struct fb_info *p)
+static void chips_hw_init(struct fb_info *p)
 {
 	int i;
 
@@ -504,7 +504,7 @@ static struct fb_var_screeninfo asiliantfb_var __devinitdata = {
 	.vsync_len 	= 2,
 };
 
-static int __devinit init_asiliant(struct fb_info *p, unsigned long addr)
+static int init_asiliant(struct fb_info *p, unsigned long addr)
 {
 	int err;
 
@@ -535,7 +535,7 @@ static int __devinit init_asiliant(struct fb_info *p, unsigned long addr)
 	return 0;
 }
 
-static int __devinit
+static int
 asiliantfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
 {
 	unsigned long addr, size;
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index 426e3f2..d9f88cc 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -449,9 +449,9 @@ static int aty128_encode_var(struct fb_var_screeninfo *var,
 static int aty128_decode_var(struct fb_var_screeninfo *var,
                              struct aty128fb_par *par);
 #if 0
-static void __devinit aty128_get_pllinfo(struct aty128fb_par *par,
+static void aty128_get_pllinfo(struct aty128fb_par *par,
 					 void __iomem *bios);
-static void __devinit __iomem *aty128_map_ROM(struct pci_dev *pdev,
+static void __iomem *aty128_map_ROM(struct pci_dev *pdev,
 					      const struct aty128fb_par *par);
 #endif
 static void aty128_timings(struct aty128fb_par *par);
@@ -582,7 +582,7 @@ static void aty_pll_writeupdate(const struct aty128fb_par *par)
 
 
 /* write to the scratch register to test r/w functionality */
-static int __devinit register_test(const struct aty128fb_par *par)
+static int register_test(const struct aty128fb_par *par)
 {
 	u32 val;
 	int flag = 0;
@@ -781,7 +781,7 @@ static u32 depth_to_dst(u32 depth)
 
 
 #ifndef __sparc__
-static void __iomem * __devinit aty128_map_ROM(const struct aty128fb_par *par,
+static void __iomem *aty128_map_ROM(const struct aty128fb_par *par,
 					       struct pci_dev *dev)
 {
 	u16 dptr;
@@ -868,7 +868,7 @@ static void __iomem * __devinit aty128_map_ROM(const struct aty128fb_par *par,
 	return NULL;
 }
 
-static void __devinit aty128_get_pllinfo(struct aty128fb_par *par,
+static void aty128_get_pllinfo(struct aty128fb_par *par,
 					 unsigned char __iomem *bios)
 {
 	unsigned int bios_hdr;
@@ -891,7 +891,7 @@ static void __devinit aty128_get_pllinfo(struct aty128fb_par *par,
 }           
 
 #ifdef CONFIG_X86
-static void __iomem *  __devinit aty128_find_mem_vbios(struct aty128fb_par *par)
+static void __iomem *aty128_find_mem_vbios(struct aty128fb_par *par)
 {
 	/* I simplified this code as we used to miss the signatures in
 	 * a lot of case. It's now closer to XFree, we just don't check
@@ -916,7 +916,7 @@ static void __iomem *  __devinit aty128_find_mem_vbios(struct aty128fb_par *par)
 #endif /* ndef(__sparc__) */
 
 /* fill in known card constants if pll_block is not available */
-static void __devinit aty128_timings(struct aty128fb_par *par)
+static void aty128_timings(struct aty128fb_par *par)
 {
 #ifdef CONFIG_PPC_OF
 	/* instead of a table lookup, assume OF has properly
@@ -1658,7 +1658,7 @@ static int aty128fb_sync(struct fb_info *info)
 }
 
 #ifndef MODULE
-static int __devinit aty128fb_setup(char *options)
+static int aty128fb_setup(char *options)
 {
 	char *this_opt;
 
@@ -1888,7 +1888,7 @@ static void aty128_early_resume(void *data)
 }
 #endif /* CONFIG_PPC_PMAC */
 
-static int __devinit aty128_init(struct pci_dev *pdev,
+static int aty128_init(struct pci_dev *pdev,
 				 const struct pci_device_id *ent)
 {
 	struct fb_info *info = pci_get_drvdata(pdev);
@@ -2039,7 +2039,7 @@ static int __devinit aty128_init(struct pci_dev *pdev,
 
 #ifdef CONFIG_PCI
 /* register a card    ++ajoshi */
-static int __devinit aty128_probe(struct pci_dev *pdev,
+static int aty128_probe(struct pci_dev *pdev,
 				  const struct pci_device_id *ent)
 {
 	unsigned long fb_addr, reg_addr;
@@ -2558,7 +2558,7 @@ static int aty128_pci_resume(struct pci_dev *pdev)
 }
 
 
-static int __devinit aty128fb_init(void)
+static int aty128fb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index bab571b..ae75dd3 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -426,7 +426,7 @@ static struct {
 #endif /* CONFIG_FB_ATY_CT */
 };
 
-static int __devinit correct_chipset(struct atyfb_par *par)
+static int correct_chipset(struct atyfb_par *par)
 {
 	u8 rev;
 	u16 type;
@@ -588,7 +588,7 @@ static u32 atyfb_get_pixclock(struct fb_var_screeninfo *var,
  * Apple monitor sense
  */
 
-static int __devinit read_aty_sense(const struct atyfb_par *par)
+static int read_aty_sense(const struct atyfb_par *par)
 {
 	int sense, i;
 
@@ -2273,7 +2273,7 @@ static void aty_bl_exit(struct backlight_device *bd)
 
 #endif /* CONFIG_FB_ATY_BACKLIGHT */
 
-static void __devinit aty_calc_mem_refresh(struct atyfb_par *par, int xclk)
+static void aty_calc_mem_refresh(struct atyfb_par *par, int xclk)
 {
 	const int ragepro_tbl[] = {
 		44, 50, 55, 66, 75, 80, 100
@@ -2307,7 +2307,7 @@ static void __devinit aty_calc_mem_refresh(struct atyfb_par *par, int xclk)
 static struct fb_info *fb_list = NULL;
 
 #if defined(__i386__) && defined(CONFIG_FB_ATY_GENERIC_LCD)
-static int __devinit atyfb_get_timings_from_lcd(struct atyfb_par *par,
+static int atyfb_get_timings_from_lcd(struct atyfb_par *par,
 						struct fb_var_screeninfo *var)
 {
 	int ret = -EINVAL;
@@ -2333,7 +2333,7 @@ static int __devinit atyfb_get_timings_from_lcd(struct atyfb_par *par,
 }
 #endif /* defined(__i386__) && defined(CONFIG_FB_ATY_GENERIC_LCD) */
 
-static int __devinit aty_init(struct fb_info *info)
+static int aty_init(struct fb_info *info)
 {
 	struct atyfb_par *par = (struct atyfb_par *) info->par;
 	const char *ramname = NULL, *xtal;
@@ -2787,7 +2787,7 @@ aty_init_exit:
 }
 
 #if defined(CONFIG_ATARI) && !defined(MODULE)
-static int __devinit store_video_par(char *video_str, unsigned char m64_num)
+static int store_video_par(char *video_str, unsigned char m64_num)
 {
 	char *p;
 	unsigned long vmembase, size, guiregbase;
@@ -2961,7 +2961,7 @@ static int atyfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
 
 #ifdef __sparc__
 
-static int __devinit atyfb_setup_sparc(struct pci_dev *pdev,
+static int atyfb_setup_sparc(struct pci_dev *pdev,
 				       struct fb_info *info,
 				       unsigned long addr)
 {
@@ -3161,7 +3161,7 @@ static int __devinit atyfb_setup_sparc(struct pci_dev *pdev,
 
 #ifdef __i386__
 #ifdef CONFIG_FB_ATY_GENERIC_LCD
-static void __devinit aty_init_lcd(struct atyfb_par *par, u32 bios_base)
+static void aty_init_lcd(struct atyfb_par *par, u32 bios_base)
 {
 	u32 driv_inf_tab, sig;
 	u16 lcd_ofs;
@@ -3392,7 +3392,7 @@ static void __devinit aty_init_lcd(struct atyfb_par *par, u32 bios_base)
 }
 #endif /* CONFIG_FB_ATY_GENERIC_LCD */
 
-static int __devinit init_from_bios(struct atyfb_par *par)
+static int init_from_bios(struct atyfb_par *par)
 {
 	u32 bios_base, rom_addr;
 	int ret;
@@ -3445,7 +3445,7 @@ static int __devinit init_from_bios(struct atyfb_par *par)
 }
 #endif /* __i386__ */
 
-static int __devinit atyfb_setup_generic(struct pci_dev *pdev,
+static int atyfb_setup_generic(struct pci_dev *pdev,
 					 struct fb_info *info,
 					 unsigned long addr)
 {
@@ -3525,7 +3525,7 @@ atyfb_setup_generic_fail:
 
 #endif /* !__sparc__ */
 
-static int __devinit atyfb_pci_probe(struct pci_dev *pdev,
+static int atyfb_pci_probe(struct pci_dev *pdev,
 				     const struct pci_device_id *ent)
 {
 	unsigned long addr, res_start, res_size;
diff --git a/drivers/video/aty/mach64_ct.c b/drivers/video/aty/mach64_ct.c
index 2745b85..31dd017 100644
--- a/drivers/video/aty/mach64_ct.c
+++ b/drivers/video/aty/mach64_ct.c
@@ -373,7 +373,7 @@ void aty_set_pll_ct(const struct fb_info *info, const union aty_pll *pll)
 #endif
 }
 
-static void __devinit aty_get_pll_ct(const struct fb_info *info,
+static void aty_get_pll_ct(const struct fb_info *info,
 				     union aty_pll *pll)
 {
 	struct atyfb_par *par = (struct atyfb_par *) info->par;
@@ -397,7 +397,7 @@ static void __devinit aty_get_pll_ct(const struct fb_info *info,
 	}
 }
 
-static int __devinit aty_init_pll_ct(const struct fb_info *info,
+static int aty_init_pll_ct(const struct fb_info *info,
 				     union aty_pll *pll)
 {
 	struct atyfb_par *par = (struct atyfb_par *) info->par;
diff --git a/drivers/video/aty/mach64_cursor.c b/drivers/video/aty/mach64_cursor.c
index 46f72ed..95ec042 100644
--- a/drivers/video/aty/mach64_cursor.c
+++ b/drivers/video/aty/mach64_cursor.c
@@ -183,7 +183,7 @@ static int atyfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
 	return 0;
 }
 
-int __devinit aty_init_cursor(struct fb_info *info)
+int aty_init_cursor(struct fb_info *info)
 {
 	unsigned long addr;
 
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index dacaa4e..7687179 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -293,7 +293,7 @@ static void radeon_unmap_ROM(struct radeonfb_info *rinfo, struct pci_dev *dev)
 	pci_unmap_rom(dev, rinfo->bios_seg);
 }
 
-static int __devinit radeon_map_ROM(struct radeonfb_info *rinfo, struct pci_dev *dev)
+static int radeon_map_ROM(struct radeonfb_info *rinfo, struct pci_dev *dev)
 {
 	void __iomem *rom;
 	u16 dptr;
@@ -388,7 +388,7 @@ static int __devinit radeon_map_ROM(struct radeonfb_info *rinfo, struct pci_dev
 }
 
 #ifdef CONFIG_X86
-static int  __devinit radeon_find_mem_vbios(struct radeonfb_info *rinfo)
+static int  radeon_find_mem_vbios(struct radeonfb_info *rinfo)
 {
 	/* I simplified this code as we used to miss the signatures in
 	 * a lot of case. It's now closer to XFree, we just don't check
@@ -423,7 +423,7 @@ static int  __devinit radeon_find_mem_vbios(struct radeonfb_info *rinfo)
  * Read XTAL (ref clock), SCLK and MCLK from Open Firmware device
  * tree. Hopefully, ATI OF driver is kind enough to fill these
  */
-static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo)
+static int radeon_read_xtal_OF (struct radeonfb_info *rinfo)
 {
 	struct device_node *dp = rinfo->of_node;
 	const u32 *val;
@@ -453,7 +453,7 @@ static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo)
 /*
  * Read PLL infos from chip registers
  */
-static int __devinit radeon_probe_pll_params(struct radeonfb_info *rinfo)
+static int radeon_probe_pll_params(struct radeonfb_info *rinfo)
 {
 	unsigned char ppll_div_sel;
 	unsigned Ns, Nm, M;
@@ -591,7 +591,7 @@ static int __devinit radeon_probe_pll_params(struct radeonfb_info *rinfo)
 /*
  * Retrieve PLL infos by different means (BIOS, Open Firmware, register probing...)
  */
-static void __devinit radeon_get_pllinfo(struct radeonfb_info *rinfo)
+static void radeon_get_pllinfo(struct radeonfb_info *rinfo)
 {
 	/*
 	 * In the case nothing works, these are defaults; they are mostly
@@ -1868,7 +1868,7 @@ static struct fb_ops radeonfb_ops = {
 };
 
 
-static int __devinit radeon_set_fbinfo (struct radeonfb_info *rinfo)
+static int radeon_set_fbinfo (struct radeonfb_info *rinfo)
 {
 	struct fb_info *info = rinfo->info;
 
@@ -2143,7 +2143,7 @@ static struct bin_attribute edid2_attr = {
 };
 
 
-static int __devinit radeonfb_pci_register (struct pci_dev *pdev,
+static int radeonfb_pci_register (struct pci_dev *pdev,
 				  const struct pci_device_id *ent)
 {
 	struct fb_info *info;
diff --git a/drivers/video/aty/radeon_monitor.c b/drivers/video/aty/radeon_monitor.c
index 5c23eac..d6d861b 100644
--- a/drivers/video/aty/radeon_monitor.c
+++ b/drivers/video/aty/radeon_monitor.c
@@ -62,7 +62,7 @@ static char *radeon_get_mon_name(int type)
  * models with broken OF probing by hard-coding known EDIDs for some Mac
  * laptops internal LVDS panel. (XXX: not done yet)
  */
-static int __devinit radeon_parse_montype_prop(struct device_node *dp, u8 **out_EDID,
+static int radeon_parse_montype_prop(struct device_node *dp, u8 **out_EDID,
 					       int hdno)
 {
         static char *propnames[] = { "DFP,EDID", "LCD,EDID", "EDID",
@@ -115,7 +115,7 @@ static int __devinit radeon_parse_montype_prop(struct device_node *dp, u8 **out_
 	return mt;
 }
 
-static int __devinit radeon_probe_OF_head(struct radeonfb_info *rinfo, int head_no,
+static int radeon_probe_OF_head(struct radeonfb_info *rinfo, int head_no,
 					  u8 **out_EDID)
 {
         struct device_node *dp;
@@ -163,7 +163,7 @@ static int __devinit radeon_probe_OF_head(struct radeonfb_info *rinfo, int head_
 #endif /* CONFIG_PPC_OF || CONFIG_SPARC */
 
 
-static int __devinit radeon_get_panel_info_BIOS(struct radeonfb_info *rinfo)
+static int radeon_get_panel_info_BIOS(struct radeonfb_info *rinfo)
 {
 	unsigned long tmp, tmp0;
 	char stmp[30];
@@ -251,7 +251,7 @@ static int __devinit radeon_get_panel_info_BIOS(struct radeonfb_info *rinfo)
  * doesn't quite work yet, but it's output is still useful for
  * debugging
  */
-static void __devinit radeon_parse_connector_info(struct radeonfb_info *rinfo)
+static void radeon_parse_connector_info(struct radeonfb_info *rinfo)
 {
 	int offset, chips, connectors, tmp, i, conn, type;
 
@@ -297,7 +297,7 @@ static void __devinit radeon_parse_connector_info(struct radeonfb_info *rinfo)
  * as well and currently is only implemented for the CRT DAC, the
  * code for the TVDAC is commented out in XFree as "non working"
  */
-static int __devinit radeon_crt_is_connected(struct radeonfb_info *rinfo, int is_crt_dac)
+static int radeon_crt_is_connected(struct radeonfb_info *rinfo, int is_crt_dac)
 {
     int	          connected = 0;
 
@@ -369,7 +369,7 @@ static int __devinit radeon_crt_is_connected(struct radeonfb_info *rinfo, int is
  * Parse the "monitor_layout" string if any. This code is mostly
  * copied from XFree's radeon driver
  */
-static int __devinit radeon_parse_monitor_layout(struct radeonfb_info *rinfo,
+static int radeon_parse_monitor_layout(struct radeonfb_info *rinfo,
 						 const char *monitor_layout)
 {
 	char s1[5], s2[5];
@@ -433,7 +433,7 @@ static int __devinit radeon_parse_monitor_layout(struct radeonfb_info *rinfo,
  * try to retrieve EDID. The algorithm here comes from XFree's radeon
  * driver
  */
-void __devinit radeon_probe_screens(struct radeonfb_info *rinfo,
+void radeon_probe_screens(struct radeonfb_info *rinfo,
 				    const char *monitor_layout, int ignore_edid)
 {
 #ifdef CONFIG_FB_RADEON_I2C
@@ -753,7 +753,7 @@ static int is_powerblade(const char *model)
  * Build the modedb for head 1 (head 2 will come later), check panel infos
  * from either BIOS or EDID, and pick up the default mode
  */
-void __devinit radeon_check_modes(struct radeonfb_info *rinfo, const char *mode_option)
+void radeon_check_modes(struct radeonfb_info *rinfo, const char *mode_option)
 {
 	struct fb_info * info = rinfo->info;
 	int has_default_mode = 0;
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c
index fe3b6ec..b4b76dc 100644
--- a/drivers/video/au1100fb.c
+++ b/drivers/video/au1100fb.c
@@ -469,7 +469,7 @@ static int au1100fb_setup(struct au1100fb_device *fbdev)
 	return 0;
 }
 
-static int __devinit au1100fb_drv_probe(struct platform_device *dev)
+static int au1100fb_drv_probe(struct platform_device *dev)
 {
 	struct au1100fb_device *fbdev = NULL;
 	struct resource *regs_res;
diff --git a/drivers/video/au1200fb.c b/drivers/video/au1200fb.c
index 4538b07..b270a5c 100644
--- a/drivers/video/au1200fb.c
+++ b/drivers/video/au1200fb.c
@@ -1673,7 +1673,7 @@ out:
 }
 
 /* AU1200 LCD controller device driver */
-static int __devinit au1200fb_drv_probe(struct platform_device *dev)
+static int au1200fb_drv_probe(struct platform_device *dev)
 {
 	struct au1200fb_device *fbdev;
 	struct au1200fb_platdata *pd;
diff --git a/drivers/video/auo_k1900fb.c b/drivers/video/auo_k1900fb.c
index 1581dbf..46ec47b 100644
--- a/drivers/video/auo_k1900fb.c
+++ b/drivers/video/auo_k1900fb.c
@@ -156,7 +156,7 @@ static bool auok1900fb_need_refresh(struct auok190xfb_par *par)
 	return (par->update_cnt > 10);
 }
 
-static int __devinit auok1900fb_probe(struct platform_device *pdev)
+static int auok1900fb_probe(struct platform_device *pdev)
 {
 	struct auok190x_init_data init;
 	struct auok190x_board *board;
diff --git a/drivers/video/auo_k1901fb.c b/drivers/video/auo_k1901fb.c
index 94a0e01..9eb7eeb 100644
--- a/drivers/video/auo_k1901fb.c
+++ b/drivers/video/auo_k1901fb.c
@@ -209,7 +209,7 @@ static bool auok1901fb_need_refresh(struct auok190xfb_par *par)
 	return (par->update_cnt > 10);
 }
 
-static int __devinit auok1901fb_probe(struct platform_device *pdev)
+static int auok1901fb_probe(struct platform_device *pdev)
 {
 	struct auok190x_init_data init;
 	struct auok190x_board *board;
diff --git a/drivers/video/auo_k190x.c b/drivers/video/auo_k190x.c
index c03ecdd..70aa5d4 100644
--- a/drivers/video/auo_k190x.c
+++ b/drivers/video/auo_k190x.c
@@ -773,7 +773,7 @@ EXPORT_SYMBOL_GPL(auok190x_pm);
  * Common probe and remove code
  */
 
-int __devinit auok190x_common_probe(struct platform_device *pdev,
+int auok190x_common_probe(struct platform_device *pdev,
 				    struct auok190x_init_data *init)
 {
 	struct auok190x_board *board = init->board;
diff --git a/drivers/video/bf537-lq035.c b/drivers/video/bf537-lq035.c
index 8081c7b..0b7c757 100644
--- a/drivers/video/bf537-lq035.c
+++ b/drivers/video/bf537-lq035.c
@@ -87,7 +87,7 @@ static void set_vcomm(void)
 		pr_err("i2c_smbus_write_byte_data fail: %d\n", nr);
 }
 
-static int __devinit ad5280_probe(struct i2c_client *client,
+static int ad5280_probe(struct i2c_client *client,
 				  const struct i2c_device_id *id)
 {
 	int ret;
@@ -360,7 +360,7 @@ static int config_dma(void)
 	return 0;
 }
 
-static int __devinit request_ports(void)
+static int request_ports(void)
 {
 	u16 tmr_req[] = TIMERS;
 
@@ -686,7 +686,7 @@ static struct lcd_ops bfin_lcd_ops = {
 
 static struct lcd_device *lcd_dev;
 
-static int __devinit bfin_lq035_probe(struct platform_device *pdev)
+static int bfin_lq035_probe(struct platform_device *pdev)
 {
 	struct backlight_properties props;
 	dma_addr_t dma_handle;
diff --git a/drivers/video/bf54x-lq043fb.c b/drivers/video/bf54x-lq043fb.c
index aff8520..9f72580 100644
--- a/drivers/video/bf54x-lq043fb.c
+++ b/drivers/video/bf54x-lq043fb.c
@@ -497,7 +497,7 @@ static irqreturn_t bfin_bf54x_irq_error(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static int __devinit bfin_bf54x_probe(struct platform_device *pdev)
+static int bfin_bf54x_probe(struct platform_device *pdev)
 {
 #ifndef NO_BL_SUPPORT
 	struct backlight_properties props;
diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c
index acd438c..353fb7c 100644
--- a/drivers/video/bfin-lq035q1-fb.c
+++ b/drivers/video/bfin-lq035q1-fb.c
@@ -137,7 +137,7 @@ static int lq035q1_control(struct spi_device *spi, unsigned char reg, unsigned s
 	return ret;
 }
 
-static int __devinit lq035q1_spidev_probe(struct spi_device *spi)
+static int lq035q1_spidev_probe(struct spi_device *spi)
 {
 	int ret;
 	struct spi_control *ctl;
@@ -358,7 +358,7 @@ static inline void bfin_lq035q1_free_ports(unsigned ppi16)
 		gpio_free(P_IDENT(P_PPI0_FS3));
 }
 
-static int __devinit bfin_lq035q1_request_ports(struct platform_device *pdev,
+static int bfin_lq035q1_request_ports(struct platform_device *pdev,
 						unsigned ppi16)
 {
 	int ret;
@@ -555,7 +555,7 @@ static irqreturn_t bfin_lq035q1_irq_error(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static int __devinit bfin_lq035q1_probe(struct platform_device *pdev)
+static int bfin_lq035q1_probe(struct platform_device *pdev)
 {
 	struct bfin_lq035q1fb_info *info;
 	struct fb_info *fbinfo;
diff --git a/drivers/video/bfin-t350mcqb-fb.c b/drivers/video/bfin-t350mcqb-fb.c
index c753abd..9456865 100644
--- a/drivers/video/bfin-t350mcqb-fb.c
+++ b/drivers/video/bfin-t350mcqb-fb.c
@@ -418,7 +418,7 @@ static irqreturn_t bfin_t350mcqb_irq_error(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev)
+static int bfin_t350mcqb_probe(struct platform_device *pdev)
 {
 #ifndef NO_BL_SUPPORT
 	struct backlight_properties props;
diff --git a/drivers/video/bfin_adv7393fb.c b/drivers/video/bfin_adv7393fb.c
index a32ef5a..85e9659 100644
--- a/drivers/video/bfin_adv7393fb.c
+++ b/drivers/video/bfin_adv7393fb.c
@@ -368,7 +368,7 @@ adv7393_write_proc(struct file *file, const char __user * buffer,
 	return count;
 }
 
-static int __devinit bfin_adv7393_fb_probe(struct i2c_client *client,
+static int bfin_adv7393_fb_probe(struct i2c_client *client,
 					   const struct i2c_device_id *id)
 {
 	int ret = 0;
diff --git a/drivers/video/broadsheetfb.c b/drivers/video/broadsheetfb.c
index 377dde3..bd15a9b 100644
--- a/drivers/video/broadsheetfb.c
+++ b/drivers/video/broadsheetfb.c
@@ -774,7 +774,7 @@ static DEVICE_ATTR(loadstore_waveform, S_IWUSR, NULL,
 			broadsheet_loadstore_waveform);
 
 /* upper level functions that manipulate the display and other stuff */
-static void __devinit broadsheet_init_display(struct broadsheetfb_par *par)
+static void broadsheet_init_display(struct broadsheetfb_par *par)
 {
 	u16 args[5];
 	int xres = par->info->var.xres;
@@ -834,7 +834,7 @@ static void __devinit broadsheet_init_display(struct broadsheetfb_par *par)
 	par->board->wait_for_rdy(par);
 }
 
-static void __devinit broadsheet_identify(struct broadsheetfb_par *par)
+static void broadsheet_identify(struct broadsheetfb_par *par)
 {
 	u16 rev, prc;
 	struct device *dev = par->info->device;
@@ -849,7 +849,7 @@ static void __devinit broadsheet_identify(struct broadsheetfb_par *par)
 		dev_warn(dev, "Unrecognized Broadsheet Revision\n");
 }
 
-static void __devinit broadsheet_init(struct broadsheetfb_par *par)
+static void broadsheet_init(struct broadsheetfb_par *par)
 {
 	broadsheet_send_command(par, BS_CMD_INIT_SYS_RUN);
 	/* the controller needs a second */
@@ -1058,7 +1058,7 @@ static struct fb_deferred_io broadsheetfb_defio = {
 	.deferred_io	= broadsheetfb_dpy_deferred_io,
 };
 
-static int __devinit broadsheetfb_probe(struct platform_device *dev)
+static int broadsheetfb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	struct broadsheet_board *board;
diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c
index bc88682..21a8587 100644
--- a/drivers/video/bw2.c
+++ b/drivers/video/bw2.c
@@ -179,7 +179,7 @@ static int bw2_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
  *  Initialisation
  */
 
-static void __devinit bw2_init_fix(struct fb_info *info, int linebytes)
+static void bw2_init_fix(struct fb_info *info, int linebytes)
 {
 	strlcpy(info->fix.id, "bwtwo", sizeof(info->fix.id));
 
@@ -226,7 +226,7 @@ static u8 bw2regs_66hz[] __devinitdata = {
 	0x10, 0x20,	0
 };
 
-static int __devinit bw2_do_default_mode(struct bw2_par *par,
+static int bw2_do_default_mode(struct bw2_par *par,
 					 struct fb_info *info,
 					 int *linebytes)
 {
@@ -273,7 +273,7 @@ static int __devinit bw2_do_default_mode(struct bw2_par *par,
 	return 0;
 }
 
-static int __devinit bw2_probe(struct platform_device *op)
+static int bw2_probe(struct platform_device *op)
 {
 	struct device_node *dp = op->dev.of_node;
 	struct fb_info *info;
diff --git a/drivers/video/carminefb.c b/drivers/video/carminefb.c
index 27561cc..9d9eb08 100644
--- a/drivers/video/carminefb.c
+++ b/drivers/video/carminefb.c
@@ -537,7 +537,7 @@ static struct fb_ops carminefb_ops = {
 	.fb_setcolreg	= carmine_setcolreg,
 };
 
-static int __devinit alloc_carmine_fb(void __iomem *regs, void __iomem *smem_base,
+static int alloc_carmine_fb(void __iomem *regs, void __iomem *smem_base,
 		int smem_offset, struct device *device, struct fb_info **rinfo)
 {
 	int ret;
@@ -606,7 +606,7 @@ static void cleanup_fb_device(struct fb_info *info)
 	}
 }
 
-static int __devinit carminefb_probe(struct pci_dev *dev,
+static int carminefb_probe(struct pci_dev *dev,
 		const struct pci_device_id *ent)
 {
 	struct carmine_hw *hw;
diff --git a/drivers/video/cg14.c b/drivers/video/cg14.c
index 6889f0c..e9d80c1 100644
--- a/drivers/video/cg14.c
+++ b/drivers/video/cg14.c
@@ -352,7 +352,7 @@ static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
  *  Initialisation
  */
 
-static void __devinit cg14_init_fix(struct fb_info *info, int linebytes,
+static void cg14_init_fix(struct fb_info *info, int linebytes,
 				    struct device_node *dp)
 {
 	const char *name = dp->name;
@@ -463,7 +463,7 @@ static void cg14_unmap_regs(struct platform_device *op, struct fb_info *info,
 			   info->screen_base, info->fix.smem_len);
 }
 
-static int __devinit cg14_probe(struct platform_device *op)
+static int cg14_probe(struct platform_device *op)
 {
 	struct device_node *dp = op->dev.of_node;
 	struct fb_info *info;
diff --git a/drivers/video/cg3.c b/drivers/video/cg3.c
index 0bd94d4..6102d57 100644
--- a/drivers/video/cg3.c
+++ b/drivers/video/cg3.c
@@ -243,7 +243,7 @@ static int cg3_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
  *  Initialisation
  */
 
-static void __devinit cg3_init_fix(struct fb_info *info, int linebytes,
+static void cg3_init_fix(struct fb_info *info, int linebytes,
 				   struct device_node *dp)
 {
 	strlcpy(info->fix.id, dp->name, sizeof(info->fix.id));
@@ -256,7 +256,7 @@ static void __devinit cg3_init_fix(struct fb_info *info, int linebytes,
 	info->fix.accel = FB_ACCEL_SUN_CGTHREE;
 }
 
-static void __devinit cg3_rdi_maybe_fixup_var(struct fb_var_screeninfo *var,
+static void cg3_rdi_maybe_fixup_var(struct fb_var_screeninfo *var,
 					      struct device_node *dp)
 {
 	const char *params;
@@ -308,7 +308,7 @@ static u_char cg3_dacvals[] __devinitdata = {
 	4, 0xff,	5, 0x00,	6, 0x70,	7, 0x00,	0
 };
 
-static int __devinit cg3_do_default_mode(struct cg3_par *par)
+static int cg3_do_default_mode(struct cg3_par *par)
 {
 	enum cg3_type type;
 	u8 *p;
@@ -346,7 +346,7 @@ static int __devinit cg3_do_default_mode(struct cg3_par *par)
 	return 0;
 }
 
-static int __devinit cg3_probe(struct platform_device *op)
+static int cg3_probe(struct platform_device *op)
 {
 	struct device_node *dp = op->dev.of_node;
 	struct fb_info *info;
diff --git a/drivers/video/cg6.c b/drivers/video/cg6.c
index 70c7013..3204e5a 100644
--- a/drivers/video/cg6.c
+++ b/drivers/video/cg6.c
@@ -607,7 +607,7 @@ static int cg6_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
  *  Initialisation
  */
 
-static void __devinit cg6_init_fix(struct fb_info *info, int linebytes)
+static void cg6_init_fix(struct fb_info *info, int linebytes)
 {
 	struct cg6_par *par = (struct cg6_par *)info->par;
 	const char *cg6_cpu_name, *cg6_card_name;
@@ -649,7 +649,7 @@ static void __devinit cg6_init_fix(struct fb_info *info, int linebytes)
 }
 
 /* Initialize Brooktree DAC */
-static void __devinit cg6_bt_init(struct cg6_par *par)
+static void cg6_bt_init(struct cg6_par *par)
 {
 	struct bt_regs __iomem *bt = par->bt;
 
@@ -663,7 +663,7 @@ static void __devinit cg6_bt_init(struct cg6_par *par)
 	sbus_writel(0x00 << 24, &bt->control);
 }
 
-static void __devinit cg6_chip_init(struct fb_info *info)
+static void cg6_chip_init(struct fb_info *info)
 {
 	struct cg6_par *par = (struct cg6_par *)info->par;
 	struct cg6_tec __iomem *tec = par->tec;
@@ -737,7 +737,7 @@ static void cg6_unmap_regs(struct platform_device *op, struct fb_info *info,
 			   info->fix.smem_len);
 }
 
-static int __devinit cg6_probe(struct platform_device *op)
+static int cg6_probe(struct platform_device *op)
 {
 	struct device_node *dp = op->dev.of_node;
 	struct fb_info *info;
diff --git a/drivers/video/chipsfb.c b/drivers/video/chipsfb.c
index 809857d..bf131f2 100644
--- a/drivers/video/chipsfb.c
+++ b/drivers/video/chipsfb.c
@@ -330,7 +330,7 @@ static struct fb_var_screeninfo chipsfb_var __devinitdata = {
 	.vsync_len = 8,
 };
 
-static void __devinit init_chips(struct fb_info *p, unsigned long addr)
+static void init_chips(struct fb_info *p, unsigned long addr)
 {
 	memset(p->screen_base, 0, 0x100000);
 
@@ -347,7 +347,7 @@ static void __devinit init_chips(struct fb_info *p, unsigned long addr)
 	chips_hw_init();
 }
 
-static int __devinit
+static int
 chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
 {
 	struct fb_info *p;
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
index 3ce6e55..0e73200 100644
--- a/drivers/video/cirrusfb.c
+++ b/drivers/video/cirrusfb.c
@@ -1892,7 +1892,7 @@ static int release_io_ports;
  * based on the DRAM bandwidth bit and DRAM bank switching bit.  This
  * works with 1MB, 2MB and 4MB configurations (which the Motorola boards
  * seem to have. */
-static unsigned int __devinit cirrusfb_get_memsize(struct fb_info *info,
+static unsigned int cirrusfb_get_memsize(struct fb_info *info,
 						   u8 __iomem *regbase)
 {
 	unsigned long mem;
@@ -2003,7 +2003,7 @@ static struct fb_ops cirrusfb_ops = {
 	.fb_imageblit	= cirrusfb_imageblit,
 };
 
-static int __devinit cirrusfb_set_fbinfo(struct fb_info *info)
+static int cirrusfb_set_fbinfo(struct fb_info *info)
 {
 	struct cirrusfb_info *cinfo = info->par;
 	struct fb_var_screeninfo *var = &info->var;
@@ -2052,7 +2052,7 @@ static int __devinit cirrusfb_set_fbinfo(struct fb_info *info)
 	return 0;
 }
 
-static int __devinit cirrusfb_register(struct fb_info *info)
+static int cirrusfb_register(struct fb_info *info)
 {
 	struct cirrusfb_info *cinfo = info->par;
 	int err;
@@ -2109,7 +2109,7 @@ static void __devexit cirrusfb_cleanup(struct fb_info *info)
 }
 
 #ifdef CONFIG_PCI
-static int __devinit cirrusfb_pci_register(struct pci_dev *pdev,
+static int cirrusfb_pci_register(struct pci_dev *pdev,
 					   const struct pci_device_id *ent)
 {
 	struct cirrusfb_info *cinfo;
@@ -2237,7 +2237,7 @@ static struct pci_driver cirrusfb_pci_driver = {
 #endif /* CONFIG_PCI */
 
 #ifdef CONFIG_ZORRO
-static int __devinit cirrusfb_zorro_register(struct zorro_dev *z,
+static int cirrusfb_zorro_register(struct zorro_dev *z,
 					     const struct zorro_device_id *ent)
 {
 	struct fb_info *info;
diff --git a/drivers/video/cobalt_lcdfb.c b/drivers/video/cobalt_lcdfb.c
index 9f2dc21..9e1e5d2 100644
--- a/drivers/video/cobalt_lcdfb.c
+++ b/drivers/video/cobalt_lcdfb.c
@@ -331,7 +331,7 @@ static struct fb_ops cobalt_lcd_fbops = {
 	.fb_cursor	= cobalt_lcdfb_cursor,
 };
 
-static int __devinit cobalt_lcdfb_probe(struct platform_device *dev)
+static int cobalt_lcdfb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	struct resource *res;
diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c
index 39571f9..0fbc03c 100644
--- a/drivers/video/console/sticore.c
+++ b/drivers/video/console/sticore.c
@@ -238,7 +238,7 @@ static void sti_flush(unsigned long start, unsigned long end)
 	flush_icache_range(start, end);
 }
 
-static void __devinit sti_rom_copy(unsigned long base, unsigned long count,
+static void sti_rom_copy(unsigned long base, unsigned long count,
 				   void *dest)
 {
 	unsigned long dest_start = (unsigned long) dest;
@@ -266,7 +266,7 @@ static void __devinit sti_rom_copy(unsigned long base, unsigned long count,
 static char default_sti_path[21] __read_mostly;
 
 #ifndef MODULE
-static int __devinit sti_setup(char *str)
+static int sti_setup(char *str)
 {
 	if (str)
 		strlcpy (default_sti_path, str, sizeof (default_sti_path));
@@ -290,7 +290,7 @@ static int __devinitdata	font_index[MAX_STI_ROMS],
 				font_height[MAX_STI_ROMS],
 				font_width[MAX_STI_ROMS];
 #ifndef MODULE
-static int __devinit sti_font_setup(char *str)
+static int sti_font_setup(char *str)
 {
 	char *x;
 	int i = 0;
@@ -343,7 +343,7 @@ __setup("sti_font=", sti_font_setup);
 
 
 	
-static void __devinit
+static void
 sti_dump_globcfg(struct sti_glob_cfg *glob_cfg, unsigned int sti_mem_request)
 {
 	struct sti_glob_cfg_ext *cfg;
@@ -383,7 +383,7 @@ sti_dump_globcfg(struct sti_glob_cfg *glob_cfg, unsigned int sti_mem_request)
 		cfg->sti_mem_addr, sti_mem_request));
 }
 
-static void __devinit
+static void
 sti_dump_outptr(struct sti_struct *sti)
 {
 	DPRINTK((KERN_INFO
@@ -397,7 +397,7 @@ sti_dump_outptr(struct sti_struct *sti)
 		 sti->outptr.attributes));
 }
 
-static int __devinit
+static int
 sti_init_glob_cfg(struct sti_struct *sti,
 	    unsigned long rom_address, unsigned long hpa)
 {
@@ -479,7 +479,7 @@ sti_init_glob_cfg(struct sti_struct *sti,
 }
 
 #ifdef CONFIG_FB
-static struct sti_cooked_font __devinit
+static struct sti_cooked_font
 *sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name)
 {
 	const struct font_desc *fbfont;
@@ -535,14 +535,14 @@ static struct sti_cooked_font __devinit
 	return cooked_font;
 }
 #else
-static struct sti_cooked_font __devinit
+static struct sti_cooked_font
 *sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name)
 {
 	return NULL;
 }
 #endif
 
-static struct sti_cooked_font __devinit
+static struct sti_cooked_font
 *sti_select_font(struct sti_cooked_rom *rom,
 		 int (*search_font_fnc)(struct sti_cooked_rom *, int, int))
 {
@@ -569,7 +569,7 @@ static struct sti_cooked_font __devinit
 }
 
 
-static void __devinit
+static void
 sti_dump_rom(struct sti_rom *rom)
 {
 	printk(KERN_INFO "    id %04x-%04x, conforms to spec rev. %d.%02x\n",
@@ -587,7 +587,7 @@ sti_dump_rom(struct sti_rom *rom)
 }
 
 
-static int __devinit
+static int
 sti_cook_fonts(struct sti_cooked_rom *cooked_rom,
 			struct sti_rom *raw_rom)
 {
@@ -622,7 +622,7 @@ sti_cook_fonts(struct sti_cooked_rom *cooked_rom,
 }
 
 
-static int __devinit
+static int
 sti_search_font(struct sti_cooked_rom *rom, int height, int width)
 {
 	struct sti_cooked_font *font;
@@ -639,8 +639,7 @@ sti_search_font(struct sti_cooked_rom *rom, int height, int width)
 #define BMODE_RELOCATE(offset)		offset = (offset) / 4;
 #define BMODE_LAST_ADDR_OFFS		0x50
 
-static void * __devinit
-sti_bmode_font_raw(struct sti_cooked_font *f)
+static void *sti_bmode_font_raw(struct sti_cooked_font *f)
 {
 	unsigned char *n, *p, *q;
 	int size = f->raw->bytes_per_char*256+sizeof(struct sti_rom_font);
@@ -657,7 +656,7 @@ sti_bmode_font_raw(struct sti_cooked_font *f)
 	return n + 3;
 }
 
-static void __devinit
+static void
 sti_bmode_rom_copy(unsigned long base, unsigned long count, void *dest)
 {
 	unsigned long dest_start = (unsigned long) dest;
@@ -672,8 +671,7 @@ sti_bmode_rom_copy(unsigned long base, unsigned long count, void *dest)
 	sti_flush(dest_start, (unsigned long)dest);
 }
 
-static struct sti_rom * __devinit
-sti_get_bmode_rom (unsigned long address)
+static struct sti_rom *sti_get_bmode_rom (unsigned long address)
 {
 	struct sti_rom *raw;
 	u32 size;
@@ -708,7 +706,7 @@ sti_get_bmode_rom (unsigned long address)
 	return raw;
 }
 
-static struct sti_rom __devinit *sti_get_wmode_rom(unsigned long address)
+static struct sti_rom *sti_get_wmode_rom(unsigned long address)
 {
 	struct sti_rom *raw;
 	unsigned long size;
@@ -723,7 +721,7 @@ static struct sti_rom __devinit *sti_get_wmode_rom(unsigned long address)
 	return raw;
 }
 
-static int __devinit sti_read_rom(int wordmode, struct sti_struct *sti,
+static int sti_read_rom(int wordmode, struct sti_struct *sti,
 				  unsigned long address)
 {
 	struct sti_cooked_rom *cooked;
@@ -806,8 +804,7 @@ out_err:
 	return 0;
 }
 
-static struct sti_struct * __devinit
-sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd)
+static struct sti_struct *sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd)
 {
 	struct sti_struct *sti;
 	int ok;
@@ -921,7 +918,7 @@ out_err:
 	return NULL;
 }
 
-static void __devinit sticore_check_for_default_sti(struct sti_struct *sti, char *path)
+static void sticore_check_for_default_sti(struct sti_struct *sti, char *path)
 {
 	if (strcmp (path, default_sti_path) == 0)
 		default_sti = sti;
@@ -932,7 +929,7 @@ static void __devinit sticore_check_for_default_sti(struct sti_struct *sti, char
  * in the additional address field addr[1] while on
  * older Systems the PDC stores it in page0->proc_sti 
  */
-static int __devinit sticore_pa_init(struct parisc_device *dev)
+static int sticore_pa_init(struct parisc_device *dev)
 {
 	char pa_path[21];
 	struct sti_struct *sti = NULL;
@@ -953,7 +950,7 @@ static int __devinit sticore_pa_init(struct parisc_device *dev)
 }
 
 
-static int __devinit sticore_pci_init(struct pci_dev *pd,
+static int sticore_pci_init(struct pci_dev *pd,
 		const struct pci_device_id *ent)
 {
 #ifdef CONFIG_PCI
@@ -1043,7 +1040,7 @@ static struct parisc_driver pa_sti_driver = {
 
 static int sticore_initialized __read_mostly;
 
-static void __devinit sti_init_roms(void)
+static void sti_init_roms(void)
 {
 	if (sticore_initialized)
 		return;
diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c
index 9b75b29..78bb6be 100644
--- a/drivers/video/cyber2000fb.c
+++ b/drivers/video/cyber2000fb.c
@@ -1230,7 +1230,7 @@ static int cyber2000fb_ddc_getsda(void *data)
 	return retval;
 }
 
-static int __devinit cyber2000fb_setup_ddc_bus(struct cfb_info *cfb)
+static int cyber2000fb_setup_ddc_bus(struct cfb_info *cfb)
 {
 	strlcpy(cfb->ddc_adapter.name, cfb->fb.fix.id,
 		sizeof(cfb->ddc_adapter.name));
@@ -1305,7 +1305,7 @@ static int cyber2000fb_i2c_getscl(void *data)
 	return ret;
 }
 
-static int __devinit cyber2000fb_i2c_register(struct cfb_info *cfb)
+static int cyber2000fb_i2c_register(struct cfb_info *cfb)
 {
 	strlcpy(cfb->i2c_adapter.name, cfb->fb.fix.id,
 		sizeof(cfb->i2c_adapter.name));
@@ -1404,7 +1404,7 @@ static void cyberpro_init_hw(struct cfb_info *cfb)
 	}
 }
 
-static struct cfb_info __devinit *cyberpro_alloc_fb_info(unsigned int id,
+static struct cfb_info *cyberpro_alloc_fb_info(unsigned int id,
 							 char *name)
 {
 	struct cfb_info *cfb;
@@ -1524,7 +1524,7 @@ static int cyber2000fb_setup(char *options)
  *  - memory mapped access to the registers
  *  - initialised mem_ctl1 and mem_ctl2 appropriately.
  */
-static int __devinit cyberpro_common_probe(struct cfb_info *cfb)
+static int cyberpro_common_probe(struct cfb_info *cfb)
 {
 	u_long smem_size;
 	u_int h_sync, v_sync;
@@ -1646,7 +1646,7 @@ static void cyberpro_common_resume(struct cfb_info *cfb)
 
 #include <mach/framebuffer.h>
 
-static int __devinit cyberpro_vl_probe(void)
+static int cyberpro_vl_probe(void)
 {
 	struct cfb_info *cfb;
 	int err = -ENOMEM;
@@ -1780,7 +1780,7 @@ static int cyberpro_pci_enable_mmio(struct cfb_info *cfb)
 	return 0;
 }
 
-static int __devinit
+static int
 cyberpro_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 {
 	struct cfb_info *cfb;
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index b3aaf3b..1face18 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -1230,7 +1230,7 @@ static unsigned int da8xxfb_pixel_clk_period(struct da8xx_fb_par *par)
 	return pix_clk_period_picosec;
 }
 
-static int __devinit fb_probe(struct platform_device *device)
+static int fb_probe(struct platform_device *device)
 {
 	struct da8xx_lcdc_platform_data *fb_pdata =
 						device->dev.platform_data;
diff --git a/drivers/video/dnfb.c b/drivers/video/dnfb.c
index 49e3dda..182b199 100644
--- a/drivers/video/dnfb.c
+++ b/drivers/video/dnfb.c
@@ -224,7 +224,7 @@ void dnfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
  * Initialization
  */
 
-static int __devinit dnfb_probe(struct platform_device *dev)
+static int dnfb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	int err = 0;
diff --git a/drivers/video/ep93xx-fb.c b/drivers/video/ep93xx-fb.c
index 2f08122..ef4ca55 100644
--- a/drivers/video/ep93xx-fb.c
+++ b/drivers/video/ep93xx-fb.c
@@ -484,7 +484,7 @@ static void ep93xxfb_dealloc_videomem(struct fb_info *info)
 				  info->screen_base, info->fix.smem_start);
 }
 
-static int __devinit ep93xxfb_probe(struct platform_device *pdev)
+static int ep93xxfb_probe(struct platform_device *pdev)
 {
 	struct ep93xxfb_mach_info *mach_info = pdev->dev.platform_data;
 	struct fb_info *info;
@@ -627,7 +627,7 @@ static struct platform_driver ep93xxfb_driver = {
 	},
 };
 
-static int __devinit ep93xxfb_init(void)
+static int ep93xxfb_init(void)
 {
 	return platform_driver_register(&ep93xxfb_driver);
 }
diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c
index 07c0453..47f0448 100644
--- a/drivers/video/exynos/exynos_dp_core.c
+++ b/drivers/video/exynos/exynos_dp_core.c
@@ -856,7 +856,7 @@ static irqreturn_t exynos_dp_irq_handler(int irq, void *arg)
 	return IRQ_HANDLED;
 }
 
-static int __devinit exynos_dp_probe(struct platform_device *pdev)
+static int exynos_dp_probe(struct platform_device *pdev)
 {
 	struct resource *res;
 	struct exynos_dp_device *dp;
diff --git a/drivers/video/ffb.c b/drivers/video/ffb.c
index d78dc9a..46aee0e 100644
--- a/drivers/video/ffb.c
+++ b/drivers/video/ffb.c
@@ -893,7 +893,7 @@ static void ffb_init_fix(struct fb_info *info)
 	info->fix.accel = FB_ACCEL_SUN_CREATOR;
 }
 
-static int __devinit ffb_probe(struct platform_device *op)
+static int ffb_probe(struct platform_device *op)
 {
 	struct device_node *dp = op->dev.of_node;
 	struct ffb_fbc __iomem *fbc;
diff --git a/drivers/video/fm2fb.c b/drivers/video/fm2fb.c
index d0533b7..a64c3ef 100644
--- a/drivers/video/fm2fb.c
+++ b/drivers/video/fm2fb.c
@@ -211,7 +211,7 @@ static int fm2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
      *  Initialisation
      */
 
-static int __devinit fm2fb_probe(struct zorro_dev *z,
+static int fm2fb_probe(struct zorro_dev *z,
 				 const struct zorro_device_id *id);
 
 static struct zorro_device_id fm2fb_devices[] __devinitdata = {
@@ -227,7 +227,7 @@ static struct zorro_driver fm2fb_driver = {
 	.probe		= fm2fb_probe,
 };
 
-static int __devinit fm2fb_probe(struct zorro_dev *z,
+static int fm2fb_probe(struct zorro_dev *z,
 				 const struct zorro_device_id *id)
 {
 	struct fb_info *info;
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index ede9e55..6bdf805 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -1244,7 +1244,7 @@ static struct fb_ops fsl_diu_ops = {
 	.fb_release = fsl_diu_release,
 };
 
-static int __devinit install_fb(struct fb_info *info)
+static int install_fb(struct fb_info *info)
 {
 	int rc;
 	struct mfb_info *mfbi = info->par;
@@ -1491,7 +1491,7 @@ static ssize_t show_monitor(struct device *device,
 	return 0;
 }
 
-static int __devinit fsl_diu_probe(struct platform_device *pdev)
+static int fsl_diu_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
 	struct mfb_info *mfbi;
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c
index f19571b..2971511 100644
--- a/drivers/video/gbefb.c
+++ b/drivers/video/gbefb.c
@@ -1098,7 +1098,7 @@ static void gbefb_create_sysfs(struct device *dev)
  * Initialization
  */
 
-static int __devinit gbefb_setup(char *options)
+static int gbefb_setup(char *options)
 {
 	char *this_opt;
 
@@ -1129,7 +1129,7 @@ static int __devinit gbefb_setup(char *options)
 	return 0;
 }
 
-static int __devinit gbefb_probe(struct platform_device *p_dev)
+static int gbefb_probe(struct platform_device *p_dev)
 {
 	int i, ret = 0;
 	struct fb_info *info;
diff --git a/drivers/video/geode/gx1fb_core.c b/drivers/video/geode/gx1fb_core.c
index 094c352..4bdd47f 100644
--- a/drivers/video/geode/gx1fb_core.c
+++ b/drivers/video/geode/gx1fb_core.c
@@ -195,7 +195,7 @@ static int gx1fb_blank(int blank_mode, struct fb_info *info)
 	return par->vid_ops->blank_display(info, blank_mode);
 }
 
-static int __devinit gx1fb_map_video_memory(struct fb_info *info, struct pci_dev *dev)
+static int gx1fb_map_video_memory(struct fb_info *info, struct pci_dev *dev)
 {
 	struct geodefb_par *par = info->par;
 	unsigned gx_base;
@@ -268,7 +268,7 @@ static struct fb_ops gx1fb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-static struct fb_info * __devinit gx1fb_init_fbinfo(struct device *dev)
+static struct fb_info *gx1fb_init_fbinfo(struct device *dev)
 {
 	struct geodefb_par *par;
 	struct fb_info *info;
@@ -318,7 +318,7 @@ static struct fb_info * __devinit gx1fb_init_fbinfo(struct device *dev)
 	return info;
 }
 
-static int __devinit gx1fb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+static int gx1fb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
 	struct geodefb_par *par;
 	struct fb_info *info;
diff --git a/drivers/video/geode/gxfb_core.c b/drivers/video/geode/gxfb_core.c
index b4f19db..d3ad1a0 100644
--- a/drivers/video/geode/gxfb_core.c
+++ b/drivers/video/geode/gxfb_core.c
@@ -117,7 +117,7 @@ static struct fb_videomode gx_dcon_modedb[] __devinitdata = {
 	  FB_VMODE_NONINTERLACED, 0 }
 };
 
-static void __devinit get_modedb(struct fb_videomode **modedb,
+static void get_modedb(struct fb_videomode **modedb,
 		unsigned int *size)
 {
 	if (olpc_has_dcon()) {
@@ -130,7 +130,7 @@ static void __devinit get_modedb(struct fb_videomode **modedb,
 }
 
 #else
-static void __devinit get_modedb(struct fb_videomode **modedb,
+static void get_modedb(struct fb_videomode **modedb,
 		unsigned int *size)
 {
 	*modedb = (struct fb_videomode *) gx_modedb;
@@ -228,7 +228,7 @@ static int gxfb_blank(int blank_mode, struct fb_info *info)
 	return gx_blank_display(info, blank_mode);
 }
 
-static int __devinit gxfb_map_video_memory(struct fb_info *info,
+static int gxfb_map_video_memory(struct fb_info *info,
 		struct pci_dev *dev)
 {
 	struct gxfb_par *par = info->par;
@@ -293,7 +293,7 @@ static struct fb_ops gxfb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-static struct fb_info *__devinit gxfb_init_fbinfo(struct device *dev)
+static struct fb_info *gxfb_init_fbinfo(struct device *dev)
 {
 	struct gxfb_par *par;
 	struct fb_info *info;
@@ -374,7 +374,7 @@ static int gxfb_resume(struct pci_dev *pdev)
 }
 #endif
 
-static int __devinit gxfb_probe(struct pci_dev *pdev,
+static int gxfb_probe(struct pci_dev *pdev,
 		const struct pci_device_id *id)
 {
 	struct gxfb_par *par;
diff --git a/drivers/video/geode/lxfb_core.c b/drivers/video/geode/lxfb_core.c
index 416851c..7428366 100644
--- a/drivers/video/geode/lxfb_core.c
+++ b/drivers/video/geode/lxfb_core.c
@@ -226,7 +226,7 @@ static struct fb_videomode olpc_dcon_modedb[] __devinitdata = {
 	  FB_VMODE_NONINTERLACED, 0 }
 };
 
-static void __devinit get_modedb(struct fb_videomode **modedb,
+static void get_modedb(struct fb_videomode **modedb,
 		unsigned int *size)
 {
 	if (olpc_has_dcon()) {
@@ -239,7 +239,7 @@ static void __devinit get_modedb(struct fb_videomode **modedb,
 }
 
 #else
-static void __devinit get_modedb(struct fb_videomode **modedb,
+static void get_modedb(struct fb_videomode **modedb,
 		unsigned int *size)
 {
 	*modedb = (struct fb_videomode *) geode_modedb;
@@ -336,7 +336,7 @@ static int lxfb_blank(int blank_mode, struct fb_info *info)
 }
 
 
-static int __devinit lxfb_map_video_memory(struct fb_info *info,
+static int lxfb_map_video_memory(struct fb_info *info,
 					struct pci_dev *dev)
 {
 	struct lxfb_par *par = info->par;
@@ -414,7 +414,7 @@ static struct fb_ops lxfb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-static struct fb_info * __devinit lxfb_init_fbinfo(struct device *dev)
+static struct fb_info *lxfb_init_fbinfo(struct device *dev)
 {
 	struct lxfb_par *par;
 	struct fb_info *info;
@@ -498,7 +498,7 @@ static int lxfb_resume(struct pci_dev *pdev)
 #define lxfb_resume NULL
 #endif
 
-static int __devinit lxfb_probe(struct pci_dev *pdev,
+static int lxfb_probe(struct pci_dev *pdev,
 			     const struct pci_device_id *id)
 {
 	struct lxfb_par *par;
diff --git a/drivers/video/grvga.c b/drivers/video/grvga.c
index 3ddf206..bf7ea95 100644
--- a/drivers/video/grvga.c
+++ b/drivers/video/grvga.c
@@ -267,7 +267,7 @@ static struct fb_ops grvga_ops = {
 	.fb_imageblit	= cfb_imageblit
 };
 
-static int __devinit grvga_parse_custom(char *options,
+static int grvga_parse_custom(char *options,
 				     struct fb_var_screeninfo *screendata)
 {
 	char *this_opt;
@@ -329,7 +329,7 @@ static int __devinit grvga_parse_custom(char *options,
 	return 0;
 }
 
-static int __devinit grvga_probe(struct platform_device *dev)
+static int grvga_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	int retval = -ENOMEM;
diff --git a/drivers/video/gxt4500.c b/drivers/video/gxt4500.c
index d4f103e..c0130a4 100644
--- a/drivers/video/gxt4500.c
+++ b/drivers/video/gxt4500.c
@@ -610,7 +610,7 @@ static struct fb_ops gxt4500_ops = {
 };
 
 /* PCI functions */
-static int __devinit gxt4500_probe(struct pci_dev *pdev,
+static int gxt4500_probe(struct pci_dev *pdev,
 				   const struct pci_device_id *ent)
 {
 	int err;
@@ -761,7 +761,7 @@ static struct pci_driver gxt4500_driver = {
 	.remove = gxt4500_remove,
 };
 
-static int __devinit gxt4500_init(void)
+static int gxt4500_init(void)
 {
 #ifndef MODULE
 	if (fb_get_options("gxt4500", &mode_option))
diff --git a/drivers/video/hecubafb.c b/drivers/video/hecubafb.c
index b28a520..f8746a3f 100644
--- a/drivers/video/hecubafb.c
+++ b/drivers/video/hecubafb.c
@@ -211,7 +211,7 @@ static struct fb_deferred_io hecubafb_defio = {
 	.deferred_io	= hecubafb_dpy_deferred_io,
 };
 
-static int __devinit hecubafb_probe(struct platform_device *dev)
+static int hecubafb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	struct hecuba_board *board;
diff --git a/drivers/video/hgafb.c b/drivers/video/hgafb.c
index f8a7036..20bbeb4 100644
--- a/drivers/video/hgafb.c
+++ b/drivers/video/hgafb.c
@@ -276,7 +276,7 @@ static void hga_blank(int blank_mode)
 	spin_unlock_irqrestore(&hga_reg_lock, flags);
 }
 
-static int __devinit hga_card_detect(void)
+static int hga_card_detect(void)
 {
 	int count = 0;
 	void __iomem *p, *q;
@@ -546,7 +546,7 @@ static struct fb_ops hgafb_ops = {
 	 *  Initialization
 	 */
 
-static int __devinit hgafb_probe(struct platform_device *pdev)
+static int hgafb_probe(struct platform_device *pdev)
 {
 	struct fb_info *info;
 
diff --git a/drivers/video/hitfb.c b/drivers/video/hitfb.c
index 4ceb978..20d8a56 100644
--- a/drivers/video/hitfb.c
+++ b/drivers/video/hitfb.c
@@ -324,7 +324,7 @@ static struct fb_ops hitfb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-static int __devinit hitfb_probe(struct platform_device *dev)
+static int hitfb_probe(struct platform_device *dev)
 {
 	unsigned short lcdclor, ldr3, ldvndr;
 	struct fb_info *info;
diff --git a/drivers/video/hpfb.c b/drivers/video/hpfb.c
index 1f15523..aa2abe8 100644
--- a/drivers/video/hpfb.c
+++ b/drivers/video/hpfb.c
@@ -206,7 +206,7 @@ static struct fb_ops hpfb_ops = {
 #define HPFB_FBOMSB	0x5d	/* Frame buffer offset		*/
 #define HPFB_FBOLSB	0x5f
 
-static int __devinit hpfb_init_one(unsigned long phys_base,
+static int hpfb_init_one(unsigned long phys_base,
 				   unsigned long virt_base)
 {
 	unsigned long fboff, fb_width, fb_height, fb_start;
@@ -327,7 +327,7 @@ unmap_screen_base:
 /* 
  * Initialise the framebuffer
  */
-static int __devinit hpfb_dio_probe(struct dio_dev * d, const struct dio_device_id * ent)
+static int hpfb_dio_probe(struct dio_dev * d, const struct dio_device_id * ent)
 {
 	unsigned long paddr, vaddr;
 
diff --git a/drivers/video/i740fb.c b/drivers/video/i740fb.c
index 1d3c8ee..1109617 100644
--- a/drivers/video/i740fb.c
+++ b/drivers/video/i740fb.c
@@ -163,7 +163,7 @@ static int i740fb_ddc_getsda(void *data)
 	return !!(i740inreg(par, XRX, REG_DDC_STATE) & DDC_SDA);
 }
 
-static int __devinit i740fb_setup_ddc_bus(struct fb_info *info)
+static int i740fb_setup_ddc_bus(struct fb_info *info)
 {
 	struct i740fb_par *par = info->par;
 
@@ -1007,7 +1007,7 @@ static struct fb_ops i740fb_ops = {
 
 /* ------------------------------------------------------------------------- */
 
-static int __devinit i740fb_probe(struct pci_dev *dev,
+static int i740fb_probe(struct pci_dev *dev,
 				  const struct pci_device_id *ent)
 {
 	struct fb_info *info;
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
index 5c06781..8c50b96 100644
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -78,7 +78,7 @@ static u32 v_offset_default __devinitdata; /* For 32 MiB Aper size, 8 should be
 static u32 voffset          __devinitdata;
 
 static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor);
-static int  __devinit i810fb_init_pci (struct pci_dev *dev,
+static int  i810fb_init_pci (struct pci_dev *dev,
 				       const struct pci_device_id *entry);
 static void __exit i810fb_remove_pci(struct pci_dev *dev);
 static int i810fb_resume(struct pci_dev *dev);
@@ -1628,7 +1628,7 @@ fail:
  *                  AGP resource allocation                            *
  ***********************************************************************/
   
-static void __devinit i810_fix_pointers(struct i810fb_par *par)
+static void i810_fix_pointers(struct i810fb_par *par)
 {
       	par->fb.physical = par->aperture.physical+(par->fb.offset << 12);
 	par->fb.virtual = par->aperture.virtual+(par->fb.offset << 12);
@@ -1640,7 +1640,7 @@ static void __devinit i810_fix_pointers(struct i810fb_par *par)
 		(par->cursor_heap.offset << 12);
 }
 
-static void __devinit i810_fix_offsets(struct i810fb_par *par)
+static void i810_fix_offsets(struct i810fb_par *par)
 {
 	if (vram + 1 > par->aperture.size >> 20)
 		vram = (par->aperture.size >> 20) - 1;
@@ -1660,7 +1660,7 @@ static void __devinit i810_fix_offsets(struct i810fb_par *par)
 	par->cursor_heap.size = 4096;
 }
 
-static int __devinit i810_alloc_agp_mem(struct fb_info *info)
+static int i810_alloc_agp_mem(struct fb_info *info)
 {
 	struct i810fb_par *par = info->par;
 	int size;
@@ -1723,7 +1723,7 @@ static int __devinit i810_alloc_agp_mem(struct fb_info *info)
  * Sets the user monitor's horizontal and vertical
  * frequency limits
  */
-static void __devinit i810_init_monspecs(struct fb_info *info)
+static void i810_init_monspecs(struct fb_info *info)
 {
 	if (!hsync1)
 		hsync1 = HFMIN;
@@ -1755,7 +1755,7 @@ static void __devinit i810_init_monspecs(struct fb_info *info)
  * @par: pointer to i810fb_par structure
  * @info: pointer to current fb_info structure
  */
-static void __devinit i810_init_defaults(struct i810fb_par *par, 
+static void i810_init_defaults(struct i810fb_par *par,
 				      struct fb_info *info)
 {
 	mutex_init(&par->open_lock);
@@ -1812,7 +1812,7 @@ static void __devinit i810_init_defaults(struct i810fb_par *par,
  * i810_init_device - initialize device
  * @par: pointer to i810fb_par structure
  */
-static void __devinit i810_init_device(struct i810fb_par *par)
+static void i810_init_device(struct i810fb_par *par)
 {
 	u8 reg;
 	u8 __iomem *mmio = par->mmio_start_virtual;
@@ -1833,7 +1833,7 @@ static void __devinit i810_init_device(struct i810fb_par *par)
 
 }
 
-static int __devinit 
+static int
 i810_allocate_pci_resource(struct i810fb_par *par, 
 			   const struct pci_device_id *entry)
 {
@@ -1892,7 +1892,7 @@ i810_allocate_pci_resource(struct i810fb_par *par,
 	return 0;
 }
 
-static void __devinit i810fb_find_init_mode(struct fb_info *info)
+static void i810fb_find_init_mode(struct fb_info *info)
 {
 	struct fb_videomode mode;
 	struct fb_var_screeninfo var;
@@ -1956,7 +1956,7 @@ static void __devinit i810fb_find_init_mode(struct fb_info *info)
 }
 
 #ifndef MODULE
-static int __devinit i810fb_setup(char *options)
+static int i810fb_setup(char *options)
 {
 	char *this_opt, *suffix = NULL;
 
@@ -2007,7 +2007,7 @@ static int __devinit i810fb_setup(char *options)
 }
 #endif
 
-static int __devinit i810fb_init_pci (struct pci_dev *dev, 
+static int i810fb_init_pci (struct pci_dev *dev,
 				   const struct pci_device_id *entry)
 {
 	struct fb_info    *info;
@@ -2136,7 +2136,7 @@ static void __exit i810fb_remove_pci(struct pci_dev *dev)
 }                                                	
 
 #ifndef MODULE
-static int __devinit i810fb_init(void)
+static int i810fb_init(void)
 {
 	char *option = NULL;
 
@@ -2154,7 +2154,7 @@ static int __devinit i810fb_init(void)
 
 #ifdef MODULE
 
-static int __devinit i810fb_init(void)
+static int i810fb_init(void)
 {
 	hsync1 *= 1000;
 	hsync2 *= 1000;
diff --git a/drivers/video/i810/i810_main.h b/drivers/video/i810/i810_main.h
index 51d4f3d4..a25afaa 100644
--- a/drivers/video/i810/i810_main.h
+++ b/drivers/video/i810/i810_main.h
@@ -64,7 +64,7 @@ static inline void flush_cache(void)
 
 #include <asm/mtrr.h>
 
-static inline void __devinit set_mtrr(struct i810fb_par *par)
+static inline void set_mtrr(struct i810fb_par *par)
 {
 	par->mtrr_reg = mtrr_add((u32) par->aperture.physical, 
 		 par->aperture.size, MTRR_TYPE_WRCOMB, 1);
diff --git a/drivers/video/imsttfb.c b/drivers/video/imsttfb.c
index 1bb3934..a7e8477 100644
--- a/drivers/video/imsttfb.c
+++ b/drivers/video/imsttfb.c
@@ -1349,7 +1349,7 @@ static struct fb_ops imsttfb_ops = {
 	.fb_ioctl 	= imsttfb_ioctl,
 };
 
-static void __devinit
+static void
 init_imstt(struct fb_info *info)
 {
 	struct imstt_par *par = info->par;
@@ -1466,7 +1466,7 @@ init_imstt(struct fb_info *info)
 		info->node, info->fix.id, info->fix.smem_len >> 20, tmp);
 }
 
-static int __devinit
+static int
 imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	unsigned long addr, size;
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index 971b5d0..860820c 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -132,7 +132,7 @@
 #include "intelfbhw.h"
 #include "../edid.h"
 
-static void __devinit get_initial_mode(struct intelfb_info *dinfo);
+static void get_initial_mode(struct intelfb_info *dinfo);
 static void update_dinfo(struct intelfb_info *dinfo,
 			 struct fb_var_screeninfo *var);
 static int intelfb_open(struct fb_info *info, int user);
@@ -162,10 +162,10 @@ static int intelfb_sync(struct fb_info *info);
 static int intelfb_ioctl(struct fb_info *info,
 			 unsigned int cmd, unsigned long arg);
 
-static int __devinit intelfb_pci_register(struct pci_dev *pdev,
+static int intelfb_pci_register(struct pci_dev *pdev,
 					  const struct pci_device_id *ent);
 static void __devexit intelfb_pci_unregister(struct pci_dev *pdev);
-static int __devinit intelfb_set_fbinfo(struct intelfb_info *dinfo);
+static int intelfb_set_fbinfo(struct intelfb_info *dinfo);
 
 /*
  * Limiting the class to PCI_CLASS_DISPLAY_VGA prevents function 1 of the
@@ -415,7 +415,7 @@ module_exit(intelfb_exit);
  ***************************************************************/
 
 #ifdef CONFIG_MTRR
-static inline void __devinit set_mtrr(struct intelfb_info *dinfo)
+static inline void set_mtrr(struct intelfb_info *dinfo)
 {
 	dinfo->mtrr_reg = mtrr_add(dinfo->aperture.physical,
 				   dinfo->aperture.size, MTRR_TYPE_WRCOMB, 1);
@@ -497,7 +497,7 @@ static void cleanup(struct intelfb_info *dinfo)
 } while (0)
 
 
-static int __devinit intelfb_pci_register(struct pci_dev *pdev,
+static int intelfb_pci_register(struct pci_dev *pdev,
 					  const struct pci_device_id *ent)
 {
 	struct fb_info *info;
@@ -970,7 +970,7 @@ static __inline__ int var_to_refresh(const struct fb_var_screeninfo *var)
  *                Various intialisation functions              *
  ***************************************************************/
 
-static void __devinit get_initial_mode(struct intelfb_info *dinfo)
+static void get_initial_mode(struct intelfb_info *dinfo)
 {
 	struct fb_var_screeninfo *var;
 	int xtot, ytot;
@@ -1037,7 +1037,7 @@ static void __devinit get_initial_mode(struct intelfb_info *dinfo)
 	}
 }
 
-static int __devinit intelfb_init_var(struct intelfb_info *dinfo)
+static int intelfb_init_var(struct intelfb_info *dinfo)
 {
 	struct fb_var_screeninfo *var;
 	int msrc = 0;
@@ -1118,7 +1118,7 @@ static int __devinit intelfb_init_var(struct intelfb_info *dinfo)
 	return 0;
 }
 
-static int __devinit intelfb_set_fbinfo(struct intelfb_info *dinfo)
+static int intelfb_set_fbinfo(struct intelfb_info *dinfo)
 {
 	struct fb_info *info = dinfo->info;
 
diff --git a/drivers/video/jz4740_fb.c b/drivers/video/jz4740_fb.c
index cb867b6..f5c645a 100644
--- a/drivers/video/jz4740_fb.c
+++ b/drivers/video/jz4740_fb.c
@@ -619,7 +619,7 @@ static struct  fb_ops jzfb_ops = {
 	.fb_setcolreg = jzfb_setcolreg,
 };
 
-static int __devinit jzfb_probe(struct platform_device *pdev)
+static int jzfb_probe(struct platform_device *pdev)
 {
 	int ret;
 	struct jzfb *jzfb;
diff --git a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c
index 2293f6a..2c498d8 100644
--- a/drivers/video/kyro/fbdev.c
+++ b/drivers/video/kyro/fbdev.c
@@ -667,7 +667,7 @@ static struct fb_ops kyrofb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-static int __devinit kyrofb_probe(struct pci_dev *pdev,
+static int kyrofb_probe(struct pci_dev *pdev,
 				  const struct pci_device_id *ent)
 {
 	struct fb_info *info;
diff --git a/drivers/video/leo.c b/drivers/video/leo.c
index 52a8678..8c64c79 100644
--- a/drivers/video/leo.c
+++ b/drivers/video/leo.c
@@ -547,7 +547,7 @@ static void leo_unmap_regs(struct platform_device *op, struct fb_info *info,
 		of_iounmap(&op->resource[0], info->screen_base, 0x800000);
 }
 
-static int __devinit leo_probe(struct platform_device *op)
+static int leo_probe(struct platform_device *op)
 {
 	struct device_node *dp = op->dev.of_node;
 	struct fb_info *info;
diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c b/drivers/video/mb862xx/mb862xxfbdrv.c
index 3025cbb..9f88328 100644
--- a/drivers/video/mb862xx/mb862xxfbdrv.c
+++ b/drivers/video/mb862xx/mb862xxfbdrv.c
@@ -668,7 +668,7 @@ static int mb862xx_gdc_init(struct mb862xxfb_par *par)
 	return 0;
 }
 
-static int __devinit of_platform_mb862xx_probe(struct platform_device *ofdev)
+static int of_platform_mb862xx_probe(struct platform_device *ofdev)
 {
 	struct device_node *np = ofdev->dev.of_node;
 	struct device *dev = &ofdev->dev;
@@ -995,7 +995,7 @@ static struct pci_device_id mb862xx_pci_tbl[] __devinitdata = {
 
 MODULE_DEVICE_TABLE(pci, mb862xx_pci_tbl);
 
-static int __devinit mb862xx_pci_probe(struct pci_dev *pdev,
+static int mb862xx_pci_probe(struct pci_dev *pdev,
 				       const struct pci_device_id *ent)
 {
 	struct mb862xxfb_par *par;
@@ -1178,7 +1178,7 @@ static struct pci_driver mb862xxfb_pci_driver = {
 };
 #endif
 
-static int __devinit mb862xxfb_init(void)
+static int mb862xxfb_init(void)
 {
 	int ret = -ENODEV;
 
diff --git a/drivers/video/mbx/mbxdebugfs.c b/drivers/video/mbx/mbxdebugfs.c
index 12dec76..474f94f 100644
--- a/drivers/video/mbx/mbxdebugfs.c
+++ b/drivers/video/mbx/mbxdebugfs.c
@@ -213,7 +213,7 @@ static const struct file_operations misc_fops = {
 	.llseek = default_llseek,
 };
 
-static void __devinit mbxfb_debugfs_init(struct fb_info *fbi)
+static void mbxfb_debugfs_init(struct fb_info *fbi)
 {
 	struct mbxfb_info *mfbi = fbi->par;
 	struct mbxfb_debugfs_data *dbg;
diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c
index a8ba922..91bf913 100644
--- a/drivers/video/mbx/mbxfb.c
+++ b/drivers/video/mbx/mbxfb.c
@@ -687,7 +687,7 @@ static struct fb_ops mbxfb_ops = {
   Enable external SDRAM controller. Assume that all clocks are active
   by now.
 */
-static void __devinit setup_memc(struct fb_info *fbi)
+static void setup_memc(struct fb_info *fbi)
 {
 	unsigned long tmp;
 	int i;
@@ -747,7 +747,7 @@ static void enable_clocks(struct fb_info *fbi)
 	write_reg_dly(0x00000001, PIXCLKDIV);
 }
 
-static void __devinit setup_graphics(struct fb_info *fbi)
+static void setup_graphics(struct fb_info *fbi)
 {
 	unsigned long gsctrl;
 	unsigned long vscadr;
@@ -781,7 +781,7 @@ static void __devinit setup_graphics(struct fb_info *fbi)
 	write_reg_dly(vscadr, VSCADR);
 }
 
-static void __devinit setup_display(struct fb_info *fbi)
+static void setup_display(struct fb_info *fbi)
 {
 	unsigned long dsctrl = 0;
 
@@ -795,7 +795,7 @@ static void __devinit setup_display(struct fb_info *fbi)
 	write_reg_dly((readl(DSCTRL) | DSCTRL_SYNCGEN_EN), DSCTRL);
 }
 
-static void __devinit enable_controller(struct fb_info *fbi)
+static void enable_controller(struct fb_info *fbi)
 {
 	u32 svctrl, shctrl;
 
@@ -881,7 +881,7 @@ static int mbxfb_resume(struct platform_device *dev)
 
 #define res_size(_r) (((_r)->end - (_r)->start) + 1)
 
-static int __devinit mbxfb_probe(struct platform_device *dev)
+static int mbxfb_probe(struct platform_device *dev)
 {
 	int ret;
 	struct fb_info *fbi;
diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c
index c0c358c..d148067 100644
--- a/drivers/video/metronomefb.c
+++ b/drivers/video/metronomefb.c
@@ -167,7 +167,7 @@ static u16 calc_img_cksum(u16 *start, int length)
 }
 
 /* here we decode the incoming waveform file and populate metromem */
-static int __devinit load_waveform(u8 *mem, size_t size, int m, int t,
+static int load_waveform(u8 *mem, size_t size, int m, int t,
 				struct metronomefb_par *par)
 {
 	int tta;
@@ -338,7 +338,7 @@ static int metronome_display_cmd(struct metronomefb_par *par)
 	return par->board->met_wait_event_intr(par);
 }
 
-static int __devinit metronome_powerup_cmd(struct metronomefb_par *par)
+static int metronome_powerup_cmd(struct metronomefb_par *par)
 {
 	int i;
 	u16 cs;
@@ -367,7 +367,7 @@ static int __devinit metronome_powerup_cmd(struct metronomefb_par *par)
 	return par->board->met_wait_event(par);
 }
 
-static int __devinit metronome_config_cmd(struct metronomefb_par *par)
+static int metronome_config_cmd(struct metronomefb_par *par)
 {
 	/* setup config command
 	we can't immediately set the opcode since the controller
@@ -385,7 +385,7 @@ static int __devinit metronome_config_cmd(struct metronomefb_par *par)
 	return par->board->met_wait_event(par);
 }
 
-static int __devinit metronome_init_cmd(struct metronomefb_par *par)
+static int metronome_init_cmd(struct metronomefb_par *par)
 {
 	int i;
 	u16 cs;
@@ -411,7 +411,7 @@ static int __devinit metronome_init_cmd(struct metronomefb_par *par)
 	return par->board->met_wait_event(par);
 }
 
-static int __devinit metronome_init_regs(struct metronomefb_par *par)
+static int metronome_init_regs(struct metronomefb_par *par)
 {
 	int res;
 
@@ -569,7 +569,7 @@ static struct fb_deferred_io metronomefb_defio = {
 	.deferred_io	= metronomefb_dpy_deferred_io,
 };
 
-static int __devinit metronomefb_probe(struct platform_device *dev)
+static int metronomefb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	struct metronome_board *board;
diff --git a/drivers/video/msm/mddi.c b/drivers/video/msm/mddi.c
index 35ac9e8..88e9f41c 100644
--- a/drivers/video/msm/mddi.c
+++ b/drivers/video/msm/mddi.c
@@ -417,7 +417,7 @@ static void mddi_resume(struct msm_mddi_client_data *cdata)
 	mddi_set_auto_hibernate(&mddi->client_data, 1);
 }
 
-static int __devinit mddi_get_client_caps(struct mddi_info *mddi)
+static int mddi_get_client_caps(struct mddi_info *mddi)
 {
 	int i, j;
 
@@ -619,7 +619,7 @@ uint32_t mddi_remote_read(struct msm_mddi_client_data *cdata, uint32_t reg)
 
 static struct mddi_info mddi_info[2];
 
-static int __devinit mddi_clk_setup(struct platform_device *pdev,
+static int mddi_clk_setup(struct platform_device *pdev,
 				    struct mddi_info *mddi,
 				    unsigned long clk_rate)
 {
@@ -664,7 +664,7 @@ static int __init mddi_rev_data_setup(struct mddi_info *mddi)
 	return 0;
 }
 
-static int __devinit mddi_probe(struct platform_device *pdev)
+static int mddi_probe(struct platform_device *pdev)
 {
 	struct msm_mddi_platform_data *pdata = pdev->dev.platform_data;
 	struct mddi_info *mddi = &mddi_info[pdev->id];
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index ddac96d..be26b36 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -586,7 +586,7 @@ static struct fb_ops mxsfb_ops = {
 	.fb_imageblit = cfb_imageblit,
 };
 
-static int __devinit mxsfb_restore_mode(struct mxsfb_info *host)
+static int mxsfb_restore_mode(struct mxsfb_info *host)
 {
 	struct fb_info *fb_info = &host->fb_info;
 	unsigned line_count;
@@ -677,7 +677,7 @@ static int __devinit mxsfb_restore_mode(struct mxsfb_info *host)
 	return 0;
 }
 
-static int __devinit mxsfb_init_fbinfo(struct mxsfb_info *host)
+static int mxsfb_init_fbinfo(struct mxsfb_info *host)
 {
 	struct fb_info *fb_info = &host->fb_info;
 	struct fb_var_screeninfo *var = &fb_info->var;
@@ -772,7 +772,7 @@ static const struct of_device_id mxsfb_dt_ids[] = {
 };
 MODULE_DEVICE_TABLE(of, mxsfb_dt_ids);
 
-static int __devinit mxsfb_probe(struct platform_device *pdev)
+static int mxsfb_probe(struct platform_device *pdev)
 {
 	const struct of_device_id *of_id =
 			of_match_device(mxsfb_dt_ids, &pdev->dev);
diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
index 15c3bef..4cd9e6d 100644
--- a/drivers/video/neofb.c
+++ b/drivers/video/neofb.c
@@ -1646,7 +1646,7 @@ static struct fb_videomode __devinitdata mode800x480 = {
 	.vmode          = FB_VMODE_NONINTERLACED
 };
 
-static int __devinit neo_map_mmio(struct fb_info *info,
+static int neo_map_mmio(struct fb_info *info,
 				  struct pci_dev *dev)
 {
 	struct neofb_par *par = info->par;
@@ -1707,7 +1707,7 @@ static void neo_unmap_mmio(struct fb_info *info)
 			   info->fix.mmio_len);
 }
 
-static int __devinit neo_map_video(struct fb_info *info,
+static int neo_map_video(struct fb_info *info,
 				   struct pci_dev *dev, int video_len)
 {
 	//unsigned long addr;
@@ -1772,7 +1772,7 @@ static void neo_unmap_video(struct fb_info *info)
 			   info->fix.smem_len);
 }
 
-static int __devinit neo_scan_monitor(struct fb_info *info)
+static int neo_scan_monitor(struct fb_info *info)
 {
 	struct neofb_par *par = info->par;
 	unsigned char type, display;
@@ -1851,7 +1851,7 @@ static int __devinit neo_scan_monitor(struct fb_info *info)
 	return 0;
 }
 
-static int __devinit neo_init_hw(struct fb_info *info)
+static int neo_init_hw(struct fb_info *info)
 {
 	struct neofb_par *par = info->par;
 	int videoRam = 896;
@@ -1939,7 +1939,7 @@ static int __devinit neo_init_hw(struct fb_info *info)
 }
 
 
-static struct fb_info *__devinit neo_alloc_fb_info(struct pci_dev *dev, const struct
+static struct fb_info *neo_alloc_fb_info(struct pci_dev *dev, const struct
 						   pci_device_id *id)
 {
 	struct fb_info *info;
@@ -2038,7 +2038,7 @@ static void neo_free_fb_info(struct fb_info *info)
 
 /* --------------------------------------------------------------------- */
 
-static int __devinit neofb_probe(struct pci_dev *dev,
+static int neofb_probe(struct pci_dev *dev,
 				 const struct pci_device_id *id)
 {
 	struct fb_info *info;
diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c
index 475dfee..32581c7 100644
--- a/drivers/video/nuc900fb.c
+++ b/drivers/video/nuc900fb.c
@@ -387,7 +387,7 @@ static int nuc900fb_init_registers(struct fb_info *info)
  *    The buffer should be a non-cached, non-buffered, memory region
  *    to allow palette and pixel writes without flushing the cache.
  */
-static int __devinit nuc900fb_map_video_memory(struct fb_info *info)
+static int nuc900fb_map_video_memory(struct fb_info *info)
 {
 	struct nuc900fb_info *fbi = info->par;
 	dma_addr_t map_dma;
@@ -499,7 +499,7 @@ static inline void nuc900fb_cpufreq_deregister(struct nuc900fb_info *info)
 
 static char driver_name[] = "nuc900fb";
 
-static int __devinit nuc900fb_probe(struct platform_device *pdev)
+static int nuc900fb_probe(struct platform_device *pdev)
 {
 	struct nuc900fb_info *fbi;
 	struct nuc900fb_display *display;
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c
index 0bbed28..ca8963c 100644
--- a/drivers/video/nvidia/nvidia.c
+++ b/drivers/video/nvidia/nvidia.c
@@ -1105,7 +1105,7 @@ fail:
 #define nvidiafb_resume NULL
 #endif
 
-static int __devinit nvidia_set_fbinfo(struct fb_info *info)
+static int nvidia_set_fbinfo(struct fb_info *info)
 {
 	struct fb_monspecs *specs = &info->monspecs;
 	struct fb_videomode modedb;
@@ -1201,7 +1201,7 @@ static int __devinit nvidia_set_fbinfo(struct fb_info *info)
 	return nvidiafb_check_var(&info->var, info);
 }
 
-static u32 __devinit nvidia_get_chipset(struct fb_info *info)
+static u32 nvidia_get_chipset(struct fb_info *info)
 {
 	struct nvidia_par *par = info->par;
 	u32 id = (par->pci_dev->vendor << 16) | par->pci_dev->device;
@@ -1224,7 +1224,7 @@ static u32 __devinit nvidia_get_chipset(struct fb_info *info)
 	return id;
 }
 
-static u32 __devinit nvidia_get_arch(struct fb_info *info)
+static u32 nvidia_get_arch(struct fb_info *info)
 {
 	struct nvidia_par *par = info->par;
 	u32 arch = 0;
@@ -1276,7 +1276,7 @@ static u32 __devinit nvidia_get_arch(struct fb_info *info)
 	return arch;
 }
 
-static int __devinit nvidiafb_probe(struct pci_dev *pd,
+static int nvidiafb_probe(struct pci_dev *pd,
 				    const struct pci_device_id *ent)
 {
 	struct nvidia_par *par;
@@ -1473,7 +1473,7 @@ static void __devexit nvidiafb_remove(struct pci_dev *pd)
  * ------------------------------------------------------------------------- */
 
 #ifndef MODULE
-static int __devinit nvidiafb_setup(char *options)
+static int nvidiafb_setup(char *options)
 {
 	char *this_opt;
 
@@ -1538,7 +1538,7 @@ static struct pci_driver nvidiafb_driver = {
  *
  * ------------------------------------------------------------------------- */
 
-static int __devinit nvidiafb_init(void)
+static int nvidiafb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
diff --git a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
index bae244f..4ed48af 100644
--- a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
+++ b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
@@ -250,7 +250,7 @@ static void init_lb035q02_panel(struct spi_device *spi)
 	lb035q02_write_reg(spi, 0x3b, 0x0806);
 }
 
-static int __devinit lb035q02_panel_spi_probe(struct spi_device *spi)
+static int lb035q02_panel_spi_probe(struct spi_device *spi)
 {
 	init_lb035q02_panel(spi);
 	return omap_dss_register_driver(&lb035q02_driver);
diff --git a/drivers/video/p9100.c b/drivers/video/p9100.c
index f402a69..62d8339 100644
--- a/drivers/video/p9100.c
+++ b/drivers/video/p9100.c
@@ -249,7 +249,7 @@ static void p9100_init_fix(struct fb_info *info, int linebytes, struct device_no
 	info->fix.accel = FB_ACCEL_SUN_CGTHREE;
 }
 
-static int __devinit p9100_probe(struct platform_device *op)
+static int p9100_probe(struct platform_device *op)
 {
 	struct device_node *dp = op->dev.of_node;
 	struct fb_info *info;
diff --git a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c
index 6694923..f638002 100644
--- a/drivers/video/platinumfb.c
+++ b/drivers/video/platinumfb.c
@@ -313,7 +313,7 @@ static void platinum_set_hardware(struct fb_info_platinum *pinfo)
 /*
  * Set misc info vars for this driver
  */
-static void __devinit platinum_init_info(struct fb_info *info, struct fb_info_platinum *pinfo)
+static void platinum_init_info(struct fb_info *info, struct fb_info_platinum *pinfo)
 {
 	/* Fill fb_info */
 	info->fbops = &platinumfb_ops;
@@ -338,7 +338,7 @@ static void __devinit platinum_init_info(struct fb_info *info, struct fb_info_pl
 }
 
 
-static int __devinit platinum_init_fb(struct fb_info *info)
+static int platinum_init_fb(struct fb_info *info)
 {
 	struct fb_info_platinum *pinfo = info->par;
 	struct fb_var_screeninfo var;
@@ -533,7 +533,7 @@ static int __init platinumfb_setup(char *options)
 #define invalidate_cache(addr)
 #endif
 
-static int __devinit platinumfb_probe(struct platform_device* odev)
+static int platinumfb_probe(struct platform_device* odev)
 {
 	struct device_node	*dp = odev->dev.of_node;
 	struct fb_info		*info;
diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c
index c4f639a..70192ba 100644
--- a/drivers/video/pm2fb.c
+++ b/drivers/video/pm2fb.c
@@ -1515,7 +1515,7 @@ static struct fb_ops pm2fb_ops = {
  * @param	pdev	PCI device.
  * @param	id	PCI device ID.
  */
-static int __devinit pm2fb_probe(struct pci_dev *pdev,
+static int pm2fb_probe(struct pci_dev *pdev,
 				 const struct pci_device_id *id)
 {
 	struct pm2fb_par *default_par;
diff --git a/drivers/video/pm3fb.c b/drivers/video/pm3fb.c
index e9d8e23..1fdae1d 100644
--- a/drivers/video/pm3fb.c
+++ b/drivers/video/pm3fb.c
@@ -1229,7 +1229,7 @@ static struct fb_ops pm3fb_ops = {
 
 /* mmio register are already mapped when this function is called */
 /* the pm3fb_fix.smem_start is also set */
-static unsigned long __devinit pm3fb_size_memory(struct pm3_par *par)
+static unsigned long pm3fb_size_memory(struct pm3_par *par)
 {
 	unsigned long	memsize = 0;
 	unsigned long	tempBypass, i, temp1, temp2;
@@ -1314,7 +1314,7 @@ static unsigned long __devinit pm3fb_size_memory(struct pm3_par *par)
 	return memsize;
 }
 
-static int __devinit pm3fb_probe(struct pci_dev *dev,
+static int pm3fb_probe(struct pci_dev *dev,
 				  const struct pci_device_id *ent)
 {
 	struct fb_info *info;
diff --git a/drivers/video/pmag-ba-fb.c b/drivers/video/pmag-ba-fb.c
index 9b4a60b..e5d2994 100644
--- a/drivers/video/pmag-ba-fb.c
+++ b/drivers/video/pmag-ba-fb.c
@@ -141,7 +141,7 @@ static void __init pmagbafb_erase_cursor(struct fb_info *info)
 }
 
 
-static int __devinit pmagbafb_probe(struct device *dev)
+static int pmagbafb_probe(struct device *dev)
 {
 	struct tc_dev *tdev = to_tc_dev(dev);
 	resource_size_t start, len;
diff --git a/drivers/video/pmagb-b-fb.c b/drivers/video/pmagb-b-fb.c
index 4e7a9c4..e731baf 100644
--- a/drivers/video/pmagb-b-fb.c
+++ b/drivers/video/pmagb-b-fb.c
@@ -147,7 +147,7 @@ static void __init pmagbbfb_erase_cursor(struct fb_info *info)
 /*
  * Set up screen parameters.
  */
-static void __devinit pmagbbfb_screen_setup(struct fb_info *info)
+static void pmagbbfb_screen_setup(struct fb_info *info)
 {
 	struct pmagbbfb_par *par = info->par;
 
@@ -179,7 +179,7 @@ static void __devinit pmagbbfb_screen_setup(struct fb_info *info)
 /*
  * Determine oscillator configuration.
  */
-static void __devinit pmagbbfb_osc_setup(struct fb_info *info)
+static void pmagbbfb_osc_setup(struct fb_info *info)
 {
 	static unsigned int pmagbbfb_freqs[] __devinitdata = {
 		130808, 119843, 104000, 92980, 74370, 72800,
@@ -246,7 +246,7 @@ static void __devinit pmagbbfb_osc_setup(struct fb_info *info)
 };
 
 
-static int __devinit pmagbbfb_probe(struct device *dev)
+static int pmagbbfb_probe(struct device *dev)
 {
 	struct tc_dev *tdev = to_tc_dev(dev);
 	resource_size_t start, len;
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index 0b340d6..536a098 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -965,7 +965,7 @@ static struct fb_fix_screeninfo ps3fb_fix __initdata = {
 	.accel =	FB_ACCEL_NONE,
 };
 
-static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev)
+static int ps3fb_probe(struct ps3_system_bus_device *dev)
 {
 	struct fb_info *info;
 	struct ps3fb_par *par;
diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c
index 69fc2c3..1192343 100644
--- a/drivers/video/pvr2fb.c
+++ b/drivers/video/pvr2fb.c
@@ -763,7 +763,7 @@ out_unmap:
  * in for flexibility anyways. Who knows, maybe someone has tv-out on a
  * PCI-based version of these things ;-)
  */
-static int __devinit pvr2fb_common_init(void)
+static int pvr2fb_common_init(void)
 {
 	struct pvr2fb_par *par = currentpar;
 	unsigned long modememused, rev;
@@ -922,7 +922,7 @@ static void __exit pvr2fb_dc_exit(void)
 #endif /* CONFIG_SH_DREAMCAST */
 
 #ifdef CONFIG_PCI
-static int __devinit pvr2fb_pci_probe(struct pci_dev *pdev,
+static int pvr2fb_pci_probe(struct pci_dev *pdev,
 				      const struct pci_device_id *ent)
 {
 	int ret;
@@ -993,7 +993,7 @@ static void __exit pvr2fb_pci_exit(void)
 }
 #endif /* CONFIG_PCI */
 
-static int __devinit pvr2_get_param(const struct pvr2_params *p, const char *s,
+static int pvr2_get_param(const struct pvr2_params *p, const char *s,
                                    int val, int size)
 {
 	int i;
diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c
index a8fd898..49af862 100644
--- a/drivers/video/pxa168fb.c
+++ b/drivers/video/pxa168fb.c
@@ -560,7 +560,7 @@ static struct fb_ops pxa168fb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-static int __devinit pxa168fb_init_mode(struct fb_info *info,
+static int pxa168fb_init_mode(struct fb_info *info,
 			      struct pxa168fb_mach_info *mi)
 {
 	struct pxa168fb_info *fbi = info->par;
@@ -600,7 +600,7 @@ static int __devinit pxa168fb_init_mode(struct fb_info *info,
 	return ret;
 }
 
-static int __devinit pxa168fb_probe(struct platform_device *pdev)
+static int pxa168fb_probe(struct platform_device *pdev)
 {
 	struct pxa168fb_mach_info *mi;
 	struct fb_info *info = 0;
diff --git a/drivers/video/pxa3xx-gcu.c b/drivers/video/pxa3xx-gcu.c
index 4493a47..f163474 100644
--- a/drivers/video/pxa3xx-gcu.c
+++ b/drivers/video/pxa3xx-gcu.c
@@ -574,7 +574,7 @@ free_buffers(struct platform_device *dev,
 	priv->free = NULL;
 }
 
-static int __devinit
+static int
 pxa3xx_gcu_probe(struct platform_device *dev)
 {
 	int i, ret, irq;
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index ffa62e2..1ff1a16 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -869,7 +869,7 @@ static struct fb_ops overlay_fb_ops = {
 	.fb_set_par		= overlayfb_set_par,
 };
 
-static void __devinit init_pxafb_overlay(struct pxafb_info *fbi,
+static void init_pxafb_overlay(struct pxafb_info *fbi,
 					 struct pxafb_layer *ofb, int id)
 {
 	sprintf(ofb->fb.fix.id, "overlay%d", id + 1);
@@ -903,7 +903,7 @@ static inline int pxafb_overlay_supported(void)
 	return 0;
 }
 
-static int __devinit pxafb_overlay_map_video_memory(struct pxafb_info *pxafb,
+static int pxafb_overlay_map_video_memory(struct pxafb_info *pxafb,
 	struct pxafb_layer *ofb)
 {
 	/* We assume that user will use at most video_mem_size for overlay fb,
@@ -927,7 +927,7 @@ static int __devinit pxafb_overlay_map_video_memory(struct pxafb_info *pxafb,
 	return 0;
 }
 
-static void __devinit pxafb_overlay_init(struct pxafb_info *fbi)
+static void pxafb_overlay_init(struct pxafb_info *fbi)
 {
 	int i, ret;
 
@@ -1706,7 +1706,7 @@ static const struct dev_pm_ops pxafb_pm_ops = {
 };
 #endif
 
-static int __devinit pxafb_init_video_memory(struct pxafb_info *fbi)
+static int pxafb_init_video_memory(struct pxafb_info *fbi)
 {
 	int size = PAGE_ALIGN(fbi->video_mem_size);
 
@@ -1789,7 +1789,7 @@ decode_mode:
 		fbi->video_mem_size = video_mem_size;
 }
 
-static struct pxafb_info * __devinit pxafb_init_fbinfo(struct device *dev)
+static struct pxafb_info *pxafb_init_fbinfo(struct device *dev)
 {
 	struct pxafb_info *fbi;
 	void *addr;
@@ -1853,7 +1853,7 @@ static struct pxafb_info * __devinit pxafb_init_fbinfo(struct device *dev)
 }
 
 #ifdef CONFIG_FB_PXA_PARAMETERS
-static int __devinit parse_opt_mode(struct device *dev, const char *this_opt)
+static int parse_opt_mode(struct device *dev, const char *this_opt)
 {
 	struct pxafb_mach_info *inf = dev->platform_data;
 
@@ -1912,7 +1912,7 @@ done:
 	return 0;
 }
 
-static int __devinit parse_opt(struct device *dev, char *this_opt)
+static int parse_opt(struct device *dev, char *this_opt)
 {
 	struct pxafb_mach_info *inf = dev->platform_data;
 	struct pxafb_mode_info *mode = &inf->modes[0];
@@ -2012,7 +2012,7 @@ static int __devinit parse_opt(struct device *dev, char *this_opt)
 	return 0;
 }
 
-static int __devinit pxafb_parse_options(struct device *dev, char *options)
+static int pxafb_parse_options(struct device *dev, char *options)
 {
 	char *this_opt;
 	int ret;
@@ -2061,7 +2061,7 @@ MODULE_PARM_DESC(options, "LCD parameters (see Documentation/fb/pxafb.txt)");
 #ifdef DEBUG_VAR
 /* Check for various illegal bit-combinations. Currently only
  * a warning is given. */
-static void __devinit pxafb_check_options(struct device *dev,
+static void pxafb_check_options(struct device *dev,
 					  struct pxafb_mach_info *inf)
 {
 	if (inf->lcd_conn)
@@ -2094,7 +2094,7 @@ static void __devinit pxafb_check_options(struct device *dev,
 #define pxafb_check_options(...)	do {} while (0)
 #endif
 
-static int __devinit pxafb_probe(struct platform_device *dev)
+static int pxafb_probe(struct platform_device *dev)
 {
 	struct pxafb_info *fbi;
 	struct pxafb_mach_info *inf;
diff --git a/drivers/video/q40fb.c b/drivers/video/q40fb.c
index a104e8c..d1a7529 100644
--- a/drivers/video/q40fb.c
+++ b/drivers/video/q40fb.c
@@ -83,7 +83,7 @@ static struct fb_ops q40fb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-static int __devinit q40fb_probe(struct platform_device *dev)
+static int q40fb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 693ed5e..49caea2 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -1709,7 +1709,7 @@ static struct fb_ops riva_fb_ops = {
 	.fb_sync 	= rivafb_sync,
 };
 
-static int __devinit riva_set_fbinfo(struct fb_info *info)
+static int riva_set_fbinfo(struct fb_info *info)
 {
 	unsigned int cmap_len;
 	struct riva_par *par = info->par;
@@ -1747,7 +1747,7 @@ static int __devinit riva_set_fbinfo(struct fb_info *info)
 }
 
 #ifdef CONFIG_PPC_OF
-static int __devinit riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
+static int riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
 {
 	struct riva_par *par = info->par;
 	struct device_node *dp;
@@ -1780,7 +1780,7 @@ static int __devinit riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
 #endif /* CONFIG_PPC_OF */
 
 #if defined(CONFIG_FB_RIVA_I2C) && !defined(CONFIG_PPC_OF)
-static int __devinit riva_get_EDID_i2c(struct fb_info *info)
+static int riva_get_EDID_i2c(struct fb_info *info)
 {
 	struct riva_par *par = info->par;
 	struct fb_var_screeninfo var;
@@ -1803,7 +1803,7 @@ static int __devinit riva_get_EDID_i2c(struct fb_info *info)
 }
 #endif /* CONFIG_FB_RIVA_I2C */
 
-static void __devinit riva_update_default_var(struct fb_var_screeninfo *var,
+static void riva_update_default_var(struct fb_var_screeninfo *var,
 					      struct fb_info *info)
 {
 	struct fb_monspecs *specs = &info->monspecs;
@@ -1836,7 +1836,7 @@ static void __devinit riva_update_default_var(struct fb_var_screeninfo *var,
 }
 
 
-static void __devinit riva_get_EDID(struct fb_info *info, struct pci_dev *pdev)
+static void riva_get_EDID(struct fb_info *info, struct pci_dev *pdev)
 {
 	NVTRACE_ENTER();
 #ifdef CONFIG_PPC_OF
@@ -1850,7 +1850,7 @@ static void __devinit riva_get_EDID(struct fb_info *info, struct pci_dev *pdev)
 }
 
 
-static void __devinit riva_get_edidinfo(struct fb_info *info)
+static void riva_get_edidinfo(struct fb_info *info)
 {
 	struct fb_var_screeninfo *var = &rivafb_default_var;
 	struct riva_par *par = info->par;
@@ -1871,7 +1871,7 @@ static void __devinit riva_get_edidinfo(struct fb_info *info)
  *
  * ------------------------------------------------------------------------- */
 
-static u32 __devinit riva_get_arch(struct pci_dev *pd)
+static u32 riva_get_arch(struct pci_dev *pd)
 {
     	u32 arch = 0;
 
@@ -1909,7 +1909,7 @@ static u32 __devinit riva_get_arch(struct pci_dev *pd)
 	return arch;
 }
 
-static int __devinit rivafb_probe(struct pci_dev *pd,
+static int rivafb_probe(struct pci_dev *pd,
 			     	const struct pci_device_id *ent)
 {
 	struct riva_par *default_par;
@@ -2145,7 +2145,7 @@ static void __devexit rivafb_remove(struct pci_dev *pd)
  * ------------------------------------------------------------------------- */
 
 #ifndef MODULE
-static int __devinit rivafb_setup(char *options)
+static int rivafb_setup(char *options)
 {
 	char *this_opt;
 
@@ -2197,7 +2197,7 @@ static struct pci_driver rivafb_driver = {
  *
  * ------------------------------------------------------------------------- */
 
-static int __devinit rivafb_init(void)
+static int rivafb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
diff --git a/drivers/video/riva/rivafb-i2c.c b/drivers/video/riva/rivafb-i2c.c
index 167400e..db78ac8 100644
--- a/drivers/video/riva/rivafb-i2c.c
+++ b/drivers/video/riva/rivafb-i2c.c
@@ -86,7 +86,7 @@ static int riva_gpio_getsda(void* data)
 	return val;
 }
 
-static int __devinit riva_setup_i2c_bus(struct riva_i2c_chan *chan,
+static int riva_setup_i2c_bus(struct riva_i2c_chan *chan,
 					const char *name,
 					unsigned int i2c_class)
 {
@@ -124,7 +124,7 @@ static int __devinit riva_setup_i2c_bus(struct riva_i2c_chan *chan,
 	return rc;
 }
 
-void __devinit riva_create_i2c_busses(struct riva_par *par)
+void riva_create_i2c_busses(struct riva_par *par)
 {
 	par->chan[0].par	= par;
 	par->chan[1].par	= par;
@@ -150,7 +150,7 @@ void riva_delete_i2c_busses(struct riva_par *par)
 	}
 }
 
-int __devinit riva_probe_i2c_connector(struct riva_par *par, int conn, u8 **out_edid)
+int riva_probe_i2c_connector(struct riva_par *par, int conn, u8 **out_edid)
 {
 	u8 *edid = NULL;
 
diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c
index 28b1c6c..f7839e1 100644
--- a/drivers/video/s1d13xxxfb.c
+++ b/drivers/video/s1d13xxxfb.c
@@ -642,7 +642,7 @@ static int s1d13xxxfb_width_tab[2][4] __devinitdata = {
  *	Note: some of the hardcoded values here might need some love to
  *	work on various chips, and might need to no longer be hardcoded.
  */
-static void __devinit
+static void
 s1d13xxxfb_fetch_hw_state(struct fb_info *info)
 {
 	struct fb_var_screeninfo *var = &info->var;
@@ -764,7 +764,7 @@ s1d13xxxfb_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int __devinit
+static int
 s1d13xxxfb_probe(struct platform_device *pdev)
 {
 	struct s1d13xxxfb_par *default_par;
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 71981a5..141fefd 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -1079,7 +1079,7 @@ static void s3c_fb_missing_pixclock(struct fb_videomode *mode)
  *
  * Allocate memory for the given framebuffer.
  */
-static int __devinit s3c_fb_alloc_memory(struct s3c_fb *sfb,
+static int s3c_fb_alloc_memory(struct s3c_fb *sfb,
 					 struct s3c_fb_win *win)
 {
 	struct s3c_fb_pd_win *windata = win->windata;
@@ -1170,7 +1170,7 @@ static void s3c_fb_release_win(struct s3c_fb *sfb, struct s3c_fb_win *win)
  * Allocate and do the basic initialisation for one of the hardware's graphics
  * windows.
  */
-static int __devinit s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
+static int s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
 				      struct s3c_fb_win_variant *variant,
 				      struct s3c_fb_win **res)
 {
@@ -1358,7 +1358,7 @@ static void s3c_fb_clear_win(struct s3c_fb *sfb, int win)
 	}
 }
 
-static int __devinit s3c_fb_probe(struct platform_device *pdev)
+static int s3c_fb_probe(struct platform_device *pdev)
 {
 	const struct platform_device_id *platid;
 	struct s3c_fb_driverdata *fbdrv;
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index fbf3cea..528cec6 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -637,7 +637,7 @@ static struct fb_ops s3c2410fb_ops = {
  *	cache.  Once this area is remapped, all virtual memory
  *	access to the video memory should occur at the new region.
  */
-static int __devinit s3c2410fb_map_video_memory(struct fb_info *info)
+static int s3c2410fb_map_video_memory(struct fb_info *info)
 {
 	struct s3c2410fb_info *fbi = info->par;
 	dma_addr_t map_dma;
@@ -819,7 +819,7 @@ static inline void s3c2410fb_cpufreq_deregister(struct s3c2410fb_info *info)
 
 static const char driver_name[] = "s3c2410fb";
 
-static int __devinit s3c24xxfb_probe(struct platform_device *pdev,
+static int s3c24xxfb_probe(struct platform_device *pdev,
 				  enum s3c_drv_type drv_type)
 {
 	struct s3c2410fb_info *info;
@@ -1010,12 +1010,12 @@ dealloc_fb:
 	return ret;
 }
 
-static int __devinit s3c2410fb_probe(struct platform_device *pdev)
+static int s3c2410fb_probe(struct platform_device *pdev)
 {
 	return s3c24xxfb_probe(pdev, DRV_S3C2410);
 }
 
-static int __devinit s3c2412fb_probe(struct platform_device *pdev)
+static int s3c2412fb_probe(struct platform_device *pdev)
 {
 	return s3c24xxfb_probe(pdev, DRV_S3C2412);
 }
diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c
index 1b4f146..e66ecbb 100644
--- a/drivers/video/s3fb.c
+++ b/drivers/video/s3fb.c
@@ -255,7 +255,7 @@ static int s3fb_ddc_getsda(void *data)
 	return !!(s3fb_ddc_read(par) & DDC_SDA_IN);
 }
 
-static int __devinit s3fb_setup_ddc_bus(struct fb_info *info)
+static int s3fb_setup_ddc_bus(struct fb_info *info)
 {
 	struct s3fb_info *par = info->par;
 
@@ -1066,7 +1066,7 @@ static struct fb_ops s3fb_ops = {
 
 /* ------------------------------------------------------------------------- */
 
-static int __devinit s3_identification(struct s3fb_info *par)
+static int s3_identification(struct s3fb_info *par)
 {
 	int chip = par->chip;
 
@@ -1122,7 +1122,7 @@ static int __devinit s3_identification(struct s3fb_info *par)
 
 /* PCI probe */
 
-static int __devinit s3_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
+static int s3_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 {
 	struct pci_bus_region bus_reg;
 	struct resource vga_res;
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index b632584..5e79fea 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -1090,7 +1090,7 @@ static int sa1100fb_resume(struct platform_device *dev)
  *      cache.  Once this area is remapped, all virtual memory
  *      access to the video memory should occur at the new region.
  */
-static int __devinit sa1100fb_map_video_memory(struct sa1100fb_info *fbi)
+static int sa1100fb_map_video_memory(struct sa1100fb_info *fbi)
 {
 	/*
 	 * We reserve one page for the palette, plus the size
@@ -1124,7 +1124,7 @@ static struct fb_monspecs monspecs __devinitdata = {
 };
 
 
-static struct sa1100fb_info * __devinit sa1100fb_init_fbinfo(struct device *dev)
+static struct sa1100fb_info *sa1100fb_init_fbinfo(struct device *dev)
 {
 	struct sa1100fb_mach_info *inf = dev->platform_data;
 	struct sa1100fb_info *fbi;
@@ -1205,7 +1205,7 @@ static struct sa1100fb_info * __devinit sa1100fb_init_fbinfo(struct device *dev)
 	return fbi;
 }
 
-static int __devinit sa1100fb_probe(struct platform_device *pdev)
+static int sa1100fb_probe(struct platform_device *pdev)
 {
 	struct sa1100fb_info *fbi;
 	struct resource *res;
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index a1cc484..dbf8d62 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -1715,7 +1715,7 @@ static void savage_disable_mmio(struct savagefb_par *par)
 }
 
 
-static int __devinit savage_map_mmio(struct fb_info *info)
+static int savage_map_mmio(struct fb_info *info)
 {
 	struct savagefb_par *par = info->par;
 	DBG("savage_map_mmio");
@@ -1761,7 +1761,7 @@ static void savage_unmap_mmio(struct fb_info *info)
 	}
 }
 
-static int __devinit savage_map_video(struct fb_info *info,
+static int savage_map_video(struct fb_info *info,
 				      int video_len)
 {
 	struct savagefb_par *par = info->par;
@@ -2052,7 +2052,7 @@ static int savage_init_hw(struct savagefb_par *par)
 	return videoRambytes;
 }
 
-static int __devinit savage_init_fb_info(struct fb_info *info,
+static int savage_init_fb_info(struct fb_info *info,
 					 struct pci_dev *dev,
 					 const struct pci_device_id *id)
 {
@@ -2178,7 +2178,7 @@ static int __devinit savage_init_fb_info(struct fb_info *info,
 
 /* --------------------------------------------------------------------- */
 
-static int __devinit savagefb_probe(struct pci_dev* dev,
+static int savagefb_probe(struct pci_dev* dev,
 				    const struct pci_device_id* id)
 {
 	struct fb_info *info;
diff --git a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c
index b5c30b9..c65ab22 100644
--- a/drivers/video/sgivwfb.c
+++ b/drivers/video/sgivwfb.c
@@ -745,7 +745,7 @@ int __init sgivwfb_setup(char *options)
 /*
  *  Initialisation
  */
-static int __devinit sgivwfb_probe(struct platform_device *dev)
+static int sgivwfb_probe(struct platform_device *dev)
 {
 	struct sgivw_par *par;
 	struct fb_info *info;
diff --git a/drivers/video/sh7760fb.c b/drivers/video/sh7760fb.c
index ff93339..0ad44d1 100644
--- a/drivers/video/sh7760fb.c
+++ b/drivers/video/sh7760fb.c
@@ -431,7 +431,7 @@ static int sh7760fb_alloc_mem(struct fb_info *info)
 	return 0;
 }
 
-static int __devinit sh7760fb_probe(struct platform_device *pdev)
+static int sh7760fb_probe(struct platform_device *pdev)
 {
 	struct fb_info *info;
 	struct resource *res;
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index 699487c..d776bfe 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -1639,7 +1639,7 @@ sh_mobile_lcdc_overlay_fb_unregister(struct sh_mobile_lcdc_overlay *ovl)
 	unregister_framebuffer(ovl->info);
 }
 
-static int __devinit
+static int
 sh_mobile_lcdc_overlay_fb_register(struct sh_mobile_lcdc_overlay *ovl)
 {
 	struct sh_mobile_lcdc_priv *lcdc = ovl->channel->lcdc;
@@ -1678,7 +1678,7 @@ sh_mobile_lcdc_overlay_fb_cleanup(struct sh_mobile_lcdc_overlay *ovl)
 	framebuffer_release(info);
 }
 
-static int __devinit
+static int
 sh_mobile_lcdc_overlay_fb_init(struct sh_mobile_lcdc_overlay *ovl)
 {
 	struct sh_mobile_lcdc_priv *priv = ovl->channel->lcdc;
@@ -2117,7 +2117,7 @@ sh_mobile_lcdc_channel_fb_unregister(struct sh_mobile_lcdc_chan *ch)
 		unregister_framebuffer(ch->info);
 }
 
-static int __devinit
+static int
 sh_mobile_lcdc_channel_fb_register(struct sh_mobile_lcdc_chan *ch)
 {
 	struct fb_info *info = ch->info;
@@ -2165,7 +2165,7 @@ sh_mobile_lcdc_channel_fb_cleanup(struct sh_mobile_lcdc_chan *ch)
 	framebuffer_release(info);
 }
 
-static int __devinit
+static int
 sh_mobile_lcdc_channel_fb_init(struct sh_mobile_lcdc_chan *ch,
 			       const struct fb_videomode *mode,
 			       unsigned int num_modes)
@@ -2475,7 +2475,7 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int __devinit sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *ch)
+static int sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *ch)
 {
 	int interface_type = ch->cfg->interface_type;
 
@@ -2515,7 +2515,7 @@ static int __devinit sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *
 	return 0;
 }
 
-static int __devinit
+static int
 sh_mobile_lcdc_overlay_init(struct sh_mobile_lcdc_priv *priv,
 			  struct sh_mobile_lcdc_overlay *ovl)
 {
@@ -2570,7 +2570,7 @@ sh_mobile_lcdc_overlay_init(struct sh_mobile_lcdc_priv *priv,
 	return 0;
 }
 
-static int __devinit
+static int
 sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
 			    struct sh_mobile_lcdc_chan *ch)
 {
@@ -2675,7 +2675,7 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
 	return sh_mobile_lcdc_channel_fb_init(ch, mode, num_modes);
 }
 
-static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
+static int sh_mobile_lcdc_probe(struct platform_device *pdev)
 {
 	struct sh_mobile_lcdc_info *pdata = pdev->dev.platform_data;
 	struct sh_mobile_lcdc_priv *priv;
diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
index 7a0ba8b..e0f0985 100644
--- a/drivers/video/sh_mobile_meram.c
+++ b/drivers/video/sh_mobile_meram.c
@@ -620,7 +620,7 @@ static UNIVERSAL_DEV_PM_OPS(sh_mobile_meram_dev_pm_ops,
  * Probe/remove and driver init/exit
  */
 
-static int __devinit sh_mobile_meram_probe(struct platform_device *pdev)
+static int sh_mobile_meram_probe(struct platform_device *pdev)
 {
 	struct sh_mobile_meram_priv *priv;
 	struct sh_mobile_meram_info *pdata = pdev->dev.platform_data;
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
index 5193138..820a002 100644
--- a/drivers/video/sis/sis_main.c
+++ b/drivers/video/sis/sis_main.c
@@ -106,7 +106,7 @@ sisfb_setdefaultparms(void)
 
 /* ------------- Parameter parsing -------------- */
 
-static void __devinit
+static void
 sisfb_search_vesamode(unsigned int vesamode, bool quiet)
 {
 	int i = 0, j = 0;
@@ -146,7 +146,7 @@ sisfb_search_vesamode(unsigned int vesamode, bool quiet)
 		printk(KERN_ERR "sisfb: Invalid VESA mode 0x%x'\n", vesamode);
 }
 
-static void __devinit
+static void
 sisfb_search_mode(char *name, bool quiet)
 {
 	unsigned int j = 0, xres = 0, yres = 0, depth = 0, rate = 0;
@@ -225,7 +225,7 @@ sisfb_search_mode(char *name, bool quiet)
 }
 
 #ifndef MODULE
-static void __devinit
+static void
 sisfb_get_vga_mode_from_kernel(void)
 {
 #ifdef CONFIG_X86
@@ -345,7 +345,7 @@ sisfb_search_specialtiming(const char *name)
 
 /* ----------- Various detection routines ----------- */
 
-static void __devinit
+static void
 sisfb_detect_custom_timing(struct sis_video_info *ivideo)
 {
 	unsigned char *biosver = NULL;
@@ -403,7 +403,7 @@ sisfb_detect_custom_timing(struct sis_video_info *ivideo)
 	} while(mycustomttable[i].chipID);
 }
 
-static bool __devinit
+static bool
 sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
 {
 	int i, j, xres, yres, refresh, index;
@@ -505,7 +505,7 @@ sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
 	return monitor->datavalid;
 }
 
-static void __devinit
+static void
 sisfb_handle_ddc(struct sis_video_info *ivideo, struct sisfb_monitor *monitor, int crtno)
 {
 	unsigned short temp, i, realcrtno = crtno;
@@ -1898,8 +1898,7 @@ static struct fb_ops sisfb_ops = {
 
 /* ---------------- Chip generation dependent routines ---------------- */
 
-static struct pci_dev * __devinit
-sisfb_get_northbridge(int basechipid)
+static struct pci_dev *sisfb_get_northbridge(int basechipid)
 {
 	struct pci_dev *pdev = NULL;
 	int nbridgenum, nbridgeidx, i;
@@ -1938,7 +1937,7 @@ sisfb_get_northbridge(int basechipid)
 	return pdev;
 }
 
-static int __devinit
+static int
 sisfb_get_dram_size(struct sis_video_info *ivideo)
 {
 #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315)
@@ -2038,7 +2037,7 @@ sisfb_get_dram_size(struct sis_video_info *ivideo)
 
 /* -------------- video bridge device detection --------------- */
 
-static void __devinit
+static void
 sisfb_detect_VB_connect(struct sis_video_info *ivideo)
 {
 	u8 cr32, temp;
@@ -2164,7 +2163,7 @@ sisfb_detect_VB_connect(struct sis_video_info *ivideo)
 
 /* ------------------ Sensing routines ------------------ */
 
-static bool __devinit
+static bool
 sisfb_test_DDC1(struct sis_video_info *ivideo)
 {
     unsigned short old;
@@ -2177,7 +2176,7 @@ sisfb_test_DDC1(struct sis_video_info *ivideo)
     return (count != -1);
 }
 
-static void __devinit
+static void
 sisfb_sense_crt1(struct sis_video_info *ivideo)
 {
     bool mustwait = false;
@@ -2259,7 +2258,7 @@ sisfb_sense_crt1(struct sis_video_info *ivideo)
 }
 
 /* Determine and detect attached devices on SiS30x */
-static void __devinit
+static void
 SiS_SenseLCD(struct sis_video_info *ivideo)
 {
 	unsigned char buffer[256];
@@ -2347,7 +2346,7 @@ SiS_SenseLCD(struct sis_video_info *ivideo)
 	ivideo->SiS_Pr.PanelSelfDetected = true;
 }
 
-static int __devinit
+static int
 SISDoSense(struct sis_video_info *ivideo, u16 type, u16 test)
 {
     int temp, mytest, result, i, j;
@@ -2377,7 +2376,7 @@ SISDoSense(struct sis_video_info *ivideo, u16 type, u16 test)
     return result;
 }
 
-static void __devinit
+static void
 SiS_Sense30x(struct sis_video_info *ivideo)
 {
     u8  backupP4_0d,backupP2_00,backupP2_4d,backupSR_1e,biosflag=0;
@@ -2518,7 +2517,7 @@ SiS_Sense30x(struct sis_video_info *ivideo)
 }
 
 /* Determine and detect attached TV's on Chrontel */
-static void __devinit
+static void
 SiS_SenseCh(struct sis_video_info *ivideo)
 {
 #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315)
@@ -2643,7 +2642,7 @@ SiS_SenseCh(struct sis_video_info *ivideo)
     }
 }
 
-static void __devinit
+static void
 sisfb_get_VB_type(struct sis_video_info *ivideo)
 {
 	char stdstr[]    = "sisfb: Detected";
@@ -2906,7 +2905,7 @@ sisfb_engine_init(struct sis_video_info *ivideo)
 	ivideo->engineok = 1;
 }
 
-static void __devinit
+static void
 sisfb_detect_lcd_type(struct sis_video_info *ivideo)
 {
 	u8 reg;
@@ -2962,7 +2961,7 @@ sisfb_detect_lcd_type(struct sis_video_info *ivideo)
 			ivideo->lcdxres, ivideo->lcdyres);
 }
 
-static void __devinit
+static void
 sisfb_save_pdc_emi(struct sis_video_info *ivideo)
 {
 #ifdef CONFIG_FB_SIS_300
@@ -3081,7 +3080,7 @@ sisfb_save_pdc_emi(struct sis_video_info *ivideo)
 
 /* -------------------- Memory manager routines ---------------------- */
 
-static u32 __devinit
+static u32
 sisfb_getheapstart(struct sis_video_info *ivideo)
 {
 	u32 ret = ivideo->sisfb_parm_mem * 1024;
@@ -3128,7 +3127,7 @@ sisfb_getheapstart(struct sis_video_info *ivideo)
 	return ret;
 }
 
-static u32 __devinit
+static u32
 sisfb_getheapsize(struct sis_video_info *ivideo)
 {
 	u32 max = ivideo->video_size - ivideo->hwcursor_size - ivideo->cmdQueueSize;
@@ -3154,7 +3153,7 @@ sisfb_getheapsize(struct sis_video_info *ivideo)
 	return ret;
 }
 
-static int __devinit
+static int
 sisfb_heap_init(struct sis_video_info *ivideo)
 {
 	struct SIS_OH *poh;
@@ -4061,7 +4060,7 @@ static int __init sisfb_setup(char *options)
 }
 #endif
 
-static int __devinit
+static int
 sisfb_check_rom(void __iomem *rom_base, struct sis_video_info *ivideo)
 {
 	void __iomem *rom;
@@ -4089,8 +4088,7 @@ sisfb_check_rom(void __iomem *rom_base, struct sis_video_info *ivideo)
 	return 1;
 }
 
-static unsigned char * __devinit
-sisfb_find_rom(struct pci_dev *pdev)
+static unsigned char *sisfb_find_rom(struct pci_dev *pdev)
 {
 	struct sis_video_info *ivideo = pci_get_drvdata(pdev);
 	void __iomem *rom_base;
@@ -4149,7 +4147,7 @@ sisfb_find_rom(struct pci_dev *pdev)
 	return myrombase;
 }
 
-static void __devinit
+static void
 sisfb_post_map_vram(struct sis_video_info *ivideo, unsigned int *mapsize,
 			unsigned int min)
 {
@@ -4176,7 +4174,7 @@ sisfb_post_map_vram(struct sis_video_info *ivideo, unsigned int *mapsize,
 }
 
 #ifdef CONFIG_FB_SIS_300
-static int __devinit
+static int
 sisfb_post_300_buswidth(struct sis_video_info *ivideo)
 {
 	void __iomem *FBAddress = ivideo->video_vbase;
@@ -4242,7 +4240,7 @@ static const unsigned short __devinitconst SiS_DRAMType[17][5] = {
 	{0x09,0x08,0x01,0x01,0x00}
 };
 
-static int __devinit
+static int
 sisfb_post_300_rwtest(struct sis_video_info *ivideo, int iteration, int buswidth,
 			int PseudoRankCapacity, int PseudoAdrPinCount,
 			unsigned int mapsize)
@@ -4309,7 +4307,7 @@ sisfb_post_300_rwtest(struct sis_video_info *ivideo, int iteration, int buswidth
 	return 0;
 }
 
-static void __devinit
+static void
 sisfb_post_300_ramsize(struct pci_dev *pdev, unsigned int mapsize)
 {
 	struct	sis_video_info *ivideo = pci_get_drvdata(pdev);
@@ -4335,7 +4333,7 @@ sisfb_post_300_ramsize(struct pci_dev *pdev, unsigned int mapsize)
 	}
 }
 
-static void __devinit
+static void
 sisfb_post_sis300(struct pci_dev *pdev)
 {
 	struct sis_video_info *ivideo = pci_get_drvdata(pdev);
@@ -4547,7 +4545,7 @@ sisfb_post_sis300(struct pci_dev *pdev)
 
 #ifdef CONFIG_FB_SIS_315
 #if 0
-static void __devinit
+static void
 sisfb_post_sis315330(struct pci_dev *pdev)
 {
 	/* TODO */
@@ -4559,7 +4557,7 @@ static inline int sisfb_xgi_is21(struct sis_video_info *ivideo)
 	return ivideo->chip_real_id == XGI_21;
 }
 
-static void __devinit
+static void
 sisfb_post_xgi_delay(struct sis_video_info *ivideo, int delay)
 {
 	unsigned int i;
@@ -4571,7 +4569,7 @@ sisfb_post_xgi_delay(struct sis_video_info *ivideo, int delay)
 	}
 }
 
-static int __devinit
+static int
 sisfb_find_host_bridge(struct sis_video_info *ivideo, struct pci_dev *mypdev,
 				unsigned short pcivendor)
 {
@@ -4591,7 +4589,7 @@ sisfb_find_host_bridge(struct sis_video_info *ivideo, struct pci_dev *mypdev,
 	return ret;
 }
 
-static int __devinit
+static int
 sisfb_post_xgi_rwtest(struct sis_video_info *ivideo, int starta,
 			unsigned int enda, unsigned int mapsize)
 {
@@ -4623,7 +4621,7 @@ sisfb_post_xgi_rwtest(struct sis_video_info *ivideo, int starta,
 	return 1;
 }
 
-static int __devinit
+static int
 sisfb_post_xgi_ramsize(struct sis_video_info *ivideo)
 {
 	unsigned int buswidth, ranksize, channelab, mapsize;
@@ -4876,7 +4874,7 @@ bail_out:
 	return status;
 }
 
-static void __devinit
+static void
 sisfb_post_xgi_setclocks(struct sis_video_info *ivideo, u8 regb)
 {
 	u8 v1, v2, v3;
@@ -4932,7 +4930,7 @@ sisfb_post_xgi_setclocks(struct sis_video_info *ivideo, u8 regb)
 	sisfb_post_xgi_delay(ivideo, 0x43);
 }
 
-static void __devinit
+static void
 sisfb_post_xgi_ddr2_mrs_default(struct sis_video_info *ivideo, u8 regb)
 {
 	unsigned char *bios = ivideo->bios_abase;
@@ -4973,7 +4971,7 @@ sisfb_post_xgi_ddr2_mrs_default(struct sis_video_info *ivideo, u8 regb)
 	sisfb_post_xgi_delay(ivideo, 1);
 }
 
-static void __devinit
+static void
 sisfb_post_xgi_ddr2_mrs_xg21(struct sis_video_info *ivideo)
 {
 	sisfb_post_xgi_setclocks(ivideo, 1);
@@ -5015,7 +5013,7 @@ sisfb_post_xgi_ddr2_mrs_xg21(struct sis_video_info *ivideo)
 	sisfb_post_xgi_delay(ivideo, 1);
 }
 
-static void __devinit
+static void
 sisfb_post_xgi_ddr2(struct sis_video_info *ivideo, u8 regb)
 {
 	unsigned char *bios = ivideo->bios_abase;
@@ -5061,7 +5059,7 @@ sisfb_post_xgi_ddr2(struct sis_video_info *ivideo, u8 regb)
 		sisfb_post_xgi_ddr2_mrs_default(ivideo, regb);
 }
 
-static u8 __devinit
+static u8
 sisfb_post_xgi_ramtype(struct sis_video_info *ivideo)
 {
 	unsigned char *bios = ivideo->bios_abase;
@@ -5101,7 +5099,7 @@ sisfb_post_xgi_ramtype(struct sis_video_info *ivideo)
 	return ramtype;
 }
 
-static int __devinit
+static int
 sisfb_post_xgi(struct pci_dev *pdev)
 {
 	struct sis_video_info *ivideo = pci_get_drvdata(pdev);
@@ -5839,7 +5837,7 @@ sisfb_post_xgi(struct pci_dev *pdev)
 }
 #endif
 
-static int __devinit
+static int
 sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	struct sisfb_chip_info	*chipinfo = &sisfb_chip_info[ent->driver_data];
diff --git a/drivers/video/skeletonfb.c b/drivers/video/skeletonfb.c
index ce61d9d..28a38ba 100644
--- a/drivers/video/skeletonfb.c
+++ b/drivers/video/skeletonfb.c
@@ -678,7 +678,7 @@ static struct fb_ops xxxfb_ops = {
      */
 
 /* static int __init xxfb_probe (struct platform_device *pdev) -- for platform devs */
-static int __devinit xxxfb_probe(struct pci_dev *dev,
+static int xxxfb_probe(struct pci_dev *dev,
 			      const struct pci_device_id *ent)
 {
     struct fb_info *info;
diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c
index 3690eff..6703712 100644
--- a/drivers/video/sm501fb.c
+++ b/drivers/video/sm501fb.c
@@ -1664,7 +1664,7 @@ static void sm501fb_stop(struct sm501fb_info *info)
 			   resource_size(info->regs_res));
 }
 
-static int __devinit sm501fb_init_fb(struct fb_info *fb,
+static int sm501fb_init_fb(struct fb_info *fb,
 			   enum sm501_controller head,
 			   const char *fbname)
 {
@@ -1850,7 +1850,7 @@ static struct sm501_platdata_fb sm501fb_def_pdata = {
 static char driver_name_crt[] = "sm501fb-crt";
 static char driver_name_pnl[] = "sm501fb-panel";
 
-static int __devinit sm501fb_probe_one(struct sm501fb_info *info,
+static int sm501fb_probe_one(struct sm501fb_info *info,
 				       enum sm501_controller head)
 {
 	unsigned char *name = (head == HEAD_CRT) ? "crt" : "panel";
@@ -1892,7 +1892,7 @@ static void sm501_free_init_fb(struct sm501fb_info *info,
 	fb_dealloc_cmap(&fbi->cmap);
 }
 
-static int __devinit sm501fb_start_one(struct sm501fb_info *info,
+static int sm501fb_start_one(struct sm501fb_info *info,
 				       enum sm501_controller head,
 				       const char *drvname)
 {
@@ -1922,7 +1922,7 @@ static int __devinit sm501fb_start_one(struct sm501fb_info *info,
 	return 0;
 }
 
-static int __devinit sm501fb_probe(struct platform_device *pdev)
+static int sm501fb_probe(struct platform_device *pdev)
 {
 	struct sm501fb_info *info;
 	struct device *dev = &pdev->dev;
diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c
index 871e074..c4ce3ef 100644
--- a/drivers/video/sstfb.c
+++ b/drivers/video/sstfb.c
@@ -822,7 +822,7 @@ static void sstfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
 /* 
  * get lfb size 
  */
-static int __devinit sst_get_memsize(struct fb_info *info, __u32 *memsize)
+static int sst_get_memsize(struct fb_info *info, __u32 *memsize)
 {
 	u8 __iomem *fbbase_virt = info->screen_base;
 
@@ -865,7 +865,7 @@ static int __devinit sst_get_memsize(struct fb_info *info, __u32 *memsize)
 /* fbi should be idle, and fifo emty and mem disabled */
 /* supposed to detect AT&T ATT20C409 and Ti TVP3409 ramdacs */
 
-static int __devinit sst_detect_att(struct fb_info *info)
+static int sst_detect_att(struct fb_info *info)
 {
 	struct sstfb_par *par = info->par;
 	int i, mir, dir;
@@ -890,7 +890,7 @@ static int __devinit sst_detect_att(struct fb_info *info)
 	return 0;
 }
 
-static int __devinit sst_detect_ti(struct fb_info *info)
+static int sst_detect_ti(struct fb_info *info)
 {
 	struct sstfb_par *par = info->par;
 	int i, mir, dir;
@@ -926,7 +926,7 @@ static int __devinit sst_detect_ti(struct fb_info *info)
  * touched...
  * is it really safe ? how can i reset this ramdac ? geee...
  */
-static int __devinit sst_detect_ics(struct fb_info *info)
+static int sst_detect_ics(struct fb_info *info)
 {
 	struct sstfb_par *par = info->par;
 	int m_clk0_1, m_clk0_7, m_clk1_b;
@@ -1121,7 +1121,7 @@ static struct dac_switch dacs[] __devinitdata = {
 		.set_vidmod	= sst_set_vidmod_ics },
 };
 
-static int __devinit sst_detect_dactype(struct fb_info *info, struct sstfb_par *par)
+static int sst_detect_dactype(struct fb_info *info, struct sstfb_par *par)
 {
 	int i, ret = 0;
 
@@ -1140,7 +1140,7 @@ static int __devinit sst_detect_dactype(struct fb_info *info, struct sstfb_par *
 /*
  * Internal Routines
  */
-static int __devinit sst_init(struct fb_info *info, struct sstfb_par *par)
+static int sst_init(struct fb_info *info, struct sstfb_par *par)
 {
 	u32 fbiinit0, fbiinit1, fbiinit4;
 	struct pci_dev *dev = par->dev;
@@ -1271,7 +1271,7 @@ static void  __devexit sst_shutdown(struct fb_info *info)
 /*
  * Interface to the world
  */
-static int  __devinit sstfb_setup(char *options)
+static int  sstfb_setup(char *options)
 {
 	char *this_opt;
 
@@ -1317,7 +1317,7 @@ static struct fb_ops sstfb_ops = {
 	.fb_ioctl	= sstfb_ioctl,
 };
 
-static int __devinit sstfb_probe(struct pci_dev *pdev,
+static int sstfb_probe(struct pci_dev *pdev,
 			const struct pci_device_id *id)
 {
 	struct fb_info *info;
@@ -1494,7 +1494,7 @@ static struct pci_driver sstfb_driver = {
 };
 
 
-static int __devinit sstfb_init(void)
+static int sstfb_init(void)
 {
 	char *option = NULL;
 
diff --git a/drivers/video/sunxvr1000.c b/drivers/video/sunxvr1000.c
index cc9bf5f..9e86e3c 100644
--- a/drivers/video/sunxvr1000.c
+++ b/drivers/video/sunxvr1000.c
@@ -25,7 +25,7 @@ struct gfb_info {
 	u32			pseudo_palette[16];
 };
 
-static int __devinit gfb_get_props(struct gfb_info *gp)
+static int gfb_get_props(struct gfb_info *gp)
 {
 	gp->width = of_getintprop_default(gp->of_node, "width", 0);
 	gp->height = of_getintprop_default(gp->of_node, "height", 0);
@@ -66,7 +66,7 @@ static struct fb_ops gfb_ops = {
 	.fb_imageblit		= cfb_imageblit,
 };
 
-static int __devinit gfb_set_fbinfo(struct gfb_info *gp)
+static int gfb_set_fbinfo(struct gfb_info *gp)
 {
 	struct fb_info *info = gp->info;
 	struct fb_var_screeninfo *var = &info->var;
@@ -111,7 +111,7 @@ static int __devinit gfb_set_fbinfo(struct gfb_info *gp)
         return 0;
 }
 
-static int __devinit gfb_probe(struct platform_device *op)
+static int gfb_probe(struct platform_device *op)
 {
 	struct device_node *dp = op->dev.of_node;
 	struct fb_info *info;
diff --git a/drivers/video/sunxvr2500.c b/drivers/video/sunxvr2500.c
index 49bd77a..b6a14d2 100644
--- a/drivers/video/sunxvr2500.c
+++ b/drivers/video/sunxvr2500.c
@@ -29,7 +29,7 @@ struct s3d_info {
 	u32			pseudo_palette[16];
 };
 
-static int __devinit s3d_get_props(struct s3d_info *sp)
+static int s3d_get_props(struct s3d_info *sp)
 {
 	sp->width = of_getintprop_default(sp->of_node, "width", 0);
 	sp->height = of_getintprop_default(sp->of_node, "height", 0);
@@ -70,7 +70,7 @@ static struct fb_ops s3d_ops = {
 	.fb_imageblit		= cfb_imageblit,
 };
 
-static int __devinit s3d_set_fbinfo(struct s3d_info *sp)
+static int s3d_set_fbinfo(struct s3d_info *sp)
 {
 	struct fb_info *info = sp->info;
 	struct fb_var_screeninfo *var = &info->var;
@@ -115,7 +115,7 @@ static int __devinit s3d_set_fbinfo(struct s3d_info *sp)
         return 0;
 }
 
-static int __devinit s3d_pci_register(struct pci_dev *pdev,
+static int s3d_pci_register(struct pci_dev *pdev,
 				      const struct pci_device_id *ent)
 {
 	struct fb_info *info;
diff --git a/drivers/video/sunxvr500.c b/drivers/video/sunxvr500.c
index e94c799..afcdab1 100644
--- a/drivers/video/sunxvr500.c
+++ b/drivers/video/sunxvr500.c
@@ -51,7 +51,7 @@ struct e3d_info {
 	u32			pseudo_palette[16];
 };
 
-static int __devinit e3d_get_props(struct e3d_info *ep)
+static int e3d_get_props(struct e3d_info *ep)
 {
 	ep->width = of_getintprop_default(ep->of_node, "width", 0);
 	ep->height = of_getintprop_default(ep->of_node, "height", 0);
@@ -193,7 +193,7 @@ static struct fb_ops e3d_ops = {
 	.fb_imageblit		= e3d_imageblit,
 };
 
-static int __devinit e3d_set_fbinfo(struct e3d_info *ep)
+static int e3d_set_fbinfo(struct e3d_info *ep)
 {
 	struct fb_info *info = ep->info;
 	struct fb_var_screeninfo *var = &info->var;
@@ -238,7 +238,7 @@ static int __devinit e3d_set_fbinfo(struct e3d_info *ep)
         return 0;
 }
 
-static int __devinit e3d_pci_register(struct pci_dev *pdev,
+static int e3d_pci_register(struct pci_dev *pdev,
 				      const struct pci_device_id *ent)
 {
 	struct device_node *of_node;
diff --git a/drivers/video/tcx.c b/drivers/video/tcx.c
index 9f57539..cfdc1bb 100644
--- a/drivers/video/tcx.c
+++ b/drivers/video/tcx.c
@@ -362,7 +362,7 @@ static void tcx_unmap_regs(struct platform_device *op, struct fb_info *info,
 			   info->screen_base, info->fix.smem_len);
 }
 
-static int __devinit tcx_probe(struct platform_device *op)
+static int tcx_probe(struct platform_device *op)
 {
 	struct device_node *dp = op->dev.of_node;
 	struct fb_info *info;
diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c
index bbb0d95..efbf5c9 100644
--- a/drivers/video/tdfxfb.c
+++ b/drivers/video/tdfxfb.c
@@ -135,7 +135,7 @@ static struct fb_var_screeninfo tdfx_var __devinitdata = {
 /*
  * PCI driver prototypes
  */
-static int __devinit tdfxfb_probe(struct pci_dev *pdev,
+static int tdfxfb_probe(struct pci_dev *pdev,
 				  const struct pci_device_id *id);
 static void __devexit tdfxfb_remove(struct pci_dev *pdev);
 
@@ -1279,7 +1279,7 @@ static int tdfxfb_ddc_getsda(void *data)
 	return (0 != (tdfx_inl(par, VIDSERPARPORT) & DDC_SDA_IN));
 }
 
-static int __devinit tdfxfb_setup_ddc_bus(struct tdfxfb_i2c_chan *chan,
+static int tdfxfb_setup_ddc_bus(struct tdfxfb_i2c_chan *chan,
 					  const char *name, struct device *dev)
 {
 	int rc;
@@ -1308,7 +1308,7 @@ static int __devinit tdfxfb_setup_ddc_bus(struct tdfxfb_i2c_chan *chan,
 	return rc;
 }
 
-static int __devinit tdfxfb_setup_i2c_bus(struct tdfxfb_i2c_chan *chan,
+static int tdfxfb_setup_i2c_bus(struct tdfxfb_i2c_chan *chan,
 					  const char *name, struct device *dev)
 {
 	int rc;
@@ -1336,7 +1336,7 @@ static int __devinit tdfxfb_setup_i2c_bus(struct tdfxfb_i2c_chan *chan,
 	return rc;
 }
 
-static void __devinit tdfxfb_create_i2c_busses(struct fb_info *info)
+static void tdfxfb_create_i2c_busses(struct fb_info *info)
 {
 	struct tdfx_par *par = info->par;
 
@@ -1388,7 +1388,7 @@ static int tdfxfb_probe_i2c_connector(struct tdfx_par *par,
  *      Initializes and allocates resources for PCI device @pdev.
  *
  */
-static int __devinit tdfxfb_probe(struct pci_dev *pdev,
+static int tdfxfb_probe(struct pci_dev *pdev,
 				  const struct pci_device_id *id)
 {
 	struct tdfx_par *default_par;
diff --git a/drivers/video/tgafb.c b/drivers/video/tgafb.c
index 7333152..63fc5ba 100644
--- a/drivers/video/tgafb.c
+++ b/drivers/video/tgafb.c
@@ -61,7 +61,7 @@ static void tgafb_fillrect(struct fb_info *, const struct fb_fillrect *);
 static void tgafb_copyarea(struct fb_info *, const struct fb_copyarea *);
 static int tgafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info);
 
-static int __devinit tgafb_register(struct device *dev);
+static int tgafb_register(struct device *dev);
 static void __devexit tgafb_unregister(struct device *dev);
 
 static const char *mode_option;
@@ -93,7 +93,7 @@ static struct fb_ops tgafb_ops = {
 /*
  *  PCI registration operations
  */
-static int __devinit tgafb_pci_register(struct pci_dev *,
+static int tgafb_pci_register(struct pci_dev *,
 					const struct pci_device_id *);
 static void __devexit tgafb_pci_unregister(struct pci_dev *);
 
@@ -110,7 +110,7 @@ static struct pci_driver tgafb_pci_driver = {
 	.remove			= tgafb_pci_unregister,
 };
 
-static int __devinit
+static int
 tgafb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	return tgafb_register(&pdev->dev);
@@ -127,7 +127,7 @@ tgafb_pci_unregister(struct pci_dev *pdev)
 /*
  *  TC registration operations
  */
-static int __devinit tgafb_tc_register(struct device *);
+static int tgafb_tc_register(struct device *);
 static int __devexit tgafb_tc_unregister(struct device *);
 
 static struct tc_device_id const tgafb_tc_table[] = {
@@ -147,7 +147,7 @@ static struct tc_driver tgafb_tc_driver = {
 	},
 };
 
-static int __devinit
+static int
 tgafb_tc_register(struct device *dev)
 {
 	int status = tgafb_register(dev);
@@ -1546,7 +1546,7 @@ static int tgafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info
 	return 0;
 }
 
-static int __devinit
+static int
 tgafb_register(struct device *dev)
 {
 	static const struct fb_videomode modedb_tc = {
@@ -1729,7 +1729,7 @@ tgafb_exit(void)
 }
 
 #ifndef MODULE
-static int __devinit
+static int
 tgafb_setup(char *arg)
 {
 	char *this_opt;
@@ -1751,7 +1751,7 @@ tgafb_setup(char *arg)
 }
 #endif /* !MODULE */
 
-static int __devinit
+static int
 tgafb_init(void)
 {
 	int status;
diff --git a/drivers/video/tmiofb.c b/drivers/video/tmiofb.c
index 7c8133e..3f7527a 100644
--- a/drivers/video/tmiofb.c
+++ b/drivers/video/tmiofb.c
@@ -675,7 +675,7 @@ static struct fb_ops tmiofb_ops = {
 
 /*--------------------------------------------------------------------------*/
 
-static int __devinit tmiofb_probe(struct platform_device *dev)
+static int tmiofb_probe(struct platform_device *dev)
 {
 	const struct mfd_cell *cell = mfd_get_cell(dev);
 	struct tmio_fb_data *data = dev->dev.platform_data;
diff --git a/drivers/video/tridentfb.c b/drivers/video/tridentfb.c
index a3f207b..f1a8495 100644
--- a/drivers/video/tridentfb.c
+++ b/drivers/video/tridentfb.c
@@ -637,7 +637,7 @@ static inline void crtc_unlock(struct tridentfb_par *par)
 }
 
 /*  Return flat panel's maximum x resolution */
-static int __devinit get_nativex(struct tridentfb_par *par)
+static int get_nativex(struct tridentfb_par *par)
 {
 	int x, y, tmp;
 
@@ -771,7 +771,7 @@ static void set_number_of_lines(struct tridentfb_par *par, int lines)
  * If we see that FP is active we assume we have one.
  * Otherwise we have a CRT display. User can override.
  */
-static int __devinit is_flatpanel(struct tridentfb_par *par)
+static int is_flatpanel(struct tridentfb_par *par)
 {
 	if (fp)
 		return 1;
@@ -781,7 +781,7 @@ static int __devinit is_flatpanel(struct tridentfb_par *par)
 }
 
 /* Try detecting the video memory size */
-static unsigned int __devinit get_memsize(struct tridentfb_par *par)
+static unsigned int get_memsize(struct tridentfb_par *par)
 {
 	unsigned char tmp, tmp2;
 	unsigned int k;
@@ -1331,7 +1331,7 @@ static struct fb_ops tridentfb_ops = {
 	.fb_sync = tridentfb_sync,
 };
 
-static int __devinit trident_pci_probe(struct pci_dev *dev,
+static int trident_pci_probe(struct pci_dev *dev,
 				       const struct pci_device_id *id)
 {
 	int err;
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
index 2f8f82d..a776c8e 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -418,7 +418,7 @@ static void uvesafb_vbe_state_restore(struct uvesafb_par *par, u8 *state_buf)
 	uvesafb_free(task);
 }
 
-static int __devinit uvesafb_vbe_getinfo(struct uvesafb_ktask *task,
+static int uvesafb_vbe_getinfo(struct uvesafb_ktask *task,
 		struct uvesafb_par *par)
 {
 	int err;
@@ -477,7 +477,7 @@ static int __devinit uvesafb_vbe_getinfo(struct uvesafb_ktask *task,
 	return 0;
 }
 
-static int __devinit uvesafb_vbe_getmodes(struct uvesafb_ktask *task,
+static int uvesafb_vbe_getmodes(struct uvesafb_ktask *task,
 		struct uvesafb_par *par)
 {
 	int off = 0, err;
@@ -556,7 +556,7 @@ static int __devinit uvesafb_vbe_getmodes(struct uvesafb_ktask *task,
  * x86 and not x86_64.
  */
 #ifdef CONFIG_X86_32
-static int __devinit uvesafb_vbe_getpmi(struct uvesafb_ktask *task,
+static int uvesafb_vbe_getpmi(struct uvesafb_ktask *task,
 		struct uvesafb_par *par)
 {
 	int i, err;
@@ -602,7 +602,7 @@ static int __devinit uvesafb_vbe_getpmi(struct uvesafb_ktask *task,
  * Check whether a video mode is supported by the Video BIOS and is
  * compatible with the monitor limits.
  */
-static int __devinit uvesafb_is_valid_mode(struct fb_videomode *mode,
+static int uvesafb_is_valid_mode(struct fb_videomode *mode,
 		struct fb_info *info)
 {
 	if (info->monspecs.gtf) {
@@ -618,7 +618,7 @@ static int __devinit uvesafb_is_valid_mode(struct fb_videomode *mode,
 	return 1;
 }
 
-static int __devinit uvesafb_vbe_getedid(struct uvesafb_ktask *task,
+static int uvesafb_vbe_getedid(struct uvesafb_ktask *task,
 		struct fb_info *info)
 {
 	struct uvesafb_par *par = info->par;
@@ -684,7 +684,7 @@ static int __devinit uvesafb_vbe_getedid(struct uvesafb_ktask *task,
 	return err;
 }
 
-static void __devinit uvesafb_vbe_getmonspecs(struct uvesafb_ktask *task,
+static void uvesafb_vbe_getmonspecs(struct uvesafb_ktask *task,
 		struct fb_info *info)
 {
 	struct uvesafb_par *par = info->par;
@@ -765,7 +765,7 @@ static void __devinit uvesafb_vbe_getmonspecs(struct uvesafb_ktask *task,
 	return;
 }
 
-static void __devinit uvesafb_vbe_getstatesize(struct uvesafb_ktask *task,
+static void uvesafb_vbe_getstatesize(struct uvesafb_ktask *task,
 		struct uvesafb_par *par)
 {
 	int err;
@@ -794,7 +794,7 @@ static void __devinit uvesafb_vbe_getstatesize(struct uvesafb_ktask *task,
 	par->vbe_state_size = 64 * (task->t.regs.ebx & 0xffff);
 }
 
-static int __devinit uvesafb_vbe_init(struct fb_info *info)
+static int uvesafb_vbe_init(struct fb_info *info)
 {
 	struct uvesafb_ktask *task = NULL;
 	struct uvesafb_par *par = info->par;
@@ -839,7 +839,7 @@ out:	uvesafb_free(task);
 	return err;
 }
 
-static int __devinit uvesafb_vbe_init_mode(struct fb_info *info)
+static int uvesafb_vbe_init_mode(struct fb_info *info)
 {
 	struct list_head *pos;
 	struct fb_modelist *modelist;
@@ -1444,7 +1444,7 @@ static struct fb_ops uvesafb_ops = {
 	.fb_set_par	= uvesafb_set_par,
 };
 
-static void __devinit uvesafb_init_info(struct fb_info *info,
+static void uvesafb_init_info(struct fb_info *info,
 		struct vbe_mode_ib *mode)
 {
 	unsigned int size_vmode;
@@ -1540,7 +1540,7 @@ static void __devinit uvesafb_init_info(struct fb_info *info,
 		info->fbops->fb_pan_display = NULL;
 }
 
-static void __devinit uvesafb_init_mtrr(struct fb_info *info)
+static void uvesafb_init_mtrr(struct fb_info *info)
 {
 #ifdef CONFIG_MTRR
 	if (mtrr && !(info->fix.smem_start & (PAGE_SIZE - 1))) {
@@ -1582,7 +1582,7 @@ static void __devinit uvesafb_init_mtrr(struct fb_info *info)
 #endif /* CONFIG_MTRR */
 }
 
-static void __devinit uvesafb_ioremap(struct fb_info *info)
+static void uvesafb_ioremap(struct fb_info *info)
 {
 #ifdef CONFIG_X86
 	switch (mtrr) {
@@ -1738,7 +1738,7 @@ static struct attribute_group uvesafb_dev_attgrp = {
 	.attrs = uvesafb_dev_attrs,
 };
 
-static int __devinit uvesafb_probe(struct platform_device *dev)
+static int uvesafb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	struct vbe_mode_ib *mode = NULL;
@@ -1882,7 +1882,7 @@ static struct platform_driver uvesafb_driver = {
 static struct platform_device *uvesafb_device;
 
 #ifndef MODULE
-static int __devinit uvesafb_setup(char *options)
+static int uvesafb_setup(char *options)
 {
 	char *this_opt;
 
@@ -1950,7 +1950,7 @@ static ssize_t store_v86d(struct device_driver *dev, const char *buf,
 
 static DRIVER_ATTR(v86d, S_IRUGO | S_IWUSR, show_v86d, store_v86d);
 
-static int __devinit uvesafb_init(void)
+static int uvesafb_init(void)
 {
 	int err;
 
diff --git a/drivers/video/vermilion/vermilion.c b/drivers/video/vermilion/vermilion.c
index a2bacf8..3e92d0e 100644
--- a/drivers/video/vermilion/vermilion.c
+++ b/drivers/video/vermilion/vermilion.c
@@ -452,7 +452,7 @@ static void vmlfb_set_pref_pixel_format(struct fb_var_screeninfo *var)
  * struct per pipe. Currently we have only one pipe.
  */
 
-static int __devinit vml_pci_probe(struct pci_dev *dev,
+static int vml_pci_probe(struct pci_dev *dev,
 				   const struct pci_device_id *id)
 {
 	struct vml_info *vinfo;
diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c
index c7f69252..f4cb015 100644
--- a/drivers/video/vfb.c
+++ b/drivers/video/vfb.c
@@ -477,7 +477,7 @@ static int __init vfb_setup(char *options)
      *  Initialisation
      */
 
-static int __devinit vfb_probe(struct platform_device *dev)
+static int vfb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	int retval = -ENOMEM;
diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c
index 1ab146a..0e53f39 100644
--- a/drivers/video/vga16fb.c
+++ b/drivers/video/vga16fb.c
@@ -1303,7 +1303,7 @@ static int __init vga16fb_setup(char *options)
 }
 #endif
 
-static int __devinit vga16fb_probe(struct platform_device *dev)
+static int vga16fb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	struct vga16fb_par *par;
diff --git a/drivers/video/via/dvi.c b/drivers/video/via/dvi.c
index 6be72f0..1c9b68c 100644
--- a/drivers/video/via/dvi.c
+++ b/drivers/video/via/dvi.c
@@ -25,7 +25,7 @@
 static void tmds_register_write(int index, u8 data);
 static int tmds_register_read(int index);
 static int tmds_register_read_bytes(int index, u8 *buff, int buff_len);
-static void __devinit dvi_get_panel_size_from_DDCv1(
+static void dvi_get_panel_size_from_DDCv1(
 	struct tmds_chip_information *tmds_chip,
 	struct tmds_setting_information *tmds_setting);
 static int viafb_dvi_query_EDID(void);
@@ -35,7 +35,7 @@ static inline bool check_tmds_chip(int device_id_subaddr, int device_id)
 	return tmds_register_read(device_id_subaddr) == device_id;
 }
 
-void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
+void viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
 	struct tmds_setting_information *tmds_setting)
 {
 	DEBUG_MSG(KERN_INFO "viafb_init_dvi_size()\n");
@@ -47,7 +47,7 @@ void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
 	return;
 }
 
-bool __devinit viafb_tmds_trasmitter_identify(void)
+bool viafb_tmds_trasmitter_identify(void)
 {
 	unsigned char sr2a = 0, sr1e = 0, sr3e = 0;
 
@@ -285,7 +285,7 @@ static int viafb_dvi_query_EDID(void)
 }
 
 /* Get Panel Size Using EDID1 Table */
-static void __devinit dvi_get_panel_size_from_DDCv1(
+static void dvi_get_panel_size_from_DDCv1(
 	struct tmds_chip_information *tmds_chip,
 	struct tmds_setting_information *tmds_setting)
 {
diff --git a/drivers/video/via/dvi.h b/drivers/video/via/dvi.h
index db75785..4c6bfba 100644
--- a/drivers/video/via/dvi.h
+++ b/drivers/video/via/dvi.h
@@ -56,8 +56,8 @@
 int viafb_dvi_sense(void);
 void viafb_dvi_disable(void);
 void viafb_dvi_enable(void);
-bool __devinit viafb_tmds_trasmitter_identify(void);
-void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
+bool viafb_tmds_trasmitter_identify(void);
+void viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
 	struct tmds_setting_information *tmds_setting);
 void viafb_dvi_set_mode(const struct fb_var_screeninfo *var,
 	u16 cxres, u16 cyres, int iga);
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index 898590d..80233da 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -465,9 +465,9 @@ static struct via_device_mapping device_mapping[] = {
 static struct via_clock clock;
 
 static void load_fix_bit_crtc_reg(void);
-static void __devinit init_gfx_chip_info(int chip_type);
-static void __devinit init_tmds_chip_info(void);
-static void __devinit init_lvds_chip_info(void);
+static void init_gfx_chip_info(int chip_type);
+static void init_tmds_chip_info(void);
+static void init_lvds_chip_info(void);
 static void device_screen_off(void);
 static void device_screen_on(void);
 static void set_display_channel(void);
@@ -1507,7 +1507,7 @@ void viafb_fill_crtc_timing(const struct fb_var_screeninfo *var,
 	viafb_set_vclock(PICOS2KHZ(var->pixclock) * 1000, iga);
 }
 
-void __devinit viafb_init_chip_info(int chip_type)
+void viafb_init_chip_info(int chip_type)
 {
 	via_clock_init(&clock, chip_type);
 	init_gfx_chip_info(chip_type);
@@ -1540,7 +1540,7 @@ void viafb_update_device_setting(int hres, int vres, int bpp, int flag)
 	}
 }
 
-static void __devinit init_gfx_chip_info(int chip_type)
+static void init_gfx_chip_info(int chip_type)
 {
 	u8 tmp;
 
@@ -1593,7 +1593,7 @@ static void __devinit init_gfx_chip_info(int chip_type)
 	}
 }
 
-static void __devinit init_tmds_chip_info(void)
+static void init_tmds_chip_info(void)
 {
 	viafb_tmds_trasmitter_identify();
 
@@ -1638,7 +1638,7 @@ static void __devinit init_tmds_chip_info(void)
 		&viaparinfo->shared->tmds_setting_info);
 }
 
-static void __devinit init_lvds_chip_info(void)
+static void init_lvds_chip_info(void)
 {
 	viafb_lvds_trasmitter_identify();
 	viafb_init_lcd_size();
@@ -1672,7 +1672,7 @@ static void __devinit init_lvds_chip_info(void)
 		  viaparinfo->chip_info->lvds_chip_info.output_interface);
 }
 
-void __devinit viafb_init_dac(int set_iga)
+void viafb_init_dac(int set_iga)
 {
 	int i;
 	u8 tmp;
diff --git a/drivers/video/via/hw.h b/drivers/video/via/hw.h
index 6be243c..a820575 100644
--- a/drivers/video/via/hw.h
+++ b/drivers/video/via/hw.h
@@ -663,8 +663,8 @@ void viafb_set_dpa_gfx(int output_interface, struct GFX_DPA_SETTING\
 int viafb_setmode(void);
 void viafb_fill_var_timing_info(struct fb_var_screeninfo *var,
 	const struct fb_videomode *mode);
-void __devinit viafb_init_chip_info(int chip_type);
-void __devinit viafb_init_dac(int set_iga);
+void viafb_init_chip_info(int chip_type);
+void viafb_init_dac(int set_iga);
 int viafb_get_refresh(int hres, int vres, u32 float_refresh);
 void viafb_update_device_setting(int hres, int vres, int bpp, int flag);
 
diff --git a/drivers/video/via/lcd.c b/drivers/video/via/lcd.c
index 1650379..980ee1b 100644
--- a/drivers/video/via/lcd.c
+++ b/drivers/video/via/lcd.c
@@ -49,7 +49,7 @@ static struct _lcd_scaling_factor lcd_scaling_factor_CLE = {
 };
 
 static bool lvds_identify_integratedlvds(void);
-static void __devinit fp_id_to_vindex(int panel_id);
+static void fp_id_to_vindex(int panel_id);
 static int lvds_register_read(int index);
 static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres,
 		      int panel_vres);
@@ -81,7 +81,7 @@ static inline bool check_lvds_chip(int device_id_subaddr, int device_id)
 	return lvds_register_read(device_id_subaddr) == device_id;
 }
 
-void __devinit viafb_init_lcd_size(void)
+void viafb_init_lcd_size(void)
 {
 	DEBUG_MSG(KERN_INFO "viafb_init_lcd_size()\n");
 
@@ -139,7 +139,7 @@ static bool lvds_identify_integratedlvds(void)
 	return true;
 }
 
-bool __devinit viafb_lvds_trasmitter_identify(void)
+bool viafb_lvds_trasmitter_identify(void)
 {
 	if (viafb_lvds_identify_vt1636(VIA_PORT_31)) {
 		viaparinfo->chip_info->lvds_chip_info.i2c_port = VIA_PORT_31;
@@ -180,7 +180,7 @@ bool __devinit viafb_lvds_trasmitter_identify(void)
 	return false;
 }
 
-static void __devinit fp_id_to_vindex(int panel_id)
+static void fp_id_to_vindex(int panel_id)
 {
 	DEBUG_MSG(KERN_INFO "fp_get_panel_id()\n");
 
@@ -914,7 +914,7 @@ static void check_diport_of_integrated_lvds(
 		  plvds_chip_info->output_interface);
 }
 
-void __devinit viafb_init_lvds_output_interface(struct lvds_chip_information
+void viafb_init_lvds_output_interface(struct lvds_chip_information
 				*plvds_chip_info,
 				struct lvds_setting_information
 				*plvds_setting_info)
diff --git a/drivers/video/via/lcd.h b/drivers/video/via/lcd.h
index 8f3e4e0..5c988a0 100644
--- a/drivers/video/via/lcd.h
+++ b/drivers/video/via/lcd.h
@@ -71,15 +71,15 @@ void viafb_enable_lvds_vt1636(struct lvds_setting_information
 			struct lvds_chip_information *plvds_chip_info);
 void viafb_lcd_disable(void);
 void viafb_lcd_enable(void);
-void __devinit viafb_init_lcd_size(void);
-void __devinit viafb_init_lvds_output_interface(struct lvds_chip_information
+void viafb_init_lcd_size(void);
+void viafb_init_lvds_output_interface(struct lvds_chip_information
 				*plvds_chip_info,
 				struct lvds_setting_information
 				*plvds_setting_info);
 void viafb_lcd_set_mode(const struct fb_var_screeninfo *var, u16 cxres,
 	u16 cyres, struct lvds_setting_information *plvds_setting_info,
 	struct lvds_chip_information *plvds_chip_info);
-bool __devinit viafb_lvds_trasmitter_identify(void);
+bool viafb_lvds_trasmitter_identify(void);
 void viafb_init_lvds_output_interface(struct lvds_chip_information
 				*plvds_chip_info,
 				struct lvds_setting_information
diff --git a/drivers/video/via/via-core.c b/drivers/video/via/via-core.c
index 29b3af8..abbcb1b 100644
--- a/drivers/video/via/via-core.c
+++ b/drivers/video/via/via-core.c
@@ -80,7 +80,7 @@ static inline int viafb_mmio_read(int reg)
  */
 static u32 viafb_enabled_ints;
 
-static void __devinit viafb_int_init(void)
+static void viafb_int_init(void)
 {
 	viafb_enabled_ints = 0;
 
@@ -475,7 +475,7 @@ static int viafb_get_fb_size_from_pci(int chip_type)
 /*
  * Figure out and map our MMIO regions.
  */
-static int __devinit via_pci_setup_mmio(struct viafb_dev *vdev)
+static int via_pci_setup_mmio(struct viafb_dev *vdev)
 {
 	int ret;
 	/*
@@ -550,7 +550,7 @@ static struct viafb_subdev_info {
 };
 #define N_SUBDEVS ARRAY_SIZE(viafb_subdevs)
 
-static int __devinit via_create_subdev(struct viafb_dev *vdev,
+static int via_create_subdev(struct viafb_dev *vdev,
 		struct viafb_subdev_info *info)
 {
 	int ret;
@@ -573,7 +573,7 @@ static int __devinit via_create_subdev(struct viafb_dev *vdev,
 	return ret;
 }
 
-static int __devinit via_setup_subdevs(struct viafb_dev *vdev)
+static int via_setup_subdevs(struct viafb_dev *vdev)
 {
 	int i;
 
@@ -671,7 +671,7 @@ static int via_resume(struct pci_dev *pdev)
 }
 #endif /* CONFIG_PM */
 
-static int __devinit via_pci_probe(struct pci_dev *pdev,
+static int via_pci_probe(struct pci_dev *pdev,
 		const struct pci_device_id *ent)
 {
 	int ret;
diff --git a/drivers/video/via/via-gpio.c b/drivers/video/via/via-gpio.c
index d69cfef..e408679 100644
--- a/drivers/video/via/via-gpio.c
+++ b/drivers/video/via/via-gpio.c
@@ -212,7 +212,7 @@ EXPORT_SYMBOL_GPL(viafb_gpio_lookup);
 /*
  * Platform device stuff.
  */
-static __devinit int viafb_gpio_probe(struct platform_device *platdev)
+static int viafb_gpio_probe(struct platform_device *platdev)
 {
 	struct viafb_dev *vdev = platdev->dev.platform_data;
 	struct via_port_cfg *port_cfg = vdev->port_cfg;
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index c80e770..bb41017 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -1072,7 +1072,7 @@ static int __init parse_active_dev(void)
 	return 0;
 }
 
-static int __devinit parse_port(char *opt_str, int *output_interface)
+static int parse_port(char *opt_str, int *output_interface)
 {
 	if (!strncmp(opt_str, "DVP0", 4))
 		*output_interface = INTERFACE_DVP0;
@@ -1089,7 +1089,7 @@ static int __devinit parse_port(char *opt_str, int *output_interface)
 	return 0;
 }
 
-static void __devinit parse_lcd_port(void)
+static void parse_lcd_port(void)
 {
 	parse_port(viafb_lcd_port, &viaparinfo->chip_info->lvds_chip_info.
 		output_interface);
@@ -1102,7 +1102,7 @@ static void __devinit parse_lcd_port(void)
 		  output_interface);
 }
 
-static void __devinit parse_dvi_port(void)
+static void parse_dvi_port(void)
 {
 	parse_port(viafb_dvi_port, &viaparinfo->chip_info->tmds_chip_info.
 		output_interface);
@@ -1727,7 +1727,7 @@ static struct viafb_pm_hooks viafb_fb_pm_hooks = {
 
 #endif
 
-static void __devinit i2c_bus_probe(struct viafb_shared *shared)
+static void i2c_bus_probe(struct viafb_shared *shared)
 {
 	/* should be always CRT */
 	printk(KERN_INFO "viafb: Probing I2C bus 0x26\n");
@@ -1753,7 +1753,7 @@ static void i2c_bus_free(struct viafb_shared *shared)
 	via_aux_free(shared->i2c_2C);
 }
 
-int __devinit via_fb_pci_probe(struct viafb_dev *vdev)
+int via_fb_pci_probe(struct viafb_dev *vdev)
 {
 	u32 default_xres, default_yres;
 	struct fb_var_screeninfo default_var;
diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c
index 22063bb..1b94610 100644
--- a/drivers/video/vt8500lcdfb.c
+++ b/drivers/video/vt8500lcdfb.c
@@ -273,7 +273,7 @@ static irqreturn_t vt8500lcd_handle_irq(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static int __devinit vt8500lcd_probe(struct platform_device *pdev)
+static int vt8500lcd_probe(struct platform_device *pdev)
 {
 	struct vt8500lcd_info *fbi;
 	struct resource *res;
diff --git a/drivers/video/vt8623fb.c b/drivers/video/vt8623fb.c
index f0bce7a..c23c8c7 100644
--- a/drivers/video/vt8623fb.c
+++ b/drivers/video/vt8623fb.c
@@ -660,7 +660,7 @@ static struct fb_ops vt8623fb_ops = {
 
 /* PCI probe */
 
-static int __devinit vt8623_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
+static int vt8623_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 {
 	struct pci_bus_region bus_reg;
 	struct resource vga_res;
diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c
index 614e1bd..1c2eaf2 100644
--- a/drivers/video/w100fb.c
+++ b/drivers/video/w100fb.c
@@ -54,7 +54,7 @@ static void w100_update_enable(void);
 static void w100_update_disable(void);
 static void calc_hsync(struct w100fb_par *par);
 static void w100_init_graphic_engine(struct w100fb_par *par);
-struct w100_pll_info *w100_get_xtal_table(unsigned int freq) __devinit;
+struct w100_pll_info *w100_get_xtal_table(unsigned int freq);
 
 /* Pseudo palette size */
 #define MAX_PALETTES      16
@@ -630,7 +630,7 @@ static int w100fb_resume(struct platform_device *dev)
 #endif
 
 
-int __devinit w100fb_probe(struct platform_device *pdev)
+int w100fb_probe(struct platform_device *pdev)
 {
 	int err = -EIO;
 	struct w100fb_mach_info *inf;
@@ -1021,7 +1021,7 @@ static struct pll_entries {
 	{ 0 },
 };
 
-struct w100_pll_info __devinit *w100_get_xtal_table(unsigned int freq)
+struct w100_pll_info *w100_get_xtal_table(unsigned int freq)
 {
 	struct pll_entries *pll_entry = w100_pll_tables;
 
diff --git a/drivers/video/wm8505fb.c b/drivers/video/wm8505fb.c
index 5c126af..456694a 100644
--- a/drivers/video/wm8505fb.c
+++ b/drivers/video/wm8505fb.c
@@ -260,7 +260,7 @@ static struct fb_ops wm8505fb_ops = {
 	.fb_blank	= wm8505fb_blank,
 };
 
-static int __devinit wm8505fb_probe(struct platform_device *pdev)
+static int wm8505fb_probe(struct platform_device *pdev)
 {
 	struct wm8505fb_info	*fbi;
 	struct resource		*res;
diff --git a/drivers/video/wmt_ge_rops.c b/drivers/video/wmt_ge_rops.c
index 46b7a09..e65361d 100644
--- a/drivers/video/wmt_ge_rops.c
+++ b/drivers/video/wmt_ge_rops.c
@@ -124,7 +124,7 @@ int wmt_ge_sync(struct fb_info *p)
 }
 EXPORT_SYMBOL_GPL(wmt_ge_sync);
 
-static int __devinit wmt_ge_rops_probe(struct platform_device *pdev)
+static int wmt_ge_rops_probe(struct platform_device *pdev)
 {
 	struct resource *res;
 
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index 917bb56..ee44be8 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -358,7 +358,7 @@ static irqreturn_t xenfb_event_handler(int rq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static int __devinit xenfb_probe(struct xenbus_device *dev,
+static int xenfb_probe(struct xenbus_device *dev,
 				 const struct xenbus_device_id *id)
 {
 	struct xenfb_info *info;
@@ -487,7 +487,7 @@ error:
 	return ret;
 }
 
-static __devinit void
+static void
 xenfb_make_preferred_console(void)
 {
 	struct console *c;
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 20a7c0e..b5d317c 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -403,7 +403,7 @@ static int xilinxfb_release(struct device *dev)
  * OF bus binding
  */
 
-static int __devinit xilinxfb_of_probe(struct platform_device *op)
+static int xilinxfb_of_probe(struct platform_device *op)
 {
 	const u32 *prop;
 	u32 *p;
-- 
1.8.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 19:10:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 19:10:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaWjP-00027v-7j; Mon, 19 Nov 2012 19:10:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <wfp5p@viridian.itc.virginia.edu>) id 1TaW5U-0001Kn-W3
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 18:28:53 +0000
Received: from [85.158.138.51:8139] by server-1.bemta-3.messagelabs.com id
	96/24-12169-46A7AA05; Mon, 19 Nov 2012 18:28:52 +0000
X-Env-Sender: wfp5p@viridian.itc.virginia.edu
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353349727!30716654!1
X-Originating-IP: [128.143.12.139]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
	MAILTO_TO_SPAM_ADDR
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12511 invoked from network); 19 Nov 2012 18:28:47 -0000
Received: from viridian.itc.virginia.edu (HELO viridian.itc.virginia.edu)
	(128.143.12.139) by server-5.tower-174.messagelabs.com with SMTP;
	19 Nov 2012 18:28:47 -0000
Received: by viridian.itc.virginia.edu (Postfix, from userid 1249)
	id 6291580436; Mon, 19 Nov 2012 13:27:51 -0500 (EST)
From: Bill Pemberton <wfp5p@virginia.edu>
To: gregkh@linuxfoundation.org
Date: Mon, 19 Nov 2012 13:27:00 -0500
Message-Id: <1353349642-3677-471-git-send-email-wfp5p@virginia.edu>
X-Mailer: git-send-email 1.8.0
In-Reply-To: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
X-Mailman-Approved-At: Mon, 19 Nov 2012 19:10:06 +0000
Cc: Jiri Slaby <jirislaby@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>,
	"VMware, Inc." <pv-drivers@vmware.com>,
	Shreyas Bhatewara <sbhatewara@vmware.com>,
	virtualization@lists.linux-foundation.org,
	"Maciej W. Rozycki" <macro@linux-mips.org>,
	Christian Lamparter <chunkeey@googlemail.com>,
	Hin-Tak Leung <htl10@users.sourceforge.net>,
	Luciano Coelho <coelho@ti.com>, Stefano Brivio <stefano.brivio@polimi.it>,
	libertas-dev@lists.infradead.org, Dan Williams <dcbw@redhat.com>,
	ath5k-devel@lists.ath5k.org, "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>,
	linux-hippi@sunsite.dk, Nick Kossifidis <mickflemm@gmail.com>,
	Francois Romieu <romieu@fr.zoreil.com>,
	Herton Ronaldo Krzesinski <herton@canonical.com>,
	Stanislav Yakovlev <stas.yakovlev@gmail.com>, b43-dev@lists.infradead.org,
	Jes Sorensen <jes@trained-monkey.org>, Samuel Ortiz <samuel@sortiz.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	"John W. Linville" <linville@tuxdriver.com>,
	linux-can@vger.kernel.org, xen-devel@lists.xensource.com,
	Marc Kleine-Budde <mkl@pengutronix.de>, netdev@vger.kernel.org,
	linux-wireless@vger.kernel.org, Wolfgang Grandegger <wg@grandegger.com>,
	Simon Kelley <simon@thekelleys.org.uk>,
	Larry Finger <Larry.Finger@lwfinger.net>, Krzysztof Halasa <khc@pm.waw.pl>
Subject: [Xen-devel] [PATCH 471/493] net: remove use of __devexit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Wolfgang Grandegger <wg@grandegger.com> 
Cc: Marc Kleine-Budde <mkl@pengutronix.de> 
Cc: "Maciej W. Rozycki" <macro@linux-mips.org> 
Cc: Jes Sorensen <jes@trained-monkey.org> 
Cc: Samuel Ortiz <samuel@sortiz.org> 
Cc: Rusty Russell <rusty@rustcorp.com.au> 
Cc: "Michael S. Tsirkin" <mst@redhat.com> 
Cc: Shreyas Bhatewara <sbhatewara@vmware.com> 
Cc: "VMware, Inc." <pv-drivers@vmware.com> 
Cc: Francois Romieu <romieu@fr.zoreil.com> 
Cc: Krzysztof Halasa <khc@pm.waw.pl> 
Cc: "John W. Linville" <linville@tuxdriver.com> 
Cc: Jiri Slaby <jirislaby@gmail.com> 
Cc: Nick Kossifidis <mickflemm@gmail.com> 
Cc: "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com> 
Cc: Simon Kelley <simon@thekelleys.org.uk> 
Cc: Stefano Brivio <stefano.brivio@polimi.it> 
Cc: Stanislav Yakovlev <stas.yakovlev@gmail.com> 
Cc: Dan Williams <dcbw@redhat.com> 
Cc: Christian Lamparter <chunkeey@googlemail.com> 
Cc: Herton Ronaldo Krzesinski <herton@canonical.com> 
Cc: Hin-Tak Leung <htl10@users.sourceforge.net> 
Cc: Larry Finger <Larry.Finger@lwfinger.net> 
Cc: Luciano Coelho <coelho@ti.com> 
Cc: netdev@vger.kernel.org 
Cc: linux-can@vger.kernel.org 
Cc: linux-hippi@sunsite.dk 
Cc: virtualization@lists.linux-foundation.org 
Cc: linux-wireless@vger.kernel.org 
Cc: ath5k-devel@lists.ath5k.org 
Cc: b43-dev@lists.infradead.org 
Cc: libertas-dev@lists.infradead.org 
Cc: xen-devel@lists.xensource.com 
---
 drivers/net/arcnet/com20020-pci.c             |  2 +-
 drivers/net/can/at91_can.c                    |  2 +-
 drivers/net/can/bfin_can.c                    |  2 +-
 drivers/net/can/c_can/c_can_pci.c             |  2 +-
 drivers/net/can/c_can/c_can_platform.c        |  2 +-
 drivers/net/can/cc770/cc770_isa.c             |  2 +-
 drivers/net/can/cc770/cc770_platform.c        |  2 +-
 drivers/net/can/flexcan.c                     |  4 ++--
 drivers/net/can/janz-ican3.c                  |  6 +++---
 drivers/net/can/mcp251x.c                     |  2 +-
 drivers/net/can/mscan/mpc5xxx_can.c           |  2 +-
 drivers/net/can/pch_can.c                     |  2 +-
 drivers/net/can/sja1000/kvaser_pci.c          |  2 +-
 drivers/net/can/sja1000/peak_pci.c            |  2 +-
 drivers/net/can/sja1000/sja1000_isa.c         |  2 +-
 drivers/net/can/sja1000/sja1000_of_platform.c |  2 +-
 drivers/net/can/sja1000/tscan1.c              |  2 +-
 drivers/net/can/softing/softing_cs.c          |  2 +-
 drivers/net/can/softing/softing_main.c        |  2 +-
 drivers/net/can/ti_hecc.c                     |  2 +-
 drivers/net/fddi/defxx.c                      | 14 +++++++-------
 drivers/net/fddi/skfp/skfddi.c                |  2 +-
 drivers/net/hippi/rrunner.c                   |  2 +-
 drivers/net/ieee802154/at86rf230.c            |  2 +-
 drivers/net/ieee802154/fakehard.c             |  2 +-
 drivers/net/ieee802154/fakelb.c               |  2 +-
 drivers/net/ieee802154/mrf24j40.c             |  2 +-
 drivers/net/irda/au1k_ir.c                    |  2 +-
 drivers/net/irda/bfin_sir.c                   |  2 +-
 drivers/net/irda/sh_irda.c                    |  2 +-
 drivers/net/irda/sh_sir.c                     |  2 +-
 drivers/net/irda/via-ircc.c                   |  4 ++--
 drivers/net/irda/vlsi_ir.c                    |  2 +-
 drivers/net/phy/mdio-gpio.c                   |  4 ++--
 drivers/net/phy/mdio-mux-gpio.c               |  2 +-
 drivers/net/phy/mdio-mux-mmioreg.c            |  2 +-
 drivers/net/phy/mdio-octeon.c                 |  2 +-
 drivers/net/phy/spi_ks8995.c                  |  2 +-
 drivers/net/virtio_net.c                      |  2 +-
 drivers/net/vmxnet3/vmxnet3_drv.c             |  2 +-
 drivers/net/wan/dscc4.c                       |  2 +-
 drivers/net/wan/farsync.c                     |  2 +-
 drivers/net/wan/ixp4xx_hss.c                  |  2 +-
 drivers/net/wan/lmc/lmc_main.c                |  2 +-
 drivers/net/wireless/adm8211.c                |  2 +-
 drivers/net/wireless/airo.c                   |  2 +-
 drivers/net/wireless/ath/ath5k/pci.c          |  2 +-
 drivers/net/wireless/atmel_pci.c              |  2 +-
 drivers/net/wireless/b43/pcmcia.c             |  2 +-
 drivers/net/wireless/b43/sdio.c               |  2 +-
 drivers/net/wireless/ipw2x00/ipw2100.c        |  2 +-
 drivers/net/wireless/ipw2x00/ipw2200.c        |  2 +-
 drivers/net/wireless/iwlegacy/3945-mac.c      |  2 +-
 drivers/net/wireless/iwlegacy/4965-mac.c      |  2 +-
 drivers/net/wireless/iwlwifi/pcie/drv.c       |  2 +-
 drivers/net/wireless/libertas/if_spi.c        |  2 +-
 drivers/net/wireless/mwl8k.c                  |  4 ++--
 drivers/net/wireless/orinoco/orinoco_nortel.c |  2 +-
 drivers/net/wireless/orinoco/orinoco_pci.c    |  2 +-
 drivers/net/wireless/orinoco/orinoco_plx.c    |  2 +-
 drivers/net/wireless/orinoco/orinoco_tmd.c    |  2 +-
 drivers/net/wireless/p54/p54pci.c             |  2 +-
 drivers/net/wireless/p54/p54spi.c             |  2 +-
 drivers/net/wireless/p54/p54usb.c             |  2 +-
 drivers/net/wireless/rtl818x/rtl8180/dev.c    |  2 +-
 drivers/net/wireless/rtl818x/rtl8187/dev.c    |  2 +-
 drivers/net/wireless/ti/wl1251/sdio.c         |  2 +-
 drivers/net/wireless/ti/wl1251/spi.c          |  2 +-
 drivers/net/wireless/ti/wlcore/main.c         |  2 +-
 drivers/net/wireless/ti/wlcore/sdio.c         |  2 +-
 drivers/net/wireless/ti/wlcore/spi.c          |  2 +-
 drivers/net/wireless/ti/wlcore/wlcore.h       |  2 +-
 drivers/net/xen-netfront.c                    |  2 +-
 73 files changed, 85 insertions(+), 85 deletions(-)

diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
index e80f04b..cbc44f5 100644
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -135,7 +135,7 @@ out_dev:
 	return err;
 }
 
-static void __devexit com20020pci_remove(struct pci_dev *pdev)
+static void com20020pci_remove(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 	unregister_netdev(dev);
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index da807f3..e3c4c22 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -1338,7 +1338,7 @@ static int at91_can_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int __devexit at91_can_remove(struct platform_device *pdev)
+static int at91_can_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 	struct at91_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/bfin_can.c b/drivers/net/can/bfin_can.c
index 16515e3..6918334 100644
--- a/drivers/net/can/bfin_can.c
+++ b/drivers/net/can/bfin_can.c
@@ -611,7 +611,7 @@ exit:
 	return err;
 }
 
-static int __devexit bfin_can_remove(struct platform_device *pdev)
+static int bfin_can_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = dev_get_drvdata(&pdev->dev);
 	struct bfin_can_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c
index 27db0f2..a1f2631 100644
--- a/drivers/net/can/c_can/c_can_pci.c
+++ b/drivers/net/can/c_can/c_can_pci.c
@@ -174,7 +174,7 @@ out:
 	return ret;
 }
 
-static void __devexit c_can_pci_remove(struct pci_dev *pdev)
+static void c_can_pci_remove(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct c_can_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
index 91e7d2b..f133951 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -220,7 +220,7 @@ exit:
 	return ret;
 }
 
-static int __devexit c_can_plat_remove(struct platform_device *pdev)
+static int c_can_plat_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 	struct c_can_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/cc770/cc770_isa.c b/drivers/net/can/cc770/cc770_isa.c
index bed9d19..8eaaac8 100644
--- a/drivers/net/can/cc770/cc770_isa.c
+++ b/drivers/net/can/cc770/cc770_isa.c
@@ -291,7 +291,7 @@ static int cc770_isa_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int __devexit cc770_isa_remove(struct platform_device *pdev)
+static int cc770_isa_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = dev_get_drvdata(&pdev->dev);
 	struct cc770_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/cc770/cc770_platform.c b/drivers/net/can/cc770/cc770_platform.c
index caf4d70..4af9f4e 100644
--- a/drivers/net/can/cc770/cc770_platform.c
+++ b/drivers/net/can/cc770/cc770_platform.c
@@ -237,7 +237,7 @@ exit_release_mem:
 	return err;
 }
 
-static int __devexit cc770_platform_remove(struct platform_device *pdev)
+static int cc770_platform_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = dev_get_drvdata(&pdev->dev);
 	struct cc770_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index dd3c933..dc31c78 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -968,7 +968,7 @@ static int register_flexcandev(struct net_device *dev)
 	return err;
 }
 
-static void __devexit unregister_flexcandev(struct net_device *dev)
+static void unregister_flexcandev(struct net_device *dev)
 {
 	unregister_candev(dev);
 }
@@ -1107,7 +1107,7 @@ static int flexcan_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int __devexit flexcan_remove(struct platform_device *pdev)
+static int flexcan_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 	struct flexcan_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index 6eb1916..e7d69a4 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -642,7 +642,7 @@ static int ican3_msg_connect(struct ican3_dev *mod)
 	return ican3_send_msg(mod, &msg);
 }
 
-static int __devexit ican3_msg_disconnect(struct ican3_dev *mod)
+static int ican3_msg_disconnect(struct ican3_dev *mod)
 {
 	struct ican3_msg msg;
 
@@ -1421,7 +1421,7 @@ static int ican3_reset_module(struct ican3_dev *mod)
 	return -ETIMEDOUT;
 }
 
-static void __devexit ican3_shutdown_module(struct ican3_dev *mod)
+static void ican3_shutdown_module(struct ican3_dev *mod)
 {
 	ican3_msg_disconnect(mod);
 	ican3_reset_module(mod);
@@ -1898,7 +1898,7 @@ out_return:
 	return ret;
 }
 
-static int __devexit ican3_remove(struct platform_device *pdev)
+static int ican3_remove(struct platform_device *pdev)
 {
 	struct net_device *ndev = platform_get_drvdata(pdev);
 	struct ican3_dev *mod = netdev_priv(ndev);
diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c
index 767fdbd..5eaf47b 100644
--- a/drivers/net/can/mcp251x.c
+++ b/drivers/net/can/mcp251x.c
@@ -1100,7 +1100,7 @@ error_out:
 	return ret;
 }
 
-static int __devexit mcp251x_can_remove(struct spi_device *spi)
+static int mcp251x_can_remove(struct spi_device *spi)
 {
 	struct mcp251x_platform_data *pdata = spi->dev.platform_data;
 	struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
index 508cbad..12e130a 100644
--- a/drivers/net/can/mscan/mpc5xxx_can.c
+++ b/drivers/net/can/mscan/mpc5xxx_can.c
@@ -323,7 +323,7 @@ exit_unmap_mem:
 	return err;
 }
 
-static int __devexit mpc5xxx_can_remove(struct platform_device *ofdev)
+static int mpc5xxx_can_remove(struct platform_device *ofdev)
 {
 	struct net_device *dev = dev_get_drvdata(&ofdev->dev);
 	struct mscan_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
index fad4625..7d17485 100644
--- a/drivers/net/can/pch_can.c
+++ b/drivers/net/can/pch_can.c
@@ -954,7 +954,7 @@ static const struct net_device_ops pch_can_netdev_ops = {
 	.ndo_start_xmit		= pch_xmit,
 };
 
-static void __devexit pch_can_remove(struct pci_dev *pdev)
+static void pch_can_remove(struct pci_dev *pdev)
 {
 	struct net_device *ndev = pci_get_drvdata(pdev);
 	struct pch_can_priv *priv = netdev_priv(ndev);
diff --git a/drivers/net/can/sja1000/kvaser_pci.c b/drivers/net/can/sja1000/kvaser_pci.c
index a6191ac..4efdaf2 100644
--- a/drivers/net/can/sja1000/kvaser_pci.c
+++ b/drivers/net/can/sja1000/kvaser_pci.c
@@ -379,7 +379,7 @@ failure:
 
 }
 
-static void __devexit kvaser_pci_remove_one(struct pci_dev *pdev)
+static void kvaser_pci_remove_one(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 
diff --git a/drivers/net/can/sja1000/peak_pci.c b/drivers/net/can/sja1000/peak_pci.c
index fbf61cf..3faeb3d 100644
--- a/drivers/net/can/sja1000/peak_pci.c
+++ b/drivers/net/can/sja1000/peak_pci.c
@@ -717,7 +717,7 @@ failure_disable_pci:
 	return err;
 }
 
-static void __devexit peak_pci_remove(struct pci_dev *pdev)
+static void peak_pci_remove(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev); /* Last device */
 	struct sja1000_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/sja1000/sja1000_isa.c b/drivers/net/can/sja1000/sja1000_isa.c
index a872f24..5c8da46 100644
--- a/drivers/net/can/sja1000/sja1000_isa.c
+++ b/drivers/net/can/sja1000/sja1000_isa.c
@@ -223,7 +223,7 @@ static int sja1000_isa_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int __devexit sja1000_isa_remove(struct platform_device *pdev)
+static int sja1000_isa_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = dev_get_drvdata(&pdev->dev);
 	struct sja1000_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/sja1000/sja1000_of_platform.c b/drivers/net/can/sja1000/sja1000_of_platform.c
index 1ca0ee1..a7b0152 100644
--- a/drivers/net/can/sja1000/sja1000_of_platform.c
+++ b/drivers/net/can/sja1000/sja1000_of_platform.c
@@ -68,7 +68,7 @@ static void sja1000_ofp_write_reg(const struct sja1000_priv *priv,
 	out_8(priv->reg_base + reg, val);
 }
 
-static int __devexit sja1000_ofp_remove(struct platform_device *ofdev)
+static int sja1000_ofp_remove(struct platform_device *ofdev)
 {
 	struct net_device *dev = dev_get_drvdata(&ofdev->dev);
 	struct sja1000_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/sja1000/tscan1.c b/drivers/net/can/sja1000/tscan1.c
index 6a6db7e..76513dd 100644
--- a/drivers/net/can/sja1000/tscan1.c
+++ b/drivers/net/can/sja1000/tscan1.c
@@ -171,7 +171,7 @@ static int tscan1_probe(struct device *dev, unsigned id)
 	return -ENXIO;
 }
 
-static int __devexit tscan1_remove(struct device *dev, unsigned id /*unused*/)
+static int tscan1_remove(struct device *dev, unsigned id /*unused*/)
 {
 	struct net_device *netdev;
 	struct sja1000_priv *priv;
diff --git a/drivers/net/can/softing/softing_cs.c b/drivers/net/can/softing/softing_cs.c
index 04e1539..ce18ba5 100644
--- a/drivers/net/can/softing/softing_cs.c
+++ b/drivers/net/can/softing/softing_cs.c
@@ -215,7 +215,7 @@ static int softingcs_probe_config(struct pcmcia_device *pcmcia,
 	return pcmcia_request_window(pcmcia, pres, memspeed);
 }
 
-static __devexit void softingcs_remove(struct pcmcia_device *pcmcia)
+static void softingcs_remove(struct pcmcia_device *pcmcia)
 {
 	struct platform_device *pdev = pcmcia->priv;
 
diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c
index aefd297..50b1e0f 100644
--- a/drivers/net/can/softing/softing_main.c
+++ b/drivers/net/can/softing/softing_main.c
@@ -745,7 +745,7 @@ static const struct attribute_group softing_pdev_group = {
 /*
  * platform driver
  */
-static __devexit int softing_pdev_remove(struct platform_device *pdev)
+static int softing_pdev_remove(struct platform_device *pdev)
 {
 	struct softing *card = platform_get_drvdata(pdev);
 	int j;
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index 80ee814..b5e1683 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -978,7 +978,7 @@ probe_exit:
 	return err;
 }
 
-static int __devexit ti_hecc_remove(struct platform_device *pdev)
+static int ti_hecc_remove(struct platform_device *pdev)
 {
 	struct resource *res;
 	struct net_device *ndev = platform_get_drvdata(pdev);
diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c
index fd58f0b..3c8aab7 100644
--- a/drivers/net/fddi/defxx.c
+++ b/drivers/net/fddi/defxx.c
@@ -809,7 +809,7 @@ static void dfx_bus_init(struct net_device *dev)
  *   Interrupts are disabled at the adapter bus-specific logic.
  */
 
-static void __devexit dfx_bus_uninit(struct net_device *dev)
+static void dfx_bus_uninit(struct net_device *dev)
 {
 	DFX_board_t *bp = netdev_priv(dev);
 	struct device *bdev = bp->bus_dev;
@@ -3579,7 +3579,7 @@ static void dfx_xmt_flush( DFX_board_t *bp )
  *   Device structures for FDDI adapters (fddi0, fddi1, etc) are
  *   freed.
  */
-static void __devexit dfx_unregister(struct device *bdev)
+static void dfx_unregister(struct device *bdev)
 {
 	struct net_device *dev = dev_get_drvdata(bdev);
 	DFX_board_t *bp = netdev_priv(dev);
@@ -3620,12 +3620,12 @@ static void __devexit dfx_unregister(struct device *bdev)
 
 
 static int __maybe_unused dfx_dev_register(struct device *);
-static int __devexit __maybe_unused dfx_dev_unregister(struct device *);
+static int __maybe_unused dfx_dev_unregister(struct device *);
 
 #ifdef CONFIG_PCI
 static int dfx_pci_register(struct pci_dev *,
 				      const struct pci_device_id *);
-static void __devexit dfx_pci_unregister(struct pci_dev *);
+static void dfx_pci_unregister(struct pci_dev *);
 
 static DEFINE_PCI_DEVICE_TABLE(dfx_pci_table) = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_FDDI) },
@@ -3646,7 +3646,7 @@ static int dfx_pci_register(struct pci_dev *pdev,
 	return dfx_register(&pdev->dev);
 }
 
-static void __devexit dfx_pci_unregister(struct pci_dev *pdev)
+static void dfx_pci_unregister(struct pci_dev *pdev)
 {
 	dfx_unregister(&pdev->dev);
 }
@@ -3704,7 +3704,7 @@ static int __maybe_unused dfx_dev_register(struct device *dev)
 	return status;
 }
 
-static int __devexit __maybe_unused dfx_dev_unregister(struct device *dev)
+static int __maybe_unused dfx_dev_unregister(struct device *dev)
 {
 	put_device(dev);
 	dfx_unregister(dev);
@@ -3724,7 +3724,7 @@ static int dfx_init(void)
 	return status;
 }
 
-static void __devexit dfx_cleanup(void)
+static void dfx_cleanup(void)
 {
 	tc_unregister_driver(&dfx_tc_driver);
 	eisa_driver_unregister(&dfx_eisa_driver);
diff --git a/drivers/net/fddi/skfp/skfddi.c b/drivers/net/fddi/skfp/skfddi.c
index cbabb74..d5bd563 100644
--- a/drivers/net/fddi/skfp/skfddi.c
+++ b/drivers/net/fddi/skfp/skfddi.c
@@ -321,7 +321,7 @@ err_out1:
 /*
  * Called for each adapter board from pci_unregister_driver
  */
-static void __devexit skfp_remove_one(struct pci_dev *pdev)
+static void skfp_remove_one(struct pci_dev *pdev)
 {
 	struct net_device *p = pci_get_drvdata(pdev);
 	struct s_smc *lp = netdev_priv(p);
diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c
index 12b7ff9..6be95ed 100644
--- a/drivers/net/hippi/rrunner.c
+++ b/drivers/net/hippi/rrunner.c
@@ -221,7 +221,7 @@ static int rr_init_one(struct pci_dev *pdev,
 	return ret;
 }
 
-static void __devexit rr_remove_one (struct pci_dev *pdev)
+static void rr_remove_one (struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct rr_private *rr = netdev_priv(dev);
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 1198c6b..a4a62e1 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -920,7 +920,7 @@ err_fill:
 	return rc;
 }
 
-static int __devexit at86rf230_remove(struct spi_device *spi)
+static int at86rf230_remove(struct spi_device *spi)
 {
 	struct at86rf230_local *lp = spi_get_drvdata(spi);
 
diff --git a/drivers/net/ieee802154/fakehard.c b/drivers/net/ieee802154/fakehard.c
index fd0438c..1e9cb0b 100644
--- a/drivers/net/ieee802154/fakehard.c
+++ b/drivers/net/ieee802154/fakehard.c
@@ -412,7 +412,7 @@ out:
 	return err;
 }
 
-static int __devexit ieee802154fake_remove(struct platform_device *pdev)
+static int ieee802154fake_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 	unregister_netdev(dev);
diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c
index e4b0e38..b8d2217 100644
--- a/drivers/net/ieee802154/fakelb.c
+++ b/drivers/net/ieee802154/fakelb.c
@@ -253,7 +253,7 @@ err_alloc:
 	return err;
 }
 
-static int __devexit fakelb_remove(struct platform_device *pdev)
+static int fakelb_remove(struct platform_device *pdev)
 {
 	struct fakelb_priv *priv = platform_get_drvdata(pdev);
 	struct fakelb_dev_priv *dp, *temp;
diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
index ef41051..3f2c7aa 100644
--- a/drivers/net/ieee802154/mrf24j40.c
+++ b/drivers/net/ieee802154/mrf24j40.c
@@ -711,7 +711,7 @@ err_devrec:
 	return ret;
 }
 
-static int __devexit mrf24j40_remove(struct spi_device *spi)
+static int mrf24j40_remove(struct spi_device *spi)
 {
 	struct mrf24j40 *devrec = dev_get_drvdata(&spi->dev);
 
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c
index 7843f50..b5151e4 100644
--- a/drivers/net/irda/au1k_ir.c
+++ b/drivers/net/irda/au1k_ir.c
@@ -921,7 +921,7 @@ out:
 	return err;
 }
 
-static int __devexit au1k_irda_remove(struct platform_device *pdev)
+static int au1k_irda_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 	struct au1k_private *aup = netdev_priv(dev);
diff --git a/drivers/net/irda/bfin_sir.c b/drivers/net/irda/bfin_sir.c
index 98c903f..fed4a05 100644
--- a/drivers/net/irda/bfin_sir.c
+++ b/drivers/net/irda/bfin_sir.c
@@ -775,7 +775,7 @@ err_mem_0:
 	return err;
 }
 
-static int __devexit bfin_sir_remove(struct platform_device *pdev)
+static int bfin_sir_remove(struct platform_device *pdev)
 {
 	struct bfin_sir_port *sir_port;
 	struct net_device *dev = NULL;
diff --git a/drivers/net/irda/sh_irda.c b/drivers/net/irda/sh_irda.c
index 2d3f3e6..9448587 100644
--- a/drivers/net/irda/sh_irda.c
+++ b/drivers/net/irda/sh_irda.c
@@ -825,7 +825,7 @@ exit:
 	return err;
 }
 
-static int __devexit sh_irda_remove(struct platform_device *pdev)
+static int sh_irda_remove(struct platform_device *pdev)
 {
 	struct net_device *ndev = platform_get_drvdata(pdev);
 	struct sh_irda_self *self = netdev_priv(ndev);
diff --git a/drivers/net/irda/sh_sir.c b/drivers/net/irda/sh_sir.c
index 150b56c..24aefcd 100644
--- a/drivers/net/irda/sh_sir.c
+++ b/drivers/net/irda/sh_sir.c
@@ -783,7 +783,7 @@ exit:
 	return err;
 }
 
-static int __devexit sh_sir_remove(struct platform_device *pdev)
+static int sh_sir_remove(struct platform_device *pdev)
 {
 	struct net_device *ndev = platform_get_drvdata(pdev);
 	struct sh_sir_self *self = netdev_priv(ndev);
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c
index d678f52..5488247 100644
--- a/drivers/net/irda/via-ircc.c
+++ b/drivers/net/irda/via-ircc.c
@@ -103,7 +103,7 @@ static void hwreset(struct via_ircc_cb *self);
 static int via_ircc_dma_xmit(struct via_ircc_cb *self, u16 iobase);
 static int upload_rxdata(struct via_ircc_cb *self, int iobase);
 static int via_init_one (struct pci_dev *pcidev, const struct pci_device_id *id);
-static void __devexit via_remove_one (struct pci_dev *pdev);
+static void via_remove_one (struct pci_dev *pdev);
 
 /* FIXME : Should use udelay() instead, even if we are x86 only - Jean II */
 static void iodelay(int udelay)
@@ -424,7 +424,7 @@ static int via_ircc_open(struct pci_dev *pdev, chipio_t * info,
  *    Close driver instance
  *
  */
-static void __devexit via_remove_one(struct pci_dev *pdev)
+static void via_remove_one(struct pci_dev *pdev)
 {
 	struct via_ircc_cb *self = pci_get_drvdata(pdev);
 	int iobase;
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
index e255b65..2f99f88 100644
--- a/drivers/net/irda/vlsi_ir.c
+++ b/drivers/net/irda/vlsi_ir.c
@@ -1699,7 +1699,7 @@ out:
 	return -ENODEV;
 }
 
-static void __devexit vlsi_irda_remove(struct pci_dev *pdev)
+static void vlsi_irda_remove(struct pci_dev *pdev)
 {
 	struct net_device *ndev = pci_get_drvdata(pdev);
 	vlsi_irda_dev_t *idev;
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
index bf30b1d..6b2fdb8 100644
--- a/drivers/net/phy/mdio-gpio.c
+++ b/drivers/net/phy/mdio-gpio.c
@@ -173,7 +173,7 @@ static void mdio_gpio_bus_deinit(struct device *dev)
 	kfree(bitbang);
 }
 
-static void __devexit mdio_gpio_bus_destroy(struct device *dev)
+static void mdio_gpio_bus_destroy(struct device *dev)
 {
 	struct mii_bus *bus = dev_get_drvdata(dev);
 
@@ -210,7 +210,7 @@ static int mdio_gpio_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int __devexit mdio_gpio_remove(struct platform_device *pdev)
+static int mdio_gpio_remove(struct platform_device *pdev)
 {
 	mdio_gpio_bus_destroy(&pdev->dev);
 
diff --git a/drivers/net/phy/mdio-mux-gpio.c b/drivers/net/phy/mdio-mux-gpio.c
index 23ee064..0c9accb 100644
--- a/drivers/net/phy/mdio-mux-gpio.c
+++ b/drivers/net/phy/mdio-mux-gpio.c
@@ -104,7 +104,7 @@ err:
 	return r;
 }
 
-static int __devexit mdio_mux_gpio_remove(struct platform_device *pdev)
+static int mdio_mux_gpio_remove(struct platform_device *pdev)
 {
 	struct mdio_mux_gpio_state *s = pdev->dev.platform_data;
 	mdio_mux_uninit(s->mux_handle);
diff --git a/drivers/net/phy/mdio-mux-mmioreg.c b/drivers/net/phy/mdio-mux-mmioreg.c
index a38951f..9733bd2 100644
--- a/drivers/net/phy/mdio-mux-mmioreg.c
+++ b/drivers/net/phy/mdio-mux-mmioreg.c
@@ -137,7 +137,7 @@ static int mdio_mux_mmioreg_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __devexit mdio_mux_mmioreg_remove(struct platform_device *pdev)
+static int mdio_mux_mmioreg_remove(struct platform_device *pdev)
 {
 	struct mdio_mux_mmioreg_state *s = dev_get_platdata(&pdev->dev);
 
diff --git a/drivers/net/phy/mdio-octeon.c b/drivers/net/phy/mdio-octeon.c
index 7a07985..09297fe 100644
--- a/drivers/net/phy/mdio-octeon.c
+++ b/drivers/net/phy/mdio-octeon.c
@@ -159,7 +159,7 @@ fail:
 	return err;
 }
 
-static int __devexit octeon_mdiobus_remove(struct platform_device *pdev)
+static int octeon_mdiobus_remove(struct platform_device *pdev)
 {
 	struct octeon_mdiobus *bus;
 	union cvmx_smix_en smi_en;
diff --git a/drivers/net/phy/spi_ks8995.c b/drivers/net/phy/spi_ks8995.c
index 1321c99..41eb8ff 100644
--- a/drivers/net/phy/spi_ks8995.c
+++ b/drivers/net/phy/spi_ks8995.c
@@ -332,7 +332,7 @@ err_drvdata:
 	return err;
 }
 
-static int __devexit ks8995_remove(struct spi_device *spi)
+static int ks8995_remove(struct spi_device *spi)
 {
 	struct ks8995_data      *ks8995;
 
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index b0c1630..c5f0ed2 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1195,7 +1195,7 @@ static void remove_vq_common(struct virtnet_info *vi)
 		__free_pages(get_a_page(vi, GFP_KERNEL), 0);
 }
 
-static void __devexit virtnet_remove(struct virtio_device *vdev)
+static void virtnet_remove(struct virtio_device *vdev)
 {
 	struct virtnet_info *vi = vdev->priv;
 
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index ac322e5..71b762f 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -3096,7 +3096,7 @@ err_alloc_shared:
 }
 
 
-static void __devexit
+static void
 vmxnet3_remove_device(struct pci_dev *pdev)
 {
 	struct net_device *netdev = pci_get_drvdata(pdev);
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index 863df17..d502230 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -1968,7 +1968,7 @@ err_out:
 	return -ENOMEM;
 }
 
-static void __devexit dscc4_remove_one(struct pci_dev *pdev)
+static void dscc4_remove_one(struct pci_dev *pdev)
 {
 	struct dscc4_pci_priv *ppriv;
 	struct dscc4_dev_priv *root;
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index dbbe06e..d7adba4 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -2615,7 +2615,7 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 /*
  *      Cleanup and close down a card
  */
-static void __devexit
+static void
 fst_remove_one(struct pci_dev *pdev)
 {
 	struct fst_card_info *card;
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
index beecbe8..b056691 100644
--- a/drivers/net/wan/ixp4xx_hss.c
+++ b/drivers/net/wan/ixp4xx_hss.c
@@ -1375,7 +1375,7 @@ err_free:
 	return err;
 }
 
-static int __devexit hss_remove_one(struct platform_device *pdev)
+static int hss_remove_one(struct platform_device *pdev)
 {
 	struct port *port = platform_get_drvdata(pdev);
 
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index 41a401a..0e443fd 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -986,7 +986,7 @@ err_req_io:
 /*
  * Called from pci when removing module.
  */
-static void __devexit lmc_remove_one(struct pci_dev *pdev)
+static void lmc_remove_one(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index bd89a29..3d339e0 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -1935,7 +1935,7 @@ static int adm8211_probe(struct pci_dev *pdev,
 }
 
 
-static void __devexit adm8211_remove(struct pci_dev *pdev)
+static void adm8211_remove(struct pci_dev *pdev)
 {
 	struct ieee80211_hw *dev = pci_get_drvdata(pdev);
 	struct adm8211_priv *priv;
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index b010f41..5329541 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -5606,7 +5606,7 @@ static int airo_pci_probe(struct pci_dev *pdev,
 	return 0;
 }
 
-static void __devexit airo_pci_remove(struct pci_dev *pdev)
+static void airo_pci_remove(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 
diff --git a/drivers/net/wireless/ath/ath5k/pci.c b/drivers/net/wireless/ath/ath5k/pci.c
index 1a78ba3..859db7c 100644
--- a/drivers/net/wireless/ath/ath5k/pci.c
+++ b/drivers/net/wireless/ath/ath5k/pci.c
@@ -285,7 +285,7 @@ err:
 	return ret;
 }
 
-static void __devexit
+static void
 ath5k_pci_remove(struct pci_dev *pdev)
 {
 	struct ieee80211_hw *hw = pci_get_drvdata(pdev);
diff --git a/drivers/net/wireless/atmel_pci.c b/drivers/net/wireless/atmel_pci.c
index 1c12fec..c1b159e 100644
--- a/drivers/net/wireless/atmel_pci.c
+++ b/drivers/net/wireless/atmel_pci.c
@@ -69,7 +69,7 @@ static int atmel_pci_probe(struct pci_dev *pdev,
 	return 0;
 }
 
-static void __devexit atmel_pci_remove(struct pci_dev *pdev)
+static void atmel_pci_remove(struct pci_dev *pdev)
 {
 	stop_atmel_card(pci_get_drvdata(pdev));
 }
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c
index 3506cca..f2ea2ce 100644
--- a/drivers/net/wireless/b43/pcmcia.c
+++ b/drivers/net/wireless/b43/pcmcia.c
@@ -110,7 +110,7 @@ out_error:
 	return err;
 }
 
-static void __devexit b43_pcmcia_remove(struct pcmcia_device *dev)
+static void b43_pcmcia_remove(struct pcmcia_device *dev)
 {
 	struct ssb_bus *ssb = dev->priv;
 
diff --git a/drivers/net/wireless/b43/sdio.c b/drivers/net/wireless/b43/sdio.c
index d2b1f98..59a5218 100644
--- a/drivers/net/wireless/b43/sdio.c
+++ b/drivers/net/wireless/b43/sdio.c
@@ -171,7 +171,7 @@ out:
 	return error;
 }
 
-static void __devexit b43_sdio_remove(struct sdio_func *func)
+static void b43_sdio_remove(struct sdio_func *func)
 {
 	struct b43_sdio *sdio = sdio_get_drvdata(func);
 
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index b96c615..7588484 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -6413,7 +6413,7 @@ out:
 	goto out;
 }
 
-static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev)
+static void ipw2100_pci_remove_one(struct pci_dev *pci_dev)
 {
 	struct ipw2100_priv *priv = pci_get_drvdata(pci_dev);
 	struct net_device *dev = priv->net_dev;
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 3f099a6..941c6b5 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -11895,7 +11895,7 @@ static int ipw_pci_probe(struct pci_dev *pdev,
 	return err;
 }
 
-static void __devexit ipw_pci_remove(struct pci_dev *pdev)
+static void ipw_pci_remove(struct pci_dev *pdev)
 {
 	struct ipw_priv *priv = pci_get_drvdata(pdev);
 	struct list_head *p, *q;
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index 88fdd39..d604b40 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -3794,7 +3794,7 @@ out:
 	return err;
 }
 
-static void __devexit
+static void
 il3945_pci_remove(struct pci_dev *pdev)
 {
 	struct il_priv *il = pci_get_drvdata(pdev);
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 14e0a94..569e1ae5 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -6664,7 +6664,7 @@ out:
 	return err;
 }
 
-static void __devexit
+static void
 il4965_pci_remove(struct pci_dev *pdev)
 {
 	struct il_priv *il = pci_get_drvdata(pdev);
diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c
index 7cb27af..1f21d60 100644
--- a/drivers/net/wireless/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/iwlwifi/pcie/drv.c
@@ -294,7 +294,7 @@ out_free_trans:
 	return -EFAULT;
 }
 
-static void __devexit iwl_pci_remove(struct pci_dev *pdev)
+static void iwl_pci_remove(struct pci_dev *pdev)
 {
 	struct iwl_trans *trans = pci_get_drvdata(pdev);
 	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index abc32e3..4bb6574 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -1226,7 +1226,7 @@ out:
 	return err;
 }
 
-static int __devexit libertas_spi_remove(struct spi_device *spi)
+static int libertas_spi_remove(struct spi_device *spi)
 {
 	struct if_spi_card *card = spi_get_drvdata(spi);
 	struct lbs_private *priv = card->priv;
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index b9f71fd..19cad01 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -5872,12 +5872,12 @@ err_disable_device:
 	return rc;
 }
 
-static void __devexit mwl8k_shutdown(struct pci_dev *pdev)
+static void mwl8k_shutdown(struct pci_dev *pdev)
 {
 	printk(KERN_ERR "===>%s(%u)\n", __func__, __LINE__);
 }
 
-static void __devexit mwl8k_remove(struct pci_dev *pdev)
+static void mwl8k_remove(struct pci_dev *pdev)
 {
 	struct ieee80211_hw *hw = pci_get_drvdata(pdev);
 	struct mwl8k_priv *priv;
diff --git a/drivers/net/wireless/orinoco/orinoco_nortel.c b/drivers/net/wireless/orinoco/orinoco_nortel.c
index f286540..d73fdf6 100644
--- a/drivers/net/wireless/orinoco/orinoco_nortel.c
+++ b/drivers/net/wireless/orinoco/orinoco_nortel.c
@@ -255,7 +255,7 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev,
 	return err;
 }
 
-static void __devexit orinoco_nortel_remove_one(struct pci_dev *pdev)
+static void orinoco_nortel_remove_one(struct pci_dev *pdev)
 {
 	struct orinoco_private *priv = pci_get_drvdata(pdev);
 	struct orinoco_pci_card *card = priv->card;
diff --git a/drivers/net/wireless/orinoco/orinoco_pci.c b/drivers/net/wireless/orinoco/orinoco_pci.c
index bf6d436..677bf14 100644
--- a/drivers/net/wireless/orinoco/orinoco_pci.c
+++ b/drivers/net/wireless/orinoco/orinoco_pci.c
@@ -199,7 +199,7 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
 	return err;
 }
 
-static void __devexit orinoco_pci_remove_one(struct pci_dev *pdev)
+static void orinoco_pci_remove_one(struct pci_dev *pdev)
 {
 	struct orinoco_private *priv = pci_get_drvdata(pdev);
 
diff --git a/drivers/net/wireless/orinoco/orinoco_plx.c b/drivers/net/wireless/orinoco/orinoco_plx.c
index 63a614f..2559dbd 100644
--- a/drivers/net/wireless/orinoco/orinoco_plx.c
+++ b/drivers/net/wireless/orinoco/orinoco_plx.c
@@ -294,7 +294,7 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
 	return err;
 }
 
-static void __devexit orinoco_plx_remove_one(struct pci_dev *pdev)
+static void orinoco_plx_remove_one(struct pci_dev *pdev)
 {
 	struct orinoco_private *priv = pci_get_drvdata(pdev);
 	struct orinoco_pci_card *card = priv->card;
diff --git a/drivers/net/wireless/orinoco/orinoco_tmd.c b/drivers/net/wireless/orinoco/orinoco_tmd.c
index f67f43e..42afeee 100644
--- a/drivers/net/wireless/orinoco/orinoco_tmd.c
+++ b/drivers/net/wireless/orinoco/orinoco_tmd.c
@@ -188,7 +188,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
 	return err;
 }
 
-static void __devexit orinoco_tmd_remove_one(struct pci_dev *pdev)
+static void orinoco_tmd_remove_one(struct pci_dev *pdev)
 {
 	struct orinoco_private *priv = pci_get_drvdata(pdev);
 	struct orinoco_pci_card *card = priv->card;
diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c
index e5b29e9..04eb0ed 100644
--- a/drivers/net/wireless/p54/p54pci.c
+++ b/drivers/net/wireless/p54/p54pci.c
@@ -639,7 +639,7 @@ static int p54p_probe(struct pci_dev *pdev,
 	return err;
 }
 
-static void __devexit p54p_remove(struct pci_dev *pdev)
+static void p54p_remove(struct pci_dev *pdev)
 {
 	struct ieee80211_hw *dev = pci_get_drvdata(pdev);
 	struct p54p_priv *priv;
diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
index d75ab3e..4fd49a0 100644
--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -683,7 +683,7 @@ err_free:
 	return ret;
 }
 
-static int __devexit p54spi_remove(struct spi_device *spi)
+static int p54spi_remove(struct spi_device *spi)
 {
 	struct p54s_priv *priv = dev_get_drvdata(&spi->dev);
 
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index 000f7ba..e71c702 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -1057,7 +1057,7 @@ static int p54u_probe(struct usb_interface *intf,
 	return err;
 }
 
-static void __devexit p54u_disconnect(struct usb_interface *intf)
+static void p54u_disconnect(struct usb_interface *intf)
 {
 	struct ieee80211_hw *dev = usb_get_intfdata(intf);
 	struct p54u_priv *priv;
diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c
index 6a5c0b8..4af3f91 100644
--- a/drivers/net/wireless/rtl818x/rtl8180/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c
@@ -1131,7 +1131,7 @@ static int rtl8180_probe(struct pci_dev *pdev,
 	return err;
 }
 
-static void __devexit rtl8180_remove(struct pci_dev *pdev)
+static void rtl8180_remove(struct pci_dev *pdev)
 {
 	struct ieee80211_hw *dev = pci_get_drvdata(pdev);
 	struct rtl8180_priv *priv;
diff --git a/drivers/net/wireless/rtl818x/rtl8187/dev.c b/drivers/net/wireless/rtl818x/rtl8187/dev.c
index f879bc3..be36935 100644
--- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
@@ -1639,7 +1639,7 @@ static int rtl8187_probe(struct usb_interface *intf,
 	return err;
 }
 
-static void __devexit rtl8187_disconnect(struct usb_interface *intf)
+static void rtl8187_disconnect(struct usb_interface *intf)
 {
 	struct ieee80211_hw *dev = usb_get_intfdata(intf);
 	struct rtl8187_priv *priv;
diff --git a/drivers/net/wireless/ti/wl1251/sdio.c b/drivers/net/wireless/ti/wl1251/sdio.c
index e3f287f..e57ee48 100644
--- a/drivers/net/wireless/ti/wl1251/sdio.c
+++ b/drivers/net/wireless/ti/wl1251/sdio.c
@@ -305,7 +305,7 @@ out_free_hw:
 	return ret;
 }
 
-static void __devexit wl1251_sdio_remove(struct sdio_func *func)
+static void wl1251_sdio_remove(struct sdio_func *func)
 {
 	struct wl1251 *wl = sdio_get_drvdata(func);
 	struct wl1251_sdio *wl_sdio = wl->if_priv;
diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c
index 640a3d5..3b266d3 100644
--- a/drivers/net/wireless/ti/wl1251/spi.c
+++ b/drivers/net/wireless/ti/wl1251/spi.c
@@ -309,7 +309,7 @@ static int wl1251_spi_probe(struct spi_device *spi)
 	return ret;
 }
 
-static int __devexit wl1251_spi_remove(struct spi_device *spi)
+static int wl1251_spi_remove(struct spi_device *spi)
 {
 	struct wl1251 *wl = dev_get_drvdata(&spi->dev);
 
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 2dd4ada..dd38f61 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -5682,7 +5682,7 @@ int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev)
 }
 EXPORT_SYMBOL_GPL(wlcore_probe);
 
-int __devexit wlcore_remove(struct platform_device *pdev)
+int wlcore_remove(struct platform_device *pdev)
 {
 	struct wl1271 *wl = platform_get_drvdata(pdev);
 
diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index 7bf612c..646f703 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -319,7 +319,7 @@ out:
 	return ret;
 }
 
-static void __devexit wl1271_remove(struct sdio_func *func)
+static void wl1271_remove(struct sdio_func *func)
 {
 	struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func);
 
diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
index ee39484..f06f477 100644
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@ -403,7 +403,7 @@ out:
 	return ret;
 }
 
-static int __devexit wl1271_remove(struct spi_device *spi)
+static int wl1271_remove(struct spi_device *spi)
 {
 	struct wl12xx_spi_glue *glue = spi_get_drvdata(spi);
 
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
index adc6152..c388493 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -415,7 +415,7 @@ struct wl1271 {
 };
 
 int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);
-int __devexit wlcore_remove(struct platform_device *pdev);
+int wlcore_remove(struct platform_device *pdev);
 struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size);
 int wlcore_free_hw(struct wl1271 *wl);
 int wlcore_set_key(struct wl1271 *wl, enum set_key_cmd cmd,
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 6f695fc..b31198c 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1911,7 +1911,7 @@ static const struct xenbus_device_id netfront_ids[] = {
 };
 
 
-static int __devexit xennet_remove(struct xenbus_device *dev)
+static int xennet_remove(struct xenbus_device *dev)
 {
 	struct netfront_info *info = dev_get_drvdata(&dev->dev);
 
-- 
1.8.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 19:10:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 19:10:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaWjP-00027v-7j; Mon, 19 Nov 2012 19:10:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <wfp5p@viridian.itc.virginia.edu>) id 1TaW5U-0001Kn-W3
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 18:28:53 +0000
Received: from [85.158.138.51:8139] by server-1.bemta-3.messagelabs.com id
	96/24-12169-46A7AA05; Mon, 19 Nov 2012 18:28:52 +0000
X-Env-Sender: wfp5p@viridian.itc.virginia.edu
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353349727!30716654!1
X-Originating-IP: [128.143.12.139]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
	MAILTO_TO_SPAM_ADDR
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12511 invoked from network); 19 Nov 2012 18:28:47 -0000
Received: from viridian.itc.virginia.edu (HELO viridian.itc.virginia.edu)
	(128.143.12.139) by server-5.tower-174.messagelabs.com with SMTP;
	19 Nov 2012 18:28:47 -0000
Received: by viridian.itc.virginia.edu (Postfix, from userid 1249)
	id 6291580436; Mon, 19 Nov 2012 13:27:51 -0500 (EST)
From: Bill Pemberton <wfp5p@virginia.edu>
To: gregkh@linuxfoundation.org
Date: Mon, 19 Nov 2012 13:27:00 -0500
Message-Id: <1353349642-3677-471-git-send-email-wfp5p@virginia.edu>
X-Mailer: git-send-email 1.8.0
In-Reply-To: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
X-Mailman-Approved-At: Mon, 19 Nov 2012 19:10:06 +0000
Cc: Jiri Slaby <jirislaby@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>,
	"VMware, Inc." <pv-drivers@vmware.com>,
	Shreyas Bhatewara <sbhatewara@vmware.com>,
	virtualization@lists.linux-foundation.org,
	"Maciej W. Rozycki" <macro@linux-mips.org>,
	Christian Lamparter <chunkeey@googlemail.com>,
	Hin-Tak Leung <htl10@users.sourceforge.net>,
	Luciano Coelho <coelho@ti.com>, Stefano Brivio <stefano.brivio@polimi.it>,
	libertas-dev@lists.infradead.org, Dan Williams <dcbw@redhat.com>,
	ath5k-devel@lists.ath5k.org, "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>,
	linux-hippi@sunsite.dk, Nick Kossifidis <mickflemm@gmail.com>,
	Francois Romieu <romieu@fr.zoreil.com>,
	Herton Ronaldo Krzesinski <herton@canonical.com>,
	Stanislav Yakovlev <stas.yakovlev@gmail.com>, b43-dev@lists.infradead.org,
	Jes Sorensen <jes@trained-monkey.org>, Samuel Ortiz <samuel@sortiz.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	"John W. Linville" <linville@tuxdriver.com>,
	linux-can@vger.kernel.org, xen-devel@lists.xensource.com,
	Marc Kleine-Budde <mkl@pengutronix.de>, netdev@vger.kernel.org,
	linux-wireless@vger.kernel.org, Wolfgang Grandegger <wg@grandegger.com>,
	Simon Kelley <simon@thekelleys.org.uk>,
	Larry Finger <Larry.Finger@lwfinger.net>, Krzysztof Halasa <khc@pm.waw.pl>
Subject: [Xen-devel] [PATCH 471/493] net: remove use of __devexit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Wolfgang Grandegger <wg@grandegger.com> 
Cc: Marc Kleine-Budde <mkl@pengutronix.de> 
Cc: "Maciej W. Rozycki" <macro@linux-mips.org> 
Cc: Jes Sorensen <jes@trained-monkey.org> 
Cc: Samuel Ortiz <samuel@sortiz.org> 
Cc: Rusty Russell <rusty@rustcorp.com.au> 
Cc: "Michael S. Tsirkin" <mst@redhat.com> 
Cc: Shreyas Bhatewara <sbhatewara@vmware.com> 
Cc: "VMware, Inc." <pv-drivers@vmware.com> 
Cc: Francois Romieu <romieu@fr.zoreil.com> 
Cc: Krzysztof Halasa <khc@pm.waw.pl> 
Cc: "John W. Linville" <linville@tuxdriver.com> 
Cc: Jiri Slaby <jirislaby@gmail.com> 
Cc: Nick Kossifidis <mickflemm@gmail.com> 
Cc: "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com> 
Cc: Simon Kelley <simon@thekelleys.org.uk> 
Cc: Stefano Brivio <stefano.brivio@polimi.it> 
Cc: Stanislav Yakovlev <stas.yakovlev@gmail.com> 
Cc: Dan Williams <dcbw@redhat.com> 
Cc: Christian Lamparter <chunkeey@googlemail.com> 
Cc: Herton Ronaldo Krzesinski <herton@canonical.com> 
Cc: Hin-Tak Leung <htl10@users.sourceforge.net> 
Cc: Larry Finger <Larry.Finger@lwfinger.net> 
Cc: Luciano Coelho <coelho@ti.com> 
Cc: netdev@vger.kernel.org 
Cc: linux-can@vger.kernel.org 
Cc: linux-hippi@sunsite.dk 
Cc: virtualization@lists.linux-foundation.org 
Cc: linux-wireless@vger.kernel.org 
Cc: ath5k-devel@lists.ath5k.org 
Cc: b43-dev@lists.infradead.org 
Cc: libertas-dev@lists.infradead.org 
Cc: xen-devel@lists.xensource.com 
---
 drivers/net/arcnet/com20020-pci.c             |  2 +-
 drivers/net/can/at91_can.c                    |  2 +-
 drivers/net/can/bfin_can.c                    |  2 +-
 drivers/net/can/c_can/c_can_pci.c             |  2 +-
 drivers/net/can/c_can/c_can_platform.c        |  2 +-
 drivers/net/can/cc770/cc770_isa.c             |  2 +-
 drivers/net/can/cc770/cc770_platform.c        |  2 +-
 drivers/net/can/flexcan.c                     |  4 ++--
 drivers/net/can/janz-ican3.c                  |  6 +++---
 drivers/net/can/mcp251x.c                     |  2 +-
 drivers/net/can/mscan/mpc5xxx_can.c           |  2 +-
 drivers/net/can/pch_can.c                     |  2 +-
 drivers/net/can/sja1000/kvaser_pci.c          |  2 +-
 drivers/net/can/sja1000/peak_pci.c            |  2 +-
 drivers/net/can/sja1000/sja1000_isa.c         |  2 +-
 drivers/net/can/sja1000/sja1000_of_platform.c |  2 +-
 drivers/net/can/sja1000/tscan1.c              |  2 +-
 drivers/net/can/softing/softing_cs.c          |  2 +-
 drivers/net/can/softing/softing_main.c        |  2 +-
 drivers/net/can/ti_hecc.c                     |  2 +-
 drivers/net/fddi/defxx.c                      | 14 +++++++-------
 drivers/net/fddi/skfp/skfddi.c                |  2 +-
 drivers/net/hippi/rrunner.c                   |  2 +-
 drivers/net/ieee802154/at86rf230.c            |  2 +-
 drivers/net/ieee802154/fakehard.c             |  2 +-
 drivers/net/ieee802154/fakelb.c               |  2 +-
 drivers/net/ieee802154/mrf24j40.c             |  2 +-
 drivers/net/irda/au1k_ir.c                    |  2 +-
 drivers/net/irda/bfin_sir.c                   |  2 +-
 drivers/net/irda/sh_irda.c                    |  2 +-
 drivers/net/irda/sh_sir.c                     |  2 +-
 drivers/net/irda/via-ircc.c                   |  4 ++--
 drivers/net/irda/vlsi_ir.c                    |  2 +-
 drivers/net/phy/mdio-gpio.c                   |  4 ++--
 drivers/net/phy/mdio-mux-gpio.c               |  2 +-
 drivers/net/phy/mdio-mux-mmioreg.c            |  2 +-
 drivers/net/phy/mdio-octeon.c                 |  2 +-
 drivers/net/phy/spi_ks8995.c                  |  2 +-
 drivers/net/virtio_net.c                      |  2 +-
 drivers/net/vmxnet3/vmxnet3_drv.c             |  2 +-
 drivers/net/wan/dscc4.c                       |  2 +-
 drivers/net/wan/farsync.c                     |  2 +-
 drivers/net/wan/ixp4xx_hss.c                  |  2 +-
 drivers/net/wan/lmc/lmc_main.c                |  2 +-
 drivers/net/wireless/adm8211.c                |  2 +-
 drivers/net/wireless/airo.c                   |  2 +-
 drivers/net/wireless/ath/ath5k/pci.c          |  2 +-
 drivers/net/wireless/atmel_pci.c              |  2 +-
 drivers/net/wireless/b43/pcmcia.c             |  2 +-
 drivers/net/wireless/b43/sdio.c               |  2 +-
 drivers/net/wireless/ipw2x00/ipw2100.c        |  2 +-
 drivers/net/wireless/ipw2x00/ipw2200.c        |  2 +-
 drivers/net/wireless/iwlegacy/3945-mac.c      |  2 +-
 drivers/net/wireless/iwlegacy/4965-mac.c      |  2 +-
 drivers/net/wireless/iwlwifi/pcie/drv.c       |  2 +-
 drivers/net/wireless/libertas/if_spi.c        |  2 +-
 drivers/net/wireless/mwl8k.c                  |  4 ++--
 drivers/net/wireless/orinoco/orinoco_nortel.c |  2 +-
 drivers/net/wireless/orinoco/orinoco_pci.c    |  2 +-
 drivers/net/wireless/orinoco/orinoco_plx.c    |  2 +-
 drivers/net/wireless/orinoco/orinoco_tmd.c    |  2 +-
 drivers/net/wireless/p54/p54pci.c             |  2 +-
 drivers/net/wireless/p54/p54spi.c             |  2 +-
 drivers/net/wireless/p54/p54usb.c             |  2 +-
 drivers/net/wireless/rtl818x/rtl8180/dev.c    |  2 +-
 drivers/net/wireless/rtl818x/rtl8187/dev.c    |  2 +-
 drivers/net/wireless/ti/wl1251/sdio.c         |  2 +-
 drivers/net/wireless/ti/wl1251/spi.c          |  2 +-
 drivers/net/wireless/ti/wlcore/main.c         |  2 +-
 drivers/net/wireless/ti/wlcore/sdio.c         |  2 +-
 drivers/net/wireless/ti/wlcore/spi.c          |  2 +-
 drivers/net/wireless/ti/wlcore/wlcore.h       |  2 +-
 drivers/net/xen-netfront.c                    |  2 +-
 73 files changed, 85 insertions(+), 85 deletions(-)

diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
index e80f04b..cbc44f5 100644
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -135,7 +135,7 @@ out_dev:
 	return err;
 }
 
-static void __devexit com20020pci_remove(struct pci_dev *pdev)
+static void com20020pci_remove(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 	unregister_netdev(dev);
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index da807f3..e3c4c22 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -1338,7 +1338,7 @@ static int at91_can_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int __devexit at91_can_remove(struct platform_device *pdev)
+static int at91_can_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 	struct at91_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/bfin_can.c b/drivers/net/can/bfin_can.c
index 16515e3..6918334 100644
--- a/drivers/net/can/bfin_can.c
+++ b/drivers/net/can/bfin_can.c
@@ -611,7 +611,7 @@ exit:
 	return err;
 }
 
-static int __devexit bfin_can_remove(struct platform_device *pdev)
+static int bfin_can_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = dev_get_drvdata(&pdev->dev);
 	struct bfin_can_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c
index 27db0f2..a1f2631 100644
--- a/drivers/net/can/c_can/c_can_pci.c
+++ b/drivers/net/can/c_can/c_can_pci.c
@@ -174,7 +174,7 @@ out:
 	return ret;
 }
 
-static void __devexit c_can_pci_remove(struct pci_dev *pdev)
+static void c_can_pci_remove(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct c_can_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
index 91e7d2b..f133951 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -220,7 +220,7 @@ exit:
 	return ret;
 }
 
-static int __devexit c_can_plat_remove(struct platform_device *pdev)
+static int c_can_plat_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 	struct c_can_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/cc770/cc770_isa.c b/drivers/net/can/cc770/cc770_isa.c
index bed9d19..8eaaac8 100644
--- a/drivers/net/can/cc770/cc770_isa.c
+++ b/drivers/net/can/cc770/cc770_isa.c
@@ -291,7 +291,7 @@ static int cc770_isa_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int __devexit cc770_isa_remove(struct platform_device *pdev)
+static int cc770_isa_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = dev_get_drvdata(&pdev->dev);
 	struct cc770_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/cc770/cc770_platform.c b/drivers/net/can/cc770/cc770_platform.c
index caf4d70..4af9f4e 100644
--- a/drivers/net/can/cc770/cc770_platform.c
+++ b/drivers/net/can/cc770/cc770_platform.c
@@ -237,7 +237,7 @@ exit_release_mem:
 	return err;
 }
 
-static int __devexit cc770_platform_remove(struct platform_device *pdev)
+static int cc770_platform_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = dev_get_drvdata(&pdev->dev);
 	struct cc770_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index dd3c933..dc31c78 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -968,7 +968,7 @@ static int register_flexcandev(struct net_device *dev)
 	return err;
 }
 
-static void __devexit unregister_flexcandev(struct net_device *dev)
+static void unregister_flexcandev(struct net_device *dev)
 {
 	unregister_candev(dev);
 }
@@ -1107,7 +1107,7 @@ static int flexcan_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int __devexit flexcan_remove(struct platform_device *pdev)
+static int flexcan_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 	struct flexcan_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index 6eb1916..e7d69a4 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -642,7 +642,7 @@ static int ican3_msg_connect(struct ican3_dev *mod)
 	return ican3_send_msg(mod, &msg);
 }
 
-static int __devexit ican3_msg_disconnect(struct ican3_dev *mod)
+static int ican3_msg_disconnect(struct ican3_dev *mod)
 {
 	struct ican3_msg msg;
 
@@ -1421,7 +1421,7 @@ static int ican3_reset_module(struct ican3_dev *mod)
 	return -ETIMEDOUT;
 }
 
-static void __devexit ican3_shutdown_module(struct ican3_dev *mod)
+static void ican3_shutdown_module(struct ican3_dev *mod)
 {
 	ican3_msg_disconnect(mod);
 	ican3_reset_module(mod);
@@ -1898,7 +1898,7 @@ out_return:
 	return ret;
 }
 
-static int __devexit ican3_remove(struct platform_device *pdev)
+static int ican3_remove(struct platform_device *pdev)
 {
 	struct net_device *ndev = platform_get_drvdata(pdev);
 	struct ican3_dev *mod = netdev_priv(ndev);
diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c
index 767fdbd..5eaf47b 100644
--- a/drivers/net/can/mcp251x.c
+++ b/drivers/net/can/mcp251x.c
@@ -1100,7 +1100,7 @@ error_out:
 	return ret;
 }
 
-static int __devexit mcp251x_can_remove(struct spi_device *spi)
+static int mcp251x_can_remove(struct spi_device *spi)
 {
 	struct mcp251x_platform_data *pdata = spi->dev.platform_data;
 	struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
index 508cbad..12e130a 100644
--- a/drivers/net/can/mscan/mpc5xxx_can.c
+++ b/drivers/net/can/mscan/mpc5xxx_can.c
@@ -323,7 +323,7 @@ exit_unmap_mem:
 	return err;
 }
 
-static int __devexit mpc5xxx_can_remove(struct platform_device *ofdev)
+static int mpc5xxx_can_remove(struct platform_device *ofdev)
 {
 	struct net_device *dev = dev_get_drvdata(&ofdev->dev);
 	struct mscan_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
index fad4625..7d17485 100644
--- a/drivers/net/can/pch_can.c
+++ b/drivers/net/can/pch_can.c
@@ -954,7 +954,7 @@ static const struct net_device_ops pch_can_netdev_ops = {
 	.ndo_start_xmit		= pch_xmit,
 };
 
-static void __devexit pch_can_remove(struct pci_dev *pdev)
+static void pch_can_remove(struct pci_dev *pdev)
 {
 	struct net_device *ndev = pci_get_drvdata(pdev);
 	struct pch_can_priv *priv = netdev_priv(ndev);
diff --git a/drivers/net/can/sja1000/kvaser_pci.c b/drivers/net/can/sja1000/kvaser_pci.c
index a6191ac..4efdaf2 100644
--- a/drivers/net/can/sja1000/kvaser_pci.c
+++ b/drivers/net/can/sja1000/kvaser_pci.c
@@ -379,7 +379,7 @@ failure:
 
 }
 
-static void __devexit kvaser_pci_remove_one(struct pci_dev *pdev)
+static void kvaser_pci_remove_one(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 
diff --git a/drivers/net/can/sja1000/peak_pci.c b/drivers/net/can/sja1000/peak_pci.c
index fbf61cf..3faeb3d 100644
--- a/drivers/net/can/sja1000/peak_pci.c
+++ b/drivers/net/can/sja1000/peak_pci.c
@@ -717,7 +717,7 @@ failure_disable_pci:
 	return err;
 }
 
-static void __devexit peak_pci_remove(struct pci_dev *pdev)
+static void peak_pci_remove(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev); /* Last device */
 	struct sja1000_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/sja1000/sja1000_isa.c b/drivers/net/can/sja1000/sja1000_isa.c
index a872f24..5c8da46 100644
--- a/drivers/net/can/sja1000/sja1000_isa.c
+++ b/drivers/net/can/sja1000/sja1000_isa.c
@@ -223,7 +223,7 @@ static int sja1000_isa_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int __devexit sja1000_isa_remove(struct platform_device *pdev)
+static int sja1000_isa_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = dev_get_drvdata(&pdev->dev);
 	struct sja1000_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/sja1000/sja1000_of_platform.c b/drivers/net/can/sja1000/sja1000_of_platform.c
index 1ca0ee1..a7b0152 100644
--- a/drivers/net/can/sja1000/sja1000_of_platform.c
+++ b/drivers/net/can/sja1000/sja1000_of_platform.c
@@ -68,7 +68,7 @@ static void sja1000_ofp_write_reg(const struct sja1000_priv *priv,
 	out_8(priv->reg_base + reg, val);
 }
 
-static int __devexit sja1000_ofp_remove(struct platform_device *ofdev)
+static int sja1000_ofp_remove(struct platform_device *ofdev)
 {
 	struct net_device *dev = dev_get_drvdata(&ofdev->dev);
 	struct sja1000_priv *priv = netdev_priv(dev);
diff --git a/drivers/net/can/sja1000/tscan1.c b/drivers/net/can/sja1000/tscan1.c
index 6a6db7e..76513dd 100644
--- a/drivers/net/can/sja1000/tscan1.c
+++ b/drivers/net/can/sja1000/tscan1.c
@@ -171,7 +171,7 @@ static int tscan1_probe(struct device *dev, unsigned id)
 	return -ENXIO;
 }
 
-static int __devexit tscan1_remove(struct device *dev, unsigned id /*unused*/)
+static int tscan1_remove(struct device *dev, unsigned id /*unused*/)
 {
 	struct net_device *netdev;
 	struct sja1000_priv *priv;
diff --git a/drivers/net/can/softing/softing_cs.c b/drivers/net/can/softing/softing_cs.c
index 04e1539..ce18ba5 100644
--- a/drivers/net/can/softing/softing_cs.c
+++ b/drivers/net/can/softing/softing_cs.c
@@ -215,7 +215,7 @@ static int softingcs_probe_config(struct pcmcia_device *pcmcia,
 	return pcmcia_request_window(pcmcia, pres, memspeed);
 }
 
-static __devexit void softingcs_remove(struct pcmcia_device *pcmcia)
+static void softingcs_remove(struct pcmcia_device *pcmcia)
 {
 	struct platform_device *pdev = pcmcia->priv;
 
diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c
index aefd297..50b1e0f 100644
--- a/drivers/net/can/softing/softing_main.c
+++ b/drivers/net/can/softing/softing_main.c
@@ -745,7 +745,7 @@ static const struct attribute_group softing_pdev_group = {
 /*
  * platform driver
  */
-static __devexit int softing_pdev_remove(struct platform_device *pdev)
+static int softing_pdev_remove(struct platform_device *pdev)
 {
 	struct softing *card = platform_get_drvdata(pdev);
 	int j;
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index 80ee814..b5e1683 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -978,7 +978,7 @@ probe_exit:
 	return err;
 }
 
-static int __devexit ti_hecc_remove(struct platform_device *pdev)
+static int ti_hecc_remove(struct platform_device *pdev)
 {
 	struct resource *res;
 	struct net_device *ndev = platform_get_drvdata(pdev);
diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c
index fd58f0b..3c8aab7 100644
--- a/drivers/net/fddi/defxx.c
+++ b/drivers/net/fddi/defxx.c
@@ -809,7 +809,7 @@ static void dfx_bus_init(struct net_device *dev)
  *   Interrupts are disabled at the adapter bus-specific logic.
  */
 
-static void __devexit dfx_bus_uninit(struct net_device *dev)
+static void dfx_bus_uninit(struct net_device *dev)
 {
 	DFX_board_t *bp = netdev_priv(dev);
 	struct device *bdev = bp->bus_dev;
@@ -3579,7 +3579,7 @@ static void dfx_xmt_flush( DFX_board_t *bp )
  *   Device structures for FDDI adapters (fddi0, fddi1, etc) are
  *   freed.
  */
-static void __devexit dfx_unregister(struct device *bdev)
+static void dfx_unregister(struct device *bdev)
 {
 	struct net_device *dev = dev_get_drvdata(bdev);
 	DFX_board_t *bp = netdev_priv(dev);
@@ -3620,12 +3620,12 @@ static void __devexit dfx_unregister(struct device *bdev)
 
 
 static int __maybe_unused dfx_dev_register(struct device *);
-static int __devexit __maybe_unused dfx_dev_unregister(struct device *);
+static int __maybe_unused dfx_dev_unregister(struct device *);
 
 #ifdef CONFIG_PCI
 static int dfx_pci_register(struct pci_dev *,
 				      const struct pci_device_id *);
-static void __devexit dfx_pci_unregister(struct pci_dev *);
+static void dfx_pci_unregister(struct pci_dev *);
 
 static DEFINE_PCI_DEVICE_TABLE(dfx_pci_table) = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_FDDI) },
@@ -3646,7 +3646,7 @@ static int dfx_pci_register(struct pci_dev *pdev,
 	return dfx_register(&pdev->dev);
 }
 
-static void __devexit dfx_pci_unregister(struct pci_dev *pdev)
+static void dfx_pci_unregister(struct pci_dev *pdev)
 {
 	dfx_unregister(&pdev->dev);
 }
@@ -3704,7 +3704,7 @@ static int __maybe_unused dfx_dev_register(struct device *dev)
 	return status;
 }
 
-static int __devexit __maybe_unused dfx_dev_unregister(struct device *dev)
+static int __maybe_unused dfx_dev_unregister(struct device *dev)
 {
 	put_device(dev);
 	dfx_unregister(dev);
@@ -3724,7 +3724,7 @@ static int dfx_init(void)
 	return status;
 }
 
-static void __devexit dfx_cleanup(void)
+static void dfx_cleanup(void)
 {
 	tc_unregister_driver(&dfx_tc_driver);
 	eisa_driver_unregister(&dfx_eisa_driver);
diff --git a/drivers/net/fddi/skfp/skfddi.c b/drivers/net/fddi/skfp/skfddi.c
index cbabb74..d5bd563 100644
--- a/drivers/net/fddi/skfp/skfddi.c
+++ b/drivers/net/fddi/skfp/skfddi.c
@@ -321,7 +321,7 @@ err_out1:
 /*
  * Called for each adapter board from pci_unregister_driver
  */
-static void __devexit skfp_remove_one(struct pci_dev *pdev)
+static void skfp_remove_one(struct pci_dev *pdev)
 {
 	struct net_device *p = pci_get_drvdata(pdev);
 	struct s_smc *lp = netdev_priv(p);
diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c
index 12b7ff9..6be95ed 100644
--- a/drivers/net/hippi/rrunner.c
+++ b/drivers/net/hippi/rrunner.c
@@ -221,7 +221,7 @@ static int rr_init_one(struct pci_dev *pdev,
 	return ret;
 }
 
-static void __devexit rr_remove_one (struct pci_dev *pdev)
+static void rr_remove_one (struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct rr_private *rr = netdev_priv(dev);
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 1198c6b..a4a62e1 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -920,7 +920,7 @@ err_fill:
 	return rc;
 }
 
-static int __devexit at86rf230_remove(struct spi_device *spi)
+static int at86rf230_remove(struct spi_device *spi)
 {
 	struct at86rf230_local *lp = spi_get_drvdata(spi);
 
diff --git a/drivers/net/ieee802154/fakehard.c b/drivers/net/ieee802154/fakehard.c
index fd0438c..1e9cb0b 100644
--- a/drivers/net/ieee802154/fakehard.c
+++ b/drivers/net/ieee802154/fakehard.c
@@ -412,7 +412,7 @@ out:
 	return err;
 }
 
-static int __devexit ieee802154fake_remove(struct platform_device *pdev)
+static int ieee802154fake_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 	unregister_netdev(dev);
diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c
index e4b0e38..b8d2217 100644
--- a/drivers/net/ieee802154/fakelb.c
+++ b/drivers/net/ieee802154/fakelb.c
@@ -253,7 +253,7 @@ err_alloc:
 	return err;
 }
 
-static int __devexit fakelb_remove(struct platform_device *pdev)
+static int fakelb_remove(struct platform_device *pdev)
 {
 	struct fakelb_priv *priv = platform_get_drvdata(pdev);
 	struct fakelb_dev_priv *dp, *temp;
diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
index ef41051..3f2c7aa 100644
--- a/drivers/net/ieee802154/mrf24j40.c
+++ b/drivers/net/ieee802154/mrf24j40.c
@@ -711,7 +711,7 @@ err_devrec:
 	return ret;
 }
 
-static int __devexit mrf24j40_remove(struct spi_device *spi)
+static int mrf24j40_remove(struct spi_device *spi)
 {
 	struct mrf24j40 *devrec = dev_get_drvdata(&spi->dev);
 
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c
index 7843f50..b5151e4 100644
--- a/drivers/net/irda/au1k_ir.c
+++ b/drivers/net/irda/au1k_ir.c
@@ -921,7 +921,7 @@ out:
 	return err;
 }
 
-static int __devexit au1k_irda_remove(struct platform_device *pdev)
+static int au1k_irda_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 	struct au1k_private *aup = netdev_priv(dev);
diff --git a/drivers/net/irda/bfin_sir.c b/drivers/net/irda/bfin_sir.c
index 98c903f..fed4a05 100644
--- a/drivers/net/irda/bfin_sir.c
+++ b/drivers/net/irda/bfin_sir.c
@@ -775,7 +775,7 @@ err_mem_0:
 	return err;
 }
 
-static int __devexit bfin_sir_remove(struct platform_device *pdev)
+static int bfin_sir_remove(struct platform_device *pdev)
 {
 	struct bfin_sir_port *sir_port;
 	struct net_device *dev = NULL;
diff --git a/drivers/net/irda/sh_irda.c b/drivers/net/irda/sh_irda.c
index 2d3f3e6..9448587 100644
--- a/drivers/net/irda/sh_irda.c
+++ b/drivers/net/irda/sh_irda.c
@@ -825,7 +825,7 @@ exit:
 	return err;
 }
 
-static int __devexit sh_irda_remove(struct platform_device *pdev)
+static int sh_irda_remove(struct platform_device *pdev)
 {
 	struct net_device *ndev = platform_get_drvdata(pdev);
 	struct sh_irda_self *self = netdev_priv(ndev);
diff --git a/drivers/net/irda/sh_sir.c b/drivers/net/irda/sh_sir.c
index 150b56c..24aefcd 100644
--- a/drivers/net/irda/sh_sir.c
+++ b/drivers/net/irda/sh_sir.c
@@ -783,7 +783,7 @@ exit:
 	return err;
 }
 
-static int __devexit sh_sir_remove(struct platform_device *pdev)
+static int sh_sir_remove(struct platform_device *pdev)
 {
 	struct net_device *ndev = platform_get_drvdata(pdev);
 	struct sh_sir_self *self = netdev_priv(ndev);
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c
index d678f52..5488247 100644
--- a/drivers/net/irda/via-ircc.c
+++ b/drivers/net/irda/via-ircc.c
@@ -103,7 +103,7 @@ static void hwreset(struct via_ircc_cb *self);
 static int via_ircc_dma_xmit(struct via_ircc_cb *self, u16 iobase);
 static int upload_rxdata(struct via_ircc_cb *self, int iobase);
 static int via_init_one (struct pci_dev *pcidev, const struct pci_device_id *id);
-static void __devexit via_remove_one (struct pci_dev *pdev);
+static void via_remove_one (struct pci_dev *pdev);
 
 /* FIXME : Should use udelay() instead, even if we are x86 only - Jean II */
 static void iodelay(int udelay)
@@ -424,7 +424,7 @@ static int via_ircc_open(struct pci_dev *pdev, chipio_t * info,
  *    Close driver instance
  *
  */
-static void __devexit via_remove_one(struct pci_dev *pdev)
+static void via_remove_one(struct pci_dev *pdev)
 {
 	struct via_ircc_cb *self = pci_get_drvdata(pdev);
 	int iobase;
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
index e255b65..2f99f88 100644
--- a/drivers/net/irda/vlsi_ir.c
+++ b/drivers/net/irda/vlsi_ir.c
@@ -1699,7 +1699,7 @@ out:
 	return -ENODEV;
 }
 
-static void __devexit vlsi_irda_remove(struct pci_dev *pdev)
+static void vlsi_irda_remove(struct pci_dev *pdev)
 {
 	struct net_device *ndev = pci_get_drvdata(pdev);
 	vlsi_irda_dev_t *idev;
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
index bf30b1d..6b2fdb8 100644
--- a/drivers/net/phy/mdio-gpio.c
+++ b/drivers/net/phy/mdio-gpio.c
@@ -173,7 +173,7 @@ static void mdio_gpio_bus_deinit(struct device *dev)
 	kfree(bitbang);
 }
 
-static void __devexit mdio_gpio_bus_destroy(struct device *dev)
+static void mdio_gpio_bus_destroy(struct device *dev)
 {
 	struct mii_bus *bus = dev_get_drvdata(dev);
 
@@ -210,7 +210,7 @@ static int mdio_gpio_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int __devexit mdio_gpio_remove(struct platform_device *pdev)
+static int mdio_gpio_remove(struct platform_device *pdev)
 {
 	mdio_gpio_bus_destroy(&pdev->dev);
 
diff --git a/drivers/net/phy/mdio-mux-gpio.c b/drivers/net/phy/mdio-mux-gpio.c
index 23ee064..0c9accb 100644
--- a/drivers/net/phy/mdio-mux-gpio.c
+++ b/drivers/net/phy/mdio-mux-gpio.c
@@ -104,7 +104,7 @@ err:
 	return r;
 }
 
-static int __devexit mdio_mux_gpio_remove(struct platform_device *pdev)
+static int mdio_mux_gpio_remove(struct platform_device *pdev)
 {
 	struct mdio_mux_gpio_state *s = pdev->dev.platform_data;
 	mdio_mux_uninit(s->mux_handle);
diff --git a/drivers/net/phy/mdio-mux-mmioreg.c b/drivers/net/phy/mdio-mux-mmioreg.c
index a38951f..9733bd2 100644
--- a/drivers/net/phy/mdio-mux-mmioreg.c
+++ b/drivers/net/phy/mdio-mux-mmioreg.c
@@ -137,7 +137,7 @@ static int mdio_mux_mmioreg_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __devexit mdio_mux_mmioreg_remove(struct platform_device *pdev)
+static int mdio_mux_mmioreg_remove(struct platform_device *pdev)
 {
 	struct mdio_mux_mmioreg_state *s = dev_get_platdata(&pdev->dev);
 
diff --git a/drivers/net/phy/mdio-octeon.c b/drivers/net/phy/mdio-octeon.c
index 7a07985..09297fe 100644
--- a/drivers/net/phy/mdio-octeon.c
+++ b/drivers/net/phy/mdio-octeon.c
@@ -159,7 +159,7 @@ fail:
 	return err;
 }
 
-static int __devexit octeon_mdiobus_remove(struct platform_device *pdev)
+static int octeon_mdiobus_remove(struct platform_device *pdev)
 {
 	struct octeon_mdiobus *bus;
 	union cvmx_smix_en smi_en;
diff --git a/drivers/net/phy/spi_ks8995.c b/drivers/net/phy/spi_ks8995.c
index 1321c99..41eb8ff 100644
--- a/drivers/net/phy/spi_ks8995.c
+++ b/drivers/net/phy/spi_ks8995.c
@@ -332,7 +332,7 @@ err_drvdata:
 	return err;
 }
 
-static int __devexit ks8995_remove(struct spi_device *spi)
+static int ks8995_remove(struct spi_device *spi)
 {
 	struct ks8995_data      *ks8995;
 
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index b0c1630..c5f0ed2 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1195,7 +1195,7 @@ static void remove_vq_common(struct virtnet_info *vi)
 		__free_pages(get_a_page(vi, GFP_KERNEL), 0);
 }
 
-static void __devexit virtnet_remove(struct virtio_device *vdev)
+static void virtnet_remove(struct virtio_device *vdev)
 {
 	struct virtnet_info *vi = vdev->priv;
 
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index ac322e5..71b762f 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -3096,7 +3096,7 @@ err_alloc_shared:
 }
 
 
-static void __devexit
+static void
 vmxnet3_remove_device(struct pci_dev *pdev)
 {
 	struct net_device *netdev = pci_get_drvdata(pdev);
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index 863df17..d502230 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -1968,7 +1968,7 @@ err_out:
 	return -ENOMEM;
 }
 
-static void __devexit dscc4_remove_one(struct pci_dev *pdev)
+static void dscc4_remove_one(struct pci_dev *pdev)
 {
 	struct dscc4_pci_priv *ppriv;
 	struct dscc4_dev_priv *root;
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index dbbe06e..d7adba4 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -2615,7 +2615,7 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 /*
  *      Cleanup and close down a card
  */
-static void __devexit
+static void
 fst_remove_one(struct pci_dev *pdev)
 {
 	struct fst_card_info *card;
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
index beecbe8..b056691 100644
--- a/drivers/net/wan/ixp4xx_hss.c
+++ b/drivers/net/wan/ixp4xx_hss.c
@@ -1375,7 +1375,7 @@ err_free:
 	return err;
 }
 
-static int __devexit hss_remove_one(struct platform_device *pdev)
+static int hss_remove_one(struct platform_device *pdev)
 {
 	struct port *port = platform_get_drvdata(pdev);
 
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index 41a401a..0e443fd 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -986,7 +986,7 @@ err_req_io:
 /*
  * Called from pci when removing module.
  */
-static void __devexit lmc_remove_one(struct pci_dev *pdev)
+static void lmc_remove_one(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index bd89a29..3d339e0 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -1935,7 +1935,7 @@ static int adm8211_probe(struct pci_dev *pdev,
 }
 
 
-static void __devexit adm8211_remove(struct pci_dev *pdev)
+static void adm8211_remove(struct pci_dev *pdev)
 {
 	struct ieee80211_hw *dev = pci_get_drvdata(pdev);
 	struct adm8211_priv *priv;
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index b010f41..5329541 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -5606,7 +5606,7 @@ static int airo_pci_probe(struct pci_dev *pdev,
 	return 0;
 }
 
-static void __devexit airo_pci_remove(struct pci_dev *pdev)
+static void airo_pci_remove(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 
diff --git a/drivers/net/wireless/ath/ath5k/pci.c b/drivers/net/wireless/ath/ath5k/pci.c
index 1a78ba3..859db7c 100644
--- a/drivers/net/wireless/ath/ath5k/pci.c
+++ b/drivers/net/wireless/ath/ath5k/pci.c
@@ -285,7 +285,7 @@ err:
 	return ret;
 }
 
-static void __devexit
+static void
 ath5k_pci_remove(struct pci_dev *pdev)
 {
 	struct ieee80211_hw *hw = pci_get_drvdata(pdev);
diff --git a/drivers/net/wireless/atmel_pci.c b/drivers/net/wireless/atmel_pci.c
index 1c12fec..c1b159e 100644
--- a/drivers/net/wireless/atmel_pci.c
+++ b/drivers/net/wireless/atmel_pci.c
@@ -69,7 +69,7 @@ static int atmel_pci_probe(struct pci_dev *pdev,
 	return 0;
 }
 
-static void __devexit atmel_pci_remove(struct pci_dev *pdev)
+static void atmel_pci_remove(struct pci_dev *pdev)
 {
 	stop_atmel_card(pci_get_drvdata(pdev));
 }
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c
index 3506cca..f2ea2ce 100644
--- a/drivers/net/wireless/b43/pcmcia.c
+++ b/drivers/net/wireless/b43/pcmcia.c
@@ -110,7 +110,7 @@ out_error:
 	return err;
 }
 
-static void __devexit b43_pcmcia_remove(struct pcmcia_device *dev)
+static void b43_pcmcia_remove(struct pcmcia_device *dev)
 {
 	struct ssb_bus *ssb = dev->priv;
 
diff --git a/drivers/net/wireless/b43/sdio.c b/drivers/net/wireless/b43/sdio.c
index d2b1f98..59a5218 100644
--- a/drivers/net/wireless/b43/sdio.c
+++ b/drivers/net/wireless/b43/sdio.c
@@ -171,7 +171,7 @@ out:
 	return error;
 }
 
-static void __devexit b43_sdio_remove(struct sdio_func *func)
+static void b43_sdio_remove(struct sdio_func *func)
 {
 	struct b43_sdio *sdio = sdio_get_drvdata(func);
 
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index b96c615..7588484 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -6413,7 +6413,7 @@ out:
 	goto out;
 }
 
-static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev)
+static void ipw2100_pci_remove_one(struct pci_dev *pci_dev)
 {
 	struct ipw2100_priv *priv = pci_get_drvdata(pci_dev);
 	struct net_device *dev = priv->net_dev;
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 3f099a6..941c6b5 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -11895,7 +11895,7 @@ static int ipw_pci_probe(struct pci_dev *pdev,
 	return err;
 }
 
-static void __devexit ipw_pci_remove(struct pci_dev *pdev)
+static void ipw_pci_remove(struct pci_dev *pdev)
 {
 	struct ipw_priv *priv = pci_get_drvdata(pdev);
 	struct list_head *p, *q;
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index 88fdd39..d604b40 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -3794,7 +3794,7 @@ out:
 	return err;
 }
 
-static void __devexit
+static void
 il3945_pci_remove(struct pci_dev *pdev)
 {
 	struct il_priv *il = pci_get_drvdata(pdev);
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 14e0a94..569e1ae5 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -6664,7 +6664,7 @@ out:
 	return err;
 }
 
-static void __devexit
+static void
 il4965_pci_remove(struct pci_dev *pdev)
 {
 	struct il_priv *il = pci_get_drvdata(pdev);
diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c
index 7cb27af..1f21d60 100644
--- a/drivers/net/wireless/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/iwlwifi/pcie/drv.c
@@ -294,7 +294,7 @@ out_free_trans:
 	return -EFAULT;
 }
 
-static void __devexit iwl_pci_remove(struct pci_dev *pdev)
+static void iwl_pci_remove(struct pci_dev *pdev)
 {
 	struct iwl_trans *trans = pci_get_drvdata(pdev);
 	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index abc32e3..4bb6574 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -1226,7 +1226,7 @@ out:
 	return err;
 }
 
-static int __devexit libertas_spi_remove(struct spi_device *spi)
+static int libertas_spi_remove(struct spi_device *spi)
 {
 	struct if_spi_card *card = spi_get_drvdata(spi);
 	struct lbs_private *priv = card->priv;
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index b9f71fd..19cad01 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -5872,12 +5872,12 @@ err_disable_device:
 	return rc;
 }
 
-static void __devexit mwl8k_shutdown(struct pci_dev *pdev)
+static void mwl8k_shutdown(struct pci_dev *pdev)
 {
 	printk(KERN_ERR "===>%s(%u)\n", __func__, __LINE__);
 }
 
-static void __devexit mwl8k_remove(struct pci_dev *pdev)
+static void mwl8k_remove(struct pci_dev *pdev)
 {
 	struct ieee80211_hw *hw = pci_get_drvdata(pdev);
 	struct mwl8k_priv *priv;
diff --git a/drivers/net/wireless/orinoco/orinoco_nortel.c b/drivers/net/wireless/orinoco/orinoco_nortel.c
index f286540..d73fdf6 100644
--- a/drivers/net/wireless/orinoco/orinoco_nortel.c
+++ b/drivers/net/wireless/orinoco/orinoco_nortel.c
@@ -255,7 +255,7 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev,
 	return err;
 }
 
-static void __devexit orinoco_nortel_remove_one(struct pci_dev *pdev)
+static void orinoco_nortel_remove_one(struct pci_dev *pdev)
 {
 	struct orinoco_private *priv = pci_get_drvdata(pdev);
 	struct orinoco_pci_card *card = priv->card;
diff --git a/drivers/net/wireless/orinoco/orinoco_pci.c b/drivers/net/wireless/orinoco/orinoco_pci.c
index bf6d436..677bf14 100644
--- a/drivers/net/wireless/orinoco/orinoco_pci.c
+++ b/drivers/net/wireless/orinoco/orinoco_pci.c
@@ -199,7 +199,7 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
 	return err;
 }
 
-static void __devexit orinoco_pci_remove_one(struct pci_dev *pdev)
+static void orinoco_pci_remove_one(struct pci_dev *pdev)
 {
 	struct orinoco_private *priv = pci_get_drvdata(pdev);
 
diff --git a/drivers/net/wireless/orinoco/orinoco_plx.c b/drivers/net/wireless/orinoco/orinoco_plx.c
index 63a614f..2559dbd 100644
--- a/drivers/net/wireless/orinoco/orinoco_plx.c
+++ b/drivers/net/wireless/orinoco/orinoco_plx.c
@@ -294,7 +294,7 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
 	return err;
 }
 
-static void __devexit orinoco_plx_remove_one(struct pci_dev *pdev)
+static void orinoco_plx_remove_one(struct pci_dev *pdev)
 {
 	struct orinoco_private *priv = pci_get_drvdata(pdev);
 	struct orinoco_pci_card *card = priv->card;
diff --git a/drivers/net/wireless/orinoco/orinoco_tmd.c b/drivers/net/wireless/orinoco/orinoco_tmd.c
index f67f43e..42afeee 100644
--- a/drivers/net/wireless/orinoco/orinoco_tmd.c
+++ b/drivers/net/wireless/orinoco/orinoco_tmd.c
@@ -188,7 +188,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
 	return err;
 }
 
-static void __devexit orinoco_tmd_remove_one(struct pci_dev *pdev)
+static void orinoco_tmd_remove_one(struct pci_dev *pdev)
 {
 	struct orinoco_private *priv = pci_get_drvdata(pdev);
 	struct orinoco_pci_card *card = priv->card;
diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c
index e5b29e9..04eb0ed 100644
--- a/drivers/net/wireless/p54/p54pci.c
+++ b/drivers/net/wireless/p54/p54pci.c
@@ -639,7 +639,7 @@ static int p54p_probe(struct pci_dev *pdev,
 	return err;
 }
 
-static void __devexit p54p_remove(struct pci_dev *pdev)
+static void p54p_remove(struct pci_dev *pdev)
 {
 	struct ieee80211_hw *dev = pci_get_drvdata(pdev);
 	struct p54p_priv *priv;
diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
index d75ab3e..4fd49a0 100644
--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -683,7 +683,7 @@ err_free:
 	return ret;
 }
 
-static int __devexit p54spi_remove(struct spi_device *spi)
+static int p54spi_remove(struct spi_device *spi)
 {
 	struct p54s_priv *priv = dev_get_drvdata(&spi->dev);
 
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index 000f7ba..e71c702 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -1057,7 +1057,7 @@ static int p54u_probe(struct usb_interface *intf,
 	return err;
 }
 
-static void __devexit p54u_disconnect(struct usb_interface *intf)
+static void p54u_disconnect(struct usb_interface *intf)
 {
 	struct ieee80211_hw *dev = usb_get_intfdata(intf);
 	struct p54u_priv *priv;
diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c
index 6a5c0b8..4af3f91 100644
--- a/drivers/net/wireless/rtl818x/rtl8180/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c
@@ -1131,7 +1131,7 @@ static int rtl8180_probe(struct pci_dev *pdev,
 	return err;
 }
 
-static void __devexit rtl8180_remove(struct pci_dev *pdev)
+static void rtl8180_remove(struct pci_dev *pdev)
 {
 	struct ieee80211_hw *dev = pci_get_drvdata(pdev);
 	struct rtl8180_priv *priv;
diff --git a/drivers/net/wireless/rtl818x/rtl8187/dev.c b/drivers/net/wireless/rtl818x/rtl8187/dev.c
index f879bc3..be36935 100644
--- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
@@ -1639,7 +1639,7 @@ static int rtl8187_probe(struct usb_interface *intf,
 	return err;
 }
 
-static void __devexit rtl8187_disconnect(struct usb_interface *intf)
+static void rtl8187_disconnect(struct usb_interface *intf)
 {
 	struct ieee80211_hw *dev = usb_get_intfdata(intf);
 	struct rtl8187_priv *priv;
diff --git a/drivers/net/wireless/ti/wl1251/sdio.c b/drivers/net/wireless/ti/wl1251/sdio.c
index e3f287f..e57ee48 100644
--- a/drivers/net/wireless/ti/wl1251/sdio.c
+++ b/drivers/net/wireless/ti/wl1251/sdio.c
@@ -305,7 +305,7 @@ out_free_hw:
 	return ret;
 }
 
-static void __devexit wl1251_sdio_remove(struct sdio_func *func)
+static void wl1251_sdio_remove(struct sdio_func *func)
 {
 	struct wl1251 *wl = sdio_get_drvdata(func);
 	struct wl1251_sdio *wl_sdio = wl->if_priv;
diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c
index 640a3d5..3b266d3 100644
--- a/drivers/net/wireless/ti/wl1251/spi.c
+++ b/drivers/net/wireless/ti/wl1251/spi.c
@@ -309,7 +309,7 @@ static int wl1251_spi_probe(struct spi_device *spi)
 	return ret;
 }
 
-static int __devexit wl1251_spi_remove(struct spi_device *spi)
+static int wl1251_spi_remove(struct spi_device *spi)
 {
 	struct wl1251 *wl = dev_get_drvdata(&spi->dev);
 
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 2dd4ada..dd38f61 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -5682,7 +5682,7 @@ int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev)
 }
 EXPORT_SYMBOL_GPL(wlcore_probe);
 
-int __devexit wlcore_remove(struct platform_device *pdev)
+int wlcore_remove(struct platform_device *pdev)
 {
 	struct wl1271 *wl = platform_get_drvdata(pdev);
 
diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index 7bf612c..646f703 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -319,7 +319,7 @@ out:
 	return ret;
 }
 
-static void __devexit wl1271_remove(struct sdio_func *func)
+static void wl1271_remove(struct sdio_func *func)
 {
 	struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func);
 
diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
index ee39484..f06f477 100644
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@ -403,7 +403,7 @@ out:
 	return ret;
 }
 
-static int __devexit wl1271_remove(struct spi_device *spi)
+static int wl1271_remove(struct spi_device *spi)
 {
 	struct wl12xx_spi_glue *glue = spi_get_drvdata(spi);
 
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
index adc6152..c388493 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -415,7 +415,7 @@ struct wl1271 {
 };
 
 int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);
-int __devexit wlcore_remove(struct platform_device *pdev);
+int wlcore_remove(struct platform_device *pdev);
 struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size);
 int wlcore_free_hw(struct wl1271 *wl);
 int wlcore_set_key(struct wl1271 *wl, enum set_key_cmd cmd,
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 6f695fc..b31198c 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1911,7 +1911,7 @@ static const struct xenbus_device_id netfront_ids[] = {
 };
 
 
-static int __devexit xennet_remove(struct xenbus_device *dev)
+static int xennet_remove(struct xenbus_device *dev)
 {
 	struct netfront_info *info = dev_get_drvdata(&dev->dev);
 
-- 
1.8.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 19:24:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 19:24:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaWxI-0002Y6-5w; Mon, 19 Nov 2012 19:24:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaWxH-0002Y1-98
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 19:24:27 +0000
Received: from [85.158.139.211:19569] by server-2.bemta-5.messagelabs.com id
	E5/1D-04892-A678AA05; Mon, 19 Nov 2012 19:24:26 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1353353064!20803753!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31318 invoked from network); 19 Nov 2012 19:24:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 19:24:24 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15888614"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 19:24:24 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 19:24:24 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TaWxE-0001d3-2L;
	Mon, 19 Nov 2012 19:24:24 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TaWxD-00016m-Sk;
	Mon, 19 Nov 2012 19:24:23 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14421-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 19 Nov 2012 19:24:23 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14421: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14421 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14421/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-i386                    4 xen-build                 fail REGR. vs. 14416
 build-i386-oldkern            4 xen-build                 fail REGR. vs. 14416
 build-amd64                   4 xen-build                 fail REGR. vs. 14416
 build-amd64-oldkern           4 xen-build                 fail REGR. vs. 14416

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a

version targeted for testing:
 xen                  fe8034159ac2
baseline version:
 xen                  321f8487379b

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Wei Wang <wei.wang2@amd.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  fail    
 build-i386                                                   fail    
 build-amd64-oldkern                                          fail    
 build-i386-oldkern                                           fail    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26177:fe8034159ac2
tag:         tip
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:35 2012 +0000
    
    docs: Include prototype for HYPERVISOR_multicall
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26176:edad24bfa561
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:34 2012 +0000
    
    docs: Document HYPERVISOR_update_descriptor
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26175:b1d36147ac96
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Add ToC entry for start of day memory layout.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26174:dbb8d24bb5ad
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Document HYPERVISOR_mmuext_op
    
    Mark-up for inclusion of generated docs.
    
    Remove some trailing whitespace.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26173:26facad2f1a1
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:32 2012 +0000
    
    docs: document HYPERVISOR_update_va_mapping(_other_domain)
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26172:cfd2772cc717
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:31 2012 +0000
    
    docs: document/mark-up SCHEDOP_*
    
    The biggest subtlety here is there additional argument when op ==
    SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
    xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
    
    This patch moves some structs around but there is no functional change
    other than improved documentation.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26171:31668da0c4d3
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 15:15:12 2012 +0100
    
    AMD IOMMU: fix type of "bdf" parameter of update_intremap_entry_from_msi_msg()
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26170:380ad94f2adc
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:51 2012 +0000
    
    Remove tools/vtpm* from MAINTAINERS file
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26169:5a6225e40388
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:50 2012 +0000
    
    tools: Remove old vtpm stuff from tools/libxen
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26168:3dc18d679d04
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:49 2012 +0000
    
    Remove VTPM_TOOLS from config/Tools.mk.in
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26167:31dcc0e08754
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    xend: Remove old vtpm support from xm
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26166:d026f8abca51
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    minios: Update mini-os license to support GPL features
    
    This patch updates extras/mini-os/COPYING to explain
    which optional features are GPL and what the implications
    of enabling them are.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26165:42a7c393c390
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:47 2012 +0000
    
    minios: fix bug in lseek for mini-os
    
    lseek always used files[fd].file.offset. It should
    use the offset of whatever union member is actually
    being used.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26164:17539cec2b9d
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: get the number of cpus from device tree
    
    The system might have fewer cpus than the GIC supports.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26163:ddb109120dbd
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: flush D-cache and I-cache when appropriate
    
    - invalidate tlb after setting WXN
    - flush D-cache and I-cache after relocation;
    - invalidate D-cache after writing to smp_up_cpu;
    - flush I-cache after changing HTTBR;
    - flush I-cache and branch predictor after writing Xen text ptes.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26162:9da9781cc3fb
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 09:48:22 2012 +0100
    
    vscsiif: minor cleanup
    
    Remove a definition not belonging into the interface, and correct a
    few typos in comments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26161:9025a10c0561
user:        Wei Wang <wei.wang2@amd.com>
date:        Mon Nov 19 09:46:46 2012 +0100
    
    AMD IOMMU: Enable HPET broadcast msi remapping
    
    This patch enables hpet msi remapping for amd iommu.
    
    Signed-off-by: Wei Wang <wei.wang2@amd.com>
    
    - use the existing ACPI_IVHD_* #define-s
    - warn on finding more than one IVHD HPET entry
    - consolidate parameters of update_intremap_entry_from_msi_msg()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Committed-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26160:321f8487379b
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:29 2012 +0000
    
    xen/arm: wake up secondary cpus
    
    Secondary cpus are held by the firmware until we send an IPI to them.
    
    Reordered non-boot cpu wait loop to perform the check before waiting
    for an event, to handled the case where the event has already
    happened when we reach the loop.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 19:24:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 19:24:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaWxI-0002Y6-5w; Mon, 19 Nov 2012 19:24:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaWxH-0002Y1-98
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 19:24:27 +0000
Received: from [85.158.139.211:19569] by server-2.bemta-5.messagelabs.com id
	E5/1D-04892-A678AA05; Mon, 19 Nov 2012 19:24:26 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1353353064!20803753!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31318 invoked from network); 19 Nov 2012 19:24:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 19:24:24 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15888614"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 19:24:24 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 19:24:24 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TaWxE-0001d3-2L;
	Mon, 19 Nov 2012 19:24:24 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TaWxD-00016m-Sk;
	Mon, 19 Nov 2012 19:24:23 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14421-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 19 Nov 2012 19:24:23 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14421: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14421 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14421/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-i386                    4 xen-build                 fail REGR. vs. 14416
 build-i386-oldkern            4 xen-build                 fail REGR. vs. 14416
 build-amd64                   4 xen-build                 fail REGR. vs. 14416
 build-amd64-oldkern           4 xen-build                 fail REGR. vs. 14416

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a

version targeted for testing:
 xen                  fe8034159ac2
baseline version:
 xen                  321f8487379b

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Wei Wang <wei.wang2@amd.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  fail    
 build-i386                                                   fail    
 build-amd64-oldkern                                          fail    
 build-i386-oldkern                                           fail    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26177:fe8034159ac2
tag:         tip
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:35 2012 +0000
    
    docs: Include prototype for HYPERVISOR_multicall
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26176:edad24bfa561
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:34 2012 +0000
    
    docs: Document HYPERVISOR_update_descriptor
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26175:b1d36147ac96
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Add ToC entry for start of day memory layout.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26174:dbb8d24bb5ad
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Document HYPERVISOR_mmuext_op
    
    Mark-up for inclusion of generated docs.
    
    Remove some trailing whitespace.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26173:26facad2f1a1
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:32 2012 +0000
    
    docs: document HYPERVISOR_update_va_mapping(_other_domain)
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26172:cfd2772cc717
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:31 2012 +0000
    
    docs: document/mark-up SCHEDOP_*
    
    The biggest subtlety here is there additional argument when op ==
    SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
    xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
    
    This patch moves some structs around but there is no functional change
    other than improved documentation.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26171:31668da0c4d3
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 15:15:12 2012 +0100
    
    AMD IOMMU: fix type of "bdf" parameter of update_intremap_entry_from_msi_msg()
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26170:380ad94f2adc
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:51 2012 +0000
    
    Remove tools/vtpm* from MAINTAINERS file
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26169:5a6225e40388
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:50 2012 +0000
    
    tools: Remove old vtpm stuff from tools/libxen
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26168:3dc18d679d04
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:49 2012 +0000
    
    Remove VTPM_TOOLS from config/Tools.mk.in
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26167:31dcc0e08754
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    xend: Remove old vtpm support from xm
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26166:d026f8abca51
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    minios: Update mini-os license to support GPL features
    
    This patch updates extras/mini-os/COPYING to explain
    which optional features are GPL and what the implications
    of enabling them are.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26165:42a7c393c390
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:47 2012 +0000
    
    minios: fix bug in lseek for mini-os
    
    lseek always used files[fd].file.offset. It should
    use the offset of whatever union member is actually
    being used.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26164:17539cec2b9d
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: get the number of cpus from device tree
    
    The system might have fewer cpus than the GIC supports.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26163:ddb109120dbd
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: flush D-cache and I-cache when appropriate
    
    - invalidate tlb after setting WXN
    - flush D-cache and I-cache after relocation;
    - invalidate D-cache after writing to smp_up_cpu;
    - flush I-cache after changing HTTBR;
    - flush I-cache and branch predictor after writing Xen text ptes.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26162:9da9781cc3fb
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 09:48:22 2012 +0100
    
    vscsiif: minor cleanup
    
    Remove a definition not belonging into the interface, and correct a
    few typos in comments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26161:9025a10c0561
user:        Wei Wang <wei.wang2@amd.com>
date:        Mon Nov 19 09:46:46 2012 +0100
    
    AMD IOMMU: Enable HPET broadcast msi remapping
    
    This patch enables hpet msi remapping for amd iommu.
    
    Signed-off-by: Wei Wang <wei.wang2@amd.com>
    
    - use the existing ACPI_IVHD_* #define-s
    - warn on finding more than one IVHD HPET entry
    - consolidate parameters of update_intremap_entry_from_msi_msg()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Committed-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26160:321f8487379b
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:29 2012 +0000
    
    xen/arm: wake up secondary cpus
    
    Secondary cpus are held by the firmware until we send an IPI to them.
    
    Reordered non-boot cpu wait loop to perform the check before waiting
    for an event, to handled the case where the event has already
    happened when we reach the loop.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 19:32:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 19:32:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaX4p-0002jv-6y; Mon, 19 Nov 2012 19:32:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TaX4n-0002jq-Rq
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 19:32:14 +0000
Received: from [85.158.143.35:12755] by server-1.bemta-4.messagelabs.com id
	1E/2D-27934-D398AA05; Mon, 19 Nov 2012 19:32:13 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1353353530!15873903!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ2Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25000 invoked from network); 19 Nov 2012 19:32:11 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 19:32:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="45076683"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 19:30:48 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 14:30:48 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TaX3P-0003Fw-Kc;
	Mon, 19 Nov 2012 19:30:47 +0000
Message-ID: <50AA88E7.4030402@citrix.com>
Date: Mon, 19 Nov 2012 19:30:47 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel@lists.xen.org, Ian Campbell <ian.campbell@citrix.com>
References: <osstest-14421-mainreport@xen.org>
In-Reply-To: <osstest-14421-mainreport@xen.org>
X-Enigmail-Version: 1.4.6
Subject: Re: [Xen-devel] [xen-unstable test] 14421: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 19/11/12 19:24, xen.org wrote:
> flight 14421 xen-unstable real [real]
> http://www.chiark.greenend.org.uk/~xensrcts/logs/14421/
>
> Regressions :-(

Build failure caused by the first hunk of
http://xenbits.xen.org/hg/staging/xen-unstable.hg/rev/26facad2f1a1 which
introduced one open-comment and two close-comments.


>
> Tests which did not succeed and are blocking,
> including tests which could not be run:
>  build-i386                    4 xen-build                 fail REGR. vs. 14416
>  build-i386-oldkern            4 xen-build                 fail REGR. vs. 14416
>  build-amd64                   4 xen-build                 fail REGR. vs. 14416
>  build-amd64-oldkern           4 xen-build                 fail REGR. vs. 14416
>
> Tests which did not succeed, but are not blocking:
>  test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
>  test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
>  test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
>  test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
>  test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
>  test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
>  test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
>  test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
>  test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
>  test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
>  test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
>  test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
>  test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
>  test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a
>
> version targeted for testing:
>  xen                  fe8034159ac2
> baseline version:
>  xen                  321f8487379b
>
> ------------------------------------------------------------
> People who touched revisions under test:
>   Ian Campbell <ian.campbell@citrix.com>
>   Ian Jackson <ian.jackson@eu.citrix.com>
>   Jan Beulich <jbeulich@suse.com>
>   Keir Fraser <keir@xen.org>
>   Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>   Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>   Wei Wang <wei.wang2@amd.com>
> ------------------------------------------------------------
>
> jobs:
>  build-amd64                                                  fail
>  build-i386                                                   fail
>  build-amd64-oldkern                                          fail
>  build-i386-oldkern                                           fail
>  build-amd64-pvops                                            pass
>  build-i386-pvops                                             pass
>  test-amd64-amd64-xl                                          blocked
>  test-amd64-i386-xl                                           blocked
>  test-amd64-i386-rhel6hvm-amd                                 blocked
>  test-amd64-i386-qemuu-rhel6hvm-amd                           blocked
>  test-amd64-amd64-xl-qemuu-win7-amd64                         blocked
>  test-amd64-amd64-xl-win7-amd64                               blocked
>  test-amd64-i386-xl-win7-amd64                                blocked
>  test-amd64-i386-xl-credit2                                   blocked
>  test-amd64-amd64-xl-pcipt-intel                              blocked
>  test-amd64-i386-rhel6hvm-intel                               blocked
>  test-amd64-i386-qemuu-rhel6hvm-intel                         blocked
>  test-amd64-i386-xl-multivcpu                                 blocked
>  test-amd64-amd64-pair                                        blocked
>  test-amd64-i386-pair                                         blocked
>  test-amd64-amd64-xl-sedf-pin                                 blocked
>  test-amd64-amd64-pv                                          blocked
>  test-amd64-i386-pv                                           blocked
>  test-amd64-amd64-xl-sedf                                     blocked
>  test-amd64-i386-win-vcpus1                                   blocked
>  test-amd64-i386-xl-win-vcpus1                                blocked
>  test-amd64-i386-xl-winxpsp3-vcpus1                           blocked
>  test-amd64-amd64-win                                         blocked
>  test-amd64-i386-win                                          blocked
>  test-amd64-amd64-xl-win                                      blocked
>  test-amd64-amd64-xl-qemuu-winxpsp3                           blocked
>  test-amd64-i386-xend-winxpsp3                                blocked
>  test-amd64-amd64-xl-winxpsp3                                 blocked
>
>
> ------------------------------------------------------------
> sg-report-flight on woking.cam.xci-test.com
> logs: /home/xc_osstest/logs
> images: /home/xc_osstest/images
>
> Logs, config files, etc. are available at
>     http://www.chiark.greenend.org.uk/~xensrcts/logs
>
> Test harness code can be found at
>     http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary
>
>
> Not pushing.
>
> ------------------------------------------------------------
> changeset:   26177:fe8034159ac2
> tag:         tip
> user:        Ian Campbell <ian.campbell@citrix.com>
> date:        Mon Nov 19 14:25:35 2012 +0000
>
>     docs: Include prototype for HYPERVISOR_multicall
>
>     Mark-up for inclusion of generated docs.
>
>     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26176:edad24bfa561
> user:        Ian Campbell <ian.campbell@citrix.com>
> date:        Mon Nov 19 14:25:34 2012 +0000
>
>     docs: Document HYPERVISOR_update_descriptor
>
>     Mark-up for inclusion of generated docs.
>
>     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26175:b1d36147ac96
> user:        Ian Campbell <ian.campbell@citrix.com>
> date:        Mon Nov 19 14:25:33 2012 +0000
>
>     docs: Add ToC entry for start of day memory layout.
>
>     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26174:dbb8d24bb5ad
> user:        Ian Campbell <ian.campbell@citrix.com>
> date:        Mon Nov 19 14:25:33 2012 +0000
>
>     docs: Document HYPERVISOR_mmuext_op
>
>     Mark-up for inclusion of generated docs.
>
>     Remove some trailing whitespace.
>
>     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26173:26facad2f1a1
> user:        Ian Campbell <ian.campbell@citrix.com>
> date:        Mon Nov 19 14:25:32 2012 +0000
>
>     docs: document HYPERVISOR_update_va_mapping(_other_domain)
>
>     Mark-up for inclusion of generated docs.
>
>     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26172:cfd2772cc717
> user:        Ian Campbell <ian.campbell@citrix.com>
> date:        Mon Nov 19 14:25:31 2012 +0000
>
>     docs: document/mark-up SCHEDOP_*
>
>     The biggest subtlety here is there additional argument when op ==
>     SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
>     xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
>
>     This patch moves some structs around but there is no functional change
>     other than improved documentation.
>
>     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26171:31668da0c4d3
> user:        Jan Beulich <jbeulich@suse.com>
> date:        Mon Nov 19 15:15:12 2012 +0100
>
>     AMD IOMMU: fix type of "bdf" parameter of update_intremap_entry_from_msi_msg()
>
>     Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
>     Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
>
> changeset:   26170:380ad94f2adc
> user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> date:        Mon Nov 19 12:59:51 2012 +0000
>
>     Remove tools/vtpm* from MAINTAINERS file
>
>     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>     Acked-by: Ian Campbell <ian.campbell@citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26169:5a6225e40388
> user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> date:        Mon Nov 19 12:59:50 2012 +0000
>
>     tools: Remove old vtpm stuff from tools/libxen
>
>     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>     Acked-by: Ian Campbell <ian.campbell@citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26168:3dc18d679d04
> user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> date:        Mon Nov 19 12:59:49 2012 +0000
>
>     Remove VTPM_TOOLS from config/Tools.mk.in
>
>     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>     Acked-by: Ian Campbell <ian.campbell@citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26167:31dcc0e08754
> user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> date:        Mon Nov 19 12:59:48 2012 +0000
>
>     xend: Remove old vtpm support from xm
>
>     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>     Acked-by: Ian Campbell <ian.campbell@citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26166:d026f8abca51
> user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> date:        Mon Nov 19 12:59:48 2012 +0000
>
>     minios: Update mini-os license to support GPL features
>
>     This patch updates extras/mini-os/COPYING to explain
>     which optional features are GPL and what the implications
>     of enabling them are.
>
>     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>     Acked-by: Ian Campbell <ian.campbell@citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26165:42a7c393c390
> user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> date:        Mon Nov 19 12:59:47 2012 +0000
>
>     minios: fix bug in lseek for mini-os
>
>     lseek always used files[fd].file.offset. It should
>     use the offset of whatever union member is actually
>     being used.
>
>     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>     Acked-by: Ian Campbell <ian.campbell@citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26164:17539cec2b9d
> user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> date:        Mon Nov 19 12:59:46 2012 +0000
>
>     xen/arm: get the number of cpus from device tree
>
>     The system might have fewer cpus than the GIC supports.
>
>     Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>     Acked-by: Ian Campbell <ian.campbell@citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26163:ddb109120dbd
> user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> date:        Mon Nov 19 12:59:46 2012 +0000
>
>     xen/arm: flush D-cache and I-cache when appropriate
>
>     - invalidate tlb after setting WXN
>     - flush D-cache and I-cache after relocation;
>     - invalidate D-cache after writing to smp_up_cpu;
>     - flush I-cache after changing HTTBR;
>     - flush I-cache and branch predictor after writing Xen text ptes.
>
>     Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>     Acked-by: Ian Campbell <ian.campbell@citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26162:9da9781cc3fb
> user:        Jan Beulich <jbeulich@suse.com>
> date:        Mon Nov 19 09:48:22 2012 +0100
>
>     vscsiif: minor cleanup
>
>     Remove a definition not belonging into the interface, and correct a
>     few typos in comments.
>
>     Signed-off-by: Jan Beulich <jbeulich@suse.com>
>     Acked-by: Keir Fraser <keir@xen.org>
>
>
> changeset:   26161:9025a10c0561
> user:        Wei Wang <wei.wang2@amd.com>
> date:        Mon Nov 19 09:46:46 2012 +0100
>
>     AMD IOMMU: Enable HPET broadcast msi remapping
>
>     This patch enables hpet msi remapping for amd iommu.
>
>     Signed-off-by: Wei Wang <wei.wang2@amd.com>
>
>     - use the existing ACPI_IVHD_* #define-s
>     - warn on finding more than one IVHD HPET entry
>     - consolidate parameters of update_intremap_entry_from_msi_msg()
>
>     Signed-off-by: Jan Beulich <jbeulich@suse.com>
>     Committed-by: Jan Beulich <jbeulich@suse.com>
>
>
> changeset:   26160:321f8487379b
> user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> date:        Thu Nov 15 10:25:29 2012 +0000
>
>     xen/arm: wake up secondary cpus
>
>     Secondary cpus are held by the firmware until we send an IPI to them.
>
>     Reordered non-boot cpu wait loop to perform the check before waiting
>     for an event, to handled the case where the event has already
>     happened when we reach the loop.
>
>     Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>     Acked-by: Ian Campbell <ian.campbell@citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> (qemu changes not included)
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 19:32:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 19:32:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaX4p-0002jv-6y; Mon, 19 Nov 2012 19:32:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TaX4n-0002jq-Rq
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 19:32:14 +0000
Received: from [85.158.143.35:12755] by server-1.bemta-4.messagelabs.com id
	1E/2D-27934-D398AA05; Mon, 19 Nov 2012 19:32:13 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1353353530!15873903!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ2Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25000 invoked from network); 19 Nov 2012 19:32:11 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 19:32:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="45076683"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 19:30:48 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 14:30:48 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TaX3P-0003Fw-Kc;
	Mon, 19 Nov 2012 19:30:47 +0000
Message-ID: <50AA88E7.4030402@citrix.com>
Date: Mon, 19 Nov 2012 19:30:47 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel@lists.xen.org, Ian Campbell <ian.campbell@citrix.com>
References: <osstest-14421-mainreport@xen.org>
In-Reply-To: <osstest-14421-mainreport@xen.org>
X-Enigmail-Version: 1.4.6
Subject: Re: [Xen-devel] [xen-unstable test] 14421: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 19/11/12 19:24, xen.org wrote:
> flight 14421 xen-unstable real [real]
> http://www.chiark.greenend.org.uk/~xensrcts/logs/14421/
>
> Regressions :-(

Build failure caused by the first hunk of
http://xenbits.xen.org/hg/staging/xen-unstable.hg/rev/26facad2f1a1 which
introduced one open-comment and two close-comments.


>
> Tests which did not succeed and are blocking,
> including tests which could not be run:
>  build-i386                    4 xen-build                 fail REGR. vs. 14416
>  build-i386-oldkern            4 xen-build                 fail REGR. vs. 14416
>  build-amd64                   4 xen-build                 fail REGR. vs. 14416
>  build-amd64-oldkern           4 xen-build                 fail REGR. vs. 14416
>
> Tests which did not succeed, but are not blocking:
>  test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
>  test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
>  test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
>  test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
>  test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
>  test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
>  test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
>  test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
>  test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
>  test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
>  test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
>  test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
>  test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
>  test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
>  test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a
>
> version targeted for testing:
>  xen                  fe8034159ac2
> baseline version:
>  xen                  321f8487379b
>
> ------------------------------------------------------------
> People who touched revisions under test:
>   Ian Campbell <ian.campbell@citrix.com>
>   Ian Jackson <ian.jackson@eu.citrix.com>
>   Jan Beulich <jbeulich@suse.com>
>   Keir Fraser <keir@xen.org>
>   Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>   Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>   Wei Wang <wei.wang2@amd.com>
> ------------------------------------------------------------
>
> jobs:
>  build-amd64                                                  fail
>  build-i386                                                   fail
>  build-amd64-oldkern                                          fail
>  build-i386-oldkern                                           fail
>  build-amd64-pvops                                            pass
>  build-i386-pvops                                             pass
>  test-amd64-amd64-xl                                          blocked
>  test-amd64-i386-xl                                           blocked
>  test-amd64-i386-rhel6hvm-amd                                 blocked
>  test-amd64-i386-qemuu-rhel6hvm-amd                           blocked
>  test-amd64-amd64-xl-qemuu-win7-amd64                         blocked
>  test-amd64-amd64-xl-win7-amd64                               blocked
>  test-amd64-i386-xl-win7-amd64                                blocked
>  test-amd64-i386-xl-credit2                                   blocked
>  test-amd64-amd64-xl-pcipt-intel                              blocked
>  test-amd64-i386-rhel6hvm-intel                               blocked
>  test-amd64-i386-qemuu-rhel6hvm-intel                         blocked
>  test-amd64-i386-xl-multivcpu                                 blocked
>  test-amd64-amd64-pair                                        blocked
>  test-amd64-i386-pair                                         blocked
>  test-amd64-amd64-xl-sedf-pin                                 blocked
>  test-amd64-amd64-pv                                          blocked
>  test-amd64-i386-pv                                           blocked
>  test-amd64-amd64-xl-sedf                                     blocked
>  test-amd64-i386-win-vcpus1                                   blocked
>  test-amd64-i386-xl-win-vcpus1                                blocked
>  test-amd64-i386-xl-winxpsp3-vcpus1                           blocked
>  test-amd64-amd64-win                                         blocked
>  test-amd64-i386-win                                          blocked
>  test-amd64-amd64-xl-win                                      blocked
>  test-amd64-amd64-xl-qemuu-winxpsp3                           blocked
>  test-amd64-i386-xend-winxpsp3                                blocked
>  test-amd64-amd64-xl-winxpsp3                                 blocked
>
>
> ------------------------------------------------------------
> sg-report-flight on woking.cam.xci-test.com
> logs: /home/xc_osstest/logs
> images: /home/xc_osstest/images
>
> Logs, config files, etc. are available at
>     http://www.chiark.greenend.org.uk/~xensrcts/logs
>
> Test harness code can be found at
>     http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary
>
>
> Not pushing.
>
> ------------------------------------------------------------
> changeset:   26177:fe8034159ac2
> tag:         tip
> user:        Ian Campbell <ian.campbell@citrix.com>
> date:        Mon Nov 19 14:25:35 2012 +0000
>
>     docs: Include prototype for HYPERVISOR_multicall
>
>     Mark-up for inclusion of generated docs.
>
>     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26176:edad24bfa561
> user:        Ian Campbell <ian.campbell@citrix.com>
> date:        Mon Nov 19 14:25:34 2012 +0000
>
>     docs: Document HYPERVISOR_update_descriptor
>
>     Mark-up for inclusion of generated docs.
>
>     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26175:b1d36147ac96
> user:        Ian Campbell <ian.campbell@citrix.com>
> date:        Mon Nov 19 14:25:33 2012 +0000
>
>     docs: Add ToC entry for start of day memory layout.
>
>     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26174:dbb8d24bb5ad
> user:        Ian Campbell <ian.campbell@citrix.com>
> date:        Mon Nov 19 14:25:33 2012 +0000
>
>     docs: Document HYPERVISOR_mmuext_op
>
>     Mark-up for inclusion of generated docs.
>
>     Remove some trailing whitespace.
>
>     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26173:26facad2f1a1
> user:        Ian Campbell <ian.campbell@citrix.com>
> date:        Mon Nov 19 14:25:32 2012 +0000
>
>     docs: document HYPERVISOR_update_va_mapping(_other_domain)
>
>     Mark-up for inclusion of generated docs.
>
>     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26172:cfd2772cc717
> user:        Ian Campbell <ian.campbell@citrix.com>
> date:        Mon Nov 19 14:25:31 2012 +0000
>
>     docs: document/mark-up SCHEDOP_*
>
>     The biggest subtlety here is there additional argument when op ==
>     SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
>     xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
>
>     This patch moves some structs around but there is no functional change
>     other than improved documentation.
>
>     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26171:31668da0c4d3
> user:        Jan Beulich <jbeulich@suse.com>
> date:        Mon Nov 19 15:15:12 2012 +0100
>
>     AMD IOMMU: fix type of "bdf" parameter of update_intremap_entry_from_msi_msg()
>
>     Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
>     Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
>
> changeset:   26170:380ad94f2adc
> user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> date:        Mon Nov 19 12:59:51 2012 +0000
>
>     Remove tools/vtpm* from MAINTAINERS file
>
>     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>     Acked-by: Ian Campbell <ian.campbell@citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26169:5a6225e40388
> user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> date:        Mon Nov 19 12:59:50 2012 +0000
>
>     tools: Remove old vtpm stuff from tools/libxen
>
>     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>     Acked-by: Ian Campbell <ian.campbell@citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26168:3dc18d679d04
> user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> date:        Mon Nov 19 12:59:49 2012 +0000
>
>     Remove VTPM_TOOLS from config/Tools.mk.in
>
>     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>     Acked-by: Ian Campbell <ian.campbell@citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26167:31dcc0e08754
> user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> date:        Mon Nov 19 12:59:48 2012 +0000
>
>     xend: Remove old vtpm support from xm
>
>     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>     Acked-by: Ian Campbell <ian.campbell@citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26166:d026f8abca51
> user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> date:        Mon Nov 19 12:59:48 2012 +0000
>
>     minios: Update mini-os license to support GPL features
>
>     This patch updates extras/mini-os/COPYING to explain
>     which optional features are GPL and what the implications
>     of enabling them are.
>
>     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>     Acked-by: Ian Campbell <ian.campbell@citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26165:42a7c393c390
> user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> date:        Mon Nov 19 12:59:47 2012 +0000
>
>     minios: fix bug in lseek for mini-os
>
>     lseek always used files[fd].file.offset. It should
>     use the offset of whatever union member is actually
>     being used.
>
>     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>     Acked-by: Ian Campbell <ian.campbell@citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26164:17539cec2b9d
> user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> date:        Mon Nov 19 12:59:46 2012 +0000
>
>     xen/arm: get the number of cpus from device tree
>
>     The system might have fewer cpus than the GIC supports.
>
>     Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>     Acked-by: Ian Campbell <ian.campbell@citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26163:ddb109120dbd
> user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> date:        Mon Nov 19 12:59:46 2012 +0000
>
>     xen/arm: flush D-cache and I-cache when appropriate
>
>     - invalidate tlb after setting WXN
>     - flush D-cache and I-cache after relocation;
>     - invalidate D-cache after writing to smp_up_cpu;
>     - flush I-cache after changing HTTBR;
>     - flush I-cache and branch predictor after writing Xen text ptes.
>
>     Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>     Acked-by: Ian Campbell <ian.campbell@citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> changeset:   26162:9da9781cc3fb
> user:        Jan Beulich <jbeulich@suse.com>
> date:        Mon Nov 19 09:48:22 2012 +0100
>
>     vscsiif: minor cleanup
>
>     Remove a definition not belonging into the interface, and correct a
>     few typos in comments.
>
>     Signed-off-by: Jan Beulich <jbeulich@suse.com>
>     Acked-by: Keir Fraser <keir@xen.org>
>
>
> changeset:   26161:9025a10c0561
> user:        Wei Wang <wei.wang2@amd.com>
> date:        Mon Nov 19 09:46:46 2012 +0100
>
>     AMD IOMMU: Enable HPET broadcast msi remapping
>
>     This patch enables hpet msi remapping for amd iommu.
>
>     Signed-off-by: Wei Wang <wei.wang2@amd.com>
>
>     - use the existing ACPI_IVHD_* #define-s
>     - warn on finding more than one IVHD HPET entry
>     - consolidate parameters of update_intremap_entry_from_msi_msg()
>
>     Signed-off-by: Jan Beulich <jbeulich@suse.com>
>     Committed-by: Jan Beulich <jbeulich@suse.com>
>
>
> changeset:   26160:321f8487379b
> user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> date:        Thu Nov 15 10:25:29 2012 +0000
>
>     xen/arm: wake up secondary cpus
>
>     Secondary cpus are held by the firmware until we send an IPI to them.
>
>     Reordered non-boot cpu wait loop to perform the check before waiting
>     for an event, to handled the case where the event has already
>     happened when we reach the loop.
>
>     Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>     Acked-by: Ian Campbell <ian.campbell@citrix.com>
>     Committed-by: Ian Campbell <ian.campbell@citrix.com>
>
>
> (qemu changes not included)
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 19:57:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 19:57:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaXTG-0003Kv-7y; Mon, 19 Nov 2012 19:57:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaXTE-0003Kq-HZ
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 19:57:28 +0000
Received: from [85.158.139.211:51013] by server-1.bemta-5.messagelabs.com id
	A4/3D-05877-72F8AA05; Mon, 19 Nov 2012 19:57:27 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353355046!20733934!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29798 invoked from network); 19 Nov 2012 19:57:26 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 19:57:26 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15888907"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 19:57:25 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 19:57:25 +0000
Message-ID: <1353355044.26243.29.camel@dagon.hellion.org.uk>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Date: Mon, 19 Nov 2012 19:57:24 +0000
In-Reply-To: <50AA88E7.4030402@citrix.com>
References: <osstest-14421-mainreport@xen.org> <50AA88E7.4030402@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [xen-unstable test] 14421: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 19:30 +0000, Andrew Cooper wrote:
> On 19/11/12 19:24, xen.org wrote:
> > flight 14421 xen-unstable real [real]
> > http://www.chiark.greenend.org.uk/~xensrcts/logs/14421/
> >
> > Regressions :-(
> 
> Build failure caused by the first hunk of
> http://xenbits.xen.org/hg/staging/xen-unstable.hg/rev/26facad2f1a1 which
> introduced one open-comment and two close-comments.

So it does, I have pushed the fix below.

I must have somehow overlooked that my usual pre-commit test (which
includes a clean build) didn't actually run to completion. Sorry about
this.

Ian.

>From 602b24f9d77cd269a4f419a49d6e2f88d9f3d68e Mon Sep 17 00:00:00 2001
From: Ian Campbell <ian.campbell@citrix.com>
Date: Mon, 19 Nov 2012 19:53:22 +0000
Subject: [PATCH] xen: fix build failure due to extra closing comment

Added by 26173:26facad2f1a1

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/public/xen.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index bff9542..5593066 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -445,7 +445,6 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
  * ` @val: The new page table entry, must contain a machine address
  * ` @flags: Control TLB flushes
  */
-*/
 /* These are passed as 'flags' to update_va_mapping. They can be ORed. */
 /* When specifying UVMF_MULTI, also OR in a pointer to a CPU bitmap.   */
 /* UVMF_LOCAL is merely UVMF_MULTI with a NULL bitmap pointer.         */
-- 
1.7.2.5



> 
> 
> >
> > Tests which did not succeed and are blocking,
> > including tests which could not be run:
> >  build-i386                    4 xen-build                 fail REGR. vs. 14416
> >  build-i386-oldkern            4 xen-build                 fail REGR. vs. 14416
> >  build-amd64                   4 xen-build                 fail REGR. vs. 14416
> >  build-amd64-oldkern           4 xen-build                 fail REGR. vs. 14416
> >
> > Tests which did not succeed, but are not blocking:
> >  test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
> >  test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
> >  test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
> >  test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
> >  test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
> >  test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
> >  test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
> >  test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
> >  test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
> >  test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a
> >
> > version targeted for testing:
> >  xen                  fe8034159ac2
> > baseline version:
> >  xen                  321f8487379b
> >
> > ------------------------------------------------------------
> > People who touched revisions under test:
> >   Ian Campbell <ian.campbell@citrix.com>
> >   Ian Jackson <ian.jackson@eu.citrix.com>
> >   Jan Beulich <jbeulich@suse.com>
> >   Keir Fraser <keir@xen.org>
> >   Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> >   Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> >   Wei Wang <wei.wang2@amd.com>
> > ------------------------------------------------------------
> >
> > jobs:
> >  build-amd64                                                  fail
> >  build-i386                                                   fail
> >  build-amd64-oldkern                                          fail
> >  build-i386-oldkern                                           fail
> >  build-amd64-pvops                                            pass
> >  build-i386-pvops                                             pass
> >  test-amd64-amd64-xl                                          blocked
> >  test-amd64-i386-xl                                           blocked
> >  test-amd64-i386-rhel6hvm-amd                                 blocked
> >  test-amd64-i386-qemuu-rhel6hvm-amd                           blocked
> >  test-amd64-amd64-xl-qemuu-win7-amd64                         blocked
> >  test-amd64-amd64-xl-win7-amd64                               blocked
> >  test-amd64-i386-xl-win7-amd64                                blocked
> >  test-amd64-i386-xl-credit2                                   blocked
> >  test-amd64-amd64-xl-pcipt-intel                              blocked
> >  test-amd64-i386-rhel6hvm-intel                               blocked
> >  test-amd64-i386-qemuu-rhel6hvm-intel                         blocked
> >  test-amd64-i386-xl-multivcpu                                 blocked
> >  test-amd64-amd64-pair                                        blocked
> >  test-amd64-i386-pair                                         blocked
> >  test-amd64-amd64-xl-sedf-pin                                 blocked
> >  test-amd64-amd64-pv                                          blocked
> >  test-amd64-i386-pv                                           blocked
> >  test-amd64-amd64-xl-sedf                                     blocked
> >  test-amd64-i386-win-vcpus1                                   blocked
> >  test-amd64-i386-xl-win-vcpus1                                blocked
> >  test-amd64-i386-xl-winxpsp3-vcpus1                           blocked
> >  test-amd64-amd64-win                                         blocked
> >  test-amd64-i386-win                                          blocked
> >  test-amd64-amd64-xl-win                                      blocked
> >  test-amd64-amd64-xl-qemuu-winxpsp3                           blocked
> >  test-amd64-i386-xend-winxpsp3                                blocked
> >  test-amd64-amd64-xl-winxpsp3                                 blocked
> >
> >
> > ------------------------------------------------------------
> > sg-report-flight on woking.cam.xci-test.com
> > logs: /home/xc_osstest/logs
> > images: /home/xc_osstest/images
> >
> > Logs, config files, etc. are available at
> >     http://www.chiark.greenend.org.uk/~xensrcts/logs
> >
> > Test harness code can be found at
> >     http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary
> >
> >
> > Not pushing.
> >
> > ------------------------------------------------------------
> > changeset:   26177:fe8034159ac2
> > tag:         tip
> > user:        Ian Campbell <ian.campbell@citrix.com>
> > date:        Mon Nov 19 14:25:35 2012 +0000
> >
> >     docs: Include prototype for HYPERVISOR_multicall
> >
> >     Mark-up for inclusion of generated docs.
> >
> >     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26176:edad24bfa561
> > user:        Ian Campbell <ian.campbell@citrix.com>
> > date:        Mon Nov 19 14:25:34 2012 +0000
> >
> >     docs: Document HYPERVISOR_update_descriptor
> >
> >     Mark-up for inclusion of generated docs.
> >
> >     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26175:b1d36147ac96
> > user:        Ian Campbell <ian.campbell@citrix.com>
> > date:        Mon Nov 19 14:25:33 2012 +0000
> >
> >     docs: Add ToC entry for start of day memory layout.
> >
> >     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26174:dbb8d24bb5ad
> > user:        Ian Campbell <ian.campbell@citrix.com>
> > date:        Mon Nov 19 14:25:33 2012 +0000
> >
> >     docs: Document HYPERVISOR_mmuext_op
> >
> >     Mark-up for inclusion of generated docs.
> >
> >     Remove some trailing whitespace.
> >
> >     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26173:26facad2f1a1
> > user:        Ian Campbell <ian.campbell@citrix.com>
> > date:        Mon Nov 19 14:25:32 2012 +0000
> >
> >     docs: document HYPERVISOR_update_va_mapping(_other_domain)
> >
> >     Mark-up for inclusion of generated docs.
> >
> >     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26172:cfd2772cc717
> > user:        Ian Campbell <ian.campbell@citrix.com>
> > date:        Mon Nov 19 14:25:31 2012 +0000
> >
> >     docs: document/mark-up SCHEDOP_*
> >
> >     The biggest subtlety here is there additional argument when op ==
> >     SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
> >     xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
> >
> >     This patch moves some structs around but there is no functional change
> >     other than improved documentation.
> >
> >     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26171:31668da0c4d3
> > user:        Jan Beulich <jbeulich@suse.com>
> > date:        Mon Nov 19 15:15:12 2012 +0100
> >
> >     AMD IOMMU: fix type of "bdf" parameter of update_intremap_entry_from_msi_msg()
> >
> >     Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> >     Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >
> >
> > changeset:   26170:380ad94f2adc
> > user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> > date:        Mon Nov 19 12:59:51 2012 +0000
> >
> >     Remove tools/vtpm* from MAINTAINERS file
> >
> >     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> >     Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26169:5a6225e40388
> > user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> > date:        Mon Nov 19 12:59:50 2012 +0000
> >
> >     tools: Remove old vtpm stuff from tools/libxen
> >
> >     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> >     Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26168:3dc18d679d04
> > user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> > date:        Mon Nov 19 12:59:49 2012 +0000
> >
> >     Remove VTPM_TOOLS from config/Tools.mk.in
> >
> >     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> >     Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26167:31dcc0e08754
> > user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> > date:        Mon Nov 19 12:59:48 2012 +0000
> >
> >     xend: Remove old vtpm support from xm
> >
> >     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> >     Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26166:d026f8abca51
> > user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> > date:        Mon Nov 19 12:59:48 2012 +0000
> >
> >     minios: Update mini-os license to support GPL features
> >
> >     This patch updates extras/mini-os/COPYING to explain
> >     which optional features are GPL and what the implications
> >     of enabling them are.
> >
> >     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> >     Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26165:42a7c393c390
> > user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> > date:        Mon Nov 19 12:59:47 2012 +0000
> >
> >     minios: fix bug in lseek for mini-os
> >
> >     lseek always used files[fd].file.offset. It should
> >     use the offset of whatever union member is actually
> >     being used.
> >
> >     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> >     Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26164:17539cec2b9d
> > user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > date:        Mon Nov 19 12:59:46 2012 +0000
> >
> >     xen/arm: get the number of cpus from device tree
> >
> >     The system might have fewer cpus than the GIC supports.
> >
> >     Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> >     Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26163:ddb109120dbd
> > user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > date:        Mon Nov 19 12:59:46 2012 +0000
> >
> >     xen/arm: flush D-cache and I-cache when appropriate
> >
> >     - invalidate tlb after setting WXN
> >     - flush D-cache and I-cache after relocation;
> >     - invalidate D-cache after writing to smp_up_cpu;
> >     - flush I-cache after changing HTTBR;
> >     - flush I-cache and branch predictor after writing Xen text ptes.
> >
> >     Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> >     Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26162:9da9781cc3fb
> > user:        Jan Beulich <jbeulich@suse.com>
> > date:        Mon Nov 19 09:48:22 2012 +0100
> >
> >     vscsiif: minor cleanup
> >
> >     Remove a definition not belonging into the interface, and correct a
> >     few typos in comments.
> >
> >     Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >     Acked-by: Keir Fraser <keir@xen.org>
> >
> >
> > changeset:   26161:9025a10c0561
> > user:        Wei Wang <wei.wang2@amd.com>
> > date:        Mon Nov 19 09:46:46 2012 +0100
> >
> >     AMD IOMMU: Enable HPET broadcast msi remapping
> >
> >     This patch enables hpet msi remapping for amd iommu.
> >
> >     Signed-off-by: Wei Wang <wei.wang2@amd.com>
> >
> >     - use the existing ACPI_IVHD_* #define-s
> >     - warn on finding more than one IVHD HPET entry
> >     - consolidate parameters of update_intremap_entry_from_msi_msg()
> >
> >     Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >     Committed-by: Jan Beulich <jbeulich@suse.com>
> >
> >
> > changeset:   26160:321f8487379b
> > user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > date:        Thu Nov 15 10:25:29 2012 +0000
> >
> >     xen/arm: wake up secondary cpus
> >
> >     Secondary cpus are held by the firmware until we send an IPI to them.
> >
> >     Reordered non-boot cpu wait loop to perform the check before waiting
> >     for an event, to handled the case where the event has already
> >     happened when we reach the loop.
> >
> >     Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> >     Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > (qemu changes not included)
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
> 
> --
> Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
> T: +44 (0)1223 225 900, http://www.citrix.com
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 19:57:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 19:57:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaXTG-0003Kv-7y; Mon, 19 Nov 2012 19:57:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaXTE-0003Kq-HZ
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 19:57:28 +0000
Received: from [85.158.139.211:51013] by server-1.bemta-5.messagelabs.com id
	A4/3D-05877-72F8AA05; Mon, 19 Nov 2012 19:57:27 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353355046!20733934!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29798 invoked from network); 19 Nov 2012 19:57:26 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 19:57:26 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15888907"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 19:57:25 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 19 Nov 2012 19:57:25 +0000
Message-ID: <1353355044.26243.29.camel@dagon.hellion.org.uk>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Date: Mon, 19 Nov 2012 19:57:24 +0000
In-Reply-To: <50AA88E7.4030402@citrix.com>
References: <osstest-14421-mainreport@xen.org> <50AA88E7.4030402@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [xen-unstable test] 14421: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 19:30 +0000, Andrew Cooper wrote:
> On 19/11/12 19:24, xen.org wrote:
> > flight 14421 xen-unstable real [real]
> > http://www.chiark.greenend.org.uk/~xensrcts/logs/14421/
> >
> > Regressions :-(
> 
> Build failure caused by the first hunk of
> http://xenbits.xen.org/hg/staging/xen-unstable.hg/rev/26facad2f1a1 which
> introduced one open-comment and two close-comments.

So it does, I have pushed the fix below.

I must have somehow overlooked that my usual pre-commit test (which
includes a clean build) didn't actually run to completion. Sorry about
this.

Ian.

>From 602b24f9d77cd269a4f419a49d6e2f88d9f3d68e Mon Sep 17 00:00:00 2001
From: Ian Campbell <ian.campbell@citrix.com>
Date: Mon, 19 Nov 2012 19:53:22 +0000
Subject: [PATCH] xen: fix build failure due to extra closing comment

Added by 26173:26facad2f1a1

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/public/xen.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index bff9542..5593066 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -445,7 +445,6 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
  * ` @val: The new page table entry, must contain a machine address
  * ` @flags: Control TLB flushes
  */
-*/
 /* These are passed as 'flags' to update_va_mapping. They can be ORed. */
 /* When specifying UVMF_MULTI, also OR in a pointer to a CPU bitmap.   */
 /* UVMF_LOCAL is merely UVMF_MULTI with a NULL bitmap pointer.         */
-- 
1.7.2.5



> 
> 
> >
> > Tests which did not succeed and are blocking,
> > including tests which could not be run:
> >  build-i386                    4 xen-build                 fail REGR. vs. 14416
> >  build-i386-oldkern            4 xen-build                 fail REGR. vs. 14416
> >  build-amd64                   4 xen-build                 fail REGR. vs. 14416
> >  build-amd64-oldkern           4 xen-build                 fail REGR. vs. 14416
> >
> > Tests which did not succeed, but are not blocking:
> >  test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
> >  test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
> >  test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
> >  test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
> >  test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
> >  test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
> >  test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
> >  test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
> >  test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
> >  test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
> >  test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a
> >
> > version targeted for testing:
> >  xen                  fe8034159ac2
> > baseline version:
> >  xen                  321f8487379b
> >
> > ------------------------------------------------------------
> > People who touched revisions under test:
> >   Ian Campbell <ian.campbell@citrix.com>
> >   Ian Jackson <ian.jackson@eu.citrix.com>
> >   Jan Beulich <jbeulich@suse.com>
> >   Keir Fraser <keir@xen.org>
> >   Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> >   Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> >   Wei Wang <wei.wang2@amd.com>
> > ------------------------------------------------------------
> >
> > jobs:
> >  build-amd64                                                  fail
> >  build-i386                                                   fail
> >  build-amd64-oldkern                                          fail
> >  build-i386-oldkern                                           fail
> >  build-amd64-pvops                                            pass
> >  build-i386-pvops                                             pass
> >  test-amd64-amd64-xl                                          blocked
> >  test-amd64-i386-xl                                           blocked
> >  test-amd64-i386-rhel6hvm-amd                                 blocked
> >  test-amd64-i386-qemuu-rhel6hvm-amd                           blocked
> >  test-amd64-amd64-xl-qemuu-win7-amd64                         blocked
> >  test-amd64-amd64-xl-win7-amd64                               blocked
> >  test-amd64-i386-xl-win7-amd64                                blocked
> >  test-amd64-i386-xl-credit2                                   blocked
> >  test-amd64-amd64-xl-pcipt-intel                              blocked
> >  test-amd64-i386-rhel6hvm-intel                               blocked
> >  test-amd64-i386-qemuu-rhel6hvm-intel                         blocked
> >  test-amd64-i386-xl-multivcpu                                 blocked
> >  test-amd64-amd64-pair                                        blocked
> >  test-amd64-i386-pair                                         blocked
> >  test-amd64-amd64-xl-sedf-pin                                 blocked
> >  test-amd64-amd64-pv                                          blocked
> >  test-amd64-i386-pv                                           blocked
> >  test-amd64-amd64-xl-sedf                                     blocked
> >  test-amd64-i386-win-vcpus1                                   blocked
> >  test-amd64-i386-xl-win-vcpus1                                blocked
> >  test-amd64-i386-xl-winxpsp3-vcpus1                           blocked
> >  test-amd64-amd64-win                                         blocked
> >  test-amd64-i386-win                                          blocked
> >  test-amd64-amd64-xl-win                                      blocked
> >  test-amd64-amd64-xl-qemuu-winxpsp3                           blocked
> >  test-amd64-i386-xend-winxpsp3                                blocked
> >  test-amd64-amd64-xl-winxpsp3                                 blocked
> >
> >
> > ------------------------------------------------------------
> > sg-report-flight on woking.cam.xci-test.com
> > logs: /home/xc_osstest/logs
> > images: /home/xc_osstest/images
> >
> > Logs, config files, etc. are available at
> >     http://www.chiark.greenend.org.uk/~xensrcts/logs
> >
> > Test harness code can be found at
> >     http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary
> >
> >
> > Not pushing.
> >
> > ------------------------------------------------------------
> > changeset:   26177:fe8034159ac2
> > tag:         tip
> > user:        Ian Campbell <ian.campbell@citrix.com>
> > date:        Mon Nov 19 14:25:35 2012 +0000
> >
> >     docs: Include prototype for HYPERVISOR_multicall
> >
> >     Mark-up for inclusion of generated docs.
> >
> >     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26176:edad24bfa561
> > user:        Ian Campbell <ian.campbell@citrix.com>
> > date:        Mon Nov 19 14:25:34 2012 +0000
> >
> >     docs: Document HYPERVISOR_update_descriptor
> >
> >     Mark-up for inclusion of generated docs.
> >
> >     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26175:b1d36147ac96
> > user:        Ian Campbell <ian.campbell@citrix.com>
> > date:        Mon Nov 19 14:25:33 2012 +0000
> >
> >     docs: Add ToC entry for start of day memory layout.
> >
> >     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26174:dbb8d24bb5ad
> > user:        Ian Campbell <ian.campbell@citrix.com>
> > date:        Mon Nov 19 14:25:33 2012 +0000
> >
> >     docs: Document HYPERVISOR_mmuext_op
> >
> >     Mark-up for inclusion of generated docs.
> >
> >     Remove some trailing whitespace.
> >
> >     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26173:26facad2f1a1
> > user:        Ian Campbell <ian.campbell@citrix.com>
> > date:        Mon Nov 19 14:25:32 2012 +0000
> >
> >     docs: document HYPERVISOR_update_va_mapping(_other_domain)
> >
> >     Mark-up for inclusion of generated docs.
> >
> >     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26172:cfd2772cc717
> > user:        Ian Campbell <ian.campbell@citrix.com>
> > date:        Mon Nov 19 14:25:31 2012 +0000
> >
> >     docs: document/mark-up SCHEDOP_*
> >
> >     The biggest subtlety here is there additional argument when op ==
> >     SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
> >     xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
> >
> >     This patch moves some structs around but there is no functional change
> >     other than improved documentation.
> >
> >     Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >     Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26171:31668da0c4d3
> > user:        Jan Beulich <jbeulich@suse.com>
> > date:        Mon Nov 19 15:15:12 2012 +0100
> >
> >     AMD IOMMU: fix type of "bdf" parameter of update_intremap_entry_from_msi_msg()
> >
> >     Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> >     Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >
> >
> > changeset:   26170:380ad94f2adc
> > user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> > date:        Mon Nov 19 12:59:51 2012 +0000
> >
> >     Remove tools/vtpm* from MAINTAINERS file
> >
> >     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> >     Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26169:5a6225e40388
> > user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> > date:        Mon Nov 19 12:59:50 2012 +0000
> >
> >     tools: Remove old vtpm stuff from tools/libxen
> >
> >     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> >     Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26168:3dc18d679d04
> > user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> > date:        Mon Nov 19 12:59:49 2012 +0000
> >
> >     Remove VTPM_TOOLS from config/Tools.mk.in
> >
> >     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> >     Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26167:31dcc0e08754
> > user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> > date:        Mon Nov 19 12:59:48 2012 +0000
> >
> >     xend: Remove old vtpm support from xm
> >
> >     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> >     Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26166:d026f8abca51
> > user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> > date:        Mon Nov 19 12:59:48 2012 +0000
> >
> >     minios: Update mini-os license to support GPL features
> >
> >     This patch updates extras/mini-os/COPYING to explain
> >     which optional features are GPL and what the implications
> >     of enabling them are.
> >
> >     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> >     Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26165:42a7c393c390
> > user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> > date:        Mon Nov 19 12:59:47 2012 +0000
> >
> >     minios: fix bug in lseek for mini-os
> >
> >     lseek always used files[fd].file.offset. It should
> >     use the offset of whatever union member is actually
> >     being used.
> >
> >     Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> >     Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26164:17539cec2b9d
> > user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > date:        Mon Nov 19 12:59:46 2012 +0000
> >
> >     xen/arm: get the number of cpus from device tree
> >
> >     The system might have fewer cpus than the GIC supports.
> >
> >     Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> >     Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26163:ddb109120dbd
> > user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > date:        Mon Nov 19 12:59:46 2012 +0000
> >
> >     xen/arm: flush D-cache and I-cache when appropriate
> >
> >     - invalidate tlb after setting WXN
> >     - flush D-cache and I-cache after relocation;
> >     - invalidate D-cache after writing to smp_up_cpu;
> >     - flush I-cache after changing HTTBR;
> >     - flush I-cache and branch predictor after writing Xen text ptes.
> >
> >     Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> >     Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > changeset:   26162:9da9781cc3fb
> > user:        Jan Beulich <jbeulich@suse.com>
> > date:        Mon Nov 19 09:48:22 2012 +0100
> >
> >     vscsiif: minor cleanup
> >
> >     Remove a definition not belonging into the interface, and correct a
> >     few typos in comments.
> >
> >     Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >     Acked-by: Keir Fraser <keir@xen.org>
> >
> >
> > changeset:   26161:9025a10c0561
> > user:        Wei Wang <wei.wang2@amd.com>
> > date:        Mon Nov 19 09:46:46 2012 +0100
> >
> >     AMD IOMMU: Enable HPET broadcast msi remapping
> >
> >     This patch enables hpet msi remapping for amd iommu.
> >
> >     Signed-off-by: Wei Wang <wei.wang2@amd.com>
> >
> >     - use the existing ACPI_IVHD_* #define-s
> >     - warn on finding more than one IVHD HPET entry
> >     - consolidate parameters of update_intremap_entry_from_msi_msg()
> >
> >     Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >     Committed-by: Jan Beulich <jbeulich@suse.com>
> >
> >
> > changeset:   26160:321f8487379b
> > user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > date:        Thu Nov 15 10:25:29 2012 +0000
> >
> >     xen/arm: wake up secondary cpus
> >
> >     Secondary cpus are held by the firmware until we send an IPI to them.
> >
> >     Reordered non-boot cpu wait loop to perform the check before waiting
> >     for an event, to handled the case where the event has already
> >     happened when we reach the loop.
> >
> >     Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> >     Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >     Committed-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >
> > (qemu changes not included)
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
> 
> --
> Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
> T: +44 (0)1223 225 900, http://www.citrix.com
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 20:04:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 20:04:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaXa3-0003l5-Re; Mon, 19 Nov 2012 20:04:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TaXa1-0003ky-UV
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 20:04:30 +0000
Received: from [85.158.143.99:42971] by server-2.bemta-4.messagelabs.com id
	C0/FE-28922-DC09AA05; Mon, 19 Nov 2012 20:04:29 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1353355466!29632390!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3MjI2NQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15929 invoked from network); 19 Nov 2012 20:04:27 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-13.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 19 Nov 2012 20:04:27 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAJK4Op2024726
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 19 Nov 2012 20:04:25 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAJK4Njt024263
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 19 Nov 2012 20:04:24 GMT
Received: from abhmt115.oracle.com (abhmt115.oracle.com [141.146.116.67])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAJK4NTb012788; Mon, 19 Nov 2012 14:04:23 -0600
MIME-Version: 1.0
Message-ID: <840e9430-324e-456a-a738-39784010cdad@default>
Date: Mon, 19 Nov 2012 12:04:21 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<50A4D12002000078000A8C68@nat28.tlf.novell.com>
	<c0905ad1-ed26-485b-9232-3475fd32e6a4@default>
	<50A6252702000078000A92AE@nat28.tlf.novell.com>
In-Reply-To: <50A6252702000078000A92AE@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Keir Fraser <keir@xen.org>, TimDeegan <tim@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Friday, November 16, 2012 3:36 AM
> To: Dan Magenheimer
> Cc: xen-devel@lists.xen.org; Konrad Wilk; ZhigangWang; Keir Fraser; TimDeegan
> Subject: RE: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> 
> >>> On 15.11.12 at 19:00, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> >>  From: Jan Beulich [mailto:JBeulich@suse.com]
> >> Similarly, but perhaps of lower priority, there is no integration
> >> with the low-mem handling.
> >
> > I'd also consider this lower priority as Olaf and Andre
> > have argued that the claim mechanism is not needed for
> > sharing/paging so the two mechanisms may not
> > be used together, at least for the foreseeable future.
> > So I plan to skip this, unless you change your mind and
> > consider it a showstopper for acceptance.
> 
> Skipping for the initial implementation is likely fine, but that
> shouldn't mean deferring the integration indefinitely. Also,
> I see no close connection between the low-mem feature
> and sharing/paging (apart from Andres working on both).

Fair enough.

After reviewing the thread where low_mem was submitted, I have to admit
that I am a bit baffled as to when the low_mem handling would ever be
necessary.   I suspect it is because the author and I are approaching
memory management from a completely different paradigm (per discussion
in an earlier thread where "claim" was first proposed), so that
is probably better left for the deferred discussion of the
integration.

So since you (Jan) do not consider this (lack of integration with
low_mem) a showstopper for claim, I will set myself a reminder
to initiate a new thread about this later.

Thanks,
Dan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 20:04:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 20:04:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaXa3-0003l5-Re; Mon, 19 Nov 2012 20:04:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TaXa1-0003ky-UV
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 20:04:30 +0000
Received: from [85.158.143.99:42971] by server-2.bemta-4.messagelabs.com id
	C0/FE-28922-DC09AA05; Mon, 19 Nov 2012 20:04:29 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1353355466!29632390!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3MjI2NQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15929 invoked from network); 19 Nov 2012 20:04:27 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-13.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 19 Nov 2012 20:04:27 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAJK4Op2024726
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 19 Nov 2012 20:04:25 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAJK4Njt024263
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 19 Nov 2012 20:04:24 GMT
Received: from abhmt115.oracle.com (abhmt115.oracle.com [141.146.116.67])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAJK4NTb012788; Mon, 19 Nov 2012 14:04:23 -0600
MIME-Version: 1.0
Message-ID: <840e9430-324e-456a-a738-39784010cdad@default>
Date: Mon, 19 Nov 2012 12:04:21 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<50A4D12002000078000A8C68@nat28.tlf.novell.com>
	<c0905ad1-ed26-485b-9232-3475fd32e6a4@default>
	<50A6252702000078000A92AE@nat28.tlf.novell.com>
In-Reply-To: <50A6252702000078000A92AE@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Keir Fraser <keir@xen.org>, TimDeegan <tim@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Friday, November 16, 2012 3:36 AM
> To: Dan Magenheimer
> Cc: xen-devel@lists.xen.org; Konrad Wilk; ZhigangWang; Keir Fraser; TimDeegan
> Subject: RE: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> 
> >>> On 15.11.12 at 19:00, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> >>  From: Jan Beulich [mailto:JBeulich@suse.com]
> >> Similarly, but perhaps of lower priority, there is no integration
> >> with the low-mem handling.
> >
> > I'd also consider this lower priority as Olaf and Andre
> > have argued that the claim mechanism is not needed for
> > sharing/paging so the two mechanisms may not
> > be used together, at least for the foreseeable future.
> > So I plan to skip this, unless you change your mind and
> > consider it a showstopper for acceptance.
> 
> Skipping for the initial implementation is likely fine, but that
> shouldn't mean deferring the integration indefinitely. Also,
> I see no close connection between the low-mem feature
> and sharing/paging (apart from Andres working on both).

Fair enough.

After reviewing the thread where low_mem was submitted, I have to admit
that I am a bit baffled as to when the low_mem handling would ever be
necessary.   I suspect it is because the author and I are approaching
memory management from a completely different paradigm (per discussion
in an earlier thread where "claim" was first proposed), so that
is probably better left for the deferred discussion of the
integration.

So since you (Jan) do not consider this (lack of integration with
low_mem) a showstopper for claim, I will set myself a reminder
to initiate a new thread about this later.

Thanks,
Dan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 20:07:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 20:07:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaXcu-0003w2-F5; Mon, 19 Nov 2012 20:07:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <larry.finger@gmail.com>) id 1TaXXs-0003dv-8o
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 20:02:16 +0000
Received: from [85.158.138.51:42290] by server-6.bemta-3.messagelabs.com id
	09/2E-28265-7409AA05; Mon, 19 Nov 2012 20:02:15 +0000
X-Env-Sender: larry.finger@gmail.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353355330!30724477!1
X-Originating-IP: [209.85.223.171]
X-SpamReason: No, hits=1.1 required=7.0 tests=BODY_RANDOM_LONG,
	MAILTO_TO_SPAM_ADDR,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13463 invoked from network); 19 Nov 2012 20:02:12 -0000
Received: from mail-ie0-f171.google.com (HELO mail-ie0-f171.google.com)
	(209.85.223.171)
	by server-5.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 20:02:12 -0000
Received: by mail-ie0-f171.google.com with SMTP id 17so2483369iea.30
	for <xen-devel@lists.xensource.com>;
	Mon, 19 Nov 2012 12:01:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	bh=P6H+HN5wceTVKJyHv581cmOIGLyy2jeVtuequRrjbLM=;
	b=W4tX3wKdb5RzlJFcm77KEhHdVAu5BcmDmIG2iaINpnvuDPFMzzmadFivZeMZ1iPe1I
	qdnSGvGZOuKS1wWwgl1P3EmTGE+qQXu5qYq+vo/ClhuWH31RxHWFuSJTV/CZe+W2zQkP
	+QCk9ZQjQ2I8lar6TZeE7jg5nk9WCRlsTUeSKR+p3J8FbHdz2DDOHUPkWaVEsDfxDEaL
	63PZbzOFQyY7otCG4TjNbB76x4W2sszi1L/5QrzYU0GhnsVLu9DPxunw+A1iJ9AHKNlA
	LDXK7SVMFBIEeylQiwadU3NWaerI657fJvOWxCbpjJpqmog6n6W/r2f5cQ+uucvmAIDU
	/zbA==
Received: by 10.43.46.2 with SMTP id um2mr11847144icb.18.1353355271173;
	Mon, 19 Nov 2012 12:01:11 -0800 (PST)
Received: from larrylap.site (CPE-75-81-36-228.kc.res.rr.com. [75.81.36.228])
	by mx.google.com with ESMTPS id l8sm8484065igo.13.2012.11.19.12.01.05
	(version=SSLv3 cipher=OTHER); Mon, 19 Nov 2012 12:01:09 -0800 (PST)
Message-ID: <50AA9000.2020902@lwfinger.net>
Date: Mon, 19 Nov 2012 14:01:04 -0600
From: Larry Finger <Larry.Finger@lwfinger.net>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121025 Thunderbird/16.0.2
MIME-Version: 1.0
To: Bill Pemberton <wfp5p@virginia.edu>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
	<1353349642-3677-471-git-send-email-wfp5p@virginia.edu>
In-Reply-To: <1353349642-3677-471-git-send-email-wfp5p@virginia.edu>
X-Mailman-Approved-At: Mon, 19 Nov 2012 20:07:26 +0000
Cc: Jiri Slaby <jirislaby@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>,
	"VMware, Inc." <pv-drivers@vmware.com>,
	Shreyas Bhatewara <sbhatewara@vmware.com>,
	virtualization@lists.linux-foundation.org,
	"Maciej W. Rozycki" <macro@linux-mips.org>,
	Christian Lamparter <chunkeey@googlemail.com>,
	Hin-Tak Leung <htl10@users.sourceforge.net>,
	Luciano Coelho <coelho@ti.com>, Stefano Brivio <stefano.brivio@polimi.it>,
	libertas-dev@lists.infradead.org, Dan Williams <dcbw@redhat.com>,
	ath5k-devel@lists.ath5k.org, "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>,
	linux-hippi@sunsite.dk, Nick Kossifidis <mickflemm@gmail.com>,
	Francois Romieu <romieu@fr.zoreil.com>,
	Herton Ronaldo Krzesinski <herton@canonical.com>,
	Stanislav Yakovlev <stas.yakovlev@gmail.com>, b43-dev@lists.infradead.org,
	Jes Sorensen <jes@trained-monkey.org>, Samuel Ortiz <samuel@sortiz.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	"John W. Linville" <linville@tuxdriver.com>,
	linux-can@vger.kernel.org, xen-devel@lists.xensource.com,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	gregkh@linuxfoundation.org, linux-wireless@vger.kernel.org,
	Wolfgang Grandegger <wg@grandegger.com>, netdev@vger.kernel.org,
	Simon Kelley <simon@thekelleys.org.uk>, Krzysztof Halasa <khc@pm.waw.pl>
Subject: Re: [Xen-devel] [PATCH 471/493] net: remove use of __devexit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/19/2012 12:27 PM, Bill Pemberton wrote:
> CONFIG_HOTPLUG is going away as an option so __devexit is no
> longer needed.
>
> Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
> Cc: Wolfgang Grandegger <wg@grandegger.com>
> Cc: Marc Kleine-Budde <mkl@pengutronix.de>
> Cc: "Maciej W. Rozycki" <macro@linux-mips.org>
> Cc: Jes Sorensen <jes@trained-monkey.org>
> Cc: Samuel Ortiz <samuel@sortiz.org>
> Cc: Rusty Russell <rusty@rustcorp.com.au>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Shreyas Bhatewara <sbhatewara@vmware.com>
> Cc: "VMware, Inc." <pv-drivers@vmware.com>
> Cc: Francois Romieu <romieu@fr.zoreil.com>
> Cc: Krzysztof Halasa <khc@pm.waw.pl>
> Cc: "John W. Linville" <linville@tuxdriver.com>
> Cc: Jiri Slaby <jirislaby@gmail.com>
> Cc: Nick Kossifidis <mickflemm@gmail.com>
> Cc: "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>
> Cc: Simon Kelley <simon@thekelleys.org.uk>
> Cc: Stefano Brivio <stefano.brivio@polimi.it>
> Cc: Stanislav Yakovlev <stas.yakovlev@gmail.com>
> Cc: Dan Williams <dcbw@redhat.com>
> Cc: Christian Lamparter <chunkeey@googlemail.com>
> Cc: Herton Ronaldo Krzesinski <herton@canonical.com>
> Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
> Cc: Larry Finger <Larry.Finger@lwfinger.net>
> Cc: Luciano Coelho <coelho@ti.com>
> Cc: netdev@vger.kernel.org
> Cc: linux-can@vger.kernel.org
> Cc: linux-hippi@sunsite.dk
> Cc: virtualization@lists.linux-foundation.org
> Cc: linux-wireless@vger.kernel.org
> Cc: ath5k-devel@lists.ath5k.org
> Cc: b43-dev@lists.infradead.org
> Cc: libertas-dev@lists.infradead.org
> Cc: xen-devel@lists.xensource.com

ACKed-by: Larry Finger <Larry.Finger.net> for the rtl8187 part.

> ---
>   drivers/net/arcnet/com20020-pci.c             |  2 +-
>   drivers/net/can/at91_can.c                    |  2 +-
>   drivers/net/can/bfin_can.c                    |  2 +-
>   drivers/net/can/c_can/c_can_pci.c             |  2 +-
>   drivers/net/can/c_can/c_can_platform.c        |  2 +-
>   drivers/net/can/cc770/cc770_isa.c             |  2 +-
>   drivers/net/can/cc770/cc770_platform.c        |  2 +-
>   drivers/net/can/flexcan.c                     |  4 ++--
>   drivers/net/can/janz-ican3.c                  |  6 +++---
>   drivers/net/can/mcp251x.c                     |  2 +-
>   drivers/net/can/mscan/mpc5xxx_can.c           |  2 +-
>   drivers/net/can/pch_can.c                     |  2 +-
>   drivers/net/can/sja1000/kvaser_pci.c          |  2 +-
>   drivers/net/can/sja1000/peak_pci.c            |  2 +-
>   drivers/net/can/sja1000/sja1000_isa.c         |  2 +-
>   drivers/net/can/sja1000/sja1000_of_platform.c |  2 +-
>   drivers/net/can/sja1000/tscan1.c              |  2 +-
>   drivers/net/can/softing/softing_cs.c          |  2 +-
>   drivers/net/can/softing/softing_main.c        |  2 +-
>   drivers/net/can/ti_hecc.c                     |  2 +-
>   drivers/net/fddi/defxx.c                      | 14 +++++++-------
>   drivers/net/fddi/skfp/skfddi.c                |  2 +-
>   drivers/net/hippi/rrunner.c                   |  2 +-
>   drivers/net/ieee802154/at86rf230.c            |  2 +-
>   drivers/net/ieee802154/fakehard.c             |  2 +-
>   drivers/net/ieee802154/fakelb.c               |  2 +-
>   drivers/net/ieee802154/mrf24j40.c             |  2 +-
>   drivers/net/irda/au1k_ir.c                    |  2 +-
>   drivers/net/irda/bfin_sir.c                   |  2 +-
>   drivers/net/irda/sh_irda.c                    |  2 +-
>   drivers/net/irda/sh_sir.c                     |  2 +-
>   drivers/net/irda/via-ircc.c                   |  4 ++--
>   drivers/net/irda/vlsi_ir.c                    |  2 +-
>   drivers/net/phy/mdio-gpio.c                   |  4 ++--
>   drivers/net/phy/mdio-mux-gpio.c               |  2 +-
>   drivers/net/phy/mdio-mux-mmioreg.c            |  2 +-
>   drivers/net/phy/mdio-octeon.c                 |  2 +-
>   drivers/net/phy/spi_ks8995.c                  |  2 +-
>   drivers/net/virtio_net.c                      |  2 +-
>   drivers/net/vmxnet3/vmxnet3_drv.c             |  2 +-
>   drivers/net/wan/dscc4.c                       |  2 +-
>   drivers/net/wan/farsync.c                     |  2 +-
>   drivers/net/wan/ixp4xx_hss.c                  |  2 +-
>   drivers/net/wan/lmc/lmc_main.c                |  2 +-
>   drivers/net/wireless/adm8211.c                |  2 +-
>   drivers/net/wireless/airo.c                   |  2 +-
>   drivers/net/wireless/ath/ath5k/pci.c          |  2 +-
>   drivers/net/wireless/atmel_pci.c              |  2 +-
>   drivers/net/wireless/b43/pcmcia.c             |  2 +-
>   drivers/net/wireless/b43/sdio.c               |  2 +-
>   drivers/net/wireless/ipw2x00/ipw2100.c        |  2 +-
>   drivers/net/wireless/ipw2x00/ipw2200.c        |  2 +-
>   drivers/net/wireless/iwlegacy/3945-mac.c      |  2 +-
>   drivers/net/wireless/iwlegacy/4965-mac.c      |  2 +-
>   drivers/net/wireless/iwlwifi/pcie/drv.c       |  2 +-
>   drivers/net/wireless/libertas/if_spi.c        |  2 +-
>   drivers/net/wireless/mwl8k.c                  |  4 ++--
>   drivers/net/wireless/orinoco/orinoco_nortel.c |  2 +-
>   drivers/net/wireless/orinoco/orinoco_pci.c    |  2 +-
>   drivers/net/wireless/orinoco/orinoco_plx.c    |  2 +-
>   drivers/net/wireless/orinoco/orinoco_tmd.c    |  2 +-
>   drivers/net/wireless/p54/p54pci.c             |  2 +-
>   drivers/net/wireless/p54/p54spi.c             |  2 +-
>   drivers/net/wireless/p54/p54usb.c             |  2 +-
>   drivers/net/wireless/rtl818x/rtl8180/dev.c    |  2 +-
>   drivers/net/wireless/rtl818x/rtl8187/dev.c    |  2 +-
>   drivers/net/wireless/ti/wl1251/sdio.c         |  2 +-
>   drivers/net/wireless/ti/wl1251/spi.c          |  2 +-
>   drivers/net/wireless/ti/wlcore/main.c         |  2 +-
>   drivers/net/wireless/ti/wlcore/sdio.c         |  2 +-
>   drivers/net/wireless/ti/wlcore/spi.c          |  2 +-
>   drivers/net/wireless/ti/wlcore/wlcore.h       |  2 +-
>   drivers/net/xen-netfront.c                    |  2 +-
>   73 files changed, 85 insertions(+), 85 deletions(-)
>
> diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
> index e80f04b..cbc44f5 100644
> --- a/drivers/net/arcnet/com20020-pci.c
> +++ b/drivers/net/arcnet/com20020-pci.c
> @@ -135,7 +135,7 @@ out_dev:
>   	return err;
>   }
>
> -static void __devexit com20020pci_remove(struct pci_dev *pdev)
> +static void com20020pci_remove(struct pci_dev *pdev)
>   {
>   	struct net_device *dev = pci_get_drvdata(pdev);
>   	unregister_netdev(dev);
> diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
> index da807f3..e3c4c22 100644
> --- a/drivers/net/can/at91_can.c
> +++ b/drivers/net/can/at91_can.c
> @@ -1338,7 +1338,7 @@ static int at91_can_probe(struct platform_device *pdev)
>   	return err;
>   }
>
> -static int __devexit at91_can_remove(struct platform_device *pdev)
> +static int at91_can_remove(struct platform_device *pdev)
>   {
>   	struct net_device *dev = platform_get_drvdata(pdev);
>   	struct at91_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/bfin_can.c b/drivers/net/can/bfin_can.c
> index 16515e3..6918334 100644
> --- a/drivers/net/can/bfin_can.c
> +++ b/drivers/net/can/bfin_can.c
> @@ -611,7 +611,7 @@ exit:
>   	return err;
>   }
>
> -static int __devexit bfin_can_remove(struct platform_device *pdev)
> +static int bfin_can_remove(struct platform_device *pdev)
>   {
>   	struct net_device *dev = dev_get_drvdata(&pdev->dev);
>   	struct bfin_can_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c
> index 27db0f2..a1f2631 100644
> --- a/drivers/net/can/c_can/c_can_pci.c
> +++ b/drivers/net/can/c_can/c_can_pci.c
> @@ -174,7 +174,7 @@ out:
>   	return ret;
>   }
>
> -static void __devexit c_can_pci_remove(struct pci_dev *pdev)
> +static void c_can_pci_remove(struct pci_dev *pdev)
>   {
>   	struct net_device *dev = pci_get_drvdata(pdev);
>   	struct c_can_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
> index 91e7d2b..f133951 100644
> --- a/drivers/net/can/c_can/c_can_platform.c
> +++ b/drivers/net/can/c_can/c_can_platform.c
> @@ -220,7 +220,7 @@ exit:
>   	return ret;
>   }
>
> -static int __devexit c_can_plat_remove(struct platform_device *pdev)
> +static int c_can_plat_remove(struct platform_device *pdev)
>   {
>   	struct net_device *dev = platform_get_drvdata(pdev);
>   	struct c_can_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/cc770/cc770_isa.c b/drivers/net/can/cc770/cc770_isa.c
> index bed9d19..8eaaac8 100644
> --- a/drivers/net/can/cc770/cc770_isa.c
> +++ b/drivers/net/can/cc770/cc770_isa.c
> @@ -291,7 +291,7 @@ static int cc770_isa_probe(struct platform_device *pdev)
>   	return err;
>   }
>
> -static int __devexit cc770_isa_remove(struct platform_device *pdev)
> +static int cc770_isa_remove(struct platform_device *pdev)
>   {
>   	struct net_device *dev = dev_get_drvdata(&pdev->dev);
>   	struct cc770_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/cc770/cc770_platform.c b/drivers/net/can/cc770/cc770_platform.c
> index caf4d70..4af9f4e 100644
> --- a/drivers/net/can/cc770/cc770_platform.c
> +++ b/drivers/net/can/cc770/cc770_platform.c
> @@ -237,7 +237,7 @@ exit_release_mem:
>   	return err;
>   }
>
> -static int __devexit cc770_platform_remove(struct platform_device *pdev)
> +static int cc770_platform_remove(struct platform_device *pdev)
>   {
>   	struct net_device *dev = dev_get_drvdata(&pdev->dev);
>   	struct cc770_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
> index dd3c933..dc31c78 100644
> --- a/drivers/net/can/flexcan.c
> +++ b/drivers/net/can/flexcan.c
> @@ -968,7 +968,7 @@ static int register_flexcandev(struct net_device *dev)
>   	return err;
>   }
>
> -static void __devexit unregister_flexcandev(struct net_device *dev)
> +static void unregister_flexcandev(struct net_device *dev)
>   {
>   	unregister_candev(dev);
>   }
> @@ -1107,7 +1107,7 @@ static int flexcan_probe(struct platform_device *pdev)
>   	return err;
>   }
>
> -static int __devexit flexcan_remove(struct platform_device *pdev)
> +static int flexcan_remove(struct platform_device *pdev)
>   {
>   	struct net_device *dev = platform_get_drvdata(pdev);
>   	struct flexcan_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
> index 6eb1916..e7d69a4 100644
> --- a/drivers/net/can/janz-ican3.c
> +++ b/drivers/net/can/janz-ican3.c
> @@ -642,7 +642,7 @@ static int ican3_msg_connect(struct ican3_dev *mod)
>   	return ican3_send_msg(mod, &msg);
>   }
>
> -static int __devexit ican3_msg_disconnect(struct ican3_dev *mod)
> +static int ican3_msg_disconnect(struct ican3_dev *mod)
>   {
>   	struct ican3_msg msg;
>
> @@ -1421,7 +1421,7 @@ static int ican3_reset_module(struct ican3_dev *mod)
>   	return -ETIMEDOUT;
>   }
>
> -static void __devexit ican3_shutdown_module(struct ican3_dev *mod)
> +static void ican3_shutdown_module(struct ican3_dev *mod)
>   {
>   	ican3_msg_disconnect(mod);
>   	ican3_reset_module(mod);
> @@ -1898,7 +1898,7 @@ out_return:
>   	return ret;
>   }
>
> -static int __devexit ican3_remove(struct platform_device *pdev)
> +static int ican3_remove(struct platform_device *pdev)
>   {
>   	struct net_device *ndev = platform_get_drvdata(pdev);
>   	struct ican3_dev *mod = netdev_priv(ndev);
> diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c
> index 767fdbd..5eaf47b 100644
> --- a/drivers/net/can/mcp251x.c
> +++ b/drivers/net/can/mcp251x.c
> @@ -1100,7 +1100,7 @@ error_out:
>   	return ret;
>   }
>
> -static int __devexit mcp251x_can_remove(struct spi_device *spi)
> +static int mcp251x_can_remove(struct spi_device *spi)
>   {
>   	struct mcp251x_platform_data *pdata = spi->dev.platform_data;
>   	struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
> diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
> index 508cbad..12e130a 100644
> --- a/drivers/net/can/mscan/mpc5xxx_can.c
> +++ b/drivers/net/can/mscan/mpc5xxx_can.c
> @@ -323,7 +323,7 @@ exit_unmap_mem:
>   	return err;
>   }
>
> -static int __devexit mpc5xxx_can_remove(struct platform_device *ofdev)
> +static int mpc5xxx_can_remove(struct platform_device *ofdev)
>   {
>   	struct net_device *dev = dev_get_drvdata(&ofdev->dev);
>   	struct mscan_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
> index fad4625..7d17485 100644
> --- a/drivers/net/can/pch_can.c
> +++ b/drivers/net/can/pch_can.c
> @@ -954,7 +954,7 @@ static const struct net_device_ops pch_can_netdev_ops = {
>   	.ndo_start_xmit		= pch_xmit,
>   };
>
> -static void __devexit pch_can_remove(struct pci_dev *pdev)
> +static void pch_can_remove(struct pci_dev *pdev)
>   {
>   	struct net_device *ndev = pci_get_drvdata(pdev);
>   	struct pch_can_priv *priv = netdev_priv(ndev);
> diff --git a/drivers/net/can/sja1000/kvaser_pci.c b/drivers/net/can/sja1000/kvaser_pci.c
> index a6191ac..4efdaf2 100644
> --- a/drivers/net/can/sja1000/kvaser_pci.c
> +++ b/drivers/net/can/sja1000/kvaser_pci.c
> @@ -379,7 +379,7 @@ failure:
>
>   }
>
> -static void __devexit kvaser_pci_remove_one(struct pci_dev *pdev)
> +static void kvaser_pci_remove_one(struct pci_dev *pdev)
>   {
>   	struct net_device *dev = pci_get_drvdata(pdev);
>
> diff --git a/drivers/net/can/sja1000/peak_pci.c b/drivers/net/can/sja1000/peak_pci.c
> index fbf61cf..3faeb3d 100644
> --- a/drivers/net/can/sja1000/peak_pci.c
> +++ b/drivers/net/can/sja1000/peak_pci.c
> @@ -717,7 +717,7 @@ failure_disable_pci:
>   	return err;
>   }
>
> -static void __devexit peak_pci_remove(struct pci_dev *pdev)
> +static void peak_pci_remove(struct pci_dev *pdev)
>   {
>   	struct net_device *dev = pci_get_drvdata(pdev); /* Last device */
>   	struct sja1000_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/sja1000/sja1000_isa.c b/drivers/net/can/sja1000/sja1000_isa.c
> index a872f24..5c8da46 100644
> --- a/drivers/net/can/sja1000/sja1000_isa.c
> +++ b/drivers/net/can/sja1000/sja1000_isa.c
> @@ -223,7 +223,7 @@ static int sja1000_isa_probe(struct platform_device *pdev)
>   	return err;
>   }
>
> -static int __devexit sja1000_isa_remove(struct platform_device *pdev)
> +static int sja1000_isa_remove(struct platform_device *pdev)
>   {
>   	struct net_device *dev = dev_get_drvdata(&pdev->dev);
>   	struct sja1000_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/sja1000/sja1000_of_platform.c b/drivers/net/can/sja1000/sja1000_of_platform.c
> index 1ca0ee1..a7b0152 100644
> --- a/drivers/net/can/sja1000/sja1000_of_platform.c
> +++ b/drivers/net/can/sja1000/sja1000_of_platform.c
> @@ -68,7 +68,7 @@ static void sja1000_ofp_write_reg(const struct sja1000_priv *priv,
>   	out_8(priv->reg_base + reg, val);
>   }
>
> -static int __devexit sja1000_ofp_remove(struct platform_device *ofdev)
> +static int sja1000_ofp_remove(struct platform_device *ofdev)
>   {
>   	struct net_device *dev = dev_get_drvdata(&ofdev->dev);
>   	struct sja1000_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/sja1000/tscan1.c b/drivers/net/can/sja1000/tscan1.c
> index 6a6db7e..76513dd 100644
> --- a/drivers/net/can/sja1000/tscan1.c
> +++ b/drivers/net/can/sja1000/tscan1.c
> @@ -171,7 +171,7 @@ static int tscan1_probe(struct device *dev, unsigned id)
>   	return -ENXIO;
>   }
>
> -static int __devexit tscan1_remove(struct device *dev, unsigned id /*unused*/)
> +static int tscan1_remove(struct device *dev, unsigned id /*unused*/)
>   {
>   	struct net_device *netdev;
>   	struct sja1000_priv *priv;
> diff --git a/drivers/net/can/softing/softing_cs.c b/drivers/net/can/softing/softing_cs.c
> index 04e1539..ce18ba5 100644
> --- a/drivers/net/can/softing/softing_cs.c
> +++ b/drivers/net/can/softing/softing_cs.c
> @@ -215,7 +215,7 @@ static int softingcs_probe_config(struct pcmcia_device *pcmcia,
>   	return pcmcia_request_window(pcmcia, pres, memspeed);
>   }
>
> -static __devexit void softingcs_remove(struct pcmcia_device *pcmcia)
> +static void softingcs_remove(struct pcmcia_device *pcmcia)
>   {
>   	struct platform_device *pdev = pcmcia->priv;
>
> diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c
> index aefd297..50b1e0f 100644
> --- a/drivers/net/can/softing/softing_main.c
> +++ b/drivers/net/can/softing/softing_main.c
> @@ -745,7 +745,7 @@ static const struct attribute_group softing_pdev_group = {
>   /*
>    * platform driver
>    */
> -static __devexit int softing_pdev_remove(struct platform_device *pdev)
> +static int softing_pdev_remove(struct platform_device *pdev)
>   {
>   	struct softing *card = platform_get_drvdata(pdev);
>   	int j;
> diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
> index 80ee814..b5e1683 100644
> --- a/drivers/net/can/ti_hecc.c
> +++ b/drivers/net/can/ti_hecc.c
> @@ -978,7 +978,7 @@ probe_exit:
>   	return err;
>   }
>
> -static int __devexit ti_hecc_remove(struct platform_device *pdev)
> +static int ti_hecc_remove(struct platform_device *pdev)
>   {
>   	struct resource *res;
>   	struct net_device *ndev = platform_get_drvdata(pdev);
> diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c
> index fd58f0b..3c8aab7 100644
> --- a/drivers/net/fddi/defxx.c
> +++ b/drivers/net/fddi/defxx.c
> @@ -809,7 +809,7 @@ static void dfx_bus_init(struct net_device *dev)
>    *   Interrupts are disabled at the adapter bus-specific logic.
>    */
>
> -static void __devexit dfx_bus_uninit(struct net_device *dev)
> +static void dfx_bus_uninit(struct net_device *dev)
>   {
>   	DFX_board_t *bp = netdev_priv(dev);
>   	struct device *bdev = bp->bus_dev;
> @@ -3579,7 +3579,7 @@ static void dfx_xmt_flush( DFX_board_t *bp )
>    *   Device structures for FDDI adapters (fddi0, fddi1, etc) are
>    *   freed.
>    */
> -static void __devexit dfx_unregister(struct device *bdev)
> +static void dfx_unregister(struct device *bdev)
>   {
>   	struct net_device *dev = dev_get_drvdata(bdev);
>   	DFX_board_t *bp = netdev_priv(dev);
> @@ -3620,12 +3620,12 @@ static void __devexit dfx_unregister(struct device *bdev)
>
>
>   static int __maybe_unused dfx_dev_register(struct device *);
> -static int __devexit __maybe_unused dfx_dev_unregister(struct device *);
> +static int __maybe_unused dfx_dev_unregister(struct device *);
>
>   #ifdef CONFIG_PCI
>   static int dfx_pci_register(struct pci_dev *,
>   				      const struct pci_device_id *);
> -static void __devexit dfx_pci_unregister(struct pci_dev *);
> +static void dfx_pci_unregister(struct pci_dev *);
>
>   static DEFINE_PCI_DEVICE_TABLE(dfx_pci_table) = {
>   	{ PCI_DEVICE(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_FDDI) },
> @@ -3646,7 +3646,7 @@ static int dfx_pci_register(struct pci_dev *pdev,
>   	return dfx_register(&pdev->dev);
>   }
>
> -static void __devexit dfx_pci_unregister(struct pci_dev *pdev)
> +static void dfx_pci_unregister(struct pci_dev *pdev)
>   {
>   	dfx_unregister(&pdev->dev);
>   }
> @@ -3704,7 +3704,7 @@ static int __maybe_unused dfx_dev_register(struct device *dev)
>   	return status;
>   }
>
> -static int __devexit __maybe_unused dfx_dev_unregister(struct device *dev)
> +static int __maybe_unused dfx_dev_unregister(struct device *dev)
>   {
>   	put_device(dev);
>   	dfx_unregister(dev);
> @@ -3724,7 +3724,7 @@ static int dfx_init(void)
>   	return status;
>   }
>
> -static void __devexit dfx_cleanup(void)
> +static void dfx_cleanup(void)
>   {
>   	tc_unregister_driver(&dfx_tc_driver);
>   	eisa_driver_unregister(&dfx_eisa_driver);
> diff --git a/drivers/net/fddi/skfp/skfddi.c b/drivers/net/fddi/skfp/skfddi.c
> index cbabb74..d5bd563 100644
> --- a/drivers/net/fddi/skfp/skfddi.c
> +++ b/drivers/net/fddi/skfp/skfddi.c
> @@ -321,7 +321,7 @@ err_out1:
>   /*
>    * Called for each adapter board from pci_unregister_driver
>    */
> -static void __devexit skfp_remove_one(struct pci_dev *pdev)
> +static void skfp_remove_one(struct pci_dev *pdev)
>   {
>   	struct net_device *p = pci_get_drvdata(pdev);
>   	struct s_smc *lp = netdev_priv(p);
> diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c
> index 12b7ff9..6be95ed 100644
> --- a/drivers/net/hippi/rrunner.c
> +++ b/drivers/net/hippi/rrunner.c
> @@ -221,7 +221,7 @@ static int rr_init_one(struct pci_dev *pdev,
>   	return ret;
>   }
>
> -static void __devexit rr_remove_one (struct pci_dev *pdev)
> +static void rr_remove_one (struct pci_dev *pdev)
>   {
>   	struct net_device *dev = pci_get_drvdata(pdev);
>   	struct rr_private *rr = netdev_priv(dev);
> diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
> index 1198c6b..a4a62e1 100644
> --- a/drivers/net/ieee802154/at86rf230.c
> +++ b/drivers/net/ieee802154/at86rf230.c
> @@ -920,7 +920,7 @@ err_fill:
>   	return rc;
>   }
>
> -static int __devexit at86rf230_remove(struct spi_device *spi)
> +static int at86rf230_remove(struct spi_device *spi)
>   {
>   	struct at86rf230_local *lp = spi_get_drvdata(spi);
>
> diff --git a/drivers/net/ieee802154/fakehard.c b/drivers/net/ieee802154/fakehard.c
> index fd0438c..1e9cb0b 100644
> --- a/drivers/net/ieee802154/fakehard.c
> +++ b/drivers/net/ieee802154/fakehard.c
> @@ -412,7 +412,7 @@ out:
>   	return err;
>   }
>
> -static int __devexit ieee802154fake_remove(struct platform_device *pdev)
> +static int ieee802154fake_remove(struct platform_device *pdev)
>   {
>   	struct net_device *dev = platform_get_drvdata(pdev);
>   	unregister_netdev(dev);
> diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c
> index e4b0e38..b8d2217 100644
> --- a/drivers/net/ieee802154/fakelb.c
> +++ b/drivers/net/ieee802154/fakelb.c
> @@ -253,7 +253,7 @@ err_alloc:
>   	return err;
>   }
>
> -static int __devexit fakelb_remove(struct platform_device *pdev)
> +static int fakelb_remove(struct platform_device *pdev)
>   {
>   	struct fakelb_priv *priv = platform_get_drvdata(pdev);
>   	struct fakelb_dev_priv *dp, *temp;
> diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
> index ef41051..3f2c7aa 100644
> --- a/drivers/net/ieee802154/mrf24j40.c
> +++ b/drivers/net/ieee802154/mrf24j40.c
> @@ -711,7 +711,7 @@ err_devrec:
>   	return ret;
>   }
>
> -static int __devexit mrf24j40_remove(struct spi_device *spi)
> +static int mrf24j40_remove(struct spi_device *spi)
>   {
>   	struct mrf24j40 *devrec = dev_get_drvdata(&spi->dev);
>
> diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c
> index 7843f50..b5151e4 100644
> --- a/drivers/net/irda/au1k_ir.c
> +++ b/drivers/net/irda/au1k_ir.c
> @@ -921,7 +921,7 @@ out:
>   	return err;
>   }
>
> -static int __devexit au1k_irda_remove(struct platform_device *pdev)
> +static int au1k_irda_remove(struct platform_device *pdev)
>   {
>   	struct net_device *dev = platform_get_drvdata(pdev);
>   	struct au1k_private *aup = netdev_priv(dev);
> diff --git a/drivers/net/irda/bfin_sir.c b/drivers/net/irda/bfin_sir.c
> index 98c903f..fed4a05 100644
> --- a/drivers/net/irda/bfin_sir.c
> +++ b/drivers/net/irda/bfin_sir.c
> @@ -775,7 +775,7 @@ err_mem_0:
>   	return err;
>   }
>
> -static int __devexit bfin_sir_remove(struct platform_device *pdev)
> +static int bfin_sir_remove(struct platform_device *pdev)
>   {
>   	struct bfin_sir_port *sir_port;
>   	struct net_device *dev = NULL;
> diff --git a/drivers/net/irda/sh_irda.c b/drivers/net/irda/sh_irda.c
> index 2d3f3e6..9448587 100644
> --- a/drivers/net/irda/sh_irda.c
> +++ b/drivers/net/irda/sh_irda.c
> @@ -825,7 +825,7 @@ exit:
>   	return err;
>   }
>
> -static int __devexit sh_irda_remove(struct platform_device *pdev)
> +static int sh_irda_remove(struct platform_device *pdev)
>   {
>   	struct net_device *ndev = platform_get_drvdata(pdev);
>   	struct sh_irda_self *self = netdev_priv(ndev);
> diff --git a/drivers/net/irda/sh_sir.c b/drivers/net/irda/sh_sir.c
> index 150b56c..24aefcd 100644
> --- a/drivers/net/irda/sh_sir.c
> +++ b/drivers/net/irda/sh_sir.c
> @@ -783,7 +783,7 @@ exit:
>   	return err;
>   }
>
> -static int __devexit sh_sir_remove(struct platform_device *pdev)
> +static int sh_sir_remove(struct platform_device *pdev)
>   {
>   	struct net_device *ndev = platform_get_drvdata(pdev);
>   	struct sh_sir_self *self = netdev_priv(ndev);
> diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c
> index d678f52..5488247 100644
> --- a/drivers/net/irda/via-ircc.c
> +++ b/drivers/net/irda/via-ircc.c
> @@ -103,7 +103,7 @@ static void hwreset(struct via_ircc_cb *self);
>   static int via_ircc_dma_xmit(struct via_ircc_cb *self, u16 iobase);
>   static int upload_rxdata(struct via_ircc_cb *self, int iobase);
>   static int via_init_one (struct pci_dev *pcidev, const struct pci_device_id *id);
> -static void __devexit via_remove_one (struct pci_dev *pdev);
> +static void via_remove_one (struct pci_dev *pdev);
>
>   /* FIXME : Should use udelay() instead, even if we are x86 only - Jean II */
>   static void iodelay(int udelay)
> @@ -424,7 +424,7 @@ static int via_ircc_open(struct pci_dev *pdev, chipio_t * info,
>    *    Close driver instance
>    *
>    */
> -static void __devexit via_remove_one(struct pci_dev *pdev)
> +static void via_remove_one(struct pci_dev *pdev)
>   {
>   	struct via_ircc_cb *self = pci_get_drvdata(pdev);
>   	int iobase;
> diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
> index e255b65..2f99f88 100644
> --- a/drivers/net/irda/vlsi_ir.c
> +++ b/drivers/net/irda/vlsi_ir.c
> @@ -1699,7 +1699,7 @@ out:
>   	return -ENODEV;
>   }
>
> -static void __devexit vlsi_irda_remove(struct pci_dev *pdev)
> +static void vlsi_irda_remove(struct pci_dev *pdev)
>   {
>   	struct net_device *ndev = pci_get_drvdata(pdev);
>   	vlsi_irda_dev_t *idev;
> diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
> index bf30b1d..6b2fdb8 100644
> --- a/drivers/net/phy/mdio-gpio.c
> +++ b/drivers/net/phy/mdio-gpio.c
> @@ -173,7 +173,7 @@ static void mdio_gpio_bus_deinit(struct device *dev)
>   	kfree(bitbang);
>   }
>
> -static void __devexit mdio_gpio_bus_destroy(struct device *dev)
> +static void mdio_gpio_bus_destroy(struct device *dev)
>   {
>   	struct mii_bus *bus = dev_get_drvdata(dev);
>
> @@ -210,7 +210,7 @@ static int mdio_gpio_probe(struct platform_device *pdev)
>   	return ret;
>   }
>
> -static int __devexit mdio_gpio_remove(struct platform_device *pdev)
> +static int mdio_gpio_remove(struct platform_device *pdev)
>   {
>   	mdio_gpio_bus_destroy(&pdev->dev);
>
> diff --git a/drivers/net/phy/mdio-mux-gpio.c b/drivers/net/phy/mdio-mux-gpio.c
> index 23ee064..0c9accb 100644
> --- a/drivers/net/phy/mdio-mux-gpio.c
> +++ b/drivers/net/phy/mdio-mux-gpio.c
> @@ -104,7 +104,7 @@ err:
>   	return r;
>   }
>
> -static int __devexit mdio_mux_gpio_remove(struct platform_device *pdev)
> +static int mdio_mux_gpio_remove(struct platform_device *pdev)
>   {
>   	struct mdio_mux_gpio_state *s = pdev->dev.platform_data;
>   	mdio_mux_uninit(s->mux_handle);
> diff --git a/drivers/net/phy/mdio-mux-mmioreg.c b/drivers/net/phy/mdio-mux-mmioreg.c
> index a38951f..9733bd2 100644
> --- a/drivers/net/phy/mdio-mux-mmioreg.c
> +++ b/drivers/net/phy/mdio-mux-mmioreg.c
> @@ -137,7 +137,7 @@ static int mdio_mux_mmioreg_probe(struct platform_device *pdev)
>   	return 0;
>   }
>
> -static int __devexit mdio_mux_mmioreg_remove(struct platform_device *pdev)
> +static int mdio_mux_mmioreg_remove(struct platform_device *pdev)
>   {
>   	struct mdio_mux_mmioreg_state *s = dev_get_platdata(&pdev->dev);
>
> diff --git a/drivers/net/phy/mdio-octeon.c b/drivers/net/phy/mdio-octeon.c
> index 7a07985..09297fe 100644
> --- a/drivers/net/phy/mdio-octeon.c
> +++ b/drivers/net/phy/mdio-octeon.c
> @@ -159,7 +159,7 @@ fail:
>   	return err;
>   }
>
> -static int __devexit octeon_mdiobus_remove(struct platform_device *pdev)
> +static int octeon_mdiobus_remove(struct platform_device *pdev)
>   {
>   	struct octeon_mdiobus *bus;
>   	union cvmx_smix_en smi_en;
> diff --git a/drivers/net/phy/spi_ks8995.c b/drivers/net/phy/spi_ks8995.c
> index 1321c99..41eb8ff 100644
> --- a/drivers/net/phy/spi_ks8995.c
> +++ b/drivers/net/phy/spi_ks8995.c
> @@ -332,7 +332,7 @@ err_drvdata:
>   	return err;
>   }
>
> -static int __devexit ks8995_remove(struct spi_device *spi)
> +static int ks8995_remove(struct spi_device *spi)
>   {
>   	struct ks8995_data      *ks8995;
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index b0c1630..c5f0ed2 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -1195,7 +1195,7 @@ static void remove_vq_common(struct virtnet_info *vi)
>   		__free_pages(get_a_page(vi, GFP_KERNEL), 0);
>   }
>
> -static void __devexit virtnet_remove(struct virtio_device *vdev)
> +static void virtnet_remove(struct virtio_device *vdev)
>   {
>   	struct virtnet_info *vi = vdev->priv;
>
> diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
> index ac322e5..71b762f 100644
> --- a/drivers/net/vmxnet3/vmxnet3_drv.c
> +++ b/drivers/net/vmxnet3/vmxnet3_drv.c
> @@ -3096,7 +3096,7 @@ err_alloc_shared:
>   }
>
>
> -static void __devexit
> +static void
>   vmxnet3_remove_device(struct pci_dev *pdev)
>   {
>   	struct net_device *netdev = pci_get_drvdata(pdev);
> diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
> index 863df17..d502230 100644
> --- a/drivers/net/wan/dscc4.c
> +++ b/drivers/net/wan/dscc4.c
> @@ -1968,7 +1968,7 @@ err_out:
>   	return -ENOMEM;
>   }
>
> -static void __devexit dscc4_remove_one(struct pci_dev *pdev)
> +static void dscc4_remove_one(struct pci_dev *pdev)
>   {
>   	struct dscc4_pci_priv *ppriv;
>   	struct dscc4_dev_priv *root;
> diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
> index dbbe06e..d7adba4 100644
> --- a/drivers/net/wan/farsync.c
> +++ b/drivers/net/wan/farsync.c
> @@ -2615,7 +2615,7 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>   /*
>    *      Cleanup and close down a card
>    */
> -static void __devexit
> +static void
>   fst_remove_one(struct pci_dev *pdev)
>   {
>   	struct fst_card_info *card;
> diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
> index beecbe8..b056691 100644
> --- a/drivers/net/wan/ixp4xx_hss.c
> +++ b/drivers/net/wan/ixp4xx_hss.c
> @@ -1375,7 +1375,7 @@ err_free:
>   	return err;
>   }
>
> -static int __devexit hss_remove_one(struct platform_device *pdev)
> +static int hss_remove_one(struct platform_device *pdev)
>   {
>   	struct port *port = platform_get_drvdata(pdev);
>
> diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
> index 41a401a..0e443fd 100644
> --- a/drivers/net/wan/lmc/lmc_main.c
> +++ b/drivers/net/wan/lmc/lmc_main.c
> @@ -986,7 +986,7 @@ err_req_io:
>   /*
>    * Called from pci when removing module.
>    */
> -static void __devexit lmc_remove_one(struct pci_dev *pdev)
> +static void lmc_remove_one(struct pci_dev *pdev)
>   {
>   	struct net_device *dev = pci_get_drvdata(pdev);
>
> diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
> index bd89a29..3d339e0 100644
> --- a/drivers/net/wireless/adm8211.c
> +++ b/drivers/net/wireless/adm8211.c
> @@ -1935,7 +1935,7 @@ static int adm8211_probe(struct pci_dev *pdev,
>   }
>
>
> -static void __devexit adm8211_remove(struct pci_dev *pdev)
> +static void adm8211_remove(struct pci_dev *pdev)
>   {
>   	struct ieee80211_hw *dev = pci_get_drvdata(pdev);
>   	struct adm8211_priv *priv;
> diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
> index b010f41..5329541 100644
> --- a/drivers/net/wireless/airo.c
> +++ b/drivers/net/wireless/airo.c
> @@ -5606,7 +5606,7 @@ static int airo_pci_probe(struct pci_dev *pdev,
>   	return 0;
>   }
>
> -static void __devexit airo_pci_remove(struct pci_dev *pdev)
> +static void airo_pci_remove(struct pci_dev *pdev)
>   {
>   	struct net_device *dev = pci_get_drvdata(pdev);
>
> diff --git a/drivers/net/wireless/ath/ath5k/pci.c b/drivers/net/wireless/ath/ath5k/pci.c
> index 1a78ba3..859db7c 100644
> --- a/drivers/net/wireless/ath/ath5k/pci.c
> +++ b/drivers/net/wireless/ath/ath5k/pci.c
> @@ -285,7 +285,7 @@ err:
>   	return ret;
>   }
>
> -static void __devexit
> +static void
>   ath5k_pci_remove(struct pci_dev *pdev)
>   {
>   	struct ieee80211_hw *hw = pci_get_drvdata(pdev);
> diff --git a/drivers/net/wireless/atmel_pci.c b/drivers/net/wireless/atmel_pci.c
> index 1c12fec..c1b159e 100644
> --- a/drivers/net/wireless/atmel_pci.c
> +++ b/drivers/net/wireless/atmel_pci.c
> @@ -69,7 +69,7 @@ static int atmel_pci_probe(struct pci_dev *pdev,
>   	return 0;
>   }
>
> -static void __devexit atmel_pci_remove(struct pci_dev *pdev)
> +static void atmel_pci_remove(struct pci_dev *pdev)
>   {
>   	stop_atmel_card(pci_get_drvdata(pdev));
>   }
> diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c
> index 3506cca..f2ea2ce 100644
> --- a/drivers/net/wireless/b43/pcmcia.c
> +++ b/drivers/net/wireless/b43/pcmcia.c
> @@ -110,7 +110,7 @@ out_error:
>   	return err;
>   }
>
> -static void __devexit b43_pcmcia_remove(struct pcmcia_device *dev)
> +static void b43_pcmcia_remove(struct pcmcia_device *dev)
>   {
>   	struct ssb_bus *ssb = dev->priv;
>
> diff --git a/drivers/net/wireless/b43/sdio.c b/drivers/net/wireless/b43/sdio.c
> index d2b1f98..59a5218 100644
> --- a/drivers/net/wireless/b43/sdio.c
> +++ b/drivers/net/wireless/b43/sdio.c
> @@ -171,7 +171,7 @@ out:
>   	return error;
>   }
>
> -static void __devexit b43_sdio_remove(struct sdio_func *func)
> +static void b43_sdio_remove(struct sdio_func *func)
>   {
>   	struct b43_sdio *sdio = sdio_get_drvdata(func);
>
> diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
> index b96c615..7588484 100644
> --- a/drivers/net/wireless/ipw2x00/ipw2100.c
> +++ b/drivers/net/wireless/ipw2x00/ipw2100.c
> @@ -6413,7 +6413,7 @@ out:
>   	goto out;
>   }
>
> -static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev)
> +static void ipw2100_pci_remove_one(struct pci_dev *pci_dev)
>   {
>   	struct ipw2100_priv *priv = pci_get_drvdata(pci_dev);
>   	struct net_device *dev = priv->net_dev;
> diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
> index 3f099a6..941c6b5 100644
> --- a/drivers/net/wireless/ipw2x00/ipw2200.c
> +++ b/drivers/net/wireless/ipw2x00/ipw2200.c
> @@ -11895,7 +11895,7 @@ static int ipw_pci_probe(struct pci_dev *pdev,
>   	return err;
>   }
>
> -static void __devexit ipw_pci_remove(struct pci_dev *pdev)
> +static void ipw_pci_remove(struct pci_dev *pdev)
>   {
>   	struct ipw_priv *priv = pci_get_drvdata(pdev);
>   	struct list_head *p, *q;
> diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
> index 88fdd39..d604b40 100644
> --- a/drivers/net/wireless/iwlegacy/3945-mac.c
> +++ b/drivers/net/wireless/iwlegacy/3945-mac.c
> @@ -3794,7 +3794,7 @@ out:
>   	return err;
>   }
>
> -static void __devexit
> +static void
>   il3945_pci_remove(struct pci_dev *pdev)
>   {
>   	struct il_priv *il = pci_get_drvdata(pdev);
> diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
> index 14e0a94..569e1ae5 100644
> --- a/drivers/net/wireless/iwlegacy/4965-mac.c
> +++ b/drivers/net/wireless/iwlegacy/4965-mac.c
> @@ -6664,7 +6664,7 @@ out:
>   	return err;
>   }
>
> -static void __devexit
> +static void
>   il4965_pci_remove(struct pci_dev *pdev)
>   {
>   	struct il_priv *il = pci_get_drvdata(pdev);
> diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c
> index 7cb27af..1f21d60 100644
> --- a/drivers/net/wireless/iwlwifi/pcie/drv.c
> +++ b/drivers/net/wireless/iwlwifi/pcie/drv.c
> @@ -294,7 +294,7 @@ out_free_trans:
>   	return -EFAULT;
>   }
>
> -static void __devexit iwl_pci_remove(struct pci_dev *pdev)
> +static void iwl_pci_remove(struct pci_dev *pdev)
>   {
>   	struct iwl_trans *trans = pci_get_drvdata(pdev);
>   	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
> diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
> index abc32e3..4bb6574 100644
> --- a/drivers/net/wireless/libertas/if_spi.c
> +++ b/drivers/net/wireless/libertas/if_spi.c
> @@ -1226,7 +1226,7 @@ out:
>   	return err;
>   }
>
> -static int __devexit libertas_spi_remove(struct spi_device *spi)
> +static int libertas_spi_remove(struct spi_device *spi)
>   {
>   	struct if_spi_card *card = spi_get_drvdata(spi);
>   	struct lbs_private *priv = card->priv;
> diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
> index b9f71fd..19cad01 100644
> --- a/drivers/net/wireless/mwl8k.c
> +++ b/drivers/net/wireless/mwl8k.c
> @@ -5872,12 +5872,12 @@ err_disable_device:
>   	return rc;
>   }
>
> -static void __devexit mwl8k_shutdown(struct pci_dev *pdev)
> +static void mwl8k_shutdown(struct pci_dev *pdev)
>   {
>   	printk(KERN_ERR "===>%s(%u)\n", __func__, __LINE__);
>   }
>
> -static void __devexit mwl8k_remove(struct pci_dev *pdev)
> +static void mwl8k_remove(struct pci_dev *pdev)
>   {
>   	struct ieee80211_hw *hw = pci_get_drvdata(pdev);
>   	struct mwl8k_priv *priv;
> diff --git a/drivers/net/wireless/orinoco/orinoco_nortel.c b/drivers/net/wireless/orinoco/orinoco_nortel.c
> index f286540..d73fdf6 100644
> --- a/drivers/net/wireless/orinoco/orinoco_nortel.c
> +++ b/drivers/net/wireless/orinoco/orinoco_nortel.c
> @@ -255,7 +255,7 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev,
>   	return err;
>   }
>
> -static void __devexit orinoco_nortel_remove_one(struct pci_dev *pdev)
> +static void orinoco_nortel_remove_one(struct pci_dev *pdev)
>   {
>   	struct orinoco_private *priv = pci_get_drvdata(pdev);
>   	struct orinoco_pci_card *card = priv->card;
> diff --git a/drivers/net/wireless/orinoco/orinoco_pci.c b/drivers/net/wireless/orinoco/orinoco_pci.c
> index bf6d436..677bf14 100644
> --- a/drivers/net/wireless/orinoco/orinoco_pci.c
> +++ b/drivers/net/wireless/orinoco/orinoco_pci.c
> @@ -199,7 +199,7 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
>   	return err;
>   }
>
> -static void __devexit orinoco_pci_remove_one(struct pci_dev *pdev)
> +static void orinoco_pci_remove_one(struct pci_dev *pdev)
>   {
>   	struct orinoco_private *priv = pci_get_drvdata(pdev);
>
> diff --git a/drivers/net/wireless/orinoco/orinoco_plx.c b/drivers/net/wireless/orinoco/orinoco_plx.c
> index 63a614f..2559dbd 100644
> --- a/drivers/net/wireless/orinoco/orinoco_plx.c
> +++ b/drivers/net/wireless/orinoco/orinoco_plx.c
> @@ -294,7 +294,7 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
>   	return err;
>   }
>
> -static void __devexit orinoco_plx_remove_one(struct pci_dev *pdev)
> +static void orinoco_plx_remove_one(struct pci_dev *pdev)
>   {
>   	struct orinoco_private *priv = pci_get_drvdata(pdev);
>   	struct orinoco_pci_card *card = priv->card;
> diff --git a/drivers/net/wireless/orinoco/orinoco_tmd.c b/drivers/net/wireless/orinoco/orinoco_tmd.c
> index f67f43e..42afeee 100644
> --- a/drivers/net/wireless/orinoco/orinoco_tmd.c
> +++ b/drivers/net/wireless/orinoco/orinoco_tmd.c
> @@ -188,7 +188,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
>   	return err;
>   }
>
> -static void __devexit orinoco_tmd_remove_one(struct pci_dev *pdev)
> +static void orinoco_tmd_remove_one(struct pci_dev *pdev)
>   {
>   	struct orinoco_private *priv = pci_get_drvdata(pdev);
>   	struct orinoco_pci_card *card = priv->card;
> diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c
> index e5b29e9..04eb0ed 100644
> --- a/drivers/net/wireless/p54/p54pci.c
> +++ b/drivers/net/wireless/p54/p54pci.c
> @@ -639,7 +639,7 @@ static int p54p_probe(struct pci_dev *pdev,
>   	return err;
>   }
>
> -static void __devexit p54p_remove(struct pci_dev *pdev)
> +static void p54p_remove(struct pci_dev *pdev)
>   {
>   	struct ieee80211_hw *dev = pci_get_drvdata(pdev);
>   	struct p54p_priv *priv;
> diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
> index d75ab3e..4fd49a0 100644
> --- a/drivers/net/wireless/p54/p54spi.c
> +++ b/drivers/net/wireless/p54/p54spi.c
> @@ -683,7 +683,7 @@ err_free:
>   	return ret;
>   }
>
> -static int __devexit p54spi_remove(struct spi_device *spi)
> +static int p54spi_remove(struct spi_device *spi)
>   {
>   	struct p54s_priv *priv = dev_get_drvdata(&spi->dev);
>
> diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
> index 000f7ba..e71c702 100644
> --- a/drivers/net/wireless/p54/p54usb.c
> +++ b/drivers/net/wireless/p54/p54usb.c
> @@ -1057,7 +1057,7 @@ static int p54u_probe(struct usb_interface *intf,
>   	return err;
>   }
>
> -static void __devexit p54u_disconnect(struct usb_interface *intf)
> +static void p54u_disconnect(struct usb_interface *intf)
>   {
>   	struct ieee80211_hw *dev = usb_get_intfdata(intf);
>   	struct p54u_priv *priv;
> diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c
> index 6a5c0b8..4af3f91 100644
> --- a/drivers/net/wireless/rtl818x/rtl8180/dev.c
> +++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c
> @@ -1131,7 +1131,7 @@ static int rtl8180_probe(struct pci_dev *pdev,
>   	return err;
>   }
>
> -static void __devexit rtl8180_remove(struct pci_dev *pdev)
> +static void rtl8180_remove(struct pci_dev *pdev)
>   {
>   	struct ieee80211_hw *dev = pci_get_drvdata(pdev);
>   	struct rtl8180_priv *priv;
> diff --git a/drivers/net/wireless/rtl818x/rtl8187/dev.c b/drivers/net/wireless/rtl818x/rtl8187/dev.c
> index f879bc3..be36935 100644
> --- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
> +++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
> @@ -1639,7 +1639,7 @@ static int rtl8187_probe(struct usb_interface *intf,
>   	return err;
>   }
>
> -static void __devexit rtl8187_disconnect(struct usb_interface *intf)
> +static void rtl8187_disconnect(struct usb_interface *intf)
>   {
>   	struct ieee80211_hw *dev = usb_get_intfdata(intf);
>   	struct rtl8187_priv *priv;
> diff --git a/drivers/net/wireless/ti/wl1251/sdio.c b/drivers/net/wireless/ti/wl1251/sdio.c
> index e3f287f..e57ee48 100644
> --- a/drivers/net/wireless/ti/wl1251/sdio.c
> +++ b/drivers/net/wireless/ti/wl1251/sdio.c
> @@ -305,7 +305,7 @@ out_free_hw:
>   	return ret;
>   }
>
> -static void __devexit wl1251_sdio_remove(struct sdio_func *func)
> +static void wl1251_sdio_remove(struct sdio_func *func)
>   {
>   	struct wl1251 *wl = sdio_get_drvdata(func);
>   	struct wl1251_sdio *wl_sdio = wl->if_priv;
> diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c
> index 640a3d5..3b266d3 100644
> --- a/drivers/net/wireless/ti/wl1251/spi.c
> +++ b/drivers/net/wireless/ti/wl1251/spi.c
> @@ -309,7 +309,7 @@ static int wl1251_spi_probe(struct spi_device *spi)
>   	return ret;
>   }
>
> -static int __devexit wl1251_spi_remove(struct spi_device *spi)
> +static int wl1251_spi_remove(struct spi_device *spi)
>   {
>   	struct wl1251 *wl = dev_get_drvdata(&spi->dev);
>
> diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
> index 2dd4ada..dd38f61 100644
> --- a/drivers/net/wireless/ti/wlcore/main.c
> +++ b/drivers/net/wireless/ti/wlcore/main.c
> @@ -5682,7 +5682,7 @@ int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev)
>   }
>   EXPORT_SYMBOL_GPL(wlcore_probe);
>
> -int __devexit wlcore_remove(struct platform_device *pdev)
> +int wlcore_remove(struct platform_device *pdev)
>   {
>   	struct wl1271 *wl = platform_get_drvdata(pdev);
>
> diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
> index 7bf612c..646f703 100644
> --- a/drivers/net/wireless/ti/wlcore/sdio.c
> +++ b/drivers/net/wireless/ti/wlcore/sdio.c
> @@ -319,7 +319,7 @@ out:
>   	return ret;
>   }
>
> -static void __devexit wl1271_remove(struct sdio_func *func)
> +static void wl1271_remove(struct sdio_func *func)
>   {
>   	struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func);
>
> diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
> index ee39484..f06f477 100644
> --- a/drivers/net/wireless/ti/wlcore/spi.c
> +++ b/drivers/net/wireless/ti/wlcore/spi.c
> @@ -403,7 +403,7 @@ out:
>   	return ret;
>   }
>
> -static int __devexit wl1271_remove(struct spi_device *spi)
> +static int wl1271_remove(struct spi_device *spi)
>   {
>   	struct wl12xx_spi_glue *glue = spi_get_drvdata(spi);
>
> diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
> index adc6152..c388493 100644
> --- a/drivers/net/wireless/ti/wlcore/wlcore.h
> +++ b/drivers/net/wireless/ti/wlcore/wlcore.h
> @@ -415,7 +415,7 @@ struct wl1271 {
>   };
>
>   int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);
> -int __devexit wlcore_remove(struct platform_device *pdev);
> +int wlcore_remove(struct platform_device *pdev);
>   struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size);
>   int wlcore_free_hw(struct wl1271 *wl);
>   int wlcore_set_key(struct wl1271 *wl, enum set_key_cmd cmd,
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index 6f695fc..b31198c 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -1911,7 +1911,7 @@ static const struct xenbus_device_id netfront_ids[] = {
>   };
>
>
> -static int __devexit xennet_remove(struct xenbus_device *dev)
> +static int xennet_remove(struct xenbus_device *dev)
>   {
>   	struct netfront_info *info = dev_get_drvdata(&dev->dev);
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 20:07:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 20:07:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaXcu-0003w2-F5; Mon, 19 Nov 2012 20:07:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <larry.finger@gmail.com>) id 1TaXXs-0003dv-8o
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 20:02:16 +0000
Received: from [85.158.138.51:42290] by server-6.bemta-3.messagelabs.com id
	09/2E-28265-7409AA05; Mon, 19 Nov 2012 20:02:15 +0000
X-Env-Sender: larry.finger@gmail.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353355330!30724477!1
X-Originating-IP: [209.85.223.171]
X-SpamReason: No, hits=1.1 required=7.0 tests=BODY_RANDOM_LONG,
	MAILTO_TO_SPAM_ADDR,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13463 invoked from network); 19 Nov 2012 20:02:12 -0000
Received: from mail-ie0-f171.google.com (HELO mail-ie0-f171.google.com)
	(209.85.223.171)
	by server-5.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 20:02:12 -0000
Received: by mail-ie0-f171.google.com with SMTP id 17so2483369iea.30
	for <xen-devel@lists.xensource.com>;
	Mon, 19 Nov 2012 12:01:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	bh=P6H+HN5wceTVKJyHv581cmOIGLyy2jeVtuequRrjbLM=;
	b=W4tX3wKdb5RzlJFcm77KEhHdVAu5BcmDmIG2iaINpnvuDPFMzzmadFivZeMZ1iPe1I
	qdnSGvGZOuKS1wWwgl1P3EmTGE+qQXu5qYq+vo/ClhuWH31RxHWFuSJTV/CZe+W2zQkP
	+QCk9ZQjQ2I8lar6TZeE7jg5nk9WCRlsTUeSKR+p3J8FbHdz2DDOHUPkWaVEsDfxDEaL
	63PZbzOFQyY7otCG4TjNbB76x4W2sszi1L/5QrzYU0GhnsVLu9DPxunw+A1iJ9AHKNlA
	LDXK7SVMFBIEeylQiwadU3NWaerI657fJvOWxCbpjJpqmog6n6W/r2f5cQ+uucvmAIDU
	/zbA==
Received: by 10.43.46.2 with SMTP id um2mr11847144icb.18.1353355271173;
	Mon, 19 Nov 2012 12:01:11 -0800 (PST)
Received: from larrylap.site (CPE-75-81-36-228.kc.res.rr.com. [75.81.36.228])
	by mx.google.com with ESMTPS id l8sm8484065igo.13.2012.11.19.12.01.05
	(version=SSLv3 cipher=OTHER); Mon, 19 Nov 2012 12:01:09 -0800 (PST)
Message-ID: <50AA9000.2020902@lwfinger.net>
Date: Mon, 19 Nov 2012 14:01:04 -0600
From: Larry Finger <Larry.Finger@lwfinger.net>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121025 Thunderbird/16.0.2
MIME-Version: 1.0
To: Bill Pemberton <wfp5p@virginia.edu>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
	<1353349642-3677-471-git-send-email-wfp5p@virginia.edu>
In-Reply-To: <1353349642-3677-471-git-send-email-wfp5p@virginia.edu>
X-Mailman-Approved-At: Mon, 19 Nov 2012 20:07:26 +0000
Cc: Jiri Slaby <jirislaby@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>,
	"VMware, Inc." <pv-drivers@vmware.com>,
	Shreyas Bhatewara <sbhatewara@vmware.com>,
	virtualization@lists.linux-foundation.org,
	"Maciej W. Rozycki" <macro@linux-mips.org>,
	Christian Lamparter <chunkeey@googlemail.com>,
	Hin-Tak Leung <htl10@users.sourceforge.net>,
	Luciano Coelho <coelho@ti.com>, Stefano Brivio <stefano.brivio@polimi.it>,
	libertas-dev@lists.infradead.org, Dan Williams <dcbw@redhat.com>,
	ath5k-devel@lists.ath5k.org, "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>,
	linux-hippi@sunsite.dk, Nick Kossifidis <mickflemm@gmail.com>,
	Francois Romieu <romieu@fr.zoreil.com>,
	Herton Ronaldo Krzesinski <herton@canonical.com>,
	Stanislav Yakovlev <stas.yakovlev@gmail.com>, b43-dev@lists.infradead.org,
	Jes Sorensen <jes@trained-monkey.org>, Samuel Ortiz <samuel@sortiz.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	"John W. Linville" <linville@tuxdriver.com>,
	linux-can@vger.kernel.org, xen-devel@lists.xensource.com,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	gregkh@linuxfoundation.org, linux-wireless@vger.kernel.org,
	Wolfgang Grandegger <wg@grandegger.com>, netdev@vger.kernel.org,
	Simon Kelley <simon@thekelleys.org.uk>, Krzysztof Halasa <khc@pm.waw.pl>
Subject: Re: [Xen-devel] [PATCH 471/493] net: remove use of __devexit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/19/2012 12:27 PM, Bill Pemberton wrote:
> CONFIG_HOTPLUG is going away as an option so __devexit is no
> longer needed.
>
> Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
> Cc: Wolfgang Grandegger <wg@grandegger.com>
> Cc: Marc Kleine-Budde <mkl@pengutronix.de>
> Cc: "Maciej W. Rozycki" <macro@linux-mips.org>
> Cc: Jes Sorensen <jes@trained-monkey.org>
> Cc: Samuel Ortiz <samuel@sortiz.org>
> Cc: Rusty Russell <rusty@rustcorp.com.au>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Shreyas Bhatewara <sbhatewara@vmware.com>
> Cc: "VMware, Inc." <pv-drivers@vmware.com>
> Cc: Francois Romieu <romieu@fr.zoreil.com>
> Cc: Krzysztof Halasa <khc@pm.waw.pl>
> Cc: "John W. Linville" <linville@tuxdriver.com>
> Cc: Jiri Slaby <jirislaby@gmail.com>
> Cc: Nick Kossifidis <mickflemm@gmail.com>
> Cc: "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>
> Cc: Simon Kelley <simon@thekelleys.org.uk>
> Cc: Stefano Brivio <stefano.brivio@polimi.it>
> Cc: Stanislav Yakovlev <stas.yakovlev@gmail.com>
> Cc: Dan Williams <dcbw@redhat.com>
> Cc: Christian Lamparter <chunkeey@googlemail.com>
> Cc: Herton Ronaldo Krzesinski <herton@canonical.com>
> Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
> Cc: Larry Finger <Larry.Finger@lwfinger.net>
> Cc: Luciano Coelho <coelho@ti.com>
> Cc: netdev@vger.kernel.org
> Cc: linux-can@vger.kernel.org
> Cc: linux-hippi@sunsite.dk
> Cc: virtualization@lists.linux-foundation.org
> Cc: linux-wireless@vger.kernel.org
> Cc: ath5k-devel@lists.ath5k.org
> Cc: b43-dev@lists.infradead.org
> Cc: libertas-dev@lists.infradead.org
> Cc: xen-devel@lists.xensource.com

ACKed-by: Larry Finger <Larry.Finger.net> for the rtl8187 part.

> ---
>   drivers/net/arcnet/com20020-pci.c             |  2 +-
>   drivers/net/can/at91_can.c                    |  2 +-
>   drivers/net/can/bfin_can.c                    |  2 +-
>   drivers/net/can/c_can/c_can_pci.c             |  2 +-
>   drivers/net/can/c_can/c_can_platform.c        |  2 +-
>   drivers/net/can/cc770/cc770_isa.c             |  2 +-
>   drivers/net/can/cc770/cc770_platform.c        |  2 +-
>   drivers/net/can/flexcan.c                     |  4 ++--
>   drivers/net/can/janz-ican3.c                  |  6 +++---
>   drivers/net/can/mcp251x.c                     |  2 +-
>   drivers/net/can/mscan/mpc5xxx_can.c           |  2 +-
>   drivers/net/can/pch_can.c                     |  2 +-
>   drivers/net/can/sja1000/kvaser_pci.c          |  2 +-
>   drivers/net/can/sja1000/peak_pci.c            |  2 +-
>   drivers/net/can/sja1000/sja1000_isa.c         |  2 +-
>   drivers/net/can/sja1000/sja1000_of_platform.c |  2 +-
>   drivers/net/can/sja1000/tscan1.c              |  2 +-
>   drivers/net/can/softing/softing_cs.c          |  2 +-
>   drivers/net/can/softing/softing_main.c        |  2 +-
>   drivers/net/can/ti_hecc.c                     |  2 +-
>   drivers/net/fddi/defxx.c                      | 14 +++++++-------
>   drivers/net/fddi/skfp/skfddi.c                |  2 +-
>   drivers/net/hippi/rrunner.c                   |  2 +-
>   drivers/net/ieee802154/at86rf230.c            |  2 +-
>   drivers/net/ieee802154/fakehard.c             |  2 +-
>   drivers/net/ieee802154/fakelb.c               |  2 +-
>   drivers/net/ieee802154/mrf24j40.c             |  2 +-
>   drivers/net/irda/au1k_ir.c                    |  2 +-
>   drivers/net/irda/bfin_sir.c                   |  2 +-
>   drivers/net/irda/sh_irda.c                    |  2 +-
>   drivers/net/irda/sh_sir.c                     |  2 +-
>   drivers/net/irda/via-ircc.c                   |  4 ++--
>   drivers/net/irda/vlsi_ir.c                    |  2 +-
>   drivers/net/phy/mdio-gpio.c                   |  4 ++--
>   drivers/net/phy/mdio-mux-gpio.c               |  2 +-
>   drivers/net/phy/mdio-mux-mmioreg.c            |  2 +-
>   drivers/net/phy/mdio-octeon.c                 |  2 +-
>   drivers/net/phy/spi_ks8995.c                  |  2 +-
>   drivers/net/virtio_net.c                      |  2 +-
>   drivers/net/vmxnet3/vmxnet3_drv.c             |  2 +-
>   drivers/net/wan/dscc4.c                       |  2 +-
>   drivers/net/wan/farsync.c                     |  2 +-
>   drivers/net/wan/ixp4xx_hss.c                  |  2 +-
>   drivers/net/wan/lmc/lmc_main.c                |  2 +-
>   drivers/net/wireless/adm8211.c                |  2 +-
>   drivers/net/wireless/airo.c                   |  2 +-
>   drivers/net/wireless/ath/ath5k/pci.c          |  2 +-
>   drivers/net/wireless/atmel_pci.c              |  2 +-
>   drivers/net/wireless/b43/pcmcia.c             |  2 +-
>   drivers/net/wireless/b43/sdio.c               |  2 +-
>   drivers/net/wireless/ipw2x00/ipw2100.c        |  2 +-
>   drivers/net/wireless/ipw2x00/ipw2200.c        |  2 +-
>   drivers/net/wireless/iwlegacy/3945-mac.c      |  2 +-
>   drivers/net/wireless/iwlegacy/4965-mac.c      |  2 +-
>   drivers/net/wireless/iwlwifi/pcie/drv.c       |  2 +-
>   drivers/net/wireless/libertas/if_spi.c        |  2 +-
>   drivers/net/wireless/mwl8k.c                  |  4 ++--
>   drivers/net/wireless/orinoco/orinoco_nortel.c |  2 +-
>   drivers/net/wireless/orinoco/orinoco_pci.c    |  2 +-
>   drivers/net/wireless/orinoco/orinoco_plx.c    |  2 +-
>   drivers/net/wireless/orinoco/orinoco_tmd.c    |  2 +-
>   drivers/net/wireless/p54/p54pci.c             |  2 +-
>   drivers/net/wireless/p54/p54spi.c             |  2 +-
>   drivers/net/wireless/p54/p54usb.c             |  2 +-
>   drivers/net/wireless/rtl818x/rtl8180/dev.c    |  2 +-
>   drivers/net/wireless/rtl818x/rtl8187/dev.c    |  2 +-
>   drivers/net/wireless/ti/wl1251/sdio.c         |  2 +-
>   drivers/net/wireless/ti/wl1251/spi.c          |  2 +-
>   drivers/net/wireless/ti/wlcore/main.c         |  2 +-
>   drivers/net/wireless/ti/wlcore/sdio.c         |  2 +-
>   drivers/net/wireless/ti/wlcore/spi.c          |  2 +-
>   drivers/net/wireless/ti/wlcore/wlcore.h       |  2 +-
>   drivers/net/xen-netfront.c                    |  2 +-
>   73 files changed, 85 insertions(+), 85 deletions(-)
>
> diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
> index e80f04b..cbc44f5 100644
> --- a/drivers/net/arcnet/com20020-pci.c
> +++ b/drivers/net/arcnet/com20020-pci.c
> @@ -135,7 +135,7 @@ out_dev:
>   	return err;
>   }
>
> -static void __devexit com20020pci_remove(struct pci_dev *pdev)
> +static void com20020pci_remove(struct pci_dev *pdev)
>   {
>   	struct net_device *dev = pci_get_drvdata(pdev);
>   	unregister_netdev(dev);
> diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
> index da807f3..e3c4c22 100644
> --- a/drivers/net/can/at91_can.c
> +++ b/drivers/net/can/at91_can.c
> @@ -1338,7 +1338,7 @@ static int at91_can_probe(struct platform_device *pdev)
>   	return err;
>   }
>
> -static int __devexit at91_can_remove(struct platform_device *pdev)
> +static int at91_can_remove(struct platform_device *pdev)
>   {
>   	struct net_device *dev = platform_get_drvdata(pdev);
>   	struct at91_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/bfin_can.c b/drivers/net/can/bfin_can.c
> index 16515e3..6918334 100644
> --- a/drivers/net/can/bfin_can.c
> +++ b/drivers/net/can/bfin_can.c
> @@ -611,7 +611,7 @@ exit:
>   	return err;
>   }
>
> -static int __devexit bfin_can_remove(struct platform_device *pdev)
> +static int bfin_can_remove(struct platform_device *pdev)
>   {
>   	struct net_device *dev = dev_get_drvdata(&pdev->dev);
>   	struct bfin_can_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c
> index 27db0f2..a1f2631 100644
> --- a/drivers/net/can/c_can/c_can_pci.c
> +++ b/drivers/net/can/c_can/c_can_pci.c
> @@ -174,7 +174,7 @@ out:
>   	return ret;
>   }
>
> -static void __devexit c_can_pci_remove(struct pci_dev *pdev)
> +static void c_can_pci_remove(struct pci_dev *pdev)
>   {
>   	struct net_device *dev = pci_get_drvdata(pdev);
>   	struct c_can_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
> index 91e7d2b..f133951 100644
> --- a/drivers/net/can/c_can/c_can_platform.c
> +++ b/drivers/net/can/c_can/c_can_platform.c
> @@ -220,7 +220,7 @@ exit:
>   	return ret;
>   }
>
> -static int __devexit c_can_plat_remove(struct platform_device *pdev)
> +static int c_can_plat_remove(struct platform_device *pdev)
>   {
>   	struct net_device *dev = platform_get_drvdata(pdev);
>   	struct c_can_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/cc770/cc770_isa.c b/drivers/net/can/cc770/cc770_isa.c
> index bed9d19..8eaaac8 100644
> --- a/drivers/net/can/cc770/cc770_isa.c
> +++ b/drivers/net/can/cc770/cc770_isa.c
> @@ -291,7 +291,7 @@ static int cc770_isa_probe(struct platform_device *pdev)
>   	return err;
>   }
>
> -static int __devexit cc770_isa_remove(struct platform_device *pdev)
> +static int cc770_isa_remove(struct platform_device *pdev)
>   {
>   	struct net_device *dev = dev_get_drvdata(&pdev->dev);
>   	struct cc770_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/cc770/cc770_platform.c b/drivers/net/can/cc770/cc770_platform.c
> index caf4d70..4af9f4e 100644
> --- a/drivers/net/can/cc770/cc770_platform.c
> +++ b/drivers/net/can/cc770/cc770_platform.c
> @@ -237,7 +237,7 @@ exit_release_mem:
>   	return err;
>   }
>
> -static int __devexit cc770_platform_remove(struct platform_device *pdev)
> +static int cc770_platform_remove(struct platform_device *pdev)
>   {
>   	struct net_device *dev = dev_get_drvdata(&pdev->dev);
>   	struct cc770_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
> index dd3c933..dc31c78 100644
> --- a/drivers/net/can/flexcan.c
> +++ b/drivers/net/can/flexcan.c
> @@ -968,7 +968,7 @@ static int register_flexcandev(struct net_device *dev)
>   	return err;
>   }
>
> -static void __devexit unregister_flexcandev(struct net_device *dev)
> +static void unregister_flexcandev(struct net_device *dev)
>   {
>   	unregister_candev(dev);
>   }
> @@ -1107,7 +1107,7 @@ static int flexcan_probe(struct platform_device *pdev)
>   	return err;
>   }
>
> -static int __devexit flexcan_remove(struct platform_device *pdev)
> +static int flexcan_remove(struct platform_device *pdev)
>   {
>   	struct net_device *dev = platform_get_drvdata(pdev);
>   	struct flexcan_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
> index 6eb1916..e7d69a4 100644
> --- a/drivers/net/can/janz-ican3.c
> +++ b/drivers/net/can/janz-ican3.c
> @@ -642,7 +642,7 @@ static int ican3_msg_connect(struct ican3_dev *mod)
>   	return ican3_send_msg(mod, &msg);
>   }
>
> -static int __devexit ican3_msg_disconnect(struct ican3_dev *mod)
> +static int ican3_msg_disconnect(struct ican3_dev *mod)
>   {
>   	struct ican3_msg msg;
>
> @@ -1421,7 +1421,7 @@ static int ican3_reset_module(struct ican3_dev *mod)
>   	return -ETIMEDOUT;
>   }
>
> -static void __devexit ican3_shutdown_module(struct ican3_dev *mod)
> +static void ican3_shutdown_module(struct ican3_dev *mod)
>   {
>   	ican3_msg_disconnect(mod);
>   	ican3_reset_module(mod);
> @@ -1898,7 +1898,7 @@ out_return:
>   	return ret;
>   }
>
> -static int __devexit ican3_remove(struct platform_device *pdev)
> +static int ican3_remove(struct platform_device *pdev)
>   {
>   	struct net_device *ndev = platform_get_drvdata(pdev);
>   	struct ican3_dev *mod = netdev_priv(ndev);
> diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c
> index 767fdbd..5eaf47b 100644
> --- a/drivers/net/can/mcp251x.c
> +++ b/drivers/net/can/mcp251x.c
> @@ -1100,7 +1100,7 @@ error_out:
>   	return ret;
>   }
>
> -static int __devexit mcp251x_can_remove(struct spi_device *spi)
> +static int mcp251x_can_remove(struct spi_device *spi)
>   {
>   	struct mcp251x_platform_data *pdata = spi->dev.platform_data;
>   	struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
> diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
> index 508cbad..12e130a 100644
> --- a/drivers/net/can/mscan/mpc5xxx_can.c
> +++ b/drivers/net/can/mscan/mpc5xxx_can.c
> @@ -323,7 +323,7 @@ exit_unmap_mem:
>   	return err;
>   }
>
> -static int __devexit mpc5xxx_can_remove(struct platform_device *ofdev)
> +static int mpc5xxx_can_remove(struct platform_device *ofdev)
>   {
>   	struct net_device *dev = dev_get_drvdata(&ofdev->dev);
>   	struct mscan_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
> index fad4625..7d17485 100644
> --- a/drivers/net/can/pch_can.c
> +++ b/drivers/net/can/pch_can.c
> @@ -954,7 +954,7 @@ static const struct net_device_ops pch_can_netdev_ops = {
>   	.ndo_start_xmit		= pch_xmit,
>   };
>
> -static void __devexit pch_can_remove(struct pci_dev *pdev)
> +static void pch_can_remove(struct pci_dev *pdev)
>   {
>   	struct net_device *ndev = pci_get_drvdata(pdev);
>   	struct pch_can_priv *priv = netdev_priv(ndev);
> diff --git a/drivers/net/can/sja1000/kvaser_pci.c b/drivers/net/can/sja1000/kvaser_pci.c
> index a6191ac..4efdaf2 100644
> --- a/drivers/net/can/sja1000/kvaser_pci.c
> +++ b/drivers/net/can/sja1000/kvaser_pci.c
> @@ -379,7 +379,7 @@ failure:
>
>   }
>
> -static void __devexit kvaser_pci_remove_one(struct pci_dev *pdev)
> +static void kvaser_pci_remove_one(struct pci_dev *pdev)
>   {
>   	struct net_device *dev = pci_get_drvdata(pdev);
>
> diff --git a/drivers/net/can/sja1000/peak_pci.c b/drivers/net/can/sja1000/peak_pci.c
> index fbf61cf..3faeb3d 100644
> --- a/drivers/net/can/sja1000/peak_pci.c
> +++ b/drivers/net/can/sja1000/peak_pci.c
> @@ -717,7 +717,7 @@ failure_disable_pci:
>   	return err;
>   }
>
> -static void __devexit peak_pci_remove(struct pci_dev *pdev)
> +static void peak_pci_remove(struct pci_dev *pdev)
>   {
>   	struct net_device *dev = pci_get_drvdata(pdev); /* Last device */
>   	struct sja1000_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/sja1000/sja1000_isa.c b/drivers/net/can/sja1000/sja1000_isa.c
> index a872f24..5c8da46 100644
> --- a/drivers/net/can/sja1000/sja1000_isa.c
> +++ b/drivers/net/can/sja1000/sja1000_isa.c
> @@ -223,7 +223,7 @@ static int sja1000_isa_probe(struct platform_device *pdev)
>   	return err;
>   }
>
> -static int __devexit sja1000_isa_remove(struct platform_device *pdev)
> +static int sja1000_isa_remove(struct platform_device *pdev)
>   {
>   	struct net_device *dev = dev_get_drvdata(&pdev->dev);
>   	struct sja1000_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/sja1000/sja1000_of_platform.c b/drivers/net/can/sja1000/sja1000_of_platform.c
> index 1ca0ee1..a7b0152 100644
> --- a/drivers/net/can/sja1000/sja1000_of_platform.c
> +++ b/drivers/net/can/sja1000/sja1000_of_platform.c
> @@ -68,7 +68,7 @@ static void sja1000_ofp_write_reg(const struct sja1000_priv *priv,
>   	out_8(priv->reg_base + reg, val);
>   }
>
> -static int __devexit sja1000_ofp_remove(struct platform_device *ofdev)
> +static int sja1000_ofp_remove(struct platform_device *ofdev)
>   {
>   	struct net_device *dev = dev_get_drvdata(&ofdev->dev);
>   	struct sja1000_priv *priv = netdev_priv(dev);
> diff --git a/drivers/net/can/sja1000/tscan1.c b/drivers/net/can/sja1000/tscan1.c
> index 6a6db7e..76513dd 100644
> --- a/drivers/net/can/sja1000/tscan1.c
> +++ b/drivers/net/can/sja1000/tscan1.c
> @@ -171,7 +171,7 @@ static int tscan1_probe(struct device *dev, unsigned id)
>   	return -ENXIO;
>   }
>
> -static int __devexit tscan1_remove(struct device *dev, unsigned id /*unused*/)
> +static int tscan1_remove(struct device *dev, unsigned id /*unused*/)
>   {
>   	struct net_device *netdev;
>   	struct sja1000_priv *priv;
> diff --git a/drivers/net/can/softing/softing_cs.c b/drivers/net/can/softing/softing_cs.c
> index 04e1539..ce18ba5 100644
> --- a/drivers/net/can/softing/softing_cs.c
> +++ b/drivers/net/can/softing/softing_cs.c
> @@ -215,7 +215,7 @@ static int softingcs_probe_config(struct pcmcia_device *pcmcia,
>   	return pcmcia_request_window(pcmcia, pres, memspeed);
>   }
>
> -static __devexit void softingcs_remove(struct pcmcia_device *pcmcia)
> +static void softingcs_remove(struct pcmcia_device *pcmcia)
>   {
>   	struct platform_device *pdev = pcmcia->priv;
>
> diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c
> index aefd297..50b1e0f 100644
> --- a/drivers/net/can/softing/softing_main.c
> +++ b/drivers/net/can/softing/softing_main.c
> @@ -745,7 +745,7 @@ static const struct attribute_group softing_pdev_group = {
>   /*
>    * platform driver
>    */
> -static __devexit int softing_pdev_remove(struct platform_device *pdev)
> +static int softing_pdev_remove(struct platform_device *pdev)
>   {
>   	struct softing *card = platform_get_drvdata(pdev);
>   	int j;
> diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
> index 80ee814..b5e1683 100644
> --- a/drivers/net/can/ti_hecc.c
> +++ b/drivers/net/can/ti_hecc.c
> @@ -978,7 +978,7 @@ probe_exit:
>   	return err;
>   }
>
> -static int __devexit ti_hecc_remove(struct platform_device *pdev)
> +static int ti_hecc_remove(struct platform_device *pdev)
>   {
>   	struct resource *res;
>   	struct net_device *ndev = platform_get_drvdata(pdev);
> diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c
> index fd58f0b..3c8aab7 100644
> --- a/drivers/net/fddi/defxx.c
> +++ b/drivers/net/fddi/defxx.c
> @@ -809,7 +809,7 @@ static void dfx_bus_init(struct net_device *dev)
>    *   Interrupts are disabled at the adapter bus-specific logic.
>    */
>
> -static void __devexit dfx_bus_uninit(struct net_device *dev)
> +static void dfx_bus_uninit(struct net_device *dev)
>   {
>   	DFX_board_t *bp = netdev_priv(dev);
>   	struct device *bdev = bp->bus_dev;
> @@ -3579,7 +3579,7 @@ static void dfx_xmt_flush( DFX_board_t *bp )
>    *   Device structures for FDDI adapters (fddi0, fddi1, etc) are
>    *   freed.
>    */
> -static void __devexit dfx_unregister(struct device *bdev)
> +static void dfx_unregister(struct device *bdev)
>   {
>   	struct net_device *dev = dev_get_drvdata(bdev);
>   	DFX_board_t *bp = netdev_priv(dev);
> @@ -3620,12 +3620,12 @@ static void __devexit dfx_unregister(struct device *bdev)
>
>
>   static int __maybe_unused dfx_dev_register(struct device *);
> -static int __devexit __maybe_unused dfx_dev_unregister(struct device *);
> +static int __maybe_unused dfx_dev_unregister(struct device *);
>
>   #ifdef CONFIG_PCI
>   static int dfx_pci_register(struct pci_dev *,
>   				      const struct pci_device_id *);
> -static void __devexit dfx_pci_unregister(struct pci_dev *);
> +static void dfx_pci_unregister(struct pci_dev *);
>
>   static DEFINE_PCI_DEVICE_TABLE(dfx_pci_table) = {
>   	{ PCI_DEVICE(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_FDDI) },
> @@ -3646,7 +3646,7 @@ static int dfx_pci_register(struct pci_dev *pdev,
>   	return dfx_register(&pdev->dev);
>   }
>
> -static void __devexit dfx_pci_unregister(struct pci_dev *pdev)
> +static void dfx_pci_unregister(struct pci_dev *pdev)
>   {
>   	dfx_unregister(&pdev->dev);
>   }
> @@ -3704,7 +3704,7 @@ static int __maybe_unused dfx_dev_register(struct device *dev)
>   	return status;
>   }
>
> -static int __devexit __maybe_unused dfx_dev_unregister(struct device *dev)
> +static int __maybe_unused dfx_dev_unregister(struct device *dev)
>   {
>   	put_device(dev);
>   	dfx_unregister(dev);
> @@ -3724,7 +3724,7 @@ static int dfx_init(void)
>   	return status;
>   }
>
> -static void __devexit dfx_cleanup(void)
> +static void dfx_cleanup(void)
>   {
>   	tc_unregister_driver(&dfx_tc_driver);
>   	eisa_driver_unregister(&dfx_eisa_driver);
> diff --git a/drivers/net/fddi/skfp/skfddi.c b/drivers/net/fddi/skfp/skfddi.c
> index cbabb74..d5bd563 100644
> --- a/drivers/net/fddi/skfp/skfddi.c
> +++ b/drivers/net/fddi/skfp/skfddi.c
> @@ -321,7 +321,7 @@ err_out1:
>   /*
>    * Called for each adapter board from pci_unregister_driver
>    */
> -static void __devexit skfp_remove_one(struct pci_dev *pdev)
> +static void skfp_remove_one(struct pci_dev *pdev)
>   {
>   	struct net_device *p = pci_get_drvdata(pdev);
>   	struct s_smc *lp = netdev_priv(p);
> diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c
> index 12b7ff9..6be95ed 100644
> --- a/drivers/net/hippi/rrunner.c
> +++ b/drivers/net/hippi/rrunner.c
> @@ -221,7 +221,7 @@ static int rr_init_one(struct pci_dev *pdev,
>   	return ret;
>   }
>
> -static void __devexit rr_remove_one (struct pci_dev *pdev)
> +static void rr_remove_one (struct pci_dev *pdev)
>   {
>   	struct net_device *dev = pci_get_drvdata(pdev);
>   	struct rr_private *rr = netdev_priv(dev);
> diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
> index 1198c6b..a4a62e1 100644
> --- a/drivers/net/ieee802154/at86rf230.c
> +++ b/drivers/net/ieee802154/at86rf230.c
> @@ -920,7 +920,7 @@ err_fill:
>   	return rc;
>   }
>
> -static int __devexit at86rf230_remove(struct spi_device *spi)
> +static int at86rf230_remove(struct spi_device *spi)
>   {
>   	struct at86rf230_local *lp = spi_get_drvdata(spi);
>
> diff --git a/drivers/net/ieee802154/fakehard.c b/drivers/net/ieee802154/fakehard.c
> index fd0438c..1e9cb0b 100644
> --- a/drivers/net/ieee802154/fakehard.c
> +++ b/drivers/net/ieee802154/fakehard.c
> @@ -412,7 +412,7 @@ out:
>   	return err;
>   }
>
> -static int __devexit ieee802154fake_remove(struct platform_device *pdev)
> +static int ieee802154fake_remove(struct platform_device *pdev)
>   {
>   	struct net_device *dev = platform_get_drvdata(pdev);
>   	unregister_netdev(dev);
> diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c
> index e4b0e38..b8d2217 100644
> --- a/drivers/net/ieee802154/fakelb.c
> +++ b/drivers/net/ieee802154/fakelb.c
> @@ -253,7 +253,7 @@ err_alloc:
>   	return err;
>   }
>
> -static int __devexit fakelb_remove(struct platform_device *pdev)
> +static int fakelb_remove(struct platform_device *pdev)
>   {
>   	struct fakelb_priv *priv = platform_get_drvdata(pdev);
>   	struct fakelb_dev_priv *dp, *temp;
> diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
> index ef41051..3f2c7aa 100644
> --- a/drivers/net/ieee802154/mrf24j40.c
> +++ b/drivers/net/ieee802154/mrf24j40.c
> @@ -711,7 +711,7 @@ err_devrec:
>   	return ret;
>   }
>
> -static int __devexit mrf24j40_remove(struct spi_device *spi)
> +static int mrf24j40_remove(struct spi_device *spi)
>   {
>   	struct mrf24j40 *devrec = dev_get_drvdata(&spi->dev);
>
> diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c
> index 7843f50..b5151e4 100644
> --- a/drivers/net/irda/au1k_ir.c
> +++ b/drivers/net/irda/au1k_ir.c
> @@ -921,7 +921,7 @@ out:
>   	return err;
>   }
>
> -static int __devexit au1k_irda_remove(struct platform_device *pdev)
> +static int au1k_irda_remove(struct platform_device *pdev)
>   {
>   	struct net_device *dev = platform_get_drvdata(pdev);
>   	struct au1k_private *aup = netdev_priv(dev);
> diff --git a/drivers/net/irda/bfin_sir.c b/drivers/net/irda/bfin_sir.c
> index 98c903f..fed4a05 100644
> --- a/drivers/net/irda/bfin_sir.c
> +++ b/drivers/net/irda/bfin_sir.c
> @@ -775,7 +775,7 @@ err_mem_0:
>   	return err;
>   }
>
> -static int __devexit bfin_sir_remove(struct platform_device *pdev)
> +static int bfin_sir_remove(struct platform_device *pdev)
>   {
>   	struct bfin_sir_port *sir_port;
>   	struct net_device *dev = NULL;
> diff --git a/drivers/net/irda/sh_irda.c b/drivers/net/irda/sh_irda.c
> index 2d3f3e6..9448587 100644
> --- a/drivers/net/irda/sh_irda.c
> +++ b/drivers/net/irda/sh_irda.c
> @@ -825,7 +825,7 @@ exit:
>   	return err;
>   }
>
> -static int __devexit sh_irda_remove(struct platform_device *pdev)
> +static int sh_irda_remove(struct platform_device *pdev)
>   {
>   	struct net_device *ndev = platform_get_drvdata(pdev);
>   	struct sh_irda_self *self = netdev_priv(ndev);
> diff --git a/drivers/net/irda/sh_sir.c b/drivers/net/irda/sh_sir.c
> index 150b56c..24aefcd 100644
> --- a/drivers/net/irda/sh_sir.c
> +++ b/drivers/net/irda/sh_sir.c
> @@ -783,7 +783,7 @@ exit:
>   	return err;
>   }
>
> -static int __devexit sh_sir_remove(struct platform_device *pdev)
> +static int sh_sir_remove(struct platform_device *pdev)
>   {
>   	struct net_device *ndev = platform_get_drvdata(pdev);
>   	struct sh_sir_self *self = netdev_priv(ndev);
> diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c
> index d678f52..5488247 100644
> --- a/drivers/net/irda/via-ircc.c
> +++ b/drivers/net/irda/via-ircc.c
> @@ -103,7 +103,7 @@ static void hwreset(struct via_ircc_cb *self);
>   static int via_ircc_dma_xmit(struct via_ircc_cb *self, u16 iobase);
>   static int upload_rxdata(struct via_ircc_cb *self, int iobase);
>   static int via_init_one (struct pci_dev *pcidev, const struct pci_device_id *id);
> -static void __devexit via_remove_one (struct pci_dev *pdev);
> +static void via_remove_one (struct pci_dev *pdev);
>
>   /* FIXME : Should use udelay() instead, even if we are x86 only - Jean II */
>   static void iodelay(int udelay)
> @@ -424,7 +424,7 @@ static int via_ircc_open(struct pci_dev *pdev, chipio_t * info,
>    *    Close driver instance
>    *
>    */
> -static void __devexit via_remove_one(struct pci_dev *pdev)
> +static void via_remove_one(struct pci_dev *pdev)
>   {
>   	struct via_ircc_cb *self = pci_get_drvdata(pdev);
>   	int iobase;
> diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
> index e255b65..2f99f88 100644
> --- a/drivers/net/irda/vlsi_ir.c
> +++ b/drivers/net/irda/vlsi_ir.c
> @@ -1699,7 +1699,7 @@ out:
>   	return -ENODEV;
>   }
>
> -static void __devexit vlsi_irda_remove(struct pci_dev *pdev)
> +static void vlsi_irda_remove(struct pci_dev *pdev)
>   {
>   	struct net_device *ndev = pci_get_drvdata(pdev);
>   	vlsi_irda_dev_t *idev;
> diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
> index bf30b1d..6b2fdb8 100644
> --- a/drivers/net/phy/mdio-gpio.c
> +++ b/drivers/net/phy/mdio-gpio.c
> @@ -173,7 +173,7 @@ static void mdio_gpio_bus_deinit(struct device *dev)
>   	kfree(bitbang);
>   }
>
> -static void __devexit mdio_gpio_bus_destroy(struct device *dev)
> +static void mdio_gpio_bus_destroy(struct device *dev)
>   {
>   	struct mii_bus *bus = dev_get_drvdata(dev);
>
> @@ -210,7 +210,7 @@ static int mdio_gpio_probe(struct platform_device *pdev)
>   	return ret;
>   }
>
> -static int __devexit mdio_gpio_remove(struct platform_device *pdev)
> +static int mdio_gpio_remove(struct platform_device *pdev)
>   {
>   	mdio_gpio_bus_destroy(&pdev->dev);
>
> diff --git a/drivers/net/phy/mdio-mux-gpio.c b/drivers/net/phy/mdio-mux-gpio.c
> index 23ee064..0c9accb 100644
> --- a/drivers/net/phy/mdio-mux-gpio.c
> +++ b/drivers/net/phy/mdio-mux-gpio.c
> @@ -104,7 +104,7 @@ err:
>   	return r;
>   }
>
> -static int __devexit mdio_mux_gpio_remove(struct platform_device *pdev)
> +static int mdio_mux_gpio_remove(struct platform_device *pdev)
>   {
>   	struct mdio_mux_gpio_state *s = pdev->dev.platform_data;
>   	mdio_mux_uninit(s->mux_handle);
> diff --git a/drivers/net/phy/mdio-mux-mmioreg.c b/drivers/net/phy/mdio-mux-mmioreg.c
> index a38951f..9733bd2 100644
> --- a/drivers/net/phy/mdio-mux-mmioreg.c
> +++ b/drivers/net/phy/mdio-mux-mmioreg.c
> @@ -137,7 +137,7 @@ static int mdio_mux_mmioreg_probe(struct platform_device *pdev)
>   	return 0;
>   }
>
> -static int __devexit mdio_mux_mmioreg_remove(struct platform_device *pdev)
> +static int mdio_mux_mmioreg_remove(struct platform_device *pdev)
>   {
>   	struct mdio_mux_mmioreg_state *s = dev_get_platdata(&pdev->dev);
>
> diff --git a/drivers/net/phy/mdio-octeon.c b/drivers/net/phy/mdio-octeon.c
> index 7a07985..09297fe 100644
> --- a/drivers/net/phy/mdio-octeon.c
> +++ b/drivers/net/phy/mdio-octeon.c
> @@ -159,7 +159,7 @@ fail:
>   	return err;
>   }
>
> -static int __devexit octeon_mdiobus_remove(struct platform_device *pdev)
> +static int octeon_mdiobus_remove(struct platform_device *pdev)
>   {
>   	struct octeon_mdiobus *bus;
>   	union cvmx_smix_en smi_en;
> diff --git a/drivers/net/phy/spi_ks8995.c b/drivers/net/phy/spi_ks8995.c
> index 1321c99..41eb8ff 100644
> --- a/drivers/net/phy/spi_ks8995.c
> +++ b/drivers/net/phy/spi_ks8995.c
> @@ -332,7 +332,7 @@ err_drvdata:
>   	return err;
>   }
>
> -static int __devexit ks8995_remove(struct spi_device *spi)
> +static int ks8995_remove(struct spi_device *spi)
>   {
>   	struct ks8995_data      *ks8995;
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index b0c1630..c5f0ed2 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -1195,7 +1195,7 @@ static void remove_vq_common(struct virtnet_info *vi)
>   		__free_pages(get_a_page(vi, GFP_KERNEL), 0);
>   }
>
> -static void __devexit virtnet_remove(struct virtio_device *vdev)
> +static void virtnet_remove(struct virtio_device *vdev)
>   {
>   	struct virtnet_info *vi = vdev->priv;
>
> diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
> index ac322e5..71b762f 100644
> --- a/drivers/net/vmxnet3/vmxnet3_drv.c
> +++ b/drivers/net/vmxnet3/vmxnet3_drv.c
> @@ -3096,7 +3096,7 @@ err_alloc_shared:
>   }
>
>
> -static void __devexit
> +static void
>   vmxnet3_remove_device(struct pci_dev *pdev)
>   {
>   	struct net_device *netdev = pci_get_drvdata(pdev);
> diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
> index 863df17..d502230 100644
> --- a/drivers/net/wan/dscc4.c
> +++ b/drivers/net/wan/dscc4.c
> @@ -1968,7 +1968,7 @@ err_out:
>   	return -ENOMEM;
>   }
>
> -static void __devexit dscc4_remove_one(struct pci_dev *pdev)
> +static void dscc4_remove_one(struct pci_dev *pdev)
>   {
>   	struct dscc4_pci_priv *ppriv;
>   	struct dscc4_dev_priv *root;
> diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
> index dbbe06e..d7adba4 100644
> --- a/drivers/net/wan/farsync.c
> +++ b/drivers/net/wan/farsync.c
> @@ -2615,7 +2615,7 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>   /*
>    *      Cleanup and close down a card
>    */
> -static void __devexit
> +static void
>   fst_remove_one(struct pci_dev *pdev)
>   {
>   	struct fst_card_info *card;
> diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
> index beecbe8..b056691 100644
> --- a/drivers/net/wan/ixp4xx_hss.c
> +++ b/drivers/net/wan/ixp4xx_hss.c
> @@ -1375,7 +1375,7 @@ err_free:
>   	return err;
>   }
>
> -static int __devexit hss_remove_one(struct platform_device *pdev)
> +static int hss_remove_one(struct platform_device *pdev)
>   {
>   	struct port *port = platform_get_drvdata(pdev);
>
> diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
> index 41a401a..0e443fd 100644
> --- a/drivers/net/wan/lmc/lmc_main.c
> +++ b/drivers/net/wan/lmc/lmc_main.c
> @@ -986,7 +986,7 @@ err_req_io:
>   /*
>    * Called from pci when removing module.
>    */
> -static void __devexit lmc_remove_one(struct pci_dev *pdev)
> +static void lmc_remove_one(struct pci_dev *pdev)
>   {
>   	struct net_device *dev = pci_get_drvdata(pdev);
>
> diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
> index bd89a29..3d339e0 100644
> --- a/drivers/net/wireless/adm8211.c
> +++ b/drivers/net/wireless/adm8211.c
> @@ -1935,7 +1935,7 @@ static int adm8211_probe(struct pci_dev *pdev,
>   }
>
>
> -static void __devexit adm8211_remove(struct pci_dev *pdev)
> +static void adm8211_remove(struct pci_dev *pdev)
>   {
>   	struct ieee80211_hw *dev = pci_get_drvdata(pdev);
>   	struct adm8211_priv *priv;
> diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
> index b010f41..5329541 100644
> --- a/drivers/net/wireless/airo.c
> +++ b/drivers/net/wireless/airo.c
> @@ -5606,7 +5606,7 @@ static int airo_pci_probe(struct pci_dev *pdev,
>   	return 0;
>   }
>
> -static void __devexit airo_pci_remove(struct pci_dev *pdev)
> +static void airo_pci_remove(struct pci_dev *pdev)
>   {
>   	struct net_device *dev = pci_get_drvdata(pdev);
>
> diff --git a/drivers/net/wireless/ath/ath5k/pci.c b/drivers/net/wireless/ath/ath5k/pci.c
> index 1a78ba3..859db7c 100644
> --- a/drivers/net/wireless/ath/ath5k/pci.c
> +++ b/drivers/net/wireless/ath/ath5k/pci.c
> @@ -285,7 +285,7 @@ err:
>   	return ret;
>   }
>
> -static void __devexit
> +static void
>   ath5k_pci_remove(struct pci_dev *pdev)
>   {
>   	struct ieee80211_hw *hw = pci_get_drvdata(pdev);
> diff --git a/drivers/net/wireless/atmel_pci.c b/drivers/net/wireless/atmel_pci.c
> index 1c12fec..c1b159e 100644
> --- a/drivers/net/wireless/atmel_pci.c
> +++ b/drivers/net/wireless/atmel_pci.c
> @@ -69,7 +69,7 @@ static int atmel_pci_probe(struct pci_dev *pdev,
>   	return 0;
>   }
>
> -static void __devexit atmel_pci_remove(struct pci_dev *pdev)
> +static void atmel_pci_remove(struct pci_dev *pdev)
>   {
>   	stop_atmel_card(pci_get_drvdata(pdev));
>   }
> diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c
> index 3506cca..f2ea2ce 100644
> --- a/drivers/net/wireless/b43/pcmcia.c
> +++ b/drivers/net/wireless/b43/pcmcia.c
> @@ -110,7 +110,7 @@ out_error:
>   	return err;
>   }
>
> -static void __devexit b43_pcmcia_remove(struct pcmcia_device *dev)
> +static void b43_pcmcia_remove(struct pcmcia_device *dev)
>   {
>   	struct ssb_bus *ssb = dev->priv;
>
> diff --git a/drivers/net/wireless/b43/sdio.c b/drivers/net/wireless/b43/sdio.c
> index d2b1f98..59a5218 100644
> --- a/drivers/net/wireless/b43/sdio.c
> +++ b/drivers/net/wireless/b43/sdio.c
> @@ -171,7 +171,7 @@ out:
>   	return error;
>   }
>
> -static void __devexit b43_sdio_remove(struct sdio_func *func)
> +static void b43_sdio_remove(struct sdio_func *func)
>   {
>   	struct b43_sdio *sdio = sdio_get_drvdata(func);
>
> diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
> index b96c615..7588484 100644
> --- a/drivers/net/wireless/ipw2x00/ipw2100.c
> +++ b/drivers/net/wireless/ipw2x00/ipw2100.c
> @@ -6413,7 +6413,7 @@ out:
>   	goto out;
>   }
>
> -static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev)
> +static void ipw2100_pci_remove_one(struct pci_dev *pci_dev)
>   {
>   	struct ipw2100_priv *priv = pci_get_drvdata(pci_dev);
>   	struct net_device *dev = priv->net_dev;
> diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
> index 3f099a6..941c6b5 100644
> --- a/drivers/net/wireless/ipw2x00/ipw2200.c
> +++ b/drivers/net/wireless/ipw2x00/ipw2200.c
> @@ -11895,7 +11895,7 @@ static int ipw_pci_probe(struct pci_dev *pdev,
>   	return err;
>   }
>
> -static void __devexit ipw_pci_remove(struct pci_dev *pdev)
> +static void ipw_pci_remove(struct pci_dev *pdev)
>   {
>   	struct ipw_priv *priv = pci_get_drvdata(pdev);
>   	struct list_head *p, *q;
> diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
> index 88fdd39..d604b40 100644
> --- a/drivers/net/wireless/iwlegacy/3945-mac.c
> +++ b/drivers/net/wireless/iwlegacy/3945-mac.c
> @@ -3794,7 +3794,7 @@ out:
>   	return err;
>   }
>
> -static void __devexit
> +static void
>   il3945_pci_remove(struct pci_dev *pdev)
>   {
>   	struct il_priv *il = pci_get_drvdata(pdev);
> diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
> index 14e0a94..569e1ae5 100644
> --- a/drivers/net/wireless/iwlegacy/4965-mac.c
> +++ b/drivers/net/wireless/iwlegacy/4965-mac.c
> @@ -6664,7 +6664,7 @@ out:
>   	return err;
>   }
>
> -static void __devexit
> +static void
>   il4965_pci_remove(struct pci_dev *pdev)
>   {
>   	struct il_priv *il = pci_get_drvdata(pdev);
> diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c
> index 7cb27af..1f21d60 100644
> --- a/drivers/net/wireless/iwlwifi/pcie/drv.c
> +++ b/drivers/net/wireless/iwlwifi/pcie/drv.c
> @@ -294,7 +294,7 @@ out_free_trans:
>   	return -EFAULT;
>   }
>
> -static void __devexit iwl_pci_remove(struct pci_dev *pdev)
> +static void iwl_pci_remove(struct pci_dev *pdev)
>   {
>   	struct iwl_trans *trans = pci_get_drvdata(pdev);
>   	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
> diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
> index abc32e3..4bb6574 100644
> --- a/drivers/net/wireless/libertas/if_spi.c
> +++ b/drivers/net/wireless/libertas/if_spi.c
> @@ -1226,7 +1226,7 @@ out:
>   	return err;
>   }
>
> -static int __devexit libertas_spi_remove(struct spi_device *spi)
> +static int libertas_spi_remove(struct spi_device *spi)
>   {
>   	struct if_spi_card *card = spi_get_drvdata(spi);
>   	struct lbs_private *priv = card->priv;
> diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
> index b9f71fd..19cad01 100644
> --- a/drivers/net/wireless/mwl8k.c
> +++ b/drivers/net/wireless/mwl8k.c
> @@ -5872,12 +5872,12 @@ err_disable_device:
>   	return rc;
>   }
>
> -static void __devexit mwl8k_shutdown(struct pci_dev *pdev)
> +static void mwl8k_shutdown(struct pci_dev *pdev)
>   {
>   	printk(KERN_ERR "===>%s(%u)\n", __func__, __LINE__);
>   }
>
> -static void __devexit mwl8k_remove(struct pci_dev *pdev)
> +static void mwl8k_remove(struct pci_dev *pdev)
>   {
>   	struct ieee80211_hw *hw = pci_get_drvdata(pdev);
>   	struct mwl8k_priv *priv;
> diff --git a/drivers/net/wireless/orinoco/orinoco_nortel.c b/drivers/net/wireless/orinoco/orinoco_nortel.c
> index f286540..d73fdf6 100644
> --- a/drivers/net/wireless/orinoco/orinoco_nortel.c
> +++ b/drivers/net/wireless/orinoco/orinoco_nortel.c
> @@ -255,7 +255,7 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev,
>   	return err;
>   }
>
> -static void __devexit orinoco_nortel_remove_one(struct pci_dev *pdev)
> +static void orinoco_nortel_remove_one(struct pci_dev *pdev)
>   {
>   	struct orinoco_private *priv = pci_get_drvdata(pdev);
>   	struct orinoco_pci_card *card = priv->card;
> diff --git a/drivers/net/wireless/orinoco/orinoco_pci.c b/drivers/net/wireless/orinoco/orinoco_pci.c
> index bf6d436..677bf14 100644
> --- a/drivers/net/wireless/orinoco/orinoco_pci.c
> +++ b/drivers/net/wireless/orinoco/orinoco_pci.c
> @@ -199,7 +199,7 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
>   	return err;
>   }
>
> -static void __devexit orinoco_pci_remove_one(struct pci_dev *pdev)
> +static void orinoco_pci_remove_one(struct pci_dev *pdev)
>   {
>   	struct orinoco_private *priv = pci_get_drvdata(pdev);
>
> diff --git a/drivers/net/wireless/orinoco/orinoco_plx.c b/drivers/net/wireless/orinoco/orinoco_plx.c
> index 63a614f..2559dbd 100644
> --- a/drivers/net/wireless/orinoco/orinoco_plx.c
> +++ b/drivers/net/wireless/orinoco/orinoco_plx.c
> @@ -294,7 +294,7 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
>   	return err;
>   }
>
> -static void __devexit orinoco_plx_remove_one(struct pci_dev *pdev)
> +static void orinoco_plx_remove_one(struct pci_dev *pdev)
>   {
>   	struct orinoco_private *priv = pci_get_drvdata(pdev);
>   	struct orinoco_pci_card *card = priv->card;
> diff --git a/drivers/net/wireless/orinoco/orinoco_tmd.c b/drivers/net/wireless/orinoco/orinoco_tmd.c
> index f67f43e..42afeee 100644
> --- a/drivers/net/wireless/orinoco/orinoco_tmd.c
> +++ b/drivers/net/wireless/orinoco/orinoco_tmd.c
> @@ -188,7 +188,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
>   	return err;
>   }
>
> -static void __devexit orinoco_tmd_remove_one(struct pci_dev *pdev)
> +static void orinoco_tmd_remove_one(struct pci_dev *pdev)
>   {
>   	struct orinoco_private *priv = pci_get_drvdata(pdev);
>   	struct orinoco_pci_card *card = priv->card;
> diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c
> index e5b29e9..04eb0ed 100644
> --- a/drivers/net/wireless/p54/p54pci.c
> +++ b/drivers/net/wireless/p54/p54pci.c
> @@ -639,7 +639,7 @@ static int p54p_probe(struct pci_dev *pdev,
>   	return err;
>   }
>
> -static void __devexit p54p_remove(struct pci_dev *pdev)
> +static void p54p_remove(struct pci_dev *pdev)
>   {
>   	struct ieee80211_hw *dev = pci_get_drvdata(pdev);
>   	struct p54p_priv *priv;
> diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
> index d75ab3e..4fd49a0 100644
> --- a/drivers/net/wireless/p54/p54spi.c
> +++ b/drivers/net/wireless/p54/p54spi.c
> @@ -683,7 +683,7 @@ err_free:
>   	return ret;
>   }
>
> -static int __devexit p54spi_remove(struct spi_device *spi)
> +static int p54spi_remove(struct spi_device *spi)
>   {
>   	struct p54s_priv *priv = dev_get_drvdata(&spi->dev);
>
> diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
> index 000f7ba..e71c702 100644
> --- a/drivers/net/wireless/p54/p54usb.c
> +++ b/drivers/net/wireless/p54/p54usb.c
> @@ -1057,7 +1057,7 @@ static int p54u_probe(struct usb_interface *intf,
>   	return err;
>   }
>
> -static void __devexit p54u_disconnect(struct usb_interface *intf)
> +static void p54u_disconnect(struct usb_interface *intf)
>   {
>   	struct ieee80211_hw *dev = usb_get_intfdata(intf);
>   	struct p54u_priv *priv;
> diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c
> index 6a5c0b8..4af3f91 100644
> --- a/drivers/net/wireless/rtl818x/rtl8180/dev.c
> +++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c
> @@ -1131,7 +1131,7 @@ static int rtl8180_probe(struct pci_dev *pdev,
>   	return err;
>   }
>
> -static void __devexit rtl8180_remove(struct pci_dev *pdev)
> +static void rtl8180_remove(struct pci_dev *pdev)
>   {
>   	struct ieee80211_hw *dev = pci_get_drvdata(pdev);
>   	struct rtl8180_priv *priv;
> diff --git a/drivers/net/wireless/rtl818x/rtl8187/dev.c b/drivers/net/wireless/rtl818x/rtl8187/dev.c
> index f879bc3..be36935 100644
> --- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
> +++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
> @@ -1639,7 +1639,7 @@ static int rtl8187_probe(struct usb_interface *intf,
>   	return err;
>   }
>
> -static void __devexit rtl8187_disconnect(struct usb_interface *intf)
> +static void rtl8187_disconnect(struct usb_interface *intf)
>   {
>   	struct ieee80211_hw *dev = usb_get_intfdata(intf);
>   	struct rtl8187_priv *priv;
> diff --git a/drivers/net/wireless/ti/wl1251/sdio.c b/drivers/net/wireless/ti/wl1251/sdio.c
> index e3f287f..e57ee48 100644
> --- a/drivers/net/wireless/ti/wl1251/sdio.c
> +++ b/drivers/net/wireless/ti/wl1251/sdio.c
> @@ -305,7 +305,7 @@ out_free_hw:
>   	return ret;
>   }
>
> -static void __devexit wl1251_sdio_remove(struct sdio_func *func)
> +static void wl1251_sdio_remove(struct sdio_func *func)
>   {
>   	struct wl1251 *wl = sdio_get_drvdata(func);
>   	struct wl1251_sdio *wl_sdio = wl->if_priv;
> diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c
> index 640a3d5..3b266d3 100644
> --- a/drivers/net/wireless/ti/wl1251/spi.c
> +++ b/drivers/net/wireless/ti/wl1251/spi.c
> @@ -309,7 +309,7 @@ static int wl1251_spi_probe(struct spi_device *spi)
>   	return ret;
>   }
>
> -static int __devexit wl1251_spi_remove(struct spi_device *spi)
> +static int wl1251_spi_remove(struct spi_device *spi)
>   {
>   	struct wl1251 *wl = dev_get_drvdata(&spi->dev);
>
> diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
> index 2dd4ada..dd38f61 100644
> --- a/drivers/net/wireless/ti/wlcore/main.c
> +++ b/drivers/net/wireless/ti/wlcore/main.c
> @@ -5682,7 +5682,7 @@ int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev)
>   }
>   EXPORT_SYMBOL_GPL(wlcore_probe);
>
> -int __devexit wlcore_remove(struct platform_device *pdev)
> +int wlcore_remove(struct platform_device *pdev)
>   {
>   	struct wl1271 *wl = platform_get_drvdata(pdev);
>
> diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
> index 7bf612c..646f703 100644
> --- a/drivers/net/wireless/ti/wlcore/sdio.c
> +++ b/drivers/net/wireless/ti/wlcore/sdio.c
> @@ -319,7 +319,7 @@ out:
>   	return ret;
>   }
>
> -static void __devexit wl1271_remove(struct sdio_func *func)
> +static void wl1271_remove(struct sdio_func *func)
>   {
>   	struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func);
>
> diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
> index ee39484..f06f477 100644
> --- a/drivers/net/wireless/ti/wlcore/spi.c
> +++ b/drivers/net/wireless/ti/wlcore/spi.c
> @@ -403,7 +403,7 @@ out:
>   	return ret;
>   }
>
> -static int __devexit wl1271_remove(struct spi_device *spi)
> +static int wl1271_remove(struct spi_device *spi)
>   {
>   	struct wl12xx_spi_glue *glue = spi_get_drvdata(spi);
>
> diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
> index adc6152..c388493 100644
> --- a/drivers/net/wireless/ti/wlcore/wlcore.h
> +++ b/drivers/net/wireless/ti/wlcore/wlcore.h
> @@ -415,7 +415,7 @@ struct wl1271 {
>   };
>
>   int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);
> -int __devexit wlcore_remove(struct platform_device *pdev);
> +int wlcore_remove(struct platform_device *pdev);
>   struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size);
>   int wlcore_free_hw(struct wl1271 *wl);
>   int wlcore_set_key(struct wl1271 *wl, enum set_key_cmd cmd,
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index 6f695fc..b31198c 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -1911,7 +1911,7 @@ static const struct xenbus_device_id netfront_ids[] = {
>   };
>
>
> -static int __devexit xennet_remove(struct xenbus_device *dev)
> +static int xennet_remove(struct xenbus_device *dev)
>   {
>   	struct netfront_info *info = dev_get_drvdata(&dev->dev);
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 20:25:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 20:25:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaXu7-0004nM-D7; Mon, 19 Nov 2012 20:25:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1TaXu5-0004n7-JG
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 20:25:13 +0000
Received: from [85.158.139.83:28156] by server-14.bemta-5.messagelabs.com id
	88/DB-21768-8A59AA05; Mon, 19 Nov 2012 20:25:12 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-2.tower-182.messagelabs.com!1353356710!30991848!1
X-Originating-IP: [209.85.210.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20169 invoked from network); 19 Nov 2012 20:25:11 -0000
Received: from mail-ia0-f173.google.com (HELO mail-ia0-f173.google.com)
	(209.85.210.173)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 20:25:11 -0000
Received: by mail-ia0-f173.google.com with SMTP id w21so2885176iac.32
	for <xen-devel@lists.xen.org>; Mon, 19 Nov 2012 12:25:09 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer
	:x-gm-message-state;
	bh=Je5iPhTOpkNoVGSzppKQh0E6DbsuwjyyJ2mJ8ivUleg=;
	b=ltUKqLhd3hDU26SjiUOQpkwAvYhv4K+2eCqZOQFG/sBz4NZPn1TtoOnJzLf/79GwLQ
	qmyb08xZpOAeRAifkSHmym+9O4AiEu9NysVQePRbPiX29NukyU1b+2vzHnZqupahDHAB
	5osGswCZf4PZtJgE6a2BEmkDfIlSO7HS8nh1o/dQYjcbWP/QECjXZyKJIZLU9bBrkLUb
	bj4tx4so4Vvgi/Y4kTZthr1ECdNJZFk3A0qUiCwnfDyK80DvLtHxMCX/I/nx7qNCjoce
	15kvvmtZk9KMY55DgitHoKTDDGfv5Cy9A9p3Ik1gjuUyBgbMuRqEjIbsGbYEO/c8y7R1
	+1ew==
Received: by 10.50.57.200 with SMTP id k8mr7854781igq.29.1353356709584;
	Mon, 19 Nov 2012 12:25:09 -0800 (PST)
Received: from [192.168.15.1] ([206.223.182.18])
	by mx.google.com with ESMTPS id yf6sm8550297igb.0.2012.11.19.12.25.07
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 19 Nov 2012 12:25:08 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
In-Reply-To: <mailman.16877.1353355647.1399.xen-devel@lists.xen.org>
Date: Mon, 19 Nov 2012 15:25:06 -0500
Message-Id: <1F985F20-30DE-4E12-AC8B-68FCA5DABF8F@gridcentric.ca>
References: <mailman.16877.1353355647.1399.xen-devel@lists.xen.org>
To: xen-devel@lists.xen.org
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQnIb3ogcnYinNgSU+SDXu1+4S/DNfp6pUU/Ln3izzCeZA8H/0IeK3XmfkEt1U9LN/GxqD8m
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>, Tim Deegan <tim@xen.org>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop
	of	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>   
>> From: Jan Beulich [mailto:JBeulich@suse.com]
>> Sent: Friday, November 16, 2012 3:36 AM
>> To: Dan Magenheimer
>> Cc: xen-devel@lists.xen.org; Konrad Wilk; ZhigangWang; Keir Fraser; TimDeegan
>> Subject: RE: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
>> 
>>>>> On 15.11.12 at 19:00, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>>> From: Jan Beulich [mailto:JBeulich@suse.com]
>>>> Similarly, but perhaps of lower priority, there is no integration
>>>> with the low-mem handling.
>>> 
>>> I'd also consider this lower priority as Olaf and Andre
>>> have argued that the claim mechanism is not needed for
>>> sharing/paging so the two mechanisms may not
>>> be used together, at least for the foreseeable future.
>>> So I plan to skip this, unless you change your mind and
>>> consider it a showstopper for acceptance.
>> 
>> Skipping for the initial implementation is likely fine, but that
>> shouldn't mean deferring the integration indefinitely. Also,
>> I see no close connection between the low-mem feature
>> and sharing/paging (apart from Andres working on both).

It's simple. Right now one can't reliably set d->max_pages to the watermark at which a VM's allocation is temporarily allowed to grow -- by unsharing or paging in. This is because of (hopefully fixable!) short-comings in the mm layer and its interaction with wait queues, documented elsewhere.

So the best next approach (in place) is to get a synchronous kick as watermarks in available memory are reached. Otherwise a host memory manager is down to polling.

It could be the case that once d->max_pages can be set reliably, one would not need the low_mem virq any further. But it's just such a useful feature at infinitesimal cost, that I would not want it to see it gone. And it would still remain useful in any scenario in which the total sum of d->max_pages exceeds available memory (for whatever reason).

> 
> Fair enough.
> 
> After reviewing the thread where low_mem was submitted, I have to admit
> that I am a bit baffled as to when the low_mem handling would ever be
> necessary.   I suspect it is because the author and I are approaching

Little to be baffled at, as per above explanation. And probably a good idea to cc the author if so.

Andres

> memory management from a completely different paradigm (per discussion
> in an earlier thread where "claim" was first proposed), so that
> is probably better left for the deferred discussion of the
> integration.
> 
> So since you (Jan) do not consider this (lack of integration with
> low_mem) a showstopper for claim, I will set myself a reminder
> to initiate a new thread about this later.
> 
> Thanks,
> Dan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 20:25:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 20:25:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaXu7-0004nM-D7; Mon, 19 Nov 2012 20:25:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1TaXu5-0004n7-JG
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 20:25:13 +0000
Received: from [85.158.139.83:28156] by server-14.bemta-5.messagelabs.com id
	88/DB-21768-8A59AA05; Mon, 19 Nov 2012 20:25:12 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-2.tower-182.messagelabs.com!1353356710!30991848!1
X-Originating-IP: [209.85.210.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20169 invoked from network); 19 Nov 2012 20:25:11 -0000
Received: from mail-ia0-f173.google.com (HELO mail-ia0-f173.google.com)
	(209.85.210.173)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 20:25:11 -0000
Received: by mail-ia0-f173.google.com with SMTP id w21so2885176iac.32
	for <xen-devel@lists.xen.org>; Mon, 19 Nov 2012 12:25:09 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=content-type:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer
	:x-gm-message-state;
	bh=Je5iPhTOpkNoVGSzppKQh0E6DbsuwjyyJ2mJ8ivUleg=;
	b=ltUKqLhd3hDU26SjiUOQpkwAvYhv4K+2eCqZOQFG/sBz4NZPn1TtoOnJzLf/79GwLQ
	qmyb08xZpOAeRAifkSHmym+9O4AiEu9NysVQePRbPiX29NukyU1b+2vzHnZqupahDHAB
	5osGswCZf4PZtJgE6a2BEmkDfIlSO7HS8nh1o/dQYjcbWP/QECjXZyKJIZLU9bBrkLUb
	bj4tx4so4Vvgi/Y4kTZthr1ECdNJZFk3A0qUiCwnfDyK80DvLtHxMCX/I/nx7qNCjoce
	15kvvmtZk9KMY55DgitHoKTDDGfv5Cy9A9p3Ik1gjuUyBgbMuRqEjIbsGbYEO/c8y7R1
	+1ew==
Received: by 10.50.57.200 with SMTP id k8mr7854781igq.29.1353356709584;
	Mon, 19 Nov 2012 12:25:09 -0800 (PST)
Received: from [192.168.15.1] ([206.223.182.18])
	by mx.google.com with ESMTPS id yf6sm8550297igb.0.2012.11.19.12.25.07
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 19 Nov 2012 12:25:08 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
In-Reply-To: <mailman.16877.1353355647.1399.xen-devel@lists.xen.org>
Date: Mon, 19 Nov 2012 15:25:06 -0500
Message-Id: <1F985F20-30DE-4E12-AC8B-68FCA5DABF8F@gridcentric.ca>
References: <mailman.16877.1353355647.1399.xen-devel@lists.xen.org>
To: xen-devel@lists.xen.org
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQnIb3ogcnYinNgSU+SDXu1+4S/DNfp6pUU/Ln3izzCeZA8H/0IeK3XmfkEt1U9LN/GxqD8m
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>, Tim Deegan <tim@xen.org>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop
	of	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>   
>> From: Jan Beulich [mailto:JBeulich@suse.com]
>> Sent: Friday, November 16, 2012 3:36 AM
>> To: Dan Magenheimer
>> Cc: xen-devel@lists.xen.org; Konrad Wilk; ZhigangWang; Keir Fraser; TimDeegan
>> Subject: RE: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
>> 
>>>>> On 15.11.12 at 19:00, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>>> From: Jan Beulich [mailto:JBeulich@suse.com]
>>>> Similarly, but perhaps of lower priority, there is no integration
>>>> with the low-mem handling.
>>> 
>>> I'd also consider this lower priority as Olaf and Andre
>>> have argued that the claim mechanism is not needed for
>>> sharing/paging so the two mechanisms may not
>>> be used together, at least for the foreseeable future.
>>> So I plan to skip this, unless you change your mind and
>>> consider it a showstopper for acceptance.
>> 
>> Skipping for the initial implementation is likely fine, but that
>> shouldn't mean deferring the integration indefinitely. Also,
>> I see no close connection between the low-mem feature
>> and sharing/paging (apart from Andres working on both).

It's simple. Right now one can't reliably set d->max_pages to the watermark at which a VM's allocation is temporarily allowed to grow -- by unsharing or paging in. This is because of (hopefully fixable!) short-comings in the mm layer and its interaction with wait queues, documented elsewhere.

So the best next approach (in place) is to get a synchronous kick as watermarks in available memory are reached. Otherwise a host memory manager is down to polling.

It could be the case that once d->max_pages can be set reliably, one would not need the low_mem virq any further. But it's just such a useful feature at infinitesimal cost, that I would not want it to see it gone. And it would still remain useful in any scenario in which the total sum of d->max_pages exceeds available memory (for whatever reason).

> 
> Fair enough.
> 
> After reviewing the thread where low_mem was submitted, I have to admit
> that I am a bit baffled as to when the low_mem handling would ever be
> necessary.   I suspect it is because the author and I are approaching

Little to be baffled at, as per above explanation. And probably a good idea to cc the author if so.

Andres

> memory management from a completely different paradigm (per discussion
> in an earlier thread where "claim" was first proposed), so that
> is probably better left for the deferred discussion of the
> integration.
> 
> So since you (Jan) do not consider this (lack of integration with
> low_mem) a showstopper for claim, I will set myself a reminder
> to initiate a new thread about this later.
> 
> Thanks,
> Dan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 20:48:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 20:48:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaYGg-0005Vx-Lo; Mon, 19 Nov 2012 20:48:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaYGf-0005Vs-3o
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 20:48:33 +0000
Received: from [85.158.143.99:24813] by server-3.bemta-4.messagelabs.com id
	81/CE-06841-02B9AA05; Mon, 19 Nov 2012 20:48:32 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1353358110!25289762!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4905 invoked from network); 19 Nov 2012 20:48:30 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 20:48:30 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15889356"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 20:48:30 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 20:48:30 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TaYGb-0002C9-Op;
	Mon, 19 Nov 2012 20:48:29 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TaYGb-0000se-OG;
	Mon, 19 Nov 2012 20:48:29 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14423-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 19 Nov 2012 20:48:29 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14423: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14423 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14423/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-i386                    4 xen-build                 fail REGR. vs. 14416
 build-i386-oldkern            4 xen-build                 fail REGR. vs. 14416
 build-amd64                   4 xen-build                 fail REGR. vs. 14416
 build-amd64-oldkern           4 xen-build                 fail REGR. vs. 14416

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a

version targeted for testing:
 xen                  fe8034159ac2
baseline version:
 xen                  321f8487379b

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Wei Wang <wei.wang2@amd.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  fail    
 build-i386                                                   fail    
 build-amd64-oldkern                                          fail    
 build-i386-oldkern                                           fail    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26177:fe8034159ac2
tag:         tip
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:35 2012 +0000
    
    docs: Include prototype for HYPERVISOR_multicall
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26176:edad24bfa561
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:34 2012 +0000
    
    docs: Document HYPERVISOR_update_descriptor
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26175:b1d36147ac96
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Add ToC entry for start of day memory layout.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26174:dbb8d24bb5ad
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Document HYPERVISOR_mmuext_op
    
    Mark-up for inclusion of generated docs.
    
    Remove some trailing whitespace.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26173:26facad2f1a1
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:32 2012 +0000
    
    docs: document HYPERVISOR_update_va_mapping(_other_domain)
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26172:cfd2772cc717
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:31 2012 +0000
    
    docs: document/mark-up SCHEDOP_*
    
    The biggest subtlety here is there additional argument when op ==
    SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
    xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
    
    This patch moves some structs around but there is no functional change
    other than improved documentation.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26171:31668da0c4d3
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 15:15:12 2012 +0100
    
    AMD IOMMU: fix type of "bdf" parameter of update_intremap_entry_from_msi_msg()
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26170:380ad94f2adc
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:51 2012 +0000
    
    Remove tools/vtpm* from MAINTAINERS file
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26169:5a6225e40388
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:50 2012 +0000
    
    tools: Remove old vtpm stuff from tools/libxen
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26168:3dc18d679d04
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:49 2012 +0000
    
    Remove VTPM_TOOLS from config/Tools.mk.in
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26167:31dcc0e08754
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    xend: Remove old vtpm support from xm
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26166:d026f8abca51
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    minios: Update mini-os license to support GPL features
    
    This patch updates extras/mini-os/COPYING to explain
    which optional features are GPL and what the implications
    of enabling them are.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26165:42a7c393c390
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:47 2012 +0000
    
    minios: fix bug in lseek for mini-os
    
    lseek always used files[fd].file.offset. It should
    use the offset of whatever union member is actually
    being used.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26164:17539cec2b9d
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: get the number of cpus from device tree
    
    The system might have fewer cpus than the GIC supports.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26163:ddb109120dbd
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: flush D-cache and I-cache when appropriate
    
    - invalidate tlb after setting WXN
    - flush D-cache and I-cache after relocation;
    - invalidate D-cache after writing to smp_up_cpu;
    - flush I-cache after changing HTTBR;
    - flush I-cache and branch predictor after writing Xen text ptes.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26162:9da9781cc3fb
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 09:48:22 2012 +0100
    
    vscsiif: minor cleanup
    
    Remove a definition not belonging into the interface, and correct a
    few typos in comments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26161:9025a10c0561
user:        Wei Wang <wei.wang2@amd.com>
date:        Mon Nov 19 09:46:46 2012 +0100
    
    AMD IOMMU: Enable HPET broadcast msi remapping
    
    This patch enables hpet msi remapping for amd iommu.
    
    Signed-off-by: Wei Wang <wei.wang2@amd.com>
    
    - use the existing ACPI_IVHD_* #define-s
    - warn on finding more than one IVHD HPET entry
    - consolidate parameters of update_intremap_entry_from_msi_msg()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Committed-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26160:321f8487379b
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:29 2012 +0000
    
    xen/arm: wake up secondary cpus
    
    Secondary cpus are held by the firmware until we send an IPI to them.
    
    Reordered non-boot cpu wait loop to perform the check before waiting
    for an event, to handled the case where the event has already
    happened when we reach the loop.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 20:48:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 20:48:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaYGg-0005Vx-Lo; Mon, 19 Nov 2012 20:48:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaYGf-0005Vs-3o
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 20:48:33 +0000
Received: from [85.158.143.99:24813] by server-3.bemta-4.messagelabs.com id
	81/CE-06841-02B9AA05; Mon, 19 Nov 2012 20:48:32 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1353358110!25289762!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4905 invoked from network); 19 Nov 2012 20:48:30 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 20:48:30 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15889356"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 20:48:30 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 20:48:30 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TaYGb-0002C9-Op;
	Mon, 19 Nov 2012 20:48:29 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TaYGb-0000se-OG;
	Mon, 19 Nov 2012 20:48:29 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14423-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 19 Nov 2012 20:48:29 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14423: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14423 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14423/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-i386                    4 xen-build                 fail REGR. vs. 14416
 build-i386-oldkern            4 xen-build                 fail REGR. vs. 14416
 build-amd64                   4 xen-build                 fail REGR. vs. 14416
 build-amd64-oldkern           4 xen-build                 fail REGR. vs. 14416

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a

version targeted for testing:
 xen                  fe8034159ac2
baseline version:
 xen                  321f8487379b

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Wei Wang <wei.wang2@amd.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  fail    
 build-i386                                                   fail    
 build-amd64-oldkern                                          fail    
 build-i386-oldkern                                           fail    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26177:fe8034159ac2
tag:         tip
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:35 2012 +0000
    
    docs: Include prototype for HYPERVISOR_multicall
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26176:edad24bfa561
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:34 2012 +0000
    
    docs: Document HYPERVISOR_update_descriptor
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26175:b1d36147ac96
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Add ToC entry for start of day memory layout.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26174:dbb8d24bb5ad
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Document HYPERVISOR_mmuext_op
    
    Mark-up for inclusion of generated docs.
    
    Remove some trailing whitespace.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26173:26facad2f1a1
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:32 2012 +0000
    
    docs: document HYPERVISOR_update_va_mapping(_other_domain)
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26172:cfd2772cc717
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:31 2012 +0000
    
    docs: document/mark-up SCHEDOP_*
    
    The biggest subtlety here is there additional argument when op ==
    SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
    xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
    
    This patch moves some structs around but there is no functional change
    other than improved documentation.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26171:31668da0c4d3
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 15:15:12 2012 +0100
    
    AMD IOMMU: fix type of "bdf" parameter of update_intremap_entry_from_msi_msg()
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26170:380ad94f2adc
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:51 2012 +0000
    
    Remove tools/vtpm* from MAINTAINERS file
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26169:5a6225e40388
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:50 2012 +0000
    
    tools: Remove old vtpm stuff from tools/libxen
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26168:3dc18d679d04
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:49 2012 +0000
    
    Remove VTPM_TOOLS from config/Tools.mk.in
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26167:31dcc0e08754
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    xend: Remove old vtpm support from xm
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26166:d026f8abca51
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    minios: Update mini-os license to support GPL features
    
    This patch updates extras/mini-os/COPYING to explain
    which optional features are GPL and what the implications
    of enabling them are.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26165:42a7c393c390
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:47 2012 +0000
    
    minios: fix bug in lseek for mini-os
    
    lseek always used files[fd].file.offset. It should
    use the offset of whatever union member is actually
    being used.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26164:17539cec2b9d
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: get the number of cpus from device tree
    
    The system might have fewer cpus than the GIC supports.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26163:ddb109120dbd
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: flush D-cache and I-cache when appropriate
    
    - invalidate tlb after setting WXN
    - flush D-cache and I-cache after relocation;
    - invalidate D-cache after writing to smp_up_cpu;
    - flush I-cache after changing HTTBR;
    - flush I-cache and branch predictor after writing Xen text ptes.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26162:9da9781cc3fb
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 09:48:22 2012 +0100
    
    vscsiif: minor cleanup
    
    Remove a definition not belonging into the interface, and correct a
    few typos in comments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26161:9025a10c0561
user:        Wei Wang <wei.wang2@amd.com>
date:        Mon Nov 19 09:46:46 2012 +0100
    
    AMD IOMMU: Enable HPET broadcast msi remapping
    
    This patch enables hpet msi remapping for amd iommu.
    
    Signed-off-by: Wei Wang <wei.wang2@amd.com>
    
    - use the existing ACPI_IVHD_* #define-s
    - warn on finding more than one IVHD HPET entry
    - consolidate parameters of update_intremap_entry_from_msi_msg()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Committed-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26160:321f8487379b
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:29 2012 +0000
    
    xen/arm: wake up secondary cpus
    
    Secondary cpus are held by the firmware until we send an IPI to them.
    
    Reordered non-boot cpu wait loop to perform the check before waiting
    for an event, to handled the case where the event has already
    happened when we reach the loop.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 20:54:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 20:54:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaYM5-0005f0-Fh; Mon, 19 Nov 2012 20:54:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TaYM3-0005ev-Pt
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 20:54:08 +0000
Received: from [85.158.137.99:41713] by server-13.bemta-3.messagelabs.com id
	1C/DB-24887-E6C9AA05; Mon, 19 Nov 2012 20:54:06 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1353358444!18070222!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3MjI2NQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21927 invoked from network); 19 Nov 2012 20:54:06 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-10.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 19 Nov 2012 20:54:06 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAJKs1GD011340
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 19 Nov 2012 20:54:02 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAJKs0Zc023256
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 19 Nov 2012 20:54:01 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAJKs0Bi016074; Mon, 19 Nov 2012 14:54:00 -0600
MIME-Version: 1.0
Message-ID: <ea33a942-7e63-4339-85c6-35935ae5119b@default>
Date: Mon, 19 Nov 2012 12:53:57 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
	<1353062895.3499.205.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353062895.3499.205.camel@zakaz.uk.xensource.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, "Tim
	\(Xen.org\)" <tim@xen.org>, xen-devel@lists.xen.org,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall

Hi Ian --

> On Thu, 2012-11-15 at 19:15 +0000, Dan Magenheimer wrote:
> > > From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> > > Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> > >
> > > On Wed, 2012-11-14 at 23:55 +0000, Dan Magenheimer wrote:
> > >
> > > How does this interact with the feature which lets you create PV guests
> > > using only superpages? I believe is something Oracle added and still
> > > maintains (Dave added to the CC).
> > >
> > > Also doesn't this fail to make any sort of guarantee if you are building
> > > a 32 bit PV guest, since they require memory under a certain host
> > > address limit (160GB IIRC)?
> > >
> > > Basically neither of those cases benefit from this hypercall at all? I
> > > don't know what the usecase for the superpage PV guests is (but I
> > > suppose it is important to Oracle, at least). The 32 bit PV guest use
> > > case is still a pretty significant one which I think ought to be
> > > handled, otherwise any system built on top of this functionality will
> > > only work reliably in a subset of cases.
> >
> > The claim mechanism will not benefit PV superpages.  IIUC, the
> > design of the PV superpages will cause a domain launch to fail
> > if it requests 10000 superpages but Xen can only successfully
> > allocate 9999.  That's already very fragile.  Since the only
> > way currently to find out if there are 10000 superpages available
> > is to start allocating them, claim can't really help.
> 
> Well, you could always account the number of free superpages in the
> system, which would allow you to cover this case too.

Because of the nature of the buddy allocator (i.e. 4MB chunks are
kept separately from 2MB chunks even though a 4MB page contains
two 2MB pages), I don't think this is trivial.  Also, once
memory is fragmented, creation of a PV-superpages domain will fail
(relatively quickly) whether claiming first or not.  The situation
could be improved by adding defrag code to Xen (or "compaction"
as Linux calls it), which I'd be interested in pursuing, but that
is also non-trivial.  Last, once PVH is an available option,
community (and Oracle's) interest in PV+superpages may fade away
quickly.

So I agree that this is worth adding superpages to a to-do list
for future claim work, but I see it as a "would be nice to add later"
feature, not a showstopper.

> > For 32 bit PV guests, note that a claim does NOT have to be
> > staked prior to any allocation.  So if a toolstack needs
> > to enforce that some portion of allocated memory is under
> > a host address limit, it can (attempt to) allocate those pages,
> > then stake a claim for the rest.
> 
> For 32 bit PV guests this is *all* of the pages needed to build any 32
> bit PV guest.

I am ignorant of the details here, but this is _all_ of the
pages only on machines with >160GiB of physical memory, correct?
(If incorrect, just ignore the 160GB parts below :-)

> > Or just not use the claim mechanism at all.
> 
> So your use case has no requirement to be able to start 32 bit domains?
> Or whatever requirement you have the leads to the claim mechanism
> somehow doesn't apply to those sorts of guests? If not then why not?

Claim doesn't fail to start 32-bit PV domains, it just doesn't
help them avoid "failing slowly" [on machines with >160GiB of RAM].

32-bit PV domains are highly likely to be legacy domains with
much smaller RAM requirements [always <= 64GiB?] so "failing slowly"
is much less of a concern.

32-bit PV domains are on their way to obsolescence so I am (and
I believe Oracle would be) quite happy documenting that launching
them might result in conditions not seen when creating other domain
types... especially when other failure conditions already exist for
32-bit PV domains.

> As it stands it seems that any toolstack which wants to use claim would
> still have to cope with the fact that a potentially significant
> proportion of guests may still fail to build even after a claim has been
> successfully staked.

The problem being addressed here is "slow failure" when creating
a domain and this can currently occur with 100% of domain creations.
The proposed claim hypercall solves this problem for:

- All HVM domains and all future PVH domains
- All 64-bit PV domains [when system RAM < 5TiB]
- [All 32-bit PV domains when system RAM < 160GiB]

and, as you've observed, currently doesn't solve the problem for

- All 32-bit PV domains [except when system RAM > 160 GiB]
- PV domains with superpages=1 that "almost succeed" but fail

I see that as a pretty good start and, with the flags argument,
the proposal even has room for future extensions should they
be needed.

> Even if these shortcomings are acceptable in your specific scenario I
> don't see why we should be satisfied with a solution which is not more
> generally applicable.

I would welcome a solution which is more generally applicable
if you've got one.  Otherwise, I am very satisfied with this one.
If you'd like confirmation from Oracle management that they
are satisfied as well, I can encourage them to reply.

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 20:54:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 20:54:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaYM5-0005f0-Fh; Mon, 19 Nov 2012 20:54:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TaYM3-0005ev-Pt
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 20:54:08 +0000
Received: from [85.158.137.99:41713] by server-13.bemta-3.messagelabs.com id
	1C/DB-24887-E6C9AA05; Mon, 19 Nov 2012 20:54:06 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1353358444!18070222!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3MjI2NQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21927 invoked from network); 19 Nov 2012 20:54:06 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-10.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 19 Nov 2012 20:54:06 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAJKs1GD011340
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 19 Nov 2012 20:54:02 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAJKs0Zc023256
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 19 Nov 2012 20:54:01 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAJKs0Bi016074; Mon, 19 Nov 2012 14:54:00 -0600
MIME-Version: 1.0
Message-ID: <ea33a942-7e63-4339-85c6-35935ae5119b@default>
Date: Mon, 19 Nov 2012 12:53:57 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
	<1353062895.3499.205.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353062895.3499.205.camel@zakaz.uk.xensource.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, "Tim
	\(Xen.org\)" <tim@xen.org>, xen-devel@lists.xen.org,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall

Hi Ian --

> On Thu, 2012-11-15 at 19:15 +0000, Dan Magenheimer wrote:
> > > From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> > > Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> > >
> > > On Wed, 2012-11-14 at 23:55 +0000, Dan Magenheimer wrote:
> > >
> > > How does this interact with the feature which lets you create PV guests
> > > using only superpages? I believe is something Oracle added and still
> > > maintains (Dave added to the CC).
> > >
> > > Also doesn't this fail to make any sort of guarantee if you are building
> > > a 32 bit PV guest, since they require memory under a certain host
> > > address limit (160GB IIRC)?
> > >
> > > Basically neither of those cases benefit from this hypercall at all? I
> > > don't know what the usecase for the superpage PV guests is (but I
> > > suppose it is important to Oracle, at least). The 32 bit PV guest use
> > > case is still a pretty significant one which I think ought to be
> > > handled, otherwise any system built on top of this functionality will
> > > only work reliably in a subset of cases.
> >
> > The claim mechanism will not benefit PV superpages.  IIUC, the
> > design of the PV superpages will cause a domain launch to fail
> > if it requests 10000 superpages but Xen can only successfully
> > allocate 9999.  That's already very fragile.  Since the only
> > way currently to find out if there are 10000 superpages available
> > is to start allocating them, claim can't really help.
> 
> Well, you could always account the number of free superpages in the
> system, which would allow you to cover this case too.

Because of the nature of the buddy allocator (i.e. 4MB chunks are
kept separately from 2MB chunks even though a 4MB page contains
two 2MB pages), I don't think this is trivial.  Also, once
memory is fragmented, creation of a PV-superpages domain will fail
(relatively quickly) whether claiming first or not.  The situation
could be improved by adding defrag code to Xen (or "compaction"
as Linux calls it), which I'd be interested in pursuing, but that
is also non-trivial.  Last, once PVH is an available option,
community (and Oracle's) interest in PV+superpages may fade away
quickly.

So I agree that this is worth adding superpages to a to-do list
for future claim work, but I see it as a "would be nice to add later"
feature, not a showstopper.

> > For 32 bit PV guests, note that a claim does NOT have to be
> > staked prior to any allocation.  So if a toolstack needs
> > to enforce that some portion of allocated memory is under
> > a host address limit, it can (attempt to) allocate those pages,
> > then stake a claim for the rest.
> 
> For 32 bit PV guests this is *all* of the pages needed to build any 32
> bit PV guest.

I am ignorant of the details here, but this is _all_ of the
pages only on machines with >160GiB of physical memory, correct?
(If incorrect, just ignore the 160GB parts below :-)

> > Or just not use the claim mechanism at all.
> 
> So your use case has no requirement to be able to start 32 bit domains?
> Or whatever requirement you have the leads to the claim mechanism
> somehow doesn't apply to those sorts of guests? If not then why not?

Claim doesn't fail to start 32-bit PV domains, it just doesn't
help them avoid "failing slowly" [on machines with >160GiB of RAM].

32-bit PV domains are highly likely to be legacy domains with
much smaller RAM requirements [always <= 64GiB?] so "failing slowly"
is much less of a concern.

32-bit PV domains are on their way to obsolescence so I am (and
I believe Oracle would be) quite happy documenting that launching
them might result in conditions not seen when creating other domain
types... especially when other failure conditions already exist for
32-bit PV domains.

> As it stands it seems that any toolstack which wants to use claim would
> still have to cope with the fact that a potentially significant
> proportion of guests may still fail to build even after a claim has been
> successfully staked.

The problem being addressed here is "slow failure" when creating
a domain and this can currently occur with 100% of domain creations.
The proposed claim hypercall solves this problem for:

- All HVM domains and all future PVH domains
- All 64-bit PV domains [when system RAM < 5TiB]
- [All 32-bit PV domains when system RAM < 160GiB]

and, as you've observed, currently doesn't solve the problem for

- All 32-bit PV domains [except when system RAM > 160 GiB]
- PV domains with superpages=1 that "almost succeed" but fail

I see that as a pretty good start and, with the flags argument,
the proposal even has room for future extensions should they
be needed.

> Even if these shortcomings are acceptable in your specific scenario I
> don't see why we should be satisfied with a solution which is not more
> generally applicable.

I would welcome a solution which is more generally applicable
if you've got one.  Otherwise, I am very satisfied with this one.
If you'd like confirmation from Oracle management that they
are satisfied as well, I can encourage them to reply.

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 21:28:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 21:28:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaYsP-00068h-PB; Mon, 19 Nov 2012 21:27:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TaYsN-00068c-PO
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 21:27:32 +0000
Received: from [85.158.139.211:5484] by server-1.bemta-5.messagelabs.com id
	26/74-05877-244AAA05; Mon, 19 Nov 2012 21:27:30 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1353360448!18788058!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNjExNjU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23700 invoked from network); 19 Nov 2012 21:27:29 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-10.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 19 Nov 2012 21:27:29 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAJLRPqS011435
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 19 Nov 2012 21:27:26 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAJLRP0N003465
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 19 Nov 2012 21:27:25 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAJLROJK023143; Mon, 19 Nov 2012 15:27:25 -0600
MIME-Version: 1.0
Message-ID: <eb3e7e6a-13f2-41a0-9a3e-e149de4040ac@default>
Date: Mon, 19 Nov 2012 13:27:22 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__135336044477141893abhmt103.oracle.com"
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [RFC/PATCH v5 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__135336044477141893abhmt103.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This is patch 1of2 of a fifth cut of the patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account
feedback from Jan and Keir and IanC, plus some fixes found via
runtime debugging (using printk and privcmd only).

v4->v5:
- Split tools part into separate patch [JBeulich]
- Minor coding style fixups [JBeulich]
- Use rcu_lock_domain_by_id, not _target version [JBeulich]

v3->v4: (please ignore v3)
- Process error, sent stale patch, sorry [djm]

v2->v3:
- Add per-domain and global "get" for unclaimed info [JBeulich]
- New hypercall(s) should fail for unpriv callers [IanC]
- Non-zero extent_order disallowed [JBeulich]
- Remove bonehead ASSERTs [JBeulich]
- Need not hold heaplock for decrease case too [JBeulich]
- More descriptive failure return values [JBeulich]
- Don't allow a claim to exceed max_pages [IanC]
- Subops must be in correct ifdef block in memory.c [keir]

v1->v2:
- Add reset-to-zero page claim in domain_kill [JBeulich]
- Proper handling of struct passed to hypercall [JBeulich]
- Fix alloc_heap_pages when a domain has a claim [JBeulich]
- Need not hold heap_lock if !d->unclaimed_pages [keir]
- Fix missed tot_pages call in donate_page [djm]
- Remove domain_reset_unclaimed_pages; use set with zero [djm]
- Bugfixes found through testing in set_unclaimed [djm]
- More comments in code [djm]
- Code formatting fixes [djm]

=3D=3D=3D

Motivation:

The goal of this hypercall is to attempt to atomically and very
quickly determine if there are sufficient pages available in the
system and, if so, "set aside" that quantity of pages for future
allocations by that domain.  Unlike an existing hypercall such as
increase_reservation or populate_physmap, specific physical
pageframes are not assigned to the domain because this
cannot be done sufficiently quickly (especially for very large
allocations in an arbitrarily fragmented system) and so the
existing mechanisms result in classic time-of-check-time-of-use
(TOCTOU) races.  One can think of claiming as similar to a
"lazy" allocation, but subsequent hypercalls are required
to do the actual physical pageframe allocation.

In order for a toolstack to "get" information about whether
a domain has a claim and, if so, how large, and also for
the toolstack to measure the total system-wide claim, a
second subop has been added and exposed through domctl
and libxl.

Built on top of this in the toolstack, I envision
a "xl create --claim" option to maximize backwards
compatibility while minimizing impact on existing toolstacks;
and perhaps an "xl free --claim" for the system-wide info.

It has been noted that this claim mechanism solves the
underlying problem (slow failure of domain creation) for
a large class of domains not not all, specifically not
handling (but also not making the problem worse for) PV
domains that specify the "superpages" flag, and 32-bit PV
domains on large RAM systems.  These may be addressed at a
later time.

Code overview:

Though the hypercall simply does arithmetic within locks,
some of the semantics in the code may be a bit subtle
so let me explain a bit.

The key variables (d->unclaimed_pages and total_unclaimed_pages)
start at zero if no claim has yet been staked for any domain.
(Perhaps a better name is "claimed_but_not_yet_possessed" but that's
a bit unwieldy.)  If no claim hypercalls are executed, there
should be no impact on existing usage.

When a claim is successfully staked by a domain, it is like a
watermark but there is no record kept of the size of the claim.
Instead, d->unclaimed_pages is set to the difference between
d->tot_pages and the claim.  When d->tot_pages increases or decreases,
d->unclaimed_pages atomically decreases or increases.  Once
d->unclaimed_pages reaches zero, the claim is satisfied and
d->unclaimed pages stays at zero -- unless a new claim is
subsequently staked.

The systemwide variable total_unclaimed_pages is always the sum
of d->unclaimed_pages, across all domains.  A non-domain-
specific heap allocation will fail if total_unclaimed_pages
exceeds free (plus, on tmem enabled systems, freeable) pages.

Claim semantics may be modified by flags.  The initial
implementation has one flag, which discerns whether the
caller would like tmem freeable pages to be considered
in determining whether or not the claim can be successfully
staked. Future flags may, for example, specify that the
caller would like the claim to be successful only if there
are sufficient pages available on a single node (per Dario's
suggestion).

A claim can be cancelled by requesting a claim of zero pages.

A second subop returns the total outstanding claimed pages
systemwide.

Note: Save/restore/migrate may need to be modified,
else it can be documented that all claims are cancelled.

Thanks for any feedback!

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 arch/x86/mm.c             |    2=20
 arch/x86/mm/mem_sharing.c |    4 -
 common/domain.c           |    1=20
 common/domctl.c           |    1=20
 common/grant_table.c      |    2=20
 common/memory.c           |   33 ++++++++++++
 common/page_alloc.c       |  118 +++++++++++++++++++++++++++++++++++++++++=
++++-
 include/public/domctl.h   |    3 -
 include/public/memory.h   |   39 +++++++++++++++
 include/xen/mm.h          |    7 ++
 include/xen/sched.h       |    1=20
 11 files changed, 203 insertions(+), 8 deletions(-)

diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index f2409ec..118f24a 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -36,7 +36,7 @@
 #include "grant_table.h"
 #include "hvm/save.h"
=20
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000009
=20
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -95,6 +95,7 @@ struct xen_domctl_getdomaininfo {
     uint32_t flags;              /* XEN_DOMINF_* */
     uint64_aligned_t tot_pages;
     uint64_aligned_t max_pages;
+    uint64_aligned_t unclaimed_pages;
     uint64_aligned_t shr_pages;
     uint64_aligned_t paged_pages;
     uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fad3d33..7e55908 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3841,7 +3841,7 @@ int donate_page(
     {
         if ( d->tot_pages >=3D d->max_pages )
             goto fail;
-        d->tot_pages++;
+        domain_increase_tot_pages(d, 1);
     }
=20
     page->count_info =3D PGC_allocated | 1;
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..943a3b5 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d,
     }
=20
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_decrease_tot_pages(d, 1);
     drop_dom_ref =3D (d->tot_pages =3D=3D 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct p=
age_info *page)
     ASSERT(page_get_owner(page) =3D=3D dom_cow);
     page_set_owner(page, d);
=20
-    if ( d->tot_pages++ =3D=3D 0 )
+    if ( domain_increase_tot_pages(d, 1) =3D=3D 0 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0e3e36a..95509e2 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -492,6 +492,7 @@ int domain_kill(struct domain *d)
         evtchn_destroy(d);
         gnttab_release_mappings(d);
         tmem_destroy(d->tmem);
+        domain_set_unclaimed_pages(d, 0, 0);
         d->tmem =3D NULL;
         /* fallthrough */
     case DOMDYING_dying:
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index e153cb4..19e3930 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -154,6 +154,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_=
getdomaininfo *info)
=20
     info->tot_pages         =3D d->tot_pages;
     info->max_pages         =3D d->max_pages;
+    info->unclaimed_pages   =3D d->unclaimed_pages;
     info->shr_pages         =3D atomic_read(&d->shr_pages);
     info->paged_pages       =3D atomic_read(&d->paged_pages);
     info->shared_info_frame =3D mfn_to_gmfn(d, __pa(d->shared_info)>>PAGE_=
SHIFT);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..10ce78f 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1656,7 +1656,7 @@ gnttab_transfer(
         }
=20
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ =3D=3D 0) )
+        if ( unlikely(domain_increase_tot_pages(e, 1) =3D=3D 0) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..adb7581 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_=
memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
=20
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -=3D dec_count;
+                domain_decrease_tot_pages(d, dec_count);
                 drop_dom_ref =3D (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
=20
@@ -685,6 +685,37 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_=
PARAM(void) arg)
         break;
     }
=20
+    case XENMEM_claim_pages:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+
+        if ( copy_from_guest(&reservation, arg, 1) )
+            return -EFAULT;
+
+        if ( !guest_handle_is_null(reservation.extent_start) )
+            return -EINVAL;
+
+        if ( reservation.extent_order !=3D 0 )
+            return -EINVAL;
+
+        d =3D rcu_lock_domain_by_id(reservation.domid);
+        if ( d =3D=3D NULL )
+            return -EINVAL;
+
+        rc =3D domain_set_unclaimed_pages(d, reservation.nr_extents,
+                                        reservation.mem_flags);
+
+        rcu_unlock_domain(d);
+
+        break;
+
+    case XENMEM_get_unclaimed_pages:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+
+        rc =3D get_total_unclaimed_pages();
+        break;
+
     default:
         rc =3D arch_memory_op(op, arg);
         break;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 15ebc66..3d9ef54 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -238,6 +238,111 @@ static long midsize_alloc_zone_pages;
 #define MIDSIZE_ALLOC_FRAC 128
=20
 static DEFINE_SPINLOCK(heap_lock);
+static long total_unclaimed_pages; /* total outstanding claims by all doma=
ins */
+
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
+
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages +=3D pages;
+    spin_lock(&heap_lock);
+    dom_before =3D d->unclaimed_pages;
+    dom_after =3D dom_before - pages;
+    if ( (dom_before > 0) && (dom_after < 0) )
+        dom_claimed =3D 0;
+    else
+        dom_claimed =3D dom_after;
+    sys_before =3D total_unclaimed_pages;
+    sys_after =3D sys_before - (dom_before - dom_claimed);
+    BUG_ON( (sys_before > 0) && (sys_after < 0) );
+    total_unclaimed_pages =3D sys_after;
+    d->unclaimed_pages =3D dom_claimed;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages -=3D pages;
+
+    spin_lock(&heap_lock);
+    d->tot_pages -=3D pages;
+    d->unclaimed_pages +=3D pages;
+    total_unclaimed_pages +=3D pages;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
+                                unsigned long flags)
+{
+    int ret =3D -ENOMEM;
+    unsigned long claim, avail_pages;
+
+    /*
+     * take the domain's page_alloc_lock, else all increases/decreases
+     * must always take the global heap_lock rather than only in the much
+     * rarer case that d->unclaimed_pages is non-zero
+     */
+    spin_lock(&d->page_alloc_lock);
+    spin_lock(&heap_lock);
+
+    /* pages=3D=3D0 means "unset" the claim (and flags is ignored) */
+    if ( pages =3D=3D 0 )
+    {
+        total_unclaimed_pages -=3D d->unclaimed_pages;
+        d->unclaimed_pages =3D 0;
+        ret =3D 0;
+        goto out;
+    }
+
+    /* only one active claim per domain please */
+    if ( d->unclaimed_pages )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* disallow a claim not exceeding current tot_pages or above max_pages=
 */
+    if ( (pages <=3D d->tot_pages) || (pages > d->max_pages) )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* how much memory is available? */
+    avail_pages =3D total_avail_pages;
+    if ( !(flags & XENMEM_CLAIMF_free_only) )
+        avail_pages +=3D tmem_freeable_pages();
+    avail_pages -=3D total_unclaimed_pages;
+
+    /*
+     * note, if domain has already allocated memory before making a claim=
=20
+     * then the claim must take tot_pages into account
+     */
+    claim =3D pages - d->tot_pages;
+    if ( claim > avail_pages )
+        goto out;
+
+    /* yay, claim fits in available memory, stake the claim, success! */
+    d->unclaimed_pages =3D claim;
+    total_unclaimed_pages +=3D d->unclaimed_pages;
+    ret =3D 0;
+
+out:
+    spin_unlock(&heap_lock);
+    spin_unlock(&d->page_alloc_lock);
+    return ret;
+}
+
+long get_total_unclaimed_pages(void)
+{
+    return total_unclaimed_pages;
+}
=20
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
@@ -443,6 +548,15 @@ static struct page_info *alloc_heap_pages(
     spin_lock(&heap_lock);
=20
     /*
+     * Claimed memory is considered unavailable unless the request
+     * is made by a domain with sufficient unclaimed pages.
+     */
+    if ( (total_unclaimed_pages + request >
+          total_avail_pages + tmem_freeable_pages()) &&
+          (d =3D=3D NULL || d->unclaimed_pages < request) )
+        goto not_found;
+
+    /*
      * TMEM: When available memory is scarce due to tmem absorbing it, all=
ow
      * only mid-size allocations to avoid worst of fragmentation issues.
      * Others try tmem pools then fail.  This is a workaround until all
@@ -1291,7 +1405,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages =3D=3D 0) )
             get_knownalive_domain(d);
=20
-        d->tot_pages +=3D 1 << order;
+        domain_increase_tot_pages(d, 1 << order);
     }
=20
     for ( i =3D 0; i < (1 << order); i++ )
@@ -1375,7 +1489,7 @@ void free_domheap_pages(struct page_info *pg, unsigne=
d int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
=20
-        d->tot_pages -=3D 1 << order;
+        domain_decrease_tot_pages(d, 1 << order);
         drop_dom_ref =3D (d->tot_pages =3D=3D 0);
=20
         spin_unlock_recursive(&d->page_alloc_lock);
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index f1ddbc0..15d6c72 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -68,6 +68,8 @@ struct xen_memory_reservation {
      *   IN:  GPFN bases of extents to populate with memory
      *   OUT: GMFN bases of extents that were allocated
      *   (NB. This command also updates the mach_to_phys translation table=
)
+     * XENMEM_claim_pages:
+     *   IN: must be zero
      */
     XEN_GUEST_HANDLE(xen_pfn_t) extent_start;
=20
@@ -421,6 +423,43 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
=20
+/*
+ * Attempt to stake a claim for a domain on a quantity of pages
+ * of system RAM, but _not_ assign specific pageframes.  Only
+ * arithmetic is performed so the hypercall is very fast and need
+ * not be preemptible, thus sidestepping time-of-check-time-of-use
+ * races for memory allocation.  Returns 0 if the hypervisor page
+ * allocator has atomically and successfully claimed the requested
+ * number of pages, else non-zero.
+ *
+ * Any domain may have only one active claim.  When sufficient memory
+ * has been allocated to resolve the claim, the claim silently expires.
+ * Claiming zero pages effectively resets any outstanding claim and
+ * is always successful.
+ *
+ * Note that a valid claim may be staked even after memory has been
+ * allocated for a domain.  In this case, the claim is not incremental,
+ * i.e. if the domain's tot_pages is 3, and a claim is staked for 10,
+ * only 7 additional pages are claimed.
+ *
+ * Caller must be privileged or the hypercall fails.
+ */
+#define XENMEM_claim_pages                  24
+/*
+ * XENMEM_claim_pages flags:
+ *  free_only: claim is successful only if sufficient free pages
+ *    are available.  If not set and tmem is enabled, hypervisor
+ *    may also consider tmem "freeable" pages to satisfy the claim.
+ */
+#define _XENMEM_CLAIMF_free_only            0
+#define XENMEM_CLAIMF_free_only             (1U<<_XENMEM_CLAIMF_free_only)
+/*
+ * Get the number of pages currently claimed (but not yet "possessed")
+ * across all domains.  The caller must be privileged but otherwise
+ * the call never fails.=20
+ */
+#define XENMEM_get_unclaimed_pages            25
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
=20
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 64a0cc1..b4dee92 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,13 @@ void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
=20
+/* Claim handling */
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges);
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges);
+int domain_set_unclaimed_pages(
+    struct domain *d, unsigned long pages, unsigned long flags);
+long get_total_unclaimed_pages(void);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..480ef39 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -242,6 +242,7 @@ struct domain
     struct page_list_head page_list;  /* linked list */
     struct page_list_head xenpage_list; /* linked list (size xenheap_pages=
) */
     unsigned int     tot_pages;       /* number of pages currently possese=
d */
+    unsigned int     unclaimed_pages; /* pages claimed but not possessed  =
  */
     unsigned int     max_pages;       /* maximum value for tot_pages      =
  */
     atomic_t         shr_pages;       /* number of shared pages           =
  */
     atomic_t         paged_pages;     /* number of paged-out pages        =
  */

--__135336044477141893abhmt103.oracle.com
Content-Type: application/octet-stream; name="claim-hyp-121119.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-hyp-121119.patch"

ZGlmZiAtLWdpdCBhL3hlbi9pbmNsdWRlL3B1YmxpYy9kb21jdGwuaCBiL3hlbi9pbmNsdWRlL3B1
YmxpYy9kb21jdGwuaAppbmRleCBmMjQwOWVjL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SBYRU5NRU1fY2xhaW1fcGFnZXM6CisgICAgICAgIGlmICgg
IUlTX1BSSVYoY3VycmVudC0+ZG9tYWluKSApCisgICAgICAgICAgICByZXR1cm4gLUVQRVJNOwor
CisgICAgICAgIGlmICggY29weV9mcm9tX2d1ZXN0KCZyZXNlcnZhdGlvbiwgYXJnLCAxKSApCisg
ICAgICAgICAgICByZXR1cm4gLUVGQVVMVDsKKworICAgICAgICBpZiAoICFndWVzdF9oYW5kbGVf
aXNfbnVsbChyZXNlcnZhdGlvbi5leHRlbnRfc3RhcnQpICkKKyAgICAgICAgICAgIHJldHVybiAt
RUlOVkFMOworCisgICAgICAgIGlmICggcmVzZXJ2YXRpb24uZXh0ZW50X29yZGVyICE9IDAgKQor
ICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisKKyAgICAgICAgZCA9IHJjdV9sb2NrX2RvbWFp
bl9ieV9pZChyZXNlcnZhdGlvbi5kb21pZCk7CisgICAgICAgIGlmICggZCA9PSBOVUxMICkKKyAg
ICAgICAgICAgIHJldHVybiAtRUlOVkFMOworCisgICAgICAgIHJjID0gZG9tYWluX3NldF91bmNs
YWltZWRfcGFnZXMoZCwgcmVzZXJ2YXRpb24ubnJfZXh0ZW50cywKKyAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICByZXNlcnZhdGlvbi5tZW1fZmxhZ3MpOworCisgICAgICAg
IHJjdV91bmxvY2tfZG9tYWluKGQpOworCisgICAgICAgIGJyZWFrOworCisgICAgY2FzZSBYRU5N
RU1fZ2V0X3VuY2xhaW1lZF9wYWdlczoKKyAgICAgICAgaWYgKCAhSVNfUFJJVihjdXJyZW50LT5k
b21haW4pICkKKyAgICAgICAgICAgIHJldHVybiAtRVBFUk07CisKKyAgICAgICAgcmMgPSBnZXRf
dG90YWxfdW5jbGFpbWVkX3BhZ2VzKCk7CisgICAgICAgIGJyZWFrOworCiAgICAgZGVmYXVsdDoK
ICAgICAgICAgcmMgPSBhcmNoX21lbW9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3RydWN0IGRvbWFpbiAqZCwg
dW5zaWduZWQgbG9uZyBwYWdlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5z
aWduZWQgbG9uZyBmbGFncykKK3sKKyAgICBpbnQgcmV0ID0gLUVOT01FTTsKKyAgICB1bnNpZ25l
ZCBsb25nIGNsYWltLCBhdmFpbF9wYWdlczsKKworICAgIC8qCisgICAgICogdGFrZSB0aGUgZG9t
YWluJ3MgcGFnZV9hbGxvY19sb2NrLCBlbHNlIGFsbCBpbmNyZWFzZXMvZGVjcmVhc2VzCisgICAg
ICogbXVzdCBhbHdheXMgdGFrZSB0aGUgZ2xvYmFsIGhlYXBfbG9jayByYXRoZXIgdGhhbiBvbmx5
IGluIHRoZSBtdWNoCisgICAgICogcmFyZXIgY2FzZSB0aGF0IGQtPnVuY2xhaW1lZF9wYWdlcyBp
cyBub24temVybworICAgICAqLworICAgIHNwaW5fbG9jaygmZC0+cGFnZV9hbGxvY19sb2NrKTsK
KyAgICBzcGluX2xvY2soJmhlYXBfbG9jayk7CisKKyAgICAvKiBwYWdlcz09MCBtZWFucyAidW5z
ZXQiIHRoZSBjbGFpbSAoYW5kIGZsYWdzIGlzIGlnbm9yZWQpICovCisgICAgaWYgKCBwYWdlcyA9
PSAwICkKKyAgICB7CisgICAgICAgIHRvdGFsX3VuY2xhaW1lZF9wYWdlcyAtPSBkLT51bmNsYWlt
ZWRfcGFnZXM7CisgICAgICAgIGQtPnVuY2xhaW1lZF9wYWdlcyA9IDA7CisgICAgICAgIHJldCA9
IDA7CisgICAgICAgIGdvdG8gb3V0OworICAgIH0KKworICAgIC8qIG9ubHkgb25lIGFjdGl2ZSBj
bGFpbSBwZXIgZG9tYWluIHBsZWFzZSAqLworICAgIGlmICggZC0+dW5jbGFpbWVkX3BhZ2VzICkK
KyAgICB7CisgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgIGdvdG8gb3V0OworICAgIH0K
KworICAgIC8qIGRpc2FsbG93IGEgY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RydWN0IHBhZ2VfaW5m
byAqYWxsb2NfZG9taGVhcF9wYWdlcygKZGlmZiAtLWdpdCBhL3hlbi9pbmNsdWRlL3hlbi9zY2hl
ZC5oIGIveGVuL2luY2x1ZGUveGVuL3NjaGVkLmgKaW5kZXggNmM1NTAzOS4uNDgwZWYzOSAxMDA2
NDQKLS0tIGEveGVuL2luY2x1ZGUveGVuL3NjaGVkLmgKKysrIGIveGVuL2luY2x1ZGUveGVuL3Nj
aGVkLmgKQEAgLTI0Miw2ICsyNDIsNyBAQCBzdHJ1Y3QgZG9tYWluCiAgICAgc3RydWN0IHBhZ2Vf
bGlzdF9oZWFkIHBhZ2VfbGlzdDsgIC8qIGxpbmtlZCBsaXN0ICovCiAgICAgc3RydWN0IHBhZ2Vf
bGlzdF9oZWFkIHhlbnBhZ2VfbGlzdDsgLyogbGlua2VkIGxpc3QgKHNpemUgeGVuaGVhcF9wYWdl
cykgKi8KICAgICB1bnNpZ25lZCBpbnQgICAgIHRvdF9wYWdlczsgICAgICAgLyogbnVtYmVyIG9m
IHBhZ2VzIGN1cnJlbnRseSBwb3NzZXNlZCAqLworICAgIHVuc2lnbmVkIGludCAgICAgdW5jbGFp
bWVkX3BhZ2VzOyAvKiBwYWdlcyBjbGFpbWVkIGJ1dCBub3QgcG9zc2Vzc2VkICAgICovCiAgICAg
dW5zaWduZWQgaW50ICAgICBtYXhfcGFnZXM7ICAgICAgIC8qIG1heGltdW0gdmFsdWUgZm9yIHRv
dF9wYWdlcyAgICAgICAgKi8KICAgICBhdG9taWNfdCAgICAgICAgIHNocl9wYWdlczsgICAgICAg
LyogbnVtYmVyIG9mIHNoYXJlZCBwYWdlcyAgICAgICAgICAgICAqLwogICAgIGF0b21pY190ICAg
ICAgICAgcGFnZWRfcGFnZXM7ICAgICAvKiBudW1iZXIgb2YgcGFnZWQtb3V0IHBhZ2VzICAgICAg
ICAgICovCg==
--__135336044477141893abhmt103.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__135336044477141893abhmt103.oracle.com--


From xen-devel-bounces@lists.xen.org Mon Nov 19 21:28:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 21:28:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaYsP-00068h-PB; Mon, 19 Nov 2012 21:27:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TaYsN-00068c-PO
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 21:27:32 +0000
Received: from [85.158.139.211:5484] by server-1.bemta-5.messagelabs.com id
	26/74-05877-244AAA05; Mon, 19 Nov 2012 21:27:30 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1353360448!18788058!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNjExNjU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23700 invoked from network); 19 Nov 2012 21:27:29 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-10.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 19 Nov 2012 21:27:29 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAJLRPqS011435
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 19 Nov 2012 21:27:26 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAJLRP0N003465
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 19 Nov 2012 21:27:25 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAJLROJK023143; Mon, 19 Nov 2012 15:27:25 -0600
MIME-Version: 1.0
Message-ID: <eb3e7e6a-13f2-41a0-9a3e-e149de4040ac@default>
Date: Mon, 19 Nov 2012 13:27:22 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__135336044477141893abhmt103.oracle.com"
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [RFC/PATCH v5 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__135336044477141893abhmt103.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This is patch 1of2 of a fifth cut of the patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account
feedback from Jan and Keir and IanC, plus some fixes found via
runtime debugging (using printk and privcmd only).

v4->v5:
- Split tools part into separate patch [JBeulich]
- Minor coding style fixups [JBeulich]
- Use rcu_lock_domain_by_id, not _target version [JBeulich]

v3->v4: (please ignore v3)
- Process error, sent stale patch, sorry [djm]

v2->v3:
- Add per-domain and global "get" for unclaimed info [JBeulich]
- New hypercall(s) should fail for unpriv callers [IanC]
- Non-zero extent_order disallowed [JBeulich]
- Remove bonehead ASSERTs [JBeulich]
- Need not hold heaplock for decrease case too [JBeulich]
- More descriptive failure return values [JBeulich]
- Don't allow a claim to exceed max_pages [IanC]
- Subops must be in correct ifdef block in memory.c [keir]

v1->v2:
- Add reset-to-zero page claim in domain_kill [JBeulich]
- Proper handling of struct passed to hypercall [JBeulich]
- Fix alloc_heap_pages when a domain has a claim [JBeulich]
- Need not hold heap_lock if !d->unclaimed_pages [keir]
- Fix missed tot_pages call in donate_page [djm]
- Remove domain_reset_unclaimed_pages; use set with zero [djm]
- Bugfixes found through testing in set_unclaimed [djm]
- More comments in code [djm]
- Code formatting fixes [djm]

=3D=3D=3D

Motivation:

The goal of this hypercall is to attempt to atomically and very
quickly determine if there are sufficient pages available in the
system and, if so, "set aside" that quantity of pages for future
allocations by that domain.  Unlike an existing hypercall such as
increase_reservation or populate_physmap, specific physical
pageframes are not assigned to the domain because this
cannot be done sufficiently quickly (especially for very large
allocations in an arbitrarily fragmented system) and so the
existing mechanisms result in classic time-of-check-time-of-use
(TOCTOU) races.  One can think of claiming as similar to a
"lazy" allocation, but subsequent hypercalls are required
to do the actual physical pageframe allocation.

In order for a toolstack to "get" information about whether
a domain has a claim and, if so, how large, and also for
the toolstack to measure the total system-wide claim, a
second subop has been added and exposed through domctl
and libxl.

Built on top of this in the toolstack, I envision
a "xl create --claim" option to maximize backwards
compatibility while minimizing impact on existing toolstacks;
and perhaps an "xl free --claim" for the system-wide info.

It has been noted that this claim mechanism solves the
underlying problem (slow failure of domain creation) for
a large class of domains not not all, specifically not
handling (but also not making the problem worse for) PV
domains that specify the "superpages" flag, and 32-bit PV
domains on large RAM systems.  These may be addressed at a
later time.

Code overview:

Though the hypercall simply does arithmetic within locks,
some of the semantics in the code may be a bit subtle
so let me explain a bit.

The key variables (d->unclaimed_pages and total_unclaimed_pages)
start at zero if no claim has yet been staked for any domain.
(Perhaps a better name is "claimed_but_not_yet_possessed" but that's
a bit unwieldy.)  If no claim hypercalls are executed, there
should be no impact on existing usage.

When a claim is successfully staked by a domain, it is like a
watermark but there is no record kept of the size of the claim.
Instead, d->unclaimed_pages is set to the difference between
d->tot_pages and the claim.  When d->tot_pages increases or decreases,
d->unclaimed_pages atomically decreases or increases.  Once
d->unclaimed_pages reaches zero, the claim is satisfied and
d->unclaimed pages stays at zero -- unless a new claim is
subsequently staked.

The systemwide variable total_unclaimed_pages is always the sum
of d->unclaimed_pages, across all domains.  A non-domain-
specific heap allocation will fail if total_unclaimed_pages
exceeds free (plus, on tmem enabled systems, freeable) pages.

Claim semantics may be modified by flags.  The initial
implementation has one flag, which discerns whether the
caller would like tmem freeable pages to be considered
in determining whether or not the claim can be successfully
staked. Future flags may, for example, specify that the
caller would like the claim to be successful only if there
are sufficient pages available on a single node (per Dario's
suggestion).

A claim can be cancelled by requesting a claim of zero pages.

A second subop returns the total outstanding claimed pages
systemwide.

Note: Save/restore/migrate may need to be modified,
else it can be documented that all claims are cancelled.

Thanks for any feedback!

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 arch/x86/mm.c             |    2=20
 arch/x86/mm/mem_sharing.c |    4 -
 common/domain.c           |    1=20
 common/domctl.c           |    1=20
 common/grant_table.c      |    2=20
 common/memory.c           |   33 ++++++++++++
 common/page_alloc.c       |  118 +++++++++++++++++++++++++++++++++++++++++=
++++-
 include/public/domctl.h   |    3 -
 include/public/memory.h   |   39 +++++++++++++++
 include/xen/mm.h          |    7 ++
 include/xen/sched.h       |    1=20
 11 files changed, 203 insertions(+), 8 deletions(-)

diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index f2409ec..118f24a 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -36,7 +36,7 @@
 #include "grant_table.h"
 #include "hvm/save.h"
=20
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000009
=20
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -95,6 +95,7 @@ struct xen_domctl_getdomaininfo {
     uint32_t flags;              /* XEN_DOMINF_* */
     uint64_aligned_t tot_pages;
     uint64_aligned_t max_pages;
+    uint64_aligned_t unclaimed_pages;
     uint64_aligned_t shr_pages;
     uint64_aligned_t paged_pages;
     uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fad3d33..7e55908 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3841,7 +3841,7 @@ int donate_page(
     {
         if ( d->tot_pages >=3D d->max_pages )
             goto fail;
-        d->tot_pages++;
+        domain_increase_tot_pages(d, 1);
     }
=20
     page->count_info =3D PGC_allocated | 1;
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..943a3b5 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d,
     }
=20
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_decrease_tot_pages(d, 1);
     drop_dom_ref =3D (d->tot_pages =3D=3D 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct p=
age_info *page)
     ASSERT(page_get_owner(page) =3D=3D dom_cow);
     page_set_owner(page, d);
=20
-    if ( d->tot_pages++ =3D=3D 0 )
+    if ( domain_increase_tot_pages(d, 1) =3D=3D 0 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0e3e36a..95509e2 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -492,6 +492,7 @@ int domain_kill(struct domain *d)
         evtchn_destroy(d);
         gnttab_release_mappings(d);
         tmem_destroy(d->tmem);
+        domain_set_unclaimed_pages(d, 0, 0);
         d->tmem =3D NULL;
         /* fallthrough */
     case DOMDYING_dying:
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index e153cb4..19e3930 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -154,6 +154,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_=
getdomaininfo *info)
=20
     info->tot_pages         =3D d->tot_pages;
     info->max_pages         =3D d->max_pages;
+    info->unclaimed_pages   =3D d->unclaimed_pages;
     info->shr_pages         =3D atomic_read(&d->shr_pages);
     info->paged_pages       =3D atomic_read(&d->paged_pages);
     info->shared_info_frame =3D mfn_to_gmfn(d, __pa(d->shared_info)>>PAGE_=
SHIFT);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..10ce78f 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1656,7 +1656,7 @@ gnttab_transfer(
         }
=20
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ =3D=3D 0) )
+        if ( unlikely(domain_increase_tot_pages(e, 1) =3D=3D 0) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..adb7581 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_=
memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
=20
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -=3D dec_count;
+                domain_decrease_tot_pages(d, dec_count);
                 drop_dom_ref =3D (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
=20
@@ -685,6 +685,37 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_=
PARAM(void) arg)
         break;
     }
=20
+    case XENMEM_claim_pages:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+
+        if ( copy_from_guest(&reservation, arg, 1) )
+            return -EFAULT;
+
+        if ( !guest_handle_is_null(reservation.extent_start) )
+            return -EINVAL;
+
+        if ( reservation.extent_order !=3D 0 )
+            return -EINVAL;
+
+        d =3D rcu_lock_domain_by_id(reservation.domid);
+        if ( d =3D=3D NULL )
+            return -EINVAL;
+
+        rc =3D domain_set_unclaimed_pages(d, reservation.nr_extents,
+                                        reservation.mem_flags);
+
+        rcu_unlock_domain(d);
+
+        break;
+
+    case XENMEM_get_unclaimed_pages:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+
+        rc =3D get_total_unclaimed_pages();
+        break;
+
     default:
         rc =3D arch_memory_op(op, arg);
         break;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 15ebc66..3d9ef54 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -238,6 +238,111 @@ static long midsize_alloc_zone_pages;
 #define MIDSIZE_ALLOC_FRAC 128
=20
 static DEFINE_SPINLOCK(heap_lock);
+static long total_unclaimed_pages; /* total outstanding claims by all doma=
ins */
+
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
+
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages +=3D pages;
+    spin_lock(&heap_lock);
+    dom_before =3D d->unclaimed_pages;
+    dom_after =3D dom_before - pages;
+    if ( (dom_before > 0) && (dom_after < 0) )
+        dom_claimed =3D 0;
+    else
+        dom_claimed =3D dom_after;
+    sys_before =3D total_unclaimed_pages;
+    sys_after =3D sys_before - (dom_before - dom_claimed);
+    BUG_ON( (sys_before > 0) && (sys_after < 0) );
+    total_unclaimed_pages =3D sys_after;
+    d->unclaimed_pages =3D dom_claimed;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages -=3D pages;
+
+    spin_lock(&heap_lock);
+    d->tot_pages -=3D pages;
+    d->unclaimed_pages +=3D pages;
+    total_unclaimed_pages +=3D pages;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
+                                unsigned long flags)
+{
+    int ret =3D -ENOMEM;
+    unsigned long claim, avail_pages;
+
+    /*
+     * take the domain's page_alloc_lock, else all increases/decreases
+     * must always take the global heap_lock rather than only in the much
+     * rarer case that d->unclaimed_pages is non-zero
+     */
+    spin_lock(&d->page_alloc_lock);
+    spin_lock(&heap_lock);
+
+    /* pages=3D=3D0 means "unset" the claim (and flags is ignored) */
+    if ( pages =3D=3D 0 )
+    {
+        total_unclaimed_pages -=3D d->unclaimed_pages;
+        d->unclaimed_pages =3D 0;
+        ret =3D 0;
+        goto out;
+    }
+
+    /* only one active claim per domain please */
+    if ( d->unclaimed_pages )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* disallow a claim not exceeding current tot_pages or above max_pages=
 */
+    if ( (pages <=3D d->tot_pages) || (pages > d->max_pages) )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* how much memory is available? */
+    avail_pages =3D total_avail_pages;
+    if ( !(flags & XENMEM_CLAIMF_free_only) )
+        avail_pages +=3D tmem_freeable_pages();
+    avail_pages -=3D total_unclaimed_pages;
+
+    /*
+     * note, if domain has already allocated memory before making a claim=
=20
+     * then the claim must take tot_pages into account
+     */
+    claim =3D pages - d->tot_pages;
+    if ( claim > avail_pages )
+        goto out;
+
+    /* yay, claim fits in available memory, stake the claim, success! */
+    d->unclaimed_pages =3D claim;
+    total_unclaimed_pages +=3D d->unclaimed_pages;
+    ret =3D 0;
+
+out:
+    spin_unlock(&heap_lock);
+    spin_unlock(&d->page_alloc_lock);
+    return ret;
+}
+
+long get_total_unclaimed_pages(void)
+{
+    return total_unclaimed_pages;
+}
=20
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
@@ -443,6 +548,15 @@ static struct page_info *alloc_heap_pages(
     spin_lock(&heap_lock);
=20
     /*
+     * Claimed memory is considered unavailable unless the request
+     * is made by a domain with sufficient unclaimed pages.
+     */
+    if ( (total_unclaimed_pages + request >
+          total_avail_pages + tmem_freeable_pages()) &&
+          (d =3D=3D NULL || d->unclaimed_pages < request) )
+        goto not_found;
+
+    /*
      * TMEM: When available memory is scarce due to tmem absorbing it, all=
ow
      * only mid-size allocations to avoid worst of fragmentation issues.
      * Others try tmem pools then fail.  This is a workaround until all
@@ -1291,7 +1405,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages =3D=3D 0) )
             get_knownalive_domain(d);
=20
-        d->tot_pages +=3D 1 << order;
+        domain_increase_tot_pages(d, 1 << order);
     }
=20
     for ( i =3D 0; i < (1 << order); i++ )
@@ -1375,7 +1489,7 @@ void free_domheap_pages(struct page_info *pg, unsigne=
d int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
=20
-        d->tot_pages -=3D 1 << order;
+        domain_decrease_tot_pages(d, 1 << order);
         drop_dom_ref =3D (d->tot_pages =3D=3D 0);
=20
         spin_unlock_recursive(&d->page_alloc_lock);
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index f1ddbc0..15d6c72 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -68,6 +68,8 @@ struct xen_memory_reservation {
      *   IN:  GPFN bases of extents to populate with memory
      *   OUT: GMFN bases of extents that were allocated
      *   (NB. This command also updates the mach_to_phys translation table=
)
+     * XENMEM_claim_pages:
+     *   IN: must be zero
      */
     XEN_GUEST_HANDLE(xen_pfn_t) extent_start;
=20
@@ -421,6 +423,43 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
=20
+/*
+ * Attempt to stake a claim for a domain on a quantity of pages
+ * of system RAM, but _not_ assign specific pageframes.  Only
+ * arithmetic is performed so the hypercall is very fast and need
+ * not be preemptible, thus sidestepping time-of-check-time-of-use
+ * races for memory allocation.  Returns 0 if the hypervisor page
+ * allocator has atomically and successfully claimed the requested
+ * number of pages, else non-zero.
+ *
+ * Any domain may have only one active claim.  When sufficient memory
+ * has been allocated to resolve the claim, the claim silently expires.
+ * Claiming zero pages effectively resets any outstanding claim and
+ * is always successful.
+ *
+ * Note that a valid claim may be staked even after memory has been
+ * allocated for a domain.  In this case, the claim is not incremental,
+ * i.e. if the domain's tot_pages is 3, and a claim is staked for 10,
+ * only 7 additional pages are claimed.
+ *
+ * Caller must be privileged or the hypercall fails.
+ */
+#define XENMEM_claim_pages                  24
+/*
+ * XENMEM_claim_pages flags:
+ *  free_only: claim is successful only if sufficient free pages
+ *    are available.  If not set and tmem is enabled, hypervisor
+ *    may also consider tmem "freeable" pages to satisfy the claim.
+ */
+#define _XENMEM_CLAIMF_free_only            0
+#define XENMEM_CLAIMF_free_only             (1U<<_XENMEM_CLAIMF_free_only)
+/*
+ * Get the number of pages currently claimed (but not yet "possessed")
+ * across all domains.  The caller must be privileged but otherwise
+ * the call never fails.=20
+ */
+#define XENMEM_get_unclaimed_pages            25
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
=20
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 64a0cc1..b4dee92 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,13 @@ void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
=20
+/* Claim handling */
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges);
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges);
+int domain_set_unclaimed_pages(
+    struct domain *d, unsigned long pages, unsigned long flags);
+long get_total_unclaimed_pages(void);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..480ef39 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -242,6 +242,7 @@ struct domain
     struct page_list_head page_list;  /* linked list */
     struct page_list_head xenpage_list; /* linked list (size xenheap_pages=
) */
     unsigned int     tot_pages;       /* number of pages currently possese=
d */
+    unsigned int     unclaimed_pages; /* pages claimed but not possessed  =
  */
     unsigned int     max_pages;       /* maximum value for tot_pages      =
  */
     atomic_t         shr_pages;       /* number of shared pages           =
  */
     atomic_t         paged_pages;     /* number of paged-out pages        =
  */

--__135336044477141893abhmt103.oracle.com
Content-Type: application/octet-stream; name="claim-hyp-121119.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-hyp-121119.patch"

ZGlmZiAtLWdpdCBhL3hlbi9pbmNsdWRlL3B1YmxpYy9kb21jdGwuaCBiL3hlbi9pbmNsdWRlL3B1
YmxpYy9kb21jdGwuaAppbmRleCBmMjQw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Y2FzZSBYRU5NRU1fY2xhaW1fcGFnZXM6CisgICAgICAgIGlmICgg
IUlTX1BSSVYoY3VycmVudC0+ZG9tYWluKSApCisgICAgICAgICAgICByZXR1cm4gLUVQRVJNOwor
CisgICAgICAgIGlmICggY29weV9mcm9tX2d1ZXN0KCZyZXNlcnZhdGlvbiwgYXJnLCAxKSApCisg
ICAgICAgICAgICByZXR1cm4gLUVGQVVMVDsKKworICAgICAgICBpZiAoICFndWVzdF9oYW5kbGVf
aXNfbnVsbChyZXNlcnZhdGlvbi5leHRlbnRfc3RhcnQpICkKKyAgICAgICAgICAgIHJldHVybiAt
RUlOVkFMOworCisgICAgICAgIGlmICggcmVzZXJ2YXRpb24uZXh0ZW50X29yZGVyICE9IDAgKQor
ICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisKKyAgICAgICAgZCA9IHJjdV9sb2NrX2RvbWFp
bl9ieV9pZChyZXNlcnZhdGlvbi5kb21pZCk7CisgICAgICAgIGlmICggZCA9PSBOVUxMICkKKyAg
ICAgICAgICAgIHJldHVybiAtRUlOVkFMOworCisgICAgICAgIHJjID0gZG9tYWluX3NldF91bmNs
YWltZWRfcGFnZXMoZCwgcmVzZXJ2YXRpb24ubnJfZXh0ZW50cywKKyAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICByZXNlcnZhdGlvbi5tZW1fZmxhZ3MpOworCisgICAgICAg
IHJjdV91bmxvY2tfZG9tYWluKGQpOworCisgICAgICAgIGJyZWFrOworCisgICAgY2FzZSBYRU5N
RU1fZ2V0X3VuY2xhaW1lZF9wYWdlczoKKyAgICAgICAgaWYgKCAhSVNfUFJJVihjdXJyZW50LT5k
b21haW4pICkKKyAgICAgICAgICAgIHJldHVybiAtRVBFUk07CisKKyAgICAgICAgcmMgPSBnZXRf
dG90YWxfdW5jbGFpbWVkX3BhZ2VzKCk7CisgICAgICAgIGJyZWFrOworCiAgICAgZGVmYXVsdDoK
ICAgICAgICAgcmMgPSBhcmNoX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ZXMoc3RydWN0IGRvbWFpbiAqZCwg
dW5zaWduZWQgbG9uZyBwYWdlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5z
aWduZWQgbG9uZyBmbGFncykKK3sKKyAgICBpbnQgcmV0ID0gLUVOT01FTTsKKyAgICB1bnNpZ25l
ZCBsb25nIGNsYWltLCBhdmFpbF9wYWdlczsKKworICAgIC8qCisgICAgICogdGFrZSB0aGUgZG9t
YWluJ3MgcGFnZV9hbGxvY19sb2NrLCBlbHNlIGFsbCBpbmNyZWFzZXMvZGVjcmVhc2VzCisgICAg
ICogbXVzdCBhbHdheXMgdGFrZSB0aGUgZ2xvYmFsIGhlYXBfbG9jayByYXRoZXIgdGhhbiBvbmx5
IGluIHRoZSBtdWNoCisgICAgICogcmFyZXIgY2FzZSB0aGF0IGQtPnVuY2xhaW1lZF9wYWdlcyBp
cyBub24temVybworICAgICAqLworICAgIHNwaW5fbG9jaygmZC0+cGFnZV9hbGxvY19sb2NrKTsK
KyAgICBzcGluX2xvY2soJmhlYXBfbG9jayk7CisKKyAgICAvKiBwYWdlcz09MCBtZWFucyAidW5z
ZXQiIHRoZSBjbGFpbSAoYW5kIGZsYWdzIGlzIGlnbm9yZWQpICovCisgICAgaWYgKCBwYWdlcyA9
PSAwICkKKyAgICB7CisgICAgICAgIHRvdGFsX3VuY2xhaW1lZF9wYWdlcyAtPSBkLT51bmNsYWlt
ZWRfcGFnZXM7CisgICAgICAgIGQtPnVuY2xhaW1lZF9wYWdlcyA9IDA7CisgICAgICAgIHJldCA9
IDA7CisgICAgICAgIGdvdG8gb3V0OworICAgIH0KKworICAgIC8qIG9ubHkgb25lIGFjdGl2ZSBj
bGFpbSBwZXIgZG9tYWluIHBsZWFzZSAqLworICAgIGlmICggZC0+dW5jbGFpbWVkX3BhZ2VzICkK
KyAgICB7CisgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgIGdvdG8gb3V0OworICAgIH0K
KworICAgIC8qIGRpc2FsbG93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Owogc3RydWN0IHBhZ2VfaW5m
byAqYWxsb2NfZG9taGVhcF9wYWdlcygKZGlmZiAtLWdpdCBhL3hlbi9pbmNsdWRlL3hlbi9zY2hl
ZC5oIGIveGVuL2luY2x1ZGUveGVuL3NjaGVkLmgKaW5kZXggNmM1NTAzOS4uNDgwZWYzOSAxMDA2
NDQKLS0tIGEveGVuL2luY2x1ZGUveGVuL3NjaGVkLmgKKysrIGIveGVuL2luY2x1ZGUveGVuL3Nj
aGVkLmgKQEAgLTI0Miw2ICsyNDIsNyBAQCBzdHJ1Y3QgZG9tYWluCiAgICAgc3RydWN0IHBhZ2Vf
bGlzdF9oZWFkIHBhZ2VfbGlzdDsgIC8qIGxpbmtlZCBsaXN0ICovCiAgICAgc3RydWN0IHBhZ2Vf
bGlzdF9oZWFkIHhlbnBhZ2VfbGlzdDsgLyogbGlua2VkIGxpc3QgKHNpemUgeGVuaGVhcF9wYWdl
cykgKi8KICAgICB1bnNpZ25lZCBpbnQgICAgIHRvdF9wYWdlczsgICAgICAgLyogbnVtYmVyIG9m
IHBhZ2VzIGN1cnJlbnRseSBwb3NzZXNlZCAqLworICAgIHVuc2lnbmVkIGludCAgICAgdW5jbGFp
bWVkX3BhZ2VzOyAvKiBwYWdlcyBjbGFpbWVkIGJ1dCBub3QgcG9zc2Vzc2VkICAgICovCiAgICAg
dW5zaWduZWQgaW50ICAgICBtYXhfcGFnZXM7ICAgICAgIC8qIG1heGltdW0gdmFsdWUgZm9yIHRv
dF9wYWdlcyAgICAgICAgKi8KICAgICBhdG9taWNfdCAgICAgICAgIHNocl9wYWdlczsgICAgICAg
LyogbnVtYmVyIG9mIHNoYXJlZCBwYWdlcyAgICAgICAgICAgICAqLwogICAgIGF0b21pY190ICAg
ICAgICAgcGFnZWRfcGFnZXM7ICAgICAvKiBudW1iZXIgb2YgcGFnZWQtb3V0IHBhZ2VzICAgICAg
ICAgICovCg==
--__135336044477141893abhmt103.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__135336044477141893abhmt103.oracle.com--


From xen-devel-bounces@lists.xen.org Mon Nov 19 21:28:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 21:28:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaYsR-000696-Bu; Mon, 19 Nov 2012 21:27:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TaYsQ-00068l-BO
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 21:27:34 +0000
Received: from [193.109.254.147:3129] by server-14.bemta-14.messagelabs.com id
	0E/6A-14517-544AAA05; Mon, 19 Nov 2012 21:27:33 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1353360451!10294343!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3MjI2NQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31412 invoked from network); 19 Nov 2012 21:27:32 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-16.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 21:27:32 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAJLRS6s012811
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 19 Nov 2012 21:27:28 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAJLRRhe017265
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 19 Nov 2012 21:27:27 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAJLRR1T024261; Mon, 19 Nov 2012 15:27:27 -0600
MIME-Version: 1.0
Message-ID: <deb2a20e-a916-42bd-a653-5bb42605d5f7@default>
Date: Mon, 19 Nov 2012 13:27:24 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__135336044682941894abhmt103.oracle.com"
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [RFC/PATCH v5 2/2] tools: XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__135336044682941894abhmt103.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This is patch 2of2 of a fifth cut of the patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account
feedback from Jan and Keir and IanC.

As requested by Jan, this is a separate post of the tools
part of the patch.  NOTE: This patch must be applied after
the hypervisor part of the patchset or otherwise may break
the build!

Thanks for any feedback!

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 xc_domain.c |    1 +
 xenctrl.h   |    1 +
 2 files changed, 2 insertions(+)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index d98e68b..6d06f7c 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -234,6 +234,7 @@ int xc_domain_getinfo(xc_interface *xch,
=20
         info->ssidref  =3D domctl.u.getdomaininfo.ssidref;
         info->nr_pages =3D domctl.u.getdomaininfo.tot_pages;
+        info->nr_unclaimed_pages =3D domctl.u.getdomaininfo.unclaimed_page=
s;
         info->nr_shared_pages =3D domctl.u.getdomaininfo.shr_pages;
         info->nr_paged_pages =3D domctl.u.getdomaininfo.paged_pages;
         info->max_memkb =3D domctl.u.getdomaininfo.max_pages << (PAGE_SHIF=
T-10);
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..325f4a3 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -364,6 +364,7 @@ typedef struct xc_dominfo {
                   hvm:1, debugged:1;
     unsigned int  shutdown_reason; /* only meaningful if shutdown=3D=3D1 *=
/
     unsigned long nr_pages; /* current number, not maximum */
+    unsigned long nr_unclaimed_pages;
     unsigned long nr_shared_pages;
     unsigned long nr_paged_pages;
     unsigned long shared_info_frame;

--__135336044682941894abhmt103.oracle.com
Content-Type: application/octet-stream; name="claim-tools-121119.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-tools-121119.patch"

ZGlmZiAtLWdpdCBhL3Rvb2xzL2xpYnhjL3hjX2RvbWFpbi5jIGIvdG9vbHMvbGlieGMveGNfZG9t
YWluLmMKaW5kZXggZDk4ZTY4Yi4uNmQwNmY3YyAxMDA2NDQKLS0tIGEvdG9vbHMvbGlieGMveGNf
ZG9tYWluLmMKKysrIGIvdG9vbHMvbGlieGMveGNfZG9tYWluLmMKQEAgLTIzNCw2ICsyMzQsNyBA
QCBpbnQgeGNfZG9tYWluX2dldGluZm8oeGNfaW50ZXJmYWNlICp4Y2gsCiAKICAgICAgICAgaW5m
by0+c3NpZHJlZiAgPSBkb21jdGwudS5nZXRkb21haW5pbmZvLnNzaWRyZWY7CiAgICAgICAgIGlu
Zm8tPm5yX3BhZ2VzID0gZG9tY3RsLnUuZ2V0ZG9tYWluaW5mby50b3RfcGFnZXM7CisgICAgICAg
IGluZm8tPm5yX3VuY2xhaW1lZF9wYWdlcyA9IGRvbWN0bC51LmdldGRvbWFpbmluZm8udW5jbGFp
bWVkX3BhZ2VzOwogICAgICAgICBpbmZvLT5ucl9zaGFyZWRfcGFnZXMgPSBkb21jdGwudS5nZXRk
b21haW5pbmZvLnNocl9wYWdlczsKICAgICAgICAgaW5mby0+bnJfcGFnZWRfcGFnZXMgPSBkb21j
dGwudS5nZXRkb21haW5pbmZvLnBhZ2VkX3BhZ2VzOwogICAgICAgICBpbmZvLT5tYXhfbWVta2Ig
PSBkb21jdGwudS5nZXRkb21haW5pbmZvLm1heF9wYWdlcyA8PCAoUEFHRV9TSElGVC0xMCk7CmRp
ZmYgLS1naXQgYS90b29scy9saWJ4Yy94ZW5jdHJsLmggYi90b29scy9saWJ4Yy94ZW5jdHJsLmgK
aW5kZXggN2ViNTc0My4uMzI1ZjRhMyAxMDA2NDQKLS0tIGEvdG9vbHMvbGlieGMveGVuY3RybC5o
CisrKyBiL3Rvb2xzL2xpYnhjL3hlbmN0cmwuaApAQCAtMzY0LDYgKzM2NCw3IEBAIHR5cGVkZWYg
c3RydWN0IHhjX2RvbWluZm8gewogICAgICAgICAgICAgICAgICAgaHZtOjEsIGRlYnVnZ2VkOjE7
CiAgICAgdW5zaWduZWQgaW50ICBzaHV0ZG93bl9yZWFzb247IC8qIG9ubHkgbWVhbmluZ2Z1bCBp
ZiBzaHV0ZG93bj09MSAqLwogICAgIHVuc2lnbmVkIGxvbmcgbnJfcGFnZXM7IC8qIGN1cnJlbnQg
bnVtYmVyLCBub3QgbWF4aW11bSAqLworICAgIHVuc2lnbmVkIGxvbmcgbnJfdW5jbGFpbWVkX3Bh
Z2VzOwogICAgIHVuc2lnbmVkIGxvbmcgbnJfc2hhcmVkX3BhZ2VzOwogICAgIHVuc2lnbmVkIGxv
bmcgbnJfcGFnZWRfcGFnZXM7CiAgICAgdW5zaWduZWQgbG9uZyBzaGFyZWRfaW5mb19mcmFtZTsK
--__135336044682941894abhmt103.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__135336044682941894abhmt103.oracle.com--


From xen-devel-bounces@lists.xen.org Mon Nov 19 21:28:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 21:28:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaYsR-000696-Bu; Mon, 19 Nov 2012 21:27:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TaYsQ-00068l-BO
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 21:27:34 +0000
Received: from [193.109.254.147:3129] by server-14.bemta-14.messagelabs.com id
	0E/6A-14517-544AAA05; Mon, 19 Nov 2012 21:27:33 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1353360451!10294343!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3MjI2NQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31412 invoked from network); 19 Nov 2012 21:27:32 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-16.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 21:27:32 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAJLRS6s012811
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 19 Nov 2012 21:27:28 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAJLRRhe017265
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 19 Nov 2012 21:27:27 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAJLRR1T024261; Mon, 19 Nov 2012 15:27:27 -0600
MIME-Version: 1.0
Message-ID: <deb2a20e-a916-42bd-a653-5bb42605d5f7@default>
Date: Mon, 19 Nov 2012 13:27:24 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__135336044682941894abhmt103.oracle.com"
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [RFC/PATCH v5 2/2] tools: XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__135336044682941894abhmt103.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This is patch 2of2 of a fifth cut of the patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account
feedback from Jan and Keir and IanC.

As requested by Jan, this is a separate post of the tools
part of the patch.  NOTE: This patch must be applied after
the hypervisor part of the patchset or otherwise may break
the build!

Thanks for any feedback!

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 xc_domain.c |    1 +
 xenctrl.h   |    1 +
 2 files changed, 2 insertions(+)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index d98e68b..6d06f7c 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -234,6 +234,7 @@ int xc_domain_getinfo(xc_interface *xch,
=20
         info->ssidref  =3D domctl.u.getdomaininfo.ssidref;
         info->nr_pages =3D domctl.u.getdomaininfo.tot_pages;
+        info->nr_unclaimed_pages =3D domctl.u.getdomaininfo.unclaimed_page=
s;
         info->nr_shared_pages =3D domctl.u.getdomaininfo.shr_pages;
         info->nr_paged_pages =3D domctl.u.getdomaininfo.paged_pages;
         info->max_memkb =3D domctl.u.getdomaininfo.max_pages << (PAGE_SHIF=
T-10);
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..325f4a3 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -364,6 +364,7 @@ typedef struct xc_dominfo {
                   hvm:1, debugged:1;
     unsigned int  shutdown_reason; /* only meaningful if shutdown=3D=3D1 *=
/
     unsigned long nr_pages; /* current number, not maximum */
+    unsigned long nr_unclaimed_pages;
     unsigned long nr_shared_pages;
     unsigned long nr_paged_pages;
     unsigned long shared_info_frame;

--__135336044682941894abhmt103.oracle.com
Content-Type: application/octet-stream; name="claim-tools-121119.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-tools-121119.patch"

ZGlmZiAtLWdpdCBhL3Rvb2xzL2xpYnhjL3hjX2RvbWFpbi5jIGIvdG9vbHMvbGlieGMveGNfZG9t
YWluLmMKaW5kZXggZDk4ZTY4Yi4uNmQwNmY3YyAxMDA2NDQKLS0tIGEvdG9vbHMvbGlieGMveGNf
ZG9tYWluLmMKKysrIGIvdG9vbHMvbGlieGMveGNfZG9tYWluLmMKQEAgLTIzNCw2ICsyMzQsNyBA
QCBpbnQgeGNfZG9tYWluX2dldGluZm8oeGNfaW50ZXJmYWNlICp4Y2gsCiAKICAgICAgICAgaW5m
by0+c3NpZHJlZiAgPSBkb21jdGwudS5nZXRkb21haW5pbmZvLnNzaWRyZWY7CiAgICAgICAgIGlu
Zm8tPm5yX3BhZ2VzID0gZG9tY3RsLnUuZ2V0ZG9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FyZWRfaW5mb19mcmFtZTsK
--__135336044682941894abhmt103.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__135336044682941894abhmt103.oracle.com--


From xen-devel-bounces@lists.xen.org Mon Nov 19 21:28:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 21:28:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaYtQ-0006Fq-Rp; Mon, 19 Nov 2012 21:28:36 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TaYtP-0006FI-1z
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 21:28:35 +0000
Received: from [193.109.254.147:36532] by server-11.bemta-14.messagelabs.com
	id 3E/5C-29027-184AAA05; Mon, 19 Nov 2012 21:28:33 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-2.tower-27.messagelabs.com!1353360510!9974100!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27344 invoked from network); 19 Nov 2012 21:28:30 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-2.tower-27.messagelabs.com with SMTP;
	19 Nov 2012 21:28:30 -0000
X-TM-IMSS-Message-ID: <993c86b6000b98b8@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 993c86b6000b98b8 ;
	Mon, 19 Nov 2012 16:27:53 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJLSNQF013605; 
	Mon, 19 Nov 2012 16:28:24 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Mon, 19 Nov 2012 16:28:21 -0500
Message-Id: <1353360502-27819-5-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 4/5] xen: platform_hypercall XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

A number of the platform_hypercall XSM hooks have no parameters or only
pass the operation ID, making them redundant with the xsm_sysctl hook.
Remove these redundant hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/platform_hypercall.c |  44 ----------------
 xen/include/xsm/dummy.h           |  52 ------------------
 xen/include/xsm/xsm.h             |  54 -------------------
 xen/xsm/dummy.c                   |  10 ----
 xen/xsm/flask/hooks.c             | 107 +++++++++++---------------------------
 5 files changed, 30 insertions(+), 237 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index ffac6ac..f267b8b 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -90,10 +90,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
     case XENPF_settime:
     {
-        ret = xsm_xen_settime();
-        if ( ret )
-            break;
-
         do_settime(op->u.settime.secs, 
                    op->u.settime.nsecs, 
                    op->u.settime.system_time);
@@ -103,10 +99,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
     case XENPF_add_memtype:
     {
-        ret = xsm_memtype(op->cmd);
-        if ( ret )
-            break;
-
         ret = mtrr_add_page(
             op->u.add_memtype.mfn,
             op->u.add_memtype.nr_mfns,
@@ -125,10 +117,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
     case XENPF_del_memtype:
     {
-        ret = xsm_memtype(op->cmd);
-        if ( ret )
-            break;
-
         if (op->u.del_memtype.handle == 0
             /* mtrr/main.c otherwise does a lookup */
             && (int)op->u.del_memtype.reg >= 0)
@@ -147,10 +135,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         unsigned long mfn, nr_mfns;
         mtrr_type     type;
 
-        ret = xsm_memtype(op->cmd);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( op->u.read_memtype.reg < num_var_ranges )
         {
@@ -167,10 +151,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         XEN_GUEST_HANDLE(const_void) data;
 
-        ret = xsm_microcode();
-        if ( ret )
-            break;
-
         guest_from_compat_handle(data, op->u.microcode.data);
 
         /*
@@ -198,10 +178,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         int quirk_id = op->u.platform_quirk.quirk_id;
 
-        ret = xsm_platform_quirk(quirk_id);
-        if ( ret )
-            break;
-
         switch ( quirk_id )
         {
         case QUIRK_NOIRQBALANCING:
@@ -223,10 +199,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_firmware_info:
-        ret = xsm_firmware_info();
-        if ( ret )
-            break;
-
         switch ( op->u.firmware_info.type )
         {
         case XEN_FW_DISK_INFO: {
@@ -335,10 +307,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         break;
 
     case XENPF_efi_runtime_call:
-        ret = xsm_efi_call();
-        if ( ret )
-            break;
-
         ret = efi_runtime_call(&op->u.efi_runtime_call);
         if ( ret == 0 &&
              copy_field_to_guest(u_xenpf_op, op, u.efi_runtime_call) )
@@ -346,18 +314,10 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         break;
 
     case XENPF_enter_acpi_sleep:
-        ret = xsm_acpi_sleep();
-        if ( ret )
-            break;
-
         ret = acpi_enter_sleep(&op->u.enter_acpi_sleep);
         break;
 
     case XENPF_change_freq:
-        ret = xsm_change_freq();
-        if ( ret )
-            break;
-
         ret = -ENOSYS;
         if ( cpufreq_controller != FREQCTL_dom0_kernel )
             break;
@@ -379,10 +339,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         XEN_GUEST_HANDLE(uint8) cpumap_bitmap;
         XEN_GUEST_HANDLE(uint64) idletimes;
 
-        ret = xsm_getidletime();
-        if ( ret )
-            break;
-
         ret = -ENOSYS;
         if ( cpufreq_controller != FREQCTL_dom0_kernel )
             break;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 93e84dc..aaac50d3 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -308,11 +308,6 @@ static XSM_INLINE int xsm_page_offline(uint32_t cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_lockprof(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_tmem_op(void)
 {
     return 0;
@@ -438,26 +433,6 @@ static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_xen_settime(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_memtype(uint32_t access)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_microcode(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_platform_op(uint32_t op)
 {
     if ( !IS_PRIV(current->domain) )
@@ -465,33 +440,6 @@ static XSM_INLINE int xsm_platform_op(uint32_t op)
     return 0;
 }
 
-static XSM_INLINE int xsm_firmware_info(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_efi_call(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_acpi_sleep(void)
-{
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
-}
-
-static XSM_INLINE int xsm_change_freq(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getidletime(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_machine_memory_map(void)
 {
     if ( !IS_PRIV(current->domain) )
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index f1ccd8e..105201e 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -107,7 +107,6 @@ struct xsm_operations {
     int (*resource_setup_misc) (void);
 
     int (*page_offline)(uint32_t cmd);
-    int (*lockprof)(void);
     int (*tmem_op)(void);
     int (*tmem_control)(void);
 
@@ -124,16 +123,8 @@ struct xsm_operations {
     int (*mem_event_op) (struct domain *d, int op);
     int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
     int (*apic) (struct domain *d, int cmd);
-    int (*xen_settime) (void);
     int (*memtype) (uint32_t access);
-    int (*microcode) (void);
-    int (*platform_quirk) (uint32_t);
     int (*platform_op) (uint32_t cmd);
-    int (*firmware_info) (void);
-    int (*efi_call) (void);
-    int (*acpi_sleep) (void);
-    int (*change_freq) (void);
-    int (*getidletime) (void);
     int (*machine_memory_map) (void);
     int (*domain_memory_map) (struct domain *d);
 #define XSM_MMU_UPDATE_READ      1
@@ -440,11 +431,6 @@ static inline int xsm_page_offline(uint32_t cmd)
     return xsm_ops->page_offline(cmd);
 }
 
-static inline int xsm_lockprof(void)
-{
-    return xsm_ops->lockprof();
-}
-
 static inline int xsm_tmem_op(void)
 {
     return xsm_ops->tmem_op();
@@ -511,56 +497,16 @@ static inline int xsm_apic (struct domain *d, int cmd)
     return xsm_ops->apic(d, cmd);
 }
 
-static inline int xsm_xen_settime (void)
-{
-    return xsm_ops->xen_settime();
-}
-
 static inline int xsm_memtype (uint32_t access)
 {
     return xsm_ops->memtype(access);
 }
 
-static inline int xsm_microcode (void)
-{
-    return xsm_ops->microcode();
-}
-
-static inline int xsm_platform_quirk (uint32_t quirk)
-{
-    return xsm_ops->platform_quirk(quirk);
-}
-
 static inline int xsm_platform_op (uint32_t op)
 {
     return xsm_ops->platform_op(op);
 }
 
-static inline int xsm_firmware_info (void)
-{
-    return xsm_ops->firmware_info();
-}
-
-static inline int xsm_efi_call (void)
-{
-    return xsm_ops->efi_call();
-}
-
-static inline int xsm_acpi_sleep (void)
-{
-    return xsm_ops->acpi_sleep();
-}
-
-static inline int xsm_change_freq (void)
-{
-    return xsm_ops->change_freq();
-}
-
-static inline int xsm_getidletime (void)
-{
-    return xsm_ops->getidletime();
-}
-
 static inline int xsm_machine_memory_map(void)
 {
     return xsm_ops->machine_memory_map();
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 03a17ba..22c66e5 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -94,7 +94,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, resource_setup_misc);
 
     set_to_dummy_if_null(ops, page_offline);
-    set_to_dummy_if_null(ops, lockprof);
     set_to_dummy_if_null(ops, tmem_op);
     set_to_dummy_if_null(ops, tmem_control);
 
@@ -111,16 +110,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, mem_event_op);
     set_to_dummy_if_null(ops, mem_sharing_op);
     set_to_dummy_if_null(ops, apic);
-    set_to_dummy_if_null(ops, xen_settime);
-    set_to_dummy_if_null(ops, memtype);
-    set_to_dummy_if_null(ops, microcode);
-    set_to_dummy_if_null(ops, platform_quirk);
     set_to_dummy_if_null(ops, platform_op);
-    set_to_dummy_if_null(ops, firmware_info);
-    set_to_dummy_if_null(ops, efi_call);
-    set_to_dummy_if_null(ops, acpi_sleep);
-    set_to_dummy_if_null(ops, change_freq);
-    set_to_dummy_if_null(ops, getidletime);
     set_to_dummy_if_null(ops, machine_memory_map);
     set_to_dummy_if_null(ops, domain_memory_map);
     set_to_dummy_if_null(ops, mmu_update);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index d72a807..03ea675 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1186,64 +1186,51 @@ static int flask_apic(struct domain *d, int cmd)
     return domain_has_xen(d, perm);
 }
 
-static int flask_xen_settime(void)
-{
-    return domain_has_xen(current->domain, XEN__SETTIME);
-}
-
-static int flask_memtype(uint32_t access)
-{
-    u32 perm;
-
-    switch ( access )
-    {
-    case XENPF_add_memtype:
-        perm = XEN__MTRR_ADD;
-        break;
-    case XENPF_del_memtype:
-        perm = XEN__MTRR_DEL;
-        break;
-    case XENPF_read_memtype:
-        perm = XEN__MTRR_READ;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return domain_has_xen(current->domain, perm);
-}
-
-static int flask_microcode(void)
-{
-    return domain_has_xen(current->domain, XEN__MICROCODE);
-}
-
-static int flask_platform_quirk(uint32_t quirk)
-{
-    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN, XEN__QUIRK, NULL);
-}
-
 static int flask_platform_op(uint32_t op)
 {
     switch ( op )
     {
+#ifdef CONFIG_X86
+    /* These operations have their own XSM hooks */
+    case XENPF_cpu_online:
+    case XENPF_cpu_offline:
+    case XENPF_cpu_hotadd:
+    case XENPF_mem_hotadd:
+        return 0;
+#endif
+
     case XENPF_settime:
+        return domain_has_xen(current->domain, XEN__SETTIME);
+
     case XENPF_add_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_ADD);
+
     case XENPF_del_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_DEL);
+
     case XENPF_read_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_READ);
+
     case XENPF_microcode_update:
+        return domain_has_xen(current->domain, XEN__MICROCODE);
+
     case XENPF_platform_quirk:
+        return domain_has_xen(current->domain, XEN__QUIRK);
+
     case XENPF_firmware_info:
+        return domain_has_xen(current->domain, XEN__FIRMWARE);
+
     case XENPF_efi_runtime_call:
+        return domain_has_xen(current->domain, XEN__FIRMWARE);
+
     case XENPF_enter_acpi_sleep:
+        return domain_has_xen(current->domain, XEN__SLEEP);
+
     case XENPF_change_freq:
+        return domain_has_xen(current->domain, XEN__FREQUENCY);
+
     case XENPF_getidletime:
-    case XENPF_cpu_online:
-    case XENPF_cpu_offline:
-    case XENPF_cpu_hotadd:
-    case XENPF_mem_hotadd:
-        /* These operations have their own XSM hooks */
-        return 0;
+        return domain_has_xen(current->domain, XEN__GETIDLE);
 
     case XENPF_set_processor_pminfo:
     case XENPF_core_parking:
@@ -1259,31 +1246,6 @@ static int flask_platform_op(uint32_t op)
     }
 }
 
-static int flask_firmware_info(void)
-{
-    return domain_has_xen(current->domain, XEN__FIRMWARE);
-}
-
-static int flask_efi_call(void)
-{
-    return domain_has_xen(current->domain, XEN__FIRMWARE);
-}
-
-static int flask_acpi_sleep(void)
-{
-    return domain_has_xen(current->domain, XEN__SLEEP);
-}
-
-static int flask_change_freq(void)
-{
-    return domain_has_xen(current->domain, XEN__FREQUENCY);
-}
-
-static int flask_getidletime(void)
-{
-    return domain_has_xen(current->domain, XEN__GETIDLE);
-}
-
 static int flask_machine_memory_map(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_MMU, MMU__MEMORYMAP, NULL);
@@ -1519,16 +1481,7 @@ static struct xsm_operations flask_ops = {
     .mem_event_op = flask_mem_event_op,
     .mem_sharing_op = flask_mem_sharing_op,
     .apic = flask_apic,
-    .xen_settime = flask_xen_settime,
-    .memtype = flask_memtype,
-    .microcode = flask_microcode,
-    .platform_quirk = flask_platform_quirk,
     .platform_op = flask_platform_op,
-    .firmware_info = flask_firmware_info,
-    .efi_call = flask_efi_call,
-    .acpi_sleep = flask_acpi_sleep,
-    .change_freq = flask_change_freq,
-    .getidletime = flask_getidletime,
     .machine_memory_map = flask_machine_memory_map,
     .domain_memory_map = flask_domain_memory_map,
     .mmu_update = flask_mmu_update,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 21:28:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 21:28:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaYtQ-0006Fq-Rp; Mon, 19 Nov 2012 21:28:36 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TaYtP-0006FI-1z
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 21:28:35 +0000
Received: from [193.109.254.147:36532] by server-11.bemta-14.messagelabs.com
	id 3E/5C-29027-184AAA05; Mon, 19 Nov 2012 21:28:33 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-2.tower-27.messagelabs.com!1353360510!9974100!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27344 invoked from network); 19 Nov 2012 21:28:30 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-2.tower-27.messagelabs.com with SMTP;
	19 Nov 2012 21:28:30 -0000
X-TM-IMSS-Message-ID: <993c86b6000b98b8@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 993c86b6000b98b8 ;
	Mon, 19 Nov 2012 16:27:53 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJLSNQF013605; 
	Mon, 19 Nov 2012 16:28:24 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Mon, 19 Nov 2012 16:28:21 -0500
Message-Id: <1353360502-27819-5-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 4/5] xen: platform_hypercall XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

A number of the platform_hypercall XSM hooks have no parameters or only
pass the operation ID, making them redundant with the xsm_sysctl hook.
Remove these redundant hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/platform_hypercall.c |  44 ----------------
 xen/include/xsm/dummy.h           |  52 ------------------
 xen/include/xsm/xsm.h             |  54 -------------------
 xen/xsm/dummy.c                   |  10 ----
 xen/xsm/flask/hooks.c             | 107 +++++++++++---------------------------
 5 files changed, 30 insertions(+), 237 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index ffac6ac..f267b8b 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -90,10 +90,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
     case XENPF_settime:
     {
-        ret = xsm_xen_settime();
-        if ( ret )
-            break;
-
         do_settime(op->u.settime.secs, 
                    op->u.settime.nsecs, 
                    op->u.settime.system_time);
@@ -103,10 +99,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
     case XENPF_add_memtype:
     {
-        ret = xsm_memtype(op->cmd);
-        if ( ret )
-            break;
-
         ret = mtrr_add_page(
             op->u.add_memtype.mfn,
             op->u.add_memtype.nr_mfns,
@@ -125,10 +117,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
     case XENPF_del_memtype:
     {
-        ret = xsm_memtype(op->cmd);
-        if ( ret )
-            break;
-
         if (op->u.del_memtype.handle == 0
             /* mtrr/main.c otherwise does a lookup */
             && (int)op->u.del_memtype.reg >= 0)
@@ -147,10 +135,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         unsigned long mfn, nr_mfns;
         mtrr_type     type;
 
-        ret = xsm_memtype(op->cmd);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( op->u.read_memtype.reg < num_var_ranges )
         {
@@ -167,10 +151,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         XEN_GUEST_HANDLE(const_void) data;
 
-        ret = xsm_microcode();
-        if ( ret )
-            break;
-
         guest_from_compat_handle(data, op->u.microcode.data);
 
         /*
@@ -198,10 +178,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         int quirk_id = op->u.platform_quirk.quirk_id;
 
-        ret = xsm_platform_quirk(quirk_id);
-        if ( ret )
-            break;
-
         switch ( quirk_id )
         {
         case QUIRK_NOIRQBALANCING:
@@ -223,10 +199,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_firmware_info:
-        ret = xsm_firmware_info();
-        if ( ret )
-            break;
-
         switch ( op->u.firmware_info.type )
         {
         case XEN_FW_DISK_INFO: {
@@ -335,10 +307,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         break;
 
     case XENPF_efi_runtime_call:
-        ret = xsm_efi_call();
-        if ( ret )
-            break;
-
         ret = efi_runtime_call(&op->u.efi_runtime_call);
         if ( ret == 0 &&
              copy_field_to_guest(u_xenpf_op, op, u.efi_runtime_call) )
@@ -346,18 +314,10 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         break;
 
     case XENPF_enter_acpi_sleep:
-        ret = xsm_acpi_sleep();
-        if ( ret )
-            break;
-
         ret = acpi_enter_sleep(&op->u.enter_acpi_sleep);
         break;
 
     case XENPF_change_freq:
-        ret = xsm_change_freq();
-        if ( ret )
-            break;
-
         ret = -ENOSYS;
         if ( cpufreq_controller != FREQCTL_dom0_kernel )
             break;
@@ -379,10 +339,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         XEN_GUEST_HANDLE(uint8) cpumap_bitmap;
         XEN_GUEST_HANDLE(uint64) idletimes;
 
-        ret = xsm_getidletime();
-        if ( ret )
-            break;
-
         ret = -ENOSYS;
         if ( cpufreq_controller != FREQCTL_dom0_kernel )
             break;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 93e84dc..aaac50d3 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -308,11 +308,6 @@ static XSM_INLINE int xsm_page_offline(uint32_t cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_lockprof(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_tmem_op(void)
 {
     return 0;
@@ -438,26 +433,6 @@ static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_xen_settime(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_memtype(uint32_t access)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_microcode(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_platform_op(uint32_t op)
 {
     if ( !IS_PRIV(current->domain) )
@@ -465,33 +440,6 @@ static XSM_INLINE int xsm_platform_op(uint32_t op)
     return 0;
 }
 
-static XSM_INLINE int xsm_firmware_info(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_efi_call(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_acpi_sleep(void)
-{
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
-}
-
-static XSM_INLINE int xsm_change_freq(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getidletime(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_machine_memory_map(void)
 {
     if ( !IS_PRIV(current->domain) )
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index f1ccd8e..105201e 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -107,7 +107,6 @@ struct xsm_operations {
     int (*resource_setup_misc) (void);
 
     int (*page_offline)(uint32_t cmd);
-    int (*lockprof)(void);
     int (*tmem_op)(void);
     int (*tmem_control)(void);
 
@@ -124,16 +123,8 @@ struct xsm_operations {
     int (*mem_event_op) (struct domain *d, int op);
     int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
     int (*apic) (struct domain *d, int cmd);
-    int (*xen_settime) (void);
     int (*memtype) (uint32_t access);
-    int (*microcode) (void);
-    int (*platform_quirk) (uint32_t);
     int (*platform_op) (uint32_t cmd);
-    int (*firmware_info) (void);
-    int (*efi_call) (void);
-    int (*acpi_sleep) (void);
-    int (*change_freq) (void);
-    int (*getidletime) (void);
     int (*machine_memory_map) (void);
     int (*domain_memory_map) (struct domain *d);
 #define XSM_MMU_UPDATE_READ      1
@@ -440,11 +431,6 @@ static inline int xsm_page_offline(uint32_t cmd)
     return xsm_ops->page_offline(cmd);
 }
 
-static inline int xsm_lockprof(void)
-{
-    return xsm_ops->lockprof();
-}
-
 static inline int xsm_tmem_op(void)
 {
     return xsm_ops->tmem_op();
@@ -511,56 +497,16 @@ static inline int xsm_apic (struct domain *d, int cmd)
     return xsm_ops->apic(d, cmd);
 }
 
-static inline int xsm_xen_settime (void)
-{
-    return xsm_ops->xen_settime();
-}
-
 static inline int xsm_memtype (uint32_t access)
 {
     return xsm_ops->memtype(access);
 }
 
-static inline int xsm_microcode (void)
-{
-    return xsm_ops->microcode();
-}
-
-static inline int xsm_platform_quirk (uint32_t quirk)
-{
-    return xsm_ops->platform_quirk(quirk);
-}
-
 static inline int xsm_platform_op (uint32_t op)
 {
     return xsm_ops->platform_op(op);
 }
 
-static inline int xsm_firmware_info (void)
-{
-    return xsm_ops->firmware_info();
-}
-
-static inline int xsm_efi_call (void)
-{
-    return xsm_ops->efi_call();
-}
-
-static inline int xsm_acpi_sleep (void)
-{
-    return xsm_ops->acpi_sleep();
-}
-
-static inline int xsm_change_freq (void)
-{
-    return xsm_ops->change_freq();
-}
-
-static inline int xsm_getidletime (void)
-{
-    return xsm_ops->getidletime();
-}
-
 static inline int xsm_machine_memory_map(void)
 {
     return xsm_ops->machine_memory_map();
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 03a17ba..22c66e5 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -94,7 +94,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, resource_setup_misc);
 
     set_to_dummy_if_null(ops, page_offline);
-    set_to_dummy_if_null(ops, lockprof);
     set_to_dummy_if_null(ops, tmem_op);
     set_to_dummy_if_null(ops, tmem_control);
 
@@ -111,16 +110,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, mem_event_op);
     set_to_dummy_if_null(ops, mem_sharing_op);
     set_to_dummy_if_null(ops, apic);
-    set_to_dummy_if_null(ops, xen_settime);
-    set_to_dummy_if_null(ops, memtype);
-    set_to_dummy_if_null(ops, microcode);
-    set_to_dummy_if_null(ops, platform_quirk);
     set_to_dummy_if_null(ops, platform_op);
-    set_to_dummy_if_null(ops, firmware_info);
-    set_to_dummy_if_null(ops, efi_call);
-    set_to_dummy_if_null(ops, acpi_sleep);
-    set_to_dummy_if_null(ops, change_freq);
-    set_to_dummy_if_null(ops, getidletime);
     set_to_dummy_if_null(ops, machine_memory_map);
     set_to_dummy_if_null(ops, domain_memory_map);
     set_to_dummy_if_null(ops, mmu_update);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index d72a807..03ea675 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1186,64 +1186,51 @@ static int flask_apic(struct domain *d, int cmd)
     return domain_has_xen(d, perm);
 }
 
-static int flask_xen_settime(void)
-{
-    return domain_has_xen(current->domain, XEN__SETTIME);
-}
-
-static int flask_memtype(uint32_t access)
-{
-    u32 perm;
-
-    switch ( access )
-    {
-    case XENPF_add_memtype:
-        perm = XEN__MTRR_ADD;
-        break;
-    case XENPF_del_memtype:
-        perm = XEN__MTRR_DEL;
-        break;
-    case XENPF_read_memtype:
-        perm = XEN__MTRR_READ;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return domain_has_xen(current->domain, perm);
-}
-
-static int flask_microcode(void)
-{
-    return domain_has_xen(current->domain, XEN__MICROCODE);
-}
-
-static int flask_platform_quirk(uint32_t quirk)
-{
-    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN, XEN__QUIRK, NULL);
-}
-
 static int flask_platform_op(uint32_t op)
 {
     switch ( op )
     {
+#ifdef CONFIG_X86
+    /* These operations have their own XSM hooks */
+    case XENPF_cpu_online:
+    case XENPF_cpu_offline:
+    case XENPF_cpu_hotadd:
+    case XENPF_mem_hotadd:
+        return 0;
+#endif
+
     case XENPF_settime:
+        return domain_has_xen(current->domain, XEN__SETTIME);
+
     case XENPF_add_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_ADD);
+
     case XENPF_del_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_DEL);
+
     case XENPF_read_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_READ);
+
     case XENPF_microcode_update:
+        return domain_has_xen(current->domain, XEN__MICROCODE);
+
     case XENPF_platform_quirk:
+        return domain_has_xen(current->domain, XEN__QUIRK);
+
     case XENPF_firmware_info:
+        return domain_has_xen(current->domain, XEN__FIRMWARE);
+
     case XENPF_efi_runtime_call:
+        return domain_has_xen(current->domain, XEN__FIRMWARE);
+
     case XENPF_enter_acpi_sleep:
+        return domain_has_xen(current->domain, XEN__SLEEP);
+
     case XENPF_change_freq:
+        return domain_has_xen(current->domain, XEN__FREQUENCY);
+
     case XENPF_getidletime:
-    case XENPF_cpu_online:
-    case XENPF_cpu_offline:
-    case XENPF_cpu_hotadd:
-    case XENPF_mem_hotadd:
-        /* These operations have their own XSM hooks */
-        return 0;
+        return domain_has_xen(current->domain, XEN__GETIDLE);
 
     case XENPF_set_processor_pminfo:
     case XENPF_core_parking:
@@ -1259,31 +1246,6 @@ static int flask_platform_op(uint32_t op)
     }
 }
 
-static int flask_firmware_info(void)
-{
-    return domain_has_xen(current->domain, XEN__FIRMWARE);
-}
-
-static int flask_efi_call(void)
-{
-    return domain_has_xen(current->domain, XEN__FIRMWARE);
-}
-
-static int flask_acpi_sleep(void)
-{
-    return domain_has_xen(current->domain, XEN__SLEEP);
-}
-
-static int flask_change_freq(void)
-{
-    return domain_has_xen(current->domain, XEN__FREQUENCY);
-}
-
-static int flask_getidletime(void)
-{
-    return domain_has_xen(current->domain, XEN__GETIDLE);
-}
-
 static int flask_machine_memory_map(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_MMU, MMU__MEMORYMAP, NULL);
@@ -1519,16 +1481,7 @@ static struct xsm_operations flask_ops = {
     .mem_event_op = flask_mem_event_op,
     .mem_sharing_op = flask_mem_sharing_op,
     .apic = flask_apic,
-    .xen_settime = flask_xen_settime,
-    .memtype = flask_memtype,
-    .microcode = flask_microcode,
-    .platform_quirk = flask_platform_quirk,
     .platform_op = flask_platform_op,
-    .firmware_info = flask_firmware_info,
-    .efi_call = flask_efi_call,
-    .acpi_sleep = flask_acpi_sleep,
-    .change_freq = flask_change_freq,
-    .getidletime = flask_getidletime,
     .machine_memory_map = flask_machine_memory_map,
     .domain_memory_map = flask_domain_memory_map,
     .mmu_update = flask_mmu_update,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 21:29:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 21:29:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaYtY-0006H9-8K; Mon, 19 Nov 2012 21:28:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TaYtW-0006Gm-JV
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 21:28:42 +0000
Received: from [193.109.254.147:41506] by server-11.bemta-14.messagelabs.com
	id 6A/6C-29027-984AAA05; Mon, 19 Nov 2012 21:28:41 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353360510!4558677!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6336 invoked from network); 19 Nov 2012 21:28:31 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-6.tower-27.messagelabs.com with SMTP;
	19 Nov 2012 21:28:31 -0000
X-TM-IMSS-Message-ID: <993c806f000b98b5@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 993c806f000b98b5 ;
	Mon, 19 Nov 2012 16:27:51 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJLSNQB013605; 
	Mon, 19 Nov 2012 16:28:23 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Mon, 19 Nov 2012 16:28:17 -0500
Message-Id: <1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <50AA5521.6080907@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
Cc: keir@xen.org, ian.campbell@citrix.com, JBeulich@suse.com,
	xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH RFC 0/5] XSM hook renames and cleanup
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

These patches clean up some of the XSM code that caused difficulty with
ctags, and changes hook names to show the default action of the hook.
They apply on top of my XSM patch series v5, and if they help increase
readability, will be integrated into the next version of that series.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 21:29:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 21:29:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaYtY-0006H9-8K; Mon, 19 Nov 2012 21:28:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TaYtW-0006Gm-JV
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 21:28:42 +0000
Received: from [193.109.254.147:41506] by server-11.bemta-14.messagelabs.com
	id 6A/6C-29027-984AAA05; Mon, 19 Nov 2012 21:28:41 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353360510!4558677!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6336 invoked from network); 19 Nov 2012 21:28:31 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-6.tower-27.messagelabs.com with SMTP;
	19 Nov 2012 21:28:31 -0000
X-TM-IMSS-Message-ID: <993c806f000b98b5@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 993c806f000b98b5 ;
	Mon, 19 Nov 2012 16:27:51 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJLSNQB013605; 
	Mon, 19 Nov 2012 16:28:23 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Mon, 19 Nov 2012 16:28:17 -0500
Message-Id: <1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <50AA5521.6080907@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
Cc: keir@xen.org, ian.campbell@citrix.com, JBeulich@suse.com,
	xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH RFC 0/5] XSM hook renames and cleanup
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

These patches clean up some of the XSM code that caused difficulty with
ctags, and changes hook names to show the default action of the hook.
They apply on top of my XSM patch series v5, and if they help increase
readability, will be integrated into the next version of that series.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 21:29:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 21:29:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaYuD-0006Pz-Mw; Mon, 19 Nov 2012 21:29:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <joseph.glanville@orionvm.com.au>) id 1TaYuC-0006Pi-Sf
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 21:29:25 +0000
Received: from [85.158.143.35:17297] by server-2.bemta-4.messagelabs.com id
	70/26-28922-4B4AAA05; Mon, 19 Nov 2012 21:29:24 +0000
X-Env-Sender: joseph.glanville@orionvm.com.au
X-Msg-Ref: server-16.tower-21.messagelabs.com!1353360561!13651493!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4627 invoked from network); 19 Nov 2012 21:29:23 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-16.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 21:29:23 -0000
Received: by mail-ie0-f173.google.com with SMTP id k14so4131575iea.32
	for <xen-devel@lists.xen.org>; Mon, 19 Nov 2012 13:29:21 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:x-originating-ip:in-reply-to:references:date
	:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding:x-gm-message-state;
	bh=s3JGG18HR/BujnOsVs1qKTErbbp0erEsa5QXscszpaM=;
	b=NtwHag5wEA+G0+tpLZGxY4qlX7d9vR+XQnoNa/QFMEfzJUnBUrd9s5ktLVABCKNoQd
	iSYIEXbR+WfV/GZUHm5/6TmPDOlwDgxqxN+vUifNLOs3t7zNO5cQD0/2wtVbWK6qxxW2
	hmBnPrZQOuMuFf88Otwfemqzi+wss0EeL6iLBZQV5HVOouOscpeyr1TU/itrd2xB/SUU
	k3yQ/uHkPM2dQaVAhgFsvLJZ22XZYHvG7gG5qqVWvs6OIaBtRTX5MMmuWksiSBIlVgVK
	WXH+DFEFBnkaBALkBdt3fXsL+HqhgNsuZZmCIrqswRzpLqHM3f3aPNulFc2sg+bou5vY
	83qQ==
MIME-Version: 1.0
Received: by 10.43.50.197 with SMTP id vf5mr12164942icb.13.1353360561652; Mon,
	19 Nov 2012 13:29:21 -0800 (PST)
Received: by 10.50.15.132 with HTTP; Mon, 19 Nov 2012 13:29:21 -0800 (PST)
X-Originating-IP: [59.167.234.130]
In-Reply-To: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
References: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
Date: Tue, 20 Nov 2012 08:29:21 +1100
Message-ID: <CAOzFzEjXpcwi1JReUAjEp5kRa2yKeoVwJz_6tGdMqBPjLFrrOw@mail.gmail.com>
From: Joseph Glanville <joseph.glanville@orionvm.com.au>
To: George Dunlap <george.dunlap@eu.citrix.com>
X-Gm-Message-State: ALoCoQnhf2r1rB/xUi26Ewl6qrLjuVpKyQ5vgxD1avfxX/49qhkSB49i8/XTkKZNc9jupcgwuCVu
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH RFC] Make all public hosting providers
 eligible for the pre-disclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

Firstly I would like to say that it's great this conversation is
happening on the open list and that a wider set of organisations are
being considered.

On 16 November 2012 04:14, George Dunlap <george.dunlap@eu.citrix.com> wrot=
e:
> As discussed on the xen-devel mailing list, allow any public hosting
> provider to join the pre-disclosure list:
> * Change "Large hosting providers" to "Public hosting providers"
> * Add rule of thumb for what "public hosting provider" means
> * Add an itemized list of information to be included in the application,
> to make expectations clear and (hopefully) applications more streamlined.

As a smaller but more specialized hosting provider (security concious
client=E8le) I am really glad to hear this.

I think important information that should be forthcoming from service
providers wanting to join the pre-disclosure group would be:

a) How they consume Xen, be it via a vendor, distro packages of some
kind or whether they build and package their own. Those doing their
own packaging I feel should be given somewhat of a priority because
they aren't able to rely on their vendor and instead must dedicate
resources to responding.
b) Their upgrade and security response procedures. It doesn't make
sense for someone to be on the pre-disclosure list if they lack the
ability (or more importantly the requirement) to aggressively test and
push out security fixes.
c) Resources available to assist in testing security patches. This
might be a non-issue but I personally think it's somewhat important
that groups on the pre-disclosure list are able to assist in testing
or reviewing patches, this improves the quality of said patches and
might allow a greater degree of vulnerability exploration. This is
however, largely my own opinion on what is considered fair
contribution in return for the privilege.

I think there should also be appropriate "guideline" points/criteria
that should be covered by other categories of organisations seeking to
join the pre-disclosure group.

Sorry if ideas along the lines of these have already been raised.

>
> NOTE: This RFC is meant to be a way to start a discussion on the exact
> wording which will be voted on.  Once it has gone through review from
> the xen-devel mailing list, I will post an "RC" and announce it on the
> Xen blog, as well as on xen-users.  Once discussion seems to have
> converged, I will post a "FINAL" one, which I will put up for a vote.
>
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
> ---
>  security_vulnerability_process.html |   27 ++++++++++++++++++++-------
>  1 file changed, 20 insertions(+), 7 deletions(-)
>
> diff --git a/security_vulnerability_process.html b/security_vulnerability=
_process.html
> index e305371..35236c9 100644
> --- a/security_vulnerability_process.html
> +++ b/security_vulnerability_process.html
> @@ -194,16 +194,18 @@ if(ns4)_d.write("<scr"+"ipt type=3Dtext/javascript =
src=3D/globals/mmenuns4.js><\/scr
>      addresses (ideally, role addresses) of the security response teams f=
or
>      significant Xen operators and distributors.</p>
>      <p>This includes:<ul>
> -      <li>Large-scale hosting providers;</li>
> +      <li>Public hosting providers;</li>
>        <li>Large-scale organisational users of Xen;</li>
>        <li>Vendors of widely-deployed Xen-based systems;</li>
>        <li>Distributors of widely-deployed operating systems with Xen sup=
port.</li>
>      </ul></p>
>      <p>This includes both corporations and community institutions.</p>
> -    <p>Here as a rule of thumb "large scale" and "widely deployed" means=
 an
> -    installed base of 300,000 or more Xen guests; other well-established
> -    organisations with a mature security response process will be consid=
ered on
> -    a case-by-case basis.</p>
> +    <p>Here as a rule of thumb, "public hosting provider" means
> +    "selling virtualization services to the general public";
> +    "large-scale" and "widely deployed" means an installed base of
> +    300,000 or more Xen guests.  Other well-established organisations
> +    with a mature security response process will be considered on a
> +    case-by-case basis.</p>
>      <p>The list of entities on the pre-disclosure list is public. (Just =
the list
>      of projects and organisations, not the actual email addresses.)</p>
>      <p>If there is an embargo, the pre-disclosure list will receive
> @@ -229,8 +231,19 @@ if(ns4)_d.write("<scr"+"ipt type=3Dtext/javascript s=
rc=3D/globals/mmenuns4.js><\/scr
>         <li>The planned disclosure date</li>
>      </ul></p>
>
> -    <p>Organisations who meet the criteria should contact security@xen i=
f they wish to receive pre-disclosure of advisories. Organisations should n=
ot request subscription via the mailing list web interface, any such subscr=
iption requests will be rejected and ignored.</p>
> -    <p>Normally we would prefer that a role address be used for each org=
anisation, rather than one or more individual's direct email address. This =
helps to ensure that changes of personnel do not end up effectively droppin=
g an organisation from the list</p>
> +    <p>Organisations who meet the criteria should contact security@xen
> +      if they wish to receive pre-disclosure of advisories.  Please
> +      include in the e-mail: <ul>
> +       <li>The name of your organization</li>
> +       <li>A brief description of why you fit the criteria</li>
> +       <li>A security alias e-mail address (see below)</li>
> +       <li>A web page with your security policy statement</li>
> +       <li>If you are a public hosting provider, a web page with your pu=
blic rates</li>
> +      </ul>
> +      Organisations should not request subscription via the mailing
> +      list web interface, any such subscription requests will be
> +      rejected and ignored.</p>
> +    <p>We prefer that a role address be used for each organisation, rath=
er than one or more individual's direct email address. This helps to ensure=
 that changes of personnel do not end up effectively dropping an organisati=
on from the list</p>
>
>
>      <h3>Organizations on the pre-disclosure list:</h3>
> --
> 1.7.9.5
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



-- =

CTO | Orion Virtualisation Solutions | www.orionvm.com.au
Phone: 1300 56 99 52 | Mobile: 0428 754 846

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 21:29:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 21:29:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaYuD-0006Pz-Mw; Mon, 19 Nov 2012 21:29:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <joseph.glanville@orionvm.com.au>) id 1TaYuC-0006Pi-Sf
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 21:29:25 +0000
Received: from [85.158.143.35:17297] by server-2.bemta-4.messagelabs.com id
	70/26-28922-4B4AAA05; Mon, 19 Nov 2012 21:29:24 +0000
X-Env-Sender: joseph.glanville@orionvm.com.au
X-Msg-Ref: server-16.tower-21.messagelabs.com!1353360561!13651493!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4627 invoked from network); 19 Nov 2012 21:29:23 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-16.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 21:29:23 -0000
Received: by mail-ie0-f173.google.com with SMTP id k14so4131575iea.32
	for <xen-devel@lists.xen.org>; Mon, 19 Nov 2012 13:29:21 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:x-originating-ip:in-reply-to:references:date
	:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding:x-gm-message-state;
	bh=s3JGG18HR/BujnOsVs1qKTErbbp0erEsa5QXscszpaM=;
	b=NtwHag5wEA+G0+tpLZGxY4qlX7d9vR+XQnoNa/QFMEfzJUnBUrd9s5ktLVABCKNoQd
	iSYIEXbR+WfV/GZUHm5/6TmPDOlwDgxqxN+vUifNLOs3t7zNO5cQD0/2wtVbWK6qxxW2
	hmBnPrZQOuMuFf88Otwfemqzi+wss0EeL6iLBZQV5HVOouOscpeyr1TU/itrd2xB/SUU
	k3yQ/uHkPM2dQaVAhgFsvLJZ22XZYHvG7gG5qqVWvs6OIaBtRTX5MMmuWksiSBIlVgVK
	WXH+DFEFBnkaBALkBdt3fXsL+HqhgNsuZZmCIrqswRzpLqHM3f3aPNulFc2sg+bou5vY
	83qQ==
MIME-Version: 1.0
Received: by 10.43.50.197 with SMTP id vf5mr12164942icb.13.1353360561652; Mon,
	19 Nov 2012 13:29:21 -0800 (PST)
Received: by 10.50.15.132 with HTTP; Mon, 19 Nov 2012 13:29:21 -0800 (PST)
X-Originating-IP: [59.167.234.130]
In-Reply-To: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
References: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
Date: Tue, 20 Nov 2012 08:29:21 +1100
Message-ID: <CAOzFzEjXpcwi1JReUAjEp5kRa2yKeoVwJz_6tGdMqBPjLFrrOw@mail.gmail.com>
From: Joseph Glanville <joseph.glanville@orionvm.com.au>
To: George Dunlap <george.dunlap@eu.citrix.com>
X-Gm-Message-State: ALoCoQnhf2r1rB/xUi26Ewl6qrLjuVpKyQ5vgxD1avfxX/49qhkSB49i8/XTkKZNc9jupcgwuCVu
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH RFC] Make all public hosting providers
 eligible for the pre-disclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

Firstly I would like to say that it's great this conversation is
happening on the open list and that a wider set of organisations are
being considered.

On 16 November 2012 04:14, George Dunlap <george.dunlap@eu.citrix.com> wrot=
e:
> As discussed on the xen-devel mailing list, allow any public hosting
> provider to join the pre-disclosure list:
> * Change "Large hosting providers" to "Public hosting providers"
> * Add rule of thumb for what "public hosting provider" means
> * Add an itemized list of information to be included in the application,
> to make expectations clear and (hopefully) applications more streamlined.

As a smaller but more specialized hosting provider (security concious
client=E8le) I am really glad to hear this.

I think important information that should be forthcoming from service
providers wanting to join the pre-disclosure group would be:

a) How they consume Xen, be it via a vendor, distro packages of some
kind or whether they build and package their own. Those doing their
own packaging I feel should be given somewhat of a priority because
they aren't able to rely on their vendor and instead must dedicate
resources to responding.
b) Their upgrade and security response procedures. It doesn't make
sense for someone to be on the pre-disclosure list if they lack the
ability (or more importantly the requirement) to aggressively test and
push out security fixes.
c) Resources available to assist in testing security patches. This
might be a non-issue but I personally think it's somewhat important
that groups on the pre-disclosure list are able to assist in testing
or reviewing patches, this improves the quality of said patches and
might allow a greater degree of vulnerability exploration. This is
however, largely my own opinion on what is considered fair
contribution in return for the privilege.

I think there should also be appropriate "guideline" points/criteria
that should be covered by other categories of organisations seeking to
join the pre-disclosure group.

Sorry if ideas along the lines of these have already been raised.

>
> NOTE: This RFC is meant to be a way to start a discussion on the exact
> wording which will be voted on.  Once it has gone through review from
> the xen-devel mailing list, I will post an "RC" and announce it on the
> Xen blog, as well as on xen-users.  Once discussion seems to have
> converged, I will post a "FINAL" one, which I will put up for a vote.
>
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
> ---
>  security_vulnerability_process.html |   27 ++++++++++++++++++++-------
>  1 file changed, 20 insertions(+), 7 deletions(-)
>
> diff --git a/security_vulnerability_process.html b/security_vulnerability=
_process.html
> index e305371..35236c9 100644
> --- a/security_vulnerability_process.html
> +++ b/security_vulnerability_process.html
> @@ -194,16 +194,18 @@ if(ns4)_d.write("<scr"+"ipt type=3Dtext/javascript =
src=3D/globals/mmenuns4.js><\/scr
>      addresses (ideally, role addresses) of the security response teams f=
or
>      significant Xen operators and distributors.</p>
>      <p>This includes:<ul>
> -      <li>Large-scale hosting providers;</li>
> +      <li>Public hosting providers;</li>
>        <li>Large-scale organisational users of Xen;</li>
>        <li>Vendors of widely-deployed Xen-based systems;</li>
>        <li>Distributors of widely-deployed operating systems with Xen sup=
port.</li>
>      </ul></p>
>      <p>This includes both corporations and community institutions.</p>
> -    <p>Here as a rule of thumb "large scale" and "widely deployed" means=
 an
> -    installed base of 300,000 or more Xen guests; other well-established
> -    organisations with a mature security response process will be consid=
ered on
> -    a case-by-case basis.</p>
> +    <p>Here as a rule of thumb, "public hosting provider" means
> +    "selling virtualization services to the general public";
> +    "large-scale" and "widely deployed" means an installed base of
> +    300,000 or more Xen guests.  Other well-established organisations
> +    with a mature security response process will be considered on a
> +    case-by-case basis.</p>
>      <p>The list of entities on the pre-disclosure list is public. (Just =
the list
>      of projects and organisations, not the actual email addresses.)</p>
>      <p>If there is an embargo, the pre-disclosure list will receive
> @@ -229,8 +231,19 @@ if(ns4)_d.write("<scr"+"ipt type=3Dtext/javascript s=
rc=3D/globals/mmenuns4.js><\/scr
>         <li>The planned disclosure date</li>
>      </ul></p>
>
> -    <p>Organisations who meet the criteria should contact security@xen i=
f they wish to receive pre-disclosure of advisories. Organisations should n=
ot request subscription via the mailing list web interface, any such subscr=
iption requests will be rejected and ignored.</p>
> -    <p>Normally we would prefer that a role address be used for each org=
anisation, rather than one or more individual's direct email address. This =
helps to ensure that changes of personnel do not end up effectively droppin=
g an organisation from the list</p>
> +    <p>Organisations who meet the criteria should contact security@xen
> +      if they wish to receive pre-disclosure of advisories.  Please
> +      include in the e-mail: <ul>
> +       <li>The name of your organization</li>
> +       <li>A brief description of why you fit the criteria</li>
> +       <li>A security alias e-mail address (see below)</li>
> +       <li>A web page with your security policy statement</li>
> +       <li>If you are a public hosting provider, a web page with your pu=
blic rates</li>
> +      </ul>
> +      Organisations should not request subscription via the mailing
> +      list web interface, any such subscription requests will be
> +      rejected and ignored.</p>
> +    <p>We prefer that a role address be used for each organisation, rath=
er than one or more individual's direct email address. This helps to ensure=
 that changes of personnel do not end up effectively dropping an organisati=
on from the list</p>
>
>
>      <h3>Organizations on the pre-disclosure list:</h3>
> --
> 1.7.9.5
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



-- =

CTO | Orion Virtualisation Solutions | www.orionvm.com.au
Phone: 1300 56 99 52 | Mobile: 0428 754 846

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 21:42:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 21:42:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaZ6K-0006ug-6L; Mon, 19 Nov 2012 21:41:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TaZ6I-0006ub-Rw
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 21:41:55 +0000
Received: from [85.158.139.211:5012] by server-9.bemta-5.messagelabs.com id
	5D/E9-29295-2A7AAA05; Mon, 19 Nov 2012 21:41:54 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353361312!20812070!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNjExNjU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6786 invoked from network); 19 Nov 2012 21:41:53 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 21:41:53 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAJLfnZM025050
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 19 Nov 2012 21:41:50 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAJLfmdf015886
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 19 Nov 2012 21:41:48 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAJLflge001852; Mon, 19 Nov 2012 15:41:47 -0600
MIME-Version: 1.0
Message-ID: <e87e0192-e0d5-4f35-8b20-fb82c431c918@default>
Date: Mon, 19 Nov 2012 13:41:45 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Andres Lagar-Cavilla <andreslc@gridcentric.ca>, xen-devel@lists.xen.org
References: <mailman.16877.1353355647.1399.xen-devel@lists.xen.org>
	<1F985F20-30DE-4E12-AC8B-68FCA5DABF8F@gridcentric.ca>
In-Reply-To: <1F985F20-30DE-4E12-AC8B-68FCA5DABF8F@gridcentric.ca>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "Keir
	\(Xen.org\)" <keir@xen.org>, Zhigang Wang <zhigang.x.wang@oracle.com>,
	Tim Deegan <tim@xen.org>, Jan Beulich <JBeulich@suse.com>,
	Konrad Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop
	of	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Andres Lagar-Cavilla [mailto:andreslc@gridcentric.ca]
> Subject: Re: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> > Fair enough.
> >
> > After reviewing the thread where low_mem was submitted, I have to admit
> > that I am a bit baffled as to when the low_mem handling would ever be
> > necessary.   I suspect it is because the author and I are approaching
> 
> Little to be baffled at, as per above explanation. And probably a good idea to cc the author if so.
> 
> Andres
>
> > memory management from a completely different paradigm (per discussion
> > in an earlier thread where "claim" was first proposed), so that
> > is probably better left for the deferred discussion of the
> > integration.
> >
> > So since you (Jan) do not consider this (lack of integration with
> > low_mem) a showstopper for claim, I will set myself a reminder
> > to initiate a new thread about this later.

     ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Hi Andres (and sorry for the typo in your name earlier in the thread) --

> ...And probably a good idea to cc the author if so.

No offense intended, I certainly intended for you to be not just on
the "Cc" list but on the "To" list of the new thread, but you are too
quick for me and, due to time constraints, I may not get to that
new thread until next week (it's a holiday week in the US).  But until
then... a quick clarification:

> > After reviewing the thread where low_mem was submitted, I have to admit
> > that I am a bit baffled as to when the low_mem handling would ever be
> > necessary.   I suspect it is because the author and I are approaching

I meant "ever be necessary in the dynamic memory (e.g. tmem) paradigm",
not the squeezed (or MS -memory-balancing-engine) paradigm, where I can
at least fathom it.

Feel free to start the new thread if you like, but I may not be able
to answer for a few days.

Happy Thanksgiving-week-in-the-US,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 21:42:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 21:42:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaZ6K-0006ug-6L; Mon, 19 Nov 2012 21:41:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TaZ6I-0006ub-Rw
	for xen-devel@lists.xen.org; Mon, 19 Nov 2012 21:41:55 +0000
Received: from [85.158.139.211:5012] by server-9.bemta-5.messagelabs.com id
	5D/E9-29295-2A7AAA05; Mon, 19 Nov 2012 21:41:54 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353361312!20812070!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNjExNjU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6786 invoked from network); 19 Nov 2012 21:41:53 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 19 Nov 2012 21:41:53 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAJLfnZM025050
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 19 Nov 2012 21:41:50 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAJLfmdf015886
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 19 Nov 2012 21:41:48 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAJLflge001852; Mon, 19 Nov 2012 15:41:47 -0600
MIME-Version: 1.0
Message-ID: <e87e0192-e0d5-4f35-8b20-fb82c431c918@default>
Date: Mon, 19 Nov 2012 13:41:45 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Andres Lagar-Cavilla <andreslc@gridcentric.ca>, xen-devel@lists.xen.org
References: <mailman.16877.1353355647.1399.xen-devel@lists.xen.org>
	<1F985F20-30DE-4E12-AC8B-68FCA5DABF8F@gridcentric.ca>
In-Reply-To: <1F985F20-30DE-4E12-AC8B-68FCA5DABF8F@gridcentric.ca>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "Keir
	\(Xen.org\)" <keir@xen.org>, Zhigang Wang <zhigang.x.wang@oracle.com>,
	Tim Deegan <tim@xen.org>, Jan Beulich <JBeulich@suse.com>,
	Konrad Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop
	of	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Andres Lagar-Cavilla [mailto:andreslc@gridcentric.ca]
> Subject: Re: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> > Fair enough.
> >
> > After reviewing the thread where low_mem was submitted, I have to admit
> > that I am a bit baffled as to when the low_mem handling would ever be
> > necessary.   I suspect it is because the author and I are approaching
> 
> Little to be baffled at, as per above explanation. And probably a good idea to cc the author if so.
> 
> Andres
>
> > memory management from a completely different paradigm (per discussion
> > in an earlier thread where "claim" was first proposed), so that
> > is probably better left for the deferred discussion of the
> > integration.
> >
> > So since you (Jan) do not consider this (lack of integration with
> > low_mem) a showstopper for claim, I will set myself a reminder
> > to initiate a new thread about this later.

     ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Hi Andres (and sorry for the typo in your name earlier in the thread) --

> ...And probably a good idea to cc the author if so.

No offense intended, I certainly intended for you to be not just on
the "Cc" list but on the "To" list of the new thread, but you are too
quick for me and, due to time constraints, I may not get to that
new thread until next week (it's a holiday week in the US).  But until
then... a quick clarification:

> > After reviewing the thread where low_mem was submitted, I have to admit
> > that I am a bit baffled as to when the low_mem handling would ever be
> > necessary.   I suspect it is because the author and I are approaching

I meant "ever be necessary in the dynamic memory (e.g. tmem) paradigm",
not the squeezed (or MS -memory-balancing-engine) paradigm, where I can
at least fathom it.

Feel free to start the new thread if you like, but I may not be able
to answer for a few days.

Happy Thanksgiving-week-in-the-US,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 21:46:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 21:46:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaZAb-000732-TR; Mon, 19 Nov 2012 21:46:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaZAb-00072x-3k
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 21:46:21 +0000
Received: from [85.158.139.83:53852] by server-7.bemta-5.messagelabs.com id
	E4/AD-23096-CA8AAA05; Mon, 19 Nov 2012 21:46:20 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1353361579!30998565!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3416 invoked from network); 19 Nov 2012 21:46:19 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 21:46:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15890181"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 21:46:18 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 21:46:19 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TaZAY-0002V3-G5;
	Mon, 19 Nov 2012 21:46:18 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TaZAY-0000bU-FV;
	Mon, 19 Nov 2012 21:46:18 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14419-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 19 Nov 2012 21:46:18 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.1-testing test] 14419: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14419 xen-4.1-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14419/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-sedf     14 guest-localmigrate/x10      fail pass in 14417
 test-amd64-i386-pv            3 host-install(3)  broken in 14417 pass in 14419

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail like 14400

Tests which did not succeed, but are not blocking:
 test-amd64-i386-qemuu-rhel6hvm-intel 11 leak-check/check       fail never pass
 test-amd64-i386-qemuu-rhel6hvm-amd 11 leak-check/check         fail never pass
 test-amd64-i386-rhel6hvm-intel 11 leak-check/check             fail never pass
 test-amd64-i386-rhel6hvm-amd 11 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-i386-i386-xl-qemuu-winxpsp3 13 guest-stop                 fail never pass

version targeted for testing:
 xen                  5639047d6c9f
baseline version:
 xen                  ce405f5fd5ee

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               fail    
 test-amd64-i386-qemuu-rhel6hvm-intel                         fail    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 pass    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.1-testing
+ revision=5639047d6c9f
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.1-testing 5639047d6c9f
+ branch=xen-4.1-testing
+ revision=5639047d6c9f
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.1-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.1-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.1-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.1-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.1-testing.git
++ : daily-cron.xen-4.1-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.1-testing.git
+ info_linux_tree xen-4.1-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.1-testing.hg
+ hg push -r 5639047d6c9f ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 19 21:46:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Nov 2012 21:46:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaZAb-000732-TR; Mon, 19 Nov 2012 21:46:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TaZAb-00072x-3k
	for xen-devel@lists.xensource.com; Mon, 19 Nov 2012 21:46:21 +0000
Received: from [85.158.139.83:53852] by server-7.bemta-5.messagelabs.com id
	E4/AD-23096-CA8AAA05; Mon, 19 Nov 2012 21:46:20 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1353361579!30998565!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3416 invoked from network); 19 Nov 2012 21:46:19 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	19 Nov 2012 21:46:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,280,1352073600"; d="scan'208";a="15890181"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	19 Nov 2012 21:46:18 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 19 Nov 2012 21:46:19 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TaZAY-0002V3-G5;
	Mon, 19 Nov 2012 21:46:18 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TaZAY-0000bU-FV;
	Mon, 19 Nov 2012 21:46:18 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14419-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 19 Nov 2012 21:46:18 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.1-testing test] 14419: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14419 xen-4.1-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14419/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-sedf     14 guest-localmigrate/x10      fail pass in 14417
 test-amd64-i386-pv            3 host-install(3)  broken in 14417 pass in 14419

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail like 14400

Tests which did not succeed, but are not blocking:
 test-amd64-i386-qemuu-rhel6hvm-intel 11 leak-check/check       fail never pass
 test-amd64-i386-qemuu-rhel6hvm-amd 11 leak-check/check         fail never pass
 test-amd64-i386-rhel6hvm-intel 11 leak-check/check             fail never pass
 test-amd64-i386-rhel6hvm-amd 11 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-i386-i386-xl-qemuu-winxpsp3 13 guest-stop                 fail never pass

version targeted for testing:
 xen                  5639047d6c9f
baseline version:
 xen                  ce405f5fd5ee

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               fail    
 test-amd64-i386-qemuu-rhel6hvm-intel                         fail    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 pass    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.1-testing
+ revision=5639047d6c9f
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.1-testing 5639047d6c9f
+ branch=xen-4.1-testing
+ revision=5639047d6c9f
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.1-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.1-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.1-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.1-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.1-testing.git
++ : daily-cron.xen-4.1-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.1-testing.git
+ info_linux_tree xen-4.1-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.1-testing.hg
+ hg push -r 5639047d6c9f ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 01:02:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 01:02:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TacEM-0004K4-Re; Tue, 20 Nov 2012 01:02:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TacEL-0004Jz-K9
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 01:02:26 +0000
Received: from [85.158.138.51:59922] by server-11.bemta-3.messagelabs.com id
	A4/F2-19361-0A6DAA05; Tue, 20 Nov 2012 01:02:24 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353373343!22645423!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14992 invoked from network); 20 Nov 2012 01:02:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 01:02:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,282,1352073600"; d="scan'208";a="15891834"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 01:02:22 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 20 Nov 2012 01:02:22 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TacEI-0003Wr-EG;
	Tue, 20 Nov 2012 01:02:22 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TacEG-0002CH-FX;
	Tue, 20 Nov 2012 01:02:22 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14426-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 20 Nov 2012 01:02:20 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14426: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14426 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14426/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-xend-winxpsp3  8 guest-saverestore        fail REGR. vs. 14416
 test-amd64-i386-win           8 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-pv           10 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-win-vcpus1    8 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-pair   17 guest-migrate/src_host/dst_host fail REGR. vs. 14416
 build-amd64-pvops             4 kernel-build              fail REGR. vs. 14416

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a

version targeted for testing:
 xen                  02b9d9a25fee
baseline version:
 xen                  321f8487379b

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Wei Wang <wei.wang2@amd.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            fail    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           fail    
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26178:02b9d9a25fee
tag:         tip
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 19:56:56 2012 +0000
    
    xen: fix build failure due to extra closing comment
    
    Added by 26173:26facad2f1a1
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26177:fe8034159ac2
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:35 2012 +0000
    
    docs: Include prototype for HYPERVISOR_multicall
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26176:edad24bfa561
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:34 2012 +0000
    
    docs: Document HYPERVISOR_update_descriptor
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26175:b1d36147ac96
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Add ToC entry for start of day memory layout.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26174:dbb8d24bb5ad
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Document HYPERVISOR_mmuext_op
    
    Mark-up for inclusion of generated docs.
    
    Remove some trailing whitespace.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26173:26facad2f1a1
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:32 2012 +0000
    
    docs: document HYPERVISOR_update_va_mapping(_other_domain)
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26172:cfd2772cc717
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:31 2012 +0000
    
    docs: document/mark-up SCHEDOP_*
    
    The biggest subtlety here is there additional argument when op ==
    SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
    xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
    
    This patch moves some structs around but there is no functional change
    other than improved documentation.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26171:31668da0c4d3
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 15:15:12 2012 +0100
    
    AMD IOMMU: fix type of "bdf" parameter of update_intremap_entry_from_msi_msg()
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26170:380ad94f2adc
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:51 2012 +0000
    
    Remove tools/vtpm* from MAINTAINERS file
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26169:5a6225e40388
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:50 2012 +0000
    
    tools: Remove old vtpm stuff from tools/libxen
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26168:3dc18d679d04
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:49 2012 +0000
    
    Remove VTPM_TOOLS from config/Tools.mk.in
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26167:31dcc0e08754
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    xend: Remove old vtpm support from xm
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26166:d026f8abca51
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    minios: Update mini-os license to support GPL features
    
    This patch updates extras/mini-os/COPYING to explain
    which optional features are GPL and what the implications
    of enabling them are.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26165:42a7c393c390
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:47 2012 +0000
    
    minios: fix bug in lseek for mini-os
    
    lseek always used files[fd].file.offset. It should
    use the offset of whatever union member is actually
    being used.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26164:17539cec2b9d
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: get the number of cpus from device tree
    
    The system might have fewer cpus than the GIC supports.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26163:ddb109120dbd
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: flush D-cache and I-cache when appropriate
    
    - invalidate tlb after setting WXN
    - flush D-cache and I-cache after relocation;
    - invalidate D-cache after writing to smp_up_cpu;
    - flush I-cache after changing HTTBR;
    - flush I-cache and branch predictor after writing Xen text ptes.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26162:9da9781cc3fb
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 09:48:22 2012 +0100
    
    vscsiif: minor cleanup
    
    Remove a definition not belonging into the interface, and correct a
    few typos in comments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26161:9025a10c0561
user:        Wei Wang <wei.wang2@amd.com>
date:        Mon Nov 19 09:46:46 2012 +0100
    
    AMD IOMMU: Enable HPET broadcast msi remapping
    
    This patch enables hpet msi remapping for amd iommu.
    
    Signed-off-by: Wei Wang <wei.wang2@amd.com>
    
    - use the existing ACPI_IVHD_* #define-s
    - warn on finding more than one IVHD HPET entry
    - consolidate parameters of update_intremap_entry_from_msi_msg()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Committed-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26160:321f8487379b
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:29 2012 +0000
    
    xen/arm: wake up secondary cpus
    
    Secondary cpus are held by the firmware until we send an IPI to them.
    
    Reordered non-boot cpu wait loop to perform the check before waiting
    for an event, to handled the case where the event has already
    happened when we reach the loop.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 01:02:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 01:02:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TacEM-0004K4-Re; Tue, 20 Nov 2012 01:02:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TacEL-0004Jz-K9
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 01:02:26 +0000
Received: from [85.158.138.51:59922] by server-11.bemta-3.messagelabs.com id
	A4/F2-19361-0A6DAA05; Tue, 20 Nov 2012 01:02:24 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353373343!22645423!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14992 invoked from network); 20 Nov 2012 01:02:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 01:02:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,282,1352073600"; d="scan'208";a="15891834"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 01:02:22 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 20 Nov 2012 01:02:22 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TacEI-0003Wr-EG;
	Tue, 20 Nov 2012 01:02:22 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TacEG-0002CH-FX;
	Tue, 20 Nov 2012 01:02:22 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14426-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 20 Nov 2012 01:02:20 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14426: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14426 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14426/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-xend-winxpsp3  8 guest-saverestore        fail REGR. vs. 14416
 test-amd64-i386-win           8 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-pv           10 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-win-vcpus1    8 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-pair   17 guest-migrate/src_host/dst_host fail REGR. vs. 14416
 build-amd64-pvops             4 kernel-build              fail REGR. vs. 14416

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a

version targeted for testing:
 xen                  02b9d9a25fee
baseline version:
 xen                  321f8487379b

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Wei Wang <wei.wang2@amd.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            fail    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           fail    
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26178:02b9d9a25fee
tag:         tip
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 19:56:56 2012 +0000
    
    xen: fix build failure due to extra closing comment
    
    Added by 26173:26facad2f1a1
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26177:fe8034159ac2
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:35 2012 +0000
    
    docs: Include prototype for HYPERVISOR_multicall
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26176:edad24bfa561
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:34 2012 +0000
    
    docs: Document HYPERVISOR_update_descriptor
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26175:b1d36147ac96
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Add ToC entry for start of day memory layout.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26174:dbb8d24bb5ad
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Document HYPERVISOR_mmuext_op
    
    Mark-up for inclusion of generated docs.
    
    Remove some trailing whitespace.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26173:26facad2f1a1
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:32 2012 +0000
    
    docs: document HYPERVISOR_update_va_mapping(_other_domain)
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26172:cfd2772cc717
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:31 2012 +0000
    
    docs: document/mark-up SCHEDOP_*
    
    The biggest subtlety here is there additional argument when op ==
    SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
    xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
    
    This patch moves some structs around but there is no functional change
    other than improved documentation.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26171:31668da0c4d3
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 15:15:12 2012 +0100
    
    AMD IOMMU: fix type of "bdf" parameter of update_intremap_entry_from_msi_msg()
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26170:380ad94f2adc
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:51 2012 +0000
    
    Remove tools/vtpm* from MAINTAINERS file
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26169:5a6225e40388
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:50 2012 +0000
    
    tools: Remove old vtpm stuff from tools/libxen
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26168:3dc18d679d04
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:49 2012 +0000
    
    Remove VTPM_TOOLS from config/Tools.mk.in
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26167:31dcc0e08754
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    xend: Remove old vtpm support from xm
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26166:d026f8abca51
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    minios: Update mini-os license to support GPL features
    
    This patch updates extras/mini-os/COPYING to explain
    which optional features are GPL and what the implications
    of enabling them are.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26165:42a7c393c390
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:47 2012 +0000
    
    minios: fix bug in lseek for mini-os
    
    lseek always used files[fd].file.offset. It should
    use the offset of whatever union member is actually
    being used.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26164:17539cec2b9d
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: get the number of cpus from device tree
    
    The system might have fewer cpus than the GIC supports.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26163:ddb109120dbd
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: flush D-cache and I-cache when appropriate
    
    - invalidate tlb after setting WXN
    - flush D-cache and I-cache after relocation;
    - invalidate D-cache after writing to smp_up_cpu;
    - flush I-cache after changing HTTBR;
    - flush I-cache and branch predictor after writing Xen text ptes.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26162:9da9781cc3fb
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 09:48:22 2012 +0100
    
    vscsiif: minor cleanup
    
    Remove a definition not belonging into the interface, and correct a
    few typos in comments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26161:9025a10c0561
user:        Wei Wang <wei.wang2@amd.com>
date:        Mon Nov 19 09:46:46 2012 +0100
    
    AMD IOMMU: Enable HPET broadcast msi remapping
    
    This patch enables hpet msi remapping for amd iommu.
    
    Signed-off-by: Wei Wang <wei.wang2@amd.com>
    
    - use the existing ACPI_IVHD_* #define-s
    - warn on finding more than one IVHD HPET entry
    - consolidate parameters of update_intremap_entry_from_msi_msg()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Committed-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26160:321f8487379b
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:29 2012 +0000
    
    xen/arm: wake up secondary cpus
    
    Secondary cpus are held by the firmware until we send an IPI to them.
    
    Reordered non-boot cpu wait loop to perform the check before waiting
    for an event, to handled the case where the event has already
    happened when we reach the loop.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 01:24:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 01:24:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TacYi-0004b3-Ud; Tue, 20 Nov 2012 01:23:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ben.guthro@gmail.com>) id 1TacYh-0004ay-6V
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 01:23:27 +0000
Received: from [85.158.139.211:53055] by server-7.bemta-5.messagelabs.com id
	01/B9-23096-E8BDAA05; Tue, 20 Nov 2012 01:23:26 +0000
X-Env-Sender: ben.guthro@gmail.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353374603!20756390!1
X-Originating-IP: [209.85.210.173]
X-SpamReason: No, hits=1.4 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_40_50,HTML_MESSAGE,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2051 invoked from network); 20 Nov 2012 01:23:25 -0000
Received: from mail-ia0-f173.google.com (HELO mail-ia0-f173.google.com)
	(209.85.210.173)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 01:23:25 -0000
Received: by mail-ia0-f173.google.com with SMTP id w21so3084346iac.32
	for <xen-devel@lists.xen.org>; Mon, 19 Nov 2012 17:23:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=ReYYGq0+LnjXG+ZbLzR75eG2Zm2Ru80jX5ceLlFzV54=;
	b=FO+CvH+YIr4b+71vBHbhwgYAENV3+KVnP3cV5aVzORjpFznPJ8XFCidI/rhYVQGoAj
	Nl+L5NDFVutrOdO2LoCv4PQ4JLW7zFq1vgTWMWD3KCevN9mbRvZGczco6oBszdEpaPxq
	/Ygi4rQu3lXDddJ+0w06AKiDfqi8FKrC3Z9iW/lHLu1W/rN4URVV5VDR8IzXqJ0V2A9T
	Lm/GHNW51Dz0MzMWlIDPnmS66G8yWBKi//MADASU55vMGLwcokJzDqMZL9Lhaf980VTR
	GLTuJL70ZmGB8kSSP6TYruh2HiZh+lQG7H8+Q1KGTc5HtTsYYtgdG/5clqFNShpXEAlb
	EP9g==
MIME-Version: 1.0
Received: by 10.42.175.5 with SMTP id ay5mr12492244icb.10.1353374603447; Mon,
	19 Nov 2012 17:23:23 -0800 (PST)
Received: by 10.231.17.13 with HTTP; Mon, 19 Nov 2012 17:23:23 -0800 (PST)
In-Reply-To: <50A50C71.5080906@tiscali.it>
References: <50A50C71.5080906@tiscali.it>
Date: Mon, 19 Nov 2012 20:23:23 -0500
X-Google-Sender-Auth: vbboBABbptEUIxib_H0Hn-ScfB4
Message-ID: <CAOvdn6W-_S9OSfKQsxN0TZmO9g08ZDVn8fEPVz5H53gOurQgew@mail.gmail.com>
From: Ben Guthro <ben@guthro.net>
To: fantonifabio@tiscali.it
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
	in Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6507431191755021527=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6507431191755021527==
Content-Type: multipart/alternative; boundary=90e6ba6e8f387c8f0804cee314ec

--90e6ba6e8f387c8f0804cee314ec
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Nov 15, 2012 at 10:38 AM, Fabio Fantoni <fantonifabio@tiscali.it>wrote:

> Support is provided for both shadow and hardware assisted paging (HAP)
>> modes.
>> This code bookkeeps the set of video frame buffers (vram),
>> detects when the guest has modified any of those buffers and, upon
>> request,
>> returns a bitmap of the modified pages.
>> This lets other software components re-paint the portions of the monitor
>> (or
>> monitors) that have changed.
>> Each monitor has a frame buffer of some size at some position in guest
>> physical
>> memory.
>> The set of frame buffers being tracked can change over time as monitors
>> are
>> plugged and unplugged.
>> (Version 3 of this patch.)
>>
> Is this patch intended for manage multiple indipendent graphic cards on
> xen domU?
> If yes is also intended for both pv and hvm domU?
>
>
No, it is intended to track multiple vram regions, for multiple monitors.

See the original thread, where Robert includes a PDF describing some
background for this patch.
http://markmail.org/message/edw5g5ihhfmcwxov





>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>

--90e6ba6e8f387c8f0804cee314ec
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Thu, Nov 15, 2012 at 10:38 AM, Fabio Fantoni <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:fantonifabio@tiscali.it" target=3D"_blank">fantonifabio@tiscal=
i.it</a>&gt;</span> wrote:<br><div class=3D"gmail_quote"><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex">
<div class=3D"im"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .=
8ex;border-left:1px #ccc solid;padding-left:1ex">
Support is provided for both shadow and hardware assisted paging (HAP) mode=
s.<br>
This code bookkeeps the set of video frame buffers (vram),<br>
detects when the guest has modified any of those buffers and, upon request,=
<br>
returns a bitmap of the modified pages.<br>
This lets other software components re-paint the portions of the monitor (o=
r<br>
monitors) that have changed.<br>
Each monitor has a frame buffer of some size at some position in guest phys=
ical<br>
memory.<br>
The set of frame buffers being tracked can change over time as monitors are=
<br>
plugged and unplugged.<br>
(Version 3 of this patch.)<br>
</blockquote></div>
Is this patch intended for manage multiple indipendent graphic cards on xen=
 domU?<br>
If yes is also intended for both pv and hvm domU?<br>
<br></blockquote><div><br></div><div>No, it is intended to track multiple v=
ram regions, for multiple monitors.</div><div><br></div><div>See the origin=
al thread, where Robert includes a PDF describing some background for this =
patch.</div>
<div><a href=3D"http://markmail.org/message/edw5g5ihhfmcwxov">http://markma=
il.org/message/edw5g5ihhfmcwxov</a></div><div><br></div><div><br></div><div=
><br></div><div>=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:=
0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>_______________________________________________<br>
Xen-devel mailing list<br>
<a href=3D"mailto:Xen-devel@lists.xen.org">Xen-devel@lists.xen.org</a><br>
<a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://lists.x=
en.org/xen-devel</a><br>
<br></blockquote></div><br>

--90e6ba6e8f387c8f0804cee314ec--


--===============6507431191755021527==
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.xen.org
http://lists.xen.org/xen-devel

--===============6507431191755021527==--


From xen-devel-bounces@lists.xen.org Tue Nov 20 01:24:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 01:24:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TacYi-0004b3-Ud; Tue, 20 Nov 2012 01:23:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ben.guthro@gmail.com>) id 1TacYh-0004ay-6V
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 01:23:27 +0000
Received: from [85.158.139.211:53055] by server-7.bemta-5.messagelabs.com id
	01/B9-23096-E8BDAA05; Tue, 20 Nov 2012 01:23:26 +0000
X-Env-Sender: ben.guthro@gmail.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353374603!20756390!1
X-Originating-IP: [209.85.210.173]
X-SpamReason: No, hits=1.4 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_40_50,HTML_MESSAGE,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2051 invoked from network); 20 Nov 2012 01:23:25 -0000
Received: from mail-ia0-f173.google.com (HELO mail-ia0-f173.google.com)
	(209.85.210.173)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 01:23:25 -0000
Received: by mail-ia0-f173.google.com with SMTP id w21so3084346iac.32
	for <xen-devel@lists.xen.org>; Mon, 19 Nov 2012 17:23:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=ReYYGq0+LnjXG+ZbLzR75eG2Zm2Ru80jX5ceLlFzV54=;
	b=FO+CvH+YIr4b+71vBHbhwgYAENV3+KVnP3cV5aVzORjpFznPJ8XFCidI/rhYVQGoAj
	Nl+L5NDFVutrOdO2LoCv4PQ4JLW7zFq1vgTWMWD3KCevN9mbRvZGczco6oBszdEpaPxq
	/Ygi4rQu3lXDddJ+0w06AKiDfqi8FKrC3Z9iW/lHLu1W/rN4URVV5VDR8IzXqJ0V2A9T
	Lm/GHNW51Dz0MzMWlIDPnmS66G8yWBKi//MADASU55vMGLwcokJzDqMZL9Lhaf980VTR
	GLTuJL70ZmGB8kSSP6TYruh2HiZh+lQG7H8+Q1KGTc5HtTsYYtgdG/5clqFNShpXEAlb
	EP9g==
MIME-Version: 1.0
Received: by 10.42.175.5 with SMTP id ay5mr12492244icb.10.1353374603447; Mon,
	19 Nov 2012 17:23:23 -0800 (PST)
Received: by 10.231.17.13 with HTTP; Mon, 19 Nov 2012 17:23:23 -0800 (PST)
In-Reply-To: <50A50C71.5080906@tiscali.it>
References: <50A50C71.5080906@tiscali.it>
Date: Mon, 19 Nov 2012 20:23:23 -0500
X-Google-Sender-Auth: vbboBABbptEUIxib_H0Hn-ScfB4
Message-ID: <CAOvdn6W-_S9OSfKQsxN0TZmO9g08ZDVn8fEPVz5H53gOurQgew@mail.gmail.com>
From: Ben Guthro <ben@guthro.net>
To: fantonifabio@tiscali.it
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
	in Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6507431191755021527=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6507431191755021527==
Content-Type: multipart/alternative; boundary=90e6ba6e8f387c8f0804cee314ec

--90e6ba6e8f387c8f0804cee314ec
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Nov 15, 2012 at 10:38 AM, Fabio Fantoni <fantonifabio@tiscali.it>wrote:

> Support is provided for both shadow and hardware assisted paging (HAP)
>> modes.
>> This code bookkeeps the set of video frame buffers (vram),
>> detects when the guest has modified any of those buffers and, upon
>> request,
>> returns a bitmap of the modified pages.
>> This lets other software components re-paint the portions of the monitor
>> (or
>> monitors) that have changed.
>> Each monitor has a frame buffer of some size at some position in guest
>> physical
>> memory.
>> The set of frame buffers being tracked can change over time as monitors
>> are
>> plugged and unplugged.
>> (Version 3 of this patch.)
>>
> Is this patch intended for manage multiple indipendent graphic cards on
> xen domU?
> If yes is also intended for both pv and hvm domU?
>
>
No, it is intended to track multiple vram regions, for multiple monitors.

See the original thread, where Robert includes a PDF describing some
background for this patch.
http://markmail.org/message/edw5g5ihhfmcwxov





>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>

--90e6ba6e8f387c8f0804cee314ec
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Thu, Nov 15, 2012 at 10:38 AM, Fabio Fantoni <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:fantonifabio@tiscali.it" target=3D"_blank">fantonifabio@tiscal=
i.it</a>&gt;</span> wrote:<br><div class=3D"gmail_quote"><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex">
<div class=3D"im"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .=
8ex;border-left:1px #ccc solid;padding-left:1ex">
Support is provided for both shadow and hardware assisted paging (HAP) mode=
s.<br>
This code bookkeeps the set of video frame buffers (vram),<br>
detects when the guest has modified any of those buffers and, upon request,=
<br>
returns a bitmap of the modified pages.<br>
This lets other software components re-paint the portions of the monitor (o=
r<br>
monitors) that have changed.<br>
Each monitor has a frame buffer of some size at some position in guest phys=
ical<br>
memory.<br>
The set of frame buffers being tracked can change over time as monitors are=
<br>
plugged and unplugged.<br>
(Version 3 of this patch.)<br>
</blockquote></div>
Is this patch intended for manage multiple indipendent graphic cards on xen=
 domU?<br>
If yes is also intended for both pv and hvm domU?<br>
<br></blockquote><div><br></div><div>No, it is intended to track multiple v=
ram regions, for multiple monitors.</div><div><br></div><div>See the origin=
al thread, where Robert includes a PDF describing some background for this =
patch.</div>
<div><a href=3D"http://markmail.org/message/edw5g5ihhfmcwxov">http://markma=
il.org/message/edw5g5ihhfmcwxov</a></div><div><br></div><div><br></div><div=
><br></div><div>=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:=
0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>_______________________________________________<br>
Xen-devel mailing list<br>
<a href=3D"mailto:Xen-devel@lists.xen.org">Xen-devel@lists.xen.org</a><br>
<a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://lists.x=
en.org/xen-devel</a><br>
<br></blockquote></div><br>

--90e6ba6e8f387c8f0804cee314ec--


--===============6507431191755021527==
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.xen.org
http://lists.xen.org/xen-devel

--===============6507431191755021527==--


From xen-devel-bounces@lists.xen.org Tue Nov 20 02:52:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 02:52:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TadwF-0005ZL-VB; Tue, 20 Nov 2012 02:51:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kgrace.liu@gmail.com>) id 1TadwE-0005ZG-KS
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 02:51:50 +0000
Received: from [85.158.137.99:11149] by server-14.bemta-3.messagelabs.com id
	5B/FA-12788-540FAA05; Tue, 20 Nov 2012 02:51:49 +0000
X-Env-Sender: kgrace.liu@gmail.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1353379907!17428703!1
X-Originating-IP: [209.85.219.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31781 invoked from network); 20 Nov 2012 02:51:48 -0000
Received: from mail-oa0-f43.google.com (HELO mail-oa0-f43.google.com)
	(209.85.219.43)
	by server-15.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 02:51:48 -0000
Received: by mail-oa0-f43.google.com with SMTP id k1so7294004oag.30
	for <xen-devel@lists.xensource.com>;
	Mon, 19 Nov 2012 18:51:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=QO1DQ48Nh4lrrUwuknGmq9gU2KAbA7swi76liNxbK20=;
	b=VkA0wWnSDpds4fH9w1IrKHYA3Wr3eqWQxmTl9koS59O/y0FfidwbwqjkkIZY/4b0Pn
	rTTXmBFhyc64r3WjILtnWRqQrBNcfstM79ddzkTNNkhmJYSviXvUTrT+yo8gwS4TFvT8
	jiOQJWoxZUnjXe9LmsVZVTEkIoAd700iMkqd+tFyRYGOLwStC9GMzHCktGv9g/asOsBY
	kDpV5l59DPrvfNRnnhAstBaRWSARxpVdGJu3FYuur/ve04fzb2XxDrL2AFlhYN3Ok8XA
	2uhw4wIS4Asd0EsGKBLFqFr0TyZHLBPcoG0M+ujjRlgZm8XbcAWisASsfPD9zUT9uqML
	Az0A==
MIME-Version: 1.0
Received: by 10.60.13.198 with SMTP id j6mr12111849oec.51.1353379907213; Mon,
	19 Nov 2012 18:51:47 -0800 (PST)
Received: by 10.60.21.163 with HTTP; Mon, 19 Nov 2012 18:51:47 -0800 (PST)
In-Reply-To: <1353324241.18229.47.camel@zakaz.uk.xensource.com>
References: <CAERYnoZOJ-9nMjEbNNqWfU0Co6ksOHqOCG+nErKMfsnqJ125=w@mail.gmail.com>
	<1353324241.18229.47.camel@zakaz.uk.xensource.com>
Date: Tue, 20 Nov 2012 10:51:47 +0800
X-Google-Sender-Auth: r1pIaQRggTcF9W2-L3TWPTE0j8w
Message-ID: <CAERYnobu+bFH-_HCHJyQG4FLmOFwUcfRbir7L+Hh9uA7jySh_Q@mail.gmail.com>
From: Chunyan Liu <cyliu@suse.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH]xenstore-chmod: handle arbitrary number of
 perms rather than MAX_PERMS constant
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

2012/11/19 Ian Campbell <Ian.Campbell@citrix.com>:
> On Fri, 2012-11-16 at 06:02 +0000, Chunyan Liu wrote:
>> Constant MAX_PERMS 16 is too small to use in some occasions, e.g. if
>> there are more than 16 domU(s) on one hypervisor (it's easy to
>> achieve) and one wants to do xenstore-chmod PATH to all domU(s). So,
>> remove MAX_PERMS limitation and make it as arbitrary number of perms.
>>
>> Signed-off-by: Chunyan Liu <cyliu@suse.com>
>>
>> diff -r 8b93ac0c93f3 tools/xenstore/xenstore_client.c
>> --- a/tools/xenstore/xenstore_client.c  Tue Nov 13 11:19:17 2012 +0000
>> +++ b/tools/xenstore/xenstore_client.c  Thu Nov 15 16:33:32 2012 +0800
>> @@ -25,7 +25,6 @@
>>  #define PATH_SEP '/'
>>  #define MAX_PATH_LEN 256
>>
>> -#define MAX_PERMS 16
>>
>>  enum mode {
>>      MODE_unknown,
>> @@ -416,31 +415,31 @@ perform(enum mode mode, int optind, int
>>             break;
>>          }
>>          case MODE_chmod: {
>> -            struct xs_permissions perms[MAX_PERMS];
>> -            int nperms = 0;
>> +            struct xs_permissions *perms;
>>              /* save path pointer: */
>>              char *path = argv[optind++];
>> +            int nperms = argc - optind;
>> +            int i;
>> +            perms = (struct xs_permissions *)malloc(nperms *
>> sizeof(struct xs_permissions));
>
> You could just do:
>                 struct xs_permissions perms[nperms];
> and let the compiler allocate enough space on the stack.
Will update.

>> +            if (!perms)
>> +               err(1, NULL);
>> -            for (; argv[optind]; optind++, nperms++)
>> +            for (i = 0; argv[optind]; optind++, i++)
>>              {
>> -                if (MAX_PERMS <= nperms)
>> -                    errx(1, "Too many permissions specified.  "
>> -                        "Maximum per invocation is %d.", MAX_PERMS);
>> -
>> -                perms[nperms].id = atoi(argv[optind]+1);
>> +                perms[i].id = atoi(argv[optind]+1);
>>
>>                  switch (argv[optind][0])
>>                  {
>>                  case 'n':
>> -                    perms[nperms].perms = XS_PERM_NONE;
>> +                    perms[i].perms = XS_PERM_NONE;
>>                      break;
>>                  case 'r':
>> -                    perms[nperms].perms = XS_PERM_READ;
>> +                    perms[i].perms = XS_PERM_READ;
>>                      break;
>>                  case 'w':
>> -                    perms[nperms].perms = XS_PERM_WRITE;
>> +                    perms[i].perms = XS_PERM_WRITE;
>>                      break;
>>                  case 'b':
>> -                    perms[nperms].perms = XS_PERM_READ | XS_PERM_WRITE;
>> +                    perms[i].perms = XS_PERM_READ | XS_PERM_WRITE;
>>                      break;
>>                  default:
>>                      errx(1, "Invalid permission specification: '%c'",
>> @@ -449,6 +448,7 @@ perform(enum mode mode, int optind, int
>>              }
>>
>>              do_chmod(path, perms, nperms, upto, recurse, xsh, xth);
>> +            free(perms);
>>              break;
>>          }
>>          case MODE_watch: {
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>
>
>
> _______________________________________________>
>> +            if (!perms)
>> +               err(1, NULL);
>> -            for (; argv[optind]; optind++, nperms++)
>> +            for (i = 0; argv[optind]; optind++, i++)
>>              {
>> -                if (MAX_PERMS <= nperms)
>> -                    errx(1, "Too many permissions specified.  "
>> -                        "Maximum per invocation is %d.", MAX_PERMS);
>> -
>> -                perms[nperms].id = atoi(argv[optind]+1);
>> +                perms[i].id = atoi(argv[optind]+1);
>>
>>                  switch (argv[optind][0])
>>                  {
>>                  case 'n':
>> -                    perms[nperms].perms = XS_PERM_NONE;
>> +                    perms[i].perms = XS_PERM_NONE;
>>                      break;
>>                  case 'r':
>> -                    perms[nperms].perms = XS_PERM_READ;
>> +                    perms[i].perms = XS_PERM_READ;
>>                      break;
>>                  case 'w':
>> -                    perms[nperms].perms = XS_PERM_WRITE;
>> +                    perms[i].perms = XS_PERM_WRITE;
>>                      break;
>>                  case 'b':
>> -                    perms[nperms].perms = XS_PERM_READ | XS_PERM_WRITE;
>> +                    perms[i].perms = XS_PERM_READ | XS_PERM_WRITE;
>>                      break;
>>                  default:
>>                      errx(1, "Invalid permission specification: '%c'",
>> @@ -449,6 +448,7 @@ perform(enum mode mode, int optind, int
>>              }
>>
>>              do_chmod(path, perms, nperms, upto, recurse, xsh, xth);
>> +            free(perms);
>>              break;
>>          }
>>          case MODE_watch: {
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>


> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 02:52:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 02:52:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TadwF-0005ZL-VB; Tue, 20 Nov 2012 02:51:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kgrace.liu@gmail.com>) id 1TadwE-0005ZG-KS
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 02:51:50 +0000
Received: from [85.158.137.99:11149] by server-14.bemta-3.messagelabs.com id
	5B/FA-12788-540FAA05; Tue, 20 Nov 2012 02:51:49 +0000
X-Env-Sender: kgrace.liu@gmail.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1353379907!17428703!1
X-Originating-IP: [209.85.219.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31781 invoked from network); 20 Nov 2012 02:51:48 -0000
Received: from mail-oa0-f43.google.com (HELO mail-oa0-f43.google.com)
	(209.85.219.43)
	by server-15.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 02:51:48 -0000
Received: by mail-oa0-f43.google.com with SMTP id k1so7294004oag.30
	for <xen-devel@lists.xensource.com>;
	Mon, 19 Nov 2012 18:51:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=QO1DQ48Nh4lrrUwuknGmq9gU2KAbA7swi76liNxbK20=;
	b=VkA0wWnSDpds4fH9w1IrKHYA3Wr3eqWQxmTl9koS59O/y0FfidwbwqjkkIZY/4b0Pn
	rTTXmBFhyc64r3WjILtnWRqQrBNcfstM79ddzkTNNkhmJYSviXvUTrT+yo8gwS4TFvT8
	jiOQJWoxZUnjXe9LmsVZVTEkIoAd700iMkqd+tFyRYGOLwStC9GMzHCktGv9g/asOsBY
	kDpV5l59DPrvfNRnnhAstBaRWSARxpVdGJu3FYuur/ve04fzb2XxDrL2AFlhYN3Ok8XA
	2uhw4wIS4Asd0EsGKBLFqFr0TyZHLBPcoG0M+ujjRlgZm8XbcAWisASsfPD9zUT9uqML
	Az0A==
MIME-Version: 1.0
Received: by 10.60.13.198 with SMTP id j6mr12111849oec.51.1353379907213; Mon,
	19 Nov 2012 18:51:47 -0800 (PST)
Received: by 10.60.21.163 with HTTP; Mon, 19 Nov 2012 18:51:47 -0800 (PST)
In-Reply-To: <1353324241.18229.47.camel@zakaz.uk.xensource.com>
References: <CAERYnoZOJ-9nMjEbNNqWfU0Co6ksOHqOCG+nErKMfsnqJ125=w@mail.gmail.com>
	<1353324241.18229.47.camel@zakaz.uk.xensource.com>
Date: Tue, 20 Nov 2012 10:51:47 +0800
X-Google-Sender-Auth: r1pIaQRggTcF9W2-L3TWPTE0j8w
Message-ID: <CAERYnobu+bFH-_HCHJyQG4FLmOFwUcfRbir7L+Hh9uA7jySh_Q@mail.gmail.com>
From: Chunyan Liu <cyliu@suse.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH]xenstore-chmod: handle arbitrary number of
 perms rather than MAX_PERMS constant
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

2012/11/19 Ian Campbell <Ian.Campbell@citrix.com>:
> On Fri, 2012-11-16 at 06:02 +0000, Chunyan Liu wrote:
>> Constant MAX_PERMS 16 is too small to use in some occasions, e.g. if
>> there are more than 16 domU(s) on one hypervisor (it's easy to
>> achieve) and one wants to do xenstore-chmod PATH to all domU(s). So,
>> remove MAX_PERMS limitation and make it as arbitrary number of perms.
>>
>> Signed-off-by: Chunyan Liu <cyliu@suse.com>
>>
>> diff -r 8b93ac0c93f3 tools/xenstore/xenstore_client.c
>> --- a/tools/xenstore/xenstore_client.c  Tue Nov 13 11:19:17 2012 +0000
>> +++ b/tools/xenstore/xenstore_client.c  Thu Nov 15 16:33:32 2012 +0800
>> @@ -25,7 +25,6 @@
>>  #define PATH_SEP '/'
>>  #define MAX_PATH_LEN 256
>>
>> -#define MAX_PERMS 16
>>
>>  enum mode {
>>      MODE_unknown,
>> @@ -416,31 +415,31 @@ perform(enum mode mode, int optind, int
>>             break;
>>          }
>>          case MODE_chmod: {
>> -            struct xs_permissions perms[MAX_PERMS];
>> -            int nperms = 0;
>> +            struct xs_permissions *perms;
>>              /* save path pointer: */
>>              char *path = argv[optind++];
>> +            int nperms = argc - optind;
>> +            int i;
>> +            perms = (struct xs_permissions *)malloc(nperms *
>> sizeof(struct xs_permissions));
>
> You could just do:
>                 struct xs_permissions perms[nperms];
> and let the compiler allocate enough space on the stack.
Will update.

>> +            if (!perms)
>> +               err(1, NULL);
>> -            for (; argv[optind]; optind++, nperms++)
>> +            for (i = 0; argv[optind]; optind++, i++)
>>              {
>> -                if (MAX_PERMS <= nperms)
>> -                    errx(1, "Too many permissions specified.  "
>> -                        "Maximum per invocation is %d.", MAX_PERMS);
>> -
>> -                perms[nperms].id = atoi(argv[optind]+1);
>> +                perms[i].id = atoi(argv[optind]+1);
>>
>>                  switch (argv[optind][0])
>>                  {
>>                  case 'n':
>> -                    perms[nperms].perms = XS_PERM_NONE;
>> +                    perms[i].perms = XS_PERM_NONE;
>>                      break;
>>                  case 'r':
>> -                    perms[nperms].perms = XS_PERM_READ;
>> +                    perms[i].perms = XS_PERM_READ;
>>                      break;
>>                  case 'w':
>> -                    perms[nperms].perms = XS_PERM_WRITE;
>> +                    perms[i].perms = XS_PERM_WRITE;
>>                      break;
>>                  case 'b':
>> -                    perms[nperms].perms = XS_PERM_READ | XS_PERM_WRITE;
>> +                    perms[i].perms = XS_PERM_READ | XS_PERM_WRITE;
>>                      break;
>>                  default:
>>                      errx(1, "Invalid permission specification: '%c'",
>> @@ -449,6 +448,7 @@ perform(enum mode mode, int optind, int
>>              }
>>
>>              do_chmod(path, perms, nperms, upto, recurse, xsh, xth);
>> +            free(perms);
>>              break;
>>          }
>>          case MODE_watch: {
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>
>
>
> _______________________________________________>
>> +            if (!perms)
>> +               err(1, NULL);
>> -            for (; argv[optind]; optind++, nperms++)
>> +            for (i = 0; argv[optind]; optind++, i++)
>>              {
>> -                if (MAX_PERMS <= nperms)
>> -                    errx(1, "Too many permissions specified.  "
>> -                        "Maximum per invocation is %d.", MAX_PERMS);
>> -
>> -                perms[nperms].id = atoi(argv[optind]+1);
>> +                perms[i].id = atoi(argv[optind]+1);
>>
>>                  switch (argv[optind][0])
>>                  {
>>                  case 'n':
>> -                    perms[nperms].perms = XS_PERM_NONE;
>> +                    perms[i].perms = XS_PERM_NONE;
>>                      break;
>>                  case 'r':
>> -                    perms[nperms].perms = XS_PERM_READ;
>> +                    perms[i].perms = XS_PERM_READ;
>>                      break;
>>                  case 'w':
>> -                    perms[nperms].perms = XS_PERM_WRITE;
>> +                    perms[i].perms = XS_PERM_WRITE;
>>                      break;
>>                  case 'b':
>> -                    perms[nperms].perms = XS_PERM_READ | XS_PERM_WRITE;
>> +                    perms[i].perms = XS_PERM_READ | XS_PERM_WRITE;
>>                      break;
>>                  default:
>>                      errx(1, "Invalid permission specification: '%c'",
>> @@ -449,6 +448,7 @@ perform(enum mode mode, int optind, int
>>              }
>>
>>              do_chmod(path, perms, nperms, upto, recurse, xsh, xth);
>> +            free(perms);
>>              break;
>>          }
>>          case MODE_watch: {
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>


> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 02:59:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 02:59:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tae3h-0005iQ-VB; Tue, 20 Nov 2012 02:59:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kgrace.liu@gmail.com>) id 1Tae3f-0005iL-WB
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 02:59:32 +0000
Received: from [85.158.139.211:52456] by server-11.bemta-5.messagelabs.com id
	6A/32-03409-312FAA05; Tue, 20 Nov 2012 02:59:31 +0000
X-Env-Sender: kgrace.liu@gmail.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1353380369!20814026!1
X-Originating-IP: [209.85.219.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 981 invoked from network); 20 Nov 2012 02:59:30 -0000
Received: from mail-oa0-f43.google.com (HELO mail-oa0-f43.google.com)
	(209.85.219.43)
	by server-3.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 02:59:30 -0000
Received: by mail-oa0-f43.google.com with SMTP id k1so7299618oag.30
	for <xen-devel@lists.xensource.com>;
	Mon, 19 Nov 2012 18:59:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:content-type;
	bh=bKA7jvbJtRSzuWtqUgLJg4eU9nmAhycr9PYzXAjIjgY=;
	b=iCW3YKK7IRzdjlpP44QyGIKbAJTF4cTPFrnoR2pqoYlHdI6s30yBelouatl3ibMQvj
	c908vaKbc/3Ti9lXS4UVr0D4IgH+OcrX2GgfPv5Vq8JNbKwMeinMFN7eqYN6oItw0P3R
	05l1C8kkiI46mP3h0tZuHDooUkLgUtqdXCxRyMV3vbLyPJpUDEHHpvauYw7x2Fh87vy0
	iErbrkIT9dfyY31NlRtEAVw56lIE7QNQxuuEi9KLhxdC0NFZa3cfyywJ/Be6+rvlXqeQ
	jaCNaOWPVjoyEsgasS7F21CVGfD/hVy3ImAUHHTbGkzNGWEjNGECs9jSO/RJnpYl2MUA
	FA8g==
MIME-Version: 1.0
Received: by 10.60.170.114 with SMTP id al18mr12486445oec.56.1353380368810;
	Mon, 19 Nov 2012 18:59:28 -0800 (PST)
Received: by 10.60.21.163 with HTTP; Mon, 19 Nov 2012 18:59:28 -0800 (PST)
Date: Tue, 20 Nov 2012 10:59:28 +0800
X-Google-Sender-Auth: 77sbWg4Mdkdjk10UOOdPCNbnywk
Message-ID: <CAERYnoYP0x-iHzys9tGCzxVzneJ9GMm=wvZ-ENhLgWMCrCs-ag@mail.gmail.com>
From: Chunyan Liu <cyliu@suse.com>
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH V2]xenstore-chmod: handle arbitrary number of
 perms rather than MAX_PERMS constant
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Constant MAX_PERMS 16 is too small to use in some occasions, e.g. if
there are more than 16 domU(s) on one hypervisor (it's easy to
achieve) and one wants to do xenstore-chmod PATH to all domU(s). So,
remove MAX_PERMS limitation and make it as arbitrary number of perms.

Signed-off-by: Chunyan Liu <cyliu@suse.com>

Change to V1:
Follow Ian's comment, change 'perms' to be array instead of pointer.

diff -r 8b93ac0c93f3 tools/xenstore/xenstore_client.c
--- a/tools/xenstore/xenstore_client.c  Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/xenstore/xenstore_client.c  Tue Nov 20 10:35:33 2012 +0800
@@ -25,7 +25,6 @@
 #define PATH_SEP '/'
 #define MAX_PATH_LEN 256

-#define MAX_PERMS 16

 enum mode {
     MODE_unknown,
@@ -416,31 +415,28 @@ perform(enum mode mode, int optind, int
            break;
         }
         case MODE_chmod: {
-            struct xs_permissions perms[MAX_PERMS];
-            int nperms = 0;
             /* save path pointer: */
             char *path = argv[optind++];
+            int nperms = argc - optind;
+            struct xs_permissions perms[nperms];
+            int i;
-            for (; argv[optind]; optind++, nperms++)
+            for (i = 0; argv[optind]; optind++, i++)
             {
-                if (MAX_PERMS <= nperms)
-                    errx(1, "Too many permissions specified.  "
-                        "Maximum per invocation is %d.", MAX_PERMS);
-
-                perms[nperms].id = atoi(argv[optind]+1);
+                perms[i].id = atoi(argv[optind]+1);

                 switch (argv[optind][0])
                 {
                 case 'n':
-                    perms[nperms].perms = XS_PERM_NONE;
+                    perms[i].perms = XS_PERM_NONE;
                     break;
                 case 'r':
-                    perms[nperms].perms = XS_PERM_READ;
+                    perms[i].perms = XS_PERM_READ;
                     break;
                 case 'w':
-                    perms[nperms].perms = XS_PERM_WRITE;
+                    perms[i].perms = XS_PERM_WRITE;
                     break;
                 case 'b':
-                    perms[nperms].perms = XS_PERM_READ | XS_PERM_WRITE;
+                    perms[i].perms = XS_PERM_READ | XS_PERM_WRITE;
                     break;
                 default:
                     errx(1, "Invalid permission specification: '%c'",

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 02:59:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 02:59:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tae3h-0005iQ-VB; Tue, 20 Nov 2012 02:59:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kgrace.liu@gmail.com>) id 1Tae3f-0005iL-WB
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 02:59:32 +0000
Received: from [85.158.139.211:52456] by server-11.bemta-5.messagelabs.com id
	6A/32-03409-312FAA05; Tue, 20 Nov 2012 02:59:31 +0000
X-Env-Sender: kgrace.liu@gmail.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1353380369!20814026!1
X-Originating-IP: [209.85.219.43]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 981 invoked from network); 20 Nov 2012 02:59:30 -0000
Received: from mail-oa0-f43.google.com (HELO mail-oa0-f43.google.com)
	(209.85.219.43)
	by server-3.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 02:59:30 -0000
Received: by mail-oa0-f43.google.com with SMTP id k1so7299618oag.30
	for <xen-devel@lists.xensource.com>;
	Mon, 19 Nov 2012 18:59:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:content-type;
	bh=bKA7jvbJtRSzuWtqUgLJg4eU9nmAhycr9PYzXAjIjgY=;
	b=iCW3YKK7IRzdjlpP44QyGIKbAJTF4cTPFrnoR2pqoYlHdI6s30yBelouatl3ibMQvj
	c908vaKbc/3Ti9lXS4UVr0D4IgH+OcrX2GgfPv5Vq8JNbKwMeinMFN7eqYN6oItw0P3R
	05l1C8kkiI46mP3h0tZuHDooUkLgUtqdXCxRyMV3vbLyPJpUDEHHpvauYw7x2Fh87vy0
	iErbrkIT9dfyY31NlRtEAVw56lIE7QNQxuuEi9KLhxdC0NFZa3cfyywJ/Be6+rvlXqeQ
	jaCNaOWPVjoyEsgasS7F21CVGfD/hVy3ImAUHHTbGkzNGWEjNGECs9jSO/RJnpYl2MUA
	FA8g==
MIME-Version: 1.0
Received: by 10.60.170.114 with SMTP id al18mr12486445oec.56.1353380368810;
	Mon, 19 Nov 2012 18:59:28 -0800 (PST)
Received: by 10.60.21.163 with HTTP; Mon, 19 Nov 2012 18:59:28 -0800 (PST)
Date: Tue, 20 Nov 2012 10:59:28 +0800
X-Google-Sender-Auth: 77sbWg4Mdkdjk10UOOdPCNbnywk
Message-ID: <CAERYnoYP0x-iHzys9tGCzxVzneJ9GMm=wvZ-ENhLgWMCrCs-ag@mail.gmail.com>
From: Chunyan Liu <cyliu@suse.com>
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH V2]xenstore-chmod: handle arbitrary number of
 perms rather than MAX_PERMS constant
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Constant MAX_PERMS 16 is too small to use in some occasions, e.g. if
there are more than 16 domU(s) on one hypervisor (it's easy to
achieve) and one wants to do xenstore-chmod PATH to all domU(s). So,
remove MAX_PERMS limitation and make it as arbitrary number of perms.

Signed-off-by: Chunyan Liu <cyliu@suse.com>

Change to V1:
Follow Ian's comment, change 'perms' to be array instead of pointer.

diff -r 8b93ac0c93f3 tools/xenstore/xenstore_client.c
--- a/tools/xenstore/xenstore_client.c  Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/xenstore/xenstore_client.c  Tue Nov 20 10:35:33 2012 +0800
@@ -25,7 +25,6 @@
 #define PATH_SEP '/'
 #define MAX_PATH_LEN 256

-#define MAX_PERMS 16

 enum mode {
     MODE_unknown,
@@ -416,31 +415,28 @@ perform(enum mode mode, int optind, int
            break;
         }
         case MODE_chmod: {
-            struct xs_permissions perms[MAX_PERMS];
-            int nperms = 0;
             /* save path pointer: */
             char *path = argv[optind++];
+            int nperms = argc - optind;
+            struct xs_permissions perms[nperms];
+            int i;
-            for (; argv[optind]; optind++, nperms++)
+            for (i = 0; argv[optind]; optind++, i++)
             {
-                if (MAX_PERMS <= nperms)
-                    errx(1, "Too many permissions specified.  "
-                        "Maximum per invocation is %d.", MAX_PERMS);
-
-                perms[nperms].id = atoi(argv[optind]+1);
+                perms[i].id = atoi(argv[optind]+1);

                 switch (argv[optind][0])
                 {
                 case 'n':
-                    perms[nperms].perms = XS_PERM_NONE;
+                    perms[i].perms = XS_PERM_NONE;
                     break;
                 case 'r':
-                    perms[nperms].perms = XS_PERM_READ;
+                    perms[i].perms = XS_PERM_READ;
                     break;
                 case 'w':
-                    perms[nperms].perms = XS_PERM_WRITE;
+                    perms[i].perms = XS_PERM_WRITE;
                     break;
                 case 'b':
-                    perms[nperms].perms = XS_PERM_READ | XS_PERM_WRITE;
+                    perms[i].perms = XS_PERM_READ | XS_PERM_WRITE;
                     break;
                 default:
                     errx(1, "Invalid permission specification: '%c'",

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 03:36:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 03:36:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaedD-00067F-5I; Tue, 20 Nov 2012 03:36:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mattjd@gmail.com>) id 1TaedB-00067A-Di
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 03:36:13 +0000
Received: from [193.109.254.147:20420] by server-16.bemta-14.messagelabs.com
	id 91/A5-09215-CAAFAA05; Tue, 20 Nov 2012 03:36:12 +0000
X-Env-Sender: mattjd@gmail.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353382569!4581470!1
X-Originating-IP: [209.85.219.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4333 invoked from network); 20 Nov 2012 03:36:10 -0000
Received: from mail-oa0-f45.google.com (HELO mail-oa0-f45.google.com)
	(209.85.219.45)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 03:36:10 -0000
Received: by mail-oa0-f45.google.com with SMTP id i18so6555959oag.32
	for <xen-devel@lists.xen.org>; Mon, 19 Nov 2012 19:36:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=huHO7rfWihdIFQHlLjjBtsuTM5Kiv3wyCozCih620vA=;
	b=a0MQsKe1tWma6EzXbshuIrq0YADOD3kK5MXwWRHxyTJFD7haJTBy3pD/6VpbJdZ7hw
	Z6j6Nud4yHc+DFlQ1Q88/M3brCueFvBO5YmiQbCJu2tPtLViNY/3ZhtBCPywFqV0dcBG
	YiNxwzMJ8g67UvzVcOEoI5kB6klGWBr6NNvm1iVIkHR0a+5eKPSvBne05+PJyDTZhmn9
	+hHAfh8m03ReuTjbepVlCjDH6nfIXprDd4P6vHuhByyWuNh1hY5FbRNjah61IaEawmF1
	p9lWpUynuobzcucOwkbfpa6xI1vTs999aUvk+OLwbBVQkURvZGmtzlTDJQ9OpgtG06v0
	Bk6g==
MIME-Version: 1.0
Received: by 10.60.171.201 with SMTP id aw9mr12096933oec.126.1353382568910;
	Mon, 19 Nov 2012 19:36:08 -0800 (PST)
Received: by 10.76.171.130 with HTTP; Mon, 19 Nov 2012 19:36:08 -0800 (PST)
In-Reply-To: <eb3e7e6a-13f2-41a0-9a3e-e149de4040ac@default>
References: <eb3e7e6a-13f2-41a0-9a3e-e149de4040ac@default>
Date: Tue, 20 Nov 2012 16:36:08 +1300
Message-ID: <CA+nUz_JU_pY06T0GOM90rMieOTW_gj44DwAFTqn5cbW6prP2Pg@mail.gmail.com>
From: Matthew Daley <mattjd@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Jan Beulich <JBeulich@suse.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v5 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 20, 2012 at 10:27 AM, Dan Magenheimer
<dan.magenheimer@oracle.com> wrote:
> @@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct page_info *page)
>      ASSERT(page_get_owner(page) == dom_cow);
>      page_set_owner(page, d);
>
> -    if ( d->tot_pages++ == 0 )
> +    if ( domain_increase_tot_pages(d, 1) == 0 )

Here, the pre-incremented value of tot_pages is expected to be used in
the expression..

> @@ -1656,7 +1656,7 @@ gnttab_transfer(
>          }
>
>          /* Okay, add the page to 'e'. */
> -        if ( unlikely(e->tot_pages++ == 0) )
> +        if ( unlikely(domain_increase_tot_pages(e, 1) == 0) )

.. likewise ..

> +unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pages)
> +{
> +    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
> +
> +    ASSERT(spin_is_locked(&d->page_alloc_lock));
> +    if ( !d->unclaimed_pages )
> +        return d->tot_pages += pages;

.. but the post-incremented value is used instead.

> +    spin_lock(&heap_lock);
> +    dom_before = d->unclaimed_pages;
> +    dom_after = dom_before - pages;
> +    if ( (dom_before > 0) && (dom_after < 0) )
> +        dom_claimed = 0;
> +    else
> +        dom_claimed = dom_after;
> +    sys_before = total_unclaimed_pages;
> +    sys_after = sys_before - (dom_before - dom_claimed);
> +    BUG_ON( (sys_before > 0) && (sys_after < 0) );
> +    total_unclaimed_pages = sys_after;
> +    d->unclaimed_pages = dom_claimed;
> +    spin_unlock(&heap_lock);
> +    return d->tot_pages;
> +}

- Matthew Daley

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 03:36:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 03:36:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaedD-00067F-5I; Tue, 20 Nov 2012 03:36:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mattjd@gmail.com>) id 1TaedB-00067A-Di
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 03:36:13 +0000
Received: from [193.109.254.147:20420] by server-16.bemta-14.messagelabs.com
	id 91/A5-09215-CAAFAA05; Tue, 20 Nov 2012 03:36:12 +0000
X-Env-Sender: mattjd@gmail.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353382569!4581470!1
X-Originating-IP: [209.85.219.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4333 invoked from network); 20 Nov 2012 03:36:10 -0000
Received: from mail-oa0-f45.google.com (HELO mail-oa0-f45.google.com)
	(209.85.219.45)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 03:36:10 -0000
Received: by mail-oa0-f45.google.com with SMTP id i18so6555959oag.32
	for <xen-devel@lists.xen.org>; Mon, 19 Nov 2012 19:36:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=huHO7rfWihdIFQHlLjjBtsuTM5Kiv3wyCozCih620vA=;
	b=a0MQsKe1tWma6EzXbshuIrq0YADOD3kK5MXwWRHxyTJFD7haJTBy3pD/6VpbJdZ7hw
	Z6j6Nud4yHc+DFlQ1Q88/M3brCueFvBO5YmiQbCJu2tPtLViNY/3ZhtBCPywFqV0dcBG
	YiNxwzMJ8g67UvzVcOEoI5kB6klGWBr6NNvm1iVIkHR0a+5eKPSvBne05+PJyDTZhmn9
	+hHAfh8m03ReuTjbepVlCjDH6nfIXprDd4P6vHuhByyWuNh1hY5FbRNjah61IaEawmF1
	p9lWpUynuobzcucOwkbfpa6xI1vTs999aUvk+OLwbBVQkURvZGmtzlTDJQ9OpgtG06v0
	Bk6g==
MIME-Version: 1.0
Received: by 10.60.171.201 with SMTP id aw9mr12096933oec.126.1353382568910;
	Mon, 19 Nov 2012 19:36:08 -0800 (PST)
Received: by 10.76.171.130 with HTTP; Mon, 19 Nov 2012 19:36:08 -0800 (PST)
In-Reply-To: <eb3e7e6a-13f2-41a0-9a3e-e149de4040ac@default>
References: <eb3e7e6a-13f2-41a0-9a3e-e149de4040ac@default>
Date: Tue, 20 Nov 2012 16:36:08 +1300
Message-ID: <CA+nUz_JU_pY06T0GOM90rMieOTW_gj44DwAFTqn5cbW6prP2Pg@mail.gmail.com>
From: Matthew Daley <mattjd@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Jan Beulich <JBeulich@suse.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v5 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 20, 2012 at 10:27 AM, Dan Magenheimer
<dan.magenheimer@oracle.com> wrote:
> @@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct page_info *page)
>      ASSERT(page_get_owner(page) == dom_cow);
>      page_set_owner(page, d);
>
> -    if ( d->tot_pages++ == 0 )
> +    if ( domain_increase_tot_pages(d, 1) == 0 )

Here, the pre-incremented value of tot_pages is expected to be used in
the expression..

> @@ -1656,7 +1656,7 @@ gnttab_transfer(
>          }
>
>          /* Okay, add the page to 'e'. */
> -        if ( unlikely(e->tot_pages++ == 0) )
> +        if ( unlikely(domain_increase_tot_pages(e, 1) == 0) )

.. likewise ..

> +unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pages)
> +{
> +    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
> +
> +    ASSERT(spin_is_locked(&d->page_alloc_lock));
> +    if ( !d->unclaimed_pages )
> +        return d->tot_pages += pages;

.. but the post-incremented value is used instead.

> +    spin_lock(&heap_lock);
> +    dom_before = d->unclaimed_pages;
> +    dom_after = dom_before - pages;
> +    if ( (dom_before > 0) && (dom_after < 0) )
> +        dom_claimed = 0;
> +    else
> +        dom_claimed = dom_after;
> +    sys_before = total_unclaimed_pages;
> +    sys_after = sys_before - (dom_before - dom_claimed);
> +    BUG_ON( (sys_before > 0) && (sys_after < 0) );
> +    total_unclaimed_pages = sys_after;
> +    d->unclaimed_pages = dom_claimed;
> +    spin_unlock(&heap_lock);
> +    return d->tot_pages;
> +}

- Matthew Daley

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 06:25:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 06:25:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TahG3-0007RQ-UX; Tue, 20 Nov 2012 06:24:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TahG2-0007RL-Qg
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 06:24:31 +0000
Received: from [85.158.137.99:22512] by server-12.bemta-3.messagelabs.com id
	8A/3D-22757-8122BA05; Tue, 20 Nov 2012 06:24:24 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353392663!19684956!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzIzMzk4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25742 invoked from network); 20 Nov 2012 06:24:24 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-2.tower-217.messagelabs.com with SMTP;
	20 Nov 2012 06:24:24 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga101.jf.intel.com with ESMTP; 19 Nov 2012 22:24:22 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,282,1352102400"; d="scan'208";a="244683639"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by orsmga002.jf.intel.com with ESMTP; 19 Nov 2012 22:24:21 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Mon, 19 Nov 2012 22:24:14 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Tue, 20 Nov 2012 14:24:04 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Thread-Topic: [PATCH] passthrough/PCI: replace improper uses of
	pci_find_next_cap()
Thread-Index: AQHNw/xgacWqgHRi30CeIgw1OIeLnJfyRyDA
Date: Tue, 20 Nov 2012 06:24:04 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A4834564403389FFE@SHSMSX101.ccr.corp.intel.com>
References: <50A64A3E02000078000A93F0@nat28.tlf.novell.com>
In-Reply-To: <50A64A3E02000078000A93F0@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Zhang, Yang Z" <yang.z.zhang@intel.com>, Wei Huang <wei.huang2@amd.com>,
	Wei Wang <weiwang.dd@gmail.com>, "Zhang, Xiantao" <xiantao.zhang@intel.com>
Subject: Re: [Xen-devel] [PATCH] passthrough/PCI: replace improper uses of
 pci_find_next_cap()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Friday, November 16, 2012 9:14 PM
> To: xen-devel
> Cc: Wei Huang; Wei Wang; Zhang, Xiantao; Zhang, Yang Z
> Subject: [PATCH] passthrough/PCI: replace improper uses of
> pci_find_next_cap()
> 
> Using pci_find_next_cap() without prior pci_find_cap_offset() is bogus (and
> possibly wrong, given that the latter doesn't check the
> PCI_STATUS_CAP_LIST flag, which so far was checked in an open-coded way
> only for the non-bridge case).
> 
> Once at it, fold the two calls into one, as we need its result in any case.
> 
> Question is whether, without any caller left, pci_find_next_cap() should be
> purged as well.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -589,16 +589,13 @@ void pci_release_devices(struct domain *
> 
>  int pdev_type(u16 seg, u8 bus, u8 devfn)  {
> -    u16 class_device;
> -    u16 status, creg;
> -    int pos;
> +    u16 class_device, creg;
>      u8 d = PCI_SLOT(devfn), f = PCI_FUNC(devfn);
> +    int pos = pci_find_cap_offset(seg, bus, d, f, PCI_CAP_ID_EXP);
> 
>      class_device = pci_conf_read16(seg, bus, d, f, PCI_CLASS_DEVICE);
>      if ( class_device == PCI_CLASS_BRIDGE_PCI )
>      {
> -        pos = pci_find_next_cap(seg, bus, devfn,
> -                                PCI_CAPABILITY_LIST, PCI_CAP_ID_EXP);
>          if ( !pos )
>              return DEV_TYPE_LEGACY_PCI_BRIDGE;
>          creg = pci_conf_read16(seg, bus, d, f, pos + PCI_EXP_FLAGS); @@ -
> 606,15 +603,7 @@ int pdev_type(u16 seg, u8 bus, u8 devfn)
>              DEV_TYPE_PCIe2PCI_BRIDGE : DEV_TYPE_PCIe_BRIDGE;
>      }
> 
> -    status = pci_conf_read16(seg, bus, d, f, PCI_STATUS);
> -    if ( !(status & PCI_STATUS_CAP_LIST) )
> -        return DEV_TYPE_PCI;
> -
> -    if ( pci_find_next_cap(seg, bus, devfn, PCI_CAPABILITY_LIST,
> -                           PCI_CAP_ID_EXP) )
> -        return DEV_TYPE_PCIe_ENDPOINT;
> -
> -    return DEV_TYPE_PCI;
> +    return pos ? DEV_TYPE_PCIe_ENDPOINT : DEV_TYPE_PCI;
>  }
> 
>  /*
> 
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 06:25:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 06:25:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TahG3-0007RQ-UX; Tue, 20 Nov 2012 06:24:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TahG2-0007RL-Qg
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 06:24:31 +0000
Received: from [85.158.137.99:22512] by server-12.bemta-3.messagelabs.com id
	8A/3D-22757-8122BA05; Tue, 20 Nov 2012 06:24:24 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353392663!19684956!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzIzMzk4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25742 invoked from network); 20 Nov 2012 06:24:24 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-2.tower-217.messagelabs.com with SMTP;
	20 Nov 2012 06:24:24 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga101.jf.intel.com with ESMTP; 19 Nov 2012 22:24:22 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,282,1352102400"; d="scan'208";a="244683639"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by orsmga002.jf.intel.com with ESMTP; 19 Nov 2012 22:24:21 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Mon, 19 Nov 2012 22:24:14 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Tue, 20 Nov 2012 14:24:04 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Thread-Topic: [PATCH] passthrough/PCI: replace improper uses of
	pci_find_next_cap()
Thread-Index: AQHNw/xgacWqgHRi30CeIgw1OIeLnJfyRyDA
Date: Tue, 20 Nov 2012 06:24:04 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A4834564403389FFE@SHSMSX101.ccr.corp.intel.com>
References: <50A64A3E02000078000A93F0@nat28.tlf.novell.com>
In-Reply-To: <50A64A3E02000078000A93F0@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Zhang, Yang Z" <yang.z.zhang@intel.com>, Wei Huang <wei.huang2@amd.com>,
	Wei Wang <weiwang.dd@gmail.com>, "Zhang, Xiantao" <xiantao.zhang@intel.com>
Subject: Re: [Xen-devel] [PATCH] passthrough/PCI: replace improper uses of
 pci_find_next_cap()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Friday, November 16, 2012 9:14 PM
> To: xen-devel
> Cc: Wei Huang; Wei Wang; Zhang, Xiantao; Zhang, Yang Z
> Subject: [PATCH] passthrough/PCI: replace improper uses of
> pci_find_next_cap()
> 
> Using pci_find_next_cap() without prior pci_find_cap_offset() is bogus (and
> possibly wrong, given that the latter doesn't check the
> PCI_STATUS_CAP_LIST flag, which so far was checked in an open-coded way
> only for the non-bridge case).
> 
> Once at it, fold the two calls into one, as we need its result in any case.
> 
> Question is whether, without any caller left, pci_find_next_cap() should be
> purged as well.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -589,16 +589,13 @@ void pci_release_devices(struct domain *
> 
>  int pdev_type(u16 seg, u8 bus, u8 devfn)  {
> -    u16 class_device;
> -    u16 status, creg;
> -    int pos;
> +    u16 class_device, creg;
>      u8 d = PCI_SLOT(devfn), f = PCI_FUNC(devfn);
> +    int pos = pci_find_cap_offset(seg, bus, d, f, PCI_CAP_ID_EXP);
> 
>      class_device = pci_conf_read16(seg, bus, d, f, PCI_CLASS_DEVICE);
>      if ( class_device == PCI_CLASS_BRIDGE_PCI )
>      {
> -        pos = pci_find_next_cap(seg, bus, devfn,
> -                                PCI_CAPABILITY_LIST, PCI_CAP_ID_EXP);
>          if ( !pos )
>              return DEV_TYPE_LEGACY_PCI_BRIDGE;
>          creg = pci_conf_read16(seg, bus, d, f, pos + PCI_EXP_FLAGS); @@ -
> 606,15 +603,7 @@ int pdev_type(u16 seg, u8 bus, u8 devfn)
>              DEV_TYPE_PCIe2PCI_BRIDGE : DEV_TYPE_PCIe_BRIDGE;
>      }
> 
> -    status = pci_conf_read16(seg, bus, d, f, PCI_STATUS);
> -    if ( !(status & PCI_STATUS_CAP_LIST) )
> -        return DEV_TYPE_PCI;
> -
> -    if ( pci_find_next_cap(seg, bus, devfn, PCI_CAPABILITY_LIST,
> -                           PCI_CAP_ID_EXP) )
> -        return DEV_TYPE_PCIe_ENDPOINT;
> -
> -    return DEV_TYPE_PCI;
> +    return pos ? DEV_TYPE_PCIe_ENDPOINT : DEV_TYPE_PCI;
>  }
> 
>  /*
> 
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 06:54:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 06:54:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TahiD-0007vW-3R; Tue, 20 Nov 2012 06:53:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <juergen.gross@ts.fujitsu.com>) id 1TahiB-0007vP-Dn
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 06:53:35 +0000
Received: from [85.158.143.35:58609] by server-2.bemta-4.messagelabs.com id
	E3/CD-28922-EE82BA05; Tue, 20 Nov 2012 06:53:34 +0000
X-Env-Sender: juergen.gross@ts.fujitsu.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1353394413!13688666!1
X-Originating-IP: [80.70.172.51]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuNzAuMTcyLjUxID0+IDE4NzExOA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2548 invoked from network); 20 Nov 2012 06:53:34 -0000
Received: from dgate20.ts.fujitsu.com (HELO dgate20.ts.fujitsu.com)
	(80.70.172.51)
	by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 20 Nov 2012 06:53:34 -0000
DomainKey-Signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns;
	h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV:
	Received:Received:Message-ID:Date:From:Organization:
	User-Agent:MIME-Version:To:CC:Subject:References:
	In-Reply-To:Content-Type:Content-Transfer-Encoding;
	b=nKLhmCKjLW2np/K1+GzoTg1Z8tVZ5XWRYFjw9I4DRKivQsnI/h36e2p6
	0VgorF/iiA6orpTSLRCO0Spa3xZVcMP1LVjHhK4xW0RPb5LhCLsH3md5x
	M8K1a62iMBHy2zo28/b+J9Dm6Os3R5MfuscFrPkuMsc2f6d3/Fb6JkMQp
	b+wt11yHE8Ybe3cu1p33BgcD8RC7KHh1vjMnsLFHtnPROzD3Ejm/6DtHi
	6/hT9upVekbVVdgB0hoOi+f5m24VW;
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
	d=ts.fujitsu.com; i=@ts.fujitsu.com; q=dns/txt;
	s=s1536b; t=1353394414; x=1384930414;
	h=message-id:date:from:mime-version:to:cc:subject:
	references:in-reply-to:content-transfer-encoding;
	bh=6F66MSxkH3nJFAKo95TAC+k7mEJCLpDDgq10X5L563o=;
	b=kn4DszgmsQFi8rR33Fvn0xdQc+9n6PiFaPX3hbyt/JrL3YeI+M3dqBGI
	5sAoWXfc/ja1rT+X7UxwwxtwpFCfthHLaaOo6CFKLoGSJYJNE40VWZaQO
	g569TcMvLp/JtULT7QiDu8g5oZBItpuaVhjWcSPRrBLPwglGHgnaWNv/Q
	d2vinnDOPzlTxtT36gG/Oig9jrM8fbWoqyLRpws5JTh1z9uvwiEjwGRiW
	5RzBYv+ZhrAtTynLKCztvIap3JSKu;
X-SBRSScore: None
X-IronPort-AV: E=Sophos;i="4.83,282,1352070000"; 
	d="scan'208,217";a="109132914"
Received: from abgdgate40u.abg.fsc.net ([172.25.138.90])
	by dgate20u.abg.fsc.net with ESMTP; 20 Nov 2012 07:53:33 +0100
X-IronPort-AV: E=Sophos;i="4.83,282,1352070000"; 
	d="scan'208,217";a="150403558"
Received: from sanpedro.mch.fsc.net ([172.17.20.6])
	by abgdgate40u.abg.fsc.net with SMTP; 20 Nov 2012 07:53:33 +0100
Received: from [172.17.21.50] (verdon.osd.mch.fsc.net [172.17.21.50])
	by sanpedro.mch.fsc.net (Postfix) with ESMTP id 8B7F2969C08;
	Tue, 20 Nov 2012 07:53:33 +0100 (CET)
Message-ID: <50AB28ED.5040703@ts.fujitsu.com>
Date: Tue, 20 Nov 2012 07:53:33 +0100
From: Juergen Gross <juergen.gross@ts.fujitsu.com>
Organization: Fujitsu Technology Solutions GmbH
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20121027 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
References: <7c02a22ef82161c3930f.1352886775@nehalem1>
	<20646.24679.998078.183038@mariner.uk.xensource.com>
In-Reply-To: <20646.24679.998078.183038@mariner.uk.xensource.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH] Support user domain create extensions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Am 16.11.2012 16:48, schrieb Ian Jackson:
> Juergen Gross writes ("[Xen-devel] [PATCH] Support user domain create extensions"):
>> This patch supports arbitrary extensions to xl create by being able
>> to specify a script which is run at domain creation. The script is
>> specified in the xl config file and will be started at domain
>> creation with following parameters:
>>
>> <script>  restore|create<domid>  <path of config file>
>
> Thanks.  I think this is a reasonable idea.
> I wonder if this might be profitably moved down into libxl.

Okay, I'll try it.

>
> Also the interface needs work.  At the very least there needs to be a
> corresponding "destroy" script invocation.

Sounds reasonable.

>
>> To be able to use non-standard devices a new device class "NSTD" is defined.
>> The xl framework will remove all NSTD devices when destroying a domain.
>
> Did I miss the implementation of this ?

I haven't tested it myself. I thought libxl will cycle through all known
device classes in the xenstore modifying the backend state of the devices
connected to the domain. This should do the job. Have I missed something?

>
>> +const char *libxl_userdata_path(libxl_ctx *ctx, uint32_t domid,
>> +                                const char *userdata_userid,
>> +                                const char *wh)
>
> I don't think this is correct.  We shouldn't be exposing the userdata
> path like this.  But anyway if we are moving this into libxl then the
> config file won't be exposed to the script anyway.
>
> What does your script need the config file for ?  Writing a separate
> parser for it is clearly a mistake...

We want to be able to:
- specify parameters for our NSTD device per domain
- make sure a domain with a NSTD device is started in the correct cpupool
   (license restriction)

So we need a way to access domain configuration parameters. There are
some other ways to do this, using the config file was the most simple one.
I could think of following alternatives:

- add a new xl subcommand to get a configuration parameter of a domain, e.g.
   xl domain-par <domain> <parameter>

- specify parameters of interest in the xl config file. Those parameters will
   be made available to the script via shell variables. Something like:
   domain_create_script_pars="cpupool nstd_device"
   leading to shell variables XLPAR_cpupool and XLPAR_nstd_device to be set to
   the correct values when invoking the script.


Juergen

-- 
Juergen Gross                 Principal Developer Operating Systems
PBG PDG ES&S SWE OS6                   Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: juergen.gross@ts.fujitsu.com
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 06:54:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 06:54:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TahiD-0007vW-3R; Tue, 20 Nov 2012 06:53:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <juergen.gross@ts.fujitsu.com>) id 1TahiB-0007vP-Dn
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 06:53:35 +0000
Received: from [85.158.143.35:58609] by server-2.bemta-4.messagelabs.com id
	E3/CD-28922-EE82BA05; Tue, 20 Nov 2012 06:53:34 +0000
X-Env-Sender: juergen.gross@ts.fujitsu.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1353394413!13688666!1
X-Originating-IP: [80.70.172.51]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuNzAuMTcyLjUxID0+IDE4NzExOA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2548 invoked from network); 20 Nov 2012 06:53:34 -0000
Received: from dgate20.ts.fujitsu.com (HELO dgate20.ts.fujitsu.com)
	(80.70.172.51)
	by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 20 Nov 2012 06:53:34 -0000
DomainKey-Signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns;
	h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV:
	Received:Received:Message-ID:Date:From:Organization:
	User-Agent:MIME-Version:To:CC:Subject:References:
	In-Reply-To:Content-Type:Content-Transfer-Encoding;
	b=nKLhmCKjLW2np/K1+GzoTg1Z8tVZ5XWRYFjw9I4DRKivQsnI/h36e2p6
	0VgorF/iiA6orpTSLRCO0Spa3xZVcMP1LVjHhK4xW0RPb5LhCLsH3md5x
	M8K1a62iMBHy2zo28/b+J9Dm6Os3R5MfuscFrPkuMsc2f6d3/Fb6JkMQp
	b+wt11yHE8Ybe3cu1p33BgcD8RC7KHh1vjMnsLFHtnPROzD3Ejm/6DtHi
	6/hT9upVekbVVdgB0hoOi+f5m24VW;
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
	d=ts.fujitsu.com; i=@ts.fujitsu.com; q=dns/txt;
	s=s1536b; t=1353394414; x=1384930414;
	h=message-id:date:from:mime-version:to:cc:subject:
	references:in-reply-to:content-transfer-encoding;
	bh=6F66MSxkH3nJFAKo95TAC+k7mEJCLpDDgq10X5L563o=;
	b=kn4DszgmsQFi8rR33Fvn0xdQc+9n6PiFaPX3hbyt/JrL3YeI+M3dqBGI
	5sAoWXfc/ja1rT+X7UxwwxtwpFCfthHLaaOo6CFKLoGSJYJNE40VWZaQO
	g569TcMvLp/JtULT7QiDu8g5oZBItpuaVhjWcSPRrBLPwglGHgnaWNv/Q
	d2vinnDOPzlTxtT36gG/Oig9jrM8fbWoqyLRpws5JTh1z9uvwiEjwGRiW
	5RzBYv+ZhrAtTynLKCztvIap3JSKu;
X-SBRSScore: None
X-IronPort-AV: E=Sophos;i="4.83,282,1352070000"; 
	d="scan'208,217";a="109132914"
Received: from abgdgate40u.abg.fsc.net ([172.25.138.90])
	by dgate20u.abg.fsc.net with ESMTP; 20 Nov 2012 07:53:33 +0100
X-IronPort-AV: E=Sophos;i="4.83,282,1352070000"; 
	d="scan'208,217";a="150403558"
Received: from sanpedro.mch.fsc.net ([172.17.20.6])
	by abgdgate40u.abg.fsc.net with SMTP; 20 Nov 2012 07:53:33 +0100
Received: from [172.17.21.50] (verdon.osd.mch.fsc.net [172.17.21.50])
	by sanpedro.mch.fsc.net (Postfix) with ESMTP id 8B7F2969C08;
	Tue, 20 Nov 2012 07:53:33 +0100 (CET)
Message-ID: <50AB28ED.5040703@ts.fujitsu.com>
Date: Tue, 20 Nov 2012 07:53:33 +0100
From: Juergen Gross <juergen.gross@ts.fujitsu.com>
Organization: Fujitsu Technology Solutions GmbH
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20121027 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
References: <7c02a22ef82161c3930f.1352886775@nehalem1>
	<20646.24679.998078.183038@mariner.uk.xensource.com>
In-Reply-To: <20646.24679.998078.183038@mariner.uk.xensource.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH] Support user domain create extensions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Am 16.11.2012 16:48, schrieb Ian Jackson:
> Juergen Gross writes ("[Xen-devel] [PATCH] Support user domain create extensions"):
>> This patch supports arbitrary extensions to xl create by being able
>> to specify a script which is run at domain creation. The script is
>> specified in the xl config file and will be started at domain
>> creation with following parameters:
>>
>> <script>  restore|create<domid>  <path of config file>
>
> Thanks.  I think this is a reasonable idea.
> I wonder if this might be profitably moved down into libxl.

Okay, I'll try it.

>
> Also the interface needs work.  At the very least there needs to be a
> corresponding "destroy" script invocation.

Sounds reasonable.

>
>> To be able to use non-standard devices a new device class "NSTD" is defined.
>> The xl framework will remove all NSTD devices when destroying a domain.
>
> Did I miss the implementation of this ?

I haven't tested it myself. I thought libxl will cycle through all known
device classes in the xenstore modifying the backend state of the devices
connected to the domain. This should do the job. Have I missed something?

>
>> +const char *libxl_userdata_path(libxl_ctx *ctx, uint32_t domid,
>> +                                const char *userdata_userid,
>> +                                const char *wh)
>
> I don't think this is correct.  We shouldn't be exposing the userdata
> path like this.  But anyway if we are moving this into libxl then the
> config file won't be exposed to the script anyway.
>
> What does your script need the config file for ?  Writing a separate
> parser for it is clearly a mistake...

We want to be able to:
- specify parameters for our NSTD device per domain
- make sure a domain with a NSTD device is started in the correct cpupool
   (license restriction)

So we need a way to access domain configuration parameters. There are
some other ways to do this, using the config file was the most simple one.
I could think of following alternatives:

- add a new xl subcommand to get a configuration parameter of a domain, e.g.
   xl domain-par <domain> <parameter>

- specify parameters of interest in the xl config file. Those parameters will
   be made available to the script via shell variables. Something like:
   domain_create_script_pars="cpupool nstd_device"
   leading to shell variables XLPAR_cpupool and XLPAR_nstd_device to be set to
   the correct values when invoking the script.


Juergen

-- 
Juergen Gross                 Principal Developer Operating Systems
PBG PDG ES&S SWE OS6                   Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: juergen.gross@ts.fujitsu.com
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 07:20:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 07:20:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tai8C-00008X-Tp; Tue, 20 Nov 2012 07:20:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bjzhang@suse.com>) id 1Tai8B-00008S-CS
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 07:20:27 +0000
Received: from [85.158.143.35:40881] by server-3.bemta-4.messagelabs.com id
	7E/51-06841-A3F2BA05; Tue, 20 Nov 2012 07:20:26 +0000
X-Env-Sender: bjzhang@suse.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1353396024!14629295!1
X-Originating-IP: [137.65.248.124]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22112 invoked from network); 20 Nov 2012 07:20:25 -0000
Received: from inet-orm.provo.novell.com (HELO mail.novell.com)
	(137.65.248.124) by server-15.tower-21.messagelabs.com with SMTP;
	20 Nov 2012 07:20:25 -0000
Received: from linux-bjrd.bjz ([147.2.207.143])
	by mail.novell.com with ESMTP; Tue, 20 Nov 2012 00:20:20 -0700
MIME-Version: 1.0
X-Mercurial-Node: 0451e6041bdd88c90eeecc2a8cd88fa50931ce23
Message-Id: <0451e6041bdd88c90eee.1353395794@linux-bjrd.bjz>
User-Agent: Mercurial-patchbomb/2.1
Date: Tue, 20 Nov 2012 15:16:34 +0800
From: Bamvor Jian Zhang <bjzhang@suse.com>
To: xen-devel@lists.xen.org
Cc: jfehlig@suse.com, Ian.Jackson@eu.citrix.com, bjzhang@suse.com
Subject: [Xen-devel] [PATCH] fix race condition between libvirtd event
 handling and libxl fd deregister
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

the race condition may be encounted at the following senaro:
(1), xenlight will remove fd handle just after the transfer is done according to
the buffer pointer. This action will first mark fd handle deleted in libvirtd
then remove fd handler from list in libxl. To mark the fd deleted in libvirtd,
the libvirt event loop mutex must be acquired.

(2), meanwhile in the libvirt event dispatch process, libvirt will check the fd
deleted flag while holding the event loop mutex. At this time, "(1)" may be
blocked from marking the deleted flag. Then libvirt release its mutex temperary
to run the dispatcher callback. But this callback need xenlight lock(CTX_LOCK)
which is held by xenlight fd deregister function. So, libvirtd will continue to
run this callback after fd deregister exit which means xenlight has been marked
deleted flag, removed this fd handler and set ev->fd as -1. after
libxl__ev_fd_deregister exit, it is time for callback running. but
unfortunately, this callback has been removed as I mentioned above.

reference the following graph:
libvirt event dispatch                  xenlight transfer done
       |                              enter libxl__ev_fd_deregister
       |                                     CTX_LOCK
       |                                         |
       |                                         |
       |                              enter osevent_fd_deregister
       |                                         |
       |                              enter virEventRemoveHandle
       |                                waiting virMutexLock
check handler delete flag                        |
virMutexUnlock                                   |
       |                                    virMutexLock
enter libxl_osevent_occurred_fd                  |
waiting CTX_LOCK                          mark delete flag
       |                                   virMutexUnlock
       |                                         |
       |                                exit virEventRemoveHandle
       |                                exit osevent_fd_deregister
       |                                         |
       |                                remove fd handler from list
       |                                   set ev->fd as -1
       |                                     CTX_UNLOCK
   CTX_LOCK
assert(fd==ev->fd) //lead to crash
call back in libxl
   CTX_UNLOCK
exit libxl_osevent_occurred_fd

at the same time, i found the times of file handler register is less than the times of file handler deregister. is that right? seems that it will be better if the register and deregister is paired.

Signed-off-by: Bamvor Jian Zhang <bjzhang@suse.com>

diff -r 321f8487379b -r 0451e6041bdd tools/libxl/libxl_event.c
--- a/tools/libxl/libxl_event.c	Thu Nov 15 10:25:29 2012 +0000
+++ b/tools/libxl/libxl_event.c	Tue Nov 20 14:56:04 2012 +0800
@@ -1018,11 +1018,15 @@ void libxl_osevent_occurred_fd(libxl_ctx
     CTX_LOCK;
     assert(!CTX->osevent_in_hook);
 
+    if (!libxl__ev_fd_isregistered(ev)) {
+        DBG("ev_fd=%p deregister unregistered",ev);
+        goto out;
+    }
     assert(fd == ev->fd);
     revents &= ev->events;
     if (revents)
         ev->func(egc, ev, fd, ev->events, revents);
-
+out:
     CTX_UNLOCK;
     EGC_FREE;
 }

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 07:20:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 07:20:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tai8C-00008X-Tp; Tue, 20 Nov 2012 07:20:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bjzhang@suse.com>) id 1Tai8B-00008S-CS
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 07:20:27 +0000
Received: from [85.158.143.35:40881] by server-3.bemta-4.messagelabs.com id
	7E/51-06841-A3F2BA05; Tue, 20 Nov 2012 07:20:26 +0000
X-Env-Sender: bjzhang@suse.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1353396024!14629295!1
X-Originating-IP: [137.65.248.124]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22112 invoked from network); 20 Nov 2012 07:20:25 -0000
Received: from inet-orm.provo.novell.com (HELO mail.novell.com)
	(137.65.248.124) by server-15.tower-21.messagelabs.com with SMTP;
	20 Nov 2012 07:20:25 -0000
Received: from linux-bjrd.bjz ([147.2.207.143])
	by mail.novell.com with ESMTP; Tue, 20 Nov 2012 00:20:20 -0700
MIME-Version: 1.0
X-Mercurial-Node: 0451e6041bdd88c90eeecc2a8cd88fa50931ce23
Message-Id: <0451e6041bdd88c90eee.1353395794@linux-bjrd.bjz>
User-Agent: Mercurial-patchbomb/2.1
Date: Tue, 20 Nov 2012 15:16:34 +0800
From: Bamvor Jian Zhang <bjzhang@suse.com>
To: xen-devel@lists.xen.org
Cc: jfehlig@suse.com, Ian.Jackson@eu.citrix.com, bjzhang@suse.com
Subject: [Xen-devel] [PATCH] fix race condition between libvirtd event
 handling and libxl fd deregister
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

the race condition may be encounted at the following senaro:
(1), xenlight will remove fd handle just after the transfer is done according to
the buffer pointer. This action will first mark fd handle deleted in libvirtd
then remove fd handler from list in libxl. To mark the fd deleted in libvirtd,
the libvirt event loop mutex must be acquired.

(2), meanwhile in the libvirt event dispatch process, libvirt will check the fd
deleted flag while holding the event loop mutex. At this time, "(1)" may be
blocked from marking the deleted flag. Then libvirt release its mutex temperary
to run the dispatcher callback. But this callback need xenlight lock(CTX_LOCK)
which is held by xenlight fd deregister function. So, libvirtd will continue to
run this callback after fd deregister exit which means xenlight has been marked
deleted flag, removed this fd handler and set ev->fd as -1. after
libxl__ev_fd_deregister exit, it is time for callback running. but
unfortunately, this callback has been removed as I mentioned above.

reference the following graph:
libvirt event dispatch                  xenlight transfer done
       |                              enter libxl__ev_fd_deregister
       |                                     CTX_LOCK
       |                                         |
       |                                         |
       |                              enter osevent_fd_deregister
       |                                         |
       |                              enter virEventRemoveHandle
       |                                waiting virMutexLock
check handler delete flag                        |
virMutexUnlock                                   |
       |                                    virMutexLock
enter libxl_osevent_occurred_fd                  |
waiting CTX_LOCK                          mark delete flag
       |                                   virMutexUnlock
       |                                         |
       |                                exit virEventRemoveHandle
       |                                exit osevent_fd_deregister
       |                                         |
       |                                remove fd handler from list
       |                                   set ev->fd as -1
       |                                     CTX_UNLOCK
   CTX_LOCK
assert(fd==ev->fd) //lead to crash
call back in libxl
   CTX_UNLOCK
exit libxl_osevent_occurred_fd

at the same time, i found the times of file handler register is less than the times of file handler deregister. is that right? seems that it will be better if the register and deregister is paired.

Signed-off-by: Bamvor Jian Zhang <bjzhang@suse.com>

diff -r 321f8487379b -r 0451e6041bdd tools/libxl/libxl_event.c
--- a/tools/libxl/libxl_event.c	Thu Nov 15 10:25:29 2012 +0000
+++ b/tools/libxl/libxl_event.c	Tue Nov 20 14:56:04 2012 +0800
@@ -1018,11 +1018,15 @@ void libxl_osevent_occurred_fd(libxl_ctx
     CTX_LOCK;
     assert(!CTX->osevent_in_hook);
 
+    if (!libxl__ev_fd_isregistered(ev)) {
+        DBG("ev_fd=%p deregister unregistered",ev);
+        goto out;
+    }
     assert(fd == ev->fd);
     revents &= ev->events;
     if (revents)
         ev->func(egc, ev, fd, ev->events, revents);
-
+out:
     CTX_UNLOCK;
     EGC_FREE;
 }

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 08:06:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 08:06:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taiqj-0000zy-FK; Tue, 20 Nov 2012 08:06:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Taiqh-0000zt-VK
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 08:06:28 +0000
Received: from [85.158.139.83:18469] by server-9.bemta-5.messagelabs.com id
	5B/E9-29295-30A3BA05; Tue, 20 Nov 2012 08:06:27 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353398786!19780435!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24687 invoked from network); 20 Nov 2012 08:06:26 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-182.messagelabs.com with SMTP;
	20 Nov 2012 08:06:26 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 08:06:26 +0000
Message-Id: <50AB484702000078000A9E04@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 08:07:19 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: tim@xen.org, keir@xen.org, ian.campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH RFC 0/5] XSM hook renames and cleanup
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 19.11.12 at 22:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> These patches clean up some of the XSM code that caused difficulty with
> ctags, and changes hook names to show the default action of the hook.
> They apply on top of my XSM patch series v5, and if they help increase
> readability, will be integrated into the next version of that series.

Only this and patch 4 appear to have made it to the list.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 08:06:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 08:06:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taiqj-0000zy-FK; Tue, 20 Nov 2012 08:06:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Taiqh-0000zt-VK
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 08:06:28 +0000
Received: from [85.158.139.83:18469] by server-9.bemta-5.messagelabs.com id
	5B/E9-29295-30A3BA05; Tue, 20 Nov 2012 08:06:27 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353398786!19780435!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24687 invoked from network); 20 Nov 2012 08:06:26 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-182.messagelabs.com with SMTP;
	20 Nov 2012 08:06:26 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 08:06:26 +0000
Message-Id: <50AB484702000078000A9E04@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 08:07:19 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: tim@xen.org, keir@xen.org, ian.campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH RFC 0/5] XSM hook renames and cleanup
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 19.11.12 at 22:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> These patches clean up some of the XSM code that caused difficulty with
> ctags, and changes hook names to show the default action of the hook.
> They apply on top of my XSM patch series v5, and if they help increase
> readability, will be integrated into the next version of that series.

Only this and patch 4 appear to have made it to the list.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 08:16:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 08:16:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taj00-0001A3-J8; Tue, 20 Nov 2012 08:16:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Taizz-00019y-Br
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 08:16:03 +0000
Received: from [85.158.138.51:50041] by server-6.bemta-3.messagelabs.com id
	61/08-28265-24C3BA05; Tue, 20 Nov 2012 08:16:02 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1353399361!26669818!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25107 invoked from network); 20 Nov 2012 08:16:01 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-174.messagelabs.com with SMTP;
	20 Nov 2012 08:16:01 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 08:16:01 +0000
Message-Id: <50AB4A8602000078000A9E10@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 08:16:54 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
	<1353062895.3499.205.camel@zakaz.uk.xensource.com>
	<ea33a942-7e63-4339-85c6-35935ae5119b@default>
In-Reply-To: <ea33a942-7e63-4339-85c6-35935ae5119b@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	KonradWilk <konrad.wilk@oracle.com>, "Tim\(Xen.org\)" <tim@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 19.11.12 at 21:53, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
>> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of 
> existing) hypercall
> 
> Hi Ian --
> 
>> On Thu, 2012-11-15 at 19:15 +0000, Dan Magenheimer wrote:
>> > > From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
>> > > Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of 
> existing) hypercall
>> > >
>> > > On Wed, 2012-11-14 at 23:55 +0000, Dan Magenheimer wrote:
>> > >
>> > > How does this interact with the feature which lets you create PV guests
>> > > using only superpages? I believe is something Oracle added and still
>> > > maintains (Dave added to the CC).
>> > >
>> > > Also doesn't this fail to make any sort of guarantee if you are building
>> > > a 32 bit PV guest, since they require memory under a certain host
>> > > address limit (160GB IIRC)?
>> > >
>> > > Basically neither of those cases benefit from this hypercall at all? I
>> > > don't know what the usecase for the superpage PV guests is (but I
>> > > suppose it is important to Oracle, at least). The 32 bit PV guest use
>> > > case is still a pretty significant one which I think ought to be
>> > > handled, otherwise any system built on top of this functionality will
>> > > only work reliably in a subset of cases.
>> >
>> > The claim mechanism will not benefit PV superpages.  IIUC, the
>> > design of the PV superpages will cause a domain launch to fail
>> > if it requests 10000 superpages but Xen can only successfully
>> > allocate 9999.  That's already very fragile.  Since the only
>> > way currently to find out if there are 10000 superpages available
>> > is to start allocating them, claim can't really help.
>> 
>> Well, you could always account the number of free superpages in the
>> system, which would allow you to cover this case too.
> 
> Because of the nature of the buddy allocator (i.e. 4MB chunks are
> kept separately from 2MB chunks even though a 4MB page contains
> two 2MB pages), I don't think this is trivial.

This ought to be as simple as adding respective accounting
when
- splitting a chunk in alloc_heap_pages(), crossing the super page
  size boundary, and
- merging chunks in free_heap_pages(), crossing the super page
  size boundary.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 08:16:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 08:16:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taj00-0001A3-J8; Tue, 20 Nov 2012 08:16:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Taizz-00019y-Br
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 08:16:03 +0000
Received: from [85.158.138.51:50041] by server-6.bemta-3.messagelabs.com id
	61/08-28265-24C3BA05; Tue, 20 Nov 2012 08:16:02 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1353399361!26669818!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25107 invoked from network); 20 Nov 2012 08:16:01 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-174.messagelabs.com with SMTP;
	20 Nov 2012 08:16:01 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 08:16:01 +0000
Message-Id: <50AB4A8602000078000A9E10@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 08:16:54 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
	<1353062895.3499.205.camel@zakaz.uk.xensource.com>
	<ea33a942-7e63-4339-85c6-35935ae5119b@default>
In-Reply-To: <ea33a942-7e63-4339-85c6-35935ae5119b@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	KonradWilk <konrad.wilk@oracle.com>, "Tim\(Xen.org\)" <tim@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 19.11.12 at 21:53, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
>> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of 
> existing) hypercall
> 
> Hi Ian --
> 
>> On Thu, 2012-11-15 at 19:15 +0000, Dan Magenheimer wrote:
>> > > From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
>> > > Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of 
> existing) hypercall
>> > >
>> > > On Wed, 2012-11-14 at 23:55 +0000, Dan Magenheimer wrote:
>> > >
>> > > How does this interact with the feature which lets you create PV guests
>> > > using only superpages? I believe is something Oracle added and still
>> > > maintains (Dave added to the CC).
>> > >
>> > > Also doesn't this fail to make any sort of guarantee if you are building
>> > > a 32 bit PV guest, since they require memory under a certain host
>> > > address limit (160GB IIRC)?
>> > >
>> > > Basically neither of those cases benefit from this hypercall at all? I
>> > > don't know what the usecase for the superpage PV guests is (but I
>> > > suppose it is important to Oracle, at least). The 32 bit PV guest use
>> > > case is still a pretty significant one which I think ought to be
>> > > handled, otherwise any system built on top of this functionality will
>> > > only work reliably in a subset of cases.
>> >
>> > The claim mechanism will not benefit PV superpages.  IIUC, the
>> > design of the PV superpages will cause a domain launch to fail
>> > if it requests 10000 superpages but Xen can only successfully
>> > allocate 9999.  That's already very fragile.  Since the only
>> > way currently to find out if there are 10000 superpages available
>> > is to start allocating them, claim can't really help.
>> 
>> Well, you could always account the number of free superpages in the
>> system, which would allow you to cover this case too.
> 
> Because of the nature of the buddy allocator (i.e. 4MB chunks are
> kept separately from 2MB chunks even though a 4MB page contains
> two 2MB pages), I don't think this is trivial.

This ought to be as simple as adding respective accounting
when
- splitting a chunk in alloc_heap_pages(), crossing the super page
  size boundary, and
- merging chunks in free_heap_pages(), crossing the super page
  size boundary.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 08:22:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 08:22:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taj5q-0001Im-Gl; Tue, 20 Nov 2012 08:22:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jg1.han@samsung.com>) id 1Tad6z-0004uk-0X
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 01:58:53 +0000
Received: from [85.158.143.35:35240] by server-1.bemta-4.messagelabs.com id
	06/65-27934-CD3EAA05; Tue, 20 Nov 2012 01:58:52 +0000
X-Env-Sender: jg1.han@samsung.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1353376728!11297860!1
X-Originating-IP: [203.254.224.34]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjAzLjI1NC4yMjQuMzQgPT4gMzM0MzQ5\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17490 invoked from network); 20 Nov 2012 01:58:50 -0000
Received: from mailout4.samsung.com (HELO mailout4.samsung.com)
	(203.254.224.34) by server-11.tower-21.messagelabs.com with SMTP;
	20 Nov 2012 01:58:50 -0000
Received: from epcpsbge6.samsung.com (epcpsbge6 [203.254.230.16])
	by mailout4.samsung.com
	(Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit
	(built Nov
	17 2011)) with ESMTP id <0MDR00JBGK5ARQA0@mailout4.samsung.com> for
	xen-devel@lists.xensource.com; Tue, 20 Nov 2012 10:58:22 +0900 (KST)
Received: from epcpsbge6.samsung.com ( [203.254.230.48])
	by epcpsbge6.samsung.com (EPCPMTA) with SMTP id DA.1D.23515.DB3EAA05;
	Tue, 20 Nov 2012 10:58:21 +0900 (KST)
X-AuditID: cbfee610-b7fd06d000005bdb-c6-50aae3bd0b25
Received: from epmailer06 ( [203.254.219.146])
	by epcpsbge6.samsung.com (EPCPMTA) with SMTP id 48.1D.23515.DB3EAA05;
	Tue, 20 Nov 2012 10:58:21 +0900 (KST)
Date: Tue, 20 Nov 2012 01:58:21 +0000 (GMT)
From: Jingoo Han <jg1.han@samsung.com>
To: Bill Pemberton <wfp5p@virginia.edu>
MIME-version: 1.0
X-MTR: 20121120015616194@jg1.han
Msgkey: 20121120015616194@jg1.han
X-EPLocale: en_US.euc-kr
X-Priority: 3
X-EPWebmail-Msg-Type: personal
X-EPWebmail-Reply-Demand: 0
X-EPApproval-Locale: 
X-EPHeader: ML
X-EPTrCode: 
X-EPTrName: 
X-MLAttribute: 
X-RootMTR: 20121120015616194@jg1.han
X-ParentMTR: 
X-Mobile: True,C10
X-ArchiveUser: EV
X-CPGSPASS: Y
MIME-version: 1.0
Message-id: <18550095.678601353376700883.JavaMail.weblogic@epml04>
DLP-Filter: Pass
X-Brightmail-Tracker: H4sIAAAAAAAAA5WTfUwTZxzH89y1d9VYdiLKA4uuHrpFDLWUlj5O2fzL3P6S6V4S3YCznLyM
	XtmVIphMO8pmCkxBivKy6QwNL10HE5zT8Srb6BgwlkA6IoJrKmNzTGuGdgsRV7iS9M/tv+99
	8v3+7vu75x4ZHnlTFivL4Qs4gWfzaGKtZHjpV1VCj8+Zqv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/HfEUUBvQNWrbxWBZ63
	r3uxr4u2r4te7/kCCBwghivQFvA5uVy6jGcNfKExV6Y1GdrB6uXco66AZivqA5QI0FHiyWyH
	WiJkD/DFhj4ARTgdLS45GEBiHVv8CWc2acyF+RzfB3YHvvIkHh+jNQXu0GjRKJTK1PTUNJUc
	yTNU/4PpODFZdEYtoXJZC/cxxxVw5rV0mCgi3gryOi1FDQd3Rm34FP6TM/vSvl2xT+4l6lXX
	j1BfPohdtrbxXbeTi0f6vj0XueD2GA4xO9/jumLUc9imtxqZ/XFqjTuqd+9Ytn8qS9stsdqj
	2/W2hITsFx7KI95WtTETk5fjLu3Bc47uf4resVcUv3w46ViFpGfCvOfvrYnDOPNOp44W8HpW
	kYSbefZfuZYSV2YEAAA=
X-CFilter-Loop: Reflected
X-Mailman-Approved-At: Tue, 20 Nov 2012 08:22:05 +0000
Cc: "linux-fbdev@vger.kernel.org" <linux-fbdev@vger.kernel.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	Michal Januszewski <spock@gentoo.org>, Paul Mackerras <paulus@samba.org>,
	"linux-nvidia@lists.surfsouth.com" <linux-nvidia@lists.surfsouth.com>,
	Daniel Walker <dwalker@fifo99.com>, Kukjin Kim <kgene.kim@samsung.com>,
	Russell King <linux@arm.linux.org.uk>, Wan ZongShun <mcuos.com@gmail.com>,
	Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
	Jingoo Han <jg1.han@samsung.com>, Tomi Valkeinen <tomi.valkeinen@ti.com>,
	David Brown <davidb@codeaurora.org>, Jaya Kumar <jayalk@intworks.biz>,
	"cbe-oss-dev@lists.ozlabs.org" <cbe-oss-dev@lists.ozlabs.org>,
	Antonino Daplas <adaplas@gmail.com>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	Thomas Winischhofer <thomas@winischhofer.net>,
	"linux-geode@lists.infradead.org" <linux-geode@lists.infradead.org>,
	"linux-samsung-soc@vger.kernel.org" <linux-samsung-soc@vger.kernel.org>,
	Ben Dooks <ben-linux@fluff.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Maik Broemme <mbroemme@plusserver.de>, Geoff Levand <geoff@infradead.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	Ferenc Bakonyi <fero@drama.obuda.kando.hu>,
	Tony Prisk <linux@prisktech.co.nz>, Bryan Huntsman <bryanh@codeaurora.org>,
	Kristoffer Ericson <kristoffer.ericson@gmail.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 158/493] video: remove use of __devinit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: jg1.han@samsung.com
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tuesday, November 20, 2012 3:22 AM, Bill Pemberton wrote
> 
> CONFIG_HOTPLUG is going away as an option so __devinit is no longer
> needed.
> 
> Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
> Cc: Jaya Kumar <jayalk@intworks.biz>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Jingoo Han <jg1.han@samsung.com>
> Cc: Ferenc Bakonyi <fero@drama.obuda.kando.hu>
> Cc: Antonino Daplas <adaplas@gmail.com>
> Cc: Maik Broemme <mbroemme@plusserver.de>
> Cc: David Brown <davidb@codeaurora.org>
> Cc: Daniel Walker <dwalker@fifo99.com>
> Cc: Bryan Huntsman <bryanh@codeaurora.org>
> Cc: Wan ZongShun <mcuos.com@gmail.com>
> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: Geoff Levand <geoff@infradead.org>
> Cc: Kristoffer Ericson <kristoffer.ericson@gmail.com>
> Cc: Ben Dooks <ben-linux@fluff.org>
> Cc: Kukjin Kim <kgene.kim@samsung.com>
> Cc: Thomas Winischhofer <thomas@winischhofer.net>
> Cc: Michal Januszewski <spock@gentoo.org>
> Cc: Tony Prisk <linux@prisktech.co.nz>
> Cc: linux-fbdev@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-geode@lists.infradead.org
> Cc: linux-nvidia@lists.surfsouth.com
> Cc: linux-arm-msm@vger.kernel.org
> Cc: linux-omap@vger.kernel.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: cbe-oss-dev@lists.ozlabs.org
> Cc: linux-samsung-soc@vger.kernel.org
> Cc: xen-devel@lists.xensource.com
> Cc: virtualization@lists.linux-foundation.org
> ---
>  drivers/video/acornfb.c                            | 14 ++--
>  drivers/video/arcfb.c                              |  2 +-
>  drivers/video/arkfb.c                              |  2 +-
>  drivers/video/asiliantfb.c                         |  6 +-
>  drivers/video/aty/aty128fb.c                       | 22 +++---
>  drivers/video/aty/atyfb_base.c                     | 22 +++---
>  drivers/video/aty/mach64_ct.c                      |  4 +-
>  drivers/video/aty/mach64_cursor.c                  |  2 +-
>  drivers/video/aty/radeon_base.c                    | 14 ++--
>  drivers/video/aty/radeon_monitor.c                 | 16 ++---
>  drivers/video/au1100fb.c                           |  2 +-
>  drivers/video/au1200fb.c                           |  2 +-
>  drivers/video/auo_k1900fb.c                        |  2 +-
>  drivers/video/auo_k1901fb.c                        |  2 +-
>  drivers/video/auo_k190x.c                          |  2 +-
>  drivers/video/bf537-lq035.c                        |  6 +-
>  drivers/video/bf54x-lq043fb.c                      |  2 +-
>  drivers/video/bfin-lq035q1-fb.c                    |  6 +-
>  drivers/video/bfin-t350mcqb-fb.c                   |  2 +-
>  drivers/video/bfin_adv7393fb.c                     |  2 +-
>  drivers/video/broadsheetfb.c                       |  8 +--
>  drivers/video/bw2.c                                |  6 +-
>  drivers/video/carminefb.c                          |  4 +-
>  drivers/video/cg14.c                               |  4 +-
>  drivers/video/cg3.c                                |  8 +--
>  drivers/video/cg6.c                                |  8 +--
>  drivers/video/chipsfb.c                            |  4 +-
>  drivers/video/cirrusfb.c                           | 10 +--
>  drivers/video/cobalt_lcdfb.c                       |  2 +-
>  drivers/video/console/sticore.c                    | 47 ++++++-------
>  drivers/video/cyber2000fb.c                        | 12 ++--
>  drivers/video/da8xx-fb.c                           |  2 +-
>  drivers/video/dnfb.c                               |  2 +-
>  drivers/video/ep93xx-fb.c                          |  4 +-
>  drivers/video/exynos/exynos_dp_core.c              |  2 +-
>  drivers/video/ffb.c                                |  2 +-
>  drivers/video/fm2fb.c                              |  4 +-
>  drivers/video/fsl-diu-fb.c                         |  4 +-
>  drivers/video/gbefb.c                              |  4 +-
>  drivers/video/geode/gx1fb_core.c                   |  6 +-
>  drivers/video/geode/gxfb_core.c                    | 10 +--
>  drivers/video/geode/lxfb_core.c                    | 10 +--
>  drivers/video/grvga.c                              |  4 +-
>  drivers/video/gxt4500.c                            |  4 +-
>  drivers/video/hecubafb.c                           |  2 +-
>  drivers/video/hgafb.c                              |  4 +-
>  drivers/video/hitfb.c                              |  2 +-
>  drivers/video/hpfb.c                               |  4 +-
>  drivers/video/i740fb.c                             |  4 +-
>  drivers/video/i810/i810_main.c                     | 26 +++----
>  drivers/video/i810/i810_main.h                     |  2 +-
>  drivers/video/imsttfb.c                            |  4 +-
>  drivers/video/intelfb/intelfbdrv.c                 | 16 ++---
>  drivers/video/jz4740_fb.c                          |  2 +-
>  drivers/video/kyro/fbdev.c                         |  2 +-
>  drivers/video/leo.c                                |  2 +-
>  drivers/video/mb862xx/mb862xxfbdrv.c               |  6 +-
>  drivers/video/mbx/mbxdebugfs.c                     |  2 +-
>  drivers/video/mbx/mbxfb.c                          | 10 +--
>  drivers/video/metronomefb.c                        | 12 ++--
>  drivers/video/msm/mddi.c                           |  6 +-
>  drivers/video/mxsfb.c                              |  6 +-
>  drivers/video/neofb.c                              | 12 ++--
>  drivers/video/nuc900fb.c                           |  4 +-
>  drivers/video/nvidia/nvidia.c                      | 12 ++--
>  .../omap2/displays/panel-lgphilips-lb035q02.c      |  2 +-
>  drivers/video/p9100.c                              |  2 +-
>  drivers/video/platinumfb.c                         |  6 +-
>  drivers/video/pm2fb.c                              |  2 +-
>  drivers/video/pm3fb.c                              |  4 +-
>  drivers/video/pmag-ba-fb.c                         |  2 +-
>  drivers/video/pmagb-b-fb.c                         |  6 +-
>  drivers/video/ps3fb.c                              |  2 +-
>  drivers/video/pvr2fb.c                             |  6 +-
>  drivers/video/pxa168fb.c                           |  4 +-
>  drivers/video/pxa3xx-gcu.c                         |  2 +-
>  drivers/video/pxafb.c                              | 20 +++---
>  drivers/video/q40fb.c                              |  2 +-
>  drivers/video/riva/fbdev.c                         | 20 +++---
>  drivers/video/riva/rivafb-i2c.c                    |  6 +-
>  drivers/video/s1d13xxxfb.c                         |  4 +-
>  drivers/video/s3c-fb.c                             |  6 +-
>  drivers/video/s3c2410fb.c                          |  8 +--
>  drivers/video/s3fb.c                               |  6 +-
>  drivers/video/sa1100fb.c                           |  6 +-
>  drivers/video/savage/savagefb_driver.c             |  8 +--
>  drivers/video/sgivwfb.c                            |  2 +-
>  drivers/video/sh7760fb.c                           |  2 +-
>  drivers/video/sh_mobile_lcdcfb.c                   | 16 ++---
>  drivers/video/sh_mobile_meram.c                    |  2 +-
>  drivers/video/sis/sis_main.c                       | 82 +++++++++++-----------
>  drivers/video/skeletonfb.c                         |  2 +-
>  drivers/video/sm501fb.c                            |  8 +--
>  drivers/video/sstfb.c                              | 18 ++---
>  drivers/video/sunxvr1000.c                         |  6 +-
>  drivers/video/sunxvr2500.c                         |  6 +-
>  drivers/video/sunxvr500.c                          |  6 +-
>  drivers/video/tcx.c                                |  2 +-
>  drivers/video/tdfxfb.c                             | 10 +--
>  drivers/video/tgafb.c                              | 16 ++---
>  drivers/video/tmiofb.c                             |  2 +-
>  drivers/video/tridentfb.c                          |  8 +--
>  drivers/video/uvesafb.c                            | 30 ++++----
>  drivers/video/vermilion/vermilion.c                |  2 +-
>  drivers/video/vfb.c                                |  2 +-
>  drivers/video/vga16fb.c                            |  2 +-
>  drivers/video/via/dvi.c                            |  8 +--
>  drivers/video/via/dvi.h                            |  4 +-
>  drivers/video/via/hw.c                             | 16 ++---
>  drivers/video/via/hw.h                             |  4 +-
>  drivers/video/via/lcd.c                            | 10 +--
>  drivers/video/via/lcd.h                            |  6 +-
>  drivers/video/via/via-core.c                       | 10 +--
>  drivers/video/via/via-gpio.c                       |  2 +-
>  drivers/video/via/viafbdev.c                       | 10 +--
>  drivers/video/vt8500lcdfb.c                        |  2 +-
>  drivers/video/vt8623fb.c                           |  2 +-
>  drivers/video/w100fb.c                             |  6 +-
>  drivers/video/wm8505fb.c                           |  2 +-
>  drivers/video/wmt_ge_rops.c                        |  2 +-
>  drivers/video/xen-fbfront.c                        |  4 +-
>  drivers/video/xilinxfb.c                           |  2 +-
>  122 files changed, 438 insertions(+), 443 deletions(-)
> 

For drivers/video/s3c-fb.c, drivers/video/exynos/exynos_dp_core.c

Acked-by: Jingoo Han <jg1.han@samsung.com>


Best regards,
Jingoo Han

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 08:22:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 08:22:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taj5q-0001Im-Gl; Tue, 20 Nov 2012 08:22:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jg1.han@samsung.com>) id 1Tad6z-0004uk-0X
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 01:58:53 +0000
Received: from [85.158.143.35:35240] by server-1.bemta-4.messagelabs.com id
	06/65-27934-CD3EAA05; Tue, 20 Nov 2012 01:58:52 +0000
X-Env-Sender: jg1.han@samsung.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1353376728!11297860!1
X-Originating-IP: [203.254.224.34]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjAzLjI1NC4yMjQuMzQgPT4gMzM0MzQ5\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17490 invoked from network); 20 Nov 2012 01:58:50 -0000
Received: from mailout4.samsung.com (HELO mailout4.samsung.com)
	(203.254.224.34) by server-11.tower-21.messagelabs.com with SMTP;
	20 Nov 2012 01:58:50 -0000
Received: from epcpsbge6.samsung.com (epcpsbge6 [203.254.230.16])
	by mailout4.samsung.com
	(Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit
	(built Nov
	17 2011)) with ESMTP id <0MDR00JBGK5ARQA0@mailout4.samsung.com> for
	xen-devel@lists.xensource.com; Tue, 20 Nov 2012 10:58:22 +0900 (KST)
Received: from epcpsbge6.samsung.com ( [203.254.230.48])
	by epcpsbge6.samsung.com (EPCPMTA) with SMTP id DA.1D.23515.DB3EAA05;
	Tue, 20 Nov 2012 10:58:21 +0900 (KST)
X-AuditID: cbfee610-b7fd06d000005bdb-c6-50aae3bd0b25
Received: from epmailer06 ( [203.254.219.146])
	by epcpsbge6.samsung.com (EPCPMTA) with SMTP id 48.1D.23515.DB3EAA05;
	Tue, 20 Nov 2012 10:58:21 +0900 (KST)
Date: Tue, 20 Nov 2012 01:58:21 +0000 (GMT)
From: Jingoo Han <jg1.han@samsung.com>
To: Bill Pemberton <wfp5p@virginia.edu>
MIME-version: 1.0
X-MTR: 20121120015616194@jg1.han
Msgkey: 20121120015616194@jg1.han
X-EPLocale: en_US.euc-kr
X-Priority: 3
X-EPWebmail-Msg-Type: personal
X-EPWebmail-Reply-Demand: 0
X-EPApproval-Locale: 
X-EPHeader: ML
X-EPTrCode: 
X-EPTrName: 
X-MLAttribute: 
X-RootMTR: 20121120015616194@jg1.han
X-ParentMTR: 
X-Mobile: True,C10
X-ArchiveUser: EV
X-CPGSPASS: Y
MIME-version: 1.0
Message-id: <18550095.678601353376700883.JavaMail.weblogic@epml04>
DLP-Filter: Pass
X-Brightmail-Tracker: H4sIAAAAAAAAA5WTfUwTZxzH89y1d9VYdiLKA4uuHrpFDLWUlj5O2fzL3P6S6V4S3YCznLyM
	XtmVIphMO8pmCkxBivKy6QwNL10HE5zT8Srb6BgwlkA6IoJrKmNzTGuGdgsRV7iS9M/tv+99
	8v3+7vu75x4ZHnlTFivL4Qs4gWfzaGKtZHjpV1VCj8+Zqvp8JBn9U75AoHNt/Rjyl3yAo6VB
	O4YmXD8QyNe8RKCapg+lyN0wTSBbnQcgx+8vIWtjO4HODy5h6OIQRB0+jxRV9Y2S6Pszfik6
	++OwBHV3eDDU4DgrQbVjvRiaGpej0vEWHC0GlqTI5o9DsxdOIte3jSSyP3Tj6LNWH4naL90i
	UPPoRQI5n45K0Iz9AblPwZRaKwhm/MxHGHM70E8yw9V9EuaJ8zecGQ/M48yN+mmS8T9MYzpb
	4plr1l4pUzFfKmX6PnGRTKfjFFM92QyYsdrLgLn/z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qjTuqd+9Ytn8qS9stsdqj
	2/W2hITsFx7KI95WtTETk5fjLu3Bc47uf4resVcUv3w46ViFpGfCvOfvrYnDOPNOp44W8HpW
	kYSbefZfuZYSV2YEAAA=
X-CFilter-Loop: Reflected
X-Mailman-Approved-At: Tue, 20 Nov 2012 08:22:05 +0000
Cc: "linux-fbdev@vger.kernel.org" <linux-fbdev@vger.kernel.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	Michal Januszewski <spock@gentoo.org>, Paul Mackerras <paulus@samba.org>,
	"linux-nvidia@lists.surfsouth.com" <linux-nvidia@lists.surfsouth.com>,
	Daniel Walker <dwalker@fifo99.com>, Kukjin Kim <kgene.kim@samsung.com>,
	Russell King <linux@arm.linux.org.uk>, Wan ZongShun <mcuos.com@gmail.com>,
	Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
	Jingoo Han <jg1.han@samsung.com>, Tomi Valkeinen <tomi.valkeinen@ti.com>,
	David Brown <davidb@codeaurora.org>, Jaya Kumar <jayalk@intworks.biz>,
	"cbe-oss-dev@lists.ozlabs.org" <cbe-oss-dev@lists.ozlabs.org>,
	Antonino Daplas <adaplas@gmail.com>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	Thomas Winischhofer <thomas@winischhofer.net>,
	"linux-geode@lists.infradead.org" <linux-geode@lists.infradead.org>,
	"linux-samsung-soc@vger.kernel.org" <linux-samsung-soc@vger.kernel.org>,
	Ben Dooks <ben-linux@fluff.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Maik Broemme <mbroemme@plusserver.de>, Geoff Levand <geoff@infradead.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	Ferenc Bakonyi <fero@drama.obuda.kando.hu>,
	Tony Prisk <linux@prisktech.co.nz>, Bryan Huntsman <bryanh@codeaurora.org>,
	Kristoffer Ericson <kristoffer.ericson@gmail.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 158/493] video: remove use of __devinit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: jg1.han@samsung.com
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tuesday, November 20, 2012 3:22 AM, Bill Pemberton wrote
> 
> CONFIG_HOTPLUG is going away as an option so __devinit is no longer
> needed.
> 
> Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
> Cc: Jaya Kumar <jayalk@intworks.biz>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Jingoo Han <jg1.han@samsung.com>
> Cc: Ferenc Bakonyi <fero@drama.obuda.kando.hu>
> Cc: Antonino Daplas <adaplas@gmail.com>
> Cc: Maik Broemme <mbroemme@plusserver.de>
> Cc: David Brown <davidb@codeaurora.org>
> Cc: Daniel Walker <dwalker@fifo99.com>
> Cc: Bryan Huntsman <bryanh@codeaurora.org>
> Cc: Wan ZongShun <mcuos.com@gmail.com>
> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: Geoff Levand <geoff@infradead.org>
> Cc: Kristoffer Ericson <kristoffer.ericson@gmail.com>
> Cc: Ben Dooks <ben-linux@fluff.org>
> Cc: Kukjin Kim <kgene.kim@samsung.com>
> Cc: Thomas Winischhofer <thomas@winischhofer.net>
> Cc: Michal Januszewski <spock@gentoo.org>
> Cc: Tony Prisk <linux@prisktech.co.nz>
> Cc: linux-fbdev@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-geode@lists.infradead.org
> Cc: linux-nvidia@lists.surfsouth.com
> Cc: linux-arm-msm@vger.kernel.org
> Cc: linux-omap@vger.kernel.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: cbe-oss-dev@lists.ozlabs.org
> Cc: linux-samsung-soc@vger.kernel.org
> Cc: xen-devel@lists.xensource.com
> Cc: virtualization@lists.linux-foundation.org
> ---
>  drivers/video/acornfb.c                            | 14 ++--
>  drivers/video/arcfb.c                              |  2 +-
>  drivers/video/arkfb.c                              |  2 +-
>  drivers/video/asiliantfb.c                         |  6 +-
>  drivers/video/aty/aty128fb.c                       | 22 +++---
>  drivers/video/aty/atyfb_base.c                     | 22 +++---
>  drivers/video/aty/mach64_ct.c                      |  4 +-
>  drivers/video/aty/mach64_cursor.c                  |  2 +-
>  drivers/video/aty/radeon_base.c                    | 14 ++--
>  drivers/video/aty/radeon_monitor.c                 | 16 ++---
>  drivers/video/au1100fb.c                           |  2 +-
>  drivers/video/au1200fb.c                           |  2 +-
>  drivers/video/auo_k1900fb.c                        |  2 +-
>  drivers/video/auo_k1901fb.c                        |  2 +-
>  drivers/video/auo_k190x.c                          |  2 +-
>  drivers/video/bf537-lq035.c                        |  6 +-
>  drivers/video/bf54x-lq043fb.c                      |  2 +-
>  drivers/video/bfin-lq035q1-fb.c                    |  6 +-
>  drivers/video/bfin-t350mcqb-fb.c                   |  2 +-
>  drivers/video/bfin_adv7393fb.c                     |  2 +-
>  drivers/video/broadsheetfb.c                       |  8 +--
>  drivers/video/bw2.c                                |  6 +-
>  drivers/video/carminefb.c                          |  4 +-
>  drivers/video/cg14.c                               |  4 +-
>  drivers/video/cg3.c                                |  8 +--
>  drivers/video/cg6.c                                |  8 +--
>  drivers/video/chipsfb.c                            |  4 +-
>  drivers/video/cirrusfb.c                           | 10 +--
>  drivers/video/cobalt_lcdfb.c                       |  2 +-
>  drivers/video/console/sticore.c                    | 47 ++++++-------
>  drivers/video/cyber2000fb.c                        | 12 ++--
>  drivers/video/da8xx-fb.c                           |  2 +-
>  drivers/video/dnfb.c                               |  2 +-
>  drivers/video/ep93xx-fb.c                          |  4 +-
>  drivers/video/exynos/exynos_dp_core.c              |  2 +-
>  drivers/video/ffb.c                                |  2 +-
>  drivers/video/fm2fb.c                              |  4 +-
>  drivers/video/fsl-diu-fb.c                         |  4 +-
>  drivers/video/gbefb.c                              |  4 +-
>  drivers/video/geode/gx1fb_core.c                   |  6 +-
>  drivers/video/geode/gxfb_core.c                    | 10 +--
>  drivers/video/geode/lxfb_core.c                    | 10 +--
>  drivers/video/grvga.c                              |  4 +-
>  drivers/video/gxt4500.c                            |  4 +-
>  drivers/video/hecubafb.c                           |  2 +-
>  drivers/video/hgafb.c                              |  4 +-
>  drivers/video/hitfb.c                              |  2 +-
>  drivers/video/hpfb.c                               |  4 +-
>  drivers/video/i740fb.c                             |  4 +-
>  drivers/video/i810/i810_main.c                     | 26 +++----
>  drivers/video/i810/i810_main.h                     |  2 +-
>  drivers/video/imsttfb.c                            |  4 +-
>  drivers/video/intelfb/intelfbdrv.c                 | 16 ++---
>  drivers/video/jz4740_fb.c                          |  2 +-
>  drivers/video/kyro/fbdev.c                         |  2 +-
>  drivers/video/leo.c                                |  2 +-
>  drivers/video/mb862xx/mb862xxfbdrv.c               |  6 +-
>  drivers/video/mbx/mbxdebugfs.c                     |  2 +-
>  drivers/video/mbx/mbxfb.c                          | 10 +--
>  drivers/video/metronomefb.c                        | 12 ++--
>  drivers/video/msm/mddi.c                           |  6 +-
>  drivers/video/mxsfb.c                              |  6 +-
>  drivers/video/neofb.c                              | 12 ++--
>  drivers/video/nuc900fb.c                           |  4 +-
>  drivers/video/nvidia/nvidia.c                      | 12 ++--
>  .../omap2/displays/panel-lgphilips-lb035q02.c      |  2 +-
>  drivers/video/p9100.c                              |  2 +-
>  drivers/video/platinumfb.c                         |  6 +-
>  drivers/video/pm2fb.c                              |  2 +-
>  drivers/video/pm3fb.c                              |  4 +-
>  drivers/video/pmag-ba-fb.c                         |  2 +-
>  drivers/video/pmagb-b-fb.c                         |  6 +-
>  drivers/video/ps3fb.c                              |  2 +-
>  drivers/video/pvr2fb.c                             |  6 +-
>  drivers/video/pxa168fb.c                           |  4 +-
>  drivers/video/pxa3xx-gcu.c                         |  2 +-
>  drivers/video/pxafb.c                              | 20 +++---
>  drivers/video/q40fb.c                              |  2 +-
>  drivers/video/riva/fbdev.c                         | 20 +++---
>  drivers/video/riva/rivafb-i2c.c                    |  6 +-
>  drivers/video/s1d13xxxfb.c                         |  4 +-
>  drivers/video/s3c-fb.c                             |  6 +-
>  drivers/video/s3c2410fb.c                          |  8 +--
>  drivers/video/s3fb.c                               |  6 +-
>  drivers/video/sa1100fb.c                           |  6 +-
>  drivers/video/savage/savagefb_driver.c             |  8 +--
>  drivers/video/sgivwfb.c                            |  2 +-
>  drivers/video/sh7760fb.c                           |  2 +-
>  drivers/video/sh_mobile_lcdcfb.c                   | 16 ++---
>  drivers/video/sh_mobile_meram.c                    |  2 +-
>  drivers/video/sis/sis_main.c                       | 82 +++++++++++-----------
>  drivers/video/skeletonfb.c                         |  2 +-
>  drivers/video/sm501fb.c                            |  8 +--
>  drivers/video/sstfb.c                              | 18 ++---
>  drivers/video/sunxvr1000.c                         |  6 +-
>  drivers/video/sunxvr2500.c                         |  6 +-
>  drivers/video/sunxvr500.c                          |  6 +-
>  drivers/video/tcx.c                                |  2 +-
>  drivers/video/tdfxfb.c                             | 10 +--
>  drivers/video/tgafb.c                              | 16 ++---
>  drivers/video/tmiofb.c                             |  2 +-
>  drivers/video/tridentfb.c                          |  8 +--
>  drivers/video/uvesafb.c                            | 30 ++++----
>  drivers/video/vermilion/vermilion.c                |  2 +-
>  drivers/video/vfb.c                                |  2 +-
>  drivers/video/vga16fb.c                            |  2 +-
>  drivers/video/via/dvi.c                            |  8 +--
>  drivers/video/via/dvi.h                            |  4 +-
>  drivers/video/via/hw.c                             | 16 ++---
>  drivers/video/via/hw.h                             |  4 +-
>  drivers/video/via/lcd.c                            | 10 +--
>  drivers/video/via/lcd.h                            |  6 +-
>  drivers/video/via/via-core.c                       | 10 +--
>  drivers/video/via/via-gpio.c                       |  2 +-
>  drivers/video/via/viafbdev.c                       | 10 +--
>  drivers/video/vt8500lcdfb.c                        |  2 +-
>  drivers/video/vt8623fb.c                           |  2 +-
>  drivers/video/w100fb.c                             |  6 +-
>  drivers/video/wm8505fb.c                           |  2 +-
>  drivers/video/wmt_ge_rops.c                        |  2 +-
>  drivers/video/xen-fbfront.c                        |  4 +-
>  drivers/video/xilinxfb.c                           |  2 +-
>  122 files changed, 438 insertions(+), 443 deletions(-)
> 

For drivers/video/s3c-fb.c, drivers/video/exynos/exynos_dp_core.c

Acked-by: Jingoo Han <jg1.han@samsung.com>


Best regards,
Jingoo Han

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 08:30:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 08:30:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TajE6-0001UZ-T3; Tue, 20 Nov 2012 08:30:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <stefan.bader@canonical.com>) id 1TajE5-0001UU-AA
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 08:30:37 +0000
Received: from [85.158.138.51:7900] by server-11.bemta-3.messagelabs.com id
	5B/2A-19361-CAF3BA05; Tue, 20 Nov 2012 08:30:36 +0000
X-Env-Sender: stefan.bader@canonical.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353400235!28795492!1
X-Originating-IP: [91.189.89.112]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21038 invoked from network); 20 Nov 2012 08:30:35 -0000
Received: from youngberry.canonical.com (HELO youngberry.canonical.com)
	(91.189.89.112) by server-15.tower-174.messagelabs.com with SMTP;
	20 Nov 2012 08:30:35 -0000
Received: from p5b2e316f.dip.t-dialin.net ([91.46.49.111] helo=[192.168.2.5])
	by youngberry.canonical.com with esmtpsa
	(TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71)
	(envelope-from <stefan.bader@canonical.com>)
	id 1TajDy-0007pb-Mi; Tue, 20 Nov 2012 08:30:30 +0000
Message-ID: <50AB3F9D.4070905@canonical.com>
Date: Tue, 20 Nov 2012 09:30:21 +0100
From: Stefan Bader <stefan.bader@canonical.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Sander Eikelenboom <linux@eikelenboom.it>
References: <1349790467.21847.185.camel@zakaz.uk.xensource.com>
	<1349790863.21172.4406.camel@edumazet-glaptop>
	<1349792241.21847.199.camel@zakaz.uk.xensource.com>
	<1349792847.21172.4479.camel@edumazet-glaptop>
	<1349793630.21847.208.camel@zakaz.uk.xensource.com>
	<1349863984.10070.26.camel@zakaz.uk.xensource.com>
	<1349874598.10070.39.camel@zakaz.uk.xensource.com>
	<748966751.20121010164949@eikelenboom.it>
	<1349942546.14806.7.camel@zakaz.uk.xensource.com>
	<151954917.20121011120004@eikelenboom.it>
	<1349949924.21172.8462.camel@edumazet-glaptop>
	<1349950494.14806.29.camel@zakaz.uk.xensource.com>
	<50A4540E.1010601@oracle.com>
	<1333495676.20121119164304@eikelenboom.it>
In-Reply-To: <1333495676.20121119164304@eikelenboom.it>
X-Enigmail-Version: 1.4.5
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Marcos E. Matsunaga" <Marcos.Matsunaga@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad@kernel.org>, ANNIE LI <annie.li@oracle.com>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] compound skb frag pages appearing in start_xmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3420615370490539784=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============3420615370490539784==
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature";
 boundary="------------enig9491B69895AA4970D7941DA3"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig9491B69895AA4970D7941DA3
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 19.11.2012 16:43, Sander Eikelenboom wrote:
>=20
> Thursday, November 15, 2012, 3:31:42 AM, you wrote:
>=20
>> On 2012-10-11 18:14, Ian Campbell wrote:
>>> On Thu, 2012-10-11 at 11:05 +0100, Eric Dumazet wrote:
>>>> On Thu, 2012-10-11 at 12:00 +0200, Sander Eikelenboom wrote:
>>>>
>>>>> Probably due to the BUG_ON from the patch below, i changed it into =
a WARN_ON.
>>>>> And i seem to hit it, but only in one of the guests at the moment a=
nd it triggers quite irregularly.
>>>> xennet_make_frags() is able to split the skb->head in multiple page-=
size
>>>> chunks.
>>>>
>>>> It should do the same for fragments
>>> Right, I just want to be reproduce the issue so I can know I've fixed=
 it
>>> properly ;-)
>> Hi Ian,
>=20
>> I can reproduce this BUG_ON when running netperf/netserver test betwee=
n=20
>> two domus running on the same dom0. The domu and dom0 all use v3.7-rc1=
=2E
>=20
>> When I tried to rebase my persistent grant netfront/netback patch on=20
>> latest kernel, netperf/netserver test never succeeded. I did some test=
=20
>> to find out that v3.6-rc7 works fine, but v3.7-rc1, v3.7-rc2 and=20
>> v3.7-rc4 does not succeed in netperf/netserver test. So I keep my=20
>> persistent grant patch only based on v3.4-rc3 now.
>=20
>> Konrad thought about commit 6a8ed462f16b8455eec5ae00eb6014159a6721f0 i=
n=20
>> v3.7-rc1, and suggested me to test your debug patch in netfront. This =

>> BUG_ON happens soon after running the netperf/netserver test case.
>=20
>> Thanks
>> Annie
>=20
> Is there any progression with this bug (rc6 is out the door, so the rel=
ease of 3.7-final seems to be eminent and this bug completely cripples an=
y networking with guests) ?
>=20

+1 on that. I was testing yesterday with a PVM domU running 3.7-rc5 on Xe=
n 4.2
(but also reported from EC2 running Xen 3.4.3) c with one VCPU. I actuall=
y can
trigger it by just ssh'ing into the domU (from another machine) and then =
run
"find /". Output starts to stutter and then stops completely. When this h=
appens
a new connection still can be made and as long as only shorter output is
generated the ssh connection is ok. From a dump taken it looks like user-=
space
is waiting in some select call (without any warnon I rather won't see the=
 tx path).

-Stefan



--------------enig9491B69895AA4970D7941DA3
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBCgAGBQJQqz+kAAoJEOhnXe7L7s6juzcP/jOI3Ac4Nix8czBGsHJE9Rl5
R7icGSpb8Dpr8tWeWd3l5U0EYzcyARcfy6SKHYHcMEQth35nWsHdR55koB7ATzZZ
bZyooTSRGqsepuw9DWilgjvfR27zDFdymi/GIDaMVCIUxIvW0F+IVB++mstMUXZv
PTemlzKQtvflgIuDhia26sd6PfV/9AhmU757gzpMwuciStKuPgkBWEr6STnFQzEe
dCDCYCpFKYGcGRvnEsQT8p8ArLR9FEju/PmO1YjkSRiohTPGB1JFMSWTk83QIFj0
lU7c2FZr6DB7gC3ITTUERfw6kyPgkjIbK5qAVLUtJEjuqOueI9HZQ8qEuo9i4rdt
jRycw6Ff22qUCyKTvwcM9JK55GnFHmkUkC8n7hU4PRM2VuOS4+3K2o/Dia0vxgB0
JOvhRQFH2NfmJgeVIkbXpInu2WuRhFGtTEHA4HWF2MoBLaJYktKoqq8GS80+gLe2
pn31LUaj4NO/Ofb+7njY+dBiZLil4y3m02Qa0dVnuOcC58J5LaVAIYUhMhfGODCA
unB71Y0OP3pHahK7shd5sVmTZ72f6hL4paBEi6zFz0JvBdrAGDGth7uzzfXDxG30
cEyQUG0B7NexC3/WZhq1FDq1UsVcJHCly8Lp5CPkXPOdbchCqh3DukHlD12ozv2z
atR22nwyftzXhcTVvXE7
=zNki
-----END PGP SIGNATURE-----

--------------enig9491B69895AA4970D7941DA3--


--===============3420615370490539784==
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.xen.org
http://lists.xen.org/xen-devel

--===============3420615370490539784==--


From xen-devel-bounces@lists.xen.org Tue Nov 20 08:30:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 08:30:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TajE6-0001UZ-T3; Tue, 20 Nov 2012 08:30:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <stefan.bader@canonical.com>) id 1TajE5-0001UU-AA
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 08:30:37 +0000
Received: from [85.158.138.51:7900] by server-11.bemta-3.messagelabs.com id
	5B/2A-19361-CAF3BA05; Tue, 20 Nov 2012 08:30:36 +0000
X-Env-Sender: stefan.bader@canonical.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353400235!28795492!1
X-Originating-IP: [91.189.89.112]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21038 invoked from network); 20 Nov 2012 08:30:35 -0000
Received: from youngberry.canonical.com (HELO youngberry.canonical.com)
	(91.189.89.112) by server-15.tower-174.messagelabs.com with SMTP;
	20 Nov 2012 08:30:35 -0000
Received: from p5b2e316f.dip.t-dialin.net ([91.46.49.111] helo=[192.168.2.5])
	by youngberry.canonical.com with esmtpsa
	(TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71)
	(envelope-from <stefan.bader@canonical.com>)
	id 1TajDy-0007pb-Mi; Tue, 20 Nov 2012 08:30:30 +0000
Message-ID: <50AB3F9D.4070905@canonical.com>
Date: Tue, 20 Nov 2012 09:30:21 +0100
From: Stefan Bader <stefan.bader@canonical.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Sander Eikelenboom <linux@eikelenboom.it>
References: <1349790467.21847.185.camel@zakaz.uk.xensource.com>
	<1349790863.21172.4406.camel@edumazet-glaptop>
	<1349792241.21847.199.camel@zakaz.uk.xensource.com>
	<1349792847.21172.4479.camel@edumazet-glaptop>
	<1349793630.21847.208.camel@zakaz.uk.xensource.com>
	<1349863984.10070.26.camel@zakaz.uk.xensource.com>
	<1349874598.10070.39.camel@zakaz.uk.xensource.com>
	<748966751.20121010164949@eikelenboom.it>
	<1349942546.14806.7.camel@zakaz.uk.xensource.com>
	<151954917.20121011120004@eikelenboom.it>
	<1349949924.21172.8462.camel@edumazet-glaptop>
	<1349950494.14806.29.camel@zakaz.uk.xensource.com>
	<50A4540E.1010601@oracle.com>
	<1333495676.20121119164304@eikelenboom.it>
In-Reply-To: <1333495676.20121119164304@eikelenboom.it>
X-Enigmail-Version: 1.4.5
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Marcos E. Matsunaga" <Marcos.Matsunaga@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad@kernel.org>, ANNIE LI <annie.li@oracle.com>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] compound skb frag pages appearing in start_xmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3420615370490539784=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============3420615370490539784==
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature";
 boundary="------------enig9491B69895AA4970D7941DA3"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig9491B69895AA4970D7941DA3
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 19.11.2012 16:43, Sander Eikelenboom wrote:
>=20
> Thursday, November 15, 2012, 3:31:42 AM, you wrote:
>=20
>> On 2012-10-11 18:14, Ian Campbell wrote:
>>> On Thu, 2012-10-11 at 11:05 +0100, Eric Dumazet wrote:
>>>> On Thu, 2012-10-11 at 12:00 +0200, Sander Eikelenboom wrote:
>>>>
>>>>> Probably due to the BUG_ON from the patch below, i changed it into =
a WARN_ON.
>>>>> And i seem to hit it, but only in one of the guests at the moment a=
nd it triggers quite irregularly.
>>>> xennet_make_frags() is able to split the skb->head in multiple page-=
size
>>>> chunks.
>>>>
>>>> It should do the same for fragments
>>> Right, I just want to be reproduce the issue so I can know I've fixed=
 it
>>> properly ;-)
>> Hi Ian,
>=20
>> I can reproduce this BUG_ON when running netperf/netserver test betwee=
n=20
>> two domus running on the same dom0. The domu and dom0 all use v3.7-rc1=
=2E
>=20
>> When I tried to rebase my persistent grant netfront/netback patch on=20
>> latest kernel, netperf/netserver test never succeeded. I did some test=
=20
>> to find out that v3.6-rc7 works fine, but v3.7-rc1, v3.7-rc2 and=20
>> v3.7-rc4 does not succeed in netperf/netserver test. So I keep my=20
>> persistent grant patch only based on v3.4-rc3 now.
>=20
>> Konrad thought about commit 6a8ed462f16b8455eec5ae00eb6014159a6721f0 i=
n=20
>> v3.7-rc1, and suggested me to test your debug patch in netfront. This =

>> BUG_ON happens soon after running the netperf/netserver test case.
>=20
>> Thanks
>> Annie
>=20
> Is there any progression with this bug (rc6 is out the door, so the rel=
ease of 3.7-final seems to be eminent and this bug completely cripples an=
y networking with guests) ?
>=20

+1 on that. I was testing yesterday with a PVM domU running 3.7-rc5 on Xe=
n 4.2
(but also reported from EC2 running Xen 3.4.3) c with one VCPU. I actuall=
y can
trigger it by just ssh'ing into the domU (from another machine) and then =
run
"find /". Output starts to stutter and then stops completely. When this h=
appens
a new connection still can be made and as long as only shorter output is
generated the ssh connection is ok. From a dump taken it looks like user-=
space
is waiting in some select call (without any warnon I rather won't see the=
 tx path).

-Stefan



--------------enig9491B69895AA4970D7941DA3
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBCgAGBQJQqz+kAAoJEOhnXe7L7s6juzcP/jOI3Ac4Nix8czBGsHJE9Rl5
R7icGSpb8Dpr8tWeWd3l5U0EYzcyARcfy6SKHYHcMEQth35nWsHdR55koB7ATzZZ
bZyooTSRGqsepuw9DWilgjvfR27zDFdymi/GIDaMVCIUxIvW0F+IVB++mstMUXZv
PTemlzKQtvflgIuDhia26sd6PfV/9AhmU757gzpMwuciStKuPgkBWEr6STnFQzEe
dCDCYCpFKYGcGRvnEsQT8p8ArLR9FEju/PmO1YjkSRiohTPGB1JFMSWTk83QIFj0
lU7c2FZr6DB7gC3ITTUERfw6kyPgkjIbK5qAVLUtJEjuqOueI9HZQ8qEuo9i4rdt
jRycw6Ff22qUCyKTvwcM9JK55GnFHmkUkC8n7hU4PRM2VuOS4+3K2o/Dia0vxgB0
JOvhRQFH2NfmJgeVIkbXpInu2WuRhFGtTEHA4HWF2MoBLaJYktKoqq8GS80+gLe2
pn31LUaj4NO/Ofb+7njY+dBiZLil4y3m02Qa0dVnuOcC58J5LaVAIYUhMhfGODCA
unB71Y0OP3pHahK7shd5sVmTZ72f6hL4paBEi6zFz0JvBdrAGDGth7uzzfXDxG30
cEyQUG0B7NexC3/WZhq1FDq1UsVcJHCly8Lp5CPkXPOdbchCqh3DukHlD12ozv2z
atR22nwyftzXhcTVvXE7
=zNki
-----END PGP SIGNATURE-----

--------------enig9491B69895AA4970D7941DA3--


--===============3420615370490539784==
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.xen.org
http://lists.xen.org/xen-devel

--===============3420615370490539784==--


From xen-devel-bounces@lists.xen.org Tue Nov 20 09:05:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 09:05:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TajlK-0001lN-Qp; Tue, 20 Nov 2012 09:04:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TajlJ-0001lI-99
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 09:04:57 +0000
Received: from [85.158.143.99:38817] by server-3.bemta-4.messagelabs.com id
	23/A3-06841-8B74BA05; Tue, 20 Nov 2012 09:04:56 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353402295!23578658!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24309 invoked from network); 20 Nov 2012 09:04:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 09:04:55 -0000
X-IronPort-AV: E=Sophos;i="4.83,284,1352073600"; d="scan'208";a="15895833"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 09:03:55 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 20 Nov 2012 09:03:55 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TajkJ-00064k-EB;
	Tue, 20 Nov 2012 09:03:55 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TajkJ-0001bg-Bx;
	Tue, 20 Nov 2012 09:03:55 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14434-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 20 Nov 2012 09:03:55 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14434: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14434 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14434/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-pv          10 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-xend-winxpsp3  8 guest-saverestore        fail REGR. vs. 14416
 test-amd64-i386-pair   17 guest-migrate/src_host/dst_host fail REGR. vs. 14416
 test-amd64-i386-win           8 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-pv           10 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-win-vcpus1    8 guest-saverestore         fail REGR. vs. 14416
 test-amd64-amd64-pair  17 guest-migrate/src_host/dst_host fail REGR. vs. 14416
 test-amd64-amd64-win          8 guest-saverestore         fail REGR. vs. 14416

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14416
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14416
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14416
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14416

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  02b9d9a25fee
baseline version:
 xen                  321f8487379b

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Wei Wang <wei.wang2@amd.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        fail    
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          fail    
 test-amd64-i386-pv                                           fail    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26178:02b9d9a25fee
tag:         tip
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 19:56:56 2012 +0000
    
    xen: fix build failure due to extra closing comment
    
    Added by 26173:26facad2f1a1
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26177:fe8034159ac2
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:35 2012 +0000
    
    docs: Include prototype for HYPERVISOR_multicall
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26176:edad24bfa561
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:34 2012 +0000
    
    docs: Document HYPERVISOR_update_descriptor
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26175:b1d36147ac96
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Add ToC entry for start of day memory layout.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26174:dbb8d24bb5ad
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Document HYPERVISOR_mmuext_op
    
    Mark-up for inclusion of generated docs.
    
    Remove some trailing whitespace.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26173:26facad2f1a1
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:32 2012 +0000
    
    docs: document HYPERVISOR_update_va_mapping(_other_domain)
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26172:cfd2772cc717
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:31 2012 +0000
    
    docs: document/mark-up SCHEDOP_*
    
    The biggest subtlety here is there additional argument when op ==
    SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
    xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
    
    This patch moves some structs around but there is no functional change
    other than improved documentation.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26171:31668da0c4d3
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 15:15:12 2012 +0100
    
    AMD IOMMU: fix type of "bdf" parameter of update_intremap_entry_from_msi_msg()
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26170:380ad94f2adc
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:51 2012 +0000
    
    Remove tools/vtpm* from MAINTAINERS file
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26169:5a6225e40388
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:50 2012 +0000
    
    tools: Remove old vtpm stuff from tools/libxen
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26168:3dc18d679d04
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:49 2012 +0000
    
    Remove VTPM_TOOLS from config/Tools.mk.in
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26167:31dcc0e08754
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    xend: Remove old vtpm support from xm
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26166:d026f8abca51
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    minios: Update mini-os license to support GPL features
    
    This patch updates extras/mini-os/COPYING to explain
    which optional features are GPL and what the implications
    of enabling them are.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26165:42a7c393c390
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:47 2012 +0000
    
    minios: fix bug in lseek for mini-os
    
    lseek always used files[fd].file.offset. It should
    use the offset of whatever union member is actually
    being used.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26164:17539cec2b9d
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: get the number of cpus from device tree
    
    The system might have fewer cpus than the GIC supports.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26163:ddb109120dbd
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: flush D-cache and I-cache when appropriate
    
    - invalidate tlb after setting WXN
    - flush D-cache and I-cache after relocation;
    - invalidate D-cache after writing to smp_up_cpu;
    - flush I-cache after changing HTTBR;
    - flush I-cache and branch predictor after writing Xen text ptes.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26162:9da9781cc3fb
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 09:48:22 2012 +0100
    
    vscsiif: minor cleanup
    
    Remove a definition not belonging into the interface, and correct a
    few typos in comments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26161:9025a10c0561
user:        Wei Wang <wei.wang2@amd.com>
date:        Mon Nov 19 09:46:46 2012 +0100
    
    AMD IOMMU: Enable HPET broadcast msi remapping
    
    This patch enables hpet msi remapping for amd iommu.
    
    Signed-off-by: Wei Wang <wei.wang2@amd.com>
    
    - use the existing ACPI_IVHD_* #define-s
    - warn on finding more than one IVHD HPET entry
    - consolidate parameters of update_intremap_entry_from_msi_msg()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Committed-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26160:321f8487379b
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:29 2012 +0000
    
    xen/arm: wake up secondary cpus
    
    Secondary cpus are held by the firmware until we send an IPI to them.
    
    Reordered non-boot cpu wait loop to perform the check before waiting
    for an event, to handled the case where the event has already
    happened when we reach the loop.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 09:05:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 09:05:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TajlK-0001lN-Qp; Tue, 20 Nov 2012 09:04:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TajlJ-0001lI-99
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 09:04:57 +0000
Received: from [85.158.143.99:38817] by server-3.bemta-4.messagelabs.com id
	23/A3-06841-8B74BA05; Tue, 20 Nov 2012 09:04:56 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353402295!23578658!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24309 invoked from network); 20 Nov 2012 09:04:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 09:04:55 -0000
X-IronPort-AV: E=Sophos;i="4.83,284,1352073600"; d="scan'208";a="15895833"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 09:03:55 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 20 Nov 2012 09:03:55 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TajkJ-00064k-EB;
	Tue, 20 Nov 2012 09:03:55 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TajkJ-0001bg-Bx;
	Tue, 20 Nov 2012 09:03:55 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14434-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 20 Nov 2012 09:03:55 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14434: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14434 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14434/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-pv          10 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-xend-winxpsp3  8 guest-saverestore        fail REGR. vs. 14416
 test-amd64-i386-pair   17 guest-migrate/src_host/dst_host fail REGR. vs. 14416
 test-amd64-i386-win           8 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-pv           10 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-win-vcpus1    8 guest-saverestore         fail REGR. vs. 14416
 test-amd64-amd64-pair  17 guest-migrate/src_host/dst_host fail REGR. vs. 14416
 test-amd64-amd64-win          8 guest-saverestore         fail REGR. vs. 14416

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14416
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14416
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14416
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14416

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  02b9d9a25fee
baseline version:
 xen                  321f8487379b

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Wei Wang <wei.wang2@amd.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        fail    
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          fail    
 test-amd64-i386-pv                                           fail    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26178:02b9d9a25fee
tag:         tip
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 19:56:56 2012 +0000
    
    xen: fix build failure due to extra closing comment
    
    Added by 26173:26facad2f1a1
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26177:fe8034159ac2
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:35 2012 +0000
    
    docs: Include prototype for HYPERVISOR_multicall
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26176:edad24bfa561
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:34 2012 +0000
    
    docs: Document HYPERVISOR_update_descriptor
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26175:b1d36147ac96
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Add ToC entry for start of day memory layout.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26174:dbb8d24bb5ad
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Document HYPERVISOR_mmuext_op
    
    Mark-up for inclusion of generated docs.
    
    Remove some trailing whitespace.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26173:26facad2f1a1
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:32 2012 +0000
    
    docs: document HYPERVISOR_update_va_mapping(_other_domain)
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26172:cfd2772cc717
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:31 2012 +0000
    
    docs: document/mark-up SCHEDOP_*
    
    The biggest subtlety here is there additional argument when op ==
    SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
    xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
    
    This patch moves some structs around but there is no functional change
    other than improved documentation.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26171:31668da0c4d3
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 15:15:12 2012 +0100
    
    AMD IOMMU: fix type of "bdf" parameter of update_intremap_entry_from_msi_msg()
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26170:380ad94f2adc
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:51 2012 +0000
    
    Remove tools/vtpm* from MAINTAINERS file
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26169:5a6225e40388
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:50 2012 +0000
    
    tools: Remove old vtpm stuff from tools/libxen
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26168:3dc18d679d04
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:49 2012 +0000
    
    Remove VTPM_TOOLS from config/Tools.mk.in
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26167:31dcc0e08754
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    xend: Remove old vtpm support from xm
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26166:d026f8abca51
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    minios: Update mini-os license to support GPL features
    
    This patch updates extras/mini-os/COPYING to explain
    which optional features are GPL and what the implications
    of enabling them are.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26165:42a7c393c390
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:47 2012 +0000
    
    minios: fix bug in lseek for mini-os
    
    lseek always used files[fd].file.offset. It should
    use the offset of whatever union member is actually
    being used.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26164:17539cec2b9d
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: get the number of cpus from device tree
    
    The system might have fewer cpus than the GIC supports.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26163:ddb109120dbd
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: flush D-cache and I-cache when appropriate
    
    - invalidate tlb after setting WXN
    - flush D-cache and I-cache after relocation;
    - invalidate D-cache after writing to smp_up_cpu;
    - flush I-cache after changing HTTBR;
    - flush I-cache and branch predictor after writing Xen text ptes.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26162:9da9781cc3fb
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 09:48:22 2012 +0100
    
    vscsiif: minor cleanup
    
    Remove a definition not belonging into the interface, and correct a
    few typos in comments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26161:9025a10c0561
user:        Wei Wang <wei.wang2@amd.com>
date:        Mon Nov 19 09:46:46 2012 +0100
    
    AMD IOMMU: Enable HPET broadcast msi remapping
    
    This patch enables hpet msi remapping for amd iommu.
    
    Signed-off-by: Wei Wang <wei.wang2@amd.com>
    
    - use the existing ACPI_IVHD_* #define-s
    - warn on finding more than one IVHD HPET entry
    - consolidate parameters of update_intremap_entry_from_msi_msg()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Committed-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26160:321f8487379b
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:29 2012 +0000
    
    xen/arm: wake up secondary cpus
    
    Secondary cpus are held by the firmware until we send an IPI to them.
    
    Reordered non-boot cpu wait loop to perform the check before waiting
    for an event, to handled the case where the event has already
    happened when we reach the loop.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 09:21:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 09:21:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tak0V-0001vm-BK; Tue, 20 Nov 2012 09:20:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tak0T-0001vh-Aq
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 09:20:37 +0000
Received: from [85.158.137.99:16006] by server-11.bemta-3.messagelabs.com id
	D4/08-19361-46B4BA05; Tue, 20 Nov 2012 09:20:36 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1353403235!16677989!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31683 invoked from network); 20 Nov 2012 09:20:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 09:20:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,284,1352073600"; d="scan'208";a="15896324"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 09:20:22 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 09:20:22 +0000
Message-ID: <1353403220.18229.158.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 20 Nov 2012 09:20:20 +0000
In-Reply-To: <osstest-14426-mainreport@xen.org>
References: <osstest-14426-mainreport@xen.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [xen-unstable test] 14426: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 01:02 +0000, xen.org wrote:
> build-amd64-pvops             4 kernel-build              fail REGR. vs. 14416

+ hg clone http://xenbits.xen.org/hg/staging/xen-unstable.hg xen-unstable
requesting all changes
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: Connection reset by peer

An infra or network error I suppose.

>  test-amd64-i386-xend-winxpsp3  8 guest-saverestore        fail REGR. vs. 14416
>  test-amd64-i386-win           8 guest-saverestore         fail REGR. vs. 14416
>  test-amd64-i386-pv           10 guest-saverestore         fail REGR. vs. 14416
>  test-amd64-i386-win-vcpus1    8 guest-saverestore         fail REGR. vs. 14416
>  test-amd64-i386-pair   17 guest-migrate/src_host/dst_host fail REGR. vs. 14416

2012-11-19 23:06:25 Z executing ssh ... root@10.80.250.27 xm migrate debian.guest.osstest bush-cricket
Error: XendOptionsFile instance has no attribute 'get_external_migration_tool'

This is a consequence of 26167:31dcc0e08754 "xend: Remove old vtpm
support from xm" which removed get_external_migration_tool but left one
caller.

Rather than further excise this call I think we should apply the
following patch to put back the basic external migration tool
infrastructure (with s/TPM/device/). Although the comments refer to vtpm
I can't see any reason why people might not be using it for other
purposes. Plus I'm more confident of this fix.

8<----------------------------------

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353402857 0
# Node ID 4c3b6252b129152bd9497ec77aed4779c04a522b
# Parent  ae6fb202b233af815466055d9f1a635802a50855
xend: reinstate XendOptionsFile.get_external_migration_tool

This was removed by 26167:31dcc0e08754 "xend: Remove old vtpm support
from xm" but at least one caller was left. Reinstate with
s/TPM/device/ since it appears that this functionality could apply
elsewhere.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r ae6fb202b233 -r 4c3b6252b129 tools/python/xen/xend/XendOptions.py
--- a/tools/python/xen/xend/XendOptions.py	Tue Nov 20 08:58:31 2012 +0100
+++ b/tools/python/xen/xend/XendOptions.py	Tue Nov 20 09:14:17 2012 +0000
@@ -349,6 +349,10 @@ class XendOptions:
         else:
             return None
 
+    def get_external_migration_tool(self):
+        """@return the name of the tool to handle virtual device migration."""
+        return self.get_config_string('external-migration-tool', self.external_migration_tool_default)
+
     def get_enable_dump(self):
         return self.get_config_bool('enable-dump', 'no')
 
diff -r ae6fb202b233 -r 4c3b6252b129 tools/python/xen/xend/tests/xend-config.sxp
--- a/tools/python/xen/xend/tests/xend-config.sxp	Tue Nov 20 08:58:31 2012 +0100
+++ b/tools/python/xen/xend/tests/xend-config.sxp	Tue Nov 20 09:14:17 2012 +0000
@@ -127,3 +127,5 @@
 # Whether to enable core-dumps when domains crash.
 #(enable-dump no)
 
+# The tool used for initiating virtual device migration
+#(external-migration-tool '')




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 09:21:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 09:21:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tak0V-0001vm-BK; Tue, 20 Nov 2012 09:20:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tak0T-0001vh-Aq
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 09:20:37 +0000
Received: from [85.158.137.99:16006] by server-11.bemta-3.messagelabs.com id
	D4/08-19361-46B4BA05; Tue, 20 Nov 2012 09:20:36 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1353403235!16677989!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31683 invoked from network); 20 Nov 2012 09:20:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 09:20:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,284,1352073600"; d="scan'208";a="15896324"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 09:20:22 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 09:20:22 +0000
Message-ID: <1353403220.18229.158.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 20 Nov 2012 09:20:20 +0000
In-Reply-To: <osstest-14426-mainreport@xen.org>
References: <osstest-14426-mainreport@xen.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [xen-unstable test] 14426: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 01:02 +0000, xen.org wrote:
> build-amd64-pvops             4 kernel-build              fail REGR. vs. 14416

+ hg clone http://xenbits.xen.org/hg/staging/xen-unstable.hg xen-unstable
requesting all changes
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: Connection reset by peer

An infra or network error I suppose.

>  test-amd64-i386-xend-winxpsp3  8 guest-saverestore        fail REGR. vs. 14416
>  test-amd64-i386-win           8 guest-saverestore         fail REGR. vs. 14416
>  test-amd64-i386-pv           10 guest-saverestore         fail REGR. vs. 14416
>  test-amd64-i386-win-vcpus1    8 guest-saverestore         fail REGR. vs. 14416
>  test-amd64-i386-pair   17 guest-migrate/src_host/dst_host fail REGR. vs. 14416

2012-11-19 23:06:25 Z executing ssh ... root@10.80.250.27 xm migrate debian.guest.osstest bush-cricket
Error: XendOptionsFile instance has no attribute 'get_external_migration_tool'

This is a consequence of 26167:31dcc0e08754 "xend: Remove old vtpm
support from xm" which removed get_external_migration_tool but left one
caller.

Rather than further excise this call I think we should apply the
following patch to put back the basic external migration tool
infrastructure (with s/TPM/device/). Although the comments refer to vtpm
I can't see any reason why people might not be using it for other
purposes. Plus I'm more confident of this fix.

8<----------------------------------

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353402857 0
# Node ID 4c3b6252b129152bd9497ec77aed4779c04a522b
# Parent  ae6fb202b233af815466055d9f1a635802a50855
xend: reinstate XendOptionsFile.get_external_migration_tool

This was removed by 26167:31dcc0e08754 "xend: Remove old vtpm support
from xm" but at least one caller was left. Reinstate with
s/TPM/device/ since it appears that this functionality could apply
elsewhere.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r ae6fb202b233 -r 4c3b6252b129 tools/python/xen/xend/XendOptions.py
--- a/tools/python/xen/xend/XendOptions.py	Tue Nov 20 08:58:31 2012 +0100
+++ b/tools/python/xen/xend/XendOptions.py	Tue Nov 20 09:14:17 2012 +0000
@@ -349,6 +349,10 @@ class XendOptions:
         else:
             return None
 
+    def get_external_migration_tool(self):
+        """@return the name of the tool to handle virtual device migration."""
+        return self.get_config_string('external-migration-tool', self.external_migration_tool_default)
+
     def get_enable_dump(self):
         return self.get_config_bool('enable-dump', 'no')
 
diff -r ae6fb202b233 -r 4c3b6252b129 tools/python/xen/xend/tests/xend-config.sxp
--- a/tools/python/xen/xend/tests/xend-config.sxp	Tue Nov 20 08:58:31 2012 +0100
+++ b/tools/python/xen/xend/tests/xend-config.sxp	Tue Nov 20 09:14:17 2012 +0000
@@ -127,3 +127,5 @@
 # Whether to enable core-dumps when domains crash.
 #(enable-dump no)
 
+# The tool used for initiating virtual device migration
+#(external-migration-tool '')




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 09:21:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 09:21:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tak1S-0001zE-Pr; Tue, 20 Nov 2012 09:21:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tak1Q-0001z4-O7
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 09:21:36 +0000
Received: from [85.158.137.99:38074] by server-12.bemta-3.messagelabs.com id
	8E/5F-22757-B9B4BA05; Tue, 20 Nov 2012 09:21:31 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1353403287!12976935!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23099 invoked from network); 20 Nov 2012 09:21:27 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 09:21:27 -0000
X-IronPort-AV: E=Sophos;i="4.83,284,1352073600"; d="scan'208";a="15896354"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 09:21:27 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 09:21:27 +0000
Message-ID: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefan Bader <stefan.bader@canonical.com>
Date: Tue, 20 Nov 2012 09:21:26 +0000
In-Reply-To: <50AB3F9D.4070905@canonical.com>
References: <1349790467.21847.185.camel@zakaz.uk.xensource.com>
	<1349790863.21172.4406.camel@edumazet-glaptop>
	<1349792241.21847.199.camel@zakaz.uk.xensource.com>
	<1349792847.21172.4479.camel@edumazet-glaptop>
	<1349793630.21847.208.camel@zakaz.uk.xensource.com>
	<1349863984.10070.26.camel@zakaz.uk.xensource.com>
	<1349874598.10070.39.camel@zakaz.uk.xensource.com>
	<748966751.20121010164949@eikelenboom.it>
	<1349942546.14806.7.camel@zakaz.uk.xensource.com>
	<151954917.20121011120004@eikelenboom.it>
	<1349949924.21172.8462.camel@edumazet-glaptop>
	<1349950494.14806.29.camel@zakaz.uk.xensource.com>
	<50A4540E.1010601@oracle.com>
	<1333495676.20121119164304@eikelenboom.it>
	<50AB3F9D.4070905@canonical.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Eric Dumazet <eric.dumazet@gmail.com>, Konrad
	Rzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Marcos E. Matsunaga" <Marcos.Matsunaga@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>, ANNIE LI <annie.li@oracle.com>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] compound skb frag pages appearing in start_xmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 08:30 +0000, Stefan Bader wrote:
> >> When I tried to rebase my persistent grant netfront/netback patch on 
> >> latest kernel, netperf/netserver test never succeeded. I did some test 
> >> to find out that v3.6-rc7 works fine, but v3.7-rc1, v3.7-rc2 and 
> >> v3.7-rc4 does not succeed in netperf/netserver test. So I keep my 
> >> persistent grant patch only based on v3.4-rc3 now.
> > 
> >> Konrad thought about commit 6a8ed462f16b8455eec5ae00eb6014159a6721f0 in 
> >> v3.7-rc1, and suggested me to test your debug patch in netfront. This 
> >> BUG_ON happens soon after running the netperf/netserver test case.
> > 
> >> Thanks
> >> Annie
> > 
> > Is there any progression with this bug (rc6 is out the door, so the
> release of 3.7-final seems to be eminent and this bug completely
> cripples any networking with guests) ?
> > 
> 
> +1 on that. I was testing yesterday with a PVM domU running 3.7-rc5 on Xen 4.2
> (but also reported from EC2 running Xen 3.4.3) c with one VCPU. I actually can
> trigger it by just ssh'ing into the domU (from another machine) and then run
> "find /". Output starts to stutter and then stops completely. When this happens
> a new connection still can be made and as long as only shorter output is
> generated the ssh connection is ok. From a dump taken it looks like user-space
> is waiting in some select call (without any warnon I rather won't see the tx path).

Annie, are you still looking into this or shall I?

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 09:21:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 09:21:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tak1S-0001zE-Pr; Tue, 20 Nov 2012 09:21:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tak1Q-0001z4-O7
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 09:21:36 +0000
Received: from [85.158.137.99:38074] by server-12.bemta-3.messagelabs.com id
	8E/5F-22757-B9B4BA05; Tue, 20 Nov 2012 09:21:31 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1353403287!12976935!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23099 invoked from network); 20 Nov 2012 09:21:27 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 09:21:27 -0000
X-IronPort-AV: E=Sophos;i="4.83,284,1352073600"; d="scan'208";a="15896354"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 09:21:27 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 09:21:27 +0000
Message-ID: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefan Bader <stefan.bader@canonical.com>
Date: Tue, 20 Nov 2012 09:21:26 +0000
In-Reply-To: <50AB3F9D.4070905@canonical.com>
References: <1349790467.21847.185.camel@zakaz.uk.xensource.com>
	<1349790863.21172.4406.camel@edumazet-glaptop>
	<1349792241.21847.199.camel@zakaz.uk.xensource.com>
	<1349792847.21172.4479.camel@edumazet-glaptop>
	<1349793630.21847.208.camel@zakaz.uk.xensource.com>
	<1349863984.10070.26.camel@zakaz.uk.xensource.com>
	<1349874598.10070.39.camel@zakaz.uk.xensource.com>
	<748966751.20121010164949@eikelenboom.it>
	<1349942546.14806.7.camel@zakaz.uk.xensource.com>
	<151954917.20121011120004@eikelenboom.it>
	<1349949924.21172.8462.camel@edumazet-glaptop>
	<1349950494.14806.29.camel@zakaz.uk.xensource.com>
	<50A4540E.1010601@oracle.com>
	<1333495676.20121119164304@eikelenboom.it>
	<50AB3F9D.4070905@canonical.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Eric Dumazet <eric.dumazet@gmail.com>, Konrad
	Rzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Marcos E. Matsunaga" <Marcos.Matsunaga@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>, ANNIE LI <annie.li@oracle.com>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] compound skb frag pages appearing in start_xmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 08:30 +0000, Stefan Bader wrote:
> >> When I tried to rebase my persistent grant netfront/netback patch on 
> >> latest kernel, netperf/netserver test never succeeded. I did some test 
> >> to find out that v3.6-rc7 works fine, but v3.7-rc1, v3.7-rc2 and 
> >> v3.7-rc4 does not succeed in netperf/netserver test. So I keep my 
> >> persistent grant patch only based on v3.4-rc3 now.
> > 
> >> Konrad thought about commit 6a8ed462f16b8455eec5ae00eb6014159a6721f0 in 
> >> v3.7-rc1, and suggested me to test your debug patch in netfront. This 
> >> BUG_ON happens soon after running the netperf/netserver test case.
> > 
> >> Thanks
> >> Annie
> > 
> > Is there any progression with this bug (rc6 is out the door, so the
> release of 3.7-final seems to be eminent and this bug completely
> cripples any networking with guests) ?
> > 
> 
> +1 on that. I was testing yesterday with a PVM domU running 3.7-rc5 on Xen 4.2
> (but also reported from EC2 running Xen 3.4.3) c with one VCPU. I actually can
> trigger it by just ssh'ing into the domU (from another machine) and then run
> "find /". Output starts to stutter and then stops completely. When this happens
> a new connection still can be made and as long as only shorter output is
> generated the ssh connection is ok. From a dump taken it looks like user-space
> is waiting in some select call (without any warnon I rather won't see the tx path).

Annie, are you still looking into this or shall I?

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 10:17:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 10:17:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Takt5-0003QG-1S; Tue, 20 Nov 2012 10:17:03 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Takt3-0003QB-Rc
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 10:17:02 +0000
Received: from [85.158.139.83:21067] by server-15.bemta-5.messagelabs.com id
	00/9A-26920-C985BA05; Tue, 20 Nov 2012 10:17:00 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1353406617!22471410!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9600 invoked from network); 20 Nov 2012 10:16:59 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 10:16:59 -0000
X-IronPort-AV: E=Sophos;i="4.83,284,1352073600"; d="scan'208";a="15898241"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 10:16:23 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 10:16:22 +0000
Message-ID: <1353406581.13542.13.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 20 Nov 2012 10:16:21 +0000
In-Reply-To: <50AB4A8602000078000A9E10@nat28.tlf.novell.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
	<1353062895.3499.205.camel@zakaz.uk.xensource.com>
	<ea33a942-7e63-4339-85c6-35935ae5119b@default>
	<50AB4A8602000078000A9E10@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Keir \(Xen.org\)" <keir@xen.org>, KonradWilk <konrad.wilk@oracle.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 08:16 +0000, Jan Beulich wrote:
> >>> On 19.11.12 at 21:53, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> >>  From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> >> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of 
> > existing) hypercall
> > 
> > Hi Ian --
> > 
> >> On Thu, 2012-11-15 at 19:15 +0000, Dan Magenheimer wrote:
> >> > > From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> >> > > Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of 
> > existing) hypercall
> >> > >
> >> > > On Wed, 2012-11-14 at 23:55 +0000, Dan Magenheimer wrote:
> >> > >
> >> > > How does this interact with the feature which lets you create PV guests
> >> > > using only superpages? I believe is something Oracle added and still
> >> > > maintains (Dave added to the CC).
> >> > >
> >> > > Also doesn't this fail to make any sort of guarantee if you are building
> >> > > a 32 bit PV guest, since they require memory under a certain host
> >> > > address limit (160GB IIRC)?
> >> > >
> >> > > Basically neither of those cases benefit from this hypercall at all? I
> >> > > don't know what the usecase for the superpage PV guests is (but I
> >> > > suppose it is important to Oracle, at least). The 32 bit PV guest use
> >> > > case is still a pretty significant one which I think ought to be
> >> > > handled, otherwise any system built on top of this functionality will
> >> > > only work reliably in a subset of cases.
> >> >
> >> > The claim mechanism will not benefit PV superpages.  IIUC, the
> >> > design of the PV superpages will cause a domain launch to fail
> >> > if it requests 10000 superpages but Xen can only successfully
> >> > allocate 9999.  That's already very fragile.  Since the only
> >> > way currently to find out if there are 10000 superpages available
> >> > is to start allocating them, claim can't really help.
> >> 
> >> Well, you could always account the number of free superpages in the
> >> system, which would allow you to cover this case too.
> > 
> > Because of the nature of the buddy allocator (i.e. 4MB chunks are
> > kept separately from 2MB chunks even though a 4MB page contains
> > two 2MB pages), I don't think this is trivial.
> 
> This ought to be as simple as adding respective accounting
> when
> - splitting a chunk in alloc_heap_pages(), crossing the super page
>   size boundary, and
> - merging chunks in free_heap_pages(), crossing the super page
>   size boundary.

That was my first thought too.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 10:17:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 10:17:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Takt5-0003QG-1S; Tue, 20 Nov 2012 10:17:03 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Takt3-0003QB-Rc
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 10:17:02 +0000
Received: from [85.158.139.83:21067] by server-15.bemta-5.messagelabs.com id
	00/9A-26920-C985BA05; Tue, 20 Nov 2012 10:17:00 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1353406617!22471410!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9600 invoked from network); 20 Nov 2012 10:16:59 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 10:16:59 -0000
X-IronPort-AV: E=Sophos;i="4.83,284,1352073600"; d="scan'208";a="15898241"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 10:16:23 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 10:16:22 +0000
Message-ID: <1353406581.13542.13.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 20 Nov 2012 10:16:21 +0000
In-Reply-To: <50AB4A8602000078000A9E10@nat28.tlf.novell.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
	<1353062895.3499.205.camel@zakaz.uk.xensource.com>
	<ea33a942-7e63-4339-85c6-35935ae5119b@default>
	<50AB4A8602000078000A9E10@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Keir \(Xen.org\)" <keir@xen.org>, KonradWilk <konrad.wilk@oracle.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 08:16 +0000, Jan Beulich wrote:
> >>> On 19.11.12 at 21:53, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> >>  From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> >> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of 
> > existing) hypercall
> > 
> > Hi Ian --
> > 
> >> On Thu, 2012-11-15 at 19:15 +0000, Dan Magenheimer wrote:
> >> > > From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> >> > > Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of 
> > existing) hypercall
> >> > >
> >> > > On Wed, 2012-11-14 at 23:55 +0000, Dan Magenheimer wrote:
> >> > >
> >> > > How does this interact with the feature which lets you create PV guests
> >> > > using only superpages? I believe is something Oracle added and still
> >> > > maintains (Dave added to the CC).
> >> > >
> >> > > Also doesn't this fail to make any sort of guarantee if you are building
> >> > > a 32 bit PV guest, since they require memory under a certain host
> >> > > address limit (160GB IIRC)?
> >> > >
> >> > > Basically neither of those cases benefit from this hypercall at all? I
> >> > > don't know what the usecase for the superpage PV guests is (but I
> >> > > suppose it is important to Oracle, at least). The 32 bit PV guest use
> >> > > case is still a pretty significant one which I think ought to be
> >> > > handled, otherwise any system built on top of this functionality will
> >> > > only work reliably in a subset of cases.
> >> >
> >> > The claim mechanism will not benefit PV superpages.  IIUC, the
> >> > design of the PV superpages will cause a domain launch to fail
> >> > if it requests 10000 superpages but Xen can only successfully
> >> > allocate 9999.  That's already very fragile.  Since the only
> >> > way currently to find out if there are 10000 superpages available
> >> > is to start allocating them, claim can't really help.
> >> 
> >> Well, you could always account the number of free superpages in the
> >> system, which would allow you to cover this case too.
> > 
> > Because of the nature of the buddy allocator (i.e. 4MB chunks are
> > kept separately from 2MB chunks even though a 4MB page contains
> > two 2MB pages), I don't think this is trivial.
> 
> This ought to be as simple as adding respective accounting
> when
> - splitting a chunk in alloc_heap_pages(), crossing the super page
>   size boundary, and
> - merging chunks in free_heap_pages(), crossing the super page
>   size boundary.

That was my first thought too.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 11:15:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 11:15:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taln6-0003p1-U3; Tue, 20 Nov 2012 11:14:56 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Taln6-0003ow-6t
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 11:14:56 +0000
Received: from [85.158.138.51:62143] by server-11.bemta-3.messagelabs.com id
	88/0A-19361-F266BA05; Tue, 20 Nov 2012 11:14:55 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1353410094!11012955!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19562 invoked from network); 20 Nov 2012 11:14:54 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-174.messagelabs.com with SMTP;
	20 Nov 2012 11:14:54 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 11:14:53 +0000
Message-Id: <50AB747402000078000A9EA9@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 11:15:48 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part81B07774.1__="
Cc: xiantao.zhang@intel.com
Subject: [Xen-devel] VT-d: clean up map/unmap log messages
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part81B07774.1__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

- printing file name and line number here is pointless
- they are guest related, so should get their log level filter
  accordingly
- include segment numbers and canonicalize number widths

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1289,11 +1289,11 @@ int domain_context_mapping_one(
         {
             if ( pdev->domain !=3D domain )
             {
-                dprintk(XENLOG_INFO VTDPREFIX, "d%d: bdf =3D %x:%x.%x =
owned by d%d!",
-                        domain->domain_id,=20
-                        bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
-                        (pdev->domain)
-                        ? pdev->domain->domain_id : -1);
+                printk(XENLOG_G_INFO VTDPREFIX
+                       "d%d: %04x:%02x:%02x.%u owned by d%d!",
+                       domain->domain_id,
+                       seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
+                       pdev->domain ? pdev->domain->domain_id : -1);
                 res =3D -EINVAL;
             }
         }
@@ -1304,17 +1304,19 @@ int domain_context_mapping_one(
            =20
             if ( cdomain < 0 )
             {
-                dprintk(VTDPREFIX, "d%d: bdf =3D %x:%x.%x mapped, but =
can't find owner!\n",
-                        domain->domain_id,=20
-                        bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
+                printk(XENLOG_G_WARNING VTDPREFIX
+                       "d%d: %04x:%02x:%02x.%u mapped, but can't find =
owner!\n",
+                       domain->domain_id,
+                       seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
                 res =3D -EINVAL;
             }
             else if ( cdomain !=3D domain->domain_id )
             {
-                dprintk(XENLOG_INFO VTDPREFIX, "d%d: bdf =3D %x:%x.%x =
already mapped to d%d!",
-                        domain->domain_id,=20
-                        bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
-                        cdomain);
+                printk(XENLOG_G_INFO VTDPREFIX
+                       "d%d: %04x:%02x:%02x.%u already mapped to d%d!",
+                       domain->domain_id,
+                       seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
+                       cdomain);
                 res =3D -EINVAL;
             }
         }




--=__Part81B07774.1__=
Content-Type: text/plain; name="VT-d-map-messages.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="VT-d-map-messages.patch"

VT-d: clean up map/unmap log messages=0A=0A- printing file name and line =
number here is pointless=0A- they are guest related, so should get their =
log level filter=0A  accordingly=0A- include segment numbers and canonicali=
ze number widths=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A-=
-- a/xen/drivers/passthrough/vtd/iommu.c=0A+++ b/xen/drivers/passthrough/vt=
d/iommu.c=0A@@ -1289,11 +1289,11 @@ int domain_context_mapping_one(=0A     =
    {=0A             if ( pdev->domain !=3D domain )=0A             {=0A-  =
              dprintk(XENLOG_INFO VTDPREFIX, "d%d: bdf =3D %x:%x.%x owned =
by d%d!",=0A-                        domain->domain_id, =0A-               =
         bus, PCI_SLOT(devfn), PCI_FUNC(devfn),=0A-                        =
(pdev->domain)=0A-                        ? pdev->domain->domain_id : =
-1);=0A+                printk(XENLOG_G_INFO VTDPREFIX=0A+                 =
      "d%d: %04x:%02x:%02x.%u owned by d%d!",=0A+                       =
domain->domain_id,=0A+                       seg, bus, PCI_SLOT(devfn), =
PCI_FUNC(devfn),=0A+                       pdev->domain ? pdev->domain->dom=
ain_id : -1);=0A                 res =3D -EINVAL;=0A             }=0A      =
   }=0A@@ -1304,17 +1304,19 @@ int domain_context_mapping_one(=0A          =
   =0A             if ( cdomain < 0 )=0A             {=0A-                =
dprintk(VTDPREFIX, "d%d: bdf =3D %x:%x.%x mapped, but can't find owner!\n",=
=0A-                        domain->domain_id, =0A-                        =
bus, PCI_SLOT(devfn), PCI_FUNC(devfn));=0A+                printk(XENLOG_G_=
WARNING VTDPREFIX=0A+                       "d%d: %04x:%02x:%02x.%u =
mapped, but can't find owner!\n",=0A+                       domain->domain_=
id,=0A+                       seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));=
=0A                 res =3D -EINVAL;=0A             }=0A             else =
if ( cdomain !=3D domain->domain_id )=0A             {=0A-                =
dprintk(XENLOG_INFO VTDPREFIX, "d%d: bdf =3D %x:%x.%x already mapped to =
d%d!",=0A-                        domain->domain_id, =0A-                  =
      bus, PCI_SLOT(devfn), PCI_FUNC(devfn),=0A-                        =
cdomain);=0A+                printk(XENLOG_G_INFO VTDPREFIX=0A+            =
           "d%d: %04x:%02x:%02x.%u already mapped to d%d!",=0A+            =
           domain->domain_id,=0A+                       seg, bus, =
PCI_SLOT(devfn), PCI_FUNC(devfn),=0A+                       cdomain);=0A   =
              res =3D -EINVAL;=0A             }=0A         }=0A
--=__Part81B07774.1__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part81B07774.1__=--


From xen-devel-bounces@lists.xen.org Tue Nov 20 11:15:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 11:15:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taln6-0003p1-U3; Tue, 20 Nov 2012 11:14:56 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Taln6-0003ow-6t
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 11:14:56 +0000
Received: from [85.158.138.51:62143] by server-11.bemta-3.messagelabs.com id
	88/0A-19361-F266BA05; Tue, 20 Nov 2012 11:14:55 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1353410094!11012955!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19562 invoked from network); 20 Nov 2012 11:14:54 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-174.messagelabs.com with SMTP;
	20 Nov 2012 11:14:54 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 11:14:53 +0000
Message-Id: <50AB747402000078000A9EA9@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 11:15:48 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part81B07774.1__="
Cc: xiantao.zhang@intel.com
Subject: [Xen-devel] VT-d: clean up map/unmap log messages
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part81B07774.1__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

- printing file name and line number here is pointless
- they are guest related, so should get their log level filter
  accordingly
- include segment numbers and canonicalize number widths

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1289,11 +1289,11 @@ int domain_context_mapping_one(
         {
             if ( pdev->domain !=3D domain )
             {
-                dprintk(XENLOG_INFO VTDPREFIX, "d%d: bdf =3D %x:%x.%x =
owned by d%d!",
-                        domain->domain_id,=20
-                        bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
-                        (pdev->domain)
-                        ? pdev->domain->domain_id : -1);
+                printk(XENLOG_G_INFO VTDPREFIX
+                       "d%d: %04x:%02x:%02x.%u owned by d%d!",
+                       domain->domain_id,
+                       seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
+                       pdev->domain ? pdev->domain->domain_id : -1);
                 res =3D -EINVAL;
             }
         }
@@ -1304,17 +1304,19 @@ int domain_context_mapping_one(
            =20
             if ( cdomain < 0 )
             {
-                dprintk(VTDPREFIX, "d%d: bdf =3D %x:%x.%x mapped, but =
can't find owner!\n",
-                        domain->domain_id,=20
-                        bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
+                printk(XENLOG_G_WARNING VTDPREFIX
+                       "d%d: %04x:%02x:%02x.%u mapped, but can't find =
owner!\n",
+                       domain->domain_id,
+                       seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
                 res =3D -EINVAL;
             }
             else if ( cdomain !=3D domain->domain_id )
             {
-                dprintk(XENLOG_INFO VTDPREFIX, "d%d: bdf =3D %x:%x.%x =
already mapped to d%d!",
-                        domain->domain_id,=20
-                        bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
-                        cdomain);
+                printk(XENLOG_G_INFO VTDPREFIX
+                       "d%d: %04x:%02x:%02x.%u already mapped to d%d!",
+                       domain->domain_id,
+                       seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
+                       cdomain);
                 res =3D -EINVAL;
             }
         }




--=__Part81B07774.1__=
Content-Type: text/plain; name="VT-d-map-messages.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="VT-d-map-messages.patch"

VT-d: clean up map/unmap log messages=0A=0A- printing file name and line =
number here is pointless=0A- they are guest related, so should get their =
log level filter=0A  accordingly=0A- include segment numbers and canonicali=
ze number widths=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A-=
-- a/xen/drivers/passthrough/vtd/iommu.c=0A+++ b/xen/drivers/passthrough/vt=
d/iommu.c=0A@@ -1289,11 +1289,11 @@ int domain_context_mapping_one(=0A     =
    {=0A             if ( pdev->domain !=3D domain )=0A             {=0A-  =
              dprintk(XENLOG_INFO VTDPREFIX, "d%d: bdf =3D %x:%x.%x owned =
by d%d!",=0A-                        domain->domain_id, =0A-               =
         bus, PCI_SLOT(devfn), PCI_FUNC(devfn),=0A-                        =
(pdev->domain)=0A-                        ? pdev->domain->domain_id : =
-1);=0A+                printk(XENLOG_G_INFO VTDPREFIX=0A+                 =
      "d%d: %04x:%02x:%02x.%u owned by d%d!",=0A+                       =
domain->domain_id,=0A+                       seg, bus, PCI_SLOT(devfn), =
PCI_FUNC(devfn),=0A+                       pdev->domain ? pdev->domain->dom=
ain_id : -1);=0A                 res =3D -EINVAL;=0A             }=0A      =
   }=0A@@ -1304,17 +1304,19 @@ int domain_context_mapping_one(=0A          =
   =0A             if ( cdomain < 0 )=0A             {=0A-                =
dprintk(VTDPREFIX, "d%d: bdf =3D %x:%x.%x mapped, but can't find owner!\n",=
=0A-                        domain->domain_id, =0A-                        =
bus, PCI_SLOT(devfn), PCI_FUNC(devfn));=0A+                printk(XENLOG_G_=
WARNING VTDPREFIX=0A+                       "d%d: %04x:%02x:%02x.%u =
mapped, but can't find owner!\n",=0A+                       domain->domain_=
id,=0A+                       seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));=
=0A                 res =3D -EINVAL;=0A             }=0A             else =
if ( cdomain !=3D domain->domain_id )=0A             {=0A-                =
dprintk(XENLOG_INFO VTDPREFIX, "d%d: bdf =3D %x:%x.%x already mapped to =
d%d!",=0A-                        domain->domain_id, =0A-                  =
      bus, PCI_SLOT(devfn), PCI_FUNC(devfn),=0A-                        =
cdomain);=0A+                printk(XENLOG_G_INFO VTDPREFIX=0A+            =
           "d%d: %04x:%02x:%02x.%u already mapped to d%d!",=0A+            =
           domain->domain_id,=0A+                       seg, bus, =
PCI_SLOT(devfn), PCI_FUNC(devfn),=0A+                       cdomain);=0A   =
              res =3D -EINVAL;=0A             }=0A         }=0A
--=__Part81B07774.1__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part81B07774.1__=--


From xen-devel-bounces@lists.xen.org Tue Nov 20 11:38:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 11:38:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tam9n-00040a-1q; Tue, 20 Nov 2012 11:38:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tam9l-00040V-Rx
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 11:38:22 +0000
Received: from [193.109.254.147:3665] by server-8.bemta-14.messagelabs.com id
	54/B6-05026-DAB6BA05; Tue, 20 Nov 2012 11:38:21 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1353411489!9513066!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26172 invoked from network); 20 Nov 2012 11:38:20 -0000
Received: from unknown (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 11:38:20 -0000
X-IronPort-AV: E=Sophos;i="4.83,285,1352073600"; d="scan'208";a="15901304"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 11:36:54 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 11:36:54 +0000
Message-ID: <1353411413.13542.31.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefan Bader <stefan.bader@canonical.com>
Date: Tue, 20 Nov 2012 11:36:53 +0000
In-Reply-To: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
References: <1349790467.21847.185.camel@zakaz.uk.xensource.com>
	<1349790863.21172.4406.camel@edumazet-glaptop>
	<1349792241.21847.199.camel@zakaz.uk.xensource.com>
	<1349792847.21172.4479.camel@edumazet-glaptop>
	<1349793630.21847.208.camel@zakaz.uk.xensource.com>
	<1349863984.10070.26.camel@zakaz.uk.xensource.com>
	<1349874598.10070.39.camel@zakaz.uk.xensource.com>
	<748966751.20121010164949@eikelenboom.it>
	<1349942546.14806.7.camel@zakaz.uk.xensource.com>
	<151954917.20121011120004@eikelenboom.it>
	<1349949924.21172.8462.camel@edumazet-glaptop>
	<1349950494.14806.29.camel@zakaz.uk.xensource.com>
	<50A4540E.1010601@oracle.com>	<1333495676.20121119164304@eikelenboom.it>
	<50AB3F9D.4070905@canonical.com>
	<1353403286.18229.159.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>, ANNIE
	LI <annie.li@oracle.com>, xen-devel <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"Marcos E. Matsunaga" <Marcos.Matsunaga@oracle.com>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] compound skb frag pages appearing in start_xmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 09:21 +0000, Ian Campbell wrote:
> On Tue, 2012-11-20 at 08:30 +0000, Stefan Bader wrote:
> > >> When I tried to rebase my persistent grant netfront/netback patch on 
> > >> latest kernel, netperf/netserver test never succeeded. I did some test 
> > >> to find out that v3.6-rc7 works fine, but v3.7-rc1, v3.7-rc2 and 
> > >> v3.7-rc4 does not succeed in netperf/netserver test. So I keep my 
> > >> persistent grant patch only based on v3.4-rc3 now.
> > > 
> > >> Konrad thought about commit 6a8ed462f16b8455eec5ae00eb6014159a6721f0 in 
> > >> v3.7-rc1, and suggested me to test your debug patch in netfront. This 
> > >> BUG_ON happens soon after running the netperf/netserver test case.
> > > 
> > >> Thanks
> > >> Annie
> > > 
> > > Is there any progression with this bug (rc6 is out the door, so the
> > release of 3.7-final seems to be eminent and this bug completely
> > cripples any networking with guests) ?
> > > 
> > 
> > +1 on that. I was testing yesterday with a PVM domU running 3.7-rc5 on Xen 4.2
> > (but also reported from EC2 running Xen 3.4.3) c with one VCPU. I actually can
> > trigger it by just ssh'ing into the domU (from another machine) and then run
> > "find /". Output starts to stutter and then stops completely. When this happens
> > a new connection still can be made and as long as only shorter output is
> > generated the ssh connection is ok. From a dump taken it looks like user-space
> > is waiting in some select call (without any warnon I rather won't see the tx path).
> 
> Annie, are you still looking into this or shall I?

I'll assume that silence == No. Will post a patch shortly.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 11:38:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 11:38:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tam9n-00040a-1q; Tue, 20 Nov 2012 11:38:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tam9l-00040V-Rx
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 11:38:22 +0000
Received: from [193.109.254.147:3665] by server-8.bemta-14.messagelabs.com id
	54/B6-05026-DAB6BA05; Tue, 20 Nov 2012 11:38:21 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1353411489!9513066!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26172 invoked from network); 20 Nov 2012 11:38:20 -0000
Received: from unknown (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 11:38:20 -0000
X-IronPort-AV: E=Sophos;i="4.83,285,1352073600"; d="scan'208";a="15901304"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 11:36:54 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 11:36:54 +0000
Message-ID: <1353411413.13542.31.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefan Bader <stefan.bader@canonical.com>
Date: Tue, 20 Nov 2012 11:36:53 +0000
In-Reply-To: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
References: <1349790467.21847.185.camel@zakaz.uk.xensource.com>
	<1349790863.21172.4406.camel@edumazet-glaptop>
	<1349792241.21847.199.camel@zakaz.uk.xensource.com>
	<1349792847.21172.4479.camel@edumazet-glaptop>
	<1349793630.21847.208.camel@zakaz.uk.xensource.com>
	<1349863984.10070.26.camel@zakaz.uk.xensource.com>
	<1349874598.10070.39.camel@zakaz.uk.xensource.com>
	<748966751.20121010164949@eikelenboom.it>
	<1349942546.14806.7.camel@zakaz.uk.xensource.com>
	<151954917.20121011120004@eikelenboom.it>
	<1349949924.21172.8462.camel@edumazet-glaptop>
	<1349950494.14806.29.camel@zakaz.uk.xensource.com>
	<50A4540E.1010601@oracle.com>	<1333495676.20121119164304@eikelenboom.it>
	<50AB3F9D.4070905@canonical.com>
	<1353403286.18229.159.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>, ANNIE
	LI <annie.li@oracle.com>, xen-devel <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"Marcos E. Matsunaga" <Marcos.Matsunaga@oracle.com>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] compound skb frag pages appearing in start_xmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 09:21 +0000, Ian Campbell wrote:
> On Tue, 2012-11-20 at 08:30 +0000, Stefan Bader wrote:
> > >> When I tried to rebase my persistent grant netfront/netback patch on 
> > >> latest kernel, netperf/netserver test never succeeded. I did some test 
> > >> to find out that v3.6-rc7 works fine, but v3.7-rc1, v3.7-rc2 and 
> > >> v3.7-rc4 does not succeed in netperf/netserver test. So I keep my 
> > >> persistent grant patch only based on v3.4-rc3 now.
> > > 
> > >> Konrad thought about commit 6a8ed462f16b8455eec5ae00eb6014159a6721f0 in 
> > >> v3.7-rc1, and suggested me to test your debug patch in netfront. This 
> > >> BUG_ON happens soon after running the netperf/netserver test case.
> > > 
> > >> Thanks
> > >> Annie
> > > 
> > > Is there any progression with this bug (rc6 is out the door, so the
> > release of 3.7-final seems to be eminent and this bug completely
> > cripples any networking with guests) ?
> > > 
> > 
> > +1 on that. I was testing yesterday with a PVM domU running 3.7-rc5 on Xen 4.2
> > (but also reported from EC2 running Xen 3.4.3) c with one VCPU. I actually can
> > trigger it by just ssh'ing into the domU (from another machine) and then run
> > "find /". Output starts to stutter and then stops completely. When this happens
> > a new connection still can be made and as long as only shorter output is
> > generated the ssh connection is ok. From a dump taken it looks like user-space
> > is waiting in some select call (without any warnon I rather won't see the tx path).
> 
> Annie, are you still looking into this or shall I?

I'll assume that silence == No. Will post a patch shortly.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 11:40:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 11:40:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TamBZ-00045l-Ic; Tue, 20 Nov 2012 11:40:13 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TamBX-00045a-Js
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 11:40:11 +0000
Received: from [193.109.254.147:49809] by server-14.bemta-14.messagelabs.com
	id B4/E5-14517-A1C6BA05; Tue, 20 Nov 2012 11:40:10 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1353411607!8903556!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ4OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28144 invoked from network); 20 Nov 2012 11:40:09 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-4.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 11:40:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,285,1352073600"; d="scan'208";a="45145457"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 11:40:07 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 06:40:06 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TamBS-0000C1-Ep;
	Tue, 20 Nov 2012 11:40:06 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: netdev@vger.kernel.org
Date: Tue, 20 Nov 2012 11:40:06 +0000
Message-ID: <1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.2.5
In-Reply-To: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>,
	Sander Eikelenboom <linux@eikelenboom.it>, ANNIE LI <annie.li@oracle.com>,
	Stefan Bader <stefan.bader@canonical.com>, xen-devel@lists.xen.org,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	Eric Dumazet <edumazet@google.com>
Subject: [Xen-devel] [PATCH] xen/netfront: handle compound page fragments on
	transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

An SKB paged fragment can consist of a compound page with order > 0.
However the netchannel protocol deals only in PAGE_SIZE frames.

Handle this in xennet_make_frags by iterating over the frames which
make up the page.

This is the netfront equivalent to 6a8ed462f16b for netback.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: netdev@vger.kernel.org
Cc: xen-devel@lists.xen.org
Cc: Eric Dumazet <edumazet@google.com>
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
Cc: ANNIE LI <annie.li@oracle.com>
Cc: Sander Eikelenboom <linux@eikelenboom.it>
Cc: Stefan Bader <stefan.bader@canonical.com>
---
 drivers/net/xen-netfront.c |   58 +++++++++++++++++++++++++++++++++----------
 1 files changed, 44 insertions(+), 14 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index caa0110..a12b99a 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -452,24 +452,54 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
 	/* Grant backend access to each skb fragment page. */
 	for (i = 0; i < frags; i++) {
 		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
+		struct page *page = skb_frag_page(frag);
+		unsigned long size = skb_frag_size(frag);
+		unsigned long offset = frag->page_offset;
 
-		tx->flags |= XEN_NETTXF_more_data;
+		/* Data must not cross a page boundary. */
+		BUG_ON(size + offset > PAGE_SIZE<<compound_order(page));
 
-		id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
-		np->tx_skbs[id].skb = skb_get(skb);
-		tx = RING_GET_REQUEST(&np->tx, prod++);
-		tx->id = id;
-		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
-		BUG_ON((signed short)ref < 0);
+		/* Skip unused frames from start of page */
+		page += offset >> PAGE_SHIFT;
+		offset &= ~PAGE_MASK;
 
-		mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
-		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
-						mfn, GNTMAP_readonly);
+		while (size > 0) {
+			unsigned long bytes;
 
-		tx->gref = np->grant_tx_ref[id] = ref;
-		tx->offset = frag->page_offset;
-		tx->size = skb_frag_size(frag);
-		tx->flags = 0;
+			BUG_ON(offset >= PAGE_SIZE);
+
+			bytes = PAGE_SIZE - offset;
+			if (bytes > size)
+				bytes = size;
+
+			tx->flags |= XEN_NETTXF_more_data;
+
+			id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
+			np->tx_skbs[id].skb = skb_get(skb);
+			tx = RING_GET_REQUEST(&np->tx, prod++);
+			tx->id = id;
+			ref = gnttab_claim_grant_reference(&np->gref_tx_head);
+			BUG_ON((signed short)ref < 0);
+
+			mfn = pfn_to_mfn(page_to_pfn(page));
+			gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
+							mfn, GNTMAP_readonly);
+
+			tx->gref = np->grant_tx_ref[id] = ref;
+			tx->offset = offset;
+			tx->size = bytes;
+			tx->flags = 0;
+
+			offset += bytes;
+			size -= bytes;
+
+			/* Next frame */
+			if (offset == PAGE_SIZE && size) {
+				BUG_ON(!PageCompound(page));
+				page++;
+				offset = 0;
+			}
+		}
 	}
 
 	np->tx.req_prod_pvt = prod;
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 11:40:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 11:40:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TamBZ-00045l-Ic; Tue, 20 Nov 2012 11:40:13 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TamBX-00045a-Js
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 11:40:11 +0000
Received: from [193.109.254.147:49809] by server-14.bemta-14.messagelabs.com
	id B4/E5-14517-A1C6BA05; Tue, 20 Nov 2012 11:40:10 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1353411607!8903556!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ4OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28144 invoked from network); 20 Nov 2012 11:40:09 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-4.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 11:40:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,285,1352073600"; d="scan'208";a="45145457"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 11:40:07 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 06:40:06 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TamBS-0000C1-Ep;
	Tue, 20 Nov 2012 11:40:06 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: netdev@vger.kernel.org
Date: Tue, 20 Nov 2012 11:40:06 +0000
Message-ID: <1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.2.5
In-Reply-To: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>,
	Sander Eikelenboom <linux@eikelenboom.it>, ANNIE LI <annie.li@oracle.com>,
	Stefan Bader <stefan.bader@canonical.com>, xen-devel@lists.xen.org,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	Eric Dumazet <edumazet@google.com>
Subject: [Xen-devel] [PATCH] xen/netfront: handle compound page fragments on
	transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

An SKB paged fragment can consist of a compound page with order > 0.
However the netchannel protocol deals only in PAGE_SIZE frames.

Handle this in xennet_make_frags by iterating over the frames which
make up the page.

This is the netfront equivalent to 6a8ed462f16b for netback.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: netdev@vger.kernel.org
Cc: xen-devel@lists.xen.org
Cc: Eric Dumazet <edumazet@google.com>
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
Cc: ANNIE LI <annie.li@oracle.com>
Cc: Sander Eikelenboom <linux@eikelenboom.it>
Cc: Stefan Bader <stefan.bader@canonical.com>
---
 drivers/net/xen-netfront.c |   58 +++++++++++++++++++++++++++++++++----------
 1 files changed, 44 insertions(+), 14 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index caa0110..a12b99a 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -452,24 +452,54 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
 	/* Grant backend access to each skb fragment page. */
 	for (i = 0; i < frags; i++) {
 		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
+		struct page *page = skb_frag_page(frag);
+		unsigned long size = skb_frag_size(frag);
+		unsigned long offset = frag->page_offset;
 
-		tx->flags |= XEN_NETTXF_more_data;
+		/* Data must not cross a page boundary. */
+		BUG_ON(size + offset > PAGE_SIZE<<compound_order(page));
 
-		id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
-		np->tx_skbs[id].skb = skb_get(skb);
-		tx = RING_GET_REQUEST(&np->tx, prod++);
-		tx->id = id;
-		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
-		BUG_ON((signed short)ref < 0);
+		/* Skip unused frames from start of page */
+		page += offset >> PAGE_SHIFT;
+		offset &= ~PAGE_MASK;
 
-		mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
-		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
-						mfn, GNTMAP_readonly);
+		while (size > 0) {
+			unsigned long bytes;
 
-		tx->gref = np->grant_tx_ref[id] = ref;
-		tx->offset = frag->page_offset;
-		tx->size = skb_frag_size(frag);
-		tx->flags = 0;
+			BUG_ON(offset >= PAGE_SIZE);
+
+			bytes = PAGE_SIZE - offset;
+			if (bytes > size)
+				bytes = size;
+
+			tx->flags |= XEN_NETTXF_more_data;
+
+			id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
+			np->tx_skbs[id].skb = skb_get(skb);
+			tx = RING_GET_REQUEST(&np->tx, prod++);
+			tx->id = id;
+			ref = gnttab_claim_grant_reference(&np->gref_tx_head);
+			BUG_ON((signed short)ref < 0);
+
+			mfn = pfn_to_mfn(page_to_pfn(page));
+			gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
+							mfn, GNTMAP_readonly);
+
+			tx->gref = np->grant_tx_ref[id] = ref;
+			tx->offset = offset;
+			tx->size = bytes;
+			tx->flags = 0;
+
+			offset += bytes;
+			size -= bytes;
+
+			/* Next frame */
+			if (offset == PAGE_SIZE && size) {
+				BUG_ON(!PageCompound(page));
+				page++;
+				offset = 0;
+			}
+		}
 	}
 
 	np->tx.req_prod_pvt = prod;
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 12:27:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 12:27:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TamvB-0004YN-JF; Tue, 20 Nov 2012 12:27:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TamvA-0004YI-Ko
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 12:27:20 +0000
Received: from [193.109.254.147:48263] by server-11.bemta-14.messagelabs.com
	id 7A/1E-29027-8277BA05; Tue, 20 Nov 2012 12:27:20 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353414439!8983298!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31696 invoked from network); 20 Nov 2012 12:27:19 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-27.messagelabs.com with SMTP;
	20 Nov 2012 12:27:19 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 12:27:18 +0000
Message-Id: <50AB856D02000078000A9EFD@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 12:28:13 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <ian.campbell@citrix.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
In-Reply-To: <1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>, netdev@vger.kernel.org,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	xen-devel@lists.xen.org, Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 12:40, Ian Campbell <ian.campbell@citrix.com> wrote:
> An SKB paged fragment can consist of a compound page with order > 0.
> However the netchannel protocol deals only in PAGE_SIZE frames.
> 
> Handle this in xennet_make_frags by iterating over the frames which
> make up the page.
> 
> This is the netfront equivalent to 6a8ed462f16b for netback.

Wouldn't you need to be at least a little more conservative here
with respect to resource use: I realize that get_id_from_freelist()
return values were never checked, and failure of
gnttab_claim_grant_reference() was always dealt with via
BUG_ON(), but considering that netfront_tx_slot_available()
doesn't account for compound page fragments, I think this (lack
of) error handling needs improvement in the course of the
change here (regardless of - I think - someone having said that
usually the sum of all pages referenced from an skb's fragments
would not exceed MAX_SKB_FRAGS - "usually" just isn't enough
imo).

Jan

> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: netdev@vger.kernel.org 
> Cc: xen-devel@lists.xen.org 
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
> Cc: ANNIE LI <annie.li@oracle.com>
> Cc: Sander Eikelenboom <linux@eikelenboom.it>
> Cc: Stefan Bader <stefan.bader@canonical.com>
> ---
>  drivers/net/xen-netfront.c |   58 +++++++++++++++++++++++++++++++++----------
>  1 files changed, 44 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index caa0110..a12b99a 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -452,24 +452,54 @@ static void xennet_make_frags(struct sk_buff *skb, 
> struct net_device *dev,
>  	/* Grant backend access to each skb fragment page. */
>  	for (i = 0; i < frags; i++) {
>  		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
> +		struct page *page = skb_frag_page(frag);
> +		unsigned long size = skb_frag_size(frag);
> +		unsigned long offset = frag->page_offset;
>  
> -		tx->flags |= XEN_NETTXF_more_data;
> +		/* Data must not cross a page boundary. */
> +		BUG_ON(size + offset > PAGE_SIZE<<compound_order(page));
>  
> -		id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> -		np->tx_skbs[id].skb = skb_get(skb);
> -		tx = RING_GET_REQUEST(&np->tx, prod++);
> -		tx->id = id;
> -		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
> -		BUG_ON((signed short)ref < 0);
> +		/* Skip unused frames from start of page */
> +		page += offset >> PAGE_SHIFT;
> +		offset &= ~PAGE_MASK;
>  
> -		mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
> -		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> -						mfn, GNTMAP_readonly);
> +		while (size > 0) {
> +			unsigned long bytes;
>  
> -		tx->gref = np->grant_tx_ref[id] = ref;
> -		tx->offset = frag->page_offset;
> -		tx->size = skb_frag_size(frag);
> -		tx->flags = 0;
> +			BUG_ON(offset >= PAGE_SIZE);
> +
> +			bytes = PAGE_SIZE - offset;
> +			if (bytes > size)
> +				bytes = size;
> +
> +			tx->flags |= XEN_NETTXF_more_data;
> +
> +			id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> +			np->tx_skbs[id].skb = skb_get(skb);
> +			tx = RING_GET_REQUEST(&np->tx, prod++);
> +			tx->id = id;
> +			ref = gnttab_claim_grant_reference(&np->gref_tx_head);
> +			BUG_ON((signed short)ref < 0);
> +
> +			mfn = pfn_to_mfn(page_to_pfn(page));
> +			gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> +							mfn, GNTMAP_readonly);
> +
> +			tx->gref = np->grant_tx_ref[id] = ref;
> +			tx->offset = offset;
> +			tx->size = bytes;
> +			tx->flags = 0;
> +
> +			offset += bytes;
> +			size -= bytes;
> +
> +			/* Next frame */
> +			if (offset == PAGE_SIZE && size) {
> +				BUG_ON(!PageCompound(page));
> +				page++;
> +				offset = 0;
> +			}
> +		}
>  	}
>  
>  	np->tx.req_prod_pvt = prod;
> -- 
> 1.7.2.5
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 12:27:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 12:27:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TamvB-0004YN-JF; Tue, 20 Nov 2012 12:27:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TamvA-0004YI-Ko
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 12:27:20 +0000
Received: from [193.109.254.147:48263] by server-11.bemta-14.messagelabs.com
	id 7A/1E-29027-8277BA05; Tue, 20 Nov 2012 12:27:20 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353414439!8983298!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31696 invoked from network); 20 Nov 2012 12:27:19 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-27.messagelabs.com with SMTP;
	20 Nov 2012 12:27:19 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 12:27:18 +0000
Message-Id: <50AB856D02000078000A9EFD@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 12:28:13 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <ian.campbell@citrix.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
In-Reply-To: <1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>, netdev@vger.kernel.org,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	xen-devel@lists.xen.org, Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 12:40, Ian Campbell <ian.campbell@citrix.com> wrote:
> An SKB paged fragment can consist of a compound page with order > 0.
> However the netchannel protocol deals only in PAGE_SIZE frames.
> 
> Handle this in xennet_make_frags by iterating over the frames which
> make up the page.
> 
> This is the netfront equivalent to 6a8ed462f16b for netback.

Wouldn't you need to be at least a little more conservative here
with respect to resource use: I realize that get_id_from_freelist()
return values were never checked, and failure of
gnttab_claim_grant_reference() was always dealt with via
BUG_ON(), but considering that netfront_tx_slot_available()
doesn't account for compound page fragments, I think this (lack
of) error handling needs improvement in the course of the
change here (regardless of - I think - someone having said that
usually the sum of all pages referenced from an skb's fragments
would not exceed MAX_SKB_FRAGS - "usually" just isn't enough
imo).

Jan

> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: netdev@vger.kernel.org 
> Cc: xen-devel@lists.xen.org 
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
> Cc: ANNIE LI <annie.li@oracle.com>
> Cc: Sander Eikelenboom <linux@eikelenboom.it>
> Cc: Stefan Bader <stefan.bader@canonical.com>
> ---
>  drivers/net/xen-netfront.c |   58 +++++++++++++++++++++++++++++++++----------
>  1 files changed, 44 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index caa0110..a12b99a 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -452,24 +452,54 @@ static void xennet_make_frags(struct sk_buff *skb, 
> struct net_device *dev,
>  	/* Grant backend access to each skb fragment page. */
>  	for (i = 0; i < frags; i++) {
>  		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
> +		struct page *page = skb_frag_page(frag);
> +		unsigned long size = skb_frag_size(frag);
> +		unsigned long offset = frag->page_offset;
>  
> -		tx->flags |= XEN_NETTXF_more_data;
> +		/* Data must not cross a page boundary. */
> +		BUG_ON(size + offset > PAGE_SIZE<<compound_order(page));
>  
> -		id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> -		np->tx_skbs[id].skb = skb_get(skb);
> -		tx = RING_GET_REQUEST(&np->tx, prod++);
> -		tx->id = id;
> -		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
> -		BUG_ON((signed short)ref < 0);
> +		/* Skip unused frames from start of page */
> +		page += offset >> PAGE_SHIFT;
> +		offset &= ~PAGE_MASK;
>  
> -		mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
> -		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> -						mfn, GNTMAP_readonly);
> +		while (size > 0) {
> +			unsigned long bytes;
>  
> -		tx->gref = np->grant_tx_ref[id] = ref;
> -		tx->offset = frag->page_offset;
> -		tx->size = skb_frag_size(frag);
> -		tx->flags = 0;
> +			BUG_ON(offset >= PAGE_SIZE);
> +
> +			bytes = PAGE_SIZE - offset;
> +			if (bytes > size)
> +				bytes = size;
> +
> +			tx->flags |= XEN_NETTXF_more_data;
> +
> +			id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> +			np->tx_skbs[id].skb = skb_get(skb);
> +			tx = RING_GET_REQUEST(&np->tx, prod++);
> +			tx->id = id;
> +			ref = gnttab_claim_grant_reference(&np->gref_tx_head);
> +			BUG_ON((signed short)ref < 0);
> +
> +			mfn = pfn_to_mfn(page_to_pfn(page));
> +			gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> +							mfn, GNTMAP_readonly);
> +
> +			tx->gref = np->grant_tx_ref[id] = ref;
> +			tx->offset = offset;
> +			tx->size = bytes;
> +			tx->flags = 0;
> +
> +			offset += bytes;
> +			size -= bytes;
> +
> +			/* Next frame */
> +			if (offset == PAGE_SIZE && size) {
> +				BUG_ON(!PageCompound(page));
> +				page++;
> +				offset = 0;
> +			}
> +		}
>  	}
>  
>  	np->tx.req_prod_pvt = prod;
> -- 
> 1.7.2.5
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 13:31:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 13:31:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tanuq-0004r4-2z; Tue, 20 Nov 2012 13:31:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <stefan.bader@canonical.com>) id 1Tanuo-0004qz-G0
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 13:31:02 +0000
Received: from [85.158.139.83:61076] by server-2.bemta-5.messagelabs.com id
	99/DA-04892-5168BA05; Tue, 20 Nov 2012 13:31:01 +0000
X-Env-Sender: stefan.bader@canonical.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353418260!19849030!1
X-Originating-IP: [91.189.89.112]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25062 invoked from network); 20 Nov 2012 13:31:00 -0000
Received: from youngberry.canonical.com (HELO youngberry.canonical.com)
	(91.189.89.112) by server-8.tower-182.messagelabs.com with SMTP;
	20 Nov 2012 13:31:00 -0000
Received: from p5b2e316f.dip.t-dialin.net ([91.46.49.111] helo=[192.168.2.5])
	by youngberry.canonical.com with esmtpsa
	(TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71)
	(envelope-from <stefan.bader@canonical.com>)
	id 1Tanuh-00035f-Vo; Tue, 20 Nov 2012 13:30:56 +0000
Message-ID: <50AB860E.3090106@canonical.com>
Date: Tue, 20 Nov 2012 14:30:54 +0100
From: Stefan Bader <stefan.bader@canonical.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <ian.campbell@citrix.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
In-Reply-To: <1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
X-Enigmail-Version: 1.4.5
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>, netdev@vger.kernel.org,
	ANNIE LI <annie.li@oracle.com>, xen-devel@lists.xen.org,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
	fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6421669734990348547=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============6421669734990348547==
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature";
 boundary="------------enig31733BF0961A95AEC5CF5C5D"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig31733BF0961A95AEC5CF5C5D
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Aside from Jans comments about error handling, I tried below patch and it=
 seems
to solve the problem with transfers out of the domU for me (though only s=
hallow
testing done, otoh 5 times is more than getting stuck the first time).

-Stefan

On 20.11.2012 12:40, Ian Campbell wrote:
> An SKB paged fragment can consist of a compound page with order > 0.
> However the netchannel protocol deals only in PAGE_SIZE frames.
>=20
> Handle this in xennet_make_frags by iterating over the frames which
> make up the page.
>=20
> This is the netfront equivalent to 6a8ed462f16b for netback.
>=20
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: netdev@vger.kernel.org
> Cc: xen-devel@lists.xen.org
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
> Cc: ANNIE LI <annie.li@oracle.com>
> Cc: Sander Eikelenboom <linux@eikelenboom.it>
> Cc: Stefan Bader <stefan.bader@canonical.com>
Tested-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>  drivers/net/xen-netfront.c |   58 +++++++++++++++++++++++++++++++++---=
-------
>  1 files changed, 44 insertions(+), 14 deletions(-)
>=20
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index caa0110..a12b99a 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -452,24 +452,54 @@ static void xennet_make_frags(struct sk_buff *skb=
, struct net_device *dev,
>  	/* Grant backend access to each skb fragment page. */
>  	for (i =3D 0; i < frags; i++) {
>  		skb_frag_t *frag =3D skb_shinfo(skb)->frags + i;
> +		struct page *page =3D skb_frag_page(frag);
> +		unsigned long size =3D skb_frag_size(frag);
> +		unsigned long offset =3D frag->page_offset;
> =20
> -		tx->flags |=3D XEN_NETTXF_more_data;
> +		/* Data must not cross a page boundary. */
> +		BUG_ON(size + offset > PAGE_SIZE<<compound_order(page));
> =20
> -		id =3D get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> -		np->tx_skbs[id].skb =3D skb_get(skb);
> -		tx =3D RING_GET_REQUEST(&np->tx, prod++);
> -		tx->id =3D id;
> -		ref =3D gnttab_claim_grant_reference(&np->gref_tx_head);
> -		BUG_ON((signed short)ref < 0);
> +		/* Skip unused frames from start of page */
> +		page +=3D offset >> PAGE_SHIFT;
> +		offset &=3D ~PAGE_MASK;
> =20
> -		mfn =3D pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
> -		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> -						mfn, GNTMAP_readonly);
> +		while (size > 0) {
> +			unsigned long bytes;
> =20
> -		tx->gref =3D np->grant_tx_ref[id] =3D ref;
> -		tx->offset =3D frag->page_offset;
> -		tx->size =3D skb_frag_size(frag);
> -		tx->flags =3D 0;
> +			BUG_ON(offset >=3D PAGE_SIZE);
> +
> +			bytes =3D PAGE_SIZE - offset;
> +			if (bytes > size)
> +				bytes =3D size;
> +
> +			tx->flags |=3D XEN_NETTXF_more_data;
> +
> +			id =3D get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> +			np->tx_skbs[id].skb =3D skb_get(skb);
> +			tx =3D RING_GET_REQUEST(&np->tx, prod++);
> +			tx->id =3D id;
> +			ref =3D gnttab_claim_grant_reference(&np->gref_tx_head);
> +			BUG_ON((signed short)ref < 0);
> +
> +			mfn =3D pfn_to_mfn(page_to_pfn(page));
> +			gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> +							mfn, GNTMAP_readonly);
> +
> +			tx->gref =3D np->grant_tx_ref[id] =3D ref;
> +			tx->offset =3D offset;
> +			tx->size =3D bytes;
> +			tx->flags =3D 0;
> +
> +			offset +=3D bytes;
> +			size -=3D bytes;
> +
> +			/* Next frame */
> +			if (offset =3D=3D PAGE_SIZE && size) {
> +				BUG_ON(!PageCompound(page));
> +				page++;
> +				offset =3D 0;
> +			}
> +		}
>  	}
> =20
>  	np->tx.req_prod_pvt =3D prod;
>=20



--------------enig31733BF0961A95AEC5CF5C5D
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBCgAGBQJQq4YOAAoJEOhnXe7L7s6j5J8QAKyiFdtq2szKHCT3Ay4xZ5EF
auXUvtLlHo9hS6EFXfh4mp9wUzJsWtjqHT+X3U8htaPbxdkeOFQnPJZMcfKNePqu
2YAWfDfuPo41Z64ViXC/3ugj6PPdikpXCPZl2WSSKcmP1dL7vwNhHYSRGqPyw4Rg
vkutmUhHEQ5V5xQ5fWNQoa65euiPyudTqjWi2CTekr9i/XBw/CamTUP6kakffbgh
Z3v1+QMiG6rZhUrpfzIJcN/rTD9e0+X8MO3y3dL5gR5H0gLxS98U5wicSOp6Inqk
rgn85OMkAZ99diIYRO6DLrIXJyHPbXW2ROLMtLGGhxFqoMA9wr02ae1UaGS+5LMQ
i+9bGLDScMeAkZeMu1IlLHM5R69t9MIcn733+dq+wqN8/tdeCC0eZmFv1i3SR8ds
pDjHLB5jI3jXafwHG+x6i8e6zVEvd01mK/3F9QxDgnblnyJWV9i1RdR85ujae/D2
zKUsYFBw9BVGgwuFVlXWT80PwB5xRq/WUfBo8Yc3SAwU4SsnwgiD3iSqQuEpA00x
5wMU1sYssfZ03BiYExBSoWSKtpgG8oDU1jaN/FTn3W7qaACQcWnVTjsXemJzgz0Y
iXaApEdfvCg8buPNrQC/9NBzjVIY74YXfh4nDiUar20Nu7zc3Pv1udsiC9PhPAeY
B4oBTxvrRrURaVDm4SHT
=/1Ia
-----END PGP SIGNATURE-----

--------------enig31733BF0961A95AEC5CF5C5D--


--===============6421669734990348547==
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.xen.org
http://lists.xen.org/xen-devel

--===============6421669734990348547==--


From xen-devel-bounces@lists.xen.org Tue Nov 20 13:31:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 13:31:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tanuq-0004r4-2z; Tue, 20 Nov 2012 13:31:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <stefan.bader@canonical.com>) id 1Tanuo-0004qz-G0
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 13:31:02 +0000
Received: from [85.158.139.83:61076] by server-2.bemta-5.messagelabs.com id
	99/DA-04892-5168BA05; Tue, 20 Nov 2012 13:31:01 +0000
X-Env-Sender: stefan.bader@canonical.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353418260!19849030!1
X-Originating-IP: [91.189.89.112]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25062 invoked from network); 20 Nov 2012 13:31:00 -0000
Received: from youngberry.canonical.com (HELO youngberry.canonical.com)
	(91.189.89.112) by server-8.tower-182.messagelabs.com with SMTP;
	20 Nov 2012 13:31:00 -0000
Received: from p5b2e316f.dip.t-dialin.net ([91.46.49.111] helo=[192.168.2.5])
	by youngberry.canonical.com with esmtpsa
	(TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71)
	(envelope-from <stefan.bader@canonical.com>)
	id 1Tanuh-00035f-Vo; Tue, 20 Nov 2012 13:30:56 +0000
Message-ID: <50AB860E.3090106@canonical.com>
Date: Tue, 20 Nov 2012 14:30:54 +0100
From: Stefan Bader <stefan.bader@canonical.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <ian.campbell@citrix.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
In-Reply-To: <1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
X-Enigmail-Version: 1.4.5
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>, netdev@vger.kernel.org,
	ANNIE LI <annie.li@oracle.com>, xen-devel@lists.xen.org,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
	fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6421669734990348547=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============6421669734990348547==
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature";
 boundary="------------enig31733BF0961A95AEC5CF5C5D"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig31733BF0961A95AEC5CF5C5D
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Aside from Jans comments about error handling, I tried below patch and it=
 seems
to solve the problem with transfers out of the domU for me (though only s=
hallow
testing done, otoh 5 times is more than getting stuck the first time).

-Stefan

On 20.11.2012 12:40, Ian Campbell wrote:
> An SKB paged fragment can consist of a compound page with order > 0.
> However the netchannel protocol deals only in PAGE_SIZE frames.
>=20
> Handle this in xennet_make_frags by iterating over the frames which
> make up the page.
>=20
> This is the netfront equivalent to 6a8ed462f16b for netback.
>=20
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: netdev@vger.kernel.org
> Cc: xen-devel@lists.xen.org
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
> Cc: ANNIE LI <annie.li@oracle.com>
> Cc: Sander Eikelenboom <linux@eikelenboom.it>
> Cc: Stefan Bader <stefan.bader@canonical.com>
Tested-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>  drivers/net/xen-netfront.c |   58 +++++++++++++++++++++++++++++++++---=
-------
>  1 files changed, 44 insertions(+), 14 deletions(-)
>=20
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index caa0110..a12b99a 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -452,24 +452,54 @@ static void xennet_make_frags(struct sk_buff *skb=
, struct net_device *dev,
>  	/* Grant backend access to each skb fragment page. */
>  	for (i =3D 0; i < frags; i++) {
>  		skb_frag_t *frag =3D skb_shinfo(skb)->frags + i;
> +		struct page *page =3D skb_frag_page(frag);
> +		unsigned long size =3D skb_frag_size(frag);
> +		unsigned long offset =3D frag->page_offset;
> =20
> -		tx->flags |=3D XEN_NETTXF_more_data;
> +		/* Data must not cross a page boundary. */
> +		BUG_ON(size + offset > PAGE_SIZE<<compound_order(page));
> =20
> -		id =3D get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> -		np->tx_skbs[id].skb =3D skb_get(skb);
> -		tx =3D RING_GET_REQUEST(&np->tx, prod++);
> -		tx->id =3D id;
> -		ref =3D gnttab_claim_grant_reference(&np->gref_tx_head);
> -		BUG_ON((signed short)ref < 0);
> +		/* Skip unused frames from start of page */
> +		page +=3D offset >> PAGE_SHIFT;
> +		offset &=3D ~PAGE_MASK;
> =20
> -		mfn =3D pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
> -		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> -						mfn, GNTMAP_readonly);
> +		while (size > 0) {
> +			unsigned long bytes;
> =20
> -		tx->gref =3D np->grant_tx_ref[id] =3D ref;
> -		tx->offset =3D frag->page_offset;
> -		tx->size =3D skb_frag_size(frag);
> -		tx->flags =3D 0;
> +			BUG_ON(offset >=3D PAGE_SIZE);
> +
> +			bytes =3D PAGE_SIZE - offset;
> +			if (bytes > size)
> +				bytes =3D size;
> +
> +			tx->flags |=3D XEN_NETTXF_more_data;
> +
> +			id =3D get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> +			np->tx_skbs[id].skb =3D skb_get(skb);
> +			tx =3D RING_GET_REQUEST(&np->tx, prod++);
> +			tx->id =3D id;
> +			ref =3D gnttab_claim_grant_reference(&np->gref_tx_head);
> +			BUG_ON((signed short)ref < 0);
> +
> +			mfn =3D pfn_to_mfn(page_to_pfn(page));
> +			gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> +							mfn, GNTMAP_readonly);
> +
> +			tx->gref =3D np->grant_tx_ref[id] =3D ref;
> +			tx->offset =3D offset;
> +			tx->size =3D bytes;
> +			tx->flags =3D 0;
> +
> +			offset +=3D bytes;
> +			size -=3D bytes;
> +
> +			/* Next frame */
> +			if (offset =3D=3D PAGE_SIZE && size) {
> +				BUG_ON(!PageCompound(page));
> +				page++;
> +				offset =3D 0;
> +			}
> +		}
>  	}
> =20
>  	np->tx.req_prod_pvt =3D prod;
>=20



--------------enig31733BF0961A95AEC5CF5C5D
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBCgAGBQJQq4YOAAoJEOhnXe7L7s6j5J8QAKyiFdtq2szKHCT3Ay4xZ5EF
auXUvtLlHo9hS6EFXfh4mp9wUzJsWtjqHT+X3U8htaPbxdkeOFQnPJZMcfKNePqu
2YAWfDfuPo41Z64ViXC/3ugj6PPdikpXCPZl2WSSKcmP1dL7vwNhHYSRGqPyw4Rg
vkutmUhHEQ5V5xQ5fWNQoa65euiPyudTqjWi2CTekr9i/XBw/CamTUP6kakffbgh
Z3v1+QMiG6rZhUrpfzIJcN/rTD9e0+X8MO3y3dL5gR5H0gLxS98U5wicSOp6Inqk
rgn85OMkAZ99diIYRO6DLrIXJyHPbXW2ROLMtLGGhxFqoMA9wr02ae1UaGS+5LMQ
i+9bGLDScMeAkZeMu1IlLHM5R69t9MIcn733+dq+wqN8/tdeCC0eZmFv1i3SR8ds
pDjHLB5jI3jXafwHG+x6i8e6zVEvd01mK/3F9QxDgnblnyJWV9i1RdR85ujae/D2
zKUsYFBw9BVGgwuFVlXWT80PwB5xRq/WUfBo8Yc3SAwU4SsnwgiD3iSqQuEpA00x
5wMU1sYssfZ03BiYExBSoWSKtpgG8oDU1jaN/FTn3W7qaACQcWnVTjsXemJzgz0Y
iXaApEdfvCg8buPNrQC/9NBzjVIY74YXfh4nDiUar20Nu7zc3Pv1udsiC9PhPAeY
B4oBTxvrRrURaVDm4SHT
=/1Ia
-----END PGP SIGNATURE-----

--------------enig31733BF0961A95AEC5CF5C5D--


--===============6421669734990348547==
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.xen.org
http://lists.xen.org/xen-devel

--===============6421669734990348547==--


From xen-devel-bounces@lists.xen.org Tue Nov 20 13:35:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 13:35:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tanyz-0004xu-Ph; Tue, 20 Nov 2012 13:35:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tanyy-0004xn-Ea
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 13:35:20 +0000
Received: from [85.158.139.211:56978] by server-16.bemta-5.messagelabs.com id
	1D/0D-04786-7178BA05; Tue, 20 Nov 2012 13:35:19 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1353418518!20911697!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16464 invoked from network); 20 Nov 2012 13:35:18 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 13:35:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,285,1352073600"; d="scan'208";a="15904521"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 13:35:18 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 13:35:18 +0000
Message-ID: <1353418516.13542.38.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 20 Nov 2012 13:35:16 +0000
In-Reply-To: <50AB856D02000078000A9EFD@nat28.tlf.novell.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 12:28 +0000, Jan Beulich wrote:
> >>> On 20.11.12 at 12:40, Ian Campbell <ian.campbell@citrix.com> wrote:
> > An SKB paged fragment can consist of a compound page with order > 0.
> > However the netchannel protocol deals only in PAGE_SIZE frames.
> > 
> > Handle this in xennet_make_frags by iterating over the frames which
> > make up the page.
> > 
> > This is the netfront equivalent to 6a8ed462f16b for netback.
> 
> Wouldn't you need to be at least a little more conservative here
> with respect to resource use: I realize that get_id_from_freelist()
> return values were never checked, and failure of
> gnttab_claim_grant_reference() was always dealt with via
> BUG_ON(), but considering that netfront_tx_slot_available()
> doesn't account for compound page fragments, I think this (lack
> of) error handling needs improvement in the course of the
> change here (regardless of - I think - someone having said that
> usually the sum of all pages referenced from an skb's fragments
> would not exceed MAX_SKB_FRAGS - "usually" just isn't enough
> imo).

I think it is more than "usually", it is derived from the number of
pages needed to contain 64K of data which is the maximum size of the
data associated with an skb (AIUI).

Unwinding from failure in xennet_make_frags looks pretty tricky, but how
about this incremental patch:

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index a12b99a..06d0a84 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -505,6 +505,46 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
 	np->tx.req_prod_pvt = prod;
 }
 
+/*
+ * Count how many ring slots are required to send the frags of this
+ * skb. Each frag might be a compound page.
+ */
+static int xennet_count_skb_frag_pages(struct sk_buff *skb)
+{
+	int i, frags = skb_shinfo(skb)->nr_frags;
+	int pages = 0;
+
+	for (i = 0; i < frags; i++) {
+		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
+		unsigned long size = skb_frag_size(frag);
+		unsigned long offset = frag->page_offset;
+
+		/* Skip unused frames from start of page */
+		offset &= ~PAGE_MASK;
+
+		while (size > 0) {
+			unsigned long bytes;
+
+			BUG_ON(offset >= PAGE_SIZE);
+
+			bytes = PAGE_SIZE - offset;
+			if (bytes > size)
+				bytes = size;
+
+			offset += bytes;
+			size -= bytes;
+
+			/* Next frame */
+			if (offset == PAGE_SIZE && size) {
+				pages++;
+				offset = 0;
+			}
+		}
+	}
+
+	return pages;
+}
+
 static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	unsigned short id;
@@ -517,12 +557,13 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	grant_ref_t ref;
 	unsigned long mfn;
 	int notify;
-	int frags = skb_shinfo(skb)->nr_frags;
+	int frags;
 	unsigned int offset = offset_in_page(data);
 	unsigned int len = skb_headlen(skb);
 	unsigned long flags;
 
-	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
+	frags = xennet_count_skb_frag_pages(skb) +
+		DIV_ROUND_UP(offset + len, PAGE_SIZE);
 	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
 		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
 		       frags);



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 13:35:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 13:35:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tanyz-0004xu-Ph; Tue, 20 Nov 2012 13:35:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tanyy-0004xn-Ea
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 13:35:20 +0000
Received: from [85.158.139.211:56978] by server-16.bemta-5.messagelabs.com id
	1D/0D-04786-7178BA05; Tue, 20 Nov 2012 13:35:19 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1353418518!20911697!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16464 invoked from network); 20 Nov 2012 13:35:18 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 13:35:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,285,1352073600"; d="scan'208";a="15904521"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 13:35:18 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 13:35:18 +0000
Message-ID: <1353418516.13542.38.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 20 Nov 2012 13:35:16 +0000
In-Reply-To: <50AB856D02000078000A9EFD@nat28.tlf.novell.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 12:28 +0000, Jan Beulich wrote:
> >>> On 20.11.12 at 12:40, Ian Campbell <ian.campbell@citrix.com> wrote:
> > An SKB paged fragment can consist of a compound page with order > 0.
> > However the netchannel protocol deals only in PAGE_SIZE frames.
> > 
> > Handle this in xennet_make_frags by iterating over the frames which
> > make up the page.
> > 
> > This is the netfront equivalent to 6a8ed462f16b for netback.
> 
> Wouldn't you need to be at least a little more conservative here
> with respect to resource use: I realize that get_id_from_freelist()
> return values were never checked, and failure of
> gnttab_claim_grant_reference() was always dealt with via
> BUG_ON(), but considering that netfront_tx_slot_available()
> doesn't account for compound page fragments, I think this (lack
> of) error handling needs improvement in the course of the
> change here (regardless of - I think - someone having said that
> usually the sum of all pages referenced from an skb's fragments
> would not exceed MAX_SKB_FRAGS - "usually" just isn't enough
> imo).

I think it is more than "usually", it is derived from the number of
pages needed to contain 64K of data which is the maximum size of the
data associated with an skb (AIUI).

Unwinding from failure in xennet_make_frags looks pretty tricky, but how
about this incremental patch:

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index a12b99a..06d0a84 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -505,6 +505,46 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
 	np->tx.req_prod_pvt = prod;
 }
 
+/*
+ * Count how many ring slots are required to send the frags of this
+ * skb. Each frag might be a compound page.
+ */
+static int xennet_count_skb_frag_pages(struct sk_buff *skb)
+{
+	int i, frags = skb_shinfo(skb)->nr_frags;
+	int pages = 0;
+
+	for (i = 0; i < frags; i++) {
+		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
+		unsigned long size = skb_frag_size(frag);
+		unsigned long offset = frag->page_offset;
+
+		/* Skip unused frames from start of page */
+		offset &= ~PAGE_MASK;
+
+		while (size > 0) {
+			unsigned long bytes;
+
+			BUG_ON(offset >= PAGE_SIZE);
+
+			bytes = PAGE_SIZE - offset;
+			if (bytes > size)
+				bytes = size;
+
+			offset += bytes;
+			size -= bytes;
+
+			/* Next frame */
+			if (offset == PAGE_SIZE && size) {
+				pages++;
+				offset = 0;
+			}
+		}
+	}
+
+	return pages;
+}
+
 static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	unsigned short id;
@@ -517,12 +557,13 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	grant_ref_t ref;
 	unsigned long mfn;
 	int notify;
-	int frags = skb_shinfo(skb)->nr_frags;
+	int frags;
 	unsigned int offset = offset_in_page(data);
 	unsigned int len = skb_headlen(skb);
 	unsigned long flags;
 
-	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
+	frags = xennet_count_skb_frag_pages(skb) +
+		DIV_ROUND_UP(offset + len, PAGE_SIZE);
 	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
 		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
 		       frags);



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 13:46:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 13:46:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tao8y-00059l-UA; Tue, 20 Nov 2012 13:45:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1Tao8x-00059g-7Z
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 13:45:39 +0000
Received: from [85.158.139.211:56958] by server-11.bemta-5.messagelabs.com id
	43/2D-03409-2898BA05; Tue, 20 Nov 2012 13:45:38 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-13.tower-206.messagelabs.com!1353419134!16898564!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 720 invoked from network); 20 Nov 2012 13:45:35 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Nov 2012 13:45:35 -0000
Received: from 136-70-ftth.on.nl ([88.159.70.136]:53622 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1TaoBo-00071a-My; Tue, 20 Nov 2012 14:48:36 +0100
Date: Tue, 20 Nov 2012 14:45:22 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <1946803246.20121120144522@eikelenboom.it>
To: Stefan Bader <stefan.bader@canonical.com>
In-Reply-To: <50AB860E.3090106@canonical.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB860E.3090106@canonical.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>, netdev@vger.kernel.org,
	ANNIE LI <annie.li@oracle.com>, xen-devel@lists.xen.org,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
	fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


Tuesday, November 20, 2012, 2:30:54 PM, you wrote:

> Aside from Jans comments about error handling, I tried below patch and it seems
> to solve the problem with transfers out of the domU for me (though only shallow
> testing done, otoh 5 times is more than getting stuck the first time).

> -Stefan

I'm running with this patch now, it seems to fix the problems for me as well.

--
Sander

> On 20.11.2012 12:40, Ian Campbell wrote:
>> An SKB paged fragment can consist of a compound page with order > 0.
>> However the netchannel protocol deals only in PAGE_SIZE frames.
>> 
>> Handle this in xennet_make_frags by iterating over the frames which
>> make up the page.
>> 
>> This is the netfront equivalent to 6a8ed462f16b for netback.
>> 
>> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>> Cc: netdev@vger.kernel.org
>> Cc: xen-devel@lists.xen.org
>> Cc: Eric Dumazet <edumazet@google.com>
>> Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
>> Cc: ANNIE LI <annie.li@oracle.com>
>> Cc: Sander Eikelenboom <linux@eikelenboom.it>
>> Cc: Stefan Bader <stefan.bader@canonical.com>
> Tested-by: Stefan Bader <stefan.bader@canonical.com>
>> ---
>>  drivers/net/xen-netfront.c |   58 +++++++++++++++++++++++++++++++++----------
>>  1 files changed, 44 insertions(+), 14 deletions(-)
>> 
>> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
>> index caa0110..a12b99a 100644
>> --- a/drivers/net/xen-netfront.c
>> +++ b/drivers/net/xen-netfront.c
>> @@ -452,24 +452,54 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
>>       /* Grant backend access to each skb fragment page. */
>>       for (i = 0; i < frags; i++) {
>>               skb_frag_t *frag = skb_shinfo(skb)->frags + i;
>> +             struct page *page = skb_frag_page(frag);
>> +             unsigned long size = skb_frag_size(frag);
>> +             unsigned long offset = frag->page_offset;
>>  
>> -             tx->flags |= XEN_NETTXF_more_data;
>> +             /* Data must not cross a page boundary. */
>> +             BUG_ON(size + offset > PAGE_SIZE<<compound_order(page));
>>  
>> -             id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
>> -             np->tx_skbs[id].skb = skb_get(skb);
>> -             tx = RING_GET_REQUEST(&np->tx, prod++);
>> -             tx->id = id;
>> -             ref = gnttab_claim_grant_reference(&np->gref_tx_head);
>> -             BUG_ON((signed short)ref < 0);
>> +             /* Skip unused frames from start of page */
>> +             page += offset >> PAGE_SHIFT;
>> +             offset &= ~PAGE_MASK;
>>  
>> -             mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
>> -             gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
>> -                                             mfn, GNTMAP_readonly);
>> +             while (size > 0) {
>> +                     unsigned long bytes;
>>  
>> -             tx->gref = np->grant_tx_ref[id] = ref;
>> -             tx->offset = frag->page_offset;
>> -             tx->size = skb_frag_size(frag);
>> -             tx->flags = 0;
>> +                     BUG_ON(offset >= PAGE_SIZE);
>> +
>> +                     bytes = PAGE_SIZE - offset;
>> +                     if (bytes > size)
>> +                             bytes = size;
>> +
>> +                     tx->flags |= XEN_NETTXF_more_data;
>> +
>> +                     id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
>> +                     np->tx_skbs[id].skb = skb_get(skb);
>> +                     tx = RING_GET_REQUEST(&np->tx, prod++);
>> +                     tx->id = id;
>> +                     ref = gnttab_claim_grant_reference(&np->gref_tx_head);
>> +                     BUG_ON((signed short)ref < 0);
>> +
>> +                     mfn = pfn_to_mfn(page_to_pfn(page));
>> +                     gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
>> +                                                     mfn, GNTMAP_readonly);
>> +
>> +                     tx->gref = np->grant_tx_ref[id] = ref;
>> +                     tx->offset = offset;
>> +                     tx->size = bytes;
>> +                     tx->flags = 0;
>> +
>> +                     offset += bytes;
>> +                     size -= bytes;
>> +
>> +                     /* Next frame */
>> +                     if (offset == PAGE_SIZE && size) {
>> +                             BUG_ON(!PageCompound(page));
>> +                             page++;
>> +                             offset = 0;
>> +                     }
>> +             }
>>       }
>>  
>>       np->tx.req_prod_pvt = prod;
>> 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 13:46:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 13:46:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tao8y-00059l-UA; Tue, 20 Nov 2012 13:45:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1Tao8x-00059g-7Z
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 13:45:39 +0000
Received: from [85.158.139.211:56958] by server-11.bemta-5.messagelabs.com id
	43/2D-03409-2898BA05; Tue, 20 Nov 2012 13:45:38 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-13.tower-206.messagelabs.com!1353419134!16898564!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 720 invoked from network); 20 Nov 2012 13:45:35 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Nov 2012 13:45:35 -0000
Received: from 136-70-ftth.on.nl ([88.159.70.136]:53622 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1TaoBo-00071a-My; Tue, 20 Nov 2012 14:48:36 +0100
Date: Tue, 20 Nov 2012 14:45:22 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <1946803246.20121120144522@eikelenboom.it>
To: Stefan Bader <stefan.bader@canonical.com>
In-Reply-To: <50AB860E.3090106@canonical.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB860E.3090106@canonical.com>
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>, netdev@vger.kernel.org,
	ANNIE LI <annie.li@oracle.com>, xen-devel@lists.xen.org,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
	fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


Tuesday, November 20, 2012, 2:30:54 PM, you wrote:

> Aside from Jans comments about error handling, I tried below patch and it seems
> to solve the problem with transfers out of the domU for me (though only shallow
> testing done, otoh 5 times is more than getting stuck the first time).

> -Stefan

I'm running with this patch now, it seems to fix the problems for me as well.

--
Sander

> On 20.11.2012 12:40, Ian Campbell wrote:
>> An SKB paged fragment can consist of a compound page with order > 0.
>> However the netchannel protocol deals only in PAGE_SIZE frames.
>> 
>> Handle this in xennet_make_frags by iterating over the frames which
>> make up the page.
>> 
>> This is the netfront equivalent to 6a8ed462f16b for netback.
>> 
>> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>> Cc: netdev@vger.kernel.org
>> Cc: xen-devel@lists.xen.org
>> Cc: Eric Dumazet <edumazet@google.com>
>> Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
>> Cc: ANNIE LI <annie.li@oracle.com>
>> Cc: Sander Eikelenboom <linux@eikelenboom.it>
>> Cc: Stefan Bader <stefan.bader@canonical.com>
> Tested-by: Stefan Bader <stefan.bader@canonical.com>
>> ---
>>  drivers/net/xen-netfront.c |   58 +++++++++++++++++++++++++++++++++----------
>>  1 files changed, 44 insertions(+), 14 deletions(-)
>> 
>> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
>> index caa0110..a12b99a 100644
>> --- a/drivers/net/xen-netfront.c
>> +++ b/drivers/net/xen-netfront.c
>> @@ -452,24 +452,54 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
>>       /* Grant backend access to each skb fragment page. */
>>       for (i = 0; i < frags; i++) {
>>               skb_frag_t *frag = skb_shinfo(skb)->frags + i;
>> +             struct page *page = skb_frag_page(frag);
>> +             unsigned long size = skb_frag_size(frag);
>> +             unsigned long offset = frag->page_offset;
>>  
>> -             tx->flags |= XEN_NETTXF_more_data;
>> +             /* Data must not cross a page boundary. */
>> +             BUG_ON(size + offset > PAGE_SIZE<<compound_order(page));
>>  
>> -             id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
>> -             np->tx_skbs[id].skb = skb_get(skb);
>> -             tx = RING_GET_REQUEST(&np->tx, prod++);
>> -             tx->id = id;
>> -             ref = gnttab_claim_grant_reference(&np->gref_tx_head);
>> -             BUG_ON((signed short)ref < 0);
>> +             /* Skip unused frames from start of page */
>> +             page += offset >> PAGE_SHIFT;
>> +             offset &= ~PAGE_MASK;
>>  
>> -             mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
>> -             gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
>> -                                             mfn, GNTMAP_readonly);
>> +             while (size > 0) {
>> +                     unsigned long bytes;
>>  
>> -             tx->gref = np->grant_tx_ref[id] = ref;
>> -             tx->offset = frag->page_offset;
>> -             tx->size = skb_frag_size(frag);
>> -             tx->flags = 0;
>> +                     BUG_ON(offset >= PAGE_SIZE);
>> +
>> +                     bytes = PAGE_SIZE - offset;
>> +                     if (bytes > size)
>> +                             bytes = size;
>> +
>> +                     tx->flags |= XEN_NETTXF_more_data;
>> +
>> +                     id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
>> +                     np->tx_skbs[id].skb = skb_get(skb);
>> +                     tx = RING_GET_REQUEST(&np->tx, prod++);
>> +                     tx->id = id;
>> +                     ref = gnttab_claim_grant_reference(&np->gref_tx_head);
>> +                     BUG_ON((signed short)ref < 0);
>> +
>> +                     mfn = pfn_to_mfn(page_to_pfn(page));
>> +                     gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
>> +                                                     mfn, GNTMAP_readonly);
>> +
>> +                     tx->gref = np->grant_tx_ref[id] = ref;
>> +                     tx->offset = offset;
>> +                     tx->size = bytes;
>> +                     tx->flags = 0;
>> +
>> +                     offset += bytes;
>> +                     size -= bytes;
>> +
>> +                     /* Next frame */
>> +                     if (offset == PAGE_SIZE && size) {
>> +                             BUG_ON(!PageCompound(page));
>> +                             page++;
>> +                             offset = 0;
>> +                     }
>> +             }
>>       }
>>  
>>       np->tx.req_prod_pvt = prod;
>> 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 13:51:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 13:51:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaoED-0005Hp-N8; Tue, 20 Nov 2012 13:51:05 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TaoEC-0005Hk-OR
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 13:51:04 +0000
Received: from [193.109.254.147:49570] by server-4.bemta-14.messagelabs.com id
	5E/16-18856-7CA8BA05; Tue, 20 Nov 2012 13:51:03 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1353419454!8890376!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23374 invoked from network); 20 Nov 2012 13:50:54 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-27.messagelabs.com with SMTP;
	20 Nov 2012 13:50:54 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 13:50:54 +0000
Message-Id: <50AB990602000078000A9F5B@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 13:51:50 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353418516.13542.38.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: KonradRzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 14:35, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Tue, 2012-11-20 at 12:28 +0000, Jan Beulich wrote:
>> >>> On 20.11.12 at 12:40, Ian Campbell <ian.campbell@citrix.com> wrote:
>> > An SKB paged fragment can consist of a compound page with order > 0.
>> > However the netchannel protocol deals only in PAGE_SIZE frames.
>> > 
>> > Handle this in xennet_make_frags by iterating over the frames which
>> > make up the page.
>> > 
>> > This is the netfront equivalent to 6a8ed462f16b for netback.
>> 
>> Wouldn't you need to be at least a little more conservative here
>> with respect to resource use: I realize that get_id_from_freelist()
>> return values were never checked, and failure of
>> gnttab_claim_grant_reference() was always dealt with via
>> BUG_ON(), but considering that netfront_tx_slot_available()
>> doesn't account for compound page fragments, I think this (lack
>> of) error handling needs improvement in the course of the
>> change here (regardless of - I think - someone having said that
>> usually the sum of all pages referenced from an skb's fragments
>> would not exceed MAX_SKB_FRAGS - "usually" just isn't enough
>> imo).
> 
> I think it is more than "usually", it is derived from the number of
> pages needed to contain 64K of data which is the maximum size of the
> data associated with an skb (AIUI).
> 
> Unwinding from failure in xennet_make_frags looks pretty tricky,

Yes, I agree.

> but how about this incremental patch:

Looks good, but can probably be simplified quite a bit:

> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -505,6 +505,46 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
>  	np->tx.req_prod_pvt = prod;
>  }
>  
> +/*
> + * Count how many ring slots are required to send the frags of this
> + * skb. Each frag might be a compound page.
> + */
> +static int xennet_count_skb_frag_pages(struct sk_buff *skb)
> +{
> +	int i, frags = skb_shinfo(skb)->nr_frags;
> +	int pages = 0;
> +
> +	for (i = 0; i < frags; i++) {
> +		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
> +		unsigned long size = skb_frag_size(frag);
> +		unsigned long offset = frag->page_offset;
> +
> +		/* Skip unused frames from start of page */
> +		offset &= ~PAGE_MASK;
> +
> +		while (size > 0) {
> +			unsigned long bytes;
> +
> +			BUG_ON(offset >= PAGE_SIZE);
> +
> +			bytes = PAGE_SIZE - offset;
> +			if (bytes > size)
> +				bytes = size;
> +
> +			offset += bytes;
> +			size -= bytes;
> +
> +			/* Next frame */
> +			if (offset == PAGE_SIZE && size) {
> +				pages++;
> +				offset = 0;
> +			}
> +		}

Isn't the whole loop equivalent to 

		pages = PFN_UP(offset + size);

(at least as long as size is not zero)?

Plus I think the increment of pages would need to be pulled out
of the if() body.

> +	}
> +
> +	return pages;
> +}
> +
>  static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  {
>  	unsigned short id;
> @@ -517,12 +557,13 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  	grant_ref_t ref;
>  	unsigned long mfn;
>  	int notify;
> -	int frags = skb_shinfo(skb)->nr_frags;
> +	int frags;
>  	unsigned int offset = offset_in_page(data);
>  	unsigned int len = skb_headlen(skb);
>  	unsigned long flags;
>  
> -	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
> +	frags = xennet_count_skb_frag_pages(skb) +
> +		DIV_ROUND_UP(offset + len, PAGE_SIZE);
>  	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {

This condition would now need adjustment, though (because
"frags" is no longer what its name says).

Jan

>  		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
>  		       frags);




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 13:51:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 13:51:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaoED-0005Hp-N8; Tue, 20 Nov 2012 13:51:05 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TaoEC-0005Hk-OR
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 13:51:04 +0000
Received: from [193.109.254.147:49570] by server-4.bemta-14.messagelabs.com id
	5E/16-18856-7CA8BA05; Tue, 20 Nov 2012 13:51:03 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1353419454!8890376!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23374 invoked from network); 20 Nov 2012 13:50:54 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-27.messagelabs.com with SMTP;
	20 Nov 2012 13:50:54 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 13:50:54 +0000
Message-Id: <50AB990602000078000A9F5B@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 13:51:50 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353418516.13542.38.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: KonradRzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 14:35, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Tue, 2012-11-20 at 12:28 +0000, Jan Beulich wrote:
>> >>> On 20.11.12 at 12:40, Ian Campbell <ian.campbell@citrix.com> wrote:
>> > An SKB paged fragment can consist of a compound page with order > 0.
>> > However the netchannel protocol deals only in PAGE_SIZE frames.
>> > 
>> > Handle this in xennet_make_frags by iterating over the frames which
>> > make up the page.
>> > 
>> > This is the netfront equivalent to 6a8ed462f16b for netback.
>> 
>> Wouldn't you need to be at least a little more conservative here
>> with respect to resource use: I realize that get_id_from_freelist()
>> return values were never checked, and failure of
>> gnttab_claim_grant_reference() was always dealt with via
>> BUG_ON(), but considering that netfront_tx_slot_available()
>> doesn't account for compound page fragments, I think this (lack
>> of) error handling needs improvement in the course of the
>> change here (regardless of - I think - someone having said that
>> usually the sum of all pages referenced from an skb's fragments
>> would not exceed MAX_SKB_FRAGS - "usually" just isn't enough
>> imo).
> 
> I think it is more than "usually", it is derived from the number of
> pages needed to contain 64K of data which is the maximum size of the
> data associated with an skb (AIUI).
> 
> Unwinding from failure in xennet_make_frags looks pretty tricky,

Yes, I agree.

> but how about this incremental patch:

Looks good, but can probably be simplified quite a bit:

> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -505,6 +505,46 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
>  	np->tx.req_prod_pvt = prod;
>  }
>  
> +/*
> + * Count how many ring slots are required to send the frags of this
> + * skb. Each frag might be a compound page.
> + */
> +static int xennet_count_skb_frag_pages(struct sk_buff *skb)
> +{
> +	int i, frags = skb_shinfo(skb)->nr_frags;
> +	int pages = 0;
> +
> +	for (i = 0; i < frags; i++) {
> +		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
> +		unsigned long size = skb_frag_size(frag);
> +		unsigned long offset = frag->page_offset;
> +
> +		/* Skip unused frames from start of page */
> +		offset &= ~PAGE_MASK;
> +
> +		while (size > 0) {
> +			unsigned long bytes;
> +
> +			BUG_ON(offset >= PAGE_SIZE);
> +
> +			bytes = PAGE_SIZE - offset;
> +			if (bytes > size)
> +				bytes = size;
> +
> +			offset += bytes;
> +			size -= bytes;
> +
> +			/* Next frame */
> +			if (offset == PAGE_SIZE && size) {
> +				pages++;
> +				offset = 0;
> +			}
> +		}

Isn't the whole loop equivalent to 

		pages = PFN_UP(offset + size);

(at least as long as size is not zero)?

Plus I think the increment of pages would need to be pulled out
of the if() body.

> +	}
> +
> +	return pages;
> +}
> +
>  static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  {
>  	unsigned short id;
> @@ -517,12 +557,13 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  	grant_ref_t ref;
>  	unsigned long mfn;
>  	int notify;
> -	int frags = skb_shinfo(skb)->nr_frags;
> +	int frags;
>  	unsigned int offset = offset_in_page(data);
>  	unsigned int len = skb_headlen(skb);
>  	unsigned long flags;
>  
> -	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
> +	frags = xennet_count_skb_frag_pages(skb) +
> +		DIV_ROUND_UP(offset + len, PAGE_SIZE);
>  	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {

This condition would now need adjustment, though (because
"frags" is no longer what its name says).

Jan

>  		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
>  		       frags);




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:14:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:14:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taoas-0005aF-4G; Tue, 20 Nov 2012 14:14:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Taoaq-0005aA-Qo
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:14:29 +0000
Received: from [85.158.143.35:58784] by server-3.bemta-4.messagelabs.com id
	96/21-06841-4409BA05; Tue, 20 Nov 2012 14:14:28 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1353420867!13764027!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7385 invoked from network); 20 Nov 2012 14:14:27 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 14:14:27 -0000
X-IronPort-AV: E=Sophos;i="4.83,285,1352073600"; d="scan'208";a="15905766"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 14:14:27 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 14:14:27 +0000
Message-ID: <1353420865.13542.44.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 20 Nov 2012 14:14:25 +0000
In-Reply-To: <50AB990602000078000A9F5B@nat28.tlf.novell.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: KonradRzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 13:51 +0000, Jan Beulich wrote:
> >>> On 20.11.12 at 14:35, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Tue, 2012-11-20 at 12:28 +0000, Jan Beulich wrote:
> >> >>> On 20.11.12 at 12:40, Ian Campbell <ian.campbell@citrix.com> wrote:
> >> > An SKB paged fragment can consist of a compound page with order > 0.
> >> > However the netchannel protocol deals only in PAGE_SIZE frames.
> >> > 
> >> > Handle this in xennet_make_frags by iterating over the frames which
> >> > make up the page.
> >> > 
> >> > This is the netfront equivalent to 6a8ed462f16b for netback.
> >> 
> >> Wouldn't you need to be at least a little more conservative here
> >> with respect to resource use: I realize that get_id_from_freelist()
> >> return values were never checked, and failure of
> >> gnttab_claim_grant_reference() was always dealt with via
> >> BUG_ON(), but considering that netfront_tx_slot_available()
> >> doesn't account for compound page fragments, I think this (lack
> >> of) error handling needs improvement in the course of the
> >> change here (regardless of - I think - someone having said that
> >> usually the sum of all pages referenced from an skb's fragments
> >> would not exceed MAX_SKB_FRAGS - "usually" just isn't enough
> >> imo).
> > 
> > I think it is more than "usually", it is derived from the number of
> > pages needed to contain 64K of data which is the maximum size of the
> > data associated with an skb (AIUI).
> > 
> > Unwinding from failure in xennet_make_frags looks pretty tricky,
> 
> Yes, I agree.
> 
> > but how about this incremental patch:
> 
> Looks good, but can probably be simplified quite a bit:
> 
> > --- a/drivers/net/xen-netfront.c
> > +++ b/drivers/net/xen-netfront.c
> > @@ -505,6 +505,46 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
> >  	np->tx.req_prod_pvt = prod;
> >  }
> >  
> > +/*
> > + * Count how many ring slots are required to send the frags of this
> > + * skb. Each frag might be a compound page.
> > + */
> > +static int xennet_count_skb_frag_pages(struct sk_buff *skb)
> > +{
> > +	int i, frags = skb_shinfo(skb)->nr_frags;
> > +	int pages = 0;
> > +
> > +	for (i = 0; i < frags; i++) {
> > +		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
> > +		unsigned long size = skb_frag_size(frag);
> > +		unsigned long offset = frag->page_offset;
> > +
> > +		/* Skip unused frames from start of page */
> > +		offset &= ~PAGE_MASK;
> > +
> > +		while (size > 0) {
> > +			unsigned long bytes;
> > +
> > +			BUG_ON(offset >= PAGE_SIZE);
> > +
> > +			bytes = PAGE_SIZE - offset;
> > +			if (bytes > size)
> > +				bytes = size;
> > +
> > +			offset += bytes;
> > +			size -= bytes;
> > +
> > +			/* Next frame */
> > +			if (offset == PAGE_SIZE && size) {
> > +				pages++;
> > +				offset = 0;
> > +			}
> > +		}
> 
> Isn't the whole loop equivalent to 
> 
> 		pages = PFN_UP(offset + size);
> 
> (at least as long as size is not zero)?

Er, yes. Wood for the trees etc...

I think using PFN_UP overcounts a bit since the data needed start in the
first frame of a compound frame, but if you keep the 
        /* Skip unused frames from start of page */
        offset &= ~PAGE_MASK;
        
I think that does the right thing

> > @@ -517,12 +557,13 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
> >  	grant_ref_t ref;
> >  	unsigned long mfn;
> >  	int notify;
> > -	int frags = skb_shinfo(skb)->nr_frags;
> > +	int frags;
> >  	unsigned int offset = offset_in_page(data);
> >  	unsigned int len = skb_headlen(skb);
> >  	unsigned long flags;
> >  
> > -	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
> > +	frags = xennet_count_skb_frag_pages(skb) +
> > +		DIV_ROUND_UP(offset + len, PAGE_SIZE);
> >  	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
> 
> This condition would now need adjustment, though (because
> "frags" is no longer what its name says).

I think it already wasn't what the name says, since it included the skb
head too. Perhaps "slots" would be a better name?

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index a12b99a..b744875 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -505,6 +505,29 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
 	np->tx.req_prod_pvt = prod;
 }
 
+/*
+ * Count how many ring slots are required to send the frags of this
+ * skb. Each frag might be a compound page.
+ */
+static int xennet_count_skb_frag_slots(struct sk_buff *skb)
+{
+	int i, frags = skb_shinfo(skb)->nr_frags;
+	int pages = 0;
+
+	for (i = 0; i < frags; i++) {
+		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
+		unsigned long size = skb_frag_size(frag);
+		unsigned long offset = frag->page_offset;
+
+		/* Skip unused frames from start of page */
+		offset &= ~PAGE_MASK;
+
+		pages += PFN_UP(offset + size);
+	}
+
+	return pages;
+}
+
 static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	unsigned short id;
@@ -517,15 +540,16 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	grant_ref_t ref;
 	unsigned long mfn;
 	int notify;
-	int frags = skb_shinfo(skb)->nr_frags;
+	int slots;
 	unsigned int offset = offset_in_page(data);
 	unsigned int len = skb_headlen(skb);
 	unsigned long flags;
 
-	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
-	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
-		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
-		       frags);
+	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
+		xennet_count_skb_frag_slots(skb);
+	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
+		printk(KERN_ALERT "xennet: skb rides the rocket: %d slots\n",
+		       slots);
 		dump_stack();
 		goto drop;
 	}
@@ -533,7 +557,7 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	spin_lock_irqsave(&np->tx_lock, flags);
 
 	if (unlikely(!netif_carrier_ok(dev) ||
-		     (frags > 1 && !xennet_can_sg(dev)) ||
+		     (slots > 1 && !xennet_can_sg(dev)) ||
 		     netif_needs_gso(skb, netif_skb_features(skb)))) {
 		spin_unlock_irqrestore(&np->tx_lock, flags);
 		goto drop;




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:14:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:14:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taoas-0005aF-4G; Tue, 20 Nov 2012 14:14:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Taoaq-0005aA-Qo
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:14:29 +0000
Received: from [85.158.143.35:58784] by server-3.bemta-4.messagelabs.com id
	96/21-06841-4409BA05; Tue, 20 Nov 2012 14:14:28 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1353420867!13764027!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7385 invoked from network); 20 Nov 2012 14:14:27 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 14:14:27 -0000
X-IronPort-AV: E=Sophos;i="4.83,285,1352073600"; d="scan'208";a="15905766"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 14:14:27 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 14:14:27 +0000
Message-ID: <1353420865.13542.44.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 20 Nov 2012 14:14:25 +0000
In-Reply-To: <50AB990602000078000A9F5B@nat28.tlf.novell.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: KonradRzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 13:51 +0000, Jan Beulich wrote:
> >>> On 20.11.12 at 14:35, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Tue, 2012-11-20 at 12:28 +0000, Jan Beulich wrote:
> >> >>> On 20.11.12 at 12:40, Ian Campbell <ian.campbell@citrix.com> wrote:
> >> > An SKB paged fragment can consist of a compound page with order > 0.
> >> > However the netchannel protocol deals only in PAGE_SIZE frames.
> >> > 
> >> > Handle this in xennet_make_frags by iterating over the frames which
> >> > make up the page.
> >> > 
> >> > This is the netfront equivalent to 6a8ed462f16b for netback.
> >> 
> >> Wouldn't you need to be at least a little more conservative here
> >> with respect to resource use: I realize that get_id_from_freelist()
> >> return values were never checked, and failure of
> >> gnttab_claim_grant_reference() was always dealt with via
> >> BUG_ON(), but considering that netfront_tx_slot_available()
> >> doesn't account for compound page fragments, I think this (lack
> >> of) error handling needs improvement in the course of the
> >> change here (regardless of - I think - someone having said that
> >> usually the sum of all pages referenced from an skb's fragments
> >> would not exceed MAX_SKB_FRAGS - "usually" just isn't enough
> >> imo).
> > 
> > I think it is more than "usually", it is derived from the number of
> > pages needed to contain 64K of data which is the maximum size of the
> > data associated with an skb (AIUI).
> > 
> > Unwinding from failure in xennet_make_frags looks pretty tricky,
> 
> Yes, I agree.
> 
> > but how about this incremental patch:
> 
> Looks good, but can probably be simplified quite a bit:
> 
> > --- a/drivers/net/xen-netfront.c
> > +++ b/drivers/net/xen-netfront.c
> > @@ -505,6 +505,46 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
> >  	np->tx.req_prod_pvt = prod;
> >  }
> >  
> > +/*
> > + * Count how many ring slots are required to send the frags of this
> > + * skb. Each frag might be a compound page.
> > + */
> > +static int xennet_count_skb_frag_pages(struct sk_buff *skb)
> > +{
> > +	int i, frags = skb_shinfo(skb)->nr_frags;
> > +	int pages = 0;
> > +
> > +	for (i = 0; i < frags; i++) {
> > +		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
> > +		unsigned long size = skb_frag_size(frag);
> > +		unsigned long offset = frag->page_offset;
> > +
> > +		/* Skip unused frames from start of page */
> > +		offset &= ~PAGE_MASK;
> > +
> > +		while (size > 0) {
> > +			unsigned long bytes;
> > +
> > +			BUG_ON(offset >= PAGE_SIZE);
> > +
> > +			bytes = PAGE_SIZE - offset;
> > +			if (bytes > size)
> > +				bytes = size;
> > +
> > +			offset += bytes;
> > +			size -= bytes;
> > +
> > +			/* Next frame */
> > +			if (offset == PAGE_SIZE && size) {
> > +				pages++;
> > +				offset = 0;
> > +			}
> > +		}
> 
> Isn't the whole loop equivalent to 
> 
> 		pages = PFN_UP(offset + size);
> 
> (at least as long as size is not zero)?

Er, yes. Wood for the trees etc...

I think using PFN_UP overcounts a bit since the data needed start in the
first frame of a compound frame, but if you keep the 
        /* Skip unused frames from start of page */
        offset &= ~PAGE_MASK;
        
I think that does the right thing

> > @@ -517,12 +557,13 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
> >  	grant_ref_t ref;
> >  	unsigned long mfn;
> >  	int notify;
> > -	int frags = skb_shinfo(skb)->nr_frags;
> > +	int frags;
> >  	unsigned int offset = offset_in_page(data);
> >  	unsigned int len = skb_headlen(skb);
> >  	unsigned long flags;
> >  
> > -	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
> > +	frags = xennet_count_skb_frag_pages(skb) +
> > +		DIV_ROUND_UP(offset + len, PAGE_SIZE);
> >  	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
> 
> This condition would now need adjustment, though (because
> "frags" is no longer what its name says).

I think it already wasn't what the name says, since it included the skb
head too. Perhaps "slots" would be a better name?

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index a12b99a..b744875 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -505,6 +505,29 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
 	np->tx.req_prod_pvt = prod;
 }
 
+/*
+ * Count how many ring slots are required to send the frags of this
+ * skb. Each frag might be a compound page.
+ */
+static int xennet_count_skb_frag_slots(struct sk_buff *skb)
+{
+	int i, frags = skb_shinfo(skb)->nr_frags;
+	int pages = 0;
+
+	for (i = 0; i < frags; i++) {
+		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
+		unsigned long size = skb_frag_size(frag);
+		unsigned long offset = frag->page_offset;
+
+		/* Skip unused frames from start of page */
+		offset &= ~PAGE_MASK;
+
+		pages += PFN_UP(offset + size);
+	}
+
+	return pages;
+}
+
 static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	unsigned short id;
@@ -517,15 +540,16 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	grant_ref_t ref;
 	unsigned long mfn;
 	int notify;
-	int frags = skb_shinfo(skb)->nr_frags;
+	int slots;
 	unsigned int offset = offset_in_page(data);
 	unsigned int len = skb_headlen(skb);
 	unsigned long flags;
 
-	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
-	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
-		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
-		       frags);
+	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
+		xennet_count_skb_frag_slots(skb);
+	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
+		printk(KERN_ALERT "xennet: skb rides the rocket: %d slots\n",
+		       slots);
 		dump_stack();
 		goto drop;
 	}
@@ -533,7 +557,7 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	spin_lock_irqsave(&np->tx_lock, flags);
 
 	if (unlikely(!netif_carrier_ok(dev) ||
-		     (frags > 1 && !xennet_can_sg(dev)) ||
+		     (slots > 1 && !xennet_can_sg(dev)) ||
 		     netif_needs_gso(skb, netif_skb_features(skb)))) {
 		spin_unlock_irqrestore(&np->tx_lock, flags);
 		goto drop;




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:22:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaoiH-0005jr-4s; Tue, 20 Nov 2012 14:22:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaoiF-0005jM-10
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:22:07 +0000
Received: from [85.158.137.99:22332] by server-14.bemta-3.messagelabs.com id
	B5/8D-12788-E029BA05; Tue, 20 Nov 2012 14:22:06 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-11.tower-217.messagelabs.com!1353421319!18994555!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD,UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22806 invoked from network); 20 Nov 2012 14:22:02 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-11.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 20 Nov 2012 14:22:02 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149572009;
	Tue, 20 Nov 2012 09:21:53 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org,
	Ian.Campbell@citrix.com
Date: Tue, 20 Nov 2012 09:21:08 -0500
Message-Id: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v4 1/5] add vtpm-stubdom code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add the code base for vtpm-stubdom to the stubdom
heirarchy. Makefile changes in later patch.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/vtpm/Makefile    |   37 +++++
 stubdom/vtpm/minios.cfg  |   14 ++
 stubdom/vtpm/vtpm.c      |  404 ++++++++++++++++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm.h      |   36 +++++
 stubdom/vtpm/vtpm_cmd.c  |  256 +++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm_cmd.h  |   31 ++++
 stubdom/vtpm/vtpm_pcrs.c |   43 +++++
 stubdom/vtpm/vtpm_pcrs.h |   53 ++++++
 stubdom/vtpm/vtpmblk.c   |  307 +++++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpmblk.h   |   31 ++++
 10 files changed, 1212 insertions(+)
 create mode 100644 stubdom/vtpm/Makefile
 create mode 100644 stubdom/vtpm/minios.cfg
 create mode 100644 stubdom/vtpm/vtpm.c
 create mode 100644 stubdom/vtpm/vtpm.h
 create mode 100644 stubdom/vtpm/vtpm_cmd.c
 create mode 100644 stubdom/vtpm/vtpm_cmd.h
 create mode 100644 stubdom/vtpm/vtpm_pcrs.c
 create mode 100644 stubdom/vtpm/vtpm_pcrs.h
 create mode 100644 stubdom/vtpm/vtpmblk.c
 create mode 100644 stubdom/vtpm/vtpmblk.h

diff --git a/stubdom/vtpm/Makefile b/stubdom/vtpm/Makefile
new file mode 100644
index 0000000..686c0ea
--- /dev/null
+++ b/stubdom/vtpm/Makefile
@@ -0,0 +1,37 @@
+# Copyright (c) 2010-2012 United States Government, as represented by
+# the Secretary of Defense.  All rights reserved.
+#
+# THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+# ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+# INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+# DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+# SOFTWARE.
+#
+
+XEN_ROOT=../..
+
+PSSL_DIR=../polarssl-$(XEN_TARGET_ARCH)/library
+PSSL_OBJS=aes.o sha1.o entropy.o ctr_drbg.o sha4.o
+
+TARGET=vtpm.a
+OBJS=vtpm.o vtpm_cmd.o vtpmblk.o vtpm_pcrs.o
+
+
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/build
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/tpm
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/crypto
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)
+
+$(TARGET): $(OBJS)
+	ar -cr $@ $(OBJS) $(TPMEMU_OBJS) $(foreach obj,$(PSSL_OBJS),$(PSSL_DIR)/$(obj))
+
+$(OBJS): vtpm_manager.h
+
+vtpm_manager.h:
+	ln -s ../vtpmmgr/vtpm_manager.h vtpm_manager.h
+
+clean:
+	-rm $(TARGET) $(OBJS) vtpm_manager.h
+
+.PHONY: clean
diff --git a/stubdom/vtpm/minios.cfg b/stubdom/vtpm/minios.cfg
new file mode 100644
index 0000000..31652ee
--- /dev/null
+++ b/stubdom/vtpm/minios.cfg
@@ -0,0 +1,14 @@
+CONFIG_TPMFRONT=y
+CONFIG_TPM_TIS=n
+CONFIG_TPMBACK=y
+CONFIG_START_NETWORK=n
+CONFIG_TEST=n
+CONFIG_PCIFRONT=n
+CONFIG_BLKFRONT=y
+CONFIG_NETFRONT=n
+CONFIG_FBFRONT=n
+CONFIG_KBDFRONT=n
+CONFIG_CONSFRONT=n
+CONFIG_XENBUS=y
+CONFIG_LWIP=n
+CONFIG_XC=n
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
new file mode 100644
index 0000000..71aef78
--- /dev/null
+++ b/stubdom/vtpm/vtpm.c
@@ -0,0 +1,404 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <syslog.h>
+#include <stdbool.h>
+#include <errno.h>
+#include <sys/time.h>
+#include <xen/xen.h>
+#include <tpmback.h>
+#include <tpmfront.h>
+
+#include <polarssl/entropy.h>
+#include <polarssl/ctr_drbg.h>
+
+#include "tpm/tpm_emulator_extern.h"
+#include "tpm/tpm_marshalling.h"
+#include "vtpm.h"
+#include "vtpm_cmd.h"
+#include "vtpm_pcrs.h"
+#include "vtpmblk.h"
+
+#define TPM_LOG_INFO LOG_INFO
+#define TPM_LOG_ERROR LOG_ERR
+#define TPM_LOG_DEBUG LOG_DEBUG
+
+/* Global commandline options - default values */
+struct Opt_args opt_args = {
+   .startup = ST_CLEAR,
+   .loglevel = TPM_LOG_INFO,
+   .hwinitpcrs = VTPM_PCRNONE,
+   .tpmconf = 0,
+   .enable_maint_cmds = false,
+};
+
+static uint32_t badords[32];
+static unsigned int n_badords = 0;
+
+entropy_context entropy;
+ctr_drbg_context ctr_drbg;
+
+struct tpmfront_dev* tpmfront_dev;
+
+void vtpm_get_extern_random_bytes(void *buf, size_t nbytes)
+{
+   ctr_drbg_random(&ctr_drbg, buf, nbytes);
+}
+
+int vtpm_read_from_file(uint8_t **data, size_t *data_length) {
+   return read_vtpmblk(tpmfront_dev, data, data_length);
+}
+
+int vtpm_write_to_file(uint8_t *data, size_t data_length) {
+   return write_vtpmblk(tpmfront_dev, data, data_length);
+}
+
+int vtpm_extern_init_fake(void) {
+   return 0;
+}
+
+void vtpm_extern_release_fake(void) {
+}
+
+
+void vtpm_log(int priority, const char *fmt, ...)
+{
+   if(opt_args.loglevel >= priority) {
+      va_list v;
+      va_start(v, fmt);
+      vprintf(fmt, v);
+      va_end(v);
+   }
+}
+
+static uint64_t vtpm_get_ticks(void)
+{
+  static uint64_t old_t = 0;
+  uint64_t new_t, res_t;
+  struct timeval tv;
+  gettimeofday(&tv, NULL);
+  new_t = (uint64_t)tv.tv_sec * 1000000 + (uint64_t)tv.tv_usec;
+  res_t = (old_t > 0) ? new_t - old_t : 0;
+  old_t = new_t;
+  return res_t;
+}
+
+
+static int tpm_entropy_source(void* dummy, unsigned char* data, size_t len, size_t* olen) {
+   UINT32 sz = len;
+   TPM_RESULT rc = VTPM_GetRandom(tpmfront_dev, data, &sz);
+   *olen = sz;
+   return rc == TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
+}
+
+int init_random(void) {
+   /* Initialize the rng */
+   entropy_init(&entropy);
+   entropy_add_source(&entropy, tpm_entropy_source, NULL, 0);
+   entropy_gather(&entropy);
+   ctr_drbg_init(&ctr_drbg, entropy_func, &entropy, NULL, 0);
+   ctr_drbg_set_prediction_resistance( &ctr_drbg, CTR_DRBG_PR_OFF );
+
+   return 0;
+}
+
+int check_ordinal(tpmcmd_t* tpmcmd) {
+   TPM_COMMAND_CODE ord;
+   UINT32 len = 4;
+   BYTE* ptr;
+   unsigned int i;
+
+   if(tpmcmd->req_len < 10) {
+      return true;
+   }
+
+   ptr = tpmcmd->req + 6;
+   tpm_unmarshal_UINT32(&ptr, &len, &ord);
+
+   for(i = 0; i < n_badords; ++i) {
+      if(ord == badords[i]) {
+         error("Disabled command ordinal (%" PRIu32") requested!\n");
+         return false;
+      }
+   }
+   return true;
+}
+
+static void main_loop(void) {
+   tpmcmd_t* tpmcmd = NULL;
+   domid_t domid;		/* Domid of frontend */
+   unsigned int handle;	/* handle of frontend */
+   int res = -1;
+
+   info("VTPM Initializing\n");
+
+   /* Set required tpm config args */
+   opt_args.tpmconf |= TPM_CONF_STRONG_PERSISTENCE;
+   opt_args.tpmconf &= ~TPM_CONF_USE_INTERNAL_PRNG;
+   opt_args.tpmconf |= TPM_CONF_GENERATE_EK;
+   opt_args.tpmconf |= TPM_CONF_GENERATE_SEED_DAA;
+
+   /* Initialize the emulator */
+   tpm_emulator_init(opt_args.startup, opt_args.tpmconf);
+
+   /* Initialize any requested PCRs with hardware TPM values */
+   if(vtpm_initialize_hw_pcrs(tpmfront_dev, opt_args.hwinitpcrs) != TPM_SUCCESS) {
+      error("Failed to initialize PCRs with hardware TPM values");
+      goto abort_postpcrs;
+   }
+
+   /* Wait for the frontend domain to connect */
+   info("Waiting for frontend domain to connect..");
+   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
+      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
+   } else {
+      error("Unable to attach to a frontend");
+   }
+
+   tpmcmd = tpmback_req(domid, handle);
+   while(tpmcmd) {
+      /* Handle the request */
+      if(tpmcmd->req_len) {
+	 tpmcmd->resp = NULL;
+	 tpmcmd->resp_len = 0;
+
+         /* First check for disabled ordinals */
+         if(!check_ordinal(tpmcmd)) {
+            create_error_response(tpmcmd, TPM_BAD_ORDINAL);
+         }
+         /* If not disabled, do the command */
+         else {
+            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
+               error("tpm_handle_command() failed");
+               create_error_response(tpmcmd, TPM_FAIL);
+            }
+         }
+      }
+
+      /* Send the response */
+      tpmback_resp(tpmcmd);
+
+      /* Wait for the next request */
+      tpmcmd = tpmback_req(domid, handle);
+
+   }
+
+abort_postpcrs:
+   info("VTPM Shutting down\n");
+
+   tpm_emulator_shutdown();
+}
+
+int parse_cmd_line(int argc, char** argv)
+{
+   char sval[25];
+   char* logstr = NULL;
+   /* Parse the command strings */
+   for(unsigned int i = 1; i < argc; ++i) {
+      if (sscanf(argv[i], "loglevel=%25s", sval) == 1){
+	 if (!strcmp(sval, "debug")) {
+	    opt_args.loglevel = TPM_LOG_DEBUG;
+	    logstr = "debug";
+	 }
+	 else if (!strcmp(sval, "info")) {
+	    logstr = "info";
+	    opt_args.loglevel = TPM_LOG_INFO;
+	 }
+	 else if (!strcmp(sval, "error")) {
+	    logstr = "error";
+	    opt_args.loglevel = TPM_LOG_ERROR;
+	 }
+      }
+      else if (!strcmp(argv[i], "clear")) {
+	 opt_args.startup = ST_CLEAR;
+      }
+      else if (!strcmp(argv[i], "save")) {
+	 opt_args.startup = ST_SAVE;
+      }
+      else if (!strcmp(argv[i], "deactivated")) {
+	 opt_args.startup = ST_DEACTIVATED;
+      }
+      else if (!strncmp(argv[i], "maintcmds=", 10)) {
+         if(!strcmp(argv[i] + 10, "1")) {
+            opt_args.enable_maint_cmds = true;
+         } else if(!strcmp(argv[i] + 10, "0")) {
+            opt_args.enable_maint_cmds = false;
+         }
+      }
+      else if(!strncmp(argv[i], "hwinitpcr=", 10)) {
+         char *pch = argv[i] + 10;
+         unsigned int v1, v2;
+         pch = strtok(pch, ",");
+         while(pch != NULL) {
+            if(!strcmp(pch, "all")) {
+               //Set all
+               opt_args.hwinitpcrs = VTPM_PCRALL;
+            } else if(!strcmp(pch, "none")) {
+               //Set none
+               opt_args.hwinitpcrs = VTPM_PCRNONE;
+            } else if(sscanf(pch, "%u", &v1) == 1) {
+               //Set one
+               if(v1 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               opt_args.hwinitpcrs |= (1 << v1);
+            } else if(sscanf(pch, "%u-%u", &v1, &v2) == 2) {
+               //Set range
+               if(v1 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               if(v2 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               if(v2 < v1) {
+                  unsigned tp = v1;
+                  v1 = v2;
+                  v2 = tp;
+               }
+               for(unsigned int i = v1; i <= v2; ++i) {
+                  opt_args.hwinitpcrs |= (1 << i);
+               }
+            } else {
+               error("hwintipcr error: Invalid PCR specification : %s", pch);
+               return -1;
+            }
+            pch = strtok(NULL, ",");
+         }
+      }
+      else {
+	 error("Invalid command line option `%s'", argv[i]);
+      }
+
+   }
+
+   /* Check Errors and print results */
+   switch(opt_args.startup) {
+      case ST_CLEAR:
+	 info("Startup mode is `clear'");
+	 break;
+      case ST_SAVE:
+	 info("Startup mode is `save'");
+	 break;
+      case ST_DEACTIVATED:
+	 info("Startup mode is `deactivated'");
+	 break;
+      default:
+	 error("Invalid startup mode %d", opt_args.startup);
+	 return -1;
+   }
+
+   if(opt_args.hwinitpcrs & (VTPM_PCRALL))
+   {
+      char pcrstr[1024];
+      char* ptr = pcrstr;
+
+      pcrstr[0] = '\0';
+      info("The following PCRs will be initialized with values from the hardware TPM:");
+      for(unsigned int i = 0; i < TPM_NUM_PCR; ++i) {
+         if(opt_args.hwinitpcrs & (1 << i)) {
+            ptr += sprintf(ptr, "%u, ", i);
+         }
+      }
+      /* get rid of the last comma if any numbers were printed */
+      *(ptr -2) = '\0';
+
+      info("\t%s", pcrstr);
+   } else {
+      info("All PCRs initialized to default values");
+   }
+
+   if(!opt_args.enable_maint_cmds) {
+      info("TPM Maintenance Commands disabled");
+      badords[n_badords++] = TPM_ORD_CreateMaintenanceArchive;
+      badords[n_badords++] = TPM_ORD_LoadMaintenanceArchive;
+      badords[n_badords++] = TPM_ORD_KillMaintenanceFeature;
+      badords[n_badords++] = TPM_ORD_LoadManuMaintPub;
+      badords[n_badords++] = TPM_ORD_ReadManuMaintPub;
+   } else {
+      info("TPM Maintenance Commands enabled");
+   }
+
+   info("Log level set to %s", logstr);
+
+   return 0;
+}
+
+void cleanup_opt_args(void) {
+}
+
+int main(int argc, char **argv)
+{
+   //FIXME: initializing blkfront without this sleep causes the domain to crash on boot
+   sleep(2);
+
+   /* Setup extern function pointers */
+   tpm_extern_init = vtpm_extern_init_fake;
+   tpm_extern_release = vtpm_extern_release_fake;
+   tpm_malloc = malloc;
+   tpm_free = free;
+   tpm_log = vtpm_log;
+   tpm_get_ticks = vtpm_get_ticks;
+   tpm_get_extern_random_bytes = vtpm_get_extern_random_bytes;
+   tpm_write_to_storage = vtpm_write_to_file;
+   tpm_read_from_storage = vtpm_read_from_file;
+
+   info("starting TPM Emulator (1.2.%d.%d-%d)", VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD);
+   if(parse_cmd_line(argc, argv)) {
+      error("Error parsing commandline\n");
+      return -1;
+   }
+
+   /* Initialize devices */
+   init_tpmback();
+   if((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
+      error("Unable to initialize tpmfront device");
+      goto abort_posttpmfront;
+   }
+
+   /* Seed the RNG with entropy from hardware TPM */
+   if(init_random()) {
+      error("Unable to initialize RNG");
+      goto abort_postrng;
+   }
+
+   /* Initialize blkfront device */
+   if(init_vtpmblk(tpmfront_dev)) {
+      error("Unable to initialize Blkfront persistent storage");
+      goto abort_postvtpmblk;
+   }
+
+   /* Run main loop */
+   main_loop();
+
+   /* Shutdown blkfront */
+   shutdown_vtpmblk();
+abort_postvtpmblk:
+abort_postrng:
+
+   /* Close devices */
+   shutdown_tpmfront(tpmfront_dev);
+abort_posttpmfront:
+   shutdown_tpmback();
+
+   cleanup_opt_args();
+
+   return 0;
+}
diff --git a/stubdom/vtpm/vtpm.h b/stubdom/vtpm/vtpm.h
new file mode 100644
index 0000000..5919e44
--- /dev/null
+++ b/stubdom/vtpm/vtpm.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef VTPM_H
+#define VTPM_H
+
+#include <stdbool.h>
+
+/* For testing */
+#define VERS_CMD "\x00\xC1\x00\x00\x00\x16\x00\x00\x00\x65\x00\x00\x00\x05\x00\x00\x00\x04\x00\x00\x01\x03"
+#define VERS_CMD_LEN 22
+
+/* Global commandline options */
+struct Opt_args {
+   enum StartUp {
+      ST_CLEAR = 1,
+      ST_SAVE = 2,
+      ST_DEACTIVATED = 3
+   } startup;
+   unsigned long hwinitpcrs;
+   int loglevel;
+   uint32_t tpmconf;
+   bool enable_maint_cmds;
+};
+extern struct Opt_args opt_args;
+
+#endif
diff --git a/stubdom/vtpm/vtpm_cmd.c b/stubdom/vtpm/vtpm_cmd.c
new file mode 100644
index 0000000..7eae98b
--- /dev/null
+++ b/stubdom/vtpm/vtpm_cmd.c
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <types.h>
+#include <xen/xen.h>
+#include <mm.h>
+#include <gnttab.h>
+#include "tpm/tpm_marshalling.h"
+#include "vtpm_manager.h"
+#include "vtpm_cmd.h"
+#include <tpmback.h>
+
+#define TRYFAILGOTO(C) \
+   if((C)) { \
+      status = TPM_FAIL; \
+      goto abort_egress; \
+   }
+#define TRYFAILGOTOMSG(C, msg) \
+   if((C)) { \
+      status = TPM_FAIL; \
+      error(msg); \
+      goto abort_egress; \
+   }
+#define CHECKSTATUSGOTO(ret, fname) \
+   if((ret) != TPM_SUCCESS) { \
+      error("%s failed with error code (%lu)", fname, (unsigned long) ret); \
+      status = ord; \
+      goto abort_egress; \
+   }
+
+#define ERR_MALFORMED "Malformed response from backend"
+#define ERR_TPMFRONT "Error sending command through frontend device"
+
+struct shpage {
+   void* page;
+   grant_ref_t grantref;
+};
+
+typedef struct shpage shpage_t;
+
+static inline int pack_header(uint8_t** bptr, UINT32* len, TPM_TAG tag, UINT32 size, TPM_COMMAND_CODE ord)
+{
+   return *bptr == NULL ||
+	 tpm_marshal_UINT16(bptr, len, tag) ||
+	 tpm_marshal_UINT32(bptr, len, size) ||
+	 tpm_marshal_UINT32(bptr, len, ord);
+}
+
+static inline int unpack_header(uint8_t** bptr, UINT32* len, TPM_TAG* tag, UINT32* size, TPM_COMMAND_CODE* ord)
+{
+   return *bptr == NULL ||
+	 tpm_unmarshal_UINT16(bptr, len, tag) ||
+	 tpm_unmarshal_UINT32(bptr, len, size) ||
+	 tpm_unmarshal_UINT32(bptr, len, ord);
+}
+
+int create_error_response(tpmcmd_t* tpmcmd, TPM_RESULT errorcode)
+{
+   TPM_TAG tag;
+   UINT32 len = tpmcmd->req_len;
+   uint8_t* respptr;
+   uint8_t* cmdptr = tpmcmd->req;
+
+   if(!tpm_unmarshal_UINT16(&cmdptr, &len, &tag)) {
+      switch (tag) {
+         case TPM_TAG_RQU_COMMAND:
+            tag = TPM_TAG_RSP_COMMAND;
+            break;
+         case TPM_TAG_RQU_AUTH1_COMMAND:
+            tag = TPM_TAG_RQU_AUTH2_COMMAND;
+            break;
+         case TPM_TAG_RQU_AUTH2_COMMAND:
+            tag = TPM_TAG_RQU_AUTH2_COMMAND;
+            break;
+      }
+   } else {
+      tag = TPM_TAG_RSP_COMMAND;
+   }
+
+   tpmcmd->resp_len = len = 10;
+   tpmcmd->resp = respptr = tpm_malloc(tpmcmd->resp_len);
+
+   return pack_header(&respptr, &len, tag, len, errorcode);
+}
+
+TPM_RESULT VTPM_GetRandom(struct tpmfront_dev* tpmfront_dev, BYTE* bytes, UINT32 *numbytes) {
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* cmdbuf, *resp, *bptr;
+   size_t resplen = 0;
+   UINT32 len;
+
+   /*Ask the real tpm for random bytes for the seed */
+   TPM_TAG tag = TPM_TAG_RQU_COMMAND;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = TPM_ORD_GetRandom;
+   len = size = sizeof(TPM_TAG) + sizeof(UINT32) + sizeof(TPM_COMMAND_CODE) + sizeof(UINT32);
+
+   /*Create the raw tpm command */
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   TRYFAILGOTO(tpm_marshal_UINT32(&bptr, &len, *numbytes));
+
+   /* Send cmd, wait for response */
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen),
+      ERR_TPMFRONT);
+
+   bptr = resp; len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   //Check return status of command
+   CHECKSTATUSGOTO(ord, "TPM_GetRandom()");
+
+   // Get the number of random bytes in the response
+   TRYFAILGOTOMSG(tpm_unmarshal_UINT32(&bptr, &len, &size), ERR_MALFORMED);
+   *numbytes = size;
+
+   //Get the random bytes out, tpm may give us less bytes than what we wanrt
+   TRYFAILGOTOMSG(tpm_unmarshal_BYTE_ARRAY(&bptr, &len, bytes, *numbytes), ERR_MALFORMED);
+
+   goto egress;
+abort_egress:
+egress:
+   free(cmdbuf);
+   return status;
+
+}
+
+TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* bptr, *resp;
+   uint8_t* cmdbuf = NULL;
+   size_t resplen = 0;
+   UINT32 len;
+
+   TPM_TAG tag = VTPM_TAG_REQ;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = VTPM_ORD_LOADHASHKEY;
+
+   /*Create the command*/
+   len = size = VTPM_COMMAND_HEADER_SIZE;
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+
+   /* Send the command to vtpm_manager */
+   info("Requesting Encryption key from backend");
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   /* Unpack response header */
+   bptr = resp;
+   len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   /* Check return code */
+   CHECKSTATUSGOTO(ord, "VTPM_LoadHashKey()");
+
+   /* Get the size of the key */
+   *data_length = size - VTPM_COMMAND_HEADER_SIZE;
+
+   /* Copy the key bits */
+   *data = malloc(*data_length);
+   memcpy(*data, bptr, *data_length);
+
+   goto egress;
+abort_egress:
+   error("VTPM_LoadHashKey failed");
+egress:
+   free(cmdbuf);
+   return status;
+}
+
+TPM_RESULT VTPM_SaveHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* bptr, *resp;
+   uint8_t* cmdbuf = NULL;
+   size_t resplen = 0;
+   UINT32 len;
+
+   TPM_TAG tag = VTPM_TAG_REQ;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = VTPM_ORD_SAVEHASHKEY;
+
+   /*Create the command*/
+   len = size = VTPM_COMMAND_HEADER_SIZE + data_length;
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   memcpy(bptr, data, data_length);
+   bptr += data_length;
+
+   /* Send the command to vtpm_manager */
+   info("Sending encryption key to backend");
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   /* Unpack response header */
+   bptr = resp;
+   len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   /* Check return code */
+   CHECKSTATUSGOTO(ord, "VTPM_SaveHashKey()");
+
+   goto egress;
+abort_egress:
+   error("VTPM_SaveHashKey failed");
+egress:
+   free(cmdbuf);
+   return status;
+}
+
+TPM_RESULT VTPM_PCRRead(struct tpmfront_dev* tpmfront_dev, UINT32 pcrIndex, BYTE* outDigest)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t *cmdbuf, *resp, *bptr;
+   size_t resplen = 0;
+   UINT32 len;
+
+   /*Just send a TPM_PCRRead Command to the HW tpm */
+   TPM_TAG tag = TPM_TAG_RQU_COMMAND;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = TPM_ORD_PCRRead;
+   len = size = sizeof(TPM_TAG) + sizeof(UINT32) + sizeof(TPM_COMMAND_CODE) + sizeof(UINT32);
+
+   /*Create the raw tpm cmd */
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   TRYFAILGOTO(tpm_marshal_UINT32(&bptr, &len, pcrIndex));
+
+   /*Send Cmd wait for response */
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   bptr = resp; len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   //Check return status of command
+   CHECKSTATUSGOTO(ord, "TPM_PCRRead");
+
+   //Get the ptr value
+   memcpy(outDigest, bptr, sizeof(TPM_PCRVALUE));
+
+   goto egress;
+abort_egress:
+egress:
+   free(cmdbuf);
+   return status;
+
+}
diff --git a/stubdom/vtpm/vtpm_cmd.h b/stubdom/vtpm/vtpm_cmd.h
new file mode 100644
index 0000000..b0bfa22
--- /dev/null
+++ b/stubdom/vtpm/vtpm_cmd.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef MANAGER_H
+#define MANAGER_H
+
+#include <tpmfront.h>
+#include <tpmback.h>
+#include "tpm/tpm_structures.h"
+
+/* Create a command response error header */
+int create_error_response(tpmcmd_t* tpmcmd, TPM_RESULT errorcode);
+/* Request random bytes from hardware tpm, returns 0 on success */
+TPM_RESULT VTPM_GetRandom(struct tpmfront_dev* tpmfront_dev, BYTE* bytes, UINT32* numbytes);
+/* Retreive 256 bit AES encryption key from manager */
+TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length);
+/* Manager securely saves our 256 bit AES encryption key */
+TPM_RESULT VTPM_SaveHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length);
+/* Send a TPM_PCRRead command passthrough the manager to the hw tpm */
+TPM_RESULT VTPM_PCRRead(struct tpmfront_dev* tpmfront_dev, UINT32 pcrIndex, BYTE* outDigest);
+
+#endif
diff --git a/stubdom/vtpm/vtpm_pcrs.c b/stubdom/vtpm/vtpm_pcrs.c
new file mode 100644
index 0000000..22a6cef
--- /dev/null
+++ b/stubdom/vtpm/vtpm_pcrs.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include "vtpm_pcrs.h"
+#include "vtpm_cmd.h"
+#include "tpm/tpm_data.h"
+
+#define PCR_VALUE      tpmData.permanent.data.pcrValue
+
+static int write_pcr_direct(unsigned int pcrIndex, uint8_t* val) {
+   if(pcrIndex > TPM_NUM_PCR) {
+      return TPM_BADINDEX;
+   }
+   memcpy(&PCR_VALUE[pcrIndex], val, sizeof(TPM_PCRVALUE));
+   return TPM_SUCCESS;
+}
+
+TPM_RESULT vtpm_initialize_hw_pcrs(struct tpmfront_dev* tpmfront_dev, unsigned long pcrs)
+{
+   TPM_RESULT rc = TPM_SUCCESS;
+   uint8_t digest[sizeof(TPM_PCRVALUE)];
+
+   for(unsigned int i = 0; i < TPM_NUM_PCR; ++i) {
+      if(pcrs & 1 << i) {
+         if((rc = VTPM_PCRRead(tpmfront_dev, i, digest)) != TPM_SUCCESS) {
+            error("TPM_PCRRead failed with error : %d", rc);
+            return rc;
+         }
+         write_pcr_direct(i, digest);
+      }
+   }
+
+   return rc;
+}
diff --git a/stubdom/vtpm/vtpm_pcrs.h b/stubdom/vtpm/vtpm_pcrs.h
new file mode 100644
index 0000000..11835f9
--- /dev/null
+++ b/stubdom/vtpm/vtpm_pcrs.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef VTPM_PCRS_H
+#define VTPM_PCRS_H
+
+#include "tpm/tpm_structures.h"
+
+#define VTPM_PCR0 1
+#define VTPM_PCR1 1 << 1
+#define VTPM_PCR2 1 << 2
+#define VTPM_PCR3 1 << 3
+#define VTPM_PCR4 1 << 4
+#define VTPM_PCR5 1 << 5
+#define VTPM_PCR6 1 << 6
+#define VTPM_PCR7 1 << 7
+#define VTPM_PCR8 1 << 8
+#define VTPM_PCR9 1 << 9
+#define VTPM_PCR10 1 << 10
+#define VTPM_PCR11 1 << 11
+#define VTPM_PCR12 1 << 12
+#define VTPM_PCR13 1 << 13
+#define VTPM_PCR14 1 << 14
+#define VTPM_PCR15 1 << 15
+#define VTPM_PCR16 1 << 16
+#define VTPM_PCR17 1 << 17
+#define VTPM_PCR18 1 << 18
+#define VTPM_PCR19 1 << 19
+#define VTPM_PCR20 1 << 20
+#define VTPM_PCR21 1 << 21
+#define VTPM_PCR22 1 << 22
+#define VTPM_PCR23 1 << 23
+
+#define VTPM_PCRALL (1 << TPM_NUM_PCR) - 1
+#define VTPM_PCRNONE 0
+
+#define VTPM_NUMPCRS 24
+
+struct tpmfront_dev;
+
+TPM_RESULT vtpm_initialize_hw_pcrs(struct tpmfront_dev* tpmfront_dev, unsigned long pcrs);
+
+
+#endif
diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
new file mode 100644
index 0000000..b343bd8
--- /dev/null
+++ b/stubdom/vtpm/vtpmblk.c
@@ -0,0 +1,307 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <mini-os/byteorder.h>
+#include "vtpmblk.h"
+#include "tpm/tpm_marshalling.h"
+#include "vtpm_cmd.h"
+#include "polarssl/aes.h"
+#include "polarssl/sha1.h"
+#include <blkfront.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+
+/*Encryption key and block sizes */
+#define BLKSZ 16
+
+static struct blkfront_dev* blkdev = NULL;
+static int blkfront_fd = -1;
+
+int init_vtpmblk(struct tpmfront_dev* tpmfront_dev)
+{
+   struct blkfront_info blkinfo;
+   info("Initializing persistent NVM storage\n");
+
+   if((blkdev = init_blkfront(NULL, &blkinfo)) == NULL) {
+      error("BLKIO: ERROR Unable to initialize blkfront");
+      return -1;
+   }
+   if (blkinfo.info & VDISK_READONLY || blkinfo.mode != O_RDWR) {
+      error("BLKIO: ERROR block device is read only!");
+      goto error;
+   }
+   if((blkfront_fd = blkfront_open(blkdev)) == -1) {
+      error("Unable to open blkfront file descriptor!");
+      goto error;
+   }
+
+   return 0;
+error:
+   shutdown_blkfront(blkdev);
+   blkdev = NULL;
+   return -1;
+}
+
+void shutdown_vtpmblk(void)
+{
+   close(blkfront_fd);
+   blkfront_fd = -1;
+   blkdev = NULL;
+}
+
+int write_vtpmblk_raw(uint8_t *data, size_t data_length)
+{
+   int rc;
+   uint32_t lenbuf;
+   debug("Begin Write data=%p len=%u", data, data_length);
+
+   lenbuf = cpu_to_be32((uint32_t)data_length);
+
+   lseek(blkfront_fd, 0, SEEK_SET);
+   if((rc = write(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
+      error("write(length) failed! error was %s", strerror(errno));
+      return -1;
+   }
+   if((rc = write(blkfront_fd, data, data_length)) != data_length) {
+      error("write(data) failed! error was %s", strerror(errno));
+      return -1;
+   }
+
+   info("Wrote %u bytes to NVM persistent storage", data_length);
+
+   return 0;
+}
+
+int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
+{
+   int rc;
+   uint32_t lenbuf;
+
+   lseek(blkfront_fd, 0, SEEK_SET);
+   if(( rc = read(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
+      error("read(length) failed! error was %s", strerror(errno));
+      return -1;
+   }
+   *data_length = (size_t) cpu_to_be32(lenbuf);
+   if(*data_length == 0) {
+      error("read 0 data_length for NVM");
+      return -1;
+   }
+
+   *data = tpm_malloc(*data_length);
+   if((rc = read(blkfront_fd, *data, *data_length)) != *data_length) {
+      error("read(data) failed! error was %s", strerror(errno));
+      return -1;
+   }
+
+   info("Read %u bytes from NVM persistent storage", *data_length);
+   return 0;
+}
+
+int encrypt_vtpmblk(uint8_t* clear, size_t clear_len, uint8_t** cipher, size_t* cipher_len, uint8_t* symkey)
+{
+   int rc = 0;
+   uint8_t iv[BLKSZ];
+   aes_context aes_ctx;
+   UINT32 temp;
+   int mod;
+
+   uint8_t* clbuf = NULL;
+
+   uint8_t* ivptr;
+   int ivlen;
+
+   uint8_t* cptr;	//Cipher block pointer
+   int clen;	//Cipher block length
+
+   /*Create a new 256 bit encryption key */
+   if(symkey == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+   tpm_get_extern_random_bytes(symkey, NVMKEYSZ);
+
+   /*Setup initialization vector - random bits and then 4 bytes clear text size at the end*/
+   temp = sizeof(UINT32);
+   ivlen = BLKSZ - temp;
+   tpm_get_extern_random_bytes(iv, ivlen);
+   ivptr = iv + ivlen;
+   tpm_marshal_UINT32(&ivptr, &temp, (UINT32) clear_len);
+
+   /*The clear text needs to be padded out to a multiple of BLKSZ */
+   mod = clear_len % BLKSZ;
+   clen = mod ? clear_len + BLKSZ - mod : clear_len;
+   clbuf = malloc(clen);
+   if (clbuf == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+   memcpy(clbuf, clear, clear_len);
+   /* zero out the padding bits - FIXME: better / more secure way to handle these? */
+   if(clen - clear_len) {
+      memset(clbuf + clear_len, 0, clen - clear_len);
+   }
+
+   /* Setup the ciphertext buffer */
+   *cipher_len = BLKSZ + clen;		/*iv + ciphertext */
+   cptr = *cipher = malloc(*cipher_len);
+   if (*cipher == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Copy the IV to cipher text blob*/
+   memcpy(cptr, iv, BLKSZ);
+   cptr += BLKSZ;
+
+   /* Setup encryption */
+   aes_setkey_enc(&aes_ctx, symkey, 256);
+
+   /* Do encryption now */
+   aes_crypt_cbc(&aes_ctx, AES_ENCRYPT, clen, iv, clbuf, cptr);
+
+   goto egress;
+abort_egress:
+egress:
+   free(clbuf);
+   return rc;
+}
+int decrypt_vtpmblk(uint8_t* cipher, size_t cipher_len, uint8_t** clear, size_t* clear_len, uint8_t* symkey)
+{
+   int rc = 0;
+   uint8_t iv[BLKSZ];
+   uint8_t* ivptr;
+   UINT32 u32, temp;
+   aes_context aes_ctx;
+
+   uint8_t* cptr = cipher;	//cipher block pointer
+   int clen = cipher_len;	//cipher block length
+
+   /* Pull out the initialization vector */
+   memcpy(iv, cipher, BLKSZ);
+   cptr += BLKSZ;
+   clen -= BLKSZ;
+
+   /* Setup the clear text buffer */
+   if((*clear = malloc(clen)) == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Get the length of clear text from last 4 bytes of iv */
+   temp = sizeof(UINT32);
+   ivptr = iv + BLKSZ - temp;
+   tpm_unmarshal_UINT32(&ivptr, &temp, &u32);
+   *clear_len = u32;
+
+   /* Setup decryption */
+   aes_setkey_dec(&aes_ctx, symkey, 256);
+
+   /* Do decryption now */
+   if ((clen % BLKSZ) != 0) {
+      error("Decryption Error: Cipher block size was not a multiple of %u", BLKSZ);
+      rc = -1;
+      goto abort_egress;
+   }
+   aes_crypt_cbc(&aes_ctx, AES_DECRYPT, clen, iv, cptr, *clear);
+
+   goto egress;
+abort_egress:
+egress:
+   return rc;
+}
+
+int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length) {
+   int rc;
+   uint8_t* cipher = NULL;
+   size_t cipher_len = 0;
+   uint8_t hashkey[HASHKEYSZ];
+   uint8_t* symkey = hashkey + HASHSZ;
+
+   /* Encrypt the data */
+   if((rc = encrypt_vtpmblk(data, data_length, &cipher, &cipher_len, symkey))) {
+      goto abort_egress;
+   }
+   /* Write to disk */
+   if((rc = write_vtpmblk_raw(cipher, cipher_len))) {
+      goto abort_egress;
+   }
+   /* Get sha1 hash of data */
+   sha1(cipher, cipher_len, hashkey);
+
+   /* Send hash and key to manager */
+   if((rc = VTPM_SaveHashKey(tpmfront_dev, hashkey, HASHKEYSZ)) != TPM_SUCCESS) {
+      goto abort_egress;
+   }
+   goto egress;
+abort_egress:
+egress:
+   free(cipher);
+   return rc;
+}
+
+int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data_length) {
+   int rc;
+   uint8_t* cipher = NULL;
+   size_t cipher_len = 0;
+   size_t keysize;
+   uint8_t* hashkey = NULL;
+   uint8_t hash[HASHSZ];
+   uint8_t* symkey;
+
+   /* Retreive the hash and the key from the manager */
+   if((rc = VTPM_LoadHashKey(tpmfront_dev, &hashkey, &keysize)) != TPM_SUCCESS) {
+      goto abort_egress;
+   }
+   if(keysize != HASHKEYSZ) {
+      error("Manager returned a hashkey of invalid size! expected %d, actual %d", NVMKEYSZ, keysize);
+      rc = -1;
+      goto abort_egress;
+   }
+   symkey = hashkey + HASHSZ;
+
+   /* Read from disk now */
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len))) {
+      goto abort_egress;
+   }
+
+   /* Compute the hash of the cipher text and compare */
+   sha1(cipher, cipher_len, hash);
+   if(memcmp(hash, hashkey, HASHSZ)) {
+      int i;
+      error("NVM Storage Checksum failed!");
+      printf("Expected: ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hashkey[i]);
+      }
+      printf("\n");
+      printf("Actual:   ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hash[i]);
+      }
+      printf("\n");
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Decrypt the blob */
+   if((rc = decrypt_vtpmblk(cipher, cipher_len, data, data_length, symkey))) {
+      goto abort_egress;
+   }
+   goto egress;
+abort_egress:
+egress:
+   free(cipher);
+   free(hashkey);
+   return rc;
+}
diff --git a/stubdom/vtpm/vtpmblk.h b/stubdom/vtpm/vtpmblk.h
new file mode 100644
index 0000000..282ce6a
--- /dev/null
+++ b/stubdom/vtpm/vtpmblk.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef NVM_H
+#define NVM_H
+#include <mini-os/types.h>
+#include <xen/xen.h>
+#include <tpmfront.h>
+
+#define NVMKEYSZ 32
+#define HASHSZ 20
+#define HASHKEYSZ (NVMKEYSZ + HASHSZ)
+
+int init_vtpmblk(struct tpmfront_dev* tpmfront_dev);
+void shutdown_vtpmblk(void);
+
+/* Encrypts and writes data to blk device */
+int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t *data, size_t data_length);
+/* Reads, Decrypts, and returns data from blk device */
+int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t **data, size_t *data_length);
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:22:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaoiE-0005jD-25; Tue, 20 Nov 2012 14:22:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaoiC-0005j3-98
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:22:04 +0000
Received: from [193.109.254.147:15291] by server-6.bemta-14.messagelabs.com id
	41/14-02788-B029BA05; Tue, 20 Nov 2012 14:22:03 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-12.tower-27.messagelabs.com!1353421321!9538388!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18267 invoked from network); 20 Nov 2012 14:22:02 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-12.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 20 Nov 2012 14:22:02 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149572018;
	Tue, 20 Nov 2012 09:21:53 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org,
	Ian.Campbell@citrix.com
Date: Tue, 20 Nov 2012 09:21:12 -0500
Message-Id: <1353421272-24797-5-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v4 5/5] Add cmake dependency to README
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 README |    1 +
 1 file changed, 1 insertion(+)

diff --git a/README b/README
index 21a81b2..aa290e5 100644
--- a/README
+++ b/README
@@ -52,6 +52,7 @@ provided by your OS distributor:
       greater. Set CONFIG_SYSTEM_LIBAIO in .config if this is not available.
     * Development install of GLib v2.0 (e.g. libglib2.0-dev)
     * pkg-config
+    * cmake
     * bridge-utils package (/sbin/brctl)
     * iproute package (/sbin/ip)
     * udev
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:22:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaoiE-0005jD-25; Tue, 20 Nov 2012 14:22:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaoiC-0005j3-98
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:22:04 +0000
Received: from [193.109.254.147:15291] by server-6.bemta-14.messagelabs.com id
	41/14-02788-B029BA05; Tue, 20 Nov 2012 14:22:03 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-12.tower-27.messagelabs.com!1353421321!9538388!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18267 invoked from network); 20 Nov 2012 14:22:02 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-12.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 20 Nov 2012 14:22:02 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149572018;
	Tue, 20 Nov 2012 09:21:53 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org,
	Ian.Campbell@citrix.com
Date: Tue, 20 Nov 2012 09:21:12 -0500
Message-Id: <1353421272-24797-5-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v4 5/5] Add cmake dependency to README
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 README |    1 +
 1 file changed, 1 insertion(+)

diff --git a/README b/README
index 21a81b2..aa290e5 100644
--- a/README
+++ b/README
@@ -52,6 +52,7 @@ provided by your OS distributor:
       greater. Set CONFIG_SYSTEM_LIBAIO in .config if this is not available.
     * Development install of GLib v2.0 (e.g. libglib2.0-dev)
     * pkg-config
+    * cmake
     * bridge-utils package (/sbin/brctl)
     * iproute package (/sbin/ip)
     * udev
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:22:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaoiH-0005jr-4s; Tue, 20 Nov 2012 14:22:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaoiF-0005jM-10
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:22:07 +0000
Received: from [85.158.137.99:22332] by server-14.bemta-3.messagelabs.com id
	B5/8D-12788-E029BA05; Tue, 20 Nov 2012 14:22:06 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-11.tower-217.messagelabs.com!1353421319!18994555!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD,UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22806 invoked from network); 20 Nov 2012 14:22:02 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-11.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 20 Nov 2012 14:22:02 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149572009;
	Tue, 20 Nov 2012 09:21:53 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org,
	Ian.Campbell@citrix.com
Date: Tue, 20 Nov 2012 09:21:08 -0500
Message-Id: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v4 1/5] add vtpm-stubdom code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add the code base for vtpm-stubdom to the stubdom
heirarchy. Makefile changes in later patch.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/vtpm/Makefile    |   37 +++++
 stubdom/vtpm/minios.cfg  |   14 ++
 stubdom/vtpm/vtpm.c      |  404 ++++++++++++++++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm.h      |   36 +++++
 stubdom/vtpm/vtpm_cmd.c  |  256 +++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm_cmd.h  |   31 ++++
 stubdom/vtpm/vtpm_pcrs.c |   43 +++++
 stubdom/vtpm/vtpm_pcrs.h |   53 ++++++
 stubdom/vtpm/vtpmblk.c   |  307 +++++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpmblk.h   |   31 ++++
 10 files changed, 1212 insertions(+)
 create mode 100644 stubdom/vtpm/Makefile
 create mode 100644 stubdom/vtpm/minios.cfg
 create mode 100644 stubdom/vtpm/vtpm.c
 create mode 100644 stubdom/vtpm/vtpm.h
 create mode 100644 stubdom/vtpm/vtpm_cmd.c
 create mode 100644 stubdom/vtpm/vtpm_cmd.h
 create mode 100644 stubdom/vtpm/vtpm_pcrs.c
 create mode 100644 stubdom/vtpm/vtpm_pcrs.h
 create mode 100644 stubdom/vtpm/vtpmblk.c
 create mode 100644 stubdom/vtpm/vtpmblk.h

diff --git a/stubdom/vtpm/Makefile b/stubdom/vtpm/Makefile
new file mode 100644
index 0000000..686c0ea
--- /dev/null
+++ b/stubdom/vtpm/Makefile
@@ -0,0 +1,37 @@
+# Copyright (c) 2010-2012 United States Government, as represented by
+# the Secretary of Defense.  All rights reserved.
+#
+# THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+# ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+# INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+# DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+# SOFTWARE.
+#
+
+XEN_ROOT=../..
+
+PSSL_DIR=../polarssl-$(XEN_TARGET_ARCH)/library
+PSSL_OBJS=aes.o sha1.o entropy.o ctr_drbg.o sha4.o
+
+TARGET=vtpm.a
+OBJS=vtpm.o vtpm_cmd.o vtpmblk.o vtpm_pcrs.o
+
+
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/build
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/tpm
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/crypto
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)
+
+$(TARGET): $(OBJS)
+	ar -cr $@ $(OBJS) $(TPMEMU_OBJS) $(foreach obj,$(PSSL_OBJS),$(PSSL_DIR)/$(obj))
+
+$(OBJS): vtpm_manager.h
+
+vtpm_manager.h:
+	ln -s ../vtpmmgr/vtpm_manager.h vtpm_manager.h
+
+clean:
+	-rm $(TARGET) $(OBJS) vtpm_manager.h
+
+.PHONY: clean
diff --git a/stubdom/vtpm/minios.cfg b/stubdom/vtpm/minios.cfg
new file mode 100644
index 0000000..31652ee
--- /dev/null
+++ b/stubdom/vtpm/minios.cfg
@@ -0,0 +1,14 @@
+CONFIG_TPMFRONT=y
+CONFIG_TPM_TIS=n
+CONFIG_TPMBACK=y
+CONFIG_START_NETWORK=n
+CONFIG_TEST=n
+CONFIG_PCIFRONT=n
+CONFIG_BLKFRONT=y
+CONFIG_NETFRONT=n
+CONFIG_FBFRONT=n
+CONFIG_KBDFRONT=n
+CONFIG_CONSFRONT=n
+CONFIG_XENBUS=y
+CONFIG_LWIP=n
+CONFIG_XC=n
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
new file mode 100644
index 0000000..71aef78
--- /dev/null
+++ b/stubdom/vtpm/vtpm.c
@@ -0,0 +1,404 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <syslog.h>
+#include <stdbool.h>
+#include <errno.h>
+#include <sys/time.h>
+#include <xen/xen.h>
+#include <tpmback.h>
+#include <tpmfront.h>
+
+#include <polarssl/entropy.h>
+#include <polarssl/ctr_drbg.h>
+
+#include "tpm/tpm_emulator_extern.h"
+#include "tpm/tpm_marshalling.h"
+#include "vtpm.h"
+#include "vtpm_cmd.h"
+#include "vtpm_pcrs.h"
+#include "vtpmblk.h"
+
+#define TPM_LOG_INFO LOG_INFO
+#define TPM_LOG_ERROR LOG_ERR
+#define TPM_LOG_DEBUG LOG_DEBUG
+
+/* Global commandline options - default values */
+struct Opt_args opt_args = {
+   .startup = ST_CLEAR,
+   .loglevel = TPM_LOG_INFO,
+   .hwinitpcrs = VTPM_PCRNONE,
+   .tpmconf = 0,
+   .enable_maint_cmds = false,
+};
+
+static uint32_t badords[32];
+static unsigned int n_badords = 0;
+
+entropy_context entropy;
+ctr_drbg_context ctr_drbg;
+
+struct tpmfront_dev* tpmfront_dev;
+
+void vtpm_get_extern_random_bytes(void *buf, size_t nbytes)
+{
+   ctr_drbg_random(&ctr_drbg, buf, nbytes);
+}
+
+int vtpm_read_from_file(uint8_t **data, size_t *data_length) {
+   return read_vtpmblk(tpmfront_dev, data, data_length);
+}
+
+int vtpm_write_to_file(uint8_t *data, size_t data_length) {
+   return write_vtpmblk(tpmfront_dev, data, data_length);
+}
+
+int vtpm_extern_init_fake(void) {
+   return 0;
+}
+
+void vtpm_extern_release_fake(void) {
+}
+
+
+void vtpm_log(int priority, const char *fmt, ...)
+{
+   if(opt_args.loglevel >= priority) {
+      va_list v;
+      va_start(v, fmt);
+      vprintf(fmt, v);
+      va_end(v);
+   }
+}
+
+static uint64_t vtpm_get_ticks(void)
+{
+  static uint64_t old_t = 0;
+  uint64_t new_t, res_t;
+  struct timeval tv;
+  gettimeofday(&tv, NULL);
+  new_t = (uint64_t)tv.tv_sec * 1000000 + (uint64_t)tv.tv_usec;
+  res_t = (old_t > 0) ? new_t - old_t : 0;
+  old_t = new_t;
+  return res_t;
+}
+
+
+static int tpm_entropy_source(void* dummy, unsigned char* data, size_t len, size_t* olen) {
+   UINT32 sz = len;
+   TPM_RESULT rc = VTPM_GetRandom(tpmfront_dev, data, &sz);
+   *olen = sz;
+   return rc == TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
+}
+
+int init_random(void) {
+   /* Initialize the rng */
+   entropy_init(&entropy);
+   entropy_add_source(&entropy, tpm_entropy_source, NULL, 0);
+   entropy_gather(&entropy);
+   ctr_drbg_init(&ctr_drbg, entropy_func, &entropy, NULL, 0);
+   ctr_drbg_set_prediction_resistance( &ctr_drbg, CTR_DRBG_PR_OFF );
+
+   return 0;
+}
+
+int check_ordinal(tpmcmd_t* tpmcmd) {
+   TPM_COMMAND_CODE ord;
+   UINT32 len = 4;
+   BYTE* ptr;
+   unsigned int i;
+
+   if(tpmcmd->req_len < 10) {
+      return true;
+   }
+
+   ptr = tpmcmd->req + 6;
+   tpm_unmarshal_UINT32(&ptr, &len, &ord);
+
+   for(i = 0; i < n_badords; ++i) {
+      if(ord == badords[i]) {
+         error("Disabled command ordinal (%" PRIu32") requested!\n");
+         return false;
+      }
+   }
+   return true;
+}
+
+static void main_loop(void) {
+   tpmcmd_t* tpmcmd = NULL;
+   domid_t domid;		/* Domid of frontend */
+   unsigned int handle;	/* handle of frontend */
+   int res = -1;
+
+   info("VTPM Initializing\n");
+
+   /* Set required tpm config args */
+   opt_args.tpmconf |= TPM_CONF_STRONG_PERSISTENCE;
+   opt_args.tpmconf &= ~TPM_CONF_USE_INTERNAL_PRNG;
+   opt_args.tpmconf |= TPM_CONF_GENERATE_EK;
+   opt_args.tpmconf |= TPM_CONF_GENERATE_SEED_DAA;
+
+   /* Initialize the emulator */
+   tpm_emulator_init(opt_args.startup, opt_args.tpmconf);
+
+   /* Initialize any requested PCRs with hardware TPM values */
+   if(vtpm_initialize_hw_pcrs(tpmfront_dev, opt_args.hwinitpcrs) != TPM_SUCCESS) {
+      error("Failed to initialize PCRs with hardware TPM values");
+      goto abort_postpcrs;
+   }
+
+   /* Wait for the frontend domain to connect */
+   info("Waiting for frontend domain to connect..");
+   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
+      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
+   } else {
+      error("Unable to attach to a frontend");
+   }
+
+   tpmcmd = tpmback_req(domid, handle);
+   while(tpmcmd) {
+      /* Handle the request */
+      if(tpmcmd->req_len) {
+	 tpmcmd->resp = NULL;
+	 tpmcmd->resp_len = 0;
+
+         /* First check for disabled ordinals */
+         if(!check_ordinal(tpmcmd)) {
+            create_error_response(tpmcmd, TPM_BAD_ORDINAL);
+         }
+         /* If not disabled, do the command */
+         else {
+            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
+               error("tpm_handle_command() failed");
+               create_error_response(tpmcmd, TPM_FAIL);
+            }
+         }
+      }
+
+      /* Send the response */
+      tpmback_resp(tpmcmd);
+
+      /* Wait for the next request */
+      tpmcmd = tpmback_req(domid, handle);
+
+   }
+
+abort_postpcrs:
+   info("VTPM Shutting down\n");
+
+   tpm_emulator_shutdown();
+}
+
+int parse_cmd_line(int argc, char** argv)
+{
+   char sval[25];
+   char* logstr = NULL;
+   /* Parse the command strings */
+   for(unsigned int i = 1; i < argc; ++i) {
+      if (sscanf(argv[i], "loglevel=%25s", sval) == 1){
+	 if (!strcmp(sval, "debug")) {
+	    opt_args.loglevel = TPM_LOG_DEBUG;
+	    logstr = "debug";
+	 }
+	 else if (!strcmp(sval, "info")) {
+	    logstr = "info";
+	    opt_args.loglevel = TPM_LOG_INFO;
+	 }
+	 else if (!strcmp(sval, "error")) {
+	    logstr = "error";
+	    opt_args.loglevel = TPM_LOG_ERROR;
+	 }
+      }
+      else if (!strcmp(argv[i], "clear")) {
+	 opt_args.startup = ST_CLEAR;
+      }
+      else if (!strcmp(argv[i], "save")) {
+	 opt_args.startup = ST_SAVE;
+      }
+      else if (!strcmp(argv[i], "deactivated")) {
+	 opt_args.startup = ST_DEACTIVATED;
+      }
+      else if (!strncmp(argv[i], "maintcmds=", 10)) {
+         if(!strcmp(argv[i] + 10, "1")) {
+            opt_args.enable_maint_cmds = true;
+         } else if(!strcmp(argv[i] + 10, "0")) {
+            opt_args.enable_maint_cmds = false;
+         }
+      }
+      else if(!strncmp(argv[i], "hwinitpcr=", 10)) {
+         char *pch = argv[i] + 10;
+         unsigned int v1, v2;
+         pch = strtok(pch, ",");
+         while(pch != NULL) {
+            if(!strcmp(pch, "all")) {
+               //Set all
+               opt_args.hwinitpcrs = VTPM_PCRALL;
+            } else if(!strcmp(pch, "none")) {
+               //Set none
+               opt_args.hwinitpcrs = VTPM_PCRNONE;
+            } else if(sscanf(pch, "%u", &v1) == 1) {
+               //Set one
+               if(v1 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               opt_args.hwinitpcrs |= (1 << v1);
+            } else if(sscanf(pch, "%u-%u", &v1, &v2) == 2) {
+               //Set range
+               if(v1 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               if(v2 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               if(v2 < v1) {
+                  unsigned tp = v1;
+                  v1 = v2;
+                  v2 = tp;
+               }
+               for(unsigned int i = v1; i <= v2; ++i) {
+                  opt_args.hwinitpcrs |= (1 << i);
+               }
+            } else {
+               error("hwintipcr error: Invalid PCR specification : %s", pch);
+               return -1;
+            }
+            pch = strtok(NULL, ",");
+         }
+      }
+      else {
+	 error("Invalid command line option `%s'", argv[i]);
+      }
+
+   }
+
+   /* Check Errors and print results */
+   switch(opt_args.startup) {
+      case ST_CLEAR:
+	 info("Startup mode is `clear'");
+	 break;
+      case ST_SAVE:
+	 info("Startup mode is `save'");
+	 break;
+      case ST_DEACTIVATED:
+	 info("Startup mode is `deactivated'");
+	 break;
+      default:
+	 error("Invalid startup mode %d", opt_args.startup);
+	 return -1;
+   }
+
+   if(opt_args.hwinitpcrs & (VTPM_PCRALL))
+   {
+      char pcrstr[1024];
+      char* ptr = pcrstr;
+
+      pcrstr[0] = '\0';
+      info("The following PCRs will be initialized with values from the hardware TPM:");
+      for(unsigned int i = 0; i < TPM_NUM_PCR; ++i) {
+         if(opt_args.hwinitpcrs & (1 << i)) {
+            ptr += sprintf(ptr, "%u, ", i);
+         }
+      }
+      /* get rid of the last comma if any numbers were printed */
+      *(ptr -2) = '\0';
+
+      info("\t%s", pcrstr);
+   } else {
+      info("All PCRs initialized to default values");
+   }
+
+   if(!opt_args.enable_maint_cmds) {
+      info("TPM Maintenance Commands disabled");
+      badords[n_badords++] = TPM_ORD_CreateMaintenanceArchive;
+      badords[n_badords++] = TPM_ORD_LoadMaintenanceArchive;
+      badords[n_badords++] = TPM_ORD_KillMaintenanceFeature;
+      badords[n_badords++] = TPM_ORD_LoadManuMaintPub;
+      badords[n_badords++] = TPM_ORD_ReadManuMaintPub;
+   } else {
+      info("TPM Maintenance Commands enabled");
+   }
+
+   info("Log level set to %s", logstr);
+
+   return 0;
+}
+
+void cleanup_opt_args(void) {
+}
+
+int main(int argc, char **argv)
+{
+   //FIXME: initializing blkfront without this sleep causes the domain to crash on boot
+   sleep(2);
+
+   /* Setup extern function pointers */
+   tpm_extern_init = vtpm_extern_init_fake;
+   tpm_extern_release = vtpm_extern_release_fake;
+   tpm_malloc = malloc;
+   tpm_free = free;
+   tpm_log = vtpm_log;
+   tpm_get_ticks = vtpm_get_ticks;
+   tpm_get_extern_random_bytes = vtpm_get_extern_random_bytes;
+   tpm_write_to_storage = vtpm_write_to_file;
+   tpm_read_from_storage = vtpm_read_from_file;
+
+   info("starting TPM Emulator (1.2.%d.%d-%d)", VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD);
+   if(parse_cmd_line(argc, argv)) {
+      error("Error parsing commandline\n");
+      return -1;
+   }
+
+   /* Initialize devices */
+   init_tpmback();
+   if((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
+      error("Unable to initialize tpmfront device");
+      goto abort_posttpmfront;
+   }
+
+   /* Seed the RNG with entropy from hardware TPM */
+   if(init_random()) {
+      error("Unable to initialize RNG");
+      goto abort_postrng;
+   }
+
+   /* Initialize blkfront device */
+   if(init_vtpmblk(tpmfront_dev)) {
+      error("Unable to initialize Blkfront persistent storage");
+      goto abort_postvtpmblk;
+   }
+
+   /* Run main loop */
+   main_loop();
+
+   /* Shutdown blkfront */
+   shutdown_vtpmblk();
+abort_postvtpmblk:
+abort_postrng:
+
+   /* Close devices */
+   shutdown_tpmfront(tpmfront_dev);
+abort_posttpmfront:
+   shutdown_tpmback();
+
+   cleanup_opt_args();
+
+   return 0;
+}
diff --git a/stubdom/vtpm/vtpm.h b/stubdom/vtpm/vtpm.h
new file mode 100644
index 0000000..5919e44
--- /dev/null
+++ b/stubdom/vtpm/vtpm.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef VTPM_H
+#define VTPM_H
+
+#include <stdbool.h>
+
+/* For testing */
+#define VERS_CMD "\x00\xC1\x00\x00\x00\x16\x00\x00\x00\x65\x00\x00\x00\x05\x00\x00\x00\x04\x00\x00\x01\x03"
+#define VERS_CMD_LEN 22
+
+/* Global commandline options */
+struct Opt_args {
+   enum StartUp {
+      ST_CLEAR = 1,
+      ST_SAVE = 2,
+      ST_DEACTIVATED = 3
+   } startup;
+   unsigned long hwinitpcrs;
+   int loglevel;
+   uint32_t tpmconf;
+   bool enable_maint_cmds;
+};
+extern struct Opt_args opt_args;
+
+#endif
diff --git a/stubdom/vtpm/vtpm_cmd.c b/stubdom/vtpm/vtpm_cmd.c
new file mode 100644
index 0000000..7eae98b
--- /dev/null
+++ b/stubdom/vtpm/vtpm_cmd.c
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <types.h>
+#include <xen/xen.h>
+#include <mm.h>
+#include <gnttab.h>
+#include "tpm/tpm_marshalling.h"
+#include "vtpm_manager.h"
+#include "vtpm_cmd.h"
+#include <tpmback.h>
+
+#define TRYFAILGOTO(C) \
+   if((C)) { \
+      status = TPM_FAIL; \
+      goto abort_egress; \
+   }
+#define TRYFAILGOTOMSG(C, msg) \
+   if((C)) { \
+      status = TPM_FAIL; \
+      error(msg); \
+      goto abort_egress; \
+   }
+#define CHECKSTATUSGOTO(ret, fname) \
+   if((ret) != TPM_SUCCESS) { \
+      error("%s failed with error code (%lu)", fname, (unsigned long) ret); \
+      status = ord; \
+      goto abort_egress; \
+   }
+
+#define ERR_MALFORMED "Malformed response from backend"
+#define ERR_TPMFRONT "Error sending command through frontend device"
+
+struct shpage {
+   void* page;
+   grant_ref_t grantref;
+};
+
+typedef struct shpage shpage_t;
+
+static inline int pack_header(uint8_t** bptr, UINT32* len, TPM_TAG tag, UINT32 size, TPM_COMMAND_CODE ord)
+{
+   return *bptr == NULL ||
+	 tpm_marshal_UINT16(bptr, len, tag) ||
+	 tpm_marshal_UINT32(bptr, len, size) ||
+	 tpm_marshal_UINT32(bptr, len, ord);
+}
+
+static inline int unpack_header(uint8_t** bptr, UINT32* len, TPM_TAG* tag, UINT32* size, TPM_COMMAND_CODE* ord)
+{
+   return *bptr == NULL ||
+	 tpm_unmarshal_UINT16(bptr, len, tag) ||
+	 tpm_unmarshal_UINT32(bptr, len, size) ||
+	 tpm_unmarshal_UINT32(bptr, len, ord);
+}
+
+int create_error_response(tpmcmd_t* tpmcmd, TPM_RESULT errorcode)
+{
+   TPM_TAG tag;
+   UINT32 len = tpmcmd->req_len;
+   uint8_t* respptr;
+   uint8_t* cmdptr = tpmcmd->req;
+
+   if(!tpm_unmarshal_UINT16(&cmdptr, &len, &tag)) {
+      switch (tag) {
+         case TPM_TAG_RQU_COMMAND:
+            tag = TPM_TAG_RSP_COMMAND;
+            break;
+         case TPM_TAG_RQU_AUTH1_COMMAND:
+            tag = TPM_TAG_RQU_AUTH2_COMMAND;
+            break;
+         case TPM_TAG_RQU_AUTH2_COMMAND:
+            tag = TPM_TAG_RQU_AUTH2_COMMAND;
+            break;
+      }
+   } else {
+      tag = TPM_TAG_RSP_COMMAND;
+   }
+
+   tpmcmd->resp_len = len = 10;
+   tpmcmd->resp = respptr = tpm_malloc(tpmcmd->resp_len);
+
+   return pack_header(&respptr, &len, tag, len, errorcode);
+}
+
+TPM_RESULT VTPM_GetRandom(struct tpmfront_dev* tpmfront_dev, BYTE* bytes, UINT32 *numbytes) {
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* cmdbuf, *resp, *bptr;
+   size_t resplen = 0;
+   UINT32 len;
+
+   /*Ask the real tpm for random bytes for the seed */
+   TPM_TAG tag = TPM_TAG_RQU_COMMAND;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = TPM_ORD_GetRandom;
+   len = size = sizeof(TPM_TAG) + sizeof(UINT32) + sizeof(TPM_COMMAND_CODE) + sizeof(UINT32);
+
+   /*Create the raw tpm command */
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   TRYFAILGOTO(tpm_marshal_UINT32(&bptr, &len, *numbytes));
+
+   /* Send cmd, wait for response */
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen),
+      ERR_TPMFRONT);
+
+   bptr = resp; len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   //Check return status of command
+   CHECKSTATUSGOTO(ord, "TPM_GetRandom()");
+
+   // Get the number of random bytes in the response
+   TRYFAILGOTOMSG(tpm_unmarshal_UINT32(&bptr, &len, &size), ERR_MALFORMED);
+   *numbytes = size;
+
+   //Get the random bytes out, tpm may give us less bytes than what we wanrt
+   TRYFAILGOTOMSG(tpm_unmarshal_BYTE_ARRAY(&bptr, &len, bytes, *numbytes), ERR_MALFORMED);
+
+   goto egress;
+abort_egress:
+egress:
+   free(cmdbuf);
+   return status;
+
+}
+
+TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* bptr, *resp;
+   uint8_t* cmdbuf = NULL;
+   size_t resplen = 0;
+   UINT32 len;
+
+   TPM_TAG tag = VTPM_TAG_REQ;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = VTPM_ORD_LOADHASHKEY;
+
+   /*Create the command*/
+   len = size = VTPM_COMMAND_HEADER_SIZE;
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+
+   /* Send the command to vtpm_manager */
+   info("Requesting Encryption key from backend");
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   /* Unpack response header */
+   bptr = resp;
+   len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   /* Check return code */
+   CHECKSTATUSGOTO(ord, "VTPM_LoadHashKey()");
+
+   /* Get the size of the key */
+   *data_length = size - VTPM_COMMAND_HEADER_SIZE;
+
+   /* Copy the key bits */
+   *data = malloc(*data_length);
+   memcpy(*data, bptr, *data_length);
+
+   goto egress;
+abort_egress:
+   error("VTPM_LoadHashKey failed");
+egress:
+   free(cmdbuf);
+   return status;
+}
+
+TPM_RESULT VTPM_SaveHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* bptr, *resp;
+   uint8_t* cmdbuf = NULL;
+   size_t resplen = 0;
+   UINT32 len;
+
+   TPM_TAG tag = VTPM_TAG_REQ;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = VTPM_ORD_SAVEHASHKEY;
+
+   /*Create the command*/
+   len = size = VTPM_COMMAND_HEADER_SIZE + data_length;
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   memcpy(bptr, data, data_length);
+   bptr += data_length;
+
+   /* Send the command to vtpm_manager */
+   info("Sending encryption key to backend");
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   /* Unpack response header */
+   bptr = resp;
+   len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   /* Check return code */
+   CHECKSTATUSGOTO(ord, "VTPM_SaveHashKey()");
+
+   goto egress;
+abort_egress:
+   error("VTPM_SaveHashKey failed");
+egress:
+   free(cmdbuf);
+   return status;
+}
+
+TPM_RESULT VTPM_PCRRead(struct tpmfront_dev* tpmfront_dev, UINT32 pcrIndex, BYTE* outDigest)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t *cmdbuf, *resp, *bptr;
+   size_t resplen = 0;
+   UINT32 len;
+
+   /*Just send a TPM_PCRRead Command to the HW tpm */
+   TPM_TAG tag = TPM_TAG_RQU_COMMAND;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = TPM_ORD_PCRRead;
+   len = size = sizeof(TPM_TAG) + sizeof(UINT32) + sizeof(TPM_COMMAND_CODE) + sizeof(UINT32);
+
+   /*Create the raw tpm cmd */
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   TRYFAILGOTO(tpm_marshal_UINT32(&bptr, &len, pcrIndex));
+
+   /*Send Cmd wait for response */
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   bptr = resp; len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   //Check return status of command
+   CHECKSTATUSGOTO(ord, "TPM_PCRRead");
+
+   //Get the ptr value
+   memcpy(outDigest, bptr, sizeof(TPM_PCRVALUE));
+
+   goto egress;
+abort_egress:
+egress:
+   free(cmdbuf);
+   return status;
+
+}
diff --git a/stubdom/vtpm/vtpm_cmd.h b/stubdom/vtpm/vtpm_cmd.h
new file mode 100644
index 0000000..b0bfa22
--- /dev/null
+++ b/stubdom/vtpm/vtpm_cmd.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef MANAGER_H
+#define MANAGER_H
+
+#include <tpmfront.h>
+#include <tpmback.h>
+#include "tpm/tpm_structures.h"
+
+/* Create a command response error header */
+int create_error_response(tpmcmd_t* tpmcmd, TPM_RESULT errorcode);
+/* Request random bytes from hardware tpm, returns 0 on success */
+TPM_RESULT VTPM_GetRandom(struct tpmfront_dev* tpmfront_dev, BYTE* bytes, UINT32* numbytes);
+/* Retreive 256 bit AES encryption key from manager */
+TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length);
+/* Manager securely saves our 256 bit AES encryption key */
+TPM_RESULT VTPM_SaveHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length);
+/* Send a TPM_PCRRead command passthrough the manager to the hw tpm */
+TPM_RESULT VTPM_PCRRead(struct tpmfront_dev* tpmfront_dev, UINT32 pcrIndex, BYTE* outDigest);
+
+#endif
diff --git a/stubdom/vtpm/vtpm_pcrs.c b/stubdom/vtpm/vtpm_pcrs.c
new file mode 100644
index 0000000..22a6cef
--- /dev/null
+++ b/stubdom/vtpm/vtpm_pcrs.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include "vtpm_pcrs.h"
+#include "vtpm_cmd.h"
+#include "tpm/tpm_data.h"
+
+#define PCR_VALUE      tpmData.permanent.data.pcrValue
+
+static int write_pcr_direct(unsigned int pcrIndex, uint8_t* val) {
+   if(pcrIndex > TPM_NUM_PCR) {
+      return TPM_BADINDEX;
+   }
+   memcpy(&PCR_VALUE[pcrIndex], val, sizeof(TPM_PCRVALUE));
+   return TPM_SUCCESS;
+}
+
+TPM_RESULT vtpm_initialize_hw_pcrs(struct tpmfront_dev* tpmfront_dev, unsigned long pcrs)
+{
+   TPM_RESULT rc = TPM_SUCCESS;
+   uint8_t digest[sizeof(TPM_PCRVALUE)];
+
+   for(unsigned int i = 0; i < TPM_NUM_PCR; ++i) {
+      if(pcrs & 1 << i) {
+         if((rc = VTPM_PCRRead(tpmfront_dev, i, digest)) != TPM_SUCCESS) {
+            error("TPM_PCRRead failed with error : %d", rc);
+            return rc;
+         }
+         write_pcr_direct(i, digest);
+      }
+   }
+
+   return rc;
+}
diff --git a/stubdom/vtpm/vtpm_pcrs.h b/stubdom/vtpm/vtpm_pcrs.h
new file mode 100644
index 0000000..11835f9
--- /dev/null
+++ b/stubdom/vtpm/vtpm_pcrs.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef VTPM_PCRS_H
+#define VTPM_PCRS_H
+
+#include "tpm/tpm_structures.h"
+
+#define VTPM_PCR0 1
+#define VTPM_PCR1 1 << 1
+#define VTPM_PCR2 1 << 2
+#define VTPM_PCR3 1 << 3
+#define VTPM_PCR4 1 << 4
+#define VTPM_PCR5 1 << 5
+#define VTPM_PCR6 1 << 6
+#define VTPM_PCR7 1 << 7
+#define VTPM_PCR8 1 << 8
+#define VTPM_PCR9 1 << 9
+#define VTPM_PCR10 1 << 10
+#define VTPM_PCR11 1 << 11
+#define VTPM_PCR12 1 << 12
+#define VTPM_PCR13 1 << 13
+#define VTPM_PCR14 1 << 14
+#define VTPM_PCR15 1 << 15
+#define VTPM_PCR16 1 << 16
+#define VTPM_PCR17 1 << 17
+#define VTPM_PCR18 1 << 18
+#define VTPM_PCR19 1 << 19
+#define VTPM_PCR20 1 << 20
+#define VTPM_PCR21 1 << 21
+#define VTPM_PCR22 1 << 22
+#define VTPM_PCR23 1 << 23
+
+#define VTPM_PCRALL (1 << TPM_NUM_PCR) - 1
+#define VTPM_PCRNONE 0
+
+#define VTPM_NUMPCRS 24
+
+struct tpmfront_dev;
+
+TPM_RESULT vtpm_initialize_hw_pcrs(struct tpmfront_dev* tpmfront_dev, unsigned long pcrs);
+
+
+#endif
diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
new file mode 100644
index 0000000..b343bd8
--- /dev/null
+++ b/stubdom/vtpm/vtpmblk.c
@@ -0,0 +1,307 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <mini-os/byteorder.h>
+#include "vtpmblk.h"
+#include "tpm/tpm_marshalling.h"
+#include "vtpm_cmd.h"
+#include "polarssl/aes.h"
+#include "polarssl/sha1.h"
+#include <blkfront.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+
+/*Encryption key and block sizes */
+#define BLKSZ 16
+
+static struct blkfront_dev* blkdev = NULL;
+static int blkfront_fd = -1;
+
+int init_vtpmblk(struct tpmfront_dev* tpmfront_dev)
+{
+   struct blkfront_info blkinfo;
+   info("Initializing persistent NVM storage\n");
+
+   if((blkdev = init_blkfront(NULL, &blkinfo)) == NULL) {
+      error("BLKIO: ERROR Unable to initialize blkfront");
+      return -1;
+   }
+   if (blkinfo.info & VDISK_READONLY || blkinfo.mode != O_RDWR) {
+      error("BLKIO: ERROR block device is read only!");
+      goto error;
+   }
+   if((blkfront_fd = blkfront_open(blkdev)) == -1) {
+      error("Unable to open blkfront file descriptor!");
+      goto error;
+   }
+
+   return 0;
+error:
+   shutdown_blkfront(blkdev);
+   blkdev = NULL;
+   return -1;
+}
+
+void shutdown_vtpmblk(void)
+{
+   close(blkfront_fd);
+   blkfront_fd = -1;
+   blkdev = NULL;
+}
+
+int write_vtpmblk_raw(uint8_t *data, size_t data_length)
+{
+   int rc;
+   uint32_t lenbuf;
+   debug("Begin Write data=%p len=%u", data, data_length);
+
+   lenbuf = cpu_to_be32((uint32_t)data_length);
+
+   lseek(blkfront_fd, 0, SEEK_SET);
+   if((rc = write(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
+      error("write(length) failed! error was %s", strerror(errno));
+      return -1;
+   }
+   if((rc = write(blkfront_fd, data, data_length)) != data_length) {
+      error("write(data) failed! error was %s", strerror(errno));
+      return -1;
+   }
+
+   info("Wrote %u bytes to NVM persistent storage", data_length);
+
+   return 0;
+}
+
+int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
+{
+   int rc;
+   uint32_t lenbuf;
+
+   lseek(blkfront_fd, 0, SEEK_SET);
+   if(( rc = read(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
+      error("read(length) failed! error was %s", strerror(errno));
+      return -1;
+   }
+   *data_length = (size_t) cpu_to_be32(lenbuf);
+   if(*data_length == 0) {
+      error("read 0 data_length for NVM");
+      return -1;
+   }
+
+   *data = tpm_malloc(*data_length);
+   if((rc = read(blkfront_fd, *data, *data_length)) != *data_length) {
+      error("read(data) failed! error was %s", strerror(errno));
+      return -1;
+   }
+
+   info("Read %u bytes from NVM persistent storage", *data_length);
+   return 0;
+}
+
+int encrypt_vtpmblk(uint8_t* clear, size_t clear_len, uint8_t** cipher, size_t* cipher_len, uint8_t* symkey)
+{
+   int rc = 0;
+   uint8_t iv[BLKSZ];
+   aes_context aes_ctx;
+   UINT32 temp;
+   int mod;
+
+   uint8_t* clbuf = NULL;
+
+   uint8_t* ivptr;
+   int ivlen;
+
+   uint8_t* cptr;	//Cipher block pointer
+   int clen;	//Cipher block length
+
+   /*Create a new 256 bit encryption key */
+   if(symkey == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+   tpm_get_extern_random_bytes(symkey, NVMKEYSZ);
+
+   /*Setup initialization vector - random bits and then 4 bytes clear text size at the end*/
+   temp = sizeof(UINT32);
+   ivlen = BLKSZ - temp;
+   tpm_get_extern_random_bytes(iv, ivlen);
+   ivptr = iv + ivlen;
+   tpm_marshal_UINT32(&ivptr, &temp, (UINT32) clear_len);
+
+   /*The clear text needs to be padded out to a multiple of BLKSZ */
+   mod = clear_len % BLKSZ;
+   clen = mod ? clear_len + BLKSZ - mod : clear_len;
+   clbuf = malloc(clen);
+   if (clbuf == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+   memcpy(clbuf, clear, clear_len);
+   /* zero out the padding bits - FIXME: better / more secure way to handle these? */
+   if(clen - clear_len) {
+      memset(clbuf + clear_len, 0, clen - clear_len);
+   }
+
+   /* Setup the ciphertext buffer */
+   *cipher_len = BLKSZ + clen;		/*iv + ciphertext */
+   cptr = *cipher = malloc(*cipher_len);
+   if (*cipher == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Copy the IV to cipher text blob*/
+   memcpy(cptr, iv, BLKSZ);
+   cptr += BLKSZ;
+
+   /* Setup encryption */
+   aes_setkey_enc(&aes_ctx, symkey, 256);
+
+   /* Do encryption now */
+   aes_crypt_cbc(&aes_ctx, AES_ENCRYPT, clen, iv, clbuf, cptr);
+
+   goto egress;
+abort_egress:
+egress:
+   free(clbuf);
+   return rc;
+}
+int decrypt_vtpmblk(uint8_t* cipher, size_t cipher_len, uint8_t** clear, size_t* clear_len, uint8_t* symkey)
+{
+   int rc = 0;
+   uint8_t iv[BLKSZ];
+   uint8_t* ivptr;
+   UINT32 u32, temp;
+   aes_context aes_ctx;
+
+   uint8_t* cptr = cipher;	//cipher block pointer
+   int clen = cipher_len;	//cipher block length
+
+   /* Pull out the initialization vector */
+   memcpy(iv, cipher, BLKSZ);
+   cptr += BLKSZ;
+   clen -= BLKSZ;
+
+   /* Setup the clear text buffer */
+   if((*clear = malloc(clen)) == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Get the length of clear text from last 4 bytes of iv */
+   temp = sizeof(UINT32);
+   ivptr = iv + BLKSZ - temp;
+   tpm_unmarshal_UINT32(&ivptr, &temp, &u32);
+   *clear_len = u32;
+
+   /* Setup decryption */
+   aes_setkey_dec(&aes_ctx, symkey, 256);
+
+   /* Do decryption now */
+   if ((clen % BLKSZ) != 0) {
+      error("Decryption Error: Cipher block size was not a multiple of %u", BLKSZ);
+      rc = -1;
+      goto abort_egress;
+   }
+   aes_crypt_cbc(&aes_ctx, AES_DECRYPT, clen, iv, cptr, *clear);
+
+   goto egress;
+abort_egress:
+egress:
+   return rc;
+}
+
+int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length) {
+   int rc;
+   uint8_t* cipher = NULL;
+   size_t cipher_len = 0;
+   uint8_t hashkey[HASHKEYSZ];
+   uint8_t* symkey = hashkey + HASHSZ;
+
+   /* Encrypt the data */
+   if((rc = encrypt_vtpmblk(data, data_length, &cipher, &cipher_len, symkey))) {
+      goto abort_egress;
+   }
+   /* Write to disk */
+   if((rc = write_vtpmblk_raw(cipher, cipher_len))) {
+      goto abort_egress;
+   }
+   /* Get sha1 hash of data */
+   sha1(cipher, cipher_len, hashkey);
+
+   /* Send hash and key to manager */
+   if((rc = VTPM_SaveHashKey(tpmfront_dev, hashkey, HASHKEYSZ)) != TPM_SUCCESS) {
+      goto abort_egress;
+   }
+   goto egress;
+abort_egress:
+egress:
+   free(cipher);
+   return rc;
+}
+
+int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data_length) {
+   int rc;
+   uint8_t* cipher = NULL;
+   size_t cipher_len = 0;
+   size_t keysize;
+   uint8_t* hashkey = NULL;
+   uint8_t hash[HASHSZ];
+   uint8_t* symkey;
+
+   /* Retreive the hash and the key from the manager */
+   if((rc = VTPM_LoadHashKey(tpmfront_dev, &hashkey, &keysize)) != TPM_SUCCESS) {
+      goto abort_egress;
+   }
+   if(keysize != HASHKEYSZ) {
+      error("Manager returned a hashkey of invalid size! expected %d, actual %d", NVMKEYSZ, keysize);
+      rc = -1;
+      goto abort_egress;
+   }
+   symkey = hashkey + HASHSZ;
+
+   /* Read from disk now */
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len))) {
+      goto abort_egress;
+   }
+
+   /* Compute the hash of the cipher text and compare */
+   sha1(cipher, cipher_len, hash);
+   if(memcmp(hash, hashkey, HASHSZ)) {
+      int i;
+      error("NVM Storage Checksum failed!");
+      printf("Expected: ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hashkey[i]);
+      }
+      printf("\n");
+      printf("Actual:   ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hash[i]);
+      }
+      printf("\n");
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Decrypt the blob */
+   if((rc = decrypt_vtpmblk(cipher, cipher_len, data, data_length, symkey))) {
+      goto abort_egress;
+   }
+   goto egress;
+abort_egress:
+egress:
+   free(cipher);
+   free(hashkey);
+   return rc;
+}
diff --git a/stubdom/vtpm/vtpmblk.h b/stubdom/vtpm/vtpmblk.h
new file mode 100644
index 0000000..282ce6a
--- /dev/null
+++ b/stubdom/vtpm/vtpmblk.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef NVM_H
+#define NVM_H
+#include <mini-os/types.h>
+#include <xen/xen.h>
+#include <tpmfront.h>
+
+#define NVMKEYSZ 32
+#define HASHSZ 20
+#define HASHKEYSZ (NVMKEYSZ + HASHSZ)
+
+int init_vtpmblk(struct tpmfront_dev* tpmfront_dev);
+void shutdown_vtpmblk(void);
+
+/* Encrypts and writes data to blk device */
+int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t *data, size_t data_length);
+/* Reads, Decrypts, and returns data from blk device */
+int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t **data, size_t *data_length);
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:22:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaoiE-0005jK-GL; Tue, 20 Nov 2012 14:22:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaoiC-0005j4-Ir
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:22:04 +0000
Received: from [85.158.143.99:8789] by server-1.bemta-4.messagelabs.com id
	9B/E7-27934-B029BA05; Tue, 20 Nov 2012 14:22:03 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-10.tower-216.messagelabs.com!1353421320!21540189!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_23,
	UNPARSEABLE_RELAY,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15224 invoked from network); 20 Nov 2012 14:22:01 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-10.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 20 Nov 2012 14:22:01 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149572016;
	Tue, 20 Nov 2012 09:21:53 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org,
	Ian.Campbell@citrix.com
Date: Tue, 20 Nov 2012 09:21:11 -0500
Message-Id: <1353421272-24797-4-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v4 4/5] Add vtpm documentation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

See the files included in this patch for details

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 docs/misc/vtpm.txt     |  355 ++++++++++++++++++++++++++++++++++--------------
 stubdom/vtpm/README    |   75 ++++++++++
 stubdom/vtpmmgr/README |   75 ++++++++++
 3 files changed, 400 insertions(+), 105 deletions(-)
 create mode 100644 stubdom/vtpm/README
 create mode 100644 stubdom/vtpmmgr/README

diff --git a/docs/misc/vtpm.txt b/docs/misc/vtpm.txt
index ad37fe8..1e8887c 100644
--- a/docs/misc/vtpm.txt
+++ b/docs/misc/vtpm.txt
@@ -1,152 +1,297 @@
-Copyright: IBM Corporation (C), Intel Corporation
-29 June 2006
-Authors: Stefan Berger <stefanb@us.ibm.com> (IBM), 
-         Employees of Intel Corp
-
-This document gives a short introduction to the virtual TPM support
-in XEN and goes as far as connecting a user domain to a virtual TPM
-instance and doing a short test to verify success. It is assumed
-that the user is fairly familiar with compiling and installing XEN
-and Linux on a machine. 
+Copyright (c) 2010-2012 United States Government, as represented by
+the Secretary of Defense.  All rights reserved.
+November 12 2012
+Authors: Matthew Fioravante (JHUAPL),
+
+This document describes the virtual Trusted Platform Module (vTPM) subsystem 
+for Xen. The reader is assumed to have familiarity with building and installing
+Xen, Linux, and a basic understanding of the TPM and vTPM concepts.
+
+------------------------------
+INTRODUCTION
+------------------------------
+The goal of this work is to provide a TPM functionality to a virtual guest 
+operating system (a DomU).  This allows programs to interact with a TPM in a 
+virtual system the same way they interact with a TPM on the physical system. 
+Each guest gets its own unique, emulated, software TPM.  However, each of the
+vTPM's secrets (Keys, NVRAM, etc) are managed by a vTPM Manager domain, which 
+seals the secrets to the Physical TPM.  Thus, the vTPM subsystem extends the 
+chain of trust rooted in the hardware TPM to virtual machines in Xen. Each 
+major component of vTPM is implemented as a separate domain, providing secure 
+separation guaranteed by the hypervisor. The vTPM domains are implemented in 
+mini-os to reduce memory and processor overhead.
+
+This mini-os vTPM subsystem was built on top of the previous vTPM
+work done by IBM and Intel corporation.
  
-Production Prerequisites: An x86-based machine machine with a
-Linux-supported TPM on the motherboard (NSC, Atmel, Infineon, TPM V1.2).
-Development Prerequisites: An emulator for TESTING ONLY is provided
+------------------------------
+DESIGN OVERVIEW
+------------------------------
+
+The architecture of vTPM is described below:
+
++------------------+
+|    Linux DomU    | ...
+|       |  ^       |
+|       v  |       |
+|   xen-tpmfront   |
++------------------+
+        |  ^
+        v  |
++------------------+
+| mini-os/tpmback  |
+|       |  ^       |
+|       v  |       |
+|  vtpm-stubdom    | ...
+|       |  ^       |
+|       v  |       |
+| mini-os/tpmfront |
++------------------+
+        |  ^
+        v  |
++------------------+
+| mini-os/tpmback  |
+|       |  ^       |
+|       v  |       |
+|   vtpmmgrdom     |
+|       |  ^       |
+|       v  |       |
+| mini-os/tpm_tis  |
++------------------+
+        |  ^
+        v  |
++------------------+
+|   Hardware TPM   |
++------------------+
+ * Linux DomU: The Linux based guest that wants to use a vTPM. There many be 
+               more than one of these.
+ 
+ * xen-tpmfront.ko: Linux kernel virtual TPM frontend driver. This driver
+                    provides vTPM access to a para-virtualized Linux based DomU.
+ 
+ * mini-os/tpmback: Mini-os TPM backend driver. The Linux frontend driver
+                    connects to this backend driver to facilitate 
+                    communications between the Linux DomU and its vTPM. This 
+                    driver is also used by vtpmmgrdom to communicate with 
+                    vtpm-stubdom.
+ 
+ * vtpm-stubdom: A mini-os stub domain that implements a vTPM. There is a
+                 one to one mapping between running vtpm-stubdom instances and 
+                 logical vtpms on the system. The vTPM Platform Configuration
+                 Registers (PCRs) are all initialized to zero.
+ 
+ * mini-os/tpmfront: Mini-os TPM frontend driver. The vTPM mini-os domain
+                     vtpm-stubdom uses this driver to communicate with 
+                     vtpmmgrdom. This driver could also be used separately to 
+                     implement a mini-os domain that wishes to use a vTPM of
+                     its own.
+ 
+ * vtpmmgrdom: A mini-os domain that implements the vTPM manager. 
+               There is only one vTPM manager and it should be running during
+               the entire lifetime of the machine.  This domain regulates 
+               access to the physical TPM on the system and secures the 
+               persistent state of each vTPM.
+ 
+ * mini-os/tpm_tis: Mini-os TPM version 1.2 TPM Interface Specification (TIS)
+                    driver. This driver used by vtpmmgrdom to talk directly to 
+                    the hardware TPM. Communication is facilitated by mapping 
+                    hardware memory pages into vtpmmgrdom.
+ 
+ * Hardware TPM: The physical TPM that is soldered onto the motherboard.
+ 
+------------------------------
+INSTALLATION
+------------------------------
 
+Prerequisites:
+--------------
+You must have an x86 machine with a TPM on the motherboard.
+The only software requirement to compiling vTPM is cmake.
+You must use libxl to manage domains with vTPMs. 'xm' is
+deprecated and does not support vTPM.
 
 Compiling the XEN tree:
 -----------------------
 
-Compile the XEN tree as usual after the following lines set in the
-linux-2.6.??-xen/.config file:
+Compile and install the XEN tree as usual. Be sure to build and install
+the stubdom tree.
+
+Compiling the LINUX dom0 kernel:
+--------------------------------
 
-CONFIG_XEN_TPMDEV_BACKEND=m
+The Linux dom0 kernel has no special prerequisites.
 
-CONFIG_TCG_TPM=m
-CONFIG_TCG_TIS=m      (supported after 2.6.17-rc4)
-CONFIG_TCG_NSC=m
-CONFIG_TCG_ATMEL=m
-CONFIG_TCG_INFINEON=m
-CONFIG_TCG_XEN=m
-<possible other TPM drivers supported by Linux>
+Compiling the LINUX domU kernel:
+--------------------------------
 
-If the frontend driver needs to be compiled into the user domain
-kernel, then the following two lines should be changed.
+The domU kernel used by domains with vtpms must
+include the xen-tpmfront.ko driver. It can be built
+directly into the kernel or as a module.
 
 CONFIG_TCG_TPM=y
 CONFIG_TCG_XEN=y
 
+------------------------------
+VTPM MANAGER SETUP
+------------------------------
+
+Manager disk image setup:
+-------------------------
+
+The vTPM Manager requires a disk image to store its
+encrypted data. The image does not require a filesystem
+and can live anywhere on the host disk. The image does not need
+to be large. 8 to 16 Mb should be sufficient.
+
+# dd if=/dev/zero of=/var/vtpmmgrdom.img bs=16M count=1
+
+Manager config file:
+--------------------
+
+The vTPM Manager domain (vtpmmgrdom) must be started like
+any other Xen virtual machine and requires a config file.
+The manager requires a disk image for storage and permission
+to access the hardware memory pages for the TPM. An
+example configuration looks like the following.
+
+kernel="/usr/lib/xen/boot/vtpmmgrdom.gz"
+memory=16
+disk=["file:/var/vtpmmgrdom.img,hda,w"]
+name="vtpmmgrdom"
+iomem=["fed40,5"]
+
+The iomem line tells xl to allow access to the TPM
+IO memory pages, which are 5 pages that start at
+0xfed40000.
+
+Starting and stopping the manager:
+----------------------------------
+
+The vTPM manager should be started at boot, you may wish to 
+create an init script to do this.
+
+# xl create -c vtpmmgrdom.cfg
+
+Once initialization is complete you should see the following:
+INFO[VTPM]: Waiting for commands from vTPM's:
+
+To shutdown the manager you must destroy it. To avoid data corruption,
+only destroy the manager when you see the above "Waiting for commands"
+message. This ensures the disk is in a consistent state.
+
+# xl destroy vtpmmgrdom
+
+------------------------------
+VTPM AND LINUX PVM SETUP
+------------------------------
 
-You must also enable the virtual TPM to be built:
+In the following examples we will assume we have Linux
+guest named "domu" with its associated configuration
+located at /home/user/domu. It's vtpm will be named
+domu-vtpm.
 
-In Config.mk in the Xen root directory set the line
+vTPM disk image setup:
+----------------------
 
-VTPM_TOOLS ?= y
+The vTPM requires a disk image to store its persistent
+data. The image does not require a filesystem. The image
+does not need to be large. 8 Mb should be sufficient.
 
-and in
+# dd if=/dev/zero of=/home/user/domu/vtpm.img bs=8M count=1
 
-tools/vtpm/Rules.mk set the line
+vTPM config file:
+-----------------
 
-BUILD_EMULATOR = y
+The vTPM domain requires a configuration file like
+any other domain. The vTPM requires a disk image for
+storage and a TPM frontend driver to communicate
+with the manager. An example configuration is given:
 
-Now build the Xen sources from Xen's root directory:
+kernel="/usr/lib/xen/boot/vtpm-stubdom.gz"
+memory=8
+disk=["file:/home/user/domu/vtpm.img,hda,w"]
+name="domu-vtpm"
+vtpm=["backend=vtpmmgrdom,uuid=ac0a5b9e-cbe2-4c07-b43b-1d69e46fb839"]
 
-make install
+The vtpm= line sets up the tpm frontend driver. The backend must set
+to vtpmmgrdom. You are required to generate a uuid for this vtpm.
+You can use the uuidgen unix program or some other method to create a
+uuid. The uuid uniquely identifies this vtpm to manager.
 
+If you wish to clear the vTPM data you can either recreate the
+disk image or change the uuid.
 
-Also build the initial RAM disk if necessary.
+Linux Guest config file:
+------------------------
 
-Reboot the machine with the created Xen kernel.
+The Linux guest config file needs to be modified to include
+the Linux tpmfront driver. Add the following line:
 
-Note: If you do not want any TPM-related code compiled into your
-kernel or built as module then comment all the above lines like
-this example:
-# CONFIG_TCG_TPM is not set
+vtpm=["backend=domu-vtpm"]
 
+Currently only paravirtualized guests are supported.
 
-Modifying VM Configuration files:
----------------------------------
+Launching and shut down:
+------------------------
 
-VM configuration files need to be adapted to make a TPM instance
-available to a user domain. The following VM configuration file is
-an example of how a user domain can be configured to have a TPM
-available. It works similar to making a network interface
-available to a domain.
+To launch a Linux guest with a vTPM we first have to start the vTPM domain.
 
-kernel = "/boot/vmlinuz-2.6.x"
-ramdisk = "/xen/initrd_domU/U1_ramdisk.img"
-memory = 32
-name = "TPMUserDomain0"
-vtpm = ['instance=1,backend=0']
-root = "/dev/ram0 console=tty ro"
-vif = ['backend=0']
+# xl create -c /home/user/domu/vtpm.cfg
 
-In the above configuration file the line 'vtpm = ...' provides
-information about the domain where the virtual TPM is running and
-where the TPM backend has been compiled into - this has to be 
-domain 0  at the moment - and which TPM instance the user domain
-is supposed to talk to. Note that each running VM must use a 
-different instance and that using instance 0 is NOT allowed. The
-instance parameter is taken as the desired instance number, but
-the actual instance number that is assigned to the virtual machine
-can be different. This is the case if for example that particular
-instance is already used by another virtual machine. The association
-of which TPM instance number is used by which virtual machine is
-kept in the file /var/vtpm/vtpm.db. Associations are maintained by
-a xend-internal vTPM UUID and vTPM instance number.
+After initialization is complete, you should see the following:
+Info: Waiting for frontend domain to connect..
 
-Note: If you do not want TPM functionality for your user domain simply
-leave out the 'vtpm' line in the configuration file.
+Next, launch the Linux guest
 
+# xl create -c /home/user/domu/domu.cfg
 
-Running the TPM:
-----------------
+If xen-tpmfront was compiled as a module, be sure to load it
+in the guest.
 
-To run the vTPM, the device /dev/vtpm must be available.
-Verify that 'ls -l /dev/vtpm' shows the following output:
+# modprobe xen-tpmfront
 
-crw-------  1 root root 10, 225 Aug 11 06:58 /dev/vtpm
+After the Linux domain boots and the xen-tpmfront driver is loaded,
+you should see the following on the vtpm console:
 
-If it is not available, run the following command as 'root'.
-mknod /dev/vtpm c 10 225
+Info: VTPM attached to Frontend X/Y
 
-Make sure that the vTPM is running in domain 0. To do this run the
-following:
+If you have trousers and tpm_tools installed on the guest, you can test the
+vtpm.
 
-modprobe tpmbk
+On guest:
+# tcsd (if tcsd is not running already)
+# tpm_version
 
-/usr/bin/vtpm_managerd
+The version command should return the following:
+  TPM 1.2 Version Info:
+  Chip Version:        1.2.0.7
+  Spec Level:          2
+  Errata Revision:     1
+  TPM Vendor ID:       ETHZ
+  TPM Version:         01010000
+  Manufacturer Info:   4554485a
 
-Start a user domain using the 'xm create' command. Once you are in the
-shell of the user domain, you should be able to do the following as
-user 'root':
+You should also see the command being sent to the vtpm console as well
+as the vtpm saving its state. You should see the vtpm key being
+encrypted and stored on the vtpmmgrdom console.
 
-Insert the TPM frontend into the kernel if it has been compiled as a
-kernel module.
+To shutdown the guest and its vtpm, you just have to shutdown the guest
+normally. As soon as the guest vm disconnects, the vtpm will shut itself
+down automatically.
 
-> modprobe tpm_xenu
+On guest:
+# shutdown -h now
 
-Check the status of the TPM
+You may wish to write a script to start your vtpm and guest together.
 
-> cd /sys/devices/xen/vtpm-0
-> ls
-[...]  cancel  caps   pcrs    pubek   [...]
-> cat pcrs
-PCR-00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-01: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-02: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-03: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-04: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-05: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-06: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-07: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-08: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-[...]
+------------------------------
+MORE INFORMATION
+------------------------------
 
-At this point the user domain has been successfully connected to its
-virtual TPM instance.
+See stubdom/vtpmmgr/README for more details about how
+the manager domain works, how to use it, and its command line
+parameters.
 
-For further information please read the documentation in 
-tools/vtpm_manager/README and tools/vtpm/README
+See stubdom/vtpm/README for more specifics about how vtpm-stubdom
+operates and the command line options it accepts.
 
-Stefan Berger and Employees of the Intel Corp
diff --git a/stubdom/vtpm/README b/stubdom/vtpm/README
new file mode 100644
index 0000000..b8ddac6
--- /dev/null
+++ b/stubdom/vtpm/README
@@ -0,0 +1,75 @@
+Copyright (c) 2010-2012 United States Government, as represented by
+the Secretary of Defense.  All rights reserved.
+November 12 2012
+Authors: Matthew Fioravante (JHUAPL),
+
+This document describes the operation and command line interface
+of vtpm-stubdom. See docs/misc/vtpm.txt for details on the
+vTPM subsystem as a whole.
+
+
+------------------------------
+OPERATION
+------------------------------
+
+The vtpm-stubdom is a mini-OS domain that emulates a TPM for the guest OS to
+use. It is a small wrapper around the Berlios TPM emulator
+version 0.7.4. Commands are passed from the linux guest via the 
+mini-os TPM backend driver. vTPM data is encrypted and stored via a disk image
+provided to the virtual machine. The key used to encrypt the data along
+with a hash of the vTPM's data is sent to the vTPM manager for secure storage
+and later retrieval.  The vTPM domain communicates with the manager using a 
+mini-os tpm front/back device pair.
+
+------------------------------
+COMMAND LINE ARGUMENTS
+------------------------------
+
+Command line arguments are passed to the domain via the 'extra'
+parameter in the VM config file. Each parameter is separated
+by white space. For example:
+
+extra="foo=bar baz"
+
+List of Arguments:
+------------------
+
+loglevel=<LOG>: Controls the amount of logging printed to the console.
+	The possible values for <LOG> are:
+	 error
+	 info (default)
+	 debug
+
+clear: Start the Berlios emulator in "clear" mode. (default)
+
+save: Start the Berlios emulator in "save" mode.
+
+deactivated: Start the Berlios emulator in "deactivated" mode.
+	See the Berlios TPM emulator documentation for details
+	about the startup mode. For all normal use, always use clear
+	which is the default. You should not need to specify any of these.
+
+maintcmds=<1|0>: Enable to disable the TPM maintenance commands.
+	These commands are used by tpm manufacturers and thus
+	open a security hole. They are disabled by default.
+
+hwinitpcr=<PCRSPEC>: Initialize the virtual Platform Configuration Registers
+	(PCRs) with PCR values from the hardware TPM. Each pcr specified by
+	<PCRSPEC> will be initialized with the value of that same PCR in TPM
+	once at startup. By default all PCRs are zero initialized.
+	Value values of <PCRSPEC> are:
+	 all: copy all pcrs
+	 none: copy no pcrs (default)
+	 <N>: copy pcr n
+	 <X-Y>: copy pcrs x to y (inclusive)
+
+	These can also be combined by comma separation, for example:
+	 hwinitpcrs=5,12-16
+	will copy pcrs 5, 12, 13, 14, 15, and 16.
+
+------------------------------
+REFERENCES
+------------------------------
+
+Berlios TPM Emulator:
+http://tpm-emulator.berlios.de/
diff --git a/stubdom/vtpmmgr/README b/stubdom/vtpmmgr/README
new file mode 100644
index 0000000..42ebbc8
--- /dev/null
+++ b/stubdom/vtpmmgr/README
@@ -0,0 +1,75 @@
+Copyright (c) 2010-2012 United States Government, as represented by
+the Secretary of Defense.  All rights reserved.
+November 12 2012
+Authors: Matthew Fioravante (JHUAPL),
+
+This document describes the operation and command line interface
+of vtpmmgrdom. See docs/misc/vtpm.txt for details on the
+vTPM subsystem as a whole.
+
+
+------------------------------
+OPERATION
+------------------------------
+
+The vtpmmgrdom implements a vTPM manager who has two major functions:
+
+ - Securely store encryption keys for each of the vTPMS
+ - Regulate access to the hardware TPM for the entire system
+
+The manager accepts commands from the vtpm-stubdom domains via the mini-os 
+TPM backend driver. The vTPM manager communicates directly with hardware TPM 
+using the mini-os tpm_tis driver.
+
+
+When the manager starts for the first time it will check if the TPM
+has an owner. If the TPM is unowned, it will attempt to take ownership
+with the supplied owner_auth (see below) and then create a TPM
+storage key which will be used to secure vTPM key data. Currently the
+manager only binds vTPM keys to the disk. In the future support
+for sealing to PCRs should be added.
+
+------------------------------
+COMMAND LINE ARGUMENTS
+------------------------------
+
+Command line arguments are passed to the domain via the 'extra'
+parameter in the VM config file. Each parameter is separated
+by white space. For example:
+
+extra="foo=bar baz"
+
+List of Arguments:
+------------------
+
+owner_auth=<AUTHSPEC>: Set the owner auth of the TPM. The default
+	is the well known owner auth of all ones.
+
+srk_auth=<AUTHSPEC>: Set the SRK auth for the TPM. The default is
+	the well known srk auth of all zeroes.
+	The possible values of <AUTHSPEC> are:
+	 well-known: Use the well known auth (default)
+	 random: Randomly generate an auth
+	 hash: <HASH>: Use the given 40 character ASCII hex string
+	 text: <STR>: Use sha1 hash of <STR>.
+
+tpmdriver=<DRIVER>: Which driver to use to talk to the hardware TPM.
+	Don't change this unless you know what you're doing.
+	The possible values of <DRIVER> are:
+	 tpm_tis: Use the tpm_tis driver to talk directly to the TPM.
+		The domain must have access to TPM IO memory.  (default)
+	 tpmfront: Use tpmfront to talk to the TPM. The domain must have
+		a tpmfront device setup to talk to another domain
+		which provides access to the TPM.
+
+The following options only apply to the tpm_tis driver:
+
+tpmiomem=<ADDR>: The base address of the hardware memory pages of the
+	TPM (default 0xfed40000).
+
+tpmirq=<IRQ>: The irq of the hardware TPM if using interrupts. A value of
+	"probe" can be set to probe for the irq. A value of 0
+	disabled interrupts and uses polling (default 0).
+
+tpmlocality=<LOC>: Attempt to use locality <LOC> of the hardware TPM.
+	(default 0)
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:22:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaoiE-0005jK-GL; Tue, 20 Nov 2012 14:22:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaoiC-0005j4-Ir
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:22:04 +0000
Received: from [85.158.143.99:8789] by server-1.bemta-4.messagelabs.com id
	9B/E7-27934-B029BA05; Tue, 20 Nov 2012 14:22:03 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-10.tower-216.messagelabs.com!1353421320!21540189!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_23,
	UNPARSEABLE_RELAY,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15224 invoked from network); 20 Nov 2012 14:22:01 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-10.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 20 Nov 2012 14:22:01 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149572016;
	Tue, 20 Nov 2012 09:21:53 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org,
	Ian.Campbell@citrix.com
Date: Tue, 20 Nov 2012 09:21:11 -0500
Message-Id: <1353421272-24797-4-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v4 4/5] Add vtpm documentation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

See the files included in this patch for details

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 docs/misc/vtpm.txt     |  355 ++++++++++++++++++++++++++++++++++--------------
 stubdom/vtpm/README    |   75 ++++++++++
 stubdom/vtpmmgr/README |   75 ++++++++++
 3 files changed, 400 insertions(+), 105 deletions(-)
 create mode 100644 stubdom/vtpm/README
 create mode 100644 stubdom/vtpmmgr/README

diff --git a/docs/misc/vtpm.txt b/docs/misc/vtpm.txt
index ad37fe8..1e8887c 100644
--- a/docs/misc/vtpm.txt
+++ b/docs/misc/vtpm.txt
@@ -1,152 +1,297 @@
-Copyright: IBM Corporation (C), Intel Corporation
-29 June 2006
-Authors: Stefan Berger <stefanb@us.ibm.com> (IBM), 
-         Employees of Intel Corp
-
-This document gives a short introduction to the virtual TPM support
-in XEN and goes as far as connecting a user domain to a virtual TPM
-instance and doing a short test to verify success. It is assumed
-that the user is fairly familiar with compiling and installing XEN
-and Linux on a machine. 
+Copyright (c) 2010-2012 United States Government, as represented by
+the Secretary of Defense.  All rights reserved.
+November 12 2012
+Authors: Matthew Fioravante (JHUAPL),
+
+This document describes the virtual Trusted Platform Module (vTPM) subsystem 
+for Xen. The reader is assumed to have familiarity with building and installing
+Xen, Linux, and a basic understanding of the TPM and vTPM concepts.
+
+------------------------------
+INTRODUCTION
+------------------------------
+The goal of this work is to provide a TPM functionality to a virtual guest 
+operating system (a DomU).  This allows programs to interact with a TPM in a 
+virtual system the same way they interact with a TPM on the physical system. 
+Each guest gets its own unique, emulated, software TPM.  However, each of the
+vTPM's secrets (Keys, NVRAM, etc) are managed by a vTPM Manager domain, which 
+seals the secrets to the Physical TPM.  Thus, the vTPM subsystem extends the 
+chain of trust rooted in the hardware TPM to virtual machines in Xen. Each 
+major component of vTPM is implemented as a separate domain, providing secure 
+separation guaranteed by the hypervisor. The vTPM domains are implemented in 
+mini-os to reduce memory and processor overhead.
+
+This mini-os vTPM subsystem was built on top of the previous vTPM
+work done by IBM and Intel corporation.
  
-Production Prerequisites: An x86-based machine machine with a
-Linux-supported TPM on the motherboard (NSC, Atmel, Infineon, TPM V1.2).
-Development Prerequisites: An emulator for TESTING ONLY is provided
+------------------------------
+DESIGN OVERVIEW
+------------------------------
+
+The architecture of vTPM is described below:
+
++------------------+
+|    Linux DomU    | ...
+|       |  ^       |
+|       v  |       |
+|   xen-tpmfront   |
++------------------+
+        |  ^
+        v  |
++------------------+
+| mini-os/tpmback  |
+|       |  ^       |
+|       v  |       |
+|  vtpm-stubdom    | ...
+|       |  ^       |
+|       v  |       |
+| mini-os/tpmfront |
++------------------+
+        |  ^
+        v  |
++------------------+
+| mini-os/tpmback  |
+|       |  ^       |
+|       v  |       |
+|   vtpmmgrdom     |
+|       |  ^       |
+|       v  |       |
+| mini-os/tpm_tis  |
++------------------+
+        |  ^
+        v  |
++------------------+
+|   Hardware TPM   |
++------------------+
+ * Linux DomU: The Linux based guest that wants to use a vTPM. There many be 
+               more than one of these.
+ 
+ * xen-tpmfront.ko: Linux kernel virtual TPM frontend driver. This driver
+                    provides vTPM access to a para-virtualized Linux based DomU.
+ 
+ * mini-os/tpmback: Mini-os TPM backend driver. The Linux frontend driver
+                    connects to this backend driver to facilitate 
+                    communications between the Linux DomU and its vTPM. This 
+                    driver is also used by vtpmmgrdom to communicate with 
+                    vtpm-stubdom.
+ 
+ * vtpm-stubdom: A mini-os stub domain that implements a vTPM. There is a
+                 one to one mapping between running vtpm-stubdom instances and 
+                 logical vtpms on the system. The vTPM Platform Configuration
+                 Registers (PCRs) are all initialized to zero.
+ 
+ * mini-os/tpmfront: Mini-os TPM frontend driver. The vTPM mini-os domain
+                     vtpm-stubdom uses this driver to communicate with 
+                     vtpmmgrdom. This driver could also be used separately to 
+                     implement a mini-os domain that wishes to use a vTPM of
+                     its own.
+ 
+ * vtpmmgrdom: A mini-os domain that implements the vTPM manager. 
+               There is only one vTPM manager and it should be running during
+               the entire lifetime of the machine.  This domain regulates 
+               access to the physical TPM on the system and secures the 
+               persistent state of each vTPM.
+ 
+ * mini-os/tpm_tis: Mini-os TPM version 1.2 TPM Interface Specification (TIS)
+                    driver. This driver used by vtpmmgrdom to talk directly to 
+                    the hardware TPM. Communication is facilitated by mapping 
+                    hardware memory pages into vtpmmgrdom.
+ 
+ * Hardware TPM: The physical TPM that is soldered onto the motherboard.
+ 
+------------------------------
+INSTALLATION
+------------------------------
 
+Prerequisites:
+--------------
+You must have an x86 machine with a TPM on the motherboard.
+The only software requirement to compiling vTPM is cmake.
+You must use libxl to manage domains with vTPMs. 'xm' is
+deprecated and does not support vTPM.
 
 Compiling the XEN tree:
 -----------------------
 
-Compile the XEN tree as usual after the following lines set in the
-linux-2.6.??-xen/.config file:
+Compile and install the XEN tree as usual. Be sure to build and install
+the stubdom tree.
+
+Compiling the LINUX dom0 kernel:
+--------------------------------
 
-CONFIG_XEN_TPMDEV_BACKEND=m
+The Linux dom0 kernel has no special prerequisites.
 
-CONFIG_TCG_TPM=m
-CONFIG_TCG_TIS=m      (supported after 2.6.17-rc4)
-CONFIG_TCG_NSC=m
-CONFIG_TCG_ATMEL=m
-CONFIG_TCG_INFINEON=m
-CONFIG_TCG_XEN=m
-<possible other TPM drivers supported by Linux>
+Compiling the LINUX domU kernel:
+--------------------------------
 
-If the frontend driver needs to be compiled into the user domain
-kernel, then the following two lines should be changed.
+The domU kernel used by domains with vtpms must
+include the xen-tpmfront.ko driver. It can be built
+directly into the kernel or as a module.
 
 CONFIG_TCG_TPM=y
 CONFIG_TCG_XEN=y
 
+------------------------------
+VTPM MANAGER SETUP
+------------------------------
+
+Manager disk image setup:
+-------------------------
+
+The vTPM Manager requires a disk image to store its
+encrypted data. The image does not require a filesystem
+and can live anywhere on the host disk. The image does not need
+to be large. 8 to 16 Mb should be sufficient.
+
+# dd if=/dev/zero of=/var/vtpmmgrdom.img bs=16M count=1
+
+Manager config file:
+--------------------
+
+The vTPM Manager domain (vtpmmgrdom) must be started like
+any other Xen virtual machine and requires a config file.
+The manager requires a disk image for storage and permission
+to access the hardware memory pages for the TPM. An
+example configuration looks like the following.
+
+kernel="/usr/lib/xen/boot/vtpmmgrdom.gz"
+memory=16
+disk=["file:/var/vtpmmgrdom.img,hda,w"]
+name="vtpmmgrdom"
+iomem=["fed40,5"]
+
+The iomem line tells xl to allow access to the TPM
+IO memory pages, which are 5 pages that start at
+0xfed40000.
+
+Starting and stopping the manager:
+----------------------------------
+
+The vTPM manager should be started at boot, you may wish to 
+create an init script to do this.
+
+# xl create -c vtpmmgrdom.cfg
+
+Once initialization is complete you should see the following:
+INFO[VTPM]: Waiting for commands from vTPM's:
+
+To shutdown the manager you must destroy it. To avoid data corruption,
+only destroy the manager when you see the above "Waiting for commands"
+message. This ensures the disk is in a consistent state.
+
+# xl destroy vtpmmgrdom
+
+------------------------------
+VTPM AND LINUX PVM SETUP
+------------------------------
 
-You must also enable the virtual TPM to be built:
+In the following examples we will assume we have Linux
+guest named "domu" with its associated configuration
+located at /home/user/domu. It's vtpm will be named
+domu-vtpm.
 
-In Config.mk in the Xen root directory set the line
+vTPM disk image setup:
+----------------------
 
-VTPM_TOOLS ?= y
+The vTPM requires a disk image to store its persistent
+data. The image does not require a filesystem. The image
+does not need to be large. 8 Mb should be sufficient.
 
-and in
+# dd if=/dev/zero of=/home/user/domu/vtpm.img bs=8M count=1
 
-tools/vtpm/Rules.mk set the line
+vTPM config file:
+-----------------
 
-BUILD_EMULATOR = y
+The vTPM domain requires a configuration file like
+any other domain. The vTPM requires a disk image for
+storage and a TPM frontend driver to communicate
+with the manager. An example configuration is given:
 
-Now build the Xen sources from Xen's root directory:
+kernel="/usr/lib/xen/boot/vtpm-stubdom.gz"
+memory=8
+disk=["file:/home/user/domu/vtpm.img,hda,w"]
+name="domu-vtpm"
+vtpm=["backend=vtpmmgrdom,uuid=ac0a5b9e-cbe2-4c07-b43b-1d69e46fb839"]
 
-make install
+The vtpm= line sets up the tpm frontend driver. The backend must set
+to vtpmmgrdom. You are required to generate a uuid for this vtpm.
+You can use the uuidgen unix program or some other method to create a
+uuid. The uuid uniquely identifies this vtpm to manager.
 
+If you wish to clear the vTPM data you can either recreate the
+disk image or change the uuid.
 
-Also build the initial RAM disk if necessary.
+Linux Guest config file:
+------------------------
 
-Reboot the machine with the created Xen kernel.
+The Linux guest config file needs to be modified to include
+the Linux tpmfront driver. Add the following line:
 
-Note: If you do not want any TPM-related code compiled into your
-kernel or built as module then comment all the above lines like
-this example:
-# CONFIG_TCG_TPM is not set
+vtpm=["backend=domu-vtpm"]
 
+Currently only paravirtualized guests are supported.
 
-Modifying VM Configuration files:
----------------------------------
+Launching and shut down:
+------------------------
 
-VM configuration files need to be adapted to make a TPM instance
-available to a user domain. The following VM configuration file is
-an example of how a user domain can be configured to have a TPM
-available. It works similar to making a network interface
-available to a domain.
+To launch a Linux guest with a vTPM we first have to start the vTPM domain.
 
-kernel = "/boot/vmlinuz-2.6.x"
-ramdisk = "/xen/initrd_domU/U1_ramdisk.img"
-memory = 32
-name = "TPMUserDomain0"
-vtpm = ['instance=1,backend=0']
-root = "/dev/ram0 console=tty ro"
-vif = ['backend=0']
+# xl create -c /home/user/domu/vtpm.cfg
 
-In the above configuration file the line 'vtpm = ...' provides
-information about the domain where the virtual TPM is running and
-where the TPM backend has been compiled into - this has to be 
-domain 0  at the moment - and which TPM instance the user domain
-is supposed to talk to. Note that each running VM must use a 
-different instance and that using instance 0 is NOT allowed. The
-instance parameter is taken as the desired instance number, but
-the actual instance number that is assigned to the virtual machine
-can be different. This is the case if for example that particular
-instance is already used by another virtual machine. The association
-of which TPM instance number is used by which virtual machine is
-kept in the file /var/vtpm/vtpm.db. Associations are maintained by
-a xend-internal vTPM UUID and vTPM instance number.
+After initialization is complete, you should see the following:
+Info: Waiting for frontend domain to connect..
 
-Note: If you do not want TPM functionality for your user domain simply
-leave out the 'vtpm' line in the configuration file.
+Next, launch the Linux guest
 
+# xl create -c /home/user/domu/domu.cfg
 
-Running the TPM:
-----------------
+If xen-tpmfront was compiled as a module, be sure to load it
+in the guest.
 
-To run the vTPM, the device /dev/vtpm must be available.
-Verify that 'ls -l /dev/vtpm' shows the following output:
+# modprobe xen-tpmfront
 
-crw-------  1 root root 10, 225 Aug 11 06:58 /dev/vtpm
+After the Linux domain boots and the xen-tpmfront driver is loaded,
+you should see the following on the vtpm console:
 
-If it is not available, run the following command as 'root'.
-mknod /dev/vtpm c 10 225
+Info: VTPM attached to Frontend X/Y
 
-Make sure that the vTPM is running in domain 0. To do this run the
-following:
+If you have trousers and tpm_tools installed on the guest, you can test the
+vtpm.
 
-modprobe tpmbk
+On guest:
+# tcsd (if tcsd is not running already)
+# tpm_version
 
-/usr/bin/vtpm_managerd
+The version command should return the following:
+  TPM 1.2 Version Info:
+  Chip Version:        1.2.0.7
+  Spec Level:          2
+  Errata Revision:     1
+  TPM Vendor ID:       ETHZ
+  TPM Version:         01010000
+  Manufacturer Info:   4554485a
 
-Start a user domain using the 'xm create' command. Once you are in the
-shell of the user domain, you should be able to do the following as
-user 'root':
+You should also see the command being sent to the vtpm console as well
+as the vtpm saving its state. You should see the vtpm key being
+encrypted and stored on the vtpmmgrdom console.
 
-Insert the TPM frontend into the kernel if it has been compiled as a
-kernel module.
+To shutdown the guest and its vtpm, you just have to shutdown the guest
+normally. As soon as the guest vm disconnects, the vtpm will shut itself
+down automatically.
 
-> modprobe tpm_xenu
+On guest:
+# shutdown -h now
 
-Check the status of the TPM
+You may wish to write a script to start your vtpm and guest together.
 
-> cd /sys/devices/xen/vtpm-0
-> ls
-[...]  cancel  caps   pcrs    pubek   [...]
-> cat pcrs
-PCR-00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-01: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-02: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-03: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-04: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-05: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-06: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-07: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-08: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-[...]
+------------------------------
+MORE INFORMATION
+------------------------------
 
-At this point the user domain has been successfully connected to its
-virtual TPM instance.
+See stubdom/vtpmmgr/README for more details about how
+the manager domain works, how to use it, and its command line
+parameters.
 
-For further information please read the documentation in 
-tools/vtpm_manager/README and tools/vtpm/README
+See stubdom/vtpm/README for more specifics about how vtpm-stubdom
+operates and the command line options it accepts.
 
-Stefan Berger and Employees of the Intel Corp
diff --git a/stubdom/vtpm/README b/stubdom/vtpm/README
new file mode 100644
index 0000000..b8ddac6
--- /dev/null
+++ b/stubdom/vtpm/README
@@ -0,0 +1,75 @@
+Copyright (c) 2010-2012 United States Government, as represented by
+the Secretary of Defense.  All rights reserved.
+November 12 2012
+Authors: Matthew Fioravante (JHUAPL),
+
+This document describes the operation and command line interface
+of vtpm-stubdom. See docs/misc/vtpm.txt for details on the
+vTPM subsystem as a whole.
+
+
+------------------------------
+OPERATION
+------------------------------
+
+The vtpm-stubdom is a mini-OS domain that emulates a TPM for the guest OS to
+use. It is a small wrapper around the Berlios TPM emulator
+version 0.7.4. Commands are passed from the linux guest via the 
+mini-os TPM backend driver. vTPM data is encrypted and stored via a disk image
+provided to the virtual machine. The key used to encrypt the data along
+with a hash of the vTPM's data is sent to the vTPM manager for secure storage
+and later retrieval.  The vTPM domain communicates with the manager using a 
+mini-os tpm front/back device pair.
+
+------------------------------
+COMMAND LINE ARGUMENTS
+------------------------------
+
+Command line arguments are passed to the domain via the 'extra'
+parameter in the VM config file. Each parameter is separated
+by white space. For example:
+
+extra="foo=bar baz"
+
+List of Arguments:
+------------------
+
+loglevel=<LOG>: Controls the amount of logging printed to the console.
+	The possible values for <LOG> are:
+	 error
+	 info (default)
+	 debug
+
+clear: Start the Berlios emulator in "clear" mode. (default)
+
+save: Start the Berlios emulator in "save" mode.
+
+deactivated: Start the Berlios emulator in "deactivated" mode.
+	See the Berlios TPM emulator documentation for details
+	about the startup mode. For all normal use, always use clear
+	which is the default. You should not need to specify any of these.
+
+maintcmds=<1|0>: Enable to disable the TPM maintenance commands.
+	These commands are used by tpm manufacturers and thus
+	open a security hole. They are disabled by default.
+
+hwinitpcr=<PCRSPEC>: Initialize the virtual Platform Configuration Registers
+	(PCRs) with PCR values from the hardware TPM. Each pcr specified by
+	<PCRSPEC> will be initialized with the value of that same PCR in TPM
+	once at startup. By default all PCRs are zero initialized.
+	Value values of <PCRSPEC> are:
+	 all: copy all pcrs
+	 none: copy no pcrs (default)
+	 <N>: copy pcr n
+	 <X-Y>: copy pcrs x to y (inclusive)
+
+	These can also be combined by comma separation, for example:
+	 hwinitpcrs=5,12-16
+	will copy pcrs 5, 12, 13, 14, 15, and 16.
+
+------------------------------
+REFERENCES
+------------------------------
+
+Berlios TPM Emulator:
+http://tpm-emulator.berlios.de/
diff --git a/stubdom/vtpmmgr/README b/stubdom/vtpmmgr/README
new file mode 100644
index 0000000..42ebbc8
--- /dev/null
+++ b/stubdom/vtpmmgr/README
@@ -0,0 +1,75 @@
+Copyright (c) 2010-2012 United States Government, as represented by
+the Secretary of Defense.  All rights reserved.
+November 12 2012
+Authors: Matthew Fioravante (JHUAPL),
+
+This document describes the operation and command line interface
+of vtpmmgrdom. See docs/misc/vtpm.txt for details on the
+vTPM subsystem as a whole.
+
+
+------------------------------
+OPERATION
+------------------------------
+
+The vtpmmgrdom implements a vTPM manager who has two major functions:
+
+ - Securely store encryption keys for each of the vTPMS
+ - Regulate access to the hardware TPM for the entire system
+
+The manager accepts commands from the vtpm-stubdom domains via the mini-os 
+TPM backend driver. The vTPM manager communicates directly with hardware TPM 
+using the mini-os tpm_tis driver.
+
+
+When the manager starts for the first time it will check if the TPM
+has an owner. If the TPM is unowned, it will attempt to take ownership
+with the supplied owner_auth (see below) and then create a TPM
+storage key which will be used to secure vTPM key data. Currently the
+manager only binds vTPM keys to the disk. In the future support
+for sealing to PCRs should be added.
+
+------------------------------
+COMMAND LINE ARGUMENTS
+------------------------------
+
+Command line arguments are passed to the domain via the 'extra'
+parameter in the VM config file. Each parameter is separated
+by white space. For example:
+
+extra="foo=bar baz"
+
+List of Arguments:
+------------------
+
+owner_auth=<AUTHSPEC>: Set the owner auth of the TPM. The default
+	is the well known owner auth of all ones.
+
+srk_auth=<AUTHSPEC>: Set the SRK auth for the TPM. The default is
+	the well known srk auth of all zeroes.
+	The possible values of <AUTHSPEC> are:
+	 well-known: Use the well known auth (default)
+	 random: Randomly generate an auth
+	 hash: <HASH>: Use the given 40 character ASCII hex string
+	 text: <STR>: Use sha1 hash of <STR>.
+
+tpmdriver=<DRIVER>: Which driver to use to talk to the hardware TPM.
+	Don't change this unless you know what you're doing.
+	The possible values of <DRIVER> are:
+	 tpm_tis: Use the tpm_tis driver to talk directly to the TPM.
+		The domain must have access to TPM IO memory.  (default)
+	 tpmfront: Use tpmfront to talk to the TPM. The domain must have
+		a tpmfront device setup to talk to another domain
+		which provides access to the TPM.
+
+The following options only apply to the tpm_tis driver:
+
+tpmiomem=<ADDR>: The base address of the hardware memory pages of the
+	TPM (default 0xfed40000).
+
+tpmirq=<IRQ>: The irq of the hardware TPM if using interrupts. A value of
+	"probe" can be set to probe for the irq. A value of 0
+	disabled interrupts and uses polling (default 0).
+
+tpmlocality=<LOC>: Attempt to use locality <LOC> of the hardware TPM.
+	(default 0)
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:22:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaoiM-0005ll-Tx; Tue, 20 Nov 2012 14:22:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaoiJ-0005kp-Tt
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:22:12 +0000
Received: from [85.158.138.51:6120] by server-12.bemta-3.messagelabs.com id
	9C/15-22757-3129BA05; Tue, 20 Nov 2012 14:22:11 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353421321!22741365!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY,UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20605 invoked from network); 20 Nov 2012 14:22:03 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-6.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 20 Nov 2012 14:22:03 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149572011;
	Tue, 20 Nov 2012 09:21:53 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org,
	Ian.Campbell@citrix.com
Date: Tue, 20 Nov 2012 09:21:09 -0500
Message-Id: <1353421272-24797-2-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v4 2/5] add stubdom/vtpmmgr code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add the code base for vtpmmgrdom. Makefile changes
next patch.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/vtpmmgr/Makefile           |   32 ++
 stubdom/vtpmmgr/init.c             |  553 +++++++++++++++++++++
 stubdom/vtpmmgr/log.c              |  151 ++++++
 stubdom/vtpmmgr/log.h              |   85 ++++
 stubdom/vtpmmgr/marshal.h          |  528 ++++++++++++++++++++
 stubdom/vtpmmgr/minios.cfg         |   14 +
 stubdom/vtpmmgr/tcg.h              |  707 +++++++++++++++++++++++++++
 stubdom/vtpmmgr/tpm.c              |  938 ++++++++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/tpm.h              |  218 +++++++++
 stubdom/vtpmmgr/tpmrsa.c           |  175 +++++++
 stubdom/vtpmmgr/tpmrsa.h           |   67 +++
 stubdom/vtpmmgr/uuid.h             |   50 ++
 stubdom/vtpmmgr/vtpm_cmd_handler.c |  152 ++++++
 stubdom/vtpmmgr/vtpm_manager.h     |   64 +++
 stubdom/vtpmmgr/vtpm_storage.c     |  794 ++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/vtpm_storage.h     |   68 +++
 stubdom/vtpmmgr/vtpmmgr.c          |   93 ++++
 stubdom/vtpmmgr/vtpmmgr.h          |   77 +++
 18 files changed, 4766 insertions(+)
 create mode 100644 stubdom/vtpmmgr/Makefile
 create mode 100644 stubdom/vtpmmgr/init.c
 create mode 100644 stubdom/vtpmmgr/log.c
 create mode 100644 stubdom/vtpmmgr/log.h
 create mode 100644 stubdom/vtpmmgr/marshal.h
 create mode 100644 stubdom/vtpmmgr/minios.cfg
 create mode 100644 stubdom/vtpmmgr/tcg.h
 create mode 100644 stubdom/vtpmmgr/tpm.c
 create mode 100644 stubdom/vtpmmgr/tpm.h
 create mode 100644 stubdom/vtpmmgr/tpmrsa.c
 create mode 100644 stubdom/vtpmmgr/tpmrsa.h
 create mode 100644 stubdom/vtpmmgr/uuid.h
 create mode 100644 stubdom/vtpmmgr/vtpm_cmd_handler.c
 create mode 100644 stubdom/vtpmmgr/vtpm_manager.h
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.c
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.h
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.c
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.h

diff --git a/stubdom/vtpmmgr/Makefile b/stubdom/vtpmmgr/Makefile
new file mode 100644
index 0000000..88c83c3
--- /dev/null
+++ b/stubdom/vtpmmgr/Makefile
@@ -0,0 +1,32 @@
+# Copyright (c) 2010-2012 United States Government, as represented by
+# the Secretary of Defense.  All rights reserved.
+#
+# THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+# ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+# INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+# DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+# SOFTWARE.
+#
+
+XEN_ROOT=../..
+
+PSSL_DIR=../polarssl-$(XEN_TARGET_ARCH)/library
+PSSL_OBJS=aes.o sha1.o entropy.o ctr_drbg.o bignum.o sha4.o havege.o timing.o entropy_poll.o
+
+TARGET=vtpmmgr.a
+OBJS=vtpmmgr.o vtpm_cmd_handler.o vtpm_storage.o init.o tpmrsa.o tpm.o log.o
+
+CFLAGS+=-Werror -Iutil -Icrypto -Itcs
+CFLAGS+=-Wno-declaration-after-statement -Wno-unused-label
+
+build: $(TARGET)
+$(TARGET): $(OBJS)
+	ar -rcs $@ $^ $(foreach obj,$(PSSL_OBJS),$(PSSL_DIR)/$(obj))
+
+clean:
+	rm -f $(TARGET) $(OBJS)
+
+distclean: clean
+
+.PHONY: clean distclean
diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
new file mode 100644
index 0000000..a158020
--- /dev/null
+++ b/stubdom/vtpmmgr/init.c
@@ -0,0 +1,553 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+#include <stdint.h>
+#include <stdlib.h>
+
+#include <xen/xen.h>
+#include <mini-os/tpmback.h>
+#include <mini-os/tpmfront.h>
+#include <mini-os/tpm_tis.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <polarssl/sha1.h>
+
+#include "log.h"
+#include "vtpmmgr.h"
+#include "vtpm_storage.h"
+#include "tpm.h"
+#include "marshal.h"
+
+struct Opts {
+   enum {
+      TPMDRV_TPM_TIS,
+      TPMDRV_TPMFRONT,
+   } tpmdriver;
+   unsigned long tpmiomem;
+   unsigned int tpmirq;
+   unsigned int tpmlocality;
+   int gen_owner_auth;
+};
+
+// --------------------------- Well Known Auths --------------------------
+const TPM_AUTHDATA WELLKNOWN_SRK_AUTH = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+const TPM_AUTHDATA WELLKNOWN_OWNER_AUTH = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+
+struct vtpm_globals vtpm_globals = {
+   .tpm_fd = -1,
+   .storage_key = TPM_KEY_INIT,
+   .storage_key_handle = 0,
+   .oiap = { .AuthHandle = 0 }
+};
+
+static int tpm_entropy_source(void* dummy, unsigned char* data, size_t len, size_t* olen) {
+   UINT32 sz = len;
+   TPM_RESULT rc = TPM_GetRandom(&sz, data);
+   *olen = sz;
+   return rc == TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
+}
+
+static TPM_RESULT check_tpm_version(void) {
+   TPM_RESULT status;
+   UINT32 rsize;
+   BYTE* res = NULL;
+   TPM_CAP_VERSION_INFO vinfo;
+
+   TPMTRYRETURN(TPM_GetCapability(
+            TPM_CAP_VERSION_VAL,
+            0,
+            NULL,
+            &rsize,
+            &res));
+   if(rsize < 4) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid size returned by GetCapability!\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   unpack_TPM_CAP_VERSION_INFO(res, &vinfo, UNPACK_ALIAS);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Hardware TPM:\n");
+   vtpmloginfo(VTPM_LOG_VTPM, " version: %hhd %hhd %hhd %hhd\n",
+         vinfo.version.major, vinfo.version.minor, vinfo.version.revMajor, vinfo.version.revMinor);
+   vtpmloginfo(VTPM_LOG_VTPM, " specLevel: %hd\n", vinfo.specLevel);
+   vtpmloginfo(VTPM_LOG_VTPM, " errataRev: %hhd\n", vinfo.errataRev);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorID: %c%c%c%c\n",
+         vinfo.tpmVendorID[0], vinfo.tpmVendorID[1],
+         vinfo.tpmVendorID[2], vinfo.tpmVendorID[3]);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecificSize: %hd\n", vinfo.vendorSpecificSize);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecific: ");
+   for(int i = 0; i < vinfo.vendorSpecificSize; ++i) {
+      vtpmloginfomore(VTPM_LOG_VTPM, "%02hhx", vinfo.vendorSpecific[i]);
+   }
+   vtpmloginfomore(VTPM_LOG_VTPM, "\n");
+
+abort_egress:
+   free(res);
+   return status;
+}
+
+static TPM_RESULT flush_tpm(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   const TPM_RESOURCE_TYPE reslist[] = { TPM_RT_KEY, TPM_RT_AUTH, TPM_RT_TRANS, TPM_RT_COUNTER, TPM_RT_DAA_TPM, TPM_RT_CONTEXT };
+   BYTE* keylist = NULL;
+   UINT32 keylistSize;
+   BYTE* ptr;
+
+   //Iterate through each resource type and flush all handles
+   for(int i = 0; i < sizeof(reslist) / sizeof(TPM_RESOURCE_TYPE); ++i) {
+      TPM_RESOURCE_TYPE beres = cpu_to_be32(reslist[i]);
+      UINT16 size;
+      TPMTRYRETURN(TPM_GetCapability(
+               TPM_CAP_HANDLE,
+               sizeof(TPM_RESOURCE_TYPE),
+               (BYTE*)(&beres),
+               &keylistSize,
+               &keylist));
+
+      ptr = keylist;
+      ptr = unpack_UINT16(ptr, &size);
+
+      //Flush each handle
+      if(size) {
+         vtpmloginfo(VTPM_LOG_VTPM, "Flushing %u handle(s) of type %lu\n", size, (unsigned long) reslist[i]);
+         for(int j = 0; j < size; ++j) {
+            TPM_HANDLE h;
+            ptr = unpack_TPM_HANDLE(ptr, &h);
+            TPMTRYRETURN(TPM_FlushSpecific(h, reslist[i]));
+         }
+      }
+
+      free(keylist);
+      keylist = NULL;
+   }
+
+   goto egress;
+abort_egress:
+   free(keylist);
+egress:
+   return status;
+}
+
+
+static TPM_RESULT try_take_ownership(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_PUBKEY pubEK = TPM_PUBKEY_INIT;
+
+   // If we can read PubEK then there is no owner and we should take it.
+   status = TPM_ReadPubek(&pubEK);
+
+   switch(status) {
+      case TPM_DISABLED_CMD:
+         //Cannot read ek? TPM has owner
+         vtpmloginfo(VTPM_LOG_VTPM, "Failed to readEK meaning TPM has an owner. Creating Keys off existing SRK.\n");
+         status = TPM_SUCCESS;
+         break;
+      case TPM_NO_ENDORSEMENT:
+         {
+            //If theres no ek, we have to create one
+            TPM_KEY_PARMS keyInfo = {
+               .algorithmID = TPM_ALG_RSA,
+               .encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1,
+               .sigScheme = TPM_SS_NONE,
+               .parmSize = 12,
+               .parms.rsa = {
+                  .keyLength = RSA_KEY_SIZE,
+                  .numPrimes = 2,
+                  .exponentSize = 0,
+                  .exponent = NULL,
+               },
+            };
+            TPMTRYRETURN(TPM_CreateEndorsementKeyPair(&keyInfo, &pubEK));
+         }
+         //fall through to take ownership
+      case TPM_SUCCESS:
+         {
+            //Construct the Srk
+            TPM_KEY srk = {
+               .ver = TPM_STRUCT_VER_1_1,
+               .keyUsage = TPM_KEY_STORAGE,
+               .keyFlags = 0x00,
+               .authDataUsage = TPM_AUTH_ALWAYS,
+               .algorithmParms = {
+                  .algorithmID = TPM_ALG_RSA,
+                  .encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1,
+                  .sigScheme =  TPM_SS_NONE,
+                  .parmSize = 12,
+                  .parms.rsa = {
+                     .keyLength = RSA_KEY_SIZE,
+                     .numPrimes = 2,
+                     .exponentSize = 0,
+                     .exponent = NULL,
+                  },
+               },
+               .PCRInfoSize = 0,
+               .pubKey = {
+                  .keyLength = 0,
+                  .key = NULL,
+               },
+               .encDataSize = 0,
+            };
+
+            TPMTRYRETURN(TPM_TakeOwnership(
+                     &pubEK,
+                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
+                     (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+                     &srk,
+                     NULL,
+                     &vtpm_globals.oiap));
+
+            TPMTRYRETURN(TPM_DisablePubekRead(
+                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
+                     &vtpm_globals.oiap));
+         }
+         break;
+      default:
+         break;
+   }
+abort_egress:
+   free_TPM_PUBKEY(&pubEK);
+   return status;
+}
+
+static void init_storage_key(TPM_KEY* key) {
+   key->ver.major = 1;
+   key->ver.minor = 1;
+   key->ver.revMajor = 0;
+   key->ver.revMinor = 0;
+
+   key->keyUsage = TPM_KEY_BIND;
+   key->keyFlags = 0;
+   key->authDataUsage = TPM_AUTH_ALWAYS;
+
+   TPM_KEY_PARMS* p = &key->algorithmParms;
+   p->algorithmID = TPM_ALG_RSA;
+   p->encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
+   p->sigScheme = TPM_SS_NONE;
+   p->parmSize = 12;
+
+   TPM_RSA_KEY_PARMS* r = &p->parms.rsa;
+   r->keyLength = RSA_KEY_SIZE;
+   r->numPrimes = 2;
+   r->exponentSize = 0;
+   r->exponent = NULL;
+
+   key->PCRInfoSize = 0;
+   key->encDataSize = 0;
+   key->encData = NULL;
+}
+
+static int parse_auth_string(char* authstr, BYTE* target, const TPM_AUTHDATA wellknown, int allowrandom) {
+   int rc;
+   /* well known owner auth */
+   if(!strcmp(authstr, "well-known")) {
+      memcpy(target, wellknown, sizeof(TPM_AUTHDATA));
+   }
+   /* Create a randomly generated owner auth */
+   else if(allowrandom && !strcmp(authstr, "random")) {
+      return 1;
+   }
+   /* owner auth is a raw hash */
+   else if(!strncmp(authstr, "hash:", 5)) {
+      authstr += 5;
+      if((rc = strlen(authstr)) != 40) {
+         vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth hex string `%s' must be exactly 40 characters (20 bytes) long, length=%d\n", authstr, rc);
+         return -1;
+      }
+      for(int j = 0; j < 20; ++j) {
+         if(sscanf(authstr, "%hhX", target + j) != 1) {
+            vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth string `%s' is not a valid hex string\n", authstr);
+            return -1;
+         }
+         authstr += 2;
+      }
+   }
+   /* owner auth is a string that will be hashed */
+   else if(!strncmp(authstr, "text:", 5)) {
+      authstr += 5;
+      sha1((const unsigned char*)authstr, strlen(authstr), target);
+   }
+   else {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid auth string %s\n", authstr);
+      return -1;
+   }
+
+   return 0;
+}
+
+int parse_cmdline_opts(int argc, char** argv, struct Opts* opts)
+{
+   int rc;
+   int i;
+
+   //Set defaults
+   memcpy(vtpm_globals.owner_auth, WELLKNOWN_OWNER_AUTH, sizeof(TPM_AUTHDATA));
+   memcpy(vtpm_globals.srk_auth, WELLKNOWN_SRK_AUTH, sizeof(TPM_AUTHDATA));
+
+   for(i = 1; i < argc; ++i) {
+      if(!strncmp(argv[i], "owner_auth:", 10)) {
+         if((rc = parse_auth_string(argv[i] + 10, vtpm_globals.owner_auth, WELLKNOWN_OWNER_AUTH, 1)) < 0) {
+            goto err_invalid;
+         }
+         if(rc == 1) {
+            opts->gen_owner_auth = 1;
+         }
+      }
+      else if(!strncmp(argv[i], "srk_auth:", 8)) {
+         if((rc = parse_auth_string(argv[i] + 8, vtpm_globals.srk_auth, WELLKNOWN_SRK_AUTH, 0)) != 0) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmdriver=", 10)) {
+         if(!strcmp(argv[i] + 10, "tpm_tis")) {
+            opts->tpmdriver = TPMDRV_TPM_TIS;
+         } else if(!strcmp(argv[i] + 10, "tpmfront")) {
+            opts->tpmdriver = TPMDRV_TPMFRONT;
+         } else {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmiomem=",9)) {
+         if(sscanf(argv[i] + 9, "0x%lX", &opts->tpmiomem) != 1) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmirq=",7)) {
+         if(!strcmp(argv[i] + 7, "probe")) {
+            opts->tpmirq = TPM_PROBE_IRQ;
+         } else if( sscanf(argv[i] + 7, "%u", &opts->tpmirq) != 1) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmlocality=",12)) {
+         if(sscanf(argv[i] + 12, "%u", &opts->tpmlocality) != 1 || opts->tpmlocality > 4) {
+            goto err_invalid;
+         }
+      }
+   }
+
+   switch(opts->tpmdriver) {
+      case TPMDRV_TPM_TIS:
+         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpm_tis driver\n");
+         break;
+      case TPMDRV_TPMFRONT:
+         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpmfront driver\n");
+         break;
+   }
+
+   return 0;
+err_invalid:
+   vtpmlogerror(VTPM_LOG_VTPM, "Invalid Option %s\n", argv[i]);
+   return -1;
+}
+
+
+
+static TPM_RESULT vtpmmgr_create(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_AUTH_SESSION osap = TPM_AUTH_SESSION_INIT;
+   TPM_AUTHDATA sharedsecret;
+
+   // Take ownership if TPM is unowned
+   TPMTRYRETURN(try_take_ownership());
+
+   // Generate storage key's auth
+   memset(&vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA));
+
+   TPMTRYRETURN( TPM_OSAP(
+            TPM_ET_KEYHANDLE,
+            TPM_SRK_KEYHANDLE,
+            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+            &sharedsecret,
+            &osap) );
+
+   init_storage_key(&vtpm_globals.storage_key);
+
+   //initialize the storage key
+   TPMTRYRETURN( TPM_CreateWrapKey(
+            TPM_SRK_KEYHANDLE,
+            (const TPM_AUTHDATA*)&sharedsecret,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.storage_key,
+            &osap) );
+
+   //Load Storage Key
+   TPMTRYRETURN( TPM_LoadKey(
+            TPM_SRK_KEYHANDLE,
+            &vtpm_globals.storage_key,
+            &vtpm_globals.storage_key_handle,
+            (const TPM_AUTHDATA*) &vtpm_globals.srk_auth,
+            &vtpm_globals.oiap));
+
+   //Make sure TPM has commited changes
+   TPMTRYRETURN( TPM_SaveState() );
+
+   //Create new disk image
+   TPMTRYRETURN(vtpm_storage_new_header());
+
+   goto egress;
+abort_egress:
+egress:
+   vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager\n");
+
+   //End the OSAP session
+   if(osap.AuthHandle) {
+      TPM_TerminateHandle(osap.AuthHandle);
+   }
+
+   return status;
+}
+
+TPM_RESULT vtpmmgr_init(int argc, char** argv) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   /* Default commandline options */
+   struct Opts opts = {
+      .tpmdriver = TPMDRV_TPM_TIS,
+      .tpmiomem = TPM_BASEADDR,
+      .tpmirq = 0,
+      .tpmlocality = 0,
+      .gen_owner_auth = 0,
+   };
+
+   if(parse_cmdline_opts(argc, argv, &opts) != 0) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Command line parsing failed! exiting..\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   //Setup storage system
+   if(vtpm_storage_init() != 0) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize storage subsystem!\n");
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   //Setup tpmback device
+   init_tpmback();
+
+   //Setup tpm access
+   switch(opts.tpmdriver) {
+      case TPMDRV_TPM_TIS:
+         {
+            struct tpm_chip* tpm;
+            if((tpm = init_tpm_tis(opts.tpmiomem, TPM_TIS_LOCL_INT_TO_FLAG(opts.tpmlocality), opts.tpmirq)) == NULL) {
+               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+               status = TPM_IOERROR;
+               goto abort_egress;
+            }
+            vtpm_globals.tpm_fd = tpm_tis_open(tpm);
+            tpm_tis_request_locality(tpm, opts.tpmlocality);
+         }
+         break;
+      case TPMDRV_TPMFRONT:
+         {
+            struct tpmfront_dev* tpmfront_dev;
+            if((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
+               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+               status = TPM_IOERROR;
+               goto abort_egress;
+            }
+            vtpm_globals.tpm_fd = tpmfront_open(tpmfront_dev);
+         }
+         break;
+   }
+
+   //Get the version of the tpm
+   TPMTRYRETURN(check_tpm_version());
+
+   // Blow away all stale handles left in the tpm
+   if(flush_tpm() != TPM_SUCCESS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_FlushResources failed, continuing anyway..\n");
+   }
+
+   /* Initialize the rng */
+   entropy_init(&vtpm_globals.entropy);
+   entropy_add_source(&vtpm_globals.entropy, tpm_entropy_source, NULL, 0);
+   entropy_gather(&vtpm_globals.entropy);
+   ctr_drbg_init(&vtpm_globals.ctr_drbg, entropy_func, &vtpm_globals.entropy, NULL, 0);
+   ctr_drbg_set_prediction_resistance( &vtpm_globals.ctr_drbg, CTR_DRBG_PR_OFF );
+
+   // Generate Auth for Owner
+   if(opts.gen_owner_auth) {
+      vtpmmgr_rand(vtpm_globals.owner_auth, sizeof(TPM_AUTHDATA));
+   }
+
+   // Create OIAP session for service's authorized commands
+   TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
+
+   /* Load the Manager data, if it fails create a new manager */
+   if (vtpm_storage_load_header() != TPM_SUCCESS) {
+      /* If the OIAP session was closed by an error, create a new one */
+      if(vtpm_globals.oiap.AuthHandle == 0) {
+         TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
+      }
+      vtpmloginfo(VTPM_LOG_VTPM, "Failed to read manager file. Assuming first time initialization.\n");
+      TPMTRYRETURN( vtpmmgr_create() );
+   }
+
+   goto egress;
+abort_egress:
+   vtpmmgr_shutdown();
+egress:
+   return status;
+}
+
+void vtpmmgr_shutdown(void)
+{
+   /* Cleanup resources */
+   free_TPM_KEY(&vtpm_globals.storage_key);
+
+   /* Cleanup TPM resources */
+   TPM_EvictKey(vtpm_globals.storage_key_handle);
+   TPM_TerminateHandle(vtpm_globals.oiap.AuthHandle);
+
+   /* Close tpmback */
+   shutdown_tpmback();
+
+   /* Close the storage system and blkfront */
+   vtpm_storage_shutdown();
+
+   /* Close tpmfront/tpm_tis */
+   close(vtpm_globals.tpm_fd);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
+}
diff --git a/stubdom/vtpmmgr/log.c b/stubdom/vtpmmgr/log.c
new file mode 100644
index 0000000..a82c913
--- /dev/null
+++ b/stubdom/vtpmmgr/log.c
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "tcg.h"
+
+char *module_names[] = { "",
+                                "TPM",
+                                "TPM",
+                                "VTPM",
+                                "VTPM",
+                                "TXDATA",
+                              };
+// Helper code for the consts, eg. to produce messages for error codes.
+
+typedef struct error_code_entry_t {
+  TPM_RESULT code;
+  char * code_name;
+  char * msg;
+} error_code_entry_t;
+
+static const error_code_entry_t error_msgs [] = {
+  { TPM_SUCCESS, "TPM_SUCCESS", "Successful completion of the operation" },
+  { TPM_AUTHFAIL, "TPM_AUTHFAIL", "Authentication failed" },
+  { TPM_BADINDEX, "TPM_BADINDEX", "The index to a PCR, DIR or other register is incorrect" },
+  { TPM_BAD_PARAMETER, "TPM_BAD_PARAMETER", "One or more parameter is bad" },
+  { TPM_AUDITFAILURE, "TPM_AUDITFAILURE", "An operation completed successfully but the auditing of that operation failed." },
+  { TPM_CLEAR_DISABLED, "TPM_CLEAR_DISABLED", "The clear disable flag is set and all clear operations now require physical access" },
+  { TPM_DEACTIVATED, "TPM_DEACTIVATED", "The TPM is deactivated" },
+  { TPM_DISABLED, "TPM_DISABLED", "The TPM is disabled" },
+  { TPM_DISABLED_CMD, "TPM_DISABLED_CMD", "The target command has been disabled" },
+  { TPM_FAIL, "TPM_FAIL", "The operation failed" },
+  { TPM_BAD_ORDINAL, "TPM_BAD_ORDINAL", "The ordinal was unknown or inconsistent" },
+  { TPM_INSTALL_DISABLED, "TPM_INSTALL_DISABLED", "The ability to install an owner is disabled" },
+  { TPM_INVALID_KEYHANDLE, "TPM_INVALID_KEYHANDLE", "The key handle presented was invalid" },
+  { TPM_KEYNOTFOUND, "TPM_KEYNOTFOUND", "The target key was not found" },
+  { TPM_INAPPROPRIATE_ENC, "TPM_INAPPROPRIATE_ENC", "Unacceptable encryption scheme" },
+  { TPM_MIGRATEFAIL, "TPM_MIGRATEFAIL", "Migration authorization failed" },
+  { TPM_INVALID_PCR_INFO, "TPM_INVALID_PCR_INFO", "PCR information could not be interpreted" },
+  { TPM_NOSPACE, "TPM_NOSPACE", "No room to load key." },
+  { TPM_NOSRK, "TPM_NOSRK", "There is no SRK set" },
+  { TPM_NOTSEALED_BLOB, "TPM_NOTSEALED_BLOB", "An encrypted blob is invalid or was not created by this TPM" },
+  { TPM_OWNER_SET, "TPM_OWNER_SET", "There is already an Owner" },
+  { TPM_RESOURCES, "TPM_RESOURCES", "The TPM has insufficient internal resources to perform the requested action." },
+  { TPM_SHORTRANDOM, "TPM_SHORTRANDOM", "A random string was too short" },
+  { TPM_SIZE, "TPM_SIZE", "The TPM does not have the space to perform the operation." },
+  { TPM_WRONGPCRVAL, "TPM_WRONGPCRVAL", "The named PCR value does not match the current PCR value." },
+  { TPM_BAD_PARAM_SIZE, "TPM_BAD_PARAM_SIZE", "The paramSize argument to the command has the incorrect value" },
+  { TPM_SHA_THREAD, "TPM_SHA_THREAD", "There is no existing SHA-1 thread." },
+  { TPM_SHA_ERROR, "TPM_SHA_ERROR", "The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error." },
+  { TPM_FAILEDSELFTEST, "TPM_FAILEDSELFTEST", "Self-test has failed and the TPM has shutdown." },
+  { TPM_AUTH2FAIL, "TPM_AUTH2FAIL", "The authorization for the second key in a 2 key function failed authorization" },
+  { TPM_BADTAG, "TPM_BADTAG", "The tag value sent to for a command is invalid" },
+  { TPM_IOERROR, "TPM_IOERROR", "An IO error occurred transmitting information to the TPM" },
+  { TPM_ENCRYPT_ERROR, "TPM_ENCRYPT_ERROR", "The encryption process had a problem." },
+  { TPM_DECRYPT_ERROR, "TPM_DECRYPT_ERROR", "The decryption process did not complete." },
+  { TPM_INVALID_AUTHHANDLE, "TPM_INVALID_AUTHHANDLE", "An invalid handle was used." },
+  { TPM_NO_ENDORSEMENT, "TPM_NO_ENDORSEMENT", "The TPM does not a EK installed" },
+  { TPM_INVALID_KEYUSAGE, "TPM_INVALID_KEYUSAGE", "The usage of a key is not allowed" },
+  { TPM_WRONG_ENTITYTYPE, "TPM_WRONG_ENTITYTYPE", "The submitted entity type is not allowed" },
+  { TPM_INVALID_POSTINIT, "TPM_INVALID_POSTINIT", "The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup" },
+  { TPM_INAPPROPRIATE_SIG, "TPM_INAPPROPRIATE_SIG", "Signed data cannot include additional DER information" },
+  { TPM_BAD_KEY_PROPERTY, "TPM_BAD_KEY_PROPERTY", "The key properties in TPM_KEY_PARMs are not supported by this TPM" },
+
+  { TPM_BAD_MIGRATION, "TPM_BAD_MIGRATION", "The migration properties of this key are incorrect." },
+  { TPM_BAD_SCHEME, "TPM_BAD_SCHEME", "The signature or encryption scheme for this key is incorrect or not permitted in this situation." },
+  { TPM_BAD_DATASIZE, "TPM_BAD_DATASIZE", "The size of the data (or blob) parameter is bad or inconsistent with the referenced key" },
+  { TPM_BAD_MODE, "TPM_BAD_MODE", "A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob." },
+  { TPM_BAD_PRESENCE, "TPM_BAD_PRESENCE", "Either the physicalPresence or physicalPresenceLock bits have the wrong value" },
+  { TPM_BAD_VERSION, "TPM_BAD_VERSION", "The TPM cannot perform this version of the capability" },
+  { TPM_NO_WRAP_TRANSPORT, "TPM_NO_WRAP_TRANSPORT", "The TPM does not allow for wrapped transport sessions" },
+  { TPM_AUDITFAIL_UNSUCCESSFUL, "TPM_AUDITFAIL_UNSUCCESSFUL", "TPM audit construction failed and the underlying command was returning a failure code also" },
+  { TPM_AUDITFAIL_SUCCESSFUL, "TPM_AUDITFAIL_SUCCESSFUL", "TPM audit construction failed and the underlying command was returning success" },
+  { TPM_NOTRESETABLE, "TPM_NOTRESETABLE", "Attempt to reset a PCR register that does not have the resettable attribute" },
+  { TPM_NOTLOCAL, "TPM_NOTLOCAL", "Attempt to reset a PCR register that requires locality and locality modifier not part of command transport" },
+  { TPM_BAD_TYPE, "TPM_BAD_TYPE", "Make identity blob not properly typed" },
+  { TPM_INVALID_RESOURCE, "TPM_INVALID_RESOURCE", "When saving context identified resource type does not match actual resource" },
+  { TPM_NOTFIPS, "TPM_NOTFIPS", "The TPM is attempting to execute a command only available when in FIPS mode" },
+  { TPM_INVALID_FAMILY, "TPM_INVALID_FAMILY", "The command is attempting to use an invalid family ID" },
+  { TPM_NO_NV_PERMISSION, "TPM_NO_NV_PERMISSION", "The permission to manipulate the NV storage is not available" },
+  { TPM_REQUIRES_SIGN, "TPM_REQUIRES_SIGN", "The operation requires a signed command" },
+  { TPM_KEY_NOTSUPPORTED, "TPM_KEY_NOTSUPPORTED", "Wrong operation to load an NV key" },
+  { TPM_AUTH_CONFLICT, "TPM_AUTH_CONFLICT", "NV_LoadKey blob requires both owner and blob authorization" },
+  { TPM_AREA_LOCKED, "TPM_AREA_LOCKED", "The NV area is locked and not writtable" },
+  { TPM_BAD_LOCALITY, "TPM_BAD_LOCALITY", "The locality is incorrect for the attempted operation" },
+  { TPM_READ_ONLY, "TPM_READ_ONLY", "The NV area is read only and can't be written to" },
+  { TPM_PER_NOWRITE, "TPM_PER_NOWRITE", "There is no protection on the write to the NV area" },
+  { TPM_FAMILYCOUNT, "TPM_FAMILYCOUNT", "The family count value does not match" },
+  { TPM_WRITE_LOCKED, "TPM_WRITE_LOCKED", "The NV area has already been written to" },
+  { TPM_BAD_ATTRIBUTES, "TPM_BAD_ATTRIBUTES", "The NV area attributes conflict" },
+  { TPM_INVALID_STRUCTURE, "TPM_INVALID_STRUCTURE", "The structure tag and version are invalid or inconsistent" },
+  { TPM_KEY_OWNER_CONTROL, "TPM_KEY_OWNER_CONTROL", "The key is under control of the TPM Owner and can only be evicted by the TPM Owner." },
+  { TPM_BAD_COUNTER, "TPM_BAD_COUNTER", "The counter handle is incorrect" },
+  { TPM_NOT_FULLWRITE, "TPM_NOT_FULLWRITE", "The write is not a complete write of the area" },
+  { TPM_CONTEXT_GAP, "TPM_CONTEXT_GAP", "The gap between saved context counts is too large" },
+  { TPM_MAXNVWRITES, "TPM_MAXNVWRITES", "The maximum number of NV writes without an owner has been exceeded" },
+  { TPM_NOOPERATOR, "TPM_NOOPERATOR", "No operator authorization value is set" },
+  { TPM_RESOURCEMISSING, "TPM_RESOURCEMISSING", "The resource pointed to by context is not loaded" },
+  { TPM_DELEGATE_LOCK, "TPM_DELEGATE_LOCK", "The delegate administration is locked" },
+  { TPM_DELEGATE_FAMILY, "TPM_DELEGATE_FAMILY", "Attempt to manage a family other then the delegated family" },
+  { TPM_DELEGATE_ADMIN, "TPM_DELEGATE_ADMIN", "Delegation table management not enabled" },
+  { TPM_TRANSPORT_EXCLUSIVE, "TPM_TRANSPORT_EXCLUSIVE", "There was a command executed outside of an exclusive transport session" },
+};
+
+
+// helper function for the error codes:
+const char* tpm_get_error_name (TPM_RESULT code) {
+  // just do a linear scan for now
+  unsigned i;
+  for (i = 0; i < sizeof(error_msgs)/sizeof(error_msgs[0]); i++)
+    if (code == error_msgs[i].code)
+      return error_msgs[i].code_name;
+
+    return("Unknown Error Code");
+}
diff --git a/stubdom/vtpmmgr/log.h b/stubdom/vtpmmgr/log.h
new file mode 100644
index 0000000..5c7abf5
--- /dev/null
+++ b/stubdom/vtpmmgr/log.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __VTPM_LOG_H__
+#define __VTPM_LOG_H__
+
+#include <stdint.h>             // for uint32_t
+#include <stddef.h>             // for pointer NULL
+#include <stdio.h>
+#include "tcg.h"
+
+// =========================== LOGGING ==============================
+
+// the logging module numbers
+#define VTPM_LOG_TPM         1
+#define VTPM_LOG_TPM_DEEP    2
+#define VTPM_LOG_VTPM        3
+#define VTPM_LOG_VTPM_DEEP   4
+#define VTPM_LOG_TXDATA      5
+
+extern char *module_names[];
+
+// Default to standard logging
+#ifndef LOGGING_MODULES
+#define LOGGING_MODULES (BITMASK(VTPM_LOG_VTPM)|BITMASK(VTPM_LOG_TPM))
+#endif
+
+// bit-access macros
+#define BITMASK(idx)      ( 1U << (idx) )
+#define GETBIT(num,idx)   ( ((num) & BITMASK(idx)) >> idx )
+#define SETBIT(num,idx)   (num) |= BITMASK(idx)
+#define CLEARBIT(num,idx) (num) &= ( ~ BITMASK(idx) )
+
+#define vtpmloginfo(module, fmt, args...) \
+  if (GETBIT (LOGGING_MODULES, module) == 1) {				\
+    fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); \
+  }
+
+#define vtpmloginfomore(module, fmt, args...) \
+  if (GETBIT (LOGGING_MODULES, module) == 1) {			      \
+    fprintf (stdout, fmt,##args);				      \
+  }
+
+#define vtpmlogerror(module, fmt, args...) \
+  fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
+
+//typedef UINT32 tpm_size_t;
+
+// helper function for the error codes:
+const char* tpm_get_error_name (TPM_RESULT code);
+
+#endif // _VTPM_LOG_H_
diff --git a/stubdom/vtpmmgr/marshal.h b/stubdom/vtpmmgr/marshal.h
new file mode 100644
index 0000000..77d32f0
--- /dev/null
+++ b/stubdom/vtpmmgr/marshal.h
@@ -0,0 +1,528 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef MARSHAL_H
+#define MARSHAL_H
+
+#include <stdlib.h>
+#include <mini-os/byteorder.h>
+#include <mini-os/endian.h>
+#include "tcg.h"
+
+typedef enum UnpackPtr {
+   UNPACK_ALIAS,
+   UNPACK_ALLOC
+} UnpackPtr;
+
+inline BYTE* pack_BYTE(BYTE* ptr, BYTE t) {
+   ptr[0] = t;
+   return ++ptr;
+}
+
+inline BYTE* unpack_BYTE(BYTE* ptr, BYTE* t) {
+   t[0] = ptr[0];
+   return ++ptr;
+}
+
+#define pack_BOOL(p, t) pack_BYTE(p, t)
+#define unpack_BOOL(p, t) unpack_BYTE(p, t)
+
+inline BYTE* pack_UINT16(BYTE* ptr, UINT16 t) {
+   BYTE* b = (BYTE*)&t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   ptr[0] = b[1];
+   ptr[1] = b[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   ptr[0] = b[0];
+   ptr[1] = b[1];
+#endif
+   return ptr + sizeof(UINT16);
+}
+
+inline BYTE* unpack_UINT16(BYTE* ptr, UINT16* t) {
+   BYTE* b = (BYTE*)t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   b[0] = ptr[1];
+   b[1] = ptr[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   b[0] = ptr[0];
+   b[1] = ptr[1];
+#endif
+   return ptr + sizeof(UINT16);
+}
+
+inline BYTE* pack_UINT32(BYTE* ptr, UINT32 t) {
+   BYTE* b = (BYTE*)&t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   ptr[3] = b[0];
+   ptr[2] = b[1];
+   ptr[1] = b[2];
+   ptr[0] = b[3];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   ptr[0] = b[0];
+   ptr[1] = b[1];
+   ptr[2] = b[2];
+   ptr[3] = b[3];
+#endif
+   return ptr + sizeof(UINT32);
+}
+
+inline BYTE* unpack_UINT32(BYTE* ptr, UINT32* t) {
+   BYTE* b = (BYTE*)t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   b[0] = ptr[3];
+   b[1] = ptr[2];
+   b[2] = ptr[1];
+   b[3] = ptr[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   b[0] = ptr[0];
+   b[1] = ptr[1];
+   b[2] = ptr[2];
+   b[3] = ptr[3];
+#endif
+   return ptr + sizeof(UINT32);
+}
+
+#define pack_TPM_RESULT(p, t) pack_UINT32(p, t)
+#define pack_TPM_PCRINDEX(p, t) pack_UINT32(p, t)
+#define pack_TPM_DIRINDEX(p, t) pack_UINT32(p, t)
+#define pack_TPM_HANDLE(p, t) pack_UINT32(p, t)
+#define pack_TPM_AUTHHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_HASHHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_HMACHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_ENCHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TPM_KEY_HANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_ENTITYHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TPM_RESOURCE_TYPE(p, t) pack_UINT32(p, t)
+#define pack_TPM_COMMAND_CODE(p, t) pack_UINT32(p, t)
+#define pack_TPM_PROTOCOL_ID(p, t) pack_UINT16(p, t)
+#define pack_TPM_AUTH_DATA_USAGE(p, t) pack_BYTE(p, t)
+#define pack_TPM_ENTITY_TYPE(p, t) pack_UINT16(p, t)
+#define pack_TPM_ALGORITHM_ID(p, t) pack_UINT32(p, t)
+#define pack_TPM_KEY_USAGE(p, t) pack_UINT16(p, t)
+#define pack_TPM_STARTUP_TYPE(p, t) pack_UINT16(p, t)
+#define pack_TPM_CAPABILITY_AREA(p, t) pack_UINT32(p, t)
+#define pack_TPM_ENC_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_SIG_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_MIGRATE_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_PHYSICAL_PRESENCE(p, t) pack_UINT16(p, t)
+#define pack_TPM_KEY_FLAGS(p, t) pack_UINT32(p, t)
+
+#define unpack_TPM_RESULT(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_PCRINDEX(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_DIRINDEX(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_HANDLE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_AUTHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_HASHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_HMACHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_ENCHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TPM_KEY_HANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_ENTITYHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TPM_RESOURCE_TYPE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_COMMAND_CODE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_PROTOCOL_ID(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_AUTH_DATA_USAGE(p, t) unpack_BYTE(p, t)
+#define unpack_TPM_ENTITY_TYPE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_ALGORITHM_ID(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_KEY_USAGE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_STARTUP_TYPE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_CAPABILITY_AREA(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_ENC_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_SIG_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_MIGRATE_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_PHYSICAL_PRESENCE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_KEY_FLAGS(p, t) unpack_UINT32(p, t)
+
+#define pack_TPM_AUTH_HANDLE(p, t) pack_UINT32(p, t);
+#define pack_TCS_CONTEXT_HANDLE(p, t) pack_UINT32(p, t);
+#define pack_TCS_KEY_HANDLE(p, t) pack_UINT32(p, t);
+
+#define unpack_TPM_AUTH_HANDLE(p, t) unpack_UINT32(p, t);
+#define unpack_TCS_CONTEXT_HANDLE(p, t) unpack_UINT32(p, t);
+#define unpack_TCS_KEY_HANDLE(p, t) unpack_UINT32(p, t);
+
+inline BYTE* pack_BUFFER(BYTE* ptr, const BYTE* buf, UINT32 size) {
+   memcpy(ptr, buf, size);
+   return ptr + size;
+}
+
+inline BYTE* unpack_BUFFER(BYTE* ptr, BYTE* buf, UINT32 size) {
+   memcpy(buf, ptr, size);
+   return ptr + size;
+}
+
+inline BYTE* unpack_ALIAS(BYTE* ptr, BYTE** buf, UINT32 size) {
+   *buf = ptr;
+   return ptr + size;
+}
+
+inline BYTE* unpack_ALLOC(BYTE* ptr, BYTE** buf, UINT32 size) {
+   if(size) {
+      *buf = malloc(size);
+      memcpy(*buf, ptr, size);
+   } else {
+      *buf = NULL;
+   }
+   return ptr + size;
+}
+
+inline BYTE* unpack_PTR(BYTE* ptr, BYTE** buf, UINT32 size, UnpackPtr alloc) {
+   if(alloc == UNPACK_ALLOC) {
+      return unpack_ALLOC(ptr, buf, size);
+   } else {
+      return unpack_ALIAS(ptr, buf, size);
+   }
+}
+
+inline BYTE* pack_TPM_AUTHDATA(BYTE* ptr, const TPM_AUTHDATA* d) {
+   return pack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_AUTHDATA(BYTE* ptr, TPM_AUTHDATA* d) {
+   return unpack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
+}
+
+#define pack_TPM_SECRET(p, t) pack_TPM_AUTHDATA(p, t)
+#define pack_TPM_ENCAUTH(p, t) pack_TPM_AUTHDATA(p, t)
+#define pack_TPM_PAYLOAD_TYPE(p, t) pack_BYTE(p, t)
+#define pack_TPM_TAG(p, t) pack_UINT16(p, t)
+#define pack_TPM_STRUCTURE_TAG(p, t) pack_UINT16(p, t)
+
+#define unpack_TPM_SECRET(p, t) unpack_TPM_AUTHDATA(p, t)
+#define unpack_TPM_ENCAUTH(p, t) unpack_TPM_AUTHDATA(p, t)
+#define unpack_TPM_PAYLOAD_TYPE(p, t) unpack_BYTE(p, t)
+#define unpack_TPM_TAG(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_STRUCTURE_TAG(p, t) unpack_UINT16(p, t)
+
+inline BYTE* pack_TPM_VERSION(BYTE* ptr, const TPM_VERSION* t) {
+   ptr[0] = t->major;
+   ptr[1] = t->minor;
+   ptr[2] = t->revMajor;
+   ptr[3] = t->revMinor;
+   return ptr + 4;
+}
+
+inline BYTE* unpack_TPM_VERSION(BYTE* ptr, TPM_VERSION* t) {
+   t->major = ptr[0];
+   t->minor = ptr[1];
+   t->revMajor = ptr[2];
+   t->revMinor = ptr[3];
+   return ptr + 4;
+}
+
+inline BYTE* pack_TPM_CAP_VERSION_INFO(BYTE* ptr, const TPM_CAP_VERSION_INFO* v) {
+   ptr = pack_TPM_STRUCTURE_TAG(ptr, v->tag);
+   ptr = pack_TPM_VERSION(ptr, &v->version);
+   ptr = pack_UINT16(ptr, v->specLevel);
+   ptr = pack_BYTE(ptr, v->errataRev);
+   ptr = pack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));
+   ptr = pack_UINT16(ptr, v->vendorSpecificSize);
+   ptr = pack_BUFFER(ptr, v->vendorSpecific, v->vendorSpecificSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_CAP_VERSION_INFO(BYTE* ptr, TPM_CAP_VERSION_INFO* v, UnpackPtr alloc) {
+   ptr = unpack_TPM_STRUCTURE_TAG(ptr, &v->tag);
+   ptr = unpack_TPM_VERSION(ptr, &v->version);
+   ptr = unpack_UINT16(ptr, &v->specLevel);
+   ptr = unpack_BYTE(ptr, &v->errataRev);
+   ptr = unpack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));
+   ptr = unpack_UINT16(ptr, &v->vendorSpecificSize);
+   ptr = unpack_PTR(ptr, &v->vendorSpecific, v->vendorSpecificSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_DIGEST(BYTE* ptr, const TPM_DIGEST* d) {
+   return pack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_DIGEST(BYTE* ptr, TPM_DIGEST* d) {
+   return unpack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
+}
+
+#define pack_TPM_PCRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_PCRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_COMPOSITE_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_COMPOSITE_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_DIRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_DIRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_HMAC(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_HMAC(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_CHOSENID_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_CHOSENID_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+inline BYTE* pack_TPM_NONCE(BYTE* ptr, const TPM_NONCE* n) {
+   return pack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_NONCE(BYTE* ptr, TPM_NONCE* n) {
+   return unpack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* pack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, const TPM_SYMMETRIC_KEY_PARMS* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_UINT32(ptr, k->blockSize);
+   ptr = pack_UINT32(ptr, k->ivSize);
+   return pack_BUFFER(ptr, k->IV, k->ivSize);
+}
+
+inline BYTE* unpack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, TPM_SYMMETRIC_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_UINT32(ptr, &k->blockSize);
+   ptr = unpack_UINT32(ptr, &k->ivSize);
+   return unpack_PTR(ptr, &k->IV, k->ivSize, alloc);
+}
+
+inline BYTE* pack_TPM_RSA_KEY_PARMS(BYTE* ptr, const TPM_RSA_KEY_PARMS* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_UINT32(ptr, k->numPrimes);
+   ptr = pack_UINT32(ptr, k->exponentSize);
+   return pack_BUFFER(ptr, k->exponent, k->exponentSize);
+}
+
+inline BYTE* unpack_TPM_RSA_KEY_PARMS(BYTE* ptr, TPM_RSA_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_UINT32(ptr, &k->numPrimes);
+   ptr = unpack_UINT32(ptr, &k->exponentSize);
+   return unpack_PTR(ptr, &k->exponent, k->exponentSize, alloc);
+}
+
+inline BYTE* pack_TPM_KEY_PARMS(BYTE* ptr, const TPM_KEY_PARMS* k) {
+   ptr = pack_TPM_ALGORITHM_ID(ptr, k->algorithmID);
+   ptr = pack_TPM_ENC_SCHEME(ptr, k->encScheme);
+   ptr = pack_TPM_SIG_SCHEME(ptr, k->sigScheme);
+   ptr = pack_UINT32(ptr, k->parmSize);
+
+   if(k->parmSize) {
+      switch(k->algorithmID) {
+         case TPM_ALG_RSA:
+            return pack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa);
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            return pack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym);
+      }
+   }
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_KEY_PARMS(BYTE* ptr, TPM_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_ALGORITHM_ID(ptr, &k->algorithmID);
+   ptr = unpack_TPM_ENC_SCHEME(ptr, &k->encScheme);
+   ptr = unpack_TPM_SIG_SCHEME(ptr, &k->sigScheme);
+   ptr = unpack_UINT32(ptr, &k->parmSize);
+
+   if(k->parmSize) {
+      switch(k->algorithmID) {
+         case TPM_ALG_RSA:
+            return unpack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa, alloc);
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            return unpack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym, alloc);
+      }
+   }
+   return ptr;
+}
+
+inline BYTE* pack_TPM_STORE_PUBKEY(BYTE* ptr, const TPM_STORE_PUBKEY* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_BUFFER(ptr, k->key, k->keyLength);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_STORE_PUBKEY(BYTE* ptr, TPM_STORE_PUBKEY* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_PTR(ptr, &k->key, k->keyLength, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PUBKEY(BYTE* ptr, const TPM_PUBKEY* k) {
+   ptr = pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
+   return pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
+}
+
+inline BYTE* unpack_TPM_PUBKEY(BYTE* ptr, TPM_PUBKEY* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
+   return unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
+}
+
+inline BYTE* pack_TPM_PCR_SELECTION(BYTE* ptr, const TPM_PCR_SELECTION* p) {
+   ptr = pack_UINT16(ptr, p->sizeOfSelect);
+   ptr = pack_BUFFER(ptr, p->pcrSelect, p->sizeOfSelect);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_SELECTION(BYTE* ptr, TPM_PCR_SELECTION* p, UnpackPtr alloc) {
+   ptr = unpack_UINT16(ptr, &p->sizeOfSelect);
+   ptr = unpack_PTR(ptr, &p->pcrSelect, p->sizeOfSelect, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PCR_INFO(BYTE* ptr, const TPM_PCR_INFO* p) {
+   ptr = pack_TPM_PCR_SELECTION(ptr, &p->pcrSelection);
+   ptr = pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
+   ptr = pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_INFO(BYTE* ptr, TPM_PCR_INFO* p, UnpackPtr alloc) {
+   ptr = unpack_TPM_PCR_SELECTION(ptr, &p->pcrSelection, alloc);
+   ptr = unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
+   ptr = unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PCR_COMPOSITE(BYTE* ptr, const TPM_PCR_COMPOSITE* p) {
+   ptr = pack_TPM_PCR_SELECTION(ptr, &p->select);
+   ptr = pack_UINT32(ptr, p->valueSize);
+   ptr = pack_BUFFER(ptr, (const BYTE*)p->pcrValue, p->valueSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_COMPOSITE(BYTE* ptr, TPM_PCR_COMPOSITE* p, UnpackPtr alloc) {
+   ptr = unpack_TPM_PCR_SELECTION(ptr, &p->select, alloc);
+   ptr = unpack_UINT32(ptr, &p->valueSize);
+   ptr = unpack_PTR(ptr, (BYTE**)&p->pcrValue, p->valueSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_KEY(BYTE* ptr, const TPM_KEY* k) {
+   ptr = pack_TPM_VERSION(ptr, &k->ver);
+   ptr = pack_TPM_KEY_USAGE(ptr, k->keyUsage);
+   ptr = pack_TPM_KEY_FLAGS(ptr, k->keyFlags);
+   ptr = pack_TPM_AUTH_DATA_USAGE(ptr, k->authDataUsage);
+   ptr = pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
+   ptr = pack_UINT32(ptr, k->PCRInfoSize);
+   if(k->PCRInfoSize) {
+      ptr = pack_TPM_PCR_INFO(ptr, &k->PCRInfo);
+   }
+   ptr = pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
+   ptr = pack_UINT32(ptr, k->encDataSize);
+   return pack_BUFFER(ptr, k->encData, k->encDataSize);
+}
+
+inline BYTE* unpack_TPM_KEY(BYTE* ptr, TPM_KEY* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &k->ver);
+   ptr = unpack_TPM_KEY_USAGE(ptr, &k->keyUsage);
+   ptr = unpack_TPM_KEY_FLAGS(ptr, &k->keyFlags);
+   ptr = unpack_TPM_AUTH_DATA_USAGE(ptr, &k->authDataUsage);
+   ptr = unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
+   ptr = unpack_UINT32(ptr, &k->PCRInfoSize);
+   if(k->PCRInfoSize) {
+      ptr = unpack_TPM_PCR_INFO(ptr, &k->PCRInfo, alloc);
+   }
+   ptr = unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
+   ptr = unpack_UINT32(ptr, &k->encDataSize);
+   return unpack_PTR(ptr, &k->encData, k->encDataSize, alloc);
+}
+
+inline BYTE* pack_TPM_BOUND_DATA(BYTE* ptr, const TPM_BOUND_DATA* b, UINT32 payloadSize) {
+   ptr = pack_TPM_VERSION(ptr, &b->ver);
+   ptr = pack_TPM_PAYLOAD_TYPE(ptr, b->payload);
+   return pack_BUFFER(ptr, b->payloadData, payloadSize);
+}
+
+inline BYTE* unpack_TPM_BOUND_DATA(BYTE* ptr, TPM_BOUND_DATA* b, UINT32 payloadSize, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &b->ver);
+   ptr = unpack_TPM_PAYLOAD_TYPE(ptr, &b->payload);
+   return unpack_PTR(ptr, &b->payloadData, payloadSize, alloc);
+}
+
+inline BYTE* pack_TPM_STORED_DATA(BYTE* ptr, const TPM_STORED_DATA* d) {
+   ptr = pack_TPM_VERSION(ptr, &d->ver);
+   ptr = pack_UINT32(ptr, d->sealInfoSize);
+   if(d->sealInfoSize) {
+      ptr = pack_TPM_PCR_INFO(ptr, &d->sealInfo);
+   }
+   ptr = pack_UINT32(ptr, d->encDataSize);
+   ptr = pack_BUFFER(ptr, d->encData, d->encDataSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_STORED_DATA(BYTE* ptr, TPM_STORED_DATA* d, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &d->ver);
+   ptr = unpack_UINT32(ptr, &d->sealInfoSize);
+   if(d->sealInfoSize) {
+      ptr = unpack_TPM_PCR_INFO(ptr, &d->sealInfo, alloc);
+   }
+   ptr = unpack_UINT32(ptr, &d->encDataSize);
+   ptr = unpack_PTR(ptr, &d->encData, d->encDataSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_AUTH_SESSION(BYTE* ptr, const TPM_AUTH_SESSION* auth) {
+   ptr = pack_TPM_AUTH_HANDLE(ptr, auth->AuthHandle);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+   ptr = pack_TPM_AUTHDATA(ptr, &auth->HMAC);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_AUTH_SESSION(BYTE* ptr, TPM_AUTH_SESSION* auth) {
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = unpack_BOOL(ptr, &auth->fContinueAuthSession);
+   ptr = unpack_TPM_AUTHDATA(ptr, &auth->HMAC);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_RQU_HEADER(BYTE* ptr,
+      TPM_TAG tag,
+      UINT32 size,
+      TPM_COMMAND_CODE ord) {
+   ptr = pack_UINT16(ptr, tag);
+   ptr = pack_UINT32(ptr, size);
+   return pack_UINT32(ptr, ord);
+}
+
+inline BYTE* unpack_TPM_RQU_HEADER(BYTE* ptr,
+      TPM_TAG* tag,
+      UINT32* size,
+      TPM_COMMAND_CODE* ord) {
+   ptr = unpack_UINT16(ptr, tag);
+   ptr = unpack_UINT32(ptr, size);
+   ptr = unpack_UINT32(ptr, ord);
+   return ptr;
+}
+
+#define pack_TPM_RSP_HEADER(p, t, s, r) pack_TPM_RQU_HEADER(p, t, s, r);
+#define unpack_TPM_RSP_HEADER(p, t, s, r) unpack_TPM_RQU_HEADER(p, t, s, r);
+
+#endif
diff --git a/stubdom/vtpmmgr/minios.cfg b/stubdom/vtpmmgr/minios.cfg
new file mode 100644
index 0000000..3fb383d
--- /dev/null
+++ b/stubdom/vtpmmgr/minios.cfg
@@ -0,0 +1,14 @@
+CONFIG_TPMFRONT=y
+CONFIG_TPM_TIS=y
+CONFIG_TPMBACK=y
+CONFIG_START_NETWORK=n
+CONFIG_TEST=n
+CONFIG_PCIFRONT=n
+CONFIG_BLKFRONT=y
+CONFIG_NETFRONT=n
+CONFIG_FBFRONT=n
+CONFIG_KBDFRONT=n
+CONFIG_CONSFRONT=n
+CONFIG_XENBUS=y
+CONFIG_LWIP=n
+CONFIG_XC=n
diff --git a/stubdom/vtpmmgr/tcg.h b/stubdom/vtpmmgr/tcg.h
new file mode 100644
index 0000000..7687eae
--- /dev/null
+++ b/stubdom/vtpmmgr/tcg.h
@@ -0,0 +1,707 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005 Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __TCG_H__
+#define __TCG_H__
+
+#include <stdlib.h>
+#include <stdint.h>
+
+// **************************** CONSTANTS *********************************
+
+// BOOL values
+#define TRUE 0x01
+#define FALSE 0x00
+
+#define TCPA_MAX_BUFFER_LENGTH 0x2000
+
+//
+// TPM_COMMAND_CODE values
+#define TPM_PROTECTED_ORDINAL 0x00000000UL
+#define TPM_UNPROTECTED_ORDINAL 0x80000000UL
+#define TPM_CONNECTION_ORDINAL 0x40000000UL
+#define TPM_VENDOR_ORDINAL 0x20000000UL
+
+#define TPM_ORD_OIAP                     (10UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OSAP                     (11UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuth               (12UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_TakeOwnership            (13UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthAsymStart      (14UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthAsymFinish     (15UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthOwner          (16UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Extend                   (20UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PcrRead                  (21UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Quote                    (22UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Seal                     (23UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Unseal                   (24UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DirWriteAuth             (25UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DirRead                  (26UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_UnBind                   (30UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateWrapKey            (31UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadKey                  (32UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetPubKey                (33UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_EvictKey                 (34UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateMigrationBlob      (40UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReWrapKey                (41UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ConvertMigrationBlob     (42UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_AuthorizeMigrationKey    (43UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateMaintenanceArchive (44UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadMaintenanceArchive   (45UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_KillMaintenanceFeature   (46UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadManuMaintPub         (47UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadManuMaintPub         (48UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CertifyKey               (50UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Sign                     (60UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetRandom                (70UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_StirRandom               (71UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SelfTestFull             (80UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SelfTestStartup          (81UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CertifySelfTest          (82UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ContinueSelfTest         (83UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetTestResult            (84UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Reset                    (90UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerClear               (91UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisableOwnerClear        (92UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ForceClear               (93UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisableForceClear        (94UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapabilitySigned      (100UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapability            (101UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapabilityOwner       (102UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerSetDisable          (110UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalEnable           (111UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalDisable          (112UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetOwnerInstall          (113UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalSetDeactivated   (114UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetTempDeactivated       (115UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateEndorsementKeyPair (120UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_MakeIdentity             (121UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ActivateIdentity         (122UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadPubek                (124UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerReadPubek           (125UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisablePubekRead         (126UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetAuditEvent            (130UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetAuditEventSigned      (131UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetOrdinalAuditStatus    (140UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetOrdinalAuditStatus    (141UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Terminate_Handle         (150UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Init                     (151UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveState                (152UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Startup                  (153UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetRedirection           (154UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Start                (160UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Update               (161UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Complete             (162UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1CompleteExtend       (163UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_FieldUpgrade             (170UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveKeyContext           (180UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadKeyContext           (181UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveAuthContext          (182UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadAuthContext          (183UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveContext                      (184UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadContext                      (185UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_FlushSpecific                    (186UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PCR_Reset                        (200UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_DefineSpace                   (204UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_WriteValue                    (205UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_WriteValueAuth                (206UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_ReadValue                     (207UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_ReadValueAuth                 (208UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_UpdateVerification      (209UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_Manage                  (210UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_CreateKeyDelegation     (212UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_CreateOwnerDelegation   (213UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_VerifyDelegation        (214UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_LoadOwnerDelegation     (216UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_ReadAuth                (217UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_ReadTable               (219UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateCounter                    (220UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_IncrementCounter                 (221UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadCounter                      (222UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseCounter                   (223UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseCounterOwner              (224UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_EstablishTransport               (230UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ExecuteTransport                 (231UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseTransportSigned           (232UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetTicks                         (241UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_TickStampBlob                    (242UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_MAX                              (256UL + TPM_PROTECTED_ORDINAL)
+
+#define TSC_ORD_PhysicalPresence         (10UL + TPM_CONNECTION_ORDINAL)
+
+
+
+//
+// TPM_RESULT values
+//
+// just put in the whole table from spec 1.2
+
+#define TPM_BASE   0x0 // The start of TPM return codes
+#define TPM_VENDOR_ERROR 0x00000400 // Mask to indicate that the error code is vendor specific for vendor specific commands
+#define TPM_NON_FATAL  0x00000800 // Mask to indicate that the error code is a non-fatal failure.
+
+#define TPM_SUCCESS   TPM_BASE // Successful completion of the operation
+#define TPM_AUTHFAIL      TPM_BASE + 1 // Authentication failed
+#define TPM_BADINDEX      TPM_BASE + 2 // The index to a PCR, DIR or other register is incorrect
+#define TPM_BAD_PARAMETER     TPM_BASE + 3 // One or more parameter is bad
+#define TPM_AUDITFAILURE     TPM_BASE + 4 // An operation completed successfully but the auditing of that operation failed.
+#define TPM_CLEAR_DISABLED     TPM_BASE + 5 // The clear disable flag is set and all clear operations now require physical access
+#define TPM_DEACTIVATED     TPM_BASE + 6 // The TPM is deactivated
+#define TPM_DISABLED      TPM_BASE + 7 // The TPM is disabled
+#define TPM_DISABLED_CMD     TPM_BASE + 8 // The target command has been disabled
+#define TPM_FAIL       TPM_BASE + 9 // The operation failed
+#define TPM_BAD_ORDINAL     TPM_BASE + 10 // The ordinal was unknown or inconsistent
+#define TPM_INSTALL_DISABLED   TPM_BASE + 11 // The ability to install an owner is disabled
+#define TPM_INVALID_KEYHANDLE  TPM_BASE + 12 // The key handle presented was invalid
+#define TPM_KEYNOTFOUND     TPM_BASE + 13 // The target key was not found
+#define TPM_INAPPROPRIATE_ENC  TPM_BASE + 14 // Unacceptable encryption scheme
+#define TPM_MIGRATEFAIL     TPM_BASE + 15 // Migration authorization failed
+#define TPM_INVALID_PCR_INFO   TPM_BASE + 16 // PCR information could not be interpreted
+#define TPM_NOSPACE      TPM_BASE + 17 // No room to load key.
+#define TPM_NOSRK       TPM_BASE + 18 // There is no SRK set
+#define TPM_NOTSEALED_BLOB     TPM_BASE + 19 // An encrypted blob is invalid or was not created by this TPM
+#define TPM_OWNER_SET      TPM_BASE + 20 // There is already an Owner
+#define TPM_RESOURCES      TPM_BASE + 21 // The TPM has insufficient internal resources to perform the requested action.
+#define TPM_SHORTRANDOM     TPM_BASE + 22 // A random string was too short
+#define TPM_SIZE       TPM_BASE + 23 // The TPM does not have the space to perform the operation.
+#define TPM_WRONGPCRVAL     TPM_BASE + 24 // The named PCR value does not match the current PCR value.
+#define TPM_BAD_PARAM_SIZE     TPM_BASE + 25 // The paramSize argument to the command has the incorrect value
+#define TPM_SHA_THREAD      TPM_BASE + 26 // There is no existing SHA-1 thread.
+#define TPM_SHA_ERROR      TPM_BASE + 27 // The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error.
+#define TPM_FAILEDSELFTEST     TPM_BASE + 28 // Self-test has failed and the TPM has shutdown.
+#define TPM_AUTH2FAIL      TPM_BASE + 29 // The authorization for the second key in a 2 key function failed authorization
+#define TPM_BADTAG       TPM_BASE + 30 // The tag value sent to for a command is invalid
+#define TPM_IOERROR      TPM_BASE + 31 // An IO error occurred transmitting information to the TPM
+#define TPM_ENCRYPT_ERROR     TPM_BASE + 32 // The encryption process had a problem.
+#define TPM_DECRYPT_ERROR     TPM_BASE + 33 // The decryption process did not complete.
+#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 // An invalid handle was used.
+#define TPM_NO_ENDORSEMENT     TPM_BASE + 35 // The TPM does not a EK installed
+#define TPM_INVALID_KEYUSAGE   TPM_BASE + 36 // The usage of a key is not allowed
+#define TPM_WRONG_ENTITYTYPE   TPM_BASE + 37 // The submitted entity type is not allowed
+#define TPM_INVALID_POSTINIT   TPM_BASE + 38 // The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup
+#define TPM_INAPPROPRIATE_SIG  TPM_BASE + 39 // Signed data cannot include additional DER information
+#define TPM_BAD_KEY_PROPERTY   TPM_BASE + 40 // The key properties in TPM_KEY_PARMs are not supported by this TPM
+
+#define TPM_BAD_MIGRATION      TPM_BASE + 41 // The migration properties of this key are incorrect.
+#define TPM_BAD_SCHEME       TPM_BASE + 42 // The signature or encryption scheme for this key is incorrect or not permitted in this situation.
+#define TPM_BAD_DATASIZE      TPM_BASE + 43 // The size of the data (or blob) parameter is bad or inconsistent with the referenced key
+#define TPM_BAD_MODE       TPM_BASE + 44 // A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob.
+#define TPM_BAD_PRESENCE      TPM_BASE + 45 // Either the physicalPresence or physicalPresenceLock bits have the wrong value
+#define TPM_BAD_VERSION      TPM_BASE + 46 // The TPM cannot perform this version of the capability
+#define TPM_NO_WRAP_TRANSPORT     TPM_BASE + 47 // The TPM does not allow for wrapped transport sessions
+#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 // TPM audit construction failed and the underlying command was returning a failure code also
+#define TPM_AUDITFAIL_SUCCESSFUL   TPM_BASE + 49 // TPM audit construction failed and the underlying command was returning success
+#define TPM_NOTRESETABLE      TPM_BASE + 50 // Attempt to reset a PCR register that does not have the resettable attribute
+#define TPM_NOTLOCAL       TPM_BASE + 51 // Attempt to reset a PCR register that requires locality and locality modifier not part of command transport
+#define TPM_BAD_TYPE       TPM_BASE + 52 // Make identity blob not properly typed
+#define TPM_INVALID_RESOURCE     TPM_BASE + 53 // When saving context identified resource type does not match actual resource
+#define TPM_NOTFIPS       TPM_BASE + 54 // The TPM is attempting to execute a command only available when in FIPS mode
+#define TPM_INVALID_FAMILY      TPM_BASE + 55 // The command is attempting to use an invalid family ID
+#define TPM_NO_NV_PERMISSION     TPM_BASE + 56 // The permission to manipulate the NV storage is not available
+#define TPM_REQUIRES_SIGN      TPM_BASE + 57 // The operation requires a signed command
+#define TPM_KEY_NOTSUPPORTED     TPM_BASE + 58 // Wrong operation to load an NV key
+#define TPM_AUTH_CONFLICT      TPM_BASE + 59 // NV_LoadKey blob requires both owner and blob authorization
+#define TPM_AREA_LOCKED      TPM_BASE + 60 // The NV area is locked and not writtable
+#define TPM_BAD_LOCALITY      TPM_BASE + 61 // The locality is incorrect for the attempted operation
+#define TPM_READ_ONLY       TPM_BASE + 62 // The NV area is read only and can't be written to
+#define TPM_PER_NOWRITE      TPM_BASE + 63 // There is no protection on the write to the NV area
+#define TPM_FAMILYCOUNT      TPM_BASE + 64 // The family count value does not match
+#define TPM_WRITE_LOCKED      TPM_BASE + 65 // The NV area has already been written to
+#define TPM_BAD_ATTRIBUTES      TPM_BASE + 66 // The NV area attributes conflict
+#define TPM_INVALID_STRUCTURE     TPM_BASE + 67 // The structure tag and version are invalid or inconsistent
+#define TPM_KEY_OWNER_CONTROL     TPM_BASE + 68 // The key is under control of the TPM Owner and can only be evicted by the TPM Owner.
+#define TPM_BAD_COUNTER      TPM_BASE + 69 // The counter handle is incorrect
+#define TPM_NOT_FULLWRITE      TPM_BASE + 70 // The write is not a complete write of the area
+#define TPM_CONTEXT_GAP      TPM_BASE + 71 // The gap between saved context counts is too large
+#define TPM_MAXNVWRITES      TPM_BASE + 72 // The maximum number of NV writes without an owner has been exceeded
+#define TPM_NOOPERATOR       TPM_BASE + 73 // No operator authorization value is set
+#define TPM_RESOURCEMISSING     TPM_BASE + 74 // The resource pointed to by context is not loaded
+#define TPM_DELEGATE_LOCK      TPM_BASE + 75 // The delegate administration is locked
+#define TPM_DELEGATE_FAMILY     TPM_BASE + 76 // Attempt to manage a family other then the delegated family
+#define TPM_DELEGATE_ADMIN      TPM_BASE + 77 // Delegation table management not enabled
+#define TPM_TRANSPORT_EXCLUSIVE    TPM_BASE + 78 // There was a command executed outside of an exclusive transport session
+
+// TPM_STARTUP_TYPE values
+#define TPM_ST_CLEAR 0x0001
+#define TPM_ST_STATE 0x0002
+#define TPM_ST_DEACTIVATED 0x003
+
+// TPM_TAG values
+#define TPM_TAG_RQU_COMMAND 0x00c1
+#define TPM_TAG_RQU_AUTH1_COMMAND 0x00c2
+#define TPM_TAG_RQU_AUTH2_COMMAND 0x00c3
+#define TPM_TAG_RSP_COMMAND 0x00c4
+#define TPM_TAG_RSP_AUTH1_COMMAND 0x00c5
+#define TPM_TAG_RSP_AUTH2_COMMAND 0x00c6
+
+// TPM_PAYLOAD_TYPE values
+#define TPM_PT_ASYM 0x01
+#define TPM_PT_BIND 0x02
+#define TPM_PT_MIGRATE 0x03
+#define TPM_PT_MAINT 0x04
+#define TPM_PT_SEAL 0x05
+
+// TPM_ENTITY_TYPE values
+#define TPM_ET_KEYHANDLE 0x0001
+#define TPM_ET_OWNER 0x0002
+#define TPM_ET_DATA 0x0003
+#define TPM_ET_SRK 0x0004
+#define TPM_ET_KEY 0x0005
+
+/// TPM_ResourceTypes
+#define TPM_RT_KEY      0x00000001
+#define TPM_RT_AUTH     0x00000002
+#define TPM_RT_HASH     0x00000003
+#define TPM_RT_TRANS    0x00000004
+#define TPM_RT_CONTEXT  0x00000005
+#define TPM_RT_COUNTER  0x00000006
+#define TPM_RT_DELEGATE 0x00000007
+#define TPM_RT_DAA_TPM  0x00000008
+#define TPM_RT_DAA_V0   0x00000009
+#define TPM_RT_DAA_V1   0x0000000A
+
+
+
+// TPM_PROTOCOL_ID values
+#define TPM_PID_OIAP 0x0001
+#define TPM_PID_OSAP 0x0002
+#define TPM_PID_ADIP 0x0003
+#define TPM_PID_ADCP 0x0004
+#define TPM_PID_OWNER 0x0005
+
+// TPM_ALGORITHM_ID values
+#define TPM_ALG_RSA 0x00000001
+#define TPM_ALG_SHA 0x00000004
+#define TPM_ALG_HMAC 0x00000005
+#define TPM_ALG_AES128 0x00000006
+#define TPM_ALG_MFG1 0x00000007
+#define TPM_ALG_AES192 0x00000008
+#define TPM_ALG_AES256 0x00000009
+#define TPM_ALG_XOR 0x0000000A
+
+// TPM_ENC_SCHEME values
+#define TPM_ES_NONE 0x0001
+#define TPM_ES_RSAESPKCSv15 0x0002
+#define TPM_ES_RSAESOAEP_SHA1_MGF1 0x0003
+
+// TPM_SIG_SCHEME values
+#define TPM_SS_NONE 0x0001
+#define TPM_SS_RSASSAPKCS1v15_SHA1 0x0002
+#define TPM_SS_RSASSAPKCS1v15_DER 0x0003
+
+/*
+ * TPM_CAPABILITY_AREA Values for TPM_GetCapability ([TPM_Part2], Section 21.1)
+ */
+#define TPM_CAP_ORD                     0x00000001
+#define TPM_CAP_ALG                     0x00000002
+#define TPM_CAP_PID                     0x00000003
+#define TPM_CAP_FLAG                    0x00000004
+#define TPM_CAP_PROPERTY                0x00000005
+#define TPM_CAP_VERSION                 0x00000006
+#define TPM_CAP_KEY_HANDLE              0x00000007
+#define TPM_CAP_CHECK_LOADED            0x00000008
+#define TPM_CAP_SYM_MODE                0x00000009
+#define TPM_CAP_KEY_STATUS              0x0000000C
+#define TPM_CAP_NV_LIST                 0x0000000D
+#define TPM_CAP_MFR                     0x00000010
+#define TPM_CAP_NV_INDEX                0x00000011
+#define TPM_CAP_TRANS_ALG               0x00000012
+#define TPM_CAP_HANDLE                  0x00000014
+#define TPM_CAP_TRANS_ES                0x00000015
+#define TPM_CAP_AUTH_ENCRYPT            0x00000017
+#define TPM_CAP_SELECT_SIZE             0x00000018
+#define TPM_CAP_DA_LOGIC                0x00000019
+#define TPM_CAP_VERSION_VAL             0x0000001A
+
+/* subCap definitions ([TPM_Part2], Section 21.2) */
+#define TPM_CAP_PROP_PCR                0x00000101
+#define TPM_CAP_PROP_DIR                0x00000102
+#define TPM_CAP_PROP_MANUFACTURER       0x00000103
+#define TPM_CAP_PROP_KEYS               0x00000104
+#define TPM_CAP_PROP_MIN_COUNTER        0x00000107
+#define TPM_CAP_FLAG_PERMANENT          0x00000108
+#define TPM_CAP_FLAG_VOLATILE           0x00000109
+#define TPM_CAP_PROP_AUTHSESS           0x0000010A
+#define TPM_CAP_PROP_TRANSESS           0x0000010B
+#define TPM_CAP_PROP_COUNTERS           0x0000010C
+#define TPM_CAP_PROP_MAX_AUTHSESS       0x0000010D
+#define TPM_CAP_PROP_MAX_TRANSESS       0x0000010E
+#define TPM_CAP_PROP_MAX_COUNTERS       0x0000010F
+#define TPM_CAP_PROP_MAX_KEYS           0x00000110
+#define TPM_CAP_PROP_OWNER              0x00000111
+#define TPM_CAP_PROP_CONTEXT            0x00000112
+#define TPM_CAP_PROP_MAX_CONTEXT        0x00000113
+#define TPM_CAP_PROP_FAMILYROWS         0x00000114
+#define TPM_CAP_PROP_TIS_TIMEOUT        0x00000115
+#define TPM_CAP_PROP_STARTUP_EFFECT     0x00000116
+#define TPM_CAP_PROP_DELEGATE_ROW       0x00000117
+#define TPM_CAP_PROP_MAX_DAASESS        0x00000119
+#define TPM_CAP_PROP_DAASESS            0x0000011A
+#define TPM_CAP_PROP_CONTEXT_DIST       0x0000011B
+#define TPM_CAP_PROP_DAA_INTERRUPT      0x0000011C
+#define TPM_CAP_PROP_SESSIONS           0x0000011D
+#define TPM_CAP_PROP_MAX_SESSIONS       0x0000011E
+#define TPM_CAP_PROP_CMK_RESTRICTION    0x0000011F
+#define TPM_CAP_PROP_DURATION           0x00000120
+#define TPM_CAP_PROP_ACTIVE_COUNTER     0x00000122
+#define TPM_CAP_PROP_MAX_NV_AVAILABLE   0x00000123
+#define TPM_CAP_PROP_INPUT_BUFFER       0x00000124
+
+// TPM_KEY_USAGE values
+#define TPM_KEY_EK 0x0000
+#define TPM_KEY_SIGNING 0x0010
+#define TPM_KEY_STORAGE 0x0011
+#define TPM_KEY_IDENTITY 0x0012
+#define TPM_KEY_AUTHCHANGE 0X0013
+#define TPM_KEY_BIND 0x0014
+#define TPM_KEY_LEGACY 0x0015
+
+// TPM_AUTH_DATA_USAGE values
+#define TPM_AUTH_NEVER 0x00
+#define TPM_AUTH_ALWAYS 0x01
+
+// Key Handle of owner and srk
+#define TPM_OWNER_KEYHANDLE 0x40000001
+#define TPM_SRK_KEYHANDLE 0x40000000
+
+
+
+// *************************** TYPEDEFS *********************************
+typedef unsigned char BYTE;
+typedef unsigned char BOOL;
+typedef uint16_t UINT16;
+typedef uint32_t UINT32;
+typedef uint64_t UINT64;
+
+typedef UINT32 TPM_RESULT;
+typedef UINT32 TPM_PCRINDEX;
+typedef UINT32 TPM_DIRINDEX;
+typedef UINT32 TPM_HANDLE;
+typedef TPM_HANDLE TPM_AUTHHANDLE;
+typedef TPM_HANDLE TCPA_HASHHANDLE;
+typedef TPM_HANDLE TCPA_HMACHANDLE;
+typedef TPM_HANDLE TCPA_ENCHANDLE;
+typedef TPM_HANDLE TPM_KEY_HANDLE;
+typedef TPM_HANDLE TCPA_ENTITYHANDLE;
+typedef UINT32 TPM_RESOURCE_TYPE;
+typedef UINT32 TPM_COMMAND_CODE;
+typedef UINT16 TPM_PROTOCOL_ID;
+typedef BYTE TPM_AUTH_DATA_USAGE;
+typedef UINT16 TPM_ENTITY_TYPE;
+typedef UINT32 TPM_ALGORITHM_ID;
+typedef UINT16 TPM_KEY_USAGE;
+typedef UINT16 TPM_STARTUP_TYPE;
+typedef UINT32 TPM_CAPABILITY_AREA;
+typedef UINT16 TPM_ENC_SCHEME;
+typedef UINT16 TPM_SIG_SCHEME;
+typedef UINT16 TPM_MIGRATE_SCHEME;
+typedef UINT16 TPM_PHYSICAL_PRESENCE;
+typedef UINT32 TPM_KEY_FLAGS;
+
+#define TPM_DIGEST_SIZE 20  // Don't change this
+typedef BYTE TPM_AUTHDATA[TPM_DIGEST_SIZE];
+typedef TPM_AUTHDATA TPM_SECRET;
+typedef TPM_AUTHDATA TPM_ENCAUTH;
+typedef BYTE TPM_PAYLOAD_TYPE;
+typedef UINT16 TPM_TAG;
+typedef UINT16 TPM_STRUCTURE_TAG;
+
+// Data Types of the TCS
+typedef UINT32 TCS_AUTHHANDLE;  // Handle addressing a authorization session
+typedef UINT32 TCS_CONTEXT_HANDLE; // Basic context handle
+typedef UINT32 TCS_KEY_HANDLE;  // Basic key handle
+
+// ************************* STRUCTURES **********************************
+
+typedef struct TPM_VERSION {
+  BYTE major;
+  BYTE minor;
+  BYTE revMajor;
+  BYTE revMinor;
+} TPM_VERSION;
+
+static const TPM_VERSION TPM_STRUCT_VER_1_1 = { 1,1,0,0 };
+
+typedef struct TPM_CAP_VERSION_INFO {
+   TPM_STRUCTURE_TAG tag;
+   TPM_VERSION version;
+   UINT16 specLevel;
+   BYTE errataRev;
+   BYTE tpmVendorID[4];
+   UINT16 vendorSpecificSize;
+   BYTE* vendorSpecific;
+} TPM_CAP_VERSION_INFO;
+
+inline void free_TPM_CAP_VERSION_INFO(TPM_CAP_VERSION_INFO* v) {
+   free(v->vendorSpecific);
+   v->vendorSpecific = NULL;
+}
+
+typedef struct TPM_DIGEST {
+  BYTE digest[TPM_DIGEST_SIZE];
+} TPM_DIGEST;
+
+typedef TPM_DIGEST TPM_PCRVALUE;
+typedef TPM_DIGEST TPM_COMPOSITE_HASH;
+typedef TPM_DIGEST TPM_DIRVALUE;
+typedef TPM_DIGEST TPM_HMAC;
+typedef TPM_DIGEST TPM_CHOSENID_HASH;
+
+typedef struct TPM_NONCE {
+  BYTE nonce[TPM_DIGEST_SIZE];
+} TPM_NONCE;
+
+typedef struct TPM_SYMMETRIC_KEY_PARMS {
+   UINT32 keyLength;
+   UINT32 blockSize;
+   UINT32 ivSize;
+   BYTE* IV;
+} TPM_SYMMETRIC_KEY_PARMS;
+
+inline void free_TPM_SYMMETRIC_KEY_PARMS(TPM_SYMMETRIC_KEY_PARMS* p) {
+   free(p->IV);
+   p->IV = NULL;
+}
+
+#define TPM_SYMMETRIC_KEY_PARMS_INIT { 0, 0, 0, NULL }
+
+typedef struct TPM_RSA_KEY_PARMS {
+  UINT32 keyLength;
+  UINT32 numPrimes;
+  UINT32 exponentSize;
+  BYTE* exponent;
+} TPM_RSA_KEY_PARMS;
+
+#define TPM_RSA_KEY_PARMS_INIT { 0, 0, 0, NULL }
+
+inline void free_TPM_RSA_KEY_PARMS(TPM_RSA_KEY_PARMS* p) {
+   free(p->exponent);
+   p->exponent = NULL;
+}
+
+typedef struct TPM_KEY_PARMS {
+  TPM_ALGORITHM_ID algorithmID;
+  TPM_ENC_SCHEME encScheme;
+  TPM_SIG_SCHEME sigScheme;
+  UINT32 parmSize;
+  union {
+     TPM_SYMMETRIC_KEY_PARMS sym;
+     TPM_RSA_KEY_PARMS rsa;
+  } parms;
+} TPM_KEY_PARMS;
+
+#define TPM_KEY_PARMS_INIT { 0, 0, 0, 0 }
+
+inline void free_TPM_KEY_PARMS(TPM_KEY_PARMS* p) {
+   if(p->parmSize) {
+      switch(p->algorithmID) {
+         case TPM_ALG_RSA:
+            free_TPM_RSA_KEY_PARMS(&p->parms.rsa);
+            break;
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            free_TPM_SYMMETRIC_KEY_PARMS(&p->parms.sym);
+            break;
+      }
+   }
+}
+
+typedef struct TPM_STORE_PUBKEY {
+  UINT32 keyLength;
+  BYTE* key;
+} TPM_STORE_PUBKEY;
+
+#define TPM_STORE_PUBKEY_INIT { 0, NULL }
+
+inline void free_TPM_STORE_PUBKEY(TPM_STORE_PUBKEY* p) {
+   free(p->key);
+   p->key = NULL;
+}
+
+typedef struct TPM_PUBKEY {
+  TPM_KEY_PARMS algorithmParms;
+  TPM_STORE_PUBKEY pubKey;
+} TPM_PUBKEY;
+
+#define TPM_PUBKEY_INIT { TPM_KEY_PARMS_INIT, TPM_STORE_PUBKEY_INIT }
+
+inline void free_TPM_PUBKEY(TPM_PUBKEY* k) {
+   free_TPM_KEY_PARMS(&k->algorithmParms);
+   free_TPM_STORE_PUBKEY(&k->pubKey);
+}
+
+typedef struct TPM_PCR_SELECTION {
+   UINT16 sizeOfSelect;
+   BYTE* pcrSelect;
+} TPM_PCR_SELECTION;
+
+#define TPM_PCR_SELECTION_INIT { 0, NULL }
+
+inline void free_TPM_PCR_SELECTION(TPM_PCR_SELECTION* p) {
+   free(p->pcrSelect);
+   p->pcrSelect = NULL;
+}
+
+typedef struct TPM_PCR_INFO {
+   TPM_PCR_SELECTION pcrSelection;
+   TPM_COMPOSITE_HASH digestAtRelease;
+   TPM_COMPOSITE_HASH digestAtCreation;
+} TPM_PCR_INFO;
+
+#define TPM_PCR_INFO_INIT { TPM_PCR_SELECTION_INIT }
+
+inline void free_TPM_PCR_INFO(TPM_PCR_INFO* p) {
+   free_TPM_PCR_SELECTION(&p->pcrSelection);
+}
+
+typedef struct TPM_PCR_COMPOSITE {
+  TPM_PCR_SELECTION select;
+  UINT32 valueSize;
+  TPM_PCRVALUE* pcrValue;
+} TPM_PCR_COMPOSITE;
+
+#define TPM_PCR_COMPOSITE_INIT { TPM_PCR_SELECTION_INIT, 0, NULL }
+
+inline void free_TPM_PCR_COMPOSITE(TPM_PCR_COMPOSITE* p) {
+   free_TPM_PCR_SELECTION(&p->select);
+   free(p->pcrValue);
+   p->pcrValue = NULL;
+}
+
+typedef struct TPM_KEY {
+  TPM_VERSION         ver;
+  TPM_KEY_USAGE       keyUsage;
+  TPM_KEY_FLAGS       keyFlags;
+  TPM_AUTH_DATA_USAGE authDataUsage;
+  TPM_KEY_PARMS       algorithmParms;
+  UINT32              PCRInfoSize;
+  TPM_PCR_INFO        PCRInfo;
+  TPM_STORE_PUBKEY    pubKey;
+  UINT32              encDataSize;
+  BYTE*               encData;
+} TPM_KEY;
+
+#define TPM_KEY_INIT { .algorithmParms = TPM_KEY_PARMS_INIT,\
+   .PCRInfoSize = 0, .PCRInfo = TPM_PCR_INFO_INIT, \
+   .pubKey = TPM_STORE_PUBKEY_INIT, \
+   .encDataSize = 0, .encData = NULL }
+
+inline void free_TPM_KEY(TPM_KEY* k) {
+   if(k->PCRInfoSize) {
+      free_TPM_PCR_INFO(&k->PCRInfo);
+   }
+   free_TPM_STORE_PUBKEY(&k->pubKey);
+   free(k->encData);
+   k->encData = NULL;
+}
+
+typedef struct TPM_BOUND_DATA {
+  TPM_VERSION ver;
+  TPM_PAYLOAD_TYPE payload;
+  BYTE* payloadData;
+} TPM_BOUND_DATA;
+
+#define TPM_BOUND_DATA_INIT { .payloadData = NULL }
+
+inline void free_TPM_BOUND_DATA(TPM_BOUND_DATA* d) {
+   free(d->payloadData);
+   d->payloadData = NULL;
+}
+
+typedef struct TPM_STORED_DATA {
+  TPM_VERSION ver;
+  UINT32 sealInfoSize;
+  TPM_PCR_INFO sealInfo;
+  UINT32 encDataSize;
+  BYTE* encData;
+} TPM_STORED_DATA;
+
+#define TPM_STORED_DATA_INIT { .sealInfoSize = 0, sealInfo = TPM_PCR_INFO_INIT,\
+   .encDataSize = 0, .encData = NULL }
+
+inline void free_TPM_STORED_DATA(TPM_STORED_DATA* d) {
+   if(d->sealInfoSize) {
+      free_TPM_PCR_INFO(&d->sealInfo);
+   }
+   free(d->encData);
+   d->encData = NULL;
+}
+
+typedef struct TPM_AUTH_SESSION {
+  TPM_AUTHHANDLE  AuthHandle;
+  TPM_NONCE   NonceOdd;   // system
+  TPM_NONCE   NonceEven;   // TPM
+  BOOL   fContinueAuthSession;
+  TPM_AUTHDATA  HMAC;
+} TPM_AUTH_SESSION;
+
+#define TPM_AUTH_SESSION_INIT { .AuthHandle = 0, .fContinueAuthSession = FALSE }
+
+// ---------------------- Functions for checking TPM_RESULTs -----------------
+
+#include <stdio.h>
+
+// FIXME: Review use of these and delete unneeded ones.
+
+// these are really badly dependent on local structure:
+// DEPENDS: local var 'status' of type TPM_RESULT
+// DEPENDS: label 'abort_egress' which cleans up and returns the status
+#define ERRORDIE(s) do { status = s; \
+                         fprintf (stderr, "*** ERRORDIE in %s at %s: %i\n", __func__, __FILE__, __LINE__); \
+                         goto abort_egress; } \
+                    while (0)
+
+// DEPENDS: local var 'status' of type TPM_RESULT
+// DEPENDS: label 'abort_egress' which cleans up and returns the status
+// Try command c. If it fails, set status to s and goto abort.
+#define TPMTRY(s,c) if (c != TPM_SUCCESS) { \
+                       status = s; \
+                       printf("ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
+                       goto abort_egress; \
+                    } else {\
+                       status = c; \
+                    }
+
+// Try command c. If it fails, print error message, set status to actual return code. Goto abort
+#define TPMTRYRETURN(c) do { status = c; \
+                             if (status != TPM_SUCCESS) { \
+                               fprintf(stderr, "ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
+                               goto abort_egress; \
+                             } \
+                        } while(0)
+
+
+#endif //__TCPA_H__
diff --git a/stubdom/vtpmmgr/tpm.c b/stubdom/vtpmmgr/tpm.c
new file mode 100644
index 0000000..123a27c
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm.c
@@ -0,0 +1,938 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <malloc.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <polarssl/sha1.h>
+
+#include "tcg.h"
+#include "tpm.h"
+#include "log.h"
+#include "marshal.h"
+#include "tpmrsa.h"
+#include "vtpmmgr.h"
+
+#define TCPA_MAX_BUFFER_LENGTH 0x2000
+
+#define TPM_BEGIN(TAG, ORD) \
+   const TPM_TAG intag = TAG;\
+TPM_TAG tag = intag;\
+UINT32 paramSize;\
+const TPM_COMMAND_CODE ordinal = ORD;\
+TPM_RESULT status = TPM_SUCCESS;\
+BYTE in_buf[TCPA_MAX_BUFFER_LENGTH];\
+BYTE out_buf[TCPA_MAX_BUFFER_LENGTH];\
+UINT32 out_len = sizeof(out_buf);\
+BYTE* ptr = in_buf;\
+/*Print a log message */\
+vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);\
+/* Pack the header*/\
+ptr = pack_TPM_TAG(ptr, tag);\
+ptr += sizeof(UINT32);\
+ptr = pack_TPM_COMMAND_CODE(ptr, ordinal)\
+
+#define TPM_AUTH_BEGIN() \
+   sha1_context sha1_ctx;\
+BYTE* authbase = ptr - sizeof(TPM_COMMAND_CODE);\
+TPM_DIGEST paramDigest;\
+sha1_starts(&sha1_ctx)
+
+#define TPM_AUTH1_GEN(HMACkey, auth) do {\
+   sha1_finish(&sha1_ctx, paramDigest.digest);\
+   generateAuth(&paramDigest, HMACkey, auth);\
+   ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_AUTH2_GEN(HMACkey, auth) do {\
+   generateAuth(&paramDigest, HMACkey, auth);\
+   ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_TRANSMIT() do {\
+   /* Pack the command size */\
+   paramSize = ptr - in_buf;\
+   pack_UINT32(in_buf + sizeof(TPM_TAG), paramSize);\
+   if((status = TPM_TransmitData(in_buf, paramSize, out_buf, &out_len)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH_VERIFY_BEGIN() do {\
+   UINT32 buf[2] = { cpu_to_be32(status), cpu_to_be32(ordinal) };\
+   sha1_starts(&sha1_ctx);\
+   sha1_update(&sha1_ctx, (unsigned char*)buf, sizeof(buf));\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH1_VERIFY(HMACkey, auth) do {\
+   sha1_finish(&sha1_ctx, paramDigest.digest);\
+   ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+   if((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH2_VERIFY(HMACkey, auth) do {\
+   ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+   if((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+
+
+#define TPM_UNPACK_VERIFY() do { \
+   ptr = out_buf;\
+   ptr = unpack_TPM_RSP_HEADER(ptr, \
+         &(tag), &(paramSize), &(status));\
+   if((status) != TPM_SUCCESS || (tag) != (intag +3)) { \
+      vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s\n", tpm_get_error_name(status));\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH_HASH() do {\
+   sha1_update(&sha1_ctx, authbase, ptr - authbase);\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH_SKIP() do {\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH_ERR_CHECK(auth) do {\
+   if(status != TPM_SUCCESS || auth->fContinueAuthSession == FALSE) {\
+      vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM\n", auth->AuthHandle);\
+      auth->AuthHandle = 0;\
+   }\
+} while(0)
+
+static void xorEncrypt(const TPM_SECRET* sharedSecret,
+      TPM_NONCE* nonce,
+      const TPM_AUTHDATA* inAuth0,
+      TPM_ENCAUTH outAuth0,
+      const TPM_AUTHDATA* inAuth1,
+      TPM_ENCAUTH outAuth1) {
+   BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
+   BYTE XORkey[TPM_DIGEST_SIZE];
+   BYTE* ptr = XORbuffer;
+   ptr = pack_TPM_SECRET(ptr, sharedSecret);
+   ptr = pack_TPM_NONCE(ptr, nonce);
+
+   sha1(XORbuffer, ptr - XORbuffer, XORkey);
+
+   if(inAuth0) {
+      for(int i = 0; i < TPM_DIGEST_SIZE; ++i) {
+         outAuth0[i] = XORkey[i] ^ (*inAuth0)[i];
+      }
+   }
+   if(inAuth1) {
+      for(int i = 0; i < TPM_DIGEST_SIZE; ++i) {
+         outAuth1[i] = XORkey[i] ^ (*inAuth1)[i];
+      }
+   }
+
+}
+
+static void generateAuth(const TPM_DIGEST* paramDigest,
+      const TPM_SECRET* HMACkey,
+      TPM_AUTH_SESSION *auth)
+{
+   //Generate new OddNonce
+   vtpmmgr_rand((BYTE*)auth->NonceOdd.nonce, sizeof(TPM_NONCE));
+
+   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
+   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
+   BYTE* ptr = hmacText;
+
+   ptr = pack_TPM_DIGEST(ptr, paramDigest);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+
+   sha1_hmac((BYTE *) HMACkey, sizeof(TPM_DIGEST),
+         (BYTE *) hmacText, sizeof(hmacText),
+         auth->HMAC);
+}
+
+static TPM_RESULT verifyAuth(const TPM_DIGEST* paramDigest,
+      /*[IN]*/ const TPM_SECRET *HMACkey,
+      /*[IN,OUT]*/ TPM_AUTH_SESSION *auth)
+{
+
+   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
+   TPM_AUTHDATA hm;
+   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
+   BYTE* ptr = hmacText;
+
+   ptr = pack_TPM_DIGEST(ptr, paramDigest);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+
+   sha1_hmac( (BYTE *) HMACkey, sizeof(TPM_DIGEST),
+         (BYTE *) hmacText, sizeof(hmacText),
+         hm);
+
+   // Compare correct HMAC with provided one.
+   if (memcmp(hm, auth->HMAC, sizeof(TPM_DIGEST)) == 0) { // 0 indicates equality
+      return TPM_SUCCESS;
+   } else {
+      vtpmlogerror(VTPM_LOG_TPM, "Auth Session verification failed!\n");
+      return TPM_AUTHFAIL;
+   }
+}
+
+
+
+// ------------------------------------------------------------------
+// Authorization Commands
+// ------------------------------------------------------------------
+
+TPM_RESULT TPM_OIAP(TPM_AUTH_SESSION*   auth)  // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OIAP);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
+   auth->fContinueAuthSession = TRUE;
+
+   ptr = unpack_UINT32(ptr, &auth->AuthHandle);
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OIAP.\n", auth->AuthHandle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_OSAP(TPM_ENTITY_TYPE  entityType,  // in
+      UINT32    entityValue, // in
+      const TPM_AUTHDATA* usageAuth, //in
+      TPM_SECRET *sharedSecret, //out
+      TPM_AUTH_SESSION *auth)
+{
+   BYTE* nonceOddOSAP;
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OSAP);
+
+   ptr = pack_TPM_ENTITY_TYPE(ptr, entityType);
+   ptr = pack_UINT32(ptr, entityValue);
+
+   //nonce Odd OSAP
+   nonceOddOSAP = ptr;
+   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
+   ptr += TPM_DIGEST_SIZE;
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, &auth->AuthHandle);
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+
+   //Calculate session secret
+   sha1_context ctx;
+   sha1_hmac_starts(&ctx, *usageAuth, TPM_DIGEST_SIZE);
+   sha1_hmac_update(&ctx, ptr, TPM_DIGEST_SIZE); //ptr = nonceEvenOSAP
+   sha1_hmac_update(&ctx, nonceOddOSAP, TPM_DIGEST_SIZE);
+   sha1_hmac_finish(&ctx, *sharedSecret);
+
+   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
+   auth->fContinueAuthSession = FALSE;
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OSAP.\n", auth->AuthHandle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_TakeOwnership(
+      const TPM_PUBKEY *pubEK, //in
+      const TPM_AUTHDATA* ownerAuth, //in
+      const TPM_AUTHDATA* srkAuth, //in
+      const TPM_KEY* inSrk, //in
+      TPM_KEY* outSrk, //out, optional
+      TPM_AUTH_SESSION*   auth)   // in, out
+{
+   int keyAlloced = 0;
+   tpmrsa_context ek_rsa = TPMRSA_CTX_INIT;
+
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_TakeOwnership);
+   TPM_AUTH_BEGIN();
+
+   tpmrsa_set_pubkey(&ek_rsa,
+         pubEK->pubKey.key, pubEK->pubKey.keyLength,
+         pubEK->algorithmParms.parms.rsa.exponent,
+         pubEK->algorithmParms.parms.rsa.exponentSize);
+
+   /* Pack the protocol ID */
+   ptr = pack_UINT16(ptr, TPM_PID_OWNER);
+
+   /* Pack the encrypted owner auth */
+   ptr = pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength / 8);
+   tpmrsa_pub_encrypt_oaep(&ek_rsa,
+         ctr_drbg_random, &vtpm_globals.ctr_drbg,
+         sizeof(TPM_SECRET),
+         (BYTE*) ownerAuth,
+         ptr);
+   ptr += pubEK->algorithmParms.parms.rsa.keyLength / 8;
+
+   /* Pack the encrypted srk auth */
+   ptr = pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength / 8);
+   tpmrsa_pub_encrypt_oaep(&ek_rsa,
+         ctr_drbg_random, &vtpm_globals.ctr_drbg,
+         sizeof(TPM_SECRET),
+         (BYTE*) srkAuth,
+         ptr);
+   ptr += pubEK->algorithmParms.parms.rsa.keyLength / 8;
+
+   /* Pack the Srk key */
+   ptr = pack_TPM_KEY(ptr, inSrk);
+
+   /* Hash everything up to here */
+   TPM_AUTH_HASH();
+
+   /* Generate the authorization */
+   TPM_AUTH1_GEN(ownerAuth, auth);
+
+   /* Send the command to the tpm*/
+   TPM_TRANSMIT();
+   /* Unpack and validate the header */
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   if(outSrk != NULL) {
+      /* If the user wants a copy of the srk we give it to them */
+      keyAlloced = 1;
+      ptr = unpack_TPM_KEY(ptr, outSrk, UNPACK_ALLOC);
+   } else {
+      /*otherwise just parse past it */
+      TPM_KEY temp;
+      ptr = unpack_TPM_KEY(ptr, &temp, UNPACK_ALIAS);
+   }
+
+   /* Hash the output key */
+   TPM_AUTH_HASH();
+
+   /* Verify authorizaton */
+   TPM_AUTH1_VERIFY(ownerAuth, auth);
+
+   goto egress;
+abort_egress:
+   if(keyAlloced) {
+      free_TPM_KEY(outSrk);
+   }
+egress:
+   tpmrsa_free(&ek_rsa);
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+
+TPM_RESULT TPM_DisablePubekRead (
+      const TPM_AUTHDATA* ownerAuth,
+      TPM_AUTH_SESSION*   auth)
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_DisablePubekRead);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(ownerAuth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   TPM_AUTH1_VERIFY(ownerAuth, auth);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+
+TPM_RESULT TPM_TerminateHandle(TPM_AUTHHANDLE  handle)  // in
+{
+   if(handle == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Terminate_Handle);
+
+   ptr = pack_TPM_AUTHHANDLE(ptr, handle);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM_TerminateHandle\n", handle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_Extend( TPM_PCRINDEX  pcrNum,  // in
+      TPM_DIGEST  inDigest, // in
+      TPM_PCRVALUE*  outDigest) // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Extend);
+
+   ptr = pack_TPM_PCRINDEX(ptr, pcrNum);
+   ptr = pack_TPM_DIGEST(ptr, &inDigest);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_TPM_PCRVALUE(ptr, outDigest);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_Seal(
+      TPM_KEY_HANDLE  keyHandle,  // in
+      UINT32    pcrInfoSize, // in
+      TPM_PCR_INFO*    pcrInfo,  // in
+      UINT32    inDataSize,  // in
+      const BYTE*    inData,   // in
+      TPM_STORED_DATA* sealedData, //out
+      const TPM_SECRET* osapSharedSecret, //in
+      const TPM_AUTHDATA* sealedDataAuth, //in
+      TPM_AUTH_SESSION*   pubAuth  // in, out
+      )
+{
+   int dataAlloced = 0;
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_Seal);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, keyHandle);
+
+   TPM_AUTH_SKIP();
+
+   xorEncrypt(osapSharedSecret, &pubAuth->NonceEven,
+         sealedDataAuth, ptr,
+         NULL, NULL);
+   ptr += sizeof(TPM_ENCAUTH);
+
+   ptr = pack_UINT32(ptr, pcrInfoSize);
+   ptr = pack_TPM_PCR_INFO(ptr, pcrInfo);
+
+   ptr = pack_UINT32(ptr, inDataSize);
+   ptr = pack_BUFFER(ptr, inData, inDataSize);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(osapSharedSecret, pubAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_TPM_STORED_DATA(ptr, sealedData, UNPACK_ALLOC);
+   dataAlloced = 1;
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(osapSharedSecret, pubAuth);
+
+   goto egress;
+abort_egress:
+   if(dataAlloced) {
+      free_TPM_STORED_DATA(sealedData);
+   }
+egress:
+   TPM_AUTH_ERR_CHECK(pubAuth);
+   return status;
+}
+
+TPM_RESULT TPM_Unseal(
+      TPM_KEY_HANDLE parentHandle, // in
+      const TPM_STORED_DATA* sealedData,
+      UINT32*   outSize,  // out
+      BYTE**    out, //out
+      const TPM_AUTHDATA* key_usage_auth, //in
+      const TPM_AUTHDATA* data_usage_auth, //in
+      TPM_AUTH_SESSION*   keyAuth,  // in, out
+      TPM_AUTH_SESSION*   dataAuth  // in, out
+      )
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH2_COMMAND, TPM_ORD_Unseal);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, parentHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_TPM_STORED_DATA(ptr, sealedData);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(key_usage_auth, keyAuth);
+   TPM_AUTH2_GEN(data_usage_auth, dataAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, outSize);
+   ptr = unpack_ALLOC(ptr, out, *outSize);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(key_usage_auth, keyAuth);
+   TPM_AUTH2_VERIFY(data_usage_auth, dataAuth);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(keyAuth);
+   TPM_AUTH_ERR_CHECK(dataAuth);
+   return status;
+}
+
+TPM_RESULT TPM_Bind(
+      const TPM_KEY* key,
+      const BYTE* in,
+      UINT32 ilen,
+      BYTE* out)
+{
+   TPM_RESULT status;
+   tpmrsa_context rsa = TPMRSA_CTX_INIT;
+   TPM_BOUND_DATA boundData;
+   uint8_t plain[TCPA_MAX_BUFFER_LENGTH];
+   BYTE* ptr = plain;
+
+   vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);
+
+   tpmrsa_set_pubkey(&rsa,
+         key->pubKey.key, key->pubKey.keyLength,
+         key->algorithmParms.parms.rsa.exponent,
+         key->algorithmParms.parms.rsa.exponentSize);
+
+   // Fill boundData's accessory information
+   boundData.ver = TPM_STRUCT_VER_1_1;
+   boundData.payload = TPM_PT_BIND;
+   boundData.payloadData = (BYTE*)in;
+
+   //marshall the bound data object
+   ptr = pack_TPM_BOUND_DATA(ptr, &boundData, ilen);
+
+   // Encrypt the data
+   TPMTRYRETURN(tpmrsa_pub_encrypt_oaep(&rsa,
+            ctr_drbg_random, &vtpm_globals.ctr_drbg,
+            ptr - plain,
+            plain,
+            out));
+
+abort_egress:
+   tpmrsa_free(&rsa);
+   return status;
+
+}
+
+TPM_RESULT TPM_UnBind(
+      TPM_KEY_HANDLE  keyHandle,  // in
+      UINT32 ilen, //in
+      const BYTE* in, //
+      UINT32* olen, //
+      BYTE*    out, //out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth //in, out
+      )
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_UnBind);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, keyHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_UINT32(ptr, ilen);
+   ptr = pack_BUFFER(ptr, in, ilen);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(usage_auth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, olen);
+   if(*olen > ilen) {
+      vtpmlogerror(VTPM_LOG_TPM, "Output length < input length!\n");
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+   ptr = unpack_BUFFER(ptr, out, *olen);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(usage_auth, auth);
+
+abort_egress:
+egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+TPM_RESULT TPM_CreateWrapKey(
+      TPM_KEY_HANDLE  hWrappingKey,  // in
+      const TPM_AUTHDATA* osapSharedSecret,
+      const TPM_AUTHDATA* dataUsageAuth, //in
+      const TPM_AUTHDATA* dataMigrationAuth, //in
+      TPM_KEY*     key, //in, out
+      TPM_AUTH_SESSION*   pAuth)    // in, out
+{
+   int keyAlloced = 0;
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_CreateWrapKey);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, hWrappingKey);
+
+   TPM_AUTH_SKIP();
+
+   //Encrypted auths
+   xorEncrypt(osapSharedSecret, &pAuth->NonceEven,
+         dataUsageAuth, ptr,
+         dataMigrationAuth, ptr + sizeof(TPM_ENCAUTH));
+   ptr += sizeof(TPM_ENCAUTH) * 2;
+
+   ptr = pack_TPM_KEY(ptr, key);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(osapSharedSecret, pAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   keyAlloced = 1;
+   ptr = unpack_TPM_KEY(ptr, key, UNPACK_ALLOC);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(osapSharedSecret, pAuth);
+
+   goto egress;
+abort_egress:
+   if(keyAlloced) {
+      free_TPM_KEY(key);
+   }
+egress:
+   TPM_AUTH_ERR_CHECK(pAuth);
+   return status;
+}
+
+TPM_RESULT TPM_LoadKey(
+      TPM_KEY_HANDLE  parentHandle, //
+      const TPM_KEY* key, //in
+      TPM_HANDLE*  keyHandle,    // out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth)
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_LoadKey);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, parentHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_TPM_KEY(ptr, key);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(usage_auth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, keyHandle);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(usage_auth, auth);
+
+   vtpmloginfo(VTPM_LOG_TPM, "Key Handle: 0x%x opened by TPM_LoadKey\n", *keyHandle);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+TPM_RESULT TPM_EvictKey( TPM_KEY_HANDLE  hKey)  // in
+{
+   if(hKey == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_EvictKey);
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, hKey);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   vtpmloginfo(VTPM_LOG_TPM, "Key handle: 0x%x closed by TPM_EvictKey\n", hKey);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle,
+      TPM_RESOURCE_TYPE rt) {
+   if(handle == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_FlushSpecific);
+
+   ptr = pack_TPM_HANDLE(ptr, handle);
+   ptr = pack_TPM_RESOURCE_TYPE(ptr, rt);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_GetRandom( UINT32*    bytesRequested, // in, out
+      BYTE*    randomBytes) // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetRandom);
+
+   // check input params
+   if (bytesRequested == NULL || randomBytes == NULL){
+      return TPM_BAD_PARAMETER;
+   }
+
+   ptr = pack_UINT32(ptr, *bytesRequested);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, bytesRequested);
+   ptr = unpack_BUFFER(ptr, randomBytes, *bytesRequested);
+
+abort_egress:
+   return status;
+}
+
+
+TPM_RESULT TPM_ReadPubek(
+      TPM_PUBKEY* pubEK //out
+      )
+{
+   BYTE* antiReplay = NULL;
+   BYTE* kptr = NULL;
+   BYTE digest[TPM_DIGEST_SIZE];
+   sha1_context ctx;
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_ReadPubek);
+
+   //antiReplay nonce
+   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
+   antiReplay = ptr;
+   ptr += TPM_DIGEST_SIZE;
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   //unpack and allocate the key
+   kptr = ptr;
+   ptr = unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
+
+   //Verify the checksum
+   sha1_starts(&ctx);
+   sha1_update(&ctx, kptr, ptr - kptr);
+   sha1_update(&ctx, antiReplay, TPM_DIGEST_SIZE);
+   sha1_finish(&ctx, digest);
+
+   //ptr points to the checksum computed by TPM
+   if(memcmp(digest, ptr, TPM_DIGEST_SIZE)) {
+      vtpmlogerror(VTPM_LOG_TPM, "TPM_ReadPubek: Checksum returned by TPM was invalid!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   goto egress;
+abort_egress:
+   if(kptr != NULL) { //If we unpacked the pubEK, we have to free it
+      free_TPM_PUBKEY(pubEK);
+   }
+egress:
+   return status;
+}
+
+
+TPM_RESULT TPM_SaveState(void)
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_SaveState);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_GetCapability(
+      TPM_CAPABILITY_AREA capArea,
+      UINT32 subCapSize,
+      const BYTE* subCap,
+      UINT32* respSize,
+      BYTE** resp)
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetCapability);
+
+   ptr = pack_TPM_CAPABILITY_AREA(ptr, capArea);
+   ptr = pack_UINT32(ptr, subCapSize);
+   ptr = pack_BUFFER(ptr, subCap, subCapSize);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, respSize);
+   ptr = unpack_ALLOC(ptr, resp, *respSize);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_CreateEndorsementKeyPair(
+      const TPM_KEY_PARMS* keyInfo,
+      TPM_PUBKEY* pubEK)
+{
+   BYTE* kptr = NULL;
+   sha1_context ctx;
+   TPM_DIGEST checksum;
+   TPM_DIGEST hash;
+   TPM_NONCE antiReplay;
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_CreateEndorsementKeyPair);
+
+   //Make anti replay nonce
+   vtpmmgr_rand(antiReplay.nonce, sizeof(antiReplay.nonce));
+
+   ptr = pack_TPM_NONCE(ptr, &antiReplay);
+   ptr = pack_TPM_KEY_PARMS(ptr, keyInfo);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   sha1_starts(&ctx);
+
+   kptr = ptr;
+   ptr = unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
+
+   /* Hash the pub key blob */
+   sha1_update(&ctx, kptr, ptr - kptr);
+   ptr = unpack_TPM_DIGEST(ptr, &checksum);
+
+   sha1_update(&ctx, antiReplay.nonce, sizeof(antiReplay.nonce));
+
+   sha1_finish(&ctx, hash.digest);
+   if(memcmp(checksum.digest, hash.digest, TPM_DIGEST_SIZE)) {
+      vtpmloginfo(VTPM_LOG_VTPM, "TPM_CreateEndorsementKey: Checkum verification failed!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   goto egress;
+abort_egress:
+   if(kptr) {
+      free_TPM_PUBKEY(pubEK);
+   }
+egress:
+   return status;
+}
+
+TPM_RESULT TPM_TransmitData(
+      BYTE* in,
+      UINT32 insize,
+      BYTE* out,
+      UINT32* outsize) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   UINT32 i;
+   vtpmloginfo(VTPM_LOG_TXDATA, "Sending buffer = 0x");
+   for(i = 0 ; i < insize ; i++)
+      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", in[i]);
+
+   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
+
+   ssize_t size = 0;
+
+   // send the request
+   size = write (vtpm_globals.tpm_fd, in, insize);
+   if (size < 0) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "write() failed : %s\n", strerror(errno));
+      ERRORDIE (TPM_IOERROR);
+   }
+   else if ((UINT32) size < insize) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "Wrote %d instead of %d bytes!\n", (int) size, insize);
+      ERRORDIE (TPM_IOERROR);
+   }
+
+   // read the response
+   size = read (vtpm_globals.tpm_fd, out, *outsize);
+   if (size < 0) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "read() failed : %s\n", strerror(errno));
+      ERRORDIE (TPM_IOERROR);
+   }
+
+   vtpmloginfo(VTPM_LOG_TXDATA, "Receiving buffer = 0x");
+   for(i = 0 ; i < size ; i++)
+      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out[i]);
+
+   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
+
+   *outsize = size;
+   goto egress;
+
+abort_egress:
+egress:
+   return status;
+}
diff --git a/stubdom/vtpmmgr/tpm.h b/stubdom/vtpmmgr/tpm.h
new file mode 100644
index 0000000..304e145
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm.h
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005/2006, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __TPM_H__
+#define __TPM_H__
+
+#include "tcg.h"
+
+// ------------------------------------------------------------------
+// Exposed API
+// ------------------------------------------------------------------
+
+// TPM v1.1B Command Set
+
+// Authorzation
+TPM_RESULT TPM_OIAP(
+      TPM_AUTH_SESSION*   auth //out
+      );
+
+TPM_RESULT TPM_OSAP (
+      TPM_ENTITY_TYPE entityType,  // in
+      UINT32    entityValue, // in
+      const TPM_AUTHDATA* usageAuth, //in
+      TPM_SECRET *sharedSecret, //out
+      TPM_AUTH_SESSION *auth);
+
+TPM_RESULT TPM_TakeOwnership(
+      const TPM_PUBKEY *pubEK, //in
+      const TPM_AUTHDATA* ownerAuth, //in
+      const TPM_AUTHDATA* srkAuth, //in
+      const TPM_KEY* inSrk, //in
+      TPM_KEY* outSrk, //out, optional
+      TPM_AUTH_SESSION*   auth   // in, out
+      );
+
+TPM_RESULT TPM_DisablePubekRead (
+      const TPM_AUTHDATA* ownerAuth,
+      TPM_AUTH_SESSION*   auth
+      );
+
+TPM_RESULT TPM_TerminateHandle ( TPM_AUTHHANDLE  handle  // in
+      );
+
+TPM_RESULT TPM_FlushSpecific ( TPM_HANDLE  handle,  // in
+      TPM_RESOURCE_TYPE resourceType //in
+      );
+
+// TPM Mandatory
+TPM_RESULT TPM_Extend ( TPM_PCRINDEX  pcrNum,  // in
+      TPM_DIGEST   inDigest, // in
+      TPM_PCRVALUE*   outDigest // out
+      );
+
+TPM_RESULT TPM_PcrRead ( TPM_PCRINDEX  pcrNum,  // in
+      TPM_PCRVALUE*  outDigest // out
+      );
+
+TPM_RESULT TPM_Quote ( TCS_KEY_HANDLE  keyHandle,  // in
+      TPM_NONCE   antiReplay,  // in
+      UINT32*    PcrDataSize, // in, out
+      BYTE**    PcrData,  // in, out
+      TPM_AUTH_SESSION*   privAuth,  // in, out
+      UINT32*    sigSize,  // out
+      BYTE**    sig    // out
+      );
+
+TPM_RESULT TPM_Seal(
+      TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32    pcrInfoSize, // in
+      TPM_PCR_INFO*    pcrInfo,  // in
+      UINT32    inDataSize,  // in
+      const BYTE*    inData,   // in
+      TPM_STORED_DATA* sealedData, //out
+      const TPM_SECRET* osapSharedSecret, //in
+      const TPM_AUTHDATA* sealDataAuth, //in
+      TPM_AUTH_SESSION*   pubAuth  // in, out
+      );
+
+TPM_RESULT TPM_Unseal (
+      TPM_KEY_HANDLE parentHandle, // in
+      const TPM_STORED_DATA* sealedData,
+      UINT32*   outSize,  // out
+      BYTE**    out, //out
+      const TPM_AUTHDATA* key_usage_auth, //in
+      const TPM_AUTHDATA* data_usage_auth, //in
+      TPM_AUTH_SESSION*   keyAuth,  // in, out
+      TPM_AUTH_SESSION*   dataAuth  // in, out
+      );
+
+TPM_RESULT TPM_DirWriteAuth ( TPM_DIRINDEX  dirIndex,  // in
+      TPM_DIRVALUE  newContents, // in
+      TPM_AUTH_SESSION*   ownerAuth  // in, out
+      );
+
+TPM_RESULT TPM_DirRead ( TPM_DIRINDEX  dirIndex, // in
+      TPM_DIRVALUE*  dirValue // out
+      );
+
+TPM_RESULT TPM_Bind(
+      const TPM_KEY* key, //in
+      const BYTE* in, //in
+      UINT32 ilen, //in
+      BYTE* out //out, must be at least cipher block size
+      );
+
+TPM_RESULT TPM_UnBind (
+      TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32 ilen, //in
+      const BYTE* in, //
+      UINT32*   outDataSize, // out
+      BYTE*    outData, //out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth //in, out
+      );
+
+TPM_RESULT TPM_CreateWrapKey (
+      TCS_KEY_HANDLE  hWrappingKey,  // in
+      const TPM_AUTHDATA* osapSharedSecret,
+      const TPM_AUTHDATA* dataUsageAuth, //in
+      const TPM_AUTHDATA* dataMigrationAuth, //in
+      TPM_KEY*     key, //in
+      TPM_AUTH_SESSION*   pAuth    // in, out
+      );
+
+TPM_RESULT TPM_LoadKey (
+      TPM_KEY_HANDLE  parentHandle, //
+      const TPM_KEY* key, //in
+      TPM_HANDLE*  keyHandle,    // out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth
+      );
+
+TPM_RESULT TPM_GetPubKey (  TCS_KEY_HANDLE  hKey,   // in
+      TPM_AUTH_SESSION*   pAuth,   // in, out
+      UINT32*    pcPubKeySize, // out
+      BYTE**    prgbPubKey  // out
+      );
+
+TPM_RESULT TPM_EvictKey ( TCS_KEY_HANDLE  hKey  // in
+      );
+
+TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle, //in
+      TPM_RESOURCE_TYPE rt //in
+      );
+
+TPM_RESULT TPM_Sign ( TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32    areaToSignSize, // in
+      BYTE*    areaToSign,  // in
+      TPM_AUTH_SESSION*   privAuth,  // in, out
+      UINT32*    sigSize,  // out
+      BYTE**    sig    // out
+      );
+
+TPM_RESULT TPM_GetRandom (  UINT32*    bytesRequested, // in, out
+      BYTE*    randomBytes  // out
+      );
+
+TPM_RESULT TPM_StirRandom (  UINT32    inDataSize, // in
+      BYTE*    inData  // in
+      );
+
+TPM_RESULT TPM_ReadPubek (
+      TPM_PUBKEY* pubEK //out
+      );
+
+TPM_RESULT TPM_GetCapability(
+      TPM_CAPABILITY_AREA capArea,
+      UINT32 subCapSize,
+      const BYTE* subCap,
+      UINT32* respSize,
+      BYTE** resp);
+
+TPM_RESULT TPM_SaveState(void);
+
+TPM_RESULT TPM_CreateEndorsementKeyPair(
+      const TPM_KEY_PARMS* keyInfo,
+      TPM_PUBKEY* pubEK);
+
+TPM_RESULT TPM_TransmitData(
+      BYTE* in,
+      UINT32 insize,
+      BYTE* out,
+      UINT32* outsize);
+
+#endif //TPM_H
diff --git a/stubdom/vtpmmgr/tpmrsa.c b/stubdom/vtpmmgr/tpmrsa.c
new file mode 100644
index 0000000..56094e7
--- /dev/null
+++ b/stubdom/vtpmmgr/tpmrsa.c
@@ -0,0 +1,175 @@
+/*
+ *  The RSA public-key cryptosystem
+ *
+ *  Copyright (C) 2006-2011, Brainspark B.V.
+ *
+ *  This file is part of PolarSSL (http://www.polarssl.org)
+ *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
+ *
+ *  All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ *  RSA was designed by Ron Rivest, Adi Shamir and Len Adleman.
+ *
+ *  http://theory.lcs.mit.edu/~rivest/rsapaper.pdf
+ *  http://www.cacr.math.uwaterloo.ca/hac/about/chap8.pdf
+ */
+
+#include "tcg.h"
+#include "polarssl/sha1.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "tpmrsa.h"
+
+#define HASH_LEN 20
+
+void tpmrsa_set_pubkey(tpmrsa_context* ctx,
+      const unsigned char* key,
+      int keylen,
+      const unsigned char* exponent,
+      int explen) {
+
+   tpmrsa_free(ctx);
+
+   if(explen == 0) { //Default e= 2^16+1
+      mpi_lset(&ctx->E, 65537);
+   } else {
+      mpi_read_binary(&ctx->E, exponent, explen);
+   }
+   mpi_read_binary(&ctx->N, key, keylen);
+
+   ctx->len = ( mpi_msb(&ctx->N) + 7) >> 3;
+}
+
+static TPM_RESULT tpmrsa_public( tpmrsa_context *ctx,
+      const unsigned char *input,
+      unsigned char *output )
+{
+   int ret;
+   size_t olen;
+   mpi T;
+
+   mpi_init( &T );
+
+   MPI_CHK( mpi_read_binary( &T, input, ctx->len ) );
+
+   if( mpi_cmp_mpi( &T, &ctx->N ) >= 0 )
+   {
+      mpi_free( &T );
+      return TPM_ENCRYPT_ERROR;
+   }
+
+   olen = ctx->len;
+   MPI_CHK( mpi_exp_mod( &T, &T, &ctx->E, &ctx->N, &ctx->RN ) );
+   MPI_CHK( mpi_write_binary( &T, output, olen ) );
+
+cleanup:
+
+   mpi_free( &T );
+
+   if( ret != 0 )
+      return TPM_ENCRYPT_ERROR;
+
+   return TPM_SUCCESS;
+}
+
+static void mgf_mask( unsigned char *dst, int dlen, unsigned char *src, int slen)
+{
+   unsigned char mask[HASH_LEN];
+   unsigned char counter[4] = {0, 0, 0, 0};
+   int i;
+   sha1_context mctx;
+
+   //We always hash the src with the counter, so save the partial hash
+   sha1_starts(&mctx);
+   sha1_update(&mctx, src, slen);
+
+   // Generate and apply dbMask
+   while(dlen > 0) {
+      //Copy the sha1 context
+      sha1_context ctx = mctx;
+
+      //compute hash for input || counter
+      sha1_update(&ctx, counter, sizeof(counter));
+      sha1_finish(&ctx, mask);
+
+      //Apply the mask
+      for(i = 0; i < (dlen < HASH_LEN ? dlen : HASH_LEN); ++i) {
+         *(dst++) ^= mask[i];
+      }
+
+      //Increment counter
+      ++counter[3];
+
+      dlen -= HASH_LEN;
+   }
+}
+
+/*
+ * Add the message padding, then do an RSA operation
+ */
+TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
+      int (*f_rng)(void *, unsigned char *, size_t),
+      void *p_rng,
+      size_t ilen,
+      const unsigned char *input,
+      unsigned char *output )
+{
+   int ret;
+   int olen;
+   unsigned char* seed = output + 1;
+   unsigned char* db = output + HASH_LEN +1;
+
+   olen = ctx->len-1;
+
+   if( f_rng == NULL )
+      return TPM_ENCRYPT_ERROR;
+
+   if( ilen > olen - 2 * HASH_LEN - 1)
+      return TPM_ENCRYPT_ERROR;
+
+   output[0] = 0;
+
+   //Encoding parameter p
+   sha1((unsigned char*)"TCPA", 4, db);
+
+   //PS
+   memset(db + HASH_LEN, 0,
+         olen - ilen - 2 * HASH_LEN - 1);
+
+   //constant 1 byte
+   db[olen - ilen - HASH_LEN -1] = 0x01;
+
+   //input string
+   memcpy(db + olen - ilen - HASH_LEN,
+         input, ilen);
+
+   //Generate random seed
+   if( ( ret = f_rng( p_rng, seed, HASH_LEN ) ) != 0 )
+      return TPM_ENCRYPT_ERROR;
+
+   // maskedDB: Apply dbMask to DB
+   mgf_mask( db, olen - HASH_LEN, seed, HASH_LEN);
+
+   // maskedSeed: Apply seedMask to seed
+   mgf_mask( seed, HASH_LEN, db, olen - HASH_LEN);
+
+   // Do the crypto op
+   return tpmrsa_public(ctx, output, output);
+}
diff --git a/stubdom/vtpmmgr/tpmrsa.h b/stubdom/vtpmmgr/tpmrsa.h
new file mode 100644
index 0000000..59579e7
--- /dev/null
+++ b/stubdom/vtpmmgr/tpmrsa.h
@@ -0,0 +1,67 @@
+/**
+ * \file rsa.h
+ *
+ * \brief The RSA public-key cryptosystem
+ *
+ *  Copyright (C) 2006-2010, Brainspark B.V.
+ *
+ *  This file is part of PolarSSL (http://www.polarssl.org)
+ *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
+ *
+ *  All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef TPMRSA_H
+#define TPMRSA_H
+
+#include "tcg.h"
+#include <polarssl/bignum.h>
+
+/* tpm software key */
+typedef struct
+{
+    size_t len;                 /*!<  size(N) in chars  */
+
+    mpi N;                      /*!<  public modulus    */
+    mpi E;                      /*!<  public exponent   */
+
+    mpi RN;                     /*!<  cached R^2 mod N  */
+}
+tpmrsa_context;
+
+#define TPMRSA_CTX_INIT { 0, {0, 0, NULL}, {0, 0, NULL}, {0, 0, NULL}}
+
+/* Setup the rsa context using tpm public key data */
+void tpmrsa_set_pubkey(tpmrsa_context* ctx,
+      const unsigned char* key,
+      int keylen,
+      const unsigned char* exponent,
+      int explen);
+
+/* Do rsa public crypto */
+TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
+      int (*f_rng)(void *, unsigned char *, size_t),
+      void *p_rng,
+      size_t ilen,
+      const unsigned char *input,
+      unsigned char *output );
+
+/* free tpmrsa key */
+inline void tpmrsa_free( tpmrsa_context *ctx ) {
+   mpi_free( &ctx->RN ); mpi_free( &ctx->E  ); mpi_free( &ctx->N  );
+}
+
+#endif /* tpmrsa.h */
diff --git a/stubdom/vtpmmgr/uuid.h b/stubdom/vtpmmgr/uuid.h
new file mode 100644
index 0000000..4737645
--- /dev/null
+++ b/stubdom/vtpmmgr/uuid.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPMMGR_UUID_H
+#define VTPMMGR_UUID_H
+
+#define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
+#define UUID_FMTLEN ((2*16)+4) /* 16 hex bytes plus 4 hypens */
+#define UUID_BYTES(uuid) uuid[0], uuid[1], uuid[2], uuid[3], \
+                                uuid[4], uuid[5], uuid[6], uuid[7], \
+                                uuid[8], uuid[9], uuid[10], uuid[11], \
+                                uuid[12], uuid[13], uuid[14], uuid[15]
+
+
+typedef uint8_t uuid_t[16];
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_cmd_handler.c b/stubdom/vtpmmgr/vtpm_cmd_handler.c
new file mode 100644
index 0000000..f82a2a9
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_cmd_handler.c
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <inttypes.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "marshal.h"
+#include "log.h"
+#include "vtpm_storage.h"
+#include "vtpmmgr.h"
+#include "tpm.h"
+#include "tcg.h"
+
+static TPM_RESULT vtpmmgr_SaveHashKey(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+
+   if(tpmcmd->req_len != VTPM_COMMAND_HEADER_SIZE + HASHKEYSZ) {
+      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_ORD_SAVEHASHKEY hashkey too short!\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   /* Do the command */
+   TPMTRYRETURN(vtpm_storage_save_hashkey(uuid, tpmcmd->req + VTPM_COMMAND_HEADER_SIZE));
+
+abort_egress:
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         VTPM_TAG_RSP, VTPM_COMMAND_HEADER_SIZE, status);
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+
+   return status;
+}
+
+static TPM_RESULT vtpmmgr_LoadHashKey(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+
+   TPMTRYRETURN(vtpm_storage_load_hashkey(uuid, tpmcmd->resp + VTPM_COMMAND_HEADER_SIZE));
+
+   tpmcmd->resp_len += HASHKEYSZ;
+
+abort_egress:
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         VTPM_TAG_RSP, tpmcmd->resp_len, status);
+
+   return status;
+}
+
+
+TPM_RESULT vtpmmgr_handle_cmd(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_TAG tag;
+   UINT32 size;
+   TPM_COMMAND_CODE ord;
+
+   unpack_TPM_RQU_HEADER(tpmcmd->req,
+         &tag, &size, &ord);
+
+   /* Handle the command now */
+   switch(tag) {
+      case VTPM_TAG_REQ:
+         //This is a vTPM command
+         switch(ord) {
+            case VTPM_ORD_SAVEHASHKEY:
+               return vtpmmgr_SaveHashKey(uuid, tpmcmd);
+            case VTPM_ORD_LOADHASHKEY:
+               return vtpmmgr_LoadHashKey(uuid, tpmcmd);
+            default:
+               vtpmlogerror(VTPM_LOG_VTPM, "Invalid vTPM Ordinal %" PRIu32 "\n", ord);
+               status = TPM_BAD_ORDINAL;
+         }
+         break;
+      case TPM_TAG_RQU_COMMAND:
+      case TPM_TAG_RQU_AUTH1_COMMAND:
+      case TPM_TAG_RQU_AUTH2_COMMAND:
+         //This is a TPM passthrough command
+         switch(ord) {
+            case TPM_ORD_GetRandom:
+               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_GetRandom\n");
+               break;
+            case TPM_ORD_PcrRead:
+               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_PcrRead\n");
+               break;
+            default:
+               vtpmlogerror(VTPM_LOG_VTPM, "TPM Disallowed Passthrough ord=%" PRIu32 "\n", ord);
+               status = TPM_DISABLED_CMD;
+               goto abort_egress;
+         }
+
+         size = TCPA_MAX_BUFFER_LENGTH;
+         TPMTRYRETURN(TPM_TransmitData(tpmcmd->req, tpmcmd->req_len, tpmcmd->resp, &size));
+         tpmcmd->resp_len = size;
+
+         unpack_TPM_RESULT(tpmcmd->resp + sizeof(TPM_TAG) + sizeof(UINT32), &status);
+         return status;
+
+         break;
+      default:
+         vtpmlogerror(VTPM_LOG_VTPM, "Invalid tag=%" PRIu16 "\n", tag);
+         status = TPM_BADTAG;
+   }
+
+abort_egress:
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         tag + 3, tpmcmd->resp_len, status);
+
+   return status;
+}
diff --git a/stubdom/vtpmmgr/vtpm_manager.h b/stubdom/vtpmmgr/vtpm_manager.h
new file mode 100644
index 0000000..a2bbcca
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_manager.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPM_MANAGER_H
+#define VTPM_MANAGER_H
+
+#define VTPM_TAG_REQ 0x01c1
+#define VTPM_TAG_RSP 0x01c4
+#define COMMAND_BUFFER_SIZE 4096
+
+// Header size
+#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
+
+//************************ Command Codes ****************************
+#define VTPM_ORD_BASE       0x0000
+#define VTPM_PRIV_MASK      0x01000000 // Priviledged VTPM Command
+#define VTPM_PRIV_BASE      (VTPM_ORD_BASE | VTPM_PRIV_MASK)
+
+// Non-priviledged VTPM Commands (From DMI's)
+#define VTPM_ORD_SAVEHASHKEY      (VTPM_ORD_BASE + 1) // DMI requests encryption key for persistent storage
+#define VTPM_ORD_LOADHASHKEY      (VTPM_ORD_BASE + 2) // DMI requests symkey to be regenerated
+
+//************************ Return Codes ****************************
+#define VTPM_SUCCESS               0
+#define VTPM_FAIL                  1
+#define VTPM_UNSUPPORTED           2
+#define VTPM_FORBIDDEN             3
+#define VTPM_RESTORE_CONTEXT_FAILED    4
+#define VTPM_INVALID_REQUEST       5
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_storage.c b/stubdom/vtpmmgr/vtpm_storage.c
new file mode 100644
index 0000000..9ce0c32
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_storage.c
@@ -0,0 +1,794 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+/***************************************************************
+ * DISK IMAGE LAYOUT
+ * *************************************************************
+ * All data is stored in BIG ENDIAN format
+ * *************************************************************
+ * Section 1: Header
+ *
+ * 10 bytes 	 id			ID String "VTPMMGRDOM"
+ * uint32_t	 version	        Disk Image version number (current == 1)
+ * uint32_t      storage_key_len	Length of the storage Key
+ * TPM_KEY       storage_key		Marshalled TPM_KEY structure (See TPM spec v2)
+ * RSA_BLOCK     aes_crypto             Encrypted aes key data (RSA_CIPHER_SIZE bytes), bound by the storage_key
+ *  BYTE[32] aes_key                    Aes key for encrypting the uuid table
+ *  uint32_t cipher_sz                  Encrypted size of the uuid table
+ *
+ * *************************************************************
+ * Section 2: Uuid Table
+ * 
+ * This table is encrypted by the aes_key in the header. The cipher text size is just
+ * large enough to hold all of the entries plus required padding.
+ *
+ * Each entry is as follows
+ * BYTE[16] uuid                       Uuid of a vtpm that is stored on this disk
+ * uint32_t offset                     Disk offset where the vtpm data is stored
+ *
+ * *************************************************************
+ * Section 3: Vtpm Table
+ *
+ * The rest of the disk stores vtpms. Each vtpm is an RSA_BLOCK encrypted
+ * by the storage key. Each vtpm must exist on an RSA_BLOCK aligned boundary,
+ * starting at the first RSA_BLOCK aligned offset after the uuid table.
+ * As the uuid table grows, vtpms may be relocated.
+ *
+ * RSA_BLOCK     vtpm_crypto          Vtpm data encrypted by storage_key
+ *   BYTE[20]    hash                 Sha1 hash of vtpm encrypted data
+ *   BYTE[16]    vtpm_aes_key         Encryption key for vtpm data
+ *
+  *************************************************************
+ */
+#define DISKVERS 1
+#define IDSTR "VTPMMGRDOM"
+#define IDSTRLEN 10
+#define AES_BLOCK_SIZE 16
+#define AES_KEY_BITS 256
+#define AES_KEY_SIZE (AES_KEY_BITS/8)
+#define BUF_SIZE 4096
+
+#define UUID_TBL_ENT_SIZE (sizeof(uuid_t) + sizeof(uint32_t))
+
+#define HEADERSZ (10 + 4 + 4)
+
+#define TRY_READ(buf, size, msg) do {\
+   int rc; \
+   if((rc = read(blkfront_fd, buf, (size))) != (size)) { \
+      vtpmlogerror(VTPM_LOG_VTPM, "read() failed! " msg " : rc=(%d/%d), error=(%s)\n", rc, (int)(size), strerror(errno)); \
+      status = TPM_IOERROR;\
+      goto abort_egress;\
+   } \
+} while(0)
+
+#define TRY_WRITE(buf, size, msg) do {\
+   int rc; \
+   if((rc = write(blkfront_fd, buf, (size))) != (size)) { \
+      vtpmlogerror(VTPM_LOG_VTPM, "write() failed! " msg " : rc=(%d/%d), error=(%s)\n", rc, (int)(size), strerror(errno)); \
+      status = TPM_IOERROR;\
+      goto abort_egress;\
+   } \
+} while(0)
+
+#include <blkfront.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <mini-os/byteorder.h>
+#include <polarssl/aes.h>
+
+#include "vtpm_manager.h"
+#include "log.h"
+#include "marshal.h"
+#include "tpm.h"
+#include "uuid.h"
+
+#include "vtpmmgr.h"
+#include "vtpm_storage.h"
+
+#define MAX(a,b) ( ((a) > (b)) ? (a) : (b) )
+#define MIN(a,b) ( ((a) < (b)) ? (a) : (b) )
+
+/* blkfront device objets */
+static struct blkfront_dev* blkdev = NULL;
+static int blkfront_fd = -1;
+
+struct Vtpm {
+   uuid_t uuid;
+   int offset;
+};
+struct Storage {
+   int aes_offset;
+   int uuid_offset;
+   int end_offset;
+
+   int num_vtpms;
+   int num_vtpms_alloced;
+   struct Vtpm* vtpms;
+};
+
+/* Global storage data */
+static struct Storage g_store = {
+   .vtpms = NULL,
+};
+
+static int get_offset(void) {
+   return lseek(blkfront_fd, 0, SEEK_CUR);
+}
+
+static void reset_store(void) {
+   g_store.aes_offset = 0;
+   g_store.uuid_offset = 0;
+   g_store.end_offset = 0;
+
+   g_store.num_vtpms = 0;
+   g_store.num_vtpms_alloced = 0;
+   free(g_store.vtpms);
+   g_store.vtpms = NULL;
+}
+
+static int vtpm_get_index(const uuid_t uuid) {
+   int st = 0;
+   int ed = g_store.num_vtpms-1;
+   while(st <= ed) {
+      int mid = ((unsigned int)st + (unsigned int)ed) >> 1; //avoid overflow
+      int c = memcmp(uuid, &g_store.vtpms[mid].uuid, sizeof(uuid_t));
+      if(c == 0) {
+         return mid;
+      } else if(c > 0) {
+         st = mid + 1;
+      } else {
+         ed = mid - 1;
+      }
+   }
+   return -(st + 1);
+}
+
+static void vtpm_add(const uuid_t uuid, int offset, int index) {
+   /* Realloc more space if needed */
+   if(g_store.num_vtpms >= g_store.num_vtpms_alloced) {
+      g_store.num_vtpms_alloced += 16;
+      g_store.vtpms = realloc(
+            g_store.vtpms,
+            sizeof(struct Vtpm) * g_store.num_vtpms_alloced);
+   }
+
+   /* Move everybody after the new guy */
+   for(int i = g_store.num_vtpms; i > index; --i) {
+      g_store.vtpms[i] = g_store.vtpms[i-1];
+   }
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Registered vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+
+   /* Finally add new one */
+   memcpy(g_store.vtpms[index].uuid, uuid, sizeof(uuid_t));
+   g_store.vtpms[index].offset = offset;
+   ++g_store.num_vtpms;
+}
+
+#if 0
+static void vtpm_remove(int index) {
+   for(i = index; i < g_store.num_vtpms; ++i) {
+      g_store.vtpms[i] = g_store.vtpms[i+1];
+   }
+   --g_store.num_vtpms;
+}
+#endif
+
+static int pack_uuid_table(uint8_t* table, int size, int* nvtpms) {
+   uint8_t* ptr = table;
+   while(*nvtpms < g_store.num_vtpms && size >= 0)
+   {
+      /* Pack the uuid */
+      memcpy(ptr, (uint8_t*)g_store.vtpms[*nvtpms].uuid, sizeof(uuid_t));
+      ptr+= sizeof(uuid_t);
+
+
+      /* Pack the offset */
+      ptr = pack_UINT32(ptr, g_store.vtpms[*nvtpms].offset);
+
+      ++*nvtpms;
+      size -= UUID_TBL_ENT_SIZE;
+   }
+   return ptr - table;
+}
+
+/* Extract the uuids */
+static int extract_uuid_table(uint8_t* table, int size) {
+   uint8_t* ptr = table;
+   for(;size >= UUID_TBL_ENT_SIZE; size -= UUID_TBL_ENT_SIZE) {
+      int index;
+      uint32_t v32;
+
+      /*uuid_t is just an array of bytes, so we can do a direct cast here */
+      uint8_t* uuid = ptr;
+      ptr += sizeof(uuid_t);
+
+      /* Get the offset of the key */
+      ptr = unpack_UINT32(ptr, &v32);
+
+      /* Insert the new vtpm in sorted order */
+      if((index = vtpm_get_index(uuid)) >= 0) {
+         vtpmlogerror(VTPM_LOG_VTPM, "Vtpm (" UUID_FMT ") exists multiple times! ignoring...\n", UUID_BYTES(uuid));
+         continue;
+      }
+      index = -index -1;
+
+      vtpm_add(uuid, v32, index);
+
+   }
+   return ptr - table;
+}
+
+static void vtpm_decrypt_block(aes_context* aes,
+      uint8_t* iv,
+      uint8_t* cipher,
+      uint8_t* plain,
+      int cipher_sz,
+      int* overlap)
+{
+   int bytes_ext;
+   /* Decrypt */
+   aes_crypt_cbc(aes, AES_DECRYPT,
+         cipher_sz,
+         iv, cipher, plain + *overlap);
+
+   /* Extract */
+   bytes_ext = extract_uuid_table(plain, cipher_sz + *overlap);
+
+   /* Copy left overs to the beginning */
+   *overlap = cipher_sz + *overlap - bytes_ext;
+   memcpy(plain, plain + bytes_ext, *overlap);
+}
+
+static int vtpm_encrypt_block(aes_context* aes,
+      uint8_t* iv,
+      uint8_t* plain,
+      uint8_t* cipher,
+      int block_sz,
+      int* overlap,
+      int* num_vtpms)
+{
+   int bytes_to_crypt;
+   int bytes_packed;
+
+   /* Pack the uuid table */
+   bytes_packed = *overlap + pack_uuid_table(plain + *overlap, block_sz - *overlap, num_vtpms);
+   bytes_to_crypt = MIN(bytes_packed, block_sz);
+
+   /* Add padding if we aren't on a multiple of the block size */
+   if(bytes_to_crypt & (AES_BLOCK_SIZE-1)) {
+      int oldsz = bytes_to_crypt;
+      //add padding
+      bytes_to_crypt += AES_BLOCK_SIZE - (bytes_to_crypt & (AES_BLOCK_SIZE-1));
+      //fill padding with random bytes
+      vtpmmgr_rand(plain + oldsz, bytes_to_crypt - oldsz);
+      *overlap = 0;
+   } else {
+      *overlap = bytes_packed - bytes_to_crypt;
+   }
+
+   /* Encrypt this chunk */
+   aes_crypt_cbc(aes, AES_ENCRYPT,
+            bytes_to_crypt,
+            iv, plain, cipher);
+
+   /* Copy the left over partials to the beginning */
+   memcpy(plain, plain + bytes_to_crypt, *overlap);
+
+   return bytes_to_crypt;
+}
+
+static TPM_RESULT vtpm_storage_new_vtpm(const uuid_t uuid, int index) {
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
+   uint8_t buf[BUF_SIZE];
+   uint8_t* ptr;
+   int cipher_sz;
+   aes_context aes;
+
+   /* Add new vtpm to the table */
+   vtpm_add(uuid, g_store.end_offset, index);
+   g_store.end_offset += RSA_CIPHER_SIZE;
+
+   /* Compute the new end location of the encrypted uuid table */
+   cipher_sz = AES_BLOCK_SIZE; //IV
+   cipher_sz += g_store.num_vtpms * UUID_TBL_ENT_SIZE; //uuid table
+   cipher_sz += (AES_BLOCK_SIZE - (cipher_sz & (AES_BLOCK_SIZE -1))) & (AES_BLOCK_SIZE-1); //aes padding
+
+   /* Does this overlap any key data? If so they need to be relocated */
+   int uuid_end = (g_store.uuid_offset + cipher_sz + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+   for(int i = 0; i < g_store.num_vtpms; ++i) {
+      if(g_store.vtpms[i].offset < uuid_end) {
+
+         vtpmloginfo(VTPM_LOG_VTPM, "Relocating vtpm data\n");
+
+         //Read the hashkey cipher text
+         lseek(blkfront_fd, g_store.vtpms[i].offset, SEEK_SET);
+         TRY_READ(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
+
+         //Write the cipher text to new offset
+         lseek(blkfront_fd, g_store.end_offset, SEEK_SET);
+         TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
+
+         //Save new offset
+         g_store.vtpms[i].offset = g_store.end_offset;
+         g_store.end_offset += RSA_CIPHER_SIZE;
+      }
+   }
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Generating a new symmetric key\n");
+
+   /* Generate an aes key */
+   TPMTRYRETURN(vtpmmgr_rand(plain, AES_KEY_SIZE));
+   aes_setkey_enc(&aes, plain, AES_KEY_BITS);
+   ptr = plain + AES_KEY_SIZE;
+
+   /* Pack the crypted size */
+   ptr = pack_UINT32(ptr, cipher_sz);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Binding encrypted key\n");
+
+   /* Seal the key and size */
+   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
+            plain,
+            ptr - plain,
+            buf));
+
+   /* Write the sealed key to disk */
+   lseek(blkfront_fd, g_store.aes_offset, SEEK_SET);
+   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm aes key");
+
+   /* ENCRYPT AND WRITE UUID TABLE */
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Encrypting the uuid table\n");
+
+   int num_vtpms = 0;
+   int overlap = 0;
+   int bytes_crypted;
+   uint8_t iv[AES_BLOCK_SIZE];
+
+   /* Generate the iv for the first block */
+   TPMTRYRETURN(vtpmmgr_rand(iv, AES_BLOCK_SIZE));
+
+   /* Copy the iv to the cipher text buffer to be written to disk */
+   memcpy(buf, iv, AES_BLOCK_SIZE);
+   ptr = buf + AES_BLOCK_SIZE;
+
+   /* Encrypt the first block of the uuid table */
+   bytes_crypted = vtpm_encrypt_block(&aes,
+         iv, //iv
+         plain, //plaintext
+         ptr, //cipher text
+         BUF_SIZE - AES_BLOCK_SIZE,
+         &overlap,
+         &num_vtpms);
+
+   /* Write the iv followed by the crypted table*/
+   TRY_WRITE(buf, bytes_crypted + AES_BLOCK_SIZE, "vtpm uuid table");
+
+   /* Decrement the number of bytes encrypted */
+   cipher_sz -= bytes_crypted + AES_BLOCK_SIZE;
+
+   /* If there are more vtpms, encrypt and write them block by block */
+   while(cipher_sz > 0) {
+      /* Encrypt the next block of the uuid table */
+      bytes_crypted = vtpm_encrypt_block(&aes,
+               iv,
+               plain,
+               buf,
+               BUF_SIZE,
+               &overlap,
+               &num_vtpms);
+
+      /* Write the cipher text to disk */
+      TRY_WRITE(buf, bytes_crypted, "vtpm uuid table");
+
+      cipher_sz -= bytes_crypted;
+   }
+
+   goto egress;
+abort_egress:
+egress:
+   return status;
+}
+
+
+/**************************************
+ * PUBLIC FUNCTIONS
+ * ***********************************/
+
+int vtpm_storage_init(void) {
+   struct blkfront_info info;
+   if((blkdev = init_blkfront(NULL, &info)) == NULL) {
+      return -1;
+   }
+   if((blkfront_fd = blkfront_open(blkdev)) < 0) {
+      return -1;
+   }
+   return 0;
+}
+
+void vtpm_storage_shutdown(void) {
+   reset_store();
+   close(blkfront_fd);
+}
+
+TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ])
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   int index;
+   uint8_t cipher[RSA_CIPHER_SIZE];
+   uint8_t clear[RSA_CIPHER_SIZE];
+   UINT32 clear_size;
+
+   /* Find the index of this uuid */
+   if((index = vtpm_get_index(uuid)) < 0) {
+      index = -index-1;
+      vtpmlogerror(VTPM_LOG_VTPM, "LoadKey failure: Unrecognized uuid! " UUID_FMT "\n", UUID_BYTES(uuid));
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   /* Read the table entry */
+   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
+   TRY_READ(cipher, RSA_CIPHER_SIZE, "vtpm hashkey data");
+
+   /* Decrypt the table entry */
+   TPMTRYRETURN(TPM_UnBind(
+            vtpm_globals.storage_key_handle,
+            RSA_CIPHER_SIZE,
+            cipher,
+            &clear_size,
+            clear,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.oiap));
+
+   if(clear_size < HASHKEYSZ) {
+      vtpmloginfo(VTPM_LOG_VTPM, "Decrypted Hash key size (%" PRIu32 ") was too small!\n", clear_size);
+      status = TPM_RESOURCES;
+      goto abort_egress;
+   }
+
+   memcpy(hashkey, clear, HASHKEYSZ);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Loaded hash and key for vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+   goto egress;
+abort_egress:
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load key\n");
+egress:
+   return status;
+}
+
+TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ])
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   int index;
+   uint8_t buf[RSA_CIPHER_SIZE];
+
+   /* Find the index of this uuid */
+   if((index = vtpm_get_index(uuid)) < 0) {
+      index = -index-1;
+      /* Create a new vtpm */
+      TPMTRYRETURN( vtpm_storage_new_vtpm(uuid, index) );
+   }
+
+   /* Encrypt the hash and key */
+   TPMTRYRETURN( TPM_Bind(&vtpm_globals.storage_key,
+            hashkey,
+            HASHKEYSZ,
+            buf));
+
+   /* Write to disk */
+   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
+   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey data");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saved hash and key for vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+   goto egress;
+abort_egress:
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to save key\n");
+egress:
+   return status;
+}
+
+TPM_RESULT vtpm_storage_new_header()
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t buf[BUF_SIZE];
+   uint8_t keybuf[AES_KEY_SIZE + sizeof(uint32_t)];
+   uint8_t* ptr = buf;
+   uint8_t* sptr;
+
+   /* Clear everything first */
+   reset_store();
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Creating new disk image header\n");
+
+   /*Copy the ID string */
+   memcpy(ptr, IDSTR, IDSTRLEN);
+   ptr += IDSTRLEN;
+
+   /*Copy the version */
+   ptr = pack_UINT32(ptr, DISKVERS);
+
+   /*Save the location of the key size */
+   sptr = ptr;
+   ptr += sizeof(UINT32);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saving root storage key..\n");
+
+   /* Copy the storage key */
+   ptr = pack_TPM_KEY(ptr, &vtpm_globals.storage_key);
+
+   /* Now save the size */
+   pack_UINT32(sptr, ptr - (sptr + 4));
+
+   /* Create a fake aes key and set cipher text size to 0 */
+   memset(keybuf, 0, sizeof(keybuf));
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Binding uuid table symmetric key..\n");
+
+   /* Save the location of the aes key */
+   g_store.aes_offset = ptr - buf;
+
+   /* Store the fake aes key and vtpm count */
+   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
+         keybuf,
+         sizeof(keybuf),
+         ptr));
+   ptr+= RSA_CIPHER_SIZE;
+
+   /* Write the header to disk */
+   lseek(blkfront_fd, 0, SEEK_SET);
+   TRY_WRITE(buf, ptr-buf, "vtpm header");
+
+   /* Save the location of the uuid table */
+   g_store.uuid_offset = get_offset();
+
+   /* Save the end offset */
+   g_store.end_offset = (g_store.uuid_offset + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saved new manager disk header.\n");
+
+   goto egress;
+abort_egress:
+egress:
+   return status;
+}
+
+
+TPM_RESULT vtpm_storage_load_header(void)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint32_t v32;
+   uint8_t buf[BUF_SIZE];
+   uint8_t* ptr = buf;
+   aes_context aes;
+
+   /* Clear everything first */
+   reset_store();
+
+   /* Read the header from disk */
+   lseek(blkfront_fd, 0, SEEK_SET);
+   TRY_READ(buf, IDSTRLEN + sizeof(UINT32) + sizeof(UINT32), "vtpm header");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Loading disk image header\n");
+
+   /* Verify the ID string */
+   if(memcmp(ptr, IDSTR, IDSTRLEN)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid ID string in disk image!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+   ptr+=IDSTRLEN;
+
+   /* Unpack the version */
+   ptr = unpack_UINT32(ptr, &v32);
+
+   /* Verify the version */
+   if(v32 != DISKVERS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unsupported disk image version number %" PRIu32 "\n", v32);
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   /* Size of the storage key */
+   ptr = unpack_UINT32(ptr, &v32);
+
+   /* Sanity check */
+   if(v32 > BUF_SIZE) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Size of storage key (%" PRIu32 ") is too large!\n", v32);
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* read the storage key */
+   TRY_READ(buf, v32, "storage pub key");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Unpacking storage key\n");
+
+   /* unpack the storage key */
+   ptr = unpack_TPM_KEY(buf, &vtpm_globals.storage_key, UNPACK_ALLOC);
+
+   /* Load Storage Key into the TPM */
+   TPMTRYRETURN( TPM_LoadKey(
+            TPM_SRK_KEYHANDLE,
+            &vtpm_globals.storage_key,
+            &vtpm_globals.storage_key_handle,
+            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+            &vtpm_globals.oiap));
+
+   /* Initialize the storage key auth */
+   memset(vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA));
+
+   /* Store the offset of the aes key */
+   g_store.aes_offset = get_offset();
+
+   /* Read the rsa cipher text for the aes key */
+   TRY_READ(buf, RSA_CIPHER_SIZE, "aes key");
+   ptr = buf + RSA_CIPHER_SIZE;
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Unbinding uuid table symmetric key\n");
+
+   /* Decrypt the aes key protecting the uuid table */
+   UINT32 datalen;
+   TPMTRYRETURN(TPM_UnBind(
+            vtpm_globals.storage_key_handle,
+            RSA_CIPHER_SIZE,
+            buf,
+            &datalen,
+            ptr,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.oiap));
+
+   /* Validate the length of the output buffer */
+   if(datalen < AES_KEY_SIZE + sizeof(UINT32)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unbound AES key size (%d) was too small! expected (%ld)\n", datalen, AES_KEY_SIZE + sizeof(UINT32));
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* Extract the aes key */
+   aes_setkey_dec(&aes, ptr, AES_KEY_BITS);
+   ptr+= AES_KEY_SIZE;
+
+   /* Extract the ciphertext size */
+   ptr = unpack_UINT32(ptr, &v32);
+   int cipher_size = v32;
+
+   /* Sanity check */
+   if(cipher_size & (AES_BLOCK_SIZE-1)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Cipher text size (%" PRIu32 ") is not a multiple of the aes block size! (%d)\n", v32, AES_BLOCK_SIZE);
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* Save the location of the uuid table */
+   g_store.uuid_offset = get_offset();
+
+   /* Only decrypt the table if there are vtpms to decrypt */
+   if(cipher_size > 0) {
+      int rbytes;
+      int overlap = 0;
+      uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
+      uint8_t iv[AES_BLOCK_SIZE];
+
+      vtpmloginfo(VTPM_LOG_VTPM, "Decrypting uuid table\n");
+
+      /* Pre allocate the vtpm array */
+      g_store.num_vtpms_alloced = cipher_size / UUID_TBL_ENT_SIZE;
+      g_store.vtpms = malloc(sizeof(struct Vtpm) * g_store.num_vtpms_alloced);
+
+      /* Read the iv and the first chunk of cipher text */
+      rbytes = MIN(cipher_size, BUF_SIZE);
+      TRY_READ(buf, rbytes, "vtpm uuid table\n");
+      cipher_size -= rbytes;
+
+      /* Copy the iv */
+      memcpy(iv, buf, AES_BLOCK_SIZE);
+      ptr = buf + AES_BLOCK_SIZE;
+
+      /* Remove the iv from the number of bytes to decrypt */
+      rbytes -= AES_BLOCK_SIZE;
+
+      /* Decrypt and extract vtpms */
+      vtpm_decrypt_block(&aes,
+            iv, ptr, plain,
+            rbytes, &overlap);
+
+      /* Read the rest of the table if there is more */
+      while(cipher_size > 0) {
+         /* Read next chunk of cipher text */
+         rbytes = MIN(cipher_size, BUF_SIZE);
+         TRY_READ(buf, rbytes, "vtpm uuid table");
+         cipher_size -= rbytes;
+
+         /* Decrypt a block of text */
+         vtpm_decrypt_block(&aes,
+               iv, buf, plain,
+               rbytes, &overlap);
+
+      }
+      vtpmloginfo(VTPM_LOG_VTPM, "Loaded %d vtpms!\n", g_store.num_vtpms);
+   }
+
+   /* The end of the key table, new vtpms go here */
+   int uuid_end = (get_offset() + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+   g_store.end_offset = uuid_end;
+
+   /* Compute the end offset while validating vtpms*/
+   for(int i = 0; i < g_store.num_vtpms; ++i) {
+      /* offset must not collide with previous data */
+      if(g_store.vtpms[i].offset < uuid_end) {
+         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
+               " offset (%d) is before end of uuid table (%d)!\n",
+               UUID_BYTES(g_store.vtpms[i].uuid),
+               g_store.vtpms[i].offset, uuid_end);
+         status = TPM_IOERROR;
+         goto abort_egress;
+      }
+      /* offset must be at a multiple of cipher size */
+      if(g_store.vtpms[i].offset & (RSA_CIPHER_SIZE-1)) {
+         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
+               " offset(%d) is not at a multiple of the rsa cipher text size (%d)!\n",
+               UUID_BYTES(g_store.vtpms[i].uuid),
+               g_store.vtpms[i].offset, RSA_CIPHER_SIZE);
+         status = TPM_IOERROR;
+         goto abort_egress;
+      }
+      /* Save the last offset */
+      if(g_store.vtpms[i].offset >= g_store.end_offset) {
+         g_store.end_offset = g_store.vtpms[i].offset + RSA_CIPHER_SIZE;
+      }
+   }
+
+   goto egress;
+abort_egress:
+   //An error occured somewhere
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load manager data!\n");
+
+   //Clear the data store
+   reset_store();
+
+   //Reset the storage key structure
+   free_TPM_KEY(&vtpm_globals.storage_key);
+   {
+      TPM_KEY key = TPM_KEY_INIT;
+      vtpm_globals.storage_key = key;
+   }
+
+   //Reset the storage key handle
+   TPM_EvictKey(vtpm_globals.storage_key_handle);
+   vtpm_globals.storage_key_handle = 0;
+egress:
+   return status;
+}
+
+#if 0
+/* For testing disk IO */
+void add_fake_vtpms(int num) {
+   for(int i = 0; i < num; ++i) {
+      uint32_t ind = cpu_to_be32(i);
+
+      uuid_t uuid;
+      memset(uuid, 0, sizeof(uuid_t));
+      memcpy(uuid, &ind, sizeof(ind));
+      int index = vtpm_get_index(uuid);
+      index = -index-1;
+
+      vtpm_storage_new_vtpm(uuid, index);
+   }
+}
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_storage.h b/stubdom/vtpmmgr/vtpm_storage.h
new file mode 100644
index 0000000..a5a5fd7
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_storage.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPM_STORAGE_H
+#define VTPM_STORAGE_h
+
+#include "uuid.h"
+
+#define VTPM_NVMKEY_SIZE 32
+#define HASHKEYSZ (sizeof(TPM_DIGEST) + VTPM_NVMKEY_SIZE)
+
+/* Initialize the storage system and its virtual disk */
+int vtpm_storage_init(void);
+
+/* Shutdown the storage system and its virtual disk */
+void vtpm_storage_shutdown(void);
+
+/* Loads Sha1 hash and 256 bit AES key from disk and stores them
+ * packed together in outbuf. outbuf must be freed
+ * by the caller using buffer_free()
+ */
+TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ]);
+
+/* inbuf must contain a sha1 hash followed by a 256 bit AES key.
+ * Encrypts and stores the hash and key to disk */
+TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ]);
+
+/* Load the vtpm manager data - call this on startup */
+TPM_RESULT vtpm_storage_load_header(void);
+
+/* Saves the vtpm manager data - call this on shutdown */
+TPM_RESULT vtpm_storage_new_header(void);
+
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpmmgr.c b/stubdom/vtpmmgr/vtpmmgr.c
new file mode 100644
index 0000000..563f4e8
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpmmgr.c
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdint.h>
+#include <mini-os/tpmback.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "log.h"
+
+#include "vtpmmgr.h"
+#include "tcg.h"
+
+
+void main_loop(void) {
+   tpmcmd_t* tpmcmd;
+   uint8_t respbuf[TCPA_MAX_BUFFER_LENGTH];
+
+   while(1) {
+      /* Wait for requests from a vtpm */
+      vtpmloginfo(VTPM_LOG_VTPM, "Waiting for commands from vTPM's:\n");
+      if((tpmcmd = tpmback_req_any()) == NULL) {
+         vtpmlogerror(VTPM_LOG_VTPM, "NULL tpmcmd\n");
+         continue;
+      }
+
+      tpmcmd->resp = respbuf;
+
+      /* Process the command */
+      vtpmmgr_handle_cmd(tpmcmd->uuid, tpmcmd);
+
+      /* Send response */
+      tpmback_resp(tpmcmd);
+   }
+}
+
+int main(int argc, char** argv)
+{
+   int rc = 0;
+   sleep(2);
+   vtpmloginfo(VTPM_LOG_VTPM, "Starting vTPM manager domain\n");
+
+   /* Initialize the vtpm manager */
+   if(vtpmmgr_init(argc, argv) != TPM_SUCCESS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize vtpmmgr domain!\n");
+      rc = -1;
+      goto exit;
+   }
+
+   main_loop();
+
+   vtpmloginfo(VTPM_LOG_VTPM, "vTPM Manager shutting down...\n");
+
+   vtpmmgr_shutdown();
+
+exit:
+   return rc;
+
+}
diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
new file mode 100644
index 0000000..50a1992
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPMMGR_H
+#define VTPMMGR_H
+
+#include <mini-os/tpmback.h>
+#include <polarssl/entropy.h>
+#include <polarssl/ctr_drbg.h>
+
+#include "uuid.h"
+#include "tcg.h"
+#include "vtpm_manager.h"
+
+#define RSA_KEY_SIZE 0x0800
+#define RSA_CIPHER_SIZE (RSA_KEY_SIZE / 8)
+
+struct vtpm_globals {
+   int tpm_fd;
+   TPM_KEY             storage_key;
+   TPM_HANDLE          storage_key_handle;       // Key used by persistent store
+   TPM_AUTH_SESSION    oiap;                // OIAP session for storageKey
+   TPM_AUTHDATA        storage_key_usage_auth;
+
+   TPM_AUTHDATA        owner_auth;
+   TPM_AUTHDATA        srk_auth;
+
+   entropy_context     entropy;
+   ctr_drbg_context    ctr_drbg;
+};
+
+// --------------------------- Global Values --------------------------
+extern struct vtpm_globals vtpm_globals;   // Key info and DMI states
+
+TPM_RESULT vtpmmgr_init(int argc, char** argv);
+void vtpmmgr_shutdown(void);
+
+TPM_RESULT vtpmmgr_handle_cmd(const uuid_t uuid, tpmcmd_t* tpmcmd);
+
+inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes) {
+   return ctr_drbg_random(&vtpm_globals.ctr_drbg, bytes, num_bytes) == 0 ? 0 : TPM_FAIL;
+}
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:22:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaoiM-0005ll-Tx; Tue, 20 Nov 2012 14:22:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaoiJ-0005kp-Tt
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:22:12 +0000
Received: from [85.158.138.51:6120] by server-12.bemta-3.messagelabs.com id
	9C/15-22757-3129BA05; Tue, 20 Nov 2012 14:22:11 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353421321!22741365!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY,UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20605 invoked from network); 20 Nov 2012 14:22:03 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-6.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 20 Nov 2012 14:22:03 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149572011;
	Tue, 20 Nov 2012 09:21:53 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org,
	Ian.Campbell@citrix.com
Date: Tue, 20 Nov 2012 09:21:09 -0500
Message-Id: <1353421272-24797-2-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v4 2/5] add stubdom/vtpmmgr code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add the code base for vtpmmgrdom. Makefile changes
next patch.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/vtpmmgr/Makefile           |   32 ++
 stubdom/vtpmmgr/init.c             |  553 +++++++++++++++++++++
 stubdom/vtpmmgr/log.c              |  151 ++++++
 stubdom/vtpmmgr/log.h              |   85 ++++
 stubdom/vtpmmgr/marshal.h          |  528 ++++++++++++++++++++
 stubdom/vtpmmgr/minios.cfg         |   14 +
 stubdom/vtpmmgr/tcg.h              |  707 +++++++++++++++++++++++++++
 stubdom/vtpmmgr/tpm.c              |  938 ++++++++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/tpm.h              |  218 +++++++++
 stubdom/vtpmmgr/tpmrsa.c           |  175 +++++++
 stubdom/vtpmmgr/tpmrsa.h           |   67 +++
 stubdom/vtpmmgr/uuid.h             |   50 ++
 stubdom/vtpmmgr/vtpm_cmd_handler.c |  152 ++++++
 stubdom/vtpmmgr/vtpm_manager.h     |   64 +++
 stubdom/vtpmmgr/vtpm_storage.c     |  794 ++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/vtpm_storage.h     |   68 +++
 stubdom/vtpmmgr/vtpmmgr.c          |   93 ++++
 stubdom/vtpmmgr/vtpmmgr.h          |   77 +++
 18 files changed, 4766 insertions(+)
 create mode 100644 stubdom/vtpmmgr/Makefile
 create mode 100644 stubdom/vtpmmgr/init.c
 create mode 100644 stubdom/vtpmmgr/log.c
 create mode 100644 stubdom/vtpmmgr/log.h
 create mode 100644 stubdom/vtpmmgr/marshal.h
 create mode 100644 stubdom/vtpmmgr/minios.cfg
 create mode 100644 stubdom/vtpmmgr/tcg.h
 create mode 100644 stubdom/vtpmmgr/tpm.c
 create mode 100644 stubdom/vtpmmgr/tpm.h
 create mode 100644 stubdom/vtpmmgr/tpmrsa.c
 create mode 100644 stubdom/vtpmmgr/tpmrsa.h
 create mode 100644 stubdom/vtpmmgr/uuid.h
 create mode 100644 stubdom/vtpmmgr/vtpm_cmd_handler.c
 create mode 100644 stubdom/vtpmmgr/vtpm_manager.h
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.c
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.h
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.c
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.h

diff --git a/stubdom/vtpmmgr/Makefile b/stubdom/vtpmmgr/Makefile
new file mode 100644
index 0000000..88c83c3
--- /dev/null
+++ b/stubdom/vtpmmgr/Makefile
@@ -0,0 +1,32 @@
+# Copyright (c) 2010-2012 United States Government, as represented by
+# the Secretary of Defense.  All rights reserved.
+#
+# THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+# ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+# INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+# DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+# SOFTWARE.
+#
+
+XEN_ROOT=../..
+
+PSSL_DIR=../polarssl-$(XEN_TARGET_ARCH)/library
+PSSL_OBJS=aes.o sha1.o entropy.o ctr_drbg.o bignum.o sha4.o havege.o timing.o entropy_poll.o
+
+TARGET=vtpmmgr.a
+OBJS=vtpmmgr.o vtpm_cmd_handler.o vtpm_storage.o init.o tpmrsa.o tpm.o log.o
+
+CFLAGS+=-Werror -Iutil -Icrypto -Itcs
+CFLAGS+=-Wno-declaration-after-statement -Wno-unused-label
+
+build: $(TARGET)
+$(TARGET): $(OBJS)
+	ar -rcs $@ $^ $(foreach obj,$(PSSL_OBJS),$(PSSL_DIR)/$(obj))
+
+clean:
+	rm -f $(TARGET) $(OBJS)
+
+distclean: clean
+
+.PHONY: clean distclean
diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
new file mode 100644
index 0000000..a158020
--- /dev/null
+++ b/stubdom/vtpmmgr/init.c
@@ -0,0 +1,553 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+#include <stdint.h>
+#include <stdlib.h>
+
+#include <xen/xen.h>
+#include <mini-os/tpmback.h>
+#include <mini-os/tpmfront.h>
+#include <mini-os/tpm_tis.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <polarssl/sha1.h>
+
+#include "log.h"
+#include "vtpmmgr.h"
+#include "vtpm_storage.h"
+#include "tpm.h"
+#include "marshal.h"
+
+struct Opts {
+   enum {
+      TPMDRV_TPM_TIS,
+      TPMDRV_TPMFRONT,
+   } tpmdriver;
+   unsigned long tpmiomem;
+   unsigned int tpmirq;
+   unsigned int tpmlocality;
+   int gen_owner_auth;
+};
+
+// --------------------------- Well Known Auths --------------------------
+const TPM_AUTHDATA WELLKNOWN_SRK_AUTH = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+const TPM_AUTHDATA WELLKNOWN_OWNER_AUTH = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+
+struct vtpm_globals vtpm_globals = {
+   .tpm_fd = -1,
+   .storage_key = TPM_KEY_INIT,
+   .storage_key_handle = 0,
+   .oiap = { .AuthHandle = 0 }
+};
+
+static int tpm_entropy_source(void* dummy, unsigned char* data, size_t len, size_t* olen) {
+   UINT32 sz = len;
+   TPM_RESULT rc = TPM_GetRandom(&sz, data);
+   *olen = sz;
+   return rc == TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
+}
+
+static TPM_RESULT check_tpm_version(void) {
+   TPM_RESULT status;
+   UINT32 rsize;
+   BYTE* res = NULL;
+   TPM_CAP_VERSION_INFO vinfo;
+
+   TPMTRYRETURN(TPM_GetCapability(
+            TPM_CAP_VERSION_VAL,
+            0,
+            NULL,
+            &rsize,
+            &res));
+   if(rsize < 4) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid size returned by GetCapability!\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   unpack_TPM_CAP_VERSION_INFO(res, &vinfo, UNPACK_ALIAS);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Hardware TPM:\n");
+   vtpmloginfo(VTPM_LOG_VTPM, " version: %hhd %hhd %hhd %hhd\n",
+         vinfo.version.major, vinfo.version.minor, vinfo.version.revMajor, vinfo.version.revMinor);
+   vtpmloginfo(VTPM_LOG_VTPM, " specLevel: %hd\n", vinfo.specLevel);
+   vtpmloginfo(VTPM_LOG_VTPM, " errataRev: %hhd\n", vinfo.errataRev);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorID: %c%c%c%c\n",
+         vinfo.tpmVendorID[0], vinfo.tpmVendorID[1],
+         vinfo.tpmVendorID[2], vinfo.tpmVendorID[3]);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecificSize: %hd\n", vinfo.vendorSpecificSize);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecific: ");
+   for(int i = 0; i < vinfo.vendorSpecificSize; ++i) {
+      vtpmloginfomore(VTPM_LOG_VTPM, "%02hhx", vinfo.vendorSpecific[i]);
+   }
+   vtpmloginfomore(VTPM_LOG_VTPM, "\n");
+
+abort_egress:
+   free(res);
+   return status;
+}
+
+static TPM_RESULT flush_tpm(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   const TPM_RESOURCE_TYPE reslist[] = { TPM_RT_KEY, TPM_RT_AUTH, TPM_RT_TRANS, TPM_RT_COUNTER, TPM_RT_DAA_TPM, TPM_RT_CONTEXT };
+   BYTE* keylist = NULL;
+   UINT32 keylistSize;
+   BYTE* ptr;
+
+   //Iterate through each resource type and flush all handles
+   for(int i = 0; i < sizeof(reslist) / sizeof(TPM_RESOURCE_TYPE); ++i) {
+      TPM_RESOURCE_TYPE beres = cpu_to_be32(reslist[i]);
+      UINT16 size;
+      TPMTRYRETURN(TPM_GetCapability(
+               TPM_CAP_HANDLE,
+               sizeof(TPM_RESOURCE_TYPE),
+               (BYTE*)(&beres),
+               &keylistSize,
+               &keylist));
+
+      ptr = keylist;
+      ptr = unpack_UINT16(ptr, &size);
+
+      //Flush each handle
+      if(size) {
+         vtpmloginfo(VTPM_LOG_VTPM, "Flushing %u handle(s) of type %lu\n", size, (unsigned long) reslist[i]);
+         for(int j = 0; j < size; ++j) {
+            TPM_HANDLE h;
+            ptr = unpack_TPM_HANDLE(ptr, &h);
+            TPMTRYRETURN(TPM_FlushSpecific(h, reslist[i]));
+         }
+      }
+
+      free(keylist);
+      keylist = NULL;
+   }
+
+   goto egress;
+abort_egress:
+   free(keylist);
+egress:
+   return status;
+}
+
+
+static TPM_RESULT try_take_ownership(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_PUBKEY pubEK = TPM_PUBKEY_INIT;
+
+   // If we can read PubEK then there is no owner and we should take it.
+   status = TPM_ReadPubek(&pubEK);
+
+   switch(status) {
+      case TPM_DISABLED_CMD:
+         //Cannot read ek? TPM has owner
+         vtpmloginfo(VTPM_LOG_VTPM, "Failed to readEK meaning TPM has an owner. Creating Keys off existing SRK.\n");
+         status = TPM_SUCCESS;
+         break;
+      case TPM_NO_ENDORSEMENT:
+         {
+            //If theres no ek, we have to create one
+            TPM_KEY_PARMS keyInfo = {
+               .algorithmID = TPM_ALG_RSA,
+               .encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1,
+               .sigScheme = TPM_SS_NONE,
+               .parmSize = 12,
+               .parms.rsa = {
+                  .keyLength = RSA_KEY_SIZE,
+                  .numPrimes = 2,
+                  .exponentSize = 0,
+                  .exponent = NULL,
+               },
+            };
+            TPMTRYRETURN(TPM_CreateEndorsementKeyPair(&keyInfo, &pubEK));
+         }
+         //fall through to take ownership
+      case TPM_SUCCESS:
+         {
+            //Construct the Srk
+            TPM_KEY srk = {
+               .ver = TPM_STRUCT_VER_1_1,
+               .keyUsage = TPM_KEY_STORAGE,
+               .keyFlags = 0x00,
+               .authDataUsage = TPM_AUTH_ALWAYS,
+               .algorithmParms = {
+                  .algorithmID = TPM_ALG_RSA,
+                  .encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1,
+                  .sigScheme =  TPM_SS_NONE,
+                  .parmSize = 12,
+                  .parms.rsa = {
+                     .keyLength = RSA_KEY_SIZE,
+                     .numPrimes = 2,
+                     .exponentSize = 0,
+                     .exponent = NULL,
+                  },
+               },
+               .PCRInfoSize = 0,
+               .pubKey = {
+                  .keyLength = 0,
+                  .key = NULL,
+               },
+               .encDataSize = 0,
+            };
+
+            TPMTRYRETURN(TPM_TakeOwnership(
+                     &pubEK,
+                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
+                     (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+                     &srk,
+                     NULL,
+                     &vtpm_globals.oiap));
+
+            TPMTRYRETURN(TPM_DisablePubekRead(
+                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
+                     &vtpm_globals.oiap));
+         }
+         break;
+      default:
+         break;
+   }
+abort_egress:
+   free_TPM_PUBKEY(&pubEK);
+   return status;
+}
+
+static void init_storage_key(TPM_KEY* key) {
+   key->ver.major = 1;
+   key->ver.minor = 1;
+   key->ver.revMajor = 0;
+   key->ver.revMinor = 0;
+
+   key->keyUsage = TPM_KEY_BIND;
+   key->keyFlags = 0;
+   key->authDataUsage = TPM_AUTH_ALWAYS;
+
+   TPM_KEY_PARMS* p = &key->algorithmParms;
+   p->algorithmID = TPM_ALG_RSA;
+   p->encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
+   p->sigScheme = TPM_SS_NONE;
+   p->parmSize = 12;
+
+   TPM_RSA_KEY_PARMS* r = &p->parms.rsa;
+   r->keyLength = RSA_KEY_SIZE;
+   r->numPrimes = 2;
+   r->exponentSize = 0;
+   r->exponent = NULL;
+
+   key->PCRInfoSize = 0;
+   key->encDataSize = 0;
+   key->encData = NULL;
+}
+
+static int parse_auth_string(char* authstr, BYTE* target, const TPM_AUTHDATA wellknown, int allowrandom) {
+   int rc;
+   /* well known owner auth */
+   if(!strcmp(authstr, "well-known")) {
+      memcpy(target, wellknown, sizeof(TPM_AUTHDATA));
+   }
+   /* Create a randomly generated owner auth */
+   else if(allowrandom && !strcmp(authstr, "random")) {
+      return 1;
+   }
+   /* owner auth is a raw hash */
+   else if(!strncmp(authstr, "hash:", 5)) {
+      authstr += 5;
+      if((rc = strlen(authstr)) != 40) {
+         vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth hex string `%s' must be exactly 40 characters (20 bytes) long, length=%d\n", authstr, rc);
+         return -1;
+      }
+      for(int j = 0; j < 20; ++j) {
+         if(sscanf(authstr, "%hhX", target + j) != 1) {
+            vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth string `%s' is not a valid hex string\n", authstr);
+            return -1;
+         }
+         authstr += 2;
+      }
+   }
+   /* owner auth is a string that will be hashed */
+   else if(!strncmp(authstr, "text:", 5)) {
+      authstr += 5;
+      sha1((const unsigned char*)authstr, strlen(authstr), target);
+   }
+   else {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid auth string %s\n", authstr);
+      return -1;
+   }
+
+   return 0;
+}
+
+int parse_cmdline_opts(int argc, char** argv, struct Opts* opts)
+{
+   int rc;
+   int i;
+
+   //Set defaults
+   memcpy(vtpm_globals.owner_auth, WELLKNOWN_OWNER_AUTH, sizeof(TPM_AUTHDATA));
+   memcpy(vtpm_globals.srk_auth, WELLKNOWN_SRK_AUTH, sizeof(TPM_AUTHDATA));
+
+   for(i = 1; i < argc; ++i) {
+      if(!strncmp(argv[i], "owner_auth:", 10)) {
+         if((rc = parse_auth_string(argv[i] + 10, vtpm_globals.owner_auth, WELLKNOWN_OWNER_AUTH, 1)) < 0) {
+            goto err_invalid;
+         }
+         if(rc == 1) {
+            opts->gen_owner_auth = 1;
+         }
+      }
+      else if(!strncmp(argv[i], "srk_auth:", 8)) {
+         if((rc = parse_auth_string(argv[i] + 8, vtpm_globals.srk_auth, WELLKNOWN_SRK_AUTH, 0)) != 0) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmdriver=", 10)) {
+         if(!strcmp(argv[i] + 10, "tpm_tis")) {
+            opts->tpmdriver = TPMDRV_TPM_TIS;
+         } else if(!strcmp(argv[i] + 10, "tpmfront")) {
+            opts->tpmdriver = TPMDRV_TPMFRONT;
+         } else {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmiomem=",9)) {
+         if(sscanf(argv[i] + 9, "0x%lX", &opts->tpmiomem) != 1) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmirq=",7)) {
+         if(!strcmp(argv[i] + 7, "probe")) {
+            opts->tpmirq = TPM_PROBE_IRQ;
+         } else if( sscanf(argv[i] + 7, "%u", &opts->tpmirq) != 1) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmlocality=",12)) {
+         if(sscanf(argv[i] + 12, "%u", &opts->tpmlocality) != 1 || opts->tpmlocality > 4) {
+            goto err_invalid;
+         }
+      }
+   }
+
+   switch(opts->tpmdriver) {
+      case TPMDRV_TPM_TIS:
+         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpm_tis driver\n");
+         break;
+      case TPMDRV_TPMFRONT:
+         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpmfront driver\n");
+         break;
+   }
+
+   return 0;
+err_invalid:
+   vtpmlogerror(VTPM_LOG_VTPM, "Invalid Option %s\n", argv[i]);
+   return -1;
+}
+
+
+
+static TPM_RESULT vtpmmgr_create(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_AUTH_SESSION osap = TPM_AUTH_SESSION_INIT;
+   TPM_AUTHDATA sharedsecret;
+
+   // Take ownership if TPM is unowned
+   TPMTRYRETURN(try_take_ownership());
+
+   // Generate storage key's auth
+   memset(&vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA));
+
+   TPMTRYRETURN( TPM_OSAP(
+            TPM_ET_KEYHANDLE,
+            TPM_SRK_KEYHANDLE,
+            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+            &sharedsecret,
+            &osap) );
+
+   init_storage_key(&vtpm_globals.storage_key);
+
+   //initialize the storage key
+   TPMTRYRETURN( TPM_CreateWrapKey(
+            TPM_SRK_KEYHANDLE,
+            (const TPM_AUTHDATA*)&sharedsecret,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.storage_key,
+            &osap) );
+
+   //Load Storage Key
+   TPMTRYRETURN( TPM_LoadKey(
+            TPM_SRK_KEYHANDLE,
+            &vtpm_globals.storage_key,
+            &vtpm_globals.storage_key_handle,
+            (const TPM_AUTHDATA*) &vtpm_globals.srk_auth,
+            &vtpm_globals.oiap));
+
+   //Make sure TPM has commited changes
+   TPMTRYRETURN( TPM_SaveState() );
+
+   //Create new disk image
+   TPMTRYRETURN(vtpm_storage_new_header());
+
+   goto egress;
+abort_egress:
+egress:
+   vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager\n");
+
+   //End the OSAP session
+   if(osap.AuthHandle) {
+      TPM_TerminateHandle(osap.AuthHandle);
+   }
+
+   return status;
+}
+
+TPM_RESULT vtpmmgr_init(int argc, char** argv) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   /* Default commandline options */
+   struct Opts opts = {
+      .tpmdriver = TPMDRV_TPM_TIS,
+      .tpmiomem = TPM_BASEADDR,
+      .tpmirq = 0,
+      .tpmlocality = 0,
+      .gen_owner_auth = 0,
+   };
+
+   if(parse_cmdline_opts(argc, argv, &opts) != 0) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Command line parsing failed! exiting..\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   //Setup storage system
+   if(vtpm_storage_init() != 0) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize storage subsystem!\n");
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   //Setup tpmback device
+   init_tpmback();
+
+   //Setup tpm access
+   switch(opts.tpmdriver) {
+      case TPMDRV_TPM_TIS:
+         {
+            struct tpm_chip* tpm;
+            if((tpm = init_tpm_tis(opts.tpmiomem, TPM_TIS_LOCL_INT_TO_FLAG(opts.tpmlocality), opts.tpmirq)) == NULL) {
+               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+               status = TPM_IOERROR;
+               goto abort_egress;
+            }
+            vtpm_globals.tpm_fd = tpm_tis_open(tpm);
+            tpm_tis_request_locality(tpm, opts.tpmlocality);
+         }
+         break;
+      case TPMDRV_TPMFRONT:
+         {
+            struct tpmfront_dev* tpmfront_dev;
+            if((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
+               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+               status = TPM_IOERROR;
+               goto abort_egress;
+            }
+            vtpm_globals.tpm_fd = tpmfront_open(tpmfront_dev);
+         }
+         break;
+   }
+
+   //Get the version of the tpm
+   TPMTRYRETURN(check_tpm_version());
+
+   // Blow away all stale handles left in the tpm
+   if(flush_tpm() != TPM_SUCCESS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_FlushResources failed, continuing anyway..\n");
+   }
+
+   /* Initialize the rng */
+   entropy_init(&vtpm_globals.entropy);
+   entropy_add_source(&vtpm_globals.entropy, tpm_entropy_source, NULL, 0);
+   entropy_gather(&vtpm_globals.entropy);
+   ctr_drbg_init(&vtpm_globals.ctr_drbg, entropy_func, &vtpm_globals.entropy, NULL, 0);
+   ctr_drbg_set_prediction_resistance( &vtpm_globals.ctr_drbg, CTR_DRBG_PR_OFF );
+
+   // Generate Auth for Owner
+   if(opts.gen_owner_auth) {
+      vtpmmgr_rand(vtpm_globals.owner_auth, sizeof(TPM_AUTHDATA));
+   }
+
+   // Create OIAP session for service's authorized commands
+   TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
+
+   /* Load the Manager data, if it fails create a new manager */
+   if (vtpm_storage_load_header() != TPM_SUCCESS) {
+      /* If the OIAP session was closed by an error, create a new one */
+      if(vtpm_globals.oiap.AuthHandle == 0) {
+         TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
+      }
+      vtpmloginfo(VTPM_LOG_VTPM, "Failed to read manager file. Assuming first time initialization.\n");
+      TPMTRYRETURN( vtpmmgr_create() );
+   }
+
+   goto egress;
+abort_egress:
+   vtpmmgr_shutdown();
+egress:
+   return status;
+}
+
+void vtpmmgr_shutdown(void)
+{
+   /* Cleanup resources */
+   free_TPM_KEY(&vtpm_globals.storage_key);
+
+   /* Cleanup TPM resources */
+   TPM_EvictKey(vtpm_globals.storage_key_handle);
+   TPM_TerminateHandle(vtpm_globals.oiap.AuthHandle);
+
+   /* Close tpmback */
+   shutdown_tpmback();
+
+   /* Close the storage system and blkfront */
+   vtpm_storage_shutdown();
+
+   /* Close tpmfront/tpm_tis */
+   close(vtpm_globals.tpm_fd);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
+}
diff --git a/stubdom/vtpmmgr/log.c b/stubdom/vtpmmgr/log.c
new file mode 100644
index 0000000..a82c913
--- /dev/null
+++ b/stubdom/vtpmmgr/log.c
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "tcg.h"
+
+char *module_names[] = { "",
+                                "TPM",
+                                "TPM",
+                                "VTPM",
+                                "VTPM",
+                                "TXDATA",
+                              };
+// Helper code for the consts, eg. to produce messages for error codes.
+
+typedef struct error_code_entry_t {
+  TPM_RESULT code;
+  char * code_name;
+  char * msg;
+} error_code_entry_t;
+
+static const error_code_entry_t error_msgs [] = {
+  { TPM_SUCCESS, "TPM_SUCCESS", "Successful completion of the operation" },
+  { TPM_AUTHFAIL, "TPM_AUTHFAIL", "Authentication failed" },
+  { TPM_BADINDEX, "TPM_BADINDEX", "The index to a PCR, DIR or other register is incorrect" },
+  { TPM_BAD_PARAMETER, "TPM_BAD_PARAMETER", "One or more parameter is bad" },
+  { TPM_AUDITFAILURE, "TPM_AUDITFAILURE", "An operation completed successfully but the auditing of that operation failed." },
+  { TPM_CLEAR_DISABLED, "TPM_CLEAR_DISABLED", "The clear disable flag is set and all clear operations now require physical access" },
+  { TPM_DEACTIVATED, "TPM_DEACTIVATED", "The TPM is deactivated" },
+  { TPM_DISABLED, "TPM_DISABLED", "The TPM is disabled" },
+  { TPM_DISABLED_CMD, "TPM_DISABLED_CMD", "The target command has been disabled" },
+  { TPM_FAIL, "TPM_FAIL", "The operation failed" },
+  { TPM_BAD_ORDINAL, "TPM_BAD_ORDINAL", "The ordinal was unknown or inconsistent" },
+  { TPM_INSTALL_DISABLED, "TPM_INSTALL_DISABLED", "The ability to install an owner is disabled" },
+  { TPM_INVALID_KEYHANDLE, "TPM_INVALID_KEYHANDLE", "The key handle presented was invalid" },
+  { TPM_KEYNOTFOUND, "TPM_KEYNOTFOUND", "The target key was not found" },
+  { TPM_INAPPROPRIATE_ENC, "TPM_INAPPROPRIATE_ENC", "Unacceptable encryption scheme" },
+  { TPM_MIGRATEFAIL, "TPM_MIGRATEFAIL", "Migration authorization failed" },
+  { TPM_INVALID_PCR_INFO, "TPM_INVALID_PCR_INFO", "PCR information could not be interpreted" },
+  { TPM_NOSPACE, "TPM_NOSPACE", "No room to load key." },
+  { TPM_NOSRK, "TPM_NOSRK", "There is no SRK set" },
+  { TPM_NOTSEALED_BLOB, "TPM_NOTSEALED_BLOB", "An encrypted blob is invalid or was not created by this TPM" },
+  { TPM_OWNER_SET, "TPM_OWNER_SET", "There is already an Owner" },
+  { TPM_RESOURCES, "TPM_RESOURCES", "The TPM has insufficient internal resources to perform the requested action." },
+  { TPM_SHORTRANDOM, "TPM_SHORTRANDOM", "A random string was too short" },
+  { TPM_SIZE, "TPM_SIZE", "The TPM does not have the space to perform the operation." },
+  { TPM_WRONGPCRVAL, "TPM_WRONGPCRVAL", "The named PCR value does not match the current PCR value." },
+  { TPM_BAD_PARAM_SIZE, "TPM_BAD_PARAM_SIZE", "The paramSize argument to the command has the incorrect value" },
+  { TPM_SHA_THREAD, "TPM_SHA_THREAD", "There is no existing SHA-1 thread." },
+  { TPM_SHA_ERROR, "TPM_SHA_ERROR", "The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error." },
+  { TPM_FAILEDSELFTEST, "TPM_FAILEDSELFTEST", "Self-test has failed and the TPM has shutdown." },
+  { TPM_AUTH2FAIL, "TPM_AUTH2FAIL", "The authorization for the second key in a 2 key function failed authorization" },
+  { TPM_BADTAG, "TPM_BADTAG", "The tag value sent to for a command is invalid" },
+  { TPM_IOERROR, "TPM_IOERROR", "An IO error occurred transmitting information to the TPM" },
+  { TPM_ENCRYPT_ERROR, "TPM_ENCRYPT_ERROR", "The encryption process had a problem." },
+  { TPM_DECRYPT_ERROR, "TPM_DECRYPT_ERROR", "The decryption process did not complete." },
+  { TPM_INVALID_AUTHHANDLE, "TPM_INVALID_AUTHHANDLE", "An invalid handle was used." },
+  { TPM_NO_ENDORSEMENT, "TPM_NO_ENDORSEMENT", "The TPM does not a EK installed" },
+  { TPM_INVALID_KEYUSAGE, "TPM_INVALID_KEYUSAGE", "The usage of a key is not allowed" },
+  { TPM_WRONG_ENTITYTYPE, "TPM_WRONG_ENTITYTYPE", "The submitted entity type is not allowed" },
+  { TPM_INVALID_POSTINIT, "TPM_INVALID_POSTINIT", "The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup" },
+  { TPM_INAPPROPRIATE_SIG, "TPM_INAPPROPRIATE_SIG", "Signed data cannot include additional DER information" },
+  { TPM_BAD_KEY_PROPERTY, "TPM_BAD_KEY_PROPERTY", "The key properties in TPM_KEY_PARMs are not supported by this TPM" },
+
+  { TPM_BAD_MIGRATION, "TPM_BAD_MIGRATION", "The migration properties of this key are incorrect." },
+  { TPM_BAD_SCHEME, "TPM_BAD_SCHEME", "The signature or encryption scheme for this key is incorrect or not permitted in this situation." },
+  { TPM_BAD_DATASIZE, "TPM_BAD_DATASIZE", "The size of the data (or blob) parameter is bad or inconsistent with the referenced key" },
+  { TPM_BAD_MODE, "TPM_BAD_MODE", "A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob." },
+  { TPM_BAD_PRESENCE, "TPM_BAD_PRESENCE", "Either the physicalPresence or physicalPresenceLock bits have the wrong value" },
+  { TPM_BAD_VERSION, "TPM_BAD_VERSION", "The TPM cannot perform this version of the capability" },
+  { TPM_NO_WRAP_TRANSPORT, "TPM_NO_WRAP_TRANSPORT", "The TPM does not allow for wrapped transport sessions" },
+  { TPM_AUDITFAIL_UNSUCCESSFUL, "TPM_AUDITFAIL_UNSUCCESSFUL", "TPM audit construction failed and the underlying command was returning a failure code also" },
+  { TPM_AUDITFAIL_SUCCESSFUL, "TPM_AUDITFAIL_SUCCESSFUL", "TPM audit construction failed and the underlying command was returning success" },
+  { TPM_NOTRESETABLE, "TPM_NOTRESETABLE", "Attempt to reset a PCR register that does not have the resettable attribute" },
+  { TPM_NOTLOCAL, "TPM_NOTLOCAL", "Attempt to reset a PCR register that requires locality and locality modifier not part of command transport" },
+  { TPM_BAD_TYPE, "TPM_BAD_TYPE", "Make identity blob not properly typed" },
+  { TPM_INVALID_RESOURCE, "TPM_INVALID_RESOURCE", "When saving context identified resource type does not match actual resource" },
+  { TPM_NOTFIPS, "TPM_NOTFIPS", "The TPM is attempting to execute a command only available when in FIPS mode" },
+  { TPM_INVALID_FAMILY, "TPM_INVALID_FAMILY", "The command is attempting to use an invalid family ID" },
+  { TPM_NO_NV_PERMISSION, "TPM_NO_NV_PERMISSION", "The permission to manipulate the NV storage is not available" },
+  { TPM_REQUIRES_SIGN, "TPM_REQUIRES_SIGN", "The operation requires a signed command" },
+  { TPM_KEY_NOTSUPPORTED, "TPM_KEY_NOTSUPPORTED", "Wrong operation to load an NV key" },
+  { TPM_AUTH_CONFLICT, "TPM_AUTH_CONFLICT", "NV_LoadKey blob requires both owner and blob authorization" },
+  { TPM_AREA_LOCKED, "TPM_AREA_LOCKED", "The NV area is locked and not writtable" },
+  { TPM_BAD_LOCALITY, "TPM_BAD_LOCALITY", "The locality is incorrect for the attempted operation" },
+  { TPM_READ_ONLY, "TPM_READ_ONLY", "The NV area is read only and can't be written to" },
+  { TPM_PER_NOWRITE, "TPM_PER_NOWRITE", "There is no protection on the write to the NV area" },
+  { TPM_FAMILYCOUNT, "TPM_FAMILYCOUNT", "The family count value does not match" },
+  { TPM_WRITE_LOCKED, "TPM_WRITE_LOCKED", "The NV area has already been written to" },
+  { TPM_BAD_ATTRIBUTES, "TPM_BAD_ATTRIBUTES", "The NV area attributes conflict" },
+  { TPM_INVALID_STRUCTURE, "TPM_INVALID_STRUCTURE", "The structure tag and version are invalid or inconsistent" },
+  { TPM_KEY_OWNER_CONTROL, "TPM_KEY_OWNER_CONTROL", "The key is under control of the TPM Owner and can only be evicted by the TPM Owner." },
+  { TPM_BAD_COUNTER, "TPM_BAD_COUNTER", "The counter handle is incorrect" },
+  { TPM_NOT_FULLWRITE, "TPM_NOT_FULLWRITE", "The write is not a complete write of the area" },
+  { TPM_CONTEXT_GAP, "TPM_CONTEXT_GAP", "The gap between saved context counts is too large" },
+  { TPM_MAXNVWRITES, "TPM_MAXNVWRITES", "The maximum number of NV writes without an owner has been exceeded" },
+  { TPM_NOOPERATOR, "TPM_NOOPERATOR", "No operator authorization value is set" },
+  { TPM_RESOURCEMISSING, "TPM_RESOURCEMISSING", "The resource pointed to by context is not loaded" },
+  { TPM_DELEGATE_LOCK, "TPM_DELEGATE_LOCK", "The delegate administration is locked" },
+  { TPM_DELEGATE_FAMILY, "TPM_DELEGATE_FAMILY", "Attempt to manage a family other then the delegated family" },
+  { TPM_DELEGATE_ADMIN, "TPM_DELEGATE_ADMIN", "Delegation table management not enabled" },
+  { TPM_TRANSPORT_EXCLUSIVE, "TPM_TRANSPORT_EXCLUSIVE", "There was a command executed outside of an exclusive transport session" },
+};
+
+
+// helper function for the error codes:
+const char* tpm_get_error_name (TPM_RESULT code) {
+  // just do a linear scan for now
+  unsigned i;
+  for (i = 0; i < sizeof(error_msgs)/sizeof(error_msgs[0]); i++)
+    if (code == error_msgs[i].code)
+      return error_msgs[i].code_name;
+
+    return("Unknown Error Code");
+}
diff --git a/stubdom/vtpmmgr/log.h b/stubdom/vtpmmgr/log.h
new file mode 100644
index 0000000..5c7abf5
--- /dev/null
+++ b/stubdom/vtpmmgr/log.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __VTPM_LOG_H__
+#define __VTPM_LOG_H__
+
+#include <stdint.h>             // for uint32_t
+#include <stddef.h>             // for pointer NULL
+#include <stdio.h>
+#include "tcg.h"
+
+// =========================== LOGGING ==============================
+
+// the logging module numbers
+#define VTPM_LOG_TPM         1
+#define VTPM_LOG_TPM_DEEP    2
+#define VTPM_LOG_VTPM        3
+#define VTPM_LOG_VTPM_DEEP   4
+#define VTPM_LOG_TXDATA      5
+
+extern char *module_names[];
+
+// Default to standard logging
+#ifndef LOGGING_MODULES
+#define LOGGING_MODULES (BITMASK(VTPM_LOG_VTPM)|BITMASK(VTPM_LOG_TPM))
+#endif
+
+// bit-access macros
+#define BITMASK(idx)      ( 1U << (idx) )
+#define GETBIT(num,idx)   ( ((num) & BITMASK(idx)) >> idx )
+#define SETBIT(num,idx)   (num) |= BITMASK(idx)
+#define CLEARBIT(num,idx) (num) &= ( ~ BITMASK(idx) )
+
+#define vtpmloginfo(module, fmt, args...) \
+  if (GETBIT (LOGGING_MODULES, module) == 1) {				\
+    fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); \
+  }
+
+#define vtpmloginfomore(module, fmt, args...) \
+  if (GETBIT (LOGGING_MODULES, module) == 1) {			      \
+    fprintf (stdout, fmt,##args);				      \
+  }
+
+#define vtpmlogerror(module, fmt, args...) \
+  fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
+
+//typedef UINT32 tpm_size_t;
+
+// helper function for the error codes:
+const char* tpm_get_error_name (TPM_RESULT code);
+
+#endif // _VTPM_LOG_H_
diff --git a/stubdom/vtpmmgr/marshal.h b/stubdom/vtpmmgr/marshal.h
new file mode 100644
index 0000000..77d32f0
--- /dev/null
+++ b/stubdom/vtpmmgr/marshal.h
@@ -0,0 +1,528 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef MARSHAL_H
+#define MARSHAL_H
+
+#include <stdlib.h>
+#include <mini-os/byteorder.h>
+#include <mini-os/endian.h>
+#include "tcg.h"
+
+typedef enum UnpackPtr {
+   UNPACK_ALIAS,
+   UNPACK_ALLOC
+} UnpackPtr;
+
+inline BYTE* pack_BYTE(BYTE* ptr, BYTE t) {
+   ptr[0] = t;
+   return ++ptr;
+}
+
+inline BYTE* unpack_BYTE(BYTE* ptr, BYTE* t) {
+   t[0] = ptr[0];
+   return ++ptr;
+}
+
+#define pack_BOOL(p, t) pack_BYTE(p, t)
+#define unpack_BOOL(p, t) unpack_BYTE(p, t)
+
+inline BYTE* pack_UINT16(BYTE* ptr, UINT16 t) {
+   BYTE* b = (BYTE*)&t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   ptr[0] = b[1];
+   ptr[1] = b[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   ptr[0] = b[0];
+   ptr[1] = b[1];
+#endif
+   return ptr + sizeof(UINT16);
+}
+
+inline BYTE* unpack_UINT16(BYTE* ptr, UINT16* t) {
+   BYTE* b = (BYTE*)t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   b[0] = ptr[1];
+   b[1] = ptr[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   b[0] = ptr[0];
+   b[1] = ptr[1];
+#endif
+   return ptr + sizeof(UINT16);
+}
+
+inline BYTE* pack_UINT32(BYTE* ptr, UINT32 t) {
+   BYTE* b = (BYTE*)&t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   ptr[3] = b[0];
+   ptr[2] = b[1];
+   ptr[1] = b[2];
+   ptr[0] = b[3];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   ptr[0] = b[0];
+   ptr[1] = b[1];
+   ptr[2] = b[2];
+   ptr[3] = b[3];
+#endif
+   return ptr + sizeof(UINT32);
+}
+
+inline BYTE* unpack_UINT32(BYTE* ptr, UINT32* t) {
+   BYTE* b = (BYTE*)t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   b[0] = ptr[3];
+   b[1] = ptr[2];
+   b[2] = ptr[1];
+   b[3] = ptr[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   b[0] = ptr[0];
+   b[1] = ptr[1];
+   b[2] = ptr[2];
+   b[3] = ptr[3];
+#endif
+   return ptr + sizeof(UINT32);
+}
+
+#define pack_TPM_RESULT(p, t) pack_UINT32(p, t)
+#define pack_TPM_PCRINDEX(p, t) pack_UINT32(p, t)
+#define pack_TPM_DIRINDEX(p, t) pack_UINT32(p, t)
+#define pack_TPM_HANDLE(p, t) pack_UINT32(p, t)
+#define pack_TPM_AUTHHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_HASHHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_HMACHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_ENCHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TPM_KEY_HANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_ENTITYHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TPM_RESOURCE_TYPE(p, t) pack_UINT32(p, t)
+#define pack_TPM_COMMAND_CODE(p, t) pack_UINT32(p, t)
+#define pack_TPM_PROTOCOL_ID(p, t) pack_UINT16(p, t)
+#define pack_TPM_AUTH_DATA_USAGE(p, t) pack_BYTE(p, t)
+#define pack_TPM_ENTITY_TYPE(p, t) pack_UINT16(p, t)
+#define pack_TPM_ALGORITHM_ID(p, t) pack_UINT32(p, t)
+#define pack_TPM_KEY_USAGE(p, t) pack_UINT16(p, t)
+#define pack_TPM_STARTUP_TYPE(p, t) pack_UINT16(p, t)
+#define pack_TPM_CAPABILITY_AREA(p, t) pack_UINT32(p, t)
+#define pack_TPM_ENC_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_SIG_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_MIGRATE_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_PHYSICAL_PRESENCE(p, t) pack_UINT16(p, t)
+#define pack_TPM_KEY_FLAGS(p, t) pack_UINT32(p, t)
+
+#define unpack_TPM_RESULT(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_PCRINDEX(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_DIRINDEX(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_HANDLE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_AUTHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_HASHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_HMACHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_ENCHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TPM_KEY_HANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_ENTITYHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TPM_RESOURCE_TYPE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_COMMAND_CODE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_PROTOCOL_ID(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_AUTH_DATA_USAGE(p, t) unpack_BYTE(p, t)
+#define unpack_TPM_ENTITY_TYPE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_ALGORITHM_ID(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_KEY_USAGE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_STARTUP_TYPE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_CAPABILITY_AREA(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_ENC_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_SIG_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_MIGRATE_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_PHYSICAL_PRESENCE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_KEY_FLAGS(p, t) unpack_UINT32(p, t)
+
+#define pack_TPM_AUTH_HANDLE(p, t) pack_UINT32(p, t);
+#define pack_TCS_CONTEXT_HANDLE(p, t) pack_UINT32(p, t);
+#define pack_TCS_KEY_HANDLE(p, t) pack_UINT32(p, t);
+
+#define unpack_TPM_AUTH_HANDLE(p, t) unpack_UINT32(p, t);
+#define unpack_TCS_CONTEXT_HANDLE(p, t) unpack_UINT32(p, t);
+#define unpack_TCS_KEY_HANDLE(p, t) unpack_UINT32(p, t);
+
+inline BYTE* pack_BUFFER(BYTE* ptr, const BYTE* buf, UINT32 size) {
+   memcpy(ptr, buf, size);
+   return ptr + size;
+}
+
+inline BYTE* unpack_BUFFER(BYTE* ptr, BYTE* buf, UINT32 size) {
+   memcpy(buf, ptr, size);
+   return ptr + size;
+}
+
+inline BYTE* unpack_ALIAS(BYTE* ptr, BYTE** buf, UINT32 size) {
+   *buf = ptr;
+   return ptr + size;
+}
+
+inline BYTE* unpack_ALLOC(BYTE* ptr, BYTE** buf, UINT32 size) {
+   if(size) {
+      *buf = malloc(size);
+      memcpy(*buf, ptr, size);
+   } else {
+      *buf = NULL;
+   }
+   return ptr + size;
+}
+
+inline BYTE* unpack_PTR(BYTE* ptr, BYTE** buf, UINT32 size, UnpackPtr alloc) {
+   if(alloc == UNPACK_ALLOC) {
+      return unpack_ALLOC(ptr, buf, size);
+   } else {
+      return unpack_ALIAS(ptr, buf, size);
+   }
+}
+
+inline BYTE* pack_TPM_AUTHDATA(BYTE* ptr, const TPM_AUTHDATA* d) {
+   return pack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_AUTHDATA(BYTE* ptr, TPM_AUTHDATA* d) {
+   return unpack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
+}
+
+#define pack_TPM_SECRET(p, t) pack_TPM_AUTHDATA(p, t)
+#define pack_TPM_ENCAUTH(p, t) pack_TPM_AUTHDATA(p, t)
+#define pack_TPM_PAYLOAD_TYPE(p, t) pack_BYTE(p, t)
+#define pack_TPM_TAG(p, t) pack_UINT16(p, t)
+#define pack_TPM_STRUCTURE_TAG(p, t) pack_UINT16(p, t)
+
+#define unpack_TPM_SECRET(p, t) unpack_TPM_AUTHDATA(p, t)
+#define unpack_TPM_ENCAUTH(p, t) unpack_TPM_AUTHDATA(p, t)
+#define unpack_TPM_PAYLOAD_TYPE(p, t) unpack_BYTE(p, t)
+#define unpack_TPM_TAG(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_STRUCTURE_TAG(p, t) unpack_UINT16(p, t)
+
+inline BYTE* pack_TPM_VERSION(BYTE* ptr, const TPM_VERSION* t) {
+   ptr[0] = t->major;
+   ptr[1] = t->minor;
+   ptr[2] = t->revMajor;
+   ptr[3] = t->revMinor;
+   return ptr + 4;
+}
+
+inline BYTE* unpack_TPM_VERSION(BYTE* ptr, TPM_VERSION* t) {
+   t->major = ptr[0];
+   t->minor = ptr[1];
+   t->revMajor = ptr[2];
+   t->revMinor = ptr[3];
+   return ptr + 4;
+}
+
+inline BYTE* pack_TPM_CAP_VERSION_INFO(BYTE* ptr, const TPM_CAP_VERSION_INFO* v) {
+   ptr = pack_TPM_STRUCTURE_TAG(ptr, v->tag);
+   ptr = pack_TPM_VERSION(ptr, &v->version);
+   ptr = pack_UINT16(ptr, v->specLevel);
+   ptr = pack_BYTE(ptr, v->errataRev);
+   ptr = pack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));
+   ptr = pack_UINT16(ptr, v->vendorSpecificSize);
+   ptr = pack_BUFFER(ptr, v->vendorSpecific, v->vendorSpecificSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_CAP_VERSION_INFO(BYTE* ptr, TPM_CAP_VERSION_INFO* v, UnpackPtr alloc) {
+   ptr = unpack_TPM_STRUCTURE_TAG(ptr, &v->tag);
+   ptr = unpack_TPM_VERSION(ptr, &v->version);
+   ptr = unpack_UINT16(ptr, &v->specLevel);
+   ptr = unpack_BYTE(ptr, &v->errataRev);
+   ptr = unpack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));
+   ptr = unpack_UINT16(ptr, &v->vendorSpecificSize);
+   ptr = unpack_PTR(ptr, &v->vendorSpecific, v->vendorSpecificSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_DIGEST(BYTE* ptr, const TPM_DIGEST* d) {
+   return pack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_DIGEST(BYTE* ptr, TPM_DIGEST* d) {
+   return unpack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
+}
+
+#define pack_TPM_PCRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_PCRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_COMPOSITE_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_COMPOSITE_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_DIRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_DIRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_HMAC(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_HMAC(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_CHOSENID_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_CHOSENID_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+inline BYTE* pack_TPM_NONCE(BYTE* ptr, const TPM_NONCE* n) {
+   return pack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_NONCE(BYTE* ptr, TPM_NONCE* n) {
+   return unpack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* pack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, const TPM_SYMMETRIC_KEY_PARMS* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_UINT32(ptr, k->blockSize);
+   ptr = pack_UINT32(ptr, k->ivSize);
+   return pack_BUFFER(ptr, k->IV, k->ivSize);
+}
+
+inline BYTE* unpack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, TPM_SYMMETRIC_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_UINT32(ptr, &k->blockSize);
+   ptr = unpack_UINT32(ptr, &k->ivSize);
+   return unpack_PTR(ptr, &k->IV, k->ivSize, alloc);
+}
+
+inline BYTE* pack_TPM_RSA_KEY_PARMS(BYTE* ptr, const TPM_RSA_KEY_PARMS* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_UINT32(ptr, k->numPrimes);
+   ptr = pack_UINT32(ptr, k->exponentSize);
+   return pack_BUFFER(ptr, k->exponent, k->exponentSize);
+}
+
+inline BYTE* unpack_TPM_RSA_KEY_PARMS(BYTE* ptr, TPM_RSA_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_UINT32(ptr, &k->numPrimes);
+   ptr = unpack_UINT32(ptr, &k->exponentSize);
+   return unpack_PTR(ptr, &k->exponent, k->exponentSize, alloc);
+}
+
+inline BYTE* pack_TPM_KEY_PARMS(BYTE* ptr, const TPM_KEY_PARMS* k) {
+   ptr = pack_TPM_ALGORITHM_ID(ptr, k->algorithmID);
+   ptr = pack_TPM_ENC_SCHEME(ptr, k->encScheme);
+   ptr = pack_TPM_SIG_SCHEME(ptr, k->sigScheme);
+   ptr = pack_UINT32(ptr, k->parmSize);
+
+   if(k->parmSize) {
+      switch(k->algorithmID) {
+         case TPM_ALG_RSA:
+            return pack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa);
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            return pack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym);
+      }
+   }
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_KEY_PARMS(BYTE* ptr, TPM_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_ALGORITHM_ID(ptr, &k->algorithmID);
+   ptr = unpack_TPM_ENC_SCHEME(ptr, &k->encScheme);
+   ptr = unpack_TPM_SIG_SCHEME(ptr, &k->sigScheme);
+   ptr = unpack_UINT32(ptr, &k->parmSize);
+
+   if(k->parmSize) {
+      switch(k->algorithmID) {
+         case TPM_ALG_RSA:
+            return unpack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa, alloc);
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            return unpack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym, alloc);
+      }
+   }
+   return ptr;
+}
+
+inline BYTE* pack_TPM_STORE_PUBKEY(BYTE* ptr, const TPM_STORE_PUBKEY* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_BUFFER(ptr, k->key, k->keyLength);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_STORE_PUBKEY(BYTE* ptr, TPM_STORE_PUBKEY* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_PTR(ptr, &k->key, k->keyLength, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PUBKEY(BYTE* ptr, const TPM_PUBKEY* k) {
+   ptr = pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
+   return pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
+}
+
+inline BYTE* unpack_TPM_PUBKEY(BYTE* ptr, TPM_PUBKEY* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
+   return unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
+}
+
+inline BYTE* pack_TPM_PCR_SELECTION(BYTE* ptr, const TPM_PCR_SELECTION* p) {
+   ptr = pack_UINT16(ptr, p->sizeOfSelect);
+   ptr = pack_BUFFER(ptr, p->pcrSelect, p->sizeOfSelect);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_SELECTION(BYTE* ptr, TPM_PCR_SELECTION* p, UnpackPtr alloc) {
+   ptr = unpack_UINT16(ptr, &p->sizeOfSelect);
+   ptr = unpack_PTR(ptr, &p->pcrSelect, p->sizeOfSelect, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PCR_INFO(BYTE* ptr, const TPM_PCR_INFO* p) {
+   ptr = pack_TPM_PCR_SELECTION(ptr, &p->pcrSelection);
+   ptr = pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
+   ptr = pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_INFO(BYTE* ptr, TPM_PCR_INFO* p, UnpackPtr alloc) {
+   ptr = unpack_TPM_PCR_SELECTION(ptr, &p->pcrSelection, alloc);
+   ptr = unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
+   ptr = unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PCR_COMPOSITE(BYTE* ptr, const TPM_PCR_COMPOSITE* p) {
+   ptr = pack_TPM_PCR_SELECTION(ptr, &p->select);
+   ptr = pack_UINT32(ptr, p->valueSize);
+   ptr = pack_BUFFER(ptr, (const BYTE*)p->pcrValue, p->valueSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_COMPOSITE(BYTE* ptr, TPM_PCR_COMPOSITE* p, UnpackPtr alloc) {
+   ptr = unpack_TPM_PCR_SELECTION(ptr, &p->select, alloc);
+   ptr = unpack_UINT32(ptr, &p->valueSize);
+   ptr = unpack_PTR(ptr, (BYTE**)&p->pcrValue, p->valueSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_KEY(BYTE* ptr, const TPM_KEY* k) {
+   ptr = pack_TPM_VERSION(ptr, &k->ver);
+   ptr = pack_TPM_KEY_USAGE(ptr, k->keyUsage);
+   ptr = pack_TPM_KEY_FLAGS(ptr, k->keyFlags);
+   ptr = pack_TPM_AUTH_DATA_USAGE(ptr, k->authDataUsage);
+   ptr = pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
+   ptr = pack_UINT32(ptr, k->PCRInfoSize);
+   if(k->PCRInfoSize) {
+      ptr = pack_TPM_PCR_INFO(ptr, &k->PCRInfo);
+   }
+   ptr = pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
+   ptr = pack_UINT32(ptr, k->encDataSize);
+   return pack_BUFFER(ptr, k->encData, k->encDataSize);
+}
+
+inline BYTE* unpack_TPM_KEY(BYTE* ptr, TPM_KEY* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &k->ver);
+   ptr = unpack_TPM_KEY_USAGE(ptr, &k->keyUsage);
+   ptr = unpack_TPM_KEY_FLAGS(ptr, &k->keyFlags);
+   ptr = unpack_TPM_AUTH_DATA_USAGE(ptr, &k->authDataUsage);
+   ptr = unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
+   ptr = unpack_UINT32(ptr, &k->PCRInfoSize);
+   if(k->PCRInfoSize) {
+      ptr = unpack_TPM_PCR_INFO(ptr, &k->PCRInfo, alloc);
+   }
+   ptr = unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
+   ptr = unpack_UINT32(ptr, &k->encDataSize);
+   return unpack_PTR(ptr, &k->encData, k->encDataSize, alloc);
+}
+
+inline BYTE* pack_TPM_BOUND_DATA(BYTE* ptr, const TPM_BOUND_DATA* b, UINT32 payloadSize) {
+   ptr = pack_TPM_VERSION(ptr, &b->ver);
+   ptr = pack_TPM_PAYLOAD_TYPE(ptr, b->payload);
+   return pack_BUFFER(ptr, b->payloadData, payloadSize);
+}
+
+inline BYTE* unpack_TPM_BOUND_DATA(BYTE* ptr, TPM_BOUND_DATA* b, UINT32 payloadSize, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &b->ver);
+   ptr = unpack_TPM_PAYLOAD_TYPE(ptr, &b->payload);
+   return unpack_PTR(ptr, &b->payloadData, payloadSize, alloc);
+}
+
+inline BYTE* pack_TPM_STORED_DATA(BYTE* ptr, const TPM_STORED_DATA* d) {
+   ptr = pack_TPM_VERSION(ptr, &d->ver);
+   ptr = pack_UINT32(ptr, d->sealInfoSize);
+   if(d->sealInfoSize) {
+      ptr = pack_TPM_PCR_INFO(ptr, &d->sealInfo);
+   }
+   ptr = pack_UINT32(ptr, d->encDataSize);
+   ptr = pack_BUFFER(ptr, d->encData, d->encDataSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_STORED_DATA(BYTE* ptr, TPM_STORED_DATA* d, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &d->ver);
+   ptr = unpack_UINT32(ptr, &d->sealInfoSize);
+   if(d->sealInfoSize) {
+      ptr = unpack_TPM_PCR_INFO(ptr, &d->sealInfo, alloc);
+   }
+   ptr = unpack_UINT32(ptr, &d->encDataSize);
+   ptr = unpack_PTR(ptr, &d->encData, d->encDataSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_AUTH_SESSION(BYTE* ptr, const TPM_AUTH_SESSION* auth) {
+   ptr = pack_TPM_AUTH_HANDLE(ptr, auth->AuthHandle);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+   ptr = pack_TPM_AUTHDATA(ptr, &auth->HMAC);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_AUTH_SESSION(BYTE* ptr, TPM_AUTH_SESSION* auth) {
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = unpack_BOOL(ptr, &auth->fContinueAuthSession);
+   ptr = unpack_TPM_AUTHDATA(ptr, &auth->HMAC);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_RQU_HEADER(BYTE* ptr,
+      TPM_TAG tag,
+      UINT32 size,
+      TPM_COMMAND_CODE ord) {
+   ptr = pack_UINT16(ptr, tag);
+   ptr = pack_UINT32(ptr, size);
+   return pack_UINT32(ptr, ord);
+}
+
+inline BYTE* unpack_TPM_RQU_HEADER(BYTE* ptr,
+      TPM_TAG* tag,
+      UINT32* size,
+      TPM_COMMAND_CODE* ord) {
+   ptr = unpack_UINT16(ptr, tag);
+   ptr = unpack_UINT32(ptr, size);
+   ptr = unpack_UINT32(ptr, ord);
+   return ptr;
+}
+
+#define pack_TPM_RSP_HEADER(p, t, s, r) pack_TPM_RQU_HEADER(p, t, s, r);
+#define unpack_TPM_RSP_HEADER(p, t, s, r) unpack_TPM_RQU_HEADER(p, t, s, r);
+
+#endif
diff --git a/stubdom/vtpmmgr/minios.cfg b/stubdom/vtpmmgr/minios.cfg
new file mode 100644
index 0000000..3fb383d
--- /dev/null
+++ b/stubdom/vtpmmgr/minios.cfg
@@ -0,0 +1,14 @@
+CONFIG_TPMFRONT=y
+CONFIG_TPM_TIS=y
+CONFIG_TPMBACK=y
+CONFIG_START_NETWORK=n
+CONFIG_TEST=n
+CONFIG_PCIFRONT=n
+CONFIG_BLKFRONT=y
+CONFIG_NETFRONT=n
+CONFIG_FBFRONT=n
+CONFIG_KBDFRONT=n
+CONFIG_CONSFRONT=n
+CONFIG_XENBUS=y
+CONFIG_LWIP=n
+CONFIG_XC=n
diff --git a/stubdom/vtpmmgr/tcg.h b/stubdom/vtpmmgr/tcg.h
new file mode 100644
index 0000000..7687eae
--- /dev/null
+++ b/stubdom/vtpmmgr/tcg.h
@@ -0,0 +1,707 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005 Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __TCG_H__
+#define __TCG_H__
+
+#include <stdlib.h>
+#include <stdint.h>
+
+// **************************** CONSTANTS *********************************
+
+// BOOL values
+#define TRUE 0x01
+#define FALSE 0x00
+
+#define TCPA_MAX_BUFFER_LENGTH 0x2000
+
+//
+// TPM_COMMAND_CODE values
+#define TPM_PROTECTED_ORDINAL 0x00000000UL
+#define TPM_UNPROTECTED_ORDINAL 0x80000000UL
+#define TPM_CONNECTION_ORDINAL 0x40000000UL
+#define TPM_VENDOR_ORDINAL 0x20000000UL
+
+#define TPM_ORD_OIAP                     (10UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OSAP                     (11UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuth               (12UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_TakeOwnership            (13UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthAsymStart      (14UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthAsymFinish     (15UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthOwner          (16UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Extend                   (20UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PcrRead                  (21UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Quote                    (22UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Seal                     (23UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Unseal                   (24UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DirWriteAuth             (25UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DirRead                  (26UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_UnBind                   (30UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateWrapKey            (31UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadKey                  (32UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetPubKey                (33UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_EvictKey                 (34UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateMigrationBlob      (40UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReWrapKey                (41UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ConvertMigrationBlob     (42UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_AuthorizeMigrationKey    (43UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateMaintenanceArchive (44UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadMaintenanceArchive   (45UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_KillMaintenanceFeature   (46UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadManuMaintPub         (47UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadManuMaintPub         (48UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CertifyKey               (50UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Sign                     (60UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetRandom                (70UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_StirRandom               (71UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SelfTestFull             (80UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SelfTestStartup          (81UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CertifySelfTest          (82UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ContinueSelfTest         (83UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetTestResult            (84UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Reset                    (90UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerClear               (91UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisableOwnerClear        (92UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ForceClear               (93UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisableForceClear        (94UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapabilitySigned      (100UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapability            (101UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapabilityOwner       (102UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerSetDisable          (110UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalEnable           (111UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalDisable          (112UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetOwnerInstall          (113UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalSetDeactivated   (114UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetTempDeactivated       (115UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateEndorsementKeyPair (120UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_MakeIdentity             (121UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ActivateIdentity         (122UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadPubek                (124UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerReadPubek           (125UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisablePubekRead         (126UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetAuditEvent            (130UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetAuditEventSigned      (131UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetOrdinalAuditStatus    (140UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetOrdinalAuditStatus    (141UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Terminate_Handle         (150UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Init                     (151UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveState                (152UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Startup                  (153UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetRedirection           (154UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Start                (160UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Update               (161UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Complete             (162UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1CompleteExtend       (163UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_FieldUpgrade             (170UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveKeyContext           (180UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadKeyContext           (181UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveAuthContext          (182UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadAuthContext          (183UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveContext                      (184UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadContext                      (185UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_FlushSpecific                    (186UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PCR_Reset                        (200UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_DefineSpace                   (204UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_WriteValue                    (205UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_WriteValueAuth                (206UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_ReadValue                     (207UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_ReadValueAuth                 (208UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_UpdateVerification      (209UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_Manage                  (210UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_CreateKeyDelegation     (212UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_CreateOwnerDelegation   (213UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_VerifyDelegation        (214UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_LoadOwnerDelegation     (216UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_ReadAuth                (217UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_ReadTable               (219UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateCounter                    (220UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_IncrementCounter                 (221UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadCounter                      (222UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseCounter                   (223UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseCounterOwner              (224UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_EstablishTransport               (230UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ExecuteTransport                 (231UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseTransportSigned           (232UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetTicks                         (241UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_TickStampBlob                    (242UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_MAX                              (256UL + TPM_PROTECTED_ORDINAL)
+
+#define TSC_ORD_PhysicalPresence         (10UL + TPM_CONNECTION_ORDINAL)
+
+
+
+//
+// TPM_RESULT values
+//
+// just put in the whole table from spec 1.2
+
+#define TPM_BASE   0x0 // The start of TPM return codes
+#define TPM_VENDOR_ERROR 0x00000400 // Mask to indicate that the error code is vendor specific for vendor specific commands
+#define TPM_NON_FATAL  0x00000800 // Mask to indicate that the error code is a non-fatal failure.
+
+#define TPM_SUCCESS   TPM_BASE // Successful completion of the operation
+#define TPM_AUTHFAIL      TPM_BASE + 1 // Authentication failed
+#define TPM_BADINDEX      TPM_BASE + 2 // The index to a PCR, DIR or other register is incorrect
+#define TPM_BAD_PARAMETER     TPM_BASE + 3 // One or more parameter is bad
+#define TPM_AUDITFAILURE     TPM_BASE + 4 // An operation completed successfully but the auditing of that operation failed.
+#define TPM_CLEAR_DISABLED     TPM_BASE + 5 // The clear disable flag is set and all clear operations now require physical access
+#define TPM_DEACTIVATED     TPM_BASE + 6 // The TPM is deactivated
+#define TPM_DISABLED      TPM_BASE + 7 // The TPM is disabled
+#define TPM_DISABLED_CMD     TPM_BASE + 8 // The target command has been disabled
+#define TPM_FAIL       TPM_BASE + 9 // The operation failed
+#define TPM_BAD_ORDINAL     TPM_BASE + 10 // The ordinal was unknown or inconsistent
+#define TPM_INSTALL_DISABLED   TPM_BASE + 11 // The ability to install an owner is disabled
+#define TPM_INVALID_KEYHANDLE  TPM_BASE + 12 // The key handle presented was invalid
+#define TPM_KEYNOTFOUND     TPM_BASE + 13 // The target key was not found
+#define TPM_INAPPROPRIATE_ENC  TPM_BASE + 14 // Unacceptable encryption scheme
+#define TPM_MIGRATEFAIL     TPM_BASE + 15 // Migration authorization failed
+#define TPM_INVALID_PCR_INFO   TPM_BASE + 16 // PCR information could not be interpreted
+#define TPM_NOSPACE      TPM_BASE + 17 // No room to load key.
+#define TPM_NOSRK       TPM_BASE + 18 // There is no SRK set
+#define TPM_NOTSEALED_BLOB     TPM_BASE + 19 // An encrypted blob is invalid or was not created by this TPM
+#define TPM_OWNER_SET      TPM_BASE + 20 // There is already an Owner
+#define TPM_RESOURCES      TPM_BASE + 21 // The TPM has insufficient internal resources to perform the requested action.
+#define TPM_SHORTRANDOM     TPM_BASE + 22 // A random string was too short
+#define TPM_SIZE       TPM_BASE + 23 // The TPM does not have the space to perform the operation.
+#define TPM_WRONGPCRVAL     TPM_BASE + 24 // The named PCR value does not match the current PCR value.
+#define TPM_BAD_PARAM_SIZE     TPM_BASE + 25 // The paramSize argument to the command has the incorrect value
+#define TPM_SHA_THREAD      TPM_BASE + 26 // There is no existing SHA-1 thread.
+#define TPM_SHA_ERROR      TPM_BASE + 27 // The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error.
+#define TPM_FAILEDSELFTEST     TPM_BASE + 28 // Self-test has failed and the TPM has shutdown.
+#define TPM_AUTH2FAIL      TPM_BASE + 29 // The authorization for the second key in a 2 key function failed authorization
+#define TPM_BADTAG       TPM_BASE + 30 // The tag value sent to for a command is invalid
+#define TPM_IOERROR      TPM_BASE + 31 // An IO error occurred transmitting information to the TPM
+#define TPM_ENCRYPT_ERROR     TPM_BASE + 32 // The encryption process had a problem.
+#define TPM_DECRYPT_ERROR     TPM_BASE + 33 // The decryption process did not complete.
+#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 // An invalid handle was used.
+#define TPM_NO_ENDORSEMENT     TPM_BASE + 35 // The TPM does not a EK installed
+#define TPM_INVALID_KEYUSAGE   TPM_BASE + 36 // The usage of a key is not allowed
+#define TPM_WRONG_ENTITYTYPE   TPM_BASE + 37 // The submitted entity type is not allowed
+#define TPM_INVALID_POSTINIT   TPM_BASE + 38 // The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup
+#define TPM_INAPPROPRIATE_SIG  TPM_BASE + 39 // Signed data cannot include additional DER information
+#define TPM_BAD_KEY_PROPERTY   TPM_BASE + 40 // The key properties in TPM_KEY_PARMs are not supported by this TPM
+
+#define TPM_BAD_MIGRATION      TPM_BASE + 41 // The migration properties of this key are incorrect.
+#define TPM_BAD_SCHEME       TPM_BASE + 42 // The signature or encryption scheme for this key is incorrect or not permitted in this situation.
+#define TPM_BAD_DATASIZE      TPM_BASE + 43 // The size of the data (or blob) parameter is bad or inconsistent with the referenced key
+#define TPM_BAD_MODE       TPM_BASE + 44 // A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob.
+#define TPM_BAD_PRESENCE      TPM_BASE + 45 // Either the physicalPresence or physicalPresenceLock bits have the wrong value
+#define TPM_BAD_VERSION      TPM_BASE + 46 // The TPM cannot perform this version of the capability
+#define TPM_NO_WRAP_TRANSPORT     TPM_BASE + 47 // The TPM does not allow for wrapped transport sessions
+#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 // TPM audit construction failed and the underlying command was returning a failure code also
+#define TPM_AUDITFAIL_SUCCESSFUL   TPM_BASE + 49 // TPM audit construction failed and the underlying command was returning success
+#define TPM_NOTRESETABLE      TPM_BASE + 50 // Attempt to reset a PCR register that does not have the resettable attribute
+#define TPM_NOTLOCAL       TPM_BASE + 51 // Attempt to reset a PCR register that requires locality and locality modifier not part of command transport
+#define TPM_BAD_TYPE       TPM_BASE + 52 // Make identity blob not properly typed
+#define TPM_INVALID_RESOURCE     TPM_BASE + 53 // When saving context identified resource type does not match actual resource
+#define TPM_NOTFIPS       TPM_BASE + 54 // The TPM is attempting to execute a command only available when in FIPS mode
+#define TPM_INVALID_FAMILY      TPM_BASE + 55 // The command is attempting to use an invalid family ID
+#define TPM_NO_NV_PERMISSION     TPM_BASE + 56 // The permission to manipulate the NV storage is not available
+#define TPM_REQUIRES_SIGN      TPM_BASE + 57 // The operation requires a signed command
+#define TPM_KEY_NOTSUPPORTED     TPM_BASE + 58 // Wrong operation to load an NV key
+#define TPM_AUTH_CONFLICT      TPM_BASE + 59 // NV_LoadKey blob requires both owner and blob authorization
+#define TPM_AREA_LOCKED      TPM_BASE + 60 // The NV area is locked and not writtable
+#define TPM_BAD_LOCALITY      TPM_BASE + 61 // The locality is incorrect for the attempted operation
+#define TPM_READ_ONLY       TPM_BASE + 62 // The NV area is read only and can't be written to
+#define TPM_PER_NOWRITE      TPM_BASE + 63 // There is no protection on the write to the NV area
+#define TPM_FAMILYCOUNT      TPM_BASE + 64 // The family count value does not match
+#define TPM_WRITE_LOCKED      TPM_BASE + 65 // The NV area has already been written to
+#define TPM_BAD_ATTRIBUTES      TPM_BASE + 66 // The NV area attributes conflict
+#define TPM_INVALID_STRUCTURE     TPM_BASE + 67 // The structure tag and version are invalid or inconsistent
+#define TPM_KEY_OWNER_CONTROL     TPM_BASE + 68 // The key is under control of the TPM Owner and can only be evicted by the TPM Owner.
+#define TPM_BAD_COUNTER      TPM_BASE + 69 // The counter handle is incorrect
+#define TPM_NOT_FULLWRITE      TPM_BASE + 70 // The write is not a complete write of the area
+#define TPM_CONTEXT_GAP      TPM_BASE + 71 // The gap between saved context counts is too large
+#define TPM_MAXNVWRITES      TPM_BASE + 72 // The maximum number of NV writes without an owner has been exceeded
+#define TPM_NOOPERATOR       TPM_BASE + 73 // No operator authorization value is set
+#define TPM_RESOURCEMISSING     TPM_BASE + 74 // The resource pointed to by context is not loaded
+#define TPM_DELEGATE_LOCK      TPM_BASE + 75 // The delegate administration is locked
+#define TPM_DELEGATE_FAMILY     TPM_BASE + 76 // Attempt to manage a family other then the delegated family
+#define TPM_DELEGATE_ADMIN      TPM_BASE + 77 // Delegation table management not enabled
+#define TPM_TRANSPORT_EXCLUSIVE    TPM_BASE + 78 // There was a command executed outside of an exclusive transport session
+
+// TPM_STARTUP_TYPE values
+#define TPM_ST_CLEAR 0x0001
+#define TPM_ST_STATE 0x0002
+#define TPM_ST_DEACTIVATED 0x003
+
+// TPM_TAG values
+#define TPM_TAG_RQU_COMMAND 0x00c1
+#define TPM_TAG_RQU_AUTH1_COMMAND 0x00c2
+#define TPM_TAG_RQU_AUTH2_COMMAND 0x00c3
+#define TPM_TAG_RSP_COMMAND 0x00c4
+#define TPM_TAG_RSP_AUTH1_COMMAND 0x00c5
+#define TPM_TAG_RSP_AUTH2_COMMAND 0x00c6
+
+// TPM_PAYLOAD_TYPE values
+#define TPM_PT_ASYM 0x01
+#define TPM_PT_BIND 0x02
+#define TPM_PT_MIGRATE 0x03
+#define TPM_PT_MAINT 0x04
+#define TPM_PT_SEAL 0x05
+
+// TPM_ENTITY_TYPE values
+#define TPM_ET_KEYHANDLE 0x0001
+#define TPM_ET_OWNER 0x0002
+#define TPM_ET_DATA 0x0003
+#define TPM_ET_SRK 0x0004
+#define TPM_ET_KEY 0x0005
+
+/// TPM_ResourceTypes
+#define TPM_RT_KEY      0x00000001
+#define TPM_RT_AUTH     0x00000002
+#define TPM_RT_HASH     0x00000003
+#define TPM_RT_TRANS    0x00000004
+#define TPM_RT_CONTEXT  0x00000005
+#define TPM_RT_COUNTER  0x00000006
+#define TPM_RT_DELEGATE 0x00000007
+#define TPM_RT_DAA_TPM  0x00000008
+#define TPM_RT_DAA_V0   0x00000009
+#define TPM_RT_DAA_V1   0x0000000A
+
+
+
+// TPM_PROTOCOL_ID values
+#define TPM_PID_OIAP 0x0001
+#define TPM_PID_OSAP 0x0002
+#define TPM_PID_ADIP 0x0003
+#define TPM_PID_ADCP 0x0004
+#define TPM_PID_OWNER 0x0005
+
+// TPM_ALGORITHM_ID values
+#define TPM_ALG_RSA 0x00000001
+#define TPM_ALG_SHA 0x00000004
+#define TPM_ALG_HMAC 0x00000005
+#define TPM_ALG_AES128 0x00000006
+#define TPM_ALG_MFG1 0x00000007
+#define TPM_ALG_AES192 0x00000008
+#define TPM_ALG_AES256 0x00000009
+#define TPM_ALG_XOR 0x0000000A
+
+// TPM_ENC_SCHEME values
+#define TPM_ES_NONE 0x0001
+#define TPM_ES_RSAESPKCSv15 0x0002
+#define TPM_ES_RSAESOAEP_SHA1_MGF1 0x0003
+
+// TPM_SIG_SCHEME values
+#define TPM_SS_NONE 0x0001
+#define TPM_SS_RSASSAPKCS1v15_SHA1 0x0002
+#define TPM_SS_RSASSAPKCS1v15_DER 0x0003
+
+/*
+ * TPM_CAPABILITY_AREA Values for TPM_GetCapability ([TPM_Part2], Section 21.1)
+ */
+#define TPM_CAP_ORD                     0x00000001
+#define TPM_CAP_ALG                     0x00000002
+#define TPM_CAP_PID                     0x00000003
+#define TPM_CAP_FLAG                    0x00000004
+#define TPM_CAP_PROPERTY                0x00000005
+#define TPM_CAP_VERSION                 0x00000006
+#define TPM_CAP_KEY_HANDLE              0x00000007
+#define TPM_CAP_CHECK_LOADED            0x00000008
+#define TPM_CAP_SYM_MODE                0x00000009
+#define TPM_CAP_KEY_STATUS              0x0000000C
+#define TPM_CAP_NV_LIST                 0x0000000D
+#define TPM_CAP_MFR                     0x00000010
+#define TPM_CAP_NV_INDEX                0x00000011
+#define TPM_CAP_TRANS_ALG               0x00000012
+#define TPM_CAP_HANDLE                  0x00000014
+#define TPM_CAP_TRANS_ES                0x00000015
+#define TPM_CAP_AUTH_ENCRYPT            0x00000017
+#define TPM_CAP_SELECT_SIZE             0x00000018
+#define TPM_CAP_DA_LOGIC                0x00000019
+#define TPM_CAP_VERSION_VAL             0x0000001A
+
+/* subCap definitions ([TPM_Part2], Section 21.2) */
+#define TPM_CAP_PROP_PCR                0x00000101
+#define TPM_CAP_PROP_DIR                0x00000102
+#define TPM_CAP_PROP_MANUFACTURER       0x00000103
+#define TPM_CAP_PROP_KEYS               0x00000104
+#define TPM_CAP_PROP_MIN_COUNTER        0x00000107
+#define TPM_CAP_FLAG_PERMANENT          0x00000108
+#define TPM_CAP_FLAG_VOLATILE           0x00000109
+#define TPM_CAP_PROP_AUTHSESS           0x0000010A
+#define TPM_CAP_PROP_TRANSESS           0x0000010B
+#define TPM_CAP_PROP_COUNTERS           0x0000010C
+#define TPM_CAP_PROP_MAX_AUTHSESS       0x0000010D
+#define TPM_CAP_PROP_MAX_TRANSESS       0x0000010E
+#define TPM_CAP_PROP_MAX_COUNTERS       0x0000010F
+#define TPM_CAP_PROP_MAX_KEYS           0x00000110
+#define TPM_CAP_PROP_OWNER              0x00000111
+#define TPM_CAP_PROP_CONTEXT            0x00000112
+#define TPM_CAP_PROP_MAX_CONTEXT        0x00000113
+#define TPM_CAP_PROP_FAMILYROWS         0x00000114
+#define TPM_CAP_PROP_TIS_TIMEOUT        0x00000115
+#define TPM_CAP_PROP_STARTUP_EFFECT     0x00000116
+#define TPM_CAP_PROP_DELEGATE_ROW       0x00000117
+#define TPM_CAP_PROP_MAX_DAASESS        0x00000119
+#define TPM_CAP_PROP_DAASESS            0x0000011A
+#define TPM_CAP_PROP_CONTEXT_DIST       0x0000011B
+#define TPM_CAP_PROP_DAA_INTERRUPT      0x0000011C
+#define TPM_CAP_PROP_SESSIONS           0x0000011D
+#define TPM_CAP_PROP_MAX_SESSIONS       0x0000011E
+#define TPM_CAP_PROP_CMK_RESTRICTION    0x0000011F
+#define TPM_CAP_PROP_DURATION           0x00000120
+#define TPM_CAP_PROP_ACTIVE_COUNTER     0x00000122
+#define TPM_CAP_PROP_MAX_NV_AVAILABLE   0x00000123
+#define TPM_CAP_PROP_INPUT_BUFFER       0x00000124
+
+// TPM_KEY_USAGE values
+#define TPM_KEY_EK 0x0000
+#define TPM_KEY_SIGNING 0x0010
+#define TPM_KEY_STORAGE 0x0011
+#define TPM_KEY_IDENTITY 0x0012
+#define TPM_KEY_AUTHCHANGE 0X0013
+#define TPM_KEY_BIND 0x0014
+#define TPM_KEY_LEGACY 0x0015
+
+// TPM_AUTH_DATA_USAGE values
+#define TPM_AUTH_NEVER 0x00
+#define TPM_AUTH_ALWAYS 0x01
+
+// Key Handle of owner and srk
+#define TPM_OWNER_KEYHANDLE 0x40000001
+#define TPM_SRK_KEYHANDLE 0x40000000
+
+
+
+// *************************** TYPEDEFS *********************************
+typedef unsigned char BYTE;
+typedef unsigned char BOOL;
+typedef uint16_t UINT16;
+typedef uint32_t UINT32;
+typedef uint64_t UINT64;
+
+typedef UINT32 TPM_RESULT;
+typedef UINT32 TPM_PCRINDEX;
+typedef UINT32 TPM_DIRINDEX;
+typedef UINT32 TPM_HANDLE;
+typedef TPM_HANDLE TPM_AUTHHANDLE;
+typedef TPM_HANDLE TCPA_HASHHANDLE;
+typedef TPM_HANDLE TCPA_HMACHANDLE;
+typedef TPM_HANDLE TCPA_ENCHANDLE;
+typedef TPM_HANDLE TPM_KEY_HANDLE;
+typedef TPM_HANDLE TCPA_ENTITYHANDLE;
+typedef UINT32 TPM_RESOURCE_TYPE;
+typedef UINT32 TPM_COMMAND_CODE;
+typedef UINT16 TPM_PROTOCOL_ID;
+typedef BYTE TPM_AUTH_DATA_USAGE;
+typedef UINT16 TPM_ENTITY_TYPE;
+typedef UINT32 TPM_ALGORITHM_ID;
+typedef UINT16 TPM_KEY_USAGE;
+typedef UINT16 TPM_STARTUP_TYPE;
+typedef UINT32 TPM_CAPABILITY_AREA;
+typedef UINT16 TPM_ENC_SCHEME;
+typedef UINT16 TPM_SIG_SCHEME;
+typedef UINT16 TPM_MIGRATE_SCHEME;
+typedef UINT16 TPM_PHYSICAL_PRESENCE;
+typedef UINT32 TPM_KEY_FLAGS;
+
+#define TPM_DIGEST_SIZE 20  // Don't change this
+typedef BYTE TPM_AUTHDATA[TPM_DIGEST_SIZE];
+typedef TPM_AUTHDATA TPM_SECRET;
+typedef TPM_AUTHDATA TPM_ENCAUTH;
+typedef BYTE TPM_PAYLOAD_TYPE;
+typedef UINT16 TPM_TAG;
+typedef UINT16 TPM_STRUCTURE_TAG;
+
+// Data Types of the TCS
+typedef UINT32 TCS_AUTHHANDLE;  // Handle addressing a authorization session
+typedef UINT32 TCS_CONTEXT_HANDLE; // Basic context handle
+typedef UINT32 TCS_KEY_HANDLE;  // Basic key handle
+
+// ************************* STRUCTURES **********************************
+
+typedef struct TPM_VERSION {
+  BYTE major;
+  BYTE minor;
+  BYTE revMajor;
+  BYTE revMinor;
+} TPM_VERSION;
+
+static const TPM_VERSION TPM_STRUCT_VER_1_1 = { 1,1,0,0 };
+
+typedef struct TPM_CAP_VERSION_INFO {
+   TPM_STRUCTURE_TAG tag;
+   TPM_VERSION version;
+   UINT16 specLevel;
+   BYTE errataRev;
+   BYTE tpmVendorID[4];
+   UINT16 vendorSpecificSize;
+   BYTE* vendorSpecific;
+} TPM_CAP_VERSION_INFO;
+
+inline void free_TPM_CAP_VERSION_INFO(TPM_CAP_VERSION_INFO* v) {
+   free(v->vendorSpecific);
+   v->vendorSpecific = NULL;
+}
+
+typedef struct TPM_DIGEST {
+  BYTE digest[TPM_DIGEST_SIZE];
+} TPM_DIGEST;
+
+typedef TPM_DIGEST TPM_PCRVALUE;
+typedef TPM_DIGEST TPM_COMPOSITE_HASH;
+typedef TPM_DIGEST TPM_DIRVALUE;
+typedef TPM_DIGEST TPM_HMAC;
+typedef TPM_DIGEST TPM_CHOSENID_HASH;
+
+typedef struct TPM_NONCE {
+  BYTE nonce[TPM_DIGEST_SIZE];
+} TPM_NONCE;
+
+typedef struct TPM_SYMMETRIC_KEY_PARMS {
+   UINT32 keyLength;
+   UINT32 blockSize;
+   UINT32 ivSize;
+   BYTE* IV;
+} TPM_SYMMETRIC_KEY_PARMS;
+
+inline void free_TPM_SYMMETRIC_KEY_PARMS(TPM_SYMMETRIC_KEY_PARMS* p) {
+   free(p->IV);
+   p->IV = NULL;
+}
+
+#define TPM_SYMMETRIC_KEY_PARMS_INIT { 0, 0, 0, NULL }
+
+typedef struct TPM_RSA_KEY_PARMS {
+  UINT32 keyLength;
+  UINT32 numPrimes;
+  UINT32 exponentSize;
+  BYTE* exponent;
+} TPM_RSA_KEY_PARMS;
+
+#define TPM_RSA_KEY_PARMS_INIT { 0, 0, 0, NULL }
+
+inline void free_TPM_RSA_KEY_PARMS(TPM_RSA_KEY_PARMS* p) {
+   free(p->exponent);
+   p->exponent = NULL;
+}
+
+typedef struct TPM_KEY_PARMS {
+  TPM_ALGORITHM_ID algorithmID;
+  TPM_ENC_SCHEME encScheme;
+  TPM_SIG_SCHEME sigScheme;
+  UINT32 parmSize;
+  union {
+     TPM_SYMMETRIC_KEY_PARMS sym;
+     TPM_RSA_KEY_PARMS rsa;
+  } parms;
+} TPM_KEY_PARMS;
+
+#define TPM_KEY_PARMS_INIT { 0, 0, 0, 0 }
+
+inline void free_TPM_KEY_PARMS(TPM_KEY_PARMS* p) {
+   if(p->parmSize) {
+      switch(p->algorithmID) {
+         case TPM_ALG_RSA:
+            free_TPM_RSA_KEY_PARMS(&p->parms.rsa);
+            break;
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            free_TPM_SYMMETRIC_KEY_PARMS(&p->parms.sym);
+            break;
+      }
+   }
+}
+
+typedef struct TPM_STORE_PUBKEY {
+  UINT32 keyLength;
+  BYTE* key;
+} TPM_STORE_PUBKEY;
+
+#define TPM_STORE_PUBKEY_INIT { 0, NULL }
+
+inline void free_TPM_STORE_PUBKEY(TPM_STORE_PUBKEY* p) {
+   free(p->key);
+   p->key = NULL;
+}
+
+typedef struct TPM_PUBKEY {
+  TPM_KEY_PARMS algorithmParms;
+  TPM_STORE_PUBKEY pubKey;
+} TPM_PUBKEY;
+
+#define TPM_PUBKEY_INIT { TPM_KEY_PARMS_INIT, TPM_STORE_PUBKEY_INIT }
+
+inline void free_TPM_PUBKEY(TPM_PUBKEY* k) {
+   free_TPM_KEY_PARMS(&k->algorithmParms);
+   free_TPM_STORE_PUBKEY(&k->pubKey);
+}
+
+typedef struct TPM_PCR_SELECTION {
+   UINT16 sizeOfSelect;
+   BYTE* pcrSelect;
+} TPM_PCR_SELECTION;
+
+#define TPM_PCR_SELECTION_INIT { 0, NULL }
+
+inline void free_TPM_PCR_SELECTION(TPM_PCR_SELECTION* p) {
+   free(p->pcrSelect);
+   p->pcrSelect = NULL;
+}
+
+typedef struct TPM_PCR_INFO {
+   TPM_PCR_SELECTION pcrSelection;
+   TPM_COMPOSITE_HASH digestAtRelease;
+   TPM_COMPOSITE_HASH digestAtCreation;
+} TPM_PCR_INFO;
+
+#define TPM_PCR_INFO_INIT { TPM_PCR_SELECTION_INIT }
+
+inline void free_TPM_PCR_INFO(TPM_PCR_INFO* p) {
+   free_TPM_PCR_SELECTION(&p->pcrSelection);
+}
+
+typedef struct TPM_PCR_COMPOSITE {
+  TPM_PCR_SELECTION select;
+  UINT32 valueSize;
+  TPM_PCRVALUE* pcrValue;
+} TPM_PCR_COMPOSITE;
+
+#define TPM_PCR_COMPOSITE_INIT { TPM_PCR_SELECTION_INIT, 0, NULL }
+
+inline void free_TPM_PCR_COMPOSITE(TPM_PCR_COMPOSITE* p) {
+   free_TPM_PCR_SELECTION(&p->select);
+   free(p->pcrValue);
+   p->pcrValue = NULL;
+}
+
+typedef struct TPM_KEY {
+  TPM_VERSION         ver;
+  TPM_KEY_USAGE       keyUsage;
+  TPM_KEY_FLAGS       keyFlags;
+  TPM_AUTH_DATA_USAGE authDataUsage;
+  TPM_KEY_PARMS       algorithmParms;
+  UINT32              PCRInfoSize;
+  TPM_PCR_INFO        PCRInfo;
+  TPM_STORE_PUBKEY    pubKey;
+  UINT32              encDataSize;
+  BYTE*               encData;
+} TPM_KEY;
+
+#define TPM_KEY_INIT { .algorithmParms = TPM_KEY_PARMS_INIT,\
+   .PCRInfoSize = 0, .PCRInfo = TPM_PCR_INFO_INIT, \
+   .pubKey = TPM_STORE_PUBKEY_INIT, \
+   .encDataSize = 0, .encData = NULL }
+
+inline void free_TPM_KEY(TPM_KEY* k) {
+   if(k->PCRInfoSize) {
+      free_TPM_PCR_INFO(&k->PCRInfo);
+   }
+   free_TPM_STORE_PUBKEY(&k->pubKey);
+   free(k->encData);
+   k->encData = NULL;
+}
+
+typedef struct TPM_BOUND_DATA {
+  TPM_VERSION ver;
+  TPM_PAYLOAD_TYPE payload;
+  BYTE* payloadData;
+} TPM_BOUND_DATA;
+
+#define TPM_BOUND_DATA_INIT { .payloadData = NULL }
+
+inline void free_TPM_BOUND_DATA(TPM_BOUND_DATA* d) {
+   free(d->payloadData);
+   d->payloadData = NULL;
+}
+
+typedef struct TPM_STORED_DATA {
+  TPM_VERSION ver;
+  UINT32 sealInfoSize;
+  TPM_PCR_INFO sealInfo;
+  UINT32 encDataSize;
+  BYTE* encData;
+} TPM_STORED_DATA;
+
+#define TPM_STORED_DATA_INIT { .sealInfoSize = 0, sealInfo = TPM_PCR_INFO_INIT,\
+   .encDataSize = 0, .encData = NULL }
+
+inline void free_TPM_STORED_DATA(TPM_STORED_DATA* d) {
+   if(d->sealInfoSize) {
+      free_TPM_PCR_INFO(&d->sealInfo);
+   }
+   free(d->encData);
+   d->encData = NULL;
+}
+
+typedef struct TPM_AUTH_SESSION {
+  TPM_AUTHHANDLE  AuthHandle;
+  TPM_NONCE   NonceOdd;   // system
+  TPM_NONCE   NonceEven;   // TPM
+  BOOL   fContinueAuthSession;
+  TPM_AUTHDATA  HMAC;
+} TPM_AUTH_SESSION;
+
+#define TPM_AUTH_SESSION_INIT { .AuthHandle = 0, .fContinueAuthSession = FALSE }
+
+// ---------------------- Functions for checking TPM_RESULTs -----------------
+
+#include <stdio.h>
+
+// FIXME: Review use of these and delete unneeded ones.
+
+// these are really badly dependent on local structure:
+// DEPENDS: local var 'status' of type TPM_RESULT
+// DEPENDS: label 'abort_egress' which cleans up and returns the status
+#define ERRORDIE(s) do { status = s; \
+                         fprintf (stderr, "*** ERRORDIE in %s at %s: %i\n", __func__, __FILE__, __LINE__); \
+                         goto abort_egress; } \
+                    while (0)
+
+// DEPENDS: local var 'status' of type TPM_RESULT
+// DEPENDS: label 'abort_egress' which cleans up and returns the status
+// Try command c. If it fails, set status to s and goto abort.
+#define TPMTRY(s,c) if (c != TPM_SUCCESS) { \
+                       status = s; \
+                       printf("ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
+                       goto abort_egress; \
+                    } else {\
+                       status = c; \
+                    }
+
+// Try command c. If it fails, print error message, set status to actual return code. Goto abort
+#define TPMTRYRETURN(c) do { status = c; \
+                             if (status != TPM_SUCCESS) { \
+                               fprintf(stderr, "ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
+                               goto abort_egress; \
+                             } \
+                        } while(0)
+
+
+#endif //__TCPA_H__
diff --git a/stubdom/vtpmmgr/tpm.c b/stubdom/vtpmmgr/tpm.c
new file mode 100644
index 0000000..123a27c
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm.c
@@ -0,0 +1,938 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <malloc.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <polarssl/sha1.h>
+
+#include "tcg.h"
+#include "tpm.h"
+#include "log.h"
+#include "marshal.h"
+#include "tpmrsa.h"
+#include "vtpmmgr.h"
+
+#define TCPA_MAX_BUFFER_LENGTH 0x2000
+
+#define TPM_BEGIN(TAG, ORD) \
+   const TPM_TAG intag = TAG;\
+TPM_TAG tag = intag;\
+UINT32 paramSize;\
+const TPM_COMMAND_CODE ordinal = ORD;\
+TPM_RESULT status = TPM_SUCCESS;\
+BYTE in_buf[TCPA_MAX_BUFFER_LENGTH];\
+BYTE out_buf[TCPA_MAX_BUFFER_LENGTH];\
+UINT32 out_len = sizeof(out_buf);\
+BYTE* ptr = in_buf;\
+/*Print a log message */\
+vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);\
+/* Pack the header*/\
+ptr = pack_TPM_TAG(ptr, tag);\
+ptr += sizeof(UINT32);\
+ptr = pack_TPM_COMMAND_CODE(ptr, ordinal)\
+
+#define TPM_AUTH_BEGIN() \
+   sha1_context sha1_ctx;\
+BYTE* authbase = ptr - sizeof(TPM_COMMAND_CODE);\
+TPM_DIGEST paramDigest;\
+sha1_starts(&sha1_ctx)
+
+#define TPM_AUTH1_GEN(HMACkey, auth) do {\
+   sha1_finish(&sha1_ctx, paramDigest.digest);\
+   generateAuth(&paramDigest, HMACkey, auth);\
+   ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_AUTH2_GEN(HMACkey, auth) do {\
+   generateAuth(&paramDigest, HMACkey, auth);\
+   ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_TRANSMIT() do {\
+   /* Pack the command size */\
+   paramSize = ptr - in_buf;\
+   pack_UINT32(in_buf + sizeof(TPM_TAG), paramSize);\
+   if((status = TPM_TransmitData(in_buf, paramSize, out_buf, &out_len)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH_VERIFY_BEGIN() do {\
+   UINT32 buf[2] = { cpu_to_be32(status), cpu_to_be32(ordinal) };\
+   sha1_starts(&sha1_ctx);\
+   sha1_update(&sha1_ctx, (unsigned char*)buf, sizeof(buf));\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH1_VERIFY(HMACkey, auth) do {\
+   sha1_finish(&sha1_ctx, paramDigest.digest);\
+   ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+   if((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH2_VERIFY(HMACkey, auth) do {\
+   ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+   if((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+
+
+#define TPM_UNPACK_VERIFY() do { \
+   ptr = out_buf;\
+   ptr = unpack_TPM_RSP_HEADER(ptr, \
+         &(tag), &(paramSize), &(status));\
+   if((status) != TPM_SUCCESS || (tag) != (intag +3)) { \
+      vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s\n", tpm_get_error_name(status));\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH_HASH() do {\
+   sha1_update(&sha1_ctx, authbase, ptr - authbase);\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH_SKIP() do {\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH_ERR_CHECK(auth) do {\
+   if(status != TPM_SUCCESS || auth->fContinueAuthSession == FALSE) {\
+      vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM\n", auth->AuthHandle);\
+      auth->AuthHandle = 0;\
+   }\
+} while(0)
+
+static void xorEncrypt(const TPM_SECRET* sharedSecret,
+      TPM_NONCE* nonce,
+      const TPM_AUTHDATA* inAuth0,
+      TPM_ENCAUTH outAuth0,
+      const TPM_AUTHDATA* inAuth1,
+      TPM_ENCAUTH outAuth1) {
+   BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
+   BYTE XORkey[TPM_DIGEST_SIZE];
+   BYTE* ptr = XORbuffer;
+   ptr = pack_TPM_SECRET(ptr, sharedSecret);
+   ptr = pack_TPM_NONCE(ptr, nonce);
+
+   sha1(XORbuffer, ptr - XORbuffer, XORkey);
+
+   if(inAuth0) {
+      for(int i = 0; i < TPM_DIGEST_SIZE; ++i) {
+         outAuth0[i] = XORkey[i] ^ (*inAuth0)[i];
+      }
+   }
+   if(inAuth1) {
+      for(int i = 0; i < TPM_DIGEST_SIZE; ++i) {
+         outAuth1[i] = XORkey[i] ^ (*inAuth1)[i];
+      }
+   }
+
+}
+
+static void generateAuth(const TPM_DIGEST* paramDigest,
+      const TPM_SECRET* HMACkey,
+      TPM_AUTH_SESSION *auth)
+{
+   //Generate new OddNonce
+   vtpmmgr_rand((BYTE*)auth->NonceOdd.nonce, sizeof(TPM_NONCE));
+
+   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
+   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
+   BYTE* ptr = hmacText;
+
+   ptr = pack_TPM_DIGEST(ptr, paramDigest);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+
+   sha1_hmac((BYTE *) HMACkey, sizeof(TPM_DIGEST),
+         (BYTE *) hmacText, sizeof(hmacText),
+         auth->HMAC);
+}
+
+static TPM_RESULT verifyAuth(const TPM_DIGEST* paramDigest,
+      /*[IN]*/ const TPM_SECRET *HMACkey,
+      /*[IN,OUT]*/ TPM_AUTH_SESSION *auth)
+{
+
+   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
+   TPM_AUTHDATA hm;
+   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
+   BYTE* ptr = hmacText;
+
+   ptr = pack_TPM_DIGEST(ptr, paramDigest);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+
+   sha1_hmac( (BYTE *) HMACkey, sizeof(TPM_DIGEST),
+         (BYTE *) hmacText, sizeof(hmacText),
+         hm);
+
+   // Compare correct HMAC with provided one.
+   if (memcmp(hm, auth->HMAC, sizeof(TPM_DIGEST)) == 0) { // 0 indicates equality
+      return TPM_SUCCESS;
+   } else {
+      vtpmlogerror(VTPM_LOG_TPM, "Auth Session verification failed!\n");
+      return TPM_AUTHFAIL;
+   }
+}
+
+
+
+// ------------------------------------------------------------------
+// Authorization Commands
+// ------------------------------------------------------------------
+
+TPM_RESULT TPM_OIAP(TPM_AUTH_SESSION*   auth)  // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OIAP);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
+   auth->fContinueAuthSession = TRUE;
+
+   ptr = unpack_UINT32(ptr, &auth->AuthHandle);
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OIAP.\n", auth->AuthHandle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_OSAP(TPM_ENTITY_TYPE  entityType,  // in
+      UINT32    entityValue, // in
+      const TPM_AUTHDATA* usageAuth, //in
+      TPM_SECRET *sharedSecret, //out
+      TPM_AUTH_SESSION *auth)
+{
+   BYTE* nonceOddOSAP;
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OSAP);
+
+   ptr = pack_TPM_ENTITY_TYPE(ptr, entityType);
+   ptr = pack_UINT32(ptr, entityValue);
+
+   //nonce Odd OSAP
+   nonceOddOSAP = ptr;
+   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
+   ptr += TPM_DIGEST_SIZE;
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, &auth->AuthHandle);
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+
+   //Calculate session secret
+   sha1_context ctx;
+   sha1_hmac_starts(&ctx, *usageAuth, TPM_DIGEST_SIZE);
+   sha1_hmac_update(&ctx, ptr, TPM_DIGEST_SIZE); //ptr = nonceEvenOSAP
+   sha1_hmac_update(&ctx, nonceOddOSAP, TPM_DIGEST_SIZE);
+   sha1_hmac_finish(&ctx, *sharedSecret);
+
+   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
+   auth->fContinueAuthSession = FALSE;
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OSAP.\n", auth->AuthHandle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_TakeOwnership(
+      const TPM_PUBKEY *pubEK, //in
+      const TPM_AUTHDATA* ownerAuth, //in
+      const TPM_AUTHDATA* srkAuth, //in
+      const TPM_KEY* inSrk, //in
+      TPM_KEY* outSrk, //out, optional
+      TPM_AUTH_SESSION*   auth)   // in, out
+{
+   int keyAlloced = 0;
+   tpmrsa_context ek_rsa = TPMRSA_CTX_INIT;
+
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_TakeOwnership);
+   TPM_AUTH_BEGIN();
+
+   tpmrsa_set_pubkey(&ek_rsa,
+         pubEK->pubKey.key, pubEK->pubKey.keyLength,
+         pubEK->algorithmParms.parms.rsa.exponent,
+         pubEK->algorithmParms.parms.rsa.exponentSize);
+
+   /* Pack the protocol ID */
+   ptr = pack_UINT16(ptr, TPM_PID_OWNER);
+
+   /* Pack the encrypted owner auth */
+   ptr = pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength / 8);
+   tpmrsa_pub_encrypt_oaep(&ek_rsa,
+         ctr_drbg_random, &vtpm_globals.ctr_drbg,
+         sizeof(TPM_SECRET),
+         (BYTE*) ownerAuth,
+         ptr);
+   ptr += pubEK->algorithmParms.parms.rsa.keyLength / 8;
+
+   /* Pack the encrypted srk auth */
+   ptr = pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength / 8);
+   tpmrsa_pub_encrypt_oaep(&ek_rsa,
+         ctr_drbg_random, &vtpm_globals.ctr_drbg,
+         sizeof(TPM_SECRET),
+         (BYTE*) srkAuth,
+         ptr);
+   ptr += pubEK->algorithmParms.parms.rsa.keyLength / 8;
+
+   /* Pack the Srk key */
+   ptr = pack_TPM_KEY(ptr, inSrk);
+
+   /* Hash everything up to here */
+   TPM_AUTH_HASH();
+
+   /* Generate the authorization */
+   TPM_AUTH1_GEN(ownerAuth, auth);
+
+   /* Send the command to the tpm*/
+   TPM_TRANSMIT();
+   /* Unpack and validate the header */
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   if(outSrk != NULL) {
+      /* If the user wants a copy of the srk we give it to them */
+      keyAlloced = 1;
+      ptr = unpack_TPM_KEY(ptr, outSrk, UNPACK_ALLOC);
+   } else {
+      /*otherwise just parse past it */
+      TPM_KEY temp;
+      ptr = unpack_TPM_KEY(ptr, &temp, UNPACK_ALIAS);
+   }
+
+   /* Hash the output key */
+   TPM_AUTH_HASH();
+
+   /* Verify authorizaton */
+   TPM_AUTH1_VERIFY(ownerAuth, auth);
+
+   goto egress;
+abort_egress:
+   if(keyAlloced) {
+      free_TPM_KEY(outSrk);
+   }
+egress:
+   tpmrsa_free(&ek_rsa);
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+
+TPM_RESULT TPM_DisablePubekRead (
+      const TPM_AUTHDATA* ownerAuth,
+      TPM_AUTH_SESSION*   auth)
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_DisablePubekRead);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(ownerAuth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   TPM_AUTH1_VERIFY(ownerAuth, auth);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+
+TPM_RESULT TPM_TerminateHandle(TPM_AUTHHANDLE  handle)  // in
+{
+   if(handle == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Terminate_Handle);
+
+   ptr = pack_TPM_AUTHHANDLE(ptr, handle);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM_TerminateHandle\n", handle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_Extend( TPM_PCRINDEX  pcrNum,  // in
+      TPM_DIGEST  inDigest, // in
+      TPM_PCRVALUE*  outDigest) // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Extend);
+
+   ptr = pack_TPM_PCRINDEX(ptr, pcrNum);
+   ptr = pack_TPM_DIGEST(ptr, &inDigest);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_TPM_PCRVALUE(ptr, outDigest);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_Seal(
+      TPM_KEY_HANDLE  keyHandle,  // in
+      UINT32    pcrInfoSize, // in
+      TPM_PCR_INFO*    pcrInfo,  // in
+      UINT32    inDataSize,  // in
+      const BYTE*    inData,   // in
+      TPM_STORED_DATA* sealedData, //out
+      const TPM_SECRET* osapSharedSecret, //in
+      const TPM_AUTHDATA* sealedDataAuth, //in
+      TPM_AUTH_SESSION*   pubAuth  // in, out
+      )
+{
+   int dataAlloced = 0;
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_Seal);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, keyHandle);
+
+   TPM_AUTH_SKIP();
+
+   xorEncrypt(osapSharedSecret, &pubAuth->NonceEven,
+         sealedDataAuth, ptr,
+         NULL, NULL);
+   ptr += sizeof(TPM_ENCAUTH);
+
+   ptr = pack_UINT32(ptr, pcrInfoSize);
+   ptr = pack_TPM_PCR_INFO(ptr, pcrInfo);
+
+   ptr = pack_UINT32(ptr, inDataSize);
+   ptr = pack_BUFFER(ptr, inData, inDataSize);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(osapSharedSecret, pubAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_TPM_STORED_DATA(ptr, sealedData, UNPACK_ALLOC);
+   dataAlloced = 1;
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(osapSharedSecret, pubAuth);
+
+   goto egress;
+abort_egress:
+   if(dataAlloced) {
+      free_TPM_STORED_DATA(sealedData);
+   }
+egress:
+   TPM_AUTH_ERR_CHECK(pubAuth);
+   return status;
+}
+
+TPM_RESULT TPM_Unseal(
+      TPM_KEY_HANDLE parentHandle, // in
+      const TPM_STORED_DATA* sealedData,
+      UINT32*   outSize,  // out
+      BYTE**    out, //out
+      const TPM_AUTHDATA* key_usage_auth, //in
+      const TPM_AUTHDATA* data_usage_auth, //in
+      TPM_AUTH_SESSION*   keyAuth,  // in, out
+      TPM_AUTH_SESSION*   dataAuth  // in, out
+      )
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH2_COMMAND, TPM_ORD_Unseal);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, parentHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_TPM_STORED_DATA(ptr, sealedData);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(key_usage_auth, keyAuth);
+   TPM_AUTH2_GEN(data_usage_auth, dataAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, outSize);
+   ptr = unpack_ALLOC(ptr, out, *outSize);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(key_usage_auth, keyAuth);
+   TPM_AUTH2_VERIFY(data_usage_auth, dataAuth);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(keyAuth);
+   TPM_AUTH_ERR_CHECK(dataAuth);
+   return status;
+}
+
+TPM_RESULT TPM_Bind(
+      const TPM_KEY* key,
+      const BYTE* in,
+      UINT32 ilen,
+      BYTE* out)
+{
+   TPM_RESULT status;
+   tpmrsa_context rsa = TPMRSA_CTX_INIT;
+   TPM_BOUND_DATA boundData;
+   uint8_t plain[TCPA_MAX_BUFFER_LENGTH];
+   BYTE* ptr = plain;
+
+   vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);
+
+   tpmrsa_set_pubkey(&rsa,
+         key->pubKey.key, key->pubKey.keyLength,
+         key->algorithmParms.parms.rsa.exponent,
+         key->algorithmParms.parms.rsa.exponentSize);
+
+   // Fill boundData's accessory information
+   boundData.ver = TPM_STRUCT_VER_1_1;
+   boundData.payload = TPM_PT_BIND;
+   boundData.payloadData = (BYTE*)in;
+
+   //marshall the bound data object
+   ptr = pack_TPM_BOUND_DATA(ptr, &boundData, ilen);
+
+   // Encrypt the data
+   TPMTRYRETURN(tpmrsa_pub_encrypt_oaep(&rsa,
+            ctr_drbg_random, &vtpm_globals.ctr_drbg,
+            ptr - plain,
+            plain,
+            out));
+
+abort_egress:
+   tpmrsa_free(&rsa);
+   return status;
+
+}
+
+TPM_RESULT TPM_UnBind(
+      TPM_KEY_HANDLE  keyHandle,  // in
+      UINT32 ilen, //in
+      const BYTE* in, //
+      UINT32* olen, //
+      BYTE*    out, //out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth //in, out
+      )
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_UnBind);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, keyHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_UINT32(ptr, ilen);
+   ptr = pack_BUFFER(ptr, in, ilen);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(usage_auth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, olen);
+   if(*olen > ilen) {
+      vtpmlogerror(VTPM_LOG_TPM, "Output length < input length!\n");
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+   ptr = unpack_BUFFER(ptr, out, *olen);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(usage_auth, auth);
+
+abort_egress:
+egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+TPM_RESULT TPM_CreateWrapKey(
+      TPM_KEY_HANDLE  hWrappingKey,  // in
+      const TPM_AUTHDATA* osapSharedSecret,
+      const TPM_AUTHDATA* dataUsageAuth, //in
+      const TPM_AUTHDATA* dataMigrationAuth, //in
+      TPM_KEY*     key, //in, out
+      TPM_AUTH_SESSION*   pAuth)    // in, out
+{
+   int keyAlloced = 0;
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_CreateWrapKey);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, hWrappingKey);
+
+   TPM_AUTH_SKIP();
+
+   //Encrypted auths
+   xorEncrypt(osapSharedSecret, &pAuth->NonceEven,
+         dataUsageAuth, ptr,
+         dataMigrationAuth, ptr + sizeof(TPM_ENCAUTH));
+   ptr += sizeof(TPM_ENCAUTH) * 2;
+
+   ptr = pack_TPM_KEY(ptr, key);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(osapSharedSecret, pAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   keyAlloced = 1;
+   ptr = unpack_TPM_KEY(ptr, key, UNPACK_ALLOC);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(osapSharedSecret, pAuth);
+
+   goto egress;
+abort_egress:
+   if(keyAlloced) {
+      free_TPM_KEY(key);
+   }
+egress:
+   TPM_AUTH_ERR_CHECK(pAuth);
+   return status;
+}
+
+TPM_RESULT TPM_LoadKey(
+      TPM_KEY_HANDLE  parentHandle, //
+      const TPM_KEY* key, //in
+      TPM_HANDLE*  keyHandle,    // out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth)
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_LoadKey);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, parentHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_TPM_KEY(ptr, key);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(usage_auth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, keyHandle);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(usage_auth, auth);
+
+   vtpmloginfo(VTPM_LOG_TPM, "Key Handle: 0x%x opened by TPM_LoadKey\n", *keyHandle);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+TPM_RESULT TPM_EvictKey( TPM_KEY_HANDLE  hKey)  // in
+{
+   if(hKey == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_EvictKey);
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, hKey);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   vtpmloginfo(VTPM_LOG_TPM, "Key handle: 0x%x closed by TPM_EvictKey\n", hKey);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle,
+      TPM_RESOURCE_TYPE rt) {
+   if(handle == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_FlushSpecific);
+
+   ptr = pack_TPM_HANDLE(ptr, handle);
+   ptr = pack_TPM_RESOURCE_TYPE(ptr, rt);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_GetRandom( UINT32*    bytesRequested, // in, out
+      BYTE*    randomBytes) // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetRandom);
+
+   // check input params
+   if (bytesRequested == NULL || randomBytes == NULL){
+      return TPM_BAD_PARAMETER;
+   }
+
+   ptr = pack_UINT32(ptr, *bytesRequested);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, bytesRequested);
+   ptr = unpack_BUFFER(ptr, randomBytes, *bytesRequested);
+
+abort_egress:
+   return status;
+}
+
+
+TPM_RESULT TPM_ReadPubek(
+      TPM_PUBKEY* pubEK //out
+      )
+{
+   BYTE* antiReplay = NULL;
+   BYTE* kptr = NULL;
+   BYTE digest[TPM_DIGEST_SIZE];
+   sha1_context ctx;
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_ReadPubek);
+
+   //antiReplay nonce
+   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
+   antiReplay = ptr;
+   ptr += TPM_DIGEST_SIZE;
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   //unpack and allocate the key
+   kptr = ptr;
+   ptr = unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
+
+   //Verify the checksum
+   sha1_starts(&ctx);
+   sha1_update(&ctx, kptr, ptr - kptr);
+   sha1_update(&ctx, antiReplay, TPM_DIGEST_SIZE);
+   sha1_finish(&ctx, digest);
+
+   //ptr points to the checksum computed by TPM
+   if(memcmp(digest, ptr, TPM_DIGEST_SIZE)) {
+      vtpmlogerror(VTPM_LOG_TPM, "TPM_ReadPubek: Checksum returned by TPM was invalid!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   goto egress;
+abort_egress:
+   if(kptr != NULL) { //If we unpacked the pubEK, we have to free it
+      free_TPM_PUBKEY(pubEK);
+   }
+egress:
+   return status;
+}
+
+
+TPM_RESULT TPM_SaveState(void)
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_SaveState);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_GetCapability(
+      TPM_CAPABILITY_AREA capArea,
+      UINT32 subCapSize,
+      const BYTE* subCap,
+      UINT32* respSize,
+      BYTE** resp)
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetCapability);
+
+   ptr = pack_TPM_CAPABILITY_AREA(ptr, capArea);
+   ptr = pack_UINT32(ptr, subCapSize);
+   ptr = pack_BUFFER(ptr, subCap, subCapSize);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, respSize);
+   ptr = unpack_ALLOC(ptr, resp, *respSize);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_CreateEndorsementKeyPair(
+      const TPM_KEY_PARMS* keyInfo,
+      TPM_PUBKEY* pubEK)
+{
+   BYTE* kptr = NULL;
+   sha1_context ctx;
+   TPM_DIGEST checksum;
+   TPM_DIGEST hash;
+   TPM_NONCE antiReplay;
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_CreateEndorsementKeyPair);
+
+   //Make anti replay nonce
+   vtpmmgr_rand(antiReplay.nonce, sizeof(antiReplay.nonce));
+
+   ptr = pack_TPM_NONCE(ptr, &antiReplay);
+   ptr = pack_TPM_KEY_PARMS(ptr, keyInfo);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   sha1_starts(&ctx);
+
+   kptr = ptr;
+   ptr = unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
+
+   /* Hash the pub key blob */
+   sha1_update(&ctx, kptr, ptr - kptr);
+   ptr = unpack_TPM_DIGEST(ptr, &checksum);
+
+   sha1_update(&ctx, antiReplay.nonce, sizeof(antiReplay.nonce));
+
+   sha1_finish(&ctx, hash.digest);
+   if(memcmp(checksum.digest, hash.digest, TPM_DIGEST_SIZE)) {
+      vtpmloginfo(VTPM_LOG_VTPM, "TPM_CreateEndorsementKey: Checkum verification failed!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   goto egress;
+abort_egress:
+   if(kptr) {
+      free_TPM_PUBKEY(pubEK);
+   }
+egress:
+   return status;
+}
+
+TPM_RESULT TPM_TransmitData(
+      BYTE* in,
+      UINT32 insize,
+      BYTE* out,
+      UINT32* outsize) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   UINT32 i;
+   vtpmloginfo(VTPM_LOG_TXDATA, "Sending buffer = 0x");
+   for(i = 0 ; i < insize ; i++)
+      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", in[i]);
+
+   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
+
+   ssize_t size = 0;
+
+   // send the request
+   size = write (vtpm_globals.tpm_fd, in, insize);
+   if (size < 0) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "write() failed : %s\n", strerror(errno));
+      ERRORDIE (TPM_IOERROR);
+   }
+   else if ((UINT32) size < insize) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "Wrote %d instead of %d bytes!\n", (int) size, insize);
+      ERRORDIE (TPM_IOERROR);
+   }
+
+   // read the response
+   size = read (vtpm_globals.tpm_fd, out, *outsize);
+   if (size < 0) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "read() failed : %s\n", strerror(errno));
+      ERRORDIE (TPM_IOERROR);
+   }
+
+   vtpmloginfo(VTPM_LOG_TXDATA, "Receiving buffer = 0x");
+   for(i = 0 ; i < size ; i++)
+      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out[i]);
+
+   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
+
+   *outsize = size;
+   goto egress;
+
+abort_egress:
+egress:
+   return status;
+}
diff --git a/stubdom/vtpmmgr/tpm.h b/stubdom/vtpmmgr/tpm.h
new file mode 100644
index 0000000..304e145
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm.h
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005/2006, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __TPM_H__
+#define __TPM_H__
+
+#include "tcg.h"
+
+// ------------------------------------------------------------------
+// Exposed API
+// ------------------------------------------------------------------
+
+// TPM v1.1B Command Set
+
+// Authorzation
+TPM_RESULT TPM_OIAP(
+      TPM_AUTH_SESSION*   auth //out
+      );
+
+TPM_RESULT TPM_OSAP (
+      TPM_ENTITY_TYPE entityType,  // in
+      UINT32    entityValue, // in
+      const TPM_AUTHDATA* usageAuth, //in
+      TPM_SECRET *sharedSecret, //out
+      TPM_AUTH_SESSION *auth);
+
+TPM_RESULT TPM_TakeOwnership(
+      const TPM_PUBKEY *pubEK, //in
+      const TPM_AUTHDATA* ownerAuth, //in
+      const TPM_AUTHDATA* srkAuth, //in
+      const TPM_KEY* inSrk, //in
+      TPM_KEY* outSrk, //out, optional
+      TPM_AUTH_SESSION*   auth   // in, out
+      );
+
+TPM_RESULT TPM_DisablePubekRead (
+      const TPM_AUTHDATA* ownerAuth,
+      TPM_AUTH_SESSION*   auth
+      );
+
+TPM_RESULT TPM_TerminateHandle ( TPM_AUTHHANDLE  handle  // in
+      );
+
+TPM_RESULT TPM_FlushSpecific ( TPM_HANDLE  handle,  // in
+      TPM_RESOURCE_TYPE resourceType //in
+      );
+
+// TPM Mandatory
+TPM_RESULT TPM_Extend ( TPM_PCRINDEX  pcrNum,  // in
+      TPM_DIGEST   inDigest, // in
+      TPM_PCRVALUE*   outDigest // out
+      );
+
+TPM_RESULT TPM_PcrRead ( TPM_PCRINDEX  pcrNum,  // in
+      TPM_PCRVALUE*  outDigest // out
+      );
+
+TPM_RESULT TPM_Quote ( TCS_KEY_HANDLE  keyHandle,  // in
+      TPM_NONCE   antiReplay,  // in
+      UINT32*    PcrDataSize, // in, out
+      BYTE**    PcrData,  // in, out
+      TPM_AUTH_SESSION*   privAuth,  // in, out
+      UINT32*    sigSize,  // out
+      BYTE**    sig    // out
+      );
+
+TPM_RESULT TPM_Seal(
+      TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32    pcrInfoSize, // in
+      TPM_PCR_INFO*    pcrInfo,  // in
+      UINT32    inDataSize,  // in
+      const BYTE*    inData,   // in
+      TPM_STORED_DATA* sealedData, //out
+      const TPM_SECRET* osapSharedSecret, //in
+      const TPM_AUTHDATA* sealDataAuth, //in
+      TPM_AUTH_SESSION*   pubAuth  // in, out
+      );
+
+TPM_RESULT TPM_Unseal (
+      TPM_KEY_HANDLE parentHandle, // in
+      const TPM_STORED_DATA* sealedData,
+      UINT32*   outSize,  // out
+      BYTE**    out, //out
+      const TPM_AUTHDATA* key_usage_auth, //in
+      const TPM_AUTHDATA* data_usage_auth, //in
+      TPM_AUTH_SESSION*   keyAuth,  // in, out
+      TPM_AUTH_SESSION*   dataAuth  // in, out
+      );
+
+TPM_RESULT TPM_DirWriteAuth ( TPM_DIRINDEX  dirIndex,  // in
+      TPM_DIRVALUE  newContents, // in
+      TPM_AUTH_SESSION*   ownerAuth  // in, out
+      );
+
+TPM_RESULT TPM_DirRead ( TPM_DIRINDEX  dirIndex, // in
+      TPM_DIRVALUE*  dirValue // out
+      );
+
+TPM_RESULT TPM_Bind(
+      const TPM_KEY* key, //in
+      const BYTE* in, //in
+      UINT32 ilen, //in
+      BYTE* out //out, must be at least cipher block size
+      );
+
+TPM_RESULT TPM_UnBind (
+      TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32 ilen, //in
+      const BYTE* in, //
+      UINT32*   outDataSize, // out
+      BYTE*    outData, //out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth //in, out
+      );
+
+TPM_RESULT TPM_CreateWrapKey (
+      TCS_KEY_HANDLE  hWrappingKey,  // in
+      const TPM_AUTHDATA* osapSharedSecret,
+      const TPM_AUTHDATA* dataUsageAuth, //in
+      const TPM_AUTHDATA* dataMigrationAuth, //in
+      TPM_KEY*     key, //in
+      TPM_AUTH_SESSION*   pAuth    // in, out
+      );
+
+TPM_RESULT TPM_LoadKey (
+      TPM_KEY_HANDLE  parentHandle, //
+      const TPM_KEY* key, //in
+      TPM_HANDLE*  keyHandle,    // out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth
+      );
+
+TPM_RESULT TPM_GetPubKey (  TCS_KEY_HANDLE  hKey,   // in
+      TPM_AUTH_SESSION*   pAuth,   // in, out
+      UINT32*    pcPubKeySize, // out
+      BYTE**    prgbPubKey  // out
+      );
+
+TPM_RESULT TPM_EvictKey ( TCS_KEY_HANDLE  hKey  // in
+      );
+
+TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle, //in
+      TPM_RESOURCE_TYPE rt //in
+      );
+
+TPM_RESULT TPM_Sign ( TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32    areaToSignSize, // in
+      BYTE*    areaToSign,  // in
+      TPM_AUTH_SESSION*   privAuth,  // in, out
+      UINT32*    sigSize,  // out
+      BYTE**    sig    // out
+      );
+
+TPM_RESULT TPM_GetRandom (  UINT32*    bytesRequested, // in, out
+      BYTE*    randomBytes  // out
+      );
+
+TPM_RESULT TPM_StirRandom (  UINT32    inDataSize, // in
+      BYTE*    inData  // in
+      );
+
+TPM_RESULT TPM_ReadPubek (
+      TPM_PUBKEY* pubEK //out
+      );
+
+TPM_RESULT TPM_GetCapability(
+      TPM_CAPABILITY_AREA capArea,
+      UINT32 subCapSize,
+      const BYTE* subCap,
+      UINT32* respSize,
+      BYTE** resp);
+
+TPM_RESULT TPM_SaveState(void);
+
+TPM_RESULT TPM_CreateEndorsementKeyPair(
+      const TPM_KEY_PARMS* keyInfo,
+      TPM_PUBKEY* pubEK);
+
+TPM_RESULT TPM_TransmitData(
+      BYTE* in,
+      UINT32 insize,
+      BYTE* out,
+      UINT32* outsize);
+
+#endif //TPM_H
diff --git a/stubdom/vtpmmgr/tpmrsa.c b/stubdom/vtpmmgr/tpmrsa.c
new file mode 100644
index 0000000..56094e7
--- /dev/null
+++ b/stubdom/vtpmmgr/tpmrsa.c
@@ -0,0 +1,175 @@
+/*
+ *  The RSA public-key cryptosystem
+ *
+ *  Copyright (C) 2006-2011, Brainspark B.V.
+ *
+ *  This file is part of PolarSSL (http://www.polarssl.org)
+ *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
+ *
+ *  All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ *  RSA was designed by Ron Rivest, Adi Shamir and Len Adleman.
+ *
+ *  http://theory.lcs.mit.edu/~rivest/rsapaper.pdf
+ *  http://www.cacr.math.uwaterloo.ca/hac/about/chap8.pdf
+ */
+
+#include "tcg.h"
+#include "polarssl/sha1.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "tpmrsa.h"
+
+#define HASH_LEN 20
+
+void tpmrsa_set_pubkey(tpmrsa_context* ctx,
+      const unsigned char* key,
+      int keylen,
+      const unsigned char* exponent,
+      int explen) {
+
+   tpmrsa_free(ctx);
+
+   if(explen == 0) { //Default e= 2^16+1
+      mpi_lset(&ctx->E, 65537);
+   } else {
+      mpi_read_binary(&ctx->E, exponent, explen);
+   }
+   mpi_read_binary(&ctx->N, key, keylen);
+
+   ctx->len = ( mpi_msb(&ctx->N) + 7) >> 3;
+}
+
+static TPM_RESULT tpmrsa_public( tpmrsa_context *ctx,
+      const unsigned char *input,
+      unsigned char *output )
+{
+   int ret;
+   size_t olen;
+   mpi T;
+
+   mpi_init( &T );
+
+   MPI_CHK( mpi_read_binary( &T, input, ctx->len ) );
+
+   if( mpi_cmp_mpi( &T, &ctx->N ) >= 0 )
+   {
+      mpi_free( &T );
+      return TPM_ENCRYPT_ERROR;
+   }
+
+   olen = ctx->len;
+   MPI_CHK( mpi_exp_mod( &T, &T, &ctx->E, &ctx->N, &ctx->RN ) );
+   MPI_CHK( mpi_write_binary( &T, output, olen ) );
+
+cleanup:
+
+   mpi_free( &T );
+
+   if( ret != 0 )
+      return TPM_ENCRYPT_ERROR;
+
+   return TPM_SUCCESS;
+}
+
+static void mgf_mask( unsigned char *dst, int dlen, unsigned char *src, int slen)
+{
+   unsigned char mask[HASH_LEN];
+   unsigned char counter[4] = {0, 0, 0, 0};
+   int i;
+   sha1_context mctx;
+
+   //We always hash the src with the counter, so save the partial hash
+   sha1_starts(&mctx);
+   sha1_update(&mctx, src, slen);
+
+   // Generate and apply dbMask
+   while(dlen > 0) {
+      //Copy the sha1 context
+      sha1_context ctx = mctx;
+
+      //compute hash for input || counter
+      sha1_update(&ctx, counter, sizeof(counter));
+      sha1_finish(&ctx, mask);
+
+      //Apply the mask
+      for(i = 0; i < (dlen < HASH_LEN ? dlen : HASH_LEN); ++i) {
+         *(dst++) ^= mask[i];
+      }
+
+      //Increment counter
+      ++counter[3];
+
+      dlen -= HASH_LEN;
+   }
+}
+
+/*
+ * Add the message padding, then do an RSA operation
+ */
+TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
+      int (*f_rng)(void *, unsigned char *, size_t),
+      void *p_rng,
+      size_t ilen,
+      const unsigned char *input,
+      unsigned char *output )
+{
+   int ret;
+   int olen;
+   unsigned char* seed = output + 1;
+   unsigned char* db = output + HASH_LEN +1;
+
+   olen = ctx->len-1;
+
+   if( f_rng == NULL )
+      return TPM_ENCRYPT_ERROR;
+
+   if( ilen > olen - 2 * HASH_LEN - 1)
+      return TPM_ENCRYPT_ERROR;
+
+   output[0] = 0;
+
+   //Encoding parameter p
+   sha1((unsigned char*)"TCPA", 4, db);
+
+   //PS
+   memset(db + HASH_LEN, 0,
+         olen - ilen - 2 * HASH_LEN - 1);
+
+   //constant 1 byte
+   db[olen - ilen - HASH_LEN -1] = 0x01;
+
+   //input string
+   memcpy(db + olen - ilen - HASH_LEN,
+         input, ilen);
+
+   //Generate random seed
+   if( ( ret = f_rng( p_rng, seed, HASH_LEN ) ) != 0 )
+      return TPM_ENCRYPT_ERROR;
+
+   // maskedDB: Apply dbMask to DB
+   mgf_mask( db, olen - HASH_LEN, seed, HASH_LEN);
+
+   // maskedSeed: Apply seedMask to seed
+   mgf_mask( seed, HASH_LEN, db, olen - HASH_LEN);
+
+   // Do the crypto op
+   return tpmrsa_public(ctx, output, output);
+}
diff --git a/stubdom/vtpmmgr/tpmrsa.h b/stubdom/vtpmmgr/tpmrsa.h
new file mode 100644
index 0000000..59579e7
--- /dev/null
+++ b/stubdom/vtpmmgr/tpmrsa.h
@@ -0,0 +1,67 @@
+/**
+ * \file rsa.h
+ *
+ * \brief The RSA public-key cryptosystem
+ *
+ *  Copyright (C) 2006-2010, Brainspark B.V.
+ *
+ *  This file is part of PolarSSL (http://www.polarssl.org)
+ *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
+ *
+ *  All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef TPMRSA_H
+#define TPMRSA_H
+
+#include "tcg.h"
+#include <polarssl/bignum.h>
+
+/* tpm software key */
+typedef struct
+{
+    size_t len;                 /*!<  size(N) in chars  */
+
+    mpi N;                      /*!<  public modulus    */
+    mpi E;                      /*!<  public exponent   */
+
+    mpi RN;                     /*!<  cached R^2 mod N  */
+}
+tpmrsa_context;
+
+#define TPMRSA_CTX_INIT { 0, {0, 0, NULL}, {0, 0, NULL}, {0, 0, NULL}}
+
+/* Setup the rsa context using tpm public key data */
+void tpmrsa_set_pubkey(tpmrsa_context* ctx,
+      const unsigned char* key,
+      int keylen,
+      const unsigned char* exponent,
+      int explen);
+
+/* Do rsa public crypto */
+TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
+      int (*f_rng)(void *, unsigned char *, size_t),
+      void *p_rng,
+      size_t ilen,
+      const unsigned char *input,
+      unsigned char *output );
+
+/* free tpmrsa key */
+inline void tpmrsa_free( tpmrsa_context *ctx ) {
+   mpi_free( &ctx->RN ); mpi_free( &ctx->E  ); mpi_free( &ctx->N  );
+}
+
+#endif /* tpmrsa.h */
diff --git a/stubdom/vtpmmgr/uuid.h b/stubdom/vtpmmgr/uuid.h
new file mode 100644
index 0000000..4737645
--- /dev/null
+++ b/stubdom/vtpmmgr/uuid.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPMMGR_UUID_H
+#define VTPMMGR_UUID_H
+
+#define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
+#define UUID_FMTLEN ((2*16)+4) /* 16 hex bytes plus 4 hypens */
+#define UUID_BYTES(uuid) uuid[0], uuid[1], uuid[2], uuid[3], \
+                                uuid[4], uuid[5], uuid[6], uuid[7], \
+                                uuid[8], uuid[9], uuid[10], uuid[11], \
+                                uuid[12], uuid[13], uuid[14], uuid[15]
+
+
+typedef uint8_t uuid_t[16];
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_cmd_handler.c b/stubdom/vtpmmgr/vtpm_cmd_handler.c
new file mode 100644
index 0000000..f82a2a9
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_cmd_handler.c
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <inttypes.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "marshal.h"
+#include "log.h"
+#include "vtpm_storage.h"
+#include "vtpmmgr.h"
+#include "tpm.h"
+#include "tcg.h"
+
+static TPM_RESULT vtpmmgr_SaveHashKey(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+
+   if(tpmcmd->req_len != VTPM_COMMAND_HEADER_SIZE + HASHKEYSZ) {
+      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_ORD_SAVEHASHKEY hashkey too short!\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   /* Do the command */
+   TPMTRYRETURN(vtpm_storage_save_hashkey(uuid, tpmcmd->req + VTPM_COMMAND_HEADER_SIZE));
+
+abort_egress:
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         VTPM_TAG_RSP, VTPM_COMMAND_HEADER_SIZE, status);
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+
+   return status;
+}
+
+static TPM_RESULT vtpmmgr_LoadHashKey(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+
+   TPMTRYRETURN(vtpm_storage_load_hashkey(uuid, tpmcmd->resp + VTPM_COMMAND_HEADER_SIZE));
+
+   tpmcmd->resp_len += HASHKEYSZ;
+
+abort_egress:
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         VTPM_TAG_RSP, tpmcmd->resp_len, status);
+
+   return status;
+}
+
+
+TPM_RESULT vtpmmgr_handle_cmd(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_TAG tag;
+   UINT32 size;
+   TPM_COMMAND_CODE ord;
+
+   unpack_TPM_RQU_HEADER(tpmcmd->req,
+         &tag, &size, &ord);
+
+   /* Handle the command now */
+   switch(tag) {
+      case VTPM_TAG_REQ:
+         //This is a vTPM command
+         switch(ord) {
+            case VTPM_ORD_SAVEHASHKEY:
+               return vtpmmgr_SaveHashKey(uuid, tpmcmd);
+            case VTPM_ORD_LOADHASHKEY:
+               return vtpmmgr_LoadHashKey(uuid, tpmcmd);
+            default:
+               vtpmlogerror(VTPM_LOG_VTPM, "Invalid vTPM Ordinal %" PRIu32 "\n", ord);
+               status = TPM_BAD_ORDINAL;
+         }
+         break;
+      case TPM_TAG_RQU_COMMAND:
+      case TPM_TAG_RQU_AUTH1_COMMAND:
+      case TPM_TAG_RQU_AUTH2_COMMAND:
+         //This is a TPM passthrough command
+         switch(ord) {
+            case TPM_ORD_GetRandom:
+               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_GetRandom\n");
+               break;
+            case TPM_ORD_PcrRead:
+               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_PcrRead\n");
+               break;
+            default:
+               vtpmlogerror(VTPM_LOG_VTPM, "TPM Disallowed Passthrough ord=%" PRIu32 "\n", ord);
+               status = TPM_DISABLED_CMD;
+               goto abort_egress;
+         }
+
+         size = TCPA_MAX_BUFFER_LENGTH;
+         TPMTRYRETURN(TPM_TransmitData(tpmcmd->req, tpmcmd->req_len, tpmcmd->resp, &size));
+         tpmcmd->resp_len = size;
+
+         unpack_TPM_RESULT(tpmcmd->resp + sizeof(TPM_TAG) + sizeof(UINT32), &status);
+         return status;
+
+         break;
+      default:
+         vtpmlogerror(VTPM_LOG_VTPM, "Invalid tag=%" PRIu16 "\n", tag);
+         status = TPM_BADTAG;
+   }
+
+abort_egress:
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         tag + 3, tpmcmd->resp_len, status);
+
+   return status;
+}
diff --git a/stubdom/vtpmmgr/vtpm_manager.h b/stubdom/vtpmmgr/vtpm_manager.h
new file mode 100644
index 0000000..a2bbcca
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_manager.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPM_MANAGER_H
+#define VTPM_MANAGER_H
+
+#define VTPM_TAG_REQ 0x01c1
+#define VTPM_TAG_RSP 0x01c4
+#define COMMAND_BUFFER_SIZE 4096
+
+// Header size
+#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
+
+//************************ Command Codes ****************************
+#define VTPM_ORD_BASE       0x0000
+#define VTPM_PRIV_MASK      0x01000000 // Priviledged VTPM Command
+#define VTPM_PRIV_BASE      (VTPM_ORD_BASE | VTPM_PRIV_MASK)
+
+// Non-priviledged VTPM Commands (From DMI's)
+#define VTPM_ORD_SAVEHASHKEY      (VTPM_ORD_BASE + 1) // DMI requests encryption key for persistent storage
+#define VTPM_ORD_LOADHASHKEY      (VTPM_ORD_BASE + 2) // DMI requests symkey to be regenerated
+
+//************************ Return Codes ****************************
+#define VTPM_SUCCESS               0
+#define VTPM_FAIL                  1
+#define VTPM_UNSUPPORTED           2
+#define VTPM_FORBIDDEN             3
+#define VTPM_RESTORE_CONTEXT_FAILED    4
+#define VTPM_INVALID_REQUEST       5
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_storage.c b/stubdom/vtpmmgr/vtpm_storage.c
new file mode 100644
index 0000000..9ce0c32
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_storage.c
@@ -0,0 +1,794 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+/***************************************************************
+ * DISK IMAGE LAYOUT
+ * *************************************************************
+ * All data is stored in BIG ENDIAN format
+ * *************************************************************
+ * Section 1: Header
+ *
+ * 10 bytes 	 id			ID String "VTPMMGRDOM"
+ * uint32_t	 version	        Disk Image version number (current == 1)
+ * uint32_t      storage_key_len	Length of the storage Key
+ * TPM_KEY       storage_key		Marshalled TPM_KEY structure (See TPM spec v2)
+ * RSA_BLOCK     aes_crypto             Encrypted aes key data (RSA_CIPHER_SIZE bytes), bound by the storage_key
+ *  BYTE[32] aes_key                    Aes key for encrypting the uuid table
+ *  uint32_t cipher_sz                  Encrypted size of the uuid table
+ *
+ * *************************************************************
+ * Section 2: Uuid Table
+ * 
+ * This table is encrypted by the aes_key in the header. The cipher text size is just
+ * large enough to hold all of the entries plus required padding.
+ *
+ * Each entry is as follows
+ * BYTE[16] uuid                       Uuid of a vtpm that is stored on this disk
+ * uint32_t offset                     Disk offset where the vtpm data is stored
+ *
+ * *************************************************************
+ * Section 3: Vtpm Table
+ *
+ * The rest of the disk stores vtpms. Each vtpm is an RSA_BLOCK encrypted
+ * by the storage key. Each vtpm must exist on an RSA_BLOCK aligned boundary,
+ * starting at the first RSA_BLOCK aligned offset after the uuid table.
+ * As the uuid table grows, vtpms may be relocated.
+ *
+ * RSA_BLOCK     vtpm_crypto          Vtpm data encrypted by storage_key
+ *   BYTE[20]    hash                 Sha1 hash of vtpm encrypted data
+ *   BYTE[16]    vtpm_aes_key         Encryption key for vtpm data
+ *
+  *************************************************************
+ */
+#define DISKVERS 1
+#define IDSTR "VTPMMGRDOM"
+#define IDSTRLEN 10
+#define AES_BLOCK_SIZE 16
+#define AES_KEY_BITS 256
+#define AES_KEY_SIZE (AES_KEY_BITS/8)
+#define BUF_SIZE 4096
+
+#define UUID_TBL_ENT_SIZE (sizeof(uuid_t) + sizeof(uint32_t))
+
+#define HEADERSZ (10 + 4 + 4)
+
+#define TRY_READ(buf, size, msg) do {\
+   int rc; \
+   if((rc = read(blkfront_fd, buf, (size))) != (size)) { \
+      vtpmlogerror(VTPM_LOG_VTPM, "read() failed! " msg " : rc=(%d/%d), error=(%s)\n", rc, (int)(size), strerror(errno)); \
+      status = TPM_IOERROR;\
+      goto abort_egress;\
+   } \
+} while(0)
+
+#define TRY_WRITE(buf, size, msg) do {\
+   int rc; \
+   if((rc = write(blkfront_fd, buf, (size))) != (size)) { \
+      vtpmlogerror(VTPM_LOG_VTPM, "write() failed! " msg " : rc=(%d/%d), error=(%s)\n", rc, (int)(size), strerror(errno)); \
+      status = TPM_IOERROR;\
+      goto abort_egress;\
+   } \
+} while(0)
+
+#include <blkfront.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <mini-os/byteorder.h>
+#include <polarssl/aes.h>
+
+#include "vtpm_manager.h"
+#include "log.h"
+#include "marshal.h"
+#include "tpm.h"
+#include "uuid.h"
+
+#include "vtpmmgr.h"
+#include "vtpm_storage.h"
+
+#define MAX(a,b) ( ((a) > (b)) ? (a) : (b) )
+#define MIN(a,b) ( ((a) < (b)) ? (a) : (b) )
+
+/* blkfront device objets */
+static struct blkfront_dev* blkdev = NULL;
+static int blkfront_fd = -1;
+
+struct Vtpm {
+   uuid_t uuid;
+   int offset;
+};
+struct Storage {
+   int aes_offset;
+   int uuid_offset;
+   int end_offset;
+
+   int num_vtpms;
+   int num_vtpms_alloced;
+   struct Vtpm* vtpms;
+};
+
+/* Global storage data */
+static struct Storage g_store = {
+   .vtpms = NULL,
+};
+
+static int get_offset(void) {
+   return lseek(blkfront_fd, 0, SEEK_CUR);
+}
+
+static void reset_store(void) {
+   g_store.aes_offset = 0;
+   g_store.uuid_offset = 0;
+   g_store.end_offset = 0;
+
+   g_store.num_vtpms = 0;
+   g_store.num_vtpms_alloced = 0;
+   free(g_store.vtpms);
+   g_store.vtpms = NULL;
+}
+
+static int vtpm_get_index(const uuid_t uuid) {
+   int st = 0;
+   int ed = g_store.num_vtpms-1;
+   while(st <= ed) {
+      int mid = ((unsigned int)st + (unsigned int)ed) >> 1; //avoid overflow
+      int c = memcmp(uuid, &g_store.vtpms[mid].uuid, sizeof(uuid_t));
+      if(c == 0) {
+         return mid;
+      } else if(c > 0) {
+         st = mid + 1;
+      } else {
+         ed = mid - 1;
+      }
+   }
+   return -(st + 1);
+}
+
+static void vtpm_add(const uuid_t uuid, int offset, int index) {
+   /* Realloc more space if needed */
+   if(g_store.num_vtpms >= g_store.num_vtpms_alloced) {
+      g_store.num_vtpms_alloced += 16;
+      g_store.vtpms = realloc(
+            g_store.vtpms,
+            sizeof(struct Vtpm) * g_store.num_vtpms_alloced);
+   }
+
+   /* Move everybody after the new guy */
+   for(int i = g_store.num_vtpms; i > index; --i) {
+      g_store.vtpms[i] = g_store.vtpms[i-1];
+   }
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Registered vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+
+   /* Finally add new one */
+   memcpy(g_store.vtpms[index].uuid, uuid, sizeof(uuid_t));
+   g_store.vtpms[index].offset = offset;
+   ++g_store.num_vtpms;
+}
+
+#if 0
+static void vtpm_remove(int index) {
+   for(i = index; i < g_store.num_vtpms; ++i) {
+      g_store.vtpms[i] = g_store.vtpms[i+1];
+   }
+   --g_store.num_vtpms;
+}
+#endif
+
+static int pack_uuid_table(uint8_t* table, int size, int* nvtpms) {
+   uint8_t* ptr = table;
+   while(*nvtpms < g_store.num_vtpms && size >= 0)
+   {
+      /* Pack the uuid */
+      memcpy(ptr, (uint8_t*)g_store.vtpms[*nvtpms].uuid, sizeof(uuid_t));
+      ptr+= sizeof(uuid_t);
+
+
+      /* Pack the offset */
+      ptr = pack_UINT32(ptr, g_store.vtpms[*nvtpms].offset);
+
+      ++*nvtpms;
+      size -= UUID_TBL_ENT_SIZE;
+   }
+   return ptr - table;
+}
+
+/* Extract the uuids */
+static int extract_uuid_table(uint8_t* table, int size) {
+   uint8_t* ptr = table;
+   for(;size >= UUID_TBL_ENT_SIZE; size -= UUID_TBL_ENT_SIZE) {
+      int index;
+      uint32_t v32;
+
+      /*uuid_t is just an array of bytes, so we can do a direct cast here */
+      uint8_t* uuid = ptr;
+      ptr += sizeof(uuid_t);
+
+      /* Get the offset of the key */
+      ptr = unpack_UINT32(ptr, &v32);
+
+      /* Insert the new vtpm in sorted order */
+      if((index = vtpm_get_index(uuid)) >= 0) {
+         vtpmlogerror(VTPM_LOG_VTPM, "Vtpm (" UUID_FMT ") exists multiple times! ignoring...\n", UUID_BYTES(uuid));
+         continue;
+      }
+      index = -index -1;
+
+      vtpm_add(uuid, v32, index);
+
+   }
+   return ptr - table;
+}
+
+static void vtpm_decrypt_block(aes_context* aes,
+      uint8_t* iv,
+      uint8_t* cipher,
+      uint8_t* plain,
+      int cipher_sz,
+      int* overlap)
+{
+   int bytes_ext;
+   /* Decrypt */
+   aes_crypt_cbc(aes, AES_DECRYPT,
+         cipher_sz,
+         iv, cipher, plain + *overlap);
+
+   /* Extract */
+   bytes_ext = extract_uuid_table(plain, cipher_sz + *overlap);
+
+   /* Copy left overs to the beginning */
+   *overlap = cipher_sz + *overlap - bytes_ext;
+   memcpy(plain, plain + bytes_ext, *overlap);
+}
+
+static int vtpm_encrypt_block(aes_context* aes,
+      uint8_t* iv,
+      uint8_t* plain,
+      uint8_t* cipher,
+      int block_sz,
+      int* overlap,
+      int* num_vtpms)
+{
+   int bytes_to_crypt;
+   int bytes_packed;
+
+   /* Pack the uuid table */
+   bytes_packed = *overlap + pack_uuid_table(plain + *overlap, block_sz - *overlap, num_vtpms);
+   bytes_to_crypt = MIN(bytes_packed, block_sz);
+
+   /* Add padding if we aren't on a multiple of the block size */
+   if(bytes_to_crypt & (AES_BLOCK_SIZE-1)) {
+      int oldsz = bytes_to_crypt;
+      //add padding
+      bytes_to_crypt += AES_BLOCK_SIZE - (bytes_to_crypt & (AES_BLOCK_SIZE-1));
+      //fill padding with random bytes
+      vtpmmgr_rand(plain + oldsz, bytes_to_crypt - oldsz);
+      *overlap = 0;
+   } else {
+      *overlap = bytes_packed - bytes_to_crypt;
+   }
+
+   /* Encrypt this chunk */
+   aes_crypt_cbc(aes, AES_ENCRYPT,
+            bytes_to_crypt,
+            iv, plain, cipher);
+
+   /* Copy the left over partials to the beginning */
+   memcpy(plain, plain + bytes_to_crypt, *overlap);
+
+   return bytes_to_crypt;
+}
+
+static TPM_RESULT vtpm_storage_new_vtpm(const uuid_t uuid, int index) {
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
+   uint8_t buf[BUF_SIZE];
+   uint8_t* ptr;
+   int cipher_sz;
+   aes_context aes;
+
+   /* Add new vtpm to the table */
+   vtpm_add(uuid, g_store.end_offset, index);
+   g_store.end_offset += RSA_CIPHER_SIZE;
+
+   /* Compute the new end location of the encrypted uuid table */
+   cipher_sz = AES_BLOCK_SIZE; //IV
+   cipher_sz += g_store.num_vtpms * UUID_TBL_ENT_SIZE; //uuid table
+   cipher_sz += (AES_BLOCK_SIZE - (cipher_sz & (AES_BLOCK_SIZE -1))) & (AES_BLOCK_SIZE-1); //aes padding
+
+   /* Does this overlap any key data? If so they need to be relocated */
+   int uuid_end = (g_store.uuid_offset + cipher_sz + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+   for(int i = 0; i < g_store.num_vtpms; ++i) {
+      if(g_store.vtpms[i].offset < uuid_end) {
+
+         vtpmloginfo(VTPM_LOG_VTPM, "Relocating vtpm data\n");
+
+         //Read the hashkey cipher text
+         lseek(blkfront_fd, g_store.vtpms[i].offset, SEEK_SET);
+         TRY_READ(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
+
+         //Write the cipher text to new offset
+         lseek(blkfront_fd, g_store.end_offset, SEEK_SET);
+         TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
+
+         //Save new offset
+         g_store.vtpms[i].offset = g_store.end_offset;
+         g_store.end_offset += RSA_CIPHER_SIZE;
+      }
+   }
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Generating a new symmetric key\n");
+
+   /* Generate an aes key */
+   TPMTRYRETURN(vtpmmgr_rand(plain, AES_KEY_SIZE));
+   aes_setkey_enc(&aes, plain, AES_KEY_BITS);
+   ptr = plain + AES_KEY_SIZE;
+
+   /* Pack the crypted size */
+   ptr = pack_UINT32(ptr, cipher_sz);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Binding encrypted key\n");
+
+   /* Seal the key and size */
+   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
+            plain,
+            ptr - plain,
+            buf));
+
+   /* Write the sealed key to disk */
+   lseek(blkfront_fd, g_store.aes_offset, SEEK_SET);
+   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm aes key");
+
+   /* ENCRYPT AND WRITE UUID TABLE */
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Encrypting the uuid table\n");
+
+   int num_vtpms = 0;
+   int overlap = 0;
+   int bytes_crypted;
+   uint8_t iv[AES_BLOCK_SIZE];
+
+   /* Generate the iv for the first block */
+   TPMTRYRETURN(vtpmmgr_rand(iv, AES_BLOCK_SIZE));
+
+   /* Copy the iv to the cipher text buffer to be written to disk */
+   memcpy(buf, iv, AES_BLOCK_SIZE);
+   ptr = buf + AES_BLOCK_SIZE;
+
+   /* Encrypt the first block of the uuid table */
+   bytes_crypted = vtpm_encrypt_block(&aes,
+         iv, //iv
+         plain, //plaintext
+         ptr, //cipher text
+         BUF_SIZE - AES_BLOCK_SIZE,
+         &overlap,
+         &num_vtpms);
+
+   /* Write the iv followed by the crypted table*/
+   TRY_WRITE(buf, bytes_crypted + AES_BLOCK_SIZE, "vtpm uuid table");
+
+   /* Decrement the number of bytes encrypted */
+   cipher_sz -= bytes_crypted + AES_BLOCK_SIZE;
+
+   /* If there are more vtpms, encrypt and write them block by block */
+   while(cipher_sz > 0) {
+      /* Encrypt the next block of the uuid table */
+      bytes_crypted = vtpm_encrypt_block(&aes,
+               iv,
+               plain,
+               buf,
+               BUF_SIZE,
+               &overlap,
+               &num_vtpms);
+
+      /* Write the cipher text to disk */
+      TRY_WRITE(buf, bytes_crypted, "vtpm uuid table");
+
+      cipher_sz -= bytes_crypted;
+   }
+
+   goto egress;
+abort_egress:
+egress:
+   return status;
+}
+
+
+/**************************************
+ * PUBLIC FUNCTIONS
+ * ***********************************/
+
+int vtpm_storage_init(void) {
+   struct blkfront_info info;
+   if((blkdev = init_blkfront(NULL, &info)) == NULL) {
+      return -1;
+   }
+   if((blkfront_fd = blkfront_open(blkdev)) < 0) {
+      return -1;
+   }
+   return 0;
+}
+
+void vtpm_storage_shutdown(void) {
+   reset_store();
+   close(blkfront_fd);
+}
+
+TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ])
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   int index;
+   uint8_t cipher[RSA_CIPHER_SIZE];
+   uint8_t clear[RSA_CIPHER_SIZE];
+   UINT32 clear_size;
+
+   /* Find the index of this uuid */
+   if((index = vtpm_get_index(uuid)) < 0) {
+      index = -index-1;
+      vtpmlogerror(VTPM_LOG_VTPM, "LoadKey failure: Unrecognized uuid! " UUID_FMT "\n", UUID_BYTES(uuid));
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   /* Read the table entry */
+   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
+   TRY_READ(cipher, RSA_CIPHER_SIZE, "vtpm hashkey data");
+
+   /* Decrypt the table entry */
+   TPMTRYRETURN(TPM_UnBind(
+            vtpm_globals.storage_key_handle,
+            RSA_CIPHER_SIZE,
+            cipher,
+            &clear_size,
+            clear,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.oiap));
+
+   if(clear_size < HASHKEYSZ) {
+      vtpmloginfo(VTPM_LOG_VTPM, "Decrypted Hash key size (%" PRIu32 ") was too small!\n", clear_size);
+      status = TPM_RESOURCES;
+      goto abort_egress;
+   }
+
+   memcpy(hashkey, clear, HASHKEYSZ);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Loaded hash and key for vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+   goto egress;
+abort_egress:
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load key\n");
+egress:
+   return status;
+}
+
+TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ])
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   int index;
+   uint8_t buf[RSA_CIPHER_SIZE];
+
+   /* Find the index of this uuid */
+   if((index = vtpm_get_index(uuid)) < 0) {
+      index = -index-1;
+      /* Create a new vtpm */
+      TPMTRYRETURN( vtpm_storage_new_vtpm(uuid, index) );
+   }
+
+   /* Encrypt the hash and key */
+   TPMTRYRETURN( TPM_Bind(&vtpm_globals.storage_key,
+            hashkey,
+            HASHKEYSZ,
+            buf));
+
+   /* Write to disk */
+   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
+   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey data");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saved hash and key for vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+   goto egress;
+abort_egress:
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to save key\n");
+egress:
+   return status;
+}
+
+TPM_RESULT vtpm_storage_new_header()
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t buf[BUF_SIZE];
+   uint8_t keybuf[AES_KEY_SIZE + sizeof(uint32_t)];
+   uint8_t* ptr = buf;
+   uint8_t* sptr;
+
+   /* Clear everything first */
+   reset_store();
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Creating new disk image header\n");
+
+   /*Copy the ID string */
+   memcpy(ptr, IDSTR, IDSTRLEN);
+   ptr += IDSTRLEN;
+
+   /*Copy the version */
+   ptr = pack_UINT32(ptr, DISKVERS);
+
+   /*Save the location of the key size */
+   sptr = ptr;
+   ptr += sizeof(UINT32);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saving root storage key..\n");
+
+   /* Copy the storage key */
+   ptr = pack_TPM_KEY(ptr, &vtpm_globals.storage_key);
+
+   /* Now save the size */
+   pack_UINT32(sptr, ptr - (sptr + 4));
+
+   /* Create a fake aes key and set cipher text size to 0 */
+   memset(keybuf, 0, sizeof(keybuf));
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Binding uuid table symmetric key..\n");
+
+   /* Save the location of the aes key */
+   g_store.aes_offset = ptr - buf;
+
+   /* Store the fake aes key and vtpm count */
+   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
+         keybuf,
+         sizeof(keybuf),
+         ptr));
+   ptr+= RSA_CIPHER_SIZE;
+
+   /* Write the header to disk */
+   lseek(blkfront_fd, 0, SEEK_SET);
+   TRY_WRITE(buf, ptr-buf, "vtpm header");
+
+   /* Save the location of the uuid table */
+   g_store.uuid_offset = get_offset();
+
+   /* Save the end offset */
+   g_store.end_offset = (g_store.uuid_offset + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saved new manager disk header.\n");
+
+   goto egress;
+abort_egress:
+egress:
+   return status;
+}
+
+
+TPM_RESULT vtpm_storage_load_header(void)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint32_t v32;
+   uint8_t buf[BUF_SIZE];
+   uint8_t* ptr = buf;
+   aes_context aes;
+
+   /* Clear everything first */
+   reset_store();
+
+   /* Read the header from disk */
+   lseek(blkfront_fd, 0, SEEK_SET);
+   TRY_READ(buf, IDSTRLEN + sizeof(UINT32) + sizeof(UINT32), "vtpm header");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Loading disk image header\n");
+
+   /* Verify the ID string */
+   if(memcmp(ptr, IDSTR, IDSTRLEN)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid ID string in disk image!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+   ptr+=IDSTRLEN;
+
+   /* Unpack the version */
+   ptr = unpack_UINT32(ptr, &v32);
+
+   /* Verify the version */
+   if(v32 != DISKVERS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unsupported disk image version number %" PRIu32 "\n", v32);
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   /* Size of the storage key */
+   ptr = unpack_UINT32(ptr, &v32);
+
+   /* Sanity check */
+   if(v32 > BUF_SIZE) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Size of storage key (%" PRIu32 ") is too large!\n", v32);
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* read the storage key */
+   TRY_READ(buf, v32, "storage pub key");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Unpacking storage key\n");
+
+   /* unpack the storage key */
+   ptr = unpack_TPM_KEY(buf, &vtpm_globals.storage_key, UNPACK_ALLOC);
+
+   /* Load Storage Key into the TPM */
+   TPMTRYRETURN( TPM_LoadKey(
+            TPM_SRK_KEYHANDLE,
+            &vtpm_globals.storage_key,
+            &vtpm_globals.storage_key_handle,
+            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+            &vtpm_globals.oiap));
+
+   /* Initialize the storage key auth */
+   memset(vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA));
+
+   /* Store the offset of the aes key */
+   g_store.aes_offset = get_offset();
+
+   /* Read the rsa cipher text for the aes key */
+   TRY_READ(buf, RSA_CIPHER_SIZE, "aes key");
+   ptr = buf + RSA_CIPHER_SIZE;
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Unbinding uuid table symmetric key\n");
+
+   /* Decrypt the aes key protecting the uuid table */
+   UINT32 datalen;
+   TPMTRYRETURN(TPM_UnBind(
+            vtpm_globals.storage_key_handle,
+            RSA_CIPHER_SIZE,
+            buf,
+            &datalen,
+            ptr,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.oiap));
+
+   /* Validate the length of the output buffer */
+   if(datalen < AES_KEY_SIZE + sizeof(UINT32)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unbound AES key size (%d) was too small! expected (%ld)\n", datalen, AES_KEY_SIZE + sizeof(UINT32));
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* Extract the aes key */
+   aes_setkey_dec(&aes, ptr, AES_KEY_BITS);
+   ptr+= AES_KEY_SIZE;
+
+   /* Extract the ciphertext size */
+   ptr = unpack_UINT32(ptr, &v32);
+   int cipher_size = v32;
+
+   /* Sanity check */
+   if(cipher_size & (AES_BLOCK_SIZE-1)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Cipher text size (%" PRIu32 ") is not a multiple of the aes block size! (%d)\n", v32, AES_BLOCK_SIZE);
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* Save the location of the uuid table */
+   g_store.uuid_offset = get_offset();
+
+   /* Only decrypt the table if there are vtpms to decrypt */
+   if(cipher_size > 0) {
+      int rbytes;
+      int overlap = 0;
+      uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
+      uint8_t iv[AES_BLOCK_SIZE];
+
+      vtpmloginfo(VTPM_LOG_VTPM, "Decrypting uuid table\n");
+
+      /* Pre allocate the vtpm array */
+      g_store.num_vtpms_alloced = cipher_size / UUID_TBL_ENT_SIZE;
+      g_store.vtpms = malloc(sizeof(struct Vtpm) * g_store.num_vtpms_alloced);
+
+      /* Read the iv and the first chunk of cipher text */
+      rbytes = MIN(cipher_size, BUF_SIZE);
+      TRY_READ(buf, rbytes, "vtpm uuid table\n");
+      cipher_size -= rbytes;
+
+      /* Copy the iv */
+      memcpy(iv, buf, AES_BLOCK_SIZE);
+      ptr = buf + AES_BLOCK_SIZE;
+
+      /* Remove the iv from the number of bytes to decrypt */
+      rbytes -= AES_BLOCK_SIZE;
+
+      /* Decrypt and extract vtpms */
+      vtpm_decrypt_block(&aes,
+            iv, ptr, plain,
+            rbytes, &overlap);
+
+      /* Read the rest of the table if there is more */
+      while(cipher_size > 0) {
+         /* Read next chunk of cipher text */
+         rbytes = MIN(cipher_size, BUF_SIZE);
+         TRY_READ(buf, rbytes, "vtpm uuid table");
+         cipher_size -= rbytes;
+
+         /* Decrypt a block of text */
+         vtpm_decrypt_block(&aes,
+               iv, buf, plain,
+               rbytes, &overlap);
+
+      }
+      vtpmloginfo(VTPM_LOG_VTPM, "Loaded %d vtpms!\n", g_store.num_vtpms);
+   }
+
+   /* The end of the key table, new vtpms go here */
+   int uuid_end = (get_offset() + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+   g_store.end_offset = uuid_end;
+
+   /* Compute the end offset while validating vtpms*/
+   for(int i = 0; i < g_store.num_vtpms; ++i) {
+      /* offset must not collide with previous data */
+      if(g_store.vtpms[i].offset < uuid_end) {
+         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
+               " offset (%d) is before end of uuid table (%d)!\n",
+               UUID_BYTES(g_store.vtpms[i].uuid),
+               g_store.vtpms[i].offset, uuid_end);
+         status = TPM_IOERROR;
+         goto abort_egress;
+      }
+      /* offset must be at a multiple of cipher size */
+      if(g_store.vtpms[i].offset & (RSA_CIPHER_SIZE-1)) {
+         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
+               " offset(%d) is not at a multiple of the rsa cipher text size (%d)!\n",
+               UUID_BYTES(g_store.vtpms[i].uuid),
+               g_store.vtpms[i].offset, RSA_CIPHER_SIZE);
+         status = TPM_IOERROR;
+         goto abort_egress;
+      }
+      /* Save the last offset */
+      if(g_store.vtpms[i].offset >= g_store.end_offset) {
+         g_store.end_offset = g_store.vtpms[i].offset + RSA_CIPHER_SIZE;
+      }
+   }
+
+   goto egress;
+abort_egress:
+   //An error occured somewhere
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load manager data!\n");
+
+   //Clear the data store
+   reset_store();
+
+   //Reset the storage key structure
+   free_TPM_KEY(&vtpm_globals.storage_key);
+   {
+      TPM_KEY key = TPM_KEY_INIT;
+      vtpm_globals.storage_key = key;
+   }
+
+   //Reset the storage key handle
+   TPM_EvictKey(vtpm_globals.storage_key_handle);
+   vtpm_globals.storage_key_handle = 0;
+egress:
+   return status;
+}
+
+#if 0
+/* For testing disk IO */
+void add_fake_vtpms(int num) {
+   for(int i = 0; i < num; ++i) {
+      uint32_t ind = cpu_to_be32(i);
+
+      uuid_t uuid;
+      memset(uuid, 0, sizeof(uuid_t));
+      memcpy(uuid, &ind, sizeof(ind));
+      int index = vtpm_get_index(uuid);
+      index = -index-1;
+
+      vtpm_storage_new_vtpm(uuid, index);
+   }
+}
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_storage.h b/stubdom/vtpmmgr/vtpm_storage.h
new file mode 100644
index 0000000..a5a5fd7
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_storage.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPM_STORAGE_H
+#define VTPM_STORAGE_h
+
+#include "uuid.h"
+
+#define VTPM_NVMKEY_SIZE 32
+#define HASHKEYSZ (sizeof(TPM_DIGEST) + VTPM_NVMKEY_SIZE)
+
+/* Initialize the storage system and its virtual disk */
+int vtpm_storage_init(void);
+
+/* Shutdown the storage system and its virtual disk */
+void vtpm_storage_shutdown(void);
+
+/* Loads Sha1 hash and 256 bit AES key from disk and stores them
+ * packed together in outbuf. outbuf must be freed
+ * by the caller using buffer_free()
+ */
+TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ]);
+
+/* inbuf must contain a sha1 hash followed by a 256 bit AES key.
+ * Encrypts and stores the hash and key to disk */
+TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ]);
+
+/* Load the vtpm manager data - call this on startup */
+TPM_RESULT vtpm_storage_load_header(void);
+
+/* Saves the vtpm manager data - call this on shutdown */
+TPM_RESULT vtpm_storage_new_header(void);
+
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpmmgr.c b/stubdom/vtpmmgr/vtpmmgr.c
new file mode 100644
index 0000000..563f4e8
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpmmgr.c
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdint.h>
+#include <mini-os/tpmback.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "log.h"
+
+#include "vtpmmgr.h"
+#include "tcg.h"
+
+
+void main_loop(void) {
+   tpmcmd_t* tpmcmd;
+   uint8_t respbuf[TCPA_MAX_BUFFER_LENGTH];
+
+   while(1) {
+      /* Wait for requests from a vtpm */
+      vtpmloginfo(VTPM_LOG_VTPM, "Waiting for commands from vTPM's:\n");
+      if((tpmcmd = tpmback_req_any()) == NULL) {
+         vtpmlogerror(VTPM_LOG_VTPM, "NULL tpmcmd\n");
+         continue;
+      }
+
+      tpmcmd->resp = respbuf;
+
+      /* Process the command */
+      vtpmmgr_handle_cmd(tpmcmd->uuid, tpmcmd);
+
+      /* Send response */
+      tpmback_resp(tpmcmd);
+   }
+}
+
+int main(int argc, char** argv)
+{
+   int rc = 0;
+   sleep(2);
+   vtpmloginfo(VTPM_LOG_VTPM, "Starting vTPM manager domain\n");
+
+   /* Initialize the vtpm manager */
+   if(vtpmmgr_init(argc, argv) != TPM_SUCCESS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize vtpmmgr domain!\n");
+      rc = -1;
+      goto exit;
+   }
+
+   main_loop();
+
+   vtpmloginfo(VTPM_LOG_VTPM, "vTPM Manager shutting down...\n");
+
+   vtpmmgr_shutdown();
+
+exit:
+   return rc;
+
+}
diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
new file mode 100644
index 0000000..50a1992
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPMMGR_H
+#define VTPMMGR_H
+
+#include <mini-os/tpmback.h>
+#include <polarssl/entropy.h>
+#include <polarssl/ctr_drbg.h>
+
+#include "uuid.h"
+#include "tcg.h"
+#include "vtpm_manager.h"
+
+#define RSA_KEY_SIZE 0x0800
+#define RSA_CIPHER_SIZE (RSA_KEY_SIZE / 8)
+
+struct vtpm_globals {
+   int tpm_fd;
+   TPM_KEY             storage_key;
+   TPM_HANDLE          storage_key_handle;       // Key used by persistent store
+   TPM_AUTH_SESSION    oiap;                // OIAP session for storageKey
+   TPM_AUTHDATA        storage_key_usage_auth;
+
+   TPM_AUTHDATA        owner_auth;
+   TPM_AUTHDATA        srk_auth;
+
+   entropy_context     entropy;
+   ctr_drbg_context    ctr_drbg;
+};
+
+// --------------------------- Global Values --------------------------
+extern struct vtpm_globals vtpm_globals;   // Key info and DMI states
+
+TPM_RESULT vtpmmgr_init(int argc, char** argv);
+void vtpmmgr_shutdown(void);
+
+TPM_RESULT vtpmmgr_handle_cmd(const uuid_t uuid, tpmcmd_t* tpmcmd);
+
+inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes) {
+   return ctr_drbg_random(&vtpm_globals.ctr_drbg, bytes, num_bytes) == 0 ? 0 : TPM_FAIL;
+}
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:22:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:22:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaoiZ-0005q4-0o; Tue, 20 Nov 2012 14:22:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaoiW-0005p6-KL
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:22:25 +0000
Received: from [85.158.139.83:26230] by server-1.bemta-5.messagelabs.com id
	CC/A1-05877-F129BA05; Tue, 20 Nov 2012 14:22:23 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-11.tower-182.messagelabs.com!1353421320!23895657!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3831 invoked from network); 20 Nov 2012 14:22:01 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-11.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 20 Nov 2012 14:22:01 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149572014;
	Tue, 20 Nov 2012 09:21:53 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org,
	Ian.Campbell@citrix.com
Date: Tue, 20 Nov 2012 09:21:10 -0500
Message-Id: <1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs to
	stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add 3 new libraries to stubdom:
libgmp
polarssl
Berlios TPM Emulator 0.7.4

Also adds makefile structure for vtpm-stubdom and vtpmmgrdom

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/Makefile           |  138 +++++++++++++++++++++++++++++++++++++++++++-
 stubdom/polarssl.patch     |   64 ++++++++++++++++++++
 stubdom/tpmemu-0.7.4.patch |   12 ++++
 3 files changed, 211 insertions(+), 3 deletions(-)
 create mode 100644 stubdom/polarssl.patch
 create mode 100644 stubdom/tpmemu-0.7.4.patch

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 50ba360..fc70d88 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -31,6 +31,18 @@ GRUB_VERSION=0.97
 OCAML_URL?=http://caml.inria.fr/pub/distrib/ocaml-3.11
 OCAML_VERSION=3.11.0
 
+GMP_VERSION=4.3.2
+GMP_URL?=$(XEN_EXTFILES_URL)
+#GMP_URL?=ftp://ftp.gmplib.org/pub/gmp-$(GMP_VERSION)
+
+POLARSSL_VERSION=1.1.4
+POLARSSL_URL?=$(XEN_EXTFILES_URL)
+#POLARSSL_URL?=http://polarssl.org/code/releases
+
+TPMEMU_VERSION=0.7.4
+TPMEMU_URL?=$(XEN_EXTFILES_URL)
+#TPMEMU_URL?=http://download.berlios.de/tpm-emulator
+
 WGET=wget -c
 
 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
@@ -74,12 +86,12 @@ TARGET_CPPFLAGS += -I$(XEN_ROOT)/xen/include
 
 TARGET_LDFLAGS += -nostdlib -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
 
-TARGETS=ioemu c caml grub xenstore
+TARGETS=ioemu c caml grub xenstore vtpm vtpmmgr
 
 .PHONY: all
 all: build
 ifeq ($(STUBDOM_SUPPORTED),1)
-build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom
+build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom vtpm-stubdom vtpmmgrdom
 else
 build: genpath
 endif
@@ -176,6 +188,76 @@ lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
 	touch $@
 
 #############
+# cross-gmp
+#############
+gmp-$(GMP_VERSION).tar.bz2:
+	$(WGET) $(GMP_URL)/$@
+
+.PHONY: cross-gmp
+ifeq ($(XEN_TARGET_ARCH), x86_32)
+   GMPEXT=ABI=32
+endif
+gmp-$(XEN_TARGET_ARCH): gmp-$(GMP_VERSION).tar.bz2 $(NEWLIB_STAMPFILE)
+	tar xjf $<
+	mv gmp-$(GMP_VERSION) $@
+	#patch -d $@ -p0 < gmp.patch
+	cd $@; CPPFLAGS="-isystem $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include $(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" CC=$(CC) $(GMPEXT) ./configure --disable-shared --enable-static --disable-fft --without-readline --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf
+	sed -i 's/#define HAVE_OBSTACK_VPRINTF 1/\/\/#define HAVE_OBSTACK_VPRINTF 1/' $@/config.h
+	touch $@
+
+GMP_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libgmp.a
+cross-gmp: $(GMP_STAMPFILE)
+$(GMP_STAMPFILE): gmp-$(XEN_TARGET_ARCH)
+	( cd $< && \
+	  $(MAKE) && \
+	  $(MAKE) install )
+
+#############
+# cross-polarssl
+#############
+polarssl-$(POLARSSL_VERSION)-gpl.tgz:
+	$(WGET) $(POLARSSL_URL)/$@
+
+polarssl-$(XEN_TARGET_ARCH): polarssl-$(POLARSSL_VERSION)-gpl.tgz
+	tar xzf $<
+	mv polarssl-$(POLARSSL_VERSION) $@
+	patch -d $@ -p1 < polarssl.patch
+	touch $@
+
+POLARSSL_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libpolarssl.a
+cross-polarssl: $(POLARSSL_STAMPFILE)
+$(POLARSSL_STAMPFILE): polarssl-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) lwip-$(XEN_TARGET_ARCH)
+	 ( cd $</library && \
+	   make CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I $(realpath $(MINI_OS)/include)" && \
+	   mkdir -p $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include && \
+	   cp -r ../include/* $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include && \
+	   mkdir -p $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib && \
+	   $(INSTALL_DATA) libpolarssl.a $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ )
+
+#############
+# cross-tpmemu
+#############
+tpm_emulator-$(TPMEMU_VERSION).tar.gz:
+	$(WGET) $(TPMEMU_URL)/$@
+
+tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
+	tar xzf $<
+	mv tpm_emulator-$(TPMEMU_VERSION) $@
+	patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
+	mkdir $@/build
+	cd $@/build; cmake .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
+	touch $@
+
+TPMEMU_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm.a
+$(TPMEMU_STAMPFILE): tpm_emulator-$(XEN_TARGET_ARCH) $(GMP_STAMPFILE)
+	( cd $</build && make VERBOSE=1 tpm_crypto tpm  )
+	cp $</build/crypto/libtpm_crypto.a $(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm_crypto.a
+	cp $</build/tpm/libtpm.a $(TPMEMU_STAMPFILE)
+
+.PHONY: cross-tpmemu
+cross-tpmemu: $(TPMEMU_STAMPFILE)
+
+#############
 # Cross-ocaml
 #############
 
@@ -319,6 +401,24 @@ c: $(CROSS_ROOT)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
 
 ######
+# VTPM
+######
+
+.PHONY: vtpm
+vtpm: cross-polarssl cross-tpmemu
+	make -C $(MINI_OS) links
+	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+
+######
+# VTPMMGR
+######
+
+.PHONY: vtpmmgr
+vtpmmgr: cross-polarssl
+	make -C $(MINI_OS) links
+	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+
+######
 # Grub
 ######
 
@@ -362,6 +462,14 @@ caml-stubdom: mini-os-$(XEN_TARGET_ARCH)-caml lwip-$(XEN_TARGET_ARCH) libxc cros
 c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxc c
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/c/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS=$(CURDIR)/c/main.a
 
+.PHONY: vtpm-stubdom
+vtpm-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpm vtpm
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpm/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpm/vtpm.a" APP_LDLIBS="-ltpm -ltpm_crypto -lgmp"
+
+.PHONY: vtpmmgrdom
+vtpmmgrdom: mini-os-$(XEN_TARGET_ARCH)-vtpmmgr vtpmmgr
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpmmgr/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpmmgr/vtpmmgr.a" APP_LDLIBS="-lm"
+
 .PHONY: pv-grub
 pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxc grub
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/grub/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a
@@ -375,7 +483,7 @@ xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxc xenstore
 #########
 
 ifeq ($(STUBDOM_SUPPORTED),1)
-install: genpath install-readme install-ioemu install-grub install-xenstore
+install: genpath install-readme install-ioemu install-grub install-xenstore install-vtpm install-vtpmmgr
 else
 install: genpath
 endif
@@ -399,6 +507,14 @@ install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/boot"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/xenstore-stubdom.gz"
 
+install-vtpm: vtpm-stubdom
+	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-vtpm/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpm-stubdom.gz"
+
+install-vtpmmgr: vtpm-stubdom
+	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-vtpmmgr/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpmmgrdom.gz"
+
 #######
 # clean
 #######
@@ -411,8 +527,12 @@ clean:
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-caml
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
+	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
+	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
 	$(MAKE) DESTDIR= -C caml clean
 	$(MAKE) DESTDIR= -C c clean
+	$(MAKE) -C vtpm clean
+	$(MAKE) -C vtpmmgr clean
 	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f $(STUBDOMPATH)
 	[ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
@@ -426,6 +546,10 @@ crossclean: clean
 	rm -fr newlib-$(XEN_TARGET_ARCH)
 	rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH)
 	rm -fr libxc-$(XEN_TARGET_ARCH) ioemu
+	rm -fr gmp-$(XEN_TARGET_ARCH)
+	rm -fr polarssl-$(XEN_TARGET_ARCH)
+	rm -fr openssl-$(XEN_TARGET_ARCH)
+	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -f mk-headers-$(XEN_TARGET_ARCH)
 	rm -fr ocaml-$(XEN_TARGET_ARCH)
 	rm -fr include
@@ -434,6 +558,10 @@ crossclean: clean
 .PHONY: patchclean
 patchclean: crossclean
 	rm -fr newlib-$(NEWLIB_VERSION)
+	rm -fr gmp-$(XEN_TARGET_ARCH)
+	rm -fr polarssl-$(XEN_TARGET_ARCH)
+	rm -fr openssl-$(XEN_TARGET_ARCH)
+	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -fr lwip-$(XEN_TARGET_ARCH)
 	rm -fr grub-upstream
 
@@ -442,10 +570,14 @@ patchclean: crossclean
 downloadclean: patchclean
 	rm -f newlib-$(NEWLIB_VERSION).tar.gz
 	rm -f zlib-$(ZLIB_VERSION).tar.gz
+	rm -f gmp-$(GMP_VERSION).tar.gz
+	rm -f tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	rm -f pciutils-$(LIBPCI_VERSION).tar.bz2
 	rm -f grub-$(GRUB_VERSION).tar.gz
 	rm -f lwip-$(LWIP_VERSION).tar.gz
 	rm -f ocaml-$(OCAML_VERSION).tar.gz
+	rm -f polarssl-$(POLARSSL_VERSION)-gpl.tgz
+	rm -f openssl-$(POLARSSL_VERSION)-gpl.tgz
 
 .PHONY: distclean
 distclean: downloadclean
diff --git a/stubdom/polarssl.patch b/stubdom/polarssl.patch
new file mode 100644
index 0000000..d387d4e
--- /dev/null
+++ b/stubdom/polarssl.patch
@@ -0,0 +1,64 @@
+diff -Naur polarssl-1.1.4/include/polarssl/config.h polarssl-x86_64/include/polarssl/config.h
+--- polarssl-1.1.4/include/polarssl/config.h	2011-12-22 05:06:27.000000000 -0500
++++ polarssl-x86_64/include/polarssl/config.h	2012-10-30 17:18:07.567001000 -0400
+@@ -164,8 +164,8 @@
+  * application.
+  *
+  * Uncomment this macro to prevent loading of default entropy functions.
+-#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
+  */
++#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
+
+ /**
+  * \def POLARSSL_NO_PLATFORM_ENTROPY
+@@ -175,8 +175,8 @@
+  * standards like the /dev/urandom or Windows CryptoAPI.
+  *
+  * Uncomment this macro to disable the built-in platform entropy functions.
+-#define POLARSSL_NO_PLATFORM_ENTROPY
+  */
++#define POLARSSL_NO_PLATFORM_ENTROPY
+
+ /**
+  * \def POLARSSL_PKCS1_V21
+@@ -426,8 +426,8 @@
+  * Requires: POLARSSL_TIMING_C
+  *
+  * This module enables the HAVEGE random number generator.
+- */
+ #define POLARSSL_HAVEGE_C
++ */
+
+ /**
+  * \def POLARSSL_MD_C
+@@ -490,7 +490,7 @@
+  *
+  * This module provides TCP/IP networking routines.
+  */
+-#define POLARSSL_NET_C
++//#define POLARSSL_NET_C
+
+ /**
+  * \def POLARSSL_PADLOCK_C
+@@ -644,8 +644,8 @@
+  * Caller:  library/havege.c
+  *
+  * This module is used by the HAVEGE random number generator.
+- */
+ #define POLARSSL_TIMING_C
++ */
+
+ /**
+  * \def POLARSSL_VERSION_C
+diff -Naur polarssl-1.1.4/library/bignum.c polarssl-x86_64/library/bignum.c
+--- polarssl-1.1.4/library/bignum.c	2012-04-29 16:15:55.000000000 -0400
++++ polarssl-x86_64/library/bignum.c	2012-10-30 17:21:52.135000999 -0400
+@@ -1101,7 +1101,7 @@
+             Z.p[i - t - 1] = ~0;
+         else
+         {
+-#if defined(POLARSSL_HAVE_LONGLONG)
++#if 0 //defined(POLARSSL_HAVE_LONGLONG)
+             t_udbl r;
+
+             r  = (t_udbl) X.p[i] << biL;
diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
new file mode 100644
index 0000000..b84eff1
--- /dev/null
+++ b/stubdom/tpmemu-0.7.4.patch
@@ -0,0 +1,12 @@
+diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
+--- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c	2012-04-27 10:55:46.581963398 -0400
++++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c	2012-04-27 10:56:02.193034152 -0400
+@@ -249,7 +249,7 @@
+ #else /* TPM_NO_EXTERN */
+
+ int (*tpm_extern_init)(void)                                      = NULL;
+-int (*tpm_extern_release)(void)                                   = NULL;
++void (*tpm_extern_release)(void)                                   = NULL;
+ void* (*tpm_malloc)(size_t size)                                  = NULL;
+ void (*tpm_free)(/*const*/ void *ptr)                             = NULL;
+ void (*tpm_log)(int priority, const char *fmt, ...)               = NULL;
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:22:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:22:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaoiZ-0005q4-0o; Tue, 20 Nov 2012 14:22:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaoiW-0005p6-KL
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:22:25 +0000
Received: from [85.158.139.83:26230] by server-1.bemta-5.messagelabs.com id
	CC/A1-05877-F129BA05; Tue, 20 Nov 2012 14:22:23 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-11.tower-182.messagelabs.com!1353421320!23895657!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3831 invoked from network); 20 Nov 2012 14:22:01 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-11.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 20 Nov 2012 14:22:01 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149572014;
	Tue, 20 Nov 2012 09:21:53 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org,
	Ian.Campbell@citrix.com
Date: Tue, 20 Nov 2012 09:21:10 -0500
Message-Id: <1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs to
	stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add 3 new libraries to stubdom:
libgmp
polarssl
Berlios TPM Emulator 0.7.4

Also adds makefile structure for vtpm-stubdom and vtpmmgrdom

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/Makefile           |  138 +++++++++++++++++++++++++++++++++++++++++++-
 stubdom/polarssl.patch     |   64 ++++++++++++++++++++
 stubdom/tpmemu-0.7.4.patch |   12 ++++
 3 files changed, 211 insertions(+), 3 deletions(-)
 create mode 100644 stubdom/polarssl.patch
 create mode 100644 stubdom/tpmemu-0.7.4.patch

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 50ba360..fc70d88 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -31,6 +31,18 @@ GRUB_VERSION=0.97
 OCAML_URL?=http://caml.inria.fr/pub/distrib/ocaml-3.11
 OCAML_VERSION=3.11.0
 
+GMP_VERSION=4.3.2
+GMP_URL?=$(XEN_EXTFILES_URL)
+#GMP_URL?=ftp://ftp.gmplib.org/pub/gmp-$(GMP_VERSION)
+
+POLARSSL_VERSION=1.1.4
+POLARSSL_URL?=$(XEN_EXTFILES_URL)
+#POLARSSL_URL?=http://polarssl.org/code/releases
+
+TPMEMU_VERSION=0.7.4
+TPMEMU_URL?=$(XEN_EXTFILES_URL)
+#TPMEMU_URL?=http://download.berlios.de/tpm-emulator
+
 WGET=wget -c
 
 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
@@ -74,12 +86,12 @@ TARGET_CPPFLAGS += -I$(XEN_ROOT)/xen/include
 
 TARGET_LDFLAGS += -nostdlib -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
 
-TARGETS=ioemu c caml grub xenstore
+TARGETS=ioemu c caml grub xenstore vtpm vtpmmgr
 
 .PHONY: all
 all: build
 ifeq ($(STUBDOM_SUPPORTED),1)
-build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom
+build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom vtpm-stubdom vtpmmgrdom
 else
 build: genpath
 endif
@@ -176,6 +188,76 @@ lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
 	touch $@
 
 #############
+# cross-gmp
+#############
+gmp-$(GMP_VERSION).tar.bz2:
+	$(WGET) $(GMP_URL)/$@
+
+.PHONY: cross-gmp
+ifeq ($(XEN_TARGET_ARCH), x86_32)
+   GMPEXT=ABI=32
+endif
+gmp-$(XEN_TARGET_ARCH): gmp-$(GMP_VERSION).tar.bz2 $(NEWLIB_STAMPFILE)
+	tar xjf $<
+	mv gmp-$(GMP_VERSION) $@
+	#patch -d $@ -p0 < gmp.patch
+	cd $@; CPPFLAGS="-isystem $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include $(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" CC=$(CC) $(GMPEXT) ./configure --disable-shared --enable-static --disable-fft --without-readline --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf
+	sed -i 's/#define HAVE_OBSTACK_VPRINTF 1/\/\/#define HAVE_OBSTACK_VPRINTF 1/' $@/config.h
+	touch $@
+
+GMP_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libgmp.a
+cross-gmp: $(GMP_STAMPFILE)
+$(GMP_STAMPFILE): gmp-$(XEN_TARGET_ARCH)
+	( cd $< && \
+	  $(MAKE) && \
+	  $(MAKE) install )
+
+#############
+# cross-polarssl
+#############
+polarssl-$(POLARSSL_VERSION)-gpl.tgz:
+	$(WGET) $(POLARSSL_URL)/$@
+
+polarssl-$(XEN_TARGET_ARCH): polarssl-$(POLARSSL_VERSION)-gpl.tgz
+	tar xzf $<
+	mv polarssl-$(POLARSSL_VERSION) $@
+	patch -d $@ -p1 < polarssl.patch
+	touch $@
+
+POLARSSL_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libpolarssl.a
+cross-polarssl: $(POLARSSL_STAMPFILE)
+$(POLARSSL_STAMPFILE): polarssl-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) lwip-$(XEN_TARGET_ARCH)
+	 ( cd $</library && \
+	   make CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I $(realpath $(MINI_OS)/include)" && \
+	   mkdir -p $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include && \
+	   cp -r ../include/* $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include && \
+	   mkdir -p $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib && \
+	   $(INSTALL_DATA) libpolarssl.a $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ )
+
+#############
+# cross-tpmemu
+#############
+tpm_emulator-$(TPMEMU_VERSION).tar.gz:
+	$(WGET) $(TPMEMU_URL)/$@
+
+tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
+	tar xzf $<
+	mv tpm_emulator-$(TPMEMU_VERSION) $@
+	patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
+	mkdir $@/build
+	cd $@/build; cmake .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
+	touch $@
+
+TPMEMU_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm.a
+$(TPMEMU_STAMPFILE): tpm_emulator-$(XEN_TARGET_ARCH) $(GMP_STAMPFILE)
+	( cd $</build && make VERBOSE=1 tpm_crypto tpm  )
+	cp $</build/crypto/libtpm_crypto.a $(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm_crypto.a
+	cp $</build/tpm/libtpm.a $(TPMEMU_STAMPFILE)
+
+.PHONY: cross-tpmemu
+cross-tpmemu: $(TPMEMU_STAMPFILE)
+
+#############
 # Cross-ocaml
 #############
 
@@ -319,6 +401,24 @@ c: $(CROSS_ROOT)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
 
 ######
+# VTPM
+######
+
+.PHONY: vtpm
+vtpm: cross-polarssl cross-tpmemu
+	make -C $(MINI_OS) links
+	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+
+######
+# VTPMMGR
+######
+
+.PHONY: vtpmmgr
+vtpmmgr: cross-polarssl
+	make -C $(MINI_OS) links
+	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+
+######
 # Grub
 ######
 
@@ -362,6 +462,14 @@ caml-stubdom: mini-os-$(XEN_TARGET_ARCH)-caml lwip-$(XEN_TARGET_ARCH) libxc cros
 c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxc c
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/c/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS=$(CURDIR)/c/main.a
 
+.PHONY: vtpm-stubdom
+vtpm-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpm vtpm
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpm/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpm/vtpm.a" APP_LDLIBS="-ltpm -ltpm_crypto -lgmp"
+
+.PHONY: vtpmmgrdom
+vtpmmgrdom: mini-os-$(XEN_TARGET_ARCH)-vtpmmgr vtpmmgr
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpmmgr/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpmmgr/vtpmmgr.a" APP_LDLIBS="-lm"
+
 .PHONY: pv-grub
 pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxc grub
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/grub/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a
@@ -375,7 +483,7 @@ xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxc xenstore
 #########
 
 ifeq ($(STUBDOM_SUPPORTED),1)
-install: genpath install-readme install-ioemu install-grub install-xenstore
+install: genpath install-readme install-ioemu install-grub install-xenstore install-vtpm install-vtpmmgr
 else
 install: genpath
 endif
@@ -399,6 +507,14 @@ install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/boot"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/xenstore-stubdom.gz"
 
+install-vtpm: vtpm-stubdom
+	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-vtpm/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpm-stubdom.gz"
+
+install-vtpmmgr: vtpm-stubdom
+	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-vtpmmgr/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpmmgrdom.gz"
+
 #######
 # clean
 #######
@@ -411,8 +527,12 @@ clean:
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-caml
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
+	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
+	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
 	$(MAKE) DESTDIR= -C caml clean
 	$(MAKE) DESTDIR= -C c clean
+	$(MAKE) -C vtpm clean
+	$(MAKE) -C vtpmmgr clean
 	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f $(STUBDOMPATH)
 	[ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
@@ -426,6 +546,10 @@ crossclean: clean
 	rm -fr newlib-$(XEN_TARGET_ARCH)
 	rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH)
 	rm -fr libxc-$(XEN_TARGET_ARCH) ioemu
+	rm -fr gmp-$(XEN_TARGET_ARCH)
+	rm -fr polarssl-$(XEN_TARGET_ARCH)
+	rm -fr openssl-$(XEN_TARGET_ARCH)
+	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -f mk-headers-$(XEN_TARGET_ARCH)
 	rm -fr ocaml-$(XEN_TARGET_ARCH)
 	rm -fr include
@@ -434,6 +558,10 @@ crossclean: clean
 .PHONY: patchclean
 patchclean: crossclean
 	rm -fr newlib-$(NEWLIB_VERSION)
+	rm -fr gmp-$(XEN_TARGET_ARCH)
+	rm -fr polarssl-$(XEN_TARGET_ARCH)
+	rm -fr openssl-$(XEN_TARGET_ARCH)
+	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -fr lwip-$(XEN_TARGET_ARCH)
 	rm -fr grub-upstream
 
@@ -442,10 +570,14 @@ patchclean: crossclean
 downloadclean: patchclean
 	rm -f newlib-$(NEWLIB_VERSION).tar.gz
 	rm -f zlib-$(ZLIB_VERSION).tar.gz
+	rm -f gmp-$(GMP_VERSION).tar.gz
+	rm -f tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	rm -f pciutils-$(LIBPCI_VERSION).tar.bz2
 	rm -f grub-$(GRUB_VERSION).tar.gz
 	rm -f lwip-$(LWIP_VERSION).tar.gz
 	rm -f ocaml-$(OCAML_VERSION).tar.gz
+	rm -f polarssl-$(POLARSSL_VERSION)-gpl.tgz
+	rm -f openssl-$(POLARSSL_VERSION)-gpl.tgz
 
 .PHONY: distclean
 distclean: downloadclean
diff --git a/stubdom/polarssl.patch b/stubdom/polarssl.patch
new file mode 100644
index 0000000..d387d4e
--- /dev/null
+++ b/stubdom/polarssl.patch
@@ -0,0 +1,64 @@
+diff -Naur polarssl-1.1.4/include/polarssl/config.h polarssl-x86_64/include/polarssl/config.h
+--- polarssl-1.1.4/include/polarssl/config.h	2011-12-22 05:06:27.000000000 -0500
++++ polarssl-x86_64/include/polarssl/config.h	2012-10-30 17:18:07.567001000 -0400
+@@ -164,8 +164,8 @@
+  * application.
+  *
+  * Uncomment this macro to prevent loading of default entropy functions.
+-#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
+  */
++#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
+
+ /**
+  * \def POLARSSL_NO_PLATFORM_ENTROPY
+@@ -175,8 +175,8 @@
+  * standards like the /dev/urandom or Windows CryptoAPI.
+  *
+  * Uncomment this macro to disable the built-in platform entropy functions.
+-#define POLARSSL_NO_PLATFORM_ENTROPY
+  */
++#define POLARSSL_NO_PLATFORM_ENTROPY
+
+ /**
+  * \def POLARSSL_PKCS1_V21
+@@ -426,8 +426,8 @@
+  * Requires: POLARSSL_TIMING_C
+  *
+  * This module enables the HAVEGE random number generator.
+- */
+ #define POLARSSL_HAVEGE_C
++ */
+
+ /**
+  * \def POLARSSL_MD_C
+@@ -490,7 +490,7 @@
+  *
+  * This module provides TCP/IP networking routines.
+  */
+-#define POLARSSL_NET_C
++//#define POLARSSL_NET_C
+
+ /**
+  * \def POLARSSL_PADLOCK_C
+@@ -644,8 +644,8 @@
+  * Caller:  library/havege.c
+  *
+  * This module is used by the HAVEGE random number generator.
+- */
+ #define POLARSSL_TIMING_C
++ */
+
+ /**
+  * \def POLARSSL_VERSION_C
+diff -Naur polarssl-1.1.4/library/bignum.c polarssl-x86_64/library/bignum.c
+--- polarssl-1.1.4/library/bignum.c	2012-04-29 16:15:55.000000000 -0400
++++ polarssl-x86_64/library/bignum.c	2012-10-30 17:21:52.135000999 -0400
+@@ -1101,7 +1101,7 @@
+             Z.p[i - t - 1] = ~0;
+         else
+         {
+-#if defined(POLARSSL_HAVE_LONGLONG)
++#if 0 //defined(POLARSSL_HAVE_LONGLONG)
+             t_udbl r;
+
+             r  = (t_udbl) X.p[i] << biL;
diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
new file mode 100644
index 0000000..b84eff1
--- /dev/null
+++ b/stubdom/tpmemu-0.7.4.patch
@@ -0,0 +1,12 @@
+diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
+--- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c	2012-04-27 10:55:46.581963398 -0400
++++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c	2012-04-27 10:56:02.193034152 -0400
+@@ -249,7 +249,7 @@
+ #else /* TPM_NO_EXTERN */
+
+ int (*tpm_extern_init)(void)                                      = NULL;
+-int (*tpm_extern_release)(void)                                   = NULL;
++void (*tpm_extern_release)(void)                                   = NULL;
+ void* (*tpm_malloc)(size_t size)                                  = NULL;
+ void (*tpm_free)(/*const*/ void *ptr)                             = NULL;
+ void (*tpm_log)(int priority, const char *fmt, ...)               = NULL;
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:26:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:26:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taolt-0006Os-16; Tue, 20 Nov 2012 14:25:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Taolp-0006OM-R0
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:25:50 +0000
Received: from [85.158.137.99:7504] by server-11.bemta-3.messagelabs.com id
	FB/59-19361-8E29BA05; Tue, 20 Nov 2012 14:25:44 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-12.tower-217.messagelabs.com!1353421533!16731644!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY,UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14905 invoked from network); 20 Nov 2012 14:25:35 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 20 Nov 2012 14:25:35 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157690906;
	Tue, 20 Nov 2012 09:25:23 -0500
Message-ID: <50AB92CF.8040306@jhuapl.edu>
Date: Tue, 20 Nov 2012 09:25:19 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, 
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353421272-24797-2-git-send-email-matthew.fioravante@jhuapl.edu>
In-Reply-To: <1353421272-24797-2-git-send-email-matthew.fioravante@jhuapl.edu>
Subject: Re: [Xen-devel] [PATCH VTPM v4 2/5] add stubdom/vtpmmgr code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0475244974786596101=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============0475244974786596101==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms080704030001010001060100"

This is a cryptographically signed message in MIME format.

--------------ms080704030001010001060100
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

Please be sure to grab this updated version. I fixed an important=20
comment about the disk image format that was out of date.

On 11/20/2012 09:21 AM, Matthew Fioravante wrote:
> Add the code base for vtpmmgrdom. Makefile changes
> next patch.
>
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> ---
>   stubdom/vtpmmgr/Makefile           |   32 ++
>   stubdom/vtpmmgr/init.c             |  553 +++++++++++++++++++++
>   stubdom/vtpmmgr/log.c              |  151 ++++++
>   stubdom/vtpmmgr/log.h              |   85 ++++
>   stubdom/vtpmmgr/marshal.h          |  528 ++++++++++++++++++++
>   stubdom/vtpmmgr/minios.cfg         |   14 +
>   stubdom/vtpmmgr/tcg.h              |  707 +++++++++++++++++++++++++++=

>   stubdom/vtpmmgr/tpm.c              |  938 +++++++++++++++++++++++++++=
+++++++++
>   stubdom/vtpmmgr/tpm.h              |  218 +++++++++
>   stubdom/vtpmmgr/tpmrsa.c           |  175 +++++++
>   stubdom/vtpmmgr/tpmrsa.h           |   67 +++
>   stubdom/vtpmmgr/uuid.h             |   50 ++
>   stubdom/vtpmmgr/vtpm_cmd_handler.c |  152 ++++++
>   stubdom/vtpmmgr/vtpm_manager.h     |   64 +++
>   stubdom/vtpmmgr/vtpm_storage.c     |  794 +++++++++++++++++++++++++++=
+++
>   stubdom/vtpmmgr/vtpm_storage.h     |   68 +++
>   stubdom/vtpmmgr/vtpmmgr.c          |   93 ++++
>   stubdom/vtpmmgr/vtpmmgr.h          |   77 +++
>   18 files changed, 4766 insertions(+)
>   create mode 100644 stubdom/vtpmmgr/Makefile
>   create mode 100644 stubdom/vtpmmgr/init.c
>   create mode 100644 stubdom/vtpmmgr/log.c
>   create mode 100644 stubdom/vtpmmgr/log.h
>   create mode 100644 stubdom/vtpmmgr/marshal.h
>   create mode 100644 stubdom/vtpmmgr/minios.cfg
>   create mode 100644 stubdom/vtpmmgr/tcg.h
>   create mode 100644 stubdom/vtpmmgr/tpm.c
>   create mode 100644 stubdom/vtpmmgr/tpm.h
>   create mode 100644 stubdom/vtpmmgr/tpmrsa.c
>   create mode 100644 stubdom/vtpmmgr/tpmrsa.h
>   create mode 100644 stubdom/vtpmmgr/uuid.h
>   create mode 100644 stubdom/vtpmmgr/vtpm_cmd_handler.c
>   create mode 100644 stubdom/vtpmmgr/vtpm_manager.h
>   create mode 100644 stubdom/vtpmmgr/vtpm_storage.c
>   create mode 100644 stubdom/vtpmmgr/vtpm_storage.h
>   create mode 100644 stubdom/vtpmmgr/vtpmmgr.c
>   create mode 100644 stubdom/vtpmmgr/vtpmmgr.h
>
> diff --git a/stubdom/vtpmmgr/Makefile b/stubdom/vtpmmgr/Makefile
> new file mode 100644
> index 0000000..88c83c3
> --- /dev/null
> +++ b/stubdom/vtpmmgr/Makefile
> @@ -0,0 +1,32 @@
> +# Copyright (c) 2010-2012 United States Government, as represented by
> +# the Secretary of Defense.  All rights reserved.
> +#
> +# THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
> +# ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
> +# INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS=

> +# FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
> +# DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
> +# SOFTWARE.
> +#
> +
> +XEN_ROOT=3D../..
> +
> +PSSL_DIR=3D../polarssl-$(XEN_TARGET_ARCH)/library
> +PSSL_OBJS=3Daes.o sha1.o entropy.o ctr_drbg.o bignum.o sha4.o havege.o=
 timing.o entropy_poll.o
> +
> +TARGET=3Dvtpmmgr.a
> +OBJS=3Dvtpmmgr.o vtpm_cmd_handler.o vtpm_storage.o init.o tpmrsa.o tpm=
=2Eo log.o
> +
> +CFLAGS+=3D-Werror -Iutil -Icrypto -Itcs
> +CFLAGS+=3D-Wno-declaration-after-statement -Wno-unused-label
> +
> +build: $(TARGET)
> +$(TARGET): $(OBJS)
> +       ar -rcs $@ $^ $(foreach obj,$(PSSL_OBJS),$(PSSL_DIR)/$(obj))
> +
> +clean:
> +       rm -f $(TARGET) $(OBJS)
> +
> +distclean: clean
> +
> +.PHONY: clean distclean
> diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
> new file mode 100644
> index 0000000..a158020
> --- /dev/null
> +++ b/stubdom/vtpmmgr/init.c
> @@ -0,0 +1,553 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +#include <stdint.h>
> +#include <stdlib.h>
> +
> +#include <xen/xen.h>
> +#include <mini-os/tpmback.h>
> +#include <mini-os/tpmfront.h>
> +#include <mini-os/tpm_tis.h>
> +#include <unistd.h>
> +#include <stdio.h>
> +#include <string.h>
> +#include <stdlib.h>
> +#include <polarssl/sha1.h>
> +
> +#include "log.h"
> +#include "vtpmmgr.h"
> +#include "vtpm_storage.h"
> +#include "tpm.h"
> +#include "marshal.h"
> +
> +struct Opts {
> +   enum {
> +      TPMDRV_TPM_TIS,
> +      TPMDRV_TPMFRONT,
> +   } tpmdriver;
> +   unsigned long tpmiomem;
> +   unsigned int tpmirq;
> +   unsigned int tpmlocality;
> +   int gen_owner_auth;
> +};
> +
> +// --------------------------- Well Known Auths ----------------------=
----
> +const TPM_AUTHDATA WELLKNOWN_SRK_AUTH =3D {0x00, 0x00, 0x00, 0x00, 0x0=
0, 0x00, 0x00, 0x00, 0x00, 0x00,
> +   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
> +
> +const TPM_AUTHDATA WELLKNOWN_OWNER_AUTH =3D {0xff, 0xff, 0xff, 0xff, 0=
xff, 0xff, 0xff, 0xff, 0xff, 0xff,
> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
> +
> +struct vtpm_globals vtpm_globals =3D {
> +   .tpm_fd =3D -1,
> +   .storage_key =3D TPM_KEY_INIT,
> +   .storage_key_handle =3D 0,
> +   .oiap =3D { .AuthHandle =3D 0 }
> +};
> +
> +static int tpm_entropy_source(void* dummy, unsigned char* data, size_t=
 len, size_t* olen) {
> +   UINT32 sz =3D len;
> +   TPM_RESULT rc =3D TPM_GetRandom(&sz, data);
> +   *olen =3D sz;
> +   return rc =3D=3D TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAIL=
ED;
> +}
> +
> +static TPM_RESULT check_tpm_version(void) {
> +   TPM_RESULT status;
> +   UINT32 rsize;
> +   BYTE* res =3D NULL;
> +   TPM_CAP_VERSION_INFO vinfo;
> +
> +   TPMTRYRETURN(TPM_GetCapability(
> +            TPM_CAP_VERSION_VAL,
> +            0,
> +            NULL,
> +            &rsize,
> +            &res));
> +   if(rsize < 4) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Invalid size returned by GetCapabil=
ity!\n");
> +      status =3D TPM_BAD_PARAMETER;
> +      goto abort_egress;
> +   }
> +
> +   unpack_TPM_CAP_VERSION_INFO(res, &vinfo, UNPACK_ALIAS);
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Hardware TPM:\n");
> +   vtpmloginfo(VTPM_LOG_VTPM, " version: %hhd %hhd %hhd %hhd\n",
> +         vinfo.version.major, vinfo.version.minor, vinfo.version.revMa=
jor, vinfo.version.revMinor);
> +   vtpmloginfo(VTPM_LOG_VTPM, " specLevel: %hd\n", vinfo.specLevel);
> +   vtpmloginfo(VTPM_LOG_VTPM, " errataRev: %hhd\n", vinfo.errataRev);
> +   vtpmloginfo(VTPM_LOG_VTPM, " vendorID: %c%c%c%c\n",
> +         vinfo.tpmVendorID[0], vinfo.tpmVendorID[1],
> +         vinfo.tpmVendorID[2], vinfo.tpmVendorID[3]);
> +   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecificSize: %hd\n", vinfo.vend=
orSpecificSize);
> +   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecific: ");
> +   for(int i =3D 0; i < vinfo.vendorSpecificSize; ++i) {
> +      vtpmloginfomore(VTPM_LOG_VTPM, "%02hhx", vinfo.vendorSpecific[i]=
);
> +   }
> +   vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> +
> +abort_egress:
> +   free(res);
> +   return status;
> +}
> +
> +static TPM_RESULT flush_tpm(void) {
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +   const TPM_RESOURCE_TYPE reslist[] =3D { TPM_RT_KEY, TPM_RT_AUTH, TP=
M_RT_TRANS, TPM_RT_COUNTER, TPM_RT_DAA_TPM, TPM_RT_CONTEXT };
> +   BYTE* keylist =3D NULL;
> +   UINT32 keylistSize;
> +   BYTE* ptr;
> +
> +   //Iterate through each resource type and flush all handles
> +   for(int i =3D 0; i < sizeof(reslist) / sizeof(TPM_RESOURCE_TYPE); +=
+i) {
> +      TPM_RESOURCE_TYPE beres =3D cpu_to_be32(reslist[i]);
> +      UINT16 size;
> +      TPMTRYRETURN(TPM_GetCapability(
> +               TPM_CAP_HANDLE,
> +               sizeof(TPM_RESOURCE_TYPE),
> +               (BYTE*)(&beres),
> +               &keylistSize,
> +               &keylist));
> +
> +      ptr =3D keylist;
> +      ptr =3D unpack_UINT16(ptr, &size);
> +
> +      //Flush each handle
> +      if(size) {
> +         vtpmloginfo(VTPM_LOG_VTPM, "Flushing %u handle(s) of type %lu=
\n", size, (unsigned long) reslist[i]);
> +         for(int j =3D 0; j < size; ++j) {
> +            TPM_HANDLE h;
> +            ptr =3D unpack_TPM_HANDLE(ptr, &h);
> +            TPMTRYRETURN(TPM_FlushSpecific(h, reslist[i]));
> +         }
> +      }
> +
> +      free(keylist);
> +      keylist =3D NULL;
> +   }
> +
> +   goto egress;
> +abort_egress:
> +   free(keylist);
> +egress:
> +   return status;
> +}
> +
> +
> +static TPM_RESULT try_take_ownership(void) {
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +   TPM_PUBKEY pubEK =3D TPM_PUBKEY_INIT;
> +
> +   // If we can read PubEK then there is no owner and we should take i=
t.
> +   status =3D TPM_ReadPubek(&pubEK);
> +
> +   switch(status) {
> +      case TPM_DISABLED_CMD:
> +         //Cannot read ek? TPM has owner
> +         vtpmloginfo(VTPM_LOG_VTPM, "Failed to readEK meaning TPM has =
an owner. Creating Keys off existing SRK.\n");
> +         status =3D TPM_SUCCESS;
> +         break;
> +      case TPM_NO_ENDORSEMENT:
> +         {
> +            //If theres no ek, we have to create one
> +            TPM_KEY_PARMS keyInfo =3D {
> +               .algorithmID =3D TPM_ALG_RSA,
> +               .encScheme =3D TPM_ES_RSAESOAEP_SHA1_MGF1,
> +               .sigScheme =3D TPM_SS_NONE,
> +               .parmSize =3D 12,
> +               .parms.rsa =3D {
> +                  .keyLength =3D RSA_KEY_SIZE,
> +                  .numPrimes =3D 2,
> +                  .exponentSize =3D 0,
> +                  .exponent =3D NULL,
> +               },
> +            };
> +            TPMTRYRETURN(TPM_CreateEndorsementKeyPair(&keyInfo, &pubEK=
));
> +         }
> +         //fall through to take ownership
> +      case TPM_SUCCESS:
> +         {
> +            //Construct the Srk
> +            TPM_KEY srk =3D {
> +               .ver =3D TPM_STRUCT_VER_1_1,
> +               .keyUsage =3D TPM_KEY_STORAGE,
> +               .keyFlags =3D 0x00,
> +               .authDataUsage =3D TPM_AUTH_ALWAYS,
> +               .algorithmParms =3D {
> +                  .algorithmID =3D TPM_ALG_RSA,
> +                  .encScheme =3D TPM_ES_RSAESOAEP_SHA1_MGF1,
> +                  .sigScheme =3D  TPM_SS_NONE,
> +                  .parmSize =3D 12,
> +                  .parms.rsa =3D {
> +                     .keyLength =3D RSA_KEY_SIZE,
> +                     .numPrimes =3D 2,
> +                     .exponentSize =3D 0,
> +                     .exponent =3D NULL,
> +                  },
> +               },
> +               .PCRInfoSize =3D 0,
> +               .pubKey =3D {
> +                  .keyLength =3D 0,
> +                  .key =3D NULL,
> +               },
> +               .encDataSize =3D 0,
> +            };
> +
> +            TPMTRYRETURN(TPM_TakeOwnership(
> +                     &pubEK,
> +                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
> +                     (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
> +                     &srk,
> +                     NULL,
> +                     &vtpm_globals.oiap));
> +
> +            TPMTRYRETURN(TPM_DisablePubekRead(
> +                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
> +                     &vtpm_globals.oiap));
> +         }
> +         break;
> +      default:
> +         break;
> +   }
> +abort_egress:
> +   free_TPM_PUBKEY(&pubEK);
> +   return status;
> +}
> +
> +static void init_storage_key(TPM_KEY* key) {
> +   key->ver.major =3D 1;
> +   key->ver.minor =3D 1;
> +   key->ver.revMajor =3D 0;
> +   key->ver.revMinor =3D 0;
> +
> +   key->keyUsage =3D TPM_KEY_BIND;
> +   key->keyFlags =3D 0;
> +   key->authDataUsage =3D TPM_AUTH_ALWAYS;
> +
> +   TPM_KEY_PARMS* p =3D &key->algorithmParms;
> +   p->algorithmID =3D TPM_ALG_RSA;
> +   p->encScheme =3D TPM_ES_RSAESOAEP_SHA1_MGF1;
> +   p->sigScheme =3D TPM_SS_NONE;
> +   p->parmSize =3D 12;
> +
> +   TPM_RSA_KEY_PARMS* r =3D &p->parms.rsa;
> +   r->keyLength =3D RSA_KEY_SIZE;
> +   r->numPrimes =3D 2;
> +   r->exponentSize =3D 0;
> +   r->exponent =3D NULL;
> +
> +   key->PCRInfoSize =3D 0;
> +   key->encDataSize =3D 0;
> +   key->encData =3D NULL;
> +}
> +
> +static int parse_auth_string(char* authstr, BYTE* target, const TPM_AU=
THDATA wellknown, int allowrandom) {
> +   int rc;
> +   /* well known owner auth */
> +   if(!strcmp(authstr, "well-known")) {
> +      memcpy(target, wellknown, sizeof(TPM_AUTHDATA));
> +   }
> +   /* Create a randomly generated owner auth */
> +   else if(allowrandom && !strcmp(authstr, "random")) {
> +      return 1;
> +   }
> +   /* owner auth is a raw hash */
> +   else if(!strncmp(authstr, "hash:", 5)) {
> +      authstr +=3D 5;
> +      if((rc =3D strlen(authstr)) !=3D 40) {
> +         vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth hex string `=
%s' must be exactly 40 characters (20 bytes) long, length=3D%d\n", authst=
r, rc);
> +         return -1;
> +      }
> +      for(int j =3D 0; j < 20; ++j) {
> +         if(sscanf(authstr, "%hhX", target + j) !=3D 1) {
> +            vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth string `%=
s' is not a valid hex string\n", authstr);
> +            return -1;
> +         }
> +         authstr +=3D 2;
> +      }
> +   }
> +   /* owner auth is a string that will be hashed */
> +   else if(!strncmp(authstr, "text:", 5)) {
> +      authstr +=3D 5;
> +      sha1((const unsigned char*)authstr, strlen(authstr), target);
> +   }
> +   else {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Invalid auth string %s\n", authstr)=
;
> +      return -1;
> +   }
> +
> +   return 0;
> +}
> +
> +int parse_cmdline_opts(int argc, char** argv, struct Opts* opts)
> +{
> +   int rc;
> +   int i;
> +
> +   //Set defaults
> +   memcpy(vtpm_globals.owner_auth, WELLKNOWN_OWNER_AUTH, sizeof(TPM_AU=
THDATA));
> +   memcpy(vtpm_globals.srk_auth, WELLKNOWN_SRK_AUTH, sizeof(TPM_AUTHDA=
TA));
> +
> +   for(i =3D 1; i < argc; ++i) {
> +      if(!strncmp(argv[i], "owner_auth:", 10)) {
> +         if((rc =3D parse_auth_string(argv[i] + 10, vtpm_globals.owner=
_auth, WELLKNOWN_OWNER_AUTH, 1)) < 0) {
> +            goto err_invalid;
> +         }
> +         if(rc =3D=3D 1) {
> +            opts->gen_owner_auth =3D 1;
> +         }
> +      }
> +      else if(!strncmp(argv[i], "srk_auth:", 8)) {
> +         if((rc =3D parse_auth_string(argv[i] + 8, vtpm_globals.srk_au=
th, WELLKNOWN_SRK_AUTH, 0)) !=3D 0) {
> +            goto err_invalid;
> +         }
> +      }
> +      else if(!strncmp(argv[i], "tpmdriver=3D", 10)) {
> +         if(!strcmp(argv[i] + 10, "tpm_tis")) {
> +            opts->tpmdriver =3D TPMDRV_TPM_TIS;
> +         } else if(!strcmp(argv[i] + 10, "tpmfront")) {
> +            opts->tpmdriver =3D TPMDRV_TPMFRONT;
> +         } else {
> +            goto err_invalid;
> +         }
> +      }
> +      else if(!strncmp(argv[i], "tpmiomem=3D",9)) {
> +         if(sscanf(argv[i] + 9, "0x%lX", &opts->tpmiomem) !=3D 1) {
> +            goto err_invalid;
> +         }
> +      }
> +      else if(!strncmp(argv[i], "tpmirq=3D",7)) {
> +         if(!strcmp(argv[i] + 7, "probe")) {
> +            opts->tpmirq =3D TPM_PROBE_IRQ;
> +         } else if( sscanf(argv[i] + 7, "%u", &opts->tpmirq) !=3D 1) {=

> +            goto err_invalid;
> +         }
> +      }
> +      else if(!strncmp(argv[i], "tpmlocality=3D",12)) {
> +         if(sscanf(argv[i] + 12, "%u", &opts->tpmlocality) !=3D 1 || o=
pts->tpmlocality > 4) {
> +            goto err_invalid;
> +         }
> +      }
> +   }
> +
> +   switch(opts->tpmdriver) {
> +      case TPMDRV_TPM_TIS:
> +         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpm_tis driver\n");=

> +         break;
> +      case TPMDRV_TPMFRONT:
> +         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpmfront driver\n")=
;
> +         break;
> +   }
> +
> +   return 0;
> +err_invalid:
> +   vtpmlogerror(VTPM_LOG_VTPM, "Invalid Option %s\n", argv[i]);
> +   return -1;
> +}
> +
> +
> +
> +static TPM_RESULT vtpmmgr_create(void) {
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +   TPM_AUTH_SESSION osap =3D TPM_AUTH_SESSION_INIT;
> +   TPM_AUTHDATA sharedsecret;
> +
> +   // Take ownership if TPM is unowned
> +   TPMTRYRETURN(try_take_ownership());
> +
> +   // Generate storage key's auth
> +   memset(&vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA=
));
> +
> +   TPMTRYRETURN( TPM_OSAP(
> +            TPM_ET_KEYHANDLE,
> +            TPM_SRK_KEYHANDLE,
> +            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
> +            &sharedsecret,
> +            &osap) );
> +
> +   init_storage_key(&vtpm_globals.storage_key);
> +
> +   //initialize the storage key
> +   TPMTRYRETURN( TPM_CreateWrapKey(
> +            TPM_SRK_KEYHANDLE,
> +            (const TPM_AUTHDATA*)&sharedsecret,
> +            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,=

> +            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,=

> +            &vtpm_globals.storage_key,
> +            &osap) );
> +
> +   //Load Storage Key
> +   TPMTRYRETURN( TPM_LoadKey(
> +            TPM_SRK_KEYHANDLE,
> +            &vtpm_globals.storage_key,
> +            &vtpm_globals.storage_key_handle,
> +            (const TPM_AUTHDATA*) &vtpm_globals.srk_auth,
> +            &vtpm_globals.oiap));
> +
> +   //Make sure TPM has commited changes
> +   TPMTRYRETURN( TPM_SaveState() );
> +
> +   //Create new disk image
> +   TPMTRYRETURN(vtpm_storage_new_header());
> +
> +   goto egress;
> +abort_egress:
> +egress:
> +   vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager\n=
");
> +
> +   //End the OSAP session
> +   if(osap.AuthHandle) {
> +      TPM_TerminateHandle(osap.AuthHandle);
> +   }
> +
> +   return status;
> +}
> +
> +TPM_RESULT vtpmmgr_init(int argc, char** argv) {
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +
> +   /* Default commandline options */
> +   struct Opts opts =3D {
> +      .tpmdriver =3D TPMDRV_TPM_TIS,
> +      .tpmiomem =3D TPM_BASEADDR,
> +      .tpmirq =3D 0,
> +      .tpmlocality =3D 0,
> +      .gen_owner_auth =3D 0,
> +   };
> +
> +   if(parse_cmdline_opts(argc, argv, &opts) !=3D 0) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Command line parsing failed! exitin=
g..\n");
> +      status =3D TPM_BAD_PARAMETER;
> +      goto abort_egress;
> +   }
> +
> +   //Setup storage system
> +   if(vtpm_storage_init() !=3D 0) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize storage subsys=
tem!\n");
> +      status =3D TPM_IOERROR;
> +      goto abort_egress;
> +   }
> +
> +   //Setup tpmback device
> +   init_tpmback();
> +
> +   //Setup tpm access
> +   switch(opts.tpmdriver) {
> +      case TPMDRV_TPM_TIS:
> +         {
> +            struct tpm_chip* tpm;
> +            if((tpm =3D init_tpm_tis(opts.tpmiomem, TPM_TIS_LOCL_INT_T=
O_FLAG(opts.tpmlocality), opts.tpmirq)) =3D=3D NULL) {
> +               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfr=
ont device\n");
> +               status =3D TPM_IOERROR;
> +               goto abort_egress;
> +            }
> +            vtpm_globals.tpm_fd =3D tpm_tis_open(tpm);
> +            tpm_tis_request_locality(tpm, opts.tpmlocality);
> +         }
> +         break;
> +      case TPMDRV_TPMFRONT:
> +         {
> +            struct tpmfront_dev* tpmfront_dev;
> +            if((tpmfront_dev =3D init_tpmfront(NULL)) =3D=3D NULL) {
> +               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfr=
ont device\n");
> +               status =3D TPM_IOERROR;
> +               goto abort_egress;
> +            }
> +            vtpm_globals.tpm_fd =3D tpmfront_open(tpmfront_dev);
> +         }
> +         break;
> +   }
> +
> +   //Get the version of the tpm
> +   TPMTRYRETURN(check_tpm_version());
> +
> +   // Blow away all stale handles left in the tpm
> +   if(flush_tpm() !=3D TPM_SUCCESS) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_FlushResources failed, continu=
ing anyway..\n");
> +   }
> +
> +   /* Initialize the rng */
> +   entropy_init(&vtpm_globals.entropy);
> +   entropy_add_source(&vtpm_globals.entropy, tpm_entropy_source, NULL,=
 0);
> +   entropy_gather(&vtpm_globals.entropy);
> +   ctr_drbg_init(&vtpm_globals.ctr_drbg, entropy_func, &vtpm_globals.e=
ntropy, NULL, 0);
> +   ctr_drbg_set_prediction_resistance( &vtpm_globals.ctr_drbg, CTR_DRB=
G_PR_OFF );
> +
> +   // Generate Auth for Owner
> +   if(opts.gen_owner_auth) {
> +      vtpmmgr_rand(vtpm_globals.owner_auth, sizeof(TPM_AUTHDATA));
> +   }
> +
> +   // Create OIAP session for service's authorized commands
> +   TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
> +
> +   /* Load the Manager data, if it fails create a new manager */
> +   if (vtpm_storage_load_header() !=3D TPM_SUCCESS) {
> +      /* If the OIAP session was closed by an error, create a new one =
*/
> +      if(vtpm_globals.oiap.AuthHandle =3D=3D 0) {
> +         TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
> +      }
> +      vtpmloginfo(VTPM_LOG_VTPM, "Failed to read manager file. Assumin=
g first time initialization.\n");
> +      TPMTRYRETURN( vtpmmgr_create() );
> +   }
> +
> +   goto egress;
> +abort_egress:
> +   vtpmmgr_shutdown();
> +egress:
> +   return status;
> +}
> +
> +void vtpmmgr_shutdown(void)
> +{
> +   /* Cleanup resources */
> +   free_TPM_KEY(&vtpm_globals.storage_key);
> +
> +   /* Cleanup TPM resources */
> +   TPM_EvictKey(vtpm_globals.storage_key_handle);
> +   TPM_TerminateHandle(vtpm_globals.oiap.AuthHandle);
> +
> +   /* Close tpmback */
> +   shutdown_tpmback();
> +
> +   /* Close the storage system and blkfront */
> +   vtpm_storage_shutdown();
> +
> +   /* Close tpmfront/tpm_tis */
> +   close(vtpm_globals.tpm_fd);
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
> +}
> diff --git a/stubdom/vtpmmgr/log.c b/stubdom/vtpmmgr/log.c
> new file mode 100644
> index 0000000..a82c913
> --- /dev/null
> +++ b/stubdom/vtpmmgr/log.c
> @@ -0,0 +1,151 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#include <stdlib.h>
> +#include <string.h>
> +#include <stdio.h>
> +
> +#include "tcg.h"
> +
> +char *module_names[] =3D { "",
> +                                "TPM",
> +                                "TPM",
> +                                "VTPM",
> +                                "VTPM",
> +                                "TXDATA",
> +                              };
> +// Helper code for the consts, eg. to produce messages for error codes=
=2E
> +
> +typedef struct error_code_entry_t {
> +  TPM_RESULT code;
> +  char * code_name;
> +  char * msg;
> +} error_code_entry_t;
> +
> +static const error_code_entry_t error_msgs [] =3D {
> +  { TPM_SUCCESS, "TPM_SUCCESS", "Successful completion of the operatio=
n" },
> +  { TPM_AUTHFAIL, "TPM_AUTHFAIL", "Authentication failed" },
> +  { TPM_BADINDEX, "TPM_BADINDEX", "The index to a PCR, DIR or other re=
gister is incorrect" },
> +  { TPM_BAD_PARAMETER, "TPM_BAD_PARAMETER", "One or more parameter is =
bad" },
> +  { TPM_AUDITFAILURE, "TPM_AUDITFAILURE", "An operation completed succ=
essfully but the auditing of that operation failed." },
> +  { TPM_CLEAR_DISABLED, "TPM_CLEAR_DISABLED", "The clear disable flag =
is set and all clear operations now require physical access" },
> +  { TPM_DEACTIVATED, "TPM_DEACTIVATED", "The TPM is deactivated" },
> +  { TPM_DISABLED, "TPM_DISABLED", "The TPM is disabled" },
> +  { TPM_DISABLED_CMD, "TPM_DISABLED_CMD", "The target command has been=
 disabled" },
> +  { TPM_FAIL, "TPM_FAIL", "The operation failed" },
> +  { TPM_BAD_ORDINAL, "TPM_BAD_ORDINAL", "The ordinal was unknown or in=
consistent" },
> +  { TPM_INSTALL_DISABLED, "TPM_INSTALL_DISABLED", "The ability to inst=
all an owner is disabled" },
> +  { TPM_INVALID_KEYHANDLE, "TPM_INVALID_KEYHANDLE", "The key handle pr=
esented was invalid" },
> +  { TPM_KEYNOTFOUND, "TPM_KEYNOTFOUND", "The target key was not found"=
 },
> +  { TPM_INAPPROPRIATE_ENC, "TPM_INAPPROPRIATE_ENC", "Unacceptable encr=
yption scheme" },
> +  { TPM_MIGRATEFAIL, "TPM_MIGRATEFAIL", "Migration authorization faile=
d" },
> +  { TPM_INVALID_PCR_INFO, "TPM_INVALID_PCR_INFO", "PCR information cou=
ld not be interpreted" },
> +  { TPM_NOSPACE, "TPM_NOSPACE", "No room to load key." },
> +  { TPM_NOSRK, "TPM_NOSRK", "There is no SRK set" },
> +  { TPM_NOTSEALED_BLOB, "TPM_NOTSEALED_BLOB", "An encrypted blob is in=
valid or was not created by this TPM" },
> +  { TPM_OWNER_SET, "TPM_OWNER_SET", "There is already an Owner" },
> +  { TPM_RESOURCES, "TPM_RESOURCES", "The TPM has insufficient internal=
 resources to perform the requested action." },
> +  { TPM_SHORTRANDOM, "TPM_SHORTRANDOM", "A random string was too short=
" },
> +  { TPM_SIZE, "TPM_SIZE", "The TPM does not have the space to perform =
the operation." },
> +  { TPM_WRONGPCRVAL, "TPM_WRONGPCRVAL", "The named PCR value does not =
match the current PCR value." },
> +  { TPM_BAD_PARAM_SIZE, "TPM_BAD_PARAM_SIZE", "The paramSize argument =
to the command has the incorrect value" },
> +  { TPM_SHA_THREAD, "TPM_SHA_THREAD", "There is no existing SHA-1 thre=
ad." },
> +  { TPM_SHA_ERROR, "TPM_SHA_ERROR", "The calculation is unable to proc=
eed because the existing SHA-1 thread has already encountered an error." =
},
> +  { TPM_FAILEDSELFTEST, "TPM_FAILEDSELFTEST", "Self-test has failed an=
d the TPM has shutdown." },
> +  { TPM_AUTH2FAIL, "TPM_AUTH2FAIL", "The authorization for the second =
key in a 2 key function failed authorization" },
> +  { TPM_BADTAG, "TPM_BADTAG", "The tag value sent to for a command is =
invalid" },
> +  { TPM_IOERROR, "TPM_IOERROR", "An IO error occurred transmitting inf=
ormation to the TPM" },
> +  { TPM_ENCRYPT_ERROR, "TPM_ENCRYPT_ERROR", "The encryption process ha=
d a problem." },
> +  { TPM_DECRYPT_ERROR, "TPM_DECRYPT_ERROR", "The decryption process di=
d not complete." },
> +  { TPM_INVALID_AUTHHANDLE, "TPM_INVALID_AUTHHANDLE", "An invalid hand=
le was used." },
> +  { TPM_NO_ENDORSEMENT, "TPM_NO_ENDORSEMENT", "The TPM does not a EK i=
nstalled" },
> +  { TPM_INVALID_KEYUSAGE, "TPM_INVALID_KEYUSAGE", "The usage of a key =
is not allowed" },
> +  { TPM_WRONG_ENTITYTYPE, "TPM_WRONG_ENTITYTYPE", "The submitted entit=
y type is not allowed" },
> +  { TPM_INVALID_POSTINIT, "TPM_INVALID_POSTINIT", "The command was rec=
eived in the wrong sequence relative to TPM_Init and a subsequent TPM_Sta=
rtup" },
> +  { TPM_INAPPROPRIATE_SIG, "TPM_INAPPROPRIATE_SIG", "Signed data canno=
t include additional DER information" },
> +  { TPM_BAD_KEY_PROPERTY, "TPM_BAD_KEY_PROPERTY", "The key properties =
in TPM_KEY_PARMs are not supported by this TPM" },
> +
> +  { TPM_BAD_MIGRATION, "TPM_BAD_MIGRATION", "The migration properties =
of this key are incorrect." },
> +  { TPM_BAD_SCHEME, "TPM_BAD_SCHEME", "The signature or encryption sch=
eme for this key is incorrect or not permitted in this situation." },
> +  { TPM_BAD_DATASIZE, "TPM_BAD_DATASIZE", "The size of the data (or bl=
ob) parameter is bad or inconsistent with the referenced key" },
> +  { TPM_BAD_MODE, "TPM_BAD_MODE", "A mode parameter is bad, such as ca=
pArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for =
TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob." },
> +  { TPM_BAD_PRESENCE, "TPM_BAD_PRESENCE", "Either the physicalPresence=
 or physicalPresenceLock bits have the wrong value" },
> +  { TPM_BAD_VERSION, "TPM_BAD_VERSION", "The TPM cannot perform this v=
ersion of the capability" },
> +  { TPM_NO_WRAP_TRANSPORT, "TPM_NO_WRAP_TRANSPORT", "The TPM does not =
allow for wrapped transport sessions" },
> +  { TPM_AUDITFAIL_UNSUCCESSFUL, "TPM_AUDITFAIL_UNSUCCESSFUL", "TPM aud=
it construction failed and the underlying command was returning a failure=
 code also" },
> +  { TPM_AUDITFAIL_SUCCESSFUL, "TPM_AUDITFAIL_SUCCESSFUL", "TPM audit c=
onstruction failed and the underlying command was returning success" },
> +  { TPM_NOTRESETABLE, "TPM_NOTRESETABLE", "Attempt to reset a PCR regi=
ster that does not have the resettable attribute" },
> +  { TPM_NOTLOCAL, "TPM_NOTLOCAL", "Attempt to reset a PCR register tha=
t requires locality and locality modifier not part of command transport" =
},
> +  { TPM_BAD_TYPE, "TPM_BAD_TYPE", "Make identity blob not properly typ=
ed" },
> +  { TPM_INVALID_RESOURCE, "TPM_INVALID_RESOURCE", "When saving context=
 identified resource type does not match actual resource" },
> +  { TPM_NOTFIPS, "TPM_NOTFIPS", "The TPM is attempting to execute a co=
mmand only available when in FIPS mode" },
> +  { TPM_INVALID_FAMILY, "TPM_INVALID_FAMILY", "The command is attempti=
ng to use an invalid family ID" },
> +  { TPM_NO_NV_PERMISSION, "TPM_NO_NV_PERMISSION", "The permission to m=
anipulate the NV storage is not available" },
> +  { TPM_REQUIRES_SIGN, "TPM_REQUIRES_SIGN", "The operation requires a =
signed command" },
> +  { TPM_KEY_NOTSUPPORTED, "TPM_KEY_NOTSUPPORTED", "Wrong operation to =
load an NV key" },
> +  { TPM_AUTH_CONFLICT, "TPM_AUTH_CONFLICT", "NV_LoadKey blob requires =
both owner and blob authorization" },
> +  { TPM_AREA_LOCKED, "TPM_AREA_LOCKED", "The NV area is locked and not=
 writtable" },
> +  { TPM_BAD_LOCALITY, "TPM_BAD_LOCALITY", "The locality is incorrect f=
or the attempted operation" },
> +  { TPM_READ_ONLY, "TPM_READ_ONLY", "The NV area is read only and can'=
t be written to" },
> +  { TPM_PER_NOWRITE, "TPM_PER_NOWRITE", "There is no protection on the=
 write to the NV area" },
> +  { TPM_FAMILYCOUNT, "TPM_FAMILYCOUNT", "The family count value does n=
ot match" },
> +  { TPM_WRITE_LOCKED, "TPM_WRITE_LOCKED", "The NV area has already bee=
n written to" },
> +  { TPM_BAD_ATTRIBUTES, "TPM_BAD_ATTRIBUTES", "The NV area attributes =
conflict" },
> +  { TPM_INVALID_STRUCTURE, "TPM_INVALID_STRUCTURE", "The structure tag=
 and version are invalid or inconsistent" },
> +  { TPM_KEY_OWNER_CONTROL, "TPM_KEY_OWNER_CONTROL", "The key is under =
control of the TPM Owner and can only be evicted by the TPM Owner." },
> +  { TPM_BAD_COUNTER, "TPM_BAD_COUNTER", "The counter handle is incorre=
ct" },
> +  { TPM_NOT_FULLWRITE, "TPM_NOT_FULLWRITE", "The write is not a comple=
te write of the area" },
> +  { TPM_CONTEXT_GAP, "TPM_CONTEXT_GAP", "The gap between saved context=
 counts is too large" },
> +  { TPM_MAXNVWRITES, "TPM_MAXNVWRITES", "The maximum number of NV writ=
es without an owner has been exceeded" },
> +  { TPM_NOOPERATOR, "TPM_NOOPERATOR", "No operator authorization value=
 is set" },
> +  { TPM_RESOURCEMISSING, "TPM_RESOURCEMISSING", "The resource pointed =
to by context is not loaded" },
> +  { TPM_DELEGATE_LOCK, "TPM_DELEGATE_LOCK", "The delegate administrati=
on is locked" },
> +  { TPM_DELEGATE_FAMILY, "TPM_DELEGATE_FAMILY", "Attempt to manage a f=
amily other then the delegated family" },
> +  { TPM_DELEGATE_ADMIN, "TPM_DELEGATE_ADMIN", "Delegation table manage=
ment not enabled" },
> +  { TPM_TRANSPORT_EXCLUSIVE, "TPM_TRANSPORT_EXCLUSIVE", "There was a c=
ommand executed outside of an exclusive transport session" },
> +};
> +
> +
> +// helper function for the error codes:
> +const char* tpm_get_error_name (TPM_RESULT code) {
> +  // just do a linear scan for now
> +  unsigned i;
> +  for (i =3D 0; i < sizeof(error_msgs)/sizeof(error_msgs[0]); i++)
> +    if (code =3D=3D error_msgs[i].code)
> +      return error_msgs[i].code_name;
> +
> +    return("Unknown Error Code");
> +}
> diff --git a/stubdom/vtpmmgr/log.h b/stubdom/vtpmmgr/log.h
> new file mode 100644
> index 0000000..5c7abf5
> --- /dev/null
> +++ b/stubdom/vtpmmgr/log.h
> @@ -0,0 +1,85 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#ifndef __VTPM_LOG_H__
> +#define __VTPM_LOG_H__
> +
> +#include <stdint.h>             // for uint32_t
> +#include <stddef.h>             // for pointer NULL
> +#include <stdio.h>
> +#include "tcg.h"
> +
> +// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D LOGGING =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> +
> +// the logging module numbers
> +#define VTPM_LOG_TPM         1
> +#define VTPM_LOG_TPM_DEEP    2
> +#define VTPM_LOG_VTPM        3
> +#define VTPM_LOG_VTPM_DEEP   4
> +#define VTPM_LOG_TXDATA      5
> +
> +extern char *module_names[];
> +
> +// Default to standard logging
> +#ifndef LOGGING_MODULES
> +#define LOGGING_MODULES (BITMASK(VTPM_LOG_VTPM)|BITMASK(VTPM_LOG_TPM))=

> +#endif
> +
> +// bit-access macros
> +#define BITMASK(idx)      ( 1U << (idx) )
> +#define GETBIT(num,idx)   ( ((num) & BITMASK(idx)) >> idx )
> +#define SETBIT(num,idx)   (num) |=3D BITMASK(idx)
> +#define CLEARBIT(num,idx) (num) &=3D ( ~ BITMASK(idx) )
> +
> +#define vtpmloginfo(module, fmt, args...) \
> +  if (GETBIT (LOGGING_MODULES, module) =3D=3D 1) {                    =
     \
> +    fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); =
\
> +  }
> +
> +#define vtpmloginfomore(module, fmt, args...) \
> +  if (GETBIT (LOGGING_MODULES, module) =3D=3D 1) {                    =
   \
> +    fprintf (stdout, fmt,##args);                                    \=

> +  }
> +
> +#define vtpmlogerror(module, fmt, args...) \
> +  fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
> +
> +//typedef UINT32 tpm_size_t;
> +
> +// helper function for the error codes:
> +const char* tpm_get_error_name (TPM_RESULT code);
> +
> +#endif // _VTPM_LOG_H_
> diff --git a/stubdom/vtpmmgr/marshal.h b/stubdom/vtpmmgr/marshal.h
> new file mode 100644
> index 0000000..77d32f0
> --- /dev/null
> +++ b/stubdom/vtpmmgr/marshal.h
> @@ -0,0 +1,528 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#ifndef MARSHAL_H
> +#define MARSHAL_H
> +
> +#include <stdlib.h>
> +#include <mini-os/byteorder.h>
> +#include <mini-os/endian.h>
> +#include "tcg.h"
> +
> +typedef enum UnpackPtr {
> +   UNPACK_ALIAS,
> +   UNPACK_ALLOC
> +} UnpackPtr;
> +
> +inline BYTE* pack_BYTE(BYTE* ptr, BYTE t) {
> +   ptr[0] =3D t;
> +   return ++ptr;
> +}
> +
> +inline BYTE* unpack_BYTE(BYTE* ptr, BYTE* t) {
> +   t[0] =3D ptr[0];
> +   return ++ptr;
> +}
> +
> +#define pack_BOOL(p, t) pack_BYTE(p, t)
> +#define unpack_BOOL(p, t) unpack_BYTE(p, t)
> +
> +inline BYTE* pack_UINT16(BYTE* ptr, UINT16 t) {
> +   BYTE* b =3D (BYTE*)&t;
> +#if __BYTE_ORDER =3D=3D __LITTLE_ENDIAN
> +   ptr[0] =3D b[1];
> +   ptr[1] =3D b[0];
> +#elif __BYTE_ORDER =3D=3D __BIG_ENDIAN
> +   ptr[0] =3D b[0];
> +   ptr[1] =3D b[1];
> +#endif
> +   return ptr + sizeof(UINT16);
> +}
> +
> +inline BYTE* unpack_UINT16(BYTE* ptr, UINT16* t) {
> +   BYTE* b =3D (BYTE*)t;
> +#if __BYTE_ORDER =3D=3D __LITTLE_ENDIAN
> +   b[0] =3D ptr[1];
> +   b[1] =3D ptr[0];
> +#elif __BYTE_ORDER =3D=3D __BIG_ENDIAN
> +   b[0] =3D ptr[0];
> +   b[1] =3D ptr[1];
> +#endif
> +   return ptr + sizeof(UINT16);
> +}
> +
> +inline BYTE* pack_UINT32(BYTE* ptr, UINT32 t) {
> +   BYTE* b =3D (BYTE*)&t;
> +#if __BYTE_ORDER =3D=3D __LITTLE_ENDIAN
> +   ptr[3] =3D b[0];
> +   ptr[2] =3D b[1];
> +   ptr[1] =3D b[2];
> +   ptr[0] =3D b[3];
> +#elif __BYTE_ORDER =3D=3D __BIG_ENDIAN
> +   ptr[0] =3D b[0];
> +   ptr[1] =3D b[1];
> +   ptr[2] =3D b[2];
> +   ptr[3] =3D b[3];
> +#endif
> +   return ptr + sizeof(UINT32);
> +}
> +
> +inline BYTE* unpack_UINT32(BYTE* ptr, UINT32* t) {
> +   BYTE* b =3D (BYTE*)t;
> +#if __BYTE_ORDER =3D=3D __LITTLE_ENDIAN
> +   b[0] =3D ptr[3];
> +   b[1] =3D ptr[2];
> +   b[2] =3D ptr[1];
> +   b[3] =3D ptr[0];
> +#elif __BYTE_ORDER =3D=3D __BIG_ENDIAN
> +   b[0] =3D ptr[0];
> +   b[1] =3D ptr[1];
> +   b[2] =3D ptr[2];
> +   b[3] =3D ptr[3];
> +#endif
> +   return ptr + sizeof(UINT32);
> +}
> +
> +#define pack_TPM_RESULT(p, t) pack_UINT32(p, t)
> +#define pack_TPM_PCRINDEX(p, t) pack_UINT32(p, t)
> +#define pack_TPM_DIRINDEX(p, t) pack_UINT32(p, t)
> +#define pack_TPM_HANDLE(p, t) pack_UINT32(p, t)
> +#define pack_TPM_AUTHHANDLE(p, t) pack_TPM_HANDLE(p, t)
> +#define pack_TCPA_HASHHANDLE(p, t) pack_TPM_HANDLE(p, t)
> +#define pack_TCPA_HMACHANDLE(p, t) pack_TPM_HANDLE(p, t)
> +#define pack_TCPA_ENCHANDLE(p, t) pack_TPM_HANDLE(p, t)
> +#define pack_TPM_KEY_HANDLE(p, t) pack_TPM_HANDLE(p, t)
> +#define pack_TCPA_ENTITYHANDLE(p, t) pack_TPM_HANDLE(p, t)
> +#define pack_TPM_RESOURCE_TYPE(p, t) pack_UINT32(p, t)
> +#define pack_TPM_COMMAND_CODE(p, t) pack_UINT32(p, t)
> +#define pack_TPM_PROTOCOL_ID(p, t) pack_UINT16(p, t)
> +#define pack_TPM_AUTH_DATA_USAGE(p, t) pack_BYTE(p, t)
> +#define pack_TPM_ENTITY_TYPE(p, t) pack_UINT16(p, t)
> +#define pack_TPM_ALGORITHM_ID(p, t) pack_UINT32(p, t)
> +#define pack_TPM_KEY_USAGE(p, t) pack_UINT16(p, t)
> +#define pack_TPM_STARTUP_TYPE(p, t) pack_UINT16(p, t)
> +#define pack_TPM_CAPABILITY_AREA(p, t) pack_UINT32(p, t)
> +#define pack_TPM_ENC_SCHEME(p, t) pack_UINT16(p, t)
> +#define pack_TPM_SIG_SCHEME(p, t) pack_UINT16(p, t)
> +#define pack_TPM_MIGRATE_SCHEME(p, t) pack_UINT16(p, t)
> +#define pack_TPM_PHYSICAL_PRESENCE(p, t) pack_UINT16(p, t)
> +#define pack_TPM_KEY_FLAGS(p, t) pack_UINT32(p, t)
> +
> +#define unpack_TPM_RESULT(p, t) unpack_UINT32(p, t)
> +#define unpack_TPM_PCRINDEX(p, t) unpack_UINT32(p, t)
> +#define unpack_TPM_DIRINDEX(p, t) unpack_UINT32(p, t)
> +#define unpack_TPM_HANDLE(p, t) unpack_UINT32(p, t)
> +#define unpack_TPM_AUTHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
> +#define unpack_TCPA_HASHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
> +#define unpack_TCPA_HMACHANDLE(p, t) unpack_TPM_HANDLE(p, t)
> +#define unpack_TCPA_ENCHANDLE(p, t) unpack_TPM_HANDLE(p, t)
> +#define unpack_TPM_KEY_HANDLE(p, t) unpack_TPM_HANDLE(p, t)
> +#define unpack_TCPA_ENTITYHANDLE(p, t) unpack_TPM_HANDLE(p, t)
> +#define unpack_TPM_RESOURCE_TYPE(p, t) unpack_UINT32(p, t)
> +#define unpack_TPM_COMMAND_CODE(p, t) unpack_UINT32(p, t)
> +#define unpack_TPM_PROTOCOL_ID(p, t) unpack_UINT16(p, t)
> +#define unpack_TPM_AUTH_DATA_USAGE(p, t) unpack_BYTE(p, t)
> +#define unpack_TPM_ENTITY_TYPE(p, t) unpack_UINT16(p, t)
> +#define unpack_TPM_ALGORITHM_ID(p, t) unpack_UINT32(p, t)
> +#define unpack_TPM_KEY_USAGE(p, t) unpack_UINT16(p, t)
> +#define unpack_TPM_STARTUP_TYPE(p, t) unpack_UINT16(p, t)
> +#define unpack_TPM_CAPABILITY_AREA(p, t) unpack_UINT32(p, t)
> +#define unpack_TPM_ENC_SCHEME(p, t) unpack_UINT16(p, t)
> +#define unpack_TPM_SIG_SCHEME(p, t) unpack_UINT16(p, t)
> +#define unpack_TPM_MIGRATE_SCHEME(p, t) unpack_UINT16(p, t)
> +#define unpack_TPM_PHYSICAL_PRESENCE(p, t) unpack_UINT16(p, t)
> +#define unpack_TPM_KEY_FLAGS(p, t) unpack_UINT32(p, t)
> +
> +#define pack_TPM_AUTH_HANDLE(p, t) pack_UINT32(p, t);
> +#define pack_TCS_CONTEXT_HANDLE(p, t) pack_UINT32(p, t);
> +#define pack_TCS_KEY_HANDLE(p, t) pack_UINT32(p, t);
> +
> +#define unpack_TPM_AUTH_HANDLE(p, t) unpack_UINT32(p, t);
> +#define unpack_TCS_CONTEXT_HANDLE(p, t) unpack_UINT32(p, t);
> +#define unpack_TCS_KEY_HANDLE(p, t) unpack_UINT32(p, t);
> +
> +inline BYTE* pack_BUFFER(BYTE* ptr, const BYTE* buf, UINT32 size) {
> +   memcpy(ptr, buf, size);
> +   return ptr + size;
> +}
> +
> +inline BYTE* unpack_BUFFER(BYTE* ptr, BYTE* buf, UINT32 size) {
> +   memcpy(buf, ptr, size);
> +   return ptr + size;
> +}
> +
> +inline BYTE* unpack_ALIAS(BYTE* ptr, BYTE** buf, UINT32 size) {
> +   *buf =3D ptr;
> +   return ptr + size;
> +}
> +
> +inline BYTE* unpack_ALLOC(BYTE* ptr, BYTE** buf, UINT32 size) {
> +   if(size) {
> +      *buf =3D malloc(size);
> +      memcpy(*buf, ptr, size);
> +   } else {
> +      *buf =3D NULL;
> +   }
> +   return ptr + size;
> +}
> +
> +inline BYTE* unpack_PTR(BYTE* ptr, BYTE** buf, UINT32 size, UnpackPtr =
alloc) {
> +   if(alloc =3D=3D UNPACK_ALLOC) {
> +      return unpack_ALLOC(ptr, buf, size);
> +   } else {
> +      return unpack_ALIAS(ptr, buf, size);
> +   }
> +}
> +
> +inline BYTE* pack_TPM_AUTHDATA(BYTE* ptr, const TPM_AUTHDATA* d) {
> +   return pack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
> +}
> +
> +inline BYTE* unpack_TPM_AUTHDATA(BYTE* ptr, TPM_AUTHDATA* d) {
> +   return unpack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
> +}
> +
> +#define pack_TPM_SECRET(p, t) pack_TPM_AUTHDATA(p, t)
> +#define pack_TPM_ENCAUTH(p, t) pack_TPM_AUTHDATA(p, t)
> +#define pack_TPM_PAYLOAD_TYPE(p, t) pack_BYTE(p, t)
> +#define pack_TPM_TAG(p, t) pack_UINT16(p, t)
> +#define pack_TPM_STRUCTURE_TAG(p, t) pack_UINT16(p, t)
> +
> +#define unpack_TPM_SECRET(p, t) unpack_TPM_AUTHDATA(p, t)
> +#define unpack_TPM_ENCAUTH(p, t) unpack_TPM_AUTHDATA(p, t)
> +#define unpack_TPM_PAYLOAD_TYPE(p, t) unpack_BYTE(p, t)
> +#define unpack_TPM_TAG(p, t) unpack_UINT16(p, t)
> +#define unpack_TPM_STRUCTURE_TAG(p, t) unpack_UINT16(p, t)
> +
> +inline BYTE* pack_TPM_VERSION(BYTE* ptr, const TPM_VERSION* t) {
> +   ptr[0] =3D t->major;
> +   ptr[1] =3D t->minor;
> +   ptr[2] =3D t->revMajor;
> +   ptr[3] =3D t->revMinor;
> +   return ptr + 4;
> +}
> +
> +inline BYTE* unpack_TPM_VERSION(BYTE* ptr, TPM_VERSION* t) {
> +   t->major =3D ptr[0];
> +   t->minor =3D ptr[1];
> +   t->revMajor =3D ptr[2];
> +   t->revMinor =3D ptr[3];
> +   return ptr + 4;
> +}
> +
> +inline BYTE* pack_TPM_CAP_VERSION_INFO(BYTE* ptr, const TPM_CAP_VERSIO=
N_INFO* v) {
> +   ptr =3D pack_TPM_STRUCTURE_TAG(ptr, v->tag);
> +   ptr =3D pack_TPM_VERSION(ptr, &v->version);
> +   ptr =3D pack_UINT16(ptr, v->specLevel);
> +   ptr =3D pack_BYTE(ptr, v->errataRev);
> +   ptr =3D pack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));
> +   ptr =3D pack_UINT16(ptr, v->vendorSpecificSize);
> +   ptr =3D pack_BUFFER(ptr, v->vendorSpecific, v->vendorSpecificSize);=

> +   return ptr;
> +}
> +
> +inline BYTE* unpack_TPM_CAP_VERSION_INFO(BYTE* ptr, TPM_CAP_VERSION_IN=
FO* v, UnpackPtr alloc) {
> +   ptr =3D unpack_TPM_STRUCTURE_TAG(ptr, &v->tag);
> +   ptr =3D unpack_TPM_VERSION(ptr, &v->version);
> +   ptr =3D unpack_UINT16(ptr, &v->specLevel);
> +   ptr =3D unpack_BYTE(ptr, &v->errataRev);
> +   ptr =3D unpack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));=

> +   ptr =3D unpack_UINT16(ptr, &v->vendorSpecificSize);
> +   ptr =3D unpack_PTR(ptr, &v->vendorSpecific, v->vendorSpecificSize, =
alloc);
> +   return ptr;
> +}
> +
> +inline BYTE* pack_TPM_DIGEST(BYTE* ptr, const TPM_DIGEST* d) {
> +   return pack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
> +}
> +
> +inline BYTE* unpack_TPM_DIGEST(BYTE* ptr, TPM_DIGEST* d) {
> +   return unpack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
> +}
> +
> +#define pack_TPM_PCRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
> +#define unpack_TPM_PCRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
> +
> +#define pack_TPM_COMPOSITE_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
> +#define unpack_TPM_COMPOSITE_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
> +
> +#define pack_TPM_DIRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
> +#define unpack_TPM_DIRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
> +
> +#define pack_TPM_HMAC(ptr, d) pack_TPM_DIGEST(ptr, d);
> +#define unpack_TPM_HMAC(ptr, d) unpack_TPM_DIGEST(ptr, d);
> +
> +#define pack_TPM_CHOSENID_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
> +#define unpack_TPM_CHOSENID_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
> +
> +inline BYTE* pack_TPM_NONCE(BYTE* ptr, const TPM_NONCE* n) {
> +   return pack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
> +}
> +
> +inline BYTE* unpack_TPM_NONCE(BYTE* ptr, TPM_NONCE* n) {
> +   return unpack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
> +}
> +
> +inline BYTE* pack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, const TPM_SYMMETR=
IC_KEY_PARMS* k) {
> +   ptr =3D pack_UINT32(ptr, k->keyLength);
> +   ptr =3D pack_UINT32(ptr, k->blockSize);
> +   ptr =3D pack_UINT32(ptr, k->ivSize);
> +   return pack_BUFFER(ptr, k->IV, k->ivSize);
> +}
> +
> +inline BYTE* unpack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, TPM_SYMMETRIC_K=
EY_PARMS* k, UnpackPtr alloc) {
> +   ptr =3D unpack_UINT32(ptr, &k->keyLength);
> +   ptr =3D unpack_UINT32(ptr, &k->blockSize);
> +   ptr =3D unpack_UINT32(ptr, &k->ivSize);
> +   return unpack_PTR(ptr, &k->IV, k->ivSize, alloc);
> +}
> +
> +inline BYTE* pack_TPM_RSA_KEY_PARMS(BYTE* ptr, const TPM_RSA_KEY_PARMS=
* k) {
> +   ptr =3D pack_UINT32(ptr, k->keyLength);
> +   ptr =3D pack_UINT32(ptr, k->numPrimes);
> +   ptr =3D pack_UINT32(ptr, k->exponentSize);
> +   return pack_BUFFER(ptr, k->exponent, k->exponentSize);
> +}
> +
> +inline BYTE* unpack_TPM_RSA_KEY_PARMS(BYTE* ptr, TPM_RSA_KEY_PARMS* k,=
 UnpackPtr alloc) {
> +   ptr =3D unpack_UINT32(ptr, &k->keyLength);
> +   ptr =3D unpack_UINT32(ptr, &k->numPrimes);
> +   ptr =3D unpack_UINT32(ptr, &k->exponentSize);
> +   return unpack_PTR(ptr, &k->exponent, k->exponentSize, alloc);
> +}
> +
> +inline BYTE* pack_TPM_KEY_PARMS(BYTE* ptr, const TPM_KEY_PARMS* k) {
> +   ptr =3D pack_TPM_ALGORITHM_ID(ptr, k->algorithmID);
> +   ptr =3D pack_TPM_ENC_SCHEME(ptr, k->encScheme);
> +   ptr =3D pack_TPM_SIG_SCHEME(ptr, k->sigScheme);
> +   ptr =3D pack_UINT32(ptr, k->parmSize);
> +
> +   if(k->parmSize) {
> +      switch(k->algorithmID) {
> +         case TPM_ALG_RSA:
> +            return pack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa);
> +         case TPM_ALG_AES128:
> +         case TPM_ALG_AES192:
> +         case TPM_ALG_AES256:
> +            return pack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym);
> +      }
> +   }
> +   return ptr;
> +}
> +
> +inline BYTE* unpack_TPM_KEY_PARMS(BYTE* ptr, TPM_KEY_PARMS* k, UnpackP=
tr alloc) {
> +   ptr =3D unpack_TPM_ALGORITHM_ID(ptr, &k->algorithmID);
> +   ptr =3D unpack_TPM_ENC_SCHEME(ptr, &k->encScheme);
> +   ptr =3D unpack_TPM_SIG_SCHEME(ptr, &k->sigScheme);
> +   ptr =3D unpack_UINT32(ptr, &k->parmSize);
> +
> +   if(k->parmSize) {
> +      switch(k->algorithmID) {
> +         case TPM_ALG_RSA:
> +            return unpack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa, alloc)=
;
> +         case TPM_ALG_AES128:
> +         case TPM_ALG_AES192:
> +         case TPM_ALG_AES256:
> +            return unpack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym, =
alloc);
> +      }
> +   }
> +   return ptr;
> +}
> +
> +inline BYTE* pack_TPM_STORE_PUBKEY(BYTE* ptr, const TPM_STORE_PUBKEY* =
k) {
> +   ptr =3D pack_UINT32(ptr, k->keyLength);
> +   ptr =3D pack_BUFFER(ptr, k->key, k->keyLength);
> +   return ptr;
> +}
> +
> +inline BYTE* unpack_TPM_STORE_PUBKEY(BYTE* ptr, TPM_STORE_PUBKEY* k, U=
npackPtr alloc) {
> +   ptr =3D unpack_UINT32(ptr, &k->keyLength);
> +   ptr =3D unpack_PTR(ptr, &k->key, k->keyLength, alloc);
> +   return ptr;
> +}
> +
> +inline BYTE* pack_TPM_PUBKEY(BYTE* ptr, const TPM_PUBKEY* k) {
> +   ptr =3D pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
> +   return pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
> +}
> +
> +inline BYTE* unpack_TPM_PUBKEY(BYTE* ptr, TPM_PUBKEY* k, UnpackPtr all=
oc) {
> +   ptr =3D unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
> +   return unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
> +}
> +
> +inline BYTE* pack_TPM_PCR_SELECTION(BYTE* ptr, const TPM_PCR_SELECTION=
* p) {
> +   ptr =3D pack_UINT16(ptr, p->sizeOfSelect);
> +   ptr =3D pack_BUFFER(ptr, p->pcrSelect, p->sizeOfSelect);
> +   return ptr;
> +}
> +
> +inline BYTE* unpack_TPM_PCR_SELECTION(BYTE* ptr, TPM_PCR_SELECTION* p,=
 UnpackPtr alloc) {
> +   ptr =3D unpack_UINT16(ptr, &p->sizeOfSelect);
> +   ptr =3D unpack_PTR(ptr, &p->pcrSelect, p->sizeOfSelect, alloc);
> +   return ptr;
> +}
> +
> +inline BYTE* pack_TPM_PCR_INFO(BYTE* ptr, const TPM_PCR_INFO* p) {
> +   ptr =3D pack_TPM_PCR_SELECTION(ptr, &p->pcrSelection);
> +   ptr =3D pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
> +   ptr =3D pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
> +   return ptr;
> +}
> +
> +inline BYTE* unpack_TPM_PCR_INFO(BYTE* ptr, TPM_PCR_INFO* p, UnpackPtr=
 alloc) {
> +   ptr =3D unpack_TPM_PCR_SELECTION(ptr, &p->pcrSelection, alloc);
> +   ptr =3D unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
> +   ptr =3D unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
> +   return ptr;
> +}
> +
> +inline BYTE* pack_TPM_PCR_COMPOSITE(BYTE* ptr, const TPM_PCR_COMPOSITE=
* p) {
> +   ptr =3D pack_TPM_PCR_SELECTION(ptr, &p->select);
> +   ptr =3D pack_UINT32(ptr, p->valueSize);
> +   ptr =3D pack_BUFFER(ptr, (const BYTE*)p->pcrValue, p->valueSize);
> +   return ptr;
> +}
> +
> +inline BYTE* unpack_TPM_PCR_COMPOSITE(BYTE* ptr, TPM_PCR_COMPOSITE* p,=
 UnpackPtr alloc) {
> +   ptr =3D unpack_TPM_PCR_SELECTION(ptr, &p->select, alloc);
> +   ptr =3D unpack_UINT32(ptr, &p->valueSize);
> +   ptr =3D unpack_PTR(ptr, (BYTE**)&p->pcrValue, p->valueSize, alloc);=

> +   return ptr;
> +}
> +
> +inline BYTE* pack_TPM_KEY(BYTE* ptr, const TPM_KEY* k) {
> +   ptr =3D pack_TPM_VERSION(ptr, &k->ver);
> +   ptr =3D pack_TPM_KEY_USAGE(ptr, k->keyUsage);
> +   ptr =3D pack_TPM_KEY_FLAGS(ptr, k->keyFlags);
> +   ptr =3D pack_TPM_AUTH_DATA_USAGE(ptr, k->authDataUsage);
> +   ptr =3D pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
> +   ptr =3D pack_UINT32(ptr, k->PCRInfoSize);
> +   if(k->PCRInfoSize) {
> +      ptr =3D pack_TPM_PCR_INFO(ptr, &k->PCRInfo);
> +   }
> +   ptr =3D pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
> +   ptr =3D pack_UINT32(ptr, k->encDataSize);
> +   return pack_BUFFER(ptr, k->encData, k->encDataSize);
> +}
> +
> +inline BYTE* unpack_TPM_KEY(BYTE* ptr, TPM_KEY* k, UnpackPtr alloc) {
> +   ptr =3D unpack_TPM_VERSION(ptr, &k->ver);
> +   ptr =3D unpack_TPM_KEY_USAGE(ptr, &k->keyUsage);
> +   ptr =3D unpack_TPM_KEY_FLAGS(ptr, &k->keyFlags);
> +   ptr =3D unpack_TPM_AUTH_DATA_USAGE(ptr, &k->authDataUsage);
> +   ptr =3D unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
> +   ptr =3D unpack_UINT32(ptr, &k->PCRInfoSize);
> +   if(k->PCRInfoSize) {
> +      ptr =3D unpack_TPM_PCR_INFO(ptr, &k->PCRInfo, alloc);
> +   }
> +   ptr =3D unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
> +   ptr =3D unpack_UINT32(ptr, &k->encDataSize);
> +   return unpack_PTR(ptr, &k->encData, k->encDataSize, alloc);
> +}
> +
> +inline BYTE* pack_TPM_BOUND_DATA(BYTE* ptr, const TPM_BOUND_DATA* b, U=
INT32 payloadSize) {
> +   ptr =3D pack_TPM_VERSION(ptr, &b->ver);
> +   ptr =3D pack_TPM_PAYLOAD_TYPE(ptr, b->payload);
> +   return pack_BUFFER(ptr, b->payloadData, payloadSize);
> +}
> +
> +inline BYTE* unpack_TPM_BOUND_DATA(BYTE* ptr, TPM_BOUND_DATA* b, UINT3=
2 payloadSize, UnpackPtr alloc) {
> +   ptr =3D unpack_TPM_VERSION(ptr, &b->ver);
> +   ptr =3D unpack_TPM_PAYLOAD_TYPE(ptr, &b->payload);
> +   return unpack_PTR(ptr, &b->payloadData, payloadSize, alloc);
> +}
> +
> +inline BYTE* pack_TPM_STORED_DATA(BYTE* ptr, const TPM_STORED_DATA* d)=
 {
> +   ptr =3D pack_TPM_VERSION(ptr, &d->ver);
> +   ptr =3D pack_UINT32(ptr, d->sealInfoSize);
> +   if(d->sealInfoSize) {
> +      ptr =3D pack_TPM_PCR_INFO(ptr, &d->sealInfo);
> +   }
> +   ptr =3D pack_UINT32(ptr, d->encDataSize);
> +   ptr =3D pack_BUFFER(ptr, d->encData, d->encDataSize);
> +   return ptr;
> +}
> +
> +inline BYTE* unpack_TPM_STORED_DATA(BYTE* ptr, TPM_STORED_DATA* d, Unp=
ackPtr alloc) {
> +   ptr =3D unpack_TPM_VERSION(ptr, &d->ver);
> +   ptr =3D unpack_UINT32(ptr, &d->sealInfoSize);
> +   if(d->sealInfoSize) {
> +      ptr =3D unpack_TPM_PCR_INFO(ptr, &d->sealInfo, alloc);
> +   }
> +   ptr =3D unpack_UINT32(ptr, &d->encDataSize);
> +   ptr =3D unpack_PTR(ptr, &d->encData, d->encDataSize, alloc);
> +   return ptr;
> +}
> +
> +inline BYTE* pack_TPM_AUTH_SESSION(BYTE* ptr, const TPM_AUTH_SESSION* =
auth) {
> +   ptr =3D pack_TPM_AUTH_HANDLE(ptr, auth->AuthHandle);
> +   ptr =3D pack_TPM_NONCE(ptr, &auth->NonceOdd);
> +   ptr =3D pack_BOOL(ptr, auth->fContinueAuthSession);
> +   ptr =3D pack_TPM_AUTHDATA(ptr, &auth->HMAC);
> +   return ptr;
> +}
> +
> +inline BYTE* unpack_TPM_AUTH_SESSION(BYTE* ptr, TPM_AUTH_SESSION* auth=
) {
> +   ptr =3D unpack_TPM_NONCE(ptr, &auth->NonceEven);
> +   ptr =3D unpack_BOOL(ptr, &auth->fContinueAuthSession);
> +   ptr =3D unpack_TPM_AUTHDATA(ptr, &auth->HMAC);
> +   return ptr;
> +}
> +
> +inline BYTE* pack_TPM_RQU_HEADER(BYTE* ptr,
> +      TPM_TAG tag,
> +      UINT32 size,
> +      TPM_COMMAND_CODE ord) {
> +   ptr =3D pack_UINT16(ptr, tag);
> +   ptr =3D pack_UINT32(ptr, size);
> +   return pack_UINT32(ptr, ord);
> +}
> +
> +inline BYTE* unpack_TPM_RQU_HEADER(BYTE* ptr,
> +      TPM_TAG* tag,
> +      UINT32* size,
> +      TPM_COMMAND_CODE* ord) {
> +   ptr =3D unpack_UINT16(ptr, tag);
> +   ptr =3D unpack_UINT32(ptr, size);
> +   ptr =3D unpack_UINT32(ptr, ord);
> +   return ptr;
> +}
> +
> +#define pack_TPM_RSP_HEADER(p, t, s, r) pack_TPM_RQU_HEADER(p, t, s, r=
);
> +#define unpack_TPM_RSP_HEADER(p, t, s, r) unpack_TPM_RQU_HEADER(p, t, =
s, r);
> +
> +#endif
> diff --git a/stubdom/vtpmmgr/minios.cfg b/stubdom/vtpmmgr/minios.cfg
> new file mode 100644
> index 0000000..3fb383d
> --- /dev/null
> +++ b/stubdom/vtpmmgr/minios.cfg
> @@ -0,0 +1,14 @@
> +CONFIG_TPMFRONT=3Dy
> +CONFIG_TPM_TIS=3Dy
> +CONFIG_TPMBACK=3Dy
> +CONFIG_START_NETWORK=3Dn
> +CONFIG_TEST=3Dn
> +CONFIG_PCIFRONT=3Dn
> +CONFIG_BLKFRONT=3Dy
> +CONFIG_NETFRONT=3Dn
> +CONFIG_FBFRONT=3Dn
> +CONFIG_KBDFRONT=3Dn
> +CONFIG_CONSFRONT=3Dn
> +CONFIG_XENBUS=3Dy
> +CONFIG_LWIP=3Dn
> +CONFIG_XC=3Dn
> diff --git a/stubdom/vtpmmgr/tcg.h b/stubdom/vtpmmgr/tcg.h
> new file mode 100644
> index 0000000..7687eae
> --- /dev/null
> +++ b/stubdom/vtpmmgr/tcg.h
> @@ -0,0 +1,707 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005 Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#ifndef __TCG_H__
> +#define __TCG_H__
> +
> +#include <stdlib.h>
> +#include <stdint.h>
> +
> +// **************************** CONSTANTS ****************************=
*****
> +
> +// BOOL values
> +#define TRUE 0x01
> +#define FALSE 0x00
> +
> +#define TCPA_MAX_BUFFER_LENGTH 0x2000
> +
> +//
> +// TPM_COMMAND_CODE values
> +#define TPM_PROTECTED_ORDINAL 0x00000000UL
> +#define TPM_UNPROTECTED_ORDINAL 0x80000000UL
> +#define TPM_CONNECTION_ORDINAL 0x40000000UL
> +#define TPM_VENDOR_ORDINAL 0x20000000UL
> +
> +#define TPM_ORD_OIAP                     (10UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_OSAP                     (11UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_ChangeAuth               (12UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_TakeOwnership            (13UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_ChangeAuthAsymStart      (14UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_ChangeAuthAsymFinish     (15UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_ChangeAuthOwner          (16UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_Extend                   (20UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_PcrRead                  (21UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_Quote                    (22UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_Seal                     (23UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_Unseal                   (24UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_DirWriteAuth             (25UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_DirRead                  (26UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_UnBind                   (30UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_CreateWrapKey            (31UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_LoadKey                  (32UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_GetPubKey                (33UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_EvictKey                 (34UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_CreateMigrationBlob      (40UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_ReWrapKey                (41UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_ConvertMigrationBlob     (42UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_AuthorizeMigrationKey    (43UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_CreateMaintenanceArchive (44UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_LoadMaintenanceArchive   (45UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_KillMaintenanceFeature   (46UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_LoadManuMaintPub         (47UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_ReadManuMaintPub         (48UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_CertifyKey               (50UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_Sign                     (60UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_GetRandom                (70UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_StirRandom               (71UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_SelfTestFull             (80UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_SelfTestStartup          (81UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_CertifySelfTest          (82UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_ContinueSelfTest         (83UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_GetTestResult            (84UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_Reset                    (90UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_OwnerClear               (91UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_DisableOwnerClear        (92UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_ForceClear               (93UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_DisableForceClear        (94UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_GetCapabilitySigned      (100UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_GetCapability            (101UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_GetCapabilityOwner       (102UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_OwnerSetDisable          (110UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_PhysicalEnable           (111UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_PhysicalDisable          (112UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SetOwnerInstall          (113UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_PhysicalSetDeactivated   (114UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SetTempDeactivated       (115UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_CreateEndorsementKeyPair (120UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_MakeIdentity             (121UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_ActivateIdentity         (122UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_ReadPubek                (124UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_OwnerReadPubek           (125UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_DisablePubekRead         (126UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_GetAuditEvent            (130UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_GetAuditEventSigned      (131UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_GetOrdinalAuditStatus    (140UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SetOrdinalAuditStatus    (141UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_Terminate_Handle         (150UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_Init                     (151UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SaveState                (152UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_Startup                  (153UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SetRedirection           (154UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SHA1Start                (160UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SHA1Update               (161UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SHA1Complete             (162UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SHA1CompleteExtend       (163UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_FieldUpgrade             (170UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SaveKeyContext           (180UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_LoadKeyContext           (181UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SaveAuthContext          (182UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_LoadAuthContext          (183UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SaveContext                      (184UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_LoadContext                      (185UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_FlushSpecific                    (186UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_PCR_Reset                        (200UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_NV_DefineSpace                   (204UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_NV_WriteValue                    (205UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_NV_WriteValueAuth                (206UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_NV_ReadValue                     (207UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_NV_ReadValueAuth                 (208UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_Delegate_UpdateVerification      (209UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_Delegate_Manage                  (210UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_Delegate_CreateKeyDelegation     (212UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_Delegate_CreateOwnerDelegation   (213UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_Delegate_VerifyDelegation        (214UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_Delegate_LoadOwnerDelegation     (216UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_Delegate_ReadAuth                (217UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_Delegate_ReadTable               (219UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_CreateCounter                    (220UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_IncrementCounter                 (221UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_ReadCounter                      (222UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_ReleaseCounter                   (223UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_ReleaseCounterOwner              (224UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_EstablishTransport               (230UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_ExecuteTransport                 (231UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_ReleaseTransportSigned           (232UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_GetTicks                         (241UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_TickStampBlob                    (242UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_MAX                              (256UL + TPM_PROTECTE=
D_ORDINAL)
> +
> +#define TSC_ORD_PhysicalPresence         (10UL + TPM_CONNECTION_ORDINA=
L)
> +
> +
> +
> +//
> +// TPM_RESULT values
> +//
> +// just put in the whole table from spec 1.2
> +
> +#define TPM_BASE   0x0 // The start of TPM return codes
> +#define TPM_VENDOR_ERROR 0x00000400 // Mask to indicate that the error=
 code is vendor specific for vendor specific commands
> +#define TPM_NON_FATAL  0x00000800 // Mask to indicate that the error c=
ode is a non-fatal failure.
> +
> +#define TPM_SUCCESS   TPM_BASE // Successful completion of the operati=
on
> +#define TPM_AUTHFAIL      TPM_BASE + 1 // Authentication failed
> +#define TPM_BADINDEX      TPM_BASE + 2 // The index to a PCR, DIR or o=
ther register is incorrect
> +#define TPM_BAD_PARAMETER     TPM_BASE + 3 // One or more parameter is=
 bad
> +#define TPM_AUDITFAILURE     TPM_BASE + 4 // An operation completed su=
ccessfully but the auditing of that operation failed.
> +#define TPM_CLEAR_DISABLED     TPM_BASE + 5 // The clear disable flag =
is set and all clear operations now require physical access
> +#define TPM_DEACTIVATED     TPM_BASE + 6 // The TPM is deactivated
> +#define TPM_DISABLED      TPM_BASE + 7 // The TPM is disabled
> +#define TPM_DISABLED_CMD     TPM_BASE + 8 // The target command has be=
en disabled
> +#define TPM_FAIL       TPM_BASE + 9 // The operation failed
> +#define TPM_BAD_ORDINAL     TPM_BASE + 10 // The ordinal was unknown o=
r inconsistent
> +#define TPM_INSTALL_DISABLED   TPM_BASE + 11 // The ability to install=
 an owner is disabled
> +#define TPM_INVALID_KEYHANDLE  TPM_BASE + 12 // The key handle present=
ed was invalid
> +#define TPM_KEYNOTFOUND     TPM_BASE + 13 // The target key was not fo=
und
> +#define TPM_INAPPROPRIATE_ENC  TPM_BASE + 14 // Unacceptable encryptio=
n scheme
> +#define TPM_MIGRATEFAIL     TPM_BASE + 15 // Migration authorization f=
ailed
> +#define TPM_INVALID_PCR_INFO   TPM_BASE + 16 // PCR information could =
not be interpreted
> +#define TPM_NOSPACE      TPM_BASE + 17 // No room to load key.
> +#define TPM_NOSRK       TPM_BASE + 18 // There is no SRK set
> +#define TPM_NOTSEALED_BLOB     TPM_BASE + 19 // An encrypted blob is i=
nvalid or was not created by this TPM
> +#define TPM_OWNER_SET      TPM_BASE + 20 // There is already an Owner
> +#define TPM_RESOURCES      TPM_BASE + 21 // The TPM has insufficient i=
nternal resources to perform the requested action.
> +#define TPM_SHORTRANDOM     TPM_BASE + 22 // A random string was too s=
hort
> +#define TPM_SIZE       TPM_BASE + 23 // The TPM does not have the spac=
e to perform the operation.
> +#define TPM_WRONGPCRVAL     TPM_BASE + 24 // The named PCR value does =
not match the current PCR value.
> +#define TPM_BAD_PARAM_SIZE     TPM_BASE + 25 // The paramSize argument=
 to the command has the incorrect value
> +#define TPM_SHA_THREAD      TPM_BASE + 26 // There is no existing SHA-=
1 thread.
> +#define TPM_SHA_ERROR      TPM_BASE + 27 // The calculation is unable =
to proceed because the existing SHA-1 thread has already encountered an e=
rror.
> +#define TPM_FAILEDSELFTEST     TPM_BASE + 28 // Self-test has failed a=
nd the TPM has shutdown.
> +#define TPM_AUTH2FAIL      TPM_BASE + 29 // The authorization for the =
second key in a 2 key function failed authorization
> +#define TPM_BADTAG       TPM_BASE + 30 // The tag value sent to for a =
command is invalid
> +#define TPM_IOERROR      TPM_BASE + 31 // An IO error occurred transmi=
tting information to the TPM
> +#define TPM_ENCRYPT_ERROR     TPM_BASE + 32 // The encryption process =
had a problem.
> +#define TPM_DECRYPT_ERROR     TPM_BASE + 33 // The decryption process =
did not complete.
> +#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 // An invalid handle was =
used.
> +#define TPM_NO_ENDORSEMENT     TPM_BASE + 35 // The TPM does not a EK =
installed
> +#define TPM_INVALID_KEYUSAGE   TPM_BASE + 36 // The usage of a key is =
not allowed
> +#define TPM_WRONG_ENTITYTYPE   TPM_BASE + 37 // The submitted entity t=
ype is not allowed
> +#define TPM_INVALID_POSTINIT   TPM_BASE + 38 // The command was receiv=
ed in the wrong sequence relative to TPM_Init and a subsequent TPM_Startu=
p
> +#define TPM_INAPPROPRIATE_SIG  TPM_BASE + 39 // Signed data cannot inc=
lude additional DER information
> +#define TPM_BAD_KEY_PROPERTY   TPM_BASE + 40 // The key properties in =
TPM_KEY_PARMs are not supported by this TPM
> +
> +#define TPM_BAD_MIGRATION      TPM_BASE + 41 // The migration properti=
es of this key are incorrect.
> +#define TPM_BAD_SCHEME       TPM_BASE + 42 // The signature or encrypt=
ion scheme for this key is incorrect or not permitted in this situation.
> +#define TPM_BAD_DATASIZE      TPM_BASE + 43 // The size of the data (o=
r blob) parameter is bad or inconsistent with the referenced key
> +#define TPM_BAD_MODE       TPM_BASE + 44 // A mode parameter is bad, s=
uch as capArea or subCapArea for TPM_GetCapability, phsicalPresence param=
eter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBl=
ob.
> +#define TPM_BAD_PRESENCE      TPM_BASE + 45 // Either the physicalPres=
ence or physicalPresenceLock bits have the wrong value
> +#define TPM_BAD_VERSION      TPM_BASE + 46 // The TPM cannot perform t=
his version of the capability
> +#define TPM_NO_WRAP_TRANSPORT     TPM_BASE + 47 // The TPM does not al=
low for wrapped transport sessions
> +#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 // TPM audit construc=
tion failed and the underlying command was returning a failure code also
> +#define TPM_AUDITFAIL_SUCCESSFUL   TPM_BASE + 49 // TPM audit construc=
tion failed and the underlying command was returning success
> +#define TPM_NOTRESETABLE      TPM_BASE + 50 // Attempt to reset a PCR =
register that does not have the resettable attribute
> +#define TPM_NOTLOCAL       TPM_BASE + 51 // Attempt to reset a PCR reg=
ister that requires locality and locality modifier not part of command tr=
ansport
> +#define TPM_BAD_TYPE       TPM_BASE + 52 // Make identity blob not pro=
perly typed
> +#define TPM_INVALID_RESOURCE     TPM_BASE + 53 // When saving context =
identified resource type does not match actual resource
> +#define TPM_NOTFIPS       TPM_BASE + 54 // The TPM is attempting to ex=
ecute a command only available when in FIPS mode
> +#define TPM_INVALID_FAMILY      TPM_BASE + 55 // The command is attemp=
ting to use an invalid family ID
> +#define TPM_NO_NV_PERMISSION     TPM_BASE + 56 // The permission to ma=
nipulate the NV storage is not available
> +#define TPM_REQUIRES_SIGN      TPM_BASE + 57 // The operation requires=
 a signed command
> +#define TPM_KEY_NOTSUPPORTED     TPM_BASE + 58 // Wrong operation to l=
oad an NV key
> +#define TPM_AUTH_CONFLICT      TPM_BASE + 59 // NV_LoadKey blob requir=
es both owner and blob authorization
> +#define TPM_AREA_LOCKED      TPM_BASE + 60 // The NV area is locked an=
d not writtable
> +#define TPM_BAD_LOCALITY      TPM_BASE + 61 // The locality is incorre=
ct for the attempted operation
> +#define TPM_READ_ONLY       TPM_BASE + 62 // The NV area is read only =
and can't be written to
> +#define TPM_PER_NOWRITE      TPM_BASE + 63 // There is no protection o=
n the write to the NV area
> +#define TPM_FAMILYCOUNT      TPM_BASE + 64 // The family count value d=
oes not match
> +#define TPM_WRITE_LOCKED      TPM_BASE + 65 // The NV area has already=
 been written to
> +#define TPM_BAD_ATTRIBUTES      TPM_BASE + 66 // The NV area attribute=
s conflict
> +#define TPM_INVALID_STRUCTURE     TPM_BASE + 67 // The structure tag a=
nd version are invalid or inconsistent
> +#define TPM_KEY_OWNER_CONTROL     TPM_BASE + 68 // The key is under co=
ntrol of the TPM Owner and can only be evicted by the TPM Owner.
> +#define TPM_BAD_COUNTER      TPM_BASE + 69 // The counter handle is in=
correct
> +#define TPM_NOT_FULLWRITE      TPM_BASE + 70 // The write is not a com=
plete write of the area
> +#define TPM_CONTEXT_GAP      TPM_BASE + 71 // The gap between saved co=
ntext counts is too large
> +#define TPM_MAXNVWRITES      TPM_BASE + 72 // The maximum number of NV=
 writes without an owner has been exceeded
> +#define TPM_NOOPERATOR       TPM_BASE + 73 // No operator authorizatio=
n value is set
> +#define TPM_RESOURCEMISSING     TPM_BASE + 74 // The resource pointed =
to by context is not loaded
> +#define TPM_DELEGATE_LOCK      TPM_BASE + 75 // The delegate administr=
ation is locked
> +#define TPM_DELEGATE_FAMILY     TPM_BASE + 76 // Attempt to manage a f=
amily other then the delegated family
> +#define TPM_DELEGATE_ADMIN      TPM_BASE + 77 // Delegation table mana=
gement not enabled
> +#define TPM_TRANSPORT_EXCLUSIVE    TPM_BASE + 78 // There was a comman=
d executed outside of an exclusive transport session
> +
> +// TPM_STARTUP_TYPE values
> +#define TPM_ST_CLEAR 0x0001
> +#define TPM_ST_STATE 0x0002
> +#define TPM_ST_DEACTIVATED 0x003
> +
> +// TPM_TAG values
> +#define TPM_TAG_RQU_COMMAND 0x00c1
> +#define TPM_TAG_RQU_AUTH1_COMMAND 0x00c2
> +#define TPM_TAG_RQU_AUTH2_COMMAND 0x00c3
> +#define TPM_TAG_RSP_COMMAND 0x00c4
> +#define TPM_TAG_RSP_AUTH1_COMMAND 0x00c5
> +#define TPM_TAG_RSP_AUTH2_COMMAND 0x00c6
> +
> +// TPM_PAYLOAD_TYPE values
> +#define TPM_PT_ASYM 0x01
> +#define TPM_PT_BIND 0x02
> +#define TPM_PT_MIGRATE 0x03
> +#define TPM_PT_MAINT 0x04
> +#define TPM_PT_SEAL 0x05
> +
> +// TPM_ENTITY_TYPE values
> +#define TPM_ET_KEYHANDLE 0x0001
> +#define TPM_ET_OWNER 0x0002
> +#define TPM_ET_DATA 0x0003
> +#define TPM_ET_SRK 0x0004
> +#define TPM_ET_KEY 0x0005
> +
> +/// TPM_ResourceTypes
> +#define TPM_RT_KEY      0x00000001
> +#define TPM_RT_AUTH     0x00000002
> +#define TPM_RT_HASH     0x00000003
> +#define TPM_RT_TRANS    0x00000004
> +#define TPM_RT_CONTEXT  0x00000005
> +#define TPM_RT_COUNTER  0x00000006
> +#define TPM_RT_DELEGATE 0x00000007
> +#define TPM_RT_DAA_TPM  0x00000008
> +#define TPM_RT_DAA_V0   0x00000009
> +#define TPM_RT_DAA_V1   0x0000000A
> +
> +
> +
> +// TPM_PROTOCOL_ID values
> +#define TPM_PID_OIAP 0x0001
> +#define TPM_PID_OSAP 0x0002
> +#define TPM_PID_ADIP 0x0003
> +#define TPM_PID_ADCP 0x0004
> +#define TPM_PID_OWNER 0x0005
> +
> +// TPM_ALGORITHM_ID values
> +#define TPM_ALG_RSA 0x00000001
> +#define TPM_ALG_SHA 0x00000004
> +#define TPM_ALG_HMAC 0x00000005
> +#define TPM_ALG_AES128 0x00000006
> +#define TPM_ALG_MFG1 0x00000007
> +#define TPM_ALG_AES192 0x00000008
> +#define TPM_ALG_AES256 0x00000009
> +#define TPM_ALG_XOR 0x0000000A
> +
> +// TPM_ENC_SCHEME values
> +#define TPM_ES_NONE 0x0001
> +#define TPM_ES_RSAESPKCSv15 0x0002
> +#define TPM_ES_RSAESOAEP_SHA1_MGF1 0x0003
> +
> +// TPM_SIG_SCHEME values
> +#define TPM_SS_NONE 0x0001
> +#define TPM_SS_RSASSAPKCS1v15_SHA1 0x0002
> +#define TPM_SS_RSASSAPKCS1v15_DER 0x0003
> +
> +/*
> + * TPM_CAPABILITY_AREA Values for TPM_GetCapability ([TPM_Part2], Sect=
ion 21.1)
> + */
> +#define TPM_CAP_ORD                     0x00000001
> +#define TPM_CAP_ALG                     0x00000002
> +#define TPM_CAP_PID                     0x00000003
> +#define TPM_CAP_FLAG                    0x00000004
> +#define TPM_CAP_PROPERTY                0x00000005
> +#define TPM_CAP_VERSION                 0x00000006
> +#define TPM_CAP_KEY_HANDLE              0x00000007
> +#define TPM_CAP_CHECK_LOADED            0x00000008
> +#define TPM_CAP_SYM_MODE                0x00000009
> +#define TPM_CAP_KEY_STATUS              0x0000000C
> +#define TPM_CAP_NV_LIST                 0x0000000D
> +#define TPM_CAP_MFR                     0x00000010
> +#define TPM_CAP_NV_INDEX                0x00000011
> +#define TPM_CAP_TRANS_ALG               0x00000012
> +#define TPM_CAP_HANDLE                  0x00000014
> +#define TPM_CAP_TRANS_ES                0x00000015
> +#define TPM_CAP_AUTH_ENCRYPT            0x00000017
> +#define TPM_CAP_SELECT_SIZE             0x00000018
> +#define TPM_CAP_DA_LOGIC                0x00000019
> +#define TPM_CAP_VERSION_VAL             0x0000001A
> +
> +/* subCap definitions ([TPM_Part2], Section 21.2) */
> +#define TPM_CAP_PROP_PCR                0x00000101
> +#define TPM_CAP_PROP_DIR                0x00000102
> +#define TPM_CAP_PROP_MANUFACTURER       0x00000103
> +#define TPM_CAP_PROP_KEYS               0x00000104
> +#define TPM_CAP_PROP_MIN_COUNTER        0x00000107
> +#define TPM_CAP_FLAG_PERMANENT          0x00000108
> +#define TPM_CAP_FLAG_VOLATILE           0x00000109
> +#define TPM_CAP_PROP_AUTHSESS           0x0000010A
> +#define TPM_CAP_PROP_TRANSESS           0x0000010B
> +#define TPM_CAP_PROP_COUNTERS           0x0000010C
> +#define TPM_CAP_PROP_MAX_AUTHSESS       0x0000010D
> +#define TPM_CAP_PROP_MAX_TRANSESS       0x0000010E
> +#define TPM_CAP_PROP_MAX_COUNTERS       0x0000010F
> +#define TPM_CAP_PROP_MAX_KEYS           0x00000110
> +#define TPM_CAP_PROP_OWNER              0x00000111
> +#define TPM_CAP_PROP_CONTEXT            0x00000112
> +#define TPM_CAP_PROP_MAX_CONTEXT        0x00000113
> +#define TPM_CAP_PROP_FAMILYROWS         0x00000114
> +#define TPM_CAP_PROP_TIS_TIMEOUT        0x00000115
> +#define TPM_CAP_PROP_STARTUP_EFFECT     0x00000116
> +#define TPM_CAP_PROP_DELEGATE_ROW       0x00000117
> +#define TPM_CAP_PROP_MAX_DAASESS        0x00000119
> +#define TPM_CAP_PROP_DAASESS            0x0000011A
> +#define TPM_CAP_PROP_CONTEXT_DIST       0x0000011B
> +#define TPM_CAP_PROP_DAA_INTERRUPT      0x0000011C
> +#define TPM_CAP_PROP_SESSIONS           0x0000011D
> +#define TPM_CAP_PROP_MAX_SESSIONS       0x0000011E
> +#define TPM_CAP_PROP_CMK_RESTRICTION    0x0000011F
> +#define TPM_CAP_PROP_DURATION           0x00000120
> +#define TPM_CAP_PROP_ACTIVE_COUNTER     0x00000122
> +#define TPM_CAP_PROP_MAX_NV_AVAILABLE   0x00000123
> +#define TPM_CAP_PROP_INPUT_BUFFER       0x00000124
> +
> +// TPM_KEY_USAGE values
> +#define TPM_KEY_EK 0x0000
> +#define TPM_KEY_SIGNING 0x0010
> +#define TPM_KEY_STORAGE 0x0011
> +#define TPM_KEY_IDENTITY 0x0012
> +#define TPM_KEY_AUTHCHANGE 0X0013
> +#define TPM_KEY_BIND 0x0014
> +#define TPM_KEY_LEGACY 0x0015
> +
> +// TPM_AUTH_DATA_USAGE values
> +#define TPM_AUTH_NEVER 0x00
> +#define TPM_AUTH_ALWAYS 0x01
> +
> +// Key Handle of owner and srk
> +#define TPM_OWNER_KEYHANDLE 0x40000001
> +#define TPM_SRK_KEYHANDLE 0x40000000
> +
> +
> +
> +// *************************** TYPEDEFS ******************************=
***
> +typedef unsigned char BYTE;
> +typedef unsigned char BOOL;
> +typedef uint16_t UINT16;
> +typedef uint32_t UINT32;
> +typedef uint64_t UINT64;
> +
> +typedef UINT32 TPM_RESULT;
> +typedef UINT32 TPM_PCRINDEX;
> +typedef UINT32 TPM_DIRINDEX;
> +typedef UINT32 TPM_HANDLE;
> +typedef TPM_HANDLE TPM_AUTHHANDLE;
> +typedef TPM_HANDLE TCPA_HASHHANDLE;
> +typedef TPM_HANDLE TCPA_HMACHANDLE;
> +typedef TPM_HANDLE TCPA_ENCHANDLE;
> +typedef TPM_HANDLE TPM_KEY_HANDLE;
> +typedef TPM_HANDLE TCPA_ENTITYHANDLE;
> +typedef UINT32 TPM_RESOURCE_TYPE;
> +typedef UINT32 TPM_COMMAND_CODE;
> +typedef UINT16 TPM_PROTOCOL_ID;
> +typedef BYTE TPM_AUTH_DATA_USAGE;
> +typedef UINT16 TPM_ENTITY_TYPE;
> +typedef UINT32 TPM_ALGORITHM_ID;
> +typedef UINT16 TPM_KEY_USAGE;
> +typedef UINT16 TPM_STARTUP_TYPE;
> +typedef UINT32 TPM_CAPABILITY_AREA;
> +typedef UINT16 TPM_ENC_SCHEME;
> +typedef UINT16 TPM_SIG_SCHEME;
> +typedef UINT16 TPM_MIGRATE_SCHEME;
> +typedef UINT16 TPM_PHYSICAL_PRESENCE;
> +typedef UINT32 TPM_KEY_FLAGS;
> +
> +#define TPM_DIGEST_SIZE 20  // Don't change this
> +typedef BYTE TPM_AUTHDATA[TPM_DIGEST_SIZE];
> +typedef TPM_AUTHDATA TPM_SECRET;
> +typedef TPM_AUTHDATA TPM_ENCAUTH;
> +typedef BYTE TPM_PAYLOAD_TYPE;
> +typedef UINT16 TPM_TAG;
> +typedef UINT16 TPM_STRUCTURE_TAG;
> +
> +// Data Types of the TCS
> +typedef UINT32 TCS_AUTHHANDLE;  // Handle addressing a authorization s=
ession
> +typedef UINT32 TCS_CONTEXT_HANDLE; // Basic context handle
> +typedef UINT32 TCS_KEY_HANDLE;  // Basic key handle
> +
> +// ************************* STRUCTURES ******************************=
****
> +
> +typedef struct TPM_VERSION {
> +  BYTE major;
> +  BYTE minor;
> +  BYTE revMajor;
> +  BYTE revMinor;
> +} TPM_VERSION;
> +
> +static const TPM_VERSION TPM_STRUCT_VER_1_1 =3D { 1,1,0,0 };
> +
> +typedef struct TPM_CAP_VERSION_INFO {
> +   TPM_STRUCTURE_TAG tag;
> +   TPM_VERSION version;
> +   UINT16 specLevel;
> +   BYTE errataRev;
> +   BYTE tpmVendorID[4];
> +   UINT16 vendorSpecificSize;
> +   BYTE* vendorSpecific;
> +} TPM_CAP_VERSION_INFO;
> +
> +inline void free_TPM_CAP_VERSION_INFO(TPM_CAP_VERSION_INFO* v) {
> +   free(v->vendorSpecific);
> +   v->vendorSpecific =3D NULL;
> +}
> +
> +typedef struct TPM_DIGEST {
> +  BYTE digest[TPM_DIGEST_SIZE];
> +} TPM_DIGEST;
> +
> +typedef TPM_DIGEST TPM_PCRVALUE;
> +typedef TPM_DIGEST TPM_COMPOSITE_HASH;
> +typedef TPM_DIGEST TPM_DIRVALUE;
> +typedef TPM_DIGEST TPM_HMAC;
> +typedef TPM_DIGEST TPM_CHOSENID_HASH;
> +
> +typedef struct TPM_NONCE {
> +  BYTE nonce[TPM_DIGEST_SIZE];
> +} TPM_NONCE;
> +
> +typedef struct TPM_SYMMETRIC_KEY_PARMS {
> +   UINT32 keyLength;
> +   UINT32 blockSize;
> +   UINT32 ivSize;
> +   BYTE* IV;
> +} TPM_SYMMETRIC_KEY_PARMS;
> +
> +inline void free_TPM_SYMMETRIC_KEY_PARMS(TPM_SYMMETRIC_KEY_PARMS* p) {=

> +   free(p->IV);
> +   p->IV =3D NULL;
> +}
> +
> +#define TPM_SYMMETRIC_KEY_PARMS_INIT { 0, 0, 0, NULL }
> +
> +typedef struct TPM_RSA_KEY_PARMS {
> +  UINT32 keyLength;
> +  UINT32 numPrimes;
> +  UINT32 exponentSize;
> +  BYTE* exponent;
> +} TPM_RSA_KEY_PARMS;
> +
> +#define TPM_RSA_KEY_PARMS_INIT { 0, 0, 0, NULL }
> +
> +inline void free_TPM_RSA_KEY_PARMS(TPM_RSA_KEY_PARMS* p) {
> +   free(p->exponent);
> +   p->exponent =3D NULL;
> +}
> +
> +typedef struct TPM_KEY_PARMS {
> +  TPM_ALGORITHM_ID algorithmID;
> +  TPM_ENC_SCHEME encScheme;
> +  TPM_SIG_SCHEME sigScheme;
> +  UINT32 parmSize;
> +  union {
> +     TPM_SYMMETRIC_KEY_PARMS sym;
> +     TPM_RSA_KEY_PARMS rsa;
> +  } parms;
> +} TPM_KEY_PARMS;
> +
> +#define TPM_KEY_PARMS_INIT { 0, 0, 0, 0 }
> +
> +inline void free_TPM_KEY_PARMS(TPM_KEY_PARMS* p) {
> +   if(p->parmSize) {
> +      switch(p->algorithmID) {
> +         case TPM_ALG_RSA:
> +            free_TPM_RSA_KEY_PARMS(&p->parms.rsa);
> +            break;
> +         case TPM_ALG_AES128:
> +         case TPM_ALG_AES192:
> +         case TPM_ALG_AES256:
> +            free_TPM_SYMMETRIC_KEY_PARMS(&p->parms.sym);
> +            break;
> +      }
> +   }
> +}
> +
> +typedef struct TPM_STORE_PUBKEY {
> +  UINT32 keyLength;
> +  BYTE* key;
> +} TPM_STORE_PUBKEY;
> +
> +#define TPM_STORE_PUBKEY_INIT { 0, NULL }
> +
> +inline void free_TPM_STORE_PUBKEY(TPM_STORE_PUBKEY* p) {
> +   free(p->key);
> +   p->key =3D NULL;
> +}
> +
> +typedef struct TPM_PUBKEY {
> +  TPM_KEY_PARMS algorithmParms;
> +  TPM_STORE_PUBKEY pubKey;
> +} TPM_PUBKEY;
> +
> +#define TPM_PUBKEY_INIT { TPM_KEY_PARMS_INIT, TPM_STORE_PUBKEY_INIT }
> +
> +inline void free_TPM_PUBKEY(TPM_PUBKEY* k) {
> +   free_TPM_KEY_PARMS(&k->algorithmParms);
> +   free_TPM_STORE_PUBKEY(&k->pubKey);
> +}
> +
> +typedef struct TPM_PCR_SELECTION {
> +   UINT16 sizeOfSelect;
> +   BYTE* pcrSelect;
> +} TPM_PCR_SELECTION;
> +
> +#define TPM_PCR_SELECTION_INIT { 0, NULL }
> +
> +inline void free_TPM_PCR_SELECTION(TPM_PCR_SELECTION* p) {
> +   free(p->pcrSelect);
> +   p->pcrSelect =3D NULL;
> +}
> +
> +typedef struct TPM_PCR_INFO {
> +   TPM_PCR_SELECTION pcrSelection;
> +   TPM_COMPOSITE_HASH digestAtRelease;
> +   TPM_COMPOSITE_HASH digestAtCreation;
> +} TPM_PCR_INFO;
> +
> +#define TPM_PCR_INFO_INIT { TPM_PCR_SELECTION_INIT }
> +
> +inline void free_TPM_PCR_INFO(TPM_PCR_INFO* p) {
> +   free_TPM_PCR_SELECTION(&p->pcrSelection);
> +}
> +
> +typedef struct TPM_PCR_COMPOSITE {
> +  TPM_PCR_SELECTION select;
> +  UINT32 valueSize;
> +  TPM_PCRVALUE* pcrValue;
> +} TPM_PCR_COMPOSITE;
> +
> +#define TPM_PCR_COMPOSITE_INIT { TPM_PCR_SELECTION_INIT, 0, NULL }
> +
> +inline void free_TPM_PCR_COMPOSITE(TPM_PCR_COMPOSITE* p) {
> +   free_TPM_PCR_SELECTION(&p->select);
> +   free(p->pcrValue);
> +   p->pcrValue =3D NULL;
> +}
> +
> +typedef struct TPM_KEY {
> +  TPM_VERSION         ver;
> +  TPM_KEY_USAGE       keyUsage;
> +  TPM_KEY_FLAGS       keyFlags;
> +  TPM_AUTH_DATA_USAGE authDataUsage;
> +  TPM_KEY_PARMS       algorithmParms;
> +  UINT32              PCRInfoSize;
> +  TPM_PCR_INFO        PCRInfo;
> +  TPM_STORE_PUBKEY    pubKey;
> +  UINT32              encDataSize;
> +  BYTE*               encData;
> +} TPM_KEY;
> +
> +#define TPM_KEY_INIT { .algorithmParms =3D TPM_KEY_PARMS_INIT,\
> +   .PCRInfoSize =3D 0, .PCRInfo =3D TPM_PCR_INFO_INIT, \
> +   .pubKey =3D TPM_STORE_PUBKEY_INIT, \
> +   .encDataSize =3D 0, .encData =3D NULL }
> +
> +inline void free_TPM_KEY(TPM_KEY* k) {
> +   if(k->PCRInfoSize) {
> +      free_TPM_PCR_INFO(&k->PCRInfo);
> +   }
> +   free_TPM_STORE_PUBKEY(&k->pubKey);
> +   free(k->encData);
> +   k->encData =3D NULL;
> +}
> +
> +typedef struct TPM_BOUND_DATA {
> +  TPM_VERSION ver;
> +  TPM_PAYLOAD_TYPE payload;
> +  BYTE* payloadData;
> +} TPM_BOUND_DATA;
> +
> +#define TPM_BOUND_DATA_INIT { .payloadData =3D NULL }
> +
> +inline void free_TPM_BOUND_DATA(TPM_BOUND_DATA* d) {
> +   free(d->payloadData);
> +   d->payloadData =3D NULL;
> +}
> +
> +typedef struct TPM_STORED_DATA {
> +  TPM_VERSION ver;
> +  UINT32 sealInfoSize;
> +  TPM_PCR_INFO sealInfo;
> +  UINT32 encDataSize;
> +  BYTE* encData;
> +} TPM_STORED_DATA;
> +
> +#define TPM_STORED_DATA_INIT { .sealInfoSize =3D 0, sealInfo =3D TPM_P=
CR_INFO_INIT,\
> +   .encDataSize =3D 0, .encData =3D NULL }
> +
> +inline void free_TPM_STORED_DATA(TPM_STORED_DATA* d) {
> +   if(d->sealInfoSize) {
> +      free_TPM_PCR_INFO(&d->sealInfo);
> +   }
> +   free(d->encData);
> +   d->encData =3D NULL;
> +}
> +
> +typedef struct TPM_AUTH_SESSION {
> +  TPM_AUTHHANDLE  AuthHandle;
> +  TPM_NONCE   NonceOdd;   // system
> +  TPM_NONCE   NonceEven;   // TPM
> +  BOOL   fContinueAuthSession;
> +  TPM_AUTHDATA  HMAC;
> +} TPM_AUTH_SESSION;
> +
> +#define TPM_AUTH_SESSION_INIT { .AuthHandle =3D 0, .fContinueAuthSessi=
on =3D FALSE }
> +
> +// ---------------------- Functions for checking TPM_RESULTs ---------=
--------
> +
> +#include <stdio.h>
> +
> +// FIXME: Review use of these and delete unneeded ones.
> +
> +// these are really badly dependent on local structure:
> +// DEPENDS: local var 'status' of type TPM_RESULT
> +// DEPENDS: label 'abort_egress' which cleans up and returns the statu=
s
> +#define ERRORDIE(s) do { status =3D s; \
> +                         fprintf (stderr, "*** ERRORDIE in %s at %s: %=
i\n", __func__, __FILE__, __LINE__); \
> +                         goto abort_egress; } \
> +                    while (0)
> +
> +// DEPENDS: local var 'status' of type TPM_RESULT
> +// DEPENDS: label 'abort_egress' which cleans up and returns the statu=
s
> +// Try command c. If it fails, set status to s and goto abort.
> +#define TPMTRY(s,c) if (c !=3D TPM_SUCCESS) { \
> +                       status =3D s; \
> +                       printf("ERROR in %s at %s:%i code: %s.\n", __fu=
nc__, __FILE__, __LINE__, tpm_get_error_name(status)); \
> +                       goto abort_egress; \
> +                    } else {\
> +                       status =3D c; \
> +                    }
> +
> +// Try command c. If it fails, print error message, set status to actu=
al return code. Goto abort
> +#define TPMTRYRETURN(c) do { status =3D c; \
> +                             if (status !=3D TPM_SUCCESS) { \
> +                               fprintf(stderr, "ERROR in %s at %s:%i c=
ode: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \=

> +                               goto abort_egress; \
> +                             } \
> +                        } while(0)
> +
> +
> +#endif //__TCPA_H__
> diff --git a/stubdom/vtpmmgr/tpm.c b/stubdom/vtpmmgr/tpm.c
> new file mode 100644
> index 0000000..123a27c
> --- /dev/null
> +++ b/stubdom/vtpmmgr/tpm.c
> @@ -0,0 +1,938 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#include <stdio.h>
> +#include <string.h>
> +#include <malloc.h>
> +#include <unistd.h>
> +#include <errno.h>
> +
> +#include <polarssl/sha1.h>
> +
> +#include "tcg.h"
> +#include "tpm.h"
> +#include "log.h"
> +#include "marshal.h"
> +#include "tpmrsa.h"
> +#include "vtpmmgr.h"
> +
> +#define TCPA_MAX_BUFFER_LENGTH 0x2000
> +
> +#define TPM_BEGIN(TAG, ORD) \
> +   const TPM_TAG intag =3D TAG;\
> +TPM_TAG tag =3D intag;\
> +UINT32 paramSize;\
> +const TPM_COMMAND_CODE ordinal =3D ORD;\
> +TPM_RESULT status =3D TPM_SUCCESS;\
> +BYTE in_buf[TCPA_MAX_BUFFER_LENGTH];\
> +BYTE out_buf[TCPA_MAX_BUFFER_LENGTH];\
> +UINT32 out_len =3D sizeof(out_buf);\
> +BYTE* ptr =3D in_buf;\
> +/*Print a log message */\
> +vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);\
> +/* Pack the header*/\
> +ptr =3D pack_TPM_TAG(ptr, tag);\
> +ptr +=3D sizeof(UINT32);\
> +ptr =3D pack_TPM_COMMAND_CODE(ptr, ordinal)\
> +
> +#define TPM_AUTH_BEGIN() \
> +   sha1_context sha1_ctx;\
> +BYTE* authbase =3D ptr - sizeof(TPM_COMMAND_CODE);\
> +TPM_DIGEST paramDigest;\
> +sha1_starts(&sha1_ctx)
> +
> +#define TPM_AUTH1_GEN(HMACkey, auth) do {\
> +   sha1_finish(&sha1_ctx, paramDigest.digest);\
> +   generateAuth(&paramDigest, HMACkey, auth);\
> +   ptr =3D pack_TPM_AUTH_SESSION(ptr, auth);\
> +} while(0)
> +
> +#define TPM_AUTH2_GEN(HMACkey, auth) do {\
> +   generateAuth(&paramDigest, HMACkey, auth);\
> +   ptr =3D pack_TPM_AUTH_SESSION(ptr, auth);\
> +} while(0)
> +
> +#define TPM_TRANSMIT() do {\
> +   /* Pack the command size */\
> +   paramSize =3D ptr - in_buf;\
> +   pack_UINT32(in_buf + sizeof(TPM_TAG), paramSize);\
> +   if((status =3D TPM_TransmitData(in_buf, paramSize, out_buf, &out_le=
n)) !=3D TPM_SUCCESS) {\
> +      goto abort_egress;\
> +   }\
> +} while(0)
> +
> +#define TPM_AUTH_VERIFY_BEGIN() do {\
> +   UINT32 buf[2] =3D { cpu_to_be32(status), cpu_to_be32(ordinal) };\
> +   sha1_starts(&sha1_ctx);\
> +   sha1_update(&sha1_ctx, (unsigned char*)buf, sizeof(buf));\
> +   authbase =3D ptr;\
> +} while(0)
> +
> +#define TPM_AUTH1_VERIFY(HMACkey, auth) do {\
> +   sha1_finish(&sha1_ctx, paramDigest.digest);\
> +   ptr =3D unpack_TPM_AUTH_SESSION(ptr, auth);\
> +   if((status =3D verifyAuth(&paramDigest, HMACkey, auth)) !=3D TPM_SU=
CCESS) {\
> +      goto abort_egress;\
> +   }\
> +} while(0)
> +
> +#define TPM_AUTH2_VERIFY(HMACkey, auth) do {\
> +   ptr =3D unpack_TPM_AUTH_SESSION(ptr, auth);\
> +   if((status =3D verifyAuth(&paramDigest, HMACkey, auth)) !=3D TPM_SU=
CCESS) {\
> +      goto abort_egress;\
> +   }\
> +} while(0)
> +
> +
> +
> +#define TPM_UNPACK_VERIFY() do { \
> +   ptr =3D out_buf;\
> +   ptr =3D unpack_TPM_RSP_HEADER(ptr, \
> +         &(tag), &(paramSize), &(status));\
> +   if((status) !=3D TPM_SUCCESS || (tag) !=3D (intag +3)) { \
> +      vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s\n", tpm_g=
et_error_name(status));\
> +      goto abort_egress;\
> +   }\
> +} while(0)
> +
> +#define TPM_AUTH_HASH() do {\
> +   sha1_update(&sha1_ctx, authbase, ptr - authbase);\
> +   authbase =3D ptr;\
> +} while(0)
> +
> +#define TPM_AUTH_SKIP() do {\
> +   authbase =3D ptr;\
> +} while(0)
> +
> +#define TPM_AUTH_ERR_CHECK(auth) do {\
> +   if(status !=3D TPM_SUCCESS || auth->fContinueAuthSession =3D=3D FAL=
SE) {\
> +      vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM\n", =
auth->AuthHandle);\
> +      auth->AuthHandle =3D 0;\
> +   }\
> +} while(0)
> +
> +static void xorEncrypt(const TPM_SECRET* sharedSecret,
> +      TPM_NONCE* nonce,
> +      const TPM_AUTHDATA* inAuth0,
> +      TPM_ENCAUTH outAuth0,
> +      const TPM_AUTHDATA* inAuth1,
> +      TPM_ENCAUTH outAuth1) {
> +   BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
> +   BYTE XORkey[TPM_DIGEST_SIZE];
> +   BYTE* ptr =3D XORbuffer;
> +   ptr =3D pack_TPM_SECRET(ptr, sharedSecret);
> +   ptr =3D pack_TPM_NONCE(ptr, nonce);
> +
> +   sha1(XORbuffer, ptr - XORbuffer, XORkey);
> +
> +   if(inAuth0) {
> +      for(int i =3D 0; i < TPM_DIGEST_SIZE; ++i) {
> +         outAuth0[i] =3D XORkey[i] ^ (*inAuth0)[i];
> +      }
> +   }
> +   if(inAuth1) {
> +      for(int i =3D 0; i < TPM_DIGEST_SIZE; ++i) {
> +         outAuth1[i] =3D XORkey[i] ^ (*inAuth1)[i];
> +      }
> +   }
> +
> +}
> +
> +static void generateAuth(const TPM_DIGEST* paramDigest,
> +      const TPM_SECRET* HMACkey,
> +      TPM_AUTH_SESSION *auth)
> +{
> +   //Generate new OddNonce
> +   vtpmmgr_rand((BYTE*)auth->NonceOdd.nonce, sizeof(TPM_NONCE));
> +
> +   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams)=
=2E
> +   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof=
(BOOL)];
> +   BYTE* ptr =3D hmacText;
> +
> +   ptr =3D pack_TPM_DIGEST(ptr, paramDigest);
> +   ptr =3D pack_TPM_NONCE(ptr, &auth->NonceEven);
> +   ptr =3D pack_TPM_NONCE(ptr, &auth->NonceOdd);
> +   ptr =3D pack_BOOL(ptr, auth->fContinueAuthSession);
> +
> +   sha1_hmac((BYTE *) HMACkey, sizeof(TPM_DIGEST),
> +         (BYTE *) hmacText, sizeof(hmacText),
> +         auth->HMAC);
> +}
> +
> +static TPM_RESULT verifyAuth(const TPM_DIGEST* paramDigest,
> +      /*[IN]*/ const TPM_SECRET *HMACkey,
> +      /*[IN,OUT]*/ TPM_AUTH_SESSION *auth)
> +{
> +
> +   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams)=
=2E
> +   TPM_AUTHDATA hm;
> +   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof=
(BOOL)];
> +   BYTE* ptr =3D hmacText;
> +
> +   ptr =3D pack_TPM_DIGEST(ptr, paramDigest);
> +   ptr =3D pack_TPM_NONCE(ptr, &auth->NonceEven);
> +   ptr =3D pack_TPM_NONCE(ptr, &auth->NonceOdd);
> +   ptr =3D pack_BOOL(ptr, auth->fContinueAuthSession);
> +
> +   sha1_hmac( (BYTE *) HMACkey, sizeof(TPM_DIGEST),
> +         (BYTE *) hmacText, sizeof(hmacText),
> +         hm);
> +
> +   // Compare correct HMAC with provided one.
> +   if (memcmp(hm, auth->HMAC, sizeof(TPM_DIGEST)) =3D=3D 0) { // 0 ind=
icates equality
> +      return TPM_SUCCESS;
> +   } else {
> +      vtpmlogerror(VTPM_LOG_TPM, "Auth Session verification failed!\n"=
);
> +      return TPM_AUTHFAIL;
> +   }
> +}
> +
> +
> +
> +// ------------------------------------------------------------------
> +// Authorization Commands
> +// ------------------------------------------------------------------
> +
> +TPM_RESULT TPM_OIAP(TPM_AUTH_SESSION*   auth)  // out
> +{
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OIAP);
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
> +   auth->fContinueAuthSession =3D TRUE;
> +
> +   ptr =3D unpack_UINT32(ptr, &auth->AuthHandle);
> +   ptr =3D unpack_TPM_NONCE(ptr, &auth->NonceEven);
> +
> +   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OIAP.\n=
", auth->AuthHandle);
> +
> +abort_egress:
> +   return status;
> +}
> +
> +TPM_RESULT TPM_OSAP(TPM_ENTITY_TYPE  entityType,  // in
> +      UINT32    entityValue, // in
> +      const TPM_AUTHDATA* usageAuth, //in
> +      TPM_SECRET *sharedSecret, //out
> +      TPM_AUTH_SESSION *auth)
> +{
> +   BYTE* nonceOddOSAP;
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OSAP);
> +
> +   ptr =3D pack_TPM_ENTITY_TYPE(ptr, entityType);
> +   ptr =3D pack_UINT32(ptr, entityValue);
> +
> +   //nonce Odd OSAP
> +   nonceOddOSAP =3D ptr;
> +   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
> +   ptr +=3D TPM_DIGEST_SIZE;
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +   ptr =3D unpack_UINT32(ptr, &auth->AuthHandle);
> +   ptr =3D unpack_TPM_NONCE(ptr, &auth->NonceEven);
> +
> +   //Calculate session secret
> +   sha1_context ctx;
> +   sha1_hmac_starts(&ctx, *usageAuth, TPM_DIGEST_SIZE);
> +   sha1_hmac_update(&ctx, ptr, TPM_DIGEST_SIZE); //ptr =3D nonceEvenOS=
AP
> +   sha1_hmac_update(&ctx, nonceOddOSAP, TPM_DIGEST_SIZE);
> +   sha1_hmac_finish(&ctx, *sharedSecret);
> +
> +   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
> +   auth->fContinueAuthSession =3D FALSE;
> +
> +   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OSAP.\n=
", auth->AuthHandle);
> +
> +abort_egress:
> +   return status;
> +}
> +
> +TPM_RESULT TPM_TakeOwnership(
> +      const TPM_PUBKEY *pubEK, //in
> +      const TPM_AUTHDATA* ownerAuth, //in
> +      const TPM_AUTHDATA* srkAuth, //in
> +      const TPM_KEY* inSrk, //in
> +      TPM_KEY* outSrk, //out, optional
> +      TPM_AUTH_SESSION*   auth)   // in, out
> +{
> +   int keyAlloced =3D 0;
> +   tpmrsa_context ek_rsa =3D TPMRSA_CTX_INIT;
> +
> +   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_TakeOwnership);
> +   TPM_AUTH_BEGIN();
> +
> +   tpmrsa_set_pubkey(&ek_rsa,
> +         pubEK->pubKey.key, pubEK->pubKey.keyLength,
> +         pubEK->algorithmParms.parms.rsa.exponent,
> +         pubEK->algorithmParms.parms.rsa.exponentSize);
> +
> +   /* Pack the protocol ID */
> +   ptr =3D pack_UINT16(ptr, TPM_PID_OWNER);
> +
> +   /* Pack the encrypted owner auth */
> +   ptr =3D pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength =
/ 8);
> +   tpmrsa_pub_encrypt_oaep(&ek_rsa,
> +         ctr_drbg_random, &vtpm_globals.ctr_drbg,
> +         sizeof(TPM_SECRET),
> +         (BYTE*) ownerAuth,
> +         ptr);
> +   ptr +=3D pubEK->algorithmParms.parms.rsa.keyLength / 8;
> +
> +   /* Pack the encrypted srk auth */
> +   ptr =3D pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength =
/ 8);
> +   tpmrsa_pub_encrypt_oaep(&ek_rsa,
> +         ctr_drbg_random, &vtpm_globals.ctr_drbg,
> +         sizeof(TPM_SECRET),
> +         (BYTE*) srkAuth,
> +         ptr);
> +   ptr +=3D pubEK->algorithmParms.parms.rsa.keyLength / 8;
> +
> +   /* Pack the Srk key */
> +   ptr =3D pack_TPM_KEY(ptr, inSrk);
> +
> +   /* Hash everything up to here */
> +   TPM_AUTH_HASH();
> +
> +   /* Generate the authorization */
> +   TPM_AUTH1_GEN(ownerAuth, auth);
> +
> +   /* Send the command to the tpm*/
> +   TPM_TRANSMIT();
> +   /* Unpack and validate the header */
> +   TPM_UNPACK_VERIFY();
> +   TPM_AUTH_VERIFY_BEGIN();
> +
> +   if(outSrk !=3D NULL) {
> +      /* If the user wants a copy of the srk we give it to them */
> +      keyAlloced =3D 1;
> +      ptr =3D unpack_TPM_KEY(ptr, outSrk, UNPACK_ALLOC);
> +   } else {
> +      /*otherwise just parse past it */
> +      TPM_KEY temp;
> +      ptr =3D unpack_TPM_KEY(ptr, &temp, UNPACK_ALIAS);
> +   }
> +
> +   /* Hash the output key */
> +   TPM_AUTH_HASH();
> +
> +   /* Verify authorizaton */
> +   TPM_AUTH1_VERIFY(ownerAuth, auth);
> +
> +   goto egress;
> +abort_egress:
> +   if(keyAlloced) {
> +      free_TPM_KEY(outSrk);
> +   }
> +egress:
> +   tpmrsa_free(&ek_rsa);
> +   TPM_AUTH_ERR_CHECK(auth);
> +   return status;
> +}
> +
> +
> +TPM_RESULT TPM_DisablePubekRead (
> +      const TPM_AUTHDATA* ownerAuth,
> +      TPM_AUTH_SESSION*   auth)
> +{
> +   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_DisablePubekRead);
> +   TPM_AUTH_BEGIN();
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_GEN(ownerAuth, auth);
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +   TPM_AUTH_VERIFY_BEGIN();
> +
> +   TPM_AUTH1_VERIFY(ownerAuth, auth);
> +
> +abort_egress:
> +   TPM_AUTH_ERR_CHECK(auth);
> +   return status;
> +}
> +
> +
> +TPM_RESULT TPM_TerminateHandle(TPM_AUTHHANDLE  handle)  // in
> +{
> +   if(handle =3D=3D 0) {
> +      return TPM_SUCCESS;
> +   }
> +
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Terminate_Handle);
> +
> +   ptr =3D pack_TPM_AUTHHANDLE(ptr, handle);
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM_Termina=
teHandle\n", handle);
> +
> +abort_egress:
> +   return status;
> +}
> +
> +TPM_RESULT TPM_Extend( TPM_PCRINDEX  pcrNum,  // in
> +      TPM_DIGEST  inDigest, // in
> +      TPM_PCRVALUE*  outDigest) // out
> +{
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Extend);
> +
> +   ptr =3D pack_TPM_PCRINDEX(ptr, pcrNum);
> +   ptr =3D pack_TPM_DIGEST(ptr, &inDigest);
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +   ptr =3D unpack_TPM_PCRVALUE(ptr, outDigest);
> +
> +abort_egress:
> +   return status;
> +}
> +
> +TPM_RESULT TPM_Seal(
> +      TPM_KEY_HANDLE  keyHandle,  // in
> +      UINT32    pcrInfoSize, // in
> +      TPM_PCR_INFO*    pcrInfo,  // in
> +      UINT32    inDataSize,  // in
> +      const BYTE*    inData,   // in
> +      TPM_STORED_DATA* sealedData, //out
> +      const TPM_SECRET* osapSharedSecret, //in
> +      const TPM_AUTHDATA* sealedDataAuth, //in
> +      TPM_AUTH_SESSION*   pubAuth  // in, out
> +      )
> +{
> +   int dataAlloced =3D 0;
> +   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_Seal);
> +   TPM_AUTH_BEGIN();
> +
> +   TPM_AUTH_HASH();
> +
> +   ptr =3D pack_TPM_KEY_HANDLE(ptr, keyHandle);
> +
> +   TPM_AUTH_SKIP();
> +
> +   xorEncrypt(osapSharedSecret, &pubAuth->NonceEven,
> +         sealedDataAuth, ptr,
> +         NULL, NULL);
> +   ptr +=3D sizeof(TPM_ENCAUTH);
> +
> +   ptr =3D pack_UINT32(ptr, pcrInfoSize);
> +   ptr =3D pack_TPM_PCR_INFO(ptr, pcrInfo);
> +
> +   ptr =3D pack_UINT32(ptr, inDataSize);
> +   ptr =3D pack_BUFFER(ptr, inData, inDataSize);
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_GEN(osapSharedSecret, pubAuth);
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +   TPM_AUTH_VERIFY_BEGIN();
> +
> +   ptr =3D unpack_TPM_STORED_DATA(ptr, sealedData, UNPACK_ALLOC);
> +   dataAlloced =3D 1;
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_VERIFY(osapSharedSecret, pubAuth);
> +
> +   goto egress;
> +abort_egress:
> +   if(dataAlloced) {
> +      free_TPM_STORED_DATA(sealedData);
> +   }
> +egress:
> +   TPM_AUTH_ERR_CHECK(pubAuth);
> +   return status;
> +}
> +
> +TPM_RESULT TPM_Unseal(
> +      TPM_KEY_HANDLE parentHandle, // in
> +      const TPM_STORED_DATA* sealedData,
> +      UINT32*   outSize,  // out
> +      BYTE**    out, //out
> +      const TPM_AUTHDATA* key_usage_auth, //in
> +      const TPM_AUTHDATA* data_usage_auth, //in
> +      TPM_AUTH_SESSION*   keyAuth,  // in, out
> +      TPM_AUTH_SESSION*   dataAuth  // in, out
> +      )
> +{
> +   TPM_BEGIN(TPM_TAG_RQU_AUTH2_COMMAND, TPM_ORD_Unseal);
> +   TPM_AUTH_BEGIN();
> +
> +   TPM_AUTH_HASH();
> +
> +   ptr =3D pack_TPM_KEY_HANDLE(ptr, parentHandle);
> +
> +   TPM_AUTH_SKIP();
> +
> +   ptr =3D pack_TPM_STORED_DATA(ptr, sealedData);
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_GEN(key_usage_auth, keyAuth);
> +   TPM_AUTH2_GEN(data_usage_auth, dataAuth);
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +   TPM_AUTH_VERIFY_BEGIN();
> +
> +   ptr =3D unpack_UINT32(ptr, outSize);
> +   ptr =3D unpack_ALLOC(ptr, out, *outSize);
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_VERIFY(key_usage_auth, keyAuth);
> +   TPM_AUTH2_VERIFY(data_usage_auth, dataAuth);
> +
> +abort_egress:
> +   TPM_AUTH_ERR_CHECK(keyAuth);
> +   TPM_AUTH_ERR_CHECK(dataAuth);
> +   return status;
> +}
> +
> +TPM_RESULT TPM_Bind(
> +      const TPM_KEY* key,
> +      const BYTE* in,
> +      UINT32 ilen,
> +      BYTE* out)
> +{
> +   TPM_RESULT status;
> +   tpmrsa_context rsa =3D TPMRSA_CTX_INIT;
> +   TPM_BOUND_DATA boundData;
> +   uint8_t plain[TCPA_MAX_BUFFER_LENGTH];
> +   BYTE* ptr =3D plain;
> +
> +   vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);
> +
> +   tpmrsa_set_pubkey(&rsa,
> +         key->pubKey.key, key->pubKey.keyLength,
> +         key->algorithmParms.parms.rsa.exponent,
> +         key->algorithmParms.parms.rsa.exponentSize);
> +
> +   // Fill boundData's accessory information
> +   boundData.ver =3D TPM_STRUCT_VER_1_1;
> +   boundData.payload =3D TPM_PT_BIND;
> +   boundData.payloadData =3D (BYTE*)in;
> +
> +   //marshall the bound data object
> +   ptr =3D pack_TPM_BOUND_DATA(ptr, &boundData, ilen);
> +
> +   // Encrypt the data
> +   TPMTRYRETURN(tpmrsa_pub_encrypt_oaep(&rsa,
> +            ctr_drbg_random, &vtpm_globals.ctr_drbg,
> +            ptr - plain,
> +            plain,
> +            out));
> +
> +abort_egress:
> +   tpmrsa_free(&rsa);
> +   return status;
> +
> +}
> +
> +TPM_RESULT TPM_UnBind(
> +      TPM_KEY_HANDLE  keyHandle,  // in
> +      UINT32 ilen, //in
> +      const BYTE* in, //
> +      UINT32* olen, //
> +      BYTE*    out, //out
> +      const TPM_AUTHDATA* usage_auth,
> +      TPM_AUTH_SESSION* auth //in, out
> +      )
> +{
> +   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_UnBind);
> +   TPM_AUTH_BEGIN();
> +
> +   TPM_AUTH_HASH();
> +
> +   ptr =3D pack_TPM_KEY_HANDLE(ptr, keyHandle);
> +
> +   TPM_AUTH_SKIP();
> +
> +   ptr =3D pack_UINT32(ptr, ilen);
> +   ptr =3D pack_BUFFER(ptr, in, ilen);
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_GEN(usage_auth, auth);
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +   TPM_AUTH_VERIFY_BEGIN();
> +
> +   ptr =3D unpack_UINT32(ptr, olen);
> +   if(*olen > ilen) {
> +      vtpmlogerror(VTPM_LOG_TPM, "Output length < input length!\n");
> +      status =3D TPM_IOERROR;
> +      goto abort_egress;
> +   }
> +   ptr =3D unpack_BUFFER(ptr, out, *olen);
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_VERIFY(usage_auth, auth);
> +
> +abort_egress:
> +egress:
> +   TPM_AUTH_ERR_CHECK(auth);
> +   return status;
> +}
> +
> +TPM_RESULT TPM_CreateWrapKey(
> +      TPM_KEY_HANDLE  hWrappingKey,  // in
> +      const TPM_AUTHDATA* osapSharedSecret,
> +      const TPM_AUTHDATA* dataUsageAuth, //in
> +      const TPM_AUTHDATA* dataMigrationAuth, //in
> +      TPM_KEY*     key, //in, out
> +      TPM_AUTH_SESSION*   pAuth)    // in, out
> +{
> +   int keyAlloced =3D 0;
> +   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_CreateWrapKey);
> +   TPM_AUTH_BEGIN();
> +
> +   TPM_AUTH_HASH();
> +
> +   ptr =3D pack_TPM_KEY_HANDLE(ptr, hWrappingKey);
> +
> +   TPM_AUTH_SKIP();
> +
> +   //Encrypted auths
> +   xorEncrypt(osapSharedSecret, &pAuth->NonceEven,
> +         dataUsageAuth, ptr,
> +         dataMigrationAuth, ptr + sizeof(TPM_ENCAUTH));
> +   ptr +=3D sizeof(TPM_ENCAUTH) * 2;
> +
> +   ptr =3D pack_TPM_KEY(ptr, key);
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_GEN(osapSharedSecret, pAuth);
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +   TPM_AUTH_VERIFY_BEGIN();
> +
> +   keyAlloced =3D 1;
> +   ptr =3D unpack_TPM_KEY(ptr, key, UNPACK_ALLOC);
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_VERIFY(osapSharedSecret, pAuth);
> +
> +   goto egress;
> +abort_egress:
> +   if(keyAlloced) {
> +      free_TPM_KEY(key);
> +   }
> +egress:
> +   TPM_AUTH_ERR_CHECK(pAuth);
> +   return status;
> +}
> +
> +TPM_RESULT TPM_LoadKey(
> +      TPM_KEY_HANDLE  parentHandle, //
> +      const TPM_KEY* key, //in
> +      TPM_HANDLE*  keyHandle,    // out
> +      const TPM_AUTHDATA* usage_auth,
> +      TPM_AUTH_SESSION* auth)
> +{
> +   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_LoadKey);
> +   TPM_AUTH_BEGIN();
> +
> +   TPM_AUTH_HASH();
> +
> +   ptr =3D pack_TPM_KEY_HANDLE(ptr, parentHandle);
> +
> +   TPM_AUTH_SKIP();
> +
> +   ptr =3D pack_TPM_KEY(ptr, key);
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_GEN(usage_auth, auth);
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +   TPM_AUTH_VERIFY_BEGIN();
> +
> +   ptr =3D unpack_UINT32(ptr, keyHandle);
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_VERIFY(usage_auth, auth);
> +
> +   vtpmloginfo(VTPM_LOG_TPM, "Key Handle: 0x%x opened by TPM_LoadKey\n=
", *keyHandle);
> +
> +abort_egress:
> +   TPM_AUTH_ERR_CHECK(auth);
> +   return status;
> +}
> +
> +TPM_RESULT TPM_EvictKey( TPM_KEY_HANDLE  hKey)  // in
> +{
> +   if(hKey =3D=3D 0) {
> +      return TPM_SUCCESS;
> +   }
> +
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_EvictKey);
> +
> +   ptr =3D pack_TPM_KEY_HANDLE(ptr, hKey);
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +   vtpmloginfo(VTPM_LOG_TPM, "Key handle: 0x%x closed by TPM_EvictKey\=
n", hKey);
> +
> +abort_egress:
> +   return status;
> +}
> +
> +TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle,
> +      TPM_RESOURCE_TYPE rt) {
> +   if(handle =3D=3D 0) {
> +      return TPM_SUCCESS;
> +   }
> +
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_FlushSpecific);
> +
> +   ptr =3D pack_TPM_HANDLE(ptr, handle);
> +   ptr =3D pack_TPM_RESOURCE_TYPE(ptr, rt);
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +abort_egress:
> +   return status;
> +}
> +
> +TPM_RESULT TPM_GetRandom( UINT32*    bytesRequested, // in, out
> +      BYTE*    randomBytes) // out
> +{
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetRandom);
> +
> +   // check input params
> +   if (bytesRequested =3D=3D NULL || randomBytes =3D=3D NULL){
> +      return TPM_BAD_PARAMETER;
> +   }
> +
> +   ptr =3D pack_UINT32(ptr, *bytesRequested);
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +   ptr =3D unpack_UINT32(ptr, bytesRequested);
> +   ptr =3D unpack_BUFFER(ptr, randomBytes, *bytesRequested);
> +
> +abort_egress:
> +   return status;
> +}
> +
> +
> +TPM_RESULT TPM_ReadPubek(
> +      TPM_PUBKEY* pubEK //out
> +      )
> +{
> +   BYTE* antiReplay =3D NULL;
> +   BYTE* kptr =3D NULL;
> +   BYTE digest[TPM_DIGEST_SIZE];
> +   sha1_context ctx;
> +
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_ReadPubek);
> +
> +   //antiReplay nonce
> +   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
> +   antiReplay =3D ptr;
> +   ptr +=3D TPM_DIGEST_SIZE;
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +   //unpack and allocate the key
> +   kptr =3D ptr;
> +   ptr =3D unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
> +
> +   //Verify the checksum
> +   sha1_starts(&ctx);
> +   sha1_update(&ctx, kptr, ptr - kptr);
> +   sha1_update(&ctx, antiReplay, TPM_DIGEST_SIZE);
> +   sha1_finish(&ctx, digest);
> +
> +   //ptr points to the checksum computed by TPM
> +   if(memcmp(digest, ptr, TPM_DIGEST_SIZE)) {
> +      vtpmlogerror(VTPM_LOG_TPM, "TPM_ReadPubek: Checksum returned by =
TPM was invalid!\n");
> +      status =3D TPM_FAIL;
> +      goto abort_egress;
> +   }
> +
> +   goto egress;
> +abort_egress:
> +   if(kptr !=3D NULL) { //If we unpacked the pubEK, we have to free it=

> +      free_TPM_PUBKEY(pubEK);
> +   }
> +egress:
> +   return status;
> +}
> +
> +
> +TPM_RESULT TPM_SaveState(void)
> +{
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_SaveState);
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +abort_egress:
> +   return status;
> +}
> +
> +TPM_RESULT TPM_GetCapability(
> +      TPM_CAPABILITY_AREA capArea,
> +      UINT32 subCapSize,
> +      const BYTE* subCap,
> +      UINT32* respSize,
> +      BYTE** resp)
> +{
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetCapability);
> +
> +   ptr =3D pack_TPM_CAPABILITY_AREA(ptr, capArea);
> +   ptr =3D pack_UINT32(ptr, subCapSize);
> +   ptr =3D pack_BUFFER(ptr, subCap, subCapSize);
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +   ptr =3D unpack_UINT32(ptr, respSize);
> +   ptr =3D unpack_ALLOC(ptr, resp, *respSize);
> +
> +abort_egress:
> +   return status;
> +}
> +
> +TPM_RESULT TPM_CreateEndorsementKeyPair(
> +      const TPM_KEY_PARMS* keyInfo,
> +      TPM_PUBKEY* pubEK)
> +{
> +   BYTE* kptr =3D NULL;
> +   sha1_context ctx;
> +   TPM_DIGEST checksum;
> +   TPM_DIGEST hash;
> +   TPM_NONCE antiReplay;
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_CreateEndorsementKeyPair);
> +
> +   //Make anti replay nonce
> +   vtpmmgr_rand(antiReplay.nonce, sizeof(antiReplay.nonce));
> +
> +   ptr =3D pack_TPM_NONCE(ptr, &antiReplay);
> +   ptr =3D pack_TPM_KEY_PARMS(ptr, keyInfo);
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +   sha1_starts(&ctx);
> +
> +   kptr =3D ptr;
> +   ptr =3D unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
> +
> +   /* Hash the pub key blob */
> +   sha1_update(&ctx, kptr, ptr - kptr);
> +   ptr =3D unpack_TPM_DIGEST(ptr, &checksum);
> +
> +   sha1_update(&ctx, antiReplay.nonce, sizeof(antiReplay.nonce));
> +
> +   sha1_finish(&ctx, hash.digest);
> +   if(memcmp(checksum.digest, hash.digest, TPM_DIGEST_SIZE)) {
> +      vtpmloginfo(VTPM_LOG_VTPM, "TPM_CreateEndorsementKey: Checkum ve=
rification failed!\n");
> +      status =3D TPM_FAIL;
> +      goto abort_egress;
> +   }
> +
> +   goto egress;
> +abort_egress:
> +   if(kptr) {
> +      free_TPM_PUBKEY(pubEK);
> +   }
> +egress:
> +   return status;
> +}
> +
> +TPM_RESULT TPM_TransmitData(
> +      BYTE* in,
> +      UINT32 insize,
> +      BYTE* out,
> +      UINT32* outsize) {
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +
> +   UINT32 i;
> +   vtpmloginfo(VTPM_LOG_TXDATA, "Sending buffer =3D 0x");
> +   for(i =3D 0 ; i < insize ; i++)
> +      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", in[i]);
> +
> +   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> +
> +   ssize_t size =3D 0;
> +
> +   // send the request
> +   size =3D write (vtpm_globals.tpm_fd, in, insize);
> +   if (size < 0) {
> +      vtpmlogerror(VTPM_LOG_TXDATA, "write() failed : %s\n", strerror(=
errno));
> +      ERRORDIE (TPM_IOERROR);
> +   }
> +   else if ((UINT32) size < insize) {
> +      vtpmlogerror(VTPM_LOG_TXDATA, "Wrote %d instead of %d bytes!\n",=
 (int) size, insize);
> +      ERRORDIE (TPM_IOERROR);
> +   }
> +
> +   // read the response
> +   size =3D read (vtpm_globals.tpm_fd, out, *outsize);
> +   if (size < 0) {
> +      vtpmlogerror(VTPM_LOG_TXDATA, "read() failed : %s\n", strerror(e=
rrno));
> +      ERRORDIE (TPM_IOERROR);
> +   }
> +
> +   vtpmloginfo(VTPM_LOG_TXDATA, "Receiving buffer =3D 0x");
> +   for(i =3D 0 ; i < size ; i++)
> +      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out[i]);
> +
> +   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> +
> +   *outsize =3D size;
> +   goto egress;
> +
> +abort_egress:
> +egress:
> +   return status;
> +}
> diff --git a/stubdom/vtpmmgr/tpm.h b/stubdom/vtpmmgr/tpm.h
> new file mode 100644
> index 0000000..304e145
> --- /dev/null
> +++ b/stubdom/vtpmmgr/tpm.h
> @@ -0,0 +1,218 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005/2006, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#ifndef __TPM_H__
> +#define __TPM_H__
> +
> +#include "tcg.h"
> +
> +// ------------------------------------------------------------------
> +// Exposed API
> +// ------------------------------------------------------------------
> +
> +// TPM v1.1B Command Set
> +
> +// Authorzation
> +TPM_RESULT TPM_OIAP(
> +      TPM_AUTH_SESSION*   auth //out
> +      );
> +
> +TPM_RESULT TPM_OSAP (
> +      TPM_ENTITY_TYPE entityType,  // in
> +      UINT32    entityValue, // in
> +      const TPM_AUTHDATA* usageAuth, //in
> +      TPM_SECRET *sharedSecret, //out
> +      TPM_AUTH_SESSION *auth);
> +
> +TPM_RESULT TPM_TakeOwnership(
> +      const TPM_PUBKEY *pubEK, //in
> +      const TPM_AUTHDATA* ownerAuth, //in
> +      const TPM_AUTHDATA* srkAuth, //in
> +      const TPM_KEY* inSrk, //in
> +      TPM_KEY* outSrk, //out, optional
> +      TPM_AUTH_SESSION*   auth   // in, out
> +      );
> +
> +TPM_RESULT TPM_DisablePubekRead (
> +      const TPM_AUTHDATA* ownerAuth,
> +      TPM_AUTH_SESSION*   auth
> +      );
> +
> +TPM_RESULT TPM_TerminateHandle ( TPM_AUTHHANDLE  handle  // in
> +      );
> +
> +TPM_RESULT TPM_FlushSpecific ( TPM_HANDLE  handle,  // in
> +      TPM_RESOURCE_TYPE resourceType //in
> +      );
> +
> +// TPM Mandatory
> +TPM_RESULT TPM_Extend ( TPM_PCRINDEX  pcrNum,  // in
> +      TPM_DIGEST   inDigest, // in
> +      TPM_PCRVALUE*   outDigest // out
> +      );
> +
> +TPM_RESULT TPM_PcrRead ( TPM_PCRINDEX  pcrNum,  // in
> +      TPM_PCRVALUE*  outDigest // out
> +      );
> +
> +TPM_RESULT TPM_Quote ( TCS_KEY_HANDLE  keyHandle,  // in
> +      TPM_NONCE   antiReplay,  // in
> +      UINT32*    PcrDataSize, // in, out
> +      BYTE**    PcrData,  // in, out
> +      TPM_AUTH_SESSION*   privAuth,  // in, out
> +      UINT32*    sigSize,  // out
> +      BYTE**    sig    // out
> +      );
> +
> +TPM_RESULT TPM_Seal(
> +      TCS_KEY_HANDLE  keyHandle,  // in
> +      UINT32    pcrInfoSize, // in
> +      TPM_PCR_INFO*    pcrInfo,  // in
> +      UINT32    inDataSize,  // in
> +      const BYTE*    inData,   // in
> +      TPM_STORED_DATA* sealedData, //out
> +      const TPM_SECRET* osapSharedSecret, //in
> +      const TPM_AUTHDATA* sealDataAuth, //in
> +      TPM_AUTH_SESSION*   pubAuth  // in, out
> +      );
> +
> +TPM_RESULT TPM_Unseal (
> +      TPM_KEY_HANDLE parentHandle, // in
> +      const TPM_STORED_DATA* sealedData,
> +      UINT32*   outSize,  // out
> +      BYTE**    out, //out
> +      const TPM_AUTHDATA* key_usage_auth, //in
> +      const TPM_AUTHDATA* data_usage_auth, //in
> +      TPM_AUTH_SESSION*   keyAuth,  // in, out
> +      TPM_AUTH_SESSION*   dataAuth  // in, out
> +      );
> +
> +TPM_RESULT TPM_DirWriteAuth ( TPM_DIRINDEX  dirIndex,  // in
> +      TPM_DIRVALUE  newContents, // in
> +      TPM_AUTH_SESSION*   ownerAuth  // in, out
> +      );
> +
> +TPM_RESULT TPM_DirRead ( TPM_DIRINDEX  dirIndex, // in
> +      TPM_DIRVALUE*  dirValue // out
> +      );
> +
> +TPM_RESULT TPM_Bind(
> +      const TPM_KEY* key, //in
> +      const BYTE* in, //in
> +      UINT32 ilen, //in
> +      BYTE* out //out, must be at least cipher block size
> +      );
> +
> +TPM_RESULT TPM_UnBind (
> +      TCS_KEY_HANDLE  keyHandle,  // in
> +      UINT32 ilen, //in
> +      const BYTE* in, //
> +      UINT32*   outDataSize, // out
> +      BYTE*    outData, //out
> +      const TPM_AUTHDATA* usage_auth,
> +      TPM_AUTH_SESSION* auth //in, out
> +      );
> +
> +TPM_RESULT TPM_CreateWrapKey (
> +      TCS_KEY_HANDLE  hWrappingKey,  // in
> +      const TPM_AUTHDATA* osapSharedSecret,
> +      const TPM_AUTHDATA* dataUsageAuth, //in
> +      const TPM_AUTHDATA* dataMigrationAuth, //in
> +      TPM_KEY*     key, //in
> +      TPM_AUTH_SESSION*   pAuth    // in, out
> +      );
> +
> +TPM_RESULT TPM_LoadKey (
> +      TPM_KEY_HANDLE  parentHandle, //
> +      const TPM_KEY* key, //in
> +      TPM_HANDLE*  keyHandle,    // out
> +      const TPM_AUTHDATA* usage_auth,
> +      TPM_AUTH_SESSION* auth
> +      );
> +
> +TPM_RESULT TPM_GetPubKey (  TCS_KEY_HANDLE  hKey,   // in
> +      TPM_AUTH_SESSION*   pAuth,   // in, out
> +      UINT32*    pcPubKeySize, // out
> +      BYTE**    prgbPubKey  // out
> +      );
> +
> +TPM_RESULT TPM_EvictKey ( TCS_KEY_HANDLE  hKey  // in
> +      );
> +
> +TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle, //in
> +      TPM_RESOURCE_TYPE rt //in
> +      );
> +
> +TPM_RESULT TPM_Sign ( TCS_KEY_HANDLE  keyHandle,  // in
> +      UINT32    areaToSignSize, // in
> +      BYTE*    areaToSign,  // in
> +      TPM_AUTH_SESSION*   privAuth,  // in, out
> +      UINT32*    sigSize,  // out
> +      BYTE**    sig    // out
> +      );
> +
> +TPM_RESULT TPM_GetRandom (  UINT32*    bytesRequested, // in, out
> +      BYTE*    randomBytes  // out
> +      );
> +
> +TPM_RESULT TPM_StirRandom (  UINT32    inDataSize, // in
> +      BYTE*    inData  // in
> +      );
> +
> +TPM_RESULT TPM_ReadPubek (
> +      TPM_PUBKEY* pubEK //out
> +      );
> +
> +TPM_RESULT TPM_GetCapability(
> +      TPM_CAPABILITY_AREA capArea,
> +      UINT32 subCapSize,
> +      const BYTE* subCap,
> +      UINT32* respSize,
> +      BYTE** resp);
> +
> +TPM_RESULT TPM_SaveState(void);
> +
> +TPM_RESULT TPM_CreateEndorsementKeyPair(
> +      const TPM_KEY_PARMS* keyInfo,
> +      TPM_PUBKEY* pubEK);
> +
> +TPM_RESULT TPM_TransmitData(
> +      BYTE* in,
> +      UINT32 insize,
> +      BYTE* out,
> +      UINT32* outsize);
> +
> +#endif //TPM_H
> diff --git a/stubdom/vtpmmgr/tpmrsa.c b/stubdom/vtpmmgr/tpmrsa.c
> new file mode 100644
> index 0000000..56094e7
> --- /dev/null
> +++ b/stubdom/vtpmmgr/tpmrsa.c
> @@ -0,0 +1,175 @@
> +/*
> + *  The RSA public-key cryptosystem
> + *
> + *  Copyright (C) 2006-2011, Brainspark B.V.
> + *
> + *  This file is part of PolarSSL (http://www.polarssl.org)
> + *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>=

> + *
> + *  All rights reserved.
> + *
> + *  This program is free software; you can redistribute it and/or modi=
fy
> + *  it under the terms of the GNU General Public License as published =
by
> + *  the Free Software Foundation; either version 2 of the License, or
> + *  (at your option) any later version.
> + *
> + *  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.,
> + *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> + */
> +/*
> + *  RSA was designed by Ron Rivest, Adi Shamir and Len Adleman.
> + *
> + *  http://theory.lcs.mit.edu/~rivest/rsapaper.pdf
> + *  http://www.cacr.math.uwaterloo.ca/hac/about/chap8.pdf
> + */
> +
> +#include "tcg.h"
> +#include "polarssl/sha1.h"
> +
> +#include <stdlib.h>
> +#include <stdio.h>
> +
> +#include "tpmrsa.h"
> +
> +#define HASH_LEN 20
> +
> +void tpmrsa_set_pubkey(tpmrsa_context* ctx,
> +      const unsigned char* key,
> +      int keylen,
> +      const unsigned char* exponent,
> +      int explen) {
> +
> +   tpmrsa_free(ctx);
> +
> +   if(explen =3D=3D 0) { //Default e=3D 2^16+1
> +      mpi_lset(&ctx->E, 65537);
> +   } else {
> +      mpi_read_binary(&ctx->E, exponent, explen);
> +   }
> +   mpi_read_binary(&ctx->N, key, keylen);
> +
> +   ctx->len =3D ( mpi_msb(&ctx->N) + 7) >> 3;
> +}
> +
> +static TPM_RESULT tpmrsa_public( tpmrsa_context *ctx,
> +      const unsigned char *input,
> +      unsigned char *output )
> +{
> +   int ret;
> +   size_t olen;
> +   mpi T;
> +
> +   mpi_init( &T );
> +
> +   MPI_CHK( mpi_read_binary( &T, input, ctx->len ) );
> +
> +   if( mpi_cmp_mpi( &T, &ctx->N ) >=3D 0 )
> +   {
> +      mpi_free( &T );
> +      return TPM_ENCRYPT_ERROR;
> +   }
> +
> +   olen =3D ctx->len;
> +   MPI_CHK( mpi_exp_mod( &T, &T, &ctx->E, &ctx->N, &ctx->RN ) );
> +   MPI_CHK( mpi_write_binary( &T, output, olen ) );
> +
> +cleanup:
> +
> +   mpi_free( &T );
> +
> +   if( ret !=3D 0 )
> +      return TPM_ENCRYPT_ERROR;
> +
> +   return TPM_SUCCESS;
> +}
> +
> +static void mgf_mask( unsigned char *dst, int dlen, unsigned char *src=
, int slen)
> +{
> +   unsigned char mask[HASH_LEN];
> +   unsigned char counter[4] =3D {0, 0, 0, 0};
> +   int i;
> +   sha1_context mctx;
> +
> +   //We always hash the src with the counter, so save the partial hash=

> +   sha1_starts(&mctx);
> +   sha1_update(&mctx, src, slen);
> +
> +   // Generate and apply dbMask
> +   while(dlen > 0) {
> +      //Copy the sha1 context
> +      sha1_context ctx =3D mctx;
> +
> +      //compute hash for input || counter
> +      sha1_update(&ctx, counter, sizeof(counter));
> +      sha1_finish(&ctx, mask);
> +
> +      //Apply the mask
> +      for(i =3D 0; i < (dlen < HASH_LEN ? dlen : HASH_LEN); ++i) {
> +         *(dst++) ^=3D mask[i];
> +      }
> +
> +      //Increment counter
> +      ++counter[3];
> +
> +      dlen -=3D HASH_LEN;
> +   }
> +}
> +
> +/*
> + * Add the message padding, then do an RSA operation
> + */
> +TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
> +      int (*f_rng)(void *, unsigned char *, size_t),
> +      void *p_rng,
> +      size_t ilen,
> +      const unsigned char *input,
> +      unsigned char *output )
> +{
> +   int ret;
> +   int olen;
> +   unsigned char* seed =3D output + 1;
> +   unsigned char* db =3D output + HASH_LEN +1;
> +
> +   olen =3D ctx->len-1;
> +
> +   if( f_rng =3D=3D NULL )
> +      return TPM_ENCRYPT_ERROR;
> +
> +   if( ilen > olen - 2 * HASH_LEN - 1)
> +      return TPM_ENCRYPT_ERROR;
> +
> +   output[0] =3D 0;
> +
> +   //Encoding parameter p
> +   sha1((unsigned char*)"TCPA", 4, db);
> +
> +   //PS
> +   memset(db + HASH_LEN, 0,
> +         olen - ilen - 2 * HASH_LEN - 1);
> +
> +   //constant 1 byte
> +   db[olen - ilen - HASH_LEN -1] =3D 0x01;
> +
> +   //input string
> +   memcpy(db + olen - ilen - HASH_LEN,
> +         input, ilen);
> +
> +   //Generate random seed
> +   if( ( ret =3D f_rng( p_rng, seed, HASH_LEN ) ) !=3D 0 )
> +      return TPM_ENCRYPT_ERROR;
> +
> +   // maskedDB: Apply dbMask to DB
> +   mgf_mask( db, olen - HASH_LEN, seed, HASH_LEN);
> +
> +   // maskedSeed: Apply seedMask to seed
> +   mgf_mask( seed, HASH_LEN, db, olen - HASH_LEN);
> +
> +   // Do the crypto op
> +   return tpmrsa_public(ctx, output, output);
> +}
> diff --git a/stubdom/vtpmmgr/tpmrsa.h b/stubdom/vtpmmgr/tpmrsa.h
> new file mode 100644
> index 0000000..59579e7
> --- /dev/null
> +++ b/stubdom/vtpmmgr/tpmrsa.h
> @@ -0,0 +1,67 @@
> +/**
> + * \file rsa.h
> + *
> + * \brief The RSA public-key cryptosystem
> + *
> + *  Copyright (C) 2006-2010, Brainspark B.V.
> + *
> + *  This file is part of PolarSSL (http://www.polarssl.org)
> + *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>=

> + *
> + *  All rights reserved.
> + *
> + *  This program is free software; you can redistribute it and/or modi=
fy
> + *  it under the terms of the GNU General Public License as published =
by
> + *  the Free Software Foundation; either version 2 of the License, or
> + *  (at your option) any later version.
> + *
> + *  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.,
> + *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> + */
> +#ifndef TPMRSA_H
> +#define TPMRSA_H
> +
> +#include "tcg.h"
> +#include <polarssl/bignum.h>
> +
> +/* tpm software key */
> +typedef struct
> +{
> +    size_t len;                 /*!<  size(N) in chars  */
> +
> +    mpi N;                      /*!<  public modulus    */
> +    mpi E;                      /*!<  public exponent   */
> +
> +    mpi RN;                     /*!<  cached R^2 mod N  */
> +}
> +tpmrsa_context;
> +
> +#define TPMRSA_CTX_INIT { 0, {0, 0, NULL}, {0, 0, NULL}, {0, 0, NULL}}=

> +
> +/* Setup the rsa context using tpm public key data */
> +void tpmrsa_set_pubkey(tpmrsa_context* ctx,
> +      const unsigned char* key,
> +      int keylen,
> +      const unsigned char* exponent,
> +      int explen);
> +
> +/* Do rsa public crypto */
> +TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
> +      int (*f_rng)(void *, unsigned char *, size_t),
> +      void *p_rng,
> +      size_t ilen,
> +      const unsigned char *input,
> +      unsigned char *output );
> +
> +/* free tpmrsa key */
> +inline void tpmrsa_free( tpmrsa_context *ctx ) {
> +   mpi_free( &ctx->RN ); mpi_free( &ctx->E  ); mpi_free( &ctx->N  );
> +}
> +
> +#endif /* tpmrsa.h */
> diff --git a/stubdom/vtpmmgr/uuid.h b/stubdom/vtpmmgr/uuid.h
> new file mode 100644
> index 0000000..4737645
> --- /dev/null
> +++ b/stubdom/vtpmmgr/uuid.h
> @@ -0,0 +1,50 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#ifndef VTPMMGR_UUID_H
> +#define VTPMMGR_UUID_H
> +
> +#define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%=
02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
> +#define UUID_FMTLEN ((2*16)+4) /* 16 hex bytes plus 4 hypens */
> +#define UUID_BYTES(uuid) uuid[0], uuid[1], uuid[2], uuid[3], \
> +                                uuid[4], uuid[5], uuid[6], uuid[7], \
> +                                uuid[8], uuid[9], uuid[10], uuid[11], =
\
> +                                uuid[12], uuid[13], uuid[14], uuid[15]=

> +
> +
> +typedef uint8_t uuid_t[16];
> +
> +#endif
> diff --git a/stubdom/vtpmmgr/vtpm_cmd_handler.c b/stubdom/vtpmmgr/vtpm_=
cmd_handler.c
> new file mode 100644
> index 0000000..f82a2a9
> --- /dev/null
> +++ b/stubdom/vtpmmgr/vtpm_cmd_handler.c
> @@ -0,0 +1,152 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#include <inttypes.h>
> +#include <string.h>
> +#include <stdlib.h>
> +
> +#include "marshal.h"
> +#include "log.h"
> +#include "vtpm_storage.h"
> +#include "vtpmmgr.h"
> +#include "tpm.h"
> +#include "tcg.h"
> +
> +static TPM_RESULT vtpmmgr_SaveHashKey(
> +      const uuid_t uuid,
> +      tpmcmd_t* tpmcmd)
> +{
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +
> +   if(tpmcmd->req_len !=3D VTPM_COMMAND_HEADER_SIZE + HASHKEYSZ) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_ORD_SAVEHASHKEY hashkey too sh=
ort!\n");
> +      status =3D TPM_BAD_PARAMETER;
> +      goto abort_egress;
> +   }
> +
> +   /* Do the command */
> +   TPMTRYRETURN(vtpm_storage_save_hashkey(uuid, tpmcmd->req + VTPM_COM=
MAND_HEADER_SIZE));
> +
> +abort_egress:
> +   pack_TPM_RSP_HEADER(tpmcmd->resp,
> +         VTPM_TAG_RSP, VTPM_COMMAND_HEADER_SIZE, status);
> +   tpmcmd->resp_len =3D VTPM_COMMAND_HEADER_SIZE;
> +
> +   return status;
> +}
> +
> +static TPM_RESULT vtpmmgr_LoadHashKey(
> +      const uuid_t uuid,
> +      tpmcmd_t* tpmcmd) {
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +
> +   tpmcmd->resp_len =3D VTPM_COMMAND_HEADER_SIZE;
> +
> +   TPMTRYRETURN(vtpm_storage_load_hashkey(uuid, tpmcmd->resp + VTPM_CO=
MMAND_HEADER_SIZE));
> +
> +   tpmcmd->resp_len +=3D HASHKEYSZ;
> +
> +abort_egress:
> +   pack_TPM_RSP_HEADER(tpmcmd->resp,
> +         VTPM_TAG_RSP, tpmcmd->resp_len, status);
> +
> +   return status;
> +}
> +
> +
> +TPM_RESULT vtpmmgr_handle_cmd(
> +      const uuid_t uuid,
> +      tpmcmd_t* tpmcmd)
> +{
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +   TPM_TAG tag;
> +   UINT32 size;
> +   TPM_COMMAND_CODE ord;
> +
> +   unpack_TPM_RQU_HEADER(tpmcmd->req,
> +         &tag, &size, &ord);
> +
> +   /* Handle the command now */
> +   switch(tag) {
> +      case VTPM_TAG_REQ:
> +         //This is a vTPM command
> +         switch(ord) {
> +            case VTPM_ORD_SAVEHASHKEY:
> +               return vtpmmgr_SaveHashKey(uuid, tpmcmd);
> +            case VTPM_ORD_LOADHASHKEY:
> +               return vtpmmgr_LoadHashKey(uuid, tpmcmd);
> +            default:
> +               vtpmlogerror(VTPM_LOG_VTPM, "Invalid vTPM Ordinal %" PR=
Iu32 "\n", ord);
> +               status =3D TPM_BAD_ORDINAL;
> +         }
> +         break;
> +      case TPM_TAG_RQU_COMMAND:
> +      case TPM_TAG_RQU_AUTH1_COMMAND:
> +      case TPM_TAG_RQU_AUTH2_COMMAND:
> +         //This is a TPM passthrough command
> +         switch(ord) {
> +            case TPM_ORD_GetRandom:
> +               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_GetRandom\=
n");
> +               break;
> +            case TPM_ORD_PcrRead:
> +               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_PcrRead\n"=
);
> +               break;
> +            default:
> +               vtpmlogerror(VTPM_LOG_VTPM, "TPM Disallowed Passthrough=
 ord=3D%" PRIu32 "\n", ord);
> +               status =3D TPM_DISABLED_CMD;
> +               goto abort_egress;
> +         }
> +
> +         size =3D TCPA_MAX_BUFFER_LENGTH;
> +         TPMTRYRETURN(TPM_TransmitData(tpmcmd->req, tpmcmd->req_len, t=
pmcmd->resp, &size));
> +         tpmcmd->resp_len =3D size;
> +
> +         unpack_TPM_RESULT(tpmcmd->resp + sizeof(TPM_TAG) + sizeof(UIN=
T32), &status);
> +         return status;
> +
> +         break;
> +      default:
> +         vtpmlogerror(VTPM_LOG_VTPM, "Invalid tag=3D%" PRIu16 "\n", ta=
g);
> +         status =3D TPM_BADTAG;
> +   }
> +
> +abort_egress:
> +   tpmcmd->resp_len =3D VTPM_COMMAND_HEADER_SIZE;
> +   pack_TPM_RSP_HEADER(tpmcmd->resp,
> +         tag + 3, tpmcmd->resp_len, status);
> +
> +   return status;
> +}
> diff --git a/stubdom/vtpmmgr/vtpm_manager.h b/stubdom/vtpmmgr/vtpm_mana=
ger.h
> new file mode 100644
> index 0000000..a2bbcca
> --- /dev/null
> +++ b/stubdom/vtpmmgr/vtpm_manager.h
> @@ -0,0 +1,64 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#ifndef VTPM_MANAGER_H
> +#define VTPM_MANAGER_H
> +
> +#define VTPM_TAG_REQ 0x01c1
> +#define VTPM_TAG_RSP 0x01c4
> +#define COMMAND_BUFFER_SIZE 4096
> +
> +// Header size
> +#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
> +
> +//************************ Command Codes ****************************
> +#define VTPM_ORD_BASE       0x0000
> +#define VTPM_PRIV_MASK      0x01000000 // Priviledged VTPM Command
> +#define VTPM_PRIV_BASE      (VTPM_ORD_BASE | VTPM_PRIV_MASK)
> +
> +// Non-priviledged VTPM Commands (From DMI's)
> +#define VTPM_ORD_SAVEHASHKEY      (VTPM_ORD_BASE + 1) // DMI requests =
encryption key for persistent storage
> +#define VTPM_ORD_LOADHASHKEY      (VTPM_ORD_BASE + 2) // DMI requests =
symkey to be regenerated
> +
> +//************************ Return Codes ****************************
> +#define VTPM_SUCCESS               0
> +#define VTPM_FAIL                  1
> +#define VTPM_UNSUPPORTED           2
> +#define VTPM_FORBIDDEN             3
> +#define VTPM_RESTORE_CONTEXT_FAILED    4
> +#define VTPM_INVALID_REQUEST       5
> +
> +#endif
> diff --git a/stubdom/vtpmmgr/vtpm_storage.c b/stubdom/vtpmmgr/vtpm_stor=
age.c
> new file mode 100644
> index 0000000..9ce0c32
> --- /dev/null
> +++ b/stubdom/vtpmmgr/vtpm_storage.c
> @@ -0,0 +1,794 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
> + * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
> + * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNES=
S
> + * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
> + * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE=

> + * SOFTWARE.
> + */
> +
> +/***************************************************************
> + * DISK IMAGE LAYOUT
> + * *************************************************************
> + * All data is stored in BIG ENDIAN format
> + * *************************************************************
> + * Section 1: Header
> + *
> + * 10 bytes     id                     ID String "VTPMMGRDOM"
> + * uint32_t     version                Disk Image version number (curr=
ent =3D=3D 1)
> + * uint32_t      storage_key_len       Length of the storage Key
> + * TPM_KEY       storage_key           Marshalled TPM_KEY structure (S=
ee TPM spec v2)
> + * RSA_BLOCK     aes_crypto             Encrypted aes key data (RSA_CI=
PHER_SIZE bytes), bound by the storage_key
> + *  BYTE[32] aes_key                    Aes key for encrypting the uui=
d table
> + *  uint32_t cipher_sz                  Encrypted size of the uuid tab=
le
> + *
> + * *************************************************************
> + * Section 2: Uuid Table
> + *
> + * This table is encrypted by the aes_key in the header. The cipher te=
xt size is just
> + * large enough to hold all of the entries plus required padding.
> + *
> + * Each entry is as follows
> + * BYTE[16] uuid                       Uuid of a vtpm that is stored o=
n this disk
> + * uint32_t offset                     Disk offset where the vtpm data=
 is stored
> + *
> + * *************************************************************
> + * Section 3: Vtpm Table
> + *
> + * The rest of the disk stores vtpms. Each vtpm is an RSA_BLOCK encryp=
ted
> + * by the storage key. Each vtpm must exist on an RSA_BLOCK aligned bo=
undary,
> + * starting at the first RSA_BLOCK aligned offset after the uuid table=
=2E
> + * As the uuid table grows, vtpms may be relocated.
> + *
> + * RSA_BLOCK     vtpm_crypto          Vtpm data encrypted by storage_k=
ey
> + *   BYTE[20]    hash                 Sha1 hash of vtpm encrypted data=

> + *   BYTE[16]    vtpm_aes_key         Encryption key for vtpm data
> + *
> +  *************************************************************
> + */
> +#define DISKVERS 1
> +#define IDSTR "VTPMMGRDOM"
> +#define IDSTRLEN 10
> +#define AES_BLOCK_SIZE 16
> +#define AES_KEY_BITS 256
> +#define AES_KEY_SIZE (AES_KEY_BITS/8)
> +#define BUF_SIZE 4096
> +
> +#define UUID_TBL_ENT_SIZE (sizeof(uuid_t) + sizeof(uint32_t))
> +
> +#define HEADERSZ (10 + 4 + 4)
> +
> +#define TRY_READ(buf, size, msg) do {\
> +   int rc; \
> +   if((rc =3D read(blkfront_fd, buf, (size))) !=3D (size)) { \
> +      vtpmlogerror(VTPM_LOG_VTPM, "read() failed! " msg " : rc=3D(%d/%=
d), error=3D(%s)\n", rc, (int)(size), strerror(errno)); \
> +      status =3D TPM_IOERROR;\
> +      goto abort_egress;\
> +   } \
> +} while(0)
> +
> +#define TRY_WRITE(buf, size, msg) do {\
> +   int rc; \
> +   if((rc =3D write(blkfront_fd, buf, (size))) !=3D (size)) { \
> +      vtpmlogerror(VTPM_LOG_VTPM, "write() failed! " msg " : rc=3D(%d/=
%d), error=3D(%s)\n", rc, (int)(size), strerror(errno)); \
> +      status =3D TPM_IOERROR;\
> +      goto abort_egress;\
> +   } \
> +} while(0)
> +
> +#include <blkfront.h>
> +#include <unistd.h>
> +#include <errno.h>
> +#include <string.h>
> +#include <inttypes.h>
> +#include <stdlib.h>
> +#include <stdbool.h>
> +#include <mini-os/byteorder.h>
> +#include <polarssl/aes.h>
> +
> +#include "vtpm_manager.h"
> +#include "log.h"
> +#include "marshal.h"
> +#include "tpm.h"
> +#include "uuid.h"
> +
> +#include "vtpmmgr.h"
> +#include "vtpm_storage.h"
> +
> +#define MAX(a,b) ( ((a) > (b)) ? (a) : (b) )
> +#define MIN(a,b) ( ((a) < (b)) ? (a) : (b) )
> +
> +/* blkfront device objets */
> +static struct blkfront_dev* blkdev =3D NULL;
> +static int blkfront_fd =3D -1;
> +
> +struct Vtpm {
> +   uuid_t uuid;
> +   int offset;
> +};
> +struct Storage {
> +   int aes_offset;
> +   int uuid_offset;
> +   int end_offset;
> +
> +   int num_vtpms;
> +   int num_vtpms_alloced;
> +   struct Vtpm* vtpms;
> +};
> +
> +/* Global storage data */
> +static struct Storage g_store =3D {
> +   .vtpms =3D NULL,
> +};
> +
> +static int get_offset(void) {
> +   return lseek(blkfront_fd, 0, SEEK_CUR);
> +}
> +
> +static void reset_store(void) {
> +   g_store.aes_offset =3D 0;
> +   g_store.uuid_offset =3D 0;
> +   g_store.end_offset =3D 0;
> +
> +   g_store.num_vtpms =3D 0;
> +   g_store.num_vtpms_alloced =3D 0;
> +   free(g_store.vtpms);
> +   g_store.vtpms =3D NULL;
> +}
> +
> +static int vtpm_get_index(const uuid_t uuid) {
> +   int st =3D 0;
> +   int ed =3D g_store.num_vtpms-1;
> +   while(st <=3D ed) {
> +      int mid =3D ((unsigned int)st + (unsigned int)ed) >> 1; //avoid =
overflow
> +      int c =3D memcmp(uuid, &g_store.vtpms[mid].uuid, sizeof(uuid_t))=
;
> +      if(c =3D=3D 0) {
> +         return mid;
> +      } else if(c > 0) {
> +         st =3D mid + 1;
> +      } else {
> +         ed =3D mid - 1;
> +      }
> +   }
> +   return -(st + 1);
> +}
> +
> +static void vtpm_add(const uuid_t uuid, int offset, int index) {
> +   /* Realloc more space if needed */
> +   if(g_store.num_vtpms >=3D g_store.num_vtpms_alloced) {
> +      g_store.num_vtpms_alloced +=3D 16;
> +      g_store.vtpms =3D realloc(
> +            g_store.vtpms,
> +            sizeof(struct Vtpm) * g_store.num_vtpms_alloced);
> +   }
> +
> +   /* Move everybody after the new guy */
> +   for(int i =3D g_store.num_vtpms; i > index; --i) {
> +      g_store.vtpms[i] =3D g_store.vtpms[i-1];
> +   }
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Registered vtpm " UUID_FMT "\n", UUID_B=
YTES(uuid));
> +
> +   /* Finally add new one */
> +   memcpy(g_store.vtpms[index].uuid, uuid, sizeof(uuid_t));
> +   g_store.vtpms[index].offset =3D offset;
> +   ++g_store.num_vtpms;
> +}
> +
> +#if 0
> +static void vtpm_remove(int index) {
> +   for(i =3D index; i < g_store.num_vtpms; ++i) {
> +      g_store.vtpms[i] =3D g_store.vtpms[i+1];
> +   }
> +   --g_store.num_vtpms;
> +}
> +#endif
> +
> +static int pack_uuid_table(uint8_t* table, int size, int* nvtpms) {
> +   uint8_t* ptr =3D table;
> +   while(*nvtpms < g_store.num_vtpms && size >=3D 0)
> +   {
> +      /* Pack the uuid */
> +      memcpy(ptr, (uint8_t*)g_store.vtpms[*nvtpms].uuid, sizeof(uuid_t=
));
> +      ptr+=3D sizeof(uuid_t);
> +
> +
> +      /* Pack the offset */
> +      ptr =3D pack_UINT32(ptr, g_store.vtpms[*nvtpms].offset);
> +
> +      ++*nvtpms;
> +      size -=3D UUID_TBL_ENT_SIZE;
> +   }
> +   return ptr - table;
> +}
> +
> +/* Extract the uuids */
> +static int extract_uuid_table(uint8_t* table, int size) {
> +   uint8_t* ptr =3D table;
> +   for(;size >=3D UUID_TBL_ENT_SIZE; size -=3D UUID_TBL_ENT_SIZE) {
> +      int index;
> +      uint32_t v32;
> +
> +      /*uuid_t is just an array of bytes, so we can do a direct cast h=
ere */
> +      uint8_t* uuid =3D ptr;
> +      ptr +=3D sizeof(uuid_t);
> +
> +      /* Get the offset of the key */
> +      ptr =3D unpack_UINT32(ptr, &v32);
> +
> +      /* Insert the new vtpm in sorted order */
> +      if((index =3D vtpm_get_index(uuid)) >=3D 0) {
> +         vtpmlogerror(VTPM_LOG_VTPM, "Vtpm (" UUID_FMT ") exists multi=
ple times! ignoring...\n", UUID_BYTES(uuid));
> +         continue;
> +      }
> +      index =3D -index -1;
> +
> +      vtpm_add(uuid, v32, index);
> +
> +   }
> +   return ptr - table;
> +}
> +
> +static void vtpm_decrypt_block(aes_context* aes,
> +      uint8_t* iv,
> +      uint8_t* cipher,
> +      uint8_t* plain,
> +      int cipher_sz,
> +      int* overlap)
> +{
> +   int bytes_ext;
> +   /* Decrypt */
> +   aes_crypt_cbc(aes, AES_DECRYPT,
> +         cipher_sz,
> +         iv, cipher, plain + *overlap);
> +
> +   /* Extract */
> +   bytes_ext =3D extract_uuid_table(plain, cipher_sz + *overlap);
> +
> +   /* Copy left overs to the beginning */
> +   *overlap =3D cipher_sz + *overlap - bytes_ext;
> +   memcpy(plain, plain + bytes_ext, *overlap);
> +}
> +
> +static int vtpm_encrypt_block(aes_context* aes,
> +      uint8_t* iv,
> +      uint8_t* plain,
> +      uint8_t* cipher,
> +      int block_sz,
> +      int* overlap,
> +      int* num_vtpms)
> +{
> +   int bytes_to_crypt;
> +   int bytes_packed;
> +
> +   /* Pack the uuid table */
> +   bytes_packed =3D *overlap + pack_uuid_table(plain + *overlap, block=
_sz - *overlap, num_vtpms);
> +   bytes_to_crypt =3D MIN(bytes_packed, block_sz);
> +
> +   /* Add padding if we aren't on a multiple of the block size */
> +   if(bytes_to_crypt & (AES_BLOCK_SIZE-1)) {
> +      int oldsz =3D bytes_to_crypt;
> +      //add padding
> +      bytes_to_crypt +=3D AES_BLOCK_SIZE - (bytes_to_crypt & (AES_BLOC=
K_SIZE-1));
> +      //fill padding with random bytes
> +      vtpmmgr_rand(plain + oldsz, bytes_to_crypt - oldsz);
> +      *overlap =3D 0;
> +   } else {
> +      *overlap =3D bytes_packed - bytes_to_crypt;
> +   }
> +
> +   /* Encrypt this chunk */
> +   aes_crypt_cbc(aes, AES_ENCRYPT,
> +            bytes_to_crypt,
> +            iv, plain, cipher);
> +
> +   /* Copy the left over partials to the beginning */
> +   memcpy(plain, plain + bytes_to_crypt, *overlap);
> +
> +   return bytes_to_crypt;
> +}
> +
> +static TPM_RESULT vtpm_storage_new_vtpm(const uuid_t uuid, int index) =
{
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +   uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
> +   uint8_t buf[BUF_SIZE];
> +   uint8_t* ptr;
> +   int cipher_sz;
> +   aes_context aes;
> +
> +   /* Add new vtpm to the table */
> +   vtpm_add(uuid, g_store.end_offset, index);
> +   g_store.end_offset +=3D RSA_CIPHER_SIZE;
> +
> +   /* Compute the new end location of the encrypted uuid table */
> +   cipher_sz =3D AES_BLOCK_SIZE; //IV
> +   cipher_sz +=3D g_store.num_vtpms * UUID_TBL_ENT_SIZE; //uuid table
> +   cipher_sz +=3D (AES_BLOCK_SIZE - (cipher_sz & (AES_BLOCK_SIZE -1)))=
 & (AES_BLOCK_SIZE-1); //aes padding
> +
> +   /* Does this overlap any key data? If so they need to be relocated =
*/
> +   int uuid_end =3D (g_store.uuid_offset + cipher_sz + RSA_CIPHER_SIZE=
) & ~(RSA_CIPHER_SIZE -1);
> +   for(int i =3D 0; i < g_store.num_vtpms; ++i) {
> +      if(g_store.vtpms[i].offset < uuid_end) {
> +
> +         vtpmloginfo(VTPM_LOG_VTPM, "Relocating vtpm data\n");
> +
> +         //Read the hashkey cipher text
> +         lseek(blkfront_fd, g_store.vtpms[i].offset, SEEK_SET);
> +         TRY_READ(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
> +
> +         //Write the cipher text to new offset
> +         lseek(blkfront_fd, g_store.end_offset, SEEK_SET);
> +         TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
> +
> +         //Save new offset
> +         g_store.vtpms[i].offset =3D g_store.end_offset;
> +         g_store.end_offset +=3D RSA_CIPHER_SIZE;
> +      }
> +   }
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Generating a new symmetric key\n");
> +
> +   /* Generate an aes key */
> +   TPMTRYRETURN(vtpmmgr_rand(plain, AES_KEY_SIZE));
> +   aes_setkey_enc(&aes, plain, AES_KEY_BITS);
> +   ptr =3D plain + AES_KEY_SIZE;
> +
> +   /* Pack the crypted size */
> +   ptr =3D pack_UINT32(ptr, cipher_sz);
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Binding encrypted key\n");
> +
> +   /* Seal the key and size */
> +   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
> +            plain,
> +            ptr - plain,
> +            buf));
> +
> +   /* Write the sealed key to disk */
> +   lseek(blkfront_fd, g_store.aes_offset, SEEK_SET);
> +   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm aes key");
> +
> +   /* ENCRYPT AND WRITE UUID TABLE */
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Encrypting the uuid table\n");
> +
> +   int num_vtpms =3D 0;
> +   int overlap =3D 0;
> +   int bytes_crypted;
> +   uint8_t iv[AES_BLOCK_SIZE];
> +
> +   /* Generate the iv for the first block */
> +   TPMTRYRETURN(vtpmmgr_rand(iv, AES_BLOCK_SIZE));
> +
> +   /* Copy the iv to the cipher text buffer to be written to disk */
> +   memcpy(buf, iv, AES_BLOCK_SIZE);
> +   ptr =3D buf + AES_BLOCK_SIZE;
> +
> +   /* Encrypt the first block of the uuid table */
> +   bytes_crypted =3D vtpm_encrypt_block(&aes,
> +         iv, //iv
> +         plain, //plaintext
> +         ptr, //cipher text
> +         BUF_SIZE - AES_BLOCK_SIZE,
> +         &overlap,
> +         &num_vtpms);
> +
> +   /* Write the iv followed by the crypted table*/
> +   TRY_WRITE(buf, bytes_crypted + AES_BLOCK_SIZE, "vtpm uuid table");
> +
> +   /* Decrement the number of bytes encrypted */
> +   cipher_sz -=3D bytes_crypted + AES_BLOCK_SIZE;
> +
> +   /* If there are more vtpms, encrypt and write them block by block *=
/
> +   while(cipher_sz > 0) {
> +      /* Encrypt the next block of the uuid table */
> +      bytes_crypted =3D vtpm_encrypt_block(&aes,
> +               iv,
> +               plain,
> +               buf,
> +               BUF_SIZE,
> +               &overlap,
> +               &num_vtpms);
> +
> +      /* Write the cipher text to disk */
> +      TRY_WRITE(buf, bytes_crypted, "vtpm uuid table");
> +
> +      cipher_sz -=3D bytes_crypted;
> +   }
> +
> +   goto egress;
> +abort_egress:
> +egress:
> +   return status;
> +}
> +
> +
> +/**************************************
> + * PUBLIC FUNCTIONS
> + * ***********************************/
> +
> +int vtpm_storage_init(void) {
> +   struct blkfront_info info;
> +   if((blkdev =3D init_blkfront(NULL, &info)) =3D=3D NULL) {
> +      return -1;
> +   }
> +   if((blkfront_fd =3D blkfront_open(blkdev)) < 0) {
> +      return -1;
> +   }
> +   return 0;
> +}
> +
> +void vtpm_storage_shutdown(void) {
> +   reset_store();
> +   close(blkfront_fd);
> +}
> +
> +TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashke=
y[HASHKEYSZ])
> +{
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +   int index;
> +   uint8_t cipher[RSA_CIPHER_SIZE];
> +   uint8_t clear[RSA_CIPHER_SIZE];
> +   UINT32 clear_size;
> +
> +   /* Find the index of this uuid */
> +   if((index =3D vtpm_get_index(uuid)) < 0) {
> +      index =3D -index-1;
> +      vtpmlogerror(VTPM_LOG_VTPM, "LoadKey failure: Unrecognized uuid!=
 " UUID_FMT "\n", UUID_BYTES(uuid));
> +      status =3D TPM_BAD_PARAMETER;
> +      goto abort_egress;
> +   }
> +
> +   /* Read the table entry */
> +   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
> +   TRY_READ(cipher, RSA_CIPHER_SIZE, "vtpm hashkey data");
> +
> +   /* Decrypt the table entry */
> +   TPMTRYRETURN(TPM_UnBind(
> +            vtpm_globals.storage_key_handle,
> +            RSA_CIPHER_SIZE,
> +            cipher,
> +            &clear_size,
> +            clear,
> +            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,=

> +            &vtpm_globals.oiap));
> +
> +   if(clear_size < HASHKEYSZ) {
> +      vtpmloginfo(VTPM_LOG_VTPM, "Decrypted Hash key size (%" PRIu32 "=
) was too small!\n", clear_size);
> +      status =3D TPM_RESOURCES;
> +      goto abort_egress;
> +   }
> +
> +   memcpy(hashkey, clear, HASHKEYSZ);
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Loaded hash and key for vtpm " UUID_FMT=
 "\n", UUID_BYTES(uuid));
> +   goto egress;
> +abort_egress:
> +   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load key\n");
> +egress:
> +   return status;
> +}
> +
> +TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashke=
y[HASHKEYSZ])
> +{
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +   int index;
> +   uint8_t buf[RSA_CIPHER_SIZE];
> +
> +   /* Find the index of this uuid */
> +   if((index =3D vtpm_get_index(uuid)) < 0) {
> +      index =3D -index-1;
> +      /* Create a new vtpm */
> +      TPMTRYRETURN( vtpm_storage_new_vtpm(uuid, index) );
> +   }
> +
> +   /* Encrypt the hash and key */
> +   TPMTRYRETURN( TPM_Bind(&vtpm_globals.storage_key,
> +            hashkey,
> +            HASHKEYSZ,
> +            buf));
> +
> +   /* Write to disk */
> +   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
> +   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey data");
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Saved hash and key for vtpm " UUID_FMT =
"\n", UUID_BYTES(uuid));
> +   goto egress;
> +abort_egress:
> +   vtpmlogerror(VTPM_LOG_VTPM, "Failed to save key\n");
> +egress:
> +   return status;
> +}
> +
> +TPM_RESULT vtpm_storage_new_header()
> +{
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +   uint8_t buf[BUF_SIZE];
> +   uint8_t keybuf[AES_KEY_SIZE + sizeof(uint32_t)];
> +   uint8_t* ptr =3D buf;
> +   uint8_t* sptr;
> +
> +   /* Clear everything first */
> +   reset_store();
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Creating new disk image header\n");
> +
> +   /*Copy the ID string */
> +   memcpy(ptr, IDSTR, IDSTRLEN);
> +   ptr +=3D IDSTRLEN;
> +
> +   /*Copy the version */
> +   ptr =3D pack_UINT32(ptr, DISKVERS);
> +
> +   /*Save the location of the key size */
> +   sptr =3D ptr;
> +   ptr +=3D sizeof(UINT32);
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Saving root storage key..\n");
> +
> +   /* Copy the storage key */
> +   ptr =3D pack_TPM_KEY(ptr, &vtpm_globals.storage_key);
> +
> +   /* Now save the size */
> +   pack_UINT32(sptr, ptr - (sptr + 4));
> +
> +   /* Create a fake aes key and set cipher text size to 0 */
> +   memset(keybuf, 0, sizeof(keybuf));
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Binding uuid table symmetric key..\n");=

> +
> +   /* Save the location of the aes key */
> +   g_store.aes_offset =3D ptr - buf;
> +
> +   /* Store the fake aes key and vtpm count */
> +   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
> +         keybuf,
> +         sizeof(keybuf),
> +         ptr));
> +   ptr+=3D RSA_CIPHER_SIZE;
> +
> +   /* Write the header to disk */
> +   lseek(blkfront_fd, 0, SEEK_SET);
> +   TRY_WRITE(buf, ptr-buf, "vtpm header");
> +
> +   /* Save the location of the uuid table */
> +   g_store.uuid_offset =3D get_offset();
> +
> +   /* Save the end offset */
> +   g_store.end_offset =3D (g_store.uuid_offset + RSA_CIPHER_SIZE) & ~(=
RSA_CIPHER_SIZE -1);
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Saved new manager disk header.\n");
> +
> +   goto egress;
> +abort_egress:
> +egress:
> +   return status;
> +}
> +
> +
> +TPM_RESULT vtpm_storage_load_header(void)
> +{
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +   uint32_t v32;
> +   uint8_t buf[BUF_SIZE];
> +   uint8_t* ptr =3D buf;
> +   aes_context aes;
> +
> +   /* Clear everything first */
> +   reset_store();
> +
> +   /* Read the header from disk */
> +   lseek(blkfront_fd, 0, SEEK_SET);
> +   TRY_READ(buf, IDSTRLEN + sizeof(UINT32) + sizeof(UINT32), "vtpm hea=
der");
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Loading disk image header\n");
> +
> +   /* Verify the ID string */
> +   if(memcmp(ptr, IDSTR, IDSTRLEN)) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Invalid ID string in disk image!\n"=
);
> +      status =3D TPM_FAIL;
> +      goto abort_egress;
> +   }
> +   ptr+=3DIDSTRLEN;
> +
> +   /* Unpack the version */
> +   ptr =3D unpack_UINT32(ptr, &v32);
> +
> +   /* Verify the version */
> +   if(v32 !=3D DISKVERS) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Unsupported disk image version numb=
er %" PRIu32 "\n", v32);
> +      status =3D TPM_FAIL;
> +      goto abort_egress;
> +   }
> +
> +   /* Size of the storage key */
> +   ptr =3D unpack_UINT32(ptr, &v32);
> +
> +   /* Sanity check */
> +   if(v32 > BUF_SIZE) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Size of storage key (%" PRIu32 ") i=
s too large!\n", v32);
> +      status =3D TPM_IOERROR;
> +      goto abort_egress;
> +   }
> +
> +   /* read the storage key */
> +   TRY_READ(buf, v32, "storage pub key");
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Unpacking storage key\n");
> +
> +   /* unpack the storage key */
> +   ptr =3D unpack_TPM_KEY(buf, &vtpm_globals.storage_key, UNPACK_ALLOC=
);
> +
> +   /* Load Storage Key into the TPM */
> +   TPMTRYRETURN( TPM_LoadKey(
> +            TPM_SRK_KEYHANDLE,
> +            &vtpm_globals.storage_key,
> +            &vtpm_globals.storage_key_handle,
> +            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
> +            &vtpm_globals.oiap));
> +
> +   /* Initialize the storage key auth */
> +   memset(vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA)=
);
> +
> +   /* Store the offset of the aes key */
> +   g_store.aes_offset =3D get_offset();
> +
> +   /* Read the rsa cipher text for the aes key */
> +   TRY_READ(buf, RSA_CIPHER_SIZE, "aes key");
> +   ptr =3D buf + RSA_CIPHER_SIZE;
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Unbinding uuid table symmetric key\n");=

> +
> +   /* Decrypt the aes key protecting the uuid table */
> +   UINT32 datalen;
> +   TPMTRYRETURN(TPM_UnBind(
> +            vtpm_globals.storage_key_handle,
> +            RSA_CIPHER_SIZE,
> +            buf,
> +            &datalen,
> +            ptr,
> +            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,=

> +            &vtpm_globals.oiap));
> +
> +   /* Validate the length of the output buffer */
> +   if(datalen < AES_KEY_SIZE + sizeof(UINT32)) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Unbound AES key size (%d) was too s=
mall! expected (%ld)\n", datalen, AES_KEY_SIZE + sizeof(UINT32));
> +      status =3D TPM_IOERROR;
> +      goto abort_egress;
> +   }
> +
> +   /* Extract the aes key */
> +   aes_setkey_dec(&aes, ptr, AES_KEY_BITS);
> +   ptr+=3D AES_KEY_SIZE;
> +
> +   /* Extract the ciphertext size */
> +   ptr =3D unpack_UINT32(ptr, &v32);
> +   int cipher_size =3D v32;
> +
> +   /* Sanity check */
> +   if(cipher_size & (AES_BLOCK_SIZE-1)) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Cipher text size (%" PRIu32 ") is n=
ot a multiple of the aes block size! (%d)\n", v32, AES_BLOCK_SIZE);
> +      status =3D TPM_IOERROR;
> +      goto abort_egress;
> +   }
> +
> +   /* Save the location of the uuid table */
> +   g_store.uuid_offset =3D get_offset();
> +
> +   /* Only decrypt the table if there are vtpms to decrypt */
> +   if(cipher_size > 0) {
> +      int rbytes;
> +      int overlap =3D 0;
> +      uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
> +      uint8_t iv[AES_BLOCK_SIZE];
> +
> +      vtpmloginfo(VTPM_LOG_VTPM, "Decrypting uuid table\n");
> +
> +      /* Pre allocate the vtpm array */
> +      g_store.num_vtpms_alloced =3D cipher_size / UUID_TBL_ENT_SIZE;
> +      g_store.vtpms =3D malloc(sizeof(struct Vtpm) * g_store.num_vtpms=
_alloced);
> +
> +      /* Read the iv and the first chunk of cipher text */
> +      rbytes =3D MIN(cipher_size, BUF_SIZE);
> +      TRY_READ(buf, rbytes, "vtpm uuid table\n");
> +      cipher_size -=3D rbytes;
> +
> +      /* Copy the iv */
> +      memcpy(iv, buf, AES_BLOCK_SIZE);
> +      ptr =3D buf + AES_BLOCK_SIZE;
> +
> +      /* Remove the iv from the number of bytes to decrypt */
> +      rbytes -=3D AES_BLOCK_SIZE;
> +
> +      /* Decrypt and extract vtpms */
> +      vtpm_decrypt_block(&aes,
> +            iv, ptr, plain,
> +            rbytes, &overlap);
> +
> +      /* Read the rest of the table if there is more */
> +      while(cipher_size > 0) {
> +         /* Read next chunk of cipher text */
> +         rbytes =3D MIN(cipher_size, BUF_SIZE);
> +         TRY_READ(buf, rbytes, "vtpm uuid table");
> +         cipher_size -=3D rbytes;
> +
> +         /* Decrypt a block of text */
> +         vtpm_decrypt_block(&aes,
> +               iv, buf, plain,
> +               rbytes, &overlap);
> +
> +      }
> +      vtpmloginfo(VTPM_LOG_VTPM, "Loaded %d vtpms!\n", g_store.num_vtp=
ms);
> +   }
> +
> +   /* The end of the key table, new vtpms go here */
> +   int uuid_end =3D (get_offset() + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SI=
ZE -1);
> +   g_store.end_offset =3D uuid_end;
> +
> +   /* Compute the end offset while validating vtpms*/
> +   for(int i =3D 0; i < g_store.num_vtpms; ++i) {
> +      /* offset must not collide with previous data */
> +      if(g_store.vtpms[i].offset < uuid_end) {
> +         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
> +               " offset (%d) is before end of uuid table (%d)!\n",
> +               UUID_BYTES(g_store.vtpms[i].uuid),
> +               g_store.vtpms[i].offset, uuid_end);
> +         status =3D TPM_IOERROR;
> +         goto abort_egress;
> +      }
> +      /* offset must be at a multiple of cipher size */
> +      if(g_store.vtpms[i].offset & (RSA_CIPHER_SIZE-1)) {
> +         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
> +               " offset(%d) is not at a multiple of the rsa cipher tex=
t size (%d)!\n",
> +               UUID_BYTES(g_store.vtpms[i].uuid),
> +               g_store.vtpms[i].offset, RSA_CIPHER_SIZE);
> +         status =3D TPM_IOERROR;
> +         goto abort_egress;
> +      }
> +      /* Save the last offset */
> +      if(g_store.vtpms[i].offset >=3D g_store.end_offset) {
> +         g_store.end_offset =3D g_store.vtpms[i].offset + RSA_CIPHER_S=
IZE;
> +      }
> +   }
> +
> +   goto egress;
> +abort_egress:
> +   //An error occured somewhere
> +   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load manager data!\n");
> +
> +   //Clear the data store
> +   reset_store();
> +
> +   //Reset the storage key structure
> +   free_TPM_KEY(&vtpm_globals.storage_key);
> +   {
> +      TPM_KEY key =3D TPM_KEY_INIT;
> +      vtpm_globals.storage_key =3D key;
> +   }
> +
> +   //Reset the storage key handle
> +   TPM_EvictKey(vtpm_globals.storage_key_handle);
> +   vtpm_globals.storage_key_handle =3D 0;
> +egress:
> +   return status;
> +}
> +
> +#if 0
> +/* For testing disk IO */
> +void add_fake_vtpms(int num) {
> +   for(int i =3D 0; i < num; ++i) {
> +      uint32_t ind =3D cpu_to_be32(i);
> +
> +      uuid_t uuid;
> +      memset(uuid, 0, sizeof(uuid_t));
> +      memcpy(uuid, &ind, sizeof(ind));
> +      int index =3D vtpm_get_index(uuid);
> +      index =3D -index-1;
> +
> +      vtpm_storage_new_vtpm(uuid, index);
> +   }
> +}
> +#endif
> diff --git a/stubdom/vtpmmgr/vtpm_storage.h b/stubdom/vtpmmgr/vtpm_stor=
age.h
> new file mode 100644
> index 0000000..a5a5fd7
> --- /dev/null
> +++ b/stubdom/vtpmmgr/vtpm_storage.h
> @@ -0,0 +1,68 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#ifndef VTPM_STORAGE_H
> +#define VTPM_STORAGE_h
> +
> +#include "uuid.h"
> +
> +#define VTPM_NVMKEY_SIZE 32
> +#define HASHKEYSZ (sizeof(TPM_DIGEST) + VTPM_NVMKEY_SIZE)
> +
> +/* Initialize the storage system and its virtual disk */
> +int vtpm_storage_init(void);
> +
> +/* Shutdown the storage system and its virtual disk */
> +void vtpm_storage_shutdown(void);
> +
> +/* Loads Sha1 hash and 256 bit AES key from disk and stores them
> + * packed together in outbuf. outbuf must be freed
> + * by the caller using buffer_free()
> + */
> +TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashke=
y[HASHKEYSZ]);
> +
> +/* inbuf must contain a sha1 hash followed by a 256 bit AES key.
> + * Encrypts and stores the hash and key to disk */
> +TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashke=
y[HASHKEYSZ]);
> +
> +/* Load the vtpm manager data - call this on startup */
> +TPM_RESULT vtpm_storage_load_header(void);
> +
> +/* Saves the vtpm manager data - call this on shutdown */
> +TPM_RESULT vtpm_storage_new_header(void);
> +
> +
> +#endif
> diff --git a/stubdom/vtpmmgr/vtpmmgr.c b/stubdom/vtpmmgr/vtpmmgr.c
> new file mode 100644
> index 0000000..563f4e8
> --- /dev/null
> +++ b/stubdom/vtpmmgr/vtpmmgr.c
> @@ -0,0 +1,93 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#include <stdint.h>
> +#include <mini-os/tpmback.h>
> +#include <unistd.h>
> +#include <stdio.h>
> +#include <string.h>
> +#include <stdlib.h>
> +#include "log.h"
> +
> +#include "vtpmmgr.h"
> +#include "tcg.h"
> +
> +
> +void main_loop(void) {
> +   tpmcmd_t* tpmcmd;
> +   uint8_t respbuf[TCPA_MAX_BUFFER_LENGTH];
> +
> +   while(1) {
> +      /* Wait for requests from a vtpm */
> +      vtpmloginfo(VTPM_LOG_VTPM, "Waiting for commands from vTPM's:\n"=
);
> +      if((tpmcmd =3D tpmback_req_any()) =3D=3D NULL) {
> +         vtpmlogerror(VTPM_LOG_VTPM, "NULL tpmcmd\n");
> +         continue;
> +      }
> +
> +      tpmcmd->resp =3D respbuf;
> +
> +      /* Process the command */
> +      vtpmmgr_handle_cmd(tpmcmd->uuid, tpmcmd);
> +
> +      /* Send response */
> +      tpmback_resp(tpmcmd);
> +   }
> +}
> +
> +int main(int argc, char** argv)
> +{
> +   int rc =3D 0;
> +   sleep(2);
> +   vtpmloginfo(VTPM_LOG_VTPM, "Starting vTPM manager domain\n");
> +
> +   /* Initialize the vtpm manager */
> +   if(vtpmmgr_init(argc, argv) !=3D TPM_SUCCESS) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize vtpmmgr domain=
!\n");
> +      rc =3D -1;
> +      goto exit;
> +   }
> +
> +   main_loop();
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "vTPM Manager shutting down...\n");
> +
> +   vtpmmgr_shutdown();
> +
> +exit:
> +   return rc;
> +
> +}
> diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
> new file mode 100644
> index 0000000..50a1992
> --- /dev/null
> +++ b/stubdom/vtpmmgr/vtpmmgr.h
> @@ -0,0 +1,77 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#ifndef VTPMMGR_H
> +#define VTPMMGR_H
> +
> +#include <mini-os/tpmback.h>
> +#include <polarssl/entropy.h>
> +#include <polarssl/ctr_drbg.h>
> +
> +#include "uuid.h"
> +#include "tcg.h"
> +#include "vtpm_manager.h"
> +
> +#define RSA_KEY_SIZE 0x0800
> +#define RSA_CIPHER_SIZE (RSA_KEY_SIZE / 8)
> +
> +struct vtpm_globals {
> +   int tpm_fd;
> +   TPM_KEY             storage_key;
> +   TPM_HANDLE          storage_key_handle;       // Key used by persis=
tent store
> +   TPM_AUTH_SESSION    oiap;                // OIAP session for storag=
eKey
> +   TPM_AUTHDATA        storage_key_usage_auth;
> +
> +   TPM_AUTHDATA        owner_auth;
> +   TPM_AUTHDATA        srk_auth;
> +
> +   entropy_context     entropy;
> +   ctr_drbg_context    ctr_drbg;
> +};
> +
> +// --------------------------- Global Values -------------------------=
-
> +extern struct vtpm_globals vtpm_globals;   // Key info and DMI states
> +
> +TPM_RESULT vtpmmgr_init(int argc, char** argv);
> +void vtpmmgr_shutdown(void);
> +
> +TPM_RESULT vtpmmgr_handle_cmd(const uuid_t uuid, tpmcmd_t* tpmcmd);
> +
> +inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes)=
 {
> +   return ctr_drbg_random(&vtpm_globals.ctr_drbg, bytes, num_bytes) =3D=
=3D 0 ? 0 : TPM_FAIL;
> +}
> +
> +#endif
> --
> 1.7.10.4
>



--------------ms080704030001010001060100
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlCwMBAQEBBAoWCGZpb3JhbWUxMBsGDSsGAQQBsyUL
AwEBAQIEChIIMDAxMDQyNjEwWAYJYIZIAYb6ax4BBEsMSVRoZSBwcml2YXRlIGtleSBjb3Jy
ZXNwb25kaW5nIHRvIHRoaXMgY2VydGlmaWNhdGUgbWF5IGhhdmUgYmVlbiBleHBvcnRlZC4w
KAYDVR0RBCEwH4EdTWF0dGhldy5GaW9yYXZhbnRlQGpodWFwbC5lZHUwUgYDVR0fBEswSTBH
oEWgQ6RBMD8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJU0RD
QTEOMAwGA1UEAxMFQ1JMNTYwHwYDVR0jBBgwFoAUCDUpmxH52EU2CyWmF2EJMB1yqeswHQYD
VR0OBBYEFO6LYxg6r9wHZ+zdQtBHn1dZ/YTNMAkGA1UdEwQCMAAwGQYJKoZIhvZ9B0EABAww
ChsEVjcuMQMCBLAwDQYJKoZIhvcNAQEFBQADgYEAJO9HQh4YNChVLzuZqK5ARJARD8JoujGZ
fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEyMDE0MjUxOVowIwYJKoZIhvcNAQkEMRYEFAONLixQwzoLhKP3
k2L24VD9JBdYMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYARV3Wmi+mb394qFYY5i7D2erEwQhzvEn1G
VUDRsCdpu9v+ntpU2j2Xe0gGBTl9IAJp6WVyP+eQ2BNzx+ufNWsMMauOg+lOl400p0W9u5cq
H2AE6aE1OzVsO/66lHkNjIsHIlISebgIFygQFIcTvN6edvvzASWO4rndvJUnJt7b7wAAAAAA
AA==
--------------ms080704030001010001060100--


--===============0475244974786596101==
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.xen.org
http://lists.xen.org/xen-devel

--===============0475244974786596101==--


From xen-devel-bounces@lists.xen.org Tue Nov 20 14:26:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:26:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taolt-0006Os-16; Tue, 20 Nov 2012 14:25:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Taolp-0006OM-R0
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:25:50 +0000
Received: from [85.158.137.99:7504] by server-11.bemta-3.messagelabs.com id
	FB/59-19361-8E29BA05; Tue, 20 Nov 2012 14:25:44 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-12.tower-217.messagelabs.com!1353421533!16731644!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY,UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14905 invoked from network); 20 Nov 2012 14:25:35 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 20 Nov 2012 14:25:35 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157690906;
	Tue, 20 Nov 2012 09:25:23 -0500
Message-ID: <50AB92CF.8040306@jhuapl.edu>
Date: Tue, 20 Nov 2012 09:25:19 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, 
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353421272-24797-2-git-send-email-matthew.fioravante@jhuapl.edu>
In-Reply-To: <1353421272-24797-2-git-send-email-matthew.fioravante@jhuapl.edu>
Subject: Re: [Xen-devel] [PATCH VTPM v4 2/5] add stubdom/vtpmmgr code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0475244974786596101=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============0475244974786596101==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms080704030001010001060100"

This is a cryptographically signed message in MIME format.

--------------ms080704030001010001060100
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

Please be sure to grab this updated version. I fixed an important=20
comment about the disk image format that was out of date.

On 11/20/2012 09:21 AM, Matthew Fioravante wrote:
> Add the code base for vtpmmgrdom. Makefile changes
> next patch.
>
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> ---
>   stubdom/vtpmmgr/Makefile           |   32 ++
>   stubdom/vtpmmgr/init.c             |  553 +++++++++++++++++++++
>   stubdom/vtpmmgr/log.c              |  151 ++++++
>   stubdom/vtpmmgr/log.h              |   85 ++++
>   stubdom/vtpmmgr/marshal.h          |  528 ++++++++++++++++++++
>   stubdom/vtpmmgr/minios.cfg         |   14 +
>   stubdom/vtpmmgr/tcg.h              |  707 +++++++++++++++++++++++++++=

>   stubdom/vtpmmgr/tpm.c              |  938 +++++++++++++++++++++++++++=
+++++++++
>   stubdom/vtpmmgr/tpm.h              |  218 +++++++++
>   stubdom/vtpmmgr/tpmrsa.c           |  175 +++++++
>   stubdom/vtpmmgr/tpmrsa.h           |   67 +++
>   stubdom/vtpmmgr/uuid.h             |   50 ++
>   stubdom/vtpmmgr/vtpm_cmd_handler.c |  152 ++++++
>   stubdom/vtpmmgr/vtpm_manager.h     |   64 +++
>   stubdom/vtpmmgr/vtpm_storage.c     |  794 +++++++++++++++++++++++++++=
+++
>   stubdom/vtpmmgr/vtpm_storage.h     |   68 +++
>   stubdom/vtpmmgr/vtpmmgr.c          |   93 ++++
>   stubdom/vtpmmgr/vtpmmgr.h          |   77 +++
>   18 files changed, 4766 insertions(+)
>   create mode 100644 stubdom/vtpmmgr/Makefile
>   create mode 100644 stubdom/vtpmmgr/init.c
>   create mode 100644 stubdom/vtpmmgr/log.c
>   create mode 100644 stubdom/vtpmmgr/log.h
>   create mode 100644 stubdom/vtpmmgr/marshal.h
>   create mode 100644 stubdom/vtpmmgr/minios.cfg
>   create mode 100644 stubdom/vtpmmgr/tcg.h
>   create mode 100644 stubdom/vtpmmgr/tpm.c
>   create mode 100644 stubdom/vtpmmgr/tpm.h
>   create mode 100644 stubdom/vtpmmgr/tpmrsa.c
>   create mode 100644 stubdom/vtpmmgr/tpmrsa.h
>   create mode 100644 stubdom/vtpmmgr/uuid.h
>   create mode 100644 stubdom/vtpmmgr/vtpm_cmd_handler.c
>   create mode 100644 stubdom/vtpmmgr/vtpm_manager.h
>   create mode 100644 stubdom/vtpmmgr/vtpm_storage.c
>   create mode 100644 stubdom/vtpmmgr/vtpm_storage.h
>   create mode 100644 stubdom/vtpmmgr/vtpmmgr.c
>   create mode 100644 stubdom/vtpmmgr/vtpmmgr.h
>
> diff --git a/stubdom/vtpmmgr/Makefile b/stubdom/vtpmmgr/Makefile
> new file mode 100644
> index 0000000..88c83c3
> --- /dev/null
> +++ b/stubdom/vtpmmgr/Makefile
> @@ -0,0 +1,32 @@
> +# Copyright (c) 2010-2012 United States Government, as represented by
> +# the Secretary of Defense.  All rights reserved.
> +#
> +# THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
> +# ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
> +# INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS=

> +# FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
> +# DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
> +# SOFTWARE.
> +#
> +
> +XEN_ROOT=3D../..
> +
> +PSSL_DIR=3D../polarssl-$(XEN_TARGET_ARCH)/library
> +PSSL_OBJS=3Daes.o sha1.o entropy.o ctr_drbg.o bignum.o sha4.o havege.o=
 timing.o entropy_poll.o
> +
> +TARGET=3Dvtpmmgr.a
> +OBJS=3Dvtpmmgr.o vtpm_cmd_handler.o vtpm_storage.o init.o tpmrsa.o tpm=
=2Eo log.o
> +
> +CFLAGS+=3D-Werror -Iutil -Icrypto -Itcs
> +CFLAGS+=3D-Wno-declaration-after-statement -Wno-unused-label
> +
> +build: $(TARGET)
> +$(TARGET): $(OBJS)
> +       ar -rcs $@ $^ $(foreach obj,$(PSSL_OBJS),$(PSSL_DIR)/$(obj))
> +
> +clean:
> +       rm -f $(TARGET) $(OBJS)
> +
> +distclean: clean
> +
> +.PHONY: clean distclean
> diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
> new file mode 100644
> index 0000000..a158020
> --- /dev/null
> +++ b/stubdom/vtpmmgr/init.c
> @@ -0,0 +1,553 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +#include <stdint.h>
> +#include <stdlib.h>
> +
> +#include <xen/xen.h>
> +#include <mini-os/tpmback.h>
> +#include <mini-os/tpmfront.h>
> +#include <mini-os/tpm_tis.h>
> +#include <unistd.h>
> +#include <stdio.h>
> +#include <string.h>
> +#include <stdlib.h>
> +#include <polarssl/sha1.h>
> +
> +#include "log.h"
> +#include "vtpmmgr.h"
> +#include "vtpm_storage.h"
> +#include "tpm.h"
> +#include "marshal.h"
> +
> +struct Opts {
> +   enum {
> +      TPMDRV_TPM_TIS,
> +      TPMDRV_TPMFRONT,
> +   } tpmdriver;
> +   unsigned long tpmiomem;
> +   unsigned int tpmirq;
> +   unsigned int tpmlocality;
> +   int gen_owner_auth;
> +};
> +
> +// --------------------------- Well Known Auths ----------------------=
----
> +const TPM_AUTHDATA WELLKNOWN_SRK_AUTH =3D {0x00, 0x00, 0x00, 0x00, 0x0=
0, 0x00, 0x00, 0x00, 0x00, 0x00,
> +   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
> +
> +const TPM_AUTHDATA WELLKNOWN_OWNER_AUTH =3D {0xff, 0xff, 0xff, 0xff, 0=
xff, 0xff, 0xff, 0xff, 0xff, 0xff,
> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
> +
> +struct vtpm_globals vtpm_globals =3D {
> +   .tpm_fd =3D -1,
> +   .storage_key =3D TPM_KEY_INIT,
> +   .storage_key_handle =3D 0,
> +   .oiap =3D { .AuthHandle =3D 0 }
> +};
> +
> +static int tpm_entropy_source(void* dummy, unsigned char* data, size_t=
 len, size_t* olen) {
> +   UINT32 sz =3D len;
> +   TPM_RESULT rc =3D TPM_GetRandom(&sz, data);
> +   *olen =3D sz;
> +   return rc =3D=3D TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAIL=
ED;
> +}
> +
> +static TPM_RESULT check_tpm_version(void) {
> +   TPM_RESULT status;
> +   UINT32 rsize;
> +   BYTE* res =3D NULL;
> +   TPM_CAP_VERSION_INFO vinfo;
> +
> +   TPMTRYRETURN(TPM_GetCapability(
> +            TPM_CAP_VERSION_VAL,
> +            0,
> +            NULL,
> +            &rsize,
> +            &res));
> +   if(rsize < 4) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Invalid size returned by GetCapabil=
ity!\n");
> +      status =3D TPM_BAD_PARAMETER;
> +      goto abort_egress;
> +   }
> +
> +   unpack_TPM_CAP_VERSION_INFO(res, &vinfo, UNPACK_ALIAS);
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Hardware TPM:\n");
> +   vtpmloginfo(VTPM_LOG_VTPM, " version: %hhd %hhd %hhd %hhd\n",
> +         vinfo.version.major, vinfo.version.minor, vinfo.version.revMa=
jor, vinfo.version.revMinor);
> +   vtpmloginfo(VTPM_LOG_VTPM, " specLevel: %hd\n", vinfo.specLevel);
> +   vtpmloginfo(VTPM_LOG_VTPM, " errataRev: %hhd\n", vinfo.errataRev);
> +   vtpmloginfo(VTPM_LOG_VTPM, " vendorID: %c%c%c%c\n",
> +         vinfo.tpmVendorID[0], vinfo.tpmVendorID[1],
> +         vinfo.tpmVendorID[2], vinfo.tpmVendorID[3]);
> +   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecificSize: %hd\n", vinfo.vend=
orSpecificSize);
> +   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecific: ");
> +   for(int i =3D 0; i < vinfo.vendorSpecificSize; ++i) {
> +      vtpmloginfomore(VTPM_LOG_VTPM, "%02hhx", vinfo.vendorSpecific[i]=
);
> +   }
> +   vtpmloginfomore(VTPM_LOG_VTPM, "\n");
> +
> +abort_egress:
> +   free(res);
> +   return status;
> +}
> +
> +static TPM_RESULT flush_tpm(void) {
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +   const TPM_RESOURCE_TYPE reslist[] =3D { TPM_RT_KEY, TPM_RT_AUTH, TP=
M_RT_TRANS, TPM_RT_COUNTER, TPM_RT_DAA_TPM, TPM_RT_CONTEXT };
> +   BYTE* keylist =3D NULL;
> +   UINT32 keylistSize;
> +   BYTE* ptr;
> +
> +   //Iterate through each resource type and flush all handles
> +   for(int i =3D 0; i < sizeof(reslist) / sizeof(TPM_RESOURCE_TYPE); +=
+i) {
> +      TPM_RESOURCE_TYPE beres =3D cpu_to_be32(reslist[i]);
> +      UINT16 size;
> +      TPMTRYRETURN(TPM_GetCapability(
> +               TPM_CAP_HANDLE,
> +               sizeof(TPM_RESOURCE_TYPE),
> +               (BYTE*)(&beres),
> +               &keylistSize,
> +               &keylist));
> +
> +      ptr =3D keylist;
> +      ptr =3D unpack_UINT16(ptr, &size);
> +
> +      //Flush each handle
> +      if(size) {
> +         vtpmloginfo(VTPM_LOG_VTPM, "Flushing %u handle(s) of type %lu=
\n", size, (unsigned long) reslist[i]);
> +         for(int j =3D 0; j < size; ++j) {
> +            TPM_HANDLE h;
> +            ptr =3D unpack_TPM_HANDLE(ptr, &h);
> +            TPMTRYRETURN(TPM_FlushSpecific(h, reslist[i]));
> +         }
> +      }
> +
> +      free(keylist);
> +      keylist =3D NULL;
> +   }
> +
> +   goto egress;
> +abort_egress:
> +   free(keylist);
> +egress:
> +   return status;
> +}
> +
> +
> +static TPM_RESULT try_take_ownership(void) {
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +   TPM_PUBKEY pubEK =3D TPM_PUBKEY_INIT;
> +
> +   // If we can read PubEK then there is no owner and we should take i=
t.
> +   status =3D TPM_ReadPubek(&pubEK);
> +
> +   switch(status) {
> +      case TPM_DISABLED_CMD:
> +         //Cannot read ek? TPM has owner
> +         vtpmloginfo(VTPM_LOG_VTPM, "Failed to readEK meaning TPM has =
an owner. Creating Keys off existing SRK.\n");
> +         status =3D TPM_SUCCESS;
> +         break;
> +      case TPM_NO_ENDORSEMENT:
> +         {
> +            //If theres no ek, we have to create one
> +            TPM_KEY_PARMS keyInfo =3D {
> +               .algorithmID =3D TPM_ALG_RSA,
> +               .encScheme =3D TPM_ES_RSAESOAEP_SHA1_MGF1,
> +               .sigScheme =3D TPM_SS_NONE,
> +               .parmSize =3D 12,
> +               .parms.rsa =3D {
> +                  .keyLength =3D RSA_KEY_SIZE,
> +                  .numPrimes =3D 2,
> +                  .exponentSize =3D 0,
> +                  .exponent =3D NULL,
> +               },
> +            };
> +            TPMTRYRETURN(TPM_CreateEndorsementKeyPair(&keyInfo, &pubEK=
));
> +         }
> +         //fall through to take ownership
> +      case TPM_SUCCESS:
> +         {
> +            //Construct the Srk
> +            TPM_KEY srk =3D {
> +               .ver =3D TPM_STRUCT_VER_1_1,
> +               .keyUsage =3D TPM_KEY_STORAGE,
> +               .keyFlags =3D 0x00,
> +               .authDataUsage =3D TPM_AUTH_ALWAYS,
> +               .algorithmParms =3D {
> +                  .algorithmID =3D TPM_ALG_RSA,
> +                  .encScheme =3D TPM_ES_RSAESOAEP_SHA1_MGF1,
> +                  .sigScheme =3D  TPM_SS_NONE,
> +                  .parmSize =3D 12,
> +                  .parms.rsa =3D {
> +                     .keyLength =3D RSA_KEY_SIZE,
> +                     .numPrimes =3D 2,
> +                     .exponentSize =3D 0,
> +                     .exponent =3D NULL,
> +                  },
> +               },
> +               .PCRInfoSize =3D 0,
> +               .pubKey =3D {
> +                  .keyLength =3D 0,
> +                  .key =3D NULL,
> +               },
> +               .encDataSize =3D 0,
> +            };
> +
> +            TPMTRYRETURN(TPM_TakeOwnership(
> +                     &pubEK,
> +                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
> +                     (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
> +                     &srk,
> +                     NULL,
> +                     &vtpm_globals.oiap));
> +
> +            TPMTRYRETURN(TPM_DisablePubekRead(
> +                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
> +                     &vtpm_globals.oiap));
> +         }
> +         break;
> +      default:
> +         break;
> +   }
> +abort_egress:
> +   free_TPM_PUBKEY(&pubEK);
> +   return status;
> +}
> +
> +static void init_storage_key(TPM_KEY* key) {
> +   key->ver.major =3D 1;
> +   key->ver.minor =3D 1;
> +   key->ver.revMajor =3D 0;
> +   key->ver.revMinor =3D 0;
> +
> +   key->keyUsage =3D TPM_KEY_BIND;
> +   key->keyFlags =3D 0;
> +   key->authDataUsage =3D TPM_AUTH_ALWAYS;
> +
> +   TPM_KEY_PARMS* p =3D &key->algorithmParms;
> +   p->algorithmID =3D TPM_ALG_RSA;
> +   p->encScheme =3D TPM_ES_RSAESOAEP_SHA1_MGF1;
> +   p->sigScheme =3D TPM_SS_NONE;
> +   p->parmSize =3D 12;
> +
> +   TPM_RSA_KEY_PARMS* r =3D &p->parms.rsa;
> +   r->keyLength =3D RSA_KEY_SIZE;
> +   r->numPrimes =3D 2;
> +   r->exponentSize =3D 0;
> +   r->exponent =3D NULL;
> +
> +   key->PCRInfoSize =3D 0;
> +   key->encDataSize =3D 0;
> +   key->encData =3D NULL;
> +}
> +
> +static int parse_auth_string(char* authstr, BYTE* target, const TPM_AU=
THDATA wellknown, int allowrandom) {
> +   int rc;
> +   /* well known owner auth */
> +   if(!strcmp(authstr, "well-known")) {
> +      memcpy(target, wellknown, sizeof(TPM_AUTHDATA));
> +   }
> +   /* Create a randomly generated owner auth */
> +   else if(allowrandom && !strcmp(authstr, "random")) {
> +      return 1;
> +   }
> +   /* owner auth is a raw hash */
> +   else if(!strncmp(authstr, "hash:", 5)) {
> +      authstr +=3D 5;
> +      if((rc =3D strlen(authstr)) !=3D 40) {
> +         vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth hex string `=
%s' must be exactly 40 characters (20 bytes) long, length=3D%d\n", authst=
r, rc);
> +         return -1;
> +      }
> +      for(int j =3D 0; j < 20; ++j) {
> +         if(sscanf(authstr, "%hhX", target + j) !=3D 1) {
> +            vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth string `%=
s' is not a valid hex string\n", authstr);
> +            return -1;
> +         }
> +         authstr +=3D 2;
> +      }
> +   }
> +   /* owner auth is a string that will be hashed */
> +   else if(!strncmp(authstr, "text:", 5)) {
> +      authstr +=3D 5;
> +      sha1((const unsigned char*)authstr, strlen(authstr), target);
> +   }
> +   else {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Invalid auth string %s\n", authstr)=
;
> +      return -1;
> +   }
> +
> +   return 0;
> +}
> +
> +int parse_cmdline_opts(int argc, char** argv, struct Opts* opts)
> +{
> +   int rc;
> +   int i;
> +
> +   //Set defaults
> +   memcpy(vtpm_globals.owner_auth, WELLKNOWN_OWNER_AUTH, sizeof(TPM_AU=
THDATA));
> +   memcpy(vtpm_globals.srk_auth, WELLKNOWN_SRK_AUTH, sizeof(TPM_AUTHDA=
TA));
> +
> +   for(i =3D 1; i < argc; ++i) {
> +      if(!strncmp(argv[i], "owner_auth:", 10)) {
> +         if((rc =3D parse_auth_string(argv[i] + 10, vtpm_globals.owner=
_auth, WELLKNOWN_OWNER_AUTH, 1)) < 0) {
> +            goto err_invalid;
> +         }
> +         if(rc =3D=3D 1) {
> +            opts->gen_owner_auth =3D 1;
> +         }
> +      }
> +      else if(!strncmp(argv[i], "srk_auth:", 8)) {
> +         if((rc =3D parse_auth_string(argv[i] + 8, vtpm_globals.srk_au=
th, WELLKNOWN_SRK_AUTH, 0)) !=3D 0) {
> +            goto err_invalid;
> +         }
> +      }
> +      else if(!strncmp(argv[i], "tpmdriver=3D", 10)) {
> +         if(!strcmp(argv[i] + 10, "tpm_tis")) {
> +            opts->tpmdriver =3D TPMDRV_TPM_TIS;
> +         } else if(!strcmp(argv[i] + 10, "tpmfront")) {
> +            opts->tpmdriver =3D TPMDRV_TPMFRONT;
> +         } else {
> +            goto err_invalid;
> +         }
> +      }
> +      else if(!strncmp(argv[i], "tpmiomem=3D",9)) {
> +         if(sscanf(argv[i] + 9, "0x%lX", &opts->tpmiomem) !=3D 1) {
> +            goto err_invalid;
> +         }
> +      }
> +      else if(!strncmp(argv[i], "tpmirq=3D",7)) {
> +         if(!strcmp(argv[i] + 7, "probe")) {
> +            opts->tpmirq =3D TPM_PROBE_IRQ;
> +         } else if( sscanf(argv[i] + 7, "%u", &opts->tpmirq) !=3D 1) {=

> +            goto err_invalid;
> +         }
> +      }
> +      else if(!strncmp(argv[i], "tpmlocality=3D",12)) {
> +         if(sscanf(argv[i] + 12, "%u", &opts->tpmlocality) !=3D 1 || o=
pts->tpmlocality > 4) {
> +            goto err_invalid;
> +         }
> +      }
> +   }
> +
> +   switch(opts->tpmdriver) {
> +      case TPMDRV_TPM_TIS:
> +         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpm_tis driver\n");=

> +         break;
> +      case TPMDRV_TPMFRONT:
> +         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpmfront driver\n")=
;
> +         break;
> +   }
> +
> +   return 0;
> +err_invalid:
> +   vtpmlogerror(VTPM_LOG_VTPM, "Invalid Option %s\n", argv[i]);
> +   return -1;
> +}
> +
> +
> +
> +static TPM_RESULT vtpmmgr_create(void) {
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +   TPM_AUTH_SESSION osap =3D TPM_AUTH_SESSION_INIT;
> +   TPM_AUTHDATA sharedsecret;
> +
> +   // Take ownership if TPM is unowned
> +   TPMTRYRETURN(try_take_ownership());
> +
> +   // Generate storage key's auth
> +   memset(&vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA=
));
> +
> +   TPMTRYRETURN( TPM_OSAP(
> +            TPM_ET_KEYHANDLE,
> +            TPM_SRK_KEYHANDLE,
> +            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
> +            &sharedsecret,
> +            &osap) );
> +
> +   init_storage_key(&vtpm_globals.storage_key);
> +
> +   //initialize the storage key
> +   TPMTRYRETURN( TPM_CreateWrapKey(
> +            TPM_SRK_KEYHANDLE,
> +            (const TPM_AUTHDATA*)&sharedsecret,
> +            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,=

> +            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,=

> +            &vtpm_globals.storage_key,
> +            &osap) );
> +
> +   //Load Storage Key
> +   TPMTRYRETURN( TPM_LoadKey(
> +            TPM_SRK_KEYHANDLE,
> +            &vtpm_globals.storage_key,
> +            &vtpm_globals.storage_key_handle,
> +            (const TPM_AUTHDATA*) &vtpm_globals.srk_auth,
> +            &vtpm_globals.oiap));
> +
> +   //Make sure TPM has commited changes
> +   TPMTRYRETURN( TPM_SaveState() );
> +
> +   //Create new disk image
> +   TPMTRYRETURN(vtpm_storage_new_header());
> +
> +   goto egress;
> +abort_egress:
> +egress:
> +   vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager\n=
");
> +
> +   //End the OSAP session
> +   if(osap.AuthHandle) {
> +      TPM_TerminateHandle(osap.AuthHandle);
> +   }
> +
> +   return status;
> +}
> +
> +TPM_RESULT vtpmmgr_init(int argc, char** argv) {
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +
> +   /* Default commandline options */
> +   struct Opts opts =3D {
> +      .tpmdriver =3D TPMDRV_TPM_TIS,
> +      .tpmiomem =3D TPM_BASEADDR,
> +      .tpmirq =3D 0,
> +      .tpmlocality =3D 0,
> +      .gen_owner_auth =3D 0,
> +   };
> +
> +   if(parse_cmdline_opts(argc, argv, &opts) !=3D 0) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Command line parsing failed! exitin=
g..\n");
> +      status =3D TPM_BAD_PARAMETER;
> +      goto abort_egress;
> +   }
> +
> +   //Setup storage system
> +   if(vtpm_storage_init() !=3D 0) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize storage subsys=
tem!\n");
> +      status =3D TPM_IOERROR;
> +      goto abort_egress;
> +   }
> +
> +   //Setup tpmback device
> +   init_tpmback();
> +
> +   //Setup tpm access
> +   switch(opts.tpmdriver) {
> +      case TPMDRV_TPM_TIS:
> +         {
> +            struct tpm_chip* tpm;
> +            if((tpm =3D init_tpm_tis(opts.tpmiomem, TPM_TIS_LOCL_INT_T=
O_FLAG(opts.tpmlocality), opts.tpmirq)) =3D=3D NULL) {
> +               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfr=
ont device\n");
> +               status =3D TPM_IOERROR;
> +               goto abort_egress;
> +            }
> +            vtpm_globals.tpm_fd =3D tpm_tis_open(tpm);
> +            tpm_tis_request_locality(tpm, opts.tpmlocality);
> +         }
> +         break;
> +      case TPMDRV_TPMFRONT:
> +         {
> +            struct tpmfront_dev* tpmfront_dev;
> +            if((tpmfront_dev =3D init_tpmfront(NULL)) =3D=3D NULL) {
> +               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfr=
ont device\n");
> +               status =3D TPM_IOERROR;
> +               goto abort_egress;
> +            }
> +            vtpm_globals.tpm_fd =3D tpmfront_open(tpmfront_dev);
> +         }
> +         break;
> +   }
> +
> +   //Get the version of the tpm
> +   TPMTRYRETURN(check_tpm_version());
> +
> +   // Blow away all stale handles left in the tpm
> +   if(flush_tpm() !=3D TPM_SUCCESS) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_FlushResources failed, continu=
ing anyway..\n");
> +   }
> +
> +   /* Initialize the rng */
> +   entropy_init(&vtpm_globals.entropy);
> +   entropy_add_source(&vtpm_globals.entropy, tpm_entropy_source, NULL,=
 0);
> +   entropy_gather(&vtpm_globals.entropy);
> +   ctr_drbg_init(&vtpm_globals.ctr_drbg, entropy_func, &vtpm_globals.e=
ntropy, NULL, 0);
> +   ctr_drbg_set_prediction_resistance( &vtpm_globals.ctr_drbg, CTR_DRB=
G_PR_OFF );
> +
> +   // Generate Auth for Owner
> +   if(opts.gen_owner_auth) {
> +      vtpmmgr_rand(vtpm_globals.owner_auth, sizeof(TPM_AUTHDATA));
> +   }
> +
> +   // Create OIAP session for service's authorized commands
> +   TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
> +
> +   /* Load the Manager data, if it fails create a new manager */
> +   if (vtpm_storage_load_header() !=3D TPM_SUCCESS) {
> +      /* If the OIAP session was closed by an error, create a new one =
*/
> +      if(vtpm_globals.oiap.AuthHandle =3D=3D 0) {
> +         TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
> +      }
> +      vtpmloginfo(VTPM_LOG_VTPM, "Failed to read manager file. Assumin=
g first time initialization.\n");
> +      TPMTRYRETURN( vtpmmgr_create() );
> +   }
> +
> +   goto egress;
> +abort_egress:
> +   vtpmmgr_shutdown();
> +egress:
> +   return status;
> +}
> +
> +void vtpmmgr_shutdown(void)
> +{
> +   /* Cleanup resources */
> +   free_TPM_KEY(&vtpm_globals.storage_key);
> +
> +   /* Cleanup TPM resources */
> +   TPM_EvictKey(vtpm_globals.storage_key_handle);
> +   TPM_TerminateHandle(vtpm_globals.oiap.AuthHandle);
> +
> +   /* Close tpmback */
> +   shutdown_tpmback();
> +
> +   /* Close the storage system and blkfront */
> +   vtpm_storage_shutdown();
> +
> +   /* Close tpmfront/tpm_tis */
> +   close(vtpm_globals.tpm_fd);
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
> +}
> diff --git a/stubdom/vtpmmgr/log.c b/stubdom/vtpmmgr/log.c
> new file mode 100644
> index 0000000..a82c913
> --- /dev/null
> +++ b/stubdom/vtpmmgr/log.c
> @@ -0,0 +1,151 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#include <stdlib.h>
> +#include <string.h>
> +#include <stdio.h>
> +
> +#include "tcg.h"
> +
> +char *module_names[] =3D { "",
> +                                "TPM",
> +                                "TPM",
> +                                "VTPM",
> +                                "VTPM",
> +                                "TXDATA",
> +                              };
> +// Helper code for the consts, eg. to produce messages for error codes=
=2E
> +
> +typedef struct error_code_entry_t {
> +  TPM_RESULT code;
> +  char * code_name;
> +  char * msg;
> +} error_code_entry_t;
> +
> +static const error_code_entry_t error_msgs [] =3D {
> +  { TPM_SUCCESS, "TPM_SUCCESS", "Successful completion of the operatio=
n" },
> +  { TPM_AUTHFAIL, "TPM_AUTHFAIL", "Authentication failed" },
> +  { TPM_BADINDEX, "TPM_BADINDEX", "The index to a PCR, DIR or other re=
gister is incorrect" },
> +  { TPM_BAD_PARAMETER, "TPM_BAD_PARAMETER", "One or more parameter is =
bad" },
> +  { TPM_AUDITFAILURE, "TPM_AUDITFAILURE", "An operation completed succ=
essfully but the auditing of that operation failed." },
> +  { TPM_CLEAR_DISABLED, "TPM_CLEAR_DISABLED", "The clear disable flag =
is set and all clear operations now require physical access" },
> +  { TPM_DEACTIVATED, "TPM_DEACTIVATED", "The TPM is deactivated" },
> +  { TPM_DISABLED, "TPM_DISABLED", "The TPM is disabled" },
> +  { TPM_DISABLED_CMD, "TPM_DISABLED_CMD", "The target command has been=
 disabled" },
> +  { TPM_FAIL, "TPM_FAIL", "The operation failed" },
> +  { TPM_BAD_ORDINAL, "TPM_BAD_ORDINAL", "The ordinal was unknown or in=
consistent" },
> +  { TPM_INSTALL_DISABLED, "TPM_INSTALL_DISABLED", "The ability to inst=
all an owner is disabled" },
> +  { TPM_INVALID_KEYHANDLE, "TPM_INVALID_KEYHANDLE", "The key handle pr=
esented was invalid" },
> +  { TPM_KEYNOTFOUND, "TPM_KEYNOTFOUND", "The target key was not found"=
 },
> +  { TPM_INAPPROPRIATE_ENC, "TPM_INAPPROPRIATE_ENC", "Unacceptable encr=
yption scheme" },
> +  { TPM_MIGRATEFAIL, "TPM_MIGRATEFAIL", "Migration authorization faile=
d" },
> +  { TPM_INVALID_PCR_INFO, "TPM_INVALID_PCR_INFO", "PCR information cou=
ld not be interpreted" },
> +  { TPM_NOSPACE, "TPM_NOSPACE", "No room to load key." },
> +  { TPM_NOSRK, "TPM_NOSRK", "There is no SRK set" },
> +  { TPM_NOTSEALED_BLOB, "TPM_NOTSEALED_BLOB", "An encrypted blob is in=
valid or was not created by this TPM" },
> +  { TPM_OWNER_SET, "TPM_OWNER_SET", "There is already an Owner" },
> +  { TPM_RESOURCES, "TPM_RESOURCES", "The TPM has insufficient internal=
 resources to perform the requested action." },
> +  { TPM_SHORTRANDOM, "TPM_SHORTRANDOM", "A random string was too short=
" },
> +  { TPM_SIZE, "TPM_SIZE", "The TPM does not have the space to perform =
the operation." },
> +  { TPM_WRONGPCRVAL, "TPM_WRONGPCRVAL", "The named PCR value does not =
match the current PCR value." },
> +  { TPM_BAD_PARAM_SIZE, "TPM_BAD_PARAM_SIZE", "The paramSize argument =
to the command has the incorrect value" },
> +  { TPM_SHA_THREAD, "TPM_SHA_THREAD", "There is no existing SHA-1 thre=
ad." },
> +  { TPM_SHA_ERROR, "TPM_SHA_ERROR", "The calculation is unable to proc=
eed because the existing SHA-1 thread has already encountered an error." =
},
> +  { TPM_FAILEDSELFTEST, "TPM_FAILEDSELFTEST", "Self-test has failed an=
d the TPM has shutdown." },
> +  { TPM_AUTH2FAIL, "TPM_AUTH2FAIL", "The authorization for the second =
key in a 2 key function failed authorization" },
> +  { TPM_BADTAG, "TPM_BADTAG", "The tag value sent to for a command is =
invalid" },
> +  { TPM_IOERROR, "TPM_IOERROR", "An IO error occurred transmitting inf=
ormation to the TPM" },
> +  { TPM_ENCRYPT_ERROR, "TPM_ENCRYPT_ERROR", "The encryption process ha=
d a problem." },
> +  { TPM_DECRYPT_ERROR, "TPM_DECRYPT_ERROR", "The decryption process di=
d not complete." },
> +  { TPM_INVALID_AUTHHANDLE, "TPM_INVALID_AUTHHANDLE", "An invalid hand=
le was used." },
> +  { TPM_NO_ENDORSEMENT, "TPM_NO_ENDORSEMENT", "The TPM does not a EK i=
nstalled" },
> +  { TPM_INVALID_KEYUSAGE, "TPM_INVALID_KEYUSAGE", "The usage of a key =
is not allowed" },
> +  { TPM_WRONG_ENTITYTYPE, "TPM_WRONG_ENTITYTYPE", "The submitted entit=
y type is not allowed" },
> +  { TPM_INVALID_POSTINIT, "TPM_INVALID_POSTINIT", "The command was rec=
eived in the wrong sequence relative to TPM_Init and a subsequent TPM_Sta=
rtup" },
> +  { TPM_INAPPROPRIATE_SIG, "TPM_INAPPROPRIATE_SIG", "Signed data canno=
t include additional DER information" },
> +  { TPM_BAD_KEY_PROPERTY, "TPM_BAD_KEY_PROPERTY", "The key properties =
in TPM_KEY_PARMs are not supported by this TPM" },
> +
> +  { TPM_BAD_MIGRATION, "TPM_BAD_MIGRATION", "The migration properties =
of this key are incorrect." },
> +  { TPM_BAD_SCHEME, "TPM_BAD_SCHEME", "The signature or encryption sch=
eme for this key is incorrect or not permitted in this situation." },
> +  { TPM_BAD_DATASIZE, "TPM_BAD_DATASIZE", "The size of the data (or bl=
ob) parameter is bad or inconsistent with the referenced key" },
> +  { TPM_BAD_MODE, "TPM_BAD_MODE", "A mode parameter is bad, such as ca=
pArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for =
TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob." },
> +  { TPM_BAD_PRESENCE, "TPM_BAD_PRESENCE", "Either the physicalPresence=
 or physicalPresenceLock bits have the wrong value" },
> +  { TPM_BAD_VERSION, "TPM_BAD_VERSION", "The TPM cannot perform this v=
ersion of the capability" },
> +  { TPM_NO_WRAP_TRANSPORT, "TPM_NO_WRAP_TRANSPORT", "The TPM does not =
allow for wrapped transport sessions" },
> +  { TPM_AUDITFAIL_UNSUCCESSFUL, "TPM_AUDITFAIL_UNSUCCESSFUL", "TPM aud=
it construction failed and the underlying command was returning a failure=
 code also" },
> +  { TPM_AUDITFAIL_SUCCESSFUL, "TPM_AUDITFAIL_SUCCESSFUL", "TPM audit c=
onstruction failed and the underlying command was returning success" },
> +  { TPM_NOTRESETABLE, "TPM_NOTRESETABLE", "Attempt to reset a PCR regi=
ster that does not have the resettable attribute" },
> +  { TPM_NOTLOCAL, "TPM_NOTLOCAL", "Attempt to reset a PCR register tha=
t requires locality and locality modifier not part of command transport" =
},
> +  { TPM_BAD_TYPE, "TPM_BAD_TYPE", "Make identity blob not properly typ=
ed" },
> +  { TPM_INVALID_RESOURCE, "TPM_INVALID_RESOURCE", "When saving context=
 identified resource type does not match actual resource" },
> +  { TPM_NOTFIPS, "TPM_NOTFIPS", "The TPM is attempting to execute a co=
mmand only available when in FIPS mode" },
> +  { TPM_INVALID_FAMILY, "TPM_INVALID_FAMILY", "The command is attempti=
ng to use an invalid family ID" },
> +  { TPM_NO_NV_PERMISSION, "TPM_NO_NV_PERMISSION", "The permission to m=
anipulate the NV storage is not available" },
> +  { TPM_REQUIRES_SIGN, "TPM_REQUIRES_SIGN", "The operation requires a =
signed command" },
> +  { TPM_KEY_NOTSUPPORTED, "TPM_KEY_NOTSUPPORTED", "Wrong operation to =
load an NV key" },
> +  { TPM_AUTH_CONFLICT, "TPM_AUTH_CONFLICT", "NV_LoadKey blob requires =
both owner and blob authorization" },
> +  { TPM_AREA_LOCKED, "TPM_AREA_LOCKED", "The NV area is locked and not=
 writtable" },
> +  { TPM_BAD_LOCALITY, "TPM_BAD_LOCALITY", "The locality is incorrect f=
or the attempted operation" },
> +  { TPM_READ_ONLY, "TPM_READ_ONLY", "The NV area is read only and can'=
t be written to" },
> +  { TPM_PER_NOWRITE, "TPM_PER_NOWRITE", "There is no protection on the=
 write to the NV area" },
> +  { TPM_FAMILYCOUNT, "TPM_FAMILYCOUNT", "The family count value does n=
ot match" },
> +  { TPM_WRITE_LOCKED, "TPM_WRITE_LOCKED", "The NV area has already bee=
n written to" },
> +  { TPM_BAD_ATTRIBUTES, "TPM_BAD_ATTRIBUTES", "The NV area attributes =
conflict" },
> +  { TPM_INVALID_STRUCTURE, "TPM_INVALID_STRUCTURE", "The structure tag=
 and version are invalid or inconsistent" },
> +  { TPM_KEY_OWNER_CONTROL, "TPM_KEY_OWNER_CONTROL", "The key is under =
control of the TPM Owner and can only be evicted by the TPM Owner." },
> +  { TPM_BAD_COUNTER, "TPM_BAD_COUNTER", "The counter handle is incorre=
ct" },
> +  { TPM_NOT_FULLWRITE, "TPM_NOT_FULLWRITE", "The write is not a comple=
te write of the area" },
> +  { TPM_CONTEXT_GAP, "TPM_CONTEXT_GAP", "The gap between saved context=
 counts is too large" },
> +  { TPM_MAXNVWRITES, "TPM_MAXNVWRITES", "The maximum number of NV writ=
es without an owner has been exceeded" },
> +  { TPM_NOOPERATOR, "TPM_NOOPERATOR", "No operator authorization value=
 is set" },
> +  { TPM_RESOURCEMISSING, "TPM_RESOURCEMISSING", "The resource pointed =
to by context is not loaded" },
> +  { TPM_DELEGATE_LOCK, "TPM_DELEGATE_LOCK", "The delegate administrati=
on is locked" },
> +  { TPM_DELEGATE_FAMILY, "TPM_DELEGATE_FAMILY", "Attempt to manage a f=
amily other then the delegated family" },
> +  { TPM_DELEGATE_ADMIN, "TPM_DELEGATE_ADMIN", "Delegation table manage=
ment not enabled" },
> +  { TPM_TRANSPORT_EXCLUSIVE, "TPM_TRANSPORT_EXCLUSIVE", "There was a c=
ommand executed outside of an exclusive transport session" },
> +};
> +
> +
> +// helper function for the error codes:
> +const char* tpm_get_error_name (TPM_RESULT code) {
> +  // just do a linear scan for now
> +  unsigned i;
> +  for (i =3D 0; i < sizeof(error_msgs)/sizeof(error_msgs[0]); i++)
> +    if (code =3D=3D error_msgs[i].code)
> +      return error_msgs[i].code_name;
> +
> +    return("Unknown Error Code");
> +}
> diff --git a/stubdom/vtpmmgr/log.h b/stubdom/vtpmmgr/log.h
> new file mode 100644
> index 0000000..5c7abf5
> --- /dev/null
> +++ b/stubdom/vtpmmgr/log.h
> @@ -0,0 +1,85 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#ifndef __VTPM_LOG_H__
> +#define __VTPM_LOG_H__
> +
> +#include <stdint.h>             // for uint32_t
> +#include <stddef.h>             // for pointer NULL
> +#include <stdio.h>
> +#include "tcg.h"
> +
> +// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D LOGGING =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> +
> +// the logging module numbers
> +#define VTPM_LOG_TPM         1
> +#define VTPM_LOG_TPM_DEEP    2
> +#define VTPM_LOG_VTPM        3
> +#define VTPM_LOG_VTPM_DEEP   4
> +#define VTPM_LOG_TXDATA      5
> +
> +extern char *module_names[];
> +
> +// Default to standard logging
> +#ifndef LOGGING_MODULES
> +#define LOGGING_MODULES (BITMASK(VTPM_LOG_VTPM)|BITMASK(VTPM_LOG_TPM))=

> +#endif
> +
> +// bit-access macros
> +#define BITMASK(idx)      ( 1U << (idx) )
> +#define GETBIT(num,idx)   ( ((num) & BITMASK(idx)) >> idx )
> +#define SETBIT(num,idx)   (num) |=3D BITMASK(idx)
> +#define CLEARBIT(num,idx) (num) &=3D ( ~ BITMASK(idx) )
> +
> +#define vtpmloginfo(module, fmt, args...) \
> +  if (GETBIT (LOGGING_MODULES, module) =3D=3D 1) {                    =
     \
> +    fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); =
\
> +  }
> +
> +#define vtpmloginfomore(module, fmt, args...) \
> +  if (GETBIT (LOGGING_MODULES, module) =3D=3D 1) {                    =
   \
> +    fprintf (stdout, fmt,##args);                                    \=

> +  }
> +
> +#define vtpmlogerror(module, fmt, args...) \
> +  fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
> +
> +//typedef UINT32 tpm_size_t;
> +
> +// helper function for the error codes:
> +const char* tpm_get_error_name (TPM_RESULT code);
> +
> +#endif // _VTPM_LOG_H_
> diff --git a/stubdom/vtpmmgr/marshal.h b/stubdom/vtpmmgr/marshal.h
> new file mode 100644
> index 0000000..77d32f0
> --- /dev/null
> +++ b/stubdom/vtpmmgr/marshal.h
> @@ -0,0 +1,528 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#ifndef MARSHAL_H
> +#define MARSHAL_H
> +
> +#include <stdlib.h>
> +#include <mini-os/byteorder.h>
> +#include <mini-os/endian.h>
> +#include "tcg.h"
> +
> +typedef enum UnpackPtr {
> +   UNPACK_ALIAS,
> +   UNPACK_ALLOC
> +} UnpackPtr;
> +
> +inline BYTE* pack_BYTE(BYTE* ptr, BYTE t) {
> +   ptr[0] =3D t;
> +   return ++ptr;
> +}
> +
> +inline BYTE* unpack_BYTE(BYTE* ptr, BYTE* t) {
> +   t[0] =3D ptr[0];
> +   return ++ptr;
> +}
> +
> +#define pack_BOOL(p, t) pack_BYTE(p, t)
> +#define unpack_BOOL(p, t) unpack_BYTE(p, t)
> +
> +inline BYTE* pack_UINT16(BYTE* ptr, UINT16 t) {
> +   BYTE* b =3D (BYTE*)&t;
> +#if __BYTE_ORDER =3D=3D __LITTLE_ENDIAN
> +   ptr[0] =3D b[1];
> +   ptr[1] =3D b[0];
> +#elif __BYTE_ORDER =3D=3D __BIG_ENDIAN
> +   ptr[0] =3D b[0];
> +   ptr[1] =3D b[1];
> +#endif
> +   return ptr + sizeof(UINT16);
> +}
> +
> +inline BYTE* unpack_UINT16(BYTE* ptr, UINT16* t) {
> +   BYTE* b =3D (BYTE*)t;
> +#if __BYTE_ORDER =3D=3D __LITTLE_ENDIAN
> +   b[0] =3D ptr[1];
> +   b[1] =3D ptr[0];
> +#elif __BYTE_ORDER =3D=3D __BIG_ENDIAN
> +   b[0] =3D ptr[0];
> +   b[1] =3D ptr[1];
> +#endif
> +   return ptr + sizeof(UINT16);
> +}
> +
> +inline BYTE* pack_UINT32(BYTE* ptr, UINT32 t) {
> +   BYTE* b =3D (BYTE*)&t;
> +#if __BYTE_ORDER =3D=3D __LITTLE_ENDIAN
> +   ptr[3] =3D b[0];
> +   ptr[2] =3D b[1];
> +   ptr[1] =3D b[2];
> +   ptr[0] =3D b[3];
> +#elif __BYTE_ORDER =3D=3D __BIG_ENDIAN
> +   ptr[0] =3D b[0];
> +   ptr[1] =3D b[1];
> +   ptr[2] =3D b[2];
> +   ptr[3] =3D b[3];
> +#endif
> +   return ptr + sizeof(UINT32);
> +}
> +
> +inline BYTE* unpack_UINT32(BYTE* ptr, UINT32* t) {
> +   BYTE* b =3D (BYTE*)t;
> +#if __BYTE_ORDER =3D=3D __LITTLE_ENDIAN
> +   b[0] =3D ptr[3];
> +   b[1] =3D ptr[2];
> +   b[2] =3D ptr[1];
> +   b[3] =3D ptr[0];
> +#elif __BYTE_ORDER =3D=3D __BIG_ENDIAN
> +   b[0] =3D ptr[0];
> +   b[1] =3D ptr[1];
> +   b[2] =3D ptr[2];
> +   b[3] =3D ptr[3];
> +#endif
> +   return ptr + sizeof(UINT32);
> +}
> +
> +#define pack_TPM_RESULT(p, t) pack_UINT32(p, t)
> +#define pack_TPM_PCRINDEX(p, t) pack_UINT32(p, t)
> +#define pack_TPM_DIRINDEX(p, t) pack_UINT32(p, t)
> +#define pack_TPM_HANDLE(p, t) pack_UINT32(p, t)
> +#define pack_TPM_AUTHHANDLE(p, t) pack_TPM_HANDLE(p, t)
> +#define pack_TCPA_HASHHANDLE(p, t) pack_TPM_HANDLE(p, t)
> +#define pack_TCPA_HMACHANDLE(p, t) pack_TPM_HANDLE(p, t)
> +#define pack_TCPA_ENCHANDLE(p, t) pack_TPM_HANDLE(p, t)
> +#define pack_TPM_KEY_HANDLE(p, t) pack_TPM_HANDLE(p, t)
> +#define pack_TCPA_ENTITYHANDLE(p, t) pack_TPM_HANDLE(p, t)
> +#define pack_TPM_RESOURCE_TYPE(p, t) pack_UINT32(p, t)
> +#define pack_TPM_COMMAND_CODE(p, t) pack_UINT32(p, t)
> +#define pack_TPM_PROTOCOL_ID(p, t) pack_UINT16(p, t)
> +#define pack_TPM_AUTH_DATA_USAGE(p, t) pack_BYTE(p, t)
> +#define pack_TPM_ENTITY_TYPE(p, t) pack_UINT16(p, t)
> +#define pack_TPM_ALGORITHM_ID(p, t) pack_UINT32(p, t)
> +#define pack_TPM_KEY_USAGE(p, t) pack_UINT16(p, t)
> +#define pack_TPM_STARTUP_TYPE(p, t) pack_UINT16(p, t)
> +#define pack_TPM_CAPABILITY_AREA(p, t) pack_UINT32(p, t)
> +#define pack_TPM_ENC_SCHEME(p, t) pack_UINT16(p, t)
> +#define pack_TPM_SIG_SCHEME(p, t) pack_UINT16(p, t)
> +#define pack_TPM_MIGRATE_SCHEME(p, t) pack_UINT16(p, t)
> +#define pack_TPM_PHYSICAL_PRESENCE(p, t) pack_UINT16(p, t)
> +#define pack_TPM_KEY_FLAGS(p, t) pack_UINT32(p, t)
> +
> +#define unpack_TPM_RESULT(p, t) unpack_UINT32(p, t)
> +#define unpack_TPM_PCRINDEX(p, t) unpack_UINT32(p, t)
> +#define unpack_TPM_DIRINDEX(p, t) unpack_UINT32(p, t)
> +#define unpack_TPM_HANDLE(p, t) unpack_UINT32(p, t)
> +#define unpack_TPM_AUTHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
> +#define unpack_TCPA_HASHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
> +#define unpack_TCPA_HMACHANDLE(p, t) unpack_TPM_HANDLE(p, t)
> +#define unpack_TCPA_ENCHANDLE(p, t) unpack_TPM_HANDLE(p, t)
> +#define unpack_TPM_KEY_HANDLE(p, t) unpack_TPM_HANDLE(p, t)
> +#define unpack_TCPA_ENTITYHANDLE(p, t) unpack_TPM_HANDLE(p, t)
> +#define unpack_TPM_RESOURCE_TYPE(p, t) unpack_UINT32(p, t)
> +#define unpack_TPM_COMMAND_CODE(p, t) unpack_UINT32(p, t)
> +#define unpack_TPM_PROTOCOL_ID(p, t) unpack_UINT16(p, t)
> +#define unpack_TPM_AUTH_DATA_USAGE(p, t) unpack_BYTE(p, t)
> +#define unpack_TPM_ENTITY_TYPE(p, t) unpack_UINT16(p, t)
> +#define unpack_TPM_ALGORITHM_ID(p, t) unpack_UINT32(p, t)
> +#define unpack_TPM_KEY_USAGE(p, t) unpack_UINT16(p, t)
> +#define unpack_TPM_STARTUP_TYPE(p, t) unpack_UINT16(p, t)
> +#define unpack_TPM_CAPABILITY_AREA(p, t) unpack_UINT32(p, t)
> +#define unpack_TPM_ENC_SCHEME(p, t) unpack_UINT16(p, t)
> +#define unpack_TPM_SIG_SCHEME(p, t) unpack_UINT16(p, t)
> +#define unpack_TPM_MIGRATE_SCHEME(p, t) unpack_UINT16(p, t)
> +#define unpack_TPM_PHYSICAL_PRESENCE(p, t) unpack_UINT16(p, t)
> +#define unpack_TPM_KEY_FLAGS(p, t) unpack_UINT32(p, t)
> +
> +#define pack_TPM_AUTH_HANDLE(p, t) pack_UINT32(p, t);
> +#define pack_TCS_CONTEXT_HANDLE(p, t) pack_UINT32(p, t);
> +#define pack_TCS_KEY_HANDLE(p, t) pack_UINT32(p, t);
> +
> +#define unpack_TPM_AUTH_HANDLE(p, t) unpack_UINT32(p, t);
> +#define unpack_TCS_CONTEXT_HANDLE(p, t) unpack_UINT32(p, t);
> +#define unpack_TCS_KEY_HANDLE(p, t) unpack_UINT32(p, t);
> +
> +inline BYTE* pack_BUFFER(BYTE* ptr, const BYTE* buf, UINT32 size) {
> +   memcpy(ptr, buf, size);
> +   return ptr + size;
> +}
> +
> +inline BYTE* unpack_BUFFER(BYTE* ptr, BYTE* buf, UINT32 size) {
> +   memcpy(buf, ptr, size);
> +   return ptr + size;
> +}
> +
> +inline BYTE* unpack_ALIAS(BYTE* ptr, BYTE** buf, UINT32 size) {
> +   *buf =3D ptr;
> +   return ptr + size;
> +}
> +
> +inline BYTE* unpack_ALLOC(BYTE* ptr, BYTE** buf, UINT32 size) {
> +   if(size) {
> +      *buf =3D malloc(size);
> +      memcpy(*buf, ptr, size);
> +   } else {
> +      *buf =3D NULL;
> +   }
> +   return ptr + size;
> +}
> +
> +inline BYTE* unpack_PTR(BYTE* ptr, BYTE** buf, UINT32 size, UnpackPtr =
alloc) {
> +   if(alloc =3D=3D UNPACK_ALLOC) {
> +      return unpack_ALLOC(ptr, buf, size);
> +   } else {
> +      return unpack_ALIAS(ptr, buf, size);
> +   }
> +}
> +
> +inline BYTE* pack_TPM_AUTHDATA(BYTE* ptr, const TPM_AUTHDATA* d) {
> +   return pack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
> +}
> +
> +inline BYTE* unpack_TPM_AUTHDATA(BYTE* ptr, TPM_AUTHDATA* d) {
> +   return unpack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
> +}
> +
> +#define pack_TPM_SECRET(p, t) pack_TPM_AUTHDATA(p, t)
> +#define pack_TPM_ENCAUTH(p, t) pack_TPM_AUTHDATA(p, t)
> +#define pack_TPM_PAYLOAD_TYPE(p, t) pack_BYTE(p, t)
> +#define pack_TPM_TAG(p, t) pack_UINT16(p, t)
> +#define pack_TPM_STRUCTURE_TAG(p, t) pack_UINT16(p, t)
> +
> +#define unpack_TPM_SECRET(p, t) unpack_TPM_AUTHDATA(p, t)
> +#define unpack_TPM_ENCAUTH(p, t) unpack_TPM_AUTHDATA(p, t)
> +#define unpack_TPM_PAYLOAD_TYPE(p, t) unpack_BYTE(p, t)
> +#define unpack_TPM_TAG(p, t) unpack_UINT16(p, t)
> +#define unpack_TPM_STRUCTURE_TAG(p, t) unpack_UINT16(p, t)
> +
> +inline BYTE* pack_TPM_VERSION(BYTE* ptr, const TPM_VERSION* t) {
> +   ptr[0] =3D t->major;
> +   ptr[1] =3D t->minor;
> +   ptr[2] =3D t->revMajor;
> +   ptr[3] =3D t->revMinor;
> +   return ptr + 4;
> +}
> +
> +inline BYTE* unpack_TPM_VERSION(BYTE* ptr, TPM_VERSION* t) {
> +   t->major =3D ptr[0];
> +   t->minor =3D ptr[1];
> +   t->revMajor =3D ptr[2];
> +   t->revMinor =3D ptr[3];
> +   return ptr + 4;
> +}
> +
> +inline BYTE* pack_TPM_CAP_VERSION_INFO(BYTE* ptr, const TPM_CAP_VERSIO=
N_INFO* v) {
> +   ptr =3D pack_TPM_STRUCTURE_TAG(ptr, v->tag);
> +   ptr =3D pack_TPM_VERSION(ptr, &v->version);
> +   ptr =3D pack_UINT16(ptr, v->specLevel);
> +   ptr =3D pack_BYTE(ptr, v->errataRev);
> +   ptr =3D pack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));
> +   ptr =3D pack_UINT16(ptr, v->vendorSpecificSize);
> +   ptr =3D pack_BUFFER(ptr, v->vendorSpecific, v->vendorSpecificSize);=

> +   return ptr;
> +}
> +
> +inline BYTE* unpack_TPM_CAP_VERSION_INFO(BYTE* ptr, TPM_CAP_VERSION_IN=
FO* v, UnpackPtr alloc) {
> +   ptr =3D unpack_TPM_STRUCTURE_TAG(ptr, &v->tag);
> +   ptr =3D unpack_TPM_VERSION(ptr, &v->version);
> +   ptr =3D unpack_UINT16(ptr, &v->specLevel);
> +   ptr =3D unpack_BYTE(ptr, &v->errataRev);
> +   ptr =3D unpack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));=

> +   ptr =3D unpack_UINT16(ptr, &v->vendorSpecificSize);
> +   ptr =3D unpack_PTR(ptr, &v->vendorSpecific, v->vendorSpecificSize, =
alloc);
> +   return ptr;
> +}
> +
> +inline BYTE* pack_TPM_DIGEST(BYTE* ptr, const TPM_DIGEST* d) {
> +   return pack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
> +}
> +
> +inline BYTE* unpack_TPM_DIGEST(BYTE* ptr, TPM_DIGEST* d) {
> +   return unpack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
> +}
> +
> +#define pack_TPM_PCRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
> +#define unpack_TPM_PCRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
> +
> +#define pack_TPM_COMPOSITE_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
> +#define unpack_TPM_COMPOSITE_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
> +
> +#define pack_TPM_DIRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
> +#define unpack_TPM_DIRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
> +
> +#define pack_TPM_HMAC(ptr, d) pack_TPM_DIGEST(ptr, d);
> +#define unpack_TPM_HMAC(ptr, d) unpack_TPM_DIGEST(ptr, d);
> +
> +#define pack_TPM_CHOSENID_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
> +#define unpack_TPM_CHOSENID_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
> +
> +inline BYTE* pack_TPM_NONCE(BYTE* ptr, const TPM_NONCE* n) {
> +   return pack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
> +}
> +
> +inline BYTE* unpack_TPM_NONCE(BYTE* ptr, TPM_NONCE* n) {
> +   return unpack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
> +}
> +
> +inline BYTE* pack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, const TPM_SYMMETR=
IC_KEY_PARMS* k) {
> +   ptr =3D pack_UINT32(ptr, k->keyLength);
> +   ptr =3D pack_UINT32(ptr, k->blockSize);
> +   ptr =3D pack_UINT32(ptr, k->ivSize);
> +   return pack_BUFFER(ptr, k->IV, k->ivSize);
> +}
> +
> +inline BYTE* unpack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, TPM_SYMMETRIC_K=
EY_PARMS* k, UnpackPtr alloc) {
> +   ptr =3D unpack_UINT32(ptr, &k->keyLength);
> +   ptr =3D unpack_UINT32(ptr, &k->blockSize);
> +   ptr =3D unpack_UINT32(ptr, &k->ivSize);
> +   return unpack_PTR(ptr, &k->IV, k->ivSize, alloc);
> +}
> +
> +inline BYTE* pack_TPM_RSA_KEY_PARMS(BYTE* ptr, const TPM_RSA_KEY_PARMS=
* k) {
> +   ptr =3D pack_UINT32(ptr, k->keyLength);
> +   ptr =3D pack_UINT32(ptr, k->numPrimes);
> +   ptr =3D pack_UINT32(ptr, k->exponentSize);
> +   return pack_BUFFER(ptr, k->exponent, k->exponentSize);
> +}
> +
> +inline BYTE* unpack_TPM_RSA_KEY_PARMS(BYTE* ptr, TPM_RSA_KEY_PARMS* k,=
 UnpackPtr alloc) {
> +   ptr =3D unpack_UINT32(ptr, &k->keyLength);
> +   ptr =3D unpack_UINT32(ptr, &k->numPrimes);
> +   ptr =3D unpack_UINT32(ptr, &k->exponentSize);
> +   return unpack_PTR(ptr, &k->exponent, k->exponentSize, alloc);
> +}
> +
> +inline BYTE* pack_TPM_KEY_PARMS(BYTE* ptr, const TPM_KEY_PARMS* k) {
> +   ptr =3D pack_TPM_ALGORITHM_ID(ptr, k->algorithmID);
> +   ptr =3D pack_TPM_ENC_SCHEME(ptr, k->encScheme);
> +   ptr =3D pack_TPM_SIG_SCHEME(ptr, k->sigScheme);
> +   ptr =3D pack_UINT32(ptr, k->parmSize);
> +
> +   if(k->parmSize) {
> +      switch(k->algorithmID) {
> +         case TPM_ALG_RSA:
> +            return pack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa);
> +         case TPM_ALG_AES128:
> +         case TPM_ALG_AES192:
> +         case TPM_ALG_AES256:
> +            return pack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym);
> +      }
> +   }
> +   return ptr;
> +}
> +
> +inline BYTE* unpack_TPM_KEY_PARMS(BYTE* ptr, TPM_KEY_PARMS* k, UnpackP=
tr alloc) {
> +   ptr =3D unpack_TPM_ALGORITHM_ID(ptr, &k->algorithmID);
> +   ptr =3D unpack_TPM_ENC_SCHEME(ptr, &k->encScheme);
> +   ptr =3D unpack_TPM_SIG_SCHEME(ptr, &k->sigScheme);
> +   ptr =3D unpack_UINT32(ptr, &k->parmSize);
> +
> +   if(k->parmSize) {
> +      switch(k->algorithmID) {
> +         case TPM_ALG_RSA:
> +            return unpack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa, alloc)=
;
> +         case TPM_ALG_AES128:
> +         case TPM_ALG_AES192:
> +         case TPM_ALG_AES256:
> +            return unpack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym, =
alloc);
> +      }
> +   }
> +   return ptr;
> +}
> +
> +inline BYTE* pack_TPM_STORE_PUBKEY(BYTE* ptr, const TPM_STORE_PUBKEY* =
k) {
> +   ptr =3D pack_UINT32(ptr, k->keyLength);
> +   ptr =3D pack_BUFFER(ptr, k->key, k->keyLength);
> +   return ptr;
> +}
> +
> +inline BYTE* unpack_TPM_STORE_PUBKEY(BYTE* ptr, TPM_STORE_PUBKEY* k, U=
npackPtr alloc) {
> +   ptr =3D unpack_UINT32(ptr, &k->keyLength);
> +   ptr =3D unpack_PTR(ptr, &k->key, k->keyLength, alloc);
> +   return ptr;
> +}
> +
> +inline BYTE* pack_TPM_PUBKEY(BYTE* ptr, const TPM_PUBKEY* k) {
> +   ptr =3D pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
> +   return pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
> +}
> +
> +inline BYTE* unpack_TPM_PUBKEY(BYTE* ptr, TPM_PUBKEY* k, UnpackPtr all=
oc) {
> +   ptr =3D unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
> +   return unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
> +}
> +
> +inline BYTE* pack_TPM_PCR_SELECTION(BYTE* ptr, const TPM_PCR_SELECTION=
* p) {
> +   ptr =3D pack_UINT16(ptr, p->sizeOfSelect);
> +   ptr =3D pack_BUFFER(ptr, p->pcrSelect, p->sizeOfSelect);
> +   return ptr;
> +}
> +
> +inline BYTE* unpack_TPM_PCR_SELECTION(BYTE* ptr, TPM_PCR_SELECTION* p,=
 UnpackPtr alloc) {
> +   ptr =3D unpack_UINT16(ptr, &p->sizeOfSelect);
> +   ptr =3D unpack_PTR(ptr, &p->pcrSelect, p->sizeOfSelect, alloc);
> +   return ptr;
> +}
> +
> +inline BYTE* pack_TPM_PCR_INFO(BYTE* ptr, const TPM_PCR_INFO* p) {
> +   ptr =3D pack_TPM_PCR_SELECTION(ptr, &p->pcrSelection);
> +   ptr =3D pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
> +   ptr =3D pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
> +   return ptr;
> +}
> +
> +inline BYTE* unpack_TPM_PCR_INFO(BYTE* ptr, TPM_PCR_INFO* p, UnpackPtr=
 alloc) {
> +   ptr =3D unpack_TPM_PCR_SELECTION(ptr, &p->pcrSelection, alloc);
> +   ptr =3D unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
> +   ptr =3D unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
> +   return ptr;
> +}
> +
> +inline BYTE* pack_TPM_PCR_COMPOSITE(BYTE* ptr, const TPM_PCR_COMPOSITE=
* p) {
> +   ptr =3D pack_TPM_PCR_SELECTION(ptr, &p->select);
> +   ptr =3D pack_UINT32(ptr, p->valueSize);
> +   ptr =3D pack_BUFFER(ptr, (const BYTE*)p->pcrValue, p->valueSize);
> +   return ptr;
> +}
> +
> +inline BYTE* unpack_TPM_PCR_COMPOSITE(BYTE* ptr, TPM_PCR_COMPOSITE* p,=
 UnpackPtr alloc) {
> +   ptr =3D unpack_TPM_PCR_SELECTION(ptr, &p->select, alloc);
> +   ptr =3D unpack_UINT32(ptr, &p->valueSize);
> +   ptr =3D unpack_PTR(ptr, (BYTE**)&p->pcrValue, p->valueSize, alloc);=

> +   return ptr;
> +}
> +
> +inline BYTE* pack_TPM_KEY(BYTE* ptr, const TPM_KEY* k) {
> +   ptr =3D pack_TPM_VERSION(ptr, &k->ver);
> +   ptr =3D pack_TPM_KEY_USAGE(ptr, k->keyUsage);
> +   ptr =3D pack_TPM_KEY_FLAGS(ptr, k->keyFlags);
> +   ptr =3D pack_TPM_AUTH_DATA_USAGE(ptr, k->authDataUsage);
> +   ptr =3D pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
> +   ptr =3D pack_UINT32(ptr, k->PCRInfoSize);
> +   if(k->PCRInfoSize) {
> +      ptr =3D pack_TPM_PCR_INFO(ptr, &k->PCRInfo);
> +   }
> +   ptr =3D pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
> +   ptr =3D pack_UINT32(ptr, k->encDataSize);
> +   return pack_BUFFER(ptr, k->encData, k->encDataSize);
> +}
> +
> +inline BYTE* unpack_TPM_KEY(BYTE* ptr, TPM_KEY* k, UnpackPtr alloc) {
> +   ptr =3D unpack_TPM_VERSION(ptr, &k->ver);
> +   ptr =3D unpack_TPM_KEY_USAGE(ptr, &k->keyUsage);
> +   ptr =3D unpack_TPM_KEY_FLAGS(ptr, &k->keyFlags);
> +   ptr =3D unpack_TPM_AUTH_DATA_USAGE(ptr, &k->authDataUsage);
> +   ptr =3D unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
> +   ptr =3D unpack_UINT32(ptr, &k->PCRInfoSize);
> +   if(k->PCRInfoSize) {
> +      ptr =3D unpack_TPM_PCR_INFO(ptr, &k->PCRInfo, alloc);
> +   }
> +   ptr =3D unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
> +   ptr =3D unpack_UINT32(ptr, &k->encDataSize);
> +   return unpack_PTR(ptr, &k->encData, k->encDataSize, alloc);
> +}
> +
> +inline BYTE* pack_TPM_BOUND_DATA(BYTE* ptr, const TPM_BOUND_DATA* b, U=
INT32 payloadSize) {
> +   ptr =3D pack_TPM_VERSION(ptr, &b->ver);
> +   ptr =3D pack_TPM_PAYLOAD_TYPE(ptr, b->payload);
> +   return pack_BUFFER(ptr, b->payloadData, payloadSize);
> +}
> +
> +inline BYTE* unpack_TPM_BOUND_DATA(BYTE* ptr, TPM_BOUND_DATA* b, UINT3=
2 payloadSize, UnpackPtr alloc) {
> +   ptr =3D unpack_TPM_VERSION(ptr, &b->ver);
> +   ptr =3D unpack_TPM_PAYLOAD_TYPE(ptr, &b->payload);
> +   return unpack_PTR(ptr, &b->payloadData, payloadSize, alloc);
> +}
> +
> +inline BYTE* pack_TPM_STORED_DATA(BYTE* ptr, const TPM_STORED_DATA* d)=
 {
> +   ptr =3D pack_TPM_VERSION(ptr, &d->ver);
> +   ptr =3D pack_UINT32(ptr, d->sealInfoSize);
> +   if(d->sealInfoSize) {
> +      ptr =3D pack_TPM_PCR_INFO(ptr, &d->sealInfo);
> +   }
> +   ptr =3D pack_UINT32(ptr, d->encDataSize);
> +   ptr =3D pack_BUFFER(ptr, d->encData, d->encDataSize);
> +   return ptr;
> +}
> +
> +inline BYTE* unpack_TPM_STORED_DATA(BYTE* ptr, TPM_STORED_DATA* d, Unp=
ackPtr alloc) {
> +   ptr =3D unpack_TPM_VERSION(ptr, &d->ver);
> +   ptr =3D unpack_UINT32(ptr, &d->sealInfoSize);
> +   if(d->sealInfoSize) {
> +      ptr =3D unpack_TPM_PCR_INFO(ptr, &d->sealInfo, alloc);
> +   }
> +   ptr =3D unpack_UINT32(ptr, &d->encDataSize);
> +   ptr =3D unpack_PTR(ptr, &d->encData, d->encDataSize, alloc);
> +   return ptr;
> +}
> +
> +inline BYTE* pack_TPM_AUTH_SESSION(BYTE* ptr, const TPM_AUTH_SESSION* =
auth) {
> +   ptr =3D pack_TPM_AUTH_HANDLE(ptr, auth->AuthHandle);
> +   ptr =3D pack_TPM_NONCE(ptr, &auth->NonceOdd);
> +   ptr =3D pack_BOOL(ptr, auth->fContinueAuthSession);
> +   ptr =3D pack_TPM_AUTHDATA(ptr, &auth->HMAC);
> +   return ptr;
> +}
> +
> +inline BYTE* unpack_TPM_AUTH_SESSION(BYTE* ptr, TPM_AUTH_SESSION* auth=
) {
> +   ptr =3D unpack_TPM_NONCE(ptr, &auth->NonceEven);
> +   ptr =3D unpack_BOOL(ptr, &auth->fContinueAuthSession);
> +   ptr =3D unpack_TPM_AUTHDATA(ptr, &auth->HMAC);
> +   return ptr;
> +}
> +
> +inline BYTE* pack_TPM_RQU_HEADER(BYTE* ptr,
> +      TPM_TAG tag,
> +      UINT32 size,
> +      TPM_COMMAND_CODE ord) {
> +   ptr =3D pack_UINT16(ptr, tag);
> +   ptr =3D pack_UINT32(ptr, size);
> +   return pack_UINT32(ptr, ord);
> +}
> +
> +inline BYTE* unpack_TPM_RQU_HEADER(BYTE* ptr,
> +      TPM_TAG* tag,
> +      UINT32* size,
> +      TPM_COMMAND_CODE* ord) {
> +   ptr =3D unpack_UINT16(ptr, tag);
> +   ptr =3D unpack_UINT32(ptr, size);
> +   ptr =3D unpack_UINT32(ptr, ord);
> +   return ptr;
> +}
> +
> +#define pack_TPM_RSP_HEADER(p, t, s, r) pack_TPM_RQU_HEADER(p, t, s, r=
);
> +#define unpack_TPM_RSP_HEADER(p, t, s, r) unpack_TPM_RQU_HEADER(p, t, =
s, r);
> +
> +#endif
> diff --git a/stubdom/vtpmmgr/minios.cfg b/stubdom/vtpmmgr/minios.cfg
> new file mode 100644
> index 0000000..3fb383d
> --- /dev/null
> +++ b/stubdom/vtpmmgr/minios.cfg
> @@ -0,0 +1,14 @@
> +CONFIG_TPMFRONT=3Dy
> +CONFIG_TPM_TIS=3Dy
> +CONFIG_TPMBACK=3Dy
> +CONFIG_START_NETWORK=3Dn
> +CONFIG_TEST=3Dn
> +CONFIG_PCIFRONT=3Dn
> +CONFIG_BLKFRONT=3Dy
> +CONFIG_NETFRONT=3Dn
> +CONFIG_FBFRONT=3Dn
> +CONFIG_KBDFRONT=3Dn
> +CONFIG_CONSFRONT=3Dn
> +CONFIG_XENBUS=3Dy
> +CONFIG_LWIP=3Dn
> +CONFIG_XC=3Dn
> diff --git a/stubdom/vtpmmgr/tcg.h b/stubdom/vtpmmgr/tcg.h
> new file mode 100644
> index 0000000..7687eae
> --- /dev/null
> +++ b/stubdom/vtpmmgr/tcg.h
> @@ -0,0 +1,707 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005 Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#ifndef __TCG_H__
> +#define __TCG_H__
> +
> +#include <stdlib.h>
> +#include <stdint.h>
> +
> +// **************************** CONSTANTS ****************************=
*****
> +
> +// BOOL values
> +#define TRUE 0x01
> +#define FALSE 0x00
> +
> +#define TCPA_MAX_BUFFER_LENGTH 0x2000
> +
> +//
> +// TPM_COMMAND_CODE values
> +#define TPM_PROTECTED_ORDINAL 0x00000000UL
> +#define TPM_UNPROTECTED_ORDINAL 0x80000000UL
> +#define TPM_CONNECTION_ORDINAL 0x40000000UL
> +#define TPM_VENDOR_ORDINAL 0x20000000UL
> +
> +#define TPM_ORD_OIAP                     (10UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_OSAP                     (11UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_ChangeAuth               (12UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_TakeOwnership            (13UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_ChangeAuthAsymStart      (14UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_ChangeAuthAsymFinish     (15UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_ChangeAuthOwner          (16UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_Extend                   (20UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_PcrRead                  (21UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_Quote                    (22UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_Seal                     (23UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_Unseal                   (24UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_DirWriteAuth             (25UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_DirRead                  (26UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_UnBind                   (30UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_CreateWrapKey            (31UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_LoadKey                  (32UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_GetPubKey                (33UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_EvictKey                 (34UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_CreateMigrationBlob      (40UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_ReWrapKey                (41UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_ConvertMigrationBlob     (42UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_AuthorizeMigrationKey    (43UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_CreateMaintenanceArchive (44UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_LoadMaintenanceArchive   (45UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_KillMaintenanceFeature   (46UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_LoadManuMaintPub         (47UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_ReadManuMaintPub         (48UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_CertifyKey               (50UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_Sign                     (60UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_GetRandom                (70UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_StirRandom               (71UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_SelfTestFull             (80UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_SelfTestStartup          (81UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_CertifySelfTest          (82UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_ContinueSelfTest         (83UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_GetTestResult            (84UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_Reset                    (90UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_OwnerClear               (91UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_DisableOwnerClear        (92UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_ForceClear               (93UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_DisableForceClear        (94UL + TPM_PROTECTED_ORDINAL=
)
> +#define TPM_ORD_GetCapabilitySigned      (100UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_GetCapability            (101UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_GetCapabilityOwner       (102UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_OwnerSetDisable          (110UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_PhysicalEnable           (111UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_PhysicalDisable          (112UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SetOwnerInstall          (113UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_PhysicalSetDeactivated   (114UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SetTempDeactivated       (115UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_CreateEndorsementKeyPair (120UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_MakeIdentity             (121UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_ActivateIdentity         (122UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_ReadPubek                (124UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_OwnerReadPubek           (125UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_DisablePubekRead         (126UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_GetAuditEvent            (130UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_GetAuditEventSigned      (131UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_GetOrdinalAuditStatus    (140UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SetOrdinalAuditStatus    (141UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_Terminate_Handle         (150UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_Init                     (151UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SaveState                (152UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_Startup                  (153UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SetRedirection           (154UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SHA1Start                (160UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SHA1Update               (161UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SHA1Complete             (162UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SHA1CompleteExtend       (163UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_FieldUpgrade             (170UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SaveKeyContext           (180UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_LoadKeyContext           (181UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SaveAuthContext          (182UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_LoadAuthContext          (183UL + TPM_PROTECTED_ORDINA=
L)
> +#define TPM_ORD_SaveContext                      (184UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_LoadContext                      (185UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_FlushSpecific                    (186UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_PCR_Reset                        (200UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_NV_DefineSpace                   (204UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_NV_WriteValue                    (205UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_NV_WriteValueAuth                (206UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_NV_ReadValue                     (207UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_NV_ReadValueAuth                 (208UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_Delegate_UpdateVerification      (209UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_Delegate_Manage                  (210UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_Delegate_CreateKeyDelegation     (212UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_Delegate_CreateOwnerDelegation   (213UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_Delegate_VerifyDelegation        (214UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_Delegate_LoadOwnerDelegation     (216UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_Delegate_ReadAuth                (217UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_Delegate_ReadTable               (219UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_CreateCounter                    (220UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_IncrementCounter                 (221UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_ReadCounter                      (222UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_ReleaseCounter                   (223UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_ReleaseCounterOwner              (224UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_EstablishTransport               (230UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_ExecuteTransport                 (231UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_ReleaseTransportSigned           (232UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_GetTicks                         (241UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_TickStampBlob                    (242UL + TPM_PROTECTE=
D_ORDINAL)
> +#define TPM_ORD_MAX                              (256UL + TPM_PROTECTE=
D_ORDINAL)
> +
> +#define TSC_ORD_PhysicalPresence         (10UL + TPM_CONNECTION_ORDINA=
L)
> +
> +
> +
> +//
> +// TPM_RESULT values
> +//
> +// just put in the whole table from spec 1.2
> +
> +#define TPM_BASE   0x0 // The start of TPM return codes
> +#define TPM_VENDOR_ERROR 0x00000400 // Mask to indicate that the error=
 code is vendor specific for vendor specific commands
> +#define TPM_NON_FATAL  0x00000800 // Mask to indicate that the error c=
ode is a non-fatal failure.
> +
> +#define TPM_SUCCESS   TPM_BASE // Successful completion of the operati=
on
> +#define TPM_AUTHFAIL      TPM_BASE + 1 // Authentication failed
> +#define TPM_BADINDEX      TPM_BASE + 2 // The index to a PCR, DIR or o=
ther register is incorrect
> +#define TPM_BAD_PARAMETER     TPM_BASE + 3 // One or more parameter is=
 bad
> +#define TPM_AUDITFAILURE     TPM_BASE + 4 // An operation completed su=
ccessfully but the auditing of that operation failed.
> +#define TPM_CLEAR_DISABLED     TPM_BASE + 5 // The clear disable flag =
is set and all clear operations now require physical access
> +#define TPM_DEACTIVATED     TPM_BASE + 6 // The TPM is deactivated
> +#define TPM_DISABLED      TPM_BASE + 7 // The TPM is disabled
> +#define TPM_DISABLED_CMD     TPM_BASE + 8 // The target command has be=
en disabled
> +#define TPM_FAIL       TPM_BASE + 9 // The operation failed
> +#define TPM_BAD_ORDINAL     TPM_BASE + 10 // The ordinal was unknown o=
r inconsistent
> +#define TPM_INSTALL_DISABLED   TPM_BASE + 11 // The ability to install=
 an owner is disabled
> +#define TPM_INVALID_KEYHANDLE  TPM_BASE + 12 // The key handle present=
ed was invalid
> +#define TPM_KEYNOTFOUND     TPM_BASE + 13 // The target key was not fo=
und
> +#define TPM_INAPPROPRIATE_ENC  TPM_BASE + 14 // Unacceptable encryptio=
n scheme
> +#define TPM_MIGRATEFAIL     TPM_BASE + 15 // Migration authorization f=
ailed
> +#define TPM_INVALID_PCR_INFO   TPM_BASE + 16 // PCR information could =
not be interpreted
> +#define TPM_NOSPACE      TPM_BASE + 17 // No room to load key.
> +#define TPM_NOSRK       TPM_BASE + 18 // There is no SRK set
> +#define TPM_NOTSEALED_BLOB     TPM_BASE + 19 // An encrypted blob is i=
nvalid or was not created by this TPM
> +#define TPM_OWNER_SET      TPM_BASE + 20 // There is already an Owner
> +#define TPM_RESOURCES      TPM_BASE + 21 // The TPM has insufficient i=
nternal resources to perform the requested action.
> +#define TPM_SHORTRANDOM     TPM_BASE + 22 // A random string was too s=
hort
> +#define TPM_SIZE       TPM_BASE + 23 // The TPM does not have the spac=
e to perform the operation.
> +#define TPM_WRONGPCRVAL     TPM_BASE + 24 // The named PCR value does =
not match the current PCR value.
> +#define TPM_BAD_PARAM_SIZE     TPM_BASE + 25 // The paramSize argument=
 to the command has the incorrect value
> +#define TPM_SHA_THREAD      TPM_BASE + 26 // There is no existing SHA-=
1 thread.
> +#define TPM_SHA_ERROR      TPM_BASE + 27 // The calculation is unable =
to proceed because the existing SHA-1 thread has already encountered an e=
rror.
> +#define TPM_FAILEDSELFTEST     TPM_BASE + 28 // Self-test has failed a=
nd the TPM has shutdown.
> +#define TPM_AUTH2FAIL      TPM_BASE + 29 // The authorization for the =
second key in a 2 key function failed authorization
> +#define TPM_BADTAG       TPM_BASE + 30 // The tag value sent to for a =
command is invalid
> +#define TPM_IOERROR      TPM_BASE + 31 // An IO error occurred transmi=
tting information to the TPM
> +#define TPM_ENCRYPT_ERROR     TPM_BASE + 32 // The encryption process =
had a problem.
> +#define TPM_DECRYPT_ERROR     TPM_BASE + 33 // The decryption process =
did not complete.
> +#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 // An invalid handle was =
used.
> +#define TPM_NO_ENDORSEMENT     TPM_BASE + 35 // The TPM does not a EK =
installed
> +#define TPM_INVALID_KEYUSAGE   TPM_BASE + 36 // The usage of a key is =
not allowed
> +#define TPM_WRONG_ENTITYTYPE   TPM_BASE + 37 // The submitted entity t=
ype is not allowed
> +#define TPM_INVALID_POSTINIT   TPM_BASE + 38 // The command was receiv=
ed in the wrong sequence relative to TPM_Init and a subsequent TPM_Startu=
p
> +#define TPM_INAPPROPRIATE_SIG  TPM_BASE + 39 // Signed data cannot inc=
lude additional DER information
> +#define TPM_BAD_KEY_PROPERTY   TPM_BASE + 40 // The key properties in =
TPM_KEY_PARMs are not supported by this TPM
> +
> +#define TPM_BAD_MIGRATION      TPM_BASE + 41 // The migration properti=
es of this key are incorrect.
> +#define TPM_BAD_SCHEME       TPM_BASE + 42 // The signature or encrypt=
ion scheme for this key is incorrect or not permitted in this situation.
> +#define TPM_BAD_DATASIZE      TPM_BASE + 43 // The size of the data (o=
r blob) parameter is bad or inconsistent with the referenced key
> +#define TPM_BAD_MODE       TPM_BASE + 44 // A mode parameter is bad, s=
uch as capArea or subCapArea for TPM_GetCapability, phsicalPresence param=
eter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBl=
ob.
> +#define TPM_BAD_PRESENCE      TPM_BASE + 45 // Either the physicalPres=
ence or physicalPresenceLock bits have the wrong value
> +#define TPM_BAD_VERSION      TPM_BASE + 46 // The TPM cannot perform t=
his version of the capability
> +#define TPM_NO_WRAP_TRANSPORT     TPM_BASE + 47 // The TPM does not al=
low for wrapped transport sessions
> +#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 // TPM audit construc=
tion failed and the underlying command was returning a failure code also
> +#define TPM_AUDITFAIL_SUCCESSFUL   TPM_BASE + 49 // TPM audit construc=
tion failed and the underlying command was returning success
> +#define TPM_NOTRESETABLE      TPM_BASE + 50 // Attempt to reset a PCR =
register that does not have the resettable attribute
> +#define TPM_NOTLOCAL       TPM_BASE + 51 // Attempt to reset a PCR reg=
ister that requires locality and locality modifier not part of command tr=
ansport
> +#define TPM_BAD_TYPE       TPM_BASE + 52 // Make identity blob not pro=
perly typed
> +#define TPM_INVALID_RESOURCE     TPM_BASE + 53 // When saving context =
identified resource type does not match actual resource
> +#define TPM_NOTFIPS       TPM_BASE + 54 // The TPM is attempting to ex=
ecute a command only available when in FIPS mode
> +#define TPM_INVALID_FAMILY      TPM_BASE + 55 // The command is attemp=
ting to use an invalid family ID
> +#define TPM_NO_NV_PERMISSION     TPM_BASE + 56 // The permission to ma=
nipulate the NV storage is not available
> +#define TPM_REQUIRES_SIGN      TPM_BASE + 57 // The operation requires=
 a signed command
> +#define TPM_KEY_NOTSUPPORTED     TPM_BASE + 58 // Wrong operation to l=
oad an NV key
> +#define TPM_AUTH_CONFLICT      TPM_BASE + 59 // NV_LoadKey blob requir=
es both owner and blob authorization
> +#define TPM_AREA_LOCKED      TPM_BASE + 60 // The NV area is locked an=
d not writtable
> +#define TPM_BAD_LOCALITY      TPM_BASE + 61 // The locality is incorre=
ct for the attempted operation
> +#define TPM_READ_ONLY       TPM_BASE + 62 // The NV area is read only =
and can't be written to
> +#define TPM_PER_NOWRITE      TPM_BASE + 63 // There is no protection o=
n the write to the NV area
> +#define TPM_FAMILYCOUNT      TPM_BASE + 64 // The family count value d=
oes not match
> +#define TPM_WRITE_LOCKED      TPM_BASE + 65 // The NV area has already=
 been written to
> +#define TPM_BAD_ATTRIBUTES      TPM_BASE + 66 // The NV area attribute=
s conflict
> +#define TPM_INVALID_STRUCTURE     TPM_BASE + 67 // The structure tag a=
nd version are invalid or inconsistent
> +#define TPM_KEY_OWNER_CONTROL     TPM_BASE + 68 // The key is under co=
ntrol of the TPM Owner and can only be evicted by the TPM Owner.
> +#define TPM_BAD_COUNTER      TPM_BASE + 69 // The counter handle is in=
correct
> +#define TPM_NOT_FULLWRITE      TPM_BASE + 70 // The write is not a com=
plete write of the area
> +#define TPM_CONTEXT_GAP      TPM_BASE + 71 // The gap between saved co=
ntext counts is too large
> +#define TPM_MAXNVWRITES      TPM_BASE + 72 // The maximum number of NV=
 writes without an owner has been exceeded
> +#define TPM_NOOPERATOR       TPM_BASE + 73 // No operator authorizatio=
n value is set
> +#define TPM_RESOURCEMISSING     TPM_BASE + 74 // The resource pointed =
to by context is not loaded
> +#define TPM_DELEGATE_LOCK      TPM_BASE + 75 // The delegate administr=
ation is locked
> +#define TPM_DELEGATE_FAMILY     TPM_BASE + 76 // Attempt to manage a f=
amily other then the delegated family
> +#define TPM_DELEGATE_ADMIN      TPM_BASE + 77 // Delegation table mana=
gement not enabled
> +#define TPM_TRANSPORT_EXCLUSIVE    TPM_BASE + 78 // There was a comman=
d executed outside of an exclusive transport session
> +
> +// TPM_STARTUP_TYPE values
> +#define TPM_ST_CLEAR 0x0001
> +#define TPM_ST_STATE 0x0002
> +#define TPM_ST_DEACTIVATED 0x003
> +
> +// TPM_TAG values
> +#define TPM_TAG_RQU_COMMAND 0x00c1
> +#define TPM_TAG_RQU_AUTH1_COMMAND 0x00c2
> +#define TPM_TAG_RQU_AUTH2_COMMAND 0x00c3
> +#define TPM_TAG_RSP_COMMAND 0x00c4
> +#define TPM_TAG_RSP_AUTH1_COMMAND 0x00c5
> +#define TPM_TAG_RSP_AUTH2_COMMAND 0x00c6
> +
> +// TPM_PAYLOAD_TYPE values
> +#define TPM_PT_ASYM 0x01
> +#define TPM_PT_BIND 0x02
> +#define TPM_PT_MIGRATE 0x03
> +#define TPM_PT_MAINT 0x04
> +#define TPM_PT_SEAL 0x05
> +
> +// TPM_ENTITY_TYPE values
> +#define TPM_ET_KEYHANDLE 0x0001
> +#define TPM_ET_OWNER 0x0002
> +#define TPM_ET_DATA 0x0003
> +#define TPM_ET_SRK 0x0004
> +#define TPM_ET_KEY 0x0005
> +
> +/// TPM_ResourceTypes
> +#define TPM_RT_KEY      0x00000001
> +#define TPM_RT_AUTH     0x00000002
> +#define TPM_RT_HASH     0x00000003
> +#define TPM_RT_TRANS    0x00000004
> +#define TPM_RT_CONTEXT  0x00000005
> +#define TPM_RT_COUNTER  0x00000006
> +#define TPM_RT_DELEGATE 0x00000007
> +#define TPM_RT_DAA_TPM  0x00000008
> +#define TPM_RT_DAA_V0   0x00000009
> +#define TPM_RT_DAA_V1   0x0000000A
> +
> +
> +
> +// TPM_PROTOCOL_ID values
> +#define TPM_PID_OIAP 0x0001
> +#define TPM_PID_OSAP 0x0002
> +#define TPM_PID_ADIP 0x0003
> +#define TPM_PID_ADCP 0x0004
> +#define TPM_PID_OWNER 0x0005
> +
> +// TPM_ALGORITHM_ID values
> +#define TPM_ALG_RSA 0x00000001
> +#define TPM_ALG_SHA 0x00000004
> +#define TPM_ALG_HMAC 0x00000005
> +#define TPM_ALG_AES128 0x00000006
> +#define TPM_ALG_MFG1 0x00000007
> +#define TPM_ALG_AES192 0x00000008
> +#define TPM_ALG_AES256 0x00000009
> +#define TPM_ALG_XOR 0x0000000A
> +
> +// TPM_ENC_SCHEME values
> +#define TPM_ES_NONE 0x0001
> +#define TPM_ES_RSAESPKCSv15 0x0002
> +#define TPM_ES_RSAESOAEP_SHA1_MGF1 0x0003
> +
> +// TPM_SIG_SCHEME values
> +#define TPM_SS_NONE 0x0001
> +#define TPM_SS_RSASSAPKCS1v15_SHA1 0x0002
> +#define TPM_SS_RSASSAPKCS1v15_DER 0x0003
> +
> +/*
> + * TPM_CAPABILITY_AREA Values for TPM_GetCapability ([TPM_Part2], Sect=
ion 21.1)
> + */
> +#define TPM_CAP_ORD                     0x00000001
> +#define TPM_CAP_ALG                     0x00000002
> +#define TPM_CAP_PID                     0x00000003
> +#define TPM_CAP_FLAG                    0x00000004
> +#define TPM_CAP_PROPERTY                0x00000005
> +#define TPM_CAP_VERSION                 0x00000006
> +#define TPM_CAP_KEY_HANDLE              0x00000007
> +#define TPM_CAP_CHECK_LOADED            0x00000008
> +#define TPM_CAP_SYM_MODE                0x00000009
> +#define TPM_CAP_KEY_STATUS              0x0000000C
> +#define TPM_CAP_NV_LIST                 0x0000000D
> +#define TPM_CAP_MFR                     0x00000010
> +#define TPM_CAP_NV_INDEX                0x00000011
> +#define TPM_CAP_TRANS_ALG               0x00000012
> +#define TPM_CAP_HANDLE                  0x00000014
> +#define TPM_CAP_TRANS_ES                0x00000015
> +#define TPM_CAP_AUTH_ENCRYPT            0x00000017
> +#define TPM_CAP_SELECT_SIZE             0x00000018
> +#define TPM_CAP_DA_LOGIC                0x00000019
> +#define TPM_CAP_VERSION_VAL             0x0000001A
> +
> +/* subCap definitions ([TPM_Part2], Section 21.2) */
> +#define TPM_CAP_PROP_PCR                0x00000101
> +#define TPM_CAP_PROP_DIR                0x00000102
> +#define TPM_CAP_PROP_MANUFACTURER       0x00000103
> +#define TPM_CAP_PROP_KEYS               0x00000104
> +#define TPM_CAP_PROP_MIN_COUNTER        0x00000107
> +#define TPM_CAP_FLAG_PERMANENT          0x00000108
> +#define TPM_CAP_FLAG_VOLATILE           0x00000109
> +#define TPM_CAP_PROP_AUTHSESS           0x0000010A
> +#define TPM_CAP_PROP_TRANSESS           0x0000010B
> +#define TPM_CAP_PROP_COUNTERS           0x0000010C
> +#define TPM_CAP_PROP_MAX_AUTHSESS       0x0000010D
> +#define TPM_CAP_PROP_MAX_TRANSESS       0x0000010E
> +#define TPM_CAP_PROP_MAX_COUNTERS       0x0000010F
> +#define TPM_CAP_PROP_MAX_KEYS           0x00000110
> +#define TPM_CAP_PROP_OWNER              0x00000111
> +#define TPM_CAP_PROP_CONTEXT            0x00000112
> +#define TPM_CAP_PROP_MAX_CONTEXT        0x00000113
> +#define TPM_CAP_PROP_FAMILYROWS         0x00000114
> +#define TPM_CAP_PROP_TIS_TIMEOUT        0x00000115
> +#define TPM_CAP_PROP_STARTUP_EFFECT     0x00000116
> +#define TPM_CAP_PROP_DELEGATE_ROW       0x00000117
> +#define TPM_CAP_PROP_MAX_DAASESS        0x00000119
> +#define TPM_CAP_PROP_DAASESS            0x0000011A
> +#define TPM_CAP_PROP_CONTEXT_DIST       0x0000011B
> +#define TPM_CAP_PROP_DAA_INTERRUPT      0x0000011C
> +#define TPM_CAP_PROP_SESSIONS           0x0000011D
> +#define TPM_CAP_PROP_MAX_SESSIONS       0x0000011E
> +#define TPM_CAP_PROP_CMK_RESTRICTION    0x0000011F
> +#define TPM_CAP_PROP_DURATION           0x00000120
> +#define TPM_CAP_PROP_ACTIVE_COUNTER     0x00000122
> +#define TPM_CAP_PROP_MAX_NV_AVAILABLE   0x00000123
> +#define TPM_CAP_PROP_INPUT_BUFFER       0x00000124
> +
> +// TPM_KEY_USAGE values
> +#define TPM_KEY_EK 0x0000
> +#define TPM_KEY_SIGNING 0x0010
> +#define TPM_KEY_STORAGE 0x0011
> +#define TPM_KEY_IDENTITY 0x0012
> +#define TPM_KEY_AUTHCHANGE 0X0013
> +#define TPM_KEY_BIND 0x0014
> +#define TPM_KEY_LEGACY 0x0015
> +
> +// TPM_AUTH_DATA_USAGE values
> +#define TPM_AUTH_NEVER 0x00
> +#define TPM_AUTH_ALWAYS 0x01
> +
> +// Key Handle of owner and srk
> +#define TPM_OWNER_KEYHANDLE 0x40000001
> +#define TPM_SRK_KEYHANDLE 0x40000000
> +
> +
> +
> +// *************************** TYPEDEFS ******************************=
***
> +typedef unsigned char BYTE;
> +typedef unsigned char BOOL;
> +typedef uint16_t UINT16;
> +typedef uint32_t UINT32;
> +typedef uint64_t UINT64;
> +
> +typedef UINT32 TPM_RESULT;
> +typedef UINT32 TPM_PCRINDEX;
> +typedef UINT32 TPM_DIRINDEX;
> +typedef UINT32 TPM_HANDLE;
> +typedef TPM_HANDLE TPM_AUTHHANDLE;
> +typedef TPM_HANDLE TCPA_HASHHANDLE;
> +typedef TPM_HANDLE TCPA_HMACHANDLE;
> +typedef TPM_HANDLE TCPA_ENCHANDLE;
> +typedef TPM_HANDLE TPM_KEY_HANDLE;
> +typedef TPM_HANDLE TCPA_ENTITYHANDLE;
> +typedef UINT32 TPM_RESOURCE_TYPE;
> +typedef UINT32 TPM_COMMAND_CODE;
> +typedef UINT16 TPM_PROTOCOL_ID;
> +typedef BYTE TPM_AUTH_DATA_USAGE;
> +typedef UINT16 TPM_ENTITY_TYPE;
> +typedef UINT32 TPM_ALGORITHM_ID;
> +typedef UINT16 TPM_KEY_USAGE;
> +typedef UINT16 TPM_STARTUP_TYPE;
> +typedef UINT32 TPM_CAPABILITY_AREA;
> +typedef UINT16 TPM_ENC_SCHEME;
> +typedef UINT16 TPM_SIG_SCHEME;
> +typedef UINT16 TPM_MIGRATE_SCHEME;
> +typedef UINT16 TPM_PHYSICAL_PRESENCE;
> +typedef UINT32 TPM_KEY_FLAGS;
> +
> +#define TPM_DIGEST_SIZE 20  // Don't change this
> +typedef BYTE TPM_AUTHDATA[TPM_DIGEST_SIZE];
> +typedef TPM_AUTHDATA TPM_SECRET;
> +typedef TPM_AUTHDATA TPM_ENCAUTH;
> +typedef BYTE TPM_PAYLOAD_TYPE;
> +typedef UINT16 TPM_TAG;
> +typedef UINT16 TPM_STRUCTURE_TAG;
> +
> +// Data Types of the TCS
> +typedef UINT32 TCS_AUTHHANDLE;  // Handle addressing a authorization s=
ession
> +typedef UINT32 TCS_CONTEXT_HANDLE; // Basic context handle
> +typedef UINT32 TCS_KEY_HANDLE;  // Basic key handle
> +
> +// ************************* STRUCTURES ******************************=
****
> +
> +typedef struct TPM_VERSION {
> +  BYTE major;
> +  BYTE minor;
> +  BYTE revMajor;
> +  BYTE revMinor;
> +} TPM_VERSION;
> +
> +static const TPM_VERSION TPM_STRUCT_VER_1_1 =3D { 1,1,0,0 };
> +
> +typedef struct TPM_CAP_VERSION_INFO {
> +   TPM_STRUCTURE_TAG tag;
> +   TPM_VERSION version;
> +   UINT16 specLevel;
> +   BYTE errataRev;
> +   BYTE tpmVendorID[4];
> +   UINT16 vendorSpecificSize;
> +   BYTE* vendorSpecific;
> +} TPM_CAP_VERSION_INFO;
> +
> +inline void free_TPM_CAP_VERSION_INFO(TPM_CAP_VERSION_INFO* v) {
> +   free(v->vendorSpecific);
> +   v->vendorSpecific =3D NULL;
> +}
> +
> +typedef struct TPM_DIGEST {
> +  BYTE digest[TPM_DIGEST_SIZE];
> +} TPM_DIGEST;
> +
> +typedef TPM_DIGEST TPM_PCRVALUE;
> +typedef TPM_DIGEST TPM_COMPOSITE_HASH;
> +typedef TPM_DIGEST TPM_DIRVALUE;
> +typedef TPM_DIGEST TPM_HMAC;
> +typedef TPM_DIGEST TPM_CHOSENID_HASH;
> +
> +typedef struct TPM_NONCE {
> +  BYTE nonce[TPM_DIGEST_SIZE];
> +} TPM_NONCE;
> +
> +typedef struct TPM_SYMMETRIC_KEY_PARMS {
> +   UINT32 keyLength;
> +   UINT32 blockSize;
> +   UINT32 ivSize;
> +   BYTE* IV;
> +} TPM_SYMMETRIC_KEY_PARMS;
> +
> +inline void free_TPM_SYMMETRIC_KEY_PARMS(TPM_SYMMETRIC_KEY_PARMS* p) {=

> +   free(p->IV);
> +   p->IV =3D NULL;
> +}
> +
> +#define TPM_SYMMETRIC_KEY_PARMS_INIT { 0, 0, 0, NULL }
> +
> +typedef struct TPM_RSA_KEY_PARMS {
> +  UINT32 keyLength;
> +  UINT32 numPrimes;
> +  UINT32 exponentSize;
> +  BYTE* exponent;
> +} TPM_RSA_KEY_PARMS;
> +
> +#define TPM_RSA_KEY_PARMS_INIT { 0, 0, 0, NULL }
> +
> +inline void free_TPM_RSA_KEY_PARMS(TPM_RSA_KEY_PARMS* p) {
> +   free(p->exponent);
> +   p->exponent =3D NULL;
> +}
> +
> +typedef struct TPM_KEY_PARMS {
> +  TPM_ALGORITHM_ID algorithmID;
> +  TPM_ENC_SCHEME encScheme;
> +  TPM_SIG_SCHEME sigScheme;
> +  UINT32 parmSize;
> +  union {
> +     TPM_SYMMETRIC_KEY_PARMS sym;
> +     TPM_RSA_KEY_PARMS rsa;
> +  } parms;
> +} TPM_KEY_PARMS;
> +
> +#define TPM_KEY_PARMS_INIT { 0, 0, 0, 0 }
> +
> +inline void free_TPM_KEY_PARMS(TPM_KEY_PARMS* p) {
> +   if(p->parmSize) {
> +      switch(p->algorithmID) {
> +         case TPM_ALG_RSA:
> +            free_TPM_RSA_KEY_PARMS(&p->parms.rsa);
> +            break;
> +         case TPM_ALG_AES128:
> +         case TPM_ALG_AES192:
> +         case TPM_ALG_AES256:
> +            free_TPM_SYMMETRIC_KEY_PARMS(&p->parms.sym);
> +            break;
> +      }
> +   }
> +}
> +
> +typedef struct TPM_STORE_PUBKEY {
> +  UINT32 keyLength;
> +  BYTE* key;
> +} TPM_STORE_PUBKEY;
> +
> +#define TPM_STORE_PUBKEY_INIT { 0, NULL }
> +
> +inline void free_TPM_STORE_PUBKEY(TPM_STORE_PUBKEY* p) {
> +   free(p->key);
> +   p->key =3D NULL;
> +}
> +
> +typedef struct TPM_PUBKEY {
> +  TPM_KEY_PARMS algorithmParms;
> +  TPM_STORE_PUBKEY pubKey;
> +} TPM_PUBKEY;
> +
> +#define TPM_PUBKEY_INIT { TPM_KEY_PARMS_INIT, TPM_STORE_PUBKEY_INIT }
> +
> +inline void free_TPM_PUBKEY(TPM_PUBKEY* k) {
> +   free_TPM_KEY_PARMS(&k->algorithmParms);
> +   free_TPM_STORE_PUBKEY(&k->pubKey);
> +}
> +
> +typedef struct TPM_PCR_SELECTION {
> +   UINT16 sizeOfSelect;
> +   BYTE* pcrSelect;
> +} TPM_PCR_SELECTION;
> +
> +#define TPM_PCR_SELECTION_INIT { 0, NULL }
> +
> +inline void free_TPM_PCR_SELECTION(TPM_PCR_SELECTION* p) {
> +   free(p->pcrSelect);
> +   p->pcrSelect =3D NULL;
> +}
> +
> +typedef struct TPM_PCR_INFO {
> +   TPM_PCR_SELECTION pcrSelection;
> +   TPM_COMPOSITE_HASH digestAtRelease;
> +   TPM_COMPOSITE_HASH digestAtCreation;
> +} TPM_PCR_INFO;
> +
> +#define TPM_PCR_INFO_INIT { TPM_PCR_SELECTION_INIT }
> +
> +inline void free_TPM_PCR_INFO(TPM_PCR_INFO* p) {
> +   free_TPM_PCR_SELECTION(&p->pcrSelection);
> +}
> +
> +typedef struct TPM_PCR_COMPOSITE {
> +  TPM_PCR_SELECTION select;
> +  UINT32 valueSize;
> +  TPM_PCRVALUE* pcrValue;
> +} TPM_PCR_COMPOSITE;
> +
> +#define TPM_PCR_COMPOSITE_INIT { TPM_PCR_SELECTION_INIT, 0, NULL }
> +
> +inline void free_TPM_PCR_COMPOSITE(TPM_PCR_COMPOSITE* p) {
> +   free_TPM_PCR_SELECTION(&p->select);
> +   free(p->pcrValue);
> +   p->pcrValue =3D NULL;
> +}
> +
> +typedef struct TPM_KEY {
> +  TPM_VERSION         ver;
> +  TPM_KEY_USAGE       keyUsage;
> +  TPM_KEY_FLAGS       keyFlags;
> +  TPM_AUTH_DATA_USAGE authDataUsage;
> +  TPM_KEY_PARMS       algorithmParms;
> +  UINT32              PCRInfoSize;
> +  TPM_PCR_INFO        PCRInfo;
> +  TPM_STORE_PUBKEY    pubKey;
> +  UINT32              encDataSize;
> +  BYTE*               encData;
> +} TPM_KEY;
> +
> +#define TPM_KEY_INIT { .algorithmParms =3D TPM_KEY_PARMS_INIT,\
> +   .PCRInfoSize =3D 0, .PCRInfo =3D TPM_PCR_INFO_INIT, \
> +   .pubKey =3D TPM_STORE_PUBKEY_INIT, \
> +   .encDataSize =3D 0, .encData =3D NULL }
> +
> +inline void free_TPM_KEY(TPM_KEY* k) {
> +   if(k->PCRInfoSize) {
> +      free_TPM_PCR_INFO(&k->PCRInfo);
> +   }
> +   free_TPM_STORE_PUBKEY(&k->pubKey);
> +   free(k->encData);
> +   k->encData =3D NULL;
> +}
> +
> +typedef struct TPM_BOUND_DATA {
> +  TPM_VERSION ver;
> +  TPM_PAYLOAD_TYPE payload;
> +  BYTE* payloadData;
> +} TPM_BOUND_DATA;
> +
> +#define TPM_BOUND_DATA_INIT { .payloadData =3D NULL }
> +
> +inline void free_TPM_BOUND_DATA(TPM_BOUND_DATA* d) {
> +   free(d->payloadData);
> +   d->payloadData =3D NULL;
> +}
> +
> +typedef struct TPM_STORED_DATA {
> +  TPM_VERSION ver;
> +  UINT32 sealInfoSize;
> +  TPM_PCR_INFO sealInfo;
> +  UINT32 encDataSize;
> +  BYTE* encData;
> +} TPM_STORED_DATA;
> +
> +#define TPM_STORED_DATA_INIT { .sealInfoSize =3D 0, sealInfo =3D TPM_P=
CR_INFO_INIT,\
> +   .encDataSize =3D 0, .encData =3D NULL }
> +
> +inline void free_TPM_STORED_DATA(TPM_STORED_DATA* d) {
> +   if(d->sealInfoSize) {
> +      free_TPM_PCR_INFO(&d->sealInfo);
> +   }
> +   free(d->encData);
> +   d->encData =3D NULL;
> +}
> +
> +typedef struct TPM_AUTH_SESSION {
> +  TPM_AUTHHANDLE  AuthHandle;
> +  TPM_NONCE   NonceOdd;   // system
> +  TPM_NONCE   NonceEven;   // TPM
> +  BOOL   fContinueAuthSession;
> +  TPM_AUTHDATA  HMAC;
> +} TPM_AUTH_SESSION;
> +
> +#define TPM_AUTH_SESSION_INIT { .AuthHandle =3D 0, .fContinueAuthSessi=
on =3D FALSE }
> +
> +// ---------------------- Functions for checking TPM_RESULTs ---------=
--------
> +
> +#include <stdio.h>
> +
> +// FIXME: Review use of these and delete unneeded ones.
> +
> +// these are really badly dependent on local structure:
> +// DEPENDS: local var 'status' of type TPM_RESULT
> +// DEPENDS: label 'abort_egress' which cleans up and returns the statu=
s
> +#define ERRORDIE(s) do { status =3D s; \
> +                         fprintf (stderr, "*** ERRORDIE in %s at %s: %=
i\n", __func__, __FILE__, __LINE__); \
> +                         goto abort_egress; } \
> +                    while (0)
> +
> +// DEPENDS: local var 'status' of type TPM_RESULT
> +// DEPENDS: label 'abort_egress' which cleans up and returns the statu=
s
> +// Try command c. If it fails, set status to s and goto abort.
> +#define TPMTRY(s,c) if (c !=3D TPM_SUCCESS) { \
> +                       status =3D s; \
> +                       printf("ERROR in %s at %s:%i code: %s.\n", __fu=
nc__, __FILE__, __LINE__, tpm_get_error_name(status)); \
> +                       goto abort_egress; \
> +                    } else {\
> +                       status =3D c; \
> +                    }
> +
> +// Try command c. If it fails, print error message, set status to actu=
al return code. Goto abort
> +#define TPMTRYRETURN(c) do { status =3D c; \
> +                             if (status !=3D TPM_SUCCESS) { \
> +                               fprintf(stderr, "ERROR in %s at %s:%i c=
ode: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \=

> +                               goto abort_egress; \
> +                             } \
> +                        } while(0)
> +
> +
> +#endif //__TCPA_H__
> diff --git a/stubdom/vtpmmgr/tpm.c b/stubdom/vtpmmgr/tpm.c
> new file mode 100644
> index 0000000..123a27c
> --- /dev/null
> +++ b/stubdom/vtpmmgr/tpm.c
> @@ -0,0 +1,938 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#include <stdio.h>
> +#include <string.h>
> +#include <malloc.h>
> +#include <unistd.h>
> +#include <errno.h>
> +
> +#include <polarssl/sha1.h>
> +
> +#include "tcg.h"
> +#include "tpm.h"
> +#include "log.h"
> +#include "marshal.h"
> +#include "tpmrsa.h"
> +#include "vtpmmgr.h"
> +
> +#define TCPA_MAX_BUFFER_LENGTH 0x2000
> +
> +#define TPM_BEGIN(TAG, ORD) \
> +   const TPM_TAG intag =3D TAG;\
> +TPM_TAG tag =3D intag;\
> +UINT32 paramSize;\
> +const TPM_COMMAND_CODE ordinal =3D ORD;\
> +TPM_RESULT status =3D TPM_SUCCESS;\
> +BYTE in_buf[TCPA_MAX_BUFFER_LENGTH];\
> +BYTE out_buf[TCPA_MAX_BUFFER_LENGTH];\
> +UINT32 out_len =3D sizeof(out_buf);\
> +BYTE* ptr =3D in_buf;\
> +/*Print a log message */\
> +vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);\
> +/* Pack the header*/\
> +ptr =3D pack_TPM_TAG(ptr, tag);\
> +ptr +=3D sizeof(UINT32);\
> +ptr =3D pack_TPM_COMMAND_CODE(ptr, ordinal)\
> +
> +#define TPM_AUTH_BEGIN() \
> +   sha1_context sha1_ctx;\
> +BYTE* authbase =3D ptr - sizeof(TPM_COMMAND_CODE);\
> +TPM_DIGEST paramDigest;\
> +sha1_starts(&sha1_ctx)
> +
> +#define TPM_AUTH1_GEN(HMACkey, auth) do {\
> +   sha1_finish(&sha1_ctx, paramDigest.digest);\
> +   generateAuth(&paramDigest, HMACkey, auth);\
> +   ptr =3D pack_TPM_AUTH_SESSION(ptr, auth);\
> +} while(0)
> +
> +#define TPM_AUTH2_GEN(HMACkey, auth) do {\
> +   generateAuth(&paramDigest, HMACkey, auth);\
> +   ptr =3D pack_TPM_AUTH_SESSION(ptr, auth);\
> +} while(0)
> +
> +#define TPM_TRANSMIT() do {\
> +   /* Pack the command size */\
> +   paramSize =3D ptr - in_buf;\
> +   pack_UINT32(in_buf + sizeof(TPM_TAG), paramSize);\
> +   if((status =3D TPM_TransmitData(in_buf, paramSize, out_buf, &out_le=
n)) !=3D TPM_SUCCESS) {\
> +      goto abort_egress;\
> +   }\
> +} while(0)
> +
> +#define TPM_AUTH_VERIFY_BEGIN() do {\
> +   UINT32 buf[2] =3D { cpu_to_be32(status), cpu_to_be32(ordinal) };\
> +   sha1_starts(&sha1_ctx);\
> +   sha1_update(&sha1_ctx, (unsigned char*)buf, sizeof(buf));\
> +   authbase =3D ptr;\
> +} while(0)
> +
> +#define TPM_AUTH1_VERIFY(HMACkey, auth) do {\
> +   sha1_finish(&sha1_ctx, paramDigest.digest);\
> +   ptr =3D unpack_TPM_AUTH_SESSION(ptr, auth);\
> +   if((status =3D verifyAuth(&paramDigest, HMACkey, auth)) !=3D TPM_SU=
CCESS) {\
> +      goto abort_egress;\
> +   }\
> +} while(0)
> +
> +#define TPM_AUTH2_VERIFY(HMACkey, auth) do {\
> +   ptr =3D unpack_TPM_AUTH_SESSION(ptr, auth);\
> +   if((status =3D verifyAuth(&paramDigest, HMACkey, auth)) !=3D TPM_SU=
CCESS) {\
> +      goto abort_egress;\
> +   }\
> +} while(0)
> +
> +
> +
> +#define TPM_UNPACK_VERIFY() do { \
> +   ptr =3D out_buf;\
> +   ptr =3D unpack_TPM_RSP_HEADER(ptr, \
> +         &(tag), &(paramSize), &(status));\
> +   if((status) !=3D TPM_SUCCESS || (tag) !=3D (intag +3)) { \
> +      vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s\n", tpm_g=
et_error_name(status));\
> +      goto abort_egress;\
> +   }\
> +} while(0)
> +
> +#define TPM_AUTH_HASH() do {\
> +   sha1_update(&sha1_ctx, authbase, ptr - authbase);\
> +   authbase =3D ptr;\
> +} while(0)
> +
> +#define TPM_AUTH_SKIP() do {\
> +   authbase =3D ptr;\
> +} while(0)
> +
> +#define TPM_AUTH_ERR_CHECK(auth) do {\
> +   if(status !=3D TPM_SUCCESS || auth->fContinueAuthSession =3D=3D FAL=
SE) {\
> +      vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM\n", =
auth->AuthHandle);\
> +      auth->AuthHandle =3D 0;\
> +   }\
> +} while(0)
> +
> +static void xorEncrypt(const TPM_SECRET* sharedSecret,
> +      TPM_NONCE* nonce,
> +      const TPM_AUTHDATA* inAuth0,
> +      TPM_ENCAUTH outAuth0,
> +      const TPM_AUTHDATA* inAuth1,
> +      TPM_ENCAUTH outAuth1) {
> +   BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
> +   BYTE XORkey[TPM_DIGEST_SIZE];
> +   BYTE* ptr =3D XORbuffer;
> +   ptr =3D pack_TPM_SECRET(ptr, sharedSecret);
> +   ptr =3D pack_TPM_NONCE(ptr, nonce);
> +
> +   sha1(XORbuffer, ptr - XORbuffer, XORkey);
> +
> +   if(inAuth0) {
> +      for(int i =3D 0; i < TPM_DIGEST_SIZE; ++i) {
> +         outAuth0[i] =3D XORkey[i] ^ (*inAuth0)[i];
> +      }
> +   }
> +   if(inAuth1) {
> +      for(int i =3D 0; i < TPM_DIGEST_SIZE; ++i) {
> +         outAuth1[i] =3D XORkey[i] ^ (*inAuth1)[i];
> +      }
> +   }
> +
> +}
> +
> +static void generateAuth(const TPM_DIGEST* paramDigest,
> +      const TPM_SECRET* HMACkey,
> +      TPM_AUTH_SESSION *auth)
> +{
> +   //Generate new OddNonce
> +   vtpmmgr_rand((BYTE*)auth->NonceOdd.nonce, sizeof(TPM_NONCE));
> +
> +   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams)=
=2E
> +   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof=
(BOOL)];
> +   BYTE* ptr =3D hmacText;
> +
> +   ptr =3D pack_TPM_DIGEST(ptr, paramDigest);
> +   ptr =3D pack_TPM_NONCE(ptr, &auth->NonceEven);
> +   ptr =3D pack_TPM_NONCE(ptr, &auth->NonceOdd);
> +   ptr =3D pack_BOOL(ptr, auth->fContinueAuthSession);
> +
> +   sha1_hmac((BYTE *) HMACkey, sizeof(TPM_DIGEST),
> +         (BYTE *) hmacText, sizeof(hmacText),
> +         auth->HMAC);
> +}
> +
> +static TPM_RESULT verifyAuth(const TPM_DIGEST* paramDigest,
> +      /*[IN]*/ const TPM_SECRET *HMACkey,
> +      /*[IN,OUT]*/ TPM_AUTH_SESSION *auth)
> +{
> +
> +   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams)=
=2E
> +   TPM_AUTHDATA hm;
> +   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof=
(BOOL)];
> +   BYTE* ptr =3D hmacText;
> +
> +   ptr =3D pack_TPM_DIGEST(ptr, paramDigest);
> +   ptr =3D pack_TPM_NONCE(ptr, &auth->NonceEven);
> +   ptr =3D pack_TPM_NONCE(ptr, &auth->NonceOdd);
> +   ptr =3D pack_BOOL(ptr, auth->fContinueAuthSession);
> +
> +   sha1_hmac( (BYTE *) HMACkey, sizeof(TPM_DIGEST),
> +         (BYTE *) hmacText, sizeof(hmacText),
> +         hm);
> +
> +   // Compare correct HMAC with provided one.
> +   if (memcmp(hm, auth->HMAC, sizeof(TPM_DIGEST)) =3D=3D 0) { // 0 ind=
icates equality
> +      return TPM_SUCCESS;
> +   } else {
> +      vtpmlogerror(VTPM_LOG_TPM, "Auth Session verification failed!\n"=
);
> +      return TPM_AUTHFAIL;
> +   }
> +}
> +
> +
> +
> +// ------------------------------------------------------------------
> +// Authorization Commands
> +// ------------------------------------------------------------------
> +
> +TPM_RESULT TPM_OIAP(TPM_AUTH_SESSION*   auth)  // out
> +{
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OIAP);
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
> +   auth->fContinueAuthSession =3D TRUE;
> +
> +   ptr =3D unpack_UINT32(ptr, &auth->AuthHandle);
> +   ptr =3D unpack_TPM_NONCE(ptr, &auth->NonceEven);
> +
> +   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OIAP.\n=
", auth->AuthHandle);
> +
> +abort_egress:
> +   return status;
> +}
> +
> +TPM_RESULT TPM_OSAP(TPM_ENTITY_TYPE  entityType,  // in
> +      UINT32    entityValue, // in
> +      const TPM_AUTHDATA* usageAuth, //in
> +      TPM_SECRET *sharedSecret, //out
> +      TPM_AUTH_SESSION *auth)
> +{
> +   BYTE* nonceOddOSAP;
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OSAP);
> +
> +   ptr =3D pack_TPM_ENTITY_TYPE(ptr, entityType);
> +   ptr =3D pack_UINT32(ptr, entityValue);
> +
> +   //nonce Odd OSAP
> +   nonceOddOSAP =3D ptr;
> +   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
> +   ptr +=3D TPM_DIGEST_SIZE;
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +   ptr =3D unpack_UINT32(ptr, &auth->AuthHandle);
> +   ptr =3D unpack_TPM_NONCE(ptr, &auth->NonceEven);
> +
> +   //Calculate session secret
> +   sha1_context ctx;
> +   sha1_hmac_starts(&ctx, *usageAuth, TPM_DIGEST_SIZE);
> +   sha1_hmac_update(&ctx, ptr, TPM_DIGEST_SIZE); //ptr =3D nonceEvenOS=
AP
> +   sha1_hmac_update(&ctx, nonceOddOSAP, TPM_DIGEST_SIZE);
> +   sha1_hmac_finish(&ctx, *sharedSecret);
> +
> +   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
> +   auth->fContinueAuthSession =3D FALSE;
> +
> +   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OSAP.\n=
", auth->AuthHandle);
> +
> +abort_egress:
> +   return status;
> +}
> +
> +TPM_RESULT TPM_TakeOwnership(
> +      const TPM_PUBKEY *pubEK, //in
> +      const TPM_AUTHDATA* ownerAuth, //in
> +      const TPM_AUTHDATA* srkAuth, //in
> +      const TPM_KEY* inSrk, //in
> +      TPM_KEY* outSrk, //out, optional
> +      TPM_AUTH_SESSION*   auth)   // in, out
> +{
> +   int keyAlloced =3D 0;
> +   tpmrsa_context ek_rsa =3D TPMRSA_CTX_INIT;
> +
> +   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_TakeOwnership);
> +   TPM_AUTH_BEGIN();
> +
> +   tpmrsa_set_pubkey(&ek_rsa,
> +         pubEK->pubKey.key, pubEK->pubKey.keyLength,
> +         pubEK->algorithmParms.parms.rsa.exponent,
> +         pubEK->algorithmParms.parms.rsa.exponentSize);
> +
> +   /* Pack the protocol ID */
> +   ptr =3D pack_UINT16(ptr, TPM_PID_OWNER);
> +
> +   /* Pack the encrypted owner auth */
> +   ptr =3D pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength =
/ 8);
> +   tpmrsa_pub_encrypt_oaep(&ek_rsa,
> +         ctr_drbg_random, &vtpm_globals.ctr_drbg,
> +         sizeof(TPM_SECRET),
> +         (BYTE*) ownerAuth,
> +         ptr);
> +   ptr +=3D pubEK->algorithmParms.parms.rsa.keyLength / 8;
> +
> +   /* Pack the encrypted srk auth */
> +   ptr =3D pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength =
/ 8);
> +   tpmrsa_pub_encrypt_oaep(&ek_rsa,
> +         ctr_drbg_random, &vtpm_globals.ctr_drbg,
> +         sizeof(TPM_SECRET),
> +         (BYTE*) srkAuth,
> +         ptr);
> +   ptr +=3D pubEK->algorithmParms.parms.rsa.keyLength / 8;
> +
> +   /* Pack the Srk key */
> +   ptr =3D pack_TPM_KEY(ptr, inSrk);
> +
> +   /* Hash everything up to here */
> +   TPM_AUTH_HASH();
> +
> +   /* Generate the authorization */
> +   TPM_AUTH1_GEN(ownerAuth, auth);
> +
> +   /* Send the command to the tpm*/
> +   TPM_TRANSMIT();
> +   /* Unpack and validate the header */
> +   TPM_UNPACK_VERIFY();
> +   TPM_AUTH_VERIFY_BEGIN();
> +
> +   if(outSrk !=3D NULL) {
> +      /* If the user wants a copy of the srk we give it to them */
> +      keyAlloced =3D 1;
> +      ptr =3D unpack_TPM_KEY(ptr, outSrk, UNPACK_ALLOC);
> +   } else {
> +      /*otherwise just parse past it */
> +      TPM_KEY temp;
> +      ptr =3D unpack_TPM_KEY(ptr, &temp, UNPACK_ALIAS);
> +   }
> +
> +   /* Hash the output key */
> +   TPM_AUTH_HASH();
> +
> +   /* Verify authorizaton */
> +   TPM_AUTH1_VERIFY(ownerAuth, auth);
> +
> +   goto egress;
> +abort_egress:
> +   if(keyAlloced) {
> +      free_TPM_KEY(outSrk);
> +   }
> +egress:
> +   tpmrsa_free(&ek_rsa);
> +   TPM_AUTH_ERR_CHECK(auth);
> +   return status;
> +}
> +
> +
> +TPM_RESULT TPM_DisablePubekRead (
> +      const TPM_AUTHDATA* ownerAuth,
> +      TPM_AUTH_SESSION*   auth)
> +{
> +   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_DisablePubekRead);
> +   TPM_AUTH_BEGIN();
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_GEN(ownerAuth, auth);
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +   TPM_AUTH_VERIFY_BEGIN();
> +
> +   TPM_AUTH1_VERIFY(ownerAuth, auth);
> +
> +abort_egress:
> +   TPM_AUTH_ERR_CHECK(auth);
> +   return status;
> +}
> +
> +
> +TPM_RESULT TPM_TerminateHandle(TPM_AUTHHANDLE  handle)  // in
> +{
> +   if(handle =3D=3D 0) {
> +      return TPM_SUCCESS;
> +   }
> +
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Terminate_Handle);
> +
> +   ptr =3D pack_TPM_AUTHHANDLE(ptr, handle);
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM_Termina=
teHandle\n", handle);
> +
> +abort_egress:
> +   return status;
> +}
> +
> +TPM_RESULT TPM_Extend( TPM_PCRINDEX  pcrNum,  // in
> +      TPM_DIGEST  inDigest, // in
> +      TPM_PCRVALUE*  outDigest) // out
> +{
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Extend);
> +
> +   ptr =3D pack_TPM_PCRINDEX(ptr, pcrNum);
> +   ptr =3D pack_TPM_DIGEST(ptr, &inDigest);
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +   ptr =3D unpack_TPM_PCRVALUE(ptr, outDigest);
> +
> +abort_egress:
> +   return status;
> +}
> +
> +TPM_RESULT TPM_Seal(
> +      TPM_KEY_HANDLE  keyHandle,  // in
> +      UINT32    pcrInfoSize, // in
> +      TPM_PCR_INFO*    pcrInfo,  // in
> +      UINT32    inDataSize,  // in
> +      const BYTE*    inData,   // in
> +      TPM_STORED_DATA* sealedData, //out
> +      const TPM_SECRET* osapSharedSecret, //in
> +      const TPM_AUTHDATA* sealedDataAuth, //in
> +      TPM_AUTH_SESSION*   pubAuth  // in, out
> +      )
> +{
> +   int dataAlloced =3D 0;
> +   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_Seal);
> +   TPM_AUTH_BEGIN();
> +
> +   TPM_AUTH_HASH();
> +
> +   ptr =3D pack_TPM_KEY_HANDLE(ptr, keyHandle);
> +
> +   TPM_AUTH_SKIP();
> +
> +   xorEncrypt(osapSharedSecret, &pubAuth->NonceEven,
> +         sealedDataAuth, ptr,
> +         NULL, NULL);
> +   ptr +=3D sizeof(TPM_ENCAUTH);
> +
> +   ptr =3D pack_UINT32(ptr, pcrInfoSize);
> +   ptr =3D pack_TPM_PCR_INFO(ptr, pcrInfo);
> +
> +   ptr =3D pack_UINT32(ptr, inDataSize);
> +   ptr =3D pack_BUFFER(ptr, inData, inDataSize);
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_GEN(osapSharedSecret, pubAuth);
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +   TPM_AUTH_VERIFY_BEGIN();
> +
> +   ptr =3D unpack_TPM_STORED_DATA(ptr, sealedData, UNPACK_ALLOC);
> +   dataAlloced =3D 1;
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_VERIFY(osapSharedSecret, pubAuth);
> +
> +   goto egress;
> +abort_egress:
> +   if(dataAlloced) {
> +      free_TPM_STORED_DATA(sealedData);
> +   }
> +egress:
> +   TPM_AUTH_ERR_CHECK(pubAuth);
> +   return status;
> +}
> +
> +TPM_RESULT TPM_Unseal(
> +      TPM_KEY_HANDLE parentHandle, // in
> +      const TPM_STORED_DATA* sealedData,
> +      UINT32*   outSize,  // out
> +      BYTE**    out, //out
> +      const TPM_AUTHDATA* key_usage_auth, //in
> +      const TPM_AUTHDATA* data_usage_auth, //in
> +      TPM_AUTH_SESSION*   keyAuth,  // in, out
> +      TPM_AUTH_SESSION*   dataAuth  // in, out
> +      )
> +{
> +   TPM_BEGIN(TPM_TAG_RQU_AUTH2_COMMAND, TPM_ORD_Unseal);
> +   TPM_AUTH_BEGIN();
> +
> +   TPM_AUTH_HASH();
> +
> +   ptr =3D pack_TPM_KEY_HANDLE(ptr, parentHandle);
> +
> +   TPM_AUTH_SKIP();
> +
> +   ptr =3D pack_TPM_STORED_DATA(ptr, sealedData);
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_GEN(key_usage_auth, keyAuth);
> +   TPM_AUTH2_GEN(data_usage_auth, dataAuth);
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +   TPM_AUTH_VERIFY_BEGIN();
> +
> +   ptr =3D unpack_UINT32(ptr, outSize);
> +   ptr =3D unpack_ALLOC(ptr, out, *outSize);
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_VERIFY(key_usage_auth, keyAuth);
> +   TPM_AUTH2_VERIFY(data_usage_auth, dataAuth);
> +
> +abort_egress:
> +   TPM_AUTH_ERR_CHECK(keyAuth);
> +   TPM_AUTH_ERR_CHECK(dataAuth);
> +   return status;
> +}
> +
> +TPM_RESULT TPM_Bind(
> +      const TPM_KEY* key,
> +      const BYTE* in,
> +      UINT32 ilen,
> +      BYTE* out)
> +{
> +   TPM_RESULT status;
> +   tpmrsa_context rsa =3D TPMRSA_CTX_INIT;
> +   TPM_BOUND_DATA boundData;
> +   uint8_t plain[TCPA_MAX_BUFFER_LENGTH];
> +   BYTE* ptr =3D plain;
> +
> +   vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);
> +
> +   tpmrsa_set_pubkey(&rsa,
> +         key->pubKey.key, key->pubKey.keyLength,
> +         key->algorithmParms.parms.rsa.exponent,
> +         key->algorithmParms.parms.rsa.exponentSize);
> +
> +   // Fill boundData's accessory information
> +   boundData.ver =3D TPM_STRUCT_VER_1_1;
> +   boundData.payload =3D TPM_PT_BIND;
> +   boundData.payloadData =3D (BYTE*)in;
> +
> +   //marshall the bound data object
> +   ptr =3D pack_TPM_BOUND_DATA(ptr, &boundData, ilen);
> +
> +   // Encrypt the data
> +   TPMTRYRETURN(tpmrsa_pub_encrypt_oaep(&rsa,
> +            ctr_drbg_random, &vtpm_globals.ctr_drbg,
> +            ptr - plain,
> +            plain,
> +            out));
> +
> +abort_egress:
> +   tpmrsa_free(&rsa);
> +   return status;
> +
> +}
> +
> +TPM_RESULT TPM_UnBind(
> +      TPM_KEY_HANDLE  keyHandle,  // in
> +      UINT32 ilen, //in
> +      const BYTE* in, //
> +      UINT32* olen, //
> +      BYTE*    out, //out
> +      const TPM_AUTHDATA* usage_auth,
> +      TPM_AUTH_SESSION* auth //in, out
> +      )
> +{
> +   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_UnBind);
> +   TPM_AUTH_BEGIN();
> +
> +   TPM_AUTH_HASH();
> +
> +   ptr =3D pack_TPM_KEY_HANDLE(ptr, keyHandle);
> +
> +   TPM_AUTH_SKIP();
> +
> +   ptr =3D pack_UINT32(ptr, ilen);
> +   ptr =3D pack_BUFFER(ptr, in, ilen);
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_GEN(usage_auth, auth);
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +   TPM_AUTH_VERIFY_BEGIN();
> +
> +   ptr =3D unpack_UINT32(ptr, olen);
> +   if(*olen > ilen) {
> +      vtpmlogerror(VTPM_LOG_TPM, "Output length < input length!\n");
> +      status =3D TPM_IOERROR;
> +      goto abort_egress;
> +   }
> +   ptr =3D unpack_BUFFER(ptr, out, *olen);
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_VERIFY(usage_auth, auth);
> +
> +abort_egress:
> +egress:
> +   TPM_AUTH_ERR_CHECK(auth);
> +   return status;
> +}
> +
> +TPM_RESULT TPM_CreateWrapKey(
> +      TPM_KEY_HANDLE  hWrappingKey,  // in
> +      const TPM_AUTHDATA* osapSharedSecret,
> +      const TPM_AUTHDATA* dataUsageAuth, //in
> +      const TPM_AUTHDATA* dataMigrationAuth, //in
> +      TPM_KEY*     key, //in, out
> +      TPM_AUTH_SESSION*   pAuth)    // in, out
> +{
> +   int keyAlloced =3D 0;
> +   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_CreateWrapKey);
> +   TPM_AUTH_BEGIN();
> +
> +   TPM_AUTH_HASH();
> +
> +   ptr =3D pack_TPM_KEY_HANDLE(ptr, hWrappingKey);
> +
> +   TPM_AUTH_SKIP();
> +
> +   //Encrypted auths
> +   xorEncrypt(osapSharedSecret, &pAuth->NonceEven,
> +         dataUsageAuth, ptr,
> +         dataMigrationAuth, ptr + sizeof(TPM_ENCAUTH));
> +   ptr +=3D sizeof(TPM_ENCAUTH) * 2;
> +
> +   ptr =3D pack_TPM_KEY(ptr, key);
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_GEN(osapSharedSecret, pAuth);
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +   TPM_AUTH_VERIFY_BEGIN();
> +
> +   keyAlloced =3D 1;
> +   ptr =3D unpack_TPM_KEY(ptr, key, UNPACK_ALLOC);
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_VERIFY(osapSharedSecret, pAuth);
> +
> +   goto egress;
> +abort_egress:
> +   if(keyAlloced) {
> +      free_TPM_KEY(key);
> +   }
> +egress:
> +   TPM_AUTH_ERR_CHECK(pAuth);
> +   return status;
> +}
> +
> +TPM_RESULT TPM_LoadKey(
> +      TPM_KEY_HANDLE  parentHandle, //
> +      const TPM_KEY* key, //in
> +      TPM_HANDLE*  keyHandle,    // out
> +      const TPM_AUTHDATA* usage_auth,
> +      TPM_AUTH_SESSION* auth)
> +{
> +   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_LoadKey);
> +   TPM_AUTH_BEGIN();
> +
> +   TPM_AUTH_HASH();
> +
> +   ptr =3D pack_TPM_KEY_HANDLE(ptr, parentHandle);
> +
> +   TPM_AUTH_SKIP();
> +
> +   ptr =3D pack_TPM_KEY(ptr, key);
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_GEN(usage_auth, auth);
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +   TPM_AUTH_VERIFY_BEGIN();
> +
> +   ptr =3D unpack_UINT32(ptr, keyHandle);
> +
> +   TPM_AUTH_HASH();
> +
> +   TPM_AUTH1_VERIFY(usage_auth, auth);
> +
> +   vtpmloginfo(VTPM_LOG_TPM, "Key Handle: 0x%x opened by TPM_LoadKey\n=
", *keyHandle);
> +
> +abort_egress:
> +   TPM_AUTH_ERR_CHECK(auth);
> +   return status;
> +}
> +
> +TPM_RESULT TPM_EvictKey( TPM_KEY_HANDLE  hKey)  // in
> +{
> +   if(hKey =3D=3D 0) {
> +      return TPM_SUCCESS;
> +   }
> +
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_EvictKey);
> +
> +   ptr =3D pack_TPM_KEY_HANDLE(ptr, hKey);
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +   vtpmloginfo(VTPM_LOG_TPM, "Key handle: 0x%x closed by TPM_EvictKey\=
n", hKey);
> +
> +abort_egress:
> +   return status;
> +}
> +
> +TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle,
> +      TPM_RESOURCE_TYPE rt) {
> +   if(handle =3D=3D 0) {
> +      return TPM_SUCCESS;
> +   }
> +
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_FlushSpecific);
> +
> +   ptr =3D pack_TPM_HANDLE(ptr, handle);
> +   ptr =3D pack_TPM_RESOURCE_TYPE(ptr, rt);
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +abort_egress:
> +   return status;
> +}
> +
> +TPM_RESULT TPM_GetRandom( UINT32*    bytesRequested, // in, out
> +      BYTE*    randomBytes) // out
> +{
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetRandom);
> +
> +   // check input params
> +   if (bytesRequested =3D=3D NULL || randomBytes =3D=3D NULL){
> +      return TPM_BAD_PARAMETER;
> +   }
> +
> +   ptr =3D pack_UINT32(ptr, *bytesRequested);
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +   ptr =3D unpack_UINT32(ptr, bytesRequested);
> +   ptr =3D unpack_BUFFER(ptr, randomBytes, *bytesRequested);
> +
> +abort_egress:
> +   return status;
> +}
> +
> +
> +TPM_RESULT TPM_ReadPubek(
> +      TPM_PUBKEY* pubEK //out
> +      )
> +{
> +   BYTE* antiReplay =3D NULL;
> +   BYTE* kptr =3D NULL;
> +   BYTE digest[TPM_DIGEST_SIZE];
> +   sha1_context ctx;
> +
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_ReadPubek);
> +
> +   //antiReplay nonce
> +   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
> +   antiReplay =3D ptr;
> +   ptr +=3D TPM_DIGEST_SIZE;
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +   //unpack and allocate the key
> +   kptr =3D ptr;
> +   ptr =3D unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
> +
> +   //Verify the checksum
> +   sha1_starts(&ctx);
> +   sha1_update(&ctx, kptr, ptr - kptr);
> +   sha1_update(&ctx, antiReplay, TPM_DIGEST_SIZE);
> +   sha1_finish(&ctx, digest);
> +
> +   //ptr points to the checksum computed by TPM
> +   if(memcmp(digest, ptr, TPM_DIGEST_SIZE)) {
> +      vtpmlogerror(VTPM_LOG_TPM, "TPM_ReadPubek: Checksum returned by =
TPM was invalid!\n");
> +      status =3D TPM_FAIL;
> +      goto abort_egress;
> +   }
> +
> +   goto egress;
> +abort_egress:
> +   if(kptr !=3D NULL) { //If we unpacked the pubEK, we have to free it=

> +      free_TPM_PUBKEY(pubEK);
> +   }
> +egress:
> +   return status;
> +}
> +
> +
> +TPM_RESULT TPM_SaveState(void)
> +{
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_SaveState);
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +abort_egress:
> +   return status;
> +}
> +
> +TPM_RESULT TPM_GetCapability(
> +      TPM_CAPABILITY_AREA capArea,
> +      UINT32 subCapSize,
> +      const BYTE* subCap,
> +      UINT32* respSize,
> +      BYTE** resp)
> +{
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetCapability);
> +
> +   ptr =3D pack_TPM_CAPABILITY_AREA(ptr, capArea);
> +   ptr =3D pack_UINT32(ptr, subCapSize);
> +   ptr =3D pack_BUFFER(ptr, subCap, subCapSize);
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +   ptr =3D unpack_UINT32(ptr, respSize);
> +   ptr =3D unpack_ALLOC(ptr, resp, *respSize);
> +
> +abort_egress:
> +   return status;
> +}
> +
> +TPM_RESULT TPM_CreateEndorsementKeyPair(
> +      const TPM_KEY_PARMS* keyInfo,
> +      TPM_PUBKEY* pubEK)
> +{
> +   BYTE* kptr =3D NULL;
> +   sha1_context ctx;
> +   TPM_DIGEST checksum;
> +   TPM_DIGEST hash;
> +   TPM_NONCE antiReplay;
> +   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_CreateEndorsementKeyPair);
> +
> +   //Make anti replay nonce
> +   vtpmmgr_rand(antiReplay.nonce, sizeof(antiReplay.nonce));
> +
> +   ptr =3D pack_TPM_NONCE(ptr, &antiReplay);
> +   ptr =3D pack_TPM_KEY_PARMS(ptr, keyInfo);
> +
> +   TPM_TRANSMIT();
> +   TPM_UNPACK_VERIFY();
> +
> +   sha1_starts(&ctx);
> +
> +   kptr =3D ptr;
> +   ptr =3D unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
> +
> +   /* Hash the pub key blob */
> +   sha1_update(&ctx, kptr, ptr - kptr);
> +   ptr =3D unpack_TPM_DIGEST(ptr, &checksum);
> +
> +   sha1_update(&ctx, antiReplay.nonce, sizeof(antiReplay.nonce));
> +
> +   sha1_finish(&ctx, hash.digest);
> +   if(memcmp(checksum.digest, hash.digest, TPM_DIGEST_SIZE)) {
> +      vtpmloginfo(VTPM_LOG_VTPM, "TPM_CreateEndorsementKey: Checkum ve=
rification failed!\n");
> +      status =3D TPM_FAIL;
> +      goto abort_egress;
> +   }
> +
> +   goto egress;
> +abort_egress:
> +   if(kptr) {
> +      free_TPM_PUBKEY(pubEK);
> +   }
> +egress:
> +   return status;
> +}
> +
> +TPM_RESULT TPM_TransmitData(
> +      BYTE* in,
> +      UINT32 insize,
> +      BYTE* out,
> +      UINT32* outsize) {
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +
> +   UINT32 i;
> +   vtpmloginfo(VTPM_LOG_TXDATA, "Sending buffer =3D 0x");
> +   for(i =3D 0 ; i < insize ; i++)
> +      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", in[i]);
> +
> +   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> +
> +   ssize_t size =3D 0;
> +
> +   // send the request
> +   size =3D write (vtpm_globals.tpm_fd, in, insize);
> +   if (size < 0) {
> +      vtpmlogerror(VTPM_LOG_TXDATA, "write() failed : %s\n", strerror(=
errno));
> +      ERRORDIE (TPM_IOERROR);
> +   }
> +   else if ((UINT32) size < insize) {
> +      vtpmlogerror(VTPM_LOG_TXDATA, "Wrote %d instead of %d bytes!\n",=
 (int) size, insize);
> +      ERRORDIE (TPM_IOERROR);
> +   }
> +
> +   // read the response
> +   size =3D read (vtpm_globals.tpm_fd, out, *outsize);
> +   if (size < 0) {
> +      vtpmlogerror(VTPM_LOG_TXDATA, "read() failed : %s\n", strerror(e=
rrno));
> +      ERRORDIE (TPM_IOERROR);
> +   }
> +
> +   vtpmloginfo(VTPM_LOG_TXDATA, "Receiving buffer =3D 0x");
> +   for(i =3D 0 ; i < size ; i++)
> +      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out[i]);
> +
> +   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
> +
> +   *outsize =3D size;
> +   goto egress;
> +
> +abort_egress:
> +egress:
> +   return status;
> +}
> diff --git a/stubdom/vtpmmgr/tpm.h b/stubdom/vtpmmgr/tpm.h
> new file mode 100644
> index 0000000..304e145
> --- /dev/null
> +++ b/stubdom/vtpmmgr/tpm.h
> @@ -0,0 +1,218 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005/2006, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#ifndef __TPM_H__
> +#define __TPM_H__
> +
> +#include "tcg.h"
> +
> +// ------------------------------------------------------------------
> +// Exposed API
> +// ------------------------------------------------------------------
> +
> +// TPM v1.1B Command Set
> +
> +// Authorzation
> +TPM_RESULT TPM_OIAP(
> +      TPM_AUTH_SESSION*   auth //out
> +      );
> +
> +TPM_RESULT TPM_OSAP (
> +      TPM_ENTITY_TYPE entityType,  // in
> +      UINT32    entityValue, // in
> +      const TPM_AUTHDATA* usageAuth, //in
> +      TPM_SECRET *sharedSecret, //out
> +      TPM_AUTH_SESSION *auth);
> +
> +TPM_RESULT TPM_TakeOwnership(
> +      const TPM_PUBKEY *pubEK, //in
> +      const TPM_AUTHDATA* ownerAuth, //in
> +      const TPM_AUTHDATA* srkAuth, //in
> +      const TPM_KEY* inSrk, //in
> +      TPM_KEY* outSrk, //out, optional
> +      TPM_AUTH_SESSION*   auth   // in, out
> +      );
> +
> +TPM_RESULT TPM_DisablePubekRead (
> +      const TPM_AUTHDATA* ownerAuth,
> +      TPM_AUTH_SESSION*   auth
> +      );
> +
> +TPM_RESULT TPM_TerminateHandle ( TPM_AUTHHANDLE  handle  // in
> +      );
> +
> +TPM_RESULT TPM_FlushSpecific ( TPM_HANDLE  handle,  // in
> +      TPM_RESOURCE_TYPE resourceType //in
> +      );
> +
> +// TPM Mandatory
> +TPM_RESULT TPM_Extend ( TPM_PCRINDEX  pcrNum,  // in
> +      TPM_DIGEST   inDigest, // in
> +      TPM_PCRVALUE*   outDigest // out
> +      );
> +
> +TPM_RESULT TPM_PcrRead ( TPM_PCRINDEX  pcrNum,  // in
> +      TPM_PCRVALUE*  outDigest // out
> +      );
> +
> +TPM_RESULT TPM_Quote ( TCS_KEY_HANDLE  keyHandle,  // in
> +      TPM_NONCE   antiReplay,  // in
> +      UINT32*    PcrDataSize, // in, out
> +      BYTE**    PcrData,  // in, out
> +      TPM_AUTH_SESSION*   privAuth,  // in, out
> +      UINT32*    sigSize,  // out
> +      BYTE**    sig    // out
> +      );
> +
> +TPM_RESULT TPM_Seal(
> +      TCS_KEY_HANDLE  keyHandle,  // in
> +      UINT32    pcrInfoSize, // in
> +      TPM_PCR_INFO*    pcrInfo,  // in
> +      UINT32    inDataSize,  // in
> +      const BYTE*    inData,   // in
> +      TPM_STORED_DATA* sealedData, //out
> +      const TPM_SECRET* osapSharedSecret, //in
> +      const TPM_AUTHDATA* sealDataAuth, //in
> +      TPM_AUTH_SESSION*   pubAuth  // in, out
> +      );
> +
> +TPM_RESULT TPM_Unseal (
> +      TPM_KEY_HANDLE parentHandle, // in
> +      const TPM_STORED_DATA* sealedData,
> +      UINT32*   outSize,  // out
> +      BYTE**    out, //out
> +      const TPM_AUTHDATA* key_usage_auth, //in
> +      const TPM_AUTHDATA* data_usage_auth, //in
> +      TPM_AUTH_SESSION*   keyAuth,  // in, out
> +      TPM_AUTH_SESSION*   dataAuth  // in, out
> +      );
> +
> +TPM_RESULT TPM_DirWriteAuth ( TPM_DIRINDEX  dirIndex,  // in
> +      TPM_DIRVALUE  newContents, // in
> +      TPM_AUTH_SESSION*   ownerAuth  // in, out
> +      );
> +
> +TPM_RESULT TPM_DirRead ( TPM_DIRINDEX  dirIndex, // in
> +      TPM_DIRVALUE*  dirValue // out
> +      );
> +
> +TPM_RESULT TPM_Bind(
> +      const TPM_KEY* key, //in
> +      const BYTE* in, //in
> +      UINT32 ilen, //in
> +      BYTE* out //out, must be at least cipher block size
> +      );
> +
> +TPM_RESULT TPM_UnBind (
> +      TCS_KEY_HANDLE  keyHandle,  // in
> +      UINT32 ilen, //in
> +      const BYTE* in, //
> +      UINT32*   outDataSize, // out
> +      BYTE*    outData, //out
> +      const TPM_AUTHDATA* usage_auth,
> +      TPM_AUTH_SESSION* auth //in, out
> +      );
> +
> +TPM_RESULT TPM_CreateWrapKey (
> +      TCS_KEY_HANDLE  hWrappingKey,  // in
> +      const TPM_AUTHDATA* osapSharedSecret,
> +      const TPM_AUTHDATA* dataUsageAuth, //in
> +      const TPM_AUTHDATA* dataMigrationAuth, //in
> +      TPM_KEY*     key, //in
> +      TPM_AUTH_SESSION*   pAuth    // in, out
> +      );
> +
> +TPM_RESULT TPM_LoadKey (
> +      TPM_KEY_HANDLE  parentHandle, //
> +      const TPM_KEY* key, //in
> +      TPM_HANDLE*  keyHandle,    // out
> +      const TPM_AUTHDATA* usage_auth,
> +      TPM_AUTH_SESSION* auth
> +      );
> +
> +TPM_RESULT TPM_GetPubKey (  TCS_KEY_HANDLE  hKey,   // in
> +      TPM_AUTH_SESSION*   pAuth,   // in, out
> +      UINT32*    pcPubKeySize, // out
> +      BYTE**    prgbPubKey  // out
> +      );
> +
> +TPM_RESULT TPM_EvictKey ( TCS_KEY_HANDLE  hKey  // in
> +      );
> +
> +TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle, //in
> +      TPM_RESOURCE_TYPE rt //in
> +      );
> +
> +TPM_RESULT TPM_Sign ( TCS_KEY_HANDLE  keyHandle,  // in
> +      UINT32    areaToSignSize, // in
> +      BYTE*    areaToSign,  // in
> +      TPM_AUTH_SESSION*   privAuth,  // in, out
> +      UINT32*    sigSize,  // out
> +      BYTE**    sig    // out
> +      );
> +
> +TPM_RESULT TPM_GetRandom (  UINT32*    bytesRequested, // in, out
> +      BYTE*    randomBytes  // out
> +      );
> +
> +TPM_RESULT TPM_StirRandom (  UINT32    inDataSize, // in
> +      BYTE*    inData  // in
> +      );
> +
> +TPM_RESULT TPM_ReadPubek (
> +      TPM_PUBKEY* pubEK //out
> +      );
> +
> +TPM_RESULT TPM_GetCapability(
> +      TPM_CAPABILITY_AREA capArea,
> +      UINT32 subCapSize,
> +      const BYTE* subCap,
> +      UINT32* respSize,
> +      BYTE** resp);
> +
> +TPM_RESULT TPM_SaveState(void);
> +
> +TPM_RESULT TPM_CreateEndorsementKeyPair(
> +      const TPM_KEY_PARMS* keyInfo,
> +      TPM_PUBKEY* pubEK);
> +
> +TPM_RESULT TPM_TransmitData(
> +      BYTE* in,
> +      UINT32 insize,
> +      BYTE* out,
> +      UINT32* outsize);
> +
> +#endif //TPM_H
> diff --git a/stubdom/vtpmmgr/tpmrsa.c b/stubdom/vtpmmgr/tpmrsa.c
> new file mode 100644
> index 0000000..56094e7
> --- /dev/null
> +++ b/stubdom/vtpmmgr/tpmrsa.c
> @@ -0,0 +1,175 @@
> +/*
> + *  The RSA public-key cryptosystem
> + *
> + *  Copyright (C) 2006-2011, Brainspark B.V.
> + *
> + *  This file is part of PolarSSL (http://www.polarssl.org)
> + *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>=

> + *
> + *  All rights reserved.
> + *
> + *  This program is free software; you can redistribute it and/or modi=
fy
> + *  it under the terms of the GNU General Public License as published =
by
> + *  the Free Software Foundation; either version 2 of the License, or
> + *  (at your option) any later version.
> + *
> + *  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.,
> + *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> + */
> +/*
> + *  RSA was designed by Ron Rivest, Adi Shamir and Len Adleman.
> + *
> + *  http://theory.lcs.mit.edu/~rivest/rsapaper.pdf
> + *  http://www.cacr.math.uwaterloo.ca/hac/about/chap8.pdf
> + */
> +
> +#include "tcg.h"
> +#include "polarssl/sha1.h"
> +
> +#include <stdlib.h>
> +#include <stdio.h>
> +
> +#include "tpmrsa.h"
> +
> +#define HASH_LEN 20
> +
> +void tpmrsa_set_pubkey(tpmrsa_context* ctx,
> +      const unsigned char* key,
> +      int keylen,
> +      const unsigned char* exponent,
> +      int explen) {
> +
> +   tpmrsa_free(ctx);
> +
> +   if(explen =3D=3D 0) { //Default e=3D 2^16+1
> +      mpi_lset(&ctx->E, 65537);
> +   } else {
> +      mpi_read_binary(&ctx->E, exponent, explen);
> +   }
> +   mpi_read_binary(&ctx->N, key, keylen);
> +
> +   ctx->len =3D ( mpi_msb(&ctx->N) + 7) >> 3;
> +}
> +
> +static TPM_RESULT tpmrsa_public( tpmrsa_context *ctx,
> +      const unsigned char *input,
> +      unsigned char *output )
> +{
> +   int ret;
> +   size_t olen;
> +   mpi T;
> +
> +   mpi_init( &T );
> +
> +   MPI_CHK( mpi_read_binary( &T, input, ctx->len ) );
> +
> +   if( mpi_cmp_mpi( &T, &ctx->N ) >=3D 0 )
> +   {
> +      mpi_free( &T );
> +      return TPM_ENCRYPT_ERROR;
> +   }
> +
> +   olen =3D ctx->len;
> +   MPI_CHK( mpi_exp_mod( &T, &T, &ctx->E, &ctx->N, &ctx->RN ) );
> +   MPI_CHK( mpi_write_binary( &T, output, olen ) );
> +
> +cleanup:
> +
> +   mpi_free( &T );
> +
> +   if( ret !=3D 0 )
> +      return TPM_ENCRYPT_ERROR;
> +
> +   return TPM_SUCCESS;
> +}
> +
> +static void mgf_mask( unsigned char *dst, int dlen, unsigned char *src=
, int slen)
> +{
> +   unsigned char mask[HASH_LEN];
> +   unsigned char counter[4] =3D {0, 0, 0, 0};
> +   int i;
> +   sha1_context mctx;
> +
> +   //We always hash the src with the counter, so save the partial hash=

> +   sha1_starts(&mctx);
> +   sha1_update(&mctx, src, slen);
> +
> +   // Generate and apply dbMask
> +   while(dlen > 0) {
> +      //Copy the sha1 context
> +      sha1_context ctx =3D mctx;
> +
> +      //compute hash for input || counter
> +      sha1_update(&ctx, counter, sizeof(counter));
> +      sha1_finish(&ctx, mask);
> +
> +      //Apply the mask
> +      for(i =3D 0; i < (dlen < HASH_LEN ? dlen : HASH_LEN); ++i) {
> +         *(dst++) ^=3D mask[i];
> +      }
> +
> +      //Increment counter
> +      ++counter[3];
> +
> +      dlen -=3D HASH_LEN;
> +   }
> +}
> +
> +/*
> + * Add the message padding, then do an RSA operation
> + */
> +TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
> +      int (*f_rng)(void *, unsigned char *, size_t),
> +      void *p_rng,
> +      size_t ilen,
> +      const unsigned char *input,
> +      unsigned char *output )
> +{
> +   int ret;
> +   int olen;
> +   unsigned char* seed =3D output + 1;
> +   unsigned char* db =3D output + HASH_LEN +1;
> +
> +   olen =3D ctx->len-1;
> +
> +   if( f_rng =3D=3D NULL )
> +      return TPM_ENCRYPT_ERROR;
> +
> +   if( ilen > olen - 2 * HASH_LEN - 1)
> +      return TPM_ENCRYPT_ERROR;
> +
> +   output[0] =3D 0;
> +
> +   //Encoding parameter p
> +   sha1((unsigned char*)"TCPA", 4, db);
> +
> +   //PS
> +   memset(db + HASH_LEN, 0,
> +         olen - ilen - 2 * HASH_LEN - 1);
> +
> +   //constant 1 byte
> +   db[olen - ilen - HASH_LEN -1] =3D 0x01;
> +
> +   //input string
> +   memcpy(db + olen - ilen - HASH_LEN,
> +         input, ilen);
> +
> +   //Generate random seed
> +   if( ( ret =3D f_rng( p_rng, seed, HASH_LEN ) ) !=3D 0 )
> +      return TPM_ENCRYPT_ERROR;
> +
> +   // maskedDB: Apply dbMask to DB
> +   mgf_mask( db, olen - HASH_LEN, seed, HASH_LEN);
> +
> +   // maskedSeed: Apply seedMask to seed
> +   mgf_mask( seed, HASH_LEN, db, olen - HASH_LEN);
> +
> +   // Do the crypto op
> +   return tpmrsa_public(ctx, output, output);
> +}
> diff --git a/stubdom/vtpmmgr/tpmrsa.h b/stubdom/vtpmmgr/tpmrsa.h
> new file mode 100644
> index 0000000..59579e7
> --- /dev/null
> +++ b/stubdom/vtpmmgr/tpmrsa.h
> @@ -0,0 +1,67 @@
> +/**
> + * \file rsa.h
> + *
> + * \brief The RSA public-key cryptosystem
> + *
> + *  Copyright (C) 2006-2010, Brainspark B.V.
> + *
> + *  This file is part of PolarSSL (http://www.polarssl.org)
> + *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>=

> + *
> + *  All rights reserved.
> + *
> + *  This program is free software; you can redistribute it and/or modi=
fy
> + *  it under the terms of the GNU General Public License as published =
by
> + *  the Free Software Foundation; either version 2 of the License, or
> + *  (at your option) any later version.
> + *
> + *  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.,
> + *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> + */
> +#ifndef TPMRSA_H
> +#define TPMRSA_H
> +
> +#include "tcg.h"
> +#include <polarssl/bignum.h>
> +
> +/* tpm software key */
> +typedef struct
> +{
> +    size_t len;                 /*!<  size(N) in chars  */
> +
> +    mpi N;                      /*!<  public modulus    */
> +    mpi E;                      /*!<  public exponent   */
> +
> +    mpi RN;                     /*!<  cached R^2 mod N  */
> +}
> +tpmrsa_context;
> +
> +#define TPMRSA_CTX_INIT { 0, {0, 0, NULL}, {0, 0, NULL}, {0, 0, NULL}}=

> +
> +/* Setup the rsa context using tpm public key data */
> +void tpmrsa_set_pubkey(tpmrsa_context* ctx,
> +      const unsigned char* key,
> +      int keylen,
> +      const unsigned char* exponent,
> +      int explen);
> +
> +/* Do rsa public crypto */
> +TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
> +      int (*f_rng)(void *, unsigned char *, size_t),
> +      void *p_rng,
> +      size_t ilen,
> +      const unsigned char *input,
> +      unsigned char *output );
> +
> +/* free tpmrsa key */
> +inline void tpmrsa_free( tpmrsa_context *ctx ) {
> +   mpi_free( &ctx->RN ); mpi_free( &ctx->E  ); mpi_free( &ctx->N  );
> +}
> +
> +#endif /* tpmrsa.h */
> diff --git a/stubdom/vtpmmgr/uuid.h b/stubdom/vtpmmgr/uuid.h
> new file mode 100644
> index 0000000..4737645
> --- /dev/null
> +++ b/stubdom/vtpmmgr/uuid.h
> @@ -0,0 +1,50 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#ifndef VTPMMGR_UUID_H
> +#define VTPMMGR_UUID_H
> +
> +#define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%=
02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
> +#define UUID_FMTLEN ((2*16)+4) /* 16 hex bytes plus 4 hypens */
> +#define UUID_BYTES(uuid) uuid[0], uuid[1], uuid[2], uuid[3], \
> +                                uuid[4], uuid[5], uuid[6], uuid[7], \
> +                                uuid[8], uuid[9], uuid[10], uuid[11], =
\
> +                                uuid[12], uuid[13], uuid[14], uuid[15]=

> +
> +
> +typedef uint8_t uuid_t[16];
> +
> +#endif
> diff --git a/stubdom/vtpmmgr/vtpm_cmd_handler.c b/stubdom/vtpmmgr/vtpm_=
cmd_handler.c
> new file mode 100644
> index 0000000..f82a2a9
> --- /dev/null
> +++ b/stubdom/vtpmmgr/vtpm_cmd_handler.c
> @@ -0,0 +1,152 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#include <inttypes.h>
> +#include <string.h>
> +#include <stdlib.h>
> +
> +#include "marshal.h"
> +#include "log.h"
> +#include "vtpm_storage.h"
> +#include "vtpmmgr.h"
> +#include "tpm.h"
> +#include "tcg.h"
> +
> +static TPM_RESULT vtpmmgr_SaveHashKey(
> +      const uuid_t uuid,
> +      tpmcmd_t* tpmcmd)
> +{
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +
> +   if(tpmcmd->req_len !=3D VTPM_COMMAND_HEADER_SIZE + HASHKEYSZ) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_ORD_SAVEHASHKEY hashkey too sh=
ort!\n");
> +      status =3D TPM_BAD_PARAMETER;
> +      goto abort_egress;
> +   }
> +
> +   /* Do the command */
> +   TPMTRYRETURN(vtpm_storage_save_hashkey(uuid, tpmcmd->req + VTPM_COM=
MAND_HEADER_SIZE));
> +
> +abort_egress:
> +   pack_TPM_RSP_HEADER(tpmcmd->resp,
> +         VTPM_TAG_RSP, VTPM_COMMAND_HEADER_SIZE, status);
> +   tpmcmd->resp_len =3D VTPM_COMMAND_HEADER_SIZE;
> +
> +   return status;
> +}
> +
> +static TPM_RESULT vtpmmgr_LoadHashKey(
> +      const uuid_t uuid,
> +      tpmcmd_t* tpmcmd) {
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +
> +   tpmcmd->resp_len =3D VTPM_COMMAND_HEADER_SIZE;
> +
> +   TPMTRYRETURN(vtpm_storage_load_hashkey(uuid, tpmcmd->resp + VTPM_CO=
MMAND_HEADER_SIZE));
> +
> +   tpmcmd->resp_len +=3D HASHKEYSZ;
> +
> +abort_egress:
> +   pack_TPM_RSP_HEADER(tpmcmd->resp,
> +         VTPM_TAG_RSP, tpmcmd->resp_len, status);
> +
> +   return status;
> +}
> +
> +
> +TPM_RESULT vtpmmgr_handle_cmd(
> +      const uuid_t uuid,
> +      tpmcmd_t* tpmcmd)
> +{
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +   TPM_TAG tag;
> +   UINT32 size;
> +   TPM_COMMAND_CODE ord;
> +
> +   unpack_TPM_RQU_HEADER(tpmcmd->req,
> +         &tag, &size, &ord);
> +
> +   /* Handle the command now */
> +   switch(tag) {
> +      case VTPM_TAG_REQ:
> +         //This is a vTPM command
> +         switch(ord) {
> +            case VTPM_ORD_SAVEHASHKEY:
> +               return vtpmmgr_SaveHashKey(uuid, tpmcmd);
> +            case VTPM_ORD_LOADHASHKEY:
> +               return vtpmmgr_LoadHashKey(uuid, tpmcmd);
> +            default:
> +               vtpmlogerror(VTPM_LOG_VTPM, "Invalid vTPM Ordinal %" PR=
Iu32 "\n", ord);
> +               status =3D TPM_BAD_ORDINAL;
> +         }
> +         break;
> +      case TPM_TAG_RQU_COMMAND:
> +      case TPM_TAG_RQU_AUTH1_COMMAND:
> +      case TPM_TAG_RQU_AUTH2_COMMAND:
> +         //This is a TPM passthrough command
> +         switch(ord) {
> +            case TPM_ORD_GetRandom:
> +               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_GetRandom\=
n");
> +               break;
> +            case TPM_ORD_PcrRead:
> +               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_PcrRead\n"=
);
> +               break;
> +            default:
> +               vtpmlogerror(VTPM_LOG_VTPM, "TPM Disallowed Passthrough=
 ord=3D%" PRIu32 "\n", ord);
> +               status =3D TPM_DISABLED_CMD;
> +               goto abort_egress;
> +         }
> +
> +         size =3D TCPA_MAX_BUFFER_LENGTH;
> +         TPMTRYRETURN(TPM_TransmitData(tpmcmd->req, tpmcmd->req_len, t=
pmcmd->resp, &size));
> +         tpmcmd->resp_len =3D size;
> +
> +         unpack_TPM_RESULT(tpmcmd->resp + sizeof(TPM_TAG) + sizeof(UIN=
T32), &status);
> +         return status;
> +
> +         break;
> +      default:
> +         vtpmlogerror(VTPM_LOG_VTPM, "Invalid tag=3D%" PRIu16 "\n", ta=
g);
> +         status =3D TPM_BADTAG;
> +   }
> +
> +abort_egress:
> +   tpmcmd->resp_len =3D VTPM_COMMAND_HEADER_SIZE;
> +   pack_TPM_RSP_HEADER(tpmcmd->resp,
> +         tag + 3, tpmcmd->resp_len, status);
> +
> +   return status;
> +}
> diff --git a/stubdom/vtpmmgr/vtpm_manager.h b/stubdom/vtpmmgr/vtpm_mana=
ger.h
> new file mode 100644
> index 0000000..a2bbcca
> --- /dev/null
> +++ b/stubdom/vtpmmgr/vtpm_manager.h
> @@ -0,0 +1,64 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#ifndef VTPM_MANAGER_H
> +#define VTPM_MANAGER_H
> +
> +#define VTPM_TAG_REQ 0x01c1
> +#define VTPM_TAG_RSP 0x01c4
> +#define COMMAND_BUFFER_SIZE 4096
> +
> +// Header size
> +#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
> +
> +//************************ Command Codes ****************************
> +#define VTPM_ORD_BASE       0x0000
> +#define VTPM_PRIV_MASK      0x01000000 // Priviledged VTPM Command
> +#define VTPM_PRIV_BASE      (VTPM_ORD_BASE | VTPM_PRIV_MASK)
> +
> +// Non-priviledged VTPM Commands (From DMI's)
> +#define VTPM_ORD_SAVEHASHKEY      (VTPM_ORD_BASE + 1) // DMI requests =
encryption key for persistent storage
> +#define VTPM_ORD_LOADHASHKEY      (VTPM_ORD_BASE + 2) // DMI requests =
symkey to be regenerated
> +
> +//************************ Return Codes ****************************
> +#define VTPM_SUCCESS               0
> +#define VTPM_FAIL                  1
> +#define VTPM_UNSUPPORTED           2
> +#define VTPM_FORBIDDEN             3
> +#define VTPM_RESTORE_CONTEXT_FAILED    4
> +#define VTPM_INVALID_REQUEST       5
> +
> +#endif
> diff --git a/stubdom/vtpmmgr/vtpm_storage.c b/stubdom/vtpmmgr/vtpm_stor=
age.c
> new file mode 100644
> index 0000000..9ce0c32
> --- /dev/null
> +++ b/stubdom/vtpmmgr/vtpm_storage.c
> @@ -0,0 +1,794 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
> + * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
> + * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNES=
S
> + * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
> + * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE=

> + * SOFTWARE.
> + */
> +
> +/***************************************************************
> + * DISK IMAGE LAYOUT
> + * *************************************************************
> + * All data is stored in BIG ENDIAN format
> + * *************************************************************
> + * Section 1: Header
> + *
> + * 10 bytes     id                     ID String "VTPMMGRDOM"
> + * uint32_t     version                Disk Image version number (curr=
ent =3D=3D 1)
> + * uint32_t      storage_key_len       Length of the storage Key
> + * TPM_KEY       storage_key           Marshalled TPM_KEY structure (S=
ee TPM spec v2)
> + * RSA_BLOCK     aes_crypto             Encrypted aes key data (RSA_CI=
PHER_SIZE bytes), bound by the storage_key
> + *  BYTE[32] aes_key                    Aes key for encrypting the uui=
d table
> + *  uint32_t cipher_sz                  Encrypted size of the uuid tab=
le
> + *
> + * *************************************************************
> + * Section 2: Uuid Table
> + *
> + * This table is encrypted by the aes_key in the header. The cipher te=
xt size is just
> + * large enough to hold all of the entries plus required padding.
> + *
> + * Each entry is as follows
> + * BYTE[16] uuid                       Uuid of a vtpm that is stored o=
n this disk
> + * uint32_t offset                     Disk offset where the vtpm data=
 is stored
> + *
> + * *************************************************************
> + * Section 3: Vtpm Table
> + *
> + * The rest of the disk stores vtpms. Each vtpm is an RSA_BLOCK encryp=
ted
> + * by the storage key. Each vtpm must exist on an RSA_BLOCK aligned bo=
undary,
> + * starting at the first RSA_BLOCK aligned offset after the uuid table=
=2E
> + * As the uuid table grows, vtpms may be relocated.
> + *
> + * RSA_BLOCK     vtpm_crypto          Vtpm data encrypted by storage_k=
ey
> + *   BYTE[20]    hash                 Sha1 hash of vtpm encrypted data=

> + *   BYTE[16]    vtpm_aes_key         Encryption key for vtpm data
> + *
> +  *************************************************************
> + */
> +#define DISKVERS 1
> +#define IDSTR "VTPMMGRDOM"
> +#define IDSTRLEN 10
> +#define AES_BLOCK_SIZE 16
> +#define AES_KEY_BITS 256
> +#define AES_KEY_SIZE (AES_KEY_BITS/8)
> +#define BUF_SIZE 4096
> +
> +#define UUID_TBL_ENT_SIZE (sizeof(uuid_t) + sizeof(uint32_t))
> +
> +#define HEADERSZ (10 + 4 + 4)
> +
> +#define TRY_READ(buf, size, msg) do {\
> +   int rc; \
> +   if((rc =3D read(blkfront_fd, buf, (size))) !=3D (size)) { \
> +      vtpmlogerror(VTPM_LOG_VTPM, "read() failed! " msg " : rc=3D(%d/%=
d), error=3D(%s)\n", rc, (int)(size), strerror(errno)); \
> +      status =3D TPM_IOERROR;\
> +      goto abort_egress;\
> +   } \
> +} while(0)
> +
> +#define TRY_WRITE(buf, size, msg) do {\
> +   int rc; \
> +   if((rc =3D write(blkfront_fd, buf, (size))) !=3D (size)) { \
> +      vtpmlogerror(VTPM_LOG_VTPM, "write() failed! " msg " : rc=3D(%d/=
%d), error=3D(%s)\n", rc, (int)(size), strerror(errno)); \
> +      status =3D TPM_IOERROR;\
> +      goto abort_egress;\
> +   } \
> +} while(0)
> +
> +#include <blkfront.h>
> +#include <unistd.h>
> +#include <errno.h>
> +#include <string.h>
> +#include <inttypes.h>
> +#include <stdlib.h>
> +#include <stdbool.h>
> +#include <mini-os/byteorder.h>
> +#include <polarssl/aes.h>
> +
> +#include "vtpm_manager.h"
> +#include "log.h"
> +#include "marshal.h"
> +#include "tpm.h"
> +#include "uuid.h"
> +
> +#include "vtpmmgr.h"
> +#include "vtpm_storage.h"
> +
> +#define MAX(a,b) ( ((a) > (b)) ? (a) : (b) )
> +#define MIN(a,b) ( ((a) < (b)) ? (a) : (b) )
> +
> +/* blkfront device objets */
> +static struct blkfront_dev* blkdev =3D NULL;
> +static int blkfront_fd =3D -1;
> +
> +struct Vtpm {
> +   uuid_t uuid;
> +   int offset;
> +};
> +struct Storage {
> +   int aes_offset;
> +   int uuid_offset;
> +   int end_offset;
> +
> +   int num_vtpms;
> +   int num_vtpms_alloced;
> +   struct Vtpm* vtpms;
> +};
> +
> +/* Global storage data */
> +static struct Storage g_store =3D {
> +   .vtpms =3D NULL,
> +};
> +
> +static int get_offset(void) {
> +   return lseek(blkfront_fd, 0, SEEK_CUR);
> +}
> +
> +static void reset_store(void) {
> +   g_store.aes_offset =3D 0;
> +   g_store.uuid_offset =3D 0;
> +   g_store.end_offset =3D 0;
> +
> +   g_store.num_vtpms =3D 0;
> +   g_store.num_vtpms_alloced =3D 0;
> +   free(g_store.vtpms);
> +   g_store.vtpms =3D NULL;
> +}
> +
> +static int vtpm_get_index(const uuid_t uuid) {
> +   int st =3D 0;
> +   int ed =3D g_store.num_vtpms-1;
> +   while(st <=3D ed) {
> +      int mid =3D ((unsigned int)st + (unsigned int)ed) >> 1; //avoid =
overflow
> +      int c =3D memcmp(uuid, &g_store.vtpms[mid].uuid, sizeof(uuid_t))=
;
> +      if(c =3D=3D 0) {
> +         return mid;
> +      } else if(c > 0) {
> +         st =3D mid + 1;
> +      } else {
> +         ed =3D mid - 1;
> +      }
> +   }
> +   return -(st + 1);
> +}
> +
> +static void vtpm_add(const uuid_t uuid, int offset, int index) {
> +   /* Realloc more space if needed */
> +   if(g_store.num_vtpms >=3D g_store.num_vtpms_alloced) {
> +      g_store.num_vtpms_alloced +=3D 16;
> +      g_store.vtpms =3D realloc(
> +            g_store.vtpms,
> +            sizeof(struct Vtpm) * g_store.num_vtpms_alloced);
> +   }
> +
> +   /* Move everybody after the new guy */
> +   for(int i =3D g_store.num_vtpms; i > index; --i) {
> +      g_store.vtpms[i] =3D g_store.vtpms[i-1];
> +   }
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Registered vtpm " UUID_FMT "\n", UUID_B=
YTES(uuid));
> +
> +   /* Finally add new one */
> +   memcpy(g_store.vtpms[index].uuid, uuid, sizeof(uuid_t));
> +   g_store.vtpms[index].offset =3D offset;
> +   ++g_store.num_vtpms;
> +}
> +
> +#if 0
> +static void vtpm_remove(int index) {
> +   for(i =3D index; i < g_store.num_vtpms; ++i) {
> +      g_store.vtpms[i] =3D g_store.vtpms[i+1];
> +   }
> +   --g_store.num_vtpms;
> +}
> +#endif
> +
> +static int pack_uuid_table(uint8_t* table, int size, int* nvtpms) {
> +   uint8_t* ptr =3D table;
> +   while(*nvtpms < g_store.num_vtpms && size >=3D 0)
> +   {
> +      /* Pack the uuid */
> +      memcpy(ptr, (uint8_t*)g_store.vtpms[*nvtpms].uuid, sizeof(uuid_t=
));
> +      ptr+=3D sizeof(uuid_t);
> +
> +
> +      /* Pack the offset */
> +      ptr =3D pack_UINT32(ptr, g_store.vtpms[*nvtpms].offset);
> +
> +      ++*nvtpms;
> +      size -=3D UUID_TBL_ENT_SIZE;
> +   }
> +   return ptr - table;
> +}
> +
> +/* Extract the uuids */
> +static int extract_uuid_table(uint8_t* table, int size) {
> +   uint8_t* ptr =3D table;
> +   for(;size >=3D UUID_TBL_ENT_SIZE; size -=3D UUID_TBL_ENT_SIZE) {
> +      int index;
> +      uint32_t v32;
> +
> +      /*uuid_t is just an array of bytes, so we can do a direct cast h=
ere */
> +      uint8_t* uuid =3D ptr;
> +      ptr +=3D sizeof(uuid_t);
> +
> +      /* Get the offset of the key */
> +      ptr =3D unpack_UINT32(ptr, &v32);
> +
> +      /* Insert the new vtpm in sorted order */
> +      if((index =3D vtpm_get_index(uuid)) >=3D 0) {
> +         vtpmlogerror(VTPM_LOG_VTPM, "Vtpm (" UUID_FMT ") exists multi=
ple times! ignoring...\n", UUID_BYTES(uuid));
> +         continue;
> +      }
> +      index =3D -index -1;
> +
> +      vtpm_add(uuid, v32, index);
> +
> +   }
> +   return ptr - table;
> +}
> +
> +static void vtpm_decrypt_block(aes_context* aes,
> +      uint8_t* iv,
> +      uint8_t* cipher,
> +      uint8_t* plain,
> +      int cipher_sz,
> +      int* overlap)
> +{
> +   int bytes_ext;
> +   /* Decrypt */
> +   aes_crypt_cbc(aes, AES_DECRYPT,
> +         cipher_sz,
> +         iv, cipher, plain + *overlap);
> +
> +   /* Extract */
> +   bytes_ext =3D extract_uuid_table(plain, cipher_sz + *overlap);
> +
> +   /* Copy left overs to the beginning */
> +   *overlap =3D cipher_sz + *overlap - bytes_ext;
> +   memcpy(plain, plain + bytes_ext, *overlap);
> +}
> +
> +static int vtpm_encrypt_block(aes_context* aes,
> +      uint8_t* iv,
> +      uint8_t* plain,
> +      uint8_t* cipher,
> +      int block_sz,
> +      int* overlap,
> +      int* num_vtpms)
> +{
> +   int bytes_to_crypt;
> +   int bytes_packed;
> +
> +   /* Pack the uuid table */
> +   bytes_packed =3D *overlap + pack_uuid_table(plain + *overlap, block=
_sz - *overlap, num_vtpms);
> +   bytes_to_crypt =3D MIN(bytes_packed, block_sz);
> +
> +   /* Add padding if we aren't on a multiple of the block size */
> +   if(bytes_to_crypt & (AES_BLOCK_SIZE-1)) {
> +      int oldsz =3D bytes_to_crypt;
> +      //add padding
> +      bytes_to_crypt +=3D AES_BLOCK_SIZE - (bytes_to_crypt & (AES_BLOC=
K_SIZE-1));
> +      //fill padding with random bytes
> +      vtpmmgr_rand(plain + oldsz, bytes_to_crypt - oldsz);
> +      *overlap =3D 0;
> +   } else {
> +      *overlap =3D bytes_packed - bytes_to_crypt;
> +   }
> +
> +   /* Encrypt this chunk */
> +   aes_crypt_cbc(aes, AES_ENCRYPT,
> +            bytes_to_crypt,
> +            iv, plain, cipher);
> +
> +   /* Copy the left over partials to the beginning */
> +   memcpy(plain, plain + bytes_to_crypt, *overlap);
> +
> +   return bytes_to_crypt;
> +}
> +
> +static TPM_RESULT vtpm_storage_new_vtpm(const uuid_t uuid, int index) =
{
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +   uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
> +   uint8_t buf[BUF_SIZE];
> +   uint8_t* ptr;
> +   int cipher_sz;
> +   aes_context aes;
> +
> +   /* Add new vtpm to the table */
> +   vtpm_add(uuid, g_store.end_offset, index);
> +   g_store.end_offset +=3D RSA_CIPHER_SIZE;
> +
> +   /* Compute the new end location of the encrypted uuid table */
> +   cipher_sz =3D AES_BLOCK_SIZE; //IV
> +   cipher_sz +=3D g_store.num_vtpms * UUID_TBL_ENT_SIZE; //uuid table
> +   cipher_sz +=3D (AES_BLOCK_SIZE - (cipher_sz & (AES_BLOCK_SIZE -1)))=
 & (AES_BLOCK_SIZE-1); //aes padding
> +
> +   /* Does this overlap any key data? If so they need to be relocated =
*/
> +   int uuid_end =3D (g_store.uuid_offset + cipher_sz + RSA_CIPHER_SIZE=
) & ~(RSA_CIPHER_SIZE -1);
> +   for(int i =3D 0; i < g_store.num_vtpms; ++i) {
> +      if(g_store.vtpms[i].offset < uuid_end) {
> +
> +         vtpmloginfo(VTPM_LOG_VTPM, "Relocating vtpm data\n");
> +
> +         //Read the hashkey cipher text
> +         lseek(blkfront_fd, g_store.vtpms[i].offset, SEEK_SET);
> +         TRY_READ(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
> +
> +         //Write the cipher text to new offset
> +         lseek(blkfront_fd, g_store.end_offset, SEEK_SET);
> +         TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
> +
> +         //Save new offset
> +         g_store.vtpms[i].offset =3D g_store.end_offset;
> +         g_store.end_offset +=3D RSA_CIPHER_SIZE;
> +      }
> +   }
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Generating a new symmetric key\n");
> +
> +   /* Generate an aes key */
> +   TPMTRYRETURN(vtpmmgr_rand(plain, AES_KEY_SIZE));
> +   aes_setkey_enc(&aes, plain, AES_KEY_BITS);
> +   ptr =3D plain + AES_KEY_SIZE;
> +
> +   /* Pack the crypted size */
> +   ptr =3D pack_UINT32(ptr, cipher_sz);
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Binding encrypted key\n");
> +
> +   /* Seal the key and size */
> +   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
> +            plain,
> +            ptr - plain,
> +            buf));
> +
> +   /* Write the sealed key to disk */
> +   lseek(blkfront_fd, g_store.aes_offset, SEEK_SET);
> +   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm aes key");
> +
> +   /* ENCRYPT AND WRITE UUID TABLE */
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Encrypting the uuid table\n");
> +
> +   int num_vtpms =3D 0;
> +   int overlap =3D 0;
> +   int bytes_crypted;
> +   uint8_t iv[AES_BLOCK_SIZE];
> +
> +   /* Generate the iv for the first block */
> +   TPMTRYRETURN(vtpmmgr_rand(iv, AES_BLOCK_SIZE));
> +
> +   /* Copy the iv to the cipher text buffer to be written to disk */
> +   memcpy(buf, iv, AES_BLOCK_SIZE);
> +   ptr =3D buf + AES_BLOCK_SIZE;
> +
> +   /* Encrypt the first block of the uuid table */
> +   bytes_crypted =3D vtpm_encrypt_block(&aes,
> +         iv, //iv
> +         plain, //plaintext
> +         ptr, //cipher text
> +         BUF_SIZE - AES_BLOCK_SIZE,
> +         &overlap,
> +         &num_vtpms);
> +
> +   /* Write the iv followed by the crypted table*/
> +   TRY_WRITE(buf, bytes_crypted + AES_BLOCK_SIZE, "vtpm uuid table");
> +
> +   /* Decrement the number of bytes encrypted */
> +   cipher_sz -=3D bytes_crypted + AES_BLOCK_SIZE;
> +
> +   /* If there are more vtpms, encrypt and write them block by block *=
/
> +   while(cipher_sz > 0) {
> +      /* Encrypt the next block of the uuid table */
> +      bytes_crypted =3D vtpm_encrypt_block(&aes,
> +               iv,
> +               plain,
> +               buf,
> +               BUF_SIZE,
> +               &overlap,
> +               &num_vtpms);
> +
> +      /* Write the cipher text to disk */
> +      TRY_WRITE(buf, bytes_crypted, "vtpm uuid table");
> +
> +      cipher_sz -=3D bytes_crypted;
> +   }
> +
> +   goto egress;
> +abort_egress:
> +egress:
> +   return status;
> +}
> +
> +
> +/**************************************
> + * PUBLIC FUNCTIONS
> + * ***********************************/
> +
> +int vtpm_storage_init(void) {
> +   struct blkfront_info info;
> +   if((blkdev =3D init_blkfront(NULL, &info)) =3D=3D NULL) {
> +      return -1;
> +   }
> +   if((blkfront_fd =3D blkfront_open(blkdev)) < 0) {
> +      return -1;
> +   }
> +   return 0;
> +}
> +
> +void vtpm_storage_shutdown(void) {
> +   reset_store();
> +   close(blkfront_fd);
> +}
> +
> +TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashke=
y[HASHKEYSZ])
> +{
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +   int index;
> +   uint8_t cipher[RSA_CIPHER_SIZE];
> +   uint8_t clear[RSA_CIPHER_SIZE];
> +   UINT32 clear_size;
> +
> +   /* Find the index of this uuid */
> +   if((index =3D vtpm_get_index(uuid)) < 0) {
> +      index =3D -index-1;
> +      vtpmlogerror(VTPM_LOG_VTPM, "LoadKey failure: Unrecognized uuid!=
 " UUID_FMT "\n", UUID_BYTES(uuid));
> +      status =3D TPM_BAD_PARAMETER;
> +      goto abort_egress;
> +   }
> +
> +   /* Read the table entry */
> +   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
> +   TRY_READ(cipher, RSA_CIPHER_SIZE, "vtpm hashkey data");
> +
> +   /* Decrypt the table entry */
> +   TPMTRYRETURN(TPM_UnBind(
> +            vtpm_globals.storage_key_handle,
> +            RSA_CIPHER_SIZE,
> +            cipher,
> +            &clear_size,
> +            clear,
> +            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,=

> +            &vtpm_globals.oiap));
> +
> +   if(clear_size < HASHKEYSZ) {
> +      vtpmloginfo(VTPM_LOG_VTPM, "Decrypted Hash key size (%" PRIu32 "=
) was too small!\n", clear_size);
> +      status =3D TPM_RESOURCES;
> +      goto abort_egress;
> +   }
> +
> +   memcpy(hashkey, clear, HASHKEYSZ);
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Loaded hash and key for vtpm " UUID_FMT=
 "\n", UUID_BYTES(uuid));
> +   goto egress;
> +abort_egress:
> +   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load key\n");
> +egress:
> +   return status;
> +}
> +
> +TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashke=
y[HASHKEYSZ])
> +{
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +   int index;
> +   uint8_t buf[RSA_CIPHER_SIZE];
> +
> +   /* Find the index of this uuid */
> +   if((index =3D vtpm_get_index(uuid)) < 0) {
> +      index =3D -index-1;
> +      /* Create a new vtpm */
> +      TPMTRYRETURN( vtpm_storage_new_vtpm(uuid, index) );
> +   }
> +
> +   /* Encrypt the hash and key */
> +   TPMTRYRETURN( TPM_Bind(&vtpm_globals.storage_key,
> +            hashkey,
> +            HASHKEYSZ,
> +            buf));
> +
> +   /* Write to disk */
> +   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
> +   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey data");
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Saved hash and key for vtpm " UUID_FMT =
"\n", UUID_BYTES(uuid));
> +   goto egress;
> +abort_egress:
> +   vtpmlogerror(VTPM_LOG_VTPM, "Failed to save key\n");
> +egress:
> +   return status;
> +}
> +
> +TPM_RESULT vtpm_storage_new_header()
> +{
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +   uint8_t buf[BUF_SIZE];
> +   uint8_t keybuf[AES_KEY_SIZE + sizeof(uint32_t)];
> +   uint8_t* ptr =3D buf;
> +   uint8_t* sptr;
> +
> +   /* Clear everything first */
> +   reset_store();
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Creating new disk image header\n");
> +
> +   /*Copy the ID string */
> +   memcpy(ptr, IDSTR, IDSTRLEN);
> +   ptr +=3D IDSTRLEN;
> +
> +   /*Copy the version */
> +   ptr =3D pack_UINT32(ptr, DISKVERS);
> +
> +   /*Save the location of the key size */
> +   sptr =3D ptr;
> +   ptr +=3D sizeof(UINT32);
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Saving root storage key..\n");
> +
> +   /* Copy the storage key */
> +   ptr =3D pack_TPM_KEY(ptr, &vtpm_globals.storage_key);
> +
> +   /* Now save the size */
> +   pack_UINT32(sptr, ptr - (sptr + 4));
> +
> +   /* Create a fake aes key and set cipher text size to 0 */
> +   memset(keybuf, 0, sizeof(keybuf));
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Binding uuid table symmetric key..\n");=

> +
> +   /* Save the location of the aes key */
> +   g_store.aes_offset =3D ptr - buf;
> +
> +   /* Store the fake aes key and vtpm count */
> +   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
> +         keybuf,
> +         sizeof(keybuf),
> +         ptr));
> +   ptr+=3D RSA_CIPHER_SIZE;
> +
> +   /* Write the header to disk */
> +   lseek(blkfront_fd, 0, SEEK_SET);
> +   TRY_WRITE(buf, ptr-buf, "vtpm header");
> +
> +   /* Save the location of the uuid table */
> +   g_store.uuid_offset =3D get_offset();
> +
> +   /* Save the end offset */
> +   g_store.end_offset =3D (g_store.uuid_offset + RSA_CIPHER_SIZE) & ~(=
RSA_CIPHER_SIZE -1);
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Saved new manager disk header.\n");
> +
> +   goto egress;
> +abort_egress:
> +egress:
> +   return status;
> +}
> +
> +
> +TPM_RESULT vtpm_storage_load_header(void)
> +{
> +   TPM_RESULT status =3D TPM_SUCCESS;
> +   uint32_t v32;
> +   uint8_t buf[BUF_SIZE];
> +   uint8_t* ptr =3D buf;
> +   aes_context aes;
> +
> +   /* Clear everything first */
> +   reset_store();
> +
> +   /* Read the header from disk */
> +   lseek(blkfront_fd, 0, SEEK_SET);
> +   TRY_READ(buf, IDSTRLEN + sizeof(UINT32) + sizeof(UINT32), "vtpm hea=
der");
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Loading disk image header\n");
> +
> +   /* Verify the ID string */
> +   if(memcmp(ptr, IDSTR, IDSTRLEN)) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Invalid ID string in disk image!\n"=
);
> +      status =3D TPM_FAIL;
> +      goto abort_egress;
> +   }
> +   ptr+=3DIDSTRLEN;
> +
> +   /* Unpack the version */
> +   ptr =3D unpack_UINT32(ptr, &v32);
> +
> +   /* Verify the version */
> +   if(v32 !=3D DISKVERS) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Unsupported disk image version numb=
er %" PRIu32 "\n", v32);
> +      status =3D TPM_FAIL;
> +      goto abort_egress;
> +   }
> +
> +   /* Size of the storage key */
> +   ptr =3D unpack_UINT32(ptr, &v32);
> +
> +   /* Sanity check */
> +   if(v32 > BUF_SIZE) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Size of storage key (%" PRIu32 ") i=
s too large!\n", v32);
> +      status =3D TPM_IOERROR;
> +      goto abort_egress;
> +   }
> +
> +   /* read the storage key */
> +   TRY_READ(buf, v32, "storage pub key");
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Unpacking storage key\n");
> +
> +   /* unpack the storage key */
> +   ptr =3D unpack_TPM_KEY(buf, &vtpm_globals.storage_key, UNPACK_ALLOC=
);
> +
> +   /* Load Storage Key into the TPM */
> +   TPMTRYRETURN( TPM_LoadKey(
> +            TPM_SRK_KEYHANDLE,
> +            &vtpm_globals.storage_key,
> +            &vtpm_globals.storage_key_handle,
> +            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
> +            &vtpm_globals.oiap));
> +
> +   /* Initialize the storage key auth */
> +   memset(vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA)=
);
> +
> +   /* Store the offset of the aes key */
> +   g_store.aes_offset =3D get_offset();
> +
> +   /* Read the rsa cipher text for the aes key */
> +   TRY_READ(buf, RSA_CIPHER_SIZE, "aes key");
> +   ptr =3D buf + RSA_CIPHER_SIZE;
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "Unbinding uuid table symmetric key\n");=

> +
> +   /* Decrypt the aes key protecting the uuid table */
> +   UINT32 datalen;
> +   TPMTRYRETURN(TPM_UnBind(
> +            vtpm_globals.storage_key_handle,
> +            RSA_CIPHER_SIZE,
> +            buf,
> +            &datalen,
> +            ptr,
> +            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,=

> +            &vtpm_globals.oiap));
> +
> +   /* Validate the length of the output buffer */
> +   if(datalen < AES_KEY_SIZE + sizeof(UINT32)) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Unbound AES key size (%d) was too s=
mall! expected (%ld)\n", datalen, AES_KEY_SIZE + sizeof(UINT32));
> +      status =3D TPM_IOERROR;
> +      goto abort_egress;
> +   }
> +
> +   /* Extract the aes key */
> +   aes_setkey_dec(&aes, ptr, AES_KEY_BITS);
> +   ptr+=3D AES_KEY_SIZE;
> +
> +   /* Extract the ciphertext size */
> +   ptr =3D unpack_UINT32(ptr, &v32);
> +   int cipher_size =3D v32;
> +
> +   /* Sanity check */
> +   if(cipher_size & (AES_BLOCK_SIZE-1)) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Cipher text size (%" PRIu32 ") is n=
ot a multiple of the aes block size! (%d)\n", v32, AES_BLOCK_SIZE);
> +      status =3D TPM_IOERROR;
> +      goto abort_egress;
> +   }
> +
> +   /* Save the location of the uuid table */
> +   g_store.uuid_offset =3D get_offset();
> +
> +   /* Only decrypt the table if there are vtpms to decrypt */
> +   if(cipher_size > 0) {
> +      int rbytes;
> +      int overlap =3D 0;
> +      uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
> +      uint8_t iv[AES_BLOCK_SIZE];
> +
> +      vtpmloginfo(VTPM_LOG_VTPM, "Decrypting uuid table\n");
> +
> +      /* Pre allocate the vtpm array */
> +      g_store.num_vtpms_alloced =3D cipher_size / UUID_TBL_ENT_SIZE;
> +      g_store.vtpms =3D malloc(sizeof(struct Vtpm) * g_store.num_vtpms=
_alloced);
> +
> +      /* Read the iv and the first chunk of cipher text */
> +      rbytes =3D MIN(cipher_size, BUF_SIZE);
> +      TRY_READ(buf, rbytes, "vtpm uuid table\n");
> +      cipher_size -=3D rbytes;
> +
> +      /* Copy the iv */
> +      memcpy(iv, buf, AES_BLOCK_SIZE);
> +      ptr =3D buf + AES_BLOCK_SIZE;
> +
> +      /* Remove the iv from the number of bytes to decrypt */
> +      rbytes -=3D AES_BLOCK_SIZE;
> +
> +      /* Decrypt and extract vtpms */
> +      vtpm_decrypt_block(&aes,
> +            iv, ptr, plain,
> +            rbytes, &overlap);
> +
> +      /* Read the rest of the table if there is more */
> +      while(cipher_size > 0) {
> +         /* Read next chunk of cipher text */
> +         rbytes =3D MIN(cipher_size, BUF_SIZE);
> +         TRY_READ(buf, rbytes, "vtpm uuid table");
> +         cipher_size -=3D rbytes;
> +
> +         /* Decrypt a block of text */
> +         vtpm_decrypt_block(&aes,
> +               iv, buf, plain,
> +               rbytes, &overlap);
> +
> +      }
> +      vtpmloginfo(VTPM_LOG_VTPM, "Loaded %d vtpms!\n", g_store.num_vtp=
ms);
> +   }
> +
> +   /* The end of the key table, new vtpms go here */
> +   int uuid_end =3D (get_offset() + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SI=
ZE -1);
> +   g_store.end_offset =3D uuid_end;
> +
> +   /* Compute the end offset while validating vtpms*/
> +   for(int i =3D 0; i < g_store.num_vtpms; ++i) {
> +      /* offset must not collide with previous data */
> +      if(g_store.vtpms[i].offset < uuid_end) {
> +         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
> +               " offset (%d) is before end of uuid table (%d)!\n",
> +               UUID_BYTES(g_store.vtpms[i].uuid),
> +               g_store.vtpms[i].offset, uuid_end);
> +         status =3D TPM_IOERROR;
> +         goto abort_egress;
> +      }
> +      /* offset must be at a multiple of cipher size */
> +      if(g_store.vtpms[i].offset & (RSA_CIPHER_SIZE-1)) {
> +         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
> +               " offset(%d) is not at a multiple of the rsa cipher tex=
t size (%d)!\n",
> +               UUID_BYTES(g_store.vtpms[i].uuid),
> +               g_store.vtpms[i].offset, RSA_CIPHER_SIZE);
> +         status =3D TPM_IOERROR;
> +         goto abort_egress;
> +      }
> +      /* Save the last offset */
> +      if(g_store.vtpms[i].offset >=3D g_store.end_offset) {
> +         g_store.end_offset =3D g_store.vtpms[i].offset + RSA_CIPHER_S=
IZE;
> +      }
> +   }
> +
> +   goto egress;
> +abort_egress:
> +   //An error occured somewhere
> +   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load manager data!\n");
> +
> +   //Clear the data store
> +   reset_store();
> +
> +   //Reset the storage key structure
> +   free_TPM_KEY(&vtpm_globals.storage_key);
> +   {
> +      TPM_KEY key =3D TPM_KEY_INIT;
> +      vtpm_globals.storage_key =3D key;
> +   }
> +
> +   //Reset the storage key handle
> +   TPM_EvictKey(vtpm_globals.storage_key_handle);
> +   vtpm_globals.storage_key_handle =3D 0;
> +egress:
> +   return status;
> +}
> +
> +#if 0
> +/* For testing disk IO */
> +void add_fake_vtpms(int num) {
> +   for(int i =3D 0; i < num; ++i) {
> +      uint32_t ind =3D cpu_to_be32(i);
> +
> +      uuid_t uuid;
> +      memset(uuid, 0, sizeof(uuid_t));
> +      memcpy(uuid, &ind, sizeof(ind));
> +      int index =3D vtpm_get_index(uuid);
> +      index =3D -index-1;
> +
> +      vtpm_storage_new_vtpm(uuid, index);
> +   }
> +}
> +#endif
> diff --git a/stubdom/vtpmmgr/vtpm_storage.h b/stubdom/vtpmmgr/vtpm_stor=
age.h
> new file mode 100644
> index 0000000..a5a5fd7
> --- /dev/null
> +++ b/stubdom/vtpmmgr/vtpm_storage.h
> @@ -0,0 +1,68 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#ifndef VTPM_STORAGE_H
> +#define VTPM_STORAGE_h
> +
> +#include "uuid.h"
> +
> +#define VTPM_NVMKEY_SIZE 32
> +#define HASHKEYSZ (sizeof(TPM_DIGEST) + VTPM_NVMKEY_SIZE)
> +
> +/* Initialize the storage system and its virtual disk */
> +int vtpm_storage_init(void);
> +
> +/* Shutdown the storage system and its virtual disk */
> +void vtpm_storage_shutdown(void);
> +
> +/* Loads Sha1 hash and 256 bit AES key from disk and stores them
> + * packed together in outbuf. outbuf must be freed
> + * by the caller using buffer_free()
> + */
> +TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashke=
y[HASHKEYSZ]);
> +
> +/* inbuf must contain a sha1 hash followed by a 256 bit AES key.
> + * Encrypts and stores the hash and key to disk */
> +TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashke=
y[HASHKEYSZ]);
> +
> +/* Load the vtpm manager data - call this on startup */
> +TPM_RESULT vtpm_storage_load_header(void);
> +
> +/* Saves the vtpm manager data - call this on shutdown */
> +TPM_RESULT vtpm_storage_new_header(void);
> +
> +
> +#endif
> diff --git a/stubdom/vtpmmgr/vtpmmgr.c b/stubdom/vtpmmgr/vtpmmgr.c
> new file mode 100644
> index 0000000..563f4e8
> --- /dev/null
> +++ b/stubdom/vtpmmgr/vtpmmgr.c
> @@ -0,0 +1,93 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#include <stdint.h>
> +#include <mini-os/tpmback.h>
> +#include <unistd.h>
> +#include <stdio.h>
> +#include <string.h>
> +#include <stdlib.h>
> +#include "log.h"
> +
> +#include "vtpmmgr.h"
> +#include "tcg.h"
> +
> +
> +void main_loop(void) {
> +   tpmcmd_t* tpmcmd;
> +   uint8_t respbuf[TCPA_MAX_BUFFER_LENGTH];
> +
> +   while(1) {
> +      /* Wait for requests from a vtpm */
> +      vtpmloginfo(VTPM_LOG_VTPM, "Waiting for commands from vTPM's:\n"=
);
> +      if((tpmcmd =3D tpmback_req_any()) =3D=3D NULL) {
> +         vtpmlogerror(VTPM_LOG_VTPM, "NULL tpmcmd\n");
> +         continue;
> +      }
> +
> +      tpmcmd->resp =3D respbuf;
> +
> +      /* Process the command */
> +      vtpmmgr_handle_cmd(tpmcmd->uuid, tpmcmd);
> +
> +      /* Send response */
> +      tpmback_resp(tpmcmd);
> +   }
> +}
> +
> +int main(int argc, char** argv)
> +{
> +   int rc =3D 0;
> +   sleep(2);
> +   vtpmloginfo(VTPM_LOG_VTPM, "Starting vTPM manager domain\n");
> +
> +   /* Initialize the vtpm manager */
> +   if(vtpmmgr_init(argc, argv) !=3D TPM_SUCCESS) {
> +      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize vtpmmgr domain=
!\n");
> +      rc =3D -1;
> +      goto exit;
> +   }
> +
> +   main_loop();
> +
> +   vtpmloginfo(VTPM_LOG_VTPM, "vTPM Manager shutting down...\n");
> +
> +   vtpmmgr_shutdown();
> +
> +exit:
> +   return rc;
> +
> +}
> diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
> new file mode 100644
> index 0000000..50a1992
> --- /dev/null
> +++ b/stubdom/vtpmmgr/vtpmmgr.h
> @@ -0,0 +1,77 @@
> +/*
> + * Copyright (c) 2010-2012 United States Government, as represented by=

> + * the Secretary of Defense.  All rights reserved.
> + *
> + * based off of the original tools/vtpm_manager code base which is:
> + * Copyright (c) 2005, Intel Corp.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *   * Redistributions of source code must retain the above copyright
> + *     notice, this list of conditions and the following disclaimer.
> + *   * Redistributions in binary form must reproduce the above
> + *     copyright notice, this list of conditions and the following
> + *     disclaimer in the documentation and/or other materials provided=

> + *     with the distribution.
> + *   * Neither the name of Intel Corporation nor the names of its
> + *     contributors may be used to endorse or promote products derived=

> + *     from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=

> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=

> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,=

> + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED=

> + * OF THE POSSIBILITY OF SUCH DAMAGE.
> +*/
> +
> +#ifndef VTPMMGR_H
> +#define VTPMMGR_H
> +
> +#include <mini-os/tpmback.h>
> +#include <polarssl/entropy.h>
> +#include <polarssl/ctr_drbg.h>
> +
> +#include "uuid.h"
> +#include "tcg.h"
> +#include "vtpm_manager.h"
> +
> +#define RSA_KEY_SIZE 0x0800
> +#define RSA_CIPHER_SIZE (RSA_KEY_SIZE / 8)
> +
> +struct vtpm_globals {
> +   int tpm_fd;
> +   TPM_KEY             storage_key;
> +   TPM_HANDLE          storage_key_handle;       // Key used by persis=
tent store
> +   TPM_AUTH_SESSION    oiap;                // OIAP session for storag=
eKey
> +   TPM_AUTHDATA        storage_key_usage_auth;
> +
> +   TPM_AUTHDATA        owner_auth;
> +   TPM_AUTHDATA        srk_auth;
> +
> +   entropy_context     entropy;
> +   ctr_drbg_context    ctr_drbg;
> +};
> +
> +// --------------------------- Global Values -------------------------=
-
> +extern struct vtpm_globals vtpm_globals;   // Key info and DMI states
> +
> +TPM_RESULT vtpmmgr_init(int argc, char** argv);
> +void vtpmmgr_shutdown(void);
> +
> +TPM_RESULT vtpmmgr_handle_cmd(const uuid_t uuid, tpmcmd_t* tpmcmd);
> +
> +inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes)=
 {
> +   return ctr_drbg_random(&vtpm_globals.ctr_drbg, bytes, num_bytes) =3D=
=3D 0 ? 0 : TPM_FAIL;
> +}
> +
> +#endif
> --
> 1.7.10.4
>



--------------ms080704030001010001060100
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlCwMBAQEBBAoWCGZpb3JhbWUxMBsGDSsGAQQBsyUL
AwEBAQIEChIIMDAxMDQyNjEwWAYJYIZIAYb6ax4BBEsMSVRoZSBwcml2YXRlIGtleSBjb3Jy
ZXNwb25kaW5nIHRvIHRoaXMgY2VydGlmaWNhdGU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l400p0W9u5cq
H2AE6aE1OzVsO/66lHkNjIsHIlISebgIFygQFIcTvN6edvvzASWO4rndvJUnJt7b7wAAAAAA
AA==
--------------ms080704030001010001060100--


--===============0475244974786596101==
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.xen.org
http://lists.xen.org/xen-devel

--===============0475244974786596101==--


From xen-devel-bounces@lists.xen.org Tue Nov 20 14:32:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:32:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taorr-0006jL-GZ; Tue, 20 Nov 2012 14:32:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Taorp-0006jE-Q0
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:32:02 +0000
Received: from [85.158.138.51:22871] by server-4.bemta-3.messagelabs.com id
	B4/DE-30023-0649BA05; Tue, 20 Nov 2012 14:32:00 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1353421906!24414274!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8308 invoked from network); 20 Nov 2012 14:31:47 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-174.messagelabs.com with SMTP;
	20 Nov 2012 14:31:47 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 14:31:45 +0000
Message-Id: <50ABA29902000078000A9FB1@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 14:32:41 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353420865.13542.44.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 15:14, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Tue, 2012-11-20 at 13:51 +0000, Jan Beulich wrote:
>> >>> On 20.11.12 at 14:35, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> > On Tue, 2012-11-20 at 12:28 +0000, Jan Beulich wrote:
>> >> >>> On 20.11.12 at 12:40, Ian Campbell <ian.campbell@citrix.com> wrote:
>> >> > An SKB paged fragment can consist of a compound page with order > 0.
>> >> > However the netchannel protocol deals only in PAGE_SIZE frames.
>> >> > 
>> >> > Handle this in xennet_make_frags by iterating over the frames which
>> >> > make up the page.
>> >> > 
>> >> > This is the netfront equivalent to 6a8ed462f16b for netback.
>> >> 
>> >> Wouldn't you need to be at least a little more conservative here
>> >> with respect to resource use: I realize that get_id_from_freelist()
>> >> return values were never checked, and failure of
>> >> gnttab_claim_grant_reference() was always dealt with via
>> >> BUG_ON(), but considering that netfront_tx_slot_available()
>> >> doesn't account for compound page fragments, I think this (lack
>> >> of) error handling needs improvement in the course of the
>> >> change here (regardless of - I think - someone having said that
>> >> usually the sum of all pages referenced from an skb's fragments
>> >> would not exceed MAX_SKB_FRAGS - "usually" just isn't enough
>> >> imo).
>> > 
>> > I think it is more than "usually", it is derived from the number of
>> > pages needed to contain 64K of data which is the maximum size of the
>> > data associated with an skb (AIUI).
>> > 
>> > Unwinding from failure in xennet_make_frags looks pretty tricky,
>> 
>> Yes, I agree.
>> 
>> > but how about this incremental patch:
>> 
>> Looks good, but can probably be simplified quite a bit:
>> 
>> > --- a/drivers/net/xen-netfront.c
>> > +++ b/drivers/net/xen-netfront.c
>> > @@ -505,6 +505,46 @@ static void xennet_make_frags(struct sk_buff *skb, 
> struct net_device *dev,
>> >  	np->tx.req_prod_pvt = prod;
>> >  }
>> >  
>> > +/*
>> > + * Count how many ring slots are required to send the frags of this
>> > + * skb. Each frag might be a compound page.
>> > + */
>> > +static int xennet_count_skb_frag_pages(struct sk_buff *skb)
>> > +{
>> > +	int i, frags = skb_shinfo(skb)->nr_frags;
>> > +	int pages = 0;
>> > +
>> > +	for (i = 0; i < frags; i++) {
>> > +		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
>> > +		unsigned long size = skb_frag_size(frag);
>> > +		unsigned long offset = frag->page_offset;
>> > +
>> > +		/* Skip unused frames from start of page */
>> > +		offset &= ~PAGE_MASK;
>> > +
>> > +		while (size > 0) {
>> > +			unsigned long bytes;
>> > +
>> > +			BUG_ON(offset >= PAGE_SIZE);
>> > +
>> > +			bytes = PAGE_SIZE - offset;
>> > +			if (bytes > size)
>> > +				bytes = size;
>> > +
>> > +			offset += bytes;
>> > +			size -= bytes;
>> > +
>> > +			/* Next frame */
>> > +			if (offset == PAGE_SIZE && size) {
>> > +				pages++;
>> > +				offset = 0;
>> > +			}
>> > +		}
>> 
>> Isn't the whole loop equivalent to 
>> 
>> 		pages = PFN_UP(offset + size);
>> 
>> (at least as long as size is not zero)?
> 
> Er, yes. Wood for the trees etc...
> 
> I think using PFN_UP overcounts a bit since the data needed start in the
> first frame of a compound frame, but if you keep the 
>         /* Skip unused frames from start of page */
>         offset &= ~PAGE_MASK;
>         
> I think that does the right thing

Right, that's what I said (I only wanted the loop to be replaced, not
what was prior to it).

> @@ -517,15 +540,16 @@ static int xennet_start_xmit(struct sk_buff *skb, 
> struct net_device *dev)
>  	grant_ref_t ref;
>  	unsigned long mfn;
>  	int notify;
> -	int frags = skb_shinfo(skb)->nr_frags;
> +	int slots;
>  	unsigned int offset = offset_in_page(data);
>  	unsigned int len = skb_headlen(skb);
>  	unsigned long flags;
>  
> -	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
> -	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
> -		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
> -		       frags);
> +	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
> +		xennet_count_skb_frag_slots(skb);
> +	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {

But still - isn't this wrong now (i.e. can't it now validly exceed the
boundary checked for)?

Jan

> +		printk(KERN_ALERT "xennet: skb rides the rocket: %d slots\n",
> +		       slots);
>  		dump_stack();
>  		goto drop;
>  	}


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:32:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:32:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taorr-0006jL-GZ; Tue, 20 Nov 2012 14:32:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Taorp-0006jE-Q0
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:32:02 +0000
Received: from [85.158.138.51:22871] by server-4.bemta-3.messagelabs.com id
	B4/DE-30023-0649BA05; Tue, 20 Nov 2012 14:32:00 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1353421906!24414274!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8308 invoked from network); 20 Nov 2012 14:31:47 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-174.messagelabs.com with SMTP;
	20 Nov 2012 14:31:47 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 14:31:45 +0000
Message-Id: <50ABA29902000078000A9FB1@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 14:32:41 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353420865.13542.44.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 15:14, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Tue, 2012-11-20 at 13:51 +0000, Jan Beulich wrote:
>> >>> On 20.11.12 at 14:35, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> > On Tue, 2012-11-20 at 12:28 +0000, Jan Beulich wrote:
>> >> >>> On 20.11.12 at 12:40, Ian Campbell <ian.campbell@citrix.com> wrote:
>> >> > An SKB paged fragment can consist of a compound page with order > 0.
>> >> > However the netchannel protocol deals only in PAGE_SIZE frames.
>> >> > 
>> >> > Handle this in xennet_make_frags by iterating over the frames which
>> >> > make up the page.
>> >> > 
>> >> > This is the netfront equivalent to 6a8ed462f16b for netback.
>> >> 
>> >> Wouldn't you need to be at least a little more conservative here
>> >> with respect to resource use: I realize that get_id_from_freelist()
>> >> return values were never checked, and failure of
>> >> gnttab_claim_grant_reference() was always dealt with via
>> >> BUG_ON(), but considering that netfront_tx_slot_available()
>> >> doesn't account for compound page fragments, I think this (lack
>> >> of) error handling needs improvement in the course of the
>> >> change here (regardless of - I think - someone having said that
>> >> usually the sum of all pages referenced from an skb's fragments
>> >> would not exceed MAX_SKB_FRAGS - "usually" just isn't enough
>> >> imo).
>> > 
>> > I think it is more than "usually", it is derived from the number of
>> > pages needed to contain 64K of data which is the maximum size of the
>> > data associated with an skb (AIUI).
>> > 
>> > Unwinding from failure in xennet_make_frags looks pretty tricky,
>> 
>> Yes, I agree.
>> 
>> > but how about this incremental patch:
>> 
>> Looks good, but can probably be simplified quite a bit:
>> 
>> > --- a/drivers/net/xen-netfront.c
>> > +++ b/drivers/net/xen-netfront.c
>> > @@ -505,6 +505,46 @@ static void xennet_make_frags(struct sk_buff *skb, 
> struct net_device *dev,
>> >  	np->tx.req_prod_pvt = prod;
>> >  }
>> >  
>> > +/*
>> > + * Count how many ring slots are required to send the frags of this
>> > + * skb. Each frag might be a compound page.
>> > + */
>> > +static int xennet_count_skb_frag_pages(struct sk_buff *skb)
>> > +{
>> > +	int i, frags = skb_shinfo(skb)->nr_frags;
>> > +	int pages = 0;
>> > +
>> > +	for (i = 0; i < frags; i++) {
>> > +		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
>> > +		unsigned long size = skb_frag_size(frag);
>> > +		unsigned long offset = frag->page_offset;
>> > +
>> > +		/* Skip unused frames from start of page */
>> > +		offset &= ~PAGE_MASK;
>> > +
>> > +		while (size > 0) {
>> > +			unsigned long bytes;
>> > +
>> > +			BUG_ON(offset >= PAGE_SIZE);
>> > +
>> > +			bytes = PAGE_SIZE - offset;
>> > +			if (bytes > size)
>> > +				bytes = size;
>> > +
>> > +			offset += bytes;
>> > +			size -= bytes;
>> > +
>> > +			/* Next frame */
>> > +			if (offset == PAGE_SIZE && size) {
>> > +				pages++;
>> > +				offset = 0;
>> > +			}
>> > +		}
>> 
>> Isn't the whole loop equivalent to 
>> 
>> 		pages = PFN_UP(offset + size);
>> 
>> (at least as long as size is not zero)?
> 
> Er, yes. Wood for the trees etc...
> 
> I think using PFN_UP overcounts a bit since the data needed start in the
> first frame of a compound frame, but if you keep the 
>         /* Skip unused frames from start of page */
>         offset &= ~PAGE_MASK;
>         
> I think that does the right thing

Right, that's what I said (I only wanted the loop to be replaced, not
what was prior to it).

> @@ -517,15 +540,16 @@ static int xennet_start_xmit(struct sk_buff *skb, 
> struct net_device *dev)
>  	grant_ref_t ref;
>  	unsigned long mfn;
>  	int notify;
> -	int frags = skb_shinfo(skb)->nr_frags;
> +	int slots;
>  	unsigned int offset = offset_in_page(data);
>  	unsigned int len = skb_headlen(skb);
>  	unsigned long flags;
>  
> -	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
> -	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
> -		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
> -		       frags);
> +	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
> +		xennet_count_skb_frag_slots(skb);
> +	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {

But still - isn't this wrong now (i.e. can't it now validly exceed the
boundary checked for)?

Jan

> +		printk(KERN_ALERT "xennet: skb rides the rocket: %d slots\n",
> +		       slots);
>  		dump_stack();
>  		goto drop;
>  	}


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:34:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:34:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaotY-0006pV-1C; Tue, 20 Nov 2012 14:33:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaotV-0006pE-KZ
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 14:33:46 +0000
Received: from [85.158.143.35:26298] by server-2.bemta-4.messagelabs.com id
	0D/0B-28922-9C49BA05; Tue, 20 Nov 2012 14:33:45 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-14.tower-21.messagelabs.com!1353422020!18537156!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30086 invoked from network); 20 Nov 2012 14:33:41 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 20 Nov 2012 14:33:41 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149573560;
	Tue, 20 Nov 2012 09:33:17 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: key@linux.vnet.ibm.com, mail@srajiv.net, jeremy@goop.org,
	tpmdd-devel@lists.sourceforge.net, xen-devel@lists.xensource.com,
	konrad.wilk@oracle.com
Date: Tue, 20 Nov 2012 09:33:05 -0500
Message-Id: <1353421985-25398-1-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	linux-kernel@vger.kernel.org
Subject: [Xen-devel] [PATCH v3] add xen-tpmfront.ko: Xen Virtual TPM
	frontend driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch ports the xen vtpm frontend driver for linux
from the linux-2.6.18-xen.hg tree to linux-stable. This
driver is designed be used with the mini-os tpmback driver
in Xen as part of the new mini-os virtual tpm subsystem.

Included in this commit message is the first draft of the
vtpm documentation.  See docs/misc/vtpm.txt for an updated
version. Contact the xen-devel@lists.xen.org mailing list
for details.

Copyright (c) 2010-2012 United States Government, as represented by
the Secretary of Defense.  All rights reserved.
November 12 2012
Authors: Matthew Fioravante (JHUAPL),

This document describes the virtual Trusted Platform Module (vTPM)
subsystem
for Xen. The reader is assumed to have familiarity with building and
installing
Xen, Linux, and a basic understanding of the TPM and vTPM concepts.

------------------------------
INTRODUCTION
------------------------------
The goal of this work is to provide a TPM functionality to a virtual
guest operating system (a DomU).  This allows programs to interact
with a TPM in a virtual system the same way they interact with a TPM
on the physical system.  Each guest gets its own unique, emulated,
software TPM.  However, each of the vTPM's secrets (Keys, NVRAM, etc)
are managed by a vTPM Manager domain, which seals the secrets to
the Physical TPM.  Thus, the vTPM subsystem extends the chain of
trust rooted in the hardware TPM to virtual machines in Xen.
Each major component of vTPM is implemented as a separate domain,
providing secure separation guaranteed by the hypervisor. The
vTPM domains are implemented in mini-os to reduce memory and
processor overhead.

This mini-os vTPM subsystem was built on top of the previous vTPM
work done by IBM and Intel corporation.

------------------------------
DESIGN OVERVIEW
------------------------------

The architecture of vTPM is described below:

+------------------+
|    Linux DomU    | ...
|       |  ^       |
|       v  |       |
|   xen-tpmfront   |
+------------------+
        |  ^
        v  |
+------------------+
| mini-os/tpmback  |
|       |  ^       |
|       v  |       |
|  vtpm-stubdom    | ...
|       |  ^       |
|       v  |       |
| mini-os/tpmfront |
+------------------+
        |  ^
        v  |
+------------------+
| mini-os/tpmback  |
|       |  ^       |
|       v  |       |
|   vtpmmgrdom     |
|       |  ^       |
|       v  |       |
| mini-os/tpm_tis  |
+------------------+
        |  ^
        v  |
+------------------+
|   Hardware TPM   |
+------------------+
 * Linux DomU: The Linux based guest that wants to use a vTPM. There
               may be more than one of these.

 * xen-tpmfront.ko: Linux kernel virtual TPM frontend driver. This
                    driver provides vTPM access to a para-virtualized
                    Linux based DomU.

 * mini-os/tpmback: Mini-os TPM backend driver. The Linux frontend
                    driver connects to this backend driver to facilitate
                    communications between the Linux DomU and its vTPM.
                    This driver is also used by vtpmmgrdom to communicate
                    with vtpm-stubdom.

 * vtpm-stubdom: A mini-os stub domain that implements a vTPM. There is
                 a one to one mapping between running vtpm-stubdom
                 instances and logical vtpms on the system. The vTPM
                 Platform Configuration Registers (PCRs) are all
		 initialized to zero.

 * mini-os/tpmfront: Mini-os TPM frontend driver. The vTPM mini-os
                     domain vtpm-stubdom uses this driver to
                     communicate with vtpmmgrdom. This driver could
                     also be used separately to implement a mini-os
                     domain that wishes to use a vTPM of
                     its own.

 * vtpmmgrdom: A mini-os domain that implements the vTPM manager.
               There is only one vTPM manager and it should be running
               during the entire lifetime of the machine.  This domain
               regulates access to the physical TPM on the system and
               secures the persistent state of each vTPM.

 * mini-os/tpm_tis: Mini-os TPM version 1.2 TPM Interface Specification
                    (TIS) driver. This driver used by vtpmmgrdom to talk
                    directly to the hardware TPM. Communication is
                    facilitated by mapping hardware memory pages into
                    vtpmmgrdom.

 * Hardware TPM: The physical TPM that is soldered onto the motherboard.

------------------------------
INSTALLATION
------------------------------

Prerequisites:
--------------
You must have an x86 machine with a TPM on the motherboard.
The only software requirement to compiling vTPM is cmake.
You must use libxl to manage domains with vTPMs. 'xm' is
deprecated and does not support vTPM.

Compiling the XEN tree:
-----------------------

Compile and install the XEN tree as usual. Be sure to build and install
the stubdom tree.

Compiling the LINUX dom0 kernel:
--------------------------------

The Linux dom0 kernel has no special prerequisites.

Compiling the LINUX domU kernel:
--------------------------------

The domU kernel used by domains with vtpms must
include the xen-tpmfront.ko driver. It can be built
directly into the kernel or as a module.

CONFIG_TCG_TPM=y
CONFIG_TCG_XEN=y

------------------------------
VTPM MANAGER SETUP
------------------------------

Manager disk image setup:
-------------------------

The vTPM Manager requires a disk image to store its
encrypted data. The image does not require a filesystem
and can live anywhere on the host disk. The image does not need
to be large. 8 to 16 Mb should be sufficient.

Manager config file:
--------------------

The vTPM Manager domain (vtpmmgrdom) must be started like
any other Xen virtual machine and requires a config file.
The manager requires a disk image for storage and permission
to access the hardware memory pages for the TPM. An
example configuration looks like the following.

kernel="/usr/lib/xen/boot/vtpmmgrdom.gz"
memory=16
disk=["file:/var/vtpmmgrdom.img,hda,w"]
name="vtpmmgrdom"
iomem=["fed40,5"]

The iomem line tells xl to allow access to the TPM
IO memory pages, which are 5 pages that start at
0xfed40000.

Starting and stopping the manager:
----------------------------------

The vTPM manager should be started at boot, you may wish to
create an init script to do this.

Once initialization is complete you should see the following:
INFO[VTPM]: Waiting for commands from vTPM's:

To shutdown the manager you must destroy it. To avoid data corruption,
only destroy the manager when you see the above "Waiting for commands"
message. This ensures the disk is in a consistent state.

------------------------------
VTPM AND LINUX PVM SETUP
------------------------------

In the following examples we will assume we have Linux
guest named "domu" with its associated configuration
located at /home/user/domu. It's vtpm will be named
domu-vtpm.

vTPM disk image setup:
----------------------

The vTPM requires a disk image to store its persistent
data. The image does not require a filesystem. The image
does not need to be large. 8 Mb should be sufficient.

vTPM config file:
-----------------

The vTPM domain requires a configuration file like
any other domain. The vTPM requires a disk image for
storage and a TPM frontend driver to communicate
with the manager. An example configuration is given:

kernel="/usr/lib/xen/boot/vtpm-stubdom.gz"
memory=8
disk=["file:/home/user/domu/vtpm.img,hda,w"]
name="domu-vtpm"
vtpm=["backend=vtpmmgrdom,uuid=ac0a5b9e-cbe2-4c07-b43b-1d69e46fb839"]

The vtpm= line sets up the tpm frontend driver. The backend must set
to vtpmmgrdom. You are required to generate a uuid for this vtpm.
You can use the uuidgen unix program or some other method to create a
uuid. The uuid uniquely identifies this vtpm to manager.

If you wish to clear the vTPM data you can either recreate the
disk image or change the uuid.

Linux Guest config file:
------------------------

The Linux guest config file needs to be modified to include
the Linux tpmfront driver. Add the following line:

vtpm=["backend=domu-vtpm"]

Currently only paravirtualized guests are supported.

Launching and shut down:
------------------------

To launch a Linux guest with a vTPM we first have to start the vTPM
domain.

After initialization is complete, you should see the following:
Info: Waiting for frontend domain to connect..

Next, launch the Linux guest

If xen-tpmfront was compiled as a module, be sure to load it
in the guest.

After the Linux domain boots and the xen-tpmfront driver is loaded,
you should see the following on the vtpm console:

Info: VTPM attached to Frontend X/Y

If you have trousers and tpm_tools installed on the guest, you can test
the vtpm.

On guest:

The version command should return the following:
  TPM 1.2 Version Info:
  Chip Version:        1.2.0.7
  Spec Level:          2
  Errata Revision:     1
  TPM Vendor ID:       ETHZ
  TPM Version:         01010000
  Manufacturer Info:   4554485a

You should also see the command being sent to the vtpm console as well
as the vtpm saving its state. You should see the vtpm key being
encrypted and stored on the vtpmmgrdom console.

To shutdown the guest and its vtpm, you just have to shutdown the guest
normally. As soon as the guest vm disconnects, the vtpm will shut itself
down automatically.

On guest:

You may wish to write a script to start your vtpm and guest together.

------------------------------
MORE INFORMATION
------------------------------

See stubdom/vtpmmgr/README for more details about how
the manager domain works, how to use it, and its command line
parameters.

See stubdom/vtpm/README for more specifics about how vtpm-stubdom
operates and the command line options it accepts.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 drivers/char/tpm/Kconfig             |   11 +
 drivers/char/tpm/Makefile            |    2 +
 drivers/char/tpm/tpm.h               |   10 +
 drivers/char/tpm/xen-tpmfront_if.c   |  688 ++++++++++++++++++++++++++++++++++
 drivers/char/tpm/xen-tpmfront_vtpm.c |  543 +++++++++++++++++++++++++++
 drivers/char/tpm/xen-tpmfront_vtpm.h |   55 +++
 include/xen/interface/io/tpmif.h     |   65 ++++
 7 files changed, 1374 insertions(+)
 create mode 100644 drivers/char/tpm/xen-tpmfront_if.c
 create mode 100644 drivers/char/tpm/xen-tpmfront_vtpm.c
 create mode 100644 drivers/char/tpm/xen-tpmfront_vtpm.h
 create mode 100644 include/xen/interface/io/tpmif.h

diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
index 915875e..23d272f 100644
--- a/drivers/char/tpm/Kconfig
+++ b/drivers/char/tpm/Kconfig
@@ -81,4 +81,15 @@ config TCG_IBMVTPM
 	  will be accessible from within Linux.  To compile this driver
 	  as a module, choose M here; the module will be called tpm_ibmvtpm.
 
+config TCG_XEN
+	tristate "XEN TPM Interface"
+	depends on TCG_TPM && XEN
+	---help---
+	  If you want to make TPM support available to a Xen user domain,
+	  say Yes and it will be accessible from within Linux. See
+	  the manpages for xl, xl.conf, and docs/misc/vtpm.txt in
+	  the Xen source repository for more details.
+	  To compile this driver as a module, choose M here; the module
+	  will be called xen-tpmfront.
+
 endif # TCG_TPM
diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
index 5b3fc8b..0161f05 100644
--- a/drivers/char/tpm/Makefile
+++ b/drivers/char/tpm/Makefile
@@ -17,3 +17,5 @@ obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
 obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
 obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
 obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
+obj-$(CONFIG_TCG_XEN) += xen-tpmfront.o
+xen-tpmfront-y = xen-tpmfront_if.o xen-tpmfront_vtpm.o
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 8ef7649..b575892 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -328,6 +328,16 @@ extern int tpm_pm_resume(struct device *);
 extern int wait_for_tpm_stat(struct tpm_chip *, u8, unsigned long,
 			     wait_queue_head_t *);
 
+static inline void *chip_get_private(const struct tpm_chip *chip)
+{
+	return chip->vendor.data;
+}
+
+static inline void chip_set_private(struct tpm_chip *chip, void *priv)
+{
+	chip->vendor.data = priv;
+}
+
 #ifdef CONFIG_ACPI
 extern int tpm_add_ppi(struct kobject *);
 extern void tpm_remove_ppi(struct kobject *);
diff --git a/drivers/char/tpm/xen-tpmfront_if.c b/drivers/char/tpm/xen-tpmfront_if.c
new file mode 100644
index 0000000..ba7fad8
--- /dev/null
+++ b/drivers/char/tpm/xen-tpmfront_if.c
@@ -0,0 +1,688 @@
+/*
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * Author: Stefan Berger, stefanb@us.ibm.com
+ * Grant table support: Mahadevan Gomathisankaran
+ *
+ * This code has been derived from drivers/xen/netfront/netfront.c
+ *
+ * Copyright (c) 2002-2004, K A Fraser
+ *
+ * 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.
+ */
+
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
+#include <linux/mutex.h>
+#include <linux/uaccess.h>
+#include <xen/events.h>
+#include <xen/interface/grant_table.h>
+#include <xen/interface/io/tpmif.h>
+#include <xen/grant_table.h>
+#include <xen/xenbus.h>
+#include <xen/page.h>
+#include "tpm.h"
+#include "xen-tpmfront_vtpm.h"
+
+#define GRANT_INVALID_REF 0
+
+/* local structures */
+struct tpm_private {
+	struct tpm_chip *chip;
+
+	struct tpmif_tx_interface *tx;
+	atomic_t refcnt;
+	unsigned int evtchn;
+	u8 is_connected;
+	u8 is_suspended;
+
+	spinlock_t tx_lock;
+
+	struct tx_buffer *tx_buffers[TPMIF_TX_RING_SIZE];
+
+	atomic_t tx_busy;
+	void *tx_remember;
+
+	domid_t backend_id;
+	wait_queue_head_t wait_q;
+
+	struct xenbus_device *dev;
+	int ring_ref;
+};
+
+struct tx_buffer {
+	unsigned int size;	/* available space in data */
+	unsigned int len;	/* used space in data */
+	unsigned char *data;	/* pointer to a page */
+};
+
+
+/* locally visible variables */
+static grant_ref_t gref_head;
+static struct tpm_private *my_priv;
+
+/* local function prototypes */
+static irqreturn_t tpmif_int(int irq,
+		void *tpm_priv);
+static void tpmif_rx_action(unsigned long unused);
+static int tpmif_connect(struct xenbus_device *dev,
+		struct tpm_private *tp,
+		domid_t domid);
+static DECLARE_TASKLET(tpmif_rx_tasklet, tpmif_rx_action, 0);
+static int tpmif_allocate_tx_buffers(struct tpm_private *tp);
+static void tpmif_free_tx_buffers(struct tpm_private *tp);
+static void tpmif_set_connected_state(struct tpm_private *tp,
+		u8 newstate);
+static int tpm_xmit(struct tpm_private *tp,
+		const u8 *buf, size_t count, int userbuffer,
+		void *remember);
+static void destroy_tpmring(struct tpm_private *tp);
+
+static inline int
+tx_buffer_copy(struct tx_buffer *txb, const u8 *src, int len,
+		int isuserbuffer)
+{
+	int copied = len;
+
+	if (len > txb->size)
+		copied = txb->size;
+	if (isuserbuffer) {
+		if (copy_from_user(txb->data, src, copied))
+			return -EFAULT;
+	} else {
+		memcpy(txb->data, src, copied);
+	}
+	txb->len = len;
+	return copied;
+}
+
+static inline struct tx_buffer *tx_buffer_alloc(void)
+{
+	struct tx_buffer *txb;
+
+	txb = kzalloc(sizeof(struct tx_buffer), GFP_KERNEL);
+	if (!txb)
+		return NULL;
+
+	txb->len = 0;
+	txb->size = PAGE_SIZE;
+	txb->data = (unsigned char *)__get_free_page(GFP_KERNEL);
+	if (txb->data == NULL) {
+		kfree(txb);
+		txb = NULL;
+	}
+
+	return txb;
+}
+
+
+static inline void tx_buffer_free(struct tx_buffer *txb)
+{
+	if (txb) {
+		free_page((long)txb->data);
+		kfree(txb);
+	}
+}
+
+/**************************************************************
+  Utility function for the tpm_private structure
+ **************************************************************/
+static void tpm_private_init(struct tpm_private *tp)
+{
+	spin_lock_init(&tp->tx_lock);
+	init_waitqueue_head(&tp->wait_q);
+	atomic_set(&tp->refcnt, 1);
+}
+
+static void tpm_private_put(void)
+{
+	if (!atomic_dec_and_test(&my_priv->refcnt))
+		return;
+
+	tpmif_free_tx_buffers(my_priv);
+	kfree(my_priv);
+	my_priv = NULL;
+}
+
+static struct tpm_private *tpm_private_get(void)
+{
+	int err;
+
+	if (my_priv) {
+		atomic_inc(&my_priv->refcnt);
+		return my_priv;
+	}
+
+	my_priv = kzalloc(sizeof(struct tpm_private), GFP_KERNEL);
+	if (!my_priv)
+		return NULL;
+
+	tpm_private_init(my_priv);
+	err = tpmif_allocate_tx_buffers(my_priv);
+	if (err < 0)
+		tpm_private_put();
+
+	return my_priv;
+}
+
+/**************************************************************
+
+  The interface to let the tpm plugin register its callback
+  function and send data to another partition using this module
+
+ **************************************************************/
+
+static DEFINE_MUTEX(suspend_lock);
+/*
+ * Send data via this module by calling this function
+ */
+int vtpm_vd_send(struct tpm_private *tp,
+		const u8 *buf, size_t count, void *ptr)
+{
+	int sent;
+
+	mutex_lock(&suspend_lock);
+	sent = tpm_xmit(tp, buf, count, 0, ptr);
+	mutex_unlock(&suspend_lock);
+
+	return sent;
+}
+
+/**************************************************************
+  XENBUS support code
+ **************************************************************/
+
+static int setup_tpmring(struct xenbus_device *dev,
+		struct tpm_private *tp)
+{
+	struct tpmif_tx_interface *sring;
+	int err;
+
+	tp->ring_ref = GRANT_INVALID_REF;
+
+	sring = (void *)__get_free_page(GFP_KERNEL);
+	if (!sring) {
+		xenbus_dev_fatal(dev, -ENOMEM, "allocating shared ring");
+		return -ENOMEM;
+	}
+	tp->tx = sring;
+
+	err = xenbus_grant_ring(dev, virt_to_mfn(tp->tx));
+	if (err < 0) {
+		free_page((unsigned long)sring);
+		tp->tx = NULL;
+		xenbus_dev_fatal(dev, err, "allocating grant reference");
+		goto fail;
+	}
+	tp->ring_ref = err;
+
+	err = tpmif_connect(dev, tp, dev->otherend_id);
+	if (err)
+		goto fail;
+
+	return 0;
+fail:
+	destroy_tpmring(tp);
+	return err;
+}
+
+
+static void destroy_tpmring(struct tpm_private *tp)
+{
+	tpmif_set_connected_state(tp, 0);
+
+	if (tp->ring_ref != GRANT_INVALID_REF) {
+		gnttab_end_foreign_access(tp->ring_ref,
+				0, (unsigned long)tp->tx);
+		tp->ring_ref = GRANT_INVALID_REF;
+		tp->tx = NULL;
+	}
+
+	if (tp->evtchn)
+		unbind_from_irqhandler(irq_from_evtchn(tp->evtchn), tp);
+
+	tp->evtchn = GRANT_INVALID_REF;
+}
+
+
+static int talk_to_backend(struct xenbus_device *dev,
+		struct tpm_private *tp)
+{
+	const char *message = NULL;
+	int err;
+	struct xenbus_transaction xbt;
+
+	err = setup_tpmring(dev, tp);
+	if (err) {
+		xenbus_dev_fatal(dev, err, "setting up ring");
+		goto out;
+	}
+
+again:
+	err = xenbus_transaction_start(&xbt);
+	if (err) {
+		xenbus_dev_fatal(dev, err, "starting transaction");
+		goto destroy_tpmring;
+	}
+
+	err = xenbus_printf(xbt, dev->nodename,
+			"ring-ref", "%u", tp->ring_ref);
+	if (err) {
+		message = "writing ring-ref";
+		goto abort_transaction;
+	}
+
+	err = xenbus_printf(xbt, dev->nodename, "event-channel", "%u",
+			tp->evtchn);
+	if (err) {
+		message = "writing event-channel";
+		goto abort_transaction;
+	}
+
+	err = xenbus_transaction_end(xbt, 0);
+	if (err == -EAGAIN)
+		goto again;
+	if (err) {
+		xenbus_dev_fatal(dev, err, "completing transaction");
+		goto destroy_tpmring;
+	}
+
+	xenbus_switch_state(dev, XenbusStateConnected);
+
+	return 0;
+
+abort_transaction:
+	xenbus_transaction_end(xbt, 1);
+	if (message)
+		xenbus_dev_error(dev, err, "%s", message);
+destroy_tpmring:
+	destroy_tpmring(tp);
+out:
+	return err;
+}
+
+/**
+ * Callback received when the backend's state changes.
+ */
+static void backend_changed(struct xenbus_device *dev,
+		enum xenbus_state backend_state)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+
+	switch (backend_state) {
+	case XenbusStateInitialising:
+	case XenbusStateInitWait:
+	case XenbusStateInitialised:
+	case XenbusStateReconfiguring:
+	case XenbusStateReconfigured:
+	case XenbusStateUnknown:
+		break;
+
+	case XenbusStateConnected:
+		tpmif_set_connected_state(tp, 1);
+		break;
+
+	case XenbusStateClosing:
+		tpmif_set_connected_state(tp, 0);
+		xenbus_frontend_closed(dev);
+		break;
+
+	case XenbusStateClosed:
+		tpmif_set_connected_state(tp, 0);
+		if (tp->is_suspended == 0)
+			device_unregister(&dev->dev);
+		xenbus_frontend_closed(dev);
+		break;
+	}
+}
+
+static int tpmfront_probe(struct xenbus_device *dev,
+		const struct xenbus_device_id *id)
+{
+	int err;
+	int handle;
+	struct tpm_private *tp = tpm_private_get();
+
+	if (!tp)
+		return -ENOMEM;
+
+	tp->chip = init_vtpm(&dev->dev, tp);
+	if (IS_ERR(tp->chip))
+		return PTR_ERR(tp->chip);
+
+	err = xenbus_scanf(XBT_NIL, dev->nodename,
+			"handle", "%i", &handle);
+	if (XENBUS_EXIST_ERR(err))
+		return err;
+
+	if (err < 0) {
+		xenbus_dev_fatal(dev, err, "reading virtual-device");
+		return err;
+	}
+
+	tp->dev = dev;
+
+	err = talk_to_backend(dev, tp);
+	if (err) {
+		tpm_private_put();
+		return err;
+	}
+
+	return 0;
+}
+
+
+static int __devexit tpmfront_remove(struct xenbus_device *dev)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+	destroy_tpmring(tp);
+	cleanup_vtpm(&dev->dev);
+	return 0;
+}
+
+static int tpmfront_suspend(struct xenbus_device *dev)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+	u32 ctr;
+
+	/* Take the lock, preventing any application from sending. */
+	mutex_lock(&suspend_lock);
+	tp->is_suspended = 1;
+
+	for (ctr = 0; atomic_read(&tp->tx_busy); ctr++) {
+		/* Wait for a request to be responded to. */
+		interruptible_sleep_on_timeout(&tp->wait_q, 100);
+	}
+
+	return 0;
+}
+
+static int tpmfront_suspend_finish(struct tpm_private *tp)
+{
+	tp->is_suspended = 0;
+	/* Allow applications to send again. */
+	mutex_unlock(&suspend_lock);
+	return 0;
+}
+
+static int tpmfront_resume(struct xenbus_device *dev)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+	destroy_tpmring(tp);
+	return talk_to_backend(dev, tp);
+}
+
+static int tpmif_connect(struct xenbus_device *dev,
+		struct tpm_private *tp,
+		domid_t domid)
+{
+	int err;
+
+	tp->backend_id = domid;
+	tp->evtchn = GRANT_INVALID_REF;
+
+	err = xenbus_alloc_evtchn(dev, &tp->evtchn);
+	if (err)
+		return err;
+
+	err = bind_evtchn_to_irqhandler(tp->evtchn, tpmif_int,
+			0, "tpmif", tp);
+	if (err <= 0)
+		return err;
+
+	return 0;
+}
+
+static const struct xenbus_device_id tpmfront_ids[] = {
+	{ "vtpm" },
+	{ "" }
+};
+MODULE_ALIAS("xen:vtpm");
+
+static DEFINE_XENBUS_DRIVER(tpmfront, ,
+		.probe = tpmfront_probe,
+		.remove =  __devexit_p(tpmfront_remove),
+		.resume = tpmfront_resume,
+		.otherend_changed = backend_changed,
+		.suspend = tpmfront_suspend,
+		);
+
+static int tpmif_allocate_tx_buffers(struct tpm_private *tp)
+{
+	unsigned int i;
+
+	for (i = 0; i < TPMIF_TX_RING_SIZE; i++) {
+		tp->tx_buffers[i] = tx_buffer_alloc();
+		if (!tp->tx_buffers[i]) {
+			tpmif_free_tx_buffers(tp);
+			return -ENOMEM;
+		}
+	}
+	return 0;
+}
+
+static void tpmif_free_tx_buffers(struct tpm_private *tp)
+{
+	unsigned int i;
+
+	for (i = 0; i < TPMIF_TX_RING_SIZE; i++)
+		tx_buffer_free(tp->tx_buffers[i]);
+}
+
+static void tpmif_rx_action(unsigned long priv)
+{
+	struct tpm_private *tp = (struct tpm_private *)priv;
+	int i = 0;
+	unsigned int received;
+	unsigned int offset = 0;
+	u8 *buffer;
+	struct tpmif_tx_request *tx = &tp->tx->ring[i].req;
+
+	atomic_set(&tp->tx_busy, 0);
+	wake_up_interruptible(&tp->wait_q);
+
+	received = tx->size;
+
+	buffer = kmalloc(received, GFP_ATOMIC);
+	if (!buffer)
+		return;
+
+	for (i = 0; i < TPMIF_TX_RING_SIZE && offset < received; i++) {
+		struct tx_buffer *txb = tp->tx_buffers[i];
+		struct tpmif_tx_request *tx;
+		unsigned int tocopy;
+
+		tx = &tp->tx->ring[i].req;
+		tocopy = tx->size;
+		if (tocopy > PAGE_SIZE)
+			tocopy = PAGE_SIZE;
+
+		memcpy(&buffer[offset], txb->data, tocopy);
+
+		gnttab_release_grant_reference(&gref_head, tx->ref);
+
+		offset += tocopy;
+	}
+
+	vtpm_vd_recv(tp->chip, buffer, received, tp->tx_remember);
+	kfree(buffer);
+}
+
+
+static irqreturn_t tpmif_int(int irq, void *tpm_priv)
+{
+	struct tpm_private *tp = tpm_priv;
+	unsigned long flags;
+
+	spin_lock_irqsave(&tp->tx_lock, flags);
+	tpmif_rx_tasklet.data = (unsigned long)tp;
+	tasklet_schedule(&tpmif_rx_tasklet);
+	spin_unlock_irqrestore(&tp->tx_lock, flags);
+
+	return IRQ_HANDLED;
+}
+
+
+static int tpm_xmit(struct tpm_private *tp,
+		const u8 *buf, size_t count, int isuserbuffer,
+		void *remember)
+{
+	struct tpmif_tx_request *tx;
+	int i;
+	unsigned int offset = 0;
+
+	spin_lock_irq(&tp->tx_lock);
+
+	if (unlikely(atomic_read(&tp->tx_busy))) {
+		spin_unlock_irq(&tp->tx_lock);
+		return -EBUSY;
+	}
+
+	if (tp->is_connected != 1) {
+		spin_unlock_irq(&tp->tx_lock);
+		return -EIO;
+	}
+
+	for (i = 0; count > 0 && i < TPMIF_TX_RING_SIZE; i++) {
+		struct tx_buffer *txb = tp->tx_buffers[i];
+		int copied;
+
+		if (!txb) {
+			spin_unlock_irq(&tp->tx_lock);
+			return -EFAULT;
+		}
+
+		copied = tx_buffer_copy(txb, &buf[offset], count,
+				isuserbuffer);
+		if (copied < 0) {
+			/* An error occurred */
+			spin_unlock_irq(&tp->tx_lock);
+			return copied;
+		}
+		count -= copied;
+		offset += copied;
+
+		tx = &tp->tx->ring[i].req;
+		tx->addr = virt_to_machine(txb->data).maddr;
+		tx->size = txb->len;
+		tx->unused = 0;
+
+		/* Get the granttable reference for this page. */
+		tx->ref = gnttab_claim_grant_reference(&gref_head);
+		if (tx->ref == -ENOSPC) {
+			spin_unlock_irq(&tp->tx_lock);
+			return -ENOSPC;
+		}
+		gnttab_grant_foreign_access_ref(tx->ref,
+				tp->backend_id,
+				virt_to_mfn(txb->data),
+				0 /*RW*/);
+		wmb();
+	}
+
+	atomic_set(&tp->tx_busy, 1);
+	tp->tx_remember = remember;
+
+	mb();
+
+	notify_remote_via_evtchn(tp->evtchn);
+
+	spin_unlock_irq(&tp->tx_lock);
+	return offset;
+}
+
+
+static void tpmif_notify_upperlayer(struct tpm_private *tp)
+{
+	/* Notify upper layer about the state of the connection to the BE. */
+	vtpm_vd_status(tp->chip, (tp->is_connected
+				? TPM_VD_STATUS_CONNECTED
+				: TPM_VD_STATUS_DISCONNECTED));
+}
+
+
+static void tpmif_set_connected_state(struct tpm_private *tp, u8 is_connected)
+{
+	/*
+	 * Don't notify upper layer if we are in suspend mode and
+	 * should disconnect - assumption is that we will resume
+	 * The mutex keeps apps from sending.
+	 */
+	if (is_connected == 0 && tp->is_suspended == 1)
+		return;
+
+	/*
+	 * Unlock the mutex if we are connected again
+	 * after being suspended - now resuming.
+	 * This also removes the suspend state.
+	 */
+	if (is_connected == 1 && tp->is_suspended == 1)
+		tpmfront_suspend_finish(tp);
+
+	if (is_connected != tp->is_connected) {
+		tp->is_connected = is_connected;
+		tpmif_notify_upperlayer(tp);
+	}
+}
+
+
+
+/* =================================================================
+ * Initialization function.
+ * =================================================================
+ */
+
+
+static int __init tpmif_init(void)
+{
+	struct tpm_private *tp;
+
+	if (!xen_domain())
+		return -ENODEV;
+
+	tp = tpm_private_get();
+	if (!tp)
+		return -ENOMEM;
+
+	if (gnttab_alloc_grant_references(TPMIF_TX_RING_SIZE,
+				&gref_head) < 0) {
+		tpm_private_put();
+		return -EFAULT;
+	}
+
+	return xenbus_register_frontend(&tpmfront_driver);
+}
+module_init(tpmif_init);
+
+static void __exit tpmif_exit(void)
+{
+	xenbus_unregister_driver(&tpmfront_driver);
+	gnttab_free_grant_references(gref_head);
+	tpm_private_put();
+}
+module_exit(tpmif_exit);
+
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/drivers/char/tpm/xen-tpmfront_vtpm.c b/drivers/char/tpm/xen-tpmfront_vtpm.c
new file mode 100644
index 0000000..d70f1df
--- /dev/null
+++ b/drivers/char/tpm/xen-tpmfront_vtpm.c
@@ -0,0 +1,543 @@
+/*
+ * Copyright (C) 2006 IBM Corporation
+ *
+ * Authors:
+ * Stefan Berger <stefanb@us.ibm.com>
+ *
+ * Generic device driver part for device drivers in a virtualized
+ * environment.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, version 2 of the
+ * License.
+ *
+ */
+
+#include <linux/uaccess.h>
+#include <linux/list.h>
+#include <linux/device.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include "tpm.h"
+#include "xen-tpmfront_vtpm.h"
+
+/* read status bits */
+enum {
+	STATUS_BUSY = 0x01,
+	STATUS_DATA_AVAIL = 0x02,
+	STATUS_READY = 0x04
+};
+
+struct transmission {
+	struct list_head next;
+
+	unsigned char *request;
+	size_t  request_len;
+	size_t  request_buflen;
+
+	unsigned char *response;
+	size_t  response_len;
+	size_t  response_buflen;
+
+	unsigned int flags;
+};
+
+enum {
+	TRANSMISSION_FLAG_WAS_QUEUED = 0x1
+};
+
+
+enum {
+	DATAEX_FLAG_QUEUED_ONLY = 0x1
+};
+
+
+/* local variables */
+
+/* local function prototypes */
+static int _vtpm_send_queued(struct tpm_chip *chip);
+
+
+/* =============================================================
+ * Some utility functions
+ * =============================================================
+ */
+static void vtpm_state_init(struct vtpm_state *vtpms)
+{
+	vtpms->current_request = NULL;
+	spin_lock_init(&vtpms->req_list_lock);
+	init_waitqueue_head(&vtpms->req_wait_queue);
+	INIT_LIST_HEAD(&vtpms->queued_requests);
+
+	vtpms->current_response = NULL;
+	spin_lock_init(&vtpms->resp_list_lock);
+	init_waitqueue_head(&vtpms->resp_wait_queue);
+
+	vtpms->disconnect_time = jiffies;
+}
+
+
+static inline struct transmission *transmission_alloc(void)
+{
+	return kzalloc(sizeof(struct transmission), GFP_ATOMIC);
+}
+
+static unsigned char *
+transmission_set_req_buffer(struct transmission *t,
+		unsigned char *buffer, size_t len)
+{
+	if (t->request_buflen < len) {
+		kfree(t->request);
+		t->request = kmalloc(len, GFP_KERNEL);
+		if (!t->request) {
+			t->request_buflen = 0;
+			return NULL;
+		}
+		t->request_buflen = len;
+	}
+
+	memcpy(t->request, buffer, len);
+	t->request_len = len;
+
+	return t->request;
+}
+
+static unsigned char *
+transmission_set_res_buffer(struct transmission *t,
+		const unsigned char *buffer, size_t len)
+{
+	if (t->response_buflen < len) {
+		kfree(t->response);
+		t->response = kmalloc(len, GFP_ATOMIC);
+		if (!t->response) {
+			t->response_buflen = 0;
+			return NULL;
+		}
+		t->response_buflen = len;
+	}
+
+	memcpy(t->response, buffer, len);
+	t->response_len = len;
+
+	return t->response;
+}
+
+static inline void transmission_free(struct transmission *t)
+{
+	kfree(t->request);
+	kfree(t->response);
+	kfree(t);
+}
+
+/* =============================================================
+ * Interface with the lower layer driver
+ * =============================================================
+ */
+/*
+ * Lower layer uses this function to make a response available.
+ */
+int vtpm_vd_recv(const struct tpm_chip *chip,
+		const unsigned char *buffer, size_t count,
+		void *ptr)
+{
+	unsigned long flags;
+	int ret_size = 0;
+	struct transmission *t;
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	/*
+	 * The list with requests must contain one request
+	 * only and the element there must be the one that
+	 * was passed to me from the front-end.
+	 */
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	if (vtpms->current_request != ptr) {
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		return 0;
+	}
+	t = vtpms->current_request;
+	if (t) {
+		transmission_free(t);
+		vtpms->current_request = NULL;
+	}
+
+	t = transmission_alloc();
+	if (t) {
+		if (!transmission_set_res_buffer(t, buffer, count)) {
+			transmission_free(t);
+			spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+			return -ENOMEM;
+		}
+		ret_size = count;
+		vtpms->current_response = t;
+		wake_up_interruptible(&vtpms->resp_wait_queue);
+	}
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+
+	return ret_size;
+}
+
+
+/*
+ * Lower layer indicates its status (connected/disconnected)
+ */
+void vtpm_vd_status(const struct tpm_chip *chip, u8 vd_status)
+{
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	vtpms->vd_status = vd_status;
+	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0)
+		vtpms->disconnect_time = jiffies;
+}
+
+/* =============================================================
+ * Interface with the generic TPM driver
+ * =============================================================
+ */
+static int vtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count)
+{
+	int rc = 0;
+	unsigned long flags;
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	/*
+	 * Check if the previous operation only queued the command
+	 * In this case there won't be a response, so I just
+	 * return from here and reset that flag. In any other
+	 * case I should receive a response from the back-end.
+	 */
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	if ((vtpms->flags & DATAEX_FLAG_QUEUED_ONLY) != 0) {
+		vtpms->flags &= ~DATAEX_FLAG_QUEUED_ONLY;
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		/*
+		 * The first few commands (measurements) must be
+		 * queued since it might not be possible to talk to the
+		 * TPM, yet.
+		 * Return a response of up to 30 '0's.
+		 */
+
+		count = min_t(size_t, count, 30);
+		memset(buf, 0x0, count);
+		return count;
+	}
+	/*
+	 * Check whether something is in the responselist and if
+	 * there's nothing in the list wait for something to appear.
+	 */
+
+	if (!vtpms->current_response) {
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		interruptible_sleep_on_timeout(&vtpms->resp_wait_queue,
+				1000);
+		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	}
+
+	if (vtpms->current_response) {
+		struct transmission *t = vtpms->current_response;
+		vtpms->current_response = NULL;
+		rc = min(count, t->response_len);
+		memcpy(buf, t->response, rc);
+		transmission_free(t);
+	}
+
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+	return rc;
+}
+
+static int vtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)
+{
+	int rc = 0;
+	unsigned long flags;
+	struct transmission *t = transmission_alloc();
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	if (!t)
+		return -ENOMEM;
+	/*
+	 * If there's a current request, it must be the
+	 * previous request that has timed out.
+	 */
+	spin_lock_irqsave(&vtpms->req_list_lock, flags);
+	if (vtpms->current_request != NULL) {
+		dev_warn(chip->dev, "Sending although there is a request outstanding.\n"
+				"         Previous request must have timed out.\n");
+		transmission_free(vtpms->current_request);
+		vtpms->current_request = NULL;
+	}
+	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+
+	/*
+	 * Queue the packet if the driver below is not
+	 * ready, yet, or there is any packet already
+	 * in the queue.
+	 * If the driver below is ready, unqueue all
+	 * packets first before sending our current
+	 * packet.
+	 * For each unqueued packet, except for the
+	 * last (=current) packet, call the function
+	 * tpm_xen_recv to wait for the response to come
+	 * back.
+	 */
+	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0) {
+		if (time_after(jiffies,
+					vtpms->disconnect_time + HZ * 10)) {
+			rc = -ENOENT;
+		} else {
+			goto queue_it;
+		}
+	} else {
+		/*
+		 * Send all queued packets.
+		 */
+		if (_vtpm_send_queued(chip) == 0) {
+
+			vtpms->current_request = t;
+
+			rc = vtpm_vd_send(vtpms->tpm_private,
+					buf,
+					count,
+					t);
+			/*
+			 * The generic TPM driver will call
+			 * the function to receive the response.
+			 */
+			if (rc < 0) {
+				vtpms->current_request = NULL;
+				goto queue_it;
+			}
+		} else {
+queue_it:
+			if (!transmission_set_req_buffer(t, buf, count)) {
+				transmission_free(t);
+				rc = -ENOMEM;
+				goto exit;
+			}
+			/*
+			 * An error occurred. Don't event try
+			 * to send the current request. Just
+			 * queue it.
+			 */
+			spin_lock_irqsave(&vtpms->req_list_lock, flags);
+			vtpms->flags |= DATAEX_FLAG_QUEUED_ONLY;
+			list_add_tail(&t->next, &vtpms->queued_requests);
+			spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+		}
+	}
+
+exit:
+	return rc;
+}
+
+
+/*
+ * Send all queued requests.
+ */
+static int _vtpm_send_queued(struct tpm_chip *chip)
+{
+	int rc;
+	int error = 0;
+	unsigned long flags;
+	unsigned char buffer[1];
+	struct vtpm_state *vtpms;
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	spin_lock_irqsave(&vtpms->req_list_lock, flags);
+
+	while (!list_empty(&vtpms->queued_requests)) {
+		/*
+		 * Need to dequeue them.
+		 * Read the result into a dummy buffer.
+		 */
+		struct transmission *qt = (struct transmission *)
+			vtpms->queued_requests.next;
+		list_del(&qt->next);
+		vtpms->current_request = qt;
+		spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+
+		rc = vtpm_vd_send(vtpms->tpm_private,
+				qt->request,
+				qt->request_len,
+				qt);
+
+		if (rc < 0) {
+			spin_lock_irqsave(&vtpms->req_list_lock, flags);
+			qt = vtpms->current_request;
+			if (qt != NULL) {
+				/*
+				 * requeue it at the beginning
+				 * of the list
+				 */
+				list_add(&qt->next,
+						&vtpms->queued_requests);
+			}
+			vtpms->current_request = NULL;
+			error = 1;
+			break;
+		}
+		/*
+		 * After this point qt is not valid anymore!
+		 * It is freed when the front-end is delivering
+		 * the data by calling tpm_recv
+		 */
+		/*
+		 * Receive response into provided dummy buffer
+		 */
+		rc = vtpm_recv(chip, buffer, sizeof(buffer));
+		spin_lock_irqsave(&vtpms->req_list_lock, flags);
+	}
+
+	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+
+	return error;
+}
+
+static void vtpm_cancel(struct tpm_chip *chip)
+{
+	unsigned long flags;
+	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+
+	if (!vtpms->current_response && vtpms->current_request) {
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		interruptible_sleep_on(&vtpms->resp_wait_queue);
+		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	}
+
+	if (vtpms->current_response) {
+		struct transmission *t = vtpms->current_response;
+		vtpms->current_response = NULL;
+		transmission_free(t);
+	}
+
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+}
+
+static u8 vtpm_status(struct tpm_chip *chip)
+{
+	u8 rc = 0;
+	unsigned long flags;
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	/*
+	 * Data are available if:
+	 *  - there's a current response
+	 *  - the last packet was queued only (this is fake, but necessary to
+	 *      get the generic TPM layer to call the receive function.)
+	 */
+	if (vtpms->current_response ||
+			0 != (vtpms->flags & DATAEX_FLAG_QUEUED_ONLY)) {
+		rc = STATUS_DATA_AVAIL;
+	} else if (!vtpms->current_response && !vtpms->current_request) {
+		rc = STATUS_READY;
+	}
+
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+	return rc;
+}
+
+static const struct file_operations vtpm_ops = {
+	.owner = THIS_MODULE,
+	.llseek = no_llseek,
+	.open = tpm_open,
+	.read = tpm_read,
+	.write = tpm_write,
+	.release = tpm_release,
+};
+
+static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
+static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
+static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);
+static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL);
+static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL);
+static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,
+		NULL);
+static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL);
+static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
+
+static struct attribute *vtpm_attrs[] = {
+	&dev_attr_pubek.attr,
+	&dev_attr_pcrs.attr,
+	&dev_attr_enabled.attr,
+	&dev_attr_active.attr,
+	&dev_attr_owned.attr,
+	&dev_attr_temp_deactivated.attr,
+	&dev_attr_caps.attr,
+	&dev_attr_cancel.attr,
+	NULL,
+};
+
+static struct attribute_group vtpm_attr_grp = { .attrs = vtpm_attrs };
+
+#define TPM_LONG_TIMEOUT   (10 * 60 * HZ)
+
+static struct tpm_vendor_specific tpm_vtpm = {
+	.recv = vtpm_recv,
+	.send = vtpm_send,
+	.cancel = vtpm_cancel,
+	.status = vtpm_status,
+	.req_complete_mask = STATUS_BUSY | STATUS_DATA_AVAIL,
+	.req_complete_val  = STATUS_DATA_AVAIL,
+	.req_canceled = STATUS_READY,
+	.attr_group = &vtpm_attr_grp,
+	.miscdev = {
+		.fops = &vtpm_ops,
+	},
+	.duration = {
+		TPM_LONG_TIMEOUT,
+		TPM_LONG_TIMEOUT,
+		TPM_LONG_TIMEOUT,
+	},
+};
+
+struct tpm_chip *init_vtpm(struct device *dev,
+		struct tpm_private *tp)
+{
+	long rc;
+	struct tpm_chip *chip;
+	struct vtpm_state *vtpms;
+
+	vtpms = kzalloc(sizeof(struct vtpm_state), GFP_KERNEL);
+	if (!vtpms)
+		return ERR_PTR(-ENOMEM);
+
+	vtpm_state_init(vtpms);
+	vtpms->tpm_private = tp;
+
+	chip = tpm_register_hardware(dev, &tpm_vtpm);
+	if (!chip) {
+		rc = -ENODEV;
+		goto err_free_mem;
+	}
+
+	chip_set_private(chip, vtpms);
+
+	return chip;
+
+err_free_mem:
+	kfree(vtpms);
+
+	return ERR_PTR(rc);
+}
+
+void cleanup_vtpm(struct device *dev)
+{
+	struct tpm_chip *chip = dev_get_drvdata(dev);
+	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
+	tpm_remove_hardware(dev);
+	kfree(vtpms);
+}
diff --git a/drivers/char/tpm/xen-tpmfront_vtpm.h b/drivers/char/tpm/xen-tpmfront_vtpm.h
new file mode 100644
index 0000000..16cf323
--- /dev/null
+++ b/drivers/char/tpm/xen-tpmfront_vtpm.h
@@ -0,0 +1,55 @@
+#ifndef XEN_TPMFRONT_VTPM_H
+#define XEN_TPMFRONT_VTPM_H
+
+struct tpm_chip;
+struct tpm_private;
+
+struct vtpm_state {
+	struct transmission *current_request;
+	spinlock_t           req_list_lock;
+	wait_queue_head_t    req_wait_queue;
+
+	struct list_head     queued_requests;
+
+	struct transmission *current_response;
+	spinlock_t           resp_list_lock;
+	wait_queue_head_t    resp_wait_queue;
+
+	u8                   vd_status;
+	u8                   flags;
+
+	unsigned long        disconnect_time;
+
+	/*
+	 * The following is a private structure of the underlying
+	 * driver. It is passed as parameter in the send function.
+	 */
+	struct tpm_private *tpm_private;
+};
+
+
+enum vdev_status {
+	TPM_VD_STATUS_DISCONNECTED = 0x0,
+	TPM_VD_STATUS_CONNECTED = 0x1
+};
+
+/* this function is called from tpm_vtpm.c */
+int vtpm_vd_send(struct tpm_private *tp,
+		const u8 *buf, size_t count, void *ptr);
+
+/* these functions are offered by tpm_vtpm.c */
+struct tpm_chip *init_vtpm(struct device *,
+		struct tpm_private *);
+void cleanup_vtpm(struct device *);
+int vtpm_vd_recv(const struct tpm_chip *chip,
+		const unsigned char *buffer, size_t count, void *ptr);
+void vtpm_vd_status(const struct tpm_chip *, u8 status);
+
+static inline struct tpm_private *tpm_private_from_dev(struct device *dev)
+{
+	struct tpm_chip *chip = dev_get_drvdata(dev);
+	struct vtpm_state *vtpms = (struct vtpm_state *)chip->vendor.data;
+	return vtpms->tpm_private;
+}
+
+#endif
diff --git a/include/xen/interface/io/tpmif.h b/include/xen/interface/io/tpmif.h
new file mode 100644
index 0000000..c9e7294
--- /dev/null
+++ b/include/xen/interface/io/tpmif.h
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * tpmif.h
+ *
+ * TPM I/O interface for Xen guest OSes.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (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.
+ *
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * Author: Stefan Berger, stefanb@us.ibm.com
+ * Grant table support: Mahadevan Gomathisankaran
+ *
+ * This code has been derived from tools/libxc/xen/io/netif.h
+ *
+ * Copyright (c) 2003-2004, Keir Fraser
+ */
+
+#ifndef __XEN_PUBLIC_IO_TPMIF_H__
+#define __XEN_PUBLIC_IO_TPMIF_H__
+
+#include "../grant_table.h"
+
+struct tpmif_tx_request {
+	unsigned long addr;   /* Machine address of packet.   */
+	grant_ref_t ref;      /* grant table access reference */
+	uint16_t unused;
+	uint16_t size;        /* Packet size in bytes.        */
+};
+struct tpmif_tx_request;
+
+/*
+ * The TPMIF_TX_RING_SIZE defines the number of pages the
+ * front-end and backend can exchange (= size of array).
+ */
+#define TPMIF_TX_RING_SIZE 1
+
+/* This structure must fit in a memory page. */
+
+struct tpmif_ring {
+	struct tpmif_tx_request req;
+};
+struct tpmif_ring;
+
+struct tpmif_tx_interface {
+	struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
+};
+struct tpmif_tx_interface;
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:34:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:34:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaotY-0006pV-1C; Tue, 20 Nov 2012 14:33:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaotV-0006pE-KZ
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 14:33:46 +0000
Received: from [85.158.143.35:26298] by server-2.bemta-4.messagelabs.com id
	0D/0B-28922-9C49BA05; Tue, 20 Nov 2012 14:33:45 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-14.tower-21.messagelabs.com!1353422020!18537156!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30086 invoked from network); 20 Nov 2012 14:33:41 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 20 Nov 2012 14:33:41 -0000
Received: from ([128.244.206.185])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149573560;
	Tue, 20 Nov 2012 09:33:17 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: key@linux.vnet.ibm.com, mail@srajiv.net, jeremy@goop.org,
	tpmdd-devel@lists.sourceforge.net, xen-devel@lists.xensource.com,
	konrad.wilk@oracle.com
Date: Tue, 20 Nov 2012 09:33:05 -0500
Message-Id: <1353421985-25398-1-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	linux-kernel@vger.kernel.org
Subject: [Xen-devel] [PATCH v3] add xen-tpmfront.ko: Xen Virtual TPM
	frontend driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch ports the xen vtpm frontend driver for linux
from the linux-2.6.18-xen.hg tree to linux-stable. This
driver is designed be used with the mini-os tpmback driver
in Xen as part of the new mini-os virtual tpm subsystem.

Included in this commit message is the first draft of the
vtpm documentation.  See docs/misc/vtpm.txt for an updated
version. Contact the xen-devel@lists.xen.org mailing list
for details.

Copyright (c) 2010-2012 United States Government, as represented by
the Secretary of Defense.  All rights reserved.
November 12 2012
Authors: Matthew Fioravante (JHUAPL),

This document describes the virtual Trusted Platform Module (vTPM)
subsystem
for Xen. The reader is assumed to have familiarity with building and
installing
Xen, Linux, and a basic understanding of the TPM and vTPM concepts.

------------------------------
INTRODUCTION
------------------------------
The goal of this work is to provide a TPM functionality to a virtual
guest operating system (a DomU).  This allows programs to interact
with a TPM in a virtual system the same way they interact with a TPM
on the physical system.  Each guest gets its own unique, emulated,
software TPM.  However, each of the vTPM's secrets (Keys, NVRAM, etc)
are managed by a vTPM Manager domain, which seals the secrets to
the Physical TPM.  Thus, the vTPM subsystem extends the chain of
trust rooted in the hardware TPM to virtual machines in Xen.
Each major component of vTPM is implemented as a separate domain,
providing secure separation guaranteed by the hypervisor. The
vTPM domains are implemented in mini-os to reduce memory and
processor overhead.

This mini-os vTPM subsystem was built on top of the previous vTPM
work done by IBM and Intel corporation.

------------------------------
DESIGN OVERVIEW
------------------------------

The architecture of vTPM is described below:

+------------------+
|    Linux DomU    | ...
|       |  ^       |
|       v  |       |
|   xen-tpmfront   |
+------------------+
        |  ^
        v  |
+------------------+
| mini-os/tpmback  |
|       |  ^       |
|       v  |       |
|  vtpm-stubdom    | ...
|       |  ^       |
|       v  |       |
| mini-os/tpmfront |
+------------------+
        |  ^
        v  |
+------------------+
| mini-os/tpmback  |
|       |  ^       |
|       v  |       |
|   vtpmmgrdom     |
|       |  ^       |
|       v  |       |
| mini-os/tpm_tis  |
+------------------+
        |  ^
        v  |
+------------------+
|   Hardware TPM   |
+------------------+
 * Linux DomU: The Linux based guest that wants to use a vTPM. There
               may be more than one of these.

 * xen-tpmfront.ko: Linux kernel virtual TPM frontend driver. This
                    driver provides vTPM access to a para-virtualized
                    Linux based DomU.

 * mini-os/tpmback: Mini-os TPM backend driver. The Linux frontend
                    driver connects to this backend driver to facilitate
                    communications between the Linux DomU and its vTPM.
                    This driver is also used by vtpmmgrdom to communicate
                    with vtpm-stubdom.

 * vtpm-stubdom: A mini-os stub domain that implements a vTPM. There is
                 a one to one mapping between running vtpm-stubdom
                 instances and logical vtpms on the system. The vTPM
                 Platform Configuration Registers (PCRs) are all
		 initialized to zero.

 * mini-os/tpmfront: Mini-os TPM frontend driver. The vTPM mini-os
                     domain vtpm-stubdom uses this driver to
                     communicate with vtpmmgrdom. This driver could
                     also be used separately to implement a mini-os
                     domain that wishes to use a vTPM of
                     its own.

 * vtpmmgrdom: A mini-os domain that implements the vTPM manager.
               There is only one vTPM manager and it should be running
               during the entire lifetime of the machine.  This domain
               regulates access to the physical TPM on the system and
               secures the persistent state of each vTPM.

 * mini-os/tpm_tis: Mini-os TPM version 1.2 TPM Interface Specification
                    (TIS) driver. This driver used by vtpmmgrdom to talk
                    directly to the hardware TPM. Communication is
                    facilitated by mapping hardware memory pages into
                    vtpmmgrdom.

 * Hardware TPM: The physical TPM that is soldered onto the motherboard.

------------------------------
INSTALLATION
------------------------------

Prerequisites:
--------------
You must have an x86 machine with a TPM on the motherboard.
The only software requirement to compiling vTPM is cmake.
You must use libxl to manage domains with vTPMs. 'xm' is
deprecated and does not support vTPM.

Compiling the XEN tree:
-----------------------

Compile and install the XEN tree as usual. Be sure to build and install
the stubdom tree.

Compiling the LINUX dom0 kernel:
--------------------------------

The Linux dom0 kernel has no special prerequisites.

Compiling the LINUX domU kernel:
--------------------------------

The domU kernel used by domains with vtpms must
include the xen-tpmfront.ko driver. It can be built
directly into the kernel or as a module.

CONFIG_TCG_TPM=y
CONFIG_TCG_XEN=y

------------------------------
VTPM MANAGER SETUP
------------------------------

Manager disk image setup:
-------------------------

The vTPM Manager requires a disk image to store its
encrypted data. The image does not require a filesystem
and can live anywhere on the host disk. The image does not need
to be large. 8 to 16 Mb should be sufficient.

Manager config file:
--------------------

The vTPM Manager domain (vtpmmgrdom) must be started like
any other Xen virtual machine and requires a config file.
The manager requires a disk image for storage and permission
to access the hardware memory pages for the TPM. An
example configuration looks like the following.

kernel="/usr/lib/xen/boot/vtpmmgrdom.gz"
memory=16
disk=["file:/var/vtpmmgrdom.img,hda,w"]
name="vtpmmgrdom"
iomem=["fed40,5"]

The iomem line tells xl to allow access to the TPM
IO memory pages, which are 5 pages that start at
0xfed40000.

Starting and stopping the manager:
----------------------------------

The vTPM manager should be started at boot, you may wish to
create an init script to do this.

Once initialization is complete you should see the following:
INFO[VTPM]: Waiting for commands from vTPM's:

To shutdown the manager you must destroy it. To avoid data corruption,
only destroy the manager when you see the above "Waiting for commands"
message. This ensures the disk is in a consistent state.

------------------------------
VTPM AND LINUX PVM SETUP
------------------------------

In the following examples we will assume we have Linux
guest named "domu" with its associated configuration
located at /home/user/domu. It's vtpm will be named
domu-vtpm.

vTPM disk image setup:
----------------------

The vTPM requires a disk image to store its persistent
data. The image does not require a filesystem. The image
does not need to be large. 8 Mb should be sufficient.

vTPM config file:
-----------------

The vTPM domain requires a configuration file like
any other domain. The vTPM requires a disk image for
storage and a TPM frontend driver to communicate
with the manager. An example configuration is given:

kernel="/usr/lib/xen/boot/vtpm-stubdom.gz"
memory=8
disk=["file:/home/user/domu/vtpm.img,hda,w"]
name="domu-vtpm"
vtpm=["backend=vtpmmgrdom,uuid=ac0a5b9e-cbe2-4c07-b43b-1d69e46fb839"]

The vtpm= line sets up the tpm frontend driver. The backend must set
to vtpmmgrdom. You are required to generate a uuid for this vtpm.
You can use the uuidgen unix program or some other method to create a
uuid. The uuid uniquely identifies this vtpm to manager.

If you wish to clear the vTPM data you can either recreate the
disk image or change the uuid.

Linux Guest config file:
------------------------

The Linux guest config file needs to be modified to include
the Linux tpmfront driver. Add the following line:

vtpm=["backend=domu-vtpm"]

Currently only paravirtualized guests are supported.

Launching and shut down:
------------------------

To launch a Linux guest with a vTPM we first have to start the vTPM
domain.

After initialization is complete, you should see the following:
Info: Waiting for frontend domain to connect..

Next, launch the Linux guest

If xen-tpmfront was compiled as a module, be sure to load it
in the guest.

After the Linux domain boots and the xen-tpmfront driver is loaded,
you should see the following on the vtpm console:

Info: VTPM attached to Frontend X/Y

If you have trousers and tpm_tools installed on the guest, you can test
the vtpm.

On guest:

The version command should return the following:
  TPM 1.2 Version Info:
  Chip Version:        1.2.0.7
  Spec Level:          2
  Errata Revision:     1
  TPM Vendor ID:       ETHZ
  TPM Version:         01010000
  Manufacturer Info:   4554485a

You should also see the command being sent to the vtpm console as well
as the vtpm saving its state. You should see the vtpm key being
encrypted and stored on the vtpmmgrdom console.

To shutdown the guest and its vtpm, you just have to shutdown the guest
normally. As soon as the guest vm disconnects, the vtpm will shut itself
down automatically.

On guest:

You may wish to write a script to start your vtpm and guest together.

------------------------------
MORE INFORMATION
------------------------------

See stubdom/vtpmmgr/README for more details about how
the manager domain works, how to use it, and its command line
parameters.

See stubdom/vtpm/README for more specifics about how vtpm-stubdom
operates and the command line options it accepts.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 drivers/char/tpm/Kconfig             |   11 +
 drivers/char/tpm/Makefile            |    2 +
 drivers/char/tpm/tpm.h               |   10 +
 drivers/char/tpm/xen-tpmfront_if.c   |  688 ++++++++++++++++++++++++++++++++++
 drivers/char/tpm/xen-tpmfront_vtpm.c |  543 +++++++++++++++++++++++++++
 drivers/char/tpm/xen-tpmfront_vtpm.h |   55 +++
 include/xen/interface/io/tpmif.h     |   65 ++++
 7 files changed, 1374 insertions(+)
 create mode 100644 drivers/char/tpm/xen-tpmfront_if.c
 create mode 100644 drivers/char/tpm/xen-tpmfront_vtpm.c
 create mode 100644 drivers/char/tpm/xen-tpmfront_vtpm.h
 create mode 100644 include/xen/interface/io/tpmif.h

diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
index 915875e..23d272f 100644
--- a/drivers/char/tpm/Kconfig
+++ b/drivers/char/tpm/Kconfig
@@ -81,4 +81,15 @@ config TCG_IBMVTPM
 	  will be accessible from within Linux.  To compile this driver
 	  as a module, choose M here; the module will be called tpm_ibmvtpm.
 
+config TCG_XEN
+	tristate "XEN TPM Interface"
+	depends on TCG_TPM && XEN
+	---help---
+	  If you want to make TPM support available to a Xen user domain,
+	  say Yes and it will be accessible from within Linux. See
+	  the manpages for xl, xl.conf, and docs/misc/vtpm.txt in
+	  the Xen source repository for more details.
+	  To compile this driver as a module, choose M here; the module
+	  will be called xen-tpmfront.
+
 endif # TCG_TPM
diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
index 5b3fc8b..0161f05 100644
--- a/drivers/char/tpm/Makefile
+++ b/drivers/char/tpm/Makefile
@@ -17,3 +17,5 @@ obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
 obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
 obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
 obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
+obj-$(CONFIG_TCG_XEN) += xen-tpmfront.o
+xen-tpmfront-y = xen-tpmfront_if.o xen-tpmfront_vtpm.o
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 8ef7649..b575892 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -328,6 +328,16 @@ extern int tpm_pm_resume(struct device *);
 extern int wait_for_tpm_stat(struct tpm_chip *, u8, unsigned long,
 			     wait_queue_head_t *);
 
+static inline void *chip_get_private(const struct tpm_chip *chip)
+{
+	return chip->vendor.data;
+}
+
+static inline void chip_set_private(struct tpm_chip *chip, void *priv)
+{
+	chip->vendor.data = priv;
+}
+
 #ifdef CONFIG_ACPI
 extern int tpm_add_ppi(struct kobject *);
 extern void tpm_remove_ppi(struct kobject *);
diff --git a/drivers/char/tpm/xen-tpmfront_if.c b/drivers/char/tpm/xen-tpmfront_if.c
new file mode 100644
index 0000000..ba7fad8
--- /dev/null
+++ b/drivers/char/tpm/xen-tpmfront_if.c
@@ -0,0 +1,688 @@
+/*
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * Author: Stefan Berger, stefanb@us.ibm.com
+ * Grant table support: Mahadevan Gomathisankaran
+ *
+ * This code has been derived from drivers/xen/netfront/netfront.c
+ *
+ * Copyright (c) 2002-2004, K A Fraser
+ *
+ * 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.
+ */
+
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
+#include <linux/mutex.h>
+#include <linux/uaccess.h>
+#include <xen/events.h>
+#include <xen/interface/grant_table.h>
+#include <xen/interface/io/tpmif.h>
+#include <xen/grant_table.h>
+#include <xen/xenbus.h>
+#include <xen/page.h>
+#include "tpm.h"
+#include "xen-tpmfront_vtpm.h"
+
+#define GRANT_INVALID_REF 0
+
+/* local structures */
+struct tpm_private {
+	struct tpm_chip *chip;
+
+	struct tpmif_tx_interface *tx;
+	atomic_t refcnt;
+	unsigned int evtchn;
+	u8 is_connected;
+	u8 is_suspended;
+
+	spinlock_t tx_lock;
+
+	struct tx_buffer *tx_buffers[TPMIF_TX_RING_SIZE];
+
+	atomic_t tx_busy;
+	void *tx_remember;
+
+	domid_t backend_id;
+	wait_queue_head_t wait_q;
+
+	struct xenbus_device *dev;
+	int ring_ref;
+};
+
+struct tx_buffer {
+	unsigned int size;	/* available space in data */
+	unsigned int len;	/* used space in data */
+	unsigned char *data;	/* pointer to a page */
+};
+
+
+/* locally visible variables */
+static grant_ref_t gref_head;
+static struct tpm_private *my_priv;
+
+/* local function prototypes */
+static irqreturn_t tpmif_int(int irq,
+		void *tpm_priv);
+static void tpmif_rx_action(unsigned long unused);
+static int tpmif_connect(struct xenbus_device *dev,
+		struct tpm_private *tp,
+		domid_t domid);
+static DECLARE_TASKLET(tpmif_rx_tasklet, tpmif_rx_action, 0);
+static int tpmif_allocate_tx_buffers(struct tpm_private *tp);
+static void tpmif_free_tx_buffers(struct tpm_private *tp);
+static void tpmif_set_connected_state(struct tpm_private *tp,
+		u8 newstate);
+static int tpm_xmit(struct tpm_private *tp,
+		const u8 *buf, size_t count, int userbuffer,
+		void *remember);
+static void destroy_tpmring(struct tpm_private *tp);
+
+static inline int
+tx_buffer_copy(struct tx_buffer *txb, const u8 *src, int len,
+		int isuserbuffer)
+{
+	int copied = len;
+
+	if (len > txb->size)
+		copied = txb->size;
+	if (isuserbuffer) {
+		if (copy_from_user(txb->data, src, copied))
+			return -EFAULT;
+	} else {
+		memcpy(txb->data, src, copied);
+	}
+	txb->len = len;
+	return copied;
+}
+
+static inline struct tx_buffer *tx_buffer_alloc(void)
+{
+	struct tx_buffer *txb;
+
+	txb = kzalloc(sizeof(struct tx_buffer), GFP_KERNEL);
+	if (!txb)
+		return NULL;
+
+	txb->len = 0;
+	txb->size = PAGE_SIZE;
+	txb->data = (unsigned char *)__get_free_page(GFP_KERNEL);
+	if (txb->data == NULL) {
+		kfree(txb);
+		txb = NULL;
+	}
+
+	return txb;
+}
+
+
+static inline void tx_buffer_free(struct tx_buffer *txb)
+{
+	if (txb) {
+		free_page((long)txb->data);
+		kfree(txb);
+	}
+}
+
+/**************************************************************
+  Utility function for the tpm_private structure
+ **************************************************************/
+static void tpm_private_init(struct tpm_private *tp)
+{
+	spin_lock_init(&tp->tx_lock);
+	init_waitqueue_head(&tp->wait_q);
+	atomic_set(&tp->refcnt, 1);
+}
+
+static void tpm_private_put(void)
+{
+	if (!atomic_dec_and_test(&my_priv->refcnt))
+		return;
+
+	tpmif_free_tx_buffers(my_priv);
+	kfree(my_priv);
+	my_priv = NULL;
+}
+
+static struct tpm_private *tpm_private_get(void)
+{
+	int err;
+
+	if (my_priv) {
+		atomic_inc(&my_priv->refcnt);
+		return my_priv;
+	}
+
+	my_priv = kzalloc(sizeof(struct tpm_private), GFP_KERNEL);
+	if (!my_priv)
+		return NULL;
+
+	tpm_private_init(my_priv);
+	err = tpmif_allocate_tx_buffers(my_priv);
+	if (err < 0)
+		tpm_private_put();
+
+	return my_priv;
+}
+
+/**************************************************************
+
+  The interface to let the tpm plugin register its callback
+  function and send data to another partition using this module
+
+ **************************************************************/
+
+static DEFINE_MUTEX(suspend_lock);
+/*
+ * Send data via this module by calling this function
+ */
+int vtpm_vd_send(struct tpm_private *tp,
+		const u8 *buf, size_t count, void *ptr)
+{
+	int sent;
+
+	mutex_lock(&suspend_lock);
+	sent = tpm_xmit(tp, buf, count, 0, ptr);
+	mutex_unlock(&suspend_lock);
+
+	return sent;
+}
+
+/**************************************************************
+  XENBUS support code
+ **************************************************************/
+
+static int setup_tpmring(struct xenbus_device *dev,
+		struct tpm_private *tp)
+{
+	struct tpmif_tx_interface *sring;
+	int err;
+
+	tp->ring_ref = GRANT_INVALID_REF;
+
+	sring = (void *)__get_free_page(GFP_KERNEL);
+	if (!sring) {
+		xenbus_dev_fatal(dev, -ENOMEM, "allocating shared ring");
+		return -ENOMEM;
+	}
+	tp->tx = sring;
+
+	err = xenbus_grant_ring(dev, virt_to_mfn(tp->tx));
+	if (err < 0) {
+		free_page((unsigned long)sring);
+		tp->tx = NULL;
+		xenbus_dev_fatal(dev, err, "allocating grant reference");
+		goto fail;
+	}
+	tp->ring_ref = err;
+
+	err = tpmif_connect(dev, tp, dev->otherend_id);
+	if (err)
+		goto fail;
+
+	return 0;
+fail:
+	destroy_tpmring(tp);
+	return err;
+}
+
+
+static void destroy_tpmring(struct tpm_private *tp)
+{
+	tpmif_set_connected_state(tp, 0);
+
+	if (tp->ring_ref != GRANT_INVALID_REF) {
+		gnttab_end_foreign_access(tp->ring_ref,
+				0, (unsigned long)tp->tx);
+		tp->ring_ref = GRANT_INVALID_REF;
+		tp->tx = NULL;
+	}
+
+	if (tp->evtchn)
+		unbind_from_irqhandler(irq_from_evtchn(tp->evtchn), tp);
+
+	tp->evtchn = GRANT_INVALID_REF;
+}
+
+
+static int talk_to_backend(struct xenbus_device *dev,
+		struct tpm_private *tp)
+{
+	const char *message = NULL;
+	int err;
+	struct xenbus_transaction xbt;
+
+	err = setup_tpmring(dev, tp);
+	if (err) {
+		xenbus_dev_fatal(dev, err, "setting up ring");
+		goto out;
+	}
+
+again:
+	err = xenbus_transaction_start(&xbt);
+	if (err) {
+		xenbus_dev_fatal(dev, err, "starting transaction");
+		goto destroy_tpmring;
+	}
+
+	err = xenbus_printf(xbt, dev->nodename,
+			"ring-ref", "%u", tp->ring_ref);
+	if (err) {
+		message = "writing ring-ref";
+		goto abort_transaction;
+	}
+
+	err = xenbus_printf(xbt, dev->nodename, "event-channel", "%u",
+			tp->evtchn);
+	if (err) {
+		message = "writing event-channel";
+		goto abort_transaction;
+	}
+
+	err = xenbus_transaction_end(xbt, 0);
+	if (err == -EAGAIN)
+		goto again;
+	if (err) {
+		xenbus_dev_fatal(dev, err, "completing transaction");
+		goto destroy_tpmring;
+	}
+
+	xenbus_switch_state(dev, XenbusStateConnected);
+
+	return 0;
+
+abort_transaction:
+	xenbus_transaction_end(xbt, 1);
+	if (message)
+		xenbus_dev_error(dev, err, "%s", message);
+destroy_tpmring:
+	destroy_tpmring(tp);
+out:
+	return err;
+}
+
+/**
+ * Callback received when the backend's state changes.
+ */
+static void backend_changed(struct xenbus_device *dev,
+		enum xenbus_state backend_state)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+
+	switch (backend_state) {
+	case XenbusStateInitialising:
+	case XenbusStateInitWait:
+	case XenbusStateInitialised:
+	case XenbusStateReconfiguring:
+	case XenbusStateReconfigured:
+	case XenbusStateUnknown:
+		break;
+
+	case XenbusStateConnected:
+		tpmif_set_connected_state(tp, 1);
+		break;
+
+	case XenbusStateClosing:
+		tpmif_set_connected_state(tp, 0);
+		xenbus_frontend_closed(dev);
+		break;
+
+	case XenbusStateClosed:
+		tpmif_set_connected_state(tp, 0);
+		if (tp->is_suspended == 0)
+			device_unregister(&dev->dev);
+		xenbus_frontend_closed(dev);
+		break;
+	}
+}
+
+static int tpmfront_probe(struct xenbus_device *dev,
+		const struct xenbus_device_id *id)
+{
+	int err;
+	int handle;
+	struct tpm_private *tp = tpm_private_get();
+
+	if (!tp)
+		return -ENOMEM;
+
+	tp->chip = init_vtpm(&dev->dev, tp);
+	if (IS_ERR(tp->chip))
+		return PTR_ERR(tp->chip);
+
+	err = xenbus_scanf(XBT_NIL, dev->nodename,
+			"handle", "%i", &handle);
+	if (XENBUS_EXIST_ERR(err))
+		return err;
+
+	if (err < 0) {
+		xenbus_dev_fatal(dev, err, "reading virtual-device");
+		return err;
+	}
+
+	tp->dev = dev;
+
+	err = talk_to_backend(dev, tp);
+	if (err) {
+		tpm_private_put();
+		return err;
+	}
+
+	return 0;
+}
+
+
+static int __devexit tpmfront_remove(struct xenbus_device *dev)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+	destroy_tpmring(tp);
+	cleanup_vtpm(&dev->dev);
+	return 0;
+}
+
+static int tpmfront_suspend(struct xenbus_device *dev)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+	u32 ctr;
+
+	/* Take the lock, preventing any application from sending. */
+	mutex_lock(&suspend_lock);
+	tp->is_suspended = 1;
+
+	for (ctr = 0; atomic_read(&tp->tx_busy); ctr++) {
+		/* Wait for a request to be responded to. */
+		interruptible_sleep_on_timeout(&tp->wait_q, 100);
+	}
+
+	return 0;
+}
+
+static int tpmfront_suspend_finish(struct tpm_private *tp)
+{
+	tp->is_suspended = 0;
+	/* Allow applications to send again. */
+	mutex_unlock(&suspend_lock);
+	return 0;
+}
+
+static int tpmfront_resume(struct xenbus_device *dev)
+{
+	struct tpm_private *tp = tpm_private_from_dev(&dev->dev);
+	destroy_tpmring(tp);
+	return talk_to_backend(dev, tp);
+}
+
+static int tpmif_connect(struct xenbus_device *dev,
+		struct tpm_private *tp,
+		domid_t domid)
+{
+	int err;
+
+	tp->backend_id = domid;
+	tp->evtchn = GRANT_INVALID_REF;
+
+	err = xenbus_alloc_evtchn(dev, &tp->evtchn);
+	if (err)
+		return err;
+
+	err = bind_evtchn_to_irqhandler(tp->evtchn, tpmif_int,
+			0, "tpmif", tp);
+	if (err <= 0)
+		return err;
+
+	return 0;
+}
+
+static const struct xenbus_device_id tpmfront_ids[] = {
+	{ "vtpm" },
+	{ "" }
+};
+MODULE_ALIAS("xen:vtpm");
+
+static DEFINE_XENBUS_DRIVER(tpmfront, ,
+		.probe = tpmfront_probe,
+		.remove =  __devexit_p(tpmfront_remove),
+		.resume = tpmfront_resume,
+		.otherend_changed = backend_changed,
+		.suspend = tpmfront_suspend,
+		);
+
+static int tpmif_allocate_tx_buffers(struct tpm_private *tp)
+{
+	unsigned int i;
+
+	for (i = 0; i < TPMIF_TX_RING_SIZE; i++) {
+		tp->tx_buffers[i] = tx_buffer_alloc();
+		if (!tp->tx_buffers[i]) {
+			tpmif_free_tx_buffers(tp);
+			return -ENOMEM;
+		}
+	}
+	return 0;
+}
+
+static void tpmif_free_tx_buffers(struct tpm_private *tp)
+{
+	unsigned int i;
+
+	for (i = 0; i < TPMIF_TX_RING_SIZE; i++)
+		tx_buffer_free(tp->tx_buffers[i]);
+}
+
+static void tpmif_rx_action(unsigned long priv)
+{
+	struct tpm_private *tp = (struct tpm_private *)priv;
+	int i = 0;
+	unsigned int received;
+	unsigned int offset = 0;
+	u8 *buffer;
+	struct tpmif_tx_request *tx = &tp->tx->ring[i].req;
+
+	atomic_set(&tp->tx_busy, 0);
+	wake_up_interruptible(&tp->wait_q);
+
+	received = tx->size;
+
+	buffer = kmalloc(received, GFP_ATOMIC);
+	if (!buffer)
+		return;
+
+	for (i = 0; i < TPMIF_TX_RING_SIZE && offset < received; i++) {
+		struct tx_buffer *txb = tp->tx_buffers[i];
+		struct tpmif_tx_request *tx;
+		unsigned int tocopy;
+
+		tx = &tp->tx->ring[i].req;
+		tocopy = tx->size;
+		if (tocopy > PAGE_SIZE)
+			tocopy = PAGE_SIZE;
+
+		memcpy(&buffer[offset], txb->data, tocopy);
+
+		gnttab_release_grant_reference(&gref_head, tx->ref);
+
+		offset += tocopy;
+	}
+
+	vtpm_vd_recv(tp->chip, buffer, received, tp->tx_remember);
+	kfree(buffer);
+}
+
+
+static irqreturn_t tpmif_int(int irq, void *tpm_priv)
+{
+	struct tpm_private *tp = tpm_priv;
+	unsigned long flags;
+
+	spin_lock_irqsave(&tp->tx_lock, flags);
+	tpmif_rx_tasklet.data = (unsigned long)tp;
+	tasklet_schedule(&tpmif_rx_tasklet);
+	spin_unlock_irqrestore(&tp->tx_lock, flags);
+
+	return IRQ_HANDLED;
+}
+
+
+static int tpm_xmit(struct tpm_private *tp,
+		const u8 *buf, size_t count, int isuserbuffer,
+		void *remember)
+{
+	struct tpmif_tx_request *tx;
+	int i;
+	unsigned int offset = 0;
+
+	spin_lock_irq(&tp->tx_lock);
+
+	if (unlikely(atomic_read(&tp->tx_busy))) {
+		spin_unlock_irq(&tp->tx_lock);
+		return -EBUSY;
+	}
+
+	if (tp->is_connected != 1) {
+		spin_unlock_irq(&tp->tx_lock);
+		return -EIO;
+	}
+
+	for (i = 0; count > 0 && i < TPMIF_TX_RING_SIZE; i++) {
+		struct tx_buffer *txb = tp->tx_buffers[i];
+		int copied;
+
+		if (!txb) {
+			spin_unlock_irq(&tp->tx_lock);
+			return -EFAULT;
+		}
+
+		copied = tx_buffer_copy(txb, &buf[offset], count,
+				isuserbuffer);
+		if (copied < 0) {
+			/* An error occurred */
+			spin_unlock_irq(&tp->tx_lock);
+			return copied;
+		}
+		count -= copied;
+		offset += copied;
+
+		tx = &tp->tx->ring[i].req;
+		tx->addr = virt_to_machine(txb->data).maddr;
+		tx->size = txb->len;
+		tx->unused = 0;
+
+		/* Get the granttable reference for this page. */
+		tx->ref = gnttab_claim_grant_reference(&gref_head);
+		if (tx->ref == -ENOSPC) {
+			spin_unlock_irq(&tp->tx_lock);
+			return -ENOSPC;
+		}
+		gnttab_grant_foreign_access_ref(tx->ref,
+				tp->backend_id,
+				virt_to_mfn(txb->data),
+				0 /*RW*/);
+		wmb();
+	}
+
+	atomic_set(&tp->tx_busy, 1);
+	tp->tx_remember = remember;
+
+	mb();
+
+	notify_remote_via_evtchn(tp->evtchn);
+
+	spin_unlock_irq(&tp->tx_lock);
+	return offset;
+}
+
+
+static void tpmif_notify_upperlayer(struct tpm_private *tp)
+{
+	/* Notify upper layer about the state of the connection to the BE. */
+	vtpm_vd_status(tp->chip, (tp->is_connected
+				? TPM_VD_STATUS_CONNECTED
+				: TPM_VD_STATUS_DISCONNECTED));
+}
+
+
+static void tpmif_set_connected_state(struct tpm_private *tp, u8 is_connected)
+{
+	/*
+	 * Don't notify upper layer if we are in suspend mode and
+	 * should disconnect - assumption is that we will resume
+	 * The mutex keeps apps from sending.
+	 */
+	if (is_connected == 0 && tp->is_suspended == 1)
+		return;
+
+	/*
+	 * Unlock the mutex if we are connected again
+	 * after being suspended - now resuming.
+	 * This also removes the suspend state.
+	 */
+	if (is_connected == 1 && tp->is_suspended == 1)
+		tpmfront_suspend_finish(tp);
+
+	if (is_connected != tp->is_connected) {
+		tp->is_connected = is_connected;
+		tpmif_notify_upperlayer(tp);
+	}
+}
+
+
+
+/* =================================================================
+ * Initialization function.
+ * =================================================================
+ */
+
+
+static int __init tpmif_init(void)
+{
+	struct tpm_private *tp;
+
+	if (!xen_domain())
+		return -ENODEV;
+
+	tp = tpm_private_get();
+	if (!tp)
+		return -ENOMEM;
+
+	if (gnttab_alloc_grant_references(TPMIF_TX_RING_SIZE,
+				&gref_head) < 0) {
+		tpm_private_put();
+		return -EFAULT;
+	}
+
+	return xenbus_register_frontend(&tpmfront_driver);
+}
+module_init(tpmif_init);
+
+static void __exit tpmif_exit(void)
+{
+	xenbus_unregister_driver(&tpmfront_driver);
+	gnttab_free_grant_references(gref_head);
+	tpm_private_put();
+}
+module_exit(tpmif_exit);
+
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/drivers/char/tpm/xen-tpmfront_vtpm.c b/drivers/char/tpm/xen-tpmfront_vtpm.c
new file mode 100644
index 0000000..d70f1df
--- /dev/null
+++ b/drivers/char/tpm/xen-tpmfront_vtpm.c
@@ -0,0 +1,543 @@
+/*
+ * Copyright (C) 2006 IBM Corporation
+ *
+ * Authors:
+ * Stefan Berger <stefanb@us.ibm.com>
+ *
+ * Generic device driver part for device drivers in a virtualized
+ * environment.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, version 2 of the
+ * License.
+ *
+ */
+
+#include <linux/uaccess.h>
+#include <linux/list.h>
+#include <linux/device.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include "tpm.h"
+#include "xen-tpmfront_vtpm.h"
+
+/* read status bits */
+enum {
+	STATUS_BUSY = 0x01,
+	STATUS_DATA_AVAIL = 0x02,
+	STATUS_READY = 0x04
+};
+
+struct transmission {
+	struct list_head next;
+
+	unsigned char *request;
+	size_t  request_len;
+	size_t  request_buflen;
+
+	unsigned char *response;
+	size_t  response_len;
+	size_t  response_buflen;
+
+	unsigned int flags;
+};
+
+enum {
+	TRANSMISSION_FLAG_WAS_QUEUED = 0x1
+};
+
+
+enum {
+	DATAEX_FLAG_QUEUED_ONLY = 0x1
+};
+
+
+/* local variables */
+
+/* local function prototypes */
+static int _vtpm_send_queued(struct tpm_chip *chip);
+
+
+/* =============================================================
+ * Some utility functions
+ * =============================================================
+ */
+static void vtpm_state_init(struct vtpm_state *vtpms)
+{
+	vtpms->current_request = NULL;
+	spin_lock_init(&vtpms->req_list_lock);
+	init_waitqueue_head(&vtpms->req_wait_queue);
+	INIT_LIST_HEAD(&vtpms->queued_requests);
+
+	vtpms->current_response = NULL;
+	spin_lock_init(&vtpms->resp_list_lock);
+	init_waitqueue_head(&vtpms->resp_wait_queue);
+
+	vtpms->disconnect_time = jiffies;
+}
+
+
+static inline struct transmission *transmission_alloc(void)
+{
+	return kzalloc(sizeof(struct transmission), GFP_ATOMIC);
+}
+
+static unsigned char *
+transmission_set_req_buffer(struct transmission *t,
+		unsigned char *buffer, size_t len)
+{
+	if (t->request_buflen < len) {
+		kfree(t->request);
+		t->request = kmalloc(len, GFP_KERNEL);
+		if (!t->request) {
+			t->request_buflen = 0;
+			return NULL;
+		}
+		t->request_buflen = len;
+	}
+
+	memcpy(t->request, buffer, len);
+	t->request_len = len;
+
+	return t->request;
+}
+
+static unsigned char *
+transmission_set_res_buffer(struct transmission *t,
+		const unsigned char *buffer, size_t len)
+{
+	if (t->response_buflen < len) {
+		kfree(t->response);
+		t->response = kmalloc(len, GFP_ATOMIC);
+		if (!t->response) {
+			t->response_buflen = 0;
+			return NULL;
+		}
+		t->response_buflen = len;
+	}
+
+	memcpy(t->response, buffer, len);
+	t->response_len = len;
+
+	return t->response;
+}
+
+static inline void transmission_free(struct transmission *t)
+{
+	kfree(t->request);
+	kfree(t->response);
+	kfree(t);
+}
+
+/* =============================================================
+ * Interface with the lower layer driver
+ * =============================================================
+ */
+/*
+ * Lower layer uses this function to make a response available.
+ */
+int vtpm_vd_recv(const struct tpm_chip *chip,
+		const unsigned char *buffer, size_t count,
+		void *ptr)
+{
+	unsigned long flags;
+	int ret_size = 0;
+	struct transmission *t;
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	/*
+	 * The list with requests must contain one request
+	 * only and the element there must be the one that
+	 * was passed to me from the front-end.
+	 */
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	if (vtpms->current_request != ptr) {
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		return 0;
+	}
+	t = vtpms->current_request;
+	if (t) {
+		transmission_free(t);
+		vtpms->current_request = NULL;
+	}
+
+	t = transmission_alloc();
+	if (t) {
+		if (!transmission_set_res_buffer(t, buffer, count)) {
+			transmission_free(t);
+			spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+			return -ENOMEM;
+		}
+		ret_size = count;
+		vtpms->current_response = t;
+		wake_up_interruptible(&vtpms->resp_wait_queue);
+	}
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+
+	return ret_size;
+}
+
+
+/*
+ * Lower layer indicates its status (connected/disconnected)
+ */
+void vtpm_vd_status(const struct tpm_chip *chip, u8 vd_status)
+{
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	vtpms->vd_status = vd_status;
+	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0)
+		vtpms->disconnect_time = jiffies;
+}
+
+/* =============================================================
+ * Interface with the generic TPM driver
+ * =============================================================
+ */
+static int vtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count)
+{
+	int rc = 0;
+	unsigned long flags;
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	/*
+	 * Check if the previous operation only queued the command
+	 * In this case there won't be a response, so I just
+	 * return from here and reset that flag. In any other
+	 * case I should receive a response from the back-end.
+	 */
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	if ((vtpms->flags & DATAEX_FLAG_QUEUED_ONLY) != 0) {
+		vtpms->flags &= ~DATAEX_FLAG_QUEUED_ONLY;
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		/*
+		 * The first few commands (measurements) must be
+		 * queued since it might not be possible to talk to the
+		 * TPM, yet.
+		 * Return a response of up to 30 '0's.
+		 */
+
+		count = min_t(size_t, count, 30);
+		memset(buf, 0x0, count);
+		return count;
+	}
+	/*
+	 * Check whether something is in the responselist and if
+	 * there's nothing in the list wait for something to appear.
+	 */
+
+	if (!vtpms->current_response) {
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		interruptible_sleep_on_timeout(&vtpms->resp_wait_queue,
+				1000);
+		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	}
+
+	if (vtpms->current_response) {
+		struct transmission *t = vtpms->current_response;
+		vtpms->current_response = NULL;
+		rc = min(count, t->response_len);
+		memcpy(buf, t->response, rc);
+		transmission_free(t);
+	}
+
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+	return rc;
+}
+
+static int vtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)
+{
+	int rc = 0;
+	unsigned long flags;
+	struct transmission *t = transmission_alloc();
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	if (!t)
+		return -ENOMEM;
+	/*
+	 * If there's a current request, it must be the
+	 * previous request that has timed out.
+	 */
+	spin_lock_irqsave(&vtpms->req_list_lock, flags);
+	if (vtpms->current_request != NULL) {
+		dev_warn(chip->dev, "Sending although there is a request outstanding.\n"
+				"         Previous request must have timed out.\n");
+		transmission_free(vtpms->current_request);
+		vtpms->current_request = NULL;
+	}
+	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+
+	/*
+	 * Queue the packet if the driver below is not
+	 * ready, yet, or there is any packet already
+	 * in the queue.
+	 * If the driver below is ready, unqueue all
+	 * packets first before sending our current
+	 * packet.
+	 * For each unqueued packet, except for the
+	 * last (=current) packet, call the function
+	 * tpm_xen_recv to wait for the response to come
+	 * back.
+	 */
+	if ((vtpms->vd_status & TPM_VD_STATUS_CONNECTED) == 0) {
+		if (time_after(jiffies,
+					vtpms->disconnect_time + HZ * 10)) {
+			rc = -ENOENT;
+		} else {
+			goto queue_it;
+		}
+	} else {
+		/*
+		 * Send all queued packets.
+		 */
+		if (_vtpm_send_queued(chip) == 0) {
+
+			vtpms->current_request = t;
+
+			rc = vtpm_vd_send(vtpms->tpm_private,
+					buf,
+					count,
+					t);
+			/*
+			 * The generic TPM driver will call
+			 * the function to receive the response.
+			 */
+			if (rc < 0) {
+				vtpms->current_request = NULL;
+				goto queue_it;
+			}
+		} else {
+queue_it:
+			if (!transmission_set_req_buffer(t, buf, count)) {
+				transmission_free(t);
+				rc = -ENOMEM;
+				goto exit;
+			}
+			/*
+			 * An error occurred. Don't event try
+			 * to send the current request. Just
+			 * queue it.
+			 */
+			spin_lock_irqsave(&vtpms->req_list_lock, flags);
+			vtpms->flags |= DATAEX_FLAG_QUEUED_ONLY;
+			list_add_tail(&t->next, &vtpms->queued_requests);
+			spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+		}
+	}
+
+exit:
+	return rc;
+}
+
+
+/*
+ * Send all queued requests.
+ */
+static int _vtpm_send_queued(struct tpm_chip *chip)
+{
+	int rc;
+	int error = 0;
+	unsigned long flags;
+	unsigned char buffer[1];
+	struct vtpm_state *vtpms;
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	spin_lock_irqsave(&vtpms->req_list_lock, flags);
+
+	while (!list_empty(&vtpms->queued_requests)) {
+		/*
+		 * Need to dequeue them.
+		 * Read the result into a dummy buffer.
+		 */
+		struct transmission *qt = (struct transmission *)
+			vtpms->queued_requests.next;
+		list_del(&qt->next);
+		vtpms->current_request = qt;
+		spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+
+		rc = vtpm_vd_send(vtpms->tpm_private,
+				qt->request,
+				qt->request_len,
+				qt);
+
+		if (rc < 0) {
+			spin_lock_irqsave(&vtpms->req_list_lock, flags);
+			qt = vtpms->current_request;
+			if (qt != NULL) {
+				/*
+				 * requeue it at the beginning
+				 * of the list
+				 */
+				list_add(&qt->next,
+						&vtpms->queued_requests);
+			}
+			vtpms->current_request = NULL;
+			error = 1;
+			break;
+		}
+		/*
+		 * After this point qt is not valid anymore!
+		 * It is freed when the front-end is delivering
+		 * the data by calling tpm_recv
+		 */
+		/*
+		 * Receive response into provided dummy buffer
+		 */
+		rc = vtpm_recv(chip, buffer, sizeof(buffer));
+		spin_lock_irqsave(&vtpms->req_list_lock, flags);
+	}
+
+	spin_unlock_irqrestore(&vtpms->req_list_lock, flags);
+
+	return error;
+}
+
+static void vtpm_cancel(struct tpm_chip *chip)
+{
+	unsigned long flags;
+	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+
+	if (!vtpms->current_response && vtpms->current_request) {
+		spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+		interruptible_sleep_on(&vtpms->resp_wait_queue);
+		spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	}
+
+	if (vtpms->current_response) {
+		struct transmission *t = vtpms->current_response;
+		vtpms->current_response = NULL;
+		transmission_free(t);
+	}
+
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+}
+
+static u8 vtpm_status(struct tpm_chip *chip)
+{
+	u8 rc = 0;
+	unsigned long flags;
+	struct vtpm_state *vtpms;
+
+	vtpms = (struct vtpm_state *)chip_get_private(chip);
+
+	spin_lock_irqsave(&vtpms->resp_list_lock, flags);
+	/*
+	 * Data are available if:
+	 *  - there's a current response
+	 *  - the last packet was queued only (this is fake, but necessary to
+	 *      get the generic TPM layer to call the receive function.)
+	 */
+	if (vtpms->current_response ||
+			0 != (vtpms->flags & DATAEX_FLAG_QUEUED_ONLY)) {
+		rc = STATUS_DATA_AVAIL;
+	} else if (!vtpms->current_response && !vtpms->current_request) {
+		rc = STATUS_READY;
+	}
+
+	spin_unlock_irqrestore(&vtpms->resp_list_lock, flags);
+	return rc;
+}
+
+static const struct file_operations vtpm_ops = {
+	.owner = THIS_MODULE,
+	.llseek = no_llseek,
+	.open = tpm_open,
+	.read = tpm_read,
+	.write = tpm_write,
+	.release = tpm_release,
+};
+
+static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
+static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
+static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);
+static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL);
+static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL);
+static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,
+		NULL);
+static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL);
+static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
+
+static struct attribute *vtpm_attrs[] = {
+	&dev_attr_pubek.attr,
+	&dev_attr_pcrs.attr,
+	&dev_attr_enabled.attr,
+	&dev_attr_active.attr,
+	&dev_attr_owned.attr,
+	&dev_attr_temp_deactivated.attr,
+	&dev_attr_caps.attr,
+	&dev_attr_cancel.attr,
+	NULL,
+};
+
+static struct attribute_group vtpm_attr_grp = { .attrs = vtpm_attrs };
+
+#define TPM_LONG_TIMEOUT   (10 * 60 * HZ)
+
+static struct tpm_vendor_specific tpm_vtpm = {
+	.recv = vtpm_recv,
+	.send = vtpm_send,
+	.cancel = vtpm_cancel,
+	.status = vtpm_status,
+	.req_complete_mask = STATUS_BUSY | STATUS_DATA_AVAIL,
+	.req_complete_val  = STATUS_DATA_AVAIL,
+	.req_canceled = STATUS_READY,
+	.attr_group = &vtpm_attr_grp,
+	.miscdev = {
+		.fops = &vtpm_ops,
+	},
+	.duration = {
+		TPM_LONG_TIMEOUT,
+		TPM_LONG_TIMEOUT,
+		TPM_LONG_TIMEOUT,
+	},
+};
+
+struct tpm_chip *init_vtpm(struct device *dev,
+		struct tpm_private *tp)
+{
+	long rc;
+	struct tpm_chip *chip;
+	struct vtpm_state *vtpms;
+
+	vtpms = kzalloc(sizeof(struct vtpm_state), GFP_KERNEL);
+	if (!vtpms)
+		return ERR_PTR(-ENOMEM);
+
+	vtpm_state_init(vtpms);
+	vtpms->tpm_private = tp;
+
+	chip = tpm_register_hardware(dev, &tpm_vtpm);
+	if (!chip) {
+		rc = -ENODEV;
+		goto err_free_mem;
+	}
+
+	chip_set_private(chip, vtpms);
+
+	return chip;
+
+err_free_mem:
+	kfree(vtpms);
+
+	return ERR_PTR(rc);
+}
+
+void cleanup_vtpm(struct device *dev)
+{
+	struct tpm_chip *chip = dev_get_drvdata(dev);
+	struct vtpm_state *vtpms = (struct vtpm_state *)chip_get_private(chip);
+	tpm_remove_hardware(dev);
+	kfree(vtpms);
+}
diff --git a/drivers/char/tpm/xen-tpmfront_vtpm.h b/drivers/char/tpm/xen-tpmfront_vtpm.h
new file mode 100644
index 0000000..16cf323
--- /dev/null
+++ b/drivers/char/tpm/xen-tpmfront_vtpm.h
@@ -0,0 +1,55 @@
+#ifndef XEN_TPMFRONT_VTPM_H
+#define XEN_TPMFRONT_VTPM_H
+
+struct tpm_chip;
+struct tpm_private;
+
+struct vtpm_state {
+	struct transmission *current_request;
+	spinlock_t           req_list_lock;
+	wait_queue_head_t    req_wait_queue;
+
+	struct list_head     queued_requests;
+
+	struct transmission *current_response;
+	spinlock_t           resp_list_lock;
+	wait_queue_head_t    resp_wait_queue;
+
+	u8                   vd_status;
+	u8                   flags;
+
+	unsigned long        disconnect_time;
+
+	/*
+	 * The following is a private structure of the underlying
+	 * driver. It is passed as parameter in the send function.
+	 */
+	struct tpm_private *tpm_private;
+};
+
+
+enum vdev_status {
+	TPM_VD_STATUS_DISCONNECTED = 0x0,
+	TPM_VD_STATUS_CONNECTED = 0x1
+};
+
+/* this function is called from tpm_vtpm.c */
+int vtpm_vd_send(struct tpm_private *tp,
+		const u8 *buf, size_t count, void *ptr);
+
+/* these functions are offered by tpm_vtpm.c */
+struct tpm_chip *init_vtpm(struct device *,
+		struct tpm_private *);
+void cleanup_vtpm(struct device *);
+int vtpm_vd_recv(const struct tpm_chip *chip,
+		const unsigned char *buffer, size_t count, void *ptr);
+void vtpm_vd_status(const struct tpm_chip *, u8 status);
+
+static inline struct tpm_private *tpm_private_from_dev(struct device *dev)
+{
+	struct tpm_chip *chip = dev_get_drvdata(dev);
+	struct vtpm_state *vtpms = (struct vtpm_state *)chip->vendor.data;
+	return vtpms->tpm_private;
+}
+
+#endif
diff --git a/include/xen/interface/io/tpmif.h b/include/xen/interface/io/tpmif.h
new file mode 100644
index 0000000..c9e7294
--- /dev/null
+++ b/include/xen/interface/io/tpmif.h
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * tpmif.h
+ *
+ * TPM I/O interface for Xen guest OSes.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (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.
+ *
+ * Copyright (c) 2005, IBM Corporation
+ *
+ * Author: Stefan Berger, stefanb@us.ibm.com
+ * Grant table support: Mahadevan Gomathisankaran
+ *
+ * This code has been derived from tools/libxc/xen/io/netif.h
+ *
+ * Copyright (c) 2003-2004, Keir Fraser
+ */
+
+#ifndef __XEN_PUBLIC_IO_TPMIF_H__
+#define __XEN_PUBLIC_IO_TPMIF_H__
+
+#include "../grant_table.h"
+
+struct tpmif_tx_request {
+	unsigned long addr;   /* Machine address of packet.   */
+	grant_ref_t ref;      /* grant table access reference */
+	uint16_t unused;
+	uint16_t size;        /* Packet size in bytes.        */
+};
+struct tpmif_tx_request;
+
+/*
+ * The TPMIF_TX_RING_SIZE defines the number of pages the
+ * front-end and backend can exchange (= size of array).
+ */
+#define TPMIF_TX_RING_SIZE 1
+
+/* This structure must fit in a memory page. */
+
+struct tpmif_ring {
+	struct tpmif_tx_request req;
+};
+struct tpmif_ring;
+
+struct tpmif_tx_interface {
+	struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
+};
+struct tpmif_tx_interface;
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:46:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:46:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tap59-0007Mx-SH; Tue, 20 Nov 2012 14:45:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <eric.dumazet@gmail.com>) id 1Tap58-0007Mp-QA
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:45:47 +0000
Received: from [85.158.138.51:10378] by server-13.bemta-3.messagelabs.com id
	75/C0-24887-5979BA05; Tue, 20 Nov 2012 14:45:41 +0000
X-Env-Sender: eric.dumazet@gmail.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1353422739!30772534!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26159 invoked from network); 20 Nov 2012 14:45:40 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-11.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 14:45:40 -0000
Received: by mail-ie0-f173.google.com with SMTP id k14so5430093iea.32
	for <xen-devel@lists.xen.org>; Tue, 20 Nov 2012 06:45:38 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=subject:from:to:cc:in-reply-to:references:content-type:date
	:message-id:mime-version:x-mailer:content-transfer-encoding;
	bh=7JfJ0mu2Z3JwlKsYu9LGhz/ds/h9SiXxdwuj19Zn7OA=;
	b=krWeBkyU87N76yhwJKsHNcKXSc0oLIPT1+fH0YP8+GzAax09eBjCc8ib02l+s7rMJj
	UJtKBIGpCkS6XQxJwoK1uwzNG8GJ/81yubetwfL7jZ74Em3YMGW6sw4pq3kUeWeov+Vt
	dh2Qvj7XBbzV/yR0aIa1/ZZLBlkOHNCQfb9Ev6qX9S472GSUKqBGeu8RfL65RDkntkdi
	sEZvAZoXsY5Scm71dpcCpqrbq/tCJJzFg9X6fAaMoUUMVXk19tOku2e390UibVilJKNs
	ujDHgIFqUjPgyDrX8bhlEnxsKOK6NvlbjSodzwDj/Vu8kXZlollScGGn+YbHQREUVTl+
	qxZA==
Received: by 10.50.42.168 with SMTP id p8mr10160998igl.57.1353422738686;
	Tue, 20 Nov 2012 06:45:38 -0800 (PST)
Received: from [172.16.51.125] ([172.16.51.125])
	by mx.google.com with ESMTPS id x5sm9564361igc.14.2012.11.20.06.45.36
	(version=SSLv3 cipher=OTHER); Tue, 20 Nov 2012 06:45:37 -0800 (PST)
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ian Campbell <ian.campbell@citrix.com>
In-Reply-To: <1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
Date: Tue, 20 Nov 2012 06:45:35 -0800
Message-ID: <1353422735.2590.6.camel@edumazet-glaptop>
Mime-Version: 1.0
X-Mailer: Evolution 2.28.3 
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>, netdev@vger.kernel.org,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	xen-devel@lists.xen.org, Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 11:40 +0000, Ian Campbell wrote:
> An SKB paged fragment can consist of a compound page with order > 0.
> However the netchannel protocol deals only in PAGE_SIZE frames.
> 
> Handle this in xennet_make_frags by iterating over the frames which
> make up the page.
> 
> This is the netfront equivalent to 6a8ed462f16b for netback.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: netdev@vger.kernel.org
> Cc: xen-devel@lists.xen.org
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
> Cc: ANNIE LI <annie.li@oracle.com>
> Cc: Sander Eikelenboom <linux@eikelenboom.it>
> Cc: Stefan Bader <stefan.bader@canonical.com>
> ---
>  drivers/net/xen-netfront.c |   58 +++++++++++++++++++++++++++++++++----------
>  1 files changed, 44 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index caa0110..a12b99a 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -452,24 +452,54 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
>  	/* Grant backend access to each skb fragment page. */
>  	for (i = 0; i < frags; i++) {
>  		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
> +		struct page *page = skb_frag_page(frag);
> +		unsigned long size = skb_frag_size(frag);
> +		unsigned long offset = frag->page_offset;
>  
> -		tx->flags |= XEN_NETTXF_more_data;
> +		/* Data must not cross a page boundary. */
> +		BUG_ON(size + offset > PAGE_SIZE<<compound_order(page));
>  
> -		id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> -		np->tx_skbs[id].skb = skb_get(skb);
> -		tx = RING_GET_REQUEST(&np->tx, prod++);
> -		tx->id = id;
> -		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
> -		BUG_ON((signed short)ref < 0);
> +		/* Skip unused frames from start of page */

'frame' in the comment means an order-0 page ?

> +		page += offset >> PAGE_SHIFT;
> +		offset &= ~PAGE_MASK;
>  
> -		mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
> -		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> -						mfn, GNTMAP_readonly);
> +		while (size > 0) {
> +			unsigned long bytes;
>  
> -		tx->gref = np->grant_tx_ref[id] = ref;
> -		tx->offset = frag->page_offset;
> -		tx->size = skb_frag_size(frag);
> -		tx->flags = 0;
> +			BUG_ON(offset >= PAGE_SIZE);
> +
> +			bytes = PAGE_SIZE - offset;
> +			if (bytes > size)
> +				bytes = size;
> +
> +			tx->flags |= XEN_NETTXF_more_data;
> +
> +			id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> +			np->tx_skbs[id].skb = skb_get(skb);

BTW this skb_get() means extra atomic operations for every 4096 bytes
unit, and an extra atomic op (and test for final 0) at TX completion.
This could be avoided, by setting np->tx_skbs[id].skb = skb only for the
very last unit.

> +			tx = RING_GET_REQUEST(&np->tx, prod++);
> +			tx->id = id;
> +			ref = gnttab_claim_grant_reference(&np->gref_tx_head);
> +			BUG_ON((signed short)ref < 0);
> +
> +			mfn = pfn_to_mfn(page_to_pfn(page));
> +			gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> +							mfn, GNTMAP_readonly);
> +
> +			tx->gref = np->grant_tx_ref[id] = ref;
> +			tx->offset = offset;
> +			tx->size = bytes;
> +			tx->flags = 0;
> +
> +			offset += bytes;
> +			size -= bytes;
> +
> +			/* Next frame */
> +			if (offset == PAGE_SIZE && size) {
> +				BUG_ON(!PageCompound(page));
> +				page++;
> +				offset = 0;
> +			}
> +		}
>  	}
>  
>  	np->tx.req_prod_pvt = prod;

Acked-by: Eric Dumazet <edumazet@google.com>

Thanks !



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:46:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:46:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tap59-0007Mx-SH; Tue, 20 Nov 2012 14:45:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <eric.dumazet@gmail.com>) id 1Tap58-0007Mp-QA
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:45:47 +0000
Received: from [85.158.138.51:10378] by server-13.bemta-3.messagelabs.com id
	75/C0-24887-5979BA05; Tue, 20 Nov 2012 14:45:41 +0000
X-Env-Sender: eric.dumazet@gmail.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1353422739!30772534!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26159 invoked from network); 20 Nov 2012 14:45:40 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-11.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 14:45:40 -0000
Received: by mail-ie0-f173.google.com with SMTP id k14so5430093iea.32
	for <xen-devel@lists.xen.org>; Tue, 20 Nov 2012 06:45:38 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=subject:from:to:cc:in-reply-to:references:content-type:date
	:message-id:mime-version:x-mailer:content-transfer-encoding;
	bh=7JfJ0mu2Z3JwlKsYu9LGhz/ds/h9SiXxdwuj19Zn7OA=;
	b=krWeBkyU87N76yhwJKsHNcKXSc0oLIPT1+fH0YP8+GzAax09eBjCc8ib02l+s7rMJj
	UJtKBIGpCkS6XQxJwoK1uwzNG8GJ/81yubetwfL7jZ74Em3YMGW6sw4pq3kUeWeov+Vt
	dh2Qvj7XBbzV/yR0aIa1/ZZLBlkOHNCQfb9Ev6qX9S472GSUKqBGeu8RfL65RDkntkdi
	sEZvAZoXsY5Scm71dpcCpqrbq/tCJJzFg9X6fAaMoUUMVXk19tOku2e390UibVilJKNs
	ujDHgIFqUjPgyDrX8bhlEnxsKOK6NvlbjSodzwDj/Vu8kXZlollScGGn+YbHQREUVTl+
	qxZA==
Received: by 10.50.42.168 with SMTP id p8mr10160998igl.57.1353422738686;
	Tue, 20 Nov 2012 06:45:38 -0800 (PST)
Received: from [172.16.51.125] ([172.16.51.125])
	by mx.google.com with ESMTPS id x5sm9564361igc.14.2012.11.20.06.45.36
	(version=SSLv3 cipher=OTHER); Tue, 20 Nov 2012 06:45:37 -0800 (PST)
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ian Campbell <ian.campbell@citrix.com>
In-Reply-To: <1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
Date: Tue, 20 Nov 2012 06:45:35 -0800
Message-ID: <1353422735.2590.6.camel@edumazet-glaptop>
Mime-Version: 1.0
X-Mailer: Evolution 2.28.3 
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>, netdev@vger.kernel.org,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	xen-devel@lists.xen.org, Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 11:40 +0000, Ian Campbell wrote:
> An SKB paged fragment can consist of a compound page with order > 0.
> However the netchannel protocol deals only in PAGE_SIZE frames.
> 
> Handle this in xennet_make_frags by iterating over the frames which
> make up the page.
> 
> This is the netfront equivalent to 6a8ed462f16b for netback.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: netdev@vger.kernel.org
> Cc: xen-devel@lists.xen.org
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
> Cc: ANNIE LI <annie.li@oracle.com>
> Cc: Sander Eikelenboom <linux@eikelenboom.it>
> Cc: Stefan Bader <stefan.bader@canonical.com>
> ---
>  drivers/net/xen-netfront.c |   58 +++++++++++++++++++++++++++++++++----------
>  1 files changed, 44 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index caa0110..a12b99a 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -452,24 +452,54 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
>  	/* Grant backend access to each skb fragment page. */
>  	for (i = 0; i < frags; i++) {
>  		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
> +		struct page *page = skb_frag_page(frag);
> +		unsigned long size = skb_frag_size(frag);
> +		unsigned long offset = frag->page_offset;
>  
> -		tx->flags |= XEN_NETTXF_more_data;
> +		/* Data must not cross a page boundary. */
> +		BUG_ON(size + offset > PAGE_SIZE<<compound_order(page));
>  
> -		id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> -		np->tx_skbs[id].skb = skb_get(skb);
> -		tx = RING_GET_REQUEST(&np->tx, prod++);
> -		tx->id = id;
> -		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
> -		BUG_ON((signed short)ref < 0);
> +		/* Skip unused frames from start of page */

'frame' in the comment means an order-0 page ?

> +		page += offset >> PAGE_SHIFT;
> +		offset &= ~PAGE_MASK;
>  
> -		mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
> -		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> -						mfn, GNTMAP_readonly);
> +		while (size > 0) {
> +			unsigned long bytes;
>  
> -		tx->gref = np->grant_tx_ref[id] = ref;
> -		tx->offset = frag->page_offset;
> -		tx->size = skb_frag_size(frag);
> -		tx->flags = 0;
> +			BUG_ON(offset >= PAGE_SIZE);
> +
> +			bytes = PAGE_SIZE - offset;
> +			if (bytes > size)
> +				bytes = size;
> +
> +			tx->flags |= XEN_NETTXF_more_data;
> +
> +			id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> +			np->tx_skbs[id].skb = skb_get(skb);

BTW this skb_get() means extra atomic operations for every 4096 bytes
unit, and an extra atomic op (and test for final 0) at TX completion.
This could be avoided, by setting np->tx_skbs[id].skb = skb only for the
very last unit.

> +			tx = RING_GET_REQUEST(&np->tx, prod++);
> +			tx->id = id;
> +			ref = gnttab_claim_grant_reference(&np->gref_tx_head);
> +			BUG_ON((signed short)ref < 0);
> +
> +			mfn = pfn_to_mfn(page_to_pfn(page));
> +			gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> +							mfn, GNTMAP_readonly);
> +
> +			tx->gref = np->grant_tx_ref[id] = ref;
> +			tx->offset = offset;
> +			tx->size = bytes;
> +			tx->flags = 0;
> +
> +			offset += bytes;
> +			size -= bytes;
> +
> +			/* Next frame */
> +			if (offset == PAGE_SIZE && size) {
> +				BUG_ON(!PageCompound(page));
> +				page++;
> +				offset = 0;
> +			}
> +		}
>  	}
>  
>  	np->tx.req_prod_pvt = prod;

Acked-by: Eric Dumazet <edumazet@google.com>

Thanks !



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:52:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:52:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapB3-0007bD-Gi; Tue, 20 Nov 2012 14:51:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TapB1-0007ad-9k
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:51:51 +0000
Received: from [85.158.143.99:24347] by server-3.bemta-4.messagelabs.com id
	42/B1-06841-6099BA05; Tue, 20 Nov 2012 14:51:50 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-8.tower-216.messagelabs.com!1353423108!19736468!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31576 invoked from network); 20 Nov 2012 14:51:48 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-8.tower-216.messagelabs.com with SMTP;
	20 Nov 2012 14:51:48 -0000
X-TM-IMSS-Message-ID: <9cf7a12c000bdf69@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9cf7a12c000bdf69 ;
	Tue, 20 Nov 2012 09:51:06 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKEpd9T028173; 
	Tue, 20 Nov 2012 09:51:39 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Tue, 20 Nov 2012 09:51:34 -0500
Message-Id: <1353423098-16371-2-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 1/5] Remove XSM_DEFAULT macro
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This fixes ctags so that it can find the default XSM hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/include/xsm/dummy.h | 256 ++++++++++++++++++++++++------------------------
 xen/include/xsm/xsm.h   |   5 +-
 xen/xsm/dummy.c         |   5 +-
 3 files changed, 135 insertions(+), 131 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 040b463..fa78785 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -11,83 +11,83 @@
 #include <xen/sched.h>
 #include <xsm/xsm.h>
 
-static XSM_DEFAULT(void, security_domaininfo)(struct domain *d,
+static XSM_INLINE void xsm_security_domaininfo(struct domain *d,
                                     struct xen_domctl_getdomaininfo *info)
 {
     return;
 }
 
-static XSM_DEFAULT(int, setvcpucontext)(struct domain *d)
+static XSM_INLINE int xsm_setvcpucontext(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, pausedomain) (struct domain *d)
+static XSM_INLINE int xsm_pausedomain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, unpausedomain) (struct domain *d)
+static XSM_INLINE int xsm_unpausedomain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, resumedomain) (struct domain *d)
+static XSM_INLINE int xsm_resumedomain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, domain_create)(struct domain *d, u32 ssidref)
+static XSM_INLINE int xsm_domain_create(struct domain *d, u32 ssidref)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, max_vcpus)(struct domain *d)
+static XSM_INLINE int xsm_max_vcpus(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, destroydomain) (struct domain *d)
+static XSM_INLINE int xsm_destroydomain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, vcpuaffinity) (int cmd, struct domain *d)
+static XSM_INLINE int xsm_vcpuaffinity(int cmd, struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, scheduler) (struct domain *d)
+static XSM_INLINE int xsm_scheduler(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getdomaininfo) (struct domain *d)
+static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getvcpucontext) (struct domain *d)
+static XSM_INLINE int xsm_getvcpucontext(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getvcpuinfo) (struct domain *d)
+static XSM_INLINE int xsm_getvcpuinfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, domain_settime) (struct domain *d)
+static XSM_INLINE int xsm_domain_settime(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, set_target) (struct domain *d, struct domain *e)
+static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, domctl)(struct domain *d, int cmd)
+static XSM_INLINE int xsm_domctl(struct domain *d, int cmd)
 {
     switch ( cmd )
     {
@@ -106,143 +106,143 @@ static XSM_DEFAULT(int, domctl)(struct domain *d, int cmd)
     return 0;
 }
 
-static XSM_DEFAULT(int, sysctl)(int cmd)
+static XSM_INLINE int xsm_sysctl(int cmd)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, set_virq_handler)(struct domain *d, uint32_t virq)
+static XSM_INLINE int xsm_set_virq_handler(struct domain *d, uint32_t virq)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, tbufcontrol) (void)
+static XSM_INLINE int xsm_tbufcontrol(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, readconsole) (uint32_t clear)
+static XSM_INLINE int xsm_readconsole(uint32_t clear)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, sched_id) (void)
+static XSM_INLINE int xsm_sched_id(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, setdomainmaxmem) (struct domain *d)
+static XSM_INLINE int xsm_setdomainmaxmem(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, setdomainhandle) (struct domain *d)
+static XSM_INLINE int xsm_setdomainhandle(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, setdebugging) (struct domain *d)
+static XSM_INLINE int xsm_setdebugging(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, perfcontrol) (void)
+static XSM_INLINE int xsm_perfcontrol(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, debug_keys) (void)
+static XSM_INLINE int xsm_debug_keys(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getcpuinfo) (void)
+static XSM_INLINE int xsm_getcpuinfo(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, get_pmstat) (void)
+static XSM_INLINE int xsm_get_pmstat(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, setpminfo) (void)
+static XSM_INLINE int xsm_setpminfo(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, pm_op) (void)
+static XSM_INLINE int xsm_pm_op(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, do_mca) (void)
+static XSM_INLINE int xsm_do_mca(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, availheap) (void)
+static XSM_INLINE int xsm_availheap(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, alloc_security_domain) (struct domain *d)
+static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(void, free_security_domain) (struct domain *d)
+static XSM_INLINE void xsm_free_security_domain(struct domain *d)
 {
     return;
 }
 
-static XSM_DEFAULT(int, grant_mapref) (struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_grant_mapref(struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_unmapref) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_unmapref(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_setup) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_setup(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_transfer) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_transfer(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_copy) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_copy(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_query_size) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_query_size(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, memory_exchange) (struct domain *d)
+static XSM_INLINE int xsm_memory_exchange(struct domain *d)
 {
     if ( d != current->domain && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, memory_adjust_reservation) (struct domain *d1,
+static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
                                                             struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
@@ -250,14 +250,14 @@ static XSM_DEFAULT(int, memory_adjust_reservation) (struct domain *d1,
     return 0;
 }
 
-static XSM_DEFAULT(int, memory_stat_reservation) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_memory_stat_reservation(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, console_io) (struct domain *d, int cmd)
+static XSM_INLINE int xsm_console_io(struct domain *d, int cmd)
 {
 #ifndef VERBOSE
     if ( !IS_PRIV(current->domain) )
@@ -266,32 +266,32 @@ static XSM_DEFAULT(int, console_io) (struct domain *d, int cmd)
     return 0;
 }
 
-static XSM_DEFAULT(int, profile) (struct domain *d, int op)
+static XSM_INLINE int xsm_profile(struct domain *d, int op)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, kexec) (void)
+static XSM_INLINE int xsm_kexec(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, schedop_shutdown) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_schedop_shutdown(struct domain *d1, struct domain *d2)
 {
     if ( !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, memory_pin_page) (struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
                                           struct page_info *page)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, evtchn_unbound) (struct domain *d, struct evtchn *chn,
+static XSM_INLINE int xsm_evtchn_unbound(struct domain *d, struct evtchn *chn,
                                          domid_t id2)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
@@ -299,200 +299,200 @@ static XSM_DEFAULT(int, evtchn_unbound) (struct domain *d, struct evtchn *chn,
     return 0;
 }
 
-static XSM_DEFAULT(int, evtchn_interdomain) (struct domain *d1, struct evtchn
+static XSM_INLINE int xsm_evtchn_interdomain(struct domain *d1, struct evtchn
                                 *chan1, struct domain *d2, struct evtchn *chan2)
 {
     return 0;
 }
 
-static XSM_DEFAULT(void, evtchn_close_post) (struct evtchn *chn)
+static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
 {
     return;
 }
 
-static XSM_DEFAULT(int, evtchn_send) (struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, evtchn_status) (struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_evtchn_status(struct domain *d, struct evtchn *chn)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, evtchn_reset) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_evtchn_reset(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, alloc_security_evtchn) (struct evtchn *chn)
+static XSM_INLINE int xsm_alloc_security_evtchn(struct evtchn *chn)
 {
     return 0;
 }
 
-static XSM_DEFAULT(void, free_security_evtchn) (struct evtchn *chn)
+static XSM_INLINE void xsm_free_security_evtchn(struct evtchn *chn)
 {
     return;
 }
 
-static XSM_DEFAULT(char *, show_security_evtchn) (struct domain *d, const struct evtchn *chn)
+static XSM_INLINE char * xsm_show_security_evtchn(struct domain *d, const struct evtchn *chn)
 {
     return NULL;
 }
 
-static XSM_DEFAULT(int, get_pod_target)(struct domain *d)
+static XSM_INLINE int xsm_get_pod_target(struct domain *d)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, set_pod_target)(struct domain *d)
+static XSM_INLINE int xsm_set_pod_target(struct domain *d)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, get_device_group) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_get_device_group(uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, test_assign_device) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_test_assign_device(uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, assign_device) (struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, deassign_device) (struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_plug_core) (void)
+static XSM_INLINE int xsm_resource_plug_core(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_unplug_core) (void)
+static XSM_INLINE int xsm_resource_unplug_core(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_plug_pci) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_resource_plug_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_unplug_pci) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_resource_unplug_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_setup_pci) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_resource_setup_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_setup_gsi) (int gsi)
+static XSM_INLINE int xsm_resource_setup_gsi(int gsi)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_setup_misc) (void)
+static XSM_INLINE int xsm_resource_setup_misc(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, page_offline) (uint32_t cmd)
+static XSM_INLINE int xsm_page_offline(uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, lockprof) (void)
+static XSM_INLINE int xsm_lockprof(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, cpupool_op) (void)
+static XSM_INLINE int xsm_cpupool_op(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, sched_op) (void)
+static XSM_INLINE int xsm_sched_op(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, tmem_op) (void)
+static XSM_INLINE int xsm_tmem_op(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, tmem_control) (void)
+static XSM_INLINE int xsm_tmem_control(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(long, do_xsm_op)(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
+static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
     return -ENOSYS;
 }
 
-static XSM_DEFAULT(char *, show_irq_sid) (int irq)
+static XSM_INLINE char * xsm_show_irq_sid(int irq)
 {
     return NULL;
 }
 
-static XSM_DEFAULT(int, map_domain_pirq) (struct domain *d, int irq, void *data)
+static XSM_INLINE int xsm_map_domain_pirq(struct domain *d, int irq, void *data)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, unmap_domain_pirq) (struct domain *d, int irq)
+static XSM_INLINE int xsm_unmap_domain_pirq(struct domain *d, int irq)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, irq_permission) (struct domain *d, int pirq, uint8_t allow)
+static XSM_INLINE int xsm_irq_permission(struct domain *d, int pirq, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, iomem_permission) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_iomem_permission(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_iomem_mapping(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, pci_config_permission) (struct domain *d, uint32_t machine_bdf,
+static XSM_INLINE int xsm_pci_config_permission(struct domain *d, uint32_t machine_bdf,
                                         uint16_t start, uint16_t end,
                                         uint8_t access)
 {
@@ -500,188 +500,188 @@ static XSM_DEFAULT(int, pci_config_permission) (struct domain *d, uint32_t machi
 }
 
 #ifdef CONFIG_X86
-static XSM_DEFAULT(int, shadow_control) (struct domain *d, uint32_t op)
+static XSM_INLINE int xsm_shadow_control(struct domain *d, uint32_t op)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getpageframeinfo) (struct domain *d)
+static XSM_INLINE int xsm_getpageframeinfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getmemlist) (struct domain *d)
+static XSM_INLINE int xsm_getmemlist(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, hypercall_init) (struct domain *d)
+static XSM_INLINE int xsm_hypercall_init(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, hvmcontext) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_hvmcontext(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, address_size) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_address_size(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, machine_address_size) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_machine_address_size(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_param) (struct domain *d, unsigned long op)
+static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_set_pci_intx_level) (struct domain *d)
+static XSM_INLINE int xsm_hvm_set_pci_intx_level(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_set_isa_irq_level) (struct domain *d)
+static XSM_INLINE int xsm_hvm_set_isa_irq_level(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_set_pci_link_route) (struct domain *d)
+static XSM_INLINE int xsm_hvm_set_pci_link_route(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_inject_msi) (struct domain *d)
+static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_event_setup) (struct domain *d)
+static XSM_INLINE int xsm_mem_event_setup(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_event_control) (struct domain *d, int mode, int op)
+static XSM_INLINE int xsm_mem_event_control(struct domain *d, int mode, int op)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_event_op) (struct domain *d, int op)
+static XSM_INLINE int xsm_mem_event_op(struct domain *d, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_sharing) (struct domain *d)
+static XSM_INLINE int xsm_mem_sharing(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_sharing_op) (struct domain *d, struct domain *cd, int op)
+static XSM_INLINE int xsm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, cd) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, apic) (struct domain *d, int cmd)
+static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
 {
     if ( !IS_PRIV(d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, xen_settime) (void)
+static XSM_INLINE int xsm_xen_settime(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, memtype) (uint32_t access)
+static XSM_INLINE int xsm_memtype(uint32_t access)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, microcode) (void)
+static XSM_INLINE int xsm_microcode(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, physinfo) (void)
+static XSM_INLINE int xsm_physinfo(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, platform_quirk) (uint32_t quirk)
+static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, platform_op) (uint32_t op)
+static XSM_INLINE int xsm_platform_op(uint32_t op)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, firmware_info) (void)
+static XSM_INLINE int xsm_firmware_info(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, efi_call) (void)
+static XSM_INLINE int xsm_efi_call(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, acpi_sleep) (void)
+static XSM_INLINE int xsm_acpi_sleep(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, change_freq) (void)
+static XSM_INLINE int xsm_change_freq(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getidletime) (void)
+static XSM_INLINE int xsm_getidletime(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, machine_memory_map) (void)
+static XSM_INLINE int xsm_machine_memory_map(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, domain_memory_map) (struct domain *d)
+static XSM_INLINE int xsm_domain_memory_map(struct domain *d)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, mmu_update) (struct domain *d, struct domain *t,
+static XSM_INLINE int xsm_mmu_update(struct domain *d, struct domain *t,
                                      struct domain *f, uint32_t flags)
 {
     if ( t && d != t && !IS_PRIV_FOR(d, t) )
@@ -691,14 +691,14 @@ static XSM_DEFAULT(int, mmu_update) (struct domain *d, struct domain *t,
     return 0;
 }
 
-static XSM_DEFAULT(int, mmuext_op) (struct domain *d, struct domain *f)
+static XSM_INLINE int xsm_mmuext_op(struct domain *d, struct domain *f)
 {
     if ( d != f && !IS_PRIV_FOR(d, f) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, update_va_mapping) (struct domain *d, struct domain *f, 
+static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
     if ( d != f && !IS_PRIV_FOR(d, f) )
@@ -706,56 +706,56 @@ static XSM_DEFAULT(int, update_va_mapping) (struct domain *d, struct domain *f,
     return 0;
 }
 
-static XSM_DEFAULT(int, add_to_physmap) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, remove_from_physmap) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, sendtrigger) (struct domain *d)
+static XSM_INLINE int xsm_sendtrigger(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_unbind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, pin_mem_cacheattr) (struct domain *d)
+static XSM_INLINE int xsm_pin_mem_cacheattr(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, ext_vcpucontext) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, vcpuextstate) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_ioport_mapping(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
 }
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 748f5ff..b2f33d6 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -195,6 +195,8 @@ struct xsm_operations {
 
 extern struct xsm_operations *xsm_ops;
 
+#ifndef XSM_NO_WRAPPERS
+
 static inline void xsm_security_domaininfo (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info)
 {
@@ -846,6 +848,7 @@ static inline int xsm_ioport_mapping (struct domain *d, uint32_t s, uint32_t e,
     return xsm_ops->ioport_mapping(d, s, e, allow);
 }
 #endif /* CONFIG_X86 */
+#endif /* XSM_NO_WRAPPERS */
 
 extern int xsm_init(unsigned long *module_map, const multiboot_info_t *mbi,
                     void *(*bootstrap_map)(const module_t *));
@@ -860,7 +863,7 @@ extern void xsm_fixup_ops(struct xsm_operations *ops);
 
 #else /* XSM_ENABLE */
 
-#define XSM_DEFAULT(type, name) inline type xsm_ ## name
+#define XSM_INLINE inline
 #include <xsm/dummy.h>
 
 static inline int xsm_init (unsigned long *module_map,
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 6e113fb..3e6e5df 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -10,7 +10,8 @@
  *  as published by the Free Software Foundation.
  */
 
-#define XSM_DEFAULT(type, name) type dummy_ ## name
+#define XSM_NO_WRAPPERS
+#define XSM_INLINE /* */
 #include <xsm/dummy.h>
 
 struct xsm_operations dummy_xsm_ops;
@@ -19,7 +20,7 @@ struct xsm_operations dummy_xsm_ops;
     do {                                                               \
         if ( !ops->function )                                          \
         {                                                              \
-            ops->function = dummy_##function;                          \
+            ops->function = xsm_##function;                            \
             if (ops != &dummy_xsm_ops)                                 \
                 dprintk(XENLOG_DEBUG, "Had to override the " #function \
                     " security operation with the dummy one.\n");      \
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:52:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:52:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapB3-0007bD-Gi; Tue, 20 Nov 2012 14:51:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TapB1-0007ad-9k
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:51:51 +0000
Received: from [85.158.143.99:24347] by server-3.bemta-4.messagelabs.com id
	42/B1-06841-6099BA05; Tue, 20 Nov 2012 14:51:50 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-8.tower-216.messagelabs.com!1353423108!19736468!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31576 invoked from network); 20 Nov 2012 14:51:48 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-8.tower-216.messagelabs.com with SMTP;
	20 Nov 2012 14:51:48 -0000
X-TM-IMSS-Message-ID: <9cf7a12c000bdf69@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9cf7a12c000bdf69 ;
	Tue, 20 Nov 2012 09:51:06 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKEpd9T028173; 
	Tue, 20 Nov 2012 09:51:39 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Tue, 20 Nov 2012 09:51:34 -0500
Message-Id: <1353423098-16371-2-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 1/5] Remove XSM_DEFAULT macro
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This fixes ctags so that it can find the default XSM hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/include/xsm/dummy.h | 256 ++++++++++++++++++++++++------------------------
 xen/include/xsm/xsm.h   |   5 +-
 xen/xsm/dummy.c         |   5 +-
 3 files changed, 135 insertions(+), 131 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 040b463..fa78785 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -11,83 +11,83 @@
 #include <xen/sched.h>
 #include <xsm/xsm.h>
 
-static XSM_DEFAULT(void, security_domaininfo)(struct domain *d,
+static XSM_INLINE void xsm_security_domaininfo(struct domain *d,
                                     struct xen_domctl_getdomaininfo *info)
 {
     return;
 }
 
-static XSM_DEFAULT(int, setvcpucontext)(struct domain *d)
+static XSM_INLINE int xsm_setvcpucontext(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, pausedomain) (struct domain *d)
+static XSM_INLINE int xsm_pausedomain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, unpausedomain) (struct domain *d)
+static XSM_INLINE int xsm_unpausedomain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, resumedomain) (struct domain *d)
+static XSM_INLINE int xsm_resumedomain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, domain_create)(struct domain *d, u32 ssidref)
+static XSM_INLINE int xsm_domain_create(struct domain *d, u32 ssidref)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, max_vcpus)(struct domain *d)
+static XSM_INLINE int xsm_max_vcpus(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, destroydomain) (struct domain *d)
+static XSM_INLINE int xsm_destroydomain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, vcpuaffinity) (int cmd, struct domain *d)
+static XSM_INLINE int xsm_vcpuaffinity(int cmd, struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, scheduler) (struct domain *d)
+static XSM_INLINE int xsm_scheduler(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getdomaininfo) (struct domain *d)
+static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getvcpucontext) (struct domain *d)
+static XSM_INLINE int xsm_getvcpucontext(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getvcpuinfo) (struct domain *d)
+static XSM_INLINE int xsm_getvcpuinfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, domain_settime) (struct domain *d)
+static XSM_INLINE int xsm_domain_settime(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, set_target) (struct domain *d, struct domain *e)
+static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, domctl)(struct domain *d, int cmd)
+static XSM_INLINE int xsm_domctl(struct domain *d, int cmd)
 {
     switch ( cmd )
     {
@@ -106,143 +106,143 @@ static XSM_DEFAULT(int, domctl)(struct domain *d, int cmd)
     return 0;
 }
 
-static XSM_DEFAULT(int, sysctl)(int cmd)
+static XSM_INLINE int xsm_sysctl(int cmd)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, set_virq_handler)(struct domain *d, uint32_t virq)
+static XSM_INLINE int xsm_set_virq_handler(struct domain *d, uint32_t virq)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, tbufcontrol) (void)
+static XSM_INLINE int xsm_tbufcontrol(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, readconsole) (uint32_t clear)
+static XSM_INLINE int xsm_readconsole(uint32_t clear)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, sched_id) (void)
+static XSM_INLINE int xsm_sched_id(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, setdomainmaxmem) (struct domain *d)
+static XSM_INLINE int xsm_setdomainmaxmem(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, setdomainhandle) (struct domain *d)
+static XSM_INLINE int xsm_setdomainhandle(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, setdebugging) (struct domain *d)
+static XSM_INLINE int xsm_setdebugging(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, perfcontrol) (void)
+static XSM_INLINE int xsm_perfcontrol(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, debug_keys) (void)
+static XSM_INLINE int xsm_debug_keys(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getcpuinfo) (void)
+static XSM_INLINE int xsm_getcpuinfo(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, get_pmstat) (void)
+static XSM_INLINE int xsm_get_pmstat(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, setpminfo) (void)
+static XSM_INLINE int xsm_setpminfo(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, pm_op) (void)
+static XSM_INLINE int xsm_pm_op(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, do_mca) (void)
+static XSM_INLINE int xsm_do_mca(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, availheap) (void)
+static XSM_INLINE int xsm_availheap(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, alloc_security_domain) (struct domain *d)
+static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(void, free_security_domain) (struct domain *d)
+static XSM_INLINE void xsm_free_security_domain(struct domain *d)
 {
     return;
 }
 
-static XSM_DEFAULT(int, grant_mapref) (struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_grant_mapref(struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_unmapref) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_unmapref(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_setup) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_setup(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_transfer) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_transfer(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_copy) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_copy(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_query_size) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_query_size(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, memory_exchange) (struct domain *d)
+static XSM_INLINE int xsm_memory_exchange(struct domain *d)
 {
     if ( d != current->domain && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, memory_adjust_reservation) (struct domain *d1,
+static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
                                                             struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
@@ -250,14 +250,14 @@ static XSM_DEFAULT(int, memory_adjust_reservation) (struct domain *d1,
     return 0;
 }
 
-static XSM_DEFAULT(int, memory_stat_reservation) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_memory_stat_reservation(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, console_io) (struct domain *d, int cmd)
+static XSM_INLINE int xsm_console_io(struct domain *d, int cmd)
 {
 #ifndef VERBOSE
     if ( !IS_PRIV(current->domain) )
@@ -266,32 +266,32 @@ static XSM_DEFAULT(int, console_io) (struct domain *d, int cmd)
     return 0;
 }
 
-static XSM_DEFAULT(int, profile) (struct domain *d, int op)
+static XSM_INLINE int xsm_profile(struct domain *d, int op)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, kexec) (void)
+static XSM_INLINE int xsm_kexec(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, schedop_shutdown) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_schedop_shutdown(struct domain *d1, struct domain *d2)
 {
     if ( !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, memory_pin_page) (struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
                                           struct page_info *page)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, evtchn_unbound) (struct domain *d, struct evtchn *chn,
+static XSM_INLINE int xsm_evtchn_unbound(struct domain *d, struct evtchn *chn,
                                          domid_t id2)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
@@ -299,200 +299,200 @@ static XSM_DEFAULT(int, evtchn_unbound) (struct domain *d, struct evtchn *chn,
     return 0;
 }
 
-static XSM_DEFAULT(int, evtchn_interdomain) (struct domain *d1, struct evtchn
+static XSM_INLINE int xsm_evtchn_interdomain(struct domain *d1, struct evtchn
                                 *chan1, struct domain *d2, struct evtchn *chan2)
 {
     return 0;
 }
 
-static XSM_DEFAULT(void, evtchn_close_post) (struct evtchn *chn)
+static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
 {
     return;
 }
 
-static XSM_DEFAULT(int, evtchn_send) (struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, evtchn_status) (struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_evtchn_status(struct domain *d, struct evtchn *chn)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, evtchn_reset) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_evtchn_reset(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, alloc_security_evtchn) (struct evtchn *chn)
+static XSM_INLINE int xsm_alloc_security_evtchn(struct evtchn *chn)
 {
     return 0;
 }
 
-static XSM_DEFAULT(void, free_security_evtchn) (struct evtchn *chn)
+static XSM_INLINE void xsm_free_security_evtchn(struct evtchn *chn)
 {
     return;
 }
 
-static XSM_DEFAULT(char *, show_security_evtchn) (struct domain *d, const struct evtchn *chn)
+static XSM_INLINE char * xsm_show_security_evtchn(struct domain *d, const struct evtchn *chn)
 {
     return NULL;
 }
 
-static XSM_DEFAULT(int, get_pod_target)(struct domain *d)
+static XSM_INLINE int xsm_get_pod_target(struct domain *d)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, set_pod_target)(struct domain *d)
+static XSM_INLINE int xsm_set_pod_target(struct domain *d)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, get_device_group) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_get_device_group(uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, test_assign_device) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_test_assign_device(uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, assign_device) (struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, deassign_device) (struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_plug_core) (void)
+static XSM_INLINE int xsm_resource_plug_core(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_unplug_core) (void)
+static XSM_INLINE int xsm_resource_unplug_core(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_plug_pci) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_resource_plug_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_unplug_pci) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_resource_unplug_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_setup_pci) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_resource_setup_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_setup_gsi) (int gsi)
+static XSM_INLINE int xsm_resource_setup_gsi(int gsi)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_setup_misc) (void)
+static XSM_INLINE int xsm_resource_setup_misc(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, page_offline) (uint32_t cmd)
+static XSM_INLINE int xsm_page_offline(uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, lockprof) (void)
+static XSM_INLINE int xsm_lockprof(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, cpupool_op) (void)
+static XSM_INLINE int xsm_cpupool_op(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, sched_op) (void)
+static XSM_INLINE int xsm_sched_op(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, tmem_op) (void)
+static XSM_INLINE int xsm_tmem_op(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, tmem_control) (void)
+static XSM_INLINE int xsm_tmem_control(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(long, do_xsm_op)(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
+static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
     return -ENOSYS;
 }
 
-static XSM_DEFAULT(char *, show_irq_sid) (int irq)
+static XSM_INLINE char * xsm_show_irq_sid(int irq)
 {
     return NULL;
 }
 
-static XSM_DEFAULT(int, map_domain_pirq) (struct domain *d, int irq, void *data)
+static XSM_INLINE int xsm_map_domain_pirq(struct domain *d, int irq, void *data)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, unmap_domain_pirq) (struct domain *d, int irq)
+static XSM_INLINE int xsm_unmap_domain_pirq(struct domain *d, int irq)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, irq_permission) (struct domain *d, int pirq, uint8_t allow)
+static XSM_INLINE int xsm_irq_permission(struct domain *d, int pirq, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, iomem_permission) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_iomem_permission(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_iomem_mapping(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, pci_config_permission) (struct domain *d, uint32_t machine_bdf,
+static XSM_INLINE int xsm_pci_config_permission(struct domain *d, uint32_t machine_bdf,
                                         uint16_t start, uint16_t end,
                                         uint8_t access)
 {
@@ -500,188 +500,188 @@ static XSM_DEFAULT(int, pci_config_permission) (struct domain *d, uint32_t machi
 }
 
 #ifdef CONFIG_X86
-static XSM_DEFAULT(int, shadow_control) (struct domain *d, uint32_t op)
+static XSM_INLINE int xsm_shadow_control(struct domain *d, uint32_t op)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getpageframeinfo) (struct domain *d)
+static XSM_INLINE int xsm_getpageframeinfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getmemlist) (struct domain *d)
+static XSM_INLINE int xsm_getmemlist(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, hypercall_init) (struct domain *d)
+static XSM_INLINE int xsm_hypercall_init(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, hvmcontext) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_hvmcontext(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, address_size) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_address_size(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, machine_address_size) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_machine_address_size(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_param) (struct domain *d, unsigned long op)
+static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_set_pci_intx_level) (struct domain *d)
+static XSM_INLINE int xsm_hvm_set_pci_intx_level(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_set_isa_irq_level) (struct domain *d)
+static XSM_INLINE int xsm_hvm_set_isa_irq_level(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_set_pci_link_route) (struct domain *d)
+static XSM_INLINE int xsm_hvm_set_pci_link_route(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_inject_msi) (struct domain *d)
+static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_event_setup) (struct domain *d)
+static XSM_INLINE int xsm_mem_event_setup(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_event_control) (struct domain *d, int mode, int op)
+static XSM_INLINE int xsm_mem_event_control(struct domain *d, int mode, int op)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_event_op) (struct domain *d, int op)
+static XSM_INLINE int xsm_mem_event_op(struct domain *d, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_sharing) (struct domain *d)
+static XSM_INLINE int xsm_mem_sharing(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_sharing_op) (struct domain *d, struct domain *cd, int op)
+static XSM_INLINE int xsm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, cd) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, apic) (struct domain *d, int cmd)
+static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
 {
     if ( !IS_PRIV(d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, xen_settime) (void)
+static XSM_INLINE int xsm_xen_settime(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, memtype) (uint32_t access)
+static XSM_INLINE int xsm_memtype(uint32_t access)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, microcode) (void)
+static XSM_INLINE int xsm_microcode(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, physinfo) (void)
+static XSM_INLINE int xsm_physinfo(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, platform_quirk) (uint32_t quirk)
+static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, platform_op) (uint32_t op)
+static XSM_INLINE int xsm_platform_op(uint32_t op)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, firmware_info) (void)
+static XSM_INLINE int xsm_firmware_info(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, efi_call) (void)
+static XSM_INLINE int xsm_efi_call(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, acpi_sleep) (void)
+static XSM_INLINE int xsm_acpi_sleep(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, change_freq) (void)
+static XSM_INLINE int xsm_change_freq(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getidletime) (void)
+static XSM_INLINE int xsm_getidletime(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, machine_memory_map) (void)
+static XSM_INLINE int xsm_machine_memory_map(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, domain_memory_map) (struct domain *d)
+static XSM_INLINE int xsm_domain_memory_map(struct domain *d)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, mmu_update) (struct domain *d, struct domain *t,
+static XSM_INLINE int xsm_mmu_update(struct domain *d, struct domain *t,
                                      struct domain *f, uint32_t flags)
 {
     if ( t && d != t && !IS_PRIV_FOR(d, t) )
@@ -691,14 +691,14 @@ static XSM_DEFAULT(int, mmu_update) (struct domain *d, struct domain *t,
     return 0;
 }
 
-static XSM_DEFAULT(int, mmuext_op) (struct domain *d, struct domain *f)
+static XSM_INLINE int xsm_mmuext_op(struct domain *d, struct domain *f)
 {
     if ( d != f && !IS_PRIV_FOR(d, f) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, update_va_mapping) (struct domain *d, struct domain *f, 
+static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
     if ( d != f && !IS_PRIV_FOR(d, f) )
@@ -706,56 +706,56 @@ static XSM_DEFAULT(int, update_va_mapping) (struct domain *d, struct domain *f,
     return 0;
 }
 
-static XSM_DEFAULT(int, add_to_physmap) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, remove_from_physmap) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, sendtrigger) (struct domain *d)
+static XSM_INLINE int xsm_sendtrigger(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_unbind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, pin_mem_cacheattr) (struct domain *d)
+static XSM_INLINE int xsm_pin_mem_cacheattr(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, ext_vcpucontext) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, vcpuextstate) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_ioport_mapping(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
 }
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 748f5ff..b2f33d6 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -195,6 +195,8 @@ struct xsm_operations {
 
 extern struct xsm_operations *xsm_ops;
 
+#ifndef XSM_NO_WRAPPERS
+
 static inline void xsm_security_domaininfo (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info)
 {
@@ -846,6 +848,7 @@ static inline int xsm_ioport_mapping (struct domain *d, uint32_t s, uint32_t e,
     return xsm_ops->ioport_mapping(d, s, e, allow);
 }
 #endif /* CONFIG_X86 */
+#endif /* XSM_NO_WRAPPERS */
 
 extern int xsm_init(unsigned long *module_map, const multiboot_info_t *mbi,
                     void *(*bootstrap_map)(const module_t *));
@@ -860,7 +863,7 @@ extern void xsm_fixup_ops(struct xsm_operations *ops);
 
 #else /* XSM_ENABLE */
 
-#define XSM_DEFAULT(type, name) inline type xsm_ ## name
+#define XSM_INLINE inline
 #include <xsm/dummy.h>
 
 static inline int xsm_init (unsigned long *module_map,
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 6e113fb..3e6e5df 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -10,7 +10,8 @@
  *  as published by the Free Software Foundation.
  */
 
-#define XSM_DEFAULT(type, name) type dummy_ ## name
+#define XSM_NO_WRAPPERS
+#define XSM_INLINE /* */
 #include <xsm/dummy.h>
 
 struct xsm_operations dummy_xsm_ops;
@@ -19,7 +20,7 @@ struct xsm_operations dummy_xsm_ops;
     do {                                                               \
         if ( !ops->function )                                          \
         {                                                              \
-            ops->function = dummy_##function;                          \
+            ops->function = xsm_##function;                            \
             if (ops != &dummy_xsm_ops)                                 \
                 dprintk(XENLOG_DEBUG, "Had to override the " #function \
                     " security operation with the dummy one.\n");      \
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:52:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:52:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapB2-0007au-Nn; Tue, 20 Nov 2012 14:51:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TapB0-0007aa-KS
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:51:51 +0000
Received: from [85.158.143.99:24302] by server-1.bemta-4.messagelabs.com id
	C7/39-27934-5099BA05; Tue, 20 Nov 2012 14:51:49 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-216.messagelabs.com!1353423108!19879440!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11615 invoked from network); 20 Nov 2012 14:51:48 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-14.tower-216.messagelabs.com with SMTP;
	20 Nov 2012 14:51:48 -0000
X-TM-IMSS-Message-ID: <9cf7a522000bdf6d@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9cf7a522000bdf6d ;
	Tue, 20 Nov 2012 09:51:07 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKEpd9W028173; 
	Tue, 20 Nov 2012 09:51:40 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Tue, 20 Nov 2012 09:51:37 -0500
Message-Id: <1353423098-16371-5-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 4/5] xen: platform_hypercall XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

A number of the platform_hypercall XSM hooks have no parameters or only
pass the operation ID, making them redundant with the xsm_sysctl hook.
Remove these redundant hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/platform_hypercall.c |  44 ----------------
 xen/include/xsm/dummy.h           |  52 ------------------
 xen/include/xsm/xsm.h             |  54 -------------------
 xen/xsm/dummy.c                   |  10 ----
 xen/xsm/flask/hooks.c             | 107 +++++++++++---------------------------
 5 files changed, 30 insertions(+), 237 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index ffac6ac..f267b8b 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -90,10 +90,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
     case XENPF_settime:
     {
-        ret = xsm_xen_settime();
-        if ( ret )
-            break;
-
         do_settime(op->u.settime.secs, 
                    op->u.settime.nsecs, 
                    op->u.settime.system_time);
@@ -103,10 +99,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
     case XENPF_add_memtype:
     {
-        ret = xsm_memtype(op->cmd);
-        if ( ret )
-            break;
-
         ret = mtrr_add_page(
             op->u.add_memtype.mfn,
             op->u.add_memtype.nr_mfns,
@@ -125,10 +117,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
     case XENPF_del_memtype:
     {
-        ret = xsm_memtype(op->cmd);
-        if ( ret )
-            break;
-
         if (op->u.del_memtype.handle == 0
             /* mtrr/main.c otherwise does a lookup */
             && (int)op->u.del_memtype.reg >= 0)
@@ -147,10 +135,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         unsigned long mfn, nr_mfns;
         mtrr_type     type;
 
-        ret = xsm_memtype(op->cmd);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( op->u.read_memtype.reg < num_var_ranges )
         {
@@ -167,10 +151,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         XEN_GUEST_HANDLE(const_void) data;
 
-        ret = xsm_microcode();
-        if ( ret )
-            break;
-
         guest_from_compat_handle(data, op->u.microcode.data);
 
         /*
@@ -198,10 +178,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         int quirk_id = op->u.platform_quirk.quirk_id;
 
-        ret = xsm_platform_quirk(quirk_id);
-        if ( ret )
-            break;
-
         switch ( quirk_id )
         {
         case QUIRK_NOIRQBALANCING:
@@ -223,10 +199,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_firmware_info:
-        ret = xsm_firmware_info();
-        if ( ret )
-            break;
-
         switch ( op->u.firmware_info.type )
         {
         case XEN_FW_DISK_INFO: {
@@ -335,10 +307,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         break;
 
     case XENPF_efi_runtime_call:
-        ret = xsm_efi_call();
-        if ( ret )
-            break;
-
         ret = efi_runtime_call(&op->u.efi_runtime_call);
         if ( ret == 0 &&
              copy_field_to_guest(u_xenpf_op, op, u.efi_runtime_call) )
@@ -346,18 +314,10 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         break;
 
     case XENPF_enter_acpi_sleep:
-        ret = xsm_acpi_sleep();
-        if ( ret )
-            break;
-
         ret = acpi_enter_sleep(&op->u.enter_acpi_sleep);
         break;
 
     case XENPF_change_freq:
-        ret = xsm_change_freq();
-        if ( ret )
-            break;
-
         ret = -ENOSYS;
         if ( cpufreq_controller != FREQCTL_dom0_kernel )
             break;
@@ -379,10 +339,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         XEN_GUEST_HANDLE(uint8) cpumap_bitmap;
         XEN_GUEST_HANDLE(uint64) idletimes;
 
-        ret = xsm_getidletime();
-        if ( ret )
-            break;
-
         ret = -ENOSYS;
         if ( cpufreq_controller != FREQCTL_dom0_kernel )
             break;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 93e84dc..aaac50d3 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -308,11 +308,6 @@ static XSM_INLINE int xsm_page_offline(uint32_t cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_lockprof(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_tmem_op(void)
 {
     return 0;
@@ -438,26 +433,6 @@ static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_xen_settime(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_memtype(uint32_t access)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_microcode(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_platform_op(uint32_t op)
 {
     if ( !IS_PRIV(current->domain) )
@@ -465,33 +440,6 @@ static XSM_INLINE int xsm_platform_op(uint32_t op)
     return 0;
 }
 
-static XSM_INLINE int xsm_firmware_info(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_efi_call(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_acpi_sleep(void)
-{
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
-}
-
-static XSM_INLINE int xsm_change_freq(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getidletime(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_machine_memory_map(void)
 {
     if ( !IS_PRIV(current->domain) )
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index f1ccd8e..105201e 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -107,7 +107,6 @@ struct xsm_operations {
     int (*resource_setup_misc) (void);
 
     int (*page_offline)(uint32_t cmd);
-    int (*lockprof)(void);
     int (*tmem_op)(void);
     int (*tmem_control)(void);
 
@@ -124,16 +123,8 @@ struct xsm_operations {
     int (*mem_event_op) (struct domain *d, int op);
     int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
     int (*apic) (struct domain *d, int cmd);
-    int (*xen_settime) (void);
     int (*memtype) (uint32_t access);
-    int (*microcode) (void);
-    int (*platform_quirk) (uint32_t);
     int (*platform_op) (uint32_t cmd);
-    int (*firmware_info) (void);
-    int (*efi_call) (void);
-    int (*acpi_sleep) (void);
-    int (*change_freq) (void);
-    int (*getidletime) (void);
     int (*machine_memory_map) (void);
     int (*domain_memory_map) (struct domain *d);
 #define XSM_MMU_UPDATE_READ      1
@@ -440,11 +431,6 @@ static inline int xsm_page_offline(uint32_t cmd)
     return xsm_ops->page_offline(cmd);
 }
 
-static inline int xsm_lockprof(void)
-{
-    return xsm_ops->lockprof();
-}
-
 static inline int xsm_tmem_op(void)
 {
     return xsm_ops->tmem_op();
@@ -511,56 +497,16 @@ static inline int xsm_apic (struct domain *d, int cmd)
     return xsm_ops->apic(d, cmd);
 }
 
-static inline int xsm_xen_settime (void)
-{
-    return xsm_ops->xen_settime();
-}
-
 static inline int xsm_memtype (uint32_t access)
 {
     return xsm_ops->memtype(access);
 }
 
-static inline int xsm_microcode (void)
-{
-    return xsm_ops->microcode();
-}
-
-static inline int xsm_platform_quirk (uint32_t quirk)
-{
-    return xsm_ops->platform_quirk(quirk);
-}
-
 static inline int xsm_platform_op (uint32_t op)
 {
     return xsm_ops->platform_op(op);
 }
 
-static inline int xsm_firmware_info (void)
-{
-    return xsm_ops->firmware_info();
-}
-
-static inline int xsm_efi_call (void)
-{
-    return xsm_ops->efi_call();
-}
-
-static inline int xsm_acpi_sleep (void)
-{
-    return xsm_ops->acpi_sleep();
-}
-
-static inline int xsm_change_freq (void)
-{
-    return xsm_ops->change_freq();
-}
-
-static inline int xsm_getidletime (void)
-{
-    return xsm_ops->getidletime();
-}
-
 static inline int xsm_machine_memory_map(void)
 {
     return xsm_ops->machine_memory_map();
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 03a17ba..22c66e5 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -94,7 +94,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, resource_setup_misc);
 
     set_to_dummy_if_null(ops, page_offline);
-    set_to_dummy_if_null(ops, lockprof);
     set_to_dummy_if_null(ops, tmem_op);
     set_to_dummy_if_null(ops, tmem_control);
 
@@ -111,16 +110,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, mem_event_op);
     set_to_dummy_if_null(ops, mem_sharing_op);
     set_to_dummy_if_null(ops, apic);
-    set_to_dummy_if_null(ops, xen_settime);
-    set_to_dummy_if_null(ops, memtype);
-    set_to_dummy_if_null(ops, microcode);
-    set_to_dummy_if_null(ops, platform_quirk);
     set_to_dummy_if_null(ops, platform_op);
-    set_to_dummy_if_null(ops, firmware_info);
-    set_to_dummy_if_null(ops, efi_call);
-    set_to_dummy_if_null(ops, acpi_sleep);
-    set_to_dummy_if_null(ops, change_freq);
-    set_to_dummy_if_null(ops, getidletime);
     set_to_dummy_if_null(ops, machine_memory_map);
     set_to_dummy_if_null(ops, domain_memory_map);
     set_to_dummy_if_null(ops, mmu_update);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index d72a807..03ea675 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1186,64 +1186,51 @@ static int flask_apic(struct domain *d, int cmd)
     return domain_has_xen(d, perm);
 }
 
-static int flask_xen_settime(void)
-{
-    return domain_has_xen(current->domain, XEN__SETTIME);
-}
-
-static int flask_memtype(uint32_t access)
-{
-    u32 perm;
-
-    switch ( access )
-    {
-    case XENPF_add_memtype:
-        perm = XEN__MTRR_ADD;
-        break;
-    case XENPF_del_memtype:
-        perm = XEN__MTRR_DEL;
-        break;
-    case XENPF_read_memtype:
-        perm = XEN__MTRR_READ;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return domain_has_xen(current->domain, perm);
-}
-
-static int flask_microcode(void)
-{
-    return domain_has_xen(current->domain, XEN__MICROCODE);
-}
-
-static int flask_platform_quirk(uint32_t quirk)
-{
-    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN, XEN__QUIRK, NULL);
-}
-
 static int flask_platform_op(uint32_t op)
 {
     switch ( op )
     {
+#ifdef CONFIG_X86
+    /* These operations have their own XSM hooks */
+    case XENPF_cpu_online:
+    case XENPF_cpu_offline:
+    case XENPF_cpu_hotadd:
+    case XENPF_mem_hotadd:
+        return 0;
+#endif
+
     case XENPF_settime:
+        return domain_has_xen(current->domain, XEN__SETTIME);
+
     case XENPF_add_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_ADD);
+
     case XENPF_del_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_DEL);
+
     case XENPF_read_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_READ);
+
     case XENPF_microcode_update:
+        return domain_has_xen(current->domain, XEN__MICROCODE);
+
     case XENPF_platform_quirk:
+        return domain_has_xen(current->domain, XEN__QUIRK);
+
     case XENPF_firmware_info:
+        return domain_has_xen(current->domain, XEN__FIRMWARE);
+
     case XENPF_efi_runtime_call:
+        return domain_has_xen(current->domain, XEN__FIRMWARE);
+
     case XENPF_enter_acpi_sleep:
+        return domain_has_xen(current->domain, XEN__SLEEP);
+
     case XENPF_change_freq:
+        return domain_has_xen(current->domain, XEN__FREQUENCY);
+
     case XENPF_getidletime:
-    case XENPF_cpu_online:
-    case XENPF_cpu_offline:
-    case XENPF_cpu_hotadd:
-    case XENPF_mem_hotadd:
-        /* These operations have their own XSM hooks */
-        return 0;
+        return domain_has_xen(current->domain, XEN__GETIDLE);
 
     case XENPF_set_processor_pminfo:
     case XENPF_core_parking:
@@ -1259,31 +1246,6 @@ static int flask_platform_op(uint32_t op)
     }
 }
 
-static int flask_firmware_info(void)
-{
-    return domain_has_xen(current->domain, XEN__FIRMWARE);
-}
-
-static int flask_efi_call(void)
-{
-    return domain_has_xen(current->domain, XEN__FIRMWARE);
-}
-
-static int flask_acpi_sleep(void)
-{
-    return domain_has_xen(current->domain, XEN__SLEEP);
-}
-
-static int flask_change_freq(void)
-{
-    return domain_has_xen(current->domain, XEN__FREQUENCY);
-}
-
-static int flask_getidletime(void)
-{
-    return domain_has_xen(current->domain, XEN__GETIDLE);
-}
-
 static int flask_machine_memory_map(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_MMU, MMU__MEMORYMAP, NULL);
@@ -1519,16 +1481,7 @@ static struct xsm_operations flask_ops = {
     .mem_event_op = flask_mem_event_op,
     .mem_sharing_op = flask_mem_sharing_op,
     .apic = flask_apic,
-    .xen_settime = flask_xen_settime,
-    .memtype = flask_memtype,
-    .microcode = flask_microcode,
-    .platform_quirk = flask_platform_quirk,
     .platform_op = flask_platform_op,
-    .firmware_info = flask_firmware_info,
-    .efi_call = flask_efi_call,
-    .acpi_sleep = flask_acpi_sleep,
-    .change_freq = flask_change_freq,
-    .getidletime = flask_getidletime,
     .machine_memory_map = flask_machine_memory_map,
     .domain_memory_map = flask_domain_memory_map,
     .mmu_update = flask_mmu_update,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:52:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:52:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapB4-0007bS-3J; Tue, 20 Nov 2012 14:51:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TapB2-0007aa-EZ
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:51:52 +0000
Received: from [85.158.143.99:24462] by server-1.bemta-4.messagelabs.com id
	BE/49-27934-8099BA05; Tue, 20 Nov 2012 14:51:52 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-10.tower-216.messagelabs.com!1353423108!21545558!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5092 invoked from network); 20 Nov 2012 14:51:48 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-10.tower-216.messagelabs.com with SMTP;
	20 Nov 2012 14:51:48 -0000
X-TM-IMSS-Message-ID: <9cf7a1c8000bdf6a@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9cf7a1c8000bdf6a ;
	Tue, 20 Nov 2012 09:51:07 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKEpd9U028173; 
	Tue, 20 Nov 2012 09:51:40 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Tue, 20 Nov 2012 09:51:35 -0500
Message-Id: <1353423098-16371-3-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 2/5] xen: domctl XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

A number of the domctl XSM hooks do nothing except pass the domain and
operation ID, making them redundant with the xsm_domctl hook. Remove
these redundant hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/domctl.c   |  76 +---------
 xen/common/domctl.c     |  59 +-------
 xen/include/xsm/dummy.h | 135 -----------------
 xen/include/xsm/xsm.h   | 161 ---------------------
 xen/xsm/dummy.c         |  27 ----
 xen/xsm/flask/hooks.c   | 378 ++++++++++++------------------------------------
 6 files changed, 98 insertions(+), 738 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 5e224fc..2630bdb 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -96,10 +96,6 @@ long arch_do_domctl(
 
         page = mfn_to_page(mfn);
 
-        ret = xsm_getpageframeinfo(d);
-        if ( ret )
-            break;
-
         if ( likely(get_page(page, d)) )
         {
             ret = 0;
@@ -140,10 +136,6 @@ long arch_do_domctl(
             struct page_info *page;
             xen_pfn_t *arr;
 
-            ret = xsm_getpageframeinfo(d);
-            if ( ret )
-                break;
-
             if ( unlikely(num > 1024) ||
                  unlikely(num != domctl->u.getpageframeinfo3.num) )
             {
@@ -229,10 +221,6 @@ long arch_do_domctl(
         int num = domctl->u.getpageframeinfo2.num;
         uint32_t *arr32;
 
-        ret = xsm_getpageframeinfo(d);
-        if ( ret )
-            break;
-
         if ( unlikely(num > 1024) )
         {
             ret = -E2BIG;
@@ -324,10 +312,6 @@ long arch_do_domctl(
         uint64_t mfn;
         struct page_info *page;
 
-        ret = xsm_getmemlist(d);
-        if ( ret )
-            break;
-
         if ( unlikely(d->is_dying) ) {
             ret = -EINVAL;
             break;
@@ -363,10 +347,6 @@ long arch_do_domctl(
         struct page_info *page;
         void *hypercall_page;
 
-        ret = xsm_hypercall_init(d);
-        if ( ret )
-            break;
-
         page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
 
         ret = -EACCES;
@@ -391,10 +371,6 @@ long arch_do_domctl(
     { 
         struct hvm_domain_context c = { .size = domctl->u.hvmcontext.size };
 
-        ret = xsm_hvmcontext(d, domctl->cmd);
-        if ( ret )
-            goto sethvmcontext_out;
-
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
             goto sethvmcontext_out;
@@ -421,10 +397,6 @@ long arch_do_domctl(
     { 
         struct hvm_domain_context c = { 0 };
 
-        ret = xsm_hvmcontext(d, domctl->cmd);
-        if ( ret )
-            goto gethvmcontext_out;
-
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
             goto gethvmcontext_out;
@@ -468,10 +440,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_gethvmcontext_partial:
     { 
-        ret = xsm_hvmcontext(d, domctl->cmd);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
             break;
@@ -487,10 +455,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_address_size:
     {
-        ret = xsm_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         switch ( domctl->u.address_size.size )
         {
         case 32:
@@ -508,10 +472,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_get_address_size:
     {
-        ret = xsm_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         domctl->u.address_size.size =
             is_pv_32on64_domain(d) ? 32 : BITS_PER_LONG;
 
@@ -524,10 +484,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_machine_address_size:
     {
-        ret = xsm_machine_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         ret = -EBUSY;
         if ( d->tot_pages > 0 )
             break;
@@ -540,10 +496,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_get_machine_address_size:
     {
-        ret = xsm_machine_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         domctl->u.address_size.size = d->arch.physaddr_bitsize;
 
         ret = 0;
@@ -557,10 +509,6 @@ long arch_do_domctl(
     {
         struct vcpu *v;
 
-        ret = xsm_sendtrigger(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( domctl->u.sendtrigger.vcpu >= MAX_VIRT_CPUS )
             break;
@@ -827,10 +775,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_pin_mem_cacheattr:
     {
-        ret = xsm_pin_mem_cacheattr(d);
-        if ( ret )
-            break;
-
         ret = hvm_set_mem_pinned_cacheattr(
             d, domctl->u.pin_mem_cacheattr.start,
             domctl->u.pin_mem_cacheattr.end,
@@ -846,10 +790,6 @@ long arch_do_domctl(
 
         evc = &domctl->u.ext_vcpucontext;
 
-        ret = xsm_ext_vcpucontext(d, domctl->cmd);
-        if ( ret )
-            break;
-
         ret = -ESRCH;
         if ( (evc->vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[evc->vcpu]) == NULL) )
@@ -1115,10 +1055,6 @@ long arch_do_domctl(
 
         evc = &domctl->u.vcpuextstate;
 
-        ret = xsm_vcpuextstate(d, domctl->cmd);
-        if ( ret )
-            goto vcpuextstate_out;
-
         ret = -ESRCH;
         if ( (evc->vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[evc->vcpu]) == NULL) )
@@ -1229,9 +1165,7 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_mem_sharing_op:
     {
-        ret = xsm_mem_sharing(d);
-        if ( !ret )
-            ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
+        ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
     }
     break;
 
@@ -1262,11 +1196,9 @@ long arch_do_domctl(
         if ( current->domain == d )
             break;
 
-        ret = xsm_mem_event_setup(d);
-        if ( !ret ) {
-            p2m = p2m_get_hostp2m(d);
-            p2m->access_required = domctl->u.access_required.access_required;
-        }
+        ret = 0;
+        p2m = p2m_get_hostp2m(d);
+        p2m->access_required = domctl->u.access_required.access_required;
     }
     break;
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 2a42a5f..6f792e9 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -289,10 +289,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( d == NULL )
             break;
 
-        ret = xsm_setvcpucontext(d);
-        if ( ret )
-            goto svc_out;
-
         ret = -EINVAL;
         if ( (d == current->domain) || /* no domain_pause() */
              (vcpu >= d->max_vcpus) || ((v = d->vcpu[vcpu]) == NULL) )
@@ -339,10 +335,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_pausedomain:
     {
-        ret = xsm_pausedomain(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( d != current->domain )
         {
@@ -354,10 +346,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_unpausedomain:
     {
-        ret = xsm_unpausedomain(d);
-        if ( ret )
-            break;
-
         domain_unpause_by_systemcontroller(d);
         ret = 0;
     }
@@ -365,10 +353,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_resumedomain:
     {
-        ret = xsm_resumedomain(d);
-        if ( ret )
-            break;
-
         domain_resume(d);
         ret = 0;
     }
@@ -452,10 +436,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
              (is_hvm_domain(d) && (max > MAX_HVM_VCPUS)) )
             break;
 
-        ret = xsm_max_vcpus(d);
-        if ( ret )
-            break;
-
         /* Until Xenoprof can dynamically grow its vcpu-s array... */
         if ( d->xenoprof )
         {
@@ -538,7 +518,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_destroydomain:
     {
-        ret = xsm_destroydomain(d) ? : domain_kill(d);
+        ret = domain_kill(d);
     }
     break;
 
@@ -547,10 +527,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     {
         struct vcpu *v;
 
-        ret = xsm_vcpuaffinity(op->cmd, d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( op->u.vcpuaffinity.vcpu >= d->max_vcpus )
             break;
@@ -581,10 +557,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_scheduler_op:
     {
-        ret = xsm_scheduler(d);
-        if ( ret )
-            break;
-
         ret = sched_adjust(d, &op->u.scheduler_op);
         if ( copy_to_guest(u_domctl, op, 1) )
             ret = -EFAULT;
@@ -629,10 +601,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         vcpu_guest_context_u c = { .nat = NULL };
         struct vcpu         *v;
 
-        ret = xsm_getvcpucontext(d);
-        if ( ret )
-            goto getvcpucontext_out;
-
         ret = -EINVAL;
         if ( op->u.vcpucontext.vcpu >= d->max_vcpus )
             goto getvcpucontext_out;
@@ -685,10 +653,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         struct vcpu   *v;
         struct vcpu_runstate_info runstate;
 
-        ret = xsm_getvcpuinfo(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( op->u.getvcpuinfo.vcpu >= d->max_vcpus )
             break;
@@ -715,10 +679,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     {
         unsigned long new_max;
 
-        ret = xsm_setdomainmaxmem(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         new_max = op->u.max_mem.max_memkb >> (PAGE_SHIFT-10);
 
@@ -736,10 +696,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_setdomainhandle:
     {
-        ret = xsm_setdomainhandle(d);
-        if ( ret )
-            break;
-
         memcpy(d->handle, op->u.setdomainhandle.handle,
                sizeof(xen_domain_handle_t));
         ret = 0;
@@ -752,10 +708,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( d == current->domain ) /* no domain_pause() */
             break;
 
-        ret = xsm_setdebugging(d);
-        if ( ret )
-            break;
-
         domain_pause(d);
         d->debugger_attached = !!op->u.setdebugging.enable;
         domain_unpause(d); /* causes guest to latch new status */
@@ -800,10 +752,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_settimeoffset:
     {
-        ret = xsm_domain_settime(d);
-        if ( ret )
-            break;
-
         domain_set_time_offset(d, op->u.settimeoffset.time_offset_seconds);
         ret = 0;
     }
@@ -853,10 +801,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     case XEN_DOMCTL_set_virq_handler:
     {
         uint32_t virq = op->u.set_virq_handler.virq;
-
-        ret = xsm_set_virq_handler(d, virq);
-        if ( !ret )
-            ret = set_global_virq_handler(d, virq);
+        ret = set_global_virq_handler(d, virq);
     }
     break;
 
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index fa78785..aef7c4e 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -17,71 +17,16 @@ static XSM_INLINE void xsm_security_domaininfo(struct domain *d,
     return;
 }
 
-static XSM_INLINE int xsm_setvcpucontext(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_pausedomain(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_unpausedomain(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_resumedomain(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_domain_create(struct domain *d, u32 ssidref)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_max_vcpus(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_destroydomain(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_vcpuaffinity(int cmd, struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_scheduler(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_getvcpucontext(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getvcpuinfo(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_domain_settime(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
 {
     return 0;
@@ -113,11 +58,6 @@ static XSM_INLINE int xsm_sysctl(int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_set_virq_handler(struct domain *d, uint32_t virq)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_tbufcontrol(void)
 {
     return 0;
@@ -133,21 +73,6 @@ static XSM_INLINE int xsm_sched_id(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_setdomainmaxmem(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_setdomainhandle(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_setdebugging(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_perfcontrol(void)
 {
     return 0;
@@ -505,36 +430,6 @@ static XSM_INLINE int xsm_shadow_control(struct domain *d, uint32_t op)
     return 0;
 }
 
-static XSM_INLINE int xsm_getpageframeinfo(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getmemlist(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_hypercall_init(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_hvmcontext(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_address_size(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_machine_address_size(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
@@ -570,11 +465,6 @@ static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_event_setup(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_mem_event_control(struct domain *d, int mode, int op)
 {
     if ( !IS_PRIV(current->domain) )
@@ -589,11 +479,6 @@ static XSM_INLINE int xsm_mem_event_op(struct domain *d, int op)
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_sharing(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, cd) )
@@ -720,11 +605,6 @@ static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *
     return 0;
 }
 
-static XSM_INLINE int xsm_sendtrigger(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
@@ -735,21 +615,6 @@ static XSM_INLINE int xsm_unbind_pt_irq(struct domain *d, struct xen_domctl_bind
     return 0;
 }
 
-static XSM_INLINE int xsm_pin_mem_cacheattr(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index b2f33d6..903c7cb 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -41,29 +41,14 @@ extern xsm_initcall_t __xsm_initcall_start[], __xsm_initcall_end[];
 struct xsm_operations {
     void (*security_domaininfo) (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info);
-    int (*setvcpucontext) (struct domain *d);
-    int (*pausedomain) (struct domain *d);
-    int (*unpausedomain) (struct domain *d);
-    int (*resumedomain) (struct domain *d);
     int (*domain_create) (struct domain *d, u32 ssidref);
-    int (*max_vcpus) (struct domain *d);
-    int (*destroydomain) (struct domain *d);
-    int (*vcpuaffinity) (int cmd, struct domain *d);
-    int (*scheduler) (struct domain *d);
     int (*getdomaininfo) (struct domain *d);
-    int (*getvcpucontext) (struct domain *d);
-    int (*getvcpuinfo) (struct domain *d);
-    int (*domain_settime) (struct domain *d);
     int (*set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
     int (*sysctl) (int cmd);
-    int (*set_virq_handler) (struct domain *d, uint32_t virq);
     int (*tbufcontrol) (void);
     int (*readconsole) (uint32_t clear);
     int (*sched_id) (void);
-    int (*setdomainmaxmem) (struct domain *d);
-    int (*setdomainhandle) (struct domain *d);
-    int (*setdebugging) (struct domain *d);
     int (*perfcontrol) (void);
     int (*debug_keys) (void);
     int (*getcpuinfo) (void);
@@ -141,21 +126,13 @@ struct xsm_operations {
 
 #ifdef CONFIG_X86
     int (*shadow_control) (struct domain *d, uint32_t op);
-    int (*getpageframeinfo) (struct domain *d);
-    int (*getmemlist) (struct domain *d);
-    int (*hypercall_init) (struct domain *d);
-    int (*hvmcontext) (struct domain *d, uint32_t op);
-    int (*address_size) (struct domain *d, uint32_t op);
-    int (*machine_address_size) (struct domain *d, uint32_t op);
     int (*hvm_param) (struct domain *d, unsigned long op);
     int (*hvm_set_pci_intx_level) (struct domain *d);
     int (*hvm_set_isa_irq_level) (struct domain *d);
     int (*hvm_set_pci_link_route) (struct domain *d);
     int (*hvm_inject_msi) (struct domain *d);
-    int (*mem_event_setup) (struct domain *d);
     int (*mem_event_control) (struct domain *d, int mode, int op);
     int (*mem_event_op) (struct domain *d, int op);
-    int (*mem_sharing) (struct domain *d);
     int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
     int (*apic) (struct domain *d, int cmd);
     int (*xen_settime) (void);
@@ -180,12 +157,8 @@ struct xsm_operations {
     int (*mmuext_op) (struct domain *d, struct domain *f);
     int (*update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
-    int (*sendtrigger) (struct domain *d);
     int (*bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
     int (*unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*pin_mem_cacheattr) (struct domain *d);
-    int (*ext_vcpucontext) (struct domain *d, uint32_t cmd);
-    int (*vcpuextstate) (struct domain *d, uint32_t cmd);
     int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
     int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
 #endif
@@ -203,71 +176,16 @@ static inline void xsm_security_domaininfo (struct domain *d,
     xsm_ops->security_domaininfo(d, info);
 }
 
-static inline int xsm_setvcpucontext(struct domain *d)
-{
-    return xsm_ops->setvcpucontext(d);
-}
-
-static inline int xsm_pausedomain (struct domain *d)
-{
-    return xsm_ops->pausedomain(d);
-}
-
-static inline int xsm_unpausedomain (struct domain *d)
-{
-    return xsm_ops->unpausedomain(d);
-}
-
-static inline int xsm_resumedomain (struct domain *d)
-{
-    return xsm_ops->resumedomain(d);
-}
-
 static inline int xsm_domain_create (struct domain *d, u32 ssidref)
 {
     return xsm_ops->domain_create(d, ssidref);
 }
 
-static inline int xsm_max_vcpus(struct domain *d)
-{
-    return xsm_ops->max_vcpus(d);
-}
-
-static inline int xsm_destroydomain (struct domain *d)
-{
-    return xsm_ops->destroydomain(d);
-}
-
-static inline int xsm_vcpuaffinity (int cmd, struct domain *d)
-{
-    return xsm_ops->vcpuaffinity(cmd, d);
-}
-
-static inline int xsm_scheduler (struct domain *d)
-{
-    return xsm_ops->scheduler(d);
-}
-
 static inline int xsm_getdomaininfo (struct domain *d)
 {
     return xsm_ops->getdomaininfo(d);
 }
 
-static inline int xsm_getvcpucontext (struct domain *d)
-{
-    return xsm_ops->getvcpucontext(d);
-}
-
-static inline int xsm_getvcpuinfo (struct domain *d)
-{
-    return xsm_ops->getvcpuinfo(d);
-}
-
-static inline int xsm_domain_settime (struct domain *d)
-{
-    return xsm_ops->domain_settime(d);
-}
-
 static inline int xsm_set_target (struct domain *d, struct domain *e)
 {
     return xsm_ops->set_target(d, e);
@@ -283,11 +201,6 @@ static inline int xsm_sysctl (int cmd)
     return xsm_ops->sysctl(cmd);
 }
 
-static inline int xsm_set_virq_handler (struct domain *d, uint32_t virq)
-{
-    return xsm_ops->set_virq_handler(d, virq);
-}
-
 static inline int xsm_tbufcontrol (void)
 {
     return xsm_ops->tbufcontrol();
@@ -303,21 +216,6 @@ static inline int xsm_sched_id (void)
     return xsm_ops->sched_id();
 }
 
-static inline int xsm_setdomainmaxmem (struct domain *d)
-{
-    return xsm_ops->setdomainmaxmem(d);
-}
-
-static inline int xsm_setdomainhandle (struct domain *d)
-{
-    return xsm_ops->setdomainhandle(d);
-}
-
-static inline int xsm_setdebugging (struct domain *d)
-{
-    return xsm_ops->setdebugging(d);
-}
-
 static inline int xsm_perfcontrol (void)
 {
     return xsm_ops->perfcontrol();
@@ -635,36 +533,6 @@ static inline int xsm_shadow_control (struct domain *d, uint32_t op)
     return xsm_ops->shadow_control(d, op);
 }
 
-static inline int xsm_getpageframeinfo (struct domain *d)
-{
-    return xsm_ops->getpageframeinfo(d);
-}
-
-static inline int xsm_getmemlist (struct domain *d)
-{
-    return xsm_ops->getmemlist(d);
-}
-
-static inline int xsm_hypercall_init (struct domain *d)
-{
-    return xsm_ops->hypercall_init(d);
-}
-
-static inline int xsm_hvmcontext (struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->hvmcontext(d, cmd);
-}
-
-static inline int xsm_address_size (struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->address_size(d, cmd);
-}
-
-static inline int xsm_machine_address_size (struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->machine_address_size(d, cmd);
-}
-
 static inline int xsm_hvm_param (struct domain *d, unsigned long op)
 {
     return xsm_ops->hvm_param(d, op);
@@ -690,11 +558,6 @@ static inline int xsm_hvm_inject_msi (struct domain *d)
     return xsm_ops->hvm_inject_msi(d);
 }
 
-static inline int xsm_mem_event_setup (struct domain *d)
-{
-    return xsm_ops->mem_event_setup(d);
-}
-
 static inline int xsm_mem_event_control (struct domain *d, int mode, int op)
 {
     return xsm_ops->mem_event_control(d, mode, op);
@@ -705,11 +568,6 @@ static inline int xsm_mem_event_op (struct domain *d, int op)
     return xsm_ops->mem_event_op(d, op);
 }
 
-static inline int xsm_mem_sharing (struct domain *d)
-{
-    return xsm_ops->mem_sharing(d);
-}
-
 static inline int xsm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
 {
     return xsm_ops->mem_sharing_op(d, cd, op);
@@ -807,11 +665,6 @@ static inline int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
     return xsm_ops->add_to_physmap(d1, d2);
 }
 
-static inline int xsm_sendtrigger(struct domain *d)
-{
-    return xsm_ops->sendtrigger(d);
-}
-
 static inline int xsm_bind_pt_irq(struct domain *d, 
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
@@ -824,20 +677,6 @@ static inline int xsm_unbind_pt_irq(struct domain *d,
     return xsm_ops->unbind_pt_irq(d, bind);
 }
 
-static inline int xsm_pin_mem_cacheattr(struct domain *d)
-{
-    return xsm_ops->pin_mem_cacheattr(d);
-}
-
-static inline int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->ext_vcpucontext(d, cmd);
-}
-static inline int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->vcpuextstate(d, cmd);
-}
-
 static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return xsm_ops->ioport_permission(d, s, e, allow);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 3e6e5df..9bb86ef 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -30,29 +30,14 @@ struct xsm_operations dummy_xsm_ops;
 void xsm_fixup_ops (struct xsm_operations *ops)
 {
     set_to_dummy_if_null(ops, security_domaininfo);
-    set_to_dummy_if_null(ops, setvcpucontext);
-    set_to_dummy_if_null(ops, pausedomain);
-    set_to_dummy_if_null(ops, unpausedomain);
-    set_to_dummy_if_null(ops, resumedomain);
     set_to_dummy_if_null(ops, domain_create);
-    set_to_dummy_if_null(ops, max_vcpus);
-    set_to_dummy_if_null(ops, destroydomain);
-    set_to_dummy_if_null(ops, vcpuaffinity);
-    set_to_dummy_if_null(ops, scheduler);
     set_to_dummy_if_null(ops, getdomaininfo);
-    set_to_dummy_if_null(ops, getvcpucontext);
-    set_to_dummy_if_null(ops, getvcpuinfo);
-    set_to_dummy_if_null(ops, domain_settime);
     set_to_dummy_if_null(ops, set_target);
     set_to_dummy_if_null(ops, domctl);
     set_to_dummy_if_null(ops, sysctl);
-    set_to_dummy_if_null(ops, set_virq_handler);
     set_to_dummy_if_null(ops, tbufcontrol);
     set_to_dummy_if_null(ops, readconsole);
     set_to_dummy_if_null(ops, sched_id);
-    set_to_dummy_if_null(ops, setdomainmaxmem);
-    set_to_dummy_if_null(ops, setdomainhandle);
-    set_to_dummy_if_null(ops, setdebugging);
     set_to_dummy_if_null(ops, perfcontrol);
     set_to_dummy_if_null(ops, debug_keys);
     set_to_dummy_if_null(ops, getcpuinfo);
@@ -128,21 +113,13 @@ void xsm_fixup_ops (struct xsm_operations *ops)
 
 #ifdef CONFIG_X86
     set_to_dummy_if_null(ops, shadow_control);
-    set_to_dummy_if_null(ops, getpageframeinfo);
-    set_to_dummy_if_null(ops, getmemlist);
-    set_to_dummy_if_null(ops, hypercall_init);
-    set_to_dummy_if_null(ops, hvmcontext);
-    set_to_dummy_if_null(ops, address_size);
-    set_to_dummy_if_null(ops, machine_address_size);
     set_to_dummy_if_null(ops, hvm_param);
     set_to_dummy_if_null(ops, hvm_set_pci_intx_level);
     set_to_dummy_if_null(ops, hvm_set_isa_irq_level);
     set_to_dummy_if_null(ops, hvm_set_pci_link_route);
     set_to_dummy_if_null(ops, hvm_inject_msi);
-    set_to_dummy_if_null(ops, mem_event_setup);
     set_to_dummy_if_null(ops, mem_event_control);
     set_to_dummy_if_null(ops, mem_event_op);
-    set_to_dummy_if_null(ops, mem_sharing);
     set_to_dummy_if_null(ops, mem_sharing_op);
     set_to_dummy_if_null(ops, apic);
     set_to_dummy_if_null(ops, xen_settime);
@@ -163,12 +140,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, update_va_mapping);
     set_to_dummy_if_null(ops, add_to_physmap);
     set_to_dummy_if_null(ops, remove_from_physmap);
-    set_to_dummy_if_null(ops, sendtrigger);
     set_to_dummy_if_null(ops, bind_pt_irq);
     set_to_dummy_if_null(ops, unbind_pt_irq);
-    set_to_dummy_if_null(ops, pin_mem_cacheattr);
-    set_to_dummy_if_null(ops, ext_vcpucontext);
-    set_to_dummy_if_null(ops, vcpuextstate);
     set_to_dummy_if_null(ops, ioport_permission);
     set_to_dummy_if_null(ops, ioport_mapping);
 #endif
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index e815ea5..f0216e0 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -484,26 +484,6 @@ static void flask_security_domaininfo(struct domain *d,
     info->ssidref = domain_sid(d);
 }
 
-static int flask_setvcpucontext(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT);
-}
-
-static int flask_pausedomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
-}
-
-static int flask_unpausedomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
-}
-
-static int flask_resumedomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__RESUME);
-}
-
 static int flask_domain_create(struct domain *d, u32 ssidref)
 {
     int rc;
@@ -532,66 +512,11 @@ static int flask_domain_create(struct domain *d, u32 ssidref)
     return rc;
 }
 
-static int flask_max_vcpus(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS);
-}
-
-static int flask_destroydomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__DESTROY);
-}
-
-static int flask_vcpuaffinity(int cmd, struct domain *d)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_setvcpuaffinity:
-        perm = DOMAIN__SETVCPUAFFINITY;
-        break;
-    case XEN_DOMCTL_getvcpuaffinity:
-        perm = DOMAIN__GETVCPUAFFINITY;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm );
-}
-
-static int flask_scheduler(struct domain *d)
-{
-    int rc = 0;
-
-    rc = domain_has_xen(current->domain, XEN__SCHEDULER);
-    if ( rc )
-        return rc;
-
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SCHEDULER);
-}
-
 static int flask_getdomaininfo(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO);
 }
 
-static int flask_getvcpucontext(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT);
-}
-
-static int flask_getvcpuinfo(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO);
-}
-
-static int flask_domain_settime(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
-}
-
 static int flask_set_target(struct domain *d, struct domain *t)
 {
     int rc;
@@ -622,62 +547,121 @@ static int flask_domctl(struct domain *d, int cmd)
     {
     /* These have individual XSM hooks (common/domctl.c) */
     case XEN_DOMCTL_createdomain:
+    case XEN_DOMCTL_getdomaininfo:
+    case XEN_DOMCTL_irq_permission:
+    case XEN_DOMCTL_iomem_permission:
+    case XEN_DOMCTL_set_target:
+#ifdef CONFIG_X86
+    /* These have individual XSM hooks (arch/x86/domctl.c) */
+    case XEN_DOMCTL_shadow_op:
+    case XEN_DOMCTL_ioport_permission:
+    case XEN_DOMCTL_bind_pt_irq:
+    case XEN_DOMCTL_unbind_pt_irq:
+    case XEN_DOMCTL_memory_mapping:
+    case XEN_DOMCTL_ioport_mapping:
+    case XEN_DOMCTL_mem_event_op:
+    /* These have individual XSM hooks (drivers/passthrough/iommu.c) */
+    case XEN_DOMCTL_get_device_group:
+    case XEN_DOMCTL_test_assign_device:
+    case XEN_DOMCTL_assign_device:
+    case XEN_DOMCTL_deassign_device:
+#endif
+        return 0;
+
     case XEN_DOMCTL_destroydomain:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__DESTROY);
+
     case XEN_DOMCTL_pausedomain:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
+
     case XEN_DOMCTL_unpausedomain:
-    case XEN_DOMCTL_getdomaininfo:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
+
     case XEN_DOMCTL_setvcpuaffinity:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUAFFINITY);
+
+    case XEN_DOMCTL_getvcpuaffinity:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUAFFINITY);
+
+    case XEN_DOMCTL_resumedomain:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__RESUME);
+
+    case XEN_DOMCTL_scheduler_op:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SCHEDULER);
+
+    case XEN_DOMCTL_max_vcpus:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS);
+
     case XEN_DOMCTL_max_mem:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM);
+
+    case XEN_DOMCTL_setdomainhandle:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE);
+
     case XEN_DOMCTL_setvcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT);
+
     case XEN_DOMCTL_getvcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT);
+
     case XEN_DOMCTL_getvcpuinfo:
-    case XEN_DOMCTL_max_vcpus:
-    case XEN_DOMCTL_scheduler_op:
-    case XEN_DOMCTL_setdomainhandle:
-    case XEN_DOMCTL_setdebugging:
-    case XEN_DOMCTL_irq_permission:
-    case XEN_DOMCTL_iomem_permission:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO);
+
     case XEN_DOMCTL_settimeoffset:
-    case XEN_DOMCTL_getvcpuaffinity:
-    case XEN_DOMCTL_resumedomain:
-    case XEN_DOMCTL_set_target:
-    case XEN_DOMCTL_set_virq_handler:
-#ifdef CONFIG_X86
-    /* These have individual XSM hooks (arch/x86/domctl.c) */
-    case XEN_DOMCTL_shadow_op:
-    case XEN_DOMCTL_ioport_permission:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
+
+    case XEN_DOMCTL_setdebugging:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
+
     case XEN_DOMCTL_getpageframeinfo:
     case XEN_DOMCTL_getpageframeinfo2:
     case XEN_DOMCTL_getpageframeinfo3:
+        return current_has_perm(d, SECCLASS_MMU, MMU__PAGEINFO);
+
     case XEN_DOMCTL_getmemlist:
+        return current_has_perm(d, SECCLASS_MMU, MMU__PAGELIST);
+
     case XEN_DOMCTL_hypercall_init:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__HYPERCALL);
+
     case XEN_DOMCTL_sethvmcontext:
+        return current_has_perm(d, SECCLASS_HVM, HVM__SETHVMC);
+
     case XEN_DOMCTL_gethvmcontext:
     case XEN_DOMCTL_gethvmcontext_partial:
+        return current_has_perm(d, SECCLASS_HVM, HVM__GETHVMC);
+
     case XEN_DOMCTL_set_address_size:
-    case XEN_DOMCTL_get_address_size:
     case XEN_DOMCTL_set_machine_address_size:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETADDRSIZE);
+
+    case XEN_DOMCTL_get_address_size:
     case XEN_DOMCTL_get_machine_address_size:
-    case XEN_DOMCTL_sendtrigger:
-    case XEN_DOMCTL_bind_pt_irq:
-    case XEN_DOMCTL_unbind_pt_irq:
-    case XEN_DOMCTL_memory_mapping:
-    case XEN_DOMCTL_ioport_mapping:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETADDRSIZE);
+
+    case XEN_DOMCTL_mem_sharing_op:
+        return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
+
     case XEN_DOMCTL_pin_mem_cacheattr:
+        return current_has_perm(d, SECCLASS_HVM, HVM__CACHEATTR);
+
     case XEN_DOMCTL_set_ext_vcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETEXTVCPUCONTEXT);
+
     case XEN_DOMCTL_get_ext_vcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETEXTVCPUCONTEXT);
+
     case XEN_DOMCTL_setvcpuextstate:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUEXTSTATE);
+
     case XEN_DOMCTL_getvcpuextstate:
-    case XEN_DOMCTL_mem_event_op:
-    case XEN_DOMCTL_mem_sharing_op:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUEXTSTATE);
+
+    case XEN_DOMCTL_sendtrigger:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
+
     case XEN_DOMCTL_set_access_required:
-    /* These have individual XSM hooks (drivers/passthrough/iommu.c) */
-    case XEN_DOMCTL_get_device_group:
-    case XEN_DOMCTL_test_assign_device:
-    case XEN_DOMCTL_assign_device:
-    case XEN_DOMCTL_deassign_device:
-#endif
-        return 0;
+        return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 
     case XEN_DOMCTL_debug_op:
     case XEN_DOMCTL_gdbsx_guestmemio:
@@ -691,6 +675,9 @@ static int flask_domctl(struct domain *d, int cmd)
     case XEN_DOMCTL_suppress_spurious_page_faults:
         return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO);
 
+    case XEN_DOMCTL_set_virq_handler:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
+
     case XEN_DOMCTL_set_cpuid:
         return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID);
 
@@ -741,11 +728,6 @@ static int flask_sysctl(int cmd)
     }
 }
 
-static int flask_set_virq_handler(struct domain *d, uint32_t virq)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
-}
-
 static int flask_tbufcontrol(void)
 {
     return domain_has_xen(current->domain, XEN__TBUFCONTROL);
@@ -766,21 +748,6 @@ static int flask_sched_id(void)
     return domain_has_xen(current->domain, XEN__SCHEDULER);
 }
 
-static int flask_setdomainmaxmem(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM);
-}
-
-static int flask_setdomainhandle(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE);
-}
-
-static int flask_setdebugging(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
-}
-
 static int flask_debug_keys(void)
 {
     return domain_has_xen(current->domain, XEN__DEBUG);
@@ -1174,82 +1141,6 @@ static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end,
     return flask_ioport_permission(d, start, end, access);
 }
 
-static int flask_getpageframeinfo(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_MMU, MMU__PAGEINFO);
-}
-
-static int flask_getmemlist(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_MMU, MMU__PAGELIST);
-}
-
-static int flask_hypercall_init(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__HYPERCALL);
-}
-
-static int flask_hvmcontext(struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_sethvmcontext:
-        perm = HVM__SETHVMC;
-        break;
-    case XEN_DOMCTL_gethvmcontext:
-    case XEN_DOMCTL_gethvmcontext_partial:
-        perm = HVM__GETHVMC;
-        break;
-    case HVMOP_track_dirty_vram:
-        perm = HVM__TRACKDIRTYVRAM;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_HVM, perm);
-}
-
-static int flask_address_size(struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_set_address_size:
-        perm = DOMAIN__SETADDRSIZE;
-        break;
-    case XEN_DOMCTL_get_address_size:
-        perm = DOMAIN__GETADDRSIZE;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm);
-}
-
-static int flask_machine_address_size(struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_set_machine_address_size:
-        perm = DOMAIN__SETADDRSIZE;
-        break;
-    case XEN_DOMCTL_get_machine_address_size:
-        perm = DOMAIN__GETADDRSIZE;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
-}
-
 static int flask_hvm_param(struct domain *d, unsigned long op)
 {
     u32 perm;
@@ -1292,11 +1183,6 @@ static int flask_hvm_inject_msi(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
-static int flask_mem_event_setup(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
-}
-
 static int flask_mem_event_control(struct domain *d, int mode, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
@@ -1307,11 +1193,6 @@ static int flask_mem_event_op(struct domain *d, int op)
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
 
-static int flask_mem_sharing(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
-}
-
 static int flask_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     int rc = current_has_perm(cd, SECCLASS_HVM, HVM__MEM_SHARING);
@@ -1499,11 +1380,6 @@ static int flask_remove_from_physmap(struct domain *d1, struct domain *d2)
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP);
 }
 
-static int flask_sendtrigger(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
-}
-
 static int flask_get_device_group(uint32_t machine_bdf)
 {
     u32 rsid;
@@ -1597,78 +1473,20 @@ static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq
 {
     return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
-
-static int flask_pin_mem_cacheattr (struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__CACHEATTR);
-}
-
-static int flask_ext_vcpucontext (struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_set_ext_vcpucontext:
-        perm = DOMAIN__SETEXTVCPUCONTEXT;
-        break;
-    case XEN_DOMCTL_get_ext_vcpucontext:
-        perm = DOMAIN__GETEXTVCPUCONTEXT;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm);
-}
-
-static int flask_vcpuextstate (struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-        case XEN_DOMCTL_setvcpuextstate:
-            perm = DOMAIN__SETVCPUEXTSTATE;
-        break;
-        case XEN_DOMCTL_getvcpuextstate:
-            perm = DOMAIN__GETVCPUEXTSTATE;
-        break;
-        default:
-            return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm);
-}
 #endif
 
 long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
 
 static struct xsm_operations flask_ops = {
     .security_domaininfo = flask_security_domaininfo,
-    .setvcpucontext = flask_setvcpucontext,
-    .pausedomain = flask_pausedomain,
-    .unpausedomain = flask_unpausedomain,    
-    .resumedomain = flask_resumedomain,    
     .domain_create = flask_domain_create,
-    .max_vcpus = flask_max_vcpus,
-    .destroydomain = flask_destroydomain,
-    .vcpuaffinity = flask_vcpuaffinity,
-    .scheduler = flask_scheduler,
     .getdomaininfo = flask_getdomaininfo,
-    .getvcpucontext = flask_getvcpucontext,
-    .getvcpuinfo = flask_getvcpuinfo,
-    .domain_settime = flask_domain_settime,
     .set_target = flask_set_target,
     .domctl = flask_domctl,
     .sysctl = flask_sysctl,
-    .set_virq_handler = flask_set_virq_handler,
     .tbufcontrol = flask_tbufcontrol,
     .readconsole = flask_readconsole,
     .sched_id = flask_sched_id,
-    .setdomainmaxmem = flask_setdomainmaxmem,
-    .setdomainhandle = flask_setdomainhandle,
-    .setdebugging = flask_setdebugging,
     .perfcontrol = flask_perfcontrol,
     .debug_keys = flask_debug_keys,
     .getcpuinfo = flask_getcpuinfo,
@@ -1740,21 +1558,13 @@ static struct xsm_operations flask_ops = {
 
 #ifdef CONFIG_X86
     .shadow_control = flask_shadow_control,
-    .getpageframeinfo = flask_getpageframeinfo,
-    .getmemlist = flask_getmemlist,
-    .hypercall_init = flask_hypercall_init,
-    .hvmcontext = flask_hvmcontext,
-    .address_size = flask_address_size,
-    .machine_address_size = flask_machine_address_size,
     .hvm_param = flask_hvm_param,
     .hvm_set_pci_intx_level = flask_hvm_set_pci_intx_level,
     .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
     .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
     .hvm_inject_msi = flask_hvm_inject_msi,
-    .mem_event_setup = flask_mem_event_setup,
     .mem_event_control = flask_mem_event_control,
     .mem_event_op = flask_mem_event_op,
-    .mem_sharing = flask_mem_sharing,
     .mem_sharing_op = flask_mem_sharing_op,
     .apic = flask_apic,
     .xen_settime = flask_xen_settime,
@@ -1775,16 +1585,12 @@ static struct xsm_operations flask_ops = {
     .update_va_mapping = flask_update_va_mapping,
     .add_to_physmap = flask_add_to_physmap,
     .remove_from_physmap = flask_remove_from_physmap,
-    .sendtrigger = flask_sendtrigger,
     .get_device_group = flask_get_device_group,
     .test_assign_device = flask_test_assign_device,
     .assign_device = flask_assign_device,
     .deassign_device = flask_deassign_device,
     .bind_pt_irq = flask_bind_pt_irq,
     .unbind_pt_irq = flask_unbind_pt_irq,
-    .pin_mem_cacheattr = flask_pin_mem_cacheattr,
-    .ext_vcpucontext = flask_ext_vcpucontext,
-    .vcpuextstate = flask_vcpuextstate,
     .ioport_permission = flask_ioport_permission,
     .ioport_mapping = flask_ioport_mapping,
 #endif
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:52:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:52:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapB4-0007bS-3J; Tue, 20 Nov 2012 14:51:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TapB2-0007aa-EZ
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:51:52 +0000
Received: from [85.158.143.99:24462] by server-1.bemta-4.messagelabs.com id
	BE/49-27934-8099BA05; Tue, 20 Nov 2012 14:51:52 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-10.tower-216.messagelabs.com!1353423108!21545558!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5092 invoked from network); 20 Nov 2012 14:51:48 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-10.tower-216.messagelabs.com with SMTP;
	20 Nov 2012 14:51:48 -0000
X-TM-IMSS-Message-ID: <9cf7a1c8000bdf6a@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9cf7a1c8000bdf6a ;
	Tue, 20 Nov 2012 09:51:07 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKEpd9U028173; 
	Tue, 20 Nov 2012 09:51:40 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Tue, 20 Nov 2012 09:51:35 -0500
Message-Id: <1353423098-16371-3-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 2/5] xen: domctl XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

A number of the domctl XSM hooks do nothing except pass the domain and
operation ID, making them redundant with the xsm_domctl hook. Remove
these redundant hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/domctl.c   |  76 +---------
 xen/common/domctl.c     |  59 +-------
 xen/include/xsm/dummy.h | 135 -----------------
 xen/include/xsm/xsm.h   | 161 ---------------------
 xen/xsm/dummy.c         |  27 ----
 xen/xsm/flask/hooks.c   | 378 ++++++++++++------------------------------------
 6 files changed, 98 insertions(+), 738 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 5e224fc..2630bdb 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -96,10 +96,6 @@ long arch_do_domctl(
 
         page = mfn_to_page(mfn);
 
-        ret = xsm_getpageframeinfo(d);
-        if ( ret )
-            break;
-
         if ( likely(get_page(page, d)) )
         {
             ret = 0;
@@ -140,10 +136,6 @@ long arch_do_domctl(
             struct page_info *page;
             xen_pfn_t *arr;
 
-            ret = xsm_getpageframeinfo(d);
-            if ( ret )
-                break;
-
             if ( unlikely(num > 1024) ||
                  unlikely(num != domctl->u.getpageframeinfo3.num) )
             {
@@ -229,10 +221,6 @@ long arch_do_domctl(
         int num = domctl->u.getpageframeinfo2.num;
         uint32_t *arr32;
 
-        ret = xsm_getpageframeinfo(d);
-        if ( ret )
-            break;
-
         if ( unlikely(num > 1024) )
         {
             ret = -E2BIG;
@@ -324,10 +312,6 @@ long arch_do_domctl(
         uint64_t mfn;
         struct page_info *page;
 
-        ret = xsm_getmemlist(d);
-        if ( ret )
-            break;
-
         if ( unlikely(d->is_dying) ) {
             ret = -EINVAL;
             break;
@@ -363,10 +347,6 @@ long arch_do_domctl(
         struct page_info *page;
         void *hypercall_page;
 
-        ret = xsm_hypercall_init(d);
-        if ( ret )
-            break;
-
         page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
 
         ret = -EACCES;
@@ -391,10 +371,6 @@ long arch_do_domctl(
     { 
         struct hvm_domain_context c = { .size = domctl->u.hvmcontext.size };
 
-        ret = xsm_hvmcontext(d, domctl->cmd);
-        if ( ret )
-            goto sethvmcontext_out;
-
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
             goto sethvmcontext_out;
@@ -421,10 +397,6 @@ long arch_do_domctl(
     { 
         struct hvm_domain_context c = { 0 };
 
-        ret = xsm_hvmcontext(d, domctl->cmd);
-        if ( ret )
-            goto gethvmcontext_out;
-
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
             goto gethvmcontext_out;
@@ -468,10 +440,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_gethvmcontext_partial:
     { 
-        ret = xsm_hvmcontext(d, domctl->cmd);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
             break;
@@ -487,10 +455,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_address_size:
     {
-        ret = xsm_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         switch ( domctl->u.address_size.size )
         {
         case 32:
@@ -508,10 +472,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_get_address_size:
     {
-        ret = xsm_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         domctl->u.address_size.size =
             is_pv_32on64_domain(d) ? 32 : BITS_PER_LONG;
 
@@ -524,10 +484,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_machine_address_size:
     {
-        ret = xsm_machine_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         ret = -EBUSY;
         if ( d->tot_pages > 0 )
             break;
@@ -540,10 +496,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_get_machine_address_size:
     {
-        ret = xsm_machine_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         domctl->u.address_size.size = d->arch.physaddr_bitsize;
 
         ret = 0;
@@ -557,10 +509,6 @@ long arch_do_domctl(
     {
         struct vcpu *v;
 
-        ret = xsm_sendtrigger(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( domctl->u.sendtrigger.vcpu >= MAX_VIRT_CPUS )
             break;
@@ -827,10 +775,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_pin_mem_cacheattr:
     {
-        ret = xsm_pin_mem_cacheattr(d);
-        if ( ret )
-            break;
-
         ret = hvm_set_mem_pinned_cacheattr(
             d, domctl->u.pin_mem_cacheattr.start,
             domctl->u.pin_mem_cacheattr.end,
@@ -846,10 +790,6 @@ long arch_do_domctl(
 
         evc = &domctl->u.ext_vcpucontext;
 
-        ret = xsm_ext_vcpucontext(d, domctl->cmd);
-        if ( ret )
-            break;
-
         ret = -ESRCH;
         if ( (evc->vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[evc->vcpu]) == NULL) )
@@ -1115,10 +1055,6 @@ long arch_do_domctl(
 
         evc = &domctl->u.vcpuextstate;
 
-        ret = xsm_vcpuextstate(d, domctl->cmd);
-        if ( ret )
-            goto vcpuextstate_out;
-
         ret = -ESRCH;
         if ( (evc->vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[evc->vcpu]) == NULL) )
@@ -1229,9 +1165,7 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_mem_sharing_op:
     {
-        ret = xsm_mem_sharing(d);
-        if ( !ret )
-            ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
+        ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
     }
     break;
 
@@ -1262,11 +1196,9 @@ long arch_do_domctl(
         if ( current->domain == d )
             break;
 
-        ret = xsm_mem_event_setup(d);
-        if ( !ret ) {
-            p2m = p2m_get_hostp2m(d);
-            p2m->access_required = domctl->u.access_required.access_required;
-        }
+        ret = 0;
+        p2m = p2m_get_hostp2m(d);
+        p2m->access_required = domctl->u.access_required.access_required;
     }
     break;
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 2a42a5f..6f792e9 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -289,10 +289,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( d == NULL )
             break;
 
-        ret = xsm_setvcpucontext(d);
-        if ( ret )
-            goto svc_out;
-
         ret = -EINVAL;
         if ( (d == current->domain) || /* no domain_pause() */
              (vcpu >= d->max_vcpus) || ((v = d->vcpu[vcpu]) == NULL) )
@@ -339,10 +335,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_pausedomain:
     {
-        ret = xsm_pausedomain(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( d != current->domain )
         {
@@ -354,10 +346,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_unpausedomain:
     {
-        ret = xsm_unpausedomain(d);
-        if ( ret )
-            break;
-
         domain_unpause_by_systemcontroller(d);
         ret = 0;
     }
@@ -365,10 +353,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_resumedomain:
     {
-        ret = xsm_resumedomain(d);
-        if ( ret )
-            break;
-
         domain_resume(d);
         ret = 0;
     }
@@ -452,10 +436,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
              (is_hvm_domain(d) && (max > MAX_HVM_VCPUS)) )
             break;
 
-        ret = xsm_max_vcpus(d);
-        if ( ret )
-            break;
-
         /* Until Xenoprof can dynamically grow its vcpu-s array... */
         if ( d->xenoprof )
         {
@@ -538,7 +518,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_destroydomain:
     {
-        ret = xsm_destroydomain(d) ? : domain_kill(d);
+        ret = domain_kill(d);
     }
     break;
 
@@ -547,10 +527,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     {
         struct vcpu *v;
 
-        ret = xsm_vcpuaffinity(op->cmd, d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( op->u.vcpuaffinity.vcpu >= d->max_vcpus )
             break;
@@ -581,10 +557,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_scheduler_op:
     {
-        ret = xsm_scheduler(d);
-        if ( ret )
-            break;
-
         ret = sched_adjust(d, &op->u.scheduler_op);
         if ( copy_to_guest(u_domctl, op, 1) )
             ret = -EFAULT;
@@ -629,10 +601,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         vcpu_guest_context_u c = { .nat = NULL };
         struct vcpu         *v;
 
-        ret = xsm_getvcpucontext(d);
-        if ( ret )
-            goto getvcpucontext_out;
-
         ret = -EINVAL;
         if ( op->u.vcpucontext.vcpu >= d->max_vcpus )
             goto getvcpucontext_out;
@@ -685,10 +653,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         struct vcpu   *v;
         struct vcpu_runstate_info runstate;
 
-        ret = xsm_getvcpuinfo(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( op->u.getvcpuinfo.vcpu >= d->max_vcpus )
             break;
@@ -715,10 +679,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     {
         unsigned long new_max;
 
-        ret = xsm_setdomainmaxmem(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         new_max = op->u.max_mem.max_memkb >> (PAGE_SHIFT-10);
 
@@ -736,10 +696,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_setdomainhandle:
     {
-        ret = xsm_setdomainhandle(d);
-        if ( ret )
-            break;
-
         memcpy(d->handle, op->u.setdomainhandle.handle,
                sizeof(xen_domain_handle_t));
         ret = 0;
@@ -752,10 +708,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( d == current->domain ) /* no domain_pause() */
             break;
 
-        ret = xsm_setdebugging(d);
-        if ( ret )
-            break;
-
         domain_pause(d);
         d->debugger_attached = !!op->u.setdebugging.enable;
         domain_unpause(d); /* causes guest to latch new status */
@@ -800,10 +752,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_settimeoffset:
     {
-        ret = xsm_domain_settime(d);
-        if ( ret )
-            break;
-
         domain_set_time_offset(d, op->u.settimeoffset.time_offset_seconds);
         ret = 0;
     }
@@ -853,10 +801,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     case XEN_DOMCTL_set_virq_handler:
     {
         uint32_t virq = op->u.set_virq_handler.virq;
-
-        ret = xsm_set_virq_handler(d, virq);
-        if ( !ret )
-            ret = set_global_virq_handler(d, virq);
+        ret = set_global_virq_handler(d, virq);
     }
     break;
 
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index fa78785..aef7c4e 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -17,71 +17,16 @@ static XSM_INLINE void xsm_security_domaininfo(struct domain *d,
     return;
 }
 
-static XSM_INLINE int xsm_setvcpucontext(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_pausedomain(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_unpausedomain(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_resumedomain(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_domain_create(struct domain *d, u32 ssidref)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_max_vcpus(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_destroydomain(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_vcpuaffinity(int cmd, struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_scheduler(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_getvcpucontext(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getvcpuinfo(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_domain_settime(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
 {
     return 0;
@@ -113,11 +58,6 @@ static XSM_INLINE int xsm_sysctl(int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_set_virq_handler(struct domain *d, uint32_t virq)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_tbufcontrol(void)
 {
     return 0;
@@ -133,21 +73,6 @@ static XSM_INLINE int xsm_sched_id(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_setdomainmaxmem(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_setdomainhandle(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_setdebugging(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_perfcontrol(void)
 {
     return 0;
@@ -505,36 +430,6 @@ static XSM_INLINE int xsm_shadow_control(struct domain *d, uint32_t op)
     return 0;
 }
 
-static XSM_INLINE int xsm_getpageframeinfo(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getmemlist(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_hypercall_init(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_hvmcontext(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_address_size(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_machine_address_size(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
@@ -570,11 +465,6 @@ static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_event_setup(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_mem_event_control(struct domain *d, int mode, int op)
 {
     if ( !IS_PRIV(current->domain) )
@@ -589,11 +479,6 @@ static XSM_INLINE int xsm_mem_event_op(struct domain *d, int op)
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_sharing(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, cd) )
@@ -720,11 +605,6 @@ static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *
     return 0;
 }
 
-static XSM_INLINE int xsm_sendtrigger(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
@@ -735,21 +615,6 @@ static XSM_INLINE int xsm_unbind_pt_irq(struct domain *d, struct xen_domctl_bind
     return 0;
 }
 
-static XSM_INLINE int xsm_pin_mem_cacheattr(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index b2f33d6..903c7cb 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -41,29 +41,14 @@ extern xsm_initcall_t __xsm_initcall_start[], __xsm_initcall_end[];
 struct xsm_operations {
     void (*security_domaininfo) (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info);
-    int (*setvcpucontext) (struct domain *d);
-    int (*pausedomain) (struct domain *d);
-    int (*unpausedomain) (struct domain *d);
-    int (*resumedomain) (struct domain *d);
     int (*domain_create) (struct domain *d, u32 ssidref);
-    int (*max_vcpus) (struct domain *d);
-    int (*destroydomain) (struct domain *d);
-    int (*vcpuaffinity) (int cmd, struct domain *d);
-    int (*scheduler) (struct domain *d);
     int (*getdomaininfo) (struct domain *d);
-    int (*getvcpucontext) (struct domain *d);
-    int (*getvcpuinfo) (struct domain *d);
-    int (*domain_settime) (struct domain *d);
     int (*set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
     int (*sysctl) (int cmd);
-    int (*set_virq_handler) (struct domain *d, uint32_t virq);
     int (*tbufcontrol) (void);
     int (*readconsole) (uint32_t clear);
     int (*sched_id) (void);
-    int (*setdomainmaxmem) (struct domain *d);
-    int (*setdomainhandle) (struct domain *d);
-    int (*setdebugging) (struct domain *d);
     int (*perfcontrol) (void);
     int (*debug_keys) (void);
     int (*getcpuinfo) (void);
@@ -141,21 +126,13 @@ struct xsm_operations {
 
 #ifdef CONFIG_X86
     int (*shadow_control) (struct domain *d, uint32_t op);
-    int (*getpageframeinfo) (struct domain *d);
-    int (*getmemlist) (struct domain *d);
-    int (*hypercall_init) (struct domain *d);
-    int (*hvmcontext) (struct domain *d, uint32_t op);
-    int (*address_size) (struct domain *d, uint32_t op);
-    int (*machine_address_size) (struct domain *d, uint32_t op);
     int (*hvm_param) (struct domain *d, unsigned long op);
     int (*hvm_set_pci_intx_level) (struct domain *d);
     int (*hvm_set_isa_irq_level) (struct domain *d);
     int (*hvm_set_pci_link_route) (struct domain *d);
     int (*hvm_inject_msi) (struct domain *d);
-    int (*mem_event_setup) (struct domain *d);
     int (*mem_event_control) (struct domain *d, int mode, int op);
     int (*mem_event_op) (struct domain *d, int op);
-    int (*mem_sharing) (struct domain *d);
     int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
     int (*apic) (struct domain *d, int cmd);
     int (*xen_settime) (void);
@@ -180,12 +157,8 @@ struct xsm_operations {
     int (*mmuext_op) (struct domain *d, struct domain *f);
     int (*update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
-    int (*sendtrigger) (struct domain *d);
     int (*bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
     int (*unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*pin_mem_cacheattr) (struct domain *d);
-    int (*ext_vcpucontext) (struct domain *d, uint32_t cmd);
-    int (*vcpuextstate) (struct domain *d, uint32_t cmd);
     int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
     int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
 #endif
@@ -203,71 +176,16 @@ static inline void xsm_security_domaininfo (struct domain *d,
     xsm_ops->security_domaininfo(d, info);
 }
 
-static inline int xsm_setvcpucontext(struct domain *d)
-{
-    return xsm_ops->setvcpucontext(d);
-}
-
-static inline int xsm_pausedomain (struct domain *d)
-{
-    return xsm_ops->pausedomain(d);
-}
-
-static inline int xsm_unpausedomain (struct domain *d)
-{
-    return xsm_ops->unpausedomain(d);
-}
-
-static inline int xsm_resumedomain (struct domain *d)
-{
-    return xsm_ops->resumedomain(d);
-}
-
 static inline int xsm_domain_create (struct domain *d, u32 ssidref)
 {
     return xsm_ops->domain_create(d, ssidref);
 }
 
-static inline int xsm_max_vcpus(struct domain *d)
-{
-    return xsm_ops->max_vcpus(d);
-}
-
-static inline int xsm_destroydomain (struct domain *d)
-{
-    return xsm_ops->destroydomain(d);
-}
-
-static inline int xsm_vcpuaffinity (int cmd, struct domain *d)
-{
-    return xsm_ops->vcpuaffinity(cmd, d);
-}
-
-static inline int xsm_scheduler (struct domain *d)
-{
-    return xsm_ops->scheduler(d);
-}
-
 static inline int xsm_getdomaininfo (struct domain *d)
 {
     return xsm_ops->getdomaininfo(d);
 }
 
-static inline int xsm_getvcpucontext (struct domain *d)
-{
-    return xsm_ops->getvcpucontext(d);
-}
-
-static inline int xsm_getvcpuinfo (struct domain *d)
-{
-    return xsm_ops->getvcpuinfo(d);
-}
-
-static inline int xsm_domain_settime (struct domain *d)
-{
-    return xsm_ops->domain_settime(d);
-}
-
 static inline int xsm_set_target (struct domain *d, struct domain *e)
 {
     return xsm_ops->set_target(d, e);
@@ -283,11 +201,6 @@ static inline int xsm_sysctl (int cmd)
     return xsm_ops->sysctl(cmd);
 }
 
-static inline int xsm_set_virq_handler (struct domain *d, uint32_t virq)
-{
-    return xsm_ops->set_virq_handler(d, virq);
-}
-
 static inline int xsm_tbufcontrol (void)
 {
     return xsm_ops->tbufcontrol();
@@ -303,21 +216,6 @@ static inline int xsm_sched_id (void)
     return xsm_ops->sched_id();
 }
 
-static inline int xsm_setdomainmaxmem (struct domain *d)
-{
-    return xsm_ops->setdomainmaxmem(d);
-}
-
-static inline int xsm_setdomainhandle (struct domain *d)
-{
-    return xsm_ops->setdomainhandle(d);
-}
-
-static inline int xsm_setdebugging (struct domain *d)
-{
-    return xsm_ops->setdebugging(d);
-}
-
 static inline int xsm_perfcontrol (void)
 {
     return xsm_ops->perfcontrol();
@@ -635,36 +533,6 @@ static inline int xsm_shadow_control (struct domain *d, uint32_t op)
     return xsm_ops->shadow_control(d, op);
 }
 
-static inline int xsm_getpageframeinfo (struct domain *d)
-{
-    return xsm_ops->getpageframeinfo(d);
-}
-
-static inline int xsm_getmemlist (struct domain *d)
-{
-    return xsm_ops->getmemlist(d);
-}
-
-static inline int xsm_hypercall_init (struct domain *d)
-{
-    return xsm_ops->hypercall_init(d);
-}
-
-static inline int xsm_hvmcontext (struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->hvmcontext(d, cmd);
-}
-
-static inline int xsm_address_size (struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->address_size(d, cmd);
-}
-
-static inline int xsm_machine_address_size (struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->machine_address_size(d, cmd);
-}
-
 static inline int xsm_hvm_param (struct domain *d, unsigned long op)
 {
     return xsm_ops->hvm_param(d, op);
@@ -690,11 +558,6 @@ static inline int xsm_hvm_inject_msi (struct domain *d)
     return xsm_ops->hvm_inject_msi(d);
 }
 
-static inline int xsm_mem_event_setup (struct domain *d)
-{
-    return xsm_ops->mem_event_setup(d);
-}
-
 static inline int xsm_mem_event_control (struct domain *d, int mode, int op)
 {
     return xsm_ops->mem_event_control(d, mode, op);
@@ -705,11 +568,6 @@ static inline int xsm_mem_event_op (struct domain *d, int op)
     return xsm_ops->mem_event_op(d, op);
 }
 
-static inline int xsm_mem_sharing (struct domain *d)
-{
-    return xsm_ops->mem_sharing(d);
-}
-
 static inline int xsm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
 {
     return xsm_ops->mem_sharing_op(d, cd, op);
@@ -807,11 +665,6 @@ static inline int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
     return xsm_ops->add_to_physmap(d1, d2);
 }
 
-static inline int xsm_sendtrigger(struct domain *d)
-{
-    return xsm_ops->sendtrigger(d);
-}
-
 static inline int xsm_bind_pt_irq(struct domain *d, 
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
@@ -824,20 +677,6 @@ static inline int xsm_unbind_pt_irq(struct domain *d,
     return xsm_ops->unbind_pt_irq(d, bind);
 }
 
-static inline int xsm_pin_mem_cacheattr(struct domain *d)
-{
-    return xsm_ops->pin_mem_cacheattr(d);
-}
-
-static inline int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->ext_vcpucontext(d, cmd);
-}
-static inline int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->vcpuextstate(d, cmd);
-}
-
 static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return xsm_ops->ioport_permission(d, s, e, allow);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 3e6e5df..9bb86ef 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -30,29 +30,14 @@ struct xsm_operations dummy_xsm_ops;
 void xsm_fixup_ops (struct xsm_operations *ops)
 {
     set_to_dummy_if_null(ops, security_domaininfo);
-    set_to_dummy_if_null(ops, setvcpucontext);
-    set_to_dummy_if_null(ops, pausedomain);
-    set_to_dummy_if_null(ops, unpausedomain);
-    set_to_dummy_if_null(ops, resumedomain);
     set_to_dummy_if_null(ops, domain_create);
-    set_to_dummy_if_null(ops, max_vcpus);
-    set_to_dummy_if_null(ops, destroydomain);
-    set_to_dummy_if_null(ops, vcpuaffinity);
-    set_to_dummy_if_null(ops, scheduler);
     set_to_dummy_if_null(ops, getdomaininfo);
-    set_to_dummy_if_null(ops, getvcpucontext);
-    set_to_dummy_if_null(ops, getvcpuinfo);
-    set_to_dummy_if_null(ops, domain_settime);
     set_to_dummy_if_null(ops, set_target);
     set_to_dummy_if_null(ops, domctl);
     set_to_dummy_if_null(ops, sysctl);
-    set_to_dummy_if_null(ops, set_virq_handler);
     set_to_dummy_if_null(ops, tbufcontrol);
     set_to_dummy_if_null(ops, readconsole);
     set_to_dummy_if_null(ops, sched_id);
-    set_to_dummy_if_null(ops, setdomainmaxmem);
-    set_to_dummy_if_null(ops, setdomainhandle);
-    set_to_dummy_if_null(ops, setdebugging);
     set_to_dummy_if_null(ops, perfcontrol);
     set_to_dummy_if_null(ops, debug_keys);
     set_to_dummy_if_null(ops, getcpuinfo);
@@ -128,21 +113,13 @@ void xsm_fixup_ops (struct xsm_operations *ops)
 
 #ifdef CONFIG_X86
     set_to_dummy_if_null(ops, shadow_control);
-    set_to_dummy_if_null(ops, getpageframeinfo);
-    set_to_dummy_if_null(ops, getmemlist);
-    set_to_dummy_if_null(ops, hypercall_init);
-    set_to_dummy_if_null(ops, hvmcontext);
-    set_to_dummy_if_null(ops, address_size);
-    set_to_dummy_if_null(ops, machine_address_size);
     set_to_dummy_if_null(ops, hvm_param);
     set_to_dummy_if_null(ops, hvm_set_pci_intx_level);
     set_to_dummy_if_null(ops, hvm_set_isa_irq_level);
     set_to_dummy_if_null(ops, hvm_set_pci_link_route);
     set_to_dummy_if_null(ops, hvm_inject_msi);
-    set_to_dummy_if_null(ops, mem_event_setup);
     set_to_dummy_if_null(ops, mem_event_control);
     set_to_dummy_if_null(ops, mem_event_op);
-    set_to_dummy_if_null(ops, mem_sharing);
     set_to_dummy_if_null(ops, mem_sharing_op);
     set_to_dummy_if_null(ops, apic);
     set_to_dummy_if_null(ops, xen_settime);
@@ -163,12 +140,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, update_va_mapping);
     set_to_dummy_if_null(ops, add_to_physmap);
     set_to_dummy_if_null(ops, remove_from_physmap);
-    set_to_dummy_if_null(ops, sendtrigger);
     set_to_dummy_if_null(ops, bind_pt_irq);
     set_to_dummy_if_null(ops, unbind_pt_irq);
-    set_to_dummy_if_null(ops, pin_mem_cacheattr);
-    set_to_dummy_if_null(ops, ext_vcpucontext);
-    set_to_dummy_if_null(ops, vcpuextstate);
     set_to_dummy_if_null(ops, ioport_permission);
     set_to_dummy_if_null(ops, ioport_mapping);
 #endif
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index e815ea5..f0216e0 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -484,26 +484,6 @@ static void flask_security_domaininfo(struct domain *d,
     info->ssidref = domain_sid(d);
 }
 
-static int flask_setvcpucontext(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT);
-}
-
-static int flask_pausedomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
-}
-
-static int flask_unpausedomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
-}
-
-static int flask_resumedomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__RESUME);
-}
-
 static int flask_domain_create(struct domain *d, u32 ssidref)
 {
     int rc;
@@ -532,66 +512,11 @@ static int flask_domain_create(struct domain *d, u32 ssidref)
     return rc;
 }
 
-static int flask_max_vcpus(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS);
-}
-
-static int flask_destroydomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__DESTROY);
-}
-
-static int flask_vcpuaffinity(int cmd, struct domain *d)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_setvcpuaffinity:
-        perm = DOMAIN__SETVCPUAFFINITY;
-        break;
-    case XEN_DOMCTL_getvcpuaffinity:
-        perm = DOMAIN__GETVCPUAFFINITY;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm );
-}
-
-static int flask_scheduler(struct domain *d)
-{
-    int rc = 0;
-
-    rc = domain_has_xen(current->domain, XEN__SCHEDULER);
-    if ( rc )
-        return rc;
-
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SCHEDULER);
-}
-
 static int flask_getdomaininfo(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO);
 }
 
-static int flask_getvcpucontext(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT);
-}
-
-static int flask_getvcpuinfo(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO);
-}
-
-static int flask_domain_settime(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
-}
-
 static int flask_set_target(struct domain *d, struct domain *t)
 {
     int rc;
@@ -622,62 +547,121 @@ static int flask_domctl(struct domain *d, int cmd)
     {
     /* These have individual XSM hooks (common/domctl.c) */
     case XEN_DOMCTL_createdomain:
+    case XEN_DOMCTL_getdomaininfo:
+    case XEN_DOMCTL_irq_permission:
+    case XEN_DOMCTL_iomem_permission:
+    case XEN_DOMCTL_set_target:
+#ifdef CONFIG_X86
+    /* These have individual XSM hooks (arch/x86/domctl.c) */
+    case XEN_DOMCTL_shadow_op:
+    case XEN_DOMCTL_ioport_permission:
+    case XEN_DOMCTL_bind_pt_irq:
+    case XEN_DOMCTL_unbind_pt_irq:
+    case XEN_DOMCTL_memory_mapping:
+    case XEN_DOMCTL_ioport_mapping:
+    case XEN_DOMCTL_mem_event_op:
+    /* These have individual XSM hooks (drivers/passthrough/iommu.c) */
+    case XEN_DOMCTL_get_device_group:
+    case XEN_DOMCTL_test_assign_device:
+    case XEN_DOMCTL_assign_device:
+    case XEN_DOMCTL_deassign_device:
+#endif
+        return 0;
+
     case XEN_DOMCTL_destroydomain:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__DESTROY);
+
     case XEN_DOMCTL_pausedomain:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
+
     case XEN_DOMCTL_unpausedomain:
-    case XEN_DOMCTL_getdomaininfo:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
+
     case XEN_DOMCTL_setvcpuaffinity:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUAFFINITY);
+
+    case XEN_DOMCTL_getvcpuaffinity:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUAFFINITY);
+
+    case XEN_DOMCTL_resumedomain:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__RESUME);
+
+    case XEN_DOMCTL_scheduler_op:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SCHEDULER);
+
+    case XEN_DOMCTL_max_vcpus:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS);
+
     case XEN_DOMCTL_max_mem:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM);
+
+    case XEN_DOMCTL_setdomainhandle:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE);
+
     case XEN_DOMCTL_setvcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT);
+
     case XEN_DOMCTL_getvcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT);
+
     case XEN_DOMCTL_getvcpuinfo:
-    case XEN_DOMCTL_max_vcpus:
-    case XEN_DOMCTL_scheduler_op:
-    case XEN_DOMCTL_setdomainhandle:
-    case XEN_DOMCTL_setdebugging:
-    case XEN_DOMCTL_irq_permission:
-    case XEN_DOMCTL_iomem_permission:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO);
+
     case XEN_DOMCTL_settimeoffset:
-    case XEN_DOMCTL_getvcpuaffinity:
-    case XEN_DOMCTL_resumedomain:
-    case XEN_DOMCTL_set_target:
-    case XEN_DOMCTL_set_virq_handler:
-#ifdef CONFIG_X86
-    /* These have individual XSM hooks (arch/x86/domctl.c) */
-    case XEN_DOMCTL_shadow_op:
-    case XEN_DOMCTL_ioport_permission:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
+
+    case XEN_DOMCTL_setdebugging:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
+
     case XEN_DOMCTL_getpageframeinfo:
     case XEN_DOMCTL_getpageframeinfo2:
     case XEN_DOMCTL_getpageframeinfo3:
+        return current_has_perm(d, SECCLASS_MMU, MMU__PAGEINFO);
+
     case XEN_DOMCTL_getmemlist:
+        return current_has_perm(d, SECCLASS_MMU, MMU__PAGELIST);
+
     case XEN_DOMCTL_hypercall_init:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__HYPERCALL);
+
     case XEN_DOMCTL_sethvmcontext:
+        return current_has_perm(d, SECCLASS_HVM, HVM__SETHVMC);
+
     case XEN_DOMCTL_gethvmcontext:
     case XEN_DOMCTL_gethvmcontext_partial:
+        return current_has_perm(d, SECCLASS_HVM, HVM__GETHVMC);
+
     case XEN_DOMCTL_set_address_size:
-    case XEN_DOMCTL_get_address_size:
     case XEN_DOMCTL_set_machine_address_size:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETADDRSIZE);
+
+    case XEN_DOMCTL_get_address_size:
     case XEN_DOMCTL_get_machine_address_size:
-    case XEN_DOMCTL_sendtrigger:
-    case XEN_DOMCTL_bind_pt_irq:
-    case XEN_DOMCTL_unbind_pt_irq:
-    case XEN_DOMCTL_memory_mapping:
-    case XEN_DOMCTL_ioport_mapping:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETADDRSIZE);
+
+    case XEN_DOMCTL_mem_sharing_op:
+        return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
+
     case XEN_DOMCTL_pin_mem_cacheattr:
+        return current_has_perm(d, SECCLASS_HVM, HVM__CACHEATTR);
+
     case XEN_DOMCTL_set_ext_vcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETEXTVCPUCONTEXT);
+
     case XEN_DOMCTL_get_ext_vcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETEXTVCPUCONTEXT);
+
     case XEN_DOMCTL_setvcpuextstate:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUEXTSTATE);
+
     case XEN_DOMCTL_getvcpuextstate:
-    case XEN_DOMCTL_mem_event_op:
-    case XEN_DOMCTL_mem_sharing_op:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUEXTSTATE);
+
+    case XEN_DOMCTL_sendtrigger:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
+
     case XEN_DOMCTL_set_access_required:
-    /* These have individual XSM hooks (drivers/passthrough/iommu.c) */
-    case XEN_DOMCTL_get_device_group:
-    case XEN_DOMCTL_test_assign_device:
-    case XEN_DOMCTL_assign_device:
-    case XEN_DOMCTL_deassign_device:
-#endif
-        return 0;
+        return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 
     case XEN_DOMCTL_debug_op:
     case XEN_DOMCTL_gdbsx_guestmemio:
@@ -691,6 +675,9 @@ static int flask_domctl(struct domain *d, int cmd)
     case XEN_DOMCTL_suppress_spurious_page_faults:
         return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO);
 
+    case XEN_DOMCTL_set_virq_handler:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
+
     case XEN_DOMCTL_set_cpuid:
         return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID);
 
@@ -741,11 +728,6 @@ static int flask_sysctl(int cmd)
     }
 }
 
-static int flask_set_virq_handler(struct domain *d, uint32_t virq)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
-}
-
 static int flask_tbufcontrol(void)
 {
     return domain_has_xen(current->domain, XEN__TBUFCONTROL);
@@ -766,21 +748,6 @@ static int flask_sched_id(void)
     return domain_has_xen(current->domain, XEN__SCHEDULER);
 }
 
-static int flask_setdomainmaxmem(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM);
-}
-
-static int flask_setdomainhandle(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE);
-}
-
-static int flask_setdebugging(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
-}
-
 static int flask_debug_keys(void)
 {
     return domain_has_xen(current->domain, XEN__DEBUG);
@@ -1174,82 +1141,6 @@ static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end,
     return flask_ioport_permission(d, start, end, access);
 }
 
-static int flask_getpageframeinfo(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_MMU, MMU__PAGEINFO);
-}
-
-static int flask_getmemlist(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_MMU, MMU__PAGELIST);
-}
-
-static int flask_hypercall_init(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__HYPERCALL);
-}
-
-static int flask_hvmcontext(struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_sethvmcontext:
-        perm = HVM__SETHVMC;
-        break;
-    case XEN_DOMCTL_gethvmcontext:
-    case XEN_DOMCTL_gethvmcontext_partial:
-        perm = HVM__GETHVMC;
-        break;
-    case HVMOP_track_dirty_vram:
-        perm = HVM__TRACKDIRTYVRAM;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_HVM, perm);
-}
-
-static int flask_address_size(struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_set_address_size:
-        perm = DOMAIN__SETADDRSIZE;
-        break;
-    case XEN_DOMCTL_get_address_size:
-        perm = DOMAIN__GETADDRSIZE;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm);
-}
-
-static int flask_machine_address_size(struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_set_machine_address_size:
-        perm = DOMAIN__SETADDRSIZE;
-        break;
-    case XEN_DOMCTL_get_machine_address_size:
-        perm = DOMAIN__GETADDRSIZE;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
-}
-
 static int flask_hvm_param(struct domain *d, unsigned long op)
 {
     u32 perm;
@@ -1292,11 +1183,6 @@ static int flask_hvm_inject_msi(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
-static int flask_mem_event_setup(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
-}
-
 static int flask_mem_event_control(struct domain *d, int mode, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
@@ -1307,11 +1193,6 @@ static int flask_mem_event_op(struct domain *d, int op)
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
 
-static int flask_mem_sharing(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
-}
-
 static int flask_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     int rc = current_has_perm(cd, SECCLASS_HVM, HVM__MEM_SHARING);
@@ -1499,11 +1380,6 @@ static int flask_remove_from_physmap(struct domain *d1, struct domain *d2)
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP);
 }
 
-static int flask_sendtrigger(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
-}
-
 static int flask_get_device_group(uint32_t machine_bdf)
 {
     u32 rsid;
@@ -1597,78 +1473,20 @@ static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq
 {
     return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
-
-static int flask_pin_mem_cacheattr (struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__CACHEATTR);
-}
-
-static int flask_ext_vcpucontext (struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_set_ext_vcpucontext:
-        perm = DOMAIN__SETEXTVCPUCONTEXT;
-        break;
-    case XEN_DOMCTL_get_ext_vcpucontext:
-        perm = DOMAIN__GETEXTVCPUCONTEXT;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm);
-}
-
-static int flask_vcpuextstate (struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-        case XEN_DOMCTL_setvcpuextstate:
-            perm = DOMAIN__SETVCPUEXTSTATE;
-        break;
-        case XEN_DOMCTL_getvcpuextstate:
-            perm = DOMAIN__GETVCPUEXTSTATE;
-        break;
-        default:
-            return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm);
-}
 #endif
 
 long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
 
 static struct xsm_operations flask_ops = {
     .security_domaininfo = flask_security_domaininfo,
-    .setvcpucontext = flask_setvcpucontext,
-    .pausedomain = flask_pausedomain,
-    .unpausedomain = flask_unpausedomain,    
-    .resumedomain = flask_resumedomain,    
     .domain_create = flask_domain_create,
-    .max_vcpus = flask_max_vcpus,
-    .destroydomain = flask_destroydomain,
-    .vcpuaffinity = flask_vcpuaffinity,
-    .scheduler = flask_scheduler,
     .getdomaininfo = flask_getdomaininfo,
-    .getvcpucontext = flask_getvcpucontext,
-    .getvcpuinfo = flask_getvcpuinfo,
-    .domain_settime = flask_domain_settime,
     .set_target = flask_set_target,
     .domctl = flask_domctl,
     .sysctl = flask_sysctl,
-    .set_virq_handler = flask_set_virq_handler,
     .tbufcontrol = flask_tbufcontrol,
     .readconsole = flask_readconsole,
     .sched_id = flask_sched_id,
-    .setdomainmaxmem = flask_setdomainmaxmem,
-    .setdomainhandle = flask_setdomainhandle,
-    .setdebugging = flask_setdebugging,
     .perfcontrol = flask_perfcontrol,
     .debug_keys = flask_debug_keys,
     .getcpuinfo = flask_getcpuinfo,
@@ -1740,21 +1558,13 @@ static struct xsm_operations flask_ops = {
 
 #ifdef CONFIG_X86
     .shadow_control = flask_shadow_control,
-    .getpageframeinfo = flask_getpageframeinfo,
-    .getmemlist = flask_getmemlist,
-    .hypercall_init = flask_hypercall_init,
-    .hvmcontext = flask_hvmcontext,
-    .address_size = flask_address_size,
-    .machine_address_size = flask_machine_address_size,
     .hvm_param = flask_hvm_param,
     .hvm_set_pci_intx_level = flask_hvm_set_pci_intx_level,
     .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
     .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
     .hvm_inject_msi = flask_hvm_inject_msi,
-    .mem_event_setup = flask_mem_event_setup,
     .mem_event_control = flask_mem_event_control,
     .mem_event_op = flask_mem_event_op,
-    .mem_sharing = flask_mem_sharing,
     .mem_sharing_op = flask_mem_sharing_op,
     .apic = flask_apic,
     .xen_settime = flask_xen_settime,
@@ -1775,16 +1585,12 @@ static struct xsm_operations flask_ops = {
     .update_va_mapping = flask_update_va_mapping,
     .add_to_physmap = flask_add_to_physmap,
     .remove_from_physmap = flask_remove_from_physmap,
-    .sendtrigger = flask_sendtrigger,
     .get_device_group = flask_get_device_group,
     .test_assign_device = flask_test_assign_device,
     .assign_device = flask_assign_device,
     .deassign_device = flask_deassign_device,
     .bind_pt_irq = flask_bind_pt_irq,
     .unbind_pt_irq = flask_unbind_pt_irq,
-    .pin_mem_cacheattr = flask_pin_mem_cacheattr,
-    .ext_vcpucontext = flask_ext_vcpucontext,
-    .vcpuextstate = flask_vcpuextstate,
     .ioport_permission = flask_ioport_permission,
     .ioport_mapping = flask_ioport_mapping,
 #endif
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:52:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:52:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapB2-0007au-Nn; Tue, 20 Nov 2012 14:51:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TapB0-0007aa-KS
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:51:51 +0000
Received: from [85.158.143.99:24302] by server-1.bemta-4.messagelabs.com id
	C7/39-27934-5099BA05; Tue, 20 Nov 2012 14:51:49 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-216.messagelabs.com!1353423108!19879440!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11615 invoked from network); 20 Nov 2012 14:51:48 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-14.tower-216.messagelabs.com with SMTP;
	20 Nov 2012 14:51:48 -0000
X-TM-IMSS-Message-ID: <9cf7a522000bdf6d@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9cf7a522000bdf6d ;
	Tue, 20 Nov 2012 09:51:07 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKEpd9W028173; 
	Tue, 20 Nov 2012 09:51:40 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Tue, 20 Nov 2012 09:51:37 -0500
Message-Id: <1353423098-16371-5-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 4/5] xen: platform_hypercall XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

A number of the platform_hypercall XSM hooks have no parameters or only
pass the operation ID, making them redundant with the xsm_sysctl hook.
Remove these redundant hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/platform_hypercall.c |  44 ----------------
 xen/include/xsm/dummy.h           |  52 ------------------
 xen/include/xsm/xsm.h             |  54 -------------------
 xen/xsm/dummy.c                   |  10 ----
 xen/xsm/flask/hooks.c             | 107 +++++++++++---------------------------
 5 files changed, 30 insertions(+), 237 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index ffac6ac..f267b8b 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -90,10 +90,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
     case XENPF_settime:
     {
-        ret = xsm_xen_settime();
-        if ( ret )
-            break;
-
         do_settime(op->u.settime.secs, 
                    op->u.settime.nsecs, 
                    op->u.settime.system_time);
@@ -103,10 +99,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
     case XENPF_add_memtype:
     {
-        ret = xsm_memtype(op->cmd);
-        if ( ret )
-            break;
-
         ret = mtrr_add_page(
             op->u.add_memtype.mfn,
             op->u.add_memtype.nr_mfns,
@@ -125,10 +117,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
     case XENPF_del_memtype:
     {
-        ret = xsm_memtype(op->cmd);
-        if ( ret )
-            break;
-
         if (op->u.del_memtype.handle == 0
             /* mtrr/main.c otherwise does a lookup */
             && (int)op->u.del_memtype.reg >= 0)
@@ -147,10 +135,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         unsigned long mfn, nr_mfns;
         mtrr_type     type;
 
-        ret = xsm_memtype(op->cmd);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( op->u.read_memtype.reg < num_var_ranges )
         {
@@ -167,10 +151,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         XEN_GUEST_HANDLE(const_void) data;
 
-        ret = xsm_microcode();
-        if ( ret )
-            break;
-
         guest_from_compat_handle(data, op->u.microcode.data);
 
         /*
@@ -198,10 +178,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         int quirk_id = op->u.platform_quirk.quirk_id;
 
-        ret = xsm_platform_quirk(quirk_id);
-        if ( ret )
-            break;
-
         switch ( quirk_id )
         {
         case QUIRK_NOIRQBALANCING:
@@ -223,10 +199,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_firmware_info:
-        ret = xsm_firmware_info();
-        if ( ret )
-            break;
-
         switch ( op->u.firmware_info.type )
         {
         case XEN_FW_DISK_INFO: {
@@ -335,10 +307,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         break;
 
     case XENPF_efi_runtime_call:
-        ret = xsm_efi_call();
-        if ( ret )
-            break;
-
         ret = efi_runtime_call(&op->u.efi_runtime_call);
         if ( ret == 0 &&
              copy_field_to_guest(u_xenpf_op, op, u.efi_runtime_call) )
@@ -346,18 +314,10 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         break;
 
     case XENPF_enter_acpi_sleep:
-        ret = xsm_acpi_sleep();
-        if ( ret )
-            break;
-
         ret = acpi_enter_sleep(&op->u.enter_acpi_sleep);
         break;
 
     case XENPF_change_freq:
-        ret = xsm_change_freq();
-        if ( ret )
-            break;
-
         ret = -ENOSYS;
         if ( cpufreq_controller != FREQCTL_dom0_kernel )
             break;
@@ -379,10 +339,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         XEN_GUEST_HANDLE(uint8) cpumap_bitmap;
         XEN_GUEST_HANDLE(uint64) idletimes;
 
-        ret = xsm_getidletime();
-        if ( ret )
-            break;
-
         ret = -ENOSYS;
         if ( cpufreq_controller != FREQCTL_dom0_kernel )
             break;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 93e84dc..aaac50d3 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -308,11 +308,6 @@ static XSM_INLINE int xsm_page_offline(uint32_t cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_lockprof(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_tmem_op(void)
 {
     return 0;
@@ -438,26 +433,6 @@ static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_xen_settime(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_memtype(uint32_t access)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_microcode(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_platform_op(uint32_t op)
 {
     if ( !IS_PRIV(current->domain) )
@@ -465,33 +440,6 @@ static XSM_INLINE int xsm_platform_op(uint32_t op)
     return 0;
 }
 
-static XSM_INLINE int xsm_firmware_info(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_efi_call(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_acpi_sleep(void)
-{
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
-}
-
-static XSM_INLINE int xsm_change_freq(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getidletime(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_machine_memory_map(void)
 {
     if ( !IS_PRIV(current->domain) )
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index f1ccd8e..105201e 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -107,7 +107,6 @@ struct xsm_operations {
     int (*resource_setup_misc) (void);
 
     int (*page_offline)(uint32_t cmd);
-    int (*lockprof)(void);
     int (*tmem_op)(void);
     int (*tmem_control)(void);
 
@@ -124,16 +123,8 @@ struct xsm_operations {
     int (*mem_event_op) (struct domain *d, int op);
     int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
     int (*apic) (struct domain *d, int cmd);
-    int (*xen_settime) (void);
     int (*memtype) (uint32_t access);
-    int (*microcode) (void);
-    int (*platform_quirk) (uint32_t);
     int (*platform_op) (uint32_t cmd);
-    int (*firmware_info) (void);
-    int (*efi_call) (void);
-    int (*acpi_sleep) (void);
-    int (*change_freq) (void);
-    int (*getidletime) (void);
     int (*machine_memory_map) (void);
     int (*domain_memory_map) (struct domain *d);
 #define XSM_MMU_UPDATE_READ      1
@@ -440,11 +431,6 @@ static inline int xsm_page_offline(uint32_t cmd)
     return xsm_ops->page_offline(cmd);
 }
 
-static inline int xsm_lockprof(void)
-{
-    return xsm_ops->lockprof();
-}
-
 static inline int xsm_tmem_op(void)
 {
     return xsm_ops->tmem_op();
@@ -511,56 +497,16 @@ static inline int xsm_apic (struct domain *d, int cmd)
     return xsm_ops->apic(d, cmd);
 }
 
-static inline int xsm_xen_settime (void)
-{
-    return xsm_ops->xen_settime();
-}
-
 static inline int xsm_memtype (uint32_t access)
 {
     return xsm_ops->memtype(access);
 }
 
-static inline int xsm_microcode (void)
-{
-    return xsm_ops->microcode();
-}
-
-static inline int xsm_platform_quirk (uint32_t quirk)
-{
-    return xsm_ops->platform_quirk(quirk);
-}
-
 static inline int xsm_platform_op (uint32_t op)
 {
     return xsm_ops->platform_op(op);
 }
 
-static inline int xsm_firmware_info (void)
-{
-    return xsm_ops->firmware_info();
-}
-
-static inline int xsm_efi_call (void)
-{
-    return xsm_ops->efi_call();
-}
-
-static inline int xsm_acpi_sleep (void)
-{
-    return xsm_ops->acpi_sleep();
-}
-
-static inline int xsm_change_freq (void)
-{
-    return xsm_ops->change_freq();
-}
-
-static inline int xsm_getidletime (void)
-{
-    return xsm_ops->getidletime();
-}
-
 static inline int xsm_machine_memory_map(void)
 {
     return xsm_ops->machine_memory_map();
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 03a17ba..22c66e5 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -94,7 +94,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, resource_setup_misc);
 
     set_to_dummy_if_null(ops, page_offline);
-    set_to_dummy_if_null(ops, lockprof);
     set_to_dummy_if_null(ops, tmem_op);
     set_to_dummy_if_null(ops, tmem_control);
 
@@ -111,16 +110,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, mem_event_op);
     set_to_dummy_if_null(ops, mem_sharing_op);
     set_to_dummy_if_null(ops, apic);
-    set_to_dummy_if_null(ops, xen_settime);
-    set_to_dummy_if_null(ops, memtype);
-    set_to_dummy_if_null(ops, microcode);
-    set_to_dummy_if_null(ops, platform_quirk);
     set_to_dummy_if_null(ops, platform_op);
-    set_to_dummy_if_null(ops, firmware_info);
-    set_to_dummy_if_null(ops, efi_call);
-    set_to_dummy_if_null(ops, acpi_sleep);
-    set_to_dummy_if_null(ops, change_freq);
-    set_to_dummy_if_null(ops, getidletime);
     set_to_dummy_if_null(ops, machine_memory_map);
     set_to_dummy_if_null(ops, domain_memory_map);
     set_to_dummy_if_null(ops, mmu_update);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index d72a807..03ea675 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1186,64 +1186,51 @@ static int flask_apic(struct domain *d, int cmd)
     return domain_has_xen(d, perm);
 }
 
-static int flask_xen_settime(void)
-{
-    return domain_has_xen(current->domain, XEN__SETTIME);
-}
-
-static int flask_memtype(uint32_t access)
-{
-    u32 perm;
-
-    switch ( access )
-    {
-    case XENPF_add_memtype:
-        perm = XEN__MTRR_ADD;
-        break;
-    case XENPF_del_memtype:
-        perm = XEN__MTRR_DEL;
-        break;
-    case XENPF_read_memtype:
-        perm = XEN__MTRR_READ;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return domain_has_xen(current->domain, perm);
-}
-
-static int flask_microcode(void)
-{
-    return domain_has_xen(current->domain, XEN__MICROCODE);
-}
-
-static int flask_platform_quirk(uint32_t quirk)
-{
-    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN, XEN__QUIRK, NULL);
-}
-
 static int flask_platform_op(uint32_t op)
 {
     switch ( op )
     {
+#ifdef CONFIG_X86
+    /* These operations have their own XSM hooks */
+    case XENPF_cpu_online:
+    case XENPF_cpu_offline:
+    case XENPF_cpu_hotadd:
+    case XENPF_mem_hotadd:
+        return 0;
+#endif
+
     case XENPF_settime:
+        return domain_has_xen(current->domain, XEN__SETTIME);
+
     case XENPF_add_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_ADD);
+
     case XENPF_del_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_DEL);
+
     case XENPF_read_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_READ);
+
     case XENPF_microcode_update:
+        return domain_has_xen(current->domain, XEN__MICROCODE);
+
     case XENPF_platform_quirk:
+        return domain_has_xen(current->domain, XEN__QUIRK);
+
     case XENPF_firmware_info:
+        return domain_has_xen(current->domain, XEN__FIRMWARE);
+
     case XENPF_efi_runtime_call:
+        return domain_has_xen(current->domain, XEN__FIRMWARE);
+
     case XENPF_enter_acpi_sleep:
+        return domain_has_xen(current->domain, XEN__SLEEP);
+
     case XENPF_change_freq:
+        return domain_has_xen(current->domain, XEN__FREQUENCY);
+
     case XENPF_getidletime:
-    case XENPF_cpu_online:
-    case XENPF_cpu_offline:
-    case XENPF_cpu_hotadd:
-    case XENPF_mem_hotadd:
-        /* These operations have their own XSM hooks */
-        return 0;
+        return domain_has_xen(current->domain, XEN__GETIDLE);
 
     case XENPF_set_processor_pminfo:
     case XENPF_core_parking:
@@ -1259,31 +1246,6 @@ static int flask_platform_op(uint32_t op)
     }
 }
 
-static int flask_firmware_info(void)
-{
-    return domain_has_xen(current->domain, XEN__FIRMWARE);
-}
-
-static int flask_efi_call(void)
-{
-    return domain_has_xen(current->domain, XEN__FIRMWARE);
-}
-
-static int flask_acpi_sleep(void)
-{
-    return domain_has_xen(current->domain, XEN__SLEEP);
-}
-
-static int flask_change_freq(void)
-{
-    return domain_has_xen(current->domain, XEN__FREQUENCY);
-}
-
-static int flask_getidletime(void)
-{
-    return domain_has_xen(current->domain, XEN__GETIDLE);
-}
-
 static int flask_machine_memory_map(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_MMU, MMU__MEMORYMAP, NULL);
@@ -1519,16 +1481,7 @@ static struct xsm_operations flask_ops = {
     .mem_event_op = flask_mem_event_op,
     .mem_sharing_op = flask_mem_sharing_op,
     .apic = flask_apic,
-    .xen_settime = flask_xen_settime,
-    .memtype = flask_memtype,
-    .microcode = flask_microcode,
-    .platform_quirk = flask_platform_quirk,
     .platform_op = flask_platform_op,
-    .firmware_info = flask_firmware_info,
-    .efi_call = flask_efi_call,
-    .acpi_sleep = flask_acpi_sleep,
-    .change_freq = flask_change_freq,
-    .getidletime = flask_getidletime,
     .machine_memory_map = flask_machine_memory_map,
     .domain_memory_map = flask_domain_memory_map,
     .mmu_update = flask_mmu_update,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:52:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:52:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapB3-0007b5-31; Tue, 20 Nov 2012 14:51:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TapB1-0007aa-AS
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:51:51 +0000
Received: from [85.158.143.99:24334] by server-1.bemta-4.messagelabs.com id
	AC/39-27934-6099BA05; Tue, 20 Nov 2012 14:51:50 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-12.tower-216.messagelabs.com!1353423108!25407751!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14763 invoked from network); 20 Nov 2012 14:51:48 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-12.tower-216.messagelabs.com with SMTP;
	20 Nov 2012 14:51:48 -0000
X-TM-IMSS-Message-ID: <9cf7a36d000bdf6b@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9cf7a36d000bdf6b ;
	Tue, 20 Nov 2012 09:51:07 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKEpd9V028173; 
	Tue, 20 Nov 2012 09:51:40 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Tue, 20 Nov 2012 09:51:36 -0500
Message-Id: <1353423098-16371-4-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 3/5] xen: sysctl XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

A number of the sysctl XSM hooks have no parameters or only pass the
operation ID, making them redundant with the xsm_sysctl hook. Remove
these redundant hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/platform_hypercall.c |  12 ----
 xen/arch/x86/sysctl.c             |  13 ----
 xen/common/sysctl.c               |  44 --------------
 xen/include/xsm/dummy.h           |  60 ------------------
 xen/include/xsm/xsm.h             |  72 ----------------------
 xen/xsm/dummy.c                   |  12 ----
 xen/xsm/flask/hooks.c             | 125 ++++++++++++--------------------------
 7 files changed, 38 insertions(+), 300 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 738bed0..ffac6ac 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -419,10 +419,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_set_processor_pminfo:
-        ret = xsm_setpminfo();
-        if ( ret )
-            break;
-
         switch ( op->u.set_pminfo.type )
         {
         case XEN_PM_PX:
@@ -475,10 +471,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
         g_info = &op->u.pcpu_info;
 
-        ret = xsm_getcpuinfo();
-        if ( ret )
-            break;
-
         if ( !get_cpu_maps() )
         {
             ret = -EBUSY;
@@ -512,10 +504,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         struct xenpf_pcpu_version *ver = &op->u.pcpu_version;
 
-        ret = xsm_getcpuinfo();
-        if ( ret )
-            break;
-
         if ( !get_cpu_maps() )
         {
             ret = -EBUSY;
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index b84dd34..5b0c4b7 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -69,11 +69,6 @@ long arch_do_sysctl(
     {
         xen_sysctl_physinfo_t *pi = &sysctl->u.physinfo;
 
-        ret = xsm_physinfo();
-        if ( ret )
-            break;
-
-
         memset(pi, 0, sizeof(*pi));
         pi->threads_per_core =
             cpumask_weight(per_cpu(cpu_sibling_mask, 0));
@@ -103,10 +98,6 @@ long arch_do_sysctl(
         uint32_t i, max_cpu_index, last_online_cpu;
         xen_sysctl_topologyinfo_t *ti = &sysctl->u.topologyinfo;
 
-        ret = xsm_physinfo();
-        if ( ret )
-            break;
-
         last_online_cpu = cpumask_last(&cpu_online_map);
         max_cpu_index = min_t(uint32_t, ti->max_cpu_index, last_online_cpu);
         ti->max_cpu_index = last_online_cpu;
@@ -143,10 +134,6 @@ long arch_do_sysctl(
         uint32_t i, j, max_node_index, last_online_node;
         xen_sysctl_numainfo_t *ni = &sysctl->u.numainfo;
 
-        ret = xsm_physinfo();
-        if ( ret )
-            break;
-
         last_online_node = last_node(node_online_map);
         max_node_index = min_t(uint32_t, ni->max_node_index, last_online_node);
         ni->max_node_index = last_online_node;
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 599430e..cbefb0e 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -69,10 +69,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_tbuf_op:
     {
-        ret = xsm_tbufcontrol();
-        if ( ret )
-            break;
-
         ret = tb_control(&op->u.tbuf_op);
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -81,10 +77,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     
     case XEN_SYSCTL_sched_id:
     {
-        ret = xsm_sched_id();
-        if ( ret )
-            break;
-
         op->u.sched_id.sched_id = sched_id();
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -139,10 +131,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 #ifdef PERF_COUNTERS
     case XEN_SYSCTL_perfc_op:
     {
-        ret = xsm_perfcontrol();
-        if ( ret )
-            break;
-
         ret = perfc_control(&op->u.perfc_op);
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -153,10 +141,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 #ifdef LOCK_PROFILE
     case XEN_SYSCTL_lockprof_op:
     {
-        ret = xsm_lockprof();
-        if ( ret )
-            break;
-
         ret = spinlock_profile_control(&op->u.lockprof_op);
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -168,10 +152,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         char c;
         uint32_t i;
 
-        ret = xsm_debug_keys();
-        if ( ret )
-            break;
-
         ret = -EFAULT;
         for ( i = 0; i < op->u.debug_keys.nr_keys; i++ )
         {
@@ -190,10 +170,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
         nr_cpus = min(op->u.getcpuinfo.max_cpus, nr_cpu_ids);
 
-        ret = xsm_getcpuinfo();
-        if ( ret )
-            break;
-
         for ( i = 0; i < nr_cpus; i++ )
         {
             cpuinfo.idletime = get_cpu_idle_time(i);
@@ -210,10 +186,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_availheap:
     { 
-        ret = xsm_availheap();
-        if ( ret )
-            break;
-
         op->u.availheap.avail_bytes = avail_domheap_pages_region(
             op->u.availheap.node,
             op->u.availheap.min_bitwidth,
@@ -227,10 +199,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 #ifdef HAS_ACPI
     case XEN_SYSCTL_get_pmstat:
     {
-        ret = xsm_get_pmstat();
-        if ( ret )
-            break;
-
         ret = do_get_pm_info(&op->u.get_pmstat);
         if ( ret )
             break;
@@ -245,10 +213,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_pm_op:
     {
-        ret = xsm_pm_op();
-        if ( ret )
-            break;
-
         ret = do_pm_op(&op->u.pm_op);
         if ( ret && (ret != -EAGAIN) )
             break;
@@ -323,10 +287,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_cpupool_op:
     {
-        ret = xsm_cpupool_op();
-        if ( ret )
-            break;
-
         ret = cpupool_do_sysctl(&op->u.cpupool_op);
         if ( (ret == 0) && copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -335,10 +295,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_scheduler_op:
     {
-        ret = xsm_sched_op();
-        if ( ret )
-            break;
-
         ret = sched_adjust_global(&op->u.scheduler_op);
         if ( (ret == 0) && copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index aef7c4e..93e84dc 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -58,51 +58,11 @@ static XSM_INLINE int xsm_sysctl(int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_tbufcontrol(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_readconsole(uint32_t clear)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_sched_id(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_perfcontrol(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_debug_keys(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getcpuinfo(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_get_pmstat(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_setpminfo(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_pm_op(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_do_mca(void)
 {
     if ( !IS_PRIV(current->domain) )
@@ -110,11 +70,6 @@ static XSM_INLINE int xsm_do_mca(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_availheap(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
 {
     return 0;
@@ -358,16 +313,6 @@ static XSM_INLINE int xsm_lockprof(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_cpupool_op(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_sched_op(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_tmem_op(void)
 {
     return 0;
@@ -508,11 +453,6 @@ static XSM_INLINE int xsm_microcode(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_physinfo(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 903c7cb..f1ccd8e 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -46,16 +46,7 @@ struct xsm_operations {
     int (*set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
     int (*sysctl) (int cmd);
-    int (*tbufcontrol) (void);
     int (*readconsole) (uint32_t clear);
-    int (*sched_id) (void);
-    int (*perfcontrol) (void);
-    int (*debug_keys) (void);
-    int (*getcpuinfo) (void);
-    int (*availheap) (void);
-    int (*get_pmstat) (void);
-    int (*setpminfo) (void);
-    int (*pm_op) (void);
     int (*do_mca) (void);
 
     int (*evtchn_unbound) (struct domain *d, struct evtchn *chn, domid_t id2);
@@ -117,8 +108,6 @@ struct xsm_operations {
 
     int (*page_offline)(uint32_t cmd);
     int (*lockprof)(void);
-    int (*cpupool_op)(void);
-    int (*sched_op)(void);
     int (*tmem_op)(void);
     int (*tmem_control)(void);
 
@@ -138,7 +127,6 @@ struct xsm_operations {
     int (*xen_settime) (void);
     int (*memtype) (uint32_t access);
     int (*microcode) (void);
-    int (*physinfo) (void);
     int (*platform_quirk) (uint32_t);
     int (*platform_op) (uint32_t cmd);
     int (*firmware_info) (void);
@@ -201,56 +189,11 @@ static inline int xsm_sysctl (int cmd)
     return xsm_ops->sysctl(cmd);
 }
 
-static inline int xsm_tbufcontrol (void)
-{
-    return xsm_ops->tbufcontrol();
-}
-
 static inline int xsm_readconsole (uint32_t clear)
 {
     return xsm_ops->readconsole(clear);
 }
 
-static inline int xsm_sched_id (void)
-{
-    return xsm_ops->sched_id();
-}
-
-static inline int xsm_perfcontrol (void)
-{
-    return xsm_ops->perfcontrol();
-}
-
-static inline int xsm_debug_keys (void)
-{
-    return xsm_ops->debug_keys();
-}
-
-static inline int xsm_availheap (void)
-{
-    return xsm_ops->availheap();
-}
-
-static inline int xsm_getcpuinfo (void)
-{
-    return xsm_ops->getcpuinfo();
-}
-
-static inline int xsm_get_pmstat(void)
-{
-    return xsm_ops->get_pmstat();
-}
-
-static inline int xsm_setpminfo(void)
-{
-    return xsm_ops->setpminfo();
-}
-
-static inline int xsm_pm_op(void)
-{
-    return xsm_ops->pm_op();
-}
-
 static inline int xsm_do_mca(void)
 {
     return xsm_ops->do_mca();
@@ -502,16 +445,6 @@ static inline int xsm_lockprof(void)
     return xsm_ops->lockprof();
 }
 
-static inline int xsm_cpupool_op(void)
-{
-    return xsm_ops->cpupool_op();
-}
-
-static inline int xsm_sched_op(void)
-{
-    return xsm_ops->sched_op();
-}
-
 static inline int xsm_tmem_op(void)
 {
     return xsm_ops->tmem_op();
@@ -593,11 +526,6 @@ static inline int xsm_microcode (void)
     return xsm_ops->microcode();
 }
 
-static inline int xsm_physinfo (void)
-{
-    return xsm_ops->physinfo();
-}
-
 static inline int xsm_platform_quirk (uint32_t quirk)
 {
     return xsm_ops->platform_quirk(quirk);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 9bb86ef..03a17ba 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -35,16 +35,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, set_target);
     set_to_dummy_if_null(ops, domctl);
     set_to_dummy_if_null(ops, sysctl);
-    set_to_dummy_if_null(ops, tbufcontrol);
     set_to_dummy_if_null(ops, readconsole);
-    set_to_dummy_if_null(ops, sched_id);
-    set_to_dummy_if_null(ops, perfcontrol);
-    set_to_dummy_if_null(ops, debug_keys);
-    set_to_dummy_if_null(ops, getcpuinfo);
-    set_to_dummy_if_null(ops, availheap);
-    set_to_dummy_if_null(ops, get_pmstat);
-    set_to_dummy_if_null(ops, setpminfo);
-    set_to_dummy_if_null(ops, pm_op);
     set_to_dummy_if_null(ops, do_mca);
 
     set_to_dummy_if_null(ops, evtchn_unbound);
@@ -104,8 +95,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
 
     set_to_dummy_if_null(ops, page_offline);
     set_to_dummy_if_null(ops, lockprof);
-    set_to_dummy_if_null(ops, cpupool_op);
-    set_to_dummy_if_null(ops, sched_op);
     set_to_dummy_if_null(ops, tmem_op);
     set_to_dummy_if_null(ops, tmem_control);
 
@@ -125,7 +114,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, xen_settime);
     set_to_dummy_if_null(ops, memtype);
     set_to_dummy_if_null(ops, microcode);
-    set_to_dummy_if_null(ops, physinfo);
     set_to_dummy_if_null(ops, platform_quirk);
     set_to_dummy_if_null(ops, platform_op);
     set_to_dummy_if_null(ops, firmware_info);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index f0216e0..d72a807 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -702,37 +702,57 @@ static int flask_sysctl(int cmd)
     {
     /* These have individual XSM hooks */
     case XEN_SYSCTL_readconsole:
+    case XEN_SYSCTL_getdomaininfolist:
+    case XEN_SYSCTL_page_offline_op:
+#ifdef CONFIG_X86
+    case XEN_SYSCTL_cpu_hotplug:
+#endif
+        return 0;
+
     case XEN_SYSCTL_tbuf_op:
+        return domain_has_xen(current->domain, XEN__TBUFCONTROL);
+
     case XEN_SYSCTL_sched_id:
+        return domain_has_xen(current->domain, XEN__SCHEDULER);
+
     case XEN_SYSCTL_perfc_op:
-    case XEN_SYSCTL_getdomaininfolist:
+        return domain_has_xen(current->domain, XEN__PERFCONTROL);
+
     case XEN_SYSCTL_debug_keys:
+        return domain_has_xen(current->domain, XEN__DEBUG);
+
     case XEN_SYSCTL_getcpuinfo:
+        return domain_has_xen(current->domain, XEN__GETCPUINFO);
+
     case XEN_SYSCTL_availheap:
+        return domain_has_xen(current->domain, XEN__HEAP);
+
     case XEN_SYSCTL_get_pmstat:
+        return domain_has_xen(current->domain, XEN__PM_OP);
+
     case XEN_SYSCTL_pm_op:
-    case XEN_SYSCTL_page_offline_op:
+        return domain_has_xen(current->domain, XEN__PM_OP);
+
     case XEN_SYSCTL_lockprof_op:
+        return domain_has_xen(current->domain, XEN__LOCKPROF);
+
     case XEN_SYSCTL_cpupool_op:
+        return domain_has_xen(current->domain, XEN__CPUPOOL_OP);
+
     case XEN_SYSCTL_scheduler_op:
-#ifdef CONFIG_X86
+        return domain_has_xen(current->domain, XEN__SCHED_OP);
+
     case XEN_SYSCTL_physinfo:
-    case XEN_SYSCTL_cpu_hotplug:
     case XEN_SYSCTL_topologyinfo:
     case XEN_SYSCTL_numainfo:
-#endif
-        return 0;
+        return domain_has_xen(current->domain, XEN__PHYSINFO);
+
     default:
         printk("flask_sysctl: Unknown op %d\n", cmd);
         return -EPERM;
     }
 }
 
-static int flask_tbufcontrol(void)
-{
-    return domain_has_xen(current->domain, XEN__TBUFCONTROL);
-}
-
 static int flask_readconsole(uint32_t clear)
 {
     u32 perms = XEN__READCONSOLE;
@@ -743,41 +763,6 @@ static int flask_readconsole(uint32_t clear)
     return domain_has_xen(current->domain, perms);
 }
 
-static int flask_sched_id(void)
-{
-    return domain_has_xen(current->domain, XEN__SCHEDULER);
-}
-
-static int flask_debug_keys(void)
-{
-    return domain_has_xen(current->domain, XEN__DEBUG);
-}
-
-static int flask_getcpuinfo(void)
-{
-    return domain_has_xen(current->domain, XEN__GETCPUINFO);
-}
-
-static int flask_availheap(void)
-{
-    return domain_has_xen(current->domain, XEN__HEAP);
-}
-
-static int flask_get_pmstat(void)
-{
-    return domain_has_xen(current->domain, XEN__PM_OP);
-}
-
-static int flask_setpminfo(void)
-{
-    return domain_has_xen(current->domain, XEN__PM_OP);
-}
-
-static int flask_pm_op(void)
-{
-    return domain_has_xen(current->domain, XEN__PM_OP);
-}
-
 static int flask_do_mca(void)
 {
     return domain_has_xen(current->domain, XEN__MCA_OP);
@@ -1031,21 +1016,6 @@ static inline int flask_page_offline(uint32_t cmd)
     }
 }
 
-static inline int flask_lockprof(void)
-{
-    return domain_has_xen(current->domain, XEN__LOCKPROF);
-}
-
-static inline int flask_cpupool_op(void)
-{
-    return domain_has_xen(current->domain, XEN__CPUPOOL_OP);
-}
-
-static inline int flask_sched_op(void)
-{
-    return domain_has_xen(current->domain, XEN__SCHED_OP);
-}
-
 static inline int flask_tmem_op(void)
 {
     return domain_has_xen(current->domain, XEN__TMEM_OP);
@@ -1056,11 +1026,6 @@ static inline int flask_tmem_control(void)
     return domain_has_xen(current->domain, XEN__TMEM_CONTROL);
 }
 
-static int flask_perfcontrol(void)
-{
-    return domain_has_xen(current->domain, XEN__PERFCONTROL);
-}
-
 #ifdef CONFIG_X86
 static int flask_shadow_control(struct domain *d, uint32_t op)
 {
@@ -1253,11 +1218,6 @@ static int flask_microcode(void)
     return domain_has_xen(current->domain, XEN__MICROCODE);
 }
 
-static int flask_physinfo(void)
-{
-    return domain_has_xen(current->domain, XEN__PHYSINFO);
-}
-
 static int flask_platform_quirk(uint32_t quirk)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN, XEN__QUIRK, NULL);
@@ -1278,17 +1238,21 @@ static int flask_platform_op(uint32_t op)
     case XENPF_enter_acpi_sleep:
     case XENPF_change_freq:
     case XENPF_getidletime:
-    case XENPF_set_processor_pminfo:
-    case XENPF_get_cpuinfo:
-    case XENPF_get_cpu_version:
     case XENPF_cpu_online:
     case XENPF_cpu_offline:
     case XENPF_cpu_hotadd:
     case XENPF_mem_hotadd:
         /* These operations have their own XSM hooks */
         return 0;
+
+    case XENPF_set_processor_pminfo:
     case XENPF_core_parking:
         return domain_has_xen(current->domain, XEN__PM_OP);
+
+    case XENPF_get_cpu_version:
+    case XENPF_get_cpuinfo:
+        return domain_has_xen(current->domain, XEN__GETCPUINFO);
+
     default:
         printk("flask_platform_op: Unknown op %d\n", op);
         return -EPERM;
@@ -1484,16 +1448,7 @@ static struct xsm_operations flask_ops = {
     .set_target = flask_set_target,
     .domctl = flask_domctl,
     .sysctl = flask_sysctl,
-    .tbufcontrol = flask_tbufcontrol,
     .readconsole = flask_readconsole,
-    .sched_id = flask_sched_id,
-    .perfcontrol = flask_perfcontrol,
-    .debug_keys = flask_debug_keys,
-    .getcpuinfo = flask_getcpuinfo,
-    .availheap = flask_availheap,
-    .get_pmstat = flask_get_pmstat,
-    .setpminfo = flask_setpminfo,
-    .pm_op = flask_pm_op,
     .do_mca = flask_do_mca,
 
     .evtchn_unbound = flask_evtchn_unbound,
@@ -1548,9 +1503,6 @@ static struct xsm_operations flask_ops = {
     .resource_setup_misc = flask_resource_setup_misc,
 
     .page_offline = flask_page_offline,
-    .lockprof = flask_lockprof,
-    .cpupool_op = flask_cpupool_op,
-    .sched_op = flask_sched_op,
     .tmem_op = flask_tmem_op,
     .tmem_control = flask_tmem_control,
 
@@ -1570,7 +1522,6 @@ static struct xsm_operations flask_ops = {
     .xen_settime = flask_xen_settime,
     .memtype = flask_memtype,
     .microcode = flask_microcode,
-    .physinfo = flask_physinfo,
     .platform_quirk = flask_platform_quirk,
     .platform_op = flask_platform_op,
     .firmware_info = flask_firmware_info,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:52:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:52:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapB3-0007b5-31; Tue, 20 Nov 2012 14:51:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TapB1-0007aa-AS
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:51:51 +0000
Received: from [85.158.143.99:24334] by server-1.bemta-4.messagelabs.com id
	AC/39-27934-6099BA05; Tue, 20 Nov 2012 14:51:50 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-12.tower-216.messagelabs.com!1353423108!25407751!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14763 invoked from network); 20 Nov 2012 14:51:48 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-12.tower-216.messagelabs.com with SMTP;
	20 Nov 2012 14:51:48 -0000
X-TM-IMSS-Message-ID: <9cf7a36d000bdf6b@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9cf7a36d000bdf6b ;
	Tue, 20 Nov 2012 09:51:07 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKEpd9V028173; 
	Tue, 20 Nov 2012 09:51:40 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Tue, 20 Nov 2012 09:51:36 -0500
Message-Id: <1353423098-16371-4-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 3/5] xen: sysctl XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

A number of the sysctl XSM hooks have no parameters or only pass the
operation ID, making them redundant with the xsm_sysctl hook. Remove
these redundant hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/platform_hypercall.c |  12 ----
 xen/arch/x86/sysctl.c             |  13 ----
 xen/common/sysctl.c               |  44 --------------
 xen/include/xsm/dummy.h           |  60 ------------------
 xen/include/xsm/xsm.h             |  72 ----------------------
 xen/xsm/dummy.c                   |  12 ----
 xen/xsm/flask/hooks.c             | 125 ++++++++++++--------------------------
 7 files changed, 38 insertions(+), 300 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 738bed0..ffac6ac 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -419,10 +419,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_set_processor_pminfo:
-        ret = xsm_setpminfo();
-        if ( ret )
-            break;
-
         switch ( op->u.set_pminfo.type )
         {
         case XEN_PM_PX:
@@ -475,10 +471,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
         g_info = &op->u.pcpu_info;
 
-        ret = xsm_getcpuinfo();
-        if ( ret )
-            break;
-
         if ( !get_cpu_maps() )
         {
             ret = -EBUSY;
@@ -512,10 +504,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         struct xenpf_pcpu_version *ver = &op->u.pcpu_version;
 
-        ret = xsm_getcpuinfo();
-        if ( ret )
-            break;
-
         if ( !get_cpu_maps() )
         {
             ret = -EBUSY;
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index b84dd34..5b0c4b7 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -69,11 +69,6 @@ long arch_do_sysctl(
     {
         xen_sysctl_physinfo_t *pi = &sysctl->u.physinfo;
 
-        ret = xsm_physinfo();
-        if ( ret )
-            break;
-
-
         memset(pi, 0, sizeof(*pi));
         pi->threads_per_core =
             cpumask_weight(per_cpu(cpu_sibling_mask, 0));
@@ -103,10 +98,6 @@ long arch_do_sysctl(
         uint32_t i, max_cpu_index, last_online_cpu;
         xen_sysctl_topologyinfo_t *ti = &sysctl->u.topologyinfo;
 
-        ret = xsm_physinfo();
-        if ( ret )
-            break;
-
         last_online_cpu = cpumask_last(&cpu_online_map);
         max_cpu_index = min_t(uint32_t, ti->max_cpu_index, last_online_cpu);
         ti->max_cpu_index = last_online_cpu;
@@ -143,10 +134,6 @@ long arch_do_sysctl(
         uint32_t i, j, max_node_index, last_online_node;
         xen_sysctl_numainfo_t *ni = &sysctl->u.numainfo;
 
-        ret = xsm_physinfo();
-        if ( ret )
-            break;
-
         last_online_node = last_node(node_online_map);
         max_node_index = min_t(uint32_t, ni->max_node_index, last_online_node);
         ni->max_node_index = last_online_node;
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 599430e..cbefb0e 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -69,10 +69,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_tbuf_op:
     {
-        ret = xsm_tbufcontrol();
-        if ( ret )
-            break;
-
         ret = tb_control(&op->u.tbuf_op);
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -81,10 +77,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     
     case XEN_SYSCTL_sched_id:
     {
-        ret = xsm_sched_id();
-        if ( ret )
-            break;
-
         op->u.sched_id.sched_id = sched_id();
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -139,10 +131,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 #ifdef PERF_COUNTERS
     case XEN_SYSCTL_perfc_op:
     {
-        ret = xsm_perfcontrol();
-        if ( ret )
-            break;
-
         ret = perfc_control(&op->u.perfc_op);
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -153,10 +141,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 #ifdef LOCK_PROFILE
     case XEN_SYSCTL_lockprof_op:
     {
-        ret = xsm_lockprof();
-        if ( ret )
-            break;
-
         ret = spinlock_profile_control(&op->u.lockprof_op);
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -168,10 +152,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         char c;
         uint32_t i;
 
-        ret = xsm_debug_keys();
-        if ( ret )
-            break;
-
         ret = -EFAULT;
         for ( i = 0; i < op->u.debug_keys.nr_keys; i++ )
         {
@@ -190,10 +170,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
         nr_cpus = min(op->u.getcpuinfo.max_cpus, nr_cpu_ids);
 
-        ret = xsm_getcpuinfo();
-        if ( ret )
-            break;
-
         for ( i = 0; i < nr_cpus; i++ )
         {
             cpuinfo.idletime = get_cpu_idle_time(i);
@@ -210,10 +186,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_availheap:
     { 
-        ret = xsm_availheap();
-        if ( ret )
-            break;
-
         op->u.availheap.avail_bytes = avail_domheap_pages_region(
             op->u.availheap.node,
             op->u.availheap.min_bitwidth,
@@ -227,10 +199,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 #ifdef HAS_ACPI
     case XEN_SYSCTL_get_pmstat:
     {
-        ret = xsm_get_pmstat();
-        if ( ret )
-            break;
-
         ret = do_get_pm_info(&op->u.get_pmstat);
         if ( ret )
             break;
@@ -245,10 +213,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_pm_op:
     {
-        ret = xsm_pm_op();
-        if ( ret )
-            break;
-
         ret = do_pm_op(&op->u.pm_op);
         if ( ret && (ret != -EAGAIN) )
             break;
@@ -323,10 +287,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_cpupool_op:
     {
-        ret = xsm_cpupool_op();
-        if ( ret )
-            break;
-
         ret = cpupool_do_sysctl(&op->u.cpupool_op);
         if ( (ret == 0) && copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -335,10 +295,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_scheduler_op:
     {
-        ret = xsm_sched_op();
-        if ( ret )
-            break;
-
         ret = sched_adjust_global(&op->u.scheduler_op);
         if ( (ret == 0) && copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index aef7c4e..93e84dc 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -58,51 +58,11 @@ static XSM_INLINE int xsm_sysctl(int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_tbufcontrol(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_readconsole(uint32_t clear)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_sched_id(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_perfcontrol(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_debug_keys(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getcpuinfo(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_get_pmstat(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_setpminfo(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_pm_op(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_do_mca(void)
 {
     if ( !IS_PRIV(current->domain) )
@@ -110,11 +70,6 @@ static XSM_INLINE int xsm_do_mca(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_availheap(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
 {
     return 0;
@@ -358,16 +313,6 @@ static XSM_INLINE int xsm_lockprof(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_cpupool_op(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_sched_op(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_tmem_op(void)
 {
     return 0;
@@ -508,11 +453,6 @@ static XSM_INLINE int xsm_microcode(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_physinfo(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 903c7cb..f1ccd8e 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -46,16 +46,7 @@ struct xsm_operations {
     int (*set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
     int (*sysctl) (int cmd);
-    int (*tbufcontrol) (void);
     int (*readconsole) (uint32_t clear);
-    int (*sched_id) (void);
-    int (*perfcontrol) (void);
-    int (*debug_keys) (void);
-    int (*getcpuinfo) (void);
-    int (*availheap) (void);
-    int (*get_pmstat) (void);
-    int (*setpminfo) (void);
-    int (*pm_op) (void);
     int (*do_mca) (void);
 
     int (*evtchn_unbound) (struct domain *d, struct evtchn *chn, domid_t id2);
@@ -117,8 +108,6 @@ struct xsm_operations {
 
     int (*page_offline)(uint32_t cmd);
     int (*lockprof)(void);
-    int (*cpupool_op)(void);
-    int (*sched_op)(void);
     int (*tmem_op)(void);
     int (*tmem_control)(void);
 
@@ -138,7 +127,6 @@ struct xsm_operations {
     int (*xen_settime) (void);
     int (*memtype) (uint32_t access);
     int (*microcode) (void);
-    int (*physinfo) (void);
     int (*platform_quirk) (uint32_t);
     int (*platform_op) (uint32_t cmd);
     int (*firmware_info) (void);
@@ -201,56 +189,11 @@ static inline int xsm_sysctl (int cmd)
     return xsm_ops->sysctl(cmd);
 }
 
-static inline int xsm_tbufcontrol (void)
-{
-    return xsm_ops->tbufcontrol();
-}
-
 static inline int xsm_readconsole (uint32_t clear)
 {
     return xsm_ops->readconsole(clear);
 }
 
-static inline int xsm_sched_id (void)
-{
-    return xsm_ops->sched_id();
-}
-
-static inline int xsm_perfcontrol (void)
-{
-    return xsm_ops->perfcontrol();
-}
-
-static inline int xsm_debug_keys (void)
-{
-    return xsm_ops->debug_keys();
-}
-
-static inline int xsm_availheap (void)
-{
-    return xsm_ops->availheap();
-}
-
-static inline int xsm_getcpuinfo (void)
-{
-    return xsm_ops->getcpuinfo();
-}
-
-static inline int xsm_get_pmstat(void)
-{
-    return xsm_ops->get_pmstat();
-}
-
-static inline int xsm_setpminfo(void)
-{
-    return xsm_ops->setpminfo();
-}
-
-static inline int xsm_pm_op(void)
-{
-    return xsm_ops->pm_op();
-}
-
 static inline int xsm_do_mca(void)
 {
     return xsm_ops->do_mca();
@@ -502,16 +445,6 @@ static inline int xsm_lockprof(void)
     return xsm_ops->lockprof();
 }
 
-static inline int xsm_cpupool_op(void)
-{
-    return xsm_ops->cpupool_op();
-}
-
-static inline int xsm_sched_op(void)
-{
-    return xsm_ops->sched_op();
-}
-
 static inline int xsm_tmem_op(void)
 {
     return xsm_ops->tmem_op();
@@ -593,11 +526,6 @@ static inline int xsm_microcode (void)
     return xsm_ops->microcode();
 }
 
-static inline int xsm_physinfo (void)
-{
-    return xsm_ops->physinfo();
-}
-
 static inline int xsm_platform_quirk (uint32_t quirk)
 {
     return xsm_ops->platform_quirk(quirk);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 9bb86ef..03a17ba 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -35,16 +35,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, set_target);
     set_to_dummy_if_null(ops, domctl);
     set_to_dummy_if_null(ops, sysctl);
-    set_to_dummy_if_null(ops, tbufcontrol);
     set_to_dummy_if_null(ops, readconsole);
-    set_to_dummy_if_null(ops, sched_id);
-    set_to_dummy_if_null(ops, perfcontrol);
-    set_to_dummy_if_null(ops, debug_keys);
-    set_to_dummy_if_null(ops, getcpuinfo);
-    set_to_dummy_if_null(ops, availheap);
-    set_to_dummy_if_null(ops, get_pmstat);
-    set_to_dummy_if_null(ops, setpminfo);
-    set_to_dummy_if_null(ops, pm_op);
     set_to_dummy_if_null(ops, do_mca);
 
     set_to_dummy_if_null(ops, evtchn_unbound);
@@ -104,8 +95,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
 
     set_to_dummy_if_null(ops, page_offline);
     set_to_dummy_if_null(ops, lockprof);
-    set_to_dummy_if_null(ops, cpupool_op);
-    set_to_dummy_if_null(ops, sched_op);
     set_to_dummy_if_null(ops, tmem_op);
     set_to_dummy_if_null(ops, tmem_control);
 
@@ -125,7 +114,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, xen_settime);
     set_to_dummy_if_null(ops, memtype);
     set_to_dummy_if_null(ops, microcode);
-    set_to_dummy_if_null(ops, physinfo);
     set_to_dummy_if_null(ops, platform_quirk);
     set_to_dummy_if_null(ops, platform_op);
     set_to_dummy_if_null(ops, firmware_info);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index f0216e0..d72a807 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -702,37 +702,57 @@ static int flask_sysctl(int cmd)
     {
     /* These have individual XSM hooks */
     case XEN_SYSCTL_readconsole:
+    case XEN_SYSCTL_getdomaininfolist:
+    case XEN_SYSCTL_page_offline_op:
+#ifdef CONFIG_X86
+    case XEN_SYSCTL_cpu_hotplug:
+#endif
+        return 0;
+
     case XEN_SYSCTL_tbuf_op:
+        return domain_has_xen(current->domain, XEN__TBUFCONTROL);
+
     case XEN_SYSCTL_sched_id:
+        return domain_has_xen(current->domain, XEN__SCHEDULER);
+
     case XEN_SYSCTL_perfc_op:
-    case XEN_SYSCTL_getdomaininfolist:
+        return domain_has_xen(current->domain, XEN__PERFCONTROL);
+
     case XEN_SYSCTL_debug_keys:
+        return domain_has_xen(current->domain, XEN__DEBUG);
+
     case XEN_SYSCTL_getcpuinfo:
+        return domain_has_xen(current->domain, XEN__GETCPUINFO);
+
     case XEN_SYSCTL_availheap:
+        return domain_has_xen(current->domain, XEN__HEAP);
+
     case XEN_SYSCTL_get_pmstat:
+        return domain_has_xen(current->domain, XEN__PM_OP);
+
     case XEN_SYSCTL_pm_op:
-    case XEN_SYSCTL_page_offline_op:
+        return domain_has_xen(current->domain, XEN__PM_OP);
+
     case XEN_SYSCTL_lockprof_op:
+        return domain_has_xen(current->domain, XEN__LOCKPROF);
+
     case XEN_SYSCTL_cpupool_op:
+        return domain_has_xen(current->domain, XEN__CPUPOOL_OP);
+
     case XEN_SYSCTL_scheduler_op:
-#ifdef CONFIG_X86
+        return domain_has_xen(current->domain, XEN__SCHED_OP);
+
     case XEN_SYSCTL_physinfo:
-    case XEN_SYSCTL_cpu_hotplug:
     case XEN_SYSCTL_topologyinfo:
     case XEN_SYSCTL_numainfo:
-#endif
-        return 0;
+        return domain_has_xen(current->domain, XEN__PHYSINFO);
+
     default:
         printk("flask_sysctl: Unknown op %d\n", cmd);
         return -EPERM;
     }
 }
 
-static int flask_tbufcontrol(void)
-{
-    return domain_has_xen(current->domain, XEN__TBUFCONTROL);
-}
-
 static int flask_readconsole(uint32_t clear)
 {
     u32 perms = XEN__READCONSOLE;
@@ -743,41 +763,6 @@ static int flask_readconsole(uint32_t clear)
     return domain_has_xen(current->domain, perms);
 }
 
-static int flask_sched_id(void)
-{
-    return domain_has_xen(current->domain, XEN__SCHEDULER);
-}
-
-static int flask_debug_keys(void)
-{
-    return domain_has_xen(current->domain, XEN__DEBUG);
-}
-
-static int flask_getcpuinfo(void)
-{
-    return domain_has_xen(current->domain, XEN__GETCPUINFO);
-}
-
-static int flask_availheap(void)
-{
-    return domain_has_xen(current->domain, XEN__HEAP);
-}
-
-static int flask_get_pmstat(void)
-{
-    return domain_has_xen(current->domain, XEN__PM_OP);
-}
-
-static int flask_setpminfo(void)
-{
-    return domain_has_xen(current->domain, XEN__PM_OP);
-}
-
-static int flask_pm_op(void)
-{
-    return domain_has_xen(current->domain, XEN__PM_OP);
-}
-
 static int flask_do_mca(void)
 {
     return domain_has_xen(current->domain, XEN__MCA_OP);
@@ -1031,21 +1016,6 @@ static inline int flask_page_offline(uint32_t cmd)
     }
 }
 
-static inline int flask_lockprof(void)
-{
-    return domain_has_xen(current->domain, XEN__LOCKPROF);
-}
-
-static inline int flask_cpupool_op(void)
-{
-    return domain_has_xen(current->domain, XEN__CPUPOOL_OP);
-}
-
-static inline int flask_sched_op(void)
-{
-    return domain_has_xen(current->domain, XEN__SCHED_OP);
-}
-
 static inline int flask_tmem_op(void)
 {
     return domain_has_xen(current->domain, XEN__TMEM_OP);
@@ -1056,11 +1026,6 @@ static inline int flask_tmem_control(void)
     return domain_has_xen(current->domain, XEN__TMEM_CONTROL);
 }
 
-static int flask_perfcontrol(void)
-{
-    return domain_has_xen(current->domain, XEN__PERFCONTROL);
-}
-
 #ifdef CONFIG_X86
 static int flask_shadow_control(struct domain *d, uint32_t op)
 {
@@ -1253,11 +1218,6 @@ static int flask_microcode(void)
     return domain_has_xen(current->domain, XEN__MICROCODE);
 }
 
-static int flask_physinfo(void)
-{
-    return domain_has_xen(current->domain, XEN__PHYSINFO);
-}
-
 static int flask_platform_quirk(uint32_t quirk)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN, XEN__QUIRK, NULL);
@@ -1278,17 +1238,21 @@ static int flask_platform_op(uint32_t op)
     case XENPF_enter_acpi_sleep:
     case XENPF_change_freq:
     case XENPF_getidletime:
-    case XENPF_set_processor_pminfo:
-    case XENPF_get_cpuinfo:
-    case XENPF_get_cpu_version:
     case XENPF_cpu_online:
     case XENPF_cpu_offline:
     case XENPF_cpu_hotadd:
     case XENPF_mem_hotadd:
         /* These operations have their own XSM hooks */
         return 0;
+
+    case XENPF_set_processor_pminfo:
     case XENPF_core_parking:
         return domain_has_xen(current->domain, XEN__PM_OP);
+
+    case XENPF_get_cpu_version:
+    case XENPF_get_cpuinfo:
+        return domain_has_xen(current->domain, XEN__GETCPUINFO);
+
     default:
         printk("flask_platform_op: Unknown op %d\n", op);
         return -EPERM;
@@ -1484,16 +1448,7 @@ static struct xsm_operations flask_ops = {
     .set_target = flask_set_target,
     .domctl = flask_domctl,
     .sysctl = flask_sysctl,
-    .tbufcontrol = flask_tbufcontrol,
     .readconsole = flask_readconsole,
-    .sched_id = flask_sched_id,
-    .perfcontrol = flask_perfcontrol,
-    .debug_keys = flask_debug_keys,
-    .getcpuinfo = flask_getcpuinfo,
-    .availheap = flask_availheap,
-    .get_pmstat = flask_get_pmstat,
-    .setpminfo = flask_setpminfo,
-    .pm_op = flask_pm_op,
     .do_mca = flask_do_mca,
 
     .evtchn_unbound = flask_evtchn_unbound,
@@ -1548,9 +1503,6 @@ static struct xsm_operations flask_ops = {
     .resource_setup_misc = flask_resource_setup_misc,
 
     .page_offline = flask_page_offline,
-    .lockprof = flask_lockprof,
-    .cpupool_op = flask_cpupool_op,
-    .sched_op = flask_sched_op,
     .tmem_op = flask_tmem_op,
     .tmem_control = flask_tmem_control,
 
@@ -1570,7 +1522,6 @@ static struct xsm_operations flask_ops = {
     .xen_settime = flask_xen_settime,
     .memtype = flask_memtype,
     .microcode = flask_microcode,
-    .physinfo = flask_physinfo,
     .platform_quirk = flask_platform_quirk,
     .platform_op = flask_platform_op,
     .firmware_info = flask_firmware_info,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:52:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:52:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapBJ-0007gB-Oc; Tue, 20 Nov 2012 14:52:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TapBI-0007fd-4O
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:52:08 +0000
Received: from [85.158.143.99:25476] by server-2.bemta-4.messagelabs.com id
	34/99-28922-7199BA05; Tue, 20 Nov 2012 14:52:07 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-216.messagelabs.com!1353423111!23152002!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2692 invoked from network); 20 Nov 2012 14:51:51 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-11.tower-216.messagelabs.com with SMTP;
	20 Nov 2012 14:51:51 -0000
X-TM-IMSS-Message-ID: <9cf7a63b000bdf6e@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9cf7a63b000bdf6e ;
	Tue, 20 Nov 2012 09:51:08 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKEpd9X028173; 
	Tue, 20 Nov 2012 09:51:41 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Tue, 20 Nov 2012 09:51:38 -0500
Message-Id: <1353423098-16371-6-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH RFC 5/5] xen/xsm: include default hook action in
	name
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Include the default XSM hook action in the name of the hook in order to
allow quick understanding of how the call site is expected to be used
(dom0-only, arbitrary guest, or target-only).

Abbreviation explanation:
 xsm_dm_*      Usable only by device model (IS_PRIV_FOR)
 xsm_hook_*    No access check in dummy module. The calling code is
               either guest-accessible or covered by another check
 xsm_priv_*    Privileged command (IS_PRIV)
 xsm_target_*  Usable by guest or its device model targeted to the guest

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/cpu/mcheck/mce.c     |   2 +-
 xen/arch/x86/domctl.c             |  10 +-
 xen/arch/x86/hvm/hvm.c            |  26 +--
 xen/arch/x86/irq.c                |   2 +-
 xen/arch/x86/mm.c                 |  20 +-
 xen/arch/x86/mm/mem_event.c       |   4 +-
 xen/arch/x86/mm/mem_sharing.c     |   4 +-
 xen/arch/x86/mm/paging.c          |   2 +-
 xen/arch/x86/msi.c                |   2 +-
 xen/arch/x86/physdev.c            |  12 +-
 xen/arch/x86/platform_hypercall.c |  12 +-
 xen/arch/x86/sysctl.c             |   4 +-
 xen/arch/x86/traps.c              |   2 +-
 xen/common/domain.c               |   2 +-
 xen/common/domctl.c               |  10 +-
 xen/common/event_channel.c        |  14 +-
 xen/common/grant_table.c          |  16 +-
 xen/common/kexec.c                |   2 +-
 xen/common/memory.c               |   8 +-
 xen/common/schedule.c             |   2 +-
 xen/common/sysctl.c               |   6 +-
 xen/common/xenoprof.c             |   2 +-
 xen/drivers/char/console.c        |   2 +-
 xen/drivers/passthrough/iommu.c   |  10 +-
 xen/drivers/passthrough/pci.c     |   4 +-
 xen/include/xen/tmem_xen.h        |   4 +-
 xen/include/xsm/dummy.h           | 140 ++++++-------
 xen/include/xsm/xsm.h             | 428 +++++++++++++++++++-------------------
 xen/xsm/dummy.c                   | 150 ++++++-------
 xen/xsm/flask/hooks.c             | 296 +++++++++++++-------------
 30 files changed, 599 insertions(+), 599 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 658774a..72f6f18 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1293,7 +1293,7 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
     struct xen_mc_msrinject *mc_msrinject;
     struct xen_mc_mceinject *mc_mceinject;
 
-    ret = xsm_do_mca();
+    ret = xsm_priv_do_mca();
     if ( ret )
         return x86_mcerr(NULL, ret);
 
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 2630bdb..9541ef8 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -76,7 +76,7 @@ long arch_do_domctl(
 
         if ( np == 0 )
             ret = 0;
-        else if ( xsm_ioport_permission(d, fp, fp + np - 1, allow) )
+        else if ( xsm_hook_ioport_permission(d, fp, fp + np - 1, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = ioports_permit_access(d, fp, fp + np - 1);
@@ -566,7 +566,7 @@ long arch_do_domctl(
         if ( !is_hvm_domain(d) )
             break;
 
-        ret = xsm_bind_pt_irq(d, bind);
+        ret = xsm_hook_bind_pt_irq(d, bind);
         if ( ret )
             break;
 
@@ -599,7 +599,7 @@ long arch_do_domctl(
              !irq_access_permitted(current->domain, bind->machine_irq) )
             break;
 
-        ret = xsm_unbind_pt_irq(d, bind);
+        ret = xsm_hook_unbind_pt_irq(d, bind);
         if ( ret )
             break;
 
@@ -634,7 +634,7 @@ long arch_do_domctl(
              !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
             break;
 
-        ret = xsm_iomem_mapping(d, mfn, mfn + nr_mfns - 1, add);
+        ret = xsm_hook_iomem_mapping(d, mfn, mfn + nr_mfns - 1, add);
         if ( ret )
             break;
 
@@ -712,7 +712,7 @@ long arch_do_domctl(
              !ioports_access_permitted(current->domain, fmp, fmp + np - 1) )
             break;
 
-        ret = xsm_ioport_mapping(d, fmp, fmp + np - 1, add);
+        ret = xsm_hook_ioport_mapping(d, fmp, fmp + np - 1, add);
         if ( ret )
             break;
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 5bdde8d..e75c139 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3400,7 +3400,7 @@ static int hvmop_set_pci_intx_level(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_set_pci_intx_level(d);
+    rc = xsm_dm_hvm_set_pci_intx_level(d);
     if ( rc )
         goto out;
 
@@ -3567,7 +3567,7 @@ static int hvmop_set_isa_irq_level(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_set_isa_irq_level(d);
+    rc = xsm_dm_hvm_set_isa_irq_level(d);
     if ( rc )
         goto out;
 
@@ -3611,7 +3611,7 @@ static int hvmop_set_pci_link_route(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_set_pci_link_route(d);
+    rc = xsm_dm_hvm_set_pci_link_route(d);
     if ( rc )
         goto out;
 
@@ -3641,7 +3641,7 @@ static int hvmop_inject_msi(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_inject_msi(d);
+    rc = xsm_dm_hvm_inject_msi(d);
     if ( rc )
         goto out;
 
@@ -3738,7 +3738,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail;
 
@@ -3984,7 +3984,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail2;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail2;
 
@@ -4023,7 +4023,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail3;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail3;
 
@@ -4069,7 +4069,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail_getmemtype;
 
@@ -4124,7 +4124,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail4;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail4;
 
@@ -4203,7 +4203,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail5;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail5;
 
@@ -4238,7 +4238,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail6;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail6;
 
@@ -4274,7 +4274,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) || !paging_mode_shadow(d) )
             goto param_fail7;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail7;
 
@@ -4328,7 +4328,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail8;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail8;
 
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 238600a..ba8a5ce 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1874,7 +1874,7 @@ int map_domain_pirq(
         return 0;
     }
 
-    ret = xsm_map_domain_pirq(d, irq, data);
+    ret = xsm_hook_map_domain_pirq(d, irq, data);
     if ( ret )
     {
         dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq %d mapping to pirq %d\n",
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 39b2cc7..1dbe4ef 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2715,7 +2715,7 @@ long do_mmuext_op(
         goto out;
     }
 
-    rc = xsm_mmuext_op(d, pg_owner);
+    rc = xsm_target_mmuext_op(d, pg_owner);
     if ( rc )
     {
         rcu_unlock_domain(pg_owner);
@@ -2787,7 +2787,7 @@ long do_mmuext_op(
                 break;
             }
 
-            if ( (rc = xsm_memory_pin_page(d, pg_owner, page)) != 0 )
+            if ( (rc = xsm_hook_memory_pin_page(d, pg_owner, page)) != 0 )
             {
                 put_page_and_type(page);
                 okay = 0;
@@ -3244,7 +3244,7 @@ long do_mmu_update(
             }
             if ( xsm_needed != xsm_checked )
             {
-                rc = xsm_mmu_update(d, pt_owner, pg_owner, xsm_needed);
+                rc = xsm_target_mmu_update(d, pt_owner, pg_owner, xsm_needed);
                 if ( rc )
                     break;
                 xsm_checked = xsm_needed;
@@ -3363,7 +3363,7 @@ long do_mmu_update(
             xsm_needed |= XSM_MMU_MACHPHYS_UPDATE;
             if ( xsm_needed != xsm_checked )
             {
-                rc = xsm_mmu_update(d, NULL, pg_owner, xsm_needed);
+                rc = xsm_target_mmu_update(d, NULL, pg_owner, xsm_needed);
                 if ( rc )
                     break;
                 xsm_checked = xsm_needed;
@@ -3931,7 +3931,7 @@ static int __do_update_va_mapping(
 
     perfc_incr(calls_to_update_va);
 
-    rc = xsm_update_va_mapping(d, pg_owner, val);
+    rc = xsm_target_update_va_mapping(d, pg_owner, val);
     if ( rc )
         return rc;
 
@@ -4402,7 +4402,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        if ( xsm_add_to_physmap(current->domain, d) )
+        if ( xsm_target_add_to_physmap(current->domain, d) )
         {
             rcu_unlock_domain(d);
             return -EPERM;
@@ -4441,7 +4441,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        rc = xsm_domain_memory_map(d);
+        rc = xsm_target_domain_memory_map(d);
         if ( rc )
         {
             rcu_unlock_domain(d);
@@ -4516,7 +4516,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         XEN_GUEST_HANDLE_PARAM(e820entry_t) buffer_param;
         unsigned int i;
 
-        rc = xsm_machine_memory_map();
+        rc = xsm_priv_machine_memory_map();
         if ( rc )
             return rc;
 
@@ -4600,9 +4600,9 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
             return -ESRCH;
 
         if ( op == XENMEM_set_pod_target )
-            rc = xsm_set_pod_target(d);
+            rc = xsm_priv_set_pod_target(d);
         else
-            rc = xsm_get_pod_target(d);
+            rc = xsm_priv_get_pod_target(d);
 
         if ( rc != 0 )
             goto pod_target_out_unlock;
diff --git a/xen/arch/x86/mm/mem_event.c b/xen/arch/x86/mm/mem_event.c
index c2b3670..3a7605c 100644
--- a/xen/arch/x86/mm/mem_event.c
+++ b/xen/arch/x86/mm/mem_event.c
@@ -449,7 +449,7 @@ int do_mem_event_op(int op, uint32_t domain, void *arg)
     if ( ret )
         return ret;
 
-    ret = xsm_mem_event_op(d, op);
+    ret = xsm_dm_mem_event_op(d, op);
     if ( ret )
         goto out;
 
@@ -502,7 +502,7 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
 {
     int rc;
 
-    rc = xsm_mem_event_control(d, mec->mode, mec->op);
+    rc = xsm_dm_mem_event_control(d, mec->mode, mec->op);
     if ( rc )
         return rc;
 
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 9229b83..57f02af 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1351,7 +1351,7 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( rc )
                 return rc;
 
-            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            rc = xsm_dm_mem_sharing_op(d, cd, mec->op);
             if ( rc )
             {
                 rcu_unlock_domain(cd);
@@ -1415,7 +1415,7 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( rc )
                 return rc;
 
-            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            rc = xsm_dm_mem_sharing_op(d, cd, mec->op);
             if ( rc )
             {
                 rcu_unlock_domain(cd);
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index ea44e39..1815696 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -678,7 +678,7 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
         return -EINVAL;
     }
 
-    rc = xsm_shadow_control(d, sc->op);
+    rc = xsm_hook_shadow_control(d, sc->op);
     if ( rc )
         return rc;
 
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index e48ad2e..4bad230 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1016,7 +1016,7 @@ int pci_restore_msi_state(struct pci_dev *pdev)
     if (!pdev)
         return -EINVAL;
 
-    ret = xsm_resource_setup_pci((pdev->seg << 16) | (pdev->bus << 8) | pdev->devfn);
+    ret = xsm_priv_resource_setup_pci((pdev->seg << 16) | (pdev->bus << 8) | pdev->devfn);
     if ( ret )
         return ret;
 
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 9c30245..a894c43 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -232,7 +232,7 @@ int physdev_unmap_pirq(domid_t domid, int pirq)
             goto free_domain;
     }
 
-    ret = xsm_unmap_domain_pirq(d, domain_pirq_to_irq(d, pirq));
+    ret = xsm_dm_unmap_domain_pirq(d, domain_pirq_to_irq(d, pirq));
     if ( ret )
         goto free_domain;
 
@@ -423,7 +423,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = xsm_apic(v->domain, cmd);
+        ret = xsm_priv_apic(v->domain, cmd);
         if ( ret )
             break;
         ret = ioapic_guest_read(apic.apic_physbase, apic.reg, &apic.value);
@@ -437,7 +437,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = xsm_apic(v->domain, cmd);
+        ret = xsm_priv_apic(v->domain, cmd);
         if ( ret )
             break;
         ret = ioapic_guest_write(apic.apic_physbase, apic.reg, apic.value);
@@ -453,7 +453,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         /* Use the APIC check since this dummy hypercall should still only
          * be called by the domain with access to program the ioapic */
-        ret = xsm_apic(v->domain, cmd);
+        ret = xsm_priv_apic(v->domain, cmd);
         if ( ret )
             break;
 
@@ -578,7 +578,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_pci_mmcfg_reserved: {
         struct physdev_pci_mmcfg_reserved info;
 
-        ret = xsm_resource_setup_misc();
+        ret = xsm_priv_resource_setup_misc();
         if ( ret )
             break;
 
@@ -632,7 +632,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( setup_gsi.gsi < 0 || setup_gsi.gsi >= nr_irqs_gsi )
             break;
 
-        ret = xsm_resource_setup_gsi(setup_gsi.gsi);
+        ret = xsm_priv_resource_setup_gsi(setup_gsi.gsi);
         if ( ret )
             break;
 
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index f267b8b..c4b20ea 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -72,7 +72,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     if ( op->interface_version != XENPF_INTERFACE_VERSION )
         return -EACCES;
 
-    ret = xsm_platform_op(op->cmd);
+    ret = xsm_priv_platform_op(op->cmd);
     if ( ret )
         return ret;
 
@@ -496,7 +496,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        ret = xsm_resource_plug_core();
+        ret = xsm_hook_resource_plug_core();
         if ( ret )
             break;
 
@@ -512,7 +512,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
             break;
         }
 
-        ret = xsm_resource_plug_core();
+        ret = xsm_hook_resource_plug_core();
         if ( ret )
             break;
 
@@ -525,7 +525,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        ret = xsm_resource_unplug_core();
+        ret = xsm_hook_resource_unplug_core();
         if ( ret )
             break;
 
@@ -554,7 +554,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_cpu_hotadd:
-        ret = xsm_resource_plug_core();
+        ret = xsm_hook_resource_plug_core();
         if ( ret )
             break;
 
@@ -564,7 +564,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_mem_hotadd:
-        ret = xsm_resource_plug_core();
+        ret = xsm_hook_resource_plug_core();
         if ( ret )
             break;
 
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index 5b0c4b7..3a10a13 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -184,14 +184,14 @@ long arch_do_sysctl(
         switch ( sysctl->u.cpu_hotplug.op )
         {
         case XEN_SYSCTL_CPU_HOTPLUG_ONLINE:
-            ret = xsm_resource_plug_core();
+            ret = xsm_hook_resource_plug_core();
             if ( ret )
                 break;
             ret = continue_hypercall_on_cpu(
                 0, cpu_up_helper, (void *)(unsigned long)cpu);
             break;
         case XEN_SYSCTL_CPU_HOTPLUG_OFFLINE:
-            ret = xsm_resource_unplug_core();
+            ret = xsm_hook_resource_unplug_core();
             if ( ret )
                 break;
             ret = continue_hypercall_on_cpu(
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 44a866e..695e991 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1643,7 +1643,7 @@ static int pci_cfg_ok(struct domain *d, int write, int size)
             start |= (d->arch.pci_cf8 >> 16) & 0xF00;
     }
     end = start + size - 1;
-    if (xsm_pci_config_permission(d, machine_bdf, start, end, write))
+    if (xsm_hook_pci_config_permission(d, machine_bdf, start, end, write))
         return 0;
     return 1;
 }
diff --git a/xen/common/domain.c b/xen/common/domain.c
index fcf24e2..296d735 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -252,7 +252,7 @@ struct domain *domain_create(
 
     if ( !is_idle_domain(d) )
     {
-        if ( (err = xsm_domain_create(d, ssidref)) != 0 )
+        if ( (err = xsm_hook_domain_create(d, ssidref)) != 0 )
             goto fail;
 
         d->is_paused_by_controller = 1;
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 6f792e9..1f88ad2 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -150,7 +150,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
     if ( is_hvm_domain(d) )
         info->flags |= XEN_DOMINF_hvm_guest;
 
-    xsm_security_domaininfo(d, info);
+    xsm_populate_security_domaininfo(d, info);
 
     info->tot_pages         = d->tot_pages;
     info->max_pages         = d->max_pages;
@@ -580,7 +580,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             break;
         }
 
-        ret = xsm_getdomaininfo(d);
+        ret = xsm_hook_getdomaininfo(d);
         if ( ret )
             goto getdomaininfo_out;
 
@@ -722,7 +722,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
         if ( pirq >= d->nr_pirqs )
             ret = -EINVAL;
-        else if ( xsm_irq_permission(d, pirq, allow) )
+        else if ( xsm_hook_irq_permission(d, pirq, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = irq_permit_access(d, pirq);
@@ -741,7 +741,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
             break;
 
-        if ( xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, allow) )
+        if ( xsm_hook_iomem_permission(d, mfn, mfn + nr_mfns - 1, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
@@ -773,7 +773,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             break;
         }
 
-        ret = xsm_set_target(d, e);
+        ret = xsm_hook_set_target(d, e);
         if ( ret ) {
             put_domain(e);
             break;
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 37947a9..ef0d89b 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -175,7 +175,7 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
         ERROR_EXIT_DOM(port, d);
     chn = evtchn_from_port(d, port);
 
-    rc = xsm_evtchn_unbound(d, chn, alloc->remote_dom);
+    rc = xsm_target_evtchn_unbound(d, chn, alloc->remote_dom);
     if ( rc )
         goto out;
 
@@ -231,7 +231,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
          (rchn->u.unbound.remote_domid != ld->domain_id) )
         ERROR_EXIT_DOM(-EINVAL, rd);
 
-    rc = xsm_evtchn_interdomain(ld, lchn, rd, rchn);
+    rc = xsm_hook_evtchn_interdomain(ld, lchn, rd, rchn);
     if ( rc )
         goto out;
 
@@ -535,7 +535,7 @@ static long __evtchn_close(struct domain *d1, int port1)
     chn1->state          = ECS_FREE;
     chn1->notify_vcpu_id = 0;
 
-    xsm_evtchn_close_post(chn1);
+    xsm_hook_evtchn_close_post(chn1);
 
  out:
     if ( d2 != NULL )
@@ -580,7 +580,7 @@ int evtchn_send(struct domain *d, unsigned int lport)
         return -EINVAL;
     }
 
-    ret = xsm_evtchn_send(ld, lchn);
+    ret = xsm_hook_evtchn_send(ld, lchn);
     if ( ret )
         goto out;
 
@@ -812,7 +812,7 @@ static long evtchn_status(evtchn_status_t *status)
 
     chn = evtchn_from_port(d, port);
 
-    rc = xsm_evtchn_status(d, chn);
+    rc = xsm_target_evtchn_status(d, chn);
     if ( rc )
         goto out;
 
@@ -954,7 +954,7 @@ static long evtchn_reset(evtchn_reset_t *r)
     if ( d == NULL )
         return -ESRCH;
 
-    rc = xsm_evtchn_reset(current->domain, d);
+    rc = xsm_target_evtchn_reset(current->domain, d);
     if ( rc )
         goto out;
 
@@ -1101,7 +1101,7 @@ int alloc_unbound_xen_event_channel(
         goto out;
     chn = evtchn_from_port(d, port);
 
-    rc = xsm_evtchn_unbound(d, chn, remote_domid);
+    rc = xsm_target_evtchn_unbound(d, chn, remote_domid);
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index eae9518..e3690b6 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -552,7 +552,7 @@ __gnttab_map_grant_ref(
         return;
     }
 
-    rc = xsm_grant_mapref(ld, rd, op->flags);
+    rc = xsm_hook_grant_mapref(ld, rd, op->flags);
     if ( rc )
     {
         rcu_unlock_domain(rd);
@@ -872,7 +872,7 @@ __gnttab_unmap_common(
         return;
     }
 
-    rc = xsm_grant_unmapref(ld, rd);
+    rc = xsm_hook_grant_unmapref(ld, rd);
     if ( rc )
     {
         rcu_unlock_domain(rd);
@@ -1326,7 +1326,7 @@ gnttab_setup_table(
         goto out2;
     }
 
-    if ( xsm_grant_setup(current->domain, d) )
+    if ( xsm_target_grant_setup(current->domain, d) )
     {
         op.status = GNTST_permission_denied;
         goto out2;
@@ -1395,7 +1395,7 @@ gnttab_query_size(
         goto query_out;
     }
 
-    rc = xsm_grant_query_size(current->domain, d);
+    rc = xsm_target_grant_query_size(current->domain, d);
     if ( rc )
     {
         op.status = GNTST_permission_denied;
@@ -1571,7 +1571,7 @@ gnttab_transfer(
             goto copyback;
         }
 
-        if ( xsm_grant_transfer(d, e) )
+        if ( xsm_hook_grant_transfer(d, e) )
         {
             put_gfn(d, gop.mfn);
             gop.status = GNTST_permission_denied;
@@ -2010,7 +2010,7 @@ __gnttab_copy(
         PIN_FAIL(error_out, GNTST_bad_domain,
                  "couldn't find %d\n", op->dest.domid);
 
-    rc = xsm_grant_copy(sd, dd);
+    rc = xsm_hook_grant_copy(sd, dd);
     if ( rc )
     {
         rc = GNTST_permission_denied;
@@ -2267,7 +2267,7 @@ gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop,
         op.status = GNTST_bad_domain;
         goto out1;
     }
-    rc = xsm_grant_setup(current->domain, d);
+    rc = xsm_target_grant_setup(current->domain, d);
     if ( rc ) {
         op.status = GNTST_permission_denied;
         goto out1;
@@ -2318,7 +2318,7 @@ gnttab_get_version(XEN_GUEST_HANDLE_PARAM(gnttab_get_version_t uop))
     if ( d == NULL )
         return -ESRCH;
 
-    rc = xsm_grant_query_size(current->domain, d);
+    rc = xsm_target_grant_query_size(current->domain, d);
     if ( rc )
     {
         rcu_unlock_domain(d);
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index d4f6332..ff9d205 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -852,7 +852,7 @@ static int do_kexec_op_internal(unsigned long op,
     unsigned long flags;
     int ret = -EINVAL;
 
-    ret = xsm_kexec();
+    ret = xsm_priv_kexec();
     if ( ret )
         return ret;
 
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 7d3c326..0e216bb 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -336,7 +336,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
         goto fail_early;
     }
 
-    rc = xsm_memory_exchange(d);
+    rc = xsm_target_memory_exchange(d);
     if ( rc )
     {
         rcu_unlock_domain(d);
@@ -585,7 +585,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return start_extent;
         args.domain = d;
 
-        rc = xsm_memory_adjust_reservation(current->domain, d);
+        rc = xsm_target_memory_adjust_reservation(current->domain, d);
         if ( rc )
         {
             rcu_unlock_domain(d);
@@ -634,7 +634,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        rc = xsm_memory_stat_reservation(current->domain, d);
+        rc = xsm_target_memory_stat_reservation(current->domain, d);
         if ( rc )
         {
             rcu_unlock_domain(d);
@@ -672,7 +672,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        if ( xsm_remove_from_physmap(current->domain, d) )
+        if ( xsm_target_remove_from_physmap(current->domain, d) )
         {
             rcu_unlock_domain(d);
             return -EPERM;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index cfd173d..2cad778 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -921,7 +921,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             break;
 
-        ret = xsm_schedop_shutdown(current->domain, d);
+        ret = xsm_dm_schedop_shutdown(current->domain, d);
         if ( ret )
         {
             rcu_unlock_domain(d);
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index cbefb0e..d6e3f6c 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -57,7 +57,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     {
     case XEN_SYSCTL_readconsole:
     {
-        ret = xsm_readconsole(op->u.readconsole.clear);
+        ret = xsm_hook_readconsole(op->u.readconsole.clear);
         if ( ret )
             break;
 
@@ -100,7 +100,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
             if ( num_domains == op->u.getdomaininfolist.max_domains )
                 break;
 
-            ret = xsm_getdomaininfo(d);
+            ret = xsm_hook_getdomaininfo(d);
             if ( ret )
                 continue;
 
@@ -231,7 +231,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         uint32_t *status, *ptr;
         unsigned long pfn;
 
-        ret = xsm_page_offline(op->u.page_offline.cmd);
+        ret = xsm_hook_page_offline(op->u.page_offline.cmd);
         if ( ret )
             break;
 
diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index ae0435b..7a82e3a 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -680,7 +680,7 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         return -EPERM;
     }
 
-    ret = xsm_profile(current->domain, op);
+    ret = xsm_hook_profile(current->domain, op);
     if ( ret )
         return ret;
 
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index b2c3ee3..b6faa43 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -406,7 +406,7 @@ long do_console_io(int cmd, int count, XEN_GUEST_HANDLE_PARAM(char) buffer)
     long rc;
     unsigned int idx, len;
 
-    rc = xsm_console_io(current->domain, cmd);
+    rc = xsm_priv_console_io(current->domain, cmd);
     if ( rc )
         return rc;
 
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 9d13185..52eff81 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -452,7 +452,7 @@ static int iommu_get_device_group(
              ((pdev->bus == bus) && (pdev->devfn == devfn)) )
             continue;
 
-        if ( xsm_get_device_group((seg << 16) | (pdev->bus << 8) | pdev->devfn) )
+        if ( xsm_hook_get_device_group((seg << 16) | (pdev->bus << 8) | pdev->devfn) )
             continue;
 
         sdev_id = ops->get_device_group_id(seg, pdev->bus, pdev->devfn);
@@ -555,7 +555,7 @@ int iommu_do_domctl(
         u32 max_sdevs;
         XEN_GUEST_HANDLE_64(uint32) sdevs;
 
-        ret = xsm_get_device_group(domctl->u.get_device_group.machine_sbdf);
+        ret = xsm_hook_get_device_group(domctl->u.get_device_group.machine_sbdf);
         if ( ret )
             break;
 
@@ -583,7 +583,7 @@ int iommu_do_domctl(
     break;
 
     case XEN_DOMCTL_test_assign_device:
-        ret = xsm_test_assign_device(domctl->u.assign_device.machine_sbdf);
+        ret = xsm_hook_test_assign_device(domctl->u.assign_device.machine_sbdf);
         if ( ret )
             break;
 
@@ -607,7 +607,7 @@ int iommu_do_domctl(
             break;
         }
 
-        ret = xsm_assign_device(d, domctl->u.assign_device.machine_sbdf);
+        ret = xsm_hook_assign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
             break;
 
@@ -626,7 +626,7 @@ int iommu_do_domctl(
         break;
 
     case XEN_DOMCTL_deassign_device:
-        ret = xsm_deassign_device(d, domctl->u.assign_device.machine_sbdf);
+        ret = xsm_hook_deassign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
             break;
 
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index d5ef4c1..43eceab 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -380,7 +380,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn, const struct pci_dev_info *info)
         pdev_type = "device";
     }
 
-    ret = xsm_resource_plug_pci((seg << 16) | (bus << 8) | devfn);
+    ret = xsm_priv_resource_plug_pci((seg << 16) | (bus << 8) | devfn);
     if ( ret )
         return ret;
 
@@ -496,7 +496,7 @@ int pci_remove_device(u16 seg, u8 bus, u8 devfn)
     struct pci_dev *pdev;
     int ret;
 
-    ret = xsm_resource_unplug_pci((seg << 16) | (bus << 8) | devfn);
+    ret = xsm_priv_resource_unplug_pci((seg << 16) | (bus << 8) | devfn);
     if ( ret )
         return ret;
 
diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h
index 8dec5aa..81d88f3 100644
--- a/xen/include/xen/tmem_xen.h
+++ b/xen/include/xen/tmem_xen.h
@@ -329,12 +329,12 @@ static inline bool_t tmh_set_client_from_id(
 
 static inline bool_t tmh_current_permitted(void)
 {
-    return !xsm_tmem_op();
+    return !xsm_hook_tmem_op();
 }
 
 static inline bool_t tmh_current_is_privileged(void)
 {
-    return !xsm_tmem_control();
+    return !xsm_priv_tmem_control();
 }
 
 static inline uint8_t tmh_get_first_byte(pfp_t *pfp)
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index aaac50d3..09ee3f2 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -11,23 +11,23 @@
 #include <xen/sched.h>
 #include <xsm/xsm.h>
 
-static XSM_INLINE void xsm_security_domaininfo(struct domain *d,
+static XSM_INLINE void xsm_populate_security_domaininfo(struct domain *d,
                                     struct xen_domctl_getdomaininfo *info)
 {
     return;
 }
 
-static XSM_INLINE int xsm_domain_create(struct domain *d, u32 ssidref)
+static XSM_INLINE int xsm_hook_domain_create(struct domain *d, u32 ssidref)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
+static XSM_INLINE int xsm_hook_getdomaininfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
+static XSM_INLINE int xsm_hook_set_target(struct domain *d, struct domain *e)
 {
     return 0;
 }
@@ -58,12 +58,12 @@ static XSM_INLINE int xsm_sysctl(int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_readconsole(uint32_t clear)
+static XSM_INLINE int xsm_hook_readconsole(uint32_t clear)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_do_mca(void)
+static XSM_INLINE int xsm_priv_do_mca(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
@@ -80,49 +80,49 @@ static XSM_INLINE void xsm_free_security_domain(struct domain *d)
     return;
 }
 
-static XSM_INLINE int xsm_grant_mapref(struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_hook_grant_mapref(struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_unmapref(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_hook_grant_unmapref(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_setup(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_grant_setup(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_transfer(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_hook_grant_transfer(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_copy(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_hook_grant_copy(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_query_size(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_grant_query_size(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_memory_exchange(struct domain *d)
+static XSM_INLINE int xsm_target_memory_exchange(struct domain *d)
 {
     if ( d != current->domain && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
+static XSM_INLINE int xsm_target_memory_adjust_reservation(struct domain *d1,
                                                             struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
@@ -130,14 +130,14 @@ static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
     return 0;
 }
 
-static XSM_INLINE int xsm_memory_stat_reservation(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_memory_stat_reservation(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_console_io(struct domain *d, int cmd)
+static XSM_INLINE int xsm_priv_console_io(struct domain *d, int cmd)
 {
 #ifndef VERBOSE
     if ( !IS_PRIV(current->domain) )
@@ -146,32 +146,32 @@ static XSM_INLINE int xsm_console_io(struct domain *d, int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_profile(struct domain *d, int op)
+static XSM_INLINE int xsm_hook_profile(struct domain *d, int op)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_kexec(void)
+static XSM_INLINE int xsm_priv_kexec(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_schedop_shutdown(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_dm_schedop_shutdown(struct domain *d1, struct domain *d2)
 {
     if ( !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_hook_memory_pin_page(struct domain *d1, struct domain *d2,
                                           struct page_info *page)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_evtchn_unbound(struct domain *d, struct evtchn *chn,
+static XSM_INLINE int xsm_target_evtchn_unbound(struct domain *d, struct evtchn *chn,
                                          domid_t id2)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
@@ -179,30 +179,30 @@ static XSM_INLINE int xsm_evtchn_unbound(struct domain *d, struct evtchn *chn,
     return 0;
 }
 
-static XSM_INLINE int xsm_evtchn_interdomain(struct domain *d1, struct evtchn
+static XSM_INLINE int xsm_hook_evtchn_interdomain(struct domain *d1, struct evtchn
                                 *chan1, struct domain *d2, struct evtchn *chan2)
 {
     return 0;
 }
 
-static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
+static XSM_INLINE void xsm_hook_evtchn_close_post(struct evtchn *chn)
 {
     return;
 }
 
-static XSM_INLINE int xsm_evtchn_send(struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_hook_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_evtchn_status(struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_target_evtchn_status(struct domain *d, struct evtchn *chn)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_evtchn_reset(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_evtchn_reset(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
@@ -224,96 +224,96 @@ static XSM_INLINE char * xsm_show_security_evtchn(struct domain *d, const struct
     return NULL;
 }
 
-static XSM_INLINE int xsm_get_pod_target(struct domain *d)
+static XSM_INLINE int xsm_priv_get_pod_target(struct domain *d)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_set_pod_target(struct domain *d)
+static XSM_INLINE int xsm_priv_set_pod_target(struct domain *d)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_get_device_group(uint32_t machine_bdf)
+static XSM_INLINE int xsm_hook_get_device_group(uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_test_assign_device(uint32_t machine_bdf)
+static XSM_INLINE int xsm_hook_test_assign_device(uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_hook_assign_device(struct domain *d, uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_hook_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_plug_core(void)
+static XSM_INLINE int xsm_hook_resource_plug_core(void)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_unplug_core(void)
+static XSM_INLINE int xsm_hook_resource_unplug_core(void)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_plug_pci(uint32_t machine_bdf)
+static XSM_INLINE int xsm_priv_resource_plug_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_unplug_pci(uint32_t machine_bdf)
+static XSM_INLINE int xsm_priv_resource_unplug_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_setup_pci(uint32_t machine_bdf)
+static XSM_INLINE int xsm_priv_resource_setup_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_setup_gsi(int gsi)
+static XSM_INLINE int xsm_priv_resource_setup_gsi(int gsi)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_setup_misc(void)
+static XSM_INLINE int xsm_priv_resource_setup_misc(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_page_offline(uint32_t cmd)
+static XSM_INLINE int xsm_hook_page_offline(uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_tmem_op(void)
+static XSM_INLINE int xsm_hook_tmem_op(void)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_tmem_control(void)
+static XSM_INLINE int xsm_priv_tmem_control(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
@@ -330,34 +330,34 @@ static XSM_INLINE char * xsm_show_irq_sid(int irq)
     return NULL;
 }
 
-static XSM_INLINE int xsm_map_domain_pirq(struct domain *d, int irq, void *data)
+static XSM_INLINE int xsm_hook_map_domain_pirq(struct domain *d, int irq, void *data)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_unmap_domain_pirq(struct domain *d, int irq)
+static XSM_INLINE int xsm_dm_unmap_domain_pirq(struct domain *d, int irq)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_irq_permission(struct domain *d, int pirq, uint8_t allow)
+static XSM_INLINE int xsm_hook_irq_permission(struct domain *d, int pirq, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_iomem_permission(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_hook_iomem_permission(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_iomem_mapping(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_hook_iomem_mapping(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_pci_config_permission(struct domain *d, uint32_t machine_bdf,
+static XSM_INLINE int xsm_hook_pci_config_permission(struct domain *d, uint32_t machine_bdf,
                                         uint16_t start, uint16_t end,
                                         uint8_t access)
 {
@@ -365,96 +365,96 @@ static XSM_INLINE int xsm_pci_config_permission(struct domain *d, uint32_t machi
 }
 
 #ifdef CONFIG_X86
-static XSM_INLINE int xsm_shadow_control(struct domain *d, uint32_t op)
+static XSM_INLINE int xsm_hook_shadow_control(struct domain *d, uint32_t op)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
+static XSM_INLINE int xsm_target_hvm_param(struct domain *d, unsigned long op)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_set_pci_intx_level(struct domain *d)
+static XSM_INLINE int xsm_dm_hvm_set_pci_intx_level(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_set_isa_irq_level(struct domain *d)
+static XSM_INLINE int xsm_dm_hvm_set_isa_irq_level(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_set_pci_link_route(struct domain *d)
+static XSM_INLINE int xsm_dm_hvm_set_pci_link_route(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
+static XSM_INLINE int xsm_dm_hvm_inject_msi(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_event_control(struct domain *d, int mode, int op)
+static XSM_INLINE int xsm_dm_mem_event_control(struct domain *d, int mode, int op)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_event_op(struct domain *d, int op)
+static XSM_INLINE int xsm_dm_mem_event_op(struct domain *d, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
+static XSM_INLINE int xsm_dm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, cd) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
+static XSM_INLINE int xsm_priv_apic(struct domain *d, int cmd)
 {
     if ( !IS_PRIV(d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_platform_op(uint32_t op)
+static XSM_INLINE int xsm_priv_platform_op(uint32_t op)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_machine_memory_map(void)
+static XSM_INLINE int xsm_priv_machine_memory_map(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_domain_memory_map(struct domain *d)
+static XSM_INLINE int xsm_target_domain_memory_map(struct domain *d)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_mmu_update(struct domain *d, struct domain *t,
+static XSM_INLINE int xsm_target_mmu_update(struct domain *d, struct domain *t,
                                      struct domain *f, uint32_t flags)
 {
     if ( t && d != t && !IS_PRIV_FOR(d, t) )
@@ -464,14 +464,14 @@ static XSM_INLINE int xsm_mmu_update(struct domain *d, struct domain *t,
     return 0;
 }
 
-static XSM_INLINE int xsm_mmuext_op(struct domain *d, struct domain *f)
+static XSM_INLINE int xsm_target_mmuext_op(struct domain *d, struct domain *f)
 {
     if ( d != f && !IS_PRIV_FOR(d, f) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f, 
+static XSM_INLINE int xsm_target_update_va_mapping(struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
     if ( d != f && !IS_PRIV_FOR(d, f) )
@@ -479,36 +479,36 @@ static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f,
     return 0;
 }
 
-static XSM_INLINE int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_add_to_physmap(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_hook_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_unbind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_hook_unbind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_hook_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_ioport_mapping(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_hook_ioport_mapping(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
 }
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 105201e..c3a29b6 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -39,30 +39,30 @@ extern xsm_initcall_t __xsm_initcall_start[], __xsm_initcall_end[];
     __used_section(".xsm_initcall.init") = fn
 
 struct xsm_operations {
-    void (*security_domaininfo) (struct domain *d,
+    void (*populate_security_domaininfo) (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info);
-    int (*domain_create) (struct domain *d, u32 ssidref);
-    int (*getdomaininfo) (struct domain *d);
-    int (*set_target) (struct domain *d, struct domain *e);
+    int (*hook_domain_create) (struct domain *d, u32 ssidref);
+    int (*hook_getdomaininfo) (struct domain *d);
+    int (*hook_set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
     int (*sysctl) (int cmd);
-    int (*readconsole) (uint32_t clear);
-    int (*do_mca) (void);
+    int (*hook_readconsole) (uint32_t clear);
+    int (*priv_do_mca) (void);
 
-    int (*evtchn_unbound) (struct domain *d, struct evtchn *chn, domid_t id2);
-    int (*evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
+    int (*target_evtchn_unbound) (struct domain *d, struct evtchn *chn, domid_t id2);
+    int (*hook_evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
                                         struct domain *d2, struct evtchn *chn2);
-    void (*evtchn_close_post) (struct evtchn *chn);
-    int (*evtchn_send) (struct domain *d, struct evtchn *chn);
-    int (*evtchn_status) (struct domain *d, struct evtchn *chn);
-    int (*evtchn_reset) (struct domain *d1, struct domain *d2);
-
-    int (*grant_mapref) (struct domain *d1, struct domain *d2, uint32_t flags);
-    int (*grant_unmapref) (struct domain *d1, struct domain *d2);
-    int (*grant_setup) (struct domain *d1, struct domain *d2);
-    int (*grant_transfer) (struct domain *d1, struct domain *d2);
-    int (*grant_copy) (struct domain *d1, struct domain *d2);
-    int (*grant_query_size) (struct domain *d1, struct domain *d2);
+    void (*hook_evtchn_close_post) (struct evtchn *chn);
+    int (*hook_evtchn_send) (struct domain *d, struct evtchn *chn);
+    int (*target_evtchn_status) (struct domain *d, struct evtchn *chn);
+    int (*target_evtchn_reset) (struct domain *d1, struct domain *d2);
+
+    int (*hook_grant_mapref) (struct domain *d1, struct domain *d2, uint32_t flags);
+    int (*hook_grant_unmapref) (struct domain *d1, struct domain *d2);
+    int (*target_grant_setup) (struct domain *d1, struct domain *d2);
+    int (*hook_grant_transfer) (struct domain *d1, struct domain *d2);
+    int (*hook_grant_copy) (struct domain *d1, struct domain *d2);
+    int (*target_grant_query_size) (struct domain *d1, struct domain *d2);
 
     int (*alloc_security_domain) (struct domain *d);
     void (*free_security_domain) (struct domain *d);
@@ -70,76 +70,76 @@ struct xsm_operations {
     void (*free_security_evtchn) (struct evtchn *chn);
     char *(*show_security_evtchn) (struct domain *d, const struct evtchn *chn);
 
-    int (*get_pod_target) (struct domain *d);
-    int (*set_pod_target) (struct domain *d);
-    int (*memory_exchange) (struct domain *d);
-    int (*memory_adjust_reservation) (struct domain *d1, struct domain *d2);
-    int (*memory_stat_reservation) (struct domain *d1, struct domain *d2);
-    int (*memory_pin_page) (struct domain *d1, struct domain *d2, struct page_info *page);
-    int (*remove_from_physmap) (struct domain *d1, struct domain *d2);
+    int (*priv_get_pod_target) (struct domain *d);
+    int (*priv_set_pod_target) (struct domain *d);
+    int (*target_memory_exchange) (struct domain *d);
+    int (*target_memory_adjust_reservation) (struct domain *d1, struct domain *d2);
+    int (*target_memory_stat_reservation) (struct domain *d1, struct domain *d2);
+    int (*hook_memory_pin_page) (struct domain *d1, struct domain *d2, struct page_info *page);
+    int (*target_remove_from_physmap) (struct domain *d1, struct domain *d2);
 
-    int (*console_io) (struct domain *d, int cmd);
+    int (*priv_console_io) (struct domain *d, int cmd);
 
-    int (*profile) (struct domain *d, int op);
+    int (*hook_profile) (struct domain *d, int op);
 
-    int (*kexec) (void);
-    int (*schedop_shutdown) (struct domain *d1, struct domain *d2);
+    int (*priv_kexec) (void);
+    int (*dm_schedop_shutdown) (struct domain *d1, struct domain *d2);
 
     char *(*show_irq_sid) (int irq);
-    int (*map_domain_pirq) (struct domain *d, int irq, void *data);
-    int (*unmap_domain_pirq) (struct domain *d, int irq);
-    int (*irq_permission) (struct domain *d, int pirq, uint8_t allow);
-    int (*iomem_permission) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
-    int (*iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
-    int (*pci_config_permission) (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access);
-
-    int (*get_device_group) (uint32_t machine_bdf);
-    int (*test_assign_device) (uint32_t machine_bdf);
-    int (*assign_device) (struct domain *d, uint32_t machine_bdf);
-    int (*deassign_device) (struct domain *d, uint32_t machine_bdf);
-
-    int (*resource_plug_core) (void);
-    int (*resource_unplug_core) (void);
-    int (*resource_plug_pci) (uint32_t machine_bdf);
-    int (*resource_unplug_pci) (uint32_t machine_bdf);
-    int (*resource_setup_pci) (uint32_t machine_bdf);
-    int (*resource_setup_gsi) (int gsi);
-    int (*resource_setup_misc) (void);
-
-    int (*page_offline)(uint32_t cmd);
-    int (*tmem_op)(void);
-    int (*tmem_control)(void);
+    int (*hook_map_domain_pirq) (struct domain *d, int irq, void *data);
+    int (*dm_unmap_domain_pirq) (struct domain *d, int irq);
+    int (*hook_irq_permission) (struct domain *d, int pirq, uint8_t allow);
+    int (*hook_iomem_permission) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
+    int (*hook_iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
+    int (*hook_pci_config_permission) (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access);
+
+    int (*hook_get_device_group) (uint32_t machine_bdf);
+    int (*hook_test_assign_device) (uint32_t machine_bdf);
+    int (*hook_assign_device) (struct domain *d, uint32_t machine_bdf);
+    int (*hook_deassign_device) (struct domain *d, uint32_t machine_bdf);
+
+    int (*hook_resource_plug_core) (void);
+    int (*hook_resource_unplug_core) (void);
+    int (*priv_resource_plug_pci) (uint32_t machine_bdf);
+    int (*priv_resource_unplug_pci) (uint32_t machine_bdf);
+    int (*priv_resource_setup_pci) (uint32_t machine_bdf);
+    int (*priv_resource_setup_gsi) (int gsi);
+    int (*priv_resource_setup_misc) (void);
+
+    int (*hook_page_offline)(uint32_t cmd);
+    int (*hook_tmem_op)(void);
+    int (*priv_tmem_control)(void);
 
     long (*do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
 
 #ifdef CONFIG_X86
-    int (*shadow_control) (struct domain *d, uint32_t op);
-    int (*hvm_param) (struct domain *d, unsigned long op);
-    int (*hvm_set_pci_intx_level) (struct domain *d);
-    int (*hvm_set_isa_irq_level) (struct domain *d);
-    int (*hvm_set_pci_link_route) (struct domain *d);
-    int (*hvm_inject_msi) (struct domain *d);
-    int (*mem_event_control) (struct domain *d, int mode, int op);
-    int (*mem_event_op) (struct domain *d, int op);
-    int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
-    int (*apic) (struct domain *d, int cmd);
+    int (*hook_shadow_control) (struct domain *d, uint32_t op);
+    int (*target_hvm_param) (struct domain *d, unsigned long op);
+    int (*dm_hvm_set_pci_intx_level) (struct domain *d);
+    int (*dm_hvm_set_isa_irq_level) (struct domain *d);
+    int (*dm_hvm_set_pci_link_route) (struct domain *d);
+    int (*dm_hvm_inject_msi) (struct domain *d);
+    int (*dm_mem_event_control) (struct domain *d, int mode, int op);
+    int (*dm_mem_event_op) (struct domain *d, int op);
+    int (*dm_mem_sharing_op) (struct domain *d, struct domain *cd, int op);
+    int (*priv_apic) (struct domain *d, int cmd);
     int (*memtype) (uint32_t access);
-    int (*platform_op) (uint32_t cmd);
-    int (*machine_memory_map) (void);
-    int (*domain_memory_map) (struct domain *d);
+    int (*priv_platform_op) (uint32_t cmd);
+    int (*priv_machine_memory_map) (void);
+    int (*target_domain_memory_map) (struct domain *d);
 #define XSM_MMU_UPDATE_READ      1
 #define XSM_MMU_UPDATE_WRITE     2
 #define XSM_MMU_NORMAL_UPDATE    4
 #define XSM_MMU_MACHPHYS_UPDATE  8
-    int (*mmu_update) (struct domain *d, struct domain *t,
+    int (*target_mmu_update) (struct domain *d, struct domain *t,
                        struct domain *f, uint32_t flags);
-    int (*mmuext_op) (struct domain *d, struct domain *f);
-    int (*update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
-    int (*add_to_physmap) (struct domain *d1, struct domain *d2);
-    int (*bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
-    int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
+    int (*target_mmuext_op) (struct domain *d, struct domain *f);
+    int (*target_update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
+    int (*target_add_to_physmap) (struct domain *d1, struct domain *d2);
+    int (*hook_bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
+    int (*hook_unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
+    int (*hook_ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
+    int (*hook_ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
 #endif
 };
 
@@ -149,25 +149,25 @@ extern struct xsm_operations *xsm_ops;
 
 #ifndef XSM_NO_WRAPPERS
 
-static inline void xsm_security_domaininfo (struct domain *d,
+static inline void xsm_populate_security_domaininfo (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info)
 {
-    xsm_ops->security_domaininfo(d, info);
+    xsm_ops->populate_security_domaininfo(d, info);
 }
 
-static inline int xsm_domain_create (struct domain *d, u32 ssidref)
+static inline int xsm_hook_domain_create (struct domain *d, u32 ssidref)
 {
-    return xsm_ops->domain_create(d, ssidref);
+    return xsm_ops->hook_domain_create(d, ssidref);
 }
 
-static inline int xsm_getdomaininfo (struct domain *d)
+static inline int xsm_hook_getdomaininfo (struct domain *d)
 {
-    return xsm_ops->getdomaininfo(d);
+    return xsm_ops->hook_getdomaininfo(d);
 }
 
-static inline int xsm_set_target (struct domain *d, struct domain *e)
+static inline int xsm_hook_set_target (struct domain *d, struct domain *e)
 {
-    return xsm_ops->set_target(d, e);
+    return xsm_ops->hook_set_target(d, e);
 }
 
 static inline int xsm_domctl (struct domain *d, int cmd)
@@ -180,77 +180,77 @@ static inline int xsm_sysctl (int cmd)
     return xsm_ops->sysctl(cmd);
 }
 
-static inline int xsm_readconsole (uint32_t clear)
+static inline int xsm_hook_readconsole (uint32_t clear)
 {
-    return xsm_ops->readconsole(clear);
+    return xsm_ops->hook_readconsole(clear);
 }
 
-static inline int xsm_do_mca(void)
+static inline int xsm_priv_do_mca(void)
 {
-    return xsm_ops->do_mca();
+    return xsm_ops->priv_do_mca();
 }
 
-static inline int xsm_evtchn_unbound (struct domain *d1, struct evtchn *chn,
+static inline int xsm_target_evtchn_unbound (struct domain *d1, struct evtchn *chn,
                                                                     domid_t id2)
 {
-    return xsm_ops->evtchn_unbound(d1, chn, id2);
+    return xsm_ops->target_evtchn_unbound(d1, chn, id2);
 }
 
-static inline int xsm_evtchn_interdomain (struct domain *d1, 
+static inline int xsm_hook_evtchn_interdomain (struct domain *d1, 
                 struct evtchn *chan1, struct domain *d2, struct evtchn *chan2)
 {
-    return xsm_ops->evtchn_interdomain(d1, chan1, d2, chan2);
+    return xsm_ops->hook_evtchn_interdomain(d1, chan1, d2, chan2);
 }
 
-static inline void xsm_evtchn_close_post (struct evtchn *chn)
+static inline void xsm_hook_evtchn_close_post (struct evtchn *chn)
 {
-    xsm_ops->evtchn_close_post(chn);
+    xsm_ops->hook_evtchn_close_post(chn);
 }
 
-static inline int xsm_evtchn_send (struct domain *d, struct evtchn *chn)
+static inline int xsm_hook_evtchn_send (struct domain *d, struct evtchn *chn)
 {
-    return xsm_ops->evtchn_send(d, chn);
+    return xsm_ops->hook_evtchn_send(d, chn);
 }
 
-static inline int xsm_evtchn_status (struct domain *d, struct evtchn *chn)
+static inline int xsm_target_evtchn_status (struct domain *d, struct evtchn *chn)
 {
-    return xsm_ops->evtchn_status(d, chn);
+    return xsm_ops->target_evtchn_status(d, chn);
 }
 
-static inline int xsm_evtchn_reset (struct domain *d1, struct domain *d2)
+static inline int xsm_target_evtchn_reset (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->evtchn_reset(d1, d2);
+    return xsm_ops->target_evtchn_reset(d1, d2);
 }
 
-static inline int xsm_grant_mapref (struct domain *d1, struct domain *d2,
+static inline int xsm_hook_grant_mapref (struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
-    return xsm_ops->grant_mapref(d1, d2, flags);
+    return xsm_ops->hook_grant_mapref(d1, d2, flags);
 }
 
-static inline int xsm_grant_unmapref (struct domain *d1, struct domain *d2)
+static inline int xsm_hook_grant_unmapref (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_unmapref(d1, d2);
+    return xsm_ops->hook_grant_unmapref(d1, d2);
 }
 
-static inline int xsm_grant_setup (struct domain *d1, struct domain *d2)
+static inline int xsm_target_grant_setup (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_setup(d1, d2);
+    return xsm_ops->target_grant_setup(d1, d2);
 }
 
-static inline int xsm_grant_transfer (struct domain *d1, struct domain *d2)
+static inline int xsm_hook_grant_transfer (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_transfer(d1, d2);
+    return xsm_ops->hook_grant_transfer(d1, d2);
 }
 
-static inline int xsm_grant_copy (struct domain *d1, struct domain *d2)
+static inline int xsm_hook_grant_copy (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_copy(d1, d2);
+    return xsm_ops->hook_grant_copy(d1, d2);
 }
 
-static inline int xsm_grant_query_size (struct domain *d1, struct domain *d2)
+static inline int xsm_target_grant_query_size (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_query_size(d1, d2);
+    return xsm_ops->target_grant_query_size(d1, d2);
 }
 
 static inline int xsm_alloc_security_domain (struct domain *d)
@@ -278,62 +278,62 @@ static inline char *xsm_show_security_evtchn (struct domain *d, const struct evt
     return xsm_ops->show_security_evtchn(d, chn);
 }
 
-static inline int xsm_get_pod_target (struct domain *d)
+static inline int xsm_priv_get_pod_target (struct domain *d)
 {
-    return xsm_ops->get_pod_target(d);
+    return xsm_ops->priv_get_pod_target(d);
 }
 
-static inline int xsm_set_pod_target (struct domain *d)
+static inline int xsm_priv_set_pod_target (struct domain *d)
 {
-    return xsm_ops->set_pod_target(d);
+    return xsm_ops->priv_set_pod_target(d);
 }
 
-static inline int xsm_memory_exchange (struct domain *d)
+static inline int xsm_target_memory_exchange (struct domain *d)
 {
-    return xsm_ops->memory_exchange(d);
+    return xsm_ops->target_memory_exchange(d);
 }
 
-static inline int xsm_memory_adjust_reservation (struct domain *d1, struct
+static inline int xsm_target_memory_adjust_reservation (struct domain *d1, struct
                                                                     domain *d2)
 {
-    return xsm_ops->memory_adjust_reservation(d1, d2);
+    return xsm_ops->target_memory_adjust_reservation(d1, d2);
 }
 
-static inline int xsm_memory_stat_reservation (struct domain *d1,
+static inline int xsm_target_memory_stat_reservation (struct domain *d1,
                                                             struct domain *d2)
 {
-    return xsm_ops->memory_stat_reservation(d1, d2);
+    return xsm_ops->target_memory_stat_reservation(d1, d2);
 }
 
-static inline int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
+static inline int xsm_hook_memory_pin_page(struct domain *d1, struct domain *d2,
                                       struct page_info *page)
 {
-    return xsm_ops->memory_pin_page(d1, d2, page);
+    return xsm_ops->hook_memory_pin_page(d1, d2, page);
 }
 
-static inline int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
+static inline int xsm_target_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->remove_from_physmap(d1, d2);
+    return xsm_ops->target_remove_from_physmap(d1, d2);
 }
 
-static inline int xsm_console_io (struct domain *d, int cmd)
+static inline int xsm_priv_console_io (struct domain *d, int cmd)
 {
-    return xsm_ops->console_io(d, cmd);
+    return xsm_ops->priv_console_io(d, cmd);
 }
 
-static inline int xsm_profile (struct domain *d, int op)
+static inline int xsm_hook_profile (struct domain *d, int op)
 {
-    return xsm_ops->profile(d, op);
+    return xsm_ops->hook_profile(d, op);
 }
 
-static inline int xsm_kexec (void)
+static inline int xsm_priv_kexec (void)
 {
-    return xsm_ops->kexec();
+    return xsm_ops->priv_kexec();
 }
 
-static inline int xsm_schedop_shutdown (struct domain *d1, struct domain *d2)
+static inline int xsm_dm_schedop_shutdown (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->schedop_shutdown(d1, d2);
+    return xsm_ops->dm_schedop_shutdown(d1, d2);
 }
 
 static inline char *xsm_show_irq_sid (int irq)
@@ -341,104 +341,104 @@ static inline char *xsm_show_irq_sid (int irq)
     return xsm_ops->show_irq_sid(irq);
 }
 
-static inline int xsm_map_domain_pirq (struct domain *d, int irq, void *data)
+static inline int xsm_hook_map_domain_pirq (struct domain *d, int irq, void *data)
 {
-    return xsm_ops->map_domain_pirq(d, irq, data);
+    return xsm_ops->hook_map_domain_pirq(d, irq, data);
 }
 
-static inline int xsm_unmap_domain_pirq (struct domain *d, int irq)
+static inline int xsm_dm_unmap_domain_pirq (struct domain *d, int irq)
 {
-    return xsm_ops->unmap_domain_pirq(d, irq);
+    return xsm_ops->dm_unmap_domain_pirq(d, irq);
 }
 
-static inline int xsm_irq_permission (struct domain *d, int pirq, uint8_t allow)
+static inline int xsm_hook_irq_permission (struct domain *d, int pirq, uint8_t allow)
 {
-    return xsm_ops->irq_permission(d, pirq, allow);
+    return xsm_ops->hook_irq_permission(d, pirq, allow);
 }
 
-static inline int xsm_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static inline int xsm_hook_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return xsm_ops->iomem_permission(d, s, e, allow);
+    return xsm_ops->hook_iomem_permission(d, s, e, allow);
 }
 
-static inline int xsm_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static inline int xsm_hook_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return xsm_ops->iomem_mapping(d, s, e, allow);
+    return xsm_ops->hook_iomem_mapping(d, s, e, allow);
 }
 
-static inline int xsm_pci_config_permission (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
+static inline int xsm_hook_pci_config_permission (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
-    return xsm_ops->pci_config_permission(d, machine_bdf, start, end, access);
+    return xsm_ops->hook_pci_config_permission(d, machine_bdf, start, end, access);
 }
 
-static inline int xsm_get_device_group(uint32_t machine_bdf)
+static inline int xsm_hook_get_device_group(uint32_t machine_bdf)
 {
-    return xsm_ops->get_device_group(machine_bdf);
+    return xsm_ops->hook_get_device_group(machine_bdf);
 }
 
-static inline int xsm_test_assign_device(uint32_t machine_bdf)
+static inline int xsm_hook_test_assign_device(uint32_t machine_bdf)
 {
-    return xsm_ops->test_assign_device(machine_bdf);
+    return xsm_ops->hook_test_assign_device(machine_bdf);
 }
 
-static inline int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
+static inline int xsm_hook_assign_device(struct domain *d, uint32_t machine_bdf)
 {
-    return xsm_ops->assign_device(d, machine_bdf);
+    return xsm_ops->hook_assign_device(d, machine_bdf);
 }
 
-static inline int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
+static inline int xsm_hook_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
-    return xsm_ops->deassign_device(d, machine_bdf);
+    return xsm_ops->hook_deassign_device(d, machine_bdf);
 }
 
-static inline int xsm_resource_plug_pci (uint32_t machine_bdf)
+static inline int xsm_priv_resource_plug_pci (uint32_t machine_bdf)
 {
-    return xsm_ops->resource_plug_pci(machine_bdf);
+    return xsm_ops->priv_resource_plug_pci(machine_bdf);
 }
 
-static inline int xsm_resource_unplug_pci (uint32_t machine_bdf)
+static inline int xsm_priv_resource_unplug_pci (uint32_t machine_bdf)
 {
-    return xsm_ops->resource_unplug_pci(machine_bdf);
+    return xsm_ops->priv_resource_unplug_pci(machine_bdf);
 }
 
-static inline int xsm_resource_plug_core (void)
+static inline int xsm_hook_resource_plug_core (void)
 {
-    return xsm_ops->resource_plug_core();
+    return xsm_ops->hook_resource_plug_core();
 }
 
-static inline int xsm_resource_unplug_core (void)
+static inline int xsm_hook_resource_unplug_core (void)
 {
-    return xsm_ops->resource_unplug_core();
+    return xsm_ops->hook_resource_unplug_core();
 }
 
-static inline int xsm_resource_setup_pci (uint32_t machine_bdf)
+static inline int xsm_priv_resource_setup_pci (uint32_t machine_bdf)
 {
-    return xsm_ops->resource_setup_pci(machine_bdf);
+    return xsm_ops->priv_resource_setup_pci(machine_bdf);
 }
 
-static inline int xsm_resource_setup_gsi (int gsi)
+static inline int xsm_priv_resource_setup_gsi (int gsi)
 {
-    return xsm_ops->resource_setup_gsi(gsi);
+    return xsm_ops->priv_resource_setup_gsi(gsi);
 }
 
-static inline int xsm_resource_setup_misc (void)
+static inline int xsm_priv_resource_setup_misc (void)
 {
-    return xsm_ops->resource_setup_misc();
+    return xsm_ops->priv_resource_setup_misc();
 }
 
-static inline int xsm_page_offline(uint32_t cmd)
+static inline int xsm_hook_page_offline(uint32_t cmd)
 {
-    return xsm_ops->page_offline(cmd);
+    return xsm_ops->hook_page_offline(cmd);
 }
 
-static inline int xsm_tmem_op(void)
+static inline int xsm_hook_tmem_op(void)
 {
-    return xsm_ops->tmem_op();
+    return xsm_ops->hook_tmem_op();
 }
 
-static inline int xsm_tmem_control(void)
+static inline int xsm_priv_tmem_control(void)
 {
-    return xsm_ops->tmem_control();
+    return xsm_ops->priv_tmem_control();
 }
 
 static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
@@ -447,54 +447,54 @@ static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 }
 
 #ifdef CONFIG_X86
-static inline int xsm_shadow_control (struct domain *d, uint32_t op)
+static inline int xsm_hook_shadow_control (struct domain *d, uint32_t op)
 {
-    return xsm_ops->shadow_control(d, op);
+    return xsm_ops->hook_shadow_control(d, op);
 }
 
-static inline int xsm_hvm_param (struct domain *d, unsigned long op)
+static inline int xsm_target_hvm_param (struct domain *d, unsigned long op)
 {
-    return xsm_ops->hvm_param(d, op);
+    return xsm_ops->target_hvm_param(d, op);
 }
 
-static inline int xsm_hvm_set_pci_intx_level (struct domain *d)
+static inline int xsm_dm_hvm_set_pci_intx_level (struct domain *d)
 {
-    return xsm_ops->hvm_set_pci_intx_level(d);
+    return xsm_ops->dm_hvm_set_pci_intx_level(d);
 }
 
-static inline int xsm_hvm_set_isa_irq_level (struct domain *d)
+static inline int xsm_dm_hvm_set_isa_irq_level (struct domain *d)
 {
-    return xsm_ops->hvm_set_isa_irq_level(d);
+    return xsm_ops->dm_hvm_set_isa_irq_level(d);
 }
 
-static inline int xsm_hvm_set_pci_link_route (struct domain *d)
+static inline int xsm_dm_hvm_set_pci_link_route (struct domain *d)
 {
-    return xsm_ops->hvm_set_pci_link_route(d);
+    return xsm_ops->dm_hvm_set_pci_link_route(d);
 }
 
-static inline int xsm_hvm_inject_msi (struct domain *d)
+static inline int xsm_dm_hvm_inject_msi (struct domain *d)
 {
-    return xsm_ops->hvm_inject_msi(d);
+    return xsm_ops->dm_hvm_inject_msi(d);
 }
 
-static inline int xsm_mem_event_control (struct domain *d, int mode, int op)
+static inline int xsm_dm_mem_event_control (struct domain *d, int mode, int op)
 {
-    return xsm_ops->mem_event_control(d, mode, op);
+    return xsm_ops->dm_mem_event_control(d, mode, op);
 }
 
-static inline int xsm_mem_event_op (struct domain *d, int op)
+static inline int xsm_dm_mem_event_op (struct domain *d, int op)
 {
-    return xsm_ops->mem_event_op(d, op);
+    return xsm_ops->dm_mem_event_op(d, op);
 }
 
-static inline int xsm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
+static inline int xsm_dm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
 {
-    return xsm_ops->mem_sharing_op(d, cd, op);
+    return xsm_ops->dm_mem_sharing_op(d, cd, op);
 }
 
-static inline int xsm_apic (struct domain *d, int cmd)
+static inline int xsm_priv_apic (struct domain *d, int cmd)
 {
-    return xsm_ops->apic(d, cmd);
+    return xsm_ops->priv_apic(d, cmd);
 }
 
 static inline int xsm_memtype (uint32_t access)
@@ -502,63 +502,63 @@ static inline int xsm_memtype (uint32_t access)
     return xsm_ops->memtype(access);
 }
 
-static inline int xsm_platform_op (uint32_t op)
+static inline int xsm_priv_platform_op (uint32_t op)
 {
-    return xsm_ops->platform_op(op);
+    return xsm_ops->priv_platform_op(op);
 }
 
-static inline int xsm_machine_memory_map(void)
+static inline int xsm_priv_machine_memory_map(void)
 {
-    return xsm_ops->machine_memory_map();
+    return xsm_ops->priv_machine_memory_map();
 }
 
-static inline int xsm_domain_memory_map(struct domain *d)
+static inline int xsm_target_domain_memory_map(struct domain *d)
 {
-    return xsm_ops->domain_memory_map(d);
+    return xsm_ops->target_domain_memory_map(d);
 }
 
-static inline int xsm_mmu_update (struct domain *d, struct domain *t,
+static inline int xsm_target_mmu_update (struct domain *d, struct domain *t,
                                   struct domain *f, uint32_t flags)
 {
-    return xsm_ops->mmu_update(d, t, f, flags);
+    return xsm_ops->target_mmu_update(d, t, f, flags);
 }
 
-static inline int xsm_mmuext_op (struct domain *d, struct domain *f)
+static inline int xsm_target_mmuext_op (struct domain *d, struct domain *f)
 {
-    return xsm_ops->mmuext_op(d, f);
+    return xsm_ops->target_mmuext_op(d, f);
 }
 
-static inline int xsm_update_va_mapping(struct domain *d, struct domain *f, 
+static inline int xsm_target_update_va_mapping(struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
-    return xsm_ops->update_va_mapping(d, f, pte);
+    return xsm_ops->target_update_va_mapping(d, f, pte);
 }
 
-static inline int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
+static inline int xsm_target_add_to_physmap(struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->add_to_physmap(d1, d2);
+    return xsm_ops->target_add_to_physmap(d1, d2);
 }
 
-static inline int xsm_bind_pt_irq(struct domain *d, 
+static inline int xsm_hook_bind_pt_irq(struct domain *d, 
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_ops->bind_pt_irq(d, bind);
+    return xsm_ops->hook_bind_pt_irq(d, bind);
 }
 
-static inline int xsm_unbind_pt_irq(struct domain *d,
+static inline int xsm_hook_unbind_pt_irq(struct domain *d,
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_ops->unbind_pt_irq(d, bind);
+    return xsm_ops->hook_unbind_pt_irq(d, bind);
 }
 
-static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static inline int xsm_hook_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return xsm_ops->ioport_permission(d, s, e, allow);
+    return xsm_ops->hook_ioport_permission(d, s, e, allow);
 }
 
-static inline int xsm_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static inline int xsm_hook_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return xsm_ops->ioport_mapping(d, s, e, allow);
+    return xsm_ops->hook_ioport_mapping(d, s, e, allow);
 }
 #endif /* CONFIG_X86 */
 #endif /* XSM_NO_WRAPPERS */
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 22c66e5..c29c5af 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -29,98 +29,98 @@ struct xsm_operations dummy_xsm_ops;
 
 void xsm_fixup_ops (struct xsm_operations *ops)
 {
-    set_to_dummy_if_null(ops, security_domaininfo);
-    set_to_dummy_if_null(ops, domain_create);
-    set_to_dummy_if_null(ops, getdomaininfo);
-    set_to_dummy_if_null(ops, set_target);
+    set_to_dummy_if_null(ops, populate_security_domaininfo);
+    set_to_dummy_if_null(ops, hook_domain_create);
+    set_to_dummy_if_null(ops, hook_getdomaininfo);
+    set_to_dummy_if_null(ops, hook_set_target);
     set_to_dummy_if_null(ops, domctl);
     set_to_dummy_if_null(ops, sysctl);
-    set_to_dummy_if_null(ops, readconsole);
-    set_to_dummy_if_null(ops, do_mca);
-
-    set_to_dummy_if_null(ops, evtchn_unbound);
-    set_to_dummy_if_null(ops, evtchn_interdomain);
-    set_to_dummy_if_null(ops, evtchn_close_post);
-    set_to_dummy_if_null(ops, evtchn_send);
-    set_to_dummy_if_null(ops, evtchn_status);
-    set_to_dummy_if_null(ops, evtchn_reset);
-
-    set_to_dummy_if_null(ops, grant_mapref);
-    set_to_dummy_if_null(ops, grant_unmapref);
-    set_to_dummy_if_null(ops, grant_setup);
-    set_to_dummy_if_null(ops, grant_transfer);
-    set_to_dummy_if_null(ops, grant_copy);
-    set_to_dummy_if_null(ops, grant_query_size);
+    set_to_dummy_if_null(ops, hook_readconsole);
+    set_to_dummy_if_null(ops, priv_do_mca);
+
+    set_to_dummy_if_null(ops, target_evtchn_unbound);
+    set_to_dummy_if_null(ops, hook_evtchn_interdomain);
+    set_to_dummy_if_null(ops, hook_evtchn_close_post);
+    set_to_dummy_if_null(ops, hook_evtchn_send);
+    set_to_dummy_if_null(ops, target_evtchn_status);
+    set_to_dummy_if_null(ops, target_evtchn_reset);
+
+    set_to_dummy_if_null(ops, hook_grant_mapref);
+    set_to_dummy_if_null(ops, hook_grant_unmapref);
+    set_to_dummy_if_null(ops, target_grant_setup);
+    set_to_dummy_if_null(ops, hook_grant_transfer);
+    set_to_dummy_if_null(ops, hook_grant_copy);
+    set_to_dummy_if_null(ops, target_grant_query_size);
 
     set_to_dummy_if_null(ops, alloc_security_domain);
     set_to_dummy_if_null(ops, free_security_domain);
     set_to_dummy_if_null(ops, alloc_security_evtchn);
     set_to_dummy_if_null(ops, free_security_evtchn);
     set_to_dummy_if_null(ops, show_security_evtchn);
-    set_to_dummy_if_null(ops, get_pod_target);
-    set_to_dummy_if_null(ops, set_pod_target);
+    set_to_dummy_if_null(ops, priv_get_pod_target);
+    set_to_dummy_if_null(ops, priv_set_pod_target);
 
-    set_to_dummy_if_null(ops, memory_exchange);
-    set_to_dummy_if_null(ops, memory_adjust_reservation);
-    set_to_dummy_if_null(ops, memory_stat_reservation);
-    set_to_dummy_if_null(ops, memory_pin_page);
+    set_to_dummy_if_null(ops, target_memory_exchange);
+    set_to_dummy_if_null(ops, target_memory_adjust_reservation);
+    set_to_dummy_if_null(ops, target_memory_stat_reservation);
+    set_to_dummy_if_null(ops, hook_memory_pin_page);
 
-    set_to_dummy_if_null(ops, console_io);
+    set_to_dummy_if_null(ops, priv_console_io);
 
-    set_to_dummy_if_null(ops, profile);
+    set_to_dummy_if_null(ops, hook_profile);
 
-    set_to_dummy_if_null(ops, kexec);
-    set_to_dummy_if_null(ops, schedop_shutdown);
+    set_to_dummy_if_null(ops, priv_kexec);
+    set_to_dummy_if_null(ops, dm_schedop_shutdown);
 
     set_to_dummy_if_null(ops, show_irq_sid);
-    set_to_dummy_if_null(ops, map_domain_pirq);
-    set_to_dummy_if_null(ops, unmap_domain_pirq);
-    set_to_dummy_if_null(ops, irq_permission);
-    set_to_dummy_if_null(ops, iomem_permission);
-    set_to_dummy_if_null(ops, iomem_mapping);
-    set_to_dummy_if_null(ops, pci_config_permission);
-
-    set_to_dummy_if_null(ops, get_device_group);
-    set_to_dummy_if_null(ops, test_assign_device);
-    set_to_dummy_if_null(ops, assign_device);
-    set_to_dummy_if_null(ops, deassign_device);
-
-    set_to_dummy_if_null(ops, resource_plug_core);
-    set_to_dummy_if_null(ops, resource_unplug_core);
-    set_to_dummy_if_null(ops, resource_plug_pci);
-    set_to_dummy_if_null(ops, resource_unplug_pci);
-    set_to_dummy_if_null(ops, resource_setup_pci);
-    set_to_dummy_if_null(ops, resource_setup_gsi);
-    set_to_dummy_if_null(ops, resource_setup_misc);
-
-    set_to_dummy_if_null(ops, page_offline);
-    set_to_dummy_if_null(ops, tmem_op);
-    set_to_dummy_if_null(ops, tmem_control);
+    set_to_dummy_if_null(ops, hook_map_domain_pirq);
+    set_to_dummy_if_null(ops, dm_unmap_domain_pirq);
+    set_to_dummy_if_null(ops, hook_irq_permission);
+    set_to_dummy_if_null(ops, hook_iomem_permission);
+    set_to_dummy_if_null(ops, hook_iomem_mapping);
+    set_to_dummy_if_null(ops, hook_pci_config_permission);
+
+    set_to_dummy_if_null(ops, hook_get_device_group);
+    set_to_dummy_if_null(ops, hook_test_assign_device);
+    set_to_dummy_if_null(ops, hook_assign_device);
+    set_to_dummy_if_null(ops, hook_deassign_device);
+
+    set_to_dummy_if_null(ops, hook_resource_plug_core);
+    set_to_dummy_if_null(ops, hook_resource_unplug_core);
+    set_to_dummy_if_null(ops, priv_resource_plug_pci);
+    set_to_dummy_if_null(ops, priv_resource_unplug_pci);
+    set_to_dummy_if_null(ops, priv_resource_setup_pci);
+    set_to_dummy_if_null(ops, priv_resource_setup_gsi);
+    set_to_dummy_if_null(ops, priv_resource_setup_misc);
+
+    set_to_dummy_if_null(ops, hook_page_offline);
+    set_to_dummy_if_null(ops, hook_tmem_op);
+    set_to_dummy_if_null(ops, priv_tmem_control);
 
     set_to_dummy_if_null(ops, do_xsm_op);
 
 #ifdef CONFIG_X86
-    set_to_dummy_if_null(ops, shadow_control);
-    set_to_dummy_if_null(ops, hvm_param);
-    set_to_dummy_if_null(ops, hvm_set_pci_intx_level);
-    set_to_dummy_if_null(ops, hvm_set_isa_irq_level);
-    set_to_dummy_if_null(ops, hvm_set_pci_link_route);
-    set_to_dummy_if_null(ops, hvm_inject_msi);
-    set_to_dummy_if_null(ops, mem_event_control);
-    set_to_dummy_if_null(ops, mem_event_op);
-    set_to_dummy_if_null(ops, mem_sharing_op);
-    set_to_dummy_if_null(ops, apic);
-    set_to_dummy_if_null(ops, platform_op);
-    set_to_dummy_if_null(ops, machine_memory_map);
-    set_to_dummy_if_null(ops, domain_memory_map);
-    set_to_dummy_if_null(ops, mmu_update);
-    set_to_dummy_if_null(ops, mmuext_op);
-    set_to_dummy_if_null(ops, update_va_mapping);
-    set_to_dummy_if_null(ops, add_to_physmap);
-    set_to_dummy_if_null(ops, remove_from_physmap);
-    set_to_dummy_if_null(ops, bind_pt_irq);
-    set_to_dummy_if_null(ops, unbind_pt_irq);
-    set_to_dummy_if_null(ops, ioport_permission);
-    set_to_dummy_if_null(ops, ioport_mapping);
+    set_to_dummy_if_null(ops, hook_shadow_control);
+    set_to_dummy_if_null(ops, target_hvm_param);
+    set_to_dummy_if_null(ops, dm_hvm_set_pci_intx_level);
+    set_to_dummy_if_null(ops, dm_hvm_set_isa_irq_level);
+    set_to_dummy_if_null(ops, dm_hvm_set_pci_link_route);
+    set_to_dummy_if_null(ops, dm_hvm_inject_msi);
+    set_to_dummy_if_null(ops, dm_mem_event_control);
+    set_to_dummy_if_null(ops, dm_mem_event_op);
+    set_to_dummy_if_null(ops, dm_mem_sharing_op);
+    set_to_dummy_if_null(ops, priv_apic);
+    set_to_dummy_if_null(ops, priv_platform_op);
+    set_to_dummy_if_null(ops, priv_machine_memory_map);
+    set_to_dummy_if_null(ops, target_domain_memory_map);
+    set_to_dummy_if_null(ops, target_mmu_update);
+    set_to_dummy_if_null(ops, target_mmuext_op);
+    set_to_dummy_if_null(ops, target_update_va_mapping);
+    set_to_dummy_if_null(ops, target_add_to_physmap);
+    set_to_dummy_if_null(ops, target_remove_from_physmap);
+    set_to_dummy_if_null(ops, hook_bind_pt_irq);
+    set_to_dummy_if_null(ops, hook_unbind_pt_irq);
+    set_to_dummy_if_null(ops, hook_ioport_permission);
+    set_to_dummy_if_null(ops, hook_ioport_mapping);
 #endif
 }
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 03ea675..2c46276 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -171,7 +171,7 @@ static void flask_domain_free_security(struct domain *d)
     xfree(dsec);
 }
 
-static int flask_evtchn_unbound(struct domain *d1, struct evtchn *chn, 
+static int flask_target_evtchn_unbound(struct domain *d1, struct evtchn *chn, 
                                 domid_t id2)
 {
     u32 sid1, sid2, newsid;
@@ -206,7 +206,7 @@ static int flask_evtchn_unbound(struct domain *d1, struct evtchn *chn,
     return rc;
 }
 
-static int flask_evtchn_interdomain(struct domain *d1, struct evtchn *chn1, 
+static int flask_hook_evtchn_interdomain(struct domain *d1, struct evtchn *chn1, 
                                     struct domain *d2, struct evtchn *chn2)
 {
     u32 sid1, sid2, newsid, reverse_sid;
@@ -252,7 +252,7 @@ static int flask_evtchn_interdomain(struct domain *d1, struct evtchn *chn1,
     return rc;
 }
 
-static void flask_evtchn_close_post(struct evtchn *chn)
+static void flask_hook_evtchn_close_post(struct evtchn *chn)
 {
     struct evtchn_security_struct *esec;
     esec = chn->ssid;
@@ -260,7 +260,7 @@ static void flask_evtchn_close_post(struct evtchn *chn)
     esec->sid = SECINITSID_UNLABELED;
 }
 
-static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
+static int flask_hook_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     int rc;
 
@@ -280,12 +280,12 @@ static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
     return rc;
 }
 
-static int flask_evtchn_status(struct domain *d, struct evtchn *chn)
+static int flask_target_evtchn_status(struct domain *d, struct evtchn *chn)
 {
     return domain_has_evtchn(d, chn, EVENT__STATUS);
 }
 
-static int flask_evtchn_reset(struct domain *d1, struct domain *d2)
+static int flask_target_evtchn_reset(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_EVENT, EVENT__RESET);
 }
@@ -350,7 +350,7 @@ static char *flask_show_security_evtchn(struct domain *d, const struct evtchn *c
     return ctx;
 }
 
-static int flask_grant_mapref(struct domain *d1, struct domain *d2, 
+static int flask_hook_grant_mapref(struct domain *d1, struct domain *d2, 
                               uint32_t flags)
 {
     u32 perms = GRANT__MAP_READ;
@@ -361,63 +361,63 @@ static int flask_grant_mapref(struct domain *d1, struct domain *d2,
     return domain_has_perm(d1, d2, SECCLASS_GRANT, perms);
 }
 
-static int flask_grant_unmapref(struct domain *d1, struct domain *d2)
+static int flask_hook_grant_unmapref(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__UNMAP);
 }
 
-static int flask_grant_setup(struct domain *d1, struct domain *d2)
+static int flask_target_grant_setup(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__SETUP);
 }
 
-static int flask_grant_transfer(struct domain *d1, struct domain *d2)
+static int flask_hook_grant_transfer(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__TRANSFER);
 }
 
-static int flask_grant_copy(struct domain *d1, struct domain *d2)
+static int flask_hook_grant_copy(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__COPY);
 }
 
-static int flask_grant_query_size(struct domain *d1, struct domain *d2)
+static int flask_target_grant_query_size(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__QUERY);
 }
 
-static int flask_get_pod_target(struct domain *d)
+static int flask_priv_get_pod_target(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETPODTARGET);
 }
 
-static int flask_set_pod_target(struct domain *d)
+static int flask_priv_set_pod_target(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETPODTARGET);
 }
 
-static int flask_memory_exchange(struct domain *d)
+static int flask_target_memory_exchange(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_MMU, MMU__EXCHANGE);
 }
 
-static int flask_memory_adjust_reservation(struct domain *d1, struct domain *d2)
+static int flask_target_memory_adjust_reservation(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__ADJUST);
 }
 
-static int flask_memory_stat_reservation(struct domain *d1, struct domain *d2)
+static int flask_target_memory_stat_reservation(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__STAT);
 }
 
-static int flask_memory_pin_page(struct domain *d1, struct domain *d2,
+static int flask_hook_memory_pin_page(struct domain *d1, struct domain *d2,
                                  struct page_info *page)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PINPAGE);
 }
 
-static int flask_console_io(struct domain *d, int cmd)
+static int flask_priv_console_io(struct domain *d, int cmd)
 {
     u32 perm;
 
@@ -436,7 +436,7 @@ static int flask_console_io(struct domain *d, int cmd)
     return domain_has_xen(d, perm);
 }
 
-static int flask_profile(struct domain *d, int op)
+static int flask_hook_profile(struct domain *d, int op)
 {
     u32 perm;
 
@@ -468,23 +468,23 @@ static int flask_profile(struct domain *d, int op)
     return domain_has_xen(d, perm);
 }
 
-static int flask_kexec(void)
+static int flask_priv_kexec(void)
 {
     return domain_has_xen(current->domain, XEN__KEXEC);
 }
 
-static int flask_schedop_shutdown(struct domain *d1, struct domain *d2)
+static int flask_dm_schedop_shutdown(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_DOMAIN, DOMAIN__SHUTDOWN);
 }
 
-static void flask_security_domaininfo(struct domain *d, 
+static void flask_populate_security_domaininfo(struct domain *d, 
                                       struct xen_domctl_getdomaininfo *info)
 {
     info->ssidref = domain_sid(d);
 }
 
-static int flask_domain_create(struct domain *d, u32 ssidref)
+static int flask_hook_domain_create(struct domain *d, u32 ssidref)
 {
     int rc;
     struct domain_security_struct *dsec = d->ssid;
@@ -512,12 +512,12 @@ static int flask_domain_create(struct domain *d, u32 ssidref)
     return rc;
 }
 
-static int flask_getdomaininfo(struct domain *d)
+static int flask_hook_getdomaininfo(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO);
 }
 
-static int flask_set_target(struct domain *d, struct domain *t)
+static int flask_hook_set_target(struct domain *d, struct domain *t)
 {
     int rc;
     struct domain_security_struct *dsec, *tsec;
@@ -753,7 +753,7 @@ static int flask_sysctl(int cmd)
     }
 }
 
-static int flask_readconsole(uint32_t clear)
+static int flask_hook_readconsole(uint32_t clear)
 {
     u32 perms = XEN__READCONSOLE;
 
@@ -763,7 +763,7 @@ static int flask_readconsole(uint32_t clear)
     return domain_has_xen(current->domain, perms);
 }
 
-static int flask_do_mca(void)
+static int flask_priv_do_mca(void)
 {
     return domain_has_xen(current->domain, XEN__MCA_OP);
 }
@@ -790,7 +790,7 @@ static char *flask_show_irq_sid (int irq)
     return ctx;
 }
 
-static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
+static int flask_hook_map_domain_pirq (struct domain *d, int irq, void *data)
 {
     u32 sid, dsid;
     int rc = -EPERM;
@@ -823,7 +823,7 @@ static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
     return rc;
 }
 
-static int flask_unmap_domain_pirq (struct domain *d, int irq)
+static int flask_dm_unmap_domain_pirq (struct domain *d, int irq)
 {
     u32 sid;
     int rc = -EPERM;
@@ -846,7 +846,7 @@ static int flask_unmap_domain_pirq (struct domain *d, int irq)
     return rc;
 }
 
-static int flask_irq_permission (struct domain *d, int pirq, uint8_t access)
+static int flask_hook_irq_permission (struct domain *d, int pirq, uint8_t access)
 {
     /* the PIRQ number is not useful; real IRQ is checked during mapping */
     return current_has_perm(d, SECCLASS_RESOURCE, resource_to_perm(access));
@@ -876,7 +876,7 @@ static int _iomem_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     return avc_has_perm(data->dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
+static int flask_hook_iomem_permission(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
 {
     struct iomem_has_perm_data data;
     int rc;
@@ -897,12 +897,12 @@ static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end
     return security_iterate_iomem_sids(start, end, _iomem_has_perm, &data);
 }
 
-static int flask_iomem_mapping(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
+static int flask_hook_iomem_mapping(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
 {
-    return flask_iomem_permission(d, start, end, access);
+    return flask_hook_iomem_permission(d, start, end, access);
 }
 
-static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
+static int flask_hook_pci_config_permission(struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
     u32 dsid, rsid;
     int rc = -EPERM;
@@ -924,12 +924,12 @@ static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, u
 
 }
 
-static int flask_resource_plug_core(void)
+static int flask_hook_resource_plug_core(void)
 {
     return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__PLUG, NULL);
 }
 
-static int flask_resource_unplug_core(void)
+static int flask_hook_resource_unplug_core(void)
 {
     return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__UNPLUG, NULL);
 }
@@ -939,7 +939,7 @@ static int flask_resource_use_core(void)
     return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__USE, NULL);
 }
 
-static int flask_resource_plug_pci(uint32_t machine_bdf)
+static int flask_priv_resource_plug_pci(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -954,7 +954,7 @@ static int flask_resource_plug_pci(uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__PLUG, &ad);
 }
 
-static int flask_resource_unplug_pci(uint32_t machine_bdf)
+static int flask_priv_resource_unplug_pci(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -969,7 +969,7 @@ static int flask_resource_unplug_pci(uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__UNPLUG, &ad);
 }
 
-static int flask_resource_setup_pci(uint32_t machine_bdf)
+static int flask_priv_resource_setup_pci(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -984,7 +984,7 @@ static int flask_resource_setup_pci(uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
-static int flask_resource_setup_gsi(int gsi)
+static int flask_priv_resource_setup_gsi(int gsi)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -997,18 +997,18 @@ static int flask_resource_setup_gsi(int gsi)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
-static int flask_resource_setup_misc(void)
+static int flask_priv_resource_setup_misc(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);
 }
 
-static inline int flask_page_offline(uint32_t cmd)
+static inline int flask_hook_page_offline(uint32_t cmd)
 {
     switch (cmd) {
     case sysctl_page_offline:
-        return flask_resource_unplug_core();
+        return flask_hook_resource_unplug_core();
     case sysctl_page_online:
-        return flask_resource_plug_core();
+        return flask_hook_resource_plug_core();
     case sysctl_query_page_offline:
         return flask_resource_use_core();
     default:
@@ -1016,18 +1016,18 @@ static inline int flask_page_offline(uint32_t cmd)
     }
 }
 
-static inline int flask_tmem_op(void)
+static inline int flask_hook_tmem_op(void)
 {
     return domain_has_xen(current->domain, XEN__TMEM_OP);
 }
 
-static inline int flask_tmem_control(void)
+static inline int flask_priv_tmem_control(void)
 {
     return domain_has_xen(current->domain, XEN__TMEM_CONTROL);
 }
 
 #ifdef CONFIG_X86
-static int flask_shadow_control(struct domain *d, uint32_t op)
+static int flask_hook_shadow_control(struct domain *d, uint32_t op)
 {
     u32 perm;
 
@@ -1079,7 +1079,7 @@ static int _ioport_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     return avc_has_perm(data->dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
+static int flask_hook_ioport_permission(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
 {
     int rc;
     struct ioport_has_perm_data data;
@@ -1101,12 +1101,12 @@ static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t en
     return security_iterate_ioport_sids(start, end, _ioport_has_perm, &data);
 }
 
-static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
+static int flask_hook_ioport_mapping(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
 {
-    return flask_ioport_permission(d, start, end, access);
+    return flask_hook_ioport_permission(d, start, end, access);
 }
 
-static int flask_hvm_param(struct domain *d, unsigned long op)
+static int flask_target_hvm_param(struct domain *d, unsigned long op)
 {
     u32 perm;
 
@@ -1128,37 +1128,37 @@ static int flask_hvm_param(struct domain *d, unsigned long op)
     return current_has_perm(d, SECCLASS_HVM, perm);
 }
 
-static int flask_hvm_set_pci_intx_level(struct domain *d)
+static int flask_dm_hvm_set_pci_intx_level(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__PCILEVEL);
 }
 
-static int flask_hvm_set_isa_irq_level(struct domain *d)
+static int flask_dm_hvm_set_isa_irq_level(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__IRQLEVEL);
 }
 
-static int flask_hvm_set_pci_link_route(struct domain *d)
+static int flask_dm_hvm_set_pci_link_route(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__PCIROUTE);
 }
 
-static int flask_hvm_inject_msi(struct domain *d)
+static int flask_dm_hvm_inject_msi(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
-static int flask_mem_event_control(struct domain *d, int mode, int op)
+static int flask_dm_mem_event_control(struct domain *d, int mode, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
 
-static int flask_mem_event_op(struct domain *d, int op)
+static int flask_dm_mem_event_op(struct domain *d, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
 
-static int flask_mem_sharing_op(struct domain *d, struct domain *cd, int op)
+static int flask_dm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     int rc = current_has_perm(cd, SECCLASS_HVM, HVM__MEM_SHARING);
     if ( rc )
@@ -1166,7 +1166,7 @@ static int flask_mem_sharing_op(struct domain *d, struct domain *cd, int op)
     return domain_has_perm(d, cd, SECCLASS_HVM, HVM__SHARE_MEM);
 }
 
-static int flask_apic(struct domain *d, int cmd)
+static int flask_priv_apic(struct domain *d, int cmd)
 {
     u32 perm;
 
@@ -1186,7 +1186,7 @@ static int flask_apic(struct domain *d, int cmd)
     return domain_has_xen(d, perm);
 }
 
-static int flask_platform_op(uint32_t op)
+static int flask_priv_platform_op(uint32_t op)
 {
     switch ( op )
     {
@@ -1241,22 +1241,22 @@ static int flask_platform_op(uint32_t op)
         return domain_has_xen(current->domain, XEN__GETCPUINFO);
 
     default:
-        printk("flask_platform_op: Unknown op %d\n", op);
+        printk("flask_priv_platform_op: Unknown op %d\n", op);
         return -EPERM;
     }
 }
 
-static int flask_machine_memory_map(void)
+static int flask_priv_machine_memory_map(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_MMU, MMU__MEMORYMAP, NULL);
 }
 
-static int flask_domain_memory_map(struct domain *d)
+static int flask_target_domain_memory_map(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_MMU, MMU__MEMORYMAP);
 }
 
-static int flask_mmu_update(struct domain *d, struct domain *t,
+static int flask_target_mmu_update(struct domain *d, struct domain *t,
                             struct domain *f, uint32_t flags)
 {
     int rc = 0;
@@ -1279,12 +1279,12 @@ static int flask_mmu_update(struct domain *d, struct domain *t,
     return rc;
 }
 
-static int flask_mmuext_op(struct domain *d, struct domain *f)
+static int flask_target_mmuext_op(struct domain *d, struct domain *f)
 {
     return domain_has_perm(d, f, SECCLASS_MMU, MMU__MMUEXT_OP);
 }
 
-static int flask_update_va_mapping(struct domain *d, struct domain *f,
+static int flask_target_update_va_mapping(struct domain *d, struct domain *f,
                                    l1_pgentry_t pte)
 {
     u32 map_perms = MMU__MAP_READ;
@@ -1296,17 +1296,17 @@ static int flask_update_va_mapping(struct domain *d, struct domain *f,
     return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
 }
 
-static int flask_add_to_physmap(struct domain *d1, struct domain *d2)
+static int flask_target_add_to_physmap(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP);
 }
 
-static int flask_remove_from_physmap(struct domain *d1, struct domain *d2)
+static int flask_target_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP);
 }
 
-static int flask_get_device_group(uint32_t machine_bdf)
+static int flask_hook_get_device_group(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -1330,7 +1330,7 @@ static int flask_test_assign_device(uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
 }
 
-static int flask_assign_device(struct domain *d, uint32_t machine_bdf)
+static int flask_hook_assign_device(struct domain *d, uint32_t machine_bdf)
 {
     u32 dsid, rsid;
     int rc = -EPERM;
@@ -1354,7 +1354,7 @@ static int flask_assign_device(struct domain *d, uint32_t machine_bdf)
     return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_deassign_device(struct domain *d, uint32_t machine_bdf)
+static int flask_hook_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -1370,7 +1370,7 @@ static int flask_deassign_device(struct domain *d, uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__REMOVE_DEVICE, NULL);
 }
 
-static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static int flask_hook_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     u32 dsid, rsid;
     int rc = -EPERM;
@@ -1395,7 +1395,7 @@ static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *b
     return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static int flask_hook_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
@@ -1404,28 +1404,28 @@ static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq
 long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
 
 static struct xsm_operations flask_ops = {
-    .security_domaininfo = flask_security_domaininfo,
-    .domain_create = flask_domain_create,
-    .getdomaininfo = flask_getdomaininfo,
-    .set_target = flask_set_target,
+    .populate_security_domaininfo = flask_populate_security_domaininfo,
+    .hook_domain_create = flask_hook_domain_create,
+    .hook_getdomaininfo = flask_hook_getdomaininfo,
+    .hook_set_target = flask_hook_set_target,
     .domctl = flask_domctl,
     .sysctl = flask_sysctl,
-    .readconsole = flask_readconsole,
-    .do_mca = flask_do_mca,
-
-    .evtchn_unbound = flask_evtchn_unbound,
-    .evtchn_interdomain = flask_evtchn_interdomain,
-    .evtchn_close_post = flask_evtchn_close_post,
-    .evtchn_send = flask_evtchn_send,
-    .evtchn_status = flask_evtchn_status,
-    .evtchn_reset = flask_evtchn_reset,
-
-    .grant_mapref = flask_grant_mapref,
-    .grant_unmapref = flask_grant_unmapref,
-    .grant_setup = flask_grant_setup,
-    .grant_transfer = flask_grant_transfer,
-    .grant_copy = flask_grant_copy,
-    .grant_query_size = flask_grant_query_size,
+    .hook_readconsole = flask_hook_readconsole,
+    .priv_do_mca = flask_priv_do_mca,
+
+    .target_evtchn_unbound = flask_target_evtchn_unbound,
+    .hook_evtchn_interdomain = flask_hook_evtchn_interdomain,
+    .hook_evtchn_close_post = flask_hook_evtchn_close_post,
+    .hook_evtchn_send = flask_hook_evtchn_send,
+    .target_evtchn_status = flask_target_evtchn_status,
+    .target_evtchn_reset = flask_target_evtchn_reset,
+
+    .hook_grant_mapref = flask_hook_grant_mapref,
+    .hook_grant_unmapref = flask_hook_grant_unmapref,
+    .target_grant_setup = flask_target_grant_setup,
+    .hook_grant_transfer = flask_hook_grant_transfer,
+    .hook_grant_copy = flask_hook_grant_copy,
+    .target_grant_query_size = flask_target_grant_query_size,
 
     .alloc_security_domain = flask_domain_alloc_security,
     .free_security_domain = flask_domain_free_security,
@@ -1433,70 +1433,70 @@ static struct xsm_operations flask_ops = {
     .free_security_evtchn = flask_free_security_evtchn,
     .show_security_evtchn = flask_show_security_evtchn,
 
-    .get_pod_target = flask_get_pod_target,
-    .set_pod_target = flask_set_pod_target,
-    .memory_exchange = flask_memory_exchange,
-    .memory_adjust_reservation = flask_memory_adjust_reservation,
-    .memory_stat_reservation = flask_memory_stat_reservation,
-    .memory_pin_page = flask_memory_pin_page,
+    .priv_get_pod_target = flask_priv_get_pod_target,
+    .priv_set_pod_target = flask_priv_set_pod_target,
+    .target_memory_exchange = flask_target_memory_exchange,
+    .target_memory_adjust_reservation = flask_target_memory_adjust_reservation,
+    .target_memory_stat_reservation = flask_target_memory_stat_reservation,
+    .hook_memory_pin_page = flask_hook_memory_pin_page,
 
-    .console_io = flask_console_io,
+    .priv_console_io = flask_priv_console_io,
 
-    .profile = flask_profile,
+    .hook_profile = flask_hook_profile,
 
-    .kexec = flask_kexec,
-    .schedop_shutdown = flask_schedop_shutdown,
+    .priv_kexec = flask_priv_kexec,
+    .dm_schedop_shutdown = flask_dm_schedop_shutdown,
 
     .show_irq_sid = flask_show_irq_sid,
 
-    .map_domain_pirq = flask_map_domain_pirq,
-    .unmap_domain_pirq = flask_unmap_domain_pirq,
-    .irq_permission = flask_irq_permission,
-    .iomem_permission = flask_iomem_permission,
-    .iomem_mapping = flask_iomem_mapping,
-    .pci_config_permission = flask_pci_config_permission,
-
-    .resource_plug_core = flask_resource_plug_core,
-    .resource_unplug_core = flask_resource_unplug_core,
-    .resource_plug_pci = flask_resource_plug_pci,
-    .resource_unplug_pci = flask_resource_unplug_pci,
-    .resource_setup_pci = flask_resource_setup_pci,
-    .resource_setup_gsi = flask_resource_setup_gsi,
-    .resource_setup_misc = flask_resource_setup_misc,
-
-    .page_offline = flask_page_offline,
-    .tmem_op = flask_tmem_op,
-    .tmem_control = flask_tmem_control,
+    .hook_map_domain_pirq = flask_hook_map_domain_pirq,
+    .dm_unmap_domain_pirq = flask_dm_unmap_domain_pirq,
+    .hook_irq_permission = flask_hook_irq_permission,
+    .hook_iomem_permission = flask_hook_iomem_permission,
+    .hook_iomem_mapping = flask_hook_iomem_mapping,
+    .hook_pci_config_permission = flask_hook_pci_config_permission,
+
+    .hook_resource_plug_core = flask_hook_resource_plug_core,
+    .hook_resource_unplug_core = flask_hook_resource_unplug_core,
+    .priv_resource_plug_pci = flask_priv_resource_plug_pci,
+    .priv_resource_unplug_pci = flask_priv_resource_unplug_pci,
+    .priv_resource_setup_pci = flask_priv_resource_setup_pci,
+    .priv_resource_setup_gsi = flask_priv_resource_setup_gsi,
+    .priv_resource_setup_misc = flask_priv_resource_setup_misc,
+
+    .hook_page_offline = flask_hook_page_offline,
+    .hook_tmem_op = flask_hook_tmem_op,
+    .priv_tmem_control = flask_priv_tmem_control,
 
     .do_xsm_op = do_flask_op,
 
 #ifdef CONFIG_X86
-    .shadow_control = flask_shadow_control,
-    .hvm_param = flask_hvm_param,
-    .hvm_set_pci_intx_level = flask_hvm_set_pci_intx_level,
-    .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
-    .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
-    .hvm_inject_msi = flask_hvm_inject_msi,
-    .mem_event_control = flask_mem_event_control,
-    .mem_event_op = flask_mem_event_op,
-    .mem_sharing_op = flask_mem_sharing_op,
-    .apic = flask_apic,
-    .platform_op = flask_platform_op,
-    .machine_memory_map = flask_machine_memory_map,
-    .domain_memory_map = flask_domain_memory_map,
-    .mmu_update = flask_mmu_update,
-    .mmuext_op = flask_mmuext_op,
-    .update_va_mapping = flask_update_va_mapping,
-    .add_to_physmap = flask_add_to_physmap,
-    .remove_from_physmap = flask_remove_from_physmap,
-    .get_device_group = flask_get_device_group,
-    .test_assign_device = flask_test_assign_device,
-    .assign_device = flask_assign_device,
-    .deassign_device = flask_deassign_device,
-    .bind_pt_irq = flask_bind_pt_irq,
-    .unbind_pt_irq = flask_unbind_pt_irq,
-    .ioport_permission = flask_ioport_permission,
-    .ioport_mapping = flask_ioport_mapping,
+    .hook_shadow_control = flask_hook_shadow_control,
+    .target_hvm_param = flask_target_hvm_param,
+    .dm_hvm_set_pci_intx_level = flask_dm_hvm_set_pci_intx_level,
+    .dm_hvm_set_isa_irq_level = flask_dm_hvm_set_isa_irq_level,
+    .dm_hvm_set_pci_link_route = flask_dm_hvm_set_pci_link_route,
+    .dm_hvm_inject_msi = flask_dm_hvm_inject_msi,
+    .dm_mem_event_control = flask_dm_mem_event_control,
+    .dm_mem_event_op = flask_dm_mem_event_op,
+    .dm_mem_sharing_op = flask_dm_mem_sharing_op,
+    .priv_apic = flask_priv_apic,
+    .priv_platform_op = flask_priv_platform_op,
+    .priv_machine_memory_map = flask_priv_machine_memory_map,
+    .target_domain_memory_map = flask_target_domain_memory_map,
+    .target_mmu_update = flask_target_mmu_update,
+    .target_mmuext_op = flask_target_mmuext_op,
+    .target_update_va_mapping = flask_target_update_va_mapping,
+    .target_add_to_physmap = flask_target_add_to_physmap,
+    .target_remove_from_physmap = flask_target_remove_from_physmap,
+    .hook_get_device_group = flask_hook_get_device_group,
+    .hook_test_assign_device = flask_test_assign_device,
+    .hook_assign_device = flask_hook_assign_device,
+    .hook_deassign_device = flask_hook_deassign_device,
+    .hook_bind_pt_irq = flask_hook_bind_pt_irq,
+    .hook_unbind_pt_irq = flask_hook_unbind_pt_irq,
+    .hook_ioport_permission = flask_hook_ioport_permission,
+    .hook_ioport_mapping = flask_hook_ioport_mapping,
 #endif
 };
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 14:52:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 14:52:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapBJ-0007gB-Oc; Tue, 20 Nov 2012 14:52:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TapBI-0007fd-4O
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 14:52:08 +0000
Received: from [85.158.143.99:25476] by server-2.bemta-4.messagelabs.com id
	34/99-28922-7199BA05; Tue, 20 Nov 2012 14:52:07 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-216.messagelabs.com!1353423111!23152002!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2692 invoked from network); 20 Nov 2012 14:51:51 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-11.tower-216.messagelabs.com with SMTP;
	20 Nov 2012 14:51:51 -0000
X-TM-IMSS-Message-ID: <9cf7a63b000bdf6e@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9cf7a63b000bdf6e ;
	Tue, 20 Nov 2012 09:51:08 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKEpd9X028173; 
	Tue, 20 Nov 2012 09:51:41 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Tue, 20 Nov 2012 09:51:38 -0500
Message-Id: <1353423098-16371-6-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH RFC 5/5] xen/xsm: include default hook action in
	name
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Include the default XSM hook action in the name of the hook in order to
allow quick understanding of how the call site is expected to be used
(dom0-only, arbitrary guest, or target-only).

Abbreviation explanation:
 xsm_dm_*      Usable only by device model (IS_PRIV_FOR)
 xsm_hook_*    No access check in dummy module. The calling code is
               either guest-accessible or covered by another check
 xsm_priv_*    Privileged command (IS_PRIV)
 xsm_target_*  Usable by guest or its device model targeted to the guest

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/cpu/mcheck/mce.c     |   2 +-
 xen/arch/x86/domctl.c             |  10 +-
 xen/arch/x86/hvm/hvm.c            |  26 +--
 xen/arch/x86/irq.c                |   2 +-
 xen/arch/x86/mm.c                 |  20 +-
 xen/arch/x86/mm/mem_event.c       |   4 +-
 xen/arch/x86/mm/mem_sharing.c     |   4 +-
 xen/arch/x86/mm/paging.c          |   2 +-
 xen/arch/x86/msi.c                |   2 +-
 xen/arch/x86/physdev.c            |  12 +-
 xen/arch/x86/platform_hypercall.c |  12 +-
 xen/arch/x86/sysctl.c             |   4 +-
 xen/arch/x86/traps.c              |   2 +-
 xen/common/domain.c               |   2 +-
 xen/common/domctl.c               |  10 +-
 xen/common/event_channel.c        |  14 +-
 xen/common/grant_table.c          |  16 +-
 xen/common/kexec.c                |   2 +-
 xen/common/memory.c               |   8 +-
 xen/common/schedule.c             |   2 +-
 xen/common/sysctl.c               |   6 +-
 xen/common/xenoprof.c             |   2 +-
 xen/drivers/char/console.c        |   2 +-
 xen/drivers/passthrough/iommu.c   |  10 +-
 xen/drivers/passthrough/pci.c     |   4 +-
 xen/include/xen/tmem_xen.h        |   4 +-
 xen/include/xsm/dummy.h           | 140 ++++++-------
 xen/include/xsm/xsm.h             | 428 +++++++++++++++++++-------------------
 xen/xsm/dummy.c                   | 150 ++++++-------
 xen/xsm/flask/hooks.c             | 296 +++++++++++++-------------
 30 files changed, 599 insertions(+), 599 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 658774a..72f6f18 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1293,7 +1293,7 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
     struct xen_mc_msrinject *mc_msrinject;
     struct xen_mc_mceinject *mc_mceinject;
 
-    ret = xsm_do_mca();
+    ret = xsm_priv_do_mca();
     if ( ret )
         return x86_mcerr(NULL, ret);
 
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 2630bdb..9541ef8 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -76,7 +76,7 @@ long arch_do_domctl(
 
         if ( np == 0 )
             ret = 0;
-        else if ( xsm_ioport_permission(d, fp, fp + np - 1, allow) )
+        else if ( xsm_hook_ioport_permission(d, fp, fp + np - 1, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = ioports_permit_access(d, fp, fp + np - 1);
@@ -566,7 +566,7 @@ long arch_do_domctl(
         if ( !is_hvm_domain(d) )
             break;
 
-        ret = xsm_bind_pt_irq(d, bind);
+        ret = xsm_hook_bind_pt_irq(d, bind);
         if ( ret )
             break;
 
@@ -599,7 +599,7 @@ long arch_do_domctl(
              !irq_access_permitted(current->domain, bind->machine_irq) )
             break;
 
-        ret = xsm_unbind_pt_irq(d, bind);
+        ret = xsm_hook_unbind_pt_irq(d, bind);
         if ( ret )
             break;
 
@@ -634,7 +634,7 @@ long arch_do_domctl(
              !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
             break;
 
-        ret = xsm_iomem_mapping(d, mfn, mfn + nr_mfns - 1, add);
+        ret = xsm_hook_iomem_mapping(d, mfn, mfn + nr_mfns - 1, add);
         if ( ret )
             break;
 
@@ -712,7 +712,7 @@ long arch_do_domctl(
              !ioports_access_permitted(current->domain, fmp, fmp + np - 1) )
             break;
 
-        ret = xsm_ioport_mapping(d, fmp, fmp + np - 1, add);
+        ret = xsm_hook_ioport_mapping(d, fmp, fmp + np - 1, add);
         if ( ret )
             break;
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 5bdde8d..e75c139 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3400,7 +3400,7 @@ static int hvmop_set_pci_intx_level(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_set_pci_intx_level(d);
+    rc = xsm_dm_hvm_set_pci_intx_level(d);
     if ( rc )
         goto out;
 
@@ -3567,7 +3567,7 @@ static int hvmop_set_isa_irq_level(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_set_isa_irq_level(d);
+    rc = xsm_dm_hvm_set_isa_irq_level(d);
     if ( rc )
         goto out;
 
@@ -3611,7 +3611,7 @@ static int hvmop_set_pci_link_route(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_set_pci_link_route(d);
+    rc = xsm_dm_hvm_set_pci_link_route(d);
     if ( rc )
         goto out;
 
@@ -3641,7 +3641,7 @@ static int hvmop_inject_msi(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_inject_msi(d);
+    rc = xsm_dm_hvm_inject_msi(d);
     if ( rc )
         goto out;
 
@@ -3738,7 +3738,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail;
 
@@ -3984,7 +3984,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail2;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail2;
 
@@ -4023,7 +4023,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail3;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail3;
 
@@ -4069,7 +4069,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail_getmemtype;
 
@@ -4124,7 +4124,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail4;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail4;
 
@@ -4203,7 +4203,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail5;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail5;
 
@@ -4238,7 +4238,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail6;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail6;
 
@@ -4274,7 +4274,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) || !paging_mode_shadow(d) )
             goto param_fail7;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail7;
 
@@ -4328,7 +4328,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail8;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail8;
 
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 238600a..ba8a5ce 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1874,7 +1874,7 @@ int map_domain_pirq(
         return 0;
     }
 
-    ret = xsm_map_domain_pirq(d, irq, data);
+    ret = xsm_hook_map_domain_pirq(d, irq, data);
     if ( ret )
     {
         dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq %d mapping to pirq %d\n",
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 39b2cc7..1dbe4ef 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2715,7 +2715,7 @@ long do_mmuext_op(
         goto out;
     }
 
-    rc = xsm_mmuext_op(d, pg_owner);
+    rc = xsm_target_mmuext_op(d, pg_owner);
     if ( rc )
     {
         rcu_unlock_domain(pg_owner);
@@ -2787,7 +2787,7 @@ long do_mmuext_op(
                 break;
             }
 
-            if ( (rc = xsm_memory_pin_page(d, pg_owner, page)) != 0 )
+            if ( (rc = xsm_hook_memory_pin_page(d, pg_owner, page)) != 0 )
             {
                 put_page_and_type(page);
                 okay = 0;
@@ -3244,7 +3244,7 @@ long do_mmu_update(
             }
             if ( xsm_needed != xsm_checked )
             {
-                rc = xsm_mmu_update(d, pt_owner, pg_owner, xsm_needed);
+                rc = xsm_target_mmu_update(d, pt_owner, pg_owner, xsm_needed);
                 if ( rc )
                     break;
                 xsm_checked = xsm_needed;
@@ -3363,7 +3363,7 @@ long do_mmu_update(
             xsm_needed |= XSM_MMU_MACHPHYS_UPDATE;
             if ( xsm_needed != xsm_checked )
             {
-                rc = xsm_mmu_update(d, NULL, pg_owner, xsm_needed);
+                rc = xsm_target_mmu_update(d, NULL, pg_owner, xsm_needed);
                 if ( rc )
                     break;
                 xsm_checked = xsm_needed;
@@ -3931,7 +3931,7 @@ static int __do_update_va_mapping(
 
     perfc_incr(calls_to_update_va);
 
-    rc = xsm_update_va_mapping(d, pg_owner, val);
+    rc = xsm_target_update_va_mapping(d, pg_owner, val);
     if ( rc )
         return rc;
 
@@ -4402,7 +4402,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        if ( xsm_add_to_physmap(current->domain, d) )
+        if ( xsm_target_add_to_physmap(current->domain, d) )
         {
             rcu_unlock_domain(d);
             return -EPERM;
@@ -4441,7 +4441,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        rc = xsm_domain_memory_map(d);
+        rc = xsm_target_domain_memory_map(d);
         if ( rc )
         {
             rcu_unlock_domain(d);
@@ -4516,7 +4516,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         XEN_GUEST_HANDLE_PARAM(e820entry_t) buffer_param;
         unsigned int i;
 
-        rc = xsm_machine_memory_map();
+        rc = xsm_priv_machine_memory_map();
         if ( rc )
             return rc;
 
@@ -4600,9 +4600,9 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
             return -ESRCH;
 
         if ( op == XENMEM_set_pod_target )
-            rc = xsm_set_pod_target(d);
+            rc = xsm_priv_set_pod_target(d);
         else
-            rc = xsm_get_pod_target(d);
+            rc = xsm_priv_get_pod_target(d);
 
         if ( rc != 0 )
             goto pod_target_out_unlock;
diff --git a/xen/arch/x86/mm/mem_event.c b/xen/arch/x86/mm/mem_event.c
index c2b3670..3a7605c 100644
--- a/xen/arch/x86/mm/mem_event.c
+++ b/xen/arch/x86/mm/mem_event.c
@@ -449,7 +449,7 @@ int do_mem_event_op(int op, uint32_t domain, void *arg)
     if ( ret )
         return ret;
 
-    ret = xsm_mem_event_op(d, op);
+    ret = xsm_dm_mem_event_op(d, op);
     if ( ret )
         goto out;
 
@@ -502,7 +502,7 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
 {
     int rc;
 
-    rc = xsm_mem_event_control(d, mec->mode, mec->op);
+    rc = xsm_dm_mem_event_control(d, mec->mode, mec->op);
     if ( rc )
         return rc;
 
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 9229b83..57f02af 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1351,7 +1351,7 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( rc )
                 return rc;
 
-            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            rc = xsm_dm_mem_sharing_op(d, cd, mec->op);
             if ( rc )
             {
                 rcu_unlock_domain(cd);
@@ -1415,7 +1415,7 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( rc )
                 return rc;
 
-            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            rc = xsm_dm_mem_sharing_op(d, cd, mec->op);
             if ( rc )
             {
                 rcu_unlock_domain(cd);
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index ea44e39..1815696 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -678,7 +678,7 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
         return -EINVAL;
     }
 
-    rc = xsm_shadow_control(d, sc->op);
+    rc = xsm_hook_shadow_control(d, sc->op);
     if ( rc )
         return rc;
 
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index e48ad2e..4bad230 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1016,7 +1016,7 @@ int pci_restore_msi_state(struct pci_dev *pdev)
     if (!pdev)
         return -EINVAL;
 
-    ret = xsm_resource_setup_pci((pdev->seg << 16) | (pdev->bus << 8) | pdev->devfn);
+    ret = xsm_priv_resource_setup_pci((pdev->seg << 16) | (pdev->bus << 8) | pdev->devfn);
     if ( ret )
         return ret;
 
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 9c30245..a894c43 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -232,7 +232,7 @@ int physdev_unmap_pirq(domid_t domid, int pirq)
             goto free_domain;
     }
 
-    ret = xsm_unmap_domain_pirq(d, domain_pirq_to_irq(d, pirq));
+    ret = xsm_dm_unmap_domain_pirq(d, domain_pirq_to_irq(d, pirq));
     if ( ret )
         goto free_domain;
 
@@ -423,7 +423,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = xsm_apic(v->domain, cmd);
+        ret = xsm_priv_apic(v->domain, cmd);
         if ( ret )
             break;
         ret = ioapic_guest_read(apic.apic_physbase, apic.reg, &apic.value);
@@ -437,7 +437,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = xsm_apic(v->domain, cmd);
+        ret = xsm_priv_apic(v->domain, cmd);
         if ( ret )
             break;
         ret = ioapic_guest_write(apic.apic_physbase, apic.reg, apic.value);
@@ -453,7 +453,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         /* Use the APIC check since this dummy hypercall should still only
          * be called by the domain with access to program the ioapic */
-        ret = xsm_apic(v->domain, cmd);
+        ret = xsm_priv_apic(v->domain, cmd);
         if ( ret )
             break;
 
@@ -578,7 +578,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_pci_mmcfg_reserved: {
         struct physdev_pci_mmcfg_reserved info;
 
-        ret = xsm_resource_setup_misc();
+        ret = xsm_priv_resource_setup_misc();
         if ( ret )
             break;
 
@@ -632,7 +632,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( setup_gsi.gsi < 0 || setup_gsi.gsi >= nr_irqs_gsi )
             break;
 
-        ret = xsm_resource_setup_gsi(setup_gsi.gsi);
+        ret = xsm_priv_resource_setup_gsi(setup_gsi.gsi);
         if ( ret )
             break;
 
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index f267b8b..c4b20ea 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -72,7 +72,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     if ( op->interface_version != XENPF_INTERFACE_VERSION )
         return -EACCES;
 
-    ret = xsm_platform_op(op->cmd);
+    ret = xsm_priv_platform_op(op->cmd);
     if ( ret )
         return ret;
 
@@ -496,7 +496,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        ret = xsm_resource_plug_core();
+        ret = xsm_hook_resource_plug_core();
         if ( ret )
             break;
 
@@ -512,7 +512,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
             break;
         }
 
-        ret = xsm_resource_plug_core();
+        ret = xsm_hook_resource_plug_core();
         if ( ret )
             break;
 
@@ -525,7 +525,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        ret = xsm_resource_unplug_core();
+        ret = xsm_hook_resource_unplug_core();
         if ( ret )
             break;
 
@@ -554,7 +554,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_cpu_hotadd:
-        ret = xsm_resource_plug_core();
+        ret = xsm_hook_resource_plug_core();
         if ( ret )
             break;
 
@@ -564,7 +564,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_mem_hotadd:
-        ret = xsm_resource_plug_core();
+        ret = xsm_hook_resource_plug_core();
         if ( ret )
             break;
 
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index 5b0c4b7..3a10a13 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -184,14 +184,14 @@ long arch_do_sysctl(
         switch ( sysctl->u.cpu_hotplug.op )
         {
         case XEN_SYSCTL_CPU_HOTPLUG_ONLINE:
-            ret = xsm_resource_plug_core();
+            ret = xsm_hook_resource_plug_core();
             if ( ret )
                 break;
             ret = continue_hypercall_on_cpu(
                 0, cpu_up_helper, (void *)(unsigned long)cpu);
             break;
         case XEN_SYSCTL_CPU_HOTPLUG_OFFLINE:
-            ret = xsm_resource_unplug_core();
+            ret = xsm_hook_resource_unplug_core();
             if ( ret )
                 break;
             ret = continue_hypercall_on_cpu(
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 44a866e..695e991 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1643,7 +1643,7 @@ static int pci_cfg_ok(struct domain *d, int write, int size)
             start |= (d->arch.pci_cf8 >> 16) & 0xF00;
     }
     end = start + size - 1;
-    if (xsm_pci_config_permission(d, machine_bdf, start, end, write))
+    if (xsm_hook_pci_config_permission(d, machine_bdf, start, end, write))
         return 0;
     return 1;
 }
diff --git a/xen/common/domain.c b/xen/common/domain.c
index fcf24e2..296d735 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -252,7 +252,7 @@ struct domain *domain_create(
 
     if ( !is_idle_domain(d) )
     {
-        if ( (err = xsm_domain_create(d, ssidref)) != 0 )
+        if ( (err = xsm_hook_domain_create(d, ssidref)) != 0 )
             goto fail;
 
         d->is_paused_by_controller = 1;
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 6f792e9..1f88ad2 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -150,7 +150,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
     if ( is_hvm_domain(d) )
         info->flags |= XEN_DOMINF_hvm_guest;
 
-    xsm_security_domaininfo(d, info);
+    xsm_populate_security_domaininfo(d, info);
 
     info->tot_pages         = d->tot_pages;
     info->max_pages         = d->max_pages;
@@ -580,7 +580,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             break;
         }
 
-        ret = xsm_getdomaininfo(d);
+        ret = xsm_hook_getdomaininfo(d);
         if ( ret )
             goto getdomaininfo_out;
 
@@ -722,7 +722,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
         if ( pirq >= d->nr_pirqs )
             ret = -EINVAL;
-        else if ( xsm_irq_permission(d, pirq, allow) )
+        else if ( xsm_hook_irq_permission(d, pirq, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = irq_permit_access(d, pirq);
@@ -741,7 +741,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
             break;
 
-        if ( xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, allow) )
+        if ( xsm_hook_iomem_permission(d, mfn, mfn + nr_mfns - 1, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
@@ -773,7 +773,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             break;
         }
 
-        ret = xsm_set_target(d, e);
+        ret = xsm_hook_set_target(d, e);
         if ( ret ) {
             put_domain(e);
             break;
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 37947a9..ef0d89b 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -175,7 +175,7 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
         ERROR_EXIT_DOM(port, d);
     chn = evtchn_from_port(d, port);
 
-    rc = xsm_evtchn_unbound(d, chn, alloc->remote_dom);
+    rc = xsm_target_evtchn_unbound(d, chn, alloc->remote_dom);
     if ( rc )
         goto out;
 
@@ -231,7 +231,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
          (rchn->u.unbound.remote_domid != ld->domain_id) )
         ERROR_EXIT_DOM(-EINVAL, rd);
 
-    rc = xsm_evtchn_interdomain(ld, lchn, rd, rchn);
+    rc = xsm_hook_evtchn_interdomain(ld, lchn, rd, rchn);
     if ( rc )
         goto out;
 
@@ -535,7 +535,7 @@ static long __evtchn_close(struct domain *d1, int port1)
     chn1->state          = ECS_FREE;
     chn1->notify_vcpu_id = 0;
 
-    xsm_evtchn_close_post(chn1);
+    xsm_hook_evtchn_close_post(chn1);
 
  out:
     if ( d2 != NULL )
@@ -580,7 +580,7 @@ int evtchn_send(struct domain *d, unsigned int lport)
         return -EINVAL;
     }
 
-    ret = xsm_evtchn_send(ld, lchn);
+    ret = xsm_hook_evtchn_send(ld, lchn);
     if ( ret )
         goto out;
 
@@ -812,7 +812,7 @@ static long evtchn_status(evtchn_status_t *status)
 
     chn = evtchn_from_port(d, port);
 
-    rc = xsm_evtchn_status(d, chn);
+    rc = xsm_target_evtchn_status(d, chn);
     if ( rc )
         goto out;
 
@@ -954,7 +954,7 @@ static long evtchn_reset(evtchn_reset_t *r)
     if ( d == NULL )
         return -ESRCH;
 
-    rc = xsm_evtchn_reset(current->domain, d);
+    rc = xsm_target_evtchn_reset(current->domain, d);
     if ( rc )
         goto out;
 
@@ -1101,7 +1101,7 @@ int alloc_unbound_xen_event_channel(
         goto out;
     chn = evtchn_from_port(d, port);
 
-    rc = xsm_evtchn_unbound(d, chn, remote_domid);
+    rc = xsm_target_evtchn_unbound(d, chn, remote_domid);
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index eae9518..e3690b6 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -552,7 +552,7 @@ __gnttab_map_grant_ref(
         return;
     }
 
-    rc = xsm_grant_mapref(ld, rd, op->flags);
+    rc = xsm_hook_grant_mapref(ld, rd, op->flags);
     if ( rc )
     {
         rcu_unlock_domain(rd);
@@ -872,7 +872,7 @@ __gnttab_unmap_common(
         return;
     }
 
-    rc = xsm_grant_unmapref(ld, rd);
+    rc = xsm_hook_grant_unmapref(ld, rd);
     if ( rc )
     {
         rcu_unlock_domain(rd);
@@ -1326,7 +1326,7 @@ gnttab_setup_table(
         goto out2;
     }
 
-    if ( xsm_grant_setup(current->domain, d) )
+    if ( xsm_target_grant_setup(current->domain, d) )
     {
         op.status = GNTST_permission_denied;
         goto out2;
@@ -1395,7 +1395,7 @@ gnttab_query_size(
         goto query_out;
     }
 
-    rc = xsm_grant_query_size(current->domain, d);
+    rc = xsm_target_grant_query_size(current->domain, d);
     if ( rc )
     {
         op.status = GNTST_permission_denied;
@@ -1571,7 +1571,7 @@ gnttab_transfer(
             goto copyback;
         }
 
-        if ( xsm_grant_transfer(d, e) )
+        if ( xsm_hook_grant_transfer(d, e) )
         {
             put_gfn(d, gop.mfn);
             gop.status = GNTST_permission_denied;
@@ -2010,7 +2010,7 @@ __gnttab_copy(
         PIN_FAIL(error_out, GNTST_bad_domain,
                  "couldn't find %d\n", op->dest.domid);
 
-    rc = xsm_grant_copy(sd, dd);
+    rc = xsm_hook_grant_copy(sd, dd);
     if ( rc )
     {
         rc = GNTST_permission_denied;
@@ -2267,7 +2267,7 @@ gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop,
         op.status = GNTST_bad_domain;
         goto out1;
     }
-    rc = xsm_grant_setup(current->domain, d);
+    rc = xsm_target_grant_setup(current->domain, d);
     if ( rc ) {
         op.status = GNTST_permission_denied;
         goto out1;
@@ -2318,7 +2318,7 @@ gnttab_get_version(XEN_GUEST_HANDLE_PARAM(gnttab_get_version_t uop))
     if ( d == NULL )
         return -ESRCH;
 
-    rc = xsm_grant_query_size(current->domain, d);
+    rc = xsm_target_grant_query_size(current->domain, d);
     if ( rc )
     {
         rcu_unlock_domain(d);
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index d4f6332..ff9d205 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -852,7 +852,7 @@ static int do_kexec_op_internal(unsigned long op,
     unsigned long flags;
     int ret = -EINVAL;
 
-    ret = xsm_kexec();
+    ret = xsm_priv_kexec();
     if ( ret )
         return ret;
 
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 7d3c326..0e216bb 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -336,7 +336,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
         goto fail_early;
     }
 
-    rc = xsm_memory_exchange(d);
+    rc = xsm_target_memory_exchange(d);
     if ( rc )
     {
         rcu_unlock_domain(d);
@@ -585,7 +585,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return start_extent;
         args.domain = d;
 
-        rc = xsm_memory_adjust_reservation(current->domain, d);
+        rc = xsm_target_memory_adjust_reservation(current->domain, d);
         if ( rc )
         {
             rcu_unlock_domain(d);
@@ -634,7 +634,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        rc = xsm_memory_stat_reservation(current->domain, d);
+        rc = xsm_target_memory_stat_reservation(current->domain, d);
         if ( rc )
         {
             rcu_unlock_domain(d);
@@ -672,7 +672,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        if ( xsm_remove_from_physmap(current->domain, d) )
+        if ( xsm_target_remove_from_physmap(current->domain, d) )
         {
             rcu_unlock_domain(d);
             return -EPERM;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index cfd173d..2cad778 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -921,7 +921,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             break;
 
-        ret = xsm_schedop_shutdown(current->domain, d);
+        ret = xsm_dm_schedop_shutdown(current->domain, d);
         if ( ret )
         {
             rcu_unlock_domain(d);
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index cbefb0e..d6e3f6c 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -57,7 +57,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     {
     case XEN_SYSCTL_readconsole:
     {
-        ret = xsm_readconsole(op->u.readconsole.clear);
+        ret = xsm_hook_readconsole(op->u.readconsole.clear);
         if ( ret )
             break;
 
@@ -100,7 +100,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
             if ( num_domains == op->u.getdomaininfolist.max_domains )
                 break;
 
-            ret = xsm_getdomaininfo(d);
+            ret = xsm_hook_getdomaininfo(d);
             if ( ret )
                 continue;
 
@@ -231,7 +231,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         uint32_t *status, *ptr;
         unsigned long pfn;
 
-        ret = xsm_page_offline(op->u.page_offline.cmd);
+        ret = xsm_hook_page_offline(op->u.page_offline.cmd);
         if ( ret )
             break;
 
diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index ae0435b..7a82e3a 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -680,7 +680,7 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         return -EPERM;
     }
 
-    ret = xsm_profile(current->domain, op);
+    ret = xsm_hook_profile(current->domain, op);
     if ( ret )
         return ret;
 
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index b2c3ee3..b6faa43 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -406,7 +406,7 @@ long do_console_io(int cmd, int count, XEN_GUEST_HANDLE_PARAM(char) buffer)
     long rc;
     unsigned int idx, len;
 
-    rc = xsm_console_io(current->domain, cmd);
+    rc = xsm_priv_console_io(current->domain, cmd);
     if ( rc )
         return rc;
 
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 9d13185..52eff81 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -452,7 +452,7 @@ static int iommu_get_device_group(
              ((pdev->bus == bus) && (pdev->devfn == devfn)) )
             continue;
 
-        if ( xsm_get_device_group((seg << 16) | (pdev->bus << 8) | pdev->devfn) )
+        if ( xsm_hook_get_device_group((seg << 16) | (pdev->bus << 8) | pdev->devfn) )
             continue;
 
         sdev_id = ops->get_device_group_id(seg, pdev->bus, pdev->devfn);
@@ -555,7 +555,7 @@ int iommu_do_domctl(
         u32 max_sdevs;
         XEN_GUEST_HANDLE_64(uint32) sdevs;
 
-        ret = xsm_get_device_group(domctl->u.get_device_group.machine_sbdf);
+        ret = xsm_hook_get_device_group(domctl->u.get_device_group.machine_sbdf);
         if ( ret )
             break;
 
@@ -583,7 +583,7 @@ int iommu_do_domctl(
     break;
 
     case XEN_DOMCTL_test_assign_device:
-        ret = xsm_test_assign_device(domctl->u.assign_device.machine_sbdf);
+        ret = xsm_hook_test_assign_device(domctl->u.assign_device.machine_sbdf);
         if ( ret )
             break;
 
@@ -607,7 +607,7 @@ int iommu_do_domctl(
             break;
         }
 
-        ret = xsm_assign_device(d, domctl->u.assign_device.machine_sbdf);
+        ret = xsm_hook_assign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
             break;
 
@@ -626,7 +626,7 @@ int iommu_do_domctl(
         break;
 
     case XEN_DOMCTL_deassign_device:
-        ret = xsm_deassign_device(d, domctl->u.assign_device.machine_sbdf);
+        ret = xsm_hook_deassign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
             break;
 
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index d5ef4c1..43eceab 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -380,7 +380,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn, const struct pci_dev_info *info)
         pdev_type = "device";
     }
 
-    ret = xsm_resource_plug_pci((seg << 16) | (bus << 8) | devfn);
+    ret = xsm_priv_resource_plug_pci((seg << 16) | (bus << 8) | devfn);
     if ( ret )
         return ret;
 
@@ -496,7 +496,7 @@ int pci_remove_device(u16 seg, u8 bus, u8 devfn)
     struct pci_dev *pdev;
     int ret;
 
-    ret = xsm_resource_unplug_pci((seg << 16) | (bus << 8) | devfn);
+    ret = xsm_priv_resource_unplug_pci((seg << 16) | (bus << 8) | devfn);
     if ( ret )
         return ret;
 
diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h
index 8dec5aa..81d88f3 100644
--- a/xen/include/xen/tmem_xen.h
+++ b/xen/include/xen/tmem_xen.h
@@ -329,12 +329,12 @@ static inline bool_t tmh_set_client_from_id(
 
 static inline bool_t tmh_current_permitted(void)
 {
-    return !xsm_tmem_op();
+    return !xsm_hook_tmem_op();
 }
 
 static inline bool_t tmh_current_is_privileged(void)
 {
-    return !xsm_tmem_control();
+    return !xsm_priv_tmem_control();
 }
 
 static inline uint8_t tmh_get_first_byte(pfp_t *pfp)
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index aaac50d3..09ee3f2 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -11,23 +11,23 @@
 #include <xen/sched.h>
 #include <xsm/xsm.h>
 
-static XSM_INLINE void xsm_security_domaininfo(struct domain *d,
+static XSM_INLINE void xsm_populate_security_domaininfo(struct domain *d,
                                     struct xen_domctl_getdomaininfo *info)
 {
     return;
 }
 
-static XSM_INLINE int xsm_domain_create(struct domain *d, u32 ssidref)
+static XSM_INLINE int xsm_hook_domain_create(struct domain *d, u32 ssidref)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
+static XSM_INLINE int xsm_hook_getdomaininfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
+static XSM_INLINE int xsm_hook_set_target(struct domain *d, struct domain *e)
 {
     return 0;
 }
@@ -58,12 +58,12 @@ static XSM_INLINE int xsm_sysctl(int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_readconsole(uint32_t clear)
+static XSM_INLINE int xsm_hook_readconsole(uint32_t clear)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_do_mca(void)
+static XSM_INLINE int xsm_priv_do_mca(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
@@ -80,49 +80,49 @@ static XSM_INLINE void xsm_free_security_domain(struct domain *d)
     return;
 }
 
-static XSM_INLINE int xsm_grant_mapref(struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_hook_grant_mapref(struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_unmapref(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_hook_grant_unmapref(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_setup(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_grant_setup(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_transfer(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_hook_grant_transfer(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_copy(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_hook_grant_copy(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_query_size(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_grant_query_size(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_memory_exchange(struct domain *d)
+static XSM_INLINE int xsm_target_memory_exchange(struct domain *d)
 {
     if ( d != current->domain && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
+static XSM_INLINE int xsm_target_memory_adjust_reservation(struct domain *d1,
                                                             struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
@@ -130,14 +130,14 @@ static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
     return 0;
 }
 
-static XSM_INLINE int xsm_memory_stat_reservation(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_memory_stat_reservation(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_console_io(struct domain *d, int cmd)
+static XSM_INLINE int xsm_priv_console_io(struct domain *d, int cmd)
 {
 #ifndef VERBOSE
     if ( !IS_PRIV(current->domain) )
@@ -146,32 +146,32 @@ static XSM_INLINE int xsm_console_io(struct domain *d, int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_profile(struct domain *d, int op)
+static XSM_INLINE int xsm_hook_profile(struct domain *d, int op)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_kexec(void)
+static XSM_INLINE int xsm_priv_kexec(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_schedop_shutdown(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_dm_schedop_shutdown(struct domain *d1, struct domain *d2)
 {
     if ( !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_hook_memory_pin_page(struct domain *d1, struct domain *d2,
                                           struct page_info *page)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_evtchn_unbound(struct domain *d, struct evtchn *chn,
+static XSM_INLINE int xsm_target_evtchn_unbound(struct domain *d, struct evtchn *chn,
                                          domid_t id2)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
@@ -179,30 +179,30 @@ static XSM_INLINE int xsm_evtchn_unbound(struct domain *d, struct evtchn *chn,
     return 0;
 }
 
-static XSM_INLINE int xsm_evtchn_interdomain(struct domain *d1, struct evtchn
+static XSM_INLINE int xsm_hook_evtchn_interdomain(struct domain *d1, struct evtchn
                                 *chan1, struct domain *d2, struct evtchn *chan2)
 {
     return 0;
 }
 
-static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
+static XSM_INLINE void xsm_hook_evtchn_close_post(struct evtchn *chn)
 {
     return;
 }
 
-static XSM_INLINE int xsm_evtchn_send(struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_hook_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_evtchn_status(struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_target_evtchn_status(struct domain *d, struct evtchn *chn)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_evtchn_reset(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_evtchn_reset(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
@@ -224,96 +224,96 @@ static XSM_INLINE char * xsm_show_security_evtchn(struct domain *d, const struct
     return NULL;
 }
 
-static XSM_INLINE int xsm_get_pod_target(struct domain *d)
+static XSM_INLINE int xsm_priv_get_pod_target(struct domain *d)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_set_pod_target(struct domain *d)
+static XSM_INLINE int xsm_priv_set_pod_target(struct domain *d)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_get_device_group(uint32_t machine_bdf)
+static XSM_INLINE int xsm_hook_get_device_group(uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_test_assign_device(uint32_t machine_bdf)
+static XSM_INLINE int xsm_hook_test_assign_device(uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_hook_assign_device(struct domain *d, uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_hook_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_plug_core(void)
+static XSM_INLINE int xsm_hook_resource_plug_core(void)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_unplug_core(void)
+static XSM_INLINE int xsm_hook_resource_unplug_core(void)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_plug_pci(uint32_t machine_bdf)
+static XSM_INLINE int xsm_priv_resource_plug_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_unplug_pci(uint32_t machine_bdf)
+static XSM_INLINE int xsm_priv_resource_unplug_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_setup_pci(uint32_t machine_bdf)
+static XSM_INLINE int xsm_priv_resource_setup_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_setup_gsi(int gsi)
+static XSM_INLINE int xsm_priv_resource_setup_gsi(int gsi)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_setup_misc(void)
+static XSM_INLINE int xsm_priv_resource_setup_misc(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_page_offline(uint32_t cmd)
+static XSM_INLINE int xsm_hook_page_offline(uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_tmem_op(void)
+static XSM_INLINE int xsm_hook_tmem_op(void)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_tmem_control(void)
+static XSM_INLINE int xsm_priv_tmem_control(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
@@ -330,34 +330,34 @@ static XSM_INLINE char * xsm_show_irq_sid(int irq)
     return NULL;
 }
 
-static XSM_INLINE int xsm_map_domain_pirq(struct domain *d, int irq, void *data)
+static XSM_INLINE int xsm_hook_map_domain_pirq(struct domain *d, int irq, void *data)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_unmap_domain_pirq(struct domain *d, int irq)
+static XSM_INLINE int xsm_dm_unmap_domain_pirq(struct domain *d, int irq)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_irq_permission(struct domain *d, int pirq, uint8_t allow)
+static XSM_INLINE int xsm_hook_irq_permission(struct domain *d, int pirq, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_iomem_permission(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_hook_iomem_permission(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_iomem_mapping(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_hook_iomem_mapping(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_pci_config_permission(struct domain *d, uint32_t machine_bdf,
+static XSM_INLINE int xsm_hook_pci_config_permission(struct domain *d, uint32_t machine_bdf,
                                         uint16_t start, uint16_t end,
                                         uint8_t access)
 {
@@ -365,96 +365,96 @@ static XSM_INLINE int xsm_pci_config_permission(struct domain *d, uint32_t machi
 }
 
 #ifdef CONFIG_X86
-static XSM_INLINE int xsm_shadow_control(struct domain *d, uint32_t op)
+static XSM_INLINE int xsm_hook_shadow_control(struct domain *d, uint32_t op)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
+static XSM_INLINE int xsm_target_hvm_param(struct domain *d, unsigned long op)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_set_pci_intx_level(struct domain *d)
+static XSM_INLINE int xsm_dm_hvm_set_pci_intx_level(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_set_isa_irq_level(struct domain *d)
+static XSM_INLINE int xsm_dm_hvm_set_isa_irq_level(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_set_pci_link_route(struct domain *d)
+static XSM_INLINE int xsm_dm_hvm_set_pci_link_route(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
+static XSM_INLINE int xsm_dm_hvm_inject_msi(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_event_control(struct domain *d, int mode, int op)
+static XSM_INLINE int xsm_dm_mem_event_control(struct domain *d, int mode, int op)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_event_op(struct domain *d, int op)
+static XSM_INLINE int xsm_dm_mem_event_op(struct domain *d, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
+static XSM_INLINE int xsm_dm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, cd) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
+static XSM_INLINE int xsm_priv_apic(struct domain *d, int cmd)
 {
     if ( !IS_PRIV(d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_platform_op(uint32_t op)
+static XSM_INLINE int xsm_priv_platform_op(uint32_t op)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_machine_memory_map(void)
+static XSM_INLINE int xsm_priv_machine_memory_map(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_domain_memory_map(struct domain *d)
+static XSM_INLINE int xsm_target_domain_memory_map(struct domain *d)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_mmu_update(struct domain *d, struct domain *t,
+static XSM_INLINE int xsm_target_mmu_update(struct domain *d, struct domain *t,
                                      struct domain *f, uint32_t flags)
 {
     if ( t && d != t && !IS_PRIV_FOR(d, t) )
@@ -464,14 +464,14 @@ static XSM_INLINE int xsm_mmu_update(struct domain *d, struct domain *t,
     return 0;
 }
 
-static XSM_INLINE int xsm_mmuext_op(struct domain *d, struct domain *f)
+static XSM_INLINE int xsm_target_mmuext_op(struct domain *d, struct domain *f)
 {
     if ( d != f && !IS_PRIV_FOR(d, f) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f, 
+static XSM_INLINE int xsm_target_update_va_mapping(struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
     if ( d != f && !IS_PRIV_FOR(d, f) )
@@ -479,36 +479,36 @@ static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f,
     return 0;
 }
 
-static XSM_INLINE int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_add_to_physmap(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_hook_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_unbind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_hook_unbind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_hook_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_ioport_mapping(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_hook_ioport_mapping(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
 }
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 105201e..c3a29b6 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -39,30 +39,30 @@ extern xsm_initcall_t __xsm_initcall_start[], __xsm_initcall_end[];
     __used_section(".xsm_initcall.init") = fn
 
 struct xsm_operations {
-    void (*security_domaininfo) (struct domain *d,
+    void (*populate_security_domaininfo) (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info);
-    int (*domain_create) (struct domain *d, u32 ssidref);
-    int (*getdomaininfo) (struct domain *d);
-    int (*set_target) (struct domain *d, struct domain *e);
+    int (*hook_domain_create) (struct domain *d, u32 ssidref);
+    int (*hook_getdomaininfo) (struct domain *d);
+    int (*hook_set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
     int (*sysctl) (int cmd);
-    int (*readconsole) (uint32_t clear);
-    int (*do_mca) (void);
+    int (*hook_readconsole) (uint32_t clear);
+    int (*priv_do_mca) (void);
 
-    int (*evtchn_unbound) (struct domain *d, struct evtchn *chn, domid_t id2);
-    int (*evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
+    int (*target_evtchn_unbound) (struct domain *d, struct evtchn *chn, domid_t id2);
+    int (*hook_evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
                                         struct domain *d2, struct evtchn *chn2);
-    void (*evtchn_close_post) (struct evtchn *chn);
-    int (*evtchn_send) (struct domain *d, struct evtchn *chn);
-    int (*evtchn_status) (struct domain *d, struct evtchn *chn);
-    int (*evtchn_reset) (struct domain *d1, struct domain *d2);
-
-    int (*grant_mapref) (struct domain *d1, struct domain *d2, uint32_t flags);
-    int (*grant_unmapref) (struct domain *d1, struct domain *d2);
-    int (*grant_setup) (struct domain *d1, struct domain *d2);
-    int (*grant_transfer) (struct domain *d1, struct domain *d2);
-    int (*grant_copy) (struct domain *d1, struct domain *d2);
-    int (*grant_query_size) (struct domain *d1, struct domain *d2);
+    void (*hook_evtchn_close_post) (struct evtchn *chn);
+    int (*hook_evtchn_send) (struct domain *d, struct evtchn *chn);
+    int (*target_evtchn_status) (struct domain *d, struct evtchn *chn);
+    int (*target_evtchn_reset) (struct domain *d1, struct domain *d2);
+
+    int (*hook_grant_mapref) (struct domain *d1, struct domain *d2, uint32_t flags);
+    int (*hook_grant_unmapref) (struct domain *d1, struct domain *d2);
+    int (*target_grant_setup) (struct domain *d1, struct domain *d2);
+    int (*hook_grant_transfer) (struct domain *d1, struct domain *d2);
+    int (*hook_grant_copy) (struct domain *d1, struct domain *d2);
+    int (*target_grant_query_size) (struct domain *d1, struct domain *d2);
 
     int (*alloc_security_domain) (struct domain *d);
     void (*free_security_domain) (struct domain *d);
@@ -70,76 +70,76 @@ struct xsm_operations {
     void (*free_security_evtchn) (struct evtchn *chn);
     char *(*show_security_evtchn) (struct domain *d, const struct evtchn *chn);
 
-    int (*get_pod_target) (struct domain *d);
-    int (*set_pod_target) (struct domain *d);
-    int (*memory_exchange) (struct domain *d);
-    int (*memory_adjust_reservation) (struct domain *d1, struct domain *d2);
-    int (*memory_stat_reservation) (struct domain *d1, struct domain *d2);
-    int (*memory_pin_page) (struct domain *d1, struct domain *d2, struct page_info *page);
-    int (*remove_from_physmap) (struct domain *d1, struct domain *d2);
+    int (*priv_get_pod_target) (struct domain *d);
+    int (*priv_set_pod_target) (struct domain *d);
+    int (*target_memory_exchange) (struct domain *d);
+    int (*target_memory_adjust_reservation) (struct domain *d1, struct domain *d2);
+    int (*target_memory_stat_reservation) (struct domain *d1, struct domain *d2);
+    int (*hook_memory_pin_page) (struct domain *d1, struct domain *d2, struct page_info *page);
+    int (*target_remove_from_physmap) (struct domain *d1, struct domain *d2);
 
-    int (*console_io) (struct domain *d, int cmd);
+    int (*priv_console_io) (struct domain *d, int cmd);
 
-    int (*profile) (struct domain *d, int op);
+    int (*hook_profile) (struct domain *d, int op);
 
-    int (*kexec) (void);
-    int (*schedop_shutdown) (struct domain *d1, struct domain *d2);
+    int (*priv_kexec) (void);
+    int (*dm_schedop_shutdown) (struct domain *d1, struct domain *d2);
 
     char *(*show_irq_sid) (int irq);
-    int (*map_domain_pirq) (struct domain *d, int irq, void *data);
-    int (*unmap_domain_pirq) (struct domain *d, int irq);
-    int (*irq_permission) (struct domain *d, int pirq, uint8_t allow);
-    int (*iomem_permission) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
-    int (*iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
-    int (*pci_config_permission) (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access);
-
-    int (*get_device_group) (uint32_t machine_bdf);
-    int (*test_assign_device) (uint32_t machine_bdf);
-    int (*assign_device) (struct domain *d, uint32_t machine_bdf);
-    int (*deassign_device) (struct domain *d, uint32_t machine_bdf);
-
-    int (*resource_plug_core) (void);
-    int (*resource_unplug_core) (void);
-    int (*resource_plug_pci) (uint32_t machine_bdf);
-    int (*resource_unplug_pci) (uint32_t machine_bdf);
-    int (*resource_setup_pci) (uint32_t machine_bdf);
-    int (*resource_setup_gsi) (int gsi);
-    int (*resource_setup_misc) (void);
-
-    int (*page_offline)(uint32_t cmd);
-    int (*tmem_op)(void);
-    int (*tmem_control)(void);
+    int (*hook_map_domain_pirq) (struct domain *d, int irq, void *data);
+    int (*dm_unmap_domain_pirq) (struct domain *d, int irq);
+    int (*hook_irq_permission) (struct domain *d, int pirq, uint8_t allow);
+    int (*hook_iomem_permission) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
+    int (*hook_iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
+    int (*hook_pci_config_permission) (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access);
+
+    int (*hook_get_device_group) (uint32_t machine_bdf);
+    int (*hook_test_assign_device) (uint32_t machine_bdf);
+    int (*hook_assign_device) (struct domain *d, uint32_t machine_bdf);
+    int (*hook_deassign_device) (struct domain *d, uint32_t machine_bdf);
+
+    int (*hook_resource_plug_core) (void);
+    int (*hook_resource_unplug_core) (void);
+    int (*priv_resource_plug_pci) (uint32_t machine_bdf);
+    int (*priv_resource_unplug_pci) (uint32_t machine_bdf);
+    int (*priv_resource_setup_pci) (uint32_t machine_bdf);
+    int (*priv_resource_setup_gsi) (int gsi);
+    int (*priv_resource_setup_misc) (void);
+
+    int (*hook_page_offline)(uint32_t cmd);
+    int (*hook_tmem_op)(void);
+    int (*priv_tmem_control)(void);
 
     long (*do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
 
 #ifdef CONFIG_X86
-    int (*shadow_control) (struct domain *d, uint32_t op);
-    int (*hvm_param) (struct domain *d, unsigned long op);
-    int (*hvm_set_pci_intx_level) (struct domain *d);
-    int (*hvm_set_isa_irq_level) (struct domain *d);
-    int (*hvm_set_pci_link_route) (struct domain *d);
-    int (*hvm_inject_msi) (struct domain *d);
-    int (*mem_event_control) (struct domain *d, int mode, int op);
-    int (*mem_event_op) (struct domain *d, int op);
-    int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
-    int (*apic) (struct domain *d, int cmd);
+    int (*hook_shadow_control) (struct domain *d, uint32_t op);
+    int (*target_hvm_param) (struct domain *d, unsigned long op);
+    int (*dm_hvm_set_pci_intx_level) (struct domain *d);
+    int (*dm_hvm_set_isa_irq_level) (struct domain *d);
+    int (*dm_hvm_set_pci_link_route) (struct domain *d);
+    int (*dm_hvm_inject_msi) (struct domain *d);
+    int (*dm_mem_event_control) (struct domain *d, int mode, int op);
+    int (*dm_mem_event_op) (struct domain *d, int op);
+    int (*dm_mem_sharing_op) (struct domain *d, struct domain *cd, int op);
+    int (*priv_apic) (struct domain *d, int cmd);
     int (*memtype) (uint32_t access);
-    int (*platform_op) (uint32_t cmd);
-    int (*machine_memory_map) (void);
-    int (*domain_memory_map) (struct domain *d);
+    int (*priv_platform_op) (uint32_t cmd);
+    int (*priv_machine_memory_map) (void);
+    int (*target_domain_memory_map) (struct domain *d);
 #define XSM_MMU_UPDATE_READ      1
 #define XSM_MMU_UPDATE_WRITE     2
 #define XSM_MMU_NORMAL_UPDATE    4
 #define XSM_MMU_MACHPHYS_UPDATE  8
-    int (*mmu_update) (struct domain *d, struct domain *t,
+    int (*target_mmu_update) (struct domain *d, struct domain *t,
                        struct domain *f, uint32_t flags);
-    int (*mmuext_op) (struct domain *d, struct domain *f);
-    int (*update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
-    int (*add_to_physmap) (struct domain *d1, struct domain *d2);
-    int (*bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
-    int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
+    int (*target_mmuext_op) (struct domain *d, struct domain *f);
+    int (*target_update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
+    int (*target_add_to_physmap) (struct domain *d1, struct domain *d2);
+    int (*hook_bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
+    int (*hook_unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
+    int (*hook_ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
+    int (*hook_ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
 #endif
 };
 
@@ -149,25 +149,25 @@ extern struct xsm_operations *xsm_ops;
 
 #ifndef XSM_NO_WRAPPERS
 
-static inline void xsm_security_domaininfo (struct domain *d,
+static inline void xsm_populate_security_domaininfo (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info)
 {
-    xsm_ops->security_domaininfo(d, info);
+    xsm_ops->populate_security_domaininfo(d, info);
 }
 
-static inline int xsm_domain_create (struct domain *d, u32 ssidref)
+static inline int xsm_hook_domain_create (struct domain *d, u32 ssidref)
 {
-    return xsm_ops->domain_create(d, ssidref);
+    return xsm_ops->hook_domain_create(d, ssidref);
 }
 
-static inline int xsm_getdomaininfo (struct domain *d)
+static inline int xsm_hook_getdomaininfo (struct domain *d)
 {
-    return xsm_ops->getdomaininfo(d);
+    return xsm_ops->hook_getdomaininfo(d);
 }
 
-static inline int xsm_set_target (struct domain *d, struct domain *e)
+static inline int xsm_hook_set_target (struct domain *d, struct domain *e)
 {
-    return xsm_ops->set_target(d, e);
+    return xsm_ops->hook_set_target(d, e);
 }
 
 static inline int xsm_domctl (struct domain *d, int cmd)
@@ -180,77 +180,77 @@ static inline int xsm_sysctl (int cmd)
     return xsm_ops->sysctl(cmd);
 }
 
-static inline int xsm_readconsole (uint32_t clear)
+static inline int xsm_hook_readconsole (uint32_t clear)
 {
-    return xsm_ops->readconsole(clear);
+    return xsm_ops->hook_readconsole(clear);
 }
 
-static inline int xsm_do_mca(void)
+static inline int xsm_priv_do_mca(void)
 {
-    return xsm_ops->do_mca();
+    return xsm_ops->priv_do_mca();
 }
 
-static inline int xsm_evtchn_unbound (struct domain *d1, struct evtchn *chn,
+static inline int xsm_target_evtchn_unbound (struct domain *d1, struct evtchn *chn,
                                                                     domid_t id2)
 {
-    return xsm_ops->evtchn_unbound(d1, chn, id2);
+    return xsm_ops->target_evtchn_unbound(d1, chn, id2);
 }
 
-static inline int xsm_evtchn_interdomain (struct domain *d1, 
+static inline int xsm_hook_evtchn_interdomain (struct domain *d1, 
                 struct evtchn *chan1, struct domain *d2, struct evtchn *chan2)
 {
-    return xsm_ops->evtchn_interdomain(d1, chan1, d2, chan2);
+    return xsm_ops->hook_evtchn_interdomain(d1, chan1, d2, chan2);
 }
 
-static inline void xsm_evtchn_close_post (struct evtchn *chn)
+static inline void xsm_hook_evtchn_close_post (struct evtchn *chn)
 {
-    xsm_ops->evtchn_close_post(chn);
+    xsm_ops->hook_evtchn_close_post(chn);
 }
 
-static inline int xsm_evtchn_send (struct domain *d, struct evtchn *chn)
+static inline int xsm_hook_evtchn_send (struct domain *d, struct evtchn *chn)
 {
-    return xsm_ops->evtchn_send(d, chn);
+    return xsm_ops->hook_evtchn_send(d, chn);
 }
 
-static inline int xsm_evtchn_status (struct domain *d, struct evtchn *chn)
+static inline int xsm_target_evtchn_status (struct domain *d, struct evtchn *chn)
 {
-    return xsm_ops->evtchn_status(d, chn);
+    return xsm_ops->target_evtchn_status(d, chn);
 }
 
-static inline int xsm_evtchn_reset (struct domain *d1, struct domain *d2)
+static inline int xsm_target_evtchn_reset (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->evtchn_reset(d1, d2);
+    return xsm_ops->target_evtchn_reset(d1, d2);
 }
 
-static inline int xsm_grant_mapref (struct domain *d1, struct domain *d2,
+static inline int xsm_hook_grant_mapref (struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
-    return xsm_ops->grant_mapref(d1, d2, flags);
+    return xsm_ops->hook_grant_mapref(d1, d2, flags);
 }
 
-static inline int xsm_grant_unmapref (struct domain *d1, struct domain *d2)
+static inline int xsm_hook_grant_unmapref (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_unmapref(d1, d2);
+    return xsm_ops->hook_grant_unmapref(d1, d2);
 }
 
-static inline int xsm_grant_setup (struct domain *d1, struct domain *d2)
+static inline int xsm_target_grant_setup (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_setup(d1, d2);
+    return xsm_ops->target_grant_setup(d1, d2);
 }
 
-static inline int xsm_grant_transfer (struct domain *d1, struct domain *d2)
+static inline int xsm_hook_grant_transfer (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_transfer(d1, d2);
+    return xsm_ops->hook_grant_transfer(d1, d2);
 }
 
-static inline int xsm_grant_copy (struct domain *d1, struct domain *d2)
+static inline int xsm_hook_grant_copy (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_copy(d1, d2);
+    return xsm_ops->hook_grant_copy(d1, d2);
 }
 
-static inline int xsm_grant_query_size (struct domain *d1, struct domain *d2)
+static inline int xsm_target_grant_query_size (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_query_size(d1, d2);
+    return xsm_ops->target_grant_query_size(d1, d2);
 }
 
 static inline int xsm_alloc_security_domain (struct domain *d)
@@ -278,62 +278,62 @@ static inline char *xsm_show_security_evtchn (struct domain *d, const struct evt
     return xsm_ops->show_security_evtchn(d, chn);
 }
 
-static inline int xsm_get_pod_target (struct domain *d)
+static inline int xsm_priv_get_pod_target (struct domain *d)
 {
-    return xsm_ops->get_pod_target(d);
+    return xsm_ops->priv_get_pod_target(d);
 }
 
-static inline int xsm_set_pod_target (struct domain *d)
+static inline int xsm_priv_set_pod_target (struct domain *d)
 {
-    return xsm_ops->set_pod_target(d);
+    return xsm_ops->priv_set_pod_target(d);
 }
 
-static inline int xsm_memory_exchange (struct domain *d)
+static inline int xsm_target_memory_exchange (struct domain *d)
 {
-    return xsm_ops->memory_exchange(d);
+    return xsm_ops->target_memory_exchange(d);
 }
 
-static inline int xsm_memory_adjust_reservation (struct domain *d1, struct
+static inline int xsm_target_memory_adjust_reservation (struct domain *d1, struct
                                                                     domain *d2)
 {
-    return xsm_ops->memory_adjust_reservation(d1, d2);
+    return xsm_ops->target_memory_adjust_reservation(d1, d2);
 }
 
-static inline int xsm_memory_stat_reservation (struct domain *d1,
+static inline int xsm_target_memory_stat_reservation (struct domain *d1,
                                                             struct domain *d2)
 {
-    return xsm_ops->memory_stat_reservation(d1, d2);
+    return xsm_ops->target_memory_stat_reservation(d1, d2);
 }
 
-static inline int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
+static inline int xsm_hook_memory_pin_page(struct domain *d1, struct domain *d2,
                                       struct page_info *page)
 {
-    return xsm_ops->memory_pin_page(d1, d2, page);
+    return xsm_ops->hook_memory_pin_page(d1, d2, page);
 }
 
-static inline int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
+static inline int xsm_target_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->remove_from_physmap(d1, d2);
+    return xsm_ops->target_remove_from_physmap(d1, d2);
 }
 
-static inline int xsm_console_io (struct domain *d, int cmd)
+static inline int xsm_priv_console_io (struct domain *d, int cmd)
 {
-    return xsm_ops->console_io(d, cmd);
+    return xsm_ops->priv_console_io(d, cmd);
 }
 
-static inline int xsm_profile (struct domain *d, int op)
+static inline int xsm_hook_profile (struct domain *d, int op)
 {
-    return xsm_ops->profile(d, op);
+    return xsm_ops->hook_profile(d, op);
 }
 
-static inline int xsm_kexec (void)
+static inline int xsm_priv_kexec (void)
 {
-    return xsm_ops->kexec();
+    return xsm_ops->priv_kexec();
 }
 
-static inline int xsm_schedop_shutdown (struct domain *d1, struct domain *d2)
+static inline int xsm_dm_schedop_shutdown (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->schedop_shutdown(d1, d2);
+    return xsm_ops->dm_schedop_shutdown(d1, d2);
 }
 
 static inline char *xsm_show_irq_sid (int irq)
@@ -341,104 +341,104 @@ static inline char *xsm_show_irq_sid (int irq)
     return xsm_ops->show_irq_sid(irq);
 }
 
-static inline int xsm_map_domain_pirq (struct domain *d, int irq, void *data)
+static inline int xsm_hook_map_domain_pirq (struct domain *d, int irq, void *data)
 {
-    return xsm_ops->map_domain_pirq(d, irq, data);
+    return xsm_ops->hook_map_domain_pirq(d, irq, data);
 }
 
-static inline int xsm_unmap_domain_pirq (struct domain *d, int irq)
+static inline int xsm_dm_unmap_domain_pirq (struct domain *d, int irq)
 {
-    return xsm_ops->unmap_domain_pirq(d, irq);
+    return xsm_ops->dm_unmap_domain_pirq(d, irq);
 }
 
-static inline int xsm_irq_permission (struct domain *d, int pirq, uint8_t allow)
+static inline int xsm_hook_irq_permission (struct domain *d, int pirq, uint8_t allow)
 {
-    return xsm_ops->irq_permission(d, pirq, allow);
+    return xsm_ops->hook_irq_permission(d, pirq, allow);
 }
 
-static inline int xsm_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static inline int xsm_hook_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return xsm_ops->iomem_permission(d, s, e, allow);
+    return xsm_ops->hook_iomem_permission(d, s, e, allow);
 }
 
-static inline int xsm_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static inline int xsm_hook_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return xsm_ops->iomem_mapping(d, s, e, allow);
+    return xsm_ops->hook_iomem_mapping(d, s, e, allow);
 }
 
-static inline int xsm_pci_config_permission (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
+static inline int xsm_hook_pci_config_permission (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
-    return xsm_ops->pci_config_permission(d, machine_bdf, start, end, access);
+    return xsm_ops->hook_pci_config_permission(d, machine_bdf, start, end, access);
 }
 
-static inline int xsm_get_device_group(uint32_t machine_bdf)
+static inline int xsm_hook_get_device_group(uint32_t machine_bdf)
 {
-    return xsm_ops->get_device_group(machine_bdf);
+    return xsm_ops->hook_get_device_group(machine_bdf);
 }
 
-static inline int xsm_test_assign_device(uint32_t machine_bdf)
+static inline int xsm_hook_test_assign_device(uint32_t machine_bdf)
 {
-    return xsm_ops->test_assign_device(machine_bdf);
+    return xsm_ops->hook_test_assign_device(machine_bdf);
 }
 
-static inline int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
+static inline int xsm_hook_assign_device(struct domain *d, uint32_t machine_bdf)
 {
-    return xsm_ops->assign_device(d, machine_bdf);
+    return xsm_ops->hook_assign_device(d, machine_bdf);
 }
 
-static inline int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
+static inline int xsm_hook_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
-    return xsm_ops->deassign_device(d, machine_bdf);
+    return xsm_ops->hook_deassign_device(d, machine_bdf);
 }
 
-static inline int xsm_resource_plug_pci (uint32_t machine_bdf)
+static inline int xsm_priv_resource_plug_pci (uint32_t machine_bdf)
 {
-    return xsm_ops->resource_plug_pci(machine_bdf);
+    return xsm_ops->priv_resource_plug_pci(machine_bdf);
 }
 
-static inline int xsm_resource_unplug_pci (uint32_t machine_bdf)
+static inline int xsm_priv_resource_unplug_pci (uint32_t machine_bdf)
 {
-    return xsm_ops->resource_unplug_pci(machine_bdf);
+    return xsm_ops->priv_resource_unplug_pci(machine_bdf);
 }
 
-static inline int xsm_resource_plug_core (void)
+static inline int xsm_hook_resource_plug_core (void)
 {
-    return xsm_ops->resource_plug_core();
+    return xsm_ops->hook_resource_plug_core();
 }
 
-static inline int xsm_resource_unplug_core (void)
+static inline int xsm_hook_resource_unplug_core (void)
 {
-    return xsm_ops->resource_unplug_core();
+    return xsm_ops->hook_resource_unplug_core();
 }
 
-static inline int xsm_resource_setup_pci (uint32_t machine_bdf)
+static inline int xsm_priv_resource_setup_pci (uint32_t machine_bdf)
 {
-    return xsm_ops->resource_setup_pci(machine_bdf);
+    return xsm_ops->priv_resource_setup_pci(machine_bdf);
 }
 
-static inline int xsm_resource_setup_gsi (int gsi)
+static inline int xsm_priv_resource_setup_gsi (int gsi)
 {
-    return xsm_ops->resource_setup_gsi(gsi);
+    return xsm_ops->priv_resource_setup_gsi(gsi);
 }
 
-static inline int xsm_resource_setup_misc (void)
+static inline int xsm_priv_resource_setup_misc (void)
 {
-    return xsm_ops->resource_setup_misc();
+    return xsm_ops->priv_resource_setup_misc();
 }
 
-static inline int xsm_page_offline(uint32_t cmd)
+static inline int xsm_hook_page_offline(uint32_t cmd)
 {
-    return xsm_ops->page_offline(cmd);
+    return xsm_ops->hook_page_offline(cmd);
 }
 
-static inline int xsm_tmem_op(void)
+static inline int xsm_hook_tmem_op(void)
 {
-    return xsm_ops->tmem_op();
+    return xsm_ops->hook_tmem_op();
 }
 
-static inline int xsm_tmem_control(void)
+static inline int xsm_priv_tmem_control(void)
 {
-    return xsm_ops->tmem_control();
+    return xsm_ops->priv_tmem_control();
 }
 
 static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
@@ -447,54 +447,54 @@ static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 }
 
 #ifdef CONFIG_X86
-static inline int xsm_shadow_control (struct domain *d, uint32_t op)
+static inline int xsm_hook_shadow_control (struct domain *d, uint32_t op)
 {
-    return xsm_ops->shadow_control(d, op);
+    return xsm_ops->hook_shadow_control(d, op);
 }
 
-static inline int xsm_hvm_param (struct domain *d, unsigned long op)
+static inline int xsm_target_hvm_param (struct domain *d, unsigned long op)
 {
-    return xsm_ops->hvm_param(d, op);
+    return xsm_ops->target_hvm_param(d, op);
 }
 
-static inline int xsm_hvm_set_pci_intx_level (struct domain *d)
+static inline int xsm_dm_hvm_set_pci_intx_level (struct domain *d)
 {
-    return xsm_ops->hvm_set_pci_intx_level(d);
+    return xsm_ops->dm_hvm_set_pci_intx_level(d);
 }
 
-static inline int xsm_hvm_set_isa_irq_level (struct domain *d)
+static inline int xsm_dm_hvm_set_isa_irq_level (struct domain *d)
 {
-    return xsm_ops->hvm_set_isa_irq_level(d);
+    return xsm_ops->dm_hvm_set_isa_irq_level(d);
 }
 
-static inline int xsm_hvm_set_pci_link_route (struct domain *d)
+static inline int xsm_dm_hvm_set_pci_link_route (struct domain *d)
 {
-    return xsm_ops->hvm_set_pci_link_route(d);
+    return xsm_ops->dm_hvm_set_pci_link_route(d);
 }
 
-static inline int xsm_hvm_inject_msi (struct domain *d)
+static inline int xsm_dm_hvm_inject_msi (struct domain *d)
 {
-    return xsm_ops->hvm_inject_msi(d);
+    return xsm_ops->dm_hvm_inject_msi(d);
 }
 
-static inline int xsm_mem_event_control (struct domain *d, int mode, int op)
+static inline int xsm_dm_mem_event_control (struct domain *d, int mode, int op)
 {
-    return xsm_ops->mem_event_control(d, mode, op);
+    return xsm_ops->dm_mem_event_control(d, mode, op);
 }
 
-static inline int xsm_mem_event_op (struct domain *d, int op)
+static inline int xsm_dm_mem_event_op (struct domain *d, int op)
 {
-    return xsm_ops->mem_event_op(d, op);
+    return xsm_ops->dm_mem_event_op(d, op);
 }
 
-static inline int xsm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
+static inline int xsm_dm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
 {
-    return xsm_ops->mem_sharing_op(d, cd, op);
+    return xsm_ops->dm_mem_sharing_op(d, cd, op);
 }
 
-static inline int xsm_apic (struct domain *d, int cmd)
+static inline int xsm_priv_apic (struct domain *d, int cmd)
 {
-    return xsm_ops->apic(d, cmd);
+    return xsm_ops->priv_apic(d, cmd);
 }
 
 static inline int xsm_memtype (uint32_t access)
@@ -502,63 +502,63 @@ static inline int xsm_memtype (uint32_t access)
     return xsm_ops->memtype(access);
 }
 
-static inline int xsm_platform_op (uint32_t op)
+static inline int xsm_priv_platform_op (uint32_t op)
 {
-    return xsm_ops->platform_op(op);
+    return xsm_ops->priv_platform_op(op);
 }
 
-static inline int xsm_machine_memory_map(void)
+static inline int xsm_priv_machine_memory_map(void)
 {
-    return xsm_ops->machine_memory_map();
+    return xsm_ops->priv_machine_memory_map();
 }
 
-static inline int xsm_domain_memory_map(struct domain *d)
+static inline int xsm_target_domain_memory_map(struct domain *d)
 {
-    return xsm_ops->domain_memory_map(d);
+    return xsm_ops->target_domain_memory_map(d);
 }
 
-static inline int xsm_mmu_update (struct domain *d, struct domain *t,
+static inline int xsm_target_mmu_update (struct domain *d, struct domain *t,
                                   struct domain *f, uint32_t flags)
 {
-    return xsm_ops->mmu_update(d, t, f, flags);
+    return xsm_ops->target_mmu_update(d, t, f, flags);
 }
 
-static inline int xsm_mmuext_op (struct domain *d, struct domain *f)
+static inline int xsm_target_mmuext_op (struct domain *d, struct domain *f)
 {
-    return xsm_ops->mmuext_op(d, f);
+    return xsm_ops->target_mmuext_op(d, f);
 }
 
-static inline int xsm_update_va_mapping(struct domain *d, struct domain *f, 
+static inline int xsm_target_update_va_mapping(struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
-    return xsm_ops->update_va_mapping(d, f, pte);
+    return xsm_ops->target_update_va_mapping(d, f, pte);
 }
 
-static inline int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
+static inline int xsm_target_add_to_physmap(struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->add_to_physmap(d1, d2);
+    return xsm_ops->target_add_to_physmap(d1, d2);
 }
 
-static inline int xsm_bind_pt_irq(struct domain *d, 
+static inline int xsm_hook_bind_pt_irq(struct domain *d, 
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_ops->bind_pt_irq(d, bind);
+    return xsm_ops->hook_bind_pt_irq(d, bind);
 }
 
-static inline int xsm_unbind_pt_irq(struct domain *d,
+static inline int xsm_hook_unbind_pt_irq(struct domain *d,
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_ops->unbind_pt_irq(d, bind);
+    return xsm_ops->hook_unbind_pt_irq(d, bind);
 }
 
-static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static inline int xsm_hook_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return xsm_ops->ioport_permission(d, s, e, allow);
+    return xsm_ops->hook_ioport_permission(d, s, e, allow);
 }
 
-static inline int xsm_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static inline int xsm_hook_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return xsm_ops->ioport_mapping(d, s, e, allow);
+    return xsm_ops->hook_ioport_mapping(d, s, e, allow);
 }
 #endif /* CONFIG_X86 */
 #endif /* XSM_NO_WRAPPERS */
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 22c66e5..c29c5af 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -29,98 +29,98 @@ struct xsm_operations dummy_xsm_ops;
 
 void xsm_fixup_ops (struct xsm_operations *ops)
 {
-    set_to_dummy_if_null(ops, security_domaininfo);
-    set_to_dummy_if_null(ops, domain_create);
-    set_to_dummy_if_null(ops, getdomaininfo);
-    set_to_dummy_if_null(ops, set_target);
+    set_to_dummy_if_null(ops, populate_security_domaininfo);
+    set_to_dummy_if_null(ops, hook_domain_create);
+    set_to_dummy_if_null(ops, hook_getdomaininfo);
+    set_to_dummy_if_null(ops, hook_set_target);
     set_to_dummy_if_null(ops, domctl);
     set_to_dummy_if_null(ops, sysctl);
-    set_to_dummy_if_null(ops, readconsole);
-    set_to_dummy_if_null(ops, do_mca);
-
-    set_to_dummy_if_null(ops, evtchn_unbound);
-    set_to_dummy_if_null(ops, evtchn_interdomain);
-    set_to_dummy_if_null(ops, evtchn_close_post);
-    set_to_dummy_if_null(ops, evtchn_send);
-    set_to_dummy_if_null(ops, evtchn_status);
-    set_to_dummy_if_null(ops, evtchn_reset);
-
-    set_to_dummy_if_null(ops, grant_mapref);
-    set_to_dummy_if_null(ops, grant_unmapref);
-    set_to_dummy_if_null(ops, grant_setup);
-    set_to_dummy_if_null(ops, grant_transfer);
-    set_to_dummy_if_null(ops, grant_copy);
-    set_to_dummy_if_null(ops, grant_query_size);
+    set_to_dummy_if_null(ops, hook_readconsole);
+    set_to_dummy_if_null(ops, priv_do_mca);
+
+    set_to_dummy_if_null(ops, target_evtchn_unbound);
+    set_to_dummy_if_null(ops, hook_evtchn_interdomain);
+    set_to_dummy_if_null(ops, hook_evtchn_close_post);
+    set_to_dummy_if_null(ops, hook_evtchn_send);
+    set_to_dummy_if_null(ops, target_evtchn_status);
+    set_to_dummy_if_null(ops, target_evtchn_reset);
+
+    set_to_dummy_if_null(ops, hook_grant_mapref);
+    set_to_dummy_if_null(ops, hook_grant_unmapref);
+    set_to_dummy_if_null(ops, target_grant_setup);
+    set_to_dummy_if_null(ops, hook_grant_transfer);
+    set_to_dummy_if_null(ops, hook_grant_copy);
+    set_to_dummy_if_null(ops, target_grant_query_size);
 
     set_to_dummy_if_null(ops, alloc_security_domain);
     set_to_dummy_if_null(ops, free_security_domain);
     set_to_dummy_if_null(ops, alloc_security_evtchn);
     set_to_dummy_if_null(ops, free_security_evtchn);
     set_to_dummy_if_null(ops, show_security_evtchn);
-    set_to_dummy_if_null(ops, get_pod_target);
-    set_to_dummy_if_null(ops, set_pod_target);
+    set_to_dummy_if_null(ops, priv_get_pod_target);
+    set_to_dummy_if_null(ops, priv_set_pod_target);
 
-    set_to_dummy_if_null(ops, memory_exchange);
-    set_to_dummy_if_null(ops, memory_adjust_reservation);
-    set_to_dummy_if_null(ops, memory_stat_reservation);
-    set_to_dummy_if_null(ops, memory_pin_page);
+    set_to_dummy_if_null(ops, target_memory_exchange);
+    set_to_dummy_if_null(ops, target_memory_adjust_reservation);
+    set_to_dummy_if_null(ops, target_memory_stat_reservation);
+    set_to_dummy_if_null(ops, hook_memory_pin_page);
 
-    set_to_dummy_if_null(ops, console_io);
+    set_to_dummy_if_null(ops, priv_console_io);
 
-    set_to_dummy_if_null(ops, profile);
+    set_to_dummy_if_null(ops, hook_profile);
 
-    set_to_dummy_if_null(ops, kexec);
-    set_to_dummy_if_null(ops, schedop_shutdown);
+    set_to_dummy_if_null(ops, priv_kexec);
+    set_to_dummy_if_null(ops, dm_schedop_shutdown);
 
     set_to_dummy_if_null(ops, show_irq_sid);
-    set_to_dummy_if_null(ops, map_domain_pirq);
-    set_to_dummy_if_null(ops, unmap_domain_pirq);
-    set_to_dummy_if_null(ops, irq_permission);
-    set_to_dummy_if_null(ops, iomem_permission);
-    set_to_dummy_if_null(ops, iomem_mapping);
-    set_to_dummy_if_null(ops, pci_config_permission);
-
-    set_to_dummy_if_null(ops, get_device_group);
-    set_to_dummy_if_null(ops, test_assign_device);
-    set_to_dummy_if_null(ops, assign_device);
-    set_to_dummy_if_null(ops, deassign_device);
-
-    set_to_dummy_if_null(ops, resource_plug_core);
-    set_to_dummy_if_null(ops, resource_unplug_core);
-    set_to_dummy_if_null(ops, resource_plug_pci);
-    set_to_dummy_if_null(ops, resource_unplug_pci);
-    set_to_dummy_if_null(ops, resource_setup_pci);
-    set_to_dummy_if_null(ops, resource_setup_gsi);
-    set_to_dummy_if_null(ops, resource_setup_misc);
-
-    set_to_dummy_if_null(ops, page_offline);
-    set_to_dummy_if_null(ops, tmem_op);
-    set_to_dummy_if_null(ops, tmem_control);
+    set_to_dummy_if_null(ops, hook_map_domain_pirq);
+    set_to_dummy_if_null(ops, dm_unmap_domain_pirq);
+    set_to_dummy_if_null(ops, hook_irq_permission);
+    set_to_dummy_if_null(ops, hook_iomem_permission);
+    set_to_dummy_if_null(ops, hook_iomem_mapping);
+    set_to_dummy_if_null(ops, hook_pci_config_permission);
+
+    set_to_dummy_if_null(ops, hook_get_device_group);
+    set_to_dummy_if_null(ops, hook_test_assign_device);
+    set_to_dummy_if_null(ops, hook_assign_device);
+    set_to_dummy_if_null(ops, hook_deassign_device);
+
+    set_to_dummy_if_null(ops, hook_resource_plug_core);
+    set_to_dummy_if_null(ops, hook_resource_unplug_core);
+    set_to_dummy_if_null(ops, priv_resource_plug_pci);
+    set_to_dummy_if_null(ops, priv_resource_unplug_pci);
+    set_to_dummy_if_null(ops, priv_resource_setup_pci);
+    set_to_dummy_if_null(ops, priv_resource_setup_gsi);
+    set_to_dummy_if_null(ops, priv_resource_setup_misc);
+
+    set_to_dummy_if_null(ops, hook_page_offline);
+    set_to_dummy_if_null(ops, hook_tmem_op);
+    set_to_dummy_if_null(ops, priv_tmem_control);
 
     set_to_dummy_if_null(ops, do_xsm_op);
 
 #ifdef CONFIG_X86
-    set_to_dummy_if_null(ops, shadow_control);
-    set_to_dummy_if_null(ops, hvm_param);
-    set_to_dummy_if_null(ops, hvm_set_pci_intx_level);
-    set_to_dummy_if_null(ops, hvm_set_isa_irq_level);
-    set_to_dummy_if_null(ops, hvm_set_pci_link_route);
-    set_to_dummy_if_null(ops, hvm_inject_msi);
-    set_to_dummy_if_null(ops, mem_event_control);
-    set_to_dummy_if_null(ops, mem_event_op);
-    set_to_dummy_if_null(ops, mem_sharing_op);
-    set_to_dummy_if_null(ops, apic);
-    set_to_dummy_if_null(ops, platform_op);
-    set_to_dummy_if_null(ops, machine_memory_map);
-    set_to_dummy_if_null(ops, domain_memory_map);
-    set_to_dummy_if_null(ops, mmu_update);
-    set_to_dummy_if_null(ops, mmuext_op);
-    set_to_dummy_if_null(ops, update_va_mapping);
-    set_to_dummy_if_null(ops, add_to_physmap);
-    set_to_dummy_if_null(ops, remove_from_physmap);
-    set_to_dummy_if_null(ops, bind_pt_irq);
-    set_to_dummy_if_null(ops, unbind_pt_irq);
-    set_to_dummy_if_null(ops, ioport_permission);
-    set_to_dummy_if_null(ops, ioport_mapping);
+    set_to_dummy_if_null(ops, hook_shadow_control);
+    set_to_dummy_if_null(ops, target_hvm_param);
+    set_to_dummy_if_null(ops, dm_hvm_set_pci_intx_level);
+    set_to_dummy_if_null(ops, dm_hvm_set_isa_irq_level);
+    set_to_dummy_if_null(ops, dm_hvm_set_pci_link_route);
+    set_to_dummy_if_null(ops, dm_hvm_inject_msi);
+    set_to_dummy_if_null(ops, dm_mem_event_control);
+    set_to_dummy_if_null(ops, dm_mem_event_op);
+    set_to_dummy_if_null(ops, dm_mem_sharing_op);
+    set_to_dummy_if_null(ops, priv_apic);
+    set_to_dummy_if_null(ops, priv_platform_op);
+    set_to_dummy_if_null(ops, priv_machine_memory_map);
+    set_to_dummy_if_null(ops, target_domain_memory_map);
+    set_to_dummy_if_null(ops, target_mmu_update);
+    set_to_dummy_if_null(ops, target_mmuext_op);
+    set_to_dummy_if_null(ops, target_update_va_mapping);
+    set_to_dummy_if_null(ops, target_add_to_physmap);
+    set_to_dummy_if_null(ops, target_remove_from_physmap);
+    set_to_dummy_if_null(ops, hook_bind_pt_irq);
+    set_to_dummy_if_null(ops, hook_unbind_pt_irq);
+    set_to_dummy_if_null(ops, hook_ioport_permission);
+    set_to_dummy_if_null(ops, hook_ioport_mapping);
 #endif
 }
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 03ea675..2c46276 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -171,7 +171,7 @@ static void flask_domain_free_security(struct domain *d)
     xfree(dsec);
 }
 
-static int flask_evtchn_unbound(struct domain *d1, struct evtchn *chn, 
+static int flask_target_evtchn_unbound(struct domain *d1, struct evtchn *chn, 
                                 domid_t id2)
 {
     u32 sid1, sid2, newsid;
@@ -206,7 +206,7 @@ static int flask_evtchn_unbound(struct domain *d1, struct evtchn *chn,
     return rc;
 }
 
-static int flask_evtchn_interdomain(struct domain *d1, struct evtchn *chn1, 
+static int flask_hook_evtchn_interdomain(struct domain *d1, struct evtchn *chn1, 
                                     struct domain *d2, struct evtchn *chn2)
 {
     u32 sid1, sid2, newsid, reverse_sid;
@@ -252,7 +252,7 @@ static int flask_evtchn_interdomain(struct domain *d1, struct evtchn *chn1,
     return rc;
 }
 
-static void flask_evtchn_close_post(struct evtchn *chn)
+static void flask_hook_evtchn_close_post(struct evtchn *chn)
 {
     struct evtchn_security_struct *esec;
     esec = chn->ssid;
@@ -260,7 +260,7 @@ static void flask_evtchn_close_post(struct evtchn *chn)
     esec->sid = SECINITSID_UNLABELED;
 }
 
-static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
+static int flask_hook_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     int rc;
 
@@ -280,12 +280,12 @@ static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
     return rc;
 }
 
-static int flask_evtchn_status(struct domain *d, struct evtchn *chn)
+static int flask_target_evtchn_status(struct domain *d, struct evtchn *chn)
 {
     return domain_has_evtchn(d, chn, EVENT__STATUS);
 }
 
-static int flask_evtchn_reset(struct domain *d1, struct domain *d2)
+static int flask_target_evtchn_reset(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_EVENT, EVENT__RESET);
 }
@@ -350,7 +350,7 @@ static char *flask_show_security_evtchn(struct domain *d, const struct evtchn *c
     return ctx;
 }
 
-static int flask_grant_mapref(struct domain *d1, struct domain *d2, 
+static int flask_hook_grant_mapref(struct domain *d1, struct domain *d2, 
                               uint32_t flags)
 {
     u32 perms = GRANT__MAP_READ;
@@ -361,63 +361,63 @@ static int flask_grant_mapref(struct domain *d1, struct domain *d2,
     return domain_has_perm(d1, d2, SECCLASS_GRANT, perms);
 }
 
-static int flask_grant_unmapref(struct domain *d1, struct domain *d2)
+static int flask_hook_grant_unmapref(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__UNMAP);
 }
 
-static int flask_grant_setup(struct domain *d1, struct domain *d2)
+static int flask_target_grant_setup(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__SETUP);
 }
 
-static int flask_grant_transfer(struct domain *d1, struct domain *d2)
+static int flask_hook_grant_transfer(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__TRANSFER);
 }
 
-static int flask_grant_copy(struct domain *d1, struct domain *d2)
+static int flask_hook_grant_copy(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__COPY);
 }
 
-static int flask_grant_query_size(struct domain *d1, struct domain *d2)
+static int flask_target_grant_query_size(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__QUERY);
 }
 
-static int flask_get_pod_target(struct domain *d)
+static int flask_priv_get_pod_target(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETPODTARGET);
 }
 
-static int flask_set_pod_target(struct domain *d)
+static int flask_priv_set_pod_target(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETPODTARGET);
 }
 
-static int flask_memory_exchange(struct domain *d)
+static int flask_target_memory_exchange(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_MMU, MMU__EXCHANGE);
 }
 
-static int flask_memory_adjust_reservation(struct domain *d1, struct domain *d2)
+static int flask_target_memory_adjust_reservation(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__ADJUST);
 }
 
-static int flask_memory_stat_reservation(struct domain *d1, struct domain *d2)
+static int flask_target_memory_stat_reservation(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__STAT);
 }
 
-static int flask_memory_pin_page(struct domain *d1, struct domain *d2,
+static int flask_hook_memory_pin_page(struct domain *d1, struct domain *d2,
                                  struct page_info *page)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PINPAGE);
 }
 
-static int flask_console_io(struct domain *d, int cmd)
+static int flask_priv_console_io(struct domain *d, int cmd)
 {
     u32 perm;
 
@@ -436,7 +436,7 @@ static int flask_console_io(struct domain *d, int cmd)
     return domain_has_xen(d, perm);
 }
 
-static int flask_profile(struct domain *d, int op)
+static int flask_hook_profile(struct domain *d, int op)
 {
     u32 perm;
 
@@ -468,23 +468,23 @@ static int flask_profile(struct domain *d, int op)
     return domain_has_xen(d, perm);
 }
 
-static int flask_kexec(void)
+static int flask_priv_kexec(void)
 {
     return domain_has_xen(current->domain, XEN__KEXEC);
 }
 
-static int flask_schedop_shutdown(struct domain *d1, struct domain *d2)
+static int flask_dm_schedop_shutdown(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_DOMAIN, DOMAIN__SHUTDOWN);
 }
 
-static void flask_security_domaininfo(struct domain *d, 
+static void flask_populate_security_domaininfo(struct domain *d, 
                                       struct xen_domctl_getdomaininfo *info)
 {
     info->ssidref = domain_sid(d);
 }
 
-static int flask_domain_create(struct domain *d, u32 ssidref)
+static int flask_hook_domain_create(struct domain *d, u32 ssidref)
 {
     int rc;
     struct domain_security_struct *dsec = d->ssid;
@@ -512,12 +512,12 @@ static int flask_domain_create(struct domain *d, u32 ssidref)
     return rc;
 }
 
-static int flask_getdomaininfo(struct domain *d)
+static int flask_hook_getdomaininfo(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO);
 }
 
-static int flask_set_target(struct domain *d, struct domain *t)
+static int flask_hook_set_target(struct domain *d, struct domain *t)
 {
     int rc;
     struct domain_security_struct *dsec, *tsec;
@@ -753,7 +753,7 @@ static int flask_sysctl(int cmd)
     }
 }
 
-static int flask_readconsole(uint32_t clear)
+static int flask_hook_readconsole(uint32_t clear)
 {
     u32 perms = XEN__READCONSOLE;
 
@@ -763,7 +763,7 @@ static int flask_readconsole(uint32_t clear)
     return domain_has_xen(current->domain, perms);
 }
 
-static int flask_do_mca(void)
+static int flask_priv_do_mca(void)
 {
     return domain_has_xen(current->domain, XEN__MCA_OP);
 }
@@ -790,7 +790,7 @@ static char *flask_show_irq_sid (int irq)
     return ctx;
 }
 
-static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
+static int flask_hook_map_domain_pirq (struct domain *d, int irq, void *data)
 {
     u32 sid, dsid;
     int rc = -EPERM;
@@ -823,7 +823,7 @@ static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
     return rc;
 }
 
-static int flask_unmap_domain_pirq (struct domain *d, int irq)
+static int flask_dm_unmap_domain_pirq (struct domain *d, int irq)
 {
     u32 sid;
     int rc = -EPERM;
@@ -846,7 +846,7 @@ static int flask_unmap_domain_pirq (struct domain *d, int irq)
     return rc;
 }
 
-static int flask_irq_permission (struct domain *d, int pirq, uint8_t access)
+static int flask_hook_irq_permission (struct domain *d, int pirq, uint8_t access)
 {
     /* the PIRQ number is not useful; real IRQ is checked during mapping */
     return current_has_perm(d, SECCLASS_RESOURCE, resource_to_perm(access));
@@ -876,7 +876,7 @@ static int _iomem_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     return avc_has_perm(data->dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
+static int flask_hook_iomem_permission(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
 {
     struct iomem_has_perm_data data;
     int rc;
@@ -897,12 +897,12 @@ static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end
     return security_iterate_iomem_sids(start, end, _iomem_has_perm, &data);
 }
 
-static int flask_iomem_mapping(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
+static int flask_hook_iomem_mapping(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
 {
-    return flask_iomem_permission(d, start, end, access);
+    return flask_hook_iomem_permission(d, start, end, access);
 }
 
-static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
+static int flask_hook_pci_config_permission(struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
     u32 dsid, rsid;
     int rc = -EPERM;
@@ -924,12 +924,12 @@ static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, u
 
 }
 
-static int flask_resource_plug_core(void)
+static int flask_hook_resource_plug_core(void)
 {
     return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__PLUG, NULL);
 }
 
-static int flask_resource_unplug_core(void)
+static int flask_hook_resource_unplug_core(void)
 {
     return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__UNPLUG, NULL);
 }
@@ -939,7 +939,7 @@ static int flask_resource_use_core(void)
     return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__USE, NULL);
 }
 
-static int flask_resource_plug_pci(uint32_t machine_bdf)
+static int flask_priv_resource_plug_pci(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -954,7 +954,7 @@ static int flask_resource_plug_pci(uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__PLUG, &ad);
 }
 
-static int flask_resource_unplug_pci(uint32_t machine_bdf)
+static int flask_priv_resource_unplug_pci(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -969,7 +969,7 @@ static int flask_resource_unplug_pci(uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__UNPLUG, &ad);
 }
 
-static int flask_resource_setup_pci(uint32_t machine_bdf)
+static int flask_priv_resource_setup_pci(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -984,7 +984,7 @@ static int flask_resource_setup_pci(uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
-static int flask_resource_setup_gsi(int gsi)
+static int flask_priv_resource_setup_gsi(int gsi)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -997,18 +997,18 @@ static int flask_resource_setup_gsi(int gsi)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
-static int flask_resource_setup_misc(void)
+static int flask_priv_resource_setup_misc(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);
 }
 
-static inline int flask_page_offline(uint32_t cmd)
+static inline int flask_hook_page_offline(uint32_t cmd)
 {
     switch (cmd) {
     case sysctl_page_offline:
-        return flask_resource_unplug_core();
+        return flask_hook_resource_unplug_core();
     case sysctl_page_online:
-        return flask_resource_plug_core();
+        return flask_hook_resource_plug_core();
     case sysctl_query_page_offline:
         return flask_resource_use_core();
     default:
@@ -1016,18 +1016,18 @@ static inline int flask_page_offline(uint32_t cmd)
     }
 }
 
-static inline int flask_tmem_op(void)
+static inline int flask_hook_tmem_op(void)
 {
     return domain_has_xen(current->domain, XEN__TMEM_OP);
 }
 
-static inline int flask_tmem_control(void)
+static inline int flask_priv_tmem_control(void)
 {
     return domain_has_xen(current->domain, XEN__TMEM_CONTROL);
 }
 
 #ifdef CONFIG_X86
-static int flask_shadow_control(struct domain *d, uint32_t op)
+static int flask_hook_shadow_control(struct domain *d, uint32_t op)
 {
     u32 perm;
 
@@ -1079,7 +1079,7 @@ static int _ioport_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     return avc_has_perm(data->dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
+static int flask_hook_ioport_permission(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
 {
     int rc;
     struct ioport_has_perm_data data;
@@ -1101,12 +1101,12 @@ static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t en
     return security_iterate_ioport_sids(start, end, _ioport_has_perm, &data);
 }
 
-static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
+static int flask_hook_ioport_mapping(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
 {
-    return flask_ioport_permission(d, start, end, access);
+    return flask_hook_ioport_permission(d, start, end, access);
 }
 
-static int flask_hvm_param(struct domain *d, unsigned long op)
+static int flask_target_hvm_param(struct domain *d, unsigned long op)
 {
     u32 perm;
 
@@ -1128,37 +1128,37 @@ static int flask_hvm_param(struct domain *d, unsigned long op)
     return current_has_perm(d, SECCLASS_HVM, perm);
 }
 
-static int flask_hvm_set_pci_intx_level(struct domain *d)
+static int flask_dm_hvm_set_pci_intx_level(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__PCILEVEL);
 }
 
-static int flask_hvm_set_isa_irq_level(struct domain *d)
+static int flask_dm_hvm_set_isa_irq_level(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__IRQLEVEL);
 }
 
-static int flask_hvm_set_pci_link_route(struct domain *d)
+static int flask_dm_hvm_set_pci_link_route(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__PCIROUTE);
 }
 
-static int flask_hvm_inject_msi(struct domain *d)
+static int flask_dm_hvm_inject_msi(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
-static int flask_mem_event_control(struct domain *d, int mode, int op)
+static int flask_dm_mem_event_control(struct domain *d, int mode, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
 
-static int flask_mem_event_op(struct domain *d, int op)
+static int flask_dm_mem_event_op(struct domain *d, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
 
-static int flask_mem_sharing_op(struct domain *d, struct domain *cd, int op)
+static int flask_dm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     int rc = current_has_perm(cd, SECCLASS_HVM, HVM__MEM_SHARING);
     if ( rc )
@@ -1166,7 +1166,7 @@ static int flask_mem_sharing_op(struct domain *d, struct domain *cd, int op)
     return domain_has_perm(d, cd, SECCLASS_HVM, HVM__SHARE_MEM);
 }
 
-static int flask_apic(struct domain *d, int cmd)
+static int flask_priv_apic(struct domain *d, int cmd)
 {
     u32 perm;
 
@@ -1186,7 +1186,7 @@ static int flask_apic(struct domain *d, int cmd)
     return domain_has_xen(d, perm);
 }
 
-static int flask_platform_op(uint32_t op)
+static int flask_priv_platform_op(uint32_t op)
 {
     switch ( op )
     {
@@ -1241,22 +1241,22 @@ static int flask_platform_op(uint32_t op)
         return domain_has_xen(current->domain, XEN__GETCPUINFO);
 
     default:
-        printk("flask_platform_op: Unknown op %d\n", op);
+        printk("flask_priv_platform_op: Unknown op %d\n", op);
         return -EPERM;
     }
 }
 
-static int flask_machine_memory_map(void)
+static int flask_priv_machine_memory_map(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_MMU, MMU__MEMORYMAP, NULL);
 }
 
-static int flask_domain_memory_map(struct domain *d)
+static int flask_target_domain_memory_map(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_MMU, MMU__MEMORYMAP);
 }
 
-static int flask_mmu_update(struct domain *d, struct domain *t,
+static int flask_target_mmu_update(struct domain *d, struct domain *t,
                             struct domain *f, uint32_t flags)
 {
     int rc = 0;
@@ -1279,12 +1279,12 @@ static int flask_mmu_update(struct domain *d, struct domain *t,
     return rc;
 }
 
-static int flask_mmuext_op(struct domain *d, struct domain *f)
+static int flask_target_mmuext_op(struct domain *d, struct domain *f)
 {
     return domain_has_perm(d, f, SECCLASS_MMU, MMU__MMUEXT_OP);
 }
 
-static int flask_update_va_mapping(struct domain *d, struct domain *f,
+static int flask_target_update_va_mapping(struct domain *d, struct domain *f,
                                    l1_pgentry_t pte)
 {
     u32 map_perms = MMU__MAP_READ;
@@ -1296,17 +1296,17 @@ static int flask_update_va_mapping(struct domain *d, struct domain *f,
     return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
 }
 
-static int flask_add_to_physmap(struct domain *d1, struct domain *d2)
+static int flask_target_add_to_physmap(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP);
 }
 
-static int flask_remove_from_physmap(struct domain *d1, struct domain *d2)
+static int flask_target_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP);
 }
 
-static int flask_get_device_group(uint32_t machine_bdf)
+static int flask_hook_get_device_group(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -1330,7 +1330,7 @@ static int flask_test_assign_device(uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
 }
 
-static int flask_assign_device(struct domain *d, uint32_t machine_bdf)
+static int flask_hook_assign_device(struct domain *d, uint32_t machine_bdf)
 {
     u32 dsid, rsid;
     int rc = -EPERM;
@@ -1354,7 +1354,7 @@ static int flask_assign_device(struct domain *d, uint32_t machine_bdf)
     return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_deassign_device(struct domain *d, uint32_t machine_bdf)
+static int flask_hook_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -1370,7 +1370,7 @@ static int flask_deassign_device(struct domain *d, uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__REMOVE_DEVICE, NULL);
 }
 
-static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static int flask_hook_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     u32 dsid, rsid;
     int rc = -EPERM;
@@ -1395,7 +1395,7 @@ static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *b
     return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static int flask_hook_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
@@ -1404,28 +1404,28 @@ static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq
 long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
 
 static struct xsm_operations flask_ops = {
-    .security_domaininfo = flask_security_domaininfo,
-    .domain_create = flask_domain_create,
-    .getdomaininfo = flask_getdomaininfo,
-    .set_target = flask_set_target,
+    .populate_security_domaininfo = flask_populate_security_domaininfo,
+    .hook_domain_create = flask_hook_domain_create,
+    .hook_getdomaininfo = flask_hook_getdomaininfo,
+    .hook_set_target = flask_hook_set_target,
     .domctl = flask_domctl,
     .sysctl = flask_sysctl,
-    .readconsole = flask_readconsole,
-    .do_mca = flask_do_mca,
-
-    .evtchn_unbound = flask_evtchn_unbound,
-    .evtchn_interdomain = flask_evtchn_interdomain,
-    .evtchn_close_post = flask_evtchn_close_post,
-    .evtchn_send = flask_evtchn_send,
-    .evtchn_status = flask_evtchn_status,
-    .evtchn_reset = flask_evtchn_reset,
-
-    .grant_mapref = flask_grant_mapref,
-    .grant_unmapref = flask_grant_unmapref,
-    .grant_setup = flask_grant_setup,
-    .grant_transfer = flask_grant_transfer,
-    .grant_copy = flask_grant_copy,
-    .grant_query_size = flask_grant_query_size,
+    .hook_readconsole = flask_hook_readconsole,
+    .priv_do_mca = flask_priv_do_mca,
+
+    .target_evtchn_unbound = flask_target_evtchn_unbound,
+    .hook_evtchn_interdomain = flask_hook_evtchn_interdomain,
+    .hook_evtchn_close_post = flask_hook_evtchn_close_post,
+    .hook_evtchn_send = flask_hook_evtchn_send,
+    .target_evtchn_status = flask_target_evtchn_status,
+    .target_evtchn_reset = flask_target_evtchn_reset,
+
+    .hook_grant_mapref = flask_hook_grant_mapref,
+    .hook_grant_unmapref = flask_hook_grant_unmapref,
+    .target_grant_setup = flask_target_grant_setup,
+    .hook_grant_transfer = flask_hook_grant_transfer,
+    .hook_grant_copy = flask_hook_grant_copy,
+    .target_grant_query_size = flask_target_grant_query_size,
 
     .alloc_security_domain = flask_domain_alloc_security,
     .free_security_domain = flask_domain_free_security,
@@ -1433,70 +1433,70 @@ static struct xsm_operations flask_ops = {
     .free_security_evtchn = flask_free_security_evtchn,
     .show_security_evtchn = flask_show_security_evtchn,
 
-    .get_pod_target = flask_get_pod_target,
-    .set_pod_target = flask_set_pod_target,
-    .memory_exchange = flask_memory_exchange,
-    .memory_adjust_reservation = flask_memory_adjust_reservation,
-    .memory_stat_reservation = flask_memory_stat_reservation,
-    .memory_pin_page = flask_memory_pin_page,
+    .priv_get_pod_target = flask_priv_get_pod_target,
+    .priv_set_pod_target = flask_priv_set_pod_target,
+    .target_memory_exchange = flask_target_memory_exchange,
+    .target_memory_adjust_reservation = flask_target_memory_adjust_reservation,
+    .target_memory_stat_reservation = flask_target_memory_stat_reservation,
+    .hook_memory_pin_page = flask_hook_memory_pin_page,
 
-    .console_io = flask_console_io,
+    .priv_console_io = flask_priv_console_io,
 
-    .profile = flask_profile,
+    .hook_profile = flask_hook_profile,
 
-    .kexec = flask_kexec,
-    .schedop_shutdown = flask_schedop_shutdown,
+    .priv_kexec = flask_priv_kexec,
+    .dm_schedop_shutdown = flask_dm_schedop_shutdown,
 
     .show_irq_sid = flask_show_irq_sid,
 
-    .map_domain_pirq = flask_map_domain_pirq,
-    .unmap_domain_pirq = flask_unmap_domain_pirq,
-    .irq_permission = flask_irq_permission,
-    .iomem_permission = flask_iomem_permission,
-    .iomem_mapping = flask_iomem_mapping,
-    .pci_config_permission = flask_pci_config_permission,
-
-    .resource_plug_core = flask_resource_plug_core,
-    .resource_unplug_core = flask_resource_unplug_core,
-    .resource_plug_pci = flask_resource_plug_pci,
-    .resource_unplug_pci = flask_resource_unplug_pci,
-    .resource_setup_pci = flask_resource_setup_pci,
-    .resource_setup_gsi = flask_resource_setup_gsi,
-    .resource_setup_misc = flask_resource_setup_misc,
-
-    .page_offline = flask_page_offline,
-    .tmem_op = flask_tmem_op,
-    .tmem_control = flask_tmem_control,
+    .hook_map_domain_pirq = flask_hook_map_domain_pirq,
+    .dm_unmap_domain_pirq = flask_dm_unmap_domain_pirq,
+    .hook_irq_permission = flask_hook_irq_permission,
+    .hook_iomem_permission = flask_hook_iomem_permission,
+    .hook_iomem_mapping = flask_hook_iomem_mapping,
+    .hook_pci_config_permission = flask_hook_pci_config_permission,
+
+    .hook_resource_plug_core = flask_hook_resource_plug_core,
+    .hook_resource_unplug_core = flask_hook_resource_unplug_core,
+    .priv_resource_plug_pci = flask_priv_resource_plug_pci,
+    .priv_resource_unplug_pci = flask_priv_resource_unplug_pci,
+    .priv_resource_setup_pci = flask_priv_resource_setup_pci,
+    .priv_resource_setup_gsi = flask_priv_resource_setup_gsi,
+    .priv_resource_setup_misc = flask_priv_resource_setup_misc,
+
+    .hook_page_offline = flask_hook_page_offline,
+    .hook_tmem_op = flask_hook_tmem_op,
+    .priv_tmem_control = flask_priv_tmem_control,
 
     .do_xsm_op = do_flask_op,
 
 #ifdef CONFIG_X86
-    .shadow_control = flask_shadow_control,
-    .hvm_param = flask_hvm_param,
-    .hvm_set_pci_intx_level = flask_hvm_set_pci_intx_level,
-    .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
-    .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
-    .hvm_inject_msi = flask_hvm_inject_msi,
-    .mem_event_control = flask_mem_event_control,
-    .mem_event_op = flask_mem_event_op,
-    .mem_sharing_op = flask_mem_sharing_op,
-    .apic = flask_apic,
-    .platform_op = flask_platform_op,
-    .machine_memory_map = flask_machine_memory_map,
-    .domain_memory_map = flask_domain_memory_map,
-    .mmu_update = flask_mmu_update,
-    .mmuext_op = flask_mmuext_op,
-    .update_va_mapping = flask_update_va_mapping,
-    .add_to_physmap = flask_add_to_physmap,
-    .remove_from_physmap = flask_remove_from_physmap,
-    .get_device_group = flask_get_device_group,
-    .test_assign_device = flask_test_assign_device,
-    .assign_device = flask_assign_device,
-    .deassign_device = flask_deassign_device,
-    .bind_pt_irq = flask_bind_pt_irq,
-    .unbind_pt_irq = flask_unbind_pt_irq,
-    .ioport_permission = flask_ioport_permission,
-    .ioport_mapping = flask_ioport_mapping,
+    .hook_shadow_control = flask_hook_shadow_control,
+    .target_hvm_param = flask_target_hvm_param,
+    .dm_hvm_set_pci_intx_level = flask_dm_hvm_set_pci_intx_level,
+    .dm_hvm_set_isa_irq_level = flask_dm_hvm_set_isa_irq_level,
+    .dm_hvm_set_pci_link_route = flask_dm_hvm_set_pci_link_route,
+    .dm_hvm_inject_msi = flask_dm_hvm_inject_msi,
+    .dm_mem_event_control = flask_dm_mem_event_control,
+    .dm_mem_event_op = flask_dm_mem_event_op,
+    .dm_mem_sharing_op = flask_dm_mem_sharing_op,
+    .priv_apic = flask_priv_apic,
+    .priv_platform_op = flask_priv_platform_op,
+    .priv_machine_memory_map = flask_priv_machine_memory_map,
+    .target_domain_memory_map = flask_target_domain_memory_map,
+    .target_mmu_update = flask_target_mmu_update,
+    .target_mmuext_op = flask_target_mmuext_op,
+    .target_update_va_mapping = flask_target_update_va_mapping,
+    .target_add_to_physmap = flask_target_add_to_physmap,
+    .target_remove_from_physmap = flask_target_remove_from_physmap,
+    .hook_get_device_group = flask_hook_get_device_group,
+    .hook_test_assign_device = flask_test_assign_device,
+    .hook_assign_device = flask_hook_assign_device,
+    .hook_deassign_device = flask_hook_deassign_device,
+    .hook_bind_pt_irq = flask_hook_bind_pt_irq,
+    .hook_unbind_pt_irq = flask_hook_unbind_pt_irq,
+    .hook_ioport_permission = flask_hook_ioport_permission,
+    .hook_ioport_mapping = flask_hook_ioport_mapping,
 #endif
 };
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:06:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:06:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapOW-0008QW-Ft; Tue, 20 Nov 2012 15:05:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TapOU-0008QO-NP
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 15:05:46 +0000
Received: from [85.158.143.99:49799] by server-3.bemta-4.messagelabs.com id
	7A/5A-06841-A4C9BA05; Tue, 20 Nov 2012 15:05:46 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1353423944!19470548!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17822 invoked from network); 20 Nov 2012 15:05:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 15:05:44 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="15907395"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 15:05:44 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 15:05:43 +0000
Message-ID: <1353423941.13542.47.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 20 Nov 2012 15:05:41 +0000
In-Reply-To: <1353422735.2590.6.camel@edumazet-glaptop>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<1353422735.2590.6.camel@edumazet-glaptop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
	fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 14:45 +0000, Eric Dumazet wrote:
> > +		/* Skip unused frames from start of page */
> 
> 'frame' in the comment means an order-0 page ?

Yes. Confusing in the context of a network driver I know! I couldn't
think of a better term.

> > +			id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> > +			np->tx_skbs[id].skb = skb_get(skb);
> 
> BTW this skb_get() means extra atomic operations for every 4096 bytes
> unit, and an extra atomic op (and test for final 0) at TX completion.
> This could be avoided, by setting np->tx_skbs[id].skb = skb only for the
> very last unit.

Thanks. Might be tricky because guests can ack the individual requests
in any order but it's something worth having a look at.

> >  	np->tx.req_prod_pvt = prod;
> 
> Acked-by: Eric Dumazet <edumazet@google.com>
> 
> Thanks !

Thanks for the review.

Ian.

> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:06:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:06:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapOW-0008QW-Ft; Tue, 20 Nov 2012 15:05:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TapOU-0008QO-NP
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 15:05:46 +0000
Received: from [85.158.143.99:49799] by server-3.bemta-4.messagelabs.com id
	7A/5A-06841-A4C9BA05; Tue, 20 Nov 2012 15:05:46 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1353423944!19470548!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17822 invoked from network); 20 Nov 2012 15:05:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 15:05:44 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="15907395"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 15:05:44 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 15:05:43 +0000
Message-ID: <1353423941.13542.47.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 20 Nov 2012 15:05:41 +0000
In-Reply-To: <1353422735.2590.6.camel@edumazet-glaptop>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<1353422735.2590.6.camel@edumazet-glaptop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
	fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 14:45 +0000, Eric Dumazet wrote:
> > +		/* Skip unused frames from start of page */
> 
> 'frame' in the comment means an order-0 page ?

Yes. Confusing in the context of a network driver I know! I couldn't
think of a better term.

> > +			id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> > +			np->tx_skbs[id].skb = skb_get(skb);
> 
> BTW this skb_get() means extra atomic operations for every 4096 bytes
> unit, and an extra atomic op (and test for final 0) at TX completion.
> This could be avoided, by setting np->tx_skbs[id].skb = skb only for the
> very last unit.

Thanks. Might be tricky because guests can ack the individual requests
in any order but it's something worth having a look at.

> >  	np->tx.req_prod_pvt = prod;
> 
> Acked-by: Eric Dumazet <edumazet@google.com>
> 
> Thanks !

Thanks for the review.

Ian.

> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQD-0008VX-35; Tue, 20 Nov 2012 15:07:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQC-0008VP-0y
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:32 +0000
Received: from [85.158.139.211:28532] by server-9.bemta-5.messagelabs.com id
	29/D1-29295-3BC9BA05; Tue, 20 Nov 2012 15:07:31 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!1
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9581 invoked from network); 20 Nov 2012 15:07:22 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:22 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1623774Ab2KTPEx
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:53 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:42 +0100
Message-Id: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
X-Bogosity: No, spamicity=0.475885
Subject: [Xen-devel] [PATCH v2 00/11] xen: Initial kexec/kdump implementation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


Hi,

This set of patches contains initial kexec/kdump implementation for Xen v2
(previous version were posted to few people by mistake; sorry for that).
Currently only dom0 is supported, however, almost all infrustructure
required for domU support is ready.

Jan Beulich suggested to merge Xen x86 assembler code with baremetal x86 code.
This could simplify and reduce a bit size of kernel code. However, this solution
requires some changes in baremetal x86 code. The most important thing which should
be changed in that case is format of page_list array. Xen kexec hypercall requires
to alternate physical addresses with virtual ones. This and other required things
have not done in that version because I am not sure that solution will be accepted
by kexec/kdump maintainers. I hope that this email spark discussion about that topic.

Daniel

 arch/x86/include/asm/kexec.h         |   10 +-
 arch/x86/include/asm/xen/hypercall.h |    6 +
 arch/x86/include/asm/xen/kexec.h     |   83 +++++++++
 arch/x86/kernel/machine_kexec_64.c   |   12 +-
 arch/x86/kernel/vmlinux.lds.S        |    7 +-
 arch/x86/xen/Makefile                |    3 +
 arch/x86/xen/enlighten.c             |   12 ++
 arch/x86/xen/kexec.c                 |  150 ++++++++++++++++
 arch/x86/xen/machine_kexec_32.c      |  245 ++++++++++++++++++++++++++
 arch/x86/xen/machine_kexec_64.c      |  301 +++++++++++++++++++++++++++++++
 arch/x86/xen/relocate_kernel_32.S    |  323 ++++++++++++++++++++++++++++++++++
 arch/x86/xen/relocate_kernel_64.S    |  309 ++++++++++++++++++++++++++++++++
 drivers/xen/sys-hypervisor.c         |   42 +++++-
 include/linux/kexec.h                |   18 ++
 include/xen/interface/xen.h          |   33 ++++
 kernel/kexec.c                       |  125 ++++++++++----
 16 files changed, 1636 insertions(+), 43 deletions(-)

Daniel Kiper (11):
      kexec: introduce kexec_ops struct
      x86/kexec: Add extra pointers to transition page table PGD, PUD, PMD and PTE
      xen: Introduce architecture independent data for kexec/kdump
      x86/xen: Introduce architecture dependent data for kexec/kdump
      x86/xen: Register resources required by kexec-tools
      x86/xen: Add i386 kexec/kdump implementation
      x86/xen: Add x86_64 kexec/kdump implementation
      x86/xen: Add kexec/kdump makefile rules
      x86/xen/enlighten: Add init and crash kexec/kdump hooks
      drivers/xen: Export vmcoreinfo through sysfs
      x86: Add Xen kexec control code size check to linker script

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQD-0008VX-35; Tue, 20 Nov 2012 15:07:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQC-0008VP-0y
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:32 +0000
Received: from [85.158.139.211:28532] by server-9.bemta-5.messagelabs.com id
	29/D1-29295-3BC9BA05; Tue, 20 Nov 2012 15:07:31 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!1
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9581 invoked from network); 20 Nov 2012 15:07:22 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:22 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1623774Ab2KTPEx
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:53 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:42 +0100
Message-Id: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
X-Bogosity: No, spamicity=0.475885
Subject: [Xen-devel] [PATCH v2 00/11] xen: Initial kexec/kdump implementation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


Hi,

This set of patches contains initial kexec/kdump implementation for Xen v2
(previous version were posted to few people by mistake; sorry for that).
Currently only dom0 is supported, however, almost all infrustructure
required for domU support is ready.

Jan Beulich suggested to merge Xen x86 assembler code with baremetal x86 code.
This could simplify and reduce a bit size of kernel code. However, this solution
requires some changes in baremetal x86 code. The most important thing which should
be changed in that case is format of page_list array. Xen kexec hypercall requires
to alternate physical addresses with virtual ones. This and other required things
have not done in that version because I am not sure that solution will be accepted
by kexec/kdump maintainers. I hope that this email spark discussion about that topic.

Daniel

 arch/x86/include/asm/kexec.h         |   10 +-
 arch/x86/include/asm/xen/hypercall.h |    6 +
 arch/x86/include/asm/xen/kexec.h     |   83 +++++++++
 arch/x86/kernel/machine_kexec_64.c   |   12 +-
 arch/x86/kernel/vmlinux.lds.S        |    7 +-
 arch/x86/xen/Makefile                |    3 +
 arch/x86/xen/enlighten.c             |   12 ++
 arch/x86/xen/kexec.c                 |  150 ++++++++++++++++
 arch/x86/xen/machine_kexec_32.c      |  245 ++++++++++++++++++++++++++
 arch/x86/xen/machine_kexec_64.c      |  301 +++++++++++++++++++++++++++++++
 arch/x86/xen/relocate_kernel_32.S    |  323 ++++++++++++++++++++++++++++++++++
 arch/x86/xen/relocate_kernel_64.S    |  309 ++++++++++++++++++++++++++++++++
 drivers/xen/sys-hypervisor.c         |   42 +++++-
 include/linux/kexec.h                |   18 ++
 include/xen/interface/xen.h          |   33 ++++
 kernel/kexec.c                       |  125 ++++++++++----
 16 files changed, 1636 insertions(+), 43 deletions(-)

Daniel Kiper (11):
      kexec: introduce kexec_ops struct
      x86/kexec: Add extra pointers to transition page table PGD, PUD, PMD and PTE
      xen: Introduce architecture independent data for kexec/kdump
      x86/xen: Introduce architecture dependent data for kexec/kdump
      x86/xen: Register resources required by kexec-tools
      x86/xen: Add i386 kexec/kdump implementation
      x86/xen: Add x86_64 kexec/kdump implementation
      x86/xen: Add kexec/kdump makefile rules
      x86/xen/enlighten: Add init and crash kexec/kdump hooks
      drivers/xen: Export vmcoreinfo through sysfs
      x86: Add Xen kexec control code size check to linker script

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQF-0008WT-Sk; Tue, 20 Nov 2012 15:07:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQE-0008VP-Nz
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:34 +0000
Received: from [85.158.139.211:49853] by server-9.bemta-5.messagelabs.com id
	FD/E1-29295-4BC9BA05; Tue, 20 Nov 2012 15:07:32 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!6
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9908 invoked from network); 20 Nov 2012 15:07:31 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:31 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1633948Ab2KTPEx
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:53 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:46 +0100
Message-Id: <1353423893-23125-5-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.006028
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 04/11] x86/xen: Introduce architecture
	dependent data for kexec/kdump
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Introduce architecture dependent constants, structures and
functions required by Xen kexec/kdump implementation.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 arch/x86/include/asm/xen/hypercall.h |    6 +++
 arch/x86/include/asm/xen/kexec.h     |   83 ++++++++++++++++++++++++++++++++++
 2 files changed, 89 insertions(+), 0 deletions(-)
 create mode 100644 arch/x86/include/asm/xen/kexec.h

diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h
index c20d1ce..e76a1b8 100644
--- a/arch/x86/include/asm/xen/hypercall.h
+++ b/arch/x86/include/asm/xen/hypercall.h
@@ -459,6 +459,12 @@ HYPERVISOR_hvm_op(int op, void *arg)
 }
 
 static inline int
+HYPERVISOR_kexec_op(unsigned long op, void *args)
+{
+	return _hypercall2(int, kexec_op, op, args);
+}
+
+static inline int
 HYPERVISOR_tmem_op(
 	struct tmem_op *op)
 {
diff --git a/arch/x86/include/asm/xen/kexec.h b/arch/x86/include/asm/xen/kexec.h
new file mode 100644
index 0000000..3349031
--- /dev/null
+++ b/arch/x86/include/asm/xen/kexec.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2011 Daniel Kiper
+ * Copyright (c) 2012 Daniel Kiper, Oracle Corporation
+ *
+ * kexec/kdump implementation for Xen was written by Daniel Kiper.
+ * Initial work on it was sponsored by Google under Google Summer
+ * of Code 2011 program and Citrix. Konrad Rzeszutek Wilk from Oracle
+ * was the mentor for this project.
+ *
+ * Some ideas are taken from:
+ *   - native kexec/kdump implementation,
+ *   - kexec/kdump implementation for Xen Linux Kernel Ver. 2.6.18,
+ *   - PV-GRUB.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _ASM_X86_XEN_KEXEC_H
+#define _ASM_X86_XEN_KEXEC_H
+
+#include <linux/init.h>
+
+#define KEXEC_XEN_NO_PAGES	17
+
+#define XK_MA_CONTROL_PAGE	0
+#define XK_VA_CONTROL_PAGE	1
+#define XK_MA_PGD_PAGE		2
+#define XK_VA_PGD_PAGE		3
+#define XK_MA_PUD0_PAGE		4
+#define XK_VA_PUD0_PAGE		5
+#define XK_MA_PUD1_PAGE		6
+#define XK_VA_PUD1_PAGE		7
+#define XK_MA_PMD0_PAGE		8
+#define XK_VA_PMD0_PAGE		9
+#define XK_MA_PMD1_PAGE		10
+#define XK_VA_PMD1_PAGE		11
+#define XK_MA_PTE0_PAGE		12
+#define XK_VA_PTE0_PAGE		13
+#define XK_MA_PTE1_PAGE		14
+#define XK_VA_PTE1_PAGE		15
+#define XK_MA_TABLE_PAGE	16
+
+#ifndef __ASSEMBLY__
+struct xen_kexec_image {
+	unsigned long page_list[KEXEC_XEN_NO_PAGES];
+	unsigned long indirection_page;
+	unsigned long start_address;
+};
+
+struct xen_kexec_load {
+	int type;
+	struct xen_kexec_image image;
+};
+
+extern unsigned int xen_kexec_control_code_size;
+
+extern void __init xen_init_kexec_ops(void);
+
+#ifdef CONFIG_X86_32
+extern void xen_relocate_kernel(unsigned long indirection_page,
+				unsigned long *page_list,
+				unsigned long start_address,
+				unsigned int has_pae,
+				unsigned int preserve_context);
+#else
+extern void xen_relocate_kernel(unsigned long indirection_page,
+				unsigned long *page_list,
+				unsigned long start_address,
+				unsigned int preserve_context);
+#endif
+#endif
+#endif /* _ASM_X86_XEN_KEXEC_H */
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQF-0008WT-Sk; Tue, 20 Nov 2012 15:07:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQE-0008VP-Nz
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:34 +0000
Received: from [85.158.139.211:49853] by server-9.bemta-5.messagelabs.com id
	FD/E1-29295-4BC9BA05; Tue, 20 Nov 2012 15:07:32 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!6
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9908 invoked from network); 20 Nov 2012 15:07:31 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:31 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1633948Ab2KTPEx
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:53 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:46 +0100
Message-Id: <1353423893-23125-5-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.006028
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 04/11] x86/xen: Introduce architecture
	dependent data for kexec/kdump
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Introduce architecture dependent constants, structures and
functions required by Xen kexec/kdump implementation.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 arch/x86/include/asm/xen/hypercall.h |    6 +++
 arch/x86/include/asm/xen/kexec.h     |   83 ++++++++++++++++++++++++++++++++++
 2 files changed, 89 insertions(+), 0 deletions(-)
 create mode 100644 arch/x86/include/asm/xen/kexec.h

diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h
index c20d1ce..e76a1b8 100644
--- a/arch/x86/include/asm/xen/hypercall.h
+++ b/arch/x86/include/asm/xen/hypercall.h
@@ -459,6 +459,12 @@ HYPERVISOR_hvm_op(int op, void *arg)
 }
 
 static inline int
+HYPERVISOR_kexec_op(unsigned long op, void *args)
+{
+	return _hypercall2(int, kexec_op, op, args);
+}
+
+static inline int
 HYPERVISOR_tmem_op(
 	struct tmem_op *op)
 {
diff --git a/arch/x86/include/asm/xen/kexec.h b/arch/x86/include/asm/xen/kexec.h
new file mode 100644
index 0000000..3349031
--- /dev/null
+++ b/arch/x86/include/asm/xen/kexec.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2011 Daniel Kiper
+ * Copyright (c) 2012 Daniel Kiper, Oracle Corporation
+ *
+ * kexec/kdump implementation for Xen was written by Daniel Kiper.
+ * Initial work on it was sponsored by Google under Google Summer
+ * of Code 2011 program and Citrix. Konrad Rzeszutek Wilk from Oracle
+ * was the mentor for this project.
+ *
+ * Some ideas are taken from:
+ *   - native kexec/kdump implementation,
+ *   - kexec/kdump implementation for Xen Linux Kernel Ver. 2.6.18,
+ *   - PV-GRUB.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _ASM_X86_XEN_KEXEC_H
+#define _ASM_X86_XEN_KEXEC_H
+
+#include <linux/init.h>
+
+#define KEXEC_XEN_NO_PAGES	17
+
+#define XK_MA_CONTROL_PAGE	0
+#define XK_VA_CONTROL_PAGE	1
+#define XK_MA_PGD_PAGE		2
+#define XK_VA_PGD_PAGE		3
+#define XK_MA_PUD0_PAGE		4
+#define XK_VA_PUD0_PAGE		5
+#define XK_MA_PUD1_PAGE		6
+#define XK_VA_PUD1_PAGE		7
+#define XK_MA_PMD0_PAGE		8
+#define XK_VA_PMD0_PAGE		9
+#define XK_MA_PMD1_PAGE		10
+#define XK_VA_PMD1_PAGE		11
+#define XK_MA_PTE0_PAGE		12
+#define XK_VA_PTE0_PAGE		13
+#define XK_MA_PTE1_PAGE		14
+#define XK_VA_PTE1_PAGE		15
+#define XK_MA_TABLE_PAGE	16
+
+#ifndef __ASSEMBLY__
+struct xen_kexec_image {
+	unsigned long page_list[KEXEC_XEN_NO_PAGES];
+	unsigned long indirection_page;
+	unsigned long start_address;
+};
+
+struct xen_kexec_load {
+	int type;
+	struct xen_kexec_image image;
+};
+
+extern unsigned int xen_kexec_control_code_size;
+
+extern void __init xen_init_kexec_ops(void);
+
+#ifdef CONFIG_X86_32
+extern void xen_relocate_kernel(unsigned long indirection_page,
+				unsigned long *page_list,
+				unsigned long start_address,
+				unsigned int has_pae,
+				unsigned int preserve_context);
+#else
+extern void xen_relocate_kernel(unsigned long indirection_page,
+				unsigned long *page_list,
+				unsigned long start_address,
+				unsigned int preserve_context);
+#endif
+#endif
+#endif /* _ASM_X86_XEN_KEXEC_H */
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQE-0008Vp-Fo; Tue, 20 Nov 2012 15:07:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQD-0008VU-6H
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:33 +0000
Received: from [85.158.139.211:9526] by server-10.bemta-5.messagelabs.com id
	C0/07-09257-4BC9BA05; Tue, 20 Nov 2012 15:07:32 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!4
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9822 invoked from network); 20 Nov 2012 15:07:30 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:30 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1633864Ab2KTPEx
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:53 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:45 +0100
Message-Id: <1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.415109
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 03/11] xen: Introduce architecture
	independent data for kexec/kdump
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Introduce architecture independent constants and structures
required by Xen kexec/kdump implementation.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 include/xen/interface/xen.h |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h
index 886a5d8..09c16ab 100644
--- a/include/xen/interface/xen.h
+++ b/include/xen/interface/xen.h
@@ -57,6 +57,7 @@
 #define __HYPERVISOR_event_channel_op     32
 #define __HYPERVISOR_physdev_op           33
 #define __HYPERVISOR_hvm_op               34
+#define __HYPERVISOR_kexec_op             37
 #define __HYPERVISOR_tmem_op              38
 
 /* Architecture-specific hypercall definitions. */
@@ -231,7 +232,39 @@ DEFINE_GUEST_HANDLE_STRUCT(mmuext_op);
 #define VMASST_TYPE_pae_extended_cr3     3
 #define MAX_VMASST_TYPE 3
 
+/*
+ * Commands to HYPERVISOR_kexec_op().
+ */
+#define KEXEC_CMD_kexec			0
+#define KEXEC_CMD_kexec_load		1
+#define KEXEC_CMD_kexec_unload		2
+#define KEXEC_CMD_kexec_get_range	3
+
+/*
+ * Memory ranges for kdump (utilized by HYPERVISOR_kexec_op()).
+ */
+#define KEXEC_RANGE_MA_CRASH		0
+#define KEXEC_RANGE_MA_XEN		1
+#define KEXEC_RANGE_MA_CPU		2
+#define KEXEC_RANGE_MA_XENHEAP		3
+#define KEXEC_RANGE_MA_BOOT_PARAM	4
+#define KEXEC_RANGE_MA_EFI_MEMMAP	5
+#define KEXEC_RANGE_MA_VMCOREINFO	6
+
 #ifndef __ASSEMBLY__
+struct xen_kexec_exec {
+	int type;
+};
+
+struct xen_kexec_range {
+	int range;
+	int nr;
+	unsigned long size;
+	unsigned long start;
+};
+
+extern unsigned long xen_vmcoreinfo_maddr;
+extern unsigned long xen_vmcoreinfo_max_size;
 
 typedef uint16_t domid_t;
 
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQE-0008W0-RQ; Tue, 20 Nov 2012 15:07:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQD-0008VV-Ac
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:33 +0000
Received: from [85.158.139.211:28639] by server-13.bemta-5.messagelabs.com id
	B6/53-27809-4BC9BA05; Tue, 20 Nov 2012 15:07:32 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!3
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9802 invoked from network); 20 Nov 2012 15:07:30 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:30 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1633847Ab2KTPEx
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:53 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:44 +0100
Message-Id: <1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.395697
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 02/11] x86/kexec: Add extra pointers to
	transition page table PGD, PUD, PMD and PTE
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Some implementations (e.g. Xen PVOPS) could not use part of identity page table
to construct transition page table. It means that they require separate PUDs,
PMDs and PTEs for virtual and physical (identity) mapping. To satisfy that
requirement add extra pointer to PGD, PUD, PMD and PTE and align existing code.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 arch/x86/include/asm/kexec.h       |   10 +++++++---
 arch/x86/kernel/machine_kexec_64.c |   12 ++++++------
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h
index 317ff17..3cf5600 100644
--- a/arch/x86/include/asm/kexec.h
+++ b/arch/x86/include/asm/kexec.h
@@ -157,9 +157,13 @@ struct kimage_arch {
 };
 #else
 struct kimage_arch {
-	pud_t *pud;
-	pmd_t *pmd;
-	pte_t *pte;
+	pgd_t *pgd;
+	pud_t *pud0;
+	pud_t *pud1;
+	pmd_t *pmd0;
+	pmd_t *pmd1;
+	pte_t *pte0;
+	pte_t *pte1;
 };
 #endif
 
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index b3ea9db..976e54b 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -137,9 +137,9 @@ out:
 
 static void free_transition_pgtable(struct kimage *image)
 {
-	free_page((unsigned long)image->arch.pud);
-	free_page((unsigned long)image->arch.pmd);
-	free_page((unsigned long)image->arch.pte);
+	free_page((unsigned long)image->arch.pud0);
+	free_page((unsigned long)image->arch.pmd0);
+	free_page((unsigned long)image->arch.pte0);
 }
 
 static int init_transition_pgtable(struct kimage *image, pgd_t *pgd)
@@ -157,7 +157,7 @@ static int init_transition_pgtable(struct kimage *image, pgd_t *pgd)
 		pud = (pud_t *)get_zeroed_page(GFP_KERNEL);
 		if (!pud)
 			goto err;
-		image->arch.pud = pud;
+		image->arch.pud0 = pud;
 		set_pgd(pgd, __pgd(__pa(pud) | _KERNPG_TABLE));
 	}
 	pud = pud_offset(pgd, vaddr);
@@ -165,7 +165,7 @@ static int init_transition_pgtable(struct kimage *image, pgd_t *pgd)
 		pmd = (pmd_t *)get_zeroed_page(GFP_KERNEL);
 		if (!pmd)
 			goto err;
-		image->arch.pmd = pmd;
+		image->arch.pmd0 = pmd;
 		set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE));
 	}
 	pmd = pmd_offset(pud, vaddr);
@@ -173,7 +173,7 @@ static int init_transition_pgtable(struct kimage *image, pgd_t *pgd)
 		pte = (pte_t *)get_zeroed_page(GFP_KERNEL);
 		if (!pte)
 			goto err;
-		image->arch.pte = pte;
+		image->arch.pte0 = pte;
 		set_pmd(pmd, __pmd(__pa(pte) | _KERNPG_TABLE));
 	}
 	pte = pte_offset_kernel(pmd, vaddr);
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQE-0008Vp-Fo; Tue, 20 Nov 2012 15:07:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQD-0008VU-6H
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:33 +0000
Received: from [85.158.139.211:9526] by server-10.bemta-5.messagelabs.com id
	C0/07-09257-4BC9BA05; Tue, 20 Nov 2012 15:07:32 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!4
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9822 invoked from network); 20 Nov 2012 15:07:30 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:30 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1633864Ab2KTPEx
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:53 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:45 +0100
Message-Id: <1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.415109
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 03/11] xen: Introduce architecture
	independent data for kexec/kdump
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Introduce architecture independent constants and structures
required by Xen kexec/kdump implementation.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 include/xen/interface/xen.h |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h
index 886a5d8..09c16ab 100644
--- a/include/xen/interface/xen.h
+++ b/include/xen/interface/xen.h
@@ -57,6 +57,7 @@
 #define __HYPERVISOR_event_channel_op     32
 #define __HYPERVISOR_physdev_op           33
 #define __HYPERVISOR_hvm_op               34
+#define __HYPERVISOR_kexec_op             37
 #define __HYPERVISOR_tmem_op              38
 
 /* Architecture-specific hypercall definitions. */
@@ -231,7 +232,39 @@ DEFINE_GUEST_HANDLE_STRUCT(mmuext_op);
 #define VMASST_TYPE_pae_extended_cr3     3
 #define MAX_VMASST_TYPE 3
 
+/*
+ * Commands to HYPERVISOR_kexec_op().
+ */
+#define KEXEC_CMD_kexec			0
+#define KEXEC_CMD_kexec_load		1
+#define KEXEC_CMD_kexec_unload		2
+#define KEXEC_CMD_kexec_get_range	3
+
+/*
+ * Memory ranges for kdump (utilized by HYPERVISOR_kexec_op()).
+ */
+#define KEXEC_RANGE_MA_CRASH		0
+#define KEXEC_RANGE_MA_XEN		1
+#define KEXEC_RANGE_MA_CPU		2
+#define KEXEC_RANGE_MA_XENHEAP		3
+#define KEXEC_RANGE_MA_BOOT_PARAM	4
+#define KEXEC_RANGE_MA_EFI_MEMMAP	5
+#define KEXEC_RANGE_MA_VMCOREINFO	6
+
 #ifndef __ASSEMBLY__
+struct xen_kexec_exec {
+	int type;
+};
+
+struct xen_kexec_range {
+	int range;
+	int nr;
+	unsigned long size;
+	unsigned long start;
+};
+
+extern unsigned long xen_vmcoreinfo_maddr;
+extern unsigned long xen_vmcoreinfo_max_size;
 
 typedef uint16_t domid_t;
 
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQE-0008W0-RQ; Tue, 20 Nov 2012 15:07:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQD-0008VV-Ac
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:33 +0000
Received: from [85.158.139.211:28639] by server-13.bemta-5.messagelabs.com id
	B6/53-27809-4BC9BA05; Tue, 20 Nov 2012 15:07:32 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!3
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9802 invoked from network); 20 Nov 2012 15:07:30 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:30 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1633847Ab2KTPEx
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:53 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:44 +0100
Message-Id: <1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.395697
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 02/11] x86/kexec: Add extra pointers to
	transition page table PGD, PUD, PMD and PTE
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Some implementations (e.g. Xen PVOPS) could not use part of identity page table
to construct transition page table. It means that they require separate PUDs,
PMDs and PTEs for virtual and physical (identity) mapping. To satisfy that
requirement add extra pointer to PGD, PUD, PMD and PTE and align existing code.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 arch/x86/include/asm/kexec.h       |   10 +++++++---
 arch/x86/kernel/machine_kexec_64.c |   12 ++++++------
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h
index 317ff17..3cf5600 100644
--- a/arch/x86/include/asm/kexec.h
+++ b/arch/x86/include/asm/kexec.h
@@ -157,9 +157,13 @@ struct kimage_arch {
 };
 #else
 struct kimage_arch {
-	pud_t *pud;
-	pmd_t *pmd;
-	pte_t *pte;
+	pgd_t *pgd;
+	pud_t *pud0;
+	pud_t *pud1;
+	pmd_t *pmd0;
+	pmd_t *pmd1;
+	pte_t *pte0;
+	pte_t *pte1;
 };
 #endif
 
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index b3ea9db..976e54b 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -137,9 +137,9 @@ out:
 
 static void free_transition_pgtable(struct kimage *image)
 {
-	free_page((unsigned long)image->arch.pud);
-	free_page((unsigned long)image->arch.pmd);
-	free_page((unsigned long)image->arch.pte);
+	free_page((unsigned long)image->arch.pud0);
+	free_page((unsigned long)image->arch.pmd0);
+	free_page((unsigned long)image->arch.pte0);
 }
 
 static int init_transition_pgtable(struct kimage *image, pgd_t *pgd)
@@ -157,7 +157,7 @@ static int init_transition_pgtable(struct kimage *image, pgd_t *pgd)
 		pud = (pud_t *)get_zeroed_page(GFP_KERNEL);
 		if (!pud)
 			goto err;
-		image->arch.pud = pud;
+		image->arch.pud0 = pud;
 		set_pgd(pgd, __pgd(__pa(pud) | _KERNPG_TABLE));
 	}
 	pud = pud_offset(pgd, vaddr);
@@ -165,7 +165,7 @@ static int init_transition_pgtable(struct kimage *image, pgd_t *pgd)
 		pmd = (pmd_t *)get_zeroed_page(GFP_KERNEL);
 		if (!pmd)
 			goto err;
-		image->arch.pmd = pmd;
+		image->arch.pmd0 = pmd;
 		set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE));
 	}
 	pmd = pmd_offset(pud, vaddr);
@@ -173,7 +173,7 @@ static int init_transition_pgtable(struct kimage *image, pgd_t *pgd)
 		pte = (pte_t *)get_zeroed_page(GFP_KERNEL);
 		if (!pte)
 			goto err;
-		image->arch.pte = pte;
+		image->arch.pte0 = pte;
 		set_pmd(pmd, __pmd(__pa(pte) | _KERNPG_TABLE));
 	}
 	pte = pte_offset_kernel(pmd, vaddr);
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQF-0008WH-9k; Tue, 20 Nov 2012 15:07:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQE-0008Vm-4Z
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:34 +0000
Received: from [85.158.139.211:49889] by server-16.bemta-5.messagelabs.com id
	52/38-04786-5BC9BA05; Tue, 20 Nov 2012 15:07:33 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!5
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9859 invoked from network); 20 Nov 2012 15:07:30 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:30 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1633973Ab2KTPEx
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:53 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:48 +0100
Message-Id: <1353423893-23125-7-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-6-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-5-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-6-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.060769
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 06/11] x86/xen: Add i386 kexec/kdump
	implementation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add i386 kexec/kdump implementation.

v2 - suggestions/fixes:
   - allocate transition page table pages below 4 GiB
     (suggested by Jan Beulich).

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 arch/x86/xen/machine_kexec_32.c   |  247 ++++++++++++++++++++++++++++
 arch/x86/xen/relocate_kernel_32.S |  323 +++++++++++++++++++++++++++++++++++++
 2 files changed, 570 insertions(+), 0 deletions(-)
 create mode 100644 arch/x86/xen/machine_kexec_32.c
 create mode 100644 arch/x86/xen/relocate_kernel_32.S

diff --git a/arch/x86/xen/machine_kexec_32.c b/arch/x86/xen/machine_kexec_32.c
new file mode 100644
index 0000000..116c302
--- /dev/null
+++ b/arch/x86/xen/machine_kexec_32.c
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 2011 Daniel Kiper
+ * Copyright (c) 2012 Daniel Kiper, Oracle Corporation
+ *
+ * kexec/kdump implementation for Xen was written by Daniel Kiper.
+ * Initial work on it was sponsored by Google under Google Summer
+ * of Code 2011 program and Citrix. Konrad Rzeszutek Wilk from Oracle
+ * was the mentor for this project.
+ *
+ * Some ideas are taken from:
+ *   - native kexec/kdump implementation,
+ *   - kexec/kdump implementation for Xen Linux Kernel Ver. 2.6.18,
+ *   - PV-GRUB.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/kexec.h>
+#include <linux/mm.h>
+#include <linux/string.h>
+
+#include <xen/xen.h>
+#include <xen/xen-ops.h>
+
+#include <asm/xen/hypercall.h>
+#include <asm/xen/kexec.h>
+#include <asm/xen/page.h>
+
+#define __ma(vaddr)	(virt_to_machine(vaddr).maddr)
+
+static struct page *kimage_alloc_pages(gfp_t gfp_mask,
+					unsigned int order,
+					unsigned long limit)
+{
+	struct page *pages;
+	unsigned int address_bits, i;
+
+	pages = alloc_pages(gfp_mask, order);
+
+	if (!pages)
+		return NULL;
+
+	address_bits = (limit == ULONG_MAX) ? BITS_PER_LONG : ilog2(limit);
+
+	/* Relocate set of pages below given limit. */
+	if (xen_create_contiguous_region((unsigned long)page_address(pages),
+							order, address_bits)) {
+		__free_pages(pages, order);
+		return NULL;
+	}
+
+	BUG_ON(PagePrivate(pages));
+
+	pages->mapping = NULL;
+	set_page_private(pages, order);
+
+	for (i = 0; i < (1 << order); ++i)
+		SetPageReserved(pages + i);
+
+	return pages;
+}
+
+static void kimage_free_pages(struct page *page)
+{
+	unsigned int i, order;
+
+	order = page_private(page);
+
+	for (i = 0; i < (1 << order); ++i)
+		ClearPageReserved(page + i);
+
+	xen_destroy_contiguous_region((unsigned long)page_address(page), order);
+	__free_pages(page, order);
+}
+
+static unsigned long xen_page_to_mfn(struct page *page)
+{
+	return pfn_to_mfn(page_to_pfn(page));
+}
+
+static struct page *xen_mfn_to_page(unsigned long mfn)
+{
+	return pfn_to_page(mfn_to_pfn(mfn));
+}
+
+static unsigned long xen_virt_to_machine(volatile void *address)
+{
+	return virt_to_machine(address).maddr;
+}
+
+static void *xen_machine_to_virt(unsigned long address)
+{
+	return phys_to_virt(machine_to_phys(XMADDR(address)).paddr);
+}
+
+static void *alloc_pgtable_page(struct kimage *image)
+{
+	struct page *page;
+
+	page = kimage_alloc_control_pages(image, 0);
+
+	if (!page || !page_address(page))
+		return NULL;
+
+	memset(page_address(page), 0, PAGE_SIZE);
+
+	return page_address(page);
+}
+
+static int alloc_transition_pgtable(struct kimage *image)
+{
+	image->arch.pgd = alloc_pgtable_page(image);
+
+	if (!image->arch.pgd)
+		return -ENOMEM;
+
+	image->arch.pmd0 = alloc_pgtable_page(image);
+
+	if (!image->arch.pmd0)
+		return -ENOMEM;
+
+	image->arch.pmd1 = alloc_pgtable_page(image);
+
+	if (!image->arch.pmd1)
+		return -ENOMEM;
+
+	image->arch.pte0 = alloc_pgtable_page(image);
+
+	if (!image->arch.pte0)
+		return -ENOMEM;
+
+	image->arch.pte1 = alloc_pgtable_page(image);
+
+	if (!image->arch.pte1)
+		return -ENOMEM;
+
+	return 0;
+}
+
+static int machine_xen_kexec_prepare(struct kimage *image)
+{
+#ifdef CONFIG_KEXEC_JUMP
+	if (image->preserve_context) {
+		pr_info_once("kexec: Context preservation is not "
+				"supported in Xen domains.\n");
+		return -ENOSYS;
+	}
+#endif
+
+	return alloc_transition_pgtable(image);
+}
+
+static int machine_xen_kexec_load(struct kimage *image)
+{
+	void *control_page;
+	struct xen_kexec_load xkl = {};
+
+	/* Image is unloaded, nothing to do. */
+	if (!image)
+		return 0;
+
+	control_page = page_address(image->control_code_page);
+	memcpy(control_page, xen_relocate_kernel, xen_kexec_control_code_size);
+
+	xkl.type = image->type;
+	xkl.image.page_list[XK_MA_CONTROL_PAGE] = __ma(control_page);
+	xkl.image.page_list[XK_MA_TABLE_PAGE] = 0; /* Unused. */
+	xkl.image.page_list[XK_MA_PGD_PAGE] = __ma(image->arch.pgd);
+	xkl.image.page_list[XK_MA_PUD0_PAGE] = 0; /* Unused. */
+	xkl.image.page_list[XK_MA_PUD1_PAGE] = 0; /* Unused. */
+	xkl.image.page_list[XK_MA_PMD0_PAGE] = __ma(image->arch.pmd0);
+	xkl.image.page_list[XK_MA_PMD1_PAGE] = __ma(image->arch.pmd1);
+	xkl.image.page_list[XK_MA_PTE0_PAGE] = __ma(image->arch.pte0);
+	xkl.image.page_list[XK_MA_PTE1_PAGE] = __ma(image->arch.pte1);
+	xkl.image.indirection_page = image->head;
+	xkl.image.start_address = image->start;
+
+	return HYPERVISOR_kexec_op(KEXEC_CMD_kexec_load, &xkl);
+}
+
+static void machine_xen_kexec_cleanup(struct kimage *image)
+{
+}
+
+static void machine_xen_kexec_unload(struct kimage *image)
+{
+	int rc;
+	struct xen_kexec_load xkl = {};
+
+	if (!image)
+		return;
+
+	xkl.type = image->type;
+	rc = HYPERVISOR_kexec_op(KEXEC_CMD_kexec_unload, &xkl);
+
+	WARN(rc, "kexec: %s: HYPERVISOR_kexec_op(): %i\n", __func__, rc);
+}
+
+static void machine_xen_kexec_shutdown(void)
+{
+}
+
+static void machine_xen_kexec(struct kimage *image)
+{
+	int rc;
+	struct xen_kexec_exec xke = {};
+
+	xke.type = image->type;
+	rc = HYPERVISOR_kexec_op(KEXEC_CMD_kexec, &xke);
+
+	pr_emerg("kexec: %s: HYPERVISOR_kexec_op(): %i\n", __func__, rc);
+	BUG();
+}
+
+void __init xen_init_kexec_ops(void)
+{
+	if (!xen_initial_domain())
+		return;
+
+	kexec_ops.crash_alloc_temp_store = true;
+	kexec_ops.kimage_alloc_pages = kimage_alloc_pages;
+	kexec_ops.kimage_free_pages = kimage_free_pages;
+	kexec_ops.page_to_pfn = xen_page_to_mfn;
+	kexec_ops.pfn_to_page = xen_mfn_to_page;
+	kexec_ops.virt_to_phys = xen_virt_to_machine;
+	kexec_ops.phys_to_virt = xen_machine_to_virt;
+	kexec_ops.machine_kexec_prepare = machine_xen_kexec_prepare;
+	kexec_ops.machine_kexec_load = machine_xen_kexec_load;
+	kexec_ops.machine_kexec_cleanup = machine_xen_kexec_cleanup;
+	kexec_ops.machine_kexec_unload = machine_xen_kexec_unload;
+	kexec_ops.machine_kexec_shutdown = machine_xen_kexec_shutdown;
+	kexec_ops.machine_kexec = machine_xen_kexec;
+}
diff --git a/arch/x86/xen/relocate_kernel_32.S b/arch/x86/xen/relocate_kernel_32.S
new file mode 100644
index 0000000..0e81830
--- /dev/null
+++ b/arch/x86/xen/relocate_kernel_32.S
@@ -0,0 +1,323 @@
+/*
+ * Copyright (c) 2002-2005 Eric Biederman <ebiederm@xmission.com>
+ * Copyright (c) 2011 Daniel Kiper
+ * Copyright (c) 2012 Daniel Kiper, Oracle Corporation
+ *
+ * kexec/kdump implementation for Xen was written by Daniel Kiper.
+ * Initial work on it was sponsored by Google under Google Summer
+ * of Code 2011 program and Citrix. Konrad Rzeszutek Wilk from Oracle
+ * was the mentor for this project.
+ *
+ * Some ideas are taken from:
+ *   - native kexec/kdump implementation,
+ *   - kexec/kdump implementation for Xen Linux Kernel Ver. 2.6.18,
+ *   - PV-GRUB.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either veesion 2 of the License, or
+ * (at your option) any later veesion.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <asm/cache.h>
+#include <asm/page_types.h>
+#include <asm/pgtable_types.h>
+#include <asm/processor-flags.h>
+
+#include <asm/xen/kexec.h>
+
+#define ARG_INDIRECTION_PAGE	0x4
+#define ARG_PAGE_LIST		0x8
+#define ARG_START_ADDRESS	0xc
+
+#define PTR(x)	(x << 2)
+
+	.text
+	.align	PAGE_SIZE
+	.globl	xen_kexec_control_code_size, xen_relocate_kernel
+
+xen_relocate_kernel:
+	/*
+	 * Must be relocatable PIC code callable as a C function.
+	 *
+	 * This function is called by Xen but here hypervisor is dead.
+	 * We are playing on bare metal.
+	 *
+	 * Every machine address passed to this function through
+	 * page_list (e.g. XK_MA_CONTROL_PAGE) is established
+	 * by dom0 during kexec load phase.
+	 *
+	 * Every virtual address passed to this function through page_list
+	 * (e.g. XK_VA_CONTROL_PAGE) is established by hypervisor during
+	 * HYPERVISOR_kexec_op(KEXEC_CMD_kexec_load) hypercall.
+	 *
+	 * 0x4(%esp) - indirection_page,
+	 * 0x8(%esp) - page_list,
+	 * 0xc(%esp) - start_address,
+	 * 0x10(%esp) - cpu_has_pae (ignored),
+	 * 0x14(%esp) - preserve_context (ignored).
+	 */
+
+	/* Zero out flags, and disable interrupts. */
+	pushl	$0
+	popfl
+
+	/* Get page_list address. */
+	movl	ARG_PAGE_LIST(%esp), %esi
+
+	/*
+	 * Map the control page at its virtual address
+	 * in transition page table.
+	 */
+	movl	PTR(XK_VA_CONTROL_PAGE)(%esi), %eax
+
+	/* Get PGD address and PGD entry index. */
+	movl	PTR(XK_VA_PGD_PAGE)(%esi), %ebx
+	movl	%eax, %ecx
+	shrl	$PGDIR_SHIFT, %ecx
+	andl	$(PTRS_PER_PGD - 1), %ecx
+
+	/* Fill PGD entry with PMD0 reference. */
+	movl	PTR(XK_MA_PMD0_PAGE)(%esi), %edx
+	orl	$_PAGE_PRESENT, %edx
+	movl	%edx, (%ebx, %ecx, 8)
+
+	/* Get PMD0 address and PMD0 entry index. */
+	movl	PTR(XK_VA_PMD0_PAGE)(%esi), %ebx
+	movl	%eax, %ecx
+	shrl	$PMD_SHIFT, %ecx
+	andl	$(PTRS_PER_PMD - 1), %ecx
+
+	/* Fill PMD0 entry with PTE0 reference. */
+	movl	PTR(XK_MA_PTE0_PAGE)(%esi), %edx
+	orl	$_KERNPG_TABLE, %edx
+	movl	%edx, (%ebx, %ecx, 8)
+
+	/* Get PTE0 address and PTE0 entry index. */
+	movl	PTR(XK_VA_PTE0_PAGE)(%esi), %ebx
+	movl	%eax, %ecx
+	shrl	$PAGE_SHIFT, %ecx
+	andl	$(PTRS_PER_PTE - 1), %ecx
+
+	/* Fill PTE0 entry with control page reference. */
+	movl	PTR(XK_MA_CONTROL_PAGE)(%esi), %edx
+	orl	$__PAGE_KERNEL_EXEC, %edx
+	movl	%edx, (%ebx, %ecx, 8)
+
+	/*
+	 * Identity map the control page at its machine address
+	 * in transition page table.
+	 */
+	movl	PTR(XK_MA_CONTROL_PAGE)(%esi), %eax
+
+	/* Get PGD address and PGD entry index. */
+	movl	PTR(XK_VA_PGD_PAGE)(%esi), %ebx
+	movl	%eax, %ecx
+	shrl	$PGDIR_SHIFT, %ecx
+	andl	$(PTRS_PER_PGD - 1), %ecx
+
+	/* Fill PGD entry with PMD1 reference. */
+	movl	PTR(XK_MA_PMD1_PAGE)(%esi), %edx
+	orl	$_PAGE_PRESENT, %edx
+	movl	%edx, (%ebx, %ecx, 8)
+
+	/* Get PMD1 address and PMD1 entry index. */
+	movl	PTR(XK_VA_PMD1_PAGE)(%esi), %ebx
+	movl	%eax, %ecx
+	shrl	$PMD_SHIFT, %ecx
+	andl	$(PTRS_PER_PMD - 1), %ecx
+
+	/* Fill PMD1 entry with PTE1 reference. */
+	movl	PTR(XK_MA_PTE1_PAGE)(%esi), %edx
+	orl	$_KERNPG_TABLE, %edx
+	movl	%edx, (%ebx, %ecx, 8)
+
+	/* Get PTE1 address and PTE1 entry index. */
+	movl	PTR(XK_VA_PTE1_PAGE)(%esi), %ebx
+	movl	%eax, %ecx
+	shrl	$PAGE_SHIFT, %ecx
+	andl	$(PTRS_PER_PTE - 1), %ecx
+
+	/* Fill PTE1 entry with control page reference. */
+	movl	PTR(XK_MA_CONTROL_PAGE)(%esi), %edx
+	orl	$__PAGE_KERNEL_EXEC, %edx
+	movl	%edx, (%ebx, %ecx, 8)
+
+	/*
+	 * Get machine address of control page now.
+	 * This is impossible after page table switch.
+	 */
+	movl	PTR(XK_MA_CONTROL_PAGE)(%esi), %ebx
+
+	/* Get machine address of transition page table now too. */
+	movl	PTR(XK_MA_PGD_PAGE)(%esi), %ecx
+
+	/* Get start_address too. */
+	movl	ARG_START_ADDRESS(%esp), %edx
+
+	/* Get indirection_page address too. */
+	movl	ARG_INDIRECTION_PAGE(%esp), %edi
+
+	/* Switch to transition page table. */
+	movl	%ecx, %cr3
+
+	/* Load IDT. */
+	lidtl	(idt_48 - xen_relocate_kernel)(%ebx)
+
+	/* Load GDT. */
+	leal	(gdt - xen_relocate_kernel)(%ebx), %eax
+	movl	%eax, (gdt_48 - xen_relocate_kernel + 2)(%ebx)
+	lgdtl	(gdt_48 - xen_relocate_kernel)(%ebx)
+
+	/* Load data segment registers. */
+	movl	$(gdt_ds - gdt), %eax
+	movl	%eax, %ds
+	movl	%eax, %es
+	movl	%eax, %fs
+	movl	%eax, %gs
+	movl	%eax, %ss
+
+	/* Setup a new stack at the end of machine address of control page. */
+	leal	PAGE_SIZE(%ebx), %esp
+
+	/* Store start_address on the stack. */
+	pushl   %edx
+
+	/* Jump to identity mapped page. */
+	pushl	$0
+	pushl	$(gdt_cs - gdt)
+	addl	$(identity_mapped - xen_relocate_kernel), %ebx
+	pushl	%ebx
+	iretl
+
+identity_mapped:
+	/*
+	 * Set %cr0 to a known state:
+	 *   - disable alignment check,
+	 *   - disable floating point emulation,
+	 *   - disable paging,
+	 *   - no task switch,
+	 *   - disable write protect,
+	 *   - enable protected mode.
+	 */
+	movl	%cr0, %eax
+	andl	$~(X86_CR0_AM | X86_CR0_EM | X86_CR0_PG | X86_CR0_TS | X86_CR0_WP), %eax
+	orl	$(X86_CR0_PE), %eax
+	movl	%eax, %cr0
+
+	/* Set %cr4 to a known state. */
+	xorl	%eax, %eax
+	movl	%eax, %cr4
+
+	jmp	1f
+
+1:
+	/* Flush the TLB (needed?). */
+	movl	%eax, %cr3
+
+	/* Do the copies. */
+	movl	%edi, %ecx	/* Put the indirection_page in %ecx. */
+	xorl	%edi, %edi
+	xorl	%esi, %esi
+	jmp	1f
+
+0:
+	/*
+	 * Top, read another doubleword from the indirection page.
+	 * Indirection page is an array which contains source
+	 * and destination address pairs. If all pairs could
+	 * not fit in one page then at the end of given
+	 * indirection page is pointer to next one.
+	 * Copy is stopped when done indicator
+	 * is found in indirection page.
+	 */
+	movl	(%ebx), %ecx
+	addl	$4, %ebx
+
+1:
+	testl	$0x1, %ecx	/* Is it a destination page? */
+	jz	2f
+
+	movl	%ecx, %edi
+	andl	$PAGE_MASK, %edi
+	jmp	0b
+
+2:
+	testl	$0x2, %ecx	/* Is it an indirection page? */
+	jz	2f
+
+	movl	%ecx, %ebx
+	andl	$PAGE_MASK, %ebx
+	jmp	0b
+
+2:
+	testl	$0x4, %ecx	/* Is it the done indicator? */
+	jz	2f
+	jmp	3f
+
+2:
+	testl	$0x8, %ecx	/* Is it the source indicator? */
+	jz	0b		/* Ignore it otherwise. */
+
+	movl	%ecx, %esi
+	andl	$PAGE_MASK, %esi
+	movl	$1024, %ecx
+
+	/* Copy page. */
+	rep	movsl
+	jmp	0b
+
+3:
+	/*
+	 * To be certain of avoiding problems with self-modifying code
+	 * I need to execute a serializing instruction here.
+	 * So I flush the TLB by reloading %cr3 here, it's handy,
+	 * and not processor dependent.
+	 */
+	xorl	%eax, %eax
+	movl	%eax, %cr3
+
+	/*
+	 * Set all of the registers to known values.
+	 * Leave %esp alone.
+	 */
+	xorl	%ebx, %ebx
+	xorl    %ecx, %ecx
+	xorl    %edx, %edx
+	xorl    %esi, %esi
+	xorl    %edi, %edi
+	xorl    %ebp, %ebp
+
+	/* Jump to start_address. */
+	retl
+
+	.align	L1_CACHE_BYTES
+
+gdt:
+	.quad	0x0000000000000000	/* NULL descriptor. */
+
+gdt_cs:
+	.quad	0x00cf9a000000ffff	/* 4 GiB code segment at 0x00000000. */
+
+gdt_ds:
+	.quad	0x00cf92000000ffff	/* 4 GiB data segment at 0x00000000. */
+gdt_end:
+
+gdt_48:
+	.word	gdt_end - gdt - 1	/* GDT limit. */
+	.long	0			/* GDT base - filled in by code above. */
+
+idt_48:
+	.word	0			/* IDT limit. */
+	.long	0			/* IDT base. */
+
+xen_kexec_control_code_size:
+	.long	. - xen_relocate_kernel
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQK-00007O-1B; Tue, 20 Nov 2012 15:07:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQH-0008VU-UJ
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:38 +0000
Received: from [85.158.139.211:29068] by server-10.bemta-5.messagelabs.com id
	D0/47-09257-9BC9BA05; Tue, 20 Nov 2012 15:07:37 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!7
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9939 invoked from network); 20 Nov 2012 15:07:31 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:31 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1633949Ab2KTPEx
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:53 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:47 +0100
Message-Id: <1353423893-23125-6-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-5-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-5-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.006529
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 05/11] x86/xen: Register resources required
	by kexec-tools
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Register resources required by kexec-tools.

v2 - suggestions/fixes:
   - change logging level
     (suggested by Konrad Rzeszutek Wilk).

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 arch/x86/xen/kexec.c |  150 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 150 insertions(+), 0 deletions(-)
 create mode 100644 arch/x86/xen/kexec.c

diff --git a/arch/x86/xen/kexec.c b/arch/x86/xen/kexec.c
new file mode 100644
index 0000000..7ec4c45
--- /dev/null
+++ b/arch/x86/xen/kexec.c
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2011 Daniel Kiper
+ * Copyright (c) 2012 Daniel Kiper, Oracle Corporation
+ *
+ * kexec/kdump implementation for Xen was written by Daniel Kiper.
+ * Initial work on it was sponsored by Google under Google Summer
+ * of Code 2011 program and Citrix. Konrad Rzeszutek Wilk from Oracle
+ * was the mentor for this project.
+ *
+ * Some ideas are taken from:
+ *   - native kexec/kdump implementation,
+ *   - kexec/kdump implementation for Xen Linux Kernel Ver. 2.6.18,
+ *   - PV-GRUB.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/kernel.h>
+#include <linux/kexec.h>
+#include <linux/slab.h>
+#include <linux/string.h>
+
+#include <xen/interface/platform.h>
+#include <xen/interface/xen.h>
+#include <xen/xen.h>
+
+#include <asm/xen/hypercall.h>
+
+unsigned long xen_vmcoreinfo_maddr = 0;
+unsigned long xen_vmcoreinfo_max_size = 0;
+
+static int __init xen_init_kexec_resources(void)
+{
+	int rc;
+	static struct resource xen_hypervisor_res = {
+		.name = "Hypervisor code and data",
+		.flags = IORESOURCE_BUSY | IORESOURCE_MEM
+	};
+	struct resource *cpu_res;
+	struct xen_kexec_range xkr;
+	struct xen_platform_op cpuinfo_op;
+	uint32_t cpus, i;
+
+	if (!xen_initial_domain())
+		return 0;
+
+	if (strstr(boot_command_line, "crashkernel="))
+		pr_warn("kexec: Ignoring crashkernel option. "
+			"It should be passed to Xen hypervisor.\n");
+
+	/* Register Crash kernel resource. */
+	xkr.range = KEXEC_RANGE_MA_CRASH;
+	rc = HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &xkr);
+
+	if (rc) {
+		pr_warn("kexec: %s: HYPERVISOR_kexec_op(KEXEC_RANGE_MA_CRASH)"
+			": %i\n", __func__, rc);
+		return rc;
+	}
+
+	if (!xkr.size)
+		return 0;
+
+	crashk_res.start = xkr.start;
+	crashk_res.end = xkr.start + xkr.size - 1;
+	insert_resource(&iomem_resource, &crashk_res);
+
+	/* Register Hypervisor code and data resource. */
+	xkr.range = KEXEC_RANGE_MA_XEN;
+	rc = HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &xkr);
+
+	if (rc) {
+		pr_warn("kexec: %s: HYPERVISOR_kexec_op(KEXEC_RANGE_MA_XEN)"
+			": %i\n", __func__, rc);
+		return rc;
+	}
+
+	xen_hypervisor_res.start = xkr.start;
+	xen_hypervisor_res.end = xkr.start + xkr.size - 1;
+	insert_resource(&iomem_resource, &xen_hypervisor_res);
+
+	/* Determine maximum number of physical CPUs. */
+	cpuinfo_op.cmd = XENPF_get_cpuinfo;
+	cpuinfo_op.u.pcpu_info.xen_cpuid = 0;
+	rc = HYPERVISOR_dom0_op(&cpuinfo_op);
+
+	if (rc) {
+		pr_warn("kexec: %s: HYPERVISOR_dom0_op(): %i\n", __func__, rc);
+		return rc;
+	}
+
+	cpus = cpuinfo_op.u.pcpu_info.max_present + 1;
+
+	/* Register CPUs Crash note resources. */
+	cpu_res = kcalloc(cpus, sizeof(struct resource), GFP_KERNEL);
+
+	if (!cpu_res) {
+		pr_warn("kexec: %s: kcalloc(): %i\n", __func__, -ENOMEM);
+		return -ENOMEM;
+	}
+
+	for (i = 0; i < cpus; ++i) {
+		xkr.range = KEXEC_RANGE_MA_CPU;
+		xkr.nr = i;
+		rc = HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &xkr);
+
+		if (rc) {
+			pr_warn("kexec: %s: cpu: %u: HYPERVISOR_kexec_op"
+				"(KEXEC_RANGE_MA_XEN): %i\n", __func__, i, rc);
+			continue;
+		}
+
+		cpu_res->name = "Crash note";
+		cpu_res->start = xkr.start;
+		cpu_res->end = xkr.start + xkr.size - 1;
+		cpu_res->flags = IORESOURCE_BUSY | IORESOURCE_MEM;
+		insert_resource(&iomem_resource, cpu_res++);
+	}
+
+	/* Get vmcoreinfo address and maximum allowed size. */
+	xkr.range = KEXEC_RANGE_MA_VMCOREINFO;
+	rc = HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &xkr);
+
+	if (rc) {
+		pr_warn("kexec: %s: HYPERVISOR_kexec_op(KEXEC_RANGE_MA_VMCOREINFO)"
+			": %i\n", __func__, rc);
+		return rc;
+	}
+
+	xen_vmcoreinfo_maddr = xkr.start;
+	xen_vmcoreinfo_max_size = xkr.size;
+
+	return 0;
+}
+
+core_initcall(xen_init_kexec_resources);
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQK-00007O-1B; Tue, 20 Nov 2012 15:07:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQH-0008VU-UJ
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:38 +0000
Received: from [85.158.139.211:29068] by server-10.bemta-5.messagelabs.com id
	D0/47-09257-9BC9BA05; Tue, 20 Nov 2012 15:07:37 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!7
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9939 invoked from network); 20 Nov 2012 15:07:31 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:31 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1633949Ab2KTPEx
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:53 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:47 +0100
Message-Id: <1353423893-23125-6-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-5-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-5-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.006529
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 05/11] x86/xen: Register resources required
	by kexec-tools
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Register resources required by kexec-tools.

v2 - suggestions/fixes:
   - change logging level
     (suggested by Konrad Rzeszutek Wilk).

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 arch/x86/xen/kexec.c |  150 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 150 insertions(+), 0 deletions(-)
 create mode 100644 arch/x86/xen/kexec.c

diff --git a/arch/x86/xen/kexec.c b/arch/x86/xen/kexec.c
new file mode 100644
index 0000000..7ec4c45
--- /dev/null
+++ b/arch/x86/xen/kexec.c
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2011 Daniel Kiper
+ * Copyright (c) 2012 Daniel Kiper, Oracle Corporation
+ *
+ * kexec/kdump implementation for Xen was written by Daniel Kiper.
+ * Initial work on it was sponsored by Google under Google Summer
+ * of Code 2011 program and Citrix. Konrad Rzeszutek Wilk from Oracle
+ * was the mentor for this project.
+ *
+ * Some ideas are taken from:
+ *   - native kexec/kdump implementation,
+ *   - kexec/kdump implementation for Xen Linux Kernel Ver. 2.6.18,
+ *   - PV-GRUB.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/kernel.h>
+#include <linux/kexec.h>
+#include <linux/slab.h>
+#include <linux/string.h>
+
+#include <xen/interface/platform.h>
+#include <xen/interface/xen.h>
+#include <xen/xen.h>
+
+#include <asm/xen/hypercall.h>
+
+unsigned long xen_vmcoreinfo_maddr = 0;
+unsigned long xen_vmcoreinfo_max_size = 0;
+
+static int __init xen_init_kexec_resources(void)
+{
+	int rc;
+	static struct resource xen_hypervisor_res = {
+		.name = "Hypervisor code and data",
+		.flags = IORESOURCE_BUSY | IORESOURCE_MEM
+	};
+	struct resource *cpu_res;
+	struct xen_kexec_range xkr;
+	struct xen_platform_op cpuinfo_op;
+	uint32_t cpus, i;
+
+	if (!xen_initial_domain())
+		return 0;
+
+	if (strstr(boot_command_line, "crashkernel="))
+		pr_warn("kexec: Ignoring crashkernel option. "
+			"It should be passed to Xen hypervisor.\n");
+
+	/* Register Crash kernel resource. */
+	xkr.range = KEXEC_RANGE_MA_CRASH;
+	rc = HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &xkr);
+
+	if (rc) {
+		pr_warn("kexec: %s: HYPERVISOR_kexec_op(KEXEC_RANGE_MA_CRASH)"
+			": %i\n", __func__, rc);
+		return rc;
+	}
+
+	if (!xkr.size)
+		return 0;
+
+	crashk_res.start = xkr.start;
+	crashk_res.end = xkr.start + xkr.size - 1;
+	insert_resource(&iomem_resource, &crashk_res);
+
+	/* Register Hypervisor code and data resource. */
+	xkr.range = KEXEC_RANGE_MA_XEN;
+	rc = HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &xkr);
+
+	if (rc) {
+		pr_warn("kexec: %s: HYPERVISOR_kexec_op(KEXEC_RANGE_MA_XEN)"
+			": %i\n", __func__, rc);
+		return rc;
+	}
+
+	xen_hypervisor_res.start = xkr.start;
+	xen_hypervisor_res.end = xkr.start + xkr.size - 1;
+	insert_resource(&iomem_resource, &xen_hypervisor_res);
+
+	/* Determine maximum number of physical CPUs. */
+	cpuinfo_op.cmd = XENPF_get_cpuinfo;
+	cpuinfo_op.u.pcpu_info.xen_cpuid = 0;
+	rc = HYPERVISOR_dom0_op(&cpuinfo_op);
+
+	if (rc) {
+		pr_warn("kexec: %s: HYPERVISOR_dom0_op(): %i\n", __func__, rc);
+		return rc;
+	}
+
+	cpus = cpuinfo_op.u.pcpu_info.max_present + 1;
+
+	/* Register CPUs Crash note resources. */
+	cpu_res = kcalloc(cpus, sizeof(struct resource), GFP_KERNEL);
+
+	if (!cpu_res) {
+		pr_warn("kexec: %s: kcalloc(): %i\n", __func__, -ENOMEM);
+		return -ENOMEM;
+	}
+
+	for (i = 0; i < cpus; ++i) {
+		xkr.range = KEXEC_RANGE_MA_CPU;
+		xkr.nr = i;
+		rc = HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &xkr);
+
+		if (rc) {
+			pr_warn("kexec: %s: cpu: %u: HYPERVISOR_kexec_op"
+				"(KEXEC_RANGE_MA_XEN): %i\n", __func__, i, rc);
+			continue;
+		}
+
+		cpu_res->name = "Crash note";
+		cpu_res->start = xkr.start;
+		cpu_res->end = xkr.start + xkr.size - 1;
+		cpu_res->flags = IORESOURCE_BUSY | IORESOURCE_MEM;
+		insert_resource(&iomem_resource, cpu_res++);
+	}
+
+	/* Get vmcoreinfo address and maximum allowed size. */
+	xkr.range = KEXEC_RANGE_MA_VMCOREINFO;
+	rc = HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &xkr);
+
+	if (rc) {
+		pr_warn("kexec: %s: HYPERVISOR_kexec_op(KEXEC_RANGE_MA_VMCOREINFO)"
+			": %i\n", __func__, rc);
+		return rc;
+	}
+
+	xen_vmcoreinfo_maddr = xkr.start;
+	xen_vmcoreinfo_max_size = xkr.size;
+
+	return 0;
+}
+
+core_initcall(xen_init_kexec_resources);
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQF-0008WH-9k; Tue, 20 Nov 2012 15:07:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQE-0008Vm-4Z
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:34 +0000
Received: from [85.158.139.211:49889] by server-16.bemta-5.messagelabs.com id
	52/38-04786-5BC9BA05; Tue, 20 Nov 2012 15:07:33 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!5
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9859 invoked from network); 20 Nov 2012 15:07:30 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:30 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1633973Ab2KTPEx
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:53 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:48 +0100
Message-Id: <1353423893-23125-7-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-6-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-5-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-6-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.060769
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 06/11] x86/xen: Add i386 kexec/kdump
	implementation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add i386 kexec/kdump implementation.

v2 - suggestions/fixes:
   - allocate transition page table pages below 4 GiB
     (suggested by Jan Beulich).

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 arch/x86/xen/machine_kexec_32.c   |  247 ++++++++++++++++++++++++++++
 arch/x86/xen/relocate_kernel_32.S |  323 +++++++++++++++++++++++++++++++++++++
 2 files changed, 570 insertions(+), 0 deletions(-)
 create mode 100644 arch/x86/xen/machine_kexec_32.c
 create mode 100644 arch/x86/xen/relocate_kernel_32.S

diff --git a/arch/x86/xen/machine_kexec_32.c b/arch/x86/xen/machine_kexec_32.c
new file mode 100644
index 0000000..116c302
--- /dev/null
+++ b/arch/x86/xen/machine_kexec_32.c
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 2011 Daniel Kiper
+ * Copyright (c) 2012 Daniel Kiper, Oracle Corporation
+ *
+ * kexec/kdump implementation for Xen was written by Daniel Kiper.
+ * Initial work on it was sponsored by Google under Google Summer
+ * of Code 2011 program and Citrix. Konrad Rzeszutek Wilk from Oracle
+ * was the mentor for this project.
+ *
+ * Some ideas are taken from:
+ *   - native kexec/kdump implementation,
+ *   - kexec/kdump implementation for Xen Linux Kernel Ver. 2.6.18,
+ *   - PV-GRUB.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/kexec.h>
+#include <linux/mm.h>
+#include <linux/string.h>
+
+#include <xen/xen.h>
+#include <xen/xen-ops.h>
+
+#include <asm/xen/hypercall.h>
+#include <asm/xen/kexec.h>
+#include <asm/xen/page.h>
+
+#define __ma(vaddr)	(virt_to_machine(vaddr).maddr)
+
+static struct page *kimage_alloc_pages(gfp_t gfp_mask,
+					unsigned int order,
+					unsigned long limit)
+{
+	struct page *pages;
+	unsigned int address_bits, i;
+
+	pages = alloc_pages(gfp_mask, order);
+
+	if (!pages)
+		return NULL;
+
+	address_bits = (limit == ULONG_MAX) ? BITS_PER_LONG : ilog2(limit);
+
+	/* Relocate set of pages below given limit. */
+	if (xen_create_contiguous_region((unsigned long)page_address(pages),
+							order, address_bits)) {
+		__free_pages(pages, order);
+		return NULL;
+	}
+
+	BUG_ON(PagePrivate(pages));
+
+	pages->mapping = NULL;
+	set_page_private(pages, order);
+
+	for (i = 0; i < (1 << order); ++i)
+		SetPageReserved(pages + i);
+
+	return pages;
+}
+
+static void kimage_free_pages(struct page *page)
+{
+	unsigned int i, order;
+
+	order = page_private(page);
+
+	for (i = 0; i < (1 << order); ++i)
+		ClearPageReserved(page + i);
+
+	xen_destroy_contiguous_region((unsigned long)page_address(page), order);
+	__free_pages(page, order);
+}
+
+static unsigned long xen_page_to_mfn(struct page *page)
+{
+	return pfn_to_mfn(page_to_pfn(page));
+}
+
+static struct page *xen_mfn_to_page(unsigned long mfn)
+{
+	return pfn_to_page(mfn_to_pfn(mfn));
+}
+
+static unsigned long xen_virt_to_machine(volatile void *address)
+{
+	return virt_to_machine(address).maddr;
+}
+
+static void *xen_machine_to_virt(unsigned long address)
+{
+	return phys_to_virt(machine_to_phys(XMADDR(address)).paddr);
+}
+
+static void *alloc_pgtable_page(struct kimage *image)
+{
+	struct page *page;
+
+	page = kimage_alloc_control_pages(image, 0);
+
+	if (!page || !page_address(page))
+		return NULL;
+
+	memset(page_address(page), 0, PAGE_SIZE);
+
+	return page_address(page);
+}
+
+static int alloc_transition_pgtable(struct kimage *image)
+{
+	image->arch.pgd = alloc_pgtable_page(image);
+
+	if (!image->arch.pgd)
+		return -ENOMEM;
+
+	image->arch.pmd0 = alloc_pgtable_page(image);
+
+	if (!image->arch.pmd0)
+		return -ENOMEM;
+
+	image->arch.pmd1 = alloc_pgtable_page(image);
+
+	if (!image->arch.pmd1)
+		return -ENOMEM;
+
+	image->arch.pte0 = alloc_pgtable_page(image);
+
+	if (!image->arch.pte0)
+		return -ENOMEM;
+
+	image->arch.pte1 = alloc_pgtable_page(image);
+
+	if (!image->arch.pte1)
+		return -ENOMEM;
+
+	return 0;
+}
+
+static int machine_xen_kexec_prepare(struct kimage *image)
+{
+#ifdef CONFIG_KEXEC_JUMP
+	if (image->preserve_context) {
+		pr_info_once("kexec: Context preservation is not "
+				"supported in Xen domains.\n");
+		return -ENOSYS;
+	}
+#endif
+
+	return alloc_transition_pgtable(image);
+}
+
+static int machine_xen_kexec_load(struct kimage *image)
+{
+	void *control_page;
+	struct xen_kexec_load xkl = {};
+
+	/* Image is unloaded, nothing to do. */
+	if (!image)
+		return 0;
+
+	control_page = page_address(image->control_code_page);
+	memcpy(control_page, xen_relocate_kernel, xen_kexec_control_code_size);
+
+	xkl.type = image->type;
+	xkl.image.page_list[XK_MA_CONTROL_PAGE] = __ma(control_page);
+	xkl.image.page_list[XK_MA_TABLE_PAGE] = 0; /* Unused. */
+	xkl.image.page_list[XK_MA_PGD_PAGE] = __ma(image->arch.pgd);
+	xkl.image.page_list[XK_MA_PUD0_PAGE] = 0; /* Unused. */
+	xkl.image.page_list[XK_MA_PUD1_PAGE] = 0; /* Unused. */
+	xkl.image.page_list[XK_MA_PMD0_PAGE] = __ma(image->arch.pmd0);
+	xkl.image.page_list[XK_MA_PMD1_PAGE] = __ma(image->arch.pmd1);
+	xkl.image.page_list[XK_MA_PTE0_PAGE] = __ma(image->arch.pte0);
+	xkl.image.page_list[XK_MA_PTE1_PAGE] = __ma(image->arch.pte1);
+	xkl.image.indirection_page = image->head;
+	xkl.image.start_address = image->start;
+
+	return HYPERVISOR_kexec_op(KEXEC_CMD_kexec_load, &xkl);
+}
+
+static void machine_xen_kexec_cleanup(struct kimage *image)
+{
+}
+
+static void machine_xen_kexec_unload(struct kimage *image)
+{
+	int rc;
+	struct xen_kexec_load xkl = {};
+
+	if (!image)
+		return;
+
+	xkl.type = image->type;
+	rc = HYPERVISOR_kexec_op(KEXEC_CMD_kexec_unload, &xkl);
+
+	WARN(rc, "kexec: %s: HYPERVISOR_kexec_op(): %i\n", __func__, rc);
+}
+
+static void machine_xen_kexec_shutdown(void)
+{
+}
+
+static void machine_xen_kexec(struct kimage *image)
+{
+	int rc;
+	struct xen_kexec_exec xke = {};
+
+	xke.type = image->type;
+	rc = HYPERVISOR_kexec_op(KEXEC_CMD_kexec, &xke);
+
+	pr_emerg("kexec: %s: HYPERVISOR_kexec_op(): %i\n", __func__, rc);
+	BUG();
+}
+
+void __init xen_init_kexec_ops(void)
+{
+	if (!xen_initial_domain())
+		return;
+
+	kexec_ops.crash_alloc_temp_store = true;
+	kexec_ops.kimage_alloc_pages = kimage_alloc_pages;
+	kexec_ops.kimage_free_pages = kimage_free_pages;
+	kexec_ops.page_to_pfn = xen_page_to_mfn;
+	kexec_ops.pfn_to_page = xen_mfn_to_page;
+	kexec_ops.virt_to_phys = xen_virt_to_machine;
+	kexec_ops.phys_to_virt = xen_machine_to_virt;
+	kexec_ops.machine_kexec_prepare = machine_xen_kexec_prepare;
+	kexec_ops.machine_kexec_load = machine_xen_kexec_load;
+	kexec_ops.machine_kexec_cleanup = machine_xen_kexec_cleanup;
+	kexec_ops.machine_kexec_unload = machine_xen_kexec_unload;
+	kexec_ops.machine_kexec_shutdown = machine_xen_kexec_shutdown;
+	kexec_ops.machine_kexec = machine_xen_kexec;
+}
diff --git a/arch/x86/xen/relocate_kernel_32.S b/arch/x86/xen/relocate_kernel_32.S
new file mode 100644
index 0000000..0e81830
--- /dev/null
+++ b/arch/x86/xen/relocate_kernel_32.S
@@ -0,0 +1,323 @@
+/*
+ * Copyright (c) 2002-2005 Eric Biederman <ebiederm@xmission.com>
+ * Copyright (c) 2011 Daniel Kiper
+ * Copyright (c) 2012 Daniel Kiper, Oracle Corporation
+ *
+ * kexec/kdump implementation for Xen was written by Daniel Kiper.
+ * Initial work on it was sponsored by Google under Google Summer
+ * of Code 2011 program and Citrix. Konrad Rzeszutek Wilk from Oracle
+ * was the mentor for this project.
+ *
+ * Some ideas are taken from:
+ *   - native kexec/kdump implementation,
+ *   - kexec/kdump implementation for Xen Linux Kernel Ver. 2.6.18,
+ *   - PV-GRUB.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either veesion 2 of the License, or
+ * (at your option) any later veesion.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <asm/cache.h>
+#include <asm/page_types.h>
+#include <asm/pgtable_types.h>
+#include <asm/processor-flags.h>
+
+#include <asm/xen/kexec.h>
+
+#define ARG_INDIRECTION_PAGE	0x4
+#define ARG_PAGE_LIST		0x8
+#define ARG_START_ADDRESS	0xc
+
+#define PTR(x)	(x << 2)
+
+	.text
+	.align	PAGE_SIZE
+	.globl	xen_kexec_control_code_size, xen_relocate_kernel
+
+xen_relocate_kernel:
+	/*
+	 * Must be relocatable PIC code callable as a C function.
+	 *
+	 * This function is called by Xen but here hypervisor is dead.
+	 * We are playing on bare metal.
+	 *
+	 * Every machine address passed to this function through
+	 * page_list (e.g. XK_MA_CONTROL_PAGE) is established
+	 * by dom0 during kexec load phase.
+	 *
+	 * Every virtual address passed to this function through page_list
+	 * (e.g. XK_VA_CONTROL_PAGE) is established by hypervisor during
+	 * HYPERVISOR_kexec_op(KEXEC_CMD_kexec_load) hypercall.
+	 *
+	 * 0x4(%esp) - indirection_page,
+	 * 0x8(%esp) - page_list,
+	 * 0xc(%esp) - start_address,
+	 * 0x10(%esp) - cpu_has_pae (ignored),
+	 * 0x14(%esp) - preserve_context (ignored).
+	 */
+
+	/* Zero out flags, and disable interrupts. */
+	pushl	$0
+	popfl
+
+	/* Get page_list address. */
+	movl	ARG_PAGE_LIST(%esp), %esi
+
+	/*
+	 * Map the control page at its virtual address
+	 * in transition page table.
+	 */
+	movl	PTR(XK_VA_CONTROL_PAGE)(%esi), %eax
+
+	/* Get PGD address and PGD entry index. */
+	movl	PTR(XK_VA_PGD_PAGE)(%esi), %ebx
+	movl	%eax, %ecx
+	shrl	$PGDIR_SHIFT, %ecx
+	andl	$(PTRS_PER_PGD - 1), %ecx
+
+	/* Fill PGD entry with PMD0 reference. */
+	movl	PTR(XK_MA_PMD0_PAGE)(%esi), %edx
+	orl	$_PAGE_PRESENT, %edx
+	movl	%edx, (%ebx, %ecx, 8)
+
+	/* Get PMD0 address and PMD0 entry index. */
+	movl	PTR(XK_VA_PMD0_PAGE)(%esi), %ebx
+	movl	%eax, %ecx
+	shrl	$PMD_SHIFT, %ecx
+	andl	$(PTRS_PER_PMD - 1), %ecx
+
+	/* Fill PMD0 entry with PTE0 reference. */
+	movl	PTR(XK_MA_PTE0_PAGE)(%esi), %edx
+	orl	$_KERNPG_TABLE, %edx
+	movl	%edx, (%ebx, %ecx, 8)
+
+	/* Get PTE0 address and PTE0 entry index. */
+	movl	PTR(XK_VA_PTE0_PAGE)(%esi), %ebx
+	movl	%eax, %ecx
+	shrl	$PAGE_SHIFT, %ecx
+	andl	$(PTRS_PER_PTE - 1), %ecx
+
+	/* Fill PTE0 entry with control page reference. */
+	movl	PTR(XK_MA_CONTROL_PAGE)(%esi), %edx
+	orl	$__PAGE_KERNEL_EXEC, %edx
+	movl	%edx, (%ebx, %ecx, 8)
+
+	/*
+	 * Identity map the control page at its machine address
+	 * in transition page table.
+	 */
+	movl	PTR(XK_MA_CONTROL_PAGE)(%esi), %eax
+
+	/* Get PGD address and PGD entry index. */
+	movl	PTR(XK_VA_PGD_PAGE)(%esi), %ebx
+	movl	%eax, %ecx
+	shrl	$PGDIR_SHIFT, %ecx
+	andl	$(PTRS_PER_PGD - 1), %ecx
+
+	/* Fill PGD entry with PMD1 reference. */
+	movl	PTR(XK_MA_PMD1_PAGE)(%esi), %edx
+	orl	$_PAGE_PRESENT, %edx
+	movl	%edx, (%ebx, %ecx, 8)
+
+	/* Get PMD1 address and PMD1 entry index. */
+	movl	PTR(XK_VA_PMD1_PAGE)(%esi), %ebx
+	movl	%eax, %ecx
+	shrl	$PMD_SHIFT, %ecx
+	andl	$(PTRS_PER_PMD - 1), %ecx
+
+	/* Fill PMD1 entry with PTE1 reference. */
+	movl	PTR(XK_MA_PTE1_PAGE)(%esi), %edx
+	orl	$_KERNPG_TABLE, %edx
+	movl	%edx, (%ebx, %ecx, 8)
+
+	/* Get PTE1 address and PTE1 entry index. */
+	movl	PTR(XK_VA_PTE1_PAGE)(%esi), %ebx
+	movl	%eax, %ecx
+	shrl	$PAGE_SHIFT, %ecx
+	andl	$(PTRS_PER_PTE - 1), %ecx
+
+	/* Fill PTE1 entry with control page reference. */
+	movl	PTR(XK_MA_CONTROL_PAGE)(%esi), %edx
+	orl	$__PAGE_KERNEL_EXEC, %edx
+	movl	%edx, (%ebx, %ecx, 8)
+
+	/*
+	 * Get machine address of control page now.
+	 * This is impossible after page table switch.
+	 */
+	movl	PTR(XK_MA_CONTROL_PAGE)(%esi), %ebx
+
+	/* Get machine address of transition page table now too. */
+	movl	PTR(XK_MA_PGD_PAGE)(%esi), %ecx
+
+	/* Get start_address too. */
+	movl	ARG_START_ADDRESS(%esp), %edx
+
+	/* Get indirection_page address too. */
+	movl	ARG_INDIRECTION_PAGE(%esp), %edi
+
+	/* Switch to transition page table. */
+	movl	%ecx, %cr3
+
+	/* Load IDT. */
+	lidtl	(idt_48 - xen_relocate_kernel)(%ebx)
+
+	/* Load GDT. */
+	leal	(gdt - xen_relocate_kernel)(%ebx), %eax
+	movl	%eax, (gdt_48 - xen_relocate_kernel + 2)(%ebx)
+	lgdtl	(gdt_48 - xen_relocate_kernel)(%ebx)
+
+	/* Load data segment registers. */
+	movl	$(gdt_ds - gdt), %eax
+	movl	%eax, %ds
+	movl	%eax, %es
+	movl	%eax, %fs
+	movl	%eax, %gs
+	movl	%eax, %ss
+
+	/* Setup a new stack at the end of machine address of control page. */
+	leal	PAGE_SIZE(%ebx), %esp
+
+	/* Store start_address on the stack. */
+	pushl   %edx
+
+	/* Jump to identity mapped page. */
+	pushl	$0
+	pushl	$(gdt_cs - gdt)
+	addl	$(identity_mapped - xen_relocate_kernel), %ebx
+	pushl	%ebx
+	iretl
+
+identity_mapped:
+	/*
+	 * Set %cr0 to a known state:
+	 *   - disable alignment check,
+	 *   - disable floating point emulation,
+	 *   - disable paging,
+	 *   - no task switch,
+	 *   - disable write protect,
+	 *   - enable protected mode.
+	 */
+	movl	%cr0, %eax
+	andl	$~(X86_CR0_AM | X86_CR0_EM | X86_CR0_PG | X86_CR0_TS | X86_CR0_WP), %eax
+	orl	$(X86_CR0_PE), %eax
+	movl	%eax, %cr0
+
+	/* Set %cr4 to a known state. */
+	xorl	%eax, %eax
+	movl	%eax, %cr4
+
+	jmp	1f
+
+1:
+	/* Flush the TLB (needed?). */
+	movl	%eax, %cr3
+
+	/* Do the copies. */
+	movl	%edi, %ecx	/* Put the indirection_page in %ecx. */
+	xorl	%edi, %edi
+	xorl	%esi, %esi
+	jmp	1f
+
+0:
+	/*
+	 * Top, read another doubleword from the indirection page.
+	 * Indirection page is an array which contains source
+	 * and destination address pairs. If all pairs could
+	 * not fit in one page then at the end of given
+	 * indirection page is pointer to next one.
+	 * Copy is stopped when done indicator
+	 * is found in indirection page.
+	 */
+	movl	(%ebx), %ecx
+	addl	$4, %ebx
+
+1:
+	testl	$0x1, %ecx	/* Is it a destination page? */
+	jz	2f
+
+	movl	%ecx, %edi
+	andl	$PAGE_MASK, %edi
+	jmp	0b
+
+2:
+	testl	$0x2, %ecx	/* Is it an indirection page? */
+	jz	2f
+
+	movl	%ecx, %ebx
+	andl	$PAGE_MASK, %ebx
+	jmp	0b
+
+2:
+	testl	$0x4, %ecx	/* Is it the done indicator? */
+	jz	2f
+	jmp	3f
+
+2:
+	testl	$0x8, %ecx	/* Is it the source indicator? */
+	jz	0b		/* Ignore it otherwise. */
+
+	movl	%ecx, %esi
+	andl	$PAGE_MASK, %esi
+	movl	$1024, %ecx
+
+	/* Copy page. */
+	rep	movsl
+	jmp	0b
+
+3:
+	/*
+	 * To be certain of avoiding problems with self-modifying code
+	 * I need to execute a serializing instruction here.
+	 * So I flush the TLB by reloading %cr3 here, it's handy,
+	 * and not processor dependent.
+	 */
+	xorl	%eax, %eax
+	movl	%eax, %cr3
+
+	/*
+	 * Set all of the registers to known values.
+	 * Leave %esp alone.
+	 */
+	xorl	%ebx, %ebx
+	xorl    %ecx, %ecx
+	xorl    %edx, %edx
+	xorl    %esi, %esi
+	xorl    %edi, %edi
+	xorl    %ebp, %ebp
+
+	/* Jump to start_address. */
+	retl
+
+	.align	L1_CACHE_BYTES
+
+gdt:
+	.quad	0x0000000000000000	/* NULL descriptor. */
+
+gdt_cs:
+	.quad	0x00cf9a000000ffff	/* 4 GiB code segment at 0x00000000. */
+
+gdt_ds:
+	.quad	0x00cf92000000ffff	/* 4 GiB data segment at 0x00000000. */
+gdt_end:
+
+gdt_48:
+	.word	gdt_end - gdt - 1	/* GDT limit. */
+	.long	0			/* GDT base - filled in by code above. */
+
+idt_48:
+	.word	0			/* IDT limit. */
+	.long	0			/* IDT base. */
+
+xen_kexec_control_code_size:
+	.long	. - xen_relocate_kernel
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQL-00008a-9O; Tue, 20 Nov 2012 15:07:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQI-00005q-G7
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:38 +0000
Received: from [85.158.139.211:16058] by server-14.bemta-5.messagelabs.com id
	2F/E6-21768-9BC9BA05; Tue, 20 Nov 2012 15:07:37 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!9
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10006 invoked from network); 20 Nov 2012 15:07:31 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:31 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1634384Ab2KTPEy
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:54 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:52 +0100
Message-Id: <1353423893-23125-11-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-10-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-5-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-6-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-7-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-8-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-9-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-10-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.193071
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 10/11] drivers/xen: Export vmcoreinfo through
	sysfs
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Export vmcoreinfo through sysfs.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 drivers/xen/sys-hypervisor.c |   42 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 41 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c
index 96453f8..6edc289 100644
--- a/drivers/xen/sys-hypervisor.c
+++ b/drivers/xen/sys-hypervisor.c
@@ -368,6 +368,41 @@ static void xen_properties_destroy(void)
 	sysfs_remove_group(hypervisor_kobj, &xen_properties_group);
 }
 
+#ifdef CONFIG_KEXEC
+static ssize_t vmcoreinfo_show(struct hyp_sysfs_attr *attr, char *buffer)
+{
+	return sprintf(buffer, "%lx %lx\n", xen_vmcoreinfo_maddr,
+						xen_vmcoreinfo_max_size);
+}
+
+HYPERVISOR_ATTR_RO(vmcoreinfo);
+
+static int __init xen_vmcoreinfo_init(void)
+{
+	if (!xen_vmcoreinfo_max_size)
+		return 0;
+
+	return sysfs_create_file(hypervisor_kobj, &vmcoreinfo_attr.attr);
+}
+
+static void xen_vmcoreinfo_destroy(void)
+{
+	if (!xen_vmcoreinfo_max_size)
+		return;
+
+	sysfs_remove_file(hypervisor_kobj, &vmcoreinfo_attr.attr);
+}
+#else
+static int __init xen_vmcoreinfo_init(void)
+{
+	return 0;
+}
+
+static void xen_vmcoreinfo_destroy(void)
+{
+}
+#endif
+
 static int __init hyper_sysfs_init(void)
 {
 	int ret;
@@ -390,9 +425,14 @@ static int __init hyper_sysfs_init(void)
 	ret = xen_properties_init();
 	if (ret)
 		goto prop_out;
+	ret = xen_vmcoreinfo_init();
+	if (ret)
+		goto vmcoreinfo_out;
 
 	goto out;
 
+vmcoreinfo_out:
+	xen_properties_destroy();
 prop_out:
 	xen_sysfs_uuid_destroy();
 uuid_out:
@@ -407,12 +447,12 @@ out:
 
 static void __exit hyper_sysfs_exit(void)
 {
+	xen_vmcoreinfo_destroy();
 	xen_properties_destroy();
 	xen_compilation_destroy();
 	xen_sysfs_uuid_destroy();
 	xen_sysfs_version_destroy();
 	xen_sysfs_type_destroy();
-
 }
 module_init(hyper_sysfs_init);
 module_exit(hyper_sysfs_exit);
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQL-00008a-9O; Tue, 20 Nov 2012 15:07:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQI-00005q-G7
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:38 +0000
Received: from [85.158.139.211:16058] by server-14.bemta-5.messagelabs.com id
	2F/E6-21768-9BC9BA05; Tue, 20 Nov 2012 15:07:37 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!9
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10006 invoked from network); 20 Nov 2012 15:07:31 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:31 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1634384Ab2KTPEy
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:54 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:52 +0100
Message-Id: <1353423893-23125-11-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-10-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-5-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-6-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-7-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-8-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-9-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-10-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.193071
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 10/11] drivers/xen: Export vmcoreinfo through
	sysfs
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Export vmcoreinfo through sysfs.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 drivers/xen/sys-hypervisor.c |   42 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 41 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c
index 96453f8..6edc289 100644
--- a/drivers/xen/sys-hypervisor.c
+++ b/drivers/xen/sys-hypervisor.c
@@ -368,6 +368,41 @@ static void xen_properties_destroy(void)
 	sysfs_remove_group(hypervisor_kobj, &xen_properties_group);
 }
 
+#ifdef CONFIG_KEXEC
+static ssize_t vmcoreinfo_show(struct hyp_sysfs_attr *attr, char *buffer)
+{
+	return sprintf(buffer, "%lx %lx\n", xen_vmcoreinfo_maddr,
+						xen_vmcoreinfo_max_size);
+}
+
+HYPERVISOR_ATTR_RO(vmcoreinfo);
+
+static int __init xen_vmcoreinfo_init(void)
+{
+	if (!xen_vmcoreinfo_max_size)
+		return 0;
+
+	return sysfs_create_file(hypervisor_kobj, &vmcoreinfo_attr.attr);
+}
+
+static void xen_vmcoreinfo_destroy(void)
+{
+	if (!xen_vmcoreinfo_max_size)
+		return;
+
+	sysfs_remove_file(hypervisor_kobj, &vmcoreinfo_attr.attr);
+}
+#else
+static int __init xen_vmcoreinfo_init(void)
+{
+	return 0;
+}
+
+static void xen_vmcoreinfo_destroy(void)
+{
+}
+#endif
+
 static int __init hyper_sysfs_init(void)
 {
 	int ret;
@@ -390,9 +425,14 @@ static int __init hyper_sysfs_init(void)
 	ret = xen_properties_init();
 	if (ret)
 		goto prop_out;
+	ret = xen_vmcoreinfo_init();
+	if (ret)
+		goto vmcoreinfo_out;
 
 	goto out;
 
+vmcoreinfo_out:
+	xen_properties_destroy();
 prop_out:
 	xen_sysfs_uuid_destroy();
 uuid_out:
@@ -407,12 +447,12 @@ out:
 
 static void __exit hyper_sysfs_exit(void)
 {
+	xen_vmcoreinfo_destroy();
 	xen_properties_destroy();
 	xen_compilation_destroy();
 	xen_sysfs_uuid_destroy();
 	xen_sysfs_version_destroy();
 	xen_sysfs_type_destroy();
-
 }
 module_init(hyper_sysfs_init);
 module_exit(hyper_sysfs_exit);
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQK-00008K-S9; Tue, 20 Nov 2012 15:07:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQI-00005h-79
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:38 +0000
Received: from [85.158.139.211:16018] by server-7.bemta-5.messagelabs.com id
	20/4B-23096-9BC9BA05; Tue, 20 Nov 2012 15:07:37 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!12
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10056 invoked from network); 20 Nov 2012 15:07:32 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:32 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1633987Ab2KTPEy
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:54 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:49 +0100
Message-Id: <1353423893-23125-8-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-7-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-5-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-6-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-7-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.089320
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 07/11] x86/xen: Add x86_64 kexec/kdump
	implementation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add x86_64 kexec/kdump implementation.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 arch/x86/xen/machine_kexec_64.c   |  302 ++++++++++++++++++++++++++++++++++++
 arch/x86/xen/relocate_kernel_64.S |  309 +++++++++++++++++++++++++++++++++++++
 2 files changed, 611 insertions(+), 0 deletions(-)
 create mode 100644 arch/x86/xen/machine_kexec_64.c
 create mode 100644 arch/x86/xen/relocate_kernel_64.S

diff --git a/arch/x86/xen/machine_kexec_64.c b/arch/x86/xen/machine_kexec_64.c
new file mode 100644
index 0000000..a2cf0c8
--- /dev/null
+++ b/arch/x86/xen/machine_kexec_64.c
@@ -0,0 +1,302 @@
+/*
+ * Copyright (c) 2011 Daniel Kiper
+ * Copyright (c) 2012 Daniel Kiper, Oracle Corporation
+ *
+ * kexec/kdump implementation for Xen was written by Daniel Kiper.
+ * Initial work on it was sponsored by Google under Google Summer
+ * of Code 2011 program and Citrix. Konrad Rzeszutek Wilk from Oracle
+ * was the mentor for this project.
+ *
+ * Some ideas are taken from:
+ *   - native kexec/kdump implementation,
+ *   - kexec/kdump implementation for Xen Linux Kernel Ver. 2.6.18,
+ *   - PV-GRUB.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/kexec.h>
+#include <linux/mm.h>
+#include <linux/string.h>
+
+#include <xen/interface/memory.h>
+#include <xen/xen.h>
+
+#include <asm/xen/hypercall.h>
+#include <asm/xen/kexec.h>
+#include <asm/xen/page.h>
+
+#define __ma(vaddr)	(virt_to_machine(vaddr).maddr)
+
+static unsigned long xen_page_to_mfn(struct page *page)
+{
+	return pfn_to_mfn(page_to_pfn(page));
+}
+
+static struct page *xen_mfn_to_page(unsigned long mfn)
+{
+	return pfn_to_page(mfn_to_pfn(mfn));
+}
+
+static unsigned long xen_virt_to_machine(volatile void *address)
+{
+	return virt_to_machine(address).maddr;
+}
+
+static void *xen_machine_to_virt(unsigned long address)
+{
+	return phys_to_virt(machine_to_phys(XMADDR(address)).paddr);
+}
+
+static void init_level2_page(pmd_t *pmd, unsigned long addr)
+{
+	unsigned long end_addr = addr + PUD_SIZE;
+
+	while (addr < end_addr) {
+		native_set_pmd(pmd++, native_make_pmd(addr | __PAGE_KERNEL_LARGE_EXEC));
+		addr += PMD_SIZE;
+	}
+}
+
+static int init_level3_page(struct kimage *image, pud_t *pud,
+				unsigned long addr, unsigned long last_addr)
+{
+	pmd_t *pmd;
+	struct page *page;
+	unsigned long end_addr = addr + PGDIR_SIZE;
+
+	while ((addr < last_addr) && (addr < end_addr)) {
+		page = kimage_alloc_control_pages(image, 0);
+
+		if (!page)
+			return -ENOMEM;
+
+		pmd = page_address(page);
+		init_level2_page(pmd, addr);
+		native_set_pud(pud++, native_make_pud(__ma(pmd) | _KERNPG_TABLE));
+		addr += PUD_SIZE;
+	}
+
+	/* Clear the unused entries. */
+	while (addr < end_addr) {
+		native_pud_clear(pud++);
+		addr += PUD_SIZE;
+	}
+
+	return 0;
+}
+
+
+static int init_level4_page(struct kimage *image, pgd_t *pgd,
+				unsigned long addr, unsigned long last_addr)
+{
+	int rc;
+	pud_t *pud;
+	struct page *page;
+	unsigned long end_addr = addr + PTRS_PER_PGD * PGDIR_SIZE;
+
+	while ((addr < last_addr) && (addr < end_addr)) {
+		page = kimage_alloc_control_pages(image, 0);
+
+		if (!page)
+			return -ENOMEM;
+
+		pud = page_address(page);
+		rc = init_level3_page(image, pud, addr, last_addr);
+
+		if (rc)
+			return rc;
+
+		native_set_pgd(pgd++, native_make_pgd(__ma(pud) | _KERNPG_TABLE));
+		addr += PGDIR_SIZE;
+	}
+
+	/* Clear the unused entries. */
+	while (addr < end_addr) {
+		native_pgd_clear(pgd++);
+		addr += PGDIR_SIZE;
+	}
+
+	return 0;
+}
+
+static void free_transition_pgtable(struct kimage *image)
+{
+	free_page((unsigned long)image->arch.pgd);
+	free_page((unsigned long)image->arch.pud0);
+	free_page((unsigned long)image->arch.pud1);
+	free_page((unsigned long)image->arch.pmd0);
+	free_page((unsigned long)image->arch.pmd1);
+	free_page((unsigned long)image->arch.pte0);
+	free_page((unsigned long)image->arch.pte1);
+}
+
+static int alloc_transition_pgtable(struct kimage *image)
+{
+	image->arch.pgd = (pgd_t *)get_zeroed_page(GFP_KERNEL);
+
+	if (!image->arch.pgd)
+		goto err;
+
+	image->arch.pud0 = (pud_t *)get_zeroed_page(GFP_KERNEL);
+
+	if (!image->arch.pud0)
+		goto err;
+
+	image->arch.pud1 = (pud_t *)get_zeroed_page(GFP_KERNEL);
+
+	if (!image->arch.pud1)
+		goto err;
+
+	image->arch.pmd0 = (pmd_t *)get_zeroed_page(GFP_KERNEL);
+
+	if (!image->arch.pmd0)
+		goto err;
+
+	image->arch.pmd1 = (pmd_t *)get_zeroed_page(GFP_KERNEL);
+
+	if (!image->arch.pmd1)
+		goto err;
+
+	image->arch.pte0 = (pte_t *)get_zeroed_page(GFP_KERNEL);
+
+	if (!image->arch.pte0)
+		goto err;
+
+	image->arch.pte1 = (pte_t *)get_zeroed_page(GFP_KERNEL);
+
+	if (!image->arch.pte1)
+		goto err;
+
+	return 0;
+
+err:
+	free_transition_pgtable(image);
+
+	return -ENOMEM;
+}
+
+static int init_pgtable(struct kimage *image, pgd_t *pgd)
+{
+	int rc;
+	unsigned long max_mfn;
+
+	max_mfn = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL);
+
+	rc = init_level4_page(image, pgd, 0, PFN_PHYS(max_mfn));
+
+	if (rc)
+		return rc;
+
+	return alloc_transition_pgtable(image);
+}
+
+static int machine_xen_kexec_prepare(struct kimage *image)
+{
+#ifdef CONFIG_KEXEC_JUMP
+	if (image->preserve_context) {
+		pr_info_once("kexec: Context preservation is not "
+				"supported in Xen domains.\n");
+		return -ENOSYS;
+	}
+#endif
+
+	return init_pgtable(image, page_address(image->control_code_page));
+}
+
+static int machine_xen_kexec_load(struct kimage *image)
+{
+	void *control_page, *table_page;
+	struct xen_kexec_load xkl = {};
+
+	/* Image is unloaded, nothing to do. */
+	if (!image)
+		return 0;
+
+	table_page = page_address(image->control_code_page);
+	control_page = table_page + PAGE_SIZE;
+
+	memcpy(control_page, xen_relocate_kernel, xen_kexec_control_code_size);
+
+	xkl.type = image->type;
+	xkl.image.page_list[XK_MA_CONTROL_PAGE] = __ma(control_page);
+	xkl.image.page_list[XK_MA_TABLE_PAGE] = __ma(table_page);
+	xkl.image.page_list[XK_MA_PGD_PAGE] = __ma(image->arch.pgd);
+	xkl.image.page_list[XK_MA_PUD0_PAGE] = __ma(image->arch.pud0);
+	xkl.image.page_list[XK_MA_PUD1_PAGE] = __ma(image->arch.pud1);
+	xkl.image.page_list[XK_MA_PMD0_PAGE] = __ma(image->arch.pmd0);
+	xkl.image.page_list[XK_MA_PMD1_PAGE] = __ma(image->arch.pmd1);
+	xkl.image.page_list[XK_MA_PTE0_PAGE] = __ma(image->arch.pte0);
+	xkl.image.page_list[XK_MA_PTE1_PAGE] = __ma(image->arch.pte1);
+	xkl.image.indirection_page = image->head;
+	xkl.image.start_address = image->start;
+
+	return HYPERVISOR_kexec_op(KEXEC_CMD_kexec_load, &xkl);
+}
+
+static void machine_xen_kexec_cleanup(struct kimage *image)
+{
+	free_transition_pgtable(image);
+}
+
+static void machine_xen_kexec_unload(struct kimage *image)
+{
+	int rc;
+	struct xen_kexec_load xkl = {};
+
+	if (!image)
+		return;
+
+	xkl.type = image->type;
+	rc = HYPERVISOR_kexec_op(KEXEC_CMD_kexec_unload, &xkl);
+
+	WARN(rc, "kexec: %s: HYPERVISOR_kexec_op(): %i\n", __func__, rc);
+}
+
+static void machine_xen_kexec_shutdown(void)
+{
+}
+
+static void machine_xen_kexec(struct kimage *image)
+{
+	int rc;
+	struct xen_kexec_exec xke = {};
+
+	xke.type = image->type;
+	rc = HYPERVISOR_kexec_op(KEXEC_CMD_kexec, &xke);
+
+	pr_emerg("kexec: %s: HYPERVISOR_kexec_op(): %i\n", __func__, rc);
+	BUG();
+}
+
+void __init xen_init_kexec_ops(void)
+{
+	if (!xen_initial_domain())
+		return;
+
+	kexec_ops.crash_alloc_temp_store = true;
+	kexec_ops.page_to_pfn = xen_page_to_mfn;
+	kexec_ops.pfn_to_page = xen_mfn_to_page;
+	kexec_ops.virt_to_phys = xen_virt_to_machine;
+	kexec_ops.phys_to_virt = xen_machine_to_virt;
+	kexec_ops.machine_kexec_prepare = machine_xen_kexec_prepare;
+	kexec_ops.machine_kexec_load = machine_xen_kexec_load;
+	kexec_ops.machine_kexec_cleanup = machine_xen_kexec_cleanup;
+	kexec_ops.machine_kexec_unload = machine_xen_kexec_unload;
+	kexec_ops.machine_kexec_shutdown = machine_xen_kexec_shutdown;
+	kexec_ops.machine_kexec = machine_xen_kexec;
+}
diff --git a/arch/x86/xen/relocate_kernel_64.S b/arch/x86/xen/relocate_kernel_64.S
new file mode 100644
index 0000000..8f641f1
--- /dev/null
+++ b/arch/x86/xen/relocate_kernel_64.S
@@ -0,0 +1,309 @@
+/*
+ * Copyright (c) 2002-2005 Eric Biederman <ebiederm@xmission.com>
+ * Copyright (c) 2011 Daniel Kiper
+ * Copyright (c) 2012 Daniel Kiper, Oracle Corporation
+ *
+ * kexec/kdump implementation for Xen was written by Daniel Kiper.
+ * Initial work on it was sponsored by Google under Google Summer
+ * of Code 2011 program and Citrix. Konrad Rzeszutek Wilk from Oracle
+ * was the mentor for this project.
+ *
+ * Some ideas are taken from:
+ *   - native kexec/kdump implementation,
+ *   - kexec/kdump implementation for Xen Linux Kernel Ver. 2.6.18,
+ *   - PV-GRUB.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <asm/page_types.h>
+#include <asm/pgtable_types.h>
+#include <asm/processor-flags.h>
+
+#include <asm/xen/kexec.h>
+
+#define PTR(x)	(x << 3)
+
+	.text
+	.code64
+	.globl	xen_kexec_control_code_size, xen_relocate_kernel
+
+xen_relocate_kernel:
+	/*
+	 * Must be relocatable PIC code callable as a C function.
+	 *
+	 * This function is called by Xen but here hypervisor is dead.
+	 * We are playing on bare metal.
+	 *
+	 * Every machine address passed to this function through
+	 * page_list (e.g. XK_MA_CONTROL_PAGE) is established
+	 * by dom0 during kexec load phase.
+	 *
+	 * Every virtual address passed to this function through page_list
+	 * (e.g. XK_VA_CONTROL_PAGE) is established by hypervisor during
+	 * HYPERVISOR_kexec_op(KEXEC_CMD_kexec_load) hypercall.
+	 *
+	 * %rdi - indirection_page,
+	 * %rsi - page_list,
+	 * %rdx - start_address,
+	 * %ecx - preserve_context (ignored).
+	 */
+
+	/* Zero out flags, and disable interrupts. */
+	pushq	$0
+	popfq
+
+	/*
+	 * Map the control page at its virtual address
+	 * in transition page table.
+	 */
+	movq	PTR(XK_VA_CONTROL_PAGE)(%rsi), %r8
+
+	/* Get PGD address and PGD entry index. */
+	movq	PTR(XK_VA_PGD_PAGE)(%rsi), %r9
+	movq	%r8, %r10
+	shrq	$PGDIR_SHIFT, %r10
+	andq	$(PTRS_PER_PGD - 1), %r10
+
+	/* Fill PGD entry with PUD0 reference. */
+	movq	PTR(XK_MA_PUD0_PAGE)(%rsi), %r11
+	orq	$_KERNPG_TABLE, %r11
+	movq	%r11, (%r9, %r10, 8)
+
+	/* Get PUD0 address and PUD0 entry index. */
+	movq	PTR(XK_VA_PUD0_PAGE)(%rsi), %r9
+	movq	%r8, %r10
+	shrq	$PUD_SHIFT, %r10
+	andq	$(PTRS_PER_PUD - 1), %r10
+
+	/* Fill PUD0 entry with PMD0 reference. */
+	movq	PTR(XK_MA_PMD0_PAGE)(%rsi), %r11
+	orq	$_KERNPG_TABLE, %r11
+	movq	%r11, (%r9, %r10, 8)
+
+	/* Get PMD0 address and PMD0 entry index. */
+	movq	PTR(XK_VA_PMD0_PAGE)(%rsi), %r9
+	movq	%r8, %r10
+	shrq	$PMD_SHIFT, %r10
+	andq	$(PTRS_PER_PMD - 1), %r10
+
+	/* Fill PMD0 entry with PTE0 reference. */
+	movq	PTR(XK_MA_PTE0_PAGE)(%rsi), %r11
+	orq	$_KERNPG_TABLE, %r11
+	movq	%r11, (%r9, %r10, 8)
+
+	/* Get PTE0 address and PTE0 entry index. */
+	movq	PTR(XK_VA_PTE0_PAGE)(%rsi), %r9
+	movq	%r8, %r10
+	shrq	$PAGE_SHIFT, %r10
+	andq	$(PTRS_PER_PTE - 1), %r10
+
+	/* Fill PTE0 entry with control page reference. */
+	movq	PTR(XK_MA_CONTROL_PAGE)(%rsi), %r11
+	orq	$__PAGE_KERNEL_EXEC, %r11
+	movq	%r11, (%r9, %r10, 8)
+
+	/*
+	 * Identity map the control page at its machine address
+	 * in transition page table.
+	 */
+	movq	PTR(XK_MA_CONTROL_PAGE)(%rsi), %r8
+
+	/* Get PGD address and PGD entry index. */
+	movq	PTR(XK_VA_PGD_PAGE)(%rsi), %r9
+	movq	%r8, %r10
+	shrq	$PGDIR_SHIFT, %r10
+	andq	$(PTRS_PER_PGD - 1), %r10
+
+	/* Fill PGD entry with PUD1 reference. */
+	movq	PTR(XK_MA_PUD1_PAGE)(%rsi), %r11
+	orq	$_KERNPG_TABLE, %r11
+	movq	%r11, (%r9, %r10, 8)
+
+	/* Get PUD1 address and PUD1 entry index. */
+	movq	PTR(XK_VA_PUD1_PAGE)(%rsi), %r9
+	movq	%r8, %r10
+	shrq	$PUD_SHIFT, %r10
+	andq	$(PTRS_PER_PUD - 1), %r10
+
+	/* Fill PUD1 entry with PMD1 reference. */
+	movq	PTR(XK_MA_PMD1_PAGE)(%rsi), %r11
+	orq	$_KERNPG_TABLE, %r11
+	movq	%r11, (%r9, %r10, 8)
+
+	/* Get PMD1 address and PMD1 entry index. */
+	movq	PTR(XK_VA_PMD1_PAGE)(%rsi), %r9
+	movq	%r8, %r10
+	shrq	$PMD_SHIFT, %r10
+	andq	$(PTRS_PER_PMD - 1), %r10
+
+	/* Fill PMD1 entry with PTE1 reference. */
+	movq	PTR(XK_MA_PTE1_PAGE)(%rsi), %r11
+	orq	$_KERNPG_TABLE, %r11
+	movq	%r11, (%r9, %r10, 8)
+
+	/* Get PTE1 address and PTE1 entry index. */
+	movq	PTR(XK_VA_PTE1_PAGE)(%rsi), %r9
+	movq	%r8, %r10
+	shrq	$PAGE_SHIFT, %r10
+	andq	$(PTRS_PER_PTE - 1), %r10
+
+	/* Fill PTE1 entry with control page reference. */
+	movq	PTR(XK_MA_CONTROL_PAGE)(%rsi), %r11
+	orq	$__PAGE_KERNEL_EXEC, %r11
+	movq	%r11, (%r9, %r10, 8)
+
+	/*
+	 * Get machine address of control page now.
+	 * This is impossible after page table switch.
+	 */
+	movq	PTR(XK_MA_CONTROL_PAGE)(%rsi), %r8
+
+	/* Get machine address of identity page table now too. */
+	movq	PTR(XK_MA_TABLE_PAGE)(%rsi), %r9
+
+	/* Get machine address of transition page table now too. */
+	movq	PTR(XK_MA_PGD_PAGE)(%rsi), %r10
+
+	/* Switch to transition page table. */
+	movq	%r10, %cr3
+
+	/* Setup a new stack at the end of machine address of control page. */
+	leaq	PAGE_SIZE(%r8), %rsp
+
+	/* Store start_address on the stack. */
+	pushq   %rdx
+
+	/* Jump to identity mapped page. */
+	addq	$(identity_mapped - xen_relocate_kernel), %r8
+	jmpq	*%r8
+
+identity_mapped:
+	/* Switch to identity page table. */
+	movq	%r9, %cr3
+
+	/*
+	 * Set %cr0 to a known state:
+	 *   - disable alignment check,
+	 *   - disable floating point emulation,
+	 *   - no task switch,
+	 *   - disable write protect,
+	 *   - enable protected mode,
+	 *   - enable paging.
+	 */
+	movq	%cr0, %rax
+	andq	$~(X86_CR0_AM | X86_CR0_EM | X86_CR0_TS | X86_CR0_WP), %rax
+	orl	$(X86_CR0_PE | X86_CR0_PG), %eax
+	movq	%rax, %cr0
+
+	/*
+	 * Set %cr4 to a known state:
+	 *   - enable physical address extension.
+	 */
+	movq	$X86_CR4_PAE, %rax
+	movq	%rax, %cr4
+
+	jmp	1f
+
+1:
+	/* Flush the TLB (needed?). */
+	movq	%r9, %cr3
+
+	/* Do the copies. */
+	movq	%rdi, %rcx	/* Put the indirection_page in %rcx. */
+	xorq	%rdi, %rdi
+	xorq	%rsi, %rsi
+	jmp	1f
+
+0:
+	/*
+	 * Top, read another quadword from the indirection page.
+	 * Indirection page is an array which contains source
+	 * and destination address pairs. If all pairs could
+	 * not fit in one page then at the end of given
+	 * indirection page is pointer to next one.
+	 * Copy is stopped when done indicator
+	 * is found in indirection page.
+	 */
+	movq	(%rbx), %rcx
+	addq	$8, %rbx
+
+1:
+	testq	$0x1, %rcx	/* Is it a destination page? */
+	jz	2f
+
+	movq	%rcx, %rdi
+	andq	$PAGE_MASK, %rdi
+	jmp	0b
+
+2:
+	testq	$0x2, %rcx	/* Is it an indirection page? */
+	jz	2f
+
+	movq	%rcx, %rbx
+	andq	$PAGE_MASK, %rbx
+	jmp	0b
+
+2:
+	testq	$0x4, %rcx	/* Is it the done indicator? */
+	jz	2f
+	jmp	3f
+
+2:
+	testq	$0x8, %rcx	/* Is it the source indicator? */
+	jz	0b		/* Ignore it otherwise. */
+
+	movq	%rcx, %rsi
+	andq	$PAGE_MASK, %rsi
+	movq	$512, %rcx
+
+	/* Copy page. */
+	rep	movsq
+	jmp	0b
+
+3:
+	/*
+	 * To be certain of avoiding problems with self-modifying code
+	 * I need to execute a serializing instruction here.
+	 * So I flush the TLB by reloading %cr3 here, it's handy,
+	 * and not processor dependent.
+	 */
+	movq	%cr3, %rax
+	movq	%rax, %cr3
+
+	/*
+	 * Set all of the registers to known values.
+	 * Leave %rsp alone.
+	 */
+	xorq	%rax, %rax
+	xorq	%rbx, %rbx
+	xorq    %rcx, %rcx
+	xorq    %rdx, %rdx
+	xorq    %rsi, %rsi
+	xorq    %rdi, %rdi
+	xorq    %rbp, %rbp
+	xorq	%r8, %r8
+	xorq	%r9, %r9
+	xorq	%r10, %r10
+	xorq	%r11, %r11
+	xorq	%r12, %r12
+	xorq	%r13, %r13
+	xorq	%r14, %r14
+	xorq	%r15, %r15
+
+	/* Jump to start_address. */
+	retq
+
+xen_kexec_control_code_size:
+	.long	. - xen_relocate_kernel
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQJ-00006q-7l; Tue, 20 Nov 2012 15:07:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQH-00005T-Gr
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:37 +0000
Received: from [85.158.139.211:28951] by server-2.bemta-5.messagelabs.com id
	4F/78-04892-8BC9BA05; Tue, 20 Nov 2012 15:07:36 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!8
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9984 invoked from network); 20 Nov 2012 15:07:31 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:31 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1634391Ab2KTPEy
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:54 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:53 +0100
Message-Id: <1353423893-23125-12-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-11-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-5-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-6-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-7-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-8-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-9-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-10-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-11-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.387740
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 11/11] x86: Add Xen kexec control code size
	check to linker script
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add Xen kexec control code size check to linker script.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 arch/x86/kernel/vmlinux.lds.S |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 22a1530..f18786a 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -360,5 +360,10 @@ INIT_PER_CPU(irq_stack_union);
 
 . = ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE,
            "kexec control code size is too big");
-#endif
 
+#ifdef CONFIG_XEN
+. = ASSERT(xen_kexec_control_code_size - xen_relocate_kernel <=
+		KEXEC_CONTROL_CODE_MAX_SIZE,
+		"Xen kexec control code size is too big");
+#endif
+#endif
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQJ-000076-K2; Tue, 20 Nov 2012 15:07:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQH-00005E-Mk
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:37 +0000
Received: from [85.158.139.211:28915] by server-3.bemta-5.messagelabs.com id
	91/82-18736-8BC9BA05; Tue, 20 Nov 2012 15:07:36 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!11
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10039 invoked from network); 20 Nov 2012 15:07:32 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:32 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1634380Ab2KTPEy
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:54 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:50 +0100
Message-Id: <1353423893-23125-9-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-8-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-5-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-6-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-7-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-8-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.499449
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 08/11] x86/xen: Add kexec/kdump makefile rules
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add kexec/kdump makefile rules.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 arch/x86/xen/Makefile |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile
index 96ab2c0..7a5db44 100644
--- a/arch/x86/xen/Makefile
+++ b/arch/x86/xen/Makefile
@@ -22,3 +22,6 @@ obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o
 obj-$(CONFIG_XEN_DEBUG_FS)	+= debugfs.o
 obj-$(CONFIG_XEN_DOM0)		+= apic.o vga.o
 obj-$(CONFIG_SWIOTLB_XEN)	+= pci-swiotlb-xen.o
+obj-$(CONFIG_KEXEC)		+= kexec.o
+obj-$(CONFIG_KEXEC)		+= machine_kexec_$(BITS).o
+obj-$(CONFIG_KEXEC)		+= relocate_kernel_$(BITS).o
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQK-00007o-Ek; Tue, 20 Nov 2012 15:07:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQI-00005T-4b
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:38 +0000
Received: from [85.158.139.211:28948] by server-2.bemta-5.messagelabs.com id
	5F/78-04892-8BC9BA05; Tue, 20 Nov 2012 15:07:36 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!10
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10017 invoked from network); 20 Nov 2012 15:07:32 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:32 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1634381Ab2KTPEy
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:54 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:51 +0100
Message-Id: <1353423893-23125-10-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-9-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-5-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-6-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-7-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-8-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-9-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.251242
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 09/11] x86/xen/enlighten: Add init and crash
	kexec/kdump hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add init and crash kexec/kdump hooks.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 arch/x86/xen/enlighten.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 586d838..e5b4d0d 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -31,6 +31,7 @@
 #include <linux/pci.h>
 #include <linux/gfp.h>
 #include <linux/memblock.h>
+#include <linux/kexec.h>
 
 #include <xen/xen.h>
 #include <xen/events.h>
@@ -67,6 +68,7 @@
 #include <asm/hypervisor.h>
 #include <asm/mwait.h>
 #include <asm/pci_x86.h>
+#include <asm/xen/kexec.h>
 
 #ifdef CONFIG_ACPI
 #include <linux/acpi.h>
@@ -1254,6 +1256,12 @@ static void xen_machine_power_off(void)
 
 static void xen_crash_shutdown(struct pt_regs *regs)
 {
+#ifdef CONFIG_KEXEC
+	if (kexec_crash_image) {
+		crash_save_cpu(regs, safe_smp_processor_id());
+		return;
+	}
+#endif
 	xen_reboot(SHUTDOWN_crash);
 }
 
@@ -1331,6 +1339,10 @@ asmlinkage void __init xen_start_kernel(void)
 
 	xen_init_mmu_ops();
 
+#ifdef CONFIG_KEXEC
+	xen_init_kexec_ops();
+#endif
+
 	/* Prevent unwanted bits from being set in PTEs. */
 	__supported_pte_mask &= ~_PAGE_GLOBAL;
 #if 0
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQJ-00006q-7l; Tue, 20 Nov 2012 15:07:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQH-00005T-Gr
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:37 +0000
Received: from [85.158.139.211:28951] by server-2.bemta-5.messagelabs.com id
	4F/78-04892-8BC9BA05; Tue, 20 Nov 2012 15:07:36 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!8
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9984 invoked from network); 20 Nov 2012 15:07:31 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:31 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1634391Ab2KTPEy
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:54 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:53 +0100
Message-Id: <1353423893-23125-12-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-11-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-5-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-6-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-7-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-8-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-9-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-10-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-11-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.387740
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 11/11] x86: Add Xen kexec control code size
	check to linker script
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add Xen kexec control code size check to linker script.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 arch/x86/kernel/vmlinux.lds.S |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 22a1530..f18786a 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -360,5 +360,10 @@ INIT_PER_CPU(irq_stack_union);
 
 . = ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE,
            "kexec control code size is too big");
-#endif
 
+#ifdef CONFIG_XEN
+. = ASSERT(xen_kexec_control_code_size - xen_relocate_kernel <=
+		KEXEC_CONTROL_CODE_MAX_SIZE,
+		"Xen kexec control code size is too big");
+#endif
+#endif
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQK-00008K-S9; Tue, 20 Nov 2012 15:07:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQI-00005h-79
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:38 +0000
Received: from [85.158.139.211:16018] by server-7.bemta-5.messagelabs.com id
	20/4B-23096-9BC9BA05; Tue, 20 Nov 2012 15:07:37 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!12
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10056 invoked from network); 20 Nov 2012 15:07:32 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:32 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1633987Ab2KTPEy
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:54 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:49 +0100
Message-Id: <1353423893-23125-8-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-7-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-5-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-6-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-7-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.089320
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 07/11] x86/xen: Add x86_64 kexec/kdump
	implementation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add x86_64 kexec/kdump implementation.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 arch/x86/xen/machine_kexec_64.c   |  302 ++++++++++++++++++++++++++++++++++++
 arch/x86/xen/relocate_kernel_64.S |  309 +++++++++++++++++++++++++++++++++++++
 2 files changed, 611 insertions(+), 0 deletions(-)
 create mode 100644 arch/x86/xen/machine_kexec_64.c
 create mode 100644 arch/x86/xen/relocate_kernel_64.S

diff --git a/arch/x86/xen/machine_kexec_64.c b/arch/x86/xen/machine_kexec_64.c
new file mode 100644
index 0000000..a2cf0c8
--- /dev/null
+++ b/arch/x86/xen/machine_kexec_64.c
@@ -0,0 +1,302 @@
+/*
+ * Copyright (c) 2011 Daniel Kiper
+ * Copyright (c) 2012 Daniel Kiper, Oracle Corporation
+ *
+ * kexec/kdump implementation for Xen was written by Daniel Kiper.
+ * Initial work on it was sponsored by Google under Google Summer
+ * of Code 2011 program and Citrix. Konrad Rzeszutek Wilk from Oracle
+ * was the mentor for this project.
+ *
+ * Some ideas are taken from:
+ *   - native kexec/kdump implementation,
+ *   - kexec/kdump implementation for Xen Linux Kernel Ver. 2.6.18,
+ *   - PV-GRUB.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/kexec.h>
+#include <linux/mm.h>
+#include <linux/string.h>
+
+#include <xen/interface/memory.h>
+#include <xen/xen.h>
+
+#include <asm/xen/hypercall.h>
+#include <asm/xen/kexec.h>
+#include <asm/xen/page.h>
+
+#define __ma(vaddr)	(virt_to_machine(vaddr).maddr)
+
+static unsigned long xen_page_to_mfn(struct page *page)
+{
+	return pfn_to_mfn(page_to_pfn(page));
+}
+
+static struct page *xen_mfn_to_page(unsigned long mfn)
+{
+	return pfn_to_page(mfn_to_pfn(mfn));
+}
+
+static unsigned long xen_virt_to_machine(volatile void *address)
+{
+	return virt_to_machine(address).maddr;
+}
+
+static void *xen_machine_to_virt(unsigned long address)
+{
+	return phys_to_virt(machine_to_phys(XMADDR(address)).paddr);
+}
+
+static void init_level2_page(pmd_t *pmd, unsigned long addr)
+{
+	unsigned long end_addr = addr + PUD_SIZE;
+
+	while (addr < end_addr) {
+		native_set_pmd(pmd++, native_make_pmd(addr | __PAGE_KERNEL_LARGE_EXEC));
+		addr += PMD_SIZE;
+	}
+}
+
+static int init_level3_page(struct kimage *image, pud_t *pud,
+				unsigned long addr, unsigned long last_addr)
+{
+	pmd_t *pmd;
+	struct page *page;
+	unsigned long end_addr = addr + PGDIR_SIZE;
+
+	while ((addr < last_addr) && (addr < end_addr)) {
+		page = kimage_alloc_control_pages(image, 0);
+
+		if (!page)
+			return -ENOMEM;
+
+		pmd = page_address(page);
+		init_level2_page(pmd, addr);
+		native_set_pud(pud++, native_make_pud(__ma(pmd) | _KERNPG_TABLE));
+		addr += PUD_SIZE;
+	}
+
+	/* Clear the unused entries. */
+	while (addr < end_addr) {
+		native_pud_clear(pud++);
+		addr += PUD_SIZE;
+	}
+
+	return 0;
+}
+
+
+static int init_level4_page(struct kimage *image, pgd_t *pgd,
+				unsigned long addr, unsigned long last_addr)
+{
+	int rc;
+	pud_t *pud;
+	struct page *page;
+	unsigned long end_addr = addr + PTRS_PER_PGD * PGDIR_SIZE;
+
+	while ((addr < last_addr) && (addr < end_addr)) {
+		page = kimage_alloc_control_pages(image, 0);
+
+		if (!page)
+			return -ENOMEM;
+
+		pud = page_address(page);
+		rc = init_level3_page(image, pud, addr, last_addr);
+
+		if (rc)
+			return rc;
+
+		native_set_pgd(pgd++, native_make_pgd(__ma(pud) | _KERNPG_TABLE));
+		addr += PGDIR_SIZE;
+	}
+
+	/* Clear the unused entries. */
+	while (addr < end_addr) {
+		native_pgd_clear(pgd++);
+		addr += PGDIR_SIZE;
+	}
+
+	return 0;
+}
+
+static void free_transition_pgtable(struct kimage *image)
+{
+	free_page((unsigned long)image->arch.pgd);
+	free_page((unsigned long)image->arch.pud0);
+	free_page((unsigned long)image->arch.pud1);
+	free_page((unsigned long)image->arch.pmd0);
+	free_page((unsigned long)image->arch.pmd1);
+	free_page((unsigned long)image->arch.pte0);
+	free_page((unsigned long)image->arch.pte1);
+}
+
+static int alloc_transition_pgtable(struct kimage *image)
+{
+	image->arch.pgd = (pgd_t *)get_zeroed_page(GFP_KERNEL);
+
+	if (!image->arch.pgd)
+		goto err;
+
+	image->arch.pud0 = (pud_t *)get_zeroed_page(GFP_KERNEL);
+
+	if (!image->arch.pud0)
+		goto err;
+
+	image->arch.pud1 = (pud_t *)get_zeroed_page(GFP_KERNEL);
+
+	if (!image->arch.pud1)
+		goto err;
+
+	image->arch.pmd0 = (pmd_t *)get_zeroed_page(GFP_KERNEL);
+
+	if (!image->arch.pmd0)
+		goto err;
+
+	image->arch.pmd1 = (pmd_t *)get_zeroed_page(GFP_KERNEL);
+
+	if (!image->arch.pmd1)
+		goto err;
+
+	image->arch.pte0 = (pte_t *)get_zeroed_page(GFP_KERNEL);
+
+	if (!image->arch.pte0)
+		goto err;
+
+	image->arch.pte1 = (pte_t *)get_zeroed_page(GFP_KERNEL);
+
+	if (!image->arch.pte1)
+		goto err;
+
+	return 0;
+
+err:
+	free_transition_pgtable(image);
+
+	return -ENOMEM;
+}
+
+static int init_pgtable(struct kimage *image, pgd_t *pgd)
+{
+	int rc;
+	unsigned long max_mfn;
+
+	max_mfn = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL);
+
+	rc = init_level4_page(image, pgd, 0, PFN_PHYS(max_mfn));
+
+	if (rc)
+		return rc;
+
+	return alloc_transition_pgtable(image);
+}
+
+static int machine_xen_kexec_prepare(struct kimage *image)
+{
+#ifdef CONFIG_KEXEC_JUMP
+	if (image->preserve_context) {
+		pr_info_once("kexec: Context preservation is not "
+				"supported in Xen domains.\n");
+		return -ENOSYS;
+	}
+#endif
+
+	return init_pgtable(image, page_address(image->control_code_page));
+}
+
+static int machine_xen_kexec_load(struct kimage *image)
+{
+	void *control_page, *table_page;
+	struct xen_kexec_load xkl = {};
+
+	/* Image is unloaded, nothing to do. */
+	if (!image)
+		return 0;
+
+	table_page = page_address(image->control_code_page);
+	control_page = table_page + PAGE_SIZE;
+
+	memcpy(control_page, xen_relocate_kernel, xen_kexec_control_code_size);
+
+	xkl.type = image->type;
+	xkl.image.page_list[XK_MA_CONTROL_PAGE] = __ma(control_page);
+	xkl.image.page_list[XK_MA_TABLE_PAGE] = __ma(table_page);
+	xkl.image.page_list[XK_MA_PGD_PAGE] = __ma(image->arch.pgd);
+	xkl.image.page_list[XK_MA_PUD0_PAGE] = __ma(image->arch.pud0);
+	xkl.image.page_list[XK_MA_PUD1_PAGE] = __ma(image->arch.pud1);
+	xkl.image.page_list[XK_MA_PMD0_PAGE] = __ma(image->arch.pmd0);
+	xkl.image.page_list[XK_MA_PMD1_PAGE] = __ma(image->arch.pmd1);
+	xkl.image.page_list[XK_MA_PTE0_PAGE] = __ma(image->arch.pte0);
+	xkl.image.page_list[XK_MA_PTE1_PAGE] = __ma(image->arch.pte1);
+	xkl.image.indirection_page = image->head;
+	xkl.image.start_address = image->start;
+
+	return HYPERVISOR_kexec_op(KEXEC_CMD_kexec_load, &xkl);
+}
+
+static void machine_xen_kexec_cleanup(struct kimage *image)
+{
+	free_transition_pgtable(image);
+}
+
+static void machine_xen_kexec_unload(struct kimage *image)
+{
+	int rc;
+	struct xen_kexec_load xkl = {};
+
+	if (!image)
+		return;
+
+	xkl.type = image->type;
+	rc = HYPERVISOR_kexec_op(KEXEC_CMD_kexec_unload, &xkl);
+
+	WARN(rc, "kexec: %s: HYPERVISOR_kexec_op(): %i\n", __func__, rc);
+}
+
+static void machine_xen_kexec_shutdown(void)
+{
+}
+
+static void machine_xen_kexec(struct kimage *image)
+{
+	int rc;
+	struct xen_kexec_exec xke = {};
+
+	xke.type = image->type;
+	rc = HYPERVISOR_kexec_op(KEXEC_CMD_kexec, &xke);
+
+	pr_emerg("kexec: %s: HYPERVISOR_kexec_op(): %i\n", __func__, rc);
+	BUG();
+}
+
+void __init xen_init_kexec_ops(void)
+{
+	if (!xen_initial_domain())
+		return;
+
+	kexec_ops.crash_alloc_temp_store = true;
+	kexec_ops.page_to_pfn = xen_page_to_mfn;
+	kexec_ops.pfn_to_page = xen_mfn_to_page;
+	kexec_ops.virt_to_phys = xen_virt_to_machine;
+	kexec_ops.phys_to_virt = xen_machine_to_virt;
+	kexec_ops.machine_kexec_prepare = machine_xen_kexec_prepare;
+	kexec_ops.machine_kexec_load = machine_xen_kexec_load;
+	kexec_ops.machine_kexec_cleanup = machine_xen_kexec_cleanup;
+	kexec_ops.machine_kexec_unload = machine_xen_kexec_unload;
+	kexec_ops.machine_kexec_shutdown = machine_xen_kexec_shutdown;
+	kexec_ops.machine_kexec = machine_xen_kexec;
+}
diff --git a/arch/x86/xen/relocate_kernel_64.S b/arch/x86/xen/relocate_kernel_64.S
new file mode 100644
index 0000000..8f641f1
--- /dev/null
+++ b/arch/x86/xen/relocate_kernel_64.S
@@ -0,0 +1,309 @@
+/*
+ * Copyright (c) 2002-2005 Eric Biederman <ebiederm@xmission.com>
+ * Copyright (c) 2011 Daniel Kiper
+ * Copyright (c) 2012 Daniel Kiper, Oracle Corporation
+ *
+ * kexec/kdump implementation for Xen was written by Daniel Kiper.
+ * Initial work on it was sponsored by Google under Google Summer
+ * of Code 2011 program and Citrix. Konrad Rzeszutek Wilk from Oracle
+ * was the mentor for this project.
+ *
+ * Some ideas are taken from:
+ *   - native kexec/kdump implementation,
+ *   - kexec/kdump implementation for Xen Linux Kernel Ver. 2.6.18,
+ *   - PV-GRUB.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <asm/page_types.h>
+#include <asm/pgtable_types.h>
+#include <asm/processor-flags.h>
+
+#include <asm/xen/kexec.h>
+
+#define PTR(x)	(x << 3)
+
+	.text
+	.code64
+	.globl	xen_kexec_control_code_size, xen_relocate_kernel
+
+xen_relocate_kernel:
+	/*
+	 * Must be relocatable PIC code callable as a C function.
+	 *
+	 * This function is called by Xen but here hypervisor is dead.
+	 * We are playing on bare metal.
+	 *
+	 * Every machine address passed to this function through
+	 * page_list (e.g. XK_MA_CONTROL_PAGE) is established
+	 * by dom0 during kexec load phase.
+	 *
+	 * Every virtual address passed to this function through page_list
+	 * (e.g. XK_VA_CONTROL_PAGE) is established by hypervisor during
+	 * HYPERVISOR_kexec_op(KEXEC_CMD_kexec_load) hypercall.
+	 *
+	 * %rdi - indirection_page,
+	 * %rsi - page_list,
+	 * %rdx - start_address,
+	 * %ecx - preserve_context (ignored).
+	 */
+
+	/* Zero out flags, and disable interrupts. */
+	pushq	$0
+	popfq
+
+	/*
+	 * Map the control page at its virtual address
+	 * in transition page table.
+	 */
+	movq	PTR(XK_VA_CONTROL_PAGE)(%rsi), %r8
+
+	/* Get PGD address and PGD entry index. */
+	movq	PTR(XK_VA_PGD_PAGE)(%rsi), %r9
+	movq	%r8, %r10
+	shrq	$PGDIR_SHIFT, %r10
+	andq	$(PTRS_PER_PGD - 1), %r10
+
+	/* Fill PGD entry with PUD0 reference. */
+	movq	PTR(XK_MA_PUD0_PAGE)(%rsi), %r11
+	orq	$_KERNPG_TABLE, %r11
+	movq	%r11, (%r9, %r10, 8)
+
+	/* Get PUD0 address and PUD0 entry index. */
+	movq	PTR(XK_VA_PUD0_PAGE)(%rsi), %r9
+	movq	%r8, %r10
+	shrq	$PUD_SHIFT, %r10
+	andq	$(PTRS_PER_PUD - 1), %r10
+
+	/* Fill PUD0 entry with PMD0 reference. */
+	movq	PTR(XK_MA_PMD0_PAGE)(%rsi), %r11
+	orq	$_KERNPG_TABLE, %r11
+	movq	%r11, (%r9, %r10, 8)
+
+	/* Get PMD0 address and PMD0 entry index. */
+	movq	PTR(XK_VA_PMD0_PAGE)(%rsi), %r9
+	movq	%r8, %r10
+	shrq	$PMD_SHIFT, %r10
+	andq	$(PTRS_PER_PMD - 1), %r10
+
+	/* Fill PMD0 entry with PTE0 reference. */
+	movq	PTR(XK_MA_PTE0_PAGE)(%rsi), %r11
+	orq	$_KERNPG_TABLE, %r11
+	movq	%r11, (%r9, %r10, 8)
+
+	/* Get PTE0 address and PTE0 entry index. */
+	movq	PTR(XK_VA_PTE0_PAGE)(%rsi), %r9
+	movq	%r8, %r10
+	shrq	$PAGE_SHIFT, %r10
+	andq	$(PTRS_PER_PTE - 1), %r10
+
+	/* Fill PTE0 entry with control page reference. */
+	movq	PTR(XK_MA_CONTROL_PAGE)(%rsi), %r11
+	orq	$__PAGE_KERNEL_EXEC, %r11
+	movq	%r11, (%r9, %r10, 8)
+
+	/*
+	 * Identity map the control page at its machine address
+	 * in transition page table.
+	 */
+	movq	PTR(XK_MA_CONTROL_PAGE)(%rsi), %r8
+
+	/* Get PGD address and PGD entry index. */
+	movq	PTR(XK_VA_PGD_PAGE)(%rsi), %r9
+	movq	%r8, %r10
+	shrq	$PGDIR_SHIFT, %r10
+	andq	$(PTRS_PER_PGD - 1), %r10
+
+	/* Fill PGD entry with PUD1 reference. */
+	movq	PTR(XK_MA_PUD1_PAGE)(%rsi), %r11
+	orq	$_KERNPG_TABLE, %r11
+	movq	%r11, (%r9, %r10, 8)
+
+	/* Get PUD1 address and PUD1 entry index. */
+	movq	PTR(XK_VA_PUD1_PAGE)(%rsi), %r9
+	movq	%r8, %r10
+	shrq	$PUD_SHIFT, %r10
+	andq	$(PTRS_PER_PUD - 1), %r10
+
+	/* Fill PUD1 entry with PMD1 reference. */
+	movq	PTR(XK_MA_PMD1_PAGE)(%rsi), %r11
+	orq	$_KERNPG_TABLE, %r11
+	movq	%r11, (%r9, %r10, 8)
+
+	/* Get PMD1 address and PMD1 entry index. */
+	movq	PTR(XK_VA_PMD1_PAGE)(%rsi), %r9
+	movq	%r8, %r10
+	shrq	$PMD_SHIFT, %r10
+	andq	$(PTRS_PER_PMD - 1), %r10
+
+	/* Fill PMD1 entry with PTE1 reference. */
+	movq	PTR(XK_MA_PTE1_PAGE)(%rsi), %r11
+	orq	$_KERNPG_TABLE, %r11
+	movq	%r11, (%r9, %r10, 8)
+
+	/* Get PTE1 address and PTE1 entry index. */
+	movq	PTR(XK_VA_PTE1_PAGE)(%rsi), %r9
+	movq	%r8, %r10
+	shrq	$PAGE_SHIFT, %r10
+	andq	$(PTRS_PER_PTE - 1), %r10
+
+	/* Fill PTE1 entry with control page reference. */
+	movq	PTR(XK_MA_CONTROL_PAGE)(%rsi), %r11
+	orq	$__PAGE_KERNEL_EXEC, %r11
+	movq	%r11, (%r9, %r10, 8)
+
+	/*
+	 * Get machine address of control page now.
+	 * This is impossible after page table switch.
+	 */
+	movq	PTR(XK_MA_CONTROL_PAGE)(%rsi), %r8
+
+	/* Get machine address of identity page table now too. */
+	movq	PTR(XK_MA_TABLE_PAGE)(%rsi), %r9
+
+	/* Get machine address of transition page table now too. */
+	movq	PTR(XK_MA_PGD_PAGE)(%rsi), %r10
+
+	/* Switch to transition page table. */
+	movq	%r10, %cr3
+
+	/* Setup a new stack at the end of machine address of control page. */
+	leaq	PAGE_SIZE(%r8), %rsp
+
+	/* Store start_address on the stack. */
+	pushq   %rdx
+
+	/* Jump to identity mapped page. */
+	addq	$(identity_mapped - xen_relocate_kernel), %r8
+	jmpq	*%r8
+
+identity_mapped:
+	/* Switch to identity page table. */
+	movq	%r9, %cr3
+
+	/*
+	 * Set %cr0 to a known state:
+	 *   - disable alignment check,
+	 *   - disable floating point emulation,
+	 *   - no task switch,
+	 *   - disable write protect,
+	 *   - enable protected mode,
+	 *   - enable paging.
+	 */
+	movq	%cr0, %rax
+	andq	$~(X86_CR0_AM | X86_CR0_EM | X86_CR0_TS | X86_CR0_WP), %rax
+	orl	$(X86_CR0_PE | X86_CR0_PG), %eax
+	movq	%rax, %cr0
+
+	/*
+	 * Set %cr4 to a known state:
+	 *   - enable physical address extension.
+	 */
+	movq	$X86_CR4_PAE, %rax
+	movq	%rax, %cr4
+
+	jmp	1f
+
+1:
+	/* Flush the TLB (needed?). */
+	movq	%r9, %cr3
+
+	/* Do the copies. */
+	movq	%rdi, %rcx	/* Put the indirection_page in %rcx. */
+	xorq	%rdi, %rdi
+	xorq	%rsi, %rsi
+	jmp	1f
+
+0:
+	/*
+	 * Top, read another quadword from the indirection page.
+	 * Indirection page is an array which contains source
+	 * and destination address pairs. If all pairs could
+	 * not fit in one page then at the end of given
+	 * indirection page is pointer to next one.
+	 * Copy is stopped when done indicator
+	 * is found in indirection page.
+	 */
+	movq	(%rbx), %rcx
+	addq	$8, %rbx
+
+1:
+	testq	$0x1, %rcx	/* Is it a destination page? */
+	jz	2f
+
+	movq	%rcx, %rdi
+	andq	$PAGE_MASK, %rdi
+	jmp	0b
+
+2:
+	testq	$0x2, %rcx	/* Is it an indirection page? */
+	jz	2f
+
+	movq	%rcx, %rbx
+	andq	$PAGE_MASK, %rbx
+	jmp	0b
+
+2:
+	testq	$0x4, %rcx	/* Is it the done indicator? */
+	jz	2f
+	jmp	3f
+
+2:
+	testq	$0x8, %rcx	/* Is it the source indicator? */
+	jz	0b		/* Ignore it otherwise. */
+
+	movq	%rcx, %rsi
+	andq	$PAGE_MASK, %rsi
+	movq	$512, %rcx
+
+	/* Copy page. */
+	rep	movsq
+	jmp	0b
+
+3:
+	/*
+	 * To be certain of avoiding problems with self-modifying code
+	 * I need to execute a serializing instruction here.
+	 * So I flush the TLB by reloading %cr3 here, it's handy,
+	 * and not processor dependent.
+	 */
+	movq	%cr3, %rax
+	movq	%rax, %cr3
+
+	/*
+	 * Set all of the registers to known values.
+	 * Leave %rsp alone.
+	 */
+	xorq	%rax, %rax
+	xorq	%rbx, %rbx
+	xorq    %rcx, %rcx
+	xorq    %rdx, %rdx
+	xorq    %rsi, %rsi
+	xorq    %rdi, %rdi
+	xorq    %rbp, %rbp
+	xorq	%r8, %r8
+	xorq	%r9, %r9
+	xorq	%r10, %r10
+	xorq	%r11, %r11
+	xorq	%r12, %r12
+	xorq	%r13, %r13
+	xorq	%r14, %r14
+	xorq	%r15, %r15
+
+	/* Jump to start_address. */
+	retq
+
+xen_kexec_control_code_size:
+	.long	. - xen_relocate_kernel
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQK-00007o-Ek; Tue, 20 Nov 2012 15:07:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQI-00005T-4b
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:38 +0000
Received: from [85.158.139.211:28948] by server-2.bemta-5.messagelabs.com id
	5F/78-04892-8BC9BA05; Tue, 20 Nov 2012 15:07:36 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!10
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10017 invoked from network); 20 Nov 2012 15:07:32 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:32 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1634381Ab2KTPEy
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:54 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:51 +0100
Message-Id: <1353423893-23125-10-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-9-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-5-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-6-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-7-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-8-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-9-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.251242
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 09/11] x86/xen/enlighten: Add init and crash
	kexec/kdump hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add init and crash kexec/kdump hooks.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 arch/x86/xen/enlighten.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 586d838..e5b4d0d 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -31,6 +31,7 @@
 #include <linux/pci.h>
 #include <linux/gfp.h>
 #include <linux/memblock.h>
+#include <linux/kexec.h>
 
 #include <xen/xen.h>
 #include <xen/events.h>
@@ -67,6 +68,7 @@
 #include <asm/hypervisor.h>
 #include <asm/mwait.h>
 #include <asm/pci_x86.h>
+#include <asm/xen/kexec.h>
 
 #ifdef CONFIG_ACPI
 #include <linux/acpi.h>
@@ -1254,6 +1256,12 @@ static void xen_machine_power_off(void)
 
 static void xen_crash_shutdown(struct pt_regs *regs)
 {
+#ifdef CONFIG_KEXEC
+	if (kexec_crash_image) {
+		crash_save_cpu(regs, safe_smp_processor_id());
+		return;
+	}
+#endif
 	xen_reboot(SHUTDOWN_crash);
 }
 
@@ -1331,6 +1339,10 @@ asmlinkage void __init xen_start_kernel(void)
 
 	xen_init_mmu_ops();
 
+#ifdef CONFIG_KEXEC
+	xen_init_kexec_ops();
+#endif
+
 	/* Prevent unwanted bits from being set in PTEs. */
 	__supported_pte_mask &= ~_PAGE_GLOBAL;
 #if 0
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQI-00006K-JT; Tue, 20 Nov 2012 15:07:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQH-00005E-1n
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:37 +0000
Received: from [85.158.139.211:50133] by server-3.bemta-5.messagelabs.com id
	81/82-18736-8BC9BA05; Tue, 20 Nov 2012 15:07:36 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!2
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9776 invoked from network); 20 Nov 2012 15:07:29 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:29 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1627173Ab2KTPEx
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:53 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:43 +0100
Message-Id: <1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.100498
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Some kexec/kdump implementations (e.g. Xen PVOPS) could not use default
functions or require some changes in behavior of kexec/kdump generic code.
To cope with that problem kexec_ops struct was introduced. It allows
a developer to replace all or some functions and control some
functionality of kexec/kdump generic code.

Default behavior of kexec/kdump generic code is not changed.

v2 - suggestions/fixes:
   - add comment for kexec_ops.crash_alloc_temp_store member
     (suggested by Konrad Rzeszutek Wilk),
   - simplify kexec_ops usage
     (suggested by Konrad Rzeszutek Wilk).

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 include/linux/kexec.h |   26 ++++++++++
 kernel/kexec.c        |  131 +++++++++++++++++++++++++++++++++++++------------
 2 files changed, 125 insertions(+), 32 deletions(-)

diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index d0b8458..c8d0b35 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -116,7 +116,33 @@ struct kimage {
 #endif
 };
 
+struct kexec_ops {
+	/*
+	 * Some kdump implementations (e.g. Xen PVOPS dom0) could not access
+	 * directly crash kernel memory area. In this situation they must
+	 * allocate memory outside of it and later move contents from temporary
+	 * storage to final resting places (usualy done by relocate_kernel()).
+	 * Such behavior could be enforced by setting
+	 * crash_alloc_temp_store member to true.
+	 */
+	bool crash_alloc_temp_store;
+	struct page *(*kimage_alloc_pages)(gfp_t gfp_mask,
+						unsigned int order,
+						unsigned long limit);
+	void (*kimage_free_pages)(struct page *page);
+	unsigned long (*page_to_pfn)(struct page *page);
+	struct page *(*pfn_to_page)(unsigned long pfn);
+	unsigned long (*virt_to_phys)(volatile void *address);
+	void *(*phys_to_virt)(unsigned long address);
+	int (*machine_kexec_prepare)(struct kimage *image);
+	int (*machine_kexec_load)(struct kimage *image);
+	void (*machine_kexec_cleanup)(struct kimage *image);
+	void (*machine_kexec_unload)(struct kimage *image);
+	void (*machine_kexec_shutdown)(void);
+	void (*machine_kexec)(struct kimage *image);
+};
 
+extern struct kexec_ops kexec_ops;
 
 /* kexec interface functions */
 extern void machine_kexec(struct kimage *image);
diff --git a/kernel/kexec.c b/kernel/kexec.c
index 5e4bd78..a5f7324 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -55,6 +55,56 @@ struct resource crashk_res = {
 	.flags = IORESOURCE_BUSY | IORESOURCE_MEM
 };
 
+static struct page *kimage_alloc_pages(gfp_t gfp_mask,
+					unsigned int order,
+					unsigned long limit);
+static void kimage_free_pages(struct page *page);
+
+static unsigned long generic_page_to_pfn(struct page *page)
+{
+	return page_to_pfn(page);
+}
+
+static struct page *generic_pfn_to_page(unsigned long pfn)
+{
+	return pfn_to_page(pfn);
+}
+
+static unsigned long generic_virt_to_phys(volatile void *address)
+{
+	return virt_to_phys(address);
+}
+
+static void *generic_phys_to_virt(unsigned long address)
+{
+	return phys_to_virt(address);
+}
+
+static int generic_kexec_load(struct kimage *image)
+{
+	return 0;
+}
+
+static void generic_kexec_unload(struct kimage *image)
+{
+}
+
+struct kexec_ops kexec_ops = {
+	.crash_alloc_temp_store = false,
+	.kimage_alloc_pages = kimage_alloc_pages,
+	.kimage_free_pages = kimage_free_pages,
+	.page_to_pfn = generic_page_to_pfn,
+	.pfn_to_page = generic_pfn_to_page,
+	.virt_to_phys = generic_virt_to_phys,
+	.phys_to_virt = generic_phys_to_virt,
+	.machine_kexec_prepare = machine_kexec_prepare,
+	.machine_kexec_load = generic_kexec_load,
+	.machine_kexec_cleanup = machine_kexec_cleanup,
+	.machine_kexec_unload = generic_kexec_unload,
+	.machine_kexec_shutdown = machine_shutdown,
+	.machine_kexec = machine_kexec
+};
+
 int kexec_should_crash(struct task_struct *p)
 {
 	if (in_interrupt() || !p->pid || is_global_init(p) || panic_on_oops)
@@ -354,7 +404,9 @@ static int kimage_is_destination_range(struct kimage *image,
 	return 0;
 }
 
-static struct page *kimage_alloc_pages(gfp_t gfp_mask, unsigned int order)
+static struct page *kimage_alloc_pages(gfp_t gfp_mask,
+					unsigned int order,
+					unsigned long limit)
 {
 	struct page *pages;
 
@@ -391,7 +443,7 @@ static void kimage_free_page_list(struct list_head *list)
 
 		page = list_entry(pos, struct page, lru);
 		list_del(&page->lru);
-		kimage_free_pages(page);
+		(*kexec_ops.kimage_free_pages)(page);
 	}
 }
 
@@ -424,10 +476,11 @@ static struct page *kimage_alloc_normal_control_pages(struct kimage *image,
 	do {
 		unsigned long pfn, epfn, addr, eaddr;
 
-		pages = kimage_alloc_pages(GFP_KERNEL, order);
+		pages = (*kexec_ops.kimage_alloc_pages)(GFP_KERNEL, order,
+							KEXEC_CONTROL_MEMORY_LIMIT);
 		if (!pages)
 			break;
-		pfn   = page_to_pfn(pages);
+		pfn   = (*kexec_ops.page_to_pfn)(pages);
 		epfn  = pfn + count;
 		addr  = pfn << PAGE_SHIFT;
 		eaddr = epfn << PAGE_SHIFT;
@@ -514,7 +567,7 @@ static struct page *kimage_alloc_crash_control_pages(struct kimage *image,
 		}
 		/* If I don't overlap any segments I have found my hole! */
 		if (i == image->nr_segments) {
-			pages = pfn_to_page(hole_start >> PAGE_SHIFT);
+			pages = (*kexec_ops.pfn_to_page)(hole_start >> PAGE_SHIFT);
 			break;
 		}
 	}
@@ -531,12 +584,13 @@ struct page *kimage_alloc_control_pages(struct kimage *image,
 	struct page *pages = NULL;
 
 	switch (image->type) {
+	case KEXEC_TYPE_CRASH:
+		if (!kexec_ops.crash_alloc_temp_store) {
+			pages = kimage_alloc_crash_control_pages(image, order);
+			break;
+		}
 	case KEXEC_TYPE_DEFAULT:
 		pages = kimage_alloc_normal_control_pages(image, order);
-		break;
-	case KEXEC_TYPE_CRASH:
-		pages = kimage_alloc_crash_control_pages(image, order);
-		break;
 	}
 
 	return pages;
@@ -556,7 +610,7 @@ static int kimage_add_entry(struct kimage *image, kimage_entry_t entry)
 			return -ENOMEM;
 
 		ind_page = page_address(page);
-		*image->entry = virt_to_phys(ind_page) | IND_INDIRECTION;
+		*image->entry = (*kexec_ops.virt_to_phys)(ind_page) | IND_INDIRECTION;
 		image->entry = ind_page;
 		image->last_entry = ind_page +
 				      ((PAGE_SIZE/sizeof(kimage_entry_t)) - 1);
@@ -615,14 +669,14 @@ static void kimage_terminate(struct kimage *image)
 #define for_each_kimage_entry(image, ptr, entry) \
 	for (ptr = &image->head; (entry = *ptr) && !(entry & IND_DONE); \
 		ptr = (entry & IND_INDIRECTION)? \
-			phys_to_virt((entry & PAGE_MASK)): ptr +1)
+			(*kexec_ops.phys_to_virt)((entry & PAGE_MASK)): ptr +1)
 
 static void kimage_free_entry(kimage_entry_t entry)
 {
 	struct page *page;
 
-	page = pfn_to_page(entry >> PAGE_SHIFT);
-	kimage_free_pages(page);
+	page = (*kexec_ops.pfn_to_page)(entry >> PAGE_SHIFT);
+	(*kexec_ops.kimage_free_pages)(page);
 }
 
 static void kimage_free(struct kimage *image)
@@ -652,7 +706,7 @@ static void kimage_free(struct kimage *image)
 		kimage_free_entry(ind);
 
 	/* Handle any machine specific cleanup */
-	machine_kexec_cleanup(image);
+	(*kexec_ops.machine_kexec_cleanup)(image);
 
 	/* Free the kexec control pages... */
 	kimage_free_page_list(&image->control_pages);
@@ -708,7 +762,7 @@ static struct page *kimage_alloc_page(struct kimage *image,
 	 * have a match.
 	 */
 	list_for_each_entry(page, &image->dest_pages, lru) {
-		addr = page_to_pfn(page) << PAGE_SHIFT;
+		addr = (*kexec_ops.page_to_pfn)(page) << PAGE_SHIFT;
 		if (addr == destination) {
 			list_del(&page->lru);
 			return page;
@@ -719,16 +773,17 @@ static struct page *kimage_alloc_page(struct kimage *image,
 		kimage_entry_t *old;
 
 		/* Allocate a page, if we run out of memory give up */
-		page = kimage_alloc_pages(gfp_mask, 0);
+		page = (*kexec_ops.kimage_alloc_pages)(gfp_mask, 0,
+							KEXEC_SOURCE_MEMORY_LIMIT);
 		if (!page)
 			return NULL;
 		/* If the page cannot be used file it away */
-		if (page_to_pfn(page) >
+		if ((*kexec_ops.page_to_pfn)(page) >
 				(KEXEC_SOURCE_MEMORY_LIMIT >> PAGE_SHIFT)) {
 			list_add(&page->lru, &image->unuseable_pages);
 			continue;
 		}
-		addr = page_to_pfn(page) << PAGE_SHIFT;
+		addr = (*kexec_ops.page_to_pfn)(page) << PAGE_SHIFT;
 
 		/* If it is the destination page we want use it */
 		if (addr == destination)
@@ -751,7 +806,7 @@ static struct page *kimage_alloc_page(struct kimage *image,
 			struct page *old_page;
 
 			old_addr = *old & PAGE_MASK;
-			old_page = pfn_to_page(old_addr >> PAGE_SHIFT);
+			old_page = (*kexec_ops.pfn_to_page)(old_addr >> PAGE_SHIFT);
 			copy_highpage(page, old_page);
 			*old = addr | (*old & ~PAGE_MASK);
 
@@ -761,7 +816,7 @@ static struct page *kimage_alloc_page(struct kimage *image,
 			 */
 			if (!(gfp_mask & __GFP_HIGHMEM) &&
 			    PageHighMem(old_page)) {
-				kimage_free_pages(old_page);
+				(*kexec_ops.kimage_free_pages)(old_page);
 				continue;
 			}
 			addr = old_addr;
@@ -807,7 +862,7 @@ static int kimage_load_normal_segment(struct kimage *image,
 			result  = -ENOMEM;
 			goto out;
 		}
-		result = kimage_add_page(image, page_to_pfn(page)
+		result = kimage_add_page(image, (*kexec_ops.page_to_pfn)(page)
 								<< PAGE_SHIFT);
 		if (result < 0)
 			goto out;
@@ -861,7 +916,7 @@ static int kimage_load_crash_segment(struct kimage *image,
 		char *ptr;
 		size_t uchunk, mchunk;
 
-		page = pfn_to_page(maddr >> PAGE_SHIFT);
+		page = (*kexec_ops.pfn_to_page)(maddr >> PAGE_SHIFT);
 		if (!page) {
 			result  = -ENOMEM;
 			goto out;
@@ -900,12 +955,13 @@ static int kimage_load_segment(struct kimage *image,
 	int result = -ENOMEM;
 
 	switch (image->type) {
+	case KEXEC_TYPE_CRASH:
+		if (!kexec_ops.crash_alloc_temp_store) {
+			result = kimage_load_crash_segment(image, segment);
+			break;
+		}
 	case KEXEC_TYPE_DEFAULT:
 		result = kimage_load_normal_segment(image, segment);
-		break;
-	case KEXEC_TYPE_CRASH:
-		result = kimage_load_crash_segment(image, segment);
-		break;
 	}
 
 	return result;
@@ -993,6 +1049,7 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
 			/* Free any current crash dump kernel before
 			 * we corrupt it.
 			 */
+			(*kexec_ops.machine_kexec_unload)(image);
 			kimage_free(xchg(&kexec_crash_image, NULL));
 			result = kimage_crash_alloc(&image, entry,
 						     nr_segments, segments);
@@ -1003,7 +1060,7 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
 
 		if (flags & KEXEC_PRESERVE_CONTEXT)
 			image->preserve_context = 1;
-		result = machine_kexec_prepare(image);
+		result = (*kexec_ops.machine_kexec_prepare)(image);
 		if (result)
 			goto out;
 
@@ -1016,11 +1073,21 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
 		if (flags & KEXEC_ON_CRASH)
 			crash_unmap_reserved_pages();
 	}
+
+	result = (*kexec_ops.machine_kexec_load)(image);
+
+	if (result)
+		goto out;
+
 	/* Install the new kernel, and  Uninstall the old */
 	image = xchg(dest_image, image);
 
 out:
 	mutex_unlock(&kexec_mutex);
+
+	if (kexec_ops.machine_kexec_unload)
+		(*kexec_ops.machine_kexec_unload)(image);
+
 	kimage_free(image);
 
 	return result;
@@ -1094,7 +1161,7 @@ void crash_kexec(struct pt_regs *regs)
 			crash_setup_regs(&fixed_regs, regs);
 			crash_save_vmcoreinfo();
 			machine_crash_shutdown(&fixed_regs);
-			machine_kexec(kexec_crash_image);
+			(*kexec_ops.machine_kexec)(kexec_crash_image);
 		}
 		mutex_unlock(&kexec_mutex);
 	}
@@ -1116,8 +1183,8 @@ void __weak crash_free_reserved_phys_range(unsigned long begin,
 	unsigned long addr;
 
 	for (addr = begin; addr < end; addr += PAGE_SIZE) {
-		ClearPageReserved(pfn_to_page(addr >> PAGE_SHIFT));
-		init_page_count(pfn_to_page(addr >> PAGE_SHIFT));
+		ClearPageReserved((*kexec_ops.pfn_to_page)(addr >> PAGE_SHIFT));
+		init_page_count((*kexec_ops.pfn_to_page)(addr >> PAGE_SHIFT));
 		free_page((unsigned long)__va(addr));
 		totalram_pages++;
 	}
@@ -1571,10 +1638,10 @@ int kernel_kexec(void)
 	{
 		kernel_restart_prepare(NULL);
 		printk(KERN_EMERG "Starting new kernel\n");
-		machine_shutdown();
+		(*kexec_ops.machine_kexec_shutdown)();
 	}
 
-	machine_kexec(kexec_image);
+	(*kexec_ops.machine_kexec)(kexec_image);
 
 #ifdef CONFIG_KEXEC_JUMP
 	if (kexec_image->preserve_context) {
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQJ-000076-K2; Tue, 20 Nov 2012 15:07:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQH-00005E-Mk
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:37 +0000
Received: from [85.158.139.211:28915] by server-3.bemta-5.messagelabs.com id
	91/82-18736-8BC9BA05; Tue, 20 Nov 2012 15:07:36 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!11
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10039 invoked from network); 20 Nov 2012 15:07:32 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:32 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1634380Ab2KTPEy
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:54 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:50 +0100
Message-Id: <1353423893-23125-9-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-8-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-4-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-5-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-6-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-7-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-8-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.499449
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 08/11] x86/xen: Add kexec/kdump makefile rules
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add kexec/kdump makefile rules.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 arch/x86/xen/Makefile |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile
index 96ab2c0..7a5db44 100644
--- a/arch/x86/xen/Makefile
+++ b/arch/x86/xen/Makefile
@@ -22,3 +22,6 @@ obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o
 obj-$(CONFIG_XEN_DEBUG_FS)	+= debugfs.o
 obj-$(CONFIG_XEN_DOM0)		+= apic.o vga.o
 obj-$(CONFIG_SWIOTLB_XEN)	+= pci-swiotlb-xen.o
+obj-$(CONFIG_KEXEC)		+= kexec.o
+obj-$(CONFIG_KEXEC)		+= machine_kexec_$(BITS).o
+obj-$(CONFIG_KEXEC)		+= relocate_kernel_$(BITS).o
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:07:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:07:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQI-00006K-JT; Tue, 20 Nov 2012 15:07:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl>)
	id 1TapQH-00005E-1n
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:07:37 +0000
Received: from [85.158.139.211:50133] by server-3.bemta-5.messagelabs.com id
	81/82-18736-8BC9BA05; Tue, 20 Nov 2012 15:07:36 +0000
X-Env-Sender: SRS0=1Z7x=JQ=oracle.com=daniel.kiper@net-space.pl
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353424041!20865370!2
X-Originating-IP: [89.174.63.77]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9776 invoked from network); 20 Nov 2012 15:07:29 -0000
Received: from router-fw.net-space.pl (HELO router-fw.net-space.pl)
	(89.174.63.77)
	by server-14.tower-206.messagelabs.com with EDH-RSA-DES-CBC3-SHA
	encrypted SMTP; 20 Nov 2012 15:07:29 -0000
Received: from dev-00.local.net-space.pl ([192.168.1.5]:35419 "EHLO
	localhost.localdomain" TLS-CIPHER: <none>)
	by router-fw-old.local.net-space.pl with ESMTP id S1627173Ab2KTPEx
	(ORCPT <rfc822;xen-devel@lists.xensource.com>);
	Tue, 20 Nov 2012 16:04:53 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: andrew.cooper3@citrix.com, ebiederm@xmission.com, hpa@zytor.com,
	jbeulich@suse.com, konrad.wilk@oracle.com, mingo@redhat.com,
	tglx@linutronix.de, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org,
	xen-devel@lists.xensource.com
Date: Tue, 20 Nov 2012 16:04:43 +0100
Message-Id: <1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
X-Mailer: git-send-email 1.5.6.5
In-Reply-To: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
X-Bogosity: No, spamicity=0.100498
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Some kexec/kdump implementations (e.g. Xen PVOPS) could not use default
functions or require some changes in behavior of kexec/kdump generic code.
To cope with that problem kexec_ops struct was introduced. It allows
a developer to replace all or some functions and control some
functionality of kexec/kdump generic code.

Default behavior of kexec/kdump generic code is not changed.

v2 - suggestions/fixes:
   - add comment for kexec_ops.crash_alloc_temp_store member
     (suggested by Konrad Rzeszutek Wilk),
   - simplify kexec_ops usage
     (suggested by Konrad Rzeszutek Wilk).

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 include/linux/kexec.h |   26 ++++++++++
 kernel/kexec.c        |  131 +++++++++++++++++++++++++++++++++++++------------
 2 files changed, 125 insertions(+), 32 deletions(-)

diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index d0b8458..c8d0b35 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -116,7 +116,33 @@ struct kimage {
 #endif
 };
 
+struct kexec_ops {
+	/*
+	 * Some kdump implementations (e.g. Xen PVOPS dom0) could not access
+	 * directly crash kernel memory area. In this situation they must
+	 * allocate memory outside of it and later move contents from temporary
+	 * storage to final resting places (usualy done by relocate_kernel()).
+	 * Such behavior could be enforced by setting
+	 * crash_alloc_temp_store member to true.
+	 */
+	bool crash_alloc_temp_store;
+	struct page *(*kimage_alloc_pages)(gfp_t gfp_mask,
+						unsigned int order,
+						unsigned long limit);
+	void (*kimage_free_pages)(struct page *page);
+	unsigned long (*page_to_pfn)(struct page *page);
+	struct page *(*pfn_to_page)(unsigned long pfn);
+	unsigned long (*virt_to_phys)(volatile void *address);
+	void *(*phys_to_virt)(unsigned long address);
+	int (*machine_kexec_prepare)(struct kimage *image);
+	int (*machine_kexec_load)(struct kimage *image);
+	void (*machine_kexec_cleanup)(struct kimage *image);
+	void (*machine_kexec_unload)(struct kimage *image);
+	void (*machine_kexec_shutdown)(void);
+	void (*machine_kexec)(struct kimage *image);
+};
 
+extern struct kexec_ops kexec_ops;
 
 /* kexec interface functions */
 extern void machine_kexec(struct kimage *image);
diff --git a/kernel/kexec.c b/kernel/kexec.c
index 5e4bd78..a5f7324 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -55,6 +55,56 @@ struct resource crashk_res = {
 	.flags = IORESOURCE_BUSY | IORESOURCE_MEM
 };
 
+static struct page *kimage_alloc_pages(gfp_t gfp_mask,
+					unsigned int order,
+					unsigned long limit);
+static void kimage_free_pages(struct page *page);
+
+static unsigned long generic_page_to_pfn(struct page *page)
+{
+	return page_to_pfn(page);
+}
+
+static struct page *generic_pfn_to_page(unsigned long pfn)
+{
+	return pfn_to_page(pfn);
+}
+
+static unsigned long generic_virt_to_phys(volatile void *address)
+{
+	return virt_to_phys(address);
+}
+
+static void *generic_phys_to_virt(unsigned long address)
+{
+	return phys_to_virt(address);
+}
+
+static int generic_kexec_load(struct kimage *image)
+{
+	return 0;
+}
+
+static void generic_kexec_unload(struct kimage *image)
+{
+}
+
+struct kexec_ops kexec_ops = {
+	.crash_alloc_temp_store = false,
+	.kimage_alloc_pages = kimage_alloc_pages,
+	.kimage_free_pages = kimage_free_pages,
+	.page_to_pfn = generic_page_to_pfn,
+	.pfn_to_page = generic_pfn_to_page,
+	.virt_to_phys = generic_virt_to_phys,
+	.phys_to_virt = generic_phys_to_virt,
+	.machine_kexec_prepare = machine_kexec_prepare,
+	.machine_kexec_load = generic_kexec_load,
+	.machine_kexec_cleanup = machine_kexec_cleanup,
+	.machine_kexec_unload = generic_kexec_unload,
+	.machine_kexec_shutdown = machine_shutdown,
+	.machine_kexec = machine_kexec
+};
+
 int kexec_should_crash(struct task_struct *p)
 {
 	if (in_interrupt() || !p->pid || is_global_init(p) || panic_on_oops)
@@ -354,7 +404,9 @@ static int kimage_is_destination_range(struct kimage *image,
 	return 0;
 }
 
-static struct page *kimage_alloc_pages(gfp_t gfp_mask, unsigned int order)
+static struct page *kimage_alloc_pages(gfp_t gfp_mask,
+					unsigned int order,
+					unsigned long limit)
 {
 	struct page *pages;
 
@@ -391,7 +443,7 @@ static void kimage_free_page_list(struct list_head *list)
 
 		page = list_entry(pos, struct page, lru);
 		list_del(&page->lru);
-		kimage_free_pages(page);
+		(*kexec_ops.kimage_free_pages)(page);
 	}
 }
 
@@ -424,10 +476,11 @@ static struct page *kimage_alloc_normal_control_pages(struct kimage *image,
 	do {
 		unsigned long pfn, epfn, addr, eaddr;
 
-		pages = kimage_alloc_pages(GFP_KERNEL, order);
+		pages = (*kexec_ops.kimage_alloc_pages)(GFP_KERNEL, order,
+							KEXEC_CONTROL_MEMORY_LIMIT);
 		if (!pages)
 			break;
-		pfn   = page_to_pfn(pages);
+		pfn   = (*kexec_ops.page_to_pfn)(pages);
 		epfn  = pfn + count;
 		addr  = pfn << PAGE_SHIFT;
 		eaddr = epfn << PAGE_SHIFT;
@@ -514,7 +567,7 @@ static struct page *kimage_alloc_crash_control_pages(struct kimage *image,
 		}
 		/* If I don't overlap any segments I have found my hole! */
 		if (i == image->nr_segments) {
-			pages = pfn_to_page(hole_start >> PAGE_SHIFT);
+			pages = (*kexec_ops.pfn_to_page)(hole_start >> PAGE_SHIFT);
 			break;
 		}
 	}
@@ -531,12 +584,13 @@ struct page *kimage_alloc_control_pages(struct kimage *image,
 	struct page *pages = NULL;
 
 	switch (image->type) {
+	case KEXEC_TYPE_CRASH:
+		if (!kexec_ops.crash_alloc_temp_store) {
+			pages = kimage_alloc_crash_control_pages(image, order);
+			break;
+		}
 	case KEXEC_TYPE_DEFAULT:
 		pages = kimage_alloc_normal_control_pages(image, order);
-		break;
-	case KEXEC_TYPE_CRASH:
-		pages = kimage_alloc_crash_control_pages(image, order);
-		break;
 	}
 
 	return pages;
@@ -556,7 +610,7 @@ static int kimage_add_entry(struct kimage *image, kimage_entry_t entry)
 			return -ENOMEM;
 
 		ind_page = page_address(page);
-		*image->entry = virt_to_phys(ind_page) | IND_INDIRECTION;
+		*image->entry = (*kexec_ops.virt_to_phys)(ind_page) | IND_INDIRECTION;
 		image->entry = ind_page;
 		image->last_entry = ind_page +
 				      ((PAGE_SIZE/sizeof(kimage_entry_t)) - 1);
@@ -615,14 +669,14 @@ static void kimage_terminate(struct kimage *image)
 #define for_each_kimage_entry(image, ptr, entry) \
 	for (ptr = &image->head; (entry = *ptr) && !(entry & IND_DONE); \
 		ptr = (entry & IND_INDIRECTION)? \
-			phys_to_virt((entry & PAGE_MASK)): ptr +1)
+			(*kexec_ops.phys_to_virt)((entry & PAGE_MASK)): ptr +1)
 
 static void kimage_free_entry(kimage_entry_t entry)
 {
 	struct page *page;
 
-	page = pfn_to_page(entry >> PAGE_SHIFT);
-	kimage_free_pages(page);
+	page = (*kexec_ops.pfn_to_page)(entry >> PAGE_SHIFT);
+	(*kexec_ops.kimage_free_pages)(page);
 }
 
 static void kimage_free(struct kimage *image)
@@ -652,7 +706,7 @@ static void kimage_free(struct kimage *image)
 		kimage_free_entry(ind);
 
 	/* Handle any machine specific cleanup */
-	machine_kexec_cleanup(image);
+	(*kexec_ops.machine_kexec_cleanup)(image);
 
 	/* Free the kexec control pages... */
 	kimage_free_page_list(&image->control_pages);
@@ -708,7 +762,7 @@ static struct page *kimage_alloc_page(struct kimage *image,
 	 * have a match.
 	 */
 	list_for_each_entry(page, &image->dest_pages, lru) {
-		addr = page_to_pfn(page) << PAGE_SHIFT;
+		addr = (*kexec_ops.page_to_pfn)(page) << PAGE_SHIFT;
 		if (addr == destination) {
 			list_del(&page->lru);
 			return page;
@@ -719,16 +773,17 @@ static struct page *kimage_alloc_page(struct kimage *image,
 		kimage_entry_t *old;
 
 		/* Allocate a page, if we run out of memory give up */
-		page = kimage_alloc_pages(gfp_mask, 0);
+		page = (*kexec_ops.kimage_alloc_pages)(gfp_mask, 0,
+							KEXEC_SOURCE_MEMORY_LIMIT);
 		if (!page)
 			return NULL;
 		/* If the page cannot be used file it away */
-		if (page_to_pfn(page) >
+		if ((*kexec_ops.page_to_pfn)(page) >
 				(KEXEC_SOURCE_MEMORY_LIMIT >> PAGE_SHIFT)) {
 			list_add(&page->lru, &image->unuseable_pages);
 			continue;
 		}
-		addr = page_to_pfn(page) << PAGE_SHIFT;
+		addr = (*kexec_ops.page_to_pfn)(page) << PAGE_SHIFT;
 
 		/* If it is the destination page we want use it */
 		if (addr == destination)
@@ -751,7 +806,7 @@ static struct page *kimage_alloc_page(struct kimage *image,
 			struct page *old_page;
 
 			old_addr = *old & PAGE_MASK;
-			old_page = pfn_to_page(old_addr >> PAGE_SHIFT);
+			old_page = (*kexec_ops.pfn_to_page)(old_addr >> PAGE_SHIFT);
 			copy_highpage(page, old_page);
 			*old = addr | (*old & ~PAGE_MASK);
 
@@ -761,7 +816,7 @@ static struct page *kimage_alloc_page(struct kimage *image,
 			 */
 			if (!(gfp_mask & __GFP_HIGHMEM) &&
 			    PageHighMem(old_page)) {
-				kimage_free_pages(old_page);
+				(*kexec_ops.kimage_free_pages)(old_page);
 				continue;
 			}
 			addr = old_addr;
@@ -807,7 +862,7 @@ static int kimage_load_normal_segment(struct kimage *image,
 			result  = -ENOMEM;
 			goto out;
 		}
-		result = kimage_add_page(image, page_to_pfn(page)
+		result = kimage_add_page(image, (*kexec_ops.page_to_pfn)(page)
 								<< PAGE_SHIFT);
 		if (result < 0)
 			goto out;
@@ -861,7 +916,7 @@ static int kimage_load_crash_segment(struct kimage *image,
 		char *ptr;
 		size_t uchunk, mchunk;
 
-		page = pfn_to_page(maddr >> PAGE_SHIFT);
+		page = (*kexec_ops.pfn_to_page)(maddr >> PAGE_SHIFT);
 		if (!page) {
 			result  = -ENOMEM;
 			goto out;
@@ -900,12 +955,13 @@ static int kimage_load_segment(struct kimage *image,
 	int result = -ENOMEM;
 
 	switch (image->type) {
+	case KEXEC_TYPE_CRASH:
+		if (!kexec_ops.crash_alloc_temp_store) {
+			result = kimage_load_crash_segment(image, segment);
+			break;
+		}
 	case KEXEC_TYPE_DEFAULT:
 		result = kimage_load_normal_segment(image, segment);
-		break;
-	case KEXEC_TYPE_CRASH:
-		result = kimage_load_crash_segment(image, segment);
-		break;
 	}
 
 	return result;
@@ -993,6 +1049,7 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
 			/* Free any current crash dump kernel before
 			 * we corrupt it.
 			 */
+			(*kexec_ops.machine_kexec_unload)(image);
 			kimage_free(xchg(&kexec_crash_image, NULL));
 			result = kimage_crash_alloc(&image, entry,
 						     nr_segments, segments);
@@ -1003,7 +1060,7 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
 
 		if (flags & KEXEC_PRESERVE_CONTEXT)
 			image->preserve_context = 1;
-		result = machine_kexec_prepare(image);
+		result = (*kexec_ops.machine_kexec_prepare)(image);
 		if (result)
 			goto out;
 
@@ -1016,11 +1073,21 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
 		if (flags & KEXEC_ON_CRASH)
 			crash_unmap_reserved_pages();
 	}
+
+	result = (*kexec_ops.machine_kexec_load)(image);
+
+	if (result)
+		goto out;
+
 	/* Install the new kernel, and  Uninstall the old */
 	image = xchg(dest_image, image);
 
 out:
 	mutex_unlock(&kexec_mutex);
+
+	if (kexec_ops.machine_kexec_unload)
+		(*kexec_ops.machine_kexec_unload)(image);
+
 	kimage_free(image);
 
 	return result;
@@ -1094,7 +1161,7 @@ void crash_kexec(struct pt_regs *regs)
 			crash_setup_regs(&fixed_regs, regs);
 			crash_save_vmcoreinfo();
 			machine_crash_shutdown(&fixed_regs);
-			machine_kexec(kexec_crash_image);
+			(*kexec_ops.machine_kexec)(kexec_crash_image);
 		}
 		mutex_unlock(&kexec_mutex);
 	}
@@ -1116,8 +1183,8 @@ void __weak crash_free_reserved_phys_range(unsigned long begin,
 	unsigned long addr;
 
 	for (addr = begin; addr < end; addr += PAGE_SIZE) {
-		ClearPageReserved(pfn_to_page(addr >> PAGE_SHIFT));
-		init_page_count(pfn_to_page(addr >> PAGE_SHIFT));
+		ClearPageReserved((*kexec_ops.pfn_to_page)(addr >> PAGE_SHIFT));
+		init_page_count((*kexec_ops.pfn_to_page)(addr >> PAGE_SHIFT));
 		free_page((unsigned long)__va(addr));
 		totalram_pages++;
 	}
@@ -1571,10 +1638,10 @@ int kernel_kexec(void)
 	{
 		kernel_restart_prepare(NULL);
 		printk(KERN_EMERG "Starting new kernel\n");
-		machine_shutdown();
+		(*kexec_ops.machine_kexec_shutdown)();
 	}
 
-	machine_kexec(kexec_image);
+	(*kexec_ops.machine_kexec)(kexec_image);
 
 #ifdef CONFIG_KEXEC_JUMP
 	if (kexec_image->preserve_context) {
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:08:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:08:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQr-0000cX-3J; Tue, 20 Nov 2012 15:08:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TapQp-0000bU-Np
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 15:08:11 +0000
Received: from [85.158.143.35:22225] by server-2.bemta-4.messagelabs.com id
	23/74-28922-BDC9BA05; Tue, 20 Nov 2012 15:08:11 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1353424016!16004187!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18822 invoked from network); 20 Nov 2012 15:06:57 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 15:06:57 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="15907430"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 15:06:56 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 15:06:56 +0000
Message-ID: <1353424014.13542.49.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 20 Nov 2012 15:06:54 +0000
In-Reply-To: <50ABA29902000078000A9FB1@nat28.tlf.novell.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 14:32 +0000, Jan Beulich wrote:
> > @@ -517,15 +540,16 @@ static int xennet_start_xmit(struct sk_buff *skb, 
> > struct net_device *dev)
> >  	grant_ref_t ref;
> >  	unsigned long mfn;
> >  	int notify;
> > -	int frags = skb_shinfo(skb)->nr_frags;
> > +	int slots;
> >  	unsigned int offset = offset_in_page(data);
> >  	unsigned int len = skb_headlen(skb);
> >  	unsigned long flags;
> >  
> > -	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
> > -	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
> > -		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
> > -		       frags);
> > +	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
> > +		xennet_count_skb_frag_slots(skb);
> > +	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
> 
> But still - isn't this wrong now (i.e. can't it now validly exceed the
> boundary checked for)?

In practice no because of the property that the number of pages backing
the frags is <= MAX_SKB_FRAGS even if you are using compound pages as
the frags.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:08:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:08:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapQr-0000cX-3J; Tue, 20 Nov 2012 15:08:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TapQp-0000bU-Np
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 15:08:11 +0000
Received: from [85.158.143.35:22225] by server-2.bemta-4.messagelabs.com id
	23/74-28922-BDC9BA05; Tue, 20 Nov 2012 15:08:11 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1353424016!16004187!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18822 invoked from network); 20 Nov 2012 15:06:57 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 15:06:57 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="15907430"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 15:06:56 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 15:06:56 +0000
Message-ID: <1353424014.13542.49.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 20 Nov 2012 15:06:54 +0000
In-Reply-To: <50ABA29902000078000A9FB1@nat28.tlf.novell.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 14:32 +0000, Jan Beulich wrote:
> > @@ -517,15 +540,16 @@ static int xennet_start_xmit(struct sk_buff *skb, 
> > struct net_device *dev)
> >  	grant_ref_t ref;
> >  	unsigned long mfn;
> >  	int notify;
> > -	int frags = skb_shinfo(skb)->nr_frags;
> > +	int slots;
> >  	unsigned int offset = offset_in_page(data);
> >  	unsigned int len = skb_headlen(skb);
> >  	unsigned long flags;
> >  
> > -	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
> > -	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
> > -		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
> > -		       frags);
> > +	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
> > +		xennet_count_skb_frag_slots(skb);
> > +	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
> 
> But still - isn't this wrong now (i.e. can't it now validly exceed the
> boundary checked for)?

In practice no because of the property that the number of pages backing
the frags is <= MAX_SKB_FRAGS even if you are using compound pages as
the frags.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:15:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:15:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapXQ-00022r-54; Tue, 20 Nov 2012 15:15:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TapXO-00022m-K5
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 15:14:58 +0000
Received: from [85.158.143.35:57360] by server-2.bemta-4.messagelabs.com id
	D1/AF-28922-17E9BA05; Tue, 20 Nov 2012 15:14:57 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1353424497!16005571!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11425 invoked from network); 20 Nov 2012 15:14:57 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-21.messagelabs.com with SMTP;
	20 Nov 2012 15:14:57 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 15:14:56 +0000
Message-Id: <50ABACB702000078000AA0C1@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 15:15:51 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353423098-16371-3-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1353423098-16371-3-git-send-email-dgdegra@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: tim@xen.org, keir@xen.org, ian.campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 2/5] xen: domctl XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 15:51, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> --- a/xen/arch/x86/domctl.c
> +++ b/xen/arch/x86/domctl.c
> @@ -96,10 +96,6 @@ long arch_do_domctl(
>  
>          page = mfn_to_page(mfn);
>  
> -        ret = xsm_getpageframeinfo(d);
> -        if ( ret )
> -            break;

This is actually a bug fix - with this still in place, the operation
returns success even if the get_page() below fails.

Jan

> -
>          if ( likely(get_page(page, d)) )
>          {
>              ret = 0;



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:15:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:15:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapXQ-00022r-54; Tue, 20 Nov 2012 15:15:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TapXO-00022m-K5
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 15:14:58 +0000
Received: from [85.158.143.35:57360] by server-2.bemta-4.messagelabs.com id
	D1/AF-28922-17E9BA05; Tue, 20 Nov 2012 15:14:57 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1353424497!16005571!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11425 invoked from network); 20 Nov 2012 15:14:57 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-21.messagelabs.com with SMTP;
	20 Nov 2012 15:14:57 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 15:14:56 +0000
Message-Id: <50ABACB702000078000AA0C1@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 15:15:51 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353423098-16371-3-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1353423098-16371-3-git-send-email-dgdegra@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: tim@xen.org, keir@xen.org, ian.campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 2/5] xen: domctl XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 15:51, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> --- a/xen/arch/x86/domctl.c
> +++ b/xen/arch/x86/domctl.c
> @@ -96,10 +96,6 @@ long arch_do_domctl(
>  
>          page = mfn_to_page(mfn);
>  
> -        ret = xsm_getpageframeinfo(d);
> -        if ( ret )
> -            break;

This is actually a bug fix - with this still in place, the operation
returns success even if the get_page() below fails.

Jan

> -
>          if ( likely(get_page(page, d)) )
>          {
>              ret = 0;



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:22:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:22:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapeP-0002He-4P; Tue, 20 Nov 2012 15:22:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TapeN-0002HZ-LZ
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:22:11 +0000
Received: from [85.158.138.51:15792] by server-7.bemta-3.messagelabs.com id
	F6/BC-01713-220ABA05; Tue, 20 Nov 2012 15:22:10 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353424928!28869231!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21647 invoked from network); 20 Nov 2012 15:22:10 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-15.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 15:22:10 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215057707"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 15:22:08 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 10:22:07 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[0.0.0.0])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TapRP-0003RD-8v;
	Tue, 20 Nov 2012 15:08:47 +0000
Message-ID: <50AB9CFE.7000003@eu.citrix.com>
Date: Tue, 20 Nov 2012 15:08:46 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
	<1353344256.18229.129.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353344256.18229.129.camel@zakaz.uk.xensource.com>
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 19/11/12 16:57, Ian Campbell wrote:
> On Mon, 2012-11-19 at 15:29 +0000, George Dunlap wrote:
>> On 19/11/12 09:55, Ian Campbell wrote:
>>> If we get to this stage then haven't we either already sent something
>>> over the wire for this page or marked it as dirty when we tried and
>>> failed to send it?
>>>
>>> In the former case we don't care that the page is now broken on the
>>> source since the target has got a good pre-breakage copy.
>>>
>>> In the latter case could we not set a flag at the same time as we mark
>>> the page dirty which means "go round at least one more time"?
>> Yeah -- on the last iteration, the VM itself has to be paused; if any
>> pages get broken after that, it doesn't really matter, does it? The real
>> thing is to have a consistent "snapshot" of behavior.
>>
>> I guess the one potentially tricky case to worry about is whether to
>> deliver an MCE to the guest on restore.  Consider the following scenario:
>>
>> - Page A is modified (and marked dirty)
>> - VM paused for last iteration
>> - Page breaks, is marked broken in the p2m
>> - Save code sends page A
>>
>> In that case, the save code would send a "broken" page, and the restore
>> code would mark a page as broken, and we *would* want to deliver an MCE
>> on the far side.  But suppose the last two steps were reversed:
>>
>> - Page A modified
>> - VM paused for last iteration
>> - Save code sends page A
>> - Page breaks, marked broken in the p2m
>>
>> In that case, when the save code sends page A, it will send a good page;
>> there's no need to mark it broken, or to send the guest an MCE.
> I guess you'd want to err on the side of stopping using a good page, as
> opposed to continuing to use a bad page? i.e. its better to take a
> spurious vMCE than to not take an actual one.

While that's true, taking a spurious MCE means at very least one less 
page available to the guest to use (for HVM guests that haven't 
ballooned down, at least), and the unnecessary loss of the data in that 
page.

The problem I guess is that the save code at the moment has no way of 
distinguishing the following cases:
1. Marked broken after the last time I sent it, but before the VM was 
paused; but the page hasn't been written to
2. Marked broken after the VM was paused; page hadn't been written to
3. Marked broken after the VM was paused, but the page had been written to

In case 1, we definitely need to send a broken page; but the VM may have 
already received a vMCE.  In case 2, we don't need to send a broken page 
or a vMCE, while in #3 we need to do both.

On the other hand, the whole situation is hopefully rare enough that 
maybe we can just do the simple correct thing, even if it's a tiny bit 
sub-optimal.  In that case, assuming that spurious vMCEs aren't a 
problem (e.g., #1), I think we basically just need to see if the last 
iteration contains a broken page, and if so, send the guest a vMCE on 
resume.

Thoughts?

> I'm not actually sure what a guest does with a vMCE, I guess it does
> some sort of memory exchange to give the bad page back to the h/v and
> get a good page in return? If the hypervisor thinks the old page is ok
> rather than bad I guess it'll just put it in the free list instead of
> the bad list?

Yes, I'm pretty sure the hypervisor's accounting of broken pages is 
separate from guest p2m entries; I think if you mark a p2m entry broken, 
the hypervisor will just free the ram page that was mapped there before.

I think the guest just tries to recover gracefully when it gets a vMCE 
(e.g., by re-reading the page from disk or killing the process).  I 
don't think it asks the hypervisor for another page to replace it at 
this point.

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:22:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:22:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapeP-0002He-4P; Tue, 20 Nov 2012 15:22:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TapeN-0002HZ-LZ
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:22:11 +0000
Received: from [85.158.138.51:15792] by server-7.bemta-3.messagelabs.com id
	F6/BC-01713-220ABA05; Tue, 20 Nov 2012 15:22:10 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353424928!28869231!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21647 invoked from network); 20 Nov 2012 15:22:10 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-15.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 15:22:10 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215057707"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 15:22:08 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 10:22:07 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[0.0.0.0])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TapRP-0003RD-8v;
	Tue, 20 Nov 2012 15:08:47 +0000
Message-ID: <50AB9CFE.7000003@eu.citrix.com>
Date: Tue, 20 Nov 2012 15:08:46 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
	<1353344256.18229.129.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353344256.18229.129.camel@zakaz.uk.xensource.com>
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 19/11/12 16:57, Ian Campbell wrote:
> On Mon, 2012-11-19 at 15:29 +0000, George Dunlap wrote:
>> On 19/11/12 09:55, Ian Campbell wrote:
>>> If we get to this stage then haven't we either already sent something
>>> over the wire for this page or marked it as dirty when we tried and
>>> failed to send it?
>>>
>>> In the former case we don't care that the page is now broken on the
>>> source since the target has got a good pre-breakage copy.
>>>
>>> In the latter case could we not set a flag at the same time as we mark
>>> the page dirty which means "go round at least one more time"?
>> Yeah -- on the last iteration, the VM itself has to be paused; if any
>> pages get broken after that, it doesn't really matter, does it? The real
>> thing is to have a consistent "snapshot" of behavior.
>>
>> I guess the one potentially tricky case to worry about is whether to
>> deliver an MCE to the guest on restore.  Consider the following scenario:
>>
>> - Page A is modified (and marked dirty)
>> - VM paused for last iteration
>> - Page breaks, is marked broken in the p2m
>> - Save code sends page A
>>
>> In that case, the save code would send a "broken" page, and the restore
>> code would mark a page as broken, and we *would* want to deliver an MCE
>> on the far side.  But suppose the last two steps were reversed:
>>
>> - Page A modified
>> - VM paused for last iteration
>> - Save code sends page A
>> - Page breaks, marked broken in the p2m
>>
>> In that case, when the save code sends page A, it will send a good page;
>> there's no need to mark it broken, or to send the guest an MCE.
> I guess you'd want to err on the side of stopping using a good page, as
> opposed to continuing to use a bad page? i.e. its better to take a
> spurious vMCE than to not take an actual one.

While that's true, taking a spurious MCE means at very least one less 
page available to the guest to use (for HVM guests that haven't 
ballooned down, at least), and the unnecessary loss of the data in that 
page.

The problem I guess is that the save code at the moment has no way of 
distinguishing the following cases:
1. Marked broken after the last time I sent it, but before the VM was 
paused; but the page hasn't been written to
2. Marked broken after the VM was paused; page hadn't been written to
3. Marked broken after the VM was paused, but the page had been written to

In case 1, we definitely need to send a broken page; but the VM may have 
already received a vMCE.  In case 2, we don't need to send a broken page 
or a vMCE, while in #3 we need to do both.

On the other hand, the whole situation is hopefully rare enough that 
maybe we can just do the simple correct thing, even if it's a tiny bit 
sub-optimal.  In that case, assuming that spurious vMCEs aren't a 
problem (e.g., #1), I think we basically just need to see if the last 
iteration contains a broken page, and if so, send the guest a vMCE on 
resume.

Thoughts?

> I'm not actually sure what a guest does with a vMCE, I guess it does
> some sort of memory exchange to give the bad page back to the h/v and
> get a good page in return? If the hypervisor thinks the old page is ok
> rather than bad I guess it'll just put it in the free list instead of
> the bad list?

Yes, I'm pretty sure the hypervisor's accounting of broken pages is 
separate from guest p2m entries; I think if you mark a p2m entry broken, 
the hypervisor will just free the ram page that was mapped there before.

I think the guest just tries to recover gracefully when it gets a vMCE 
(e.g., by re-reading the page from disk or killing the process).  I 
don't think it asks the hypervisor for another page to replace it at 
this point.

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:25:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:25:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taph8-0002OP-Oy; Tue, 20 Nov 2012 15:25:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Taph7-0002OI-Cf
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 15:25:01 +0000
Received: from [85.158.138.51:13105] by server-6.bemta-3.messagelabs.com id
	17/64-28265-CC0ABA05; Tue, 20 Nov 2012 15:25:00 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1353425099!30769592!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8938 invoked from network); 20 Nov 2012 15:25:00 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-174.messagelabs.com with SMTP;
	20 Nov 2012 15:25:00 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 15:24:59 +0000
Message-Id: <50ABAF1302000078000AA0D5@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 15:25:55 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353423098-16371-4-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1353423098-16371-4-git-send-email-dgdegra@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: tim@xen.org, keir@xen.org, ian.campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 3/5] xen: sysctl XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 15:51, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> A number of the sysctl XSM hooks have no parameters or only pass the
> operation ID, making them redundant with the xsm_sysctl hook. Remove
> these redundant hooks.
> 
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>  xen/arch/x86/platform_hypercall.c |  12 ----

This is slightly confusing given the title/description.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:25:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:25:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taph8-0002OP-Oy; Tue, 20 Nov 2012 15:25:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Taph7-0002OI-Cf
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 15:25:01 +0000
Received: from [85.158.138.51:13105] by server-6.bemta-3.messagelabs.com id
	17/64-28265-CC0ABA05; Tue, 20 Nov 2012 15:25:00 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1353425099!30769592!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8938 invoked from network); 20 Nov 2012 15:25:00 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-174.messagelabs.com with SMTP;
	20 Nov 2012 15:25:00 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 15:24:59 +0000
Message-Id: <50ABAF1302000078000AA0D5@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 15:25:55 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353423098-16371-4-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1353423098-16371-4-git-send-email-dgdegra@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: tim@xen.org, keir@xen.org, ian.campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 3/5] xen: sysctl XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 15:51, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> A number of the sysctl XSM hooks have no parameters or only pass the
> operation ID, making them redundant with the xsm_sysctl hook. Remove
> these redundant hooks.
> 
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>  xen/arch/x86/platform_hypercall.c |  12 ----

This is slightly confusing given the title/description.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:28:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:28:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tapkb-0002Y4-Dh; Tue, 20 Nov 2012 15:28:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <eric.dumazet@gmail.com>) id 1Tapka-0002Xz-CG
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 15:28:36 +0000
Received: from [85.158.139.83:24803] by server-12.bemta-5.messagelabs.com id
	F4/CA-02886-3A1ABA05; Tue, 20 Nov 2012 15:28:35 +0000
X-Env-Sender: eric.dumazet@gmail.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1353425313!30434246!1
X-Originating-IP: [209.85.210.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24136 invoked from network); 20 Nov 2012 15:28:35 -0000
Received: from mail-ia0-f173.google.com (HELO mail-ia0-f173.google.com)
	(209.85.210.173)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 15:28:35 -0000
Received: by mail-ia0-f173.google.com with SMTP id w21so3612944iac.32
	for <xen-devel@lists.xen.org>; Tue, 20 Nov 2012 07:28:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=subject:from:to:cc:in-reply-to:references:content-type:date
	:message-id:mime-version:x-mailer:content-transfer-encoding;
	bh=Xbrp23dkoOc6sQYStgdg7Di9Dc5Q2Gqelz+LWL80B5o=;
	b=WJTGF9+lwd5SozBGVjcyLVX9DFiFQ6VSvABq3pX414rEPZ+EybR3G5fSsEPfKMgfH9
	+LRbkpGkPtc7l9OMoUWkTgsGdo7kDJvbCjD7ClGsLyEGhc/ISDj8Q9awL81kZjsZrlJQ
	HBdCPZatAGYnUD9dPlfjYAOOQLCaBjr2LsjplLNHw/0IsmrzeBSKLIqrjyneB1QyuG9D
	937a+uwCcli+4+vOzCoh0UOx9hYKMyXIW28wqOF2sKA3LA+1vfcbasOmJFJ4m+mhoXek
	hAioLEup1eD0OzszHFQmpkhtVrgv7INHX2x//turSehzwxBwX0lP/XrFWrwTEryx5cNz
	yeCw==
Received: by 10.50.157.162 with SMTP id wn2mr10573516igb.27.1353425313311;
	Tue, 20 Nov 2012 07:28:33 -0800 (PST)
Received: from [172.16.51.125] ([172.16.51.125])
	by mx.google.com with ESMTPS id bg10sm9655150igc.6.2012.11.20.07.28.28
	(version=SSLv3 cipher=OTHER); Tue, 20 Nov 2012 07:28:32 -0800 (PST)
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1353424014.13542.49.camel@zakaz.uk.xensource.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
Date: Tue, 20 Nov 2012 07:28:28 -0800
Message-ID: <1353425308.2590.11.camel@edumazet-glaptop>
Mime-Version: 1.0
X-Mailer: Evolution 2.28.3 
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 15:06 +0000, Ian Campbell wrote:

> In practice no because of the property that the number of pages backing
> the frags is <= MAX_SKB_FRAGS even if you are using compound pages as
> the frags.

Yes, but you can make this test trigger with some hacks from userland
(since the frag allocator is per task instead of per socket), so you
should remove the dump_stack() ?

Best way would be to count exact number of slots.

This could be something like 48 slots for a single skb

(if each frag is 4098 (1+4096+1)bytes, only the last one is around 4000
bytes)

MAX_SKB_FRAGS is really number of frags, while your driver needs a count
of 'order-0' 'frames'




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:28:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:28:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tapkb-0002Y4-Dh; Tue, 20 Nov 2012 15:28:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <eric.dumazet@gmail.com>) id 1Tapka-0002Xz-CG
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 15:28:36 +0000
Received: from [85.158.139.83:24803] by server-12.bemta-5.messagelabs.com id
	F4/CA-02886-3A1ABA05; Tue, 20 Nov 2012 15:28:35 +0000
X-Env-Sender: eric.dumazet@gmail.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1353425313!30434246!1
X-Originating-IP: [209.85.210.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24136 invoked from network); 20 Nov 2012 15:28:35 -0000
Received: from mail-ia0-f173.google.com (HELO mail-ia0-f173.google.com)
	(209.85.210.173)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 15:28:35 -0000
Received: by mail-ia0-f173.google.com with SMTP id w21so3612944iac.32
	for <xen-devel@lists.xen.org>; Tue, 20 Nov 2012 07:28:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=subject:from:to:cc:in-reply-to:references:content-type:date
	:message-id:mime-version:x-mailer:content-transfer-encoding;
	bh=Xbrp23dkoOc6sQYStgdg7Di9Dc5Q2Gqelz+LWL80B5o=;
	b=WJTGF9+lwd5SozBGVjcyLVX9DFiFQ6VSvABq3pX414rEPZ+EybR3G5fSsEPfKMgfH9
	+LRbkpGkPtc7l9OMoUWkTgsGdo7kDJvbCjD7ClGsLyEGhc/ISDj8Q9awL81kZjsZrlJQ
	HBdCPZatAGYnUD9dPlfjYAOOQLCaBjr2LsjplLNHw/0IsmrzeBSKLIqrjyneB1QyuG9D
	937a+uwCcli+4+vOzCoh0UOx9hYKMyXIW28wqOF2sKA3LA+1vfcbasOmJFJ4m+mhoXek
	hAioLEup1eD0OzszHFQmpkhtVrgv7INHX2x//turSehzwxBwX0lP/XrFWrwTEryx5cNz
	yeCw==
Received: by 10.50.157.162 with SMTP id wn2mr10573516igb.27.1353425313311;
	Tue, 20 Nov 2012 07:28:33 -0800 (PST)
Received: from [172.16.51.125] ([172.16.51.125])
	by mx.google.com with ESMTPS id bg10sm9655150igc.6.2012.11.20.07.28.28
	(version=SSLv3 cipher=OTHER); Tue, 20 Nov 2012 07:28:32 -0800 (PST)
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1353424014.13542.49.camel@zakaz.uk.xensource.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
Date: Tue, 20 Nov 2012 07:28:28 -0800
Message-ID: <1353425308.2590.11.camel@edumazet-glaptop>
Mime-Version: 1.0
X-Mailer: Evolution 2.28.3 
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 15:06 +0000, Ian Campbell wrote:

> In practice no because of the property that the number of pages backing
> the frags is <= MAX_SKB_FRAGS even if you are using compound pages as
> the frags.

Yes, but you can make this test trigger with some hacks from userland
(since the frag allocator is per task instead of per socket), so you
should remove the dump_stack() ?

Best way would be to count exact number of slots.

This could be something like 48 slots for a single skb

(if each frag is 4098 (1+4096+1)bytes, only the last one is around 4000
bytes)

MAX_SKB_FRAGS is really number of frags, while your driver needs a count
of 'order-0' 'frames'




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:44:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapzS-0002na-UF; Tue, 20 Nov 2012 15:43:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TapzQ-0002nV-QW
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 15:43:57 +0000
Received: from [85.158.137.99:33054] by server-12.bemta-3.messagelabs.com id
	C1/96-22757-C35ABA05; Tue, 20 Nov 2012 15:43:56 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353426235!19779740!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 520 invoked from network); 20 Nov 2012 15:43:55 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-217.messagelabs.com with SMTP;
	20 Nov 2012 15:43:55 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 15:43:54 +0000
Message-Id: <50ABB38202000078000AA0FD@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 15:44:50 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353424014.13542.49.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 16:06, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Tue, 2012-11-20 at 14:32 +0000, Jan Beulich wrote:
>> > @@ -517,15 +540,16 @@ static int xennet_start_xmit(struct sk_buff *skb, 
>> > struct net_device *dev)
>> >  	grant_ref_t ref;
>> >  	unsigned long mfn;
>> >  	int notify;
>> > -	int frags = skb_shinfo(skb)->nr_frags;
>> > +	int slots;
>> >  	unsigned int offset = offset_in_page(data);
>> >  	unsigned int len = skb_headlen(skb);
>> >  	unsigned long flags;
>> >  
>> > -	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
>> > -	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
>> > -		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
>> > -		       frags);
>> > +	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
>> > +		xennet_count_skb_frag_slots(skb);
>> > +	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
>> 
>> But still - isn't this wrong now (i.e. can't it now validly exceed the
>> boundary checked for)?
> 
> In practice no because of the property that the number of pages backing
> the frags is <= MAX_SKB_FRAGS even if you are using compound pages as
> the frags.

So are you saying that there is something in the system
preventing up to MAX_SKB_FRAGS * SKB_FRAG_PAGE_ORDER
(or NETDEV_FRAG_PAGE_MAX_ORDER) skb-s to be created? I
didn't find any. I do notice that __netdev_alloc_frag() currently
never gets called with a size larger than PAGE_SIZE, but
considering that the function just recently got made capable of
that, I'm sure respective users will show up rather sooner than
later.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:44:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TapzS-0002na-UF; Tue, 20 Nov 2012 15:43:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TapzQ-0002nV-QW
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 15:43:57 +0000
Received: from [85.158.137.99:33054] by server-12.bemta-3.messagelabs.com id
	C1/96-22757-C35ABA05; Tue, 20 Nov 2012 15:43:56 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353426235!19779740!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 520 invoked from network); 20 Nov 2012 15:43:55 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-217.messagelabs.com with SMTP;
	20 Nov 2012 15:43:55 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 15:43:54 +0000
Message-Id: <50ABB38202000078000AA0FD@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 15:44:50 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353424014.13542.49.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 16:06, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Tue, 2012-11-20 at 14:32 +0000, Jan Beulich wrote:
>> > @@ -517,15 +540,16 @@ static int xennet_start_xmit(struct sk_buff *skb, 
>> > struct net_device *dev)
>> >  	grant_ref_t ref;
>> >  	unsigned long mfn;
>> >  	int notify;
>> > -	int frags = skb_shinfo(skb)->nr_frags;
>> > +	int slots;
>> >  	unsigned int offset = offset_in_page(data);
>> >  	unsigned int len = skb_headlen(skb);
>> >  	unsigned long flags;
>> >  
>> > -	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
>> > -	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
>> > -		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
>> > -		       frags);
>> > +	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
>> > +		xennet_count_skb_frag_slots(skb);
>> > +	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
>> 
>> But still - isn't this wrong now (i.e. can't it now validly exceed the
>> boundary checked for)?
> 
> In practice no because of the property that the number of pages backing
> the frags is <= MAX_SKB_FRAGS even if you are using compound pages as
> the frags.

So are you saying that there is something in the system
preventing up to MAX_SKB_FRAGS * SKB_FRAG_PAGE_ORDER
(or NETDEV_FRAG_PAGE_MAX_ORDER) skb-s to be created? I
didn't find any. I do notice that __netdev_alloc_frag() currently
never gets called with a size larger than PAGE_SIZE, but
considering that the function just recently got made capable of
that, I'm sure respective users will show up rather sooner than
later.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:45:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:45:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taq0x-0002sY-EM; Tue, 20 Nov 2012 15:45:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1Taq0x-0002sT-01
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 15:45:31 +0000
Received: from [85.158.143.99:21314] by server-3.bemta-4.messagelabs.com id
	68/EA-06841-A95ABA05; Tue, 20 Nov 2012 15:45:30 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1353426328!21555660!1
X-Originating-IP: [192.134.164.105]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12952 invoked from network); 20 Nov 2012 15:45:29 -0000
Received: from mail4-relais-sop.national.inria.fr (HELO
	mail4-relais-sop.national.inria.fr) (192.134.164.105)
	by server-10.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 15:45:29 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352070000"; d="scan'208";a="163160893"
Received: from unknown (HELO type.ipv6) ([193.50.110.58])
	by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	20 Nov 2012 16:45:26 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1Taq0r-0007WH-VY; Tue, 20 Nov 2012 16:45:25 +0100
Date: Tue, 20 Nov 2012 16:45:25 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121120154525.GA6241@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	xen-devel@lists.xen.org, Ian.Campbell@citrix.com
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs
 to stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Tue 20 Nov 2012 09:21:10 -0500, a =E9crit :
> Add 3 new libraries to stubdom:
> libgmp
> polarssl
> Berlios TPM Emulator 0.7.4
> =

> Also adds makefile structure for vtpm-stubdom and vtpmmgrdom
> =

> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>

Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:45:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:45:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taq0x-0002sY-EM; Tue, 20 Nov 2012 15:45:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1Taq0x-0002sT-01
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 15:45:31 +0000
Received: from [85.158.143.99:21314] by server-3.bemta-4.messagelabs.com id
	68/EA-06841-A95ABA05; Tue, 20 Nov 2012 15:45:30 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1353426328!21555660!1
X-Originating-IP: [192.134.164.105]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12952 invoked from network); 20 Nov 2012 15:45:29 -0000
Received: from mail4-relais-sop.national.inria.fr (HELO
	mail4-relais-sop.national.inria.fr) (192.134.164.105)
	by server-10.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 15:45:29 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352070000"; d="scan'208";a="163160893"
Received: from unknown (HELO type.ipv6) ([193.50.110.58])
	by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	20 Nov 2012 16:45:26 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1Taq0r-0007WH-VY; Tue, 20 Nov 2012 16:45:25 +0100
Date: Tue, 20 Nov 2012 16:45:25 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121120154525.GA6241@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	xen-devel@lists.xen.org, Ian.Campbell@citrix.com
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs
 to stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Tue 20 Nov 2012 09:21:10 -0500, a =E9crit :
> Add 3 new libraries to stubdom:
> libgmp
> polarssl
> Berlios TPM Emulator 0.7.4
> =

> Also adds makefile structure for vtpm-stubdom and vtpmmgrdom
> =

> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>

Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:51:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:51:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taq6l-00036G-8c; Tue, 20 Nov 2012 15:51:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Taq6j-00036B-Qn
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:51:30 +0000
Received: from [85.158.139.83:57301] by server-11.bemta-5.messagelabs.com id
	B9/A0-03409-107ABA05; Tue, 20 Nov 2012 15:51:29 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1353426672!27180066!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12676 invoked from network); 20 Nov 2012 15:51:12 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-182.messagelabs.com with SMTP;
	20 Nov 2012 15:51:12 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 15:51:12 +0000
Message-Id: <50ABB53702000078000AA11D@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 15:52:07 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel Kiper" <daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
In-Reply-To: <1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	ebiederm@xmission.com, hpa@zytor.com, tglx@linutronix.de
Subject: Re: [Xen-devel] [PATCH v2 02/11] x86/kexec: Add extra pointers to
 transition page table PGD, PUD, PMD and PTE
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 16:04, Daniel Kiper <daniel.kiper@oracle.com> wrote:
> Some implementations (e.g. Xen PVOPS) could not use part of identity page 
> table
> to construct transition page table. It means that they require separate 
> PUDs,
> PMDs and PTEs for virtual and physical (identity) mapping. To satisfy that
> requirement add extra pointer to PGD, PUD, PMD and PTE and align existing 
> code.

As said for v1 already - this is not really a requirement of the
interface, or else none of our Xen kernels since 2.6.30 would
have worked. I don't think it is desirable to introduce overhead
for everyone if it's not even needed for Xen.

Jan

> Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
> ---
>  arch/x86/include/asm/kexec.h       |   10 +++++++---
>  arch/x86/kernel/machine_kexec_64.c |   12 ++++++------
>  2 files changed, 13 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h
> index 317ff17..3cf5600 100644
> --- a/arch/x86/include/asm/kexec.h
> +++ b/arch/x86/include/asm/kexec.h
> @@ -157,9 +157,13 @@ struct kimage_arch {
>  };
>  #else
>  struct kimage_arch {
> -	pud_t *pud;
> -	pmd_t *pmd;
> -	pte_t *pte;
> +	pgd_t *pgd;
> +	pud_t *pud0;
> +	pud_t *pud1;
> +	pmd_t *pmd0;
> +	pmd_t *pmd1;
> +	pte_t *pte0;
> +	pte_t *pte1;
>  };
>  #endif
>  
> diff --git a/arch/x86/kernel/machine_kexec_64.c 
> b/arch/x86/kernel/machine_kexec_64.c
> index b3ea9db..976e54b 100644
> --- a/arch/x86/kernel/machine_kexec_64.c
> +++ b/arch/x86/kernel/machine_kexec_64.c
> @@ -137,9 +137,9 @@ out:
>  
>  static void free_transition_pgtable(struct kimage *image)
>  {
> -	free_page((unsigned long)image->arch.pud);
> -	free_page((unsigned long)image->arch.pmd);
> -	free_page((unsigned long)image->arch.pte);
> +	free_page((unsigned long)image->arch.pud0);
> +	free_page((unsigned long)image->arch.pmd0);
> +	free_page((unsigned long)image->arch.pte0);
>  }
>  
>  static int init_transition_pgtable(struct kimage *image, pgd_t *pgd)
> @@ -157,7 +157,7 @@ static int init_transition_pgtable(struct kimage *image, 
> pgd_t *pgd)
>  		pud = (pud_t *)get_zeroed_page(GFP_KERNEL);
>  		if (!pud)
>  			goto err;
> -		image->arch.pud = pud;
> +		image->arch.pud0 = pud;
>  		set_pgd(pgd, __pgd(__pa(pud) | _KERNPG_TABLE));
>  	}
>  	pud = pud_offset(pgd, vaddr);
> @@ -165,7 +165,7 @@ static int init_transition_pgtable(struct kimage *image, 
> pgd_t *pgd)
>  		pmd = (pmd_t *)get_zeroed_page(GFP_KERNEL);
>  		if (!pmd)
>  			goto err;
> -		image->arch.pmd = pmd;
> +		image->arch.pmd0 = pmd;
>  		set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE));
>  	}
>  	pmd = pmd_offset(pud, vaddr);
> @@ -173,7 +173,7 @@ static int init_transition_pgtable(struct kimage *image, 
> pgd_t *pgd)
>  		pte = (pte_t *)get_zeroed_page(GFP_KERNEL);
>  		if (!pte)
>  			goto err;
> -		image->arch.pte = pte;
> +		image->arch.pte0 = pte;
>  		set_pmd(pmd, __pmd(__pa(pte) | _KERNPG_TABLE));
>  	}
>  	pte = pte_offset_kernel(pmd, vaddr);
> -- 
> 1.5.6.5




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:51:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:51:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taq6l-00036G-8c; Tue, 20 Nov 2012 15:51:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Taq6j-00036B-Qn
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 15:51:30 +0000
Received: from [85.158.139.83:57301] by server-11.bemta-5.messagelabs.com id
	B9/A0-03409-107ABA05; Tue, 20 Nov 2012 15:51:29 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1353426672!27180066!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12676 invoked from network); 20 Nov 2012 15:51:12 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-182.messagelabs.com with SMTP;
	20 Nov 2012 15:51:12 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 15:51:12 +0000
Message-Id: <50ABB53702000078000AA11D@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 15:52:07 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel Kiper" <daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
In-Reply-To: <1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	ebiederm@xmission.com, hpa@zytor.com, tglx@linutronix.de
Subject: Re: [Xen-devel] [PATCH v2 02/11] x86/kexec: Add extra pointers to
 transition page table PGD, PUD, PMD and PTE
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 16:04, Daniel Kiper <daniel.kiper@oracle.com> wrote:
> Some implementations (e.g. Xen PVOPS) could not use part of identity page 
> table
> to construct transition page table. It means that they require separate 
> PUDs,
> PMDs and PTEs for virtual and physical (identity) mapping. To satisfy that
> requirement add extra pointer to PGD, PUD, PMD and PTE and align existing 
> code.

As said for v1 already - this is not really a requirement of the
interface, or else none of our Xen kernels since 2.6.30 would
have worked. I don't think it is desirable to introduce overhead
for everyone if it's not even needed for Xen.

Jan

> Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
> ---
>  arch/x86/include/asm/kexec.h       |   10 +++++++---
>  arch/x86/kernel/machine_kexec_64.c |   12 ++++++------
>  2 files changed, 13 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h
> index 317ff17..3cf5600 100644
> --- a/arch/x86/include/asm/kexec.h
> +++ b/arch/x86/include/asm/kexec.h
> @@ -157,9 +157,13 @@ struct kimage_arch {
>  };
>  #else
>  struct kimage_arch {
> -	pud_t *pud;
> -	pmd_t *pmd;
> -	pte_t *pte;
> +	pgd_t *pgd;
> +	pud_t *pud0;
> +	pud_t *pud1;
> +	pmd_t *pmd0;
> +	pmd_t *pmd1;
> +	pte_t *pte0;
> +	pte_t *pte1;
>  };
>  #endif
>  
> diff --git a/arch/x86/kernel/machine_kexec_64.c 
> b/arch/x86/kernel/machine_kexec_64.c
> index b3ea9db..976e54b 100644
> --- a/arch/x86/kernel/machine_kexec_64.c
> +++ b/arch/x86/kernel/machine_kexec_64.c
> @@ -137,9 +137,9 @@ out:
>  
>  static void free_transition_pgtable(struct kimage *image)
>  {
> -	free_page((unsigned long)image->arch.pud);
> -	free_page((unsigned long)image->arch.pmd);
> -	free_page((unsigned long)image->arch.pte);
> +	free_page((unsigned long)image->arch.pud0);
> +	free_page((unsigned long)image->arch.pmd0);
> +	free_page((unsigned long)image->arch.pte0);
>  }
>  
>  static int init_transition_pgtable(struct kimage *image, pgd_t *pgd)
> @@ -157,7 +157,7 @@ static int init_transition_pgtable(struct kimage *image, 
> pgd_t *pgd)
>  		pud = (pud_t *)get_zeroed_page(GFP_KERNEL);
>  		if (!pud)
>  			goto err;
> -		image->arch.pud = pud;
> +		image->arch.pud0 = pud;
>  		set_pgd(pgd, __pgd(__pa(pud) | _KERNPG_TABLE));
>  	}
>  	pud = pud_offset(pgd, vaddr);
> @@ -165,7 +165,7 @@ static int init_transition_pgtable(struct kimage *image, 
> pgd_t *pgd)
>  		pmd = (pmd_t *)get_zeroed_page(GFP_KERNEL);
>  		if (!pmd)
>  			goto err;
> -		image->arch.pmd = pmd;
> +		image->arch.pmd0 = pmd;
>  		set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE));
>  	}
>  	pmd = pmd_offset(pud, vaddr);
> @@ -173,7 +173,7 @@ static int init_transition_pgtable(struct kimage *image, 
> pgd_t *pgd)
>  		pte = (pte_t *)get_zeroed_page(GFP_KERNEL);
>  		if (!pte)
>  			goto err;
> -		image->arch.pte = pte;
> +		image->arch.pte0 = pte;
>  		set_pmd(pmd, __pmd(__pa(pte) | _KERNPG_TABLE));
>  	}
>  	pte = pte_offset_kernel(pmd, vaddr);
> -- 
> 1.5.6.5




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:54:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:54:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taq9B-0003Cd-UY; Tue, 20 Nov 2012 15:54:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Taq9A-0003CQ-FT
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 15:54:00 +0000
Received: from [85.158.137.99:25666] by server-9.bemta-3.messagelabs.com id
	B8/FE-02388-797ABA05; Tue, 20 Nov 2012 15:53:59 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1353426836!19896583!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3NTEwMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21631 invoked from network); 20 Nov 2012 15:53:57 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-13.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 20 Nov 2012 15:53:57 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAKFrq8N005310
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 20 Nov 2012 15:53:53 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAKFrpqk019750
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 20 Nov 2012 15:53:52 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAKFrpwx025728; Tue, 20 Nov 2012 09:53:51 -0600
MIME-Version: 1.0
Message-ID: <2c098858-2357-43f0-bdbe-98618cd1564e@default>
Date: Tue, 20 Nov 2012 07:53:48 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Matthew Daley <mattjd@gmail.com>
References: <eb3e7e6a-13f2-41a0-9a3e-e149de4040ac@default>
	<CA+nUz_JU_pY06T0GOM90rMieOTW_gj44DwAFTqn5cbW6prP2Pg@mail.gmail.com>
In-Reply-To: <CA+nUz_JU_pY06T0GOM90rMieOTW_gj44DwAFTqn5cbW6prP2Pg@mail.gmail.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Jan Beulich <JBeulich@suse.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v5 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Matthew Daley [mailto:mattjd@gmail.com]
> Subject: Re: [Xen-devel] [RFC/PATCH v5 1/2] hypervisor: XENMEM_claim_pages (subop of existing)
> hypercall
> 
> On Tue, Nov 20, 2012 at 10:27 AM, Dan Magenheimer
> <dan.magenheimer@oracle.com> wrote:
> > @@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct page_info *page)
> >      ASSERT(page_get_owner(page) == dom_cow);
> >      page_set_owner(page, d);
> >
> > -    if ( d->tot_pages++ == 0 )
> > +    if ( domain_increase_tot_pages(d, 1) == 0 )
> 
> Here, the pre-incremented value of tot_pages is expected to be used in
> the expression..

Hmmm... yes, good catch (both places)!  v6 coming soon :-(

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:54:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:54:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taq9B-0003Cd-UY; Tue, 20 Nov 2012 15:54:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Taq9A-0003CQ-FT
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 15:54:00 +0000
Received: from [85.158.137.99:25666] by server-9.bemta-3.messagelabs.com id
	B8/FE-02388-797ABA05; Tue, 20 Nov 2012 15:53:59 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1353426836!19896583!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3NTEwMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21631 invoked from network); 20 Nov 2012 15:53:57 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-13.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 20 Nov 2012 15:53:57 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAKFrq8N005310
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 20 Nov 2012 15:53:53 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAKFrpqk019750
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 20 Nov 2012 15:53:52 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAKFrpwx025728; Tue, 20 Nov 2012 09:53:51 -0600
MIME-Version: 1.0
Message-ID: <2c098858-2357-43f0-bdbe-98618cd1564e@default>
Date: Tue, 20 Nov 2012 07:53:48 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Matthew Daley <mattjd@gmail.com>
References: <eb3e7e6a-13f2-41a0-9a3e-e149de4040ac@default>
	<CA+nUz_JU_pY06T0GOM90rMieOTW_gj44DwAFTqn5cbW6prP2Pg@mail.gmail.com>
In-Reply-To: <CA+nUz_JU_pY06T0GOM90rMieOTW_gj44DwAFTqn5cbW6prP2Pg@mail.gmail.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Jan Beulich <JBeulich@suse.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v5 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Matthew Daley [mailto:mattjd@gmail.com]
> Subject: Re: [Xen-devel] [RFC/PATCH v5 1/2] hypervisor: XENMEM_claim_pages (subop of existing)
> hypercall
> 
> On Tue, Nov 20, 2012 at 10:27 AM, Dan Magenheimer
> <dan.magenheimer@oracle.com> wrote:
> > @@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct page_info *page)
> >      ASSERT(page_get_owner(page) == dom_cow);
> >      page_set_owner(page, d);
> >
> > -    if ( d->tot_pages++ == 0 )
> > +    if ( domain_increase_tot_pages(d, 1) == 0 )
> 
> Here, the pre-incremented value of tot_pages is expected to be used in
> the expression..

Hmmm... yes, good catch (both places)!  v6 coming soon :-(

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:54:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:54:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taq9q-0003Gi-HM; Tue, 20 Nov 2012 15:54:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Taq9p-0003GU-3x
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 15:54:41 +0000
Received: from [85.158.137.99:38326] by server-8.bemta-3.messagelabs.com id
	C2/D6-07786-0C7ABA05; Tue, 20 Nov 2012 15:54:40 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1353426879!15083646!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5631 invoked from network); 20 Nov 2012 15:54:39 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 15:54:39 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="15908797"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 15:54:39 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 15:54:39 +0000
Message-ID: <1353426878.13542.59.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 20 Nov 2012 15:54:38 +0000
In-Reply-To: <1353425308.2590.11.camel@edumazet-glaptop>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 15:28 +0000, Eric Dumazet wrote:
> On Tue, 2012-11-20 at 15:06 +0000, Ian Campbell wrote:
> 
> > In practice no because of the property that the number of pages backing
> > the frags is <= MAX_SKB_FRAGS even if you are using compound pages as
> > the frags.
> 
> Yes, but you can make this test trigger with some hacks from userland
> (since the frag allocator is per task instead of per socket), so you
> should remove the dump_stack() ?
> 
> Best way would be to count exact number of slots.
> 
> This could be something like 48 slots for a single skb
> 
> (if each frag is 4098 (1+4096+1)bytes, only the last one is around 4000
> bytes)
> 
> MAX_SKB_FRAGS is really number of frags, while your driver needs a count
> of 'order-0' 'frames'

The use of MAX_SKB_FRAGS is a bit misleading here, it's really the max
number of slots which the other end will be willing to receive as a
single frame (in the Ethernet sense), as defined by the PV protocol. It
happens to be the same as MAX_SKB_FRAGS (or it is at least
MAX_SKB_FRAGS, I'm not too sure).

I'll nuke the dump_stack() though -- it's not clear what sort of useful
context it would contain anyway.

Ian.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 15:54:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 15:54:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taq9q-0003Gi-HM; Tue, 20 Nov 2012 15:54:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Taq9p-0003GU-3x
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 15:54:41 +0000
Received: from [85.158.137.99:38326] by server-8.bemta-3.messagelabs.com id
	C2/D6-07786-0C7ABA05; Tue, 20 Nov 2012 15:54:40 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1353426879!15083646!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5631 invoked from network); 20 Nov 2012 15:54:39 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 15:54:39 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="15908797"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 15:54:39 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 15:54:39 +0000
Message-ID: <1353426878.13542.59.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 20 Nov 2012 15:54:38 +0000
In-Reply-To: <1353425308.2590.11.camel@edumazet-glaptop>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 15:28 +0000, Eric Dumazet wrote:
> On Tue, 2012-11-20 at 15:06 +0000, Ian Campbell wrote:
> 
> > In practice no because of the property that the number of pages backing
> > the frags is <= MAX_SKB_FRAGS even if you are using compound pages as
> > the frags.
> 
> Yes, but you can make this test trigger with some hacks from userland
> (since the frag allocator is per task instead of per socket), so you
> should remove the dump_stack() ?
> 
> Best way would be to count exact number of slots.
> 
> This could be something like 48 slots for a single skb
> 
> (if each frag is 4098 (1+4096+1)bytes, only the last one is around 4000
> bytes)
> 
> MAX_SKB_FRAGS is really number of frags, while your driver needs a count
> of 'order-0' 'frames'

The use of MAX_SKB_FRAGS is a bit misleading here, it's really the max
number of slots which the other end will be willing to receive as a
single frame (in the Ethernet sense), as defined by the PV protocol. It
happens to be the same as MAX_SKB_FRAGS (or it is at least
MAX_SKB_FRAGS, I'm not too sure).

I'll nuke the dump_stack() though -- it's not clear what sort of useful
context it would contain anyway.

Ian.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:03:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:03:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqIE-0003yc-Hd; Tue, 20 Nov 2012 16:03:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TaqID-0003yX-92
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:03:21 +0000
Received: from [193.109.254.147:29992] by server-14.bemta-14.messagelabs.com
	id 54/DE-14517-8C9ABA05; Tue, 20 Nov 2012 16:03:20 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1353427397!9554183!1
X-Originating-IP: [209.85.213.171]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28215 invoked from network); 20 Nov 2012 16:03:19 -0000
Received: from mail-ye0-f171.google.com (HELO mail-ye0-f171.google.com)
	(209.85.213.171)
	by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 16:03:19 -0000
Received: by mail-ye0-f171.google.com with SMTP id q11so486973yen.30
	for <xen-devel@lists.xensource.com>;
	Tue, 20 Nov 2012 08:03:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=yRUUalpvsSdFLrjSScpyt9b1sT1YJaGDrND8iNLDpOw=;
	b=P0B1YXlMI16+XI7IW/ngCkeoD7/gDSqk+3mngC/QXkVPN4XPFehU/JvC6nfr5wErrj
	ficWsP8x+zLIev+4h3AS35mnJIOi2LPl+QVly0pvi1eT5BgnQI4EScxsY4UuCUicDJjY
	FJI10/YC0lAm5nGghRM+ZwNQl3EhSb8zSX+z9aoYJya+VyvAygZGIe9I735GRmTEqve8
	guWBiqz/nM/kZboqcjbdppy0yITYksLjFbOWnx9ciuEiqVIDfECqNGluVyfJJna3cnWX
	4ZUQEOQkdUsz6oxhYDcoYXoFK4nr3eLbKP5kvOhGQtMKskgONtLd6N/wmWaod41pYO7i
	8+DQ==
MIME-Version: 1.0
Received: by 10.58.2.71 with SMTP id 7mr22824905ves.42.1353427397463; Tue, 20
	Nov 2012 08:03:17 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Tue, 20 Nov 2012 08:03:17 -0800 (PST)
In-Reply-To: <1345191671.30865.81.camel@zakaz.uk.xensource.com>
References: <0982bad392e4f96fb39a.1345022903@elijah>
	<1345191671.30865.81.camel@zakaz.uk.xensource.com>
Date: Tue, 20 Nov 2012 16:03:17 +0000
X-Google-Sender-Auth: -3wHDKEpdI7SgTTMpRzfJacyDqI
Message-ID: <CAFLBxZYwG4CaeGQnN=nTdcZGo9p=itvn5otkqQig8QhL2gQ10A@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] xl: Suppress spurious warning message for
	cpupool-list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5554103493652770685=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5554103493652770685==
Content-Type: multipart/alternative; boundary=047d7b2e76e0414de704ceef5f3e

--047d7b2e76e0414de704ceef5f3e
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Aug 17, 2012 at 9:21 AM, Ian Campbell <Ian.Campbell@citrix.com>wrote:

> > This patch adds a "probe" argument to cpupool_info(). If set, it won't
> print
> > a warning if the xc_cpupool_getinfo() fails with ENOENT.
>
> Looking at the callers I think the existing "exact" parameter could be
> used instead of a new param -- it would be fine to fail silently on
> ENOENT iff !exact, I think.
>

Hmm -- those two don't seem to me to necessarily mean the same thing; it's
not clear to me that "exact==true" would imply "print an error message" and
"exact==false" would imply "don't print an error message".

But at the moment the two callers of the function pass (true,false) and
(false,true) for those booleans, and it is an internal function, so if it
turns out we need to make a distinction we can always add the extra
parameter in later.

New patch on the way...

 -George

--047d7b2e76e0414de704ceef5f3e
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Aug 17, 2012 at 9:21 AM, Ian Campbell <span dir=3D"ltr">&lt;<a href=
=3D"mailto:Ian.Campbell@citrix.com" target=3D"_blank">Ian.Campbell@citrix.c=
om</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_=
quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">&gt; This patch adds a &quot;probe&quot; arg=
ument to cpupool_info(). If set, it won&#39;t print<br><div class=3D"im">
&gt; a warning if the xc_cpupool_getinfo() fails with ENOENT.<br>
<br>
</div>Looking at the callers I think the existing &quot;exact&quot; paramet=
er could be<br>
used instead of a new param -- it would be fine to fail silently on<br>
ENOENT iff !exact, I think.<br></blockquote><div><br>Hmm -- those two don&#=
39;t seem to me to necessarily mean the same thing; it&#39;s not clear to m=
e that &quot;exact=3D=3Dtrue&quot; would imply &quot;print an error message=
&quot; and &quot;exact=3D=3Dfalse&quot; would imply &quot;don&#39;t print a=
n error message&quot;.<br>
<br>But at the moment the two callers of the function pass (true,false) and=
 (false,true) for those booleans, and it is an internal function, so if it =
turns out we need to make a distinction we can always add the extra paramet=
er in later.<br>
<br>New patch on the way...<br><br>=A0-George<br></div></div></div>

--047d7b2e76e0414de704ceef5f3e--


--===============5554103493652770685==
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.xen.org
http://lists.xen.org/xen-devel

--===============5554103493652770685==--


From xen-devel-bounces@lists.xen.org Tue Nov 20 16:03:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:03:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqIE-0003yc-Hd; Tue, 20 Nov 2012 16:03:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TaqID-0003yX-92
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:03:21 +0000
Received: from [193.109.254.147:29992] by server-14.bemta-14.messagelabs.com
	id 54/DE-14517-8C9ABA05; Tue, 20 Nov 2012 16:03:20 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1353427397!9554183!1
X-Originating-IP: [209.85.213.171]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28215 invoked from network); 20 Nov 2012 16:03:19 -0000
Received: from mail-ye0-f171.google.com (HELO mail-ye0-f171.google.com)
	(209.85.213.171)
	by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 16:03:19 -0000
Received: by mail-ye0-f171.google.com with SMTP id q11so486973yen.30
	for <xen-devel@lists.xensource.com>;
	Tue, 20 Nov 2012 08:03:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=yRUUalpvsSdFLrjSScpyt9b1sT1YJaGDrND8iNLDpOw=;
	b=P0B1YXlMI16+XI7IW/ngCkeoD7/gDSqk+3mngC/QXkVPN4XPFehU/JvC6nfr5wErrj
	ficWsP8x+zLIev+4h3AS35mnJIOi2LPl+QVly0pvi1eT5BgnQI4EScxsY4UuCUicDJjY
	FJI10/YC0lAm5nGghRM+ZwNQl3EhSb8zSX+z9aoYJya+VyvAygZGIe9I735GRmTEqve8
	guWBiqz/nM/kZboqcjbdppy0yITYksLjFbOWnx9ciuEiqVIDfECqNGluVyfJJna3cnWX
	4ZUQEOQkdUsz6oxhYDcoYXoFK4nr3eLbKP5kvOhGQtMKskgONtLd6N/wmWaod41pYO7i
	8+DQ==
MIME-Version: 1.0
Received: by 10.58.2.71 with SMTP id 7mr22824905ves.42.1353427397463; Tue, 20
	Nov 2012 08:03:17 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Tue, 20 Nov 2012 08:03:17 -0800 (PST)
In-Reply-To: <1345191671.30865.81.camel@zakaz.uk.xensource.com>
References: <0982bad392e4f96fb39a.1345022903@elijah>
	<1345191671.30865.81.camel@zakaz.uk.xensource.com>
Date: Tue, 20 Nov 2012 16:03:17 +0000
X-Google-Sender-Auth: -3wHDKEpdI7SgTTMpRzfJacyDqI
Message-ID: <CAFLBxZYwG4CaeGQnN=nTdcZGo9p=itvn5otkqQig8QhL2gQ10A@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] xl: Suppress spurious warning message for
	cpupool-list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5554103493652770685=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5554103493652770685==
Content-Type: multipart/alternative; boundary=047d7b2e76e0414de704ceef5f3e

--047d7b2e76e0414de704ceef5f3e
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Aug 17, 2012 at 9:21 AM, Ian Campbell <Ian.Campbell@citrix.com>wrote:

> > This patch adds a "probe" argument to cpupool_info(). If set, it won't
> print
> > a warning if the xc_cpupool_getinfo() fails with ENOENT.
>
> Looking at the callers I think the existing "exact" parameter could be
> used instead of a new param -- it would be fine to fail silently on
> ENOENT iff !exact, I think.
>

Hmm -- those two don't seem to me to necessarily mean the same thing; it's
not clear to me that "exact==true" would imply "print an error message" and
"exact==false" would imply "don't print an error message".

But at the moment the two callers of the function pass (true,false) and
(false,true) for those booleans, and it is an internal function, so if it
turns out we need to make a distinction we can always add the extra
parameter in later.

New patch on the way...

 -George

--047d7b2e76e0414de704ceef5f3e
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Aug 17, 2012 at 9:21 AM, Ian Campbell <span dir=3D"ltr">&lt;<a href=
=3D"mailto:Ian.Campbell@citrix.com" target=3D"_blank">Ian.Campbell@citrix.c=
om</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_=
quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">&gt; This patch adds a &quot;probe&quot; arg=
ument to cpupool_info(). If set, it won&#39;t print<br><div class=3D"im">
&gt; a warning if the xc_cpupool_getinfo() fails with ENOENT.<br>
<br>
</div>Looking at the callers I think the existing &quot;exact&quot; paramet=
er could be<br>
used instead of a new param -- it would be fine to fail silently on<br>
ENOENT iff !exact, I think.<br></blockquote><div><br>Hmm -- those two don&#=
39;t seem to me to necessarily mean the same thing; it&#39;s not clear to m=
e that &quot;exact=3D=3Dtrue&quot; would imply &quot;print an error message=
&quot; and &quot;exact=3D=3Dfalse&quot; would imply &quot;don&#39;t print a=
n error message&quot;.<br>
<br>But at the moment the two callers of the function pass (true,false) and=
 (false,true) for those booleans, and it is an internal function, so if it =
turns out we need to make a distinction we can always add the extra paramet=
er in later.<br>
<br>New patch on the way...<br><br>=A0-George<br></div></div></div>

--047d7b2e76e0414de704ceef5f3e--


--===============5554103493652770685==
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.xen.org
http://lists.xen.org/xen-devel

--===============5554103493652770685==--


From xen-devel-bounces@lists.xen.org Tue Nov 20 16:04:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:04:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqJH-00041n-0C; Tue, 20 Nov 2012 16:04:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaqJE-00041b-Sw
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:04:25 +0000
Received: from [85.158.138.51:62059] by server-11.bemta-3.messagelabs.com id
	B8/0E-19361-30AABA05; Tue, 20 Nov 2012 16:04:19 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1353427458!26747507!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20302 invoked from network); 20 Nov 2012 16:04:18 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 16:04:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="15909032"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 16:04:18 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 16:04:17 +0000
Message-ID: <1353427456.13542.65.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: xen-devel <xen-devel@lists.xen.org>
Date: Tue, 20 Nov 2012 16:04:16 +0000
In-Reply-To: <1353426878.13542.59.camel@zakaz.uk.xensource.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
	<1353426878.13542.59.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: KonradRzeszutekWilk <konrad@kernel.org>, ANNIE LI <annie.li@oracle.com>
Subject: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
 xen/netfront: handle compound page fragments on transmit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Limiting to just xen-devel folks.

On Tue, 2012-11-20 at 15:54 +0000, Ian Campbell wrote:
> The use of MAX_SKB_FRAGS is a bit misleading here, it's really the max
> number of slots which the other end will be willing to receive as a
> single frame (in the Ethernet sense), as defined by the PV protocol.
> It happens to be the same as MAX_SKB_FRAGS (or it is at least
> MAX_SKB_FRAGS, I'm not too sure). 

This highlights a couple of issues, the main one is that implicitly
including MAX_SKB_FRAGS in the PV net protocol is just madness. It can
and has changed in the past. Someone really needs to (retroactively)
figure out what a sensible default minimum which front and back must
support is and use it in the front and backends instead of
MAX_SKB_FRAGS. Probably something derived from the existing 64K limit
(Linux has used 17 and 18 as MAX_SKB_FRAGS in the past).

Then perhaps implement a feature-flag to allow front and backends to
negotiate something bigger if they like.

It might also be interesting for front and backends to coalesce multiple
ring slots into compound pages.

I don't have time for either of those unfortunately

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:04:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:04:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqJH-00041n-0C; Tue, 20 Nov 2012 16:04:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaqJE-00041b-Sw
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:04:25 +0000
Received: from [85.158.138.51:62059] by server-11.bemta-3.messagelabs.com id
	B8/0E-19361-30AABA05; Tue, 20 Nov 2012 16:04:19 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1353427458!26747507!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20302 invoked from network); 20 Nov 2012 16:04:18 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 16:04:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="15909032"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 16:04:18 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 16:04:17 +0000
Message-ID: <1353427456.13542.65.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: xen-devel <xen-devel@lists.xen.org>
Date: Tue, 20 Nov 2012 16:04:16 +0000
In-Reply-To: <1353426878.13542.59.camel@zakaz.uk.xensource.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
	<1353426878.13542.59.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: KonradRzeszutekWilk <konrad@kernel.org>, ANNIE LI <annie.li@oracle.com>
Subject: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
 xen/netfront: handle compound page fragments on transmit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Limiting to just xen-devel folks.

On Tue, 2012-11-20 at 15:54 +0000, Ian Campbell wrote:
> The use of MAX_SKB_FRAGS is a bit misleading here, it's really the max
> number of slots which the other end will be willing to receive as a
> single frame (in the Ethernet sense), as defined by the PV protocol.
> It happens to be the same as MAX_SKB_FRAGS (or it is at least
> MAX_SKB_FRAGS, I'm not too sure). 

This highlights a couple of issues, the main one is that implicitly
including MAX_SKB_FRAGS in the PV net protocol is just madness. It can
and has changed in the past. Someone really needs to (retroactively)
figure out what a sensible default minimum which front and back must
support is and use it in the front and backends instead of
MAX_SKB_FRAGS. Probably something derived from the existing 64K limit
(Linux has used 17 and 18 as MAX_SKB_FRAGS in the past).

Then perhaps implement a feature-flag to allow front and backends to
negotiate something bigger if they like.

It might also be interesting for front and backends to coalesce multiple
ring slots into compound pages.

I don't have time for either of those unfortunately

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:06:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:06:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqKh-00048l-IC; Tue, 20 Nov 2012 16:05:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaqKg-00048g-Sh
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:05:55 +0000
Received: from [85.158.139.211:43657] by server-12.bemta-5.messagelabs.com id
	30/17-02886-26AABA05; Tue, 20 Nov 2012 16:05:54 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1353427551!20941571!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24697 invoked from network); 20 Nov 2012 16:05:52 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 16:05:52 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215064570"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 16:05:50 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 11:05:50 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TaqFt-0006XV-En;
	Tue, 20 Nov 2012 16:00:57 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: netdev@vger.kernel.org
Date: Tue, 20 Nov 2012 16:00:57 +0000
Message-ID: <1353427257-16789-1-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.2.5
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>,
	Sander Eikelenboom <linux@eikelenboom.it>, ANNIE LI <annie.li@oracle.com>,
	Stefan Bader <stefan.bader@canonical.com>, xen-devel@lists.xen.org,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	Eric Dumazet <edumazet@google.com>
Subject: [Xen-devel] [PATCH V2] xen/netfront: handle compound page fragments
	on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

An SKB paged fragment can consist of a compound page with order > 0.
However the netchannel protocol deals only in PAGE_SIZE frames.

Handle this in xennet_make_frags by iterating over the frames which
make up the page.

This is the netfront equivalent to 6a8ed462f16b for netback.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: netdev@vger.kernel.org
Cc: xen-devel@lists.xen.org
Cc: Eric Dumazet <edumazet@google.com>
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
Cc: ANNIE LI <annie.li@oracle.com>
Cc: Sander Eikelenboom <linux@eikelenboom.it>
Cc: Stefan Bader <stefan.bader@canonical.com>
---
v2: check we have enough room in the ring and that the other end can
    cope with the number of slots in a single frame
---
 drivers/net/xen-netfront.c |   95 ++++++++++++++++++++++++++++++++++----------
 1 files changed, 74 insertions(+), 21 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index caa0110..d9b16f4 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -452,29 +452,82 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
 	/* Grant backend access to each skb fragment page. */
 	for (i = 0; i < frags; i++) {
 		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
+		struct page *page = skb_frag_page(frag);
+		unsigned long size = skb_frag_size(frag);
+		unsigned long offset = frag->page_offset;
 
-		tx->flags |= XEN_NETTXF_more_data;
+		/* Data must not cross a page boundary. */
+		BUG_ON(size + offset > PAGE_SIZE<<compound_order(page));
 
-		id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
-		np->tx_skbs[id].skb = skb_get(skb);
-		tx = RING_GET_REQUEST(&np->tx, prod++);
-		tx->id = id;
-		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
-		BUG_ON((signed short)ref < 0);
+		/* Skip unused frames from start of page */
+		page += offset >> PAGE_SHIFT;
+		offset &= ~PAGE_MASK;
 
-		mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
-		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
-						mfn, GNTMAP_readonly);
+		while (size > 0) {
+			unsigned long bytes;
 
-		tx->gref = np->grant_tx_ref[id] = ref;
-		tx->offset = frag->page_offset;
-		tx->size = skb_frag_size(frag);
-		tx->flags = 0;
+			BUG_ON(offset >= PAGE_SIZE);
+
+			bytes = PAGE_SIZE - offset;
+			if (bytes > size)
+				bytes = size;
+
+			tx->flags |= XEN_NETTXF_more_data;
+
+			id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
+			np->tx_skbs[id].skb = skb_get(skb);
+			tx = RING_GET_REQUEST(&np->tx, prod++);
+			tx->id = id;
+			ref = gnttab_claim_grant_reference(&np->gref_tx_head);
+			BUG_ON((signed short)ref < 0);
+
+			mfn = pfn_to_mfn(page_to_pfn(page));
+			gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
+							mfn, GNTMAP_readonly);
+
+			tx->gref = np->grant_tx_ref[id] = ref;
+			tx->offset = offset;
+			tx->size = bytes;
+			tx->flags = 0;
+
+			offset += bytes;
+			size -= bytes;
+
+			/* Next frame */
+			if (offset == PAGE_SIZE && size) {
+				BUG_ON(!PageCompound(page));
+				page++;
+				offset = 0;
+			}
+		}
 	}
 
 	np->tx.req_prod_pvt = prod;
 }
 
+/*
+ * Count how many ring slots are required to send the frags of this
+ * skb. Each frag might be a compound page.
+ */
+static int xennet_count_skb_frag_slots(struct sk_buff *skb)
+{
+	int i, frags = skb_shinfo(skb)->nr_frags;
+	int pages = 0;
+
+	for (i = 0; i < frags; i++) {
+		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
+		unsigned long size = skb_frag_size(frag);
+		unsigned long offset = frag->page_offset;
+
+		/* Skip unused frames from start of page */
+		offset &= ~PAGE_MASK;
+
+		pages += PFN_UP(offset + size);
+	}
+
+	return pages;
+}
+
 static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	unsigned short id;
@@ -487,23 +540,23 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	grant_ref_t ref;
 	unsigned long mfn;
 	int notify;
-	int frags = skb_shinfo(skb)->nr_frags;
+	int slots;
 	unsigned int offset = offset_in_page(data);
 	unsigned int len = skb_headlen(skb);
 	unsigned long flags;
 
-	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
-	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
-		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
-		       frags);
-		dump_stack();
+	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
+		xennet_count_skb_frag_slots(skb);
+	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
+		printk(KERN_ALERT "xennet: skb rides the rocket: %d slots\n",
+		       slots);
 		goto drop;
 	}
 
 	spin_lock_irqsave(&np->tx_lock, flags);
 
 	if (unlikely(!netif_carrier_ok(dev) ||
-		     (frags > 1 && !xennet_can_sg(dev)) ||
+		     (slots > 1 && !xennet_can_sg(dev)) ||
 		     netif_needs_gso(skb, netif_skb_features(skb)))) {
 		spin_unlock_irqrestore(&np->tx_lock, flags);
 		goto drop;
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:06:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:06:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqKh-00048l-IC; Tue, 20 Nov 2012 16:05:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaqKg-00048g-Sh
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:05:55 +0000
Received: from [85.158.139.211:43657] by server-12.bemta-5.messagelabs.com id
	30/17-02886-26AABA05; Tue, 20 Nov 2012 16:05:54 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1353427551!20941571!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24697 invoked from network); 20 Nov 2012 16:05:52 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 16:05:52 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215064570"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 16:05:50 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 11:05:50 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TaqFt-0006XV-En;
	Tue, 20 Nov 2012 16:00:57 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: netdev@vger.kernel.org
Date: Tue, 20 Nov 2012 16:00:57 +0000
Message-ID: <1353427257-16789-1-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.2.5
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>,
	Sander Eikelenboom <linux@eikelenboom.it>, ANNIE LI <annie.li@oracle.com>,
	Stefan Bader <stefan.bader@canonical.com>, xen-devel@lists.xen.org,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	Eric Dumazet <edumazet@google.com>
Subject: [Xen-devel] [PATCH V2] xen/netfront: handle compound page fragments
	on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

An SKB paged fragment can consist of a compound page with order > 0.
However the netchannel protocol deals only in PAGE_SIZE frames.

Handle this in xennet_make_frags by iterating over the frames which
make up the page.

This is the netfront equivalent to 6a8ed462f16b for netback.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: netdev@vger.kernel.org
Cc: xen-devel@lists.xen.org
Cc: Eric Dumazet <edumazet@google.com>
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
Cc: ANNIE LI <annie.li@oracle.com>
Cc: Sander Eikelenboom <linux@eikelenboom.it>
Cc: Stefan Bader <stefan.bader@canonical.com>
---
v2: check we have enough room in the ring and that the other end can
    cope with the number of slots in a single frame
---
 drivers/net/xen-netfront.c |   95 ++++++++++++++++++++++++++++++++++----------
 1 files changed, 74 insertions(+), 21 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index caa0110..d9b16f4 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -452,29 +452,82 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
 	/* Grant backend access to each skb fragment page. */
 	for (i = 0; i < frags; i++) {
 		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
+		struct page *page = skb_frag_page(frag);
+		unsigned long size = skb_frag_size(frag);
+		unsigned long offset = frag->page_offset;
 
-		tx->flags |= XEN_NETTXF_more_data;
+		/* Data must not cross a page boundary. */
+		BUG_ON(size + offset > PAGE_SIZE<<compound_order(page));
 
-		id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
-		np->tx_skbs[id].skb = skb_get(skb);
-		tx = RING_GET_REQUEST(&np->tx, prod++);
-		tx->id = id;
-		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
-		BUG_ON((signed short)ref < 0);
+		/* Skip unused frames from start of page */
+		page += offset >> PAGE_SHIFT;
+		offset &= ~PAGE_MASK;
 
-		mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
-		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
-						mfn, GNTMAP_readonly);
+		while (size > 0) {
+			unsigned long bytes;
 
-		tx->gref = np->grant_tx_ref[id] = ref;
-		tx->offset = frag->page_offset;
-		tx->size = skb_frag_size(frag);
-		tx->flags = 0;
+			BUG_ON(offset >= PAGE_SIZE);
+
+			bytes = PAGE_SIZE - offset;
+			if (bytes > size)
+				bytes = size;
+
+			tx->flags |= XEN_NETTXF_more_data;
+
+			id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
+			np->tx_skbs[id].skb = skb_get(skb);
+			tx = RING_GET_REQUEST(&np->tx, prod++);
+			tx->id = id;
+			ref = gnttab_claim_grant_reference(&np->gref_tx_head);
+			BUG_ON((signed short)ref < 0);
+
+			mfn = pfn_to_mfn(page_to_pfn(page));
+			gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
+							mfn, GNTMAP_readonly);
+
+			tx->gref = np->grant_tx_ref[id] = ref;
+			tx->offset = offset;
+			tx->size = bytes;
+			tx->flags = 0;
+
+			offset += bytes;
+			size -= bytes;
+
+			/* Next frame */
+			if (offset == PAGE_SIZE && size) {
+				BUG_ON(!PageCompound(page));
+				page++;
+				offset = 0;
+			}
+		}
 	}
 
 	np->tx.req_prod_pvt = prod;
 }
 
+/*
+ * Count how many ring slots are required to send the frags of this
+ * skb. Each frag might be a compound page.
+ */
+static int xennet_count_skb_frag_slots(struct sk_buff *skb)
+{
+	int i, frags = skb_shinfo(skb)->nr_frags;
+	int pages = 0;
+
+	for (i = 0; i < frags; i++) {
+		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
+		unsigned long size = skb_frag_size(frag);
+		unsigned long offset = frag->page_offset;
+
+		/* Skip unused frames from start of page */
+		offset &= ~PAGE_MASK;
+
+		pages += PFN_UP(offset + size);
+	}
+
+	return pages;
+}
+
 static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	unsigned short id;
@@ -487,23 +540,23 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	grant_ref_t ref;
 	unsigned long mfn;
 	int notify;
-	int frags = skb_shinfo(skb)->nr_frags;
+	int slots;
 	unsigned int offset = offset_in_page(data);
 	unsigned int len = skb_headlen(skb);
 	unsigned long flags;
 
-	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
-	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
-		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
-		       frags);
-		dump_stack();
+	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
+		xennet_count_skb_frag_slots(skb);
+	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
+		printk(KERN_ALERT "xennet: skb rides the rocket: %d slots\n",
+		       slots);
 		goto drop;
 	}
 
 	spin_lock_irqsave(&np->tx_lock, flags);
 
 	if (unlikely(!netif_carrier_ok(dev) ||
-		     (frags > 1 && !xennet_can_sg(dev)) ||
+		     (slots > 1 && !xennet_can_sg(dev)) ||
 		     netif_needs_gso(skb, netif_skb_features(skb)))) {
 		spin_unlock_irqrestore(&np->tx_lock, flags);
 		goto drop;
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:09:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:09:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqNt-0004M0-6y; Tue, 20 Nov 2012 16:09:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaqNs-0004Lt-6w
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:09:12 +0000
Received: from [85.158.143.35:47707] by server-2.bemta-4.messagelabs.com id
	30/13-28922-72BABA05; Tue, 20 Nov 2012 16:09:11 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1353427720!11397273!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30604 invoked from network); 20 Nov 2012 16:08:42 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 16:08:42 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="15909168"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 16:08:39 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 16:08:38 +0000
Message-ID: <1353427717.13542.68.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Date: Tue, 20 Nov 2012 16:08:37 +0000
In-Reply-To: <CAFLBxZYwG4CaeGQnN=nTdcZGo9p=itvn5otkqQig8QhL2gQ10A@mail.gmail.com>
References: <0982bad392e4f96fb39a.1345022903@elijah>
	<1345191671.30865.81.camel@zakaz.uk.xensource.com>
	<CAFLBxZYwG4CaeGQnN=nTdcZGo9p=itvn5otkqQig8QhL2gQ10A@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] xl: Suppress spurious warning message for
 cpupool-list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 16:03 +0000, George Dunlap wrote:
> On Fri, Aug 17, 2012 at 9:21 AM, Ian Campbell
> <Ian.Campbell@citrix.com> wrote:
>         > This patch adds a "probe" argument to cpupool_info(). If
>         set, it won't print
>         > a warning if the xc_cpupool_getinfo() fails with ENOENT.
>         
>         
>         Looking at the callers I think the existing "exact" parameter
>         could be
>         used instead of a new param -- it would be fine to fail
>         silently on
>         ENOENT iff !exact, I think.
> 
> Hmm -- those two don't seem to me to necessarily mean the same thing;
> it's not clear to me that "exact==true" would imply "print an error
> message" and "exact==false" would imply "don't print an error
> message".

I think my logic was: If I asked for an exact thing and didn't get it
then that is worth logging. But if I didn't ask for something exact then
it doesn't really matter if it can't be found so no point in logging. If
you see what I mean.

> 
> But at the moment the two callers of the function pass (true,false)
> and (false,true) for those booleans, and it is an internal function,
> so if it turns out we need to make a distinction we can always add the
> extra parameter in later.
> 
> New patch on the way...
> 
>  -George
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:09:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:09:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqNt-0004M0-6y; Tue, 20 Nov 2012 16:09:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TaqNs-0004Lt-6w
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:09:12 +0000
Received: from [85.158.143.35:47707] by server-2.bemta-4.messagelabs.com id
	30/13-28922-72BABA05; Tue, 20 Nov 2012 16:09:11 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1353427720!11397273!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30604 invoked from network); 20 Nov 2012 16:08:42 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 16:08:42 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="15909168"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 16:08:39 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 16:08:38 +0000
Message-ID: <1353427717.13542.68.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Date: Tue, 20 Nov 2012 16:08:37 +0000
In-Reply-To: <CAFLBxZYwG4CaeGQnN=nTdcZGo9p=itvn5otkqQig8QhL2gQ10A@mail.gmail.com>
References: <0982bad392e4f96fb39a.1345022903@elijah>
	<1345191671.30865.81.camel@zakaz.uk.xensource.com>
	<CAFLBxZYwG4CaeGQnN=nTdcZGo9p=itvn5otkqQig8QhL2gQ10A@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] xl: Suppress spurious warning message for
 cpupool-list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 16:03 +0000, George Dunlap wrote:
> On Fri, Aug 17, 2012 at 9:21 AM, Ian Campbell
> <Ian.Campbell@citrix.com> wrote:
>         > This patch adds a "probe" argument to cpupool_info(). If
>         set, it won't print
>         > a warning if the xc_cpupool_getinfo() fails with ENOENT.
>         
>         
>         Looking at the callers I think the existing "exact" parameter
>         could be
>         used instead of a new param -- it would be fine to fail
>         silently on
>         ENOENT iff !exact, I think.
> 
> Hmm -- those two don't seem to me to necessarily mean the same thing;
> it's not clear to me that "exact==true" would imply "print an error
> message" and "exact==false" would imply "don't print an error
> message".

I think my logic was: If I asked for an exact thing and didn't get it
then that is worth logging. But if I didn't ask for something exact then
it doesn't really matter if it can't be found so no point in logging. If
you see what I mean.

> 
> But at the moment the two callers of the function pass (true,false)
> and (false,true) for those booleans, and it is an internal function,
> so if it turns out we need to make a distinction we can always add the
> extra parameter in later.
> 
> New patch on the way...
> 
>  -George
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:11:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqPn-0004TZ-PV; Tue, 20 Nov 2012 16:11:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TaqPl-0004TR-Sm
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:11:10 +0000
Received: from [85.158.137.99:10161] by server-4.bemta-3.messagelabs.com id
	7D/FD-30023-D9BABA05; Tue, 20 Nov 2012 16:11:09 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-8.tower-217.messagelabs.com!1353427866!13052180!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21370 invoked from network); 20 Nov 2012 16:11:07 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-8.tower-217.messagelabs.com with SMTP;
	20 Nov 2012 16:11:07 -0000
X-TM-IMSS-Message-ID: <9d4054d2000bf674@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9d4054d2000bf674 ;
	Tue, 20 Nov 2012 11:10:31 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKGB4sf002878; 
	Tue, 20 Nov 2012 11:11:04 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu
Date: Tue, 20 Nov 2012 11:11:00 -0500
Message-Id: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Since the vTPM implementations are being incorproated into Xen and
possibly upstream Linux, I would like to see if this protocol change
could be added before we have significant legacy implementations. If
not, I still think it would be useful as either a v2 or negotiated
protocol change.

The current vTPM protocol is a copy of the network protocol. This was
likely done for ease of implementation, since support for the network
backend/frontend existed in Linux and minios. However, this
implementation is overly complex when dealing with vTPM packets: for
example, a vTPM never needs to deal with having more than one packet in
flight at any given time.

I will send the corresponding patch for the Linux kernel module once I
have adapted it for the file names used in the upstream version.

------------------------------------>8----------------------------------

This changes the vTPM shared page ABI from a copy of the Xen network
interface to a single-page interface that better reflects the expected
behavior of a TPM: only a single request packet can be sent at any given
time, and every packet sent generates a single response packet. This
protocol change should also increase efficiency as it avoids mapping and
unmapping grants when possible.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/include/tpmback.h  |   1 +
 extras/mini-os/include/tpmfront.h |   7 +-
 extras/mini-os/tpmback.c          | 132 ++++++++++++++-------------------
 extras/mini-os/tpmfront.c         | 150 +++++++++++++++++++-------------------
 xen/include/public/io/tpmif.h     |  45 +++---------
 5 files changed, 148 insertions(+), 187 deletions(-)

diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
index ff86732..ec9eda4 100644
--- a/extras/mini-os/include/tpmback.h
+++ b/extras/mini-os/include/tpmback.h
@@ -43,6 +43,7 @@
 
 struct tpmcmd {
    domid_t domid;		/* Domid of the frontend */
+   uint8_t locality;    /* Locality requested by the frontend */
    unsigned int handle;	/* Handle of the frontend */
    unsigned char uuid[16];			/* uuid of the tpm interface */
 
diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include/tpmfront.h
index fd2cb17..a0c7c4d 100644
--- a/extras/mini-os/include/tpmfront.h
+++ b/extras/mini-os/include/tpmfront.h
@@ -37,9 +37,7 @@ struct tpmfront_dev {
    grant_ref_t ring_ref;
    evtchn_port_t evtchn;
 
-   tpmif_tx_interface_t* tx;
-
-   void** pages;
+   vtpm_shared_page_t *page;
 
    domid_t bedomid;
    char* nodename;
@@ -77,6 +75,9 @@ void shutdown_tpmfront(struct tpmfront_dev* dev);
  * */
 int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen);
 
+/* Set the locality used for communicating with a vTPM */
+int tpmfront_set_locality(struct tpmfront_dev* dev, int locality);
+
 #ifdef HAVE_LIBC
 #include <sys/stat.h>
 /* POSIX IO functions:
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index 658fed1..29aced9 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -86,10 +86,7 @@ struct tpmif {
    evtchn_port_t evtchn;
 
    /* Shared page */
-   tpmif_tx_interface_t* tx;
-
-   /* pointer to TPMIF_RX_RING_SIZE pages */
-   void** pages;
+   vtpm_shared_page_t *page;
 
    enum xenbus_state state;
    enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
@@ -386,8 +383,7 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
    tpmif->fe_state_path = NULL;
    tpmif->state = XenbusStateInitialising;
    tpmif->status = DISCONNECTED;
-   tpmif->tx = NULL;
-   tpmif->pages = NULL;
+   tpmif->page = NULL;
    tpmif->flags = 0;
    memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
    return tpmif;
@@ -395,9 +391,6 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
 
 void __free_tpmif(tpmif_t* tpmif)
 {
-   if(tpmif->pages) {
-      free(tpmif->pages);
-   }
    if(tpmif->fe_path) {
       free(tpmif->fe_path);
    }
@@ -430,12 +423,6 @@ tpmif_t* new_tpmif(domid_t domid, unsigned int handle)
       goto error;
    }
 
-   /* allocate pages to be used for shared mapping */
-   if((tpmif->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE)) == NULL) {
-      goto error;
-   }
-   memset(tpmif->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-
    if(tpmif_change_state(tpmif, XenbusStateInitWait)) {
       goto error;
    }
@@ -486,7 +473,7 @@ void free_tpmif(tpmif_t* tpmif)
       tpmif->status = DISCONNECTING;
       mask_evtchn(tpmif->evtchn);
 
-      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1)) {
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
 	 TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
       }
 
@@ -529,9 +516,10 @@ void free_tpmif(tpmif_t* tpmif)
 void tpmback_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
 {
    tpmif_t* tpmif = (tpmif_t*) data;
-   tpmif_tx_request_t* tx = &tpmif->tx->ring[0].req;
-   /* Throw away 0 size events, these can trigger from event channel unmasking */
-   if(tx->size == 0)
+   vtpm_shared_page_t* pg = tpmif->page;
+
+   /* Only pay attention if the request is ready */
+   if (pg->state == 0)
       return;
 
    TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
@@ -585,11 +573,10 @@ int connect_fe(tpmif_t* tpmif)
    free(value);
 
    domid = tpmif->domid;
-   if((tpmif->tx = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
+   if((tpmif->page = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
       TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
       return -1;
    }
-   memset(tpmif->tx, 0, PAGE_SIZE);
 
    /*Bind the event channel */
    if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler, tpmif, &tpmif->evtchn)))
@@ -618,10 +605,28 @@ error_post_evtchn:
    mask_evtchn(tpmif->evtchn);
    unbind_evtchn(tpmif->evtchn);
 error_post_map:
-   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1);
+   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1);
    return -1;
 }
 
+static void disconnect_fe(tpmif_t* tpmif)
+{
+   if (tpmif->status == CONNECTED) {
+      tpmif->status = DISCONNECTING;
+      mask_evtchn(tpmif->evtchn);
+
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
+	 TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
+      }
+
+      unbind_evtchn(tpmif->evtchn);
+   }
+   tpmif->status = DISCONNECTED;
+   tpmif_change_state(tpmif, XenbusStateReconfigured);
+
+   TPMBACK_LOG("Frontend %u/%u disconnected\n", (unsigned int) tpmif->domid, tpmif->handle);
+}
+
 static int frontend_changed(tpmif_t* tpmif)
 {
    int state = xenbus_read_integer(tpmif->fe_state_path);
@@ -874,6 +879,7 @@ void shutdown_tpmback(void)
 inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, unsigned char uuid[16])
 {
    tpmcmd->domid = domid;
+   tpmcmd->locality = -1;
    tpmcmd->handle = handle;
    memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
    tpmcmd->req = NULL;
@@ -884,12 +890,12 @@ inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, un
 
 tpmcmd_t* get_request(tpmif_t* tpmif) {
    tpmcmd_t* cmd;
-   tpmif_tx_request_t* tx;
-   int offset;
-   int tocopy;
-   int i;
-   uint32_t domid;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+int i;
+#endif
 
    local_irq_save(flags);
 
@@ -899,35 +905,22 @@ tpmcmd_t* get_request(tpmif_t* tpmif) {
    }
    init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);
 
-   tx = &tpmif->tx->ring[0].req;
-   cmd->req_len = tx->size;
+   shr = tpmif->page;
+   cmd->req_len = shr->length;
+   cmd->locality = shr->locality;
+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->req_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
+   }
    /* Allocate the buffer */
    if(cmd->req_len) {
       if((cmd->req = malloc(cmd->req_len)) == NULL) {
 	 goto error;
       }
    }
-   /* Copy the bits from the shared pages */
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->req_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_READ)) == NULL) {
-	 TPMBACK_ERR("%u/%u Unable to map shared page during read!\n", (unsigned int) tpmif->domid, tpmif->handle);
-	 goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->req_len - offset, PAGE_SIZE);
-      memcpy(&cmd->req[offset], tpmif->pages[i], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
-
-   }
+   /* Copy the bits from the shared page(s) */
+   memcpy(cmd->req, offset + (uint8_t*)shr, cmd->req_len);
 
 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Received Tpm Command from %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->req_len);
@@ -958,38 +951,24 @@ error:
 
 void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
 {
-   tpmif_tx_request_t* tx;
-   int offset;
-   int i;
-   uint32_t domid;
-   int tocopy;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+int i;
+#endif
 
    local_irq_save(flags);
 
-   tx = &tpmif->tx->ring[0].req;
-   tx->size = cmd->resp_len;
-
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->resp_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_WRITE)) == NULL) {
-	 TPMBACK_ERR("%u/%u Unable to map shared page during write!\n", (unsigned int) tpmif->domid, tpmif->handle);
-	 goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->resp_len - offset, PAGE_SIZE);
-      memcpy(tpmif->pages[i], &cmd->resp[offset], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
+   shr = tpmif->page;
+   shr->length = cmd->resp_len;
 
+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->resp_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
    }
+   memcpy(offset + (uint8_t*)shr, cmd->resp, cmd->resp_len);
 
 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Sent response to %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->resp_len);
@@ -1003,6 +982,7 @@ void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
 #endif
    /* clear the ready flag and send the event channel notice to the frontend */
    tpmif_req_finished(tpmif);
+   shr->state = 0;
    notify_remote_via_evtchn(tpmif->evtchn);
 error:
    local_irq_restore(flags);
diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
index 0218d7f..bcee93d 100644
--- a/extras/mini-os/tpmfront.c
+++ b/extras/mini-os/tpmfront.c
@@ -153,6 +153,32 @@ static int wait_for_backend_closed(xenbus_event_queue* events, char* path)
 
 }
 
+static int wait_for_backend_reconfig(xenbus_event_queue* events, char* path)
+{
+   int state;
+
+   TPMFRONT_LOG("Waiting for backend to reconfigure...\n");
+   while(1) {
+      state = xenbus_read_integer(path);
+      if ( state < 0)
+	 state = XenbusStateUnknown;
+      switch(state) {
+	 case XenbusStateUnknown:
+	    TPMFRONT_ERR("Backend Unknown state, forcing shutdown\n");
+	    return -1;
+	 case XenbusStateClosed:
+	    TPMFRONT_LOG("Backend Closed\n");
+	    return 0;
+	 case XenbusStateReconfigured:
+	    TPMFRONT_LOG("Backend Reconfigured\n");
+	    return 0;
+	 default:
+	    xenbus_wait_for_watch(events);
+      }
+   }
+
+}
+
 static int wait_for_backend_state_changed(struct tpmfront_dev* dev, XenbusState state) {
    char* err;
    int ret = 0;
@@ -175,8 +201,11 @@ static int wait_for_backend_state_changed(struct tpmfront_dev* dev, XenbusState
       case XenbusStateClosed:
 	 ret = wait_for_backend_closed(&events, path);
 	 break;
-      default:
+      case XenbusStateReconfigured:
+	 ret = wait_for_backend_reconfig(&events, path);
 	 break;
+      default:
+         TPMFRONT_ERR("Bad wait state %d, ignoring\n", state);
    }
 
    if((err = xenbus_unwatch_path_token(XBT_NIL, path, path))) {
@@ -190,13 +219,13 @@ static int tpmfront_connect(struct tpmfront_dev* dev)
 {
    char* err;
    /* Create shared page */
-   dev->tx = (tpmif_tx_interface_t*) alloc_page();
-   if(dev->tx == NULL) {
+   dev->page = (vtpm_shared_page_t*) alloc_page();
+   if(dev->page == NULL) {
       TPMFRONT_ERR("Unable to allocate page for shared memory\n");
       goto error;
    }
-   memset(dev->tx, 0, PAGE_SIZE);
-   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->tx), 0);
+   memset(dev->page, 0, PAGE_SIZE);
+   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->page), 0);
    TPMFRONT_DEBUG("grant ref is %lu\n", (unsigned long) dev->ring_ref);
 
    /*Create event channel */
@@ -228,7 +257,7 @@ error_postevtchn:
       unbind_evtchn(dev->evtchn);
 error_postmap:
       gnttab_end_access(dev->ring_ref);
-      free_page(dev->tx);
+      free_page(dev->page);
 error:
    return -1;
 }
@@ -240,7 +269,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
    char path[512];
    char* value, *err;
    unsigned long long ival;
-   int i;
 
    printk("============= Init TPM Front ================\n");
 
@@ -289,19 +317,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
       goto error;
    }
 
-   /* Allocate pages that will contain the messages */
-   dev->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE);
-   if(dev->pages == NULL) {
-      goto error;
-   }
-   memset(dev->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-   for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-      dev->pages[i] = (void*)alloc_page();
-      if(dev->pages[i] == NULL) {
-	 goto error;
-      }
-   }
-
    TPMFRONT_LOG("Initialization Completed successfully\n");
 
    return dev;
@@ -314,12 +329,10 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
 {
    char* err;
    char path[512];
-   int i;
-   tpmif_tx_request_t* tx;
    if(dev == NULL) {
       return;
    }
-   TPMFRONT_LOG("Shutting down tpmfront\n");
+   TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for reconfigure" : "");
    /* disconnect */
    if(dev->state == XenbusStateConnected) {
       dev->state = XenbusStateClosing;
@@ -349,27 +362,12 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
       /* Wait for the backend to close and unmap shared pages, ignore any errors */
       wait_for_backend_state_changed(dev, XenbusStateClosed);
 
-      /* Cleanup any shared pages */
-      if(dev->pages) {
-	 for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-	    if(dev->pages[i]) {
-	       tx = &dev->tx->ring[i].req;
-	       if(tx->ref != 0) {
-		  gnttab_end_access(tx->ref);
-	       }
-	       free_page(dev->pages[i]);
-	    }
-	 }
-	 free(dev->pages);
-      }
-
       /* Close event channel and unmap shared page */
       mask_evtchn(dev->evtchn);
       unbind_evtchn(dev->evtchn);
       gnttab_end_access(dev->ring_ref);
 
-      free_page(dev->tx);
-
+      free_page(dev->page);
    }
 
    /* Cleanup memory usage */
@@ -387,13 +385,17 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
 
 int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 {
-   int i;
-   tpmif_tx_request_t* tx = NULL;
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
+int i;
+#endif
    /* Error Checking */
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to send message through disconnected frontend\n");
       return -1;
    }
+   shr = dev->page;
 
 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Sending Msg to backend size=%u", (unsigned int) length);
@@ -407,19 +409,16 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 #endif
 
    /* Copy to shared pages now */
-   for(i = 0; length > 0 && i < TPMIF_TX_RING_SIZE; ++i) {
-      /* Share the page */
-      tx = &dev->tx->ring[i].req;
-      tx->unused = 0;
-      tx->addr = virt_to_mach(dev->pages[i]);
-      tx->ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->pages[i]), 0);
-      /* Copy the bits to the page */
-      tx->size = length > PAGE_SIZE ? PAGE_SIZE : length;
-      memcpy(dev->pages[i], &msg[i * PAGE_SIZE], tx->size);
-
-      /* Update counters */
-      length -= tx->size;
+   offset = sizeof(*shr);
+   if (length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Message too long for shared page\n");
+      return -1;
    }
+   memcpy(offset + (uint8_t*)shr, msg, length);
+   shr->length = length;
+   barrier();
+   shr->state = 1;
+
    dev->waiting = 1;
    dev->resplen = 0;
 #ifdef HAVE_LIBC
@@ -434,44 +433,41 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 }
 int tpmfront_recv(struct tpmfront_dev* dev, uint8_t** msg, size_t *length)
 {
-   tpmif_tx_request_t* tx;
-   int i;
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
+int i;
+#endif
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to receive message from disconnected frontend\n");
       return -1;
    }
    /*Wait for the response */
    wait_event(dev->waitq, (!dev->waiting));
+   shr = dev->page;
+   if (shr->state != 0)
+      goto quit;
 
    /* Initialize */
    *msg = NULL;
-   *length = 0;
+   *length = shr->length;
+   offset = sizeof(*shr);
 
-   /* special case, just quit */
-   tx = &dev->tx->ring[0].req;
-   if(tx->size == 0 ) {
-       goto quit;
-   }
-   /* Get the total size */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      *length += tx->size;
+   if (*length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Reply too long for shared page\n");
+      return -1;
    }
+
    /* Alloc the buffer */
    if(dev->respbuf) {
       free(dev->respbuf);
    }
    *msg = dev->respbuf = malloc(*length);
    dev->resplen = *length;
+
    /* Copy the bits */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      memcpy(&(*msg)[i * PAGE_SIZE], dev->pages[i], tx->size);
-      gnttab_end_access(tx->ref);
-      tx->ref = 0;
-   }
+   memcpy(*msg, offset + (uint8_t*)shr, *length);
+
 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Received response from backend size=%u", (unsigned int) *length);
    for(i = 0; i < *length; ++i) {
@@ -504,6 +500,14 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t*
    return 0;
 }
 
+int tpmfront_set_locality(struct tpmfront_dev* dev, int locality)
+{
+   if (!dev || !dev->page)
+      return -1;
+   dev->page->locality = locality;
+   return 0;
+}
+
 #ifdef HAVE_LIBC
 #include <errno.h>
 int tpmfront_open(struct tpmfront_dev* dev)
diff --git a/xen/include/public/io/tpmif.h b/xen/include/public/io/tpmif.h
index 02ccdab..afc9181 100644
--- a/xen/include/public/io/tpmif.h
+++ b/xen/include/public/io/tpmif.h
@@ -1,7 +1,7 @@
 /******************************************************************************
  * tpmif.h
  *
- * TPM I/O interface for Xen guest OSes.
+ * TPM I/O interface for Xen guest OSes, v2
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -21,48 +21,23 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  *
- * Copyright (c) 2005, IBM Corporation
- *
- * Author: Stefan Berger, stefanb@us.ibm.com
- * Grant table support: Mahadevan Gomathisankaran
- *
- * This code has been derived from tools/libxc/xen/io/netif.h
- *
- * Copyright (c) 2003-2004, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_IO_TPMIF_H__
 #define __XEN_PUBLIC_IO_TPMIF_H__
 
-#include "../grant_table.h"
+struct vtpm_shared_page {
+    uint16_t length;         /* request/response length in bytes */
 
-struct tpmif_tx_request {
-    unsigned long addr;   /* Machine address of packet.   */
-    grant_ref_t ref;      /* grant table access reference */
-    uint16_t unused;
-    uint16_t size;        /* Packet size in bytes.        */
-};
-typedef struct tpmif_tx_request tpmif_tx_request_t;
-
-/*
- * The TPMIF_TX_RING_SIZE defines the number of pages the
- * front-end and backend can exchange (= size of array).
- */
-typedef uint32_t TPMIF_RING_IDX;
-
-#define TPMIF_TX_RING_SIZE 1
-
-/* This structure must fit in a memory page. */
-
-struct tpmif_ring {
-    struct tpmif_tx_request req;
-};
-typedef struct tpmif_ring tpmif_ring_t;
+    uint8_t state;           /* 0 - response ready / idle
+                              * 1 - request ready / working */
+    uint8_t locality;        /* for the current request */
+    uint8_t padding[3];
 
-struct tpmif_tx_interface {
-    struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
+    uint8_t nr_extra_pages;  /* extra pages for long packets; may be zero */
+    uint32_t extra_pages[0]; /* grant IDs; length is actually nr_extra_pages */
 };
-typedef struct tpmif_tx_interface tpmif_tx_interface_t;
+typedef struct vtpm_shared_page vtpm_shared_page_t;
 
 #endif
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:11:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqPn-0004TZ-PV; Tue, 20 Nov 2012 16:11:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TaqPl-0004TR-Sm
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:11:10 +0000
Received: from [85.158.137.99:10161] by server-4.bemta-3.messagelabs.com id
	7D/FD-30023-D9BABA05; Tue, 20 Nov 2012 16:11:09 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-8.tower-217.messagelabs.com!1353427866!13052180!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21370 invoked from network); 20 Nov 2012 16:11:07 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-8.tower-217.messagelabs.com with SMTP;
	20 Nov 2012 16:11:07 -0000
X-TM-IMSS-Message-ID: <9d4054d2000bf674@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9d4054d2000bf674 ;
	Tue, 20 Nov 2012 11:10:31 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKGB4sf002878; 
	Tue, 20 Nov 2012 11:11:04 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu
Date: Tue, 20 Nov 2012 11:11:00 -0500
Message-Id: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Since the vTPM implementations are being incorproated into Xen and
possibly upstream Linux, I would like to see if this protocol change
could be added before we have significant legacy implementations. If
not, I still think it would be useful as either a v2 or negotiated
protocol change.

The current vTPM protocol is a copy of the network protocol. This was
likely done for ease of implementation, since support for the network
backend/frontend existed in Linux and minios. However, this
implementation is overly complex when dealing with vTPM packets: for
example, a vTPM never needs to deal with having more than one packet in
flight at any given time.

I will send the corresponding patch for the Linux kernel module once I
have adapted it for the file names used in the upstream version.

------------------------------------>8----------------------------------

This changes the vTPM shared page ABI from a copy of the Xen network
interface to a single-page interface that better reflects the expected
behavior of a TPM: only a single request packet can be sent at any given
time, and every packet sent generates a single response packet. This
protocol change should also increase efficiency as it avoids mapping and
unmapping grants when possible.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/include/tpmback.h  |   1 +
 extras/mini-os/include/tpmfront.h |   7 +-
 extras/mini-os/tpmback.c          | 132 ++++++++++++++-------------------
 extras/mini-os/tpmfront.c         | 150 +++++++++++++++++++-------------------
 xen/include/public/io/tpmif.h     |  45 +++---------
 5 files changed, 148 insertions(+), 187 deletions(-)

diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
index ff86732..ec9eda4 100644
--- a/extras/mini-os/include/tpmback.h
+++ b/extras/mini-os/include/tpmback.h
@@ -43,6 +43,7 @@
 
 struct tpmcmd {
    domid_t domid;		/* Domid of the frontend */
+   uint8_t locality;    /* Locality requested by the frontend */
    unsigned int handle;	/* Handle of the frontend */
    unsigned char uuid[16];			/* uuid of the tpm interface */
 
diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include/tpmfront.h
index fd2cb17..a0c7c4d 100644
--- a/extras/mini-os/include/tpmfront.h
+++ b/extras/mini-os/include/tpmfront.h
@@ -37,9 +37,7 @@ struct tpmfront_dev {
    grant_ref_t ring_ref;
    evtchn_port_t evtchn;
 
-   tpmif_tx_interface_t* tx;
-
-   void** pages;
+   vtpm_shared_page_t *page;
 
    domid_t bedomid;
    char* nodename;
@@ -77,6 +75,9 @@ void shutdown_tpmfront(struct tpmfront_dev* dev);
  * */
 int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen);
 
+/* Set the locality used for communicating with a vTPM */
+int tpmfront_set_locality(struct tpmfront_dev* dev, int locality);
+
 #ifdef HAVE_LIBC
 #include <sys/stat.h>
 /* POSIX IO functions:
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index 658fed1..29aced9 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -86,10 +86,7 @@ struct tpmif {
    evtchn_port_t evtchn;
 
    /* Shared page */
-   tpmif_tx_interface_t* tx;
-
-   /* pointer to TPMIF_RX_RING_SIZE pages */
-   void** pages;
+   vtpm_shared_page_t *page;
 
    enum xenbus_state state;
    enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
@@ -386,8 +383,7 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
    tpmif->fe_state_path = NULL;
    tpmif->state = XenbusStateInitialising;
    tpmif->status = DISCONNECTED;
-   tpmif->tx = NULL;
-   tpmif->pages = NULL;
+   tpmif->page = NULL;
    tpmif->flags = 0;
    memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
    return tpmif;
@@ -395,9 +391,6 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
 
 void __free_tpmif(tpmif_t* tpmif)
 {
-   if(tpmif->pages) {
-      free(tpmif->pages);
-   }
    if(tpmif->fe_path) {
       free(tpmif->fe_path);
    }
@@ -430,12 +423,6 @@ tpmif_t* new_tpmif(domid_t domid, unsigned int handle)
       goto error;
    }
 
-   /* allocate pages to be used for shared mapping */
-   if((tpmif->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE)) == NULL) {
-      goto error;
-   }
-   memset(tpmif->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-
    if(tpmif_change_state(tpmif, XenbusStateInitWait)) {
       goto error;
    }
@@ -486,7 +473,7 @@ void free_tpmif(tpmif_t* tpmif)
       tpmif->status = DISCONNECTING;
       mask_evtchn(tpmif->evtchn);
 
-      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1)) {
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
 	 TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
       }
 
@@ -529,9 +516,10 @@ void free_tpmif(tpmif_t* tpmif)
 void tpmback_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
 {
    tpmif_t* tpmif = (tpmif_t*) data;
-   tpmif_tx_request_t* tx = &tpmif->tx->ring[0].req;
-   /* Throw away 0 size events, these can trigger from event channel unmasking */
-   if(tx->size == 0)
+   vtpm_shared_page_t* pg = tpmif->page;
+
+   /* Only pay attention if the request is ready */
+   if (pg->state == 0)
       return;
 
    TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
@@ -585,11 +573,10 @@ int connect_fe(tpmif_t* tpmif)
    free(value);
 
    domid = tpmif->domid;
-   if((tpmif->tx = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
+   if((tpmif->page = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
       TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
       return -1;
    }
-   memset(tpmif->tx, 0, PAGE_SIZE);
 
    /*Bind the event channel */
    if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler, tpmif, &tpmif->evtchn)))
@@ -618,10 +605,28 @@ error_post_evtchn:
    mask_evtchn(tpmif->evtchn);
    unbind_evtchn(tpmif->evtchn);
 error_post_map:
-   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1);
+   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1);
    return -1;
 }
 
+static void disconnect_fe(tpmif_t* tpmif)
+{
+   if (tpmif->status == CONNECTED) {
+      tpmif->status = DISCONNECTING;
+      mask_evtchn(tpmif->evtchn);
+
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
+	 TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
+      }
+
+      unbind_evtchn(tpmif->evtchn);
+   }
+   tpmif->status = DISCONNECTED;
+   tpmif_change_state(tpmif, XenbusStateReconfigured);
+
+   TPMBACK_LOG("Frontend %u/%u disconnected\n", (unsigned int) tpmif->domid, tpmif->handle);
+}
+
 static int frontend_changed(tpmif_t* tpmif)
 {
    int state = xenbus_read_integer(tpmif->fe_state_path);
@@ -874,6 +879,7 @@ void shutdown_tpmback(void)
 inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, unsigned char uuid[16])
 {
    tpmcmd->domid = domid;
+   tpmcmd->locality = -1;
    tpmcmd->handle = handle;
    memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
    tpmcmd->req = NULL;
@@ -884,12 +890,12 @@ inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, un
 
 tpmcmd_t* get_request(tpmif_t* tpmif) {
    tpmcmd_t* cmd;
-   tpmif_tx_request_t* tx;
-   int offset;
-   int tocopy;
-   int i;
-   uint32_t domid;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+int i;
+#endif
 
    local_irq_save(flags);
 
@@ -899,35 +905,22 @@ tpmcmd_t* get_request(tpmif_t* tpmif) {
    }
    init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);
 
-   tx = &tpmif->tx->ring[0].req;
-   cmd->req_len = tx->size;
+   shr = tpmif->page;
+   cmd->req_len = shr->length;
+   cmd->locality = shr->locality;
+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->req_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
+   }
    /* Allocate the buffer */
    if(cmd->req_len) {
       if((cmd->req = malloc(cmd->req_len)) == NULL) {
 	 goto error;
       }
    }
-   /* Copy the bits from the shared pages */
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->req_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_READ)) == NULL) {
-	 TPMBACK_ERR("%u/%u Unable to map shared page during read!\n", (unsigned int) tpmif->domid, tpmif->handle);
-	 goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->req_len - offset, PAGE_SIZE);
-      memcpy(&cmd->req[offset], tpmif->pages[i], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
-
-   }
+   /* Copy the bits from the shared page(s) */
+   memcpy(cmd->req, offset + (uint8_t*)shr, cmd->req_len);
 
 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Received Tpm Command from %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->req_len);
@@ -958,38 +951,24 @@ error:
 
 void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
 {
-   tpmif_tx_request_t* tx;
-   int offset;
-   int i;
-   uint32_t domid;
-   int tocopy;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+int i;
+#endif
 
    local_irq_save(flags);
 
-   tx = &tpmif->tx->ring[0].req;
-   tx->size = cmd->resp_len;
-
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->resp_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_WRITE)) == NULL) {
-	 TPMBACK_ERR("%u/%u Unable to map shared page during write!\n", (unsigned int) tpmif->domid, tpmif->handle);
-	 goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->resp_len - offset, PAGE_SIZE);
-      memcpy(tpmif->pages[i], &cmd->resp[offset], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
+   shr = tpmif->page;
+   shr->length = cmd->resp_len;
 
+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->resp_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
    }
+   memcpy(offset + (uint8_t*)shr, cmd->resp, cmd->resp_len);
 
 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Sent response to %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->resp_len);
@@ -1003,6 +982,7 @@ void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
 #endif
    /* clear the ready flag and send the event channel notice to the frontend */
    tpmif_req_finished(tpmif);
+   shr->state = 0;
    notify_remote_via_evtchn(tpmif->evtchn);
 error:
    local_irq_restore(flags);
diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
index 0218d7f..bcee93d 100644
--- a/extras/mini-os/tpmfront.c
+++ b/extras/mini-os/tpmfront.c
@@ -153,6 +153,32 @@ static int wait_for_backend_closed(xenbus_event_queue* events, char* path)
 
 }
 
+static int wait_for_backend_reconfig(xenbus_event_queue* events, char* path)
+{
+   int state;
+
+   TPMFRONT_LOG("Waiting for backend to reconfigure...\n");
+   while(1) {
+      state = xenbus_read_integer(path);
+      if ( state < 0)
+	 state = XenbusStateUnknown;
+      switch(state) {
+	 case XenbusStateUnknown:
+	    TPMFRONT_ERR("Backend Unknown state, forcing shutdown\n");
+	    return -1;
+	 case XenbusStateClosed:
+	    TPMFRONT_LOG("Backend Closed\n");
+	    return 0;
+	 case XenbusStateReconfigured:
+	    TPMFRONT_LOG("Backend Reconfigured\n");
+	    return 0;
+	 default:
+	    xenbus_wait_for_watch(events);
+      }
+   }
+
+}
+
 static int wait_for_backend_state_changed(struct tpmfront_dev* dev, XenbusState state) {
    char* err;
    int ret = 0;
@@ -175,8 +201,11 @@ static int wait_for_backend_state_changed(struct tpmfront_dev* dev, XenbusState
       case XenbusStateClosed:
 	 ret = wait_for_backend_closed(&events, path);
 	 break;
-      default:
+      case XenbusStateReconfigured:
+	 ret = wait_for_backend_reconfig(&events, path);
 	 break;
+      default:
+         TPMFRONT_ERR("Bad wait state %d, ignoring\n", state);
    }
 
    if((err = xenbus_unwatch_path_token(XBT_NIL, path, path))) {
@@ -190,13 +219,13 @@ static int tpmfront_connect(struct tpmfront_dev* dev)
 {
    char* err;
    /* Create shared page */
-   dev->tx = (tpmif_tx_interface_t*) alloc_page();
-   if(dev->tx == NULL) {
+   dev->page = (vtpm_shared_page_t*) alloc_page();
+   if(dev->page == NULL) {
       TPMFRONT_ERR("Unable to allocate page for shared memory\n");
       goto error;
    }
-   memset(dev->tx, 0, PAGE_SIZE);
-   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->tx), 0);
+   memset(dev->page, 0, PAGE_SIZE);
+   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->page), 0);
    TPMFRONT_DEBUG("grant ref is %lu\n", (unsigned long) dev->ring_ref);
 
    /*Create event channel */
@@ -228,7 +257,7 @@ error_postevtchn:
       unbind_evtchn(dev->evtchn);
 error_postmap:
       gnttab_end_access(dev->ring_ref);
-      free_page(dev->tx);
+      free_page(dev->page);
 error:
    return -1;
 }
@@ -240,7 +269,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
    char path[512];
    char* value, *err;
    unsigned long long ival;
-   int i;
 
    printk("============= Init TPM Front ================\n");
 
@@ -289,19 +317,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
       goto error;
    }
 
-   /* Allocate pages that will contain the messages */
-   dev->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE);
-   if(dev->pages == NULL) {
-      goto error;
-   }
-   memset(dev->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-   for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-      dev->pages[i] = (void*)alloc_page();
-      if(dev->pages[i] == NULL) {
-	 goto error;
-      }
-   }
-
    TPMFRONT_LOG("Initialization Completed successfully\n");
 
    return dev;
@@ -314,12 +329,10 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
 {
    char* err;
    char path[512];
-   int i;
-   tpmif_tx_request_t* tx;
    if(dev == NULL) {
       return;
    }
-   TPMFRONT_LOG("Shutting down tpmfront\n");
+   TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for reconfigure" : "");
    /* disconnect */
    if(dev->state == XenbusStateConnected) {
       dev->state = XenbusStateClosing;
@@ -349,27 +362,12 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
       /* Wait for the backend to close and unmap shared pages, ignore any errors */
       wait_for_backend_state_changed(dev, XenbusStateClosed);
 
-      /* Cleanup any shared pages */
-      if(dev->pages) {
-	 for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-	    if(dev->pages[i]) {
-	       tx = &dev->tx->ring[i].req;
-	       if(tx->ref != 0) {
-		  gnttab_end_access(tx->ref);
-	       }
-	       free_page(dev->pages[i]);
-	    }
-	 }
-	 free(dev->pages);
-      }
-
       /* Close event channel and unmap shared page */
       mask_evtchn(dev->evtchn);
       unbind_evtchn(dev->evtchn);
       gnttab_end_access(dev->ring_ref);
 
-      free_page(dev->tx);
-
+      free_page(dev->page);
    }
 
    /* Cleanup memory usage */
@@ -387,13 +385,17 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
 
 int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 {
-   int i;
-   tpmif_tx_request_t* tx = NULL;
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
+int i;
+#endif
    /* Error Checking */
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to send message through disconnected frontend\n");
       return -1;
    }
+   shr = dev->page;
 
 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Sending Msg to backend size=%u", (unsigned int) length);
@@ -407,19 +409,16 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 #endif
 
    /* Copy to shared pages now */
-   for(i = 0; length > 0 && i < TPMIF_TX_RING_SIZE; ++i) {
-      /* Share the page */
-      tx = &dev->tx->ring[i].req;
-      tx->unused = 0;
-      tx->addr = virt_to_mach(dev->pages[i]);
-      tx->ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->pages[i]), 0);
-      /* Copy the bits to the page */
-      tx->size = length > PAGE_SIZE ? PAGE_SIZE : length;
-      memcpy(dev->pages[i], &msg[i * PAGE_SIZE], tx->size);
-
-      /* Update counters */
-      length -= tx->size;
+   offset = sizeof(*shr);
+   if (length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Message too long for shared page\n");
+      return -1;
    }
+   memcpy(offset + (uint8_t*)shr, msg, length);
+   shr->length = length;
+   barrier();
+   shr->state = 1;
+
    dev->waiting = 1;
    dev->resplen = 0;
 #ifdef HAVE_LIBC
@@ -434,44 +433,41 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 }
 int tpmfront_recv(struct tpmfront_dev* dev, uint8_t** msg, size_t *length)
 {
-   tpmif_tx_request_t* tx;
-   int i;
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
+int i;
+#endif
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to receive message from disconnected frontend\n");
       return -1;
    }
    /*Wait for the response */
    wait_event(dev->waitq, (!dev->waiting));
+   shr = dev->page;
+   if (shr->state != 0)
+      goto quit;
 
    /* Initialize */
    *msg = NULL;
-   *length = 0;
+   *length = shr->length;
+   offset = sizeof(*shr);
 
-   /* special case, just quit */
-   tx = &dev->tx->ring[0].req;
-   if(tx->size == 0 ) {
-       goto quit;
-   }
-   /* Get the total size */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      *length += tx->size;
+   if (*length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Reply too long for shared page\n");
+      return -1;
    }
+
    /* Alloc the buffer */
    if(dev->respbuf) {
       free(dev->respbuf);
    }
    *msg = dev->respbuf = malloc(*length);
    dev->resplen = *length;
+
    /* Copy the bits */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      memcpy(&(*msg)[i * PAGE_SIZE], dev->pages[i], tx->size);
-      gnttab_end_access(tx->ref);
-      tx->ref = 0;
-   }
+   memcpy(*msg, offset + (uint8_t*)shr, *length);
+
 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Received response from backend size=%u", (unsigned int) *length);
    for(i = 0; i < *length; ++i) {
@@ -504,6 +500,14 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t*
    return 0;
 }
 
+int tpmfront_set_locality(struct tpmfront_dev* dev, int locality)
+{
+   if (!dev || !dev->page)
+      return -1;
+   dev->page->locality = locality;
+   return 0;
+}
+
 #ifdef HAVE_LIBC
 #include <errno.h>
 int tpmfront_open(struct tpmfront_dev* dev)
diff --git a/xen/include/public/io/tpmif.h b/xen/include/public/io/tpmif.h
index 02ccdab..afc9181 100644
--- a/xen/include/public/io/tpmif.h
+++ b/xen/include/public/io/tpmif.h
@@ -1,7 +1,7 @@
 /******************************************************************************
  * tpmif.h
  *
- * TPM I/O interface for Xen guest OSes.
+ * TPM I/O interface for Xen guest OSes, v2
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -21,48 +21,23 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  *
- * Copyright (c) 2005, IBM Corporation
- *
- * Author: Stefan Berger, stefanb@us.ibm.com
- * Grant table support: Mahadevan Gomathisankaran
- *
- * This code has been derived from tools/libxc/xen/io/netif.h
- *
- * Copyright (c) 2003-2004, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_IO_TPMIF_H__
 #define __XEN_PUBLIC_IO_TPMIF_H__
 
-#include "../grant_table.h"
+struct vtpm_shared_page {
+    uint16_t length;         /* request/response length in bytes */
 
-struct tpmif_tx_request {
-    unsigned long addr;   /* Machine address of packet.   */
-    grant_ref_t ref;      /* grant table access reference */
-    uint16_t unused;
-    uint16_t size;        /* Packet size in bytes.        */
-};
-typedef struct tpmif_tx_request tpmif_tx_request_t;
-
-/*
- * The TPMIF_TX_RING_SIZE defines the number of pages the
- * front-end and backend can exchange (= size of array).
- */
-typedef uint32_t TPMIF_RING_IDX;
-
-#define TPMIF_TX_RING_SIZE 1
-
-/* This structure must fit in a memory page. */
-
-struct tpmif_ring {
-    struct tpmif_tx_request req;
-};
-typedef struct tpmif_ring tpmif_ring_t;
+    uint8_t state;           /* 0 - response ready / idle
+                              * 1 - request ready / working */
+    uint8_t locality;        /* for the current request */
+    uint8_t padding[3];
 
-struct tpmif_tx_interface {
-    struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
+    uint8_t nr_extra_pages;  /* extra pages for long packets; may be zero */
+    uint32_t extra_pages[0]; /* grant IDs; length is actually nr_extra_pages */
 };
-typedef struct tpmif_tx_interface tpmif_tx_interface_t;
+typedef struct vtpm_shared_page vtpm_shared_page_t;
 
 #endif
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:12:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:12:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqQf-0004ZX-FU; Tue, 20 Nov 2012 16:12:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TaqQe-0004ZK-MC
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:12:04 +0000
Received: from [85.158.137.99:19625] by server-7.bemta-3.messagelabs.com id
	12/CB-01713-3DBABA05; Tue, 20 Nov 2012 16:12:03 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1353427922!14825198!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjMyNDg4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6450 invoked from network); 20 Nov 2012 16:12:03 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-3.tower-217.messagelabs.com with SMTP;
	20 Nov 2012 16:12:03 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga102.ch.intel.com with ESMTP; 20 Nov 2012 08:11:52 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,286,1352102400"; d="scan'208";a="170602721"
Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35])
	by AZSMGA002.ch.intel.com with ESMTP; 20 Nov 2012 08:11:29 -0800
Received: from fmsmsx101.amr.corp.intel.com (10.19.9.52) by
	FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 08:11:29 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX101.amr.corp.intel.com (10.19.9.52) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 08:11:29 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 00:11:27 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Thread-Topic: [PATCH V3] X86/vMCE: handle broken page with regard to migration
Thread-Index: AQHNxjv7gIBs/Elka0CkW2KriS9nNJfy5Gnw
Date: Tue, 20 Nov 2012 16:11:26 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335393429@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353318919.18229.7.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell wrote:
> On Fri, 2012-11-16 at 18:31 +0000, Liu, Jinsong wrote:
>>>> +            /*
>>>> +             * if vMCE occur at last iter, do one more iter so
>>>> that it get +             * chance to transfer broken page's
>>>> pfn_type and pfn number to +             * target and then take
>>>> appropriate action [...] +            }
>>> 
>>> Is this really the best way of doing this ?  Isn't there some single
>>> flag the hypervisor sets somewhere ?
> 
>> That will involve adding new hypercall, and notifying hypervisor
>> whether tools side is at the last iter round.
> 
> If we get to this stage then haven't we either already sent something
> over the wire for this page or marked it as dirty when we tried and
> failed to send it?
> 
> In the former case we don't care that the page is now broken on the
> source since the target has got a good pre-breakage copy.

Yes, and theoritically it's better, if only tools save code and hypervisor vmce code can *easily* know status each other, like
* whether vmce occur at last iteration
* whether the broken page is at dirty bitmap or not at last iteration

> 
> In the latter case could we not set a flag at the same time as we mark
> the page dirty which means "go round at least one more time"?
> 
> Ian.

That would involve adding new hypercalls for this corner case.

IMO it's better to keep simple way for the corner case, re-use currently existed mechanism.

Thanks,
Jinsong

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:12:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:12:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqQf-0004ZX-FU; Tue, 20 Nov 2012 16:12:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TaqQe-0004ZK-MC
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:12:04 +0000
Received: from [85.158.137.99:19625] by server-7.bemta-3.messagelabs.com id
	12/CB-01713-3DBABA05; Tue, 20 Nov 2012 16:12:03 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1353427922!14825198!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjMyNDg4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6450 invoked from network); 20 Nov 2012 16:12:03 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-3.tower-217.messagelabs.com with SMTP;
	20 Nov 2012 16:12:03 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga102.ch.intel.com with ESMTP; 20 Nov 2012 08:11:52 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,286,1352102400"; d="scan'208";a="170602721"
Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35])
	by AZSMGA002.ch.intel.com with ESMTP; 20 Nov 2012 08:11:29 -0800
Received: from fmsmsx101.amr.corp.intel.com (10.19.9.52) by
	FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 08:11:29 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX101.amr.corp.intel.com (10.19.9.52) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 08:11:29 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 00:11:27 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Thread-Topic: [PATCH V3] X86/vMCE: handle broken page with regard to migration
Thread-Index: AQHNxjv7gIBs/Elka0CkW2KriS9nNJfy5Gnw
Date: Tue, 20 Nov 2012 16:11:26 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335393429@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353318919.18229.7.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell wrote:
> On Fri, 2012-11-16 at 18:31 +0000, Liu, Jinsong wrote:
>>>> +            /*
>>>> +             * if vMCE occur at last iter, do one more iter so
>>>> that it get +             * chance to transfer broken page's
>>>> pfn_type and pfn number to +             * target and then take
>>>> appropriate action [...] +            }
>>> 
>>> Is this really the best way of doing this ?  Isn't there some single
>>> flag the hypervisor sets somewhere ?
> 
>> That will involve adding new hypercall, and notifying hypervisor
>> whether tools side is at the last iter round.
> 
> If we get to this stage then haven't we either already sent something
> over the wire for this page or marked it as dirty when we tried and
> failed to send it?
> 
> In the former case we don't care that the page is now broken on the
> source since the target has got a good pre-breakage copy.

Yes, and theoritically it's better, if only tools save code and hypervisor vmce code can *easily* know status each other, like
* whether vmce occur at last iteration
* whether the broken page is at dirty bitmap or not at last iteration

> 
> In the latter case could we not set a flag at the same time as we mark
> the page dirty which means "go round at least one more time"?
> 
> Ian.

That would involve adding new hypercalls for this corner case.

IMO it's better to keep simple way for the corner case, re-use currently existed mechanism.

Thanks,
Jinsong

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:15:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:15:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqU6-0004oy-9t; Tue, 20 Nov 2012 16:15:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TaqU4-0004or-SX
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:15:37 +0000
Received: from [85.158.143.35:19388] by server-2.bemta-4.messagelabs.com id
	50/8C-28922-8ACABA05; Tue, 20 Nov 2012 16:15:36 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1353428117!12086152!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20038 invoked from network); 20 Nov 2012 16:15:19 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 16:15:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215066473"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 16:15:17 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 11:15:17 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TaqTk-0006o7-V5;
	Tue, 20 Nov 2012 16:15:16 +0000
MIME-Version: 1.0
X-Mercurial-Node: ab313e9521f44bdd91a20a1b3eb499b2ee321b5e
Message-ID: <ab313e9521f44bdd91a2.1353427784@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Tue, 20 Nov 2012 16:09:44 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH] xl: Suppress spurious warning message for
	cpupool-list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1353427397 0
# Node ID ab313e9521f44bdd91a20a1b3eb499b2ee321b5e
# Parent  ae6fb202b233af815466055d9f1a635802a50855
xl: Suppress spurious warning message for cpupool-list

libxl_cpupool_list() enumerates the cpupools by "probing": calling
cpupool_info, starting at 0 and stopping when it gets an error. However,
cpupool_info will print an error when the call to xc_cpupool_getinfo() fails,
resulting in every xl command that uses libxl_list_cpupool (such as
cpupool-list) printing that error message spuriously.

Since at the moment the times we want to print the message correspond
with the use of the existing "exact" parameter, use it to decide
whether to print the message or not.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -593,7 +593,8 @@ static int cpupool_info(libxl__gc *gc,
     xcinfo = xc_cpupool_getinfo(CTX->xch, poolid);
     if (xcinfo == NULL)
     {
-        LOGE(ERROR, "failed to get info for cpupool%d\n", poolid);
+        if (exact || errno != ENOENT)
+            LOGE(ERROR, "failed to get info for cpupool%d\n", poolid);
         return ERROR_FAIL;
     }
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:15:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:15:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqU6-0004oy-9t; Tue, 20 Nov 2012 16:15:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TaqU4-0004or-SX
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:15:37 +0000
Received: from [85.158.143.35:19388] by server-2.bemta-4.messagelabs.com id
	50/8C-28922-8ACABA05; Tue, 20 Nov 2012 16:15:36 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1353428117!12086152!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20038 invoked from network); 20 Nov 2012 16:15:19 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 16:15:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215066473"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 16:15:17 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 11:15:17 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TaqTk-0006o7-V5;
	Tue, 20 Nov 2012 16:15:16 +0000
MIME-Version: 1.0
X-Mercurial-Node: ab313e9521f44bdd91a20a1b3eb499b2ee321b5e
Message-ID: <ab313e9521f44bdd91a2.1353427784@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Tue, 20 Nov 2012 16:09:44 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH] xl: Suppress spurious warning message for
	cpupool-list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1353427397 0
# Node ID ab313e9521f44bdd91a20a1b3eb499b2ee321b5e
# Parent  ae6fb202b233af815466055d9f1a635802a50855
xl: Suppress spurious warning message for cpupool-list

libxl_cpupool_list() enumerates the cpupools by "probing": calling
cpupool_info, starting at 0 and stopping when it gets an error. However,
cpupool_info will print an error when the call to xc_cpupool_getinfo() fails,
resulting in every xl command that uses libxl_list_cpupool (such as
cpupool-list) printing that error message spuriously.

Since at the moment the times we want to print the message correspond
with the use of the existing "exact" parameter, use it to decide
whether to print the message or not.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -593,7 +593,8 @@ static int cpupool_info(libxl__gc *gc,
     xcinfo = xc_cpupool_getinfo(CTX->xch, poolid);
     if (xcinfo == NULL)
     {
-        LOGE(ERROR, "failed to get info for cpupool%d\n", poolid);
+        if (exact || errno != ENOENT)
+            LOGE(ERROR, "failed to get info for cpupool%d\n", poolid);
         return ERROR_FAIL;
     }
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:17:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:17:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqWC-0004wT-O8; Tue, 20 Nov 2012 16:17:48 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <edumazet@google.com>) id 1TaqSr-0004lP-1z
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:14:21 +0000
Received: from [85.158.139.211:32646] by server-11.bemta-5.messagelabs.com id
	C1/78-03409-C5CABA05; Tue, 20 Nov 2012 16:14:20 +0000
X-Env-Sender: edumazet@google.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1353428057!20937896!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11074 invoked from network); 20 Nov 2012 16:14:19 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 16:14:19 -0000
Received: by mail-ie0-f173.google.com with SMTP id k14so5624134iea.32
	for <xen-devel@lists.xen.org>; Tue, 20 Nov 2012 08:14:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=ee3UbnFRV4pAhH+0VEdbtfVo6tbcMAJBxtW78/7JZK4=;
	b=GA8WjBZtvCfT+OJC184vKSIPn6H2ApXIKrsJkVdqDIpTm+pvHa5RmhT3ni5UXlVbzO
	02OwTKfLHPNj3Z1lWTTE0MN68rU7KAI1l9n8A89TQOaCDj7Ju+DvXDFe9bAvF0EqCtQT
	RUwot2YZD9hm5or72iAomOpE3fjaYHqYXc3sAC5XlSwCWKf8nJyScA6mtWcKxS8rpoeA
	DnxbUL6EoSzmPmkXUtgLc+3YbIMCTuam2jZws0pFzmH04AV872ZCTAQrdOw5yZR1bauW
	xodKMD7BXZyJR+yCiIMf0GONSnXmyb7b7uVv8zMa7ZBwatkHlPquvyEb+hXqg1Ek5QQV
	md+g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=ee3UbnFRV4pAhH+0VEdbtfVo6tbcMAJBxtW78/7JZK4=;
	b=EfYMs12oieK0hBK1B6yzeF3a7/Y9em2ci703fra3Fu1363BVq0kt+EktL4/9aecQ50
	twaqon/Verk9sFev7zi0VgrheNFYcwidlowCxPeA0CV9sC/IfXlkDsqK6YzL3bDfCCMS
	JPtTBAG/12J3umM1gnpojWFjMK5UktoimXwdrLCEPk7T+nKPgDxukOPxHXyZeNQ/Tzwa
	NcwP1xGFPQcLqzxKLyBwSy0zl+j2gCNN1nYrUDP9OBg/loZswMKGVIXXe99K+AqWGno6
	jq/eDz0CfBGoV6OclkppEODdAF13K3aaJZR9bGpJgNeEDb2BcdzRDldIkjcBGNIJ3k0m
	j7wg==
MIME-Version: 1.0
Received: by 10.50.88.199 with SMTP id bi7mr10781722igb.9.1353428057533; Tue,
	20 Nov 2012 08:14:17 -0800 (PST)
Received: by 10.43.46.74 with HTTP; Tue, 20 Nov 2012 08:14:17 -0800 (PST)
In-Reply-To: <50ABB38202000078000AA0FD@nat28.tlf.novell.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<50ABB38202000078000AA0FD@nat28.tlf.novell.com>
Date: Tue, 20 Nov 2012 08:14:17 -0800
Message-ID: <CANn89iJiugvBQgKvWrpg-BvpBi6SEwuDpkLEd0DTcRMyfvzsJQ@mail.gmail.com>
From: Eric Dumazet <edumazet@google.com>
To: Jan Beulich <JBeulich@suse.com>
X-Gm-Message-State: ALoCoQl69KzE33ayTyn8c4TRf8ar9imcPMFmz3Ysy0cKsuyRxcmCuprh+USYjUDMe1Mm0D52Uki0pF/qhh5YjuLM6/HnIW6PCC765CupzxYNUiM/n1ca64VJbtJGwnKRvoEZcIVRTbN7YnbBmczeyo22xU7SgvGRyDEfBUuOzRe37UVOtJ2c5JAgLykHmUQxsHecJAfU46Bv
X-Mailman-Approved-At: Tue, 20 Nov 2012 16:17:47 +0000
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	KonradRzeszutekWilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>, ANNIE LI <annie.li@oracle.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2251798557072754796=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============2251798557072754796==
Content-Type: multipart/alternative; boundary=e89a8f3ba0db992cdc04ceef8630

--e89a8f3ba0db992cdc04ceef8630
Content-Type: text/plain; charset=ISO-8859-1

At least TCP skbs are limited to 65536 bytes in tcp_sendmsg()
(around 45 1460-bytes MSS segments)

Thats probably because IPv4  stack only copes with this limit.

This probably could be relaxed for TCP friends, but this kind of skbs
should not hit a driver.




On Tue, Nov 20, 2012 at 7:44 AM, Jan Beulich <JBeulich@suse.com> wrote:

> >>> On 20.11.12 at 16:06, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Tue, 2012-11-20 at 14:32 +0000, Jan Beulich wrote:
> >> > @@ -517,15 +540,16 @@ static int xennet_start_xmit(struct sk_buff
> *skb,
> >> > struct net_device *dev)
> >> >    grant_ref_t ref;
> >> >    unsigned long mfn;
> >> >    int notify;
> >> > -  int frags = skb_shinfo(skb)->nr_frags;
> >> > +  int slots;
> >> >    unsigned int offset = offset_in_page(data);
> >> >    unsigned int len = skb_headlen(skb);
> >> >    unsigned long flags;
> >> >
> >> > -  frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
> >> > -  if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
> >> > -          printk(KERN_ALERT "xennet: skb rides the rocket: %d
> frags\n",
> >> > -                 frags);
> >> > +  slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
> >> > +          xennet_count_skb_frag_slots(skb);
> >> > +  if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
> >>
> >> But still - isn't this wrong now (i.e. can't it now validly exceed the
> >> boundary checked for)?
> >
> > In practice no because of the property that the number of pages backing
> > the frags is <= MAX_SKB_FRAGS even if you are using compound pages as
> > the frags.
>
> So are you saying that there is something in the system
> preventing up to MAX_SKB_FRAGS * SKB_FRAG_PAGE_ORDER
> (or NETDEV_FRAG_PAGE_MAX_ORDER) skb-s to be created? I
> didn't find any. I do notice that __netdev_alloc_frag() currently
> never gets called with a size larger than PAGE_SIZE, but
> considering that the function just recently got made capable of
> that, I'm sure respective users will show up rather sooner than
> later.
>
> Jan
>
>

--e89a8f3ba0db992cdc04ceef8630
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div style=3D"font-family: arial, helvetica, sans-serif; font-size: 10pt">A=
t least TCP skbs are limited to 65536 bytes in tcp_sendmsg()<div>(around 45=
 1460-bytes MSS segments)<br><div><br></div><div>Thats probably because IPv=
4 =A0stack only copes with this limit.</div>
<div><br></div><div>This probably could be relaxed for TCP friends, but thi=
s kind of skbs should not hit a driver.</div><div><br></div><div><br></div>=
</div><div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Tue,=
 Nov 20, 2012 at 7:44 AM, Jan Beulich <span dir=3D"ltr">&lt;<a href=3D"mail=
to:JBeulich@suse.com" target=3D"_blank">JBeulich@suse.com</a>&gt;</span> wr=
ote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"HOEnZb"><div class=3D"h5">&gt;=
&gt;&gt; On 20.11.12 at 16:06, Ian Campbell &lt;<a href=3D"mailto:Ian.Campb=
ell@citrix.com">Ian.Campbell@citrix.com</a>&gt; wrote:<br>

&gt; On Tue, 2012-11-20 at 14:32 +0000, Jan Beulich wrote:<br>
&gt;&gt; &gt; @@ -517,15 +540,16 @@ static int xennet_start_xmit(struct sk_=
buff *skb,<br>
&gt;&gt; &gt; struct net_device *dev)<br>
&gt;&gt; &gt; =A0 =A0grant_ref_t ref;<br>
&gt;&gt; &gt; =A0 =A0unsigned long mfn;<br>
&gt;&gt; &gt; =A0 =A0int notify;<br>
&gt;&gt; &gt; - =A0int frags =3D skb_shinfo(skb)-&gt;nr_frags;<br>
&gt;&gt; &gt; + =A0int slots;<br>
&gt;&gt; &gt; =A0 =A0unsigned int offset =3D offset_in_page(data);<br>
&gt;&gt; &gt; =A0 =A0unsigned int len =3D skb_headlen(skb);<br>
&gt;&gt; &gt; =A0 =A0unsigned long flags;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; - =A0frags +=3D DIV_ROUND_UP(offset + len, PAGE_SIZE);<br>
&gt;&gt; &gt; - =A0if (unlikely(frags &gt; MAX_SKB_FRAGS + 1)) {<br>
&gt;&gt; &gt; - =A0 =A0 =A0 =A0 =A0printk(KERN_ALERT &quot;xennet: skb ride=
s the rocket: %d frags\n&quot;,<br>
&gt;&gt; &gt; - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 frags);<br>
&gt;&gt; &gt; + =A0slots =3D DIV_ROUND_UP(offset + len, PAGE_SIZE) +<br>
&gt;&gt; &gt; + =A0 =A0 =A0 =A0 =A0xennet_count_skb_frag_slots(skb);<br>
&gt;&gt; &gt; + =A0if (unlikely(slots &gt; MAX_SKB_FRAGS + 1)) {<br>
&gt;&gt;<br>
&gt;&gt; But still - isn&#39;t this wrong now (i.e. can&#39;t it now validl=
y exceed the<br>
&gt;&gt; boundary checked for)?<br>
&gt;<br>
&gt; In practice no because of the property that the number of pages backin=
g<br>
&gt; the frags is &lt;=3D MAX_SKB_FRAGS even if you are using compound page=
s as<br>
&gt; the frags.<br>
<br>
</div></div>So are you saying that there is something in the system<br>
preventing up to MAX_SKB_FRAGS * SKB_FRAG_PAGE_ORDER<br>
(or NETDEV_FRAG_PAGE_MAX_ORDER) skb-s to be created? I<br>
didn&#39;t find any. I do notice that __netdev_alloc_frag() currently<br>
never gets called with a size larger than PAGE_SIZE, but<br>
considering that the function just recently got made capable of<br>
that, I&#39;m sure respective users will show up rather sooner than<br>
later.<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
Jan<br>
<br>
</font></span></blockquote></div><br></div></div>

--e89a8f3ba0db992cdc04ceef8630--


--===============2251798557072754796==
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.xen.org
http://lists.xen.org/xen-devel

--===============2251798557072754796==--


From xen-devel-bounces@lists.xen.org Tue Nov 20 16:17:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:17:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqWC-0004wT-O8; Tue, 20 Nov 2012 16:17:48 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <edumazet@google.com>) id 1TaqSr-0004lP-1z
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:14:21 +0000
Received: from [85.158.139.211:32646] by server-11.bemta-5.messagelabs.com id
	C1/78-03409-C5CABA05; Tue, 20 Nov 2012 16:14:20 +0000
X-Env-Sender: edumazet@google.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1353428057!20937896!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11074 invoked from network); 20 Nov 2012 16:14:19 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 16:14:19 -0000
Received: by mail-ie0-f173.google.com with SMTP id k14so5624134iea.32
	for <xen-devel@lists.xen.org>; Tue, 20 Nov 2012 08:14:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=ee3UbnFRV4pAhH+0VEdbtfVo6tbcMAJBxtW78/7JZK4=;
	b=GA8WjBZtvCfT+OJC184vKSIPn6H2ApXIKrsJkVdqDIpTm+pvHa5RmhT3ni5UXlVbzO
	02OwTKfLHPNj3Z1lWTTE0MN68rU7KAI1l9n8A89TQOaCDj7Ju+DvXDFe9bAvF0EqCtQT
	RUwot2YZD9hm5or72iAomOpE3fjaYHqYXc3sAC5XlSwCWKf8nJyScA6mtWcKxS8rpoeA
	DnxbUL6EoSzmPmkXUtgLc+3YbIMCTuam2jZws0pFzmH04AV872ZCTAQrdOw5yZR1bauW
	xodKMD7BXZyJR+yCiIMf0GONSnXmyb7b7uVv8zMa7ZBwatkHlPquvyEb+hXqg1Ek5QQV
	md+g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=ee3UbnFRV4pAhH+0VEdbtfVo6tbcMAJBxtW78/7JZK4=;
	b=EfYMs12oieK0hBK1B6yzeF3a7/Y9em2ci703fra3Fu1363BVq0kt+EktL4/9aecQ50
	twaqon/Verk9sFev7zi0VgrheNFYcwidlowCxPeA0CV9sC/IfXlkDsqK6YzL3bDfCCMS
	JPtTBAG/12J3umM1gnpojWFjMK5UktoimXwdrLCEPk7T+nKPgDxukOPxHXyZeNQ/Tzwa
	NcwP1xGFPQcLqzxKLyBwSy0zl+j2gCNN1nYrUDP9OBg/loZswMKGVIXXe99K+AqWGno6
	jq/eDz0CfBGoV6OclkppEODdAF13K3aaJZR9bGpJgNeEDb2BcdzRDldIkjcBGNIJ3k0m
	j7wg==
MIME-Version: 1.0
Received: by 10.50.88.199 with SMTP id bi7mr10781722igb.9.1353428057533; Tue,
	20 Nov 2012 08:14:17 -0800 (PST)
Received: by 10.43.46.74 with HTTP; Tue, 20 Nov 2012 08:14:17 -0800 (PST)
In-Reply-To: <50ABB38202000078000AA0FD@nat28.tlf.novell.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<50ABB38202000078000AA0FD@nat28.tlf.novell.com>
Date: Tue, 20 Nov 2012 08:14:17 -0800
Message-ID: <CANn89iJiugvBQgKvWrpg-BvpBi6SEwuDpkLEd0DTcRMyfvzsJQ@mail.gmail.com>
From: Eric Dumazet <edumazet@google.com>
To: Jan Beulich <JBeulich@suse.com>
X-Gm-Message-State: ALoCoQl69KzE33ayTyn8c4TRf8ar9imcPMFmz3Ysy0cKsuyRxcmCuprh+USYjUDMe1Mm0D52Uki0pF/qhh5YjuLM6/HnIW6PCC765CupzxYNUiM/n1ca64VJbtJGwnKRvoEZcIVRTbN7YnbBmczeyo22xU7SgvGRyDEfBUuOzRe37UVOtJ2c5JAgLykHmUQxsHecJAfU46Bv
X-Mailman-Approved-At: Tue, 20 Nov 2012 16:17:47 +0000
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	KonradRzeszutekWilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>, ANNIE LI <annie.li@oracle.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2251798557072754796=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============2251798557072754796==
Content-Type: multipart/alternative; boundary=e89a8f3ba0db992cdc04ceef8630

--e89a8f3ba0db992cdc04ceef8630
Content-Type: text/plain; charset=ISO-8859-1

At least TCP skbs are limited to 65536 bytes in tcp_sendmsg()
(around 45 1460-bytes MSS segments)

Thats probably because IPv4  stack only copes with this limit.

This probably could be relaxed for TCP friends, but this kind of skbs
should not hit a driver.




On Tue, Nov 20, 2012 at 7:44 AM, Jan Beulich <JBeulich@suse.com> wrote:

> >>> On 20.11.12 at 16:06, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Tue, 2012-11-20 at 14:32 +0000, Jan Beulich wrote:
> >> > @@ -517,15 +540,16 @@ static int xennet_start_xmit(struct sk_buff
> *skb,
> >> > struct net_device *dev)
> >> >    grant_ref_t ref;
> >> >    unsigned long mfn;
> >> >    int notify;
> >> > -  int frags = skb_shinfo(skb)->nr_frags;
> >> > +  int slots;
> >> >    unsigned int offset = offset_in_page(data);
> >> >    unsigned int len = skb_headlen(skb);
> >> >    unsigned long flags;
> >> >
> >> > -  frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
> >> > -  if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
> >> > -          printk(KERN_ALERT "xennet: skb rides the rocket: %d
> frags\n",
> >> > -                 frags);
> >> > +  slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
> >> > +          xennet_count_skb_frag_slots(skb);
> >> > +  if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
> >>
> >> But still - isn't this wrong now (i.e. can't it now validly exceed the
> >> boundary checked for)?
> >
> > In practice no because of the property that the number of pages backing
> > the frags is <= MAX_SKB_FRAGS even if you are using compound pages as
> > the frags.
>
> So are you saying that there is something in the system
> preventing up to MAX_SKB_FRAGS * SKB_FRAG_PAGE_ORDER
> (or NETDEV_FRAG_PAGE_MAX_ORDER) skb-s to be created? I
> didn't find any. I do notice that __netdev_alloc_frag() currently
> never gets called with a size larger than PAGE_SIZE, but
> considering that the function just recently got made capable of
> that, I'm sure respective users will show up rather sooner than
> later.
>
> Jan
>
>

--e89a8f3ba0db992cdc04ceef8630
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div style=3D"font-family: arial, helvetica, sans-serif; font-size: 10pt">A=
t least TCP skbs are limited to 65536 bytes in tcp_sendmsg()<div>(around 45=
 1460-bytes MSS segments)<br><div><br></div><div>Thats probably because IPv=
4 =A0stack only copes with this limit.</div>
<div><br></div><div>This probably could be relaxed for TCP friends, but thi=
s kind of skbs should not hit a driver.</div><div><br></div><div><br></div>=
</div><div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Tue,=
 Nov 20, 2012 at 7:44 AM, Jan Beulich <span dir=3D"ltr">&lt;<a href=3D"mail=
to:JBeulich@suse.com" target=3D"_blank">JBeulich@suse.com</a>&gt;</span> wr=
ote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"HOEnZb"><div class=3D"h5">&gt;=
&gt;&gt; On 20.11.12 at 16:06, Ian Campbell &lt;<a href=3D"mailto:Ian.Campb=
ell@citrix.com">Ian.Campbell@citrix.com</a>&gt; wrote:<br>

&gt; On Tue, 2012-11-20 at 14:32 +0000, Jan Beulich wrote:<br>
&gt;&gt; &gt; @@ -517,15 +540,16 @@ static int xennet_start_xmit(struct sk_=
buff *skb,<br>
&gt;&gt; &gt; struct net_device *dev)<br>
&gt;&gt; &gt; =A0 =A0grant_ref_t ref;<br>
&gt;&gt; &gt; =A0 =A0unsigned long mfn;<br>
&gt;&gt; &gt; =A0 =A0int notify;<br>
&gt;&gt; &gt; - =A0int frags =3D skb_shinfo(skb)-&gt;nr_frags;<br>
&gt;&gt; &gt; + =A0int slots;<br>
&gt;&gt; &gt; =A0 =A0unsigned int offset =3D offset_in_page(data);<br>
&gt;&gt; &gt; =A0 =A0unsigned int len =3D skb_headlen(skb);<br>
&gt;&gt; &gt; =A0 =A0unsigned long flags;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; - =A0frags +=3D DIV_ROUND_UP(offset + len, PAGE_SIZE);<br>
&gt;&gt; &gt; - =A0if (unlikely(frags &gt; MAX_SKB_FRAGS + 1)) {<br>
&gt;&gt; &gt; - =A0 =A0 =A0 =A0 =A0printk(KERN_ALERT &quot;xennet: skb ride=
s the rocket: %d frags\n&quot;,<br>
&gt;&gt; &gt; - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 frags);<br>
&gt;&gt; &gt; + =A0slots =3D DIV_ROUND_UP(offset + len, PAGE_SIZE) +<br>
&gt;&gt; &gt; + =A0 =A0 =A0 =A0 =A0xennet_count_skb_frag_slots(skb);<br>
&gt;&gt; &gt; + =A0if (unlikely(slots &gt; MAX_SKB_FRAGS + 1)) {<br>
&gt;&gt;<br>
&gt;&gt; But still - isn&#39;t this wrong now (i.e. can&#39;t it now validl=
y exceed the<br>
&gt;&gt; boundary checked for)?<br>
&gt;<br>
&gt; In practice no because of the property that the number of pages backin=
g<br>
&gt; the frags is &lt;=3D MAX_SKB_FRAGS even if you are using compound page=
s as<br>
&gt; the frags.<br>
<br>
</div></div>So are you saying that there is something in the system<br>
preventing up to MAX_SKB_FRAGS * SKB_FRAG_PAGE_ORDER<br>
(or NETDEV_FRAG_PAGE_MAX_ORDER) skb-s to be created? I<br>
didn&#39;t find any. I do notice that __netdev_alloc_frag() currently<br>
never gets called with a size larger than PAGE_SIZE, but<br>
considering that the function just recently got made capable of<br>
that, I&#39;m sure respective users will show up rather sooner than<br>
later.<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
Jan<br>
<br>
</font></span></blockquote></div><br></div></div>

--e89a8f3ba0db992cdc04ceef8630--


--===============2251798557072754796==
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.xen.org
http://lists.xen.org/xen-devel

--===============2251798557072754796==--


From xen-devel-bounces@lists.xen.org Tue Nov 20 16:18:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:18:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqWQ-0004xq-71; Tue, 20 Nov 2012 16:18:02 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaqWN-0004xB-Ub
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:18:00 +0000
Received: from [193.109.254.147:2745] by server-8.bemta-14.messagelabs.com id
	05/AF-05026-53DABA05; Tue, 20 Nov 2012 16:17:57 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-10.tower-27.messagelabs.com!1353428257!4846011!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6461 invoked from network); 20 Nov 2012 16:17:38 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-10.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 20 Nov 2012 16:17:38 -0000
Received: from ([128.244.198.90])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157706588;
	Tue, 20 Nov 2012 11:17:20 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas1.dom1.jhuapl.edu ([128.244.198.90]) with mapi; Tue, 20 Nov 2012
	11:16:51 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Date: Tue, 20 Nov 2012 11:16:50 -0500
Thread-Topic: [PATCH RFC] stubdom: Change vTPM shared page ABI
Thread-Index: Ac3HOZZLjOLBnNkwR0yoQ+J7Tm6taQAAH0CA
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This was something I've been wanting to do for a while so I'm very happy you went ahead and fixed it yourself. Once you submit the linux version I'll test it on my system.

Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

-----Original Message-----
From: Daniel De Graaf [mailto:dgdegra@tycho.nsa.gov]
Sent: Tuesday, November 20, 2012 11:11 AM
To: Fioravante, Matthew E.
Cc: xen-devel@lists.xen.org; Ian.Campbell@citrix.com; Daniel De Graaf
Subject: [PATCH RFC] stubdom: Change vTPM shared page ABI

Since the vTPM implementations are being incorproated into Xen and possibly upstream Linux, I would like to see if this protocol change could be added before we have significant legacy implementations. If not, I still think it would be useful as either a v2 or negotiated protocol change.

The current vTPM protocol is a copy of the network protocol. This was likely done for ease of implementation, since support for the network backend/frontend existed in Linux and minios. However, this implementation is overly complex when dealing with vTPM packets: for example, a vTPM never needs to deal with having more than one packet in flight at any given time.

I will send the corresponding patch for the Linux kernel module once I have adapted it for the file names used in the upstream version.

------------------------------------>8----------------------------------

This changes the vTPM shared page ABI from a copy of the Xen network interface to a single-page interface that better reflects the expected behavior of a TPM: only a single request packet can be sent at any given time, and every packet sent generates a single response packet. This protocol change should also increase efficiency as it avoids mapping and unmapping grants when possible.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/include/tpmback.h  |   1 +
 extras/mini-os/include/tpmfront.h |   7 +-
 extras/mini-os/tpmback.c          | 132 ++++++++++++++-------------------
 extras/mini-os/tpmfront.c         | 150 +++++++++++++++++++-------------------
 xen/include/public/io/tpmif.h     |  45 +++---------
 5 files changed, 148 insertions(+), 187 deletions(-)

diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
index ff86732..ec9eda4 100644
--- a/extras/mini-os/include/tpmback.h
+++ b/extras/mini-os/include/tpmback.h
@@ -43,6 +43,7 @@

 struct tpmcmd {
    domid_t domid;              /* Domid of the frontend */
+   uint8_t locality;    /* Locality requested by the frontend */
    unsigned int handle;        /* Handle of the frontend */
    unsigned char uuid[16];                     /* uuid of the tpm interface */

diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include/tpmfront.h
index fd2cb17..a0c7c4d 100644
--- a/extras/mini-os/include/tpmfront.h
+++ b/extras/mini-os/include/tpmfront.h
@@ -37,9 +37,7 @@ struct tpmfront_dev {
    grant_ref_t ring_ref;
    evtchn_port_t evtchn;

-   tpmif_tx_interface_t* tx;
-
-   void** pages;
+   vtpm_shared_page_t *page;

    domid_t bedomid;
    char* nodename;
@@ -77,6 +75,9 @@ void shutdown_tpmfront(struct tpmfront_dev* dev);
  * */
 int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen);

+/* Set the locality used for communicating with a vTPM */ int
+tpmfront_set_locality(struct tpmfront_dev* dev, int locality);
+
 #ifdef HAVE_LIBC
 #include <sys/stat.h>
 /* POSIX IO functions:
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c index 658fed1..29aced9 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -86,10 +86,7 @@ struct tpmif {
    evtchn_port_t evtchn;

    /* Shared page */
-   tpmif_tx_interface_t* tx;
-
-   /* pointer to TPMIF_RX_RING_SIZE pages */
-   void** pages;
+   vtpm_shared_page_t *page;

    enum xenbus_state state;
    enum { DISCONNECTED, DISCONNECTING, CONNECTED } status; @@ -386,8 +383,7 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
    tpmif->fe_state_path = NULL;
    tpmif->state = XenbusStateInitialising;
    tpmif->status = DISCONNECTED;
-   tpmif->tx = NULL;
-   tpmif->pages = NULL;
+   tpmif->page = NULL;
    tpmif->flags = 0;
    memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
    return tpmif;
@@ -395,9 +391,6 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)

 void __free_tpmif(tpmif_t* tpmif)
 {
-   if(tpmif->pages) {
-      free(tpmif->pages);
-   }
    if(tpmif->fe_path) {
       free(tpmif->fe_path);
    }
@@ -430,12 +423,6 @@ tpmif_t* new_tpmif(domid_t domid, unsigned int handle)
       goto error;
    }

-   /* allocate pages to be used for shared mapping */
-   if((tpmif->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE)) == NULL) {
-      goto error;
-   }
-   memset(tpmif->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-
    if(tpmif_change_state(tpmif, XenbusStateInitWait)) {
       goto error;
    }
@@ -486,7 +473,7 @@ void free_tpmif(tpmif_t* tpmif)
       tpmif->status = DISCONNECTING;
       mask_evtchn(tpmif->evtchn);

-      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1)) {
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
         TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
       }

@@ -529,9 +516,10 @@ void free_tpmif(tpmif_t* tpmif)  void tpmback_handler(evtchn_port_t port, struct pt_regs *regs, void *data)  {
    tpmif_t* tpmif = (tpmif_t*) data;
-   tpmif_tx_request_t* tx = &tpmif->tx->ring[0].req;
-   /* Throw away 0 size events, these can trigger from event channel unmasking */
-   if(tx->size == 0)
+   vtpm_shared_page_t* pg = tpmif->page;
+
+   /* Only pay attention if the request is ready */
+   if (pg->state == 0)
       return;

    TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle); @@ -585,11 +573,10 @@ int connect_fe(tpmif_t* tpmif)
    free(value);

    domid = tpmif->domid;
-   if((tpmif->tx = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
+   if((tpmif->page = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0,
+ &ringref, PROT_READ | PROT_WRITE)) == NULL) {
       TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
       return -1;
    }
-   memset(tpmif->tx, 0, PAGE_SIZE);

    /*Bind the event channel */
    if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler, tpmif, &tpmif->evtchn))) @@ -618,10 +605,28 @@ error_post_evtchn:
    mask_evtchn(tpmif->evtchn);
    unbind_evtchn(tpmif->evtchn);
 error_post_map:
-   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1);
+   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1);
    return -1;
 }

+static void disconnect_fe(tpmif_t* tpmif) {
+   if (tpmif->status == CONNECTED) {
+      tpmif->status = DISCONNECTING;
+      mask_evtchn(tpmif->evtchn);
+
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
+        TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
+      }
+
+      unbind_evtchn(tpmif->evtchn);
+   }
+   tpmif->status = DISCONNECTED;
+   tpmif_change_state(tpmif, XenbusStateReconfigured);
+
+   TPMBACK_LOG("Frontend %u/%u disconnected\n", (unsigned int)
+tpmif->domid, tpmif->handle); }
+
 static int frontend_changed(tpmif_t* tpmif)  {
    int state = xenbus_read_integer(tpmif->fe_state_path);
@@ -874,6 +879,7 @@ void shutdown_tpmback(void)  inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, unsigned char uuid[16])  {
    tpmcmd->domid = domid;
+   tpmcmd->locality = -1;
    tpmcmd->handle = handle;
    memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
    tpmcmd->req = NULL;
@@ -884,12 +890,12 @@ inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, un

 tpmcmd_t* get_request(tpmif_t* tpmif) {
    tpmcmd_t* cmd;
-   tpmif_tx_request_t* tx;
-   int offset;
-   int tocopy;
-   int i;
-   uint32_t domid;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+int i;
+#endif

    local_irq_save(flags);

@@ -899,35 +905,22 @@ tpmcmd_t* get_request(tpmif_t* tpmif) {
    }
    init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);

-   tx = &tpmif->tx->ring[0].req;
-   cmd->req_len = tx->size;
+   shr = tpmif->page;
+   cmd->req_len = shr->length;
+   cmd->locality = shr->locality;
+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->req_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
+   }
    /* Allocate the buffer */
    if(cmd->req_len) {
       if((cmd->req = malloc(cmd->req_len)) == NULL) {
         goto error;
       }
    }
-   /* Copy the bits from the shared pages */
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->req_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_READ)) == NULL) {
-        TPMBACK_ERR("%u/%u Unable to map shared page during read!\n", (unsigned int) tpmif->domid, tpmif->handle);
-        goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->req_len - offset, PAGE_SIZE);
-      memcpy(&cmd->req[offset], tpmif->pages[i], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
-
-   }
+   /* Copy the bits from the shared page(s) */
+   memcpy(cmd->req, offset + (uint8_t*)shr, cmd->req_len);

 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Received Tpm Command from %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->req_len); @@ -958,38 +951,24 @@ error:

 void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)  {
-   tpmif_tx_request_t* tx;
-   int offset;
-   int i;
-   uint32_t domid;
-   int tocopy;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+int i;
+#endif

    local_irq_save(flags);

-   tx = &tpmif->tx->ring[0].req;
-   tx->size = cmd->resp_len;
-
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->resp_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_WRITE)) == NULL) {
-        TPMBACK_ERR("%u/%u Unable to map shared page during write!\n", (unsigned int) tpmif->domid, tpmif->handle);
-        goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->resp_len - offset, PAGE_SIZE);
-      memcpy(tpmif->pages[i], &cmd->resp[offset], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
+   shr = tpmif->page;
+   shr->length = cmd->resp_len;

+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->resp_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
    }
+   memcpy(offset + (uint8_t*)shr, cmd->resp, cmd->resp_len);

 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Sent response to %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->resp_len); @@ -1003,6 +982,7 @@ void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)  #endif
    /* clear the ready flag and send the event channel notice to the frontend */
    tpmif_req_finished(tpmif);
+   shr->state = 0;
    notify_remote_via_evtchn(tpmif->evtchn);
 error:
    local_irq_restore(flags);
diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c index 0218d7f..bcee93d 100644
--- a/extras/mini-os/tpmfront.c
+++ b/extras/mini-os/tpmfront.c
@@ -153,6 +153,32 @@ static int wait_for_backend_closed(xenbus_event_queue* events, char* path)

 }

+static int wait_for_backend_reconfig(xenbus_event_queue* events, char*
+path) {
+   int state;
+
+   TPMFRONT_LOG("Waiting for backend to reconfigure...\n");
+   while(1) {
+      state = xenbus_read_integer(path);
+      if ( state < 0)
+        state = XenbusStateUnknown;
+      switch(state) {
+        case XenbusStateUnknown:
+           TPMFRONT_ERR("Backend Unknown state, forcing shutdown\n");
+           return -1;
+        case XenbusStateClosed:
+           TPMFRONT_LOG("Backend Closed\n");
+           return 0;
+        case XenbusStateReconfigured:
+           TPMFRONT_LOG("Backend Reconfigured\n");
+           return 0;
+        default:
+           xenbus_wait_for_watch(events);
+      }
+   }
+
+}
+
 static int wait_for_backend_state_changed(struct tpmfront_dev* dev, XenbusState state) {
    char* err;
    int ret = 0;
@@ -175,8 +201,11 @@ static int wait_for_backend_state_changed(struct tpmfront_dev* dev, XenbusState
       case XenbusStateClosed:
         ret = wait_for_backend_closed(&events, path);
         break;
-      default:
+      case XenbusStateReconfigured:
+        ret = wait_for_backend_reconfig(&events, path);
         break;
+      default:
+         TPMFRONT_ERR("Bad wait state %d, ignoring\n", state);
    }

    if((err = xenbus_unwatch_path_token(XBT_NIL, path, path))) { @@ -190,13 +219,13 @@ static int tpmfront_connect(struct tpmfront_dev* dev)  {
    char* err;
    /* Create shared page */
-   dev->tx = (tpmif_tx_interface_t*) alloc_page();
-   if(dev->tx == NULL) {
+   dev->page = (vtpm_shared_page_t*) alloc_page();
+   if(dev->page == NULL) {
       TPMFRONT_ERR("Unable to allocate page for shared memory\n");
       goto error;
    }
-   memset(dev->tx, 0, PAGE_SIZE);
-   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->tx), 0);
+   memset(dev->page, 0, PAGE_SIZE);
+   dev->ring_ref = gnttab_grant_access(dev->bedomid,
+ virt_to_mfn(dev->page), 0);
    TPMFRONT_DEBUG("grant ref is %lu\n", (unsigned long) dev->ring_ref);

    /*Create event channel */
@@ -228,7 +257,7 @@ error_postevtchn:
       unbind_evtchn(dev->evtchn);
 error_postmap:
       gnttab_end_access(dev->ring_ref);
-      free_page(dev->tx);
+      free_page(dev->page);
 error:
    return -1;
 }
@@ -240,7 +269,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
    char path[512];
    char* value, *err;
    unsigned long long ival;
-   int i;

    printk("============= Init TPM Front ================\n");

@@ -289,19 +317,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
       goto error;
    }

-   /* Allocate pages that will contain the messages */
-   dev->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE);
-   if(dev->pages == NULL) {
-      goto error;
-   }
-   memset(dev->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-   for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-      dev->pages[i] = (void*)alloc_page();
-      if(dev->pages[i] == NULL) {
-        goto error;
-      }
-   }
-
    TPMFRONT_LOG("Initialization Completed successfully\n");

    return dev;
@@ -314,12 +329,10 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)  {
    char* err;
    char path[512];
-   int i;
-   tpmif_tx_request_t* tx;
    if(dev == NULL) {
       return;
    }
-   TPMFRONT_LOG("Shutting down tpmfront\n");
+   TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for
+ reconfigure" : "");
    /* disconnect */
    if(dev->state == XenbusStateConnected) {
       dev->state = XenbusStateClosing;
@@ -349,27 +362,12 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
       /* Wait for the backend to close and unmap shared pages, ignore any errors */
       wait_for_backend_state_changed(dev, XenbusStateClosed);

-      /* Cleanup any shared pages */
-      if(dev->pages) {
-        for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-           if(dev->pages[i]) {
-              tx = &dev->tx->ring[i].req;
-              if(tx->ref != 0) {
-                 gnttab_end_access(tx->ref);
-              }
-              free_page(dev->pages[i]);
-           }
-        }
-        free(dev->pages);
-      }
-
       /* Close event channel and unmap shared page */
       mask_evtchn(dev->evtchn);
       unbind_evtchn(dev->evtchn);
       gnttab_end_access(dev->ring_ref);

-      free_page(dev->tx);
-
+      free_page(dev->page);
    }

    /* Cleanup memory usage */
@@ -387,13 +385,17 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)

 int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)  {
-   int i;
-   tpmif_tx_request_t* tx = NULL;
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
+int i;
+#endif
    /* Error Checking */
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to send message through disconnected frontend\n");
       return -1;
    }
+   shr = dev->page;

 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Sending Msg to backend size=%u", (unsigned int) length); @@ -407,19 +409,16 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)  #endif

    /* Copy to shared pages now */
-   for(i = 0; length > 0 && i < TPMIF_TX_RING_SIZE; ++i) {
-      /* Share the page */
-      tx = &dev->tx->ring[i].req;
-      tx->unused = 0;
-      tx->addr = virt_to_mach(dev->pages[i]);
-      tx->ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->pages[i]), 0);
-      /* Copy the bits to the page */
-      tx->size = length > PAGE_SIZE ? PAGE_SIZE : length;
-      memcpy(dev->pages[i], &msg[i * PAGE_SIZE], tx->size);
-
-      /* Update counters */
-      length -= tx->size;
+   offset = sizeof(*shr);
+   if (length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Message too long for shared page\n");
+      return -1;
    }
+   memcpy(offset + (uint8_t*)shr, msg, length);
+   shr->length = length;
+   barrier();
+   shr->state = 1;
+
    dev->waiting = 1;
    dev->resplen = 0;
 #ifdef HAVE_LIBC
@@ -434,44 +433,41 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)  }  int tpmfront_recv(struct tpmfront_dev* dev, uint8_t** msg, size_t *length)  {
-   tpmif_tx_request_t* tx;
-   int i;
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
+int i;
+#endif
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to receive message from disconnected frontend\n");
       return -1;
    }
    /*Wait for the response */
    wait_event(dev->waitq, (!dev->waiting));
+   shr = dev->page;
+   if (shr->state != 0)
+      goto quit;

    /* Initialize */
    *msg = NULL;
-   *length = 0;
+   *length = shr->length;
+   offset = sizeof(*shr);

-   /* special case, just quit */
-   tx = &dev->tx->ring[0].req;
-   if(tx->size == 0 ) {
-       goto quit;
-   }
-   /* Get the total size */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      *length += tx->size;
+   if (*length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Reply too long for shared page\n");
+      return -1;
    }
+
    /* Alloc the buffer */
    if(dev->respbuf) {
       free(dev->respbuf);
    }
    *msg = dev->respbuf = malloc(*length);
    dev->resplen = *length;
+
    /* Copy the bits */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      memcpy(&(*msg)[i * PAGE_SIZE], dev->pages[i], tx->size);
-      gnttab_end_access(tx->ref);
-      tx->ref = 0;
-   }
+   memcpy(*msg, offset + (uint8_t*)shr, *length);
+
 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Received response from backend size=%u", (unsigned int) *length);
    for(i = 0; i < *length; ++i) {
@@ -504,6 +500,14 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t*
    return 0;
 }

+int tpmfront_set_locality(struct tpmfront_dev* dev, int locality) {
+   if (!dev || !dev->page)
+      return -1;
+   dev->page->locality = locality;
+   return 0;
+}
+
 #ifdef HAVE_LIBC
 #include <errno.h>
 int tpmfront_open(struct tpmfront_dev* dev) diff --git a/xen/include/public/io/tpmif.h b/xen/include/public/io/tpmif.h index 02ccdab..afc9181 100644
--- a/xen/include/public/io/tpmif.h
+++ b/xen/include/public/io/tpmif.h
@@ -1,7 +1,7 @@
 /******************************************************************************
  * tpmif.h
  *
- * TPM I/O interface for Xen guest OSes.
+ * TPM I/O interface for Xen guest OSes, v2
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to @@ -21,48 +21,23 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  *
- * Copyright (c) 2005, IBM Corporation
- *
- * Author: Stefan Berger, stefanb@us.ibm.com
- * Grant table support: Mahadevan Gomathisankaran
- *
- * This code has been derived from tools/libxc/xen/io/netif.h
- *
- * Copyright (c) 2003-2004, Keir Fraser
  */

 #ifndef __XEN_PUBLIC_IO_TPMIF_H__
 #define __XEN_PUBLIC_IO_TPMIF_H__

-#include "../grant_table.h"
+struct vtpm_shared_page {
+    uint16_t length;         /* request/response length in bytes */

-struct tpmif_tx_request {
-    unsigned long addr;   /* Machine address of packet.   */
-    grant_ref_t ref;      /* grant table access reference */
-    uint16_t unused;
-    uint16_t size;        /* Packet size in bytes.        */
-};
-typedef struct tpmif_tx_request tpmif_tx_request_t;
-
-/*
- * The TPMIF_TX_RING_SIZE defines the number of pages the
- * front-end and backend can exchange (= size of array).
- */
-typedef uint32_t TPMIF_RING_IDX;
-
-#define TPMIF_TX_RING_SIZE 1
-
-/* This structure must fit in a memory page. */
-
-struct tpmif_ring {
-    struct tpmif_tx_request req;
-};
-typedef struct tpmif_ring tpmif_ring_t;
+    uint8_t state;           /* 0 - response ready / idle
+                              * 1 - request ready / working */
+    uint8_t locality;        /* for the current request */
+    uint8_t padding[3];

-struct tpmif_tx_interface {
-    struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
+    uint8_t nr_extra_pages;  /* extra pages for long packets; may be zero */
+    uint32_t extra_pages[0]; /* grant IDs; length is actually
+ nr_extra_pages */
 };
-typedef struct tpmif_tx_interface tpmif_tx_interface_t;
+typedef struct vtpm_shared_page vtpm_shared_page_t;

 #endif

--
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:18:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:18:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqWQ-0004xq-71; Tue, 20 Nov 2012 16:18:02 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TaqWN-0004xB-Ub
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:18:00 +0000
Received: from [193.109.254.147:2745] by server-8.bemta-14.messagelabs.com id
	05/AF-05026-53DABA05; Tue, 20 Nov 2012 16:17:57 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-10.tower-27.messagelabs.com!1353428257!4846011!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6461 invoked from network); 20 Nov 2012 16:17:38 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-10.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 20 Nov 2012 16:17:38 -0000
Received: from ([128.244.198.90])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.157706588;
	Tue, 20 Nov 2012 11:17:20 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas1.dom1.jhuapl.edu ([128.244.198.90]) with mapi; Tue, 20 Nov 2012
	11:16:51 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Date: Tue, 20 Nov 2012 11:16:50 -0500
Thread-Topic: [PATCH RFC] stubdom: Change vTPM shared page ABI
Thread-Index: Ac3HOZZLjOLBnNkwR0yoQ+J7Tm6taQAAH0CA
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This was something I've been wanting to do for a while so I'm very happy you went ahead and fixed it yourself. Once you submit the linux version I'll test it on my system.

Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

-----Original Message-----
From: Daniel De Graaf [mailto:dgdegra@tycho.nsa.gov]
Sent: Tuesday, November 20, 2012 11:11 AM
To: Fioravante, Matthew E.
Cc: xen-devel@lists.xen.org; Ian.Campbell@citrix.com; Daniel De Graaf
Subject: [PATCH RFC] stubdom: Change vTPM shared page ABI

Since the vTPM implementations are being incorproated into Xen and possibly upstream Linux, I would like to see if this protocol change could be added before we have significant legacy implementations. If not, I still think it would be useful as either a v2 or negotiated protocol change.

The current vTPM protocol is a copy of the network protocol. This was likely done for ease of implementation, since support for the network backend/frontend existed in Linux and minios. However, this implementation is overly complex when dealing with vTPM packets: for example, a vTPM never needs to deal with having more than one packet in flight at any given time.

I will send the corresponding patch for the Linux kernel module once I have adapted it for the file names used in the upstream version.

------------------------------------>8----------------------------------

This changes the vTPM shared page ABI from a copy of the Xen network interface to a single-page interface that better reflects the expected behavior of a TPM: only a single request packet can be sent at any given time, and every packet sent generates a single response packet. This protocol change should also increase efficiency as it avoids mapping and unmapping grants when possible.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/include/tpmback.h  |   1 +
 extras/mini-os/include/tpmfront.h |   7 +-
 extras/mini-os/tpmback.c          | 132 ++++++++++++++-------------------
 extras/mini-os/tpmfront.c         | 150 +++++++++++++++++++-------------------
 xen/include/public/io/tpmif.h     |  45 +++---------
 5 files changed, 148 insertions(+), 187 deletions(-)

diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
index ff86732..ec9eda4 100644
--- a/extras/mini-os/include/tpmback.h
+++ b/extras/mini-os/include/tpmback.h
@@ -43,6 +43,7 @@

 struct tpmcmd {
    domid_t domid;              /* Domid of the frontend */
+   uint8_t locality;    /* Locality requested by the frontend */
    unsigned int handle;        /* Handle of the frontend */
    unsigned char uuid[16];                     /* uuid of the tpm interface */

diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include/tpmfront.h
index fd2cb17..a0c7c4d 100644
--- a/extras/mini-os/include/tpmfront.h
+++ b/extras/mini-os/include/tpmfront.h
@@ -37,9 +37,7 @@ struct tpmfront_dev {
    grant_ref_t ring_ref;
    evtchn_port_t evtchn;

-   tpmif_tx_interface_t* tx;
-
-   void** pages;
+   vtpm_shared_page_t *page;

    domid_t bedomid;
    char* nodename;
@@ -77,6 +75,9 @@ void shutdown_tpmfront(struct tpmfront_dev* dev);
  * */
 int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen);

+/* Set the locality used for communicating with a vTPM */ int
+tpmfront_set_locality(struct tpmfront_dev* dev, int locality);
+
 #ifdef HAVE_LIBC
 #include <sys/stat.h>
 /* POSIX IO functions:
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c index 658fed1..29aced9 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -86,10 +86,7 @@ struct tpmif {
    evtchn_port_t evtchn;

    /* Shared page */
-   tpmif_tx_interface_t* tx;
-
-   /* pointer to TPMIF_RX_RING_SIZE pages */
-   void** pages;
+   vtpm_shared_page_t *page;

    enum xenbus_state state;
    enum { DISCONNECTED, DISCONNECTING, CONNECTED } status; @@ -386,8 +383,7 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
    tpmif->fe_state_path = NULL;
    tpmif->state = XenbusStateInitialising;
    tpmif->status = DISCONNECTED;
-   tpmif->tx = NULL;
-   tpmif->pages = NULL;
+   tpmif->page = NULL;
    tpmif->flags = 0;
    memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
    return tpmif;
@@ -395,9 +391,6 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)

 void __free_tpmif(tpmif_t* tpmif)
 {
-   if(tpmif->pages) {
-      free(tpmif->pages);
-   }
    if(tpmif->fe_path) {
       free(tpmif->fe_path);
    }
@@ -430,12 +423,6 @@ tpmif_t* new_tpmif(domid_t domid, unsigned int handle)
       goto error;
    }

-   /* allocate pages to be used for shared mapping */
-   if((tpmif->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE)) == NULL) {
-      goto error;
-   }
-   memset(tpmif->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-
    if(tpmif_change_state(tpmif, XenbusStateInitWait)) {
       goto error;
    }
@@ -486,7 +473,7 @@ void free_tpmif(tpmif_t* tpmif)
       tpmif->status = DISCONNECTING;
       mask_evtchn(tpmif->evtchn);

-      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1)) {
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
         TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
       }

@@ -529,9 +516,10 @@ void free_tpmif(tpmif_t* tpmif)  void tpmback_handler(evtchn_port_t port, struct pt_regs *regs, void *data)  {
    tpmif_t* tpmif = (tpmif_t*) data;
-   tpmif_tx_request_t* tx = &tpmif->tx->ring[0].req;
-   /* Throw away 0 size events, these can trigger from event channel unmasking */
-   if(tx->size == 0)
+   vtpm_shared_page_t* pg = tpmif->page;
+
+   /* Only pay attention if the request is ready */
+   if (pg->state == 0)
       return;

    TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle); @@ -585,11 +573,10 @@ int connect_fe(tpmif_t* tpmif)
    free(value);

    domid = tpmif->domid;
-   if((tpmif->tx = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
+   if((tpmif->page = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0,
+ &ringref, PROT_READ | PROT_WRITE)) == NULL) {
       TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
       return -1;
    }
-   memset(tpmif->tx, 0, PAGE_SIZE);

    /*Bind the event channel */
    if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler, tpmif, &tpmif->evtchn))) @@ -618,10 +605,28 @@ error_post_evtchn:
    mask_evtchn(tpmif->evtchn);
    unbind_evtchn(tpmif->evtchn);
 error_post_map:
-   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1);
+   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1);
    return -1;
 }

+static void disconnect_fe(tpmif_t* tpmif) {
+   if (tpmif->status == CONNECTED) {
+      tpmif->status = DISCONNECTING;
+      mask_evtchn(tpmif->evtchn);
+
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
+        TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
+      }
+
+      unbind_evtchn(tpmif->evtchn);
+   }
+   tpmif->status = DISCONNECTED;
+   tpmif_change_state(tpmif, XenbusStateReconfigured);
+
+   TPMBACK_LOG("Frontend %u/%u disconnected\n", (unsigned int)
+tpmif->domid, tpmif->handle); }
+
 static int frontend_changed(tpmif_t* tpmif)  {
    int state = xenbus_read_integer(tpmif->fe_state_path);
@@ -874,6 +879,7 @@ void shutdown_tpmback(void)  inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, unsigned char uuid[16])  {
    tpmcmd->domid = domid;
+   tpmcmd->locality = -1;
    tpmcmd->handle = handle;
    memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
    tpmcmd->req = NULL;
@@ -884,12 +890,12 @@ inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, un

 tpmcmd_t* get_request(tpmif_t* tpmif) {
    tpmcmd_t* cmd;
-   tpmif_tx_request_t* tx;
-   int offset;
-   int tocopy;
-   int i;
-   uint32_t domid;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+int i;
+#endif

    local_irq_save(flags);

@@ -899,35 +905,22 @@ tpmcmd_t* get_request(tpmif_t* tpmif) {
    }
    init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);

-   tx = &tpmif->tx->ring[0].req;
-   cmd->req_len = tx->size;
+   shr = tpmif->page;
+   cmd->req_len = shr->length;
+   cmd->locality = shr->locality;
+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->req_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
+   }
    /* Allocate the buffer */
    if(cmd->req_len) {
       if((cmd->req = malloc(cmd->req_len)) == NULL) {
         goto error;
       }
    }
-   /* Copy the bits from the shared pages */
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->req_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_READ)) == NULL) {
-        TPMBACK_ERR("%u/%u Unable to map shared page during read!\n", (unsigned int) tpmif->domid, tpmif->handle);
-        goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->req_len - offset, PAGE_SIZE);
-      memcpy(&cmd->req[offset], tpmif->pages[i], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
-
-   }
+   /* Copy the bits from the shared page(s) */
+   memcpy(cmd->req, offset + (uint8_t*)shr, cmd->req_len);

 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Received Tpm Command from %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->req_len); @@ -958,38 +951,24 @@ error:

 void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)  {
-   tpmif_tx_request_t* tx;
-   int offset;
-   int i;
-   uint32_t domid;
-   int tocopy;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+int i;
+#endif

    local_irq_save(flags);

-   tx = &tpmif->tx->ring[0].req;
-   tx->size = cmd->resp_len;
-
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->resp_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_WRITE)) == NULL) {
-        TPMBACK_ERR("%u/%u Unable to map shared page during write!\n", (unsigned int) tpmif->domid, tpmif->handle);
-        goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->resp_len - offset, PAGE_SIZE);
-      memcpy(tpmif->pages[i], &cmd->resp[offset], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
+   shr = tpmif->page;
+   shr->length = cmd->resp_len;

+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->resp_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
    }
+   memcpy(offset + (uint8_t*)shr, cmd->resp, cmd->resp_len);

 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Sent response to %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->resp_len); @@ -1003,6 +982,7 @@ void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)  #endif
    /* clear the ready flag and send the event channel notice to the frontend */
    tpmif_req_finished(tpmif);
+   shr->state = 0;
    notify_remote_via_evtchn(tpmif->evtchn);
 error:
    local_irq_restore(flags);
diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c index 0218d7f..bcee93d 100644
--- a/extras/mini-os/tpmfront.c
+++ b/extras/mini-os/tpmfront.c
@@ -153,6 +153,32 @@ static int wait_for_backend_closed(xenbus_event_queue* events, char* path)

 }

+static int wait_for_backend_reconfig(xenbus_event_queue* events, char*
+path) {
+   int state;
+
+   TPMFRONT_LOG("Waiting for backend to reconfigure...\n");
+   while(1) {
+      state = xenbus_read_integer(path);
+      if ( state < 0)
+        state = XenbusStateUnknown;
+      switch(state) {
+        case XenbusStateUnknown:
+           TPMFRONT_ERR("Backend Unknown state, forcing shutdown\n");
+           return -1;
+        case XenbusStateClosed:
+           TPMFRONT_LOG("Backend Closed\n");
+           return 0;
+        case XenbusStateReconfigured:
+           TPMFRONT_LOG("Backend Reconfigured\n");
+           return 0;
+        default:
+           xenbus_wait_for_watch(events);
+      }
+   }
+
+}
+
 static int wait_for_backend_state_changed(struct tpmfront_dev* dev, XenbusState state) {
    char* err;
    int ret = 0;
@@ -175,8 +201,11 @@ static int wait_for_backend_state_changed(struct tpmfront_dev* dev, XenbusState
       case XenbusStateClosed:
         ret = wait_for_backend_closed(&events, path);
         break;
-      default:
+      case XenbusStateReconfigured:
+        ret = wait_for_backend_reconfig(&events, path);
         break;
+      default:
+         TPMFRONT_ERR("Bad wait state %d, ignoring\n", state);
    }

    if((err = xenbus_unwatch_path_token(XBT_NIL, path, path))) { @@ -190,13 +219,13 @@ static int tpmfront_connect(struct tpmfront_dev* dev)  {
    char* err;
    /* Create shared page */
-   dev->tx = (tpmif_tx_interface_t*) alloc_page();
-   if(dev->tx == NULL) {
+   dev->page = (vtpm_shared_page_t*) alloc_page();
+   if(dev->page == NULL) {
       TPMFRONT_ERR("Unable to allocate page for shared memory\n");
       goto error;
    }
-   memset(dev->tx, 0, PAGE_SIZE);
-   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->tx), 0);
+   memset(dev->page, 0, PAGE_SIZE);
+   dev->ring_ref = gnttab_grant_access(dev->bedomid,
+ virt_to_mfn(dev->page), 0);
    TPMFRONT_DEBUG("grant ref is %lu\n", (unsigned long) dev->ring_ref);

    /*Create event channel */
@@ -228,7 +257,7 @@ error_postevtchn:
       unbind_evtchn(dev->evtchn);
 error_postmap:
       gnttab_end_access(dev->ring_ref);
-      free_page(dev->tx);
+      free_page(dev->page);
 error:
    return -1;
 }
@@ -240,7 +269,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
    char path[512];
    char* value, *err;
    unsigned long long ival;
-   int i;

    printk("============= Init TPM Front ================\n");

@@ -289,19 +317,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
       goto error;
    }

-   /* Allocate pages that will contain the messages */
-   dev->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE);
-   if(dev->pages == NULL) {
-      goto error;
-   }
-   memset(dev->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-   for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-      dev->pages[i] = (void*)alloc_page();
-      if(dev->pages[i] == NULL) {
-        goto error;
-      }
-   }
-
    TPMFRONT_LOG("Initialization Completed successfully\n");

    return dev;
@@ -314,12 +329,10 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)  {
    char* err;
    char path[512];
-   int i;
-   tpmif_tx_request_t* tx;
    if(dev == NULL) {
       return;
    }
-   TPMFRONT_LOG("Shutting down tpmfront\n");
+   TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for
+ reconfigure" : "");
    /* disconnect */
    if(dev->state == XenbusStateConnected) {
       dev->state = XenbusStateClosing;
@@ -349,27 +362,12 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
       /* Wait for the backend to close and unmap shared pages, ignore any errors */
       wait_for_backend_state_changed(dev, XenbusStateClosed);

-      /* Cleanup any shared pages */
-      if(dev->pages) {
-        for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-           if(dev->pages[i]) {
-              tx = &dev->tx->ring[i].req;
-              if(tx->ref != 0) {
-                 gnttab_end_access(tx->ref);
-              }
-              free_page(dev->pages[i]);
-           }
-        }
-        free(dev->pages);
-      }
-
       /* Close event channel and unmap shared page */
       mask_evtchn(dev->evtchn);
       unbind_evtchn(dev->evtchn);
       gnttab_end_access(dev->ring_ref);

-      free_page(dev->tx);
-
+      free_page(dev->page);
    }

    /* Cleanup memory usage */
@@ -387,13 +385,17 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)

 int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)  {
-   int i;
-   tpmif_tx_request_t* tx = NULL;
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
+int i;
+#endif
    /* Error Checking */
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to send message through disconnected frontend\n");
       return -1;
    }
+   shr = dev->page;

 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Sending Msg to backend size=%u", (unsigned int) length); @@ -407,19 +409,16 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)  #endif

    /* Copy to shared pages now */
-   for(i = 0; length > 0 && i < TPMIF_TX_RING_SIZE; ++i) {
-      /* Share the page */
-      tx = &dev->tx->ring[i].req;
-      tx->unused = 0;
-      tx->addr = virt_to_mach(dev->pages[i]);
-      tx->ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->pages[i]), 0);
-      /* Copy the bits to the page */
-      tx->size = length > PAGE_SIZE ? PAGE_SIZE : length;
-      memcpy(dev->pages[i], &msg[i * PAGE_SIZE], tx->size);
-
-      /* Update counters */
-      length -= tx->size;
+   offset = sizeof(*shr);
+   if (length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Message too long for shared page\n");
+      return -1;
    }
+   memcpy(offset + (uint8_t*)shr, msg, length);
+   shr->length = length;
+   barrier();
+   shr->state = 1;
+
    dev->waiting = 1;
    dev->resplen = 0;
 #ifdef HAVE_LIBC
@@ -434,44 +433,41 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)  }  int tpmfront_recv(struct tpmfront_dev* dev, uint8_t** msg, size_t *length)  {
-   tpmif_tx_request_t* tx;
-   int i;
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
+int i;
+#endif
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to receive message from disconnected frontend\n");
       return -1;
    }
    /*Wait for the response */
    wait_event(dev->waitq, (!dev->waiting));
+   shr = dev->page;
+   if (shr->state != 0)
+      goto quit;

    /* Initialize */
    *msg = NULL;
-   *length = 0;
+   *length = shr->length;
+   offset = sizeof(*shr);

-   /* special case, just quit */
-   tx = &dev->tx->ring[0].req;
-   if(tx->size == 0 ) {
-       goto quit;
-   }
-   /* Get the total size */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      *length += tx->size;
+   if (*length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Reply too long for shared page\n");
+      return -1;
    }
+
    /* Alloc the buffer */
    if(dev->respbuf) {
       free(dev->respbuf);
    }
    *msg = dev->respbuf = malloc(*length);
    dev->resplen = *length;
+
    /* Copy the bits */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      memcpy(&(*msg)[i * PAGE_SIZE], dev->pages[i], tx->size);
-      gnttab_end_access(tx->ref);
-      tx->ref = 0;
-   }
+   memcpy(*msg, offset + (uint8_t*)shr, *length);
+
 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Received response from backend size=%u", (unsigned int) *length);
    for(i = 0; i < *length; ++i) {
@@ -504,6 +500,14 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t*
    return 0;
 }

+int tpmfront_set_locality(struct tpmfront_dev* dev, int locality) {
+   if (!dev || !dev->page)
+      return -1;
+   dev->page->locality = locality;
+   return 0;
+}
+
 #ifdef HAVE_LIBC
 #include <errno.h>
 int tpmfront_open(struct tpmfront_dev* dev) diff --git a/xen/include/public/io/tpmif.h b/xen/include/public/io/tpmif.h index 02ccdab..afc9181 100644
--- a/xen/include/public/io/tpmif.h
+++ b/xen/include/public/io/tpmif.h
@@ -1,7 +1,7 @@
 /******************************************************************************
  * tpmif.h
  *
- * TPM I/O interface for Xen guest OSes.
+ * TPM I/O interface for Xen guest OSes, v2
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to @@ -21,48 +21,23 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  *
- * Copyright (c) 2005, IBM Corporation
- *
- * Author: Stefan Berger, stefanb@us.ibm.com
- * Grant table support: Mahadevan Gomathisankaran
- *
- * This code has been derived from tools/libxc/xen/io/netif.h
- *
- * Copyright (c) 2003-2004, Keir Fraser
  */

 #ifndef __XEN_PUBLIC_IO_TPMIF_H__
 #define __XEN_PUBLIC_IO_TPMIF_H__

-#include "../grant_table.h"
+struct vtpm_shared_page {
+    uint16_t length;         /* request/response length in bytes */

-struct tpmif_tx_request {
-    unsigned long addr;   /* Machine address of packet.   */
-    grant_ref_t ref;      /* grant table access reference */
-    uint16_t unused;
-    uint16_t size;        /* Packet size in bytes.        */
-};
-typedef struct tpmif_tx_request tpmif_tx_request_t;
-
-/*
- * The TPMIF_TX_RING_SIZE defines the number of pages the
- * front-end and backend can exchange (= size of array).
- */
-typedef uint32_t TPMIF_RING_IDX;
-
-#define TPMIF_TX_RING_SIZE 1
-
-/* This structure must fit in a memory page. */
-
-struct tpmif_ring {
-    struct tpmif_tx_request req;
-};
-typedef struct tpmif_ring tpmif_ring_t;
+    uint8_t state;           /* 0 - response ready / idle
+                              * 1 - request ready / working */
+    uint8_t locality;        /* for the current request */
+    uint8_t padding[3];

-struct tpmif_tx_interface {
-    struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
+    uint8_t nr_extra_pages;  /* extra pages for long packets; may be zero */
+    uint32_t extra_pages[0]; /* grant IDs; length is actually
+ nr_extra_pages */
 };
-typedef struct tpmif_tx_interface tpmif_tx_interface_t;
+typedef struct vtpm_shared_page vtpm_shared_page_t;

 #endif

--
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:27:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:27:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taqfd-0005Oc-MQ; Tue, 20 Nov 2012 16:27:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <eric.dumazet@gmail.com>) id 1Taqfb-0005OW-PD
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:27:32 +0000
Received: from [85.158.139.211:29591] by server-10.bemta-5.messagelabs.com id
	9D/49-09257-27FABA05; Tue, 20 Nov 2012 16:27:30 +0000
X-Env-Sender: eric.dumazet@gmail.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1353428848!20923060!1
X-Originating-IP: [209.85.210.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13186 invoked from network); 20 Nov 2012 16:27:29 -0000
Received: from mail-da0-f45.google.com (HELO mail-da0-f45.google.com)
	(209.85.210.45)
	by server-2.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 16:27:29 -0000
Received: by mail-da0-f45.google.com with SMTP id w4so411745dam.32
	for <xen-devel@lists.xen.org>; Tue, 20 Nov 2012 08:27:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=subject:from:to:cc:in-reply-to:references:content-type:date
	:message-id:mime-version:x-mailer:content-transfer-encoding;
	bh=kUzHR1/2gWpqptCi/wLg/tlf4Ld1+jCUMNz9cpsPcFY=;
	b=AG8noiUGSX8bkmg2o79g2nBSp1WAnnDmbqxUt51exmdDh0685Rw4WBhPeX7X0WZMvi
	uI/hK+T+xbQQMrVhu0+EVtnmoc7iz2rxZTfyK4/DzRJG7AtfrSWDVmlG8G2ZMqdAf0XI
	wWkCa+FRODfHmg33X+hGoKj/h6tI0eo/EOpPK2o4cK2bIwRjZ4heJ/mqXzmFTx4ewSSs
	8FWEkH+9WV2c1ofRk9Zx1jrRQBBlNq+ZDo3OD/v8HZDUKvRhzVAruPDESGTjQpLx5Z7/
	Sehi7ZgVc2R6b2c/Hmfvd7r2GtqO6K2RDjpImYVBde+q+zDGDuF0bQbS0Jv93iU26BkO
	+fPw==
Received: by 10.68.230.135 with SMTP id sy7mr50513014pbc.76.1353428847647;
	Tue, 20 Nov 2012 08:27:27 -0800 (PST)
Received: from [67.218.107.94] ([67.218.107.94])
	by mx.google.com with ESMTPS id ok8sm8295243pbb.42.2012.11.20.08.27.25
	(version=SSLv3 cipher=OTHER); Tue, 20 Nov 2012 08:27:26 -0800 (PST)
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ian Campbell <ian.campbell@citrix.com>
In-Reply-To: <1353427257-16789-1-git-send-email-ian.campbell@citrix.com>
References: <1353427257-16789-1-git-send-email-ian.campbell@citrix.com>
Date: Tue, 20 Nov 2012 08:27:24 -0800
Message-ID: <1353428844.2590.17.camel@edumazet-glaptop>
Mime-Version: 1.0
X-Mailer: Evolution 2.28.3 
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>, netdev@vger.kernel.org,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	xen-devel@lists.xen.org, Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH V2] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 16:00 +0000, Ian Campbell wrote:
> An SKB paged fragment can consist of a compound page with order > 0.
> However the netchannel protocol deals only in PAGE_SIZE frames.
> 
> Handle this in xennet_make_frags by iterating over the frames which
> make up the page.
> 
> This is the netfront equivalent to 6a8ed462f16b for netback.
...

> -	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
> -	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
> -		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
> -		       frags);
> -		dump_stack();
> +	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
> +		xennet_count_skb_frag_slots(skb);
> +	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
> +		printk(KERN_ALERT "xennet: skb rides the rocket: %d slots\n",
> +		       slots);

I think this is wrong.

You should change netfront_tx_slot_available() to stop the queue before
this can happen.

Yes, you dont hit this on your tests, but a driver should not drop a
good packet.

>  		goto drop;
>  	}
>  
>  	spin_lock_irqsave(&np->tx_lock, flags);
>  
>  	if (unlikely(!netif_carrier_ok(dev) ||
> -		     (frags > 1 && !xennet_can_sg(dev)) ||
> +		     (slots > 1 && !xennet_can_sg(dev)) ||
>  		     netif_needs_gso(skb, netif_skb_features(skb)))) {
>  		spin_unlock_irqrestore(&np->tx_lock, flags);
>  		goto drop;


diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index caa0110..cb1e605 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -215,10 +215,13 @@ static void rx_refill_timeout(unsigned long data)
        napi_schedule(&np->napi);
 }
 
+/* Considering a 64Kb packet of 16 frags, each frag can be mapped
+ * to 3 order-0 parts on pathological cases
+ */
 static int netfront_tx_slot_available(struct netfront_info *np)
 {
        return (np->tx.req_prod_pvt - np->tx.rsp_cons) <
-               (TX_MAX_TARGET - MAX_SKB_FRAGS - 2);
+               (TX_MAX_TARGET - 3*MAX_SKB_FRAGS - 2);
 }
 
 static void xennet_maybe_wake_tx(struct net_device *dev)



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:27:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:27:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taqfd-0005Oc-MQ; Tue, 20 Nov 2012 16:27:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <eric.dumazet@gmail.com>) id 1Taqfb-0005OW-PD
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:27:32 +0000
Received: from [85.158.139.211:29591] by server-10.bemta-5.messagelabs.com id
	9D/49-09257-27FABA05; Tue, 20 Nov 2012 16:27:30 +0000
X-Env-Sender: eric.dumazet@gmail.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1353428848!20923060!1
X-Originating-IP: [209.85.210.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13186 invoked from network); 20 Nov 2012 16:27:29 -0000
Received: from mail-da0-f45.google.com (HELO mail-da0-f45.google.com)
	(209.85.210.45)
	by server-2.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 16:27:29 -0000
Received: by mail-da0-f45.google.com with SMTP id w4so411745dam.32
	for <xen-devel@lists.xen.org>; Tue, 20 Nov 2012 08:27:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=subject:from:to:cc:in-reply-to:references:content-type:date
	:message-id:mime-version:x-mailer:content-transfer-encoding;
	bh=kUzHR1/2gWpqptCi/wLg/tlf4Ld1+jCUMNz9cpsPcFY=;
	b=AG8noiUGSX8bkmg2o79g2nBSp1WAnnDmbqxUt51exmdDh0685Rw4WBhPeX7X0WZMvi
	uI/hK+T+xbQQMrVhu0+EVtnmoc7iz2rxZTfyK4/DzRJG7AtfrSWDVmlG8G2ZMqdAf0XI
	wWkCa+FRODfHmg33X+hGoKj/h6tI0eo/EOpPK2o4cK2bIwRjZ4heJ/mqXzmFTx4ewSSs
	8FWEkH+9WV2c1ofRk9Zx1jrRQBBlNq+ZDo3OD/v8HZDUKvRhzVAruPDESGTjQpLx5Z7/
	Sehi7ZgVc2R6b2c/Hmfvd7r2GtqO6K2RDjpImYVBde+q+zDGDuF0bQbS0Jv93iU26BkO
	+fPw==
Received: by 10.68.230.135 with SMTP id sy7mr50513014pbc.76.1353428847647;
	Tue, 20 Nov 2012 08:27:27 -0800 (PST)
Received: from [67.218.107.94] ([67.218.107.94])
	by mx.google.com with ESMTPS id ok8sm8295243pbb.42.2012.11.20.08.27.25
	(version=SSLv3 cipher=OTHER); Tue, 20 Nov 2012 08:27:26 -0800 (PST)
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ian Campbell <ian.campbell@citrix.com>
In-Reply-To: <1353427257-16789-1-git-send-email-ian.campbell@citrix.com>
References: <1353427257-16789-1-git-send-email-ian.campbell@citrix.com>
Date: Tue, 20 Nov 2012 08:27:24 -0800
Message-ID: <1353428844.2590.17.camel@edumazet-glaptop>
Mime-Version: 1.0
X-Mailer: Evolution 2.28.3 
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>, netdev@vger.kernel.org,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	xen-devel@lists.xen.org, Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH V2] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 16:00 +0000, Ian Campbell wrote:
> An SKB paged fragment can consist of a compound page with order > 0.
> However the netchannel protocol deals only in PAGE_SIZE frames.
> 
> Handle this in xennet_make_frags by iterating over the frames which
> make up the page.
> 
> This is the netfront equivalent to 6a8ed462f16b for netback.
...

> -	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
> -	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
> -		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
> -		       frags);
> -		dump_stack();
> +	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
> +		xennet_count_skb_frag_slots(skb);
> +	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
> +		printk(KERN_ALERT "xennet: skb rides the rocket: %d slots\n",
> +		       slots);

I think this is wrong.

You should change netfront_tx_slot_available() to stop the queue before
this can happen.

Yes, you dont hit this on your tests, but a driver should not drop a
good packet.

>  		goto drop;
>  	}
>  
>  	spin_lock_irqsave(&np->tx_lock, flags);
>  
>  	if (unlikely(!netif_carrier_ok(dev) ||
> -		     (frags > 1 && !xennet_can_sg(dev)) ||
> +		     (slots > 1 && !xennet_can_sg(dev)) ||
>  		     netif_needs_gso(skb, netif_skb_features(skb)))) {
>  		spin_unlock_irqrestore(&np->tx_lock, flags);
>  		goto drop;


diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index caa0110..cb1e605 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -215,10 +215,13 @@ static void rx_refill_timeout(unsigned long data)
        napi_schedule(&np->napi);
 }
 
+/* Considering a 64Kb packet of 16 frags, each frag can be mapped
+ * to 3 order-0 parts on pathological cases
+ */
 static int netfront_tx_slot_available(struct netfront_info *np)
 {
        return (np->tx.req_prod_pvt - np->tx.rsp_cons) <
-               (TX_MAX_TARGET - MAX_SKB_FRAGS - 2);
+               (TX_MAX_TARGET - 3*MAX_SKB_FRAGS - 2);
 }
 
 static void xennet_maybe_wake_tx(struct net_device *dev)



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:29:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:29:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqhA-0005Tw-K9; Tue, 20 Nov 2012 16:29:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1Taqh9-0005Tn-DS
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:29:07 +0000
Received: from [85.158.143.99:42048] by server-3.bemta-4.messagelabs.com id
	76/AD-06841-2DFABA05; Tue, 20 Nov 2012 16:29:06 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1353428945!25413086!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjMyNTM3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1457 invoked from network); 20 Nov 2012 16:29:06 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-4.tower-216.messagelabs.com with SMTP;
	20 Nov 2012 16:29:06 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga101.ch.intel.com with ESMTP; 20 Nov 2012 08:29:04 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,286,1352102400"; d="scan'208";a="220220318"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by azsmga001.ch.intel.com with ESMTP; 20 Nov 2012 08:29:03 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 08:29:03 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 00:29:01 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>, Ian Campbell
	<Ian.Campbell@citrix.com>
Thread-Topic: [PATCH V3] X86/vMCE: handle broken page with regard to migration
Thread-Index: AQHNxmqvgIBs/Elka0CkW2KriS9nNJfy5pOw
Date: Tue, 20 Nov 2012 16:29:00 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353934C2@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
In-Reply-To: <50AA5061.7040103@eu.citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> On 19/11/12 09:55, Ian Campbell wrote:
>> If we get to this stage then haven't we either already sent something
>> over the wire for this page or marked it as dirty when we tried and
>> failed to send it? 
>> 
>> In the former case we don't care that the page is now broken on the
>> source since the target has got a good pre-breakage copy.
>> 
>> In the latter case could we not set a flag at the same time as we
>> mark the page dirty which means "go round at least one more time"?
> 
> Yeah -- on the last iteration, the VM itself has to be paused; if any
> pages get broken after that, it doesn't really matter, does it? The

If the page (which will break at last iter) is in the dirty bitmap of last iter, it does matter, even though VM forzen at last iter.

> real thing is to have a consistent "snapshot" of behavior.
> 
> I guess the one potentially tricky case to worry about is whether to
> deliver an MCE to the guest on restore.  Consider the following
> scenario: 
> 
> - Page A is modified (and marked dirty)
> - VM paused for last iteration
> - Page breaks, is marked broken in the p2m
> - Save code sends page A
> 
> In that case, the save code would send a "broken" page, and the
> restore code would mark a page as broken, and we *would* want to
> deliver an MCE on the far side.  But suppose the last two steps were
> reversed: 
> 
> - Page A modified
> - VM paused for last iteration
> - Save code sends page A
> - Page breaks, marked broken in the p2m
> 
> In that case, when the save code sends page A, it will send a good
> page; there's no need to mark it broken, 

> or to send the guest an MCE.
> 
> Am I understanding the situation correctly, Jinsong?
> 
>   -George

Yes, if not consider code complication :-)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:29:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:29:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqhA-0005Tw-K9; Tue, 20 Nov 2012 16:29:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1Taqh9-0005Tn-DS
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:29:07 +0000
Received: from [85.158.143.99:42048] by server-3.bemta-4.messagelabs.com id
	76/AD-06841-2DFABA05; Tue, 20 Nov 2012 16:29:06 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1353428945!25413086!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjMyNTM3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1457 invoked from network); 20 Nov 2012 16:29:06 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-4.tower-216.messagelabs.com with SMTP;
	20 Nov 2012 16:29:06 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga101.ch.intel.com with ESMTP; 20 Nov 2012 08:29:04 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,286,1352102400"; d="scan'208";a="220220318"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by azsmga001.ch.intel.com with ESMTP; 20 Nov 2012 08:29:03 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 08:29:03 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 00:29:01 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>, Ian Campbell
	<Ian.Campbell@citrix.com>
Thread-Topic: [PATCH V3] X86/vMCE: handle broken page with regard to migration
Thread-Index: AQHNxmqvgIBs/Elka0CkW2KriS9nNJfy5pOw
Date: Tue, 20 Nov 2012 16:29:00 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353934C2@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
In-Reply-To: <50AA5061.7040103@eu.citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> On 19/11/12 09:55, Ian Campbell wrote:
>> If we get to this stage then haven't we either already sent something
>> over the wire for this page or marked it as dirty when we tried and
>> failed to send it? 
>> 
>> In the former case we don't care that the page is now broken on the
>> source since the target has got a good pre-breakage copy.
>> 
>> In the latter case could we not set a flag at the same time as we
>> mark the page dirty which means "go round at least one more time"?
> 
> Yeah -- on the last iteration, the VM itself has to be paused; if any
> pages get broken after that, it doesn't really matter, does it? The

If the page (which will break at last iter) is in the dirty bitmap of last iter, it does matter, even though VM forzen at last iter.

> real thing is to have a consistent "snapshot" of behavior.
> 
> I guess the one potentially tricky case to worry about is whether to
> deliver an MCE to the guest on restore.  Consider the following
> scenario: 
> 
> - Page A is modified (and marked dirty)
> - VM paused for last iteration
> - Page breaks, is marked broken in the p2m
> - Save code sends page A
> 
> In that case, the save code would send a "broken" page, and the
> restore code would mark a page as broken, and we *would* want to
> deliver an MCE on the far side.  But suppose the last two steps were
> reversed: 
> 
> - Page A modified
> - VM paused for last iteration
> - Save code sends page A
> - Page breaks, marked broken in the p2m
> 
> In that case, when the save code sends page A, it will send a good
> page; there's no need to mark it broken, 

> or to send the guest an MCE.
> 
> Am I understanding the situation correctly, Jinsong?
> 
>   -George

Yes, if not consider code complication :-)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:29:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:29:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taqh8-0005Tg-5s; Tue, 20 Nov 2012 16:29:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1Taqh6-0005TZ-0o
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:29:04 +0000
Received: from [85.158.139.83:40846] by server-10.bemta-5.messagelabs.com id
	61/8C-09257-FCFABA05; Tue, 20 Nov 2012 16:29:03 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353428941!19885474!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15190 invoked from network); 20 Nov 2012 16:29:02 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-8.tower-182.messagelabs.com with SMTP;
	20 Nov 2012 16:29:02 -0000
X-TM-IMSS-Message-ID: <08cff42b0000544f@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 08cff42b0000544f ;
	Mon, 19 Nov 2012 10:24:03 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJFKV9R024359; 
	Mon, 19 Nov 2012 10:20:32 -0500
Message-ID: <50AA4E3F.4090907@tycho.nsa.gov>
Date: Mon, 19 Nov 2012 10:20:31 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-10-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA08D102000078000A9957@nat28.tlf.novell.com>
In-Reply-To: <50AA08D102000078000A9957@nat28.tlf.novell.com>
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 09/19] xen: lock target domain in do_domctl
	common code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/19/2012 04:24 AM, Jan Beulich wrote:
>>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>> @@ -458,6 +443,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
>>          if ( IS_ERR(d) )
>>          {
>>              ret = PTR_ERR(d);
>> +            d = NULL;
> 
> Considering that in the common code you already set d to NULL,
> is there a specific reason why you do so again here ...
> 
>>              break;
>>          }
>>  
>> @@ -469,39 +455,28 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
>>          op->domain = d->domain_id;
>>          if ( copy_to_guest(u_domctl, op, 1) )
>>              ret = -EFAULT;
>> +        d = NULL;
> 
> ... and here?
> 
> Same further down for XEN_DOMCTL_getdomaininfo.
> 
> Jan
> 
>>      }
>>      break;
>>  
> 
> 
> 

This avoids unlocking the domain when it hasn't been locked (at the
end of the function at domctl_out_unlock) or trying to unlock a
ERR_PTR value.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:29:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:29:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taqh8-0005Tg-5s; Tue, 20 Nov 2012 16:29:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1Taqh6-0005TZ-0o
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:29:04 +0000
Received: from [85.158.139.83:40846] by server-10.bemta-5.messagelabs.com id
	61/8C-09257-FCFABA05; Tue, 20 Nov 2012 16:29:03 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353428941!19885474!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15190 invoked from network); 20 Nov 2012 16:29:02 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-8.tower-182.messagelabs.com with SMTP;
	20 Nov 2012 16:29:02 -0000
X-TM-IMSS-Message-ID: <08cff42b0000544f@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 08cff42b0000544f ;
	Mon, 19 Nov 2012 10:24:03 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJFKV9R024359; 
	Mon, 19 Nov 2012 10:20:32 -0500
Message-ID: <50AA4E3F.4090907@tycho.nsa.gov>
Date: Mon, 19 Nov 2012 10:20:31 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-10-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA08D102000078000A9957@nat28.tlf.novell.com>
In-Reply-To: <50AA08D102000078000A9957@nat28.tlf.novell.com>
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 09/19] xen: lock target domain in do_domctl
	common code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/19/2012 04:24 AM, Jan Beulich wrote:
>>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>> @@ -458,6 +443,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
>>          if ( IS_ERR(d) )
>>          {
>>              ret = PTR_ERR(d);
>> +            d = NULL;
> 
> Considering that in the common code you already set d to NULL,
> is there a specific reason why you do so again here ...
> 
>>              break;
>>          }
>>  
>> @@ -469,39 +455,28 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
>>          op->domain = d->domain_id;
>>          if ( copy_to_guest(u_domctl, op, 1) )
>>              ret = -EFAULT;
>> +        d = NULL;
> 
> ... and here?
> 
> Same further down for XEN_DOMCTL_getdomaininfo.
> 
> Jan
> 
>>      }
>>      break;
>>  
> 
> 
> 

This avoids unlocking the domain when it hasn't been locked (at the
end of the function at domctl_out_unlock) or trying to unlock a
ERR_PTR value.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:32:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:32:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqkJ-0005oG-9G; Tue, 20 Nov 2012 16:32:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TaqkH-0005nz-Tp
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:32:22 +0000
Received: from [85.158.139.83:64347] by server-14.bemta-5.messagelabs.com id
	C2/63-21768-390BBA05; Tue, 20 Nov 2012 16:32:19 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353429137!19886081!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25635 invoked from network); 20 Nov 2012 16:32:17 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-8.tower-182.messagelabs.com with SMTP;
	20 Nov 2012 16:32:17 -0000
X-TM-IMSS-Message-ID: <08b7576000004e0d@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 08b7576000004e0d ;
	Mon, 19 Nov 2012 09:57:10 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJErYQD022254; 
	Mon, 19 Nov 2012 09:53:35 -0500
Message-ID: <50AA47EE.907@tycho.nsa.gov>
Date: Mon, 19 Nov 2012 09:53:34 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-4-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA031802000078000A9935@nat28.tlf.novell.com>
In-Reply-To: <50AA031802000078000A9935@nat28.tlf.novell.com>
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 03/19] arch/x86: add distinct XSM hooks for
	map/unmap
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/19/2012 03:59 AM, Jan Beulich wrote:
>>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>> -static int flask_irq_permission (struct domain *d, int irq, uint8_t access)
>> +static int flask_unmap_domain_pirq (struct domain *d, int irq)
>>  {
>> -    u32 perm;
>> -    u32 rsid;
>> +    u32 sid;
>>      int rc = -EPERM;
>>  
>> -    struct domain_security_struct *ssec, *tsec;
>> +    struct domain_security_struct *ssec;
>>      struct avc_audit_data ad;
>>  
>> -    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
>> -                         resource_to_perm(access));
>> -
>> +    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
>>      if ( rc )
>>          return rc;
>>  
>> -    if ( access )
>> -        perm = RESOURCE__ADD_IRQ;
>> -    else
>> -        perm = RESOURCE__REMOVE_IRQ;
>> -
>>      ssec = current->domain->ssid;
>> -    tsec = d->ssid;
>>  
>> -    rc = get_irq_sid(irq, &rsid, &ad);
>> -    if ( rc )
>> -        return rc;
>> -
>> -    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
>> +    if ( irq >= nr_irqs_gsi ) {
> 
> Isn't the use of nr_irqs_gsi x86-specific?
> 
> Jan
> 

It's defined in xen/include/xen/irq.h (not in an x86-specific file), so I
hadn't assumed so. The check here is to avoid needing to allow access to
the MSI IRQs by number since they are dynamic and therefore meaningless in
a statically-defined policy.

>> +        /* TODO support for MSI here */
>> +        return 0;
>> +    } else {
>> +        rc = get_irq_sid(irq, &sid, &ad);
>> +    }
>>      if ( rc )
>>          return rc;
>>  
>> -    if ( access )
>> -        rc = avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, 
>> -                            RESOURCE__USE, &ad);
>> +    rc = avc_has_perm(ssec->sid, sid, SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, &ad);
>>      return rc;
>>  }
> 
> 
> 


-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:32:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:32:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqkJ-0005oG-9G; Tue, 20 Nov 2012 16:32:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TaqkH-0005nz-Tp
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:32:22 +0000
Received: from [85.158.139.83:64347] by server-14.bemta-5.messagelabs.com id
	C2/63-21768-390BBA05; Tue, 20 Nov 2012 16:32:19 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353429137!19886081!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25635 invoked from network); 20 Nov 2012 16:32:17 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-8.tower-182.messagelabs.com with SMTP;
	20 Nov 2012 16:32:17 -0000
X-TM-IMSS-Message-ID: <08b7576000004e0d@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 08b7576000004e0d ;
	Mon, 19 Nov 2012 09:57:10 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJErYQD022254; 
	Mon, 19 Nov 2012 09:53:35 -0500
Message-ID: <50AA47EE.907@tycho.nsa.gov>
Date: Mon, 19 Nov 2012 09:53:34 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-4-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA031802000078000A9935@nat28.tlf.novell.com>
In-Reply-To: <50AA031802000078000A9935@nat28.tlf.novell.com>
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 03/19] arch/x86: add distinct XSM hooks for
	map/unmap
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/19/2012 03:59 AM, Jan Beulich wrote:
>>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>> -static int flask_irq_permission (struct domain *d, int irq, uint8_t access)
>> +static int flask_unmap_domain_pirq (struct domain *d, int irq)
>>  {
>> -    u32 perm;
>> -    u32 rsid;
>> +    u32 sid;
>>      int rc = -EPERM;
>>  
>> -    struct domain_security_struct *ssec, *tsec;
>> +    struct domain_security_struct *ssec;
>>      struct avc_audit_data ad;
>>  
>> -    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
>> -                         resource_to_perm(access));
>> -
>> +    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
>>      if ( rc )
>>          return rc;
>>  
>> -    if ( access )
>> -        perm = RESOURCE__ADD_IRQ;
>> -    else
>> -        perm = RESOURCE__REMOVE_IRQ;
>> -
>>      ssec = current->domain->ssid;
>> -    tsec = d->ssid;
>>  
>> -    rc = get_irq_sid(irq, &rsid, &ad);
>> -    if ( rc )
>> -        return rc;
>> -
>> -    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
>> +    if ( irq >= nr_irqs_gsi ) {
> 
> Isn't the use of nr_irqs_gsi x86-specific?
> 
> Jan
> 

It's defined in xen/include/xen/irq.h (not in an x86-specific file), so I
hadn't assumed so. The check here is to avoid needing to allow access to
the MSI IRQs by number since they are dynamic and therefore meaningless in
a statically-defined policy.

>> +        /* TODO support for MSI here */
>> +        return 0;
>> +    } else {
>> +        rc = get_irq_sid(irq, &sid, &ad);
>> +    }
>>      if ( rc )
>>          return rc;
>>  
>> -    if ( access )
>> -        rc = avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, 
>> -                            RESOURCE__USE, &ad);
>> +    rc = avc_has_perm(ssec->sid, sid, SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, &ad);
>>      return rc;
>>  }
> 
> 
> 


-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:33:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taql7-0005tN-Pe; Tue, 20 Nov 2012 16:33:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Taql5-0005tA-5v
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:33:11 +0000
Received: from [85.158.139.83:27258] by server-14.bemta-5.messagelabs.com id
	8C/35-21768-6C0BBA05; Tue, 20 Nov 2012 16:33:10 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1353429187!23922216!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3NTEwMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27154 invoked from network); 20 Nov 2012 16:33:09 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-11.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 20 Nov 2012 16:33:09 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAKGX4i7023752
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 20 Nov 2012 16:33:05 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAKGX330021730
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 20 Nov 2012 16:33:04 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAKGX3He009369; Tue, 20 Nov 2012 10:33:03 -0600
MIME-Version: 1.0
Message-ID: <1bc66c5f-1740-411f-9be2-3de26372b469@default>
Date: Tue, 20 Nov 2012 08:33:00 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
	<1353062895.3499.205.camel@zakaz.uk.xensource.com>
	<ea33a942-7e63-4339-85c6-35935ae5119b@default>
	<50AB4A8602000078000A9E10@nat28.tlf.novell.com>
	<1353406581.13542.13.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353406581.13542.13.camel@zakaz.uk.xensource.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: xen-devel@lists.xen.org, "Keir \(Xen.org\)" <keir@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>, "Tim \(Xen.org\)" <tim@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> 
> On Tue, 2012-11-20 at 08:16 +0000, Jan Beulich wrote:
> > >>> On 19.11.12 at 21:53, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> > >>  From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> > >> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
> > > existing) hypercall
> > >
> > > Hi Ian --
> > >
> > >> On Thu, 2012-11-15 at 19:15 +0000, Dan Magenheimer wrote:
> > >> > > From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> > >> > > Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
> > > existing) hypercall
> > >> > >
> > >> > > On Wed, 2012-11-14 at 23:55 +0000, Dan Magenheimer wrote:
> > >> > >
> > >> > > How does this interact with the feature which lets you create PV guests
> > >> > > using only superpages? I believe is something Oracle added and still
> > >> > > maintains (Dave added to the CC).
> > >> >
> > >> > The claim mechanism will not benefit PV superpages.  IIUC, the
> > >> > design of the PV superpages will cause a domain launch to fail
> > >> > if it requests 10000 superpages but Xen can only successfully
> > >> > allocate 9999.  That's already very fragile.  Since the only
> > >> > way currently to find out if there are 10000 superpages available
> > >> > is to start allocating them, claim can't really help.
> > >>
> > >> Well, you could always account the number of free superpages in the
> > >> system, which would allow you to cover this case too.
> > >
> > > Because of the nature of the buddy allocator (i.e. 4MB chunks are
> > > kept separately from 2MB chunks even though a 4MB page contains
> > > two 2MB pages), I don't think this is trivial.
> >
> > This ought to be as simple as adding respective accounting
> > when
> > - splitting a chunk in alloc_heap_pages(), crossing the super page
> >   size boundary, and
> > - merging chunks in free_heap_pages(), crossing the super page
> >   size boundary.
> 
> That was my first thought too.

Hi Ian and Jan --

I agree it's possible, just saying it's not trivial... one has to
account not only for superpages system-wide (which isn't currently
done) but a mix of unclaimed superpages and unclaimed order==0 pages
per-domain.  Especially since that would improve launch of only a small
and shrinking class of domains (PV && superpages=1 && mem="huge"),
can we please consider it a possible future enhancement, not a showstopper?
The proposed claim hypercall doesn't _break_ PV-superpage domains,
it just doesn't pre-fail domain launch when there is sufficient physical
RAM but insufficient quantity of superpages.  And the toolstack doesn't
need to special-case... always doing a claim first is worthwhile because
it still pre-fails the case where there is insufficient physical RAM.

(I'd ask Konrad or Kurt to chime in here, but I know both are
away from the office due to the holidays... and I should be too.)

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:33:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taql7-0005tN-Pe; Tue, 20 Nov 2012 16:33:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Taql5-0005tA-5v
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:33:11 +0000
Received: from [85.158.139.83:27258] by server-14.bemta-5.messagelabs.com id
	8C/35-21768-6C0BBA05; Tue, 20 Nov 2012 16:33:10 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1353429187!23922216!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3NTEwMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27154 invoked from network); 20 Nov 2012 16:33:09 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-11.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 20 Nov 2012 16:33:09 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAKGX4i7023752
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 20 Nov 2012 16:33:05 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAKGX330021730
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 20 Nov 2012 16:33:04 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAKGX3He009369; Tue, 20 Nov 2012 10:33:03 -0600
MIME-Version: 1.0
Message-ID: <1bc66c5f-1740-411f-9be2-3de26372b469@default>
Date: Tue, 20 Nov 2012 08:33:00 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
	<1353062895.3499.205.camel@zakaz.uk.xensource.com>
	<ea33a942-7e63-4339-85c6-35935ae5119b@default>
	<50AB4A8602000078000A9E10@nat28.tlf.novell.com>
	<1353406581.13542.13.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353406581.13542.13.camel@zakaz.uk.xensource.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: xen-devel@lists.xen.org, "Keir \(Xen.org\)" <keir@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>, "Tim \(Xen.org\)" <tim@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> 
> On Tue, 2012-11-20 at 08:16 +0000, Jan Beulich wrote:
> > >>> On 19.11.12 at 21:53, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> > >>  From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> > >> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
> > > existing) hypercall
> > >
> > > Hi Ian --
> > >
> > >> On Thu, 2012-11-15 at 19:15 +0000, Dan Magenheimer wrote:
> > >> > > From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> > >> > > Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
> > > existing) hypercall
> > >> > >
> > >> > > On Wed, 2012-11-14 at 23:55 +0000, Dan Magenheimer wrote:
> > >> > >
> > >> > > How does this interact with the feature which lets you create PV guests
> > >> > > using only superpages? I believe is something Oracle added and still
> > >> > > maintains (Dave added to the CC).
> > >> >
> > >> > The claim mechanism will not benefit PV superpages.  IIUC, the
> > >> > design of the PV superpages will cause a domain launch to fail
> > >> > if it requests 10000 superpages but Xen can only successfully
> > >> > allocate 9999.  That's already very fragile.  Since the only
> > >> > way currently to find out if there are 10000 superpages available
> > >> > is to start allocating them, claim can't really help.
> > >>
> > >> Well, you could always account the number of free superpages in the
> > >> system, which would allow you to cover this case too.
> > >
> > > Because of the nature of the buddy allocator (i.e. 4MB chunks are
> > > kept separately from 2MB chunks even though a 4MB page contains
> > > two 2MB pages), I don't think this is trivial.
> >
> > This ought to be as simple as adding respective accounting
> > when
> > - splitting a chunk in alloc_heap_pages(), crossing the super page
> >   size boundary, and
> > - merging chunks in free_heap_pages(), crossing the super page
> >   size boundary.
> 
> That was my first thought too.

Hi Ian and Jan --

I agree it's possible, just saying it's not trivial... one has to
account not only for superpages system-wide (which isn't currently
done) but a mix of unclaimed superpages and unclaimed order==0 pages
per-domain.  Especially since that would improve launch of only a small
and shrinking class of domains (PV && superpages=1 && mem="huge"),
can we please consider it a possible future enhancement, not a showstopper?
The proposed claim hypercall doesn't _break_ PV-superpage domains,
it just doesn't pre-fail domain launch when there is sufficient physical
RAM but insufficient quantity of superpages.  And the toolstack doesn't
need to special-case... always doing a claim first is worthwhile because
it still pre-fails the case where there is insufficient physical RAM.

(I'd ask Konrad or Kurt to chime in here, but I know both are
away from the office due to the holidays... and I should be too.)

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:38:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:38:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taqq8-00069C-O3; Tue, 20 Nov 2012 16:38:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Taqq7-000696-Ky
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:38:23 +0000
Received: from [85.158.143.99:23331] by server-2.bemta-4.messagelabs.com id
	EB/0C-28922-FF1BBA05; Tue, 20 Nov 2012 16:38:23 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1353429502!30719194!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16512 invoked from network); 20 Nov 2012 16:38:22 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-216.messagelabs.com with SMTP;
	20 Nov 2012 16:38:22 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 16:38:22 +0000
Message-Id: <50ABC04502000078000AA1CF@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 16:39:17 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-4-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA031802000078000A9935@nat28.tlf.novell.com>
	<50AA47EE.907@tycho.nsa.gov>
In-Reply-To: <50AA47EE.907@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 03/19] arch/x86: add distinct XSM hooks for
 map/unmap
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 19.11.12 at 15:53, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> On 11/19/2012 03:59 AM, Jan Beulich wrote:
>>>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>>> -static int flask_irq_permission (struct domain *d, int irq, uint8_t access)
>>> +static int flask_unmap_domain_pirq (struct domain *d, int irq)
>>>  {
>>> -    u32 perm;
>>> -    u32 rsid;
>>> +    u32 sid;
>>>      int rc = -EPERM;
>>>  
>>> -    struct domain_security_struct *ssec, *tsec;
>>> +    struct domain_security_struct *ssec;
>>>      struct avc_audit_data ad;
>>>  
>>> -    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
>>> -                         resource_to_perm(access));
>>> -
>>> +    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, 
> RESOURCE__REMOVE);
>>>      if ( rc )
>>>          return rc;
>>>  
>>> -    if ( access )
>>> -        perm = RESOURCE__ADD_IRQ;
>>> -    else
>>> -        perm = RESOURCE__REMOVE_IRQ;
>>> -
>>>      ssec = current->domain->ssid;
>>> -    tsec = d->ssid;
>>>  
>>> -    rc = get_irq_sid(irq, &rsid, &ad);
>>> -    if ( rc )
>>> -        return rc;
>>> -
>>> -    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
>>> +    if ( irq >= nr_irqs_gsi ) {
>> 
>> Isn't the use of nr_irqs_gsi x86-specific?
> 
> It's defined in xen/include/xen/irq.h (not in an x86-specific file), so I
> hadn't assumed so. The check here is to avoid needing to allow access to
> the MSI IRQs by number since they are dynamic and therefore meaningless in
> a statically-defined policy.

Indeed, there are other uses in common code. We may need to
do something about this for ARM.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:38:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:38:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taqq8-00069C-O3; Tue, 20 Nov 2012 16:38:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Taqq7-000696-Ky
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:38:23 +0000
Received: from [85.158.143.99:23331] by server-2.bemta-4.messagelabs.com id
	EB/0C-28922-FF1BBA05; Tue, 20 Nov 2012 16:38:23 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1353429502!30719194!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16512 invoked from network); 20 Nov 2012 16:38:22 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-216.messagelabs.com with SMTP;
	20 Nov 2012 16:38:22 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 16:38:22 +0000
Message-Id: <50ABC04502000078000AA1CF@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 16:39:17 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-4-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA031802000078000A9935@nat28.tlf.novell.com>
	<50AA47EE.907@tycho.nsa.gov>
In-Reply-To: <50AA47EE.907@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 03/19] arch/x86: add distinct XSM hooks for
 map/unmap
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 19.11.12 at 15:53, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> On 11/19/2012 03:59 AM, Jan Beulich wrote:
>>>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>>> -static int flask_irq_permission (struct domain *d, int irq, uint8_t access)
>>> +static int flask_unmap_domain_pirq (struct domain *d, int irq)
>>>  {
>>> -    u32 perm;
>>> -    u32 rsid;
>>> +    u32 sid;
>>>      int rc = -EPERM;
>>>  
>>> -    struct domain_security_struct *ssec, *tsec;
>>> +    struct domain_security_struct *ssec;
>>>      struct avc_audit_data ad;
>>>  
>>> -    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
>>> -                         resource_to_perm(access));
>>> -
>>> +    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, 
> RESOURCE__REMOVE);
>>>      if ( rc )
>>>          return rc;
>>>  
>>> -    if ( access )
>>> -        perm = RESOURCE__ADD_IRQ;
>>> -    else
>>> -        perm = RESOURCE__REMOVE_IRQ;
>>> -
>>>      ssec = current->domain->ssid;
>>> -    tsec = d->ssid;
>>>  
>>> -    rc = get_irq_sid(irq, &rsid, &ad);
>>> -    if ( rc )
>>> -        return rc;
>>> -
>>> -    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
>>> +    if ( irq >= nr_irqs_gsi ) {
>> 
>> Isn't the use of nr_irqs_gsi x86-specific?
> 
> It's defined in xen/include/xen/irq.h (not in an x86-specific file), so I
> hadn't assumed so. The check here is to avoid needing to allow access to
> the MSI IRQs by number since they are dynamic and therefore meaningless in
> a statically-defined policy.

Indeed, there are other uses in common code. We may need to
do something about this for ARM.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:39:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:39:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taqqm-0006CC-62; Tue, 20 Nov 2012 16:39:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1Taqqk-0006C1-3M
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:39:02 +0000
Received: from [85.158.139.211:20988] by server-4.bemta-5.messagelabs.com id
	60/48-15011-522BBA05; Tue, 20 Nov 2012 16:39:01 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-206.messagelabs.com!1353429539!20941584!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2001 invoked from network); 20 Nov 2012 16:39:00 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-11.tower-206.messagelabs.com with SMTP;
	20 Nov 2012 16:39:00 -0000
X-TM-IMSS-Message-ID: <9d59dcd6000c03cc@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9d59dcd6000c03cc ;
	Tue, 20 Nov 2012 11:38:24 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKGcv8a007239; 
	Tue, 20 Nov 2012 11:38:57 -0500
Message-ID: <50ABB221.1000501@tycho.nsa.gov>
Date: Tue, 20 Nov 2012 11:38:57 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-2-git-send-email-dgdegra@tycho.nsa.gov>
	<1353321726.18229.32.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353321726.18229.32.camel@zakaz.uk.xensource.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 01/19] libxl: introduce XSM relabel on build
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/19/2012 05:42 AM, Ian Campbell wrote:
> On Fri, 2012-11-16 at 18:28 +0000, Daniel De Graaf wrote:
>> Allow a domain to be built under one security label and run using a
>> different label. This can be used to prevent the domain builder or
>> control domain from having the ability to access a guest domain's memory
>> via map_foreign_range except during the build process where this is
>> required.
>>
>> Note: this does not provide complete protection from a malicious dom0;
>> mappings created during the build process may persist after the relabel,
>> and could be used to indirectly access the guest's memory.
>>
>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
>> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>> Cc: Ian Campbell <ian.campbell@citrix.com>
>> ---
>>  tools/libxc/xc_flask.c      | 10 ++++++++++
>>  tools/libxc/xenctrl.h       |  1 +
>>  tools/libxl/libxl_create.c  |  4 ++++
>>  tools/libxl/libxl_types.idl |  1 +
>>  tools/libxl/xl_cmdimpl.c    | 20 +++++++++++++++++++-
> 
>    docs/man... please

The following will be included in the next version:

--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -270,6 +270,15 @@ UUID will be generated.
 
 Assign an XSM security label to this domain.
 
+=item B<init_seclabel="LABEL">
+
+Specify an XSM security label used for this domain temporarily during
+its build. The domain's XSM label will be changed to the execution
+seclabel (specified by "seclabel") once the build is complete, prior to
+unpausing the domain. With a properly constructed security policy (such
+as nomigrate_t in the example policy), this can be used to build a
+domain whose memory is not accessible to the toolstack domain.
+
 =item B<nomigrate=BOOLEAN>
 
>> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
>> index 7eac4a8..93524f0 100644
>> --- a/tools/libxl/libxl_types.idl
>> +++ b/tools/libxl/libxl_types.idl
>> @@ -268,6 +268,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
>>      ("video_memkb",     MemKB),
>>      ("shadow_memkb",    MemKB),
>>      ("rtc_timeoffset",  uint32),
>> +    ("exec_ssidref",    uint32),
> 
> What is the significance of the "exec_" bit of the name?

This ssidref is the one used during execution of the domain (as opposed to
during build). I chose to add this rather than adding a field called
init_ssidref because the new functionality is the ability to change the label
prior to execution: the existing ssidref is already used at creation.

>>      ("localtime",       libxl_defbool),
>>      ("disable_migrate", libxl_defbool),
>>      ("cpuid",           libxl_cpuid_policy_list),
> 
> Ian.
> 

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:39:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:39:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taqqm-0006CC-62; Tue, 20 Nov 2012 16:39:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1Taqqk-0006C1-3M
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:39:02 +0000
Received: from [85.158.139.211:20988] by server-4.bemta-5.messagelabs.com id
	60/48-15011-522BBA05; Tue, 20 Nov 2012 16:39:01 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-206.messagelabs.com!1353429539!20941584!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2001 invoked from network); 20 Nov 2012 16:39:00 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-11.tower-206.messagelabs.com with SMTP;
	20 Nov 2012 16:39:00 -0000
X-TM-IMSS-Message-ID: <9d59dcd6000c03cc@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9d59dcd6000c03cc ;
	Tue, 20 Nov 2012 11:38:24 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKGcv8a007239; 
	Tue, 20 Nov 2012 11:38:57 -0500
Message-ID: <50ABB221.1000501@tycho.nsa.gov>
Date: Tue, 20 Nov 2012 11:38:57 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-2-git-send-email-dgdegra@tycho.nsa.gov>
	<1353321726.18229.32.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353321726.18229.32.camel@zakaz.uk.xensource.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 01/19] libxl: introduce XSM relabel on build
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/19/2012 05:42 AM, Ian Campbell wrote:
> On Fri, 2012-11-16 at 18:28 +0000, Daniel De Graaf wrote:
>> Allow a domain to be built under one security label and run using a
>> different label. This can be used to prevent the domain builder or
>> control domain from having the ability to access a guest domain's memory
>> via map_foreign_range except during the build process where this is
>> required.
>>
>> Note: this does not provide complete protection from a malicious dom0;
>> mappings created during the build process may persist after the relabel,
>> and could be used to indirectly access the guest's memory.
>>
>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
>> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>> Cc: Ian Campbell <ian.campbell@citrix.com>
>> ---
>>  tools/libxc/xc_flask.c      | 10 ++++++++++
>>  tools/libxc/xenctrl.h       |  1 +
>>  tools/libxl/libxl_create.c  |  4 ++++
>>  tools/libxl/libxl_types.idl |  1 +
>>  tools/libxl/xl_cmdimpl.c    | 20 +++++++++++++++++++-
> 
>    docs/man... please

The following will be included in the next version:

--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -270,6 +270,15 @@ UUID will be generated.
 
 Assign an XSM security label to this domain.
 
+=item B<init_seclabel="LABEL">
+
+Specify an XSM security label used for this domain temporarily during
+its build. The domain's XSM label will be changed to the execution
+seclabel (specified by "seclabel") once the build is complete, prior to
+unpausing the domain. With a properly constructed security policy (such
+as nomigrate_t in the example policy), this can be used to build a
+domain whose memory is not accessible to the toolstack domain.
+
 =item B<nomigrate=BOOLEAN>
 
>> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
>> index 7eac4a8..93524f0 100644
>> --- a/tools/libxl/libxl_types.idl
>> +++ b/tools/libxl/libxl_types.idl
>> @@ -268,6 +268,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
>>      ("video_memkb",     MemKB),
>>      ("shadow_memkb",    MemKB),
>>      ("rtc_timeoffset",  uint32),
>> +    ("exec_ssidref",    uint32),
> 
> What is the significance of the "exec_" bit of the name?

This ssidref is the one used during execution of the domain (as opposed to
during build). I chose to add this rather than adding a field called
init_ssidref because the new functionality is the ability to change the label
prior to execution: the existing ssidref is already used at creation.

>>      ("localtime",       libxl_defbool),
>>      ("disable_migrate", libxl_defbool),
>>      ("cpuid",           libxl_cpuid_policy_list),
> 
> Ian.
> 

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:39:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:39:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqrT-0006IR-Sj; Tue, 20 Nov 2012 16:39:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TaqrS-0006IE-Uz
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:39:47 +0000
Received: from [85.158.143.99:29426] by server-3.bemta-4.messagelabs.com id
	84/1C-06841-252BBA05; Tue, 20 Nov 2012 16:39:46 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1353429585!28025546!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17241 invoked from network); 20 Nov 2012 16:39:45 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-216.messagelabs.com with SMTP;
	20 Nov 2012 16:39:45 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 16:39:45 +0000
Message-Id: <50ABC09802000078000AA1D2@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 16:40:40 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-10-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA08D102000078000A9957@nat28.tlf.novell.com>
	<50AA4E3F.4090907@tycho.nsa.gov>
In-Reply-To: <50AA4E3F.4090907@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 09/19] xen: lock target domain in do_domctl
 common code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 19.11.12 at 16:20, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> On 11/19/2012 04:24 AM, Jan Beulich wrote:
>>>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>>> @@ -458,6 +443,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
> u_domctl)
>>>          if ( IS_ERR(d) )
>>>          {
>>>              ret = PTR_ERR(d);
>>> +            d = NULL;
>> 
>> Considering that in the common code you already set d to NULL,
>> is there a specific reason why you do so again here ...
>> 
>>>              break;
>>>          }
>>>  
>>> @@ -469,39 +455,28 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
> u_domctl)
>>>          op->domain = d->domain_id;
>>>          if ( copy_to_guest(u_domctl, op, 1) )
>>>              ret = -EFAULT;
>>> +        d = NULL;
>> 
>> ... and here?
>> 
>> Same further down for XEN_DOMCTL_getdomaininfo.
>> 
>> Jan
>> 
>>>      }
>>>      break;
>>>  
>> 
>> 
>> 
> 
> This avoids unlocking the domain when it hasn't been locked (at the
> end of the function at domctl_out_unlock) or trying to unlock a
> ERR_PTR value.

Sorry, this doesn't explain why d needs to be set to NULL twice.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:39:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:39:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqrT-0006IR-Sj; Tue, 20 Nov 2012 16:39:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TaqrS-0006IE-Uz
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:39:47 +0000
Received: from [85.158.143.99:29426] by server-3.bemta-4.messagelabs.com id
	84/1C-06841-252BBA05; Tue, 20 Nov 2012 16:39:46 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1353429585!28025546!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17241 invoked from network); 20 Nov 2012 16:39:45 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-216.messagelabs.com with SMTP;
	20 Nov 2012 16:39:45 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 16:39:45 +0000
Message-Id: <50ABC09802000078000AA1D2@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 16:40:40 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-10-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA08D102000078000A9957@nat28.tlf.novell.com>
	<50AA4E3F.4090907@tycho.nsa.gov>
In-Reply-To: <50AA4E3F.4090907@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 09/19] xen: lock target domain in do_domctl
 common code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 19.11.12 at 16:20, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> On 11/19/2012 04:24 AM, Jan Beulich wrote:
>>>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>>> @@ -458,6 +443,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
> u_domctl)
>>>          if ( IS_ERR(d) )
>>>          {
>>>              ret = PTR_ERR(d);
>>> +            d = NULL;
>> 
>> Considering that in the common code you already set d to NULL,
>> is there a specific reason why you do so again here ...
>> 
>>>              break;
>>>          }
>>>  
>>> @@ -469,39 +455,28 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
> u_domctl)
>>>          op->domain = d->domain_id;
>>>          if ( copy_to_guest(u_domctl, op, 1) )
>>>              ret = -EFAULT;
>>> +        d = NULL;
>> 
>> ... and here?
>> 
>> Same further down for XEN_DOMCTL_getdomaininfo.
>> 
>> Jan
>> 
>>>      }
>>>      break;
>>>  
>> 
>> 
>> 
> 
> This avoids unlocking the domain when it hasn't been locked (at the
> end of the function at domctl_out_unlock) or trying to unlock a
> ERR_PTR value.

Sorry, this doesn't explain why d needs to be set to NULL twice.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:41:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:41:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taqsz-0006UX-Dk; Tue, 20 Nov 2012 16:41:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ebiederm@xmission.com>) id 1Taqsx-0006UL-TW
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:41:20 +0000
Received: from [85.158.139.211:37243] by server-5.bemta-5.messagelabs.com id
	54/CC-11353-FA2BBA05; Tue, 20 Nov 2012 16:41:19 +0000
X-Env-Sender: ebiederm@xmission.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353429672!20870612!1
X-Originating-IP: [166.70.13.233]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11769 invoked from network); 20 Nov 2012 16:41:13 -0000
Received: from out03.mta.xmission.com (HELO out03.mta.xmission.com)
	(166.70.13.233) by server-12.tower-206.messagelabs.com with SMTP;
	20 Nov 2012 16:41:13 -0000
Received: from in02.mta.xmission.com ([166.70.13.52])
	by out03.mta.xmission.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.76) (envelope-from <ebiederm@xmission.com>)
	id 1Taqsl-0003Ug-91; Tue, 20 Nov 2012 09:41:07 -0700
Received: from c-98-207-153-68.hsd1.ca.comcast.net ([98.207.153.68]
	helo=eric-ThinkPad-X220.xmission.com)
	by in02.mta.xmission.com with esmtpsa
	(TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76)
	(envelope-from <ebiederm@xmission.com>)
	id 1TaqsU-0006PF-85; Tue, 20 Nov 2012 09:41:07 -0700
From: ebiederm@xmission.com (Eric W. Biederman)
To: Daniel Kiper <daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
Date: Tue, 20 Nov 2012 08:40:39 -0800
In-Reply-To: <1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	(Daniel Kiper's message of "Tue, 20 Nov 2012 16:04:43 +0100")
Message-ID: <87lidwtego.fsf@xmission.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)
MIME-Version: 1.0
X-XM-AID: U2FsdGVkX1+ST0kVCjkS5E3qgXUWsB2mRzh+wQAr9lg=
X-SA-Exim-Connect-IP: 98.207.153.68
X-SA-Exim-Mail-From: ebiederm@xmission.com
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sa06.xmission.com
X-Spam-Level: 
X-Spam-Status: No, score=-4.0 required=8.0 tests=ALL_TRUSTED,BAYES_00,
	DCC_CHECK_NEGATIVE, T_TM2_M_HEADER_IN_MSG,
	T_TooManySym_01 autolearn=disabled version=3.3.2
X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
	*  0.0 T_TM2_M_HEADER_IN_MSG BODY: T_TM2_M_HEADER_IN_MSG
	* -3.0 BAYES_00 BODY: Bayes spam probability is 0 to 1%
	*      [score: 0.0000]
	* -0.0 DCC_CHECK_NEGATIVE Not listed in DCC
	*      [sa06 1397; Body=1 Fuz1=1 Fuz2=1]
	*  0.0 T_TooManySym_01 4+ unique symbols in subject
X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 
X-Spam-Combo: ;Daniel Kiper <daniel.kiper@oracle.com>
X-Spam-Relay-Country: 
X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 03:05:19 +0000)
X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com)
Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	jbeulich@suse.com, hpa@zytor.com, tglx@linutronix.de
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Daniel Kiper <daniel.kiper@oracle.com> writes:

> Some kexec/kdump implementations (e.g. Xen PVOPS) could not use default
> functions or require some changes in behavior of kexec/kdump generic code.
> To cope with that problem kexec_ops struct was introduced. It allows
> a developer to replace all or some functions and control some
> functionality of kexec/kdump generic code.
>
> Default behavior of kexec/kdump generic code is not changed.

Ick.

> v2 - suggestions/fixes:
>    - add comment for kexec_ops.crash_alloc_temp_store member
>      (suggested by Konrad Rzeszutek Wilk),
>    - simplify kexec_ops usage
>      (suggested by Konrad Rzeszutek Wilk).
>
> Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
> ---
>  include/linux/kexec.h |   26 ++++++++++
>  kernel/kexec.c        |  131 +++++++++++++++++++++++++++++++++++++------------
>  2 files changed, 125 insertions(+), 32 deletions(-)
>
> diff --git a/include/linux/kexec.h b/include/linux/kexec.h
> index d0b8458..c8d0b35 100644
> --- a/include/linux/kexec.h
> +++ b/include/linux/kexec.h
> @@ -116,7 +116,33 @@ struct kimage {
>  #endif
>  };
>  
> +struct kexec_ops {
> +	/*
> +	 * Some kdump implementations (e.g. Xen PVOPS dom0) could not access
> +	 * directly crash kernel memory area. In this situation they must
> +	 * allocate memory outside of it and later move contents from temporary
> +	 * storage to final resting places (usualy done by relocate_kernel()).
> +	 * Such behavior could be enforced by setting
> +	 * crash_alloc_temp_store member to true.
> +	 */

Why in the world would Xen not be able to access crash kernel memory?
As currently defined it is normal memory that the kernel chooses not to
use.

If relocate kernel can access that memory you definitely can access the
memory so the comment does not make any sense.

> +	bool crash_alloc_temp_store;
> +	struct page *(*kimage_alloc_pages)(gfp_t gfp_mask,
> +						unsigned int order,
> +						unsigned long limit);
> +	void (*kimage_free_pages)(struct page *page);
> +	unsigned long (*page_to_pfn)(struct page *page);
> +	struct page *(*pfn_to_page)(unsigned long pfn);
> +	unsigned long (*virt_to_phys)(volatile void *address);
> +	void *(*phys_to_virt)(unsigned long address);
> +	int (*machine_kexec_prepare)(struct kimage *image);
> +	int (*machine_kexec_load)(struct kimage *image);
> +	void (*machine_kexec_cleanup)(struct kimage *image);
> +	void (*machine_kexec_unload)(struct kimage *image);
> +	void (*machine_kexec_shutdown)(void);
> +	void (*machine_kexec)(struct kimage *image);
> +};

Ugh.  This is a nasty abstraction.

You are mixing and matching a bunch of things together here.

If you need to override machine_kexec_xxx please do that on a per
architecture basis.

Special case overrides of page_to_pfn, pfn_to_page, virt_to_phys,
phys_to_virt, and friends seem completely inappropriate.

There may be a point to all of these but you are mixing and matching
things badly.


Eric

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:41:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:41:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taqsz-0006UX-Dk; Tue, 20 Nov 2012 16:41:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ebiederm@xmission.com>) id 1Taqsx-0006UL-TW
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:41:20 +0000
Received: from [85.158.139.211:37243] by server-5.bemta-5.messagelabs.com id
	54/CC-11353-FA2BBA05; Tue, 20 Nov 2012 16:41:19 +0000
X-Env-Sender: ebiederm@xmission.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353429672!20870612!1
X-Originating-IP: [166.70.13.233]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11769 invoked from network); 20 Nov 2012 16:41:13 -0000
Received: from out03.mta.xmission.com (HELO out03.mta.xmission.com)
	(166.70.13.233) by server-12.tower-206.messagelabs.com with SMTP;
	20 Nov 2012 16:41:13 -0000
Received: from in02.mta.xmission.com ([166.70.13.52])
	by out03.mta.xmission.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.76) (envelope-from <ebiederm@xmission.com>)
	id 1Taqsl-0003Ug-91; Tue, 20 Nov 2012 09:41:07 -0700
Received: from c-98-207-153-68.hsd1.ca.comcast.net ([98.207.153.68]
	helo=eric-ThinkPad-X220.xmission.com)
	by in02.mta.xmission.com with esmtpsa
	(TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76)
	(envelope-from <ebiederm@xmission.com>)
	id 1TaqsU-0006PF-85; Tue, 20 Nov 2012 09:41:07 -0700
From: ebiederm@xmission.com (Eric W. Biederman)
To: Daniel Kiper <daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
Date: Tue, 20 Nov 2012 08:40:39 -0800
In-Reply-To: <1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	(Daniel Kiper's message of "Tue, 20 Nov 2012 16:04:43 +0100")
Message-ID: <87lidwtego.fsf@xmission.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)
MIME-Version: 1.0
X-XM-AID: U2FsdGVkX1+ST0kVCjkS5E3qgXUWsB2mRzh+wQAr9lg=
X-SA-Exim-Connect-IP: 98.207.153.68
X-SA-Exim-Mail-From: ebiederm@xmission.com
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sa06.xmission.com
X-Spam-Level: 
X-Spam-Status: No, score=-4.0 required=8.0 tests=ALL_TRUSTED,BAYES_00,
	DCC_CHECK_NEGATIVE, T_TM2_M_HEADER_IN_MSG,
	T_TooManySym_01 autolearn=disabled version=3.3.2
X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
	*  0.0 T_TM2_M_HEADER_IN_MSG BODY: T_TM2_M_HEADER_IN_MSG
	* -3.0 BAYES_00 BODY: Bayes spam probability is 0 to 1%
	*      [score: 0.0000]
	* -0.0 DCC_CHECK_NEGATIVE Not listed in DCC
	*      [sa06 1397; Body=1 Fuz1=1 Fuz2=1]
	*  0.0 T_TooManySym_01 4+ unique symbols in subject
X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 
X-Spam-Combo: ;Daniel Kiper <daniel.kiper@oracle.com>
X-Spam-Relay-Country: 
X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 03:05:19 +0000)
X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com)
Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	jbeulich@suse.com, hpa@zytor.com, tglx@linutronix.de
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Daniel Kiper <daniel.kiper@oracle.com> writes:

> Some kexec/kdump implementations (e.g. Xen PVOPS) could not use default
> functions or require some changes in behavior of kexec/kdump generic code.
> To cope with that problem kexec_ops struct was introduced. It allows
> a developer to replace all or some functions and control some
> functionality of kexec/kdump generic code.
>
> Default behavior of kexec/kdump generic code is not changed.

Ick.

> v2 - suggestions/fixes:
>    - add comment for kexec_ops.crash_alloc_temp_store member
>      (suggested by Konrad Rzeszutek Wilk),
>    - simplify kexec_ops usage
>      (suggested by Konrad Rzeszutek Wilk).
>
> Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
> ---
>  include/linux/kexec.h |   26 ++++++++++
>  kernel/kexec.c        |  131 +++++++++++++++++++++++++++++++++++++------------
>  2 files changed, 125 insertions(+), 32 deletions(-)
>
> diff --git a/include/linux/kexec.h b/include/linux/kexec.h
> index d0b8458..c8d0b35 100644
> --- a/include/linux/kexec.h
> +++ b/include/linux/kexec.h
> @@ -116,7 +116,33 @@ struct kimage {
>  #endif
>  };
>  
> +struct kexec_ops {
> +	/*
> +	 * Some kdump implementations (e.g. Xen PVOPS dom0) could not access
> +	 * directly crash kernel memory area. In this situation they must
> +	 * allocate memory outside of it and later move contents from temporary
> +	 * storage to final resting places (usualy done by relocate_kernel()).
> +	 * Such behavior could be enforced by setting
> +	 * crash_alloc_temp_store member to true.
> +	 */

Why in the world would Xen not be able to access crash kernel memory?
As currently defined it is normal memory that the kernel chooses not to
use.

If relocate kernel can access that memory you definitely can access the
memory so the comment does not make any sense.

> +	bool crash_alloc_temp_store;
> +	struct page *(*kimage_alloc_pages)(gfp_t gfp_mask,
> +						unsigned int order,
> +						unsigned long limit);
> +	void (*kimage_free_pages)(struct page *page);
> +	unsigned long (*page_to_pfn)(struct page *page);
> +	struct page *(*pfn_to_page)(unsigned long pfn);
> +	unsigned long (*virt_to_phys)(volatile void *address);
> +	void *(*phys_to_virt)(unsigned long address);
> +	int (*machine_kexec_prepare)(struct kimage *image);
> +	int (*machine_kexec_load)(struct kimage *image);
> +	void (*machine_kexec_cleanup)(struct kimage *image);
> +	void (*machine_kexec_unload)(struct kimage *image);
> +	void (*machine_kexec_shutdown)(void);
> +	void (*machine_kexec)(struct kimage *image);
> +};

Ugh.  This is a nasty abstraction.

You are mixing and matching a bunch of things together here.

If you need to override machine_kexec_xxx please do that on a per
architecture basis.

Special case overrides of page_to_pfn, pfn_to_page, virt_to_phys,
phys_to_virt, and friends seem completely inappropriate.

There may be a point to all of these but you are mixing and matching
things badly.


Eric

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:44:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:44:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taqvy-0006kZ-6b; Tue, 20 Nov 2012 16:44:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1Taqvx-0006kQ-6j
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:44:25 +0000
Received: from [85.158.139.211:48974] by server-15.bemta-5.messagelabs.com id
	3A/D6-26920-863BBA05; Tue, 20 Nov 2012 16:44:24 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1353429860!20928081!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY3NTIx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31943 invoked from network); 20 Nov 2012 16:44:22 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-3.tower-206.messagelabs.com with SMTP;
	20 Nov 2012 16:44:22 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga102.jf.intel.com with ESMTP; 20 Nov 2012 08:43:40 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,286,1352102400"; d="scan'208";a="244898829"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by orsmga002.jf.intel.com with ESMTP; 20 Nov 2012 08:43:58 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 08:43:57 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 00:43:56 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, George Dunlap
	<george.dunlap@eu.citrix.com>
Thread-Topic: [PATCH V3] X86/vMCE: handle broken page with regard to migration
Thread-Index: AQHNxnb5gIBs/Elka0CkW2KriS9nNJfy7AHg
Date: Tue, 20 Nov 2012 16:43:55 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335393567@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
	<1353344256.18229.129.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353344256.18229.129.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell wrote:
> On Mon, 2012-11-19 at 15:29 +0000, George Dunlap wrote:
>> On 19/11/12 09:55, Ian Campbell wrote:
>>> If we get to this stage then haven't we either already sent
>>> something over the wire for this page or marked it as dirty when we
>>> tried and failed to send it? 
>>> 
>>> In the former case we don't care that the page is now broken on the
>>> source since the target has got a good pre-breakage copy.
>>> 
>>> In the latter case could we not set a flag at the same time as we
>>> mark the page dirty which means "go round at least one more time"?
>> 
>> Yeah -- on the last iteration, the VM itself has to be paused; if any
>> pages get broken after that, it doesn't really matter, does it? The
>> real thing is to have a consistent "snapshot" of behavior.
>> 
>> I guess the one potentially tricky case to worry about is whether to
>> deliver an MCE to the guest on restore.  Consider the following
>> scenario: 
>> 
>> - Page A is modified (and marked dirty)
>> - VM paused for last iteration
>> - Page breaks, is marked broken in the p2m
>> - Save code sends page A
>> 
>> In that case, the save code would send a "broken" page, and the
>> restore code would mark a page as broken, and we *would* want to
>> deliver an MCE on the far side.  But suppose the last two steps were
>> reversed: 
>> 
>> - Page A modified
>> - VM paused for last iteration
>> - Save code sends page A
>> - Page breaks, marked broken in the p2m
>> 
>> In that case, when the save code sends page A, it will send a good
>> page; there's no need to mark it broken, or to send the guest an MCE.
> 
> I guess you'd want to err on the side of stopping using a good page,
> as opposed to continuing to use a bad page? i.e. its better to take a
> spurious vMCE than to not take an actual one.
> 
> I'm not actually sure what a guest does with a vMCE, I guess it does
> some sort of memory exchange to give the bad page back to the h/v and
> get a good page in return? If the hypervisor thinks the old page is ok
> rather than bad I guess it'll just put it in the free list instead of
> the bad list?
> 

the broken page is h/w bad page, means its content corrupted and cannot be corrected by h/w circuit (say ECC).

For vmce and the broken page, guest and h/v are agnostic each other so I don't think h/v should have chance to do anything, except inject vMCE# to guest.
Guest handle vMCE# exactly same as native, like, to simply ignore vMCE, to kill process and isolate broken page if possible (in its own range), or kill guest itself if not possible, depending on what the error is.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:44:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:44:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Taqvy-0006kZ-6b; Tue, 20 Nov 2012 16:44:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1Taqvx-0006kQ-6j
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:44:25 +0000
Received: from [85.158.139.211:48974] by server-15.bemta-5.messagelabs.com id
	3A/D6-26920-863BBA05; Tue, 20 Nov 2012 16:44:24 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1353429860!20928081!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY3NTIx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31943 invoked from network); 20 Nov 2012 16:44:22 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-3.tower-206.messagelabs.com with SMTP;
	20 Nov 2012 16:44:22 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga102.jf.intel.com with ESMTP; 20 Nov 2012 08:43:40 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,286,1352102400"; d="scan'208";a="244898829"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by orsmga002.jf.intel.com with ESMTP; 20 Nov 2012 08:43:58 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 08:43:57 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 00:43:56 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, George Dunlap
	<george.dunlap@eu.citrix.com>
Thread-Topic: [PATCH V3] X86/vMCE: handle broken page with regard to migration
Thread-Index: AQHNxnb5gIBs/Elka0CkW2KriS9nNJfy7AHg
Date: Tue, 20 Nov 2012 16:43:55 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335393567@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
	<1353344256.18229.129.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353344256.18229.129.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell wrote:
> On Mon, 2012-11-19 at 15:29 +0000, George Dunlap wrote:
>> On 19/11/12 09:55, Ian Campbell wrote:
>>> If we get to this stage then haven't we either already sent
>>> something over the wire for this page or marked it as dirty when we
>>> tried and failed to send it? 
>>> 
>>> In the former case we don't care that the page is now broken on the
>>> source since the target has got a good pre-breakage copy.
>>> 
>>> In the latter case could we not set a flag at the same time as we
>>> mark the page dirty which means "go round at least one more time"?
>> 
>> Yeah -- on the last iteration, the VM itself has to be paused; if any
>> pages get broken after that, it doesn't really matter, does it? The
>> real thing is to have a consistent "snapshot" of behavior.
>> 
>> I guess the one potentially tricky case to worry about is whether to
>> deliver an MCE to the guest on restore.  Consider the following
>> scenario: 
>> 
>> - Page A is modified (and marked dirty)
>> - VM paused for last iteration
>> - Page breaks, is marked broken in the p2m
>> - Save code sends page A
>> 
>> In that case, the save code would send a "broken" page, and the
>> restore code would mark a page as broken, and we *would* want to
>> deliver an MCE on the far side.  But suppose the last two steps were
>> reversed: 
>> 
>> - Page A modified
>> - VM paused for last iteration
>> - Save code sends page A
>> - Page breaks, marked broken in the p2m
>> 
>> In that case, when the save code sends page A, it will send a good
>> page; there's no need to mark it broken, or to send the guest an MCE.
> 
> I guess you'd want to err on the side of stopping using a good page,
> as opposed to continuing to use a bad page? i.e. its better to take a
> spurious vMCE than to not take an actual one.
> 
> I'm not actually sure what a guest does with a vMCE, I guess it does
> some sort of memory exchange to give the bad page back to the h/v and
> get a good page in return? If the hypervisor thinks the old page is ok
> rather than bad I guess it'll just put it in the free list instead of
> the bad list?
> 

the broken page is h/w bad page, means its content corrupted and cannot be corrected by h/w circuit (say ECC).

For vmce and the broken page, guest and h/v are agnostic each other so I don't think h/v should have chance to do anything, except inject vMCE# to guest.
Guest handle vMCE# exactly same as native, like, to simply ignore vMCE, to kill process and isolate broken page if possible (in its own range), or kill guest itself if not possible, depending on what the error is.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:45:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:45:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqwZ-0006nk-LM; Tue, 20 Nov 2012 16:45:03 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TaqwX-0006nY-SF
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:45:02 +0000
Received: from [85.158.139.211:15251] by server-5.bemta-5.messagelabs.com id
	8D/C2-11353-D83BBA05; Tue, 20 Nov 2012 16:45:01 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353429899!20867367!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12883 invoked from network); 20 Nov 2012 16:45:00 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-15.tower-206.messagelabs.com with SMTP;
	20 Nov 2012 16:45:00 -0000
X-TM-IMSS-Message-ID: <9d5f5292000c060b@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9d5f5292000c060b ;
	Tue, 20 Nov 2012 11:44:22 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKGitLV008060; 
	Tue, 20 Nov 2012 11:44:55 -0500
Message-ID: <50ABB387.6090206@tycho.nsa.gov>
Date: Tue, 20 Nov 2012 11:44:55 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-10-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA08D102000078000A9957@nat28.tlf.novell.com>
	<50AA4E3F.4090907@tycho.nsa.gov>
	<50ABC09802000078000AA1D2@nat28.tlf.novell.com>
In-Reply-To: <50ABC09802000078000AA1D2@nat28.tlf.novell.com>
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 09/19] xen: lock target domain in do_domctl
	common code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/20/2012 11:40 AM, Jan Beulich wrote:
>>>> On 19.11.12 at 16:20, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>> On 11/19/2012 04:24 AM, Jan Beulich wrote:
>>>>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>>>> @@ -458,6 +443,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
>> u_domctl)
>>>>          if ( IS_ERR(d) )
>>>>          {
>>>>              ret = PTR_ERR(d);
>>>> +            d = NULL;
>>>
>>> Considering that in the common code you already set d to NULL,
>>> is there a specific reason why you do so again here ...
>>>
>>>>              break;
>>>>          }
>>>>  
>>>> @@ -469,39 +455,28 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
>> u_domctl)
>>>>          op->domain = d->domain_id;
>>>>          if ( copy_to_guest(u_domctl, op, 1) )
>>>>              ret = -EFAULT;
>>>> +        d = NULL;
>>>
>>> ... and here?
>>>
>>> Same further down for XEN_DOMCTL_getdomaininfo.
>>>
>>> Jan
>>>
>>>>      }
>>>>      break;
>>>>  
>>>
>>>
>>>
>>
>> This avoids unlocking the domain when it hasn't been locked (at the
>> end of the function at domctl_out_unlock) or trying to unlock a
>> ERR_PTR value.
> 
> Sorry, this doesn't explain why d needs to be set to NULL twice.
> 
> Jan
> 

Maybe I misunderstood you: do you think one of the two assignments is
redundant? They are not, since the above is immediately followed by a
break, which jumps out of the switch statement to domctl_lock_release(),
and does not hit the second assignment.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:45:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:45:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqwZ-0006nk-LM; Tue, 20 Nov 2012 16:45:03 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TaqwX-0006nY-SF
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:45:02 +0000
Received: from [85.158.139.211:15251] by server-5.bemta-5.messagelabs.com id
	8D/C2-11353-D83BBA05; Tue, 20 Nov 2012 16:45:01 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353429899!20867367!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12883 invoked from network); 20 Nov 2012 16:45:00 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-15.tower-206.messagelabs.com with SMTP;
	20 Nov 2012 16:45:00 -0000
X-TM-IMSS-Message-ID: <9d5f5292000c060b@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9d5f5292000c060b ;
	Tue, 20 Nov 2012 11:44:22 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKGitLV008060; 
	Tue, 20 Nov 2012 11:44:55 -0500
Message-ID: <50ABB387.6090206@tycho.nsa.gov>
Date: Tue, 20 Nov 2012 11:44:55 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-10-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA08D102000078000A9957@nat28.tlf.novell.com>
	<50AA4E3F.4090907@tycho.nsa.gov>
	<50ABC09802000078000AA1D2@nat28.tlf.novell.com>
In-Reply-To: <50ABC09802000078000AA1D2@nat28.tlf.novell.com>
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 09/19] xen: lock target domain in do_domctl
	common code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/20/2012 11:40 AM, Jan Beulich wrote:
>>>> On 19.11.12 at 16:20, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>> On 11/19/2012 04:24 AM, Jan Beulich wrote:
>>>>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>>>> @@ -458,6 +443,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
>> u_domctl)
>>>>          if ( IS_ERR(d) )
>>>>          {
>>>>              ret = PTR_ERR(d);
>>>> +            d = NULL;
>>>
>>> Considering that in the common code you already set d to NULL,
>>> is there a specific reason why you do so again here ...
>>>
>>>>              break;
>>>>          }
>>>>  
>>>> @@ -469,39 +455,28 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
>> u_domctl)
>>>>          op->domain = d->domain_id;
>>>>          if ( copy_to_guest(u_domctl, op, 1) )
>>>>              ret = -EFAULT;
>>>> +        d = NULL;
>>>
>>> ... and here?
>>>
>>> Same further down for XEN_DOMCTL_getdomaininfo.
>>>
>>> Jan
>>>
>>>>      }
>>>>      break;
>>>>  
>>>
>>>
>>>
>>
>> This avoids unlocking the domain when it hasn't been locked (at the
>> end of the function at domctl_out_unlock) or trying to unlock a
>> ERR_PTR value.
> 
> Sorry, this doesn't explain why d needs to be set to NULL twice.
> 
> Jan
> 

Maybe I misunderstood you: do you think one of the two assignments is
redundant? They are not, since the above is immediately followed by a
break, which jumps out of the switch statement to domctl_lock_release(),
and does not hit the second assignment.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:48:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:48:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqzI-0006zq-8q; Tue, 20 Nov 2012 16:47:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TaqzG-0006zh-Nc
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:47:50 +0000
Received: from [85.158.139.211:25210] by server-16.bemta-5.messagelabs.com id
	ED/84-04786-534BBA05; Tue, 20 Nov 2012 16:47:49 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-10.tower-206.messagelabs.com!1353430068!18919496!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28809 invoked from network); 20 Nov 2012 16:47:49 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-10.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 20 Nov 2012 16:47:49 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TaqzA-000DUu-Vr; Tue, 20 Nov 2012 16:47:44 +0000
Date: Tue, 20 Nov 2012 16:47:44 +0000
From: Tim Deegan <tim@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <20121120164744.GA46858@ocelot.phlegethon.org>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
	<1353062895.3499.205.camel@zakaz.uk.xensource.com>
	<ea33a942-7e63-4339-85c6-35935ae5119b@default>
	<50AB4A8602000078000A9E10@nat28.tlf.novell.com>
	<1353406581.13542.13.camel@zakaz.uk.xensource.com>
	<1bc66c5f-1740-411f-9be2-3de26372b469@default>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1bc66c5f-1740-411f-9be2-3de26372b469@default>
User-Agent: Mutt/1.4.2.1i
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 08:33 -0800 on 20 Nov (1353400380), Dan Magenheimer wrote:
> I agree it's possible, just saying it's not trivial... one has to
> account not only for superpages system-wide (which isn't currently
> done) but a mix of unclaimed superpages and unclaimed order==0 pages
> per-domain.  Especially since that would improve launch of only a small
> and shrinking class of domains (PV && superpages=1 && mem="huge"),
> can we please consider it a possible future enhancement, not a showstopper?

Please, no.  Either you need this benighted hypercall, or you don't.  
If you really need it, do it properly.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:48:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:48:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TaqzI-0006zq-8q; Tue, 20 Nov 2012 16:47:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TaqzG-0006zh-Nc
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:47:50 +0000
Received: from [85.158.139.211:25210] by server-16.bemta-5.messagelabs.com id
	ED/84-04786-534BBA05; Tue, 20 Nov 2012 16:47:49 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-10.tower-206.messagelabs.com!1353430068!18919496!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28809 invoked from network); 20 Nov 2012 16:47:49 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-10.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 20 Nov 2012 16:47:49 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TaqzA-000DUu-Vr; Tue, 20 Nov 2012 16:47:44 +0000
Date: Tue, 20 Nov 2012 16:47:44 +0000
From: Tim Deegan <tim@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <20121120164744.GA46858@ocelot.phlegethon.org>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
	<1353062895.3499.205.camel@zakaz.uk.xensource.com>
	<ea33a942-7e63-4339-85c6-35935ae5119b@default>
	<50AB4A8602000078000A9E10@nat28.tlf.novell.com>
	<1353406581.13542.13.camel@zakaz.uk.xensource.com>
	<1bc66c5f-1740-411f-9be2-3de26372b469@default>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1bc66c5f-1740-411f-9be2-3de26372b469@default>
User-Agent: Mutt/1.4.2.1i
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 08:33 -0800 on 20 Nov (1353400380), Dan Magenheimer wrote:
> I agree it's possible, just saying it's not trivial... one has to
> account not only for superpages system-wide (which isn't currently
> done) but a mix of unclaimed superpages and unclaimed order==0 pages
> per-domain.  Especially since that would improve launch of only a small
> and shrinking class of domains (PV && superpages=1 && mem="huge"),
> can we please consider it a possible future enhancement, not a showstopper?

Please, no.  Either you need this benighted hypercall, or you don't.  
If you really need it, do it properly.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:50:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:50:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tar1o-0007B7-4b; Tue, 20 Nov 2012 16:50:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Tar1n-0007At-1b
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:50:27 +0000
Received: from [193.109.254.147:26217] by server-5.bemta-14.messagelabs.com id
	15/E0-10257-2D4BBA05; Tue, 20 Nov 2012 16:50:26 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353430222!8967335!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6378 invoked from network); 20 Nov 2012 16:50:22 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 16:50:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="15910247"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 16:50:21 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 20 Nov 2012 16:50:21 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1Tar1h-00015c-C3;
	Tue, 20 Nov 2012 16:50:21 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1Tar1h-0000HK-9C;
	Tue, 20 Nov 2012 16:50:21 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14443-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 20 Nov 2012 16:50:21 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14443: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14443 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14443/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-pv          10 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-xend-winxpsp3  8 guest-saverestore        fail REGR. vs. 14416
 test-amd64-i386-pair   17 guest-migrate/src_host/dst_host fail REGR. vs. 14416
 test-amd64-i386-win           8 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-pv           10 guest-saverestore         fail REGR. vs. 14416
 test-amd64-amd64-xl-win7-amd64 12 guest-localmigrate/x10  fail REGR. vs. 14416
 test-amd64-i386-win-vcpus1    8 guest-saverestore         fail REGR. vs. 14416
 test-amd64-amd64-pair  17 guest-migrate/src_host/dst_host fail REGR. vs. 14416
 test-amd64-amd64-win          8 guest-saverestore         fail REGR. vs. 14416

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14416
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14416
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14416
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14416

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  ae6fb202b233
baseline version:
 xen                  321f8487379b

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Wei Wang <wei.wang2@amd.com>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        fail    
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          fail    
 test-amd64-i386-pv                                           fail    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26179:ae6fb202b233
tag:         tip
user:        Jan Beulich <jbeulich@suse.com>
date:        Tue Nov 20 08:58:31 2012 +0100
    
    passthrough/PCI: replace improper uses of pci_find_next_cap()
    
    Using pci_find_next_cap() without prior pci_find_cap_offset() is bogus
    (and possibly wrong, given that the latter doesn't check the
    PCI_STATUS_CAP_LIST flag, which so far was checked in an open-coded way
    only for the non-bridge case).
    
    Once at it, fold the two calls into one, as we need its result in any
    case.
    
    Question is whether, without any caller left, pci_find_next_cap()
    should be purged as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>
    
    
changeset:   26178:02b9d9a25fee
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 19:56:56 2012 +0000
    
    xen: fix build failure due to extra closing comment
    
    Added by 26173:26facad2f1a1
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26177:fe8034159ac2
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:35 2012 +0000
    
    docs: Include prototype for HYPERVISOR_multicall
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26176:edad24bfa561
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:34 2012 +0000
    
    docs: Document HYPERVISOR_update_descriptor
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26175:b1d36147ac96
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Add ToC entry for start of day memory layout.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26174:dbb8d24bb5ad
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Document HYPERVISOR_mmuext_op
    
    Mark-up for inclusion of generated docs.
    
    Remove some trailing whitespace.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26173:26facad2f1a1
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:32 2012 +0000
    
    docs: document HYPERVISOR_update_va_mapping(_other_domain)
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26172:cfd2772cc717
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:31 2012 +0000
    
    docs: document/mark-up SCHEDOP_*
    
    The biggest subtlety here is there additional argument when op ==
    SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
    xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
    
    This patch moves some structs around but there is no functional change
    other than improved documentation.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26171:31668da0c4d3
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 15:15:12 2012 +0100
    
    AMD IOMMU: fix type of "bdf" parameter of update_intremap_entry_from_msi_msg()
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26170:380ad94f2adc
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:51 2012 +0000
    
    Remove tools/vtpm* from MAINTAINERS file
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26169:5a6225e40388
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:50 2012 +0000
    
    tools: Remove old vtpm stuff from tools/libxen
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26168:3dc18d679d04
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:49 2012 +0000
    
    Remove VTPM_TOOLS from config/Tools.mk.in
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26167:31dcc0e08754
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    xend: Remove old vtpm support from xm
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26166:d026f8abca51
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    minios: Update mini-os license to support GPL features
    
    This patch updates extras/mini-os/COPYING to explain
    which optional features are GPL and what the implications
    of enabling them are.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26165:42a7c393c390
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:47 2012 +0000
    
    minios: fix bug in lseek for mini-os
    
    lseek always used files[fd].file.offset. It should
    use the offset of whatever union member is actually
    being used.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26164:17539cec2b9d
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: get the number of cpus from device tree
    
    The system might have fewer cpus than the GIC supports.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26163:ddb109120dbd
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: flush D-cache and I-cache when appropriate
    
    - invalidate tlb after setting WXN
    - flush D-cache and I-cache after relocation;
    - invalidate D-cache after writing to smp_up_cpu;
    - flush I-cache after changing HTTBR;
    - flush I-cache and branch predictor after writing Xen text ptes.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26162:9da9781cc3fb
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 09:48:22 2012 +0100
    
    vscsiif: minor cleanup
    
    Remove a definition not belonging into the interface, and correct a
    few typos in comments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26161:9025a10c0561
user:        Wei Wang <wei.wang2@amd.com>
date:        Mon Nov 19 09:46:46 2012 +0100
    
    AMD IOMMU: Enable HPET broadcast msi remapping
    
    This patch enables hpet msi remapping for amd iommu.
    
    Signed-off-by: Wei Wang <wei.wang2@amd.com>
    
    - use the existing ACPI_IVHD_* #define-s
    - warn on finding more than one IVHD HPET entry
    - consolidate parameters of update_intremap_entry_from_msi_msg()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Committed-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26160:321f8487379b
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:29 2012 +0000
    
    xen/arm: wake up secondary cpus
    
    Secondary cpus are held by the firmware until we send an IPI to them.
    
    Reordered non-boot cpu wait loop to perform the check before waiting
    for an event, to handled the case where the event has already
    happened when we reach the loop.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:50:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:50:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tar1o-0007B7-4b; Tue, 20 Nov 2012 16:50:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Tar1n-0007At-1b
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:50:27 +0000
Received: from [193.109.254.147:26217] by server-5.bemta-14.messagelabs.com id
	15/E0-10257-2D4BBA05; Tue, 20 Nov 2012 16:50:26 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353430222!8967335!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6378 invoked from network); 20 Nov 2012 16:50:22 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 16:50:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="15910247"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 16:50:21 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 20 Nov 2012 16:50:21 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1Tar1h-00015c-C3;
	Tue, 20 Nov 2012 16:50:21 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1Tar1h-0000HK-9C;
	Tue, 20 Nov 2012 16:50:21 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14443-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 20 Nov 2012 16:50:21 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14443: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14443 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14443/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-pv          10 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-xend-winxpsp3  8 guest-saverestore        fail REGR. vs. 14416
 test-amd64-i386-pair   17 guest-migrate/src_host/dst_host fail REGR. vs. 14416
 test-amd64-i386-win           8 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-pv           10 guest-saverestore         fail REGR. vs. 14416
 test-amd64-amd64-xl-win7-amd64 12 guest-localmigrate/x10  fail REGR. vs. 14416
 test-amd64-i386-win-vcpus1    8 guest-saverestore         fail REGR. vs. 14416
 test-amd64-amd64-pair  17 guest-migrate/src_host/dst_host fail REGR. vs. 14416
 test-amd64-amd64-win          8 guest-saverestore         fail REGR. vs. 14416

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14416
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14416
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14416
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14416

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  ae6fb202b233
baseline version:
 xen                  321f8487379b

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Wei Wang <wei.wang2@amd.com>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        fail    
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          fail    
 test-amd64-i386-pv                                           fail    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26179:ae6fb202b233
tag:         tip
user:        Jan Beulich <jbeulich@suse.com>
date:        Tue Nov 20 08:58:31 2012 +0100
    
    passthrough/PCI: replace improper uses of pci_find_next_cap()
    
    Using pci_find_next_cap() without prior pci_find_cap_offset() is bogus
    (and possibly wrong, given that the latter doesn't check the
    PCI_STATUS_CAP_LIST flag, which so far was checked in an open-coded way
    only for the non-bridge case).
    
    Once at it, fold the two calls into one, as we need its result in any
    case.
    
    Question is whether, without any caller left, pci_find_next_cap()
    should be purged as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>
    
    
changeset:   26178:02b9d9a25fee
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 19:56:56 2012 +0000
    
    xen: fix build failure due to extra closing comment
    
    Added by 26173:26facad2f1a1
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26177:fe8034159ac2
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:35 2012 +0000
    
    docs: Include prototype for HYPERVISOR_multicall
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26176:edad24bfa561
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:34 2012 +0000
    
    docs: Document HYPERVISOR_update_descriptor
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26175:b1d36147ac96
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Add ToC entry for start of day memory layout.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26174:dbb8d24bb5ad
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Document HYPERVISOR_mmuext_op
    
    Mark-up for inclusion of generated docs.
    
    Remove some trailing whitespace.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26173:26facad2f1a1
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:32 2012 +0000
    
    docs: document HYPERVISOR_update_va_mapping(_other_domain)
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26172:cfd2772cc717
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:31 2012 +0000
    
    docs: document/mark-up SCHEDOP_*
    
    The biggest subtlety here is there additional argument when op ==
    SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
    xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
    
    This patch moves some structs around but there is no functional change
    other than improved documentation.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26171:31668da0c4d3
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 15:15:12 2012 +0100
    
    AMD IOMMU: fix type of "bdf" parameter of update_intremap_entry_from_msi_msg()
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26170:380ad94f2adc
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:51 2012 +0000
    
    Remove tools/vtpm* from MAINTAINERS file
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26169:5a6225e40388
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:50 2012 +0000
    
    tools: Remove old vtpm stuff from tools/libxen
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26168:3dc18d679d04
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:49 2012 +0000
    
    Remove VTPM_TOOLS from config/Tools.mk.in
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26167:31dcc0e08754
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    xend: Remove old vtpm support from xm
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26166:d026f8abca51
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    minios: Update mini-os license to support GPL features
    
    This patch updates extras/mini-os/COPYING to explain
    which optional features are GPL and what the implications
    of enabling them are.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26165:42a7c393c390
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:47 2012 +0000
    
    minios: fix bug in lseek for mini-os
    
    lseek always used files[fd].file.offset. It should
    use the offset of whatever union member is actually
    being used.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26164:17539cec2b9d
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: get the number of cpus from device tree
    
    The system might have fewer cpus than the GIC supports.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26163:ddb109120dbd
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: flush D-cache and I-cache when appropriate
    
    - invalidate tlb after setting WXN
    - flush D-cache and I-cache after relocation;
    - invalidate D-cache after writing to smp_up_cpu;
    - flush I-cache after changing HTTBR;
    - flush I-cache and branch predictor after writing Xen text ptes.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26162:9da9781cc3fb
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 09:48:22 2012 +0100
    
    vscsiif: minor cleanup
    
    Remove a definition not belonging into the interface, and correct a
    few typos in comments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26161:9025a10c0561
user:        Wei Wang <wei.wang2@amd.com>
date:        Mon Nov 19 09:46:46 2012 +0100
    
    AMD IOMMU: Enable HPET broadcast msi remapping
    
    This patch enables hpet msi remapping for amd iommu.
    
    Signed-off-by: Wei Wang <wei.wang2@amd.com>
    
    - use the existing ACPI_IVHD_* #define-s
    - warn on finding more than one IVHD HPET entry
    - consolidate parameters of update_intremap_entry_from_msi_msg()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Committed-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26160:321f8487379b
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:29 2012 +0000
    
    xen/arm: wake up secondary cpus
    
    Secondary cpus are held by the firmware until we send an IPI to them.
    
    Reordered non-boot cpu wait loop to perform the check before waiting
    for an event, to handled the case where the event has already
    happened when we reach the loop.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:52:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:52:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tar3h-0007Qb-16; Tue, 20 Nov 2012 16:52:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tar3g-0007QS-2E
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:52:24 +0000
Received: from [193.109.254.147:40346] by server-12.bemta-14.messagelabs.com
	id 94/3F-00510-745BBA05; Tue, 20 Nov 2012 16:52:23 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1353430340!4849410!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16100 invoked from network); 20 Nov 2012 16:52:20 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-27.messagelabs.com with SMTP;
	20 Nov 2012 16:52:20 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 16:52:20 +0000
Message-Id: <50ABC38C02000078000AA22A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 16:53:16 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-10-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA08D102000078000A9957@nat28.tlf.novell.com>
	<50AA4E3F.4090907@tycho.nsa.gov>
	<50ABC09802000078000AA1D2@nat28.tlf.novell.com>
	<50ABB387.6090206@tycho.nsa.gov>
In-Reply-To: <50ABB387.6090206@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 09/19] xen: lock target domain in do_domctl
 common code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 17:44, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> On 11/20/2012 11:40 AM, Jan Beulich wrote:
>>>>> On 19.11.12 at 16:20, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>>> On 11/19/2012 04:24 AM, Jan Beulich wrote:
>>>>>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>>>>> @@ -458,6 +443,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
>>> u_domctl)
>>>>>          if ( IS_ERR(d) )
>>>>>          {
>>>>>              ret = PTR_ERR(d);
>>>>> +            d = NULL;
>>>>
>>>> Considering that in the common code you already set d to NULL,
>>>> is there a specific reason why you do so again here ...
>>>>
>>>>>              break;
>>>>>          }
>>>>>  
>>>>> @@ -469,39 +455,28 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
>>> u_domctl)
>>>>>          op->domain = d->domain_id;
>>>>>          if ( copy_to_guest(u_domctl, op, 1) )
>>>>>              ret = -EFAULT;
>>>>> +        d = NULL;
>>>>
>>>> ... and here?
>>>>
>>>> Same further down for XEN_DOMCTL_getdomaininfo.
>>>>
>>>> Jan
>>>>
>>>>>      }
>>>>>      break;
>>>>>  
>>>>
>>>>
>>>>
>>>
>>> This avoids unlocking the domain when it hasn't been locked (at the
>>> end of the function at domctl_out_unlock) or trying to unlock a
>>> ERR_PTR value.
>> 
>> Sorry, this doesn't explain why d needs to be set to NULL twice.
>> 
>> Jan
>> 
> 
> Maybe I misunderstood you: do you think one of the two assignments is
> redundant? They are not, since the above is immediately followed by a
> break, which jumps out of the switch statement to domctl_lock_release(),
> and does not hit the second assignment.

I thought they were redundant with the NULL assignment you added
close to the top of the function. But I realize I was wrong with that.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:52:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:52:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tar3h-0007Qb-16; Tue, 20 Nov 2012 16:52:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tar3g-0007QS-2E
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 16:52:24 +0000
Received: from [193.109.254.147:40346] by server-12.bemta-14.messagelabs.com
	id 94/3F-00510-745BBA05; Tue, 20 Nov 2012 16:52:23 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1353430340!4849410!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16100 invoked from network); 20 Nov 2012 16:52:20 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-27.messagelabs.com with SMTP;
	20 Nov 2012 16:52:20 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 20 Nov 2012 16:52:20 +0000
Message-Id: <50ABC38C02000078000AA22A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 20 Nov 2012 16:53:16 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel De Graaf" <dgdegra@tycho.nsa.gov>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-10-git-send-email-dgdegra@tycho.nsa.gov>
	<50AA08D102000078000A9957@nat28.tlf.novell.com>
	<50AA4E3F.4090907@tycho.nsa.gov>
	<50ABC09802000078000AA1D2@nat28.tlf.novell.com>
	<50ABB387.6090206@tycho.nsa.gov>
In-Reply-To: <50ABB387.6090206@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 09/19] xen: lock target domain in do_domctl
 common code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 17:44, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
> On 11/20/2012 11:40 AM, Jan Beulich wrote:
>>>>> On 19.11.12 at 16:20, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>>> On 11/19/2012 04:24 AM, Jan Beulich wrote:
>>>>>>> On 16.11.12 at 19:28, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>>>>> @@ -458,6 +443,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
>>> u_domctl)
>>>>>          if ( IS_ERR(d) )
>>>>>          {
>>>>>              ret = PTR_ERR(d);
>>>>> +            d = NULL;
>>>>
>>>> Considering that in the common code you already set d to NULL,
>>>> is there a specific reason why you do so again here ...
>>>>
>>>>>              break;
>>>>>          }
>>>>>  
>>>>> @@ -469,39 +455,28 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
>>> u_domctl)
>>>>>          op->domain = d->domain_id;
>>>>>          if ( copy_to_guest(u_domctl, op, 1) )
>>>>>              ret = -EFAULT;
>>>>> +        d = NULL;
>>>>
>>>> ... and here?
>>>>
>>>> Same further down for XEN_DOMCTL_getdomaininfo.
>>>>
>>>> Jan
>>>>
>>>>>      }
>>>>>      break;
>>>>>  
>>>>
>>>>
>>>>
>>>
>>> This avoids unlocking the domain when it hasn't been locked (at the
>>> end of the function at domctl_out_unlock) or trying to unlock a
>>> ERR_PTR value.
>> 
>> Sorry, this doesn't explain why d needs to be set to NULL twice.
>> 
>> Jan
>> 
> 
> Maybe I misunderstood you: do you think one of the two assignments is
> redundant? They are not, since the above is immediately followed by a
> break, which jumps out of the switch statement to domctl_lock_release(),
> and does not hit the second assignment.

I thought they were redundant with the NULL assignment you added
close to the top of the function. But I realize I was wrong with that.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 16:57:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:57:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tar8Y-0007fo-Sw; Tue, 20 Nov 2012 16:57:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1Tar8X-0007fj-3Z
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:57:25 +0000
Received: from [85.158.139.83:52151] by server-8.bemta-5.messagelabs.com id
	2F/E7-06050-276BBA05; Tue, 20 Nov 2012 16:57:22 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1353430640!26868393!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ4OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19646 invoked from network); 20 Nov 2012 16:57:21 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 16:57:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208,217";a="45189852"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 16:57:18 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 11:57:16 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[0.0.0.0])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1Tar8O-0007QR-IC;
	Tue, 20 Nov 2012 16:57:16 +0000
Message-ID: <50ABB66B.7090004@eu.citrix.com>
Date: Tue, 20 Nov 2012 16:57:15 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "rshriram@cs.ubc.ca" <rshriram@cs.ubc.ca>
References: <DE8DF0795D48FD4CA783C40EC829233534A645@SHSMSX101.ccr.corp.intel.com>
	<20609.28264.158580.995717@mariner.uk.xensource.com>
	<CAFLBxZZvU9GQ4jjFvWK25jjmkbhRXZjvKSJZajz2Qu9m8n+H0w@mail.gmail.com>
	<20613.9696.715106.47187@mariner.uk.xensource.com>
	<CAP8mzPNYECd_nrO6Y7CL3X+3AFZ-ibSxwPFi1ZTJ75d7h6En1A@mail.gmail.com>
In-Reply-To: <CAP8mzPNYECd_nrO6Y7CL3X+3AFZ-ibSxwPFi1ZTJ75d7h6En1A@mail.gmail.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH 5/5] X86/vMCE: guest broken page handling
 when migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3541790306068943822=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============3541790306068943822==
Content-Type: multipart/alternative;
	boundary="------------040509000102070206070808"

--------------040509000102070206070808
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
Content-Transfer-Encoding: 7bit

On 22/10/12 20:26, Shriram Rajagopalan wrote:
> On Mon, Oct 22, 2012 at 3:54 AM, Ian Jackson 
> <Ian.Jackson@eu.citrix.com <mailto:Ian.Jackson@eu.citrix.com>> wrote:
>
>     George Dunlap writes ("Re: [Xen-devel] [PATCH 5/5] X86/vMCE: guest
>     broken page handling when migration"):
>     > On Fri, Oct 19, 2012 at 4:14 PM, Ian Jackson
>     <Ian.Jackson@eu.citrix.com <mailto:Ian.Jackson@eu.citrix.com>> wrote:
>     > > This looks plausible to me, as far as the tools go.  Can you
>     explain
>     > > how you have tested this ?  Did you manage to do any tests of the
>     > > remus codepaths ?
>     >
>     > I'm pretty sure that this shouldn't cause any problems with
>     Remus.  If
>     > it's difficult for Jinsong to test Remus, I think probably OK to
>     > commit it, and then revert it if the Remus guys have any problems.
>
>     OK.
>
>
> You can easily test it with Remus. With xl, memory replication 
> functionality is already
> in place. so xl remus command should work.

Should "xl remus $domain localhost" work?  How would one test the 
fail-over mechanism?  Are there any other requirements for the guest, 
the kernel, &c?

I just ran the above command on xen-unstable, and after 10 minutes or so 
the guest crashed with some kind of a kernel double-fault.

Are we running any remus stuff in our testing infrastructure?

  -George


--------------040509000102070206070808
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 22/10/12 20:26, Shriram Rajagopalan
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAP8mzPNYECd_nrO6Y7CL3X+3AFZ-ibSxwPFi1ZTJ75d7h6En1A@mail.gmail.com"
      type="cite">
      <div>
        <div>On Mon, Oct 22, 2012 at 3:54 AM, Ian Jackson <span
            dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:Ian.Jackson@eu.citrix.com" target="_blank">Ian.Jackson@eu.citrix.com</a>&gt;</span>
          wrote:</div>
        <div>
          <div>
            <div class="gmail_quote">
              <blockquote class="gmail_quote" style="margin:0 0 0
                .8ex;border-left:1px #ccc solid;padding-left:1ex">George
                Dunlap writes ("Re: [Xen-devel] [PATCH 5/5] X86/vMCE:
                guest broken page handling when migration"):<br>
                <div class="im">&gt; On Fri, Oct 19, 2012 at 4:14 PM,
                  Ian Jackson &lt;<a moz-do-not-send="true"
                    href="mailto:Ian.Jackson@eu.citrix.com">Ian.Jackson@eu.citrix.com</a>&gt;
                  wrote:<br>
                </div>
                <div class="im">&gt; &gt; This looks plausible to me, as
                  far as the tools go. &nbsp;Can you explain<br>
                  &gt; &gt; how you have tested this ? &nbsp;Did you manage
                  to do any tests of the<br>
                  &gt; &gt; remus codepaths ?<br>
                  &gt;<br>
                  &gt; I'm pretty sure that this shouldn't cause any
                  problems with Remus. &nbsp;If<br>
                  &gt; it's difficult for Jinsong to test Remus, I think
                  probably OK to<br>
                  &gt; commit it, and then revert it if the Remus guys
                  have any problems.<br>
                  <br>
                </div>
                OK.<br>
                <span class="HOEnZb"><font color="#888888"><br>
                  </font></span></blockquote>
              <div><br>
              </div>
              You can easily test it with Remus. With xl, memory
              replication functionality is already
              <div>in place. so xl remus command should work.</div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Should "xl remus $domain localhost" work?&nbsp; How would one test the
    fail-over mechanism?&nbsp; Are there any other requirements for the
    guest, the kernel, &amp;c?<br>
    <br>
    I just ran the above command on xen-unstable, and after 10 minutes
    or so the guest crashed with some kind of a kernel double-fault.<br>
    <br>
    Are we running any remus stuff in our testing infrastructure?<br>
    <br>
    &nbsp;-George<br>
    <br>
  </body>
</html>

--------------040509000102070206070808--


--===============3541790306068943822==
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.xen.org
http://lists.xen.org/xen-devel

--===============3541790306068943822==--


From xen-devel-bounces@lists.xen.org Tue Nov 20 16:57:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 16:57:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tar8Y-0007fo-Sw; Tue, 20 Nov 2012 16:57:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1Tar8X-0007fj-3Z
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:57:25 +0000
Received: from [85.158.139.83:52151] by server-8.bemta-5.messagelabs.com id
	2F/E7-06050-276BBA05; Tue, 20 Nov 2012 16:57:22 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1353430640!26868393!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ4OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19646 invoked from network); 20 Nov 2012 16:57:21 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 16:57:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208,217";a="45189852"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 16:57:18 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 11:57:16 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[0.0.0.0])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1Tar8O-0007QR-IC;
	Tue, 20 Nov 2012 16:57:16 +0000
Message-ID: <50ABB66B.7090004@eu.citrix.com>
Date: Tue, 20 Nov 2012 16:57:15 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "rshriram@cs.ubc.ca" <rshriram@cs.ubc.ca>
References: <DE8DF0795D48FD4CA783C40EC829233534A645@SHSMSX101.ccr.corp.intel.com>
	<20609.28264.158580.995717@mariner.uk.xensource.com>
	<CAFLBxZZvU9GQ4jjFvWK25jjmkbhRXZjvKSJZajz2Qu9m8n+H0w@mail.gmail.com>
	<20613.9696.715106.47187@mariner.uk.xensource.com>
	<CAP8mzPNYECd_nrO6Y7CL3X+3AFZ-ibSxwPFi1ZTJ75d7h6En1A@mail.gmail.com>
In-Reply-To: <CAP8mzPNYECd_nrO6Y7CL3X+3AFZ-ibSxwPFi1ZTJ75d7h6En1A@mail.gmail.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH 5/5] X86/vMCE: guest broken page handling
 when migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3541790306068943822=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============3541790306068943822==
Content-Type: multipart/alternative;
	boundary="------------040509000102070206070808"

--------------040509000102070206070808
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
Content-Transfer-Encoding: 7bit

On 22/10/12 20:26, Shriram Rajagopalan wrote:
> On Mon, Oct 22, 2012 at 3:54 AM, Ian Jackson 
> <Ian.Jackson@eu.citrix.com <mailto:Ian.Jackson@eu.citrix.com>> wrote:
>
>     George Dunlap writes ("Re: [Xen-devel] [PATCH 5/5] X86/vMCE: guest
>     broken page handling when migration"):
>     > On Fri, Oct 19, 2012 at 4:14 PM, Ian Jackson
>     <Ian.Jackson@eu.citrix.com <mailto:Ian.Jackson@eu.citrix.com>> wrote:
>     > > This looks plausible to me, as far as the tools go.  Can you
>     explain
>     > > how you have tested this ?  Did you manage to do any tests of the
>     > > remus codepaths ?
>     >
>     > I'm pretty sure that this shouldn't cause any problems with
>     Remus.  If
>     > it's difficult for Jinsong to test Remus, I think probably OK to
>     > commit it, and then revert it if the Remus guys have any problems.
>
>     OK.
>
>
> You can easily test it with Remus. With xl, memory replication 
> functionality is already
> in place. so xl remus command should work.

Should "xl remus $domain localhost" work?  How would one test the 
fail-over mechanism?  Are there any other requirements for the guest, 
the kernel, &c?

I just ran the above command on xen-unstable, and after 10 minutes or so 
the guest crashed with some kind of a kernel double-fault.

Are we running any remus stuff in our testing infrastructure?

  -George


--------------040509000102070206070808
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 22/10/12 20:26, Shriram Rajagopalan
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAP8mzPNYECd_nrO6Y7CL3X+3AFZ-ibSxwPFi1ZTJ75d7h6En1A@mail.gmail.com"
      type="cite">
      <div>
        <div>On Mon, Oct 22, 2012 at 3:54 AM, Ian Jackson <span
            dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:Ian.Jackson@eu.citrix.com" target="_blank">Ian.Jackson@eu.citrix.com</a>&gt;</span>
          wrote:</div>
        <div>
          <div>
            <div class="gmail_quote">
              <blockquote class="gmail_quote" style="margin:0 0 0
                .8ex;border-left:1px #ccc solid;padding-left:1ex">George
                Dunlap writes ("Re: [Xen-devel] [PATCH 5/5] X86/vMCE:
                guest broken page handling when migration"):<br>
                <div class="im">&gt; On Fri, Oct 19, 2012 at 4:14 PM,
                  Ian Jackson &lt;<a moz-do-not-send="true"
                    href="mailto:Ian.Jackson@eu.citrix.com">Ian.Jackson@eu.citrix.com</a>&gt;
                  wrote:<br>
                </div>
                <div class="im">&gt; &gt; This looks plausible to me, as
                  far as the tools go. &nbsp;Can you explain<br>
                  &gt; &gt; how you have tested this ? &nbsp;Did you manage
                  to do any tests of the<br>
                  &gt; &gt; remus codepaths ?<br>
                  &gt;<br>
                  &gt; I'm pretty sure that this shouldn't cause any
                  problems with Remus. &nbsp;If<br>
                  &gt; it's difficult for Jinsong to test Remus, I think
                  probably OK to<br>
                  &gt; commit it, and then revert it if the Remus guys
                  have any problems.<br>
                  <br>
                </div>
                OK.<br>
                <span class="HOEnZb"><font color="#888888"><br>
                  </font></span></blockquote>
              <div><br>
              </div>
              You can easily test it with Remus. With xl, memory
              replication functionality is already
              <div>in place. so xl remus command should work.</div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Should "xl remus $domain localhost" work?&nbsp; How would one test the
    fail-over mechanism?&nbsp; Are there any other requirements for the
    guest, the kernel, &amp;c?<br>
    <br>
    I just ran the above command on xen-unstable, and after 10 minutes
    or so the guest crashed with some kind of a kernel double-fault.<br>
    <br>
    Are we running any remus stuff in our testing infrastructure?<br>
    <br>
    &nbsp;-George<br>
    <br>
  </body>
</html>

--------------040509000102070206070808--


--===============3541790306068943822==
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.xen.org
http://lists.xen.org/xen-devel

--===============3541790306068943822==--


From xen-devel-bounces@lists.xen.org Tue Nov 20 17:00:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:00:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarB4-0007tt-7v; Tue, 20 Nov 2012 17:00:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <davidb@codeaurora.org>) id 1Tar8x-0007hb-3i
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:57:51 +0000
Received: from [85.158.139.211:7832] by server-5.bemta-5.messagelabs.com id
	4A/97-11353-E86BBA05; Tue, 20 Nov 2012 16:57:50 +0000
X-Env-Sender: davidb@codeaurora.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353430667!20983499!1
X-Originating-IP: [199.106.114.254]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTk5LjEwNi4xMTQuMjU0ID0+IDM3OTIxNQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13464 invoked from network); 20 Nov 2012 16:57:48 -0000
Received: from wolverine01.qualcomm.com (HELO wolverine01.qualcomm.com)
	(199.106.114.254)
	by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 20 Nov 2012 16:57:48 -0000
X-IronPort-AV: E=McAfee;i="5400,1158,6901"; a="8370233"
Received: from pdmz-ns-snip_115_219.qualcomm.com (HELO mostmsg01.qualcomm.com)
	([199.106.115.219])
	by wolverine01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA;
	20 Nov 2012 08:57:27 -0800
Received: from codeaurora.org (pdmz-ns-snip_218_1.qualcomm.com [192.168.218.1])
	by mostmsg01.qualcomm.com (Postfix) with ESMTPA id 3E69510004BF;
	Tue, 20 Nov 2012 08:57:27 -0800 (PST)
Date: Tue, 20 Nov 2012 08:57:26 -0800
From: David Brown <davidb@codeaurora.org>
To: Bill Pemberton <wfp5p@virginia.edu>
Message-ID: <20121120165726.GB21706@codeaurora.org>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
	<1353349642-3677-158-git-send-email-wfp5p@virginia.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353349642-3677-158-git-send-email-wfp5p@virginia.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Mailman-Approved-At: Tue, 20 Nov 2012 17:00:00 +0000
Cc: linux-fbdev@vger.kernel.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	virtualization@lists.linux-foundation.org,
	Michal Januszewski <spock@gentoo.org>, Paul Mackerras <paulus@samba.org>,
	linux-nvidia@lists.surfsouth.com, Daniel Walker <dwalker@fifo99.com>,
	Kukjin Kim <kgene.kim@samsung.com>, Russell King <linux@arm.linux.org.uk>,
	Wan ZongShun <mcuos.com@gmail.com>,
	Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
	Jingoo Han <jg1.han@samsung.com>, Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Jaya Kumar <jayalk@intworks.biz>, cbe-oss-dev@lists.ozlabs.org,
	Antonino Daplas <adaplas@gmail.com>, linux-arm-msm@vger.kernel.org,
	Thomas Winischhofer <thomas@winischhofer.net>,
	linux-geode@lists.infradead.org, linux-samsung-soc@vger.kernel.org,
	Ben Dooks <ben-linux@fluff.org>, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Maik Broemme <mbroemme@plusserver.de>,
	Geoff Levand <geoff@infradead.org>, gregkh@linuxfoundation.org,
	Ferenc Bakonyi <fero@drama.obuda.kando.hu>,
	Tony Prisk <linux@prisktech.co.nz>, Bryan Huntsman <bryanh@codeaurora.org>,
	Kristoffer Ericson <kristoffer.ericson@gmail.com>,
	linuxppc-dev@lists.ozlabs.org, xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH 158/493] video: remove use of __devinit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 19, 2012 at 01:21:47PM -0500, Bill Pemberton wrote:
> CONFIG_HOTPLUG is going away as an option so __devinit is no longer
> needed.
> 
> Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
> ---
>  drivers/video/msm/mddi.c                           |  6 +-

Acked-by: David Brown <davidb@codeaurora.org>

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:00:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:00:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarB4-0007tt-7v; Tue, 20 Nov 2012 17:00:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <davidb@codeaurora.org>) id 1Tar8x-0007hb-3i
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 16:57:51 +0000
Received: from [85.158.139.211:7832] by server-5.bemta-5.messagelabs.com id
	4A/97-11353-E86BBA05; Tue, 20 Nov 2012 16:57:50 +0000
X-Env-Sender: davidb@codeaurora.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353430667!20983499!1
X-Originating-IP: [199.106.114.254]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTk5LjEwNi4xMTQuMjU0ID0+IDM3OTIxNQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13464 invoked from network); 20 Nov 2012 16:57:48 -0000
Received: from wolverine01.qualcomm.com (HELO wolverine01.qualcomm.com)
	(199.106.114.254)
	by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 20 Nov 2012 16:57:48 -0000
X-IronPort-AV: E=McAfee;i="5400,1158,6901"; a="8370233"
Received: from pdmz-ns-snip_115_219.qualcomm.com (HELO mostmsg01.qualcomm.com)
	([199.106.115.219])
	by wolverine01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA;
	20 Nov 2012 08:57:27 -0800
Received: from codeaurora.org (pdmz-ns-snip_218_1.qualcomm.com [192.168.218.1])
	by mostmsg01.qualcomm.com (Postfix) with ESMTPA id 3E69510004BF;
	Tue, 20 Nov 2012 08:57:27 -0800 (PST)
Date: Tue, 20 Nov 2012 08:57:26 -0800
From: David Brown <davidb@codeaurora.org>
To: Bill Pemberton <wfp5p@virginia.edu>
Message-ID: <20121120165726.GB21706@codeaurora.org>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
	<1353349642-3677-158-git-send-email-wfp5p@virginia.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353349642-3677-158-git-send-email-wfp5p@virginia.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Mailman-Approved-At: Tue, 20 Nov 2012 17:00:00 +0000
Cc: linux-fbdev@vger.kernel.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	virtualization@lists.linux-foundation.org,
	Michal Januszewski <spock@gentoo.org>, Paul Mackerras <paulus@samba.org>,
	linux-nvidia@lists.surfsouth.com, Daniel Walker <dwalker@fifo99.com>,
	Kukjin Kim <kgene.kim@samsung.com>, Russell King <linux@arm.linux.org.uk>,
	Wan ZongShun <mcuos.com@gmail.com>,
	Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
	Jingoo Han <jg1.han@samsung.com>, Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Jaya Kumar <jayalk@intworks.biz>, cbe-oss-dev@lists.ozlabs.org,
	Antonino Daplas <adaplas@gmail.com>, linux-arm-msm@vger.kernel.org,
	Thomas Winischhofer <thomas@winischhofer.net>,
	linux-geode@lists.infradead.org, linux-samsung-soc@vger.kernel.org,
	Ben Dooks <ben-linux@fluff.org>, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Maik Broemme <mbroemme@plusserver.de>,
	Geoff Levand <geoff@infradead.org>, gregkh@linuxfoundation.org,
	Ferenc Bakonyi <fero@drama.obuda.kando.hu>,
	Tony Prisk <linux@prisktech.co.nz>, Bryan Huntsman <bryanh@codeaurora.org>,
	Kristoffer Ericson <kristoffer.ericson@gmail.com>,
	linuxppc-dev@lists.ozlabs.org, xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH 158/493] video: remove use of __devinit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 19, 2012 at 01:21:47PM -0500, Bill Pemberton wrote:
> CONFIG_HOTPLUG is going away as an option so __devinit is no longer
> needed.
> 
> Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
> ---
>  drivers/video/msm/mddi.c                           |  6 +-

Acked-by: David Brown <davidb@codeaurora.org>

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:04:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:04:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarFZ-0008Fx-Ca; Tue, 20 Nov 2012 17:04:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TarFW-0008Fe-OL
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:04:39 +0000
Received: from [85.158.139.83:40509] by server-12.bemta-5.messagelabs.com id
	B3/86-02886-528BBA05; Tue, 20 Nov 2012 17:04:37 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1353431073!31194935!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNjQzMDU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14348 invoked from network); 20 Nov 2012 17:04:34 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-5.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 20 Nov 2012 17:04:34 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAKH4UKY026538
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 20 Nov 2012 17:04:30 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAKH4T8X016289
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 20 Nov 2012 17:04:29 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAKH4TX6001162; Tue, 20 Nov 2012 11:04:29 -0600
MIME-Version: 1.0
Message-ID: <9758ec2d-1d62-4426-ba59-204bed3acf6d@default>
Date: Tue, 20 Nov 2012 09:04:24 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__135343106902782846abhmt104.oracle.com"
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>, Matthew Daley <mattjd@gmail.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [RFC/PATCH v6 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__135343106902782846abhmt104.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This is patch 1of2 of a sixth cut of the patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account review
feedback from Jan and Keir and IanC and Matthew Daley, plus some
fixes found via runtime debugging (using printk and privcmd only).

v5->v6:
- Fix post-inc problem [mattjd]

v4->v5:
- Split tools part into separate patch [JBeulich]
- Minor coding style fixups [JBeulich]
- Use rcu_lock_domain_by_id, not _target version [JBeulich]

v3->v4: (please ignore v3)
- Process error, sent stale patch, sorry [djm]

v2->v3:
- Add per-domain and global "get" for unclaimed info [JBeulich]
- New hypercall(s) should fail for unpriv callers [IanC]
- Non-zero extent_order disallowed [JBeulich]
- Remove bonehead ASSERTs [JBeulich]
- Need not hold heaplock for decrease case too [JBeulich]
- More descriptive failure return values [JBeulich]
- Don't allow a claim to exceed max_pages [IanC]
- Subops must be in correct ifdef block in memory.c [keir]

v1->v2:
- Add reset-to-zero page claim in domain_kill [JBeulich]
- Proper handling of struct passed to hypercall [JBeulich]
- Fix alloc_heap_pages when a domain has a claim [JBeulich]
- Need not hold heap_lock if !d->unclaimed_pages [keir]
- Fix missed tot_pages call in donate_page [djm]
- Remove domain_reset_unclaimed_pages; use set with zero [djm]
- Bugfixes found through testing in set_unclaimed [djm]
- More comments in code [djm]
- Code formatting fixes [djm]

=3D=3D=3D

Motivation:

The goal of this hypercall is to attempt to atomically and very
quickly determine if there are sufficient pages available in the
system and, if so, "set aside" that quantity of pages for future
allocations by that domain.  Unlike an existing hypercall such as
increase_reservation or populate_physmap, specific physical
pageframes are not assigned to the domain because this
cannot be done sufficiently quickly (especially for very large
allocations in an arbitrarily fragmented system) and so the
existing mechanisms result in classic time-of-check-time-of-use
(TOCTOU) races.  One can think of claiming as similar to a
"lazy" allocation, but subsequent hypercalls are required
to do the actual physical pageframe allocation.

In order for a toolstack to "get" information about whether
a domain has a claim and, if so, how large, and also for
the toolstack to measure the total system-wide claim, a
second subop has been added and exposed through domctl
and libxl.

Built on top of this in the toolstack, I envision
a "xl create --claim" option to maximize backwards
compatibility while minimizing impact on existing toolstacks;
and perhaps an "xl free --claim" for the system-wide info.

It has been noted that this claim mechanism solves the
underlying problem (slow failure of domain creation) for
a large class of domains not not all, specifically not
handling (but also not making the problem worse for) PV
domains that specify the "superpages" flag, and 32-bit PV
domains on large RAM systems.  These may be addressed at a
later time.

Code overview:

Though the hypercall simply does arithmetic within locks,
some of the semantics in the code may be a bit subtle
so let me explain a bit.

The key variables (d->unclaimed_pages and total_unclaimed_pages)
start at zero if no claim has yet been staked for any domain.
(Perhaps a better name is "claimed_but_not_yet_possessed" but that's
a bit unwieldy.)  If no claim hypercalls are executed, there
should be no impact on existing usage.

When a claim is successfully staked by a domain, it is like a
watermark but there is no record kept of the size of the claim.
Instead, d->unclaimed_pages is set to the difference between
d->tot_pages and the claim.  When d->tot_pages increases or decreases,
d->unclaimed_pages atomically decreases or increases.  Once
d->unclaimed_pages reaches zero, the claim is satisfied and
d->unclaimed pages stays at zero -- unless a new claim is
subsequently staked.

The systemwide variable total_unclaimed_pages is always the sum
of d->unclaimed_pages, across all domains.  A non-domain-
specific heap allocation will fail if total_unclaimed_pages
exceeds free (plus, on tmem enabled systems, freeable) pages.

Claim semantics may be modified by flags.  The initial
implementation has one flag, which discerns whether the
caller would like tmem freeable pages to be considered
in determining whether or not the claim can be successfully
staked. Future flags may, for example, specify that the
caller would like the claim to be successful only if there
are sufficient pages available on a single node (per Dario's
suggestion).

A claim can be cancelled by requesting a claim of zero pages.

A second subop returns the total outstanding claimed pages
systemwide.

Note: Save/restore/migrate may need to be modified,
else it can be documented that all claims are cancelled.

Thanks for any feedback!

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 arch/x86/mm.c             |    2=20
 arch/x86/mm/mem_sharing.c |    4 -
 common/domain.c           |    1=20
 common/domctl.c           |    1=20
 common/grant_table.c      |    2=20
 common/memory.c           |   33 ++++++++++++
 common/page_alloc.c       |  118 +++++++++++++++++++++++++++++++++++++++++=
++++-
 include/public/domctl.h   |    3 -
 include/public/memory.h   |   39 +++++++++++++++
 include/xen/mm.h          |    7 ++
 include/xen/sched.h       |    1=20
 11 files changed, 203 insertions(+), 8 deletions(-)

diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index f2409ec..118f24a 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -36,7 +36,7 @@
 #include "grant_table.h"
 #include "hvm/save.h"
=20
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000009
=20
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -95,6 +95,7 @@ struct xen_domctl_getdomaininfo {
     uint32_t flags;              /* XEN_DOMINF_* */
     uint64_aligned_t tot_pages;
     uint64_aligned_t max_pages;
+    uint64_aligned_t unclaimed_pages;
     uint64_aligned_t shr_pages;
     uint64_aligned_t paged_pages;
     uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fad3d33..7e55908 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3841,7 +3841,7 @@ int donate_page(
     {
         if ( d->tot_pages >=3D d->max_pages )
             goto fail;
-        d->tot_pages++;
+        domain_increase_tot_pages(d, 1);
     }
=20
     page->count_info =3D PGC_allocated | 1;
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..943a3b5 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d,
     }
=20
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_decrease_tot_pages(d, 1);
     drop_dom_ref =3D (d->tot_pages =3D=3D 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct p=
age_info *page)
     ASSERT(page_get_owner(page) =3D=3D dom_cow);
     page_set_owner(page, d);
=20
-    if ( d->tot_pages++ =3D=3D 0 )
+    if ( domain_increase_tot_pages(d, 1) =3D=3D 1 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0e3e36a..95509e2 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -492,6 +492,7 @@ int domain_kill(struct domain *d)
         evtchn_destroy(d);
         gnttab_release_mappings(d);
         tmem_destroy(d->tmem);
+        domain_set_unclaimed_pages(d, 0, 0);
         d->tmem =3D NULL;
         /* fallthrough */
     case DOMDYING_dying:
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index e153cb4..19e3930 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -154,6 +154,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_=
getdomaininfo *info)
=20
     info->tot_pages         =3D d->tot_pages;
     info->max_pages         =3D d->max_pages;
+    info->unclaimed_pages   =3D d->unclaimed_pages;
     info->shr_pages         =3D atomic_read(&d->shr_pages);
     info->paged_pages       =3D atomic_read(&d->paged_pages);
     info->shared_info_frame =3D mfn_to_gmfn(d, __pa(d->shared_info)>>PAGE_=
SHIFT);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..10ce78f 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1656,7 +1656,7 @@ gnttab_transfer(
         }
=20
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ =3D=3D 0) )
+        if ( unlikely(domain_increase_tot_pages(e, 1) =3D=3D 1) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..adb7581 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_=
memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
=20
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -=3D dec_count;
+                domain_decrease_tot_pages(d, dec_count);
                 drop_dom_ref =3D (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
=20
@@ -685,6 +685,37 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_=
PARAM(void) arg)
         break;
     }
=20
+    case XENMEM_claim_pages:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+
+        if ( copy_from_guest(&reservation, arg, 1) )
+            return -EFAULT;
+
+        if ( !guest_handle_is_null(reservation.extent_start) )
+            return -EINVAL;
+
+        if ( reservation.extent_order !=3D 0 )
+            return -EINVAL;
+
+        d =3D rcu_lock_domain_by_id(reservation.domid);
+        if ( d =3D=3D NULL )
+            return -EINVAL;
+
+        rc =3D domain_set_unclaimed_pages(d, reservation.nr_extents,
+                                        reservation.mem_flags);
+
+        rcu_unlock_domain(d);
+
+        break;
+
+    case XENMEM_get_unclaimed_pages:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+
+        rc =3D get_total_unclaimed_pages();
+        break;
+
     default:
         rc =3D arch_memory_op(op, arg);
         break;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 15ebc66..3d9ef54 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -238,6 +238,111 @@ static long midsize_alloc_zone_pages;
 #define MIDSIZE_ALLOC_FRAC 128
=20
 static DEFINE_SPINLOCK(heap_lock);
+static long total_unclaimed_pages; /* total outstanding claims by all doma=
ins */
+
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
+
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages +=3D pages;
+    spin_lock(&heap_lock);
+    dom_before =3D d->unclaimed_pages;
+    dom_after =3D dom_before - pages;
+    if ( (dom_before > 0) && (dom_after < 0) )
+        dom_claimed =3D 0;
+    else
+        dom_claimed =3D dom_after;
+    sys_before =3D total_unclaimed_pages;
+    sys_after =3D sys_before - (dom_before - dom_claimed);
+    BUG_ON( (sys_before > 0) && (sys_after < 0) );
+    total_unclaimed_pages =3D sys_after;
+    d->unclaimed_pages =3D dom_claimed;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages -=3D pages;
+
+    spin_lock(&heap_lock);
+    d->tot_pages -=3D pages;
+    d->unclaimed_pages +=3D pages;
+    total_unclaimed_pages +=3D pages;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
+                                unsigned long flags)
+{
+    int ret =3D -ENOMEM;
+    unsigned long claim, avail_pages;
+
+    /*
+     * take the domain's page_alloc_lock, else all increases/decreases
+     * must always take the global heap_lock rather than only in the much
+     * rarer case that d->unclaimed_pages is non-zero
+     */
+    spin_lock(&d->page_alloc_lock);
+    spin_lock(&heap_lock);
+
+    /* pages=3D=3D0 means "unset" the claim (and flags is ignored) */
+    if ( pages =3D=3D 0 )
+    {
+        total_unclaimed_pages -=3D d->unclaimed_pages;
+        d->unclaimed_pages =3D 0;
+        ret =3D 0;
+        goto out;
+    }
+
+    /* only one active claim per domain please */
+    if ( d->unclaimed_pages )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* disallow a claim not exceeding current tot_pages or above max_pages=
 */
+    if ( (pages <=3D d->tot_pages) || (pages > d->max_pages) )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* how much memory is available? */
+    avail_pages =3D total_avail_pages;
+    if ( !(flags & XENMEM_CLAIMF_free_only) )
+        avail_pages +=3D tmem_freeable_pages();
+    avail_pages -=3D total_unclaimed_pages;
+
+    /*
+     * note, if domain has already allocated memory before making a claim=
=20
+     * then the claim must take tot_pages into account
+     */
+    claim =3D pages - d->tot_pages;
+    if ( claim > avail_pages )
+        goto out;
+
+    /* yay, claim fits in available memory, stake the claim, success! */
+    d->unclaimed_pages =3D claim;
+    total_unclaimed_pages +=3D d->unclaimed_pages;
+    ret =3D 0;
+
+out:
+    spin_unlock(&heap_lock);
+    spin_unlock(&d->page_alloc_lock);
+    return ret;
+}
+
+long get_total_unclaimed_pages(void)
+{
+    return total_unclaimed_pages;
+}
=20
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
@@ -443,6 +548,15 @@ static struct page_info *alloc_heap_pages(
     spin_lock(&heap_lock);
=20
     /*
+     * Claimed memory is considered unavailable unless the request
+     * is made by a domain with sufficient unclaimed pages.
+     */
+    if ( (total_unclaimed_pages + request >
+          total_avail_pages + tmem_freeable_pages()) &&
+          (d =3D=3D NULL || d->unclaimed_pages < request) )
+        goto not_found;
+
+    /*
      * TMEM: When available memory is scarce due to tmem absorbing it, all=
ow
      * only mid-size allocations to avoid worst of fragmentation issues.
      * Others try tmem pools then fail.  This is a workaround until all
@@ -1291,7 +1405,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages =3D=3D 0) )
             get_knownalive_domain(d);
=20
-        d->tot_pages +=3D 1 << order;
+        domain_increase_tot_pages(d, 1 << order);
     }
=20
     for ( i =3D 0; i < (1 << order); i++ )
@@ -1375,7 +1489,7 @@ void free_domheap_pages(struct page_info *pg, unsigne=
d int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
=20
-        d->tot_pages -=3D 1 << order;
+        domain_decrease_tot_pages(d, 1 << order);
         drop_dom_ref =3D (d->tot_pages =3D=3D 0);
=20
         spin_unlock_recursive(&d->page_alloc_lock);
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index f1ddbc0..15d6c72 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -68,6 +68,8 @@ struct xen_memory_reservation {
      *   IN:  GPFN bases of extents to populate with memory
      *   OUT: GMFN bases of extents that were allocated
      *   (NB. This command also updates the mach_to_phys translation table=
)
+     * XENMEM_claim_pages:
+     *   IN: must be zero
      */
     XEN_GUEST_HANDLE(xen_pfn_t) extent_start;
=20
@@ -421,6 +423,43 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
=20
+/*
+ * Attempt to stake a claim for a domain on a quantity of pages
+ * of system RAM, but _not_ assign specific pageframes.  Only
+ * arithmetic is performed so the hypercall is very fast and need
+ * not be preemptible, thus sidestepping time-of-check-time-of-use
+ * races for memory allocation.  Returns 0 if the hypervisor page
+ * allocator has atomically and successfully claimed the requested
+ * number of pages, else non-zero.
+ *
+ * Any domain may have only one active claim.  When sufficient memory
+ * has been allocated to resolve the claim, the claim silently expires.
+ * Claiming zero pages effectively resets any outstanding claim and
+ * is always successful.
+ *
+ * Note that a valid claim may be staked even after memory has been
+ * allocated for a domain.  In this case, the claim is not incremental,
+ * i.e. if the domain's tot_pages is 3, and a claim is staked for 10,
+ * only 7 additional pages are claimed.
+ *
+ * Caller must be privileged or the hypercall fails.
+ */
+#define XENMEM_claim_pages                  24
+/*
+ * XENMEM_claim_pages flags:
+ *  free_only: claim is successful only if sufficient free pages
+ *    are available.  If not set and tmem is enabled, hypervisor
+ *    may also consider tmem "freeable" pages to satisfy the claim.
+ */
+#define _XENMEM_CLAIMF_free_only            0
+#define XENMEM_CLAIMF_free_only             (1U<<_XENMEM_CLAIMF_free_only)
+/*
+ * Get the number of pages currently claimed (but not yet "possessed")
+ * across all domains.  The caller must be privileged but otherwise
+ * the call never fails.=20
+ */
+#define XENMEM_get_unclaimed_pages            25
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
=20
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 64a0cc1..b4dee92 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,13 @@ void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
=20
+/* Claim handling */
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges);
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges);
+int domain_set_unclaimed_pages(
+    struct domain *d, unsigned long pages, unsigned long flags);
+long get_total_unclaimed_pages(void);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..480ef39 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -242,6 +242,7 @@ struct domain
     struct page_list_head page_list;  /* linked list */
     struct page_list_head xenpage_list; /* linked list (size xenheap_pages=
) */
     unsigned int     tot_pages;       /* number of pages currently possese=
d */
+    unsigned int     unclaimed_pages; /* pages claimed but not possessed  =
  */
     unsigned int     max_pages;       /* maximum value for tot_pages      =
  */
     atomic_t         shr_pages;       /* number of shared pages           =
  */
     atomic_t         paged_pages;     /* number of paged-out pages        =
  */

--__135343106902782846abhmt104.oracle.com
Content-Type: application/octet-stream; name="claim-hyp-121120.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-hyp-121120.patch"

ZGl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Sw2ICs2
ODUsMzcgQEAgbG9uZyBkb19tZW1vcnlfb3AodW5zaWduZWQgbG9uZyBjbWQsIFhFTl9HVUVTVF9I
QU5ETEVfUEFSQU0odm9pZCkgYXJnKQogICAgICAgICBicmVhazsKICAgICB9CiAKKyAgICBjYXNl
IFhFTk1FTV9jbGFpbV9wYWdlczoKKyAgICAgICAgaWYgKCAhSVNfUFJJVihjdXJyZW50LT5kb21h
aW4pICkKKyAgICAgICAgICAgIHJldHVybiAtRVBFUk07CisKKyAgICAgICAgaWYgKCBjb3B5X2Zy
b21fZ3Vlc3QoJnJlc2VydmF0aW9uLCBhcmcsIDEpICkKKyAgICAgICAgICAgIHJldHVybiAtRUZB
VUxUOworCisgICAgICAgIGlmICggIWd1ZXN0X2hhbmRsZV9pc19udWxsKHJlc2VydmF0aW9uLmV4
dGVudF9zdGFydCkgKQorICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisKKyAgICAgICAgaWYg
KCByZXNlcnZhdGlvbi5leHRlbnRfb3JkZXIgIT0gMCApCisgICAgICAgICAgICByZXR1cm4gLUVJ
TlZBTDsKKworICAgICAgICBkID0gcmN1X2xvY2tfZG9tYWluX2J5X2lkKHJlc2VydmF0aW9uLmRv
bWlkKTsKKyAgICAgICAgaWYgKCBkID09IE5VTEwgKQorICAgICAgICAgICAgcmV0dXJuIC1FSU5W
QUw7CisKKyAgICAgICAgcmMgPSBkb21haW5fc2V0X3VuY2xhaW1lZF9wYWdlcyhkLCByZXNlcnZh
dGlvbi5ucl9leHRlbnRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
IHJlc2VydmF0aW9uLm1lbV9mbGFncyk7CisKKyAgICAgICAgcmN1X3VubG9ja19kb21haW4oZCk7
CisKKyAgICAgICAgYnJlYWs7CisKKyAgICBjYXNlIFhFTk1FTV9nZXRfdW5jbGFpbWVkX3BhZ2Vz
OgorICAgICAgICBpZiAoICFJU19QUklWKGN1cnJlbnQtPmRvbWFpbikgK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
ICAgICAgcGFnZWRfcGFnZXM7ICAgICAvKiBudW1iZXIgb2YgcGFnZWQtb3V0IHBhZ2VzICAgICAg
ICAgICovCg==
--__135343106902782846abhmt104.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__135343106902782846abhmt104.oracle.com--


From xen-devel-bounces@lists.xen.org Tue Nov 20 17:04:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:04:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarFZ-0008Fx-Ca; Tue, 20 Nov 2012 17:04:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TarFW-0008Fe-OL
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:04:39 +0000
Received: from [85.158.139.83:40509] by server-12.bemta-5.messagelabs.com id
	B3/86-02886-528BBA05; Tue, 20 Nov 2012 17:04:37 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1353431073!31194935!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNjQzMDU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14348 invoked from network); 20 Nov 2012 17:04:34 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-5.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 20 Nov 2012 17:04:34 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAKH4UKY026538
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 20 Nov 2012 17:04:30 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAKH4T8X016289
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 20 Nov 2012 17:04:29 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAKH4TX6001162; Tue, 20 Nov 2012 11:04:29 -0600
MIME-Version: 1.0
Message-ID: <9758ec2d-1d62-4426-ba59-204bed3acf6d@default>
Date: Tue, 20 Nov 2012 09:04:24 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__135343106902782846abhmt104.oracle.com"
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>, Matthew Daley <mattjd@gmail.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [RFC/PATCH v6 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__135343106902782846abhmt104.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This is patch 1of2 of a sixth cut of the patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account review
feedback from Jan and Keir and IanC and Matthew Daley, plus some
fixes found via runtime debugging (using printk and privcmd only).

v5->v6:
- Fix post-inc problem [mattjd]

v4->v5:
- Split tools part into separate patch [JBeulich]
- Minor coding style fixups [JBeulich]
- Use rcu_lock_domain_by_id, not _target version [JBeulich]

v3->v4: (please ignore v3)
- Process error, sent stale patch, sorry [djm]

v2->v3:
- Add per-domain and global "get" for unclaimed info [JBeulich]
- New hypercall(s) should fail for unpriv callers [IanC]
- Non-zero extent_order disallowed [JBeulich]
- Remove bonehead ASSERTs [JBeulich]
- Need not hold heaplock for decrease case too [JBeulich]
- More descriptive failure return values [JBeulich]
- Don't allow a claim to exceed max_pages [IanC]
- Subops must be in correct ifdef block in memory.c [keir]

v1->v2:
- Add reset-to-zero page claim in domain_kill [JBeulich]
- Proper handling of struct passed to hypercall [JBeulich]
- Fix alloc_heap_pages when a domain has a claim [JBeulich]
- Need not hold heap_lock if !d->unclaimed_pages [keir]
- Fix missed tot_pages call in donate_page [djm]
- Remove domain_reset_unclaimed_pages; use set with zero [djm]
- Bugfixes found through testing in set_unclaimed [djm]
- More comments in code [djm]
- Code formatting fixes [djm]

=3D=3D=3D

Motivation:

The goal of this hypercall is to attempt to atomically and very
quickly determine if there are sufficient pages available in the
system and, if so, "set aside" that quantity of pages for future
allocations by that domain.  Unlike an existing hypercall such as
increase_reservation or populate_physmap, specific physical
pageframes are not assigned to the domain because this
cannot be done sufficiently quickly (especially for very large
allocations in an arbitrarily fragmented system) and so the
existing mechanisms result in classic time-of-check-time-of-use
(TOCTOU) races.  One can think of claiming as similar to a
"lazy" allocation, but subsequent hypercalls are required
to do the actual physical pageframe allocation.

In order for a toolstack to "get" information about whether
a domain has a claim and, if so, how large, and also for
the toolstack to measure the total system-wide claim, a
second subop has been added and exposed through domctl
and libxl.

Built on top of this in the toolstack, I envision
a "xl create --claim" option to maximize backwards
compatibility while minimizing impact on existing toolstacks;
and perhaps an "xl free --claim" for the system-wide info.

It has been noted that this claim mechanism solves the
underlying problem (slow failure of domain creation) for
a large class of domains not not all, specifically not
handling (but also not making the problem worse for) PV
domains that specify the "superpages" flag, and 32-bit PV
domains on large RAM systems.  These may be addressed at a
later time.

Code overview:

Though the hypercall simply does arithmetic within locks,
some of the semantics in the code may be a bit subtle
so let me explain a bit.

The key variables (d->unclaimed_pages and total_unclaimed_pages)
start at zero if no claim has yet been staked for any domain.
(Perhaps a better name is "claimed_but_not_yet_possessed" but that's
a bit unwieldy.)  If no claim hypercalls are executed, there
should be no impact on existing usage.

When a claim is successfully staked by a domain, it is like a
watermark but there is no record kept of the size of the claim.
Instead, d->unclaimed_pages is set to the difference between
d->tot_pages and the claim.  When d->tot_pages increases or decreases,
d->unclaimed_pages atomically decreases or increases.  Once
d->unclaimed_pages reaches zero, the claim is satisfied and
d->unclaimed pages stays at zero -- unless a new claim is
subsequently staked.

The systemwide variable total_unclaimed_pages is always the sum
of d->unclaimed_pages, across all domains.  A non-domain-
specific heap allocation will fail if total_unclaimed_pages
exceeds free (plus, on tmem enabled systems, freeable) pages.

Claim semantics may be modified by flags.  The initial
implementation has one flag, which discerns whether the
caller would like tmem freeable pages to be considered
in determining whether or not the claim can be successfully
staked. Future flags may, for example, specify that the
caller would like the claim to be successful only if there
are sufficient pages available on a single node (per Dario's
suggestion).

A claim can be cancelled by requesting a claim of zero pages.

A second subop returns the total outstanding claimed pages
systemwide.

Note: Save/restore/migrate may need to be modified,
else it can be documented that all claims are cancelled.

Thanks for any feedback!

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 arch/x86/mm.c             |    2=20
 arch/x86/mm/mem_sharing.c |    4 -
 common/domain.c           |    1=20
 common/domctl.c           |    1=20
 common/grant_table.c      |    2=20
 common/memory.c           |   33 ++++++++++++
 common/page_alloc.c       |  118 +++++++++++++++++++++++++++++++++++++++++=
++++-
 include/public/domctl.h   |    3 -
 include/public/memory.h   |   39 +++++++++++++++
 include/xen/mm.h          |    7 ++
 include/xen/sched.h       |    1=20
 11 files changed, 203 insertions(+), 8 deletions(-)

diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index f2409ec..118f24a 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -36,7 +36,7 @@
 #include "grant_table.h"
 #include "hvm/save.h"
=20
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000009
=20
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -95,6 +95,7 @@ struct xen_domctl_getdomaininfo {
     uint32_t flags;              /* XEN_DOMINF_* */
     uint64_aligned_t tot_pages;
     uint64_aligned_t max_pages;
+    uint64_aligned_t unclaimed_pages;
     uint64_aligned_t shr_pages;
     uint64_aligned_t paged_pages;
     uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fad3d33..7e55908 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3841,7 +3841,7 @@ int donate_page(
     {
         if ( d->tot_pages >=3D d->max_pages )
             goto fail;
-        d->tot_pages++;
+        domain_increase_tot_pages(d, 1);
     }
=20
     page->count_info =3D PGC_allocated | 1;
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..943a3b5 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d,
     }
=20
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_decrease_tot_pages(d, 1);
     drop_dom_ref =3D (d->tot_pages =3D=3D 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct p=
age_info *page)
     ASSERT(page_get_owner(page) =3D=3D dom_cow);
     page_set_owner(page, d);
=20
-    if ( d->tot_pages++ =3D=3D 0 )
+    if ( domain_increase_tot_pages(d, 1) =3D=3D 1 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0e3e36a..95509e2 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -492,6 +492,7 @@ int domain_kill(struct domain *d)
         evtchn_destroy(d);
         gnttab_release_mappings(d);
         tmem_destroy(d->tmem);
+        domain_set_unclaimed_pages(d, 0, 0);
         d->tmem =3D NULL;
         /* fallthrough */
     case DOMDYING_dying:
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index e153cb4..19e3930 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -154,6 +154,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_=
getdomaininfo *info)
=20
     info->tot_pages         =3D d->tot_pages;
     info->max_pages         =3D d->max_pages;
+    info->unclaimed_pages   =3D d->unclaimed_pages;
     info->shr_pages         =3D atomic_read(&d->shr_pages);
     info->paged_pages       =3D atomic_read(&d->paged_pages);
     info->shared_info_frame =3D mfn_to_gmfn(d, __pa(d->shared_info)>>PAGE_=
SHIFT);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..10ce78f 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1656,7 +1656,7 @@ gnttab_transfer(
         }
=20
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ =3D=3D 0) )
+        if ( unlikely(domain_increase_tot_pages(e, 1) =3D=3D 1) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..adb7581 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_=
memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
=20
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -=3D dec_count;
+                domain_decrease_tot_pages(d, dec_count);
                 drop_dom_ref =3D (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
=20
@@ -685,6 +685,37 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_=
PARAM(void) arg)
         break;
     }
=20
+    case XENMEM_claim_pages:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+
+        if ( copy_from_guest(&reservation, arg, 1) )
+            return -EFAULT;
+
+        if ( !guest_handle_is_null(reservation.extent_start) )
+            return -EINVAL;
+
+        if ( reservation.extent_order !=3D 0 )
+            return -EINVAL;
+
+        d =3D rcu_lock_domain_by_id(reservation.domid);
+        if ( d =3D=3D NULL )
+            return -EINVAL;
+
+        rc =3D domain_set_unclaimed_pages(d, reservation.nr_extents,
+                                        reservation.mem_flags);
+
+        rcu_unlock_domain(d);
+
+        break;
+
+    case XENMEM_get_unclaimed_pages:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+
+        rc =3D get_total_unclaimed_pages();
+        break;
+
     default:
         rc =3D arch_memory_op(op, arg);
         break;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 15ebc66..3d9ef54 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -238,6 +238,111 @@ static long midsize_alloc_zone_pages;
 #define MIDSIZE_ALLOC_FRAC 128
=20
 static DEFINE_SPINLOCK(heap_lock);
+static long total_unclaimed_pages; /* total outstanding claims by all doma=
ins */
+
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
+
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages +=3D pages;
+    spin_lock(&heap_lock);
+    dom_before =3D d->unclaimed_pages;
+    dom_after =3D dom_before - pages;
+    if ( (dom_before > 0) && (dom_after < 0) )
+        dom_claimed =3D 0;
+    else
+        dom_claimed =3D dom_after;
+    sys_before =3D total_unclaimed_pages;
+    sys_after =3D sys_before - (dom_before - dom_claimed);
+    BUG_ON( (sys_before > 0) && (sys_after < 0) );
+    total_unclaimed_pages =3D sys_after;
+    d->unclaimed_pages =3D dom_claimed;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages -=3D pages;
+
+    spin_lock(&heap_lock);
+    d->tot_pages -=3D pages;
+    d->unclaimed_pages +=3D pages;
+    total_unclaimed_pages +=3D pages;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
+                                unsigned long flags)
+{
+    int ret =3D -ENOMEM;
+    unsigned long claim, avail_pages;
+
+    /*
+     * take the domain's page_alloc_lock, else all increases/decreases
+     * must always take the global heap_lock rather than only in the much
+     * rarer case that d->unclaimed_pages is non-zero
+     */
+    spin_lock(&d->page_alloc_lock);
+    spin_lock(&heap_lock);
+
+    /* pages=3D=3D0 means "unset" the claim (and flags is ignored) */
+    if ( pages =3D=3D 0 )
+    {
+        total_unclaimed_pages -=3D d->unclaimed_pages;
+        d->unclaimed_pages =3D 0;
+        ret =3D 0;
+        goto out;
+    }
+
+    /* only one active claim per domain please */
+    if ( d->unclaimed_pages )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* disallow a claim not exceeding current tot_pages or above max_pages=
 */
+    if ( (pages <=3D d->tot_pages) || (pages > d->max_pages) )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* how much memory is available? */
+    avail_pages =3D total_avail_pages;
+    if ( !(flags & XENMEM_CLAIMF_free_only) )
+        avail_pages +=3D tmem_freeable_pages();
+    avail_pages -=3D total_unclaimed_pages;
+
+    /*
+     * note, if domain has already allocated memory before making a claim=
=20
+     * then the claim must take tot_pages into account
+     */
+    claim =3D pages - d->tot_pages;
+    if ( claim > avail_pages )
+        goto out;
+
+    /* yay, claim fits in available memory, stake the claim, success! */
+    d->unclaimed_pages =3D claim;
+    total_unclaimed_pages +=3D d->unclaimed_pages;
+    ret =3D 0;
+
+out:
+    spin_unlock(&heap_lock);
+    spin_unlock(&d->page_alloc_lock);
+    return ret;
+}
+
+long get_total_unclaimed_pages(void)
+{
+    return total_unclaimed_pages;
+}
=20
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
@@ -443,6 +548,15 @@ static struct page_info *alloc_heap_pages(
     spin_lock(&heap_lock);
=20
     /*
+     * Claimed memory is considered unavailable unless the request
+     * is made by a domain with sufficient unclaimed pages.
+     */
+    if ( (total_unclaimed_pages + request >
+          total_avail_pages + tmem_freeable_pages()) &&
+          (d =3D=3D NULL || d->unclaimed_pages < request) )
+        goto not_found;
+
+    /*
      * TMEM: When available memory is scarce due to tmem absorbing it, all=
ow
      * only mid-size allocations to avoid worst of fragmentation issues.
      * Others try tmem pools then fail.  This is a workaround until all
@@ -1291,7 +1405,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages =3D=3D 0) )
             get_knownalive_domain(d);
=20
-        d->tot_pages +=3D 1 << order;
+        domain_increase_tot_pages(d, 1 << order);
     }
=20
     for ( i =3D 0; i < (1 << order); i++ )
@@ -1375,7 +1489,7 @@ void free_domheap_pages(struct page_info *pg, unsigne=
d int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
=20
-        d->tot_pages -=3D 1 << order;
+        domain_decrease_tot_pages(d, 1 << order);
         drop_dom_ref =3D (d->tot_pages =3D=3D 0);
=20
         spin_unlock_recursive(&d->page_alloc_lock);
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index f1ddbc0..15d6c72 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -68,6 +68,8 @@ struct xen_memory_reservation {
      *   IN:  GPFN bases of extents to populate with memory
      *   OUT: GMFN bases of extents that were allocated
      *   (NB. This command also updates the mach_to_phys translation table=
)
+     * XENMEM_claim_pages:
+     *   IN: must be zero
      */
     XEN_GUEST_HANDLE(xen_pfn_t) extent_start;
=20
@@ -421,6 +423,43 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
=20
+/*
+ * Attempt to stake a claim for a domain on a quantity of pages
+ * of system RAM, but _not_ assign specific pageframes.  Only
+ * arithmetic is performed so the hypercall is very fast and need
+ * not be preemptible, thus sidestepping time-of-check-time-of-use
+ * races for memory allocation.  Returns 0 if the hypervisor page
+ * allocator has atomically and successfully claimed the requested
+ * number of pages, else non-zero.
+ *
+ * Any domain may have only one active claim.  When sufficient memory
+ * has been allocated to resolve the claim, the claim silently expires.
+ * Claiming zero pages effectively resets any outstanding claim and
+ * is always successful.
+ *
+ * Note that a valid claim may be staked even after memory has been
+ * allocated for a domain.  In this case, the claim is not incremental,
+ * i.e. if the domain's tot_pages is 3, and a claim is staked for 10,
+ * only 7 additional pages are claimed.
+ *
+ * Caller must be privileged or the hypercall fails.
+ */
+#define XENMEM_claim_pages                  24
+/*
+ * XENMEM_claim_pages flags:
+ *  free_only: claim is successful only if sufficient free pages
+ *    are available.  If not set and tmem is enabled, hypervisor
+ *    may also consider tmem "freeable" pages to satisfy the claim.
+ */
+#define _XENMEM_CLAIMF_free_only            0
+#define XENMEM_CLAIMF_free_only             (1U<<_XENMEM_CLAIMF_free_only)
+/*
+ * Get the number of pages currently claimed (but not yet "possessed")
+ * across all domains.  The caller must be privileged but otherwise
+ * the call never fails.=20
+ */
+#define XENMEM_get_unclaimed_pages            25
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
=20
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 64a0cc1..b4dee92 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,13 @@ void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
=20
+/* Claim handling */
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges);
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges);
+int domain_set_unclaimed_pages(
+    struct domain *d, unsigned long pages, unsigned long flags);
+long get_total_unclaimed_pages(void);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..480ef39 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -242,6 +242,7 @@ struct domain
     struct page_list_head page_list;  /* linked list */
     struct page_list_head xenpage_list; /* linked list (size xenheap_pages=
) */
     unsigned int     tot_pages;       /* number of pages currently possese=
d */
+    unsigned int     unclaimed_pages; /* pages claimed but not possessed  =
  */
     unsigned int     max_pages;       /* maximum value for tot_pages      =
  */
     atomic_t         shr_pages;       /* number of shared pages           =
  */
     atomic_t         paged_pages;     /* number of paged-out pages        =
  */

--__135343106902782846abhmt104.oracle.com
Content-Type: application/octet-stream; name="claim-hyp-121120.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-hyp-121120.patch"

ZGlmZiAtLWdpdCBhL3hlbi9hcmNoL3g4Ni9tbS5jIGIveGVuL2FyY2gveDg2L21tLmMKaW5kZXgg
ZmFkM2QzMy4uN2U1NTkwOCAxMDA2NDQKLS0tIGEveGVuL2FyY2gveDg2L21tLmMKKysrIGIveGVu
L2FyY2gveDg2L21tLmMKQEAgLTM4NDEsNyArMzg0MSw3IEBAIGludCBkb25hdGVfcGFnZSgKICAg
ICB7CiAgICAgICAgIGlmICggZC0+dG90X3BhZ2VzID49IGQtPm1heF9wYWdlcyApCiAgICAgICAg
ICAgICBnb3RvIGZhaWw7Ci0gICAgICAgIGQtPnRvdF9wYWdlcysrOworICAgICAgICBkb21haW5f
aW5jcmVhc2VfdG90X3BhZ2VzKGQsIDEpOwogICAgIH0KIAogICAgIHBhZ2UtPmNvdW50X2luZm8g
PSBQR0NfYWxsb2NhdGVkIHwgMTsKZGlmZiAtLWdpdCBhL3hlbi9hcmNoL3g4Ni9tbS9tZW1fc2hh
cmluZy5jIGIveGVuL2FyY2gveDg2L21tL21lbV9zaGFyaW5nLmMKaW5kZXggNTEwMzI4NS4uM2Qy
OWUzNSAxMDA2NDQKLS0tIGEveGVuL2FyY2gveDg2L21tL21lbV9zaGFyaW5nLmMKKysrIGIveGVu
L2FyY2gveDg2L21tL21lbV9zaGFyaW5nLmMKQEAgLTYzOSw3ICs2MzksNyBAQCBzdGF0aWMgaW50
IHBhZ2VfbWFrZV9zaGFyYWJsZShzdHJ1Y3QgZG9tYWluICpkLAogICAgIH0KIAogICAgIHBhZ2Vf
c2V0X293bmVyKHBhZ2UsIGRvbV9jb3cpOwotICAgIGQtPnRvdF9wYWdlcy0tOworICAgIGRvbWFp
bl9kZWNyZWFzZV90b3RfcGFnZXMoZCwgMSk7CiAgICAgZHJvcF9kb21fcmVmID0gKGQtPnRvdF9w
Y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vdF9wYWdlcyk7CiAgICAgICAg
ICAgICAgICAgc3Bpbl91bmxvY2soJmQtPnBhZ2VfYWxsb2NfbG9jayk7CiAKQEAgLTY4NSw2ICs2
ODUsMzcgQEAgbG9uZyBkb19tZW1vcnlfb3AodW5zaWduZWQgbG9uZyBjbWQsIFhFTl9HVUVTVF9I
QU5ETEVfUEFSQU0odm9pZCkgYXJnKQogICAgICAgICBicmVhazsKICAgICB9CiAKKyAgICBjYXNl
IFhFTk1FTV9jbGFpbV9wYWdlczoKKyAgICAgICAgaWYgKCAhSVNfUFJJVihjdXJyZW50LT5kb21h
aW4pICkKKyAgICAgICAgICAgIHJldHVybiAtRVBFUk07CisKKyAgICAgICAgaWYgKCBjb3B5X2Zy
b21fZ3Vlc3QoJnJlc2VydmF0aW9uLCBhcmcsIDEpICkKKyAgICAgICAgICAgIHJldHVybiAtRUZB
VUxUOworCisgICAgICAgIGlmICggIWd1ZXN0X2hhbmRsZV9pc19udWxsKHJlc2VydmF0aW9uLmV4
dGVudF9zdGFydCkgKQorICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisKKyAgICAgICAgaWYg
KCByZXNlcnZhdGlvbi5leHRlbnRfb3JkZXIgIT0gMCApCisgICAgICAgICAgICByZXR1cm4gLUVJ
TlZBTDsKKworICAgICAgICBkID0gcmN1X2xvY2tfZG9tYWluX2J5X2lkKHJlc2VydmF0aW9uLmRv
bWlkKTsKKyAgICAgICAgaWYgKCBkID09IE5VTEwgKQorICAgICAgICAgICAgcmV0dXJuIC1FSU5W
QUw7CisKKyAgICAgICAgcmMgPSBkb21haW5fc2V0X3VuY2xhaW1lZF9wYWdlcyhkLCByZXNlcnZh
dGlvbi5ucl9leHRlbnRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
IHJlc2VydmF0aW9uLm1lbV9mbGFncyk7CisKKyAgICAgICAgcmN1X3VubG9ja19kb21haW4oZCk7
CisKKyAgICAgICAgYnJlYWs7CisKKyAgICBjYX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gMDsKKyAgICAgICAgcmV0ID0gMDsKKyAgICAgICAgZ290byBvdXQ7
CisgICAgfQorCisgICAgLyogb25seSBvbmUgYWN0aXZlIGNsYWltIHBlciBkb21haW4gcGxlYXNl
ICovCisgICAgaWYgKCBkLT51bmNsYWltZWRfcGFnZXMgKQorICAgIHsKKyAgICAgICAgcmV0ID0g
LUVJTlZBTDsKKyAgICAgICAgZ290byBvdXQ7CisgICAgfQorCisgICAgLyogZGlzYWxsb3cgYSBj
bGFpbSBub3QgZXhjZWVkaW5nIGN1cnJlbnQgdG90X3BhZ2VzIG9yIGFib3ZlIG1heF9wYWdlcyAq
LworICAgIGlmICggKHBhZ2VzIDw9IGQtPnRvdF9wYWdlcykgfHwgKHBhZ2VzID4gZC0+bWF4X3Bh
Z2VzKSApCisgICAgeworICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICBnb3RvIG91dDsK
KyAgICB9CisKKyAgICAvKiBob3cgbXVjaCBtZW1vcnkgaXMgYXZhaWxhYmxlPyAqLworICAgIGF2
YWlsX3BhZ2VzID0gdG90YWxfYXZhaWxfcGFnZXM7CisgICAgaWYgKCAhKGZsYWdzICYgWEVOTUVN
X0NMQUlNRl9mcmVlX29ubHkpICkKKyAgICAgICAgYXZhaWxfcGFnZXMgKz0gdG1lbV9mcmVlYWJs
ZV9wYWdlcygpOworICAgIGF2YWlsX3BhZ2VzIC09IHRvdGFsX3VuY2xhaW1lZF9wYWdlczsKKwor
ICAgIC8qCisgICAgICogbm90ZSwgaWYgZG9tYWluIGhhcyBhbHJlYWR5IGFsbG9jYXRlZCBtZW1v
cnkgYmVmb3JlIG1ha2luZyBhIGNsYWltIAorICAgICAqIHRoZW4gdGhlIGNsYWltIG11c3QgdGFr
ZSB0b3RfcGFnZXMgaW50byBhY2NvdW50CisgICAgICovCisgICAgY2xhaW0gPSBwYWdlcyAtIGQt
PnRvdF9wYWdlczsKKyAgICBpZiAoIGNsYWltID4gYXZhaWxfcGFnZXMgKQorICAgICAgICBn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ICAgIHNocl9wYWdlczsgICAgICAg
LyogbnVtYmVyIG9mIHNoYXJlZCBwYWdlcyAgICAgICAgICAgICAqLwogICAgIGF0b21pY190ICAg
ICAgICAgcGFnZWRfcGFnZXM7ICAgICAvKiBudW1iZXIgb2YgcGFnZWQtb3V0IHBhZ2VzICAgICAg
ICAgICovCg==
--__135343106902782846abhmt104.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__135343106902782846abhmt104.oracle.com--


From xen-devel-bounces@lists.xen.org Tue Nov 20 17:04:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:04:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarFX-0008Fp-Vo; Tue, 20 Nov 2012 17:04:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TarFW-0008Ff-Ls
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:04:38 +0000
Received: from [193.109.254.147:32054] by server-10.bemta-14.messagelabs.com
	id A3/8B-31741-628BBA05; Tue, 20 Nov 2012 17:04:38 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1353431075!1266938!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNjQzMDU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1456 invoked from network); 20 Nov 2012 17:04:36 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-7.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 20 Nov 2012 17:04:36 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAKH4Wld026584
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 20 Nov 2012 17:04:33 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAKH4VpE027325
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 20 Nov 2012 17:04:31 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAKH4UmR020913; Tue, 20 Nov 2012 11:04:31 -0600
MIME-Version: 1.0
Message-ID: <fa78cbff-7082-4126-a293-626570b52a60@default>
Date: Tue, 20 Nov 2012 09:04:27 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__135343107080282847abhmt104.oracle.com"
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>, Matthew Daley <mattjd@gmail.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [RFC/PATCH v6 2/2] tools: XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__135343107080282847abhmt104.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This is patch 2of2 of a sixth cut of the patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account
feedback from Jan and Keir and IanC and Matthew Daley.

As requested by Jan, this is a separate post of the tools
part of the patch.  NOTE: This patch must be applied after
the hypervisor part of the patchset or otherwise may break
the build!

v5->v6:
- no change in this patch (only in patch 1of2)

Thanks for any feedback!

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 xc_domain.c |    1 +
 xenctrl.h   |    1 +
 2 files changed, 2 insertions(+)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index d98e68b..6d06f7c 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -234,6 +234,7 @@ int xc_domain_getinfo(xc_interface *xch,
=20
         info->ssidref  =3D domctl.u.getdomaininfo.ssidref;
         info->nr_pages =3D domctl.u.getdomaininfo.tot_pages;
+        info->nr_unclaimed_pages =3D domctl.u.getdomaininfo.unclaimed_page=
s;
         info->nr_shared_pages =3D domctl.u.getdomaininfo.shr_pages;
         info->nr_paged_pages =3D domctl.u.getdomaininfo.paged_pages;
         info->max_memkb =3D domctl.u.getdomaininfo.max_pages << (PAGE_SHIF=
T-10);
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..325f4a3 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -364,6 +364,7 @@ typedef struct xc_dominfo {
                   hvm:1, debugged:1;
     unsigned int  shutdown_reason; /* only meaningful if shutdown=3D=3D1 *=
/
     unsigned long nr_pages; /* current number, not maximum */
+    unsigned long nr_unclaimed_pages;
     unsigned long nr_shared_pages;
     unsigned long nr_paged_pages;
     unsigned long shared_info_frame;

--__135343107080282847abhmt104.oracle.com
Content-Type: application/octet-stream; name="claim-tools-121120.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-tools-121120.patch"

ZGlmZiAtLWdpdCBhL3Rvb2xzL2xpYnhjL3hjX2RvbWFpbi5jIGIvdG9vbHMvbGlieGMveGNfZG9t
YWluLmMKaW5kZXggZDk4ZTY4Yi4uNmQwNmY3YyAxMDA2NDQKLS0tIGEvdG9vbHMvbGlieGMveGNf
ZG9tYWluLmMKKysrIGIvdG9vbHMvbGlieGMveGNfZG9tYWluLmMKQEAgLTIzNCw2ICsyMzQsNyBA
QCBpbnQgeGNfZG9tYWluX2dldGluZm8oeGNfaW50ZXJmYWNlICp4Y2gsCiAKICAgICAgICAgaW5m
by0+c3NpZHJlZiAgPSBkb21jdGwudS5nZXRkb21haW5pbmZvLnNzaWRyZWY7CiAgICAgICAgIGlu
Zm8tPm5yX3BhZ2VzID0gZG9tY3RsLnUuZ2V0ZG9tYWluaW5mby50b3RfcGFnZXM7CisgICAgICAg
IGluZm8tPm5yX3VuY2xhaW1lZF9wYWdlcyA9IGRvbWN0bC51LmdldGRvbWFpbmluZm8udW5jbGFp
bWVkX3BhZ2VzOwogICAgICAgICBpbmZvLT5ucl9zaGFyZWRfcGFnZXMgPSBkb21jdGwudS5nZXRk
b21haW5pbmZvLnNocl9wYWdlczsKICAgICAgICAgaW5mby0+bnJfcGFnZWRfcGFnZXMgPSBkb21j
dGwudS5nZXRkb21haW5pbmZvLnBhZ2VkX3BhZ2VzOwogICAgICAgICBpbmZvLT5tYXhfbWVta2Ig
PSBkb21jdGwudS5nZXRkb21haW5pbmZvLm1heF9wYWdlcyA8PCAoUEFHRV9TSElGVC0xMCk7CmRp
ZmYgLS1naXQgYS90b29scy9saWJ4Yy94ZW5jdHJsLmggYi90b29scy9saWJ4Yy94ZW5jdHJsLmgK
aW5kZXggN2ViNTc0My4uMzI1ZjRhMyAxMDA2NDQKLS0tIGEvdG9vbHMvbGlieGMveGVuY3RybC5o
CisrKyBiL3Rvb2xzL2xpYnhjL3hlbmN0cmwuaApAQCAtMzY0LDYgKzM2NCw3IEBAIHR5cGVkZWYg
c3RydWN0IHhjX2RvbWluZm8gewogICAgICAgICAgICAgICAgICAgaHZtOjEsIGRlYnVnZ2VkOjE7
CiAgICAgdW5zaWduZWQgaW50ICBzaHV0ZG93bl9yZWFzb247IC8qIG9ubHkgbWVhbmluZ2Z1bCBp
ZiBzaHV0ZG93bj09MSAqLwogICAgIHVuc2lnbmVkIGxvbmcgbnJfcGFnZXM7IC8qIGN1cnJlbnQg
bnVtYmVyLCBub3QgbWF4aW11bSAqLworICAgIHVuc2lnbmVkIGxvbmcgbnJfdW5jbGFpbWVkX3Bh
Z2VzOwogICAgIHVuc2lnbmVkIGxvbmcgbnJfc2hhcmVkX3BhZ2VzOwogICAgIHVuc2lnbmVkIGxv
bmcgbnJfcGFnZWRfcGFnZXM7CiAgICAgdW5zaWduZWQgbG9uZyBzaGFyZWRfaW5mb19mcmFtZTsK
--__135343107080282847abhmt104.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__135343107080282847abhmt104.oracle.com--


From xen-devel-bounces@lists.xen.org Tue Nov 20 17:04:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:04:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarFX-0008Fp-Vo; Tue, 20 Nov 2012 17:04:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TarFW-0008Ff-Ls
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:04:38 +0000
Received: from [193.109.254.147:32054] by server-10.bemta-14.messagelabs.com
	id A3/8B-31741-628BBA05; Tue, 20 Nov 2012 17:04:38 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1353431075!1266938!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNjQzMDU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1456 invoked from network); 20 Nov 2012 17:04:36 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-7.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 20 Nov 2012 17:04:36 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAKH4Wld026584
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 20 Nov 2012 17:04:33 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAKH4VpE027325
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 20 Nov 2012 17:04:31 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAKH4UmR020913; Tue, 20 Nov 2012 11:04:31 -0600
MIME-Version: 1.0
Message-ID: <fa78cbff-7082-4126-a293-626570b52a60@default>
Date: Tue, 20 Nov 2012 09:04:27 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__135343107080282847abhmt104.oracle.com"
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>, Matthew Daley <mattjd@gmail.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [RFC/PATCH v6 2/2] tools: XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__135343107080282847abhmt104.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This is patch 2of2 of a sixth cut of the patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account
feedback from Jan and Keir and IanC and Matthew Daley.

As requested by Jan, this is a separate post of the tools
part of the patch.  NOTE: This patch must be applied after
the hypervisor part of the patchset or otherwise may break
the build!

v5->v6:
- no change in this patch (only in patch 1of2)

Thanks for any feedback!

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 xc_domain.c |    1 +
 xenctrl.h   |    1 +
 2 files changed, 2 insertions(+)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index d98e68b..6d06f7c 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -234,6 +234,7 @@ int xc_domain_getinfo(xc_interface *xch,
=20
         info->ssidref  =3D domctl.u.getdomaininfo.ssidref;
         info->nr_pages =3D domctl.u.getdomaininfo.tot_pages;
+        info->nr_unclaimed_pages =3D domctl.u.getdomaininfo.unclaimed_page=
s;
         info->nr_shared_pages =3D domctl.u.getdomaininfo.shr_pages;
         info->nr_paged_pages =3D domctl.u.getdomaininfo.paged_pages;
         info->max_memkb =3D domctl.u.getdomaininfo.max_pages << (PAGE_SHIF=
T-10);
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..325f4a3 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -364,6 +364,7 @@ typedef struct xc_dominfo {
                   hvm:1, debugged:1;
     unsigned int  shutdown_reason; /* only meaningful if shutdown=3D=3D1 *=
/
     unsigned long nr_pages; /* current number, not maximum */
+    unsigned long nr_unclaimed_pages;
     unsigned long nr_shared_pages;
     unsigned long nr_paged_pages;
     unsigned long shared_info_frame;

--__135343107080282847abhmt104.oracle.com
Content-Type: application/octet-stream; name="claim-tools-121120.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-tools-121120.patch"

ZGlmZiAtLWdpdCBhL3Rvb2xzL2xpYnhjL3hjX2RvbWFpbi5jIGIvdG9vbHMvbGlieGMveG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zaWduZWQgaW50ICBzaHV0ZG93bl9yZWFzb247IC8qIG9ubHkgbWVhbmluZ2Z1bCBp
ZiBzaHV0ZG93bj09MSAqLwogICAgIHVuc2lnbmVkIGxvbmcgbnJfcGFnZXM7IC8qIGN1cnJlbnQg
bnVtYmVyLCBub3QgbWF4aW11bSAqLworICAgIHVuc2lnbmVkIGxvbmcgbnJfdW5jbGFpbWVkX3Bh
Z2VzOwogICAgIHVuc2lnbmVkIGxvbmcgbnJfc2hhcmVkX3BhZ2VzOwogICAgIHVuc2lnbmVkIGxv
bmcgbnJfcGFnZWRfcGFnZXM7CiAgICAgdW5zaWduZWQgbG9uZyBzaGFyZWRfaW5mb19mcmFtZTsK
--__135343107080282847abhmt104.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__135343107080282847abhmt104.oracle.com--


From xen-devel-bounces@lists.xen.org Tue Nov 20 17:07:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:07:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarHz-0008Ua-6E; Tue, 20 Nov 2012 17:07:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TarHx-0008UN-Nc
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:07:10 +0000
Received: from [85.158.143.35:63093] by server-2.bemta-4.messagelabs.com id
	82/92-28922-DB8BBA05; Tue, 20 Nov 2012 17:07:09 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-13.tower-21.messagelabs.com!1353431210!17875939!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23691 invoked from network); 20 Nov 2012 17:06:51 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-13.tower-21.messagelabs.com with SMTP;
	20 Nov 2012 17:06:51 -0000
X-TM-IMSS-Message-ID: <0a20c06600009afe@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 0a20c06600009afe ;
	Mon, 19 Nov 2012 16:31:55 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJLSNQG013605; 
	Mon, 19 Nov 2012 16:28:25 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Mon, 19 Nov 2012 16:28:22 -0500
Message-Id: <1353360502-27819-6-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH RFC 5/5] xen/xsm: include default hook action in
	name
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Include the default XSM hook action in the name of the hook in order to
allow quick understanding of how the call site is expected to be used
(dom0-only, arbitrary guest, or target-only).

Abbreviation explanation:
 xsm_dm_*      Usable only by device model (IS_PRIV_FOR)
 xsm_hook_*    No access check in dummy module. The calling code is
               either guest-accessible or covered by another check
 xsm_priv_*    Privileged command (IS_PRIV)
 xsm_target_*  Usable by guest or its device model targeted to the guest

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/cpu/mcheck/mce.c     |   2 +-
 xen/arch/x86/domctl.c             |  10 +-
 xen/arch/x86/hvm/hvm.c            |  26 +--
 xen/arch/x86/irq.c                |   2 +-
 xen/arch/x86/mm.c                 |  20 +-
 xen/arch/x86/mm/mem_event.c       |   4 +-
 xen/arch/x86/mm/mem_sharing.c     |   4 +-
 xen/arch/x86/mm/paging.c          |   2 +-
 xen/arch/x86/msi.c                |   2 +-
 xen/arch/x86/physdev.c            |  12 +-
 xen/arch/x86/platform_hypercall.c |  12 +-
 xen/arch/x86/sysctl.c             |   4 +-
 xen/arch/x86/traps.c              |   2 +-
 xen/common/domain.c               |   2 +-
 xen/common/domctl.c               |  10 +-
 xen/common/event_channel.c        |  14 +-
 xen/common/grant_table.c          |  16 +-
 xen/common/kexec.c                |   2 +-
 xen/common/memory.c               |   8 +-
 xen/common/schedule.c             |   2 +-
 xen/common/sysctl.c               |   6 +-
 xen/common/xenoprof.c             |   2 +-
 xen/drivers/char/console.c        |   2 +-
 xen/drivers/passthrough/iommu.c   |  10 +-
 xen/drivers/passthrough/pci.c     |   4 +-
 xen/include/xen/tmem_xen.h        |   4 +-
 xen/include/xsm/dummy.h           | 140 ++++++-------
 xen/include/xsm/xsm.h             | 428 +++++++++++++++++++-------------------
 xen/xsm/dummy.c                   | 150 ++++++-------
 xen/xsm/flask/hooks.c             | 296 +++++++++++++-------------
 30 files changed, 599 insertions(+), 599 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 658774a..72f6f18 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1293,7 +1293,7 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
     struct xen_mc_msrinject *mc_msrinject;
     struct xen_mc_mceinject *mc_mceinject;
 
-    ret = xsm_do_mca();
+    ret = xsm_priv_do_mca();
     if ( ret )
         return x86_mcerr(NULL, ret);
 
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 2630bdb..9541ef8 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -76,7 +76,7 @@ long arch_do_domctl(
 
         if ( np == 0 )
             ret = 0;
-        else if ( xsm_ioport_permission(d, fp, fp + np - 1, allow) )
+        else if ( xsm_hook_ioport_permission(d, fp, fp + np - 1, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = ioports_permit_access(d, fp, fp + np - 1);
@@ -566,7 +566,7 @@ long arch_do_domctl(
         if ( !is_hvm_domain(d) )
             break;
 
-        ret = xsm_bind_pt_irq(d, bind);
+        ret = xsm_hook_bind_pt_irq(d, bind);
         if ( ret )
             break;
 
@@ -599,7 +599,7 @@ long arch_do_domctl(
              !irq_access_permitted(current->domain, bind->machine_irq) )
             break;
 
-        ret = xsm_unbind_pt_irq(d, bind);
+        ret = xsm_hook_unbind_pt_irq(d, bind);
         if ( ret )
             break;
 
@@ -634,7 +634,7 @@ long arch_do_domctl(
              !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
             break;
 
-        ret = xsm_iomem_mapping(d, mfn, mfn + nr_mfns - 1, add);
+        ret = xsm_hook_iomem_mapping(d, mfn, mfn + nr_mfns - 1, add);
         if ( ret )
             break;
 
@@ -712,7 +712,7 @@ long arch_do_domctl(
              !ioports_access_permitted(current->domain, fmp, fmp + np - 1) )
             break;
 
-        ret = xsm_ioport_mapping(d, fmp, fmp + np - 1, add);
+        ret = xsm_hook_ioport_mapping(d, fmp, fmp + np - 1, add);
         if ( ret )
             break;
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 5bdde8d..e75c139 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3400,7 +3400,7 @@ static int hvmop_set_pci_intx_level(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_set_pci_intx_level(d);
+    rc = xsm_dm_hvm_set_pci_intx_level(d);
     if ( rc )
         goto out;
 
@@ -3567,7 +3567,7 @@ static int hvmop_set_isa_irq_level(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_set_isa_irq_level(d);
+    rc = xsm_dm_hvm_set_isa_irq_level(d);
     if ( rc )
         goto out;
 
@@ -3611,7 +3611,7 @@ static int hvmop_set_pci_link_route(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_set_pci_link_route(d);
+    rc = xsm_dm_hvm_set_pci_link_route(d);
     if ( rc )
         goto out;
 
@@ -3641,7 +3641,7 @@ static int hvmop_inject_msi(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_inject_msi(d);
+    rc = xsm_dm_hvm_inject_msi(d);
     if ( rc )
         goto out;
 
@@ -3738,7 +3738,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail;
 
@@ -3984,7 +3984,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail2;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail2;
 
@@ -4023,7 +4023,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail3;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail3;
 
@@ -4069,7 +4069,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail_getmemtype;
 
@@ -4124,7 +4124,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail4;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail4;
 
@@ -4203,7 +4203,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail5;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail5;
 
@@ -4238,7 +4238,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail6;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail6;
 
@@ -4274,7 +4274,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) || !paging_mode_shadow(d) )
             goto param_fail7;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail7;
 
@@ -4328,7 +4328,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail8;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail8;
 
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 238600a..ba8a5ce 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1874,7 +1874,7 @@ int map_domain_pirq(
         return 0;
     }
 
-    ret = xsm_map_domain_pirq(d, irq, data);
+    ret = xsm_hook_map_domain_pirq(d, irq, data);
     if ( ret )
     {
         dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq %d mapping to pirq %d\n",
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 39b2cc7..1dbe4ef 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2715,7 +2715,7 @@ long do_mmuext_op(
         goto out;
     }
 
-    rc = xsm_mmuext_op(d, pg_owner);
+    rc = xsm_target_mmuext_op(d, pg_owner);
     if ( rc )
     {
         rcu_unlock_domain(pg_owner);
@@ -2787,7 +2787,7 @@ long do_mmuext_op(
                 break;
             }
 
-            if ( (rc = xsm_memory_pin_page(d, pg_owner, page)) != 0 )
+            if ( (rc = xsm_hook_memory_pin_page(d, pg_owner, page)) != 0 )
             {
                 put_page_and_type(page);
                 okay = 0;
@@ -3244,7 +3244,7 @@ long do_mmu_update(
             }
             if ( xsm_needed != xsm_checked )
             {
-                rc = xsm_mmu_update(d, pt_owner, pg_owner, xsm_needed);
+                rc = xsm_target_mmu_update(d, pt_owner, pg_owner, xsm_needed);
                 if ( rc )
                     break;
                 xsm_checked = xsm_needed;
@@ -3363,7 +3363,7 @@ long do_mmu_update(
             xsm_needed |= XSM_MMU_MACHPHYS_UPDATE;
             if ( xsm_needed != xsm_checked )
             {
-                rc = xsm_mmu_update(d, NULL, pg_owner, xsm_needed);
+                rc = xsm_target_mmu_update(d, NULL, pg_owner, xsm_needed);
                 if ( rc )
                     break;
                 xsm_checked = xsm_needed;
@@ -3931,7 +3931,7 @@ static int __do_update_va_mapping(
 
     perfc_incr(calls_to_update_va);
 
-    rc = xsm_update_va_mapping(d, pg_owner, val);
+    rc = xsm_target_update_va_mapping(d, pg_owner, val);
     if ( rc )
         return rc;
 
@@ -4402,7 +4402,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        if ( xsm_add_to_physmap(current->domain, d) )
+        if ( xsm_target_add_to_physmap(current->domain, d) )
         {
             rcu_unlock_domain(d);
             return -EPERM;
@@ -4441,7 +4441,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        rc = xsm_domain_memory_map(d);
+        rc = xsm_target_domain_memory_map(d);
         if ( rc )
         {
             rcu_unlock_domain(d);
@@ -4516,7 +4516,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         XEN_GUEST_HANDLE_PARAM(e820entry_t) buffer_param;
         unsigned int i;
 
-        rc = xsm_machine_memory_map();
+        rc = xsm_priv_machine_memory_map();
         if ( rc )
             return rc;
 
@@ -4600,9 +4600,9 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
             return -ESRCH;
 
         if ( op == XENMEM_set_pod_target )
-            rc = xsm_set_pod_target(d);
+            rc = xsm_priv_set_pod_target(d);
         else
-            rc = xsm_get_pod_target(d);
+            rc = xsm_priv_get_pod_target(d);
 
         if ( rc != 0 )
             goto pod_target_out_unlock;
diff --git a/xen/arch/x86/mm/mem_event.c b/xen/arch/x86/mm/mem_event.c
index c2b3670..3a7605c 100644
--- a/xen/arch/x86/mm/mem_event.c
+++ b/xen/arch/x86/mm/mem_event.c
@@ -449,7 +449,7 @@ int do_mem_event_op(int op, uint32_t domain, void *arg)
     if ( ret )
         return ret;
 
-    ret = xsm_mem_event_op(d, op);
+    ret = xsm_dm_mem_event_op(d, op);
     if ( ret )
         goto out;
 
@@ -502,7 +502,7 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
 {
     int rc;
 
-    rc = xsm_mem_event_control(d, mec->mode, mec->op);
+    rc = xsm_dm_mem_event_control(d, mec->mode, mec->op);
     if ( rc )
         return rc;
 
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 9229b83..57f02af 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1351,7 +1351,7 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( rc )
                 return rc;
 
-            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            rc = xsm_dm_mem_sharing_op(d, cd, mec->op);
             if ( rc )
             {
                 rcu_unlock_domain(cd);
@@ -1415,7 +1415,7 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( rc )
                 return rc;
 
-            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            rc = xsm_dm_mem_sharing_op(d, cd, mec->op);
             if ( rc )
             {
                 rcu_unlock_domain(cd);
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index ea44e39..1815696 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -678,7 +678,7 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
         return -EINVAL;
     }
 
-    rc = xsm_shadow_control(d, sc->op);
+    rc = xsm_hook_shadow_control(d, sc->op);
     if ( rc )
         return rc;
 
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index e48ad2e..4bad230 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1016,7 +1016,7 @@ int pci_restore_msi_state(struct pci_dev *pdev)
     if (!pdev)
         return -EINVAL;
 
-    ret = xsm_resource_setup_pci((pdev->seg << 16) | (pdev->bus << 8) | pdev->devfn);
+    ret = xsm_priv_resource_setup_pci((pdev->seg << 16) | (pdev->bus << 8) | pdev->devfn);
     if ( ret )
         return ret;
 
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 9c30245..a894c43 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -232,7 +232,7 @@ int physdev_unmap_pirq(domid_t domid, int pirq)
             goto free_domain;
     }
 
-    ret = xsm_unmap_domain_pirq(d, domain_pirq_to_irq(d, pirq));
+    ret = xsm_dm_unmap_domain_pirq(d, domain_pirq_to_irq(d, pirq));
     if ( ret )
         goto free_domain;
 
@@ -423,7 +423,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = xsm_apic(v->domain, cmd);
+        ret = xsm_priv_apic(v->domain, cmd);
         if ( ret )
             break;
         ret = ioapic_guest_read(apic.apic_physbase, apic.reg, &apic.value);
@@ -437,7 +437,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = xsm_apic(v->domain, cmd);
+        ret = xsm_priv_apic(v->domain, cmd);
         if ( ret )
             break;
         ret = ioapic_guest_write(apic.apic_physbase, apic.reg, apic.value);
@@ -453,7 +453,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         /* Use the APIC check since this dummy hypercall should still only
          * be called by the domain with access to program the ioapic */
-        ret = xsm_apic(v->domain, cmd);
+        ret = xsm_priv_apic(v->domain, cmd);
         if ( ret )
             break;
 
@@ -578,7 +578,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_pci_mmcfg_reserved: {
         struct physdev_pci_mmcfg_reserved info;
 
-        ret = xsm_resource_setup_misc();
+        ret = xsm_priv_resource_setup_misc();
         if ( ret )
             break;
 
@@ -632,7 +632,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( setup_gsi.gsi < 0 || setup_gsi.gsi >= nr_irqs_gsi )
             break;
 
-        ret = xsm_resource_setup_gsi(setup_gsi.gsi);
+        ret = xsm_priv_resource_setup_gsi(setup_gsi.gsi);
         if ( ret )
             break;
 
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index f267b8b..c4b20ea 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -72,7 +72,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     if ( op->interface_version != XENPF_INTERFACE_VERSION )
         return -EACCES;
 
-    ret = xsm_platform_op(op->cmd);
+    ret = xsm_priv_platform_op(op->cmd);
     if ( ret )
         return ret;
 
@@ -496,7 +496,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        ret = xsm_resource_plug_core();
+        ret = xsm_hook_resource_plug_core();
         if ( ret )
             break;
 
@@ -512,7 +512,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
             break;
         }
 
-        ret = xsm_resource_plug_core();
+        ret = xsm_hook_resource_plug_core();
         if ( ret )
             break;
 
@@ -525,7 +525,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        ret = xsm_resource_unplug_core();
+        ret = xsm_hook_resource_unplug_core();
         if ( ret )
             break;
 
@@ -554,7 +554,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_cpu_hotadd:
-        ret = xsm_resource_plug_core();
+        ret = xsm_hook_resource_plug_core();
         if ( ret )
             break;
 
@@ -564,7 +564,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_mem_hotadd:
-        ret = xsm_resource_plug_core();
+        ret = xsm_hook_resource_plug_core();
         if ( ret )
             break;
 
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index 5b0c4b7..3a10a13 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -184,14 +184,14 @@ long arch_do_sysctl(
         switch ( sysctl->u.cpu_hotplug.op )
         {
         case XEN_SYSCTL_CPU_HOTPLUG_ONLINE:
-            ret = xsm_resource_plug_core();
+            ret = xsm_hook_resource_plug_core();
             if ( ret )
                 break;
             ret = continue_hypercall_on_cpu(
                 0, cpu_up_helper, (void *)(unsigned long)cpu);
             break;
         case XEN_SYSCTL_CPU_HOTPLUG_OFFLINE:
-            ret = xsm_resource_unplug_core();
+            ret = xsm_hook_resource_unplug_core();
             if ( ret )
                 break;
             ret = continue_hypercall_on_cpu(
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 44a866e..695e991 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1643,7 +1643,7 @@ static int pci_cfg_ok(struct domain *d, int write, int size)
             start |= (d->arch.pci_cf8 >> 16) & 0xF00;
     }
     end = start + size - 1;
-    if (xsm_pci_config_permission(d, machine_bdf, start, end, write))
+    if (xsm_hook_pci_config_permission(d, machine_bdf, start, end, write))
         return 0;
     return 1;
 }
diff --git a/xen/common/domain.c b/xen/common/domain.c
index fcf24e2..296d735 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -252,7 +252,7 @@ struct domain *domain_create(
 
     if ( !is_idle_domain(d) )
     {
-        if ( (err = xsm_domain_create(d, ssidref)) != 0 )
+        if ( (err = xsm_hook_domain_create(d, ssidref)) != 0 )
             goto fail;
 
         d->is_paused_by_controller = 1;
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 6f792e9..1f88ad2 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -150,7 +150,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
     if ( is_hvm_domain(d) )
         info->flags |= XEN_DOMINF_hvm_guest;
 
-    xsm_security_domaininfo(d, info);
+    xsm_populate_security_domaininfo(d, info);
 
     info->tot_pages         = d->tot_pages;
     info->max_pages         = d->max_pages;
@@ -580,7 +580,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             break;
         }
 
-        ret = xsm_getdomaininfo(d);
+        ret = xsm_hook_getdomaininfo(d);
         if ( ret )
             goto getdomaininfo_out;
 
@@ -722,7 +722,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
         if ( pirq >= d->nr_pirqs )
             ret = -EINVAL;
-        else if ( xsm_irq_permission(d, pirq, allow) )
+        else if ( xsm_hook_irq_permission(d, pirq, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = irq_permit_access(d, pirq);
@@ -741,7 +741,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
             break;
 
-        if ( xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, allow) )
+        if ( xsm_hook_iomem_permission(d, mfn, mfn + nr_mfns - 1, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
@@ -773,7 +773,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             break;
         }
 
-        ret = xsm_set_target(d, e);
+        ret = xsm_hook_set_target(d, e);
         if ( ret ) {
             put_domain(e);
             break;
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 37947a9..ef0d89b 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -175,7 +175,7 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
         ERROR_EXIT_DOM(port, d);
     chn = evtchn_from_port(d, port);
 
-    rc = xsm_evtchn_unbound(d, chn, alloc->remote_dom);
+    rc = xsm_target_evtchn_unbound(d, chn, alloc->remote_dom);
     if ( rc )
         goto out;
 
@@ -231,7 +231,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
          (rchn->u.unbound.remote_domid != ld->domain_id) )
         ERROR_EXIT_DOM(-EINVAL, rd);
 
-    rc = xsm_evtchn_interdomain(ld, lchn, rd, rchn);
+    rc = xsm_hook_evtchn_interdomain(ld, lchn, rd, rchn);
     if ( rc )
         goto out;
 
@@ -535,7 +535,7 @@ static long __evtchn_close(struct domain *d1, int port1)
     chn1->state          = ECS_FREE;
     chn1->notify_vcpu_id = 0;
 
-    xsm_evtchn_close_post(chn1);
+    xsm_hook_evtchn_close_post(chn1);
 
  out:
     if ( d2 != NULL )
@@ -580,7 +580,7 @@ int evtchn_send(struct domain *d, unsigned int lport)
         return -EINVAL;
     }
 
-    ret = xsm_evtchn_send(ld, lchn);
+    ret = xsm_hook_evtchn_send(ld, lchn);
     if ( ret )
         goto out;
 
@@ -812,7 +812,7 @@ static long evtchn_status(evtchn_status_t *status)
 
     chn = evtchn_from_port(d, port);
 
-    rc = xsm_evtchn_status(d, chn);
+    rc = xsm_target_evtchn_status(d, chn);
     if ( rc )
         goto out;
 
@@ -954,7 +954,7 @@ static long evtchn_reset(evtchn_reset_t *r)
     if ( d == NULL )
         return -ESRCH;
 
-    rc = xsm_evtchn_reset(current->domain, d);
+    rc = xsm_target_evtchn_reset(current->domain, d);
     if ( rc )
         goto out;
 
@@ -1101,7 +1101,7 @@ int alloc_unbound_xen_event_channel(
         goto out;
     chn = evtchn_from_port(d, port);
 
-    rc = xsm_evtchn_unbound(d, chn, remote_domid);
+    rc = xsm_target_evtchn_unbound(d, chn, remote_domid);
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index eae9518..e3690b6 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -552,7 +552,7 @@ __gnttab_map_grant_ref(
         return;
     }
 
-    rc = xsm_grant_mapref(ld, rd, op->flags);
+    rc = xsm_hook_grant_mapref(ld, rd, op->flags);
     if ( rc )
     {
         rcu_unlock_domain(rd);
@@ -872,7 +872,7 @@ __gnttab_unmap_common(
         return;
     }
 
-    rc = xsm_grant_unmapref(ld, rd);
+    rc = xsm_hook_grant_unmapref(ld, rd);
     if ( rc )
     {
         rcu_unlock_domain(rd);
@@ -1326,7 +1326,7 @@ gnttab_setup_table(
         goto out2;
     }
 
-    if ( xsm_grant_setup(current->domain, d) )
+    if ( xsm_target_grant_setup(current->domain, d) )
     {
         op.status = GNTST_permission_denied;
         goto out2;
@@ -1395,7 +1395,7 @@ gnttab_query_size(
         goto query_out;
     }
 
-    rc = xsm_grant_query_size(current->domain, d);
+    rc = xsm_target_grant_query_size(current->domain, d);
     if ( rc )
     {
         op.status = GNTST_permission_denied;
@@ -1571,7 +1571,7 @@ gnttab_transfer(
             goto copyback;
         }
 
-        if ( xsm_grant_transfer(d, e) )
+        if ( xsm_hook_grant_transfer(d, e) )
         {
             put_gfn(d, gop.mfn);
             gop.status = GNTST_permission_denied;
@@ -2010,7 +2010,7 @@ __gnttab_copy(
         PIN_FAIL(error_out, GNTST_bad_domain,
                  "couldn't find %d\n", op->dest.domid);
 
-    rc = xsm_grant_copy(sd, dd);
+    rc = xsm_hook_grant_copy(sd, dd);
     if ( rc )
     {
         rc = GNTST_permission_denied;
@@ -2267,7 +2267,7 @@ gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop,
         op.status = GNTST_bad_domain;
         goto out1;
     }
-    rc = xsm_grant_setup(current->domain, d);
+    rc = xsm_target_grant_setup(current->domain, d);
     if ( rc ) {
         op.status = GNTST_permission_denied;
         goto out1;
@@ -2318,7 +2318,7 @@ gnttab_get_version(XEN_GUEST_HANDLE_PARAM(gnttab_get_version_t uop))
     if ( d == NULL )
         return -ESRCH;
 
-    rc = xsm_grant_query_size(current->domain, d);
+    rc = xsm_target_grant_query_size(current->domain, d);
     if ( rc )
     {
         rcu_unlock_domain(d);
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index d4f6332..ff9d205 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -852,7 +852,7 @@ static int do_kexec_op_internal(unsigned long op,
     unsigned long flags;
     int ret = -EINVAL;
 
-    ret = xsm_kexec();
+    ret = xsm_priv_kexec();
     if ( ret )
         return ret;
 
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 7d3c326..0e216bb 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -336,7 +336,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
         goto fail_early;
     }
 
-    rc = xsm_memory_exchange(d);
+    rc = xsm_target_memory_exchange(d);
     if ( rc )
     {
         rcu_unlock_domain(d);
@@ -585,7 +585,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return start_extent;
         args.domain = d;
 
-        rc = xsm_memory_adjust_reservation(current->domain, d);
+        rc = xsm_target_memory_adjust_reservation(current->domain, d);
         if ( rc )
         {
             rcu_unlock_domain(d);
@@ -634,7 +634,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        rc = xsm_memory_stat_reservation(current->domain, d);
+        rc = xsm_target_memory_stat_reservation(current->domain, d);
         if ( rc )
         {
             rcu_unlock_domain(d);
@@ -672,7 +672,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        if ( xsm_remove_from_physmap(current->domain, d) )
+        if ( xsm_target_remove_from_physmap(current->domain, d) )
         {
             rcu_unlock_domain(d);
             return -EPERM;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index cfd173d..2cad778 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -921,7 +921,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             break;
 
-        ret = xsm_schedop_shutdown(current->domain, d);
+        ret = xsm_dm_schedop_shutdown(current->domain, d);
         if ( ret )
         {
             rcu_unlock_domain(d);
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index cbefb0e..d6e3f6c 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -57,7 +57,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     {
     case XEN_SYSCTL_readconsole:
     {
-        ret = xsm_readconsole(op->u.readconsole.clear);
+        ret = xsm_hook_readconsole(op->u.readconsole.clear);
         if ( ret )
             break;
 
@@ -100,7 +100,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
             if ( num_domains == op->u.getdomaininfolist.max_domains )
                 break;
 
-            ret = xsm_getdomaininfo(d);
+            ret = xsm_hook_getdomaininfo(d);
             if ( ret )
                 continue;
 
@@ -231,7 +231,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         uint32_t *status, *ptr;
         unsigned long pfn;
 
-        ret = xsm_page_offline(op->u.page_offline.cmd);
+        ret = xsm_hook_page_offline(op->u.page_offline.cmd);
         if ( ret )
             break;
 
diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index ae0435b..7a82e3a 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -680,7 +680,7 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         return -EPERM;
     }
 
-    ret = xsm_profile(current->domain, op);
+    ret = xsm_hook_profile(current->domain, op);
     if ( ret )
         return ret;
 
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index b2c3ee3..b6faa43 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -406,7 +406,7 @@ long do_console_io(int cmd, int count, XEN_GUEST_HANDLE_PARAM(char) buffer)
     long rc;
     unsigned int idx, len;
 
-    rc = xsm_console_io(current->domain, cmd);
+    rc = xsm_priv_console_io(current->domain, cmd);
     if ( rc )
         return rc;
 
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 9d13185..52eff81 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -452,7 +452,7 @@ static int iommu_get_device_group(
              ((pdev->bus == bus) && (pdev->devfn == devfn)) )
             continue;
 
-        if ( xsm_get_device_group((seg << 16) | (pdev->bus << 8) | pdev->devfn) )
+        if ( xsm_hook_get_device_group((seg << 16) | (pdev->bus << 8) | pdev->devfn) )
             continue;
 
         sdev_id = ops->get_device_group_id(seg, pdev->bus, pdev->devfn);
@@ -555,7 +555,7 @@ int iommu_do_domctl(
         u32 max_sdevs;
         XEN_GUEST_HANDLE_64(uint32) sdevs;
 
-        ret = xsm_get_device_group(domctl->u.get_device_group.machine_sbdf);
+        ret = xsm_hook_get_device_group(domctl->u.get_device_group.machine_sbdf);
         if ( ret )
             break;
 
@@ -583,7 +583,7 @@ int iommu_do_domctl(
     break;
 
     case XEN_DOMCTL_test_assign_device:
-        ret = xsm_test_assign_device(domctl->u.assign_device.machine_sbdf);
+        ret = xsm_hook_test_assign_device(domctl->u.assign_device.machine_sbdf);
         if ( ret )
             break;
 
@@ -607,7 +607,7 @@ int iommu_do_domctl(
             break;
         }
 
-        ret = xsm_assign_device(d, domctl->u.assign_device.machine_sbdf);
+        ret = xsm_hook_assign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
             break;
 
@@ -626,7 +626,7 @@ int iommu_do_domctl(
         break;
 
     case XEN_DOMCTL_deassign_device:
-        ret = xsm_deassign_device(d, domctl->u.assign_device.machine_sbdf);
+        ret = xsm_hook_deassign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
             break;
 
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index d5ef4c1..43eceab 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -380,7 +380,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn, const struct pci_dev_info *info)
         pdev_type = "device";
     }
 
-    ret = xsm_resource_plug_pci((seg << 16) | (bus << 8) | devfn);
+    ret = xsm_priv_resource_plug_pci((seg << 16) | (bus << 8) | devfn);
     if ( ret )
         return ret;
 
@@ -496,7 +496,7 @@ int pci_remove_device(u16 seg, u8 bus, u8 devfn)
     struct pci_dev *pdev;
     int ret;
 
-    ret = xsm_resource_unplug_pci((seg << 16) | (bus << 8) | devfn);
+    ret = xsm_priv_resource_unplug_pci((seg << 16) | (bus << 8) | devfn);
     if ( ret )
         return ret;
 
diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h
index 8dec5aa..81d88f3 100644
--- a/xen/include/xen/tmem_xen.h
+++ b/xen/include/xen/tmem_xen.h
@@ -329,12 +329,12 @@ static inline bool_t tmh_set_client_from_id(
 
 static inline bool_t tmh_current_permitted(void)
 {
-    return !xsm_tmem_op();
+    return !xsm_hook_tmem_op();
 }
 
 static inline bool_t tmh_current_is_privileged(void)
 {
-    return !xsm_tmem_control();
+    return !xsm_priv_tmem_control();
 }
 
 static inline uint8_t tmh_get_first_byte(pfp_t *pfp)
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index aaac50d3..09ee3f2 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -11,23 +11,23 @@
 #include <xen/sched.h>
 #include <xsm/xsm.h>
 
-static XSM_INLINE void xsm_security_domaininfo(struct domain *d,
+static XSM_INLINE void xsm_populate_security_domaininfo(struct domain *d,
                                     struct xen_domctl_getdomaininfo *info)
 {
     return;
 }
 
-static XSM_INLINE int xsm_domain_create(struct domain *d, u32 ssidref)
+static XSM_INLINE int xsm_hook_domain_create(struct domain *d, u32 ssidref)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
+static XSM_INLINE int xsm_hook_getdomaininfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
+static XSM_INLINE int xsm_hook_set_target(struct domain *d, struct domain *e)
 {
     return 0;
 }
@@ -58,12 +58,12 @@ static XSM_INLINE int xsm_sysctl(int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_readconsole(uint32_t clear)
+static XSM_INLINE int xsm_hook_readconsole(uint32_t clear)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_do_mca(void)
+static XSM_INLINE int xsm_priv_do_mca(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
@@ -80,49 +80,49 @@ static XSM_INLINE void xsm_free_security_domain(struct domain *d)
     return;
 }
 
-static XSM_INLINE int xsm_grant_mapref(struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_hook_grant_mapref(struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_unmapref(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_hook_grant_unmapref(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_setup(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_grant_setup(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_transfer(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_hook_grant_transfer(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_copy(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_hook_grant_copy(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_query_size(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_grant_query_size(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_memory_exchange(struct domain *d)
+static XSM_INLINE int xsm_target_memory_exchange(struct domain *d)
 {
     if ( d != current->domain && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
+static XSM_INLINE int xsm_target_memory_adjust_reservation(struct domain *d1,
                                                             struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
@@ -130,14 +130,14 @@ static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
     return 0;
 }
 
-static XSM_INLINE int xsm_memory_stat_reservation(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_memory_stat_reservation(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_console_io(struct domain *d, int cmd)
+static XSM_INLINE int xsm_priv_console_io(struct domain *d, int cmd)
 {
 #ifndef VERBOSE
     if ( !IS_PRIV(current->domain) )
@@ -146,32 +146,32 @@ static XSM_INLINE int xsm_console_io(struct domain *d, int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_profile(struct domain *d, int op)
+static XSM_INLINE int xsm_hook_profile(struct domain *d, int op)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_kexec(void)
+static XSM_INLINE int xsm_priv_kexec(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_schedop_shutdown(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_dm_schedop_shutdown(struct domain *d1, struct domain *d2)
 {
     if ( !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_hook_memory_pin_page(struct domain *d1, struct domain *d2,
                                           struct page_info *page)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_evtchn_unbound(struct domain *d, struct evtchn *chn,
+static XSM_INLINE int xsm_target_evtchn_unbound(struct domain *d, struct evtchn *chn,
                                          domid_t id2)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
@@ -179,30 +179,30 @@ static XSM_INLINE int xsm_evtchn_unbound(struct domain *d, struct evtchn *chn,
     return 0;
 }
 
-static XSM_INLINE int xsm_evtchn_interdomain(struct domain *d1, struct evtchn
+static XSM_INLINE int xsm_hook_evtchn_interdomain(struct domain *d1, struct evtchn
                                 *chan1, struct domain *d2, struct evtchn *chan2)
 {
     return 0;
 }
 
-static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
+static XSM_INLINE void xsm_hook_evtchn_close_post(struct evtchn *chn)
 {
     return;
 }
 
-static XSM_INLINE int xsm_evtchn_send(struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_hook_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_evtchn_status(struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_target_evtchn_status(struct domain *d, struct evtchn *chn)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_evtchn_reset(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_evtchn_reset(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
@@ -224,96 +224,96 @@ static XSM_INLINE char * xsm_show_security_evtchn(struct domain *d, const struct
     return NULL;
 }
 
-static XSM_INLINE int xsm_get_pod_target(struct domain *d)
+static XSM_INLINE int xsm_priv_get_pod_target(struct domain *d)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_set_pod_target(struct domain *d)
+static XSM_INLINE int xsm_priv_set_pod_target(struct domain *d)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_get_device_group(uint32_t machine_bdf)
+static XSM_INLINE int xsm_hook_get_device_group(uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_test_assign_device(uint32_t machine_bdf)
+static XSM_INLINE int xsm_hook_test_assign_device(uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_hook_assign_device(struct domain *d, uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_hook_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_plug_core(void)
+static XSM_INLINE int xsm_hook_resource_plug_core(void)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_unplug_core(void)
+static XSM_INLINE int xsm_hook_resource_unplug_core(void)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_plug_pci(uint32_t machine_bdf)
+static XSM_INLINE int xsm_priv_resource_plug_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_unplug_pci(uint32_t machine_bdf)
+static XSM_INLINE int xsm_priv_resource_unplug_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_setup_pci(uint32_t machine_bdf)
+static XSM_INLINE int xsm_priv_resource_setup_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_setup_gsi(int gsi)
+static XSM_INLINE int xsm_priv_resource_setup_gsi(int gsi)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_setup_misc(void)
+static XSM_INLINE int xsm_priv_resource_setup_misc(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_page_offline(uint32_t cmd)
+static XSM_INLINE int xsm_hook_page_offline(uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_tmem_op(void)
+static XSM_INLINE int xsm_hook_tmem_op(void)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_tmem_control(void)
+static XSM_INLINE int xsm_priv_tmem_control(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
@@ -330,34 +330,34 @@ static XSM_INLINE char * xsm_show_irq_sid(int irq)
     return NULL;
 }
 
-static XSM_INLINE int xsm_map_domain_pirq(struct domain *d, int irq, void *data)
+static XSM_INLINE int xsm_hook_map_domain_pirq(struct domain *d, int irq, void *data)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_unmap_domain_pirq(struct domain *d, int irq)
+static XSM_INLINE int xsm_dm_unmap_domain_pirq(struct domain *d, int irq)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_irq_permission(struct domain *d, int pirq, uint8_t allow)
+static XSM_INLINE int xsm_hook_irq_permission(struct domain *d, int pirq, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_iomem_permission(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_hook_iomem_permission(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_iomem_mapping(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_hook_iomem_mapping(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_pci_config_permission(struct domain *d, uint32_t machine_bdf,
+static XSM_INLINE int xsm_hook_pci_config_permission(struct domain *d, uint32_t machine_bdf,
                                         uint16_t start, uint16_t end,
                                         uint8_t access)
 {
@@ -365,96 +365,96 @@ static XSM_INLINE int xsm_pci_config_permission(struct domain *d, uint32_t machi
 }
 
 #ifdef CONFIG_X86
-static XSM_INLINE int xsm_shadow_control(struct domain *d, uint32_t op)
+static XSM_INLINE int xsm_hook_shadow_control(struct domain *d, uint32_t op)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
+static XSM_INLINE int xsm_target_hvm_param(struct domain *d, unsigned long op)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_set_pci_intx_level(struct domain *d)
+static XSM_INLINE int xsm_dm_hvm_set_pci_intx_level(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_set_isa_irq_level(struct domain *d)
+static XSM_INLINE int xsm_dm_hvm_set_isa_irq_level(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_set_pci_link_route(struct domain *d)
+static XSM_INLINE int xsm_dm_hvm_set_pci_link_route(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
+static XSM_INLINE int xsm_dm_hvm_inject_msi(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_event_control(struct domain *d, int mode, int op)
+static XSM_INLINE int xsm_dm_mem_event_control(struct domain *d, int mode, int op)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_event_op(struct domain *d, int op)
+static XSM_INLINE int xsm_dm_mem_event_op(struct domain *d, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
+static XSM_INLINE int xsm_dm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, cd) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
+static XSM_INLINE int xsm_priv_apic(struct domain *d, int cmd)
 {
     if ( !IS_PRIV(d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_platform_op(uint32_t op)
+static XSM_INLINE int xsm_priv_platform_op(uint32_t op)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_machine_memory_map(void)
+static XSM_INLINE int xsm_priv_machine_memory_map(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_domain_memory_map(struct domain *d)
+static XSM_INLINE int xsm_target_domain_memory_map(struct domain *d)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_mmu_update(struct domain *d, struct domain *t,
+static XSM_INLINE int xsm_target_mmu_update(struct domain *d, struct domain *t,
                                      struct domain *f, uint32_t flags)
 {
     if ( t && d != t && !IS_PRIV_FOR(d, t) )
@@ -464,14 +464,14 @@ static XSM_INLINE int xsm_mmu_update(struct domain *d, struct domain *t,
     return 0;
 }
 
-static XSM_INLINE int xsm_mmuext_op(struct domain *d, struct domain *f)
+static XSM_INLINE int xsm_target_mmuext_op(struct domain *d, struct domain *f)
 {
     if ( d != f && !IS_PRIV_FOR(d, f) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f, 
+static XSM_INLINE int xsm_target_update_va_mapping(struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
     if ( d != f && !IS_PRIV_FOR(d, f) )
@@ -479,36 +479,36 @@ static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f,
     return 0;
 }
 
-static XSM_INLINE int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_add_to_physmap(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_hook_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_unbind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_hook_unbind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_hook_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_ioport_mapping(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_hook_ioport_mapping(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
 }
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 105201e..c3a29b6 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -39,30 +39,30 @@ extern xsm_initcall_t __xsm_initcall_start[], __xsm_initcall_end[];
     __used_section(".xsm_initcall.init") = fn
 
 struct xsm_operations {
-    void (*security_domaininfo) (struct domain *d,
+    void (*populate_security_domaininfo) (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info);
-    int (*domain_create) (struct domain *d, u32 ssidref);
-    int (*getdomaininfo) (struct domain *d);
-    int (*set_target) (struct domain *d, struct domain *e);
+    int (*hook_domain_create) (struct domain *d, u32 ssidref);
+    int (*hook_getdomaininfo) (struct domain *d);
+    int (*hook_set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
     int (*sysctl) (int cmd);
-    int (*readconsole) (uint32_t clear);
-    int (*do_mca) (void);
+    int (*hook_readconsole) (uint32_t clear);
+    int (*priv_do_mca) (void);
 
-    int (*evtchn_unbound) (struct domain *d, struct evtchn *chn, domid_t id2);
-    int (*evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
+    int (*target_evtchn_unbound) (struct domain *d, struct evtchn *chn, domid_t id2);
+    int (*hook_evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
                                         struct domain *d2, struct evtchn *chn2);
-    void (*evtchn_close_post) (struct evtchn *chn);
-    int (*evtchn_send) (struct domain *d, struct evtchn *chn);
-    int (*evtchn_status) (struct domain *d, struct evtchn *chn);
-    int (*evtchn_reset) (struct domain *d1, struct domain *d2);
-
-    int (*grant_mapref) (struct domain *d1, struct domain *d2, uint32_t flags);
-    int (*grant_unmapref) (struct domain *d1, struct domain *d2);
-    int (*grant_setup) (struct domain *d1, struct domain *d2);
-    int (*grant_transfer) (struct domain *d1, struct domain *d2);
-    int (*grant_copy) (struct domain *d1, struct domain *d2);
-    int (*grant_query_size) (struct domain *d1, struct domain *d2);
+    void (*hook_evtchn_close_post) (struct evtchn *chn);
+    int (*hook_evtchn_send) (struct domain *d, struct evtchn *chn);
+    int (*target_evtchn_status) (struct domain *d, struct evtchn *chn);
+    int (*target_evtchn_reset) (struct domain *d1, struct domain *d2);
+
+    int (*hook_grant_mapref) (struct domain *d1, struct domain *d2, uint32_t flags);
+    int (*hook_grant_unmapref) (struct domain *d1, struct domain *d2);
+    int (*target_grant_setup) (struct domain *d1, struct domain *d2);
+    int (*hook_grant_transfer) (struct domain *d1, struct domain *d2);
+    int (*hook_grant_copy) (struct domain *d1, struct domain *d2);
+    int (*target_grant_query_size) (struct domain *d1, struct domain *d2);
 
     int (*alloc_security_domain) (struct domain *d);
     void (*free_security_domain) (struct domain *d);
@@ -70,76 +70,76 @@ struct xsm_operations {
     void (*free_security_evtchn) (struct evtchn *chn);
     char *(*show_security_evtchn) (struct domain *d, const struct evtchn *chn);
 
-    int (*get_pod_target) (struct domain *d);
-    int (*set_pod_target) (struct domain *d);
-    int (*memory_exchange) (struct domain *d);
-    int (*memory_adjust_reservation) (struct domain *d1, struct domain *d2);
-    int (*memory_stat_reservation) (struct domain *d1, struct domain *d2);
-    int (*memory_pin_page) (struct domain *d1, struct domain *d2, struct page_info *page);
-    int (*remove_from_physmap) (struct domain *d1, struct domain *d2);
+    int (*priv_get_pod_target) (struct domain *d);
+    int (*priv_set_pod_target) (struct domain *d);
+    int (*target_memory_exchange) (struct domain *d);
+    int (*target_memory_adjust_reservation) (struct domain *d1, struct domain *d2);
+    int (*target_memory_stat_reservation) (struct domain *d1, struct domain *d2);
+    int (*hook_memory_pin_page) (struct domain *d1, struct domain *d2, struct page_info *page);
+    int (*target_remove_from_physmap) (struct domain *d1, struct domain *d2);
 
-    int (*console_io) (struct domain *d, int cmd);
+    int (*priv_console_io) (struct domain *d, int cmd);
 
-    int (*profile) (struct domain *d, int op);
+    int (*hook_profile) (struct domain *d, int op);
 
-    int (*kexec) (void);
-    int (*schedop_shutdown) (struct domain *d1, struct domain *d2);
+    int (*priv_kexec) (void);
+    int (*dm_schedop_shutdown) (struct domain *d1, struct domain *d2);
 
     char *(*show_irq_sid) (int irq);
-    int (*map_domain_pirq) (struct domain *d, int irq, void *data);
-    int (*unmap_domain_pirq) (struct domain *d, int irq);
-    int (*irq_permission) (struct domain *d, int pirq, uint8_t allow);
-    int (*iomem_permission) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
-    int (*iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
-    int (*pci_config_permission) (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access);
-
-    int (*get_device_group) (uint32_t machine_bdf);
-    int (*test_assign_device) (uint32_t machine_bdf);
-    int (*assign_device) (struct domain *d, uint32_t machine_bdf);
-    int (*deassign_device) (struct domain *d, uint32_t machine_bdf);
-
-    int (*resource_plug_core) (void);
-    int (*resource_unplug_core) (void);
-    int (*resource_plug_pci) (uint32_t machine_bdf);
-    int (*resource_unplug_pci) (uint32_t machine_bdf);
-    int (*resource_setup_pci) (uint32_t machine_bdf);
-    int (*resource_setup_gsi) (int gsi);
-    int (*resource_setup_misc) (void);
-
-    int (*page_offline)(uint32_t cmd);
-    int (*tmem_op)(void);
-    int (*tmem_control)(void);
+    int (*hook_map_domain_pirq) (struct domain *d, int irq, void *data);
+    int (*dm_unmap_domain_pirq) (struct domain *d, int irq);
+    int (*hook_irq_permission) (struct domain *d, int pirq, uint8_t allow);
+    int (*hook_iomem_permission) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
+    int (*hook_iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
+    int (*hook_pci_config_permission) (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access);
+
+    int (*hook_get_device_group) (uint32_t machine_bdf);
+    int (*hook_test_assign_device) (uint32_t machine_bdf);
+    int (*hook_assign_device) (struct domain *d, uint32_t machine_bdf);
+    int (*hook_deassign_device) (struct domain *d, uint32_t machine_bdf);
+
+    int (*hook_resource_plug_core) (void);
+    int (*hook_resource_unplug_core) (void);
+    int (*priv_resource_plug_pci) (uint32_t machine_bdf);
+    int (*priv_resource_unplug_pci) (uint32_t machine_bdf);
+    int (*priv_resource_setup_pci) (uint32_t machine_bdf);
+    int (*priv_resource_setup_gsi) (int gsi);
+    int (*priv_resource_setup_misc) (void);
+
+    int (*hook_page_offline)(uint32_t cmd);
+    int (*hook_tmem_op)(void);
+    int (*priv_tmem_control)(void);
 
     long (*do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
 
 #ifdef CONFIG_X86
-    int (*shadow_control) (struct domain *d, uint32_t op);
-    int (*hvm_param) (struct domain *d, unsigned long op);
-    int (*hvm_set_pci_intx_level) (struct domain *d);
-    int (*hvm_set_isa_irq_level) (struct domain *d);
-    int (*hvm_set_pci_link_route) (struct domain *d);
-    int (*hvm_inject_msi) (struct domain *d);
-    int (*mem_event_control) (struct domain *d, int mode, int op);
-    int (*mem_event_op) (struct domain *d, int op);
-    int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
-    int (*apic) (struct domain *d, int cmd);
+    int (*hook_shadow_control) (struct domain *d, uint32_t op);
+    int (*target_hvm_param) (struct domain *d, unsigned long op);
+    int (*dm_hvm_set_pci_intx_level) (struct domain *d);
+    int (*dm_hvm_set_isa_irq_level) (struct domain *d);
+    int (*dm_hvm_set_pci_link_route) (struct domain *d);
+    int (*dm_hvm_inject_msi) (struct domain *d);
+    int (*dm_mem_event_control) (struct domain *d, int mode, int op);
+    int (*dm_mem_event_op) (struct domain *d, int op);
+    int (*dm_mem_sharing_op) (struct domain *d, struct domain *cd, int op);
+    int (*priv_apic) (struct domain *d, int cmd);
     int (*memtype) (uint32_t access);
-    int (*platform_op) (uint32_t cmd);
-    int (*machine_memory_map) (void);
-    int (*domain_memory_map) (struct domain *d);
+    int (*priv_platform_op) (uint32_t cmd);
+    int (*priv_machine_memory_map) (void);
+    int (*target_domain_memory_map) (struct domain *d);
 #define XSM_MMU_UPDATE_READ      1
 #define XSM_MMU_UPDATE_WRITE     2
 #define XSM_MMU_NORMAL_UPDATE    4
 #define XSM_MMU_MACHPHYS_UPDATE  8
-    int (*mmu_update) (struct domain *d, struct domain *t,
+    int (*target_mmu_update) (struct domain *d, struct domain *t,
                        struct domain *f, uint32_t flags);
-    int (*mmuext_op) (struct domain *d, struct domain *f);
-    int (*update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
-    int (*add_to_physmap) (struct domain *d1, struct domain *d2);
-    int (*bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
-    int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
+    int (*target_mmuext_op) (struct domain *d, struct domain *f);
+    int (*target_update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
+    int (*target_add_to_physmap) (struct domain *d1, struct domain *d2);
+    int (*hook_bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
+    int (*hook_unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
+    int (*hook_ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
+    int (*hook_ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
 #endif
 };
 
@@ -149,25 +149,25 @@ extern struct xsm_operations *xsm_ops;
 
 #ifndef XSM_NO_WRAPPERS
 
-static inline void xsm_security_domaininfo (struct domain *d,
+static inline void xsm_populate_security_domaininfo (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info)
 {
-    xsm_ops->security_domaininfo(d, info);
+    xsm_ops->populate_security_domaininfo(d, info);
 }
 
-static inline int xsm_domain_create (struct domain *d, u32 ssidref)
+static inline int xsm_hook_domain_create (struct domain *d, u32 ssidref)
 {
-    return xsm_ops->domain_create(d, ssidref);
+    return xsm_ops->hook_domain_create(d, ssidref);
 }
 
-static inline int xsm_getdomaininfo (struct domain *d)
+static inline int xsm_hook_getdomaininfo (struct domain *d)
 {
-    return xsm_ops->getdomaininfo(d);
+    return xsm_ops->hook_getdomaininfo(d);
 }
 
-static inline int xsm_set_target (struct domain *d, struct domain *e)
+static inline int xsm_hook_set_target (struct domain *d, struct domain *e)
 {
-    return xsm_ops->set_target(d, e);
+    return xsm_ops->hook_set_target(d, e);
 }
 
 static inline int xsm_domctl (struct domain *d, int cmd)
@@ -180,77 +180,77 @@ static inline int xsm_sysctl (int cmd)
     return xsm_ops->sysctl(cmd);
 }
 
-static inline int xsm_readconsole (uint32_t clear)
+static inline int xsm_hook_readconsole (uint32_t clear)
 {
-    return xsm_ops->readconsole(clear);
+    return xsm_ops->hook_readconsole(clear);
 }
 
-static inline int xsm_do_mca(void)
+static inline int xsm_priv_do_mca(void)
 {
-    return xsm_ops->do_mca();
+    return xsm_ops->priv_do_mca();
 }
 
-static inline int xsm_evtchn_unbound (struct domain *d1, struct evtchn *chn,
+static inline int xsm_target_evtchn_unbound (struct domain *d1, struct evtchn *chn,
                                                                     domid_t id2)
 {
-    return xsm_ops->evtchn_unbound(d1, chn, id2);
+    return xsm_ops->target_evtchn_unbound(d1, chn, id2);
 }
 
-static inline int xsm_evtchn_interdomain (struct domain *d1, 
+static inline int xsm_hook_evtchn_interdomain (struct domain *d1, 
                 struct evtchn *chan1, struct domain *d2, struct evtchn *chan2)
 {
-    return xsm_ops->evtchn_interdomain(d1, chan1, d2, chan2);
+    return xsm_ops->hook_evtchn_interdomain(d1, chan1, d2, chan2);
 }
 
-static inline void xsm_evtchn_close_post (struct evtchn *chn)
+static inline void xsm_hook_evtchn_close_post (struct evtchn *chn)
 {
-    xsm_ops->evtchn_close_post(chn);
+    xsm_ops->hook_evtchn_close_post(chn);
 }
 
-static inline int xsm_evtchn_send (struct domain *d, struct evtchn *chn)
+static inline int xsm_hook_evtchn_send (struct domain *d, struct evtchn *chn)
 {
-    return xsm_ops->evtchn_send(d, chn);
+    return xsm_ops->hook_evtchn_send(d, chn);
 }
 
-static inline int xsm_evtchn_status (struct domain *d, struct evtchn *chn)
+static inline int xsm_target_evtchn_status (struct domain *d, struct evtchn *chn)
 {
-    return xsm_ops->evtchn_status(d, chn);
+    return xsm_ops->target_evtchn_status(d, chn);
 }
 
-static inline int xsm_evtchn_reset (struct domain *d1, struct domain *d2)
+static inline int xsm_target_evtchn_reset (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->evtchn_reset(d1, d2);
+    return xsm_ops->target_evtchn_reset(d1, d2);
 }
 
-static inline int xsm_grant_mapref (struct domain *d1, struct domain *d2,
+static inline int xsm_hook_grant_mapref (struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
-    return xsm_ops->grant_mapref(d1, d2, flags);
+    return xsm_ops->hook_grant_mapref(d1, d2, flags);
 }
 
-static inline int xsm_grant_unmapref (struct domain *d1, struct domain *d2)
+static inline int xsm_hook_grant_unmapref (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_unmapref(d1, d2);
+    return xsm_ops->hook_grant_unmapref(d1, d2);
 }
 
-static inline int xsm_grant_setup (struct domain *d1, struct domain *d2)
+static inline int xsm_target_grant_setup (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_setup(d1, d2);
+    return xsm_ops->target_grant_setup(d1, d2);
 }
 
-static inline int xsm_grant_transfer (struct domain *d1, struct domain *d2)
+static inline int xsm_hook_grant_transfer (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_transfer(d1, d2);
+    return xsm_ops->hook_grant_transfer(d1, d2);
 }
 
-static inline int xsm_grant_copy (struct domain *d1, struct domain *d2)
+static inline int xsm_hook_grant_copy (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_copy(d1, d2);
+    return xsm_ops->hook_grant_copy(d1, d2);
 }
 
-static inline int xsm_grant_query_size (struct domain *d1, struct domain *d2)
+static inline int xsm_target_grant_query_size (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_query_size(d1, d2);
+    return xsm_ops->target_grant_query_size(d1, d2);
 }
 
 static inline int xsm_alloc_security_domain (struct domain *d)
@@ -278,62 +278,62 @@ static inline char *xsm_show_security_evtchn (struct domain *d, const struct evt
     return xsm_ops->show_security_evtchn(d, chn);
 }
 
-static inline int xsm_get_pod_target (struct domain *d)
+static inline int xsm_priv_get_pod_target (struct domain *d)
 {
-    return xsm_ops->get_pod_target(d);
+    return xsm_ops->priv_get_pod_target(d);
 }
 
-static inline int xsm_set_pod_target (struct domain *d)
+static inline int xsm_priv_set_pod_target (struct domain *d)
 {
-    return xsm_ops->set_pod_target(d);
+    return xsm_ops->priv_set_pod_target(d);
 }
 
-static inline int xsm_memory_exchange (struct domain *d)
+static inline int xsm_target_memory_exchange (struct domain *d)
 {
-    return xsm_ops->memory_exchange(d);
+    return xsm_ops->target_memory_exchange(d);
 }
 
-static inline int xsm_memory_adjust_reservation (struct domain *d1, struct
+static inline int xsm_target_memory_adjust_reservation (struct domain *d1, struct
                                                                     domain *d2)
 {
-    return xsm_ops->memory_adjust_reservation(d1, d2);
+    return xsm_ops->target_memory_adjust_reservation(d1, d2);
 }
 
-static inline int xsm_memory_stat_reservation (struct domain *d1,
+static inline int xsm_target_memory_stat_reservation (struct domain *d1,
                                                             struct domain *d2)
 {
-    return xsm_ops->memory_stat_reservation(d1, d2);
+    return xsm_ops->target_memory_stat_reservation(d1, d2);
 }
 
-static inline int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
+static inline int xsm_hook_memory_pin_page(struct domain *d1, struct domain *d2,
                                       struct page_info *page)
 {
-    return xsm_ops->memory_pin_page(d1, d2, page);
+    return xsm_ops->hook_memory_pin_page(d1, d2, page);
 }
 
-static inline int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
+static inline int xsm_target_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->remove_from_physmap(d1, d2);
+    return xsm_ops->target_remove_from_physmap(d1, d2);
 }
 
-static inline int xsm_console_io (struct domain *d, int cmd)
+static inline int xsm_priv_console_io (struct domain *d, int cmd)
 {
-    return xsm_ops->console_io(d, cmd);
+    return xsm_ops->priv_console_io(d, cmd);
 }
 
-static inline int xsm_profile (struct domain *d, int op)
+static inline int xsm_hook_profile (struct domain *d, int op)
 {
-    return xsm_ops->profile(d, op);
+    return xsm_ops->hook_profile(d, op);
 }
 
-static inline int xsm_kexec (void)
+static inline int xsm_priv_kexec (void)
 {
-    return xsm_ops->kexec();
+    return xsm_ops->priv_kexec();
 }
 
-static inline int xsm_schedop_shutdown (struct domain *d1, struct domain *d2)
+static inline int xsm_dm_schedop_shutdown (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->schedop_shutdown(d1, d2);
+    return xsm_ops->dm_schedop_shutdown(d1, d2);
 }
 
 static inline char *xsm_show_irq_sid (int irq)
@@ -341,104 +341,104 @@ static inline char *xsm_show_irq_sid (int irq)
     return xsm_ops->show_irq_sid(irq);
 }
 
-static inline int xsm_map_domain_pirq (struct domain *d, int irq, void *data)
+static inline int xsm_hook_map_domain_pirq (struct domain *d, int irq, void *data)
 {
-    return xsm_ops->map_domain_pirq(d, irq, data);
+    return xsm_ops->hook_map_domain_pirq(d, irq, data);
 }
 
-static inline int xsm_unmap_domain_pirq (struct domain *d, int irq)
+static inline int xsm_dm_unmap_domain_pirq (struct domain *d, int irq)
 {
-    return xsm_ops->unmap_domain_pirq(d, irq);
+    return xsm_ops->dm_unmap_domain_pirq(d, irq);
 }
 
-static inline int xsm_irq_permission (struct domain *d, int pirq, uint8_t allow)
+static inline int xsm_hook_irq_permission (struct domain *d, int pirq, uint8_t allow)
 {
-    return xsm_ops->irq_permission(d, pirq, allow);
+    return xsm_ops->hook_irq_permission(d, pirq, allow);
 }
 
-static inline int xsm_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static inline int xsm_hook_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return xsm_ops->iomem_permission(d, s, e, allow);
+    return xsm_ops->hook_iomem_permission(d, s, e, allow);
 }
 
-static inline int xsm_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static inline int xsm_hook_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return xsm_ops->iomem_mapping(d, s, e, allow);
+    return xsm_ops->hook_iomem_mapping(d, s, e, allow);
 }
 
-static inline int xsm_pci_config_permission (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
+static inline int xsm_hook_pci_config_permission (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
-    return xsm_ops->pci_config_permission(d, machine_bdf, start, end, access);
+    return xsm_ops->hook_pci_config_permission(d, machine_bdf, start, end, access);
 }
 
-static inline int xsm_get_device_group(uint32_t machine_bdf)
+static inline int xsm_hook_get_device_group(uint32_t machine_bdf)
 {
-    return xsm_ops->get_device_group(machine_bdf);
+    return xsm_ops->hook_get_device_group(machine_bdf);
 }
 
-static inline int xsm_test_assign_device(uint32_t machine_bdf)
+static inline int xsm_hook_test_assign_device(uint32_t machine_bdf)
 {
-    return xsm_ops->test_assign_device(machine_bdf);
+    return xsm_ops->hook_test_assign_device(machine_bdf);
 }
 
-static inline int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
+static inline int xsm_hook_assign_device(struct domain *d, uint32_t machine_bdf)
 {
-    return xsm_ops->assign_device(d, machine_bdf);
+    return xsm_ops->hook_assign_device(d, machine_bdf);
 }
 
-static inline int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
+static inline int xsm_hook_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
-    return xsm_ops->deassign_device(d, machine_bdf);
+    return xsm_ops->hook_deassign_device(d, machine_bdf);
 }
 
-static inline int xsm_resource_plug_pci (uint32_t machine_bdf)
+static inline int xsm_priv_resource_plug_pci (uint32_t machine_bdf)
 {
-    return xsm_ops->resource_plug_pci(machine_bdf);
+    return xsm_ops->priv_resource_plug_pci(machine_bdf);
 }
 
-static inline int xsm_resource_unplug_pci (uint32_t machine_bdf)
+static inline int xsm_priv_resource_unplug_pci (uint32_t machine_bdf)
 {
-    return xsm_ops->resource_unplug_pci(machine_bdf);
+    return xsm_ops->priv_resource_unplug_pci(machine_bdf);
 }
 
-static inline int xsm_resource_plug_core (void)
+static inline int xsm_hook_resource_plug_core (void)
 {
-    return xsm_ops->resource_plug_core();
+    return xsm_ops->hook_resource_plug_core();
 }
 
-static inline int xsm_resource_unplug_core (void)
+static inline int xsm_hook_resource_unplug_core (void)
 {
-    return xsm_ops->resource_unplug_core();
+    return xsm_ops->hook_resource_unplug_core();
 }
 
-static inline int xsm_resource_setup_pci (uint32_t machine_bdf)
+static inline int xsm_priv_resource_setup_pci (uint32_t machine_bdf)
 {
-    return xsm_ops->resource_setup_pci(machine_bdf);
+    return xsm_ops->priv_resource_setup_pci(machine_bdf);
 }
 
-static inline int xsm_resource_setup_gsi (int gsi)
+static inline int xsm_priv_resource_setup_gsi (int gsi)
 {
-    return xsm_ops->resource_setup_gsi(gsi);
+    return xsm_ops->priv_resource_setup_gsi(gsi);
 }
 
-static inline int xsm_resource_setup_misc (void)
+static inline int xsm_priv_resource_setup_misc (void)
 {
-    return xsm_ops->resource_setup_misc();
+    return xsm_ops->priv_resource_setup_misc();
 }
 
-static inline int xsm_page_offline(uint32_t cmd)
+static inline int xsm_hook_page_offline(uint32_t cmd)
 {
-    return xsm_ops->page_offline(cmd);
+    return xsm_ops->hook_page_offline(cmd);
 }
 
-static inline int xsm_tmem_op(void)
+static inline int xsm_hook_tmem_op(void)
 {
-    return xsm_ops->tmem_op();
+    return xsm_ops->hook_tmem_op();
 }
 
-static inline int xsm_tmem_control(void)
+static inline int xsm_priv_tmem_control(void)
 {
-    return xsm_ops->tmem_control();
+    return xsm_ops->priv_tmem_control();
 }
 
 static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
@@ -447,54 +447,54 @@ static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 }
 
 #ifdef CONFIG_X86
-static inline int xsm_shadow_control (struct domain *d, uint32_t op)
+static inline int xsm_hook_shadow_control (struct domain *d, uint32_t op)
 {
-    return xsm_ops->shadow_control(d, op);
+    return xsm_ops->hook_shadow_control(d, op);
 }
 
-static inline int xsm_hvm_param (struct domain *d, unsigned long op)
+static inline int xsm_target_hvm_param (struct domain *d, unsigned long op)
 {
-    return xsm_ops->hvm_param(d, op);
+    return xsm_ops->target_hvm_param(d, op);
 }
 
-static inline int xsm_hvm_set_pci_intx_level (struct domain *d)
+static inline int xsm_dm_hvm_set_pci_intx_level (struct domain *d)
 {
-    return xsm_ops->hvm_set_pci_intx_level(d);
+    return xsm_ops->dm_hvm_set_pci_intx_level(d);
 }
 
-static inline int xsm_hvm_set_isa_irq_level (struct domain *d)
+static inline int xsm_dm_hvm_set_isa_irq_level (struct domain *d)
 {
-    return xsm_ops->hvm_set_isa_irq_level(d);
+    return xsm_ops->dm_hvm_set_isa_irq_level(d);
 }
 
-static inline int xsm_hvm_set_pci_link_route (struct domain *d)
+static inline int xsm_dm_hvm_set_pci_link_route (struct domain *d)
 {
-    return xsm_ops->hvm_set_pci_link_route(d);
+    return xsm_ops->dm_hvm_set_pci_link_route(d);
 }
 
-static inline int xsm_hvm_inject_msi (struct domain *d)
+static inline int xsm_dm_hvm_inject_msi (struct domain *d)
 {
-    return xsm_ops->hvm_inject_msi(d);
+    return xsm_ops->dm_hvm_inject_msi(d);
 }
 
-static inline int xsm_mem_event_control (struct domain *d, int mode, int op)
+static inline int xsm_dm_mem_event_control (struct domain *d, int mode, int op)
 {
-    return xsm_ops->mem_event_control(d, mode, op);
+    return xsm_ops->dm_mem_event_control(d, mode, op);
 }
 
-static inline int xsm_mem_event_op (struct domain *d, int op)
+static inline int xsm_dm_mem_event_op (struct domain *d, int op)
 {
-    return xsm_ops->mem_event_op(d, op);
+    return xsm_ops->dm_mem_event_op(d, op);
 }
 
-static inline int xsm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
+static inline int xsm_dm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
 {
-    return xsm_ops->mem_sharing_op(d, cd, op);
+    return xsm_ops->dm_mem_sharing_op(d, cd, op);
 }
 
-static inline int xsm_apic (struct domain *d, int cmd)
+static inline int xsm_priv_apic (struct domain *d, int cmd)
 {
-    return xsm_ops->apic(d, cmd);
+    return xsm_ops->priv_apic(d, cmd);
 }
 
 static inline int xsm_memtype (uint32_t access)
@@ -502,63 +502,63 @@ static inline int xsm_memtype (uint32_t access)
     return xsm_ops->memtype(access);
 }
 
-static inline int xsm_platform_op (uint32_t op)
+static inline int xsm_priv_platform_op (uint32_t op)
 {
-    return xsm_ops->platform_op(op);
+    return xsm_ops->priv_platform_op(op);
 }
 
-static inline int xsm_machine_memory_map(void)
+static inline int xsm_priv_machine_memory_map(void)
 {
-    return xsm_ops->machine_memory_map();
+    return xsm_ops->priv_machine_memory_map();
 }
 
-static inline int xsm_domain_memory_map(struct domain *d)
+static inline int xsm_target_domain_memory_map(struct domain *d)
 {
-    return xsm_ops->domain_memory_map(d);
+    return xsm_ops->target_domain_memory_map(d);
 }
 
-static inline int xsm_mmu_update (struct domain *d, struct domain *t,
+static inline int xsm_target_mmu_update (struct domain *d, struct domain *t,
                                   struct domain *f, uint32_t flags)
 {
-    return xsm_ops->mmu_update(d, t, f, flags);
+    return xsm_ops->target_mmu_update(d, t, f, flags);
 }
 
-static inline int xsm_mmuext_op (struct domain *d, struct domain *f)
+static inline int xsm_target_mmuext_op (struct domain *d, struct domain *f)
 {
-    return xsm_ops->mmuext_op(d, f);
+    return xsm_ops->target_mmuext_op(d, f);
 }
 
-static inline int xsm_update_va_mapping(struct domain *d, struct domain *f, 
+static inline int xsm_target_update_va_mapping(struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
-    return xsm_ops->update_va_mapping(d, f, pte);
+    return xsm_ops->target_update_va_mapping(d, f, pte);
 }
 
-static inline int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
+static inline int xsm_target_add_to_physmap(struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->add_to_physmap(d1, d2);
+    return xsm_ops->target_add_to_physmap(d1, d2);
 }
 
-static inline int xsm_bind_pt_irq(struct domain *d, 
+static inline int xsm_hook_bind_pt_irq(struct domain *d, 
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_ops->bind_pt_irq(d, bind);
+    return xsm_ops->hook_bind_pt_irq(d, bind);
 }
 
-static inline int xsm_unbind_pt_irq(struct domain *d,
+static inline int xsm_hook_unbind_pt_irq(struct domain *d,
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_ops->unbind_pt_irq(d, bind);
+    return xsm_ops->hook_unbind_pt_irq(d, bind);
 }
 
-static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static inline int xsm_hook_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return xsm_ops->ioport_permission(d, s, e, allow);
+    return xsm_ops->hook_ioport_permission(d, s, e, allow);
 }
 
-static inline int xsm_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static inline int xsm_hook_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return xsm_ops->ioport_mapping(d, s, e, allow);
+    return xsm_ops->hook_ioport_mapping(d, s, e, allow);
 }
 #endif /* CONFIG_X86 */
 #endif /* XSM_NO_WRAPPERS */
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 22c66e5..c29c5af 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -29,98 +29,98 @@ struct xsm_operations dummy_xsm_ops;
 
 void xsm_fixup_ops (struct xsm_operations *ops)
 {
-    set_to_dummy_if_null(ops, security_domaininfo);
-    set_to_dummy_if_null(ops, domain_create);
-    set_to_dummy_if_null(ops, getdomaininfo);
-    set_to_dummy_if_null(ops, set_target);
+    set_to_dummy_if_null(ops, populate_security_domaininfo);
+    set_to_dummy_if_null(ops, hook_domain_create);
+    set_to_dummy_if_null(ops, hook_getdomaininfo);
+    set_to_dummy_if_null(ops, hook_set_target);
     set_to_dummy_if_null(ops, domctl);
     set_to_dummy_if_null(ops, sysctl);
-    set_to_dummy_if_null(ops, readconsole);
-    set_to_dummy_if_null(ops, do_mca);
-
-    set_to_dummy_if_null(ops, evtchn_unbound);
-    set_to_dummy_if_null(ops, evtchn_interdomain);
-    set_to_dummy_if_null(ops, evtchn_close_post);
-    set_to_dummy_if_null(ops, evtchn_send);
-    set_to_dummy_if_null(ops, evtchn_status);
-    set_to_dummy_if_null(ops, evtchn_reset);
-
-    set_to_dummy_if_null(ops, grant_mapref);
-    set_to_dummy_if_null(ops, grant_unmapref);
-    set_to_dummy_if_null(ops, grant_setup);
-    set_to_dummy_if_null(ops, grant_transfer);
-    set_to_dummy_if_null(ops, grant_copy);
-    set_to_dummy_if_null(ops, grant_query_size);
+    set_to_dummy_if_null(ops, hook_readconsole);
+    set_to_dummy_if_null(ops, priv_do_mca);
+
+    set_to_dummy_if_null(ops, target_evtchn_unbound);
+    set_to_dummy_if_null(ops, hook_evtchn_interdomain);
+    set_to_dummy_if_null(ops, hook_evtchn_close_post);
+    set_to_dummy_if_null(ops, hook_evtchn_send);
+    set_to_dummy_if_null(ops, target_evtchn_status);
+    set_to_dummy_if_null(ops, target_evtchn_reset);
+
+    set_to_dummy_if_null(ops, hook_grant_mapref);
+    set_to_dummy_if_null(ops, hook_grant_unmapref);
+    set_to_dummy_if_null(ops, target_grant_setup);
+    set_to_dummy_if_null(ops, hook_grant_transfer);
+    set_to_dummy_if_null(ops, hook_grant_copy);
+    set_to_dummy_if_null(ops, target_grant_query_size);
 
     set_to_dummy_if_null(ops, alloc_security_domain);
     set_to_dummy_if_null(ops, free_security_domain);
     set_to_dummy_if_null(ops, alloc_security_evtchn);
     set_to_dummy_if_null(ops, free_security_evtchn);
     set_to_dummy_if_null(ops, show_security_evtchn);
-    set_to_dummy_if_null(ops, get_pod_target);
-    set_to_dummy_if_null(ops, set_pod_target);
+    set_to_dummy_if_null(ops, priv_get_pod_target);
+    set_to_dummy_if_null(ops, priv_set_pod_target);
 
-    set_to_dummy_if_null(ops, memory_exchange);
-    set_to_dummy_if_null(ops, memory_adjust_reservation);
-    set_to_dummy_if_null(ops, memory_stat_reservation);
-    set_to_dummy_if_null(ops, memory_pin_page);
+    set_to_dummy_if_null(ops, target_memory_exchange);
+    set_to_dummy_if_null(ops, target_memory_adjust_reservation);
+    set_to_dummy_if_null(ops, target_memory_stat_reservation);
+    set_to_dummy_if_null(ops, hook_memory_pin_page);
 
-    set_to_dummy_if_null(ops, console_io);
+    set_to_dummy_if_null(ops, priv_console_io);
 
-    set_to_dummy_if_null(ops, profile);
+    set_to_dummy_if_null(ops, hook_profile);
 
-    set_to_dummy_if_null(ops, kexec);
-    set_to_dummy_if_null(ops, schedop_shutdown);
+    set_to_dummy_if_null(ops, priv_kexec);
+    set_to_dummy_if_null(ops, dm_schedop_shutdown);
 
     set_to_dummy_if_null(ops, show_irq_sid);
-    set_to_dummy_if_null(ops, map_domain_pirq);
-    set_to_dummy_if_null(ops, unmap_domain_pirq);
-    set_to_dummy_if_null(ops, irq_permission);
-    set_to_dummy_if_null(ops, iomem_permission);
-    set_to_dummy_if_null(ops, iomem_mapping);
-    set_to_dummy_if_null(ops, pci_config_permission);
-
-    set_to_dummy_if_null(ops, get_device_group);
-    set_to_dummy_if_null(ops, test_assign_device);
-    set_to_dummy_if_null(ops, assign_device);
-    set_to_dummy_if_null(ops, deassign_device);
-
-    set_to_dummy_if_null(ops, resource_plug_core);
-    set_to_dummy_if_null(ops, resource_unplug_core);
-    set_to_dummy_if_null(ops, resource_plug_pci);
-    set_to_dummy_if_null(ops, resource_unplug_pci);
-    set_to_dummy_if_null(ops, resource_setup_pci);
-    set_to_dummy_if_null(ops, resource_setup_gsi);
-    set_to_dummy_if_null(ops, resource_setup_misc);
-
-    set_to_dummy_if_null(ops, page_offline);
-    set_to_dummy_if_null(ops, tmem_op);
-    set_to_dummy_if_null(ops, tmem_control);
+    set_to_dummy_if_null(ops, hook_map_domain_pirq);
+    set_to_dummy_if_null(ops, dm_unmap_domain_pirq);
+    set_to_dummy_if_null(ops, hook_irq_permission);
+    set_to_dummy_if_null(ops, hook_iomem_permission);
+    set_to_dummy_if_null(ops, hook_iomem_mapping);
+    set_to_dummy_if_null(ops, hook_pci_config_permission);
+
+    set_to_dummy_if_null(ops, hook_get_device_group);
+    set_to_dummy_if_null(ops, hook_test_assign_device);
+    set_to_dummy_if_null(ops, hook_assign_device);
+    set_to_dummy_if_null(ops, hook_deassign_device);
+
+    set_to_dummy_if_null(ops, hook_resource_plug_core);
+    set_to_dummy_if_null(ops, hook_resource_unplug_core);
+    set_to_dummy_if_null(ops, priv_resource_plug_pci);
+    set_to_dummy_if_null(ops, priv_resource_unplug_pci);
+    set_to_dummy_if_null(ops, priv_resource_setup_pci);
+    set_to_dummy_if_null(ops, priv_resource_setup_gsi);
+    set_to_dummy_if_null(ops, priv_resource_setup_misc);
+
+    set_to_dummy_if_null(ops, hook_page_offline);
+    set_to_dummy_if_null(ops, hook_tmem_op);
+    set_to_dummy_if_null(ops, priv_tmem_control);
 
     set_to_dummy_if_null(ops, do_xsm_op);
 
 #ifdef CONFIG_X86
-    set_to_dummy_if_null(ops, shadow_control);
-    set_to_dummy_if_null(ops, hvm_param);
-    set_to_dummy_if_null(ops, hvm_set_pci_intx_level);
-    set_to_dummy_if_null(ops, hvm_set_isa_irq_level);
-    set_to_dummy_if_null(ops, hvm_set_pci_link_route);
-    set_to_dummy_if_null(ops, hvm_inject_msi);
-    set_to_dummy_if_null(ops, mem_event_control);
-    set_to_dummy_if_null(ops, mem_event_op);
-    set_to_dummy_if_null(ops, mem_sharing_op);
-    set_to_dummy_if_null(ops, apic);
-    set_to_dummy_if_null(ops, platform_op);
-    set_to_dummy_if_null(ops, machine_memory_map);
-    set_to_dummy_if_null(ops, domain_memory_map);
-    set_to_dummy_if_null(ops, mmu_update);
-    set_to_dummy_if_null(ops, mmuext_op);
-    set_to_dummy_if_null(ops, update_va_mapping);
-    set_to_dummy_if_null(ops, add_to_physmap);
-    set_to_dummy_if_null(ops, remove_from_physmap);
-    set_to_dummy_if_null(ops, bind_pt_irq);
-    set_to_dummy_if_null(ops, unbind_pt_irq);
-    set_to_dummy_if_null(ops, ioport_permission);
-    set_to_dummy_if_null(ops, ioport_mapping);
+    set_to_dummy_if_null(ops, hook_shadow_control);
+    set_to_dummy_if_null(ops, target_hvm_param);
+    set_to_dummy_if_null(ops, dm_hvm_set_pci_intx_level);
+    set_to_dummy_if_null(ops, dm_hvm_set_isa_irq_level);
+    set_to_dummy_if_null(ops, dm_hvm_set_pci_link_route);
+    set_to_dummy_if_null(ops, dm_hvm_inject_msi);
+    set_to_dummy_if_null(ops, dm_mem_event_control);
+    set_to_dummy_if_null(ops, dm_mem_event_op);
+    set_to_dummy_if_null(ops, dm_mem_sharing_op);
+    set_to_dummy_if_null(ops, priv_apic);
+    set_to_dummy_if_null(ops, priv_platform_op);
+    set_to_dummy_if_null(ops, priv_machine_memory_map);
+    set_to_dummy_if_null(ops, target_domain_memory_map);
+    set_to_dummy_if_null(ops, target_mmu_update);
+    set_to_dummy_if_null(ops, target_mmuext_op);
+    set_to_dummy_if_null(ops, target_update_va_mapping);
+    set_to_dummy_if_null(ops, target_add_to_physmap);
+    set_to_dummy_if_null(ops, target_remove_from_physmap);
+    set_to_dummy_if_null(ops, hook_bind_pt_irq);
+    set_to_dummy_if_null(ops, hook_unbind_pt_irq);
+    set_to_dummy_if_null(ops, hook_ioport_permission);
+    set_to_dummy_if_null(ops, hook_ioport_mapping);
 #endif
 }
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 03ea675..2c46276 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -171,7 +171,7 @@ static void flask_domain_free_security(struct domain *d)
     xfree(dsec);
 }
 
-static int flask_evtchn_unbound(struct domain *d1, struct evtchn *chn, 
+static int flask_target_evtchn_unbound(struct domain *d1, struct evtchn *chn, 
                                 domid_t id2)
 {
     u32 sid1, sid2, newsid;
@@ -206,7 +206,7 @@ static int flask_evtchn_unbound(struct domain *d1, struct evtchn *chn,
     return rc;
 }
 
-static int flask_evtchn_interdomain(struct domain *d1, struct evtchn *chn1, 
+static int flask_hook_evtchn_interdomain(struct domain *d1, struct evtchn *chn1, 
                                     struct domain *d2, struct evtchn *chn2)
 {
     u32 sid1, sid2, newsid, reverse_sid;
@@ -252,7 +252,7 @@ static int flask_evtchn_interdomain(struct domain *d1, struct evtchn *chn1,
     return rc;
 }
 
-static void flask_evtchn_close_post(struct evtchn *chn)
+static void flask_hook_evtchn_close_post(struct evtchn *chn)
 {
     struct evtchn_security_struct *esec;
     esec = chn->ssid;
@@ -260,7 +260,7 @@ static void flask_evtchn_close_post(struct evtchn *chn)
     esec->sid = SECINITSID_UNLABELED;
 }
 
-static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
+static int flask_hook_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     int rc;
 
@@ -280,12 +280,12 @@ static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
     return rc;
 }
 
-static int flask_evtchn_status(struct domain *d, struct evtchn *chn)
+static int flask_target_evtchn_status(struct domain *d, struct evtchn *chn)
 {
     return domain_has_evtchn(d, chn, EVENT__STATUS);
 }
 
-static int flask_evtchn_reset(struct domain *d1, struct domain *d2)
+static int flask_target_evtchn_reset(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_EVENT, EVENT__RESET);
 }
@@ -350,7 +350,7 @@ static char *flask_show_security_evtchn(struct domain *d, const struct evtchn *c
     return ctx;
 }
 
-static int flask_grant_mapref(struct domain *d1, struct domain *d2, 
+static int flask_hook_grant_mapref(struct domain *d1, struct domain *d2, 
                               uint32_t flags)
 {
     u32 perms = GRANT__MAP_READ;
@@ -361,63 +361,63 @@ static int flask_grant_mapref(struct domain *d1, struct domain *d2,
     return domain_has_perm(d1, d2, SECCLASS_GRANT, perms);
 }
 
-static int flask_grant_unmapref(struct domain *d1, struct domain *d2)
+static int flask_hook_grant_unmapref(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__UNMAP);
 }
 
-static int flask_grant_setup(struct domain *d1, struct domain *d2)
+static int flask_target_grant_setup(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__SETUP);
 }
 
-static int flask_grant_transfer(struct domain *d1, struct domain *d2)
+static int flask_hook_grant_transfer(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__TRANSFER);
 }
 
-static int flask_grant_copy(struct domain *d1, struct domain *d2)
+static int flask_hook_grant_copy(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__COPY);
 }
 
-static int flask_grant_query_size(struct domain *d1, struct domain *d2)
+static int flask_target_grant_query_size(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__QUERY);
 }
 
-static int flask_get_pod_target(struct domain *d)
+static int flask_priv_get_pod_target(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETPODTARGET);
 }
 
-static int flask_set_pod_target(struct domain *d)
+static int flask_priv_set_pod_target(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETPODTARGET);
 }
 
-static int flask_memory_exchange(struct domain *d)
+static int flask_target_memory_exchange(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_MMU, MMU__EXCHANGE);
 }
 
-static int flask_memory_adjust_reservation(struct domain *d1, struct domain *d2)
+static int flask_target_memory_adjust_reservation(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__ADJUST);
 }
 
-static int flask_memory_stat_reservation(struct domain *d1, struct domain *d2)
+static int flask_target_memory_stat_reservation(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__STAT);
 }
 
-static int flask_memory_pin_page(struct domain *d1, struct domain *d2,
+static int flask_hook_memory_pin_page(struct domain *d1, struct domain *d2,
                                  struct page_info *page)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PINPAGE);
 }
 
-static int flask_console_io(struct domain *d, int cmd)
+static int flask_priv_console_io(struct domain *d, int cmd)
 {
     u32 perm;
 
@@ -436,7 +436,7 @@ static int flask_console_io(struct domain *d, int cmd)
     return domain_has_xen(d, perm);
 }
 
-static int flask_profile(struct domain *d, int op)
+static int flask_hook_profile(struct domain *d, int op)
 {
     u32 perm;
 
@@ -468,23 +468,23 @@ static int flask_profile(struct domain *d, int op)
     return domain_has_xen(d, perm);
 }
 
-static int flask_kexec(void)
+static int flask_priv_kexec(void)
 {
     return domain_has_xen(current->domain, XEN__KEXEC);
 }
 
-static int flask_schedop_shutdown(struct domain *d1, struct domain *d2)
+static int flask_dm_schedop_shutdown(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_DOMAIN, DOMAIN__SHUTDOWN);
 }
 
-static void flask_security_domaininfo(struct domain *d, 
+static void flask_populate_security_domaininfo(struct domain *d, 
                                       struct xen_domctl_getdomaininfo *info)
 {
     info->ssidref = domain_sid(d);
 }
 
-static int flask_domain_create(struct domain *d, u32 ssidref)
+static int flask_hook_domain_create(struct domain *d, u32 ssidref)
 {
     int rc;
     struct domain_security_struct *dsec = d->ssid;
@@ -512,12 +512,12 @@ static int flask_domain_create(struct domain *d, u32 ssidref)
     return rc;
 }
 
-static int flask_getdomaininfo(struct domain *d)
+static int flask_hook_getdomaininfo(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO);
 }
 
-static int flask_set_target(struct domain *d, struct domain *t)
+static int flask_hook_set_target(struct domain *d, struct domain *t)
 {
     int rc;
     struct domain_security_struct *dsec, *tsec;
@@ -753,7 +753,7 @@ static int flask_sysctl(int cmd)
     }
 }
 
-static int flask_readconsole(uint32_t clear)
+static int flask_hook_readconsole(uint32_t clear)
 {
     u32 perms = XEN__READCONSOLE;
 
@@ -763,7 +763,7 @@ static int flask_readconsole(uint32_t clear)
     return domain_has_xen(current->domain, perms);
 }
 
-static int flask_do_mca(void)
+static int flask_priv_do_mca(void)
 {
     return domain_has_xen(current->domain, XEN__MCA_OP);
 }
@@ -790,7 +790,7 @@ static char *flask_show_irq_sid (int irq)
     return ctx;
 }
 
-static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
+static int flask_hook_map_domain_pirq (struct domain *d, int irq, void *data)
 {
     u32 sid, dsid;
     int rc = -EPERM;
@@ -823,7 +823,7 @@ static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
     return rc;
 }
 
-static int flask_unmap_domain_pirq (struct domain *d, int irq)
+static int flask_dm_unmap_domain_pirq (struct domain *d, int irq)
 {
     u32 sid;
     int rc = -EPERM;
@@ -846,7 +846,7 @@ static int flask_unmap_domain_pirq (struct domain *d, int irq)
     return rc;
 }
 
-static int flask_irq_permission (struct domain *d, int pirq, uint8_t access)
+static int flask_hook_irq_permission (struct domain *d, int pirq, uint8_t access)
 {
     /* the PIRQ number is not useful; real IRQ is checked during mapping */
     return current_has_perm(d, SECCLASS_RESOURCE, resource_to_perm(access));
@@ -876,7 +876,7 @@ static int _iomem_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     return avc_has_perm(data->dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
+static int flask_hook_iomem_permission(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
 {
     struct iomem_has_perm_data data;
     int rc;
@@ -897,12 +897,12 @@ static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end
     return security_iterate_iomem_sids(start, end, _iomem_has_perm, &data);
 }
 
-static int flask_iomem_mapping(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
+static int flask_hook_iomem_mapping(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
 {
-    return flask_iomem_permission(d, start, end, access);
+    return flask_hook_iomem_permission(d, start, end, access);
 }
 
-static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
+static int flask_hook_pci_config_permission(struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
     u32 dsid, rsid;
     int rc = -EPERM;
@@ -924,12 +924,12 @@ static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, u
 
 }
 
-static int flask_resource_plug_core(void)
+static int flask_hook_resource_plug_core(void)
 {
     return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__PLUG, NULL);
 }
 
-static int flask_resource_unplug_core(void)
+static int flask_hook_resource_unplug_core(void)
 {
     return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__UNPLUG, NULL);
 }
@@ -939,7 +939,7 @@ static int flask_resource_use_core(void)
     return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__USE, NULL);
 }
 
-static int flask_resource_plug_pci(uint32_t machine_bdf)
+static int flask_priv_resource_plug_pci(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -954,7 +954,7 @@ static int flask_resource_plug_pci(uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__PLUG, &ad);
 }
 
-static int flask_resource_unplug_pci(uint32_t machine_bdf)
+static int flask_priv_resource_unplug_pci(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -969,7 +969,7 @@ static int flask_resource_unplug_pci(uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__UNPLUG, &ad);
 }
 
-static int flask_resource_setup_pci(uint32_t machine_bdf)
+static int flask_priv_resource_setup_pci(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -984,7 +984,7 @@ static int flask_resource_setup_pci(uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
-static int flask_resource_setup_gsi(int gsi)
+static int flask_priv_resource_setup_gsi(int gsi)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -997,18 +997,18 @@ static int flask_resource_setup_gsi(int gsi)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
-static int flask_resource_setup_misc(void)
+static int flask_priv_resource_setup_misc(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);
 }
 
-static inline int flask_page_offline(uint32_t cmd)
+static inline int flask_hook_page_offline(uint32_t cmd)
 {
     switch (cmd) {
     case sysctl_page_offline:
-        return flask_resource_unplug_core();
+        return flask_hook_resource_unplug_core();
     case sysctl_page_online:
-        return flask_resource_plug_core();
+        return flask_hook_resource_plug_core();
     case sysctl_query_page_offline:
         return flask_resource_use_core();
     default:
@@ -1016,18 +1016,18 @@ static inline int flask_page_offline(uint32_t cmd)
     }
 }
 
-static inline int flask_tmem_op(void)
+static inline int flask_hook_tmem_op(void)
 {
     return domain_has_xen(current->domain, XEN__TMEM_OP);
 }
 
-static inline int flask_tmem_control(void)
+static inline int flask_priv_tmem_control(void)
 {
     return domain_has_xen(current->domain, XEN__TMEM_CONTROL);
 }
 
 #ifdef CONFIG_X86
-static int flask_shadow_control(struct domain *d, uint32_t op)
+static int flask_hook_shadow_control(struct domain *d, uint32_t op)
 {
     u32 perm;
 
@@ -1079,7 +1079,7 @@ static int _ioport_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     return avc_has_perm(data->dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
+static int flask_hook_ioport_permission(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
 {
     int rc;
     struct ioport_has_perm_data data;
@@ -1101,12 +1101,12 @@ static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t en
     return security_iterate_ioport_sids(start, end, _ioport_has_perm, &data);
 }
 
-static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
+static int flask_hook_ioport_mapping(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
 {
-    return flask_ioport_permission(d, start, end, access);
+    return flask_hook_ioport_permission(d, start, end, access);
 }
 
-static int flask_hvm_param(struct domain *d, unsigned long op)
+static int flask_target_hvm_param(struct domain *d, unsigned long op)
 {
     u32 perm;
 
@@ -1128,37 +1128,37 @@ static int flask_hvm_param(struct domain *d, unsigned long op)
     return current_has_perm(d, SECCLASS_HVM, perm);
 }
 
-static int flask_hvm_set_pci_intx_level(struct domain *d)
+static int flask_dm_hvm_set_pci_intx_level(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__PCILEVEL);
 }
 
-static int flask_hvm_set_isa_irq_level(struct domain *d)
+static int flask_dm_hvm_set_isa_irq_level(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__IRQLEVEL);
 }
 
-static int flask_hvm_set_pci_link_route(struct domain *d)
+static int flask_dm_hvm_set_pci_link_route(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__PCIROUTE);
 }
 
-static int flask_hvm_inject_msi(struct domain *d)
+static int flask_dm_hvm_inject_msi(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
-static int flask_mem_event_control(struct domain *d, int mode, int op)
+static int flask_dm_mem_event_control(struct domain *d, int mode, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
 
-static int flask_mem_event_op(struct domain *d, int op)
+static int flask_dm_mem_event_op(struct domain *d, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
 
-static int flask_mem_sharing_op(struct domain *d, struct domain *cd, int op)
+static int flask_dm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     int rc = current_has_perm(cd, SECCLASS_HVM, HVM__MEM_SHARING);
     if ( rc )
@@ -1166,7 +1166,7 @@ static int flask_mem_sharing_op(struct domain *d, struct domain *cd, int op)
     return domain_has_perm(d, cd, SECCLASS_HVM, HVM__SHARE_MEM);
 }
 
-static int flask_apic(struct domain *d, int cmd)
+static int flask_priv_apic(struct domain *d, int cmd)
 {
     u32 perm;
 
@@ -1186,7 +1186,7 @@ static int flask_apic(struct domain *d, int cmd)
     return domain_has_xen(d, perm);
 }
 
-static int flask_platform_op(uint32_t op)
+static int flask_priv_platform_op(uint32_t op)
 {
     switch ( op )
     {
@@ -1241,22 +1241,22 @@ static int flask_platform_op(uint32_t op)
         return domain_has_xen(current->domain, XEN__GETCPUINFO);
 
     default:
-        printk("flask_platform_op: Unknown op %d\n", op);
+        printk("flask_priv_platform_op: Unknown op %d\n", op);
         return -EPERM;
     }
 }
 
-static int flask_machine_memory_map(void)
+static int flask_priv_machine_memory_map(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_MMU, MMU__MEMORYMAP, NULL);
 }
 
-static int flask_domain_memory_map(struct domain *d)
+static int flask_target_domain_memory_map(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_MMU, MMU__MEMORYMAP);
 }
 
-static int flask_mmu_update(struct domain *d, struct domain *t,
+static int flask_target_mmu_update(struct domain *d, struct domain *t,
                             struct domain *f, uint32_t flags)
 {
     int rc = 0;
@@ -1279,12 +1279,12 @@ static int flask_mmu_update(struct domain *d, struct domain *t,
     return rc;
 }
 
-static int flask_mmuext_op(struct domain *d, struct domain *f)
+static int flask_target_mmuext_op(struct domain *d, struct domain *f)
 {
     return domain_has_perm(d, f, SECCLASS_MMU, MMU__MMUEXT_OP);
 }
 
-static int flask_update_va_mapping(struct domain *d, struct domain *f,
+static int flask_target_update_va_mapping(struct domain *d, struct domain *f,
                                    l1_pgentry_t pte)
 {
     u32 map_perms = MMU__MAP_READ;
@@ -1296,17 +1296,17 @@ static int flask_update_va_mapping(struct domain *d, struct domain *f,
     return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
 }
 
-static int flask_add_to_physmap(struct domain *d1, struct domain *d2)
+static int flask_target_add_to_physmap(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP);
 }
 
-static int flask_remove_from_physmap(struct domain *d1, struct domain *d2)
+static int flask_target_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP);
 }
 
-static int flask_get_device_group(uint32_t machine_bdf)
+static int flask_hook_get_device_group(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -1330,7 +1330,7 @@ static int flask_test_assign_device(uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
 }
 
-static int flask_assign_device(struct domain *d, uint32_t machine_bdf)
+static int flask_hook_assign_device(struct domain *d, uint32_t machine_bdf)
 {
     u32 dsid, rsid;
     int rc = -EPERM;
@@ -1354,7 +1354,7 @@ static int flask_assign_device(struct domain *d, uint32_t machine_bdf)
     return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_deassign_device(struct domain *d, uint32_t machine_bdf)
+static int flask_hook_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -1370,7 +1370,7 @@ static int flask_deassign_device(struct domain *d, uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__REMOVE_DEVICE, NULL);
 }
 
-static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static int flask_hook_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     u32 dsid, rsid;
     int rc = -EPERM;
@@ -1395,7 +1395,7 @@ static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *b
     return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static int flask_hook_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
@@ -1404,28 +1404,28 @@ static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq
 long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
 
 static struct xsm_operations flask_ops = {
-    .security_domaininfo = flask_security_domaininfo,
-    .domain_create = flask_domain_create,
-    .getdomaininfo = flask_getdomaininfo,
-    .set_target = flask_set_target,
+    .populate_security_domaininfo = flask_populate_security_domaininfo,
+    .hook_domain_create = flask_hook_domain_create,
+    .hook_getdomaininfo = flask_hook_getdomaininfo,
+    .hook_set_target = flask_hook_set_target,
     .domctl = flask_domctl,
     .sysctl = flask_sysctl,
-    .readconsole = flask_readconsole,
-    .do_mca = flask_do_mca,
-
-    .evtchn_unbound = flask_evtchn_unbound,
-    .evtchn_interdomain = flask_evtchn_interdomain,
-    .evtchn_close_post = flask_evtchn_close_post,
-    .evtchn_send = flask_evtchn_send,
-    .evtchn_status = flask_evtchn_status,
-    .evtchn_reset = flask_evtchn_reset,
-
-    .grant_mapref = flask_grant_mapref,
-    .grant_unmapref = flask_grant_unmapref,
-    .grant_setup = flask_grant_setup,
-    .grant_transfer = flask_grant_transfer,
-    .grant_copy = flask_grant_copy,
-    .grant_query_size = flask_grant_query_size,
+    .hook_readconsole = flask_hook_readconsole,
+    .priv_do_mca = flask_priv_do_mca,
+
+    .target_evtchn_unbound = flask_target_evtchn_unbound,
+    .hook_evtchn_interdomain = flask_hook_evtchn_interdomain,
+    .hook_evtchn_close_post = flask_hook_evtchn_close_post,
+    .hook_evtchn_send = flask_hook_evtchn_send,
+    .target_evtchn_status = flask_target_evtchn_status,
+    .target_evtchn_reset = flask_target_evtchn_reset,
+
+    .hook_grant_mapref = flask_hook_grant_mapref,
+    .hook_grant_unmapref = flask_hook_grant_unmapref,
+    .target_grant_setup = flask_target_grant_setup,
+    .hook_grant_transfer = flask_hook_grant_transfer,
+    .hook_grant_copy = flask_hook_grant_copy,
+    .target_grant_query_size = flask_target_grant_query_size,
 
     .alloc_security_domain = flask_domain_alloc_security,
     .free_security_domain = flask_domain_free_security,
@@ -1433,70 +1433,70 @@ static struct xsm_operations flask_ops = {
     .free_security_evtchn = flask_free_security_evtchn,
     .show_security_evtchn = flask_show_security_evtchn,
 
-    .get_pod_target = flask_get_pod_target,
-    .set_pod_target = flask_set_pod_target,
-    .memory_exchange = flask_memory_exchange,
-    .memory_adjust_reservation = flask_memory_adjust_reservation,
-    .memory_stat_reservation = flask_memory_stat_reservation,
-    .memory_pin_page = flask_memory_pin_page,
+    .priv_get_pod_target = flask_priv_get_pod_target,
+    .priv_set_pod_target = flask_priv_set_pod_target,
+    .target_memory_exchange = flask_target_memory_exchange,
+    .target_memory_adjust_reservation = flask_target_memory_adjust_reservation,
+    .target_memory_stat_reservation = flask_target_memory_stat_reservation,
+    .hook_memory_pin_page = flask_hook_memory_pin_page,
 
-    .console_io = flask_console_io,
+    .priv_console_io = flask_priv_console_io,
 
-    .profile = flask_profile,
+    .hook_profile = flask_hook_profile,
 
-    .kexec = flask_kexec,
-    .schedop_shutdown = flask_schedop_shutdown,
+    .priv_kexec = flask_priv_kexec,
+    .dm_schedop_shutdown = flask_dm_schedop_shutdown,
 
     .show_irq_sid = flask_show_irq_sid,
 
-    .map_domain_pirq = flask_map_domain_pirq,
-    .unmap_domain_pirq = flask_unmap_domain_pirq,
-    .irq_permission = flask_irq_permission,
-    .iomem_permission = flask_iomem_permission,
-    .iomem_mapping = flask_iomem_mapping,
-    .pci_config_permission = flask_pci_config_permission,
-
-    .resource_plug_core = flask_resource_plug_core,
-    .resource_unplug_core = flask_resource_unplug_core,
-    .resource_plug_pci = flask_resource_plug_pci,
-    .resource_unplug_pci = flask_resource_unplug_pci,
-    .resource_setup_pci = flask_resource_setup_pci,
-    .resource_setup_gsi = flask_resource_setup_gsi,
-    .resource_setup_misc = flask_resource_setup_misc,
-
-    .page_offline = flask_page_offline,
-    .tmem_op = flask_tmem_op,
-    .tmem_control = flask_tmem_control,
+    .hook_map_domain_pirq = flask_hook_map_domain_pirq,
+    .dm_unmap_domain_pirq = flask_dm_unmap_domain_pirq,
+    .hook_irq_permission = flask_hook_irq_permission,
+    .hook_iomem_permission = flask_hook_iomem_permission,
+    .hook_iomem_mapping = flask_hook_iomem_mapping,
+    .hook_pci_config_permission = flask_hook_pci_config_permission,
+
+    .hook_resource_plug_core = flask_hook_resource_plug_core,
+    .hook_resource_unplug_core = flask_hook_resource_unplug_core,
+    .priv_resource_plug_pci = flask_priv_resource_plug_pci,
+    .priv_resource_unplug_pci = flask_priv_resource_unplug_pci,
+    .priv_resource_setup_pci = flask_priv_resource_setup_pci,
+    .priv_resource_setup_gsi = flask_priv_resource_setup_gsi,
+    .priv_resource_setup_misc = flask_priv_resource_setup_misc,
+
+    .hook_page_offline = flask_hook_page_offline,
+    .hook_tmem_op = flask_hook_tmem_op,
+    .priv_tmem_control = flask_priv_tmem_control,
 
     .do_xsm_op = do_flask_op,
 
 #ifdef CONFIG_X86
-    .shadow_control = flask_shadow_control,
-    .hvm_param = flask_hvm_param,
-    .hvm_set_pci_intx_level = flask_hvm_set_pci_intx_level,
-    .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
-    .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
-    .hvm_inject_msi = flask_hvm_inject_msi,
-    .mem_event_control = flask_mem_event_control,
-    .mem_event_op = flask_mem_event_op,
-    .mem_sharing_op = flask_mem_sharing_op,
-    .apic = flask_apic,
-    .platform_op = flask_platform_op,
-    .machine_memory_map = flask_machine_memory_map,
-    .domain_memory_map = flask_domain_memory_map,
-    .mmu_update = flask_mmu_update,
-    .mmuext_op = flask_mmuext_op,
-    .update_va_mapping = flask_update_va_mapping,
-    .add_to_physmap = flask_add_to_physmap,
-    .remove_from_physmap = flask_remove_from_physmap,
-    .get_device_group = flask_get_device_group,
-    .test_assign_device = flask_test_assign_device,
-    .assign_device = flask_assign_device,
-    .deassign_device = flask_deassign_device,
-    .bind_pt_irq = flask_bind_pt_irq,
-    .unbind_pt_irq = flask_unbind_pt_irq,
-    .ioport_permission = flask_ioport_permission,
-    .ioport_mapping = flask_ioport_mapping,
+    .hook_shadow_control = flask_hook_shadow_control,
+    .target_hvm_param = flask_target_hvm_param,
+    .dm_hvm_set_pci_intx_level = flask_dm_hvm_set_pci_intx_level,
+    .dm_hvm_set_isa_irq_level = flask_dm_hvm_set_isa_irq_level,
+    .dm_hvm_set_pci_link_route = flask_dm_hvm_set_pci_link_route,
+    .dm_hvm_inject_msi = flask_dm_hvm_inject_msi,
+    .dm_mem_event_control = flask_dm_mem_event_control,
+    .dm_mem_event_op = flask_dm_mem_event_op,
+    .dm_mem_sharing_op = flask_dm_mem_sharing_op,
+    .priv_apic = flask_priv_apic,
+    .priv_platform_op = flask_priv_platform_op,
+    .priv_machine_memory_map = flask_priv_machine_memory_map,
+    .target_domain_memory_map = flask_target_domain_memory_map,
+    .target_mmu_update = flask_target_mmu_update,
+    .target_mmuext_op = flask_target_mmuext_op,
+    .target_update_va_mapping = flask_target_update_va_mapping,
+    .target_add_to_physmap = flask_target_add_to_physmap,
+    .target_remove_from_physmap = flask_target_remove_from_physmap,
+    .hook_get_device_group = flask_hook_get_device_group,
+    .hook_test_assign_device = flask_test_assign_device,
+    .hook_assign_device = flask_hook_assign_device,
+    .hook_deassign_device = flask_hook_deassign_device,
+    .hook_bind_pt_irq = flask_hook_bind_pt_irq,
+    .hook_unbind_pt_irq = flask_hook_unbind_pt_irq,
+    .hook_ioport_permission = flask_hook_ioport_permission,
+    .hook_ioport_mapping = flask_hook_ioport_mapping,
 #endif
 };
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:07:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:07:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarHz-0008Ua-6E; Tue, 20 Nov 2012 17:07:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TarHx-0008UN-Nc
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:07:10 +0000
Received: from [85.158.143.35:63093] by server-2.bemta-4.messagelabs.com id
	82/92-28922-DB8BBA05; Tue, 20 Nov 2012 17:07:09 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-13.tower-21.messagelabs.com!1353431210!17875939!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23691 invoked from network); 20 Nov 2012 17:06:51 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-13.tower-21.messagelabs.com with SMTP;
	20 Nov 2012 17:06:51 -0000
X-TM-IMSS-Message-ID: <0a20c06600009afe@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 0a20c06600009afe ;
	Mon, 19 Nov 2012 16:31:55 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJLSNQG013605; 
	Mon, 19 Nov 2012 16:28:25 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Mon, 19 Nov 2012 16:28:22 -0500
Message-Id: <1353360502-27819-6-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH RFC 5/5] xen/xsm: include default hook action in
	name
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Include the default XSM hook action in the name of the hook in order to
allow quick understanding of how the call site is expected to be used
(dom0-only, arbitrary guest, or target-only).

Abbreviation explanation:
 xsm_dm_*      Usable only by device model (IS_PRIV_FOR)
 xsm_hook_*    No access check in dummy module. The calling code is
               either guest-accessible or covered by another check
 xsm_priv_*    Privileged command (IS_PRIV)
 xsm_target_*  Usable by guest or its device model targeted to the guest

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/cpu/mcheck/mce.c     |   2 +-
 xen/arch/x86/domctl.c             |  10 +-
 xen/arch/x86/hvm/hvm.c            |  26 +--
 xen/arch/x86/irq.c                |   2 +-
 xen/arch/x86/mm.c                 |  20 +-
 xen/arch/x86/mm/mem_event.c       |   4 +-
 xen/arch/x86/mm/mem_sharing.c     |   4 +-
 xen/arch/x86/mm/paging.c          |   2 +-
 xen/arch/x86/msi.c                |   2 +-
 xen/arch/x86/physdev.c            |  12 +-
 xen/arch/x86/platform_hypercall.c |  12 +-
 xen/arch/x86/sysctl.c             |   4 +-
 xen/arch/x86/traps.c              |   2 +-
 xen/common/domain.c               |   2 +-
 xen/common/domctl.c               |  10 +-
 xen/common/event_channel.c        |  14 +-
 xen/common/grant_table.c          |  16 +-
 xen/common/kexec.c                |   2 +-
 xen/common/memory.c               |   8 +-
 xen/common/schedule.c             |   2 +-
 xen/common/sysctl.c               |   6 +-
 xen/common/xenoprof.c             |   2 +-
 xen/drivers/char/console.c        |   2 +-
 xen/drivers/passthrough/iommu.c   |  10 +-
 xen/drivers/passthrough/pci.c     |   4 +-
 xen/include/xen/tmem_xen.h        |   4 +-
 xen/include/xsm/dummy.h           | 140 ++++++-------
 xen/include/xsm/xsm.h             | 428 +++++++++++++++++++-------------------
 xen/xsm/dummy.c                   | 150 ++++++-------
 xen/xsm/flask/hooks.c             | 296 +++++++++++++-------------
 30 files changed, 599 insertions(+), 599 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 658774a..72f6f18 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1293,7 +1293,7 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
     struct xen_mc_msrinject *mc_msrinject;
     struct xen_mc_mceinject *mc_mceinject;
 
-    ret = xsm_do_mca();
+    ret = xsm_priv_do_mca();
     if ( ret )
         return x86_mcerr(NULL, ret);
 
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 2630bdb..9541ef8 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -76,7 +76,7 @@ long arch_do_domctl(
 
         if ( np == 0 )
             ret = 0;
-        else if ( xsm_ioport_permission(d, fp, fp + np - 1, allow) )
+        else if ( xsm_hook_ioport_permission(d, fp, fp + np - 1, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = ioports_permit_access(d, fp, fp + np - 1);
@@ -566,7 +566,7 @@ long arch_do_domctl(
         if ( !is_hvm_domain(d) )
             break;
 
-        ret = xsm_bind_pt_irq(d, bind);
+        ret = xsm_hook_bind_pt_irq(d, bind);
         if ( ret )
             break;
 
@@ -599,7 +599,7 @@ long arch_do_domctl(
              !irq_access_permitted(current->domain, bind->machine_irq) )
             break;
 
-        ret = xsm_unbind_pt_irq(d, bind);
+        ret = xsm_hook_unbind_pt_irq(d, bind);
         if ( ret )
             break;
 
@@ -634,7 +634,7 @@ long arch_do_domctl(
              !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
             break;
 
-        ret = xsm_iomem_mapping(d, mfn, mfn + nr_mfns - 1, add);
+        ret = xsm_hook_iomem_mapping(d, mfn, mfn + nr_mfns - 1, add);
         if ( ret )
             break;
 
@@ -712,7 +712,7 @@ long arch_do_domctl(
              !ioports_access_permitted(current->domain, fmp, fmp + np - 1) )
             break;
 
-        ret = xsm_ioport_mapping(d, fmp, fmp + np - 1, add);
+        ret = xsm_hook_ioport_mapping(d, fmp, fmp + np - 1, add);
         if ( ret )
             break;
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 5bdde8d..e75c139 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3400,7 +3400,7 @@ static int hvmop_set_pci_intx_level(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_set_pci_intx_level(d);
+    rc = xsm_dm_hvm_set_pci_intx_level(d);
     if ( rc )
         goto out;
 
@@ -3567,7 +3567,7 @@ static int hvmop_set_isa_irq_level(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_set_isa_irq_level(d);
+    rc = xsm_dm_hvm_set_isa_irq_level(d);
     if ( rc )
         goto out;
 
@@ -3611,7 +3611,7 @@ static int hvmop_set_pci_link_route(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_set_pci_link_route(d);
+    rc = xsm_dm_hvm_set_pci_link_route(d);
     if ( rc )
         goto out;
 
@@ -3641,7 +3641,7 @@ static int hvmop_inject_msi(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_inject_msi(d);
+    rc = xsm_dm_hvm_inject_msi(d);
     if ( rc )
         goto out;
 
@@ -3738,7 +3738,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail;
 
@@ -3984,7 +3984,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail2;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail2;
 
@@ -4023,7 +4023,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail3;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail3;
 
@@ -4069,7 +4069,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail_getmemtype;
 
@@ -4124,7 +4124,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail4;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail4;
 
@@ -4203,7 +4203,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail5;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail5;
 
@@ -4238,7 +4238,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail6;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail6;
 
@@ -4274,7 +4274,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) || !paging_mode_shadow(d) )
             goto param_fail7;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail7;
 
@@ -4328,7 +4328,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail8;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_target_hvm_param(d, op);
         if ( rc )
             goto param_fail8;
 
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 238600a..ba8a5ce 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1874,7 +1874,7 @@ int map_domain_pirq(
         return 0;
     }
 
-    ret = xsm_map_domain_pirq(d, irq, data);
+    ret = xsm_hook_map_domain_pirq(d, irq, data);
     if ( ret )
     {
         dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq %d mapping to pirq %d\n",
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 39b2cc7..1dbe4ef 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2715,7 +2715,7 @@ long do_mmuext_op(
         goto out;
     }
 
-    rc = xsm_mmuext_op(d, pg_owner);
+    rc = xsm_target_mmuext_op(d, pg_owner);
     if ( rc )
     {
         rcu_unlock_domain(pg_owner);
@@ -2787,7 +2787,7 @@ long do_mmuext_op(
                 break;
             }
 
-            if ( (rc = xsm_memory_pin_page(d, pg_owner, page)) != 0 )
+            if ( (rc = xsm_hook_memory_pin_page(d, pg_owner, page)) != 0 )
             {
                 put_page_and_type(page);
                 okay = 0;
@@ -3244,7 +3244,7 @@ long do_mmu_update(
             }
             if ( xsm_needed != xsm_checked )
             {
-                rc = xsm_mmu_update(d, pt_owner, pg_owner, xsm_needed);
+                rc = xsm_target_mmu_update(d, pt_owner, pg_owner, xsm_needed);
                 if ( rc )
                     break;
                 xsm_checked = xsm_needed;
@@ -3363,7 +3363,7 @@ long do_mmu_update(
             xsm_needed |= XSM_MMU_MACHPHYS_UPDATE;
             if ( xsm_needed != xsm_checked )
             {
-                rc = xsm_mmu_update(d, NULL, pg_owner, xsm_needed);
+                rc = xsm_target_mmu_update(d, NULL, pg_owner, xsm_needed);
                 if ( rc )
                     break;
                 xsm_checked = xsm_needed;
@@ -3931,7 +3931,7 @@ static int __do_update_va_mapping(
 
     perfc_incr(calls_to_update_va);
 
-    rc = xsm_update_va_mapping(d, pg_owner, val);
+    rc = xsm_target_update_va_mapping(d, pg_owner, val);
     if ( rc )
         return rc;
 
@@ -4402,7 +4402,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        if ( xsm_add_to_physmap(current->domain, d) )
+        if ( xsm_target_add_to_physmap(current->domain, d) )
         {
             rcu_unlock_domain(d);
             return -EPERM;
@@ -4441,7 +4441,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        rc = xsm_domain_memory_map(d);
+        rc = xsm_target_domain_memory_map(d);
         if ( rc )
         {
             rcu_unlock_domain(d);
@@ -4516,7 +4516,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         XEN_GUEST_HANDLE_PARAM(e820entry_t) buffer_param;
         unsigned int i;
 
-        rc = xsm_machine_memory_map();
+        rc = xsm_priv_machine_memory_map();
         if ( rc )
             return rc;
 
@@ -4600,9 +4600,9 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
             return -ESRCH;
 
         if ( op == XENMEM_set_pod_target )
-            rc = xsm_set_pod_target(d);
+            rc = xsm_priv_set_pod_target(d);
         else
-            rc = xsm_get_pod_target(d);
+            rc = xsm_priv_get_pod_target(d);
 
         if ( rc != 0 )
             goto pod_target_out_unlock;
diff --git a/xen/arch/x86/mm/mem_event.c b/xen/arch/x86/mm/mem_event.c
index c2b3670..3a7605c 100644
--- a/xen/arch/x86/mm/mem_event.c
+++ b/xen/arch/x86/mm/mem_event.c
@@ -449,7 +449,7 @@ int do_mem_event_op(int op, uint32_t domain, void *arg)
     if ( ret )
         return ret;
 
-    ret = xsm_mem_event_op(d, op);
+    ret = xsm_dm_mem_event_op(d, op);
     if ( ret )
         goto out;
 
@@ -502,7 +502,7 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
 {
     int rc;
 
-    rc = xsm_mem_event_control(d, mec->mode, mec->op);
+    rc = xsm_dm_mem_event_control(d, mec->mode, mec->op);
     if ( rc )
         return rc;
 
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 9229b83..57f02af 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1351,7 +1351,7 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( rc )
                 return rc;
 
-            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            rc = xsm_dm_mem_sharing_op(d, cd, mec->op);
             if ( rc )
             {
                 rcu_unlock_domain(cd);
@@ -1415,7 +1415,7 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( rc )
                 return rc;
 
-            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            rc = xsm_dm_mem_sharing_op(d, cd, mec->op);
             if ( rc )
             {
                 rcu_unlock_domain(cd);
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index ea44e39..1815696 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -678,7 +678,7 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
         return -EINVAL;
     }
 
-    rc = xsm_shadow_control(d, sc->op);
+    rc = xsm_hook_shadow_control(d, sc->op);
     if ( rc )
         return rc;
 
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index e48ad2e..4bad230 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1016,7 +1016,7 @@ int pci_restore_msi_state(struct pci_dev *pdev)
     if (!pdev)
         return -EINVAL;
 
-    ret = xsm_resource_setup_pci((pdev->seg << 16) | (pdev->bus << 8) | pdev->devfn);
+    ret = xsm_priv_resource_setup_pci((pdev->seg << 16) | (pdev->bus << 8) | pdev->devfn);
     if ( ret )
         return ret;
 
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 9c30245..a894c43 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -232,7 +232,7 @@ int physdev_unmap_pirq(domid_t domid, int pirq)
             goto free_domain;
     }
 
-    ret = xsm_unmap_domain_pirq(d, domain_pirq_to_irq(d, pirq));
+    ret = xsm_dm_unmap_domain_pirq(d, domain_pirq_to_irq(d, pirq));
     if ( ret )
         goto free_domain;
 
@@ -423,7 +423,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = xsm_apic(v->domain, cmd);
+        ret = xsm_priv_apic(v->domain, cmd);
         if ( ret )
             break;
         ret = ioapic_guest_read(apic.apic_physbase, apic.reg, &apic.value);
@@ -437,7 +437,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = xsm_apic(v->domain, cmd);
+        ret = xsm_priv_apic(v->domain, cmd);
         if ( ret )
             break;
         ret = ioapic_guest_write(apic.apic_physbase, apic.reg, apic.value);
@@ -453,7 +453,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         /* Use the APIC check since this dummy hypercall should still only
          * be called by the domain with access to program the ioapic */
-        ret = xsm_apic(v->domain, cmd);
+        ret = xsm_priv_apic(v->domain, cmd);
         if ( ret )
             break;
 
@@ -578,7 +578,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_pci_mmcfg_reserved: {
         struct physdev_pci_mmcfg_reserved info;
 
-        ret = xsm_resource_setup_misc();
+        ret = xsm_priv_resource_setup_misc();
         if ( ret )
             break;
 
@@ -632,7 +632,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( setup_gsi.gsi < 0 || setup_gsi.gsi >= nr_irqs_gsi )
             break;
 
-        ret = xsm_resource_setup_gsi(setup_gsi.gsi);
+        ret = xsm_priv_resource_setup_gsi(setup_gsi.gsi);
         if ( ret )
             break;
 
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index f267b8b..c4b20ea 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -72,7 +72,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     if ( op->interface_version != XENPF_INTERFACE_VERSION )
         return -EACCES;
 
-    ret = xsm_platform_op(op->cmd);
+    ret = xsm_priv_platform_op(op->cmd);
     if ( ret )
         return ret;
 
@@ -496,7 +496,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        ret = xsm_resource_plug_core();
+        ret = xsm_hook_resource_plug_core();
         if ( ret )
             break;
 
@@ -512,7 +512,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
             break;
         }
 
-        ret = xsm_resource_plug_core();
+        ret = xsm_hook_resource_plug_core();
         if ( ret )
             break;
 
@@ -525,7 +525,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        ret = xsm_resource_unplug_core();
+        ret = xsm_hook_resource_unplug_core();
         if ( ret )
             break;
 
@@ -554,7 +554,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_cpu_hotadd:
-        ret = xsm_resource_plug_core();
+        ret = xsm_hook_resource_plug_core();
         if ( ret )
             break;
 
@@ -564,7 +564,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_mem_hotadd:
-        ret = xsm_resource_plug_core();
+        ret = xsm_hook_resource_plug_core();
         if ( ret )
             break;
 
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index 5b0c4b7..3a10a13 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -184,14 +184,14 @@ long arch_do_sysctl(
         switch ( sysctl->u.cpu_hotplug.op )
         {
         case XEN_SYSCTL_CPU_HOTPLUG_ONLINE:
-            ret = xsm_resource_plug_core();
+            ret = xsm_hook_resource_plug_core();
             if ( ret )
                 break;
             ret = continue_hypercall_on_cpu(
                 0, cpu_up_helper, (void *)(unsigned long)cpu);
             break;
         case XEN_SYSCTL_CPU_HOTPLUG_OFFLINE:
-            ret = xsm_resource_unplug_core();
+            ret = xsm_hook_resource_unplug_core();
             if ( ret )
                 break;
             ret = continue_hypercall_on_cpu(
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 44a866e..695e991 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1643,7 +1643,7 @@ static int pci_cfg_ok(struct domain *d, int write, int size)
             start |= (d->arch.pci_cf8 >> 16) & 0xF00;
     }
     end = start + size - 1;
-    if (xsm_pci_config_permission(d, machine_bdf, start, end, write))
+    if (xsm_hook_pci_config_permission(d, machine_bdf, start, end, write))
         return 0;
     return 1;
 }
diff --git a/xen/common/domain.c b/xen/common/domain.c
index fcf24e2..296d735 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -252,7 +252,7 @@ struct domain *domain_create(
 
     if ( !is_idle_domain(d) )
     {
-        if ( (err = xsm_domain_create(d, ssidref)) != 0 )
+        if ( (err = xsm_hook_domain_create(d, ssidref)) != 0 )
             goto fail;
 
         d->is_paused_by_controller = 1;
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 6f792e9..1f88ad2 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -150,7 +150,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
     if ( is_hvm_domain(d) )
         info->flags |= XEN_DOMINF_hvm_guest;
 
-    xsm_security_domaininfo(d, info);
+    xsm_populate_security_domaininfo(d, info);
 
     info->tot_pages         = d->tot_pages;
     info->max_pages         = d->max_pages;
@@ -580,7 +580,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             break;
         }
 
-        ret = xsm_getdomaininfo(d);
+        ret = xsm_hook_getdomaininfo(d);
         if ( ret )
             goto getdomaininfo_out;
 
@@ -722,7 +722,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
         if ( pirq >= d->nr_pirqs )
             ret = -EINVAL;
-        else if ( xsm_irq_permission(d, pirq, allow) )
+        else if ( xsm_hook_irq_permission(d, pirq, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = irq_permit_access(d, pirq);
@@ -741,7 +741,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
             break;
 
-        if ( xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, allow) )
+        if ( xsm_hook_iomem_permission(d, mfn, mfn + nr_mfns - 1, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
@@ -773,7 +773,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             break;
         }
 
-        ret = xsm_set_target(d, e);
+        ret = xsm_hook_set_target(d, e);
         if ( ret ) {
             put_domain(e);
             break;
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 37947a9..ef0d89b 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -175,7 +175,7 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
         ERROR_EXIT_DOM(port, d);
     chn = evtchn_from_port(d, port);
 
-    rc = xsm_evtchn_unbound(d, chn, alloc->remote_dom);
+    rc = xsm_target_evtchn_unbound(d, chn, alloc->remote_dom);
     if ( rc )
         goto out;
 
@@ -231,7 +231,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
          (rchn->u.unbound.remote_domid != ld->domain_id) )
         ERROR_EXIT_DOM(-EINVAL, rd);
 
-    rc = xsm_evtchn_interdomain(ld, lchn, rd, rchn);
+    rc = xsm_hook_evtchn_interdomain(ld, lchn, rd, rchn);
     if ( rc )
         goto out;
 
@@ -535,7 +535,7 @@ static long __evtchn_close(struct domain *d1, int port1)
     chn1->state          = ECS_FREE;
     chn1->notify_vcpu_id = 0;
 
-    xsm_evtchn_close_post(chn1);
+    xsm_hook_evtchn_close_post(chn1);
 
  out:
     if ( d2 != NULL )
@@ -580,7 +580,7 @@ int evtchn_send(struct domain *d, unsigned int lport)
         return -EINVAL;
     }
 
-    ret = xsm_evtchn_send(ld, lchn);
+    ret = xsm_hook_evtchn_send(ld, lchn);
     if ( ret )
         goto out;
 
@@ -812,7 +812,7 @@ static long evtchn_status(evtchn_status_t *status)
 
     chn = evtchn_from_port(d, port);
 
-    rc = xsm_evtchn_status(d, chn);
+    rc = xsm_target_evtchn_status(d, chn);
     if ( rc )
         goto out;
 
@@ -954,7 +954,7 @@ static long evtchn_reset(evtchn_reset_t *r)
     if ( d == NULL )
         return -ESRCH;
 
-    rc = xsm_evtchn_reset(current->domain, d);
+    rc = xsm_target_evtchn_reset(current->domain, d);
     if ( rc )
         goto out;
 
@@ -1101,7 +1101,7 @@ int alloc_unbound_xen_event_channel(
         goto out;
     chn = evtchn_from_port(d, port);
 
-    rc = xsm_evtchn_unbound(d, chn, remote_domid);
+    rc = xsm_target_evtchn_unbound(d, chn, remote_domid);
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index eae9518..e3690b6 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -552,7 +552,7 @@ __gnttab_map_grant_ref(
         return;
     }
 
-    rc = xsm_grant_mapref(ld, rd, op->flags);
+    rc = xsm_hook_grant_mapref(ld, rd, op->flags);
     if ( rc )
     {
         rcu_unlock_domain(rd);
@@ -872,7 +872,7 @@ __gnttab_unmap_common(
         return;
     }
 
-    rc = xsm_grant_unmapref(ld, rd);
+    rc = xsm_hook_grant_unmapref(ld, rd);
     if ( rc )
     {
         rcu_unlock_domain(rd);
@@ -1326,7 +1326,7 @@ gnttab_setup_table(
         goto out2;
     }
 
-    if ( xsm_grant_setup(current->domain, d) )
+    if ( xsm_target_grant_setup(current->domain, d) )
     {
         op.status = GNTST_permission_denied;
         goto out2;
@@ -1395,7 +1395,7 @@ gnttab_query_size(
         goto query_out;
     }
 
-    rc = xsm_grant_query_size(current->domain, d);
+    rc = xsm_target_grant_query_size(current->domain, d);
     if ( rc )
     {
         op.status = GNTST_permission_denied;
@@ -1571,7 +1571,7 @@ gnttab_transfer(
             goto copyback;
         }
 
-        if ( xsm_grant_transfer(d, e) )
+        if ( xsm_hook_grant_transfer(d, e) )
         {
             put_gfn(d, gop.mfn);
             gop.status = GNTST_permission_denied;
@@ -2010,7 +2010,7 @@ __gnttab_copy(
         PIN_FAIL(error_out, GNTST_bad_domain,
                  "couldn't find %d\n", op->dest.domid);
 
-    rc = xsm_grant_copy(sd, dd);
+    rc = xsm_hook_grant_copy(sd, dd);
     if ( rc )
     {
         rc = GNTST_permission_denied;
@@ -2267,7 +2267,7 @@ gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop,
         op.status = GNTST_bad_domain;
         goto out1;
     }
-    rc = xsm_grant_setup(current->domain, d);
+    rc = xsm_target_grant_setup(current->domain, d);
     if ( rc ) {
         op.status = GNTST_permission_denied;
         goto out1;
@@ -2318,7 +2318,7 @@ gnttab_get_version(XEN_GUEST_HANDLE_PARAM(gnttab_get_version_t uop))
     if ( d == NULL )
         return -ESRCH;
 
-    rc = xsm_grant_query_size(current->domain, d);
+    rc = xsm_target_grant_query_size(current->domain, d);
     if ( rc )
     {
         rcu_unlock_domain(d);
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index d4f6332..ff9d205 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -852,7 +852,7 @@ static int do_kexec_op_internal(unsigned long op,
     unsigned long flags;
     int ret = -EINVAL;
 
-    ret = xsm_kexec();
+    ret = xsm_priv_kexec();
     if ( ret )
         return ret;
 
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 7d3c326..0e216bb 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -336,7 +336,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
         goto fail_early;
     }
 
-    rc = xsm_memory_exchange(d);
+    rc = xsm_target_memory_exchange(d);
     if ( rc )
     {
         rcu_unlock_domain(d);
@@ -585,7 +585,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return start_extent;
         args.domain = d;
 
-        rc = xsm_memory_adjust_reservation(current->domain, d);
+        rc = xsm_target_memory_adjust_reservation(current->domain, d);
         if ( rc )
         {
             rcu_unlock_domain(d);
@@ -634,7 +634,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        rc = xsm_memory_stat_reservation(current->domain, d);
+        rc = xsm_target_memory_stat_reservation(current->domain, d);
         if ( rc )
         {
             rcu_unlock_domain(d);
@@ -672,7 +672,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        if ( xsm_remove_from_physmap(current->domain, d) )
+        if ( xsm_target_remove_from_physmap(current->domain, d) )
         {
             rcu_unlock_domain(d);
             return -EPERM;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index cfd173d..2cad778 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -921,7 +921,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             break;
 
-        ret = xsm_schedop_shutdown(current->domain, d);
+        ret = xsm_dm_schedop_shutdown(current->domain, d);
         if ( ret )
         {
             rcu_unlock_domain(d);
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index cbefb0e..d6e3f6c 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -57,7 +57,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     {
     case XEN_SYSCTL_readconsole:
     {
-        ret = xsm_readconsole(op->u.readconsole.clear);
+        ret = xsm_hook_readconsole(op->u.readconsole.clear);
         if ( ret )
             break;
 
@@ -100,7 +100,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
             if ( num_domains == op->u.getdomaininfolist.max_domains )
                 break;
 
-            ret = xsm_getdomaininfo(d);
+            ret = xsm_hook_getdomaininfo(d);
             if ( ret )
                 continue;
 
@@ -231,7 +231,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         uint32_t *status, *ptr;
         unsigned long pfn;
 
-        ret = xsm_page_offline(op->u.page_offline.cmd);
+        ret = xsm_hook_page_offline(op->u.page_offline.cmd);
         if ( ret )
             break;
 
diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index ae0435b..7a82e3a 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -680,7 +680,7 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         return -EPERM;
     }
 
-    ret = xsm_profile(current->domain, op);
+    ret = xsm_hook_profile(current->domain, op);
     if ( ret )
         return ret;
 
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index b2c3ee3..b6faa43 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -406,7 +406,7 @@ long do_console_io(int cmd, int count, XEN_GUEST_HANDLE_PARAM(char) buffer)
     long rc;
     unsigned int idx, len;
 
-    rc = xsm_console_io(current->domain, cmd);
+    rc = xsm_priv_console_io(current->domain, cmd);
     if ( rc )
         return rc;
 
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 9d13185..52eff81 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -452,7 +452,7 @@ static int iommu_get_device_group(
              ((pdev->bus == bus) && (pdev->devfn == devfn)) )
             continue;
 
-        if ( xsm_get_device_group((seg << 16) | (pdev->bus << 8) | pdev->devfn) )
+        if ( xsm_hook_get_device_group((seg << 16) | (pdev->bus << 8) | pdev->devfn) )
             continue;
 
         sdev_id = ops->get_device_group_id(seg, pdev->bus, pdev->devfn);
@@ -555,7 +555,7 @@ int iommu_do_domctl(
         u32 max_sdevs;
         XEN_GUEST_HANDLE_64(uint32) sdevs;
 
-        ret = xsm_get_device_group(domctl->u.get_device_group.machine_sbdf);
+        ret = xsm_hook_get_device_group(domctl->u.get_device_group.machine_sbdf);
         if ( ret )
             break;
 
@@ -583,7 +583,7 @@ int iommu_do_domctl(
     break;
 
     case XEN_DOMCTL_test_assign_device:
-        ret = xsm_test_assign_device(domctl->u.assign_device.machine_sbdf);
+        ret = xsm_hook_test_assign_device(domctl->u.assign_device.machine_sbdf);
         if ( ret )
             break;
 
@@ -607,7 +607,7 @@ int iommu_do_domctl(
             break;
         }
 
-        ret = xsm_assign_device(d, domctl->u.assign_device.machine_sbdf);
+        ret = xsm_hook_assign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
             break;
 
@@ -626,7 +626,7 @@ int iommu_do_domctl(
         break;
 
     case XEN_DOMCTL_deassign_device:
-        ret = xsm_deassign_device(d, domctl->u.assign_device.machine_sbdf);
+        ret = xsm_hook_deassign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
             break;
 
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index d5ef4c1..43eceab 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -380,7 +380,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn, const struct pci_dev_info *info)
         pdev_type = "device";
     }
 
-    ret = xsm_resource_plug_pci((seg << 16) | (bus << 8) | devfn);
+    ret = xsm_priv_resource_plug_pci((seg << 16) | (bus << 8) | devfn);
     if ( ret )
         return ret;
 
@@ -496,7 +496,7 @@ int pci_remove_device(u16 seg, u8 bus, u8 devfn)
     struct pci_dev *pdev;
     int ret;
 
-    ret = xsm_resource_unplug_pci((seg << 16) | (bus << 8) | devfn);
+    ret = xsm_priv_resource_unplug_pci((seg << 16) | (bus << 8) | devfn);
     if ( ret )
         return ret;
 
diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h
index 8dec5aa..81d88f3 100644
--- a/xen/include/xen/tmem_xen.h
+++ b/xen/include/xen/tmem_xen.h
@@ -329,12 +329,12 @@ static inline bool_t tmh_set_client_from_id(
 
 static inline bool_t tmh_current_permitted(void)
 {
-    return !xsm_tmem_op();
+    return !xsm_hook_tmem_op();
 }
 
 static inline bool_t tmh_current_is_privileged(void)
 {
-    return !xsm_tmem_control();
+    return !xsm_priv_tmem_control();
 }
 
 static inline uint8_t tmh_get_first_byte(pfp_t *pfp)
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index aaac50d3..09ee3f2 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -11,23 +11,23 @@
 #include <xen/sched.h>
 #include <xsm/xsm.h>
 
-static XSM_INLINE void xsm_security_domaininfo(struct domain *d,
+static XSM_INLINE void xsm_populate_security_domaininfo(struct domain *d,
                                     struct xen_domctl_getdomaininfo *info)
 {
     return;
 }
 
-static XSM_INLINE int xsm_domain_create(struct domain *d, u32 ssidref)
+static XSM_INLINE int xsm_hook_domain_create(struct domain *d, u32 ssidref)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
+static XSM_INLINE int xsm_hook_getdomaininfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
+static XSM_INLINE int xsm_hook_set_target(struct domain *d, struct domain *e)
 {
     return 0;
 }
@@ -58,12 +58,12 @@ static XSM_INLINE int xsm_sysctl(int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_readconsole(uint32_t clear)
+static XSM_INLINE int xsm_hook_readconsole(uint32_t clear)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_do_mca(void)
+static XSM_INLINE int xsm_priv_do_mca(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
@@ -80,49 +80,49 @@ static XSM_INLINE void xsm_free_security_domain(struct domain *d)
     return;
 }
 
-static XSM_INLINE int xsm_grant_mapref(struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_hook_grant_mapref(struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_unmapref(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_hook_grant_unmapref(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_setup(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_grant_setup(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_transfer(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_hook_grant_transfer(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_copy(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_hook_grant_copy(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_grant_query_size(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_grant_query_size(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_memory_exchange(struct domain *d)
+static XSM_INLINE int xsm_target_memory_exchange(struct domain *d)
 {
     if ( d != current->domain && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
+static XSM_INLINE int xsm_target_memory_adjust_reservation(struct domain *d1,
                                                             struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
@@ -130,14 +130,14 @@ static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
     return 0;
 }
 
-static XSM_INLINE int xsm_memory_stat_reservation(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_memory_stat_reservation(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_console_io(struct domain *d, int cmd)
+static XSM_INLINE int xsm_priv_console_io(struct domain *d, int cmd)
 {
 #ifndef VERBOSE
     if ( !IS_PRIV(current->domain) )
@@ -146,32 +146,32 @@ static XSM_INLINE int xsm_console_io(struct domain *d, int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_profile(struct domain *d, int op)
+static XSM_INLINE int xsm_hook_profile(struct domain *d, int op)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_kexec(void)
+static XSM_INLINE int xsm_priv_kexec(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_schedop_shutdown(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_dm_schedop_shutdown(struct domain *d1, struct domain *d2)
 {
     if ( !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_hook_memory_pin_page(struct domain *d1, struct domain *d2,
                                           struct page_info *page)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_evtchn_unbound(struct domain *d, struct evtchn *chn,
+static XSM_INLINE int xsm_target_evtchn_unbound(struct domain *d, struct evtchn *chn,
                                          domid_t id2)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
@@ -179,30 +179,30 @@ static XSM_INLINE int xsm_evtchn_unbound(struct domain *d, struct evtchn *chn,
     return 0;
 }
 
-static XSM_INLINE int xsm_evtchn_interdomain(struct domain *d1, struct evtchn
+static XSM_INLINE int xsm_hook_evtchn_interdomain(struct domain *d1, struct evtchn
                                 *chan1, struct domain *d2, struct evtchn *chan2)
 {
     return 0;
 }
 
-static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
+static XSM_INLINE void xsm_hook_evtchn_close_post(struct evtchn *chn)
 {
     return;
 }
 
-static XSM_INLINE int xsm_evtchn_send(struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_hook_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_evtchn_status(struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_target_evtchn_status(struct domain *d, struct evtchn *chn)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_evtchn_reset(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_evtchn_reset(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
@@ -224,96 +224,96 @@ static XSM_INLINE char * xsm_show_security_evtchn(struct domain *d, const struct
     return NULL;
 }
 
-static XSM_INLINE int xsm_get_pod_target(struct domain *d)
+static XSM_INLINE int xsm_priv_get_pod_target(struct domain *d)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_set_pod_target(struct domain *d)
+static XSM_INLINE int xsm_priv_set_pod_target(struct domain *d)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_get_device_group(uint32_t machine_bdf)
+static XSM_INLINE int xsm_hook_get_device_group(uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_test_assign_device(uint32_t machine_bdf)
+static XSM_INLINE int xsm_hook_test_assign_device(uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_hook_assign_device(struct domain *d, uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_hook_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_plug_core(void)
+static XSM_INLINE int xsm_hook_resource_plug_core(void)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_unplug_core(void)
+static XSM_INLINE int xsm_hook_resource_unplug_core(void)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_plug_pci(uint32_t machine_bdf)
+static XSM_INLINE int xsm_priv_resource_plug_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_unplug_pci(uint32_t machine_bdf)
+static XSM_INLINE int xsm_priv_resource_unplug_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_setup_pci(uint32_t machine_bdf)
+static XSM_INLINE int xsm_priv_resource_setup_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_setup_gsi(int gsi)
+static XSM_INLINE int xsm_priv_resource_setup_gsi(int gsi)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_resource_setup_misc(void)
+static XSM_INLINE int xsm_priv_resource_setup_misc(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_page_offline(uint32_t cmd)
+static XSM_INLINE int xsm_hook_page_offline(uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_tmem_op(void)
+static XSM_INLINE int xsm_hook_tmem_op(void)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_tmem_control(void)
+static XSM_INLINE int xsm_priv_tmem_control(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
@@ -330,34 +330,34 @@ static XSM_INLINE char * xsm_show_irq_sid(int irq)
     return NULL;
 }
 
-static XSM_INLINE int xsm_map_domain_pirq(struct domain *d, int irq, void *data)
+static XSM_INLINE int xsm_hook_map_domain_pirq(struct domain *d, int irq, void *data)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_unmap_domain_pirq(struct domain *d, int irq)
+static XSM_INLINE int xsm_dm_unmap_domain_pirq(struct domain *d, int irq)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_irq_permission(struct domain *d, int pirq, uint8_t allow)
+static XSM_INLINE int xsm_hook_irq_permission(struct domain *d, int pirq, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_iomem_permission(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_hook_iomem_permission(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_iomem_mapping(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_hook_iomem_mapping(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_pci_config_permission(struct domain *d, uint32_t machine_bdf,
+static XSM_INLINE int xsm_hook_pci_config_permission(struct domain *d, uint32_t machine_bdf,
                                         uint16_t start, uint16_t end,
                                         uint8_t access)
 {
@@ -365,96 +365,96 @@ static XSM_INLINE int xsm_pci_config_permission(struct domain *d, uint32_t machi
 }
 
 #ifdef CONFIG_X86
-static XSM_INLINE int xsm_shadow_control(struct domain *d, uint32_t op)
+static XSM_INLINE int xsm_hook_shadow_control(struct domain *d, uint32_t op)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
+static XSM_INLINE int xsm_target_hvm_param(struct domain *d, unsigned long op)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_set_pci_intx_level(struct domain *d)
+static XSM_INLINE int xsm_dm_hvm_set_pci_intx_level(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_set_isa_irq_level(struct domain *d)
+static XSM_INLINE int xsm_dm_hvm_set_isa_irq_level(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_set_pci_link_route(struct domain *d)
+static XSM_INLINE int xsm_dm_hvm_set_pci_link_route(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
+static XSM_INLINE int xsm_dm_hvm_inject_msi(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_event_control(struct domain *d, int mode, int op)
+static XSM_INLINE int xsm_dm_mem_event_control(struct domain *d, int mode, int op)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_event_op(struct domain *d, int op)
+static XSM_INLINE int xsm_dm_mem_event_op(struct domain *d, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
+static XSM_INLINE int xsm_dm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, cd) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
+static XSM_INLINE int xsm_priv_apic(struct domain *d, int cmd)
 {
     if ( !IS_PRIV(d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_platform_op(uint32_t op)
+static XSM_INLINE int xsm_priv_platform_op(uint32_t op)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_machine_memory_map(void)
+static XSM_INLINE int xsm_priv_machine_memory_map(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_domain_memory_map(struct domain *d)
+static XSM_INLINE int xsm_target_domain_memory_map(struct domain *d)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_mmu_update(struct domain *d, struct domain *t,
+static XSM_INLINE int xsm_target_mmu_update(struct domain *d, struct domain *t,
                                      struct domain *f, uint32_t flags)
 {
     if ( t && d != t && !IS_PRIV_FOR(d, t) )
@@ -464,14 +464,14 @@ static XSM_INLINE int xsm_mmu_update(struct domain *d, struct domain *t,
     return 0;
 }
 
-static XSM_INLINE int xsm_mmuext_op(struct domain *d, struct domain *f)
+static XSM_INLINE int xsm_target_mmuext_op(struct domain *d, struct domain *f)
 {
     if ( d != f && !IS_PRIV_FOR(d, f) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f, 
+static XSM_INLINE int xsm_target_update_va_mapping(struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
     if ( d != f && !IS_PRIV_FOR(d, f) )
@@ -479,36 +479,36 @@ static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f,
     return 0;
 }
 
-static XSM_INLINE int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_add_to_physmap(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_target_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_hook_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_unbind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_hook_unbind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_hook_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_ioport_mapping(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_hook_ioport_mapping(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
 }
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 105201e..c3a29b6 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -39,30 +39,30 @@ extern xsm_initcall_t __xsm_initcall_start[], __xsm_initcall_end[];
     __used_section(".xsm_initcall.init") = fn
 
 struct xsm_operations {
-    void (*security_domaininfo) (struct domain *d,
+    void (*populate_security_domaininfo) (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info);
-    int (*domain_create) (struct domain *d, u32 ssidref);
-    int (*getdomaininfo) (struct domain *d);
-    int (*set_target) (struct domain *d, struct domain *e);
+    int (*hook_domain_create) (struct domain *d, u32 ssidref);
+    int (*hook_getdomaininfo) (struct domain *d);
+    int (*hook_set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
     int (*sysctl) (int cmd);
-    int (*readconsole) (uint32_t clear);
-    int (*do_mca) (void);
+    int (*hook_readconsole) (uint32_t clear);
+    int (*priv_do_mca) (void);
 
-    int (*evtchn_unbound) (struct domain *d, struct evtchn *chn, domid_t id2);
-    int (*evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
+    int (*target_evtchn_unbound) (struct domain *d, struct evtchn *chn, domid_t id2);
+    int (*hook_evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
                                         struct domain *d2, struct evtchn *chn2);
-    void (*evtchn_close_post) (struct evtchn *chn);
-    int (*evtchn_send) (struct domain *d, struct evtchn *chn);
-    int (*evtchn_status) (struct domain *d, struct evtchn *chn);
-    int (*evtchn_reset) (struct domain *d1, struct domain *d2);
-
-    int (*grant_mapref) (struct domain *d1, struct domain *d2, uint32_t flags);
-    int (*grant_unmapref) (struct domain *d1, struct domain *d2);
-    int (*grant_setup) (struct domain *d1, struct domain *d2);
-    int (*grant_transfer) (struct domain *d1, struct domain *d2);
-    int (*grant_copy) (struct domain *d1, struct domain *d2);
-    int (*grant_query_size) (struct domain *d1, struct domain *d2);
+    void (*hook_evtchn_close_post) (struct evtchn *chn);
+    int (*hook_evtchn_send) (struct domain *d, struct evtchn *chn);
+    int (*target_evtchn_status) (struct domain *d, struct evtchn *chn);
+    int (*target_evtchn_reset) (struct domain *d1, struct domain *d2);
+
+    int (*hook_grant_mapref) (struct domain *d1, struct domain *d2, uint32_t flags);
+    int (*hook_grant_unmapref) (struct domain *d1, struct domain *d2);
+    int (*target_grant_setup) (struct domain *d1, struct domain *d2);
+    int (*hook_grant_transfer) (struct domain *d1, struct domain *d2);
+    int (*hook_grant_copy) (struct domain *d1, struct domain *d2);
+    int (*target_grant_query_size) (struct domain *d1, struct domain *d2);
 
     int (*alloc_security_domain) (struct domain *d);
     void (*free_security_domain) (struct domain *d);
@@ -70,76 +70,76 @@ struct xsm_operations {
     void (*free_security_evtchn) (struct evtchn *chn);
     char *(*show_security_evtchn) (struct domain *d, const struct evtchn *chn);
 
-    int (*get_pod_target) (struct domain *d);
-    int (*set_pod_target) (struct domain *d);
-    int (*memory_exchange) (struct domain *d);
-    int (*memory_adjust_reservation) (struct domain *d1, struct domain *d2);
-    int (*memory_stat_reservation) (struct domain *d1, struct domain *d2);
-    int (*memory_pin_page) (struct domain *d1, struct domain *d2, struct page_info *page);
-    int (*remove_from_physmap) (struct domain *d1, struct domain *d2);
+    int (*priv_get_pod_target) (struct domain *d);
+    int (*priv_set_pod_target) (struct domain *d);
+    int (*target_memory_exchange) (struct domain *d);
+    int (*target_memory_adjust_reservation) (struct domain *d1, struct domain *d2);
+    int (*target_memory_stat_reservation) (struct domain *d1, struct domain *d2);
+    int (*hook_memory_pin_page) (struct domain *d1, struct domain *d2, struct page_info *page);
+    int (*target_remove_from_physmap) (struct domain *d1, struct domain *d2);
 
-    int (*console_io) (struct domain *d, int cmd);
+    int (*priv_console_io) (struct domain *d, int cmd);
 
-    int (*profile) (struct domain *d, int op);
+    int (*hook_profile) (struct domain *d, int op);
 
-    int (*kexec) (void);
-    int (*schedop_shutdown) (struct domain *d1, struct domain *d2);
+    int (*priv_kexec) (void);
+    int (*dm_schedop_shutdown) (struct domain *d1, struct domain *d2);
 
     char *(*show_irq_sid) (int irq);
-    int (*map_domain_pirq) (struct domain *d, int irq, void *data);
-    int (*unmap_domain_pirq) (struct domain *d, int irq);
-    int (*irq_permission) (struct domain *d, int pirq, uint8_t allow);
-    int (*iomem_permission) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
-    int (*iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
-    int (*pci_config_permission) (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access);
-
-    int (*get_device_group) (uint32_t machine_bdf);
-    int (*test_assign_device) (uint32_t machine_bdf);
-    int (*assign_device) (struct domain *d, uint32_t machine_bdf);
-    int (*deassign_device) (struct domain *d, uint32_t machine_bdf);
-
-    int (*resource_plug_core) (void);
-    int (*resource_unplug_core) (void);
-    int (*resource_plug_pci) (uint32_t machine_bdf);
-    int (*resource_unplug_pci) (uint32_t machine_bdf);
-    int (*resource_setup_pci) (uint32_t machine_bdf);
-    int (*resource_setup_gsi) (int gsi);
-    int (*resource_setup_misc) (void);
-
-    int (*page_offline)(uint32_t cmd);
-    int (*tmem_op)(void);
-    int (*tmem_control)(void);
+    int (*hook_map_domain_pirq) (struct domain *d, int irq, void *data);
+    int (*dm_unmap_domain_pirq) (struct domain *d, int irq);
+    int (*hook_irq_permission) (struct domain *d, int pirq, uint8_t allow);
+    int (*hook_iomem_permission) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
+    int (*hook_iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
+    int (*hook_pci_config_permission) (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access);
+
+    int (*hook_get_device_group) (uint32_t machine_bdf);
+    int (*hook_test_assign_device) (uint32_t machine_bdf);
+    int (*hook_assign_device) (struct domain *d, uint32_t machine_bdf);
+    int (*hook_deassign_device) (struct domain *d, uint32_t machine_bdf);
+
+    int (*hook_resource_plug_core) (void);
+    int (*hook_resource_unplug_core) (void);
+    int (*priv_resource_plug_pci) (uint32_t machine_bdf);
+    int (*priv_resource_unplug_pci) (uint32_t machine_bdf);
+    int (*priv_resource_setup_pci) (uint32_t machine_bdf);
+    int (*priv_resource_setup_gsi) (int gsi);
+    int (*priv_resource_setup_misc) (void);
+
+    int (*hook_page_offline)(uint32_t cmd);
+    int (*hook_tmem_op)(void);
+    int (*priv_tmem_control)(void);
 
     long (*do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
 
 #ifdef CONFIG_X86
-    int (*shadow_control) (struct domain *d, uint32_t op);
-    int (*hvm_param) (struct domain *d, unsigned long op);
-    int (*hvm_set_pci_intx_level) (struct domain *d);
-    int (*hvm_set_isa_irq_level) (struct domain *d);
-    int (*hvm_set_pci_link_route) (struct domain *d);
-    int (*hvm_inject_msi) (struct domain *d);
-    int (*mem_event_control) (struct domain *d, int mode, int op);
-    int (*mem_event_op) (struct domain *d, int op);
-    int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
-    int (*apic) (struct domain *d, int cmd);
+    int (*hook_shadow_control) (struct domain *d, uint32_t op);
+    int (*target_hvm_param) (struct domain *d, unsigned long op);
+    int (*dm_hvm_set_pci_intx_level) (struct domain *d);
+    int (*dm_hvm_set_isa_irq_level) (struct domain *d);
+    int (*dm_hvm_set_pci_link_route) (struct domain *d);
+    int (*dm_hvm_inject_msi) (struct domain *d);
+    int (*dm_mem_event_control) (struct domain *d, int mode, int op);
+    int (*dm_mem_event_op) (struct domain *d, int op);
+    int (*dm_mem_sharing_op) (struct domain *d, struct domain *cd, int op);
+    int (*priv_apic) (struct domain *d, int cmd);
     int (*memtype) (uint32_t access);
-    int (*platform_op) (uint32_t cmd);
-    int (*machine_memory_map) (void);
-    int (*domain_memory_map) (struct domain *d);
+    int (*priv_platform_op) (uint32_t cmd);
+    int (*priv_machine_memory_map) (void);
+    int (*target_domain_memory_map) (struct domain *d);
 #define XSM_MMU_UPDATE_READ      1
 #define XSM_MMU_UPDATE_WRITE     2
 #define XSM_MMU_NORMAL_UPDATE    4
 #define XSM_MMU_MACHPHYS_UPDATE  8
-    int (*mmu_update) (struct domain *d, struct domain *t,
+    int (*target_mmu_update) (struct domain *d, struct domain *t,
                        struct domain *f, uint32_t flags);
-    int (*mmuext_op) (struct domain *d, struct domain *f);
-    int (*update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
-    int (*add_to_physmap) (struct domain *d1, struct domain *d2);
-    int (*bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
-    int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
+    int (*target_mmuext_op) (struct domain *d, struct domain *f);
+    int (*target_update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
+    int (*target_add_to_physmap) (struct domain *d1, struct domain *d2);
+    int (*hook_bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
+    int (*hook_unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
+    int (*hook_ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
+    int (*hook_ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
 #endif
 };
 
@@ -149,25 +149,25 @@ extern struct xsm_operations *xsm_ops;
 
 #ifndef XSM_NO_WRAPPERS
 
-static inline void xsm_security_domaininfo (struct domain *d,
+static inline void xsm_populate_security_domaininfo (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info)
 {
-    xsm_ops->security_domaininfo(d, info);
+    xsm_ops->populate_security_domaininfo(d, info);
 }
 
-static inline int xsm_domain_create (struct domain *d, u32 ssidref)
+static inline int xsm_hook_domain_create (struct domain *d, u32 ssidref)
 {
-    return xsm_ops->domain_create(d, ssidref);
+    return xsm_ops->hook_domain_create(d, ssidref);
 }
 
-static inline int xsm_getdomaininfo (struct domain *d)
+static inline int xsm_hook_getdomaininfo (struct domain *d)
 {
-    return xsm_ops->getdomaininfo(d);
+    return xsm_ops->hook_getdomaininfo(d);
 }
 
-static inline int xsm_set_target (struct domain *d, struct domain *e)
+static inline int xsm_hook_set_target (struct domain *d, struct domain *e)
 {
-    return xsm_ops->set_target(d, e);
+    return xsm_ops->hook_set_target(d, e);
 }
 
 static inline int xsm_domctl (struct domain *d, int cmd)
@@ -180,77 +180,77 @@ static inline int xsm_sysctl (int cmd)
     return xsm_ops->sysctl(cmd);
 }
 
-static inline int xsm_readconsole (uint32_t clear)
+static inline int xsm_hook_readconsole (uint32_t clear)
 {
-    return xsm_ops->readconsole(clear);
+    return xsm_ops->hook_readconsole(clear);
 }
 
-static inline int xsm_do_mca(void)
+static inline int xsm_priv_do_mca(void)
 {
-    return xsm_ops->do_mca();
+    return xsm_ops->priv_do_mca();
 }
 
-static inline int xsm_evtchn_unbound (struct domain *d1, struct evtchn *chn,
+static inline int xsm_target_evtchn_unbound (struct domain *d1, struct evtchn *chn,
                                                                     domid_t id2)
 {
-    return xsm_ops->evtchn_unbound(d1, chn, id2);
+    return xsm_ops->target_evtchn_unbound(d1, chn, id2);
 }
 
-static inline int xsm_evtchn_interdomain (struct domain *d1, 
+static inline int xsm_hook_evtchn_interdomain (struct domain *d1, 
                 struct evtchn *chan1, struct domain *d2, struct evtchn *chan2)
 {
-    return xsm_ops->evtchn_interdomain(d1, chan1, d2, chan2);
+    return xsm_ops->hook_evtchn_interdomain(d1, chan1, d2, chan2);
 }
 
-static inline void xsm_evtchn_close_post (struct evtchn *chn)
+static inline void xsm_hook_evtchn_close_post (struct evtchn *chn)
 {
-    xsm_ops->evtchn_close_post(chn);
+    xsm_ops->hook_evtchn_close_post(chn);
 }
 
-static inline int xsm_evtchn_send (struct domain *d, struct evtchn *chn)
+static inline int xsm_hook_evtchn_send (struct domain *d, struct evtchn *chn)
 {
-    return xsm_ops->evtchn_send(d, chn);
+    return xsm_ops->hook_evtchn_send(d, chn);
 }
 
-static inline int xsm_evtchn_status (struct domain *d, struct evtchn *chn)
+static inline int xsm_target_evtchn_status (struct domain *d, struct evtchn *chn)
 {
-    return xsm_ops->evtchn_status(d, chn);
+    return xsm_ops->target_evtchn_status(d, chn);
 }
 
-static inline int xsm_evtchn_reset (struct domain *d1, struct domain *d2)
+static inline int xsm_target_evtchn_reset (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->evtchn_reset(d1, d2);
+    return xsm_ops->target_evtchn_reset(d1, d2);
 }
 
-static inline int xsm_grant_mapref (struct domain *d1, struct domain *d2,
+static inline int xsm_hook_grant_mapref (struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
-    return xsm_ops->grant_mapref(d1, d2, flags);
+    return xsm_ops->hook_grant_mapref(d1, d2, flags);
 }
 
-static inline int xsm_grant_unmapref (struct domain *d1, struct domain *d2)
+static inline int xsm_hook_grant_unmapref (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_unmapref(d1, d2);
+    return xsm_ops->hook_grant_unmapref(d1, d2);
 }
 
-static inline int xsm_grant_setup (struct domain *d1, struct domain *d2)
+static inline int xsm_target_grant_setup (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_setup(d1, d2);
+    return xsm_ops->target_grant_setup(d1, d2);
 }
 
-static inline int xsm_grant_transfer (struct domain *d1, struct domain *d2)
+static inline int xsm_hook_grant_transfer (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_transfer(d1, d2);
+    return xsm_ops->hook_grant_transfer(d1, d2);
 }
 
-static inline int xsm_grant_copy (struct domain *d1, struct domain *d2)
+static inline int xsm_hook_grant_copy (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_copy(d1, d2);
+    return xsm_ops->hook_grant_copy(d1, d2);
 }
 
-static inline int xsm_grant_query_size (struct domain *d1, struct domain *d2)
+static inline int xsm_target_grant_query_size (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->grant_query_size(d1, d2);
+    return xsm_ops->target_grant_query_size(d1, d2);
 }
 
 static inline int xsm_alloc_security_domain (struct domain *d)
@@ -278,62 +278,62 @@ static inline char *xsm_show_security_evtchn (struct domain *d, const struct evt
     return xsm_ops->show_security_evtchn(d, chn);
 }
 
-static inline int xsm_get_pod_target (struct domain *d)
+static inline int xsm_priv_get_pod_target (struct domain *d)
 {
-    return xsm_ops->get_pod_target(d);
+    return xsm_ops->priv_get_pod_target(d);
 }
 
-static inline int xsm_set_pod_target (struct domain *d)
+static inline int xsm_priv_set_pod_target (struct domain *d)
 {
-    return xsm_ops->set_pod_target(d);
+    return xsm_ops->priv_set_pod_target(d);
 }
 
-static inline int xsm_memory_exchange (struct domain *d)
+static inline int xsm_target_memory_exchange (struct domain *d)
 {
-    return xsm_ops->memory_exchange(d);
+    return xsm_ops->target_memory_exchange(d);
 }
 
-static inline int xsm_memory_adjust_reservation (struct domain *d1, struct
+static inline int xsm_target_memory_adjust_reservation (struct domain *d1, struct
                                                                     domain *d2)
 {
-    return xsm_ops->memory_adjust_reservation(d1, d2);
+    return xsm_ops->target_memory_adjust_reservation(d1, d2);
 }
 
-static inline int xsm_memory_stat_reservation (struct domain *d1,
+static inline int xsm_target_memory_stat_reservation (struct domain *d1,
                                                             struct domain *d2)
 {
-    return xsm_ops->memory_stat_reservation(d1, d2);
+    return xsm_ops->target_memory_stat_reservation(d1, d2);
 }
 
-static inline int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
+static inline int xsm_hook_memory_pin_page(struct domain *d1, struct domain *d2,
                                       struct page_info *page)
 {
-    return xsm_ops->memory_pin_page(d1, d2, page);
+    return xsm_ops->hook_memory_pin_page(d1, d2, page);
 }
 
-static inline int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
+static inline int xsm_target_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->remove_from_physmap(d1, d2);
+    return xsm_ops->target_remove_from_physmap(d1, d2);
 }
 
-static inline int xsm_console_io (struct domain *d, int cmd)
+static inline int xsm_priv_console_io (struct domain *d, int cmd)
 {
-    return xsm_ops->console_io(d, cmd);
+    return xsm_ops->priv_console_io(d, cmd);
 }
 
-static inline int xsm_profile (struct domain *d, int op)
+static inline int xsm_hook_profile (struct domain *d, int op)
 {
-    return xsm_ops->profile(d, op);
+    return xsm_ops->hook_profile(d, op);
 }
 
-static inline int xsm_kexec (void)
+static inline int xsm_priv_kexec (void)
 {
-    return xsm_ops->kexec();
+    return xsm_ops->priv_kexec();
 }
 
-static inline int xsm_schedop_shutdown (struct domain *d1, struct domain *d2)
+static inline int xsm_dm_schedop_shutdown (struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->schedop_shutdown(d1, d2);
+    return xsm_ops->dm_schedop_shutdown(d1, d2);
 }
 
 static inline char *xsm_show_irq_sid (int irq)
@@ -341,104 +341,104 @@ static inline char *xsm_show_irq_sid (int irq)
     return xsm_ops->show_irq_sid(irq);
 }
 
-static inline int xsm_map_domain_pirq (struct domain *d, int irq, void *data)
+static inline int xsm_hook_map_domain_pirq (struct domain *d, int irq, void *data)
 {
-    return xsm_ops->map_domain_pirq(d, irq, data);
+    return xsm_ops->hook_map_domain_pirq(d, irq, data);
 }
 
-static inline int xsm_unmap_domain_pirq (struct domain *d, int irq)
+static inline int xsm_dm_unmap_domain_pirq (struct domain *d, int irq)
 {
-    return xsm_ops->unmap_domain_pirq(d, irq);
+    return xsm_ops->dm_unmap_domain_pirq(d, irq);
 }
 
-static inline int xsm_irq_permission (struct domain *d, int pirq, uint8_t allow)
+static inline int xsm_hook_irq_permission (struct domain *d, int pirq, uint8_t allow)
 {
-    return xsm_ops->irq_permission(d, pirq, allow);
+    return xsm_ops->hook_irq_permission(d, pirq, allow);
 }
 
-static inline int xsm_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static inline int xsm_hook_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return xsm_ops->iomem_permission(d, s, e, allow);
+    return xsm_ops->hook_iomem_permission(d, s, e, allow);
 }
 
-static inline int xsm_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static inline int xsm_hook_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return xsm_ops->iomem_mapping(d, s, e, allow);
+    return xsm_ops->hook_iomem_mapping(d, s, e, allow);
 }
 
-static inline int xsm_pci_config_permission (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
+static inline int xsm_hook_pci_config_permission (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
-    return xsm_ops->pci_config_permission(d, machine_bdf, start, end, access);
+    return xsm_ops->hook_pci_config_permission(d, machine_bdf, start, end, access);
 }
 
-static inline int xsm_get_device_group(uint32_t machine_bdf)
+static inline int xsm_hook_get_device_group(uint32_t machine_bdf)
 {
-    return xsm_ops->get_device_group(machine_bdf);
+    return xsm_ops->hook_get_device_group(machine_bdf);
 }
 
-static inline int xsm_test_assign_device(uint32_t machine_bdf)
+static inline int xsm_hook_test_assign_device(uint32_t machine_bdf)
 {
-    return xsm_ops->test_assign_device(machine_bdf);
+    return xsm_ops->hook_test_assign_device(machine_bdf);
 }
 
-static inline int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
+static inline int xsm_hook_assign_device(struct domain *d, uint32_t machine_bdf)
 {
-    return xsm_ops->assign_device(d, machine_bdf);
+    return xsm_ops->hook_assign_device(d, machine_bdf);
 }
 
-static inline int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
+static inline int xsm_hook_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
-    return xsm_ops->deassign_device(d, machine_bdf);
+    return xsm_ops->hook_deassign_device(d, machine_bdf);
 }
 
-static inline int xsm_resource_plug_pci (uint32_t machine_bdf)
+static inline int xsm_priv_resource_plug_pci (uint32_t machine_bdf)
 {
-    return xsm_ops->resource_plug_pci(machine_bdf);
+    return xsm_ops->priv_resource_plug_pci(machine_bdf);
 }
 
-static inline int xsm_resource_unplug_pci (uint32_t machine_bdf)
+static inline int xsm_priv_resource_unplug_pci (uint32_t machine_bdf)
 {
-    return xsm_ops->resource_unplug_pci(machine_bdf);
+    return xsm_ops->priv_resource_unplug_pci(machine_bdf);
 }
 
-static inline int xsm_resource_plug_core (void)
+static inline int xsm_hook_resource_plug_core (void)
 {
-    return xsm_ops->resource_plug_core();
+    return xsm_ops->hook_resource_plug_core();
 }
 
-static inline int xsm_resource_unplug_core (void)
+static inline int xsm_hook_resource_unplug_core (void)
 {
-    return xsm_ops->resource_unplug_core();
+    return xsm_ops->hook_resource_unplug_core();
 }
 
-static inline int xsm_resource_setup_pci (uint32_t machine_bdf)
+static inline int xsm_priv_resource_setup_pci (uint32_t machine_bdf)
 {
-    return xsm_ops->resource_setup_pci(machine_bdf);
+    return xsm_ops->priv_resource_setup_pci(machine_bdf);
 }
 
-static inline int xsm_resource_setup_gsi (int gsi)
+static inline int xsm_priv_resource_setup_gsi (int gsi)
 {
-    return xsm_ops->resource_setup_gsi(gsi);
+    return xsm_ops->priv_resource_setup_gsi(gsi);
 }
 
-static inline int xsm_resource_setup_misc (void)
+static inline int xsm_priv_resource_setup_misc (void)
 {
-    return xsm_ops->resource_setup_misc();
+    return xsm_ops->priv_resource_setup_misc();
 }
 
-static inline int xsm_page_offline(uint32_t cmd)
+static inline int xsm_hook_page_offline(uint32_t cmd)
 {
-    return xsm_ops->page_offline(cmd);
+    return xsm_ops->hook_page_offline(cmd);
 }
 
-static inline int xsm_tmem_op(void)
+static inline int xsm_hook_tmem_op(void)
 {
-    return xsm_ops->tmem_op();
+    return xsm_ops->hook_tmem_op();
 }
 
-static inline int xsm_tmem_control(void)
+static inline int xsm_priv_tmem_control(void)
 {
-    return xsm_ops->tmem_control();
+    return xsm_ops->priv_tmem_control();
 }
 
 static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
@@ -447,54 +447,54 @@ static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 }
 
 #ifdef CONFIG_X86
-static inline int xsm_shadow_control (struct domain *d, uint32_t op)
+static inline int xsm_hook_shadow_control (struct domain *d, uint32_t op)
 {
-    return xsm_ops->shadow_control(d, op);
+    return xsm_ops->hook_shadow_control(d, op);
 }
 
-static inline int xsm_hvm_param (struct domain *d, unsigned long op)
+static inline int xsm_target_hvm_param (struct domain *d, unsigned long op)
 {
-    return xsm_ops->hvm_param(d, op);
+    return xsm_ops->target_hvm_param(d, op);
 }
 
-static inline int xsm_hvm_set_pci_intx_level (struct domain *d)
+static inline int xsm_dm_hvm_set_pci_intx_level (struct domain *d)
 {
-    return xsm_ops->hvm_set_pci_intx_level(d);
+    return xsm_ops->dm_hvm_set_pci_intx_level(d);
 }
 
-static inline int xsm_hvm_set_isa_irq_level (struct domain *d)
+static inline int xsm_dm_hvm_set_isa_irq_level (struct domain *d)
 {
-    return xsm_ops->hvm_set_isa_irq_level(d);
+    return xsm_ops->dm_hvm_set_isa_irq_level(d);
 }
 
-static inline int xsm_hvm_set_pci_link_route (struct domain *d)
+static inline int xsm_dm_hvm_set_pci_link_route (struct domain *d)
 {
-    return xsm_ops->hvm_set_pci_link_route(d);
+    return xsm_ops->dm_hvm_set_pci_link_route(d);
 }
 
-static inline int xsm_hvm_inject_msi (struct domain *d)
+static inline int xsm_dm_hvm_inject_msi (struct domain *d)
 {
-    return xsm_ops->hvm_inject_msi(d);
+    return xsm_ops->dm_hvm_inject_msi(d);
 }
 
-static inline int xsm_mem_event_control (struct domain *d, int mode, int op)
+static inline int xsm_dm_mem_event_control (struct domain *d, int mode, int op)
 {
-    return xsm_ops->mem_event_control(d, mode, op);
+    return xsm_ops->dm_mem_event_control(d, mode, op);
 }
 
-static inline int xsm_mem_event_op (struct domain *d, int op)
+static inline int xsm_dm_mem_event_op (struct domain *d, int op)
 {
-    return xsm_ops->mem_event_op(d, op);
+    return xsm_ops->dm_mem_event_op(d, op);
 }
 
-static inline int xsm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
+static inline int xsm_dm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
 {
-    return xsm_ops->mem_sharing_op(d, cd, op);
+    return xsm_ops->dm_mem_sharing_op(d, cd, op);
 }
 
-static inline int xsm_apic (struct domain *d, int cmd)
+static inline int xsm_priv_apic (struct domain *d, int cmd)
 {
-    return xsm_ops->apic(d, cmd);
+    return xsm_ops->priv_apic(d, cmd);
 }
 
 static inline int xsm_memtype (uint32_t access)
@@ -502,63 +502,63 @@ static inline int xsm_memtype (uint32_t access)
     return xsm_ops->memtype(access);
 }
 
-static inline int xsm_platform_op (uint32_t op)
+static inline int xsm_priv_platform_op (uint32_t op)
 {
-    return xsm_ops->platform_op(op);
+    return xsm_ops->priv_platform_op(op);
 }
 
-static inline int xsm_machine_memory_map(void)
+static inline int xsm_priv_machine_memory_map(void)
 {
-    return xsm_ops->machine_memory_map();
+    return xsm_ops->priv_machine_memory_map();
 }
 
-static inline int xsm_domain_memory_map(struct domain *d)
+static inline int xsm_target_domain_memory_map(struct domain *d)
 {
-    return xsm_ops->domain_memory_map(d);
+    return xsm_ops->target_domain_memory_map(d);
 }
 
-static inline int xsm_mmu_update (struct domain *d, struct domain *t,
+static inline int xsm_target_mmu_update (struct domain *d, struct domain *t,
                                   struct domain *f, uint32_t flags)
 {
-    return xsm_ops->mmu_update(d, t, f, flags);
+    return xsm_ops->target_mmu_update(d, t, f, flags);
 }
 
-static inline int xsm_mmuext_op (struct domain *d, struct domain *f)
+static inline int xsm_target_mmuext_op (struct domain *d, struct domain *f)
 {
-    return xsm_ops->mmuext_op(d, f);
+    return xsm_ops->target_mmuext_op(d, f);
 }
 
-static inline int xsm_update_va_mapping(struct domain *d, struct domain *f, 
+static inline int xsm_target_update_va_mapping(struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
-    return xsm_ops->update_va_mapping(d, f, pte);
+    return xsm_ops->target_update_va_mapping(d, f, pte);
 }
 
-static inline int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
+static inline int xsm_target_add_to_physmap(struct domain *d1, struct domain *d2)
 {
-    return xsm_ops->add_to_physmap(d1, d2);
+    return xsm_ops->target_add_to_physmap(d1, d2);
 }
 
-static inline int xsm_bind_pt_irq(struct domain *d, 
+static inline int xsm_hook_bind_pt_irq(struct domain *d, 
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_ops->bind_pt_irq(d, bind);
+    return xsm_ops->hook_bind_pt_irq(d, bind);
 }
 
-static inline int xsm_unbind_pt_irq(struct domain *d,
+static inline int xsm_hook_unbind_pt_irq(struct domain *d,
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_ops->unbind_pt_irq(d, bind);
+    return xsm_ops->hook_unbind_pt_irq(d, bind);
 }
 
-static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static inline int xsm_hook_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return xsm_ops->ioport_permission(d, s, e, allow);
+    return xsm_ops->hook_ioport_permission(d, s, e, allow);
 }
 
-static inline int xsm_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static inline int xsm_hook_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return xsm_ops->ioport_mapping(d, s, e, allow);
+    return xsm_ops->hook_ioport_mapping(d, s, e, allow);
 }
 #endif /* CONFIG_X86 */
 #endif /* XSM_NO_WRAPPERS */
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 22c66e5..c29c5af 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -29,98 +29,98 @@ struct xsm_operations dummy_xsm_ops;
 
 void xsm_fixup_ops (struct xsm_operations *ops)
 {
-    set_to_dummy_if_null(ops, security_domaininfo);
-    set_to_dummy_if_null(ops, domain_create);
-    set_to_dummy_if_null(ops, getdomaininfo);
-    set_to_dummy_if_null(ops, set_target);
+    set_to_dummy_if_null(ops, populate_security_domaininfo);
+    set_to_dummy_if_null(ops, hook_domain_create);
+    set_to_dummy_if_null(ops, hook_getdomaininfo);
+    set_to_dummy_if_null(ops, hook_set_target);
     set_to_dummy_if_null(ops, domctl);
     set_to_dummy_if_null(ops, sysctl);
-    set_to_dummy_if_null(ops, readconsole);
-    set_to_dummy_if_null(ops, do_mca);
-
-    set_to_dummy_if_null(ops, evtchn_unbound);
-    set_to_dummy_if_null(ops, evtchn_interdomain);
-    set_to_dummy_if_null(ops, evtchn_close_post);
-    set_to_dummy_if_null(ops, evtchn_send);
-    set_to_dummy_if_null(ops, evtchn_status);
-    set_to_dummy_if_null(ops, evtchn_reset);
-
-    set_to_dummy_if_null(ops, grant_mapref);
-    set_to_dummy_if_null(ops, grant_unmapref);
-    set_to_dummy_if_null(ops, grant_setup);
-    set_to_dummy_if_null(ops, grant_transfer);
-    set_to_dummy_if_null(ops, grant_copy);
-    set_to_dummy_if_null(ops, grant_query_size);
+    set_to_dummy_if_null(ops, hook_readconsole);
+    set_to_dummy_if_null(ops, priv_do_mca);
+
+    set_to_dummy_if_null(ops, target_evtchn_unbound);
+    set_to_dummy_if_null(ops, hook_evtchn_interdomain);
+    set_to_dummy_if_null(ops, hook_evtchn_close_post);
+    set_to_dummy_if_null(ops, hook_evtchn_send);
+    set_to_dummy_if_null(ops, target_evtchn_status);
+    set_to_dummy_if_null(ops, target_evtchn_reset);
+
+    set_to_dummy_if_null(ops, hook_grant_mapref);
+    set_to_dummy_if_null(ops, hook_grant_unmapref);
+    set_to_dummy_if_null(ops, target_grant_setup);
+    set_to_dummy_if_null(ops, hook_grant_transfer);
+    set_to_dummy_if_null(ops, hook_grant_copy);
+    set_to_dummy_if_null(ops, target_grant_query_size);
 
     set_to_dummy_if_null(ops, alloc_security_domain);
     set_to_dummy_if_null(ops, free_security_domain);
     set_to_dummy_if_null(ops, alloc_security_evtchn);
     set_to_dummy_if_null(ops, free_security_evtchn);
     set_to_dummy_if_null(ops, show_security_evtchn);
-    set_to_dummy_if_null(ops, get_pod_target);
-    set_to_dummy_if_null(ops, set_pod_target);
+    set_to_dummy_if_null(ops, priv_get_pod_target);
+    set_to_dummy_if_null(ops, priv_set_pod_target);
 
-    set_to_dummy_if_null(ops, memory_exchange);
-    set_to_dummy_if_null(ops, memory_adjust_reservation);
-    set_to_dummy_if_null(ops, memory_stat_reservation);
-    set_to_dummy_if_null(ops, memory_pin_page);
+    set_to_dummy_if_null(ops, target_memory_exchange);
+    set_to_dummy_if_null(ops, target_memory_adjust_reservation);
+    set_to_dummy_if_null(ops, target_memory_stat_reservation);
+    set_to_dummy_if_null(ops, hook_memory_pin_page);
 
-    set_to_dummy_if_null(ops, console_io);
+    set_to_dummy_if_null(ops, priv_console_io);
 
-    set_to_dummy_if_null(ops, profile);
+    set_to_dummy_if_null(ops, hook_profile);
 
-    set_to_dummy_if_null(ops, kexec);
-    set_to_dummy_if_null(ops, schedop_shutdown);
+    set_to_dummy_if_null(ops, priv_kexec);
+    set_to_dummy_if_null(ops, dm_schedop_shutdown);
 
     set_to_dummy_if_null(ops, show_irq_sid);
-    set_to_dummy_if_null(ops, map_domain_pirq);
-    set_to_dummy_if_null(ops, unmap_domain_pirq);
-    set_to_dummy_if_null(ops, irq_permission);
-    set_to_dummy_if_null(ops, iomem_permission);
-    set_to_dummy_if_null(ops, iomem_mapping);
-    set_to_dummy_if_null(ops, pci_config_permission);
-
-    set_to_dummy_if_null(ops, get_device_group);
-    set_to_dummy_if_null(ops, test_assign_device);
-    set_to_dummy_if_null(ops, assign_device);
-    set_to_dummy_if_null(ops, deassign_device);
-
-    set_to_dummy_if_null(ops, resource_plug_core);
-    set_to_dummy_if_null(ops, resource_unplug_core);
-    set_to_dummy_if_null(ops, resource_plug_pci);
-    set_to_dummy_if_null(ops, resource_unplug_pci);
-    set_to_dummy_if_null(ops, resource_setup_pci);
-    set_to_dummy_if_null(ops, resource_setup_gsi);
-    set_to_dummy_if_null(ops, resource_setup_misc);
-
-    set_to_dummy_if_null(ops, page_offline);
-    set_to_dummy_if_null(ops, tmem_op);
-    set_to_dummy_if_null(ops, tmem_control);
+    set_to_dummy_if_null(ops, hook_map_domain_pirq);
+    set_to_dummy_if_null(ops, dm_unmap_domain_pirq);
+    set_to_dummy_if_null(ops, hook_irq_permission);
+    set_to_dummy_if_null(ops, hook_iomem_permission);
+    set_to_dummy_if_null(ops, hook_iomem_mapping);
+    set_to_dummy_if_null(ops, hook_pci_config_permission);
+
+    set_to_dummy_if_null(ops, hook_get_device_group);
+    set_to_dummy_if_null(ops, hook_test_assign_device);
+    set_to_dummy_if_null(ops, hook_assign_device);
+    set_to_dummy_if_null(ops, hook_deassign_device);
+
+    set_to_dummy_if_null(ops, hook_resource_plug_core);
+    set_to_dummy_if_null(ops, hook_resource_unplug_core);
+    set_to_dummy_if_null(ops, priv_resource_plug_pci);
+    set_to_dummy_if_null(ops, priv_resource_unplug_pci);
+    set_to_dummy_if_null(ops, priv_resource_setup_pci);
+    set_to_dummy_if_null(ops, priv_resource_setup_gsi);
+    set_to_dummy_if_null(ops, priv_resource_setup_misc);
+
+    set_to_dummy_if_null(ops, hook_page_offline);
+    set_to_dummy_if_null(ops, hook_tmem_op);
+    set_to_dummy_if_null(ops, priv_tmem_control);
 
     set_to_dummy_if_null(ops, do_xsm_op);
 
 #ifdef CONFIG_X86
-    set_to_dummy_if_null(ops, shadow_control);
-    set_to_dummy_if_null(ops, hvm_param);
-    set_to_dummy_if_null(ops, hvm_set_pci_intx_level);
-    set_to_dummy_if_null(ops, hvm_set_isa_irq_level);
-    set_to_dummy_if_null(ops, hvm_set_pci_link_route);
-    set_to_dummy_if_null(ops, hvm_inject_msi);
-    set_to_dummy_if_null(ops, mem_event_control);
-    set_to_dummy_if_null(ops, mem_event_op);
-    set_to_dummy_if_null(ops, mem_sharing_op);
-    set_to_dummy_if_null(ops, apic);
-    set_to_dummy_if_null(ops, platform_op);
-    set_to_dummy_if_null(ops, machine_memory_map);
-    set_to_dummy_if_null(ops, domain_memory_map);
-    set_to_dummy_if_null(ops, mmu_update);
-    set_to_dummy_if_null(ops, mmuext_op);
-    set_to_dummy_if_null(ops, update_va_mapping);
-    set_to_dummy_if_null(ops, add_to_physmap);
-    set_to_dummy_if_null(ops, remove_from_physmap);
-    set_to_dummy_if_null(ops, bind_pt_irq);
-    set_to_dummy_if_null(ops, unbind_pt_irq);
-    set_to_dummy_if_null(ops, ioport_permission);
-    set_to_dummy_if_null(ops, ioport_mapping);
+    set_to_dummy_if_null(ops, hook_shadow_control);
+    set_to_dummy_if_null(ops, target_hvm_param);
+    set_to_dummy_if_null(ops, dm_hvm_set_pci_intx_level);
+    set_to_dummy_if_null(ops, dm_hvm_set_isa_irq_level);
+    set_to_dummy_if_null(ops, dm_hvm_set_pci_link_route);
+    set_to_dummy_if_null(ops, dm_hvm_inject_msi);
+    set_to_dummy_if_null(ops, dm_mem_event_control);
+    set_to_dummy_if_null(ops, dm_mem_event_op);
+    set_to_dummy_if_null(ops, dm_mem_sharing_op);
+    set_to_dummy_if_null(ops, priv_apic);
+    set_to_dummy_if_null(ops, priv_platform_op);
+    set_to_dummy_if_null(ops, priv_machine_memory_map);
+    set_to_dummy_if_null(ops, target_domain_memory_map);
+    set_to_dummy_if_null(ops, target_mmu_update);
+    set_to_dummy_if_null(ops, target_mmuext_op);
+    set_to_dummy_if_null(ops, target_update_va_mapping);
+    set_to_dummy_if_null(ops, target_add_to_physmap);
+    set_to_dummy_if_null(ops, target_remove_from_physmap);
+    set_to_dummy_if_null(ops, hook_bind_pt_irq);
+    set_to_dummy_if_null(ops, hook_unbind_pt_irq);
+    set_to_dummy_if_null(ops, hook_ioport_permission);
+    set_to_dummy_if_null(ops, hook_ioport_mapping);
 #endif
 }
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 03ea675..2c46276 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -171,7 +171,7 @@ static void flask_domain_free_security(struct domain *d)
     xfree(dsec);
 }
 
-static int flask_evtchn_unbound(struct domain *d1, struct evtchn *chn, 
+static int flask_target_evtchn_unbound(struct domain *d1, struct evtchn *chn, 
                                 domid_t id2)
 {
     u32 sid1, sid2, newsid;
@@ -206,7 +206,7 @@ static int flask_evtchn_unbound(struct domain *d1, struct evtchn *chn,
     return rc;
 }
 
-static int flask_evtchn_interdomain(struct domain *d1, struct evtchn *chn1, 
+static int flask_hook_evtchn_interdomain(struct domain *d1, struct evtchn *chn1, 
                                     struct domain *d2, struct evtchn *chn2)
 {
     u32 sid1, sid2, newsid, reverse_sid;
@@ -252,7 +252,7 @@ static int flask_evtchn_interdomain(struct domain *d1, struct evtchn *chn1,
     return rc;
 }
 
-static void flask_evtchn_close_post(struct evtchn *chn)
+static void flask_hook_evtchn_close_post(struct evtchn *chn)
 {
     struct evtchn_security_struct *esec;
     esec = chn->ssid;
@@ -260,7 +260,7 @@ static void flask_evtchn_close_post(struct evtchn *chn)
     esec->sid = SECINITSID_UNLABELED;
 }
 
-static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
+static int flask_hook_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     int rc;
 
@@ -280,12 +280,12 @@ static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
     return rc;
 }
 
-static int flask_evtchn_status(struct domain *d, struct evtchn *chn)
+static int flask_target_evtchn_status(struct domain *d, struct evtchn *chn)
 {
     return domain_has_evtchn(d, chn, EVENT__STATUS);
 }
 
-static int flask_evtchn_reset(struct domain *d1, struct domain *d2)
+static int flask_target_evtchn_reset(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_EVENT, EVENT__RESET);
 }
@@ -350,7 +350,7 @@ static char *flask_show_security_evtchn(struct domain *d, const struct evtchn *c
     return ctx;
 }
 
-static int flask_grant_mapref(struct domain *d1, struct domain *d2, 
+static int flask_hook_grant_mapref(struct domain *d1, struct domain *d2, 
                               uint32_t flags)
 {
     u32 perms = GRANT__MAP_READ;
@@ -361,63 +361,63 @@ static int flask_grant_mapref(struct domain *d1, struct domain *d2,
     return domain_has_perm(d1, d2, SECCLASS_GRANT, perms);
 }
 
-static int flask_grant_unmapref(struct domain *d1, struct domain *d2)
+static int flask_hook_grant_unmapref(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__UNMAP);
 }
 
-static int flask_grant_setup(struct domain *d1, struct domain *d2)
+static int flask_target_grant_setup(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__SETUP);
 }
 
-static int flask_grant_transfer(struct domain *d1, struct domain *d2)
+static int flask_hook_grant_transfer(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__TRANSFER);
 }
 
-static int flask_grant_copy(struct domain *d1, struct domain *d2)
+static int flask_hook_grant_copy(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__COPY);
 }
 
-static int flask_grant_query_size(struct domain *d1, struct domain *d2)
+static int flask_target_grant_query_size(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__QUERY);
 }
 
-static int flask_get_pod_target(struct domain *d)
+static int flask_priv_get_pod_target(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETPODTARGET);
 }
 
-static int flask_set_pod_target(struct domain *d)
+static int flask_priv_set_pod_target(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETPODTARGET);
 }
 
-static int flask_memory_exchange(struct domain *d)
+static int flask_target_memory_exchange(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_MMU, MMU__EXCHANGE);
 }
 
-static int flask_memory_adjust_reservation(struct domain *d1, struct domain *d2)
+static int flask_target_memory_adjust_reservation(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__ADJUST);
 }
 
-static int flask_memory_stat_reservation(struct domain *d1, struct domain *d2)
+static int flask_target_memory_stat_reservation(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__STAT);
 }
 
-static int flask_memory_pin_page(struct domain *d1, struct domain *d2,
+static int flask_hook_memory_pin_page(struct domain *d1, struct domain *d2,
                                  struct page_info *page)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PINPAGE);
 }
 
-static int flask_console_io(struct domain *d, int cmd)
+static int flask_priv_console_io(struct domain *d, int cmd)
 {
     u32 perm;
 
@@ -436,7 +436,7 @@ static int flask_console_io(struct domain *d, int cmd)
     return domain_has_xen(d, perm);
 }
 
-static int flask_profile(struct domain *d, int op)
+static int flask_hook_profile(struct domain *d, int op)
 {
     u32 perm;
 
@@ -468,23 +468,23 @@ static int flask_profile(struct domain *d, int op)
     return domain_has_xen(d, perm);
 }
 
-static int flask_kexec(void)
+static int flask_priv_kexec(void)
 {
     return domain_has_xen(current->domain, XEN__KEXEC);
 }
 
-static int flask_schedop_shutdown(struct domain *d1, struct domain *d2)
+static int flask_dm_schedop_shutdown(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_DOMAIN, DOMAIN__SHUTDOWN);
 }
 
-static void flask_security_domaininfo(struct domain *d, 
+static void flask_populate_security_domaininfo(struct domain *d, 
                                       struct xen_domctl_getdomaininfo *info)
 {
     info->ssidref = domain_sid(d);
 }
 
-static int flask_domain_create(struct domain *d, u32 ssidref)
+static int flask_hook_domain_create(struct domain *d, u32 ssidref)
 {
     int rc;
     struct domain_security_struct *dsec = d->ssid;
@@ -512,12 +512,12 @@ static int flask_domain_create(struct domain *d, u32 ssidref)
     return rc;
 }
 
-static int flask_getdomaininfo(struct domain *d)
+static int flask_hook_getdomaininfo(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO);
 }
 
-static int flask_set_target(struct domain *d, struct domain *t)
+static int flask_hook_set_target(struct domain *d, struct domain *t)
 {
     int rc;
     struct domain_security_struct *dsec, *tsec;
@@ -753,7 +753,7 @@ static int flask_sysctl(int cmd)
     }
 }
 
-static int flask_readconsole(uint32_t clear)
+static int flask_hook_readconsole(uint32_t clear)
 {
     u32 perms = XEN__READCONSOLE;
 
@@ -763,7 +763,7 @@ static int flask_readconsole(uint32_t clear)
     return domain_has_xen(current->domain, perms);
 }
 
-static int flask_do_mca(void)
+static int flask_priv_do_mca(void)
 {
     return domain_has_xen(current->domain, XEN__MCA_OP);
 }
@@ -790,7 +790,7 @@ static char *flask_show_irq_sid (int irq)
     return ctx;
 }
 
-static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
+static int flask_hook_map_domain_pirq (struct domain *d, int irq, void *data)
 {
     u32 sid, dsid;
     int rc = -EPERM;
@@ -823,7 +823,7 @@ static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
     return rc;
 }
 
-static int flask_unmap_domain_pirq (struct domain *d, int irq)
+static int flask_dm_unmap_domain_pirq (struct domain *d, int irq)
 {
     u32 sid;
     int rc = -EPERM;
@@ -846,7 +846,7 @@ static int flask_unmap_domain_pirq (struct domain *d, int irq)
     return rc;
 }
 
-static int flask_irq_permission (struct domain *d, int pirq, uint8_t access)
+static int flask_hook_irq_permission (struct domain *d, int pirq, uint8_t access)
 {
     /* the PIRQ number is not useful; real IRQ is checked during mapping */
     return current_has_perm(d, SECCLASS_RESOURCE, resource_to_perm(access));
@@ -876,7 +876,7 @@ static int _iomem_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     return avc_has_perm(data->dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
+static int flask_hook_iomem_permission(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
 {
     struct iomem_has_perm_data data;
     int rc;
@@ -897,12 +897,12 @@ static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end
     return security_iterate_iomem_sids(start, end, _iomem_has_perm, &data);
 }
 
-static int flask_iomem_mapping(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
+static int flask_hook_iomem_mapping(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
 {
-    return flask_iomem_permission(d, start, end, access);
+    return flask_hook_iomem_permission(d, start, end, access);
 }
 
-static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
+static int flask_hook_pci_config_permission(struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
     u32 dsid, rsid;
     int rc = -EPERM;
@@ -924,12 +924,12 @@ static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, u
 
 }
 
-static int flask_resource_plug_core(void)
+static int flask_hook_resource_plug_core(void)
 {
     return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__PLUG, NULL);
 }
 
-static int flask_resource_unplug_core(void)
+static int flask_hook_resource_unplug_core(void)
 {
     return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__UNPLUG, NULL);
 }
@@ -939,7 +939,7 @@ static int flask_resource_use_core(void)
     return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__USE, NULL);
 }
 
-static int flask_resource_plug_pci(uint32_t machine_bdf)
+static int flask_priv_resource_plug_pci(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -954,7 +954,7 @@ static int flask_resource_plug_pci(uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__PLUG, &ad);
 }
 
-static int flask_resource_unplug_pci(uint32_t machine_bdf)
+static int flask_priv_resource_unplug_pci(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -969,7 +969,7 @@ static int flask_resource_unplug_pci(uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__UNPLUG, &ad);
 }
 
-static int flask_resource_setup_pci(uint32_t machine_bdf)
+static int flask_priv_resource_setup_pci(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -984,7 +984,7 @@ static int flask_resource_setup_pci(uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
-static int flask_resource_setup_gsi(int gsi)
+static int flask_priv_resource_setup_gsi(int gsi)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -997,18 +997,18 @@ static int flask_resource_setup_gsi(int gsi)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
-static int flask_resource_setup_misc(void)
+static int flask_priv_resource_setup_misc(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);
 }
 
-static inline int flask_page_offline(uint32_t cmd)
+static inline int flask_hook_page_offline(uint32_t cmd)
 {
     switch (cmd) {
     case sysctl_page_offline:
-        return flask_resource_unplug_core();
+        return flask_hook_resource_unplug_core();
     case sysctl_page_online:
-        return flask_resource_plug_core();
+        return flask_hook_resource_plug_core();
     case sysctl_query_page_offline:
         return flask_resource_use_core();
     default:
@@ -1016,18 +1016,18 @@ static inline int flask_page_offline(uint32_t cmd)
     }
 }
 
-static inline int flask_tmem_op(void)
+static inline int flask_hook_tmem_op(void)
 {
     return domain_has_xen(current->domain, XEN__TMEM_OP);
 }
 
-static inline int flask_tmem_control(void)
+static inline int flask_priv_tmem_control(void)
 {
     return domain_has_xen(current->domain, XEN__TMEM_CONTROL);
 }
 
 #ifdef CONFIG_X86
-static int flask_shadow_control(struct domain *d, uint32_t op)
+static int flask_hook_shadow_control(struct domain *d, uint32_t op)
 {
     u32 perm;
 
@@ -1079,7 +1079,7 @@ static int _ioport_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     return avc_has_perm(data->dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
+static int flask_hook_ioport_permission(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
 {
     int rc;
     struct ioport_has_perm_data data;
@@ -1101,12 +1101,12 @@ static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t en
     return security_iterate_ioport_sids(start, end, _ioport_has_perm, &data);
 }
 
-static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
+static int flask_hook_ioport_mapping(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
 {
-    return flask_ioport_permission(d, start, end, access);
+    return flask_hook_ioport_permission(d, start, end, access);
 }
 
-static int flask_hvm_param(struct domain *d, unsigned long op)
+static int flask_target_hvm_param(struct domain *d, unsigned long op)
 {
     u32 perm;
 
@@ -1128,37 +1128,37 @@ static int flask_hvm_param(struct domain *d, unsigned long op)
     return current_has_perm(d, SECCLASS_HVM, perm);
 }
 
-static int flask_hvm_set_pci_intx_level(struct domain *d)
+static int flask_dm_hvm_set_pci_intx_level(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__PCILEVEL);
 }
 
-static int flask_hvm_set_isa_irq_level(struct domain *d)
+static int flask_dm_hvm_set_isa_irq_level(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__IRQLEVEL);
 }
 
-static int flask_hvm_set_pci_link_route(struct domain *d)
+static int flask_dm_hvm_set_pci_link_route(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__PCIROUTE);
 }
 
-static int flask_hvm_inject_msi(struct domain *d)
+static int flask_dm_hvm_inject_msi(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
-static int flask_mem_event_control(struct domain *d, int mode, int op)
+static int flask_dm_mem_event_control(struct domain *d, int mode, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
 
-static int flask_mem_event_op(struct domain *d, int op)
+static int flask_dm_mem_event_op(struct domain *d, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
 
-static int flask_mem_sharing_op(struct domain *d, struct domain *cd, int op)
+static int flask_dm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     int rc = current_has_perm(cd, SECCLASS_HVM, HVM__MEM_SHARING);
     if ( rc )
@@ -1166,7 +1166,7 @@ static int flask_mem_sharing_op(struct domain *d, struct domain *cd, int op)
     return domain_has_perm(d, cd, SECCLASS_HVM, HVM__SHARE_MEM);
 }
 
-static int flask_apic(struct domain *d, int cmd)
+static int flask_priv_apic(struct domain *d, int cmd)
 {
     u32 perm;
 
@@ -1186,7 +1186,7 @@ static int flask_apic(struct domain *d, int cmd)
     return domain_has_xen(d, perm);
 }
 
-static int flask_platform_op(uint32_t op)
+static int flask_priv_platform_op(uint32_t op)
 {
     switch ( op )
     {
@@ -1241,22 +1241,22 @@ static int flask_platform_op(uint32_t op)
         return domain_has_xen(current->domain, XEN__GETCPUINFO);
 
     default:
-        printk("flask_platform_op: Unknown op %d\n", op);
+        printk("flask_priv_platform_op: Unknown op %d\n", op);
         return -EPERM;
     }
 }
 
-static int flask_machine_memory_map(void)
+static int flask_priv_machine_memory_map(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_MMU, MMU__MEMORYMAP, NULL);
 }
 
-static int flask_domain_memory_map(struct domain *d)
+static int flask_target_domain_memory_map(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_MMU, MMU__MEMORYMAP);
 }
 
-static int flask_mmu_update(struct domain *d, struct domain *t,
+static int flask_target_mmu_update(struct domain *d, struct domain *t,
                             struct domain *f, uint32_t flags)
 {
     int rc = 0;
@@ -1279,12 +1279,12 @@ static int flask_mmu_update(struct domain *d, struct domain *t,
     return rc;
 }
 
-static int flask_mmuext_op(struct domain *d, struct domain *f)
+static int flask_target_mmuext_op(struct domain *d, struct domain *f)
 {
     return domain_has_perm(d, f, SECCLASS_MMU, MMU__MMUEXT_OP);
 }
 
-static int flask_update_va_mapping(struct domain *d, struct domain *f,
+static int flask_target_update_va_mapping(struct domain *d, struct domain *f,
                                    l1_pgentry_t pte)
 {
     u32 map_perms = MMU__MAP_READ;
@@ -1296,17 +1296,17 @@ static int flask_update_va_mapping(struct domain *d, struct domain *f,
     return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
 }
 
-static int flask_add_to_physmap(struct domain *d1, struct domain *d2)
+static int flask_target_add_to_physmap(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP);
 }
 
-static int flask_remove_from_physmap(struct domain *d1, struct domain *d2)
+static int flask_target_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP);
 }
 
-static int flask_get_device_group(uint32_t machine_bdf)
+static int flask_hook_get_device_group(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -1330,7 +1330,7 @@ static int flask_test_assign_device(uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
 }
 
-static int flask_assign_device(struct domain *d, uint32_t machine_bdf)
+static int flask_hook_assign_device(struct domain *d, uint32_t machine_bdf)
 {
     u32 dsid, rsid;
     int rc = -EPERM;
@@ -1354,7 +1354,7 @@ static int flask_assign_device(struct domain *d, uint32_t machine_bdf)
     return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_deassign_device(struct domain *d, uint32_t machine_bdf)
+static int flask_hook_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
@@ -1370,7 +1370,7 @@ static int flask_deassign_device(struct domain *d, uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__REMOVE_DEVICE, NULL);
 }
 
-static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static int flask_hook_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     u32 dsid, rsid;
     int rc = -EPERM;
@@ -1395,7 +1395,7 @@ static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *b
     return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static int flask_hook_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
@@ -1404,28 +1404,28 @@ static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq
 long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
 
 static struct xsm_operations flask_ops = {
-    .security_domaininfo = flask_security_domaininfo,
-    .domain_create = flask_domain_create,
-    .getdomaininfo = flask_getdomaininfo,
-    .set_target = flask_set_target,
+    .populate_security_domaininfo = flask_populate_security_domaininfo,
+    .hook_domain_create = flask_hook_domain_create,
+    .hook_getdomaininfo = flask_hook_getdomaininfo,
+    .hook_set_target = flask_hook_set_target,
     .domctl = flask_domctl,
     .sysctl = flask_sysctl,
-    .readconsole = flask_readconsole,
-    .do_mca = flask_do_mca,
-
-    .evtchn_unbound = flask_evtchn_unbound,
-    .evtchn_interdomain = flask_evtchn_interdomain,
-    .evtchn_close_post = flask_evtchn_close_post,
-    .evtchn_send = flask_evtchn_send,
-    .evtchn_status = flask_evtchn_status,
-    .evtchn_reset = flask_evtchn_reset,
-
-    .grant_mapref = flask_grant_mapref,
-    .grant_unmapref = flask_grant_unmapref,
-    .grant_setup = flask_grant_setup,
-    .grant_transfer = flask_grant_transfer,
-    .grant_copy = flask_grant_copy,
-    .grant_query_size = flask_grant_query_size,
+    .hook_readconsole = flask_hook_readconsole,
+    .priv_do_mca = flask_priv_do_mca,
+
+    .target_evtchn_unbound = flask_target_evtchn_unbound,
+    .hook_evtchn_interdomain = flask_hook_evtchn_interdomain,
+    .hook_evtchn_close_post = flask_hook_evtchn_close_post,
+    .hook_evtchn_send = flask_hook_evtchn_send,
+    .target_evtchn_status = flask_target_evtchn_status,
+    .target_evtchn_reset = flask_target_evtchn_reset,
+
+    .hook_grant_mapref = flask_hook_grant_mapref,
+    .hook_grant_unmapref = flask_hook_grant_unmapref,
+    .target_grant_setup = flask_target_grant_setup,
+    .hook_grant_transfer = flask_hook_grant_transfer,
+    .hook_grant_copy = flask_hook_grant_copy,
+    .target_grant_query_size = flask_target_grant_query_size,
 
     .alloc_security_domain = flask_domain_alloc_security,
     .free_security_domain = flask_domain_free_security,
@@ -1433,70 +1433,70 @@ static struct xsm_operations flask_ops = {
     .free_security_evtchn = flask_free_security_evtchn,
     .show_security_evtchn = flask_show_security_evtchn,
 
-    .get_pod_target = flask_get_pod_target,
-    .set_pod_target = flask_set_pod_target,
-    .memory_exchange = flask_memory_exchange,
-    .memory_adjust_reservation = flask_memory_adjust_reservation,
-    .memory_stat_reservation = flask_memory_stat_reservation,
-    .memory_pin_page = flask_memory_pin_page,
+    .priv_get_pod_target = flask_priv_get_pod_target,
+    .priv_set_pod_target = flask_priv_set_pod_target,
+    .target_memory_exchange = flask_target_memory_exchange,
+    .target_memory_adjust_reservation = flask_target_memory_adjust_reservation,
+    .target_memory_stat_reservation = flask_target_memory_stat_reservation,
+    .hook_memory_pin_page = flask_hook_memory_pin_page,
 
-    .console_io = flask_console_io,
+    .priv_console_io = flask_priv_console_io,
 
-    .profile = flask_profile,
+    .hook_profile = flask_hook_profile,
 
-    .kexec = flask_kexec,
-    .schedop_shutdown = flask_schedop_shutdown,
+    .priv_kexec = flask_priv_kexec,
+    .dm_schedop_shutdown = flask_dm_schedop_shutdown,
 
     .show_irq_sid = flask_show_irq_sid,
 
-    .map_domain_pirq = flask_map_domain_pirq,
-    .unmap_domain_pirq = flask_unmap_domain_pirq,
-    .irq_permission = flask_irq_permission,
-    .iomem_permission = flask_iomem_permission,
-    .iomem_mapping = flask_iomem_mapping,
-    .pci_config_permission = flask_pci_config_permission,
-
-    .resource_plug_core = flask_resource_plug_core,
-    .resource_unplug_core = flask_resource_unplug_core,
-    .resource_plug_pci = flask_resource_plug_pci,
-    .resource_unplug_pci = flask_resource_unplug_pci,
-    .resource_setup_pci = flask_resource_setup_pci,
-    .resource_setup_gsi = flask_resource_setup_gsi,
-    .resource_setup_misc = flask_resource_setup_misc,
-
-    .page_offline = flask_page_offline,
-    .tmem_op = flask_tmem_op,
-    .tmem_control = flask_tmem_control,
+    .hook_map_domain_pirq = flask_hook_map_domain_pirq,
+    .dm_unmap_domain_pirq = flask_dm_unmap_domain_pirq,
+    .hook_irq_permission = flask_hook_irq_permission,
+    .hook_iomem_permission = flask_hook_iomem_permission,
+    .hook_iomem_mapping = flask_hook_iomem_mapping,
+    .hook_pci_config_permission = flask_hook_pci_config_permission,
+
+    .hook_resource_plug_core = flask_hook_resource_plug_core,
+    .hook_resource_unplug_core = flask_hook_resource_unplug_core,
+    .priv_resource_plug_pci = flask_priv_resource_plug_pci,
+    .priv_resource_unplug_pci = flask_priv_resource_unplug_pci,
+    .priv_resource_setup_pci = flask_priv_resource_setup_pci,
+    .priv_resource_setup_gsi = flask_priv_resource_setup_gsi,
+    .priv_resource_setup_misc = flask_priv_resource_setup_misc,
+
+    .hook_page_offline = flask_hook_page_offline,
+    .hook_tmem_op = flask_hook_tmem_op,
+    .priv_tmem_control = flask_priv_tmem_control,
 
     .do_xsm_op = do_flask_op,
 
 #ifdef CONFIG_X86
-    .shadow_control = flask_shadow_control,
-    .hvm_param = flask_hvm_param,
-    .hvm_set_pci_intx_level = flask_hvm_set_pci_intx_level,
-    .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
-    .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
-    .hvm_inject_msi = flask_hvm_inject_msi,
-    .mem_event_control = flask_mem_event_control,
-    .mem_event_op = flask_mem_event_op,
-    .mem_sharing_op = flask_mem_sharing_op,
-    .apic = flask_apic,
-    .platform_op = flask_platform_op,
-    .machine_memory_map = flask_machine_memory_map,
-    .domain_memory_map = flask_domain_memory_map,
-    .mmu_update = flask_mmu_update,
-    .mmuext_op = flask_mmuext_op,
-    .update_va_mapping = flask_update_va_mapping,
-    .add_to_physmap = flask_add_to_physmap,
-    .remove_from_physmap = flask_remove_from_physmap,
-    .get_device_group = flask_get_device_group,
-    .test_assign_device = flask_test_assign_device,
-    .assign_device = flask_assign_device,
-    .deassign_device = flask_deassign_device,
-    .bind_pt_irq = flask_bind_pt_irq,
-    .unbind_pt_irq = flask_unbind_pt_irq,
-    .ioport_permission = flask_ioport_permission,
-    .ioport_mapping = flask_ioport_mapping,
+    .hook_shadow_control = flask_hook_shadow_control,
+    .target_hvm_param = flask_target_hvm_param,
+    .dm_hvm_set_pci_intx_level = flask_dm_hvm_set_pci_intx_level,
+    .dm_hvm_set_isa_irq_level = flask_dm_hvm_set_isa_irq_level,
+    .dm_hvm_set_pci_link_route = flask_dm_hvm_set_pci_link_route,
+    .dm_hvm_inject_msi = flask_dm_hvm_inject_msi,
+    .dm_mem_event_control = flask_dm_mem_event_control,
+    .dm_mem_event_op = flask_dm_mem_event_op,
+    .dm_mem_sharing_op = flask_dm_mem_sharing_op,
+    .priv_apic = flask_priv_apic,
+    .priv_platform_op = flask_priv_platform_op,
+    .priv_machine_memory_map = flask_priv_machine_memory_map,
+    .target_domain_memory_map = flask_target_domain_memory_map,
+    .target_mmu_update = flask_target_mmu_update,
+    .target_mmuext_op = flask_target_mmuext_op,
+    .target_update_va_mapping = flask_target_update_va_mapping,
+    .target_add_to_physmap = flask_target_add_to_physmap,
+    .target_remove_from_physmap = flask_target_remove_from_physmap,
+    .hook_get_device_group = flask_hook_get_device_group,
+    .hook_test_assign_device = flask_test_assign_device,
+    .hook_assign_device = flask_hook_assign_device,
+    .hook_deassign_device = flask_hook_deassign_device,
+    .hook_bind_pt_irq = flask_hook_bind_pt_irq,
+    .hook_unbind_pt_irq = flask_hook_unbind_pt_irq,
+    .hook_ioport_permission = flask_hook_ioport_permission,
+    .hook_ioport_mapping = flask_hook_ioport_mapping,
 #endif
 };
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:08:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:08:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarJ5-0000Al-J0; Tue, 20 Nov 2012 17:08:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TarJ4-0000AQ-6i
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:08:18 +0000
Received: from [85.158.143.35:29244] by server-2.bemta-4.messagelabs.com id
	9B/D3-28922-109BBA05; Tue, 20 Nov 2012 17:08:17 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-3.tower-21.messagelabs.com!1353431285!16025702!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30872 invoked from network); 20 Nov 2012 17:08:06 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-3.tower-21.messagelabs.com with SMTP;
	20 Nov 2012 17:08:06 -0000
X-TM-IMSS-Message-ID: <0a20bbf300009afb@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 0a20bbf300009afb ;
	Mon, 19 Nov 2012 16:31:54 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJLSNQC013605; 
	Mon, 19 Nov 2012 16:28:23 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Mon, 19 Nov 2012 16:28:18 -0500
Message-Id: <1353360502-27819-2-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 1/5] Remove XSM_DEFAULT macro
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This fixes ctags so that it can find the default XSM hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>

---
 xen/include/xsm/dummy.h | 256 ++++++++++++++++++++++++------------------------
 xen/include/xsm/xsm.h   |   5 +-
 xen/xsm/dummy.c         |   5 +-
 3 files changed, 135 insertions(+), 131 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 040b463..fa78785 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -11,83 +11,83 @@
 #include <xen/sched.h>
 #include <xsm/xsm.h>
 
-static XSM_DEFAULT(void, security_domaininfo)(struct domain *d,
+static XSM_INLINE void xsm_security_domaininfo(struct domain *d,
                                     struct xen_domctl_getdomaininfo *info)
 {
     return;
 }
 
-static XSM_DEFAULT(int, setvcpucontext)(struct domain *d)
+static XSM_INLINE int xsm_setvcpucontext(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, pausedomain) (struct domain *d)
+static XSM_INLINE int xsm_pausedomain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, unpausedomain) (struct domain *d)
+static XSM_INLINE int xsm_unpausedomain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, resumedomain) (struct domain *d)
+static XSM_INLINE int xsm_resumedomain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, domain_create)(struct domain *d, u32 ssidref)
+static XSM_INLINE int xsm_domain_create(struct domain *d, u32 ssidref)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, max_vcpus)(struct domain *d)
+static XSM_INLINE int xsm_max_vcpus(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, destroydomain) (struct domain *d)
+static XSM_INLINE int xsm_destroydomain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, vcpuaffinity) (int cmd, struct domain *d)
+static XSM_INLINE int xsm_vcpuaffinity(int cmd, struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, scheduler) (struct domain *d)
+static XSM_INLINE int xsm_scheduler(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getdomaininfo) (struct domain *d)
+static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getvcpucontext) (struct domain *d)
+static XSM_INLINE int xsm_getvcpucontext(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getvcpuinfo) (struct domain *d)
+static XSM_INLINE int xsm_getvcpuinfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, domain_settime) (struct domain *d)
+static XSM_INLINE int xsm_domain_settime(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, set_target) (struct domain *d, struct domain *e)
+static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, domctl)(struct domain *d, int cmd)
+static XSM_INLINE int xsm_domctl(struct domain *d, int cmd)
 {
     switch ( cmd )
     {
@@ -106,143 +106,143 @@ static XSM_DEFAULT(int, domctl)(struct domain *d, int cmd)
     return 0;
 }
 
-static XSM_DEFAULT(int, sysctl)(int cmd)
+static XSM_INLINE int xsm_sysctl(int cmd)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, set_virq_handler)(struct domain *d, uint32_t virq)
+static XSM_INLINE int xsm_set_virq_handler(struct domain *d, uint32_t virq)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, tbufcontrol) (void)
+static XSM_INLINE int xsm_tbufcontrol(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, readconsole) (uint32_t clear)
+static XSM_INLINE int xsm_readconsole(uint32_t clear)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, sched_id) (void)
+static XSM_INLINE int xsm_sched_id(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, setdomainmaxmem) (struct domain *d)
+static XSM_INLINE int xsm_setdomainmaxmem(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, setdomainhandle) (struct domain *d)
+static XSM_INLINE int xsm_setdomainhandle(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, setdebugging) (struct domain *d)
+static XSM_INLINE int xsm_setdebugging(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, perfcontrol) (void)
+static XSM_INLINE int xsm_perfcontrol(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, debug_keys) (void)
+static XSM_INLINE int xsm_debug_keys(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getcpuinfo) (void)
+static XSM_INLINE int xsm_getcpuinfo(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, get_pmstat) (void)
+static XSM_INLINE int xsm_get_pmstat(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, setpminfo) (void)
+static XSM_INLINE int xsm_setpminfo(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, pm_op) (void)
+static XSM_INLINE int xsm_pm_op(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, do_mca) (void)
+static XSM_INLINE int xsm_do_mca(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, availheap) (void)
+static XSM_INLINE int xsm_availheap(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, alloc_security_domain) (struct domain *d)
+static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(void, free_security_domain) (struct domain *d)
+static XSM_INLINE void xsm_free_security_domain(struct domain *d)
 {
     return;
 }
 
-static XSM_DEFAULT(int, grant_mapref) (struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_grant_mapref(struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_unmapref) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_unmapref(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_setup) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_setup(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_transfer) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_transfer(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_copy) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_copy(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_query_size) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_query_size(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, memory_exchange) (struct domain *d)
+static XSM_INLINE int xsm_memory_exchange(struct domain *d)
 {
     if ( d != current->domain && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, memory_adjust_reservation) (struct domain *d1,
+static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
                                                             struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
@@ -250,14 +250,14 @@ static XSM_DEFAULT(int, memory_adjust_reservation) (struct domain *d1,
     return 0;
 }
 
-static XSM_DEFAULT(int, memory_stat_reservation) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_memory_stat_reservation(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, console_io) (struct domain *d, int cmd)
+static XSM_INLINE int xsm_console_io(struct domain *d, int cmd)
 {
 #ifndef VERBOSE
     if ( !IS_PRIV(current->domain) )
@@ -266,32 +266,32 @@ static XSM_DEFAULT(int, console_io) (struct domain *d, int cmd)
     return 0;
 }
 
-static XSM_DEFAULT(int, profile) (struct domain *d, int op)
+static XSM_INLINE int xsm_profile(struct domain *d, int op)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, kexec) (void)
+static XSM_INLINE int xsm_kexec(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, schedop_shutdown) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_schedop_shutdown(struct domain *d1, struct domain *d2)
 {
     if ( !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, memory_pin_page) (struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
                                           struct page_info *page)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, evtchn_unbound) (struct domain *d, struct evtchn *chn,
+static XSM_INLINE int xsm_evtchn_unbound(struct domain *d, struct evtchn *chn,
                                          domid_t id2)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
@@ -299,200 +299,200 @@ static XSM_DEFAULT(int, evtchn_unbound) (struct domain *d, struct evtchn *chn,
     return 0;
 }
 
-static XSM_DEFAULT(int, evtchn_interdomain) (struct domain *d1, struct evtchn
+static XSM_INLINE int xsm_evtchn_interdomain(struct domain *d1, struct evtchn
                                 *chan1, struct domain *d2, struct evtchn *chan2)
 {
     return 0;
 }
 
-static XSM_DEFAULT(void, evtchn_close_post) (struct evtchn *chn)
+static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
 {
     return;
 }
 
-static XSM_DEFAULT(int, evtchn_send) (struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, evtchn_status) (struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_evtchn_status(struct domain *d, struct evtchn *chn)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, evtchn_reset) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_evtchn_reset(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, alloc_security_evtchn) (struct evtchn *chn)
+static XSM_INLINE int xsm_alloc_security_evtchn(struct evtchn *chn)
 {
     return 0;
 }
 
-static XSM_DEFAULT(void, free_security_evtchn) (struct evtchn *chn)
+static XSM_INLINE void xsm_free_security_evtchn(struct evtchn *chn)
 {
     return;
 }
 
-static XSM_DEFAULT(char *, show_security_evtchn) (struct domain *d, const struct evtchn *chn)
+static XSM_INLINE char * xsm_show_security_evtchn(struct domain *d, const struct evtchn *chn)
 {
     return NULL;
 }
 
-static XSM_DEFAULT(int, get_pod_target)(struct domain *d)
+static XSM_INLINE int xsm_get_pod_target(struct domain *d)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, set_pod_target)(struct domain *d)
+static XSM_INLINE int xsm_set_pod_target(struct domain *d)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, get_device_group) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_get_device_group(uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, test_assign_device) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_test_assign_device(uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, assign_device) (struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, deassign_device) (struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_plug_core) (void)
+static XSM_INLINE int xsm_resource_plug_core(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_unplug_core) (void)
+static XSM_INLINE int xsm_resource_unplug_core(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_plug_pci) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_resource_plug_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_unplug_pci) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_resource_unplug_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_setup_pci) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_resource_setup_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_setup_gsi) (int gsi)
+static XSM_INLINE int xsm_resource_setup_gsi(int gsi)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_setup_misc) (void)
+static XSM_INLINE int xsm_resource_setup_misc(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, page_offline) (uint32_t cmd)
+static XSM_INLINE int xsm_page_offline(uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, lockprof) (void)
+static XSM_INLINE int xsm_lockprof(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, cpupool_op) (void)
+static XSM_INLINE int xsm_cpupool_op(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, sched_op) (void)
+static XSM_INLINE int xsm_sched_op(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, tmem_op) (void)
+static XSM_INLINE int xsm_tmem_op(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, tmem_control) (void)
+static XSM_INLINE int xsm_tmem_control(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(long, do_xsm_op)(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
+static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
     return -ENOSYS;
 }
 
-static XSM_DEFAULT(char *, show_irq_sid) (int irq)
+static XSM_INLINE char * xsm_show_irq_sid(int irq)
 {
     return NULL;
 }
 
-static XSM_DEFAULT(int, map_domain_pirq) (struct domain *d, int irq, void *data)
+static XSM_INLINE int xsm_map_domain_pirq(struct domain *d, int irq, void *data)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, unmap_domain_pirq) (struct domain *d, int irq)
+static XSM_INLINE int xsm_unmap_domain_pirq(struct domain *d, int irq)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, irq_permission) (struct domain *d, int pirq, uint8_t allow)
+static XSM_INLINE int xsm_irq_permission(struct domain *d, int pirq, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, iomem_permission) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_iomem_permission(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_iomem_mapping(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, pci_config_permission) (struct domain *d, uint32_t machine_bdf,
+static XSM_INLINE int xsm_pci_config_permission(struct domain *d, uint32_t machine_bdf,
                                         uint16_t start, uint16_t end,
                                         uint8_t access)
 {
@@ -500,188 +500,188 @@ static XSM_DEFAULT(int, pci_config_permission) (struct domain *d, uint32_t machi
 }
 
 #ifdef CONFIG_X86
-static XSM_DEFAULT(int, shadow_control) (struct domain *d, uint32_t op)
+static XSM_INLINE int xsm_shadow_control(struct domain *d, uint32_t op)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getpageframeinfo) (struct domain *d)
+static XSM_INLINE int xsm_getpageframeinfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getmemlist) (struct domain *d)
+static XSM_INLINE int xsm_getmemlist(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, hypercall_init) (struct domain *d)
+static XSM_INLINE int xsm_hypercall_init(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, hvmcontext) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_hvmcontext(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, address_size) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_address_size(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, machine_address_size) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_machine_address_size(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_param) (struct domain *d, unsigned long op)
+static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_set_pci_intx_level) (struct domain *d)
+static XSM_INLINE int xsm_hvm_set_pci_intx_level(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_set_isa_irq_level) (struct domain *d)
+static XSM_INLINE int xsm_hvm_set_isa_irq_level(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_set_pci_link_route) (struct domain *d)
+static XSM_INLINE int xsm_hvm_set_pci_link_route(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_inject_msi) (struct domain *d)
+static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_event_setup) (struct domain *d)
+static XSM_INLINE int xsm_mem_event_setup(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_event_control) (struct domain *d, int mode, int op)
+static XSM_INLINE int xsm_mem_event_control(struct domain *d, int mode, int op)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_event_op) (struct domain *d, int op)
+static XSM_INLINE int xsm_mem_event_op(struct domain *d, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_sharing) (struct domain *d)
+static XSM_INLINE int xsm_mem_sharing(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_sharing_op) (struct domain *d, struct domain *cd, int op)
+static XSM_INLINE int xsm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, cd) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, apic) (struct domain *d, int cmd)
+static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
 {
     if ( !IS_PRIV(d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, xen_settime) (void)
+static XSM_INLINE int xsm_xen_settime(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, memtype) (uint32_t access)
+static XSM_INLINE int xsm_memtype(uint32_t access)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, microcode) (void)
+static XSM_INLINE int xsm_microcode(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, physinfo) (void)
+static XSM_INLINE int xsm_physinfo(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, platform_quirk) (uint32_t quirk)
+static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, platform_op) (uint32_t op)
+static XSM_INLINE int xsm_platform_op(uint32_t op)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, firmware_info) (void)
+static XSM_INLINE int xsm_firmware_info(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, efi_call) (void)
+static XSM_INLINE int xsm_efi_call(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, acpi_sleep) (void)
+static XSM_INLINE int xsm_acpi_sleep(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, change_freq) (void)
+static XSM_INLINE int xsm_change_freq(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getidletime) (void)
+static XSM_INLINE int xsm_getidletime(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, machine_memory_map) (void)
+static XSM_INLINE int xsm_machine_memory_map(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, domain_memory_map) (struct domain *d)
+static XSM_INLINE int xsm_domain_memory_map(struct domain *d)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, mmu_update) (struct domain *d, struct domain *t,
+static XSM_INLINE int xsm_mmu_update(struct domain *d, struct domain *t,
                                      struct domain *f, uint32_t flags)
 {
     if ( t && d != t && !IS_PRIV_FOR(d, t) )
@@ -691,14 +691,14 @@ static XSM_DEFAULT(int, mmu_update) (struct domain *d, struct domain *t,
     return 0;
 }
 
-static XSM_DEFAULT(int, mmuext_op) (struct domain *d, struct domain *f)
+static XSM_INLINE int xsm_mmuext_op(struct domain *d, struct domain *f)
 {
     if ( d != f && !IS_PRIV_FOR(d, f) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, update_va_mapping) (struct domain *d, struct domain *f, 
+static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
     if ( d != f && !IS_PRIV_FOR(d, f) )
@@ -706,56 +706,56 @@ static XSM_DEFAULT(int, update_va_mapping) (struct domain *d, struct domain *f,
     return 0;
 }
 
-static XSM_DEFAULT(int, add_to_physmap) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, remove_from_physmap) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, sendtrigger) (struct domain *d)
+static XSM_INLINE int xsm_sendtrigger(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_unbind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, pin_mem_cacheattr) (struct domain *d)
+static XSM_INLINE int xsm_pin_mem_cacheattr(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, ext_vcpucontext) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, vcpuextstate) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_ioport_mapping(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
 }
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 748f5ff..b2f33d6 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -195,6 +195,8 @@ struct xsm_operations {
 
 extern struct xsm_operations *xsm_ops;
 
+#ifndef XSM_NO_WRAPPERS
+
 static inline void xsm_security_domaininfo (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info)
 {
@@ -846,6 +848,7 @@ static inline int xsm_ioport_mapping (struct domain *d, uint32_t s, uint32_t e,
     return xsm_ops->ioport_mapping(d, s, e, allow);
 }
 #endif /* CONFIG_X86 */
+#endif /* XSM_NO_WRAPPERS */
 
 extern int xsm_init(unsigned long *module_map, const multiboot_info_t *mbi,
                     void *(*bootstrap_map)(const module_t *));
@@ -860,7 +863,7 @@ extern void xsm_fixup_ops(struct xsm_operations *ops);
 
 #else /* XSM_ENABLE */
 
-#define XSM_DEFAULT(type, name) inline type xsm_ ## name
+#define XSM_INLINE inline
 #include <xsm/dummy.h>
 
 static inline int xsm_init (unsigned long *module_map,
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 6e113fb..3e6e5df 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -10,7 +10,8 @@
  *  as published by the Free Software Foundation.
  */
 
-#define XSM_DEFAULT(type, name) type dummy_ ## name
+#define XSM_NO_WRAPPERS
+#define XSM_INLINE /* */
 #include <xsm/dummy.h>
 
 struct xsm_operations dummy_xsm_ops;
@@ -19,7 +20,7 @@ struct xsm_operations dummy_xsm_ops;
     do {                                                               \
         if ( !ops->function )                                          \
         {                                                              \
-            ops->function = dummy_##function;                          \
+            ops->function = xsm_##function;                            \
             if (ops != &dummy_xsm_ops)                                 \
                 dprintk(XENLOG_DEBUG, "Had to override the " #function \
                     " security operation with the dummy one.\n");      \
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:08:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:08:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarJ5-0000Al-J0; Tue, 20 Nov 2012 17:08:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TarJ4-0000AQ-6i
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:08:18 +0000
Received: from [85.158.143.35:29244] by server-2.bemta-4.messagelabs.com id
	9B/D3-28922-109BBA05; Tue, 20 Nov 2012 17:08:17 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-3.tower-21.messagelabs.com!1353431285!16025702!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30872 invoked from network); 20 Nov 2012 17:08:06 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-3.tower-21.messagelabs.com with SMTP;
	20 Nov 2012 17:08:06 -0000
X-TM-IMSS-Message-ID: <0a20bbf300009afb@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 0a20bbf300009afb ;
	Mon, 19 Nov 2012 16:31:54 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJLSNQC013605; 
	Mon, 19 Nov 2012 16:28:23 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Mon, 19 Nov 2012 16:28:18 -0500
Message-Id: <1353360502-27819-2-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 1/5] Remove XSM_DEFAULT macro
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This fixes ctags so that it can find the default XSM hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>

---
 xen/include/xsm/dummy.h | 256 ++++++++++++++++++++++++------------------------
 xen/include/xsm/xsm.h   |   5 +-
 xen/xsm/dummy.c         |   5 +-
 3 files changed, 135 insertions(+), 131 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 040b463..fa78785 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -11,83 +11,83 @@
 #include <xen/sched.h>
 #include <xsm/xsm.h>
 
-static XSM_DEFAULT(void, security_domaininfo)(struct domain *d,
+static XSM_INLINE void xsm_security_domaininfo(struct domain *d,
                                     struct xen_domctl_getdomaininfo *info)
 {
     return;
 }
 
-static XSM_DEFAULT(int, setvcpucontext)(struct domain *d)
+static XSM_INLINE int xsm_setvcpucontext(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, pausedomain) (struct domain *d)
+static XSM_INLINE int xsm_pausedomain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, unpausedomain) (struct domain *d)
+static XSM_INLINE int xsm_unpausedomain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, resumedomain) (struct domain *d)
+static XSM_INLINE int xsm_resumedomain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, domain_create)(struct domain *d, u32 ssidref)
+static XSM_INLINE int xsm_domain_create(struct domain *d, u32 ssidref)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, max_vcpus)(struct domain *d)
+static XSM_INLINE int xsm_max_vcpus(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, destroydomain) (struct domain *d)
+static XSM_INLINE int xsm_destroydomain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, vcpuaffinity) (int cmd, struct domain *d)
+static XSM_INLINE int xsm_vcpuaffinity(int cmd, struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, scheduler) (struct domain *d)
+static XSM_INLINE int xsm_scheduler(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getdomaininfo) (struct domain *d)
+static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getvcpucontext) (struct domain *d)
+static XSM_INLINE int xsm_getvcpucontext(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getvcpuinfo) (struct domain *d)
+static XSM_INLINE int xsm_getvcpuinfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, domain_settime) (struct domain *d)
+static XSM_INLINE int xsm_domain_settime(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, set_target) (struct domain *d, struct domain *e)
+static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, domctl)(struct domain *d, int cmd)
+static XSM_INLINE int xsm_domctl(struct domain *d, int cmd)
 {
     switch ( cmd )
     {
@@ -106,143 +106,143 @@ static XSM_DEFAULT(int, domctl)(struct domain *d, int cmd)
     return 0;
 }
 
-static XSM_DEFAULT(int, sysctl)(int cmd)
+static XSM_INLINE int xsm_sysctl(int cmd)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, set_virq_handler)(struct domain *d, uint32_t virq)
+static XSM_INLINE int xsm_set_virq_handler(struct domain *d, uint32_t virq)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, tbufcontrol) (void)
+static XSM_INLINE int xsm_tbufcontrol(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, readconsole) (uint32_t clear)
+static XSM_INLINE int xsm_readconsole(uint32_t clear)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, sched_id) (void)
+static XSM_INLINE int xsm_sched_id(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, setdomainmaxmem) (struct domain *d)
+static XSM_INLINE int xsm_setdomainmaxmem(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, setdomainhandle) (struct domain *d)
+static XSM_INLINE int xsm_setdomainhandle(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, setdebugging) (struct domain *d)
+static XSM_INLINE int xsm_setdebugging(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, perfcontrol) (void)
+static XSM_INLINE int xsm_perfcontrol(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, debug_keys) (void)
+static XSM_INLINE int xsm_debug_keys(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getcpuinfo) (void)
+static XSM_INLINE int xsm_getcpuinfo(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, get_pmstat) (void)
+static XSM_INLINE int xsm_get_pmstat(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, setpminfo) (void)
+static XSM_INLINE int xsm_setpminfo(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, pm_op) (void)
+static XSM_INLINE int xsm_pm_op(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, do_mca) (void)
+static XSM_INLINE int xsm_do_mca(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, availheap) (void)
+static XSM_INLINE int xsm_availheap(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, alloc_security_domain) (struct domain *d)
+static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(void, free_security_domain) (struct domain *d)
+static XSM_INLINE void xsm_free_security_domain(struct domain *d)
 {
     return;
 }
 
-static XSM_DEFAULT(int, grant_mapref) (struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_grant_mapref(struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_unmapref) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_unmapref(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_setup) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_setup(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_transfer) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_transfer(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_copy) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_copy(struct domain *d1, struct domain *d2)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, grant_query_size) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_query_size(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, memory_exchange) (struct domain *d)
+static XSM_INLINE int xsm_memory_exchange(struct domain *d)
 {
     if ( d != current->domain && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, memory_adjust_reservation) (struct domain *d1,
+static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
                                                             struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
@@ -250,14 +250,14 @@ static XSM_DEFAULT(int, memory_adjust_reservation) (struct domain *d1,
     return 0;
 }
 
-static XSM_DEFAULT(int, memory_stat_reservation) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_memory_stat_reservation(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, console_io) (struct domain *d, int cmd)
+static XSM_INLINE int xsm_console_io(struct domain *d, int cmd)
 {
 #ifndef VERBOSE
     if ( !IS_PRIV(current->domain) )
@@ -266,32 +266,32 @@ static XSM_DEFAULT(int, console_io) (struct domain *d, int cmd)
     return 0;
 }
 
-static XSM_DEFAULT(int, profile) (struct domain *d, int op)
+static XSM_INLINE int xsm_profile(struct domain *d, int op)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, kexec) (void)
+static XSM_INLINE int xsm_kexec(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, schedop_shutdown) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_schedop_shutdown(struct domain *d1, struct domain *d2)
 {
     if ( !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, memory_pin_page) (struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
                                           struct page_info *page)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, evtchn_unbound) (struct domain *d, struct evtchn *chn,
+static XSM_INLINE int xsm_evtchn_unbound(struct domain *d, struct evtchn *chn,
                                          domid_t id2)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
@@ -299,200 +299,200 @@ static XSM_DEFAULT(int, evtchn_unbound) (struct domain *d, struct evtchn *chn,
     return 0;
 }
 
-static XSM_DEFAULT(int, evtchn_interdomain) (struct domain *d1, struct evtchn
+static XSM_INLINE int xsm_evtchn_interdomain(struct domain *d1, struct evtchn
                                 *chan1, struct domain *d2, struct evtchn *chan2)
 {
     return 0;
 }
 
-static XSM_DEFAULT(void, evtchn_close_post) (struct evtchn *chn)
+static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
 {
     return;
 }
 
-static XSM_DEFAULT(int, evtchn_send) (struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, evtchn_status) (struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_evtchn_status(struct domain *d, struct evtchn *chn)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, evtchn_reset) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_evtchn_reset(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, alloc_security_evtchn) (struct evtchn *chn)
+static XSM_INLINE int xsm_alloc_security_evtchn(struct evtchn *chn)
 {
     return 0;
 }
 
-static XSM_DEFAULT(void, free_security_evtchn) (struct evtchn *chn)
+static XSM_INLINE void xsm_free_security_evtchn(struct evtchn *chn)
 {
     return;
 }
 
-static XSM_DEFAULT(char *, show_security_evtchn) (struct domain *d, const struct evtchn *chn)
+static XSM_INLINE char * xsm_show_security_evtchn(struct domain *d, const struct evtchn *chn)
 {
     return NULL;
 }
 
-static XSM_DEFAULT(int, get_pod_target)(struct domain *d)
+static XSM_INLINE int xsm_get_pod_target(struct domain *d)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, set_pod_target)(struct domain *d)
+static XSM_INLINE int xsm_set_pod_target(struct domain *d)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, get_device_group) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_get_device_group(uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, test_assign_device) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_test_assign_device(uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, assign_device) (struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, deassign_device) (struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_plug_core) (void)
+static XSM_INLINE int xsm_resource_plug_core(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_unplug_core) (void)
+static XSM_INLINE int xsm_resource_unplug_core(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_plug_pci) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_resource_plug_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_unplug_pci) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_resource_unplug_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_setup_pci) (uint32_t machine_bdf)
+static XSM_INLINE int xsm_resource_setup_pci(uint32_t machine_bdf)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_setup_gsi) (int gsi)
+static XSM_INLINE int xsm_resource_setup_gsi(int gsi)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, resource_setup_misc) (void)
+static XSM_INLINE int xsm_resource_setup_misc(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, page_offline) (uint32_t cmd)
+static XSM_INLINE int xsm_page_offline(uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, lockprof) (void)
+static XSM_INLINE int xsm_lockprof(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, cpupool_op) (void)
+static XSM_INLINE int xsm_cpupool_op(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, sched_op) (void)
+static XSM_INLINE int xsm_sched_op(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, tmem_op) (void)
+static XSM_INLINE int xsm_tmem_op(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, tmem_control) (void)
+static XSM_INLINE int xsm_tmem_control(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(long, do_xsm_op)(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
+static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
     return -ENOSYS;
 }
 
-static XSM_DEFAULT(char *, show_irq_sid) (int irq)
+static XSM_INLINE char * xsm_show_irq_sid(int irq)
 {
     return NULL;
 }
 
-static XSM_DEFAULT(int, map_domain_pirq) (struct domain *d, int irq, void *data)
+static XSM_INLINE int xsm_map_domain_pirq(struct domain *d, int irq, void *data)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, unmap_domain_pirq) (struct domain *d, int irq)
+static XSM_INLINE int xsm_unmap_domain_pirq(struct domain *d, int irq)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, irq_permission) (struct domain *d, int pirq, uint8_t allow)
+static XSM_INLINE int xsm_irq_permission(struct domain *d, int pirq, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, iomem_permission) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_iomem_permission(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_iomem_mapping(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, pci_config_permission) (struct domain *d, uint32_t machine_bdf,
+static XSM_INLINE int xsm_pci_config_permission(struct domain *d, uint32_t machine_bdf,
                                         uint16_t start, uint16_t end,
                                         uint8_t access)
 {
@@ -500,188 +500,188 @@ static XSM_DEFAULT(int, pci_config_permission) (struct domain *d, uint32_t machi
 }
 
 #ifdef CONFIG_X86
-static XSM_DEFAULT(int, shadow_control) (struct domain *d, uint32_t op)
+static XSM_INLINE int xsm_shadow_control(struct domain *d, uint32_t op)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getpageframeinfo) (struct domain *d)
+static XSM_INLINE int xsm_getpageframeinfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getmemlist) (struct domain *d)
+static XSM_INLINE int xsm_getmemlist(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, hypercall_init) (struct domain *d)
+static XSM_INLINE int xsm_hypercall_init(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, hvmcontext) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_hvmcontext(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, address_size) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_address_size(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, machine_address_size) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_machine_address_size(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_param) (struct domain *d, unsigned long op)
+static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_set_pci_intx_level) (struct domain *d)
+static XSM_INLINE int xsm_hvm_set_pci_intx_level(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_set_isa_irq_level) (struct domain *d)
+static XSM_INLINE int xsm_hvm_set_isa_irq_level(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_set_pci_link_route) (struct domain *d)
+static XSM_INLINE int xsm_hvm_set_pci_link_route(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, hvm_inject_msi) (struct domain *d)
+static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_event_setup) (struct domain *d)
+static XSM_INLINE int xsm_mem_event_setup(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_event_control) (struct domain *d, int mode, int op)
+static XSM_INLINE int xsm_mem_event_control(struct domain *d, int mode, int op)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_event_op) (struct domain *d, int op)
+static XSM_INLINE int xsm_mem_event_op(struct domain *d, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_sharing) (struct domain *d)
+static XSM_INLINE int xsm_mem_sharing(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, mem_sharing_op) (struct domain *d, struct domain *cd, int op)
+static XSM_INLINE int xsm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, cd) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, apic) (struct domain *d, int cmd)
+static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
 {
     if ( !IS_PRIV(d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, xen_settime) (void)
+static XSM_INLINE int xsm_xen_settime(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, memtype) (uint32_t access)
+static XSM_INLINE int xsm_memtype(uint32_t access)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, microcode) (void)
+static XSM_INLINE int xsm_microcode(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, physinfo) (void)
+static XSM_INLINE int xsm_physinfo(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, platform_quirk) (uint32_t quirk)
+static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, platform_op) (uint32_t op)
+static XSM_INLINE int xsm_platform_op(uint32_t op)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, firmware_info) (void)
+static XSM_INLINE int xsm_firmware_info(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, efi_call) (void)
+static XSM_INLINE int xsm_efi_call(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, acpi_sleep) (void)
+static XSM_INLINE int xsm_acpi_sleep(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, change_freq) (void)
+static XSM_INLINE int xsm_change_freq(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, getidletime) (void)
+static XSM_INLINE int xsm_getidletime(void)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, machine_memory_map) (void)
+static XSM_INLINE int xsm_machine_memory_map(void)
 {
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, domain_memory_map) (struct domain *d)
+static XSM_INLINE int xsm_domain_memory_map(struct domain *d)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, mmu_update) (struct domain *d, struct domain *t,
+static XSM_INLINE int xsm_mmu_update(struct domain *d, struct domain *t,
                                      struct domain *f, uint32_t flags)
 {
     if ( t && d != t && !IS_PRIV_FOR(d, t) )
@@ -691,14 +691,14 @@ static XSM_DEFAULT(int, mmu_update) (struct domain *d, struct domain *t,
     return 0;
 }
 
-static XSM_DEFAULT(int, mmuext_op) (struct domain *d, struct domain *f)
+static XSM_INLINE int xsm_mmuext_op(struct domain *d, struct domain *f)
 {
     if ( d != f && !IS_PRIV_FOR(d, f) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, update_va_mapping) (struct domain *d, struct domain *f, 
+static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
     if ( d != f && !IS_PRIV_FOR(d, f) )
@@ -706,56 +706,56 @@ static XSM_DEFAULT(int, update_va_mapping) (struct domain *d, struct domain *f,
     return 0;
 }
 
-static XSM_DEFAULT(int, add_to_physmap) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, remove_from_physmap) (struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
     if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
         return -EPERM;
     return 0;
 }
 
-static XSM_DEFAULT(int, sendtrigger) (struct domain *d)
+static XSM_INLINE int xsm_sendtrigger(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_unbind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, pin_mem_cacheattr) (struct domain *d)
+static XSM_INLINE int xsm_pin_mem_cacheattr(struct domain *d)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, ext_vcpucontext) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, vcpuextstate) (struct domain *d, uint32_t cmd)
+static XSM_INLINE int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
 }
 
-static XSM_DEFAULT(int, ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_ioport_mapping(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
 }
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 748f5ff..b2f33d6 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -195,6 +195,8 @@ struct xsm_operations {
 
 extern struct xsm_operations *xsm_ops;
 
+#ifndef XSM_NO_WRAPPERS
+
 static inline void xsm_security_domaininfo (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info)
 {
@@ -846,6 +848,7 @@ static inline int xsm_ioport_mapping (struct domain *d, uint32_t s, uint32_t e,
     return xsm_ops->ioport_mapping(d, s, e, allow);
 }
 #endif /* CONFIG_X86 */
+#endif /* XSM_NO_WRAPPERS */
 
 extern int xsm_init(unsigned long *module_map, const multiboot_info_t *mbi,
                     void *(*bootstrap_map)(const module_t *));
@@ -860,7 +863,7 @@ extern void xsm_fixup_ops(struct xsm_operations *ops);
 
 #else /* XSM_ENABLE */
 
-#define XSM_DEFAULT(type, name) inline type xsm_ ## name
+#define XSM_INLINE inline
 #include <xsm/dummy.h>
 
 static inline int xsm_init (unsigned long *module_map,
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 6e113fb..3e6e5df 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -10,7 +10,8 @@
  *  as published by the Free Software Foundation.
  */
 
-#define XSM_DEFAULT(type, name) type dummy_ ## name
+#define XSM_NO_WRAPPERS
+#define XSM_INLINE /* */
 #include <xsm/dummy.h>
 
 struct xsm_operations dummy_xsm_ops;
@@ -19,7 +20,7 @@ struct xsm_operations dummy_xsm_ops;
     do {                                                               \
         if ( !ops->function )                                          \
         {                                                              \
-            ops->function = dummy_##function;                          \
+            ops->function = xsm_##function;                            \
             if (ops != &dummy_xsm_ops)                                 \
                 dprintk(XENLOG_DEBUG, "Had to override the " #function \
                     " security operation with the dummy one.\n");      \
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:09:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:09:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarJp-0000Jc-38; Tue, 20 Nov 2012 17:09:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TarJn-0000J4-NL
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 17:09:03 +0000
Received: from [85.158.138.51:29155] by server-11.bemta-3.messagelabs.com id
	37/05-19361-A29BBA05; Tue, 20 Nov 2012 17:08:58 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1353431336!30786518!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjMyNDg4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28853 invoked from network); 20 Nov 2012 17:08:57 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-9.tower-174.messagelabs.com with SMTP;
	20 Nov 2012 17:08:57 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga102.ch.intel.com with ESMTP; 20 Nov 2012 09:08:35 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,286,1352102400"; d="scan'208";a="170627664"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by AZSMGA002.ch.intel.com with ESMTP; 20 Nov 2012 09:08:35 -0800
Received: from FMSMSX110.amr.corp.intel.com (10.19.9.29) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 09:08:34 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	fmsmsx110.amr.corp.intel.com (10.19.9.29) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 09:08:34 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 01:08:32 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>, Ian Campbell
	<Ian.Campbell@citrix.com>
Thread-Topic: [PATCH V3] X86/vMCE: handle broken page with regard to migration
Thread-Index: AQHNxzLagIBs/Elka0CkW2KriS9nNJfy8Czg
Date: Tue, 20 Nov 2012 17:08:32 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335393633@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
	<1353344256.18229.129.camel@zakaz.uk.xensource.com>
	<50AB9CFE.7000003@eu.citrix.com>
In-Reply-To: <50AB9CFE.7000003@eu.citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> On 19/11/12 16:57, Ian Campbell wrote:
>> On Mon, 2012-11-19 at 15:29 +0000, George Dunlap wrote:
>>> On 19/11/12 09:55, Ian Campbell wrote:
>>>> If we get to this stage then haven't we either already sent
>>>> something over the wire for this page or marked it as dirty when
>>>> we tried and failed to send it? 
>>>> 
>>>> In the former case we don't care that the page is now broken on the
>>>> source since the target has got a good pre-breakage copy.
>>>> 
>>>> In the latter case could we not set a flag at the same time as we
>>>> mark the page dirty which means "go round at least one more time"?
>>> Yeah -- on the last iteration, the VM itself has to be paused; if
>>> any pages get broken after that, it doesn't really matter, does it?
>>> The real thing is to have a consistent "snapshot" of behavior.
>>> 
>>> I guess the one potentially tricky case to worry about is whether to
>>> deliver an MCE to the guest on restore.  Consider the following
>>> scenario: 
>>> 
>>> - Page A is modified (and marked dirty)
>>> - VM paused for last iteration
>>> - Page breaks, is marked broken in the p2m
>>> - Save code sends page A
>>> 
>>> In that case, the save code would send a "broken" page, and the
>>> restore code would mark a page as broken, and we *would* want to
>>> deliver an MCE on the far side.  But suppose the last two steps
>>> were reversed: 
>>> 
>>> - Page A modified
>>> - VM paused for last iteration
>>> - Save code sends page A
>>> - Page breaks, marked broken in the p2m
>>> 
>>> In that case, when the save code sends page A, it will send a good
>>> page; there's no need to mark it broken, or to send the guest an
>>> MCE. 
>> I guess you'd want to err on the side of stopping using a good page,
>> as opposed to continuing to use a bad page? i.e. its better to take a
>> spurious vMCE than to not take an actual one.
> 
> While that's true, taking a spurious MCE means at very least one less
> page available to the guest to use (for HVM guests that haven't
> ballooned down, at least), and the unnecessary loss of the data in
> that page.
> 
> The problem I guess is that the save code at the moment has no way of
> distinguishing the following cases:
> 1. Marked broken after the last time I sent it, but before the VM was
> paused; but the page hasn't been written to
> 2. Marked broken after the VM was paused; page hadn't been written to
> 3. Marked broken after the VM was paused, but the page had been
> written to 
> 
> In case 1, we definitely need to send a broken page; but the VM may
> have already received a vMCE.  In case 2, we don't need to send a
> broken page or a vMCE, while in #3 we need to do both.
> 

Yes, and for case 3, strictly it still has chance not to send broken page to target (and target will happily runs on 'good' pfn_type and 'good' page), but too complicated to distinguish.

> On the other hand, the whole situation is hopefully rare enough that
> maybe we can just do the simple correct thing, even if it's a tiny bit
> sub-optimal.  In that case, assuming that spurious vMCEs aren't a
> problem (e.g., #1), I think we basically just need to see if the last
> iteration contains a broken page, and if so, send the guest a vMCE on
> resume.
> 
> Thoughts?

Yes, that's exactly V3 patch did.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:09:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:09:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarJp-0000Jc-38; Tue, 20 Nov 2012 17:09:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TarJn-0000J4-NL
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 17:09:03 +0000
Received: from [85.158.138.51:29155] by server-11.bemta-3.messagelabs.com id
	37/05-19361-A29BBA05; Tue, 20 Nov 2012 17:08:58 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1353431336!30786518!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjMyNDg4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28853 invoked from network); 20 Nov 2012 17:08:57 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-9.tower-174.messagelabs.com with SMTP;
	20 Nov 2012 17:08:57 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga102.ch.intel.com with ESMTP; 20 Nov 2012 09:08:35 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,286,1352102400"; d="scan'208";a="170627664"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by AZSMGA002.ch.intel.com with ESMTP; 20 Nov 2012 09:08:35 -0800
Received: from FMSMSX110.amr.corp.intel.com (10.19.9.29) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 09:08:34 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	fmsmsx110.amr.corp.intel.com (10.19.9.29) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 09:08:34 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 01:08:32 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>, Ian Campbell
	<Ian.Campbell@citrix.com>
Thread-Topic: [PATCH V3] X86/vMCE: handle broken page with regard to migration
Thread-Index: AQHNxzLagIBs/Elka0CkW2KriS9nNJfy8Czg
Date: Tue, 20 Nov 2012 17:08:32 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335393633@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
	<1353344256.18229.129.camel@zakaz.uk.xensource.com>
	<50AB9CFE.7000003@eu.citrix.com>
In-Reply-To: <50AB9CFE.7000003@eu.citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> On 19/11/12 16:57, Ian Campbell wrote:
>> On Mon, 2012-11-19 at 15:29 +0000, George Dunlap wrote:
>>> On 19/11/12 09:55, Ian Campbell wrote:
>>>> If we get to this stage then haven't we either already sent
>>>> something over the wire for this page or marked it as dirty when
>>>> we tried and failed to send it? 
>>>> 
>>>> In the former case we don't care that the page is now broken on the
>>>> source since the target has got a good pre-breakage copy.
>>>> 
>>>> In the latter case could we not set a flag at the same time as we
>>>> mark the page dirty which means "go round at least one more time"?
>>> Yeah -- on the last iteration, the VM itself has to be paused; if
>>> any pages get broken after that, it doesn't really matter, does it?
>>> The real thing is to have a consistent "snapshot" of behavior.
>>> 
>>> I guess the one potentially tricky case to worry about is whether to
>>> deliver an MCE to the guest on restore.  Consider the following
>>> scenario: 
>>> 
>>> - Page A is modified (and marked dirty)
>>> - VM paused for last iteration
>>> - Page breaks, is marked broken in the p2m
>>> - Save code sends page A
>>> 
>>> In that case, the save code would send a "broken" page, and the
>>> restore code would mark a page as broken, and we *would* want to
>>> deliver an MCE on the far side.  But suppose the last two steps
>>> were reversed: 
>>> 
>>> - Page A modified
>>> - VM paused for last iteration
>>> - Save code sends page A
>>> - Page breaks, marked broken in the p2m
>>> 
>>> In that case, when the save code sends page A, it will send a good
>>> page; there's no need to mark it broken, or to send the guest an
>>> MCE. 
>> I guess you'd want to err on the side of stopping using a good page,
>> as opposed to continuing to use a bad page? i.e. its better to take a
>> spurious vMCE than to not take an actual one.
> 
> While that's true, taking a spurious MCE means at very least one less
> page available to the guest to use (for HVM guests that haven't
> ballooned down, at least), and the unnecessary loss of the data in
> that page.
> 
> The problem I guess is that the save code at the moment has no way of
> distinguishing the following cases:
> 1. Marked broken after the last time I sent it, but before the VM was
> paused; but the page hasn't been written to
> 2. Marked broken after the VM was paused; page hadn't been written to
> 3. Marked broken after the VM was paused, but the page had been
> written to 
> 
> In case 1, we definitely need to send a broken page; but the VM may
> have already received a vMCE.  In case 2, we don't need to send a
> broken page or a vMCE, while in #3 we need to do both.
> 

Yes, and for case 3, strictly it still has chance not to send broken page to target (and target will happily runs on 'good' pfn_type and 'good' page), but too complicated to distinguish.

> On the other hand, the whole situation is hopefully rare enough that
> maybe we can just do the simple correct thing, even if it's a tiny bit
> sub-optimal.  In that case, assuming that spurious vMCEs aren't a
> problem (e.g., #1), I think we basically just need to see if the last
> iteration contains a broken page, and if so, send the guest a vMCE on
> resume.
> 
> Thoughts?

Yes, that's exactly V3 patch did.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:11:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:11:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarM4-0000hZ-RL; Tue, 20 Nov 2012 17:11:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TarM3-0000hM-7y
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:11:23 +0000
Received: from [85.158.143.35:41517] by server-2.bemta-4.messagelabs.com id
	C5/87-28922-AB9BBA05; Tue, 20 Nov 2012 17:11:22 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-21.messagelabs.com!1353431478!11405262!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1036 invoked from network); 20 Nov 2012 17:11:19 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-11.tower-21.messagelabs.com with SMTP;
	20 Nov 2012 17:11:19 -0000
X-TM-IMSS-Message-ID: <0a20be7300009afd@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 0a20be7300009afd ;
	Mon, 19 Nov 2012 16:31:55 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJLSNQE013605; 
	Mon, 19 Nov 2012 16:28:24 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Mon, 19 Nov 2012 16:28:20 -0500
Message-Id: <1353360502-27819-4-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 3/5] xen: sysctl XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

A number of the sysctl XSM hooks have no parameters or only pass the
operation ID, making them redundant with the xsm_sysctl hook. Remove
these redundant hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/platform_hypercall.c |  12 ----
 xen/arch/x86/sysctl.c             |  13 ----
 xen/common/sysctl.c               |  44 --------------
 xen/include/xsm/dummy.h           |  60 ------------------
 xen/include/xsm/xsm.h             |  72 ----------------------
 xen/xsm/dummy.c                   |  12 ----
 xen/xsm/flask/hooks.c             | 125 ++++++++++++--------------------------
 7 files changed, 38 insertions(+), 300 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 738bed0..ffac6ac 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -419,10 +419,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_set_processor_pminfo:
-        ret = xsm_setpminfo();
-        if ( ret )
-            break;
-
         switch ( op->u.set_pminfo.type )
         {
         case XEN_PM_PX:
@@ -475,10 +471,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
         g_info = &op->u.pcpu_info;
 
-        ret = xsm_getcpuinfo();
-        if ( ret )
-            break;
-
         if ( !get_cpu_maps() )
         {
             ret = -EBUSY;
@@ -512,10 +504,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         struct xenpf_pcpu_version *ver = &op->u.pcpu_version;
 
-        ret = xsm_getcpuinfo();
-        if ( ret )
-            break;
-
         if ( !get_cpu_maps() )
         {
             ret = -EBUSY;
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index b84dd34..5b0c4b7 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -69,11 +69,6 @@ long arch_do_sysctl(
     {
         xen_sysctl_physinfo_t *pi = &sysctl->u.physinfo;
 
-        ret = xsm_physinfo();
-        if ( ret )
-            break;
-
-
         memset(pi, 0, sizeof(*pi));
         pi->threads_per_core =
             cpumask_weight(per_cpu(cpu_sibling_mask, 0));
@@ -103,10 +98,6 @@ long arch_do_sysctl(
         uint32_t i, max_cpu_index, last_online_cpu;
         xen_sysctl_topologyinfo_t *ti = &sysctl->u.topologyinfo;
 
-        ret = xsm_physinfo();
-        if ( ret )
-            break;
-
         last_online_cpu = cpumask_last(&cpu_online_map);
         max_cpu_index = min_t(uint32_t, ti->max_cpu_index, last_online_cpu);
         ti->max_cpu_index = last_online_cpu;
@@ -143,10 +134,6 @@ long arch_do_sysctl(
         uint32_t i, j, max_node_index, last_online_node;
         xen_sysctl_numainfo_t *ni = &sysctl->u.numainfo;
 
-        ret = xsm_physinfo();
-        if ( ret )
-            break;
-
         last_online_node = last_node(node_online_map);
         max_node_index = min_t(uint32_t, ni->max_node_index, last_online_node);
         ni->max_node_index = last_online_node;
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 599430e..cbefb0e 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -69,10 +69,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_tbuf_op:
     {
-        ret = xsm_tbufcontrol();
-        if ( ret )
-            break;
-
         ret = tb_control(&op->u.tbuf_op);
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -81,10 +77,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     
     case XEN_SYSCTL_sched_id:
     {
-        ret = xsm_sched_id();
-        if ( ret )
-            break;
-
         op->u.sched_id.sched_id = sched_id();
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -139,10 +131,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 #ifdef PERF_COUNTERS
     case XEN_SYSCTL_perfc_op:
     {
-        ret = xsm_perfcontrol();
-        if ( ret )
-            break;
-
         ret = perfc_control(&op->u.perfc_op);
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -153,10 +141,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 #ifdef LOCK_PROFILE
     case XEN_SYSCTL_lockprof_op:
     {
-        ret = xsm_lockprof();
-        if ( ret )
-            break;
-
         ret = spinlock_profile_control(&op->u.lockprof_op);
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -168,10 +152,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         char c;
         uint32_t i;
 
-        ret = xsm_debug_keys();
-        if ( ret )
-            break;
-
         ret = -EFAULT;
         for ( i = 0; i < op->u.debug_keys.nr_keys; i++ )
         {
@@ -190,10 +170,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
         nr_cpus = min(op->u.getcpuinfo.max_cpus, nr_cpu_ids);
 
-        ret = xsm_getcpuinfo();
-        if ( ret )
-            break;
-
         for ( i = 0; i < nr_cpus; i++ )
         {
             cpuinfo.idletime = get_cpu_idle_time(i);
@@ -210,10 +186,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_availheap:
     { 
-        ret = xsm_availheap();
-        if ( ret )
-            break;
-
         op->u.availheap.avail_bytes = avail_domheap_pages_region(
             op->u.availheap.node,
             op->u.availheap.min_bitwidth,
@@ -227,10 +199,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 #ifdef HAS_ACPI
     case XEN_SYSCTL_get_pmstat:
     {
-        ret = xsm_get_pmstat();
-        if ( ret )
-            break;
-
         ret = do_get_pm_info(&op->u.get_pmstat);
         if ( ret )
             break;
@@ -245,10 +213,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_pm_op:
     {
-        ret = xsm_pm_op();
-        if ( ret )
-            break;
-
         ret = do_pm_op(&op->u.pm_op);
         if ( ret && (ret != -EAGAIN) )
             break;
@@ -323,10 +287,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_cpupool_op:
     {
-        ret = xsm_cpupool_op();
-        if ( ret )
-            break;
-
         ret = cpupool_do_sysctl(&op->u.cpupool_op);
         if ( (ret == 0) && copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -335,10 +295,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_scheduler_op:
     {
-        ret = xsm_sched_op();
-        if ( ret )
-            break;
-
         ret = sched_adjust_global(&op->u.scheduler_op);
         if ( (ret == 0) && copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index aef7c4e..93e84dc 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -58,51 +58,11 @@ static XSM_INLINE int xsm_sysctl(int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_tbufcontrol(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_readconsole(uint32_t clear)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_sched_id(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_perfcontrol(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_debug_keys(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getcpuinfo(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_get_pmstat(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_setpminfo(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_pm_op(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_do_mca(void)
 {
     if ( !IS_PRIV(current->domain) )
@@ -110,11 +70,6 @@ static XSM_INLINE int xsm_do_mca(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_availheap(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
 {
     return 0;
@@ -358,16 +313,6 @@ static XSM_INLINE int xsm_lockprof(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_cpupool_op(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_sched_op(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_tmem_op(void)
 {
     return 0;
@@ -508,11 +453,6 @@ static XSM_INLINE int xsm_microcode(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_physinfo(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 903c7cb..f1ccd8e 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -46,16 +46,7 @@ struct xsm_operations {
     int (*set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
     int (*sysctl) (int cmd);
-    int (*tbufcontrol) (void);
     int (*readconsole) (uint32_t clear);
-    int (*sched_id) (void);
-    int (*perfcontrol) (void);
-    int (*debug_keys) (void);
-    int (*getcpuinfo) (void);
-    int (*availheap) (void);
-    int (*get_pmstat) (void);
-    int (*setpminfo) (void);
-    int (*pm_op) (void);
     int (*do_mca) (void);
 
     int (*evtchn_unbound) (struct domain *d, struct evtchn *chn, domid_t id2);
@@ -117,8 +108,6 @@ struct xsm_operations {
 
     int (*page_offline)(uint32_t cmd);
     int (*lockprof)(void);
-    int (*cpupool_op)(void);
-    int (*sched_op)(void);
     int (*tmem_op)(void);
     int (*tmem_control)(void);
 
@@ -138,7 +127,6 @@ struct xsm_operations {
     int (*xen_settime) (void);
     int (*memtype) (uint32_t access);
     int (*microcode) (void);
-    int (*physinfo) (void);
     int (*platform_quirk) (uint32_t);
     int (*platform_op) (uint32_t cmd);
     int (*firmware_info) (void);
@@ -201,56 +189,11 @@ static inline int xsm_sysctl (int cmd)
     return xsm_ops->sysctl(cmd);
 }
 
-static inline int xsm_tbufcontrol (void)
-{
-    return xsm_ops->tbufcontrol();
-}
-
 static inline int xsm_readconsole (uint32_t clear)
 {
     return xsm_ops->readconsole(clear);
 }
 
-static inline int xsm_sched_id (void)
-{
-    return xsm_ops->sched_id();
-}
-
-static inline int xsm_perfcontrol (void)
-{
-    return xsm_ops->perfcontrol();
-}
-
-static inline int xsm_debug_keys (void)
-{
-    return xsm_ops->debug_keys();
-}
-
-static inline int xsm_availheap (void)
-{
-    return xsm_ops->availheap();
-}
-
-static inline int xsm_getcpuinfo (void)
-{
-    return xsm_ops->getcpuinfo();
-}
-
-static inline int xsm_get_pmstat(void)
-{
-    return xsm_ops->get_pmstat();
-}
-
-static inline int xsm_setpminfo(void)
-{
-    return xsm_ops->setpminfo();
-}
-
-static inline int xsm_pm_op(void)
-{
-    return xsm_ops->pm_op();
-}
-
 static inline int xsm_do_mca(void)
 {
     return xsm_ops->do_mca();
@@ -502,16 +445,6 @@ static inline int xsm_lockprof(void)
     return xsm_ops->lockprof();
 }
 
-static inline int xsm_cpupool_op(void)
-{
-    return xsm_ops->cpupool_op();
-}
-
-static inline int xsm_sched_op(void)
-{
-    return xsm_ops->sched_op();
-}
-
 static inline int xsm_tmem_op(void)
 {
     return xsm_ops->tmem_op();
@@ -593,11 +526,6 @@ static inline int xsm_microcode (void)
     return xsm_ops->microcode();
 }
 
-static inline int xsm_physinfo (void)
-{
-    return xsm_ops->physinfo();
-}
-
 static inline int xsm_platform_quirk (uint32_t quirk)
 {
     return xsm_ops->platform_quirk(quirk);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 9bb86ef..03a17ba 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -35,16 +35,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, set_target);
     set_to_dummy_if_null(ops, domctl);
     set_to_dummy_if_null(ops, sysctl);
-    set_to_dummy_if_null(ops, tbufcontrol);
     set_to_dummy_if_null(ops, readconsole);
-    set_to_dummy_if_null(ops, sched_id);
-    set_to_dummy_if_null(ops, perfcontrol);
-    set_to_dummy_if_null(ops, debug_keys);
-    set_to_dummy_if_null(ops, getcpuinfo);
-    set_to_dummy_if_null(ops, availheap);
-    set_to_dummy_if_null(ops, get_pmstat);
-    set_to_dummy_if_null(ops, setpminfo);
-    set_to_dummy_if_null(ops, pm_op);
     set_to_dummy_if_null(ops, do_mca);
 
     set_to_dummy_if_null(ops, evtchn_unbound);
@@ -104,8 +95,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
 
     set_to_dummy_if_null(ops, page_offline);
     set_to_dummy_if_null(ops, lockprof);
-    set_to_dummy_if_null(ops, cpupool_op);
-    set_to_dummy_if_null(ops, sched_op);
     set_to_dummy_if_null(ops, tmem_op);
     set_to_dummy_if_null(ops, tmem_control);
 
@@ -125,7 +114,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, xen_settime);
     set_to_dummy_if_null(ops, memtype);
     set_to_dummy_if_null(ops, microcode);
-    set_to_dummy_if_null(ops, physinfo);
     set_to_dummy_if_null(ops, platform_quirk);
     set_to_dummy_if_null(ops, platform_op);
     set_to_dummy_if_null(ops, firmware_info);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index f0216e0..d72a807 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -702,37 +702,57 @@ static int flask_sysctl(int cmd)
     {
     /* These have individual XSM hooks */
     case XEN_SYSCTL_readconsole:
+    case XEN_SYSCTL_getdomaininfolist:
+    case XEN_SYSCTL_page_offline_op:
+#ifdef CONFIG_X86
+    case XEN_SYSCTL_cpu_hotplug:
+#endif
+        return 0;
+
     case XEN_SYSCTL_tbuf_op:
+        return domain_has_xen(current->domain, XEN__TBUFCONTROL);
+
     case XEN_SYSCTL_sched_id:
+        return domain_has_xen(current->domain, XEN__SCHEDULER);
+
     case XEN_SYSCTL_perfc_op:
-    case XEN_SYSCTL_getdomaininfolist:
+        return domain_has_xen(current->domain, XEN__PERFCONTROL);
+
     case XEN_SYSCTL_debug_keys:
+        return domain_has_xen(current->domain, XEN__DEBUG);
+
     case XEN_SYSCTL_getcpuinfo:
+        return domain_has_xen(current->domain, XEN__GETCPUINFO);
+
     case XEN_SYSCTL_availheap:
+        return domain_has_xen(current->domain, XEN__HEAP);
+
     case XEN_SYSCTL_get_pmstat:
+        return domain_has_xen(current->domain, XEN__PM_OP);
+
     case XEN_SYSCTL_pm_op:
-    case XEN_SYSCTL_page_offline_op:
+        return domain_has_xen(current->domain, XEN__PM_OP);
+
     case XEN_SYSCTL_lockprof_op:
+        return domain_has_xen(current->domain, XEN__LOCKPROF);
+
     case XEN_SYSCTL_cpupool_op:
+        return domain_has_xen(current->domain, XEN__CPUPOOL_OP);
+
     case XEN_SYSCTL_scheduler_op:
-#ifdef CONFIG_X86
+        return domain_has_xen(current->domain, XEN__SCHED_OP);
+
     case XEN_SYSCTL_physinfo:
-    case XEN_SYSCTL_cpu_hotplug:
     case XEN_SYSCTL_topologyinfo:
     case XEN_SYSCTL_numainfo:
-#endif
-        return 0;
+        return domain_has_xen(current->domain, XEN__PHYSINFO);
+
     default:
         printk("flask_sysctl: Unknown op %d\n", cmd);
         return -EPERM;
     }
 }
 
-static int flask_tbufcontrol(void)
-{
-    return domain_has_xen(current->domain, XEN__TBUFCONTROL);
-}
-
 static int flask_readconsole(uint32_t clear)
 {
     u32 perms = XEN__READCONSOLE;
@@ -743,41 +763,6 @@ static int flask_readconsole(uint32_t clear)
     return domain_has_xen(current->domain, perms);
 }
 
-static int flask_sched_id(void)
-{
-    return domain_has_xen(current->domain, XEN__SCHEDULER);
-}
-
-static int flask_debug_keys(void)
-{
-    return domain_has_xen(current->domain, XEN__DEBUG);
-}
-
-static int flask_getcpuinfo(void)
-{
-    return domain_has_xen(current->domain, XEN__GETCPUINFO);
-}
-
-static int flask_availheap(void)
-{
-    return domain_has_xen(current->domain, XEN__HEAP);
-}
-
-static int flask_get_pmstat(void)
-{
-    return domain_has_xen(current->domain, XEN__PM_OP);
-}
-
-static int flask_setpminfo(void)
-{
-    return domain_has_xen(current->domain, XEN__PM_OP);
-}
-
-static int flask_pm_op(void)
-{
-    return domain_has_xen(current->domain, XEN__PM_OP);
-}
-
 static int flask_do_mca(void)
 {
     return domain_has_xen(current->domain, XEN__MCA_OP);
@@ -1031,21 +1016,6 @@ static inline int flask_page_offline(uint32_t cmd)
     }
 }
 
-static inline int flask_lockprof(void)
-{
-    return domain_has_xen(current->domain, XEN__LOCKPROF);
-}
-
-static inline int flask_cpupool_op(void)
-{
-    return domain_has_xen(current->domain, XEN__CPUPOOL_OP);
-}
-
-static inline int flask_sched_op(void)
-{
-    return domain_has_xen(current->domain, XEN__SCHED_OP);
-}
-
 static inline int flask_tmem_op(void)
 {
     return domain_has_xen(current->domain, XEN__TMEM_OP);
@@ -1056,11 +1026,6 @@ static inline int flask_tmem_control(void)
     return domain_has_xen(current->domain, XEN__TMEM_CONTROL);
 }
 
-static int flask_perfcontrol(void)
-{
-    return domain_has_xen(current->domain, XEN__PERFCONTROL);
-}
-
 #ifdef CONFIG_X86
 static int flask_shadow_control(struct domain *d, uint32_t op)
 {
@@ -1253,11 +1218,6 @@ static int flask_microcode(void)
     return domain_has_xen(current->domain, XEN__MICROCODE);
 }
 
-static int flask_physinfo(void)
-{
-    return domain_has_xen(current->domain, XEN__PHYSINFO);
-}
-
 static int flask_platform_quirk(uint32_t quirk)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN, XEN__QUIRK, NULL);
@@ -1278,17 +1238,21 @@ static int flask_platform_op(uint32_t op)
     case XENPF_enter_acpi_sleep:
     case XENPF_change_freq:
     case XENPF_getidletime:
-    case XENPF_set_processor_pminfo:
-    case XENPF_get_cpuinfo:
-    case XENPF_get_cpu_version:
     case XENPF_cpu_online:
     case XENPF_cpu_offline:
     case XENPF_cpu_hotadd:
     case XENPF_mem_hotadd:
         /* These operations have their own XSM hooks */
         return 0;
+
+    case XENPF_set_processor_pminfo:
     case XENPF_core_parking:
         return domain_has_xen(current->domain, XEN__PM_OP);
+
+    case XENPF_get_cpu_version:
+    case XENPF_get_cpuinfo:
+        return domain_has_xen(current->domain, XEN__GETCPUINFO);
+
     default:
         printk("flask_platform_op: Unknown op %d\n", op);
         return -EPERM;
@@ -1484,16 +1448,7 @@ static struct xsm_operations flask_ops = {
     .set_target = flask_set_target,
     .domctl = flask_domctl,
     .sysctl = flask_sysctl,
-    .tbufcontrol = flask_tbufcontrol,
     .readconsole = flask_readconsole,
-    .sched_id = flask_sched_id,
-    .perfcontrol = flask_perfcontrol,
-    .debug_keys = flask_debug_keys,
-    .getcpuinfo = flask_getcpuinfo,
-    .availheap = flask_availheap,
-    .get_pmstat = flask_get_pmstat,
-    .setpminfo = flask_setpminfo,
-    .pm_op = flask_pm_op,
     .do_mca = flask_do_mca,
 
     .evtchn_unbound = flask_evtchn_unbound,
@@ -1548,9 +1503,6 @@ static struct xsm_operations flask_ops = {
     .resource_setup_misc = flask_resource_setup_misc,
 
     .page_offline = flask_page_offline,
-    .lockprof = flask_lockprof,
-    .cpupool_op = flask_cpupool_op,
-    .sched_op = flask_sched_op,
     .tmem_op = flask_tmem_op,
     .tmem_control = flask_tmem_control,
 
@@ -1570,7 +1522,6 @@ static struct xsm_operations flask_ops = {
     .xen_settime = flask_xen_settime,
     .memtype = flask_memtype,
     .microcode = flask_microcode,
-    .physinfo = flask_physinfo,
     .platform_quirk = flask_platform_quirk,
     .platform_op = flask_platform_op,
     .firmware_info = flask_firmware_info,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:11:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:11:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarM4-0000hZ-RL; Tue, 20 Nov 2012 17:11:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TarM3-0000hM-7y
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:11:23 +0000
Received: from [85.158.143.35:41517] by server-2.bemta-4.messagelabs.com id
	C5/87-28922-AB9BBA05; Tue, 20 Nov 2012 17:11:22 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-21.messagelabs.com!1353431478!11405262!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1036 invoked from network); 20 Nov 2012 17:11:19 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-11.tower-21.messagelabs.com with SMTP;
	20 Nov 2012 17:11:19 -0000
X-TM-IMSS-Message-ID: <0a20be7300009afd@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 0a20be7300009afd ;
	Mon, 19 Nov 2012 16:31:55 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJLSNQE013605; 
	Mon, 19 Nov 2012 16:28:24 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Mon, 19 Nov 2012 16:28:20 -0500
Message-Id: <1353360502-27819-4-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 3/5] xen: sysctl XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

A number of the sysctl XSM hooks have no parameters or only pass the
operation ID, making them redundant with the xsm_sysctl hook. Remove
these redundant hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/platform_hypercall.c |  12 ----
 xen/arch/x86/sysctl.c             |  13 ----
 xen/common/sysctl.c               |  44 --------------
 xen/include/xsm/dummy.h           |  60 ------------------
 xen/include/xsm/xsm.h             |  72 ----------------------
 xen/xsm/dummy.c                   |  12 ----
 xen/xsm/flask/hooks.c             | 125 ++++++++++++--------------------------
 7 files changed, 38 insertions(+), 300 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 738bed0..ffac6ac 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -419,10 +419,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_set_processor_pminfo:
-        ret = xsm_setpminfo();
-        if ( ret )
-            break;
-
         switch ( op->u.set_pminfo.type )
         {
         case XEN_PM_PX:
@@ -475,10 +471,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
         g_info = &op->u.pcpu_info;
 
-        ret = xsm_getcpuinfo();
-        if ( ret )
-            break;
-
         if ( !get_cpu_maps() )
         {
             ret = -EBUSY;
@@ -512,10 +504,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         struct xenpf_pcpu_version *ver = &op->u.pcpu_version;
 
-        ret = xsm_getcpuinfo();
-        if ( ret )
-            break;
-
         if ( !get_cpu_maps() )
         {
             ret = -EBUSY;
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index b84dd34..5b0c4b7 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -69,11 +69,6 @@ long arch_do_sysctl(
     {
         xen_sysctl_physinfo_t *pi = &sysctl->u.physinfo;
 
-        ret = xsm_physinfo();
-        if ( ret )
-            break;
-
-
         memset(pi, 0, sizeof(*pi));
         pi->threads_per_core =
             cpumask_weight(per_cpu(cpu_sibling_mask, 0));
@@ -103,10 +98,6 @@ long arch_do_sysctl(
         uint32_t i, max_cpu_index, last_online_cpu;
         xen_sysctl_topologyinfo_t *ti = &sysctl->u.topologyinfo;
 
-        ret = xsm_physinfo();
-        if ( ret )
-            break;
-
         last_online_cpu = cpumask_last(&cpu_online_map);
         max_cpu_index = min_t(uint32_t, ti->max_cpu_index, last_online_cpu);
         ti->max_cpu_index = last_online_cpu;
@@ -143,10 +134,6 @@ long arch_do_sysctl(
         uint32_t i, j, max_node_index, last_online_node;
         xen_sysctl_numainfo_t *ni = &sysctl->u.numainfo;
 
-        ret = xsm_physinfo();
-        if ( ret )
-            break;
-
         last_online_node = last_node(node_online_map);
         max_node_index = min_t(uint32_t, ni->max_node_index, last_online_node);
         ni->max_node_index = last_online_node;
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 599430e..cbefb0e 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -69,10 +69,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_tbuf_op:
     {
-        ret = xsm_tbufcontrol();
-        if ( ret )
-            break;
-
         ret = tb_control(&op->u.tbuf_op);
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -81,10 +77,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     
     case XEN_SYSCTL_sched_id:
     {
-        ret = xsm_sched_id();
-        if ( ret )
-            break;
-
         op->u.sched_id.sched_id = sched_id();
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -139,10 +131,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 #ifdef PERF_COUNTERS
     case XEN_SYSCTL_perfc_op:
     {
-        ret = xsm_perfcontrol();
-        if ( ret )
-            break;
-
         ret = perfc_control(&op->u.perfc_op);
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -153,10 +141,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 #ifdef LOCK_PROFILE
     case XEN_SYSCTL_lockprof_op:
     {
-        ret = xsm_lockprof();
-        if ( ret )
-            break;
-
         ret = spinlock_profile_control(&op->u.lockprof_op);
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -168,10 +152,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         char c;
         uint32_t i;
 
-        ret = xsm_debug_keys();
-        if ( ret )
-            break;
-
         ret = -EFAULT;
         for ( i = 0; i < op->u.debug_keys.nr_keys; i++ )
         {
@@ -190,10 +170,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
         nr_cpus = min(op->u.getcpuinfo.max_cpus, nr_cpu_ids);
 
-        ret = xsm_getcpuinfo();
-        if ( ret )
-            break;
-
         for ( i = 0; i < nr_cpus; i++ )
         {
             cpuinfo.idletime = get_cpu_idle_time(i);
@@ -210,10 +186,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_availheap:
     { 
-        ret = xsm_availheap();
-        if ( ret )
-            break;
-
         op->u.availheap.avail_bytes = avail_domheap_pages_region(
             op->u.availheap.node,
             op->u.availheap.min_bitwidth,
@@ -227,10 +199,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 #ifdef HAS_ACPI
     case XEN_SYSCTL_get_pmstat:
     {
-        ret = xsm_get_pmstat();
-        if ( ret )
-            break;
-
         ret = do_get_pm_info(&op->u.get_pmstat);
         if ( ret )
             break;
@@ -245,10 +213,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_pm_op:
     {
-        ret = xsm_pm_op();
-        if ( ret )
-            break;
-
         ret = do_pm_op(&op->u.pm_op);
         if ( ret && (ret != -EAGAIN) )
             break;
@@ -323,10 +287,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_cpupool_op:
     {
-        ret = xsm_cpupool_op();
-        if ( ret )
-            break;
-
         ret = cpupool_do_sysctl(&op->u.cpupool_op);
         if ( (ret == 0) && copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -335,10 +295,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_scheduler_op:
     {
-        ret = xsm_sched_op();
-        if ( ret )
-            break;
-
         ret = sched_adjust_global(&op->u.scheduler_op);
         if ( (ret == 0) && copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index aef7c4e..93e84dc 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -58,51 +58,11 @@ static XSM_INLINE int xsm_sysctl(int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_tbufcontrol(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_readconsole(uint32_t clear)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_sched_id(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_perfcontrol(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_debug_keys(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getcpuinfo(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_get_pmstat(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_setpminfo(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_pm_op(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_do_mca(void)
 {
     if ( !IS_PRIV(current->domain) )
@@ -110,11 +70,6 @@ static XSM_INLINE int xsm_do_mca(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_availheap(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
 {
     return 0;
@@ -358,16 +313,6 @@ static XSM_INLINE int xsm_lockprof(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_cpupool_op(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_sched_op(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_tmem_op(void)
 {
     return 0;
@@ -508,11 +453,6 @@ static XSM_INLINE int xsm_microcode(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_physinfo(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 903c7cb..f1ccd8e 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -46,16 +46,7 @@ struct xsm_operations {
     int (*set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
     int (*sysctl) (int cmd);
-    int (*tbufcontrol) (void);
     int (*readconsole) (uint32_t clear);
-    int (*sched_id) (void);
-    int (*perfcontrol) (void);
-    int (*debug_keys) (void);
-    int (*getcpuinfo) (void);
-    int (*availheap) (void);
-    int (*get_pmstat) (void);
-    int (*setpminfo) (void);
-    int (*pm_op) (void);
     int (*do_mca) (void);
 
     int (*evtchn_unbound) (struct domain *d, struct evtchn *chn, domid_t id2);
@@ -117,8 +108,6 @@ struct xsm_operations {
 
     int (*page_offline)(uint32_t cmd);
     int (*lockprof)(void);
-    int (*cpupool_op)(void);
-    int (*sched_op)(void);
     int (*tmem_op)(void);
     int (*tmem_control)(void);
 
@@ -138,7 +127,6 @@ struct xsm_operations {
     int (*xen_settime) (void);
     int (*memtype) (uint32_t access);
     int (*microcode) (void);
-    int (*physinfo) (void);
     int (*platform_quirk) (uint32_t);
     int (*platform_op) (uint32_t cmd);
     int (*firmware_info) (void);
@@ -201,56 +189,11 @@ static inline int xsm_sysctl (int cmd)
     return xsm_ops->sysctl(cmd);
 }
 
-static inline int xsm_tbufcontrol (void)
-{
-    return xsm_ops->tbufcontrol();
-}
-
 static inline int xsm_readconsole (uint32_t clear)
 {
     return xsm_ops->readconsole(clear);
 }
 
-static inline int xsm_sched_id (void)
-{
-    return xsm_ops->sched_id();
-}
-
-static inline int xsm_perfcontrol (void)
-{
-    return xsm_ops->perfcontrol();
-}
-
-static inline int xsm_debug_keys (void)
-{
-    return xsm_ops->debug_keys();
-}
-
-static inline int xsm_availheap (void)
-{
-    return xsm_ops->availheap();
-}
-
-static inline int xsm_getcpuinfo (void)
-{
-    return xsm_ops->getcpuinfo();
-}
-
-static inline int xsm_get_pmstat(void)
-{
-    return xsm_ops->get_pmstat();
-}
-
-static inline int xsm_setpminfo(void)
-{
-    return xsm_ops->setpminfo();
-}
-
-static inline int xsm_pm_op(void)
-{
-    return xsm_ops->pm_op();
-}
-
 static inline int xsm_do_mca(void)
 {
     return xsm_ops->do_mca();
@@ -502,16 +445,6 @@ static inline int xsm_lockprof(void)
     return xsm_ops->lockprof();
 }
 
-static inline int xsm_cpupool_op(void)
-{
-    return xsm_ops->cpupool_op();
-}
-
-static inline int xsm_sched_op(void)
-{
-    return xsm_ops->sched_op();
-}
-
 static inline int xsm_tmem_op(void)
 {
     return xsm_ops->tmem_op();
@@ -593,11 +526,6 @@ static inline int xsm_microcode (void)
     return xsm_ops->microcode();
 }
 
-static inline int xsm_physinfo (void)
-{
-    return xsm_ops->physinfo();
-}
-
 static inline int xsm_platform_quirk (uint32_t quirk)
 {
     return xsm_ops->platform_quirk(quirk);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 9bb86ef..03a17ba 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -35,16 +35,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, set_target);
     set_to_dummy_if_null(ops, domctl);
     set_to_dummy_if_null(ops, sysctl);
-    set_to_dummy_if_null(ops, tbufcontrol);
     set_to_dummy_if_null(ops, readconsole);
-    set_to_dummy_if_null(ops, sched_id);
-    set_to_dummy_if_null(ops, perfcontrol);
-    set_to_dummy_if_null(ops, debug_keys);
-    set_to_dummy_if_null(ops, getcpuinfo);
-    set_to_dummy_if_null(ops, availheap);
-    set_to_dummy_if_null(ops, get_pmstat);
-    set_to_dummy_if_null(ops, setpminfo);
-    set_to_dummy_if_null(ops, pm_op);
     set_to_dummy_if_null(ops, do_mca);
 
     set_to_dummy_if_null(ops, evtchn_unbound);
@@ -104,8 +95,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
 
     set_to_dummy_if_null(ops, page_offline);
     set_to_dummy_if_null(ops, lockprof);
-    set_to_dummy_if_null(ops, cpupool_op);
-    set_to_dummy_if_null(ops, sched_op);
     set_to_dummy_if_null(ops, tmem_op);
     set_to_dummy_if_null(ops, tmem_control);
 
@@ -125,7 +114,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, xen_settime);
     set_to_dummy_if_null(ops, memtype);
     set_to_dummy_if_null(ops, microcode);
-    set_to_dummy_if_null(ops, physinfo);
     set_to_dummy_if_null(ops, platform_quirk);
     set_to_dummy_if_null(ops, platform_op);
     set_to_dummy_if_null(ops, firmware_info);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index f0216e0..d72a807 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -702,37 +702,57 @@ static int flask_sysctl(int cmd)
     {
     /* These have individual XSM hooks */
     case XEN_SYSCTL_readconsole:
+    case XEN_SYSCTL_getdomaininfolist:
+    case XEN_SYSCTL_page_offline_op:
+#ifdef CONFIG_X86
+    case XEN_SYSCTL_cpu_hotplug:
+#endif
+        return 0;
+
     case XEN_SYSCTL_tbuf_op:
+        return domain_has_xen(current->domain, XEN__TBUFCONTROL);
+
     case XEN_SYSCTL_sched_id:
+        return domain_has_xen(current->domain, XEN__SCHEDULER);
+
     case XEN_SYSCTL_perfc_op:
-    case XEN_SYSCTL_getdomaininfolist:
+        return domain_has_xen(current->domain, XEN__PERFCONTROL);
+
     case XEN_SYSCTL_debug_keys:
+        return domain_has_xen(current->domain, XEN__DEBUG);
+
     case XEN_SYSCTL_getcpuinfo:
+        return domain_has_xen(current->domain, XEN__GETCPUINFO);
+
     case XEN_SYSCTL_availheap:
+        return domain_has_xen(current->domain, XEN__HEAP);
+
     case XEN_SYSCTL_get_pmstat:
+        return domain_has_xen(current->domain, XEN__PM_OP);
+
     case XEN_SYSCTL_pm_op:
-    case XEN_SYSCTL_page_offline_op:
+        return domain_has_xen(current->domain, XEN__PM_OP);
+
     case XEN_SYSCTL_lockprof_op:
+        return domain_has_xen(current->domain, XEN__LOCKPROF);
+
     case XEN_SYSCTL_cpupool_op:
+        return domain_has_xen(current->domain, XEN__CPUPOOL_OP);
+
     case XEN_SYSCTL_scheduler_op:
-#ifdef CONFIG_X86
+        return domain_has_xen(current->domain, XEN__SCHED_OP);
+
     case XEN_SYSCTL_physinfo:
-    case XEN_SYSCTL_cpu_hotplug:
     case XEN_SYSCTL_topologyinfo:
     case XEN_SYSCTL_numainfo:
-#endif
-        return 0;
+        return domain_has_xen(current->domain, XEN__PHYSINFO);
+
     default:
         printk("flask_sysctl: Unknown op %d\n", cmd);
         return -EPERM;
     }
 }
 
-static int flask_tbufcontrol(void)
-{
-    return domain_has_xen(current->domain, XEN__TBUFCONTROL);
-}
-
 static int flask_readconsole(uint32_t clear)
 {
     u32 perms = XEN__READCONSOLE;
@@ -743,41 +763,6 @@ static int flask_readconsole(uint32_t clear)
     return domain_has_xen(current->domain, perms);
 }
 
-static int flask_sched_id(void)
-{
-    return domain_has_xen(current->domain, XEN__SCHEDULER);
-}
-
-static int flask_debug_keys(void)
-{
-    return domain_has_xen(current->domain, XEN__DEBUG);
-}
-
-static int flask_getcpuinfo(void)
-{
-    return domain_has_xen(current->domain, XEN__GETCPUINFO);
-}
-
-static int flask_availheap(void)
-{
-    return domain_has_xen(current->domain, XEN__HEAP);
-}
-
-static int flask_get_pmstat(void)
-{
-    return domain_has_xen(current->domain, XEN__PM_OP);
-}
-
-static int flask_setpminfo(void)
-{
-    return domain_has_xen(current->domain, XEN__PM_OP);
-}
-
-static int flask_pm_op(void)
-{
-    return domain_has_xen(current->domain, XEN__PM_OP);
-}
-
 static int flask_do_mca(void)
 {
     return domain_has_xen(current->domain, XEN__MCA_OP);
@@ -1031,21 +1016,6 @@ static inline int flask_page_offline(uint32_t cmd)
     }
 }
 
-static inline int flask_lockprof(void)
-{
-    return domain_has_xen(current->domain, XEN__LOCKPROF);
-}
-
-static inline int flask_cpupool_op(void)
-{
-    return domain_has_xen(current->domain, XEN__CPUPOOL_OP);
-}
-
-static inline int flask_sched_op(void)
-{
-    return domain_has_xen(current->domain, XEN__SCHED_OP);
-}
-
 static inline int flask_tmem_op(void)
 {
     return domain_has_xen(current->domain, XEN__TMEM_OP);
@@ -1056,11 +1026,6 @@ static inline int flask_tmem_control(void)
     return domain_has_xen(current->domain, XEN__TMEM_CONTROL);
 }
 
-static int flask_perfcontrol(void)
-{
-    return domain_has_xen(current->domain, XEN__PERFCONTROL);
-}
-
 #ifdef CONFIG_X86
 static int flask_shadow_control(struct domain *d, uint32_t op)
 {
@@ -1253,11 +1218,6 @@ static int flask_microcode(void)
     return domain_has_xen(current->domain, XEN__MICROCODE);
 }
 
-static int flask_physinfo(void)
-{
-    return domain_has_xen(current->domain, XEN__PHYSINFO);
-}
-
 static int flask_platform_quirk(uint32_t quirk)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN, XEN__QUIRK, NULL);
@@ -1278,17 +1238,21 @@ static int flask_platform_op(uint32_t op)
     case XENPF_enter_acpi_sleep:
     case XENPF_change_freq:
     case XENPF_getidletime:
-    case XENPF_set_processor_pminfo:
-    case XENPF_get_cpuinfo:
-    case XENPF_get_cpu_version:
     case XENPF_cpu_online:
     case XENPF_cpu_offline:
     case XENPF_cpu_hotadd:
     case XENPF_mem_hotadd:
         /* These operations have their own XSM hooks */
         return 0;
+
+    case XENPF_set_processor_pminfo:
     case XENPF_core_parking:
         return domain_has_xen(current->domain, XEN__PM_OP);
+
+    case XENPF_get_cpu_version:
+    case XENPF_get_cpuinfo:
+        return domain_has_xen(current->domain, XEN__GETCPUINFO);
+
     default:
         printk("flask_platform_op: Unknown op %d\n", op);
         return -EPERM;
@@ -1484,16 +1448,7 @@ static struct xsm_operations flask_ops = {
     .set_target = flask_set_target,
     .domctl = flask_domctl,
     .sysctl = flask_sysctl,
-    .tbufcontrol = flask_tbufcontrol,
     .readconsole = flask_readconsole,
-    .sched_id = flask_sched_id,
-    .perfcontrol = flask_perfcontrol,
-    .debug_keys = flask_debug_keys,
-    .getcpuinfo = flask_getcpuinfo,
-    .availheap = flask_availheap,
-    .get_pmstat = flask_get_pmstat,
-    .setpminfo = flask_setpminfo,
-    .pm_op = flask_pm_op,
     .do_mca = flask_do_mca,
 
     .evtchn_unbound = flask_evtchn_unbound,
@@ -1548,9 +1503,6 @@ static struct xsm_operations flask_ops = {
     .resource_setup_misc = flask_resource_setup_misc,
 
     .page_offline = flask_page_offline,
-    .lockprof = flask_lockprof,
-    .cpupool_op = flask_cpupool_op,
-    .sched_op = flask_sched_op,
     .tmem_op = flask_tmem_op,
     .tmem_control = flask_tmem_control,
 
@@ -1570,7 +1522,6 @@ static struct xsm_operations flask_ops = {
     .xen_settime = flask_xen_settime,
     .memtype = flask_memtype,
     .microcode = flask_microcode,
-    .physinfo = flask_physinfo,
     .platform_quirk = flask_platform_quirk,
     .platform_op = flask_platform_op,
     .firmware_info = flask_firmware_info,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:12:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:12:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarN5-0000ts-B4; Tue, 20 Nov 2012 17:12:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TarN3-0000tE-8N
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:12:25 +0000
Received: from [85.158.143.35:33195] by server-2.bemta-4.messagelabs.com id
	F0/98-28922-8F9BBA05; Tue, 20 Nov 2012 17:12:24 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-2.tower-21.messagelabs.com!1353431541!5616716!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21963 invoked from network); 20 Nov 2012 17:12:21 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-2.tower-21.messagelabs.com with SMTP;
	20 Nov 2012 17:12:21 -0000
X-TM-IMSS-Message-ID: <0a20bda800009afc@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 0a20bda800009afc ;
	Mon, 19 Nov 2012 16:31:54 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJLSNQD013605; 
	Mon, 19 Nov 2012 16:28:24 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Mon, 19 Nov 2012 16:28:19 -0500
Message-Id: <1353360502-27819-3-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 2/5] xen: domctl XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

A number of the domctl XSM hooks do nothing except pass the domain and
operation ID, making them redundant with the xsm_domctl hook. Remove
these redundant hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/domctl.c   |  76 +---------
 xen/common/domctl.c     |  59 +-------
 xen/include/xsm/dummy.h | 135 -----------------
 xen/include/xsm/xsm.h   | 161 ---------------------
 xen/xsm/dummy.c         |  27 ----
 xen/xsm/flask/hooks.c   | 378 ++++++++++++------------------------------------
 6 files changed, 98 insertions(+), 738 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 5e224fc..2630bdb 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -96,10 +96,6 @@ long arch_do_domctl(
 
         page = mfn_to_page(mfn);
 
-        ret = xsm_getpageframeinfo(d);
-        if ( ret )
-            break;
-
         if ( likely(get_page(page, d)) )
         {
             ret = 0;
@@ -140,10 +136,6 @@ long arch_do_domctl(
             struct page_info *page;
             xen_pfn_t *arr;
 
-            ret = xsm_getpageframeinfo(d);
-            if ( ret )
-                break;
-
             if ( unlikely(num > 1024) ||
                  unlikely(num != domctl->u.getpageframeinfo3.num) )
             {
@@ -229,10 +221,6 @@ long arch_do_domctl(
         int num = domctl->u.getpageframeinfo2.num;
         uint32_t *arr32;
 
-        ret = xsm_getpageframeinfo(d);
-        if ( ret )
-            break;
-
         if ( unlikely(num > 1024) )
         {
             ret = -E2BIG;
@@ -324,10 +312,6 @@ long arch_do_domctl(
         uint64_t mfn;
         struct page_info *page;
 
-        ret = xsm_getmemlist(d);
-        if ( ret )
-            break;
-
         if ( unlikely(d->is_dying) ) {
             ret = -EINVAL;
             break;
@@ -363,10 +347,6 @@ long arch_do_domctl(
         struct page_info *page;
         void *hypercall_page;
 
-        ret = xsm_hypercall_init(d);
-        if ( ret )
-            break;
-
         page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
 
         ret = -EACCES;
@@ -391,10 +371,6 @@ long arch_do_domctl(
     { 
         struct hvm_domain_context c = { .size = domctl->u.hvmcontext.size };
 
-        ret = xsm_hvmcontext(d, domctl->cmd);
-        if ( ret )
-            goto sethvmcontext_out;
-
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
             goto sethvmcontext_out;
@@ -421,10 +397,6 @@ long arch_do_domctl(
     { 
         struct hvm_domain_context c = { 0 };
 
-        ret = xsm_hvmcontext(d, domctl->cmd);
-        if ( ret )
-            goto gethvmcontext_out;
-
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
             goto gethvmcontext_out;
@@ -468,10 +440,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_gethvmcontext_partial:
     { 
-        ret = xsm_hvmcontext(d, domctl->cmd);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
             break;
@@ -487,10 +455,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_address_size:
     {
-        ret = xsm_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         switch ( domctl->u.address_size.size )
         {
         case 32:
@@ -508,10 +472,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_get_address_size:
     {
-        ret = xsm_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         domctl->u.address_size.size =
             is_pv_32on64_domain(d) ? 32 : BITS_PER_LONG;
 
@@ -524,10 +484,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_machine_address_size:
     {
-        ret = xsm_machine_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         ret = -EBUSY;
         if ( d->tot_pages > 0 )
             break;
@@ -540,10 +496,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_get_machine_address_size:
     {
-        ret = xsm_machine_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         domctl->u.address_size.size = d->arch.physaddr_bitsize;
 
         ret = 0;
@@ -557,10 +509,6 @@ long arch_do_domctl(
     {
         struct vcpu *v;
 
-        ret = xsm_sendtrigger(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( domctl->u.sendtrigger.vcpu >= MAX_VIRT_CPUS )
             break;
@@ -827,10 +775,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_pin_mem_cacheattr:
     {
-        ret = xsm_pin_mem_cacheattr(d);
-        if ( ret )
-            break;
-
         ret = hvm_set_mem_pinned_cacheattr(
             d, domctl->u.pin_mem_cacheattr.start,
             domctl->u.pin_mem_cacheattr.end,
@@ -846,10 +790,6 @@ long arch_do_domctl(
 
         evc = &domctl->u.ext_vcpucontext;
 
-        ret = xsm_ext_vcpucontext(d, domctl->cmd);
-        if ( ret )
-            break;
-
         ret = -ESRCH;
         if ( (evc->vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[evc->vcpu]) == NULL) )
@@ -1115,10 +1055,6 @@ long arch_do_domctl(
 
         evc = &domctl->u.vcpuextstate;
 
-        ret = xsm_vcpuextstate(d, domctl->cmd);
-        if ( ret )
-            goto vcpuextstate_out;
-
         ret = -ESRCH;
         if ( (evc->vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[evc->vcpu]) == NULL) )
@@ -1229,9 +1165,7 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_mem_sharing_op:
     {
-        ret = xsm_mem_sharing(d);
-        if ( !ret )
-            ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
+        ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
     }
     break;
 
@@ -1262,11 +1196,9 @@ long arch_do_domctl(
         if ( current->domain == d )
             break;
 
-        ret = xsm_mem_event_setup(d);
-        if ( !ret ) {
-            p2m = p2m_get_hostp2m(d);
-            p2m->access_required = domctl->u.access_required.access_required;
-        }
+        ret = 0;
+        p2m = p2m_get_hostp2m(d);
+        p2m->access_required = domctl->u.access_required.access_required;
     }
     break;
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 2a42a5f..6f792e9 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -289,10 +289,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( d == NULL )
             break;
 
-        ret = xsm_setvcpucontext(d);
-        if ( ret )
-            goto svc_out;
-
         ret = -EINVAL;
         if ( (d == current->domain) || /* no domain_pause() */
              (vcpu >= d->max_vcpus) || ((v = d->vcpu[vcpu]) == NULL) )
@@ -339,10 +335,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_pausedomain:
     {
-        ret = xsm_pausedomain(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( d != current->domain )
         {
@@ -354,10 +346,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_unpausedomain:
     {
-        ret = xsm_unpausedomain(d);
-        if ( ret )
-            break;
-
         domain_unpause_by_systemcontroller(d);
         ret = 0;
     }
@@ -365,10 +353,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_resumedomain:
     {
-        ret = xsm_resumedomain(d);
-        if ( ret )
-            break;
-
         domain_resume(d);
         ret = 0;
     }
@@ -452,10 +436,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
              (is_hvm_domain(d) && (max > MAX_HVM_VCPUS)) )
             break;
 
-        ret = xsm_max_vcpus(d);
-        if ( ret )
-            break;
-
         /* Until Xenoprof can dynamically grow its vcpu-s array... */
         if ( d->xenoprof )
         {
@@ -538,7 +518,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_destroydomain:
     {
-        ret = xsm_destroydomain(d) ? : domain_kill(d);
+        ret = domain_kill(d);
     }
     break;
 
@@ -547,10 +527,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     {
         struct vcpu *v;
 
-        ret = xsm_vcpuaffinity(op->cmd, d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( op->u.vcpuaffinity.vcpu >= d->max_vcpus )
             break;
@@ -581,10 +557,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_scheduler_op:
     {
-        ret = xsm_scheduler(d);
-        if ( ret )
-            break;
-
         ret = sched_adjust(d, &op->u.scheduler_op);
         if ( copy_to_guest(u_domctl, op, 1) )
             ret = -EFAULT;
@@ -629,10 +601,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         vcpu_guest_context_u c = { .nat = NULL };
         struct vcpu         *v;
 
-        ret = xsm_getvcpucontext(d);
-        if ( ret )
-            goto getvcpucontext_out;
-
         ret = -EINVAL;
         if ( op->u.vcpucontext.vcpu >= d->max_vcpus )
             goto getvcpucontext_out;
@@ -685,10 +653,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         struct vcpu   *v;
         struct vcpu_runstate_info runstate;
 
-        ret = xsm_getvcpuinfo(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( op->u.getvcpuinfo.vcpu >= d->max_vcpus )
             break;
@@ -715,10 +679,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     {
         unsigned long new_max;
 
-        ret = xsm_setdomainmaxmem(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         new_max = op->u.max_mem.max_memkb >> (PAGE_SHIFT-10);
 
@@ -736,10 +696,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_setdomainhandle:
     {
-        ret = xsm_setdomainhandle(d);
-        if ( ret )
-            break;
-
         memcpy(d->handle, op->u.setdomainhandle.handle,
                sizeof(xen_domain_handle_t));
         ret = 0;
@@ -752,10 +708,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( d == current->domain ) /* no domain_pause() */
             break;
 
-        ret = xsm_setdebugging(d);
-        if ( ret )
-            break;
-
         domain_pause(d);
         d->debugger_attached = !!op->u.setdebugging.enable;
         domain_unpause(d); /* causes guest to latch new status */
@@ -800,10 +752,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_settimeoffset:
     {
-        ret = xsm_domain_settime(d);
-        if ( ret )
-            break;
-
         domain_set_time_offset(d, op->u.settimeoffset.time_offset_seconds);
         ret = 0;
     }
@@ -853,10 +801,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     case XEN_DOMCTL_set_virq_handler:
     {
         uint32_t virq = op->u.set_virq_handler.virq;
-
-        ret = xsm_set_virq_handler(d, virq);
-        if ( !ret )
-            ret = set_global_virq_handler(d, virq);
+        ret = set_global_virq_handler(d, virq);
     }
     break;
 
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index fa78785..aef7c4e 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -17,71 +17,16 @@ static XSM_INLINE void xsm_security_domaininfo(struct domain *d,
     return;
 }
 
-static XSM_INLINE int xsm_setvcpucontext(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_pausedomain(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_unpausedomain(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_resumedomain(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_domain_create(struct domain *d, u32 ssidref)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_max_vcpus(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_destroydomain(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_vcpuaffinity(int cmd, struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_scheduler(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_getvcpucontext(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getvcpuinfo(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_domain_settime(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
 {
     return 0;
@@ -113,11 +58,6 @@ static XSM_INLINE int xsm_sysctl(int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_set_virq_handler(struct domain *d, uint32_t virq)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_tbufcontrol(void)
 {
     return 0;
@@ -133,21 +73,6 @@ static XSM_INLINE int xsm_sched_id(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_setdomainmaxmem(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_setdomainhandle(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_setdebugging(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_perfcontrol(void)
 {
     return 0;
@@ -505,36 +430,6 @@ static XSM_INLINE int xsm_shadow_control(struct domain *d, uint32_t op)
     return 0;
 }
 
-static XSM_INLINE int xsm_getpageframeinfo(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getmemlist(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_hypercall_init(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_hvmcontext(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_address_size(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_machine_address_size(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
@@ -570,11 +465,6 @@ static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_event_setup(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_mem_event_control(struct domain *d, int mode, int op)
 {
     if ( !IS_PRIV(current->domain) )
@@ -589,11 +479,6 @@ static XSM_INLINE int xsm_mem_event_op(struct domain *d, int op)
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_sharing(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, cd) )
@@ -720,11 +605,6 @@ static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *
     return 0;
 }
 
-static XSM_INLINE int xsm_sendtrigger(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
@@ -735,21 +615,6 @@ static XSM_INLINE int xsm_unbind_pt_irq(struct domain *d, struct xen_domctl_bind
     return 0;
 }
 
-static XSM_INLINE int xsm_pin_mem_cacheattr(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index b2f33d6..903c7cb 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -41,29 +41,14 @@ extern xsm_initcall_t __xsm_initcall_start[], __xsm_initcall_end[];
 struct xsm_operations {
     void (*security_domaininfo) (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info);
-    int (*setvcpucontext) (struct domain *d);
-    int (*pausedomain) (struct domain *d);
-    int (*unpausedomain) (struct domain *d);
-    int (*resumedomain) (struct domain *d);
     int (*domain_create) (struct domain *d, u32 ssidref);
-    int (*max_vcpus) (struct domain *d);
-    int (*destroydomain) (struct domain *d);
-    int (*vcpuaffinity) (int cmd, struct domain *d);
-    int (*scheduler) (struct domain *d);
     int (*getdomaininfo) (struct domain *d);
-    int (*getvcpucontext) (struct domain *d);
-    int (*getvcpuinfo) (struct domain *d);
-    int (*domain_settime) (struct domain *d);
     int (*set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
     int (*sysctl) (int cmd);
-    int (*set_virq_handler) (struct domain *d, uint32_t virq);
     int (*tbufcontrol) (void);
     int (*readconsole) (uint32_t clear);
     int (*sched_id) (void);
-    int (*setdomainmaxmem) (struct domain *d);
-    int (*setdomainhandle) (struct domain *d);
-    int (*setdebugging) (struct domain *d);
     int (*perfcontrol) (void);
     int (*debug_keys) (void);
     int (*getcpuinfo) (void);
@@ -141,21 +126,13 @@ struct xsm_operations {
 
 #ifdef CONFIG_X86
     int (*shadow_control) (struct domain *d, uint32_t op);
-    int (*getpageframeinfo) (struct domain *d);
-    int (*getmemlist) (struct domain *d);
-    int (*hypercall_init) (struct domain *d);
-    int (*hvmcontext) (struct domain *d, uint32_t op);
-    int (*address_size) (struct domain *d, uint32_t op);
-    int (*machine_address_size) (struct domain *d, uint32_t op);
     int (*hvm_param) (struct domain *d, unsigned long op);
     int (*hvm_set_pci_intx_level) (struct domain *d);
     int (*hvm_set_isa_irq_level) (struct domain *d);
     int (*hvm_set_pci_link_route) (struct domain *d);
     int (*hvm_inject_msi) (struct domain *d);
-    int (*mem_event_setup) (struct domain *d);
     int (*mem_event_control) (struct domain *d, int mode, int op);
     int (*mem_event_op) (struct domain *d, int op);
-    int (*mem_sharing) (struct domain *d);
     int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
     int (*apic) (struct domain *d, int cmd);
     int (*xen_settime) (void);
@@ -180,12 +157,8 @@ struct xsm_operations {
     int (*mmuext_op) (struct domain *d, struct domain *f);
     int (*update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
-    int (*sendtrigger) (struct domain *d);
     int (*bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
     int (*unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*pin_mem_cacheattr) (struct domain *d);
-    int (*ext_vcpucontext) (struct domain *d, uint32_t cmd);
-    int (*vcpuextstate) (struct domain *d, uint32_t cmd);
     int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
     int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
 #endif
@@ -203,71 +176,16 @@ static inline void xsm_security_domaininfo (struct domain *d,
     xsm_ops->security_domaininfo(d, info);
 }
 
-static inline int xsm_setvcpucontext(struct domain *d)
-{
-    return xsm_ops->setvcpucontext(d);
-}
-
-static inline int xsm_pausedomain (struct domain *d)
-{
-    return xsm_ops->pausedomain(d);
-}
-
-static inline int xsm_unpausedomain (struct domain *d)
-{
-    return xsm_ops->unpausedomain(d);
-}
-
-static inline int xsm_resumedomain (struct domain *d)
-{
-    return xsm_ops->resumedomain(d);
-}
-
 static inline int xsm_domain_create (struct domain *d, u32 ssidref)
 {
     return xsm_ops->domain_create(d, ssidref);
 }
 
-static inline int xsm_max_vcpus(struct domain *d)
-{
-    return xsm_ops->max_vcpus(d);
-}
-
-static inline int xsm_destroydomain (struct domain *d)
-{
-    return xsm_ops->destroydomain(d);
-}
-
-static inline int xsm_vcpuaffinity (int cmd, struct domain *d)
-{
-    return xsm_ops->vcpuaffinity(cmd, d);
-}
-
-static inline int xsm_scheduler (struct domain *d)
-{
-    return xsm_ops->scheduler(d);
-}
-
 static inline int xsm_getdomaininfo (struct domain *d)
 {
     return xsm_ops->getdomaininfo(d);
 }
 
-static inline int xsm_getvcpucontext (struct domain *d)
-{
-    return xsm_ops->getvcpucontext(d);
-}
-
-static inline int xsm_getvcpuinfo (struct domain *d)
-{
-    return xsm_ops->getvcpuinfo(d);
-}
-
-static inline int xsm_domain_settime (struct domain *d)
-{
-    return xsm_ops->domain_settime(d);
-}
-
 static inline int xsm_set_target (struct domain *d, struct domain *e)
 {
     return xsm_ops->set_target(d, e);
@@ -283,11 +201,6 @@ static inline int xsm_sysctl (int cmd)
     return xsm_ops->sysctl(cmd);
 }
 
-static inline int xsm_set_virq_handler (struct domain *d, uint32_t virq)
-{
-    return xsm_ops->set_virq_handler(d, virq);
-}
-
 static inline int xsm_tbufcontrol (void)
 {
     return xsm_ops->tbufcontrol();
@@ -303,21 +216,6 @@ static inline int xsm_sched_id (void)
     return xsm_ops->sched_id();
 }
 
-static inline int xsm_setdomainmaxmem (struct domain *d)
-{
-    return xsm_ops->setdomainmaxmem(d);
-}
-
-static inline int xsm_setdomainhandle (struct domain *d)
-{
-    return xsm_ops->setdomainhandle(d);
-}
-
-static inline int xsm_setdebugging (struct domain *d)
-{
-    return xsm_ops->setdebugging(d);
-}
-
 static inline int xsm_perfcontrol (void)
 {
     return xsm_ops->perfcontrol();
@@ -635,36 +533,6 @@ static inline int xsm_shadow_control (struct domain *d, uint32_t op)
     return xsm_ops->shadow_control(d, op);
 }
 
-static inline int xsm_getpageframeinfo (struct domain *d)
-{
-    return xsm_ops->getpageframeinfo(d);
-}
-
-static inline int xsm_getmemlist (struct domain *d)
-{
-    return xsm_ops->getmemlist(d);
-}
-
-static inline int xsm_hypercall_init (struct domain *d)
-{
-    return xsm_ops->hypercall_init(d);
-}
-
-static inline int xsm_hvmcontext (struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->hvmcontext(d, cmd);
-}
-
-static inline int xsm_address_size (struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->address_size(d, cmd);
-}
-
-static inline int xsm_machine_address_size (struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->machine_address_size(d, cmd);
-}
-
 static inline int xsm_hvm_param (struct domain *d, unsigned long op)
 {
     return xsm_ops->hvm_param(d, op);
@@ -690,11 +558,6 @@ static inline int xsm_hvm_inject_msi (struct domain *d)
     return xsm_ops->hvm_inject_msi(d);
 }
 
-static inline int xsm_mem_event_setup (struct domain *d)
-{
-    return xsm_ops->mem_event_setup(d);
-}
-
 static inline int xsm_mem_event_control (struct domain *d, int mode, int op)
 {
     return xsm_ops->mem_event_control(d, mode, op);
@@ -705,11 +568,6 @@ static inline int xsm_mem_event_op (struct domain *d, int op)
     return xsm_ops->mem_event_op(d, op);
 }
 
-static inline int xsm_mem_sharing (struct domain *d)
-{
-    return xsm_ops->mem_sharing(d);
-}
-
 static inline int xsm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
 {
     return xsm_ops->mem_sharing_op(d, cd, op);
@@ -807,11 +665,6 @@ static inline int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
     return xsm_ops->add_to_physmap(d1, d2);
 }
 
-static inline int xsm_sendtrigger(struct domain *d)
-{
-    return xsm_ops->sendtrigger(d);
-}
-
 static inline int xsm_bind_pt_irq(struct domain *d, 
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
@@ -824,20 +677,6 @@ static inline int xsm_unbind_pt_irq(struct domain *d,
     return xsm_ops->unbind_pt_irq(d, bind);
 }
 
-static inline int xsm_pin_mem_cacheattr(struct domain *d)
-{
-    return xsm_ops->pin_mem_cacheattr(d);
-}
-
-static inline int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->ext_vcpucontext(d, cmd);
-}
-static inline int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->vcpuextstate(d, cmd);
-}
-
 static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return xsm_ops->ioport_permission(d, s, e, allow);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 3e6e5df..9bb86ef 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -30,29 +30,14 @@ struct xsm_operations dummy_xsm_ops;
 void xsm_fixup_ops (struct xsm_operations *ops)
 {
     set_to_dummy_if_null(ops, security_domaininfo);
-    set_to_dummy_if_null(ops, setvcpucontext);
-    set_to_dummy_if_null(ops, pausedomain);
-    set_to_dummy_if_null(ops, unpausedomain);
-    set_to_dummy_if_null(ops, resumedomain);
     set_to_dummy_if_null(ops, domain_create);
-    set_to_dummy_if_null(ops, max_vcpus);
-    set_to_dummy_if_null(ops, destroydomain);
-    set_to_dummy_if_null(ops, vcpuaffinity);
-    set_to_dummy_if_null(ops, scheduler);
     set_to_dummy_if_null(ops, getdomaininfo);
-    set_to_dummy_if_null(ops, getvcpucontext);
-    set_to_dummy_if_null(ops, getvcpuinfo);
-    set_to_dummy_if_null(ops, domain_settime);
     set_to_dummy_if_null(ops, set_target);
     set_to_dummy_if_null(ops, domctl);
     set_to_dummy_if_null(ops, sysctl);
-    set_to_dummy_if_null(ops, set_virq_handler);
     set_to_dummy_if_null(ops, tbufcontrol);
     set_to_dummy_if_null(ops, readconsole);
     set_to_dummy_if_null(ops, sched_id);
-    set_to_dummy_if_null(ops, setdomainmaxmem);
-    set_to_dummy_if_null(ops, setdomainhandle);
-    set_to_dummy_if_null(ops, setdebugging);
     set_to_dummy_if_null(ops, perfcontrol);
     set_to_dummy_if_null(ops, debug_keys);
     set_to_dummy_if_null(ops, getcpuinfo);
@@ -128,21 +113,13 @@ void xsm_fixup_ops (struct xsm_operations *ops)
 
 #ifdef CONFIG_X86
     set_to_dummy_if_null(ops, shadow_control);
-    set_to_dummy_if_null(ops, getpageframeinfo);
-    set_to_dummy_if_null(ops, getmemlist);
-    set_to_dummy_if_null(ops, hypercall_init);
-    set_to_dummy_if_null(ops, hvmcontext);
-    set_to_dummy_if_null(ops, address_size);
-    set_to_dummy_if_null(ops, machine_address_size);
     set_to_dummy_if_null(ops, hvm_param);
     set_to_dummy_if_null(ops, hvm_set_pci_intx_level);
     set_to_dummy_if_null(ops, hvm_set_isa_irq_level);
     set_to_dummy_if_null(ops, hvm_set_pci_link_route);
     set_to_dummy_if_null(ops, hvm_inject_msi);
-    set_to_dummy_if_null(ops, mem_event_setup);
     set_to_dummy_if_null(ops, mem_event_control);
     set_to_dummy_if_null(ops, mem_event_op);
-    set_to_dummy_if_null(ops, mem_sharing);
     set_to_dummy_if_null(ops, mem_sharing_op);
     set_to_dummy_if_null(ops, apic);
     set_to_dummy_if_null(ops, xen_settime);
@@ -163,12 +140,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, update_va_mapping);
     set_to_dummy_if_null(ops, add_to_physmap);
     set_to_dummy_if_null(ops, remove_from_physmap);
-    set_to_dummy_if_null(ops, sendtrigger);
     set_to_dummy_if_null(ops, bind_pt_irq);
     set_to_dummy_if_null(ops, unbind_pt_irq);
-    set_to_dummy_if_null(ops, pin_mem_cacheattr);
-    set_to_dummy_if_null(ops, ext_vcpucontext);
-    set_to_dummy_if_null(ops, vcpuextstate);
     set_to_dummy_if_null(ops, ioport_permission);
     set_to_dummy_if_null(ops, ioport_mapping);
 #endif
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index e815ea5..f0216e0 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -484,26 +484,6 @@ static void flask_security_domaininfo(struct domain *d,
     info->ssidref = domain_sid(d);
 }
 
-static int flask_setvcpucontext(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT);
-}
-
-static int flask_pausedomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
-}
-
-static int flask_unpausedomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
-}
-
-static int flask_resumedomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__RESUME);
-}
-
 static int flask_domain_create(struct domain *d, u32 ssidref)
 {
     int rc;
@@ -532,66 +512,11 @@ static int flask_domain_create(struct domain *d, u32 ssidref)
     return rc;
 }
 
-static int flask_max_vcpus(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS);
-}
-
-static int flask_destroydomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__DESTROY);
-}
-
-static int flask_vcpuaffinity(int cmd, struct domain *d)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_setvcpuaffinity:
-        perm = DOMAIN__SETVCPUAFFINITY;
-        break;
-    case XEN_DOMCTL_getvcpuaffinity:
-        perm = DOMAIN__GETVCPUAFFINITY;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm );
-}
-
-static int flask_scheduler(struct domain *d)
-{
-    int rc = 0;
-
-    rc = domain_has_xen(current->domain, XEN__SCHEDULER);
-    if ( rc )
-        return rc;
-
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SCHEDULER);
-}
-
 static int flask_getdomaininfo(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO);
 }
 
-static int flask_getvcpucontext(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT);
-}
-
-static int flask_getvcpuinfo(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO);
-}
-
-static int flask_domain_settime(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
-}
-
 static int flask_set_target(struct domain *d, struct domain *t)
 {
     int rc;
@@ -622,62 +547,121 @@ static int flask_domctl(struct domain *d, int cmd)
     {
     /* These have individual XSM hooks (common/domctl.c) */
     case XEN_DOMCTL_createdomain:
+    case XEN_DOMCTL_getdomaininfo:
+    case XEN_DOMCTL_irq_permission:
+    case XEN_DOMCTL_iomem_permission:
+    case XEN_DOMCTL_set_target:
+#ifdef CONFIG_X86
+    /* These have individual XSM hooks (arch/x86/domctl.c) */
+    case XEN_DOMCTL_shadow_op:
+    case XEN_DOMCTL_ioport_permission:
+    case XEN_DOMCTL_bind_pt_irq:
+    case XEN_DOMCTL_unbind_pt_irq:
+    case XEN_DOMCTL_memory_mapping:
+    case XEN_DOMCTL_ioport_mapping:
+    case XEN_DOMCTL_mem_event_op:
+    /* These have individual XSM hooks (drivers/passthrough/iommu.c) */
+    case XEN_DOMCTL_get_device_group:
+    case XEN_DOMCTL_test_assign_device:
+    case XEN_DOMCTL_assign_device:
+    case XEN_DOMCTL_deassign_device:
+#endif
+        return 0;
+
     case XEN_DOMCTL_destroydomain:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__DESTROY);
+
     case XEN_DOMCTL_pausedomain:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
+
     case XEN_DOMCTL_unpausedomain:
-    case XEN_DOMCTL_getdomaininfo:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
+
     case XEN_DOMCTL_setvcpuaffinity:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUAFFINITY);
+
+    case XEN_DOMCTL_getvcpuaffinity:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUAFFINITY);
+
+    case XEN_DOMCTL_resumedomain:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__RESUME);
+
+    case XEN_DOMCTL_scheduler_op:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SCHEDULER);
+
+    case XEN_DOMCTL_max_vcpus:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS);
+
     case XEN_DOMCTL_max_mem:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM);
+
+    case XEN_DOMCTL_setdomainhandle:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE);
+
     case XEN_DOMCTL_setvcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT);
+
     case XEN_DOMCTL_getvcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT);
+
     case XEN_DOMCTL_getvcpuinfo:
-    case XEN_DOMCTL_max_vcpus:
-    case XEN_DOMCTL_scheduler_op:
-    case XEN_DOMCTL_setdomainhandle:
-    case XEN_DOMCTL_setdebugging:
-    case XEN_DOMCTL_irq_permission:
-    case XEN_DOMCTL_iomem_permission:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO);
+
     case XEN_DOMCTL_settimeoffset:
-    case XEN_DOMCTL_getvcpuaffinity:
-    case XEN_DOMCTL_resumedomain:
-    case XEN_DOMCTL_set_target:
-    case XEN_DOMCTL_set_virq_handler:
-#ifdef CONFIG_X86
-    /* These have individual XSM hooks (arch/x86/domctl.c) */
-    case XEN_DOMCTL_shadow_op:
-    case XEN_DOMCTL_ioport_permission:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
+
+    case XEN_DOMCTL_setdebugging:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
+
     case XEN_DOMCTL_getpageframeinfo:
     case XEN_DOMCTL_getpageframeinfo2:
     case XEN_DOMCTL_getpageframeinfo3:
+        return current_has_perm(d, SECCLASS_MMU, MMU__PAGEINFO);
+
     case XEN_DOMCTL_getmemlist:
+        return current_has_perm(d, SECCLASS_MMU, MMU__PAGELIST);
+
     case XEN_DOMCTL_hypercall_init:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__HYPERCALL);
+
     case XEN_DOMCTL_sethvmcontext:
+        return current_has_perm(d, SECCLASS_HVM, HVM__SETHVMC);
+
     case XEN_DOMCTL_gethvmcontext:
     case XEN_DOMCTL_gethvmcontext_partial:
+        return current_has_perm(d, SECCLASS_HVM, HVM__GETHVMC);
+
     case XEN_DOMCTL_set_address_size:
-    case XEN_DOMCTL_get_address_size:
     case XEN_DOMCTL_set_machine_address_size:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETADDRSIZE);
+
+    case XEN_DOMCTL_get_address_size:
     case XEN_DOMCTL_get_machine_address_size:
-    case XEN_DOMCTL_sendtrigger:
-    case XEN_DOMCTL_bind_pt_irq:
-    case XEN_DOMCTL_unbind_pt_irq:
-    case XEN_DOMCTL_memory_mapping:
-    case XEN_DOMCTL_ioport_mapping:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETADDRSIZE);
+
+    case XEN_DOMCTL_mem_sharing_op:
+        return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
+
     case XEN_DOMCTL_pin_mem_cacheattr:
+        return current_has_perm(d, SECCLASS_HVM, HVM__CACHEATTR);
+
     case XEN_DOMCTL_set_ext_vcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETEXTVCPUCONTEXT);
+
     case XEN_DOMCTL_get_ext_vcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETEXTVCPUCONTEXT);
+
     case XEN_DOMCTL_setvcpuextstate:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUEXTSTATE);
+
     case XEN_DOMCTL_getvcpuextstate:
-    case XEN_DOMCTL_mem_event_op:
-    case XEN_DOMCTL_mem_sharing_op:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUEXTSTATE);
+
+    case XEN_DOMCTL_sendtrigger:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
+
     case XEN_DOMCTL_set_access_required:
-    /* These have individual XSM hooks (drivers/passthrough/iommu.c) */
-    case XEN_DOMCTL_get_device_group:
-    case XEN_DOMCTL_test_assign_device:
-    case XEN_DOMCTL_assign_device:
-    case XEN_DOMCTL_deassign_device:
-#endif
-        return 0;
+        return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 
     case XEN_DOMCTL_debug_op:
     case XEN_DOMCTL_gdbsx_guestmemio:
@@ -691,6 +675,9 @@ static int flask_domctl(struct domain *d, int cmd)
     case XEN_DOMCTL_suppress_spurious_page_faults:
         return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO);
 
+    case XEN_DOMCTL_set_virq_handler:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
+
     case XEN_DOMCTL_set_cpuid:
         return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID);
 
@@ -741,11 +728,6 @@ static int flask_sysctl(int cmd)
     }
 }
 
-static int flask_set_virq_handler(struct domain *d, uint32_t virq)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
-}
-
 static int flask_tbufcontrol(void)
 {
     return domain_has_xen(current->domain, XEN__TBUFCONTROL);
@@ -766,21 +748,6 @@ static int flask_sched_id(void)
     return domain_has_xen(current->domain, XEN__SCHEDULER);
 }
 
-static int flask_setdomainmaxmem(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM);
-}
-
-static int flask_setdomainhandle(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE);
-}
-
-static int flask_setdebugging(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
-}
-
 static int flask_debug_keys(void)
 {
     return domain_has_xen(current->domain, XEN__DEBUG);
@@ -1174,82 +1141,6 @@ static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end,
     return flask_ioport_permission(d, start, end, access);
 }
 
-static int flask_getpageframeinfo(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_MMU, MMU__PAGEINFO);
-}
-
-static int flask_getmemlist(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_MMU, MMU__PAGELIST);
-}
-
-static int flask_hypercall_init(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__HYPERCALL);
-}
-
-static int flask_hvmcontext(struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_sethvmcontext:
-        perm = HVM__SETHVMC;
-        break;
-    case XEN_DOMCTL_gethvmcontext:
-    case XEN_DOMCTL_gethvmcontext_partial:
-        perm = HVM__GETHVMC;
-        break;
-    case HVMOP_track_dirty_vram:
-        perm = HVM__TRACKDIRTYVRAM;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_HVM, perm);
-}
-
-static int flask_address_size(struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_set_address_size:
-        perm = DOMAIN__SETADDRSIZE;
-        break;
-    case XEN_DOMCTL_get_address_size:
-        perm = DOMAIN__GETADDRSIZE;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm);
-}
-
-static int flask_machine_address_size(struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_set_machine_address_size:
-        perm = DOMAIN__SETADDRSIZE;
-        break;
-    case XEN_DOMCTL_get_machine_address_size:
-        perm = DOMAIN__GETADDRSIZE;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
-}
-
 static int flask_hvm_param(struct domain *d, unsigned long op)
 {
     u32 perm;
@@ -1292,11 +1183,6 @@ static int flask_hvm_inject_msi(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
-static int flask_mem_event_setup(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
-}
-
 static int flask_mem_event_control(struct domain *d, int mode, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
@@ -1307,11 +1193,6 @@ static int flask_mem_event_op(struct domain *d, int op)
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
 
-static int flask_mem_sharing(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
-}
-
 static int flask_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     int rc = current_has_perm(cd, SECCLASS_HVM, HVM__MEM_SHARING);
@@ -1499,11 +1380,6 @@ static int flask_remove_from_physmap(struct domain *d1, struct domain *d2)
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP);
 }
 
-static int flask_sendtrigger(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
-}
-
 static int flask_get_device_group(uint32_t machine_bdf)
 {
     u32 rsid;
@@ -1597,78 +1473,20 @@ static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq
 {
     return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
-
-static int flask_pin_mem_cacheattr (struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__CACHEATTR);
-}
-
-static int flask_ext_vcpucontext (struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_set_ext_vcpucontext:
-        perm = DOMAIN__SETEXTVCPUCONTEXT;
-        break;
-    case XEN_DOMCTL_get_ext_vcpucontext:
-        perm = DOMAIN__GETEXTVCPUCONTEXT;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm);
-}
-
-static int flask_vcpuextstate (struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-        case XEN_DOMCTL_setvcpuextstate:
-            perm = DOMAIN__SETVCPUEXTSTATE;
-        break;
-        case XEN_DOMCTL_getvcpuextstate:
-            perm = DOMAIN__GETVCPUEXTSTATE;
-        break;
-        default:
-            return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm);
-}
 #endif
 
 long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
 
 static struct xsm_operations flask_ops = {
     .security_domaininfo = flask_security_domaininfo,
-    .setvcpucontext = flask_setvcpucontext,
-    .pausedomain = flask_pausedomain,
-    .unpausedomain = flask_unpausedomain,    
-    .resumedomain = flask_resumedomain,    
     .domain_create = flask_domain_create,
-    .max_vcpus = flask_max_vcpus,
-    .destroydomain = flask_destroydomain,
-    .vcpuaffinity = flask_vcpuaffinity,
-    .scheduler = flask_scheduler,
     .getdomaininfo = flask_getdomaininfo,
-    .getvcpucontext = flask_getvcpucontext,
-    .getvcpuinfo = flask_getvcpuinfo,
-    .domain_settime = flask_domain_settime,
     .set_target = flask_set_target,
     .domctl = flask_domctl,
     .sysctl = flask_sysctl,
-    .set_virq_handler = flask_set_virq_handler,
     .tbufcontrol = flask_tbufcontrol,
     .readconsole = flask_readconsole,
     .sched_id = flask_sched_id,
-    .setdomainmaxmem = flask_setdomainmaxmem,
-    .setdomainhandle = flask_setdomainhandle,
-    .setdebugging = flask_setdebugging,
     .perfcontrol = flask_perfcontrol,
     .debug_keys = flask_debug_keys,
     .getcpuinfo = flask_getcpuinfo,
@@ -1740,21 +1558,13 @@ static struct xsm_operations flask_ops = {
 
 #ifdef CONFIG_X86
     .shadow_control = flask_shadow_control,
-    .getpageframeinfo = flask_getpageframeinfo,
-    .getmemlist = flask_getmemlist,
-    .hypercall_init = flask_hypercall_init,
-    .hvmcontext = flask_hvmcontext,
-    .address_size = flask_address_size,
-    .machine_address_size = flask_machine_address_size,
     .hvm_param = flask_hvm_param,
     .hvm_set_pci_intx_level = flask_hvm_set_pci_intx_level,
     .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
     .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
     .hvm_inject_msi = flask_hvm_inject_msi,
-    .mem_event_setup = flask_mem_event_setup,
     .mem_event_control = flask_mem_event_control,
     .mem_event_op = flask_mem_event_op,
-    .mem_sharing = flask_mem_sharing,
     .mem_sharing_op = flask_mem_sharing_op,
     .apic = flask_apic,
     .xen_settime = flask_xen_settime,
@@ -1775,16 +1585,12 @@ static struct xsm_operations flask_ops = {
     .update_va_mapping = flask_update_va_mapping,
     .add_to_physmap = flask_add_to_physmap,
     .remove_from_physmap = flask_remove_from_physmap,
-    .sendtrigger = flask_sendtrigger,
     .get_device_group = flask_get_device_group,
     .test_assign_device = flask_test_assign_device,
     .assign_device = flask_assign_device,
     .deassign_device = flask_deassign_device,
     .bind_pt_irq = flask_bind_pt_irq,
     .unbind_pt_irq = flask_unbind_pt_irq,
-    .pin_mem_cacheattr = flask_pin_mem_cacheattr,
-    .ext_vcpucontext = flask_ext_vcpucontext,
-    .vcpuextstate = flask_vcpuextstate,
     .ioport_permission = flask_ioport_permission,
     .ioport_mapping = flask_ioport_mapping,
 #endif
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:12:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:12:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarN5-0000ts-B4; Tue, 20 Nov 2012 17:12:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TarN3-0000tE-8N
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:12:25 +0000
Received: from [85.158.143.35:33195] by server-2.bemta-4.messagelabs.com id
	F0/98-28922-8F9BBA05; Tue, 20 Nov 2012 17:12:24 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-2.tower-21.messagelabs.com!1353431541!5616716!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21963 invoked from network); 20 Nov 2012 17:12:21 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-2.tower-21.messagelabs.com with SMTP;
	20 Nov 2012 17:12:21 -0000
X-TM-IMSS-Message-ID: <0a20bda800009afc@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 0a20bda800009afc ;
	Mon, 19 Nov 2012 16:31:54 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAJLSNQD013605; 
	Mon, 19 Nov 2012 16:28:24 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Mon, 19 Nov 2012 16:28:19 -0500
Message-Id: <1353360502-27819-3-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353360502-27819-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	ian.campbell@citrix.com, JBeulich@suse.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 2/5] xen: domctl XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

A number of the domctl XSM hooks do nothing except pass the domain and
operation ID, making them redundant with the xsm_domctl hook. Remove
these redundant hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/domctl.c   |  76 +---------
 xen/common/domctl.c     |  59 +-------
 xen/include/xsm/dummy.h | 135 -----------------
 xen/include/xsm/xsm.h   | 161 ---------------------
 xen/xsm/dummy.c         |  27 ----
 xen/xsm/flask/hooks.c   | 378 ++++++++++++------------------------------------
 6 files changed, 98 insertions(+), 738 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 5e224fc..2630bdb 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -96,10 +96,6 @@ long arch_do_domctl(
 
         page = mfn_to_page(mfn);
 
-        ret = xsm_getpageframeinfo(d);
-        if ( ret )
-            break;
-
         if ( likely(get_page(page, d)) )
         {
             ret = 0;
@@ -140,10 +136,6 @@ long arch_do_domctl(
             struct page_info *page;
             xen_pfn_t *arr;
 
-            ret = xsm_getpageframeinfo(d);
-            if ( ret )
-                break;
-
             if ( unlikely(num > 1024) ||
                  unlikely(num != domctl->u.getpageframeinfo3.num) )
             {
@@ -229,10 +221,6 @@ long arch_do_domctl(
         int num = domctl->u.getpageframeinfo2.num;
         uint32_t *arr32;
 
-        ret = xsm_getpageframeinfo(d);
-        if ( ret )
-            break;
-
         if ( unlikely(num > 1024) )
         {
             ret = -E2BIG;
@@ -324,10 +312,6 @@ long arch_do_domctl(
         uint64_t mfn;
         struct page_info *page;
 
-        ret = xsm_getmemlist(d);
-        if ( ret )
-            break;
-
         if ( unlikely(d->is_dying) ) {
             ret = -EINVAL;
             break;
@@ -363,10 +347,6 @@ long arch_do_domctl(
         struct page_info *page;
         void *hypercall_page;
 
-        ret = xsm_hypercall_init(d);
-        if ( ret )
-            break;
-
         page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
 
         ret = -EACCES;
@@ -391,10 +371,6 @@ long arch_do_domctl(
     { 
         struct hvm_domain_context c = { .size = domctl->u.hvmcontext.size };
 
-        ret = xsm_hvmcontext(d, domctl->cmd);
-        if ( ret )
-            goto sethvmcontext_out;
-
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
             goto sethvmcontext_out;
@@ -421,10 +397,6 @@ long arch_do_domctl(
     { 
         struct hvm_domain_context c = { 0 };
 
-        ret = xsm_hvmcontext(d, domctl->cmd);
-        if ( ret )
-            goto gethvmcontext_out;
-
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
             goto gethvmcontext_out;
@@ -468,10 +440,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_gethvmcontext_partial:
     { 
-        ret = xsm_hvmcontext(d, domctl->cmd);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
             break;
@@ -487,10 +455,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_address_size:
     {
-        ret = xsm_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         switch ( domctl->u.address_size.size )
         {
         case 32:
@@ -508,10 +472,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_get_address_size:
     {
-        ret = xsm_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         domctl->u.address_size.size =
             is_pv_32on64_domain(d) ? 32 : BITS_PER_LONG;
 
@@ -524,10 +484,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_machine_address_size:
     {
-        ret = xsm_machine_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         ret = -EBUSY;
         if ( d->tot_pages > 0 )
             break;
@@ -540,10 +496,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_get_machine_address_size:
     {
-        ret = xsm_machine_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         domctl->u.address_size.size = d->arch.physaddr_bitsize;
 
         ret = 0;
@@ -557,10 +509,6 @@ long arch_do_domctl(
     {
         struct vcpu *v;
 
-        ret = xsm_sendtrigger(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( domctl->u.sendtrigger.vcpu >= MAX_VIRT_CPUS )
             break;
@@ -827,10 +775,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_pin_mem_cacheattr:
     {
-        ret = xsm_pin_mem_cacheattr(d);
-        if ( ret )
-            break;
-
         ret = hvm_set_mem_pinned_cacheattr(
             d, domctl->u.pin_mem_cacheattr.start,
             domctl->u.pin_mem_cacheattr.end,
@@ -846,10 +790,6 @@ long arch_do_domctl(
 
         evc = &domctl->u.ext_vcpucontext;
 
-        ret = xsm_ext_vcpucontext(d, domctl->cmd);
-        if ( ret )
-            break;
-
         ret = -ESRCH;
         if ( (evc->vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[evc->vcpu]) == NULL) )
@@ -1115,10 +1055,6 @@ long arch_do_domctl(
 
         evc = &domctl->u.vcpuextstate;
 
-        ret = xsm_vcpuextstate(d, domctl->cmd);
-        if ( ret )
-            goto vcpuextstate_out;
-
         ret = -ESRCH;
         if ( (evc->vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[evc->vcpu]) == NULL) )
@@ -1229,9 +1165,7 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_mem_sharing_op:
     {
-        ret = xsm_mem_sharing(d);
-        if ( !ret )
-            ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
+        ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
     }
     break;
 
@@ -1262,11 +1196,9 @@ long arch_do_domctl(
         if ( current->domain == d )
             break;
 
-        ret = xsm_mem_event_setup(d);
-        if ( !ret ) {
-            p2m = p2m_get_hostp2m(d);
-            p2m->access_required = domctl->u.access_required.access_required;
-        }
+        ret = 0;
+        p2m = p2m_get_hostp2m(d);
+        p2m->access_required = domctl->u.access_required.access_required;
     }
     break;
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 2a42a5f..6f792e9 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -289,10 +289,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( d == NULL )
             break;
 
-        ret = xsm_setvcpucontext(d);
-        if ( ret )
-            goto svc_out;
-
         ret = -EINVAL;
         if ( (d == current->domain) || /* no domain_pause() */
              (vcpu >= d->max_vcpus) || ((v = d->vcpu[vcpu]) == NULL) )
@@ -339,10 +335,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_pausedomain:
     {
-        ret = xsm_pausedomain(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( d != current->domain )
         {
@@ -354,10 +346,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_unpausedomain:
     {
-        ret = xsm_unpausedomain(d);
-        if ( ret )
-            break;
-
         domain_unpause_by_systemcontroller(d);
         ret = 0;
     }
@@ -365,10 +353,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_resumedomain:
     {
-        ret = xsm_resumedomain(d);
-        if ( ret )
-            break;
-
         domain_resume(d);
         ret = 0;
     }
@@ -452,10 +436,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
              (is_hvm_domain(d) && (max > MAX_HVM_VCPUS)) )
             break;
 
-        ret = xsm_max_vcpus(d);
-        if ( ret )
-            break;
-
         /* Until Xenoprof can dynamically grow its vcpu-s array... */
         if ( d->xenoprof )
         {
@@ -538,7 +518,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_destroydomain:
     {
-        ret = xsm_destroydomain(d) ? : domain_kill(d);
+        ret = domain_kill(d);
     }
     break;
 
@@ -547,10 +527,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     {
         struct vcpu *v;
 
-        ret = xsm_vcpuaffinity(op->cmd, d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( op->u.vcpuaffinity.vcpu >= d->max_vcpus )
             break;
@@ -581,10 +557,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_scheduler_op:
     {
-        ret = xsm_scheduler(d);
-        if ( ret )
-            break;
-
         ret = sched_adjust(d, &op->u.scheduler_op);
         if ( copy_to_guest(u_domctl, op, 1) )
             ret = -EFAULT;
@@ -629,10 +601,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         vcpu_guest_context_u c = { .nat = NULL };
         struct vcpu         *v;
 
-        ret = xsm_getvcpucontext(d);
-        if ( ret )
-            goto getvcpucontext_out;
-
         ret = -EINVAL;
         if ( op->u.vcpucontext.vcpu >= d->max_vcpus )
             goto getvcpucontext_out;
@@ -685,10 +653,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         struct vcpu   *v;
         struct vcpu_runstate_info runstate;
 
-        ret = xsm_getvcpuinfo(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( op->u.getvcpuinfo.vcpu >= d->max_vcpus )
             break;
@@ -715,10 +679,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     {
         unsigned long new_max;
 
-        ret = xsm_setdomainmaxmem(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         new_max = op->u.max_mem.max_memkb >> (PAGE_SHIFT-10);
 
@@ -736,10 +696,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_setdomainhandle:
     {
-        ret = xsm_setdomainhandle(d);
-        if ( ret )
-            break;
-
         memcpy(d->handle, op->u.setdomainhandle.handle,
                sizeof(xen_domain_handle_t));
         ret = 0;
@@ -752,10 +708,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( d == current->domain ) /* no domain_pause() */
             break;
 
-        ret = xsm_setdebugging(d);
-        if ( ret )
-            break;
-
         domain_pause(d);
         d->debugger_attached = !!op->u.setdebugging.enable;
         domain_unpause(d); /* causes guest to latch new status */
@@ -800,10 +752,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_settimeoffset:
     {
-        ret = xsm_domain_settime(d);
-        if ( ret )
-            break;
-
         domain_set_time_offset(d, op->u.settimeoffset.time_offset_seconds);
         ret = 0;
     }
@@ -853,10 +801,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     case XEN_DOMCTL_set_virq_handler:
     {
         uint32_t virq = op->u.set_virq_handler.virq;
-
-        ret = xsm_set_virq_handler(d, virq);
-        if ( !ret )
-            ret = set_global_virq_handler(d, virq);
+        ret = set_global_virq_handler(d, virq);
     }
     break;
 
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index fa78785..aef7c4e 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -17,71 +17,16 @@ static XSM_INLINE void xsm_security_domaininfo(struct domain *d,
     return;
 }
 
-static XSM_INLINE int xsm_setvcpucontext(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_pausedomain(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_unpausedomain(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_resumedomain(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_domain_create(struct domain *d, u32 ssidref)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_max_vcpus(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_destroydomain(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_vcpuaffinity(int cmd, struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_scheduler(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_getvcpucontext(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getvcpuinfo(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_domain_settime(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
 {
     return 0;
@@ -113,11 +58,6 @@ static XSM_INLINE int xsm_sysctl(int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_set_virq_handler(struct domain *d, uint32_t virq)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_tbufcontrol(void)
 {
     return 0;
@@ -133,21 +73,6 @@ static XSM_INLINE int xsm_sched_id(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_setdomainmaxmem(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_setdomainhandle(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_setdebugging(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_perfcontrol(void)
 {
     return 0;
@@ -505,36 +430,6 @@ static XSM_INLINE int xsm_shadow_control(struct domain *d, uint32_t op)
     return 0;
 }
 
-static XSM_INLINE int xsm_getpageframeinfo(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getmemlist(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_hypercall_init(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_hvmcontext(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_address_size(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_machine_address_size(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
@@ -570,11 +465,6 @@ static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_event_setup(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_mem_event_control(struct domain *d, int mode, int op)
 {
     if ( !IS_PRIV(current->domain) )
@@ -589,11 +479,6 @@ static XSM_INLINE int xsm_mem_event_op(struct domain *d, int op)
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_sharing(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, cd) )
@@ -720,11 +605,6 @@ static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *
     return 0;
 }
 
-static XSM_INLINE int xsm_sendtrigger(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
@@ -735,21 +615,6 @@ static XSM_INLINE int xsm_unbind_pt_irq(struct domain *d, struct xen_domctl_bind
     return 0;
 }
 
-static XSM_INLINE int xsm_pin_mem_cacheattr(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index b2f33d6..903c7cb 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -41,29 +41,14 @@ extern xsm_initcall_t __xsm_initcall_start[], __xsm_initcall_end[];
 struct xsm_operations {
     void (*security_domaininfo) (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info);
-    int (*setvcpucontext) (struct domain *d);
-    int (*pausedomain) (struct domain *d);
-    int (*unpausedomain) (struct domain *d);
-    int (*resumedomain) (struct domain *d);
     int (*domain_create) (struct domain *d, u32 ssidref);
-    int (*max_vcpus) (struct domain *d);
-    int (*destroydomain) (struct domain *d);
-    int (*vcpuaffinity) (int cmd, struct domain *d);
-    int (*scheduler) (struct domain *d);
     int (*getdomaininfo) (struct domain *d);
-    int (*getvcpucontext) (struct domain *d);
-    int (*getvcpuinfo) (struct domain *d);
-    int (*domain_settime) (struct domain *d);
     int (*set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
     int (*sysctl) (int cmd);
-    int (*set_virq_handler) (struct domain *d, uint32_t virq);
     int (*tbufcontrol) (void);
     int (*readconsole) (uint32_t clear);
     int (*sched_id) (void);
-    int (*setdomainmaxmem) (struct domain *d);
-    int (*setdomainhandle) (struct domain *d);
-    int (*setdebugging) (struct domain *d);
     int (*perfcontrol) (void);
     int (*debug_keys) (void);
     int (*getcpuinfo) (void);
@@ -141,21 +126,13 @@ struct xsm_operations {
 
 #ifdef CONFIG_X86
     int (*shadow_control) (struct domain *d, uint32_t op);
-    int (*getpageframeinfo) (struct domain *d);
-    int (*getmemlist) (struct domain *d);
-    int (*hypercall_init) (struct domain *d);
-    int (*hvmcontext) (struct domain *d, uint32_t op);
-    int (*address_size) (struct domain *d, uint32_t op);
-    int (*machine_address_size) (struct domain *d, uint32_t op);
     int (*hvm_param) (struct domain *d, unsigned long op);
     int (*hvm_set_pci_intx_level) (struct domain *d);
     int (*hvm_set_isa_irq_level) (struct domain *d);
     int (*hvm_set_pci_link_route) (struct domain *d);
     int (*hvm_inject_msi) (struct domain *d);
-    int (*mem_event_setup) (struct domain *d);
     int (*mem_event_control) (struct domain *d, int mode, int op);
     int (*mem_event_op) (struct domain *d, int op);
-    int (*mem_sharing) (struct domain *d);
     int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
     int (*apic) (struct domain *d, int cmd);
     int (*xen_settime) (void);
@@ -180,12 +157,8 @@ struct xsm_operations {
     int (*mmuext_op) (struct domain *d, struct domain *f);
     int (*update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
-    int (*sendtrigger) (struct domain *d);
     int (*bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
     int (*unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*pin_mem_cacheattr) (struct domain *d);
-    int (*ext_vcpucontext) (struct domain *d, uint32_t cmd);
-    int (*vcpuextstate) (struct domain *d, uint32_t cmd);
     int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
     int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
 #endif
@@ -203,71 +176,16 @@ static inline void xsm_security_domaininfo (struct domain *d,
     xsm_ops->security_domaininfo(d, info);
 }
 
-static inline int xsm_setvcpucontext(struct domain *d)
-{
-    return xsm_ops->setvcpucontext(d);
-}
-
-static inline int xsm_pausedomain (struct domain *d)
-{
-    return xsm_ops->pausedomain(d);
-}
-
-static inline int xsm_unpausedomain (struct domain *d)
-{
-    return xsm_ops->unpausedomain(d);
-}
-
-static inline int xsm_resumedomain (struct domain *d)
-{
-    return xsm_ops->resumedomain(d);
-}
-
 static inline int xsm_domain_create (struct domain *d, u32 ssidref)
 {
     return xsm_ops->domain_create(d, ssidref);
 }
 
-static inline int xsm_max_vcpus(struct domain *d)
-{
-    return xsm_ops->max_vcpus(d);
-}
-
-static inline int xsm_destroydomain (struct domain *d)
-{
-    return xsm_ops->destroydomain(d);
-}
-
-static inline int xsm_vcpuaffinity (int cmd, struct domain *d)
-{
-    return xsm_ops->vcpuaffinity(cmd, d);
-}
-
-static inline int xsm_scheduler (struct domain *d)
-{
-    return xsm_ops->scheduler(d);
-}
-
 static inline int xsm_getdomaininfo (struct domain *d)
 {
     return xsm_ops->getdomaininfo(d);
 }
 
-static inline int xsm_getvcpucontext (struct domain *d)
-{
-    return xsm_ops->getvcpucontext(d);
-}
-
-static inline int xsm_getvcpuinfo (struct domain *d)
-{
-    return xsm_ops->getvcpuinfo(d);
-}
-
-static inline int xsm_domain_settime (struct domain *d)
-{
-    return xsm_ops->domain_settime(d);
-}
-
 static inline int xsm_set_target (struct domain *d, struct domain *e)
 {
     return xsm_ops->set_target(d, e);
@@ -283,11 +201,6 @@ static inline int xsm_sysctl (int cmd)
     return xsm_ops->sysctl(cmd);
 }
 
-static inline int xsm_set_virq_handler (struct domain *d, uint32_t virq)
-{
-    return xsm_ops->set_virq_handler(d, virq);
-}
-
 static inline int xsm_tbufcontrol (void)
 {
     return xsm_ops->tbufcontrol();
@@ -303,21 +216,6 @@ static inline int xsm_sched_id (void)
     return xsm_ops->sched_id();
 }
 
-static inline int xsm_setdomainmaxmem (struct domain *d)
-{
-    return xsm_ops->setdomainmaxmem(d);
-}
-
-static inline int xsm_setdomainhandle (struct domain *d)
-{
-    return xsm_ops->setdomainhandle(d);
-}
-
-static inline int xsm_setdebugging (struct domain *d)
-{
-    return xsm_ops->setdebugging(d);
-}
-
 static inline int xsm_perfcontrol (void)
 {
     return xsm_ops->perfcontrol();
@@ -635,36 +533,6 @@ static inline int xsm_shadow_control (struct domain *d, uint32_t op)
     return xsm_ops->shadow_control(d, op);
 }
 
-static inline int xsm_getpageframeinfo (struct domain *d)
-{
-    return xsm_ops->getpageframeinfo(d);
-}
-
-static inline int xsm_getmemlist (struct domain *d)
-{
-    return xsm_ops->getmemlist(d);
-}
-
-static inline int xsm_hypercall_init (struct domain *d)
-{
-    return xsm_ops->hypercall_init(d);
-}
-
-static inline int xsm_hvmcontext (struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->hvmcontext(d, cmd);
-}
-
-static inline int xsm_address_size (struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->address_size(d, cmd);
-}
-
-static inline int xsm_machine_address_size (struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->machine_address_size(d, cmd);
-}
-
 static inline int xsm_hvm_param (struct domain *d, unsigned long op)
 {
     return xsm_ops->hvm_param(d, op);
@@ -690,11 +558,6 @@ static inline int xsm_hvm_inject_msi (struct domain *d)
     return xsm_ops->hvm_inject_msi(d);
 }
 
-static inline int xsm_mem_event_setup (struct domain *d)
-{
-    return xsm_ops->mem_event_setup(d);
-}
-
 static inline int xsm_mem_event_control (struct domain *d, int mode, int op)
 {
     return xsm_ops->mem_event_control(d, mode, op);
@@ -705,11 +568,6 @@ static inline int xsm_mem_event_op (struct domain *d, int op)
     return xsm_ops->mem_event_op(d, op);
 }
 
-static inline int xsm_mem_sharing (struct domain *d)
-{
-    return xsm_ops->mem_sharing(d);
-}
-
 static inline int xsm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
 {
     return xsm_ops->mem_sharing_op(d, cd, op);
@@ -807,11 +665,6 @@ static inline int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
     return xsm_ops->add_to_physmap(d1, d2);
 }
 
-static inline int xsm_sendtrigger(struct domain *d)
-{
-    return xsm_ops->sendtrigger(d);
-}
-
 static inline int xsm_bind_pt_irq(struct domain *d, 
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
@@ -824,20 +677,6 @@ static inline int xsm_unbind_pt_irq(struct domain *d,
     return xsm_ops->unbind_pt_irq(d, bind);
 }
 
-static inline int xsm_pin_mem_cacheattr(struct domain *d)
-{
-    return xsm_ops->pin_mem_cacheattr(d);
-}
-
-static inline int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->ext_vcpucontext(d, cmd);
-}
-static inline int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->vcpuextstate(d, cmd);
-}
-
 static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return xsm_ops->ioport_permission(d, s, e, allow);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 3e6e5df..9bb86ef 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -30,29 +30,14 @@ struct xsm_operations dummy_xsm_ops;
 void xsm_fixup_ops (struct xsm_operations *ops)
 {
     set_to_dummy_if_null(ops, security_domaininfo);
-    set_to_dummy_if_null(ops, setvcpucontext);
-    set_to_dummy_if_null(ops, pausedomain);
-    set_to_dummy_if_null(ops, unpausedomain);
-    set_to_dummy_if_null(ops, resumedomain);
     set_to_dummy_if_null(ops, domain_create);
-    set_to_dummy_if_null(ops, max_vcpus);
-    set_to_dummy_if_null(ops, destroydomain);
-    set_to_dummy_if_null(ops, vcpuaffinity);
-    set_to_dummy_if_null(ops, scheduler);
     set_to_dummy_if_null(ops, getdomaininfo);
-    set_to_dummy_if_null(ops, getvcpucontext);
-    set_to_dummy_if_null(ops, getvcpuinfo);
-    set_to_dummy_if_null(ops, domain_settime);
     set_to_dummy_if_null(ops, set_target);
     set_to_dummy_if_null(ops, domctl);
     set_to_dummy_if_null(ops, sysctl);
-    set_to_dummy_if_null(ops, set_virq_handler);
     set_to_dummy_if_null(ops, tbufcontrol);
     set_to_dummy_if_null(ops, readconsole);
     set_to_dummy_if_null(ops, sched_id);
-    set_to_dummy_if_null(ops, setdomainmaxmem);
-    set_to_dummy_if_null(ops, setdomainhandle);
-    set_to_dummy_if_null(ops, setdebugging);
     set_to_dummy_if_null(ops, perfcontrol);
     set_to_dummy_if_null(ops, debug_keys);
     set_to_dummy_if_null(ops, getcpuinfo);
@@ -128,21 +113,13 @@ void xsm_fixup_ops (struct xsm_operations *ops)
 
 #ifdef CONFIG_X86
     set_to_dummy_if_null(ops, shadow_control);
-    set_to_dummy_if_null(ops, getpageframeinfo);
-    set_to_dummy_if_null(ops, getmemlist);
-    set_to_dummy_if_null(ops, hypercall_init);
-    set_to_dummy_if_null(ops, hvmcontext);
-    set_to_dummy_if_null(ops, address_size);
-    set_to_dummy_if_null(ops, machine_address_size);
     set_to_dummy_if_null(ops, hvm_param);
     set_to_dummy_if_null(ops, hvm_set_pci_intx_level);
     set_to_dummy_if_null(ops, hvm_set_isa_irq_level);
     set_to_dummy_if_null(ops, hvm_set_pci_link_route);
     set_to_dummy_if_null(ops, hvm_inject_msi);
-    set_to_dummy_if_null(ops, mem_event_setup);
     set_to_dummy_if_null(ops, mem_event_control);
     set_to_dummy_if_null(ops, mem_event_op);
-    set_to_dummy_if_null(ops, mem_sharing);
     set_to_dummy_if_null(ops, mem_sharing_op);
     set_to_dummy_if_null(ops, apic);
     set_to_dummy_if_null(ops, xen_settime);
@@ -163,12 +140,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, update_va_mapping);
     set_to_dummy_if_null(ops, add_to_physmap);
     set_to_dummy_if_null(ops, remove_from_physmap);
-    set_to_dummy_if_null(ops, sendtrigger);
     set_to_dummy_if_null(ops, bind_pt_irq);
     set_to_dummy_if_null(ops, unbind_pt_irq);
-    set_to_dummy_if_null(ops, pin_mem_cacheattr);
-    set_to_dummy_if_null(ops, ext_vcpucontext);
-    set_to_dummy_if_null(ops, vcpuextstate);
     set_to_dummy_if_null(ops, ioport_permission);
     set_to_dummy_if_null(ops, ioport_mapping);
 #endif
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index e815ea5..f0216e0 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -484,26 +484,6 @@ static void flask_security_domaininfo(struct domain *d,
     info->ssidref = domain_sid(d);
 }
 
-static int flask_setvcpucontext(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT);
-}
-
-static int flask_pausedomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
-}
-
-static int flask_unpausedomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
-}
-
-static int flask_resumedomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__RESUME);
-}
-
 static int flask_domain_create(struct domain *d, u32 ssidref)
 {
     int rc;
@@ -532,66 +512,11 @@ static int flask_domain_create(struct domain *d, u32 ssidref)
     return rc;
 }
 
-static int flask_max_vcpus(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS);
-}
-
-static int flask_destroydomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__DESTROY);
-}
-
-static int flask_vcpuaffinity(int cmd, struct domain *d)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_setvcpuaffinity:
-        perm = DOMAIN__SETVCPUAFFINITY;
-        break;
-    case XEN_DOMCTL_getvcpuaffinity:
-        perm = DOMAIN__GETVCPUAFFINITY;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm );
-}
-
-static int flask_scheduler(struct domain *d)
-{
-    int rc = 0;
-
-    rc = domain_has_xen(current->domain, XEN__SCHEDULER);
-    if ( rc )
-        return rc;
-
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SCHEDULER);
-}
-
 static int flask_getdomaininfo(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO);
 }
 
-static int flask_getvcpucontext(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT);
-}
-
-static int flask_getvcpuinfo(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO);
-}
-
-static int flask_domain_settime(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
-}
-
 static int flask_set_target(struct domain *d, struct domain *t)
 {
     int rc;
@@ -622,62 +547,121 @@ static int flask_domctl(struct domain *d, int cmd)
     {
     /* These have individual XSM hooks (common/domctl.c) */
     case XEN_DOMCTL_createdomain:
+    case XEN_DOMCTL_getdomaininfo:
+    case XEN_DOMCTL_irq_permission:
+    case XEN_DOMCTL_iomem_permission:
+    case XEN_DOMCTL_set_target:
+#ifdef CONFIG_X86
+    /* These have individual XSM hooks (arch/x86/domctl.c) */
+    case XEN_DOMCTL_shadow_op:
+    case XEN_DOMCTL_ioport_permission:
+    case XEN_DOMCTL_bind_pt_irq:
+    case XEN_DOMCTL_unbind_pt_irq:
+    case XEN_DOMCTL_memory_mapping:
+    case XEN_DOMCTL_ioport_mapping:
+    case XEN_DOMCTL_mem_event_op:
+    /* These have individual XSM hooks (drivers/passthrough/iommu.c) */
+    case XEN_DOMCTL_get_device_group:
+    case XEN_DOMCTL_test_assign_device:
+    case XEN_DOMCTL_assign_device:
+    case XEN_DOMCTL_deassign_device:
+#endif
+        return 0;
+
     case XEN_DOMCTL_destroydomain:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__DESTROY);
+
     case XEN_DOMCTL_pausedomain:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
+
     case XEN_DOMCTL_unpausedomain:
-    case XEN_DOMCTL_getdomaininfo:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
+
     case XEN_DOMCTL_setvcpuaffinity:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUAFFINITY);
+
+    case XEN_DOMCTL_getvcpuaffinity:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUAFFINITY);
+
+    case XEN_DOMCTL_resumedomain:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__RESUME);
+
+    case XEN_DOMCTL_scheduler_op:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SCHEDULER);
+
+    case XEN_DOMCTL_max_vcpus:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS);
+
     case XEN_DOMCTL_max_mem:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM);
+
+    case XEN_DOMCTL_setdomainhandle:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE);
+
     case XEN_DOMCTL_setvcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT);
+
     case XEN_DOMCTL_getvcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT);
+
     case XEN_DOMCTL_getvcpuinfo:
-    case XEN_DOMCTL_max_vcpus:
-    case XEN_DOMCTL_scheduler_op:
-    case XEN_DOMCTL_setdomainhandle:
-    case XEN_DOMCTL_setdebugging:
-    case XEN_DOMCTL_irq_permission:
-    case XEN_DOMCTL_iomem_permission:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO);
+
     case XEN_DOMCTL_settimeoffset:
-    case XEN_DOMCTL_getvcpuaffinity:
-    case XEN_DOMCTL_resumedomain:
-    case XEN_DOMCTL_set_target:
-    case XEN_DOMCTL_set_virq_handler:
-#ifdef CONFIG_X86
-    /* These have individual XSM hooks (arch/x86/domctl.c) */
-    case XEN_DOMCTL_shadow_op:
-    case XEN_DOMCTL_ioport_permission:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
+
+    case XEN_DOMCTL_setdebugging:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
+
     case XEN_DOMCTL_getpageframeinfo:
     case XEN_DOMCTL_getpageframeinfo2:
     case XEN_DOMCTL_getpageframeinfo3:
+        return current_has_perm(d, SECCLASS_MMU, MMU__PAGEINFO);
+
     case XEN_DOMCTL_getmemlist:
+        return current_has_perm(d, SECCLASS_MMU, MMU__PAGELIST);
+
     case XEN_DOMCTL_hypercall_init:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__HYPERCALL);
+
     case XEN_DOMCTL_sethvmcontext:
+        return current_has_perm(d, SECCLASS_HVM, HVM__SETHVMC);
+
     case XEN_DOMCTL_gethvmcontext:
     case XEN_DOMCTL_gethvmcontext_partial:
+        return current_has_perm(d, SECCLASS_HVM, HVM__GETHVMC);
+
     case XEN_DOMCTL_set_address_size:
-    case XEN_DOMCTL_get_address_size:
     case XEN_DOMCTL_set_machine_address_size:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETADDRSIZE);
+
+    case XEN_DOMCTL_get_address_size:
     case XEN_DOMCTL_get_machine_address_size:
-    case XEN_DOMCTL_sendtrigger:
-    case XEN_DOMCTL_bind_pt_irq:
-    case XEN_DOMCTL_unbind_pt_irq:
-    case XEN_DOMCTL_memory_mapping:
-    case XEN_DOMCTL_ioport_mapping:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETADDRSIZE);
+
+    case XEN_DOMCTL_mem_sharing_op:
+        return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
+
     case XEN_DOMCTL_pin_mem_cacheattr:
+        return current_has_perm(d, SECCLASS_HVM, HVM__CACHEATTR);
+
     case XEN_DOMCTL_set_ext_vcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETEXTVCPUCONTEXT);
+
     case XEN_DOMCTL_get_ext_vcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETEXTVCPUCONTEXT);
+
     case XEN_DOMCTL_setvcpuextstate:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUEXTSTATE);
+
     case XEN_DOMCTL_getvcpuextstate:
-    case XEN_DOMCTL_mem_event_op:
-    case XEN_DOMCTL_mem_sharing_op:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUEXTSTATE);
+
+    case XEN_DOMCTL_sendtrigger:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
+
     case XEN_DOMCTL_set_access_required:
-    /* These have individual XSM hooks (drivers/passthrough/iommu.c) */
-    case XEN_DOMCTL_get_device_group:
-    case XEN_DOMCTL_test_assign_device:
-    case XEN_DOMCTL_assign_device:
-    case XEN_DOMCTL_deassign_device:
-#endif
-        return 0;
+        return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 
     case XEN_DOMCTL_debug_op:
     case XEN_DOMCTL_gdbsx_guestmemio:
@@ -691,6 +675,9 @@ static int flask_domctl(struct domain *d, int cmd)
     case XEN_DOMCTL_suppress_spurious_page_faults:
         return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO);
 
+    case XEN_DOMCTL_set_virq_handler:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
+
     case XEN_DOMCTL_set_cpuid:
         return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID);
 
@@ -741,11 +728,6 @@ static int flask_sysctl(int cmd)
     }
 }
 
-static int flask_set_virq_handler(struct domain *d, uint32_t virq)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
-}
-
 static int flask_tbufcontrol(void)
 {
     return domain_has_xen(current->domain, XEN__TBUFCONTROL);
@@ -766,21 +748,6 @@ static int flask_sched_id(void)
     return domain_has_xen(current->domain, XEN__SCHEDULER);
 }
 
-static int flask_setdomainmaxmem(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM);
-}
-
-static int flask_setdomainhandle(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE);
-}
-
-static int flask_setdebugging(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
-}
-
 static int flask_debug_keys(void)
 {
     return domain_has_xen(current->domain, XEN__DEBUG);
@@ -1174,82 +1141,6 @@ static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end,
     return flask_ioport_permission(d, start, end, access);
 }
 
-static int flask_getpageframeinfo(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_MMU, MMU__PAGEINFO);
-}
-
-static int flask_getmemlist(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_MMU, MMU__PAGELIST);
-}
-
-static int flask_hypercall_init(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__HYPERCALL);
-}
-
-static int flask_hvmcontext(struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_sethvmcontext:
-        perm = HVM__SETHVMC;
-        break;
-    case XEN_DOMCTL_gethvmcontext:
-    case XEN_DOMCTL_gethvmcontext_partial:
-        perm = HVM__GETHVMC;
-        break;
-    case HVMOP_track_dirty_vram:
-        perm = HVM__TRACKDIRTYVRAM;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_HVM, perm);
-}
-
-static int flask_address_size(struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_set_address_size:
-        perm = DOMAIN__SETADDRSIZE;
-        break;
-    case XEN_DOMCTL_get_address_size:
-        perm = DOMAIN__GETADDRSIZE;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm);
-}
-
-static int flask_machine_address_size(struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_set_machine_address_size:
-        perm = DOMAIN__SETADDRSIZE;
-        break;
-    case XEN_DOMCTL_get_machine_address_size:
-        perm = DOMAIN__GETADDRSIZE;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
-}
-
 static int flask_hvm_param(struct domain *d, unsigned long op)
 {
     u32 perm;
@@ -1292,11 +1183,6 @@ static int flask_hvm_inject_msi(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
-static int flask_mem_event_setup(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
-}
-
 static int flask_mem_event_control(struct domain *d, int mode, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
@@ -1307,11 +1193,6 @@ static int flask_mem_event_op(struct domain *d, int op)
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
 
-static int flask_mem_sharing(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
-}
-
 static int flask_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     int rc = current_has_perm(cd, SECCLASS_HVM, HVM__MEM_SHARING);
@@ -1499,11 +1380,6 @@ static int flask_remove_from_physmap(struct domain *d1, struct domain *d2)
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP);
 }
 
-static int flask_sendtrigger(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
-}
-
 static int flask_get_device_group(uint32_t machine_bdf)
 {
     u32 rsid;
@@ -1597,78 +1473,20 @@ static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq
 {
     return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
-
-static int flask_pin_mem_cacheattr (struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__CACHEATTR);
-}
-
-static int flask_ext_vcpucontext (struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_set_ext_vcpucontext:
-        perm = DOMAIN__SETEXTVCPUCONTEXT;
-        break;
-    case XEN_DOMCTL_get_ext_vcpucontext:
-        perm = DOMAIN__GETEXTVCPUCONTEXT;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm);
-}
-
-static int flask_vcpuextstate (struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-        case XEN_DOMCTL_setvcpuextstate:
-            perm = DOMAIN__SETVCPUEXTSTATE;
-        break;
-        case XEN_DOMCTL_getvcpuextstate:
-            perm = DOMAIN__GETVCPUEXTSTATE;
-        break;
-        default:
-            return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm);
-}
 #endif
 
 long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
 
 static struct xsm_operations flask_ops = {
     .security_domaininfo = flask_security_domaininfo,
-    .setvcpucontext = flask_setvcpucontext,
-    .pausedomain = flask_pausedomain,
-    .unpausedomain = flask_unpausedomain,    
-    .resumedomain = flask_resumedomain,    
     .domain_create = flask_domain_create,
-    .max_vcpus = flask_max_vcpus,
-    .destroydomain = flask_destroydomain,
-    .vcpuaffinity = flask_vcpuaffinity,
-    .scheduler = flask_scheduler,
     .getdomaininfo = flask_getdomaininfo,
-    .getvcpucontext = flask_getvcpucontext,
-    .getvcpuinfo = flask_getvcpuinfo,
-    .domain_settime = flask_domain_settime,
     .set_target = flask_set_target,
     .domctl = flask_domctl,
     .sysctl = flask_sysctl,
-    .set_virq_handler = flask_set_virq_handler,
     .tbufcontrol = flask_tbufcontrol,
     .readconsole = flask_readconsole,
     .sched_id = flask_sched_id,
-    .setdomainmaxmem = flask_setdomainmaxmem,
-    .setdomainhandle = flask_setdomainhandle,
-    .setdebugging = flask_setdebugging,
     .perfcontrol = flask_perfcontrol,
     .debug_keys = flask_debug_keys,
     .getcpuinfo = flask_getcpuinfo,
@@ -1740,21 +1558,13 @@ static struct xsm_operations flask_ops = {
 
 #ifdef CONFIG_X86
     .shadow_control = flask_shadow_control,
-    .getpageframeinfo = flask_getpageframeinfo,
-    .getmemlist = flask_getmemlist,
-    .hypercall_init = flask_hypercall_init,
-    .hvmcontext = flask_hvmcontext,
-    .address_size = flask_address_size,
-    .machine_address_size = flask_machine_address_size,
     .hvm_param = flask_hvm_param,
     .hvm_set_pci_intx_level = flask_hvm_set_pci_intx_level,
     .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
     .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
     .hvm_inject_msi = flask_hvm_inject_msi,
-    .mem_event_setup = flask_mem_event_setup,
     .mem_event_control = flask_mem_event_control,
     .mem_event_op = flask_mem_event_op,
-    .mem_sharing = flask_mem_sharing,
     .mem_sharing_op = flask_mem_sharing_op,
     .apic = flask_apic,
     .xen_settime = flask_xen_settime,
@@ -1775,16 +1585,12 @@ static struct xsm_operations flask_ops = {
     .update_va_mapping = flask_update_va_mapping,
     .add_to_physmap = flask_add_to_physmap,
     .remove_from_physmap = flask_remove_from_physmap,
-    .sendtrigger = flask_sendtrigger,
     .get_device_group = flask_get_device_group,
     .test_assign_device = flask_test_assign_device,
     .assign_device = flask_assign_device,
     .deassign_device = flask_deassign_device,
     .bind_pt_irq = flask_bind_pt_irq,
     .unbind_pt_irq = flask_unbind_pt_irq,
-    .pin_mem_cacheattr = flask_pin_mem_cacheattr,
-    .ext_vcpucontext = flask_ext_vcpucontext,
-    .vcpuextstate = flask_vcpuextstate,
     .ioport_permission = flask_ioport_permission,
     .ioport_mapping = flask_ioport_mapping,
 #endif
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:18:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:18:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarSr-0001J6-Dc; Tue, 20 Nov 2012 17:18:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TarSq-0001J1-E5
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 17:18:24 +0000
Received: from [85.158.137.99:56502] by server-14.bemta-3.messagelabs.com id
	9B/D5-12788-F5BBBA05; Tue, 20 Nov 2012 17:18:23 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1353431902!15160605!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6563 invoked from network); 20 Nov 2012 17:18:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:18:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="15911160"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:18:22 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 17:18:22 +0000
Message-ID: <1353431901.13542.86.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Date: Tue, 20 Nov 2012 17:18:21 +0000
In-Reply-To: <1353403220.18229.158.camel@zakaz.uk.xensource.com>
References: <osstest-14426-mainreport@xen.org>
	<1353403220.18229.158.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [xen-unstable test] 14426: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 09:20 +0000, Ian Campbell wrote:
> 
> 8<----------------------------------
> 
> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk>
> # Date 1353402857 0
> # Node ID 4c3b6252b129152bd9497ec77aed4779c04a522b
> # Parent  ae6fb202b233af815466055d9f1a635802a50855
> xend: reinstate XendOptionsFile.get_external_migration_tool
> 
> This was removed by 26167:31dcc0e08754 "xend: Remove old vtpm support
> from xm" but at least one caller was left. Reinstate with
> s/TPM/device/ since it appears that this functionality could apply
> elsewhere.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Ian J acked this offline so I have applied.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:18:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:18:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarSr-0001J6-Dc; Tue, 20 Nov 2012 17:18:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TarSq-0001J1-E5
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 17:18:24 +0000
Received: from [85.158.137.99:56502] by server-14.bemta-3.messagelabs.com id
	9B/D5-12788-F5BBBA05; Tue, 20 Nov 2012 17:18:23 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1353431902!15160605!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6563 invoked from network); 20 Nov 2012 17:18:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:18:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="15911160"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:18:22 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 17:18:22 +0000
Message-ID: <1353431901.13542.86.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Date: Tue, 20 Nov 2012 17:18:21 +0000
In-Reply-To: <1353403220.18229.158.camel@zakaz.uk.xensource.com>
References: <osstest-14426-mainreport@xen.org>
	<1353403220.18229.158.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [xen-unstable test] 14426: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 09:20 +0000, Ian Campbell wrote:
> 
> 8<----------------------------------
> 
> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk>
> # Date 1353402857 0
> # Node ID 4c3b6252b129152bd9497ec77aed4779c04a522b
> # Parent  ae6fb202b233af815466055d9f1a635802a50855
> xend: reinstate XendOptionsFile.get_external_migration_tool
> 
> This was removed by 26167:31dcc0e08754 "xend: Remove old vtpm support
> from xm" but at least one caller was left. Reinstate with
> s/TPM/device/ since it appears that this functionality could apply
> elsewhere.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Ian J acked this offline so I have applied.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarXh-0001XI-5y; Tue, 20 Nov 2012 17:23:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TarXf-0001XC-IM
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 17:23:23 +0000
Received: from [85.158.139.211:48458] by server-10.bemta-5.messagelabs.com id
	1A/66-09257-A8CBBA05; Tue, 20 Nov 2012 17:23:22 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353432200!20948203!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29091 invoked from network); 20 Nov 2012 17:23:22 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078847"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:20 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:19 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[0.0.0.0])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TarXb-0008Bc-Dn;
	Tue, 20 Nov 2012 17:23:19 +0000
Message-ID: <50ABBC86.6040701@eu.citrix.com>
Date: Tue, 20 Nov 2012 17:23:18 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "Liu, Jinsong" <jinsong.liu@intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
	<1353344256.18229.129.camel@zakaz.uk.xensource.com>
	<50AB9CFE.7000003@eu.citrix.com>
	<DE8DF0795D48FD4CA783C40EC8292335393633@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC8292335393633@SHSMSX101.ccr.corp.intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 20/11/12 17:08, Liu, Jinsong wrote:
>> On the other hand, the whole situation is hopefully rare enough that
>> maybe we can just do the simple correct thing, even if it's a tiny bit
>> sub-optimal.  In that case, assuming that spurious vMCEs aren't a
>> problem (e.g., #1), I think we basically just need to see if the last
>> iteration contains a broken page, and if so, send the guest a vMCE on
>> resume.
>>
>> Thoughts?
>
> Yes, that's exactly V3 patch did.

Right -- but you did it by adding an extra couple of loops, which made 
us wonder if there was a more efficient way to do the same thing.  Now 
that we know *what* needs to be done, we're in a better position to 
think about other options.  Let me take a look...

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarXh-0001XI-5y; Tue, 20 Nov 2012 17:23:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TarXf-0001XC-IM
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 17:23:23 +0000
Received: from [85.158.139.211:48458] by server-10.bemta-5.messagelabs.com id
	1A/66-09257-A8CBBA05; Tue, 20 Nov 2012 17:23:22 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353432200!20948203!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29091 invoked from network); 20 Nov 2012 17:23:22 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078847"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:20 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:19 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[0.0.0.0])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TarXb-0008Bc-Dn;
	Tue, 20 Nov 2012 17:23:19 +0000
Message-ID: <50ABBC86.6040701@eu.citrix.com>
Date: Tue, 20 Nov 2012 17:23:18 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "Liu, Jinsong" <jinsong.liu@intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
	<1353344256.18229.129.camel@zakaz.uk.xensource.com>
	<50AB9CFE.7000003@eu.citrix.com>
	<DE8DF0795D48FD4CA783C40EC8292335393633@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC8292335393633@SHSMSX101.ccr.corp.intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 20/11/12 17:08, Liu, Jinsong wrote:
>> On the other hand, the whole situation is hopefully rare enough that
>> maybe we can just do the simple correct thing, even if it's a tiny bit
>> sub-optimal.  In that case, assuming that spurious vMCEs aren't a
>> problem (e.g., #1), I think we basically just need to see if the last
>> iteration contains a broken page, and if so, send the guest a vMCE on
>> resume.
>>
>> Thoughts?
>
> Yes, that's exactly V3 patch did.

Right -- but you did it by adding an extra couple of loops, which made 
us wonder if there was a more efficient way to do the same thing.  Now 
that we know *what* needs to be done, we're in a better position to 
think about other options.  Let me take a look...

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarY1-0001cs-QE; Tue, 20 Nov 2012 17:23:45 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXy-0001Z9-LQ; Tue, 20 Nov 2012 17:23:42 +0000
Received: from [85.158.143.99:56857] by server-2.bemta-4.messagelabs.com id
	DA/24-28922-E9CBBA05; Tue, 20 Nov 2012 17:23:42 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1353432218!25420593!3
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24508 invoked from network); 20 Nov 2012 17:23:41 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078859"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-JM;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 601dc257a740d3a6047667731007283a4dcb9600
Message-ID: <601dc257a740d3a60476.1353432201@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:21 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 01 of 15] libxl: move definition of
 libxl_domain_config into the IDL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432136 0
# Node ID 601dc257a740d3a6047667731007283a4dcb9600
# Parent  c893596e2d4c7ddd62a3704ea5460be4e5be38df
libxl: move definition of libxl_domain_config into the IDL

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Posted during 4.2 freeze and deferred until 4.3...

diff -r c893596e2d4c -r 601dc257a740 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Tue Nov 20 17:22:10 2012 +0000
+++ b/tools/libxl/libxl.h	Tue Nov 20 17:22:16 2012 +0000
@@ -474,26 +474,6 @@ typedef struct {
 
 #define LIBXL_VERSION 0
 
-typedef struct {
-    libxl_domain_create_info c_info;
-    libxl_domain_build_info b_info;
-
-    int num_disks, num_nics, num_pcidevs, num_vfbs, num_vkbs, num_vtpms;
-
-    libxl_device_disk *disks;
-    libxl_device_nic *nics;
-    libxl_device_pci *pcidevs;
-    libxl_device_vfb *vfbs;
-    libxl_device_vkb *vkbs;
-    libxl_device_vtpm *vtpms;
-
-    libxl_action_on_shutdown on_poweroff;
-    libxl_action_on_shutdown on_reboot;
-    libxl_action_on_shutdown on_watchdog;
-    libxl_action_on_shutdown on_crash;
-} libxl_domain_config;
-char *libxl_domain_config_to_json(libxl_ctx *ctx, libxl_domain_config *p);
-
 /* context functions */
 int libxl_ctx_alloc(libxl_ctx **pctx, int version,
                     unsigned flags /* none currently defined */,
diff -r c893596e2d4c -r 601dc257a740 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Tue Nov 20 17:22:10 2012 +0000
+++ b/tools/libxl/libxl_create.c	Tue Nov 20 17:22:16 2012 +0000
@@ -24,43 +24,6 @@
 #include <xenguest.h>
 #include <xen/hvm/hvm_info_table.h>
 
-void libxl_domain_config_init(libxl_domain_config *d_config)
-{
-    memset(d_config, 0, sizeof(*d_config));
-    libxl_domain_create_info_init(&d_config->c_info);
-    libxl_domain_build_info_init(&d_config->b_info);
-}
-
-void libxl_domain_config_dispose(libxl_domain_config *d_config)
-{
-    int i;
-
-    for (i=0; i<d_config->num_disks; i++)
-        libxl_device_disk_dispose(&d_config->disks[i]);
-    free(d_config->disks);
-
-    for (i=0; i<d_config->num_nics; i++)
-        libxl_device_nic_dispose(&d_config->nics[i]);
-    free(d_config->nics);
-
-    for (i=0; i<d_config->num_pcidevs; i++)
-        libxl_device_pci_dispose(&d_config->pcidevs[i]);
-    free(d_config->pcidevs);
-
-    for (i=0; i<d_config->num_vfbs; i++)
-        libxl_device_vfb_dispose(&d_config->vfbs[i]);
-    free(d_config->vfbs);
-
-    for (i=0; i<d_config->num_vkbs; i++)
-        libxl_device_vkb_dispose(&d_config->vkbs[i]);
-    free(d_config->vkbs);
-
-    libxl_device_vtpm_list_free(d_config->vtpms, d_config->num_vtpms);
-
-    libxl_domain_create_info_dispose(&d_config->c_info);
-    libxl_domain_build_info_dispose(&d_config->b_info);
-}
-
 int libxl__domain_create_info_setdefault(libxl__gc *gc,
                                          libxl_domain_create_info *c_info)
 {
diff -r c893596e2d4c -r 601dc257a740 tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Tue Nov 20 17:22:10 2012 +0000
+++ b/tools/libxl/libxl_json.c	Tue Nov 20 17:22:16 2012 +0000
@@ -786,158 +786,6 @@ out:
     return ret;
 }
 
-yajl_gen_status libxl_domain_config_gen_json(yajl_gen hand,
-                                             libxl_domain_config *p)
-{
-    yajl_gen_status s;
-    int i;
-
-    s = yajl_gen_map_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"c_info",
-                        sizeof("c_info")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_domain_create_info_gen_json(hand, &p->c_info);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"b_info",
-                        sizeof("b_info")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_domain_build_info_gen_json(hand, &p->b_info);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"disks",
-                        sizeof("disks")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_disks; i++) {
-        s = libxl_device_disk_gen_json(hand, &p->disks[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"nics",
-                        sizeof("nics")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_nics; i++) {
-        s = libxl_device_nic_gen_json(hand, &p->nics[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"pcidevs",
-                        sizeof("pcidevs")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_pcidevs; i++) {
-        s = libxl_device_pci_gen_json(hand, &p->pcidevs[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"vfbs",
-                        sizeof("vfbs")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_vfbs; i++) {
-        s = libxl_device_vfb_gen_json(hand, &p->vfbs[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"vkbs",
-                        sizeof("vkbs")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_vkbs; i++) {
-        s = libxl_device_vkb_gen_json(hand, &p->vkbs[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"on_poweroff",
-                        sizeof("on_poweroff")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_action_on_shutdown_gen_json(hand, &p->on_poweroff);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"on_reboot",
-                        sizeof("on_reboot")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_action_on_shutdown_gen_json(hand, &p->on_reboot);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"on_watchdog",
-                        sizeof("on_watchdog")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_action_on_shutdown_gen_json(hand, &p->on_watchdog);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"on_crash",
-                        sizeof("on_crash")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_action_on_shutdown_gen_json(hand, &p->on_crash);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_map_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    out:
-    return s;
-}
-
-char *libxl_domain_config_to_json(libxl_ctx *ctx, libxl_domain_config *p)
-{
-    return libxl__object_to_json(ctx, "libxl_domain_config",
-                        (libxl__gen_json_callback)&libxl_domain_config_gen_json,
-                        (void *)p);
-}
-
 /*
  * Local variables:
  * mode: C
diff -r c893596e2d4c -r 601dc257a740 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:10 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:16 2012 +0000
@@ -401,6 +401,23 @@ libxl_device_vtpm = Struct("device_vtpm"
     ("uuid",             libxl_uuid),
 ])
 
+libxl_domain_config = Struct("domain_config", [
+    ("c_info", libxl_domain_create_info),
+    ("b_info", libxl_domain_build_info),
+
+    ("disks", Array(libxl_device_disk, "num_disks")),
+    ("nics", Array(libxl_device_nic, "num_nics")),
+    ("pcidevs", Array(libxl_device_pci, "num_pcidevs")),
+    ("vfbs", Array(libxl_device_vfb, "num_vfbs")),
+    ("vkbs", Array(libxl_device_vkb, "num_vkbs")),
+    ("vtpms", Array(libxl_device_vtpm, "num_vtpms")),
+
+    ("on_poweroff", libxl_action_on_shutdown),
+    ("on_reboot", libxl_action_on_shutdown),
+    ("on_watchdog", libxl_action_on_shutdown),
+    ("on_crash", libxl_action_on_shutdown),
+    ])
+
 libxl_diskinfo = Struct("diskinfo", [
     ("backend", string),
     ("backend_id", uint32),
diff -r c893596e2d4c -r 601dc257a740 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:10 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:16 2012 +0000
@@ -283,6 +283,7 @@ if __name__ == '__main__':
         "cpupoolinfo",
         "domain_create_info",
         "domain_build_info",
+        "domain_config",
         "vcpuinfo",
         "event",
         ]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarXy-0001Zq-9u; Tue, 20 Nov 2012 17:23:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXw-0001Yd-GR; Tue, 20 Nov 2012 17:23:40 +0000
Received: from [85.158.137.99:15219] by server-3.bemta-3.messagelabs.com id
	E3/8E-31566-B9CBBA05; Tue, 20 Nov 2012 17:23:39 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353432216!14773161!2
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17315 invoked from network); 20 Nov 2012 17:23:39 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:39 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078853"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-Jq;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 8195cb0ebac691ae94e97939362f4d345891b4a7
Message-ID: <8195cb0ebac691ae94e9.1353432202@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:22 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 02 of 15] libxl: Add
	LIBXL_SHUTDOWN_REASON_UNKNOWN
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID 8195cb0ebac691ae94e97939362f4d345891b4a7
# Parent  601dc257a740d3a6047667731007283a4dcb9600
libxl: Add LIBXL_SHUTDOWN_REASON_UNKNOWN

libxl_dominfo.shutdown_reason is valid iff (shutdown||dying). This is a bit
annoying when generating language bindings since it needs all sorts of special
casing. Just introduce an explicit value instead.

Signed-off-by: Ian Campbell <ian.cambell@citrix.com>

diff -r 601dc257a740 -r 8195cb0ebac6 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Tue Nov 20 17:22:16 2012 +0000
+++ b/tools/libxl/libxl.c	Tue Nov 20 17:22:21 2012 +0000
@@ -526,7 +526,7 @@ static void xcinfo2xlinfo(const xc_domai
     if (xlinfo->shutdown || xlinfo->dying)
         xlinfo->shutdown_reason = (xcinfo->flags>>XEN_DOMINF_shutdownshift) & XEN_DOMINF_shutdownmask;
     else
-        xlinfo->shutdown_reason  = ~0;
+        xlinfo->shutdown_reason = LIBXL_SHUTDOWN_REASON_UNKNOWN;
 
     xlinfo->current_memkb = PAGE_TO_MEMKB(xcinfo->tot_pages);
     xlinfo->shared_memkb = PAGE_TO_MEMKB(xcinfo->shr_pages);
diff -r 601dc257a740 -r 8195cb0ebac6 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:16 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:21 2012 +0000
@@ -118,14 +118,15 @@ libxl_scheduler = Enumeration("scheduler
     (7, "arinc653"),
     ])
 
-# Consistent with SHUTDOWN_* in sched.h
+# Consistent with SHUTDOWN_* in sched.h (apart from UNKNOWN)
 libxl_shutdown_reason = Enumeration("shutdown_reason", [
+    (-1, "unknown"),
     (0, "poweroff"),
     (1, "reboot"),
     (2, "suspend"),
     (3, "crash"),
     (4, "watchdog"),
-    ])
+    ], init_val = "LIBXL_SHUTDOWN_REASON_UNKNOWN")
 
 libxl_vga_interface_type = Enumeration("vga_interface_type", [
     (1, "CIRRUS"),

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarY1-0001cs-QE; Tue, 20 Nov 2012 17:23:45 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXy-0001Z9-LQ; Tue, 20 Nov 2012 17:23:42 +0000
Received: from [85.158.143.99:56857] by server-2.bemta-4.messagelabs.com id
	DA/24-28922-E9CBBA05; Tue, 20 Nov 2012 17:23:42 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1353432218!25420593!3
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24508 invoked from network); 20 Nov 2012 17:23:41 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078859"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-JM;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 601dc257a740d3a6047667731007283a4dcb9600
Message-ID: <601dc257a740d3a60476.1353432201@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:21 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 01 of 15] libxl: move definition of
 libxl_domain_config into the IDL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432136 0
# Node ID 601dc257a740d3a6047667731007283a4dcb9600
# Parent  c893596e2d4c7ddd62a3704ea5460be4e5be38df
libxl: move definition of libxl_domain_config into the IDL

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Posted during 4.2 freeze and deferred until 4.3...

diff -r c893596e2d4c -r 601dc257a740 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Tue Nov 20 17:22:10 2012 +0000
+++ b/tools/libxl/libxl.h	Tue Nov 20 17:22:16 2012 +0000
@@ -474,26 +474,6 @@ typedef struct {
 
 #define LIBXL_VERSION 0
 
-typedef struct {
-    libxl_domain_create_info c_info;
-    libxl_domain_build_info b_info;
-
-    int num_disks, num_nics, num_pcidevs, num_vfbs, num_vkbs, num_vtpms;
-
-    libxl_device_disk *disks;
-    libxl_device_nic *nics;
-    libxl_device_pci *pcidevs;
-    libxl_device_vfb *vfbs;
-    libxl_device_vkb *vkbs;
-    libxl_device_vtpm *vtpms;
-
-    libxl_action_on_shutdown on_poweroff;
-    libxl_action_on_shutdown on_reboot;
-    libxl_action_on_shutdown on_watchdog;
-    libxl_action_on_shutdown on_crash;
-} libxl_domain_config;
-char *libxl_domain_config_to_json(libxl_ctx *ctx, libxl_domain_config *p);
-
 /* context functions */
 int libxl_ctx_alloc(libxl_ctx **pctx, int version,
                     unsigned flags /* none currently defined */,
diff -r c893596e2d4c -r 601dc257a740 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Tue Nov 20 17:22:10 2012 +0000
+++ b/tools/libxl/libxl_create.c	Tue Nov 20 17:22:16 2012 +0000
@@ -24,43 +24,6 @@
 #include <xenguest.h>
 #include <xen/hvm/hvm_info_table.h>
 
-void libxl_domain_config_init(libxl_domain_config *d_config)
-{
-    memset(d_config, 0, sizeof(*d_config));
-    libxl_domain_create_info_init(&d_config->c_info);
-    libxl_domain_build_info_init(&d_config->b_info);
-}
-
-void libxl_domain_config_dispose(libxl_domain_config *d_config)
-{
-    int i;
-
-    for (i=0; i<d_config->num_disks; i++)
-        libxl_device_disk_dispose(&d_config->disks[i]);
-    free(d_config->disks);
-
-    for (i=0; i<d_config->num_nics; i++)
-        libxl_device_nic_dispose(&d_config->nics[i]);
-    free(d_config->nics);
-
-    for (i=0; i<d_config->num_pcidevs; i++)
-        libxl_device_pci_dispose(&d_config->pcidevs[i]);
-    free(d_config->pcidevs);
-
-    for (i=0; i<d_config->num_vfbs; i++)
-        libxl_device_vfb_dispose(&d_config->vfbs[i]);
-    free(d_config->vfbs);
-
-    for (i=0; i<d_config->num_vkbs; i++)
-        libxl_device_vkb_dispose(&d_config->vkbs[i]);
-    free(d_config->vkbs);
-
-    libxl_device_vtpm_list_free(d_config->vtpms, d_config->num_vtpms);
-
-    libxl_domain_create_info_dispose(&d_config->c_info);
-    libxl_domain_build_info_dispose(&d_config->b_info);
-}
-
 int libxl__domain_create_info_setdefault(libxl__gc *gc,
                                          libxl_domain_create_info *c_info)
 {
diff -r c893596e2d4c -r 601dc257a740 tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Tue Nov 20 17:22:10 2012 +0000
+++ b/tools/libxl/libxl_json.c	Tue Nov 20 17:22:16 2012 +0000
@@ -786,158 +786,6 @@ out:
     return ret;
 }
 
-yajl_gen_status libxl_domain_config_gen_json(yajl_gen hand,
-                                             libxl_domain_config *p)
-{
-    yajl_gen_status s;
-    int i;
-
-    s = yajl_gen_map_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"c_info",
-                        sizeof("c_info")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_domain_create_info_gen_json(hand, &p->c_info);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"b_info",
-                        sizeof("b_info")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_domain_build_info_gen_json(hand, &p->b_info);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"disks",
-                        sizeof("disks")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_disks; i++) {
-        s = libxl_device_disk_gen_json(hand, &p->disks[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"nics",
-                        sizeof("nics")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_nics; i++) {
-        s = libxl_device_nic_gen_json(hand, &p->nics[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"pcidevs",
-                        sizeof("pcidevs")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_pcidevs; i++) {
-        s = libxl_device_pci_gen_json(hand, &p->pcidevs[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"vfbs",
-                        sizeof("vfbs")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_vfbs; i++) {
-        s = libxl_device_vfb_gen_json(hand, &p->vfbs[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"vkbs",
-                        sizeof("vkbs")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_vkbs; i++) {
-        s = libxl_device_vkb_gen_json(hand, &p->vkbs[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"on_poweroff",
-                        sizeof("on_poweroff")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_action_on_shutdown_gen_json(hand, &p->on_poweroff);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"on_reboot",
-                        sizeof("on_reboot")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_action_on_shutdown_gen_json(hand, &p->on_reboot);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"on_watchdog",
-                        sizeof("on_watchdog")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_action_on_shutdown_gen_json(hand, &p->on_watchdog);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"on_crash",
-                        sizeof("on_crash")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_action_on_shutdown_gen_json(hand, &p->on_crash);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_map_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    out:
-    return s;
-}
-
-char *libxl_domain_config_to_json(libxl_ctx *ctx, libxl_domain_config *p)
-{
-    return libxl__object_to_json(ctx, "libxl_domain_config",
-                        (libxl__gen_json_callback)&libxl_domain_config_gen_json,
-                        (void *)p);
-}
-
 /*
  * Local variables:
  * mode: C
diff -r c893596e2d4c -r 601dc257a740 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:10 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:16 2012 +0000
@@ -401,6 +401,23 @@ libxl_device_vtpm = Struct("device_vtpm"
     ("uuid",             libxl_uuid),
 ])
 
+libxl_domain_config = Struct("domain_config", [
+    ("c_info", libxl_domain_create_info),
+    ("b_info", libxl_domain_build_info),
+
+    ("disks", Array(libxl_device_disk, "num_disks")),
+    ("nics", Array(libxl_device_nic, "num_nics")),
+    ("pcidevs", Array(libxl_device_pci, "num_pcidevs")),
+    ("vfbs", Array(libxl_device_vfb, "num_vfbs")),
+    ("vkbs", Array(libxl_device_vkb, "num_vkbs")),
+    ("vtpms", Array(libxl_device_vtpm, "num_vtpms")),
+
+    ("on_poweroff", libxl_action_on_shutdown),
+    ("on_reboot", libxl_action_on_shutdown),
+    ("on_watchdog", libxl_action_on_shutdown),
+    ("on_crash", libxl_action_on_shutdown),
+    ])
+
 libxl_diskinfo = Struct("diskinfo", [
     ("backend", string),
     ("backend_id", uint32),
diff -r c893596e2d4c -r 601dc257a740 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:10 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:16 2012 +0000
@@ -283,6 +283,7 @@ if __name__ == '__main__':
         "cpupoolinfo",
         "domain_create_info",
         "domain_build_info",
+        "domain_config",
         "vcpuinfo",
         "event",
         ]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarXy-0001Zq-9u; Tue, 20 Nov 2012 17:23:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXw-0001Yd-GR; Tue, 20 Nov 2012 17:23:40 +0000
Received: from [85.158.137.99:15219] by server-3.bemta-3.messagelabs.com id
	E3/8E-31566-B9CBBA05; Tue, 20 Nov 2012 17:23:39 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353432216!14773161!2
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17315 invoked from network); 20 Nov 2012 17:23:39 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:39 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078853"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-Jq;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 8195cb0ebac691ae94e97939362f4d345891b4a7
Message-ID: <8195cb0ebac691ae94e9.1353432202@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:22 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 02 of 15] libxl: Add
	LIBXL_SHUTDOWN_REASON_UNKNOWN
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID 8195cb0ebac691ae94e97939362f4d345891b4a7
# Parent  601dc257a740d3a6047667731007283a4dcb9600
libxl: Add LIBXL_SHUTDOWN_REASON_UNKNOWN

libxl_dominfo.shutdown_reason is valid iff (shutdown||dying). This is a bit
annoying when generating language bindings since it needs all sorts of special
casing. Just introduce an explicit value instead.

Signed-off-by: Ian Campbell <ian.cambell@citrix.com>

diff -r 601dc257a740 -r 8195cb0ebac6 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Tue Nov 20 17:22:16 2012 +0000
+++ b/tools/libxl/libxl.c	Tue Nov 20 17:22:21 2012 +0000
@@ -526,7 +526,7 @@ static void xcinfo2xlinfo(const xc_domai
     if (xlinfo->shutdown || xlinfo->dying)
         xlinfo->shutdown_reason = (xcinfo->flags>>XEN_DOMINF_shutdownshift) & XEN_DOMINF_shutdownmask;
     else
-        xlinfo->shutdown_reason  = ~0;
+        xlinfo->shutdown_reason = LIBXL_SHUTDOWN_REASON_UNKNOWN;
 
     xlinfo->current_memkb = PAGE_TO_MEMKB(xcinfo->tot_pages);
     xlinfo->shared_memkb = PAGE_TO_MEMKB(xcinfo->shr_pages);
diff -r 601dc257a740 -r 8195cb0ebac6 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:16 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:21 2012 +0000
@@ -118,14 +118,15 @@ libxl_scheduler = Enumeration("scheduler
     (7, "arinc653"),
     ])
 
-# Consistent with SHUTDOWN_* in sched.h
+# Consistent with SHUTDOWN_* in sched.h (apart from UNKNOWN)
 libxl_shutdown_reason = Enumeration("shutdown_reason", [
+    (-1, "unknown"),
     (0, "poweroff"),
     (1, "reboot"),
     (2, "suspend"),
     (3, "crash"),
     (4, "watchdog"),
-    ])
+    ], init_val = "LIBXL_SHUTDOWN_REASON_UNKNOWN")
 
 libxl_vga_interface_type = Enumeration("vga_interface_type", [
     (1, "CIRRUS"),

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarXy-0001aO-Rx; Tue, 20 Nov 2012 17:23:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXx-0001Z9-F2; Tue, 20 Nov 2012 17:23:41 +0000
Received: from [85.158.143.99:25230] by server-2.bemta-4.messagelabs.com id
	F6/24-28922-C9CBBA05; Tue, 20 Nov 2012 17:23:40 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1353432218!25420593!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24469 invoked from network); 20 Nov 2012 17:23:40 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:40 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078856"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-LN;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: b7e2cd4a03f278c9abfec0812c88234f7e493646
Message-ID: <b7e2cd4a03f278c9abfe.1353432205@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 05 of 15] libxl: ocaml: support for Arrays in
 bindings generator
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID b7e2cd4a03f278c9abfec0812c88234f7e493646
# Parent  be294b1cdd00dac5d3a1b42faf06656902b99e5b
libxl: ocaml: support for Arrays in bindings generator.

No change in generated code because no arrays are currently generated.

Signed-off-by: Ian Campbell <ian.campbell@citria.xcom>

diff -r be294b1cdd00 -r b7e2cd4a03f2 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
@@ -143,7 +143,13 @@ def c_val(ty, c, o, indent="", parent = 
             raise NotImplementedError("No c_val fn for Builtin %s (%s)" % (ty.typename, type(ty)))
         s += "%s;" % (fn % { "o": o, "c": c })
     elif isinstance (ty,idl.Array):
-        raise("Cannot handle Array type\n")
+        s += "{\n"
+        s += "\tint i;\n"
+        s += "\t%s = Wosize_val(%s);\n" % (parent + ty.lenvar.name, o)
+        s += "\tfor(i=0; i<%s; i++) {\n" % (parent + ty.lenvar.name)
+        s += c_val(ty.elem_type, c+"[i]", "Field(%s, i)" % o, indent="\t\t", parent=parent) + "\n"
+        s += "\t}\n"
+        s += "}\n"
     elif isinstance(ty,idl.Enumeration) and (parent is None):
         n = 0
         s += "switch(Int_val(%s)) {\n" % o

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarXx-0001ZP-OG; Tue, 20 Nov 2012 17:23:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXv-0001YV-PY; Tue, 20 Nov 2012 17:23:39 +0000
Received: from [85.158.137.99:15168] by server-10.bemta-3.messagelabs.com id
	55/CD-19806-A9CBBA05; Tue, 20 Nov 2012 17:23:38 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353432216!14773161!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17192 invoked from network); 20 Nov 2012 17:23:38 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:38 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078852"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-Ip;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
Message-ID: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:20 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 00 of 15] libxl: ocaml: improve the bindings
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The following series makes the libxl ocaml bindings somewhat more
useful (for some small value of useful).

As well as defining some of the more useful types in the bindings they
switch to a model of long lived libxl contexts rather than per-call
ones. This is necessary to use the stuff like events, signal handling etc.

I got half way through implementing a useful binding for building a
domain before I got distracted by other things, hence posting what I
have. Most of the early part of the series could go in, the last
couple of patches probably need more work.

There are plenty of code paths here which have never been even
slightly exercised. This is true of these bindings in general I think.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarXx-0001ZP-OG; Tue, 20 Nov 2012 17:23:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXv-0001YV-PY; Tue, 20 Nov 2012 17:23:39 +0000
Received: from [85.158.137.99:15168] by server-10.bemta-3.messagelabs.com id
	55/CD-19806-A9CBBA05; Tue, 20 Nov 2012 17:23:38 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353432216!14773161!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17192 invoked from network); 20 Nov 2012 17:23:38 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:38 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078852"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-Ip;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
Message-ID: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:20 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 00 of 15] libxl: ocaml: improve the bindings
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The following series makes the libxl ocaml bindings somewhat more
useful (for some small value of useful).

As well as defining some of the more useful types in the bindings they
switch to a model of long lived libxl contexts rather than per-call
ones. This is necessary to use the stuff like events, signal handling etc.

I got half way through implementing a useful binding for building a
domain before I got distracted by other things, hence posting what I
have. Most of the early part of the series could go in, the last
couple of patches probably need more work.

There are plenty of code paths here which have never been even
slightly exercised. This is true of these bindings in general I think.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarXy-0001aO-Rx; Tue, 20 Nov 2012 17:23:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXx-0001Z9-F2; Tue, 20 Nov 2012 17:23:41 +0000
Received: from [85.158.143.99:25230] by server-2.bemta-4.messagelabs.com id
	F6/24-28922-C9CBBA05; Tue, 20 Nov 2012 17:23:40 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1353432218!25420593!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24469 invoked from network); 20 Nov 2012 17:23:40 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:40 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078856"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-LN;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: b7e2cd4a03f278c9abfec0812c88234f7e493646
Message-ID: <b7e2cd4a03f278c9abfe.1353432205@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:25 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 05 of 15] libxl: ocaml: support for Arrays in
 bindings generator
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID b7e2cd4a03f278c9abfec0812c88234f7e493646
# Parent  be294b1cdd00dac5d3a1b42faf06656902b99e5b
libxl: ocaml: support for Arrays in bindings generator.

No change in generated code because no arrays are currently generated.

Signed-off-by: Ian Campbell <ian.campbell@citria.xcom>

diff -r be294b1cdd00 -r b7e2cd4a03f2 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
@@ -143,7 +143,13 @@ def c_val(ty, c, o, indent="", parent = 
             raise NotImplementedError("No c_val fn for Builtin %s (%s)" % (ty.typename, type(ty)))
         s += "%s;" % (fn % { "o": o, "c": c })
     elif isinstance (ty,idl.Array):
-        raise("Cannot handle Array type\n")
+        s += "{\n"
+        s += "\tint i;\n"
+        s += "\t%s = Wosize_val(%s);\n" % (parent + ty.lenvar.name, o)
+        s += "\tfor(i=0; i<%s; i++) {\n" % (parent + ty.lenvar.name)
+        s += c_val(ty.elem_type, c+"[i]", "Field(%s, i)" % o, indent="\t\t", parent=parent) + "\n"
+        s += "\t}\n"
+        s += "}\n"
     elif isinstance(ty,idl.Enumeration) and (parent is None):
         n = 0
         s += "switch(Int_val(%s)) {\n" % o

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarY2-0001dp-Ju; Tue, 20 Nov 2012 17:23:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXz-0001aJ-Bu; Tue, 20 Nov 2012 17:23:43 +0000
Received: from [85.158.137.99:41382] by server-13.bemta-3.messagelabs.com id
	89/AE-24887-E9CBBA05; Tue, 20 Nov 2012 17:23:42 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353432216!14773161!5
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17407 invoked from network); 20 Nov 2012 17:23:41 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078854"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-Ko;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: be294b1cdd00dac5d3a1b42faf06656902b99e5b
Message-ID: <be294b1cdd00dac5d3a1.1353432204@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:24 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 04 of 15] libxl: ocaml: fix code intended to
 output comments before definitions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID be294b1cdd00dac5d3a1b42faf06656902b99e5b
# Parent  739989dcd108c6dac61aa9c87be2a75feafb9871
libxl: ocaml: fix code intended to output comments before definitions

I'm not sure how useful these comments actually are but erred on the
side of fixing rather than removing.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 739989dcd108 -r be294b1cdd00 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
@@ -79,12 +79,14 @@ def gen_ocaml_ml(ty, interface, indent="
         s = ("""(* %s interface *)\n""" % ty.typename)
     else:
         s = ("""(* %s implementation *)\n""" % ty.typename)
+        
     if isinstance(ty, idl.Enumeration):
-        s = "type %s = \n" % ty.rawname
+        s += "type %s = \n" % ty.rawname
         for v in ty.values:
             s += "\t | %s\n" % v.rawname
     elif isinstance(ty, idl.Aggregate):
-        s = ""
+        s += ""
+        
         if ty.typename is None:
             raise NotImplementedError("%s has no typename" % type(ty))
         else:

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarY2-0001dp-Ju; Tue, 20 Nov 2012 17:23:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXz-0001aJ-Bu; Tue, 20 Nov 2012 17:23:43 +0000
Received: from [85.158.137.99:41382] by server-13.bemta-3.messagelabs.com id
	89/AE-24887-E9CBBA05; Tue, 20 Nov 2012 17:23:42 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353432216!14773161!5
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17407 invoked from network); 20 Nov 2012 17:23:41 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078854"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-Ko;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: be294b1cdd00dac5d3a1b42faf06656902b99e5b
Message-ID: <be294b1cdd00dac5d3a1.1353432204@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:24 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 04 of 15] libxl: ocaml: fix code intended to
 output comments before definitions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID be294b1cdd00dac5d3a1b42faf06656902b99e5b
# Parent  739989dcd108c6dac61aa9c87be2a75feafb9871
libxl: ocaml: fix code intended to output comments before definitions

I'm not sure how useful these comments actually are but erred on the
side of fixing rather than removing.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 739989dcd108 -r be294b1cdd00 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
@@ -79,12 +79,14 @@ def gen_ocaml_ml(ty, interface, indent="
         s = ("""(* %s interface *)\n""" % ty.typename)
     else:
         s = ("""(* %s implementation *)\n""" % ty.typename)
+        
     if isinstance(ty, idl.Enumeration):
-        s = "type %s = \n" % ty.rawname
+        s += "type %s = \n" % ty.rawname
         for v in ty.values:
             s += "\t | %s\n" % v.rawname
     elif isinstance(ty, idl.Aggregate):
-        s = ""
+        s += ""
+        
         if ty.typename is None:
             raise NotImplementedError("%s has no typename" % type(ty))
         else:

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarY3-0001fO-5r; Tue, 20 Nov 2012 17:23:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXz-0001YV-JH; Tue, 20 Nov 2012 17:23:43 +0000
Received: from [85.158.137.99:15436] by server-10.bemta-3.messagelabs.com id
	5C/DD-19806-F9CBBA05; Tue, 20 Nov 2012 17:23:43 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353432216!14773161!6
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17418 invoked from network); 20 Nov 2012 17:23:42 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:42 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078861"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-MM;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 0cf342afa9e6b506fad68346cb3a1207030372eb
Message-ID: <0cf342afa9e6b506fad6.1353432207@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:27 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 07 of 15] libxl: ocaml: support for KeyedUnion
 in the bindings generator
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID 0cf342afa9e6b506fad68346cb3a1207030372eb
# Parent  f618acdeea1bf60b3b68da4062de018d8162fe8c
libxl: ocaml: support for KeyedUnion in the bindings generator.

A KeyedUnion consists of two fields in the containing struct. First an
enum field ("e") used as a descriminator and second a union ("u")
containing potentially anonymous structs associated with each enum
value.

We map the anonymous structs to structs named after the descriminator
field ("e") and the specific enum values. We then declare an ocaml
variant type name e__union mapping each enum value to its associated
struct.

So given IDL:

 foo = Enumeration("foo",
	(0, "BAR"),
	(1, "BAZ"),
 s = Struct("s", [
        ("u", KeyedUnion(none, foo, "blargle", [
		("bar", Struct(...xxx...)),
		("baz", Struct(...yyy...)),
	])),
 ])

We generate C:

 enum { FOO, BAR } foo;
 struct s {
 	enum foo blargle;
 	union {
 		struct { ...xxx... } bar;
 		struct { ...yyy... } baz;
 	} u;
 }

and map this to ocaml

 type foo = BAR | BAZ;

 module	s = Struct

 	type blargle_bar = ...xxx...;

 	type blargle_baz = ...yyy...;

 	type blargle__union = Bar of blargle_bar | Baz of blargle_baz;

 	type t =
 	{
 		blargle : blargle__union;
 	}

These type names are OK because they are already within the namespace
associated with the struct "s".

If the struct assiated with bar is empty then we don't bother iwht
blargle_bar of "of blargle_bar".

No actually change in the gnerated code since we don't generated any
KeyedUnions yet.

The actual implementation was inspired by
http://www.linux-nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php#ref_constvrnt

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r f618acdeea1b -r 0cf342afa9e6 tools/libxl/idl.py
--- a/tools/libxl/idl.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/libxl/idl.py	Tue Nov 20 17:22:21 2012 +0000
@@ -216,6 +216,9 @@ class Struct(Aggregate):
         kwargs.setdefault('passby', PASS_BY_REFERENCE)
         Aggregate.__init__(self, "struct", name, fields, **kwargs)
 
+    def has_fields(self):
+        return len(self.fields) != 0
+
 class Union(Aggregate):
     def __init__(self, name, fields, **kwargs):
         # Generally speaking some intelligence is required to free a
diff -r f618acdeea1b -r 0cf342afa9e6 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
@@ -65,6 +65,8 @@ def ocaml_type_of(ty):
         if not typename:
             raise NotImplementedError("No typename for Builtin %s (%s)" % (ty.typename, type(ty)))
         return typename
+    elif isinstance(ty,idl.KeyedUnion):
+        return ty.union_name
     elif isinstance(ty,idl.Aggregate):
         return ty.rawname.capitalize() + ".t"
     else:
@@ -76,8 +78,67 @@ def munge_name(name):
     else:
         return name
     
-def ocaml_instance_of(type, name):
-    return "%s : %s" % (munge_name(name), ocaml_type_of(type))
+def ocaml_instance_of_field(f):
+    if isinstance(f.type, idl.KeyedUnion):
+        name = f.type.keyvar.name
+    else:
+        name = f.name
+    return "%s : %s" % (munge_name(name), ocaml_type_of(f.type))
+
+def gen_struct(ty):
+    s = ""
+    for f in ty.fields:
+        if f.type.private:
+            continue
+        x = ocaml_instance_of_field(f)
+        x = x.replace("\n", "\n\t\t")
+        s += "\t\t" + x + ";\n"
+    return s
+
+def gen_ocaml_keyedunions(ty, interface, indent, parent = None):
+    s = ""
+    
+    if ty.rawname is not None:
+        # Non-anonymous types need no special handling
+        pass
+    elif isinstance(ty, idl.KeyedUnion):
+        if parent is None:
+            nparent = ty.keyvar.name
+        else:
+            nparent = parent + "_" + ty.keyvar.name
+
+        for f in ty.fields:
+            if f.type is None: continue
+            if f.type.rawname is not None: continue
+            if isinstance(f.type, idl.Struct) and not f.type.has_fields(): continue
+            s += "\ntype %s_%s =\n" % (nparent,f.name)
+            s += "{\n"
+            s += gen_struct(f.type)
+            s += "}\n"
+
+        name = "%s__union" % ty.keyvar.name
+        s += "\n"
+        s += "type %s = " % name
+        u = []
+        for f in ty.fields:
+            if f.type is None:
+                u.append("%s" % (f.name.capitalize()))
+            elif isinstance(f.type, idl.Struct):
+                if f.type.rawname is not None:
+                    u.append("%s of %s" % (f.name.capitalize(), f.type.rawname.capitalize()))
+                elif f.type.has_fields():
+                    u.append("%s of %s_%s" % (f.name.capitalize(), nparent, f.name))
+                else:
+                    u.append("%s" % (f.name.capitalize()))
+            else:
+                raise NotImplementedError("Cannot handle KeyedUnion fields which are not Structs")
+            
+        s += " | ".join(u) + "\n"
+        ty.union_name = name
+
+    if s == "":
+        return None
+    return s.replace("\n", "\n%s" % indent)
 
 def gen_ocaml_ml(ty, interface, indent=""):
 
@@ -103,16 +164,17 @@ def gen_ocaml_ml(ty, interface, indent="
                 s += "module %s : sig\n" % module_name
             else:
                 s += "module %s = struct\n" % module_name
-            s += "\ttype t =\n"
-            s += "\t{\n"
-            
+                
+        # Handle KeyedUnions...
         for f in ty.fields:
-            if f.type.private:
-                continue
-            x = ocaml_instance_of(f.type, f.name)
-            x = x.replace("\n", "\n\t\t")
-            s += "\t\t" + x + ";\n"
+            ku = gen_ocaml_keyedunions(f.type, interface, "\t")
+            if ku is not None:
+                s += ku
+                s += "\n"
 
+        s += "\ttype t =\n"
+        s += "\t{\n"
+        s += gen_struct(ty)
         s += "\t}\n"
         
         if functions.has_key(ty.rawname):
@@ -164,12 +226,43 @@ def c_val(ty, c, o, indent="", parent = 
             n += 1
         s += "    default: failwith_xl(\"cannot convert value to %s\", lg); break;\n" % ty.typename
         s += "}"
-    elif isinstance(ty, idl.Aggregate) and (parent is None):
+    elif isinstance(ty, idl.KeyedUnion):
+        s += "{\n"
+        s += "\tif(Is_long(%s)) {\n" % o
+        n = 0
+        s += "\t\tswitch(Int_val(%s)) {\n" % o
+        for f in ty.fields:
+            if f.type is None or not f.type.has_fields():
+                s += "\t\t    case %d: %s = %s; break;\n" % (n,
+                                                    parent + ty.keyvar.name,
+                                                    f.enumname)
+            n += 1
+        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (long)\", lg); break;\n" % (parent, ty.keyvar.name)        
+        s += "\t\t}\n"
+        s += "\t} else {\n"
+        s += "\t\t/* Is block... */\n"
+        s += "\t\tswitch(Tag_val(%s)) {\n" % o
+        n = 0
+        for f in ty.fields:
+            if f.type is not None and f.type.has_fields():
+                if f.type.private:
+                    continue
+                s += "\t\t    case %d:\n" % (n)
+                s += "\t\t        %s = %s;\n" % (parent + ty.keyvar.name, f.enumname)
+                (nparent,fexpr) = ty.member(c, f, False)
+                s += "%s" % c_val(f.type, fexpr, o, indent=indent+"\t\t        ")
+                s += "break;\n"
+            n += 1
+        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (block)\", lg); break;\n" % (parent, ty.keyvar.name)
+        s += "\t\t}\n"
+        s += "\t}\n"
+        s += "}"
+    elif isinstance(ty, idl.Aggregate) and (parent is None or ty.rawname is None):
         n = 0
         for f in ty.fields:
             if f.type.private:
                 continue
-            (nparent,fexpr) = ty.member(c, f, parent is None)
+            (nparent,fexpr) = ty.member(c, f, ty.rawname is not None)
             s += "%s\n" % c_val(f.type, fexpr, "Field(%s, %d)" % (o,n), parent=nparent)
             n = n + 1
     else:
@@ -191,8 +284,8 @@ def gen_c_val(ty, indent=""):
     s += "}\n"
     
     return s.replace("\n", "\n%s" % indent)
-
-def ocaml_Val(ty, o, c, indent="", parent = None):
+    
+def ocaml_Val(ty, o, c, indent="", parent = None, struct_tag = None):
     s = indent
     if isinstance(ty,idl.UInt):
         if ty.width in [8, 16]:
@@ -231,11 +324,39 @@ def ocaml_Val(ty, o, c, indent="", paren
             n += 1
         s += "    default: failwith_xl(\"cannot convert value from %s\", lg); break;\n" % ty.typename
         s += "}"
-    elif isinstance(ty,idl.Aggregate) and (parent is None):
+    elif isinstance(ty, idl.KeyedUnion):
+        n = 0
+        s += "switch(%s) {\n" % (parent + ty.keyvar.name)
+        for f in ty.fields:
+            s += "\t    case %s:\n" % f.enumname
+            if f.type is None:
+                s += "\t        /* %d: None */\n" % n
+                s += "\t        %s = Val_long(%d);\n" % (o,n)
+            elif not f.type.has_fields():
+                s += "\t        /* %d: Long */\n" % n
+                s += "\t        %s = Val_long(%d);\n" % (o,n)
+            else:
+                s += "\t        /* %d: Block */\n" % n
+                (nparent,fexpr) = ty.member(c, f, parent is None)
+                s += ocaml_Val(f.type, o, fexpr, struct_tag = n, indent="\t        ", parent=nparent)
+                s += "\n"
+                #s += "\t        %s = caml_alloc(%d,%d);\n" % (o,len(f.type.fields),n)
+            s += "\t        break;\n"
+            n += 1
+        s += "\t    default: failwith_xl(\"cannot convert value from %s\", lg); break;\n" % ty.typename
+        s += "\t}"
+    elif isinstance(ty,idl.Aggregate) and (parent is None or ty.rawname is None):
         s += "{\n"
-        s += "\tvalue %s_field;\n" % ty.rawname
+        if ty.rawname is None:
+            fn = "anon_field"
+        else:
+            fn = "%s_field" % ty.rawname
+        s += "\tvalue %s;\n" % fn
         s += "\n"
-        s += "\t%s = caml_alloc_tuple(%d);\n" % (o, len(ty.fields))
+        if struct_tag is not None:
+            s += "\t%s = caml_alloc(%d,%d);\n" % (o, len(ty.fields), struct_tag)
+        else:
+            s += "\t%s = caml_alloc_tuple(%d);\n" % (o, len(ty.fields))
         
         n = 0
         for f in ty.fields:
@@ -245,8 +366,8 @@ def ocaml_Val(ty, o, c, indent="", paren
             (nparent,fexpr) = ty.member(c, f, parent is None)
 
             s += "\n"
-            s += "\t%s\n" % ocaml_Val(f.type, "%s_field" % ty.rawname, ty.pass_arg(fexpr, c), parent=nparent)
-            s += "\tStore_field(%s, %d, %s);\n" % (o, n, "%s_field" % ty.rawname)
+            s += "\t%s\n" % ocaml_Val(f.type, fn, ty.pass_arg(fexpr, c), parent=nparent)
+            s += "\tStore_field(%s, %d, %s);\n" % (o, n, fn)
             n = n + 1
         s += "}"
     else:

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarY1-0001cX-Do; Tue, 20 Nov 2012 17:23:45 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXy-0001ZG-ME; Tue, 20 Nov 2012 17:23:42 +0000
Received: from [85.158.143.99:25298] by server-3.bemta-4.messagelabs.com id
	6A/65-06841-E9CBBA05; Tue, 20 Nov 2012 17:23:42 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1353432220!29778082!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n,
	ML_RADAR_SPEW_LINKS_18,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29508 invoked from network); 20 Nov 2012 17:23:41 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078860"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-Mt;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 21c5e58956d09437903e1ee1b0588d61a7c28145
Message-ID: <21c5e58956d09437903e.1353432208@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:28 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 08 of 15] libxl/ocaml: add some more builtin
	types
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID 21c5e58956d09437903e1ee1b0588d61a7c28145
# Parent  0cf342afa9e6b506fad68346cb3a1207030372eb
libxl/ocaml: add some more builtin types.

  * bitmaps
  * string_list
  * cpuid_policy_list (actually opaque)
  * key_value_list

None of these are used yet, so no change to the generated code.

Bitmap_val requires a ctx, so leave it as an abort for now.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 0cf342afa9e6 -r 21c5e58956d0 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
@@ -13,9 +13,13 @@ builtins = {
     "libxl_devid":          ("devid",                  "%(c)s = Int_val(%(o)s)",            "Val_int(%(c)s)"  ),
     "libxl_defbool":        ("bool option",            "%(c)s = Defbool_val(%(o)s)",        "Val_defbool(%(c)s)" ),
     "libxl_uuid":           ("int array",              "Uuid_val(gc, lg, &%(c)s, %(o)s)",   "Val_uuid(&%(c)s)"),
-    "libxl_key_value_list": ("(string * string) list", None,                                None),
+    "libxl_bitmap":         ("bool array",             "Bitmap_val(gc, lg, &%(c)s, %(o)s)",   "Val_bitmap(&%(c)s)"),    
+    "libxl_key_value_list": ("(string * string) list", "libxl_key_value_list_val(gc, lg, &%(c)s, %(o)s)",                              None),
+    "libxl_string_list":    ("string list",            "libxl_string_list_val(gc, lg, &%(c)s, %(o)s)",                                 "String_list_val(gc, lg, &%(c)s, %(o)s)"),
     "libxl_mac":            ("int array",              "Mac_val(gc, lg, &%(c)s, %(o)s)",    "Val_mac(&%(c)s)"),
     "libxl_hwcap":          ("int32 array",            None,                                "Val_hwcap(&%(c)s)"),
+    # This is an opaque type
+    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(gc, lg, &%(c)s, %(o)s)",   "Val_cpuid_policy_list(&%(c)s)"),    
     }
 
 DEVICE_FUNCTIONS = [ ("add",            ["t", "domid", "unit"]),
diff -r 0cf342afa9e6 -r 21c5e58956d0 tools/ocaml/libs/xl/xenlight.ml.in
--- a/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
@@ -18,6 +18,10 @@ exception Error of string
 type domid = int
 type devid = int
 
+module Cpuid_policy = struct
+	type t
+end
+
 (* @@LIBXL_TYPES@@ *)
 
 external send_trigger : domid -> trigger -> int -> unit = "stub_xl_send_trigger"
diff -r 0cf342afa9e6 -r 21c5e58956d0 tools/ocaml/libs/xl/xenlight_stubs.c
--- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
@@ -27,6 +27,7 @@
 #include <string.h>
 
 #include <libxl.h>
+#include <libxl_utils.h>
 
 struct caml_logger {
 	struct xentoollog_logger logger;
@@ -96,7 +97,6 @@ static void failwith_xl(char *fname, str
 	caml_raise_with_string(*caml_named_value("xl.error"), s);
 }
 
-#if 0 /* TODO: wrap libxl_domain_create(), these functions will be needed then */
 static void * gc_calloc(caml_gc *gc, size_t nmemb, size_t size)
 {
 	void *ptr;
@@ -107,28 +107,62 @@ static void * gc_calloc(caml_gc *gc, siz
 	return ptr;
 }
 
-static int string_string_tuple_array_val (caml_gc *gc, char ***c_val, value v)
+static int list_len(value v)
+{
+	int len = 0;
+	while ( v != Val_emptylist ) {
+		len++;
+		v = Field(v, 1);
+	}
+	return len;
+}
+
+static int libxl_key_value_list_val(caml_gc *gc, struct caml_logger *lg,
+				    libxl_key_value_list *c_val,
+				    value v)
 {
 	CAMLparam1(v);
-	CAMLlocal1(a);
-	int i;
-	char **array;
+	CAMLlocal1(elem);
+	int nr, i;
+	libxl_key_value_list array;
 
-	for (i = 0, a = Field(v, 5); a != Val_emptylist; a = Field(a, 1)) { i++; }
+	nr = list_len(v);
 
-	array = gc_calloc(gc, (i + 1) * 2, sizeof(char *));
+	array = gc_calloc(gc, (nr + 1) * 2, sizeof(char *));
 	if (!array)
-		return 1;
-	for (i = 0, a = Field(v, 5); a != Val_emptylist; a = Field(a, 1), i++) {
-		value b = Field(a, 0);
-		array[i * 2] = dup_String_val(gc, Field(b, 0));
-		array[i * 2 + 1] = dup_String_val(gc, Field(b, 1));
+		caml_raise_out_of_memory();
+
+	for (i=0; v != Val_emptylist; i++, v = Field(v, 1) ) {
+		elem = Field(v, 0);
+
+		array[i * 2] = dup_String_val(gc, Field(elem, 0));
+		array[i * 2 + 1] = dup_String_val(gc, Field(elem, 1));
 	}
+
 	*c_val = array;
 	CAMLreturn(0);
 }
 
-#endif
+static int libxl_string_list_val(caml_gc *gc, struct caml_logger *lg,
+				 libxl_string_list *c_val,
+				 value v)
+{
+	CAMLparam1(v);
+	int nr, i;
+	libxl_key_value_list array;
+
+	nr = list_len(v);
+
+	array = gc_calloc(gc, (nr + 1), sizeof(char *));
+	if (!array)
+		caml_raise_out_of_memory();
+
+	for (i=0; v != Val_emptylist; i++, v = Field(v, 1) )
+		array[i] = dup_String_val(gc, Field(v, 0));
+
+	*c_val = array;
+	CAMLreturn(0);
+}
 
 /* Option type support as per http://www.linux-nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php */
 #define Val_none Val_int(0)
@@ -168,6 +202,45 @@ static int Mac_val(caml_gc *gc, struct c
 	CAMLreturn(0);
 }
 
+static value Val_bitmap (libxl_bitmap *c_val)
+{
+	CAMLparam0();
+	CAMLlocal1(v);
+	int i;
+
+	v = caml_alloc(8 * (c_val->size), 0);
+	libxl_for_each_bit(i, *c_val) {
+		if (libxl_bitmap_test(c_val, i))
+			Store_field(v, i, Val_true);
+		else
+			Store_field(v, i, Val_false);
+	}
+	CAMLreturn(v);
+}
+
+static int Bitmap_val(caml_gc *gc, struct caml_logger *lg,
+		      libxl_bitmap *c_val, value v)
+{
+	abort(); /* XXX */
+}
+
+static value Val_cpuid_policy_list(libxl_cpuid_policy_list *c_val)
+{
+	CAMLparam0();
+	/* An opaque pointer */
+	CAMLreturn((value)c_val);
+}
+
+static int Cpuid_policy_list_val(caml_gc *gc, struct caml_logger *lg,
+				 libxl_cpuid_policy_list **c_val, value v)
+{
+	CAMLparam1(v);
+
+	/* An opaque pointer */
+	*c_val = (libxl_cpuid_policy_list*)v;
+	CAMLreturn(0);
+}
+
 static value Val_uuid (libxl_uuid *c_val)
 {
 	CAMLparam0();

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarY3-0001fO-5r; Tue, 20 Nov 2012 17:23:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXz-0001YV-JH; Tue, 20 Nov 2012 17:23:43 +0000
Received: from [85.158.137.99:15436] by server-10.bemta-3.messagelabs.com id
	5C/DD-19806-F9CBBA05; Tue, 20 Nov 2012 17:23:43 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353432216!14773161!6
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17418 invoked from network); 20 Nov 2012 17:23:42 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:42 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078861"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-MM;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 0cf342afa9e6b506fad68346cb3a1207030372eb
Message-ID: <0cf342afa9e6b506fad6.1353432207@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:27 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 07 of 15] libxl: ocaml: support for KeyedUnion
 in the bindings generator
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID 0cf342afa9e6b506fad68346cb3a1207030372eb
# Parent  f618acdeea1bf60b3b68da4062de018d8162fe8c
libxl: ocaml: support for KeyedUnion in the bindings generator.

A KeyedUnion consists of two fields in the containing struct. First an
enum field ("e") used as a descriminator and second a union ("u")
containing potentially anonymous structs associated with each enum
value.

We map the anonymous structs to structs named after the descriminator
field ("e") and the specific enum values. We then declare an ocaml
variant type name e__union mapping each enum value to its associated
struct.

So given IDL:

 foo = Enumeration("foo",
	(0, "BAR"),
	(1, "BAZ"),
 s = Struct("s", [
        ("u", KeyedUnion(none, foo, "blargle", [
		("bar", Struct(...xxx...)),
		("baz", Struct(...yyy...)),
	])),
 ])

We generate C:

 enum { FOO, BAR } foo;
 struct s {
 	enum foo blargle;
 	union {
 		struct { ...xxx... } bar;
 		struct { ...yyy... } baz;
 	} u;
 }

and map this to ocaml

 type foo = BAR | BAZ;

 module	s = Struct

 	type blargle_bar = ...xxx...;

 	type blargle_baz = ...yyy...;

 	type blargle__union = Bar of blargle_bar | Baz of blargle_baz;

 	type t =
 	{
 		blargle : blargle__union;
 	}

These type names are OK because they are already within the namespace
associated with the struct "s".

If the struct assiated with bar is empty then we don't bother iwht
blargle_bar of "of blargle_bar".

No actually change in the gnerated code since we don't generated any
KeyedUnions yet.

The actual implementation was inspired by
http://www.linux-nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php#ref_constvrnt

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r f618acdeea1b -r 0cf342afa9e6 tools/libxl/idl.py
--- a/tools/libxl/idl.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/libxl/idl.py	Tue Nov 20 17:22:21 2012 +0000
@@ -216,6 +216,9 @@ class Struct(Aggregate):
         kwargs.setdefault('passby', PASS_BY_REFERENCE)
         Aggregate.__init__(self, "struct", name, fields, **kwargs)
 
+    def has_fields(self):
+        return len(self.fields) != 0
+
 class Union(Aggregate):
     def __init__(self, name, fields, **kwargs):
         # Generally speaking some intelligence is required to free a
diff -r f618acdeea1b -r 0cf342afa9e6 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
@@ -65,6 +65,8 @@ def ocaml_type_of(ty):
         if not typename:
             raise NotImplementedError("No typename for Builtin %s (%s)" % (ty.typename, type(ty)))
         return typename
+    elif isinstance(ty,idl.KeyedUnion):
+        return ty.union_name
     elif isinstance(ty,idl.Aggregate):
         return ty.rawname.capitalize() + ".t"
     else:
@@ -76,8 +78,67 @@ def munge_name(name):
     else:
         return name
     
-def ocaml_instance_of(type, name):
-    return "%s : %s" % (munge_name(name), ocaml_type_of(type))
+def ocaml_instance_of_field(f):
+    if isinstance(f.type, idl.KeyedUnion):
+        name = f.type.keyvar.name
+    else:
+        name = f.name
+    return "%s : %s" % (munge_name(name), ocaml_type_of(f.type))
+
+def gen_struct(ty):
+    s = ""
+    for f in ty.fields:
+        if f.type.private:
+            continue
+        x = ocaml_instance_of_field(f)
+        x = x.replace("\n", "\n\t\t")
+        s += "\t\t" + x + ";\n"
+    return s
+
+def gen_ocaml_keyedunions(ty, interface, indent, parent = None):
+    s = ""
+    
+    if ty.rawname is not None:
+        # Non-anonymous types need no special handling
+        pass
+    elif isinstance(ty, idl.KeyedUnion):
+        if parent is None:
+            nparent = ty.keyvar.name
+        else:
+            nparent = parent + "_" + ty.keyvar.name
+
+        for f in ty.fields:
+            if f.type is None: continue
+            if f.type.rawname is not None: continue
+            if isinstance(f.type, idl.Struct) and not f.type.has_fields(): continue
+            s += "\ntype %s_%s =\n" % (nparent,f.name)
+            s += "{\n"
+            s += gen_struct(f.type)
+            s += "}\n"
+
+        name = "%s__union" % ty.keyvar.name
+        s += "\n"
+        s += "type %s = " % name
+        u = []
+        for f in ty.fields:
+            if f.type is None:
+                u.append("%s" % (f.name.capitalize()))
+            elif isinstance(f.type, idl.Struct):
+                if f.type.rawname is not None:
+                    u.append("%s of %s" % (f.name.capitalize(), f.type.rawname.capitalize()))
+                elif f.type.has_fields():
+                    u.append("%s of %s_%s" % (f.name.capitalize(), nparent, f.name))
+                else:
+                    u.append("%s" % (f.name.capitalize()))
+            else:
+                raise NotImplementedError("Cannot handle KeyedUnion fields which are not Structs")
+            
+        s += " | ".join(u) + "\n"
+        ty.union_name = name
+
+    if s == "":
+        return None
+    return s.replace("\n", "\n%s" % indent)
 
 def gen_ocaml_ml(ty, interface, indent=""):
 
@@ -103,16 +164,17 @@ def gen_ocaml_ml(ty, interface, indent="
                 s += "module %s : sig\n" % module_name
             else:
                 s += "module %s = struct\n" % module_name
-            s += "\ttype t =\n"
-            s += "\t{\n"
-            
+                
+        # Handle KeyedUnions...
         for f in ty.fields:
-            if f.type.private:
-                continue
-            x = ocaml_instance_of(f.type, f.name)
-            x = x.replace("\n", "\n\t\t")
-            s += "\t\t" + x + ";\n"
+            ku = gen_ocaml_keyedunions(f.type, interface, "\t")
+            if ku is not None:
+                s += ku
+                s += "\n"
 
+        s += "\ttype t =\n"
+        s += "\t{\n"
+        s += gen_struct(ty)
         s += "\t}\n"
         
         if functions.has_key(ty.rawname):
@@ -164,12 +226,43 @@ def c_val(ty, c, o, indent="", parent = 
             n += 1
         s += "    default: failwith_xl(\"cannot convert value to %s\", lg); break;\n" % ty.typename
         s += "}"
-    elif isinstance(ty, idl.Aggregate) and (parent is None):
+    elif isinstance(ty, idl.KeyedUnion):
+        s += "{\n"
+        s += "\tif(Is_long(%s)) {\n" % o
+        n = 0
+        s += "\t\tswitch(Int_val(%s)) {\n" % o
+        for f in ty.fields:
+            if f.type is None or not f.type.has_fields():
+                s += "\t\t    case %d: %s = %s; break;\n" % (n,
+                                                    parent + ty.keyvar.name,
+                                                    f.enumname)
+            n += 1
+        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (long)\", lg); break;\n" % (parent, ty.keyvar.name)        
+        s += "\t\t}\n"
+        s += "\t} else {\n"
+        s += "\t\t/* Is block... */\n"
+        s += "\t\tswitch(Tag_val(%s)) {\n" % o
+        n = 0
+        for f in ty.fields:
+            if f.type is not None and f.type.has_fields():
+                if f.type.private:
+                    continue
+                s += "\t\t    case %d:\n" % (n)
+                s += "\t\t        %s = %s;\n" % (parent + ty.keyvar.name, f.enumname)
+                (nparent,fexpr) = ty.member(c, f, False)
+                s += "%s" % c_val(f.type, fexpr, o, indent=indent+"\t\t        ")
+                s += "break;\n"
+            n += 1
+        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (block)\", lg); break;\n" % (parent, ty.keyvar.name)
+        s += "\t\t}\n"
+        s += "\t}\n"
+        s += "}"
+    elif isinstance(ty, idl.Aggregate) and (parent is None or ty.rawname is None):
         n = 0
         for f in ty.fields:
             if f.type.private:
                 continue
-            (nparent,fexpr) = ty.member(c, f, parent is None)
+            (nparent,fexpr) = ty.member(c, f, ty.rawname is not None)
             s += "%s\n" % c_val(f.type, fexpr, "Field(%s, %d)" % (o,n), parent=nparent)
             n = n + 1
     else:
@@ -191,8 +284,8 @@ def gen_c_val(ty, indent=""):
     s += "}\n"
     
     return s.replace("\n", "\n%s" % indent)
-
-def ocaml_Val(ty, o, c, indent="", parent = None):
+    
+def ocaml_Val(ty, o, c, indent="", parent = None, struct_tag = None):
     s = indent
     if isinstance(ty,idl.UInt):
         if ty.width in [8, 16]:
@@ -231,11 +324,39 @@ def ocaml_Val(ty, o, c, indent="", paren
             n += 1
         s += "    default: failwith_xl(\"cannot convert value from %s\", lg); break;\n" % ty.typename
         s += "}"
-    elif isinstance(ty,idl.Aggregate) and (parent is None):
+    elif isinstance(ty, idl.KeyedUnion):
+        n = 0
+        s += "switch(%s) {\n" % (parent + ty.keyvar.name)
+        for f in ty.fields:
+            s += "\t    case %s:\n" % f.enumname
+            if f.type is None:
+                s += "\t        /* %d: None */\n" % n
+                s += "\t        %s = Val_long(%d);\n" % (o,n)
+            elif not f.type.has_fields():
+                s += "\t        /* %d: Long */\n" % n
+                s += "\t        %s = Val_long(%d);\n" % (o,n)
+            else:
+                s += "\t        /* %d: Block */\n" % n
+                (nparent,fexpr) = ty.member(c, f, parent is None)
+                s += ocaml_Val(f.type, o, fexpr, struct_tag = n, indent="\t        ", parent=nparent)
+                s += "\n"
+                #s += "\t        %s = caml_alloc(%d,%d);\n" % (o,len(f.type.fields),n)
+            s += "\t        break;\n"
+            n += 1
+        s += "\t    default: failwith_xl(\"cannot convert value from %s\", lg); break;\n" % ty.typename
+        s += "\t}"
+    elif isinstance(ty,idl.Aggregate) and (parent is None or ty.rawname is None):
         s += "{\n"
-        s += "\tvalue %s_field;\n" % ty.rawname
+        if ty.rawname is None:
+            fn = "anon_field"
+        else:
+            fn = "%s_field" % ty.rawname
+        s += "\tvalue %s;\n" % fn
         s += "\n"
-        s += "\t%s = caml_alloc_tuple(%d);\n" % (o, len(ty.fields))
+        if struct_tag is not None:
+            s += "\t%s = caml_alloc(%d,%d);\n" % (o, len(ty.fields), struct_tag)
+        else:
+            s += "\t%s = caml_alloc_tuple(%d);\n" % (o, len(ty.fields))
         
         n = 0
         for f in ty.fields:
@@ -245,8 +366,8 @@ def ocaml_Val(ty, o, c, indent="", paren
             (nparent,fexpr) = ty.member(c, f, parent is None)
 
             s += "\n"
-            s += "\t%s\n" % ocaml_Val(f.type, "%s_field" % ty.rawname, ty.pass_arg(fexpr, c), parent=nparent)
-            s += "\tStore_field(%s, %d, %s);\n" % (o, n, "%s_field" % ty.rawname)
+            s += "\t%s\n" % ocaml_Val(f.type, fn, ty.pass_arg(fexpr, c), parent=nparent)
+            s += "\tStore_field(%s, %d, %s);\n" % (o, n, fn)
             n = n + 1
         s += "}"
     else:

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarY0-0001bg-AT; Tue, 20 Nov 2012 17:23:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXy-0001ZG-2h; Tue, 20 Nov 2012 17:23:42 +0000
Received: from [85.158.143.99:56816] by server-3.bemta-4.messagelabs.com id
	47/65-06841-D9CBBA05; Tue, 20 Nov 2012 17:23:41 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1353432218!25420593!2
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24493 invoked from network); 20 Nov 2012 17:23:40 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:40 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078858"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-NO;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 5173d29f64fa541f6ec0c48481c4957a03f0302c
Message-ID: <5173d29f64fa541f6ec0.1353432209@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:29 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 09 of 15] libxl/ocaml: add
 domain_build/create_info and events to the bindings
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID 5173d29f64fa541f6ec0c48481c4957a03f0302c
# Parent  21c5e58956d09437903e1ee1b0588d61a7c28145
libxl/ocaml: add domain_build/create_info and events to the bindings.

We now have enoguh infrastructure in place to do this trivially.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 21c5e58956d0 -r 5173d29f64fa tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
@@ -19,7 +19,7 @@ builtins = {
     "libxl_mac":            ("int array",              "Mac_val(gc, lg, &%(c)s, %(o)s)",    "Val_mac(&%(c)s)"),
     "libxl_hwcap":          ("int32 array",            None,                                "Val_hwcap(&%(c)s)"),
     # This is an opaque type
-    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(gc, lg, &%(c)s, %(o)s)",   "Val_cpuid_policy_list(&%(c)s)"),    
+    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(gc, lg, &%(c)s, %(o)s)",   "Val_cpuid_policy_list(%(c)s)"),    
     }
 
 DEVICE_FUNCTIONS = [ ("add",            ["t", "domid", "unit"]),
@@ -420,11 +420,8 @@ if __name__ == '__main__':
     # Do not generate these yet.
     blacklist = [
         "cpupoolinfo",
-        "domain_create_info",
-        "domain_build_info",
         "domain_config",
         "vcpuinfo",
-        "event",
         ]
 
     for t in blacklist:
diff -r 21c5e58956d0 -r 5173d29f64fa tools/ocaml/libs/xl/xenlight_stubs.c
--- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
@@ -224,7 +224,7 @@ static int Bitmap_val(caml_gc *gc, struc
 	abort(); /* XXX */
 }
 
-static value Val_cpuid_policy_list(libxl_cpuid_policy_list *c_val)
+static value Val_cpuid_policy_list(libxl_cpuid_policy_list c_val)
 {
 	CAMLparam0();
 	/* An opaque pointer */
@@ -232,12 +232,13 @@ static value Val_cpuid_policy_list(libxl
 }
 
 static int Cpuid_policy_list_val(caml_gc *gc, struct caml_logger *lg,
-				 libxl_cpuid_policy_list **c_val, value v)
+				 libxl_cpuid_policy_list *c_val, value v)
 {
 	CAMLparam1(v);
 
 	/* An opaque pointer */
-	*c_val = (libxl_cpuid_policy_list*)v;
+	*c_val = (libxl_cpuid_policy_list)v;
+
 	CAMLreturn(0);
 }
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarXz-0001as-DS; Tue, 20 Nov 2012 17:23:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXx-0001Z4-KK; Tue, 20 Nov 2012 17:23:41 +0000
Received: from [85.158.137.99:15300] by server-8.bemta-3.messagelabs.com id
	77/84-07786-C9CBBA05; Tue, 20 Nov 2012 17:23:40 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353432216!14773161!3
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17353 invoked from network); 20 Nov 2012 17:23:39 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:39 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078855"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-Lr;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: f618acdeea1bf60b3b68da4062de018d8162fe8c
Message-ID: <f618acdeea1bf60b3b68.1353432206@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:26 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 06 of 15] libxl/ocaml: avoid reserved words in
 type and field names
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID f618acdeea1bf60b3b68da4062de018d8162fe8c
# Parent  b7e2cd4a03f278c9abfec0812c88234f7e493646
libxl/ocaml: avoid reserved words in type and field names.

Current just s/type/ty/ and there are no such fields (yet) so no
change to generated code.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r b7e2cd4a03f2 -r f618acdeea1b tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
@@ -70,8 +70,14 @@ def ocaml_type_of(ty):
     else:
         return ty.rawname
 
+def munge_name(name):
+    if name == "type":
+        return "ty"
+    else:
+        return name
+    
 def ocaml_instance_of(type, name):
-    return "%s : %s" % (name, ocaml_type_of(type))
+    return "%s : %s" % (munge_name(name), ocaml_type_of(type))
 
 def gen_ocaml_ml(ty, interface, indent=""):
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarY1-0001cX-Do; Tue, 20 Nov 2012 17:23:45 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXy-0001ZG-ME; Tue, 20 Nov 2012 17:23:42 +0000
Received: from [85.158.143.99:25298] by server-3.bemta-4.messagelabs.com id
	6A/65-06841-E9CBBA05; Tue, 20 Nov 2012 17:23:42 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1353432220!29778082!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n,
	ML_RADAR_SPEW_LINKS_18,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29508 invoked from network); 20 Nov 2012 17:23:41 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078860"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-Mt;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 21c5e58956d09437903e1ee1b0588d61a7c28145
Message-ID: <21c5e58956d09437903e.1353432208@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:28 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 08 of 15] libxl/ocaml: add some more builtin
	types
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID 21c5e58956d09437903e1ee1b0588d61a7c28145
# Parent  0cf342afa9e6b506fad68346cb3a1207030372eb
libxl/ocaml: add some more builtin types.

  * bitmaps
  * string_list
  * cpuid_policy_list (actually opaque)
  * key_value_list

None of these are used yet, so no change to the generated code.

Bitmap_val requires a ctx, so leave it as an abort for now.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 0cf342afa9e6 -r 21c5e58956d0 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
@@ -13,9 +13,13 @@ builtins = {
     "libxl_devid":          ("devid",                  "%(c)s = Int_val(%(o)s)",            "Val_int(%(c)s)"  ),
     "libxl_defbool":        ("bool option",            "%(c)s = Defbool_val(%(o)s)",        "Val_defbool(%(c)s)" ),
     "libxl_uuid":           ("int array",              "Uuid_val(gc, lg, &%(c)s, %(o)s)",   "Val_uuid(&%(c)s)"),
-    "libxl_key_value_list": ("(string * string) list", None,                                None),
+    "libxl_bitmap":         ("bool array",             "Bitmap_val(gc, lg, &%(c)s, %(o)s)",   "Val_bitmap(&%(c)s)"),    
+    "libxl_key_value_list": ("(string * string) list", "libxl_key_value_list_val(gc, lg, &%(c)s, %(o)s)",                              None),
+    "libxl_string_list":    ("string list",            "libxl_string_list_val(gc, lg, &%(c)s, %(o)s)",                                 "String_list_val(gc, lg, &%(c)s, %(o)s)"),
     "libxl_mac":            ("int array",              "Mac_val(gc, lg, &%(c)s, %(o)s)",    "Val_mac(&%(c)s)"),
     "libxl_hwcap":          ("int32 array",            None,                                "Val_hwcap(&%(c)s)"),
+    # This is an opaque type
+    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(gc, lg, &%(c)s, %(o)s)",   "Val_cpuid_policy_list(&%(c)s)"),    
     }
 
 DEVICE_FUNCTIONS = [ ("add",            ["t", "domid", "unit"]),
diff -r 0cf342afa9e6 -r 21c5e58956d0 tools/ocaml/libs/xl/xenlight.ml.in
--- a/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
@@ -18,6 +18,10 @@ exception Error of string
 type domid = int
 type devid = int
 
+module Cpuid_policy = struct
+	type t
+end
+
 (* @@LIBXL_TYPES@@ *)
 
 external send_trigger : domid -> trigger -> int -> unit = "stub_xl_send_trigger"
diff -r 0cf342afa9e6 -r 21c5e58956d0 tools/ocaml/libs/xl/xenlight_stubs.c
--- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
@@ -27,6 +27,7 @@
 #include <string.h>
 
 #include <libxl.h>
+#include <libxl_utils.h>
 
 struct caml_logger {
 	struct xentoollog_logger logger;
@@ -96,7 +97,6 @@ static void failwith_xl(char *fname, str
 	caml_raise_with_string(*caml_named_value("xl.error"), s);
 }
 
-#if 0 /* TODO: wrap libxl_domain_create(), these functions will be needed then */
 static void * gc_calloc(caml_gc *gc, size_t nmemb, size_t size)
 {
 	void *ptr;
@@ -107,28 +107,62 @@ static void * gc_calloc(caml_gc *gc, siz
 	return ptr;
 }
 
-static int string_string_tuple_array_val (caml_gc *gc, char ***c_val, value v)
+static int list_len(value v)
+{
+	int len = 0;
+	while ( v != Val_emptylist ) {
+		len++;
+		v = Field(v, 1);
+	}
+	return len;
+}
+
+static int libxl_key_value_list_val(caml_gc *gc, struct caml_logger *lg,
+				    libxl_key_value_list *c_val,
+				    value v)
 {
 	CAMLparam1(v);
-	CAMLlocal1(a);
-	int i;
-	char **array;
+	CAMLlocal1(elem);
+	int nr, i;
+	libxl_key_value_list array;
 
-	for (i = 0, a = Field(v, 5); a != Val_emptylist; a = Field(a, 1)) { i++; }
+	nr = list_len(v);
 
-	array = gc_calloc(gc, (i + 1) * 2, sizeof(char *));
+	array = gc_calloc(gc, (nr + 1) * 2, sizeof(char *));
 	if (!array)
-		return 1;
-	for (i = 0, a = Field(v, 5); a != Val_emptylist; a = Field(a, 1), i++) {
-		value b = Field(a, 0);
-		array[i * 2] = dup_String_val(gc, Field(b, 0));
-		array[i * 2 + 1] = dup_String_val(gc, Field(b, 1));
+		caml_raise_out_of_memory();
+
+	for (i=0; v != Val_emptylist; i++, v = Field(v, 1) ) {
+		elem = Field(v, 0);
+
+		array[i * 2] = dup_String_val(gc, Field(elem, 0));
+		array[i * 2 + 1] = dup_String_val(gc, Field(elem, 1));
 	}
+
 	*c_val = array;
 	CAMLreturn(0);
 }
 
-#endif
+static int libxl_string_list_val(caml_gc *gc, struct caml_logger *lg,
+				 libxl_string_list *c_val,
+				 value v)
+{
+	CAMLparam1(v);
+	int nr, i;
+	libxl_key_value_list array;
+
+	nr = list_len(v);
+
+	array = gc_calloc(gc, (nr + 1), sizeof(char *));
+	if (!array)
+		caml_raise_out_of_memory();
+
+	for (i=0; v != Val_emptylist; i++, v = Field(v, 1) )
+		array[i] = dup_String_val(gc, Field(v, 0));
+
+	*c_val = array;
+	CAMLreturn(0);
+}
 
 /* Option type support as per http://www.linux-nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php */
 #define Val_none Val_int(0)
@@ -168,6 +202,45 @@ static int Mac_val(caml_gc *gc, struct c
 	CAMLreturn(0);
 }
 
+static value Val_bitmap (libxl_bitmap *c_val)
+{
+	CAMLparam0();
+	CAMLlocal1(v);
+	int i;
+
+	v = caml_alloc(8 * (c_val->size), 0);
+	libxl_for_each_bit(i, *c_val) {
+		if (libxl_bitmap_test(c_val, i))
+			Store_field(v, i, Val_true);
+		else
+			Store_field(v, i, Val_false);
+	}
+	CAMLreturn(v);
+}
+
+static int Bitmap_val(caml_gc *gc, struct caml_logger *lg,
+		      libxl_bitmap *c_val, value v)
+{
+	abort(); /* XXX */
+}
+
+static value Val_cpuid_policy_list(libxl_cpuid_policy_list *c_val)
+{
+	CAMLparam0();
+	/* An opaque pointer */
+	CAMLreturn((value)c_val);
+}
+
+static int Cpuid_policy_list_val(caml_gc *gc, struct caml_logger *lg,
+				 libxl_cpuid_policy_list **c_val, value v)
+{
+	CAMLparam1(v);
+
+	/* An opaque pointer */
+	*c_val = (libxl_cpuid_policy_list*)v;
+	CAMLreturn(0);
+}
+
 static value Val_uuid (libxl_uuid *c_val)
 {
 	CAMLparam0();

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarY0-0001bv-MY; Tue, 20 Nov 2012 17:23:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXy-0001ZD-3K; Tue, 20 Nov 2012 17:23:42 +0000
Received: from [85.158.137.99:41346] by server-1.bemta-3.messagelabs.com id
	53/44-12169-D9CBBA05; Tue, 20 Nov 2012 17:23:41 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353432216!14773161!4
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17378 invoked from network); 20 Nov 2012 17:23:40 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:40 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078857"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-KL;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 739989dcd108c6dac61aa9c87be2a75feafb9871
Message-ID: <739989dcd108c6dac61a.1353432203@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:23 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 03 of 15] libxl: idl: Allow KeyedUnion members
	to be empty
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID 739989dcd108c6dac61aa9c87be2a75feafb9871
# Parent  8195cb0ebac691ae94e97939362f4d345891b4a7
libxl: idl: Allow KeyedUnion members to be empty

This is useful when the key enum has an "invalid" option and avoids
the need to declare a dummy struct. Use this for domain_build_info
resulting in the generated API changing like so:
    --- tools/libxl/_libxl_BACKUP_types.h
    +++ tools/libxl/_libxl_types.h
    @@ -377,8 +377,6 @@ typedef struct libxl_domain_build_info {
                 const char * features;
                 libxl_defbool e820_host;
             } pv;
    -        struct {
    -        } invalid;
         } u;
     } libxl_domain_build_info;
     void libxl_domain_build_info_dispose(libxl_domain_build_info *p);

+ a related change to the JSON generation.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 8195cb0ebac6 -r 739989dcd108 tools/libxl/gentest.py
--- a/tools/libxl/gentest.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/libxl/gentest.py	Tue Nov 20 17:22:21 2012 +0000
@@ -46,7 +46,8 @@ def gen_rand_init(ty, v, indent = "    "
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
-            s += gen_rand_init(f.type, fexpr, indent + "    ", nparent)
+            if f.type is not None:
+                s += gen_rand_init(f.type, fexpr, indent + "    ", nparent)
             s += "    break;\n"
         s += "}\n"
     elif isinstance(ty, idl.Struct) \
diff -r 8195cb0ebac6 -r 739989dcd108 tools/libxl/gentypes.py
--- a/tools/libxl/gentypes.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/libxl/gentypes.py	Tue Nov 20 17:22:21 2012 +0000
@@ -45,6 +45,8 @@ def libxl_C_type_define(ty, indent = "")
             s += "typedef %s %s {\n" % (ty.kind, ty.typename)
 
         for f in ty.fields:
+            if isinstance(ty, idl.KeyedUnion) and f.type is None: continue
+            
             x = libxl_C_instance_of(f.type, f.name)
             if f.const:
                 x = "const " + x
@@ -67,7 +69,8 @@ def libxl_C_type_dispose(ty, v, indent =
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
-            s += libxl_C_type_dispose(f.type, fexpr, indent + "    ", nparent)
+            if f.type is not None:
+                s += libxl_C_type_dispose(f.type, fexpr, indent + "    ", nparent)
             s += "    break;\n"
         s += "}\n"
     elif isinstance(ty, idl.Array):
@@ -115,7 +118,8 @@ def _libxl_C_type_init(ty, v, indent = "
             for f in ty.fields:
                 (nparent,fexpr) = ty.member(v, f, parent is None)
                 s += "case %s:\n" % f.enumname
-                s += _libxl_C_type_init(f.type, fexpr, "    ", nparent)
+                if f.type is not None:
+                    s += _libxl_C_type_init(f.type, fexpr, "    ", nparent)
                 s += "    break;\n"
             s += "}\n"
         else:
@@ -214,7 +218,8 @@ def libxl_C_type_gen_json(ty, v, indent 
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
-            s += libxl_C_type_gen_json(f.type, fexpr, indent + "    ", nparent)
+            if f.type is not None:
+                s += libxl_C_type_gen_json(f.type, fexpr, indent + "    ", nparent)
             s += "    break;\n"
         s += "}\n"
     elif isinstance(ty, idl.Struct) and (parent is None or ty.json_fn is None):
diff -r 8195cb0ebac6 -r 739989dcd108 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:21 2012 +0000
@@ -338,7 +338,7 @@ libxl_domain_build_info = Struct("domain
                                       # Use host's E820 for PCI passthrough.
                                       ("e820_host", libxl_defbool),
                                       ])),
-                 ("invalid", Struct(None, [])),
+                 ("invalid", None),
                  ], keyvar_init_val = "LIBXL_DOMAIN_TYPE_INVALID")),
     ], dir=DIR_IN
 )

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarY0-0001bg-AT; Tue, 20 Nov 2012 17:23:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXy-0001ZG-2h; Tue, 20 Nov 2012 17:23:42 +0000
Received: from [85.158.143.99:56816] by server-3.bemta-4.messagelabs.com id
	47/65-06841-D9CBBA05; Tue, 20 Nov 2012 17:23:41 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1353432218!25420593!2
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24493 invoked from network); 20 Nov 2012 17:23:40 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:40 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078858"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-NO;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 5173d29f64fa541f6ec0c48481c4957a03f0302c
Message-ID: <5173d29f64fa541f6ec0.1353432209@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:29 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 09 of 15] libxl/ocaml: add
 domain_build/create_info and events to the bindings
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID 5173d29f64fa541f6ec0c48481c4957a03f0302c
# Parent  21c5e58956d09437903e1ee1b0588d61a7c28145
libxl/ocaml: add domain_build/create_info and events to the bindings.

We now have enoguh infrastructure in place to do this trivially.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 21c5e58956d0 -r 5173d29f64fa tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
@@ -19,7 +19,7 @@ builtins = {
     "libxl_mac":            ("int array",              "Mac_val(gc, lg, &%(c)s, %(o)s)",    "Val_mac(&%(c)s)"),
     "libxl_hwcap":          ("int32 array",            None,                                "Val_hwcap(&%(c)s)"),
     # This is an opaque type
-    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(gc, lg, &%(c)s, %(o)s)",   "Val_cpuid_policy_list(&%(c)s)"),    
+    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(gc, lg, &%(c)s, %(o)s)",   "Val_cpuid_policy_list(%(c)s)"),    
     }
 
 DEVICE_FUNCTIONS = [ ("add",            ["t", "domid", "unit"]),
@@ -420,11 +420,8 @@ if __name__ == '__main__':
     # Do not generate these yet.
     blacklist = [
         "cpupoolinfo",
-        "domain_create_info",
-        "domain_build_info",
         "domain_config",
         "vcpuinfo",
-        "event",
         ]
 
     for t in blacklist:
diff -r 21c5e58956d0 -r 5173d29f64fa tools/ocaml/libs/xl/xenlight_stubs.c
--- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
@@ -224,7 +224,7 @@ static int Bitmap_val(caml_gc *gc, struc
 	abort(); /* XXX */
 }
 
-static value Val_cpuid_policy_list(libxl_cpuid_policy_list *c_val)
+static value Val_cpuid_policy_list(libxl_cpuid_policy_list c_val)
 {
 	CAMLparam0();
 	/* An opaque pointer */
@@ -232,12 +232,13 @@ static value Val_cpuid_policy_list(libxl
 }
 
 static int Cpuid_policy_list_val(caml_gc *gc, struct caml_logger *lg,
-				 libxl_cpuid_policy_list **c_val, value v)
+				 libxl_cpuid_policy_list *c_val, value v)
 {
 	CAMLparam1(v);
 
 	/* An opaque pointer */
-	*c_val = (libxl_cpuid_policy_list*)v;
+	*c_val = (libxl_cpuid_policy_list)v;
+
 	CAMLreturn(0);
 }
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarXz-0001as-DS; Tue, 20 Nov 2012 17:23:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXx-0001Z4-KK; Tue, 20 Nov 2012 17:23:41 +0000
Received: from [85.158.137.99:15300] by server-8.bemta-3.messagelabs.com id
	77/84-07786-C9CBBA05; Tue, 20 Nov 2012 17:23:40 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353432216!14773161!3
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17353 invoked from network); 20 Nov 2012 17:23:39 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:39 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078855"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-Lr;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: f618acdeea1bf60b3b68da4062de018d8162fe8c
Message-ID: <f618acdeea1bf60b3b68.1353432206@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:26 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 06 of 15] libxl/ocaml: avoid reserved words in
 type and field names
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID f618acdeea1bf60b3b68da4062de018d8162fe8c
# Parent  b7e2cd4a03f278c9abfec0812c88234f7e493646
libxl/ocaml: avoid reserved words in type and field names.

Current just s/type/ty/ and there are no such fields (yet) so no
change to generated code.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r b7e2cd4a03f2 -r f618acdeea1b tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
@@ -70,8 +70,14 @@ def ocaml_type_of(ty):
     else:
         return ty.rawname
 
+def munge_name(name):
+    if name == "type":
+        return "ty"
+    else:
+        return name
+    
 def ocaml_instance_of(type, name):
-    return "%s : %s" % (name, ocaml_type_of(type))
+    return "%s : %s" % (munge_name(name), ocaml_type_of(type))
 
 def gen_ocaml_ml(ty, interface, indent=""):
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:23:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:23:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TarY0-0001bv-MY; Tue, 20 Nov 2012 17:23:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TarXy-0001ZD-3K; Tue, 20 Nov 2012 17:23:42 +0000
Received: from [85.158.137.99:41346] by server-1.bemta-3.messagelabs.com id
	53/44-12169-D9CBBA05; Tue, 20 Nov 2012 17:23:41 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353432216!14773161!4
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17378 invoked from network); 20 Nov 2012 17:23:40 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:23:40 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215078857"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:23:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:23:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-KL;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 739989dcd108c6dac61aa9c87be2a75feafb9871
Message-ID: <739989dcd108c6dac61a.1353432203@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:23 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 03 of 15] libxl: idl: Allow KeyedUnion members
	to be empty
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID 739989dcd108c6dac61aa9c87be2a75feafb9871
# Parent  8195cb0ebac691ae94e97939362f4d345891b4a7
libxl: idl: Allow KeyedUnion members to be empty

This is useful when the key enum has an "invalid" option and avoids
the need to declare a dummy struct. Use this for domain_build_info
resulting in the generated API changing like so:
    --- tools/libxl/_libxl_BACKUP_types.h
    +++ tools/libxl/_libxl_types.h
    @@ -377,8 +377,6 @@ typedef struct libxl_domain_build_info {
                 const char * features;
                 libxl_defbool e820_host;
             } pv;
    -        struct {
    -        } invalid;
         } u;
     } libxl_domain_build_info;
     void libxl_domain_build_info_dispose(libxl_domain_build_info *p);

+ a related change to the JSON generation.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 8195cb0ebac6 -r 739989dcd108 tools/libxl/gentest.py
--- a/tools/libxl/gentest.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/libxl/gentest.py	Tue Nov 20 17:22:21 2012 +0000
@@ -46,7 +46,8 @@ def gen_rand_init(ty, v, indent = "    "
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
-            s += gen_rand_init(f.type, fexpr, indent + "    ", nparent)
+            if f.type is not None:
+                s += gen_rand_init(f.type, fexpr, indent + "    ", nparent)
             s += "    break;\n"
         s += "}\n"
     elif isinstance(ty, idl.Struct) \
diff -r 8195cb0ebac6 -r 739989dcd108 tools/libxl/gentypes.py
--- a/tools/libxl/gentypes.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/libxl/gentypes.py	Tue Nov 20 17:22:21 2012 +0000
@@ -45,6 +45,8 @@ def libxl_C_type_define(ty, indent = "")
             s += "typedef %s %s {\n" % (ty.kind, ty.typename)
 
         for f in ty.fields:
+            if isinstance(ty, idl.KeyedUnion) and f.type is None: continue
+            
             x = libxl_C_instance_of(f.type, f.name)
             if f.const:
                 x = "const " + x
@@ -67,7 +69,8 @@ def libxl_C_type_dispose(ty, v, indent =
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
-            s += libxl_C_type_dispose(f.type, fexpr, indent + "    ", nparent)
+            if f.type is not None:
+                s += libxl_C_type_dispose(f.type, fexpr, indent + "    ", nparent)
             s += "    break;\n"
         s += "}\n"
     elif isinstance(ty, idl.Array):
@@ -115,7 +118,8 @@ def _libxl_C_type_init(ty, v, indent = "
             for f in ty.fields:
                 (nparent,fexpr) = ty.member(v, f, parent is None)
                 s += "case %s:\n" % f.enumname
-                s += _libxl_C_type_init(f.type, fexpr, "    ", nparent)
+                if f.type is not None:
+                    s += _libxl_C_type_init(f.type, fexpr, "    ", nparent)
                 s += "    break;\n"
             s += "}\n"
         else:
@@ -214,7 +218,8 @@ def libxl_C_type_gen_json(ty, v, indent 
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
-            s += libxl_C_type_gen_json(f.type, fexpr, indent + "    ", nparent)
+            if f.type is not None:
+                s += libxl_C_type_gen_json(f.type, fexpr, indent + "    ", nparent)
             s += "    break;\n"
         s += "}\n"
     elif isinstance(ty, idl.Struct) and (parent is None or ty.json_fn is None):
diff -r 8195cb0ebac6 -r 739989dcd108 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:21 2012 +0000
@@ -338,7 +338,7 @@ libxl_domain_build_info = Struct("domain
                                       # Use host's E820 for PCI passthrough.
                                       ("e820_host", libxl_defbool),
                                       ])),
-                 ("invalid", Struct(None, [])),
+                 ("invalid", None),
                  ], keyvar_init_val = "LIBXL_DOMAIN_TYPE_INVALID")),
     ], dir=DIR_IN
 )

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:26:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:26:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tarak-0003Vj-WB; Tue, 20 Nov 2012 17:26:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1Taraj-0003Uy-SC
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:26:34 +0000
Received: from [85.158.138.51:50667] by server-9.bemta-3.messagelabs.com id
	2C/A6-02388-74DBBA05; Tue, 20 Nov 2012 17:26:31 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-174.messagelabs.com!1353432390!30797107!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8100 invoked from network); 20 Nov 2012 17:26:30 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-11.tower-174.messagelabs.com with SMTP;
	20 Nov 2012 17:26:30 -0000
X-TM-IMSS-Message-ID: <9d85587c000c198e@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9d85587c000c198e ;
	Tue, 20 Nov 2012 12:25:54 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKHQRru014360; 
	Tue, 20 Nov 2012 12:26:27 -0500
Message-ID: <50ABBD43.5040302@tycho.nsa.gov>
Date: Tue, 20 Nov 2012 12:26:27 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-3-git-send-email-dgdegra@tycho.nsa.gov>
	<1353322019.18229.35.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353322019.18229.35.camel@zakaz.uk.xensource.com>
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 02/19] flask/policy: Add domain relabel
	example
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/19/2012 05:46 AM, Ian Campbell wrote:
> On Fri, 2012-11-16 at 18:28 +0000, Daniel De Graaf wrote:
>> This adds the nomigrate_t type to the example FLASK policy which allows
>> domains to be created that dom0 cannot access after building.
> 
> This is a very cool example of how even dom0's privileges can be
> curtailed, I like it!
> 
> The fact that the domain can't be migrated is more of a side-effect
> though I guess, but I can't really think of a better name (e.g.
> "securedom_t" suggests other domains aren't etc...)

Especially as I have already used some of the other choices (protected,
isolated) for other examples. The inability to migrate actually sums up
the protection this provides: since the only reason dom0 has to read a
domain's memory is to migrate it, preventing migration should (in theory)
prevent that access.

> I'd ack it but this stuff is all Greek to me ;-)

FLASK policies in general tend to be hard to read, especially since using
the M4 macros is almost required to make a sane policy. There is some work
at making a higher-level language for SELinux policy definition, so that
can be applied to Xen at some point. Using sesearch on the Xen policy can
also be useful to see what the result of the definitions is.

>>
>> Example domain configuration snippet:
>>   seclabel='customer_1:vm_r:nomigrate_t'
>>   init_seclabel='customer_1:vm_r:nomigrate_t_building'
>>
>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> ---
>>  docs/misc/xsm-flask.txt                      |  2 +
>>  tools/flask/policy/policy/modules/xen/xen.if | 56 +++++++++++++++++++++-------
>>  tools/flask/policy/policy/modules/xen/xen.te | 10 +++++
>>  3 files changed, 55 insertions(+), 13 deletions(-)
>>
>> diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
>> index 6b0d327..0778a28 100644
>> --- a/docs/misc/xsm-flask.txt
>> +++ b/docs/misc/xsm-flask.txt
>> @@ -60,6 +60,8 @@ that can be used without dom0 disaggregation. The main types for domUs are:
>>   - domU_t is a domain that can communicate with any other domU_t
>>   - isolated_domU_t can only communicate with dom0
>>   - prot_domU_t is a domain type whose creation can be disabled with a boolean
>> + - nomigrate_t is a domain that must be created via the nomigrate_t_building
>> +   type, and whose memory cannot be read by dom0 once created
>>  
>>  HVM domains with stubdomain device models use two types (one per domain):
>>   - domHVM_t is an HVM domain that uses a stubdomain device model

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:26:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:26:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tarak-0003Vj-WB; Tue, 20 Nov 2012 17:26:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1Taraj-0003Uy-SC
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:26:34 +0000
Received: from [85.158.138.51:50667] by server-9.bemta-3.messagelabs.com id
	2C/A6-02388-74DBBA05; Tue, 20 Nov 2012 17:26:31 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-174.messagelabs.com!1353432390!30797107!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8100 invoked from network); 20 Nov 2012 17:26:30 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-11.tower-174.messagelabs.com with SMTP;
	20 Nov 2012 17:26:30 -0000
X-TM-IMSS-Message-ID: <9d85587c000c198e@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9d85587c000c198e ;
	Tue, 20 Nov 2012 12:25:54 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKHQRru014360; 
	Tue, 20 Nov 2012 12:26:27 -0500
Message-ID: <50ABBD43.5040302@tycho.nsa.gov>
Date: Tue, 20 Nov 2012 12:26:27 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1353090514-18537-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353090514-18537-3-git-send-email-dgdegra@tycho.nsa.gov>
	<1353322019.18229.35.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353322019.18229.35.camel@zakaz.uk.xensource.com>
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 02/19] flask/policy: Add domain relabel
	example
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/19/2012 05:46 AM, Ian Campbell wrote:
> On Fri, 2012-11-16 at 18:28 +0000, Daniel De Graaf wrote:
>> This adds the nomigrate_t type to the example FLASK policy which allows
>> domains to be created that dom0 cannot access after building.
> 
> This is a very cool example of how even dom0's privileges can be
> curtailed, I like it!
> 
> The fact that the domain can't be migrated is more of a side-effect
> though I guess, but I can't really think of a better name (e.g.
> "securedom_t" suggests other domains aren't etc...)

Especially as I have already used some of the other choices (protected,
isolated) for other examples. The inability to migrate actually sums up
the protection this provides: since the only reason dom0 has to read a
domain's memory is to migrate it, preventing migration should (in theory)
prevent that access.

> I'd ack it but this stuff is all Greek to me ;-)

FLASK policies in general tend to be hard to read, especially since using
the M4 macros is almost required to make a sane policy. There is some work
at making a higher-level language for SELinux policy definition, so that
can be applied to Xen at some point. Using sesearch on the Xen policy can
also be useful to see what the result of the definitions is.

>>
>> Example domain configuration snippet:
>>   seclabel='customer_1:vm_r:nomigrate_t'
>>   init_seclabel='customer_1:vm_r:nomigrate_t_building'
>>
>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> ---
>>  docs/misc/xsm-flask.txt                      |  2 +
>>  tools/flask/policy/policy/modules/xen/xen.if | 56 +++++++++++++++++++++-------
>>  tools/flask/policy/policy/modules/xen/xen.te | 10 +++++
>>  3 files changed, 55 insertions(+), 13 deletions(-)
>>
>> diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
>> index 6b0d327..0778a28 100644
>> --- a/docs/misc/xsm-flask.txt
>> +++ b/docs/misc/xsm-flask.txt
>> @@ -60,6 +60,8 @@ that can be used without dom0 disaggregation. The main types for domUs are:
>>   - domU_t is a domain that can communicate with any other domU_t
>>   - isolated_domU_t can only communicate with dom0
>>   - prot_domU_t is a domain type whose creation can be disabled with a boolean
>> + - nomigrate_t is a domain that must be created via the nomigrate_t_building
>> +   type, and whose memory cannot be read by dom0 once created
>>  
>>  HVM domains with stubdomain device models use two types (one per domain):
>>   - domHVM_t is an HVM domain that uses a stubdomain device model

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:44:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tarrg-0004av-RY; Tue, 20 Nov 2012 17:44:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1Tarrf-0004aj-Kw
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:44:03 +0000
Received: from [85.158.138.51:57227] by server-13.bemta-3.messagelabs.com id
	C6/18-24887-261CBA05; Tue, 20 Nov 2012 17:44:02 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353433441!28888728!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21764 invoked from network); 20 Nov 2012 17:44:02 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-15.tower-174.messagelabs.com with SMTP;
	20 Nov 2012 17:44:02 -0000
X-TM-IMSS-Message-ID: <0ddbd7240000ef85@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 0ddbd7240000ef85 ;
	Tue, 20 Nov 2012 09:55:08 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKEpd9S028173; 
	Tue, 20 Nov 2012 09:51:39 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Tue, 20 Nov 2012 09:51:33 -0500
Message-Id: <1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <50AA5521.6080907@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
Cc: keir@xen.org, ian.campbell@citrix.com, JBeulich@suse.com,
	xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH RFC 0/5] XSM hook renames and cleanup
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

These patches clean up some of the XSM code that caused difficulty with
ctags, and changes hook names to show the default action of the hook.
They apply on top of my XSM patch series v5, and if they help increase
readability, will be integrated into the next version of that series.

Resending due to the mail issues - apparently only one message got
through to the list last time.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:44:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tarrg-0004av-RY; Tue, 20 Nov 2012 17:44:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1Tarrf-0004aj-Kw
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:44:03 +0000
Received: from [85.158.138.51:57227] by server-13.bemta-3.messagelabs.com id
	C6/18-24887-261CBA05; Tue, 20 Nov 2012 17:44:02 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353433441!28888728!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21764 invoked from network); 20 Nov 2012 17:44:02 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-15.tower-174.messagelabs.com with SMTP;
	20 Nov 2012 17:44:02 -0000
X-TM-IMSS-Message-ID: <0ddbd7240000ef85@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 0ddbd7240000ef85 ;
	Tue, 20 Nov 2012 09:55:08 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKEpd9S028173; 
	Tue, 20 Nov 2012 09:51:39 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: tim@xen.org
Date: Tue, 20 Nov 2012 09:51:33 -0500
Message-Id: <1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <50AA5521.6080907@tycho.nsa.gov>
References: <50AA5521.6080907@tycho.nsa.gov>
Cc: keir@xen.org, ian.campbell@citrix.com, JBeulich@suse.com,
	xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH RFC 0/5] XSM hook renames and cleanup
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

These patches clean up some of the XSM code that caused difficulty with
ctags, and changes hook names to show the default action of the hook.
They apply on top of my XSM patch series v5, and if they help increase
readability, will be integrated into the next version of that series.

Resending due to the mail issues - apparently only one message got
through to the list last time.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:46:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:46:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tartb-0004oC-Bp; Tue, 20 Nov 2012 17:46:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TartZ-0004nz-Nd
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:46:02 +0000
Received: from [85.158.138.51:5077] by server-15.bemta-3.messagelabs.com id
	74/44-09445-4D1CBA05; Tue, 20 Nov 2012 17:45:56 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-3.tower-174.messagelabs.com!1353433555!22716518!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12925 invoked from network); 20 Nov 2012 17:45:55 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-3.tower-174.messagelabs.com with SMTP;
	20 Nov 2012 17:45:55 -0000
X-TM-IMSS-Message-ID: <0010513b00000370@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 0010513b00000370 ;
	Tue, 20 Nov 2012 10:38:26 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKFYldJ031316; 
	Tue, 20 Nov 2012 10:34:47 -0500
Message-ID: <50ABA317.70300@tycho.nsa.gov>
Date: Tue, 20 Nov 2012 10:34:47 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353423098-16371-4-git-send-email-dgdegra@tycho.nsa.gov>
	<50ABAF1302000078000AA0D5@nat28.tlf.novell.com>
In-Reply-To: <50ABAF1302000078000AA0D5@nat28.tlf.novell.com>
Cc: tim@xen.org, keir@xen.org, ian.campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 3/5] xen: sysctl XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/20/2012 10:25 AM, Jan Beulich wrote:
>>>> On 20.11.12 at 15:51, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>> A number of the sysctl XSM hooks have no parameters or only pass the
>> operation ID, making them redundant with the xsm_sysctl hook. Remove
>> these redundant hooks.
>>
>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> ---
>>  xen/arch/x86/platform_hypercall.c |  12 ----
> 
> This is slightly confusing given the title/description.
> 
> Jan
> 

There were a few hooks used in both sysctl and platform_hypercall, so this
was needed to avoid breaking the compile. I'll delay their removal until the
next patch in order to keep the changes confined to a single file, which was
my original goal.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:46:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:46:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tartb-0004oC-Bp; Tue, 20 Nov 2012 17:46:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TartZ-0004nz-Nd
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:46:02 +0000
Received: from [85.158.138.51:5077] by server-15.bemta-3.messagelabs.com id
	74/44-09445-4D1CBA05; Tue, 20 Nov 2012 17:45:56 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-3.tower-174.messagelabs.com!1353433555!22716518!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12925 invoked from network); 20 Nov 2012 17:45:55 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-3.tower-174.messagelabs.com with SMTP;
	20 Nov 2012 17:45:55 -0000
X-TM-IMSS-Message-ID: <0010513b00000370@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 0010513b00000370 ;
	Tue, 20 Nov 2012 10:38:26 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKFYldJ031316; 
	Tue, 20 Nov 2012 10:34:47 -0500
Message-ID: <50ABA317.70300@tycho.nsa.gov>
Date: Tue, 20 Nov 2012 10:34:47 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353423098-16371-4-git-send-email-dgdegra@tycho.nsa.gov>
	<50ABAF1302000078000AA0D5@nat28.tlf.novell.com>
In-Reply-To: <50ABAF1302000078000AA0D5@nat28.tlf.novell.com>
Cc: tim@xen.org, keir@xen.org, ian.campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 3/5] xen: sysctl XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/20/2012 10:25 AM, Jan Beulich wrote:
>>>> On 20.11.12 at 15:51, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>> A number of the sysctl XSM hooks have no parameters or only pass the
>> operation ID, making them redundant with the xsm_sysctl hook. Remove
>> these redundant hooks.
>>
>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> ---
>>  xen/arch/x86/platform_hypercall.c |  12 ----
> 
> This is slightly confusing given the title/description.
> 
> Jan
> 

There were a few hooks used in both sysctl and platform_hypercall, so this
was needed to avoid breaking the compile. I'll delay their removal until the
next patch in order to keep the changes confined to a single file, which was
my original goal.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:46:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:46:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tartr-0004vQ-Nu; Tue, 20 Nov 2012 17:46:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Tarto-0004qi-6E; Tue, 20 Nov 2012 17:46:16 +0000
Received: from [85.158.138.51:5846] by server-13.bemta-3.messagelabs.com id
	1E/AA-24887-7E1CBA05; Tue, 20 Nov 2012 17:46:15 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353433568!30872360!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30011 invoked from network); 20 Nov 2012 17:46:10 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:46:10 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215082601"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:46:08 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:46:08 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-PJ;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: c8d22bfef298ce525c98b5a3f0c394068ab01572
Message-ID: <c8d22bfef298ce525c98.1353432213@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:33 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 13 of 15] libxl: ocaml: propagate the libxl
 return error code in exceptions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID c8d22bfef298ce525c98b5a3f0c394068ab01572
# Parent  e4525795eac22c7d199ceae8714e95ed660a00c4
libxl: ocaml: propagate the libxl return error code in exceptions

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
@@ -228,7 +228,7 @@ def c_val(ty, c, o, indent="", parent = 
         for e in ty.values:
             s += "    case %d: *%s = %s; break;\n" % (n, c, e.name)
             n += 1
-        s += "    default: failwith_xl(\"cannot convert value to %s\"); break;\n" % ty.typename
+        s += "    default: failwith_xl(ERROR_FAIL, \"cannot convert value to %s\"); break;\n" % ty.typename
         s += "}"
     elif isinstance(ty, idl.KeyedUnion):
         s += "{\n"
@@ -241,7 +241,7 @@ def c_val(ty, c, o, indent="", parent = 
                                                     parent + ty.keyvar.name,
                                                     f.enumname)
             n += 1
-        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (long)\"); break;\n" % (parent, ty.keyvar.name)        
+        s += "\t\t    default: failwith_xl(ERROR_FAIL, \"variant handling bug %s%s (long)\"); break;\n" % (parent, ty.keyvar.name)        
         s += "\t\t}\n"
         s += "\t} else {\n"
         s += "\t\t/* Is block... */\n"
@@ -257,7 +257,7 @@ def c_val(ty, c, o, indent="", parent = 
                 s += "%s" % c_val(f.type, fexpr, o, indent=indent+"\t\t        ")
                 s += "break;\n"
             n += 1
-        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (block)\"); break;\n" % (parent, ty.keyvar.name)
+        s += "\t\t    default: failwith_xl(ERROR_FAIL, \"variant handling bug %s%s (block)\"); break;\n" % (parent, ty.keyvar.name)
         s += "\t\t}\n"
         s += "\t}\n"
         s += "}"
@@ -326,7 +326,7 @@ def ocaml_Val(ty, o, c, indent="", paren
         for e in ty.values:
             s += "    case %s: %s = Int_val(%d); break;\n" % (e.name, o, n)
             n += 1
-        s += "    default: failwith_xl(\"cannot convert value from %s\"); break;\n" % ty.typename
+        s += "    default: failwith_xl(ERROR_FAIL, \"cannot convert value from %s\"); break;\n" % ty.typename
         s += "}"
     elif isinstance(ty, idl.KeyedUnion):
         n = 0
@@ -347,7 +347,7 @@ def ocaml_Val(ty, o, c, indent="", paren
                 #s += "\t        %s = caml_alloc(%d,%d);\n" % (o,len(f.type.fields),n)
             s += "\t        break;\n"
             n += 1
-        s += "\t    default: failwith_xl(\"cannot convert value from %s\"); break;\n" % ty.typename
+        s += "\t    default: failwith_xl(ERROR_FAIL, \"cannot convert value from %s\"); break;\n" % ty.typename
         s += "\t}"
     elif isinstance(ty,idl.Aggregate) and (parent is None or ty.rawname is None):
         s += "{\n"
diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/libs/xl/xenlight.ml.in
--- a/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
@@ -15,7 +15,47 @@
 
 open Xentoollog
 
-exception Error of string
+type error = 
+    Nonspecific |
+    Version |
+    Fail |
+    Ni |
+    Nomem |
+    Inval |
+    Badfail |
+    Guest_Timedout |
+    Timedout |
+    Noparavirt |
+    Not_Ready |
+    Osevent_Reg_Fail |
+    Bufferfull |
+    Unknown_Child
+
+let string_of_error error =
+  match error with
+  | Nonspecific -> "Non specific"
+  | Version -> "Version"
+  | Fail -> "Fail"
+  | Ni -> "Ni"
+  | Nomem -> "Nomem"
+  | Inval -> "Inval"
+  | Badfail -> "Badfail"
+  | Guest_Timedout -> "Guest Timedout"
+  | Timedout -> "Timedout"
+  | Noparavirt -> "Noparavirt"
+  | Not_Ready -> "Not Ready"
+  | Osevent_Reg_Fail -> "Osevent Reg Fail"
+  | Bufferfull -> "Bufferfull"
+  | Unknown_Child -> "Unknown Child"
+
+exception Error of (error * string)
+
+type ctx
+
+external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
+external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
+
+external test_raise_exception: unit -> unit = "stub_raise_exception"
 
 type domid = int
 type devid = int
@@ -26,15 +66,10 @@ end
 
 (* @@LIBXL_TYPES@@ *)
 
-type ctx
-
-external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
-external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
-
 external list_domain: ctx -> Dominfo.t list = "stub_libxl_list_domain"
 
 external send_trigger : domid -> trigger -> int -> unit = "stub_xl_send_trigger"
 external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
 external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
 
-let _ = Callback.register_exception "Xenlight.Error" (Error(""))
+let _ = Callback.register_exception "Xenlight.Error" (Error(Fail, ""))
diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/libs/xl/xenlight.mli.in
--- a/tools/ocaml/libs/xl/xenlight.mli.in	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight.mli.in	Tue Nov 20 17:22:21 2012 +0000
@@ -15,7 +15,32 @@
 
 open Xentoollog
 
-exception Error of string
+type error = 
+    Nonspecific |
+    Version |
+    Fail |
+    Ni |
+    Nomem |
+    Inval |
+    Badfail |
+    Guest_Timedout |
+    Timedout |
+    Noparavirt |
+    Not_Ready |
+    Osevent_Reg_Fail |
+    Bufferfull |
+    Unknown_Child
+
+val string_of_error: error -> string
+
+exception Error of (error * string)
+
+type ctx
+
+external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
+external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
+
+external test_raise_exception: unit = "stub_raise_exception"
 
 type domid = int
 type devid = int
@@ -24,9 +49,6 @@ type devid = int
 
 type ctx
 
-external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
-external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
-
 external list_domain: ctx -> Dominfo.t list = "stub_libxl_list_domain"
 
 external send_trigger : domid -> trigger -> int -> unit = "stub_xl_send_trigger"
diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/libs/xl/xenlight_stubs.c
--- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
@@ -43,12 +43,54 @@ static char * dup_String_val(value s)
 	return c;
 }
 
-static void failwith_xl(char *fname)
+static value Val_error(int error)
 {
+	switch (error) {
+	case ERROR_NONSPECIFIC: return Val_int(0);
+	case ERROR_VERSION:     return Val_int(1);
+	case ERROR_FAIL:        return Val_int(2);
+	case ERROR_NI:          return Val_int(3);
+	case ERROR_NOMEM:       return Val_int(4);
+	case ERROR_INVAL:       return Val_int(5);
+	case ERROR_BADFAIL:     return Val_int(6);
+	case ERROR_GUEST_TIMEDOUT: return Val_int(7);
+	case ERROR_TIMEDOUT:    return Val_int(8);
+	case ERROR_NOPARAVIRT:  return Val_int(9);
+	case ERROR_NOT_READY:   return Val_int(10);
+	case ERROR_OSEVENT_REG_FAIL: return Val_int(11);
+	case ERROR_BUFFERFULL:  return Val_int(12);
+	case ERROR_UNKNOWN_CHILD: return Val_int(13);
+#if 0 /* Let the compiler catch this */
+	default:
+		caml_raise_sys_error(caml_copy_string("Unknown libxl ERROR"));
+		break;
+#endif
+	}
+	/* Should not reach here */
+	abort();
+}
+
+static void failwith_xl(int error, char *fname)
+{
+	CAMLlocal1(arg);
 	value *exc = caml_named_value("Xenlight.Error");
+
 	if (!exc)
 		caml_invalid_argument("Exception Xenlight.Error not initialized, please link xl.cma");
-	caml_raise_with_string(*exc, fname);
+
+	arg = caml_alloc_small(2, 0);
+
+	Field(arg, 0) = Val_error(error);
+	Field(arg, 1) = caml_copy_string(fname);
+
+	caml_raise_with_arg(*exc, arg);
+}
+
+CAMLprim value stub_raise_exception(value unit)
+{
+	CAMLparam1(unit);
+	failwith_xl(ERROR_FAIL, "test exception");
+	CAMLreturn(Val_unit);
 }
 
 CAMLprim value stub_libxl_ctx_alloc(value logger)
@@ -60,7 +102,7 @@ CAMLprim value stub_libxl_ctx_alloc(valu
 	caml_enter_blocking_section();
 	ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct xentoollog_logger *) logger);
 	if (ret != 0) \
-		failwith_xl("cannot init context");
+		failwith_xl(ERROR_FAIL, "cannot init context");
 	caml_leave_blocking_section();
 	CAMLreturn((value)ctx);
 }
@@ -190,7 +232,7 @@ static int Bitmap_val(libxl_ctx *ctx, li
 	int i, len = Wosize_val(v);
 
 	if (!libxl_bitmap_alloc(ctx, c_val, len))
-		failwith_xl("cannot allocate bitmap");
+		failwith_xl(ERROR_NOMEM, "cannot allocate bitmap");
 	for (i=0; i<len; i++) {
 		if (Int_val(Field(v, i)))
 			libxl_bitmap_set(c_val, i);
@@ -295,7 +337,7 @@ value stub_libxl_list_domain(value ctx)
 
 	info = libxl_list_domain(CTX, &nr);
 	if (info == NULL)
-		failwith_xl("list_domain");
+		failwith_xl(ERROR_FAIL, "list_domain");
 
 	cli = Val_emptylist;
 
@@ -332,7 +374,7 @@ value stub_xl_device_##type##_##op(value
 	libxl_device_##type##_dispose(&c_info);				\
 									\
 	if (ret != 0)							\
-		failwith_xl(STRINGIFY(type) "_" STRINGIFY(op));		\
+		failwith_xl(ret, STRINGIFY(type) "_" STRINGIFY(op));	\
 									\
 	CAMLreturn(Val_unit);						\
 }
@@ -358,7 +400,7 @@ value stub_xl_physinfo_get(value ctx)
 	ret = libxl_get_physinfo(CTX, &c_physinfo);
 
 	if (ret != 0)
-		failwith_xl("get_physinfo");
+		failwith_xl(ret, "get_physinfo");
 
 	physinfo = Val_physinfo(CTX, &c_physinfo);
 
@@ -377,7 +419,7 @@ value stub_xl_cputopology_get(value ctx)
 	c_topology = libxl_get_cpu_topology(CTX, &nr);
 
 	if (!c_topology)
-		failwith_xl("topologyinfo");
+		failwith_xl(ERROR_FAIL, "get_cpu_topologyinfo");
 
 	topology = caml_alloc_tuple(nr);
 	for (i = 0; i < nr; i++) {
@@ -402,7 +444,7 @@ value stub_xl_domain_sched_params_get(va
 
 	ret = libxl_domain_sched_params_get(CTX, Int_val(domid), &c_scinfo);
 	if (ret != 0)
-		failwith_xl("domain_sched_params_get");
+		failwith_xl(ret, "domain_sched_params_get");
 
 	scinfo = Val_domain_sched_params(CTX, &c_scinfo);
 
@@ -424,7 +466,7 @@ value stub_xl_domain_sched_params_set(va
 	libxl_domain_sched_params_dispose(&c_scinfo);
 
 	if (ret != 0)
-		failwith_xl("domain_sched_params_set");
+		failwith_xl(ret, "domain_sched_params_set");
 
 	CAMLreturn(Val_unit);
 }
@@ -441,7 +483,7 @@ value stub_xl_send_trigger(value ctx, va
 				 c_trigger, Int_val(vcpuid));
 
 	if (ret != 0)
-		failwith_xl("send_trigger");
+		failwith_xl(ret, "send_trigger");
 
 	CAMLreturn(Val_unit);
 }
@@ -454,7 +496,7 @@ value stub_xl_send_sysrq(value ctx, valu
 	ret = libxl_send_sysrq(CTX, Int_val(domid), Int_val(sysrq));
 
 	if (ret != 0)
-		failwith_xl("send_sysrq");
+		failwith_xl(ret, "send_sysrq");
 
 	CAMLreturn(Val_unit);
 }
@@ -469,7 +511,7 @@ value stub_xl_send_debug_keys(value ctx,
 
 	ret = libxl_send_debug_keys(CTX, c_keys);
 	if (ret != 0)
-		failwith_xl("send_debug_keys");
+		failwith_xl(ret, "send_debug_keys");
 
 	free(c_keys);
 
diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/test/Makefile
--- a/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
@@ -6,9 +6,9 @@ OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xentoollog \
 	-I $(OCAML_TOPLEVEL)/libs/xl
 
-OBJS = xtl send_debug_keys list_domains
+OBJS = xtl send_debug_keys list_domains raise_exception
 
-PROGRAMS = xtl send_debug_keys list_domains
+PROGRAMS = xtl send_debug_keys list_domains raise_exception
 
 xtl_LIBS =  \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa
@@ -27,7 +27,13 @@ list_domains_LIBS =  \
 
 list_domains_OBJS = list_domains
 
-OCAML_PROGRAM = xtl send_debug_keys list_domains
+raise_exception_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl $(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
+
+raise_exception_OBJS = raise_exception
+
+OCAML_PROGRAM = xtl send_debug_keys list_domains raise_exception
 
 all: $(PROGRAMS)
 
diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/test/list_domains.ml
--- a/tools/ocaml/test/list_domains.ml	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/test/list_domains.ml	Tue Nov 20 17:22:21 2012 +0000
@@ -19,8 +19,11 @@ let print_dominfo dominfo =
 let _ = 
   let logger = Xentoollog.create_stdio_logger (*~level:Xentoollog.Debug*) () in
   let ctx = Xenlight.ctx_alloc logger in
-  let domains = Xenlight.list_domain ctx in
-  List.iter (fun d -> print_dominfo d) domains;
-  Xenlight.ctx_free ctx;
-  Xentoollog.destroy logger;
-
+  try
+    let domains = Xenlight.list_domain ctx in
+    List.iter (fun d -> print_dominfo d) domains;
+    Xenlight.ctx_free ctx;
+    Xentoollog.destroy logger;
+  with Xenlight.Error(err, fn) -> begin
+    printf "Caught Exception: %s: %s\n" (Xenlight.string_of_error err) fn;
+  end
diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/test/raise_exception.ml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/test/raise_exception.ml	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,15 @@
+open Printf
+open Xentoollog
+open Xenlight
+
+let _ = 
+  let logger = Xentoollog.create_stdio_logger (*~level:Xentoollog.Debug*) () in
+  let ctx = Xenlight.ctx_alloc logger in
+  try
+    Xenlight.test_raise_exception ()
+  with Xenlight.Error(err, fn) -> begin
+    printf "Caught Exception: %s: %s\n" (Xenlight.string_of_error err) fn;
+  end;
+  Xenlight.ctx_free ctx;
+  Xentoollog.destroy logger;
+

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:46:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:46:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tartr-0004vQ-Nu; Tue, 20 Nov 2012 17:46:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Tarto-0004qi-6E; Tue, 20 Nov 2012 17:46:16 +0000
Received: from [85.158.138.51:5846] by server-13.bemta-3.messagelabs.com id
	1E/AA-24887-7E1CBA05; Tue, 20 Nov 2012 17:46:15 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353433568!30872360!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30011 invoked from network); 20 Nov 2012 17:46:10 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:46:10 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215082601"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:46:08 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:46:08 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-PJ;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: c8d22bfef298ce525c98b5a3f0c394068ab01572
Message-ID: <c8d22bfef298ce525c98.1353432213@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:33 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 13 of 15] libxl: ocaml: propagate the libxl
 return error code in exceptions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID c8d22bfef298ce525c98b5a3f0c394068ab01572
# Parent  e4525795eac22c7d199ceae8714e95ed660a00c4
libxl: ocaml: propagate the libxl return error code in exceptions

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
@@ -228,7 +228,7 @@ def c_val(ty, c, o, indent="", parent = 
         for e in ty.values:
             s += "    case %d: *%s = %s; break;\n" % (n, c, e.name)
             n += 1
-        s += "    default: failwith_xl(\"cannot convert value to %s\"); break;\n" % ty.typename
+        s += "    default: failwith_xl(ERROR_FAIL, \"cannot convert value to %s\"); break;\n" % ty.typename
         s += "}"
     elif isinstance(ty, idl.KeyedUnion):
         s += "{\n"
@@ -241,7 +241,7 @@ def c_val(ty, c, o, indent="", parent = 
                                                     parent + ty.keyvar.name,
                                                     f.enumname)
             n += 1
-        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (long)\"); break;\n" % (parent, ty.keyvar.name)        
+        s += "\t\t    default: failwith_xl(ERROR_FAIL, \"variant handling bug %s%s (long)\"); break;\n" % (parent, ty.keyvar.name)        
         s += "\t\t}\n"
         s += "\t} else {\n"
         s += "\t\t/* Is block... */\n"
@@ -257,7 +257,7 @@ def c_val(ty, c, o, indent="", parent = 
                 s += "%s" % c_val(f.type, fexpr, o, indent=indent+"\t\t        ")
                 s += "break;\n"
             n += 1
-        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (block)\"); break;\n" % (parent, ty.keyvar.name)
+        s += "\t\t    default: failwith_xl(ERROR_FAIL, \"variant handling bug %s%s (block)\"); break;\n" % (parent, ty.keyvar.name)
         s += "\t\t}\n"
         s += "\t}\n"
         s += "}"
@@ -326,7 +326,7 @@ def ocaml_Val(ty, o, c, indent="", paren
         for e in ty.values:
             s += "    case %s: %s = Int_val(%d); break;\n" % (e.name, o, n)
             n += 1
-        s += "    default: failwith_xl(\"cannot convert value from %s\"); break;\n" % ty.typename
+        s += "    default: failwith_xl(ERROR_FAIL, \"cannot convert value from %s\"); break;\n" % ty.typename
         s += "}"
     elif isinstance(ty, idl.KeyedUnion):
         n = 0
@@ -347,7 +347,7 @@ def ocaml_Val(ty, o, c, indent="", paren
                 #s += "\t        %s = caml_alloc(%d,%d);\n" % (o,len(f.type.fields),n)
             s += "\t        break;\n"
             n += 1
-        s += "\t    default: failwith_xl(\"cannot convert value from %s\"); break;\n" % ty.typename
+        s += "\t    default: failwith_xl(ERROR_FAIL, \"cannot convert value from %s\"); break;\n" % ty.typename
         s += "\t}"
     elif isinstance(ty,idl.Aggregate) and (parent is None or ty.rawname is None):
         s += "{\n"
diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/libs/xl/xenlight.ml.in
--- a/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
@@ -15,7 +15,47 @@
 
 open Xentoollog
 
-exception Error of string
+type error = 
+    Nonspecific |
+    Version |
+    Fail |
+    Ni |
+    Nomem |
+    Inval |
+    Badfail |
+    Guest_Timedout |
+    Timedout |
+    Noparavirt |
+    Not_Ready |
+    Osevent_Reg_Fail |
+    Bufferfull |
+    Unknown_Child
+
+let string_of_error error =
+  match error with
+  | Nonspecific -> "Non specific"
+  | Version -> "Version"
+  | Fail -> "Fail"
+  | Ni -> "Ni"
+  | Nomem -> "Nomem"
+  | Inval -> "Inval"
+  | Badfail -> "Badfail"
+  | Guest_Timedout -> "Guest Timedout"
+  | Timedout -> "Timedout"
+  | Noparavirt -> "Noparavirt"
+  | Not_Ready -> "Not Ready"
+  | Osevent_Reg_Fail -> "Osevent Reg Fail"
+  | Bufferfull -> "Bufferfull"
+  | Unknown_Child -> "Unknown Child"
+
+exception Error of (error * string)
+
+type ctx
+
+external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
+external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
+
+external test_raise_exception: unit -> unit = "stub_raise_exception"
 
 type domid = int
 type devid = int
@@ -26,15 +66,10 @@ end
 
 (* @@LIBXL_TYPES@@ *)
 
-type ctx
-
-external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
-external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
-
 external list_domain: ctx -> Dominfo.t list = "stub_libxl_list_domain"
 
 external send_trigger : domid -> trigger -> int -> unit = "stub_xl_send_trigger"
 external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
 external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
 
-let _ = Callback.register_exception "Xenlight.Error" (Error(""))
+let _ = Callback.register_exception "Xenlight.Error" (Error(Fail, ""))
diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/libs/xl/xenlight.mli.in
--- a/tools/ocaml/libs/xl/xenlight.mli.in	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight.mli.in	Tue Nov 20 17:22:21 2012 +0000
@@ -15,7 +15,32 @@
 
 open Xentoollog
 
-exception Error of string
+type error = 
+    Nonspecific |
+    Version |
+    Fail |
+    Ni |
+    Nomem |
+    Inval |
+    Badfail |
+    Guest_Timedout |
+    Timedout |
+    Noparavirt |
+    Not_Ready |
+    Osevent_Reg_Fail |
+    Bufferfull |
+    Unknown_Child
+
+val string_of_error: error -> string
+
+exception Error of (error * string)
+
+type ctx
+
+external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
+external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
+
+external test_raise_exception: unit = "stub_raise_exception"
 
 type domid = int
 type devid = int
@@ -24,9 +49,6 @@ type devid = int
 
 type ctx
 
-external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
-external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
-
 external list_domain: ctx -> Dominfo.t list = "stub_libxl_list_domain"
 
 external send_trigger : domid -> trigger -> int -> unit = "stub_xl_send_trigger"
diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/libs/xl/xenlight_stubs.c
--- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
@@ -43,12 +43,54 @@ static char * dup_String_val(value s)
 	return c;
 }
 
-static void failwith_xl(char *fname)
+static value Val_error(int error)
 {
+	switch (error) {
+	case ERROR_NONSPECIFIC: return Val_int(0);
+	case ERROR_VERSION:     return Val_int(1);
+	case ERROR_FAIL:        return Val_int(2);
+	case ERROR_NI:          return Val_int(3);
+	case ERROR_NOMEM:       return Val_int(4);
+	case ERROR_INVAL:       return Val_int(5);
+	case ERROR_BADFAIL:     return Val_int(6);
+	case ERROR_GUEST_TIMEDOUT: return Val_int(7);
+	case ERROR_TIMEDOUT:    return Val_int(8);
+	case ERROR_NOPARAVIRT:  return Val_int(9);
+	case ERROR_NOT_READY:   return Val_int(10);
+	case ERROR_OSEVENT_REG_FAIL: return Val_int(11);
+	case ERROR_BUFFERFULL:  return Val_int(12);
+	case ERROR_UNKNOWN_CHILD: return Val_int(13);
+#if 0 /* Let the compiler catch this */
+	default:
+		caml_raise_sys_error(caml_copy_string("Unknown libxl ERROR"));
+		break;
+#endif
+	}
+	/* Should not reach here */
+	abort();
+}
+
+static void failwith_xl(int error, char *fname)
+{
+	CAMLlocal1(arg);
 	value *exc = caml_named_value("Xenlight.Error");
+
 	if (!exc)
 		caml_invalid_argument("Exception Xenlight.Error not initialized, please link xl.cma");
-	caml_raise_with_string(*exc, fname);
+
+	arg = caml_alloc_small(2, 0);
+
+	Field(arg, 0) = Val_error(error);
+	Field(arg, 1) = caml_copy_string(fname);
+
+	caml_raise_with_arg(*exc, arg);
+}
+
+CAMLprim value stub_raise_exception(value unit)
+{
+	CAMLparam1(unit);
+	failwith_xl(ERROR_FAIL, "test exception");
+	CAMLreturn(Val_unit);
 }
 
 CAMLprim value stub_libxl_ctx_alloc(value logger)
@@ -60,7 +102,7 @@ CAMLprim value stub_libxl_ctx_alloc(valu
 	caml_enter_blocking_section();
 	ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct xentoollog_logger *) logger);
 	if (ret != 0) \
-		failwith_xl("cannot init context");
+		failwith_xl(ERROR_FAIL, "cannot init context");
 	caml_leave_blocking_section();
 	CAMLreturn((value)ctx);
 }
@@ -190,7 +232,7 @@ static int Bitmap_val(libxl_ctx *ctx, li
 	int i, len = Wosize_val(v);
 
 	if (!libxl_bitmap_alloc(ctx, c_val, len))
-		failwith_xl("cannot allocate bitmap");
+		failwith_xl(ERROR_NOMEM, "cannot allocate bitmap");
 	for (i=0; i<len; i++) {
 		if (Int_val(Field(v, i)))
 			libxl_bitmap_set(c_val, i);
@@ -295,7 +337,7 @@ value stub_libxl_list_domain(value ctx)
 
 	info = libxl_list_domain(CTX, &nr);
 	if (info == NULL)
-		failwith_xl("list_domain");
+		failwith_xl(ERROR_FAIL, "list_domain");
 
 	cli = Val_emptylist;
 
@@ -332,7 +374,7 @@ value stub_xl_device_##type##_##op(value
 	libxl_device_##type##_dispose(&c_info);				\
 									\
 	if (ret != 0)							\
-		failwith_xl(STRINGIFY(type) "_" STRINGIFY(op));		\
+		failwith_xl(ret, STRINGIFY(type) "_" STRINGIFY(op));	\
 									\
 	CAMLreturn(Val_unit);						\
 }
@@ -358,7 +400,7 @@ value stub_xl_physinfo_get(value ctx)
 	ret = libxl_get_physinfo(CTX, &c_physinfo);
 
 	if (ret != 0)
-		failwith_xl("get_physinfo");
+		failwith_xl(ret, "get_physinfo");
 
 	physinfo = Val_physinfo(CTX, &c_physinfo);
 
@@ -377,7 +419,7 @@ value stub_xl_cputopology_get(value ctx)
 	c_topology = libxl_get_cpu_topology(CTX, &nr);
 
 	if (!c_topology)
-		failwith_xl("topologyinfo");
+		failwith_xl(ERROR_FAIL, "get_cpu_topologyinfo");
 
 	topology = caml_alloc_tuple(nr);
 	for (i = 0; i < nr; i++) {
@@ -402,7 +444,7 @@ value stub_xl_domain_sched_params_get(va
 
 	ret = libxl_domain_sched_params_get(CTX, Int_val(domid), &c_scinfo);
 	if (ret != 0)
-		failwith_xl("domain_sched_params_get");
+		failwith_xl(ret, "domain_sched_params_get");
 
 	scinfo = Val_domain_sched_params(CTX, &c_scinfo);
 
@@ -424,7 +466,7 @@ value stub_xl_domain_sched_params_set(va
 	libxl_domain_sched_params_dispose(&c_scinfo);
 
 	if (ret != 0)
-		failwith_xl("domain_sched_params_set");
+		failwith_xl(ret, "domain_sched_params_set");
 
 	CAMLreturn(Val_unit);
 }
@@ -441,7 +483,7 @@ value stub_xl_send_trigger(value ctx, va
 				 c_trigger, Int_val(vcpuid));
 
 	if (ret != 0)
-		failwith_xl("send_trigger");
+		failwith_xl(ret, "send_trigger");
 
 	CAMLreturn(Val_unit);
 }
@@ -454,7 +496,7 @@ value stub_xl_send_sysrq(value ctx, valu
 	ret = libxl_send_sysrq(CTX, Int_val(domid), Int_val(sysrq));
 
 	if (ret != 0)
-		failwith_xl("send_sysrq");
+		failwith_xl(ret, "send_sysrq");
 
 	CAMLreturn(Val_unit);
 }
@@ -469,7 +511,7 @@ value stub_xl_send_debug_keys(value ctx,
 
 	ret = libxl_send_debug_keys(CTX, c_keys);
 	if (ret != 0)
-		failwith_xl("send_debug_keys");
+		failwith_xl(ret, "send_debug_keys");
 
 	free(c_keys);
 
diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/test/Makefile
--- a/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
@@ -6,9 +6,9 @@ OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xentoollog \
 	-I $(OCAML_TOPLEVEL)/libs/xl
 
-OBJS = xtl send_debug_keys list_domains
+OBJS = xtl send_debug_keys list_domains raise_exception
 
-PROGRAMS = xtl send_debug_keys list_domains
+PROGRAMS = xtl send_debug_keys list_domains raise_exception
 
 xtl_LIBS =  \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa
@@ -27,7 +27,13 @@ list_domains_LIBS =  \
 
 list_domains_OBJS = list_domains
 
-OCAML_PROGRAM = xtl send_debug_keys list_domains
+raise_exception_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl $(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
+
+raise_exception_OBJS = raise_exception
+
+OCAML_PROGRAM = xtl send_debug_keys list_domains raise_exception
 
 all: $(PROGRAMS)
 
diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/test/list_domains.ml
--- a/tools/ocaml/test/list_domains.ml	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/test/list_domains.ml	Tue Nov 20 17:22:21 2012 +0000
@@ -19,8 +19,11 @@ let print_dominfo dominfo =
 let _ = 
   let logger = Xentoollog.create_stdio_logger (*~level:Xentoollog.Debug*) () in
   let ctx = Xenlight.ctx_alloc logger in
-  let domains = Xenlight.list_domain ctx in
-  List.iter (fun d -> print_dominfo d) domains;
-  Xenlight.ctx_free ctx;
-  Xentoollog.destroy logger;
-
+  try
+    let domains = Xenlight.list_domain ctx in
+    List.iter (fun d -> print_dominfo d) domains;
+    Xenlight.ctx_free ctx;
+    Xentoollog.destroy logger;
+  with Xenlight.Error(err, fn) -> begin
+    printf "Caught Exception: %s: %s\n" (Xenlight.string_of_error err) fn;
+  end
diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/test/raise_exception.ml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/test/raise_exception.ml	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,15 @@
+open Printf
+open Xentoollog
+open Xenlight
+
+let _ = 
+  let logger = Xentoollog.create_stdio_logger (*~level:Xentoollog.Debug*) () in
+  let ctx = Xenlight.ctx_alloc logger in
+  try
+    Xenlight.test_raise_exception ()
+  with Xenlight.Error(err, fn) -> begin
+    printf "Caught Exception: %s: %s\n" (Xenlight.string_of_error err) fn;
+  end;
+  Xenlight.ctx_free ctx;
+  Xentoollog.destroy logger;
+

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:46:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:46:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tartn-0004qR-4K; Tue, 20 Nov 2012 17:46:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Tartk-0004pV-Kd; Tue, 20 Nov 2012 17:46:12 +0000
Received: from [85.158.138.51:27877] by server-12.bemta-3.messagelabs.com id
	6A/9A-22757-3E1CBA05; Tue, 20 Nov 2012 17:46:11 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1353433569!11078498!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ4OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9743 invoked from network); 20 Nov 2012 17:46:10 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-13.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:46:10 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="45198851"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:46:08 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:46:08 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-QB;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 72376896ba08bb7035ad4b7ed5a91c2c1b45b905
Message-ID: <72376896ba08bb7035ad.1353432215@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:35 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 15 of 15] libxl: ocaml: add bindings for
 libxl_domain_create_new
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID 72376896ba08bb7035ad4b7ed5a91c2c1b45b905
# Parent  41f0137955f4a1a5a76ad34a5a6440e32d0090ef
libxl: ocaml: add bindings for libxl_domain_create_new

** NOT TO BE APPLIED **

Add a simple stub thing which should build a domain. Except it is
incomplete and doesn't actually build. Hence RFC.

It's a bit tedious to have to give empty values for everything. This
suggests that a better API would be for anything in the libxl API
which has the concept of a default type should be a FOO option in the
ocaml binding. Or is that tedious on the ocaml side?

Or is there some way to declare only a partially initialised struct
in ocaml (in a way which can be sensibly marshalled to C).

diff -r 41f0137955f4 -r 72376896ba08 tools/ocaml/libs/xl/xenlight.ml.in
--- a/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
@@ -72,4 +72,6 @@ external send_trigger : domid -> trigger
 external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
 external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
 
+external domain_create_new : ctx -> Domain_config.t -> domid = "stub_xl_domain_create_new"
+
 let _ = Callback.register_exception "Xenlight.Error" (Error(Fail, ""))
diff -r 41f0137955f4 -r 72376896ba08 tools/ocaml/libs/xl/xenlight.mli.in
--- a/tools/ocaml/libs/xl/xenlight.mli.in	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight.mli.in	Tue Nov 20 17:22:21 2012 +0000
@@ -54,3 +54,6 @@ external list_domain: ctx -> Dominfo.t l
 external send_trigger : domid -> trigger -> int -> unit = "stub_xl_send_trigger"
 external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
 external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
+
+/* XXX: const libxl_asyncop_how *ao_how, const libxl_asyncprogress_how *aop_console_how */
+external domain_create_new :ctx -> Domain_config.t -> domid = "stub_xl_domain_create_new"
diff -r 41f0137955f4 -r 72376896ba08 tools/ocaml/libs/xl/xenlight_stubs.c
--- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
@@ -518,6 +518,23 @@ value stub_xl_send_debug_keys(value ctx,
 	CAMLreturn(Val_unit);
 }
 
+value stub_xl_domain_create_new(value ctx, value domain_config)
+{
+	CAMLparam2(ctx, domain_config);
+	int ret;
+	libxl_domain_config c_dconfig;
+	uint32_t c_domid;
+
+	ret = libxl_domain_create_new(CTX, &c_dconfig, &c_domid,
+				      NULL, NULL);
+	if (ret != 0)
+		failwith_xl(ret, "domain_create_new");
+
+	libxl_domain_config_dispose(&c_dconfig);
+
+	CAMLreturn(Val_int(c_domid));
+}
+
 /*
  * Local variables:
  *  indent-tabs-mode: t
diff -r 41f0137955f4 -r 72376896ba08 tools/ocaml/test/Makefile
--- a/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
@@ -6,9 +6,9 @@ OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xentoollog \
 	-I $(OCAML_TOPLEVEL)/libs/xl
 
-OBJS = xtl send_debug_keys list_domains raise_exception
+OBJS = xtl send_debug_keys list_domains raise_exception build_domain
 
-PROGRAMS = xtl send_debug_keys list_domains raise_exception
+PROGRAMS = xtl send_debug_keys list_domains raise_exception build_domain
 
 xtl_LIBS =  \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa
@@ -33,7 +33,13 @@ raise_exception_LIBS =  \
 
 raise_exception_OBJS = raise_exception
 
-OCAML_PROGRAM = xtl send_debug_keys list_domains raise_exception
+build_domain_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl $(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
+
+build_domain_OBJS = build_domain
+
+OCAML_PROGRAM = xtl send_debug_keys list_domains raise_exception build_domain
 
 all: $(PROGRAMS)
 
diff -r 41f0137955f4 -r 72376896ba08 tools/ocaml/test/build_domain.ml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/test/build_domain.ml	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,42 @@
+open Arg
+open Printf
+open Xentoollog
+open Xenlight
+
+let _ = 
+  let logger = Xentoollog.create_stdio_logger ~level:Xentoollog.Debug () in
+  let ctx = Xenlight.ctx_alloc logger in
+  let c_info = {
+    Xenlight.Domain_create_info.hap = None;
+    Xenlight.Domain_create_info.oos = None;
+    Xenlight.Domain_create_info.name = "Test;
+  }
+  and b_info = {
+    Xenlight.Domain_build_info.max_vcpus = 1;
+    Xenlight.Domain_build_info.avail_vcpus = [| |];
+    Xenlight.Domain_build_info.cpumap = [| |];
+    Xenlight.Domain_build_info.numa_placement = None;
+    Xenlight.Domain_build_info.tsc_mode = Xenlight.TSC_MODE_DEFAULT;
+    Xenlight.Domain_build_info.max_memkb = 1024L;
+    Xenlight.Domain_build_info.target_memkb = 1024L;
+    Xenlight.Domain_build_info.video_memkb = 0L;
+    Xenlight.Domain_build_info.shadow_memkb = 0L;
+    Xenlight.Domain_build_info.rtc_timeoffset = 0L;
+  } in
+  let d_info = {
+    Xenlight.Domain_config.b_info = b_info;
+    Xenlight.Domain_config.c_info = c_info;
+    Xenlight.Domain_config.disks = [| |];
+    Xenlight.Domain_config.nics = [| |];
+    Xenlight.Domain_config.vfbs = [| |];
+    Xenlight.Domain_config.vkbs = [| |];
+    Xenlight.Domain_config.pcidevs = [| |];
+    (*Xenlight.Domain_config.on_poweroff = Xenlight.Action_on_shutdown.dESTROY;*)
+  } in
+  try
+    Xenlight.domain_create_new ctx d_info;
+    Xenlight.ctx_free ctx;
+    Xentoollog.destroy logger;
+  with Xenlight.Error(err, fn) -> begin
+    printf "Caught Exception: %s: %s\n" (Xenlight.string_of_error err) fn;
+  end

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:46:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:46:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tartn-0004qR-4K; Tue, 20 Nov 2012 17:46:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Tartk-0004pV-Kd; Tue, 20 Nov 2012 17:46:12 +0000
Received: from [85.158.138.51:27877] by server-12.bemta-3.messagelabs.com id
	6A/9A-22757-3E1CBA05; Tue, 20 Nov 2012 17:46:11 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1353433569!11078498!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ4OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9743 invoked from network); 20 Nov 2012 17:46:10 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-13.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:46:10 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="45198851"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:46:08 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:46:08 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-QB;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 72376896ba08bb7035ad4b7ed5a91c2c1b45b905
Message-ID: <72376896ba08bb7035ad.1353432215@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:35 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 15 of 15] libxl: ocaml: add bindings for
 libxl_domain_create_new
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID 72376896ba08bb7035ad4b7ed5a91c2c1b45b905
# Parent  41f0137955f4a1a5a76ad34a5a6440e32d0090ef
libxl: ocaml: add bindings for libxl_domain_create_new

** NOT TO BE APPLIED **

Add a simple stub thing which should build a domain. Except it is
incomplete and doesn't actually build. Hence RFC.

It's a bit tedious to have to give empty values for everything. This
suggests that a better API would be for anything in the libxl API
which has the concept of a default type should be a FOO option in the
ocaml binding. Or is that tedious on the ocaml side?

Or is there some way to declare only a partially initialised struct
in ocaml (in a way which can be sensibly marshalled to C).

diff -r 41f0137955f4 -r 72376896ba08 tools/ocaml/libs/xl/xenlight.ml.in
--- a/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
@@ -72,4 +72,6 @@ external send_trigger : domid -> trigger
 external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
 external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
 
+external domain_create_new : ctx -> Domain_config.t -> domid = "stub_xl_domain_create_new"
+
 let _ = Callback.register_exception "Xenlight.Error" (Error(Fail, ""))
diff -r 41f0137955f4 -r 72376896ba08 tools/ocaml/libs/xl/xenlight.mli.in
--- a/tools/ocaml/libs/xl/xenlight.mli.in	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight.mli.in	Tue Nov 20 17:22:21 2012 +0000
@@ -54,3 +54,6 @@ external list_domain: ctx -> Dominfo.t l
 external send_trigger : domid -> trigger -> int -> unit = "stub_xl_send_trigger"
 external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
 external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
+
+/* XXX: const libxl_asyncop_how *ao_how, const libxl_asyncprogress_how *aop_console_how */
+external domain_create_new :ctx -> Domain_config.t -> domid = "stub_xl_domain_create_new"
diff -r 41f0137955f4 -r 72376896ba08 tools/ocaml/libs/xl/xenlight_stubs.c
--- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
@@ -518,6 +518,23 @@ value stub_xl_send_debug_keys(value ctx,
 	CAMLreturn(Val_unit);
 }
 
+value stub_xl_domain_create_new(value ctx, value domain_config)
+{
+	CAMLparam2(ctx, domain_config);
+	int ret;
+	libxl_domain_config c_dconfig;
+	uint32_t c_domid;
+
+	ret = libxl_domain_create_new(CTX, &c_dconfig, &c_domid,
+				      NULL, NULL);
+	if (ret != 0)
+		failwith_xl(ret, "domain_create_new");
+
+	libxl_domain_config_dispose(&c_dconfig);
+
+	CAMLreturn(Val_int(c_domid));
+}
+
 /*
  * Local variables:
  *  indent-tabs-mode: t
diff -r 41f0137955f4 -r 72376896ba08 tools/ocaml/test/Makefile
--- a/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
@@ -6,9 +6,9 @@ OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xentoollog \
 	-I $(OCAML_TOPLEVEL)/libs/xl
 
-OBJS = xtl send_debug_keys list_domains raise_exception
+OBJS = xtl send_debug_keys list_domains raise_exception build_domain
 
-PROGRAMS = xtl send_debug_keys list_domains raise_exception
+PROGRAMS = xtl send_debug_keys list_domains raise_exception build_domain
 
 xtl_LIBS =  \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa
@@ -33,7 +33,13 @@ raise_exception_LIBS =  \
 
 raise_exception_OBJS = raise_exception
 
-OCAML_PROGRAM = xtl send_debug_keys list_domains raise_exception
+build_domain_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl $(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
+
+build_domain_OBJS = build_domain
+
+OCAML_PROGRAM = xtl send_debug_keys list_domains raise_exception build_domain
 
 all: $(PROGRAMS)
 
diff -r 41f0137955f4 -r 72376896ba08 tools/ocaml/test/build_domain.ml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/test/build_domain.ml	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,42 @@
+open Arg
+open Printf
+open Xentoollog
+open Xenlight
+
+let _ = 
+  let logger = Xentoollog.create_stdio_logger ~level:Xentoollog.Debug () in
+  let ctx = Xenlight.ctx_alloc logger in
+  let c_info = {
+    Xenlight.Domain_create_info.hap = None;
+    Xenlight.Domain_create_info.oos = None;
+    Xenlight.Domain_create_info.name = "Test;
+  }
+  and b_info = {
+    Xenlight.Domain_build_info.max_vcpus = 1;
+    Xenlight.Domain_build_info.avail_vcpus = [| |];
+    Xenlight.Domain_build_info.cpumap = [| |];
+    Xenlight.Domain_build_info.numa_placement = None;
+    Xenlight.Domain_build_info.tsc_mode = Xenlight.TSC_MODE_DEFAULT;
+    Xenlight.Domain_build_info.max_memkb = 1024L;
+    Xenlight.Domain_build_info.target_memkb = 1024L;
+    Xenlight.Domain_build_info.video_memkb = 0L;
+    Xenlight.Domain_build_info.shadow_memkb = 0L;
+    Xenlight.Domain_build_info.rtc_timeoffset = 0L;
+  } in
+  let d_info = {
+    Xenlight.Domain_config.b_info = b_info;
+    Xenlight.Domain_config.c_info = c_info;
+    Xenlight.Domain_config.disks = [| |];
+    Xenlight.Domain_config.nics = [| |];
+    Xenlight.Domain_config.vfbs = [| |];
+    Xenlight.Domain_config.vkbs = [| |];
+    Xenlight.Domain_config.pcidevs = [| |];
+    (*Xenlight.Domain_config.on_poweroff = Xenlight.Action_on_shutdown.dESTROY;*)
+  } in
+  try
+    Xenlight.domain_create_new ctx d_info;
+    Xenlight.ctx_free ctx;
+    Xentoollog.destroy logger;
+  with Xenlight.Error(err, fn) -> begin
+    printf "Caught Exception: %s: %s\n" (Xenlight.string_of_error err) fn;
+  end

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:46:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:46:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tarto-0004rU-A0; Tue, 20 Nov 2012 17:46:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Tartl-0004ps-RA; Tue, 20 Nov 2012 17:46:14 +0000
Received: from [85.158.138.51:27931] by server-15.bemta-3.messagelabs.com id
	DA/94-09445-5E1CBA05; Tue, 20 Nov 2012 17:46:13 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1353433569!11078498!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ4OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9768 invoked from network); 20 Nov 2012 17:46:11 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-13.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:46:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="45198857"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:46:10 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:46:10 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-Nr;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 2b433b1523e4295bb1ed74a7b71e2a20e00f1802
Message-ID: <2b433b1523e4295bb1ed.1353432210@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:30 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 10 of 15] libxc/ocaml: Add simple binding for
 xentoollog (output only)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID 2b433b1523e4295bb1ed74a7b71e2a20e00f1802
# Parent  5173d29f64fa541f6ec0c48481c4957a03f0302c
libxc/ocaml: Add simple binding for xentoollog (output only).

These bindings allow ocaml code to receive log message via xentoollog
but do not support injecting messages into xentoollog from ocaml.
Receiving log messages from libx{c,l} and forwarding them to ocaml is
the use case which is needed by the following patches.

Add a simple noddy test case (tools/ocaml/test).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 5173d29f64fa -r 2b433b1523e4 .gitignore
--- a/.gitignore	Tue Nov 20 17:22:21 2012 +0000
+++ b/.gitignore	Tue Nov 20 17:22:21 2012 +0000
@@ -364,6 +364,7 @@ tools/ocaml/libs/xl/_libxl_types.mli.in
 tools/ocaml/libs/xl/xenlight.ml
 tools/ocaml/libs/xl/xenlight.mli
 tools/ocaml/xenstored/oxenstored
+tools/ocaml/test/xtl
 
 tools/debugger/kdd/kdd
 tools/firmware/etherboot/ipxe.tar.gz
diff -r 5173d29f64fa -r 2b433b1523e4 .hgignore
--- a/.hgignore	Tue Nov 20 17:22:21 2012 +0000
+++ b/.hgignore	Tue Nov 20 17:22:21 2012 +0000
@@ -305,6 +305,7 @@
 ^tools/ocaml/libs/xl/xenlight\.ml$
 ^tools/ocaml/libs/xl/xenlight\.mli$
 ^tools/ocaml/xenstored/oxenstored$
+^tools/ocaml/test/xtl$
 ^tools/autom4te\.cache$
 ^tools/config\.h$
 ^tools/config\.log$
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/Makefile
--- a/tools/ocaml/Makefile	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/Makefile	Tue Nov 20 17:22:21 2012 +0000
@@ -1,7 +1,7 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-SUBDIRS_PROGRAMS = xenstored
+SUBDIRS_PROGRAMS = xenstored test
 
 SUBDIRS = libs $(SUBDIRS_PROGRAMS)
 
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/Makefile.rules
--- a/tools/ocaml/Makefile.rules	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/Makefile.rules	Tue Nov 20 17:22:21 2012 +0000
@@ -24,7 +24,7 @@ ALL_OCAML_OBJS ?= $(OBJS)
 %.cmi: %.mli
 	$(call quiet-command, $(OCAMLC) $(OCAMLCFLAGS) -c -o $@ $<,MLI,$@)
 
-%.cmx: %.ml
+%.cmx %.o: %.ml
 	$(call quiet-command, $(OCAMLOPT) $(OCAMLOPTFLAGS) -c -o $@ $<,MLOPT,$@)
 
 %.ml: %.mll
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/libs/Makefile
--- a/tools/ocaml/libs/Makefile	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/Makefile	Tue Nov 20 17:22:21 2012 +0000
@@ -3,6 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 SUBDIRS= \
 	mmap \
+	xentoollog \
 	xc eventchn \
 	xb xs xl
 
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/libs/xentoollog/META.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/libs/xentoollog/META.in	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,4 @@
+version = "@VERSION@"
+description = "Xen Tools Logger Interface"
+archive(byte) = "xentoollog.cma"
+archive(native) = "xentoollog.cmxa"
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/libs/xentoollog/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/libs/xentoollog/Makefile	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,33 @@
+TOPLEVEL=$(CURDIR)/../..
+XEN_ROOT=$(TOPLEVEL)/../..
+include $(TOPLEVEL)/common.make
+
+CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
+OCAMLINCLUDE +=
+
+OBJS = xentoollog
+INTF = xentoollog.cmi
+LIBS = xentoollog.cma xentoollog.cmxa
+
+LIBS_xentoollog = $(LDLIBS_libxenctrl)
+
+xentoollog_OBJS = $(OBJS)
+xentoollog_C_OBJS = xentoollog_stubs
+
+OCAML_LIBRARY = xentoollog
+
+all: $(INTF) $(LIBS)
+
+libs: $(LIBS)
+
+.PHONY: install
+install: $(LIBS) META
+	mkdir -p $(OCAMLDESTDIR)
+	ocamlfind remove -destdir $(OCAMLDESTDIR) xentoollog
+	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xentoollog META $(INTF) $(LIBS) *.a *.so *.cmx
+
+.PHONY: uninstall
+uninstall:
+	ocamlfind remove -destdir $(OCAMLDESTDIR) xentoollog
+
+include $(TOPLEVEL)/Makefile.rules
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/libs/xentoollog/xentoollog.ml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/libs/xentoollog/xentoollog.ml	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,101 @@
+(*
+ * Copyright (C) 2012      Citrix Ltd.
+ * Author Ian Campbell <ian.campbell@citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ *)
+
+open Printf
+open Random
+open Callback
+
+type level = Debug
+	     | Verbose
+	     | Detail
+	     | Progress
+	     | Info
+	     | Notice
+	     | Warn
+	     | Error
+	     | Critical
+
+let level_to_string level =
+  match level with
+  | Debug -> "Debug"
+  | Verbose -> "Verbose"
+  | Detail -> "Detail"
+  | Progress -> "Progress"
+  | Info -> "Info"
+  | Notice -> "Notice"
+  | Warn -> "Warn"
+  | Error -> "Error"
+  | Critical -> "Critical"
+
+let level_to_prio level = 
+  match level with
+  | Debug -> 0
+  | Verbose -> 1
+  | Detail -> 2
+  | Progress -> 3
+  | Info -> 4
+  | Notice -> 5
+  | Warn -> 6
+  | Error -> 7
+  | Critical -> 8
+
+type handle
+
+type logger_cbs = {
+		  vmessage : level -> int option -> string option -> string -> unit;
+		  progress : string option -> string -> int -> int64 -> int64 -> unit;
+		  (*destroy : unit -> unit*) }
+
+external _create_logger: (string * string) -> handle = "stub_xtl_create_logger"
+external test: handle -> unit = "stub_xtl_test"
+
+let create name cbs : handle =
+  (* Callback names are supposed to be unique *)
+  let suffix = string_of_int (Random.int 1000000) in
+  let vmessage_name = sprintf "%s_vmessage_%s" name suffix in
+  let progress_name = sprintf "%s_progress_%s" name suffix in
+  (*let destroy_name = sprintf "%s_destroy" name in*)
+  begin
+    Callback.register vmessage_name cbs.vmessage;
+    Callback.register progress_name cbs.progress;
+    _create_logger (vmessage_name, progress_name)
+  end
+
+
+let stdio_vmessage min_level level errno ctx msg =
+  let level_int = level_to_prio level 
+  and level_str = level_to_string level
+  and errno_str = match errno with None -> "" | Some s -> sprintf ": errno=%d" s
+  and ctx_str = match ctx with None -> "" | Some s -> sprintf ": %s" s in
+  if min_level <= level_int then begin
+    printf "%s%s%s: %s\n" level_str ctx_str errno_str msg;
+    flush stdout;  
+  end;
+  ()
+
+let stdio_progress ctx what percent dne total =
+  let nl = if dne = total then "\n" else "" in
+  printf "\rProgress %s %d%% (%Ld/%Ld)%s" what percent dne total nl;
+  flush stdout;
+  ()
+    
+let create_stdio_logger ?(level=Info) () =
+  let level_int = level_to_prio level in
+  let cbs = {
+    vmessage = stdio_vmessage level_int;
+    progress = stdio_progress; } in
+  create "Xentoollog.stdio_logger" cbs
+
+external destroy: handle -> unit = "stub_xtl_destroy"
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/libs/xentoollog/xentoollog.mli
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/libs/xentoollog/xentoollog.mli	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,52 @@
+(*
+ * Copyright (C) 2012      Citrix Ltd.
+ * Author Ian Campbell <ian.campbell@citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ *)
+
+type level = Debug
+	     | Verbose
+	     | Detail
+	     | Progress (* also used for "progress" messages *)
+	     | Info
+	     | Notice
+	     | Warn
+	     | Error
+	     | Critical
+
+val level_to_string : level -> string
+
+type handle
+
+(** call back arguments. See xentoollog.h for more info.
+    vmessage:
+      level: level as above
+      errno: Some <errno> or None
+      context: Some <string> or None
+      message: The log message (already formatted)
+    progress:
+      context: Some <string> or None
+      doing_what: string
+      percent, done, total.
+*)
+type logger_cbs = {
+		  vmessage : level -> int option -> string option -> string -> unit;
+		  progress : string option -> string -> int -> int64 -> int64 -> unit;
+		  (*destroy : handle -> unit*) }
+
+external test: handle -> unit = "stub_xtl_test"
+
+val create : string -> logger_cbs -> handle
+
+val create_stdio_logger : ?level:level -> unit -> handle
+
+external destroy: handle -> unit = "stub_xtl_destroy"
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/libs/xentoollog/xentoollog_stubs.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,211 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ * Author Ian Campbell <ian.campbell@citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#define CAML_NAME_SPACE
+#include <caml/alloc.h>
+#include <caml/memory.h>
+#include <caml/signals.h>
+#include <caml/fail.h>
+#include <caml/callback.h>
+
+
+#include <xentoollog.h>
+
+struct caml_xtl {
+	xentoollog_logger vtable;
+	char *vmessage_cb;
+	char *progress_cb;
+};
+
+#define HND ((struct caml_xtl*)handle)
+#define XTL ((xentoollog_logger *)HND)
+
+static char * dup_String_val(value s)
+{
+	int len;
+	char *c;
+	len = caml_string_length(s);
+	c = calloc(len + 1, sizeof(char));
+	if (!c)
+		caml_raise_out_of_memory();
+	memcpy(c, String_val(s), len);
+	return c;
+}
+
+static value Val_level(xentoollog_level c_level)
+{
+	/* Must correspond to order in .mli */
+	switch (c_level) {
+	case XTL_NONE: /* Not a real value */
+		caml_raise_sys_error(caml_copy_string("Val_level XTL_NONE"));
+		break;
+	case XTL_DEBUG:    return Val_int(0);
+	case XTL_VERBOSE:  return Val_int(1);
+	case XTL_DETAIL:   return Val_int(2);
+	case XTL_PROGRESS: return Val_int(3);
+	case XTL_INFO:     return Val_int(4);
+	case XTL_NOTICE:   return Val_int(5);
+	case XTL_WARN:     return Val_int(6);
+	case XTL_ERROR:    return Val_int(7);
+	case XTL_CRITICAL: return Val_int(8);
+	case XTL_NUM_LEVELS: /* Not a real value! */
+		caml_raise_sys_error(
+			caml_copy_string("Val_level XTL_NUM_LEVELS"));
+#if 0 /* Let the compiler catch this */
+	default:
+		caml_raise_sys_error(caml_copy_string("Val_level Unknown"));
+		break;
+#endif
+	}
+	abort();
+}
+
+/* Option type support as per http://www.linux-nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php */
+#define Val_none Val_int(0)
+#define Some_val(v) Field(v,0)
+
+static value Val_some(value v)
+{
+	CAMLparam1(v);
+	CAMLlocal1(some);
+	some = caml_alloc(1, 0);
+	Store_field(some, 0, v);
+	CAMLreturn(some);
+}
+
+static value Val_errno(int errnoval)
+{
+	if (errnoval == -1)
+		return Val_none;
+	return Val_some(Val_int(errnoval));
+}
+
+static value Val_context(const char *context)
+{
+	if (context == NULL)
+		return Val_none;
+	return Val_some(caml_copy_string(context));
+}
+
+static void stub_xtl_ocaml_vmessage(struct xentoollog_logger *logger,
+			       xentoollog_level level,
+			       int errnoval,
+			       const char *context,
+			       const char *format,
+			       va_list al)
+{
+	struct caml_xtl *xtl = (struct caml_xtl*)logger;
+	value *func = caml_named_value(xtl->vmessage_cb) ;
+	value args[4];
+	char *msg;
+
+	if (args == NULL)
+		caml_raise_out_of_memory();
+	if (func == NULL)
+		caml_raise_sys_error(caml_copy_string("Unable to find callback"));
+	if (vasprintf(&msg, format, al) < 0)
+		caml_raise_out_of_memory();
+
+	/* vmessage : level -> int option -> string option -> string -> unit; */
+	args[0] = Val_level(level);
+	args[1] = Val_errno(errnoval);
+	args[2] = Val_context(context);
+	args[3] = caml_copy_string(msg);
+
+	free(msg);
+
+	caml_callbackN(*func, 4, args);
+}
+
+static void stub_xtl_ocaml_progress(struct xentoollog_logger *logger,
+				    const char *context,
+				    const char *doing_what /* no \r,\n */,
+				    int percent, unsigned long done, unsigned long total)
+{
+	struct caml_xtl *xtl = (struct caml_xtl*)logger;
+	value *func = caml_named_value(xtl->progress_cb) ;
+	value args[5];
+
+	if (args == NULL)
+		caml_raise_out_of_memory();
+	if (func == NULL)
+		caml_raise_sys_error(caml_copy_string("Unable to find callback"));
+
+	/* progress : string option -> string -> int -> int64 -> int64 -> unit; */
+	args[0] = Val_context(context);
+	args[1] = caml_copy_string(doing_what);
+	args[2] = Val_int(percent);
+	args[3] = caml_copy_int64(done);
+	args[4] = caml_copy_int64(total);
+
+	caml_callbackN(*func, 5, args);
+}
+
+static void xtl_destroy(struct xentoollog_logger *logger)
+{
+	struct caml_xtl *xtl = (struct caml_xtl*)logger;
+	free(xtl->vmessage_cb);
+	free(xtl->progress_cb);
+	free(xtl);
+}
+
+/* external _create_logger: (string * string) -> handle = "stub_xtl_create_logger" */
+CAMLprim value stub_xtl_create_logger(value cbs)
+{
+	CAMLparam1(cbs);
+	struct caml_xtl *xtl = malloc(sizeof(*xtl));
+	if (xtl == NULL)
+		caml_raise_out_of_memory();
+
+	memset(xtl, 0, sizeof(*xtl));
+
+	xtl->vtable.vmessage = &stub_xtl_ocaml_vmessage;
+	xtl->vtable.progress = &stub_xtl_ocaml_progress;
+	xtl->vtable.destroy = &xtl_destroy;
+
+	xtl->vmessage_cb = dup_String_val(Field(cbs, 0));
+	xtl->progress_cb = dup_String_val(Field(cbs, 1));
+	CAMLreturn((value)xtl);
+}
+
+/* external destroy: handle -> unit = "stub_xtl_destroy" */
+CAMLprim value stub_xtl_destroy(value handle)
+{
+	CAMLparam1(handle);
+	xtl_logger_destroy(XTL);
+	CAMLreturn(Val_unit);
+}
+
+/* external test: handle -> unit = "stub_xtl_test" */
+CAMLprim value stub_xtl_test(value handle)
+{
+	unsigned long l;
+	CAMLparam1(handle);
+	xtl_log(XTL, XTL_DEBUG, -1, "debug", "%s -- debug", __func__);
+	xtl_log(XTL, XTL_INFO, -1, "test", "%s -- test 1", __func__);
+	xtl_log(XTL, XTL_INFO, ENOSYS, "test errno", "%s -- test 2", __func__);
+	xtl_log(XTL, XTL_CRITICAL, -1, "critical", "%s -- critical", __func__);
+	for (l = 0UL; l<=100UL; l += 10UL) {
+		xtl_progress(XTL, "progress", "testing", l, 100UL);
+		usleep(10000);
+	}
+	CAMLreturn(Val_unit);
+}
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/test/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,27 @@
+XEN_ROOT = $(CURDIR)/../../..
+OCAML_TOPLEVEL = $(CURDIR)/..
+include $(OCAML_TOPLEVEL)/common.make
+
+OCAMLINCLUDE += \
+	-I $(OCAML_TOPLEVEL)/libs/xentoollog
+
+OBJS = xtl
+
+PROGRAMS = xtl
+
+xtl_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa
+
+xtl_OBJS = xtl
+
+OCAML_PROGRAM = xtl
+
+all: $(PROGRAMS)
+
+bins: $(PROGRAMS)
+
+install: all
+	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
+	$(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(BINDIR)
+
+include $(OCAML_TOPLEVEL)/Makefile.rules
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/test/xtl.ml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/test/xtl.ml	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,20 @@
+open Arg
+open Xentoollog
+  
+let do_test level = 
+  let lgr = Xentoollog.create_stdio_logger ~level:level () in
+  begin
+    Xentoollog.test lgr;
+    Xentoollog.destroy lgr;
+  end
+
+let () =
+  let debug_level = ref Xentoollog.Info in
+  let speclist = [
+    ("-v", Arg.Unit (fun () -> debug_level := Xentoollog.Debug), "Verbose");
+    ("-q", Arg.Unit (fun () -> debug_level := Xentoollog.Critical), "Quiet");
+  ] in
+  let usage_msg = "usage: xtl [OPTIONS]" in
+  Arg.parse speclist (fun s -> ()) usage_msg;
+
+  do_test !debug_level

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:46:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:46:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tarto-0004rU-A0; Tue, 20 Nov 2012 17:46:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Tartl-0004ps-RA; Tue, 20 Nov 2012 17:46:14 +0000
Received: from [85.158.138.51:27931] by server-15.bemta-3.messagelabs.com id
	DA/94-09445-5E1CBA05; Tue, 20 Nov 2012 17:46:13 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1353433569!11078498!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ4OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9768 invoked from network); 20 Nov 2012 17:46:11 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-13.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:46:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="45198857"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:46:10 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:46:10 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-Nr;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 2b433b1523e4295bb1ed74a7b71e2a20e00f1802
Message-ID: <2b433b1523e4295bb1ed.1353432210@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:30 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 10 of 15] libxc/ocaml: Add simple binding for
 xentoollog (output only)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID 2b433b1523e4295bb1ed74a7b71e2a20e00f1802
# Parent  5173d29f64fa541f6ec0c48481c4957a03f0302c
libxc/ocaml: Add simple binding for xentoollog (output only).

These bindings allow ocaml code to receive log message via xentoollog
but do not support injecting messages into xentoollog from ocaml.
Receiving log messages from libx{c,l} and forwarding them to ocaml is
the use case which is needed by the following patches.

Add a simple noddy test case (tools/ocaml/test).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 5173d29f64fa -r 2b433b1523e4 .gitignore
--- a/.gitignore	Tue Nov 20 17:22:21 2012 +0000
+++ b/.gitignore	Tue Nov 20 17:22:21 2012 +0000
@@ -364,6 +364,7 @@ tools/ocaml/libs/xl/_libxl_types.mli.in
 tools/ocaml/libs/xl/xenlight.ml
 tools/ocaml/libs/xl/xenlight.mli
 tools/ocaml/xenstored/oxenstored
+tools/ocaml/test/xtl
 
 tools/debugger/kdd/kdd
 tools/firmware/etherboot/ipxe.tar.gz
diff -r 5173d29f64fa -r 2b433b1523e4 .hgignore
--- a/.hgignore	Tue Nov 20 17:22:21 2012 +0000
+++ b/.hgignore	Tue Nov 20 17:22:21 2012 +0000
@@ -305,6 +305,7 @@
 ^tools/ocaml/libs/xl/xenlight\.ml$
 ^tools/ocaml/libs/xl/xenlight\.mli$
 ^tools/ocaml/xenstored/oxenstored$
+^tools/ocaml/test/xtl$
 ^tools/autom4te\.cache$
 ^tools/config\.h$
 ^tools/config\.log$
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/Makefile
--- a/tools/ocaml/Makefile	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/Makefile	Tue Nov 20 17:22:21 2012 +0000
@@ -1,7 +1,7 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-SUBDIRS_PROGRAMS = xenstored
+SUBDIRS_PROGRAMS = xenstored test
 
 SUBDIRS = libs $(SUBDIRS_PROGRAMS)
 
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/Makefile.rules
--- a/tools/ocaml/Makefile.rules	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/Makefile.rules	Tue Nov 20 17:22:21 2012 +0000
@@ -24,7 +24,7 @@ ALL_OCAML_OBJS ?= $(OBJS)
 %.cmi: %.mli
 	$(call quiet-command, $(OCAMLC) $(OCAMLCFLAGS) -c -o $@ $<,MLI,$@)
 
-%.cmx: %.ml
+%.cmx %.o: %.ml
 	$(call quiet-command, $(OCAMLOPT) $(OCAMLOPTFLAGS) -c -o $@ $<,MLOPT,$@)
 
 %.ml: %.mll
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/libs/Makefile
--- a/tools/ocaml/libs/Makefile	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/Makefile	Tue Nov 20 17:22:21 2012 +0000
@@ -3,6 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 SUBDIRS= \
 	mmap \
+	xentoollog \
 	xc eventchn \
 	xb xs xl
 
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/libs/xentoollog/META.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/libs/xentoollog/META.in	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,4 @@
+version = "@VERSION@"
+description = "Xen Tools Logger Interface"
+archive(byte) = "xentoollog.cma"
+archive(native) = "xentoollog.cmxa"
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/libs/xentoollog/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/libs/xentoollog/Makefile	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,33 @@
+TOPLEVEL=$(CURDIR)/../..
+XEN_ROOT=$(TOPLEVEL)/../..
+include $(TOPLEVEL)/common.make
+
+CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
+OCAMLINCLUDE +=
+
+OBJS = xentoollog
+INTF = xentoollog.cmi
+LIBS = xentoollog.cma xentoollog.cmxa
+
+LIBS_xentoollog = $(LDLIBS_libxenctrl)
+
+xentoollog_OBJS = $(OBJS)
+xentoollog_C_OBJS = xentoollog_stubs
+
+OCAML_LIBRARY = xentoollog
+
+all: $(INTF) $(LIBS)
+
+libs: $(LIBS)
+
+.PHONY: install
+install: $(LIBS) META
+	mkdir -p $(OCAMLDESTDIR)
+	ocamlfind remove -destdir $(OCAMLDESTDIR) xentoollog
+	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xentoollog META $(INTF) $(LIBS) *.a *.so *.cmx
+
+.PHONY: uninstall
+uninstall:
+	ocamlfind remove -destdir $(OCAMLDESTDIR) xentoollog
+
+include $(TOPLEVEL)/Makefile.rules
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/libs/xentoollog/xentoollog.ml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/libs/xentoollog/xentoollog.ml	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,101 @@
+(*
+ * Copyright (C) 2012      Citrix Ltd.
+ * Author Ian Campbell <ian.campbell@citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ *)
+
+open Printf
+open Random
+open Callback
+
+type level = Debug
+	     | Verbose
+	     | Detail
+	     | Progress
+	     | Info
+	     | Notice
+	     | Warn
+	     | Error
+	     | Critical
+
+let level_to_string level =
+  match level with
+  | Debug -> "Debug"
+  | Verbose -> "Verbose"
+  | Detail -> "Detail"
+  | Progress -> "Progress"
+  | Info -> "Info"
+  | Notice -> "Notice"
+  | Warn -> "Warn"
+  | Error -> "Error"
+  | Critical -> "Critical"
+
+let level_to_prio level = 
+  match level with
+  | Debug -> 0
+  | Verbose -> 1
+  | Detail -> 2
+  | Progress -> 3
+  | Info -> 4
+  | Notice -> 5
+  | Warn -> 6
+  | Error -> 7
+  | Critical -> 8
+
+type handle
+
+type logger_cbs = {
+		  vmessage : level -> int option -> string option -> string -> unit;
+		  progress : string option -> string -> int -> int64 -> int64 -> unit;
+		  (*destroy : unit -> unit*) }
+
+external _create_logger: (string * string) -> handle = "stub_xtl_create_logger"
+external test: handle -> unit = "stub_xtl_test"
+
+let create name cbs : handle =
+  (* Callback names are supposed to be unique *)
+  let suffix = string_of_int (Random.int 1000000) in
+  let vmessage_name = sprintf "%s_vmessage_%s" name suffix in
+  let progress_name = sprintf "%s_progress_%s" name suffix in
+  (*let destroy_name = sprintf "%s_destroy" name in*)
+  begin
+    Callback.register vmessage_name cbs.vmessage;
+    Callback.register progress_name cbs.progress;
+    _create_logger (vmessage_name, progress_name)
+  end
+
+
+let stdio_vmessage min_level level errno ctx msg =
+  let level_int = level_to_prio level 
+  and level_str = level_to_string level
+  and errno_str = match errno with None -> "" | Some s -> sprintf ": errno=%d" s
+  and ctx_str = match ctx with None -> "" | Some s -> sprintf ": %s" s in
+  if min_level <= level_int then begin
+    printf "%s%s%s: %s\n" level_str ctx_str errno_str msg;
+    flush stdout;  
+  end;
+  ()
+
+let stdio_progress ctx what percent dne total =
+  let nl = if dne = total then "\n" else "" in
+  printf "\rProgress %s %d%% (%Ld/%Ld)%s" what percent dne total nl;
+  flush stdout;
+  ()
+    
+let create_stdio_logger ?(level=Info) () =
+  let level_int = level_to_prio level in
+  let cbs = {
+    vmessage = stdio_vmessage level_int;
+    progress = stdio_progress; } in
+  create "Xentoollog.stdio_logger" cbs
+
+external destroy: handle -> unit = "stub_xtl_destroy"
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/libs/xentoollog/xentoollog.mli
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/libs/xentoollog/xentoollog.mli	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,52 @@
+(*
+ * Copyright (C) 2012      Citrix Ltd.
+ * Author Ian Campbell <ian.campbell@citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ *)
+
+type level = Debug
+	     | Verbose
+	     | Detail
+	     | Progress (* also used for "progress" messages *)
+	     | Info
+	     | Notice
+	     | Warn
+	     | Error
+	     | Critical
+
+val level_to_string : level -> string
+
+type handle
+
+(** call back arguments. See xentoollog.h for more info.
+    vmessage:
+      level: level as above
+      errno: Some <errno> or None
+      context: Some <string> or None
+      message: The log message (already formatted)
+    progress:
+      context: Some <string> or None
+      doing_what: string
+      percent, done, total.
+*)
+type logger_cbs = {
+		  vmessage : level -> int option -> string option -> string -> unit;
+		  progress : string option -> string -> int -> int64 -> int64 -> unit;
+		  (*destroy : handle -> unit*) }
+
+external test: handle -> unit = "stub_xtl_test"
+
+val create : string -> logger_cbs -> handle
+
+val create_stdio_logger : ?level:level -> unit -> handle
+
+external destroy: handle -> unit = "stub_xtl_destroy"
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/libs/xentoollog/xentoollog_stubs.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,211 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ * Author Ian Campbell <ian.campbell@citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#define CAML_NAME_SPACE
+#include <caml/alloc.h>
+#include <caml/memory.h>
+#include <caml/signals.h>
+#include <caml/fail.h>
+#include <caml/callback.h>
+
+
+#include <xentoollog.h>
+
+struct caml_xtl {
+	xentoollog_logger vtable;
+	char *vmessage_cb;
+	char *progress_cb;
+};
+
+#define HND ((struct caml_xtl*)handle)
+#define XTL ((xentoollog_logger *)HND)
+
+static char * dup_String_val(value s)
+{
+	int len;
+	char *c;
+	len = caml_string_length(s);
+	c = calloc(len + 1, sizeof(char));
+	if (!c)
+		caml_raise_out_of_memory();
+	memcpy(c, String_val(s), len);
+	return c;
+}
+
+static value Val_level(xentoollog_level c_level)
+{
+	/* Must correspond to order in .mli */
+	switch (c_level) {
+	case XTL_NONE: /* Not a real value */
+		caml_raise_sys_error(caml_copy_string("Val_level XTL_NONE"));
+		break;
+	case XTL_DEBUG:    return Val_int(0);
+	case XTL_VERBOSE:  return Val_int(1);
+	case XTL_DETAIL:   return Val_int(2);
+	case XTL_PROGRESS: return Val_int(3);
+	case XTL_INFO:     return Val_int(4);
+	case XTL_NOTICE:   return Val_int(5);
+	case XTL_WARN:     return Val_int(6);
+	case XTL_ERROR:    return Val_int(7);
+	case XTL_CRITICAL: return Val_int(8);
+	case XTL_NUM_LEVELS: /* Not a real value! */
+		caml_raise_sys_error(
+			caml_copy_string("Val_level XTL_NUM_LEVELS"));
+#if 0 /* Let the compiler catch this */
+	default:
+		caml_raise_sys_error(caml_copy_string("Val_level Unknown"));
+		break;
+#endif
+	}
+	abort();
+}
+
+/* Option type support as per http://www.linux-nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php */
+#define Val_none Val_int(0)
+#define Some_val(v) Field(v,0)
+
+static value Val_some(value v)
+{
+	CAMLparam1(v);
+	CAMLlocal1(some);
+	some = caml_alloc(1, 0);
+	Store_field(some, 0, v);
+	CAMLreturn(some);
+}
+
+static value Val_errno(int errnoval)
+{
+	if (errnoval == -1)
+		return Val_none;
+	return Val_some(Val_int(errnoval));
+}
+
+static value Val_context(const char *context)
+{
+	if (context == NULL)
+		return Val_none;
+	return Val_some(caml_copy_string(context));
+}
+
+static void stub_xtl_ocaml_vmessage(struct xentoollog_logger *logger,
+			       xentoollog_level level,
+			       int errnoval,
+			       const char *context,
+			       const char *format,
+			       va_list al)
+{
+	struct caml_xtl *xtl = (struct caml_xtl*)logger;
+	value *func = caml_named_value(xtl->vmessage_cb) ;
+	value args[4];
+	char *msg;
+
+	if (args == NULL)
+		caml_raise_out_of_memory();
+	if (func == NULL)
+		caml_raise_sys_error(caml_copy_string("Unable to find callback"));
+	if (vasprintf(&msg, format, al) < 0)
+		caml_raise_out_of_memory();
+
+	/* vmessage : level -> int option -> string option -> string -> unit; */
+	args[0] = Val_level(level);
+	args[1] = Val_errno(errnoval);
+	args[2] = Val_context(context);
+	args[3] = caml_copy_string(msg);
+
+	free(msg);
+
+	caml_callbackN(*func, 4, args);
+}
+
+static void stub_xtl_ocaml_progress(struct xentoollog_logger *logger,
+				    const char *context,
+				    const char *doing_what /* no \r,\n */,
+				    int percent, unsigned long done, unsigned long total)
+{
+	struct caml_xtl *xtl = (struct caml_xtl*)logger;
+	value *func = caml_named_value(xtl->progress_cb) ;
+	value args[5];
+
+	if (args == NULL)
+		caml_raise_out_of_memory();
+	if (func == NULL)
+		caml_raise_sys_error(caml_copy_string("Unable to find callback"));
+
+	/* progress : string option -> string -> int -> int64 -> int64 -> unit; */
+	args[0] = Val_context(context);
+	args[1] = caml_copy_string(doing_what);
+	args[2] = Val_int(percent);
+	args[3] = caml_copy_int64(done);
+	args[4] = caml_copy_int64(total);
+
+	caml_callbackN(*func, 5, args);
+}
+
+static void xtl_destroy(struct xentoollog_logger *logger)
+{
+	struct caml_xtl *xtl = (struct caml_xtl*)logger;
+	free(xtl->vmessage_cb);
+	free(xtl->progress_cb);
+	free(xtl);
+}
+
+/* external _create_logger: (string * string) -> handle = "stub_xtl_create_logger" */
+CAMLprim value stub_xtl_create_logger(value cbs)
+{
+	CAMLparam1(cbs);
+	struct caml_xtl *xtl = malloc(sizeof(*xtl));
+	if (xtl == NULL)
+		caml_raise_out_of_memory();
+
+	memset(xtl, 0, sizeof(*xtl));
+
+	xtl->vtable.vmessage = &stub_xtl_ocaml_vmessage;
+	xtl->vtable.progress = &stub_xtl_ocaml_progress;
+	xtl->vtable.destroy = &xtl_destroy;
+
+	xtl->vmessage_cb = dup_String_val(Field(cbs, 0));
+	xtl->progress_cb = dup_String_val(Field(cbs, 1));
+	CAMLreturn((value)xtl);
+}
+
+/* external destroy: handle -> unit = "stub_xtl_destroy" */
+CAMLprim value stub_xtl_destroy(value handle)
+{
+	CAMLparam1(handle);
+	xtl_logger_destroy(XTL);
+	CAMLreturn(Val_unit);
+}
+
+/* external test: handle -> unit = "stub_xtl_test" */
+CAMLprim value stub_xtl_test(value handle)
+{
+	unsigned long l;
+	CAMLparam1(handle);
+	xtl_log(XTL, XTL_DEBUG, -1, "debug", "%s -- debug", __func__);
+	xtl_log(XTL, XTL_INFO, -1, "test", "%s -- test 1", __func__);
+	xtl_log(XTL, XTL_INFO, ENOSYS, "test errno", "%s -- test 2", __func__);
+	xtl_log(XTL, XTL_CRITICAL, -1, "critical", "%s -- critical", __func__);
+	for (l = 0UL; l<=100UL; l += 10UL) {
+		xtl_progress(XTL, "progress", "testing", l, 100UL);
+		usleep(10000);
+	}
+	CAMLreturn(Val_unit);
+}
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/test/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,27 @@
+XEN_ROOT = $(CURDIR)/../../..
+OCAML_TOPLEVEL = $(CURDIR)/..
+include $(OCAML_TOPLEVEL)/common.make
+
+OCAMLINCLUDE += \
+	-I $(OCAML_TOPLEVEL)/libs/xentoollog
+
+OBJS = xtl
+
+PROGRAMS = xtl
+
+xtl_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa
+
+xtl_OBJS = xtl
+
+OCAML_PROGRAM = xtl
+
+all: $(PROGRAMS)
+
+bins: $(PROGRAMS)
+
+install: all
+	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
+	$(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(BINDIR)
+
+include $(OCAML_TOPLEVEL)/Makefile.rules
diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/test/xtl.ml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/test/xtl.ml	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,20 @@
+open Arg
+open Xentoollog
+  
+let do_test level = 
+  let lgr = Xentoollog.create_stdio_logger ~level:level () in
+  begin
+    Xentoollog.test lgr;
+    Xentoollog.destroy lgr;
+  end
+
+let () =
+  let debug_level = ref Xentoollog.Info in
+  let speclist = [
+    ("-v", Arg.Unit (fun () -> debug_level := Xentoollog.Debug), "Verbose");
+    ("-q", Arg.Unit (fun () -> debug_level := Xentoollog.Critical), "Quiet");
+  ] in
+  let usage_msg = "usage: xtl [OPTIONS]" in
+  Arg.parse speclist (fun s -> ()) usage_msg;
+
+  do_test !debug_level

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:46:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:46:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tartp-0004sI-3H; Tue, 20 Nov 2012 17:46:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Tartm-0004q0-U6; Tue, 20 Nov 2012 17:46:15 +0000
Received: from [85.158.138.51:5793] by server-1.bemta-3.messagelabs.com id
	64/7C-12169-5E1CBA05; Tue, 20 Nov 2012 17:46:13 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1353433570!11078500!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ4OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9809 invoked from network); 20 Nov 2012 17:46:12 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-13.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:46:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="45198860"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:46:12 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:46:11 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-On;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: e4525795eac22c7d199ceae8714e95ed660a00c4
Message-ID: <e4525795eac22c7d199c.1353432212@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:32 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 12 of 15] libxl: ocaml: switch all functions
 over to take a context
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID e4525795eac22c7d199ceae8714e95ed660a00c4
# Parent  bdd9c3e423d7f505f93edf413a92ad7b47ed9e39
libxl: ocaml: switch all functions over to take a context.

Since the context has a logger we can get rid of the logger built into these
bindings and use the xentoollog bindings instead.

The gc is of limited use when most things are freed with libxl_FOO_dispose,
so get rid of that too.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r bdd9c3e423d7 -r e4525795eac2 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
@@ -8,23 +8,23 @@ import idl
 builtins = {
     "bool":                 ("bool",                   "%(c)s = Bool_val(%(o)s)",           "Val_bool(%(c)s)" ),
     "int":                  ("int",                    "%(c)s = Int_val(%(o)s)",            "Val_int(%(c)s)"  ),
-    "char *":               ("string",                 "%(c)s = dup_String_val(gc, %(o)s)", "caml_copy_string(%(c)s)"),
+    "char *":               ("string",                 "%(c)s = dup_String_val(%(o)s)", "caml_copy_string(%(c)s)"),
     "libxl_domid":          ("domid",                  "%(c)s = Int_val(%(o)s)",            "Val_int(%(c)s)"  ),
     "libxl_devid":          ("devid",                  "%(c)s = Int_val(%(o)s)",            "Val_int(%(c)s)"  ),
     "libxl_defbool":        ("bool option",            "%(c)s = Defbool_val(%(o)s)",        "Val_defbool(%(c)s)" ),
-    "libxl_uuid":           ("int array",              "Uuid_val(gc, lg, &%(c)s, %(o)s)",   "Val_uuid(&%(c)s)"),
-    "libxl_bitmap":         ("bool array",             "Bitmap_val(gc, lg, &%(c)s, %(o)s)",   "Val_bitmap(&%(c)s)"),    
-    "libxl_key_value_list": ("(string * string) list", "libxl_key_value_list_val(gc, lg, &%(c)s, %(o)s)",                              None),
-    "libxl_string_list":    ("string list",            "libxl_string_list_val(gc, lg, &%(c)s, %(o)s)",                                 "String_list_val(gc, lg, &%(c)s, %(o)s)"),
-    "libxl_mac":            ("int array",              "Mac_val(gc, lg, &%(c)s, %(o)s)",    "Val_mac(&%(c)s)"),
+    "libxl_uuid":           ("int array",              "Uuid_val(&%(c)s, %(o)s)",   "Val_uuid(&%(c)s)"),
+    "libxl_bitmap":         ("bool array",             "Bitmap_val(ctx, &%(c)s, %(o)s)",   "Val_bitmap(&%(c)s)"),    
+    "libxl_key_value_list": ("(string * string) list", "libxl_key_value_list_val(&%(c)s, %(o)s)",                              None),
+    "libxl_string_list":    ("string list",            "libxl_string_list_val(&%(c)s, %(o)s)",                                 "String_list_val(&%(c)s, %(o)s)"),
+    "libxl_mac":            ("int array",              "Mac_val(&%(c)s, %(o)s)",    "Val_mac(&%(c)s)"),
     "libxl_hwcap":          ("int32 array",            None,                                "Val_hwcap(&%(c)s)"),
     # This is an opaque type
-    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(gc, lg, &%(c)s, %(o)s)",   "Val_cpuid_policy_list(%(c)s)"),    
+    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(&%(c)s, %(o)s)",   "Val_cpuid_policy_list(%(c)s)"),    
     }
 
-DEVICE_FUNCTIONS = [ ("add",            ["t", "domid", "unit"]),
-                     ("remove",         ["t", "domid", "unit"]),
-                     ("destroy",        ["t", "domid", "unit"]),
+DEVICE_FUNCTIONS = [ ("add",            ["handle", "t", "domid", "unit"]),
+                     ("remove",         ["handle", "t", "domid", "unit"]),
+                     ("destroy",        ["handle", "t", "domid", "unit"]),
                    ]
 
 functions = { # ( name , [type1,type2,....] )
@@ -33,13 +33,13 @@ functions = { # ( name , [type1,type2,..
     "device_disk":    DEVICE_FUNCTIONS,
     "device_nic":     DEVICE_FUNCTIONS,
     "device_pci":     DEVICE_FUNCTIONS,
-    "physinfo":       [ ("get",            ["unit", "t"]),
+    "physinfo":       [ ("get",            ["handle", "t"]),
                       ],
-    "cputopology":    [ ("get",            ["unit", "t array"]),
+    "cputopology":    [ ("get",            ["handle", "t array"]),
                       ],
     "domain_sched_params":
-                      [ ("get",            ["domid", "t"]),
-                        ("set",            ["domid", "t", "unit"]),
+                      [ ("get",            ["handle", "domid", "t"]),
+                        ("set",            ["handle", "domid", "t", "unit"]),
                       ],
 }
 def stub_fn_name(ty, name):
@@ -228,7 +228,7 @@ def c_val(ty, c, o, indent="", parent = 
         for e in ty.values:
             s += "    case %d: *%s = %s; break;\n" % (n, c, e.name)
             n += 1
-        s += "    default: failwith_xl(\"cannot convert value to %s\", lg); break;\n" % ty.typename
+        s += "    default: failwith_xl(\"cannot convert value to %s\"); break;\n" % ty.typename
         s += "}"
     elif isinstance(ty, idl.KeyedUnion):
         s += "{\n"
@@ -241,7 +241,7 @@ def c_val(ty, c, o, indent="", parent = 
                                                     parent + ty.keyvar.name,
                                                     f.enumname)
             n += 1
-        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (long)\", lg); break;\n" % (parent, ty.keyvar.name)        
+        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (long)\"); break;\n" % (parent, ty.keyvar.name)        
         s += "\t\t}\n"
         s += "\t} else {\n"
         s += "\t\t/* Is block... */\n"
@@ -257,7 +257,7 @@ def c_val(ty, c, o, indent="", parent = 
                 s += "%s" % c_val(f.type, fexpr, o, indent=indent+"\t\t        ")
                 s += "break;\n"
             n += 1
-        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (block)\", lg); break;\n" % (parent, ty.keyvar.name)
+        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (block)\"); break;\n" % (parent, ty.keyvar.name)
         s += "\t\t}\n"
         s += "\t}\n"
         s += "}"
@@ -270,14 +270,14 @@ def c_val(ty, c, o, indent="", parent = 
             s += "%s\n" % c_val(f.type, fexpr, "Field(%s, %d)" % (o,n), parent=nparent)
             n = n + 1
     else:
-        s += "%s_val(gc, lg, %s, %s);" % (ty.rawname, ty.pass_arg(c, parent is None, passby=idl.PASS_BY_REFERENCE), o)
+        s += "%s_val(ctx, %s, %s);" % (ty.rawname, ty.pass_arg(c, parent is None, passby=idl.PASS_BY_REFERENCE), o)
     
     return s.replace("\n", "\n%s" % indent)
 
 def gen_c_val(ty, indent=""):
     s = "/* Convert caml value to %s */\n" % ty.rawname
     
-    s += "static int %s_val (caml_gc *gc, struct caml_logger *lg, %s, value v)\n" % (ty.rawname, ty.make_arg("c_val", passby=idl.PASS_BY_REFERENCE))
+    s += "static int %s_val (libxl_ctx *ctx, %s, value v)\n" % (ty.rawname, ty.make_arg("c_val", passby=idl.PASS_BY_REFERENCE))
     s += "{\n"
     s += "\tCAMLparam1(v);\n"
     s += "\n"
@@ -326,7 +326,7 @@ def ocaml_Val(ty, o, c, indent="", paren
         for e in ty.values:
             s += "    case %s: %s = Int_val(%d); break;\n" % (e.name, o, n)
             n += 1
-        s += "    default: failwith_xl(\"cannot convert value from %s\", lg); break;\n" % ty.typename
+        s += "    default: failwith_xl(\"cannot convert value from %s\"); break;\n" % ty.typename
         s += "}"
     elif isinstance(ty, idl.KeyedUnion):
         n = 0
@@ -347,7 +347,7 @@ def ocaml_Val(ty, o, c, indent="", paren
                 #s += "\t        %s = caml_alloc(%d,%d);\n" % (o,len(f.type.fields),n)
             s += "\t        break;\n"
             n += 1
-        s += "\t    default: failwith_xl(\"cannot convert value from %s\", lg); break;\n" % ty.typename
+        s += "\t    default: failwith_xl(\"cannot convert value from %s\"); break;\n" % ty.typename
         s += "\t}"
     elif isinstance(ty,idl.Aggregate) and (parent is None or ty.rawname is None):
         s += "{\n"
@@ -375,14 +375,14 @@ def ocaml_Val(ty, o, c, indent="", paren
             n = n + 1
         s += "}"
     else:
-        s += "%s = Val_%s(gc, lg, %s);" % (o, ty.rawname, ty.pass_arg(c, parent is None))
+        s += "%s = Val_%s(ctx, %s);" % (o, ty.rawname, ty.pass_arg(c, parent is None))
     
     return s.replace("\n", "\n%s" % indent).rstrip(indent)
 
 def gen_Val_ocaml(ty, indent=""):
     s = "/* Convert %s to a caml value */\n" % ty.rawname
 
-    s += "static value Val_%s (caml_gc *gc, struct caml_logger *lg, %s)\n" % (ty.rawname, ty.make_arg(ty.rawname+"_c"))
+    s += "static value Val_%s (libxl_ctx *ctx, %s)\n" % (ty.rawname, ty.make_arg(ty.rawname+"_c"))
     s += "{\n"
     s += "\tCAMLparam0();\n"
     s += "\tCAMLlocal1(%s_ocaml);\n" % ty.rawname
diff -r bdd9c3e423d7 -r e4525795eac2 tools/ocaml/libs/xl/xenlight.ml.in
--- a/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
@@ -37,4 +37,4 @@ external send_trigger : domid -> trigger
 external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
 external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
 
-let _ = Callback.register_exception "xl.error" (Error "register_callback")
+let _ = Callback.register_exception "Xenlight.Error" (Error(""))
diff -r bdd9c3e423d7 -r e4525795eac2 tools/ocaml/libs/xl/xenlight_stubs.c
--- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
@@ -31,49 +31,7 @@
 
 #define CTX ((libxl_ctx *)ctx)
 
-struct caml_logger {
-	struct xentoollog_logger logger;
-	int log_offset;
-	char log_buf[2048];
-};
-
-typedef struct caml_gc {
-	int offset;
-	void *ptrs[64];
-} caml_gc;
-
-static void log_vmessage(struct xentoollog_logger *logger, xentoollog_level level,
-                  int errnoval, const char *context, const char *format, va_list al)
-{
-	struct caml_logger *ologger = (struct caml_logger *) logger;
-
-	ologger->log_offset += vsnprintf(ologger->log_buf + ologger->log_offset,
-	                                 2048 - ologger->log_offset, format, al);
-}
-
-static void log_destroy(struct xentoollog_logger *logger)
-{
-}
-
-#define INIT_STRUCT() libxl_ctx *ctx; struct caml_logger lg; struct caml_gc gc; gc.offset = 0;
-
-#define INIT_CTX()  \
-	lg.logger.vmessage = log_vmessage; \
-	lg.logger.destroy = log_destroy; \
-	lg.logger.progress = NULL; \
-	lg.log_offset = 0; \
-	memset(&lg.log_buf,0,sizeof(lg.log_buf));	\
-	caml_enter_blocking_section(); \
-	ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct xentoollog_logger *) &lg); \
-	if (ret != 0) \
-		failwith_xl("cannot init context", &lg);
-
-#define FREE_CTX()  \
-	gc_free(&gc); \
-	caml_leave_blocking_section(); \
-	libxl_ctx_free(ctx)
-
-static char * dup_String_val(caml_gc *gc, value s)
+static char * dup_String_val(value s)
 {
 	int len;
 	char *c;
@@ -81,25 +39,16 @@ static char * dup_String_val(caml_gc *gc
 	c = calloc(len + 1, sizeof(char));
 	if (!c)
 		caml_raise_out_of_memory();
-	if (gc) gc->ptrs[gc->offset++] = c;
 	memcpy(c, String_val(s), len);
 	return c;
 }
 
-static void gc_free(caml_gc *gc)
+static void failwith_xl(char *fname)
 {
-	int i;
-	for (i = 0; i < gc->offset; i++) {
-		free(gc->ptrs[i]);
-	}
-}
-
-static void failwith_xl(char *fname, struct caml_logger *lg)
-{
-	char *s;
-	s = (lg) ? lg->log_buf : fname;
-	printf("Error: %s\n", fname);
-	caml_raise_with_string(*caml_named_value("xl.error"), s);
+	value *exc = caml_named_value("Xenlight.Error");
+	if (!exc)
+		caml_invalid_argument("Exception Xenlight.Error not initialized, please link xl.cma");
+	caml_raise_with_string(*exc, fname);
 }
 
 CAMLprim value stub_libxl_ctx_alloc(value logger)
@@ -111,7 +60,7 @@ CAMLprim value stub_libxl_ctx_alloc(valu
 	caml_enter_blocking_section();
 	ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct xentoollog_logger *) logger);
 	if (ret != 0) \
-		failwith_xl("cannot init context", NULL);
+		failwith_xl("cannot init context");
 	caml_leave_blocking_section();
 	CAMLreturn((value)ctx);
 }
@@ -127,16 +76,6 @@ CAMLprim value stub_libxl_ctx_free(value
 	CAMLreturn(Val_unit);
 }
 
-static void * gc_calloc(caml_gc *gc, size_t nmemb, size_t size)
-{
-	void *ptr;
-	ptr = calloc(nmemb, size);
-	if (!ptr)
-		caml_raise_out_of_memory();
-	gc->ptrs[gc->offset++] = ptr;
-	return ptr;
-}
-
 static int list_len(value v)
 {
 	int len = 0;
@@ -147,8 +86,7 @@ static int list_len(value v)
 	return len;
 }
 
-static int libxl_key_value_list_val(caml_gc *gc, struct caml_logger *lg,
-				    libxl_key_value_list *c_val,
+static int libxl_key_value_list_val(libxl_key_value_list *c_val,
 				    value v)
 {
 	CAMLparam1(v);
@@ -158,24 +96,22 @@ static int libxl_key_value_list_val(caml
 
 	nr = list_len(v);
 
-	array = gc_calloc(gc, (nr + 1) * 2, sizeof(char *));
+	array = calloc((nr + 1) * 2, sizeof(char *));
 	if (!array)
 		caml_raise_out_of_memory();
 
 	for (i=0; v != Val_emptylist; i++, v = Field(v, 1) ) {
 		elem = Field(v, 0);
 
-		array[i * 2] = dup_String_val(gc, Field(elem, 0));
-		array[i * 2 + 1] = dup_String_val(gc, Field(elem, 1));
+		array[i * 2] = dup_String_val(Field(elem, 0));
+		array[i * 2 + 1] = dup_String_val(Field(elem, 1));
 	}
 
 	*c_val = array;
 	CAMLreturn(0);
 }
 
-static int libxl_string_list_val(caml_gc *gc, struct caml_logger *lg,
-				 libxl_string_list *c_val,
-				 value v)
+static int libxl_string_list_val(libxl_string_list *c_val, value v)
 {
 	CAMLparam1(v);
 	int nr, i;
@@ -183,12 +119,12 @@ static int libxl_string_list_val(caml_gc
 
 	nr = list_len(v);
 
-	array = gc_calloc(gc, (nr + 1), sizeof(char *));
+	array = calloc(nr + 1, sizeof(char *));
 	if (!array)
 		caml_raise_out_of_memory();
 
 	for (i=0; v != Val_emptylist; i++, v = Field(v, 1) )
-		array[i] = dup_String_val(gc, Field(v, 0));
+		array[i] = dup_String_val(Field(v, 0));
 
 	*c_val = array;
 	CAMLreturn(0);
@@ -221,7 +157,7 @@ static value Val_mac (libxl_mac *c_val)
 	CAMLreturn(v);
 }
 
-static int Mac_val(caml_gc *gc, struct caml_logger *lg, libxl_mac *c_val, value v)
+static int Mac_val(libxl_mac *c_val, value v)
 {
 	CAMLparam1(v);
 	int i;
@@ -248,10 +184,20 @@ static value Val_bitmap (libxl_bitmap *c
 	CAMLreturn(v);
 }
 
-static int Bitmap_val(caml_gc *gc, struct caml_logger *lg,
-		      libxl_bitmap *c_val, value v)
+static int Bitmap_val(libxl_ctx *ctx, libxl_bitmap *c_val, value v)
 {
-	abort(); /* XXX */
+	CAMLparam1(v);
+	int i, len = Wosize_val(v);
+
+	if (!libxl_bitmap_alloc(ctx, c_val, len))
+		failwith_xl("cannot allocate bitmap");
+	for (i=0; i<len; i++) {
+		if (Int_val(Field(v, i)))
+			libxl_bitmap_set(c_val, i);
+		else
+			libxl_bitmap_reset(c_val, i);
+	}
+	CAMLreturn(0);
 }
 
 static value Val_cpuid_policy_list(libxl_cpuid_policy_list c_val)
@@ -261,8 +207,7 @@ static value Val_cpuid_policy_list(libxl
 	CAMLreturn((value)c_val);
 }
 
-static int Cpuid_policy_list_val(caml_gc *gc, struct caml_logger *lg,
-				 libxl_cpuid_policy_list *c_val, value v)
+static int Cpuid_policy_list_val(libxl_cpuid_policy_list *c_val, value v)
 {
 	CAMLparam1(v);
 
@@ -287,7 +232,7 @@ static value Val_uuid (libxl_uuid *c_val
 	CAMLreturn(v);
 }
 
-static int Uuid_val(caml_gc *gc, struct caml_logger *lg, libxl_uuid *c_val, value v)
+static int Uuid_val(libxl_uuid *c_val, value v)
 {
 	CAMLparam1(v);
 	int i;
@@ -345,14 +290,12 @@ value stub_libxl_list_domain(value ctx)
 {
 	CAMLparam1(ctx);
 	CAMLlocal2( cli, cons );
-	struct caml_gc gc;
 	libxl_dominfo *info;
 	int i, nr;
 
-	gc.offset = 0;
 	info = libxl_list_domain(CTX, &nr);
 	if (info == NULL)
-		failwith_xl("list_domain", NULL);
+		failwith_xl("list_domain");
 
 	cli = Val_emptylist;
 
@@ -360,7 +303,7 @@ value stub_libxl_list_domain(value ctx)
 		cons = caml_alloc(2, 0);
 
 		/* Head */
-		Store_field(cons, 0, Val_dominfo(&gc, NULL, &info[i]));
+		Store_field(cons, 0, Val_dominfo(CTX, &info[i]));
 		/* Tail */
 		Store_field(cons, 1, cli);
 
@@ -369,259 +312,77 @@ value stub_libxl_list_domain(value ctx)
 
 	libxl_dominfo_list_free(info, nr);
 
-	gc_free(&gc);
-
 	CAMLreturn(cli);
 }
 
-value stub_xl_device_disk_add(value info, value domid)
-{
-	CAMLparam2(info, domid);
-	libxl_device_disk c_info;
-	int ret;
-	INIT_STRUCT();
+#define _STRINGIFY(x) #x
+#define STRINGIFY(x) _STRINGIFY(x)
 
-	device_disk_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_disk_add(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("disk_add", &lg);
-	FREE_CTX();
-	CAMLreturn(Val_unit);
+#define _DEVICE_ADDREMOVE(type,op)					\
+value stub_xl_device_##type##_##op(value ctx, value info, value domid)	\
+{									\
+	CAMLparam3(ctx, info, domid);					\
+	libxl_device_##type c_info;					\
+	int ret, marker_var;						\
+									\
+	device_##type##_val(CTX, &c_info, info);			\
+									\
+	ret = libxl_device_##type##_##op(CTX, Int_val(domid), &c_info, 0); \
+									\
+	libxl_device_##type##_dispose(&c_info);				\
+									\
+	if (ret != 0)							\
+		failwith_xl(STRINGIFY(type) "_" STRINGIFY(op));		\
+									\
+	CAMLreturn(Val_unit);						\
 }
 
-value stub_xl_device_disk_del(value info, value domid)
+#define DEVICE_ADDREMOVE(type) \
+	_DEVICE_ADDREMOVE(type, add) \
+ 	_DEVICE_ADDREMOVE(type, remove) \
+ 	_DEVICE_ADDREMOVE(type, destroy)
+
+DEVICE_ADDREMOVE(disk)
+DEVICE_ADDREMOVE(nic)
+DEVICE_ADDREMOVE(vfb)
+DEVICE_ADDREMOVE(vkb)
+DEVICE_ADDREMOVE(pci)
+
+value stub_xl_physinfo_get(value ctx)
 {
-	CAMLparam2(info, domid);
-	libxl_device_disk c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_disk_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_disk_remove(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("disk_del", &lg);
-	FREE_CTX();
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_nic_add(value info, value domid)
-{
-	CAMLparam2(info, domid);
-	libxl_device_nic c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_nic_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_nic_add(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("nic_add", &lg);
-	FREE_CTX();
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_nic_del(value info, value domid)
-{
-	CAMLparam2(info, domid);
-	libxl_device_nic c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_nic_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_nic_remove(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("nic_del", &lg);
-	FREE_CTX();
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_vkb_add(value info, value domid)
-{
-	CAMLparam2(info, domid);
-	libxl_device_vkb c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_vkb_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_vkb_add(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("vkb_add", &lg);
-	FREE_CTX();
-
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_vkb_remove(value info, value domid)
-{
-	CAMLparam1(domid);
-	libxl_device_vkb c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_vkb_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_vkb_remove(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("vkb_clean_shutdown", &lg);
-	FREE_CTX();
-
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_vkb_destroy(value info, value domid)
-{
-	CAMLparam1(domid);
-	libxl_device_vkb c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_vkb_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_vkb_destroy(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("vkb_hard_shutdown", &lg);
-	FREE_CTX();
-
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_vfb_add(value info, value domid)
-{
-	CAMLparam2(info, domid);
-	libxl_device_vfb c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_vfb_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_vfb_add(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("vfb_add", &lg);
-	FREE_CTX();
-
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_vfb_remove(value info, value domid)
-{
-	CAMLparam1(domid);
-	libxl_device_vfb c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_vfb_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_vfb_remove(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("vfb_clean_shutdown", &lg);
-	FREE_CTX();
-
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_vfb_destroy(value info, value domid)
-{
-	CAMLparam1(domid);
-	libxl_device_vfb c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_vfb_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_vfb_destroy(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("vfb_hard_shutdown", &lg);
-	FREE_CTX();
-
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_pci_add(value info, value domid)
-{
-	CAMLparam2(info, domid);
-	libxl_device_pci c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_pci_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_pci_add(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("pci_add", &lg);
-	FREE_CTX();
-
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_pci_remove(value info, value domid)
-{
-	CAMLparam2(info, domid);
-	libxl_device_pci c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_pci_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_pci_remove(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("pci_remove", &lg);
-	FREE_CTX();
-
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_physinfo_get(value unit)
-{
-	CAMLparam1(unit);
+	CAMLparam1(ctx);
 	CAMLlocal1(physinfo);
 	libxl_physinfo c_physinfo;
 	int ret;
-	INIT_STRUCT();
 
-	INIT_CTX();
-	ret = libxl_get_physinfo(ctx, &c_physinfo);
+	ret = libxl_get_physinfo(CTX, &c_physinfo);
+
 	if (ret != 0)
-		failwith_xl("physinfo", &lg);
-	FREE_CTX();
+		failwith_xl("get_physinfo");
 
-	physinfo = Val_physinfo(&gc, &lg, &c_physinfo);
+	physinfo = Val_physinfo(CTX, &c_physinfo);
+
+	libxl_physinfo_dispose(&c_physinfo);
+
 	CAMLreturn(physinfo);
 }
 
-value stub_xl_cputopology_get(value unit)
+value stub_xl_cputopology_get(value ctx)
 {
-	CAMLparam1(unit);
+	CAMLparam1(ctx);
 	CAMLlocal2(topology, v);
 	libxl_cputopology *c_topology;
-	int i, nr, ret;
-	INIT_STRUCT();
+	int i, nr;
 
-	INIT_CTX();
+	c_topology = libxl_get_cpu_topology(CTX, &nr);
 
-	c_topology = libxl_get_cpu_topology(ctx, &nr);
-	if (ret != 0)
-		failwith_xl("topologyinfo", &lg);
+	if (!c_topology)
+		failwith_xl("topologyinfo");
 
 	topology = caml_alloc_tuple(nr);
 	for (i = 0; i < nr; i++) {
 		if (c_topology[i].core != LIBXL_CPUTOPOLOGY_INVALID_ENTRY)
-			v = Val_some(Val_cputopology(&gc, &lg, &c_topology[i]));
+			v = Val_some(Val_cputopology(CTX, &c_topology[i]));
 		else
 			v = Val_none;
 		Store_field(topology, i, v);
@@ -629,74 +390,72 @@ value stub_xl_cputopology_get(value unit
 
 	libxl_cputopology_list_free(c_topology, nr);
 
-	FREE_CTX();
 	CAMLreturn(topology);
 }
 
-value stub_xl_domain_sched_params_get(value domid)
+value stub_xl_domain_sched_params_get(value ctx, value domid)
 {
-	CAMLparam1(domid);
+	CAMLparam2(ctx, domid);
 	CAMLlocal1(scinfo);
 	libxl_domain_sched_params c_scinfo;
 	int ret;
-	INIT_STRUCT();
 
-	INIT_CTX();
-	ret = libxl_domain_sched_params_get(ctx, Int_val(domid), &c_scinfo);
+	ret = libxl_domain_sched_params_get(CTX, Int_val(domid), &c_scinfo);
 	if (ret != 0)
-		failwith_xl("domain_sched_params_get", &lg);
-	FREE_CTX();
+		failwith_xl("domain_sched_params_get");
 
-	scinfo = Val_domain_sched_params(&gc, &lg, &c_scinfo);
+	scinfo = Val_domain_sched_params(CTX, &c_scinfo);
+
+	libxl_domain_sched_params_dispose(&c_scinfo);
+
 	CAMLreturn(scinfo);
 }
 
-value stub_xl_domain_sched_params_set(value domid, value scinfo)
+value stub_xl_domain_sched_params_set(value ctx, value domid, value scinfo)
 {
-	CAMLparam2(domid, scinfo);
+	CAMLparam3(ctx, domid, scinfo);
 	libxl_domain_sched_params c_scinfo;
 	int ret;
-	INIT_STRUCT();
 
-	domain_sched_params_val(&gc, &lg, &c_scinfo, scinfo);
+	domain_sched_params_val(CTX, &c_scinfo, scinfo);
 
-	INIT_CTX();
-	ret = libxl_domain_sched_params_set(ctx, Int_val(domid), &c_scinfo);
+	ret = libxl_domain_sched_params_set(CTX, Int_val(domid), &c_scinfo);
+
+	libxl_domain_sched_params_dispose(&c_scinfo);
+
 	if (ret != 0)
-		failwith_xl("domain_sched_params_set", &lg);
-	FREE_CTX();
+		failwith_xl("domain_sched_params_set");
 
 	CAMLreturn(Val_unit);
 }
 
-value stub_xl_send_trigger(value domid, value trigger, value vcpuid)
+value stub_xl_send_trigger(value ctx, value domid, value trigger, value vcpuid)
 {
-	CAMLparam3(domid, trigger, vcpuid);
+	CAMLparam4(ctx, domid, trigger, vcpuid);
 	int ret;
 	libxl_trigger c_trigger = LIBXL_TRIGGER_UNKNOWN;
-	INIT_STRUCT();
 
-	trigger_val(&gc, &lg, &c_trigger, trigger);
+	trigger_val(CTX, &c_trigger, trigger);
 
-	INIT_CTX();
-	ret = libxl_send_trigger(ctx, Int_val(domid), c_trigger, Int_val(vcpuid));
+	ret = libxl_send_trigger(CTX, Int_val(domid),
+				 c_trigger, Int_val(vcpuid));
+
 	if (ret != 0)
-		failwith_xl("send_trigger", &lg);
-	FREE_CTX();
+		failwith_xl("send_trigger");
+
 	CAMLreturn(Val_unit);
 }
 
-value stub_xl_send_sysrq(value domid, value sysrq)
+value stub_xl_send_sysrq(value ctx, value domid, value sysrq)
 {
-	CAMLparam2(domid, sysrq);
+	CAMLparam3(ctx, domid, sysrq);
 	int ret;
-	INIT_STRUCT();
 
-	INIT_CTX();
-	ret = libxl_send_sysrq(ctx, Int_val(domid), Int_val(sysrq));
+	ret = libxl_send_sysrq(CTX, Int_val(domid), Int_val(sysrq));
+
 	if (ret != 0)
-		failwith_xl("send_sysrq", &lg);
-	FREE_CTX();
+		failwith_xl("send_sysrq");
+
 	CAMLreturn(Val_unit);
 }
 
@@ -706,11 +465,11 @@ value stub_xl_send_debug_keys(value ctx,
 	int ret;
 	char *c_keys;
 
-	c_keys = dup_String_val(NULL, keys);
+	c_keys = dup_String_val(keys);
 
 	ret = libxl_send_debug_keys(CTX, c_keys);
 	if (ret != 0)
-		failwith_xl("send_debug_keys", NULL);
+		failwith_xl("send_debug_keys");
 
 	free(c_keys);
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:46:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:46:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tartp-0004sI-3H; Tue, 20 Nov 2012 17:46:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Tartm-0004q0-U6; Tue, 20 Nov 2012 17:46:15 +0000
Received: from [85.158.138.51:5793] by server-1.bemta-3.messagelabs.com id
	64/7C-12169-5E1CBA05; Tue, 20 Nov 2012 17:46:13 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1353433570!11078500!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ4OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9809 invoked from network); 20 Nov 2012 17:46:12 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-13.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:46:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="45198860"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:46:12 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:46:11 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-On;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: e4525795eac22c7d199ceae8714e95ed660a00c4
Message-ID: <e4525795eac22c7d199c.1353432212@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:32 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 12 of 15] libxl: ocaml: switch all functions
 over to take a context
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID e4525795eac22c7d199ceae8714e95ed660a00c4
# Parent  bdd9c3e423d7f505f93edf413a92ad7b47ed9e39
libxl: ocaml: switch all functions over to take a context.

Since the context has a logger we can get rid of the logger built into these
bindings and use the xentoollog bindings instead.

The gc is of limited use when most things are freed with libxl_FOO_dispose,
so get rid of that too.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r bdd9c3e423d7 -r e4525795eac2 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
@@ -8,23 +8,23 @@ import idl
 builtins = {
     "bool":                 ("bool",                   "%(c)s = Bool_val(%(o)s)",           "Val_bool(%(c)s)" ),
     "int":                  ("int",                    "%(c)s = Int_val(%(o)s)",            "Val_int(%(c)s)"  ),
-    "char *":               ("string",                 "%(c)s = dup_String_val(gc, %(o)s)", "caml_copy_string(%(c)s)"),
+    "char *":               ("string",                 "%(c)s = dup_String_val(%(o)s)", "caml_copy_string(%(c)s)"),
     "libxl_domid":          ("domid",                  "%(c)s = Int_val(%(o)s)",            "Val_int(%(c)s)"  ),
     "libxl_devid":          ("devid",                  "%(c)s = Int_val(%(o)s)",            "Val_int(%(c)s)"  ),
     "libxl_defbool":        ("bool option",            "%(c)s = Defbool_val(%(o)s)",        "Val_defbool(%(c)s)" ),
-    "libxl_uuid":           ("int array",              "Uuid_val(gc, lg, &%(c)s, %(o)s)",   "Val_uuid(&%(c)s)"),
-    "libxl_bitmap":         ("bool array",             "Bitmap_val(gc, lg, &%(c)s, %(o)s)",   "Val_bitmap(&%(c)s)"),    
-    "libxl_key_value_list": ("(string * string) list", "libxl_key_value_list_val(gc, lg, &%(c)s, %(o)s)",                              None),
-    "libxl_string_list":    ("string list",            "libxl_string_list_val(gc, lg, &%(c)s, %(o)s)",                                 "String_list_val(gc, lg, &%(c)s, %(o)s)"),
-    "libxl_mac":            ("int array",              "Mac_val(gc, lg, &%(c)s, %(o)s)",    "Val_mac(&%(c)s)"),
+    "libxl_uuid":           ("int array",              "Uuid_val(&%(c)s, %(o)s)",   "Val_uuid(&%(c)s)"),
+    "libxl_bitmap":         ("bool array",             "Bitmap_val(ctx, &%(c)s, %(o)s)",   "Val_bitmap(&%(c)s)"),    
+    "libxl_key_value_list": ("(string * string) list", "libxl_key_value_list_val(&%(c)s, %(o)s)",                              None),
+    "libxl_string_list":    ("string list",            "libxl_string_list_val(&%(c)s, %(o)s)",                                 "String_list_val(&%(c)s, %(o)s)"),
+    "libxl_mac":            ("int array",              "Mac_val(&%(c)s, %(o)s)",    "Val_mac(&%(c)s)"),
     "libxl_hwcap":          ("int32 array",            None,                                "Val_hwcap(&%(c)s)"),
     # This is an opaque type
-    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(gc, lg, &%(c)s, %(o)s)",   "Val_cpuid_policy_list(%(c)s)"),    
+    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(&%(c)s, %(o)s)",   "Val_cpuid_policy_list(%(c)s)"),    
     }
 
-DEVICE_FUNCTIONS = [ ("add",            ["t", "domid", "unit"]),
-                     ("remove",         ["t", "domid", "unit"]),
-                     ("destroy",        ["t", "domid", "unit"]),
+DEVICE_FUNCTIONS = [ ("add",            ["handle", "t", "domid", "unit"]),
+                     ("remove",         ["handle", "t", "domid", "unit"]),
+                     ("destroy",        ["handle", "t", "domid", "unit"]),
                    ]
 
 functions = { # ( name , [type1,type2,....] )
@@ -33,13 +33,13 @@ functions = { # ( name , [type1,type2,..
     "device_disk":    DEVICE_FUNCTIONS,
     "device_nic":     DEVICE_FUNCTIONS,
     "device_pci":     DEVICE_FUNCTIONS,
-    "physinfo":       [ ("get",            ["unit", "t"]),
+    "physinfo":       [ ("get",            ["handle", "t"]),
                       ],
-    "cputopology":    [ ("get",            ["unit", "t array"]),
+    "cputopology":    [ ("get",            ["handle", "t array"]),
                       ],
     "domain_sched_params":
-                      [ ("get",            ["domid", "t"]),
-                        ("set",            ["domid", "t", "unit"]),
+                      [ ("get",            ["handle", "domid", "t"]),
+                        ("set",            ["handle", "domid", "t", "unit"]),
                       ],
 }
 def stub_fn_name(ty, name):
@@ -228,7 +228,7 @@ def c_val(ty, c, o, indent="", parent = 
         for e in ty.values:
             s += "    case %d: *%s = %s; break;\n" % (n, c, e.name)
             n += 1
-        s += "    default: failwith_xl(\"cannot convert value to %s\", lg); break;\n" % ty.typename
+        s += "    default: failwith_xl(\"cannot convert value to %s\"); break;\n" % ty.typename
         s += "}"
     elif isinstance(ty, idl.KeyedUnion):
         s += "{\n"
@@ -241,7 +241,7 @@ def c_val(ty, c, o, indent="", parent = 
                                                     parent + ty.keyvar.name,
                                                     f.enumname)
             n += 1
-        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (long)\", lg); break;\n" % (parent, ty.keyvar.name)        
+        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (long)\"); break;\n" % (parent, ty.keyvar.name)        
         s += "\t\t}\n"
         s += "\t} else {\n"
         s += "\t\t/* Is block... */\n"
@@ -257,7 +257,7 @@ def c_val(ty, c, o, indent="", parent = 
                 s += "%s" % c_val(f.type, fexpr, o, indent=indent+"\t\t        ")
                 s += "break;\n"
             n += 1
-        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (block)\", lg); break;\n" % (parent, ty.keyvar.name)
+        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (block)\"); break;\n" % (parent, ty.keyvar.name)
         s += "\t\t}\n"
         s += "\t}\n"
         s += "}"
@@ -270,14 +270,14 @@ def c_val(ty, c, o, indent="", parent = 
             s += "%s\n" % c_val(f.type, fexpr, "Field(%s, %d)" % (o,n), parent=nparent)
             n = n + 1
     else:
-        s += "%s_val(gc, lg, %s, %s);" % (ty.rawname, ty.pass_arg(c, parent is None, passby=idl.PASS_BY_REFERENCE), o)
+        s += "%s_val(ctx, %s, %s);" % (ty.rawname, ty.pass_arg(c, parent is None, passby=idl.PASS_BY_REFERENCE), o)
     
     return s.replace("\n", "\n%s" % indent)
 
 def gen_c_val(ty, indent=""):
     s = "/* Convert caml value to %s */\n" % ty.rawname
     
-    s += "static int %s_val (caml_gc *gc, struct caml_logger *lg, %s, value v)\n" % (ty.rawname, ty.make_arg("c_val", passby=idl.PASS_BY_REFERENCE))
+    s += "static int %s_val (libxl_ctx *ctx, %s, value v)\n" % (ty.rawname, ty.make_arg("c_val", passby=idl.PASS_BY_REFERENCE))
     s += "{\n"
     s += "\tCAMLparam1(v);\n"
     s += "\n"
@@ -326,7 +326,7 @@ def ocaml_Val(ty, o, c, indent="", paren
         for e in ty.values:
             s += "    case %s: %s = Int_val(%d); break;\n" % (e.name, o, n)
             n += 1
-        s += "    default: failwith_xl(\"cannot convert value from %s\", lg); break;\n" % ty.typename
+        s += "    default: failwith_xl(\"cannot convert value from %s\"); break;\n" % ty.typename
         s += "}"
     elif isinstance(ty, idl.KeyedUnion):
         n = 0
@@ -347,7 +347,7 @@ def ocaml_Val(ty, o, c, indent="", paren
                 #s += "\t        %s = caml_alloc(%d,%d);\n" % (o,len(f.type.fields),n)
             s += "\t        break;\n"
             n += 1
-        s += "\t    default: failwith_xl(\"cannot convert value from %s\", lg); break;\n" % ty.typename
+        s += "\t    default: failwith_xl(\"cannot convert value from %s\"); break;\n" % ty.typename
         s += "\t}"
     elif isinstance(ty,idl.Aggregate) and (parent is None or ty.rawname is None):
         s += "{\n"
@@ -375,14 +375,14 @@ def ocaml_Val(ty, o, c, indent="", paren
             n = n + 1
         s += "}"
     else:
-        s += "%s = Val_%s(gc, lg, %s);" % (o, ty.rawname, ty.pass_arg(c, parent is None))
+        s += "%s = Val_%s(ctx, %s);" % (o, ty.rawname, ty.pass_arg(c, parent is None))
     
     return s.replace("\n", "\n%s" % indent).rstrip(indent)
 
 def gen_Val_ocaml(ty, indent=""):
     s = "/* Convert %s to a caml value */\n" % ty.rawname
 
-    s += "static value Val_%s (caml_gc *gc, struct caml_logger *lg, %s)\n" % (ty.rawname, ty.make_arg(ty.rawname+"_c"))
+    s += "static value Val_%s (libxl_ctx *ctx, %s)\n" % (ty.rawname, ty.make_arg(ty.rawname+"_c"))
     s += "{\n"
     s += "\tCAMLparam0();\n"
     s += "\tCAMLlocal1(%s_ocaml);\n" % ty.rawname
diff -r bdd9c3e423d7 -r e4525795eac2 tools/ocaml/libs/xl/xenlight.ml.in
--- a/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
@@ -37,4 +37,4 @@ external send_trigger : domid -> trigger
 external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
 external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
 
-let _ = Callback.register_exception "xl.error" (Error "register_callback")
+let _ = Callback.register_exception "Xenlight.Error" (Error(""))
diff -r bdd9c3e423d7 -r e4525795eac2 tools/ocaml/libs/xl/xenlight_stubs.c
--- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
@@ -31,49 +31,7 @@
 
 #define CTX ((libxl_ctx *)ctx)
 
-struct caml_logger {
-	struct xentoollog_logger logger;
-	int log_offset;
-	char log_buf[2048];
-};
-
-typedef struct caml_gc {
-	int offset;
-	void *ptrs[64];
-} caml_gc;
-
-static void log_vmessage(struct xentoollog_logger *logger, xentoollog_level level,
-                  int errnoval, const char *context, const char *format, va_list al)
-{
-	struct caml_logger *ologger = (struct caml_logger *) logger;
-
-	ologger->log_offset += vsnprintf(ologger->log_buf + ologger->log_offset,
-	                                 2048 - ologger->log_offset, format, al);
-}
-
-static void log_destroy(struct xentoollog_logger *logger)
-{
-}
-
-#define INIT_STRUCT() libxl_ctx *ctx; struct caml_logger lg; struct caml_gc gc; gc.offset = 0;
-
-#define INIT_CTX()  \
-	lg.logger.vmessage = log_vmessage; \
-	lg.logger.destroy = log_destroy; \
-	lg.logger.progress = NULL; \
-	lg.log_offset = 0; \
-	memset(&lg.log_buf,0,sizeof(lg.log_buf));	\
-	caml_enter_blocking_section(); \
-	ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct xentoollog_logger *) &lg); \
-	if (ret != 0) \
-		failwith_xl("cannot init context", &lg);
-
-#define FREE_CTX()  \
-	gc_free(&gc); \
-	caml_leave_blocking_section(); \
-	libxl_ctx_free(ctx)
-
-static char * dup_String_val(caml_gc *gc, value s)
+static char * dup_String_val(value s)
 {
 	int len;
 	char *c;
@@ -81,25 +39,16 @@ static char * dup_String_val(caml_gc *gc
 	c = calloc(len + 1, sizeof(char));
 	if (!c)
 		caml_raise_out_of_memory();
-	if (gc) gc->ptrs[gc->offset++] = c;
 	memcpy(c, String_val(s), len);
 	return c;
 }
 
-static void gc_free(caml_gc *gc)
+static void failwith_xl(char *fname)
 {
-	int i;
-	for (i = 0; i < gc->offset; i++) {
-		free(gc->ptrs[i]);
-	}
-}
-
-static void failwith_xl(char *fname, struct caml_logger *lg)
-{
-	char *s;
-	s = (lg) ? lg->log_buf : fname;
-	printf("Error: %s\n", fname);
-	caml_raise_with_string(*caml_named_value("xl.error"), s);
+	value *exc = caml_named_value("Xenlight.Error");
+	if (!exc)
+		caml_invalid_argument("Exception Xenlight.Error not initialized, please link xl.cma");
+	caml_raise_with_string(*exc, fname);
 }
 
 CAMLprim value stub_libxl_ctx_alloc(value logger)
@@ -111,7 +60,7 @@ CAMLprim value stub_libxl_ctx_alloc(valu
 	caml_enter_blocking_section();
 	ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct xentoollog_logger *) logger);
 	if (ret != 0) \
-		failwith_xl("cannot init context", NULL);
+		failwith_xl("cannot init context");
 	caml_leave_blocking_section();
 	CAMLreturn((value)ctx);
 }
@@ -127,16 +76,6 @@ CAMLprim value stub_libxl_ctx_free(value
 	CAMLreturn(Val_unit);
 }
 
-static void * gc_calloc(caml_gc *gc, size_t nmemb, size_t size)
-{
-	void *ptr;
-	ptr = calloc(nmemb, size);
-	if (!ptr)
-		caml_raise_out_of_memory();
-	gc->ptrs[gc->offset++] = ptr;
-	return ptr;
-}
-
 static int list_len(value v)
 {
 	int len = 0;
@@ -147,8 +86,7 @@ static int list_len(value v)
 	return len;
 }
 
-static int libxl_key_value_list_val(caml_gc *gc, struct caml_logger *lg,
-				    libxl_key_value_list *c_val,
+static int libxl_key_value_list_val(libxl_key_value_list *c_val,
 				    value v)
 {
 	CAMLparam1(v);
@@ -158,24 +96,22 @@ static int libxl_key_value_list_val(caml
 
 	nr = list_len(v);
 
-	array = gc_calloc(gc, (nr + 1) * 2, sizeof(char *));
+	array = calloc((nr + 1) * 2, sizeof(char *));
 	if (!array)
 		caml_raise_out_of_memory();
 
 	for (i=0; v != Val_emptylist; i++, v = Field(v, 1) ) {
 		elem = Field(v, 0);
 
-		array[i * 2] = dup_String_val(gc, Field(elem, 0));
-		array[i * 2 + 1] = dup_String_val(gc, Field(elem, 1));
+		array[i * 2] = dup_String_val(Field(elem, 0));
+		array[i * 2 + 1] = dup_String_val(Field(elem, 1));
 	}
 
 	*c_val = array;
 	CAMLreturn(0);
 }
 
-static int libxl_string_list_val(caml_gc *gc, struct caml_logger *lg,
-				 libxl_string_list *c_val,
-				 value v)
+static int libxl_string_list_val(libxl_string_list *c_val, value v)
 {
 	CAMLparam1(v);
 	int nr, i;
@@ -183,12 +119,12 @@ static int libxl_string_list_val(caml_gc
 
 	nr = list_len(v);
 
-	array = gc_calloc(gc, (nr + 1), sizeof(char *));
+	array = calloc(nr + 1, sizeof(char *));
 	if (!array)
 		caml_raise_out_of_memory();
 
 	for (i=0; v != Val_emptylist; i++, v = Field(v, 1) )
-		array[i] = dup_String_val(gc, Field(v, 0));
+		array[i] = dup_String_val(Field(v, 0));
 
 	*c_val = array;
 	CAMLreturn(0);
@@ -221,7 +157,7 @@ static value Val_mac (libxl_mac *c_val)
 	CAMLreturn(v);
 }
 
-static int Mac_val(caml_gc *gc, struct caml_logger *lg, libxl_mac *c_val, value v)
+static int Mac_val(libxl_mac *c_val, value v)
 {
 	CAMLparam1(v);
 	int i;
@@ -248,10 +184,20 @@ static value Val_bitmap (libxl_bitmap *c
 	CAMLreturn(v);
 }
 
-static int Bitmap_val(caml_gc *gc, struct caml_logger *lg,
-		      libxl_bitmap *c_val, value v)
+static int Bitmap_val(libxl_ctx *ctx, libxl_bitmap *c_val, value v)
 {
-	abort(); /* XXX */
+	CAMLparam1(v);
+	int i, len = Wosize_val(v);
+
+	if (!libxl_bitmap_alloc(ctx, c_val, len))
+		failwith_xl("cannot allocate bitmap");
+	for (i=0; i<len; i++) {
+		if (Int_val(Field(v, i)))
+			libxl_bitmap_set(c_val, i);
+		else
+			libxl_bitmap_reset(c_val, i);
+	}
+	CAMLreturn(0);
 }
 
 static value Val_cpuid_policy_list(libxl_cpuid_policy_list c_val)
@@ -261,8 +207,7 @@ static value Val_cpuid_policy_list(libxl
 	CAMLreturn((value)c_val);
 }
 
-static int Cpuid_policy_list_val(caml_gc *gc, struct caml_logger *lg,
-				 libxl_cpuid_policy_list *c_val, value v)
+static int Cpuid_policy_list_val(libxl_cpuid_policy_list *c_val, value v)
 {
 	CAMLparam1(v);
 
@@ -287,7 +232,7 @@ static value Val_uuid (libxl_uuid *c_val
 	CAMLreturn(v);
 }
 
-static int Uuid_val(caml_gc *gc, struct caml_logger *lg, libxl_uuid *c_val, value v)
+static int Uuid_val(libxl_uuid *c_val, value v)
 {
 	CAMLparam1(v);
 	int i;
@@ -345,14 +290,12 @@ value stub_libxl_list_domain(value ctx)
 {
 	CAMLparam1(ctx);
 	CAMLlocal2( cli, cons );
-	struct caml_gc gc;
 	libxl_dominfo *info;
 	int i, nr;
 
-	gc.offset = 0;
 	info = libxl_list_domain(CTX, &nr);
 	if (info == NULL)
-		failwith_xl("list_domain", NULL);
+		failwith_xl("list_domain");
 
 	cli = Val_emptylist;
 
@@ -360,7 +303,7 @@ value stub_libxl_list_domain(value ctx)
 		cons = caml_alloc(2, 0);
 
 		/* Head */
-		Store_field(cons, 0, Val_dominfo(&gc, NULL, &info[i]));
+		Store_field(cons, 0, Val_dominfo(CTX, &info[i]));
 		/* Tail */
 		Store_field(cons, 1, cli);
 
@@ -369,259 +312,77 @@ value stub_libxl_list_domain(value ctx)
 
 	libxl_dominfo_list_free(info, nr);
 
-	gc_free(&gc);
-
 	CAMLreturn(cli);
 }
 
-value stub_xl_device_disk_add(value info, value domid)
-{
-	CAMLparam2(info, domid);
-	libxl_device_disk c_info;
-	int ret;
-	INIT_STRUCT();
+#define _STRINGIFY(x) #x
+#define STRINGIFY(x) _STRINGIFY(x)
 
-	device_disk_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_disk_add(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("disk_add", &lg);
-	FREE_CTX();
-	CAMLreturn(Val_unit);
+#define _DEVICE_ADDREMOVE(type,op)					\
+value stub_xl_device_##type##_##op(value ctx, value info, value domid)	\
+{									\
+	CAMLparam3(ctx, info, domid);					\
+	libxl_device_##type c_info;					\
+	int ret, marker_var;						\
+									\
+	device_##type##_val(CTX, &c_info, info);			\
+									\
+	ret = libxl_device_##type##_##op(CTX, Int_val(domid), &c_info, 0); \
+									\
+	libxl_device_##type##_dispose(&c_info);				\
+									\
+	if (ret != 0)							\
+		failwith_xl(STRINGIFY(type) "_" STRINGIFY(op));		\
+									\
+	CAMLreturn(Val_unit);						\
 }
 
-value stub_xl_device_disk_del(value info, value domid)
+#define DEVICE_ADDREMOVE(type) \
+	_DEVICE_ADDREMOVE(type, add) \
+ 	_DEVICE_ADDREMOVE(type, remove) \
+ 	_DEVICE_ADDREMOVE(type, destroy)
+
+DEVICE_ADDREMOVE(disk)
+DEVICE_ADDREMOVE(nic)
+DEVICE_ADDREMOVE(vfb)
+DEVICE_ADDREMOVE(vkb)
+DEVICE_ADDREMOVE(pci)
+
+value stub_xl_physinfo_get(value ctx)
 {
-	CAMLparam2(info, domid);
-	libxl_device_disk c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_disk_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_disk_remove(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("disk_del", &lg);
-	FREE_CTX();
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_nic_add(value info, value domid)
-{
-	CAMLparam2(info, domid);
-	libxl_device_nic c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_nic_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_nic_add(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("nic_add", &lg);
-	FREE_CTX();
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_nic_del(value info, value domid)
-{
-	CAMLparam2(info, domid);
-	libxl_device_nic c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_nic_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_nic_remove(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("nic_del", &lg);
-	FREE_CTX();
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_vkb_add(value info, value domid)
-{
-	CAMLparam2(info, domid);
-	libxl_device_vkb c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_vkb_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_vkb_add(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("vkb_add", &lg);
-	FREE_CTX();
-
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_vkb_remove(value info, value domid)
-{
-	CAMLparam1(domid);
-	libxl_device_vkb c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_vkb_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_vkb_remove(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("vkb_clean_shutdown", &lg);
-	FREE_CTX();
-
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_vkb_destroy(value info, value domid)
-{
-	CAMLparam1(domid);
-	libxl_device_vkb c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_vkb_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_vkb_destroy(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("vkb_hard_shutdown", &lg);
-	FREE_CTX();
-
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_vfb_add(value info, value domid)
-{
-	CAMLparam2(info, domid);
-	libxl_device_vfb c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_vfb_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_vfb_add(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("vfb_add", &lg);
-	FREE_CTX();
-
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_vfb_remove(value info, value domid)
-{
-	CAMLparam1(domid);
-	libxl_device_vfb c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_vfb_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_vfb_remove(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("vfb_clean_shutdown", &lg);
-	FREE_CTX();
-
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_vfb_destroy(value info, value domid)
-{
-	CAMLparam1(domid);
-	libxl_device_vfb c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_vfb_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_vfb_destroy(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("vfb_hard_shutdown", &lg);
-	FREE_CTX();
-
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_pci_add(value info, value domid)
-{
-	CAMLparam2(info, domid);
-	libxl_device_pci c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_pci_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_pci_add(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("pci_add", &lg);
-	FREE_CTX();
-
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_device_pci_remove(value info, value domid)
-{
-	CAMLparam2(info, domid);
-	libxl_device_pci c_info;
-	int ret;
-	INIT_STRUCT();
-
-	device_pci_val(&gc, &lg, &c_info, info);
-
-	INIT_CTX();
-	ret = libxl_device_pci_remove(ctx, Int_val(domid), &c_info, 0);
-	if (ret != 0)
-		failwith_xl("pci_remove", &lg);
-	FREE_CTX();
-
-	CAMLreturn(Val_unit);
-}
-
-value stub_xl_physinfo_get(value unit)
-{
-	CAMLparam1(unit);
+	CAMLparam1(ctx);
 	CAMLlocal1(physinfo);
 	libxl_physinfo c_physinfo;
 	int ret;
-	INIT_STRUCT();
 
-	INIT_CTX();
-	ret = libxl_get_physinfo(ctx, &c_physinfo);
+	ret = libxl_get_physinfo(CTX, &c_physinfo);
+
 	if (ret != 0)
-		failwith_xl("physinfo", &lg);
-	FREE_CTX();
+		failwith_xl("get_physinfo");
 
-	physinfo = Val_physinfo(&gc, &lg, &c_physinfo);
+	physinfo = Val_physinfo(CTX, &c_physinfo);
+
+	libxl_physinfo_dispose(&c_physinfo);
+
 	CAMLreturn(physinfo);
 }
 
-value stub_xl_cputopology_get(value unit)
+value stub_xl_cputopology_get(value ctx)
 {
-	CAMLparam1(unit);
+	CAMLparam1(ctx);
 	CAMLlocal2(topology, v);
 	libxl_cputopology *c_topology;
-	int i, nr, ret;
-	INIT_STRUCT();
+	int i, nr;
 
-	INIT_CTX();
+	c_topology = libxl_get_cpu_topology(CTX, &nr);
 
-	c_topology = libxl_get_cpu_topology(ctx, &nr);
-	if (ret != 0)
-		failwith_xl("topologyinfo", &lg);
+	if (!c_topology)
+		failwith_xl("topologyinfo");
 
 	topology = caml_alloc_tuple(nr);
 	for (i = 0; i < nr; i++) {
 		if (c_topology[i].core != LIBXL_CPUTOPOLOGY_INVALID_ENTRY)
-			v = Val_some(Val_cputopology(&gc, &lg, &c_topology[i]));
+			v = Val_some(Val_cputopology(CTX, &c_topology[i]));
 		else
 			v = Val_none;
 		Store_field(topology, i, v);
@@ -629,74 +390,72 @@ value stub_xl_cputopology_get(value unit
 
 	libxl_cputopology_list_free(c_topology, nr);
 
-	FREE_CTX();
 	CAMLreturn(topology);
 }
 
-value stub_xl_domain_sched_params_get(value domid)
+value stub_xl_domain_sched_params_get(value ctx, value domid)
 {
-	CAMLparam1(domid);
+	CAMLparam2(ctx, domid);
 	CAMLlocal1(scinfo);
 	libxl_domain_sched_params c_scinfo;
 	int ret;
-	INIT_STRUCT();
 
-	INIT_CTX();
-	ret = libxl_domain_sched_params_get(ctx, Int_val(domid), &c_scinfo);
+	ret = libxl_domain_sched_params_get(CTX, Int_val(domid), &c_scinfo);
 	if (ret != 0)
-		failwith_xl("domain_sched_params_get", &lg);
-	FREE_CTX();
+		failwith_xl("domain_sched_params_get");
 
-	scinfo = Val_domain_sched_params(&gc, &lg, &c_scinfo);
+	scinfo = Val_domain_sched_params(CTX, &c_scinfo);
+
+	libxl_domain_sched_params_dispose(&c_scinfo);
+
 	CAMLreturn(scinfo);
 }
 
-value stub_xl_domain_sched_params_set(value domid, value scinfo)
+value stub_xl_domain_sched_params_set(value ctx, value domid, value scinfo)
 {
-	CAMLparam2(domid, scinfo);
+	CAMLparam3(ctx, domid, scinfo);
 	libxl_domain_sched_params c_scinfo;
 	int ret;
-	INIT_STRUCT();
 
-	domain_sched_params_val(&gc, &lg, &c_scinfo, scinfo);
+	domain_sched_params_val(CTX, &c_scinfo, scinfo);
 
-	INIT_CTX();
-	ret = libxl_domain_sched_params_set(ctx, Int_val(domid), &c_scinfo);
+	ret = libxl_domain_sched_params_set(CTX, Int_val(domid), &c_scinfo);
+
+	libxl_domain_sched_params_dispose(&c_scinfo);
+
 	if (ret != 0)
-		failwith_xl("domain_sched_params_set", &lg);
-	FREE_CTX();
+		failwith_xl("domain_sched_params_set");
 
 	CAMLreturn(Val_unit);
 }
 
-value stub_xl_send_trigger(value domid, value trigger, value vcpuid)
+value stub_xl_send_trigger(value ctx, value domid, value trigger, value vcpuid)
 {
-	CAMLparam3(domid, trigger, vcpuid);
+	CAMLparam4(ctx, domid, trigger, vcpuid);
 	int ret;
 	libxl_trigger c_trigger = LIBXL_TRIGGER_UNKNOWN;
-	INIT_STRUCT();
 
-	trigger_val(&gc, &lg, &c_trigger, trigger);
+	trigger_val(CTX, &c_trigger, trigger);
 
-	INIT_CTX();
-	ret = libxl_send_trigger(ctx, Int_val(domid), c_trigger, Int_val(vcpuid));
+	ret = libxl_send_trigger(CTX, Int_val(domid),
+				 c_trigger, Int_val(vcpuid));
+
 	if (ret != 0)
-		failwith_xl("send_trigger", &lg);
-	FREE_CTX();
+		failwith_xl("send_trigger");
+
 	CAMLreturn(Val_unit);
 }
 
-value stub_xl_send_sysrq(value domid, value sysrq)
+value stub_xl_send_sysrq(value ctx, value domid, value sysrq)
 {
-	CAMLparam2(domid, sysrq);
+	CAMLparam3(ctx, domid, sysrq);
 	int ret;
-	INIT_STRUCT();
 
-	INIT_CTX();
-	ret = libxl_send_sysrq(ctx, Int_val(domid), Int_val(sysrq));
+	ret = libxl_send_sysrq(CTX, Int_val(domid), Int_val(sysrq));
+
 	if (ret != 0)
-		failwith_xl("send_sysrq", &lg);
-	FREE_CTX();
+		failwith_xl("send_sysrq");
+
 	CAMLreturn(Val_unit);
 }
 
@@ -706,11 +465,11 @@ value stub_xl_send_debug_keys(value ctx,
 	int ret;
 	char *c_keys;
 
-	c_keys = dup_String_val(NULL, keys);
+	c_keys = dup_String_val(keys);
 
 	ret = libxl_send_debug_keys(CTX, c_keys);
 	if (ret != 0)
-		failwith_xl("send_debug_keys", NULL);
+		failwith_xl("send_debug_keys");
 
 	free(c_keys);
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:46:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:46:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tartr-0004v0-Bp; Tue, 20 Nov 2012 17:46:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Tarto-0004qt-8o; Tue, 20 Nov 2012 17:46:16 +0000
Received: from [85.158.138.51:28028] by server-2.bemta-3.messagelabs.com id
	85/3E-04744-7E1CBA05; Tue, 20 Nov 2012 17:46:15 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353433568!30872360!2
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30060 invoked from network); 20 Nov 2012 17:46:11 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:46:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215082612"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:46:11 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:46:10 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-OL;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: bdd9c3e423d7f505f93edf413a92ad7b47ed9e39
Message-ID: <bdd9c3e423d7f505f93e.1353432211@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:31 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 11 of 15] libxl: ocaml: allocate a long lived
	libxl context
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID bdd9c3e423d7f505f93edf413a92ad7b47ed9e39
# Parent  2b433b1523e4295bb1ed74a7b71e2a20e00f1802
libxl: ocaml: allocate a long lived libxl context.

Rather than allocating a new context for every libxl call begin to
switch to a model where a context is allocated by the caller and may
then be used for multiple calls down into the library.

As a starting point convert list_domains and send_debug_keys and
implement simple tests which use them. These are just PoC of the
infrastructure, I don't intend to add one for every function...

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 2b433b1523e4 -r bdd9c3e423d7 .gitignore
--- a/.gitignore	Tue Nov 20 17:22:21 2012 +0000
+++ b/.gitignore	Tue Nov 20 17:22:21 2012 +0000
@@ -365,7 +365,8 @@ tools/ocaml/libs/xl/xenlight.ml
 tools/ocaml/libs/xl/xenlight.mli
 tools/ocaml/xenstored/oxenstored
 tools/ocaml/test/xtl
-
+tools/ocaml/test/send_debug_keys
+tools/ocaml/test/list_domains
 tools/debugger/kdd/kdd
 tools/firmware/etherboot/ipxe.tar.gz
 tools/firmware/etherboot/ipxe/
diff -r 2b433b1523e4 -r bdd9c3e423d7 .hgignore
--- a/.hgignore	Tue Nov 20 17:22:21 2012 +0000
+++ b/.hgignore	Tue Nov 20 17:22:21 2012 +0000
@@ -306,6 +306,8 @@
 ^tools/ocaml/libs/xl/xenlight\.mli$
 ^tools/ocaml/xenstored/oxenstored$
 ^tools/ocaml/test/xtl$
+^tools/ocaml/test/send_debug_keys$
+^tools/ocaml/test/list_domains$
 ^tools/autom4te\.cache$
 ^tools/config\.h$
 ^tools/config\.log$
diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/libs/xl/Makefile
--- a/tools/ocaml/libs/xl/Makefile	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/Makefile	Tue Nov 20 17:22:21 2012 +0000
@@ -10,6 +10,8 @@ OBJS = xenlight
 INTF = xenlight.cmi
 LIBS = xenlight.cma xenlight.cmxa
 
+OCAMLINCLUDE += -I ../xentoollog
+
 LIBS_xenlight = $(LDLIBS_libxenlight)
 
 xenlight_OBJS = $(OBJS)
diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/libs/xl/xenlight.ml.in
--- a/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
@@ -13,6 +13,8 @@
  * GNU Lesser General Public License for more details.
  *)
 
+open Xentoollog
+
 exception Error of string
 
 type domid = int
@@ -24,8 +26,15 @@ end
 
 (* @@LIBXL_TYPES@@ *)
 
+type ctx
+
+external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
+external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
+
+external list_domain: ctx -> Dominfo.t list = "stub_libxl_list_domain"
+
 external send_trigger : domid -> trigger -> int -> unit = "stub_xl_send_trigger"
 external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
-external send_debug_keys : domid -> string -> unit = "stub_xl_send_debug_keys"
+external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
 
 let _ = Callback.register_exception "xl.error" (Error "register_callback")
diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/libs/xl/xenlight.mli.in
--- a/tools/ocaml/libs/xl/xenlight.mli.in	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight.mli.in	Tue Nov 20 17:22:21 2012 +0000
@@ -13,6 +13,8 @@
  * GNU Lesser General Public License for more details.
  *)
 
+open Xentoollog
+
 exception Error of string
 
 type domid = int
@@ -20,6 +22,13 @@ type devid = int
 
 (* @@LIBXL_TYPES@@ *)
 
+type ctx
+
+external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
+external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
+
+external list_domain: ctx -> Dominfo.t list = "stub_libxl_list_domain"
+
 external send_trigger : domid -> trigger -> int -> unit = "stub_xl_send_trigger"
 external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
-external send_debug_keys : domid -> string -> unit = "stub_xl_send_debug_keys"
+external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/libs/xl/xenlight_stubs.c
--- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
@@ -29,6 +29,8 @@
 #include <libxl.h>
 #include <libxl_utils.h>
 
+#define CTX ((libxl_ctx *)ctx)
+
 struct caml_logger {
 	struct xentoollog_logger logger;
 	int log_offset;
@@ -59,6 +61,8 @@ static void log_destroy(struct xentoollo
 	lg.logger.vmessage = log_vmessage; \
 	lg.logger.destroy = log_destroy; \
 	lg.logger.progress = NULL; \
+	lg.log_offset = 0; \
+	memset(&lg.log_buf,0,sizeof(lg.log_buf));	\
 	caml_enter_blocking_section(); \
 	ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct xentoollog_logger *) &lg); \
 	if (ret != 0) \
@@ -77,7 +81,7 @@ static char * dup_String_val(caml_gc *gc
 	c = calloc(len + 1, sizeof(char));
 	if (!c)
 		caml_raise_out_of_memory();
-	gc->ptrs[gc->offset++] = c;
+	if (gc) gc->ptrs[gc->offset++] = c;
 	memcpy(c, String_val(s), len);
 	return c;
 }
@@ -94,9 +98,35 @@ static void failwith_xl(char *fname, str
 {
 	char *s;
 	s = (lg) ? lg->log_buf : fname;
+	printf("Error: %s\n", fname);
 	caml_raise_with_string(*caml_named_value("xl.error"), s);
 }
 
+CAMLprim value stub_libxl_ctx_alloc(value logger)
+{
+	CAMLparam1(logger);
+	libxl_ctx *ctx;
+	int ret;
+
+	caml_enter_blocking_section();
+	ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct xentoollog_logger *) logger);
+	if (ret != 0) \
+		failwith_xl("cannot init context", NULL);
+	caml_leave_blocking_section();
+	CAMLreturn((value)ctx);
+}
+
+CAMLprim value stub_libxl_ctx_free(value ctx)
+{
+	CAMLparam1(ctx);
+
+	caml_enter_blocking_section();
+	libxl_ctx_free(CTX);
+	caml_leave_blocking_section();
+
+	CAMLreturn(Val_unit);
+}
+
 static void * gc_calloc(caml_gc *gc, size_t nmemb, size_t size)
 {
 	void *ptr;
@@ -311,6 +341,39 @@ static value Val_hwcap(libxl_hwcap *c_va
 
 #include "_libxl_types.inc"
 
+value stub_libxl_list_domain(value ctx)
+{
+	CAMLparam1(ctx);
+	CAMLlocal2( cli, cons );
+	struct caml_gc gc;
+	libxl_dominfo *info;
+	int i, nr;
+
+	gc.offset = 0;
+	info = libxl_list_domain(CTX, &nr);
+	if (info == NULL)
+		failwith_xl("list_domain", NULL);
+
+	cli = Val_emptylist;
+
+	for (i = nr - 1; i >= 0; i--) {
+		cons = caml_alloc(2, 0);
+
+		/* Head */
+		Store_field(cons, 0, Val_dominfo(&gc, NULL, &info[i]));
+		/* Tail */
+		Store_field(cons, 1, cli);
+
+		cli = cons;
+	}
+
+	libxl_dominfo_list_free(info, nr);
+
+	gc_free(&gc);
+
+	CAMLreturn(cli);
+}
+
 value stub_xl_device_disk_add(value info, value domid)
 {
 	CAMLparam2(info, domid);
@@ -637,20 +700,20 @@ value stub_xl_send_sysrq(value domid, va
 	CAMLreturn(Val_unit);
 }
 
-value stub_xl_send_debug_keys(value keys)
+value stub_xl_send_debug_keys(value ctx, value keys)
 {
-	CAMLparam1(keys);
+	CAMLparam2(ctx, keys);
 	int ret;
 	char *c_keys;
-	INIT_STRUCT();
 
-	c_keys = dup_String_val(&gc, keys);
+	c_keys = dup_String_val(NULL, keys);
 
-	INIT_CTX();
-	ret = libxl_send_debug_keys(ctx, c_keys);
+	ret = libxl_send_debug_keys(CTX, c_keys);
 	if (ret != 0)
-		failwith_xl("send_debug_keys", &lg);
-	FREE_CTX();
+		failwith_xl("send_debug_keys", NULL);
+
+	free(c_keys);
+
 	CAMLreturn(Val_unit);
 }
 
diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/test/Makefile
--- a/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
@@ -3,18 +3,31 @@ OCAML_TOPLEVEL = $(CURDIR)/..
 include $(OCAML_TOPLEVEL)/common.make
 
 OCAMLINCLUDE += \
-	-I $(OCAML_TOPLEVEL)/libs/xentoollog
+	-I $(OCAML_TOPLEVEL)/libs/xentoollog \
+	-I $(OCAML_TOPLEVEL)/libs/xl
 
-OBJS = xtl
+OBJS = xtl send_debug_keys list_domains
 
-PROGRAMS = xtl
+PROGRAMS = xtl send_debug_keys list_domains
 
 xtl_LIBS =  \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa
 
 xtl_OBJS = xtl
 
-OCAML_PROGRAM = xtl
+send_debug_keys_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl $(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
+
+send_debug_keys_OBJS = send_debug_keys
+
+list_domains_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl $(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
+
+list_domains_OBJS = list_domains
+
+OCAML_PROGRAM = xtl send_debug_keys list_domains
 
 all: $(PROGRAMS)
 
diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/test/list_domains.ml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/test/list_domains.ml	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,26 @@
+open Arg
+open Printf
+open Xentoollog
+open Xenlight
+
+let bool_as_char b c = if b then c else '-'
+
+let print_dominfo dominfo = 
+  let id = dominfo.Xenlight.Dominfo.domid
+  and running = bool_as_char dominfo.Xenlight.Dominfo.running 'r'
+  and blocked = bool_as_char dominfo.Xenlight.Dominfo.blocked 'b'
+  and paused = bool_as_char dominfo.Xenlight.Dominfo.paused 'p'
+  and shutdown = bool_as_char dominfo.Xenlight.Dominfo.shutdown 's'
+  and dying = bool_as_char dominfo.Xenlight.Dominfo.dying 'd'
+  and memory = dominfo.Xenlight.Dominfo.current_memkb
+  in
+  printf "Dom %d: %c%c%c%c%c %LdKB\n" id running blocked paused shutdown dying memory
+
+let _ = 
+  let logger = Xentoollog.create_stdio_logger (*~level:Xentoollog.Debug*) () in
+  let ctx = Xenlight.ctx_alloc logger in
+  let domains = Xenlight.list_domain ctx in
+  List.iter (fun d -> print_dominfo d) domains;
+  Xenlight.ctx_free ctx;
+  Xentoollog.destroy logger;
+
diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/test/send_debug_keys.ml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/test/send_debug_keys.ml	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,17 @@
+open Arg
+open Printf
+open Xentoollog
+open Xenlight
+
+let send_keys ctx s = 
+  printf "Sending debug key %s\n" s;
+  Xenlight.send_debug_keys ctx s;
+  ()
+  
+let _ = 
+  let logger = Xentoollog.create_stdio_logger () in
+  let ctx = Xenlight.ctx_alloc logger in
+  Arg.parse [
+  ] (fun s -> send_keys ctx s) "usage: send_debug_keys <keys>";
+  Xenlight.ctx_free ctx;
+  Xentoollog.destroy logger

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:46:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:46:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tartr-0004v0-Bp; Tue, 20 Nov 2012 17:46:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Tarto-0004qt-8o; Tue, 20 Nov 2012 17:46:16 +0000
Received: from [85.158.138.51:28028] by server-2.bemta-3.messagelabs.com id
	85/3E-04744-7E1CBA05; Tue, 20 Nov 2012 17:46:15 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353433568!30872360!2
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30060 invoked from network); 20 Nov 2012 17:46:11 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:46:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215082612"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:46:11 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:46:10 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-OL;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: bdd9c3e423d7f505f93edf413a92ad7b47ed9e39
Message-ID: <bdd9c3e423d7f505f93e.1353432211@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:31 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 11 of 15] libxl: ocaml: allocate a long lived
	libxl context
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID bdd9c3e423d7f505f93edf413a92ad7b47ed9e39
# Parent  2b433b1523e4295bb1ed74a7b71e2a20e00f1802
libxl: ocaml: allocate a long lived libxl context.

Rather than allocating a new context for every libxl call begin to
switch to a model where a context is allocated by the caller and may
then be used for multiple calls down into the library.

As a starting point convert list_domains and send_debug_keys and
implement simple tests which use them. These are just PoC of the
infrastructure, I don't intend to add one for every function...

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 2b433b1523e4 -r bdd9c3e423d7 .gitignore
--- a/.gitignore	Tue Nov 20 17:22:21 2012 +0000
+++ b/.gitignore	Tue Nov 20 17:22:21 2012 +0000
@@ -365,7 +365,8 @@ tools/ocaml/libs/xl/xenlight.ml
 tools/ocaml/libs/xl/xenlight.mli
 tools/ocaml/xenstored/oxenstored
 tools/ocaml/test/xtl
-
+tools/ocaml/test/send_debug_keys
+tools/ocaml/test/list_domains
 tools/debugger/kdd/kdd
 tools/firmware/etherboot/ipxe.tar.gz
 tools/firmware/etherboot/ipxe/
diff -r 2b433b1523e4 -r bdd9c3e423d7 .hgignore
--- a/.hgignore	Tue Nov 20 17:22:21 2012 +0000
+++ b/.hgignore	Tue Nov 20 17:22:21 2012 +0000
@@ -306,6 +306,8 @@
 ^tools/ocaml/libs/xl/xenlight\.mli$
 ^tools/ocaml/xenstored/oxenstored$
 ^tools/ocaml/test/xtl$
+^tools/ocaml/test/send_debug_keys$
+^tools/ocaml/test/list_domains$
 ^tools/autom4te\.cache$
 ^tools/config\.h$
 ^tools/config\.log$
diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/libs/xl/Makefile
--- a/tools/ocaml/libs/xl/Makefile	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/Makefile	Tue Nov 20 17:22:21 2012 +0000
@@ -10,6 +10,8 @@ OBJS = xenlight
 INTF = xenlight.cmi
 LIBS = xenlight.cma xenlight.cmxa
 
+OCAMLINCLUDE += -I ../xentoollog
+
 LIBS_xenlight = $(LDLIBS_libxenlight)
 
 xenlight_OBJS = $(OBJS)
diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/libs/xl/xenlight.ml.in
--- a/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012 +0000
@@ -13,6 +13,8 @@
  * GNU Lesser General Public License for more details.
  *)
 
+open Xentoollog
+
 exception Error of string
 
 type domid = int
@@ -24,8 +26,15 @@ end
 
 (* @@LIBXL_TYPES@@ *)
 
+type ctx
+
+external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
+external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
+
+external list_domain: ctx -> Dominfo.t list = "stub_libxl_list_domain"
+
 external send_trigger : domid -> trigger -> int -> unit = "stub_xl_send_trigger"
 external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
-external send_debug_keys : domid -> string -> unit = "stub_xl_send_debug_keys"
+external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
 
 let _ = Callback.register_exception "xl.error" (Error "register_callback")
diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/libs/xl/xenlight.mli.in
--- a/tools/ocaml/libs/xl/xenlight.mli.in	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight.mli.in	Tue Nov 20 17:22:21 2012 +0000
@@ -13,6 +13,8 @@
  * GNU Lesser General Public License for more details.
  *)
 
+open Xentoollog
+
 exception Error of string
 
 type domid = int
@@ -20,6 +22,13 @@ type devid = int
 
 (* @@LIBXL_TYPES@@ *)
 
+type ctx
+
+external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
+external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
+
+external list_domain: ctx -> Dominfo.t list = "stub_libxl_list_domain"
+
 external send_trigger : domid -> trigger -> int -> unit = "stub_xl_send_trigger"
 external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
-external send_debug_keys : domid -> string -> unit = "stub_xl_send_debug_keys"
+external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/libs/xl/xenlight_stubs.c
--- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012 +0000
@@ -29,6 +29,8 @@
 #include <libxl.h>
 #include <libxl_utils.h>
 
+#define CTX ((libxl_ctx *)ctx)
+
 struct caml_logger {
 	struct xentoollog_logger logger;
 	int log_offset;
@@ -59,6 +61,8 @@ static void log_destroy(struct xentoollo
 	lg.logger.vmessage = log_vmessage; \
 	lg.logger.destroy = log_destroy; \
 	lg.logger.progress = NULL; \
+	lg.log_offset = 0; \
+	memset(&lg.log_buf,0,sizeof(lg.log_buf));	\
 	caml_enter_blocking_section(); \
 	ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct xentoollog_logger *) &lg); \
 	if (ret != 0) \
@@ -77,7 +81,7 @@ static char * dup_String_val(caml_gc *gc
 	c = calloc(len + 1, sizeof(char));
 	if (!c)
 		caml_raise_out_of_memory();
-	gc->ptrs[gc->offset++] = c;
+	if (gc) gc->ptrs[gc->offset++] = c;
 	memcpy(c, String_val(s), len);
 	return c;
 }
@@ -94,9 +98,35 @@ static void failwith_xl(char *fname, str
 {
 	char *s;
 	s = (lg) ? lg->log_buf : fname;
+	printf("Error: %s\n", fname);
 	caml_raise_with_string(*caml_named_value("xl.error"), s);
 }
 
+CAMLprim value stub_libxl_ctx_alloc(value logger)
+{
+	CAMLparam1(logger);
+	libxl_ctx *ctx;
+	int ret;
+
+	caml_enter_blocking_section();
+	ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct xentoollog_logger *) logger);
+	if (ret != 0) \
+		failwith_xl("cannot init context", NULL);
+	caml_leave_blocking_section();
+	CAMLreturn((value)ctx);
+}
+
+CAMLprim value stub_libxl_ctx_free(value ctx)
+{
+	CAMLparam1(ctx);
+
+	caml_enter_blocking_section();
+	libxl_ctx_free(CTX);
+	caml_leave_blocking_section();
+
+	CAMLreturn(Val_unit);
+}
+
 static void * gc_calloc(caml_gc *gc, size_t nmemb, size_t size)
 {
 	void *ptr;
@@ -311,6 +341,39 @@ static value Val_hwcap(libxl_hwcap *c_va
 
 #include "_libxl_types.inc"
 
+value stub_libxl_list_domain(value ctx)
+{
+	CAMLparam1(ctx);
+	CAMLlocal2( cli, cons );
+	struct caml_gc gc;
+	libxl_dominfo *info;
+	int i, nr;
+
+	gc.offset = 0;
+	info = libxl_list_domain(CTX, &nr);
+	if (info == NULL)
+		failwith_xl("list_domain", NULL);
+
+	cli = Val_emptylist;
+
+	for (i = nr - 1; i >= 0; i--) {
+		cons = caml_alloc(2, 0);
+
+		/* Head */
+		Store_field(cons, 0, Val_dominfo(&gc, NULL, &info[i]));
+		/* Tail */
+		Store_field(cons, 1, cli);
+
+		cli = cons;
+	}
+
+	libxl_dominfo_list_free(info, nr);
+
+	gc_free(&gc);
+
+	CAMLreturn(cli);
+}
+
 value stub_xl_device_disk_add(value info, value domid)
 {
 	CAMLparam2(info, domid);
@@ -637,20 +700,20 @@ value stub_xl_send_sysrq(value domid, va
 	CAMLreturn(Val_unit);
 }
 
-value stub_xl_send_debug_keys(value keys)
+value stub_xl_send_debug_keys(value ctx, value keys)
 {
-	CAMLparam1(keys);
+	CAMLparam2(ctx, keys);
 	int ret;
 	char *c_keys;
-	INIT_STRUCT();
 
-	c_keys = dup_String_val(&gc, keys);
+	c_keys = dup_String_val(NULL, keys);
 
-	INIT_CTX();
-	ret = libxl_send_debug_keys(ctx, c_keys);
+	ret = libxl_send_debug_keys(CTX, c_keys);
 	if (ret != 0)
-		failwith_xl("send_debug_keys", &lg);
-	FREE_CTX();
+		failwith_xl("send_debug_keys", NULL);
+
+	free(c_keys);
+
 	CAMLreturn(Val_unit);
 }
 
diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/test/Makefile
--- a/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
@@ -3,18 +3,31 @@ OCAML_TOPLEVEL = $(CURDIR)/..
 include $(OCAML_TOPLEVEL)/common.make
 
 OCAMLINCLUDE += \
-	-I $(OCAML_TOPLEVEL)/libs/xentoollog
+	-I $(OCAML_TOPLEVEL)/libs/xentoollog \
+	-I $(OCAML_TOPLEVEL)/libs/xl
 
-OBJS = xtl
+OBJS = xtl send_debug_keys list_domains
 
-PROGRAMS = xtl
+PROGRAMS = xtl send_debug_keys list_domains
 
 xtl_LIBS =  \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa
 
 xtl_OBJS = xtl
 
-OCAML_PROGRAM = xtl
+send_debug_keys_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl $(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
+
+send_debug_keys_OBJS = send_debug_keys
+
+list_domains_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl $(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
+
+list_domains_OBJS = list_domains
+
+OCAML_PROGRAM = xtl send_debug_keys list_domains
 
 all: $(PROGRAMS)
 
diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/test/list_domains.ml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/test/list_domains.ml	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,26 @@
+open Arg
+open Printf
+open Xentoollog
+open Xenlight
+
+let bool_as_char b c = if b then c else '-'
+
+let print_dominfo dominfo = 
+  let id = dominfo.Xenlight.Dominfo.domid
+  and running = bool_as_char dominfo.Xenlight.Dominfo.running 'r'
+  and blocked = bool_as_char dominfo.Xenlight.Dominfo.blocked 'b'
+  and paused = bool_as_char dominfo.Xenlight.Dominfo.paused 'p'
+  and shutdown = bool_as_char dominfo.Xenlight.Dominfo.shutdown 's'
+  and dying = bool_as_char dominfo.Xenlight.Dominfo.dying 'd'
+  and memory = dominfo.Xenlight.Dominfo.current_memkb
+  in
+  printf "Dom %d: %c%c%c%c%c %LdKB\n" id running blocked paused shutdown dying memory
+
+let _ = 
+  let logger = Xentoollog.create_stdio_logger (*~level:Xentoollog.Debug*) () in
+  let ctx = Xenlight.ctx_alloc logger in
+  let domains = Xenlight.list_domain ctx in
+  List.iter (fun d -> print_dominfo d) domains;
+  Xenlight.ctx_free ctx;
+  Xentoollog.destroy logger;
+
diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/test/send_debug_keys.ml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/test/send_debug_keys.ml	Tue Nov 20 17:22:21 2012 +0000
@@ -0,0 +1,17 @@
+open Arg
+open Printf
+open Xentoollog
+open Xenlight
+
+let send_keys ctx s = 
+  printf "Sending debug key %s\n" s;
+  Xenlight.send_debug_keys ctx s;
+  ()
+  
+let _ = 
+  let logger = Xentoollog.create_stdio_logger () in
+  let ctx = Xenlight.ctx_alloc logger in
+  Arg.parse [
+  ] (fun s -> send_keys ctx s) "usage: send_debug_keys <keys>";
+  Xenlight.ctx_free ctx;
+  Xentoollog.destroy logger

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:46:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:46:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tartn-0004qh-Hv; Tue, 20 Nov 2012 17:46:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Tartk-0004pX-Lk; Tue, 20 Nov 2012 17:46:12 +0000
Received: from [85.158.139.211:5020] by server-5.bemta-5.messagelabs.com id
	04/DE-11353-3E1CBA05; Tue, 20 Nov 2012 17:46:11 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1353433569!20935399!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23334 invoked from network); 20 Nov 2012 17:46:11 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-3.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:46:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215082611"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:46:10 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:46:09 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-Pl;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 41f0137955f4a1a5a76ad34a5a6440e32d0090ef
Message-ID: <41f0137955f4a1a5a76a.1353432214@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:34 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 14 of 15] libxl: ocaml: generate
	libxl_domain_config bindings
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID 41f0137955f4a1a5a76ad34a5a6440e32d0090ef
# Parent  c8d22bfef298ce525c98b5a3f0c394068ab01572
libxl: ocaml: generate libxl_domain_config bindings

With the infrastructure we now have in place this is trivial.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r c8d22bfef298 -r 41f0137955f4 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:21 2012 +0000
@@ -417,7 +417,7 @@ libxl_domain_config = Struct("domain_con
     ("on_reboot", libxl_action_on_shutdown),
     ("on_watchdog", libxl_action_on_shutdown),
     ("on_crash", libxl_action_on_shutdown),
-    ])
+    ], dir=DIR_IN)
 
 libxl_diskinfo = Struct("diskinfo", [
     ("backend", string),
diff -r c8d22bfef298 -r 41f0137955f4 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
@@ -420,7 +420,6 @@ if __name__ == '__main__':
     # Do not generate these yet.
     blacklist = [
         "cpupoolinfo",
-        "domain_config",
         "vcpuinfo",
         ]
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:46:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:46:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tartn-0004qh-Hv; Tue, 20 Nov 2012 17:46:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Tartk-0004pX-Lk; Tue, 20 Nov 2012 17:46:12 +0000
Received: from [85.158.139.211:5020] by server-5.bemta-5.messagelabs.com id
	04/DE-11353-3E1CBA05; Tue, 20 Nov 2012 17:46:11 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1353433569!20935399!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1Mzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23334 invoked from network); 20 Nov 2012 17:46:11 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-3.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:46:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,286,1352073600"; d="scan'208";a="215082611"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 17:46:10 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 20 Nov 2012 12:46:09 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TarXd-0008Br-Pl;
	Tue, 20 Nov 2012 17:23:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 41f0137955f4a1a5a76ad34a5a6440e32d0090ef
Message-ID: <41f0137955f4a1a5a76a.1353432214@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 20 Nov 2012 17:23:34 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org, xen-api@lists.xen.org
Subject: [Xen-devel] [PATCH 14 of 15] libxl: ocaml: generate
	libxl_domain_config bindings
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1353432141 0
# Node ID 41f0137955f4a1a5a76ad34a5a6440e32d0090ef
# Parent  c8d22bfef298ce525c98b5a3f0c394068ab01572
libxl: ocaml: generate libxl_domain_config bindings

With the infrastructure we now have in place this is trivial.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r c8d22bfef298 -r 41f0137955f4 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:21 2012 +0000
@@ -417,7 +417,7 @@ libxl_domain_config = Struct("domain_con
     ("on_reboot", libxl_action_on_shutdown),
     ("on_watchdog", libxl_action_on_shutdown),
     ("on_crash", libxl_action_on_shutdown),
-    ])
+    ], dir=DIR_IN)
 
 libxl_diskinfo = Struct("diskinfo", [
     ("backend", string),
diff -r c8d22bfef298 -r 41f0137955f4 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
@@ -420,7 +420,6 @@ if __name__ == '__main__':
     # Do not generate these yet.
     blacklist = [
         "cpupoolinfo",
-        "domain_config",
         "vcpuinfo",
         ]
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:48:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:48:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tarw4-00068B-Fk; Tue, 20 Nov 2012 17:48:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1Tarw2-00067h-OI
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 17:48:35 +0000
Received: from [85.158.138.51:36242] by server-9.bemta-3.messagelabs.com id
	12/72-02388-D62CBA05; Tue, 20 Nov 2012 17:48:29 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353433707!22772659!1
X-Originating-IP: [209.85.212.43]
X-SpamReason: No, hits=0.9 required=7.0 tests=HTML_40_50,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11336 invoked from network); 20 Nov 2012 17:48:28 -0000
Received: from mail-vb0-f43.google.com (HELO mail-vb0-f43.google.com)
	(209.85.212.43)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:48:28 -0000
Received: by mail-vb0-f43.google.com with SMTP id fn1so3630843vbb.30
	for <xen-devel@lists.xensource.com>;
	Tue, 20 Nov 2012 09:48:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=OXpK3Vo7F5k+Nf3u/0wLExioglQOJOCP9e8uMSX92pE=;
	b=1HBrDbMxbTXLteuCe2brHOAbEcyWQW/Uc0Y9JGsWuj38QcISeopIlwrB1UQrkEMhQ5
	jhul8IGtf0JrdceqVpqZ/dZmLjDKEhX7Eerh7V6/ghM5/ANPXxn9KI5pBHXj6eA+nSG2
	6vDgW3BfBAuL0QW0xIGuO48o42ZUcPfyfNtDRkWWTEDuib/NmxhkF2fAh0qfvzj+tWPo
	9/hHfAglVxfD3RDa5EQhsNB7ORwqpokl255bYppwV6H9L0r2KZiSzmqBXnWwKvKscJ2B
	jorxts/+X0/OXbD4JyJLudxU2zoqzzJIHHXNRGVciUNzDI9sQUwxtg+NK8R5V8wxuiTZ
	O63w==
MIME-Version: 1.0
Received: by 10.220.8.73 with SMTP id g9mr24860599vcg.28.1353433707266; Tue,
	20 Nov 2012 09:48:27 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Tue, 20 Nov 2012 09:48:26 -0800 (PST)
In-Reply-To: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
Date: Tue, 20 Nov 2012 17:48:26 +0000
X-Google-Sender-Auth: ZJi5hJhBgQ0UFnK9CAUb-WuPUmc
Message-ID: <CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Liu Jinsong <jinsong.liu@intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4807346674701914666=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4807346674701914666==
Content-Type: multipart/alternative; boundary=bcaec54b492459420704cef0d728

--bcaec54b492459420704cef0d728
Content-Type: text/plain; charset=ISO-8859-1

On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <jinsong.liu@intel.com> wrote:

> +            /*
> +             * if vMCE occur at last iter, do one more iter so that it get
> +             * chance to transfer broken page's pfn_type and pfn number to
> +             * target and then take appropriate action
> +             */
> +            if ( last_iter )
> +            {
> +                for ( j = 0; j < batch; j++ )
> +                {
> +                    if ( hvm )
> +                        pfn_type[j] = pfn_batch[j];
> +                    else
> +                        pfn_type[j] = pfn_to_mfn(pfn_batch[j]);
> +                }
> +
> +                if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
> +                {
> +                    PERROR("get_pfn_type_batch failed");
> +                    goto out;
> +                }
> +
> +                broken_page_num2 = 0;
> +                for ( j = 0; j < batch; j++ )
> +                    if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                        broken_page_num2++;
> +
> +                if ( broken_page_num1 < broken_page_num2 )
> +                    last_iter = 0;
> +            }
>

I guess I still don't see the point of this loop.  The pages this loop will
catch are pages in this scenario:
- Page A marked dirty
- Last iteration begins; vm paused
- Page A sent
- Page A marked broken
- Last iteration ends

But in this case, it doesn't really matter that page A is clean on the
receiving side; it's already got a clean working copy with the latest data,
right?



>          } /* end of this while loop for this iteration */
>
>        skip:
> @@ -1550,23 +1592,22 @@
>                      PERROR("Error when writing to state file (tsc)");
>                      goto out;
>                  }
> +            }
> +        }
> +        else
> +            last_iter = 1;
>
> +        if ( xc_shadow_control(xch, dom,
> +                               XEN_DOMCTL_SHADOW_OP_CLEAN,
> HYPERCALL_BUFFER(to_send),
> +                               dinfo->p2m_size, NULL, 0, &shadow_stats)
> != dinfo->p2m_size )
> +        {
> +            PERROR("Error flushing shadow PT");
> +            goto out;
> +        }
>
> -            }
> +        sent_last_iter = sent_this_iter;
>
> -            if ( xc_shadow_control(xch, dom,
> -                                   XEN_DOMCTL_SHADOW_OP_CLEAN,
> HYPERCALL_BUFFER(to_send),
> -                                   dinfo->p2m_size, NULL, 0,
> &shadow_stats) != dinfo->p2m_size )
> -            {
> -                PERROR("Error flushing shadow PT");
> -                goto out;
> -            }
> -
> -            sent_last_iter = sent_this_iter;
> -
> -            print_stats(xch, dom, sent_this_iter, &time_stats,
> &shadow_stats, 1);
> -
> -        }
> +        print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats,
> 1);
>

And what's all this stuff about?  Why force a second sweep when we're
saving to disk?

 -George

--bcaec54b492459420704cef0d728
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <span dir=3D"ltr">&lt;<a href=
=3D"mailto:jinsong.liu@intel.com" target=3D"_blank">jinsong.liu@intel.com</=
a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_quot=
e"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left=
:1px #ccc solid;padding-left:1ex">
+ =A0 =A0 =A0 =A0 =A0 =A0/*<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 * if vMCE occur at last iter, do one more iter so=
 that it get<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 * chance to transfer broken page&#39;s pfn_type a=
nd pfn number to<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 * target and then take appropriate action<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 */<br>
+ =A0 =A0 =A0 =A0 =A0 =A0if ( last_iter )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for ( j =3D 0; j &lt; batch; j++ )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( hvm )<br>
<div class=3D"im">+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pfn_type=
[j] =3D pfn_batch[j];<br>
</div>+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pfn_type[j] =3D pfn_to_mfn=
(pfn_batch[j]);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
+<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( xc_get_pfn_type_batch(xch, dom, batch=
, pfn_type) )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0PERROR(&quot;get_pfn_type_batch fa=
iled&quot;);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
+<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0broken_page_num2 =3D 0;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for ( j =3D 0; j &lt; batch; j++ )<br>
<div class=3D"im">+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( pfn_type[j]=
 =3D=3D XEN_DOMCTL_PFINFO_BROKEN )<br>
</div>+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0broken_page_num2++;<=
br>
+<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( broken_page_num1 &lt; broken_page_num=
2 )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0last_iter =3D 0;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0}<br></blockquote><div><br>I guess I still don&#39=
;t see the point of this loop.=A0 The pages this loop will catch are pages =
in this scenario:<br>- Page A marked dirty<br>- Last iteration begins; vm p=
aused<br>
- Page A sent<br>- Page A marked broken<br>- Last iteration ends<br><br>But=
 in this case, it doesn&#39;t really matter that page A is clean on the rec=
eiving side; it&#39;s already got a clean working copy with the latest data=
, right?<br>
<br>=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;b=
order-left:1px #ccc solid;padding-left:1ex">
=A0 =A0 =A0 =A0 =A0} /* end of this while loop for this iteration */<br>
<br>
=A0 =A0 =A0 =A0skip:<br>
@@ -1550,23 +1592,22 @@<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0PERROR(&quot;Error when writing =
to state file (tsc)&quot;);<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out;<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0else<br>
+ =A0 =A0 =A0 =A0 =A0 =A0last_iter =3D 1;<br>
<br>
+ =A0 =A0 =A0 =A0if ( xc_shadow_control(xch, dom,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 XEN_DOMCTL_SH=
ADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dinfo-&gt;p2m=
_size, NULL, 0, &amp;shadow_stats) !=3D dinfo-&gt;p2m_size )<br>
+ =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0PERROR(&quot;Error flushing shadow PT&quot;);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0goto out;<br>
+ =A0 =A0 =A0 =A0}<br>
<br>
- =A0 =A0 =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0sent_last_iter =3D sent_this_iter;<br>
<br>
- =A0 =A0 =A0 =A0 =A0 =A0if ( xc_shadow_control(xch, dom,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 XEN_D=
OMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dinfo=
-&gt;p2m_size, NULL, 0, &amp;shadow_stats) !=3D dinfo-&gt;p2m_size )<br>
- =A0 =A0 =A0 =A0 =A0 =A0{<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0PERROR(&quot;Error flushing shadow PT&quot=
;);<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out;<br>
- =A0 =A0 =A0 =A0 =A0 =A0}<br>
-<br>
- =A0 =A0 =A0 =A0 =A0 =A0sent_last_iter =3D sent_this_iter;<br>
-<br>
- =A0 =A0 =A0 =A0 =A0 =A0print_stats(xch, dom, sent_this_iter, &amp;time_st=
ats, &amp;shadow_stats, 1);<br>
-<br>
- =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0print_stats(xch, dom, sent_this_iter, &amp;time_stats, &am=
p;shadow_stats, 1);<br></blockquote><div><br>And what&#39;s all this stuff =
about?=A0 Why force a second sweep when we&#39;re saving to disk?<br></div>=
</div>
<br>=A0-George<br></div>

--bcaec54b492459420704cef0d728--


--===============4807346674701914666==
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.xen.org
http://lists.xen.org/xen-devel

--===============4807346674701914666==--


From xen-devel-bounces@lists.xen.org Tue Nov 20 17:48:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:48:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tarw4-00068B-Fk; Tue, 20 Nov 2012 17:48:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1Tarw2-00067h-OI
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 17:48:35 +0000
Received: from [85.158.138.51:36242] by server-9.bemta-3.messagelabs.com id
	12/72-02388-D62CBA05; Tue, 20 Nov 2012 17:48:29 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353433707!22772659!1
X-Originating-IP: [209.85.212.43]
X-SpamReason: No, hits=0.9 required=7.0 tests=HTML_40_50,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11336 invoked from network); 20 Nov 2012 17:48:28 -0000
Received: from mail-vb0-f43.google.com (HELO mail-vb0-f43.google.com)
	(209.85.212.43)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 17:48:28 -0000
Received: by mail-vb0-f43.google.com with SMTP id fn1so3630843vbb.30
	for <xen-devel@lists.xensource.com>;
	Tue, 20 Nov 2012 09:48:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=OXpK3Vo7F5k+Nf3u/0wLExioglQOJOCP9e8uMSX92pE=;
	b=1HBrDbMxbTXLteuCe2brHOAbEcyWQW/Uc0Y9JGsWuj38QcISeopIlwrB1UQrkEMhQ5
	jhul8IGtf0JrdceqVpqZ/dZmLjDKEhX7Eerh7V6/ghM5/ANPXxn9KI5pBHXj6eA+nSG2
	6vDgW3BfBAuL0QW0xIGuO48o42ZUcPfyfNtDRkWWTEDuib/NmxhkF2fAh0qfvzj+tWPo
	9/hHfAglVxfD3RDa5EQhsNB7ORwqpokl255bYppwV6H9L0r2KZiSzmqBXnWwKvKscJ2B
	jorxts/+X0/OXbD4JyJLudxU2zoqzzJIHHXNRGVciUNzDI9sQUwxtg+NK8R5V8wxuiTZ
	O63w==
MIME-Version: 1.0
Received: by 10.220.8.73 with SMTP id g9mr24860599vcg.28.1353433707266; Tue,
	20 Nov 2012 09:48:27 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Tue, 20 Nov 2012 09:48:26 -0800 (PST)
In-Reply-To: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
Date: Tue, 20 Nov 2012 17:48:26 +0000
X-Google-Sender-Auth: ZJi5hJhBgQ0UFnK9CAUb-WuPUmc
Message-ID: <CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Liu Jinsong <jinsong.liu@intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4807346674701914666=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4807346674701914666==
Content-Type: multipart/alternative; boundary=bcaec54b492459420704cef0d728

--bcaec54b492459420704cef0d728
Content-Type: text/plain; charset=ISO-8859-1

On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <jinsong.liu@intel.com> wrote:

> +            /*
> +             * if vMCE occur at last iter, do one more iter so that it get
> +             * chance to transfer broken page's pfn_type and pfn number to
> +             * target and then take appropriate action
> +             */
> +            if ( last_iter )
> +            {
> +                for ( j = 0; j < batch; j++ )
> +                {
> +                    if ( hvm )
> +                        pfn_type[j] = pfn_batch[j];
> +                    else
> +                        pfn_type[j] = pfn_to_mfn(pfn_batch[j]);
> +                }
> +
> +                if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
> +                {
> +                    PERROR("get_pfn_type_batch failed");
> +                    goto out;
> +                }
> +
> +                broken_page_num2 = 0;
> +                for ( j = 0; j < batch; j++ )
> +                    if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                        broken_page_num2++;
> +
> +                if ( broken_page_num1 < broken_page_num2 )
> +                    last_iter = 0;
> +            }
>

I guess I still don't see the point of this loop.  The pages this loop will
catch are pages in this scenario:
- Page A marked dirty
- Last iteration begins; vm paused
- Page A sent
- Page A marked broken
- Last iteration ends

But in this case, it doesn't really matter that page A is clean on the
receiving side; it's already got a clean working copy with the latest data,
right?



>          } /* end of this while loop for this iteration */
>
>        skip:
> @@ -1550,23 +1592,22 @@
>                      PERROR("Error when writing to state file (tsc)");
>                      goto out;
>                  }
> +            }
> +        }
> +        else
> +            last_iter = 1;
>
> +        if ( xc_shadow_control(xch, dom,
> +                               XEN_DOMCTL_SHADOW_OP_CLEAN,
> HYPERCALL_BUFFER(to_send),
> +                               dinfo->p2m_size, NULL, 0, &shadow_stats)
> != dinfo->p2m_size )
> +        {
> +            PERROR("Error flushing shadow PT");
> +            goto out;
> +        }
>
> -            }
> +        sent_last_iter = sent_this_iter;
>
> -            if ( xc_shadow_control(xch, dom,
> -                                   XEN_DOMCTL_SHADOW_OP_CLEAN,
> HYPERCALL_BUFFER(to_send),
> -                                   dinfo->p2m_size, NULL, 0,
> &shadow_stats) != dinfo->p2m_size )
> -            {
> -                PERROR("Error flushing shadow PT");
> -                goto out;
> -            }
> -
> -            sent_last_iter = sent_this_iter;
> -
> -            print_stats(xch, dom, sent_this_iter, &time_stats,
> &shadow_stats, 1);
> -
> -        }
> +        print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats,
> 1);
>

And what's all this stuff about?  Why force a second sweep when we're
saving to disk?

 -George

--bcaec54b492459420704cef0d728
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <span dir=3D"ltr">&lt;<a href=
=3D"mailto:jinsong.liu@intel.com" target=3D"_blank">jinsong.liu@intel.com</=
a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_quot=
e"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left=
:1px #ccc solid;padding-left:1ex">
+ =A0 =A0 =A0 =A0 =A0 =A0/*<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 * if vMCE occur at last iter, do one more iter so=
 that it get<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 * chance to transfer broken page&#39;s pfn_type a=
nd pfn number to<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 * target and then take appropriate action<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 */<br>
+ =A0 =A0 =A0 =A0 =A0 =A0if ( last_iter )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for ( j =3D 0; j &lt; batch; j++ )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( hvm )<br>
<div class=3D"im">+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pfn_type=
[j] =3D pfn_batch[j];<br>
</div>+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pfn_type[j] =3D pfn_to_mfn=
(pfn_batch[j]);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
+<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( xc_get_pfn_type_batch(xch, dom, batch=
, pfn_type) )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0PERROR(&quot;get_pfn_type_batch fa=
iled&quot;);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
+<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0broken_page_num2 =3D 0;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for ( j =3D 0; j &lt; batch; j++ )<br>
<div class=3D"im">+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( pfn_type[j]=
 =3D=3D XEN_DOMCTL_PFINFO_BROKEN )<br>
</div>+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0broken_page_num2++;<=
br>
+<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( broken_page_num1 &lt; broken_page_num=
2 )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0last_iter =3D 0;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0}<br></blockquote><div><br>I guess I still don&#39=
;t see the point of this loop.=A0 The pages this loop will catch are pages =
in this scenario:<br>- Page A marked dirty<br>- Last iteration begins; vm p=
aused<br>
- Page A sent<br>- Page A marked broken<br>- Last iteration ends<br><br>But=
 in this case, it doesn&#39;t really matter that page A is clean on the rec=
eiving side; it&#39;s already got a clean working copy with the latest data=
, right?<br>
<br>=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;b=
order-left:1px #ccc solid;padding-left:1ex">
=A0 =A0 =A0 =A0 =A0} /* end of this while loop for this iteration */<br>
<br>
=A0 =A0 =A0 =A0skip:<br>
@@ -1550,23 +1592,22 @@<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0PERROR(&quot;Error when writing =
to state file (tsc)&quot;);<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out;<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0else<br>
+ =A0 =A0 =A0 =A0 =A0 =A0last_iter =3D 1;<br>
<br>
+ =A0 =A0 =A0 =A0if ( xc_shadow_control(xch, dom,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 XEN_DOMCTL_SH=
ADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dinfo-&gt;p2m=
_size, NULL, 0, &amp;shadow_stats) !=3D dinfo-&gt;p2m_size )<br>
+ =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0PERROR(&quot;Error flushing shadow PT&quot;);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0goto out;<br>
+ =A0 =A0 =A0 =A0}<br>
<br>
- =A0 =A0 =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0sent_last_iter =3D sent_this_iter;<br>
<br>
- =A0 =A0 =A0 =A0 =A0 =A0if ( xc_shadow_control(xch, dom,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 XEN_D=
OMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dinfo=
-&gt;p2m_size, NULL, 0, &amp;shadow_stats) !=3D dinfo-&gt;p2m_size )<br>
- =A0 =A0 =A0 =A0 =A0 =A0{<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0PERROR(&quot;Error flushing shadow PT&quot=
;);<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out;<br>
- =A0 =A0 =A0 =A0 =A0 =A0}<br>
-<br>
- =A0 =A0 =A0 =A0 =A0 =A0sent_last_iter =3D sent_this_iter;<br>
-<br>
- =A0 =A0 =A0 =A0 =A0 =A0print_stats(xch, dom, sent_this_iter, &amp;time_st=
ats, &amp;shadow_stats, 1);<br>
-<br>
- =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0print_stats(xch, dom, sent_this_iter, &amp;time_stats, &am=
p;shadow_stats, 1);<br></blockquote><div><br>And what&#39;s all this stuff =
about?=A0 Why force a second sweep when we&#39;re saving to disk?<br></div>=
</div>
<br>=A0-George<br></div>

--bcaec54b492459420704cef0d728--


--===============4807346674701914666==
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.xen.org
http://lists.xen.org/xen-devel

--===============4807346674701914666==--


From xen-devel-bounces@lists.xen.org Tue Nov 20 17:49:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:49:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tarws-0006Mc-0Z; Tue, 20 Nov 2012 17:49:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1Tarwq-0006M8-LH
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 17:49:24 +0000
Received: from [85.158.139.211:20868] by server-5.bemta-5.messagelabs.com id
	1B/92-11353-3A2CBA05; Tue, 20 Nov 2012 17:49:23 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1353433762!19443087!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0NjMwMQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12245 invoked from network); 20 Nov 2012 17:49:23 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-9.tower-206.messagelabs.com with SMTP;
	20 Nov 2012 17:49:23 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga101.fm.intel.com with ESMTP; 20 Nov 2012 09:49:21 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,286,1352102400"; d="scan'208";a="250088577"
Received: from fmsmsx107.amr.corp.intel.com ([10.19.9.54])
	by fmsmga001.fm.intel.com with ESMTP; 20 Nov 2012 09:49:12 -0800
Received: from fmsmsx119.amr.corp.intel.com (10.18.22.143) by
	FMSMSX107.amr.corp.intel.com (10.19.9.54) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 09:49:12 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	fmsmsx119.amr.corp.intel.com (10.18.22.143) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 09:49:12 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 01:49:10 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Thread-Topic: [PATCH V3] X86/vMCE: handle broken page with regard to migration
Thread-Index: AQHNx0O7gIBs/Elka0CkW2KriS9nNJfy/3mg
Date: Tue, 20 Nov 2012 17:49:09 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353937A7@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
	<1353344256.18229.129.camel@zakaz.uk.xensource.com>
	<50AB9CFE.7000003@eu.citrix.com>
	<DE8DF0795D48FD4CA783C40EC8292335393633@SHSMSX101.ccr.corp.intel.com>
	<50ABBC86.6040701@eu.citrix.com>
In-Reply-To: <50ABBC86.6040701@eu.citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> On 20/11/12 17:08, Liu, Jinsong wrote:
>>> On the other hand, the whole situation is hopefully rare enough that
>>> maybe we can just do the simple correct thing, even if it's a tiny
>>> bit sub-optimal.  In that case, assuming that spurious vMCEs aren't
>>> a problem (e.g., #1), I think we basically just need to see if the
>>> last iteration contains a broken page, and if so, send the guest a
>>> vMCE on resume. 
>>> 
>>> Thoughts?
>> 
>> Yes, that's exactly V3 patch did.
> 
> Right -- but you did it by adding an extra couple of loops, which made
> us wonder if there was a more efficient way to do the same thing.  Now
> that we know *what* needs to be done, we're in a better position to
> think about other options.  Let me take a look...
> 
>   -George

Wow, thanks!

Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:49:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:49:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tarws-0006Mc-0Z; Tue, 20 Nov 2012 17:49:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1Tarwq-0006M8-LH
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 17:49:24 +0000
Received: from [85.158.139.211:20868] by server-5.bemta-5.messagelabs.com id
	1B/92-11353-3A2CBA05; Tue, 20 Nov 2012 17:49:23 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1353433762!19443087!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0NjMwMQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12245 invoked from network); 20 Nov 2012 17:49:23 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-9.tower-206.messagelabs.com with SMTP;
	20 Nov 2012 17:49:23 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga101.fm.intel.com with ESMTP; 20 Nov 2012 09:49:21 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,286,1352102400"; d="scan'208";a="250088577"
Received: from fmsmsx107.amr.corp.intel.com ([10.19.9.54])
	by fmsmga001.fm.intel.com with ESMTP; 20 Nov 2012 09:49:12 -0800
Received: from fmsmsx119.amr.corp.intel.com (10.18.22.143) by
	FMSMSX107.amr.corp.intel.com (10.19.9.54) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 09:49:12 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	fmsmsx119.amr.corp.intel.com (10.18.22.143) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 09:49:12 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 01:49:10 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Thread-Topic: [PATCH V3] X86/vMCE: handle broken page with regard to migration
Thread-Index: AQHNx0O7gIBs/Elka0CkW2KriS9nNJfy/3mg
Date: Tue, 20 Nov 2012 17:49:09 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353937A7@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
	<1353344256.18229.129.camel@zakaz.uk.xensource.com>
	<50AB9CFE.7000003@eu.citrix.com>
	<DE8DF0795D48FD4CA783C40EC8292335393633@SHSMSX101.ccr.corp.intel.com>
	<50ABBC86.6040701@eu.citrix.com>
In-Reply-To: <50ABBC86.6040701@eu.citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> On 20/11/12 17:08, Liu, Jinsong wrote:
>>> On the other hand, the whole situation is hopefully rare enough that
>>> maybe we can just do the simple correct thing, even if it's a tiny
>>> bit sub-optimal.  In that case, assuming that spurious vMCEs aren't
>>> a problem (e.g., #1), I think we basically just need to see if the
>>> last iteration contains a broken page, and if so, send the guest a
>>> vMCE on resume. 
>>> 
>>> Thoughts?
>> 
>> Yes, that's exactly V3 patch did.
> 
> Right -- but you did it by adding an extra couple of loops, which made
> us wonder if there was a more efficient way to do the same thing.  Now
> that we know *what* needs to be done, we're in a better position to
> think about other options.  Let me take a look...
> 
>   -George

Wow, thanks!

Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:53:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:53:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tas0F-0006sb-SM; Tue, 20 Nov 2012 17:52:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Tas0E-0006sR-JP
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:52:54 +0000
Received: from [85.158.143.35:64343] by server-1.bemta-4.messagelabs.com id
	2D/CD-27934-573CBA05; Tue, 20 Nov 2012 17:52:53 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1353433956!11410032!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3NTEwMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26421 invoked from network); 20 Nov 2012 17:52:38 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-11.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 20 Nov 2012 17:52:38 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAKHqXGX022754
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 20 Nov 2012 17:52:33 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAKHqWDN029663
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 20 Nov 2012 17:52:32 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAKHqVcQ027324; Tue, 20 Nov 2012 11:52:31 -0600
MIME-Version: 1.0
Message-ID: <47fef645-2fc9-4039-86da-13874fbef552@default>
Date: Tue, 20 Nov 2012 09:52:28 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Tim Deegan <tim@xen.org>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
	<1353062895.3499.205.camel@zakaz.uk.xensource.com>
	<ea33a942-7e63-4339-85c6-35935ae5119b@default>
	<50AB4A8602000078000A9E10@nat28.tlf.novell.com>
	<1353406581.13542.13.camel@zakaz.uk.xensource.com>
	<1bc66c5f-1740-411f-9be2-3de26372b469@default>
	<20121120164744.GA46858@ocelot.phlegethon.org>
In-Reply-To: <20121120164744.GA46858@ocelot.phlegethon.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Tim Deegan [mailto:tim@xen.org]
> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> 
> At 08:33 -0800 on 20 Nov (1353400380), Dan Magenheimer wrote:
> > I agree it's possible, just saying it's not trivial... one has to
> > account not only for superpages system-wide (which isn't currently
> > done) but a mix of unclaimed superpages and unclaimed order==0 pages
> > per-domain.  Especially since that would improve launch of only a small
> > and shrinking class of domains (PV && superpages=1 && mem="huge"),
> > can we please consider it a possible future enhancement, not a showstopper?
> 
> Please, no.  Either you need this benighted hypercall, or you don't.
> If you really need it, do it properly.

Hi Tim --

I must respectfully disagree.

For years, Xen has been accepting features that work on a 64-bit
hypervisor but not on a 32-bit hypervisor.  And new features such
as memory-sharing/paging _could_ be designed to help PV domains and
have completely ignored PV but have still been accepted.  There is
clearly precedent for new features that don't enhance every
possible case.

The claim feature dramatically decreases a real customer problem in
the vast majority of our customer environments with no loss of
functionality in the small remaining percentage.  This real problem
is getting continually worse as system physical RAM and domain memory
requirements increase.  So, yes, _we_ do need it.

Considering maintenance, adding 100% claim support for remaining
near-obsolescent domains will (IMHO) unnecessarily clutter both
the hypervisor and the toolstack, with very little net value
to real customers.

So, in my opinion, it _is_ done properly already, just not
obsessively.

Dan

P.S. Did you mean "beknighted"?  Or are you referring to your
omniscient toolstack as enlightened and Oracle's toolstack as
ignorant?  As a fan of etymology and wordplay, I'm curious...

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 17:53:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 17:53:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tas0F-0006sb-SM; Tue, 20 Nov 2012 17:52:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Tas0E-0006sR-JP
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 17:52:54 +0000
Received: from [85.158.143.35:64343] by server-1.bemta-4.messagelabs.com id
	2D/CD-27934-573CBA05; Tue, 20 Nov 2012 17:52:53 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1353433956!11410032!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3NTEwMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26421 invoked from network); 20 Nov 2012 17:52:38 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-11.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 20 Nov 2012 17:52:38 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAKHqXGX022754
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 20 Nov 2012 17:52:33 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAKHqWDN029663
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 20 Nov 2012 17:52:32 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAKHqVcQ027324; Tue, 20 Nov 2012 11:52:31 -0600
MIME-Version: 1.0
Message-ID: <47fef645-2fc9-4039-86da-13874fbef552@default>
Date: Tue, 20 Nov 2012 09:52:28 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Tim Deegan <tim@xen.org>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
	<1353062895.3499.205.camel@zakaz.uk.xensource.com>
	<ea33a942-7e63-4339-85c6-35935ae5119b@default>
	<50AB4A8602000078000A9E10@nat28.tlf.novell.com>
	<1353406581.13542.13.camel@zakaz.uk.xensource.com>
	<1bc66c5f-1740-411f-9be2-3de26372b469@default>
	<20121120164744.GA46858@ocelot.phlegethon.org>
In-Reply-To: <20121120164744.GA46858@ocelot.phlegethon.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Zhigang Wang <zhigang.x.wang@oracle.com>, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Tim Deegan [mailto:tim@xen.org]
> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> 
> At 08:33 -0800 on 20 Nov (1353400380), Dan Magenheimer wrote:
> > I agree it's possible, just saying it's not trivial... one has to
> > account not only for superpages system-wide (which isn't currently
> > done) but a mix of unclaimed superpages and unclaimed order==0 pages
> > per-domain.  Especially since that would improve launch of only a small
> > and shrinking class of domains (PV && superpages=1 && mem="huge"),
> > can we please consider it a possible future enhancement, not a showstopper?
> 
> Please, no.  Either you need this benighted hypercall, or you don't.
> If you really need it, do it properly.

Hi Tim --

I must respectfully disagree.

For years, Xen has been accepting features that work on a 64-bit
hypervisor but not on a 32-bit hypervisor.  And new features such
as memory-sharing/paging _could_ be designed to help PV domains and
have completely ignored PV but have still been accepted.  There is
clearly precedent for new features that don't enhance every
possible case.

The claim feature dramatically decreases a real customer problem in
the vast majority of our customer environments with no loss of
functionality in the small remaining percentage.  This real problem
is getting continually worse as system physical RAM and domain memory
requirements increase.  So, yes, _we_ do need it.

Considering maintenance, adding 100% claim support for remaining
near-obsolescent domains will (IMHO) unnecessarily clutter both
the hypervisor and the toolstack, with very little net value
to real customers.

So, in my opinion, it _is_ done properly already, just not
obsessively.

Dan

P.S. Did you mean "beknighted"?  Or are you referring to your
omniscient toolstack as enlightened and Oracle's toolstack as
ignorant?  As a fan of etymology and wordplay, I'm curious...

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 18:14:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 18:14:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TasKi-0007OO-Pt; Tue, 20 Nov 2012 18:14:04 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TasKh-0007OH-K4
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 18:14:03 +0000
Received: from [193.109.254.147:28040] by server-16.bemta-14.messagelabs.com
	id 8E/E0-09215-A68CBA05; Tue, 20 Nov 2012 18:14:02 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1353435241!4741837!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY3NTIx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16480 invoked from network); 20 Nov 2012 18:14:01 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-14.tower-27.messagelabs.com with SMTP;
	20 Nov 2012 18:14:01 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 20 Nov 2012 10:13:20 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,287,1352102400"; 
	d="scan'208,217";a="222260708"
Received: from fmsmsx107.amr.corp.intel.com ([10.19.9.54])
	by orsmga001.jf.intel.com with ESMTP; 20 Nov 2012 10:13:59 -0800
Received: from FMSMSX110.amr.corp.intel.com (10.19.9.29) by
	FMSMSX107.amr.corp.intel.com (10.19.9.54) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 10:13:59 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	fmsmsx110.amr.corp.intel.com (10.19.9.29) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 10:13:59 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 02:13:57 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNx0dSWSR52N+j5UqhK6CjagaIUZfzAr3Q
Date: Tue, 20 Nov 2012 18:13:56 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
In-Reply-To: <CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1646373611190925612=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============1646373611190925612==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_DE8DF0795D48FD4CA783C40EC82923353937DFSHSMSX101ccrcorpi_"

--_000_DE8DF0795D48FD4CA783C40EC82923353937DFSHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable



________________________________
From: dunlapg@gmail.com [mailto:dunlapg@gmail.com] On Behalf Of George Dunl=
ap
Sent: Wednesday, November 21, 2012 1:48 AM
To: Liu, Jinsong
Cc: Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regar=
d to migration

On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <jinsong.liu@intel.com<mailto:=
jinsong.liu@intel.com>> wrote:
+            /*
+             * if vMCE occur at last iter, do one more iter so that it get
+             * chance to transfer broken page's pfn_type and pfn number to
+             * target and then take appropriate action
+             */
+            if ( last_iter )
+            {
+                for ( j =3D 0; j < batch; j++ )
+                {
+                    if ( hvm )
+                        pfn_type[j] =3D pfn_batch[j];
+                    else
+                        pfn_type[j] =3D pfn_to_mfn(pfn_batch[j]);
+                }
+
+                if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
+                {
+                    PERROR("get_pfn_type_batch failed");
+                    goto out;
+                }
+
+                broken_page_num2 =3D 0;
+                for ( j =3D 0; j < batch; j++ )
+                    if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_BROKEN )
+                        broken_page_num2++;
+
+                if ( broken_page_num1 < broken_page_num2 )
+                    last_iter =3D 0;
+            }

I guess I still don't see the point of this loop.  The pages this loop will=
 catch are pages in this scenario:
- Page A marked dirty
- Last iteration begins; vm paused
- Page A sent
- Page A marked broken
- Last iteration ends

[Jinsong]

No, at last lter, there are 4 points:
1. start last iter
2. get and transfer pfn_type to target
3. copy page to target
4. end last iter

this code monitor whether it has a vmce occur at area from point 2 to point=
 4 (we don't care vmce occur at last iter but before point2)

But in this case, it doesn't really matter that page A is clean on the rece=
iving side; it's already got a clean working copy with the latest data, rig=
ht?


         } /* end of this while loop for this iteration */

       skip:
@@ -1550,23 +1592,22 @@
                     PERROR("Error when writing to state file (tsc)");
                     goto out;
                 }
+            }
+        }
+        else
+            last_iter =3D 1;

+        if ( xc_shadow_control(xch, dom,
+                               XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFE=
R(to_send),
+                               dinfo->p2m_size, NULL, 0, &shadow_stats) !=
=3D dinfo->p2m_size )
+        {
+            PERROR("Error flushing shadow PT");
+            goto out;
+        }

-            }
+        sent_last_iter =3D sent_this_iter;

-            if ( xc_shadow_control(xch, dom,
-                                   XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_B=
UFFER(to_send),
-                                   dinfo->p2m_size, NULL, 0, &shadow_stats=
) !=3D dinfo->p2m_size )
-            {
-                PERROR("Error flushing shadow PT");
-                goto out;
-            }
-
-            sent_last_iter =3D sent_this_iter;
-
-            print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_sta=
ts, 1);
-
-        }
+        print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, =
1);

And what's all this stuff about?  Why force a second sweep when we're savin=
g to disk?

 [Jinsong] if not, saving to disk will do endless loop, since it has no cha=
nce to set last_iter=3D1.




--_000_DE8DF0795D48FD4CA783C40EC82923353937DFSHSMSX101ccrcorpi_
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=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"GENERATOR" content=3D"MSHTML 8.00.6001.19328">
</head>
<body>
<div dir=3D"ltr" align=3D"left"><font color=3D"#0000ff" size=3D"2" face=3D"=
Arial"></font>&nbsp;</div>
<br>
<div dir=3D"ltr" lang=3D"en-us" class=3D"OutlookMessageHeader" align=3D"lef=
t"><font face=3D"Arial">
<hr tabindex=3D"-1">
</font><font face=3D"Arial"><font size=3D"2"><b>From:</b> dunlapg@gmail.com=
 [mailto:dunlapg@gmail.com]
<b>On Behalf Of </b>George Dunlap<br>
<b>Sent:</b> Wednesday, November 21, 2012 1:48 AM<br>
<b>To:</b> Liu, Jinsong<br>
<b>Cc:</b> Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensourc=
e.com<br>
<b>Subject:</b> Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page wit=
h regard to migration<br>
</font><br>
</font></div>
<div><font face=3D"Arial"></font></div>
<font face=3D"Arial">On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <span dir=
=3D"ltr">&lt;<a href=3D"mailto:jinsong.liu@intel.com" target=3D"_blank">jin=
song.liu@intel.com</a>&gt;</span> wrote:<br>
</font>
<div class=3D"gmail_quote">
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<font face=3D"Arial">&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/*<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * if vMCE occur at last ite=
r, do one more iter so that it get<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * chance to transfer broken=
 page's pfn_type and pfn number to<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * target and then take appr=
opriate action<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( last_iter )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for ( j =3D 0;=
 j &lt; batch; j&#43;&#43; )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
if ( hvm )<br>
</font>
<div class=3D"im"><font face=3D"Arial">&#43; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pfn_type[j] =3D pfn_ba=
tch[j];<br>
</font></div>
<font face=3D"Arial">&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp;else<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp;pfn_type[j] =3D pfn_to_mfn(pfn_batch[j]);<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( xc_get_pf=
n_type_batch(xch, dom, batch, pfn_type) )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
PERROR(&quot;get_pfn_type_batch failed&quot;);<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
goto out;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;broken_page_nu=
m2 =3D 0;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for ( j =3D 0;=
 j &lt; batch; j&#43;&#43; )<br>
</font>
<div class=3D"im"><font face=3D"Arial">&#43; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( pfn_type[j] =3D=3D XEN_DOMCTL_P=
FINFO_BROKEN )<br>
</font></div>
<font face=3D"Arial">&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;broken_page_num2&#43;&#43;;<br>
&#43;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( broken_pa=
ge_num1 &lt; broken_page_num2 )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
last_iter =3D 0;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
</font></blockquote>
<div><br>
<font face=3D"Arial">I guess I still don't see the point of this loop.&nbsp=
; The pages this loop will catch are pages in this scenario:<br>
- Page A marked dirty<br>
- Last iteration begins; vm paused<br>
- Page A sent<br>
- Page A marked broken<br>
- Last iteration ends<span class=3D"459305817-20112012"><font color=3D"#000=
0ff" size=3D"2">&nbsp;</font></span></font></div>
<div><span class=3D"459305817-20112012"><font face=3D"Arial"></font></span>=
&nbsp;</div>
<div><span class=3D"459305817-20112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"Arial">[Jinsong]</font></span></div>
<div><span class=3D"459305817-20112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"Arial"></font></span>&nbsp;</div>
<div><span class=3D"459305817-20112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"Arial">No, at last lter, there are 4 points:</font></span></div>
<div><span class=3D"459305817-20112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"Arial">1. start last iter</font></span></div>
<div><span class=3D"459305817-20112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"Arial">2. get and transfer pfn_type to target</font></span></div>
<div><span class=3D"459305817-20112012"></span><span class=3D"459305817-201=
12012"><font color=3D"#0000ff" size=3D"2" face=3D"Arial">3. copy page to ta=
rget</font></span></div>
<div><span class=3D"459305817-20112012"></span><span class=3D"459305817-201=
12012"><font color=3D"#0000ff" size=3D"2" face=3D"Arial">4.&nbsp;end last i=
ter</font></span></div>
<div><span class=3D"459305817-20112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"Arial"></font></span>&nbsp;</div>
<div><span class=3D"459305817-20112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"Arial">this&nbsp;code monitor whether it has a vmce occur&nbsp;at a=
rea from&nbsp;point 2&nbsp;to point&nbsp;4 (we don't&nbsp;care vmce occur a=
t last iter but before point2)</font></span><font face=3D"Arial"><span clas=
s=3D"459305817-20112012">&nbsp;</span><br>
<br>
But in this case, it doesn't really matter that page A is clean on the rece=
iving side; it's already got a clean working copy with the latest data, rig=
ht?<br>
<br>
&nbsp;</font></div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<font face=3D"Arial">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} /* end of this whi=
le loop for this iteration */<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;skip:<br>
@@ -1550,23 &#43;1592,22 @@<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
;PERROR(&quot;Error when writing to state file (tsc)&quot;);<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
;goto out;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;else<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;last_iter =3D 1;<br>
<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;if ( xc_shadow_control(xch, dom,<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_B=
UFFER(to_send),<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dinfo-&gt;p2m_size, NULL, 0, &amp;shado=
w_stats) !=3D dinfo-&gt;p2m_size )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PERROR(&quot;Error flushing =
shadow PT&quot;);<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;goto out;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;sent_last_iter =3D sent_this_iter;<br>
<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( xc_shadow_control(xch, dom,=
<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XEN_DOMCTL_SHADOW_OP_CLEAN, H=
YPERCALL_BUFFER(to_send),<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dinfo-&gt;p2m_size, NULL, 0, =
&amp;shadow_stats) !=3D dinfo-&gt;p2m_size )<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PERROR(&quot;Error=
 flushing shadow PT&quot;);<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;goto out;<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
-<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sent_last_iter =3D sent_this_ite=
r;<br>
-<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print_stats(xch, dom, sent_this_=
iter, &amp;time_stats, &amp;shadow_stats, 1);<br>
-<br>
- &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;print_stats(xch, dom, sent_this_iter, &amp=
;time_stats, &amp;shadow_stats, 1);<br>
</font></blockquote>
<div><br>
<font face=3D"Arial">And what's all this stuff about?&nbsp; Why force a sec=
ond sweep when we're saving to disk?<br>
</font></div>
</div>
<div class=3D"gmail_extra"><br>
<font face=3D"Arial">&nbsp;<span class=3D"459305817-20112012"><font color=
=3D"#0000ff" size=3D"2">[Jinsong] if not, saving to disk will do endless lo=
op, since it has no chance to set last_iter=3D1.</font></span></font></div>
<div class=3D"gmail_extra"><span class=3D"459305817-20112012"><font face=3D=
"Arial"></font></span>&nbsp;</div>
<div class=3D"gmail_extra"><span class=3D"459305817-20112012"><font face=3D=
"Arial"></font></span>&nbsp;</div>
<div class=3D"gmail_extra"><font face=3D"Arial"><span class=3D"459305817-20=
112012">&nbsp;</span><br>
</font></div>
</body>
</html>

--_000_DE8DF0795D48FD4CA783C40EC82923353937DFSHSMSX101ccrcorpi_--


--===============1646373611190925612==
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.xen.org
http://lists.xen.org/xen-devel

--===============1646373611190925612==--


From xen-devel-bounces@lists.xen.org Tue Nov 20 18:14:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 18:14:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TasKi-0007OO-Pt; Tue, 20 Nov 2012 18:14:04 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TasKh-0007OH-K4
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 18:14:03 +0000
Received: from [193.109.254.147:28040] by server-16.bemta-14.messagelabs.com
	id 8E/E0-09215-A68CBA05; Tue, 20 Nov 2012 18:14:02 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1353435241!4741837!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY3NTIx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16480 invoked from network); 20 Nov 2012 18:14:01 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-14.tower-27.messagelabs.com with SMTP;
	20 Nov 2012 18:14:01 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 20 Nov 2012 10:13:20 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,287,1352102400"; 
	d="scan'208,217";a="222260708"
Received: from fmsmsx107.amr.corp.intel.com ([10.19.9.54])
	by orsmga001.jf.intel.com with ESMTP; 20 Nov 2012 10:13:59 -0800
Received: from FMSMSX110.amr.corp.intel.com (10.19.9.29) by
	FMSMSX107.amr.corp.intel.com (10.19.9.54) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 10:13:59 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	fmsmsx110.amr.corp.intel.com (10.19.9.29) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 10:13:59 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 02:13:57 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNx0dSWSR52N+j5UqhK6CjagaIUZfzAr3Q
Date: Tue, 20 Nov 2012 18:13:56 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
In-Reply-To: <CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1646373611190925612=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============1646373611190925612==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_DE8DF0795D48FD4CA783C40EC82923353937DFSHSMSX101ccrcorpi_"

--_000_DE8DF0795D48FD4CA783C40EC82923353937DFSHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable



________________________________
From: dunlapg@gmail.com [mailto:dunlapg@gmail.com] On Behalf Of George Dunl=
ap
Sent: Wednesday, November 21, 2012 1:48 AM
To: Liu, Jinsong
Cc: Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regar=
d to migration

On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <jinsong.liu@intel.com<mailto:=
jinsong.liu@intel.com>> wrote:
+            /*
+             * if vMCE occur at last iter, do one more iter so that it get
+             * chance to transfer broken page's pfn_type and pfn number to
+             * target and then take appropriate action
+             */
+            if ( last_iter )
+            {
+                for ( j =3D 0; j < batch; j++ )
+                {
+                    if ( hvm )
+                        pfn_type[j] =3D pfn_batch[j];
+                    else
+                        pfn_type[j] =3D pfn_to_mfn(pfn_batch[j]);
+                }
+
+                if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
+                {
+                    PERROR("get_pfn_type_batch failed");
+                    goto out;
+                }
+
+                broken_page_num2 =3D 0;
+                for ( j =3D 0; j < batch; j++ )
+                    if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_BROKEN )
+                        broken_page_num2++;
+
+                if ( broken_page_num1 < broken_page_num2 )
+                    last_iter =3D 0;
+            }

I guess I still don't see the point of this loop.  The pages this loop will=
 catch are pages in this scenario:
- Page A marked dirty
- Last iteration begins; vm paused
- Page A sent
- Page A marked broken
- Last iteration ends

[Jinsong]

No, at last lter, there are 4 points:
1. start last iter
2. get and transfer pfn_type to target
3. copy page to target
4. end last iter

this code monitor whether it has a vmce occur at area from point 2 to point=
 4 (we don't care vmce occur at last iter but before point2)

But in this case, it doesn't really matter that page A is clean on the rece=
iving side; it's already got a clean working copy with the latest data, rig=
ht?


         } /* end of this while loop for this iteration */

       skip:
@@ -1550,23 +1592,22 @@
                     PERROR("Error when writing to state file (tsc)");
                     goto out;
                 }
+            }
+        }
+        else
+            last_iter =3D 1;

+        if ( xc_shadow_control(xch, dom,
+                               XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFE=
R(to_send),
+                               dinfo->p2m_size, NULL, 0, &shadow_stats) !=
=3D dinfo->p2m_size )
+        {
+            PERROR("Error flushing shadow PT");
+            goto out;
+        }

-            }
+        sent_last_iter =3D sent_this_iter;

-            if ( xc_shadow_control(xch, dom,
-                                   XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_B=
UFFER(to_send),
-                                   dinfo->p2m_size, NULL, 0, &shadow_stats=
) !=3D dinfo->p2m_size )
-            {
-                PERROR("Error flushing shadow PT");
-                goto out;
-            }
-
-            sent_last_iter =3D sent_this_iter;
-
-            print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_sta=
ts, 1);
-
-        }
+        print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, =
1);

And what's all this stuff about?  Why force a second sweep when we're savin=
g to disk?

 [Jinsong] if not, saving to disk will do endless loop, since it has no cha=
nce to set last_iter=3D1.




--_000_DE8DF0795D48FD4CA783C40EC82923353937DFSHSMSX101ccrcorpi_
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=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"GENERATOR" content=3D"MSHTML 8.00.6001.19328">
</head>
<body>
<div dir=3D"ltr" align=3D"left"><font color=3D"#0000ff" size=3D"2" face=3D"=
Arial"></font>&nbsp;</div>
<br>
<div dir=3D"ltr" lang=3D"en-us" class=3D"OutlookMessageHeader" align=3D"lef=
t"><font face=3D"Arial">
<hr tabindex=3D"-1">
</font><font face=3D"Arial"><font size=3D"2"><b>From:</b> dunlapg@gmail.com=
 [mailto:dunlapg@gmail.com]
<b>On Behalf Of </b>George Dunlap<br>
<b>Sent:</b> Wednesday, November 21, 2012 1:48 AM<br>
<b>To:</b> Liu, Jinsong<br>
<b>Cc:</b> Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensourc=
e.com<br>
<b>Subject:</b> Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page wit=
h regard to migration<br>
</font><br>
</font></div>
<div><font face=3D"Arial"></font></div>
<font face=3D"Arial">On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <span dir=
=3D"ltr">&lt;<a href=3D"mailto:jinsong.liu@intel.com" target=3D"_blank">jin=
song.liu@intel.com</a>&gt;</span> wrote:<br>
</font>
<div class=3D"gmail_quote">
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<font face=3D"Arial">&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/*<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * if vMCE occur at last ite=
r, do one more iter so that it get<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * chance to transfer broken=
 page's pfn_type and pfn number to<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * target and then take appr=
opriate action<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( last_iter )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for ( j =3D 0;=
 j &lt; batch; j&#43;&#43; )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
if ( hvm )<br>
</font>
<div class=3D"im"><font face=3D"Arial">&#43; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pfn_type[j] =3D pfn_ba=
tch[j];<br>
</font></div>
<font face=3D"Arial">&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp;else<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp;pfn_type[j] =3D pfn_to_mfn(pfn_batch[j]);<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( xc_get_pf=
n_type_batch(xch, dom, batch, pfn_type) )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
PERROR(&quot;get_pfn_type_batch failed&quot;);<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
goto out;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;broken_page_nu=
m2 =3D 0;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for ( j =3D 0;=
 j &lt; batch; j&#43;&#43; )<br>
</font>
<div class=3D"im"><font face=3D"Arial">&#43; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( pfn_type[j] =3D=3D XEN_DOMCTL_P=
FINFO_BROKEN )<br>
</font></div>
<font face=3D"Arial">&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;broken_page_num2&#43;&#43;;<br>
&#43;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( broken_pa=
ge_num1 &lt; broken_page_num2 )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
last_iter =3D 0;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
</font></blockquote>
<div><br>
<font face=3D"Arial">I guess I still don't see the point of this loop.&nbsp=
; The pages this loop will catch are pages in this scenario:<br>
- Page A marked dirty<br>
- Last iteration begins; vm paused<br>
- Page A sent<br>
- Page A marked broken<br>
- Last iteration ends<span class=3D"459305817-20112012"><font color=3D"#000=
0ff" size=3D"2">&nbsp;</font></span></font></div>
<div><span class=3D"459305817-20112012"><font face=3D"Arial"></font></span>=
&nbsp;</div>
<div><span class=3D"459305817-20112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"Arial">[Jinsong]</font></span></div>
<div><span class=3D"459305817-20112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"Arial"></font></span>&nbsp;</div>
<div><span class=3D"459305817-20112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"Arial">No, at last lter, there are 4 points:</font></span></div>
<div><span class=3D"459305817-20112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"Arial">1. start last iter</font></span></div>
<div><span class=3D"459305817-20112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"Arial">2. get and transfer pfn_type to target</font></span></div>
<div><span class=3D"459305817-20112012"></span><span class=3D"459305817-201=
12012"><font color=3D"#0000ff" size=3D"2" face=3D"Arial">3. copy page to ta=
rget</font></span></div>
<div><span class=3D"459305817-20112012"></span><span class=3D"459305817-201=
12012"><font color=3D"#0000ff" size=3D"2" face=3D"Arial">4.&nbsp;end last i=
ter</font></span></div>
<div><span class=3D"459305817-20112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"Arial"></font></span>&nbsp;</div>
<div><span class=3D"459305817-20112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"Arial">this&nbsp;code monitor whether it has a vmce occur&nbsp;at a=
rea from&nbsp;point 2&nbsp;to point&nbsp;4 (we don't&nbsp;care vmce occur a=
t last iter but before point2)</font></span><font face=3D"Arial"><span clas=
s=3D"459305817-20112012">&nbsp;</span><br>
<br>
But in this case, it doesn't really matter that page A is clean on the rece=
iving side; it's already got a clean working copy with the latest data, rig=
ht?<br>
<br>
&nbsp;</font></div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<font face=3D"Arial">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} /* end of this whi=
le loop for this iteration */<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;skip:<br>
@@ -1550,23 &#43;1592,22 @@<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
;PERROR(&quot;Error when writing to state file (tsc)&quot;);<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
;goto out;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;else<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;last_iter =3D 1;<br>
<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;if ( xc_shadow_control(xch, dom,<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_B=
UFFER(to_send),<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dinfo-&gt;p2m_size, NULL, 0, &amp;shado=
w_stats) !=3D dinfo-&gt;p2m_size )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PERROR(&quot;Error flushing =
shadow PT&quot;);<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;goto out;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;sent_last_iter =3D sent_this_iter;<br>
<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( xc_shadow_control(xch, dom,=
<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XEN_DOMCTL_SHADOW_OP_CLEAN, H=
YPERCALL_BUFFER(to_send),<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dinfo-&gt;p2m_size, NULL, 0, =
&amp;shadow_stats) !=3D dinfo-&gt;p2m_size )<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PERROR(&quot;Error=
 flushing shadow PT&quot;);<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;goto out;<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
-<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sent_last_iter =3D sent_this_ite=
r;<br>
-<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print_stats(xch, dom, sent_this_=
iter, &amp;time_stats, &amp;shadow_stats, 1);<br>
-<br>
- &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;print_stats(xch, dom, sent_this_iter, &amp=
;time_stats, &amp;shadow_stats, 1);<br>
</font></blockquote>
<div><br>
<font face=3D"Arial">And what's all this stuff about?&nbsp; Why force a sec=
ond sweep when we're saving to disk?<br>
</font></div>
</div>
<div class=3D"gmail_extra"><br>
<font face=3D"Arial">&nbsp;<span class=3D"459305817-20112012"><font color=
=3D"#0000ff" size=3D"2">[Jinsong] if not, saving to disk will do endless lo=
op, since it has no chance to set last_iter=3D1.</font></span></font></div>
<div class=3D"gmail_extra"><span class=3D"459305817-20112012"><font face=3D=
"Arial"></font></span>&nbsp;</div>
<div class=3D"gmail_extra"><span class=3D"459305817-20112012"><font face=3D=
"Arial"></font></span>&nbsp;</div>
<div class=3D"gmail_extra"><font face=3D"Arial"><span class=3D"459305817-20=
112012">&nbsp;</span><br>
</font></div>
</body>
</html>

--_000_DE8DF0795D48FD4CA783C40EC82923353937DFSHSMSX101ccrcorpi_--


--===============1646373611190925612==
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.xen.org
http://lists.xen.org/xen-devel

--===============1646373611190925612==--


From xen-devel-bounces@lists.xen.org Tue Nov 20 18:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 18:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TasRy-0007lf-Nm; Tue, 20 Nov 2012 18:21:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TasRx-0007la-HY
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 18:21:33 +0000
Received: from [85.158.139.83:62175] by server-7.bemta-5.messagelabs.com id
	DC/B3-23096-C2ACBA05; Tue, 20 Nov 2012 18:21:32 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1353435691!30875695!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17316 invoked from network); 20 Nov 2012 18:21:31 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 18:21:31 -0000
X-IronPort-AV: E=Sophos;i="4.83,287,1352073600"; d="scan'208";a="15912434"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 18:21:31 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 20 Nov 2012 18:21:31 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TasRv-0001dI-8Q; Tue, 20 Nov 2012 18:21:31 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TasRv-0002Ep-3P;
	Tue, 20 Nov 2012 18:21:31 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20651.51754.974511.264479@mariner.uk.xensource.com>
Date: Tue, 20 Nov 2012 18:21:30 +0000
To: "Liu, Jinsong" <jinsong.liu@intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard to migration"):
> No, at last lter, there are 4 points:
> 1. start last iter
> 2. get and transfer pfn_type to target
> 3. copy page to target
> 4. end last iter
> 
> this code monitor whether it has a vmce occur at area from point 2 to point 4 (we don't care vmce occur at last iter but before point2)

The migration code is rather tangled but perhaps it would be best to
check for mce after step 3 for each page, and keep a separate list of
the pages which broke in that pass ?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 18:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 18:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TasRy-0007lf-Nm; Tue, 20 Nov 2012 18:21:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TasRx-0007la-HY
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 18:21:33 +0000
Received: from [85.158.139.83:62175] by server-7.bemta-5.messagelabs.com id
	DC/B3-23096-C2ACBA05; Tue, 20 Nov 2012 18:21:32 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1353435691!30875695!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17316 invoked from network); 20 Nov 2012 18:21:31 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 18:21:31 -0000
X-IronPort-AV: E=Sophos;i="4.83,287,1352073600"; d="scan'208";a="15912434"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 18:21:31 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 20 Nov 2012 18:21:31 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TasRv-0001dI-8Q; Tue, 20 Nov 2012 18:21:31 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TasRv-0002Ep-3P;
	Tue, 20 Nov 2012 18:21:31 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20651.51754.974511.264479@mariner.uk.xensource.com>
Date: Tue, 20 Nov 2012 18:21:30 +0000
To: "Liu, Jinsong" <jinsong.liu@intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard to migration"):
> No, at last lter, there are 4 points:
> 1. start last iter
> 2. get and transfer pfn_type to target
> 3. copy page to target
> 4. end last iter
> 
> this code monitor whether it has a vmce occur at area from point 2 to point 4 (we don't care vmce occur at last iter but before point2)

The migration code is rather tangled but perhaps it would be best to
check for mce after step 3 for each page, and keep a separate list of
the pages which broke in that pass ?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 18:25:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 18:25:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TasVA-0007sy-B8; Tue, 20 Nov 2012 18:24:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TasV8-0007st-RJ
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 18:24:51 +0000
Received: from [85.158.143.99:55862] by server-2.bemta-4.messagelabs.com id
	3B/F5-28922-1FACBA05; Tue, 20 Nov 2012 18:24:49 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-7.tower-216.messagelabs.com!1353435888!27332284!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31261 invoked from network); 20 Nov 2012 18:24:48 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-7.tower-216.messagelabs.com with SMTP;
	20 Nov 2012 18:24:48 -0000
X-TM-IMSS-Message-ID: <9dbaaf24000c3b89@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9dbaaf24000c3b89 ;
	Tue, 20 Nov 2012 13:24:09 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKIOh5R023537; 
	Tue, 20 Nov 2012 13:24:43 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: Matthew.Fioravante@jhuapl.edu
Date: Tue, 20 Nov 2012 13:24:41 -0500
Message-Id: <1353435881-21237-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
References: <068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
Cc: jeremy@goop.org, Ian.Campbell@citrix.com, konrad.wilk@oracle.com,
	xen-devel@lists.xen.org, tpmdd-devel@lists.sourceforge.net,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: [Xen-devel] [PATCH] drivers/tpm-xen: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This changes the vTPM shared page ABI from a copy of the Xen network
interface to a single-page interface that better reflects the expected
behavior of a TPM: only a single request packet can be sent at any given
time, and every packet sent generates a single response packet. This
protocol change should also increase efficiency as it avoids mapping and
unmapping grants when possible.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 drivers/char/tpm/xen-tpmfront_if.c | 191 ++++++-------------------------------
 include/xen/interface/io/tpmif.h   |  42 ++------
 2 files changed, 40 insertions(+), 193 deletions(-)

diff --git a/drivers/char/tpm/xen-tpmfront_if.c b/drivers/char/tpm/xen-tpmfront_if.c
index ba7fad8..02405af 100644
--- a/drivers/char/tpm/xen-tpmfront_if.c
+++ b/drivers/char/tpm/xen-tpmfront_if.c
@@ -53,7 +53,7 @@
 struct tpm_private {
 	struct tpm_chip *chip;
 
-	struct tpmif_tx_interface *tx;
+	struct vtpm_shared_page *page;
 	atomic_t refcnt;
 	unsigned int evtchn;
 	u8 is_connected;
@@ -61,8 +61,6 @@ struct tpm_private {
 
 	spinlock_t tx_lock;
 
-	struct tx_buffer *tx_buffers[TPMIF_TX_RING_SIZE];
-
 	atomic_t tx_busy;
 	void *tx_remember;
 
@@ -73,15 +71,7 @@ struct tpm_private {
 	int ring_ref;
 };
 
-struct tx_buffer {
-	unsigned int size;	/* available space in data */
-	unsigned int len;	/* used space in data */
-	unsigned char *data;	/* pointer to a page */
-};
-
-
 /* locally visible variables */
-static grant_ref_t gref_head;
 static struct tpm_private *my_priv;
 
 /* local function prototypes */
@@ -92,8 +82,6 @@ static int tpmif_connect(struct xenbus_device *dev,
 		struct tpm_private *tp,
 		domid_t domid);
 static DECLARE_TASKLET(tpmif_rx_tasklet, tpmif_rx_action, 0);
-static int tpmif_allocate_tx_buffers(struct tpm_private *tp);
-static void tpmif_free_tx_buffers(struct tpm_private *tp);
 static void tpmif_set_connected_state(struct tpm_private *tp,
 		u8 newstate);
 static int tpm_xmit(struct tpm_private *tp,
@@ -101,52 +89,6 @@ static int tpm_xmit(struct tpm_private *tp,
 		void *remember);
 static void destroy_tpmring(struct tpm_private *tp);
 
-static inline int
-tx_buffer_copy(struct tx_buffer *txb, const u8 *src, int len,
-		int isuserbuffer)
-{
-	int copied = len;
-
-	if (len > txb->size)
-		copied = txb->size;
-	if (isuserbuffer) {
-		if (copy_from_user(txb->data, src, copied))
-			return -EFAULT;
-	} else {
-		memcpy(txb->data, src, copied);
-	}
-	txb->len = len;
-	return copied;
-}
-
-static inline struct tx_buffer *tx_buffer_alloc(void)
-{
-	struct tx_buffer *txb;
-
-	txb = kzalloc(sizeof(struct tx_buffer), GFP_KERNEL);
-	if (!txb)
-		return NULL;
-
-	txb->len = 0;
-	txb->size = PAGE_SIZE;
-	txb->data = (unsigned char *)__get_free_page(GFP_KERNEL);
-	if (txb->data == NULL) {
-		kfree(txb);
-		txb = NULL;
-	}
-
-	return txb;
-}
-
-
-static inline void tx_buffer_free(struct tx_buffer *txb)
-{
-	if (txb) {
-		free_page((long)txb->data);
-		kfree(txb);
-	}
-}
-
 /**************************************************************
   Utility function for the tpm_private structure
  **************************************************************/
@@ -162,15 +104,12 @@ static void tpm_private_put(void)
 	if (!atomic_dec_and_test(&my_priv->refcnt))
 		return;
 
-	tpmif_free_tx_buffers(my_priv);
 	kfree(my_priv);
 	my_priv = NULL;
 }
 
 static struct tpm_private *tpm_private_get(void)
 {
-	int err;
-
 	if (my_priv) {
 		atomic_inc(&my_priv->refcnt);
 		return my_priv;
@@ -181,9 +120,6 @@ static struct tpm_private *tpm_private_get(void)
 		return NULL;
 
 	tpm_private_init(my_priv);
-	err = tpmif_allocate_tx_buffers(my_priv);
-	if (err < 0)
-		tpm_private_put();
 
 	return my_priv;
 }
@@ -218,22 +154,22 @@ int vtpm_vd_send(struct tpm_private *tp,
 static int setup_tpmring(struct xenbus_device *dev,
 		struct tpm_private *tp)
 {
-	struct tpmif_tx_interface *sring;
+	struct vtpm_shared_page *sring;
 	int err;
 
 	tp->ring_ref = GRANT_INVALID_REF;
 
-	sring = (void *)__get_free_page(GFP_KERNEL);
+	sring = (void *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
 	if (!sring) {
 		xenbus_dev_fatal(dev, -ENOMEM, "allocating shared ring");
 		return -ENOMEM;
 	}
-	tp->tx = sring;
+	tp->page = sring;
 
-	err = xenbus_grant_ring(dev, virt_to_mfn(tp->tx));
+	err = xenbus_grant_ring(dev, virt_to_mfn(tp->page));
 	if (err < 0) {
 		free_page((unsigned long)sring);
-		tp->tx = NULL;
+		tp->page = NULL;
 		xenbus_dev_fatal(dev, err, "allocating grant reference");
 		goto fail;
 	}
@@ -256,9 +192,9 @@ static void destroy_tpmring(struct tpm_private *tp)
 
 	if (tp->ring_ref != GRANT_INVALID_REF) {
 		gnttab_end_foreign_access(tp->ring_ref,
-				0, (unsigned long)tp->tx);
+				0, (unsigned long)tp->page);
 		tp->ring_ref = GRANT_INVALID_REF;
-		tp->tx = NULL;
+		tp->page = NULL;
 	}
 
 	if (tp->evtchn)
@@ -470,62 +406,30 @@ static DEFINE_XENBUS_DRIVER(tpmfront, ,
 		.suspend = tpmfront_suspend,
 		);
 
-static int tpmif_allocate_tx_buffers(struct tpm_private *tp)
-{
-	unsigned int i;
-
-	for (i = 0; i < TPMIF_TX_RING_SIZE; i++) {
-		tp->tx_buffers[i] = tx_buffer_alloc();
-		if (!tp->tx_buffers[i]) {
-			tpmif_free_tx_buffers(tp);
-			return -ENOMEM;
-		}
-	}
-	return 0;
-}
-
-static void tpmif_free_tx_buffers(struct tpm_private *tp)
-{
-	unsigned int i;
-
-	for (i = 0; i < TPMIF_TX_RING_SIZE; i++)
-		tx_buffer_free(tp->tx_buffers[i]);
-}
-
 static void tpmif_rx_action(unsigned long priv)
 {
 	struct tpm_private *tp = (struct tpm_private *)priv;
-	int i = 0;
 	unsigned int received;
 	unsigned int offset = 0;
 	u8 *buffer;
-	struct tpmif_tx_request *tx = &tp->tx->ring[i].req;
+	struct vtpm_shared_page *shr = tp->page;
 
 	atomic_set(&tp->tx_busy, 0);
 	wake_up_interruptible(&tp->wait_q);
 
-	received = tx->size;
+	offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+	received = shr->length;
+
+	if (offset > PAGE_SIZE || offset + received > PAGE_SIZE) {
+		printk(KERN_WARNING "tpmif_rx_action packet too large\n");
+		return;
+	}
 
 	buffer = kmalloc(received, GFP_ATOMIC);
 	if (!buffer)
 		return;
 
-	for (i = 0; i < TPMIF_TX_RING_SIZE && offset < received; i++) {
-		struct tx_buffer *txb = tp->tx_buffers[i];
-		struct tpmif_tx_request *tx;
-		unsigned int tocopy;
-
-		tx = &tp->tx->ring[i].req;
-		tocopy = tx->size;
-		if (tocopy > PAGE_SIZE)
-			tocopy = PAGE_SIZE;
-
-		memcpy(&buffer[offset], txb->data, tocopy);
-
-		gnttab_release_grant_reference(&gref_head, tx->ref);
-
-		offset += tocopy;
-	}
+	memcpy(buffer, offset + (u8*)shr, received);
 
 	vtpm_vd_recv(tp->chip, buffer, received, tp->tx_remember);
 	kfree(buffer);
@@ -550,8 +454,7 @@ static int tpm_xmit(struct tpm_private *tp,
 		const u8 *buf, size_t count, int isuserbuffer,
 		void *remember)
 {
-	struct tpmif_tx_request *tx;
-	int i;
+	struct vtpm_shared_page *shr;
 	unsigned int offset = 0;
 
 	spin_lock_irq(&tp->tx_lock);
@@ -566,48 +469,23 @@ static int tpm_xmit(struct tpm_private *tp,
 		return -EIO;
 	}
 
-	for (i = 0; count > 0 && i < TPMIF_TX_RING_SIZE; i++) {
-		struct tx_buffer *txb = tp->tx_buffers[i];
-		int copied;
-
-		if (!txb) {
-			spin_unlock_irq(&tp->tx_lock);
-			return -EFAULT;
-		}
-
-		copied = tx_buffer_copy(txb, &buf[offset], count,
-				isuserbuffer);
-		if (copied < 0) {
-			/* An error occurred */
-			spin_unlock_irq(&tp->tx_lock);
-			return copied;
-		}
-		count -= copied;
-		offset += copied;
-
-		tx = &tp->tx->ring[i].req;
-		tx->addr = virt_to_machine(txb->data).maddr;
-		tx->size = txb->len;
-		tx->unused = 0;
-
-		/* Get the granttable reference for this page. */
-		tx->ref = gnttab_claim_grant_reference(&gref_head);
-		if (tx->ref == -ENOSPC) {
-			spin_unlock_irq(&tp->tx_lock);
-			return -ENOSPC;
-		}
-		gnttab_grant_foreign_access_ref(tx->ref,
-				tp->backend_id,
-				virt_to_mfn(txb->data),
-				0 /*RW*/);
-		wmb();
-	}
+	shr = tp->page;
+	offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+
+	if (offset > PAGE_SIZE)
+		return -EIO;
+
+	if (offset + count > PAGE_SIZE)
+		count = PAGE_SIZE - offset;
+
+	memcpy(offset + (u8*)shr, buf, count);
+	shr->length = count;
+	barrier();
+	shr->state = 1;
 
 	atomic_set(&tp->tx_busy, 1);
 	tp->tx_remember = remember;
 
-	mb();
-
 	notify_remote_via_evtchn(tp->evtchn);
 
 	spin_unlock_irq(&tp->tx_lock);
@@ -667,12 +545,6 @@ static int __init tpmif_init(void)
 	if (!tp)
 		return -ENOMEM;
 
-	if (gnttab_alloc_grant_references(TPMIF_TX_RING_SIZE,
-				&gref_head) < 0) {
-		tpm_private_put();
-		return -EFAULT;
-	}
-
 	return xenbus_register_frontend(&tpmfront_driver);
 }
 module_init(tpmif_init);
@@ -680,7 +552,6 @@ module_init(tpmif_init);
 static void __exit tpmif_exit(void)
 {
 	xenbus_unregister_driver(&tpmfront_driver);
-	gnttab_free_grant_references(gref_head);
 	tpm_private_put();
 }
 module_exit(tpmif_exit);
diff --git a/include/xen/interface/io/tpmif.h b/include/xen/interface/io/tpmif.h
index c9e7294..3d5c743 100644
--- a/include/xen/interface/io/tpmif.h
+++ b/include/xen/interface/io/tpmif.h
@@ -1,7 +1,7 @@
 /******************************************************************************
  * tpmif.h
  *
- * TPM I/O interface for Xen guest OSes.
+ * TPM I/O interface for Xen guest OSes, v2
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -21,45 +21,21 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  *
- * Copyright (c) 2005, IBM Corporation
- *
- * Author: Stefan Berger, stefanb@us.ibm.com
- * Grant table support: Mahadevan Gomathisankaran
- *
- * This code has been derived from tools/libxc/xen/io/netif.h
- *
- * Copyright (c) 2003-2004, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_IO_TPMIF_H__
 #define __XEN_PUBLIC_IO_TPMIF_H__
 
-#include "../grant_table.h"
-
-struct tpmif_tx_request {
-	unsigned long addr;   /* Machine address of packet.   */
-	grant_ref_t ref;      /* grant table access reference */
-	uint16_t unused;
-	uint16_t size;        /* Packet size in bytes.        */
-};
-struct tpmif_tx_request;
+struct vtpm_shared_page {
+	uint16_t length;         /* request/response length in bytes */
 
-/*
- * The TPMIF_TX_RING_SIZE defines the number of pages the
- * front-end and backend can exchange (= size of array).
- */
-#define TPMIF_TX_RING_SIZE 1
-
-/* This structure must fit in a memory page. */
-
-struct tpmif_ring {
-	struct tpmif_tx_request req;
-};
-struct tpmif_ring;
+	uint8_t state;           /* 0 - response ready / idle
+                              * 1 - request ready / working */
+	uint8_t locality;        /* for the current request */
+	uint8_t padding[3];
 
-struct tpmif_tx_interface {
-	struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
+	uint8_t nr_extra_pages;  /* extra pages for long packets; may be zero */
+	uint32_t extra_pages[0]; /* grant IDs; length is actually nr_extra_pages */
 };
-struct tpmif_tx_interface;
 
 #endif
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 18:25:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 18:25:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TasVA-0007sy-B8; Tue, 20 Nov 2012 18:24:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TasV8-0007st-RJ
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 18:24:51 +0000
Received: from [85.158.143.99:55862] by server-2.bemta-4.messagelabs.com id
	3B/F5-28922-1FACBA05; Tue, 20 Nov 2012 18:24:49 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-7.tower-216.messagelabs.com!1353435888!27332284!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31261 invoked from network); 20 Nov 2012 18:24:48 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-7.tower-216.messagelabs.com with SMTP;
	20 Nov 2012 18:24:48 -0000
X-TM-IMSS-Message-ID: <9dbaaf24000c3b89@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 9dbaaf24000c3b89 ;
	Tue, 20 Nov 2012 13:24:09 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAKIOh5R023537; 
	Tue, 20 Nov 2012 13:24:43 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: Matthew.Fioravante@jhuapl.edu
Date: Tue, 20 Nov 2012 13:24:41 -0500
Message-Id: <1353435881-21237-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
References: <068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
Cc: jeremy@goop.org, Ian.Campbell@citrix.com, konrad.wilk@oracle.com,
	xen-devel@lists.xen.org, tpmdd-devel@lists.sourceforge.net,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: [Xen-devel] [PATCH] drivers/tpm-xen: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This changes the vTPM shared page ABI from a copy of the Xen network
interface to a single-page interface that better reflects the expected
behavior of a TPM: only a single request packet can be sent at any given
time, and every packet sent generates a single response packet. This
protocol change should also increase efficiency as it avoids mapping and
unmapping grants when possible.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 drivers/char/tpm/xen-tpmfront_if.c | 191 ++++++-------------------------------
 include/xen/interface/io/tpmif.h   |  42 ++------
 2 files changed, 40 insertions(+), 193 deletions(-)

diff --git a/drivers/char/tpm/xen-tpmfront_if.c b/drivers/char/tpm/xen-tpmfront_if.c
index ba7fad8..02405af 100644
--- a/drivers/char/tpm/xen-tpmfront_if.c
+++ b/drivers/char/tpm/xen-tpmfront_if.c
@@ -53,7 +53,7 @@
 struct tpm_private {
 	struct tpm_chip *chip;
 
-	struct tpmif_tx_interface *tx;
+	struct vtpm_shared_page *page;
 	atomic_t refcnt;
 	unsigned int evtchn;
 	u8 is_connected;
@@ -61,8 +61,6 @@ struct tpm_private {
 
 	spinlock_t tx_lock;
 
-	struct tx_buffer *tx_buffers[TPMIF_TX_RING_SIZE];
-
 	atomic_t tx_busy;
 	void *tx_remember;
 
@@ -73,15 +71,7 @@ struct tpm_private {
 	int ring_ref;
 };
 
-struct tx_buffer {
-	unsigned int size;	/* available space in data */
-	unsigned int len;	/* used space in data */
-	unsigned char *data;	/* pointer to a page */
-};
-
-
 /* locally visible variables */
-static grant_ref_t gref_head;
 static struct tpm_private *my_priv;
 
 /* local function prototypes */
@@ -92,8 +82,6 @@ static int tpmif_connect(struct xenbus_device *dev,
 		struct tpm_private *tp,
 		domid_t domid);
 static DECLARE_TASKLET(tpmif_rx_tasklet, tpmif_rx_action, 0);
-static int tpmif_allocate_tx_buffers(struct tpm_private *tp);
-static void tpmif_free_tx_buffers(struct tpm_private *tp);
 static void tpmif_set_connected_state(struct tpm_private *tp,
 		u8 newstate);
 static int tpm_xmit(struct tpm_private *tp,
@@ -101,52 +89,6 @@ static int tpm_xmit(struct tpm_private *tp,
 		void *remember);
 static void destroy_tpmring(struct tpm_private *tp);
 
-static inline int
-tx_buffer_copy(struct tx_buffer *txb, const u8 *src, int len,
-		int isuserbuffer)
-{
-	int copied = len;
-
-	if (len > txb->size)
-		copied = txb->size;
-	if (isuserbuffer) {
-		if (copy_from_user(txb->data, src, copied))
-			return -EFAULT;
-	} else {
-		memcpy(txb->data, src, copied);
-	}
-	txb->len = len;
-	return copied;
-}
-
-static inline struct tx_buffer *tx_buffer_alloc(void)
-{
-	struct tx_buffer *txb;
-
-	txb = kzalloc(sizeof(struct tx_buffer), GFP_KERNEL);
-	if (!txb)
-		return NULL;
-
-	txb->len = 0;
-	txb->size = PAGE_SIZE;
-	txb->data = (unsigned char *)__get_free_page(GFP_KERNEL);
-	if (txb->data == NULL) {
-		kfree(txb);
-		txb = NULL;
-	}
-
-	return txb;
-}
-
-
-static inline void tx_buffer_free(struct tx_buffer *txb)
-{
-	if (txb) {
-		free_page((long)txb->data);
-		kfree(txb);
-	}
-}
-
 /**************************************************************
   Utility function for the tpm_private structure
  **************************************************************/
@@ -162,15 +104,12 @@ static void tpm_private_put(void)
 	if (!atomic_dec_and_test(&my_priv->refcnt))
 		return;
 
-	tpmif_free_tx_buffers(my_priv);
 	kfree(my_priv);
 	my_priv = NULL;
 }
 
 static struct tpm_private *tpm_private_get(void)
 {
-	int err;
-
 	if (my_priv) {
 		atomic_inc(&my_priv->refcnt);
 		return my_priv;
@@ -181,9 +120,6 @@ static struct tpm_private *tpm_private_get(void)
 		return NULL;
 
 	tpm_private_init(my_priv);
-	err = tpmif_allocate_tx_buffers(my_priv);
-	if (err < 0)
-		tpm_private_put();
 
 	return my_priv;
 }
@@ -218,22 +154,22 @@ int vtpm_vd_send(struct tpm_private *tp,
 static int setup_tpmring(struct xenbus_device *dev,
 		struct tpm_private *tp)
 {
-	struct tpmif_tx_interface *sring;
+	struct vtpm_shared_page *sring;
 	int err;
 
 	tp->ring_ref = GRANT_INVALID_REF;
 
-	sring = (void *)__get_free_page(GFP_KERNEL);
+	sring = (void *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
 	if (!sring) {
 		xenbus_dev_fatal(dev, -ENOMEM, "allocating shared ring");
 		return -ENOMEM;
 	}
-	tp->tx = sring;
+	tp->page = sring;
 
-	err = xenbus_grant_ring(dev, virt_to_mfn(tp->tx));
+	err = xenbus_grant_ring(dev, virt_to_mfn(tp->page));
 	if (err < 0) {
 		free_page((unsigned long)sring);
-		tp->tx = NULL;
+		tp->page = NULL;
 		xenbus_dev_fatal(dev, err, "allocating grant reference");
 		goto fail;
 	}
@@ -256,9 +192,9 @@ static void destroy_tpmring(struct tpm_private *tp)
 
 	if (tp->ring_ref != GRANT_INVALID_REF) {
 		gnttab_end_foreign_access(tp->ring_ref,
-				0, (unsigned long)tp->tx);
+				0, (unsigned long)tp->page);
 		tp->ring_ref = GRANT_INVALID_REF;
-		tp->tx = NULL;
+		tp->page = NULL;
 	}
 
 	if (tp->evtchn)
@@ -470,62 +406,30 @@ static DEFINE_XENBUS_DRIVER(tpmfront, ,
 		.suspend = tpmfront_suspend,
 		);
 
-static int tpmif_allocate_tx_buffers(struct tpm_private *tp)
-{
-	unsigned int i;
-
-	for (i = 0; i < TPMIF_TX_RING_SIZE; i++) {
-		tp->tx_buffers[i] = tx_buffer_alloc();
-		if (!tp->tx_buffers[i]) {
-			tpmif_free_tx_buffers(tp);
-			return -ENOMEM;
-		}
-	}
-	return 0;
-}
-
-static void tpmif_free_tx_buffers(struct tpm_private *tp)
-{
-	unsigned int i;
-
-	for (i = 0; i < TPMIF_TX_RING_SIZE; i++)
-		tx_buffer_free(tp->tx_buffers[i]);
-}
-
 static void tpmif_rx_action(unsigned long priv)
 {
 	struct tpm_private *tp = (struct tpm_private *)priv;
-	int i = 0;
 	unsigned int received;
 	unsigned int offset = 0;
 	u8 *buffer;
-	struct tpmif_tx_request *tx = &tp->tx->ring[i].req;
+	struct vtpm_shared_page *shr = tp->page;
 
 	atomic_set(&tp->tx_busy, 0);
 	wake_up_interruptible(&tp->wait_q);
 
-	received = tx->size;
+	offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+	received = shr->length;
+
+	if (offset > PAGE_SIZE || offset + received > PAGE_SIZE) {
+		printk(KERN_WARNING "tpmif_rx_action packet too large\n");
+		return;
+	}
 
 	buffer = kmalloc(received, GFP_ATOMIC);
 	if (!buffer)
 		return;
 
-	for (i = 0; i < TPMIF_TX_RING_SIZE && offset < received; i++) {
-		struct tx_buffer *txb = tp->tx_buffers[i];
-		struct tpmif_tx_request *tx;
-		unsigned int tocopy;
-
-		tx = &tp->tx->ring[i].req;
-		tocopy = tx->size;
-		if (tocopy > PAGE_SIZE)
-			tocopy = PAGE_SIZE;
-
-		memcpy(&buffer[offset], txb->data, tocopy);
-
-		gnttab_release_grant_reference(&gref_head, tx->ref);
-
-		offset += tocopy;
-	}
+	memcpy(buffer, offset + (u8*)shr, received);
 
 	vtpm_vd_recv(tp->chip, buffer, received, tp->tx_remember);
 	kfree(buffer);
@@ -550,8 +454,7 @@ static int tpm_xmit(struct tpm_private *tp,
 		const u8 *buf, size_t count, int isuserbuffer,
 		void *remember)
 {
-	struct tpmif_tx_request *tx;
-	int i;
+	struct vtpm_shared_page *shr;
 	unsigned int offset = 0;
 
 	spin_lock_irq(&tp->tx_lock);
@@ -566,48 +469,23 @@ static int tpm_xmit(struct tpm_private *tp,
 		return -EIO;
 	}
 
-	for (i = 0; count > 0 && i < TPMIF_TX_RING_SIZE; i++) {
-		struct tx_buffer *txb = tp->tx_buffers[i];
-		int copied;
-
-		if (!txb) {
-			spin_unlock_irq(&tp->tx_lock);
-			return -EFAULT;
-		}
-
-		copied = tx_buffer_copy(txb, &buf[offset], count,
-				isuserbuffer);
-		if (copied < 0) {
-			/* An error occurred */
-			spin_unlock_irq(&tp->tx_lock);
-			return copied;
-		}
-		count -= copied;
-		offset += copied;
-
-		tx = &tp->tx->ring[i].req;
-		tx->addr = virt_to_machine(txb->data).maddr;
-		tx->size = txb->len;
-		tx->unused = 0;
-
-		/* Get the granttable reference for this page. */
-		tx->ref = gnttab_claim_grant_reference(&gref_head);
-		if (tx->ref == -ENOSPC) {
-			spin_unlock_irq(&tp->tx_lock);
-			return -ENOSPC;
-		}
-		gnttab_grant_foreign_access_ref(tx->ref,
-				tp->backend_id,
-				virt_to_mfn(txb->data),
-				0 /*RW*/);
-		wmb();
-	}
+	shr = tp->page;
+	offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+
+	if (offset > PAGE_SIZE)
+		return -EIO;
+
+	if (offset + count > PAGE_SIZE)
+		count = PAGE_SIZE - offset;
+
+	memcpy(offset + (u8*)shr, buf, count);
+	shr->length = count;
+	barrier();
+	shr->state = 1;
 
 	atomic_set(&tp->tx_busy, 1);
 	tp->tx_remember = remember;
 
-	mb();
-
 	notify_remote_via_evtchn(tp->evtchn);
 
 	spin_unlock_irq(&tp->tx_lock);
@@ -667,12 +545,6 @@ static int __init tpmif_init(void)
 	if (!tp)
 		return -ENOMEM;
 
-	if (gnttab_alloc_grant_references(TPMIF_TX_RING_SIZE,
-				&gref_head) < 0) {
-		tpm_private_put();
-		return -EFAULT;
-	}
-
 	return xenbus_register_frontend(&tpmfront_driver);
 }
 module_init(tpmif_init);
@@ -680,7 +552,6 @@ module_init(tpmif_init);
 static void __exit tpmif_exit(void)
 {
 	xenbus_unregister_driver(&tpmfront_driver);
-	gnttab_free_grant_references(gref_head);
 	tpm_private_put();
 }
 module_exit(tpmif_exit);
diff --git a/include/xen/interface/io/tpmif.h b/include/xen/interface/io/tpmif.h
index c9e7294..3d5c743 100644
--- a/include/xen/interface/io/tpmif.h
+++ b/include/xen/interface/io/tpmif.h
@@ -1,7 +1,7 @@
 /******************************************************************************
  * tpmif.h
  *
- * TPM I/O interface for Xen guest OSes.
+ * TPM I/O interface for Xen guest OSes, v2
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -21,45 +21,21 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  *
- * Copyright (c) 2005, IBM Corporation
- *
- * Author: Stefan Berger, stefanb@us.ibm.com
- * Grant table support: Mahadevan Gomathisankaran
- *
- * This code has been derived from tools/libxc/xen/io/netif.h
- *
- * Copyright (c) 2003-2004, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_IO_TPMIF_H__
 #define __XEN_PUBLIC_IO_TPMIF_H__
 
-#include "../grant_table.h"
-
-struct tpmif_tx_request {
-	unsigned long addr;   /* Machine address of packet.   */
-	grant_ref_t ref;      /* grant table access reference */
-	uint16_t unused;
-	uint16_t size;        /* Packet size in bytes.        */
-};
-struct tpmif_tx_request;
+struct vtpm_shared_page {
+	uint16_t length;         /* request/response length in bytes */
 
-/*
- * The TPMIF_TX_RING_SIZE defines the number of pages the
- * front-end and backend can exchange (= size of array).
- */
-#define TPMIF_TX_RING_SIZE 1
-
-/* This structure must fit in a memory page. */
-
-struct tpmif_ring {
-	struct tpmif_tx_request req;
-};
-struct tpmif_ring;
+	uint8_t state;           /* 0 - response ready / idle
+                              * 1 - request ready / working */
+	uint8_t locality;        /* for the current request */
+	uint8_t padding[3];
 
-struct tpmif_tx_interface {
-	struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
+	uint8_t nr_extra_pages;  /* extra pages for long packets; may be zero */
+	uint32_t extra_pages[0]; /* grant IDs; length is actually nr_extra_pages */
 };
-struct tpmif_tx_interface;
 
 #endif
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 18:40:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 18:40:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tasjp-0008CI-0a; Tue, 20 Nov 2012 18:40:01 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1Tasjo-0008CD-9c
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 18:40:00 +0000
Received: from [193.109.254.147:40998] by server-5.bemta-14.messagelabs.com id
	84/20-10257-F7ECBA05; Tue, 20 Nov 2012 18:39:59 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353436798!11708113!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0NjMwMQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31683 invoked from network); 20 Nov 2012 18:39:58 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-3.tower-27.messagelabs.com with SMTP;
	20 Nov 2012 18:39:58 -0000
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
	by fmsmga101.fm.intel.com with ESMTP; 20 Nov 2012 10:39:47 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,287,1352102400"; d="scan'208";a="251990584"
Received: from fmsmsx107.amr.corp.intel.com ([10.19.9.54])
	by fmsmga002.fm.intel.com with ESMTP; 20 Nov 2012 10:39:23 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX107.amr.corp.intel.com (10.19.9.54) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 10:39:22 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 02:39:21 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNx0vcWSR52N+j5UqhK6CjagaIUZfzCmgw
Date: Tue, 20 Nov 2012 18:39:20 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
In-Reply-To: <20651.51754.974511.264479@mariner.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Jackson wrote:
> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
> broken page with regard to migration"): 
>> No, at last lter, there are 4 points:
>> 1. start last iter
>> 2. get and transfer pfn_type to target
>> 3. copy page to target
>> 4. end last iter
>> 
>> this code monitor whether it has a vmce occur at area from point 2
>> to point 4 (we don't care vmce occur at last iter but before point2) 
> 
> The migration code is rather tangled but perhaps it would be best to
> check for mce after step 3 for each page, and keep a separate list of
> the pages which broke in that pass ?
> 
> Ian.

It indeed checks mce after point 3 for each page, but what's the advantage of keeping a separate list?

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 18:40:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 18:40:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tasjp-0008CI-0a; Tue, 20 Nov 2012 18:40:01 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1Tasjo-0008CD-9c
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 18:40:00 +0000
Received: from [193.109.254.147:40998] by server-5.bemta-14.messagelabs.com id
	84/20-10257-F7ECBA05; Tue, 20 Nov 2012 18:39:59 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353436798!11708113!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0NjMwMQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31683 invoked from network); 20 Nov 2012 18:39:58 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-3.tower-27.messagelabs.com with SMTP;
	20 Nov 2012 18:39:58 -0000
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
	by fmsmga101.fm.intel.com with ESMTP; 20 Nov 2012 10:39:47 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,287,1352102400"; d="scan'208";a="251990584"
Received: from fmsmsx107.amr.corp.intel.com ([10.19.9.54])
	by fmsmga002.fm.intel.com with ESMTP; 20 Nov 2012 10:39:23 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX107.amr.corp.intel.com (10.19.9.54) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 10:39:22 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 02:39:21 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNx0vcWSR52N+j5UqhK6CjagaIUZfzCmgw
Date: Tue, 20 Nov 2012 18:39:20 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
In-Reply-To: <20651.51754.974511.264479@mariner.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Jackson wrote:
> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
> broken page with regard to migration"): 
>> No, at last lter, there are 4 points:
>> 1. start last iter
>> 2. get and transfer pfn_type to target
>> 3. copy page to target
>> 4. end last iter
>> 
>> this code monitor whether it has a vmce occur at area from point 2
>> to point 4 (we don't care vmce occur at last iter but before point2) 
> 
> The migration code is rather tangled but perhaps it would be best to
> check for mce after step 3 for each page, and keep a separate list of
> the pages which broke in that pass ?
> 
> Ian.

It indeed checks mce after point 3 for each page, but what's the advantage of keeping a separate list?

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 18:42:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 18:42:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TasmC-0008MH-Hy; Tue, 20 Nov 2012 18:42:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TasmA-0008M8-SG
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 18:42:27 +0000
Received: from [85.158.143.35:4790] by server-1.bemta-4.messagelabs.com id
	AB/7F-27934-01FCBA05; Tue, 20 Nov 2012 18:42:24 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1353436935!6262764!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21126 invoked from network); 20 Nov 2012 18:42:15 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 18:42:15 -0000
X-IronPort-AV: E=Sophos;i="4.83,287,1352073600"; d="scan'208";a="15912851"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 18:42:15 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 20 Nov 2012 18:42:15 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Taslz-0001lO-4Z; Tue, 20 Nov 2012 18:42:15 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Taslz-0002Fv-0P;
	Tue, 20 Nov 2012 18:42:15 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20651.52995.774236.722303@mariner.uk.xensource.com>
Date: Tue, 20 Nov 2012 18:42:11 +0000
To: "Liu, Jinsong" <jinsong.liu@intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard to migration"):
> Ian Jackson wrote:
> > Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
> > broken page with regard to migration"): 
> >> No, at last lter, there are 4 points:
> >> 1. start last iter
> >> 2. get and transfer pfn_type to target
> >> 3. copy page to target
> >> 4. end last iter
...
> It indeed checks mce after point 3 for each page, but what's the
> advantage of keeping a separate list?

It avoids yet another loop over all the pages.  Unless I have
misunderstood.  Which I may have, because: if it checks for mce after
point 3 then surely that is sufficient ?  We don't need to worry about
mces after that check.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 18:42:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 18:42:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TasmC-0008MH-Hy; Tue, 20 Nov 2012 18:42:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TasmA-0008M8-SG
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 18:42:27 +0000
Received: from [85.158.143.35:4790] by server-1.bemta-4.messagelabs.com id
	AB/7F-27934-01FCBA05; Tue, 20 Nov 2012 18:42:24 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1353436935!6262764!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21126 invoked from network); 20 Nov 2012 18:42:15 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 18:42:15 -0000
X-IronPort-AV: E=Sophos;i="4.83,287,1352073600"; d="scan'208";a="15912851"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 18:42:15 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 20 Nov 2012 18:42:15 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Taslz-0001lO-4Z; Tue, 20 Nov 2012 18:42:15 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Taslz-0002Fv-0P;
	Tue, 20 Nov 2012 18:42:15 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20651.52995.774236.722303@mariner.uk.xensource.com>
Date: Tue, 20 Nov 2012 18:42:11 +0000
To: "Liu, Jinsong" <jinsong.liu@intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard to migration"):
> Ian Jackson wrote:
> > Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
> > broken page with regard to migration"): 
> >> No, at last lter, there are 4 points:
> >> 1. start last iter
> >> 2. get and transfer pfn_type to target
> >> 3. copy page to target
> >> 4. end last iter
...
> It indeed checks mce after point 3 for each page, but what's the
> advantage of keeping a separate list?

It avoids yet another loop over all the pages.  Unless I have
misunderstood.  Which I may have, because: if it checks for mce after
point 3 then surely that is sufficient ?  We don't need to worry about
mces after that check.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 18:54:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 18:54:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TasxY-0000Bv-PL; Tue, 20 Nov 2012 18:54:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TasxW-0000Bn-VD
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 18:54:11 +0000
Received: from [85.158.143.35:62741] by server-2.bemta-4.messagelabs.com id
	9B/A7-28922-2D1DBA05; Tue, 20 Nov 2012 18:54:10 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1353437645!10602110!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjMyNDg4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8309 invoked from network); 20 Nov 2012 18:54:06 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-10.tower-21.messagelabs.com with SMTP;
	20 Nov 2012 18:54:06 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga102.ch.intel.com with ESMTP; 20 Nov 2012 10:54:04 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,287,1352102400"; d="scan'208";a="170668948"
Received: from fmsmsx107.amr.corp.intel.com ([10.19.9.54])
	by AZSMGA002.ch.intel.com with ESMTP; 20 Nov 2012 10:54:03 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX107.amr.corp.intel.com (10.19.9.54) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 10:54:03 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 02:54:01 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>, Ian Campbell
	<Ian.Campbell@citrix.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard	to migration
Thread-Index: AQHNxzLagIBs/Elka0CkW2KriS9nNJfy8CzggAAF17A=
Date: Tue, 20 Nov 2012 18:54:00 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233539385B@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
	<1353344256.18229.129.camel@zakaz.uk.xensource.com>
	<50AB9CFE.7000003@eu.citrix.com>
	<DE8DF0795D48FD4CA783C40EC8292335393633@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC8292335393633@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Well, let me elaborate more my thought about broken page occur at last iter:

Theoretically we can separate 'broken page at last iter' into several sub-cases, and optimize case by case:
1. if the page (which will break at last iter) is not on dirty bitmap (of last iter) --> do nothing is OK, target will happily run w/o broken page;
2. if the page (which will break at last iter) is on dirty bitmap (of last iter)
  2.1 if at last iter, vmce occur after page copy --> do nothing is OK, target happily run w/o broken page;
  2.2 if vmce occur beofre pfn_type transfer --> do nothing is OK, V2 patch has correctly handle the case, target will set p2m broken correctly;
  2.3 if vmce occur after pfn_type transfer and before copy page to target --> we need handle this case;

Practically considering it's rare enough, and code complication, we handle it in a simple way (not so optimized but enough for real life):
- we don't distinguish if the page is in dirty bitmap of last iter;
- we don't prefer adding new hypercall for this corner case, instead we'd like to re-use currently existed hypercall;
- if vmce occur at last iter, we do 1~2 more iter.
This is what V3 patch does now.

Thoughts?

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 18:54:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 18:54:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TasxY-0000Bv-PL; Tue, 20 Nov 2012 18:54:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TasxW-0000Bn-VD
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 18:54:11 +0000
Received: from [85.158.143.35:62741] by server-2.bemta-4.messagelabs.com id
	9B/A7-28922-2D1DBA05; Tue, 20 Nov 2012 18:54:10 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1353437645!10602110!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjMyNDg4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8309 invoked from network); 20 Nov 2012 18:54:06 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-10.tower-21.messagelabs.com with SMTP;
	20 Nov 2012 18:54:06 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga102.ch.intel.com with ESMTP; 20 Nov 2012 10:54:04 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,287,1352102400"; d="scan'208";a="170668948"
Received: from fmsmsx107.amr.corp.intel.com ([10.19.9.54])
	by AZSMGA002.ch.intel.com with ESMTP; 20 Nov 2012 10:54:03 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX107.amr.corp.intel.com (10.19.9.54) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 10:54:03 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 02:54:01 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>, Ian Campbell
	<Ian.Campbell@citrix.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard	to migration
Thread-Index: AQHNxzLagIBs/Elka0CkW2KriS9nNJfy8CzggAAF17A=
Date: Tue, 20 Nov 2012 18:54:00 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233539385B@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
	<1353344256.18229.129.camel@zakaz.uk.xensource.com>
	<50AB9CFE.7000003@eu.citrix.com>
	<DE8DF0795D48FD4CA783C40EC8292335393633@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC8292335393633@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard	to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Well, let me elaborate more my thought about broken page occur at last iter:

Theoretically we can separate 'broken page at last iter' into several sub-cases, and optimize case by case:
1. if the page (which will break at last iter) is not on dirty bitmap (of last iter) --> do nothing is OK, target will happily run w/o broken page;
2. if the page (which will break at last iter) is on dirty bitmap (of last iter)
  2.1 if at last iter, vmce occur after page copy --> do nothing is OK, target happily run w/o broken page;
  2.2 if vmce occur beofre pfn_type transfer --> do nothing is OK, V2 patch has correctly handle the case, target will set p2m broken correctly;
  2.3 if vmce occur after pfn_type transfer and before copy page to target --> we need handle this case;

Practically considering it's rare enough, and code complication, we handle it in a simple way (not so optimized but enough for real life):
- we don't distinguish if the page is in dirty bitmap of last iter;
- we don't prefer adding new hypercall for this corner case, instead we'd like to re-use currently existed hypercall;
- if vmce occur at last iter, we do 1~2 more iter.
This is what V3 patch does now.

Thoughts?

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 19:08:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 19:08:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TatAj-0000SM-44; Tue, 20 Nov 2012 19:07:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TatAh-0000SE-2k
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 19:07:47 +0000
Received: from [85.158.143.35:46597] by server-2.bemta-4.messagelabs.com id
	D5/51-28922-205DBA05; Tue, 20 Nov 2012 19:07:46 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1353438462!13806030!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4MzUxOA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5573 invoked from network); 20 Nov 2012 19:07:43 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-16.tower-21.messagelabs.com with SMTP;
	20 Nov 2012 19:07:43 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 20 Nov 2012 11:07:35 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,287,1352102400"; d="scan'208";a="250134595"
Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35])
	by fmsmga001.fm.intel.com with ESMTP; 20 Nov 2012 11:07:34 -0800
Received: from FMSMSX110.amr.corp.intel.com (10.19.9.29) by
	FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 11:07:34 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	fmsmsx110.amr.corp.intel.com (10.19.9.29) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 11:07:34 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 03:07:32 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNx0vcWSR52N+j5UqhK6CjagaIUZfzCmgw//9+ZICAAItcAA==
Date: Tue, 20 Nov 2012 19:07:32 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233539387B@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
In-Reply-To: <20651.52995.774236.722303@mariner.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Jackson wrote:
> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
> broken page with regard to migration"): 
>> Ian Jackson wrote:
>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>> broken page with regard to migration"):
>>>> No, at last lter, there are 4 points:
>>>> 1. start last iter
>>>> 2. get and transfer pfn_type to target
>>>> 3. copy page to target
>>>> 4. end last iter
> ...
>> It indeed checks mce after point 3 for each page, but what's the
>> advantage of keeping a separate list?
> 
> It avoids yet another loop over all the pages.  Unless I have
> misunderstood.  Which I may have, because: if it checks for mce after
> point 3 then surely that is sufficient ?  We don't need to worry about
> mces after that check.
> 
> Ian.

In fact it will only do 1~2 more iter (if vmce occur at last iter), with exactly 1 more page (the broken page) -- vm frozen under this case, right?
As for the case vmce occur after our check, target will be very happy (and lucky) run the vm w/o broken page.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 19:08:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 19:08:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TatAj-0000SM-44; Tue, 20 Nov 2012 19:07:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TatAh-0000SE-2k
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 19:07:47 +0000
Received: from [85.158.143.35:46597] by server-2.bemta-4.messagelabs.com id
	D5/51-28922-205DBA05; Tue, 20 Nov 2012 19:07:46 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1353438462!13806030!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4MzUxOA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5573 invoked from network); 20 Nov 2012 19:07:43 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-16.tower-21.messagelabs.com with SMTP;
	20 Nov 2012 19:07:43 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 20 Nov 2012 11:07:35 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,287,1352102400"; d="scan'208";a="250134595"
Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35])
	by fmsmga001.fm.intel.com with ESMTP; 20 Nov 2012 11:07:34 -0800
Received: from FMSMSX110.amr.corp.intel.com (10.19.9.29) by
	FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 11:07:34 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	fmsmsx110.amr.corp.intel.com (10.19.9.29) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Tue, 20 Nov 2012 11:07:34 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 03:07:32 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNx0vcWSR52N+j5UqhK6CjagaIUZfzCmgw//9+ZICAAItcAA==
Date: Tue, 20 Nov 2012 19:07:32 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233539387B@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
In-Reply-To: <20651.52995.774236.722303@mariner.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Jackson wrote:
> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
> broken page with regard to migration"): 
>> Ian Jackson wrote:
>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>> broken page with regard to migration"):
>>>> No, at last lter, there are 4 points:
>>>> 1. start last iter
>>>> 2. get and transfer pfn_type to target
>>>> 3. copy page to target
>>>> 4. end last iter
> ...
>> It indeed checks mce after point 3 for each page, but what's the
>> advantage of keeping a separate list?
> 
> It avoids yet another loop over all the pages.  Unless I have
> misunderstood.  Which I may have, because: if it checks for mce after
> point 3 then surely that is sufficient ?  We don't need to worry about
> mces after that check.
> 
> Ian.

In fact it will only do 1~2 more iter (if vmce occur at last iter), with exactly 1 more page (the broken page) -- vm frozen under this case, right?
As for the case vmce occur after our check, target will be very happy (and lucky) run the vm w/o broken page.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 20:59:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 20:59:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tautp-0001lu-Hd; Tue, 20 Nov 2012 20:58:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Tauto-0001lp-3j
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 20:58:28 +0000
Received: from [85.158.143.99:32130] by server-1.bemta-4.messagelabs.com id
	C4/48-27934-3FEEBA05; Tue, 20 Nov 2012 20:58:27 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1353445106!30745910!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3230 invoked from network); 20 Nov 2012 20:58:26 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 20:58:26 -0000
X-IronPort-AV: E=Sophos;i="4.83,287,1352073600"; d="scan'208";a="15914319"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 20:58:19 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 20 Nov 2012 20:58:19 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1Tautf-0002b4-F0;
	Tue, 20 Nov 2012 20:58:19 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1Tautf-0005Uu-E4;
	Tue, 20 Nov 2012 20:58:19 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14449-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 20 Nov 2012 20:58:19 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14449: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14449 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14449/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-pv          10 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-xend-winxpsp3  8 guest-saverestore        fail REGR. vs. 14416
 test-amd64-i386-pair   17 guest-migrate/src_host/dst_host fail REGR. vs. 14416
 test-amd64-i386-win           8 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-pv           10 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-win-vcpus1    8 guest-saverestore         fail REGR. vs. 14416
 test-amd64-amd64-pair  17 guest-migrate/src_host/dst_host fail REGR. vs. 14416
 test-amd64-amd64-win          8 guest-saverestore         fail REGR. vs. 14416

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14416
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14416
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14416
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14416

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  ae6fb202b233
baseline version:
 xen                  321f8487379b

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Wei Wang <wei.wang2@amd.com>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        fail    
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          fail    
 test-amd64-i386-pv                                           fail    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26179:ae6fb202b233
tag:         tip
user:        Jan Beulich <jbeulich@suse.com>
date:        Tue Nov 20 08:58:31 2012 +0100
    
    passthrough/PCI: replace improper uses of pci_find_next_cap()
    
    Using pci_find_next_cap() without prior pci_find_cap_offset() is bogus
    (and possibly wrong, given that the latter doesn't check the
    PCI_STATUS_CAP_LIST flag, which so far was checked in an open-coded way
    only for the non-bridge case).
    
    Once at it, fold the two calls into one, as we need its result in any
    case.
    
    Question is whether, without any caller left, pci_find_next_cap()
    should be purged as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>
    
    
changeset:   26178:02b9d9a25fee
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 19:56:56 2012 +0000
    
    xen: fix build failure due to extra closing comment
    
    Added by 26173:26facad2f1a1
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26177:fe8034159ac2
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:35 2012 +0000
    
    docs: Include prototype for HYPERVISOR_multicall
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26176:edad24bfa561
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:34 2012 +0000
    
    docs: Document HYPERVISOR_update_descriptor
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26175:b1d36147ac96
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Add ToC entry for start of day memory layout.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26174:dbb8d24bb5ad
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Document HYPERVISOR_mmuext_op
    
    Mark-up for inclusion of generated docs.
    
    Remove some trailing whitespace.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26173:26facad2f1a1
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:32 2012 +0000
    
    docs: document HYPERVISOR_update_va_mapping(_other_domain)
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26172:cfd2772cc717
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:31 2012 +0000
    
    docs: document/mark-up SCHEDOP_*
    
    The biggest subtlety here is there additional argument when op ==
    SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
    xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
    
    This patch moves some structs around but there is no functional change
    other than improved documentation.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26171:31668da0c4d3
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 15:15:12 2012 +0100
    
    AMD IOMMU: fix type of "bdf" parameter of update_intremap_entry_from_msi_msg()
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26170:380ad94f2adc
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:51 2012 +0000
    
    Remove tools/vtpm* from MAINTAINERS file
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26169:5a6225e40388
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:50 2012 +0000
    
    tools: Remove old vtpm stuff from tools/libxen
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26168:3dc18d679d04
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:49 2012 +0000
    
    Remove VTPM_TOOLS from config/Tools.mk.in
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26167:31dcc0e08754
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    xend: Remove old vtpm support from xm
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26166:d026f8abca51
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    minios: Update mini-os license to support GPL features
    
    This patch updates extras/mini-os/COPYING to explain
    which optional features are GPL and what the implications
    of enabling them are.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26165:42a7c393c390
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:47 2012 +0000
    
    minios: fix bug in lseek for mini-os
    
    lseek always used files[fd].file.offset. It should
    use the offset of whatever union member is actually
    being used.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26164:17539cec2b9d
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: get the number of cpus from device tree
    
    The system might have fewer cpus than the GIC supports.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26163:ddb109120dbd
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: flush D-cache and I-cache when appropriate
    
    - invalidate tlb after setting WXN
    - flush D-cache and I-cache after relocation;
    - invalidate D-cache after writing to smp_up_cpu;
    - flush I-cache after changing HTTBR;
    - flush I-cache and branch predictor after writing Xen text ptes.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26162:9da9781cc3fb
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 09:48:22 2012 +0100
    
    vscsiif: minor cleanup
    
    Remove a definition not belonging into the interface, and correct a
    few typos in comments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26161:9025a10c0561
user:        Wei Wang <wei.wang2@amd.com>
date:        Mon Nov 19 09:46:46 2012 +0100
    
    AMD IOMMU: Enable HPET broadcast msi remapping
    
    This patch enables hpet msi remapping for amd iommu.
    
    Signed-off-by: Wei Wang <wei.wang2@amd.com>
    
    - use the existing ACPI_IVHD_* #define-s
    - warn on finding more than one IVHD HPET entry
    - consolidate parameters of update_intremap_entry_from_msi_msg()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Committed-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26160:321f8487379b
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:29 2012 +0000
    
    xen/arm: wake up secondary cpus
    
    Secondary cpus are held by the firmware until we send an IPI to them.
    
    Reordered non-boot cpu wait loop to perform the check before waiting
    for an event, to handled the case where the event has already
    happened when we reach the loop.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 20:59:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 20:59:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tautp-0001lu-Hd; Tue, 20 Nov 2012 20:58:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Tauto-0001lp-3j
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 20:58:28 +0000
Received: from [85.158.143.99:32130] by server-1.bemta-4.messagelabs.com id
	C4/48-27934-3FEEBA05; Tue, 20 Nov 2012 20:58:27 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1353445106!30745910!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3230 invoked from network); 20 Nov 2012 20:58:26 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 20:58:26 -0000
X-IronPort-AV: E=Sophos;i="4.83,287,1352073600"; d="scan'208";a="15914319"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 20:58:19 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 20 Nov 2012 20:58:19 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1Tautf-0002b4-F0;
	Tue, 20 Nov 2012 20:58:19 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1Tautf-0005Uu-E4;
	Tue, 20 Nov 2012 20:58:19 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14449-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 20 Nov 2012 20:58:19 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14449: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14449 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14449/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-pv          10 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-xend-winxpsp3  8 guest-saverestore        fail REGR. vs. 14416
 test-amd64-i386-pair   17 guest-migrate/src_host/dst_host fail REGR. vs. 14416
 test-amd64-i386-win           8 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-pv           10 guest-saverestore         fail REGR. vs. 14416
 test-amd64-i386-win-vcpus1    8 guest-saverestore         fail REGR. vs. 14416
 test-amd64-amd64-pair  17 guest-migrate/src_host/dst_host fail REGR. vs. 14416
 test-amd64-amd64-win          8 guest-saverestore         fail REGR. vs. 14416

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14416
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14416
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14416
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14416

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass

version targeted for testing:
 xen                  ae6fb202b233
baseline version:
 xen                  321f8487379b

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Wei Wang <wei.wang2@amd.com>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        fail    
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          fail    
 test-amd64-i386-pv                                           fail    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26179:ae6fb202b233
tag:         tip
user:        Jan Beulich <jbeulich@suse.com>
date:        Tue Nov 20 08:58:31 2012 +0100
    
    passthrough/PCI: replace improper uses of pci_find_next_cap()
    
    Using pci_find_next_cap() without prior pci_find_cap_offset() is bogus
    (and possibly wrong, given that the latter doesn't check the
    PCI_STATUS_CAP_LIST flag, which so far was checked in an open-coded way
    only for the non-bridge case).
    
    Once at it, fold the two calls into one, as we need its result in any
    case.
    
    Question is whether, without any caller left, pci_find_next_cap()
    should be purged as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>
    
    
changeset:   26178:02b9d9a25fee
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 19:56:56 2012 +0000
    
    xen: fix build failure due to extra closing comment
    
    Added by 26173:26facad2f1a1
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26177:fe8034159ac2
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:35 2012 +0000
    
    docs: Include prototype for HYPERVISOR_multicall
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26176:edad24bfa561
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:34 2012 +0000
    
    docs: Document HYPERVISOR_update_descriptor
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26175:b1d36147ac96
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Add ToC entry for start of day memory layout.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26174:dbb8d24bb5ad
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:33 2012 +0000
    
    docs: Document HYPERVISOR_mmuext_op
    
    Mark-up for inclusion of generated docs.
    
    Remove some trailing whitespace.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26173:26facad2f1a1
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:32 2012 +0000
    
    docs: document HYPERVISOR_update_va_mapping(_other_domain)
    
    Mark-up for inclusion of generated docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26172:cfd2772cc717
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Mon Nov 19 14:25:31 2012 +0000
    
    docs: document/mark-up SCHEDOP_*
    
    The biggest subtlety here is there additional argument when op ==
    SCHEDOP_shutdown and reason == SHUTDOWN_suspend and its interpretation by
    xc_domain_{save,restore}. Add some clarifying comments to libxc as well.
    
    This patch moves some structs around but there is no functional change
    other than improved documentation.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26171:31668da0c4d3
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 15:15:12 2012 +0100
    
    AMD IOMMU: fix type of "bdf" parameter of update_intremap_entry_from_msi_msg()
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26170:380ad94f2adc
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:51 2012 +0000
    
    Remove tools/vtpm* from MAINTAINERS file
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26169:5a6225e40388
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:50 2012 +0000
    
    tools: Remove old vtpm stuff from tools/libxen
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26168:3dc18d679d04
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:49 2012 +0000
    
    Remove VTPM_TOOLS from config/Tools.mk.in
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26167:31dcc0e08754
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    xend: Remove old vtpm support from xm
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26166:d026f8abca51
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:48 2012 +0000
    
    minios: Update mini-os license to support GPL features
    
    This patch updates extras/mini-os/COPYING to explain
    which optional features are GPL and what the implications
    of enabling them are.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26165:42a7c393c390
user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
date:        Mon Nov 19 12:59:47 2012 +0000
    
    minios: fix bug in lseek for mini-os
    
    lseek always used files[fd].file.offset. It should
    use the offset of whatever union member is actually
    being used.
    
    Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26164:17539cec2b9d
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: get the number of cpus from device tree
    
    The system might have fewer cpus than the GIC supports.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26163:ddb109120dbd
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Mon Nov 19 12:59:46 2012 +0000
    
    xen/arm: flush D-cache and I-cache when appropriate
    
    - invalidate tlb after setting WXN
    - flush D-cache and I-cache after relocation;
    - invalidate D-cache after writing to smp_up_cpu;
    - flush I-cache after changing HTTBR;
    - flush I-cache and branch predictor after writing Xen text ptes.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26162:9da9781cc3fb
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 19 09:48:22 2012 +0100
    
    vscsiif: minor cleanup
    
    Remove a definition not belonging into the interface, and correct a
    few typos in comments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26161:9025a10c0561
user:        Wei Wang <wei.wang2@amd.com>
date:        Mon Nov 19 09:46:46 2012 +0100
    
    AMD IOMMU: Enable HPET broadcast msi remapping
    
    This patch enables hpet msi remapping for amd iommu.
    
    Signed-off-by: Wei Wang <wei.wang2@amd.com>
    
    - use the existing ACPI_IVHD_* #define-s
    - warn on finding more than one IVHD HPET entry
    - consolidate parameters of update_intremap_entry_from_msi_msg()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Committed-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26160:321f8487379b
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 15 10:25:29 2012 +0000
    
    xen/arm: wake up secondary cpus
    
    Secondary cpus are held by the firmware until we send an IPI to them.
    
    Reordered non-boot cpu wait loop to perform the check before waiting
    for an event, to handled the case where the event has already
    happened when we reach the loop.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 21:29:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 21:29:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TavNI-0002cS-NP; Tue, 20 Nov 2012 21:28:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TavNH-0002cM-MX
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 21:28:55 +0000
Received: from [85.158.143.35:55412] by server-1.bemta-4.messagelabs.com id
	82/1B-27934-616FBA05; Tue, 20 Nov 2012 21:28:54 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1353446932!17901466!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2356 invoked from network); 20 Nov 2012 21:28:53 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-13.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 21:28:53 -0000
X-IronPort-AV: E=Sophos;i="4.83,287,1352073600"; d="scan'208";a="15914629"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 21:28:33 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 20 Nov 2012 21:28:33 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TavMv-0002pU-4W;
	Tue, 20 Nov 2012 21:28:33 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TavMv-0001pd-4A;
	Tue, 20 Nov 2012 21:28:33 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <E1TavMv-0001pd-4A@woking.cam.xci-test.com>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 20 Nov 2012 21:28:33 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com, keir@xen.org, stefano.stabellini@eu.citrix.com
Subject: [Xen-devel] [xen-unstable bisection] complete test-amd64-amd64-pv
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

branch xen-unstable
xen branch xen-unstable
job test-amd64-amd64-pv
test guest-saverestore

Tree: linux git://xenbits.xen.org/linux-pvops.git
Tree: qemu git://xenbits.xen.org/staging/qemu-xen-unstable.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-unstable.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-unstable.hg

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-unstable.hg
  Bug introduced:  31dcc0e08754
  Bug not present: d026f8abca51


  changeset:   26167:31dcc0e08754
  user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  date:        Mon Nov 19 12:59:48 2012 +0000
      
      xend: Remove old vtpm support from xm
      
      Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
      Acked-by: Ian Campbell <ian.campbell@citrix.com>
      Committed-by: Ian Campbell <ian.campbell@citrix.com>
      
      


For bisection revision-tuple graph see:
   http://www.chiark.greenend.org.uk/~xensrcts/results/bisect.xen-unstable.test-amd64-amd64-pv.guest-saverestore.html
Revision IDs in each graph node refer, respectively, to the Trees above.

----------------------------------------
Searching for failure / basis pass:
 14449 fail [host=fire-frog] / 14418 [host=lace-bug] 14416 [host=lake-frog] 14414 [host=bush-cricket] 14413 [host=field-cricket] 14411 [host=earwig] 14408 [host=leaf-beetle] 14403 [host=woodlouse] 14399 ok.
Failure / basis pass flights: 14449 / 14399
Tree: linux git://xenbits.xen.org/linux-pvops.git
Tree: qemu git://xenbits.xen.org/staging/qemu-xen-unstable.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-unstable.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-unstable.hg
Latest a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 ae6fb202b233
Basis pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 d1d05cb59a76
Generating revisions with ./adhoc-revtuple-generator  git://xenbits.xen.org/linux-pvops.git#a938a246d34912423c560f475ccf1ce0c71d9d00-a938a246d34912423c560f475ccf1ce0c71d9d00 git://xenbits.xen.org/staging/qemu-xen-unstable.git#bacc0d302445c75f18f4c826750fb5853b60e7ca-bacc0d302445c75f18f4c826750fb5853b60e7ca git://xenbits.xen.org/staging/qemu-upstream-unstable.git#cdf4d2bb4006805f209712fbb8ed1f83127e9984-cdf4d2bb4006805f209712fbb8ed1f83127e9984 http://xenbits.xen.org/hg/staging/xen-unstable.hg#d1d05cb59a76-ae6fb202b233
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-unstable.hg
searching for changes
no changes found
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-unstable.hg
searching for changes
no changes found
Loaded 358 nodes in revision graph
Searching for test results:
 14442 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 31668da0c4d3
 14408 [host=leaf-beetle]
 14423 []
 14411 [host=earwig]
 14450 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 d1d05cb59a76
 14395 [host=itch-mite]
 14413 [host=field-cricket]
 14414 [host=bush-cricket]
 14399 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 d1d05cb59a76
 14402 []
 14444 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 3dc18d679d04
 14416 [host=lake-frog]
 14403 [host=woodlouse]
 14418 [host=lace-bug]
 14434 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 02b9d9a25fee
 14421 []
 14446 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 d026f8abca51
 14439 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 d1d05cb59a76
 14426 []
 14451 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 ae6fb202b233
 14440 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 02b9d9a25fee
 14447 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 5a6225e40388
 14441 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 42a7c393c390
 14454 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 d026f8abca51
 14452 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 d026f8abca51
 14443 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 ae6fb202b233
 14448 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 31dcc0e08754
 14456 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 31dcc0e08754
 14453 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 31dcc0e08754
 14449 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 ae6fb202b233
Searching for interesting versions
 Result found: flight 14399 (pass), for basis pass
 Result found: flight 14443 (fail), for basis failure
 Repro found: flight 14450 (pass), for basis pass
 Repro found: flight 14451 (fail), for basis failure
 0 revisions at a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 d026f8abca51
No revisions left to test, checking graph state.
 Result found: flight 14446 (pass), for last pass
 Result found: flight 14448 (fail), for first failure
 Repro found: flight 14452 (pass), for last pass
 Repro found: flight 14453 (fail), for first failure
 Repro found: flight 14454 (pass), for last pass
 Repro found: flight 14456 (fail), for first failure

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-unstable.hg
  Bug introduced:  31dcc0e08754
  Bug not present: d026f8abca51

pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-unstable.hg
searching for changes
no changes found

  changeset:   26167:31dcc0e08754
  user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  date:        Mon Nov 19 12:59:48 2012 +0000
      
      xend: Remove old vtpm support from xm
      
      Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
      Acked-by: Ian Campbell <ian.campbell@citrix.com>
      Committed-by: Ian Campbell <ian.campbell@citrix.com>
      
      

Revision graph left in /home/xc_osstest/results/bisect.xen-unstable.test-amd64-amd64-pv.guest-saverestore.{dot,ps,png,html}.
----------------------------------------
14456: tolerable ALL FAIL

flight 14456 xen-unstable real-bisect [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14456/

Failures :-/ but no regressions.

Tests which did not succeed,
including tests which could not be run:
 test-amd64-amd64-pv          10 guest-saverestore       fail baseline untested


jobs:
 test-amd64-amd64-pv                                          fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 21:29:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 21:29:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TavNI-0002cS-NP; Tue, 20 Nov 2012 21:28:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TavNH-0002cM-MX
	for xen-devel@lists.xensource.com; Tue, 20 Nov 2012 21:28:55 +0000
Received: from [85.158.143.35:55412] by server-1.bemta-4.messagelabs.com id
	82/1B-27934-616FBA05; Tue, 20 Nov 2012 21:28:54 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1353446932!17901466!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2356 invoked from network); 20 Nov 2012 21:28:53 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-13.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	20 Nov 2012 21:28:53 -0000
X-IronPort-AV: E=Sophos;i="4.83,287,1352073600"; d="scan'208";a="15914629"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	20 Nov 2012 21:28:33 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 20 Nov 2012 21:28:33 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TavMv-0002pU-4W;
	Tue, 20 Nov 2012 21:28:33 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TavMv-0001pd-4A;
	Tue, 20 Nov 2012 21:28:33 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <E1TavMv-0001pd-4A@woking.cam.xci-test.com>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 20 Nov 2012 21:28:33 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com, keir@xen.org, stefano.stabellini@eu.citrix.com
Subject: [Xen-devel] [xen-unstable bisection] complete test-amd64-amd64-pv
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

branch xen-unstable
xen branch xen-unstable
job test-amd64-amd64-pv
test guest-saverestore

Tree: linux git://xenbits.xen.org/linux-pvops.git
Tree: qemu git://xenbits.xen.org/staging/qemu-xen-unstable.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-unstable.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-unstable.hg

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-unstable.hg
  Bug introduced:  31dcc0e08754
  Bug not present: d026f8abca51


  changeset:   26167:31dcc0e08754
  user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  date:        Mon Nov 19 12:59:48 2012 +0000
      
      xend: Remove old vtpm support from xm
      
      Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
      Acked-by: Ian Campbell <ian.campbell@citrix.com>
      Committed-by: Ian Campbell <ian.campbell@citrix.com>
      
      


For bisection revision-tuple graph see:
   http://www.chiark.greenend.org.uk/~xensrcts/results/bisect.xen-unstable.test-amd64-amd64-pv.guest-saverestore.html
Revision IDs in each graph node refer, respectively, to the Trees above.

----------------------------------------
Searching for failure / basis pass:
 14449 fail [host=fire-frog] / 14418 [host=lace-bug] 14416 [host=lake-frog] 14414 [host=bush-cricket] 14413 [host=field-cricket] 14411 [host=earwig] 14408 [host=leaf-beetle] 14403 [host=woodlouse] 14399 ok.
Failure / basis pass flights: 14449 / 14399
Tree: linux git://xenbits.xen.org/linux-pvops.git
Tree: qemu git://xenbits.xen.org/staging/qemu-xen-unstable.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-unstable.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-unstable.hg
Latest a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 ae6fb202b233
Basis pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 d1d05cb59a76
Generating revisions with ./adhoc-revtuple-generator  git://xenbits.xen.org/linux-pvops.git#a938a246d34912423c560f475ccf1ce0c71d9d00-a938a246d34912423c560f475ccf1ce0c71d9d00 git://xenbits.xen.org/staging/qemu-xen-unstable.git#bacc0d302445c75f18f4c826750fb5853b60e7ca-bacc0d302445c75f18f4c826750fb5853b60e7ca git://xenbits.xen.org/staging/qemu-upstream-unstable.git#cdf4d2bb4006805f209712fbb8ed1f83127e9984-cdf4d2bb4006805f209712fbb8ed1f83127e9984 http://xenbits.xen.org/hg/staging/xen-unstable.hg#d1d05cb59a76-ae6fb202b233
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-unstable.hg
searching for changes
no changes found
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-unstable.hg
searching for changes
no changes found
Loaded 358 nodes in revision graph
Searching for test results:
 14442 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 31668da0c4d3
 14408 [host=leaf-beetle]
 14423 []
 14411 [host=earwig]
 14450 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 d1d05cb59a76
 14395 [host=itch-mite]
 14413 [host=field-cricket]
 14414 [host=bush-cricket]
 14399 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 d1d05cb59a76
 14402 []
 14444 blocked a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 3dc18d679d04
 14416 [host=lake-frog]
 14403 [host=woodlouse]
 14418 [host=lace-bug]
 14434 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 02b9d9a25fee
 14421 []
 14446 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 d026f8abca51
 14439 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 d1d05cb59a76
 14426 []
 14451 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 ae6fb202b233
 14440 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 02b9d9a25fee
 14447 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 5a6225e40388
 14441 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 42a7c393c390
 14454 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 d026f8abca51
 14452 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 d026f8abca51
 14443 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 ae6fb202b233
 14448 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 31dcc0e08754
 14456 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 31dcc0e08754
 14453 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 31dcc0e08754
 14449 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 ae6fb202b233
Searching for interesting versions
 Result found: flight 14399 (pass), for basis pass
 Result found: flight 14443 (fail), for basis failure
 Repro found: flight 14450 (pass), for basis pass
 Repro found: flight 14451 (fail), for basis failure
 0 revisions at a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 d026f8abca51
No revisions left to test, checking graph state.
 Result found: flight 14446 (pass), for last pass
 Result found: flight 14448 (fail), for first failure
 Repro found: flight 14452 (pass), for last pass
 Repro found: flight 14453 (fail), for first failure
 Repro found: flight 14454 (pass), for last pass
 Repro found: flight 14456 (fail), for first failure

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-unstable.hg
  Bug introduced:  31dcc0e08754
  Bug not present: d026f8abca51

pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-unstable.hg
searching for changes
no changes found

  changeset:   26167:31dcc0e08754
  user:        Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  date:        Mon Nov 19 12:59:48 2012 +0000
      
      xend: Remove old vtpm support from xm
      
      Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
      Acked-by: Ian Campbell <ian.campbell@citrix.com>
      Committed-by: Ian Campbell <ian.campbell@citrix.com>
      
      

Revision graph left in /home/xc_osstest/results/bisect.xen-unstable.test-amd64-amd64-pv.guest-saverestore.{dot,ps,png,html}.
----------------------------------------
14456: tolerable ALL FAIL

flight 14456 xen-unstable real-bisect [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14456/

Failures :-/ but no regressions.

Tests which did not succeed,
including tests which could not be run:
 test-amd64-amd64-pv          10 guest-saverestore       fail baseline untested


jobs:
 test-amd64-amd64-pv                                          fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 22:43:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 22:43:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TawWV-0003M9-Ib; Tue, 20 Nov 2012 22:42:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TawWT-0003M4-O5
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 22:42:29 +0000
Received: from [85.158.138.51:49101] by server-12.bemta-3.messagelabs.com id
	8B/D8-22757-4570CA05; Tue, 20 Nov 2012 22:42:28 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1353451345!22905097!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNjU4Nzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20628 invoked from network); 20 Nov 2012 22:42:27 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-12.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 20 Nov 2012 22:42:27 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAKMgNWt014787
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 20 Nov 2012 22:42:25 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAKMgMuJ006493
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 20 Nov 2012 22:42:23 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAKMgLf3020325; Tue, 20 Nov 2012 16:42:22 -0600
MIME-Version: 1.0
Message-ID: <748aba10-531a-4ad5-bad3-7af0f86c0489@default>
Date: Tue, 20 Nov 2012 14:42:18 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Konrad Wilk <konrad.wilk@oracle.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] xen: tmem: selfballooning should be enabled
 when xen tmem is enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Konrad: Any chance this can get in for the upcoming window?
(Or is it enough of a bug fix that it can go in at an -rcN?)

It was just pointed out to me that some kernels have
cleancache and frontswap and xen_tmem enabled but NOT
xen_selfballooning!  While this configuration should be
possible, nearly all kernels that have CONFIG_XEN_TMEM=y should
also have CONFIG_XEN_SELFBALLOONING=y, since Transcendent
Memory (tmem) for Xen has very limited value without
selfballooning.

This is probably a result of a Kconfig mistake fixed I think
by the patch below.  Note that the year-old Oracle UEK2 kernel
distro has both CONFIG_XEN_TMEM and CONFIG_XEN_SELFBALLOONING
enabled, as does a Fedora 17 kernel update (3.6.6-1.fc17), so
the combination should be well tested.  Also, Xen tmem (and thus
selfballooning) are currently only enabled when a kernel boot
parameter is supplied so there is no runtime impact without
that boot parameter.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
index d4dffcd..b5f02f3 100644
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
@@ -10,9 +10,9 @@ config XEN_BALLOON
 	  return unneeded memory to the system.
 
 config XEN_SELFBALLOONING
-	bool "Dynamically self-balloon kernel memory to target"
-	depends on XEN && XEN_BALLOON && CLEANCACHE && SWAP && XEN_TMEM
-	default n
+	bool
+	depends on XEN_BALLOON && SWAP
+	default y if XEN_TMEM
 	help
 	  Self-ballooning dynamically balloons available kernel memory driven
 	  by the current usage of anonymous memory ("committed AS") and

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 20 22:43:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Nov 2012 22:43:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TawWV-0003M9-Ib; Tue, 20 Nov 2012 22:42:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TawWT-0003M4-O5
	for xen-devel@lists.xen.org; Tue, 20 Nov 2012 22:42:29 +0000
Received: from [85.158.138.51:49101] by server-12.bemta-3.messagelabs.com id
	8B/D8-22757-4570CA05; Tue, 20 Nov 2012 22:42:28 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1353451345!22905097!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNjU4Nzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20628 invoked from network); 20 Nov 2012 22:42:27 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-12.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 20 Nov 2012 22:42:27 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAKMgNWt014787
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 20 Nov 2012 22:42:25 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAKMgMuJ006493
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 20 Nov 2012 22:42:23 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAKMgLf3020325; Tue, 20 Nov 2012 16:42:22 -0600
MIME-Version: 1.0
Message-ID: <748aba10-531a-4ad5-bad3-7af0f86c0489@default>
Date: Tue, 20 Nov 2012 14:42:18 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Konrad Wilk <konrad.wilk@oracle.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] xen: tmem: selfballooning should be enabled
 when xen tmem is enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Konrad: Any chance this can get in for the upcoming window?
(Or is it enough of a bug fix that it can go in at an -rcN?)

It was just pointed out to me that some kernels have
cleancache and frontswap and xen_tmem enabled but NOT
xen_selfballooning!  While this configuration should be
possible, nearly all kernels that have CONFIG_XEN_TMEM=y should
also have CONFIG_XEN_SELFBALLOONING=y, since Transcendent
Memory (tmem) for Xen has very limited value without
selfballooning.

This is probably a result of a Kconfig mistake fixed I think
by the patch below.  Note that the year-old Oracle UEK2 kernel
distro has both CONFIG_XEN_TMEM and CONFIG_XEN_SELFBALLOONING
enabled, as does a Fedora 17 kernel update (3.6.6-1.fc17), so
the combination should be well tested.  Also, Xen tmem (and thus
selfballooning) are currently only enabled when a kernel boot
parameter is supplied so there is no runtime impact without
that boot parameter.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
index d4dffcd..b5f02f3 100644
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
@@ -10,9 +10,9 @@ config XEN_BALLOON
 	  return unneeded memory to the system.
 
 config XEN_SELFBALLOONING
-	bool "Dynamically self-balloon kernel memory to target"
-	depends on XEN && XEN_BALLOON && CLEANCACHE && SWAP && XEN_TMEM
-	default n
+	bool
+	depends on XEN_BALLOON && SWAP
+	default y if XEN_TMEM
 	help
 	  Self-ballooning dynamically balloons available kernel memory driven
 	  by the current usage of anonymous memory ("committed AS") and

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 02:27:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 02:27:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb01b-0001Xk-Hw; Wed, 21 Nov 2012 02:26:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1Tb01Z-0001Xf-Rj
	for Xen-devel@lists.xensource.com; Wed, 21 Nov 2012 02:26:50 +0000
Received: from [85.158.139.211:4947] by server-15.bemta-5.messagelabs.com id
	24/03-26920-9EB3CA05; Wed, 21 Nov 2012 02:26:49 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1353464807!18969921!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3NjU3Nw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26172 invoked from network); 21 Nov 2012 02:26:48 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-8.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 21 Nov 2012 02:26:48 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAL2QfVb019743
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 21 Nov 2012 02:26:41 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAL2QeQh008592
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Nov 2012 02:26:40 GMT
Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAL2Qd3O006997; Tue, 20 Nov 2012 20:26:39 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 20 Nov 2012 18:26:39 -0800
Date: Tue, 20 Nov 2012 18:26:36 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	"stefano.stabellini@eu.citrix.com" <stefano.stabellini@eu.citrix.com>, Ian
	Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121120182636.3879564a@mantra.us.oracle.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Subject: [Xen-devel] PVH:  domain creations...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi guys,

Good news, I got everything working on my refreshed tree. So, now time
to clean up the patch, look at the fixme's/TBDs to see what needs to be
done in phase I and what can be deferred. Lets start with domain
creation:

I currently have following for domain creation:
  dom0: dom0pvh in the command line makes it PVH mode. IMO, we should leave
        this as is until PVH is default.

  domU: vm.cfg has line: is_pvh = 1. The tools then parse this and set
        is_pvh fields in  libxl_domain_create_info{} and
        libxl_domain_build_info{}. I also introduced XEN_DOMCTL_CDF_pvh_guest 
        flag to send down the info to xen during domU creation.
 

 1. I suppose in XEN_DOMCTL_createdomain in xen: I could just see if
 it's PV guest with HAP, ie, 
       if (~XEN_DOMCTL_CDF_hvm_guest && XEN_DOMCTL_CDF_hap)
            then domcr_flags |= DOMCRF_pvh;

   This would result in elimination of XEN_DOMCTL_CDF_pvh_guest flag.
   What do you think?

 2. I suppose I could undo flags in libxl_domain_create_info and 
    libxl_domain_build_info, and just call xc_dom_feature_translated()
    and assume it's PVH if it returns true for PV?


Also, I realized SIF_IS_PVH is probably not needed and I'm trying to 
see if I can remove it.

Attaching user mode change diffs.

thanks,
Mukesh


diff -r 8b0762504037 tools/libxc/xc_dom_x86.c
--- a/tools/libxc/xc_dom_x86.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxc/xc_dom_x86.c	Tue Nov 20 15:58:21 2012 -0800
@@ -386,7 +386,8 @@ static int setup_pgtables_x86_64(struct 
         pgpfn = (addr - dom->parms.virt_base) >> PAGE_SHIFT_X86;
         l1tab[l1off] =
             pfn_to_paddr(xc_dom_p2m_guest(dom, pgpfn)) | L1_PROT;
-        if ( (addr >= dom->pgtables_seg.vstart) && 
+        if ( !(dom->flags & SIF_IS_PVH)      &&
+             (addr >= dom->pgtables_seg.vstart) && 
              (addr < dom->pgtables_seg.vend) )
             l1tab[l1off] &= ~_PAGE_RW; /* page tables are r/o */
         if ( l1off == (L1_PAGETABLE_ENTRIES_X86_64 - 1) )
@@ -716,7 +717,7 @@ int arch_setup_meminit(struct xc_dom_ima
     rc = x86_compat(dom->xch, dom->guest_domid, dom->guest_type);
     if ( rc )
         return rc;
-    if ( xc_dom_feature_translated(dom) )
+    if ( xc_dom_feature_translated(dom) && !(dom->flags & SIF_IS_PVH) )
     {
         dom->shadow_enabled = 1;
         rc = x86_shadow(dom->xch, dom->guest_domid);
@@ -830,7 +831,7 @@ int arch_setup_bootlate(struct xc_dom_im
         }
 
         /* Map grant table frames into guest physmap. */
-        for ( i = 0; ; i++ )
+        for ( i = 0; !(dom->flags & SIF_IS_PVH); i++ )
         {
             rc = xc_domain_add_to_physmap(dom->xch, dom->guest_domid,
                                           XENMAPSPACE_grant_table,
diff -r 8b0762504037 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxc/xc_domain_restore.c	Tue Nov 20 15:58:21 2012 -0800
@@ -1933,15 +1933,15 @@ int xc_domain_restore(xc_interface *xch,
             munmap(start_info, PAGE_SIZE);
         }
         /* Uncanonicalise each GDT frame number. */
-        if ( GET_FIELD(ctxt, gdt_ents) > 8192 )
+        if ( GET_FIELD(ctxt, u.pv.gdt_ents) > 8192 )
         {
             ERROR("GDT entry count out of range");
             goto out;
         }
 
-        for ( j = 0; (512*j) < GET_FIELD(ctxt, gdt_ents); j++ )
+        for ( j = 0; (512*j) < GET_FIELD(ctxt, u.pv.gdt_ents); j++ )
         {
-            pfn = GET_FIELD(ctxt, gdt_frames[j]);
+            pfn = GET_FIELD(ctxt, u.pv.gdt_frames[j]);
             if ( (pfn >= dinfo->p2m_size) ||
                  (pfn_type[pfn] != XEN_DOMCTL_PFINFO_NOTAB) )
             {
@@ -1949,7 +1949,7 @@ int xc_domain_restore(xc_interface *xch,
                       j, (unsigned long)pfn);
                 goto out;
             }
-            SET_FIELD(ctxt, gdt_frames[j], ctx->p2m[pfn]);
+            SET_FIELD(ctxt, u.pv.gdt_frames[j], ctx->p2m[pfn]);
         }
         /* Uncanonicalise the page table base pointer. */
         pfn = UNFOLD_CR3(GET_FIELD(ctxt, ctrlreg[3]));
diff -r 8b0762504037 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxc/xc_domain_save.c	Tue Nov 20 15:58:21 2012 -0800
@@ -1889,15 +1889,15 @@ int xc_domain_save(xc_interface *xch, in
         }
 
         /* Canonicalise each GDT frame number. */
-        for ( j = 0; (512*j) < GET_FIELD(&ctxt, gdt_ents); j++ )
+        for ( j = 0; (512*j) < GET_FIELD(&ctxt, u.pv.gdt_ents); j++ )
         {
-            mfn = GET_FIELD(&ctxt, gdt_frames[j]);
+            mfn = GET_FIELD(&ctxt, u.pv.gdt_frames[j]);
             if ( !MFN_IS_IN_PSEUDOPHYS_MAP(mfn) )
             {
                 ERROR("GDT frame is not in range of pseudophys map");
                 goto out;
             }
-            SET_FIELD(&ctxt, gdt_frames[j], mfn_to_pfn(mfn));
+            SET_FIELD(&ctxt, u.pv.gdt_frames[j], mfn_to_pfn(mfn));
         }
 
         /* Canonicalise the page table base pointer. */
diff -r 8b0762504037 tools/libxl/Makefile
--- a/tools/libxl/Makefile	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/Makefile	Tue Nov 20 15:58:21 2012 -0800
@@ -13,7 +13,7 @@ XLUMINOR = 1
 
 CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
 	-Wno-declaration-after-statement -Wformat-nonliteral
-CFLAGS += -I. -fPIC
+CFLAGS += -I. -fPIC -O0
 
 ifeq ($(CONFIG_Linux),y)
 LIBUUID_LIBS += -luuid
diff -r 8b0762504037 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/libxl_create.c	Tue Nov 20 15:58:21 2012 -0800
@@ -409,6 +409,8 @@ int libxl__domain_make(libxl__gc *gc, li
         flags |= XEN_DOMCTL_CDF_hvm_guest;
         flags |= libxl_defbool_val(info->hap) ? XEN_DOMCTL_CDF_hap : 0;
         flags |= libxl_defbool_val(info->oos) ? 0 : XEN_DOMCTL_CDF_oos_off;
+    } else if ( libxl_defbool_val(info->ci_pvh) ) {
+        flags |= (XEN_DOMCTL_CDF_pvh_guest | XEN_DOMCTL_CDF_hap);
     }
     *domid = -1;
 
diff -r 8b0762504037 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/libxl_dom.c	Tue Nov 20 15:58:21 2012 -0800
@@ -270,7 +270,8 @@ int libxl__build_pre(libxl__gc *gc, uint
     if (rtc_timeoffset)
         xc_domain_set_time_offset(ctx->xch, domid, rtc_timeoffset);
 
-    if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
+    if (info->type == LIBXL_DOMAIN_TYPE_HVM ||
+        libxl_defbool_val(info->bi_pvh) ) {
         unsigned long shadow;
         shadow = (info->shadow_memkb + 1023) / 1024;
         xc_shadow_control(ctx->xch, domid, XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION, NULL, 0, &shadow, 0, NULL);
@@ -368,9 +369,15 @@ int libxl__build_pv(libxl__gc *gc, uint3
     struct xc_dom_image *dom;
     int ret;
     int flags = 0;
+    int is_pvh = libxl_defbool_val(info->bi_pvh);
 
     xc_dom_loginit(ctx->xch);
 
+    if (is_pvh) {
+        printf("info..features:%s\n", info->u.pv.features);
+        info->u.pv.features = strdup("auto_translated_physmap");
+    }
+
     dom = xc_dom_allocate(ctx->xch, state->pv_cmdline, info->u.pv.features);
     if (!dom) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_dom_allocate failed");
@@ -408,6 +415,7 @@ int libxl__build_pv(libxl__gc *gc, uint3
         }
     }
 
+    flags |= is_pvh ? SIF_IS_PVH : 0;
     dom->flags = flags;
     dom->console_evtchn = state->console_port;
     dom->console_domid = state->console_domid;
@@ -438,7 +446,8 @@ int libxl__build_pv(libxl__gc *gc, uint3
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_dom_boot_image failed");
         goto out;
     }
-    if ( (ret = xc_dom_gnttab_init(dom)) != 0 ) {
+    /* PVH sets up its own grant during boot via hvm mechanisms */
+    if ( !is_pvh && (ret = xc_dom_gnttab_init(dom)) != 0 ) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_dom_gnttab_init failed");
         goto out;
     }
diff -r 8b0762504037 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/libxl_types.idl	Tue Nov 20 15:58:21 2012 -0800
@@ -243,6 +243,7 @@ libxl_domain_create_info = Struct("domai
     ("platformdata", libxl_key_value_list),
     ("poolid",       uint32),
     ("run_hotplug_scripts",libxl_defbool),
+    ("ci_pvh",       libxl_defbool),
     ], dir=DIR_IN)
 
 MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
@@ -339,6 +340,7 @@ libxl_domain_build_info = Struct("domain
                                       ])),
                  ("invalid", Struct(None, [])),
                  ], keyvar_init_val = "LIBXL_DOMAIN_TYPE_INVALID")),
+    ("bi_pvh",       libxl_defbool),
     ], dir=DIR_IN
 )
 
diff -r 8b0762504037 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/xl_cmdimpl.c	Tue Nov 20 15:58:21 2012 -0800
@@ -615,8 +615,18 @@ static void parse_config_data(const char
         !strncmp(buf, "hvm", strlen(buf)))
         c_info->type = LIBXL_DOMAIN_TYPE_HVM;
 
+    libxl_defbool_setdefault(&c_info->ci_pvh, false);
+    libxl_defbool_setdefault(&c_info->hap, false);
+    xlu_cfg_get_defbool(config, "pvh", &c_info->ci_pvh, 0);
     xlu_cfg_get_defbool(config, "hap", &c_info->hap, 0);
 
+    if (libxl_defbool_val(c_info->ci_pvh) &&
+        !libxl_defbool_val(c_info->hap)) {
+
+        fprintf(stderr, "hap is required for PVH domain\n");
+        exit(1);
+    }
+
     if (xlu_cfg_replace_string (config, "name", &c_info->name, 0)) {
         fprintf(stderr, "Domain name must be specified.\n");
         exit(1);
@@ -916,6 +926,7 @@ static void parse_config_data(const char
 
         b_info->u.pv.cmdline = cmdline;
         xlu_cfg_replace_string (config, "ramdisk", &b_info->u.pv.ramdisk, 0);
+        libxl_defbool_set(&b_info->bi_pvh, libxl_defbool_val(c_info->ci_pvh));
         break;
     }
     default:

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 02:27:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 02:27:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb01b-0001Xk-Hw; Wed, 21 Nov 2012 02:26:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1Tb01Z-0001Xf-Rj
	for Xen-devel@lists.xensource.com; Wed, 21 Nov 2012 02:26:50 +0000
Received: from [85.158.139.211:4947] by server-15.bemta-5.messagelabs.com id
	24/03-26920-9EB3CA05; Wed, 21 Nov 2012 02:26:49 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1353464807!18969921!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3NjU3Nw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26172 invoked from network); 21 Nov 2012 02:26:48 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-8.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 21 Nov 2012 02:26:48 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAL2QfVb019743
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 21 Nov 2012 02:26:41 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAL2QeQh008592
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Nov 2012 02:26:40 GMT
Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAL2Qd3O006997; Tue, 20 Nov 2012 20:26:39 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 20 Nov 2012 18:26:39 -0800
Date: Tue, 20 Nov 2012 18:26:36 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	"stefano.stabellini@eu.citrix.com" <stefano.stabellini@eu.citrix.com>, Ian
	Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121120182636.3879564a@mantra.us.oracle.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Subject: [Xen-devel] PVH:  domain creations...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi guys,

Good news, I got everything working on my refreshed tree. So, now time
to clean up the patch, look at the fixme's/TBDs to see what needs to be
done in phase I and what can be deferred. Lets start with domain
creation:

I currently have following for domain creation:
  dom0: dom0pvh in the command line makes it PVH mode. IMO, we should leave
        this as is until PVH is default.

  domU: vm.cfg has line: is_pvh = 1. The tools then parse this and set
        is_pvh fields in  libxl_domain_create_info{} and
        libxl_domain_build_info{}. I also introduced XEN_DOMCTL_CDF_pvh_guest 
        flag to send down the info to xen during domU creation.
 

 1. I suppose in XEN_DOMCTL_createdomain in xen: I could just see if
 it's PV guest with HAP, ie, 
       if (~XEN_DOMCTL_CDF_hvm_guest && XEN_DOMCTL_CDF_hap)
            then domcr_flags |= DOMCRF_pvh;

   This would result in elimination of XEN_DOMCTL_CDF_pvh_guest flag.
   What do you think?

 2. I suppose I could undo flags in libxl_domain_create_info and 
    libxl_domain_build_info, and just call xc_dom_feature_translated()
    and assume it's PVH if it returns true for PV?


Also, I realized SIF_IS_PVH is probably not needed and I'm trying to 
see if I can remove it.

Attaching user mode change diffs.

thanks,
Mukesh


diff -r 8b0762504037 tools/libxc/xc_dom_x86.c
--- a/tools/libxc/xc_dom_x86.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxc/xc_dom_x86.c	Tue Nov 20 15:58:21 2012 -0800
@@ -386,7 +386,8 @@ static int setup_pgtables_x86_64(struct 
         pgpfn = (addr - dom->parms.virt_base) >> PAGE_SHIFT_X86;
         l1tab[l1off] =
             pfn_to_paddr(xc_dom_p2m_guest(dom, pgpfn)) | L1_PROT;
-        if ( (addr >= dom->pgtables_seg.vstart) && 
+        if ( !(dom->flags & SIF_IS_PVH)      &&
+             (addr >= dom->pgtables_seg.vstart) && 
              (addr < dom->pgtables_seg.vend) )
             l1tab[l1off] &= ~_PAGE_RW; /* page tables are r/o */
         if ( l1off == (L1_PAGETABLE_ENTRIES_X86_64 - 1) )
@@ -716,7 +717,7 @@ int arch_setup_meminit(struct xc_dom_ima
     rc = x86_compat(dom->xch, dom->guest_domid, dom->guest_type);
     if ( rc )
         return rc;
-    if ( xc_dom_feature_translated(dom) )
+    if ( xc_dom_feature_translated(dom) && !(dom->flags & SIF_IS_PVH) )
     {
         dom->shadow_enabled = 1;
         rc = x86_shadow(dom->xch, dom->guest_domid);
@@ -830,7 +831,7 @@ int arch_setup_bootlate(struct xc_dom_im
         }
 
         /* Map grant table frames into guest physmap. */
-        for ( i = 0; ; i++ )
+        for ( i = 0; !(dom->flags & SIF_IS_PVH); i++ )
         {
             rc = xc_domain_add_to_physmap(dom->xch, dom->guest_domid,
                                           XENMAPSPACE_grant_table,
diff -r 8b0762504037 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxc/xc_domain_restore.c	Tue Nov 20 15:58:21 2012 -0800
@@ -1933,15 +1933,15 @@ int xc_domain_restore(xc_interface *xch,
             munmap(start_info, PAGE_SIZE);
         }
         /* Uncanonicalise each GDT frame number. */
-        if ( GET_FIELD(ctxt, gdt_ents) > 8192 )
+        if ( GET_FIELD(ctxt, u.pv.gdt_ents) > 8192 )
         {
             ERROR("GDT entry count out of range");
             goto out;
         }
 
-        for ( j = 0; (512*j) < GET_FIELD(ctxt, gdt_ents); j++ )
+        for ( j = 0; (512*j) < GET_FIELD(ctxt, u.pv.gdt_ents); j++ )
         {
-            pfn = GET_FIELD(ctxt, gdt_frames[j]);
+            pfn = GET_FIELD(ctxt, u.pv.gdt_frames[j]);
             if ( (pfn >= dinfo->p2m_size) ||
                  (pfn_type[pfn] != XEN_DOMCTL_PFINFO_NOTAB) )
             {
@@ -1949,7 +1949,7 @@ int xc_domain_restore(xc_interface *xch,
                       j, (unsigned long)pfn);
                 goto out;
             }
-            SET_FIELD(ctxt, gdt_frames[j], ctx->p2m[pfn]);
+            SET_FIELD(ctxt, u.pv.gdt_frames[j], ctx->p2m[pfn]);
         }
         /* Uncanonicalise the page table base pointer. */
         pfn = UNFOLD_CR3(GET_FIELD(ctxt, ctrlreg[3]));
diff -r 8b0762504037 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxc/xc_domain_save.c	Tue Nov 20 15:58:21 2012 -0800
@@ -1889,15 +1889,15 @@ int xc_domain_save(xc_interface *xch, in
         }
 
         /* Canonicalise each GDT frame number. */
-        for ( j = 0; (512*j) < GET_FIELD(&ctxt, gdt_ents); j++ )
+        for ( j = 0; (512*j) < GET_FIELD(&ctxt, u.pv.gdt_ents); j++ )
         {
-            mfn = GET_FIELD(&ctxt, gdt_frames[j]);
+            mfn = GET_FIELD(&ctxt, u.pv.gdt_frames[j]);
             if ( !MFN_IS_IN_PSEUDOPHYS_MAP(mfn) )
             {
                 ERROR("GDT frame is not in range of pseudophys map");
                 goto out;
             }
-            SET_FIELD(&ctxt, gdt_frames[j], mfn_to_pfn(mfn));
+            SET_FIELD(&ctxt, u.pv.gdt_frames[j], mfn_to_pfn(mfn));
         }
 
         /* Canonicalise the page table base pointer. */
diff -r 8b0762504037 tools/libxl/Makefile
--- a/tools/libxl/Makefile	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/Makefile	Tue Nov 20 15:58:21 2012 -0800
@@ -13,7 +13,7 @@ XLUMINOR = 1
 
 CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
 	-Wno-declaration-after-statement -Wformat-nonliteral
-CFLAGS += -I. -fPIC
+CFLAGS += -I. -fPIC -O0
 
 ifeq ($(CONFIG_Linux),y)
 LIBUUID_LIBS += -luuid
diff -r 8b0762504037 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/libxl_create.c	Tue Nov 20 15:58:21 2012 -0800
@@ -409,6 +409,8 @@ int libxl__domain_make(libxl__gc *gc, li
         flags |= XEN_DOMCTL_CDF_hvm_guest;
         flags |= libxl_defbool_val(info->hap) ? XEN_DOMCTL_CDF_hap : 0;
         flags |= libxl_defbool_val(info->oos) ? 0 : XEN_DOMCTL_CDF_oos_off;
+    } else if ( libxl_defbool_val(info->ci_pvh) ) {
+        flags |= (XEN_DOMCTL_CDF_pvh_guest | XEN_DOMCTL_CDF_hap);
     }
     *domid = -1;
 
diff -r 8b0762504037 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/libxl_dom.c	Tue Nov 20 15:58:21 2012 -0800
@@ -270,7 +270,8 @@ int libxl__build_pre(libxl__gc *gc, uint
     if (rtc_timeoffset)
         xc_domain_set_time_offset(ctx->xch, domid, rtc_timeoffset);
 
-    if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
+    if (info->type == LIBXL_DOMAIN_TYPE_HVM ||
+        libxl_defbool_val(info->bi_pvh) ) {
         unsigned long shadow;
         shadow = (info->shadow_memkb + 1023) / 1024;
         xc_shadow_control(ctx->xch, domid, XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION, NULL, 0, &shadow, 0, NULL);
@@ -368,9 +369,15 @@ int libxl__build_pv(libxl__gc *gc, uint3
     struct xc_dom_image *dom;
     int ret;
     int flags = 0;
+    int is_pvh = libxl_defbool_val(info->bi_pvh);
 
     xc_dom_loginit(ctx->xch);
 
+    if (is_pvh) {
+        printf("info..features:%s\n", info->u.pv.features);
+        info->u.pv.features = strdup("auto_translated_physmap");
+    }
+
     dom = xc_dom_allocate(ctx->xch, state->pv_cmdline, info->u.pv.features);
     if (!dom) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_dom_allocate failed");
@@ -408,6 +415,7 @@ int libxl__build_pv(libxl__gc *gc, uint3
         }
     }
 
+    flags |= is_pvh ? SIF_IS_PVH : 0;
     dom->flags = flags;
     dom->console_evtchn = state->console_port;
     dom->console_domid = state->console_domid;
@@ -438,7 +446,8 @@ int libxl__build_pv(libxl__gc *gc, uint3
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_dom_boot_image failed");
         goto out;
     }
-    if ( (ret = xc_dom_gnttab_init(dom)) != 0 ) {
+    /* PVH sets up its own grant during boot via hvm mechanisms */
+    if ( !is_pvh && (ret = xc_dom_gnttab_init(dom)) != 0 ) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_dom_gnttab_init failed");
         goto out;
     }
diff -r 8b0762504037 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/libxl_types.idl	Tue Nov 20 15:58:21 2012 -0800
@@ -243,6 +243,7 @@ libxl_domain_create_info = Struct("domai
     ("platformdata", libxl_key_value_list),
     ("poolid",       uint32),
     ("run_hotplug_scripts",libxl_defbool),
+    ("ci_pvh",       libxl_defbool),
     ], dir=DIR_IN)
 
 MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
@@ -339,6 +340,7 @@ libxl_domain_build_info = Struct("domain
                                       ])),
                  ("invalid", Struct(None, [])),
                  ], keyvar_init_val = "LIBXL_DOMAIN_TYPE_INVALID")),
+    ("bi_pvh",       libxl_defbool),
     ], dir=DIR_IN
 )
 
diff -r 8b0762504037 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Oct 31 16:08:55 2012 -0700
+++ b/tools/libxl/xl_cmdimpl.c	Tue Nov 20 15:58:21 2012 -0800
@@ -615,8 +615,18 @@ static void parse_config_data(const char
         !strncmp(buf, "hvm", strlen(buf)))
         c_info->type = LIBXL_DOMAIN_TYPE_HVM;
 
+    libxl_defbool_setdefault(&c_info->ci_pvh, false);
+    libxl_defbool_setdefault(&c_info->hap, false);
+    xlu_cfg_get_defbool(config, "pvh", &c_info->ci_pvh, 0);
     xlu_cfg_get_defbool(config, "hap", &c_info->hap, 0);
 
+    if (libxl_defbool_val(c_info->ci_pvh) &&
+        !libxl_defbool_val(c_info->hap)) {
+
+        fprintf(stderr, "hap is required for PVH domain\n");
+        exit(1);
+    }
+
     if (xlu_cfg_replace_string (config, "name", &c_info->name, 0)) {
         fprintf(stderr, "Domain name must be specified.\n");
         exit(1);
@@ -916,6 +926,7 @@ static void parse_config_data(const char
 
         b_info->u.pv.cmdline = cmdline;
         xlu_cfg_replace_string (config, "ramdisk", &b_info->u.pv.ramdisk, 0);
+        libxl_defbool_set(&b_info->bi_pvh, libxl_defbool_val(c_info->ci_pvh));
         break;
     }
     default:

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 02:43:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 02:43:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb0H3-0001nk-5i; Wed, 21 Nov 2012 02:42:49 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1Tb0H1-0001nc-AU
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 02:42:47 +0000
Received: from [193.109.254.147:51852] by server-15.bemta-14.messagelabs.com
	id 9F/45-12105-6AF3CA05; Wed, 21 Nov 2012 02:42:46 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1353465764!10150783!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3NjU3Nw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22338 invoked from network); 21 Nov 2012 02:42:45 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-2.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 21 Nov 2012 02:42:45 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAL2gXrD031138
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 21 Nov 2012 02:42:34 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAL2gW7T000949
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Nov 2012 02:42:32 GMT
Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAL2gVVI017123; Tue, 20 Nov 2012 20:42:31 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 20 Nov 2012 18:42:31 -0800
Message-ID: <50AC3FA2.3050008@oracle.com>
Date: Wed, 21 Nov 2012 10:42:42 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1349790467.21847.185.camel@zakaz.uk.xensource.com>
	<1349790863.21172.4406.camel@edumazet-glaptop>
	<1349792241.21847.199.camel@zakaz.uk.xensource.com>
	<1349792847.21172.4479.camel@edumazet-glaptop>
	<1349793630.21847.208.camel@zakaz.uk.xensource.com>
	<1349863984.10070.26.camel@zakaz.uk.xensource.com>
	<1349874598.10070.39.camel@zakaz.uk.xensource.com>
	<748966751.20121010164949@eikelenboom.it>
	<1349942546.14806.7.camel@zakaz.uk.xensource.com>
	<151954917.20121011120004@eikelenboom.it>
	<1349949924.21172.8462.camel@edumazet-glaptop>
	<1349950494.14806.29.camel@zakaz.uk.xensource.com>
	<50A4540E.1010601@oracle.com>	<1333495676.20121119164304@eikelenboom.it>
	<50AB3F9D.4070905@canonical.com>
	<1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411413.13542.31.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353411413.13542.31.camel@zakaz.uk.xensource.com>
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Stefan Bader <stefan.bader@canonical.com>,
	xen-devel <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	"Marcos E. Matsunaga" <Marcos.Matsunaga@oracle.com>
Subject: Re: [Xen-devel] compound skb frag pages appearing in start_xmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-20 19:36, Ian Campbell wrote:
> On Tue, 2012-11-20 at 09:21 +0000, Ian Campbell wrote:
>> On Tue, 2012-11-20 at 08:30 +0000, Stefan Bader wrote:
>>>>> When I tried to rebase my persistent grant netfront/netback patch on
>>>>> latest kernel, netperf/netserver test never succeeded. I did some test
>>>>> to find out that v3.6-rc7 works fine, but v3.7-rc1, v3.7-rc2 and
>>>>> v3.7-rc4 does not succeed in netperf/netserver test. So I keep my
>>>>> persistent grant patch only based on v3.4-rc3 now.
>>>>> Konrad thought about commit 6a8ed462f16b8455eec5ae00eb6014159a6721f0 in
>>>>> v3.7-rc1, and suggested me to test your debug patch in netfront. This
>>>>> BUG_ON happens soon after running the netperf/netserver test case.
>>>>> Thanks
>>>>> Annie
>>>> Is there any progression with this bug (rc6 is out the door, so the
>>> release of 3.7-final seems to be eminent and this bug completely
>>> cripples any networking with guests) ?
>>> +1 on that. I was testing yesterday with a PVM domU running 3.7-rc5 on Xen 4.2
>>> (but also reported from EC2 running Xen 3.4.3) c with one VCPU. I actually can
>>> trigger it by just ssh'ing into the domU (from another machine) and then run
>>> "find /". Output starts to stutter and then stops completely. When this happens
>>> a new connection still can be made and as long as only shorter output is
>>> generated the ssh connection is ok. From a dump taken it looks like user-space
>>> is waiting in some select call (without any warnon I rather won't see the tx path).
>> Annie, are you still looking into this or shall I?
> I'll assume that silence == No. Will post a patch shortly.
Sorry for the delay response, I did create a patch, but did not post it 
out in time.

Thanks
Annie
> Ian.
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 02:43:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 02:43:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb0H3-0001nk-5i; Wed, 21 Nov 2012 02:42:49 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1Tb0H1-0001nc-AU
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 02:42:47 +0000
Received: from [193.109.254.147:51852] by server-15.bemta-14.messagelabs.com
	id 9F/45-12105-6AF3CA05; Wed, 21 Nov 2012 02:42:46 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1353465764!10150783!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3NjU3Nw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22338 invoked from network); 21 Nov 2012 02:42:45 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-2.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 21 Nov 2012 02:42:45 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAL2gXrD031138
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 21 Nov 2012 02:42:34 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAL2gW7T000949
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Nov 2012 02:42:32 GMT
Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAL2gVVI017123; Tue, 20 Nov 2012 20:42:31 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 20 Nov 2012 18:42:31 -0800
Message-ID: <50AC3FA2.3050008@oracle.com>
Date: Wed, 21 Nov 2012 10:42:42 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1349790467.21847.185.camel@zakaz.uk.xensource.com>
	<1349790863.21172.4406.camel@edumazet-glaptop>
	<1349792241.21847.199.camel@zakaz.uk.xensource.com>
	<1349792847.21172.4479.camel@edumazet-glaptop>
	<1349793630.21847.208.camel@zakaz.uk.xensource.com>
	<1349863984.10070.26.camel@zakaz.uk.xensource.com>
	<1349874598.10070.39.camel@zakaz.uk.xensource.com>
	<748966751.20121010164949@eikelenboom.it>
	<1349942546.14806.7.camel@zakaz.uk.xensource.com>
	<151954917.20121011120004@eikelenboom.it>
	<1349949924.21172.8462.camel@edumazet-glaptop>
	<1349950494.14806.29.camel@zakaz.uk.xensource.com>
	<50A4540E.1010601@oracle.com>	<1333495676.20121119164304@eikelenboom.it>
	<50AB3F9D.4070905@canonical.com>
	<1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411413.13542.31.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353411413.13542.31.camel@zakaz.uk.xensource.com>
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Stefan Bader <stefan.bader@canonical.com>,
	xen-devel <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	"Marcos E. Matsunaga" <Marcos.Matsunaga@oracle.com>
Subject: Re: [Xen-devel] compound skb frag pages appearing in start_xmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-20 19:36, Ian Campbell wrote:
> On Tue, 2012-11-20 at 09:21 +0000, Ian Campbell wrote:
>> On Tue, 2012-11-20 at 08:30 +0000, Stefan Bader wrote:
>>>>> When I tried to rebase my persistent grant netfront/netback patch on
>>>>> latest kernel, netperf/netserver test never succeeded. I did some test
>>>>> to find out that v3.6-rc7 works fine, but v3.7-rc1, v3.7-rc2 and
>>>>> v3.7-rc4 does not succeed in netperf/netserver test. So I keep my
>>>>> persistent grant patch only based on v3.4-rc3 now.
>>>>> Konrad thought about commit 6a8ed462f16b8455eec5ae00eb6014159a6721f0 in
>>>>> v3.7-rc1, and suggested me to test your debug patch in netfront. This
>>>>> BUG_ON happens soon after running the netperf/netserver test case.
>>>>> Thanks
>>>>> Annie
>>>> Is there any progression with this bug (rc6 is out the door, so the
>>> release of 3.7-final seems to be eminent and this bug completely
>>> cripples any networking with guests) ?
>>> +1 on that. I was testing yesterday with a PVM domU running 3.7-rc5 on Xen 4.2
>>> (but also reported from EC2 running Xen 3.4.3) c with one VCPU. I actually can
>>> trigger it by just ssh'ing into the domU (from another machine) and then run
>>> "find /". Output starts to stutter and then stops completely. When this happens
>>> a new connection still can be made and as long as only shorter output is
>>> generated the ssh connection is ok. From a dump taken it looks like user-space
>>> is waiting in some select call (without any warnon I rather won't see the tx path).
>> Annie, are you still looking into this or shall I?
> I'll assume that silence == No. Will post a patch shortly.
Sorry for the delay response, I did create a patch, but did not post it 
out in time.

Thanks
Annie
> Ian.
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 02:48:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 02:48:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb0M7-0001xa-2P; Wed, 21 Nov 2012 02:48:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1Tb0M5-0001xV-MF
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 02:48:02 +0000
Received: from [85.158.143.35:12937] by server-3.bemta-4.messagelabs.com id
	6E/6A-06841-1E04CA05; Wed, 21 Nov 2012 02:48:01 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1353466079!8123700!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3NjU3Nw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23062 invoked from network); 21 Nov 2012 02:48:00 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 21 Nov 2012 02:48:00 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAL2lvVT002339
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 21 Nov 2012 02:47:58 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAL2luPB002799
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Nov 2012 02:47:57 GMT
Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAL2luxR019692; Tue, 20 Nov 2012 20:47:56 -0600
Received: from konrad-lan.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 20 Nov 2012 18:47:56 -0800
Date: Tue, 20 Nov 2012 21:47:53 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <20121121024753.GB11912@konrad-lan.dumpdata.com>
References: <748aba10-531a-4ad5-bad3-7af0f86c0489@default>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <748aba10-531a-4ad5-bad3-7af0f86c0489@default>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: tmem: selfballooning should be enabled
 when xen tmem is enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 20, 2012 at 02:42:18PM -0800, Dan Magenheimer wrote:
> Konrad: Any chance this can get in for the upcoming window?
> (Or is it enough of a bug fix that it can go in at an -rcN?)

Lets do it in the next merge window. About now I am comfortable
only with regression fixes.
> 
> It was just pointed out to me that some kernels have
> cleancache and frontswap and xen_tmem enabled but NOT
> xen_selfballooning!  While this configuration should be
> possible, nearly all kernels that have CONFIG_XEN_TMEM=y should
> also have CONFIG_XEN_SELFBALLOONING=y, since Transcendent
> Memory (tmem) for Xen has very limited value without
> selfballooning.
> 
> This is probably a result of a Kconfig mistake fixed I think
> by the patch below.  Note that the year-old Oracle UEK2 kernel
> distro has both CONFIG_XEN_TMEM and CONFIG_XEN_SELFBALLOONING
> enabled, as does a Fedora 17 kernel update (3.6.6-1.fc17), so
> the combination should be well tested.  Also, Xen tmem (and thus
> selfballooning) are currently only enabled when a kernel boot
> parameter is supplied so there is no runtime impact without
> that boot parameter.
> 
> Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
> 
> diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
> index d4dffcd..b5f02f3 100644
> --- a/drivers/xen/Kconfig
> +++ b/drivers/xen/Kconfig
> @@ -10,9 +10,9 @@ config XEN_BALLOON
>  	  return unneeded memory to the system.
>  
>  config XEN_SELFBALLOONING
> -	bool "Dynamically self-balloon kernel memory to target"
> -	depends on XEN && XEN_BALLOON && CLEANCACHE && SWAP && XEN_TMEM
> -	default n
> +	bool
> +	depends on XEN_BALLOON && SWAP
> +	default y if XEN_TMEM
>  	help
>  	  Self-ballooning dynamically balloons available kernel memory driven
>  	  by the current usage of anonymous memory ("committed AS") and

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 02:48:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 02:48:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb0M7-0001xa-2P; Wed, 21 Nov 2012 02:48:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1Tb0M5-0001xV-MF
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 02:48:02 +0000
Received: from [85.158.143.35:12937] by server-3.bemta-4.messagelabs.com id
	6E/6A-06841-1E04CA05; Wed, 21 Nov 2012 02:48:01 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1353466079!8123700!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3NjU3Nw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23062 invoked from network); 21 Nov 2012 02:48:00 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 21 Nov 2012 02:48:00 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAL2lvVT002339
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 21 Nov 2012 02:47:58 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAL2luPB002799
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Nov 2012 02:47:57 GMT
Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAL2luxR019692; Tue, 20 Nov 2012 20:47:56 -0600
Received: from konrad-lan.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 20 Nov 2012 18:47:56 -0800
Date: Tue, 20 Nov 2012 21:47:53 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <20121121024753.GB11912@konrad-lan.dumpdata.com>
References: <748aba10-531a-4ad5-bad3-7af0f86c0489@default>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <748aba10-531a-4ad5-bad3-7af0f86c0489@default>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: tmem: selfballooning should be enabled
 when xen tmem is enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 20, 2012 at 02:42:18PM -0800, Dan Magenheimer wrote:
> Konrad: Any chance this can get in for the upcoming window?
> (Or is it enough of a bug fix that it can go in at an -rcN?)

Lets do it in the next merge window. About now I am comfortable
only with regression fixes.
> 
> It was just pointed out to me that some kernels have
> cleancache and frontswap and xen_tmem enabled but NOT
> xen_selfballooning!  While this configuration should be
> possible, nearly all kernels that have CONFIG_XEN_TMEM=y should
> also have CONFIG_XEN_SELFBALLOONING=y, since Transcendent
> Memory (tmem) for Xen has very limited value without
> selfballooning.
> 
> This is probably a result of a Kconfig mistake fixed I think
> by the patch below.  Note that the year-old Oracle UEK2 kernel
> distro has both CONFIG_XEN_TMEM and CONFIG_XEN_SELFBALLOONING
> enabled, as does a Fedora 17 kernel update (3.6.6-1.fc17), so
> the combination should be well tested.  Also, Xen tmem (and thus
> selfballooning) are currently only enabled when a kernel boot
> parameter is supplied so there is no runtime impact without
> that boot parameter.
> 
> Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
> 
> diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
> index d4dffcd..b5f02f3 100644
> --- a/drivers/xen/Kconfig
> +++ b/drivers/xen/Kconfig
> @@ -10,9 +10,9 @@ config XEN_BALLOON
>  	  return unneeded memory to the system.
>  
>  config XEN_SELFBALLOONING
> -	bool "Dynamically self-balloon kernel memory to target"
> -	depends on XEN && XEN_BALLOON && CLEANCACHE && SWAP && XEN_TMEM
> -	default n
> +	bool
> +	depends on XEN_BALLOON && SWAP
> +	default y if XEN_TMEM
>  	help
>  	  Self-ballooning dynamically balloons available kernel memory driven
>  	  by the current usage of anonymous memory ("committed AS") and

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 02:53:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 02:53:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb0Qd-00029B-PD; Wed, 21 Nov 2012 02:52:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1Tb0Qc-000293-Ed
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 02:52:42 +0000
Received: from [85.158.139.83:21383] by server-8.bemta-5.messagelabs.com id
	99/F6-06050-9F14CA05; Wed, 21 Nov 2012 02:52:41 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1353466359!26586155!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3NjU3Nw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15294 invoked from network); 21 Nov 2012 02:52:40 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-6.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 21 Nov 2012 02:52:40 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAL2qToC005762
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 21 Nov 2012 02:52:30 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAL2qTuA012239
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Nov 2012 02:52:29 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAL2qS9q019913; Tue, 20 Nov 2012 20:52:28 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 20 Nov 2012 18:52:28 -0800
Message-ID: <50AC41F7.7080609@oracle.com>
Date: Wed, 21 Nov 2012 10:52:39 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <ian.campbell@citrix.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
In-Reply-To: <1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>, netdev@vger.kernel.org,
	Stefan Bader <stefan.bader@canonical.com>, xen-devel@lists.xen.org,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
	fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-20 19:40, Ian Campbell wrote:
> An SKB paged fragment can consist of a compound page with order>  0.
> However the netchannel protocol deals only in PAGE_SIZE frames.
>
> Handle this in xennet_make_frags by iterating over the frames which
> make up the page.
>
> This is the netfront equivalent to 6a8ed462f16b for netback.
>
> Signed-off-by: Ian Campbell<ian.campbell@citrix.com>
> Cc: netdev@vger.kernel.org
> Cc: xen-devel@lists.xen.org
> Cc: Eric Dumazet<edumazet@google.com>
> Cc: Konrad Rzeszutek Wilk<konrad@kernel.org>
> Cc: ANNIE LI<annie.li@oracle.com>
> Cc: Sander Eikelenboom<linux@eikelenboom.it>
> Cc: Stefan Bader<stefan.bader@canonical.com>
> ---
>   drivers/net/xen-netfront.c |   58 +++++++++++++++++++++++++++++++++----------
>   1 files changed, 44 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index caa0110..a12b99a 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -452,24 +452,54 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
>   	/* Grant backend access to each skb fragment page. */
>   	for (i = 0; i<  frags; i++) {
>   		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
> +		struct page *page = skb_frag_page(frag);
> +		unsigned long size = skb_frag_size(frag);
> +		unsigned long offset = frag->page_offset;

There are following definitions at the beginning of xennet_make_frags,

         unsigned int offset = offset_in_page(data);
         unsigned int len = skb_headlen(skb);

Is it better to reuse those definitions, and not define new size and 
offset again in this for loop? And unsigned int is enough here, right?

>
> -		tx->flags |= XEN_NETTXF_more_data;
> +		/* Data must not cross a page boundary. */
> +		BUG_ON(size + offset>  PAGE_SIZE<<compound_order(page));
>
> -		id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> -		np->tx_skbs[id].skb = skb_get(skb);
> -		tx = RING_GET_REQUEST(&np->tx, prod++);
> -		tx->id = id;
> -		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
> -		BUG_ON((signed short)ref<  0);
> +		/* Skip unused frames from start of page */
> +		page += offset>>  PAGE_SHIFT;
> +		offset&= ~PAGE_MASK;
>
> -		mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
> -		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> -						mfn, GNTMAP_readonly);
> +		while (size>  0) {
> +			unsigned long bytes;
>
> -		tx->gref = np->grant_tx_ref[id] = ref;
> -		tx->offset = frag->page_offset;
> -		tx->size = skb_frag_size(frag);
> -		tx->flags = 0;
> +			BUG_ON(offset>= PAGE_SIZE);
> +
> +			bytes = PAGE_SIZE - offset;
> +			if (bytes>  size)
> +				bytes = size;
> +
> +			tx->flags |= XEN_NETTXF_more_data;
> +
> +			id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
Over 80 characters?
> +			np->tx_skbs[id].skb = skb_get(skb);
> +			tx = RING_GET_REQUEST(&np->tx, prod++);
> +			tx->id = id;
> +			ref = gnttab_claim_grant_reference(&np->gref_tx_head);
> +			BUG_ON((signed short)ref<  0);
> +
> +			mfn = pfn_to_mfn(page_to_pfn(page));
> +			gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> +							mfn, GNTMAP_readonly);
Over 80 characters?

Thanks
Annie
> +
> +			tx->gref = np->grant_tx_ref[id] = ref;
> +			tx->offset = offset;
> +			tx->size = bytes;
> +			tx->flags = 0;
> +
> +			offset += bytes;
> +			size -= bytes;
> +
> +			/* Next frame */
> +			if (offset == PAGE_SIZE&&  size) {
> +				BUG_ON(!PageCompound(page));
> +				page++;
> +				offset = 0;
> +			}
> +		}
>   	}
>
>   	np->tx.req_prod_pvt = prod;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 02:53:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 02:53:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb0Qd-00029B-PD; Wed, 21 Nov 2012 02:52:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1Tb0Qc-000293-Ed
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 02:52:42 +0000
Received: from [85.158.139.83:21383] by server-8.bemta-5.messagelabs.com id
	99/F6-06050-9F14CA05; Wed, 21 Nov 2012 02:52:41 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1353466359!26586155!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3NjU3Nw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15294 invoked from network); 21 Nov 2012 02:52:40 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-6.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 21 Nov 2012 02:52:40 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAL2qToC005762
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 21 Nov 2012 02:52:30 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAL2qTuA012239
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Nov 2012 02:52:29 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAL2qS9q019913; Tue, 20 Nov 2012 20:52:28 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 20 Nov 2012 18:52:28 -0800
Message-ID: <50AC41F7.7080609@oracle.com>
Date: Wed, 21 Nov 2012 10:52:39 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <ian.campbell@citrix.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
In-Reply-To: <1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>, netdev@vger.kernel.org,
	Stefan Bader <stefan.bader@canonical.com>, xen-devel@lists.xen.org,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
	fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-20 19:40, Ian Campbell wrote:
> An SKB paged fragment can consist of a compound page with order>  0.
> However the netchannel protocol deals only in PAGE_SIZE frames.
>
> Handle this in xennet_make_frags by iterating over the frames which
> make up the page.
>
> This is the netfront equivalent to 6a8ed462f16b for netback.
>
> Signed-off-by: Ian Campbell<ian.campbell@citrix.com>
> Cc: netdev@vger.kernel.org
> Cc: xen-devel@lists.xen.org
> Cc: Eric Dumazet<edumazet@google.com>
> Cc: Konrad Rzeszutek Wilk<konrad@kernel.org>
> Cc: ANNIE LI<annie.li@oracle.com>
> Cc: Sander Eikelenboom<linux@eikelenboom.it>
> Cc: Stefan Bader<stefan.bader@canonical.com>
> ---
>   drivers/net/xen-netfront.c |   58 +++++++++++++++++++++++++++++++++----------
>   1 files changed, 44 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index caa0110..a12b99a 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -452,24 +452,54 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
>   	/* Grant backend access to each skb fragment page. */
>   	for (i = 0; i<  frags; i++) {
>   		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
> +		struct page *page = skb_frag_page(frag);
> +		unsigned long size = skb_frag_size(frag);
> +		unsigned long offset = frag->page_offset;

There are following definitions at the beginning of xennet_make_frags,

         unsigned int offset = offset_in_page(data);
         unsigned int len = skb_headlen(skb);

Is it better to reuse those definitions, and not define new size and 
offset again in this for loop? And unsigned int is enough here, right?

>
> -		tx->flags |= XEN_NETTXF_more_data;
> +		/* Data must not cross a page boundary. */
> +		BUG_ON(size + offset>  PAGE_SIZE<<compound_order(page));
>
> -		id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> -		np->tx_skbs[id].skb = skb_get(skb);
> -		tx = RING_GET_REQUEST(&np->tx, prod++);
> -		tx->id = id;
> -		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
> -		BUG_ON((signed short)ref<  0);
> +		/* Skip unused frames from start of page */
> +		page += offset>>  PAGE_SHIFT;
> +		offset&= ~PAGE_MASK;
>
> -		mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
> -		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> -						mfn, GNTMAP_readonly);
> +		while (size>  0) {
> +			unsigned long bytes;
>
> -		tx->gref = np->grant_tx_ref[id] = ref;
> -		tx->offset = frag->page_offset;
> -		tx->size = skb_frag_size(frag);
> -		tx->flags = 0;
> +			BUG_ON(offset>= PAGE_SIZE);
> +
> +			bytes = PAGE_SIZE - offset;
> +			if (bytes>  size)
> +				bytes = size;
> +
> +			tx->flags |= XEN_NETTXF_more_data;
> +
> +			id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
Over 80 characters?
> +			np->tx_skbs[id].skb = skb_get(skb);
> +			tx = RING_GET_REQUEST(&np->tx, prod++);
> +			tx->id = id;
> +			ref = gnttab_claim_grant_reference(&np->gref_tx_head);
> +			BUG_ON((signed short)ref<  0);
> +
> +			mfn = pfn_to_mfn(page_to_pfn(page));
> +			gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> +							mfn, GNTMAP_readonly);
Over 80 characters?

Thanks
Annie
> +
> +			tx->gref = np->grant_tx_ref[id] = ref;
> +			tx->offset = offset;
> +			tx->size = bytes;
> +			tx->flags = 0;
> +
> +			offset += bytes;
> +			size -= bytes;
> +
> +			/* Next frame */
> +			if (offset == PAGE_SIZE&&  size) {
> +				BUG_ON(!PageCompound(page));
> +				page++;
> +				offset = 0;
> +			}
> +		}
>   	}
>
>   	np->tx.req_prod_pvt = prod;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 03:08:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 03:08:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb0fP-0002PN-Bl; Wed, 21 Nov 2012 03:07:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Tb0fN-0002PI-RS
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 03:07:58 +0000
Received: from [193.109.254.147:59803] by server-7.bemta-14.messagelabs.com id
	AE/70-02272-D854CA05; Wed, 21 Nov 2012 03:07:57 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1353467275!9863595!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20705 invoked from network); 21 Nov 2012 03:07:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 03:07:55 -0000
X-IronPort-AV: E=Sophos;i="4.83,290,1352073600"; d="scan'208";a="15916291"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 03:07:54 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 21 Nov 2012 03:07:54 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1Tb0fK-0004dl-F4;
	Wed, 21 Nov 2012 03:07:54 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1Tb0fK-0000lr-Ee;
	Wed, 21 Nov 2012 03:07:54 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14455-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 21 Nov 2012 03:07:54 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14455: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14455 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14455/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14416
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14416
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14416
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14416

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  2489c2926698
baseline version:
 xen                  321f8487379b

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Wei Wang <wei.wang2@amd.com>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=2489c2926698
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 2489c2926698
+ branch=xen-unstable
+ revision=2489c2926698
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 2489c2926698 ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 20 changesets with 51 changes to 43 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 03:08:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 03:08:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb0fP-0002PN-Bl; Wed, 21 Nov 2012 03:07:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Tb0fN-0002PI-RS
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 03:07:58 +0000
Received: from [193.109.254.147:59803] by server-7.bemta-14.messagelabs.com id
	AE/70-02272-D854CA05; Wed, 21 Nov 2012 03:07:57 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1353467275!9863595!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20705 invoked from network); 21 Nov 2012 03:07:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 03:07:55 -0000
X-IronPort-AV: E=Sophos;i="4.83,290,1352073600"; d="scan'208";a="15916291"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 03:07:54 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 21 Nov 2012 03:07:54 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1Tb0fK-0004dl-F4;
	Wed, 21 Nov 2012 03:07:54 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1Tb0fK-0000lr-Ee;
	Wed, 21 Nov 2012 03:07:54 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14455-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 21 Nov 2012 03:07:54 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14455: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14455 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14455/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14416
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14416
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14416
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14416

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  2489c2926698
baseline version:
 xen                  321f8487379b

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Matthew Fioravante <matthew.fioravante@jhuapl.edu>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Wei Wang <wei.wang2@amd.com>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=2489c2926698
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 2489c2926698
+ branch=xen-unstable
+ revision=2489c2926698
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 2489c2926698 ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 20 changesets with 51 changes to 43 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 03:27:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 03:27:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb0yP-0003JJ-Ay; Wed, 21 Nov 2012 03:27:37 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <zpengxen@gmail.com>) id 1Tb0yO-0003JE-0R
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 03:27:36 +0000
Received: from [193.109.254.147:56042] by server-6.bemta-14.messagelabs.com id
	5E/D8-02788-72A4CA05; Wed, 21 Nov 2012 03:27:35 +0000
X-Env-Sender: zpengxen@gmail.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353468453!11747909!1
X-Originating-IP: [209.85.223.171]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1090 invoked from network); 21 Nov 2012 03:27:34 -0000
Received: from mail-ie0-f171.google.com (HELO mail-ie0-f171.google.com)
	(209.85.223.171)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 03:27:34 -0000
Received: by mail-ie0-f171.google.com with SMTP id 17so5311801iea.30
	for <xen-devel@lists.xensource.com>;
	Tue, 20 Nov 2012 19:27:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=JEWqtoakR38kQZkUVcnfAUk8kKnTt6elMO/vAsnAUUE=;
	b=Up+AweQXQ8OHL3rysTa7myXPLagIDCsWTdvouSEIvJM2gbvHBawGFxol5x2tCbLrGB
	EVeYBMS4gQGpo9AHCmMdSnmuMMNRqJ6lXwE8J1WwXkTuuwKtClGAcGwaE6Pod3FyvqHO
	n7mUxeFv3rbMlRdIwOwXKE2lcH/947BO7rRALglpYvzC0MiCKj6ePU3UlEotQjkX1k23
	LNWIS358ahdJvPn8BmizXa1EBol6OCPeY35SOS9UQChoAo6dhIKTWzXtgXVv7crSuAx+
	SmIONU9O79XFv+WhjgcABFOZPBqoTW5gvavp9pHvxDbANG1CANOw4urmKhNbQvtIIuu2
	v5Gg==
MIME-Version: 1.0
Received: by 10.50.195.196 with SMTP id ig4mr12457568igc.33.1353468453050;
	Tue, 20 Nov 2012 19:27:33 -0800 (PST)
Received: by 10.50.236.104 with HTTP; Tue, 20 Nov 2012 19:27:32 -0800 (PST)
In-Reply-To: <1353325039.18229.49.camel@zakaz.uk.xensource.com>
References: <CAAh7U5MHRnwwK-X==Hh7F2uy94i4yYU3oFFQEesowUtPQGf6Eg@mail.gmail.com>
	<1338987918.32319.84.camel@zakaz.uk.xensource.com>
	<CAAh7U5PYuJJcrAVCzVPLR0vZ1PLpS5mNqsrBmToTsm2KW46_wQ@mail.gmail.com>
	<1339049291.6557.11.camel@dagon.hellion.org.uk>
	<CAAh7U5O2FCeT7Mzp5KNkxqcX5B037YUmqef=TJTrQ9b=JgsHZA@mail.gmail.com>
	<1341325462.21547.20.camel@zakaz.uk.xensource.com>
	<CAFLBxZZfh0eXszeVvZ6WYDuGV6cDcvcgpOByf8FWz9EOvOUorQ@mail.gmail.com>
	<CAAh7U5PBASWB6Y6P-Sz3yg2Z1xv-JYAMtFSYGWe=3oov3h32dQ@mail.gmail.com>
	<CAAh7U5MMmAz047KzHVMRkUF=hGZKGfDfM1KM41jF8g6bZAXq7g@mail.gmail.com>
	<508559E8.10102@eu.citrix.com>
	<CAAh7U5PjF7c3mg3C7WZ2uphZaYLRTzwphiobDG+t-2Q-BpnTKQ@mail.gmail.com>
	<1353325039.18229.49.camel@zakaz.uk.xensource.com>
Date: Wed, 21 Nov 2012 11:27:32 +0800
Message-ID: <CAAh7U5NM5aPcXdJAC53romAQQ2_yQaiEpJQyhi0fTEFRaWUsCA@mail.gmail.com>
From: ZhouPeng <zpengxen@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"Xen-Devel \(E-mail\)" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 2/3] tools:libxl: Add qxl vga interface
 support v2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 19, 2012 at 7:37 PM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Wed, 2012-10-24 at 09:06 +0100, ZhouPeng wrote:
>
>> >> +For B<qxl> option, the default is 128MB. If B<videoram> is set greater
>> >> +than 128MB, it will be trimmed to 128MB; if set less than 128MB, an
>> >> +error will be triggered.
>> >
>> >
>> > Is this a fixed value in qemu, or is this something that can be changed via
>> > the command-line?
>> Can be changed.
>>
>> But Ian Campbell and me have talked on sth related with this
>> closely before. And we both agree to just support the default is
>> enough in most time. You can get it from the url below quickly, pls
>> read from bottom up, which can save time.
>>
>> http://lists.xen.org/archives/html/xen-devel/2012-07/msg00098.html
>
> We discussed what to do if the supplied value was too small but I don't
> recall this behaviour of clamping a value which is larger to a specific
> value.

I think, the key idea is just to support the default for qxl (128Mib)
in the discussion.
videoram is not designed for qxl video ram.
> If we reject values which are <128M, and clamp anything which is >128M
> to 128M then what is the point of the option?

This piece of code doesn't mean to use videoram option to assign memory for qxl.
Because videoram option comes in Xen before qxl, it need to be consided here.

v2 gives user the chance to assign memory for qxl.
>
> Ian.

-- 
Zhou Peng

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 03:27:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 03:27:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb0yP-0003JJ-Ay; Wed, 21 Nov 2012 03:27:37 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <zpengxen@gmail.com>) id 1Tb0yO-0003JE-0R
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 03:27:36 +0000
Received: from [193.109.254.147:56042] by server-6.bemta-14.messagelabs.com id
	5E/D8-02788-72A4CA05; Wed, 21 Nov 2012 03:27:35 +0000
X-Env-Sender: zpengxen@gmail.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353468453!11747909!1
X-Originating-IP: [209.85.223.171]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1090 invoked from network); 21 Nov 2012 03:27:34 -0000
Received: from mail-ie0-f171.google.com (HELO mail-ie0-f171.google.com)
	(209.85.223.171)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 03:27:34 -0000
Received: by mail-ie0-f171.google.com with SMTP id 17so5311801iea.30
	for <xen-devel@lists.xensource.com>;
	Tue, 20 Nov 2012 19:27:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=JEWqtoakR38kQZkUVcnfAUk8kKnTt6elMO/vAsnAUUE=;
	b=Up+AweQXQ8OHL3rysTa7myXPLagIDCsWTdvouSEIvJM2gbvHBawGFxol5x2tCbLrGB
	EVeYBMS4gQGpo9AHCmMdSnmuMMNRqJ6lXwE8J1WwXkTuuwKtClGAcGwaE6Pod3FyvqHO
	n7mUxeFv3rbMlRdIwOwXKE2lcH/947BO7rRALglpYvzC0MiCKj6ePU3UlEotQjkX1k23
	LNWIS358ahdJvPn8BmizXa1EBol6OCPeY35SOS9UQChoAo6dhIKTWzXtgXVv7crSuAx+
	SmIONU9O79XFv+WhjgcABFOZPBqoTW5gvavp9pHvxDbANG1CANOw4urmKhNbQvtIIuu2
	v5Gg==
MIME-Version: 1.0
Received: by 10.50.195.196 with SMTP id ig4mr12457568igc.33.1353468453050;
	Tue, 20 Nov 2012 19:27:33 -0800 (PST)
Received: by 10.50.236.104 with HTTP; Tue, 20 Nov 2012 19:27:32 -0800 (PST)
In-Reply-To: <1353325039.18229.49.camel@zakaz.uk.xensource.com>
References: <CAAh7U5MHRnwwK-X==Hh7F2uy94i4yYU3oFFQEesowUtPQGf6Eg@mail.gmail.com>
	<1338987918.32319.84.camel@zakaz.uk.xensource.com>
	<CAAh7U5PYuJJcrAVCzVPLR0vZ1PLpS5mNqsrBmToTsm2KW46_wQ@mail.gmail.com>
	<1339049291.6557.11.camel@dagon.hellion.org.uk>
	<CAAh7U5O2FCeT7Mzp5KNkxqcX5B037YUmqef=TJTrQ9b=JgsHZA@mail.gmail.com>
	<1341325462.21547.20.camel@zakaz.uk.xensource.com>
	<CAFLBxZZfh0eXszeVvZ6WYDuGV6cDcvcgpOByf8FWz9EOvOUorQ@mail.gmail.com>
	<CAAh7U5PBASWB6Y6P-Sz3yg2Z1xv-JYAMtFSYGWe=3oov3h32dQ@mail.gmail.com>
	<CAAh7U5MMmAz047KzHVMRkUF=hGZKGfDfM1KM41jF8g6bZAXq7g@mail.gmail.com>
	<508559E8.10102@eu.citrix.com>
	<CAAh7U5PjF7c3mg3C7WZ2uphZaYLRTzwphiobDG+t-2Q-BpnTKQ@mail.gmail.com>
	<1353325039.18229.49.camel@zakaz.uk.xensource.com>
Date: Wed, 21 Nov 2012 11:27:32 +0800
Message-ID: <CAAh7U5NM5aPcXdJAC53romAQQ2_yQaiEpJQyhi0fTEFRaWUsCA@mail.gmail.com>
From: ZhouPeng <zpengxen@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"Xen-Devel \(E-mail\)" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 2/3] tools:libxl: Add qxl vga interface
 support v2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 19, 2012 at 7:37 PM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Wed, 2012-10-24 at 09:06 +0100, ZhouPeng wrote:
>
>> >> +For B<qxl> option, the default is 128MB. If B<videoram> is set greater
>> >> +than 128MB, it will be trimmed to 128MB; if set less than 128MB, an
>> >> +error will be triggered.
>> >
>> >
>> > Is this a fixed value in qemu, or is this something that can be changed via
>> > the command-line?
>> Can be changed.
>>
>> But Ian Campbell and me have talked on sth related with this
>> closely before. And we both agree to just support the default is
>> enough in most time. You can get it from the url below quickly, pls
>> read from bottom up, which can save time.
>>
>> http://lists.xen.org/archives/html/xen-devel/2012-07/msg00098.html
>
> We discussed what to do if the supplied value was too small but I don't
> recall this behaviour of clamping a value which is larger to a specific
> value.

I think, the key idea is just to support the default for qxl (128Mib)
in the discussion.
videoram is not designed for qxl video ram.
> If we reject values which are <128M, and clamp anything which is >128M
> to 128M then what is the point of the option?

This piece of code doesn't mean to use videoram option to assign memory for qxl.
Because videoram option comes in Xen before qxl, it need to be consided here.

v2 gives user the chance to assign memory for qxl.
>
> Ian.

-- 
Zhou Peng

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 07:41:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 07:41:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb4vm-00070i-1p; Wed, 21 Nov 2012 07:41:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Tb4vk-00070a-0O
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 07:41:08 +0000
Received: from [85.158.143.35:31364] by server-2.bemta-4.messagelabs.com id
	22/29-28922-3958CA05; Wed, 21 Nov 2012 07:41:07 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1353483666!18631719!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12226 invoked from network); 21 Nov 2012 07:41:06 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 07:41:06 -0000
X-IronPort-AV: E=Sophos;i="4.83,291,1352073600"; d="scan'208";a="15918066"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 07:41:05 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 21 Nov 2012 07:41:05 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1Tb4vh-00066i-Jh;
	Wed, 21 Nov 2012 07:41:05 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1Tb4vh-0000PY-9T;
	Wed, 21 Nov 2012 07:41:05 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14462-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 21 Nov 2012 07:41:05 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14462: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14462 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14462/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-xl-win-vcpus1 12 guest-localmigrate/x10     fail pass in 14455
 test-amd64-i386-win-vcpus1    7 windows-install             fail pass in 14455

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14455
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14455
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14455
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14455

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop           fail in 14455 never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check      fail in 14455 never pass

version targeted for testing:
 xen                  2489c2926698
baseline version:
 xen                  2489c2926698

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 07:41:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 07:41:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb4vm-00070i-1p; Wed, 21 Nov 2012 07:41:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Tb4vk-00070a-0O
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 07:41:08 +0000
Received: from [85.158.143.35:31364] by server-2.bemta-4.messagelabs.com id
	22/29-28922-3958CA05; Wed, 21 Nov 2012 07:41:07 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1353483666!18631719!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12226 invoked from network); 21 Nov 2012 07:41:06 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 07:41:06 -0000
X-IronPort-AV: E=Sophos;i="4.83,291,1352073600"; d="scan'208";a="15918066"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 07:41:05 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 21 Nov 2012 07:41:05 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1Tb4vh-00066i-Jh;
	Wed, 21 Nov 2012 07:41:05 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1Tb4vh-0000PY-9T;
	Wed, 21 Nov 2012 07:41:05 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14462-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 21 Nov 2012 07:41:05 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14462: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14462 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14462/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-xl-win-vcpus1 12 guest-localmigrate/x10     fail pass in 14455
 test-amd64-i386-win-vcpus1    7 windows-install             fail pass in 14455

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14455
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14455
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14455
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14455

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop           fail in 14455 never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check      fail in 14455 never pass

version targeted for testing:
 xen                  2489c2926698
baseline version:
 xen                  2489c2926698

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 08:21:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 08:21:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb5Yr-0008EC-Ic; Wed, 21 Nov 2012 08:21:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb5Yp-0008E7-Vp
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 08:21:32 +0000
Received: from [85.158.143.35:19614] by server-2.bemta-4.messagelabs.com id
	DE/41-28922-B0F8CA05; Wed, 21 Nov 2012 08:21:31 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1353486010!8149122!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6226 invoked from network); 21 Nov 2012 08:20:10 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-21.messagelabs.com with SMTP;
	21 Nov 2012 08:20:10 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 08:20:09 +0000
Message-Id: <50AC9CFF02000078000AA43C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 08:21:03 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <748aba10-531a-4ad5-bad3-7af0f86c0489@default>
In-Reply-To: <748aba10-531a-4ad5-bad3-7af0f86c0489@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Wilk <konrad.wilk@oracle.com>, linux-kernel@vger.kernel.org,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: tmem: selfballooning should be enabled
 when xen tmem is enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 23:42, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> Konrad: Any chance this can get in for the upcoming window?
> (Or is it enough of a bug fix that it can go in at an -rcN?)
> 
> It was just pointed out to me that some kernels have
> cleancache and frontswap and xen_tmem enabled but NOT
> xen_selfballooning!  While this configuration should be
> possible, nearly all kernels that have CONFIG_XEN_TMEM=y should
> also have CONFIG_XEN_SELFBALLOONING=y, since Transcendent
> Memory (tmem) for Xen has very limited value without
> selfballooning.
> 
> This is probably a result of a Kconfig mistake fixed I think
> by the patch below.  Note that the year-old Oracle UEK2 kernel
> distro has both CONFIG_XEN_TMEM and CONFIG_XEN_SELFBALLOONING
> enabled, as does a Fedora 17 kernel update (3.6.6-1.fc17), so
> the combination should be well tested.  Also, Xen tmem (and thus
> selfballooning) are currently only enabled when a kernel boot
> parameter is supplied so there is no runtime impact without
> that boot parameter.
> 
> Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
> 
> diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
> index d4dffcd..b5f02f3 100644
> --- a/drivers/xen/Kconfig
> +++ b/drivers/xen/Kconfig
> @@ -10,9 +10,9 @@ config XEN_BALLOON
>  	  return unneeded memory to the system.
>  
>  config XEN_SELFBALLOONING
> -	bool "Dynamically self-balloon kernel memory to target"

Why would you want to take away the configurability of this?
You wanting it always on in your use case doesn't mean everyone
agrees. This would be the right way only when the option being
off despite all its dependencies being enabled is actively wrong.

> -	depends on XEN && XEN_BALLOON && CLEANCACHE && SWAP && XEN_TMEM
> -	default n
> +	bool
> +	depends on XEN_BALLOON && SWAP
> +	default y if XEN_TMEM

Changing the default, otoh, is certainly acceptable. However, this
should imo be (assuming that you dropped the CLEANCACHE
dependency for an unrelated [and unexplained] reason),

	depends on XEN_BALLOON && SWAP && XEN_TMEM
	default XEN_TMEM

i.e. the default selection can be simplified, but if you indeed
have a good reason to drop the prompt, the
dependencies should continue to include the symbol referenced
by the default directive, as otherwise you may end up with a
.config pointlessly having

# CONFIG_XEN_SELFBALLOONING is disabled. This is particularly
annoying when subsequently this gets a prompt re-added, since
at that point a "make oldconfig" won't ask for the item to get
possibly enabled as there is a value known for it already.

>  	help
>  	  Self-ballooning dynamically balloons available kernel memory driven
>  	  by the current usage of anonymous memory ("committed AS") and

If you take away the prompt, keeping the help text isn't useful
either.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 08:21:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 08:21:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb5Yr-0008EC-Ic; Wed, 21 Nov 2012 08:21:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb5Yp-0008E7-Vp
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 08:21:32 +0000
Received: from [85.158.143.35:19614] by server-2.bemta-4.messagelabs.com id
	DE/41-28922-B0F8CA05; Wed, 21 Nov 2012 08:21:31 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1353486010!8149122!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6226 invoked from network); 21 Nov 2012 08:20:10 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-21.messagelabs.com with SMTP;
	21 Nov 2012 08:20:10 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 08:20:09 +0000
Message-Id: <50AC9CFF02000078000AA43C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 08:21:03 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <748aba10-531a-4ad5-bad3-7af0f86c0489@default>
In-Reply-To: <748aba10-531a-4ad5-bad3-7af0f86c0489@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Wilk <konrad.wilk@oracle.com>, linux-kernel@vger.kernel.org,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: tmem: selfballooning should be enabled
 when xen tmem is enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 23:42, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> Konrad: Any chance this can get in for the upcoming window?
> (Or is it enough of a bug fix that it can go in at an -rcN?)
> 
> It was just pointed out to me that some kernels have
> cleancache and frontswap and xen_tmem enabled but NOT
> xen_selfballooning!  While this configuration should be
> possible, nearly all kernels that have CONFIG_XEN_TMEM=y should
> also have CONFIG_XEN_SELFBALLOONING=y, since Transcendent
> Memory (tmem) for Xen has very limited value without
> selfballooning.
> 
> This is probably a result of a Kconfig mistake fixed I think
> by the patch below.  Note that the year-old Oracle UEK2 kernel
> distro has both CONFIG_XEN_TMEM and CONFIG_XEN_SELFBALLOONING
> enabled, as does a Fedora 17 kernel update (3.6.6-1.fc17), so
> the combination should be well tested.  Also, Xen tmem (and thus
> selfballooning) are currently only enabled when a kernel boot
> parameter is supplied so there is no runtime impact without
> that boot parameter.
> 
> Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
> 
> diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
> index d4dffcd..b5f02f3 100644
> --- a/drivers/xen/Kconfig
> +++ b/drivers/xen/Kconfig
> @@ -10,9 +10,9 @@ config XEN_BALLOON
>  	  return unneeded memory to the system.
>  
>  config XEN_SELFBALLOONING
> -	bool "Dynamically self-balloon kernel memory to target"

Why would you want to take away the configurability of this?
You wanting it always on in your use case doesn't mean everyone
agrees. This would be the right way only when the option being
off despite all its dependencies being enabled is actively wrong.

> -	depends on XEN && XEN_BALLOON && CLEANCACHE && SWAP && XEN_TMEM
> -	default n
> +	bool
> +	depends on XEN_BALLOON && SWAP
> +	default y if XEN_TMEM

Changing the default, otoh, is certainly acceptable. However, this
should imo be (assuming that you dropped the CLEANCACHE
dependency for an unrelated [and unexplained] reason),

	depends on XEN_BALLOON && SWAP && XEN_TMEM
	default XEN_TMEM

i.e. the default selection can be simplified, but if you indeed
have a good reason to drop the prompt, the
dependencies should continue to include the symbol referenced
by the default directive, as otherwise you may end up with a
.config pointlessly having

# CONFIG_XEN_SELFBALLOONING is disabled. This is particularly
annoying when subsequently this gets a prompt re-added, since
at that point a "make oldconfig" won't ask for the item to get
possibly enabled as there is a value known for it already.

>  	help
>  	  Self-ballooning dynamically balloons available kernel memory driven
>  	  by the current usage of anonymous memory ("committed AS") and

If you take away the prompt, keeping the help text isn't useful
either.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 08:31:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 08:31:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb5hf-0008O5-S9; Wed, 21 Nov 2012 08:30:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb5he-0008O0-P8
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 08:30:39 +0000
Received: from [85.158.139.83:24000] by server-11.bemta-5.messagelabs.com id
	E8/AD-03409-D219CA05; Wed, 21 Nov 2012 08:30:37 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1353486637!30669233!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6189 invoked from network); 21 Nov 2012 08:30:37 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 08:30:37 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 08:30:35 +0000
Message-Id: <50AC9F7302000078000AA44A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 08:31:31 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
	<1353062895.3499.205.camel@zakaz.uk.xensource.com>
	<ea33a942-7e63-4339-85c6-35935ae5119b@default>
	<50AB4A8602000078000A9E10@nat28.tlf.novell.com>
	<1353406581.13542.13.camel@zakaz.uk.xensource.com>
	<1bc66c5f-1740-411f-9be2-3de26372b469@default>
	<20121120164744.GA46858@ocelot.phlegethon.org>
	<47fef645-2fc9-4039-86da-13874fbef552@default>
In-Reply-To: <47fef645-2fc9-4039-86da-13874fbef552@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, Tim Deegan <tim@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	ZhigangWang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 18:52, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  From: Tim Deegan [mailto:tim@xen.org]
>> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of 
> existing) hypercall
>> 
>> At 08:33 -0800 on 20 Nov (1353400380), Dan Magenheimer wrote:
>> > I agree it's possible, just saying it's not trivial... one has to
>> > account not only for superpages system-wide (which isn't currently
>> > done) but a mix of unclaimed superpages and unclaimed order==0 pages
>> > per-domain.  Especially since that would improve launch of only a small
>> > and shrinking class of domains (PV && superpages=1 && mem="huge"),
>> > can we please consider it a possible future enhancement, not a showstopper?
>> 
>> Please, no.  Either you need this benighted hypercall, or you don't.
>> If you really need it, do it properly.
> 
> Hi Tim --
> 
> I must respectfully disagree.
> 
> For years, Xen has been accepting features that work on a 64-bit
> hypervisor but not on a 32-bit hypervisor.  And new features such
> as memory-sharing/paging _could_ be designed to help PV domains and
> have completely ignored PV but have still been accepted.  There is
> clearly precedent for new features that don't enhance every
> possible case.
> 
> The claim feature dramatically decreases a real customer problem in
> the vast majority of our customer environments with no loss of
> functionality in the small remaining percentage.  This real problem
> is getting continually worse as system physical RAM and domain memory
> requirements increase.  So, yes, _we_ do need it.

A meaningful difference is that those other features have tools
side users, while you add (from the perspective of the Xen tree)
dead code. That is, it wouldn't have any chance of getting checked
for correctness when committed (other than for not breaking
existing code), and it will bit rot pretty quickly. Or did you mean
to supply tools side integration before expecting this to be
considered for applying?

In any case, while the hypervisor side changes look acceptable,
I'm afraid that without (mostly) convincing (almost) all of the
maintainers, there's no perspective of this getting committed.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 08:31:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 08:31:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb5hf-0008O5-S9; Wed, 21 Nov 2012 08:30:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb5he-0008O0-P8
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 08:30:39 +0000
Received: from [85.158.139.83:24000] by server-11.bemta-5.messagelabs.com id
	E8/AD-03409-D219CA05; Wed, 21 Nov 2012 08:30:37 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1353486637!30669233!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6189 invoked from network); 21 Nov 2012 08:30:37 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 08:30:37 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 08:30:35 +0000
Message-Id: <50AC9F7302000078000AA44A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 08:31:31 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
	<1353062895.3499.205.camel@zakaz.uk.xensource.com>
	<ea33a942-7e63-4339-85c6-35935ae5119b@default>
	<50AB4A8602000078000A9E10@nat28.tlf.novell.com>
	<1353406581.13542.13.camel@zakaz.uk.xensource.com>
	<1bc66c5f-1740-411f-9be2-3de26372b469@default>
	<20121120164744.GA46858@ocelot.phlegethon.org>
	<47fef645-2fc9-4039-86da-13874fbef552@default>
In-Reply-To: <47fef645-2fc9-4039-86da-13874fbef552@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, Tim Deegan <tim@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	ZhigangWang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 18:52, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  From: Tim Deegan [mailto:tim@xen.org]
>> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of 
> existing) hypercall
>> 
>> At 08:33 -0800 on 20 Nov (1353400380), Dan Magenheimer wrote:
>> > I agree it's possible, just saying it's not trivial... one has to
>> > account not only for superpages system-wide (which isn't currently
>> > done) but a mix of unclaimed superpages and unclaimed order==0 pages
>> > per-domain.  Especially since that would improve launch of only a small
>> > and shrinking class of domains (PV && superpages=1 && mem="huge"),
>> > can we please consider it a possible future enhancement, not a showstopper?
>> 
>> Please, no.  Either you need this benighted hypercall, or you don't.
>> If you really need it, do it properly.
> 
> Hi Tim --
> 
> I must respectfully disagree.
> 
> For years, Xen has been accepting features that work on a 64-bit
> hypervisor but not on a 32-bit hypervisor.  And new features such
> as memory-sharing/paging _could_ be designed to help PV domains and
> have completely ignored PV but have still been accepted.  There is
> clearly precedent for new features that don't enhance every
> possible case.
> 
> The claim feature dramatically decreases a real customer problem in
> the vast majority of our customer environments with no loss of
> functionality in the small remaining percentage.  This real problem
> is getting continually worse as system physical RAM and domain memory
> requirements increase.  So, yes, _we_ do need it.

A meaningful difference is that those other features have tools
side users, while you add (from the perspective of the Xen tree)
dead code. That is, it wouldn't have any chance of getting checked
for correctness when committed (other than for not breaking
existing code), and it will bit rot pretty quickly. Or did you mean
to supply tools side integration before expecting this to be
considered for applying?

In any case, while the hypervisor side changes look acceptable,
I'm afraid that without (mostly) convincing (almost) all of the
maintainers, there's no perspective of this getting committed.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 08:35:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 08:35:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb5lu-00008a-LX; Wed, 21 Nov 2012 08:35:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb5ls-00008R-NB
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 08:35:00 +0000
Received: from [85.158.137.99:59564] by server-3.bemta-3.messagelabs.com id
	65/B3-31566-3329CA05; Wed, 21 Nov 2012 08:34:59 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1353486892!16835364!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20233 invoked from network); 21 Nov 2012 08:34:53 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-217.messagelabs.com with SMTP;
	21 Nov 2012 08:34:53 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 08:34:52 +0000
Message-Id: <50ACA07202000078000AA45E@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 08:35:46 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <9758ec2d-1d62-4426-ba59-204bed3acf6d@default>
In-Reply-To: <9758ec2d-1d62-4426-ba59-204bed3acf6d@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	KonradWilk <konrad.wilk@oracle.com>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v6 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 18:04, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> This is patch 1of2 of a sixth cut of the patch of the proposed
> XENMEM_claim_pages hypercall/subop, taking into account review
> feedback from Jan and Keir and IanC and Matthew Daley, plus some
> fixes found via runtime debugging (using printk and privcmd only).
> 
> v5->v6:
> - Fix post-inc problem [mattjd]

I continue to miss an expiry mechanism for claims; as said before
I don't think these should be held indefinitely.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 08:35:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 08:35:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb5lu-00008a-LX; Wed, 21 Nov 2012 08:35:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb5ls-00008R-NB
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 08:35:00 +0000
Received: from [85.158.137.99:59564] by server-3.bemta-3.messagelabs.com id
	65/B3-31566-3329CA05; Wed, 21 Nov 2012 08:34:59 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1353486892!16835364!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20233 invoked from network); 21 Nov 2012 08:34:53 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-217.messagelabs.com with SMTP;
	21 Nov 2012 08:34:53 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 08:34:52 +0000
Message-Id: <50ACA07202000078000AA45E@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 08:35:46 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <9758ec2d-1d62-4426-ba59-204bed3acf6d@default>
In-Reply-To: <9758ec2d-1d62-4426-ba59-204bed3acf6d@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	KonradWilk <konrad.wilk@oracle.com>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v6 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 20.11.12 at 18:04, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> This is patch 1of2 of a sixth cut of the patch of the proposed
> XENMEM_claim_pages hypercall/subop, taking into account review
> feedback from Jan and Keir and IanC and Matthew Daley, plus some
> fixes found via runtime debugging (using printk and privcmd only).
> 
> v5->v6:
> - Fix post-inc problem [mattjd]

I continue to miss an expiry mechanism for claims; as said before
I don't think these should be held indefinitely.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 08:37:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 08:37:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb5oA-0000FH-7u; Wed, 21 Nov 2012 08:37:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb5o9-0000F9-06
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 08:37:21 +0000
Received: from [85.158.139.83:13012] by server-16.bemta-5.messagelabs.com id
	EA/24-04786-FB29CA05; Wed, 21 Nov 2012 08:37:19 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1353487033!22617214!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11041 invoked from network); 21 Nov 2012 08:37:13 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 08:37:13 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 08:37:12 +0000
Message-Id: <50ACA0FF02000078000AA461@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 08:38:07 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mukesh Rathor" <mukesh.rathor@oracle.com>
References: <20121120182636.3879564a@mantra.us.oracle.com>
In-Reply-To: <20121120182636.3879564a@mantra.us.oracle.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>, IanCampbell <Ian.Campbell@citrix.com>,
	"stefano.stabellini@eu.citrix.com" <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] PVH:  domain creations...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 21.11.12 at 03:26, Mukesh Rathor <mukesh.rathor@oracle.com> wrote:
>  1. I suppose in XEN_DOMCTL_createdomain in xen: I could just see if
>  it's PV guest with HAP, ie, 
>        if (~XEN_DOMCTL_CDF_hvm_guest && XEN_DOMCTL_CDF_hap)
>             then domcr_flags |= DOMCRF_pvh;
> 
>    This would result in elimination of XEN_DOMCTL_CDF_pvh_guest flag.
>    What do you think?

Sounds plausible to me.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 08:37:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 08:37:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb5oA-0000FH-7u; Wed, 21 Nov 2012 08:37:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb5o9-0000F9-06
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 08:37:21 +0000
Received: from [85.158.139.83:13012] by server-16.bemta-5.messagelabs.com id
	EA/24-04786-FB29CA05; Wed, 21 Nov 2012 08:37:19 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1353487033!22617214!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11041 invoked from network); 21 Nov 2012 08:37:13 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 08:37:13 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 08:37:12 +0000
Message-Id: <50ACA0FF02000078000AA461@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 08:38:07 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mukesh Rathor" <mukesh.rathor@oracle.com>
References: <20121120182636.3879564a@mantra.us.oracle.com>
In-Reply-To: <20121120182636.3879564a@mantra.us.oracle.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>, IanCampbell <Ian.Campbell@citrix.com>,
	"stefano.stabellini@eu.citrix.com" <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] PVH:  domain creations...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 21.11.12 at 03:26, Mukesh Rathor <mukesh.rathor@oracle.com> wrote:
>  1. I suppose in XEN_DOMCTL_createdomain in xen: I could just see if
>  it's PV guest with HAP, ie, 
>        if (~XEN_DOMCTL_CDF_hvm_guest && XEN_DOMCTL_CDF_hap)
>             then domcr_flags |= DOMCRF_pvh;
> 
>    This would result in elimination of XEN_DOMCTL_CDF_pvh_guest flag.
>    What do you think?

Sounds plausible to me.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 10:06:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:06:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7Bt-0001Ly-34; Wed, 21 Nov 2012 10:05:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb7Br-0001Lt-Ns
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 10:05:55 +0000
Received: from [85.158.143.99:33063] by server-3.bemta-4.messagelabs.com id
	8C/28-06841-287ACA05; Wed, 21 Nov 2012 10:05:54 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1353492352!25507574!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10140 invoked from network); 21 Nov 2012 10:05:53 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-216.messagelabs.com with SMTP;
	21 Nov 2012 10:05:53 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 10:05:51 +0000
Message-Id: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 10:06:46 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: [Xen-devel] [PATCH 0/5] HPET and IOMMU adjustments
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The first three patches complete the 'M' debug key output, to
also include MSIs from HPET and IOMMUs.

The remaining two patched are logically unrelated, but apply only
on top of the earlier ones.

1: x86/HPET: include FSB interrupt information in 'M' debug key output
2: VT-d: include IOMMU interrupt information in 'M' debug key output
3: AMD IOMMU: include IOMMU interrupt information in 'M' debug key output
4: x86/HPET: fix FSB interrupt masking
5: VT-d: adjust IOMMU interrupt affinities when all CPUs are online

Signed-off-by: Jan Beulich <jbeulich@suse.com>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 10:06:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:06:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7Bt-0001Ly-34; Wed, 21 Nov 2012 10:05:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb7Br-0001Lt-Ns
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 10:05:55 +0000
Received: from [85.158.143.99:33063] by server-3.bemta-4.messagelabs.com id
	8C/28-06841-287ACA05; Wed, 21 Nov 2012 10:05:54 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1353492352!25507574!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10140 invoked from network); 21 Nov 2012 10:05:53 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-216.messagelabs.com with SMTP;
	21 Nov 2012 10:05:53 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 10:05:51 +0000
Message-Id: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 10:06:46 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: [Xen-devel] [PATCH 0/5] HPET and IOMMU adjustments
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The first three patches complete the 'M' debug key output, to
also include MSIs from HPET and IOMMUs.

The remaining two patched are logically unrelated, but apply only
on top of the earlier ones.

1: x86/HPET: include FSB interrupt information in 'M' debug key output
2: VT-d: include IOMMU interrupt information in 'M' debug key output
3: AMD IOMMU: include IOMMU interrupt information in 'M' debug key output
4: x86/HPET: fix FSB interrupt masking
5: VT-d: adjust IOMMU interrupt affinities when all CPUs are online

Signed-off-by: Jan Beulich <jbeulich@suse.com>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 10:16:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:16:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7L7-0001Yk-8x; Wed, 21 Nov 2012 10:15:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb7L5-0001Yf-Tz
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 10:15:28 +0000
Received: from [85.158.139.83:46724] by server-9.bemta-5.messagelabs.com id
	87/95-29295-FB9ACA05; Wed, 21 Nov 2012 10:15:27 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1353492925!22635863!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24435 invoked from network); 21 Nov 2012 10:15:25 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 10:15:25 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 10:15:24 +0000
Message-Id: <50ACB80302000078000AA494@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 10:16:19 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
In-Reply-To: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartDEEF2FE3.3__="
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: [Xen-devel] [PATCH 1/5] x86/HPET: include FSB interrupt information
 in 'M' debug key output
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartDEEF2FE3.3__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -239,6 +239,7 @@ static void hpet_msi_unmask(struct irq_d
     cfg =3D hpet_read32(HPET_Tn_CFG(ch->idx));
     cfg |=3D HPET_TN_FSB;
     hpet_write32(cfg, HPET_Tn_CFG(ch->idx));
+    ch->msi.msi_attrib.masked =3D 0;
 }
=20
 static void hpet_msi_mask(struct irq_desc *desc)
@@ -249,6 +250,7 @@ static void hpet_msi_mask(struct irq_des
     cfg =3D hpet_read32(HPET_Tn_CFG(ch->idx));
     cfg &=3D ~HPET_TN_FSB;
     hpet_write32(cfg, HPET_Tn_CFG(ch->idx));
+    ch->msi.msi_attrib.masked =3D 1;
 }
=20
 static void hpet_msi_write(struct hpet_event_channel *ch, struct msi_msg =
*msg)
@@ -346,6 +348,7 @@ static int __init hpet_setup_msi_irq(str
     }
=20
     __hpet_setup_msi_irq(desc);
+    desc->msi_desc =3D &ch->msi;
=20
     return 0;
 }
@@ -390,6 +393,17 @@ static void __init hpet_fsb_cap_lookup(v
         if ( !(cfg & HPET_TN_FSB_CAP) )
             continue;
=20
+        /* hpet_setup(), via hpet_resume(), attempted to clear HPET_TN_FSB=
, so
+         * if it is still set... */
+        if ( !(cfg & HPET_TN_FSB) )
+            ch->msi.msi_attrib.maskbit =3D 1;
+        else
+        {
+            ch->msi.msi_attrib.maskbit =3D 0;
+            printk(XENLOG_WARNING "HPET: channel %u is not maskable =
(%04x)\n",
+                   i, cfg);
+        }
+
         if ( !zalloc_cpumask_var(&ch->cpumask) )
         {
             if ( !num_hpets_used )
@@ -573,6 +587,8 @@ void __init hpet_broadcast_init(void)
         spin_lock_init(&hpet_events[i].lock);
         wmb();
         hpet_events[i].event_handler =3D handle_hpet_broadcast;
+
+        hpet_events[i].msi.msi_attrib.pos =3D MSI_TYPE_HPET;
     }
=20
     if ( !num_hpets_used )
@@ -795,7 +811,10 @@ void hpet_resume(u32 *boot_cfg)
     {
         cfg =3D hpet_read32(HPET_Tn_CFG(i));
         if ( boot_cfg )
+        {
             boot_cfg[i + 1] =3D cfg;
+            cfg &=3D ~HPET_TN_FSB;
+        }
         cfg &=3D ~HPET_TN_ENABLE;
         if ( cfg & HPET_TN_RESERVED )
         {
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1119,17 +1119,17 @@ static void dump_msi(unsigned char key)
 {
     unsigned int irq;
=20
-    printk("PCI-MSI interrupt information:\n");
+    printk("MSI information:\n");
=20
     for ( irq =3D 0; irq < nr_irqs; irq++ )
     {
         struct irq_desc *desc =3D irq_to_desc(irq);
         const struct msi_desc *entry;
         u32 addr, data, dest32;
-        int mask;
+        char mask;
         struct msi_attrib attr;
         unsigned long flags;
-        char type;
+        const char *type =3D "???";
=20
         if ( !irq_desc_initialized(desc) )
             continue;
@@ -1145,21 +1145,30 @@ static void dump_msi(unsigned char key)
=20
         switch ( entry->msi_attrib.type )
         {
-        case PCI_CAP_ID_MSI: type =3D ' '; break;
-        case PCI_CAP_ID_MSIX: type =3D 'X'; break;
-        default: type =3D '?'; break;
+        case PCI_CAP_ID_MSI: type =3D "MSI"; break;
+        case PCI_CAP_ID_MSIX: type =3D "MSI-X"; break;
+        case 0:
+            switch ( entry->msi_attrib.pos )
+            {
+            case MSI_TYPE_HPET: type =3D "HPET"; break;
+            case MSI_TYPE_IOMMU: type =3D "IOMMU"; break;
+            }
+            break;
         }
=20
         data =3D entry->msg.data;
         addr =3D entry->msg.address_lo;
         dest32 =3D entry->msg.dest32;
         attr =3D entry->msi_attrib;
-        mask =3D msi_get_mask_bit(entry);
+        if ( entry->msi_attrib.type )
+            mask =3D msi_get_mask_bit(entry) ? '1' : '0';
+        else
+            mask =3D '?';
=20
         spin_unlock_irqrestore(&desc->lock, flags);
=20
-        printk(" MSI%c %4u vec=3D%02x%7s%6s%3sassert%5s%7s"
-               " dest=3D%08x mask=3D%d/%d/%d\n",
+        printk(" %-6s%4u vec=3D%02x%7s%6s%3sassert%5s%7s"
+               " dest=3D%08x mask=3D%d/%d/%c\n",
                type, irq,
                (data & MSI_DATA_VECTOR_MASK) >> MSI_DATA_VECTOR_SHIFT,
                data & MSI_DATA_DELIVERY_LOWPRI ? "lowest" : "fixed",
--- a/xen/include/asm-x86/msi.h
+++ b/xen/include/asm-x86/msi.h
@@ -109,6 +109,14 @@ struct msi_desc {
 	int remap_index;		/* index in interrupt remapping =
table */
 };
=20
+/*
+ * Values stored into msi_desc.msi_attrib.pos for non-PCI devices
+ * (msi_desc.msi_attrib.type is zero):
+ */
+#define MSI_TYPE_UNKNOWN 0
+#define MSI_TYPE_HPET    1
+#define MSI_TYPE_IOMMU   2
+
 int msi_maskable_irq(const struct msi_desc *);
 int msi_free_irq(struct msi_desc *entry);
=20



--=__PartDEEF2FE3.3__=
Content-Type: text/plain; name="x86-HPET-MSI-dump.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="x86-HPET-MSI-dump.patch"

x86/HPET: include FSB interrupt information in 'M' debug key output=0A=0ASi=
gned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- a/xen/arch/x86/hpet.c=
=0A+++ b/xen/arch/x86/hpet.c=0A@@ -239,6 +239,7 @@ static void hpet_msi_unm=
ask(struct irq_d=0A     cfg =3D hpet_read32(HPET_Tn_CFG(ch->idx));=0A     =
cfg |=3D HPET_TN_FSB;=0A     hpet_write32(cfg, HPET_Tn_CFG(ch->idx));=0A+  =
  ch->msi.msi_attrib.masked =3D 0;=0A }=0A =0A static void hpet_msi_mask(st=
ruct irq_desc *desc)=0A@@ -249,6 +250,7 @@ static void hpet_msi_mask(struct=
 irq_des=0A     cfg =3D hpet_read32(HPET_Tn_CFG(ch->idx));=0A     cfg &=3D =
~HPET_TN_FSB;=0A     hpet_write32(cfg, HPET_Tn_CFG(ch->idx));=0A+    =
ch->msi.msi_attrib.masked =3D 1;=0A }=0A =0A static void hpet_msi_write(str=
uct hpet_event_channel *ch, struct msi_msg *msg)=0A@@ -346,6 +348,7 @@ =
static int __init hpet_setup_msi_irq(str=0A     }=0A =0A     __hpet_setup_m=
si_irq(desc);=0A+    desc->msi_desc =3D &ch->msi;=0A =0A     return 0;=0A =
}=0A@@ -390,6 +393,17 @@ static void __init hpet_fsb_cap_lookup(v=0A       =
  if ( !(cfg & HPET_TN_FSB_CAP) )=0A             continue;=0A =0A+        =
/* hpet_setup(), via hpet_resume(), attempted to clear HPET_TN_FSB, so=0A+ =
        * if it is still set... */=0A+        if ( !(cfg & HPET_TN_FSB) =
)=0A+            ch->msi.msi_attrib.maskbit =3D 1;=0A+        else=0A+     =
   {=0A+            ch->msi.msi_attrib.maskbit =3D 0;=0A+            =
printk(XENLOG_WARNING "HPET: channel %u is not maskable (%04x)\n",=0A+     =
              i, cfg);=0A+        }=0A+=0A         if ( !zalloc_cpumask_var=
(&ch->cpumask) )=0A         {=0A             if ( !num_hpets_used )=0A@@ =
-573,6 +587,8 @@ void __init hpet_broadcast_init(void)=0A         =
spin_lock_init(&hpet_events[i].lock);=0A         wmb();=0A         =
hpet_events[i].event_handler =3D handle_hpet_broadcast;=0A+=0A+        =
hpet_events[i].msi.msi_attrib.pos =3D MSI_TYPE_HPET;=0A     }=0A =0A     =
if ( !num_hpets_used )=0A@@ -795,7 +811,10 @@ void hpet_resume(u32 =
*boot_cfg)=0A     {=0A         cfg =3D hpet_read32(HPET_Tn_CFG(i));=0A     =
    if ( boot_cfg )=0A+        {=0A             boot_cfg[i + 1] =3D =
cfg;=0A+            cfg &=3D ~HPET_TN_FSB;=0A+        }=0A         cfg =
&=3D ~HPET_TN_ENABLE;=0A         if ( cfg & HPET_TN_RESERVED )=0A         =
{=0A--- a/xen/arch/x86/msi.c=0A+++ b/xen/arch/x86/msi.c=0A@@ -1119,17 =
+1119,17 @@ static void dump_msi(unsigned char key)=0A {=0A     unsigned =
int irq;=0A =0A-    printk("PCI-MSI interrupt information:\n");=0A+    =
printk("MSI information:\n");=0A =0A     for ( irq =3D 0; irq < nr_irqs; =
irq++ )=0A     {=0A         struct irq_desc *desc =3D irq_to_desc(irq);=0A =
        const struct msi_desc *entry;=0A         u32 addr, data, dest32;=0A=
-        int mask;=0A+        char mask;=0A         struct msi_attrib =
attr;=0A         unsigned long flags;=0A-        char type;=0A+        =
const char *type =3D "???";=0A =0A         if ( !irq_desc_initialized(desc)=
 )=0A             continue;=0A@@ -1145,21 +1145,30 @@ static void =
dump_msi(unsigned char key)=0A =0A         switch ( entry->msi_attrib.type =
)=0A         {=0A-        case PCI_CAP_ID_MSI: type =3D ' '; break;=0A-    =
    case PCI_CAP_ID_MSIX: type =3D 'X'; break;=0A-        default: type =
=3D '?'; break;=0A+        case PCI_CAP_ID_MSI: type =3D "MSI"; break;=0A+ =
       case PCI_CAP_ID_MSIX: type =3D "MSI-X"; break;=0A+        case =
0:=0A+            switch ( entry->msi_attrib.pos )=0A+            {=0A+    =
        case MSI_TYPE_HPET: type =3D "HPET"; break;=0A+            case =
MSI_TYPE_IOMMU: type =3D "IOMMU"; break;=0A+            }=0A+            =
break;=0A         }=0A =0A         data =3D entry->msg.data;=0A         =
addr =3D entry->msg.address_lo;=0A         dest32 =3D entry->msg.dest32;=0A=
         attr =3D entry->msi_attrib;=0A-        mask =3D msi_get_mask_bit(e=
ntry);=0A+        if ( entry->msi_attrib.type )=0A+            mask =3D =
msi_get_mask_bit(entry) ? '1' : '0';=0A+        else=0A+            mask =
=3D '?';=0A =0A         spin_unlock_irqrestore(&desc->lock, flags);=0A =
=0A-        printk(" MSI%c %4u vec=3D%02x%7s%6s%3sassert%5s%7s"=0A-        =
       " dest=3D%08x mask=3D%d/%d/%d\n",=0A+        printk(" %-6s%4u =
vec=3D%02x%7s%6s%3sassert%5s%7s"=0A+               " dest=3D%08x mask=3D%d/=
%d/%c\n",=0A                type, irq,=0A                (data & MSI_DATA_V=
ECTOR_MASK) >> MSI_DATA_VECTOR_SHIFT,=0A                data & MSI_DATA_DEL=
IVERY_LOWPRI ? "lowest" : "fixed",=0A--- a/xen/include/asm-x86/msi.h=0A+++ =
b/xen/include/asm-x86/msi.h=0A@@ -109,6 +109,14 @@ struct msi_desc {=0A 	=
int remap_index;		/* index in interrupt remapping table =
*/=0A };=0A =0A+/*=0A+ * Values stored into msi_desc.msi_attrib.pos for =
non-PCI devices=0A+ * (msi_desc.msi_attrib.type is zero):=0A+ */=0A+#define=
 MSI_TYPE_UNKNOWN 0=0A+#define MSI_TYPE_HPET    1=0A+#define MSI_TYPE_IOMMU=
   2=0A+=0A int msi_maskable_irq(const struct msi_desc *);=0A int =
msi_free_irq(struct msi_desc *entry);=0A =0A
--=__PartDEEF2FE3.3__=
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.xen.org
http://lists.xen.org/xen-devel

--=__PartDEEF2FE3.3__=--


From xen-devel-bounces@lists.xen.org Wed Nov 21 10:16:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:16:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7L7-0001Yk-8x; Wed, 21 Nov 2012 10:15:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb7L5-0001Yf-Tz
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 10:15:28 +0000
Received: from [85.158.139.83:46724] by server-9.bemta-5.messagelabs.com id
	87/95-29295-FB9ACA05; Wed, 21 Nov 2012 10:15:27 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1353492925!22635863!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24435 invoked from network); 21 Nov 2012 10:15:25 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 10:15:25 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 10:15:24 +0000
Message-Id: <50ACB80302000078000AA494@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 10:16:19 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
In-Reply-To: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartDEEF2FE3.3__="
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: [Xen-devel] [PATCH 1/5] x86/HPET: include FSB interrupt information
 in 'M' debug key output
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartDEEF2FE3.3__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -239,6 +239,7 @@ static void hpet_msi_unmask(struct irq_d
     cfg =3D hpet_read32(HPET_Tn_CFG(ch->idx));
     cfg |=3D HPET_TN_FSB;
     hpet_write32(cfg, HPET_Tn_CFG(ch->idx));
+    ch->msi.msi_attrib.masked =3D 0;
 }
=20
 static void hpet_msi_mask(struct irq_desc *desc)
@@ -249,6 +250,7 @@ static void hpet_msi_mask(struct irq_des
     cfg =3D hpet_read32(HPET_Tn_CFG(ch->idx));
     cfg &=3D ~HPET_TN_FSB;
     hpet_write32(cfg, HPET_Tn_CFG(ch->idx));
+    ch->msi.msi_attrib.masked =3D 1;
 }
=20
 static void hpet_msi_write(struct hpet_event_channel *ch, struct msi_msg =
*msg)
@@ -346,6 +348,7 @@ static int __init hpet_setup_msi_irq(str
     }
=20
     __hpet_setup_msi_irq(desc);
+    desc->msi_desc =3D &ch->msi;
=20
     return 0;
 }
@@ -390,6 +393,17 @@ static void __init hpet_fsb_cap_lookup(v
         if ( !(cfg & HPET_TN_FSB_CAP) )
             continue;
=20
+        /* hpet_setup(), via hpet_resume(), attempted to clear HPET_TN_FSB=
, so
+         * if it is still set... */
+        if ( !(cfg & HPET_TN_FSB) )
+            ch->msi.msi_attrib.maskbit =3D 1;
+        else
+        {
+            ch->msi.msi_attrib.maskbit =3D 0;
+            printk(XENLOG_WARNING "HPET: channel %u is not maskable =
(%04x)\n",
+                   i, cfg);
+        }
+
         if ( !zalloc_cpumask_var(&ch->cpumask) )
         {
             if ( !num_hpets_used )
@@ -573,6 +587,8 @@ void __init hpet_broadcast_init(void)
         spin_lock_init(&hpet_events[i].lock);
         wmb();
         hpet_events[i].event_handler =3D handle_hpet_broadcast;
+
+        hpet_events[i].msi.msi_attrib.pos =3D MSI_TYPE_HPET;
     }
=20
     if ( !num_hpets_used )
@@ -795,7 +811,10 @@ void hpet_resume(u32 *boot_cfg)
     {
         cfg =3D hpet_read32(HPET_Tn_CFG(i));
         if ( boot_cfg )
+        {
             boot_cfg[i + 1] =3D cfg;
+            cfg &=3D ~HPET_TN_FSB;
+        }
         cfg &=3D ~HPET_TN_ENABLE;
         if ( cfg & HPET_TN_RESERVED )
         {
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1119,17 +1119,17 @@ static void dump_msi(unsigned char key)
 {
     unsigned int irq;
=20
-    printk("PCI-MSI interrupt information:\n");
+    printk("MSI information:\n");
=20
     for ( irq =3D 0; irq < nr_irqs; irq++ )
     {
         struct irq_desc *desc =3D irq_to_desc(irq);
         const struct msi_desc *entry;
         u32 addr, data, dest32;
-        int mask;
+        char mask;
         struct msi_attrib attr;
         unsigned long flags;
-        char type;
+        const char *type =3D "???";
=20
         if ( !irq_desc_initialized(desc) )
             continue;
@@ -1145,21 +1145,30 @@ static void dump_msi(unsigned char key)
=20
         switch ( entry->msi_attrib.type )
         {
-        case PCI_CAP_ID_MSI: type =3D ' '; break;
-        case PCI_CAP_ID_MSIX: type =3D 'X'; break;
-        default: type =3D '?'; break;
+        case PCI_CAP_ID_MSI: type =3D "MSI"; break;
+        case PCI_CAP_ID_MSIX: type =3D "MSI-X"; break;
+        case 0:
+            switch ( entry->msi_attrib.pos )
+            {
+            case MSI_TYPE_HPET: type =3D "HPET"; break;
+            case MSI_TYPE_IOMMU: type =3D "IOMMU"; break;
+            }
+            break;
         }
=20
         data =3D entry->msg.data;
         addr =3D entry->msg.address_lo;
         dest32 =3D entry->msg.dest32;
         attr =3D entry->msi_attrib;
-        mask =3D msi_get_mask_bit(entry);
+        if ( entry->msi_attrib.type )
+            mask =3D msi_get_mask_bit(entry) ? '1' : '0';
+        else
+            mask =3D '?';
=20
         spin_unlock_irqrestore(&desc->lock, flags);
=20
-        printk(" MSI%c %4u vec=3D%02x%7s%6s%3sassert%5s%7s"
-               " dest=3D%08x mask=3D%d/%d/%d\n",
+        printk(" %-6s%4u vec=3D%02x%7s%6s%3sassert%5s%7s"
+               " dest=3D%08x mask=3D%d/%d/%c\n",
                type, irq,
                (data & MSI_DATA_VECTOR_MASK) >> MSI_DATA_VECTOR_SHIFT,
                data & MSI_DATA_DELIVERY_LOWPRI ? "lowest" : "fixed",
--- a/xen/include/asm-x86/msi.h
+++ b/xen/include/asm-x86/msi.h
@@ -109,6 +109,14 @@ struct msi_desc {
 	int remap_index;		/* index in interrupt remapping =
table */
 };
=20
+/*
+ * Values stored into msi_desc.msi_attrib.pos for non-PCI devices
+ * (msi_desc.msi_attrib.type is zero):
+ */
+#define MSI_TYPE_UNKNOWN 0
+#define MSI_TYPE_HPET    1
+#define MSI_TYPE_IOMMU   2
+
 int msi_maskable_irq(const struct msi_desc *);
 int msi_free_irq(struct msi_desc *entry);
=20



--=__PartDEEF2FE3.3__=
Content-Type: text/plain; name="x86-HPET-MSI-dump.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="x86-HPET-MSI-dump.patch"

x86/HPET: include FSB interrupt information in 'M' debug key output=0A=0ASi=
gned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- a/xen/arch/x86/hpet.c=
=0A+++ b/xen/arch/x86/hpet.c=0A@@ -239,6 +239,7 @@ static void hpet_msi_unm=
ask(struct irq_d=0A     cfg =3D hpet_read32(HPET_Tn_CFG(ch->idx));=0A     =
cfg |=3D HPET_TN_FSB;=0A     hpet_write32(cfg, HPET_Tn_CFG(ch->idx));=0A+  =
  ch->msi.msi_attrib.masked =3D 0;=0A }=0A =0A static void hpet_msi_mask(st=
ruct irq_desc *desc)=0A@@ -249,6 +250,7 @@ static void hpet_msi_mask(struct=
 irq_des=0A     cfg =3D hpet_read32(HPET_Tn_CFG(ch->idx));=0A     cfg &=3D =
~HPET_TN_FSB;=0A     hpet_write32(cfg, HPET_Tn_CFG(ch->idx));=0A+    =
ch->msi.msi_attrib.masked =3D 1;=0A }=0A =0A static void hpet_msi_write(str=
uct hpet_event_channel *ch, struct msi_msg *msg)=0A@@ -346,6 +348,7 @@ =
static int __init hpet_setup_msi_irq(str=0A     }=0A =0A     __hpet_setup_m=
si_irq(desc);=0A+    desc->msi_desc =3D &ch->msi;=0A =0A     return 0;=0A =
}=0A@@ -390,6 +393,17 @@ static void __init hpet_fsb_cap_lookup(v=0A       =
  if ( !(cfg & HPET_TN_FSB_CAP) )=0A             continue;=0A =0A+        =
/* hpet_setup(), via hpet_resume(), attempted to clear HPET_TN_FSB, so=0A+ =
        * if it is still set... */=0A+        if ( !(cfg & HPET_TN_FSB) =
)=0A+            ch->msi.msi_attrib.maskbit =3D 1;=0A+        else=0A+     =
   {=0A+            ch->msi.msi_attrib.maskbit =3D 0;=0A+            =
printk(XENLOG_WARNING "HPET: channel %u is not maskable (%04x)\n",=0A+     =
              i, cfg);=0A+        }=0A+=0A         if ( !zalloc_cpumask_var=
(&ch->cpumask) )=0A         {=0A             if ( !num_hpets_used )=0A@@ =
-573,6 +587,8 @@ void __init hpet_broadcast_init(void)=0A         =
spin_lock_init(&hpet_events[i].lock);=0A         wmb();=0A         =
hpet_events[i].event_handler =3D handle_hpet_broadcast;=0A+=0A+        =
hpet_events[i].msi.msi_attrib.pos =3D MSI_TYPE_HPET;=0A     }=0A =0A     =
if ( !num_hpets_used )=0A@@ -795,7 +811,10 @@ void hpet_resume(u32 =
*boot_cfg)=0A     {=0A         cfg =3D hpet_read32(HPET_Tn_CFG(i));=0A     =
    if ( boot_cfg )=0A+        {=0A             boot_cfg[i + 1] =3D =
cfg;=0A+            cfg &=3D ~HPET_TN_FSB;=0A+        }=0A         cfg =
&=3D ~HPET_TN_ENABLE;=0A         if ( cfg & HPET_TN_RESERVED )=0A         =
{=0A--- a/xen/arch/x86/msi.c=0A+++ b/xen/arch/x86/msi.c=0A@@ -1119,17 =
+1119,17 @@ static void dump_msi(unsigned char key)=0A {=0A     unsigned =
int irq;=0A =0A-    printk("PCI-MSI interrupt information:\n");=0A+    =
printk("MSI information:\n");=0A =0A     for ( irq =3D 0; irq < nr_irqs; =
irq++ )=0A     {=0A         struct irq_desc *desc =3D irq_to_desc(irq);=0A =
        const struct msi_desc *entry;=0A         u32 addr, data, dest32;=0A=
-        int mask;=0A+        char mask;=0A         struct msi_attrib =
attr;=0A         unsigned long flags;=0A-        char type;=0A+        =
const char *type =3D "???";=0A =0A         if ( !irq_desc_initialized(desc)=
 )=0A             continue;=0A@@ -1145,21 +1145,30 @@ static void =
dump_msi(unsigned char key)=0A =0A         switch ( entry->msi_attrib.type =
)=0A         {=0A-        case PCI_CAP_ID_MSI: type =3D ' '; break;=0A-    =
    case PCI_CAP_ID_MSIX: type =3D 'X'; break;=0A-        default: type =
=3D '?'; break;=0A+        case PCI_CAP_ID_MSI: type =3D "MSI"; break;=0A+ =
       case PCI_CAP_ID_MSIX: type =3D "MSI-X"; break;=0A+        case =
0:=0A+            switch ( entry->msi_attrib.pos )=0A+            {=0A+    =
        case MSI_TYPE_HPET: type =3D "HPET"; break;=0A+            case =
MSI_TYPE_IOMMU: type =3D "IOMMU"; break;=0A+            }=0A+            =
break;=0A         }=0A =0A         data =3D entry->msg.data;=0A         =
addr =3D entry->msg.address_lo;=0A         dest32 =3D entry->msg.dest32;=0A=
         attr =3D entry->msi_attrib;=0A-        mask =3D msi_get_mask_bit(e=
ntry);=0A+        if ( entry->msi_attrib.type )=0A+            mask =3D =
msi_get_mask_bit(entry) ? '1' : '0';=0A+        else=0A+            mask =
=3D '?';=0A =0A         spin_unlock_irqrestore(&desc->lock, flags);=0A =
=0A-        printk(" MSI%c %4u vec=3D%02x%7s%6s%3sassert%5s%7s"=0A-        =
       " dest=3D%08x mask=3D%d/%d/%d\n",=0A+        printk(" %-6s%4u =
vec=3D%02x%7s%6s%3sassert%5s%7s"=0A+               " dest=3D%08x mask=3D%d/=
%d/%c\n",=0A                type, irq,=0A                (data & MSI_DATA_V=
ECTOR_MASK) >> MSI_DATA_VECTOR_SHIFT,=0A                data & MSI_DATA_DEL=
IVERY_LOWPRI ? "lowest" : "fixed",=0A--- a/xen/include/asm-x86/msi.h=0A+++ =
b/xen/include/asm-x86/msi.h=0A@@ -109,6 +109,14 @@ struct msi_desc {=0A 	=
int remap_index;		/* index in interrupt remapping table =
*/=0A };=0A =0A+/*=0A+ * Values stored into msi_desc.msi_attrib.pos for =
non-PCI devices=0A+ * (msi_desc.msi_attrib.type is zero):=0A+ */=0A+#define=
 MSI_TYPE_UNKNOWN 0=0A+#define MSI_TYPE_HPET    1=0A+#define MSI_TYPE_IOMMU=
   2=0A+=0A int msi_maskable_irq(const struct msi_desc *);=0A int =
msi_free_irq(struct msi_desc *entry);=0A =0A
--=__PartDEEF2FE3.3__=
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.xen.org
http://lists.xen.org/xen-devel

--=__PartDEEF2FE3.3__=--


From xen-devel-bounces@lists.xen.org Wed Nov 21 10:17:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:17:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7MM-0001cg-OQ; Wed, 21 Nov 2012 10:16:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb7MK-0001cT-Qz
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 10:16:45 +0000
Received: from [85.158.139.83:59680] by server-10.bemta-5.messagelabs.com id
	76/9E-09257-B0AACA05; Wed, 21 Nov 2012 10:16:43 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1353493002!26951908!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32740 invoked from network); 21 Nov 2012 10:16:42 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 10:16:42 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 10:16:41 +0000
Message-Id: <50ACB84F02000078000AA498@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 10:17:35 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
In-Reply-To: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part1120E02F.3__="
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: [Xen-devel] [PATCH 2/5] VT-d: include IOMMU interrupt information
 in 'M' debug key output
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part1120E02F.3__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1008,6 +1008,7 @@ static void dma_msi_unmask(struct irq_de
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
+    iommu->msi.msi_attrib.masked =3D 0;
 }
=20
 static void dma_msi_mask(struct irq_desc *desc)
@@ -1019,6 +1020,7 @@ static void dma_msi_mask(struct irq_desc
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
+    iommu->msi.msi_attrib.masked =3D 1;
 }
=20
 static unsigned int dma_msi_startup(struct irq_desc *desc)
@@ -1059,6 +1061,7 @@ static void dma_msi_set_affinity(struct=20
         msg.address_hi =3D dest & 0xFFFFFF00;
     msg.address_lo &=3D ~MSI_ADDR_DEST_ID_MASK;
     msg.address_lo |=3D MSI_ADDR_DEST_ID(dest & 0xff);
+    iommu->msi.msg =3D msg;
=20
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FEDATA_REG, msg.data);
@@ -1082,6 +1085,8 @@ static int __init iommu_set_interrupt(st
 {
     int irq, ret;
     struct acpi_rhsa_unit *rhsa =3D drhd_to_rhsa(drhd);
+    struct iommu *iommu =3D drhd->iommu;
+    struct irq_desc *desc;
=20
     irq =3D create_irq(rhsa ? pxm_to_node(rhsa->proximity_domain)
                           : NUMA_NO_NODE);
@@ -1091,17 +1096,24 @@ static int __init iommu_set_interrupt(st
         return -EINVAL;
     }
=20
-    irq_desc[irq].handler =3D &dma_msi_type;
-    ret =3D request_irq(irq, iommu_page_fault, 0, "dmar", drhd->iommu);
+    desc =3D irq_to_desc(irq);
+    desc->handler =3D &dma_msi_type;
+    ret =3D request_irq(irq, iommu_page_fault, 0, "dmar", iommu);
     if ( ret )
     {
-        irq_desc[irq].handler =3D &no_irq_type;
+        desc->handler =3D &no_irq_type;
         destroy_irq(irq);
         dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: can't request irq\n");
         return ret;
     }
=20
-    return irq;
+    iommu->msi.irq =3D irq;
+    iommu->msi.msi_attrib.pos =3D MSI_TYPE_IOMMU;
+    iommu->msi.msi_attrib.maskbit =3D 1;
+    iommu->msi.msi_attrib.is_64 =3D 1;
+    desc->msi_desc =3D &iommu->msi;
+
+    return 0;
 }
=20
 int __init iommu_alloc(struct acpi_drhd_unit *drhd)
@@ -1121,7 +1133,7 @@ int __init iommu_alloc(struct acpi_drhd_
     if ( iommu =3D=3D NULL )
         return -ENOMEM;
=20
-    iommu->irq =3D -1; /* No irq assigned yet. */
+    iommu->msi.irq =3D -1; /* No irq assigned yet. */
=20
     iommu->intel =3D alloc_intel_iommu();
     if ( iommu->intel =3D=3D NULL )
@@ -1218,8 +1230,8 @@ void __init iommu_free(struct acpi_drhd_
     xfree(iommu->domid_map);
=20
     free_intel_iommu(iommu->intel);
-    if ( iommu->irq >=3D 0 )
-        destroy_irq(iommu->irq);
+    if ( iommu->msi.irq >=3D 0 )
+        destroy_irq(iommu->msi.irq);
     xfree(iommu);
 }
=20
@@ -1976,7 +1988,7 @@ static int init_vtd_hw(void)
=20
         iommu =3D drhd->iommu;
=20
-        desc =3D irq_to_desc(iommu->irq);
+        desc =3D irq_to_desc(iommu->msi.irq);
         dma_msi_set_affinity(desc, desc->arch.cpu_mask);
=20
         clear_fault_bits(iommu);
@@ -2122,12 +2134,11 @@ int __init intel_vtd_setup(void)
             iommu_hap_pt_share =3D 0;
=20
         ret =3D iommu_set_interrupt(drhd);
-        if ( ret < 0 )
+        if ( ret )
         {
             dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: interrupt setup =
failed\n");
             goto error;
         }
-        iommu->irq =3D ret;
     }
=20
     softirq_tasklet_init(&vtd_fault_tasklet, do_iommu_page_fault, 0);
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -21,6 +21,7 @@
 #define _INTEL_IOMMU_H_
=20
 #include <xen/iommu.h>
+#include <asm/msi.h>
=20
 /*
  * Intel IOMMU register specification per version 1.0 public spec.
@@ -520,7 +521,7 @@ struct iommu {
     spinlock_t lock; /* protect context, domain ids */
     spinlock_t register_lock; /* protect iommu register handling */
     u64 root_maddr; /* root entry machine address */
-    int irq;
+    struct msi_desc msi;
     struct intel_iommu *intel;
     unsigned long *domid_bitmap;  /* domain id bitmap */
     u16 *domid_map;               /* domain id mapping array */



--=__Part1120E02F.3__=
Content-Type: text/plain; name="VT-d-MSI-dump.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="VT-d-MSI-dump.patch"

VT-d: include IOMMU interrupt information in 'M' debug key output=0A=0ASign=
ed-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- a/xen/drivers/passthrou=
gh/vtd/iommu.c=0A+++ b/xen/drivers/passthrough/vtd/iommu.c=0A@@ -1008,6 =
+1008,7 @@ static void dma_msi_unmask(struct irq_de=0A     spin_lock_irqsav=
e(&iommu->register_lock, flags);=0A     dmar_writel(iommu->reg, DMAR_FECTL_=
REG, 0);=0A     spin_unlock_irqrestore(&iommu->register_lock, flags);=0A+  =
  iommu->msi.msi_attrib.masked =3D 0;=0A }=0A =0A static void dma_msi_mask(=
struct irq_desc *desc)=0A@@ -1019,6 +1020,7 @@ static void dma_msi_mask(str=
uct irq_desc=0A     spin_lock_irqsave(&iommu->register_lock, flags);=0A    =
 dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);=0A     spin_unlock_=
irqrestore(&iommu->register_lock, flags);=0A+    iommu->msi.msi_attrib.mask=
ed =3D 1;=0A }=0A =0A static unsigned int dma_msi_startup(struct irq_desc =
*desc)=0A@@ -1059,6 +1061,7 @@ static void dma_msi_set_affinity(struct =0A =
        msg.address_hi =3D dest & 0xFFFFFF00;=0A     msg.address_lo &=3D =
~MSI_ADDR_DEST_ID_MASK;=0A     msg.address_lo |=3D MSI_ADDR_DEST_ID(dest & =
0xff);=0A+    iommu->msi.msg =3D msg;=0A =0A     spin_lock_irqsave(&iommu->=
register_lock, flags);=0A     dmar_writel(iommu->reg, DMAR_FEDATA_REG, =
msg.data);=0A@@ -1082,6 +1085,8 @@ static int __init iommu_set_interrupt(st=
=0A {=0A     int irq, ret;=0A     struct acpi_rhsa_unit *rhsa =3D =
drhd_to_rhsa(drhd);=0A+    struct iommu *iommu =3D drhd->iommu;=0A+    =
struct irq_desc *desc;=0A =0A     irq =3D create_irq(rhsa ? pxm_to_node(rhs=
a->proximity_domain)=0A                           : NUMA_NO_NODE);=0A@@ =
-1091,17 +1096,24 @@ static int __init iommu_set_interrupt(st=0A         =
return -EINVAL;=0A     }=0A =0A-    irq_desc[irq].handler =3D &dma_msi_type=
;=0A-    ret =3D request_irq(irq, iommu_page_fault, 0, "dmar", drhd->iommu)=
;=0A+    desc =3D irq_to_desc(irq);=0A+    desc->handler =3D &dma_msi_type;=
=0A+    ret =3D request_irq(irq, iommu_page_fault, 0, "dmar", iommu);=0A   =
  if ( ret )=0A     {=0A-        irq_desc[irq].handler =3D &no_irq_type;=0A=
+        desc->handler =3D &no_irq_type;=0A         destroy_irq(irq);=0A   =
      dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: can't request irq\n");=0A      =
   return ret;=0A     }=0A =0A-    return irq;=0A+    iommu->msi.irq =3D =
irq;=0A+    iommu->msi.msi_attrib.pos =3D MSI_TYPE_IOMMU;=0A+    iommu->msi=
.msi_attrib.maskbit =3D 1;=0A+    iommu->msi.msi_attrib.is_64 =3D 1;=0A+   =
 desc->msi_desc =3D &iommu->msi;=0A+=0A+    return 0;=0A }=0A =0A int =
__init iommu_alloc(struct acpi_drhd_unit *drhd)=0A@@ -1121,7 +1133,7 @@ =
int __init iommu_alloc(struct acpi_drhd_=0A     if ( iommu =3D=3D NULL =
)=0A         return -ENOMEM;=0A =0A-    iommu->irq =3D -1; /* No irq =
assigned yet. */=0A+    iommu->msi.irq =3D -1; /* No irq assigned yet. =
*/=0A =0A     iommu->intel =3D alloc_intel_iommu();=0A     if ( iommu->inte=
l =3D=3D NULL )=0A@@ -1218,8 +1230,8 @@ void __init iommu_free(struct =
acpi_drhd_=0A     xfree(iommu->domid_map);=0A =0A     free_intel_iommu(iomm=
u->intel);=0A-    if ( iommu->irq >=3D 0 )=0A-        destroy_irq(iommu->ir=
q);=0A+    if ( iommu->msi.irq >=3D 0 )=0A+        destroy_irq(iommu->msi.i=
rq);=0A     xfree(iommu);=0A }=0A =0A@@ -1976,7 +1988,7 @@ static int =
init_vtd_hw(void)=0A =0A         iommu =3D drhd->iommu;=0A =0A-        =
desc =3D irq_to_desc(iommu->irq);=0A+        desc =3D irq_to_desc(iommu->ms=
i.irq);=0A         dma_msi_set_affinity(desc, desc->arch.cpu_mask);=0A =0A =
        clear_fault_bits(iommu);=0A@@ -2122,12 +2134,11 @@ int __init =
intel_vtd_setup(void)=0A             iommu_hap_pt_share =3D 0;=0A =0A      =
   ret =3D iommu_set_interrupt(drhd);=0A-        if ( ret < 0 )=0A+        =
if ( ret )=0A         {=0A             dprintk(XENLOG_ERR VTDPREFIX, =
"IOMMU: interrupt setup failed\n");=0A             goto error;=0A         =
}=0A-        iommu->irq =3D ret;=0A     }=0A =0A     softirq_tasklet_init(&=
vtd_fault_tasklet, do_iommu_page_fault, 0);=0A--- a/xen/drivers/passthrough=
/vtd/iommu.h=0A+++ b/xen/drivers/passthrough/vtd/iommu.h=0A@@ -21,6 +21,7 =
@@=0A #define _INTEL_IOMMU_H_=0A =0A #include <xen/iommu.h>=0A+#include =
<asm/msi.h>=0A =0A /*=0A  * Intel IOMMU register specification per version =
1.0 public spec.=0A@@ -520,7 +521,7 @@ struct iommu {=0A     spinlock_t =
lock; /* protect context, domain ids */=0A     spinlock_t register_lock; =
/* protect iommu register handling */=0A     u64 root_maddr; /* root entry =
machine address */=0A-    int irq;=0A+    struct msi_desc msi;=0A     =
struct intel_iommu *intel;=0A     unsigned long *domid_bitmap;  /* domain =
id bitmap */=0A     u16 *domid_map;               /* domain id mapping =
array */=0A
--=__Part1120E02F.3__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part1120E02F.3__=--


From xen-devel-bounces@lists.xen.org Wed Nov 21 10:17:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:17:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7MM-0001cg-OQ; Wed, 21 Nov 2012 10:16:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb7MK-0001cT-Qz
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 10:16:45 +0000
Received: from [85.158.139.83:59680] by server-10.bemta-5.messagelabs.com id
	76/9E-09257-B0AACA05; Wed, 21 Nov 2012 10:16:43 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1353493002!26951908!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32740 invoked from network); 21 Nov 2012 10:16:42 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 10:16:42 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 10:16:41 +0000
Message-Id: <50ACB84F02000078000AA498@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 10:17:35 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
In-Reply-To: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part1120E02F.3__="
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: [Xen-devel] [PATCH 2/5] VT-d: include IOMMU interrupt information
 in 'M' debug key output
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part1120E02F.3__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1008,6 +1008,7 @@ static void dma_msi_unmask(struct irq_de
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
+    iommu->msi.msi_attrib.masked =3D 0;
 }
=20
 static void dma_msi_mask(struct irq_desc *desc)
@@ -1019,6 +1020,7 @@ static void dma_msi_mask(struct irq_desc
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
+    iommu->msi.msi_attrib.masked =3D 1;
 }
=20
 static unsigned int dma_msi_startup(struct irq_desc *desc)
@@ -1059,6 +1061,7 @@ static void dma_msi_set_affinity(struct=20
         msg.address_hi =3D dest & 0xFFFFFF00;
     msg.address_lo &=3D ~MSI_ADDR_DEST_ID_MASK;
     msg.address_lo |=3D MSI_ADDR_DEST_ID(dest & 0xff);
+    iommu->msi.msg =3D msg;
=20
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FEDATA_REG, msg.data);
@@ -1082,6 +1085,8 @@ static int __init iommu_set_interrupt(st
 {
     int irq, ret;
     struct acpi_rhsa_unit *rhsa =3D drhd_to_rhsa(drhd);
+    struct iommu *iommu =3D drhd->iommu;
+    struct irq_desc *desc;
=20
     irq =3D create_irq(rhsa ? pxm_to_node(rhsa->proximity_domain)
                           : NUMA_NO_NODE);
@@ -1091,17 +1096,24 @@ static int __init iommu_set_interrupt(st
         return -EINVAL;
     }
=20
-    irq_desc[irq].handler =3D &dma_msi_type;
-    ret =3D request_irq(irq, iommu_page_fault, 0, "dmar", drhd->iommu);
+    desc =3D irq_to_desc(irq);
+    desc->handler =3D &dma_msi_type;
+    ret =3D request_irq(irq, iommu_page_fault, 0, "dmar", iommu);
     if ( ret )
     {
-        irq_desc[irq].handler =3D &no_irq_type;
+        desc->handler =3D &no_irq_type;
         destroy_irq(irq);
         dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: can't request irq\n");
         return ret;
     }
=20
-    return irq;
+    iommu->msi.irq =3D irq;
+    iommu->msi.msi_attrib.pos =3D MSI_TYPE_IOMMU;
+    iommu->msi.msi_attrib.maskbit =3D 1;
+    iommu->msi.msi_attrib.is_64 =3D 1;
+    desc->msi_desc =3D &iommu->msi;
+
+    return 0;
 }
=20
 int __init iommu_alloc(struct acpi_drhd_unit *drhd)
@@ -1121,7 +1133,7 @@ int __init iommu_alloc(struct acpi_drhd_
     if ( iommu =3D=3D NULL )
         return -ENOMEM;
=20
-    iommu->irq =3D -1; /* No irq assigned yet. */
+    iommu->msi.irq =3D -1; /* No irq assigned yet. */
=20
     iommu->intel =3D alloc_intel_iommu();
     if ( iommu->intel =3D=3D NULL )
@@ -1218,8 +1230,8 @@ void __init iommu_free(struct acpi_drhd_
     xfree(iommu->domid_map);
=20
     free_intel_iommu(iommu->intel);
-    if ( iommu->irq >=3D 0 )
-        destroy_irq(iommu->irq);
+    if ( iommu->msi.irq >=3D 0 )
+        destroy_irq(iommu->msi.irq);
     xfree(iommu);
 }
=20
@@ -1976,7 +1988,7 @@ static int init_vtd_hw(void)
=20
         iommu =3D drhd->iommu;
=20
-        desc =3D irq_to_desc(iommu->irq);
+        desc =3D irq_to_desc(iommu->msi.irq);
         dma_msi_set_affinity(desc, desc->arch.cpu_mask);
=20
         clear_fault_bits(iommu);
@@ -2122,12 +2134,11 @@ int __init intel_vtd_setup(void)
             iommu_hap_pt_share =3D 0;
=20
         ret =3D iommu_set_interrupt(drhd);
-        if ( ret < 0 )
+        if ( ret )
         {
             dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: interrupt setup =
failed\n");
             goto error;
         }
-        iommu->irq =3D ret;
     }
=20
     softirq_tasklet_init(&vtd_fault_tasklet, do_iommu_page_fault, 0);
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -21,6 +21,7 @@
 #define _INTEL_IOMMU_H_
=20
 #include <xen/iommu.h>
+#include <asm/msi.h>
=20
 /*
  * Intel IOMMU register specification per version 1.0 public spec.
@@ -520,7 +521,7 @@ struct iommu {
     spinlock_t lock; /* protect context, domain ids */
     spinlock_t register_lock; /* protect iommu register handling */
     u64 root_maddr; /* root entry machine address */
-    int irq;
+    struct msi_desc msi;
     struct intel_iommu *intel;
     unsigned long *domid_bitmap;  /* domain id bitmap */
     u16 *domid_map;               /* domain id mapping array */



--=__Part1120E02F.3__=
Content-Type: text/plain; name="VT-d-MSI-dump.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="VT-d-MSI-dump.patch"

VT-d: include IOMMU interrupt information in 'M' debug key output=0A=0ASign=
ed-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- a/xen/drivers/passthrou=
gh/vtd/iommu.c=0A+++ b/xen/drivers/passthrough/vtd/iommu.c=0A@@ -1008,6 =
+1008,7 @@ static void dma_msi_unmask(struct irq_de=0A     spin_lock_irqsav=
e(&iommu->register_lock, flags);=0A     dmar_writel(iommu->reg, DMAR_FECTL_=
REG, 0);=0A     spin_unlock_irqrestore(&iommu->register_lock, flags);=0A+  =
  iommu->msi.msi_attrib.masked =3D 0;=0A }=0A =0A static void dma_msi_mask(=
struct irq_desc *desc)=0A@@ -1019,6 +1020,7 @@ static void dma_msi_mask(str=
uct irq_desc=0A     spin_lock_irqsave(&iommu->register_lock, flags);=0A    =
 dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);=0A     spin_unlock_=
irqrestore(&iommu->register_lock, flags);=0A+    iommu->msi.msi_attrib.mask=
ed =3D 1;=0A }=0A =0A static unsigned int dma_msi_startup(struct irq_desc =
*desc)=0A@@ -1059,6 +1061,7 @@ static void dma_msi_set_affinity(struct =0A =
        msg.address_hi =3D dest & 0xFFFFFF00;=0A     msg.address_lo &=3D =
~MSI_ADDR_DEST_ID_MASK;=0A     msg.address_lo |=3D MSI_ADDR_DEST_ID(dest & =
0xff);=0A+    iommu->msi.msg =3D msg;=0A =0A     spin_lock_irqsave(&iommu->=
register_lock, flags);=0A     dmar_writel(iommu->reg, DMAR_FEDATA_REG, =
msg.data);=0A@@ -1082,6 +1085,8 @@ static int __init iommu_set_interrupt(st=
=0A {=0A     int irq, ret;=0A     struct acpi_rhsa_unit *rhsa =3D =
drhd_to_rhsa(drhd);=0A+    struct iommu *iommu =3D drhd->iommu;=0A+    =
struct irq_desc *desc;=0A =0A     irq =3D create_irq(rhsa ? pxm_to_node(rhs=
a->proximity_domain)=0A                           : NUMA_NO_NODE);=0A@@ =
-1091,17 +1096,24 @@ static int __init iommu_set_interrupt(st=0A         =
return -EINVAL;=0A     }=0A =0A-    irq_desc[irq].handler =3D &dma_msi_type=
;=0A-    ret =3D request_irq(irq, iommu_page_fault, 0, "dmar", drhd->iommu)=
;=0A+    desc =3D irq_to_desc(irq);=0A+    desc->handler =3D &dma_msi_type;=
=0A+    ret =3D request_irq(irq, iommu_page_fault, 0, "dmar", iommu);=0A   =
  if ( ret )=0A     {=0A-        irq_desc[irq].handler =3D &no_irq_type;=0A=
+        desc->handler =3D &no_irq_type;=0A         destroy_irq(irq);=0A   =
      dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: can't request irq\n");=0A      =
   return ret;=0A     }=0A =0A-    return irq;=0A+    iommu->msi.irq =3D =
irq;=0A+    iommu->msi.msi_attrib.pos =3D MSI_TYPE_IOMMU;=0A+    iommu->msi=
.msi_attrib.maskbit =3D 1;=0A+    iommu->msi.msi_attrib.is_64 =3D 1;=0A+   =
 desc->msi_desc =3D &iommu->msi;=0A+=0A+    return 0;=0A }=0A =0A int =
__init iommu_alloc(struct acpi_drhd_unit *drhd)=0A@@ -1121,7 +1133,7 @@ =
int __init iommu_alloc(struct acpi_drhd_=0A     if ( iommu =3D=3D NULL =
)=0A         return -ENOMEM;=0A =0A-    iommu->irq =3D -1; /* No irq =
assigned yet. */=0A+    iommu->msi.irq =3D -1; /* No irq assigned yet. =
*/=0A =0A     iommu->intel =3D alloc_intel_iommu();=0A     if ( iommu->inte=
l =3D=3D NULL )=0A@@ -1218,8 +1230,8 @@ void __init iommu_free(struct =
acpi_drhd_=0A     xfree(iommu->domid_map);=0A =0A     free_intel_iommu(iomm=
u->intel);=0A-    if ( iommu->irq >=3D 0 )=0A-        destroy_irq(iommu->ir=
q);=0A+    if ( iommu->msi.irq >=3D 0 )=0A+        destroy_irq(iommu->msi.i=
rq);=0A     xfree(iommu);=0A }=0A =0A@@ -1976,7 +1988,7 @@ static int =
init_vtd_hw(void)=0A =0A         iommu =3D drhd->iommu;=0A =0A-        =
desc =3D irq_to_desc(iommu->irq);=0A+        desc =3D irq_to_desc(iommu->ms=
i.irq);=0A         dma_msi_set_affinity(desc, desc->arch.cpu_mask);=0A =0A =
        clear_fault_bits(iommu);=0A@@ -2122,12 +2134,11 @@ int __init =
intel_vtd_setup(void)=0A             iommu_hap_pt_share =3D 0;=0A =0A      =
   ret =3D iommu_set_interrupt(drhd);=0A-        if ( ret < 0 )=0A+        =
if ( ret )=0A         {=0A             dprintk(XENLOG_ERR VTDPREFIX, =
"IOMMU: interrupt setup failed\n");=0A             goto error;=0A         =
}=0A-        iommu->irq =3D ret;=0A     }=0A =0A     softirq_tasklet_init(&=
vtd_fault_tasklet, do_iommu_page_fault, 0);=0A--- a/xen/drivers/passthrough=
/vtd/iommu.h=0A+++ b/xen/drivers/passthrough/vtd/iommu.h=0A@@ -21,6 +21,7 =
@@=0A #define _INTEL_IOMMU_H_=0A =0A #include <xen/iommu.h>=0A+#include =
<asm/msi.h>=0A =0A /*=0A  * Intel IOMMU register specification per version =
1.0 public spec.=0A@@ -520,7 +521,7 @@ struct iommu {=0A     spinlock_t =
lock; /* protect context, domain ids */=0A     spinlock_t register_lock; =
/* protect iommu register handling */=0A     u64 root_maddr; /* root entry =
machine address */=0A-    int irq;=0A+    struct msi_desc msi;=0A     =
struct intel_iommu *intel;=0A     unsigned long *domid_bitmap;  /* domain =
id bitmap */=0A     u16 *domid_map;               /* domain id mapping =
array */=0A
--=__Part1120E02F.3__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part1120E02F.3__=--


From xen-devel-bounces@lists.xen.org Wed Nov 21 10:18:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:18:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7Ng-0001lU-Pc; Wed, 21 Nov 2012 10:18:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb7Nf-0001lD-Dw
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 10:18:07 +0000
Received: from [85.158.139.83:56282] by server-2.bemta-5.messagelabs.com id
	00/F2-04892-E5AACA05; Wed, 21 Nov 2012 10:18:06 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1353493085!31279208!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25439 invoked from network); 21 Nov 2012 10:18:05 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 10:18:05 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 10:18:05 +0000
Message-Id: <50ACB8A402000078000AA4AC@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 10:19:00 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
In-Reply-To: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartBA8B4B84.3__="
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: [Xen-devel] [PATCH 4/5] x86/HPET: fix FSB interrupt masking
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartBA8B4B84.3__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

HPET_TN_FSB is not really suitable for masking interrupts - it merely
switches between the two delivery methods. The right way of masking is
through the HPET_TN_ENABLE bit (which really is an interrupt enable,
not a counter enable or some such). This is even more so with certain
chip sets not even allowing HPET_TN_FSB to be cleared on some of the
channels.

Further, all the setup of the channel should happen before actually
enabling the interrupt, which requires splitting legacy and FSB logic.

Finally this also fixes an S3 resume problem (HPET_TN_FSB did not get
set in hpet_broadcast_resume(), and hpet_msi_unmask() doesn't get
called from the general resume code either afaict).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -237,7 +237,7 @@ static void hpet_msi_unmask(struct irq_d
     struct hpet_event_channel *ch =3D desc->action->dev_id;
=20
     cfg =3D hpet_read32(HPET_Tn_CFG(ch->idx));
-    cfg |=3D HPET_TN_FSB;
+    cfg |=3D HPET_TN_ENABLE;
     hpet_write32(cfg, HPET_Tn_CFG(ch->idx));
     ch->msi.msi_attrib.masked =3D 0;
 }
@@ -248,7 +248,7 @@ static void hpet_msi_mask(struct irq_des
     struct hpet_event_channel *ch =3D desc->action->dev_id;
=20
     cfg =3D hpet_read32(HPET_Tn_CFG(ch->idx));
-    cfg &=3D ~HPET_TN_FSB;
+    cfg &=3D ~HPET_TN_ENABLE;
     hpet_write32(cfg, HPET_Tn_CFG(ch->idx));
     ch->msi.msi_attrib.masked =3D 1;
 }
@@ -328,6 +328,7 @@ static void __hpet_setup_msi_irq(struct=20
 static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)
 {
     int ret;
+    u32 cfg =3D hpet_read32(HPET_Tn_CFG(ch->idx));
     irq_desc_t *desc =3D irq_to_desc(ch->msi.irq);
=20
     if ( iommu_intremap )
@@ -338,6 +339,11 @@ static int __init hpet_setup_msi_irq(str
             return ret;
     }
=20
+    /* set HPET Tn as oneshot */
+    cfg &=3D ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
+    cfg |=3D HPET_TN_FSB | HPET_TN_32BIT;
+    hpet_write32(cfg, HPET_Tn_CFG(ch->idx));
+
     desc->handler =3D &hpet_msi_type;
     ret =3D request_irq(ch->msi.irq, hpet_interrupt_handler, 0, "HPET", =
ch);
     if ( ret < 0 )
@@ -393,17 +399,6 @@ static void __init hpet_fsb_cap_lookup(v
         if ( !(cfg & HPET_TN_FSB_CAP) )
             continue;
=20
-        /* hpet_setup(), via hpet_resume(), attempted to clear HPET_TN_FSB=
, so
-         * if it is still set... */
-        if ( !(cfg & HPET_TN_FSB) )
-            ch->msi.msi_attrib.maskbit =3D 1;
-        else
-        {
-            ch->msi.msi_attrib.maskbit =3D 0;
-            printk(XENLOG_WARNING "HPET: channel %u is not maskable =
(%04x)\n",
-                   i, cfg);
-        }
-
         if ( !zalloc_cpumask_var(&ch->cpumask) )
         {
             if ( !num_hpets_used )
@@ -570,11 +565,14 @@ void __init hpet_broadcast_init(void)
=20
     for ( i =3D 0; i < n; i++ )
     {
-        /* set HPET Tn as oneshot */
-        cfg =3D hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
-        cfg &=3D ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
-        cfg |=3D HPET_TN_ENABLE | HPET_TN_32BIT;
-        hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
+        if ( i =3D=3D 0 && (cfg & HPET_CFG_LEGACY) )
+        {
+            /* set HPET T0 as oneshot */
+            cfg =3D hpet_read32(HPET_Tn_CFG(0));
+            cfg &=3D ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
+            cfg |=3D HPET_TN_ENABLE | HPET_TN_32BIT;
+            hpet_write32(cfg, HPET_Tn_CFG(0));
+        }
=20
         /*
          * The period is a femto seconds value. We need to calculate the =
scaled
@@ -588,6 +586,7 @@ void __init hpet_broadcast_init(void)
         wmb();
         hpet_events[i].event_handler =3D handle_hpet_broadcast;
=20
+        hpet_events[i].msi.msi_attrib.maskbit =3D 1;
         hpet_events[i].msi.msi_attrib.pos =3D MSI_TYPE_HPET;
     }
=20
@@ -633,6 +632,8 @@ void hpet_broadcast_resume(void)
         cfg =3D hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
         cfg &=3D ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
         cfg |=3D HPET_TN_ENABLE | HPET_TN_32BIT;
+        if ( !(hpet_events[i].flags & HPET_EVT_LEGACY) )
+            cfg |=3D HPET_TN_FSB;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
=20
         hpet_events[i].next_event =3D STIME_MAX;
@@ -811,10 +812,7 @@ void hpet_resume(u32 *boot_cfg)
     {
         cfg =3D hpet_read32(HPET_Tn_CFG(i));
         if ( boot_cfg )
-        {
             boot_cfg[i + 1] =3D cfg;
-            cfg &=3D ~HPET_TN_FSB;
-        }
         cfg &=3D ~HPET_TN_ENABLE;
         if ( cfg & HPET_TN_RESERVED )
         {



--=__PartBA8B4B84.3__=
Content-Type: text/plain; name="x86-HPET-masking.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="x86-HPET-masking.patch"

x86/HPET: fix FSB interrupt masking=0A=0AHPET_TN_FSB is not really =
suitable for masking interrupts - it merely=0Aswitches between the two =
delivery methods. The right way of masking is=0Athrough the HPET_TN_ENABLE =
bit (which really is an interrupt enable,=0Anot a counter enable or some =
such). This is even more so with certain=0Achip sets not even allowing =
HPET_TN_FSB to be cleared on some of the=0Achannels.=0A=0AFurther, all the =
setup of the channel should happen before actually=0Aenabling the =
interrupt, which requires splitting legacy and FSB logic.=0A=0AFinally =
this also fixes an S3 resume problem (HPET_TN_FSB did not get=0Aset in =
hpet_broadcast_resume(), and hpet_msi_unmask() doesn't get=0Acalled from =
the general resume code either afaict).=0A=0ASigned-off-by: Jan Beulich =
<jbeulich@suse.com>=0A=0A--- a/xen/arch/x86/hpet.c=0A+++ b/xen/arch/x86/hpe=
t.c=0A@@ -237,7 +237,7 @@ static void hpet_msi_unmask(struct irq_d=0A     =
struct hpet_event_channel *ch =3D desc->action->dev_id;=0A =0A     cfg =3D =
hpet_read32(HPET_Tn_CFG(ch->idx));=0A-    cfg |=3D HPET_TN_FSB;=0A+    cfg =
|=3D HPET_TN_ENABLE;=0A     hpet_write32(cfg, HPET_Tn_CFG(ch->idx));=0A    =
 ch->msi.msi_attrib.masked =3D 0;=0A }=0A@@ -248,7 +248,7 @@ static void =
hpet_msi_mask(struct irq_des=0A     struct hpet_event_channel *ch =3D =
desc->action->dev_id;=0A =0A     cfg =3D hpet_read32(HPET_Tn_CFG(ch->idx));=
=0A-    cfg &=3D ~HPET_TN_FSB;=0A+    cfg &=3D ~HPET_TN_ENABLE;=0A     =
hpet_write32(cfg, HPET_Tn_CFG(ch->idx));=0A     ch->msi.msi_attrib.masked =
=3D 1;=0A }=0A@@ -328,6 +328,7 @@ static void __hpet_setup_msi_irq(struct =
=0A static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)=0A =
{=0A     int ret;=0A+    u32 cfg =3D hpet_read32(HPET_Tn_CFG(ch->idx));=0A =
    irq_desc_t *desc =3D irq_to_desc(ch->msi.irq);=0A =0A     if ( =
iommu_intremap )=0A@@ -338,6 +339,11 @@ static int __init hpet_setup_msi_ir=
q(str=0A             return ret;=0A     }=0A =0A+    /* set HPET Tn as =
oneshot */=0A+    cfg &=3D ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);=0A+    cfg =
|=3D HPET_TN_FSB | HPET_TN_32BIT;=0A+    hpet_write32(cfg, HPET_Tn_CFG(ch->=
idx));=0A+=0A     desc->handler =3D &hpet_msi_type;=0A     ret =3D =
request_irq(ch->msi.irq, hpet_interrupt_handler, 0, "HPET", ch);=0A     if =
( ret < 0 )=0A@@ -393,17 +399,6 @@ static void __init hpet_fsb_cap_lookup(v=
=0A         if ( !(cfg & HPET_TN_FSB_CAP) )=0A             continue;=0A =
=0A-        /* hpet_setup(), via hpet_resume(), attempted to clear =
HPET_TN_FSB, so=0A-         * if it is still set... */=0A-        if ( =
!(cfg & HPET_TN_FSB) )=0A-            ch->msi.msi_attrib.maskbit =3D =
1;=0A-        else=0A-        {=0A-            ch->msi.msi_attrib.maskbit =
=3D 0;=0A-            printk(XENLOG_WARNING "HPET: channel %u is not =
maskable (%04x)\n",=0A-                   i, cfg);=0A-        }=0A-=0A     =
    if ( !zalloc_cpumask_var(&ch->cpumask) )=0A         {=0A             =
if ( !num_hpets_used )=0A@@ -570,11 +565,14 @@ void __init hpet_broadcast_i=
nit(void)=0A =0A     for ( i =3D 0; i < n; i++ )=0A     {=0A-        /* =
set HPET Tn as oneshot */=0A-        cfg =3D hpet_read32(HPET_Tn_CFG(hpet_e=
vents[i].idx));=0A-        cfg &=3D ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);=0A=
-        cfg |=3D HPET_TN_ENABLE | HPET_TN_32BIT;=0A-        hpet_write32(c=
fg, HPET_Tn_CFG(hpet_events[i].idx));=0A+        if ( i =3D=3D 0 && (cfg & =
HPET_CFG_LEGACY) )=0A+        {=0A+            /* set HPET T0 as oneshot =
*/=0A+            cfg =3D hpet_read32(HPET_Tn_CFG(0));=0A+            cfg =
&=3D ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);=0A+            cfg |=3D =
HPET_TN_ENABLE | HPET_TN_32BIT;=0A+            hpet_write32(cfg, HPET_Tn_CF=
G(0));=0A+        }=0A =0A         /*=0A          * The period is a femto =
seconds value. We need to calculate the scaled=0A@@ -588,6 +586,7 @@ void =
__init hpet_broadcast_init(void)=0A         wmb();=0A         hpet_events[i=
].event_handler =3D handle_hpet_broadcast;=0A =0A+        hpet_events[i].ms=
i.msi_attrib.maskbit =3D 1;=0A         hpet_events[i].msi.msi_attrib.pos =
=3D MSI_TYPE_HPET;=0A     }=0A =0A@@ -633,6 +632,8 @@ void hpet_broadcast_r=
esume(void)=0A         cfg =3D hpet_read32(HPET_Tn_CFG(hpet_events[i].idx))=
;=0A         cfg &=3D ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);=0A         cfg =
|=3D HPET_TN_ENABLE | HPET_TN_32BIT;=0A+        if ( !(hpet_events[i].flags=
 & HPET_EVT_LEGACY) )=0A+            cfg |=3D HPET_TN_FSB;=0A         =
hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));=0A =0A         =
hpet_events[i].next_event =3D STIME_MAX;=0A@@ -811,10 +812,7 @@ void =
hpet_resume(u32 *boot_cfg)=0A     {=0A         cfg =3D hpet_read32(HPET_Tn_=
CFG(i));=0A         if ( boot_cfg )=0A-        {=0A             boot_cfg[i =
+ 1] =3D cfg;=0A-            cfg &=3D ~HPET_TN_FSB;=0A-        }=0A        =
 cfg &=3D ~HPET_TN_ENABLE;=0A         if ( cfg & HPET_TN_RESERVED )=0A     =
    {=0A
--=__PartBA8B4B84.3__=
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.xen.org
http://lists.xen.org/xen-devel

--=__PartBA8B4B84.3__=--


From xen-devel-bounces@lists.xen.org Wed Nov 21 10:18:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:18:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7Ng-0001lU-Pc; Wed, 21 Nov 2012 10:18:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb7Nf-0001lD-Dw
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 10:18:07 +0000
Received: from [85.158.139.83:56282] by server-2.bemta-5.messagelabs.com id
	00/F2-04892-E5AACA05; Wed, 21 Nov 2012 10:18:06 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1353493085!31279208!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25439 invoked from network); 21 Nov 2012 10:18:05 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 10:18:05 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 10:18:05 +0000
Message-Id: <50ACB8A402000078000AA4AC@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 10:19:00 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
In-Reply-To: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartBA8B4B84.3__="
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: [Xen-devel] [PATCH 4/5] x86/HPET: fix FSB interrupt masking
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartBA8B4B84.3__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

HPET_TN_FSB is not really suitable for masking interrupts - it merely
switches between the two delivery methods. The right way of masking is
through the HPET_TN_ENABLE bit (which really is an interrupt enable,
not a counter enable or some such). This is even more so with certain
chip sets not even allowing HPET_TN_FSB to be cleared on some of the
channels.

Further, all the setup of the channel should happen before actually
enabling the interrupt, which requires splitting legacy and FSB logic.

Finally this also fixes an S3 resume problem (HPET_TN_FSB did not get
set in hpet_broadcast_resume(), and hpet_msi_unmask() doesn't get
called from the general resume code either afaict).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -237,7 +237,7 @@ static void hpet_msi_unmask(struct irq_d
     struct hpet_event_channel *ch =3D desc->action->dev_id;
=20
     cfg =3D hpet_read32(HPET_Tn_CFG(ch->idx));
-    cfg |=3D HPET_TN_FSB;
+    cfg |=3D HPET_TN_ENABLE;
     hpet_write32(cfg, HPET_Tn_CFG(ch->idx));
     ch->msi.msi_attrib.masked =3D 0;
 }
@@ -248,7 +248,7 @@ static void hpet_msi_mask(struct irq_des
     struct hpet_event_channel *ch =3D desc->action->dev_id;
=20
     cfg =3D hpet_read32(HPET_Tn_CFG(ch->idx));
-    cfg &=3D ~HPET_TN_FSB;
+    cfg &=3D ~HPET_TN_ENABLE;
     hpet_write32(cfg, HPET_Tn_CFG(ch->idx));
     ch->msi.msi_attrib.masked =3D 1;
 }
@@ -328,6 +328,7 @@ static void __hpet_setup_msi_irq(struct=20
 static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)
 {
     int ret;
+    u32 cfg =3D hpet_read32(HPET_Tn_CFG(ch->idx));
     irq_desc_t *desc =3D irq_to_desc(ch->msi.irq);
=20
     if ( iommu_intremap )
@@ -338,6 +339,11 @@ static int __init hpet_setup_msi_irq(str
             return ret;
     }
=20
+    /* set HPET Tn as oneshot */
+    cfg &=3D ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
+    cfg |=3D HPET_TN_FSB | HPET_TN_32BIT;
+    hpet_write32(cfg, HPET_Tn_CFG(ch->idx));
+
     desc->handler =3D &hpet_msi_type;
     ret =3D request_irq(ch->msi.irq, hpet_interrupt_handler, 0, "HPET", =
ch);
     if ( ret < 0 )
@@ -393,17 +399,6 @@ static void __init hpet_fsb_cap_lookup(v
         if ( !(cfg & HPET_TN_FSB_CAP) )
             continue;
=20
-        /* hpet_setup(), via hpet_resume(), attempted to clear HPET_TN_FSB=
, so
-         * if it is still set... */
-        if ( !(cfg & HPET_TN_FSB) )
-            ch->msi.msi_attrib.maskbit =3D 1;
-        else
-        {
-            ch->msi.msi_attrib.maskbit =3D 0;
-            printk(XENLOG_WARNING "HPET: channel %u is not maskable =
(%04x)\n",
-                   i, cfg);
-        }
-
         if ( !zalloc_cpumask_var(&ch->cpumask) )
         {
             if ( !num_hpets_used )
@@ -570,11 +565,14 @@ void __init hpet_broadcast_init(void)
=20
     for ( i =3D 0; i < n; i++ )
     {
-        /* set HPET Tn as oneshot */
-        cfg =3D hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
-        cfg &=3D ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
-        cfg |=3D HPET_TN_ENABLE | HPET_TN_32BIT;
-        hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
+        if ( i =3D=3D 0 && (cfg & HPET_CFG_LEGACY) )
+        {
+            /* set HPET T0 as oneshot */
+            cfg =3D hpet_read32(HPET_Tn_CFG(0));
+            cfg &=3D ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
+            cfg |=3D HPET_TN_ENABLE | HPET_TN_32BIT;
+            hpet_write32(cfg, HPET_Tn_CFG(0));
+        }
=20
         /*
          * The period is a femto seconds value. We need to calculate the =
scaled
@@ -588,6 +586,7 @@ void __init hpet_broadcast_init(void)
         wmb();
         hpet_events[i].event_handler =3D handle_hpet_broadcast;
=20
+        hpet_events[i].msi.msi_attrib.maskbit =3D 1;
         hpet_events[i].msi.msi_attrib.pos =3D MSI_TYPE_HPET;
     }
=20
@@ -633,6 +632,8 @@ void hpet_broadcast_resume(void)
         cfg =3D hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
         cfg &=3D ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
         cfg |=3D HPET_TN_ENABLE | HPET_TN_32BIT;
+        if ( !(hpet_events[i].flags & HPET_EVT_LEGACY) )
+            cfg |=3D HPET_TN_FSB;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
=20
         hpet_events[i].next_event =3D STIME_MAX;
@@ -811,10 +812,7 @@ void hpet_resume(u32 *boot_cfg)
     {
         cfg =3D hpet_read32(HPET_Tn_CFG(i));
         if ( boot_cfg )
-        {
             boot_cfg[i + 1] =3D cfg;
-            cfg &=3D ~HPET_TN_FSB;
-        }
         cfg &=3D ~HPET_TN_ENABLE;
         if ( cfg & HPET_TN_RESERVED )
         {



--=__PartBA8B4B84.3__=
Content-Type: text/plain; name="x86-HPET-masking.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="x86-HPET-masking.patch"

x86/HPET: fix FSB interrupt masking=0A=0AHPET_TN_FSB is not really =
suitable for masking interrupts - it merely=0Aswitches between the two =
delivery methods. The right way of masking is=0Athrough the HPET_TN_ENABLE =
bit (which really is an interrupt enable,=0Anot a counter enable or some =
such). This is even more so with certain=0Achip sets not even allowing =
HPET_TN_FSB to be cleared on some of the=0Achannels.=0A=0AFurther, all the =
setup of the channel should happen before actually=0Aenabling the =
interrupt, which requires splitting legacy and FSB logic.=0A=0AFinally =
this also fixes an S3 resume problem (HPET_TN_FSB did not get=0Aset in =
hpet_broadcast_resume(), and hpet_msi_unmask() doesn't get=0Acalled from =
the general resume code either afaict).=0A=0ASigned-off-by: Jan Beulich =
<jbeulich@suse.com>=0A=0A--- a/xen/arch/x86/hpet.c=0A+++ b/xen/arch/x86/hpe=
t.c=0A@@ -237,7 +237,7 @@ static void hpet_msi_unmask(struct irq_d=0A     =
struct hpet_event_channel *ch =3D desc->action->dev_id;=0A =0A     cfg =3D =
hpet_read32(HPET_Tn_CFG(ch->idx));=0A-    cfg |=3D HPET_TN_FSB;=0A+    cfg =
|=3D HPET_TN_ENABLE;=0A     hpet_write32(cfg, HPET_Tn_CFG(ch->idx));=0A    =
 ch->msi.msi_attrib.masked =3D 0;=0A }=0A@@ -248,7 +248,7 @@ static void =
hpet_msi_mask(struct irq_des=0A     struct hpet_event_channel *ch =3D =
desc->action->dev_id;=0A =0A     cfg =3D hpet_read32(HPET_Tn_CFG(ch->idx));=
=0A-    cfg &=3D ~HPET_TN_FSB;=0A+    cfg &=3D ~HPET_TN_ENABLE;=0A     =
hpet_write32(cfg, HPET_Tn_CFG(ch->idx));=0A     ch->msi.msi_attrib.masked =
=3D 1;=0A }=0A@@ -328,6 +328,7 @@ static void __hpet_setup_msi_irq(struct =
=0A static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)=0A =
{=0A     int ret;=0A+    u32 cfg =3D hpet_read32(HPET_Tn_CFG(ch->idx));=0A =
    irq_desc_t *desc =3D irq_to_desc(ch->msi.irq);=0A =0A     if ( =
iommu_intremap )=0A@@ -338,6 +339,11 @@ static int __init hpet_setup_msi_ir=
q(str=0A             return ret;=0A     }=0A =0A+    /* set HPET Tn as =
oneshot */=0A+    cfg &=3D ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);=0A+    cfg =
|=3D HPET_TN_FSB | HPET_TN_32BIT;=0A+    hpet_write32(cfg, HPET_Tn_CFG(ch->=
idx));=0A+=0A     desc->handler =3D &hpet_msi_type;=0A     ret =3D =
request_irq(ch->msi.irq, hpet_interrupt_handler, 0, "HPET", ch);=0A     if =
( ret < 0 )=0A@@ -393,17 +399,6 @@ static void __init hpet_fsb_cap_lookup(v=
=0A         if ( !(cfg & HPET_TN_FSB_CAP) )=0A             continue;=0A =
=0A-        /* hpet_setup(), via hpet_resume(), attempted to clear =
HPET_TN_FSB, so=0A-         * if it is still set... */=0A-        if ( =
!(cfg & HPET_TN_FSB) )=0A-            ch->msi.msi_attrib.maskbit =3D =
1;=0A-        else=0A-        {=0A-            ch->msi.msi_attrib.maskbit =
=3D 0;=0A-            printk(XENLOG_WARNING "HPET: channel %u is not =
maskable (%04x)\n",=0A-                   i, cfg);=0A-        }=0A-=0A     =
    if ( !zalloc_cpumask_var(&ch->cpumask) )=0A         {=0A             =
if ( !num_hpets_used )=0A@@ -570,11 +565,14 @@ void __init hpet_broadcast_i=
nit(void)=0A =0A     for ( i =3D 0; i < n; i++ )=0A     {=0A-        /* =
set HPET Tn as oneshot */=0A-        cfg =3D hpet_read32(HPET_Tn_CFG(hpet_e=
vents[i].idx));=0A-        cfg &=3D ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);=0A=
-        cfg |=3D HPET_TN_ENABLE | HPET_TN_32BIT;=0A-        hpet_write32(c=
fg, HPET_Tn_CFG(hpet_events[i].idx));=0A+        if ( i =3D=3D 0 && (cfg & =
HPET_CFG_LEGACY) )=0A+        {=0A+            /* set HPET T0 as oneshot =
*/=0A+            cfg =3D hpet_read32(HPET_Tn_CFG(0));=0A+            cfg =
&=3D ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);=0A+            cfg |=3D =
HPET_TN_ENABLE | HPET_TN_32BIT;=0A+            hpet_write32(cfg, HPET_Tn_CF=
G(0));=0A+        }=0A =0A         /*=0A          * The period is a femto =
seconds value. We need to calculate the scaled=0A@@ -588,6 +586,7 @@ void =
__init hpet_broadcast_init(void)=0A         wmb();=0A         hpet_events[i=
].event_handler =3D handle_hpet_broadcast;=0A =0A+        hpet_events[i].ms=
i.msi_attrib.maskbit =3D 1;=0A         hpet_events[i].msi.msi_attrib.pos =
=3D MSI_TYPE_HPET;=0A     }=0A =0A@@ -633,6 +632,8 @@ void hpet_broadcast_r=
esume(void)=0A         cfg =3D hpet_read32(HPET_Tn_CFG(hpet_events[i].idx))=
;=0A         cfg &=3D ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);=0A         cfg =
|=3D HPET_TN_ENABLE | HPET_TN_32BIT;=0A+        if ( !(hpet_events[i].flags=
 & HPET_EVT_LEGACY) )=0A+            cfg |=3D HPET_TN_FSB;=0A         =
hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));=0A =0A         =
hpet_events[i].next_event =3D STIME_MAX;=0A@@ -811,10 +812,7 @@ void =
hpet_resume(u32 *boot_cfg)=0A     {=0A         cfg =3D hpet_read32(HPET_Tn_=
CFG(i));=0A         if ( boot_cfg )=0A-        {=0A             boot_cfg[i =
+ 1] =3D cfg;=0A-            cfg &=3D ~HPET_TN_FSB;=0A-        }=0A        =
 cfg &=3D ~HPET_TN_ENABLE;=0A         if ( cfg & HPET_TN_RESERVED )=0A     =
    {=0A
--=__PartBA8B4B84.3__=
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.xen.org
http://lists.xen.org/xen-devel

--=__PartBA8B4B84.3__=--


From xen-devel-bounces@lists.xen.org Wed Nov 21 10:18:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:18:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7Nc-0001ku-CP; Wed, 21 Nov 2012 10:18:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb7Na-0001kl-Ga
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 10:18:02 +0000
Received: from [85.158.139.83:55623] by server-13.bemta-5.messagelabs.com id
	E6/57-27809-95AACA05; Wed, 21 Nov 2012 10:18:01 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1353493047!22636408!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1518 invoked from network); 21 Nov 2012 10:17:27 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 10:17:27 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 10:17:26 +0000
Message-Id: <50ACB87E02000078000AA4A8@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 10:18:22 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
In-Reply-To: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part4071B17E.3__="
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: [Xen-devel] [PATCH 3/5] AMD IOMMU: include IOMMU interrupt
 information in 'M' debug key output
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part4071B17E.3__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Note that this also adds a few pieces missing from c/s
25903:5e4a00b4114c (relevant only when the PCI MSI mask bit is
supported by an IOMMU, which apparently isn't the case for existing
implementations).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -263,7 +263,7 @@ static void write_msi_msg(struct msi_des
     }
 }
=20
-static void set_msi_affinity(struct irq_desc *desc, const cpumask_t =
*mask)
+void set_msi_affinity(struct irq_desc *desc, const cpumask_t *mask)
 {
     struct msi_msg msg;
     unsigned int dest;
--- a/xen/drivers/passthrough/amd/iommu_detect.c
+++ b/xen/drivers/passthrough/amd/iommu_detect.c
@@ -39,7 +39,9 @@ static int __init get_iommu_msi_capabili
=20
     AMD_IOMMU_DEBUG("Found MSI capability block at %#x\n", pos);
=20
-    iommu->msi_cap =3D pos;
+    iommu->msi.msi_attrib.type =3D PCI_CAP_ID_MSI;
+    iommu->msi.msi_attrib.pos =3D pos;
+    iommu->msi.msi_attrib.is_64 =3D 1;
     return 0;
 }
=20
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -449,42 +449,10 @@ static void iommu_reset_log(struct amd_i
     ctrl_func(iommu, IOMMU_CONTROL_ENABLED);
 }
=20
-static void iommu_msi_set_affinity(struct irq_desc *desc, const cpumask_t =
*mask)
-{
-    struct msi_msg msg;
-    unsigned int dest;
-    struct amd_iommu *iommu =3D desc->action->dev_id;
-    u16 seg =3D iommu->seg;
-    u8 bus =3D PCI_BUS(iommu->bdf);
-    u8 dev =3D PCI_SLOT(iommu->bdf);
-    u8 func =3D PCI_FUNC(iommu->bdf);
-
-    dest =3D set_desc_affinity(desc, mask);
-
-    if ( dest =3D=3D BAD_APICID )
-    {
-        dprintk(XENLOG_ERR, "Set iommu interrupt affinity error!\n");
-        return;
-    }
-
-    msi_compose_msg(desc, &msg);
-    /* Is this override really needed? */
-    msg.address_lo &=3D ~MSI_ADDR_DEST_ID_MASK;
-    msg.address_lo |=3D MSI_ADDR_DEST_ID(dest & 0xff);
-
-    pci_conf_write32(seg, bus, dev, func,
-        iommu->msi_cap + PCI_MSI_DATA_64, msg.data);
-    pci_conf_write32(seg, bus, dev, func,
-        iommu->msi_cap + PCI_MSI_ADDRESS_LO, msg.address_lo);
-    pci_conf_write32(seg, bus, dev, func,
-        iommu->msi_cap + PCI_MSI_ADDRESS_HI, msg.address_hi);
-   =20
-}
-
 static void amd_iommu_msi_enable(struct amd_iommu *iommu, int flag)
 {
     __msi_set_enable(iommu->seg, PCI_BUS(iommu->bdf), PCI_SLOT(iommu->bdf)=
,
-                     PCI_FUNC(iommu->bdf), iommu->msi_cap, flag);
+                     PCI_FUNC(iommu->bdf), iommu->msi.msi_attrib.pos, =
flag);
 }
=20
 static void iommu_msi_unmask(struct irq_desc *desc)
@@ -495,6 +463,7 @@ static void iommu_msi_unmask(struct irq_
     spin_lock_irqsave(&iommu->lock, flags);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
     spin_unlock_irqrestore(&iommu->lock, flags);
+    iommu->msi.msi_attrib.masked =3D 0;
 }
=20
 static void iommu_msi_mask(struct irq_desc *desc)
@@ -507,6 +476,7 @@ static void iommu_msi_mask(struct irq_de
     spin_lock_irqsave(&iommu->lock, flags);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_DISABLED);
     spin_unlock_irqrestore(&iommu->lock, flags);
+    iommu->msi.msi_attrib.masked =3D 1;
 }
=20
 static unsigned int iommu_msi_startup(struct irq_desc *desc)
@@ -530,7 +500,7 @@ static hw_irq_controller iommu_msi_type=20
     .disable =3D iommu_msi_mask,
     .ack =3D iommu_msi_mask,
     .end =3D iommu_msi_end,
-    .set_affinity =3D iommu_msi_set_affinity,
+    .set_affinity =3D set_msi_affinity,
 };
=20
 static unsigned int iommu_maskable_msi_startup(struct irq_desc *desc)
@@ -561,7 +531,7 @@ static hw_irq_controller iommu_maskable_
     .disable =3D mask_msi_irq,
     .ack =3D iommu_maskable_msi_ack,
     .end =3D iommu_maskable_msi_end,
-    .set_affinity =3D iommu_msi_set_affinity,
+    .set_affinity =3D set_msi_affinity,
 };
=20
 static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
@@ -775,9 +745,11 @@ static void iommu_interrupt_handler(int=20
     tasklet_schedule(&amd_iommu_irq_tasklet);
 }
=20
-static int __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
+static bool_t __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
 {
     int irq, ret;
+    struct irq_desc *desc;
+    unsigned long flags;
     u16 control;
=20
     irq =3D create_irq(NUMA_NO_NODE);
@@ -786,23 +758,38 @@ static int __init set_iommu_interrupt_ha
         dprintk(XENLOG_ERR, "IOMMU: no irqs\n");
         return 0;
     }
-   =20
+
+    desc =3D irq_to_desc(irq);
+    spin_lock_irqsave(&pcidevs_lock, flags);
+    iommu->msi.dev =3D pci_get_pdev(iommu->seg, PCI_BUS(iommu->bdf),
+                                  PCI_DEVFN2(iommu->bdf));
+    spin_unlock_irqrestore(&pcidevs_lock, flags);
+    if ( !iommu->msi.dev )
+    {
+        AMD_IOMMU_DEBUG("IOMMU: no pdev for %04x:%02x:%02x.%u\n",
+                        iommu->seg, PCI_BUS(iommu->bdf),
+                        PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf));
+        return 0;
+    }
+    desc->msi_desc =3D &iommu->msi;
     control =3D pci_conf_read16(iommu->seg, PCI_BUS(iommu->bdf),
                               PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf),
-                              iommu->msi_cap + PCI_MSI_FLAGS);
-    irq_desc[irq].handler =3D control & PCI_MSI_FLAGS_MASKBIT ?
-                            &iommu_maskable_msi_type : &iommu_msi_type;
+                              iommu->msi.msi_attrib.pos + PCI_MSI_FLAGS);
+    iommu->msi.msi_attrib.maskbit =3D !!(control & PCI_MSI_FLAGS_MASKBIT);=

+    desc->handler =3D control & PCI_MSI_FLAGS_MASKBIT ?
+                    &iommu_maskable_msi_type : &iommu_msi_type;
     ret =3D request_irq(irq, iommu_interrupt_handler, 0, "amd_iommu", =
iommu);
     if ( ret )
     {
-        irq_desc[irq].handler =3D &no_irq_type;
+        desc->handler =3D &no_irq_type;
         destroy_irq(irq);
         AMD_IOMMU_DEBUG("can't request irq\n");
         return 0;
     }
=20
-    iommu->irq =3D irq;
-    return irq;
+    iommu->msi.irq =3D irq;
+
+    return 1;
 }
=20
 static void enable_iommu(struct amd_iommu *iommu)
@@ -825,7 +812,7 @@ static void enable_iommu(struct amd_iomm
     if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
         register_iommu_ppr_log_in_mmio_space(iommu);
=20
-    iommu_msi_set_affinity(irq_to_desc(iommu->irq), &cpu_online_map);
+    set_msi_affinity(irq_to_desc(iommu->msi.irq), &cpu_online_map);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
=20
     set_iommu_ht_flags(iommu);
@@ -947,7 +934,7 @@ static int __init amd_iommu_init_one(str
         if ( allocate_ppr_log(iommu) =3D=3D NULL )
             goto error_out;
=20
-    if ( set_iommu_interrupt_handler(iommu) =3D=3D 0 )
+    if ( !set_iommu_interrupt_handler(iommu) )
         goto error_out;
=20
     /* To make sure that device_table.buffer has been successfully =
allocated */
--- a/xen/include/asm-x86/amd-iommu.h
+++ b/xen/include/asm-x86/amd-iommu.h
@@ -25,6 +25,7 @@
 #include <xen/list.h>
 #include <xen/spinlock.h>
 #include <xen/tasklet.h>
+#include <asm/msi.h>
 #include <asm/hvm/svm/amd-iommu-defs.h>
=20
 #define iommu_found()           (!list_empty(&amd_iommu_head))
@@ -82,8 +83,9 @@ struct amd_iommu {
=20
     u16 seg;
     u16 bdf;
+    struct msi_desc msi;
+
     u16 cap_offset;
-    u8 msi_cap;
     iommu_cap_t cap;
=20
     u8 ht_flags;
@@ -103,7 +105,6 @@ struct amd_iommu {
     uint64_t exclusion_limit;
=20
     int enabled;
-    int irq;
 };
=20
 struct ivrs_mappings {
--- a/xen/include/asm-x86/msi.h
+++ b/xen/include/asm-x86/msi.h
@@ -214,5 +214,6 @@ void mask_msi_irq(struct irq_desc *);
 void unmask_msi_irq(struct irq_desc *);
 void ack_nonmaskable_msi_irq(struct irq_desc *);
 void end_nonmaskable_msi_irq(struct irq_desc *, u8 vector);
+void set_msi_affinity(struct irq_desc *, const cpumask_t *);
=20
 #endif /* __ASM_MSI_H */



--=__Part4071B17E.3__=
Content-Type: text/plain; name="AMD-IOMMU-MSI-dump.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="AMD-IOMMU-MSI-dump.patch"

AMD IOMMU: include IOMMU interrupt information in 'M' debug key =
output=0A=0ANote that this also adds a few pieces missing from c/s=0A25903:=
5e4a00b4114c (relevant only when the PCI MSI mask bit is=0Asupported by an =
IOMMU, which apparently isn't the case for existing=0Aimplementations).=0A=
=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- a/xen/arch/x86/m=
si.c=0A+++ b/xen/arch/x86/msi.c=0A@@ -263,7 +263,7 @@ static void =
write_msi_msg(struct msi_des=0A     }=0A }=0A =0A-static void set_msi_affin=
ity(struct irq_desc *desc, const cpumask_t *mask)=0A+void set_msi_affinity(=
struct irq_desc *desc, const cpumask_t *mask)=0A {=0A     struct msi_msg =
msg;=0A     unsigned int dest;=0A--- a/xen/drivers/passthrough/amd/iommu_de=
tect.c=0A+++ b/xen/drivers/passthrough/amd/iommu_detect.c=0A@@ -39,7 +39,9 =
@@ static int __init get_iommu_msi_capabili=0A =0A     AMD_IOMMU_DEBUG("Fou=
nd MSI capability block at %#x\n", pos);=0A =0A-    iommu->msi_cap =3D =
pos;=0A+    iommu->msi.msi_attrib.type =3D PCI_CAP_ID_MSI;=0A+    =
iommu->msi.msi_attrib.pos =3D pos;=0A+    iommu->msi.msi_attrib.is_64 =3D =
1;=0A     return 0;=0A }=0A =0A--- a/xen/drivers/passthrough/amd/iommu_init=
.c=0A+++ b/xen/drivers/passthrough/amd/iommu_init.c=0A@@ -449,42 +449,10 =
@@ static void iommu_reset_log(struct amd_i=0A     ctrl_func(iommu, =
IOMMU_CONTROL_ENABLED);=0A }=0A =0A-static void iommu_msi_set_affinity(stru=
ct irq_desc *desc, const cpumask_t *mask)=0A-{=0A-    struct msi_msg =
msg;=0A-    unsigned int dest;=0A-    struct amd_iommu *iommu =3D =
desc->action->dev_id;=0A-    u16 seg =3D iommu->seg;=0A-    u8 bus =3D =
PCI_BUS(iommu->bdf);=0A-    u8 dev =3D PCI_SLOT(iommu->bdf);=0A-    u8 =
func =3D PCI_FUNC(iommu->bdf);=0A-=0A-    dest =3D set_desc_affinity(desc, =
mask);=0A-=0A-    if ( dest =3D=3D BAD_APICID )=0A-    {=0A-        =
dprintk(XENLOG_ERR, "Set iommu interrupt affinity error!\n");=0A-        =
return;=0A-    }=0A-=0A-    msi_compose_msg(desc, &msg);=0A-    /* Is this =
override really needed? */=0A-    msg.address_lo &=3D ~MSI_ADDR_DEST_ID_MAS=
K;=0A-    msg.address_lo |=3D MSI_ADDR_DEST_ID(dest & 0xff);=0A-=0A-    =
pci_conf_write32(seg, bus, dev, func,=0A-        iommu->msi_cap + =
PCI_MSI_DATA_64, msg.data);=0A-    pci_conf_write32(seg, bus, dev, =
func,=0A-        iommu->msi_cap + PCI_MSI_ADDRESS_LO, msg.address_lo);=0A- =
   pci_conf_write32(seg, bus, dev, func,=0A-        iommu->msi_cap + =
PCI_MSI_ADDRESS_HI, msg.address_hi);=0A-    =0A-}=0A-=0A static void =
amd_iommu_msi_enable(struct amd_iommu *iommu, int flag)=0A {=0A     =
__msi_set_enable(iommu->seg, PCI_BUS(iommu->bdf), PCI_SLOT(iommu->bdf),=0A-=
                     PCI_FUNC(iommu->bdf), iommu->msi_cap, flag);=0A+      =
               PCI_FUNC(iommu->bdf), iommu->msi.msi_attrib.pos, flag);=0A =
}=0A =0A static void iommu_msi_unmask(struct irq_desc *desc)=0A@@ -495,6 =
+463,7 @@ static void iommu_msi_unmask(struct irq_=0A     spin_lock_irqsave=
(&iommu->lock, flags);=0A     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENA=
BLED);=0A     spin_unlock_irqrestore(&iommu->lock, flags);=0A+    =
iommu->msi.msi_attrib.masked =3D 0;=0A }=0A =0A static void iommu_msi_mask(=
struct irq_desc *desc)=0A@@ -507,6 +476,7 @@ static void iommu_msi_mask(str=
uct irq_de=0A     spin_lock_irqsave(&iommu->lock, flags);=0A     amd_iommu_=
msi_enable(iommu, IOMMU_CONTROL_DISABLED);=0A     spin_unlock_irqrestore(&i=
ommu->lock, flags);=0A+    iommu->msi.msi_attrib.masked =3D 1;=0A }=0A =0A =
static unsigned int iommu_msi_startup(struct irq_desc *desc)=0A@@ -530,7 =
+500,7 @@ static hw_irq_controller iommu_msi_type =0A     .disable =3D =
iommu_msi_mask,=0A     .ack =3D iommu_msi_mask,=0A     .end =3D iommu_msi_e=
nd,=0A-    .set_affinity =3D iommu_msi_set_affinity,=0A+    .set_affinity =
=3D set_msi_affinity,=0A };=0A =0A static unsigned int iommu_maskable_msi_s=
tartup(struct irq_desc *desc)=0A@@ -561,7 +531,7 @@ static hw_irq_controlle=
r iommu_maskable_=0A     .disable =3D mask_msi_irq,=0A     .ack =3D =
iommu_maskable_msi_ack,=0A     .end =3D iommu_maskable_msi_end,=0A-    =
.set_affinity =3D iommu_msi_set_affinity,=0A+    .set_affinity =3D =
set_msi_affinity,=0A };=0A =0A static void parse_event_log_entry(struct =
amd_iommu *iommu, u32 entry[])=0A@@ -775,9 +745,11 @@ static void =
iommu_interrupt_handler(int =0A     tasklet_schedule(&amd_iommu_irq_tasklet=
);=0A }=0A =0A-static int __init set_iommu_interrupt_handler(struct =
amd_iommu *iommu)=0A+static bool_t __init set_iommu_interrupt_handler(struc=
t amd_iommu *iommu)=0A {=0A     int irq, ret;=0A+    struct irq_desc =
*desc;=0A+    unsigned long flags;=0A     u16 control;=0A =0A     irq =3D =
create_irq(NUMA_NO_NODE);=0A@@ -786,23 +758,38 @@ static int __init =
set_iommu_interrupt_ha=0A         dprintk(XENLOG_ERR, "IOMMU: no =
irqs\n");=0A         return 0;=0A     }=0A-    =0A+=0A+    desc =3D =
irq_to_desc(irq);=0A+    spin_lock_irqsave(&pcidevs_lock, flags);=0A+    =
iommu->msi.dev =3D pci_get_pdev(iommu->seg, PCI_BUS(iommu->bdf),=0A+       =
                           PCI_DEVFN2(iommu->bdf));=0A+    spin_unlock_irqr=
estore(&pcidevs_lock, flags);=0A+    if ( !iommu->msi.dev )=0A+    {=0A+   =
     AMD_IOMMU_DEBUG("IOMMU: no pdev for %04x:%02x:%02x.%u\n",=0A+         =
               iommu->seg, PCI_BUS(iommu->bdf),=0A+                        =
PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf));=0A+        return 0;=0A+    =
}=0A+    desc->msi_desc =3D &iommu->msi;=0A     control =3D pci_conf_read16=
(iommu->seg, PCI_BUS(iommu->bdf),=0A                               =
PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf),=0A-                            =
  iommu->msi_cap + PCI_MSI_FLAGS);=0A-    irq_desc[irq].handler =3D =
control & PCI_MSI_FLAGS_MASKBIT ?=0A-                            &iommu_mas=
kable_msi_type : &iommu_msi_type;=0A+                              =
iommu->msi.msi_attrib.pos + PCI_MSI_FLAGS);=0A+    iommu->msi.msi_attrib.ma=
skbit =3D !!(control & PCI_MSI_FLAGS_MASKBIT);=0A+    desc->handler =3D =
control & PCI_MSI_FLAGS_MASKBIT ?=0A+                    &iommu_maskable_ms=
i_type : &iommu_msi_type;=0A     ret =3D request_irq(irq, iommu_interrupt_h=
andler, 0, "amd_iommu", iommu);=0A     if ( ret )=0A     {=0A-        =
irq_desc[irq].handler =3D &no_irq_type;=0A+        desc->handler =3D =
&no_irq_type;=0A         destroy_irq(irq);=0A         AMD_IOMMU_DEBUG("can'=
t request irq\n");=0A         return 0;=0A     }=0A =0A-    iommu->irq =3D =
irq;=0A-    return irq;=0A+    iommu->msi.irq =3D irq;=0A+=0A+    return =
1;=0A }=0A =0A static void enable_iommu(struct amd_iommu *iommu)=0A@@ =
-825,7 +812,7 @@ static void enable_iommu(struct amd_iomm=0A     if ( =
iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )=0A         =
register_iommu_ppr_log_in_mmio_space(iommu);=0A =0A-    iommu_msi_set_affin=
ity(irq_to_desc(iommu->irq), &cpu_online_map);=0A+    set_msi_affinity(irq_=
to_desc(iommu->msi.irq), &cpu_online_map);=0A     amd_iommu_msi_enable(iomm=
u, IOMMU_CONTROL_ENABLED);=0A =0A     set_iommu_ht_flags(iommu);=0A@@ =
-947,7 +934,7 @@ static int __init amd_iommu_init_one(str=0A         if ( =
allocate_ppr_log(iommu) =3D=3D NULL )=0A             goto error_out;=0A =
=0A-    if ( set_iommu_interrupt_handler(iommu) =3D=3D 0 )=0A+    if ( =
!set_iommu_interrupt_handler(iommu) )=0A         goto error_out;=0A =0A    =
 /* To make sure that device_table.buffer has been successfully allocated =
*/=0A--- a/xen/include/asm-x86/amd-iommu.h=0A+++ b/xen/include/asm-x86/amd-=
iommu.h=0A@@ -25,6 +25,7 @@=0A #include <xen/list.h>=0A #include <xen/spinl=
ock.h>=0A #include <xen/tasklet.h>=0A+#include <asm/msi.h>=0A #include =
<asm/hvm/svm/amd-iommu-defs.h>=0A =0A #define iommu_found()           =
(!list_empty(&amd_iommu_head))=0A@@ -82,8 +83,9 @@ struct amd_iommu {=0A =
=0A     u16 seg;=0A     u16 bdf;=0A+    struct msi_desc msi;=0A+=0A     =
u16 cap_offset;=0A-    u8 msi_cap;=0A     iommu_cap_t cap;=0A =0A     u8 =
ht_flags;=0A@@ -103,7 +105,6 @@ struct amd_iommu {=0A     uint64_t =
exclusion_limit;=0A =0A     int enabled;=0A-    int irq;=0A };=0A =0A =
struct ivrs_mappings {=0A--- a/xen/include/asm-x86/msi.h=0A+++ b/xen/includ=
e/asm-x86/msi.h=0A@@ -214,5 +214,6 @@ void mask_msi_irq(struct irq_desc =
*);=0A void unmask_msi_irq(struct irq_desc *);=0A void ack_nonmaskable_msi_=
irq(struct irq_desc *);=0A void end_nonmaskable_msi_irq(struct irq_desc *, =
u8 vector);=0A+void set_msi_affinity(struct irq_desc *, const cpumask_t =
*);=0A =0A #endif /* __ASM_MSI_H */=0A
--=__Part4071B17E.3__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part4071B17E.3__=--


From xen-devel-bounces@lists.xen.org Wed Nov 21 10:18:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:18:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7Nc-0001ku-CP; Wed, 21 Nov 2012 10:18:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb7Na-0001kl-Ga
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 10:18:02 +0000
Received: from [85.158.139.83:55623] by server-13.bemta-5.messagelabs.com id
	E6/57-27809-95AACA05; Wed, 21 Nov 2012 10:18:01 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1353493047!22636408!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1518 invoked from network); 21 Nov 2012 10:17:27 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 10:17:27 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 10:17:26 +0000
Message-Id: <50ACB87E02000078000AA4A8@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 10:18:22 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
In-Reply-To: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part4071B17E.3__="
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: [Xen-devel] [PATCH 3/5] AMD IOMMU: include IOMMU interrupt
 information in 'M' debug key output
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part4071B17E.3__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Note that this also adds a few pieces missing from c/s
25903:5e4a00b4114c (relevant only when the PCI MSI mask bit is
supported by an IOMMU, which apparently isn't the case for existing
implementations).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -263,7 +263,7 @@ static void write_msi_msg(struct msi_des
     }
 }
=20
-static void set_msi_affinity(struct irq_desc *desc, const cpumask_t =
*mask)
+void set_msi_affinity(struct irq_desc *desc, const cpumask_t *mask)
 {
     struct msi_msg msg;
     unsigned int dest;
--- a/xen/drivers/passthrough/amd/iommu_detect.c
+++ b/xen/drivers/passthrough/amd/iommu_detect.c
@@ -39,7 +39,9 @@ static int __init get_iommu_msi_capabili
=20
     AMD_IOMMU_DEBUG("Found MSI capability block at %#x\n", pos);
=20
-    iommu->msi_cap =3D pos;
+    iommu->msi.msi_attrib.type =3D PCI_CAP_ID_MSI;
+    iommu->msi.msi_attrib.pos =3D pos;
+    iommu->msi.msi_attrib.is_64 =3D 1;
     return 0;
 }
=20
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -449,42 +449,10 @@ static void iommu_reset_log(struct amd_i
     ctrl_func(iommu, IOMMU_CONTROL_ENABLED);
 }
=20
-static void iommu_msi_set_affinity(struct irq_desc *desc, const cpumask_t =
*mask)
-{
-    struct msi_msg msg;
-    unsigned int dest;
-    struct amd_iommu *iommu =3D desc->action->dev_id;
-    u16 seg =3D iommu->seg;
-    u8 bus =3D PCI_BUS(iommu->bdf);
-    u8 dev =3D PCI_SLOT(iommu->bdf);
-    u8 func =3D PCI_FUNC(iommu->bdf);
-
-    dest =3D set_desc_affinity(desc, mask);
-
-    if ( dest =3D=3D BAD_APICID )
-    {
-        dprintk(XENLOG_ERR, "Set iommu interrupt affinity error!\n");
-        return;
-    }
-
-    msi_compose_msg(desc, &msg);
-    /* Is this override really needed? */
-    msg.address_lo &=3D ~MSI_ADDR_DEST_ID_MASK;
-    msg.address_lo |=3D MSI_ADDR_DEST_ID(dest & 0xff);
-
-    pci_conf_write32(seg, bus, dev, func,
-        iommu->msi_cap + PCI_MSI_DATA_64, msg.data);
-    pci_conf_write32(seg, bus, dev, func,
-        iommu->msi_cap + PCI_MSI_ADDRESS_LO, msg.address_lo);
-    pci_conf_write32(seg, bus, dev, func,
-        iommu->msi_cap + PCI_MSI_ADDRESS_HI, msg.address_hi);
-   =20
-}
-
 static void amd_iommu_msi_enable(struct amd_iommu *iommu, int flag)
 {
     __msi_set_enable(iommu->seg, PCI_BUS(iommu->bdf), PCI_SLOT(iommu->bdf)=
,
-                     PCI_FUNC(iommu->bdf), iommu->msi_cap, flag);
+                     PCI_FUNC(iommu->bdf), iommu->msi.msi_attrib.pos, =
flag);
 }
=20
 static void iommu_msi_unmask(struct irq_desc *desc)
@@ -495,6 +463,7 @@ static void iommu_msi_unmask(struct irq_
     spin_lock_irqsave(&iommu->lock, flags);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
     spin_unlock_irqrestore(&iommu->lock, flags);
+    iommu->msi.msi_attrib.masked =3D 0;
 }
=20
 static void iommu_msi_mask(struct irq_desc *desc)
@@ -507,6 +476,7 @@ static void iommu_msi_mask(struct irq_de
     spin_lock_irqsave(&iommu->lock, flags);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_DISABLED);
     spin_unlock_irqrestore(&iommu->lock, flags);
+    iommu->msi.msi_attrib.masked =3D 1;
 }
=20
 static unsigned int iommu_msi_startup(struct irq_desc *desc)
@@ -530,7 +500,7 @@ static hw_irq_controller iommu_msi_type=20
     .disable =3D iommu_msi_mask,
     .ack =3D iommu_msi_mask,
     .end =3D iommu_msi_end,
-    .set_affinity =3D iommu_msi_set_affinity,
+    .set_affinity =3D set_msi_affinity,
 };
=20
 static unsigned int iommu_maskable_msi_startup(struct irq_desc *desc)
@@ -561,7 +531,7 @@ static hw_irq_controller iommu_maskable_
     .disable =3D mask_msi_irq,
     .ack =3D iommu_maskable_msi_ack,
     .end =3D iommu_maskable_msi_end,
-    .set_affinity =3D iommu_msi_set_affinity,
+    .set_affinity =3D set_msi_affinity,
 };
=20
 static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
@@ -775,9 +745,11 @@ static void iommu_interrupt_handler(int=20
     tasklet_schedule(&amd_iommu_irq_tasklet);
 }
=20
-static int __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
+static bool_t __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
 {
     int irq, ret;
+    struct irq_desc *desc;
+    unsigned long flags;
     u16 control;
=20
     irq =3D create_irq(NUMA_NO_NODE);
@@ -786,23 +758,38 @@ static int __init set_iommu_interrupt_ha
         dprintk(XENLOG_ERR, "IOMMU: no irqs\n");
         return 0;
     }
-   =20
+
+    desc =3D irq_to_desc(irq);
+    spin_lock_irqsave(&pcidevs_lock, flags);
+    iommu->msi.dev =3D pci_get_pdev(iommu->seg, PCI_BUS(iommu->bdf),
+                                  PCI_DEVFN2(iommu->bdf));
+    spin_unlock_irqrestore(&pcidevs_lock, flags);
+    if ( !iommu->msi.dev )
+    {
+        AMD_IOMMU_DEBUG("IOMMU: no pdev for %04x:%02x:%02x.%u\n",
+                        iommu->seg, PCI_BUS(iommu->bdf),
+                        PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf));
+        return 0;
+    }
+    desc->msi_desc =3D &iommu->msi;
     control =3D pci_conf_read16(iommu->seg, PCI_BUS(iommu->bdf),
                               PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf),
-                              iommu->msi_cap + PCI_MSI_FLAGS);
-    irq_desc[irq].handler =3D control & PCI_MSI_FLAGS_MASKBIT ?
-                            &iommu_maskable_msi_type : &iommu_msi_type;
+                              iommu->msi.msi_attrib.pos + PCI_MSI_FLAGS);
+    iommu->msi.msi_attrib.maskbit =3D !!(control & PCI_MSI_FLAGS_MASKBIT);=

+    desc->handler =3D control & PCI_MSI_FLAGS_MASKBIT ?
+                    &iommu_maskable_msi_type : &iommu_msi_type;
     ret =3D request_irq(irq, iommu_interrupt_handler, 0, "amd_iommu", =
iommu);
     if ( ret )
     {
-        irq_desc[irq].handler =3D &no_irq_type;
+        desc->handler =3D &no_irq_type;
         destroy_irq(irq);
         AMD_IOMMU_DEBUG("can't request irq\n");
         return 0;
     }
=20
-    iommu->irq =3D irq;
-    return irq;
+    iommu->msi.irq =3D irq;
+
+    return 1;
 }
=20
 static void enable_iommu(struct amd_iommu *iommu)
@@ -825,7 +812,7 @@ static void enable_iommu(struct amd_iomm
     if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
         register_iommu_ppr_log_in_mmio_space(iommu);
=20
-    iommu_msi_set_affinity(irq_to_desc(iommu->irq), &cpu_online_map);
+    set_msi_affinity(irq_to_desc(iommu->msi.irq), &cpu_online_map);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
=20
     set_iommu_ht_flags(iommu);
@@ -947,7 +934,7 @@ static int __init amd_iommu_init_one(str
         if ( allocate_ppr_log(iommu) =3D=3D NULL )
             goto error_out;
=20
-    if ( set_iommu_interrupt_handler(iommu) =3D=3D 0 )
+    if ( !set_iommu_interrupt_handler(iommu) )
         goto error_out;
=20
     /* To make sure that device_table.buffer has been successfully =
allocated */
--- a/xen/include/asm-x86/amd-iommu.h
+++ b/xen/include/asm-x86/amd-iommu.h
@@ -25,6 +25,7 @@
 #include <xen/list.h>
 #include <xen/spinlock.h>
 #include <xen/tasklet.h>
+#include <asm/msi.h>
 #include <asm/hvm/svm/amd-iommu-defs.h>
=20
 #define iommu_found()           (!list_empty(&amd_iommu_head))
@@ -82,8 +83,9 @@ struct amd_iommu {
=20
     u16 seg;
     u16 bdf;
+    struct msi_desc msi;
+
     u16 cap_offset;
-    u8 msi_cap;
     iommu_cap_t cap;
=20
     u8 ht_flags;
@@ -103,7 +105,6 @@ struct amd_iommu {
     uint64_t exclusion_limit;
=20
     int enabled;
-    int irq;
 };
=20
 struct ivrs_mappings {
--- a/xen/include/asm-x86/msi.h
+++ b/xen/include/asm-x86/msi.h
@@ -214,5 +214,6 @@ void mask_msi_irq(struct irq_desc *);
 void unmask_msi_irq(struct irq_desc *);
 void ack_nonmaskable_msi_irq(struct irq_desc *);
 void end_nonmaskable_msi_irq(struct irq_desc *, u8 vector);
+void set_msi_affinity(struct irq_desc *, const cpumask_t *);
=20
 #endif /* __ASM_MSI_H */



--=__Part4071B17E.3__=
Content-Type: text/plain; name="AMD-IOMMU-MSI-dump.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="AMD-IOMMU-MSI-dump.patch"

AMD IOMMU: include IOMMU interrupt information in 'M' debug key =
output=0A=0ANote that this also adds a few pieces missing from c/s=0A25903:=
5e4a00b4114c (relevant only when the PCI MSI mask bit is=0Asupported by an =
IOMMU, which apparently isn't the case for existing=0Aimplementations).=0A=
=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- a/xen/arch/x86/m=
si.c=0A+++ b/xen/arch/x86/msi.c=0A@@ -263,7 +263,7 @@ static void =
write_msi_msg(struct msi_des=0A     }=0A }=0A =0A-static void set_msi_affin=
ity(struct irq_desc *desc, const cpumask_t *mask)=0A+void set_msi_affinity(=
struct irq_desc *desc, const cpumask_t *mask)=0A {=0A     struct msi_msg =
msg;=0A     unsigned int dest;=0A--- a/xen/drivers/passthrough/amd/iommu_de=
tect.c=0A+++ b/xen/drivers/passthrough/amd/iommu_detect.c=0A@@ -39,7 +39,9 =
@@ static int __init get_iommu_msi_capabili=0A =0A     AMD_IOMMU_DEBUG("Fou=
nd MSI capability block at %#x\n", pos);=0A =0A-    iommu->msi_cap =3D =
pos;=0A+    iommu->msi.msi_attrib.type =3D PCI_CAP_ID_MSI;=0A+    =
iommu->msi.msi_attrib.pos =3D pos;=0A+    iommu->msi.msi_attrib.is_64 =3D =
1;=0A     return 0;=0A }=0A =0A--- a/xen/drivers/passthrough/amd/iommu_init=
.c=0A+++ b/xen/drivers/passthrough/amd/iommu_init.c=0A@@ -449,42 +449,10 =
@@ static void iommu_reset_log(struct amd_i=0A     ctrl_func(iommu, =
IOMMU_CONTROL_ENABLED);=0A }=0A =0A-static void iommu_msi_set_affinity(stru=
ct irq_desc *desc, const cpumask_t *mask)=0A-{=0A-    struct msi_msg =
msg;=0A-    unsigned int dest;=0A-    struct amd_iommu *iommu =3D =
desc->action->dev_id;=0A-    u16 seg =3D iommu->seg;=0A-    u8 bus =3D =
PCI_BUS(iommu->bdf);=0A-    u8 dev =3D PCI_SLOT(iommu->bdf);=0A-    u8 =
func =3D PCI_FUNC(iommu->bdf);=0A-=0A-    dest =3D set_desc_affinity(desc, =
mask);=0A-=0A-    if ( dest =3D=3D BAD_APICID )=0A-    {=0A-        =
dprintk(XENLOG_ERR, "Set iommu interrupt affinity error!\n");=0A-        =
return;=0A-    }=0A-=0A-    msi_compose_msg(desc, &msg);=0A-    /* Is this =
override really needed? */=0A-    msg.address_lo &=3D ~MSI_ADDR_DEST_ID_MAS=
K;=0A-    msg.address_lo |=3D MSI_ADDR_DEST_ID(dest & 0xff);=0A-=0A-    =
pci_conf_write32(seg, bus, dev, func,=0A-        iommu->msi_cap + =
PCI_MSI_DATA_64, msg.data);=0A-    pci_conf_write32(seg, bus, dev, =
func,=0A-        iommu->msi_cap + PCI_MSI_ADDRESS_LO, msg.address_lo);=0A- =
   pci_conf_write32(seg, bus, dev, func,=0A-        iommu->msi_cap + =
PCI_MSI_ADDRESS_HI, msg.address_hi);=0A-    =0A-}=0A-=0A static void =
amd_iommu_msi_enable(struct amd_iommu *iommu, int flag)=0A {=0A     =
__msi_set_enable(iommu->seg, PCI_BUS(iommu->bdf), PCI_SLOT(iommu->bdf),=0A-=
                     PCI_FUNC(iommu->bdf), iommu->msi_cap, flag);=0A+      =
               PCI_FUNC(iommu->bdf), iommu->msi.msi_attrib.pos, flag);=0A =
}=0A =0A static void iommu_msi_unmask(struct irq_desc *desc)=0A@@ -495,6 =
+463,7 @@ static void iommu_msi_unmask(struct irq_=0A     spin_lock_irqsave=
(&iommu->lock, flags);=0A     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENA=
BLED);=0A     spin_unlock_irqrestore(&iommu->lock, flags);=0A+    =
iommu->msi.msi_attrib.masked =3D 0;=0A }=0A =0A static void iommu_msi_mask(=
struct irq_desc *desc)=0A@@ -507,6 +476,7 @@ static void iommu_msi_mask(str=
uct irq_de=0A     spin_lock_irqsave(&iommu->lock, flags);=0A     amd_iommu_=
msi_enable(iommu, IOMMU_CONTROL_DISABLED);=0A     spin_unlock_irqrestore(&i=
ommu->lock, flags);=0A+    iommu->msi.msi_attrib.masked =3D 1;=0A }=0A =0A =
static unsigned int iommu_msi_startup(struct irq_desc *desc)=0A@@ -530,7 =
+500,7 @@ static hw_irq_controller iommu_msi_type =0A     .disable =3D =
iommu_msi_mask,=0A     .ack =3D iommu_msi_mask,=0A     .end =3D iommu_msi_e=
nd,=0A-    .set_affinity =3D iommu_msi_set_affinity,=0A+    .set_affinity =
=3D set_msi_affinity,=0A };=0A =0A static unsigned int iommu_maskable_msi_s=
tartup(struct irq_desc *desc)=0A@@ -561,7 +531,7 @@ static hw_irq_controlle=
r iommu_maskable_=0A     .disable =3D mask_msi_irq,=0A     .ack =3D =
iommu_maskable_msi_ack,=0A     .end =3D iommu_maskable_msi_end,=0A-    =
.set_affinity =3D iommu_msi_set_affinity,=0A+    .set_affinity =3D =
set_msi_affinity,=0A };=0A =0A static void parse_event_log_entry(struct =
amd_iommu *iommu, u32 entry[])=0A@@ -775,9 +745,11 @@ static void =
iommu_interrupt_handler(int =0A     tasklet_schedule(&amd_iommu_irq_tasklet=
);=0A }=0A =0A-static int __init set_iommu_interrupt_handler(struct =
amd_iommu *iommu)=0A+static bool_t __init set_iommu_interrupt_handler(struc=
t amd_iommu *iommu)=0A {=0A     int irq, ret;=0A+    struct irq_desc =
*desc;=0A+    unsigned long flags;=0A     u16 control;=0A =0A     irq =3D =
create_irq(NUMA_NO_NODE);=0A@@ -786,23 +758,38 @@ static int __init =
set_iommu_interrupt_ha=0A         dprintk(XENLOG_ERR, "IOMMU: no =
irqs\n");=0A         return 0;=0A     }=0A-    =0A+=0A+    desc =3D =
irq_to_desc(irq);=0A+    spin_lock_irqsave(&pcidevs_lock, flags);=0A+    =
iommu->msi.dev =3D pci_get_pdev(iommu->seg, PCI_BUS(iommu->bdf),=0A+       =
                           PCI_DEVFN2(iommu->bdf));=0A+    spin_unlock_irqr=
estore(&pcidevs_lock, flags);=0A+    if ( !iommu->msi.dev )=0A+    {=0A+   =
     AMD_IOMMU_DEBUG("IOMMU: no pdev for %04x:%02x:%02x.%u\n",=0A+         =
               iommu->seg, PCI_BUS(iommu->bdf),=0A+                        =
PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf));=0A+        return 0;=0A+    =
}=0A+    desc->msi_desc =3D &iommu->msi;=0A     control =3D pci_conf_read16=
(iommu->seg, PCI_BUS(iommu->bdf),=0A                               =
PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf),=0A-                            =
  iommu->msi_cap + PCI_MSI_FLAGS);=0A-    irq_desc[irq].handler =3D =
control & PCI_MSI_FLAGS_MASKBIT ?=0A-                            &iommu_mas=
kable_msi_type : &iommu_msi_type;=0A+                              =
iommu->msi.msi_attrib.pos + PCI_MSI_FLAGS);=0A+    iommu->msi.msi_attrib.ma=
skbit =3D !!(control & PCI_MSI_FLAGS_MASKBIT);=0A+    desc->handler =3D =
control & PCI_MSI_FLAGS_MASKBIT ?=0A+                    &iommu_maskable_ms=
i_type : &iommu_msi_type;=0A     ret =3D request_irq(irq, iommu_interrupt_h=
andler, 0, "amd_iommu", iommu);=0A     if ( ret )=0A     {=0A-        =
irq_desc[irq].handler =3D &no_irq_type;=0A+        desc->handler =3D =
&no_irq_type;=0A         destroy_irq(irq);=0A         AMD_IOMMU_DEBUG("can'=
t request irq\n");=0A         return 0;=0A     }=0A =0A-    iommu->irq =3D =
irq;=0A-    return irq;=0A+    iommu->msi.irq =3D irq;=0A+=0A+    return =
1;=0A }=0A =0A static void enable_iommu(struct amd_iommu *iommu)=0A@@ =
-825,7 +812,7 @@ static void enable_iommu(struct amd_iomm=0A     if ( =
iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )=0A         =
register_iommu_ppr_log_in_mmio_space(iommu);=0A =0A-    iommu_msi_set_affin=
ity(irq_to_desc(iommu->irq), &cpu_online_map);=0A+    set_msi_affinity(irq_=
to_desc(iommu->msi.irq), &cpu_online_map);=0A     amd_iommu_msi_enable(iomm=
u, IOMMU_CONTROL_ENABLED);=0A =0A     set_iommu_ht_flags(iommu);=0A@@ =
-947,7 +934,7 @@ static int __init amd_iommu_init_one(str=0A         if ( =
allocate_ppr_log(iommu) =3D=3D NULL )=0A             goto error_out;=0A =
=0A-    if ( set_iommu_interrupt_handler(iommu) =3D=3D 0 )=0A+    if ( =
!set_iommu_interrupt_handler(iommu) )=0A         goto error_out;=0A =0A    =
 /* To make sure that device_table.buffer has been successfully allocated =
*/=0A--- a/xen/include/asm-x86/amd-iommu.h=0A+++ b/xen/include/asm-x86/amd-=
iommu.h=0A@@ -25,6 +25,7 @@=0A #include <xen/list.h>=0A #include <xen/spinl=
ock.h>=0A #include <xen/tasklet.h>=0A+#include <asm/msi.h>=0A #include =
<asm/hvm/svm/amd-iommu-defs.h>=0A =0A #define iommu_found()           =
(!list_empty(&amd_iommu_head))=0A@@ -82,8 +83,9 @@ struct amd_iommu {=0A =
=0A     u16 seg;=0A     u16 bdf;=0A+    struct msi_desc msi;=0A+=0A     =
u16 cap_offset;=0A-    u8 msi_cap;=0A     iommu_cap_t cap;=0A =0A     u8 =
ht_flags;=0A@@ -103,7 +105,6 @@ struct amd_iommu {=0A     uint64_t =
exclusion_limit;=0A =0A     int enabled;=0A-    int irq;=0A };=0A =0A =
struct ivrs_mappings {=0A--- a/xen/include/asm-x86/msi.h=0A+++ b/xen/includ=
e/asm-x86/msi.h=0A@@ -214,5 +214,6 @@ void mask_msi_irq(struct irq_desc =
*);=0A void unmask_msi_irq(struct irq_desc *);=0A void ack_nonmaskable_msi_=
irq(struct irq_desc *);=0A void end_nonmaskable_msi_irq(struct irq_desc *, =
u8 vector);=0A+void set_msi_affinity(struct irq_desc *, const cpumask_t =
*);=0A =0A #endif /* __ASM_MSI_H */=0A
--=__Part4071B17E.3__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part4071B17E.3__=--


From xen-devel-bounces@lists.xen.org Wed Nov 21 10:19:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:19:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7OO-0001tE-Do; Wed, 21 Nov 2012 10:18:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb7OM-0001sq-HI
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 10:18:50 +0000
Received: from [85.158.139.83:3184] by server-13.bemta-5.messagelabs.com id
	5E/79-27809-98AACA05; Wed, 21 Nov 2012 10:18:49 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1353493128!24010763!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26787 invoked from network); 21 Nov 2012 10:18:48 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 10:18:48 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 10:18:47 +0000
Message-Id: <50ACB8CE02000078000AA4B0@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 10:19:41 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
In-Reply-To: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part93A262AD.3__="
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: [Xen-devel] [PATCH 5/5] VT-d: adjust IOMMU interrupt affinities
 when all CPUs are online
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part93A262AD.3__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Since these interrupts get setup before APs get brought online, their
affinities naturally could only ever point to CPU 0 alone so far.
Adjust this to include potentially multiple CPUs in the target mask
(when running in one of the cluster modes), and take into account NUMA
information (to handle the interrupts on a CPU on the node where the
respective IOMMU is).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -839,6 +839,7 @@ void acpi_dmar_reinstate(void)
=20
 void acpi_dmar_zap(void)
 {
+    adjust_vtd_irq_affinities();
     if ( dmar_table =3D=3D NULL )
         return;
     dmar_table->signature[0] =3D 'X';
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -52,6 +52,7 @@ int invalidate_sync(struct iommu *iommu)
 int iommu_flush_iec_global(struct iommu *iommu);
 int iommu_flush_iec_index(struct iommu *iommu, u8 im, u16 iidx);
 void clear_fault_bits(struct iommu *iommu);
+int adjust_vtd_irq_affinities(void);
=20
 struct iommu * ioapic_to_iommu(unsigned int apic_id);
 struct iommu * hpet_to_iommu(unsigned int hpet_id);
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1971,6 +1971,33 @@ void clear_fault_bits(struct iommu *iomm
     spin_unlock_irqrestore(&iommu->register_lock, flags);
 }
=20
+static void adjust_irq_affinity(struct acpi_drhd_unit *drhd)
+{
+    const struct acpi_rhsa_unit *rhsa =3D drhd_to_rhsa(drhd);
+    unsigned int node =3D rhsa ? pxm_to_node(rhsa->proximity_domain)
+                             : NUMA_NO_NODE;
+    const cpumask_t *cpumask =3D &cpu_online_map;
+
+    if ( node < MAX_NUMNODES && node_online(node) &&
+         cpumask_intersects(&node_to_cpumask(node), cpumask) )
+        cpumask =3D &node_to_cpumask(node);
+    dma_msi_set_affinity(irq_to_desc(drhd->iommu->msi.irq), cpumask);
+}
+
+int adjust_vtd_irq_affinities(void)
+{
+    struct acpi_drhd_unit *drhd;
+
+    if ( !iommu_enabled )
+        return 0;
+
+    for_each_drhd_unit ( drhd )
+        adjust_irq_affinity(drhd);
+
+    return 0;
+}
+__initcall(adjust_vtd_irq_affinities);
+
 static int init_vtd_hw(void)
 {
     struct acpi_drhd_unit *drhd;
@@ -1984,13 +2011,10 @@ static int init_vtd_hw(void)
      */
     for_each_drhd_unit ( drhd )
     {
-        struct irq_desc *desc;
+        adjust_irq_affinity(drhd);
=20
         iommu =3D drhd->iommu;
=20
-        desc =3D irq_to_desc(iommu->msi.irq);
-        dma_msi_set_affinity(desc, desc->arch.cpu_mask);
-
         clear_fault_bits(iommu);
=20
         spin_lock_irqsave(&iommu->register_lock, flags);




--=__Part93A262AD.3__=
Content-Type: text/plain; name="VT-d-interrupt-affinity.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="VT-d-interrupt-affinity.patch"

VT-d: adjust IOMMU interrupt affinities when all CPUs are online=0A=0ASince=
 these interrupts get setup before APs get brought online, their=0Aaffiniti=
es naturally could only ever point to CPU 0 alone so far.=0AAdjust this to =
include potentially multiple CPUs in the target mask=0A(when running in =
one of the cluster modes), and take into account NUMA=0Ainformation (to =
handle the interrupts on a CPU on the node where the=0Arespective IOMMU =
is).=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- =
a/xen/drivers/passthrough/vtd/dmar.c=0A+++ b/xen/drivers/passthrough/vtd/dm=
ar.c=0A@@ -839,6 +839,7 @@ void acpi_dmar_reinstate(void)=0A =0A void =
acpi_dmar_zap(void)=0A {=0A+    adjust_vtd_irq_affinities();=0A     if ( =
dmar_table =3D=3D NULL )=0A         return;=0A     dmar_table->signature[0]=
 =3D 'X';=0A--- a/xen/drivers/passthrough/vtd/extern.h=0A+++ b/xen/drivers/=
passthrough/vtd/extern.h=0A@@ -52,6 +52,7 @@ int invalidate_sync(struct =
iommu *iommu)=0A int iommu_flush_iec_global(struct iommu *iommu);=0A int =
iommu_flush_iec_index(struct iommu *iommu, u8 im, u16 iidx);=0A void =
clear_fault_bits(struct iommu *iommu);=0A+int adjust_vtd_irq_affinities(voi=
d);=0A =0A struct iommu * ioapic_to_iommu(unsigned int apic_id);=0A struct =
iommu * hpet_to_iommu(unsigned int hpet_id);=0A--- a/xen/drivers/passthroug=
h/vtd/iommu.c=0A+++ b/xen/drivers/passthrough/vtd/iommu.c=0A@@ -1971,6 =
+1971,33 @@ void clear_fault_bits(struct iommu *iomm=0A     spin_unlock_irq=
restore(&iommu->register_lock, flags);=0A }=0A =0A+static void adjust_irq_a=
ffinity(struct acpi_drhd_unit *drhd)=0A+{=0A+    const struct acpi_rhsa_uni=
t *rhsa =3D drhd_to_rhsa(drhd);=0A+    unsigned int node =3D rhsa ? =
pxm_to_node(rhsa->proximity_domain)=0A+                             : =
NUMA_NO_NODE;=0A+    const cpumask_t *cpumask =3D &cpu_online_map;=0A+=0A+ =
   if ( node < MAX_NUMNODES && node_online(node) &&=0A+         cpumask_int=
ersects(&node_to_cpumask(node), cpumask) )=0A+        cpumask =3D =
&node_to_cpumask(node);=0A+    dma_msi_set_affinity(irq_to_desc(drhd->iommu=
->msi.irq), cpumask);=0A+}=0A+=0A+int adjust_vtd_irq_affinities(void)=0A+{=
=0A+    struct acpi_drhd_unit *drhd;=0A+=0A+    if ( !iommu_enabled )=0A+  =
      return 0;=0A+=0A+    for_each_drhd_unit ( drhd )=0A+        =
adjust_irq_affinity(drhd);=0A+=0A+    return 0;=0A+}=0A+__initcall(adjust_v=
td_irq_affinities);=0A+=0A static int init_vtd_hw(void)=0A {=0A     struct =
acpi_drhd_unit *drhd;=0A@@ -1984,13 +2011,10 @@ static int init_vtd_hw(void=
)=0A      */=0A     for_each_drhd_unit ( drhd )=0A     {=0A-        struct =
irq_desc *desc;=0A+        adjust_irq_affinity(drhd);=0A =0A         iommu =
=3D drhd->iommu;=0A =0A-        desc =3D irq_to_desc(iommu->msi.irq);=0A-  =
      dma_msi_set_affinity(desc, desc->arch.cpu_mask);=0A-=0A         =
clear_fault_bits(iommu);=0A =0A         spin_lock_irqsave(&iommu->register_=
lock, flags);=0A
--=__Part93A262AD.3__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part93A262AD.3__=--


From xen-devel-bounces@lists.xen.org Wed Nov 21 10:19:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:19:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7OO-0001tE-Do; Wed, 21 Nov 2012 10:18:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb7OM-0001sq-HI
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 10:18:50 +0000
Received: from [85.158.139.83:3184] by server-13.bemta-5.messagelabs.com id
	5E/79-27809-98AACA05; Wed, 21 Nov 2012 10:18:49 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1353493128!24010763!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26787 invoked from network); 21 Nov 2012 10:18:48 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 10:18:48 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 10:18:47 +0000
Message-Id: <50ACB8CE02000078000AA4B0@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 10:19:41 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
In-Reply-To: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part93A262AD.3__="
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: [Xen-devel] [PATCH 5/5] VT-d: adjust IOMMU interrupt affinities
 when all CPUs are online
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part93A262AD.3__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Since these interrupts get setup before APs get brought online, their
affinities naturally could only ever point to CPU 0 alone so far.
Adjust this to include potentially multiple CPUs in the target mask
(when running in one of the cluster modes), and take into account NUMA
information (to handle the interrupts on a CPU on the node where the
respective IOMMU is).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -839,6 +839,7 @@ void acpi_dmar_reinstate(void)
=20
 void acpi_dmar_zap(void)
 {
+    adjust_vtd_irq_affinities();
     if ( dmar_table =3D=3D NULL )
         return;
     dmar_table->signature[0] =3D 'X';
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -52,6 +52,7 @@ int invalidate_sync(struct iommu *iommu)
 int iommu_flush_iec_global(struct iommu *iommu);
 int iommu_flush_iec_index(struct iommu *iommu, u8 im, u16 iidx);
 void clear_fault_bits(struct iommu *iommu);
+int adjust_vtd_irq_affinities(void);
=20
 struct iommu * ioapic_to_iommu(unsigned int apic_id);
 struct iommu * hpet_to_iommu(unsigned int hpet_id);
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1971,6 +1971,33 @@ void clear_fault_bits(struct iommu *iomm
     spin_unlock_irqrestore(&iommu->register_lock, flags);
 }
=20
+static void adjust_irq_affinity(struct acpi_drhd_unit *drhd)
+{
+    const struct acpi_rhsa_unit *rhsa =3D drhd_to_rhsa(drhd);
+    unsigned int node =3D rhsa ? pxm_to_node(rhsa->proximity_domain)
+                             : NUMA_NO_NODE;
+    const cpumask_t *cpumask =3D &cpu_online_map;
+
+    if ( node < MAX_NUMNODES && node_online(node) &&
+         cpumask_intersects(&node_to_cpumask(node), cpumask) )
+        cpumask =3D &node_to_cpumask(node);
+    dma_msi_set_affinity(irq_to_desc(drhd->iommu->msi.irq), cpumask);
+}
+
+int adjust_vtd_irq_affinities(void)
+{
+    struct acpi_drhd_unit *drhd;
+
+    if ( !iommu_enabled )
+        return 0;
+
+    for_each_drhd_unit ( drhd )
+        adjust_irq_affinity(drhd);
+
+    return 0;
+}
+__initcall(adjust_vtd_irq_affinities);
+
 static int init_vtd_hw(void)
 {
     struct acpi_drhd_unit *drhd;
@@ -1984,13 +2011,10 @@ static int init_vtd_hw(void)
      */
     for_each_drhd_unit ( drhd )
     {
-        struct irq_desc *desc;
+        adjust_irq_affinity(drhd);
=20
         iommu =3D drhd->iommu;
=20
-        desc =3D irq_to_desc(iommu->msi.irq);
-        dma_msi_set_affinity(desc, desc->arch.cpu_mask);
-
         clear_fault_bits(iommu);
=20
         spin_lock_irqsave(&iommu->register_lock, flags);




--=__Part93A262AD.3__=
Content-Type: text/plain; name="VT-d-interrupt-affinity.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="VT-d-interrupt-affinity.patch"

VT-d: adjust IOMMU interrupt affinities when all CPUs are online=0A=0ASince=
 these interrupts get setup before APs get brought online, their=0Aaffiniti=
es naturally could only ever point to CPU 0 alone so far.=0AAdjust this to =
include potentially multiple CPUs in the target mask=0A(when running in =
one of the cluster modes), and take into account NUMA=0Ainformation (to =
handle the interrupts on a CPU on the node where the=0Arespective IOMMU =
is).=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- =
a/xen/drivers/passthrough/vtd/dmar.c=0A+++ b/xen/drivers/passthrough/vtd/dm=
ar.c=0A@@ -839,6 +839,7 @@ void acpi_dmar_reinstate(void)=0A =0A void =
acpi_dmar_zap(void)=0A {=0A+    adjust_vtd_irq_affinities();=0A     if ( =
dmar_table =3D=3D NULL )=0A         return;=0A     dmar_table->signature[0]=
 =3D 'X';=0A--- a/xen/drivers/passthrough/vtd/extern.h=0A+++ b/xen/drivers/=
passthrough/vtd/extern.h=0A@@ -52,6 +52,7 @@ int invalidate_sync(struct =
iommu *iommu)=0A int iommu_flush_iec_global(struct iommu *iommu);=0A int =
iommu_flush_iec_index(struct iommu *iommu, u8 im, u16 iidx);=0A void =
clear_fault_bits(struct iommu *iommu);=0A+int adjust_vtd_irq_affinities(voi=
d);=0A =0A struct iommu * ioapic_to_iommu(unsigned int apic_id);=0A struct =
iommu * hpet_to_iommu(unsigned int hpet_id);=0A--- a/xen/drivers/passthroug=
h/vtd/iommu.c=0A+++ b/xen/drivers/passthrough/vtd/iommu.c=0A@@ -1971,6 =
+1971,33 @@ void clear_fault_bits(struct iommu *iomm=0A     spin_unlock_irq=
restore(&iommu->register_lock, flags);=0A }=0A =0A+static void adjust_irq_a=
ffinity(struct acpi_drhd_unit *drhd)=0A+{=0A+    const struct acpi_rhsa_uni=
t *rhsa =3D drhd_to_rhsa(drhd);=0A+    unsigned int node =3D rhsa ? =
pxm_to_node(rhsa->proximity_domain)=0A+                             : =
NUMA_NO_NODE;=0A+    const cpumask_t *cpumask =3D &cpu_online_map;=0A+=0A+ =
   if ( node < MAX_NUMNODES && node_online(node) &&=0A+         cpumask_int=
ersects(&node_to_cpumask(node), cpumask) )=0A+        cpumask =3D =
&node_to_cpumask(node);=0A+    dma_msi_set_affinity(irq_to_desc(drhd->iommu=
->msi.irq), cpumask);=0A+}=0A+=0A+int adjust_vtd_irq_affinities(void)=0A+{=
=0A+    struct acpi_drhd_unit *drhd;=0A+=0A+    if ( !iommu_enabled )=0A+  =
      return 0;=0A+=0A+    for_each_drhd_unit ( drhd )=0A+        =
adjust_irq_affinity(drhd);=0A+=0A+    return 0;=0A+}=0A+__initcall(adjust_v=
td_irq_affinities);=0A+=0A static int init_vtd_hw(void)=0A {=0A     struct =
acpi_drhd_unit *drhd;=0A@@ -1984,13 +2011,10 @@ static int init_vtd_hw(void=
)=0A      */=0A     for_each_drhd_unit ( drhd )=0A     {=0A-        struct =
irq_desc *desc;=0A+        adjust_irq_affinity(drhd);=0A =0A         iommu =
=3D drhd->iommu;=0A =0A-        desc =3D irq_to_desc(iommu->msi.irq);=0A-  =
      dma_msi_set_affinity(desc, desc->arch.cpu_mask);=0A-=0A         =
clear_fault_bits(iommu);=0A =0A         spin_lock_irqsave(&iommu->register_=
lock, flags);=0A
--=__Part93A262AD.3__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part93A262AD.3__=--


From xen-devel-bounces@lists.xen.org Wed Nov 21 10:27:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:27:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7Ws-0002OE-Do; Wed, 21 Nov 2012 10:27:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1Tb7Wq-0002O8-Ow
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 10:27:37 +0000
Received: from [85.158.139.83:8656] by server-12.bemta-5.messagelabs.com id
	A0/BC-02886-79CACA05; Wed, 21 Nov 2012 10:27:35 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1353493653!24012381!1
X-Originating-IP: [209.85.212.43]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30156 invoked from network); 21 Nov 2012 10:27:34 -0000
Received: from mail-vb0-f43.google.com (HELO mail-vb0-f43.google.com)
	(209.85.212.43)
	by server-11.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 10:27:34 -0000
Received: by mail-vb0-f43.google.com with SMTP id fn1so4579187vbb.30
	for <xen-devel@lists.xensource.com>;
	Wed, 21 Nov 2012 02:27:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=JSCO7TsB26n3nVSeknyaEfKMuwooa4oOPV73wNf+sPU=;
	b=V3RVCdEibmfFxd0LEqV5wvGP0TL7oabS+rNsvLlL1dOnq6BppAOV31/8GLFDEe0gpQ
	7y0sbk3h4NMR5FMTHxHSRqACK7x8+Y/YvLHCohg2QMFFmLWf/cbjWsbqRdFjIutcnZ1G
	TlVuskBBF0YbZti9isamLxYyfbR/x7sQSDp6BS4GRTVnutmmp5bRmmAD6BVudUKs4ojA
	PMosCOF2pA0SWb8JC45D+JaTd/ditucmC4XY/sBvNavw0+uIgOUy5lnTuC1VHZRP7IlJ
	jnC+cbFnu4VZBcBeQAoMQQvTl3mPM1cLvmx96vrMB9/tXx1MrRPHLM7iqUNtkgGy62RO
	TD5w==
MIME-Version: 1.0
Received: by 10.220.142.8 with SMTP id o8mr27989141vcu.23.1353493653326; Wed,
	21 Nov 2012 02:27:33 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Wed, 21 Nov 2012 02:27:33 -0800 (PST)
In-Reply-To: <ab313e9521f44bdd91a2.1353427784@elijah>
References: <ab313e9521f44bdd91a2.1353427784@elijah>
Date: Wed, 21 Nov 2012 10:27:33 +0000
X-Google-Sender-Auth: rFJDm40IZwM9Er7WTuEg7cbz0WM
Message-ID: <CAFLBxZY3-LXcPHW77pnZqnXY_6miXtGs+twtzAUyT99B69mo9A@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xl: Suppress spurious warning message for
	cpupool-list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6279582160006823125=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6279582160006823125==
Content-Type: multipart/alternative; boundary=f46d043890b9698aeb04cefecc59

--f46d043890b9698aeb04cefecc59
Content-Type: text/plain; charset=ISO-8859-1

I suppose I should have labelled this one "v2" -- oops. :-)
 -George


On Tue, Nov 20, 2012 at 4:09 PM, George Dunlap
<george.dunlap@eu.citrix.com>wrote:

> # HG changeset patch
> # User George Dunlap <george.dunlap@eu.citrix.com>
> # Date 1353427397 0
> # Node ID ab313e9521f44bdd91a20a1b3eb499b2ee321b5e
> # Parent  ae6fb202b233af815466055d9f1a635802a50855
> xl: Suppress spurious warning message for cpupool-list
>
> libxl_cpupool_list() enumerates the cpupools by "probing": calling
> cpupool_info, starting at 0 and stopping when it gets an error. However,
> cpupool_info will print an error when the call to xc_cpupool_getinfo()
> fails,
> resulting in every xl command that uses libxl_list_cpupool (such as
> cpupool-list) printing that error message spuriously.
>
> Since at the moment the times we want to print the message correspond
> with the use of the existing "exact" parameter, use it to decide
> whether to print the message or not.
>
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
>
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -593,7 +593,8 @@ static int cpupool_info(libxl__gc *gc,
>      xcinfo = xc_cpupool_getinfo(CTX->xch, poolid);
>      if (xcinfo == NULL)
>      {
> -        LOGE(ERROR, "failed to get info for cpupool%d\n", poolid);
> +        if (exact || errno != ENOENT)
> +            LOGE(ERROR, "failed to get info for cpupool%d\n", poolid);
>          return ERROR_FAIL;
>      }
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>

--f46d043890b9698aeb04cefecc59
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I suppose I should have labelled this one &quot;v2&quot; -- oops. :-)<br>=
=A0-George<br><div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote"=
>On Tue, Nov 20, 2012 at 4:09 PM, George Dunlap <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:george.dunlap@eu.citrix.com" target=3D"_blank">george.dunlap@e=
u.citrix.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">geo=
rge.dunlap@eu.citrix.com</a>&gt;<br>
# Date 1353427397 0<br>
# Node ID ab313e9521f44bdd91a20a1b3eb499b2ee321b5e<br>
# Parent =A0ae6fb202b233af815466055d9f1a635802a50855<br>
xl: Suppress spurious warning message for cpupool-list<br>
<br>
libxl_cpupool_list() enumerates the cpupools by &quot;probing&quot;: callin=
g<br>
cpupool_info, starting at 0 and stopping when it gets an error. However,<br=
>
cpupool_info will print an error when the call to xc_cpupool_getinfo() fail=
s,<br>
resulting in every xl command that uses libxl_list_cpupool (such as<br>
cpupool-list) printing that error message spuriously.<br>
<br>
Since at the moment the times we want to print the message correspond<br>
with the use of the existing &quot;exact&quot; parameter, use it to decide<=
br>
whether to print the message or not.<br>
<br>
Signed-off-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.=
com">george.dunlap@eu.citrix.com</a>&gt;<br>
<br>
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c<br>
--- a/tools/libxl/libxl.c<br>
+++ b/tools/libxl/libxl.c<br>
@@ -593,7 +593,8 @@ static int cpupool_info(libxl__gc *gc,<br>
=A0 =A0 =A0xcinfo =3D xc_cpupool_getinfo(CTX-&gt;xch, poolid);<br>
=A0 =A0 =A0if (xcinfo =3D=3D NULL)<br>
=A0 =A0 =A0{<br>
- =A0 =A0 =A0 =A0LOGE(ERROR, &quot;failed to get info for cpupool%d\n&quot;=
, poolid);<br>
+ =A0 =A0 =A0 =A0if (exact || errno !=3D ENOENT)<br>
+ =A0 =A0 =A0 =A0 =A0 =A0LOGE(ERROR, &quot;failed to get info for cpupool%d=
\n&quot;, poolid);<br>
=A0 =A0 =A0 =A0 =A0return ERROR_FAIL;<br>
=A0 =A0 =A0}<br>
<br>
<br>
_______________________________________________<br>
Xen-devel mailing list<br>
<a href=3D"mailto:Xen-devel@lists.xen.org">Xen-devel@lists.xen.org</a><br>
<a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://lists.x=
en.org/xen-devel</a><br>
</blockquote></div><br></div>

--f46d043890b9698aeb04cefecc59--


--===============6279582160006823125==
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.xen.org
http://lists.xen.org/xen-devel

--===============6279582160006823125==--


From xen-devel-bounces@lists.xen.org Wed Nov 21 10:27:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:27:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7Ws-0002OE-Do; Wed, 21 Nov 2012 10:27:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1Tb7Wq-0002O8-Ow
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 10:27:37 +0000
Received: from [85.158.139.83:8656] by server-12.bemta-5.messagelabs.com id
	A0/BC-02886-79CACA05; Wed, 21 Nov 2012 10:27:35 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1353493653!24012381!1
X-Originating-IP: [209.85.212.43]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30156 invoked from network); 21 Nov 2012 10:27:34 -0000
Received: from mail-vb0-f43.google.com (HELO mail-vb0-f43.google.com)
	(209.85.212.43)
	by server-11.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 10:27:34 -0000
Received: by mail-vb0-f43.google.com with SMTP id fn1so4579187vbb.30
	for <xen-devel@lists.xensource.com>;
	Wed, 21 Nov 2012 02:27:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=JSCO7TsB26n3nVSeknyaEfKMuwooa4oOPV73wNf+sPU=;
	b=V3RVCdEibmfFxd0LEqV5wvGP0TL7oabS+rNsvLlL1dOnq6BppAOV31/8GLFDEe0gpQ
	7y0sbk3h4NMR5FMTHxHSRqACK7x8+Y/YvLHCohg2QMFFmLWf/cbjWsbqRdFjIutcnZ1G
	TlVuskBBF0YbZti9isamLxYyfbR/x7sQSDp6BS4GRTVnutmmp5bRmmAD6BVudUKs4ojA
	PMosCOF2pA0SWb8JC45D+JaTd/ditucmC4XY/sBvNavw0+uIgOUy5lnTuC1VHZRP7IlJ
	jnC+cbFnu4VZBcBeQAoMQQvTl3mPM1cLvmx96vrMB9/tXx1MrRPHLM7iqUNtkgGy62RO
	TD5w==
MIME-Version: 1.0
Received: by 10.220.142.8 with SMTP id o8mr27989141vcu.23.1353493653326; Wed,
	21 Nov 2012 02:27:33 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Wed, 21 Nov 2012 02:27:33 -0800 (PST)
In-Reply-To: <ab313e9521f44bdd91a2.1353427784@elijah>
References: <ab313e9521f44bdd91a2.1353427784@elijah>
Date: Wed, 21 Nov 2012 10:27:33 +0000
X-Google-Sender-Auth: rFJDm40IZwM9Er7WTuEg7cbz0WM
Message-ID: <CAFLBxZY3-LXcPHW77pnZqnXY_6miXtGs+twtzAUyT99B69mo9A@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xl: Suppress spurious warning message for
	cpupool-list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6279582160006823125=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6279582160006823125==
Content-Type: multipart/alternative; boundary=f46d043890b9698aeb04cefecc59

--f46d043890b9698aeb04cefecc59
Content-Type: text/plain; charset=ISO-8859-1

I suppose I should have labelled this one "v2" -- oops. :-)
 -George


On Tue, Nov 20, 2012 at 4:09 PM, George Dunlap
<george.dunlap@eu.citrix.com>wrote:

> # HG changeset patch
> # User George Dunlap <george.dunlap@eu.citrix.com>
> # Date 1353427397 0
> # Node ID ab313e9521f44bdd91a20a1b3eb499b2ee321b5e
> # Parent  ae6fb202b233af815466055d9f1a635802a50855
> xl: Suppress spurious warning message for cpupool-list
>
> libxl_cpupool_list() enumerates the cpupools by "probing": calling
> cpupool_info, starting at 0 and stopping when it gets an error. However,
> cpupool_info will print an error when the call to xc_cpupool_getinfo()
> fails,
> resulting in every xl command that uses libxl_list_cpupool (such as
> cpupool-list) printing that error message spuriously.
>
> Since at the moment the times we want to print the message correspond
> with the use of the existing "exact" parameter, use it to decide
> whether to print the message or not.
>
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
>
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -593,7 +593,8 @@ static int cpupool_info(libxl__gc *gc,
>      xcinfo = xc_cpupool_getinfo(CTX->xch, poolid);
>      if (xcinfo == NULL)
>      {
> -        LOGE(ERROR, "failed to get info for cpupool%d\n", poolid);
> +        if (exact || errno != ENOENT)
> +            LOGE(ERROR, "failed to get info for cpupool%d\n", poolid);
>          return ERROR_FAIL;
>      }
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>

--f46d043890b9698aeb04cefecc59
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I suppose I should have labelled this one &quot;v2&quot; -- oops. :-)<br>=
=A0-George<br><div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote"=
>On Tue, Nov 20, 2012 at 4:09 PM, George Dunlap <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:george.dunlap@eu.citrix.com" target=3D"_blank">george.dunlap@e=
u.citrix.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">geo=
rge.dunlap@eu.citrix.com</a>&gt;<br>
# Date 1353427397 0<br>
# Node ID ab313e9521f44bdd91a20a1b3eb499b2ee321b5e<br>
# Parent =A0ae6fb202b233af815466055d9f1a635802a50855<br>
xl: Suppress spurious warning message for cpupool-list<br>
<br>
libxl_cpupool_list() enumerates the cpupools by &quot;probing&quot;: callin=
g<br>
cpupool_info, starting at 0 and stopping when it gets an error. However,<br=
>
cpupool_info will print an error when the call to xc_cpupool_getinfo() fail=
s,<br>
resulting in every xl command that uses libxl_list_cpupool (such as<br>
cpupool-list) printing that error message spuriously.<br>
<br>
Since at the moment the times we want to print the message correspond<br>
with the use of the existing &quot;exact&quot; parameter, use it to decide<=
br>
whether to print the message or not.<br>
<br>
Signed-off-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.=
com">george.dunlap@eu.citrix.com</a>&gt;<br>
<br>
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c<br>
--- a/tools/libxl/libxl.c<br>
+++ b/tools/libxl/libxl.c<br>
@@ -593,7 +593,8 @@ static int cpupool_info(libxl__gc *gc,<br>
=A0 =A0 =A0xcinfo =3D xc_cpupool_getinfo(CTX-&gt;xch, poolid);<br>
=A0 =A0 =A0if (xcinfo =3D=3D NULL)<br>
=A0 =A0 =A0{<br>
- =A0 =A0 =A0 =A0LOGE(ERROR, &quot;failed to get info for cpupool%d\n&quot;=
, poolid);<br>
+ =A0 =A0 =A0 =A0if (exact || errno !=3D ENOENT)<br>
+ =A0 =A0 =A0 =A0 =A0 =A0LOGE(ERROR, &quot;failed to get info for cpupool%d=
\n&quot;, poolid);<br>
=A0 =A0 =A0 =A0 =A0return ERROR_FAIL;<br>
=A0 =A0 =A0}<br>
<br>
<br>
_______________________________________________<br>
Xen-devel mailing list<br>
<a href=3D"mailto:Xen-devel@lists.xen.org">Xen-devel@lists.xen.org</a><br>
<a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://lists.x=
en.org/xen-devel</a><br>
</blockquote></div><br></div>

--f46d043890b9698aeb04cefecc59--


--===============6279582160006823125==
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.xen.org
http://lists.xen.org/xen-devel

--===============6279582160006823125==--


From xen-devel-bounces@lists.xen.org Wed Nov 21 10:30:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:30:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7ZR-0002Ug-06; Wed, 21 Nov 2012 10:30:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb7ZP-0002UW-4Y
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 10:30:15 +0000
Received: from [85.158.143.35:11676] by server-1.bemta-4.messagelabs.com id
	67/43-27934-63DACA05; Wed, 21 Nov 2012 10:30:14 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1353493716!17970719!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22658 invoked from network); 21 Nov 2012 10:28:36 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-21.messagelabs.com with SMTP;
	21 Nov 2012 10:28:36 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 10:28:35 +0000
Message-Id: <50ACBB1A02000078000AA4E2@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 10:29:30 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mats Petersson" <mats.petersson@citrix.com>
References: <1353077152-29630-1-git-send-email-mats.petersson@citrix.com>
In-Reply-To: <1353077152-29630-1-git-send-email-mats.petersson@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: konrad.wilk@oracle.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] Improve performance of
 IOCTL_PRIVCMD_MMAPBATCH_V2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 15:45, Mats Petersson <mats.petersson@citrix.com> wrote:
> @@ -2526,12 +2540,25 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
>  		if (err)
>  			goto out;
>  
> -		err = HYPERVISOR_mmu_update(mmu_update, batch, NULL, domid);
> -		if (err < 0)
> -			goto out;
> +		/* We record the error for each page that gives an error, but
> +		 * continue mapping until the whole set is done */
> +		do {
> +			err = HYPERVISOR_mmu_update(&mmu_update[index],
> +						    batch_left, &done, domid);
> +			if (err < 0) {
> +				if (err_ptr)
> +					err_ptr[index] = err;

Shouldn't you increment "done" here, in order to not retry the failed
slot immediately?

> +				else /* exit if error and no err_ptr */
> +					goto out;
> +			}
> +			batch_left -= done;
> +			index += done;
> +		} while (batch_left);
>  
>  		nr -= batch;
>  		addr += range;
> +		if (err_ptr)
> +			err_ptr += batch;
>  	}
>  
>  	err = 0;
> @@ -303,6 +349,8 @@ static int mmap_return_errors_v1(void *data, void *state)
>  	return __put_user(*mfnp, st->user_mfn++);
>  }
>  
> +
> +

???

>  static struct vm_operations_struct privcmd_vm_ops;
>  
>  static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
> @@ -319,6 +367,8 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, 
> int version)
>  	if (!xen_initial_domain())
>  		return -EPERM;
>  
> +
> +

???

Jan

>  	switch (version) {
>  	case 1:
>  		if (copy_from_user(&m, udata, sizeof(struct privcmd_mmapbatch)))



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 10:30:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:30:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7ZR-0002Ug-06; Wed, 21 Nov 2012 10:30:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb7ZP-0002UW-4Y
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 10:30:15 +0000
Received: from [85.158.143.35:11676] by server-1.bemta-4.messagelabs.com id
	67/43-27934-63DACA05; Wed, 21 Nov 2012 10:30:14 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1353493716!17970719!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22658 invoked from network); 21 Nov 2012 10:28:36 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-21.messagelabs.com with SMTP;
	21 Nov 2012 10:28:36 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 10:28:35 +0000
Message-Id: <50ACBB1A02000078000AA4E2@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 10:29:30 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mats Petersson" <mats.petersson@citrix.com>
References: <1353077152-29630-1-git-send-email-mats.petersson@citrix.com>
In-Reply-To: <1353077152-29630-1-git-send-email-mats.petersson@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: konrad.wilk@oracle.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] Improve performance of
 IOCTL_PRIVCMD_MMAPBATCH_V2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 16.11.12 at 15:45, Mats Petersson <mats.petersson@citrix.com> wrote:
> @@ -2526,12 +2540,25 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
>  		if (err)
>  			goto out;
>  
> -		err = HYPERVISOR_mmu_update(mmu_update, batch, NULL, domid);
> -		if (err < 0)
> -			goto out;
> +		/* We record the error for each page that gives an error, but
> +		 * continue mapping until the whole set is done */
> +		do {
> +			err = HYPERVISOR_mmu_update(&mmu_update[index],
> +						    batch_left, &done, domid);
> +			if (err < 0) {
> +				if (err_ptr)
> +					err_ptr[index] = err;

Shouldn't you increment "done" here, in order to not retry the failed
slot immediately?

> +				else /* exit if error and no err_ptr */
> +					goto out;
> +			}
> +			batch_left -= done;
> +			index += done;
> +		} while (batch_left);
>  
>  		nr -= batch;
>  		addr += range;
> +		if (err_ptr)
> +			err_ptr += batch;
>  	}
>  
>  	err = 0;
> @@ -303,6 +349,8 @@ static int mmap_return_errors_v1(void *data, void *state)
>  	return __put_user(*mfnp, st->user_mfn++);
>  }
>  
> +
> +

???

>  static struct vm_operations_struct privcmd_vm_ops;
>  
>  static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
> @@ -319,6 +367,8 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, 
> int version)
>  	if (!xen_initial_domain())
>  		return -EPERM;
>  
> +
> +

???

Jan

>  	switch (version) {
>  	case 1:
>  		if (copy_from_user(&m, udata, sizeof(struct privcmd_mmapbatch)))



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 10:51:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:51:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7u6-0002rB-UC; Wed, 21 Nov 2012 10:51:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1Tb7u5-0002r6-FD
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 10:51:37 +0000
Received: from [85.158.138.51:14306] by server-16.bemta-3.messagelabs.com id
	4B/F1-07461-832BCA05; Wed, 21 Nov 2012 10:51:36 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1353495089!24536348!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUyNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20676 invoked from network); 21 Nov 2012 10:51:31 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 10:51:31 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="45274853"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	21 Nov 2012 10:51:28 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Wed, 21 Nov 2012 05:51:27 -0500
Message-ID: <50ACB22E.4070101@citrix.com>
Date: Wed, 21 Nov 2012 10:51:26 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <1353077152-29630-1-git-send-email-mats.petersson@citrix.com>
	<50ACBB1A02000078000AA4E2@nat28.tlf.novell.com>
In-Reply-To: <50ACBB1A02000078000AA4E2@nat28.tlf.novell.com>
X-Originating-IP: [10.80.3.146]
Cc: "konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Improve performance of
	IOCTL_PRIVCMD_MMAPBATCH_V2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 21/11/12 10:29, Jan Beulich wrote:
>>>> On 16.11.12 at 15:45, Mats Petersson <mats.petersson@citrix.com> wrote:
>> @@ -2526,12 +2540,25 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
>>   		if (err)
>>   			goto out;
>>   
>> -		err = HYPERVISOR_mmu_update(mmu_update, batch, NULL, domid);
>> -		if (err < 0)
>> -			goto out;
>> +		/* We record the error for each page that gives an error, but
>> +		 * continue mapping until the whole set is done */
>> +		do {
>> +			err = HYPERVISOR_mmu_update(&mmu_update[index],
>> +						    batch_left, &done, domid);
>> +			if (err < 0) {
>> +				if (err_ptr)
>> +					err_ptr[index] = err;
> Shouldn't you increment "done" here, in order to not retry the failed
> slot immediately?

Yes, good spot - for some reason, I have double checked the behaviour of 
"done", and it returns the index of the item which gave the error, not 
actually "how many were processed".

I have rewritten this part of code for V3 of this patch, but I think it 
still requires an increment of "done" to make it work correctly.
>
>> +				else /* exit if error and no err_ptr */
>> +					goto out;
>> +			}
>> +			batch_left -= done;
>> +			index += done;
>> +		} while (batch_left);
>>   
>>   		nr -= batch;
>>   		addr += range;
>> +		if (err_ptr)
>> +			err_ptr += batch;
>>   	}
>>   
>>   	err = 0;
>> @@ -303,6 +349,8 @@ static int mmap_return_errors_v1(void *data, void *state)
>>   	return __put_user(*mfnp, st->user_mfn++);
>>   }
>>   
>> +
>> +
> ???
This is cleaned up in the V3 patch.
>>   static struct vm_operations_struct privcmd_vm_ops;
>>   
>>   static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
>> @@ -319,6 +367,8 @@ static long privcmd_ioctl_mmap_batch(void __user *udata,
>> int version)
>>   	if (!xen_initial_domain())
>>   		return -EPERM;
>>   
>> +
>> +
> ???
As above.

--
Mats
> Jan
>
>>   	switch (version) {
>>   	case 1:
>>   		if (copy_from_user(&m, udata, sizeof(struct privcmd_mmapbatch)))
>
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 10:51:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:51:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7u6-0002rB-UC; Wed, 21 Nov 2012 10:51:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1Tb7u5-0002r6-FD
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 10:51:37 +0000
Received: from [85.158.138.51:14306] by server-16.bemta-3.messagelabs.com id
	4B/F1-07461-832BCA05; Wed, 21 Nov 2012 10:51:36 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1353495089!24536348!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUyNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20676 invoked from network); 21 Nov 2012 10:51:31 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 10:51:31 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="45274853"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	21 Nov 2012 10:51:28 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Wed, 21 Nov 2012 05:51:27 -0500
Message-ID: <50ACB22E.4070101@citrix.com>
Date: Wed, 21 Nov 2012 10:51:26 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <1353077152-29630-1-git-send-email-mats.petersson@citrix.com>
	<50ACBB1A02000078000AA4E2@nat28.tlf.novell.com>
In-Reply-To: <50ACBB1A02000078000AA4E2@nat28.tlf.novell.com>
X-Originating-IP: [10.80.3.146]
Cc: "konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Improve performance of
	IOCTL_PRIVCMD_MMAPBATCH_V2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 21/11/12 10:29, Jan Beulich wrote:
>>>> On 16.11.12 at 15:45, Mats Petersson <mats.petersson@citrix.com> wrote:
>> @@ -2526,12 +2540,25 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
>>   		if (err)
>>   			goto out;
>>   
>> -		err = HYPERVISOR_mmu_update(mmu_update, batch, NULL, domid);
>> -		if (err < 0)
>> -			goto out;
>> +		/* We record the error for each page that gives an error, but
>> +		 * continue mapping until the whole set is done */
>> +		do {
>> +			err = HYPERVISOR_mmu_update(&mmu_update[index],
>> +						    batch_left, &done, domid);
>> +			if (err < 0) {
>> +				if (err_ptr)
>> +					err_ptr[index] = err;
> Shouldn't you increment "done" here, in order to not retry the failed
> slot immediately?

Yes, good spot - for some reason, I have double checked the behaviour of 
"done", and it returns the index of the item which gave the error, not 
actually "how many were processed".

I have rewritten this part of code for V3 of this patch, but I think it 
still requires an increment of "done" to make it work correctly.
>
>> +				else /* exit if error and no err_ptr */
>> +					goto out;
>> +			}
>> +			batch_left -= done;
>> +			index += done;
>> +		} while (batch_left);
>>   
>>   		nr -= batch;
>>   		addr += range;
>> +		if (err_ptr)
>> +			err_ptr += batch;
>>   	}
>>   
>>   	err = 0;
>> @@ -303,6 +349,8 @@ static int mmap_return_errors_v1(void *data, void *state)
>>   	return __put_user(*mfnp, st->user_mfn++);
>>   }
>>   
>> +
>> +
> ???
This is cleaned up in the V3 patch.
>>   static struct vm_operations_struct privcmd_vm_ops;
>>   
>>   static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
>> @@ -319,6 +367,8 @@ static long privcmd_ioctl_mmap_batch(void __user *udata,
>> int version)
>>   	if (!xen_initial_domain())
>>   		return -EPERM;
>>   
>> +
>> +
> ???
As above.

--
Mats
> Jan
>
>>   	switch (version) {
>>   	case 1:
>>   		if (copy_from_user(&m, udata, sizeof(struct privcmd_mmapbatch)))
>
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 10:53:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:53:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7vd-0002zV-EK; Wed, 21 Nov 2012 10:53:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1Tb7vc-0002zM-8x
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 10:53:12 +0000
Received: from [85.158.137.99:38998] by server-10.bemta-3.messagelabs.com id
	45/21-19806-692BCA05; Wed, 21 Nov 2012 10:53:10 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1353495188!20005290!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNjc2MTI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32239 invoked from network); 21 Nov 2012 10:53:09 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-4.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 21 Nov 2012 10:53:09 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qALAqpqi022983
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 21 Nov 2012 10:52:51 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qALAqo04011556
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Nov 2012 10:52:50 GMT
Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qALAqnfF022596; Wed, 21 Nov 2012 04:52:49 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 21 Nov 2012 02:52:48 -0800
Date: Wed, 21 Nov 2012 11:52:21 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: ebiederm@xmission.com
Message-ID: <20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <87lidwtego.fsf@xmission.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	jbeulich@suse.com, hpa@zytor.com, tglx@linutronix.de
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 20, 2012 at 08:40:39AM -0800, ebiederm@xmission.com wrote:
> Daniel Kiper <daniel.kiper@oracle.com> writes:
>
> > Some kexec/kdump implementations (e.g. Xen PVOPS) could not use default
> > functions or require some changes in behavior of kexec/kdump generic code.
> > To cope with that problem kexec_ops struct was introduced. It allows
> > a developer to replace all or some functions and control some
> > functionality of kexec/kdump generic code.
> >
> > Default behavior of kexec/kdump generic code is not changed.
>
> Ick.
>
> > v2 - suggestions/fixes:
> >    - add comment for kexec_ops.crash_alloc_temp_store member
> >      (suggested by Konrad Rzeszutek Wilk),
> >    - simplify kexec_ops usage
> >      (suggested by Konrad Rzeszutek Wilk).
> >
> > Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
> > ---
> >  include/linux/kexec.h |   26 ++++++++++
> >  kernel/kexec.c        |  131 +++++++++++++++++++++++++++++++++++++------------
> >  2 files changed, 125 insertions(+), 32 deletions(-)
> >
> > diff --git a/include/linux/kexec.h b/include/linux/kexec.h
> > index d0b8458..c8d0b35 100644
> > --- a/include/linux/kexec.h
> > +++ b/include/linux/kexec.h
> > @@ -116,7 +116,33 @@ struct kimage {
> >  #endif
> >  };
> >
> > +struct kexec_ops {
> > +	/*
> > +	 * Some kdump implementations (e.g. Xen PVOPS dom0) could not access
> > +	 * directly crash kernel memory area. In this situation they must
> > +	 * allocate memory outside of it and later move contents from temporary
> > +	 * storage to final resting places (usualy done by relocate_kernel()).
> > +	 * Such behavior could be enforced by setting
> > +	 * crash_alloc_temp_store member to true.
> > +	 */
>
> Why in the world would Xen not be able to access crash kernel memory?
> As currently defined it is normal memory that the kernel chooses not to
> use.
>
> If relocate kernel can access that memory you definitely can access the
> memory so the comment does not make any sense.

Crash kernel memory is reserved by Xen hypervisor and Xen hypervisor
only has access to it. dom0 does not have any mapping of this area.
However, relocate_kernel() has access to crash kernel memory
because it is executed by Xen hypervisor and whole machine
memory is identity mapped.

> > +	bool crash_alloc_temp_store;
> > +	struct page *(*kimage_alloc_pages)(gfp_t gfp_mask,
> > +						unsigned int order,
> > +						unsigned long limit);
> > +	void (*kimage_free_pages)(struct page *page);
> > +	unsigned long (*page_to_pfn)(struct page *page);
> > +	struct page *(*pfn_to_page)(unsigned long pfn);
> > +	unsigned long (*virt_to_phys)(volatile void *address);
> > +	void *(*phys_to_virt)(unsigned long address);
> > +	int (*machine_kexec_prepare)(struct kimage *image);
> > +	int (*machine_kexec_load)(struct kimage *image);
> > +	void (*machine_kexec_cleanup)(struct kimage *image);
> > +	void (*machine_kexec_unload)(struct kimage *image);
> > +	void (*machine_kexec_shutdown)(void);
> > +	void (*machine_kexec)(struct kimage *image);
> > +};
>
> Ugh.  This is a nasty abstraction.
>
> You are mixing and matching a bunch of things together here.
>
> If you need to override machine_kexec_xxx please do that on a per
> architecture basis.

Yes, it is possible but I think that it is worth to do it at that
level because it could be useful for other archs too (e.g. Xen ARM port
is under development). Then we do not need to duplicate that functionality
in arch code. Additionally, Xen requires machine_kexec_load and
machine_kexec_unload hooks which are not available in current generic
kexec/kdump code.

> Special case overrides of page_to_pfn, pfn_to_page, virt_to_phys,
> phys_to_virt, and friends seem completely inappropriate.

They are required in Xen PVOPS case. If we do not do that in that way
then we at least need to duplicate almost all generic kexec/kdump existing
code in arch depended files. I do not mention that we need to capture
relevant syscall and other things. I think that this is wrong way.

> There may be a point to all of these but you are mixing and matching
> things badly.

Do you whish to split this kexec_ops struct to something which
works with addresses and something which is reponsible for
loading, unloading and executing kexec/kdump? I am able to change
that but I would like to know a bit about your vision first.

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 10:53:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:53:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7vd-0002zV-EK; Wed, 21 Nov 2012 10:53:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1Tb7vc-0002zM-8x
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 10:53:12 +0000
Received: from [85.158.137.99:38998] by server-10.bemta-3.messagelabs.com id
	45/21-19806-692BCA05; Wed, 21 Nov 2012 10:53:10 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1353495188!20005290!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNjc2MTI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32239 invoked from network); 21 Nov 2012 10:53:09 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-4.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 21 Nov 2012 10:53:09 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qALAqpqi022983
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 21 Nov 2012 10:52:51 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qALAqo04011556
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Nov 2012 10:52:50 GMT
Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qALAqnfF022596; Wed, 21 Nov 2012 04:52:49 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 21 Nov 2012 02:52:48 -0800
Date: Wed, 21 Nov 2012 11:52:21 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: ebiederm@xmission.com
Message-ID: <20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <87lidwtego.fsf@xmission.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	jbeulich@suse.com, hpa@zytor.com, tglx@linutronix.de
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 20, 2012 at 08:40:39AM -0800, ebiederm@xmission.com wrote:
> Daniel Kiper <daniel.kiper@oracle.com> writes:
>
> > Some kexec/kdump implementations (e.g. Xen PVOPS) could not use default
> > functions or require some changes in behavior of kexec/kdump generic code.
> > To cope with that problem kexec_ops struct was introduced. It allows
> > a developer to replace all or some functions and control some
> > functionality of kexec/kdump generic code.
> >
> > Default behavior of kexec/kdump generic code is not changed.
>
> Ick.
>
> > v2 - suggestions/fixes:
> >    - add comment for kexec_ops.crash_alloc_temp_store member
> >      (suggested by Konrad Rzeszutek Wilk),
> >    - simplify kexec_ops usage
> >      (suggested by Konrad Rzeszutek Wilk).
> >
> > Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
> > ---
> >  include/linux/kexec.h |   26 ++++++++++
> >  kernel/kexec.c        |  131 +++++++++++++++++++++++++++++++++++++------------
> >  2 files changed, 125 insertions(+), 32 deletions(-)
> >
> > diff --git a/include/linux/kexec.h b/include/linux/kexec.h
> > index d0b8458..c8d0b35 100644
> > --- a/include/linux/kexec.h
> > +++ b/include/linux/kexec.h
> > @@ -116,7 +116,33 @@ struct kimage {
> >  #endif
> >  };
> >
> > +struct kexec_ops {
> > +	/*
> > +	 * Some kdump implementations (e.g. Xen PVOPS dom0) could not access
> > +	 * directly crash kernel memory area. In this situation they must
> > +	 * allocate memory outside of it and later move contents from temporary
> > +	 * storage to final resting places (usualy done by relocate_kernel()).
> > +	 * Such behavior could be enforced by setting
> > +	 * crash_alloc_temp_store member to true.
> > +	 */
>
> Why in the world would Xen not be able to access crash kernel memory?
> As currently defined it is normal memory that the kernel chooses not to
> use.
>
> If relocate kernel can access that memory you definitely can access the
> memory so the comment does not make any sense.

Crash kernel memory is reserved by Xen hypervisor and Xen hypervisor
only has access to it. dom0 does not have any mapping of this area.
However, relocate_kernel() has access to crash kernel memory
because it is executed by Xen hypervisor and whole machine
memory is identity mapped.

> > +	bool crash_alloc_temp_store;
> > +	struct page *(*kimage_alloc_pages)(gfp_t gfp_mask,
> > +						unsigned int order,
> > +						unsigned long limit);
> > +	void (*kimage_free_pages)(struct page *page);
> > +	unsigned long (*page_to_pfn)(struct page *page);
> > +	struct page *(*pfn_to_page)(unsigned long pfn);
> > +	unsigned long (*virt_to_phys)(volatile void *address);
> > +	void *(*phys_to_virt)(unsigned long address);
> > +	int (*machine_kexec_prepare)(struct kimage *image);
> > +	int (*machine_kexec_load)(struct kimage *image);
> > +	void (*machine_kexec_cleanup)(struct kimage *image);
> > +	void (*machine_kexec_unload)(struct kimage *image);
> > +	void (*machine_kexec_shutdown)(void);
> > +	void (*machine_kexec)(struct kimage *image);
> > +};
>
> Ugh.  This is a nasty abstraction.
>
> You are mixing and matching a bunch of things together here.
>
> If you need to override machine_kexec_xxx please do that on a per
> architecture basis.

Yes, it is possible but I think that it is worth to do it at that
level because it could be useful for other archs too (e.g. Xen ARM port
is under development). Then we do not need to duplicate that functionality
in arch code. Additionally, Xen requires machine_kexec_load and
machine_kexec_unload hooks which are not available in current generic
kexec/kdump code.

> Special case overrides of page_to_pfn, pfn_to_page, virt_to_phys,
> phys_to_virt, and friends seem completely inappropriate.

They are required in Xen PVOPS case. If we do not do that in that way
then we at least need to duplicate almost all generic kexec/kdump existing
code in arch depended files. I do not mention that we need to capture
relevant syscall and other things. I think that this is wrong way.

> There may be a point to all of these but you are mixing and matching
> things badly.

Do you whish to split this kexec_ops struct to something which
works with addresses and something which is reponsible for
loading, unloading and executing kexec/kdump? I am able to change
that but I would like to know a bit about your vision first.

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 10:53:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:53:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7w4-00032J-2l; Wed, 21 Nov 2012 10:53:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tb7w2-000329-Nc
	for Xen-devel@lists.xensource.com; Wed, 21 Nov 2012 10:53:38 +0000
Received: from [85.158.143.35:15426] by server-1.bemta-4.messagelabs.com id
	CC/2C-27934-1B2BCA05; Wed, 21 Nov 2012 10:53:37 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1353495032!7463248!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14907 invoked from network); 21 Nov 2012 10:50:38 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 10:50:38 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="15922600"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 10:50:32 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 10:50:31 +0000
Message-ID: <1353495030.13542.112.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>
Date: Wed, 21 Nov 2012 10:50:30 +0000
In-Reply-To: <20121120182636.3879564a@mantra.us.oracle.com>
References: <20121120182636.3879564a@mantra.us.oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] PVH:  domain creations...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-21 at 02:26 +0000, Mukesh Rathor wrote:
> Hi guys,
> 
> Good news, I got everything working on my refreshed tree. So, now time
> to clean up the patch, look at the fixme's/TBDs to see what needs to be
> done in phase I and what can be deferred. Lets start with domain
> creation:
> 
> I currently have following for domain creation:
>   dom0: dom0pvh in the command line makes it PVH mode. IMO, we should leave
>         this as is until PVH is default.
> 
>   domU: vm.cfg has line: is_pvh = 1. The tools then parse this and set
>         is_pvh fields in  libxl_domain_create_info{} and
>         libxl_domain_build_info{}. I also introduced XEN_DOMCTL_CDF_pvh_guest 
>         flag to send down the info to xen during domU creation.
>  
> 
>  1. I suppose in XEN_DOMCTL_createdomain in xen: I could just see if
>  it's PV guest with HAP, ie, 
>        if (~XEN_DOMCTL_CDF_hvm_guest && XEN_DOMCTL_CDF_hap)
>             then domcr_flags |= DOMCRF_pvh;
> 
>    This would result in elimination of XEN_DOMCTL_CDF_pvh_guest flag.
>    What do you think?

Seems to make sense. And this interface is a hyp<=>tools one so we can
always fix it or change it if necessary.

(one thought for the future would be to include the kernels feature
flags in struct xen_domctl_createdomain, for example)

>  2. I suppose I could undo flags in libxl_domain_create_info and 
>     libxl_domain_build_info, and just call xc_dom_feature_translated()
>     and assume it's PVH if it returns true for PV?

I think you actually want both, i.e. libxl/libxc should provide a
sensible default (perhaps based on xc_dom_feature_translated as you
suggest) but you also want a way for the user to forcibly enable or
disable it in the guest config (to workaround bugs, allow comparative
benchmarks etc).

> Also, I realized SIF_IS_PVH is probably not needed and I'm trying to 
> see if I can remove it.

Cool.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 10:53:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:53:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7w4-00032J-2l; Wed, 21 Nov 2012 10:53:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tb7w2-000329-Nc
	for Xen-devel@lists.xensource.com; Wed, 21 Nov 2012 10:53:38 +0000
Received: from [85.158.143.35:15426] by server-1.bemta-4.messagelabs.com id
	CC/2C-27934-1B2BCA05; Wed, 21 Nov 2012 10:53:37 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1353495032!7463248!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14907 invoked from network); 21 Nov 2012 10:50:38 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 10:50:38 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="15922600"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 10:50:32 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 10:50:31 +0000
Message-ID: <1353495030.13542.112.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>
Date: Wed, 21 Nov 2012 10:50:30 +0000
In-Reply-To: <20121120182636.3879564a@mantra.us.oracle.com>
References: <20121120182636.3879564a@mantra.us.oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] PVH:  domain creations...
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-21 at 02:26 +0000, Mukesh Rathor wrote:
> Hi guys,
> 
> Good news, I got everything working on my refreshed tree. So, now time
> to clean up the patch, look at the fixme's/TBDs to see what needs to be
> done in phase I and what can be deferred. Lets start with domain
> creation:
> 
> I currently have following for domain creation:
>   dom0: dom0pvh in the command line makes it PVH mode. IMO, we should leave
>         this as is until PVH is default.
> 
>   domU: vm.cfg has line: is_pvh = 1. The tools then parse this and set
>         is_pvh fields in  libxl_domain_create_info{} and
>         libxl_domain_build_info{}. I also introduced XEN_DOMCTL_CDF_pvh_guest 
>         flag to send down the info to xen during domU creation.
>  
> 
>  1. I suppose in XEN_DOMCTL_createdomain in xen: I could just see if
>  it's PV guest with HAP, ie, 
>        if (~XEN_DOMCTL_CDF_hvm_guest && XEN_DOMCTL_CDF_hap)
>             then domcr_flags |= DOMCRF_pvh;
> 
>    This would result in elimination of XEN_DOMCTL_CDF_pvh_guest flag.
>    What do you think?

Seems to make sense. And this interface is a hyp<=>tools one so we can
always fix it or change it if necessary.

(one thought for the future would be to include the kernels feature
flags in struct xen_domctl_createdomain, for example)

>  2. I suppose I could undo flags in libxl_domain_create_info and 
>     libxl_domain_build_info, and just call xc_dom_feature_translated()
>     and assume it's PVH if it returns true for PV?

I think you actually want both, i.e. libxl/libxc should provide a
sensible default (perhaps based on xc_dom_feature_translated as you
suggest) but you also want a way for the user to forcibly enable or
disable it in the guest config (to workaround bugs, allow comparative
benchmarks etc).

> Also, I realized SIF_IS_PVH is probably not needed and I'm trying to 
> see if I can remove it.

Cool.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 10:57:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:57:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7zN-0003J6-Mh; Wed, 21 Nov 2012 10:57:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb7zM-0003J0-VU
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 10:57:05 +0000
Received: from [85.158.138.51:11483] by server-1.bemta-3.messagelabs.com id
	C2/0B-12169-F73BCA05; Wed, 21 Nov 2012 10:57:03 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1353495422!30893839!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12775 invoked from network); 21 Nov 2012 10:57:02 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-174.messagelabs.com with SMTP;
	21 Nov 2012 10:57:02 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 10:57:02 +0000
Message-Id: <50ACC1C402000078000AA506@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 10:57:56 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mats Petersson" <mats.petersson@citrix.com>
References: <1353077152-29630-1-git-send-email-mats.petersson@citrix.com>
	<50ACBB1A02000078000AA4E2@nat28.tlf.novell.com>
	<50ACB22E.4070101@citrix.com>
In-Reply-To: <50ACB22E.4070101@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Improve performance of
 IOCTL_PRIVCMD_MMAPBATCH_V2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 21.11.12 at 11:51, Mats Petersson <mats.petersson@citrix.com> wrote:
> On 21/11/12 10:29, Jan Beulich wrote:
>>>>> On 16.11.12 at 15:45, Mats Petersson <mats.petersson@citrix.com> wrote:
>>> @@ -2526,12 +2540,25 @@ int xen_remap_domain_mfn_range(struct vm_area_struct 
> *vma,
>>>   		if (err)
>>>   			goto out;
>>>   
>>> -		err = HYPERVISOR_mmu_update(mmu_update, batch, NULL, domid);
>>> -		if (err < 0)
>>> -			goto out;
>>> +		/* We record the error for each page that gives an error, but
>>> +		 * continue mapping until the whole set is done */
>>> +		do {
>>> +			err = HYPERVISOR_mmu_update(&mmu_update[index],
>>> +						    batch_left, &done, domid);
>>> +			if (err < 0) {
>>> +				if (err_ptr)
>>> +					err_ptr[index] = err;
>> Shouldn't you increment "done" here, in order to not retry the failed
>> slot immediately?
> 
> Yes, good spot - for some reason, I have double checked the behaviour of 
> "done", and it returns the index of the item which gave the error, not 
> actually "how many were processed".

Isn't the index of failure equal to the number of successfully
processed ones?

> I have rewritten this part of code for V3 of this patch, but I think it 
> still requires an increment of "done" to make it work correctly.
>>
>>> +				else /* exit if error and no err_ptr */
>>> +					goto out;
>>> +			}
>>> +			batch_left -= done;
>>> +			index += done;
>>> +		} while (batch_left);
>>>   
>>>   		nr -= batch;
>>>   		addr += range;
>>> +		if (err_ptr)
>>> +			err_ptr += batch;
>>>   	}
>>>   
>>>   	err = 0;
>>> @@ -303,6 +349,8 @@ static int mmap_return_errors_v1(void *data, void *state)
>>>   	return __put_user(*mfnp, st->user_mfn++);
>>>   }
>>>   
>>> +
>>> +
>> ???
> This is cleaned up in the V3 patch.

Did I miss that (and v2 too)?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 10:57:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 10:57:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb7zN-0003J6-Mh; Wed, 21 Nov 2012 10:57:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb7zM-0003J0-VU
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 10:57:05 +0000
Received: from [85.158.138.51:11483] by server-1.bemta-3.messagelabs.com id
	C2/0B-12169-F73BCA05; Wed, 21 Nov 2012 10:57:03 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1353495422!30893839!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12775 invoked from network); 21 Nov 2012 10:57:02 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-174.messagelabs.com with SMTP;
	21 Nov 2012 10:57:02 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 10:57:02 +0000
Message-Id: <50ACC1C402000078000AA506@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 10:57:56 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mats Petersson" <mats.petersson@citrix.com>
References: <1353077152-29630-1-git-send-email-mats.petersson@citrix.com>
	<50ACBB1A02000078000AA4E2@nat28.tlf.novell.com>
	<50ACB22E.4070101@citrix.com>
In-Reply-To: <50ACB22E.4070101@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Improve performance of
 IOCTL_PRIVCMD_MMAPBATCH_V2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 21.11.12 at 11:51, Mats Petersson <mats.petersson@citrix.com> wrote:
> On 21/11/12 10:29, Jan Beulich wrote:
>>>>> On 16.11.12 at 15:45, Mats Petersson <mats.petersson@citrix.com> wrote:
>>> @@ -2526,12 +2540,25 @@ int xen_remap_domain_mfn_range(struct vm_area_struct 
> *vma,
>>>   		if (err)
>>>   			goto out;
>>>   
>>> -		err = HYPERVISOR_mmu_update(mmu_update, batch, NULL, domid);
>>> -		if (err < 0)
>>> -			goto out;
>>> +		/* We record the error for each page that gives an error, but
>>> +		 * continue mapping until the whole set is done */
>>> +		do {
>>> +			err = HYPERVISOR_mmu_update(&mmu_update[index],
>>> +						    batch_left, &done, domid);
>>> +			if (err < 0) {
>>> +				if (err_ptr)
>>> +					err_ptr[index] = err;
>> Shouldn't you increment "done" here, in order to not retry the failed
>> slot immediately?
> 
> Yes, good spot - for some reason, I have double checked the behaviour of 
> "done", and it returns the index of the item which gave the error, not 
> actually "how many were processed".

Isn't the index of failure equal to the number of successfully
processed ones?

> I have rewritten this part of code for V3 of this patch, but I think it 
> still requires an increment of "done" to make it work correctly.
>>
>>> +				else /* exit if error and no err_ptr */
>>> +					goto out;
>>> +			}
>>> +			batch_left -= done;
>>> +			index += done;
>>> +		} while (batch_left);
>>>   
>>>   		nr -= batch;
>>>   		addr += range;
>>> +		if (err_ptr)
>>> +			err_ptr += batch;
>>>   	}
>>>   
>>>   	err = 0;
>>> @@ -303,6 +349,8 @@ static int mmap_return_errors_v1(void *data, void *state)
>>>   	return __put_user(*mfnp, st->user_mfn++);
>>>   }
>>>   
>>> +
>>> +
>> ???
> This is cleaned up in the V3 patch.

Did I miss that (and v2 too)?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:02:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:02:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb84F-0003as-Gx; Wed, 21 Nov 2012 11:02:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tb84D-0003al-Qi
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 11:02:06 +0000
Received: from [85.158.137.99:60548] by server-8.bemta-3.messagelabs.com id
	62/38-07786-CA4BCA05; Wed, 21 Nov 2012 11:02:04 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353495724!19893424!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5095 invoked from network); 21 Nov 2012 11:02:04 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 11:02:04 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="15922957"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 11:02:03 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 11:02:03 +0000
Message-ID: <1353495722.13542.118.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: ZhouPeng <zpengxen@gmail.com>
Date: Wed, 21 Nov 2012 11:02:02 +0000
In-Reply-To: <CAAh7U5NM5aPcXdJAC53romAQQ2_yQaiEpJQyhi0fTEFRaWUsCA@mail.gmail.com>
References: <CAAh7U5MHRnwwK-X==Hh7F2uy94i4yYU3oFFQEesowUtPQGf6Eg@mail.gmail.com>
	<1338987918.32319.84.camel@zakaz.uk.xensource.com>
	<CAAh7U5PYuJJcrAVCzVPLR0vZ1PLpS5mNqsrBmToTsm2KW46_wQ@mail.gmail.com>
	<1339049291.6557.11.camel@dagon.hellion.org.uk>
	<CAAh7U5O2FCeT7Mzp5KNkxqcX5B037YUmqef=TJTrQ9b=JgsHZA@mail.gmail.com>
	<1341325462.21547.20.camel@zakaz.uk.xensource.com>
	<CAFLBxZZfh0eXszeVvZ6WYDuGV6cDcvcgpOByf8FWz9EOvOUorQ@mail.gmail.com>
	<CAAh7U5PBASWB6Y6P-Sz3yg2Z1xv-JYAMtFSYGWe=3oov3h32dQ@mail.gmail.com>
	<CAAh7U5MMmAz047KzHVMRkUF=hGZKGfDfM1KM41jF8g6bZAXq7g@mail.gmail.com>
	<508559E8.10102@eu.citrix.com>
	<CAAh7U5PjF7c3mg3C7WZ2uphZaYLRTzwphiobDG+t-2Q-BpnTKQ@mail.gmail.com>
	<1353325039.18229.49.camel@zakaz.uk.xensource.com>
	<CAAh7U5NM5aPcXdJAC53romAQQ2_yQaiEpJQyhi0fTEFRaWUsCA@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"Xen-Devel \(E-mail\)" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 2/3] tools:libxl: Add qxl vga interface
 support v2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-21 at 03:27 +0000, ZhouPeng wrote:
> On Mon, Nov 19, 2012 at 7:37 PM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Wed, 2012-10-24 at 09:06 +0100, ZhouPeng wrote:
> >
> >> >> +For B<qxl> option, the default is 128MB. If B<videoram> is set greater
> >> >> +than 128MB, it will be trimmed to 128MB; if set less than 128MB, an
> >> >> +error will be triggered.
> >> >
> >> >
> >> > Is this a fixed value in qemu, or is this something that can be changed via
> >> > the command-line?
> >> Can be changed.
> >>
> >> But Ian Campbell and me have talked on sth related with this
> >> closely before. And we both agree to just support the default is
> >> enough in most time. You can get it from the url below quickly, pls
> >> read from bottom up, which can save time.
> >>
> >> http://lists.xen.org/archives/html/xen-devel/2012-07/msg00098.html
> >
> > We discussed what to do if the supplied value was too small but I don't
> > recall this behaviour of clamping a value which is larger to a specific
> > value.
> 
> I think, the key idea is just to support the default for qxl (128Mib)
> in the discussion.
> videoram is not designed for qxl video ram.
> > If we reject values which are <128M, and clamp anything which is >128M
> > to 128M then what is the point of the option?
> 
> This piece of code doesn't mean to use videoram option to assign memory for qxl.
> Because videoram option comes in Xen before qxl, it need to be consided here.

You mean because video_memkb is used for VGA when QXL is disabled and
QXL when it is? So the confusion here arises because this field is doing
double duty.

Perhaps it would be better to add a separate notion of qxl_memkb? The
code in libxl__build_device_model_args_new and perhaps a handful of
other places would need to account for either videoram or qxlram
depending on which was enabled (you'd probably want a helper function
for this).

Is it possible to enable both VGA and QXL for a domain?

> 
> v2 gives user the chance to assign memory for qxl.
> >
> > Ian.
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:02:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:02:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb84F-0003as-Gx; Wed, 21 Nov 2012 11:02:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tb84D-0003al-Qi
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 11:02:06 +0000
Received: from [85.158.137.99:60548] by server-8.bemta-3.messagelabs.com id
	62/38-07786-CA4BCA05; Wed, 21 Nov 2012 11:02:04 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353495724!19893424!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5095 invoked from network); 21 Nov 2012 11:02:04 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 11:02:04 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="15922957"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 11:02:03 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 11:02:03 +0000
Message-ID: <1353495722.13542.118.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: ZhouPeng <zpengxen@gmail.com>
Date: Wed, 21 Nov 2012 11:02:02 +0000
In-Reply-To: <CAAh7U5NM5aPcXdJAC53romAQQ2_yQaiEpJQyhi0fTEFRaWUsCA@mail.gmail.com>
References: <CAAh7U5MHRnwwK-X==Hh7F2uy94i4yYU3oFFQEesowUtPQGf6Eg@mail.gmail.com>
	<1338987918.32319.84.camel@zakaz.uk.xensource.com>
	<CAAh7U5PYuJJcrAVCzVPLR0vZ1PLpS5mNqsrBmToTsm2KW46_wQ@mail.gmail.com>
	<1339049291.6557.11.camel@dagon.hellion.org.uk>
	<CAAh7U5O2FCeT7Mzp5KNkxqcX5B037YUmqef=TJTrQ9b=JgsHZA@mail.gmail.com>
	<1341325462.21547.20.camel@zakaz.uk.xensource.com>
	<CAFLBxZZfh0eXszeVvZ6WYDuGV6cDcvcgpOByf8FWz9EOvOUorQ@mail.gmail.com>
	<CAAh7U5PBASWB6Y6P-Sz3yg2Z1xv-JYAMtFSYGWe=3oov3h32dQ@mail.gmail.com>
	<CAAh7U5MMmAz047KzHVMRkUF=hGZKGfDfM1KM41jF8g6bZAXq7g@mail.gmail.com>
	<508559E8.10102@eu.citrix.com>
	<CAAh7U5PjF7c3mg3C7WZ2uphZaYLRTzwphiobDG+t-2Q-BpnTKQ@mail.gmail.com>
	<1353325039.18229.49.camel@zakaz.uk.xensource.com>
	<CAAh7U5NM5aPcXdJAC53romAQQ2_yQaiEpJQyhi0fTEFRaWUsCA@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"Xen-Devel \(E-mail\)" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 2/3] tools:libxl: Add qxl vga interface
 support v2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-21 at 03:27 +0000, ZhouPeng wrote:
> On Mon, Nov 19, 2012 at 7:37 PM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Wed, 2012-10-24 at 09:06 +0100, ZhouPeng wrote:
> >
> >> >> +For B<qxl> option, the default is 128MB. If B<videoram> is set greater
> >> >> +than 128MB, it will be trimmed to 128MB; if set less than 128MB, an
> >> >> +error will be triggered.
> >> >
> >> >
> >> > Is this a fixed value in qemu, or is this something that can be changed via
> >> > the command-line?
> >> Can be changed.
> >>
> >> But Ian Campbell and me have talked on sth related with this
> >> closely before. And we both agree to just support the default is
> >> enough in most time. You can get it from the url below quickly, pls
> >> read from bottom up, which can save time.
> >>
> >> http://lists.xen.org/archives/html/xen-devel/2012-07/msg00098.html
> >
> > We discussed what to do if the supplied value was too small but I don't
> > recall this behaviour of clamping a value which is larger to a specific
> > value.
> 
> I think, the key idea is just to support the default for qxl (128Mib)
> in the discussion.
> videoram is not designed for qxl video ram.
> > If we reject values which are <128M, and clamp anything which is >128M
> > to 128M then what is the point of the option?
> 
> This piece of code doesn't mean to use videoram option to assign memory for qxl.
> Because videoram option comes in Xen before qxl, it need to be consided here.

You mean because video_memkb is used for VGA when QXL is disabled and
QXL when it is? So the confusion here arises because this field is doing
double duty.

Perhaps it would be better to add a separate notion of qxl_memkb? The
code in libxl__build_device_model_args_new and perhaps a handful of
other places would need to account for either videoram or qxlram
depending on which was enabled (you'd probably want a helper function
for this).

Is it possible to enable both VGA and QXL for a domain?

> 
> v2 gives user the chance to assign memory for qxl.
> >
> > Ian.
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:08:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:08:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8A6-0003kp-BW; Wed, 21 Nov 2012 11:08:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tb8A4-0003kh-Ec
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 11:08:08 +0000
Received: from [193.109.254.147:18917] by server-1.bemta-14.messagelabs.com id
	CB/58-25314-716BCA05; Wed, 21 Nov 2012 11:08:07 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1353496030!9657650!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12540 invoked from network); 21 Nov 2012 11:07:11 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 11:07:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="15923087"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 11:07:09 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 11:07:09 +0000
Message-ID: <1353496027.13542.119.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Date: Wed, 21 Nov 2012 11:07:07 +0000
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233539385B@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
	<1353344256.18229.129.camel@zakaz.uk.xensource.com>
	<50AB9CFE.7000003@eu.citrix.com>
	<DE8DF0795D48FD4CA783C40EC8292335393633@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233539385B@SHSMSX101.ccr.corp.intel.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 18:54 +0000, Liu, Jinsong wrote:
> Well, let me elaborate more my thought about broken page occur at last iter:
> 
> Theoretically we can separate 'broken page at last iter' into several sub-cases, and optimize case by case:
> 1. if the page (which will break at last iter) is not on dirty bitmap (of last iter) --> do nothing is OK, target will happily run w/o broken page;
> 2. if the page (which will break at last iter) is on dirty bitmap (of last iter)
>   2.1 if at last iter, vmce occur after page copy --> do nothing is OK, target happily run w/o broken page;
>   2.2 if vmce occur beofre pfn_type transfer --> do nothing is OK, V2 patch has correctly handle the case, target will set p2m broken correctly;
>   2.3 if vmce occur after pfn_type transfer and before copy page to target --> we need handle this case;
> 
> Practically considering it's rare enough, and code complication, we handle it in a simple way (not so optimized but enough for real life):
> - we don't distinguish if the page is in dirty bitmap of last iter;
> - we don't prefer adding new hypercall for this corner case, instead we'd like to re-use currently existed hypercall;
> - if vmce occur at last iter, we do 1~2 more iter.

Can't a page break on each "last" iter. i.e. you might actually go
around as many times as there are pages in the last batch?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:08:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:08:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8A6-0003kp-BW; Wed, 21 Nov 2012 11:08:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tb8A4-0003kh-Ec
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 11:08:08 +0000
Received: from [193.109.254.147:18917] by server-1.bemta-14.messagelabs.com id
	CB/58-25314-716BCA05; Wed, 21 Nov 2012 11:08:07 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1353496030!9657650!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12540 invoked from network); 21 Nov 2012 11:07:11 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 11:07:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="15923087"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 11:07:09 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 11:07:09 +0000
Message-ID: <1353496027.13542.119.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Date: Wed, 21 Nov 2012 11:07:07 +0000
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233539385B@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
	<1353344256.18229.129.camel@zakaz.uk.xensource.com>
	<50AB9CFE.7000003@eu.citrix.com>
	<DE8DF0795D48FD4CA783C40EC8292335393633@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233539385B@SHSMSX101.ccr.corp.intel.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 18:54 +0000, Liu, Jinsong wrote:
> Well, let me elaborate more my thought about broken page occur at last iter:
> 
> Theoretically we can separate 'broken page at last iter' into several sub-cases, and optimize case by case:
> 1. if the page (which will break at last iter) is not on dirty bitmap (of last iter) --> do nothing is OK, target will happily run w/o broken page;
> 2. if the page (which will break at last iter) is on dirty bitmap (of last iter)
>   2.1 if at last iter, vmce occur after page copy --> do nothing is OK, target happily run w/o broken page;
>   2.2 if vmce occur beofre pfn_type transfer --> do nothing is OK, V2 patch has correctly handle the case, target will set p2m broken correctly;
>   2.3 if vmce occur after pfn_type transfer and before copy page to target --> we need handle this case;
> 
> Practically considering it's rare enough, and code complication, we handle it in a simple way (not so optimized but enough for real life):
> - we don't distinguish if the page is in dirty bitmap of last iter;
> - we don't prefer adding new hypercall for this corner case, instead we'd like to re-use currently existed hypercall;
> - if vmce occur at last iter, we do 1~2 more iter.

Can't a page break on each "last" iter. i.e. you might actually go
around as many times as there are pages in the last batch?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:10:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:10:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8Bf-0003pe-Sd; Wed, 21 Nov 2012 11:09:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tb8Be-0003pU-Gb
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 11:09:46 +0000
Received: from [85.158.138.51:3820] by server-11.bemta-3.messagelabs.com id
	56/C8-19361-976BCA05; Wed, 21 Nov 2012 11:09:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353496169!28985331!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18636 invoked from network); 21 Nov 2012 11:09:30 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 11:09:30 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="15923190"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 11:09:29 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 11:09:29 +0000
Message-ID: <1353496168.13542.120.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: ANNIE LI <annie.li@oracle.com>
Date: Wed, 21 Nov 2012 11:09:28 +0000
In-Reply-To: <50AC41F7.7080609@oracle.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AC41F7.7080609@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, Sander
	Eikelenboom <linux@eikelenboom.it>, Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
	fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-21 at 02:52 +0000, ANNIE LI wrote:
> 
> On 2012-11-20 19:40, Ian Campbell wrote:
> > An SKB paged fragment can consist of a compound page with order>  0.
> > However the netchannel protocol deals only in PAGE_SIZE frames.
> >
> > Handle this in xennet_make_frags by iterating over the frames which
> > make up the page.
> >
> > This is the netfront equivalent to 6a8ed462f16b for netback.
> >
> > Signed-off-by: Ian Campbell<ian.campbell@citrix.com>
> > Cc: netdev@vger.kernel.org
> > Cc: xen-devel@lists.xen.org
> > Cc: Eric Dumazet<edumazet@google.com>
> > Cc: Konrad Rzeszutek Wilk<konrad@kernel.org>
> > Cc: ANNIE LI<annie.li@oracle.com>
> > Cc: Sander Eikelenboom<linux@eikelenboom.it>
> > Cc: Stefan Bader<stefan.bader@canonical.com>
> > ---
> >   drivers/net/xen-netfront.c |   58 +++++++++++++++++++++++++++++++++----------
> >   1 files changed, 44 insertions(+), 14 deletions(-)
> >
> > diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> > index caa0110..a12b99a 100644
> > --- a/drivers/net/xen-netfront.c
> > +++ b/drivers/net/xen-netfront.c
> > @@ -452,24 +452,54 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
> >   	/* Grant backend access to each skb fragment page. */
> >   	for (i = 0; i<  frags; i++) {
> >   		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
> > +		struct page *page = skb_frag_page(frag);
> > +		unsigned long size = skb_frag_size(frag);
> > +		unsigned long offset = frag->page_offset;
> 
> There are following definitions at the beginning of xennet_make_frags,
> 
>          unsigned int offset = offset_in_page(data);
>          unsigned int len = skb_headlen(skb);

So they are, well spotted.

> Is it better to reuse those definitions, and not define new size and 
> offset again in this for loop? And unsigned int is enough here, right?

Yes to both.
> [...]
> Over 80 characters?
[...]
> Over 80 characters?

Both fixed, thanks for your review.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:10:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:10:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8Bf-0003pe-Sd; Wed, 21 Nov 2012 11:09:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tb8Be-0003pU-Gb
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 11:09:46 +0000
Received: from [85.158.138.51:3820] by server-11.bemta-3.messagelabs.com id
	56/C8-19361-976BCA05; Wed, 21 Nov 2012 11:09:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353496169!28985331!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18636 invoked from network); 21 Nov 2012 11:09:30 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 11:09:30 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="15923190"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 11:09:29 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 11:09:29 +0000
Message-ID: <1353496168.13542.120.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: ANNIE LI <annie.li@oracle.com>
Date: Wed, 21 Nov 2012 11:09:28 +0000
In-Reply-To: <50AC41F7.7080609@oracle.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AC41F7.7080609@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, Sander
	Eikelenboom <linux@eikelenboom.it>, Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
	fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-21 at 02:52 +0000, ANNIE LI wrote:
> 
> On 2012-11-20 19:40, Ian Campbell wrote:
> > An SKB paged fragment can consist of a compound page with order>  0.
> > However the netchannel protocol deals only in PAGE_SIZE frames.
> >
> > Handle this in xennet_make_frags by iterating over the frames which
> > make up the page.
> >
> > This is the netfront equivalent to 6a8ed462f16b for netback.
> >
> > Signed-off-by: Ian Campbell<ian.campbell@citrix.com>
> > Cc: netdev@vger.kernel.org
> > Cc: xen-devel@lists.xen.org
> > Cc: Eric Dumazet<edumazet@google.com>
> > Cc: Konrad Rzeszutek Wilk<konrad@kernel.org>
> > Cc: ANNIE LI<annie.li@oracle.com>
> > Cc: Sander Eikelenboom<linux@eikelenboom.it>
> > Cc: Stefan Bader<stefan.bader@canonical.com>
> > ---
> >   drivers/net/xen-netfront.c |   58 +++++++++++++++++++++++++++++++++----------
> >   1 files changed, 44 insertions(+), 14 deletions(-)
> >
> > diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> > index caa0110..a12b99a 100644
> > --- a/drivers/net/xen-netfront.c
> > +++ b/drivers/net/xen-netfront.c
> > @@ -452,24 +452,54 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
> >   	/* Grant backend access to each skb fragment page. */
> >   	for (i = 0; i<  frags; i++) {
> >   		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
> > +		struct page *page = skb_frag_page(frag);
> > +		unsigned long size = skb_frag_size(frag);
> > +		unsigned long offset = frag->page_offset;
> 
> There are following definitions at the beginning of xennet_make_frags,
> 
>          unsigned int offset = offset_in_page(data);
>          unsigned int len = skb_headlen(skb);

So they are, well spotted.

> Is it better to reuse those definitions, and not define new size and 
> offset again in this for loop? And unsigned int is enough here, right?

Yes to both.
> [...]
> Over 80 characters?
[...]
> Over 80 characters?

Both fixed, thanks for your review.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:10:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:10:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8Cf-0003vg-Ak; Wed, 21 Nov 2012 11:10:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Tb8Ce-0003vI-Kb
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 11:10:48 +0000
Received: from [85.158.143.99:27531] by server-2.bemta-4.messagelabs.com id
	11/69-28922-7B6BCA05; Wed, 21 Nov 2012 11:10:47 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1353496246!27417784!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19027 invoked from network); 21 Nov 2012 11:10:46 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 11:10:46 -0000
Received: by mail-ea0-f173.google.com with SMTP id i13so3280974eaa.32
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 03:10:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=XeScGtxxjm1XvD97f8EUuF5GZR/X73Zhzf7qpr4guA4=;
	b=zKC71EkBSdF3T4ofBLU4u5hoo19IMARSccW6Y68c7OsPPjNzfQwUbMcDrJ5BAjl53d
	Xj9thDxzQVkDgliPzsHYT6026RKFqEKJhZ0sbbxwASJGXOXhXQSeHJZJ3f5Ji2T1Q/ux
	V7hIpaR7uTBlcfApEmFFL5wOpr752t1GJy1pTBNLhNu+/wpZ1xpvviRXsWBbIsksCNOE
	L9nZB081nfvxWuI1aykHp7xy8VvLPtp7tIhG+IdAHHVVJ/73SO/XOWYPRfvZadRnJbF1
	jryiYWd+sPOEmEGBgCNAd7bF6yzGHL4IprAoXFb3BXP1iZShaVhqfEd8TmFO8zmjqCMl
	vq/Q==
Received: by 10.14.223.200 with SMTP id v48mr44477893eep.24.1353496246103;
	Wed, 21 Nov 2012 03:10:46 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id 42sm36529953eee.0.2012.11.21.03.10.41
	(version=SSLv3 cipher=OTHER); Wed, 21 Nov 2012 03:10:45 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 21 Nov 2012 11:10:36 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCD2672C.451A0%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [PATCH 5/5] VT-d: adjust IOMMU interrupt affinities
	when all CPUs are online
Thread-Index: Ac3H2NTC3oKrnLg6FEG6S+m9c0cSiw==
In-Reply-To: <50ACB8CE02000078000AA4B0@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: Re: [Xen-devel] [PATCH 5/5] VT-d: adjust IOMMU interrupt affinities
 when all CPUs are online
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 21/11/2012 10:19, "Jan Beulich" <JBeulich@suse.com> wrote:

> Since these interrupts get setup before APs get brought online, their
> affinities naturally could only ever point to CPU 0 alone so far.
> Adjust this to include potentially multiple CPUs in the target mask
> (when running in one of the cluster modes), and take into account NUMA
> information (to handle the interrupts on a CPU on the node where the
> respective IOMMU is).
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/drivers/passthrough/vtd/dmar.c
> +++ b/xen/drivers/passthrough/vtd/dmar.c
> @@ -839,6 +839,7 @@ void acpi_dmar_reinstate(void)
>  
>  void acpi_dmar_zap(void)
>  {
> +    adjust_vtd_irq_affinities();

Is this just a handy place to hook? Does it logically make sense?

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:10:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:10:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8Cf-0003vg-Ak; Wed, 21 Nov 2012 11:10:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Tb8Ce-0003vI-Kb
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 11:10:48 +0000
Received: from [85.158.143.99:27531] by server-2.bemta-4.messagelabs.com id
	11/69-28922-7B6BCA05; Wed, 21 Nov 2012 11:10:47 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1353496246!27417784!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19027 invoked from network); 21 Nov 2012 11:10:46 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 11:10:46 -0000
Received: by mail-ea0-f173.google.com with SMTP id i13so3280974eaa.32
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 03:10:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=XeScGtxxjm1XvD97f8EUuF5GZR/X73Zhzf7qpr4guA4=;
	b=zKC71EkBSdF3T4ofBLU4u5hoo19IMARSccW6Y68c7OsPPjNzfQwUbMcDrJ5BAjl53d
	Xj9thDxzQVkDgliPzsHYT6026RKFqEKJhZ0sbbxwASJGXOXhXQSeHJZJ3f5Ji2T1Q/ux
	V7hIpaR7uTBlcfApEmFFL5wOpr752t1GJy1pTBNLhNu+/wpZ1xpvviRXsWBbIsksCNOE
	L9nZB081nfvxWuI1aykHp7xy8VvLPtp7tIhG+IdAHHVVJ/73SO/XOWYPRfvZadRnJbF1
	jryiYWd+sPOEmEGBgCNAd7bF6yzGHL4IprAoXFb3BXP1iZShaVhqfEd8TmFO8zmjqCMl
	vq/Q==
Received: by 10.14.223.200 with SMTP id v48mr44477893eep.24.1353496246103;
	Wed, 21 Nov 2012 03:10:46 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id 42sm36529953eee.0.2012.11.21.03.10.41
	(version=SSLv3 cipher=OTHER); Wed, 21 Nov 2012 03:10:45 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 21 Nov 2012 11:10:36 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCD2672C.451A0%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [PATCH 5/5] VT-d: adjust IOMMU interrupt affinities
	when all CPUs are online
Thread-Index: Ac3H2NTC3oKrnLg6FEG6S+m9c0cSiw==
In-Reply-To: <50ACB8CE02000078000AA4B0@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: Re: [Xen-devel] [PATCH 5/5] VT-d: adjust IOMMU interrupt affinities
 when all CPUs are online
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 21/11/2012 10:19, "Jan Beulich" <JBeulich@suse.com> wrote:

> Since these interrupts get setup before APs get brought online, their
> affinities naturally could only ever point to CPU 0 alone so far.
> Adjust this to include potentially multiple CPUs in the target mask
> (when running in one of the cluster modes), and take into account NUMA
> information (to handle the interrupts on a CPU on the node where the
> respective IOMMU is).
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/drivers/passthrough/vtd/dmar.c
> +++ b/xen/drivers/passthrough/vtd/dmar.c
> @@ -839,6 +839,7 @@ void acpi_dmar_reinstate(void)
>  
>  void acpi_dmar_zap(void)
>  {
> +    adjust_vtd_irq_affinities();

Is this just a handy place to hook? Does it logically make sense?

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:11:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:11:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8D9-00040P-Oi; Wed, 21 Nov 2012 11:11:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Tb8D8-00040A-NV
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 11:11:18 +0000
Received: from [85.158.137.99:53136] by server-7.bemta-3.messagelabs.com id
	15/D8-01713-5D6BCA05; Wed, 21 Nov 2012 11:11:17 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1353496277!15261501!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30515 invoked from network); 21 Nov 2012 11:11:17 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-5.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 11:11:17 -0000
Received: by mail-ee0-f45.google.com with SMTP id d49so4719624eek.32
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 03:11:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=kLnUo4jghZRohN4Tbfn0I44vXYY3/Qb+E3XJvUNypSU=;
	b=00jpqvIAwEACWnKUnUbg+nBJU6vn0VZPGJQ6AFOwNaGemMAyc6CdLSBosu3RTOEXL+
	SilS9Rf1kuE1tv6GOXHDrNh8lm2ipRbhylqkaFYsNCTcOlavJbcE43zGg0KeJLs5YH1N
	QgwO37qSLBPmqp0sNOL0QNANDIiTuk1lKxE2MEEkYLcETWOD21jTQ/eZWma4BO68mq36
	Fp9ryZMMtVSuQGslpzPLRBzbnswATf7+bH9aWHig4JGxC+zXBReM8W7h1YQZ1k+2lPcl
	2fKZKPqUAMCrukgoUj6GqOJQhmimOmfgcy2w8jmPNXhseuPGxvIOKRdb4xenkadBh26u
	9Ixw==
Received: by 10.14.176.68 with SMTP id a44mr44575454eem.1.1353496276976;
	Wed, 21 Nov 2012 03:11:16 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id e2sm5683563eeo.8.2012.11.21.03.11.13
	(version=SSLv3 cipher=OTHER); Wed, 21 Nov 2012 03:11:16 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 21 Nov 2012 11:11:10 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCD2674E.451A1%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [PATCH 0/5] HPET and IOMMU adjustments
Thread-Index: Ac3H2OkGLpu2N6sOgUGHVfPT7CPw9A==
In-Reply-To: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: Re: [Xen-devel] [PATCH 0/5] HPET and IOMMU adjustments
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 21/11/2012 10:06, "Jan Beulich" <JBeulich@suse.com> wrote:

> The first three patches complete the 'M' debug key output, to
> also include MSIs from HPET and IOMMUs.
> 
> The remaining two patched are logically unrelated, but apply only
> on top of the earlier ones.
> 
> 1: x86/HPET: include FSB interrupt information in 'M' debug key output
> 2: VT-d: include IOMMU interrupt information in 'M' debug key output
> 3: AMD IOMMU: include IOMMU interrupt information in 'M' debug key output
> 4: x86/HPET: fix FSB interrupt masking
> 5: VT-d: adjust IOMMU interrupt affinities when all CPUs are online
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

I had a minor comment on 5/5, but apart from that, these all look pretty
sensible.

Acked-by: Keir Fraser <keir@xen.org>

> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:11:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:11:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8D9-00040P-Oi; Wed, 21 Nov 2012 11:11:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Tb8D8-00040A-NV
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 11:11:18 +0000
Received: from [85.158.137.99:53136] by server-7.bemta-3.messagelabs.com id
	15/D8-01713-5D6BCA05; Wed, 21 Nov 2012 11:11:17 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1353496277!15261501!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30515 invoked from network); 21 Nov 2012 11:11:17 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-5.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 11:11:17 -0000
Received: by mail-ee0-f45.google.com with SMTP id d49so4719624eek.32
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 03:11:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=kLnUo4jghZRohN4Tbfn0I44vXYY3/Qb+E3XJvUNypSU=;
	b=00jpqvIAwEACWnKUnUbg+nBJU6vn0VZPGJQ6AFOwNaGemMAyc6CdLSBosu3RTOEXL+
	SilS9Rf1kuE1tv6GOXHDrNh8lm2ipRbhylqkaFYsNCTcOlavJbcE43zGg0KeJLs5YH1N
	QgwO37qSLBPmqp0sNOL0QNANDIiTuk1lKxE2MEEkYLcETWOD21jTQ/eZWma4BO68mq36
	Fp9ryZMMtVSuQGslpzPLRBzbnswATf7+bH9aWHig4JGxC+zXBReM8W7h1YQZ1k+2lPcl
	2fKZKPqUAMCrukgoUj6GqOJQhmimOmfgcy2w8jmPNXhseuPGxvIOKRdb4xenkadBh26u
	9Ixw==
Received: by 10.14.176.68 with SMTP id a44mr44575454eem.1.1353496276976;
	Wed, 21 Nov 2012 03:11:16 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id e2sm5683563eeo.8.2012.11.21.03.11.13
	(version=SSLv3 cipher=OTHER); Wed, 21 Nov 2012 03:11:16 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 21 Nov 2012 11:11:10 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCD2674E.451A1%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [PATCH 0/5] HPET and IOMMU adjustments
Thread-Index: Ac3H2OkGLpu2N6sOgUGHVfPT7CPw9A==
In-Reply-To: <50ACB5C602000078000AA487@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: Re: [Xen-devel] [PATCH 0/5] HPET and IOMMU adjustments
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 21/11/2012 10:06, "Jan Beulich" <JBeulich@suse.com> wrote:

> The first three patches complete the 'M' debug key output, to
> also include MSIs from HPET and IOMMUs.
> 
> The remaining two patched are logically unrelated, but apply only
> on top of the earlier ones.
> 
> 1: x86/HPET: include FSB interrupt information in 'M' debug key output
> 2: VT-d: include IOMMU interrupt information in 'M' debug key output
> 3: AMD IOMMU: include IOMMU interrupt information in 'M' debug key output
> 4: x86/HPET: fix FSB interrupt masking
> 5: VT-d: adjust IOMMU interrupt affinities when all CPUs are online
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

I had a minor comment on 5/5, but apart from that, these all look pretty
sensible.

Acked-by: Keir Fraser <keir@xen.org>

> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:17:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:17:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8Ig-0004Qj-N2; Wed, 21 Nov 2012 11:17:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb8Ie-0004Qe-Ue
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 11:17:01 +0000
Received: from [85.158.139.83:19494] by server-9.bemta-5.messagelabs.com id
	CA/C5-29295-C28BCA05; Wed, 21 Nov 2012 11:17:00 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1353496617!30544610!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29567 invoked from network); 21 Nov 2012 11:16:58 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 11:16:58 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 11:16:57 +0000
Message-Id: <50ACC67002000078000AA56A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 11:17:52 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir.xen@gmail.com>
References: <50ACB8CE02000078000AA4B0@nat28.tlf.novell.com>
	<CCD2672C.451A0%keir.xen@gmail.com>
In-Reply-To: <CCD2672C.451A0%keir.xen@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Wei Huang <wei.huang2@amd.com>, xen-devel <xen-devel@lists.xen.org>,
	Wei Wang <weiwang.dd@gmail.com>, xiantao.zhang@intel.com,
	Gang Wei <gang.wei@intel.com>
Subject: Re: [Xen-devel] [PATCH 5/5] VT-d: adjust IOMMU interrupt affinities
 when all CPUs are online
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 21.11.12 at 12:10, Keir Fraser <keir.xen@gmail.com> wrote:
> On 21/11/2012 10:19, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>> Since these interrupts get setup before APs get brought online, their
>> affinities naturally could only ever point to CPU 0 alone so far.
>> Adjust this to include potentially multiple CPUs in the target mask
>> (when running in one of the cluster modes), and take into account NUMA
>> information (to handle the interrupts on a CPU on the node where the
>> respective IOMMU is).
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> 
>> --- a/xen/drivers/passthrough/vtd/dmar.c
>> +++ b/xen/drivers/passthrough/vtd/dmar.c
>> @@ -839,6 +839,7 @@ void acpi_dmar_reinstate(void)
>>  
>>  void acpi_dmar_zap(void)
>>  {
>> +    adjust_vtd_irq_affinities();
> 
> Is this just a handy place to hook?

Yes.

> Does it logically make sense?

No. Just needed to put it somewhere where it would get run at
the right point in time, and the place here ensures this for both
boot and resume.

Shall I add a comment to this effect?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:17:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:17:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8Ig-0004Qj-N2; Wed, 21 Nov 2012 11:17:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb8Ie-0004Qe-Ue
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 11:17:01 +0000
Received: from [85.158.139.83:19494] by server-9.bemta-5.messagelabs.com id
	CA/C5-29295-C28BCA05; Wed, 21 Nov 2012 11:17:00 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1353496617!30544610!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29567 invoked from network); 21 Nov 2012 11:16:58 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 11:16:58 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 11:16:57 +0000
Message-Id: <50ACC67002000078000AA56A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 11:17:52 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir.xen@gmail.com>
References: <50ACB8CE02000078000AA4B0@nat28.tlf.novell.com>
	<CCD2672C.451A0%keir.xen@gmail.com>
In-Reply-To: <CCD2672C.451A0%keir.xen@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Wei Huang <wei.huang2@amd.com>, xen-devel <xen-devel@lists.xen.org>,
	Wei Wang <weiwang.dd@gmail.com>, xiantao.zhang@intel.com,
	Gang Wei <gang.wei@intel.com>
Subject: Re: [Xen-devel] [PATCH 5/5] VT-d: adjust IOMMU interrupt affinities
 when all CPUs are online
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 21.11.12 at 12:10, Keir Fraser <keir.xen@gmail.com> wrote:
> On 21/11/2012 10:19, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>> Since these interrupts get setup before APs get brought online, their
>> affinities naturally could only ever point to CPU 0 alone so far.
>> Adjust this to include potentially multiple CPUs in the target mask
>> (when running in one of the cluster modes), and take into account NUMA
>> information (to handle the interrupts on a CPU on the node where the
>> respective IOMMU is).
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> 
>> --- a/xen/drivers/passthrough/vtd/dmar.c
>> +++ b/xen/drivers/passthrough/vtd/dmar.c
>> @@ -839,6 +839,7 @@ void acpi_dmar_reinstate(void)
>>  
>>  void acpi_dmar_zap(void)
>>  {
>> +    adjust_vtd_irq_affinities();
> 
> Is this just a handy place to hook?

Yes.

> Does it logically make sense?

No. Just needed to put it somewhere where it would get run at
the right point in time, and the place here ensures this for both
boot and resume.

Shall I add a comment to this effect?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:24:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:24:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8Po-0004et-L8; Wed, 21 Nov 2012 11:24:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1Tb8Po-0004eo-10
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 11:24:24 +0000
Received: from [85.158.139.83:25477] by server-14.bemta-5.messagelabs.com id
	50/85-21768-4E9BCA05; Wed, 21 Nov 2012 11:24:20 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1353497058!31246454!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc4Njk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4774 invoked from network); 21 Nov 2012 11:24:20 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 11:24:20 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="215159326"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 11:24:18 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 06:24:18 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1Tb8Ph-0007JG-Ru;
	Wed, 21 Nov 2012 11:24:17 +0000
Message-ID: <50ACB894.1070509@eu.citrix.com>
Date: Wed, 21 Nov 2012 11:18:44 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
	<1353344256.18229.129.camel@zakaz.uk.xensource.com>
	<50AB9CFE.7000003@eu.citrix.com>
	<DE8DF0795D48FD4CA783C40EC8292335393633@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233539385B@SHSMSX101.ccr.corp.intel.com>
	<1353496027.13542.119.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353496027.13542.119.camel@zakaz.uk.xensource.com>
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 21/11/12 11:07, Ian Campbell wrote:
> On Tue, 2012-11-20 at 18:54 +0000, Liu, Jinsong wrote:
>> Well, let me elaborate more my thought about broken page occur at last iter:
>>
>> Theoretically we can separate 'broken page at last iter' into several sub-cases, and optimize case by case:
>> 1. if the page (which will break at last iter) is not on dirty bitmap (of last iter) --> do nothing is OK, target will happily run w/o broken page;
>> 2. if the page (which will break at last iter) is on dirty bitmap (of last iter)
>>    2.1 if at last iter, vmce occur after page copy --> do nothing is OK, target happily run w/o broken page;
>>    2.2 if vmce occur beofre pfn_type transfer --> do nothing is OK, V2 patch has correctly handle the case, target will set p2m broken correctly;
>>    2.3 if vmce occur after pfn_type transfer and before copy page to target --> we need handle this case;
>>
>> Practically considering it's rare enough, and code complication, we handle it in a simple way (not so optimized but enough for real life):
>> - we don't distinguish if the page is in dirty bitmap of last iter;
>> - we don't prefer adding new hypercall for this corner case, instead we'd like to re-use currently existed hypercall;
>> - if vmce occur at last iter, we do 1~2 more iter.
> Can't a page break on each "last" iter. i.e. you might actually go
> around as many times as there are pages in the last batch?

I think it would be only if the pages break one by one, at just the 
right time -- that seems pretty unlikely. :-)

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:24:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:24:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8Po-0004et-L8; Wed, 21 Nov 2012 11:24:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1Tb8Po-0004eo-10
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 11:24:24 +0000
Received: from [85.158.139.83:25477] by server-14.bemta-5.messagelabs.com id
	50/85-21768-4E9BCA05; Wed, 21 Nov 2012 11:24:20 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1353497058!31246454!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc4Njk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4774 invoked from network); 21 Nov 2012 11:24:20 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 11:24:20 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="215159326"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 11:24:18 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 06:24:18 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1Tb8Ph-0007JG-Ru;
	Wed, 21 Nov 2012 11:24:17 +0000
Message-ID: <50ACB894.1070509@eu.citrix.com>
Date: Wed, 21 Nov 2012 11:18:44 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
	<1353344256.18229.129.camel@zakaz.uk.xensource.com>
	<50AB9CFE.7000003@eu.citrix.com>
	<DE8DF0795D48FD4CA783C40EC8292335393633@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233539385B@SHSMSX101.ccr.corp.intel.com>
	<1353496027.13542.119.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353496027.13542.119.camel@zakaz.uk.xensource.com>
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 21/11/12 11:07, Ian Campbell wrote:
> On Tue, 2012-11-20 at 18:54 +0000, Liu, Jinsong wrote:
>> Well, let me elaborate more my thought about broken page occur at last iter:
>>
>> Theoretically we can separate 'broken page at last iter' into several sub-cases, and optimize case by case:
>> 1. if the page (which will break at last iter) is not on dirty bitmap (of last iter) --> do nothing is OK, target will happily run w/o broken page;
>> 2. if the page (which will break at last iter) is on dirty bitmap (of last iter)
>>    2.1 if at last iter, vmce occur after page copy --> do nothing is OK, target happily run w/o broken page;
>>    2.2 if vmce occur beofre pfn_type transfer --> do nothing is OK, V2 patch has correctly handle the case, target will set p2m broken correctly;
>>    2.3 if vmce occur after pfn_type transfer and before copy page to target --> we need handle this case;
>>
>> Practically considering it's rare enough, and code complication, we handle it in a simple way (not so optimized but enough for real life):
>> - we don't distinguish if the page is in dirty bitmap of last iter;
>> - we don't prefer adding new hypercall for this corner case, instead we'd like to re-use currently existed hypercall;
>> - if vmce occur at last iter, we do 1~2 more iter.
> Can't a page break on each "last" iter. i.e. you might actually go
> around as many times as there are pages in the last batch?

I think it would be only if the pages break one by one, at just the 
right time -- that seems pretty unlikely. :-)

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:30:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:30:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8VK-0004nM-EQ; Wed, 21 Nov 2012 11:30:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Tb8VI-0004nH-U1
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 11:30:05 +0000
Received: from [85.158.138.51:35011] by server-13.bemta-3.messagelabs.com id
	05/50-24887-C3BBCA05; Wed, 21 Nov 2012 11:30:04 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1353497403!30810286!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6889 invoked from network); 21 Nov 2012 11:30:03 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 11:30:03 -0000
Received: by mail-wi0-f173.google.com with SMTP id hm11so1516444wib.14
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 03:30:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=PII0/3dzc71MZ8C7++p8Otc9CIUZrHAcEAmtqgOyagA=;
	b=Vr8yILPUNOTdw7D1MXNAisULsEeMj3KWViKF68K6nNVDMq/Uhq6r243BCh0N6vCXaI
	JBe8s72c6t+XKVsufyo1X8d19VJsgiPZHYuF66tNY+sPCDQy3/QWGRICckl0alsdIuSx
	k5agCiq4pkIeEIFyyPYmHPVJlYjAs5IJmAkhbH278//f7oLVNGKz+FwfdOH2ensoJIqS
	DY3/RHMl+48wrB2DuLRgi/jT4utLrDtzJBVIljobThzjOM12/aWWiV4gH8VP1wkoTeBh
	OvtX9QRxghArLNf1UV693ypRUcJWAIafBagrw/Hm/r1MF6PmsPZDWeAdZ3DOGicUc1Ms
	aeNg==
Received: by 10.216.213.224 with SMTP id a74mr4888464wep.190.1353497403336;
	Wed, 21 Nov 2012 03:30:03 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id hv4sm21577429wib.0.2012.11.21.03.30.00
	(version=SSLv3 cipher=OTHER); Wed, 21 Nov 2012 03:30:02 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 21 Nov 2012 11:29:57 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <CCD26BB5.451A9%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [PATCH 5/5] VT-d: adjust IOMMU interrupt affinities
	when all CPUs are online
Thread-Index: Ac3H24jFAjWxaRuxZ0qny2CIkztyuw==
In-Reply-To: <50ACC67002000078000AA56A@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Wei Huang <wei.huang2@amd.com>, xen-devel <xen-devel@lists.xen.org>,
	Wei Wang <weiwang.dd@gmail.com>, xiantao.zhang@intel.com,
	Gang Wei <gang.wei@intel.com>
Subject: Re: [Xen-devel] [PATCH 5/5] VT-d: adjust IOMMU interrupt affinities
 when all CPUs are online
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 21/11/2012 11:17, "Jan Beulich" <JBeulich@suse.com> wrote:

>> Is this just a handy place to hook?
> 
> Yes.
> 
>> Does it logically make sense?
> 
> No. Just needed to put it somewhere where it would get run at
> the right point in time, and the place here ensures this for both
> boot and resume.

Yuk! And it doesn't work anyway. acpi_dmar_zap() isn't usually called during
boot -- go see it open coded at the end of acpi_parse_dmar(). It's only
called during boot when running tboot.

> Shall I add a comment to this effect?

I would rather have this added as another call to
acpi/power.c:enter_state(). It doesn't logically belong with
acpi_dmar_zap(), nor even with all its callers (e.g.,
tboot_parse_dmar_table).

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:30:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:30:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8VK-0004nM-EQ; Wed, 21 Nov 2012 11:30:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Tb8VI-0004nH-U1
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 11:30:05 +0000
Received: from [85.158.138.51:35011] by server-13.bemta-3.messagelabs.com id
	05/50-24887-C3BBCA05; Wed, 21 Nov 2012 11:30:04 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1353497403!30810286!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6889 invoked from network); 21 Nov 2012 11:30:03 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 11:30:03 -0000
Received: by mail-wi0-f173.google.com with SMTP id hm11so1516444wib.14
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 03:30:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=PII0/3dzc71MZ8C7++p8Otc9CIUZrHAcEAmtqgOyagA=;
	b=Vr8yILPUNOTdw7D1MXNAisULsEeMj3KWViKF68K6nNVDMq/Uhq6r243BCh0N6vCXaI
	JBe8s72c6t+XKVsufyo1X8d19VJsgiPZHYuF66tNY+sPCDQy3/QWGRICckl0alsdIuSx
	k5agCiq4pkIeEIFyyPYmHPVJlYjAs5IJmAkhbH278//f7oLVNGKz+FwfdOH2ensoJIqS
	DY3/RHMl+48wrB2DuLRgi/jT4utLrDtzJBVIljobThzjOM12/aWWiV4gH8VP1wkoTeBh
	OvtX9QRxghArLNf1UV693ypRUcJWAIafBagrw/Hm/r1MF6PmsPZDWeAdZ3DOGicUc1Ms
	aeNg==
Received: by 10.216.213.224 with SMTP id a74mr4888464wep.190.1353497403336;
	Wed, 21 Nov 2012 03:30:03 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id hv4sm21577429wib.0.2012.11.21.03.30.00
	(version=SSLv3 cipher=OTHER); Wed, 21 Nov 2012 03:30:02 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 21 Nov 2012 11:29:57 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <CCD26BB5.451A9%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [PATCH 5/5] VT-d: adjust IOMMU interrupt affinities
	when all CPUs are online
Thread-Index: Ac3H24jFAjWxaRuxZ0qny2CIkztyuw==
In-Reply-To: <50ACC67002000078000AA56A@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Wei Huang <wei.huang2@amd.com>, xen-devel <xen-devel@lists.xen.org>,
	Wei Wang <weiwang.dd@gmail.com>, xiantao.zhang@intel.com,
	Gang Wei <gang.wei@intel.com>
Subject: Re: [Xen-devel] [PATCH 5/5] VT-d: adjust IOMMU interrupt affinities
 when all CPUs are online
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 21/11/2012 11:17, "Jan Beulich" <JBeulich@suse.com> wrote:

>> Is this just a handy place to hook?
> 
> Yes.
> 
>> Does it logically make sense?
> 
> No. Just needed to put it somewhere where it would get run at
> the right point in time, and the place here ensures this for both
> boot and resume.

Yuk! And it doesn't work anyway. acpi_dmar_zap() isn't usually called during
boot -- go see it open coded at the end of acpi_parse_dmar(). It's only
called during boot when running tboot.

> Shall I add a comment to this effect?

I would rather have this added as another call to
acpi/power.c:enter_state(). It doesn't logically belong with
acpi_dmar_zap(), nor even with all its callers (e.g.,
tboot_parse_dmar_table).

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:40:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:40:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8fa-00057J-Oi; Wed, 21 Nov 2012 11:40:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1Tb8fY-00057E-OG
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 11:40:40 +0000
Received: from [85.158.139.211:30387] by server-14.bemta-5.messagelabs.com id
	26/BE-21768-8BDBCA05; Wed, 21 Nov 2012 11:40:40 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353498017!20955022!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc4Njk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14188 invoked from network); 21 Nov 2012 11:40:39 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 11:40:39 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="215160938"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 11:40:14 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 06:40:14 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1Tb8f8-0007bE-9t;
	Wed, 21 Nov 2012 11:40:14 +0000
Message-ID: <50ACBC50.4040204@eu.citrix.com>
Date: Wed, 21 Nov 2012 11:34:40 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
In-Reply-To: <20651.52995.774236.722303@mariner.uk.xensource.com>
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 20/11/12 18:42, Ian Jackson wrote:
> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard to migration"):
>> Ian Jackson wrote:
>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>> broken page with regard to migration"):
>>>> No, at last lter, there are 4 points:
>>>> 1. start last iter
>>>> 2. get and transfer pfn_type to target
>>>> 3. copy page to target
>>>> 4. end last iter
> ...
>> It indeed checks mce after point 3 for each page, but what's the
>> advantage of keeping a separate list?
> It avoids yet another loop over all the pages.  Unless I have
> misunderstood.  Which I may have, because: if it checks for mce after
> point 3 then surely that is sufficient ?  We don't need to worry about
> mces after that check.

It's sufficient, but wouldn't each check require a separate hypercall?  
That would surely be slower than just a single hypercall and a loop 
(which is what Jinsong's patch does).

We don't actually need a list -- I think we just need to know, "Have any 
pages broken between reading the p2m table ( xc_get_pfn_type_batch() ); 
if so, we do another full iteration.

Since marking a page broken will also mark it dirty, I suppose what we 
could do is, on the last iteration, clear the dirty bitmap after getting 
the list of pages but before copying them; and then check the bit in the 
bitmap corresponding to the pfn after copying it.

But on the whole, is that really that much *faster* to do it that way?  
Either way you're still adding a single hypercall to the whole thing, 
and one iteration of a loop for each page; but in Jinsong's patch, the 
loop is done all at once, so presumably the compiler / processor will be 
able to do make better use of loop unrolling / registers / the pipeline 
/ branch prediction / caches &c.

The only way to avoid the loop would be to add an extra "have any pages 
been marked broken / dirty" bit somewhere, which is probably more 
trouble than it's worth.

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:40:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:40:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8fa-00057J-Oi; Wed, 21 Nov 2012 11:40:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1Tb8fY-00057E-OG
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 11:40:40 +0000
Received: from [85.158.139.211:30387] by server-14.bemta-5.messagelabs.com id
	26/BE-21768-8BDBCA05; Wed, 21 Nov 2012 11:40:40 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353498017!20955022!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc4Njk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14188 invoked from network); 21 Nov 2012 11:40:39 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 11:40:39 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="215160938"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 11:40:14 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 06:40:14 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1Tb8f8-0007bE-9t;
	Wed, 21 Nov 2012 11:40:14 +0000
Message-ID: <50ACBC50.4040204@eu.citrix.com>
Date: Wed, 21 Nov 2012 11:34:40 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
In-Reply-To: <20651.52995.774236.722303@mariner.uk.xensource.com>
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 20/11/12 18:42, Ian Jackson wrote:
> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard to migration"):
>> Ian Jackson wrote:
>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>> broken page with regard to migration"):
>>>> No, at last lter, there are 4 points:
>>>> 1. start last iter
>>>> 2. get and transfer pfn_type to target
>>>> 3. copy page to target
>>>> 4. end last iter
> ...
>> It indeed checks mce after point 3 for each page, but what's the
>> advantage of keeping a separate list?
> It avoids yet another loop over all the pages.  Unless I have
> misunderstood.  Which I may have, because: if it checks for mce after
> point 3 then surely that is sufficient ?  We don't need to worry about
> mces after that check.

It's sufficient, but wouldn't each check require a separate hypercall?  
That would surely be slower than just a single hypercall and a loop 
(which is what Jinsong's patch does).

We don't actually need a list -- I think we just need to know, "Have any 
pages broken between reading the p2m table ( xc_get_pfn_type_batch() ); 
if so, we do another full iteration.

Since marking a page broken will also mark it dirty, I suppose what we 
could do is, on the last iteration, clear the dirty bitmap after getting 
the list of pages but before copying them; and then check the bit in the 
bitmap corresponding to the pfn after copying it.

But on the whole, is that really that much *faster* to do it that way?  
Either way you're still adding a single hypercall to the whole thing, 
and one iteration of a loop for each page; but in Jinsong's patch, the 
loop is done all at once, so presumably the compiler / processor will be 
able to do make better use of loop unrolling / registers / the pipeline 
/ branch prediction / caches &c.

The only way to avoid the loop would be to add an extra "have any pages 
been marked broken / dirty" bit somewhere, which is probably more 
trouble than it's worth.

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:45:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:45:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8k9-0005KJ-GB; Wed, 21 Nov 2012 11:45:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1Tb8k8-0005KE-GM
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 11:45:25 +0000
Received: from [85.158.139.83:8418] by server-14.bemta-5.messagelabs.com id
	25/BA-21768-3DEBCA05; Wed, 21 Nov 2012 11:45:23 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1353498310!31296129!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjMyODQz\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27730 invoked from network); 21 Nov 2012 11:45:11 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-5.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 11:45:11 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga102.ch.intel.com with ESMTP; 21 Nov 2012 03:45:08 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,293,1352102400"; 
	d="scan'208,223";a="170957336"
Received: from fmsmsx107.amr.corp.intel.com ([10.19.9.54])
	by AZSMGA002.ch.intel.com with ESMTP; 21 Nov 2012 03:45:07 -0800
Received: from fmsmsx102.amr.corp.intel.com (10.19.9.53) by
	FMSMSX107.amr.corp.intel.com (10.19.9.54) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 03:45:07 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX102.amr.corp.intel.com (10.19.9.53) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 03:45:06 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 19:45:05 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Thread-Topic: [PATCH V1 1/2] Xen acpi memory hotplug driver
Thread-Index: Ac3H3aWVSU3ZacIzTZWfqqryq2EEHA==
Date: Wed, 21 Nov 2012 11:45:04 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353942F9@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_002_DE8DF0795D48FD4CA783C40EC82923353942F9SHSMSX101ccrcorpi_"
MIME-Version: 1.0
Cc: "lenb@kernel.org" <lenb@kernel.org>
Subject: [Xen-devel] [PATCH V1 1/2] Xen acpi memory hotplug driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_DE8DF0795D48FD4CA783C40EC82923353942F9SHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

>From 630c65690c878255ce71e7c1172338ed08709273 Mon Sep 17 00:00:00 2001
From: Liu Jinsong <jinsong.liu@intel.com>
Date: Tue, 20 Nov 2012 21:14:37 +0800
Subject: [PATCH 1/2] Xen acpi memory hotplug driver

Xen acpi memory hotplug consists of 2 logic components:
Xen acpi memory hotplug driver and Xen hypercall.

This patch implement Xen acpi memory hotplug driver. When running
under xen platform, Xen driver will early occupy (so native driver
will be blocked). When acpi memory notify OSPM, xen driver will take
effect, adding related memory device and parsing memory information.

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
---
 drivers/xen/Kconfig               |   11 +
 drivers/xen/Makefile              |    1 +
 drivers/xen/xen-acpi-memhotplug.c |  383 +++++++++++++++++++++++++++++++++=
++++
 3 files changed, 395 insertions(+), 0 deletions(-)
 create mode 100644 drivers/xen/xen-acpi-memhotplug.c

diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
index 126d8ce..abd0396 100644
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
@@ -206,4 +206,15 @@ config XEN_MCE_LOG
 	  Allow kernel fetching MCE error from Xen platform and
 	  converting it into Linux mcelog format for mcelog tools
=20
+config XEN_ACPI_MEMORY_HOTPLUG
+	bool "Xen ACPI memory hotplug"
+	depends on XEN_DOM0 && X86_64 && ACPI
+	default n
+	help
+	  This is Xen acpi memory hotplug.
+
+	  Currently Xen only support acpi memory hot-add. If you want
+	  to hot-add memory at runtime (the hot-added memory cannot be
+	  removed until machine stop), select Y here, otherwise select N.
+
 endmenu
diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 7435470..c339eb4 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -30,6 +30,7 @@ obj-$(CONFIG_XEN_MCE_LOG)		+=3D mcelog.o
 obj-$(CONFIG_XEN_PCIDEV_BACKEND)	+=3D xen-pciback/
 obj-$(CONFIG_XEN_PRIVCMD)		+=3D xen-privcmd.o
 obj-$(CONFIG_XEN_ACPI_PROCESSOR)	+=3D xen-acpi-processor.o
+obj-$(CONFIG_XEN_ACPI_MEMORY_HOTPLUG)	+=3D xen-acpi-memhotplug.o
 xen-evtchn-y				:=3D evtchn.o
 xen-gntdev-y				:=3D gntdev.o
 xen-gntalloc-y				:=3D gntalloc.o
diff --git a/drivers/xen/xen-acpi-memhotplug.c b/drivers/xen/xen-acpi-memho=
tplug.c
new file mode 100644
index 0000000..f0c7990
--- /dev/null
+++ b/drivers/xen/xen-acpi-memhotplug.c
@@ -0,0 +1,383 @@
+/*
+ * Copyright (C) 2012 Intel Corporation
+ *    Author: Liu Jinsong <jinsong.liu@intel.com>
+ *    Author: Jiang Yunhong <yunhong.jiang@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * 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, GOOD TITLE or
+ * NON INFRINGEMENT.  See the GNU General Public License for more
+ * details.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <acpi/acpi_drivers.h>
+
+#define ACPI_MEMORY_DEVICE_CLASS		"memory"
+#define ACPI_MEMORY_DEVICE_HID			"PNP0C80"
+#define ACPI_MEMORY_DEVICE_NAME			"Hotplug Mem Device"
+
+#undef PREFIX
+#define PREFIX "ACPI:memory_hp:"
+
+static int acpi_memory_device_add(struct acpi_device *device);
+static int acpi_memory_device_remove(struct acpi_device *device, int type)=
;
+
+static const struct acpi_device_id memory_device_ids[] =3D {
+	{ACPI_MEMORY_DEVICE_HID, 0},
+	{"", 0},
+};
+
+static struct acpi_driver acpi_memory_device_driver =3D {
+	.name =3D "acpi_memhotplug",
+	.class =3D ACPI_MEMORY_DEVICE_CLASS,
+	.ids =3D memory_device_ids,
+	.ops =3D {
+		.add =3D acpi_memory_device_add,
+		.remove =3D acpi_memory_device_remove,
+		},
+};
+
+struct acpi_memory_info {
+	struct list_head list;
+	u64 start_addr;		/* Memory Range start physical addr */
+	u64 length;		/* Memory Range length */
+	unsigned short caching;	/* memory cache attribute */
+	unsigned short write_protect;	/* memory read/write attribute */
+	unsigned int enabled:1;
+};
+
+struct acpi_memory_device {
+	struct acpi_device *device;
+	struct list_head res_list;
+};
+
+static int acpi_hotmem_initialized;
+
+
+int xen_acpi_memory_enable_device(struct acpi_memory_device *mem_device)
+{
+	return 0;
+}
+
+static acpi_status
+acpi_memory_get_resource(struct acpi_resource *resource, void *context)
+{
+	struct acpi_memory_device *mem_device =3D context;
+	struct acpi_resource_address64 address64;
+	struct acpi_memory_info *info, *new;
+	acpi_status status;
+
+	status =3D acpi_resource_to_address64(resource, &address64);
+	if (ACPI_FAILURE(status) ||
+	    (address64.resource_type !=3D ACPI_MEMORY_RANGE))
+		return AE_OK;
+
+	list_for_each_entry(info, &mem_device->res_list, list) {
+		/* Can we combine the resource range information? */
+		if ((info->caching =3D=3D address64.info.mem.caching) &&
+		    (info->write_protect =3D=3D address64.info.mem.write_protect) &&
+		    (info->start_addr + info->length =3D=3D address64.minimum)) {
+			info->length +=3D address64.address_length;
+			return AE_OK;
+		}
+	}
+
+	new =3D kzalloc(sizeof(struct acpi_memory_info), GFP_KERNEL);
+	if (!new)
+		return AE_ERROR;
+
+	INIT_LIST_HEAD(&new->list);
+	new->caching =3D address64.info.mem.caching;
+	new->write_protect =3D address64.info.mem.write_protect;
+	new->start_addr =3D address64.minimum;
+	new->length =3D address64.address_length;
+	list_add_tail(&new->list, &mem_device->res_list);
+
+	return AE_OK;
+}
+
+static int
+acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
+{
+	acpi_status status;
+	struct acpi_memory_info *info, *n;
+
+	if (!list_empty(&mem_device->res_list))
+		return 0;
+
+	status =3D acpi_walk_resources(mem_device->device->handle,
+		METHOD_NAME__CRS, acpi_memory_get_resource, mem_device);
+
+	if (ACPI_FAILURE(status)) {
+		list_for_each_entry_safe(info, n, &mem_device->res_list, list)
+			kfree(info);
+		INIT_LIST_HEAD(&mem_device->res_list);
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int
+acpi_memory_get_device(acpi_handle handle,
+		       struct acpi_memory_device **mem_device)
+{
+	acpi_status status;
+	acpi_handle phandle;
+	struct acpi_device *device =3D NULL;
+	struct acpi_device *pdevice =3D NULL;
+	int result;
+
+	if (!acpi_bus_get_device(handle, &device) && device)
+		goto end;
+
+	status =3D acpi_get_parent(handle, &phandle);
+	if (ACPI_FAILURE(status)) {
+		pr_warn(PREFIX "Cannot find acpi parent\n");
+		return -EINVAL;
+	}
+
+	/* Get the parent device */
+	result =3D acpi_bus_get_device(phandle, &pdevice);
+	if (result) {
+		pr_warn(PREFIX "Cannot get acpi bus device\n");
+		return -EINVAL;
+	}
+
+	/*
+	 * Now add the notified device.  This creates the acpi_device
+	 * and invokes .add function
+	 */
+	result =3D acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
+	if (result) {
+		pr_warn(PREFIX "Cannot add acpi bus\n");
+		return -EINVAL;
+	}
+
+end:
+	*mem_device =3D acpi_driver_data(device);
+	if (!(*mem_device)) {
+		pr_err(PREFIX "Driver data not found\n");
+		return -ENODEV;
+	}
+
+	return 0;
+}
+
+static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
+{
+	unsigned long long current_status;
+
+	/* Get device present/absent information from the _STA */
+	if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle,
+				"_STA", NULL, &current_status)))
+		return -ENODEV;
+	/*
+	 * Check for device status. Device should be
+	 * present/enabled/functioning.
+	 */
+	if (!((current_status & ACPI_STA_DEVICE_PRESENT)
+	      && (current_status & ACPI_STA_DEVICE_ENABLED)
+	      && (current_status & ACPI_STA_DEVICE_FUNCTIONING)))
+		return -ENODEV;
+
+	return 0;
+}
+
+static int acpi_memory_disable_device(struct acpi_memory_device *mem_devic=
e)
+{
+	pr_warn(PREFIX "Xen does not support memory hotremove\n");
+
+	return -ENOSYS;
+}
+
+static void acpi_memory_device_notify(acpi_handle handle, u32 event, void =
*data)
+{
+	struct acpi_memory_device *mem_device;
+	struct acpi_device *device;
+	u32 ost_code =3D ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */
+
+	switch (event) {
+	case ACPI_NOTIFY_BUS_CHECK:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+			"\nReceived BUS CHECK notification for device\n"));
+		/* Fall Through */
+	case ACPI_NOTIFY_DEVICE_CHECK:
+		if (event =3D=3D ACPI_NOTIFY_DEVICE_CHECK)
+			ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+			"\nReceived DEVICE CHECK notification for device\n"));
+
+		if (acpi_memory_get_device(handle, &mem_device)) {
+			pr_err(PREFIX "Cannot find driver data\n");
+			break;
+		}
+
+		ost_code =3D ACPI_OST_SC_SUCCESS;
+		break;
+
+	case ACPI_NOTIFY_EJECT_REQUEST:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+			"\nReceived EJECT REQUEST notification for device\n"));
+
+		if (acpi_bus_get_device(handle, &device)) {
+			pr_err(PREFIX "Device doesn't exist\n");
+			break;
+		}
+		mem_device =3D acpi_driver_data(device);
+		if (!mem_device) {
+			pr_err(PREFIX "Driver Data is NULL\n");
+			break;
+		}
+
+		/*
+		 * TBD: implement acpi_memory_disable_device and invoke
+		 * acpi_bus_remove if Xen support hotremove in the future
+		 */
+		acpi_memory_disable_device(mem_device);
+		break;
+
+	default:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+				  "Unsupported event [0x%x]\n", event));
+		/* non-hotplug event; possibly handled by other handler */
+		return;
+	}
+
+	/* Inform firmware that the hotplug operation has completed */
+	(void) acpi_evaluate_hotplug_ost(handle, event, ost_code, NULL);
+	return;
+}
+
+static int acpi_memory_device_add(struct acpi_device *device)
+{
+	int result;
+	struct acpi_memory_device *mem_device =3D NULL;
+
+
+	if (!device)
+		return -EINVAL;
+
+	mem_device =3D kzalloc(sizeof(struct acpi_memory_device), GFP_KERNEL);
+	if (!mem_device)
+		return -ENOMEM;
+
+	INIT_LIST_HEAD(&mem_device->res_list);
+	mem_device->device =3D device;
+	sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME);
+	sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS);
+	device->driver_data =3D mem_device;
+
+	/* Get the range from the _CRS */
+	result =3D acpi_memory_get_device_resources(mem_device);
+	if (result) {
+		kfree(mem_device);
+		return result;
+	}
+
+	/*
+	 * Early boot code has recognized memory area by EFI/E820.
+	 * If DSDT shows these memory devices on boot, hotplug is not necessary
+	 * for them. So, it just returns until completion of this driver's
+	 * start up.
+	 */
+	if (!acpi_hotmem_initialized)
+		return 0;
+
+	if (!acpi_memory_check_device(mem_device))
+		result =3D xen_acpi_memory_enable_device(mem_device);
+
+	return result;
+}
+
+static int acpi_memory_device_remove(struct acpi_device *device, int type)
+{
+	struct acpi_memory_device *mem_device =3D NULL;
+
+	if (!device || !acpi_driver_data(device))
+		return -EINVAL;
+
+	mem_device =3D acpi_driver_data(device);
+	kfree(mem_device);
+
+	return 0;
+}
+
+/*
+ * Helper function to check for memory device
+ */
+static acpi_status is_memory_device(acpi_handle handle)
+{
+	char *hardware_id;
+	acpi_status status;
+	struct acpi_device_info *info;
+
+	status =3D acpi_get_object_info(handle, &info);
+	if (ACPI_FAILURE(status))
+		return status;
+
+	if (!(info->valid & ACPI_VALID_HID)) {
+		kfree(info);
+		return AE_ERROR;
+	}
+
+	hardware_id =3D info->hardware_id.string;
+	if ((hardware_id =3D=3D NULL) ||
+	    (strcmp(hardware_id, ACPI_MEMORY_DEVICE_HID)))
+		status =3D AE_ERROR;
+
+	kfree(info);
+	return status;
+}
+
+static acpi_status
+acpi_memory_register_notify_handler(acpi_handle handle,
+				    u32 level, void *ctxt, void **retv)
+{
+	acpi_status status;
+
+	status =3D is_memory_device(handle);
+	if (ACPI_FAILURE(status))
+		return AE_OK;	/* continue */
+
+	status =3D acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
+					     acpi_memory_device_notify, NULL);
+	/* continue */
+	return AE_OK;
+}
+
+static int __init xen_acpi_memory_device_init(void)
+{
+	int result;
+	acpi_status status;
+
+	/* only dom0 is responsible for xen acpi memory hotplug */
+	if (!xen_initial_domain())
+		return -ENODEV;
+
+	result =3D acpi_bus_register_driver(&acpi_memory_device_driver);
+	if (result < 0)
+		return -ENODEV;
+
+	status =3D acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
+				     ACPI_UINT32_MAX,
+				     acpi_memory_register_notify_handler, NULL,
+				     NULL, NULL);
+
+	if (ACPI_FAILURE(status)) {
+		pr_warn(PREFIX "walk_namespace failed\n");
+		acpi_bus_unregister_driver(&acpi_memory_device_driver);
+		return -ENODEV;
+	}
+
+	acpi_hotmem_initialized =3D 1;
+	return 0;
+}
+subsys_initcall(xen_acpi_memory_device_init);
--=20
1.7.1

--_002_DE8DF0795D48FD4CA783C40EC82923353942F9SHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
	name="0001-Xen-acpi-memory-hotplug-driver.patch"
Content-Description: 0001-Xen-acpi-memory-hotplug-driver.patch
Content-Disposition: attachment;
	filename="0001-Xen-acpi-memory-hotplug-driver.patch"; size=12522;
	creation-date="Wed, 21 Nov 2012 11:38:00 GMT";
	modification-date="Wed, 21 Nov 2012 11:20:46 GMT"
Content-Transfer-Encoding: base64

RnJvbSA2MzBjNjU2OTBjODc4MjU1Y2U3MWU3YzExNzIzMzhlZDA4NzA5MjczIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBMaXUgSmluc29uZyA8amluc29uZy5saXVAaW50ZWwuY29tPgpE
YXRlOiBUdWUsIDIwIE5vdiAyMDE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QSV9S
T09UX09CSkVDVCwKKwkJCQkgICAgIEFDUElfVUlOVDMyX01BWCwKKwkJCQkgICAgIGFjcGlfbWVt
b3J5X3JlZ2lzdGVyX25vdGlmeV9oYW5kbGVyLCBOVUxMLAorCQkJCSAgICAgTlVMTCwgTlVMTCk7
CisKKwlpZiAoQUNQSV9GQUlMVVJFKHN0YXR1cykpIHsKKwkJcHJfd2FybihQUkVGSVggIndhbGtf
bmFtZXNwYWNlIGZhaWxlZFxuIik7CisJCWFjcGlfYnVzX3VucmVnaXN0ZXJfZHJpdmVyKCZhY3Bp
X21lbW9yeV9kZXZpY2VfZHJpdmVyKTsKKwkJcmV0dXJuIC1FTk9ERVY7CisJfQorCisJYWNwaV9o
b3RtZW1faW5pdGlhbGl6ZWQgPSAxOworCXJldHVybiAwOworfQorc3Vic3lzX2luaXRjYWxsKHhl
bl9hY3BpX21lbW9yeV9kZXZpY2VfaW5pdCk7Ci0tIAoxLjcuMQoK

--_002_DE8DF0795D48FD4CA783C40EC82923353942F9SHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_002_DE8DF0795D48FD4CA783C40EC82923353942F9SHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Wed Nov 21 11:45:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:45:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8k9-0005KJ-GB; Wed, 21 Nov 2012 11:45:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1Tb8k8-0005KE-GM
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 11:45:25 +0000
Received: from [85.158.139.83:8418] by server-14.bemta-5.messagelabs.com id
	25/BA-21768-3DEBCA05; Wed, 21 Nov 2012 11:45:23 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1353498310!31296129!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjMyODQz\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27730 invoked from network); 21 Nov 2012 11:45:11 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-5.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 11:45:11 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga102.ch.intel.com with ESMTP; 21 Nov 2012 03:45:08 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,293,1352102400"; 
	d="scan'208,223";a="170957336"
Received: from fmsmsx107.amr.corp.intel.com ([10.19.9.54])
	by AZSMGA002.ch.intel.com with ESMTP; 21 Nov 2012 03:45:07 -0800
Received: from fmsmsx102.amr.corp.intel.com (10.19.9.53) by
	FMSMSX107.amr.corp.intel.com (10.19.9.54) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 03:45:07 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX102.amr.corp.intel.com (10.19.9.53) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 03:45:06 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 19:45:05 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Thread-Topic: [PATCH V1 1/2] Xen acpi memory hotplug driver
Thread-Index: Ac3H3aWVSU3ZacIzTZWfqqryq2EEHA==
Date: Wed, 21 Nov 2012 11:45:04 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353942F9@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_002_DE8DF0795D48FD4CA783C40EC82923353942F9SHSMSX101ccrcorpi_"
MIME-Version: 1.0
Cc: "lenb@kernel.org" <lenb@kernel.org>
Subject: [Xen-devel] [PATCH V1 1/2] Xen acpi memory hotplug driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_DE8DF0795D48FD4CA783C40EC82923353942F9SHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

>From 630c65690c878255ce71e7c1172338ed08709273 Mon Sep 17 00:00:00 2001
From: Liu Jinsong <jinsong.liu@intel.com>
Date: Tue, 20 Nov 2012 21:14:37 +0800
Subject: [PATCH 1/2] Xen acpi memory hotplug driver

Xen acpi memory hotplug consists of 2 logic components:
Xen acpi memory hotplug driver and Xen hypercall.

This patch implement Xen acpi memory hotplug driver. When running
under xen platform, Xen driver will early occupy (so native driver
will be blocked). When acpi memory notify OSPM, xen driver will take
effect, adding related memory device and parsing memory information.

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
---
 drivers/xen/Kconfig               |   11 +
 drivers/xen/Makefile              |    1 +
 drivers/xen/xen-acpi-memhotplug.c |  383 +++++++++++++++++++++++++++++++++=
++++
 3 files changed, 395 insertions(+), 0 deletions(-)
 create mode 100644 drivers/xen/xen-acpi-memhotplug.c

diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
index 126d8ce..abd0396 100644
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
@@ -206,4 +206,15 @@ config XEN_MCE_LOG
 	  Allow kernel fetching MCE error from Xen platform and
 	  converting it into Linux mcelog format for mcelog tools
=20
+config XEN_ACPI_MEMORY_HOTPLUG
+	bool "Xen ACPI memory hotplug"
+	depends on XEN_DOM0 && X86_64 && ACPI
+	default n
+	help
+	  This is Xen acpi memory hotplug.
+
+	  Currently Xen only support acpi memory hot-add. If you want
+	  to hot-add memory at runtime (the hot-added memory cannot be
+	  removed until machine stop), select Y here, otherwise select N.
+
 endmenu
diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 7435470..c339eb4 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -30,6 +30,7 @@ obj-$(CONFIG_XEN_MCE_LOG)		+=3D mcelog.o
 obj-$(CONFIG_XEN_PCIDEV_BACKEND)	+=3D xen-pciback/
 obj-$(CONFIG_XEN_PRIVCMD)		+=3D xen-privcmd.o
 obj-$(CONFIG_XEN_ACPI_PROCESSOR)	+=3D xen-acpi-processor.o
+obj-$(CONFIG_XEN_ACPI_MEMORY_HOTPLUG)	+=3D xen-acpi-memhotplug.o
 xen-evtchn-y				:=3D evtchn.o
 xen-gntdev-y				:=3D gntdev.o
 xen-gntalloc-y				:=3D gntalloc.o
diff --git a/drivers/xen/xen-acpi-memhotplug.c b/drivers/xen/xen-acpi-memho=
tplug.c
new file mode 100644
index 0000000..f0c7990
--- /dev/null
+++ b/drivers/xen/xen-acpi-memhotplug.c
@@ -0,0 +1,383 @@
+/*
+ * Copyright (C) 2012 Intel Corporation
+ *    Author: Liu Jinsong <jinsong.liu@intel.com>
+ *    Author: Jiang Yunhong <yunhong.jiang@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * 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, GOOD TITLE or
+ * NON INFRINGEMENT.  See the GNU General Public License for more
+ * details.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <acpi/acpi_drivers.h>
+
+#define ACPI_MEMORY_DEVICE_CLASS		"memory"
+#define ACPI_MEMORY_DEVICE_HID			"PNP0C80"
+#define ACPI_MEMORY_DEVICE_NAME			"Hotplug Mem Device"
+
+#undef PREFIX
+#define PREFIX "ACPI:memory_hp:"
+
+static int acpi_memory_device_add(struct acpi_device *device);
+static int acpi_memory_device_remove(struct acpi_device *device, int type)=
;
+
+static const struct acpi_device_id memory_device_ids[] =3D {
+	{ACPI_MEMORY_DEVICE_HID, 0},
+	{"", 0},
+};
+
+static struct acpi_driver acpi_memory_device_driver =3D {
+	.name =3D "acpi_memhotplug",
+	.class =3D ACPI_MEMORY_DEVICE_CLASS,
+	.ids =3D memory_device_ids,
+	.ops =3D {
+		.add =3D acpi_memory_device_add,
+		.remove =3D acpi_memory_device_remove,
+		},
+};
+
+struct acpi_memory_info {
+	struct list_head list;
+	u64 start_addr;		/* Memory Range start physical addr */
+	u64 length;		/* Memory Range length */
+	unsigned short caching;	/* memory cache attribute */
+	unsigned short write_protect;	/* memory read/write attribute */
+	unsigned int enabled:1;
+};
+
+struct acpi_memory_device {
+	struct acpi_device *device;
+	struct list_head res_list;
+};
+
+static int acpi_hotmem_initialized;
+
+
+int xen_acpi_memory_enable_device(struct acpi_memory_device *mem_device)
+{
+	return 0;
+}
+
+static acpi_status
+acpi_memory_get_resource(struct acpi_resource *resource, void *context)
+{
+	struct acpi_memory_device *mem_device =3D context;
+	struct acpi_resource_address64 address64;
+	struct acpi_memory_info *info, *new;
+	acpi_status status;
+
+	status =3D acpi_resource_to_address64(resource, &address64);
+	if (ACPI_FAILURE(status) ||
+	    (address64.resource_type !=3D ACPI_MEMORY_RANGE))
+		return AE_OK;
+
+	list_for_each_entry(info, &mem_device->res_list, list) {
+		/* Can we combine the resource range information? */
+		if ((info->caching =3D=3D address64.info.mem.caching) &&
+		    (info->write_protect =3D=3D address64.info.mem.write_protect) &&
+		    (info->start_addr + info->length =3D=3D address64.minimum)) {
+			info->length +=3D address64.address_length;
+			return AE_OK;
+		}
+	}
+
+	new =3D kzalloc(sizeof(struct acpi_memory_info), GFP_KERNEL);
+	if (!new)
+		return AE_ERROR;
+
+	INIT_LIST_HEAD(&new->list);
+	new->caching =3D address64.info.mem.caching;
+	new->write_protect =3D address64.info.mem.write_protect;
+	new->start_addr =3D address64.minimum;
+	new->length =3D address64.address_length;
+	list_add_tail(&new->list, &mem_device->res_list);
+
+	return AE_OK;
+}
+
+static int
+acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
+{
+	acpi_status status;
+	struct acpi_memory_info *info, *n;
+
+	if (!list_empty(&mem_device->res_list))
+		return 0;
+
+	status =3D acpi_walk_resources(mem_device->device->handle,
+		METHOD_NAME__CRS, acpi_memory_get_resource, mem_device);
+
+	if (ACPI_FAILURE(status)) {
+		list_for_each_entry_safe(info, n, &mem_device->res_list, list)
+			kfree(info);
+		INIT_LIST_HEAD(&mem_device->res_list);
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int
+acpi_memory_get_device(acpi_handle handle,
+		       struct acpi_memory_device **mem_device)
+{
+	acpi_status status;
+	acpi_handle phandle;
+	struct acpi_device *device =3D NULL;
+	struct acpi_device *pdevice =3D NULL;
+	int result;
+
+	if (!acpi_bus_get_device(handle, &device) && device)
+		goto end;
+
+	status =3D acpi_get_parent(handle, &phandle);
+	if (ACPI_FAILURE(status)) {
+		pr_warn(PREFIX "Cannot find acpi parent\n");
+		return -EINVAL;
+	}
+
+	/* Get the parent device */
+	result =3D acpi_bus_get_device(phandle, &pdevice);
+	if (result) {
+		pr_warn(PREFIX "Cannot get acpi bus device\n");
+		return -EINVAL;
+	}
+
+	/*
+	 * Now add the notified device.  This creates the acpi_device
+	 * and invokes .add function
+	 */
+	result =3D acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
+	if (result) {
+		pr_warn(PREFIX "Cannot add acpi bus\n");
+		return -EINVAL;
+	}
+
+end:
+	*mem_device =3D acpi_driver_data(device);
+	if (!(*mem_device)) {
+		pr_err(PREFIX "Driver data not found\n");
+		return -ENODEV;
+	}
+
+	return 0;
+}
+
+static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
+{
+	unsigned long long current_status;
+
+	/* Get device present/absent information from the _STA */
+	if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle,
+				"_STA", NULL, &current_status)))
+		return -ENODEV;
+	/*
+	 * Check for device status. Device should be
+	 * present/enabled/functioning.
+	 */
+	if (!((current_status & ACPI_STA_DEVICE_PRESENT)
+	      && (current_status & ACPI_STA_DEVICE_ENABLED)
+	      && (current_status & ACPI_STA_DEVICE_FUNCTIONING)))
+		return -ENODEV;
+
+	return 0;
+}
+
+static int acpi_memory_disable_device(struct acpi_memory_device *mem_devic=
e)
+{
+	pr_warn(PREFIX "Xen does not support memory hotremove\n");
+
+	return -ENOSYS;
+}
+
+static void acpi_memory_device_notify(acpi_handle handle, u32 event, void =
*data)
+{
+	struct acpi_memory_device *mem_device;
+	struct acpi_device *device;
+	u32 ost_code =3D ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */
+
+	switch (event) {
+	case ACPI_NOTIFY_BUS_CHECK:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+			"\nReceived BUS CHECK notification for device\n"));
+		/* Fall Through */
+	case ACPI_NOTIFY_DEVICE_CHECK:
+		if (event =3D=3D ACPI_NOTIFY_DEVICE_CHECK)
+			ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+			"\nReceived DEVICE CHECK notification for device\n"));
+
+		if (acpi_memory_get_device(handle, &mem_device)) {
+			pr_err(PREFIX "Cannot find driver data\n");
+			break;
+		}
+
+		ost_code =3D ACPI_OST_SC_SUCCESS;
+		break;
+
+	case ACPI_NOTIFY_EJECT_REQUEST:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+			"\nReceived EJECT REQUEST notification for device\n"));
+
+		if (acpi_bus_get_device(handle, &device)) {
+			pr_err(PREFIX "Device doesn't exist\n");
+			break;
+		}
+		mem_device =3D acpi_driver_data(device);
+		if (!mem_device) {
+			pr_err(PREFIX "Driver Data is NULL\n");
+			break;
+		}
+
+		/*
+		 * TBD: implement acpi_memory_disable_device and invoke
+		 * acpi_bus_remove if Xen support hotremove in the future
+		 */
+		acpi_memory_disable_device(mem_device);
+		break;
+
+	default:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+				  "Unsupported event [0x%x]\n", event));
+		/* non-hotplug event; possibly handled by other handler */
+		return;
+	}
+
+	/* Inform firmware that the hotplug operation has completed */
+	(void) acpi_evaluate_hotplug_ost(handle, event, ost_code, NULL);
+	return;
+}
+
+static int acpi_memory_device_add(struct acpi_device *device)
+{
+	int result;
+	struct acpi_memory_device *mem_device =3D NULL;
+
+
+	if (!device)
+		return -EINVAL;
+
+	mem_device =3D kzalloc(sizeof(struct acpi_memory_device), GFP_KERNEL);
+	if (!mem_device)
+		return -ENOMEM;
+
+	INIT_LIST_HEAD(&mem_device->res_list);
+	mem_device->device =3D device;
+	sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME);
+	sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS);
+	device->driver_data =3D mem_device;
+
+	/* Get the range from the _CRS */
+	result =3D acpi_memory_get_device_resources(mem_device);
+	if (result) {
+		kfree(mem_device);
+		return result;
+	}
+
+	/*
+	 * Early boot code has recognized memory area by EFI/E820.
+	 * If DSDT shows these memory devices on boot, hotplug is not necessary
+	 * for them. So, it just returns until completion of this driver's
+	 * start up.
+	 */
+	if (!acpi_hotmem_initialized)
+		return 0;
+
+	if (!acpi_memory_check_device(mem_device))
+		result =3D xen_acpi_memory_enable_device(mem_device);
+
+	return result;
+}
+
+static int acpi_memory_device_remove(struct acpi_device *device, int type)
+{
+	struct acpi_memory_device *mem_device =3D NULL;
+
+	if (!device || !acpi_driver_data(device))
+		return -EINVAL;
+
+	mem_device =3D acpi_driver_data(device);
+	kfree(mem_device);
+
+	return 0;
+}
+
+/*
+ * Helper function to check for memory device
+ */
+static acpi_status is_memory_device(acpi_handle handle)
+{
+	char *hardware_id;
+	acpi_status status;
+	struct acpi_device_info *info;
+
+	status =3D acpi_get_object_info(handle, &info);
+	if (ACPI_FAILURE(status))
+		return status;
+
+	if (!(info->valid & ACPI_VALID_HID)) {
+		kfree(info);
+		return AE_ERROR;
+	}
+
+	hardware_id =3D info->hardware_id.string;
+	if ((hardware_id =3D=3D NULL) ||
+	    (strcmp(hardware_id, ACPI_MEMORY_DEVICE_HID)))
+		status =3D AE_ERROR;
+
+	kfree(info);
+	return status;
+}
+
+static acpi_status
+acpi_memory_register_notify_handler(acpi_handle handle,
+				    u32 level, void *ctxt, void **retv)
+{
+	acpi_status status;
+
+	status =3D is_memory_device(handle);
+	if (ACPI_FAILURE(status))
+		return AE_OK;	/* continue */
+
+	status =3D acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
+					     acpi_memory_device_notify, NULL);
+	/* continue */
+	return AE_OK;
+}
+
+static int __init xen_acpi_memory_device_init(void)
+{
+	int result;
+	acpi_status status;
+
+	/* only dom0 is responsible for xen acpi memory hotplug */
+	if (!xen_initial_domain())
+		return -ENODEV;
+
+	result =3D acpi_bus_register_driver(&acpi_memory_device_driver);
+	if (result < 0)
+		return -ENODEV;
+
+	status =3D acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
+				     ACPI_UINT32_MAX,
+				     acpi_memory_register_notify_handler, NULL,
+				     NULL, NULL);
+
+	if (ACPI_FAILURE(status)) {
+		pr_warn(PREFIX "walk_namespace failed\n");
+		acpi_bus_unregister_driver(&acpi_memory_device_driver);
+		return -ENODEV;
+	}
+
+	acpi_hotmem_initialized =3D 1;
+	return 0;
+}
+subsys_initcall(xen_acpi_memory_device_init);
--=20
1.7.1

--_002_DE8DF0795D48FD4CA783C40EC82923353942F9SHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
	name="0001-Xen-acpi-memory-hotplug-driver.patch"
Content-Description: 0001-Xen-acpi-memory-hotplug-driver.patch
Content-Disposition: attachment;
	filename="0001-Xen-acpi-memory-hotplug-driver.patch"; size=12522;
	creation-date="Wed, 21 Nov 2012 11:38:00 GMT";
	modification-date="Wed, 21 Nov 2012 11:20:46 GMT"
Content-Transfer-Encoding: base64

RnJvbSA2MzBjNjU2OTBjODc4MjU1Y2U3MWU3YzExNzIzMzhlZDA4NzA5MjczIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBMaXUgSmluc29uZyA8amluc29uZy5saXVAaW50ZWwuY29tPgpE
YXRlOiBUdWUsIDIwIE5vdiAyMDEyIDIxOjE0OjM3ICswODAwClN1YmplY3Q6IFtQQVRDSCAxLzJd
IFhlbiBhY3BpIG1lbW9yeSBob3RwbHVnIGRyaXZlcgoKWGVuIGFjcGkgbWVtb3J5IGhvdHBsdWcg
Y29uc2lzdHMgb2YgMiBsb2dpYyBjb21wb25lbnRzOgpYZW4gYWNwaSBtZW1vcnkgaG90cGx1ZyBk
cml2ZXIgYW5kIFhlb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IndhbGtf
bmFtZXNwYWNlIGZhaWxlZFxuIik7CisJCWFjcGlfYnVzX3VucmVnaXN0ZXJfZHJpdmVyKCZhY3Bp
X21lbW9yeV9kZXZpY2VfZHJpdmVyKTsKKwkJcmV0dXJuIC1FTk9ERVY7CisJfQorCisJYWNwaV9o
b3RtZW1faW5pdGlhbGl6ZWQgPSAxOworCXJldHVybiAwOworfQorc3Vic3lzX2luaXRjYWxsKHhl
bl9hY3BpX21lbW9yeV9kZXZpY2VfaW5pdCk7Ci0tIAoxLjcuMQoK

--_002_DE8DF0795D48FD4CA783C40EC82923353942F9SHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_002_DE8DF0795D48FD4CA783C40EC82923353942F9SHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Wed Nov 21 11:47:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:47:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8lh-0005S5-9x; Wed, 21 Nov 2012 11:47:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1Tb8lf-0005Rv-M1
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 11:46:59 +0000
Received: from [85.158.143.99:42683] by server-2.bemta-4.messagelabs.com id
	60/AE-28922-23FBCA05; Wed, 21 Nov 2012 11:46:58 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1353498416!30229966!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjMyNDk0\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13812 invoked from network); 21 Nov 2012 11:46:57 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-3.tower-216.messagelabs.com with SMTP;
	21 Nov 2012 11:46:57 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga101.ch.intel.com with ESMTP; 21 Nov 2012 03:46:56 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,293,1352102400"; 
	d="scan'208,223";a="220606479"
Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35])
	by azsmga001.ch.intel.com with ESMTP; 21 Nov 2012 03:46:55 -0800
Received: from FMSMSX109.amr.corp.intel.com (10.19.9.28) by
	FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 03:46:55 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	fmsmsx109.amr.corp.intel.com (10.19.9.28) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 03:46:55 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 19:46:53 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Thread-Topic: [PATCH V1 2/2] Xen acpi memory hotplug hypercall
Thread-Index: Ac3H3eaBDCAgZnNdSMCQjopXez+hyA==
Date: Wed, 21 Nov 2012 11:46:53 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335394308@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_002_DE8DF0795D48FD4CA783C40EC8292335394308SHSMSX101ccrcorpi_"
MIME-Version: 1.0
Cc: "lenb@kernel.org" <lenb@kernel.org>
Subject: [Xen-devel] [PATCH V1 2/2] Xen acpi memory hotplug hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_DE8DF0795D48FD4CA783C40EC8292335394308SHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

>From dd622978066d2cf29a26f246ad6c55f51a0a6272 Mon Sep 17 00:00:00 2001
From: Liu Jinsong <jinsong.liu@intel.com>
Date: Wed, 21 Nov 2012 15:39:47 +0800
Subject: [PATCH 2/2] Xen acpi memory hotplug hypercall

This patch implement Xen acpi memory hotplug hypercall, extracting
memory information then hypercall to hypervisor.

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
---
 drivers/xen/xen-acpi-memhotplug.c |   44 +++++++++++++++++++++++++++++++++=
++++
 include/xen/interface/platform.h  |    9 +++++++
 2 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/drivers/xen/xen-acpi-memhotplug.c b/drivers/xen/xen-acpi-memho=
tplug.c
index f0c7990..877f5c8 100644
--- a/drivers/xen/xen-acpi-memhotplug.c
+++ b/drivers/xen/xen-acpi-memhotplug.c
@@ -18,7 +18,10 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/types.h>
+#include <linux/acpi.h>
 #include <acpi/acpi_drivers.h>
+#include <xen/interface/platform.h>
+#include <asm/xen/hypercall.h>
=20
 #define ACPI_MEMORY_DEVICE_CLASS		"memory"
 #define ACPI_MEMORY_DEVICE_HID			"PNP0C80"
@@ -61,9 +64,50 @@ struct acpi_memory_device {
=20
 static int acpi_hotmem_initialized;
=20
+static int xen_hotadd_memory(int pxm, struct acpi_memory_info *info)
+{
+	struct xen_platform_op op;
+
+	op.cmd =3D XENPF_mem_hotadd;
+	op.u.mem_add.spfn =3D info->start_addr >> PAGE_SHIFT;
+	op.u.mem_add.epfn =3D (info->start_addr + info->length) >> PAGE_SHIFT;
+	op.u.mem_add.pxm =3D pxm;
+
+	return HYPERVISOR_dom0_op(&op);
+}
=20
 int xen_acpi_memory_enable_device(struct acpi_memory_device *mem_device)
 {
+	int pxm, result;
+	int num_enabled =3D 0;
+	struct acpi_memory_info *info;
+
+	if (!mem_device)
+		return -EINVAL;
+
+	pxm =3D acpi_get_pxm(mem_device->device->handle);
+	if (pxm < 0)
+		return -EINVAL;
+
+	list_for_each_entry(info, &mem_device->res_list, list) {
+		if (info->enabled) { /* just sanity check...*/
+			num_enabled++;
+			continue;
+		}
+
+		if (!info->length)
+			continue;
+
+		result =3D xen_hotadd_memory(pxm, info);
+		if (result)
+			continue;
+		info->enabled =3D 1;
+		num_enabled++;
+	}
+
+	if (!num_enabled)
+		return -EINVAL;
+
 	return 0;
 }
=20
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platf=
orm.h
index 4755b5f..45215d9 100644
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
@@ -324,6 +324,14 @@ struct xenpf_cpu_ol {
 };
 DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
=20
+#define XENPF_mem_hotadd    59
+struct xenpf_mem_hotadd {
+	uint64_t spfn;
+	uint64_t epfn;
+	uint32_t pxm;
+	uint32_t flags;
+};
+
 struct xen_platform_op {
 	uint32_t cmd;
 	uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -341,6 +349,7 @@ struct xen_platform_op {
 		struct xenpf_set_processor_pminfo set_pminfo;
 		struct xenpf_pcpuinfo          pcpu_info;
 		struct xenpf_cpu_ol            cpu_ol;
+		struct xenpf_mem_hotadd        mem_add;
 		uint8_t                        pad[128];
 	} u;
 };
--=20
1.7.1

--_002_DE8DF0795D48FD4CA783C40EC8292335394308SHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
	name="0002-Xen-acpi-memory-hotplug-hypercall.patch"
Content-Description: 0002-Xen-acpi-memory-hotplug-hypercall.patch
Content-Disposition: attachment;
	filename="0002-Xen-acpi-memory-hotplug-hypercall.patch"; size=2928;
	creation-date="Wed, 21 Nov 2012 11:38:00 GMT";
	modification-date="Wed, 21 Nov 2012 11:20:46 GMT"
Content-Transfer-Encoding: base64

RnJvbSBkZDYyMjk3ODA2NmQyY2YyOWEyNmYyNDZhZDZjNTVmNTFhMGE2MjcyIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBMaXUgSmluc29uZyA8amluc29uZy5saXVAaW50ZWwuY29tPgpE
YXRlOiBXZWQsIDIxIE5vdiAyMDEyIDE1OjM5OjQ3ICswODAwClN1YmplY3Q6IFtQQVRDSCAyLzJd
IFhlbiBhY3BpIG1lbW9yeSBob3RwbHVnIGh5cGVyY2FsbAoKVGhpcyBwYXRjaCBpbXBsZW1lbnQg
WGVuIGFjcGkgbWVtb3J5IGhvdHBsdWcgaHlwZXJjYWxsLCBleHRyYWN0aW5nCm1lbW9yeSBpbmZv
cm1hdGlvbiB0aGVuIGh5cGVyY2FsbCB0byBoeXBlcnZpc29yLgoKU2lnbmVkLW9mZi1ieTogTGl1
IEppbnNvbm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CQlz
dHJ1Y3QgeGVucGZfcGNwdWluZm8gICAgICAgICAgcGNwdV9pbmZvOwogCQlzdHJ1Y3QgeGVucGZf
Y3B1X29sICAgICAgICAgICAgY3B1X29sOworCQlzdHJ1Y3QgeGVucGZfbWVtX2hvdGFkZCAgICAg
ICAgbWVtX2FkZDsKIAkJdWludDhfdCAgICAgICAgICAgICAgICAgICAgICAgIHBhZFsxMjhdOwog
CX0gdTsKIH07Ci0tIAoxLjcuMQoK

--_002_DE8DF0795D48FD4CA783C40EC8292335394308SHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_002_DE8DF0795D48FD4CA783C40EC8292335394308SHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Wed Nov 21 11:47:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:47:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8lh-0005S5-9x; Wed, 21 Nov 2012 11:47:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1Tb8lf-0005Rv-M1
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 11:46:59 +0000
Received: from [85.158.143.99:42683] by server-2.bemta-4.messagelabs.com id
	60/AE-28922-23FBCA05; Wed, 21 Nov 2012 11:46:58 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1353498416!30229966!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjMyNDk0\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13812 invoked from network); 21 Nov 2012 11:46:57 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-3.tower-216.messagelabs.com with SMTP;
	21 Nov 2012 11:46:57 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga101.ch.intel.com with ESMTP; 21 Nov 2012 03:46:56 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,293,1352102400"; 
	d="scan'208,223";a="220606479"
Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35])
	by azsmga001.ch.intel.com with ESMTP; 21 Nov 2012 03:46:55 -0800
Received: from FMSMSX109.amr.corp.intel.com (10.19.9.28) by
	FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 03:46:55 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	fmsmsx109.amr.corp.intel.com (10.19.9.28) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 03:46:55 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 19:46:53 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Thread-Topic: [PATCH V1 2/2] Xen acpi memory hotplug hypercall
Thread-Index: Ac3H3eaBDCAgZnNdSMCQjopXez+hyA==
Date: Wed, 21 Nov 2012 11:46:53 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335394308@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: multipart/mixed;
	boundary="_002_DE8DF0795D48FD4CA783C40EC8292335394308SHSMSX101ccrcorpi_"
MIME-Version: 1.0
Cc: "lenb@kernel.org" <lenb@kernel.org>
Subject: [Xen-devel] [PATCH V1 2/2] Xen acpi memory hotplug hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_DE8DF0795D48FD4CA783C40EC8292335394308SHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

>From dd622978066d2cf29a26f246ad6c55f51a0a6272 Mon Sep 17 00:00:00 2001
From: Liu Jinsong <jinsong.liu@intel.com>
Date: Wed, 21 Nov 2012 15:39:47 +0800
Subject: [PATCH 2/2] Xen acpi memory hotplug hypercall

This patch implement Xen acpi memory hotplug hypercall, extracting
memory information then hypercall to hypervisor.

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
---
 drivers/xen/xen-acpi-memhotplug.c |   44 +++++++++++++++++++++++++++++++++=
++++
 include/xen/interface/platform.h  |    9 +++++++
 2 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/drivers/xen/xen-acpi-memhotplug.c b/drivers/xen/xen-acpi-memho=
tplug.c
index f0c7990..877f5c8 100644
--- a/drivers/xen/xen-acpi-memhotplug.c
+++ b/drivers/xen/xen-acpi-memhotplug.c
@@ -18,7 +18,10 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/types.h>
+#include <linux/acpi.h>
 #include <acpi/acpi_drivers.h>
+#include <xen/interface/platform.h>
+#include <asm/xen/hypercall.h>
=20
 #define ACPI_MEMORY_DEVICE_CLASS		"memory"
 #define ACPI_MEMORY_DEVICE_HID			"PNP0C80"
@@ -61,9 +64,50 @@ struct acpi_memory_device {
=20
 static int acpi_hotmem_initialized;
=20
+static int xen_hotadd_memory(int pxm, struct acpi_memory_info *info)
+{
+	struct xen_platform_op op;
+
+	op.cmd =3D XENPF_mem_hotadd;
+	op.u.mem_add.spfn =3D info->start_addr >> PAGE_SHIFT;
+	op.u.mem_add.epfn =3D (info->start_addr + info->length) >> PAGE_SHIFT;
+	op.u.mem_add.pxm =3D pxm;
+
+	return HYPERVISOR_dom0_op(&op);
+}
=20
 int xen_acpi_memory_enable_device(struct acpi_memory_device *mem_device)
 {
+	int pxm, result;
+	int num_enabled =3D 0;
+	struct acpi_memory_info *info;
+
+	if (!mem_device)
+		return -EINVAL;
+
+	pxm =3D acpi_get_pxm(mem_device->device->handle);
+	if (pxm < 0)
+		return -EINVAL;
+
+	list_for_each_entry(info, &mem_device->res_list, list) {
+		if (info->enabled) { /* just sanity check...*/
+			num_enabled++;
+			continue;
+		}
+
+		if (!info->length)
+			continue;
+
+		result =3D xen_hotadd_memory(pxm, info);
+		if (result)
+			continue;
+		info->enabled =3D 1;
+		num_enabled++;
+	}
+
+	if (!num_enabled)
+		return -EINVAL;
+
 	return 0;
 }
=20
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platf=
orm.h
index 4755b5f..45215d9 100644
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
@@ -324,6 +324,14 @@ struct xenpf_cpu_ol {
 };
 DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
=20
+#define XENPF_mem_hotadd    59
+struct xenpf_mem_hotadd {
+	uint64_t spfn;
+	uint64_t epfn;
+	uint32_t pxm;
+	uint32_t flags;
+};
+
 struct xen_platform_op {
 	uint32_t cmd;
 	uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -341,6 +349,7 @@ struct xen_platform_op {
 		struct xenpf_set_processor_pminfo set_pminfo;
 		struct xenpf_pcpuinfo          pcpu_info;
 		struct xenpf_cpu_ol            cpu_ol;
+		struct xenpf_mem_hotadd        mem_add;
 		uint8_t                        pad[128];
 	} u;
 };
--=20
1.7.1

--_002_DE8DF0795D48FD4CA783C40EC8292335394308SHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
	name="0002-Xen-acpi-memory-hotplug-hypercall.patch"
Content-Description: 0002-Xen-acpi-memory-hotplug-hypercall.patch
Content-Disposition: attachment;
	filename="0002-Xen-acpi-memory-hotplug-hypercall.patch"; size=2928;
	creation-date="Wed, 21 Nov 2012 11:38:00 GMT";
	modification-date="Wed, 21 Nov 2012 11:20:46 GMT"
Content-Transfer-Encoding: base64

RnJvbSBkZDYyMjk3ODA2NmQyY2YyOWEyNmYyNDZhZDZjNTVmNTFhMGE2MjcyIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBMaXUgSmluc29uZyA8amluc29uZy5saXVAaW50ZWwuY29tPgpE
YXRlOiBXZWQsIDIxIE5vdiAyMDEyIDE1OjM5OjQ3ICswODAwClN1YmplY3Q6IFtQQVRDSCAyLzJd
IFhlbiBhY3BpIG1lbW9yeSBob3RwbHVnIGh5cGVyY2FsbAoKVGhpcyBwYXRjaCBpbXBsZW1lbnQg
WGVuIGFjcGkgbWVtb3J5IGhvdHBsdWcgaHlwZXJjYWxsLCBleHRyYWN0aW5nCm1lbW9yeSBpbmZv
cm1hdGlvbiB0aGVuIGh5cGVyY2FsbCB0byBoeXBlcnZpc29yLgoKU2lnbmVkLW9mZi1ieTogTGl1
IEppbnNvbmcgPGppbnNvbmcubGl1QGludGVsLmNvbT4KLS0tCi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ICAgICAgcGNwdV9pbmZvOwogCQlzdHJ1Y3QgeGVucGZf
Y3B1X29sICAgICAgICAgICAgY3B1X29sOworCQlzdHJ1Y3QgeGVucGZfbWVtX2hvdGFkZCAgICAg
ICAgbWVtX2FkZDsKIAkJdWludDhfdCAgICAgICAgICAgICAgICAgICAgICAgIHBhZFsxMjhdOwog
CX0gdTsKIH07Ci0tIAoxLjcuMQoK

--_002_DE8DF0795D48FD4CA783C40EC8292335394308SHSMSX101ccrcorpi_
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.xen.org
http://lists.xen.org/xen-devel

--_002_DE8DF0795D48FD4CA783C40EC8292335394308SHSMSX101ccrcorpi_--


From xen-devel-bounces@lists.xen.org Wed Nov 21 11:56:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:56:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8uc-0005kX-CD; Wed, 21 Nov 2012 11:56:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Tb8ua-0005kS-HJ
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 11:56:12 +0000
Received: from [85.158.143.99:29510] by server-2.bemta-4.messagelabs.com id
	C7/BC-28922-B51CCA05; Wed, 21 Nov 2012 11:56:11 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1353498970!25536345!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5578 invoked from network); 21 Nov 2012 11:56:10 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 11:56:10 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="15924441"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 11:55:30 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 21 Nov 2012 11:55:30 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Tb8tu-0007bW-Ih; Wed, 21 Nov 2012 11:55:30 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Tb8tu-0002ub-Ad;
	Wed, 21 Nov 2012 11:55:30 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20652.49458.119111.771393@mariner.uk.xensource.com>
Date: Wed, 21 Nov 2012 11:55:30 +0000
To: George Dunlap <george.dunlap@eu.citrix.com>
In-Reply-To: <50ACBC50.4040204@eu.citrix.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
	<50ACBC50.4040204@eu.citrix.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap writes ("Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard to migration"):
> But on the whole, is that really that much *faster* to do it that way?  
> Either way you're still adding a single hypercall to the whole thing, 
> and one iteration of a loop for each page; but in Jinsong's patch, the 
> loop is done all at once, so presumably the compiler / processor will be 
> able to do make better use of loop unrolling / registers / the pipeline 
> / branch prediction / caches &c.
> 
> The only way to avoid the loop would be to add an extra "have any pages 
> been marked broken / dirty" bit somewhere, which is probably more 
> trouble than it's worth.

OK, that makes sense.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:56:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:56:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8uc-0005kX-CD; Wed, 21 Nov 2012 11:56:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Tb8ua-0005kS-HJ
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 11:56:12 +0000
Received: from [85.158.143.99:29510] by server-2.bemta-4.messagelabs.com id
	C7/BC-28922-B51CCA05; Wed, 21 Nov 2012 11:56:11 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1353498970!25536345!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5578 invoked from network); 21 Nov 2012 11:56:10 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 11:56:10 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="15924441"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 11:55:30 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 21 Nov 2012 11:55:30 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Tb8tu-0007bW-Ih; Wed, 21 Nov 2012 11:55:30 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Tb8tu-0002ub-Ad;
	Wed, 21 Nov 2012 11:55:30 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20652.49458.119111.771393@mariner.uk.xensource.com>
Date: Wed, 21 Nov 2012 11:55:30 +0000
To: George Dunlap <george.dunlap@eu.citrix.com>
In-Reply-To: <50ACBC50.4040204@eu.citrix.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
	<50ACBC50.4040204@eu.citrix.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap writes ("Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard to migration"):
> But on the whole, is that really that much *faster* to do it that way?  
> Either way you're still adding a single hypercall to the whole thing, 
> and one iteration of a loop for each page; but in Jinsong's patch, the 
> loop is done all at once, so presumably the compiler / processor will be 
> able to do make better use of loop unrolling / registers / the pipeline 
> / branch prediction / caches &c.
> 
> The only way to avoid the loop would be to add an extra "have any pages 
> been marked broken / dirty" bit somewhere, which is probably more 
> trouble than it's worth.

OK, that makes sense.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:57:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:57:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8w8-0005py-S1; Wed, 21 Nov 2012 11:57:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb8w7-0005pr-IB
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 11:57:47 +0000
Received: from [85.158.143.35:33866] by server-3.bemta-4.messagelabs.com id
	19/1A-06841-AB1CCA05; Wed, 21 Nov 2012 11:57:46 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1353499066!8178421!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27756 invoked from network); 21 Nov 2012 11:57:46 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-21.messagelabs.com with SMTP;
	21 Nov 2012 11:57:46 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 11:57:45 +0000
Message-Id: <50ACD00002000078000AA59A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 11:58:40 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir.xen@gmail.com>
References: <50ACC67002000078000AA56A@nat28.tlf.novell.com>
	<CCD26BB5.451A9%keir.xen@gmail.com>
In-Reply-To: <CCD26BB5.451A9%keir.xen@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Wei Huang <wei.huang2@amd.com>, xen-devel <xen-devel@lists.xen.org>,
	Wei Wang <weiwang.dd@gmail.com>, xiantao.zhang@intel.com,
	Gang Wei <gang.wei@intel.com>
Subject: Re: [Xen-devel] [PATCH 5/5] VT-d: adjust IOMMU interrupt affinities
 when all CPUs are online
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 21.11.12 at 12:29, Keir Fraser <keir.xen@gmail.com> wrote:
> On 21/11/2012 11:17, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>>> Is this just a handy place to hook?
>> 
>> Yes.
>> 
>>> Does it logically make sense?
>> 
>> No. Just needed to put it somewhere where it would get run at
>> the right point in time, and the place here ensures this for both
>> boot and resume.
> 
> Yuk! And it doesn't work anyway. acpi_dmar_zap() isn't usually called during
> boot -- go see it open coded at the end of acpi_parse_dmar(). It's only
> called during boot when running tboot.

Oh, right, I should have checked the patch before replying: It's
there _only_ for the resume case, the boot time case gets
handled via an initcall.

>> Shall I add a comment to this effect?
> 
> I would rather have this added as another call to
> acpi/power.c:enter_state(). It doesn't logically belong with
> acpi_dmar_zap(), nor even with all its callers (e.g.,
> tboot_parse_dmar_table).

Okay, will change this accordingly and re-submit just that one
patch.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 11:57:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 11:57:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb8w8-0005py-S1; Wed, 21 Nov 2012 11:57:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb8w7-0005pr-IB
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 11:57:47 +0000
Received: from [85.158.143.35:33866] by server-3.bemta-4.messagelabs.com id
	19/1A-06841-AB1CCA05; Wed, 21 Nov 2012 11:57:46 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1353499066!8178421!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27756 invoked from network); 21 Nov 2012 11:57:46 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-21.messagelabs.com with SMTP;
	21 Nov 2012 11:57:46 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 11:57:45 +0000
Message-Id: <50ACD00002000078000AA59A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 11:58:40 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir.xen@gmail.com>
References: <50ACC67002000078000AA56A@nat28.tlf.novell.com>
	<CCD26BB5.451A9%keir.xen@gmail.com>
In-Reply-To: <CCD26BB5.451A9%keir.xen@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Wei Huang <wei.huang2@amd.com>, xen-devel <xen-devel@lists.xen.org>,
	Wei Wang <weiwang.dd@gmail.com>, xiantao.zhang@intel.com,
	Gang Wei <gang.wei@intel.com>
Subject: Re: [Xen-devel] [PATCH 5/5] VT-d: adjust IOMMU interrupt affinities
 when all CPUs are online
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 21.11.12 at 12:29, Keir Fraser <keir.xen@gmail.com> wrote:
> On 21/11/2012 11:17, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>>> Is this just a handy place to hook?
>> 
>> Yes.
>> 
>>> Does it logically make sense?
>> 
>> No. Just needed to put it somewhere where it would get run at
>> the right point in time, and the place here ensures this for both
>> boot and resume.
> 
> Yuk! And it doesn't work anyway. acpi_dmar_zap() isn't usually called during
> boot -- go see it open coded at the end of acpi_parse_dmar(). It's only
> called during boot when running tboot.

Oh, right, I should have checked the patch before replying: It's
there _only_ for the resume case, the boot time case gets
handled via an initcall.

>> Shall I add a comment to this effect?
> 
> I would rather have this added as another call to
> acpi/power.c:enter_state(). It doesn't logically belong with
> acpi_dmar_zap(), nor even with all its callers (e.g.,
> tboot_parse_dmar_table).

Okay, will change this accordingly and re-submit just that one
patch.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 12:02:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 12:02:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb90Z-0006CC-6S; Wed, 21 Nov 2012 12:02:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tb90X-0006C1-V0
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 12:02:22 +0000
Received: from [85.158.138.51:57439] by server-3.bemta-3.messagelabs.com id
	12/65-31566-CC2CCA05; Wed, 21 Nov 2012 12:02:20 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1353499338!30887313!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUyNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5098 invoked from network); 21 Nov 2012 12:02:19 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 12:02:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="45281164"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 12:02:17 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 07:02:17 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1Tb90S-0007vA-Uc;
	Wed, 21 Nov 2012 12:02:16 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: netdev@vger.kernel.org
Date: Wed, 21 Nov 2012 12:02:16 +0000
Message-ID: <1353499336-28952-1-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.2.5
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>,
	Sander Eikelenboom <linux@eikelenboom.it>, ANNIE LI <annie.li@oracle.com>,
	Stefan Bader <stefan.bader@canonical.com>, xen-devel@lists.xen.org,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	Eric Dumazet <edumazet@google.com>
Subject: [Xen-devel] [PATCH V3] xen/netfront: handle compound page fragments
	on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

An SKB paged fragment can consist of a compound page with order > 0.
However the netchannel protocol deals only in PAGE_SIZE frames.

Handle this in xennet_make_frags by iterating over the frames which
make up the page.

This is the netfront equivalent to 6a8ed462f16b for netback.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: netdev@vger.kernel.org
Cc: xen-devel@lists.xen.org
Cc: Eric Dumazet <edumazet@google.com>
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
Cc: ANNIE LI <annie.li@oracle.com>
Cc: Sander Eikelenboom <linux@eikelenboom.it>
Cc: Stefan Bader <stefan.bader@canonical.com>
---
v3: limit to 80-characters. Use net_alert_ratelimited.
v2: check we have enough room in the ring and that the other end can
    cope with the number of slots in a single frame
---
 drivers/net/xen-netfront.c |   98 ++++++++++++++++++++++++++++++++++---------
 1 files changed, 77 insertions(+), 21 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index caa0110..fc24eb9 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -452,29 +452,85 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
 	/* Grant backend access to each skb fragment page. */
 	for (i = 0; i < frags; i++) {
 		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
+		struct page *page = skb_frag_page(frag);
 
-		tx->flags |= XEN_NETTXF_more_data;
+		len = skb_frag_size(frag);
+		offset = frag->page_offset;
 
-		id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
-		np->tx_skbs[id].skb = skb_get(skb);
-		tx = RING_GET_REQUEST(&np->tx, prod++);
-		tx->id = id;
-		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
-		BUG_ON((signed short)ref < 0);
+		/* Data must not cross a page boundary. */
+		BUG_ON(len + offset > PAGE_SIZE<<compound_order(page));
 
-		mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
-		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
-						mfn, GNTMAP_readonly);
+		/* Skip unused frames from start of page */
+		page += offset >> PAGE_SHIFT;
+		offset &= ~PAGE_MASK;
 
-		tx->gref = np->grant_tx_ref[id] = ref;
-		tx->offset = frag->page_offset;
-		tx->size = skb_frag_size(frag);
-		tx->flags = 0;
+		while (len > 0) {
+			unsigned long bytes;
+
+			BUG_ON(offset >= PAGE_SIZE);
+
+			bytes = PAGE_SIZE - offset;
+			if (bytes > len)
+				bytes = len;
+
+			tx->flags |= XEN_NETTXF_more_data;
+
+			id = get_id_from_freelist(&np->tx_skb_freelist,
+						  np->tx_skbs);
+			np->tx_skbs[id].skb = skb_get(skb);
+			tx = RING_GET_REQUEST(&np->tx, prod++);
+			tx->id = id;
+			ref = gnttab_claim_grant_reference(&np->gref_tx_head);
+			BUG_ON((signed short)ref < 0);
+
+			mfn = pfn_to_mfn(page_to_pfn(page));
+			gnttab_grant_foreign_access_ref(ref,
+							np->xbdev->otherend_id,
+							mfn, GNTMAP_readonly);
+
+			tx->gref = np->grant_tx_ref[id] = ref;
+			tx->offset = offset;
+			tx->size = bytes;
+			tx->flags = 0;
+
+			offset += bytes;
+			len -= bytes;
+
+			/* Next frame */
+			if (offset == PAGE_SIZE && len) {
+				BUG_ON(!PageCompound(page));
+				page++;
+				offset = 0;
+			}
+		}
 	}
 
 	np->tx.req_prod_pvt = prod;
 }
 
+/*
+ * Count how many ring slots are required to send the frags of this
+ * skb. Each frag might be a compound page.
+ */
+static int xennet_count_skb_frag_slots(struct sk_buff *skb)
+{
+	int i, frags = skb_shinfo(skb)->nr_frags;
+	int pages = 0;
+
+	for (i = 0; i < frags; i++) {
+		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
+		unsigned long size = skb_frag_size(frag);
+		unsigned long offset = frag->page_offset;
+
+		/* Skip unused frames from start of page */
+		offset &= ~PAGE_MASK;
+
+		pages += PFN_UP(offset + size);
+	}
+
+	return pages;
+}
+
 static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	unsigned short id;
@@ -487,23 +543,23 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	grant_ref_t ref;
 	unsigned long mfn;
 	int notify;
-	int frags = skb_shinfo(skb)->nr_frags;
+	int slots;
 	unsigned int offset = offset_in_page(data);
 	unsigned int len = skb_headlen(skb);
 	unsigned long flags;
 
-	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
-	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
-		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
-		       frags);
-		dump_stack();
+	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
+		xennet_count_skb_frag_slots(skb);
+	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
+		net_alert_ratelimited(
+			"xennet: skb rides the rocket: %d slots\n", slots);
 		goto drop;
 	}
 
 	spin_lock_irqsave(&np->tx_lock, flags);
 
 	if (unlikely(!netif_carrier_ok(dev) ||
-		     (frags > 1 && !xennet_can_sg(dev)) ||
+		     (slots > 1 && !xennet_can_sg(dev)) ||
 		     netif_needs_gso(skb, netif_skb_features(skb)))) {
 		spin_unlock_irqrestore(&np->tx_lock, flags);
 		goto drop;
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 12:02:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 12:02:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb90Z-0006CC-6S; Wed, 21 Nov 2012 12:02:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tb90X-0006C1-V0
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 12:02:22 +0000
Received: from [85.158.138.51:57439] by server-3.bemta-3.messagelabs.com id
	12/65-31566-CC2CCA05; Wed, 21 Nov 2012 12:02:20 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1353499338!30887313!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUyNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5098 invoked from network); 21 Nov 2012 12:02:19 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 12:02:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="45281164"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 12:02:17 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 07:02:17 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1Tb90S-0007vA-Uc;
	Wed, 21 Nov 2012 12:02:16 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: netdev@vger.kernel.org
Date: Wed, 21 Nov 2012 12:02:16 +0000
Message-ID: <1353499336-28952-1-git-send-email-ian.campbell@citrix.com>
X-Mailer: git-send-email 1.7.2.5
MIME-Version: 1.0
Cc: Ian Campbell <ian.campbell@citrix.com>,
	Sander Eikelenboom <linux@eikelenboom.it>, ANNIE LI <annie.li@oracle.com>,
	Stefan Bader <stefan.bader@canonical.com>, xen-devel@lists.xen.org,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	Eric Dumazet <edumazet@google.com>
Subject: [Xen-devel] [PATCH V3] xen/netfront: handle compound page fragments
	on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

An SKB paged fragment can consist of a compound page with order > 0.
However the netchannel protocol deals only in PAGE_SIZE frames.

Handle this in xennet_make_frags by iterating over the frames which
make up the page.

This is the netfront equivalent to 6a8ed462f16b for netback.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: netdev@vger.kernel.org
Cc: xen-devel@lists.xen.org
Cc: Eric Dumazet <edumazet@google.com>
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
Cc: ANNIE LI <annie.li@oracle.com>
Cc: Sander Eikelenboom <linux@eikelenboom.it>
Cc: Stefan Bader <stefan.bader@canonical.com>
---
v3: limit to 80-characters. Use net_alert_ratelimited.
v2: check we have enough room in the ring and that the other end can
    cope with the number of slots in a single frame
---
 drivers/net/xen-netfront.c |   98 ++++++++++++++++++++++++++++++++++---------
 1 files changed, 77 insertions(+), 21 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index caa0110..fc24eb9 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -452,29 +452,85 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
 	/* Grant backend access to each skb fragment page. */
 	for (i = 0; i < frags; i++) {
 		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
+		struct page *page = skb_frag_page(frag);
 
-		tx->flags |= XEN_NETTXF_more_data;
+		len = skb_frag_size(frag);
+		offset = frag->page_offset;
 
-		id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
-		np->tx_skbs[id].skb = skb_get(skb);
-		tx = RING_GET_REQUEST(&np->tx, prod++);
-		tx->id = id;
-		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
-		BUG_ON((signed short)ref < 0);
+		/* Data must not cross a page boundary. */
+		BUG_ON(len + offset > PAGE_SIZE<<compound_order(page));
 
-		mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
-		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
-						mfn, GNTMAP_readonly);
+		/* Skip unused frames from start of page */
+		page += offset >> PAGE_SHIFT;
+		offset &= ~PAGE_MASK;
 
-		tx->gref = np->grant_tx_ref[id] = ref;
-		tx->offset = frag->page_offset;
-		tx->size = skb_frag_size(frag);
-		tx->flags = 0;
+		while (len > 0) {
+			unsigned long bytes;
+
+			BUG_ON(offset >= PAGE_SIZE);
+
+			bytes = PAGE_SIZE - offset;
+			if (bytes > len)
+				bytes = len;
+
+			tx->flags |= XEN_NETTXF_more_data;
+
+			id = get_id_from_freelist(&np->tx_skb_freelist,
+						  np->tx_skbs);
+			np->tx_skbs[id].skb = skb_get(skb);
+			tx = RING_GET_REQUEST(&np->tx, prod++);
+			tx->id = id;
+			ref = gnttab_claim_grant_reference(&np->gref_tx_head);
+			BUG_ON((signed short)ref < 0);
+
+			mfn = pfn_to_mfn(page_to_pfn(page));
+			gnttab_grant_foreign_access_ref(ref,
+							np->xbdev->otherend_id,
+							mfn, GNTMAP_readonly);
+
+			tx->gref = np->grant_tx_ref[id] = ref;
+			tx->offset = offset;
+			tx->size = bytes;
+			tx->flags = 0;
+
+			offset += bytes;
+			len -= bytes;
+
+			/* Next frame */
+			if (offset == PAGE_SIZE && len) {
+				BUG_ON(!PageCompound(page));
+				page++;
+				offset = 0;
+			}
+		}
 	}
 
 	np->tx.req_prod_pvt = prod;
 }
 
+/*
+ * Count how many ring slots are required to send the frags of this
+ * skb. Each frag might be a compound page.
+ */
+static int xennet_count_skb_frag_slots(struct sk_buff *skb)
+{
+	int i, frags = skb_shinfo(skb)->nr_frags;
+	int pages = 0;
+
+	for (i = 0; i < frags; i++) {
+		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
+		unsigned long size = skb_frag_size(frag);
+		unsigned long offset = frag->page_offset;
+
+		/* Skip unused frames from start of page */
+		offset &= ~PAGE_MASK;
+
+		pages += PFN_UP(offset + size);
+	}
+
+	return pages;
+}
+
 static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	unsigned short id;
@@ -487,23 +543,23 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	grant_ref_t ref;
 	unsigned long mfn;
 	int notify;
-	int frags = skb_shinfo(skb)->nr_frags;
+	int slots;
 	unsigned int offset = offset_in_page(data);
 	unsigned int len = skb_headlen(skb);
 	unsigned long flags;
 
-	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
-	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
-		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
-		       frags);
-		dump_stack();
+	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
+		xennet_count_skb_frag_slots(skb);
+	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
+		net_alert_ratelimited(
+			"xennet: skb rides the rocket: %d slots\n", slots);
 		goto drop;
 	}
 
 	spin_lock_irqsave(&np->tx_lock, flags);
 
 	if (unlikely(!netif_carrier_ok(dev) ||
-		     (frags > 1 && !xennet_can_sg(dev)) ||
+		     (slots > 1 && !xennet_can_sg(dev)) ||
 		     netif_needs_gso(skb, netif_skb_features(skb)))) {
 		spin_unlock_irqrestore(&np->tx_lock, flags);
 		goto drop;
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 12:09:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 12:09:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb96r-0006TA-38; Wed, 21 Nov 2012 12:08:53 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tb96p-0006T5-BN
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 12:08:51 +0000
Received: from [85.158.139.83:56826] by server-16.bemta-5.messagelabs.com id
	84/1A-04786-254CCA05; Wed, 21 Nov 2012 12:08:50 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1353499729!31255456!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6129 invoked from network); 21 Nov 2012 12:08:49 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 12:08:49 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="15924769"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 12:08:49 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 12:08:49 +0000
Message-ID: <1353499727.13542.137.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 21 Nov 2012 12:08:47 +0000
In-Reply-To: <1353428844.2590.17.camel@edumazet-glaptop>
References: <1353427257-16789-1-git-send-email-ian.campbell@citrix.com>
	<1353428844.2590.17.camel@edumazet-glaptop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH V2] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 16:27 +0000, Eric Dumazet wrote:
> On Tue, 2012-11-20 at 16:00 +0000, Ian Campbell wrote:
> > An SKB paged fragment can consist of a compound page with order > 0.
> > However the netchannel protocol deals only in PAGE_SIZE frames.
> > 
> > Handle this in xennet_make_frags by iterating over the frames which
> > make up the page.
> > 
> > This is the netfront equivalent to 6a8ed462f16b for netback.
> ...
> 
> > -	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
> > -	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
> > -		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
> > -		       frags);
> > -		dump_stack();
> > +	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
> > +		xennet_count_skb_frag_slots(skb);
> > +	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
> > +		printk(KERN_ALERT "xennet: skb rides the rocket: %d slots\n",
> > +		       slots);
> 
> I think this is wrong.
> 
> You should change netfront_tx_slot_available() to stop the queue before
> this can happen.
>
> Yes, you dont hit this on your tests, but a driver should not drop a
> good packet.

The max-frag related limitation comes from the "wire" protocol used
between front and back. As it stands either the frontend or the backend
is more than likely going to drop the sort of pathalogical skbs you are
worried.

I agree that this absolutely needs to be fixed in the protocol (and I've
posted a call to arms on this topic on xen-devel) but I'd like to do it
in a coordinated manner as part of a protocol extension (where the front
and backend negotiate the maximum number of order-0 pages per Ethernet
frame they are willing to handle) rather than as a side effect of this
patch.

So right now I don't want to introduce frontends which default to
sending increased numbers of pages in to the wild, since that makes
things more complex when we come to extend the protocol.

Perhaps in the short term doing an skb_linearize when we hit this case
would help, that will turn the pathalogical skb into a much more normal
one. It'll be expensive but it should be rare. That assumes you can
linearize such a large skb, which depends on the ability to allocate
large order pages which isn't a given. Herm, maybe that doesn't work
then.

AFAIK we don't have an existing skb_foo operation which copies an skb,
including (or only) the frags, with the side effect of aligning and
coalescing them. Do we?

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 12:09:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 12:09:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb96r-0006TA-38; Wed, 21 Nov 2012 12:08:53 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tb96p-0006T5-BN
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 12:08:51 +0000
Received: from [85.158.139.83:56826] by server-16.bemta-5.messagelabs.com id
	84/1A-04786-254CCA05; Wed, 21 Nov 2012 12:08:50 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1353499729!31255456!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6129 invoked from network); 21 Nov 2012 12:08:49 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 12:08:49 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="15924769"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 12:08:49 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 12:08:49 +0000
Message-ID: <1353499727.13542.137.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 21 Nov 2012 12:08:47 +0000
In-Reply-To: <1353428844.2590.17.camel@edumazet-glaptop>
References: <1353427257-16789-1-git-send-email-ian.campbell@citrix.com>
	<1353428844.2590.17.camel@edumazet-glaptop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH V2] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 16:27 +0000, Eric Dumazet wrote:
> On Tue, 2012-11-20 at 16:00 +0000, Ian Campbell wrote:
> > An SKB paged fragment can consist of a compound page with order > 0.
> > However the netchannel protocol deals only in PAGE_SIZE frames.
> > 
> > Handle this in xennet_make_frags by iterating over the frames which
> > make up the page.
> > 
> > This is the netfront equivalent to 6a8ed462f16b for netback.
> ...
> 
> > -	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
> > -	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
> > -		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
> > -		       frags);
> > -		dump_stack();
> > +	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
> > +		xennet_count_skb_frag_slots(skb);
> > +	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
> > +		printk(KERN_ALERT "xennet: skb rides the rocket: %d slots\n",
> > +		       slots);
> 
> I think this is wrong.
> 
> You should change netfront_tx_slot_available() to stop the queue before
> this can happen.
>
> Yes, you dont hit this on your tests, but a driver should not drop a
> good packet.

The max-frag related limitation comes from the "wire" protocol used
between front and back. As it stands either the frontend or the backend
is more than likely going to drop the sort of pathalogical skbs you are
worried.

I agree that this absolutely needs to be fixed in the protocol (and I've
posted a call to arms on this topic on xen-devel) but I'd like to do it
in a coordinated manner as part of a protocol extension (where the front
and backend negotiate the maximum number of order-0 pages per Ethernet
frame they are willing to handle) rather than as a side effect of this
patch.

So right now I don't want to introduce frontends which default to
sending increased numbers of pages in to the wild, since that makes
things more complex when we come to extend the protocol.

Perhaps in the short term doing an skb_linearize when we hit this case
would help, that will turn the pathalogical skb into a much more normal
one. It'll be expensive but it should be rare. That assumes you can
linearize such a large skb, which depends on the ability to allocate
large order pages which isn't a given. Herm, maybe that doesn't work
then.

AFAIK we don't have an existing skb_foo operation which copies an skb,
including (or only) the frags, with the side effect of aligning and
coalescing them. Do we?

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 12:12:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 12:12:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb99j-0006fB-La; Wed, 21 Nov 2012 12:11:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tb99h-0006f5-OA
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 12:11:49 +0000
Received: from [85.158.138.51:55669] by server-13.bemta-3.messagelabs.com id
	13/54-24887-505CCA05; Wed, 21 Nov 2012 12:11:49 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353499908!22880610!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31100 invoked from network); 21 Nov 2012 12:11:48 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 12:11:48 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="15924833"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 12:11:47 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 12:11:46 +0000
Message-ID: <1353499905.13542.139.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Wed, 21 Nov 2012 12:11:45 +0000
In-Reply-To: <50ACBC50.4040204@eu.citrix.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
	<50ACBC50.4040204@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-21 at 11:34 +0000, George Dunlap wrote:
> On 20/11/12 18:42, Ian Jackson wrote:
> > Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard to migration"):
> >> Ian Jackson wrote:
> >>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
> >>> broken page with regard to migration"):
> >>>> No, at last lter, there are 4 points:
> >>>> 1. start last iter
> >>>> 2. get and transfer pfn_type to target
> >>>> 3. copy page to target
> >>>> 4. end last iter
> > ...
> >> It indeed checks mce after point 3 for each page, but what's the
> >> advantage of keeping a separate list?
> > It avoids yet another loop over all the pages.  Unless I have
> > misunderstood.  Which I may have, because: if it checks for mce after
> > point 3 then surely that is sufficient ?  We don't need to worry about
> > mces after that check.
> 
> It's sufficient, but wouldn't each check require a separate hypercall?  
> That would surely be slower than just a single hypercall and a loop 
> (which is what Jinsong's patch does).
> 
> We don't actually need a list -- I think we just need to know, "Have any 
> pages broken between reading the p2m table ( xc_get_pfn_type_batch() ); 
> if so, we do another full iteration.

If a page fails between 2. and 3. above then what happens at point 3? I
presume we can't map and send the page (since it is broken), do we get
some sort of failure to map?

What happens if the failure occurs during stage 3, i.e. while the page
is mapped and we are reading from it?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 12:12:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 12:12:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb99j-0006fB-La; Wed, 21 Nov 2012 12:11:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tb99h-0006f5-OA
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 12:11:49 +0000
Received: from [85.158.138.51:55669] by server-13.bemta-3.messagelabs.com id
	13/54-24887-505CCA05; Wed, 21 Nov 2012 12:11:49 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353499908!22880610!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31100 invoked from network); 21 Nov 2012 12:11:48 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 12:11:48 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="15924833"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 12:11:47 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 12:11:46 +0000
Message-ID: <1353499905.13542.139.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Wed, 21 Nov 2012 12:11:45 +0000
In-Reply-To: <50ACBC50.4040204@eu.citrix.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
	<50ACBC50.4040204@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-21 at 11:34 +0000, George Dunlap wrote:
> On 20/11/12 18:42, Ian Jackson wrote:
> > Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard to migration"):
> >> Ian Jackson wrote:
> >>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
> >>> broken page with regard to migration"):
> >>>> No, at last lter, there are 4 points:
> >>>> 1. start last iter
> >>>> 2. get and transfer pfn_type to target
> >>>> 3. copy page to target
> >>>> 4. end last iter
> > ...
> >> It indeed checks mce after point 3 for each page, but what's the
> >> advantage of keeping a separate list?
> > It avoids yet another loop over all the pages.  Unless I have
> > misunderstood.  Which I may have, because: if it checks for mce after
> > point 3 then surely that is sufficient ?  We don't need to worry about
> > mces after that check.
> 
> It's sufficient, but wouldn't each check require a separate hypercall?  
> That would surely be slower than just a single hypercall and a loop 
> (which is what Jinsong's patch does).
> 
> We don't actually need a list -- I think we just need to know, "Have any 
> pages broken between reading the p2m table ( xc_get_pfn_type_batch() ); 
> if so, we do another full iteration.

If a page fails between 2. and 3. above then what happens at point 3? I
presume we can't map and send the page (since it is broken), do we get
some sort of failure to map?

What happens if the failure occurs during stage 3, i.e. while the page
is mapped and we are reading from it?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 12:12:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 12:12:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb9A8-0006hn-20; Wed, 21 Nov 2012 12:12:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1Tb9A7-0006hf-Ib
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 12:12:15 +0000
Received: from [85.158.143.35:54716] by server-1.bemta-4.messagelabs.com id
	75/3A-27934-E15CCA05; Wed, 21 Nov 2012 12:12:14 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1353499905!10699354!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzI0MDgy\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30478 invoked from network); 21 Nov 2012 12:11:45 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-10.tower-21.messagelabs.com with SMTP;
	21 Nov 2012 12:11:45 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga101.jf.intel.com with ESMTP; 21 Nov 2012 04:11:29 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,293,1352102400"; d="scan'208";a="245304885"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by orsmga002.jf.intel.com with ESMTP; 21 Nov 2012 04:11:29 -0800
Received: from fmsmsx153.amr.corp.intel.com (10.19.17.7) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 04:11:28 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX153.amr.corp.intel.com (10.19.17.7) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 04:11:28 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 20:11:27 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>, Ian Campbell
	<Ian.Campbell@citrix.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNx9n3WSR52N+j5UqhK6CjagaIUZf0Mo8A
Date: Wed, 21 Nov 2012 12:11:26 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335394370@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
	<1353344256.18229.129.camel@zakaz.uk.xensource.com>
	<50AB9CFE.7000003@eu.citrix.com>
	<DE8DF0795D48FD4CA783C40EC8292335393633@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233539385B@SHSMSX101.ccr.corp.intel.com>
	<1353496027.13542.119.camel@zakaz.uk.xensource.com>
	<50ACB894.1070509@eu.citrix.com>
In-Reply-To: <50ACB894.1070509@eu.citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> On 21/11/12 11:07, Ian Campbell wrote:
>> On Tue, 2012-11-20 at 18:54 +0000, Liu, Jinsong wrote:
>>> Well, let me elaborate more my thought about broken page occur at
>>> last iter: 
>>> 
>>> Theoretically we can separate 'broken page at last iter' into
>>> several sub-cases, and optimize case by case: 
>>> 1. if the page (which will break at last iter) is not on dirty
>>> bitmap (of last iter) --> do nothing is OK, target will happily run
>>> w/o broken page;  
>>> 2. if the page (which will break at last iter) is on dirty bitmap
>>> (of last iter) 
>>>    2.1 if at last iter, vmce occur after page copy --> do nothing
>>> is OK, target happily run w/o broken page; 
>>>    2.2 if vmce occur beofre pfn_type transfer --> do nothing is OK,
>>> V2 patch has correctly handle the case, target will set p2m broken
>>> correctly;  
>>>    2.3 if vmce occur after pfn_type transfer and before copy page
>>> to target --> we need handle this case; 
>>> 
>>> Practically considering it's rare enough, and code complication, we
>>> handle it in a simple way (not so optimized but enough for real
>>> life):  
>>> - we don't distinguish if the page is in dirty bitmap of last iter;
>>> - we don't prefer adding new hypercall for this corner case,
>>> instead we'd like to re-use currently existed hypercall; 
>>> - if vmce occur at last iter, we do 1~2 more iter.
>> Can't a page break on each "last" iter. i.e. you might actually go
>> around as many times as there are pages in the last batch?
> 
> I think it would be only if the pages break one by one, at just the
> right time -- that seems pretty unlikely. :-)
> 
>   -George

And under the case it still OK w/ V3, keeping iter until the last broken page.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 12:12:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 12:12:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb9A8-0006hn-20; Wed, 21 Nov 2012 12:12:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1Tb9A7-0006hf-Ib
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 12:12:15 +0000
Received: from [85.158.143.35:54716] by server-1.bemta-4.messagelabs.com id
	75/3A-27934-E15CCA05; Wed, 21 Nov 2012 12:12:14 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1353499905!10699354!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzI0MDgy\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30478 invoked from network); 21 Nov 2012 12:11:45 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-10.tower-21.messagelabs.com with SMTP;
	21 Nov 2012 12:11:45 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga101.jf.intel.com with ESMTP; 21 Nov 2012 04:11:29 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,293,1352102400"; d="scan'208";a="245304885"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by orsmga002.jf.intel.com with ESMTP; 21 Nov 2012 04:11:29 -0800
Received: from fmsmsx153.amr.corp.intel.com (10.19.17.7) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 04:11:28 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX153.amr.corp.intel.com (10.19.17.7) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 04:11:28 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 20:11:27 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>, Ian Campbell
	<Ian.Campbell@citrix.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNx9n3WSR52N+j5UqhK6CjagaIUZf0Mo8A
Date: Wed, 21 Nov 2012 12:11:26 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335394370@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<20646.33684.410414.579210@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233538DFD5@SHSMSX101.ccr.corp.intel.com>
	<1353318919.18229.7.camel@zakaz.uk.xensource.com>
	<50AA5061.7040103@eu.citrix.com>
	<1353344256.18229.129.camel@zakaz.uk.xensource.com>
	<50AB9CFE.7000003@eu.citrix.com>
	<DE8DF0795D48FD4CA783C40EC8292335393633@SHSMSX101.ccr.corp.intel.com>
	<DE8DF0795D48FD4CA783C40EC829233539385B@SHSMSX101.ccr.corp.intel.com>
	<1353496027.13542.119.camel@zakaz.uk.xensource.com>
	<50ACB894.1070509@eu.citrix.com>
In-Reply-To: <50ACB894.1070509@eu.citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> On 21/11/12 11:07, Ian Campbell wrote:
>> On Tue, 2012-11-20 at 18:54 +0000, Liu, Jinsong wrote:
>>> Well, let me elaborate more my thought about broken page occur at
>>> last iter: 
>>> 
>>> Theoretically we can separate 'broken page at last iter' into
>>> several sub-cases, and optimize case by case: 
>>> 1. if the page (which will break at last iter) is not on dirty
>>> bitmap (of last iter) --> do nothing is OK, target will happily run
>>> w/o broken page;  
>>> 2. if the page (which will break at last iter) is on dirty bitmap
>>> (of last iter) 
>>>    2.1 if at last iter, vmce occur after page copy --> do nothing
>>> is OK, target happily run w/o broken page; 
>>>    2.2 if vmce occur beofre pfn_type transfer --> do nothing is OK,
>>> V2 patch has correctly handle the case, target will set p2m broken
>>> correctly;  
>>>    2.3 if vmce occur after pfn_type transfer and before copy page
>>> to target --> we need handle this case; 
>>> 
>>> Practically considering it's rare enough, and code complication, we
>>> handle it in a simple way (not so optimized but enough for real
>>> life):  
>>> - we don't distinguish if the page is in dirty bitmap of last iter;
>>> - we don't prefer adding new hypercall for this corner case,
>>> instead we'd like to re-use currently existed hypercall; 
>>> - if vmce occur at last iter, we do 1~2 more iter.
>> Can't a page break on each "last" iter. i.e. you might actually go
>> around as many times as there are pages in the last batch?
> 
> I think it would be only if the pages break one by one, at just the
> right time -- that seems pretty unlikely. :-)
> 
>   -George

And under the case it still OK w/ V3, keeping iter until the last broken page.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 12:12:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 12:12:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb9AD-0006iU-Eo; Wed, 21 Nov 2012 12:12:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb9AC-0006iE-IR
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 12:12:20 +0000
Received: from [85.158.139.83:59011] by server-5.bemta-5.messagelabs.com id
	5B/D8-11353-325CCA05; Wed, 21 Nov 2012 12:12:19 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1353499937!31263549!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17195 invoked from network); 21 Nov 2012 12:12:17 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 12:12:17 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 12:12:16 +0000
Message-Id: <50ACD36702000078000AA5B3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 12:13:11 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir.xen@gmail.com>, "xen-devel" <xen-devel@lists.xen.org>
References: <50ACC67002000078000AA56A@nat28.tlf.novell.com>
	<CCD26BB5.451A9%keir.xen@gmail.com>
In-Reply-To: <CCD26BB5.451A9%keir.xen@gmail.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part1627E747.3__="
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: [Xen-devel] [PATCH 5/5 v2] VT-d: adjust IOMMU interrupt affinities
 when all CPUs are online
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part1627E747.3__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Since these interrupts get setup before APs get brought online, their
affinities naturally could only ever point to CPU 0 alone so far.
Adjust this to include potentially multiple CPUs in the target mask
(when running in one of the cluster modes), and take into account NUMA
information (to handle the interrupts on a CPU on the node where the
respective IOMMU is).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: Call adjust_vtd_irq_affinities() explicitly from enter_state()
    rather than through acpi_dmar_zap().

--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -219,6 +219,7 @@ static int enter_state(u32 state)
     mtrr_aps_sync_begin();
     enable_nonboot_cpus();
     mtrr_aps_sync_end();
+    adjust_vtd_irq_affinities();
     acpi_dmar_zap();
     thaw_domains();
     system_state =3D SYS_STATE_active;
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1971,6 +1971,33 @@ void clear_fault_bits(struct iommu *iomm
     spin_unlock_irqrestore(&iommu->register_lock, flags);
 }
=20
+static void adjust_irq_affinity(struct acpi_drhd_unit *drhd)
+{
+    const struct acpi_rhsa_unit *rhsa =3D drhd_to_rhsa(drhd);
+    unsigned int node =3D rhsa ? pxm_to_node(rhsa->proximity_domain)
+                             : NUMA_NO_NODE;
+    const cpumask_t *cpumask =3D &cpu_online_map;
+
+    if ( node < MAX_NUMNODES && node_online(node) &&
+         cpumask_intersects(&node_to_cpumask(node), cpumask) )
+        cpumask =3D &node_to_cpumask(node);
+    dma_msi_set_affinity(irq_to_desc(drhd->iommu->msi.irq), cpumask);
+}
+
+int adjust_vtd_irq_affinities(void)
+{
+    struct acpi_drhd_unit *drhd;
+
+    if ( !iommu_enabled )
+        return 0;
+
+    for_each_drhd_unit ( drhd )
+        adjust_irq_affinity(drhd);
+
+    return 0;
+}
+__initcall(adjust_vtd_irq_affinities);
+
 static int init_vtd_hw(void)
 {
     struct acpi_drhd_unit *drhd;
@@ -1984,13 +2011,10 @@ static int init_vtd_hw(void)
      */
     for_each_drhd_unit ( drhd )
     {
-        struct irq_desc *desc;
+        adjust_irq_affinity(drhd);
=20
         iommu =3D drhd->iommu;
=20
-        desc =3D irq_to_desc(iommu->msi.irq);
-        dma_msi_set_affinity(desc, desc->arch.cpu_mask);
-
         clear_fault_bits(iommu);
=20
         spin_lock_irqsave(&iommu->register_lock, flags);
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -137,6 +137,9 @@ int iommu_do_domctl(struct xen_domctl *,
 void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int =
page_count);
 void iommu_iotlb_flush_all(struct domain *d);
=20
+/* While VT-d specific, this must get declared in a generic header. */
+int adjust_vtd_irq_affinities(void);
+
 /*
  * The purpose of the iommu_dont_flush_iotlb optional cpu flag is to
  * avoid unecessary iotlb_flush in the low level IOMMU code.




--=__Part1627E747.3__=
Content-Type: text/plain; name="VT-d-interrupt-affinity.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="VT-d-interrupt-affinity.patch"

VT-d: adjust IOMMU interrupt affinities when all CPUs are online=0A=0ASince=
 these interrupts get setup before APs get brought online, their=0Aaffiniti=
es naturally could only ever point to CPU 0 alone so far.=0AAdjust this to =
include potentially multiple CPUs in the target mask=0A(when running in =
one of the cluster modes), and take into account NUMA=0Ainformation (to =
handle the interrupts on a CPU on the node where the=0Arespective IOMMU =
is).=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A---=0Av2: Call =
adjust_vtd_irq_affinities() explicitly from enter_state()=0A    rather =
than through acpi_dmar_zap().=0A=0A--- a/xen/arch/x86/acpi/power.c=0A+++ =
b/xen/arch/x86/acpi/power.c=0A@@ -219,6 +219,7 @@ static int enter_state(u3=
2 state)=0A     mtrr_aps_sync_begin();=0A     enable_nonboot_cpus();=0A    =
 mtrr_aps_sync_end();=0A+    adjust_vtd_irq_affinities();=0A     acpi_dmar_=
zap();=0A     thaw_domains();=0A     system_state =3D SYS_STATE_active;=0A-=
-- a/xen/drivers/passthrough/vtd/iommu.c=0A+++ b/xen/drivers/passthrough/vt=
d/iommu.c=0A@@ -1971,6 +1971,33 @@ void clear_fault_bits(struct iommu =
*iomm=0A     spin_unlock_irqrestore(&iommu->register_lock, flags);=0A }=0A =
=0A+static void adjust_irq_affinity(struct acpi_drhd_unit *drhd)=0A+{=0A+  =
  const struct acpi_rhsa_unit *rhsa =3D drhd_to_rhsa(drhd);=0A+    =
unsigned int node =3D rhsa ? pxm_to_node(rhsa->proximity_domain)=0A+       =
                      : NUMA_NO_NODE;=0A+    const cpumask_t *cpumask =3D =
&cpu_online_map;=0A+=0A+    if ( node < MAX_NUMNODES && node_online(node) =
&&=0A+         cpumask_intersects(&node_to_cpumask(node), cpumask) )=0A+   =
     cpumask =3D &node_to_cpumask(node);=0A+    dma_msi_set_affinity(irq_to=
_desc(drhd->iommu->msi.irq), cpumask);=0A+}=0A+=0A+int adjust_vtd_irq_affin=
ities(void)=0A+{=0A+    struct acpi_drhd_unit *drhd;=0A+=0A+    if ( =
!iommu_enabled )=0A+        return 0;=0A+=0A+    for_each_drhd_unit ( drhd =
)=0A+        adjust_irq_affinity(drhd);=0A+=0A+    return 0;=0A+}=0A+__init=
call(adjust_vtd_irq_affinities);=0A+=0A static int init_vtd_hw(void)=0A =
{=0A     struct acpi_drhd_unit *drhd;=0A@@ -1984,13 +2011,10 @@ static int =
init_vtd_hw(void)=0A      */=0A     for_each_drhd_unit ( drhd )=0A     =
{=0A-        struct irq_desc *desc;=0A+        adjust_irq_affinity(drhd);=
=0A =0A         iommu =3D drhd->iommu;=0A =0A-        desc =3D irq_to_desc(=
iommu->msi.irq);=0A-        dma_msi_set_affinity(desc, desc->arch.cpu_mask)=
;=0A-=0A         clear_fault_bits(iommu);=0A =0A         spin_lock_irqsave(=
&iommu->register_lock, flags);=0A--- a/xen/include/xen/iommu.h=0A+++ =
b/xen/include/xen/iommu.h=0A@@ -137,6 +137,9 @@ int iommu_do_domctl(struct =
xen_domctl *,=0A void iommu_iotlb_flush(struct domain *d, unsigned long =
gfn, unsigned int page_count);=0A void iommu_iotlb_flush_all(struct domain =
*d);=0A =0A+/* While VT-d specific, this must get declared in a generic =
header. */=0A+int adjust_vtd_irq_affinities(void);=0A+=0A /*=0A  * The =
purpose of the iommu_dont_flush_iotlb optional cpu flag is to=0A  * avoid =
unecessary iotlb_flush in the low level IOMMU code.=0A
--=__Part1627E747.3__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part1627E747.3__=--


From xen-devel-bounces@lists.xen.org Wed Nov 21 12:12:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 12:12:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb9AD-0006iU-Eo; Wed, 21 Nov 2012 12:12:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tb9AC-0006iE-IR
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 12:12:20 +0000
Received: from [85.158.139.83:59011] by server-5.bemta-5.messagelabs.com id
	5B/D8-11353-325CCA05; Wed, 21 Nov 2012 12:12:19 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1353499937!31263549!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17195 invoked from network); 21 Nov 2012 12:12:17 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-182.messagelabs.com with SMTP;
	21 Nov 2012 12:12:17 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 12:12:16 +0000
Message-Id: <50ACD36702000078000AA5B3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 12:13:11 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Keir Fraser" <keir.xen@gmail.com>, "xen-devel" <xen-devel@lists.xen.org>
References: <50ACC67002000078000AA56A@nat28.tlf.novell.com>
	<CCD26BB5.451A9%keir.xen@gmail.com>
In-Reply-To: <CCD26BB5.451A9%keir.xen@gmail.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part1627E747.3__="
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: [Xen-devel] [PATCH 5/5 v2] VT-d: adjust IOMMU interrupt affinities
 when all CPUs are online
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part1627E747.3__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Since these interrupts get setup before APs get brought online, their
affinities naturally could only ever point to CPU 0 alone so far.
Adjust this to include potentially multiple CPUs in the target mask
(when running in one of the cluster modes), and take into account NUMA
information (to handle the interrupts on a CPU on the node where the
respective IOMMU is).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: Call adjust_vtd_irq_affinities() explicitly from enter_state()
    rather than through acpi_dmar_zap().

--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -219,6 +219,7 @@ static int enter_state(u32 state)
     mtrr_aps_sync_begin();
     enable_nonboot_cpus();
     mtrr_aps_sync_end();
+    adjust_vtd_irq_affinities();
     acpi_dmar_zap();
     thaw_domains();
     system_state =3D SYS_STATE_active;
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1971,6 +1971,33 @@ void clear_fault_bits(struct iommu *iomm
     spin_unlock_irqrestore(&iommu->register_lock, flags);
 }
=20
+static void adjust_irq_affinity(struct acpi_drhd_unit *drhd)
+{
+    const struct acpi_rhsa_unit *rhsa =3D drhd_to_rhsa(drhd);
+    unsigned int node =3D rhsa ? pxm_to_node(rhsa->proximity_domain)
+                             : NUMA_NO_NODE;
+    const cpumask_t *cpumask =3D &cpu_online_map;
+
+    if ( node < MAX_NUMNODES && node_online(node) &&
+         cpumask_intersects(&node_to_cpumask(node), cpumask) )
+        cpumask =3D &node_to_cpumask(node);
+    dma_msi_set_affinity(irq_to_desc(drhd->iommu->msi.irq), cpumask);
+}
+
+int adjust_vtd_irq_affinities(void)
+{
+    struct acpi_drhd_unit *drhd;
+
+    if ( !iommu_enabled )
+        return 0;
+
+    for_each_drhd_unit ( drhd )
+        adjust_irq_affinity(drhd);
+
+    return 0;
+}
+__initcall(adjust_vtd_irq_affinities);
+
 static int init_vtd_hw(void)
 {
     struct acpi_drhd_unit *drhd;
@@ -1984,13 +2011,10 @@ static int init_vtd_hw(void)
      */
     for_each_drhd_unit ( drhd )
     {
-        struct irq_desc *desc;
+        adjust_irq_affinity(drhd);
=20
         iommu =3D drhd->iommu;
=20
-        desc =3D irq_to_desc(iommu->msi.irq);
-        dma_msi_set_affinity(desc, desc->arch.cpu_mask);
-
         clear_fault_bits(iommu);
=20
         spin_lock_irqsave(&iommu->register_lock, flags);
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -137,6 +137,9 @@ int iommu_do_domctl(struct xen_domctl *,
 void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int =
page_count);
 void iommu_iotlb_flush_all(struct domain *d);
=20
+/* While VT-d specific, this must get declared in a generic header. */
+int adjust_vtd_irq_affinities(void);
+
 /*
  * The purpose of the iommu_dont_flush_iotlb optional cpu flag is to
  * avoid unecessary iotlb_flush in the low level IOMMU code.




--=__Part1627E747.3__=
Content-Type: text/plain; name="VT-d-interrupt-affinity.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="VT-d-interrupt-affinity.patch"

VT-d: adjust IOMMU interrupt affinities when all CPUs are online=0A=0ASince=
 these interrupts get setup before APs get brought online, their=0Aaffiniti=
es naturally could only ever point to CPU 0 alone so far.=0AAdjust this to =
include potentially multiple CPUs in the target mask=0A(when running in =
one of the cluster modes), and take into account NUMA=0Ainformation (to =
handle the interrupts on a CPU on the node where the=0Arespective IOMMU =
is).=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A---=0Av2: Call =
adjust_vtd_irq_affinities() explicitly from enter_state()=0A    rather =
than through acpi_dmar_zap().=0A=0A--- a/xen/arch/x86/acpi/power.c=0A+++ =
b/xen/arch/x86/acpi/power.c=0A@@ -219,6 +219,7 @@ static int enter_state(u3=
2 state)=0A     mtrr_aps_sync_begin();=0A     enable_nonboot_cpus();=0A    =
 mtrr_aps_sync_end();=0A+    adjust_vtd_irq_affinities();=0A     acpi_dmar_=
zap();=0A     thaw_domains();=0A     system_state =3D SYS_STATE_active;=0A-=
-- a/xen/drivers/passthrough/vtd/iommu.c=0A+++ b/xen/drivers/passthrough/vt=
d/iommu.c=0A@@ -1971,6 +1971,33 @@ void clear_fault_bits(struct iommu =
*iomm=0A     spin_unlock_irqrestore(&iommu->register_lock, flags);=0A }=0A =
=0A+static void adjust_irq_affinity(struct acpi_drhd_unit *drhd)=0A+{=0A+  =
  const struct acpi_rhsa_unit *rhsa =3D drhd_to_rhsa(drhd);=0A+    =
unsigned int node =3D rhsa ? pxm_to_node(rhsa->proximity_domain)=0A+       =
                      : NUMA_NO_NODE;=0A+    const cpumask_t *cpumask =3D =
&cpu_online_map;=0A+=0A+    if ( node < MAX_NUMNODES && node_online(node) =
&&=0A+         cpumask_intersects(&node_to_cpumask(node), cpumask) )=0A+   =
     cpumask =3D &node_to_cpumask(node);=0A+    dma_msi_set_affinity(irq_to=
_desc(drhd->iommu->msi.irq), cpumask);=0A+}=0A+=0A+int adjust_vtd_irq_affin=
ities(void)=0A+{=0A+    struct acpi_drhd_unit *drhd;=0A+=0A+    if ( =
!iommu_enabled )=0A+        return 0;=0A+=0A+    for_each_drhd_unit ( drhd =
)=0A+        adjust_irq_affinity(drhd);=0A+=0A+    return 0;=0A+}=0A+__init=
call(adjust_vtd_irq_affinities);=0A+=0A static int init_vtd_hw(void)=0A =
{=0A     struct acpi_drhd_unit *drhd;=0A@@ -1984,13 +2011,10 @@ static int =
init_vtd_hw(void)=0A      */=0A     for_each_drhd_unit ( drhd )=0A     =
{=0A-        struct irq_desc *desc;=0A+        adjust_irq_affinity(drhd);=
=0A =0A         iommu =3D drhd->iommu;=0A =0A-        desc =3D irq_to_desc(=
iommu->msi.irq);=0A-        dma_msi_set_affinity(desc, desc->arch.cpu_mask)=
;=0A-=0A         clear_fault_bits(iommu);=0A =0A         spin_lock_irqsave(=
&iommu->register_lock, flags);=0A--- a/xen/include/xen/iommu.h=0A+++ =
b/xen/include/xen/iommu.h=0A@@ -137,6 +137,9 @@ int iommu_do_domctl(struct =
xen_domctl *,=0A void iommu_iotlb_flush(struct domain *d, unsigned long =
gfn, unsigned int page_count);=0A void iommu_iotlb_flush_all(struct domain =
*d);=0A =0A+/* While VT-d specific, this must get declared in a generic =
header. */=0A+int adjust_vtd_irq_affinities(void);=0A+=0A /*=0A  * The =
purpose of the iommu_dont_flush_iotlb optional cpu flag is to=0A  * avoid =
unecessary iotlb_flush in the low level IOMMU code.=0A
--=__Part1627E747.3__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part1627E747.3__=--


From xen-devel-bounces@lists.xen.org Wed Nov 21 12:17:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 12:17:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb9Ey-00078V-CY; Wed, 21 Nov 2012 12:17:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1Tb9Ew-00078P-JP
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 12:17:15 +0000
Received: from [85.158.139.83:42019] by server-10.bemta-5.messagelabs.com id
	D7/23-09257-946CCA05; Wed, 21 Nov 2012 12:17:13 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1353500231!31257237!1
X-Originating-IP: [209.85.216.171]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10966 invoked from network); 21 Nov 2012 12:17:12 -0000
Received: from mail-qc0-f171.google.com (HELO mail-qc0-f171.google.com)
	(209.85.216.171)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 12:17:12 -0000
Received: by mail-qc0-f171.google.com with SMTP id d1so1012704qca.30
	for <xen-devel@lists.xensource.com>;
	Wed, 21 Nov 2012 04:17:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=MXq7K/YZUZl0Db2e3smVyuCd900bBg280CIR+WlLTqM=;
	b=lPpMhTHX/00xyExUHQyGt24mpHX9tX10Eas4edDDI2Mc6cR7Xv5EytU43X3W3dB70+
	sQQThttxSH6Jju/p+WHY8iDqTJt6lmVnpOivKiVdS43Ggs/NucpE6SdWMEdL9cwDoTXe
	9WGZlzzJ0D/WTtXH0f1D6zHtP9W4eEStyHIklsXKTaCjAdlLEBDcH2Yu2+4jiK/WCCAz
	+qfaFyH3d+V0Z5TVDSxNTfuS0hBAPig5qZIeWQNALWvIrmZ7Jmi/tqRIMihjQWj28qYv
	WCOlNeTly/gRo/RvDtnrW//GmHqzPbabKUSNvmB6+u7lepE2r9MpFNTYAQeuFpWgDzZM
	byKg==
MIME-Version: 1.0
Received: by 10.229.180.35 with SMTP id bs35mr4278649qcb.22.1353500230661;
	Wed, 21 Nov 2012 04:17:10 -0800 (PST)
Received: by 10.49.51.169 with HTTP; Wed, 21 Nov 2012 04:17:10 -0800 (PST)
In-Reply-To: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
Date: Wed, 21 Nov 2012 12:17:10 +0000
X-Google-Sender-Auth: NaFASRYcyRnr1OGQdrPrE22adRQ
Message-ID: <CAFLBxZZq5obGskT0BGKMqEY+Mj4OtY-9DyhAcdo5XU9bidL2zg@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Liu Jinsong <jinsong.liu@intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3369826934845018278=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============3369826934845018278==
Content-Type: multipart/alternative; boundary=001636d33d2a73b71e04cf005420

--001636d33d2a73b71e04cf005420
Content-Type: text/plain; charset=ISO-8859-1

OK, so now that we seem to have agreed on the overall approach, down to
"brass tacks", as we say in English:

On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <jinsong.liu@intel.com> wrote:

> Generally, there are 2 cases:
> 1. broken page occurs before migration
> 2. broken page occurs during migration
>

I think we probably need to include the "last iteration" subcases here as
well -- although, probably it would be better to put them in the comments.
Also make sure to note that now even suspend may do a second iteration if
pages are broken during the suspend operation.

Also, what you should do is have the main description always say what the
patch does, and then at the bottom have a summary of the changes; for
instance:

v4:
 - Adjust variables and patch description based on feedback
v3:
 - Handle pages broken on the last iteration
&c



> We had submitted 2 versions of patches. Their difference is how to handle
> case 2:
> V1 patch aborted migration for the case 'broken page occurs during
> migration';
> V2 patch marked broken page to dirty bitmap then got handled next round
> and no abort;
>
> This is V3 patch, adding handle for vMCE occur at last iteration of
> migration:
> At the sender
>   For case 1, the broken page will be mapped but not copied to target
>   (otherwise it may trigger more serious error, say, SRAR error).
>   While its pfn_type and pfn number will be transferred to target
>   so that target take appropriate action.
>
>   For case 2, mce handler marks the broken page to dirty bitmap, so that
>   at copypages stage of migration, its pfn_type and pfn number will be
>   transferred to target and then take appropriate action.
>
> At the target
>   When migration target populates pages for guest. As for the case
>   of broken page wrt migration, we prefer to keep the type of the page,
>   for the sake of seamless migration.
>
>   At target it will set p2m as p2m_ram_broken for broken page. Guest MCE
>   may have good chance to handle its broken page, while if guest access
>   the broken page again it will kill itself as expected.
>
> If vMCE occur at the last memory copy iteration of migration, we do one
> more
> iteration so that the broken page's pfn_type and pfn number has chance to
> be transferred to target.
>
> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
>
> - for tools part of the patch
> Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
>

You should remove these until you get another ack (since the patch has
changed materially)


>
> - for hypervisor part of the patch
> Acked-by: Jan Beulich <JBeulich@suse.com>
>

I think if you haven't changed the HV part since his ack, you can probably
leave this one.


>
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain.c
> --- a/tools/libxc/xc_domain.c   Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xc_domain.c   Sat Nov 17 09:46:05 2012 +0800
> @@ -283,6 +283,22 @@
>      return ret;
>  }
>
> +/* set broken page p2m */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn)
> +{
> +    int ret;
> +    DECLARE_DOMCTL;
> +
> +    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
> +    domctl.domain = (domid_t)domid;
> +    domctl.u.set_broken_page_p2m.pfn = pfn;
> +    ret = do_domctl(xch, &domctl);
> +
> +    return ret ? -1 : 0;
> +}
> +
>  /* get info from hvm guest for save */
>  int xc_domain_hvm_getcontext(xc_interface *xch,
>                               uint32_t domid,
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_restore.c
> --- a/tools/libxc/xc_domain_restore.c   Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xc_domain_restore.c   Sat Nov 17 09:46:05 2012 +0800
> @@ -1023,9 +1023,15 @@
>
>      countpages = count;
>      for (i = oldcount; i < buf->nr_pages; ++i)
> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
> XEN_DOMCTL_PFINFO_XTAB
> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
> XEN_DOMCTL_PFINFO_XALLOC)
> +    {
> +        unsigned long pagetype;
> +
> +        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
> +        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
> +             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
> +             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>              --countpages;
> +    }
>
>      if (!countpages)
>          return count;
> @@ -1267,6 +1273,17 @@
>              /* a bogus/unmapped/allocate-only page: skip it */
>              continue;
>
> +        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
> +        {
> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
> +            {
> +                ERROR("Set p2m for broken page failed, "
> +                      "dom=%d, pfn=%lx\n", dom, pfn);
> +                goto err_mapped;
> +            }
> +            continue;
> +        }
> +
>          if (pfn_err[i])
>          {
>              ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx
> p2m_mfn %lx",
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_save.c
> --- a/tools/libxc/xc_domain_save.c      Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xc_domain_save.c      Sat Nov 17 09:46:05 2012 +0800
> @@ -1118,7 +1118,7 @@
>      /* Now write out each data page, canonicalising page tables as we
> go... */
>      for ( ; ; )
>      {
> -        unsigned int N, batch, run;
> +        unsigned int N, batch, run, broken_page_num1, broken_page_num2;
>

You need more descriptive variables here.  Maybe "broken_before_send" and
"broken_after_send"?


>          char reportbuf[80];
>
>          snprintf(reportbuf, sizeof(reportbuf),
> @@ -1270,6 +1270,7 @@
>                  goto out;
>              }
>
> +            broken_page_num1 = 0;
>              for ( run = j = 0; j < batch; j++ )
>              {
>                  unsigned long gmfn = pfn_batch[j];
> @@ -1277,6 +1278,14 @@
>                  if ( !hvm )
>                      gmfn = pfn_to_mfn(gmfn);
>
> +                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                {
> +                    pfn_type[j] |= pfn_batch[j];
> +                    ++broken_page_num1;
> +                    ++run;
> +                    continue;
> +                }
> +
>                  if ( pfn_err[j] )
>                  {
>                      if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
> @@ -1371,8 +1380,12 @@
>                      }
>                  }
>
> -                /* skip pages that aren't present or are alloc-only */
> +                /*
> +                 * skip pages that aren't present,
> +                 * or are broken, or are alloc-only
> +                 */
>                  if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
> +                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
>                      || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>                      continue;
>
> @@ -1484,6 +1497,35 @@
>
>              munmap(region_base, batch*PAGE_SIZE);
>
> +            /*
> +             * if vMCE occur at last iter, do one more iter so that it get
> +             * chance to transfer broken page's pfn_type and pfn number to
> +             * target and then take appropriate action
> +             */
>

Maybe, "Pages may have broken between mapping them and sending them.  Count
the number of broken pages after sending, and if there are more than before
sending, do another iteration to make sure the pages are marked broken on
the receiving side"?


> +            if ( last_iter )
> +            {
>

/* Read the p2m table again */


> +                for ( j = 0; j < batch; j++ )
> +                {
> +                    if ( hvm )
> +                        pfn_type[j] = pfn_batch[j];
> +                    else
> +                        pfn_type[j] = pfn_to_mfn(pfn_batch[j]);
> +                }
> +
> +                if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
> +                {
> +                    PERROR("get_pfn_type_batch failed");
> +                    goto out;
> +                }
> +
>

/* Count the number of broken pages */


> +                broken_page_num2 = 0;
> +                for ( j = 0; j < batch; j++ )
> +                    if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                        broken_page_num2++;
> +
>

/* If there are more than before sending, do one more iteration */


> +                if ( broken_page_num1 < broken_page_num2 )
> +                    last_iter = 0;
> +            }
>          } /* end of this while loop for this iteration */
>

I think that's all I have.

 -George

--001636d33d2a73b71e04cf005420
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

OK, so now that we seem to have agreed on the overall approach, down to &qu=
ot;brass tacks&quot;, as we say in English:<br><br><div class=3D"gmail_extr=
a">On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:jinsong.liu@intel.com" target=3D"_blank">jinsong.liu@intel.com=
</a>&gt;</span> wrote:<br>
<div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=3D"im"=
>Generally, there are 2 cases:<br>
1. broken page occurs before migration<br>
2. broken page occurs during migration<br></div></blockquote><div><br>I thi=
nk we probably need to include the &quot;last iteration&quot; subcases here=
 as well -- although, probably it would be better to put them in the commen=
ts.=A0 Also make sure to note that now even suspend may do a second iterati=
on if pages are broken during the suspend operation.<br>
<br>Also, what you should do is have the main description always say what t=
he patch does, and then at the bottom have a summary of the changes; for in=
stance:<br><br>v4: <br>=A0- Adjust variables and patch description based on=
 feedback<br>
v3: <br>=A0- Handle pages broken on the last iteration<br>&amp;c<br>=A0<br>=
<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"><div class=3D"im">
<br>
</div>We had submitted 2 versions of patches. Their difference is how to ha=
ndle case 2:<br>
V1 patch aborted migration for the case &#39;broken page occurs during migr=
ation&#39;;<br>
V2 patch marked broken page to dirty bitmap then got handled next round and=
 no abort;<br>
<br>
This is V3 patch, adding handle for vMCE occur at last iteration of migrati=
on:<br>
At the sender<br>
=A0 For case 1, the broken page will be mapped but not copied to target<br>
<div class=3D"im">=A0 (otherwise it may trigger more serious error, say, SR=
AR error).<br>
</div>=A0 While its pfn_type and pfn number will be transferred to target<b=
r>
<div class=3D"im">=A0 so that target take appropriate action.<br>
<br>
=A0 For case 2, mce handler marks the broken page to dirty bitmap, so that<=
br>
</div>=A0 at copypages stage of migration, its pfn_type and pfn number will=
 be<br>
<div class=3D"im">=A0 transferred to target and then take appropriate actio=
n.<br>
<br>
At the target<br>
</div>=A0 When migration target populates pages for guest. As for the case<=
br>
=A0 of broken page wrt migration, we prefer to keep the type of the page,<b=
r>
<div class=3D"im">=A0 for the sake of seamless migration.<br>
<br>
</div>=A0 At target it will set p2m as p2m_ram_broken for broken page. Gues=
t MCE<br>
<div class=3D"im">=A0 may have good chance to handle its broken page, while=
 if guest access<br>
</div>=A0 the broken page again it will kill itself as expected.<br>
<br>
If vMCE occur at the last memory copy iteration of migration, we do one mor=
e<br>
iteration so that the broken page&#39;s pfn_type and pfn number has chance =
to<br>
be transferred to target.<br>
<div class=3D"im"><br>
Suggested-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.c=
om">george.dunlap@eu.citrix.com</a>&gt;<br>
Signed-off-by: Liu Jinsong &lt;<a href=3D"mailto:jinsong.liu@intel.com">jin=
song.liu@intel.com</a>&gt;<br>
Acked-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">=
george.dunlap@eu.citrix.com</a>&gt;<br>
<br>
</div>- for tools part of the patch<br>
Acked-by: Ian Jackson &lt;<a href=3D"mailto:Ian.Jackson@eu.citrix.com">Ian.=
Jackson@eu.citrix.com</a>&gt;<br></blockquote><div><br>You should remove th=
ese until you get another ack (since the patch has changed materially)<br>
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex">
<br>
- for hypervisor part of the patch<br>
Acked-by: Jan Beulich &lt;<a href=3D"mailto:JBeulich@suse.com">JBeulich@sus=
e.com</a>&gt;<br></blockquote><div><br>I think if you haven&#39;t changed t=
he HV part since his ack, you can probably leave this one.<br>=A0</div><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex">

<br>
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain.c<br>
<div class=3D"im">--- a/tools/libxc/xc_domain.c =A0 Tue Nov 13 11:19:17 201=
2 +0000<br>
</div>+++ b/tools/libxc/xc_domain.c =A0 Sat Nov 17 09:46:05 2012 +0800<br>
<div class=3D"im">@@ -283,6 +283,22 @@<br>
=A0 =A0 =A0return ret;<br>
=A0}<br>
<br>
+/* set broken page p2m */<br>
+int xc_set_broken_page_p2m(xc_interface *xch,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 uint32_t domid,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 unsigned long pfn)<br=
>
+{<br>
+ =A0 =A0int ret;<br>
+ =A0 =A0DECLARE_DOMCTL;<br>
+<br>
+ =A0 =A0domctl.cmd =3D XEN_DOMCTL_set_broken_page_p2m;<br>
+ =A0 =A0domctl.domain =3D (domid_t)domid;<br>
+ =A0 =A0domctl.u.set_broken_page_p2m.pfn =3D pfn;<br>
+ =A0 =A0ret =3D do_domctl(xch, &amp;domctl);<br>
+<br>
+ =A0 =A0return ret ? -1 : 0;<br>
+}<br>
+<br>
=A0/* get info from hvm guest for save */<br>
=A0int xc_domain_hvm_getcontext(xc_interface *xch,<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 uint32_t domid,=
<br>
</div>diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_restore.c<=
br>
<div class=3D"im">--- a/tools/libxc/xc_domain_restore.c =A0 Tue Nov 13 11:1=
9:17 2012 +0000<br>
</div>+++ b/tools/libxc/xc_domain_restore.c =A0 Sat Nov 17 09:46:05 2012 +0=
800<br>
<div><div class=3D"h5">@@ -1023,9 +1023,15 @@<br>
<br>
=A0 =A0 =A0countpages =3D count;<br>
=A0 =A0 =A0for (i =3D oldcount; i &lt; buf-&gt;nr_pages; ++i)<br>
- =A0 =A0 =A0 =A0if ((buf-&gt;pfn_types[i] &amp; XEN_DOMCTL_PFINFO_LTAB_MAS=
K) =3D=3D XEN_DOMCTL_PFINFO_XTAB<br>
- =A0 =A0 =A0 =A0 =A0 =A0||(buf-&gt;pfn_types[i] &amp; XEN_DOMCTL_PFINFO_LT=
AB_MASK) =3D=3D XEN_DOMCTL_PFINFO_XALLOC)<br>
+ =A0 =A0{<br>
+ =A0 =A0 =A0 =A0unsigned long pagetype;<br>
+<br>
+ =A0 =A0 =A0 =A0pagetype =3D buf-&gt;pfn_types[i] &amp; XEN_DOMCTL_PFINFO_=
LTAB_MASK;<br>
+ =A0 =A0 =A0 =A0if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTAB ||<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN ||<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0--countpages;<br>
+ =A0 =A0}<br>
<br>
=A0 =A0 =A0if (!countpages)<br>
=A0 =A0 =A0 =A0 =A0return count;<br>
@@ -1267,6 +1273,17 @@<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0/* a bogus/unmapped/allocate-only page: skip it =
*/<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0continue;<br>
<br>
+ =A0 =A0 =A0 =A0if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN )<br>
+ =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0if ( xc_set_broken_page_p2m(xch, dom, pfn) )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ERROR(&quot;Set p2m for broken page failed=
, &quot;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;dom=3D%d, pfn=3D%lx\n&qu=
ot;, dom, pfn);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto err_mapped;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0 =A0 =A0continue;<br>
+ =A0 =A0 =A0 =A0}<br>
+<br>
=A0 =A0 =A0 =A0 =A0if (pfn_err[i])<br>
=A0 =A0 =A0 =A0 =A0{<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0ERROR(&quot;unexpected PFN mapping failure pfn %=
lx map_mfn %lx p2m_mfn %lx&quot;,<br>
</div></div>diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_save=
.c<br>
<div class=3D"im">--- a/tools/libxc/xc_domain_save.c =A0 =A0 =A0Tue Nov 13 =
11:19:17 2012 +0000<br>
</div>+++ b/tools/libxc/xc_domain_save.c =A0 =A0 =A0Sat Nov 17 09:46:05 201=
2 +0800<br>
@@ -1118,7 +1118,7 @@<br>
=A0 =A0 =A0/* Now write out each data page, canonicalising page tables as w=
e go... */<br>
=A0 =A0 =A0for ( ; ; )<br>
=A0 =A0 =A0{<br>
- =A0 =A0 =A0 =A0unsigned int N, batch, run;<br>
+ =A0 =A0 =A0 =A0unsigned int N, batch, run, broken_page_num1, broken_page_=
num2;<br></blockquote><div><br>You need more descriptive variables here.=A0=
 Maybe &quot;broken_before_send&quot; and &quot;broken_after_send&quot;?<br=
>=A0</div>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
=A0 =A0 =A0 =A0 =A0char reportbuf[80];<br>
<br>
=A0 =A0 =A0 =A0 =A0snprintf(reportbuf, sizeof(reportbuf),<br>
@@ -1270,6 +1270,7 @@<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out;<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
<br>
+ =A0 =A0 =A0 =A0 =A0 =A0broken_page_num1 =3D 0;<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0for ( run =3D j =3D 0; j &lt; batch; j++ )<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0{<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0unsigned long gmfn =3D pfn_batch[j];<br>
@@ -1277,6 +1278,14 @@<br>
<div class=3D"im">=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( !hvm )<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0gmfn =3D pfn_to_mfn(gmfn);<br>
<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_=
BROKEN )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pfn_type[j] |=3D pfn_batch[j];<br>
</div>+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0++broken_page_num1;<br>
<div class=3D"im">+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0++run;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0continue;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
+<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( pfn_err[j] )<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( pfn_type[j] =3D=3D XEN_DOMC=
TL_PFINFO_XTAB )<br>
</div>@@ -1371,8 +1380,12 @@<br>
<div class=3D"im">=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* skip pages that aren&#39;t present or a=
re alloc-only */<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/*<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * skip pages that aren&#39;t present,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * or are broken, or are alloc-only<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 */<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_X=
TAB<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0|| pagetype =3D=3D XEN_DOMCTL_PFIN=
FO_BROKEN<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0|| pagetype =3D=3D XEN_DOMCTL_PF=
INFO_XALLOC )<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0continue;<br>
<br>
</div>@@ -1484,6 +1497,35 @@<br>
<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0munmap(region_base, batch*PAGE_SIZE);<br>
<br>
+ =A0 =A0 =A0 =A0 =A0 =A0/*<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 * if vMCE occur at last iter, do one more iter so=
 that it get<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 * chance to transfer broken page&#39;s pfn_type a=
nd pfn number to<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 * target and then take appropriate action<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 */<br></blockquote><div><br>Maybe, &quot;Pages ma=
y have broken between mapping them and sending them.=A0 Count the number of=
 broken pages after sending, and if there are more than before sending, do =
another iteration to make sure the pages are marked broken on the receiving=
 side&quot;?<br>
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex">
+ =A0 =A0 =A0 =A0 =A0 =A0if ( last_iter )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0{<br></blockquote><div><br>/* Read the p2m table a=
gain */<br>=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for ( j =3D 0; j &lt; batch; j++ )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( hvm )<br>
<div class=3D"im">+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pfn_type=
[j] =3D pfn_batch[j];<br>
</div>+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pfn_type[j] =3D pfn_to_mfn=
(pfn_batch[j]);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
+<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( xc_get_pfn_type_batch(xch, dom, batch=
, pfn_type) )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0PERROR(&quot;get_pfn_type_batch fa=
iled&quot;);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
+<br></blockquote><div><br>/* Count the number of broken pages */<br>=A0</d=
iv><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left=
:1px #ccc solid;padding-left:1ex">
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0broken_page_num2 =3D 0;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for ( j =3D 0; j &lt; batch; j++ )<br>
<div class=3D"im">+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( pfn_type[j]=
 =3D=3D XEN_DOMCTL_PFINFO_BROKEN )<br>
</div>+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0broken_page_num2++;<=
br>
+<br></blockquote><div><br>/* If there are more than before sending, do one=
 more iteration */<br>=A0</div><blockquote class=3D"gmail_quote" style=3D"m=
argin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( broken_page_num1 &lt; broken_page_num=
2 )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0last_iter =3D 0;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0}<br>
=A0 =A0 =A0 =A0 =A0} /* end of this while loop for this iteration */<br></b=
lockquote><div><br>I think that&#39;s all I have.<br><br>=A0-George<br></di=
v></div><br></div>

--001636d33d2a73b71e04cf005420--


--===============3369826934845018278==
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.xen.org
http://lists.xen.org/xen-devel

--===============3369826934845018278==--


From xen-devel-bounces@lists.xen.org Wed Nov 21 12:17:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 12:17:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb9Ey-00078V-CY; Wed, 21 Nov 2012 12:17:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1Tb9Ew-00078P-JP
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 12:17:15 +0000
Received: from [85.158.139.83:42019] by server-10.bemta-5.messagelabs.com id
	D7/23-09257-946CCA05; Wed, 21 Nov 2012 12:17:13 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1353500231!31257237!1
X-Originating-IP: [209.85.216.171]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10966 invoked from network); 21 Nov 2012 12:17:12 -0000
Received: from mail-qc0-f171.google.com (HELO mail-qc0-f171.google.com)
	(209.85.216.171)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 12:17:12 -0000
Received: by mail-qc0-f171.google.com with SMTP id d1so1012704qca.30
	for <xen-devel@lists.xensource.com>;
	Wed, 21 Nov 2012 04:17:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=MXq7K/YZUZl0Db2e3smVyuCd900bBg280CIR+WlLTqM=;
	b=lPpMhTHX/00xyExUHQyGt24mpHX9tX10Eas4edDDI2Mc6cR7Xv5EytU43X3W3dB70+
	sQQThttxSH6Jju/p+WHY8iDqTJt6lmVnpOivKiVdS43Ggs/NucpE6SdWMEdL9cwDoTXe
	9WGZlzzJ0D/WTtXH0f1D6zHtP9W4eEStyHIklsXKTaCjAdlLEBDcH2Yu2+4jiK/WCCAz
	+qfaFyH3d+V0Z5TVDSxNTfuS0hBAPig5qZIeWQNALWvIrmZ7Jmi/tqRIMihjQWj28qYv
	WCOlNeTly/gRo/RvDtnrW//GmHqzPbabKUSNvmB6+u7lepE2r9MpFNTYAQeuFpWgDzZM
	byKg==
MIME-Version: 1.0
Received: by 10.229.180.35 with SMTP id bs35mr4278649qcb.22.1353500230661;
	Wed, 21 Nov 2012 04:17:10 -0800 (PST)
Received: by 10.49.51.169 with HTTP; Wed, 21 Nov 2012 04:17:10 -0800 (PST)
In-Reply-To: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
Date: Wed, 21 Nov 2012 12:17:10 +0000
X-Google-Sender-Auth: NaFASRYcyRnr1OGQdrPrE22adRQ
Message-ID: <CAFLBxZZq5obGskT0BGKMqEY+Mj4OtY-9DyhAcdo5XU9bidL2zg@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Liu Jinsong <jinsong.liu@intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3369826934845018278=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============3369826934845018278==
Content-Type: multipart/alternative; boundary=001636d33d2a73b71e04cf005420

--001636d33d2a73b71e04cf005420
Content-Type: text/plain; charset=ISO-8859-1

OK, so now that we seem to have agreed on the overall approach, down to
"brass tacks", as we say in English:

On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <jinsong.liu@intel.com> wrote:

> Generally, there are 2 cases:
> 1. broken page occurs before migration
> 2. broken page occurs during migration
>

I think we probably need to include the "last iteration" subcases here as
well -- although, probably it would be better to put them in the comments.
Also make sure to note that now even suspend may do a second iteration if
pages are broken during the suspend operation.

Also, what you should do is have the main description always say what the
patch does, and then at the bottom have a summary of the changes; for
instance:

v4:
 - Adjust variables and patch description based on feedback
v3:
 - Handle pages broken on the last iteration
&c



> We had submitted 2 versions of patches. Their difference is how to handle
> case 2:
> V1 patch aborted migration for the case 'broken page occurs during
> migration';
> V2 patch marked broken page to dirty bitmap then got handled next round
> and no abort;
>
> This is V3 patch, adding handle for vMCE occur at last iteration of
> migration:
> At the sender
>   For case 1, the broken page will be mapped but not copied to target
>   (otherwise it may trigger more serious error, say, SRAR error).
>   While its pfn_type and pfn number will be transferred to target
>   so that target take appropriate action.
>
>   For case 2, mce handler marks the broken page to dirty bitmap, so that
>   at copypages stage of migration, its pfn_type and pfn number will be
>   transferred to target and then take appropriate action.
>
> At the target
>   When migration target populates pages for guest. As for the case
>   of broken page wrt migration, we prefer to keep the type of the page,
>   for the sake of seamless migration.
>
>   At target it will set p2m as p2m_ram_broken for broken page. Guest MCE
>   may have good chance to handle its broken page, while if guest access
>   the broken page again it will kill itself as expected.
>
> If vMCE occur at the last memory copy iteration of migration, we do one
> more
> iteration so that the broken page's pfn_type and pfn number has chance to
> be transferred to target.
>
> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
>
> - for tools part of the patch
> Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
>

You should remove these until you get another ack (since the patch has
changed materially)


>
> - for hypervisor part of the patch
> Acked-by: Jan Beulich <JBeulich@suse.com>
>

I think if you haven't changed the HV part since his ack, you can probably
leave this one.


>
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain.c
> --- a/tools/libxc/xc_domain.c   Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xc_domain.c   Sat Nov 17 09:46:05 2012 +0800
> @@ -283,6 +283,22 @@
>      return ret;
>  }
>
> +/* set broken page p2m */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn)
> +{
> +    int ret;
> +    DECLARE_DOMCTL;
> +
> +    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
> +    domctl.domain = (domid_t)domid;
> +    domctl.u.set_broken_page_p2m.pfn = pfn;
> +    ret = do_domctl(xch, &domctl);
> +
> +    return ret ? -1 : 0;
> +}
> +
>  /* get info from hvm guest for save */
>  int xc_domain_hvm_getcontext(xc_interface *xch,
>                               uint32_t domid,
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_restore.c
> --- a/tools/libxc/xc_domain_restore.c   Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xc_domain_restore.c   Sat Nov 17 09:46:05 2012 +0800
> @@ -1023,9 +1023,15 @@
>
>      countpages = count;
>      for (i = oldcount; i < buf->nr_pages; ++i)
> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
> XEN_DOMCTL_PFINFO_XTAB
> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
> XEN_DOMCTL_PFINFO_XALLOC)
> +    {
> +        unsigned long pagetype;
> +
> +        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
> +        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
> +             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
> +             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>              --countpages;
> +    }
>
>      if (!countpages)
>          return count;
> @@ -1267,6 +1273,17 @@
>              /* a bogus/unmapped/allocate-only page: skip it */
>              continue;
>
> +        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
> +        {
> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
> +            {
> +                ERROR("Set p2m for broken page failed, "
> +                      "dom=%d, pfn=%lx\n", dom, pfn);
> +                goto err_mapped;
> +            }
> +            continue;
> +        }
> +
>          if (pfn_err[i])
>          {
>              ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx
> p2m_mfn %lx",
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_save.c
> --- a/tools/libxc/xc_domain_save.c      Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xc_domain_save.c      Sat Nov 17 09:46:05 2012 +0800
> @@ -1118,7 +1118,7 @@
>      /* Now write out each data page, canonicalising page tables as we
> go... */
>      for ( ; ; )
>      {
> -        unsigned int N, batch, run;
> +        unsigned int N, batch, run, broken_page_num1, broken_page_num2;
>

You need more descriptive variables here.  Maybe "broken_before_send" and
"broken_after_send"?


>          char reportbuf[80];
>
>          snprintf(reportbuf, sizeof(reportbuf),
> @@ -1270,6 +1270,7 @@
>                  goto out;
>              }
>
> +            broken_page_num1 = 0;
>              for ( run = j = 0; j < batch; j++ )
>              {
>                  unsigned long gmfn = pfn_batch[j];
> @@ -1277,6 +1278,14 @@
>                  if ( !hvm )
>                      gmfn = pfn_to_mfn(gmfn);
>
> +                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                {
> +                    pfn_type[j] |= pfn_batch[j];
> +                    ++broken_page_num1;
> +                    ++run;
> +                    continue;
> +                }
> +
>                  if ( pfn_err[j] )
>                  {
>                      if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
> @@ -1371,8 +1380,12 @@
>                      }
>                  }
>
> -                /* skip pages that aren't present or are alloc-only */
> +                /*
> +                 * skip pages that aren't present,
> +                 * or are broken, or are alloc-only
> +                 */
>                  if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
> +                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
>                      || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>                      continue;
>
> @@ -1484,6 +1497,35 @@
>
>              munmap(region_base, batch*PAGE_SIZE);
>
> +            /*
> +             * if vMCE occur at last iter, do one more iter so that it get
> +             * chance to transfer broken page's pfn_type and pfn number to
> +             * target and then take appropriate action
> +             */
>

Maybe, "Pages may have broken between mapping them and sending them.  Count
the number of broken pages after sending, and if there are more than before
sending, do another iteration to make sure the pages are marked broken on
the receiving side"?


> +            if ( last_iter )
> +            {
>

/* Read the p2m table again */


> +                for ( j = 0; j < batch; j++ )
> +                {
> +                    if ( hvm )
> +                        pfn_type[j] = pfn_batch[j];
> +                    else
> +                        pfn_type[j] = pfn_to_mfn(pfn_batch[j]);
> +                }
> +
> +                if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
> +                {
> +                    PERROR("get_pfn_type_batch failed");
> +                    goto out;
> +                }
> +
>

/* Count the number of broken pages */


> +                broken_page_num2 = 0;
> +                for ( j = 0; j < batch; j++ )
> +                    if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                        broken_page_num2++;
> +
>

/* If there are more than before sending, do one more iteration */


> +                if ( broken_page_num1 < broken_page_num2 )
> +                    last_iter = 0;
> +            }
>          } /* end of this while loop for this iteration */
>

I think that's all I have.

 -George

--001636d33d2a73b71e04cf005420
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

OK, so now that we seem to have agreed on the overall approach, down to &qu=
ot;brass tacks&quot;, as we say in English:<br><br><div class=3D"gmail_extr=
a">On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:jinsong.liu@intel.com" target=3D"_blank">jinsong.liu@intel.com=
</a>&gt;</span> wrote:<br>
<div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=3D"im"=
>Generally, there are 2 cases:<br>
1. broken page occurs before migration<br>
2. broken page occurs during migration<br></div></blockquote><div><br>I thi=
nk we probably need to include the &quot;last iteration&quot; subcases here=
 as well -- although, probably it would be better to put them in the commen=
ts.=A0 Also make sure to note that now even suspend may do a second iterati=
on if pages are broken during the suspend operation.<br>
<br>Also, what you should do is have the main description always say what t=
he patch does, and then at the bottom have a summary of the changes; for in=
stance:<br><br>v4: <br>=A0- Adjust variables and patch description based on=
 feedback<br>
v3: <br>=A0- Handle pages broken on the last iteration<br>&amp;c<br>=A0<br>=
<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"><div class=3D"im">
<br>
</div>We had submitted 2 versions of patches. Their difference is how to ha=
ndle case 2:<br>
V1 patch aborted migration for the case &#39;broken page occurs during migr=
ation&#39;;<br>
V2 patch marked broken page to dirty bitmap then got handled next round and=
 no abort;<br>
<br>
This is V3 patch, adding handle for vMCE occur at last iteration of migrati=
on:<br>
At the sender<br>
=A0 For case 1, the broken page will be mapped but not copied to target<br>
<div class=3D"im">=A0 (otherwise it may trigger more serious error, say, SR=
AR error).<br>
</div>=A0 While its pfn_type and pfn number will be transferred to target<b=
r>
<div class=3D"im">=A0 so that target take appropriate action.<br>
<br>
=A0 For case 2, mce handler marks the broken page to dirty bitmap, so that<=
br>
</div>=A0 at copypages stage of migration, its pfn_type and pfn number will=
 be<br>
<div class=3D"im">=A0 transferred to target and then take appropriate actio=
n.<br>
<br>
At the target<br>
</div>=A0 When migration target populates pages for guest. As for the case<=
br>
=A0 of broken page wrt migration, we prefer to keep the type of the page,<b=
r>
<div class=3D"im">=A0 for the sake of seamless migration.<br>
<br>
</div>=A0 At target it will set p2m as p2m_ram_broken for broken page. Gues=
t MCE<br>
<div class=3D"im">=A0 may have good chance to handle its broken page, while=
 if guest access<br>
</div>=A0 the broken page again it will kill itself as expected.<br>
<br>
If vMCE occur at the last memory copy iteration of migration, we do one mor=
e<br>
iteration so that the broken page&#39;s pfn_type and pfn number has chance =
to<br>
be transferred to target.<br>
<div class=3D"im"><br>
Suggested-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.c=
om">george.dunlap@eu.citrix.com</a>&gt;<br>
Signed-off-by: Liu Jinsong &lt;<a href=3D"mailto:jinsong.liu@intel.com">jin=
song.liu@intel.com</a>&gt;<br>
Acked-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">=
george.dunlap@eu.citrix.com</a>&gt;<br>
<br>
</div>- for tools part of the patch<br>
Acked-by: Ian Jackson &lt;<a href=3D"mailto:Ian.Jackson@eu.citrix.com">Ian.=
Jackson@eu.citrix.com</a>&gt;<br></blockquote><div><br>You should remove th=
ese until you get another ack (since the patch has changed materially)<br>
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex">
<br>
- for hypervisor part of the patch<br>
Acked-by: Jan Beulich &lt;<a href=3D"mailto:JBeulich@suse.com">JBeulich@sus=
e.com</a>&gt;<br></blockquote><div><br>I think if you haven&#39;t changed t=
he HV part since his ack, you can probably leave this one.<br>=A0</div><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex">

<br>
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain.c<br>
<div class=3D"im">--- a/tools/libxc/xc_domain.c =A0 Tue Nov 13 11:19:17 201=
2 +0000<br>
</div>+++ b/tools/libxc/xc_domain.c =A0 Sat Nov 17 09:46:05 2012 +0800<br>
<div class=3D"im">@@ -283,6 +283,22 @@<br>
=A0 =A0 =A0return ret;<br>
=A0}<br>
<br>
+/* set broken page p2m */<br>
+int xc_set_broken_page_p2m(xc_interface *xch,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 uint32_t domid,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 unsigned long pfn)<br=
>
+{<br>
+ =A0 =A0int ret;<br>
+ =A0 =A0DECLARE_DOMCTL;<br>
+<br>
+ =A0 =A0domctl.cmd =3D XEN_DOMCTL_set_broken_page_p2m;<br>
+ =A0 =A0domctl.domain =3D (domid_t)domid;<br>
+ =A0 =A0domctl.u.set_broken_page_p2m.pfn =3D pfn;<br>
+ =A0 =A0ret =3D do_domctl(xch, &amp;domctl);<br>
+<br>
+ =A0 =A0return ret ? -1 : 0;<br>
+}<br>
+<br>
=A0/* get info from hvm guest for save */<br>
=A0int xc_domain_hvm_getcontext(xc_interface *xch,<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 uint32_t domid,=
<br>
</div>diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_restore.c<=
br>
<div class=3D"im">--- a/tools/libxc/xc_domain_restore.c =A0 Tue Nov 13 11:1=
9:17 2012 +0000<br>
</div>+++ b/tools/libxc/xc_domain_restore.c =A0 Sat Nov 17 09:46:05 2012 +0=
800<br>
<div><div class=3D"h5">@@ -1023,9 +1023,15 @@<br>
<br>
=A0 =A0 =A0countpages =3D count;<br>
=A0 =A0 =A0for (i =3D oldcount; i &lt; buf-&gt;nr_pages; ++i)<br>
- =A0 =A0 =A0 =A0if ((buf-&gt;pfn_types[i] &amp; XEN_DOMCTL_PFINFO_LTAB_MAS=
K) =3D=3D XEN_DOMCTL_PFINFO_XTAB<br>
- =A0 =A0 =A0 =A0 =A0 =A0||(buf-&gt;pfn_types[i] &amp; XEN_DOMCTL_PFINFO_LT=
AB_MASK) =3D=3D XEN_DOMCTL_PFINFO_XALLOC)<br>
+ =A0 =A0{<br>
+ =A0 =A0 =A0 =A0unsigned long pagetype;<br>
+<br>
+ =A0 =A0 =A0 =A0pagetype =3D buf-&gt;pfn_types[i] &amp; XEN_DOMCTL_PFINFO_=
LTAB_MASK;<br>
+ =A0 =A0 =A0 =A0if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTAB ||<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN ||<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0--countpages;<br>
+ =A0 =A0}<br>
<br>
=A0 =A0 =A0if (!countpages)<br>
=A0 =A0 =A0 =A0 =A0return count;<br>
@@ -1267,6 +1273,17 @@<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0/* a bogus/unmapped/allocate-only page: skip it =
*/<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0continue;<br>
<br>
+ =A0 =A0 =A0 =A0if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN )<br>
+ =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0if ( xc_set_broken_page_p2m(xch, dom, pfn) )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ERROR(&quot;Set p2m for broken page failed=
, &quot;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;dom=3D%d, pfn=3D%lx\n&qu=
ot;, dom, pfn);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto err_mapped;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0 =A0 =A0continue;<br>
+ =A0 =A0 =A0 =A0}<br>
+<br>
=A0 =A0 =A0 =A0 =A0if (pfn_err[i])<br>
=A0 =A0 =A0 =A0 =A0{<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0ERROR(&quot;unexpected PFN mapping failure pfn %=
lx map_mfn %lx p2m_mfn %lx&quot;,<br>
</div></div>diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_save=
.c<br>
<div class=3D"im">--- a/tools/libxc/xc_domain_save.c =A0 =A0 =A0Tue Nov 13 =
11:19:17 2012 +0000<br>
</div>+++ b/tools/libxc/xc_domain_save.c =A0 =A0 =A0Sat Nov 17 09:46:05 201=
2 +0800<br>
@@ -1118,7 +1118,7 @@<br>
=A0 =A0 =A0/* Now write out each data page, canonicalising page tables as w=
e go... */<br>
=A0 =A0 =A0for ( ; ; )<br>
=A0 =A0 =A0{<br>
- =A0 =A0 =A0 =A0unsigned int N, batch, run;<br>
+ =A0 =A0 =A0 =A0unsigned int N, batch, run, broken_page_num1, broken_page_=
num2;<br></blockquote><div><br>You need more descriptive variables here.=A0=
 Maybe &quot;broken_before_send&quot; and &quot;broken_after_send&quot;?<br=
>=A0</div>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
=A0 =A0 =A0 =A0 =A0char reportbuf[80];<br>
<br>
=A0 =A0 =A0 =A0 =A0snprintf(reportbuf, sizeof(reportbuf),<br>
@@ -1270,6 +1270,7 @@<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out;<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
<br>
+ =A0 =A0 =A0 =A0 =A0 =A0broken_page_num1 =3D 0;<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0for ( run =3D j =3D 0; j &lt; batch; j++ )<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0{<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0unsigned long gmfn =3D pfn_batch[j];<br>
@@ -1277,6 +1278,14 @@<br>
<div class=3D"im">=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( !hvm )<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0gmfn =3D pfn_to_mfn(gmfn);<br>
<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_=
BROKEN )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pfn_type[j] |=3D pfn_batch[j];<br>
</div>+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0++broken_page_num1;<br>
<div class=3D"im">+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0++run;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0continue;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
+<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( pfn_err[j] )<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( pfn_type[j] =3D=3D XEN_DOMC=
TL_PFINFO_XTAB )<br>
</div>@@ -1371,8 +1380,12 @@<br>
<div class=3D"im">=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* skip pages that aren&#39;t present or a=
re alloc-only */<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/*<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * skip pages that aren&#39;t present,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * or are broken, or are alloc-only<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 */<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_X=
TAB<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0|| pagetype =3D=3D XEN_DOMCTL_PFIN=
FO_BROKEN<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0|| pagetype =3D=3D XEN_DOMCTL_PF=
INFO_XALLOC )<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0continue;<br>
<br>
</div>@@ -1484,6 +1497,35 @@<br>
<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0munmap(region_base, batch*PAGE_SIZE);<br>
<br>
+ =A0 =A0 =A0 =A0 =A0 =A0/*<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 * if vMCE occur at last iter, do one more iter so=
 that it get<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 * chance to transfer broken page&#39;s pfn_type a=
nd pfn number to<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 * target and then take appropriate action<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 */<br></blockquote><div><br>Maybe, &quot;Pages ma=
y have broken between mapping them and sending them.=A0 Count the number of=
 broken pages after sending, and if there are more than before sending, do =
another iteration to make sure the pages are marked broken on the receiving=
 side&quot;?<br>
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex">
+ =A0 =A0 =A0 =A0 =A0 =A0if ( last_iter )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0{<br></blockquote><div><br>/* Read the p2m table a=
gain */<br>=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for ( j =3D 0; j &lt; batch; j++ )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( hvm )<br>
<div class=3D"im">+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pfn_type=
[j] =3D pfn_batch[j];<br>
</div>+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pfn_type[j] =3D pfn_to_mfn=
(pfn_batch[j]);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
+<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( xc_get_pfn_type_batch(xch, dom, batch=
, pfn_type) )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0PERROR(&quot;get_pfn_type_batch fa=
iled&quot;);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
+<br></blockquote><div><br>/* Count the number of broken pages */<br>=A0</d=
iv><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left=
:1px #ccc solid;padding-left:1ex">
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0broken_page_num2 =3D 0;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for ( j =3D 0; j &lt; batch; j++ )<br>
<div class=3D"im">+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( pfn_type[j]=
 =3D=3D XEN_DOMCTL_PFINFO_BROKEN )<br>
</div>+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0broken_page_num2++;<=
br>
+<br></blockquote><div><br>/* If there are more than before sending, do one=
 more iteration */<br>=A0</div><blockquote class=3D"gmail_quote" style=3D"m=
argin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ( broken_page_num1 &lt; broken_page_num=
2 )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0last_iter =3D 0;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0}<br>
=A0 =A0 =A0 =A0 =A0} /* end of this while loop for this iteration */<br></b=
lockquote><div><br>I think that&#39;s all I have.<br><br>=A0-George<br></di=
v></div><br></div>

--001636d33d2a73b71e04cf005420--


--===============3369826934845018278==
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.xen.org
http://lists.xen.org/xen-devel

--===============3369826934845018278==--


From xen-devel-bounces@lists.xen.org Wed Nov 21 12:22:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 12:22:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb9JU-0007Ic-4f; Wed, 21 Nov 2012 12:21:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1Tb9JS-0007IW-JN
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 12:21:54 +0000
Received: from [193.109.254.147:61830] by server-10.bemta-14.messagelabs.com
	id AE/88-31741-167CCA05; Wed, 21 Nov 2012 12:21:53 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353500497!9079744!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUyNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16669 invoked from network); 21 Nov 2012 12:21:38 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 12:21:38 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="45283045"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 12:21:28 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 07:21:28 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1Tb9J1-0008CD-NQ;
	Wed, 21 Nov 2012 12:21:27 +0000
Message-ID: <50ACC5F9.4090703@eu.citrix.com>
Date: Wed, 21 Nov 2012 12:15:53 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
	<50ACBC50.4040204@eu.citrix.com>
	<1353499905.13542.139.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353499905.13542.139.camel@zakaz.uk.xensource.com>
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 21/11/12 12:11, Ian Campbell wrote:
> On Wed, 2012-11-21 at 11:34 +0000, George Dunlap wrote:
>> On 20/11/12 18:42, Ian Jackson wrote:
>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard to migration"):
>>>> Ian Jackson wrote:
>>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>>>> broken page with regard to migration"):
>>>>>> No, at last lter, there are 4 points:
>>>>>> 1. start last iter
>>>>>> 2. get and transfer pfn_type to target
>>>>>> 3. copy page to target
>>>>>> 4. end last iter
>>> ...
>>>> It indeed checks mce after point 3 for each page, but what's the
>>>> advantage of keeping a separate list?
>>> It avoids yet another loop over all the pages.  Unless I have
>>> misunderstood.  Which I may have, because: if it checks for mce after
>>> point 3 then surely that is sufficient ?  We don't need to worry about
>>> mces after that check.
>> It's sufficient, but wouldn't each check require a separate hypercall?
>> That would surely be slower than just a single hypercall and a loop
>> (which is what Jinsong's patch does).
>>
>> We don't actually need a list -- I think we just need to know, "Have any
>> pages broken between reading the p2m table ( xc_get_pfn_type_batch() );
>> if so, we do another full iteration.
> If a page fails between 2. and 3. above then what happens at point 3? I
> presume we can't map and send the page (since it is broken), do we get
> some sort of failure to map?

At that point the pages are already mapped.  The order is:
1. From dirty bitmap / whatever, get a batch of pfns to map
2. Map them with foreign_batch
3. Read the p2m table
4. Send a list of PFNs (this is where it will list the broken ones)
5. Send all the data from those pfns

So JS is adding:

6. Read the p2m table again to see if anything has broken between 3 and 
the end of 5

> What happens if the failure occurs during stage 3, i.e. while the page
> is mapped and we are reading from it?

I was rather wondering the same thing. :-)

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 12:22:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 12:22:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb9JU-0007Ic-4f; Wed, 21 Nov 2012 12:21:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1Tb9JS-0007IW-JN
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 12:21:54 +0000
Received: from [193.109.254.147:61830] by server-10.bemta-14.messagelabs.com
	id AE/88-31741-167CCA05; Wed, 21 Nov 2012 12:21:53 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353500497!9079744!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUyNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16669 invoked from network); 21 Nov 2012 12:21:38 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 12:21:38 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="45283045"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 12:21:28 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 07:21:28 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1Tb9J1-0008CD-NQ;
	Wed, 21 Nov 2012 12:21:27 +0000
Message-ID: <50ACC5F9.4090703@eu.citrix.com>
Date: Wed, 21 Nov 2012 12:15:53 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
	<50ACBC50.4040204@eu.citrix.com>
	<1353499905.13542.139.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353499905.13542.139.camel@zakaz.uk.xensource.com>
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 21/11/12 12:11, Ian Campbell wrote:
> On Wed, 2012-11-21 at 11:34 +0000, George Dunlap wrote:
>> On 20/11/12 18:42, Ian Jackson wrote:
>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard to migration"):
>>>> Ian Jackson wrote:
>>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>>>> broken page with regard to migration"):
>>>>>> No, at last lter, there are 4 points:
>>>>>> 1. start last iter
>>>>>> 2. get and transfer pfn_type to target
>>>>>> 3. copy page to target
>>>>>> 4. end last iter
>>> ...
>>>> It indeed checks mce after point 3 for each page, but what's the
>>>> advantage of keeping a separate list?
>>> It avoids yet another loop over all the pages.  Unless I have
>>> misunderstood.  Which I may have, because: if it checks for mce after
>>> point 3 then surely that is sufficient ?  We don't need to worry about
>>> mces after that check.
>> It's sufficient, but wouldn't each check require a separate hypercall?
>> That would surely be slower than just a single hypercall and a loop
>> (which is what Jinsong's patch does).
>>
>> We don't actually need a list -- I think we just need to know, "Have any
>> pages broken between reading the p2m table ( xc_get_pfn_type_batch() );
>> if so, we do another full iteration.
> If a page fails between 2. and 3. above then what happens at point 3? I
> presume we can't map and send the page (since it is broken), do we get
> some sort of failure to map?

At that point the pages are already mapped.  The order is:
1. From dirty bitmap / whatever, get a batch of pfns to map
2. Map them with foreign_batch
3. Read the p2m table
4. Send a list of PFNs (this is where it will list the broken ones)
5. Send all the data from those pfns

So JS is adding:

6. Read the p2m table again to see if anything has broken between 3 and 
the end of 5

> What happens if the failure occurs during stage 3, i.e. while the page
> is mapped and we are reading from it?

I was rather wondering the same thing. :-)

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 12:45:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 12:45:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb9fz-0007jZ-DB; Wed, 21 Nov 2012 12:45:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Tb9fy-0007jR-18
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 12:45:10 +0000
Received: from [85.158.143.99:58568] by server-2.bemta-4.messagelabs.com id
	93/7C-28922-5DCCCA05; Wed, 21 Nov 2012 12:45:09 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1353501908!29892983!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21387 invoked from network); 21 Nov 2012 12:45:08 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-13.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 12:45:08 -0000
Received: by mail-wi0-f173.google.com with SMTP id hm11so1567294wib.14
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 04:45:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=f55hguzWncKPDa8ntbBwEP5O4dM2iM/2APLGo9Qy7wM=;
	b=biRLxfKCcTs5EYYe0co5zUYBV+6M25eAv5gbjy63RiJzk1OutrnWyhrD0FX4f/kbbF
	PjY+LikXxFvAYLm8WZ13GvK27Qp6sR1RwBpD9eODSLYq0aGpGiXDlVeedYP/QneQmtJN
	BShq+PKozUWyNOeyGZ8rP5j+0NZSArt0EAjOQ3oyz+5yCDagXPraj4ioHipxWH2/F+eB
	XqBxURCDKiHGznlvYw2tXRo250kFYAvYcGTnGYqaCMqimKpyHt0Mw0FBR7S4r6a5JVC1
	ia7j50vHYFbOOop/rVtqItNFUhSOsdHhelSEubSRsXwPFRReLMX0fMuJJW1R7BLDpcjv
	qGPw==
Received: by 10.216.143.71 with SMTP id k49mr2210713wej.7.1353501907823;
	Wed, 21 Nov 2012 04:45:07 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id p2sm8997wic.7.2012.11.21.04.45.05
	(version=SSLv3 cipher=OTHER); Wed, 21 Nov 2012 04:45:07 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 21 Nov 2012 12:45:03 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCD27D4F.451D1%keir.xen@gmail.com>
Thread-Topic: [PATCH 5/5 v2] VT-d: adjust IOMMU interrupt affinities when all
	CPUs are online
Thread-Index: Ac3H5gaOhs8BrwDXlE+8S93ftZPkzw==
In-Reply-To: <50ACD36702000078000AA5B3@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: Re: [Xen-devel] [PATCH 5/5 v2] VT-d: adjust IOMMU interrupt
 affinities when all CPUs are online
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 21/11/2012 12:13, "Jan Beulich" <JBeulich@suse.com> wrote:

> Since these interrupts get setup before APs get brought online, their
> affinities naturally could only ever point to CPU 0 alone so far.
> Adjust this to include potentially multiple CPUs in the target mask
> (when running in one of the cluster modes), and take into account NUMA
> information (to handle the interrupts on a CPU on the node where the
> respective IOMMU is).
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> ---
> v2: Call adjust_vtd_irq_affinities() explicitly from enter_state()
>     rather than through acpi_dmar_zap().
> 
> --- a/xen/arch/x86/acpi/power.c
> +++ b/xen/arch/x86/acpi/power.c
> @@ -219,6 +219,7 @@ static int enter_state(u32 state)
>      mtrr_aps_sync_begin();
>      enable_nonboot_cpus();
>      mtrr_aps_sync_end();
> +    adjust_vtd_irq_affinities();
>      acpi_dmar_zap();
>      thaw_domains();
>      system_state = SYS_STATE_active;
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -1971,6 +1971,33 @@ void clear_fault_bits(struct iommu *iomm
>      spin_unlock_irqrestore(&iommu->register_lock, flags);
>  }
>  
> +static void adjust_irq_affinity(struct acpi_drhd_unit *drhd)
> +{
> +    const struct acpi_rhsa_unit *rhsa = drhd_to_rhsa(drhd);
> +    unsigned int node = rhsa ? pxm_to_node(rhsa->proximity_domain)
> +                             : NUMA_NO_NODE;
> +    const cpumask_t *cpumask = &cpu_online_map;
> +
> +    if ( node < MAX_NUMNODES && node_online(node) &&
> +         cpumask_intersects(&node_to_cpumask(node), cpumask) )
> +        cpumask = &node_to_cpumask(node);
> +    dma_msi_set_affinity(irq_to_desc(drhd->iommu->msi.irq), cpumask);
> +}
> +
> +int adjust_vtd_irq_affinities(void)
> +{
> +    struct acpi_drhd_unit *drhd;
> +
> +    if ( !iommu_enabled )
> +        return 0;
> +
> +    for_each_drhd_unit ( drhd )
> +        adjust_irq_affinity(drhd);
> +
> +    return 0;
> +}
> +__initcall(adjust_vtd_irq_affinities);
> +
>  static int init_vtd_hw(void)
>  {
>      struct acpi_drhd_unit *drhd;
> @@ -1984,13 +2011,10 @@ static int init_vtd_hw(void)
>       */
>      for_each_drhd_unit ( drhd )
>      {
> -        struct irq_desc *desc;
> +        adjust_irq_affinity(drhd);
>  
>          iommu = drhd->iommu;
>  
> -        desc = irq_to_desc(iommu->msi.irq);
> -        dma_msi_set_affinity(desc, desc->arch.cpu_mask);
> -
>          clear_fault_bits(iommu);
>  
>          spin_lock_irqsave(&iommu->register_lock, flags);
> --- a/xen/include/xen/iommu.h
> +++ b/xen/include/xen/iommu.h
> @@ -137,6 +137,9 @@ int iommu_do_domctl(struct xen_domctl *,
>  void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int
> page_count);
>  void iommu_iotlb_flush_all(struct domain *d);
>  
> +/* While VT-d specific, this must get declared in a generic header. */
> +int adjust_vtd_irq_affinities(void);
> +
>  /*
>   * The purpose of the iommu_dont_flush_iotlb optional cpu flag is to
>   * avoid unecessary iotlb_flush in the low level IOMMU code.
> 
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 12:45:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 12:45:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tb9fz-0007jZ-DB; Wed, 21 Nov 2012 12:45:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Tb9fy-0007jR-18
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 12:45:10 +0000
Received: from [85.158.143.99:58568] by server-2.bemta-4.messagelabs.com id
	93/7C-28922-5DCCCA05; Wed, 21 Nov 2012 12:45:09 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1353501908!29892983!1
X-Originating-IP: [209.85.212.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21387 invoked from network); 21 Nov 2012 12:45:08 -0000
Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com)
	(209.85.212.173)
	by server-13.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 12:45:08 -0000
Received: by mail-wi0-f173.google.com with SMTP id hm11so1567294wib.14
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 04:45:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=f55hguzWncKPDa8ntbBwEP5O4dM2iM/2APLGo9Qy7wM=;
	b=biRLxfKCcTs5EYYe0co5zUYBV+6M25eAv5gbjy63RiJzk1OutrnWyhrD0FX4f/kbbF
	PjY+LikXxFvAYLm8WZ13GvK27Qp6sR1RwBpD9eODSLYq0aGpGiXDlVeedYP/QneQmtJN
	BShq+PKozUWyNOeyGZ8rP5j+0NZSArt0EAjOQ3oyz+5yCDagXPraj4ioHipxWH2/F+eB
	XqBxURCDKiHGznlvYw2tXRo250kFYAvYcGTnGYqaCMqimKpyHt0Mw0FBR7S4r6a5JVC1
	ia7j50vHYFbOOop/rVtqItNFUhSOsdHhelSEubSRsXwPFRReLMX0fMuJJW1R7BLDpcjv
	qGPw==
Received: by 10.216.143.71 with SMTP id k49mr2210713wej.7.1353501907823;
	Wed, 21 Nov 2012 04:45:07 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id p2sm8997wic.7.2012.11.21.04.45.05
	(version=SSLv3 cipher=OTHER); Wed, 21 Nov 2012 04:45:07 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 21 Nov 2012 12:45:03 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCD27D4F.451D1%keir.xen@gmail.com>
Thread-Topic: [PATCH 5/5 v2] VT-d: adjust IOMMU interrupt affinities when all
	CPUs are online
Thread-Index: Ac3H5gaOhs8BrwDXlE+8S93ftZPkzw==
In-Reply-To: <50ACD36702000078000AA5B3@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com, Gang Wei <gang.wei@intel.com>
Subject: Re: [Xen-devel] [PATCH 5/5 v2] VT-d: adjust IOMMU interrupt
 affinities when all CPUs are online
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 21/11/2012 12:13, "Jan Beulich" <JBeulich@suse.com> wrote:

> Since these interrupts get setup before APs get brought online, their
> affinities naturally could only ever point to CPU 0 alone so far.
> Adjust this to include potentially multiple CPUs in the target mask
> (when running in one of the cluster modes), and take into account NUMA
> information (to handle the interrupts on a CPU on the node where the
> respective IOMMU is).
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> ---
> v2: Call adjust_vtd_irq_affinities() explicitly from enter_state()
>     rather than through acpi_dmar_zap().
> 
> --- a/xen/arch/x86/acpi/power.c
> +++ b/xen/arch/x86/acpi/power.c
> @@ -219,6 +219,7 @@ static int enter_state(u32 state)
>      mtrr_aps_sync_begin();
>      enable_nonboot_cpus();
>      mtrr_aps_sync_end();
> +    adjust_vtd_irq_affinities();
>      acpi_dmar_zap();
>      thaw_domains();
>      system_state = SYS_STATE_active;
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -1971,6 +1971,33 @@ void clear_fault_bits(struct iommu *iomm
>      spin_unlock_irqrestore(&iommu->register_lock, flags);
>  }
>  
> +static void adjust_irq_affinity(struct acpi_drhd_unit *drhd)
> +{
> +    const struct acpi_rhsa_unit *rhsa = drhd_to_rhsa(drhd);
> +    unsigned int node = rhsa ? pxm_to_node(rhsa->proximity_domain)
> +                             : NUMA_NO_NODE;
> +    const cpumask_t *cpumask = &cpu_online_map;
> +
> +    if ( node < MAX_NUMNODES && node_online(node) &&
> +         cpumask_intersects(&node_to_cpumask(node), cpumask) )
> +        cpumask = &node_to_cpumask(node);
> +    dma_msi_set_affinity(irq_to_desc(drhd->iommu->msi.irq), cpumask);
> +}
> +
> +int adjust_vtd_irq_affinities(void)
> +{
> +    struct acpi_drhd_unit *drhd;
> +
> +    if ( !iommu_enabled )
> +        return 0;
> +
> +    for_each_drhd_unit ( drhd )
> +        adjust_irq_affinity(drhd);
> +
> +    return 0;
> +}
> +__initcall(adjust_vtd_irq_affinities);
> +
>  static int init_vtd_hw(void)
>  {
>      struct acpi_drhd_unit *drhd;
> @@ -1984,13 +2011,10 @@ static int init_vtd_hw(void)
>       */
>      for_each_drhd_unit ( drhd )
>      {
> -        struct irq_desc *desc;
> +        adjust_irq_affinity(drhd);
>  
>          iommu = drhd->iommu;
>  
> -        desc = irq_to_desc(iommu->msi.irq);
> -        dma_msi_set_affinity(desc, desc->arch.cpu_mask);
> -
>          clear_fault_bits(iommu);
>  
>          spin_lock_irqsave(&iommu->register_lock, flags);
> --- a/xen/include/xen/iommu.h
> +++ b/xen/include/xen/iommu.h
> @@ -137,6 +137,9 @@ int iommu_do_domctl(struct xen_domctl *,
>  void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int
> page_count);
>  void iommu_iotlb_flush_all(struct domain *d);
>  
> +/* While VT-d specific, this must get declared in a generic header. */
> +int adjust_vtd_irq_affinities(void);
> +
>  /*
>   * The purpose of the iommu_dont_flush_iotlb optional cpu flag is to
>   * avoid unecessary iotlb_flush in the low level IOMMU code.
> 
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 13:28:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 13:28:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbALq-0008E3-Ua; Wed, 21 Nov 2012 13:28:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TbALo-0008Dy-O0
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 13:28:24 +0000
Received: from [193.109.254.147:39595] by server-13.bemta-14.messagelabs.com
	id 4A/B2-11239-8F6DCA05; Wed, 21 Nov 2012 13:28:24 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1353504389!9033361!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzI0MDgy\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27343 invoked from network); 21 Nov 2012 13:26:30 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-13.tower-27.messagelabs.com with SMTP;
	21 Nov 2012 13:26:30 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga101.jf.intel.com with ESMTP; 21 Nov 2012 05:26:28 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,293,1352102400"; d="scan'208";a="245327938"
Received: from fmsmsx107.amr.corp.intel.com ([10.19.9.54])
	by orsmga002.jf.intel.com with ESMTP; 21 Nov 2012 05:26:28 -0800
Received: from fmsmsx102.amr.corp.intel.com (10.19.9.53) by
	FMSMSX107.amr.corp.intel.com (10.19.9.54) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 05:26:28 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX102.amr.corp.intel.com (10.19.9.53) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 05:26:27 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 21:26:26 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, George Dunlap
	<george.dunlap@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNx+FfWSR52N+j5UqhK6CjagaIUZf0RDoA
Date: Wed, 21 Nov 2012 13:26:25 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353944A2@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
	<50ACBC50.4040204@eu.citrix.com>
	<1353499905.13542.139.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353499905.13542.139.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell wrote:
> On Wed, 2012-11-21 at 11:34 +0000, George Dunlap wrote:
>> On 20/11/12 18:42, Ian Jackson wrote:
>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>> broken page with regard to migration"): 
>>>> Ian Jackson wrote:
>>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>>>> broken page with regard to migration"):
>>>>>> No, at last lter, there are 4 points:
>>>>>> 1. start last iter
>>>>>> 2. get and transfer pfn_type to target
>>>>>> 3. copy page to target
>>>>>> 4. end last iter
>>> ...
>>>> It indeed checks mce after point 3 for each page, but what's the
>>>> advantage of keeping a separate list?
>>> It avoids yet another loop over all the pages.  Unless I have
>>> misunderstood.  Which I may have, because: if it checks for mce
>>> after 
>>> point 3 then surely that is sufficient ?  We don't need to worry
>>> about 
>>> mces after that check.
>> 
>> It's sufficient, but wouldn't each check require a separate
>> hypercall? That would surely be slower than just a single hypercall
>> and a loop (which is what Jinsong's patch does).
>> 
>> We don't actually need a list -- I think we just need to know, "Have
>> any pages broken between reading the p2m table (
>> xc_get_pfn_type_batch() ); if so, we do another full iteration.
> 
> If a page fails between 2. and 3. above then what happens at point 3?
> I presume we can't map and send the page (since it is broken), do we
> get some sort of failure to map?
> 
> What happens if the failure occurs during stage 3, i.e. while the page
> is mapped and we are reading from it?
> 
> Ian.

If read a broken page, it generates more serious error (say, SRAR error).
I don't think guest has good opportunity to survive under this case --> most probably it kill itself and of course we don't need care migration now.
However, if guest can luckly survive (say complete broken page copying to target), it's OK to continue --> its broken pfn_type will transfer to target next iter so guest will kill itself if access then.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 13:28:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 13:28:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbALq-0008E3-Ua; Wed, 21 Nov 2012 13:28:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TbALo-0008Dy-O0
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 13:28:24 +0000
Received: from [193.109.254.147:39595] by server-13.bemta-14.messagelabs.com
	id 4A/B2-11239-8F6DCA05; Wed, 21 Nov 2012 13:28:24 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1353504389!9033361!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzI0MDgy\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27343 invoked from network); 21 Nov 2012 13:26:30 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-13.tower-27.messagelabs.com with SMTP;
	21 Nov 2012 13:26:30 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga101.jf.intel.com with ESMTP; 21 Nov 2012 05:26:28 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,293,1352102400"; d="scan'208";a="245327938"
Received: from fmsmsx107.amr.corp.intel.com ([10.19.9.54])
	by orsmga002.jf.intel.com with ESMTP; 21 Nov 2012 05:26:28 -0800
Received: from fmsmsx102.amr.corp.intel.com (10.19.9.53) by
	FMSMSX107.amr.corp.intel.com (10.19.9.54) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 05:26:28 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX102.amr.corp.intel.com (10.19.9.53) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 05:26:27 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 21:26:26 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, George Dunlap
	<george.dunlap@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNx+FfWSR52N+j5UqhK6CjagaIUZf0RDoA
Date: Wed, 21 Nov 2012 13:26:25 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353944A2@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
	<50ACBC50.4040204@eu.citrix.com>
	<1353499905.13542.139.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353499905.13542.139.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell wrote:
> On Wed, 2012-11-21 at 11:34 +0000, George Dunlap wrote:
>> On 20/11/12 18:42, Ian Jackson wrote:
>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>> broken page with regard to migration"): 
>>>> Ian Jackson wrote:
>>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>>>> broken page with regard to migration"):
>>>>>> No, at last lter, there are 4 points:
>>>>>> 1. start last iter
>>>>>> 2. get and transfer pfn_type to target
>>>>>> 3. copy page to target
>>>>>> 4. end last iter
>>> ...
>>>> It indeed checks mce after point 3 for each page, but what's the
>>>> advantage of keeping a separate list?
>>> It avoids yet another loop over all the pages.  Unless I have
>>> misunderstood.  Which I may have, because: if it checks for mce
>>> after 
>>> point 3 then surely that is sufficient ?  We don't need to worry
>>> about 
>>> mces after that check.
>> 
>> It's sufficient, but wouldn't each check require a separate
>> hypercall? That would surely be slower than just a single hypercall
>> and a loop (which is what Jinsong's patch does).
>> 
>> We don't actually need a list -- I think we just need to know, "Have
>> any pages broken between reading the p2m table (
>> xc_get_pfn_type_batch() ); if so, we do another full iteration.
> 
> If a page fails between 2. and 3. above then what happens at point 3?
> I presume we can't map and send the page (since it is broken), do we
> get some sort of failure to map?
> 
> What happens if the failure occurs during stage 3, i.e. while the page
> is mapped and we are reading from it?
> 
> Ian.

If read a broken page, it generates more serious error (say, SRAR error).
I don't think guest has good opportunity to survive under this case --> most probably it kill itself and of course we don't need care migration now.
However, if guest can luckly survive (say complete broken page copying to target), it's OK to continue --> its broken pfn_type will transfer to target next iter so guest will kill itself if access then.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 13:31:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 13:31:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbAOr-0008Nq-Hr; Wed, 21 Nov 2012 13:31:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TbAOp-0008Nd-Lt
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 13:31:32 +0000
Received: from [193.109.254.147:8878] by server-7.bemta-14.messagelabs.com id
	91/17-02272-3B7DCA05; Wed, 21 Nov 2012 13:31:31 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1353504685!10542290!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjMyODQz\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26957 invoked from network); 21 Nov 2012 13:31:26 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-16.tower-27.messagelabs.com with SMTP;
	21 Nov 2012 13:31:26 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga102.ch.intel.com with ESMTP; 21 Nov 2012 05:31:24 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,293,1352102400"; 
	d="scan'208,217";a="220637463"
Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37])
	by azsmga001.ch.intel.com with ESMTP; 21 Nov 2012 05:31:23 -0800
Received: from fmsmsx119.amr.corp.intel.com (10.18.22.143) by
	FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 05:31:23 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	fmsmsx119.amr.corp.intel.com (10.18.22.143) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 05:31:22 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 21:31:21 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNx+IhWSR52N+j5UqhK6CjagaIUZf0SOuw
Date: Wed, 21 Nov 2012 13:31:21 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353944E5@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZZq5obGskT0BGKMqEY+Mj4OtY-9DyhAcdo5XU9bidL2zg@mail.gmail.com>
In-Reply-To: <CAFLBxZZq5obGskT0BGKMqEY+Mj4OtY-9DyhAcdo5XU9bidL2zg@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7923967199936632013=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============7923967199936632013==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_DE8DF0795D48FD4CA783C40EC82923353944E5SHSMSX101ccrcorpi_"

--_000_DE8DF0795D48FD4CA783C40EC82923353944E5SHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Yes, I will update and send V4 later.

Thanks,
Jinsong

________________________________
From: dunlapg@gmail.com [mailto:dunlapg@gmail.com] On Behalf Of George Dunl=
ap
Sent: Wednesday, November 21, 2012 8:17 PM
To: Liu, Jinsong
Cc: Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regar=
d to migration

OK, so now that we seem to have agreed on the overall approach, down to "br=
ass tacks", as we say in English:

On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <jinsong.liu@intel.com<mailto:=
jinsong.liu@intel.com>> wrote:
Generally, there are 2 cases:
1. broken page occurs before migration
2. broken page occurs during migration

I think we probably need to include the "last iteration" subcases here as w=
ell -- although, probably it would be better to put them in the comments.  =
Also make sure to note that now even suspend may do a second iteration if p=
ages are broken during the suspend operation.

Also, what you should do is have the main description always say what the p=
atch does, and then at the bottom have a summary of the changes; for instan=
ce:

v4:
 - Adjust variables and patch description based on feedback
v3:
 - Handle pages broken on the last iteration
&c



We had submitted 2 versions of patches. Their difference is how to handle c=
ase 2:
V1 patch aborted migration for the case 'broken page occurs during migratio=
n';
V2 patch marked broken page to dirty bitmap then got handled next round and=
 no abort;

This is V3 patch, adding handle for vMCE occur at last iteration of migrati=
on:
At the sender
  For case 1, the broken page will be mapped but not copied to target
  (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number will be transferred to target
  so that target take appropriate action.

  For case 2, mce handler marks the broken page to dirty bitmap, so that
  at copypages stage of migration, its pfn_type and pfn number will be
  transferred to target and then take appropriate action.

At the target
  When migration target populates pages for guest. As for the case
  of broken page wrt migration, we prefer to keep the type of the page,
  for the sake of seamless migration.

  At target it will set p2m as p2m_ram_broken for broken page. Guest MCE
  may have good chance to handle its broken page, while if guest access
  the broken page again it will kill itself as expected.

If vMCE occur at the last memory copy iteration of migration, we do one mor=
e
iteration so that the broken page's pfn_type and pfn number has chance to
be transferred to target.

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunl=
ap@eu.citrix.com>>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com<mailto:jinsong.liu@intel.=
com>>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunlap@e=
u.citrix.com>>

- for tools part of the patch
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com<mailto:Ian.Jackson@eu.citr=
ix.com>>

You should remove these until you get another ack (since the patch has chan=
ged materially)


- for hypervisor part of the patch
Acked-by: Jan Beulich <JBeulich@suse.com<mailto:JBeulich@suse.com>>

I think if you haven't changed the HV part since his ack, you can probably =
leave this one.


diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c   Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain.c   Sat Nov 17 09:46:05 2012 +0800
@@ -283,6 +283,22 @@
     return ret;
 }

+/* set broken page p2m */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn)
+{
+    int ret;
+    DECLARE_DOMCTL;
+
+    domctl.cmd =3D XEN_DOMCTL_set_broken_page_p2m;
+    domctl.domain =3D (domid_t)domid;
+    domctl.u.set_broken_page_p2m.pfn =3D pfn;
+    ret =3D do_domctl(xch, &domctl);
+
+    return ret ? -1 : 0;
+}
+
 /* get info from hvm guest for save */
 int xc_domain_hvm_getcontext(xc_interface *xch,
                              uint32_t domid,
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c   Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_restore.c   Sat Nov 17 09:46:05 2012 +0800
@@ -1023,9 +1023,15 @@

     countpages =3D count;
     for (i =3D oldcount; i < buf->nr_pages; ++i)
-        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) =3D=3D XEN_D=
OMCTL_PFINFO_XTAB
-            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) =3D=3D XEN=
_DOMCTL_PFINFO_XALLOC)
+    {
+        unsigned long pagetype;
+
+        pagetype =3D buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
+        if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTAB ||
+             pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN ||
+             pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )
             --countpages;
+    }

     if (!countpages)
         return count;
@@ -1267,6 +1273,17 @@
             /* a bogus/unmapped/allocate-only page: skip it */
             continue;

+        if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN )
+        {
+            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
+            {
+                ERROR("Set p2m for broken page failed, "
+                      "dom=3D%d, pfn=3D%lx\n", dom, pfn);
+                goto err_mapped;
+            }
+            continue;
+        }
+
         if (pfn_err[i])
         {
             ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_=
mfn %lx",
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c      Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_save.c      Sat Nov 17 09:46:05 2012 +0800
@@ -1118,7 +1118,7 @@
     /* Now write out each data page, canonicalising page tables as we go..=
. */
     for ( ; ; )
     {
-        unsigned int N, batch, run;
+        unsigned int N, batch, run, broken_page_num1, broken_page_num2;

You need more descriptive variables here.  Maybe "broken_before_send" and "=
broken_after_send"?

         char reportbuf[80];

         snprintf(reportbuf, sizeof(reportbuf),
@@ -1270,6 +1270,7 @@
                 goto out;
             }

+            broken_page_num1 =3D 0;
             for ( run =3D j =3D 0; j < batch; j++ )
             {
                 unsigned long gmfn =3D pfn_batch[j];
@@ -1277,6 +1278,14 @@
                 if ( !hvm )
                     gmfn =3D pfn_to_mfn(gmfn);

+                if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_BROKEN )
+                {
+                    pfn_type[j] |=3D pfn_batch[j];
+                    ++broken_page_num1;
+                    ++run;
+                    continue;
+                }
+
                 if ( pfn_err[j] )
                 {
                     if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_XTAB )
@@ -1371,8 +1380,12 @@
                     }
                 }

-                /* skip pages that aren't present or are alloc-only */
+                /*
+                 * skip pages that aren't present,
+                 * or are broken, or are alloc-only
+                 */
                 if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTAB
+                    || pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN
                     || pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )
                     continue;

@@ -1484,6 +1497,35 @@

             munmap(region_base, batch*PAGE_SIZE);

+            /*
+             * if vMCE occur at last iter, do one more iter so that it get
+             * chance to transfer broken page's pfn_type and pfn number to
+             * target and then take appropriate action
+             */

Maybe, "Pages may have broken between mapping them and sending them.  Count=
 the number of broken pages after sending, and if there are more than befor=
e sending, do another iteration to make sure the pages are marked broken on=
 the receiving side"?

+            if ( last_iter )
+            {

/* Read the p2m table again */

+                for ( j =3D 0; j < batch; j++ )
+                {
+                    if ( hvm )
+                        pfn_type[j] =3D pfn_batch[j];
+                    else
+                        pfn_type[j] =3D pfn_to_mfn(pfn_batch[j]);
+                }
+
+                if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
+                {
+                    PERROR("get_pfn_type_batch failed");
+                    goto out;
+                }
+

/* Count the number of broken pages */

+                broken_page_num2 =3D 0;
+                for ( j =3D 0; j < batch; j++ )
+                    if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_BROKEN )
+                        broken_page_num2++;
+

/* If there are more than before sending, do one more iteration */

+                if ( broken_page_num1 < broken_page_num2 )
+                    last_iter =3D 0;
+            }
         } /* end of this while loop for this iteration */

I think that's all I have.

 -George


--_000_DE8DF0795D48FD4CA783C40EC82923353944E5SHSMSX101ccrcorpi_
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=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"GENERATOR" content=3D"MSHTML 8.00.6001.19328">
</head>
<body>
<div dir=3D"ltr" align=3D"left"><span class=3D"275163013-21112012"><font co=
lor=3D"#0000ff" size=3D"2" face=3D"&#23435;&#20307;">Yes, I will update and=
 send V4 later.</font></span></div>
<div dir=3D"ltr" align=3D"left"><span class=3D"275163013-21112012"><font co=
lor=3D"#0000ff" size=3D"2" face=3D"&#23435;&#20307;"></font></span>&nbsp;</=
div>
<div dir=3D"ltr" align=3D"left"><span class=3D"275163013-21112012"><font co=
lor=3D"#0000ff" size=3D"2" face=3D"&#23435;&#20307;">Thanks,</font></span><=
/div>
<div dir=3D"ltr" align=3D"left"><span class=3D"275163013-21112012"><font co=
lor=3D"#0000ff" size=3D"2" face=3D"&#23435;&#20307;">Jinsong</font></span><=
/div>
<br>
<div dir=3D"ltr" lang=3D"en-us" class=3D"OutlookMessageHeader" align=3D"lef=
t">
<hr tabindex=3D"-1">
<font size=3D"2" face=3D"Tahoma"><b>From:</b> dunlapg@gmail.com [mailto:dun=
lapg@gmail.com]
<b>On Behalf Of </b>George Dunlap<br>
<b>Sent:</b> Wednesday, November 21, 2012 8:17 PM<br>
<b>To:</b> Liu, Jinsong<br>
<b>Cc:</b> Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensourc=
e.com<br>
<b>Subject:</b> Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page wit=
h regard to migration<br>
</font><br>
</div>
<div></div>
OK, so now that we seem to have agreed on the overall approach, down to &qu=
ot;brass tacks&quot;, as we say in English:<br>
<br>
<div class=3D"gmail_extra">On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <sp=
an dir=3D"ltr">
&lt;<a href=3D"mailto:jinsong.liu@intel.com" target=3D"_blank">jinsong.liu@=
intel.com</a>&gt;</span> wrote:<br>
<div class=3D"gmail_quote">
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<div class=3D"im">Generally, there are 2 cases:<br>
1. broken page occurs before migration<br>
2. broken page occurs during migration<br>
</div>
</blockquote>
<div><br>
I think we probably need to include the &quot;last iteration&quot; subcases=
 here as well -- although, probably it would be better to put them in the c=
omments.&nbsp; Also make sure to note that now even suspend may do a second=
 iteration if pages are broken during the suspend
 operation.<br>
<br>
Also, what you should do is have the main description always say what the p=
atch does, and then at the bottom have a summary of the changes; for instan=
ce:<br>
<br>
v4: <br>
&nbsp;- Adjust variables and patch description based on feedback<br>
v3: <br>
&nbsp;- Handle pages broken on the last iteration<br>
&amp;c<br>
&nbsp;<br>
<br>
</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<div class=3D"im"><br>
</div>
We had submitted 2 versions of patches. Their difference is how to handle c=
ase 2:<br>
V1 patch aborted migration for the case 'broken page occurs during migratio=
n';<br>
V2 patch marked broken page to dirty bitmap then got handled next round and=
 no abort;<br>
<br>
This is V3 patch, adding handle for vMCE occur at last iteration of migrati=
on:<br>
At the sender<br>
&nbsp; For case 1, the broken page will be mapped but not copied to target<=
br>
<div class=3D"im">&nbsp; (otherwise it may trigger more serious error, say,=
 SRAR error).<br>
</div>
&nbsp; While its pfn_type and pfn number will be transferred to target<br>
<div class=3D"im">&nbsp; so that target take appropriate action.<br>
<br>
&nbsp; For case 2, mce handler marks the broken page to dirty bitmap, so th=
at<br>
</div>
&nbsp; at copypages stage of migration, its pfn_type and pfn number will be=
<br>
<div class=3D"im">&nbsp; transferred to target and then take appropriate ac=
tion.<br>
<br>
At the target<br>
</div>
&nbsp; When migration target populates pages for guest. As for the case<br>
&nbsp; of broken page wrt migration, we prefer to keep the type of the page=
,<br>
<div class=3D"im">&nbsp; for the sake of seamless migration.<br>
<br>
</div>
&nbsp; At target it will set p2m as p2m_ram_broken for broken page. Guest M=
CE<br>
<div class=3D"im">&nbsp; may have good chance to handle its broken page, wh=
ile if guest access<br>
</div>
&nbsp; the broken page again it will kill itself as expected.<br>
<br>
If vMCE occur at the last memory copy iteration of migration, we do one mor=
e<br>
iteration so that the broken page's pfn_type and pfn number has chance to<b=
r>
be transferred to target.<br>
<div class=3D"im"><br>
Suggested-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.c=
om">george.dunlap@eu.citrix.com</a>&gt;<br>
Signed-off-by: Liu Jinsong &lt;<a href=3D"mailto:jinsong.liu@intel.com">jin=
song.liu@intel.com</a>&gt;<br>
Acked-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">=
george.dunlap@eu.citrix.com</a>&gt;<br>
<br>
</div>
- for tools part of the patch<br>
Acked-by: Ian Jackson &lt;<a href=3D"mailto:Ian.Jackson@eu.citrix.com">Ian.=
Jackson@eu.citrix.com</a>&gt;<br>
</blockquote>
<div><br>
You should remove these until you get another ack (since the patch has chan=
ged materially)<br>
&nbsp;</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<br>
- for hypervisor part of the patch<br>
Acked-by: Jan Beulich &lt;<a href=3D"mailto:JBeulich@suse.com">JBeulich@sus=
e.com</a>&gt;<br>
</blockquote>
<div><br>
I think if you haven't changed the HV part since his ack, you can probably =
leave this one.<br>
&nbsp;</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<br>
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain.c<br>
<div class=3D"im">--- a/tools/libxc/xc_domain.c &nbsp; Tue Nov 13 11:19:17 =
2012 &#43;0000<br>
</div>
&#43;&#43;&#43; b/tools/libxc/xc_domain.c &nbsp; Sat Nov 17 09:46:05 2012 &=
#43;0800<br>
<div class=3D"im">@@ -283,6 &#43;283,22 @@<br>
&nbsp; &nbsp; &nbsp;return ret;<br>
&nbsp;}<br>
<br>
&#43;/* set broken page p2m */<br>
&#43;int xc_set_broken_page_p2m(xc_interface *xch,<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; uint32_t domid,<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; unsigned long pfn)<br>
&#43;{<br>
&#43; &nbsp; &nbsp;int ret;<br>
&#43; &nbsp; &nbsp;DECLARE_DOMCTL;<br>
&#43;<br>
&#43; &nbsp; &nbsp;domctl.cmd =3D XEN_DOMCTL_set_broken_page_p2m;<br>
&#43; &nbsp; &nbsp;domctl.domain =3D (domid_t)domid;<br>
&#43; &nbsp; &nbsp;domctl.u.set_broken_page_p2m.pfn =3D pfn;<br>
&#43; &nbsp; &nbsp;ret =3D do_domctl(xch, &amp;domctl);<br>
&#43;<br>
&#43; &nbsp; &nbsp;return ret ? -1 : 0;<br>
&#43;}<br>
&#43;<br>
&nbsp;/* get info from hvm guest for save */<br>
&nbsp;int xc_domain_hvm_getcontext(xc_interface *xch,<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; uint32_t domid,<br>
</div>
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_restore.c<br>
<div class=3D"im">--- a/tools/libxc/xc_domain_restore.c &nbsp; Tue Nov 13 1=
1:19:17 2012 &#43;0000<br>
</div>
&#43;&#43;&#43; b/tools/libxc/xc_domain_restore.c &nbsp; Sat Nov 17 09:46:0=
5 2012 &#43;0800<br>
<div>
<div class=3D"h5">@@ -1023,9 &#43;1023,15 @@<br>
<br>
&nbsp; &nbsp; &nbsp;countpages =3D count;<br>
&nbsp; &nbsp; &nbsp;for (i =3D oldcount; i &lt; buf-&gt;nr_pages; &#43;&#43=
;i)<br>
- &nbsp; &nbsp; &nbsp; &nbsp;if ((buf-&gt;pfn_types[i] &amp; XEN_DOMCTL_PFI=
NFO_LTAB_MASK) =3D=3D XEN_DOMCTL_PFINFO_XTAB<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;||(buf-&gt;pfn_types[i] &amp; XE=
N_DOMCTL_PFINFO_LTAB_MASK) =3D=3D XEN_DOMCTL_PFINFO_XALLOC)<br>
&#43; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;unsigned long pagetype;<br>
&#43;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;pagetype =3D buf-&gt;pfn_types[i] &amp; XE=
N_DOMCTL_PFINFO_LTAB_MASK;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTA=
B ||<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pagetype =3D=3D XEN_DOMCTL_=
PFINFO_BROKEN ||<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pagetype =3D=3D XEN_DOMCTL_=
PFINFO_XALLOC )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;--countpages;<br>
&#43; &nbsp; &nbsp;}<br>
<br>
&nbsp; &nbsp; &nbsp;if (!countpages)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return count;<br>
@@ -1267,6 &#43;1273,17 @@<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/* a bogus/unmapped/allocat=
e-only page: skip it */<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;continue;<br>
<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_BRO=
KEN )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( xc_set_broken_page_p2m(=
xch, dom, pfn) )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ERROR(&quot;Se=
t p2m for broken page failed, &quot;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp;&quot;dom=3D%d, pfn=3D%lx\n&quot;, dom, pfn);<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;goto err_mappe=
d;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;continue;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (pfn_err[i])<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ERROR(&quot;unexpected PFN =
mapping failure pfn %lx map_mfn %lx p2m_mfn %lx&quot;,<br>
</div>
</div>
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_save.c<br>
<div class=3D"im">--- a/tools/libxc/xc_domain_save.c &nbsp; &nbsp; &nbsp;Tu=
e Nov 13 11:19:17 2012 &#43;0000<br>
</div>
&#43;&#43;&#43; b/tools/libxc/xc_domain_save.c &nbsp; &nbsp; &nbsp;Sat Nov =
17 09:46:05 2012 &#43;0800<br>
@@ -1118,7 &#43;1118,7 @@<br>
&nbsp; &nbsp; &nbsp;/* Now write out each data page, canonicalising page ta=
bles as we go... */<br>
&nbsp; &nbsp; &nbsp;for ( ; ; )<br>
&nbsp; &nbsp; &nbsp;{<br>
- &nbsp; &nbsp; &nbsp; &nbsp;unsigned int N, batch, run;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;unsigned int N, batch, run, broken_page_nu=
m1, broken_page_num2;<br>
</blockquote>
<div><br>
You need more descriptive variables here.&nbsp; Maybe &quot;broken_before_s=
end&quot; and &quot;broken_after_send&quot;?<br>
&nbsp;</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;char reportbuf[80];<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;snprintf(reportbuf, sizeof(reportbuf),<br=
>
@@ -1270,6 &#43;1270,7 @@<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;goto out;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;broken_page_num1 =3D 0;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for ( run =3D j =3D 0; j &l=
t; batch; j&#43;&#43; )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;unsigned long=
 gmfn =3D pfn_batch[j];<br>
@@ -1277,6 &#43;1278,14 @@<br>
<div class=3D"im">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp;if ( !hvm )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
;gmfn =3D pfn_to_mfn(gmfn);<br>
<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( pfn_type[=
j] =3D=3D XEN_DOMCTL_PFINFO_BROKEN )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
pfn_type[j] |=3D pfn_batch[j];<br>
</div>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
&#43;&#43;broken_page_num1;<br>
<div class=3D"im">&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp;&#43;&#43;run;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
continue;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( pfn_err[=
j] )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
;if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_XTAB )<br>
</div>
@@ -1371,8 &#43;1380,12 @@<br>
<div class=3D"im">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp;}<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/* skip pages that=
 aren't present or are alloc-only */<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/*<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * skip pages =
that aren't present,<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * or are brok=
en, or are alloc-only<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( pagetype=
 =3D=3D XEN_DOMCTL_PFINFO_XTAB<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
|| pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
;|| pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
;continue;<br>
<br>
</div>
@@ -1484,6 &#43;1497,35 @@<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;munmap(region_base, batch*P=
AGE_SIZE);<br>
<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/*<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * if vMCE occur at last ite=
r, do one more iter so that it get<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * chance to transfer broken=
 page's pfn_type and pfn number to<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * target and then take appr=
opriate action<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br>
</blockquote>
<div><br>
Maybe, &quot;Pages may have broken between mapping them and sending them.&n=
bsp; Count the number of broken pages after sending, and if there are more =
than before sending, do another iteration to make sure the pages are marked=
 broken on the receiving side&quot;?<br>
&nbsp;</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( last_iter )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
</blockquote>
<div><br>
/* Read the p2m table again */<br>
&nbsp;</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for ( j =3D 0;=
 j &lt; batch; j&#43;&#43; )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
if ( hvm )<br>
<div class=3D"im">&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp;pfn_type[j] =3D pfn_batch[j];<br>
</div>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
else<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp;pfn_type[j] =3D pfn_to_mfn(pfn_batch[j]);<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( xc_get_pf=
n_type_batch(xch, dom, batch, pfn_type) )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
PERROR(&quot;get_pfn_type_batch failed&quot;);<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
goto out;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43;<br>
</blockquote>
<div><br>
/* Count the number of broken pages */<br>
&nbsp;</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;broken_page_nu=
m2 =3D 0;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for ( j =3D 0;=
 j &lt; batch; j&#43;&#43; )<br>
<div class=3D"im">&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp;if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_BROKEN )<br>
</div>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp;broken_page_num2&#43;&#43;;<br>
&#43;<br>
</blockquote>
<div><br>
/* If there are more than before sending, do one more iteration */<br>
&nbsp;</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( broken_pa=
ge_num1 &lt; broken_page_num2 )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
last_iter =3D 0;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} /* end of this while loop for this iter=
ation */<br>
</blockquote>
<div><br>
I think that's all I have.<br>
<br>
&nbsp;-George<br>
</div>
</div>
<br>
</div>
</body>
</html>

--_000_DE8DF0795D48FD4CA783C40EC82923353944E5SHSMSX101ccrcorpi_--


--===============7923967199936632013==
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.xen.org
http://lists.xen.org/xen-devel

--===============7923967199936632013==--


From xen-devel-bounces@lists.xen.org Wed Nov 21 13:31:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 13:31:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbAOr-0008Nq-Hr; Wed, 21 Nov 2012 13:31:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TbAOp-0008Nd-Lt
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 13:31:32 +0000
Received: from [193.109.254.147:8878] by server-7.bemta-14.messagelabs.com id
	91/17-02272-3B7DCA05; Wed, 21 Nov 2012 13:31:31 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1353504685!10542290!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjMyODQz\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26957 invoked from network); 21 Nov 2012 13:31:26 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-16.tower-27.messagelabs.com with SMTP;
	21 Nov 2012 13:31:26 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga102.ch.intel.com with ESMTP; 21 Nov 2012 05:31:24 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,293,1352102400"; 
	d="scan'208,217";a="220637463"
Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37])
	by azsmga001.ch.intel.com with ESMTP; 21 Nov 2012 05:31:23 -0800
Received: from fmsmsx119.amr.corp.intel.com (10.18.22.143) by
	FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 05:31:23 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	fmsmsx119.amr.corp.intel.com (10.18.22.143) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 21 Nov 2012 05:31:22 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Wed, 21 Nov 2012 21:31:21 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNx+IhWSR52N+j5UqhK6CjagaIUZf0SOuw
Date: Wed, 21 Nov 2012 13:31:21 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353944E5@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZZq5obGskT0BGKMqEY+Mj4OtY-9DyhAcdo5XU9bidL2zg@mail.gmail.com>
In-Reply-To: <CAFLBxZZq5obGskT0BGKMqEY+Mj4OtY-9DyhAcdo5XU9bidL2zg@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7923967199936632013=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============7923967199936632013==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_DE8DF0795D48FD4CA783C40EC82923353944E5SHSMSX101ccrcorpi_"

--_000_DE8DF0795D48FD4CA783C40EC82923353944E5SHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Yes, I will update and send V4 later.

Thanks,
Jinsong

________________________________
From: dunlapg@gmail.com [mailto:dunlapg@gmail.com] On Behalf Of George Dunl=
ap
Sent: Wednesday, November 21, 2012 8:17 PM
To: Liu, Jinsong
Cc: Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regar=
d to migration

OK, so now that we seem to have agreed on the overall approach, down to "br=
ass tacks", as we say in English:

On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <jinsong.liu@intel.com<mailto:=
jinsong.liu@intel.com>> wrote:
Generally, there are 2 cases:
1. broken page occurs before migration
2. broken page occurs during migration

I think we probably need to include the "last iteration" subcases here as w=
ell -- although, probably it would be better to put them in the comments.  =
Also make sure to note that now even suspend may do a second iteration if p=
ages are broken during the suspend operation.

Also, what you should do is have the main description always say what the p=
atch does, and then at the bottom have a summary of the changes; for instan=
ce:

v4:
 - Adjust variables and patch description based on feedback
v3:
 - Handle pages broken on the last iteration
&c



We had submitted 2 versions of patches. Their difference is how to handle c=
ase 2:
V1 patch aborted migration for the case 'broken page occurs during migratio=
n';
V2 patch marked broken page to dirty bitmap then got handled next round and=
 no abort;

This is V3 patch, adding handle for vMCE occur at last iteration of migrati=
on:
At the sender
  For case 1, the broken page will be mapped but not copied to target
  (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number will be transferred to target
  so that target take appropriate action.

  For case 2, mce handler marks the broken page to dirty bitmap, so that
  at copypages stage of migration, its pfn_type and pfn number will be
  transferred to target and then take appropriate action.

At the target
  When migration target populates pages for guest. As for the case
  of broken page wrt migration, we prefer to keep the type of the page,
  for the sake of seamless migration.

  At target it will set p2m as p2m_ram_broken for broken page. Guest MCE
  may have good chance to handle its broken page, while if guest access
  the broken page again it will kill itself as expected.

If vMCE occur at the last memory copy iteration of migration, we do one mor=
e
iteration so that the broken page's pfn_type and pfn number has chance to
be transferred to target.

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunl=
ap@eu.citrix.com>>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com<mailto:jinsong.liu@intel.=
com>>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunlap@e=
u.citrix.com>>

- for tools part of the patch
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com<mailto:Ian.Jackson@eu.citr=
ix.com>>

You should remove these until you get another ack (since the patch has chan=
ged materially)


- for hypervisor part of the patch
Acked-by: Jan Beulich <JBeulich@suse.com<mailto:JBeulich@suse.com>>

I think if you haven't changed the HV part since his ack, you can probably =
leave this one.


diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c   Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain.c   Sat Nov 17 09:46:05 2012 +0800
@@ -283,6 +283,22 @@
     return ret;
 }

+/* set broken page p2m */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn)
+{
+    int ret;
+    DECLARE_DOMCTL;
+
+    domctl.cmd =3D XEN_DOMCTL_set_broken_page_p2m;
+    domctl.domain =3D (domid_t)domid;
+    domctl.u.set_broken_page_p2m.pfn =3D pfn;
+    ret =3D do_domctl(xch, &domctl);
+
+    return ret ? -1 : 0;
+}
+
 /* get info from hvm guest for save */
 int xc_domain_hvm_getcontext(xc_interface *xch,
                              uint32_t domid,
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c   Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_restore.c   Sat Nov 17 09:46:05 2012 +0800
@@ -1023,9 +1023,15 @@

     countpages =3D count;
     for (i =3D oldcount; i < buf->nr_pages; ++i)
-        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) =3D=3D XEN_D=
OMCTL_PFINFO_XTAB
-            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) =3D=3D XEN=
_DOMCTL_PFINFO_XALLOC)
+    {
+        unsigned long pagetype;
+
+        pagetype =3D buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
+        if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTAB ||
+             pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN ||
+             pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )
             --countpages;
+    }

     if (!countpages)
         return count;
@@ -1267,6 +1273,17 @@
             /* a bogus/unmapped/allocate-only page: skip it */
             continue;

+        if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN )
+        {
+            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
+            {
+                ERROR("Set p2m for broken page failed, "
+                      "dom=3D%d, pfn=3D%lx\n", dom, pfn);
+                goto err_mapped;
+            }
+            continue;
+        }
+
         if (pfn_err[i])
         {
             ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_=
mfn %lx",
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c      Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_save.c      Sat Nov 17 09:46:05 2012 +0800
@@ -1118,7 +1118,7 @@
     /* Now write out each data page, canonicalising page tables as we go..=
. */
     for ( ; ; )
     {
-        unsigned int N, batch, run;
+        unsigned int N, batch, run, broken_page_num1, broken_page_num2;

You need more descriptive variables here.  Maybe "broken_before_send" and "=
broken_after_send"?

         char reportbuf[80];

         snprintf(reportbuf, sizeof(reportbuf),
@@ -1270,6 +1270,7 @@
                 goto out;
             }

+            broken_page_num1 =3D 0;
             for ( run =3D j =3D 0; j < batch; j++ )
             {
                 unsigned long gmfn =3D pfn_batch[j];
@@ -1277,6 +1278,14 @@
                 if ( !hvm )
                     gmfn =3D pfn_to_mfn(gmfn);

+                if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_BROKEN )
+                {
+                    pfn_type[j] |=3D pfn_batch[j];
+                    ++broken_page_num1;
+                    ++run;
+                    continue;
+                }
+
                 if ( pfn_err[j] )
                 {
                     if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_XTAB )
@@ -1371,8 +1380,12 @@
                     }
                 }

-                /* skip pages that aren't present or are alloc-only */
+                /*
+                 * skip pages that aren't present,
+                 * or are broken, or are alloc-only
+                 */
                 if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTAB
+                    || pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN
                     || pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )
                     continue;

@@ -1484,6 +1497,35 @@

             munmap(region_base, batch*PAGE_SIZE);

+            /*
+             * if vMCE occur at last iter, do one more iter so that it get
+             * chance to transfer broken page's pfn_type and pfn number to
+             * target and then take appropriate action
+             */

Maybe, "Pages may have broken between mapping them and sending them.  Count=
 the number of broken pages after sending, and if there are more than befor=
e sending, do another iteration to make sure the pages are marked broken on=
 the receiving side"?

+            if ( last_iter )
+            {

/* Read the p2m table again */

+                for ( j =3D 0; j < batch; j++ )
+                {
+                    if ( hvm )
+                        pfn_type[j] =3D pfn_batch[j];
+                    else
+                        pfn_type[j] =3D pfn_to_mfn(pfn_batch[j]);
+                }
+
+                if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
+                {
+                    PERROR("get_pfn_type_batch failed");
+                    goto out;
+                }
+

/* Count the number of broken pages */

+                broken_page_num2 =3D 0;
+                for ( j =3D 0; j < batch; j++ )
+                    if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_BROKEN )
+                        broken_page_num2++;
+

/* If there are more than before sending, do one more iteration */

+                if ( broken_page_num1 < broken_page_num2 )
+                    last_iter =3D 0;
+            }
         } /* end of this while loop for this iteration */

I think that's all I have.

 -George


--_000_DE8DF0795D48FD4CA783C40EC82923353944E5SHSMSX101ccrcorpi_
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=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"GENERATOR" content=3D"MSHTML 8.00.6001.19328">
</head>
<body>
<div dir=3D"ltr" align=3D"left"><span class=3D"275163013-21112012"><font co=
lor=3D"#0000ff" size=3D"2" face=3D"&#23435;&#20307;">Yes, I will update and=
 send V4 later.</font></span></div>
<div dir=3D"ltr" align=3D"left"><span class=3D"275163013-21112012"><font co=
lor=3D"#0000ff" size=3D"2" face=3D"&#23435;&#20307;"></font></span>&nbsp;</=
div>
<div dir=3D"ltr" align=3D"left"><span class=3D"275163013-21112012"><font co=
lor=3D"#0000ff" size=3D"2" face=3D"&#23435;&#20307;">Thanks,</font></span><=
/div>
<div dir=3D"ltr" align=3D"left"><span class=3D"275163013-21112012"><font co=
lor=3D"#0000ff" size=3D"2" face=3D"&#23435;&#20307;">Jinsong</font></span><=
/div>
<br>
<div dir=3D"ltr" lang=3D"en-us" class=3D"OutlookMessageHeader" align=3D"lef=
t">
<hr tabindex=3D"-1">
<font size=3D"2" face=3D"Tahoma"><b>From:</b> dunlapg@gmail.com [mailto:dun=
lapg@gmail.com]
<b>On Behalf Of </b>George Dunlap<br>
<b>Sent:</b> Wednesday, November 21, 2012 8:17 PM<br>
<b>To:</b> Liu, Jinsong<br>
<b>Cc:</b> Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensourc=
e.com<br>
<b>Subject:</b> Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page wit=
h regard to migration<br>
</font><br>
</div>
<div></div>
OK, so now that we seem to have agreed on the overall approach, down to &qu=
ot;brass tacks&quot;, as we say in English:<br>
<br>
<div class=3D"gmail_extra">On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <sp=
an dir=3D"ltr">
&lt;<a href=3D"mailto:jinsong.liu@intel.com" target=3D"_blank">jinsong.liu@=
intel.com</a>&gt;</span> wrote:<br>
<div class=3D"gmail_quote">
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<div class=3D"im">Generally, there are 2 cases:<br>
1. broken page occurs before migration<br>
2. broken page occurs during migration<br>
</div>
</blockquote>
<div><br>
I think we probably need to include the &quot;last iteration&quot; subcases=
 here as well -- although, probably it would be better to put them in the c=
omments.&nbsp; Also make sure to note that now even suspend may do a second=
 iteration if pages are broken during the suspend
 operation.<br>
<br>
Also, what you should do is have the main description always say what the p=
atch does, and then at the bottom have a summary of the changes; for instan=
ce:<br>
<br>
v4: <br>
&nbsp;- Adjust variables and patch description based on feedback<br>
v3: <br>
&nbsp;- Handle pages broken on the last iteration<br>
&amp;c<br>
&nbsp;<br>
<br>
</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<div class=3D"im"><br>
</div>
We had submitted 2 versions of patches. Their difference is how to handle c=
ase 2:<br>
V1 patch aborted migration for the case 'broken page occurs during migratio=
n';<br>
V2 patch marked broken page to dirty bitmap then got handled next round and=
 no abort;<br>
<br>
This is V3 patch, adding handle for vMCE occur at last iteration of migrati=
on:<br>
At the sender<br>
&nbsp; For case 1, the broken page will be mapped but not copied to target<=
br>
<div class=3D"im">&nbsp; (otherwise it may trigger more serious error, say,=
 SRAR error).<br>
</div>
&nbsp; While its pfn_type and pfn number will be transferred to target<br>
<div class=3D"im">&nbsp; so that target take appropriate action.<br>
<br>
&nbsp; For case 2, mce handler marks the broken page to dirty bitmap, so th=
at<br>
</div>
&nbsp; at copypages stage of migration, its pfn_type and pfn number will be=
<br>
<div class=3D"im">&nbsp; transferred to target and then take appropriate ac=
tion.<br>
<br>
At the target<br>
</div>
&nbsp; When migration target populates pages for guest. As for the case<br>
&nbsp; of broken page wrt migration, we prefer to keep the type of the page=
,<br>
<div class=3D"im">&nbsp; for the sake of seamless migration.<br>
<br>
</div>
&nbsp; At target it will set p2m as p2m_ram_broken for broken page. Guest M=
CE<br>
<div class=3D"im">&nbsp; may have good chance to handle its broken page, wh=
ile if guest access<br>
</div>
&nbsp; the broken page again it will kill itself as expected.<br>
<br>
If vMCE occur at the last memory copy iteration of migration, we do one mor=
e<br>
iteration so that the broken page's pfn_type and pfn number has chance to<b=
r>
be transferred to target.<br>
<div class=3D"im"><br>
Suggested-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.c=
om">george.dunlap@eu.citrix.com</a>&gt;<br>
Signed-off-by: Liu Jinsong &lt;<a href=3D"mailto:jinsong.liu@intel.com">jin=
song.liu@intel.com</a>&gt;<br>
Acked-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">=
george.dunlap@eu.citrix.com</a>&gt;<br>
<br>
</div>
- for tools part of the patch<br>
Acked-by: Ian Jackson &lt;<a href=3D"mailto:Ian.Jackson@eu.citrix.com">Ian.=
Jackson@eu.citrix.com</a>&gt;<br>
</blockquote>
<div><br>
You should remove these until you get another ack (since the patch has chan=
ged materially)<br>
&nbsp;</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<br>
- for hypervisor part of the patch<br>
Acked-by: Jan Beulich &lt;<a href=3D"mailto:JBeulich@suse.com">JBeulich@sus=
e.com</a>&gt;<br>
</blockquote>
<div><br>
I think if you haven't changed the HV part since his ack, you can probably =
leave this one.<br>
&nbsp;</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<br>
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain.c<br>
<div class=3D"im">--- a/tools/libxc/xc_domain.c &nbsp; Tue Nov 13 11:19:17 =
2012 &#43;0000<br>
</div>
&#43;&#43;&#43; b/tools/libxc/xc_domain.c &nbsp; Sat Nov 17 09:46:05 2012 &=
#43;0800<br>
<div class=3D"im">@@ -283,6 &#43;283,22 @@<br>
&nbsp; &nbsp; &nbsp;return ret;<br>
&nbsp;}<br>
<br>
&#43;/* set broken page p2m */<br>
&#43;int xc_set_broken_page_p2m(xc_interface *xch,<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; uint32_t domid,<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; unsigned long pfn)<br>
&#43;{<br>
&#43; &nbsp; &nbsp;int ret;<br>
&#43; &nbsp; &nbsp;DECLARE_DOMCTL;<br>
&#43;<br>
&#43; &nbsp; &nbsp;domctl.cmd =3D XEN_DOMCTL_set_broken_page_p2m;<br>
&#43; &nbsp; &nbsp;domctl.domain =3D (domid_t)domid;<br>
&#43; &nbsp; &nbsp;domctl.u.set_broken_page_p2m.pfn =3D pfn;<br>
&#43; &nbsp; &nbsp;ret =3D do_domctl(xch, &amp;domctl);<br>
&#43;<br>
&#43; &nbsp; &nbsp;return ret ? -1 : 0;<br>
&#43;}<br>
&#43;<br>
&nbsp;/* get info from hvm guest for save */<br>
&nbsp;int xc_domain_hvm_getcontext(xc_interface *xch,<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; uint32_t domid,<br>
</div>
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_restore.c<br>
<div class=3D"im">--- a/tools/libxc/xc_domain_restore.c &nbsp; Tue Nov 13 1=
1:19:17 2012 &#43;0000<br>
</div>
&#43;&#43;&#43; b/tools/libxc/xc_domain_restore.c &nbsp; Sat Nov 17 09:46:0=
5 2012 &#43;0800<br>
<div>
<div class=3D"h5">@@ -1023,9 &#43;1023,15 @@<br>
<br>
&nbsp; &nbsp; &nbsp;countpages =3D count;<br>
&nbsp; &nbsp; &nbsp;for (i =3D oldcount; i &lt; buf-&gt;nr_pages; &#43;&#43=
;i)<br>
- &nbsp; &nbsp; &nbsp; &nbsp;if ((buf-&gt;pfn_types[i] &amp; XEN_DOMCTL_PFI=
NFO_LTAB_MASK) =3D=3D XEN_DOMCTL_PFINFO_XTAB<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;||(buf-&gt;pfn_types[i] &amp; XE=
N_DOMCTL_PFINFO_LTAB_MASK) =3D=3D XEN_DOMCTL_PFINFO_XALLOC)<br>
&#43; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;unsigned long pagetype;<br>
&#43;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;pagetype =3D buf-&gt;pfn_types[i] &amp; XE=
N_DOMCTL_PFINFO_LTAB_MASK;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_XTA=
B ||<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pagetype =3D=3D XEN_DOMCTL_=
PFINFO_BROKEN ||<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pagetype =3D=3D XEN_DOMCTL_=
PFINFO_XALLOC )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;--countpages;<br>
&#43; &nbsp; &nbsp;}<br>
<br>
&nbsp; &nbsp; &nbsp;if (!countpages)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return count;<br>
@@ -1267,6 &#43;1273,17 @@<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/* a bogus/unmapped/allocat=
e-only page: skip it */<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;continue;<br>
<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;if ( pagetype =3D=3D XEN_DOMCTL_PFINFO_BRO=
KEN )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( xc_set_broken_page_p2m(=
xch, dom, pfn) )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ERROR(&quot;Se=
t p2m for broken page failed, &quot;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp;&quot;dom=3D%d, pfn=3D%lx\n&quot;, dom, pfn);<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;goto err_mappe=
d;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;continue;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (pfn_err[i])<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ERROR(&quot;unexpected PFN =
mapping failure pfn %lx map_mfn %lx p2m_mfn %lx&quot;,<br>
</div>
</div>
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_save.c<br>
<div class=3D"im">--- a/tools/libxc/xc_domain_save.c &nbsp; &nbsp; &nbsp;Tu=
e Nov 13 11:19:17 2012 &#43;0000<br>
</div>
&#43;&#43;&#43; b/tools/libxc/xc_domain_save.c &nbsp; &nbsp; &nbsp;Sat Nov =
17 09:46:05 2012 &#43;0800<br>
@@ -1118,7 &#43;1118,7 @@<br>
&nbsp; &nbsp; &nbsp;/* Now write out each data page, canonicalising page ta=
bles as we go... */<br>
&nbsp; &nbsp; &nbsp;for ( ; ; )<br>
&nbsp; &nbsp; &nbsp;{<br>
- &nbsp; &nbsp; &nbsp; &nbsp;unsigned int N, batch, run;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;unsigned int N, batch, run, broken_page_nu=
m1, broken_page_num2;<br>
</blockquote>
<div><br>
You need more descriptive variables here.&nbsp; Maybe &quot;broken_before_s=
end&quot; and &quot;broken_after_send&quot;?<br>
&nbsp;</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;char reportbuf[80];<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;snprintf(reportbuf, sizeof(reportbuf),<br=
>
@@ -1270,6 &#43;1270,7 @@<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;goto out;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;broken_page_num1 =3D 0;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for ( run =3D j =3D 0; j &l=
t; batch; j&#43;&#43; )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;unsigned long=
 gmfn =3D pfn_batch[j];<br>
@@ -1277,6 &#43;1278,14 @@<br>
<div class=3D"im">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp;if ( !hvm )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
;gmfn =3D pfn_to_mfn(gmfn);<br>
<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( pfn_type[=
j] =3D=3D XEN_DOMCTL_PFINFO_BROKEN )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
pfn_type[j] |=3D pfn_batch[j];<br>
</div>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
&#43;&#43;broken_page_num1;<br>
<div class=3D"im">&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp;&#43;&#43;run;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
continue;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( pfn_err[=
j] )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
;if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_XTAB )<br>
</div>
@@ -1371,8 &#43;1380,12 @@<br>
<div class=3D"im">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp;}<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/* skip pages that=
 aren't present or are alloc-only */<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/*<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * skip pages =
that aren't present,<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * or are brok=
en, or are alloc-only<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( pagetype=
 =3D=3D XEN_DOMCTL_PFINFO_XTAB<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
|| pagetype =3D=3D XEN_DOMCTL_PFINFO_BROKEN<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
;|| pagetype =3D=3D XEN_DOMCTL_PFINFO_XALLOC )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
;continue;<br>
<br>
</div>
@@ -1484,6 &#43;1497,35 @@<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;munmap(region_base, batch*P=
AGE_SIZE);<br>
<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/*<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * if vMCE occur at last ite=
r, do one more iter so that it get<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * chance to transfer broken=
 page's pfn_type and pfn number to<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * target and then take appr=
opriate action<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br>
</blockquote>
<div><br>
Maybe, &quot;Pages may have broken between mapping them and sending them.&n=
bsp; Count the number of broken pages after sending, and if there are more =
than before sending, do another iteration to make sure the pages are marked=
 broken on the receiving side&quot;?<br>
&nbsp;</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( last_iter )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
</blockquote>
<div><br>
/* Read the p2m table again */<br>
&nbsp;</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for ( j =3D 0;=
 j &lt; batch; j&#43;&#43; )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
if ( hvm )<br>
<div class=3D"im">&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp;pfn_type[j] =3D pfn_batch[j];<br>
</div>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
else<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp;pfn_type[j] =3D pfn_to_mfn(pfn_batch[j]);<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( xc_get_pf=
n_type_batch(xch, dom, batch, pfn_type) )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
PERROR(&quot;get_pfn_type_batch failed&quot;);<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
goto out;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&#43;<br>
</blockquote>
<div><br>
/* Count the number of broken pages */<br>
&nbsp;</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;broken_page_nu=
m2 =3D 0;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for ( j =3D 0;=
 j &lt; batch; j&#43;&#43; )<br>
<div class=3D"im">&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp;if ( pfn_type[j] =3D=3D XEN_DOMCTL_PFINFO_BROKEN )<br>
</div>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp;broken_page_num2&#43;&#43;;<br>
&#43;<br>
</blockquote>
<div><br>
/* If there are more than before sending, do one more iteration */<br>
&nbsp;</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( broken_pa=
ge_num1 &lt; broken_page_num2 )<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
last_iter =3D 0;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} /* end of this while loop for this iter=
ation */<br>
</blockquote>
<div><br>
I think that's all I have.<br>
<br>
&nbsp;-George<br>
</div>
</div>
<br>
</div>
</body>
</html>

--_000_DE8DF0795D48FD4CA783C40EC82923353944E5SHSMSX101ccrcorpi_--


--===============7923967199936632013==
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.xen.org
http://lists.xen.org/xen-devel

--===============7923967199936632013==--


From xen-devel-bounces@lists.xen.org Wed Nov 21 13:37:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 13:37:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbATk-00009C-Nf; Wed, 21 Nov 2012 13:36:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbATj-000096-MY
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 13:36:35 +0000
Received: from [85.158.137.99:5116] by server-12.bemta-3.messagelabs.com id
	23/ED-22757-2E8DCA05; Wed, 21 Nov 2012 13:36:34 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1353504993!16877807!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19197 invoked from network); 21 Nov 2012 13:36:34 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-217.messagelabs.com with SMTP;
	21 Nov 2012 13:36:34 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 13:36:33 +0000
Message-Id: <50ACE72802000078000AA635@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 13:37:28 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Jinsong Liu" <jinsong.liu@intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
	<50ACBC50.4040204@eu.citrix.com>
	<1353499905.13542.139.camel@zakaz.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC82923353944A2@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923353944A2@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 21.11.12 at 14:26, "Liu, Jinsong" <jinsong.liu@intel.com> wrote:
> Ian Campbell wrote:
>> On Wed, 2012-11-21 at 11:34 +0000, George Dunlap wrote:
>>> On 20/11/12 18:42, Ian Jackson wrote:
>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>>> broken page with regard to migration"): 
>>>>> Ian Jackson wrote:
>>>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>>>>> broken page with regard to migration"):
>>>>>>> No, at last lter, there are 4 points:
>>>>>>> 1. start last iter
>>>>>>> 2. get and transfer pfn_type to target
>>>>>>> 3. copy page to target
>>>>>>> 4. end last iter
>>>> ...
>>>>> It indeed checks mce after point 3 for each page, but what's the
>>>>> advantage of keeping a separate list?
>>>> It avoids yet another loop over all the pages.  Unless I have
>>>> misunderstood.  Which I may have, because: if it checks for mce
>>>> after 
>>>> point 3 then surely that is sufficient ?  We don't need to worry
>>>> about 
>>>> mces after that check.
>>> 
>>> It's sufficient, but wouldn't each check require a separate
>>> hypercall? That would surely be slower than just a single hypercall
>>> and a loop (which is what Jinsong's patch does).
>>> 
>>> We don't actually need a list -- I think we just need to know, "Have
>>> any pages broken between reading the p2m table (
>>> xc_get_pfn_type_batch() ); if so, we do another full iteration.
>> 
>> If a page fails between 2. and 3. above then what happens at point 3?
>> I presume we can't map and send the page (since it is broken), do we
>> get some sort of failure to map?
>> 
>> What happens if the failure occurs during stage 3, i.e. while the page
>> is mapped and we are reading from it?
>> 
>> Ian.
> 
> If read a broken page, it generates more serious error (say, SRAR error).
> I don't think guest has good opportunity to survive under this case --> most 
> probably it kill itself and of course we don't need care migration now.
> However, if guest can luckly survive (say complete broken page copying to 
> target), it's OK to continue --> its broken pfn_type will transfer to target 
> next iter so guest will kill itself if access then.

I think you misread the question - it said "we", as in "the tools/
kernel/hypervisor" (at least that's how I'm reading it). The MCE
would surface in host context in this case, and whether that's
fatal to the host depends on the precise properties of the event.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 13:37:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 13:37:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbATk-00009C-Nf; Wed, 21 Nov 2012 13:36:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbATj-000096-MY
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 13:36:35 +0000
Received: from [85.158.137.99:5116] by server-12.bemta-3.messagelabs.com id
	23/ED-22757-2E8DCA05; Wed, 21 Nov 2012 13:36:34 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1353504993!16877807!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19197 invoked from network); 21 Nov 2012 13:36:34 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-217.messagelabs.com with SMTP;
	21 Nov 2012 13:36:34 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 13:36:33 +0000
Message-Id: <50ACE72802000078000AA635@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 13:37:28 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Jinsong Liu" <jinsong.liu@intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
	<50ACBC50.4040204@eu.citrix.com>
	<1353499905.13542.139.camel@zakaz.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC82923353944A2@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923353944A2@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 21.11.12 at 14:26, "Liu, Jinsong" <jinsong.liu@intel.com> wrote:
> Ian Campbell wrote:
>> On Wed, 2012-11-21 at 11:34 +0000, George Dunlap wrote:
>>> On 20/11/12 18:42, Ian Jackson wrote:
>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>>> broken page with regard to migration"): 
>>>>> Ian Jackson wrote:
>>>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>>>>> broken page with regard to migration"):
>>>>>>> No, at last lter, there are 4 points:
>>>>>>> 1. start last iter
>>>>>>> 2. get and transfer pfn_type to target
>>>>>>> 3. copy page to target
>>>>>>> 4. end last iter
>>>> ...
>>>>> It indeed checks mce after point 3 for each page, but what's the
>>>>> advantage of keeping a separate list?
>>>> It avoids yet another loop over all the pages.  Unless I have
>>>> misunderstood.  Which I may have, because: if it checks for mce
>>>> after 
>>>> point 3 then surely that is sufficient ?  We don't need to worry
>>>> about 
>>>> mces after that check.
>>> 
>>> It's sufficient, but wouldn't each check require a separate
>>> hypercall? That would surely be slower than just a single hypercall
>>> and a loop (which is what Jinsong's patch does).
>>> 
>>> We don't actually need a list -- I think we just need to know, "Have
>>> any pages broken between reading the p2m table (
>>> xc_get_pfn_type_batch() ); if so, we do another full iteration.
>> 
>> If a page fails between 2. and 3. above then what happens at point 3?
>> I presume we can't map and send the page (since it is broken), do we
>> get some sort of failure to map?
>> 
>> What happens if the failure occurs during stage 3, i.e. while the page
>> is mapped and we are reading from it?
>> 
>> Ian.
> 
> If read a broken page, it generates more serious error (say, SRAR error).
> I don't think guest has good opportunity to survive under this case --> most 
> probably it kill itself and of course we don't need care migration now.
> However, if guest can luckly survive (say complete broken page copying to 
> target), it's OK to continue --> its broken pfn_type will transfer to target 
> next iter so guest will kill itself if access then.

I think you misread the question - it said "we", as in "the tools/
kernel/hypervisor" (at least that's how I'm reading it). The MCE
would surface in host context in this case, and whether that's
fatal to the host depends on the precise properties of the event.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 13:46:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 13:46:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbAca-0000OA-Ok; Wed, 21 Nov 2012 13:45:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <stefan.bader@canonical.com>) id 1TbAcY-0000O5-Ra
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 13:45:43 +0000
Received: from [85.158.138.51:36818] by server-8.bemta-3.messagelabs.com id
	8E/F8-07786-10BDCA05; Wed, 21 Nov 2012 13:45:37 +0000
X-Env-Sender: stefan.bader@canonical.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1353505533!27391764!1
X-Originating-IP: [91.189.89.112]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10315 invoked from network); 21 Nov 2012 13:45:33 -0000
Received: from youngberry.canonical.com (HELO youngberry.canonical.com)
	(91.189.89.112) by server-2.tower-174.messagelabs.com with SMTP;
	21 Nov 2012 13:45:33 -0000
Received: from p5b2e214b.dip.t-dialin.net ([91.46.33.75] helo=[192.168.2.5])
	by youngberry.canonical.com with esmtpsa
	(TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71)
	(envelope-from <stefan.bader@canonical.com>)
	id 1TbAcJ-0005eG-Lt; Wed, 21 Nov 2012 13:45:27 +0000
Message-ID: <50ACDAF5.2030404@canonical.com>
Date: Wed, 21 Nov 2012 14:45:25 +0100
From: Stefan Bader <stefan.bader@canonical.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <ian.campbell@citrix.com>
References: <1353499336-28952-1-git-send-email-ian.campbell@citrix.com>
In-Reply-To: <1353499336-28952-1-git-send-email-ian.campbell@citrix.com>
X-Enigmail-Version: 1.4.5
Cc: Sander Eikelenboom <linux@eikelenboom.it>, netdev@vger.kernel.org,
	Eric Dumazet <edumazet@google.com>, xen-devel@lists.xen.org,
	Konrad Rzeszutek Wilk <konrad@kernel.org>, ANNIE LI <annie.li@oracle.com>
Subject: Re: [Xen-devel] [PATCH V3] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7514796620666413442=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============7514796620666413442==
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature";
 boundary="------------enig91DCED7CD60A1DB594E4A616"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig91DCED7CD60A1DB594E4A616
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

FWIW, I ran the v3 version and it appears to be good from that point of v=
iew.
If it looks good to everyone else, it would be great if that could reach =
3.7
final. :)

-Stefan

On 21.11.2012 13:02, Ian Campbell wrote:
> An SKB paged fragment can consist of a compound page with order > 0.
> However the netchannel protocol deals only in PAGE_SIZE frames.
>=20
> Handle this in xennet_make_frags by iterating over the frames which
> make up the page.
>=20
> This is the netfront equivalent to 6a8ed462f16b for netback.
>=20
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: netdev@vger.kernel.org
> Cc: xen-devel@lists.xen.org
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
> Cc: ANNIE LI <annie.li@oracle.com>
> Cc: Sander Eikelenboom <linux@eikelenboom.it>
> Cc: Stefan Bader <stefan.bader@canonical.com>
> ---
> v3: limit to 80-characters. Use net_alert_ratelimited.
> v2: check we have enough room in the ring and that the other end can
>     cope with the number of slots in a single frame
> ---
>  drivers/net/xen-netfront.c |   98 ++++++++++++++++++++++++++++++++++--=
-------
>  1 files changed, 77 insertions(+), 21 deletions(-)
>=20
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index caa0110..fc24eb9 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -452,29 +452,85 @@ static void xennet_make_frags(struct sk_buff *skb=
, struct net_device *dev,
>  	/* Grant backend access to each skb fragment page. */
>  	for (i =3D 0; i < frags; i++) {
>  		skb_frag_t *frag =3D skb_shinfo(skb)->frags + i;
> +		struct page *page =3D skb_frag_page(frag);
> =20
> -		tx->flags |=3D XEN_NETTXF_more_data;
> +		len =3D skb_frag_size(frag);
> +		offset =3D frag->page_offset;
> =20
> -		id =3D get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> -		np->tx_skbs[id].skb =3D skb_get(skb);
> -		tx =3D RING_GET_REQUEST(&np->tx, prod++);
> -		tx->id =3D id;
> -		ref =3D gnttab_claim_grant_reference(&np->gref_tx_head);
> -		BUG_ON((signed short)ref < 0);
> +		/* Data must not cross a page boundary. */
> +		BUG_ON(len + offset > PAGE_SIZE<<compound_order(page));
> =20
> -		mfn =3D pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
> -		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> -						mfn, GNTMAP_readonly);
> +		/* Skip unused frames from start of page */
> +		page +=3D offset >> PAGE_SHIFT;
> +		offset &=3D ~PAGE_MASK;
> =20
> -		tx->gref =3D np->grant_tx_ref[id] =3D ref;
> -		tx->offset =3D frag->page_offset;
> -		tx->size =3D skb_frag_size(frag);
> -		tx->flags =3D 0;
> +		while (len > 0) {
> +			unsigned long bytes;
> +
> +			BUG_ON(offset >=3D PAGE_SIZE);
> +
> +			bytes =3D PAGE_SIZE - offset;
> +			if (bytes > len)
> +				bytes =3D len;
> +
> +			tx->flags |=3D XEN_NETTXF_more_data;
> +
> +			id =3D get_id_from_freelist(&np->tx_skb_freelist,
> +						  np->tx_skbs);
> +			np->tx_skbs[id].skb =3D skb_get(skb);
> +			tx =3D RING_GET_REQUEST(&np->tx, prod++);
> +			tx->id =3D id;
> +			ref =3D gnttab_claim_grant_reference(&np->gref_tx_head);
> +			BUG_ON((signed short)ref < 0);
> +
> +			mfn =3D pfn_to_mfn(page_to_pfn(page));
> +			gnttab_grant_foreign_access_ref(ref,
> +							np->xbdev->otherend_id,
> +							mfn, GNTMAP_readonly);
> +
> +			tx->gref =3D np->grant_tx_ref[id] =3D ref;
> +			tx->offset =3D offset;
> +			tx->size =3D bytes;
> +			tx->flags =3D 0;
> +
> +			offset +=3D bytes;
> +			len -=3D bytes;
> +
> +			/* Next frame */
> +			if (offset =3D=3D PAGE_SIZE && len) {
> +				BUG_ON(!PageCompound(page));
> +				page++;
> +				offset =3D 0;
> +			}
> +		}
>  	}
> =20
>  	np->tx.req_prod_pvt =3D prod;
>  }
> =20
> +/*
> + * Count how many ring slots are required to send the frags of this
> + * skb. Each frag might be a compound page.
> + */
> +static int xennet_count_skb_frag_slots(struct sk_buff *skb)
> +{
> +	int i, frags =3D skb_shinfo(skb)->nr_frags;
> +	int pages =3D 0;
> +
> +	for (i =3D 0; i < frags; i++) {
> +		skb_frag_t *frag =3D skb_shinfo(skb)->frags + i;
> +		unsigned long size =3D skb_frag_size(frag);
> +		unsigned long offset =3D frag->page_offset;
> +
> +		/* Skip unused frames from start of page */
> +		offset &=3D ~PAGE_MASK;
> +
> +		pages +=3D PFN_UP(offset + size);
> +	}
> +
> +	return pages;
> +}
> +
>  static int xennet_start_xmit(struct sk_buff *skb, struct net_device *d=
ev)
>  {
>  	unsigned short id;
> @@ -487,23 +543,23 @@ static int xennet_start_xmit(struct sk_buff *skb,=
 struct net_device *dev)
>  	grant_ref_t ref;
>  	unsigned long mfn;
>  	int notify;
> -	int frags =3D skb_shinfo(skb)->nr_frags;
> +	int slots;
>  	unsigned int offset =3D offset_in_page(data);
>  	unsigned int len =3D skb_headlen(skb);
>  	unsigned long flags;
> =20
> -	frags +=3D DIV_ROUND_UP(offset + len, PAGE_SIZE);
> -	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
> -		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
> -		       frags);
> -		dump_stack();
> +	slots =3D DIV_ROUND_UP(offset + len, PAGE_SIZE) +
> +		xennet_count_skb_frag_slots(skb);
> +	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
> +		net_alert_ratelimited(
> +			"xennet: skb rides the rocket: %d slots\n", slots);
>  		goto drop;
>  	}
> =20
>  	spin_lock_irqsave(&np->tx_lock, flags);
> =20
>  	if (unlikely(!netif_carrier_ok(dev) ||
> -		     (frags > 1 && !xennet_can_sg(dev)) ||
> +		     (slots > 1 && !xennet_can_sg(dev)) ||
>  		     netif_needs_gso(skb, netif_skb_features(skb)))) {
>  		spin_unlock_irqrestore(&np->tx_lock, flags);
>  		goto drop;
>=20



--------------enig91DCED7CD60A1DB594E4A616
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBCgAGBQJQrNr1AAoJEOhnXe7L7s6jVJgP/Ri1PSISucuJDNdgj/1ievSj
GVFnGTgYDMVCh2/afk8CAnkmlfIiVyPyhko/EDtkd9BJYucPjwg8VHWnDFUyNqbG
vG1KLxddOd0YERQjSzr9eZltwyUlsVWLuJYZcF75D4Jq7F9e+Qv4b8GHH6m+0O+r
vaEuRA/KvKzLzLlqcneV2SBy8YrqI6YgPlViE0fAZV8jTthL6oR1jVBerWeMuM9p
J/YllFICR+JxIB6HHnI8U1c9uHgeL/wzZnmyXIAZxAMBKrzracmmQ5J3xIfx0DRS
Mu19JhXGwcYZl7Vcuc4uR9BLef4Icy0IhxVGiKfJITqA1LIEo2drQtQSGYFgwU0g
nRzW4VEhllmbuCtOh5O4RAShjkihRcnhgQypO/mU5R0VAw/9dnasG/9E/r4P65no
V2vGr6K1ewJWvmZ7vl+cNRHX84JHDU3SBdjfAnsDNDcjijJeMX0m5ltP0Tq9IgCZ
g0nniIhXTSyiJSNvEvipMHhJ80GErgQQTtaFcbtOlzgIqi5uX1vCD+MdxV7Y49qj
L9OAf+elF7D+tvRauwaJ/++/Wh84ELI9d4lGatU1aLjDJ6RB9Vi9j8iBnT9p03m4
oMS2PMOMatEX09HwFHL7dKYU1xjtt6N2NDpyzTrdbtQQPkf1YKsLbqFFfy2GNsWa
D47SCm83pidUfYIZEOuw
=2+Ly
-----END PGP SIGNATURE-----

--------------enig91DCED7CD60A1DB594E4A616--


--===============7514796620666413442==
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.xen.org
http://lists.xen.org/xen-devel

--===============7514796620666413442==--


From xen-devel-bounces@lists.xen.org Wed Nov 21 13:46:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 13:46:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbAca-0000OA-Ok; Wed, 21 Nov 2012 13:45:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <stefan.bader@canonical.com>) id 1TbAcY-0000O5-Ra
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 13:45:43 +0000
Received: from [85.158.138.51:36818] by server-8.bemta-3.messagelabs.com id
	8E/F8-07786-10BDCA05; Wed, 21 Nov 2012 13:45:37 +0000
X-Env-Sender: stefan.bader@canonical.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1353505533!27391764!1
X-Originating-IP: [91.189.89.112]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10315 invoked from network); 21 Nov 2012 13:45:33 -0000
Received: from youngberry.canonical.com (HELO youngberry.canonical.com)
	(91.189.89.112) by server-2.tower-174.messagelabs.com with SMTP;
	21 Nov 2012 13:45:33 -0000
Received: from p5b2e214b.dip.t-dialin.net ([91.46.33.75] helo=[192.168.2.5])
	by youngberry.canonical.com with esmtpsa
	(TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71)
	(envelope-from <stefan.bader@canonical.com>)
	id 1TbAcJ-0005eG-Lt; Wed, 21 Nov 2012 13:45:27 +0000
Message-ID: <50ACDAF5.2030404@canonical.com>
Date: Wed, 21 Nov 2012 14:45:25 +0100
From: Stefan Bader <stefan.bader@canonical.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <ian.campbell@citrix.com>
References: <1353499336-28952-1-git-send-email-ian.campbell@citrix.com>
In-Reply-To: <1353499336-28952-1-git-send-email-ian.campbell@citrix.com>
X-Enigmail-Version: 1.4.5
Cc: Sander Eikelenboom <linux@eikelenboom.it>, netdev@vger.kernel.org,
	Eric Dumazet <edumazet@google.com>, xen-devel@lists.xen.org,
	Konrad Rzeszutek Wilk <konrad@kernel.org>, ANNIE LI <annie.li@oracle.com>
Subject: Re: [Xen-devel] [PATCH V3] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7514796620666413442=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============7514796620666413442==
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature";
 boundary="------------enig91DCED7CD60A1DB594E4A616"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig91DCED7CD60A1DB594E4A616
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

FWIW, I ran the v3 version and it appears to be good from that point of v=
iew.
If it looks good to everyone else, it would be great if that could reach =
3.7
final. :)

-Stefan

On 21.11.2012 13:02, Ian Campbell wrote:
> An SKB paged fragment can consist of a compound page with order > 0.
> However the netchannel protocol deals only in PAGE_SIZE frames.
>=20
> Handle this in xennet_make_frags by iterating over the frames which
> make up the page.
>=20
> This is the netfront equivalent to 6a8ed462f16b for netback.
>=20
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: netdev@vger.kernel.org
> Cc: xen-devel@lists.xen.org
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
> Cc: ANNIE LI <annie.li@oracle.com>
> Cc: Sander Eikelenboom <linux@eikelenboom.it>
> Cc: Stefan Bader <stefan.bader@canonical.com>
> ---
> v3: limit to 80-characters. Use net_alert_ratelimited.
> v2: check we have enough room in the ring and that the other end can
>     cope with the number of slots in a single frame
> ---
>  drivers/net/xen-netfront.c |   98 ++++++++++++++++++++++++++++++++++--=
-------
>  1 files changed, 77 insertions(+), 21 deletions(-)
>=20
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index caa0110..fc24eb9 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -452,29 +452,85 @@ static void xennet_make_frags(struct sk_buff *skb=
, struct net_device *dev,
>  	/* Grant backend access to each skb fragment page. */
>  	for (i =3D 0; i < frags; i++) {
>  		skb_frag_t *frag =3D skb_shinfo(skb)->frags + i;
> +		struct page *page =3D skb_frag_page(frag);
> =20
> -		tx->flags |=3D XEN_NETTXF_more_data;
> +		len =3D skb_frag_size(frag);
> +		offset =3D frag->page_offset;
> =20
> -		id =3D get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> -		np->tx_skbs[id].skb =3D skb_get(skb);
> -		tx =3D RING_GET_REQUEST(&np->tx, prod++);
> -		tx->id =3D id;
> -		ref =3D gnttab_claim_grant_reference(&np->gref_tx_head);
> -		BUG_ON((signed short)ref < 0);
> +		/* Data must not cross a page boundary. */
> +		BUG_ON(len + offset > PAGE_SIZE<<compound_order(page));
> =20
> -		mfn =3D pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
> -		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> -						mfn, GNTMAP_readonly);
> +		/* Skip unused frames from start of page */
> +		page +=3D offset >> PAGE_SHIFT;
> +		offset &=3D ~PAGE_MASK;
> =20
> -		tx->gref =3D np->grant_tx_ref[id] =3D ref;
> -		tx->offset =3D frag->page_offset;
> -		tx->size =3D skb_frag_size(frag);
> -		tx->flags =3D 0;
> +		while (len > 0) {
> +			unsigned long bytes;
> +
> +			BUG_ON(offset >=3D PAGE_SIZE);
> +
> +			bytes =3D PAGE_SIZE - offset;
> +			if (bytes > len)
> +				bytes =3D len;
> +
> +			tx->flags |=3D XEN_NETTXF_more_data;
> +
> +			id =3D get_id_from_freelist(&np->tx_skb_freelist,
> +						  np->tx_skbs);
> +			np->tx_skbs[id].skb =3D skb_get(skb);
> +			tx =3D RING_GET_REQUEST(&np->tx, prod++);
> +			tx->id =3D id;
> +			ref =3D gnttab_claim_grant_reference(&np->gref_tx_head);
> +			BUG_ON((signed short)ref < 0);
> +
> +			mfn =3D pfn_to_mfn(page_to_pfn(page));
> +			gnttab_grant_foreign_access_ref(ref,
> +							np->xbdev->otherend_id,
> +							mfn, GNTMAP_readonly);
> +
> +			tx->gref =3D np->grant_tx_ref[id] =3D ref;
> +			tx->offset =3D offset;
> +			tx->size =3D bytes;
> +			tx->flags =3D 0;
> +
> +			offset +=3D bytes;
> +			len -=3D bytes;
> +
> +			/* Next frame */
> +			if (offset =3D=3D PAGE_SIZE && len) {
> +				BUG_ON(!PageCompound(page));
> +				page++;
> +				offset =3D 0;
> +			}
> +		}
>  	}
> =20
>  	np->tx.req_prod_pvt =3D prod;
>  }
> =20
> +/*
> + * Count how many ring slots are required to send the frags of this
> + * skb. Each frag might be a compound page.
> + */
> +static int xennet_count_skb_frag_slots(struct sk_buff *skb)
> +{
> +	int i, frags =3D skb_shinfo(skb)->nr_frags;
> +	int pages =3D 0;
> +
> +	for (i =3D 0; i < frags; i++) {
> +		skb_frag_t *frag =3D skb_shinfo(skb)->frags + i;
> +		unsigned long size =3D skb_frag_size(frag);
> +		unsigned long offset =3D frag->page_offset;
> +
> +		/* Skip unused frames from start of page */
> +		offset &=3D ~PAGE_MASK;
> +
> +		pages +=3D PFN_UP(offset + size);
> +	}
> +
> +	return pages;
> +}
> +
>  static int xennet_start_xmit(struct sk_buff *skb, struct net_device *d=
ev)
>  {
>  	unsigned short id;
> @@ -487,23 +543,23 @@ static int xennet_start_xmit(struct sk_buff *skb,=
 struct net_device *dev)
>  	grant_ref_t ref;
>  	unsigned long mfn;
>  	int notify;
> -	int frags =3D skb_shinfo(skb)->nr_frags;
> +	int slots;
>  	unsigned int offset =3D offset_in_page(data);
>  	unsigned int len =3D skb_headlen(skb);
>  	unsigned long flags;
> =20
> -	frags +=3D DIV_ROUND_UP(offset + len, PAGE_SIZE);
> -	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
> -		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
> -		       frags);
> -		dump_stack();
> +	slots =3D DIV_ROUND_UP(offset + len, PAGE_SIZE) +
> +		xennet_count_skb_frag_slots(skb);
> +	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
> +		net_alert_ratelimited(
> +			"xennet: skb rides the rocket: %d slots\n", slots);
>  		goto drop;
>  	}
> =20
>  	spin_lock_irqsave(&np->tx_lock, flags);
> =20
>  	if (unlikely(!netif_carrier_ok(dev) ||
> -		     (frags > 1 && !xennet_can_sg(dev)) ||
> +		     (slots > 1 && !xennet_can_sg(dev)) ||
>  		     netif_needs_gso(skb, netif_skb_features(skb)))) {
>  		spin_unlock_irqrestore(&np->tx_lock, flags);
>  		goto drop;
>=20



--------------enig91DCED7CD60A1DB594E4A616
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBCgAGBQJQrNr1AAoJEOhnXe7L7s6jVJgP/Ri1PSISucuJDNdgj/1ievSj
GVFnGTgYDMVCh2/afk8CAnkmlfIiVyPyhko/EDtkd9BJYucPjwg8VHWnDFUyNqbG
vG1KLxddOd0YERQjSzr9eZltwyUlsVWLuJYZcF75D4Jq7F9e+Qv4b8GHH6m+0O+r
vaEuRA/KvKzLzLlqcneV2SBy8YrqI6YgPlViE0fAZV8jTthL6oR1jVBerWeMuM9p
J/YllFICR+JxIB6HHnI8U1c9uHgeL/wzZnmyXIAZxAMBKrzracmmQ5J3xIfx0DRS
Mu19JhXGwcYZl7Vcuc4uR9BLef4Icy0IhxVGiKfJITqA1LIEo2drQtQSGYFgwU0g
nRzW4VEhllmbuCtOh5O4RAShjkihRcnhgQypO/mU5R0VAw/9dnasG/9E/r4P65no
V2vGr6K1ewJWvmZ7vl+cNRHX84JHDU3SBdjfAnsDNDcjijJeMX0m5ltP0Tq9IgCZ
g0nniIhXTSyiJSNvEvipMHhJ80GErgQQTtaFcbtOlzgIqi5uX1vCD+MdxV7Y49qj
L9OAf+elF7D+tvRauwaJ/++/Wh84ELI9d4lGatU1aLjDJ6RB9Vi9j8iBnT9p03m4
oMS2PMOMatEX09HwFHL7dKYU1xjtt6N2NDpyzTrdbtQQPkf1YKsLbqFFfy2GNsWa
D47SCm83pidUfYIZEOuw
=2+Ly
-----END PGP SIGNATURE-----

--------------enig91DCED7CD60A1DB594E4A616--


--===============7514796620666413442==
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.xen.org
http://lists.xen.org/xen-devel

--===============7514796620666413442==--


From xen-devel-bounces@lists.xen.org Wed Nov 21 14:05:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 14:05:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbAvt-0000ud-Ur; Wed, 21 Nov 2012 14:05:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TbAvs-0000uY-M3
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 14:05:40 +0000
Received: from [85.158.143.35:7725] by server-3.bemta-4.messagelabs.com id
	4C/AB-06841-3BFDCA05; Wed, 21 Nov 2012 14:05:39 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1353506736!10719516!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUyNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11197 invoked from network); 21 Nov 2012 14:05:38 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-10.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 14:05:38 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="45293252"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 14:05:32 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 09:05:31 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TbAvj-0001Lg-Di;
	Wed, 21 Nov 2012 14:05:31 +0000
Message-ID: <50ACDE5D.302@eu.citrix.com>
Date: Wed, 21 Nov 2012 13:59:57 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "Liu, Jinsong" <jinsong.liu@intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
	<50ACBC50.4040204@eu.citrix.com>
	<1353499905.13542.139.camel@zakaz.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC82923353944A2@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923353944A2@SHSMSX101.ccr.corp.intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 21/11/12 13:26, Liu, Jinsong wrote:
> Ian Campbell wrote:
>> On Wed, 2012-11-21 at 11:34 +0000, George Dunlap wrote:
>>> On 20/11/12 18:42, Ian Jackson wrote:
>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>>> broken page with regard to migration"):
>>>>> Ian Jackson wrote:
>>>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>>>>> broken page with regard to migration"):
>>>>>>> No, at last lter, there are 4 points:
>>>>>>> 1. start last iter
>>>>>>> 2. get and transfer pfn_type to target
>>>>>>> 3. copy page to target
>>>>>>> 4. end last iter
>>>> ...
>>>>> It indeed checks mce after point 3 for each page, but what's the
>>>>> advantage of keeping a separate list?
>>>> It avoids yet another loop over all the pages.  Unless I have
>>>> misunderstood.  Which I may have, because: if it checks for mce
>>>> after
>>>> point 3 then surely that is sufficient ?  We don't need to worry
>>>> about
>>>> mces after that check.
>>> It's sufficient, but wouldn't each check require a separate
>>> hypercall? That would surely be slower than just a single hypercall
>>> and a loop (which is what Jinsong's patch does).
>>>
>>> We don't actually need a list -- I think we just need to know, "Have
>>> any pages broken between reading the p2m table (
>>> xc_get_pfn_type_batch() ); if so, we do another full iteration.
>> If a page fails between 2. and 3. above then what happens at point 3?
>> I presume we can't map and send the page (since it is broken), do we
>> get some sort of failure to map?
>>
>> What happens if the failure occurs during stage 3, i.e. while the page
>> is mapped and we are reading from it?
>>
>> Ian.
> If read a broken page, it generates more serious error (say, SRAR error).
> I don't think guest has good opportunity to survive under this case --> most probably it kill itself and of course we don't need care migration now.
> However, if guest can luckly survive (say complete broken page copying to target), it's OK to continue --> its broken pfn_type will transfer to target next iter so guest will kill itself if access then.

But in this case, I'm asking what happens if the migration code reads 
the page.  If reading the page in the migration code causes dom0 to 
crash, then the whole "last iteration" stuff is fairly pointless. :-)

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 14:05:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 14:05:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbAvt-0000ud-Ur; Wed, 21 Nov 2012 14:05:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TbAvs-0000uY-M3
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 14:05:40 +0000
Received: from [85.158.143.35:7725] by server-3.bemta-4.messagelabs.com id
	4C/AB-06841-3BFDCA05; Wed, 21 Nov 2012 14:05:39 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1353506736!10719516!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUyNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11197 invoked from network); 21 Nov 2012 14:05:38 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-10.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 14:05:38 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="45293252"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 14:05:32 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 09:05:31 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TbAvj-0001Lg-Di;
	Wed, 21 Nov 2012 14:05:31 +0000
Message-ID: <50ACDE5D.302@eu.citrix.com>
Date: Wed, 21 Nov 2012 13:59:57 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "Liu, Jinsong" <jinsong.liu@intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
	<50ACBC50.4040204@eu.citrix.com>
	<1353499905.13542.139.camel@zakaz.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC82923353944A2@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923353944A2@SHSMSX101.ccr.corp.intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 21/11/12 13:26, Liu, Jinsong wrote:
> Ian Campbell wrote:
>> On Wed, 2012-11-21 at 11:34 +0000, George Dunlap wrote:
>>> On 20/11/12 18:42, Ian Jackson wrote:
>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>>> broken page with regard to migration"):
>>>>> Ian Jackson wrote:
>>>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>>>>> broken page with regard to migration"):
>>>>>>> No, at last lter, there are 4 points:
>>>>>>> 1. start last iter
>>>>>>> 2. get and transfer pfn_type to target
>>>>>>> 3. copy page to target
>>>>>>> 4. end last iter
>>>> ...
>>>>> It indeed checks mce after point 3 for each page, but what's the
>>>>> advantage of keeping a separate list?
>>>> It avoids yet another loop over all the pages.  Unless I have
>>>> misunderstood.  Which I may have, because: if it checks for mce
>>>> after
>>>> point 3 then surely that is sufficient ?  We don't need to worry
>>>> about
>>>> mces after that check.
>>> It's sufficient, but wouldn't each check require a separate
>>> hypercall? That would surely be slower than just a single hypercall
>>> and a loop (which is what Jinsong's patch does).
>>>
>>> We don't actually need a list -- I think we just need to know, "Have
>>> any pages broken between reading the p2m table (
>>> xc_get_pfn_type_batch() ); if so, we do another full iteration.
>> If a page fails between 2. and 3. above then what happens at point 3?
>> I presume we can't map and send the page (since it is broken), do we
>> get some sort of failure to map?
>>
>> What happens if the failure occurs during stage 3, i.e. while the page
>> is mapped and we are reading from it?
>>
>> Ian.
> If read a broken page, it generates more serious error (say, SRAR error).
> I don't think guest has good opportunity to survive under this case --> most probably it kill itself and of course we don't need care migration now.
> However, if guest can luckly survive (say complete broken page copying to target), it's OK to continue --> its broken pfn_type will transfer to target next iter so guest will kill itself if access then.

But in this case, I'm asking what happens if the migration code reads 
the page.  If reading the page in the migration code causes dom0 to 
crash, then the whole "last iteration" stuff is fairly pointless. :-)

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 15:14:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 15:14:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbBzd-0001kh-De; Wed, 21 Nov 2012 15:13:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <eric.dumazet@gmail.com>) id 1TbBzb-0001kc-O5
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 15:13:35 +0000
Received: from [85.158.137.99:60784] by server-9.bemta-3.messagelabs.com id
	F9/9E-02388-A9FECA05; Wed, 21 Nov 2012 15:13:30 +0000
X-Env-Sender: eric.dumazet@gmail.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1353510808!15241480!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28924 invoked from network); 21 Nov 2012 15:13:29 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 15:13:29 -0000
Received: by mail-ie0-f173.google.com with SMTP id e13so454291iej.32
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 07:13:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=subject:from:to:cc:in-reply-to:references:content-type:date
	:message-id:mime-version:x-mailer:content-transfer-encoding;
	bh=hiN9L4IfRuATQlHsom2MUkg/d4P6/tBMJFEoummNqwk=;
	b=RQB1cQgyXDVK29dyas/LInLDzDxaRUj20YWdR/+fmSDvMVuSbxFw0GzCVtoh1oZ1OG
	Q8BBpXG0nd5DUH8xhuyHv2hYrXKbrcMTe5sf5F5SpNjaNbiHKx5WO3jkaEpKD4z7h+MV
	1+13aBS5fHLDmFJZDfYs+unoLpy2rSy8U7NW/i+Qzmieu4wmvGHdxMgtvo5aNez0CKpp
	9nSiLj/LkYmDryEC6VpubmBlWaTMkgtc8RdNPSuWaqkyCaV+FIxfD/IaO0H3hrl6k1yp
	J3rAR4DA1ZxjBCG428c83jn+gWmL3PWAPTumc1UNFTHczn2VVlQpahS3dx7SVEO3aovF
	iQhQ==
Received: by 10.50.152.240 with SMTP id vb16mr14253506igb.45.1353510807933;
	Wed, 21 Nov 2012 07:13:27 -0800 (PST)
Received: from [172.16.51.65] ([172.16.51.65])
	by mx.google.com with ESMTPS id gs6sm269676igc.11.2012.11.21.07.13.25
	(version=SSLv3 cipher=OTHER); Wed, 21 Nov 2012 07:13:26 -0800 (PST)
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1353499727.13542.137.camel@zakaz.uk.xensource.com>
References: <1353427257-16789-1-git-send-email-ian.campbell@citrix.com>
	<1353428844.2590.17.camel@edumazet-glaptop>
	<1353499727.13542.137.camel@zakaz.uk.xensource.com>
Date: Wed, 21 Nov 2012 07:13:24 -0800
Message-ID: <1353510804.2590.38.camel@edumazet-glaptop>
Mime-Version: 1.0
X-Mailer: Evolution 2.28.3 
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH V2] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-21 at 12:08 +0000, Ian Campbell wrote:
> The max-frag related limitation comes from the "wire" protocol used
> between front and back. As it stands either the frontend or the backend
> is more than likely going to drop the sort of pathalogical skbs you are
> worried.
> 
> I agree that this absolutely needs to be fixed in the protocol (and I've
> posted a call to arms on this topic on xen-devel) but I'd like to do it
> in a coordinated manner as part of a protocol extension (where the front
> and backend negotiate the maximum number of order-0 pages per Ethernet
> frame they are willing to handle) rather than as a side effect of this
> patch.
> 
> So right now I don't want to introduce frontends which default to
> sending increased numbers of pages in to the wild, since that makes
> things more complex when we come to extend the protocol.
> 
> Perhaps in the short term doing an skb_linearize when we hit this case
> would help, that will turn the pathalogical skb into a much more normal
> one. It'll be expensive but it should be rare. That assumes you can
> linearize such a large skb, which depends on the ability to allocate
> large order pages which isn't a given. Herm, maybe that doesn't work
> then.
> 

First of all, thanks a lot for all these detailed informations.

This now makes sense !


> AFAIK we don't have an existing skb_foo operation which copies an skb,
> including (or only) the frags, with the side effect of aligning and
> coalescing them. Do we?
> 

No, we only have the full linearize helper, and skb_try_coalesce()
helpers.

TCP stack uses an internal function to collapse several skbs so skbs
using a single page, I guess we could generalize this and make it
available to other uses.

Thanks !



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 15:14:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 15:14:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbBzd-0001kh-De; Wed, 21 Nov 2012 15:13:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <eric.dumazet@gmail.com>) id 1TbBzb-0001kc-O5
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 15:13:35 +0000
Received: from [85.158.137.99:60784] by server-9.bemta-3.messagelabs.com id
	F9/9E-02388-A9FECA05; Wed, 21 Nov 2012 15:13:30 +0000
X-Env-Sender: eric.dumazet@gmail.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1353510808!15241480!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28924 invoked from network); 21 Nov 2012 15:13:29 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 15:13:29 -0000
Received: by mail-ie0-f173.google.com with SMTP id e13so454291iej.32
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 07:13:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=subject:from:to:cc:in-reply-to:references:content-type:date
	:message-id:mime-version:x-mailer:content-transfer-encoding;
	bh=hiN9L4IfRuATQlHsom2MUkg/d4P6/tBMJFEoummNqwk=;
	b=RQB1cQgyXDVK29dyas/LInLDzDxaRUj20YWdR/+fmSDvMVuSbxFw0GzCVtoh1oZ1OG
	Q8BBpXG0nd5DUH8xhuyHv2hYrXKbrcMTe5sf5F5SpNjaNbiHKx5WO3jkaEpKD4z7h+MV
	1+13aBS5fHLDmFJZDfYs+unoLpy2rSy8U7NW/i+Qzmieu4wmvGHdxMgtvo5aNez0CKpp
	9nSiLj/LkYmDryEC6VpubmBlWaTMkgtc8RdNPSuWaqkyCaV+FIxfD/IaO0H3hrl6k1yp
	J3rAR4DA1ZxjBCG428c83jn+gWmL3PWAPTumc1UNFTHczn2VVlQpahS3dx7SVEO3aovF
	iQhQ==
Received: by 10.50.152.240 with SMTP id vb16mr14253506igb.45.1353510807933;
	Wed, 21 Nov 2012 07:13:27 -0800 (PST)
Received: from [172.16.51.65] ([172.16.51.65])
	by mx.google.com with ESMTPS id gs6sm269676igc.11.2012.11.21.07.13.25
	(version=SSLv3 cipher=OTHER); Wed, 21 Nov 2012 07:13:26 -0800 (PST)
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1353499727.13542.137.camel@zakaz.uk.xensource.com>
References: <1353427257-16789-1-git-send-email-ian.campbell@citrix.com>
	<1353428844.2590.17.camel@edumazet-glaptop>
	<1353499727.13542.137.camel@zakaz.uk.xensource.com>
Date: Wed, 21 Nov 2012 07:13:24 -0800
Message-ID: <1353510804.2590.38.camel@edumazet-glaptop>
Mime-Version: 1.0
X-Mailer: Evolution 2.28.3 
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH V2] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-21 at 12:08 +0000, Ian Campbell wrote:
> The max-frag related limitation comes from the "wire" protocol used
> between front and back. As it stands either the frontend or the backend
> is more than likely going to drop the sort of pathalogical skbs you are
> worried.
> 
> I agree that this absolutely needs to be fixed in the protocol (and I've
> posted a call to arms on this topic on xen-devel) but I'd like to do it
> in a coordinated manner as part of a protocol extension (where the front
> and backend negotiate the maximum number of order-0 pages per Ethernet
> frame they are willing to handle) rather than as a side effect of this
> patch.
> 
> So right now I don't want to introduce frontends which default to
> sending increased numbers of pages in to the wild, since that makes
> things more complex when we come to extend the protocol.
> 
> Perhaps in the short term doing an skb_linearize when we hit this case
> would help, that will turn the pathalogical skb into a much more normal
> one. It'll be expensive but it should be rare. That assumes you can
> linearize such a large skb, which depends on the ability to allocate
> large order pages which isn't a given. Herm, maybe that doesn't work
> then.
> 

First of all, thanks a lot for all these detailed informations.

This now makes sense !


> AFAIK we don't have an existing skb_foo operation which copies an skb,
> including (or only) the frags, with the side effect of aligning and
> coalescing them. Do we?
> 

No, we only have the full linearize helper, and skb_try_coalesce()
helpers.

TCP stack uses an internal function to collapse several skbs so skbs
using a single page, I guess we could generalize this and make it
available to other uses.

Thanks !



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 15:14:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 15:14:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbC01-0001lr-SD; Wed, 21 Nov 2012 15:14:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <eric.dumazet@gmail.com>) id 1TbC00-0001lh-SB
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 15:14:01 +0000
Received: from [85.158.137.99:64562] by server-10.bemta-3.messagelabs.com id
	19/A2-19806-4BFECA05; Wed, 21 Nov 2012 15:13:56 +0000
X-Env-Sender: eric.dumazet@gmail.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1353510808!15241480!2
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30630 invoked from network); 21 Nov 2012 15:13:56 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 15:13:56 -0000
Received: by mail-ie0-f173.google.com with SMTP id e13so454291iej.32
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 07:13:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=subject:from:to:cc:in-reply-to:references:content-type:date
	:message-id:mime-version:x-mailer:content-transfer-encoding;
	bh=7QxYfQBW9iyDawdVJ2FPJ23RwG+9XMm84h8loqfbYdo=;
	b=Qyvg6WyF7pArr+lZs0M7pGVy6PTEoBUtadKtQbHoRhjnB4JBDtpiwjsOwWtnNnBwKk
	HTHoN1RgkYJLICvaJONMWJPGIkvvzhXjAwsuRSv1Rz21rwYmb33Lqu96Th2odpTx+tIj
	UnqFKlklCgvmp1jvdci0IQDNCao/qE76mrFPFCTvwi+AvXPfMT5XSdY3ZtkIXGSxaV1L
	ROOK4Ije8+Y9w4AvZcqhwdBy/CpsZTg2lX/hiogXssNlEr1i9Xf/ujEsxm0JaZf3yKur
	YO9H2vj4G5W33LUorW5O/DZy0GysWuiJUAXFZ/ZRD3EKSCgqveLpgJceX+Qr3mlagz8G
	IGMg==
Received: by 10.50.158.201 with SMTP id ww9mr14231963igb.22.1353510834340;
	Wed, 21 Nov 2012 07:13:54 -0800 (PST)
Received: from [172.16.51.65] ([172.16.51.65])
	by mx.google.com with ESMTPS id uz1sm261941igb.16.2012.11.21.07.13.52
	(version=SSLv3 cipher=OTHER); Wed, 21 Nov 2012 07:13:53 -0800 (PST)
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ian Campbell <ian.campbell@citrix.com>
In-Reply-To: <1353499336-28952-1-git-send-email-ian.campbell@citrix.com>
References: <1353499336-28952-1-git-send-email-ian.campbell@citrix.com>
Date: Wed, 21 Nov 2012 07:13:52 -0800
Message-ID: <1353510832.2590.39.camel@edumazet-glaptop>
Mime-Version: 1.0
X-Mailer: Evolution 2.28.3 
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>, netdev@vger.kernel.org,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	xen-devel@lists.xen.org, Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH V3] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-21 at 12:02 +0000, Ian Campbell wrote:
> An SKB paged fragment can consist of a compound page with order > 0.
> However the netchannel protocol deals only in PAGE_SIZE frames.
> 
> Handle this in xennet_make_frags by iterating over the frames which
> make up the page.
> 
> This is the netfront equivalent to 6a8ed462f16b for netback.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: netdev@vger.kernel.org
> Cc: xen-devel@lists.xen.org
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
> Cc: ANNIE LI <annie.li@oracle.com>
> Cc: Sander Eikelenboom <linux@eikelenboom.it>
> Cc: Stefan Bader <stefan.bader@canonical.com>
> ---
> v3: limit to 80-characters. Use net_alert_ratelimited.
> v2: check we have enough room in the ring and that the other end can
>     cope with the number of slots in a single frame
> ---

Acked-by: Eric Dumazet <edumazet@google.com>




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 15:14:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 15:14:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbC01-0001lr-SD; Wed, 21 Nov 2012 15:14:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <eric.dumazet@gmail.com>) id 1TbC00-0001lh-SB
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 15:14:01 +0000
Received: from [85.158.137.99:64562] by server-10.bemta-3.messagelabs.com id
	19/A2-19806-4BFECA05; Wed, 21 Nov 2012 15:13:56 +0000
X-Env-Sender: eric.dumazet@gmail.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1353510808!15241480!2
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30630 invoked from network); 21 Nov 2012 15:13:56 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 15:13:56 -0000
Received: by mail-ie0-f173.google.com with SMTP id e13so454291iej.32
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 07:13:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=subject:from:to:cc:in-reply-to:references:content-type:date
	:message-id:mime-version:x-mailer:content-transfer-encoding;
	bh=7QxYfQBW9iyDawdVJ2FPJ23RwG+9XMm84h8loqfbYdo=;
	b=Qyvg6WyF7pArr+lZs0M7pGVy6PTEoBUtadKtQbHoRhjnB4JBDtpiwjsOwWtnNnBwKk
	HTHoN1RgkYJLICvaJONMWJPGIkvvzhXjAwsuRSv1Rz21rwYmb33Lqu96Th2odpTx+tIj
	UnqFKlklCgvmp1jvdci0IQDNCao/qE76mrFPFCTvwi+AvXPfMT5XSdY3ZtkIXGSxaV1L
	ROOK4Ije8+Y9w4AvZcqhwdBy/CpsZTg2lX/hiogXssNlEr1i9Xf/ujEsxm0JaZf3yKur
	YO9H2vj4G5W33LUorW5O/DZy0GysWuiJUAXFZ/ZRD3EKSCgqveLpgJceX+Qr3mlagz8G
	IGMg==
Received: by 10.50.158.201 with SMTP id ww9mr14231963igb.22.1353510834340;
	Wed, 21 Nov 2012 07:13:54 -0800 (PST)
Received: from [172.16.51.65] ([172.16.51.65])
	by mx.google.com with ESMTPS id uz1sm261941igb.16.2012.11.21.07.13.52
	(version=SSLv3 cipher=OTHER); Wed, 21 Nov 2012 07:13:53 -0800 (PST)
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ian Campbell <ian.campbell@citrix.com>
In-Reply-To: <1353499336-28952-1-git-send-email-ian.campbell@citrix.com>
References: <1353499336-28952-1-git-send-email-ian.campbell@citrix.com>
Date: Wed, 21 Nov 2012 07:13:52 -0800
Message-ID: <1353510832.2590.39.camel@edumazet-glaptop>
Mime-Version: 1.0
X-Mailer: Evolution 2.28.3 
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>, netdev@vger.kernel.org,
	ANNIE LI <annie.li@oracle.com>, Stefan Bader <stefan.bader@canonical.com>,
	xen-devel@lists.xen.org, Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH V3] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-21 at 12:02 +0000, Ian Campbell wrote:
> An SKB paged fragment can consist of a compound page with order > 0.
> However the netchannel protocol deals only in PAGE_SIZE frames.
> 
> Handle this in xennet_make_frags by iterating over the frames which
> make up the page.
> 
> This is the netfront equivalent to 6a8ed462f16b for netback.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: netdev@vger.kernel.org
> Cc: xen-devel@lists.xen.org
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
> Cc: ANNIE LI <annie.li@oracle.com>
> Cc: Sander Eikelenboom <linux@eikelenboom.it>
> Cc: Stefan Bader <stefan.bader@canonical.com>
> ---
> v3: limit to 80-characters. Use net_alert_ratelimited.
> v2: check we have enough room in the ring and that the other end can
>     cope with the number of slots in a single frame
> ---

Acked-by: Eric Dumazet <edumazet@google.com>




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 15:17:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 15:17:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbC2b-0001vm-EE; Wed, 21 Nov 2012 15:16:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TbC2a-0001vg-1Y
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 15:16:40 +0000
Received: from [85.158.143.99:28628] by server-1.bemta-4.messagelabs.com id
	2C/9F-27934-750FCA05; Wed, 21 Nov 2012 15:16:39 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1353510994!19629637!1
X-Originating-IP: [209.85.216.52]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17094 invoked from network); 21 Nov 2012 15:16:35 -0000
Received: from mail-qa0-f52.google.com (HELO mail-qa0-f52.google.com)
	(209.85.216.52)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 15:16:35 -0000
Received: by mail-qa0-f52.google.com with SMTP id g14so1809781qab.11
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 07:16:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=I8hmSI74kCzQqRNuvninUeAG+pq89vMoMhbQ9BCbBOA=;
	b=zlgKGg1tPm5SWRqB/z/8uiCViyYRqXmpxk5w7XGSXz2pfYthb8cpAXw4xHaG9P6k3Y
	9lTJgXGz9GLApkPQRVXJdelBf3geldx33AipLSdmwdwCIyAHhsjONvzEvwoOfnKb0xP9
	YWZ/ucrxC6Yp4M8K++VpYHm/B+QZnawPuhTP7HZgQACRXx7IewANqzYNNs3i6mqA9y7f
	DtyJxfQaFbOvgS2uF4z8Qv0qr1Qz+Wl8UiyETVAh8SPrRaZoiknNfaAx/uzYRqjz1w19
	3J1LRQRJ9EBcRSLPtfLmgHrA1j7EBtuPvB96QaxwJMawg/ynwn3rHm0t+x0oGsyjr0Bt
	IiAw==
Received: by 10.49.87.230 with SMTP id bb6mr21297809qeb.18.1353510994392;
	Wed, 21 Nov 2012 07:16:34 -0800 (PST)
Received: from konrad-lan.dumpdata.com
	(50-195-21-189-static.hfc.comcastbusiness.net. [50.195.21.189])
	by mx.google.com with ESMTPS id i9sm402993qak.3.2012.11.21.07.16.32
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 21 Nov 2012 07:16:33 -0800 (PST)
Date: Wed, 21 Nov 2012 10:16:27 -0500
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Ian Campbell <ian.campbell@citrix.com>, davem@davemloft.net
Message-ID: <20121121151625.GA13127@konrad-lan.dumpdata.com>
References: <1353499336-28952-1-git-send-email-ian.campbell@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353499336-28952-1-git-send-email-ian.campbell@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: netdev@vger.kernel.org, ANNIE LI <annie.li@oracle.com>,
	Stefan Bader <stefan.bader@canonical.com>, xen-devel@lists.xen.org,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH V3] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 21, 2012 at 12:02:16PM +0000, Ian Campbell wrote:
> An SKB paged fragment can consist of a compound page with order > 0.
> However the netchannel protocol deals only in PAGE_SIZE frames.
> 
> Handle this in xennet_make_frags by iterating over the frames which
> make up the page.
> 
> This is the netfront equivalent to 6a8ed462f16b for netback.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: netdev@vger.kernel.org
> Cc: xen-devel@lists.xen.org
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>

Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

David, would you like me to send it to Linus via my tree or are you
OK sending him a git pull with this patch (and hopefully some other
ones?)

Thank you.

> Cc: ANNIE LI <annie.li@oracle.com>
> Cc: Sander Eikelenboom <linux@eikelenboom.it>
> Cc: Stefan Bader <stefan.bader@canonical.com>
> ---
> v3: limit to 80-characters. Use net_alert_ratelimited.
> v2: check we have enough room in the ring and that the other end can
>     cope with the number of slots in a single frame
> ---
>  drivers/net/xen-netfront.c |   98 ++++++++++++++++++++++++++++++++++---------
>  1 files changed, 77 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index caa0110..fc24eb9 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -452,29 +452,85 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
>  	/* Grant backend access to each skb fragment page. */
>  	for (i = 0; i < frags; i++) {
>  		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
> +		struct page *page = skb_frag_page(frag);
>  
> -		tx->flags |= XEN_NETTXF_more_data;
> +		len = skb_frag_size(frag);
> +		offset = frag->page_offset;
>  
> -		id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> -		np->tx_skbs[id].skb = skb_get(skb);
> -		tx = RING_GET_REQUEST(&np->tx, prod++);
> -		tx->id = id;
> -		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
> -		BUG_ON((signed short)ref < 0);
> +		/* Data must not cross a page boundary. */
> +		BUG_ON(len + offset > PAGE_SIZE<<compound_order(page));
>  
> -		mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
> -		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> -						mfn, GNTMAP_readonly);
> +		/* Skip unused frames from start of page */
> +		page += offset >> PAGE_SHIFT;
> +		offset &= ~PAGE_MASK;
>  
> -		tx->gref = np->grant_tx_ref[id] = ref;
> -		tx->offset = frag->page_offset;
> -		tx->size = skb_frag_size(frag);
> -		tx->flags = 0;
> +		while (len > 0) {
> +			unsigned long bytes;
> +
> +			BUG_ON(offset >= PAGE_SIZE);
> +
> +			bytes = PAGE_SIZE - offset;
> +			if (bytes > len)
> +				bytes = len;
> +
> +			tx->flags |= XEN_NETTXF_more_data;
> +
> +			id = get_id_from_freelist(&np->tx_skb_freelist,
> +						  np->tx_skbs);
> +			np->tx_skbs[id].skb = skb_get(skb);
> +			tx = RING_GET_REQUEST(&np->tx, prod++);
> +			tx->id = id;
> +			ref = gnttab_claim_grant_reference(&np->gref_tx_head);
> +			BUG_ON((signed short)ref < 0);
> +
> +			mfn = pfn_to_mfn(page_to_pfn(page));
> +			gnttab_grant_foreign_access_ref(ref,
> +							np->xbdev->otherend_id,
> +							mfn, GNTMAP_readonly);
> +
> +			tx->gref = np->grant_tx_ref[id] = ref;
> +			tx->offset = offset;
> +			tx->size = bytes;
> +			tx->flags = 0;
> +
> +			offset += bytes;
> +			len -= bytes;
> +
> +			/* Next frame */
> +			if (offset == PAGE_SIZE && len) {
> +				BUG_ON(!PageCompound(page));
> +				page++;
> +				offset = 0;
> +			}
> +		}
>  	}
>  
>  	np->tx.req_prod_pvt = prod;
>  }
>  
> +/*
> + * Count how many ring slots are required to send the frags of this
> + * skb. Each frag might be a compound page.
> + */
> +static int xennet_count_skb_frag_slots(struct sk_buff *skb)
> +{
> +	int i, frags = skb_shinfo(skb)->nr_frags;
> +	int pages = 0;
> +
> +	for (i = 0; i < frags; i++) {
> +		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
> +		unsigned long size = skb_frag_size(frag);
> +		unsigned long offset = frag->page_offset;
> +
> +		/* Skip unused frames from start of page */
> +		offset &= ~PAGE_MASK;
> +
> +		pages += PFN_UP(offset + size);
> +	}
> +
> +	return pages;
> +}
> +
>  static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  {
>  	unsigned short id;
> @@ -487,23 +543,23 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  	grant_ref_t ref;
>  	unsigned long mfn;
>  	int notify;
> -	int frags = skb_shinfo(skb)->nr_frags;
> +	int slots;
>  	unsigned int offset = offset_in_page(data);
>  	unsigned int len = skb_headlen(skb);
>  	unsigned long flags;
>  
> -	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
> -	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
> -		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
> -		       frags);
> -		dump_stack();
> +	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
> +		xennet_count_skb_frag_slots(skb);
> +	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
> +		net_alert_ratelimited(
> +			"xennet: skb rides the rocket: %d slots\n", slots);
>  		goto drop;
>  	}
>  
>  	spin_lock_irqsave(&np->tx_lock, flags);
>  
>  	if (unlikely(!netif_carrier_ok(dev) ||
> -		     (frags > 1 && !xennet_can_sg(dev)) ||
> +		     (slots > 1 && !xennet_can_sg(dev)) ||
>  		     netif_needs_gso(skb, netif_skb_features(skb)))) {
>  		spin_unlock_irqrestore(&np->tx_lock, flags);
>  		goto drop;
> -- 
> 1.7.2.5
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 15:17:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 15:17:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbC2b-0001vm-EE; Wed, 21 Nov 2012 15:16:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TbC2a-0001vg-1Y
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 15:16:40 +0000
Received: from [85.158.143.99:28628] by server-1.bemta-4.messagelabs.com id
	2C/9F-27934-750FCA05; Wed, 21 Nov 2012 15:16:39 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1353510994!19629637!1
X-Originating-IP: [209.85.216.52]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17094 invoked from network); 21 Nov 2012 15:16:35 -0000
Received: from mail-qa0-f52.google.com (HELO mail-qa0-f52.google.com)
	(209.85.216.52)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 15:16:35 -0000
Received: by mail-qa0-f52.google.com with SMTP id g14so1809781qab.11
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 07:16:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=I8hmSI74kCzQqRNuvninUeAG+pq89vMoMhbQ9BCbBOA=;
	b=zlgKGg1tPm5SWRqB/z/8uiCViyYRqXmpxk5w7XGSXz2pfYthb8cpAXw4xHaG9P6k3Y
	9lTJgXGz9GLApkPQRVXJdelBf3geldx33AipLSdmwdwCIyAHhsjONvzEvwoOfnKb0xP9
	YWZ/ucrxC6Yp4M8K++VpYHm/B+QZnawPuhTP7HZgQACRXx7IewANqzYNNs3i6mqA9y7f
	DtyJxfQaFbOvgS2uF4z8Qv0qr1Qz+Wl8UiyETVAh8SPrRaZoiknNfaAx/uzYRqjz1w19
	3J1LRQRJ9EBcRSLPtfLmgHrA1j7EBtuPvB96QaxwJMawg/ynwn3rHm0t+x0oGsyjr0Bt
	IiAw==
Received: by 10.49.87.230 with SMTP id bb6mr21297809qeb.18.1353510994392;
	Wed, 21 Nov 2012 07:16:34 -0800 (PST)
Received: from konrad-lan.dumpdata.com
	(50-195-21-189-static.hfc.comcastbusiness.net. [50.195.21.189])
	by mx.google.com with ESMTPS id i9sm402993qak.3.2012.11.21.07.16.32
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 21 Nov 2012 07:16:33 -0800 (PST)
Date: Wed, 21 Nov 2012 10:16:27 -0500
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Ian Campbell <ian.campbell@citrix.com>, davem@davemloft.net
Message-ID: <20121121151625.GA13127@konrad-lan.dumpdata.com>
References: <1353499336-28952-1-git-send-email-ian.campbell@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353499336-28952-1-git-send-email-ian.campbell@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: netdev@vger.kernel.org, ANNIE LI <annie.li@oracle.com>,
	Stefan Bader <stefan.bader@canonical.com>, xen-devel@lists.xen.org,
	Sander Eikelenboom <linux@eikelenboom.it>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Xen-devel] [PATCH V3] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 21, 2012 at 12:02:16PM +0000, Ian Campbell wrote:
> An SKB paged fragment can consist of a compound page with order > 0.
> However the netchannel protocol deals only in PAGE_SIZE frames.
> 
> Handle this in xennet_make_frags by iterating over the frames which
> make up the page.
> 
> This is the netfront equivalent to 6a8ed462f16b for netback.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: netdev@vger.kernel.org
> Cc: xen-devel@lists.xen.org
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>

Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

David, would you like me to send it to Linus via my tree or are you
OK sending him a git pull with this patch (and hopefully some other
ones?)

Thank you.

> Cc: ANNIE LI <annie.li@oracle.com>
> Cc: Sander Eikelenboom <linux@eikelenboom.it>
> Cc: Stefan Bader <stefan.bader@canonical.com>
> ---
> v3: limit to 80-characters. Use net_alert_ratelimited.
> v2: check we have enough room in the ring and that the other end can
>     cope with the number of slots in a single frame
> ---
>  drivers/net/xen-netfront.c |   98 ++++++++++++++++++++++++++++++++++---------
>  1 files changed, 77 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index caa0110..fc24eb9 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -452,29 +452,85 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
>  	/* Grant backend access to each skb fragment page. */
>  	for (i = 0; i < frags; i++) {
>  		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
> +		struct page *page = skb_frag_page(frag);
>  
> -		tx->flags |= XEN_NETTXF_more_data;
> +		len = skb_frag_size(frag);
> +		offset = frag->page_offset;
>  
> -		id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
> -		np->tx_skbs[id].skb = skb_get(skb);
> -		tx = RING_GET_REQUEST(&np->tx, prod++);
> -		tx->id = id;
> -		ref = gnttab_claim_grant_reference(&np->gref_tx_head);
> -		BUG_ON((signed short)ref < 0);
> +		/* Data must not cross a page boundary. */
> +		BUG_ON(len + offset > PAGE_SIZE<<compound_order(page));
>  
> -		mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag)));
> -		gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id,
> -						mfn, GNTMAP_readonly);
> +		/* Skip unused frames from start of page */
> +		page += offset >> PAGE_SHIFT;
> +		offset &= ~PAGE_MASK;
>  
> -		tx->gref = np->grant_tx_ref[id] = ref;
> -		tx->offset = frag->page_offset;
> -		tx->size = skb_frag_size(frag);
> -		tx->flags = 0;
> +		while (len > 0) {
> +			unsigned long bytes;
> +
> +			BUG_ON(offset >= PAGE_SIZE);
> +
> +			bytes = PAGE_SIZE - offset;
> +			if (bytes > len)
> +				bytes = len;
> +
> +			tx->flags |= XEN_NETTXF_more_data;
> +
> +			id = get_id_from_freelist(&np->tx_skb_freelist,
> +						  np->tx_skbs);
> +			np->tx_skbs[id].skb = skb_get(skb);
> +			tx = RING_GET_REQUEST(&np->tx, prod++);
> +			tx->id = id;
> +			ref = gnttab_claim_grant_reference(&np->gref_tx_head);
> +			BUG_ON((signed short)ref < 0);
> +
> +			mfn = pfn_to_mfn(page_to_pfn(page));
> +			gnttab_grant_foreign_access_ref(ref,
> +							np->xbdev->otherend_id,
> +							mfn, GNTMAP_readonly);
> +
> +			tx->gref = np->grant_tx_ref[id] = ref;
> +			tx->offset = offset;
> +			tx->size = bytes;
> +			tx->flags = 0;
> +
> +			offset += bytes;
> +			len -= bytes;
> +
> +			/* Next frame */
> +			if (offset == PAGE_SIZE && len) {
> +				BUG_ON(!PageCompound(page));
> +				page++;
> +				offset = 0;
> +			}
> +		}
>  	}
>  
>  	np->tx.req_prod_pvt = prod;
>  }
>  
> +/*
> + * Count how many ring slots are required to send the frags of this
> + * skb. Each frag might be a compound page.
> + */
> +static int xennet_count_skb_frag_slots(struct sk_buff *skb)
> +{
> +	int i, frags = skb_shinfo(skb)->nr_frags;
> +	int pages = 0;
> +
> +	for (i = 0; i < frags; i++) {
> +		skb_frag_t *frag = skb_shinfo(skb)->frags + i;
> +		unsigned long size = skb_frag_size(frag);
> +		unsigned long offset = frag->page_offset;
> +
> +		/* Skip unused frames from start of page */
> +		offset &= ~PAGE_MASK;
> +
> +		pages += PFN_UP(offset + size);
> +	}
> +
> +	return pages;
> +}
> +
>  static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  {
>  	unsigned short id;
> @@ -487,23 +543,23 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  	grant_ref_t ref;
>  	unsigned long mfn;
>  	int notify;
> -	int frags = skb_shinfo(skb)->nr_frags;
> +	int slots;
>  	unsigned int offset = offset_in_page(data);
>  	unsigned int len = skb_headlen(skb);
>  	unsigned long flags;
>  
> -	frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
> -	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
> -		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
> -		       frags);
> -		dump_stack();
> +	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
> +		xennet_count_skb_frag_slots(skb);
> +	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
> +		net_alert_ratelimited(
> +			"xennet: skb rides the rocket: %d slots\n", slots);
>  		goto drop;
>  	}
>  
>  	spin_lock_irqsave(&np->tx_lock, flags);
>  
>  	if (unlikely(!netif_carrier_ok(dev) ||
> -		     (frags > 1 && !xennet_can_sg(dev)) ||
> +		     (slots > 1 && !xennet_can_sg(dev)) ||
>  		     netif_needs_gso(skb, netif_skb_features(skb)))) {
>  		spin_unlock_irqrestore(&np->tx_lock, flags);
>  		goto drop;
> -- 
> 1.7.2.5
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 15:27:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 15:27:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbCCk-0002Hg-OA; Wed, 21 Nov 2012 15:27:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TbCCj-0002Hb-B3
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 15:27:09 +0000
Received: from [85.158.143.35:53194] by server-1.bemta-4.messagelabs.com id
	27/9F-27934-BC2FCA05; Wed, 21 Nov 2012 15:27:07 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1353511623!13059097!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNjc2MTI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24467 invoked from network); 21 Nov 2012 15:27:05 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-12.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 21 Nov 2012 15:27:05 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qALFR1Gu023840
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 21 Nov 2012 15:27:02 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qALFR0BL008348
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Nov 2012 15:27:01 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qALFR0dm011205; Wed, 21 Nov 2012 09:27:00 -0600
MIME-Version: 1.0
Message-ID: <3b3b72db-32fd-446c-9971-e119a8993b3d@default>
Date: Wed, 21 Nov 2012 07:26:58 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Konrad Wilk <konrad.wilk@oracle.com>
References: <748aba10-531a-4ad5-bad3-7af0f86c0489@default>
	<20121121024753.GB11912@konrad-lan.dumpdata.com>
In-Reply-To: <20121121024753.GB11912@konrad-lan.dumpdata.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: tmem: selfballooning should be enabled
 when xen tmem is enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Konrad Rzeszutek Wilk
> Sent: Tuesday, November 20, 2012 7:48 PM
> To: Dan Magenheimer
> Cc: linux-kernel@vger.kernel.org; xen-devel@lists.xen.org
> Subject: Re: [PATCH] xen: tmem: selfballooning should be enabled when xen tmem is enabled
> 
> On Tue, Nov 20, 2012 at 02:42:18PM -0800, Dan Magenheimer wrote:
> > Konrad: Any chance this can get in for the upcoming window?
> > (Or is it enough of a bug fix that it can go in at an -rcN?)
> 
> Lets do it in the next merge window. About now I am comfortable
> only with regression fixes.

OK, thanks!

> > It was just pointed out to me that some kernels have
> > cleancache and frontswap and xen_tmem enabled but NOT
> > xen_selfballooning!  While this configuration should be
> > possible, nearly all kernels that have CONFIG_XEN_TMEM=y should
> > also have CONFIG_XEN_SELFBALLOONING=y, since Transcendent
> > Memory (tmem) for Xen has very limited value without
> > selfballooning.
> >
> > This is probably a result of a Kconfig mistake fixed I think
> > by the patch below.  Note that the year-old Oracle UEK2 kernel
> > distro has both CONFIG_XEN_TMEM and CONFIG_XEN_SELFBALLOONING
> > enabled, as does a Fedora 17 kernel update (3.6.6-1.fc17), so
> > the combination should be well tested.  Also, Xen tmem (and thus
> > selfballooning) are currently only enabled when a kernel boot
> > parameter is supplied so there is no runtime impact without
> > that boot parameter.
> >
> > Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
> >
> > diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
> > index d4dffcd..b5f02f3 100644
> > --- a/drivers/xen/Kconfig
> > +++ b/drivers/xen/Kconfig
> > @@ -10,9 +10,9 @@ config XEN_BALLOON
> >  	  return unneeded memory to the system.
> >
> >  config XEN_SELFBALLOONING
> > -	bool "Dynamically self-balloon kernel memory to target"
> > -	depends on XEN && XEN_BALLOON && CLEANCACHE && SWAP && XEN_TMEM
> > -	default n
> > +	bool
> > +	depends on XEN_BALLOON && SWAP
> > +	default y if XEN_TMEM
> >  	help
> >  	  Self-ballooning dynamically balloons available kernel memory driven
> >  	  by the current usage of anonymous memory ("committed AS") and

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 15:27:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 15:27:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbCCk-0002Hg-OA; Wed, 21 Nov 2012 15:27:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TbCCj-0002Hb-B3
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 15:27:09 +0000
Received: from [85.158.143.35:53194] by server-1.bemta-4.messagelabs.com id
	27/9F-27934-BC2FCA05; Wed, 21 Nov 2012 15:27:07 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1353511623!13059097!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNjc2MTI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24467 invoked from network); 21 Nov 2012 15:27:05 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-12.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 21 Nov 2012 15:27:05 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qALFR1Gu023840
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 21 Nov 2012 15:27:02 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qALFR0BL008348
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Nov 2012 15:27:01 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qALFR0dm011205; Wed, 21 Nov 2012 09:27:00 -0600
MIME-Version: 1.0
Message-ID: <3b3b72db-32fd-446c-9971-e119a8993b3d@default>
Date: Wed, 21 Nov 2012 07:26:58 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Konrad Wilk <konrad.wilk@oracle.com>
References: <748aba10-531a-4ad5-bad3-7af0f86c0489@default>
	<20121121024753.GB11912@konrad-lan.dumpdata.com>
In-Reply-To: <20121121024753.GB11912@konrad-lan.dumpdata.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: tmem: selfballooning should be enabled
 when xen tmem is enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Konrad Rzeszutek Wilk
> Sent: Tuesday, November 20, 2012 7:48 PM
> To: Dan Magenheimer
> Cc: linux-kernel@vger.kernel.org; xen-devel@lists.xen.org
> Subject: Re: [PATCH] xen: tmem: selfballooning should be enabled when xen tmem is enabled
> 
> On Tue, Nov 20, 2012 at 02:42:18PM -0800, Dan Magenheimer wrote:
> > Konrad: Any chance this can get in for the upcoming window?
> > (Or is it enough of a bug fix that it can go in at an -rcN?)
> 
> Lets do it in the next merge window. About now I am comfortable
> only with regression fixes.

OK, thanks!

> > It was just pointed out to me that some kernels have
> > cleancache and frontswap and xen_tmem enabled but NOT
> > xen_selfballooning!  While this configuration should be
> > possible, nearly all kernels that have CONFIG_XEN_TMEM=y should
> > also have CONFIG_XEN_SELFBALLOONING=y, since Transcendent
> > Memory (tmem) for Xen has very limited value without
> > selfballooning.
> >
> > This is probably a result of a Kconfig mistake fixed I think
> > by the patch below.  Note that the year-old Oracle UEK2 kernel
> > distro has both CONFIG_XEN_TMEM and CONFIG_XEN_SELFBALLOONING
> > enabled, as does a Fedora 17 kernel update (3.6.6-1.fc17), so
> > the combination should be well tested.  Also, Xen tmem (and thus
> > selfballooning) are currently only enabled when a kernel boot
> > parameter is supplied so there is no runtime impact without
> > that boot parameter.
> >
> > Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
> >
> > diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
> > index d4dffcd..b5f02f3 100644
> > --- a/drivers/xen/Kconfig
> > +++ b/drivers/xen/Kconfig
> > @@ -10,9 +10,9 @@ config XEN_BALLOON
> >  	  return unneeded memory to the system.
> >
> >  config XEN_SELFBALLOONING
> > -	bool "Dynamically self-balloon kernel memory to target"
> > -	depends on XEN && XEN_BALLOON && CLEANCACHE && SWAP && XEN_TMEM
> > -	default n
> > +	bool
> > +	depends on XEN_BALLOON && SWAP
> > +	default y if XEN_TMEM
> >  	help
> >  	  Self-ballooning dynamically balloons available kernel memory driven
> >  	  by the current usage of anonymous memory ("committed AS") and

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 15:42:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 15:42:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbCRb-0002am-5x; Wed, 21 Nov 2012 15:42:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TbCRZ-0002ah-Mu
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 15:42:29 +0000
Received: from [85.158.139.83:46819] by server-1.bemta-5.messagelabs.com id
	AD/58-05877-466FCA05; Wed, 21 Nov 2012 15:42:28 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1353512545!31010916!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNjc2MTI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30593 invoked from network); 21 Nov 2012 15:42:26 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-15.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 21 Nov 2012 15:42:26 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qALFgNDs010130
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 21 Nov 2012 15:42:24 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qALFgLd4009494
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Nov 2012 15:42:22 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qALFgLFc000731; Wed, 21 Nov 2012 09:42:21 -0600
MIME-Version: 1.0
Message-ID: <6912a721-cd5b-4c12-91b2-795eb58ace66@default>
Date: Wed, 21 Nov 2012 07:42:19 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <748aba10-531a-4ad5-bad3-7af0f86c0489@default>
	<50AC9CFF02000078000AA43C@nat28.tlf.novell.com>
In-Reply-To: <50AC9CFF02000078000AA43C@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Konrad Wilk <konrad.wilk@oracle.com>, linux-kernel@vger.kernel.org,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: tmem: selfballooning should be enabled
 when xen tmem is enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Wednesday, November 21, 2012 1:21 AM
> To: Dan Magenheimer
> Cc: xen-devel@lists.xen.org; Konrad Wilk; linux-kernel@vger.kernel.org
> Subject: Re: [Xen-devel] [PATCH] xen: tmem: selfballooning should be enabled when xen tmem is enabled
> 
> >>> On 20.11.12 at 23:42, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> > Konrad: Any chance this can get in for the upcoming window?
> > (Or is it enough of a bug fix that it can go in at an -rcN?)
> >
> > It was just pointed out to me that some kernels have
> > cleancache and frontswap and xen_tmem enabled but NOT
> > xen_selfballooning!  While this configuration should be
> > possible, nearly all kernels that have CONFIG_XEN_TMEM=y should
> > also have CONFIG_XEN_SELFBALLOONING=y, since Transcendent
> > Memory (tmem) for Xen has very limited value without
> > selfballooning.
> >
> > This is probably a result of a Kconfig mistake fixed I think
> > by the patch below.  Note that the year-old Oracle UEK2 kernel
> > distro has both CONFIG_XEN_TMEM and CONFIG_XEN_SELFBALLOONING
> > enabled, as does a Fedora 17 kernel update (3.6.6-1.fc17), so
> > the combination should be well tested.  Also, Xen tmem (and thus
> > selfballooning) are currently only enabled when a kernel boot
> > parameter is supplied so there is no runtime impact without
> > that boot parameter.
> >
> > Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
> >
> > diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
> > index d4dffcd..b5f02f3 100644
> > --- a/drivers/xen/Kconfig
> > +++ b/drivers/xen/Kconfig
> > @@ -10,9 +10,9 @@ config XEN_BALLOON
> >  	  return unneeded memory to the system.
> >
> >  config XEN_SELFBALLOONING
> > -	bool "Dynamically self-balloon kernel memory to target"
> 
> Why would you want to take away the configurability of this?
> You wanting it always on in your use case doesn't mean everyone
> agrees. This would be the right way only when the option being
> off despite all its dependencies being enabled is actively wrong.

I'd like it to be configurable, but my config steps
(e.g. yes "" | make oldconfig, after enabling CLEANCACHE and
FRONTSWAP and XEN_TMEM) failed to enable it.  Removing the
prompt is the only thing that worked.
 
> > -	depends on XEN && XEN_BALLOON && CLEANCACHE && SWAP && XEN_TMEM
> > -	default n
> > +	bool
> > +	depends on XEN_BALLOON && SWAP
> > +	default y if XEN_TMEM
> 
> Changing the default, otoh, is certainly acceptable. However, this
> should imo be (assuming that you dropped the CLEANCACHE
> dependency for an unrelated [and unexplained] reason),
> 
> 	depends on XEN_BALLOON && SWAP && XEN_TMEM
> 	default XEN_TMEM
> 
> i.e. the default selection can be simplified, but if you indeed
> have a good reason to drop the prompt, the
> dependencies should continue to include the symbol referenced
> by the default directive, as otherwise you may end up with a
> .config pointlessly having
> 
> # CONFIG_XEN_SELFBALLOONING is disabled. This is particularly
> annoying when subsequently this gets a prompt re-added, since
> at that point a "make oldconfig" won't ask for the item to get
> possibly enabled as there is a value known for it already.
> 
> >  	help
> >  	  Self-ballooning dynamically balloons available kernel memory driven
> >  	  by the current usage of anonymous memory ("committed AS") and
> 
> If you take away the prompt, keeping the help text isn't useful
> either.

Thanks for the feedback.  I'm an idiot with Kconfig and have
to play with it until it works as I expect.  Since Konrad
isn't going to accept it for the upcoming window anyway,
I'll play with it some more, but if the answer is obvious,
please spoon feed it to me. :-)

Dan

P.S. I removed the CLEANCACHE dependency because that dependency
is present for XEN_TMEM and I assumed dependencies are transitive.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 15:42:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 15:42:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbCRb-0002am-5x; Wed, 21 Nov 2012 15:42:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TbCRZ-0002ah-Mu
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 15:42:29 +0000
Received: from [85.158.139.83:46819] by server-1.bemta-5.messagelabs.com id
	AD/58-05877-466FCA05; Wed, 21 Nov 2012 15:42:28 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1353512545!31010916!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNjc2MTI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30593 invoked from network); 21 Nov 2012 15:42:26 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-15.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 21 Nov 2012 15:42:26 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qALFgNDs010130
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 21 Nov 2012 15:42:24 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qALFgLd4009494
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Nov 2012 15:42:22 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qALFgLFc000731; Wed, 21 Nov 2012 09:42:21 -0600
MIME-Version: 1.0
Message-ID: <6912a721-cd5b-4c12-91b2-795eb58ace66@default>
Date: Wed, 21 Nov 2012 07:42:19 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <748aba10-531a-4ad5-bad3-7af0f86c0489@default>
	<50AC9CFF02000078000AA43C@nat28.tlf.novell.com>
In-Reply-To: <50AC9CFF02000078000AA43C@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Konrad Wilk <konrad.wilk@oracle.com>, linux-kernel@vger.kernel.org,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: tmem: selfballooning should be enabled
 when xen tmem is enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Wednesday, November 21, 2012 1:21 AM
> To: Dan Magenheimer
> Cc: xen-devel@lists.xen.org; Konrad Wilk; linux-kernel@vger.kernel.org
> Subject: Re: [Xen-devel] [PATCH] xen: tmem: selfballooning should be enabled when xen tmem is enabled
> 
> >>> On 20.11.12 at 23:42, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> > Konrad: Any chance this can get in for the upcoming window?
> > (Or is it enough of a bug fix that it can go in at an -rcN?)
> >
> > It was just pointed out to me that some kernels have
> > cleancache and frontswap and xen_tmem enabled but NOT
> > xen_selfballooning!  While this configuration should be
> > possible, nearly all kernels that have CONFIG_XEN_TMEM=y should
> > also have CONFIG_XEN_SELFBALLOONING=y, since Transcendent
> > Memory (tmem) for Xen has very limited value without
> > selfballooning.
> >
> > This is probably a result of a Kconfig mistake fixed I think
> > by the patch below.  Note that the year-old Oracle UEK2 kernel
> > distro has both CONFIG_XEN_TMEM and CONFIG_XEN_SELFBALLOONING
> > enabled, as does a Fedora 17 kernel update (3.6.6-1.fc17), so
> > the combination should be well tested.  Also, Xen tmem (and thus
> > selfballooning) are currently only enabled when a kernel boot
> > parameter is supplied so there is no runtime impact without
> > that boot parameter.
> >
> > Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
> >
> > diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
> > index d4dffcd..b5f02f3 100644
> > --- a/drivers/xen/Kconfig
> > +++ b/drivers/xen/Kconfig
> > @@ -10,9 +10,9 @@ config XEN_BALLOON
> >  	  return unneeded memory to the system.
> >
> >  config XEN_SELFBALLOONING
> > -	bool "Dynamically self-balloon kernel memory to target"
> 
> Why would you want to take away the configurability of this?
> You wanting it always on in your use case doesn't mean everyone
> agrees. This would be the right way only when the option being
> off despite all its dependencies being enabled is actively wrong.

I'd like it to be configurable, but my config steps
(e.g. yes "" | make oldconfig, after enabling CLEANCACHE and
FRONTSWAP and XEN_TMEM) failed to enable it.  Removing the
prompt is the only thing that worked.
 
> > -	depends on XEN && XEN_BALLOON && CLEANCACHE && SWAP && XEN_TMEM
> > -	default n
> > +	bool
> > +	depends on XEN_BALLOON && SWAP
> > +	default y if XEN_TMEM
> 
> Changing the default, otoh, is certainly acceptable. However, this
> should imo be (assuming that you dropped the CLEANCACHE
> dependency for an unrelated [and unexplained] reason),
> 
> 	depends on XEN_BALLOON && SWAP && XEN_TMEM
> 	default XEN_TMEM
> 
> i.e. the default selection can be simplified, but if you indeed
> have a good reason to drop the prompt, the
> dependencies should continue to include the symbol referenced
> by the default directive, as otherwise you may end up with a
> .config pointlessly having
> 
> # CONFIG_XEN_SELFBALLOONING is disabled. This is particularly
> annoying when subsequently this gets a prompt re-added, since
> at that point a "make oldconfig" won't ask for the item to get
> possibly enabled as there is a value known for it already.
> 
> >  	help
> >  	  Self-ballooning dynamically balloons available kernel memory driven
> >  	  by the current usage of anonymous memory ("committed AS") and
> 
> If you take away the prompt, keeping the help text isn't useful
> either.

Thanks for the feedback.  I'm an idiot with Kconfig and have
to play with it until it works as I expect.  Since Konrad
isn't going to accept it for the upcoming window anyway,
I'll play with it some more, but if the answer is obvious,
please spoon feed it to me. :-)

Dan

P.S. I removed the CLEANCACHE dependency because that dependency
is present for XEN_TMEM and I assumed dependencies are transitive.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 15:53:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 15:53:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbCcP-0002pJ-EK; Wed, 21 Nov 2012 15:53:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbCcN-0002pE-Ov
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 15:53:39 +0000
Received: from [85.158.143.99:28749] by server-2.bemta-4.messagelabs.com id
	20/36-28922-309FCA05; Wed, 21 Nov 2012 15:53:39 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1353513218!25535702!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11539 invoked from network); 21 Nov 2012 15:53:38 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-216.messagelabs.com with SMTP;
	21 Nov 2012 15:53:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 15:53:38 +0000
Message-Id: <50AD074A02000078000AA6B3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 15:54:34 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <748aba10-531a-4ad5-bad3-7af0f86c0489@default>
	<50AC9CFF02000078000AA43C@nat28.tlf.novell.com>
	<6912a721-cd5b-4c12-91b2-795eb58ace66@default>
In-Reply-To: <6912a721-cd5b-4c12-91b2-795eb58ace66@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Wilk <konrad.wilk@oracle.com>, linux-kernel@vger.kernel.org,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: tmem: selfballooning should be enabled
 when xen tmem is enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 21.11.12 at 16:42, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  From: Jan Beulich [mailto:JBeulich@suse.com]
>> Sent: Wednesday, November 21, 2012 1:21 AM
>> To: Dan Magenheimer
>> Cc: xen-devel@lists.xen.org; Konrad Wilk; linux-kernel@vger.kernel.org 
>> Subject: Re: [Xen-devel] [PATCH] xen: tmem: selfballooning should be enabled 
> when xen tmem is enabled
>> 
>> >>> On 20.11.12 at 23:42, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>> > Konrad: Any chance this can get in for the upcoming window?
>> > (Or is it enough of a bug fix that it can go in at an -rcN?)
>> >
>> > It was just pointed out to me that some kernels have
>> > cleancache and frontswap and xen_tmem enabled but NOT
>> > xen_selfballooning!  While this configuration should be
>> > possible, nearly all kernels that have CONFIG_XEN_TMEM=y should
>> > also have CONFIG_XEN_SELFBALLOONING=y, since Transcendent
>> > Memory (tmem) for Xen has very limited value without
>> > selfballooning.
>> >
>> > This is probably a result of a Kconfig mistake fixed I think
>> > by the patch below.  Note that the year-old Oracle UEK2 kernel
>> > distro has both CONFIG_XEN_TMEM and CONFIG_XEN_SELFBALLOONING
>> > enabled, as does a Fedora 17 kernel update (3.6.6-1.fc17), so
>> > the combination should be well tested.  Also, Xen tmem (and thus
>> > selfballooning) are currently only enabled when a kernel boot
>> > parameter is supplied so there is no runtime impact without
>> > that boot parameter.
>> >
>> > Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
>> >
>> > diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
>> > index d4dffcd..b5f02f3 100644
>> > --- a/drivers/xen/Kconfig
>> > +++ b/drivers/xen/Kconfig
>> > @@ -10,9 +10,9 @@ config XEN_BALLOON
>> >  	  return unneeded memory to the system.
>> >
>> >  config XEN_SELFBALLOONING
>> > -	bool "Dynamically self-balloon kernel memory to target"
>> 
>> Why would you want to take away the configurability of this?
>> You wanting it always on in your use case doesn't mean everyone
>> agrees. This would be the right way only when the option being
>> off despite all its dependencies being enabled is actively wrong.
> 
> I'd like it to be configurable, but my config steps
> (e.g. yes "" | make oldconfig, after enabling CLEANCACHE and
> FRONTSWAP and XEN_TMEM) failed to enable it.  Removing the
> prompt is the only thing that worked.

If all of the dependencies are enabled, then I can't see why the
prompt wouldn't show up.

> P.S. I removed the CLEANCACHE dependency because that dependency
> is present for XEN_TMEM and I assumed dependencies are transitive.

That's correct.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 15:53:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 15:53:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbCcP-0002pJ-EK; Wed, 21 Nov 2012 15:53:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbCcN-0002pE-Ov
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 15:53:39 +0000
Received: from [85.158.143.99:28749] by server-2.bemta-4.messagelabs.com id
	20/36-28922-309FCA05; Wed, 21 Nov 2012 15:53:39 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1353513218!25535702!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11539 invoked from network); 21 Nov 2012 15:53:38 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-216.messagelabs.com with SMTP;
	21 Nov 2012 15:53:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 15:53:38 +0000
Message-Id: <50AD074A02000078000AA6B3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 15:54:34 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <748aba10-531a-4ad5-bad3-7af0f86c0489@default>
	<50AC9CFF02000078000AA43C@nat28.tlf.novell.com>
	<6912a721-cd5b-4c12-91b2-795eb58ace66@default>
In-Reply-To: <6912a721-cd5b-4c12-91b2-795eb58ace66@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Wilk <konrad.wilk@oracle.com>, linux-kernel@vger.kernel.org,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: tmem: selfballooning should be enabled
 when xen tmem is enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 21.11.12 at 16:42, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  From: Jan Beulich [mailto:JBeulich@suse.com]
>> Sent: Wednesday, November 21, 2012 1:21 AM
>> To: Dan Magenheimer
>> Cc: xen-devel@lists.xen.org; Konrad Wilk; linux-kernel@vger.kernel.org 
>> Subject: Re: [Xen-devel] [PATCH] xen: tmem: selfballooning should be enabled 
> when xen tmem is enabled
>> 
>> >>> On 20.11.12 at 23:42, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>> > Konrad: Any chance this can get in for the upcoming window?
>> > (Or is it enough of a bug fix that it can go in at an -rcN?)
>> >
>> > It was just pointed out to me that some kernels have
>> > cleancache and frontswap and xen_tmem enabled but NOT
>> > xen_selfballooning!  While this configuration should be
>> > possible, nearly all kernels that have CONFIG_XEN_TMEM=y should
>> > also have CONFIG_XEN_SELFBALLOONING=y, since Transcendent
>> > Memory (tmem) for Xen has very limited value without
>> > selfballooning.
>> >
>> > This is probably a result of a Kconfig mistake fixed I think
>> > by the patch below.  Note that the year-old Oracle UEK2 kernel
>> > distro has both CONFIG_XEN_TMEM and CONFIG_XEN_SELFBALLOONING
>> > enabled, as does a Fedora 17 kernel update (3.6.6-1.fc17), so
>> > the combination should be well tested.  Also, Xen tmem (and thus
>> > selfballooning) are currently only enabled when a kernel boot
>> > parameter is supplied so there is no runtime impact without
>> > that boot parameter.
>> >
>> > Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
>> >
>> > diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
>> > index d4dffcd..b5f02f3 100644
>> > --- a/drivers/xen/Kconfig
>> > +++ b/drivers/xen/Kconfig
>> > @@ -10,9 +10,9 @@ config XEN_BALLOON
>> >  	  return unneeded memory to the system.
>> >
>> >  config XEN_SELFBALLOONING
>> > -	bool "Dynamically self-balloon kernel memory to target"
>> 
>> Why would you want to take away the configurability of this?
>> You wanting it always on in your use case doesn't mean everyone
>> agrees. This would be the right way only when the option being
>> off despite all its dependencies being enabled is actively wrong.
> 
> I'd like it to be configurable, but my config steps
> (e.g. yes "" | make oldconfig, after enabling CLEANCACHE and
> FRONTSWAP and XEN_TMEM) failed to enable it.  Removing the
> prompt is the only thing that worked.

If all of the dependencies are enabled, then I can't see why the
prompt wouldn't show up.

> P.S. I removed the CLEANCACHE dependency because that dependency
> is present for XEN_TMEM and I assumed dependencies are transitive.

That's correct.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 15:59:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 15:59:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbCiF-0002yM-AC; Wed, 21 Nov 2012 15:59:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TbCiD-0002yF-V8
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 15:59:42 +0000
Received: from [85.158.139.211:39750] by server-12.bemta-5.messagelabs.com id
	2E/C0-02886-D6AFCA05; Wed, 21 Nov 2012 15:59:41 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353513553!21112308!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNjc2MTI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11909 invoked from network); 21 Nov 2012 15:59:15 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 21 Nov 2012 15:59:15 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qALFxBOl029506
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 21 Nov 2012 15:59:12 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qALFx98e027764
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Nov 2012 15:59:10 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qALFx9E2014457; Wed, 21 Nov 2012 09:59:09 -0600
MIME-Version: 1.0
Message-ID: <dc8b1cbe-442e-4f8b-a427-3909d14acede@default>
Date: Wed, 21 Nov 2012 07:59:07 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
	<1353062895.3499.205.camel@zakaz.uk.xensource.com>
	<ea33a942-7e63-4339-85c6-35935ae5119b@default>
	<50AB4A8602000078000A9E10@nat28.tlf.novell.com>
	<1353406581.13542.13.camel@zakaz.uk.xensource.com>
	<1bc66c5f-1740-411f-9be2-3de26372b469@default>
	<20121120164744.GA46858@ocelot.phlegethon.org>
	<47fef645-2fc9-4039-86da-13874fbef552@default>
	<50AC9F7302000078000AA44A@nat28.tlf.novell.com>
In-Reply-To: <50AC9F7302000078000AA44A@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: xen-devel@lists.xen.org, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, Tim Deegan <tim@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Wednesday, November 21, 2012 1:32 AM
> To: Dan Magenheimer
> Cc: Ian Campbell; xen-devel@lists.xen.org; Dave Mccracken; Konrad Wilk; ZhigangWang; Keir (Xen.org);
> Tim Deegan
> Subject: RE: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> 
> >>> On 20.11.12 at 18:52, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> >>  From: Tim Deegan [mailto:tim@xen.org]
> >> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
> > existing) hypercall
> >>
> >> At 08:33 -0800 on 20 Nov (1353400380), Dan Magenheimer wrote:
> >> > per-domain.  Especially since that would improve launch of only a small
> >> > and shrinking class of domains (PV && superpages=1 && mem="huge"),
> >> > can we please consider it a possible future enhancement, not a showstopper?
> >>
> >> Please, no.  Either you need this benighted hypercall, or you don't.
> >> If you really need it, do it properly.
> >
> > Hi Tim --
> >
> > I must respectfully disagree.
> >
> > For years, Xen has been accepting features that work on a 64-bit
> > hypervisor but not on a 32-bit hypervisor.  And new features such
> > as memory-sharing/paging _could_ be designed to help PV domains and
> > have completely ignored PV but have still been accepted.  There is
> > clearly precedent for new features that don't enhance every
> > possible case.
> >
> > The claim feature dramatically decreases a real customer problem in
> > the vast majority of our customer environments with no loss of
> > functionality in the small remaining percentage.  This real problem
> > is getting continually worse as system physical RAM and domain memory
> > requirements increase.  So, yes, _we_ do need it.
> 
> A meaningful difference is that those other features have tools
> side users, while you add (from the perspective of the Xen tree)
> dead code. That is, it wouldn't have any chance of getting checked
> for correctness when committed (other than for not breaking
> existing code), and it will bit rot pretty quickly. Or did you mean
> to supply tools side integration before expecting this to be
> considered for applying?

Oracle uses xm and a proprietary toolstack.  I don't normally
work on the toolstack (and other Oracle folk that do are tied up
with a release right now)... I can probably come up with an
xm/xend patch but I expect an xm/xend patch won't be well-received.

> In any case, while the hypervisor side changes look acceptable,
> I'm afraid that without (mostly) convincing (almost) all of the
> maintainers, there's no perspective of this getting committed.

Thanks very much, Jan, for your repeated reviews and I'm
very pleased that you think the hypervisor patch is acceptable.

I was under the impression that the hypervisor was supposed
to be toolstack-independent.  I think I've thoroughly explained
Oracle's real customer need here... if advocates of other
toolstacks don't understand it, it's not from lack of my
trying.  (More words have been spilled on this topic now than
possibly any other 200 lines in Xen!)

If other maintainers wish to impose their toolstack requirements
on other vendors' toolstacks and/or block hypervisor enhancements
that don't fit with their idea of a toolstack's needs,  I
suppose that is a question that will need to be raised to the
Xen Advisory Board, and that is above my pay grade.

Happy (U.S.) Thanksgiving!
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 15:59:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 15:59:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbCiF-0002yM-AC; Wed, 21 Nov 2012 15:59:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TbCiD-0002yF-V8
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 15:59:42 +0000
Received: from [85.158.139.211:39750] by server-12.bemta-5.messagelabs.com id
	2E/C0-02886-D6AFCA05; Wed, 21 Nov 2012 15:59:41 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353513553!21112308!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNjc2MTI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11909 invoked from network); 21 Nov 2012 15:59:15 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 21 Nov 2012 15:59:15 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qALFxBOl029506
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 21 Nov 2012 15:59:12 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qALFx98e027764
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Nov 2012 15:59:10 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qALFx9E2014457; Wed, 21 Nov 2012 09:59:09 -0600
MIME-Version: 1.0
Message-ID: <dc8b1cbe-442e-4f8b-a427-3909d14acede@default>
Date: Wed, 21 Nov 2012 07:59:07 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default>
	<1352982337.3499.119.camel@zakaz.uk.xensource.com>
	<ee278b0f-1bc0-4991-b67d-0805d9009a4d@default>
	<1353062895.3499.205.camel@zakaz.uk.xensource.com>
	<ea33a942-7e63-4339-85c6-35935ae5119b@default>
	<50AB4A8602000078000A9E10@nat28.tlf.novell.com>
	<1353406581.13542.13.camel@zakaz.uk.xensource.com>
	<1bc66c5f-1740-411f-9be2-3de26372b469@default>
	<20121120164744.GA46858@ocelot.phlegethon.org>
	<47fef645-2fc9-4039-86da-13874fbef552@default>
	<50AC9F7302000078000AA44A@nat28.tlf.novell.com>
In-Reply-To: <50AC9F7302000078000AA44A@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: xen-devel@lists.xen.org, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, Tim Deegan <tim@xen.org>,
	Dave Mccracken <dave.mccracken@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Wednesday, November 21, 2012 1:32 AM
> To: Dan Magenheimer
> Cc: Ian Campbell; xen-devel@lists.xen.org; Dave Mccracken; Konrad Wilk; ZhigangWang; Keir (Xen.org);
> Tim Deegan
> Subject: RE: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> 
> >>> On 20.11.12 at 18:52, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> >>  From: Tim Deegan [mailto:tim@xen.org]
> >> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
> > existing) hypercall
> >>
> >> At 08:33 -0800 on 20 Nov (1353400380), Dan Magenheimer wrote:
> >> > per-domain.  Especially since that would improve launch of only a small
> >> > and shrinking class of domains (PV && superpages=1 && mem="huge"),
> >> > can we please consider it a possible future enhancement, not a showstopper?
> >>
> >> Please, no.  Either you need this benighted hypercall, or you don't.
> >> If you really need it, do it properly.
> >
> > Hi Tim --
> >
> > I must respectfully disagree.
> >
> > For years, Xen has been accepting features that work on a 64-bit
> > hypervisor but not on a 32-bit hypervisor.  And new features such
> > as memory-sharing/paging _could_ be designed to help PV domains and
> > have completely ignored PV but have still been accepted.  There is
> > clearly precedent for new features that don't enhance every
> > possible case.
> >
> > The claim feature dramatically decreases a real customer problem in
> > the vast majority of our customer environments with no loss of
> > functionality in the small remaining percentage.  This real problem
> > is getting continually worse as system physical RAM and domain memory
> > requirements increase.  So, yes, _we_ do need it.
> 
> A meaningful difference is that those other features have tools
> side users, while you add (from the perspective of the Xen tree)
> dead code. That is, it wouldn't have any chance of getting checked
> for correctness when committed (other than for not breaking
> existing code), and it will bit rot pretty quickly. Or did you mean
> to supply tools side integration before expecting this to be
> considered for applying?

Oracle uses xm and a proprietary toolstack.  I don't normally
work on the toolstack (and other Oracle folk that do are tied up
with a release right now)... I can probably come up with an
xm/xend patch but I expect an xm/xend patch won't be well-received.

> In any case, while the hypervisor side changes look acceptable,
> I'm afraid that without (mostly) convincing (almost) all of the
> maintainers, there's no perspective of this getting committed.

Thanks very much, Jan, for your repeated reviews and I'm
very pleased that you think the hypervisor patch is acceptable.

I was under the impression that the hypervisor was supposed
to be toolstack-independent.  I think I've thoroughly explained
Oracle's real customer need here... if advocates of other
toolstacks don't understand it, it's not from lack of my
trying.  (More words have been spilled on this topic now than
possibly any other 200 lines in Xen!)

If other maintainers wish to impose their toolstack requirements
on other vendors' toolstacks and/or block hypervisor enhancements
that don't fit with their idea of a toolstack's needs,  I
suppose that is a question that will need to be raised to the
Xen Advisory Board, and that is above my pay grade.

Happy (U.S.) Thanksgiving!
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 16:16:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 16:16:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbCyH-0003hn-UT; Wed, 21 Nov 2012 16:16:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TbCyG-0003hi-E1
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 16:16:16 +0000
Received: from [85.158.143.35:9178] by server-1.bemta-4.messagelabs.com id
	10/29-27934-F4EFCA05; Wed, 21 Nov 2012 16:16:15 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1353514572!11650171!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3ODE1Mw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27541 invoked from network); 21 Nov 2012 16:16:14 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 21 Nov 2012 16:16:14 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qALGG9ka027942
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 21 Nov 2012 16:16:09 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qALGG8Zr008810
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Nov 2012 16:16:08 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qALGG78u019024; Wed, 21 Nov 2012 10:16:07 -0600
MIME-Version: 1.0
Message-ID: <cef443e6-0bb2-4906-b276-25d9b15d6d30@default>
Date: Wed, 21 Nov 2012 08:16:05 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <9758ec2d-1d62-4426-ba59-204bed3acf6d@default>
	<50ACA07202000078000AA45E@nat28.tlf.novell.com>
In-Reply-To: <50ACA07202000078000AA45E@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v6 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Subject: Re: [RFC/PATCH v6 1/2] hypervisor: XENMEM_claim_pages (subop of existing) hypercall
> 
> >>> On 20.11.12 at 18:04, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> > This is patch 1of2 of a sixth cut of the patch of the proposed
> > XENMEM_claim_pages hypercall/subop, taking into account review
> > feedback from Jan and Keir and IanC and Matthew Daley, plus some
> > fixes found via runtime debugging (using printk and privcmd only).
> >
> > v5->v6:
> > - Fix post-inc problem [mattjd]
> 
> I continue to miss an expiry mechanism for claims; as said before
> I don't think these should be held indefinitely.

Do you mean some kind of time-based expiry?

The simple use model I have in mind results in toolstack
changes as follows:

Current:
- call populate_physmap repeatedly to achieve mem=N memory
- if any populate_physmap call fails, report -ENOMEM up the stack
- memory is held until domain dies or the toolstack decreases it

Proposed:
- call claim for mem=N amount of memory
- if claim succeeds:
    call populate_physmap repeatedly to achieve mem=N memory (failsafe)
  else
    report -ENOMEM up the stack
- claim is held until mem=N is achieved or the domain dies or
   the toolstack changes it to 0
- memory is held until domain dies or the toolstack decreases it

In both cases, the memory is held "indefinitely" so I'm
not sure I see why a claim would need a time-based expiry
when a populate_physmap doesn't.  A claim is really just
a "soft" version of a populate_physmap where the quantity
of pages are (atomically) assigned to the domain but the specific
physical pageframes are (non-atomically) assigned later.

Does that make sense?

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 16:16:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 16:16:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbCyH-0003hn-UT; Wed, 21 Nov 2012 16:16:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TbCyG-0003hi-E1
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 16:16:16 +0000
Received: from [85.158.143.35:9178] by server-1.bemta-4.messagelabs.com id
	10/29-27934-F4EFCA05; Wed, 21 Nov 2012 16:16:15 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1353514572!11650171!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA3ODE1Mw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27541 invoked from network); 21 Nov 2012 16:16:14 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 21 Nov 2012 16:16:14 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qALGG9ka027942
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 21 Nov 2012 16:16:09 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qALGG8Zr008810
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Nov 2012 16:16:08 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qALGG78u019024; Wed, 21 Nov 2012 10:16:07 -0600
MIME-Version: 1.0
Message-ID: <cef443e6-0bb2-4906-b276-25d9b15d6d30@default>
Date: Wed, 21 Nov 2012 08:16:05 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <9758ec2d-1d62-4426-ba59-204bed3acf6d@default>
	<50ACA07202000078000AA45E@nat28.tlf.novell.com>
In-Reply-To: <50ACA07202000078000AA45E@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v6 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Subject: Re: [RFC/PATCH v6 1/2] hypervisor: XENMEM_claim_pages (subop of existing) hypercall
> 
> >>> On 20.11.12 at 18:04, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> > This is patch 1of2 of a sixth cut of the patch of the proposed
> > XENMEM_claim_pages hypercall/subop, taking into account review
> > feedback from Jan and Keir and IanC and Matthew Daley, plus some
> > fixes found via runtime debugging (using printk and privcmd only).
> >
> > v5->v6:
> > - Fix post-inc problem [mattjd]
> 
> I continue to miss an expiry mechanism for claims; as said before
> I don't think these should be held indefinitely.

Do you mean some kind of time-based expiry?

The simple use model I have in mind results in toolstack
changes as follows:

Current:
- call populate_physmap repeatedly to achieve mem=N memory
- if any populate_physmap call fails, report -ENOMEM up the stack
- memory is held until domain dies or the toolstack decreases it

Proposed:
- call claim for mem=N amount of memory
- if claim succeeds:
    call populate_physmap repeatedly to achieve mem=N memory (failsafe)
  else
    report -ENOMEM up the stack
- claim is held until mem=N is achieved or the domain dies or
   the toolstack changes it to 0
- memory is held until domain dies or the toolstack decreases it

In both cases, the memory is held "indefinitely" so I'm
not sure I see why a claim would need a time-based expiry
when a populate_physmap doesn't.  A claim is really just
a "soft" version of a populate_physmap where the quantity
of pages are (atomically) assigned to the domain but the specific
physical pageframes are (non-atomically) assigned later.

Does that make sense?

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 16:44:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 16:44:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbDP9-0004Bq-N0; Wed, 21 Nov 2012 16:44:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbDP9-0004Bl-06
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 16:44:03 +0000
Received: from [85.158.143.99:50902] by server-1.bemta-4.messagelabs.com id
	43/8E-27934-2D40DA05; Wed, 21 Nov 2012 16:44:02 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1353516241!23326614!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4513 invoked from network); 21 Nov 2012 16:44:01 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-216.messagelabs.com with SMTP;
	21 Nov 2012 16:44:01 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 16:44:01 +0000
Message-Id: <50AD131802000078000AA6E6@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 16:44:56 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <9758ec2d-1d62-4426-ba59-204bed3acf6d@default>
	<50ACA07202000078000AA45E@nat28.tlf.novell.com>
	<cef443e6-0bb2-4906-b276-25d9b15d6d30@default>
In-Reply-To: <cef443e6-0bb2-4906-b276-25d9b15d6d30@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v6 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 21.11.12 at 17:16, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  From: Jan Beulich [mailto:JBeulich@suse.com]
>> Subject: Re: [RFC/PATCH v6 1/2] hypervisor: XENMEM_claim_pages (subop of 
> existing) hypercall
>> 
>> >>> On 20.11.12 at 18:04, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>> > This is patch 1of2 of a sixth cut of the patch of the proposed
>> > XENMEM_claim_pages hypercall/subop, taking into account review
>> > feedback from Jan and Keir and IanC and Matthew Daley, plus some
>> > fixes found via runtime debugging (using printk and privcmd only).
>> >
>> > v5->v6:
>> > - Fix post-inc problem [mattjd]
>> 
>> I continue to miss an expiry mechanism for claims; as said before
>> I don't think these should be held indefinitely.
> 
> Do you mean some kind of time-based expiry?
> 
> The simple use model I have in mind results in toolstack
> changes as follows:
> 
> Current:
> - call populate_physmap repeatedly to achieve mem=N memory
> - if any populate_physmap call fails, report -ENOMEM up the stack
> - memory is held until domain dies or the toolstack decreases it
> 
> Proposed:
> - call claim for mem=N amount of memory
> - if claim succeeds:
>     call populate_physmap repeatedly to achieve mem=N memory (failsafe)
>   else
>     report -ENOMEM up the stack
> - claim is held until mem=N is achieved or the domain dies or
>    the toolstack changes it to 0
> - memory is held until domain dies or the toolstack decreases it
> 
> In both cases, the memory is held "indefinitely" so I'm
> not sure I see why a claim would need a time-based expiry
> when a populate_physmap doesn't.  A claim is really just
> a "soft" version of a populate_physmap where the quantity
> of pages are (atomically) assigned to the domain but the specific
> physical pageframes are (non-atomically) assigned later.
> 
> Does that make sense?

I get your point, but it seems wasteful to me to set aside perhaps
large quantities of memory for e.g. a zombie domain cleanup of
which didn't get to releasing the claim, yet.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 16:44:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 16:44:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbDP9-0004Bq-N0; Wed, 21 Nov 2012 16:44:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbDP9-0004Bl-06
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 16:44:03 +0000
Received: from [85.158.143.99:50902] by server-1.bemta-4.messagelabs.com id
	43/8E-27934-2D40DA05; Wed, 21 Nov 2012 16:44:02 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1353516241!23326614!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4513 invoked from network); 21 Nov 2012 16:44:01 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-216.messagelabs.com with SMTP;
	21 Nov 2012 16:44:01 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 16:44:01 +0000
Message-Id: <50AD131802000078000AA6E6@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 16:44:56 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <9758ec2d-1d62-4426-ba59-204bed3acf6d@default>
	<50ACA07202000078000AA45E@nat28.tlf.novell.com>
	<cef443e6-0bb2-4906-b276-25d9b15d6d30@default>
In-Reply-To: <cef443e6-0bb2-4906-b276-25d9b15d6d30@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v6 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 21.11.12 at 17:16, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  From: Jan Beulich [mailto:JBeulich@suse.com]
>> Subject: Re: [RFC/PATCH v6 1/2] hypervisor: XENMEM_claim_pages (subop of 
> existing) hypercall
>> 
>> >>> On 20.11.12 at 18:04, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>> > This is patch 1of2 of a sixth cut of the patch of the proposed
>> > XENMEM_claim_pages hypercall/subop, taking into account review
>> > feedback from Jan and Keir and IanC and Matthew Daley, plus some
>> > fixes found via runtime debugging (using printk and privcmd only).
>> >
>> > v5->v6:
>> > - Fix post-inc problem [mattjd]
>> 
>> I continue to miss an expiry mechanism for claims; as said before
>> I don't think these should be held indefinitely.
> 
> Do you mean some kind of time-based expiry?
> 
> The simple use model I have in mind results in toolstack
> changes as follows:
> 
> Current:
> - call populate_physmap repeatedly to achieve mem=N memory
> - if any populate_physmap call fails, report -ENOMEM up the stack
> - memory is held until domain dies or the toolstack decreases it
> 
> Proposed:
> - call claim for mem=N amount of memory
> - if claim succeeds:
>     call populate_physmap repeatedly to achieve mem=N memory (failsafe)
>   else
>     report -ENOMEM up the stack
> - claim is held until mem=N is achieved or the domain dies or
>    the toolstack changes it to 0
> - memory is held until domain dies or the toolstack decreases it
> 
> In both cases, the memory is held "indefinitely" so I'm
> not sure I see why a claim would need a time-based expiry
> when a populate_physmap doesn't.  A claim is really just
> a "soft" version of a populate_physmap where the quantity
> of pages are (atomically) assigned to the domain but the specific
> physical pageframes are (non-atomically) assigned later.
> 
> Does that make sense?

I get your point, but it seems wasteful to me to set aside perhaps
large quantities of memory for e.g. a zombie domain cleanup of
which didn't get to releasing the claim, yet.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 16:45:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 16:45:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbDPo-0004Ei-9j; Wed, 21 Nov 2012 16:44:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbDPm-0004EY-Uo
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 16:44:43 +0000
Received: from [85.158.143.35:47889] by server-2.bemta-4.messagelabs.com id
	F8/9E-28922-AF40DA05; Wed, 21 Nov 2012 16:44:42 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1353516281!16184879!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7381 invoked from network); 21 Nov 2012 16:44:41 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-21.messagelabs.com with SMTP;
	21 Nov 2012 16:44:41 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 16:44:41 +0000
Message-Id: <50AD134002000078000AA6EA@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 16:45:36 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartB0814020.0__="
Subject: [Xen-devel] [PATCH] linux-2.6.18/scsifront: fix address arithmetic
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartB0814020.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Incrementing the result of page_to_phys() is not the same as invoking
it on the incremented page pointer.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/drivers/xen/scsifront/scsifront.c
+++ b/drivers/xen/scsifront/scsifront.c
@@ -247,7 +247,6 @@ static int map_data_for_request(struct v
 	int err, i, ref, ref_cnt =3D 0;
 	int write =3D (sc->sc_data_direction =3D=3D DMA_TO_DEVICE);
 	int nr_pages, off, len, bytes;
-	unsigned long buffer_pfn;
 	unsigned int data_len =3D 0;
=20
 	if (sc->sc_data_direction =3D=3D DMA_NONE || !sc->request_bufflen)
@@ -276,8 +275,6 @@ static int map_data_for_request(struct v
 			len =3D sg[i].length;
 			data_len +=3D len;
=20
-			buffer_pfn =3D page_to_phys(page) >> PAGE_SHIFT;
-
 			while (len > 0) {
 				bytes =3D min_t(unsigned int, len, =
PAGE_SIZE - off);
 			=09
@@ -285,14 +282,14 @@ static int map_data_for_request(struct v
 				BUG_ON(ref =3D=3D -ENOSPC);
=20
 				gnttab_grant_foreign_access_ref(ref, =
info->dev->otherend_id,
-					buffer_pfn, write);
+					page_to_phys(page) >> PAGE_SHIFT, =
write);
=20
 				info->shadow[id].gref[ref_cnt]  =3D ref;
 				ring_req->seg[ref_cnt].gref     =3D ref;
 				ring_req->seg[ref_cnt].offset   =3D =
(uint16_t)off;
 				ring_req->seg[ref_cnt].length   =3D =
(uint16_t)bytes;
=20
-				buffer_pfn++;
+				page++;
 				len -=3D bytes;
 				off =3D 0;
 				ref_cnt++;
@@ -312,8 +309,6 @@ static int map_data_for_request(struct v
 			goto big_to_sg;
 		}
=20
-		buffer_pfn =3D page_to_phys(page) >> PAGE_SHIFT;
-
 		off =3D offset_in_page((unsigned long)sc->request_buffer);
 		for (i =3D 0; i < nr_pages; i++) {
 			bytes =3D PAGE_SIZE - off;
@@ -325,14 +320,14 @@ static int map_data_for_request(struct v
 			BUG_ON(ref =3D=3D -ENOSPC);
=20
 			gnttab_grant_foreign_access_ref(ref, info->dev->oth=
erend_id,
-				buffer_pfn, write);
+				page_to_phys(page) >> PAGE_SHIFT, write);
=20
 			info->shadow[id].gref[i] =3D ref;
 			ring_req->seg[i].gref     =3D ref;
 			ring_req->seg[i].offset   =3D (uint16_t)off;
 			ring_req->seg[i].length   =3D (uint16_t)bytes;
=20
-			buffer_pfn++;
+			page++;
 			len -=3D bytes;
 			off =3D 0;
 			ref_cnt++;




--=__PartB0814020.0__=
Content-Type: text/plain; name="xen-scsifront-page-arithmetic.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-scsifront-page-arithmetic.patch"

scsifront: fix address arithmetic=0A=0AIncrementing the result of =
page_to_phys() is not the same as invoking=0Ait on the incremented page =
pointer.=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- =
a/drivers/xen/scsifront/scsifront.c=0A+++ b/drivers/xen/scsifront/scsifront=
.c=0A@@ -247,7 +247,6 @@ static int map_data_for_request(struct v=0A 	=
int err, i, ref, ref_cnt =3D 0;=0A 	int write =3D (sc->sc_data_directio=
n =3D=3D DMA_TO_DEVICE);=0A 	int nr_pages, off, len, bytes;=0A-	=
unsigned long buffer_pfn;=0A 	unsigned int data_len =3D 0;=0A =0A 	if =
(sc->sc_data_direction =3D=3D DMA_NONE || !sc->request_bufflen)=0A@@ =
-276,8 +275,6 @@ static int map_data_for_request(struct v=0A 			=
len =3D sg[i].length;=0A 			data_len +=3D len;=0A =0A-	=
		buffer_pfn =3D page_to_phys(page) >> PAGE_SHIFT;=0A-=0A 	=
		while (len > 0) {=0A 				bytes =3D =
min_t(unsigned int, len, PAGE_SIZE - off);=0A 				=
=0A@@ -285,14 +282,14 @@ static int map_data_for_request(struct v=0A 		=
		BUG_ON(ref =3D=3D -ENOSPC);=0A =0A 				=
gnttab_grant_foreign_access_ref(ref, info->dev->otherend_id,=0A-		=
			buffer_pfn, write);=0A+					=
page_to_phys(page) >> PAGE_SHIFT, write);=0A =0A 				=
info->shadow[id].gref[ref_cnt]  =3D ref;=0A 				=
ring_req->seg[ref_cnt].gref     =3D ref;=0A 				=
ring_req->seg[ref_cnt].offset   =3D (uint16_t)off;=0A 				=
ring_req->seg[ref_cnt].length   =3D (uint16_t)bytes;=0A =0A-			=
	buffer_pfn++;=0A+				page++;=0A 		=
		len -=3D bytes;=0A 				off =3D =
0;=0A 				ref_cnt++;=0A@@ -312,8 +309,6 @@ static =
int map_data_for_request(struct v=0A 			goto big_to_sg;=0A =
		}=0A =0A-		buffer_pfn =3D page_to_phys(page) =
>> PAGE_SHIFT;=0A-=0A 		off =3D offset_in_page((unsigned long)sc->r=
equest_buffer);=0A 		for (i =3D 0; i < nr_pages; i++) {=0A 		=
	bytes =3D PAGE_SIZE - off;=0A@@ -325,14 +320,14 @@ static int =
map_data_for_request(struct v=0A 			BUG_ON(ref =3D=3D =
-ENOSPC);=0A =0A 			gnttab_grant_foreign_access_ref(ref=
, info->dev->otherend_id,=0A-				buffer_pfn, =
write);=0A+				page_to_phys(page) >> PAGE_SHIFT, =
write);=0A =0A 			info->shadow[id].gref[i] =3D ref;=0A 		=
	ring_req->seg[i].gref     =3D ref;=0A 			ring_req->s=
eg[i].offset   =3D (uint16_t)off;=0A 			ring_req->seg[i].le=
ngth   =3D (uint16_t)bytes;=0A =0A-			buffer_pfn++;=0A+	=
		page++;=0A 			len -=3D bytes;=0A 		=
	off =3D 0;=0A 			ref_cnt++;=0A
--=__PartB0814020.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.xen.org
http://lists.xen.org/xen-devel

--=__PartB0814020.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 21 16:45:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 16:45:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbDPo-0004Ei-9j; Wed, 21 Nov 2012 16:44:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbDPm-0004EY-Uo
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 16:44:43 +0000
Received: from [85.158.143.35:47889] by server-2.bemta-4.messagelabs.com id
	F8/9E-28922-AF40DA05; Wed, 21 Nov 2012 16:44:42 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1353516281!16184879!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7381 invoked from network); 21 Nov 2012 16:44:41 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-21.messagelabs.com with SMTP;
	21 Nov 2012 16:44:41 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 16:44:41 +0000
Message-Id: <50AD134002000078000AA6EA@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 16:45:36 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartB0814020.0__="
Subject: [Xen-devel] [PATCH] linux-2.6.18/scsifront: fix address arithmetic
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartB0814020.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Incrementing the result of page_to_phys() is not the same as invoking
it on the incremented page pointer.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/drivers/xen/scsifront/scsifront.c
+++ b/drivers/xen/scsifront/scsifront.c
@@ -247,7 +247,6 @@ static int map_data_for_request(struct v
 	int err, i, ref, ref_cnt =3D 0;
 	int write =3D (sc->sc_data_direction =3D=3D DMA_TO_DEVICE);
 	int nr_pages, off, len, bytes;
-	unsigned long buffer_pfn;
 	unsigned int data_len =3D 0;
=20
 	if (sc->sc_data_direction =3D=3D DMA_NONE || !sc->request_bufflen)
@@ -276,8 +275,6 @@ static int map_data_for_request(struct v
 			len =3D sg[i].length;
 			data_len +=3D len;
=20
-			buffer_pfn =3D page_to_phys(page) >> PAGE_SHIFT;
-
 			while (len > 0) {
 				bytes =3D min_t(unsigned int, len, =
PAGE_SIZE - off);
 			=09
@@ -285,14 +282,14 @@ static int map_data_for_request(struct v
 				BUG_ON(ref =3D=3D -ENOSPC);
=20
 				gnttab_grant_foreign_access_ref(ref, =
info->dev->otherend_id,
-					buffer_pfn, write);
+					page_to_phys(page) >> PAGE_SHIFT, =
write);
=20
 				info->shadow[id].gref[ref_cnt]  =3D ref;
 				ring_req->seg[ref_cnt].gref     =3D ref;
 				ring_req->seg[ref_cnt].offset   =3D =
(uint16_t)off;
 				ring_req->seg[ref_cnt].length   =3D =
(uint16_t)bytes;
=20
-				buffer_pfn++;
+				page++;
 				len -=3D bytes;
 				off =3D 0;
 				ref_cnt++;
@@ -312,8 +309,6 @@ static int map_data_for_request(struct v
 			goto big_to_sg;
 		}
=20
-		buffer_pfn =3D page_to_phys(page) >> PAGE_SHIFT;
-
 		off =3D offset_in_page((unsigned long)sc->request_buffer);
 		for (i =3D 0; i < nr_pages; i++) {
 			bytes =3D PAGE_SIZE - off;
@@ -325,14 +320,14 @@ static int map_data_for_request(struct v
 			BUG_ON(ref =3D=3D -ENOSPC);
=20
 			gnttab_grant_foreign_access_ref(ref, info->dev->oth=
erend_id,
-				buffer_pfn, write);
+				page_to_phys(page) >> PAGE_SHIFT, write);
=20
 			info->shadow[id].gref[i] =3D ref;
 			ring_req->seg[i].gref     =3D ref;
 			ring_req->seg[i].offset   =3D (uint16_t)off;
 			ring_req->seg[i].length   =3D (uint16_t)bytes;
=20
-			buffer_pfn++;
+			page++;
 			len -=3D bytes;
 			off =3D 0;
 			ref_cnt++;




--=__PartB0814020.0__=
Content-Type: text/plain; name="xen-scsifront-page-arithmetic.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-scsifront-page-arithmetic.patch"

scsifront: fix address arithmetic=0A=0AIncrementing the result of =
page_to_phys() is not the same as invoking=0Ait on the incremented page =
pointer.=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- =
a/drivers/xen/scsifront/scsifront.c=0A+++ b/drivers/xen/scsifront/scsifront=
.c=0A@@ -247,7 +247,6 @@ static int map_data_for_request(struct v=0A 	=
int err, i, ref, ref_cnt =3D 0;=0A 	int write =3D (sc->sc_data_directio=
n =3D=3D DMA_TO_DEVICE);=0A 	int nr_pages, off, len, bytes;=0A-	=
unsigned long buffer_pfn;=0A 	unsigned int data_len =3D 0;=0A =0A 	if =
(sc->sc_data_direction =3D=3D DMA_NONE || !sc->request_bufflen)=0A@@ =
-276,8 +275,6 @@ static int map_data_for_request(struct v=0A 			=
len =3D sg[i].length;=0A 			data_len +=3D len;=0A =0A-	=
		buffer_pfn =3D page_to_phys(page) >> PAGE_SHIFT;=0A-=0A 	=
		while (len > 0) {=0A 				bytes =3D =
min_t(unsigned int, len, PAGE_SIZE - off);=0A 				=
=0A@@ -285,14 +282,14 @@ static int map_data_for_request(struct v=0A 		=
		BUG_ON(ref =3D=3D -ENOSPC);=0A =0A 				=
gnttab_grant_foreign_access_ref(ref, info->dev->otherend_id,=0A-		=
			buffer_pfn, write);=0A+					=
page_to_phys(page) >> PAGE_SHIFT, write);=0A =0A 				=
info->shadow[id].gref[ref_cnt]  =3D ref;=0A 				=
ring_req->seg[ref_cnt].gref     =3D ref;=0A 				=
ring_req->seg[ref_cnt].offset   =3D (uint16_t)off;=0A 				=
ring_req->seg[ref_cnt].length   =3D (uint16_t)bytes;=0A =0A-			=
	buffer_pfn++;=0A+				page++;=0A 		=
		len -=3D bytes;=0A 				off =3D =
0;=0A 				ref_cnt++;=0A@@ -312,8 +309,6 @@ static =
int map_data_for_request(struct v=0A 			goto big_to_sg;=0A =
		}=0A =0A-		buffer_pfn =3D page_to_phys(page) =
>> PAGE_SHIFT;=0A-=0A 		off =3D offset_in_page((unsigned long)sc->r=
equest_buffer);=0A 		for (i =3D 0; i < nr_pages; i++) {=0A 		=
	bytes =3D PAGE_SIZE - off;=0A@@ -325,14 +320,14 @@ static int =
map_data_for_request(struct v=0A 			BUG_ON(ref =3D=3D =
-ENOSPC);=0A =0A 			gnttab_grant_foreign_access_ref(ref=
, info->dev->otherend_id,=0A-				buffer_pfn, =
write);=0A+				page_to_phys(page) >> PAGE_SHIFT, =
write);=0A =0A 			info->shadow[id].gref[i] =3D ref;=0A 		=
	ring_req->seg[i].gref     =3D ref;=0A 			ring_req->s=
eg[i].offset   =3D (uint16_t)off;=0A 			ring_req->seg[i].le=
ngth   =3D (uint16_t)bytes;=0A =0A-			buffer_pfn++;=0A+	=
		page++;=0A 			len -=3D bytes;=0A 		=
	off =3D 0;=0A 			ref_cnt++;=0A
--=__PartB0814020.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.xen.org
http://lists.xen.org/xen-devel

--=__PartB0814020.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 21 16:45:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 16:45:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbDQl-0004LX-Oh; Wed, 21 Nov 2012 16:45:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbDQj-0004LE-K6
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 16:45:41 +0000
Received: from [85.158.143.35:55605] by server-2.bemta-4.messagelabs.com id
	5C/DF-28922-4350DA05; Wed, 21 Nov 2012 16:45:40 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1353516314!10743410!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13252 invoked from network); 21 Nov 2012 16:45:15 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-21.messagelabs.com with SMTP;
	21 Nov 2012 16:45:15 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 16:45:14 +0000
Message-Id: <50AD136202000078000AA6EE@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 16:46:10 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartD2E32242.0__="
Subject: [Xen-devel] [PATCH] linux-2.6.18/scsifront: more cleanup
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartD2E32242.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

- make scsifront_cmd_done() static
- properly annotate XenBus setup/cleanup functions

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/drivers/xen/scsifront/common.h
+++ b/drivers/xen/scsifront/common.h
@@ -125,7 +125,6 @@ int scsifront_xenbus_init(void);
 void scsifront_xenbus_unregister(void);
 int scsifront_schedule(void *data);
 irqreturn_t scsifront_intr(int irq, void *dev_id, struct pt_regs =
*ptregs);
-int scsifront_cmd_done(struct vscsifrnt_info *info);
=20
=20
 #endif /* __XEN_DRIVERS_SCSIFRONT_H__  */
--- a/drivers/xen/scsifront/scsifront.c
+++ b/drivers/xen/scsifront/scsifront.c
@@ -176,7 +176,7 @@ static void scsifront_sync_cmd_done(stru
 }
=20
=20
-int scsifront_cmd_done(struct vscsifrnt_info *info)
+static int scsifront_cmd_done(struct vscsifrnt_info *info)
 {
 	vscsiif_response_t *ring_res;
=20
--- a/drivers/xen/scsifront/xenbus.c
+++ b/drivers/xen/scsifront/xenbus.c
@@ -413,12 +413,12 @@ static struct xenbus_driver scsifront_dr
 	.otherend_changed	=3D scsifront_backend_changed,
 };
=20
-int scsifront_xenbus_init(void)
+int __init scsifront_xenbus_init(void)
 {
 	return xenbus_register_frontend(&scsifront_driver);
 }
=20
-void scsifront_xenbus_unregister(void)
+void __exit scsifront_xenbus_unregister(void)
 {
 	xenbus_unregister_driver(&scsifront_driver);
 }




--=__PartD2E32242.0__=
Content-Type: text/plain; name="xen-scsifront-cleanup2.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-scsifront-cleanup2.patch"

scsifront: more cleanup=0A=0A- make scsifront_cmd_done() static=0A- =
properly annotate XenBus setup/cleanup functions=0A=0ASigned-off-by: Jan =
Beulich <jbeulich@suse.com>=0A=0A--- a/drivers/xen/scsifront/common.h=0A+++=
 b/drivers/xen/scsifront/common.h=0A@@ -125,7 +125,6 @@ int scsifront_xenbu=
s_init(void);=0A void scsifront_xenbus_unregister(void);=0A int scsifront_s=
chedule(void *data);=0A irqreturn_t scsifront_intr(int irq, void *dev_id, =
struct pt_regs *ptregs);=0A-int scsifront_cmd_done(struct vscsifrnt_info =
*info);=0A =0A =0A #endif /* __XEN_DRIVERS_SCSIFRONT_H__  */=0A--- =
a/drivers/xen/scsifront/scsifront.c=0A+++ b/drivers/xen/scsifront/scsifront=
.c=0A@@ -176,7 +176,7 @@ static void scsifront_sync_cmd_done(stru=0A }=0A =
=0A =0A-int scsifront_cmd_done(struct vscsifrnt_info *info)=0A+static int =
scsifront_cmd_done(struct vscsifrnt_info *info)=0A {=0A 	vscsiif_res=
ponse_t *ring_res;=0A =0A--- a/drivers/xen/scsifront/xenbus.c=0A+++ =
b/drivers/xen/scsifront/xenbus.c=0A@@ -413,12 +413,12 @@ static struct =
xenbus_driver scsifront_dr=0A 	.otherend_changed	=3D scsifront_backe=
nd_changed,=0A };=0A =0A-int scsifront_xenbus_init(void)=0A+int __init =
scsifront_xenbus_init(void)=0A {=0A 	return xenbus_register_frontend(&sc=
sifront_driver);=0A }=0A =0A-void scsifront_xenbus_unregister(void)=0A+void=
 __exit scsifront_xenbus_unregister(void)=0A {=0A 	xenbus_unregister_d=
river(&scsifront_driver);=0A }=0A
--=__PartD2E32242.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.xen.org
http://lists.xen.org/xen-devel

--=__PartD2E32242.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 21 16:45:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 16:45:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbDQl-0004LX-Oh; Wed, 21 Nov 2012 16:45:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbDQj-0004LE-K6
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 16:45:41 +0000
Received: from [85.158.143.35:55605] by server-2.bemta-4.messagelabs.com id
	5C/DF-28922-4350DA05; Wed, 21 Nov 2012 16:45:40 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1353516314!10743410!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13252 invoked from network); 21 Nov 2012 16:45:15 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-21.messagelabs.com with SMTP;
	21 Nov 2012 16:45:15 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 21 Nov 2012 16:45:14 +0000
Message-Id: <50AD136202000078000AA6EE@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 21 Nov 2012 16:46:10 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartD2E32242.0__="
Subject: [Xen-devel] [PATCH] linux-2.6.18/scsifront: more cleanup
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartD2E32242.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

- make scsifront_cmd_done() static
- properly annotate XenBus setup/cleanup functions

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/drivers/xen/scsifront/common.h
+++ b/drivers/xen/scsifront/common.h
@@ -125,7 +125,6 @@ int scsifront_xenbus_init(void);
 void scsifront_xenbus_unregister(void);
 int scsifront_schedule(void *data);
 irqreturn_t scsifront_intr(int irq, void *dev_id, struct pt_regs =
*ptregs);
-int scsifront_cmd_done(struct vscsifrnt_info *info);
=20
=20
 #endif /* __XEN_DRIVERS_SCSIFRONT_H__  */
--- a/drivers/xen/scsifront/scsifront.c
+++ b/drivers/xen/scsifront/scsifront.c
@@ -176,7 +176,7 @@ static void scsifront_sync_cmd_done(stru
 }
=20
=20
-int scsifront_cmd_done(struct vscsifrnt_info *info)
+static int scsifront_cmd_done(struct vscsifrnt_info *info)
 {
 	vscsiif_response_t *ring_res;
=20
--- a/drivers/xen/scsifront/xenbus.c
+++ b/drivers/xen/scsifront/xenbus.c
@@ -413,12 +413,12 @@ static struct xenbus_driver scsifront_dr
 	.otherend_changed	=3D scsifront_backend_changed,
 };
=20
-int scsifront_xenbus_init(void)
+int __init scsifront_xenbus_init(void)
 {
 	return xenbus_register_frontend(&scsifront_driver);
 }
=20
-void scsifront_xenbus_unregister(void)
+void __exit scsifront_xenbus_unregister(void)
 {
 	xenbus_unregister_driver(&scsifront_driver);
 }




--=__PartD2E32242.0__=
Content-Type: text/plain; name="xen-scsifront-cleanup2.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-scsifront-cleanup2.patch"

scsifront: more cleanup=0A=0A- make scsifront_cmd_done() static=0A- =
properly annotate XenBus setup/cleanup functions=0A=0ASigned-off-by: Jan =
Beulich <jbeulich@suse.com>=0A=0A--- a/drivers/xen/scsifront/common.h=0A+++=
 b/drivers/xen/scsifront/common.h=0A@@ -125,7 +125,6 @@ int scsifront_xenbu=
s_init(void);=0A void scsifront_xenbus_unregister(void);=0A int scsifront_s=
chedule(void *data);=0A irqreturn_t scsifront_intr(int irq, void *dev_id, =
struct pt_regs *ptregs);=0A-int scsifront_cmd_done(struct vscsifrnt_info =
*info);=0A =0A =0A #endif /* __XEN_DRIVERS_SCSIFRONT_H__  */=0A--- =
a/drivers/xen/scsifront/scsifront.c=0A+++ b/drivers/xen/scsifront/scsifront=
.c=0A@@ -176,7 +176,7 @@ static void scsifront_sync_cmd_done(stru=0A }=0A =
=0A =0A-int scsifront_cmd_done(struct vscsifrnt_info *info)=0A+static int =
scsifront_cmd_done(struct vscsifrnt_info *info)=0A {=0A 	vscsiif_res=
ponse_t *ring_res;=0A =0A--- a/drivers/xen/scsifront/xenbus.c=0A+++ =
b/drivers/xen/scsifront/xenbus.c=0A@@ -413,12 +413,12 @@ static struct =
xenbus_driver scsifront_dr=0A 	.otherend_changed	=3D scsifront_backe=
nd_changed,=0A };=0A =0A-int scsifront_xenbus_init(void)=0A+int __init =
scsifront_xenbus_init(void)=0A {=0A 	return xenbus_register_frontend(&sc=
sifront_driver);=0A }=0A =0A-void scsifront_xenbus_unregister(void)=0A+void=
 __exit scsifront_xenbus_unregister(void)=0A {=0A 	xenbus_unregister_d=
river(&scsifront_driver);=0A }=0A
--=__PartD2E32242.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.xen.org
http://lists.xen.org/xen-devel

--=__PartD2E32242.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 21 16:50:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 16:50:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbDUx-0004aq-EY; Wed, 21 Nov 2012 16:50:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <davem@davemloft.net>) id 1TbDUv-0004ai-TB
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 16:50:02 +0000
Received: from [193.109.254.147:44955] by server-7.bemta-14.messagelabs.com id
	61/55-02272-9360DA05; Wed, 21 Nov 2012 16:50:01 +0000
X-Env-Sender: davem@davemloft.net
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353516599!9119762!1
X-Originating-IP: [149.20.54.216]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21449 invoked from network); 21 Nov 2012 16:50:00 -0000
Received: from shards.monkeyblade.net (HELO shards.monkeyblade.net)
	(149.20.54.216) by server-8.tower-27.messagelabs.com with SMTP;
	21 Nov 2012 16:50:00 -0000
Received: from localhost (cpe-66-108-117-132.nyc.res.rr.com [66.108.117.132])
	by shards.monkeyblade.net (Postfix) with ESMTPSA id EBDD8585C9B;
	Wed, 21 Nov 2012 08:50:00 -0800 (PST)
Date: Wed, 21 Nov 2012 11:49:57 -0500 (EST)
Message-Id: <20121121.114957.441218567286373485.davem@davemloft.net>
To: konrad@kernel.org
From: David Miller <davem@davemloft.net>
In-Reply-To: <20121121151625.GA13127@konrad-lan.dumpdata.com>
References: <1353499336-28952-1-git-send-email-ian.campbell@citrix.com>
	<20121121151625.GA13127@konrad-lan.dumpdata.com>
X-Mailer: Mew version 6.5 on Emacs 24.1 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Cc: ian.campbell@citrix.com, netdev@vger.kernel.org, annie.li@oracle.com,
	stefan.bader@canonical.com, xen-devel@lists.xen.org,
	linux@eikelenboom.it, edumazet@google.com
Subject: Re: [Xen-devel] [PATCH V3] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

From: Konrad Rzeszutek Wilk <konrad@kernel.org>
Date: Wed, 21 Nov 2012 10:16:27 -0500

> On Wed, Nov 21, 2012 at 12:02:16PM +0000, Ian Campbell wrote:
>> An SKB paged fragment can consist of a compound page with order > 0.
>> However the netchannel protocol deals only in PAGE_SIZE frames.
>> 
>> Handle this in xennet_make_frags by iterating over the frames which
>> make up the page.
>> 
>> This is the netfront equivalent to 6a8ed462f16b for netback.
>> 
>> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>> Cc: netdev@vger.kernel.org
>> Cc: xen-devel@lists.xen.org
>> Cc: Eric Dumazet <edumazet@google.com>
>> Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
> 
> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> 
> David, would you like me to send it to Linus via my tree or are you
> OK sending him a git pull with this patch (and hopefully some other
> ones?)

I'll merge this to Linus via my net tree, thanks.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 16:50:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 16:50:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbDUx-0004aq-EY; Wed, 21 Nov 2012 16:50:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <davem@davemloft.net>) id 1TbDUv-0004ai-TB
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 16:50:02 +0000
Received: from [193.109.254.147:44955] by server-7.bemta-14.messagelabs.com id
	61/55-02272-9360DA05; Wed, 21 Nov 2012 16:50:01 +0000
X-Env-Sender: davem@davemloft.net
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353516599!9119762!1
X-Originating-IP: [149.20.54.216]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21449 invoked from network); 21 Nov 2012 16:50:00 -0000
Received: from shards.monkeyblade.net (HELO shards.monkeyblade.net)
	(149.20.54.216) by server-8.tower-27.messagelabs.com with SMTP;
	21 Nov 2012 16:50:00 -0000
Received: from localhost (cpe-66-108-117-132.nyc.res.rr.com [66.108.117.132])
	by shards.monkeyblade.net (Postfix) with ESMTPSA id EBDD8585C9B;
	Wed, 21 Nov 2012 08:50:00 -0800 (PST)
Date: Wed, 21 Nov 2012 11:49:57 -0500 (EST)
Message-Id: <20121121.114957.441218567286373485.davem@davemloft.net>
To: konrad@kernel.org
From: David Miller <davem@davemloft.net>
In-Reply-To: <20121121151625.GA13127@konrad-lan.dumpdata.com>
References: <1353499336-28952-1-git-send-email-ian.campbell@citrix.com>
	<20121121151625.GA13127@konrad-lan.dumpdata.com>
X-Mailer: Mew version 6.5 on Emacs 24.1 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Cc: ian.campbell@citrix.com, netdev@vger.kernel.org, annie.li@oracle.com,
	stefan.bader@canonical.com, xen-devel@lists.xen.org,
	linux@eikelenboom.it, edumazet@google.com
Subject: Re: [Xen-devel] [PATCH V3] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

From: Konrad Rzeszutek Wilk <konrad@kernel.org>
Date: Wed, 21 Nov 2012 10:16:27 -0500

> On Wed, Nov 21, 2012 at 12:02:16PM +0000, Ian Campbell wrote:
>> An SKB paged fragment can consist of a compound page with order > 0.
>> However the netchannel protocol deals only in PAGE_SIZE frames.
>> 
>> Handle this in xennet_make_frags by iterating over the frames which
>> make up the page.
>> 
>> This is the netfront equivalent to 6a8ed462f16b for netback.
>> 
>> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>> Cc: netdev@vger.kernel.org
>> Cc: xen-devel@lists.xen.org
>> Cc: Eric Dumazet <edumazet@google.com>
>> Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
> 
> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> 
> David, would you like me to send it to Linus via my tree or are you
> OK sending him a git pull with this patch (and hopefully some other
> ones?)

I'll merge this to Linus via my net tree, thanks.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 17:02:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 17:02:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbDgC-0004zH-Ks; Wed, 21 Nov 2012 17:01:40 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jefranca@gmail.com>) id 1TbDgA-0004zC-OJ
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 17:01:38 +0000
Received: from [85.158.137.99:3533] by server-1.bemta-3.messagelabs.com id
	96/82-12169-FE80DA05; Wed, 21 Nov 2012 17:01:35 +0000
X-Env-Sender: jefranca@gmail.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1353517293!15258275!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=1.7 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_10_20, HTML_MESSAGE, ML_RADAR_SPEW_LINKS_14, RCVD_BY_IP,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 640 invoked from network); 21 Nov 2012 17:01:34 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 17:01:34 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so9024931vbi.32
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 09:01:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=ntthfojPol9bJ6MvpECzfsf6A6B0jZapzcn5NU2JQCk=;
	b=p6w/FP7zrxqQ92cMkz0nv2EhdPWA72vQYm0KrPJQchgJVz/YY61dhOwV0J5ElRr/pE
	mMKtALn6JwMUihslguQQb11lNWoS/PnWm6X2H3epFRN8p+1qi7iQjqFIAmS4eEOU5Vmo
	WEXNFM6QG1FLQ391eXRrrsO6VA7MrSx6lhVvNNzWLw8dAfdhYSi+D202SgA9hfRbkJcf
	I4xv/W5OjvWSCkXb6BVSVr/6zvYawgeKElJsHPAMOjNv+w6KRfozIFUgP6ul4xgd7QUC
	/C5XOL3b75SKxl2RqNyxt1FVUEFqhU2D1aP33FuskdJfONIaBIZTwCpALU7UmeIajZ1B
	OL6g==
MIME-Version: 1.0
Received: by 10.52.72.104 with SMTP id c8mr23928331vdv.20.1353517293017; Wed,
	21 Nov 2012 09:01:33 -0800 (PST)
Received: by 10.58.117.105 with HTTP; Wed, 21 Nov 2012 09:01:32 -0800 (PST)
Date: Wed, 21 Nov 2012 15:01:32 -0200
Message-ID: <CAJP76_CP4f5YzksxwdrG8zc6-mnZwwSr3etAzXt0qi2kCX2esA@mail.gmail.com>
From: =?ISO-8859-1?Q?Jos=E9_Eduardo_Fran=E7a?= <jefranca@gmail.com>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] how to change checkpoint interval
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3565614721906994912=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============3565614721906994912==
Content-Type: multipart/alternative; boundary=bcaec50162bd7299e404cf044de1

--bcaec50162bd7299e404cf044de1
Content-Type: text/plain; charset=ISO-8859-1

Hi guys,

In my research, I want to change checkpoint interval during remus running.
I think that the checkpoint_settimer function (declared in libcheckpoint.c)
can do that I need.

But I would like to call a checkpoint_settimer in xc_domain_save.c. Then I
created a checkpoint_settimer*2* into xc_domain_save.c and this doesn't
work coz probably the timer_settime function there.

Then I started to search the error or where I change the checkpoint
interval. After I just changed one line in checkpoint.c:

      from: checkpoint_settimer(&self->cps, self->interval);
      to:     checkpoint_settimer(&self->cps, 300);

and I ran remus again, but the interval was still 200 ms.
The question is: Does checkpoint_settimer function set the interval? If
not, what's the function change interval?

Thanks

--bcaec50162bd7299e404cf044de1
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi guys,<div><br></div><div>In my research, I want to change checkpoint int=
erval during remus running.</div><div>I think that the=A0checkpoint_settime=
r function (declared in libcheckpoint.c) can do that I=A0need.<br><br>
But I would like to call a checkpoint_settimer in xc_domain_save.c. Then I =
created a checkpoint_settimer<b>2</b> into xc_domain_save.c and this doesn&=
#39;t work coz probably the timer_settime function there.<br><br>Then I sta=
rted to search the error or where I change the checkpoint interval. After I=
 just changed one line in checkpoint.c:<br>
<br>=A0=A0=A0=A0=A0 from: checkpoint_settimer(&amp;self-&gt;cps, self-&gt;i=
nterval);<br>=A0 =A0 =A0 to:=A0=A0=A0=A0 checkpoint_settimer(&amp;self-&gt;=
cps, 300);<br><br>and I ran remus again, but the interval was still 200 ms.=
<br>The question is: Does checkpoint_settimer function set the interval? If=
 not, what&#39;s the function change interval?<br>
<br>Thanks<br></div><div><br></div><div><br></div><div><br></div><div>=A0=
=A0</div>

--bcaec50162bd7299e404cf044de1--


--===============3565614721906994912==
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.xen.org
http://lists.xen.org/xen-devel

--===============3565614721906994912==--


From xen-devel-bounces@lists.xen.org Wed Nov 21 17:02:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 17:02:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbDgC-0004zH-Ks; Wed, 21 Nov 2012 17:01:40 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jefranca@gmail.com>) id 1TbDgA-0004zC-OJ
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 17:01:38 +0000
Received: from [85.158.137.99:3533] by server-1.bemta-3.messagelabs.com id
	96/82-12169-FE80DA05; Wed, 21 Nov 2012 17:01:35 +0000
X-Env-Sender: jefranca@gmail.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1353517293!15258275!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=1.7 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_10_20, HTML_MESSAGE, ML_RADAR_SPEW_LINKS_14, RCVD_BY_IP,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 640 invoked from network); 21 Nov 2012 17:01:34 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 17:01:34 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so9024931vbi.32
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 09:01:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=ntthfojPol9bJ6MvpECzfsf6A6B0jZapzcn5NU2JQCk=;
	b=p6w/FP7zrxqQ92cMkz0nv2EhdPWA72vQYm0KrPJQchgJVz/YY61dhOwV0J5ElRr/pE
	mMKtALn6JwMUihslguQQb11lNWoS/PnWm6X2H3epFRN8p+1qi7iQjqFIAmS4eEOU5Vmo
	WEXNFM6QG1FLQ391eXRrrsO6VA7MrSx6lhVvNNzWLw8dAfdhYSi+D202SgA9hfRbkJcf
	I4xv/W5OjvWSCkXb6BVSVr/6zvYawgeKElJsHPAMOjNv+w6KRfozIFUgP6ul4xgd7QUC
	/C5XOL3b75SKxl2RqNyxt1FVUEFqhU2D1aP33FuskdJfONIaBIZTwCpALU7UmeIajZ1B
	OL6g==
MIME-Version: 1.0
Received: by 10.52.72.104 with SMTP id c8mr23928331vdv.20.1353517293017; Wed,
	21 Nov 2012 09:01:33 -0800 (PST)
Received: by 10.58.117.105 with HTTP; Wed, 21 Nov 2012 09:01:32 -0800 (PST)
Date: Wed, 21 Nov 2012 15:01:32 -0200
Message-ID: <CAJP76_CP4f5YzksxwdrG8zc6-mnZwwSr3etAzXt0qi2kCX2esA@mail.gmail.com>
From: =?ISO-8859-1?Q?Jos=E9_Eduardo_Fran=E7a?= <jefranca@gmail.com>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] how to change checkpoint interval
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3565614721906994912=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============3565614721906994912==
Content-Type: multipart/alternative; boundary=bcaec50162bd7299e404cf044de1

--bcaec50162bd7299e404cf044de1
Content-Type: text/plain; charset=ISO-8859-1

Hi guys,

In my research, I want to change checkpoint interval during remus running.
I think that the checkpoint_settimer function (declared in libcheckpoint.c)
can do that I need.

But I would like to call a checkpoint_settimer in xc_domain_save.c. Then I
created a checkpoint_settimer*2* into xc_domain_save.c and this doesn't
work coz probably the timer_settime function there.

Then I started to search the error or where I change the checkpoint
interval. After I just changed one line in checkpoint.c:

      from: checkpoint_settimer(&self->cps, self->interval);
      to:     checkpoint_settimer(&self->cps, 300);

and I ran remus again, but the interval was still 200 ms.
The question is: Does checkpoint_settimer function set the interval? If
not, what's the function change interval?

Thanks

--bcaec50162bd7299e404cf044de1
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi guys,<div><br></div><div>In my research, I want to change checkpoint int=
erval during remus running.</div><div>I think that the=A0checkpoint_settime=
r function (declared in libcheckpoint.c) can do that I=A0need.<br><br>
But I would like to call a checkpoint_settimer in xc_domain_save.c. Then I =
created a checkpoint_settimer<b>2</b> into xc_domain_save.c and this doesn&=
#39;t work coz probably the timer_settime function there.<br><br>Then I sta=
rted to search the error or where I change the checkpoint interval. After I=
 just changed one line in checkpoint.c:<br>
<br>=A0=A0=A0=A0=A0 from: checkpoint_settimer(&amp;self-&gt;cps, self-&gt;i=
nterval);<br>=A0 =A0 =A0 to:=A0=A0=A0=A0 checkpoint_settimer(&amp;self-&gt;=
cps, 300);<br><br>and I ran remus again, but the interval was still 200 ms.=
<br>The question is: Does checkpoint_settimer function set the interval? If=
 not, what&#39;s the function change interval?<br>
<br>Thanks<br></div><div><br></div><div><br></div><div><br></div><div>=A0=
=A0</div>

--bcaec50162bd7299e404cf044de1--


--===============3565614721906994912==
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.xen.org
http://lists.xen.org/xen-devel

--===============3565614721906994912==--


From xen-devel-bounces@lists.xen.org Wed Nov 21 17:20:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 17:20:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbDxy-0005FK-Co; Wed, 21 Nov 2012 17:20:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TbDxw-0005FF-Sf
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 17:20:01 +0000
Received: from [85.158.143.35:28621] by server-2.bemta-4.messagelabs.com id
	05/3A-28922-04D0DA05; Wed, 21 Nov 2012 17:20:00 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1353518398!13074631!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc4Njk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14108 invoked from network); 21 Nov 2012 17:19:59 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 17:19:59 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="215200736"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 17:19:57 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 12:19:57 -0500
Received: from [10.80.3.146] (helo=localmatsp-T3500.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<mats.petersson@citrix.com>)	id 1TbDxs-0004Fr-T3;
	Wed, 21 Nov 2012 17:19:56 +0000
From: Mats Petersson <mats.petersson@citrix.com>
To: xen-devel@lists.xen.org
Date: Wed, 21 Nov 2012 17:19:25 +0000
Message-ID: <1353518365-7386-1-git-send-email-mats.petersson@citrix.com>
X-Mailer: git-send-email 1.7.9.5
MIME-Version: 1.0
Cc: konrad@kernel.org, Mats Petersson <mats.petersson@citrix.com>,
	Ian.Campbell@citrix.com, JBeulich@suse.com, david.vrabel@citrix.com
Subject: [Xen-devel] [PATCH V3] xen/privcmd: improve performance of mapping
	of guest memory to dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch makes the IOCTL_PRIVCMD_MMAPBATCH_V2 (and older V1 version)
map multiple (typically 1024) pages at a time rather than one page at a
time, despite the pages being non-consecutive MFNs. The main change is
to pass a pointer to an array of mfns, rather than one mfn. To support
error reporting, we also pass an err_ptr. If err_ptr is NULL, it indicates
we want the contiguous pages behaviour, so the mfn value is incremented
rather than the pointer itself. Performance of mapping guest memory into
Dom0 is improved by a factor of 2  with this change. (sorry, said more
than that before, as I confused it with the "improved unmap" numbers.)

This version of the patch contains suggested improvements from:
David Vrabel - make it two distinct external functions, doc-comments.
Ian Campbell - use one common function for the main work.
Jan Beulich  - found a bug and pointed out some whitespace problems.

One comment asked for more details on the improvements:
Using a small test program to map Guest memory into Dom0 (repeatedly
for "Iterations" mapping the same first "Num Pages")
Iterations    Num Pages	   Time 3.7rc4	Time With this patch
5000	      4096	   76.107	37.027
10000	      2048	   75.703	37.177
20000	      1024	   75.893	37.247
So a little better than twice as fast.

Using this patch in migration, using "time" to measure the overall
time it take to migrate a guest (Debian Squeeze 6.0, 1024MB guest
memory, one network card, one disk, guest at login prompt):
Time 3.7rc5		Time With this patch
6.697			5.667
Since migration involves a whole lot of other things, it's only about
15% faster - but still a good improvement. Similar measurement with a
guest that is running code to "dirty" memory shows about 23%
improvement, as it spends more time copying dirtied memory.

As discussed elsewhere, a good deal more can be had from improving the
munmap system call, but it is a little tricky to get this in without
worsening non-PVOPS kernel, so I will have another look at this.

Signed-off-by: Mats Petersson <mats.petersson@citrix.com>
---
 arch/x86/xen/mmu.c    |  134 +++++++++++++++++++++++++++++++++++++++++++------
 drivers/xen/privcmd.c |   56 +++++++++++++++++----
 include/xen/xen-ops.h |    5 ++
 3 files changed, 172 insertions(+), 23 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index dcf5f2d..636da15 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -2477,7 +2477,8 @@ void __init xen_hvm_init_mmu_ops(void)
 #define REMAP_BATCH_SIZE 16
 
 struct remap_data {
-	unsigned long mfn;
+	unsigned long *mfn;
+	bool contiguous;
 	pgprot_t prot;
 	struct mmu_update *mmu_update;
 };
@@ -2486,7 +2487,13 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
 				 unsigned long addr, void *data)
 {
 	struct remap_data *rmd = data;
-	pte_t pte = pte_mkspecial(pfn_pte(rmd->mfn++, rmd->prot));
+	pte_t pte = pte_mkspecial(pfn_pte(*rmd->mfn, rmd->prot));
+	/* If we have a contigious range, just update the mfn itself,
+	   else update pointer to be "next mfn". */
+	if (rmd->contiguous)
+		(*rmd->mfn)++;
+	else
+		rmd->mfn++;
 
 	rmd->mmu_update->ptr = virt_to_machine(ptep).maddr;
 	rmd->mmu_update->val = pte_val_ma(pte);
@@ -2495,16 +2502,34 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
 	return 0;
 }
 
-int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
-			       unsigned long addr,
-			       unsigned long mfn, int nr,
-			       pgprot_t prot, unsigned domid)
-{
+/* do_remap_mfn() - helper function to map foreign pages
+ * @vma:     the vma for the pages to be mapped into
+ * @addr:    the address at which to map the pages
+ * @mfn:     pointer to array of MFNs to map
+ * @nr:      the number entries in the MFN array
+ * @err_ptr: pointer to array
+ * @prot:    page protection mask
+ * @domid:   id of the domain that we are mapping from
+ *
+ * This function takes an array of mfns and maps nr pages from that into
+ * this kernel's memory. The owner of the pages is defined by domid. Where the
+ * pages are mapped is determined by addr, and vma is used for "accounting" of
+ * the pages.
+ *
+ * Return value is zero for success, negative for failure.
+ *
+ * Note that err_ptr is used to indicate whether *mfn
+ * is a list or a "first mfn of a contiguous range". */
+static int do_remap_mfn(struct vm_area_struct *vma,
+			unsigned long addr,
+			unsigned long *mfn, int nr,
+			int *err_ptr, pgprot_t prot,
+			unsigned domid)
+{
+	int err, last_err = 0;
 	struct remap_data rmd;
 	struct mmu_update mmu_update[REMAP_BATCH_SIZE];
-	int batch;
 	unsigned long range;
-	int err = 0;
 
 	if (xen_feature(XENFEAT_auto_translated_physmap))
 		return -EINVAL;
@@ -2515,9 +2540,15 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
 
 	rmd.mfn = mfn;
 	rmd.prot = prot;
+	/* We use the err_ptr to indicate if there we are doing a contigious
+	 * mapping or a discontigious mapping. */
+	rmd.contiguous = !err_ptr;
 
 	while (nr) {
-		batch = min(REMAP_BATCH_SIZE, nr);
+		int index = 0;
+		int done = 0;
+		int batch = min(REMAP_BATCH_SIZE, nr);
+		int batch_left = batch;
 		range = (unsigned long)batch << PAGE_SHIFT;
 
 		rmd.mmu_update = mmu_update;
@@ -2526,19 +2557,94 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
 		if (err)
 			goto out;
 
-		err = HYPERVISOR_mmu_update(mmu_update, batch, NULL, domid);
-		if (err < 0)
-			goto out;
+		/* We record the error for each page that gives an error, but
+		 * continue mapping until the whole set is done */
+		do {
+			err = HYPERVISOR_mmu_update(&mmu_update[index],
+						    batch_left, &done, domid);
+			if (err < 0) {
+				/* incrememnt done so we skip the error item */
+				done++;
+				if (err_ptr)
+					last_err = err_ptr[index] = err;
+				else
+					/* exit if error and no err_ptr */
+					goto out;
+			}
+			batch_left -= done;
+			index += done;
+		} while (batch_left);
 
 		nr -= batch;
 		addr += range;
+		if (err_ptr)
+			err_ptr += batch;
 	}
 
-	err = 0;
+	err = last_err;
 out:
 
 	xen_flush_tlb_all();
 
 	return err;
 }
+
+/* xen_remap_domain_mfn_range() - Used to map foreign pages
+ * @vma:   the vma for the pages to be mapped into
+ * @addr:  the address at which to map the pages
+ * @mfn:   the first MFN to map
+ * @nr:    the number of consecutive mfns to map
+ * @prot:  page protection mask
+ * @domid: id of the domain that we are mapping from
+ *
+ * This function takes a mfn and maps nr pages on from that into this kernel's
+ * memory. The owner of the pages is defined by domid. Where the pages are
+ * mapped is determined by addr, and vma is used for "accounting" of the
+ * pages.
+ *
+ * Return value is zero for success, negative ERRNO value for failure.
+ */
+int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
+			       unsigned long addr,
+			       unsigned long mfn, int nr,
+			       pgprot_t prot, unsigned domid)
+{
+	return do_remap_mfn(vma, addr, &mfn, nr, NULL, prot, domid);
+}
 EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range);
+
+/* xen_remap_domain_mfn_array() - Used to map an array of foreign pages
+ * @vma:     the vma for the pages to be mapped into
+ * @addr:    the address at which to map the pages
+ * @mfn:     pointer to array of MFNs to map
+ * @nr:      the number entries in the MFN array
+ * @err_ptr: pointer to array of integers, one per MFN, for an error
+ *           value for each page. The err_ptr must not be NULL.
+ * @prot:    page protection mask
+ * @domid:   id of the domain that we are mapping from
+ *
+ * This function takes an array of mfns and maps nr pages from that into this
+ * kernel's memory. The owner of the pages is defined by domid. Where the pages
+ * are mapped is determined by addr, and vma is used for "accounting" of the
+ * pages. The err_ptr array is filled in on any page that is not sucessfully
+ * mapped in.
+ *
+ * Return value is zero for success, negative ERRNO value for failure.
+ * Note that the error value -ENOENT is considered a "retry", so when this
+ * error code is seen, another call should be made with the list of pages that
+ * are marked as -ENOENT in the err_ptr array.
+ */
+int xen_remap_domain_mfn_array(struct vm_area_struct *vma,
+			       unsigned long addr,
+			       unsigned long *mfn, int nr,
+			       int *err_ptr, pgprot_t prot,
+			       unsigned domid)
+{
+	/* We BUG_ON because it's a programmer error to pass a NULL err_ptr,
+	 * and the consequences later is quite hard to detect what the actual
+	 * cause of "wrong memory was mapped in".
+	 */
+	BUG_ON(err_ptr == NULL);
+	return do_remap_mfn(vma, addr, mfn, nr, err_ptr, prot, domid);
+}
+EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_array);
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index 71f5c45..28b1ea3 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -151,6 +151,40 @@ static int traverse_pages(unsigned nelem, size_t size,
 	return ret;
 }
 
+/*
+ * Similar to traverse_pages, but use each page as a "block" of
+ * data to be processed as one unit.
+ */
+static int traverse_pages_block(unsigned nelem, size_t size,
+				struct list_head *pos,
+				int (*fn)(void *data, int nr, void *state),
+				void *state)
+{
+	void *pagedata;
+	unsigned pageidx;
+	int ret = 0;
+
+	BUG_ON(size > PAGE_SIZE);
+
+	pageidx = PAGE_SIZE;
+
+	while (nelem) {
+		int nr = (PAGE_SIZE/size);
+		struct page *page;
+		if (nr > nelem)
+			nr = nelem;
+		pos = pos->next;
+		page = list_entry(pos, struct page, lru);
+		pagedata = page_address(page);
+		ret = (*fn)(pagedata, nr, state);
+		if (ret)
+			break;
+		nelem -= nr;
+	}
+
+	return ret;
+}
+
 struct mmap_mfn_state {
 	unsigned long va;
 	struct vm_area_struct *vma;
@@ -250,7 +284,7 @@ struct mmap_batch_state {
 	 *      0 for no errors
 	 *      1 if at least one error has happened (and no
 	 *          -ENOENT errors have happened)
-	 *      -ENOENT if at least 1 -ENOENT has happened.
+	 *      -ENOENT if at least one -ENOENT has happened.
 	 */
 	int global_error;
 	/* An array for individual errors */
@@ -260,17 +294,21 @@ struct mmap_batch_state {
 	xen_pfn_t __user *user_mfn;
 };
 
-static int mmap_batch_fn(void *data, void *state)
+static int mmap_batch_fn(void *data, int nr, void *state)
 {
 	xen_pfn_t *mfnp = data;
+
 	struct mmap_batch_state *st = state;
 	int ret;
 
-	ret = xen_remap_domain_mfn_range(st->vma, st->va & PAGE_MASK, *mfnp, 1,
-					 st->vma->vm_page_prot, st->domain);
+	BUG_ON(nr < 0);
 
-	/* Store error code for second pass. */
-	*(st->err++) = ret;
+	ret = xen_remap_domain_mfn_array(st->vma,
+					 st->va & PAGE_MASK,
+					 mfnp, nr,
+					 st->err,
+					 st->vma->vm_page_prot,
+					 st->domain);
 
 	/* And see if it affects the global_error. */
 	if (ret < 0) {
@@ -282,7 +320,7 @@ static int mmap_batch_fn(void *data, void *state)
 				st->global_error = 1;
 		}
 	}
-	st->va += PAGE_SIZE;
+	st->va += PAGE_SIZE * nr;
 
 	return 0;
 }
@@ -378,8 +416,8 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
 	state.err           = err_array;
 
 	/* mmap_batch_fn guarantees ret == 0 */
-	BUG_ON(traverse_pages(m.num, sizeof(xen_pfn_t),
-			     &pagelist, mmap_batch_fn, &state));
+	BUG_ON(traverse_pages_block(m.num, sizeof(xen_pfn_t),
+				    &pagelist, mmap_batch_fn, &state));
 
 	up_write(&mm->mmap_sem);
 
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
index 6a198e4..22cad75 100644
--- a/include/xen/xen-ops.h
+++ b/include/xen/xen-ops.h
@@ -29,4 +29,9 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
 			       unsigned long mfn, int nr,
 			       pgprot_t prot, unsigned domid);
 
+int xen_remap_domain_mfn_array(struct vm_area_struct *vma,
+			       unsigned long addr,
+			       unsigned long *mfn, int nr,
+			       int *err_ptr, pgprot_t prot,
+			       unsigned domid);
 #endif /* INCLUDE_XEN_OPS_H */
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 17:20:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 17:20:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbDxy-0005FK-Co; Wed, 21 Nov 2012 17:20:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TbDxw-0005FF-Sf
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 17:20:01 +0000
Received: from [85.158.143.35:28621] by server-2.bemta-4.messagelabs.com id
	05/3A-28922-04D0DA05; Wed, 21 Nov 2012 17:20:00 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1353518398!13074631!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc4Njk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14108 invoked from network); 21 Nov 2012 17:19:59 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 17:19:59 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="215200736"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 17:19:57 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 12:19:57 -0500
Received: from [10.80.3.146] (helo=localmatsp-T3500.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<mats.petersson@citrix.com>)	id 1TbDxs-0004Fr-T3;
	Wed, 21 Nov 2012 17:19:56 +0000
From: Mats Petersson <mats.petersson@citrix.com>
To: xen-devel@lists.xen.org
Date: Wed, 21 Nov 2012 17:19:25 +0000
Message-ID: <1353518365-7386-1-git-send-email-mats.petersson@citrix.com>
X-Mailer: git-send-email 1.7.9.5
MIME-Version: 1.0
Cc: konrad@kernel.org, Mats Petersson <mats.petersson@citrix.com>,
	Ian.Campbell@citrix.com, JBeulich@suse.com, david.vrabel@citrix.com
Subject: [Xen-devel] [PATCH V3] xen/privcmd: improve performance of mapping
	of guest memory to dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch makes the IOCTL_PRIVCMD_MMAPBATCH_V2 (and older V1 version)
map multiple (typically 1024) pages at a time rather than one page at a
time, despite the pages being non-consecutive MFNs. The main change is
to pass a pointer to an array of mfns, rather than one mfn. To support
error reporting, we also pass an err_ptr. If err_ptr is NULL, it indicates
we want the contiguous pages behaviour, so the mfn value is incremented
rather than the pointer itself. Performance of mapping guest memory into
Dom0 is improved by a factor of 2  with this change. (sorry, said more
than that before, as I confused it with the "improved unmap" numbers.)

This version of the patch contains suggested improvements from:
David Vrabel - make it two distinct external functions, doc-comments.
Ian Campbell - use one common function for the main work.
Jan Beulich  - found a bug and pointed out some whitespace problems.

One comment asked for more details on the improvements:
Using a small test program to map Guest memory into Dom0 (repeatedly
for "Iterations" mapping the same first "Num Pages")
Iterations    Num Pages	   Time 3.7rc4	Time With this patch
5000	      4096	   76.107	37.027
10000	      2048	   75.703	37.177
20000	      1024	   75.893	37.247
So a little better than twice as fast.

Using this patch in migration, using "time" to measure the overall
time it take to migrate a guest (Debian Squeeze 6.0, 1024MB guest
memory, one network card, one disk, guest at login prompt):
Time 3.7rc5		Time With this patch
6.697			5.667
Since migration involves a whole lot of other things, it's only about
15% faster - but still a good improvement. Similar measurement with a
guest that is running code to "dirty" memory shows about 23%
improvement, as it spends more time copying dirtied memory.

As discussed elsewhere, a good deal more can be had from improving the
munmap system call, but it is a little tricky to get this in without
worsening non-PVOPS kernel, so I will have another look at this.

Signed-off-by: Mats Petersson <mats.petersson@citrix.com>
---
 arch/x86/xen/mmu.c    |  134 +++++++++++++++++++++++++++++++++++++++++++------
 drivers/xen/privcmd.c |   56 +++++++++++++++++----
 include/xen/xen-ops.h |    5 ++
 3 files changed, 172 insertions(+), 23 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index dcf5f2d..636da15 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -2477,7 +2477,8 @@ void __init xen_hvm_init_mmu_ops(void)
 #define REMAP_BATCH_SIZE 16
 
 struct remap_data {
-	unsigned long mfn;
+	unsigned long *mfn;
+	bool contiguous;
 	pgprot_t prot;
 	struct mmu_update *mmu_update;
 };
@@ -2486,7 +2487,13 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
 				 unsigned long addr, void *data)
 {
 	struct remap_data *rmd = data;
-	pte_t pte = pte_mkspecial(pfn_pte(rmd->mfn++, rmd->prot));
+	pte_t pte = pte_mkspecial(pfn_pte(*rmd->mfn, rmd->prot));
+	/* If we have a contigious range, just update the mfn itself,
+	   else update pointer to be "next mfn". */
+	if (rmd->contiguous)
+		(*rmd->mfn)++;
+	else
+		rmd->mfn++;
 
 	rmd->mmu_update->ptr = virt_to_machine(ptep).maddr;
 	rmd->mmu_update->val = pte_val_ma(pte);
@@ -2495,16 +2502,34 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
 	return 0;
 }
 
-int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
-			       unsigned long addr,
-			       unsigned long mfn, int nr,
-			       pgprot_t prot, unsigned domid)
-{
+/* do_remap_mfn() - helper function to map foreign pages
+ * @vma:     the vma for the pages to be mapped into
+ * @addr:    the address at which to map the pages
+ * @mfn:     pointer to array of MFNs to map
+ * @nr:      the number entries in the MFN array
+ * @err_ptr: pointer to array
+ * @prot:    page protection mask
+ * @domid:   id of the domain that we are mapping from
+ *
+ * This function takes an array of mfns and maps nr pages from that into
+ * this kernel's memory. The owner of the pages is defined by domid. Where the
+ * pages are mapped is determined by addr, and vma is used for "accounting" of
+ * the pages.
+ *
+ * Return value is zero for success, negative for failure.
+ *
+ * Note that err_ptr is used to indicate whether *mfn
+ * is a list or a "first mfn of a contiguous range". */
+static int do_remap_mfn(struct vm_area_struct *vma,
+			unsigned long addr,
+			unsigned long *mfn, int nr,
+			int *err_ptr, pgprot_t prot,
+			unsigned domid)
+{
+	int err, last_err = 0;
 	struct remap_data rmd;
 	struct mmu_update mmu_update[REMAP_BATCH_SIZE];
-	int batch;
 	unsigned long range;
-	int err = 0;
 
 	if (xen_feature(XENFEAT_auto_translated_physmap))
 		return -EINVAL;
@@ -2515,9 +2540,15 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
 
 	rmd.mfn = mfn;
 	rmd.prot = prot;
+	/* We use the err_ptr to indicate if there we are doing a contigious
+	 * mapping or a discontigious mapping. */
+	rmd.contiguous = !err_ptr;
 
 	while (nr) {
-		batch = min(REMAP_BATCH_SIZE, nr);
+		int index = 0;
+		int done = 0;
+		int batch = min(REMAP_BATCH_SIZE, nr);
+		int batch_left = batch;
 		range = (unsigned long)batch << PAGE_SHIFT;
 
 		rmd.mmu_update = mmu_update;
@@ -2526,19 +2557,94 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
 		if (err)
 			goto out;
 
-		err = HYPERVISOR_mmu_update(mmu_update, batch, NULL, domid);
-		if (err < 0)
-			goto out;
+		/* We record the error for each page that gives an error, but
+		 * continue mapping until the whole set is done */
+		do {
+			err = HYPERVISOR_mmu_update(&mmu_update[index],
+						    batch_left, &done, domid);
+			if (err < 0) {
+				/* incrememnt done so we skip the error item */
+				done++;
+				if (err_ptr)
+					last_err = err_ptr[index] = err;
+				else
+					/* exit if error and no err_ptr */
+					goto out;
+			}
+			batch_left -= done;
+			index += done;
+		} while (batch_left);
 
 		nr -= batch;
 		addr += range;
+		if (err_ptr)
+			err_ptr += batch;
 	}
 
-	err = 0;
+	err = last_err;
 out:
 
 	xen_flush_tlb_all();
 
 	return err;
 }
+
+/* xen_remap_domain_mfn_range() - Used to map foreign pages
+ * @vma:   the vma for the pages to be mapped into
+ * @addr:  the address at which to map the pages
+ * @mfn:   the first MFN to map
+ * @nr:    the number of consecutive mfns to map
+ * @prot:  page protection mask
+ * @domid: id of the domain that we are mapping from
+ *
+ * This function takes a mfn and maps nr pages on from that into this kernel's
+ * memory. The owner of the pages is defined by domid. Where the pages are
+ * mapped is determined by addr, and vma is used for "accounting" of the
+ * pages.
+ *
+ * Return value is zero for success, negative ERRNO value for failure.
+ */
+int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
+			       unsigned long addr,
+			       unsigned long mfn, int nr,
+			       pgprot_t prot, unsigned domid)
+{
+	return do_remap_mfn(vma, addr, &mfn, nr, NULL, prot, domid);
+}
 EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range);
+
+/* xen_remap_domain_mfn_array() - Used to map an array of foreign pages
+ * @vma:     the vma for the pages to be mapped into
+ * @addr:    the address at which to map the pages
+ * @mfn:     pointer to array of MFNs to map
+ * @nr:      the number entries in the MFN array
+ * @err_ptr: pointer to array of integers, one per MFN, for an error
+ *           value for each page. The err_ptr must not be NULL.
+ * @prot:    page protection mask
+ * @domid:   id of the domain that we are mapping from
+ *
+ * This function takes an array of mfns and maps nr pages from that into this
+ * kernel's memory. The owner of the pages is defined by domid. Where the pages
+ * are mapped is determined by addr, and vma is used for "accounting" of the
+ * pages. The err_ptr array is filled in on any page that is not sucessfully
+ * mapped in.
+ *
+ * Return value is zero for success, negative ERRNO value for failure.
+ * Note that the error value -ENOENT is considered a "retry", so when this
+ * error code is seen, another call should be made with the list of pages that
+ * are marked as -ENOENT in the err_ptr array.
+ */
+int xen_remap_domain_mfn_array(struct vm_area_struct *vma,
+			       unsigned long addr,
+			       unsigned long *mfn, int nr,
+			       int *err_ptr, pgprot_t prot,
+			       unsigned domid)
+{
+	/* We BUG_ON because it's a programmer error to pass a NULL err_ptr,
+	 * and the consequences later is quite hard to detect what the actual
+	 * cause of "wrong memory was mapped in".
+	 */
+	BUG_ON(err_ptr == NULL);
+	return do_remap_mfn(vma, addr, mfn, nr, err_ptr, prot, domid);
+}
+EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_array);
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index 71f5c45..28b1ea3 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -151,6 +151,40 @@ static int traverse_pages(unsigned nelem, size_t size,
 	return ret;
 }
 
+/*
+ * Similar to traverse_pages, but use each page as a "block" of
+ * data to be processed as one unit.
+ */
+static int traverse_pages_block(unsigned nelem, size_t size,
+				struct list_head *pos,
+				int (*fn)(void *data, int nr, void *state),
+				void *state)
+{
+	void *pagedata;
+	unsigned pageidx;
+	int ret = 0;
+
+	BUG_ON(size > PAGE_SIZE);
+
+	pageidx = PAGE_SIZE;
+
+	while (nelem) {
+		int nr = (PAGE_SIZE/size);
+		struct page *page;
+		if (nr > nelem)
+			nr = nelem;
+		pos = pos->next;
+		page = list_entry(pos, struct page, lru);
+		pagedata = page_address(page);
+		ret = (*fn)(pagedata, nr, state);
+		if (ret)
+			break;
+		nelem -= nr;
+	}
+
+	return ret;
+}
+
 struct mmap_mfn_state {
 	unsigned long va;
 	struct vm_area_struct *vma;
@@ -250,7 +284,7 @@ struct mmap_batch_state {
 	 *      0 for no errors
 	 *      1 if at least one error has happened (and no
 	 *          -ENOENT errors have happened)
-	 *      -ENOENT if at least 1 -ENOENT has happened.
+	 *      -ENOENT if at least one -ENOENT has happened.
 	 */
 	int global_error;
 	/* An array for individual errors */
@@ -260,17 +294,21 @@ struct mmap_batch_state {
 	xen_pfn_t __user *user_mfn;
 };
 
-static int mmap_batch_fn(void *data, void *state)
+static int mmap_batch_fn(void *data, int nr, void *state)
 {
 	xen_pfn_t *mfnp = data;
+
 	struct mmap_batch_state *st = state;
 	int ret;
 
-	ret = xen_remap_domain_mfn_range(st->vma, st->va & PAGE_MASK, *mfnp, 1,
-					 st->vma->vm_page_prot, st->domain);
+	BUG_ON(nr < 0);
 
-	/* Store error code for second pass. */
-	*(st->err++) = ret;
+	ret = xen_remap_domain_mfn_array(st->vma,
+					 st->va & PAGE_MASK,
+					 mfnp, nr,
+					 st->err,
+					 st->vma->vm_page_prot,
+					 st->domain);
 
 	/* And see if it affects the global_error. */
 	if (ret < 0) {
@@ -282,7 +320,7 @@ static int mmap_batch_fn(void *data, void *state)
 				st->global_error = 1;
 		}
 	}
-	st->va += PAGE_SIZE;
+	st->va += PAGE_SIZE * nr;
 
 	return 0;
 }
@@ -378,8 +416,8 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
 	state.err           = err_array;
 
 	/* mmap_batch_fn guarantees ret == 0 */
-	BUG_ON(traverse_pages(m.num, sizeof(xen_pfn_t),
-			     &pagelist, mmap_batch_fn, &state));
+	BUG_ON(traverse_pages_block(m.num, sizeof(xen_pfn_t),
+				    &pagelist, mmap_batch_fn, &state));
 
 	up_write(&mm->mmap_sem);
 
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
index 6a198e4..22cad75 100644
--- a/include/xen/xen-ops.h
+++ b/include/xen/xen-ops.h
@@ -29,4 +29,9 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
 			       unsigned long mfn, int nr,
 			       pgprot_t prot, unsigned domid);
 
+int xen_remap_domain_mfn_array(struct vm_area_struct *vma,
+			       unsigned long addr,
+			       unsigned long *mfn, int nr,
+			       int *err_ptr, pgprot_t prot,
+			       unsigned domid);
 #endif /* INCLUDE_XEN_OPS_H */
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 17:35:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 17:35:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbECe-0005c0-0o; Wed, 21 Nov 2012 17:35:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TbECb-0005bs-Vk
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 17:35:10 +0000
Received: from [85.158.137.99:21407] by server-3.bemta-3.messagelabs.com id
	24/01-31566-DC01DA05; Wed, 21 Nov 2012 17:35:09 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353519306!14935525!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc4Njk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17682 invoked from network); 21 Nov 2012 17:35:08 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 17:35:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="215202461"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 17:35:05 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 12:35:05 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TbECW-0004Tq-N9;
	Wed, 21 Nov 2012 17:35:04 +0000
MIME-Version: 1.0
X-Mercurial-Node: a4f707f6049a4a8152d2886f1b1d49f9e70ef5eb
Message-ID: <a4f707f6049a4a8152d2.1353518970@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 21 Nov 2012 17:29:30 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH] libxl: Fix bug in libxl_cdrom_insert,
 make more robust against bad xenstore data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1353518844 0
# Node ID a4f707f6049a4a8152d2886f1b1d49f9e70ef5eb
# Parent  ae6fb202b233af815466055d9f1a635802a50855
libxl: Fix bug in libxl_cdrom_insert, make more robust against bad xenstore data

libxl_cdrom_insert was failing to initialize the backend type,
resulting in the wrong default backend.  The result was not only that
the CD was not inserted properly, but also that some improper xenstore
entries were created, causing further block commands to fail.

This patch fixes the bug by setting the disk backend type based on the
type of the existing device.

It also makes the system more robust by:
* Checking to see that it has got a valid path before proceeding to
write a partial xenstore entry
* Handling non-existent nodes in the backend xenstore entries more
gracefully

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2201,14 +2201,14 @@ static void libxl__device_disk_from_xs_b
         disk->removable = 0;
 
     tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/mode", be_path));
-    if (!strcmp(tmp, "w"))
+    if (tmp && !strcmp(tmp, "w"))
         disk->readwrite = 1;
     else
         disk->readwrite = 0;
 
     tmp = libxl__xs_read(gc, XBT_NULL,
                          libxl__sprintf(gc, "%s/device-type", be_path));
-    disk->is_cdrom = !strcmp(tmp, "cdrom");
+    disk->is_cdrom = tmp && !strcmp(tmp, "cdrom");
 
     disk->format = LIBXL_DISK_FORMAT_UNKNOWN;
 }
@@ -2353,6 +2353,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
 
     libxl__device device;
     const char * path;
+    char * tmp;
 
     flexarray_t *insert = NULL;
 
@@ -2383,8 +2384,11 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
     disks = libxl_device_disk_list(ctx, domid, &num);
     for (i = 0; i < num; i++) {
         if (disks[i].is_cdrom && !strcmp(disk->vdev, disks[i].vdev))
-            /* found */
+        {
+            /* Found.  Set backend type appropriately. */
+            disk->backend=disks[i].backend;
             break;
+        }
     }
     if (i == num) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Virtual device not found");
@@ -2410,6 +2414,17 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
 
     path = libxl__device_backend_path(gc, &device);
 
+    /* Sanity check: make sure the backend exists before writing here */
+    tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/frontend", path));
+    if (!tmp)
+    {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Internal error: %s does not exist",
+            libxl__sprintf(gc, "%s/frontend", path));
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+
     insert = flexarray_make(gc, 4, 1);
 
     flexarray_append_pair(insert, "type",

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 17:35:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 17:35:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbECe-0005c0-0o; Wed, 21 Nov 2012 17:35:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TbECb-0005bs-Vk
	for xen-devel@lists.xensource.com; Wed, 21 Nov 2012 17:35:10 +0000
Received: from [85.158.137.99:21407] by server-3.bemta-3.messagelabs.com id
	24/01-31566-DC01DA05; Wed, 21 Nov 2012 17:35:09 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353519306!14935525!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc4Njk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17682 invoked from network); 21 Nov 2012 17:35:08 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 17:35:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,293,1352073600"; d="scan'208";a="215202461"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 17:35:05 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 12:35:05 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TbECW-0004Tq-N9;
	Wed, 21 Nov 2012 17:35:04 +0000
MIME-Version: 1.0
X-Mercurial-Node: a4f707f6049a4a8152d2886f1b1d49f9e70ef5eb
Message-ID: <a4f707f6049a4a8152d2.1353518970@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 21 Nov 2012 17:29:30 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH] libxl: Fix bug in libxl_cdrom_insert,
 make more robust against bad xenstore data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1353518844 0
# Node ID a4f707f6049a4a8152d2886f1b1d49f9e70ef5eb
# Parent  ae6fb202b233af815466055d9f1a635802a50855
libxl: Fix bug in libxl_cdrom_insert, make more robust against bad xenstore data

libxl_cdrom_insert was failing to initialize the backend type,
resulting in the wrong default backend.  The result was not only that
the CD was not inserted properly, but also that some improper xenstore
entries were created, causing further block commands to fail.

This patch fixes the bug by setting the disk backend type based on the
type of the existing device.

It also makes the system more robust by:
* Checking to see that it has got a valid path before proceeding to
write a partial xenstore entry
* Handling non-existent nodes in the backend xenstore entries more
gracefully

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2201,14 +2201,14 @@ static void libxl__device_disk_from_xs_b
         disk->removable = 0;
 
     tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/mode", be_path));
-    if (!strcmp(tmp, "w"))
+    if (tmp && !strcmp(tmp, "w"))
         disk->readwrite = 1;
     else
         disk->readwrite = 0;
 
     tmp = libxl__xs_read(gc, XBT_NULL,
                          libxl__sprintf(gc, "%s/device-type", be_path));
-    disk->is_cdrom = !strcmp(tmp, "cdrom");
+    disk->is_cdrom = tmp && !strcmp(tmp, "cdrom");
 
     disk->format = LIBXL_DISK_FORMAT_UNKNOWN;
 }
@@ -2353,6 +2353,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
 
     libxl__device device;
     const char * path;
+    char * tmp;
 
     flexarray_t *insert = NULL;
 
@@ -2383,8 +2384,11 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
     disks = libxl_device_disk_list(ctx, domid, &num);
     for (i = 0; i < num; i++) {
         if (disks[i].is_cdrom && !strcmp(disk->vdev, disks[i].vdev))
-            /* found */
+        {
+            /* Found.  Set backend type appropriately. */
+            disk->backend=disks[i].backend;
             break;
+        }
     }
     if (i == num) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Virtual device not found");
@@ -2410,6 +2414,17 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
 
     path = libxl__device_backend_path(gc, &device);
 
+    /* Sanity check: make sure the backend exists before writing here */
+    tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/frontend", path));
+    if (!tmp)
+    {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Internal error: %s does not exist",
+            libxl__sprintf(gc, "%s/frontend", path));
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+
     insert = flexarray_make(gc, 4, 1);
 
     flexarray_append_pair(insert, "type",

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 20:50:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 20:50:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbHEy-0007ie-Lh; Wed, 21 Nov 2012 20:49:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TbHEx-0007iW-5C
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 20:49:47 +0000
Received: from [85.158.137.99:37024] by server-8.bemta-3.messagelabs.com id
	BA/D9-07786-A6E3DA05; Wed, 21 Nov 2012 20:49:46 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-8.tower-217.messagelabs.com!1353530982!13244935!1
X-Originating-IP: [81.169.146.162]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MiA9PiA0NjYzNTA=\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MiA9PiA0NjYzNTA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13689 invoked from network); 21 Nov 2012 20:49:44 -0000
Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.162)
	by server-8.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 21 Nov 2012 20:49:44 -0000
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmztM8TOFHii0LG94=
X-RZG-CLASS-ID: mo00
Received: from probook.site
	(dslb-088-065-094-058.pools.arcor-ip.net [88.65.94.58])
	by smtp.strato.de (joses mo13) (RZmta 31.4 DYNA|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id y0257eoALKGacr
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 21:49:42 +0100 (CET)
Received: from probook.site (localhost [IPv6:::1])
	by probook.site (Postfix) with ESMTP id BF58D1839A
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 21:49:41 +0100 (CET)
MIME-Version: 1.0
X-Mercurial-Node: a446956472330fe32bc69be764a33f59fb090792
Message-Id: <a446956472330fe32bc6.1353530980@probook.site>
User-Agent: Mercurial-patchbomb/1.7.5
Date: Wed, 21 Nov 2012 21:49:40 +0100
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] xend: enable environment passing in xPopen3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1353530937 -3600
# Node ID a446956472330fe32bc69be764a33f59fb090792
# Parent  2489c29266982175b5b4e945c97b4549360e947f
xend: enable environment passing in xPopen3

In changeset 19990:38dd208e1d95 a new parameter 'env' was added to
xPopen3, but no code was added to actually pass the environment down to
execvpe. Also, the new code was unreachable.

Signed-off-by: Olaf Hering <olaf@aepfle.de>

diff -r 2489c2926698 -r a44695647233 tools/python/xen/util/xpopen.py
--- a/tools/python/xen/util/xpopen.py
+++ b/tools/python/xen/util/xpopen.py
@@ -104,7 +104,7 @@ class xPopen3:
             os.dup2(c2pwrite, 1)
             if capturestderr:
                 os.dup2(errin, 2)
-            self._run_child(cmd)
+            self._run_child(cmd, env)
         os.close(p2cread)
         self.tochild = os.fdopen(p2cwrite, 'w', bufsize)
         os.close(c2pwrite)
@@ -116,7 +116,7 @@ class xPopen3:
             self.childerr = None
         _active.append(self)
 
-    def _run_child(self, cmd):
+    def _run_child(self, cmd, env):
         if isinstance(cmd, basestring):
             cmd = ['/bin/sh', '-c', cmd]
         for i in range(3, MAXFD):
@@ -127,7 +127,6 @@ class xPopen3:
             except OSError:
                 pass
         try:
-            os.execvp(cmd[0], cmd)
             if env is None:
                 os.execvp(cmd[0], cmd)
             else:

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 20:50:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 20:50:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbHEy-0007ie-Lh; Wed, 21 Nov 2012 20:49:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TbHEx-0007iW-5C
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 20:49:47 +0000
Received: from [85.158.137.99:37024] by server-8.bemta-3.messagelabs.com id
	BA/D9-07786-A6E3DA05; Wed, 21 Nov 2012 20:49:46 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-8.tower-217.messagelabs.com!1353530982!13244935!1
X-Originating-IP: [81.169.146.162]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MiA9PiA0NjYzNTA=\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MiA9PiA0NjYzNTA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13689 invoked from network); 21 Nov 2012 20:49:44 -0000
Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.162)
	by server-8.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 21 Nov 2012 20:49:44 -0000
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmztM8TOFHii0LG94=
X-RZG-CLASS-ID: mo00
Received: from probook.site
	(dslb-088-065-094-058.pools.arcor-ip.net [88.65.94.58])
	by smtp.strato.de (joses mo13) (RZmta 31.4 DYNA|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id y0257eoALKGacr
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 21:49:42 +0100 (CET)
Received: from probook.site (localhost [IPv6:::1])
	by probook.site (Postfix) with ESMTP id BF58D1839A
	for <xen-devel@lists.xen.org>; Wed, 21 Nov 2012 21:49:41 +0100 (CET)
MIME-Version: 1.0
X-Mercurial-Node: a446956472330fe32bc69be764a33f59fb090792
Message-Id: <a446956472330fe32bc6.1353530980@probook.site>
User-Agent: Mercurial-patchbomb/1.7.5
Date: Wed, 21 Nov 2012 21:49:40 +0100
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] xend: enable environment passing in xPopen3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1353530937 -3600
# Node ID a446956472330fe32bc69be764a33f59fb090792
# Parent  2489c29266982175b5b4e945c97b4549360e947f
xend: enable environment passing in xPopen3

In changeset 19990:38dd208e1d95 a new parameter 'env' was added to
xPopen3, but no code was added to actually pass the environment down to
execvpe. Also, the new code was unreachable.

Signed-off-by: Olaf Hering <olaf@aepfle.de>

diff -r 2489c2926698 -r a44695647233 tools/python/xen/util/xpopen.py
--- a/tools/python/xen/util/xpopen.py
+++ b/tools/python/xen/util/xpopen.py
@@ -104,7 +104,7 @@ class xPopen3:
             os.dup2(c2pwrite, 1)
             if capturestderr:
                 os.dup2(errin, 2)
-            self._run_child(cmd)
+            self._run_child(cmd, env)
         os.close(p2cread)
         self.tochild = os.fdopen(p2cwrite, 'w', bufsize)
         os.close(c2pwrite)
@@ -116,7 +116,7 @@ class xPopen3:
             self.childerr = None
         _active.append(self)
 
-    def _run_child(self, cmd):
+    def _run_child(self, cmd, env):
         if isinstance(cmd, basestring):
             cmd = ['/bin/sh', '-c', cmd]
         for i in range(3, MAXFD):
@@ -127,7 +127,6 @@ class xPopen3:
             except OSError:
                 pass
         try:
-            os.execvp(cmd[0], cmd)
             if env is None:
                 os.execvp(cmd[0], cmd)
             else:

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 21:07:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 21:07:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbHVc-00083d-B5; Wed, 21 Nov 2012 21:07:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbHVa-00083Y-QY
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 21:06:59 +0000
Received: from [85.158.139.83:31484] by server-9.bemta-5.messagelabs.com id
	D9/74-29295-2724DA05; Wed, 21 Nov 2012 21:06:58 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1353532016!22734291!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUyNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2868 invoked from network); 21 Nov 2012 21:06:57 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-16.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 21:06:57 -0000
X-IronPort-AV: E=Sophos;i="4.83,294,1352073600"; d="scan'208";a="45344646"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 21:06:44 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 16:06:44 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbHVM-0007PF-EE;
	Wed, 21 Nov 2012 21:06:44 +0000
Message-ID: <50AD4264.6030005@citrix.com>
Date: Wed, 21 Nov 2012 21:06:44 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, Keir Fraser
	<keir@xen.org>, Jan Beulich <jbeulich@suse.com>, Tim Deegan <tim@xen.org>
X-Enigmail-Version: 1.4.6
Subject: [Xen-devel] Reentrant NMIs, MCEs and interrupt stack tables.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

While working on a fix for the rare-but-possible problem of reentrant
NMIs and MCEs, I have discovered that it is sadly possible to generate
fake NMIs and MCEs which will run the relevant handlers on the relevant
stacks, without invoking any of the other CPU logic for these special
interrupts.

A fake NMI can be generated by a processor in PIC mode as opposed to
Virtual wire mode, with a delivery of vector 2.  This setup is certainly
possible on a 64bit CPU, but I doubt there are many 64bit CPUs running
with only PIC.

A fake MCE is easy to generate.  A mal-programmed IO-APIC, IOMMU or
MSI/MSI-X entry which deliveres vector 0x18 is sufficient.  The LAPIC
will reject vectors 0 thru 0xf, but will deliver vectors 0x10 thru 0x1f,
despite them being architecturally reserved for exceptions.


The possibility of these fake interrupts (however unlikely) means that
there is necessarily a race condition between receiving a fake interrupt
and a genuine interrupt during which the handler cannot fixup the stack
sufficiently to be able to safely get back out.  If this race condition
were to occur, the real interrupt will corrupt the exception frame of
the fake interrupt, meaning that we cannot possibly resume the original
context.  This situation can be detected, but cannot be corrected, and
the only course of action is to crash gracefully.

The above problem made me wonder why we use separate stacks for NMIs and
MCEs.  I completely accept that the double fault handler should be on a
separate stack, but as we guarentee never to return from it, these
problems disappear.

Is there any particular reason to have separate stacks for NMIs and
MCEs, other than perhaps that it is good/common practice?  I can't think
of any other reasons offhand. (I am not necessarily advocating that we
combine NMIs and MCEs back into the regular Xen stack because, while it
would remove the above race condition, it would make other aspects of
the problem harder to solve.)

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 21:07:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 21:07:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbHVc-00083d-B5; Wed, 21 Nov 2012 21:07:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbHVa-00083Y-QY
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 21:06:59 +0000
Received: from [85.158.139.83:31484] by server-9.bemta-5.messagelabs.com id
	D9/74-29295-2724DA05; Wed, 21 Nov 2012 21:06:58 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1353532016!22734291!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUyNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2868 invoked from network); 21 Nov 2012 21:06:57 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-16.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 21:06:57 -0000
X-IronPort-AV: E=Sophos;i="4.83,294,1352073600"; d="scan'208";a="45344646"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 21:06:44 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 16:06:44 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbHVM-0007PF-EE;
	Wed, 21 Nov 2012 21:06:44 +0000
Message-ID: <50AD4264.6030005@citrix.com>
Date: Wed, 21 Nov 2012 21:06:44 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, Keir Fraser
	<keir@xen.org>, Jan Beulich <jbeulich@suse.com>, Tim Deegan <tim@xen.org>
X-Enigmail-Version: 1.4.6
Subject: [Xen-devel] Reentrant NMIs, MCEs and interrupt stack tables.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

While working on a fix for the rare-but-possible problem of reentrant
NMIs and MCEs, I have discovered that it is sadly possible to generate
fake NMIs and MCEs which will run the relevant handlers on the relevant
stacks, without invoking any of the other CPU logic for these special
interrupts.

A fake NMI can be generated by a processor in PIC mode as opposed to
Virtual wire mode, with a delivery of vector 2.  This setup is certainly
possible on a 64bit CPU, but I doubt there are many 64bit CPUs running
with only PIC.

A fake MCE is easy to generate.  A mal-programmed IO-APIC, IOMMU or
MSI/MSI-X entry which deliveres vector 0x18 is sufficient.  The LAPIC
will reject vectors 0 thru 0xf, but will deliver vectors 0x10 thru 0x1f,
despite them being architecturally reserved for exceptions.


The possibility of these fake interrupts (however unlikely) means that
there is necessarily a race condition between receiving a fake interrupt
and a genuine interrupt during which the handler cannot fixup the stack
sufficiently to be able to safely get back out.  If this race condition
were to occur, the real interrupt will corrupt the exception frame of
the fake interrupt, meaning that we cannot possibly resume the original
context.  This situation can be detected, but cannot be corrected, and
the only course of action is to crash gracefully.

The above problem made me wonder why we use separate stacks for NMIs and
MCEs.  I completely accept that the double fault handler should be on a
separate stack, but as we guarentee never to return from it, these
problems disappear.

Is there any particular reason to have separate stacks for NMIs and
MCEs, other than perhaps that it is good/common practice?  I can't think
of any other reasons offhand. (I am not necessarily advocating that we
combine NMIs and MCEs back into the regular Xen stack because, while it
would remove the above race condition, it would make other aspects of
the problem harder to solve.)

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 21:17:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 21:17:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbHfL-0008Ib-IZ; Wed, 21 Nov 2012 21:17:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TbHfK-0008IW-Qg
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 21:17:03 +0000
Received: from [193.109.254.147:52983] by server-4.bemta-14.messagelabs.com id
	AE/98-18856-EC44DA05; Wed, 21 Nov 2012 21:17:02 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1353532621!8483916!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30846 invoked from network); 21 Nov 2012 21:17:01 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-13.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 21 Nov 2012 21:17:01 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TbHfI-000JOx-3Q; Wed, 21 Nov 2012 21:17:00 +0000
Date: Wed, 21 Nov 2012 21:17:00 +0000
From: Tim Deegan <tim@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121121211700.GB61398@ocelot.phlegethon.org>
References: <50AD4264.6030005@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50AD4264.6030005@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Reentrant NMIs, MCEs and interrupt stack tables.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 21:06 +0000 on 21 Nov (1353532004), Andrew Cooper wrote:
> Hello,
> 
> While working on a fix for the rare-but-possible problem of reentrant
> NMIs and MCEs, I have discovered that it is sadly possible to generate
> fake NMIs and MCEs which will run the relevant handlers on the relevant
> stacks, without invoking any of the other CPU logic for these special
> interrupts.
> 
> A fake NMI can be generated by a processor in PIC mode as opposed to
> Virtual wire mode, with a delivery of vector 2.  This setup is certainly
> possible on a 64bit CPU, but I doubt there are many 64bit CPUs running
> with only PIC.
> 
> A fake MCE is easy to generate.  A mal-programmed IO-APIC, IOMMU or
> MSI/MSI-X entry which deliveres vector 0x18 is sufficient.  The LAPIC
> will reject vectors 0 thru 0xf, but will deliver vectors 0x10 thru 0x1f,
> despite them being architecturally reserved for exceptions.

You're not suggesting these could be caused by guest activity?

> The possibility of these fake interrupts (however unlikely) means that
> there is necessarily a race condition between receiving a fake interrupt
> and a genuine interrupt during which the handler cannot fixup the stack
> sufficiently to be able to safely get back out.  If this race condition
> were to occur, the real interrupt will corrupt the exception frame of
> the fake interrupt, meaning that we cannot possibly resume the original
> context.  This situation can be detected, but cannot be corrected, and
> the only course of action is to crash gracefully.

If once of these could only be casued by a bug in Xen, then I don't think
we need to handle it at all.  If it's trivial to detect it and crash
cleanly, that would be nice.

> The above problem made me wonder why we use separate stacks for NMIs and
> MCEs.  I completely accept that the double fault handler should be on a
> separate stack, but as we guarentee never to return from it, these
> problems disappear.
> 
> Is there any particular reason to have separate stacks for NMIs and
> MCEs, other than perhaps that it is good/common practice? 

It's to avoid a race where we take an NMI or MCE after swicthhing to the
user/guest stack but before SYSRET.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 21:17:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 21:17:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbHfL-0008Ib-IZ; Wed, 21 Nov 2012 21:17:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TbHfK-0008IW-Qg
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 21:17:03 +0000
Received: from [193.109.254.147:52983] by server-4.bemta-14.messagelabs.com id
	AE/98-18856-EC44DA05; Wed, 21 Nov 2012 21:17:02 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1353532621!8483916!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30846 invoked from network); 21 Nov 2012 21:17:01 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-13.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 21 Nov 2012 21:17:01 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TbHfI-000JOx-3Q; Wed, 21 Nov 2012 21:17:00 +0000
Date: Wed, 21 Nov 2012 21:17:00 +0000
From: Tim Deegan <tim@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121121211700.GB61398@ocelot.phlegethon.org>
References: <50AD4264.6030005@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50AD4264.6030005@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Reentrant NMIs, MCEs and interrupt stack tables.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 21:06 +0000 on 21 Nov (1353532004), Andrew Cooper wrote:
> Hello,
> 
> While working on a fix for the rare-but-possible problem of reentrant
> NMIs and MCEs, I have discovered that it is sadly possible to generate
> fake NMIs and MCEs which will run the relevant handlers on the relevant
> stacks, without invoking any of the other CPU logic for these special
> interrupts.
> 
> A fake NMI can be generated by a processor in PIC mode as opposed to
> Virtual wire mode, with a delivery of vector 2.  This setup is certainly
> possible on a 64bit CPU, but I doubt there are many 64bit CPUs running
> with only PIC.
> 
> A fake MCE is easy to generate.  A mal-programmed IO-APIC, IOMMU or
> MSI/MSI-X entry which deliveres vector 0x18 is sufficient.  The LAPIC
> will reject vectors 0 thru 0xf, but will deliver vectors 0x10 thru 0x1f,
> despite them being architecturally reserved for exceptions.

You're not suggesting these could be caused by guest activity?

> The possibility of these fake interrupts (however unlikely) means that
> there is necessarily a race condition between receiving a fake interrupt
> and a genuine interrupt during which the handler cannot fixup the stack
> sufficiently to be able to safely get back out.  If this race condition
> were to occur, the real interrupt will corrupt the exception frame of
> the fake interrupt, meaning that we cannot possibly resume the original
> context.  This situation can be detected, but cannot be corrected, and
> the only course of action is to crash gracefully.

If once of these could only be casued by a bug in Xen, then I don't think
we need to handle it at all.  If it's trivial to detect it and crash
cleanly, that would be nice.

> The above problem made me wonder why we use separate stacks for NMIs and
> MCEs.  I completely accept that the double fault handler should be on a
> separate stack, but as we guarentee never to return from it, these
> problems disappear.
> 
> Is there any particular reason to have separate stacks for NMIs and
> MCEs, other than perhaps that it is good/common practice? 

It's to avoid a race where we take an NMI or MCE after swicthhing to the
user/guest stack but before SYSRET.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 21:40:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 21:40:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbI1d-0000CE-JA; Wed, 21 Nov 2012 21:40:05 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbI1c-0000C7-4h
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 21:40:04 +0000
Received: from [85.158.143.99:61446] by server-2.bemta-4.messagelabs.com id
	43/DE-28922-33A4DA05; Wed, 21 Nov 2012 21:40:03 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1353534001!29954466!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc4Njk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18672 invoked from network); 21 Nov 2012 21:40:02 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 21:40:02 -0000
X-IronPort-AV: E=Sophos;i="4.83,295,1352073600"; d="scan'208";a="215228103"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 21:40:00 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 16:40:00 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbI1Y-0007tH-2f;
	Wed, 21 Nov 2012 21:40:00 +0000
Message-ID: <50AD4A30.90804@citrix.com>
Date: Wed, 21 Nov 2012 21:40:00 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <50AD4264.6030005@citrix.com>
	<20121121211700.GB61398@ocelot.phlegethon.org>
In-Reply-To: <20121121211700.GB61398@ocelot.phlegethon.org>
X-Enigmail-Version: 1.4.6
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Reentrant NMIs, MCEs and interrupt stack tables.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 21/11/12 21:17, Tim Deegan wrote:
> At 21:06 +0000 on 21 Nov (1353532004), Andrew Cooper wrote:
>> Hello,
>>
>> While working on a fix for the rare-but-possible problem of reentrant
>> NMIs and MCEs, I have discovered that it is sadly possible to generate
>> fake NMIs and MCEs which will run the relevant handlers on the relevant
>> stacks, without invoking any of the other CPU logic for these special
>> interrupts.
>>
>> A fake NMI can be generated by a processor in PIC mode as opposed to
>> Virtual wire mode, with a delivery of vector 2.  This setup is certainly
>> possible on a 64bit CPU, but I doubt there are many 64bit CPUs running
>> with only PIC.
>>
>> A fake MCE is easy to generate.  A mal-programmed IO-APIC, IOMMU or
>> MSI/MSI-X entry which deliveres vector 0x18 is sufficient.  The LAPIC
>> will reject vectors 0 thru 0xf, but will deliver vectors 0x10 thru 0x1f,
>> despite them being architecturally reserved for exceptions.
> You're not suggesting these could be caused by guest activity?

No.  This would be buggy hardware or buggy Xen.  Perhaps I should have
said "A fake MCE is easy to generate (if you are hacking Xen to try and
deliberately make it happen)" (Although 'easy' is just speculation based
on the description of behaviour of the LAPIC in the Intel SDM Volume 3)

>
>> The possibility of these fake interrupts (however unlikely) means that
>> there is necessarily a race condition between receiving a fake interrupt
>> and a genuine interrupt during which the handler cannot fixup the stack
>> sufficiently to be able to safely get back out.  If this race condition
>> were to occur, the real interrupt will corrupt the exception frame of
>> the fake interrupt, meaning that we cannot possibly resume the original
>> context.  This situation can be detected, but cannot be corrected, and
>> the only course of action is to crash gracefully.
> If once of these could only be casued by a bug in Xen, then I don't think
> we need to handle it at all.  If it's trivial to detect it and crash
> cleanly, that would be nice.

With all the other gubbins in to work around the stack problem, it
becomes two extra conditionals, so for all intents and purposes trivial.

>
>> The above problem made me wonder why we use separate stacks for NMIs and
>> MCEs.  I completely accept that the double fault handler should be on a
>> separate stack, but as we guarentee never to return from it, these
>> problems disappear.
>>
>> Is there any particular reason to have separate stacks for NMIs and
>> MCEs, other than perhaps that it is good/common practice? 
> It's to avoid a race where we take an NMI or MCE after swicthhing to the
> user/guest stack but before SYSRET.
>
> Tim.

Ah yes - I forgot to consider that case.

Thanks,

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 21:40:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 21:40:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbI1d-0000CE-JA; Wed, 21 Nov 2012 21:40:05 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbI1c-0000C7-4h
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 21:40:04 +0000
Received: from [85.158.143.99:61446] by server-2.bemta-4.messagelabs.com id
	43/DE-28922-33A4DA05; Wed, 21 Nov 2012 21:40:03 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1353534001!29954466!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc4Njk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18672 invoked from network); 21 Nov 2012 21:40:02 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 21:40:02 -0000
X-IronPort-AV: E=Sophos;i="4.83,295,1352073600"; d="scan'208";a="215228103"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	21 Nov 2012 21:40:00 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 21 Nov 2012 16:40:00 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbI1Y-0007tH-2f;
	Wed, 21 Nov 2012 21:40:00 +0000
Message-ID: <50AD4A30.90804@citrix.com>
Date: Wed, 21 Nov 2012 21:40:00 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <50AD4264.6030005@citrix.com>
	<20121121211700.GB61398@ocelot.phlegethon.org>
In-Reply-To: <20121121211700.GB61398@ocelot.phlegethon.org>
X-Enigmail-Version: 1.4.6
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Reentrant NMIs, MCEs and interrupt stack tables.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 21/11/12 21:17, Tim Deegan wrote:
> At 21:06 +0000 on 21 Nov (1353532004), Andrew Cooper wrote:
>> Hello,
>>
>> While working on a fix for the rare-but-possible problem of reentrant
>> NMIs and MCEs, I have discovered that it is sadly possible to generate
>> fake NMIs and MCEs which will run the relevant handlers on the relevant
>> stacks, without invoking any of the other CPU logic for these special
>> interrupts.
>>
>> A fake NMI can be generated by a processor in PIC mode as opposed to
>> Virtual wire mode, with a delivery of vector 2.  This setup is certainly
>> possible on a 64bit CPU, but I doubt there are many 64bit CPUs running
>> with only PIC.
>>
>> A fake MCE is easy to generate.  A mal-programmed IO-APIC, IOMMU or
>> MSI/MSI-X entry which deliveres vector 0x18 is sufficient.  The LAPIC
>> will reject vectors 0 thru 0xf, but will deliver vectors 0x10 thru 0x1f,
>> despite them being architecturally reserved for exceptions.
> You're not suggesting these could be caused by guest activity?

No.  This would be buggy hardware or buggy Xen.  Perhaps I should have
said "A fake MCE is easy to generate (if you are hacking Xen to try and
deliberately make it happen)" (Although 'easy' is just speculation based
on the description of behaviour of the LAPIC in the Intel SDM Volume 3)

>
>> The possibility of these fake interrupts (however unlikely) means that
>> there is necessarily a race condition between receiving a fake interrupt
>> and a genuine interrupt during which the handler cannot fixup the stack
>> sufficiently to be able to safely get back out.  If this race condition
>> were to occur, the real interrupt will corrupt the exception frame of
>> the fake interrupt, meaning that we cannot possibly resume the original
>> context.  This situation can be detected, but cannot be corrected, and
>> the only course of action is to crash gracefully.
> If once of these could only be casued by a bug in Xen, then I don't think
> we need to handle it at all.  If it's trivial to detect it and crash
> cleanly, that would be nice.

With all the other gubbins in to work around the stack problem, it
becomes two extra conditionals, so for all intents and purposes trivial.

>
>> The above problem made me wonder why we use separate stacks for NMIs and
>> MCEs.  I completely accept that the double fault handler should be on a
>> separate stack, but as we guarentee never to return from it, these
>> problems disappear.
>>
>> Is there any particular reason to have separate stacks for NMIs and
>> MCEs, other than perhaps that it is good/common practice? 
> It's to avoid a race where we take an NMI or MCE after swicthhing to the
> user/guest stack but before SYSRET.
>
> Tim.

Ah yes - I forgot to consider that case.

Thanks,

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 22:45:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 22:45:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbJ1x-00012A-Vt; Wed, 21 Nov 2012 22:44:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ronny.hegewald@online.de>) id 1TbJ1w-000125-MD
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 22:44:28 +0000
Received: from [85.158.139.211:51397] by server-15.bemta-5.messagelabs.com id
	B2/8E-26920-B495DA05; Wed, 21 Nov 2012 22:44:27 +0000
X-Env-Sender: ronny.hegewald@online.de
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353537867!21044564!1
X-Originating-IP: [212.227.17.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gODQxMDA=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gODQxMDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4523 invoked from network); 21 Nov 2012 22:44:27 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.17.9)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 22:44:27 -0000
Received: from server2-groupware.localnet (p4FEF8C5B.dip0.t-ipconnect.de
	[79.239.140.91])
	by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis)
	id 0MYpHi-1Tp0PB48Qc-00VQ2u; Wed, 21 Nov 2012 23:44:21 +0100
From: Ronny Hegewald <ronny.hegewald@online.de>
To: xen-devel@lists.xen.org
Date: Wed, 21 Nov 2012 23:50:04 +0000
User-Agent: KMail/1.11.4 (Linux/3.0.3; KDE/4.2.4; i686; ; )
References: <201211010218.14872.ronny.hegewald@online.de>
	<201211030255.37630.ronny.hegewald@online.de>
	<1352805562.7491.59.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352805562.7491.59.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
Message-Id: <201211212350.04598.ronny.hegewald@online.de>
X-Provags-ID: V02:K0:wsgDmHx0unAW4ixHa76tlcF8BOV7tHP6J7ksQK5F49O
	OiI7PM3vmHs4BTXP+/FdAU7dXk7CCRyV8zJolmQHF03Q9tt7sx
	dcWbqmTEiLq7apRgclLXwyhvgbdlI9yOLXVhPY6eaZkj/xAkYT
	lEWr5vOZUDcPfRkr4TU5vrQhwJf5E6je4kQv9FFBM209VkB3eZ
	8YqRsPHJpxxnMeZ7nlqLIKjCwBWLtN/hF0eOAAHnuhy5k7eR8K
	zXF9gZlXTqZQIldZFDtQooac/CfmTrP2869gPQKzbXABf1IzrF
	syZYyWJp67C0rZslxN57QshMDW90jdmxV1nWwZadt/JtDYD8tc
	Z65M4cAUMTUIFbRBLnwCXsDdNH0IJI1CTJ+IkJogf0TxhoxYcN
	JxEACp0v1aPuhQJITdehf3x4nwnG1JEIiE=
Cc: Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH V2] fix vfb related assertion problem when
	starting pv-domU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tuesday 13 November 2012, Ian Campbell wrote:
> On Sat, 2012-11-03 at 02:55 +0000, Ronny Hegewald wrote:
> > > Signed-off-by: Ronny Hegewald@online.de
> >
> > Somehow the sign off gone wrong. it was supposed to be
> >
> > Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>
>
> Acked-by: Ian Campbell <ian.campbell@citrix.com> and applied, thanks.
>

Wouldn't this patch also be appropriate for the 4.2 stable branch?



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 21 22:45:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Nov 2012 22:45:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbJ1x-00012A-Vt; Wed, 21 Nov 2012 22:44:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ronny.hegewald@online.de>) id 1TbJ1w-000125-MD
	for xen-devel@lists.xen.org; Wed, 21 Nov 2012 22:44:28 +0000
Received: from [85.158.139.211:51397] by server-15.bemta-5.messagelabs.com id
	B2/8E-26920-B495DA05; Wed, 21 Nov 2012 22:44:27 +0000
X-Env-Sender: ronny.hegewald@online.de
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353537867!21044564!1
X-Originating-IP: [212.227.17.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gODQxMDA=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gODQxMDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4523 invoked from network); 21 Nov 2012 22:44:27 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.17.9)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	21 Nov 2012 22:44:27 -0000
Received: from server2-groupware.localnet (p4FEF8C5B.dip0.t-ipconnect.de
	[79.239.140.91])
	by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis)
	id 0MYpHi-1Tp0PB48Qc-00VQ2u; Wed, 21 Nov 2012 23:44:21 +0100
From: Ronny Hegewald <ronny.hegewald@online.de>
To: xen-devel@lists.xen.org
Date: Wed, 21 Nov 2012 23:50:04 +0000
User-Agent: KMail/1.11.4 (Linux/3.0.3; KDE/4.2.4; i686; ; )
References: <201211010218.14872.ronny.hegewald@online.de>
	<201211030255.37630.ronny.hegewald@online.de>
	<1352805562.7491.59.camel@zakaz.uk.xensource.com>
In-Reply-To: <1352805562.7491.59.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
Message-Id: <201211212350.04598.ronny.hegewald@online.de>
X-Provags-ID: V02:K0:wsgDmHx0unAW4ixHa76tlcF8BOV7tHP6J7ksQK5F49O
	OiI7PM3vmHs4BTXP+/FdAU7dXk7CCRyV8zJolmQHF03Q9tt7sx
	dcWbqmTEiLq7apRgclLXwyhvgbdlI9yOLXVhPY6eaZkj/xAkYT
	lEWr5vOZUDcPfRkr4TU5vrQhwJf5E6je4kQv9FFBM209VkB3eZ
	8YqRsPHJpxxnMeZ7nlqLIKjCwBWLtN/hF0eOAAHnuhy5k7eR8K
	zXF9gZlXTqZQIldZFDtQooac/CfmTrP2869gPQKzbXABf1IzrF
	syZYyWJp67C0rZslxN57QshMDW90jdmxV1nWwZadt/JtDYD8tc
	Z65M4cAUMTUIFbRBLnwCXsDdNH0IJI1CTJ+IkJogf0TxhoxYcN
	JxEACp0v1aPuhQJITdehf3x4nwnG1JEIiE=
Cc: Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH V2] fix vfb related assertion problem when
	starting pv-domU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tuesday 13 November 2012, Ian Campbell wrote:
> On Sat, 2012-11-03 at 02:55 +0000, Ronny Hegewald wrote:
> > > Signed-off-by: Ronny Hegewald@online.de
> >
> > Somehow the sign off gone wrong. it was supposed to be
> >
> > Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>
>
> Acked-by: Ian Campbell <ian.campbell@citrix.com> and applied, thanks.
>

Wouldn't this patch also be appropriate for the 4.2 stable branch?



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 02:25:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 02:25:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbMSx-0007rK-HR; Thu, 22 Nov 2012 02:24:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <yang.z.zhang@intel.com>) id 1TbMSw-0007rF-RW
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 02:24:34 +0000
Received: from [85.158.139.211:14928] by server-2.bemta-5.messagelabs.com id
	E0/3F-04892-1EC8DA05; Thu, 22 Nov 2012 02:24:33 +0000
X-Env-Sender: yang.z.zhang@intel.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1353551072!19115153!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzI0MzA4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28392 invoked from network); 22 Nov 2012 02:24:33 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-8.tower-206.messagelabs.com with SMTP;
	22 Nov 2012 02:24:33 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga101.jf.intel.com with ESMTP; 21 Nov 2012 18:24:31 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,297,1352102400"; d="scan'208";a="222896467"
Received: from yang-desktop.sh.intel.com ([10.239.13.107])
	by orsmga001.jf.intel.com with ESMTP; 21 Nov 2012 18:24:30 -0800
From: Yang Zhang <yang.z.zhang@intel.com>
To: xen-devel@lists.xen.org
Date: Thu, 22 Nov 2012 10:20:23 +0800
Message-Id: <1353550823-10009-1-git-send-email-yang.z.zhang@intel.com>
X-Mailer: git-send-email 1.7.1.1
Cc: Yang Zhang <yang.z.zhang@Intel.com>, konrad@kernel.org
Subject: [Xen-devel] [PATCH] x86/xen : Fix the wrong check in pciback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

From: Yang Zhang <yang.z.zhang@Intel.com>

Fix the wrong check in pciback.

Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
---
 drivers/xen/xen-pciback/pciback.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/xen-pciback/pciback.h b/drivers/xen/xen-pciback/pciback.h
index a7def01..f72af87 100644
--- a/drivers/xen/xen-pciback/pciback.h
+++ b/drivers/xen/xen-pciback/pciback.h
@@ -124,7 +124,7 @@ static inline int xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev,
 static inline void xen_pcibk_release_pci_dev(struct xen_pcibk_device *pdev,
 					     struct pci_dev *dev)
 {
-	if (xen_pcibk_backend && xen_pcibk_backend->free)
+	if (xen_pcibk_backend && xen_pcibk_backend->release)
 		return xen_pcibk_backend->release(pdev, dev);
 }
 
-- 
1.7.1.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 02:25:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 02:25:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbMSx-0007rK-HR; Thu, 22 Nov 2012 02:24:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <yang.z.zhang@intel.com>) id 1TbMSw-0007rF-RW
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 02:24:34 +0000
Received: from [85.158.139.211:14928] by server-2.bemta-5.messagelabs.com id
	E0/3F-04892-1EC8DA05; Thu, 22 Nov 2012 02:24:33 +0000
X-Env-Sender: yang.z.zhang@intel.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1353551072!19115153!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzI0MzA4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28392 invoked from network); 22 Nov 2012 02:24:33 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-8.tower-206.messagelabs.com with SMTP;
	22 Nov 2012 02:24:33 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga101.jf.intel.com with ESMTP; 21 Nov 2012 18:24:31 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,297,1352102400"; d="scan'208";a="222896467"
Received: from yang-desktop.sh.intel.com ([10.239.13.107])
	by orsmga001.jf.intel.com with ESMTP; 21 Nov 2012 18:24:30 -0800
From: Yang Zhang <yang.z.zhang@intel.com>
To: xen-devel@lists.xen.org
Date: Thu, 22 Nov 2012 10:20:23 +0800
Message-Id: <1353550823-10009-1-git-send-email-yang.z.zhang@intel.com>
X-Mailer: git-send-email 1.7.1.1
Cc: Yang Zhang <yang.z.zhang@Intel.com>, konrad@kernel.org
Subject: [Xen-devel] [PATCH] x86/xen : Fix the wrong check in pciback
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

From: Yang Zhang <yang.z.zhang@Intel.com>

Fix the wrong check in pciback.

Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
---
 drivers/xen/xen-pciback/pciback.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/xen-pciback/pciback.h b/drivers/xen/xen-pciback/pciback.h
index a7def01..f72af87 100644
--- a/drivers/xen/xen-pciback/pciback.h
+++ b/drivers/xen/xen-pciback/pciback.h
@@ -124,7 +124,7 @@ static inline int xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev,
 static inline void xen_pcibk_release_pci_dev(struct xen_pcibk_device *pdev,
 					     struct pci_dev *dev)
 {
-	if (xen_pcibk_backend && xen_pcibk_backend->free)
+	if (xen_pcibk_backend && xen_pcibk_backend->release)
 		return xen_pcibk_backend->release(pdev, dev);
 }
 
-- 
1.7.1.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 06:00:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 06:00:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbPpM-0002Aq-Kl; Thu, 22 Nov 2012 05:59:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TbPpK-0002Al-Sd
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 05:59:55 +0000
Received: from [85.158.139.83:40069] by server-2.bemta-5.messagelabs.com id
	63/BA-04892-A5FBDA05; Thu, 22 Nov 2012 05:59:54 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1353563993!28662897!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3917 invoked from network); 22 Nov 2012 05:59:53 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 05:59:53 -0000
X-IronPort-AV: E=Sophos;i="4.83,298,1352073600"; d="scan'208";a="15938186"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 05:59:52 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 22 Nov 2012 05:59:52 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TbPpI-00078X-GT;
	Thu, 22 Nov 2012 05:59:52 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TbPpI-0002dt-Cm;
	Thu, 22 Nov 2012 05:59:52 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14464-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 22 Nov 2012 05:59:52 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14464: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14464 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14464/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14462
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14462
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14462
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14462

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  2489c2926698
baseline version:
 xen                  2489c2926698

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 06:00:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 06:00:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbPpM-0002Aq-Kl; Thu, 22 Nov 2012 05:59:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TbPpK-0002Al-Sd
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 05:59:55 +0000
Received: from [85.158.139.83:40069] by server-2.bemta-5.messagelabs.com id
	63/BA-04892-A5FBDA05; Thu, 22 Nov 2012 05:59:54 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1353563993!28662897!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3917 invoked from network); 22 Nov 2012 05:59:53 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 05:59:53 -0000
X-IronPort-AV: E=Sophos;i="4.83,298,1352073600"; d="scan'208";a="15938186"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 05:59:52 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 22 Nov 2012 05:59:52 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TbPpI-00078X-GT;
	Thu, 22 Nov 2012 05:59:52 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TbPpI-0002dt-Cm;
	Thu, 22 Nov 2012 05:59:52 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14464-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 22 Nov 2012 05:59:52 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14464: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14464 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14464/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14462
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14462
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14462
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14462

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  2489c2926698
baseline version:
 xen                  2489c2926698

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 07:54:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 07:54:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbRbp-0003i9-CL; Thu, 22 Nov 2012 07:54:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbRbn-0003i4-5G
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 07:54:03 +0000
Received: from [85.158.137.99:29811] by server-16.bemta-3.messagelabs.com id
	BC/06-07461-A1ADDA05; Thu, 22 Nov 2012 07:54:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1353570841!20128841!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22769 invoked from network); 22 Nov 2012 07:54:01 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 07:54:01 -0000
X-IronPort-AV: E=Sophos;i="4.83,298,1352073600"; d="scan'208";a="15939308"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 07:54:01 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 07:54:01 +0000
Message-ID: <1353570840.29837.13.camel@dagon.hellion.org.uk>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ronny Hegewald <ronny.hegewald@online.de>
Date: Thu, 22 Nov 2012 07:54:00 +0000
In-Reply-To: <201211212350.04598.ronny.hegewald@online.de>
References: <201211010218.14872.ronny.hegewald@online.de>
	<201211030255.37630.ronny.hegewald@online.de>
	<1352805562.7491.59.camel@zakaz.uk.xensource.com>
	<201211212350.04598.ronny.hegewald@online.de>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] fix vfb related assertion problem when
 starting pv-domU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-21 at 23:50 +0000, Ronny Hegewald wrote:
> On Tuesday 13 November 2012, Ian Campbell wrote:
> > On Sat, 2012-11-03 at 02:55 +0000, Ronny Hegewald wrote:
> > > > Signed-off-by: Ronny Hegewald@online.de
> > >
> > > Somehow the sign off gone wrong. it was supposed to be
> > >
> > > Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>
> >
> > Acked-by: Ian Campbell <ian.campbell@citrix.com> and applied, thanks.
> >
> 
> Wouldn't this patch also be appropriate for the 4.2 stable branch?

Yes, I think so.

Ian, this is 26145:8b93ac0c93f3 in unstable.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 07:54:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 07:54:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbRbp-0003i9-CL; Thu, 22 Nov 2012 07:54:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbRbn-0003i4-5G
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 07:54:03 +0000
Received: from [85.158.137.99:29811] by server-16.bemta-3.messagelabs.com id
	BC/06-07461-A1ADDA05; Thu, 22 Nov 2012 07:54:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1353570841!20128841!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22769 invoked from network); 22 Nov 2012 07:54:01 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 07:54:01 -0000
X-IronPort-AV: E=Sophos;i="4.83,298,1352073600"; d="scan'208";a="15939308"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 07:54:01 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 07:54:01 +0000
Message-ID: <1353570840.29837.13.camel@dagon.hellion.org.uk>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ronny Hegewald <ronny.hegewald@online.de>
Date: Thu, 22 Nov 2012 07:54:00 +0000
In-Reply-To: <201211212350.04598.ronny.hegewald@online.de>
References: <201211010218.14872.ronny.hegewald@online.de>
	<201211030255.37630.ronny.hegewald@online.de>
	<1352805562.7491.59.camel@zakaz.uk.xensource.com>
	<201211212350.04598.ronny.hegewald@online.de>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] fix vfb related assertion problem when
 starting pv-domU
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-21 at 23:50 +0000, Ronny Hegewald wrote:
> On Tuesday 13 November 2012, Ian Campbell wrote:
> > On Sat, 2012-11-03 at 02:55 +0000, Ronny Hegewald wrote:
> > > > Signed-off-by: Ronny Hegewald@online.de
> > >
> > > Somehow the sign off gone wrong. it was supposed to be
> > >
> > > Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>
> >
> > Acked-by: Ian Campbell <ian.campbell@citrix.com> and applied, thanks.
> >
> 
> Wouldn't this patch also be appropriate for the 4.2 stable branch?

Yes, I think so.

Ian, this is 26145:8b93ac0c93f3 in unstable.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 08:42:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 08:42:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbSMD-0004ms-Db; Thu, 22 Nov 2012 08:42:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbSMC-0004mn-4B
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 08:42:00 +0000
Received: from [85.158.139.83:8171] by server-16.bemta-5.messagelabs.com id
	D7/4E-04786-755EDA05; Thu, 22 Nov 2012 08:41:59 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1353573718!27423638!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24095 invoked from network); 22 Nov 2012 08:41:58 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-182.messagelabs.com with SMTP;
	22 Nov 2012 08:41:58 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 08:41:57 +0000
Message-Id: <50ADF39E02000078000AA8A4@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 08:42:53 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mats Petersson" <mats.petersson@citrix.com>
References: <1353518365-7386-1-git-send-email-mats.petersson@citrix.com>
In-Reply-To: <1353518365-7386-1-git-send-email-mats.petersson@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: konrad@kernel.org, xen-devel@lists.xen.org, david.vrabel@citrix.com,
	Ian.Campbell@citrix.com
Subject: Re: [Xen-devel] [PATCH V3] xen/privcmd: improve performance of
 mapping of guest memory to dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 21.11.12 at 18:19, Mats Petersson <mats.petersson@citrix.com> wrote:
> @@ -2526,19 +2557,94 @@ int xen_remap_domain_mfn_range(struct vm_area_struct 
> *vma,
>  		if (err)
>  			goto out;
>  
> -		err = HYPERVISOR_mmu_update(mmu_update, batch, NULL, domid);
> -		if (err < 0)
> -			goto out;
> +		/* We record the error for each page that gives an error, but
> +		 * continue mapping until the whole set is done */
> +		do {
> +			err = HYPERVISOR_mmu_update(&mmu_update[index],
> +						    batch_left, &done, domid);
> +			if (err < 0) {
> +				/* incrememnt done so we skip the error item */

increment

> +				done++;
> +				if (err_ptr)
> +					last_err = err_ptr[index] = err;
> +				else
> +					/* exit if error and no err_ptr */
> +					goto out;

For readability/reduction of indentation, I'd suggest


				/* exit if error and no err_ptr */
				if (!err_ptr)
					goto out;
				/* increment done so we skip the error item */
				done++;
				last_err = err_ptr[index] = err;

However, I wonder how a caller of the function would find out
at which slot the error happened when not passing an error
indicator array (after all, the function also doesn't undo what
already succeeded in that case, i.e. the state is completely
unknown to such a caller).

Jan

> +			}
> +			batch_left -= done;
> +			index += done;
> +		} while (batch_left);



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 08:42:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 08:42:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbSMD-0004ms-Db; Thu, 22 Nov 2012 08:42:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbSMC-0004mn-4B
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 08:42:00 +0000
Received: from [85.158.139.83:8171] by server-16.bemta-5.messagelabs.com id
	D7/4E-04786-755EDA05; Thu, 22 Nov 2012 08:41:59 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1353573718!27423638!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24095 invoked from network); 22 Nov 2012 08:41:58 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-182.messagelabs.com with SMTP;
	22 Nov 2012 08:41:58 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 08:41:57 +0000
Message-Id: <50ADF39E02000078000AA8A4@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 08:42:53 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mats Petersson" <mats.petersson@citrix.com>
References: <1353518365-7386-1-git-send-email-mats.petersson@citrix.com>
In-Reply-To: <1353518365-7386-1-git-send-email-mats.petersson@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: konrad@kernel.org, xen-devel@lists.xen.org, david.vrabel@citrix.com,
	Ian.Campbell@citrix.com
Subject: Re: [Xen-devel] [PATCH V3] xen/privcmd: improve performance of
 mapping of guest memory to dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 21.11.12 at 18:19, Mats Petersson <mats.petersson@citrix.com> wrote:
> @@ -2526,19 +2557,94 @@ int xen_remap_domain_mfn_range(struct vm_area_struct 
> *vma,
>  		if (err)
>  			goto out;
>  
> -		err = HYPERVISOR_mmu_update(mmu_update, batch, NULL, domid);
> -		if (err < 0)
> -			goto out;
> +		/* We record the error for each page that gives an error, but
> +		 * continue mapping until the whole set is done */
> +		do {
> +			err = HYPERVISOR_mmu_update(&mmu_update[index],
> +						    batch_left, &done, domid);
> +			if (err < 0) {
> +				/* incrememnt done so we skip the error item */

increment

> +				done++;
> +				if (err_ptr)
> +					last_err = err_ptr[index] = err;
> +				else
> +					/* exit if error and no err_ptr */
> +					goto out;

For readability/reduction of indentation, I'd suggest


				/* exit if error and no err_ptr */
				if (!err_ptr)
					goto out;
				/* increment done so we skip the error item */
				done++;
				last_err = err_ptr[index] = err;

However, I wonder how a caller of the function would find out
at which slot the error happened when not passing an error
indicator array (after all, the function also doesn't undo what
already succeeded in that case, i.e. the state is completely
unknown to such a caller).

Jan

> +			}
> +			batch_left -= done;
> +			index += done;
> +		} while (batch_left);



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 08:55:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 08:55:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbSYb-00051Y-7B; Thu, 22 Nov 2012 08:54:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbSYa-00051T-97
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 08:54:48 +0000
Received: from [85.158.137.99:39494] by server-1.bemta-3.messagelabs.com id
	D6/DE-12169-758EDA05; Thu, 22 Nov 2012 08:54:47 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1353574486!20138037!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29850 invoked from network); 22 Nov 2012 08:54:46 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-217.messagelabs.com with SMTP;
	22 Nov 2012 08:54:46 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 08:54:45 +0000
Message-Id: <50ADF69E02000078000AA8B0@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 08:55:42 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>,
 "Tim Deegan" <tim@xen.org>
References: <50AD4264.6030005@citrix.com>
	<20121121211700.GB61398@ocelot.phlegethon.org>
In-Reply-To: <20121121211700.GB61398@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Reentrant NMIs, MCEs and interrupt stack tables.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 21.11.12 at 22:17, Tim Deegan <tim@xen.org> wrote:
> At 21:06 +0000 on 21 Nov (1353532004), Andrew Cooper wrote:
>> Hello,
>> 
>> While working on a fix for the rare-but-possible problem of reentrant
>> NMIs and MCEs, I have discovered that it is sadly possible to generate
>> fake NMIs and MCEs which will run the relevant handlers on the relevant
>> stacks, without invoking any of the other CPU logic for these special
>> interrupts.
>> 
>> A fake NMI can be generated by a processor in PIC mode as opposed to
>> Virtual wire mode, with a delivery of vector 2.  This setup is certainly
>> possible on a 64bit CPU, but I doubt there are many 64bit CPUs running
>> with only PIC.
>> 
>> A fake MCE is easy to generate.  A mal-programmed IO-APIC, IOMMU or
>> MSI/MSI-X entry which deliveres vector 0x18 is sufficient.  The LAPIC
>> will reject vectors 0 thru 0xf, but will deliver vectors 0x10 thru 0x1f,
>> despite them being architecturally reserved for exceptions.
> 
> You're not suggesting these could be caused by guest activity?
> 
>> The possibility of these fake interrupts (however unlikely) means that
>> there is necessarily a race condition between receiving a fake interrupt
>> and a genuine interrupt during which the handler cannot fixup the stack
>> sufficiently to be able to safely get back out.  If this race condition
>> were to occur, the real interrupt will corrupt the exception frame of
>> the fake interrupt, meaning that we cannot possibly resume the original
>> context.  This situation can be detected, but cannot be corrected, and
>> the only course of action is to crash gracefully.
> 
> If once of these could only be casued by a bug in Xen, then I don't think
> we need to handle it at all.

Fully agree - the nesting we need to deal with cleanly is only
what can result from proper operation. Buggy operation should
not require any extra efforts, as long as it's only hypothetical
(i.e. if we knew a certain chipset/CPU could cause such, the need
for a workaround would surely arise; bugs in Xen we should treat
as such rather than trying to work around their effects).

> If it's trivial to detect it and crash cleanly, that would be nice.

That shouldn't be too difficult, as such interrupts would set ISR bits
in either the PIC or the LAPIC.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 08:55:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 08:55:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbSYb-00051Y-7B; Thu, 22 Nov 2012 08:54:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbSYa-00051T-97
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 08:54:48 +0000
Received: from [85.158.137.99:39494] by server-1.bemta-3.messagelabs.com id
	D6/DE-12169-758EDA05; Thu, 22 Nov 2012 08:54:47 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1353574486!20138037!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29850 invoked from network); 22 Nov 2012 08:54:46 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-217.messagelabs.com with SMTP;
	22 Nov 2012 08:54:46 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 08:54:45 +0000
Message-Id: <50ADF69E02000078000AA8B0@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 08:55:42 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>,
 "Tim Deegan" <tim@xen.org>
References: <50AD4264.6030005@citrix.com>
	<20121121211700.GB61398@ocelot.phlegethon.org>
In-Reply-To: <20121121211700.GB61398@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Reentrant NMIs, MCEs and interrupt stack tables.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 21.11.12 at 22:17, Tim Deegan <tim@xen.org> wrote:
> At 21:06 +0000 on 21 Nov (1353532004), Andrew Cooper wrote:
>> Hello,
>> 
>> While working on a fix for the rare-but-possible problem of reentrant
>> NMIs and MCEs, I have discovered that it is sadly possible to generate
>> fake NMIs and MCEs which will run the relevant handlers on the relevant
>> stacks, without invoking any of the other CPU logic for these special
>> interrupts.
>> 
>> A fake NMI can be generated by a processor in PIC mode as opposed to
>> Virtual wire mode, with a delivery of vector 2.  This setup is certainly
>> possible on a 64bit CPU, but I doubt there are many 64bit CPUs running
>> with only PIC.
>> 
>> A fake MCE is easy to generate.  A mal-programmed IO-APIC, IOMMU or
>> MSI/MSI-X entry which deliveres vector 0x18 is sufficient.  The LAPIC
>> will reject vectors 0 thru 0xf, but will deliver vectors 0x10 thru 0x1f,
>> despite them being architecturally reserved for exceptions.
> 
> You're not suggesting these could be caused by guest activity?
> 
>> The possibility of these fake interrupts (however unlikely) means that
>> there is necessarily a race condition between receiving a fake interrupt
>> and a genuine interrupt during which the handler cannot fixup the stack
>> sufficiently to be able to safely get back out.  If this race condition
>> were to occur, the real interrupt will corrupt the exception frame of
>> the fake interrupt, meaning that we cannot possibly resume the original
>> context.  This situation can be detected, but cannot be corrected, and
>> the only course of action is to crash gracefully.
> 
> If once of these could only be casued by a bug in Xen, then I don't think
> we need to handle it at all.

Fully agree - the nesting we need to deal with cleanly is only
what can result from proper operation. Buggy operation should
not require any extra efforts, as long as it's only hypothetical
(i.e. if we knew a certain chipset/CPU could cause such, the need
for a workaround would surely arise; bugs in Xen we should treat
as such rather than trying to work around their effects).

> If it's trivial to detect it and crash cleanly, that would be nice.

That shouldn't be too difficult, as such interrupts would set ISR bits
in either the PIC or the LAPIC.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 08:58:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 08:58:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbSbj-00057r-Re; Thu, 22 Nov 2012 08:58:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbSbi-00057j-9A
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 08:58:02 +0000
Received: from [85.158.137.99:37320] by server-6.bemta-3.messagelabs.com id
	CA/CB-28265-919EDA05; Thu, 22 Nov 2012 08:58:01 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1353574680!16995066!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8912 invoked from network); 22 Nov 2012 08:58:00 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-217.messagelabs.com with SMTP;
	22 Nov 2012 08:58:00 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 08:57:59 +0000
Message-Id: <50ADF75F02000078000AA8BB@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 08:58:55 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Malcolm Crossley" <malcolm.crossley@citrix.com>,<tim@xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
In-Reply-To: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
Mime-Version: 1.0
Content-Disposition: inline
Cc: eddie.dong@intel.com, Ian.Campbell@citrix.com, jun.nakajima@intel.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 21:08, Malcolm Crossley <malcolm.crossley@citrix.com> wrote:
> The self_nmi() code cause's an NMI to be triggered by sending an APIC message
> to the local processor. Unfortunately there is a delay in the delivery of 
> the
> APIC message and we may already have re-entered the HVM guest by the time the
> NMI is taken. This results in the VMEXIT code calling the self_nmi() 
> function
> again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop 
> before
> the HVM guest resumes normal operation.
> 
> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
> 
> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
> completes.
> 
> So we believe it is safe to directly invoke the INT call as NMI's should
> already be blocked.
> 
> The INT 2 call will perform an IRET which will unblock later calls to the 
> NMI
> handler, according to Intel SDM Volume 3 Chapter 6.7.1. We must ensure that 
> the
> IRET from the INT 2 IRET is the first IRET issued to prevent losing an NMI.
> Moving the INT 2 call to before the interrupts are enabled should ensure we
> don't lose the NMI.
> 
> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
> Acked-by: Tim Deegan <tim@xen.org>

As (I think) we agreed to not use "int $2", and as I don't recall
having seen a v3 of this patch - is that something that can be
expected any time soon? Ideally, I would want to incorporate
the changes here (and hopefully also the PV issue described
during the discussion) in the pending 4.2.1 (and, if applicable,
4.1.4) release(s).

Jan

> diff -r 62885b3c34c8 -r 7d6fd0219dd7 xen/arch/x86/hvm/vmx/vmx.c
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>          vector = intr_info & INTR_INFO_VECTOR_MASK;
>          if ( vector == TRAP_machine_check )
>              do_machine_check(regs);
> +        else if ( vector == TRAP_nmi &&
> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
> +                  (X86_EVENTTYPE_NMI << 8) ) )
> +            /* Must be called before interrupts are enabled to ensure
> +             * the NMI handler code is run before the first IRET. The
> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
> +             */
> +            asm volatile("int $2"); /* Real NMI, vector 2: normal 
> processing */
>          break;
>      case EXIT_REASON_MCE_DURING_VMENTRY:
>          do_machine_check(regs);
> @@ -2442,7 +2450,6 @@ void vmx_vmexit_handler(struct cpu_user_
>                   (X86_EVENTTYPE_NMI << 8) )
>                  goto exit_and_crash;
>              HVMTRACE_0D(NMI);
> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>              break;
>          case TRAP_machine_check:
>              HVMTRACE_0D(MCE);
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 08:58:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 08:58:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbSbj-00057r-Re; Thu, 22 Nov 2012 08:58:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbSbi-00057j-9A
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 08:58:02 +0000
Received: from [85.158.137.99:37320] by server-6.bemta-3.messagelabs.com id
	CA/CB-28265-919EDA05; Thu, 22 Nov 2012 08:58:01 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1353574680!16995066!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8912 invoked from network); 22 Nov 2012 08:58:00 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-217.messagelabs.com with SMTP;
	22 Nov 2012 08:58:00 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 08:57:59 +0000
Message-Id: <50ADF75F02000078000AA8BB@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 08:58:55 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Malcolm Crossley" <malcolm.crossley@citrix.com>,<tim@xen.org>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
In-Reply-To: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
Mime-Version: 1.0
Content-Disposition: inline
Cc: eddie.dong@intel.com, Ian.Campbell@citrix.com, jun.nakajima@intel.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 13.11.12 at 21:08, Malcolm Crossley <malcolm.crossley@citrix.com> wrote:
> The self_nmi() code cause's an NMI to be triggered by sending an APIC message
> to the local processor. Unfortunately there is a delay in the delivery of 
> the
> APIC message and we may already have re-entered the HVM guest by the time the
> NMI is taken. This results in the VMEXIT code calling the self_nmi() 
> function
> again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop 
> before
> the HVM guest resumes normal operation.
> 
> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
> 
> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
> completes.
> 
> So we believe it is safe to directly invoke the INT call as NMI's should
> already be blocked.
> 
> The INT 2 call will perform an IRET which will unblock later calls to the 
> NMI
> handler, according to Intel SDM Volume 3 Chapter 6.7.1. We must ensure that 
> the
> IRET from the INT 2 IRET is the first IRET issued to prevent losing an NMI.
> Moving the INT 2 call to before the interrupts are enabled should ensure we
> don't lose the NMI.
> 
> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
> Acked-by: Tim Deegan <tim@xen.org>

As (I think) we agreed to not use "int $2", and as I don't recall
having seen a v3 of this patch - is that something that can be
expected any time soon? Ideally, I would want to incorporate
the changes here (and hopefully also the PV issue described
during the discussion) in the pending 4.2.1 (and, if applicable,
4.1.4) release(s).

Jan

> diff -r 62885b3c34c8 -r 7d6fd0219dd7 xen/arch/x86/hvm/vmx/vmx.c
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>          vector = intr_info & INTR_INFO_VECTOR_MASK;
>          if ( vector == TRAP_machine_check )
>              do_machine_check(regs);
> +        else if ( vector == TRAP_nmi &&
> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
> +                  (X86_EVENTTYPE_NMI << 8) ) )
> +            /* Must be called before interrupts are enabled to ensure
> +             * the NMI handler code is run before the first IRET. The
> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
> +             */
> +            asm volatile("int $2"); /* Real NMI, vector 2: normal 
> processing */
>          break;
>      case EXIT_REASON_MCE_DURING_VMENTRY:
>          do_machine_check(regs);
> @@ -2442,7 +2450,6 @@ void vmx_vmexit_handler(struct cpu_user_
>                   (X86_EVENTTYPE_NMI << 8) )
>                  goto exit_and_crash;
>              HVMTRACE_0D(NMI);
> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>              break;
>          case TRAP_machine_check:
>              HVMTRACE_0D(MCE);
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 09:32:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 09:32:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbT95-0005he-1O; Thu, 22 Nov 2012 09:32:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TbT92-0005hZ-P5
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 09:32:29 +0000
Received: from [85.158.137.99:33841] by server-9.bemta-3.messagelabs.com id
	9B/F0-02388-721FDA05; Thu, 22 Nov 2012 09:32:23 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1353576742!20143864!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3825 invoked from network); 22 Nov 2012 09:32:22 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 09:32:22 -0000
Received: by mail-ee0-f45.google.com with SMTP id d49so5382578eek.32
	for <xen-devel@lists.xen.org>; Thu, 22 Nov 2012 01:32:22 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=5vlPoCCQEK09BMsmhQ2EvETmfj3LhWzkVaOqSRHG428=;
	b=AyyYKmpDdrJg4AEFZ8mI0ROaBVGx2eDpgqYFUClFyal5EbPjM7lDiyTgIcTihuj858
	UQslwnX6jY986lUZ70MDntJDdXh6+i63igHmB+2ax0nqc/zlj2QiqYt+42p4ZzQ7WidX
	23RiFuUhnK6xLlf7DJQavHNEunSoBb/6DZLnyuYBrGldRjtPFXlgtHzUfohRrLGehImS
	o1RORPW6KAp1695tcFiAFCAeYdzgfqpDtOvE1aRlQtGPrhYNb2bdUznlLwCN6uWWarq+
	F7kRk1I7pzd+1YOFKPtUINb9tW1zFldUGEflugNb6jBkrS2tTTkNFHEQZ9eGa7oibr4I
	5zrA==
Received: by 10.14.205.3 with SMTP id i3mr55712939eeo.18.1353576741922;
	Thu, 22 Nov 2012 01:32:21 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id a44sm5851365eeo.7.2012.11.22.01.32.20
	(version=SSLv3 cipher=OTHER); Thu, 22 Nov 2012 01:32:21 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 22 Nov 2012 09:32:10 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCD3A19A.53300%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] implement vmap()
Thread-Index: Ac3IlD7stsV6DBGSJEuaY73H40lBvQ==
In-Reply-To: <509D12FC02000078000A77E4@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] implement vmap()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 09/11/2012 13:28, "Jan Beulich" <JBeulich@suse.com> wrote:

> ... and use it as basis for a proper ioremap() on x86.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -100,6 +100,7 @@
>  #include <xen/iocap.h>
>  #include <xen/guest_access.h>
>  #include <xen/pfn.h>
> +#include <xen/vmap.h>
>  #include <xen/xmalloc.h>
>  #include <xen/efi.h>
>  #include <xen/grant_table.h>
> @@ -5460,6 +5561,32 @@ void __set_fixmap(
>      map_pages_to_xen(fix_to_virt(idx), mfn, 1, flags);
>  }
>  
> +void *__init arch_vmap_virt_end(void)
> +{
> +    return (void *)fix_to_virt(__end_of_fixed_addresses);
> +}
> +
> +void __iomem *ioremap(paddr_t pa, size_t len)
> +{
> +    unsigned long pfn = PFN_DOWN(pa);
> +    void *va;
> +
> +    WARN_ON(page_is_ram_type(pfn, RAM_TYPE_CONVENTIONAL));
> +
> +    /* The low first Mb is always mapped. */
> +    if ( !((pa + len - 1) >> 20) )
> +        va = __va(pa);
> +    else
> +    {
> +        unsigned int offs = pa & (PAGE_SIZE - 1);
> +        unsigned int nr = PFN_UP(offs + len);
> +
> +        va = __vmap(&pfn, nr, 1, 1, PAGE_HYPERVISOR_NOCACHE) + offs;
> +    }
> +
> +    return (void __force __iomem *)va;
> +}
> +
>  #ifdef MEMORY_GUARD
>  
>  void memguard_init(void)
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -1104,6 +1104,7 @@ void __init __start_xen(unsigned long mb
>      end_boot_allocator();
>      system_state = SYS_STATE_boot;
>  
> +    vm_init();
>      vesa_init();
>  
>      softirq_init();
> --- a/xen/common/Makefile
> +++ b/xen/common/Makefile
> @@ -36,6 +36,7 @@ obj-y += time.o
>  obj-y += timer.o
>  obj-y += trace.o
>  obj-y += version.o
> +obj-y += vmap.o
>  obj-y += vsprintf.o
>  obj-y += wait.o
>  obj-y += xmalloc_tlsf.o
> --- /dev/null
> +++ b/xen/common/vmap.c
> @@ -0,0 +1,204 @@
> +#ifdef VMAP_VIRT_START
> +#include <xen/bitmap.h>
> +#include <xen/cache.h>
> +#include <xen/init.h>
> +#include <xen/mm.h>
> +#include <xen/pfn.h>
> +#include <xen/spinlock.h>
> +#include <xen/types.h>
> +#include <xen/vmap.h>
> +#include <asm/page.h>
> +
> +static DEFINE_SPINLOCK(vm_lock);
> +static void *__read_mostly vm_base;
> +#define vm_bitmap ((unsigned long *)vm_base)
> +/* highest allocated bit in the bitmap */
> +static unsigned int __read_mostly vm_top;
> +/* total number of bits in the bitmap */
> +static unsigned int __read_mostly vm_end;
> +/* lowest known clear bit in the bitmap */
> +static unsigned int vm_low;
> +
> +void __init vm_init(void)
> +{
> +    unsigned int i, nr;
> +    unsigned long va;
> +
> +    vm_base = (void *)VMAP_VIRT_START;
> +    vm_end = PFN_DOWN(arch_vmap_virt_end() - vm_base);
> +    vm_low = PFN_UP((vm_end + 7) / 8);
> +    nr = PFN_UP((vm_low + 7) / 8);
> +    vm_top = nr * PAGE_SIZE * 8;
> +
> +    for ( i = 0, va = (unsigned long)vm_bitmap; i < nr; ++i, va += PAGE_SIZE
> )
> +    {
> +        struct page_info *pg = alloc_domheap_page(NULL, 0);
> +
> +        map_pages_to_xen(va, page_to_mfn(pg), 1, PAGE_HYPERVISOR);
> +        clear_page((void *)va);
> +    }
> +    bitmap_fill(vm_bitmap, vm_low);
> +
> +    /* Populate page tables for the bitmap if necessary. */
> +    map_pages_to_xen(va, 0, vm_low - nr, MAP_SMALL_PAGES);
> +}
> +
> +void *vm_alloc(unsigned int nr, unsigned int align)
> +{
> +    unsigned int start, bit;
> +
> +    if ( !align )
> +        align = 1;
> +    else if ( align & (align - 1) )
> +        align &= -align;
> +
> +    spin_lock(&vm_lock);
> +    for ( ; ; )
> +    {
> +        struct page_info *pg;
> +
> +        ASSERT(!test_bit(vm_low, vm_bitmap));
> +        for ( start = vm_low; ; )
> +        {
> +            bit = find_next_bit(vm_bitmap, vm_top, start + 1);
> +            if ( bit > vm_top )
> +                bit = vm_top;
> +            /*
> +             * Note that this skips the first bit, making the
> +             * corresponding page a guard one.
> +             */
> +            start = (start + align) & ~(align - 1);
> +            if ( start + nr <= bit )
> +                break;
> +            start = bit < vm_top ?
> +                    find_next_zero_bit(vm_bitmap, vm_top, bit + 1) : bit;
> +            if ( start >= vm_top )
> +                break;
> +        }
> +
> +        if ( start < vm_top )
> +            break;
> +
> +        spin_unlock(&vm_lock);
> +
> +        if ( vm_top >= vm_end )
> +            return NULL;
> +
> +        pg = alloc_domheap_page(NULL, 0);
> +        if ( !pg )
> +            return NULL;
> +
> +        spin_lock(&vm_lock);
> +
> +        if ( start >= vm_top )
> +        {
> +            unsigned long va = (unsigned long)vm_bitmap + vm_top / 8;
> +
> +            if ( !map_pages_to_xen(va, page_to_mfn(pg), 1, PAGE_HYPERVISOR) )
> +            {
> +                clear_page((void *)va);
> +                vm_top += PAGE_SIZE * 8;
> +                if ( vm_top > vm_end )
> +                    vm_top = vm_end;
> +                continue;
> +            }
> +        }
> +
> +        free_domheap_page(pg);
> +
> +        if ( start >= vm_top )
> +        {
> +            spin_unlock(&vm_lock);
> +            return NULL;
> +        }
> +    }
> +
> +    for ( bit = start; bit < start + nr; ++bit )
> +        __set_bit(bit, vm_bitmap);
> +    if ( start <= vm_low + 2 )
> +        vm_low = bit;
> +    spin_unlock(&vm_lock);
> +
> +    return vm_base + start * PAGE_SIZE;
> +}
> +
> +static unsigned int vm_index(const void *va)
> +{
> +    unsigned long addr = (unsigned long)va & ~(PAGE_SIZE - 1);
> +    unsigned int idx;
> +
> +    if ( addr < VMAP_VIRT_START + (vm_end / 8) ||
> +         addr >= VMAP_VIRT_START + vm_top * PAGE_SIZE )
> +        return 0;
> +
> +    idx = PFN_DOWN(va - vm_base);
> +    return !test_bit(idx - 1, vm_bitmap) &&
> +           test_bit(idx, vm_bitmap) ? idx : 0;
> +}
> +
> +static unsigned int vm_size(const void *va)
> +{
> +    unsigned int start = vm_index(va), end;
> +
> +    if ( !start )
> +        return 0;
> +
> +    end = find_next_zero_bit(vm_bitmap, vm_top, start + 1);
> +
> +    return min(end, vm_top) - start;
> +}
> +
> +void vm_free(const void *va)
> +{
> +    unsigned int bit = vm_index(va);
> +
> +    if ( !bit )
> +    {
> +        WARN_ON(va != NULL);
> +        return;
> +    }
> +
> +    spin_lock(&vm_lock);
> +    if ( bit < vm_low )
> +    {
> +        vm_low = bit - 1;
> +        while ( !test_bit(vm_low - 1, vm_bitmap) )
> +            --vm_low;
> +    }
> +    while ( __test_and_clear_bit(bit, vm_bitmap) )
> +        if ( ++bit == vm_top )
> +            break;
> +    spin_unlock(&vm_lock);
> +}
> +
> +void *__vmap(const unsigned long *mfn, unsigned int granularity,
> +             unsigned int nr, unsigned int align, unsigned int flags)
> +{
> +    void *va = vm_alloc(nr * granularity, align);
> +    unsigned long cur = (unsigned long)va;
> +
> +    for ( ; va && nr--; ++mfn, cur += PAGE_SIZE * granularity )
> +    {
> +        if ( map_pages_to_xen(cur, *mfn, granularity, flags) )
> +        {
> +            vunmap(va);
> +            va = NULL;
> +        }
> +    }
> +
> +    return va;
> +}
> +
> +void *vmap(const unsigned long *mfn, unsigned int nr)
> +{
> +    return __vmap(mfn, 1, nr, 1, PAGE_HYPERVISOR);
> +}
> +
> +void vunmap(const void *va)
> +{
> +    unsigned long addr = (unsigned long)va;
> +
> +    destroy_xen_mappings(addr, addr + PAGE_SIZE * vm_size(va));
> +    vm_free(va);
> +}
> +#endif
> --- a/xen/drivers/acpi/apei/erst.c
> +++ b/xen/drivers/acpi/apei/erst.c
> @@ -247,9 +247,6 @@ static int erst_exec_move_data(struct ap
>  {
> int rc;
> u64 offset;
> -#ifdef CONFIG_X86
> - enum fixed_addresses idx;
> -#endif
> void *src, *dst;
>  
> /* ioremap does not work in interrupt context */
> @@ -263,39 +260,11 @@ static int erst_exec_move_data(struct ap
> if (rc)
> return rc;
>  
> -#ifdef CONFIG_X86
> - switch (ctx->var2) {
> - case 0:
> -  return 0;
> - case 1 ... PAGE_SIZE:
> -  break;
> - default:
> -  printk(KERN_WARNING
> -         "MOVE_DATA cannot be used for %#"PRIx64" bytes of data\n",
> -         ctx->var2);
> -  return -EOPNOTSUPP;
> - }
> -
> - src = __acpi_map_table(ctx->src_base + offset, ctx->var2);
> -#else
> src = ioremap(ctx->src_base + offset, ctx->var2);
> -#endif
> if (!src)
> return -ENOMEM;
>  
> -#ifdef CONFIG_X86
> - BUILD_BUG_ON(FIX_ACPI_PAGES < 4);
> - idx = virt_to_fix((unsigned long)src + 2 * PAGE_SIZE);
> - offset += ctx->dst_base;
> - dst = (void *)fix_to_virt(idx) + (offset & ~PAGE_MASK);
> - set_fixmap(idx, offset);
> - if (PFN_DOWN(offset) != PFN_DOWN(offset + ctx->var2 - 1)) {
> -  idx = virt_to_fix((unsigned long)dst + PAGE_SIZE);
> -  set_fixmap(idx, offset + PAGE_SIZE);
> - }
> -#else
> dst = ioremap(ctx->dst_base + offset, ctx->var2);
> -#endif
> if (dst) {
> memmove(dst, src, ctx->var2);
> iounmap(dst);
> --- a/xen/drivers/video/vesa.c
> +++ b/xen/drivers/video/vesa.c
> @@ -10,6 +10,7 @@
>  #include <xen/xmalloc.h>
>  #include <xen/kernel.h>
>  #include <xen/vga.h>
> +#include <asm/io.h>
>  #include <asm/page.h>
>  #include "font.h"
>  
> @@ -101,13 +102,11 @@ void __init vesa_init(void)
>      if ( !line_len )
>          goto fail;
>  
> -    if ( map_pages_to_xen(IOREMAP_VIRT_START,
> -                          vlfb_info.lfb_base >> PAGE_SHIFT,
> -                          vram_remap >> PAGE_SHIFT,
> -                          PAGE_HYPERVISOR_NOCACHE) )
> +    lfb = ioremap(vlfb_info.lfb_base, vram_remap);
> +    if ( !lfb )
>          goto fail;
>  
> -    lfb = memset((void *)IOREMAP_VIRT_START, 0, vram_remap);
> +    memset(lfb, 0, vram_remap);
>  
>      vga_puts = vesa_redraw_puts;
>  
> --- a/xen/include/asm-x86/config.h
> +++ b/xen/include/asm-x86/config.h
> @@ -144,7 +144,7 @@ extern unsigned char boot_edid_info[128]
>   *  0xffff828000000000 - 0xffff82bfffffffff [256GB, 2^38 bytes, PML4:261]
>   *    Machine-to-phys translation table.
>   *  0xffff82c000000000 - 0xffff82c3ffffffff [16GB,  2^34 bytes, PML4:261]
> - *    ioremap()/fixmap area.
> + *    vmap()/ioremap()/fixmap area.
>   *  0xffff82c400000000 - 0xffff82c43fffffff [1GB,   2^30 bytes, PML4:261]
>   *    Compatibility machine-to-phys translation table.
>   *  0xffff82c440000000 - 0xffff82c47fffffff [1GB,   2^30 bytes, PML4:261]
> @@ -205,11 +205,11 @@ extern unsigned char boot_edid_info[128]
>  /* Slot 261: machine-to-phys conversion table (256GB). */
>  #define RDWR_MPT_VIRT_START     (PML4_ADDR(261))
>  #define RDWR_MPT_VIRT_END       (RDWR_MPT_VIRT_START + MPT_VIRT_SIZE)
> -/* Slot 261: ioremap()/fixmap area (16GB). */
> -#define IOREMAP_VIRT_START      RDWR_MPT_VIRT_END
> -#define IOREMAP_VIRT_END        (IOREMAP_VIRT_START + GB(16))
> +/* Slot 261: vmap()/ioremap()/fixmap area (16GB). */
> +#define VMAP_VIRT_START         RDWR_MPT_VIRT_END
> +#define VMAP_VIRT_END           (VMAP_VIRT_START + GB(16))
>  /* Slot 261: compatibility machine-to-phys conversion table (1GB). */
> -#define RDWR_COMPAT_MPT_VIRT_START IOREMAP_VIRT_END
> +#define RDWR_COMPAT_MPT_VIRT_START VMAP_VIRT_END
>  #define RDWR_COMPAT_MPT_VIRT_END (RDWR_COMPAT_MPT_VIRT_START + GB(1))
>  /* Slot 261: high read-only compat machine-to-phys conversion table (1GB). */
>  #define HIRO_COMPAT_MPT_VIRT_START RDWR_COMPAT_MPT_VIRT_END
> --- a/xen/include/asm-x86/fixmap.h
> +++ b/xen/include/asm-x86/fixmap.h
> @@ -15,7 +15,7 @@
>  #include <xen/config.h>
>  #include <asm/page.h>
>  
> -#define FIXADDR_TOP (IOREMAP_VIRT_END - PAGE_SIZE)
> +#define FIXADDR_TOP (VMAP_VIRT_END - PAGE_SIZE)
>  
>  #ifndef __ASSEMBLY__
>  
> --- a/xen/include/asm-x86/io.h
> +++ b/xen/include/asm-x86/io.h
> @@ -1,14 +1,10 @@
>  #ifndef _ASM_IO_H
>  #define _ASM_IO_H
>  
> -#include <xen/config.h>
> +#include <xen/vmap.h>
>  #include <xen/types.h>
>  #include <asm/page.h>
>  
> -/* We don't need real ioremap() on Xen/x86. */
> -#define ioremap(x,l) (__va(x))
> -#define iounmap(p)   ((void)0)
> -
>  #define readb(x) (*(volatile char *)(x))
>  #define readw(x) (*(volatile short *)(x))
>  #define readl(x) (*(volatile int *)(x))
> --- /dev/null
> +++ b/xen/include/xen/vmap.h
> @@ -0,0 +1,24 @@
> +#if !defined(__XEN_VMAP_H__) && defined(VMAP_VIRT_START)
> +#define __XEN_VMAP_H__
> +
> +#include <xen/types.h>
> +
> +void *vm_alloc(unsigned int nr, unsigned int align);
> +void vm_free(const void *);
> +
> +void *__vmap(const unsigned long *mfn, unsigned int granularity,
> +             unsigned int nr, unsigned int align, unsigned int flags);
> +void *vmap(const unsigned long *mfn, unsigned int nr);
> +void vunmap(const void *);
> +
> +void __iomem *ioremap(paddr_t, size_t);
> +
> +static inline void iounmap(void __iomem *va)
> +{
> +    vunmap((void __force *)va);
> +}
> +
> +void vm_init(void);
> +void *arch_vmap_virt_end(void);
> +
> +#endif /* __XEN_VMAP_H__ */
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 09:32:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 09:32:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbT95-0005he-1O; Thu, 22 Nov 2012 09:32:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TbT92-0005hZ-P5
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 09:32:29 +0000
Received: from [85.158.137.99:33841] by server-9.bemta-3.messagelabs.com id
	9B/F0-02388-721FDA05; Thu, 22 Nov 2012 09:32:23 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1353576742!20143864!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3825 invoked from network); 22 Nov 2012 09:32:22 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 09:32:22 -0000
Received: by mail-ee0-f45.google.com with SMTP id d49so5382578eek.32
	for <xen-devel@lists.xen.org>; Thu, 22 Nov 2012 01:32:22 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=5vlPoCCQEK09BMsmhQ2EvETmfj3LhWzkVaOqSRHG428=;
	b=AyyYKmpDdrJg4AEFZ8mI0ROaBVGx2eDpgqYFUClFyal5EbPjM7lDiyTgIcTihuj858
	UQslwnX6jY986lUZ70MDntJDdXh6+i63igHmB+2ax0nqc/zlj2QiqYt+42p4ZzQ7WidX
	23RiFuUhnK6xLlf7DJQavHNEunSoBb/6DZLnyuYBrGldRjtPFXlgtHzUfohRrLGehImS
	o1RORPW6KAp1695tcFiAFCAeYdzgfqpDtOvE1aRlQtGPrhYNb2bdUznlLwCN6uWWarq+
	F7kRk1I7pzd+1YOFKPtUINb9tW1zFldUGEflugNb6jBkrS2tTTkNFHEQZ9eGa7oibr4I
	5zrA==
Received: by 10.14.205.3 with SMTP id i3mr55712939eeo.18.1353576741922;
	Thu, 22 Nov 2012 01:32:21 -0800 (PST)
Received: from [192.168.1.3] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id a44sm5851365eeo.7.2012.11.22.01.32.20
	(version=SSLv3 cipher=OTHER); Thu, 22 Nov 2012 01:32:21 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 22 Nov 2012 09:32:10 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCD3A19A.53300%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] implement vmap()
Thread-Index: Ac3IlD7stsV6DBGSJEuaY73H40lBvQ==
In-Reply-To: <509D12FC02000078000A77E4@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] implement vmap()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 09/11/2012 13:28, "Jan Beulich" <JBeulich@suse.com> wrote:

> ... and use it as basis for a proper ioremap() on x86.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -100,6 +100,7 @@
>  #include <xen/iocap.h>
>  #include <xen/guest_access.h>
>  #include <xen/pfn.h>
> +#include <xen/vmap.h>
>  #include <xen/xmalloc.h>
>  #include <xen/efi.h>
>  #include <xen/grant_table.h>
> @@ -5460,6 +5561,32 @@ void __set_fixmap(
>      map_pages_to_xen(fix_to_virt(idx), mfn, 1, flags);
>  }
>  
> +void *__init arch_vmap_virt_end(void)
> +{
> +    return (void *)fix_to_virt(__end_of_fixed_addresses);
> +}
> +
> +void __iomem *ioremap(paddr_t pa, size_t len)
> +{
> +    unsigned long pfn = PFN_DOWN(pa);
> +    void *va;
> +
> +    WARN_ON(page_is_ram_type(pfn, RAM_TYPE_CONVENTIONAL));
> +
> +    /* The low first Mb is always mapped. */
> +    if ( !((pa + len - 1) >> 20) )
> +        va = __va(pa);
> +    else
> +    {
> +        unsigned int offs = pa & (PAGE_SIZE - 1);
> +        unsigned int nr = PFN_UP(offs + len);
> +
> +        va = __vmap(&pfn, nr, 1, 1, PAGE_HYPERVISOR_NOCACHE) + offs;
> +    }
> +
> +    return (void __force __iomem *)va;
> +}
> +
>  #ifdef MEMORY_GUARD
>  
>  void memguard_init(void)
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -1104,6 +1104,7 @@ void __init __start_xen(unsigned long mb
>      end_boot_allocator();
>      system_state = SYS_STATE_boot;
>  
> +    vm_init();
>      vesa_init();
>  
>      softirq_init();
> --- a/xen/common/Makefile
> +++ b/xen/common/Makefile
> @@ -36,6 +36,7 @@ obj-y += time.o
>  obj-y += timer.o
>  obj-y += trace.o
>  obj-y += version.o
> +obj-y += vmap.o
>  obj-y += vsprintf.o
>  obj-y += wait.o
>  obj-y += xmalloc_tlsf.o
> --- /dev/null
> +++ b/xen/common/vmap.c
> @@ -0,0 +1,204 @@
> +#ifdef VMAP_VIRT_START
> +#include <xen/bitmap.h>
> +#include <xen/cache.h>
> +#include <xen/init.h>
> +#include <xen/mm.h>
> +#include <xen/pfn.h>
> +#include <xen/spinlock.h>
> +#include <xen/types.h>
> +#include <xen/vmap.h>
> +#include <asm/page.h>
> +
> +static DEFINE_SPINLOCK(vm_lock);
> +static void *__read_mostly vm_base;
> +#define vm_bitmap ((unsigned long *)vm_base)
> +/* highest allocated bit in the bitmap */
> +static unsigned int __read_mostly vm_top;
> +/* total number of bits in the bitmap */
> +static unsigned int __read_mostly vm_end;
> +/* lowest known clear bit in the bitmap */
> +static unsigned int vm_low;
> +
> +void __init vm_init(void)
> +{
> +    unsigned int i, nr;
> +    unsigned long va;
> +
> +    vm_base = (void *)VMAP_VIRT_START;
> +    vm_end = PFN_DOWN(arch_vmap_virt_end() - vm_base);
> +    vm_low = PFN_UP((vm_end + 7) / 8);
> +    nr = PFN_UP((vm_low + 7) / 8);
> +    vm_top = nr * PAGE_SIZE * 8;
> +
> +    for ( i = 0, va = (unsigned long)vm_bitmap; i < nr; ++i, va += PAGE_SIZE
> )
> +    {
> +        struct page_info *pg = alloc_domheap_page(NULL, 0);
> +
> +        map_pages_to_xen(va, page_to_mfn(pg), 1, PAGE_HYPERVISOR);
> +        clear_page((void *)va);
> +    }
> +    bitmap_fill(vm_bitmap, vm_low);
> +
> +    /* Populate page tables for the bitmap if necessary. */
> +    map_pages_to_xen(va, 0, vm_low - nr, MAP_SMALL_PAGES);
> +}
> +
> +void *vm_alloc(unsigned int nr, unsigned int align)
> +{
> +    unsigned int start, bit;
> +
> +    if ( !align )
> +        align = 1;
> +    else if ( align & (align - 1) )
> +        align &= -align;
> +
> +    spin_lock(&vm_lock);
> +    for ( ; ; )
> +    {
> +        struct page_info *pg;
> +
> +        ASSERT(!test_bit(vm_low, vm_bitmap));
> +        for ( start = vm_low; ; )
> +        {
> +            bit = find_next_bit(vm_bitmap, vm_top, start + 1);
> +            if ( bit > vm_top )
> +                bit = vm_top;
> +            /*
> +             * Note that this skips the first bit, making the
> +             * corresponding page a guard one.
> +             */
> +            start = (start + align) & ~(align - 1);
> +            if ( start + nr <= bit )
> +                break;
> +            start = bit < vm_top ?
> +                    find_next_zero_bit(vm_bitmap, vm_top, bit + 1) : bit;
> +            if ( start >= vm_top )
> +                break;
> +        }
> +
> +        if ( start < vm_top )
> +            break;
> +
> +        spin_unlock(&vm_lock);
> +
> +        if ( vm_top >= vm_end )
> +            return NULL;
> +
> +        pg = alloc_domheap_page(NULL, 0);
> +        if ( !pg )
> +            return NULL;
> +
> +        spin_lock(&vm_lock);
> +
> +        if ( start >= vm_top )
> +        {
> +            unsigned long va = (unsigned long)vm_bitmap + vm_top / 8;
> +
> +            if ( !map_pages_to_xen(va, page_to_mfn(pg), 1, PAGE_HYPERVISOR) )
> +            {
> +                clear_page((void *)va);
> +                vm_top += PAGE_SIZE * 8;
> +                if ( vm_top > vm_end )
> +                    vm_top = vm_end;
> +                continue;
> +            }
> +        }
> +
> +        free_domheap_page(pg);
> +
> +        if ( start >= vm_top )
> +        {
> +            spin_unlock(&vm_lock);
> +            return NULL;
> +        }
> +    }
> +
> +    for ( bit = start; bit < start + nr; ++bit )
> +        __set_bit(bit, vm_bitmap);
> +    if ( start <= vm_low + 2 )
> +        vm_low = bit;
> +    spin_unlock(&vm_lock);
> +
> +    return vm_base + start * PAGE_SIZE;
> +}
> +
> +static unsigned int vm_index(const void *va)
> +{
> +    unsigned long addr = (unsigned long)va & ~(PAGE_SIZE - 1);
> +    unsigned int idx;
> +
> +    if ( addr < VMAP_VIRT_START + (vm_end / 8) ||
> +         addr >= VMAP_VIRT_START + vm_top * PAGE_SIZE )
> +        return 0;
> +
> +    idx = PFN_DOWN(va - vm_base);
> +    return !test_bit(idx - 1, vm_bitmap) &&
> +           test_bit(idx, vm_bitmap) ? idx : 0;
> +}
> +
> +static unsigned int vm_size(const void *va)
> +{
> +    unsigned int start = vm_index(va), end;
> +
> +    if ( !start )
> +        return 0;
> +
> +    end = find_next_zero_bit(vm_bitmap, vm_top, start + 1);
> +
> +    return min(end, vm_top) - start;
> +}
> +
> +void vm_free(const void *va)
> +{
> +    unsigned int bit = vm_index(va);
> +
> +    if ( !bit )
> +    {
> +        WARN_ON(va != NULL);
> +        return;
> +    }
> +
> +    spin_lock(&vm_lock);
> +    if ( bit < vm_low )
> +    {
> +        vm_low = bit - 1;
> +        while ( !test_bit(vm_low - 1, vm_bitmap) )
> +            --vm_low;
> +    }
> +    while ( __test_and_clear_bit(bit, vm_bitmap) )
> +        if ( ++bit == vm_top )
> +            break;
> +    spin_unlock(&vm_lock);
> +}
> +
> +void *__vmap(const unsigned long *mfn, unsigned int granularity,
> +             unsigned int nr, unsigned int align, unsigned int flags)
> +{
> +    void *va = vm_alloc(nr * granularity, align);
> +    unsigned long cur = (unsigned long)va;
> +
> +    for ( ; va && nr--; ++mfn, cur += PAGE_SIZE * granularity )
> +    {
> +        if ( map_pages_to_xen(cur, *mfn, granularity, flags) )
> +        {
> +            vunmap(va);
> +            va = NULL;
> +        }
> +    }
> +
> +    return va;
> +}
> +
> +void *vmap(const unsigned long *mfn, unsigned int nr)
> +{
> +    return __vmap(mfn, 1, nr, 1, PAGE_HYPERVISOR);
> +}
> +
> +void vunmap(const void *va)
> +{
> +    unsigned long addr = (unsigned long)va;
> +
> +    destroy_xen_mappings(addr, addr + PAGE_SIZE * vm_size(va));
> +    vm_free(va);
> +}
> +#endif
> --- a/xen/drivers/acpi/apei/erst.c
> +++ b/xen/drivers/acpi/apei/erst.c
> @@ -247,9 +247,6 @@ static int erst_exec_move_data(struct ap
>  {
> int rc;
> u64 offset;
> -#ifdef CONFIG_X86
> - enum fixed_addresses idx;
> -#endif
> void *src, *dst;
>  
> /* ioremap does not work in interrupt context */
> @@ -263,39 +260,11 @@ static int erst_exec_move_data(struct ap
> if (rc)
> return rc;
>  
> -#ifdef CONFIG_X86
> - switch (ctx->var2) {
> - case 0:
> -  return 0;
> - case 1 ... PAGE_SIZE:
> -  break;
> - default:
> -  printk(KERN_WARNING
> -         "MOVE_DATA cannot be used for %#"PRIx64" bytes of data\n",
> -         ctx->var2);
> -  return -EOPNOTSUPP;
> - }
> -
> - src = __acpi_map_table(ctx->src_base + offset, ctx->var2);
> -#else
> src = ioremap(ctx->src_base + offset, ctx->var2);
> -#endif
> if (!src)
> return -ENOMEM;
>  
> -#ifdef CONFIG_X86
> - BUILD_BUG_ON(FIX_ACPI_PAGES < 4);
> - idx = virt_to_fix((unsigned long)src + 2 * PAGE_SIZE);
> - offset += ctx->dst_base;
> - dst = (void *)fix_to_virt(idx) + (offset & ~PAGE_MASK);
> - set_fixmap(idx, offset);
> - if (PFN_DOWN(offset) != PFN_DOWN(offset + ctx->var2 - 1)) {
> -  idx = virt_to_fix((unsigned long)dst + PAGE_SIZE);
> -  set_fixmap(idx, offset + PAGE_SIZE);
> - }
> -#else
> dst = ioremap(ctx->dst_base + offset, ctx->var2);
> -#endif
> if (dst) {
> memmove(dst, src, ctx->var2);
> iounmap(dst);
> --- a/xen/drivers/video/vesa.c
> +++ b/xen/drivers/video/vesa.c
> @@ -10,6 +10,7 @@
>  #include <xen/xmalloc.h>
>  #include <xen/kernel.h>
>  #include <xen/vga.h>
> +#include <asm/io.h>
>  #include <asm/page.h>
>  #include "font.h"
>  
> @@ -101,13 +102,11 @@ void __init vesa_init(void)
>      if ( !line_len )
>          goto fail;
>  
> -    if ( map_pages_to_xen(IOREMAP_VIRT_START,
> -                          vlfb_info.lfb_base >> PAGE_SHIFT,
> -                          vram_remap >> PAGE_SHIFT,
> -                          PAGE_HYPERVISOR_NOCACHE) )
> +    lfb = ioremap(vlfb_info.lfb_base, vram_remap);
> +    if ( !lfb )
>          goto fail;
>  
> -    lfb = memset((void *)IOREMAP_VIRT_START, 0, vram_remap);
> +    memset(lfb, 0, vram_remap);
>  
>      vga_puts = vesa_redraw_puts;
>  
> --- a/xen/include/asm-x86/config.h
> +++ b/xen/include/asm-x86/config.h
> @@ -144,7 +144,7 @@ extern unsigned char boot_edid_info[128]
>   *  0xffff828000000000 - 0xffff82bfffffffff [256GB, 2^38 bytes, PML4:261]
>   *    Machine-to-phys translation table.
>   *  0xffff82c000000000 - 0xffff82c3ffffffff [16GB,  2^34 bytes, PML4:261]
> - *    ioremap()/fixmap area.
> + *    vmap()/ioremap()/fixmap area.
>   *  0xffff82c400000000 - 0xffff82c43fffffff [1GB,   2^30 bytes, PML4:261]
>   *    Compatibility machine-to-phys translation table.
>   *  0xffff82c440000000 - 0xffff82c47fffffff [1GB,   2^30 bytes, PML4:261]
> @@ -205,11 +205,11 @@ extern unsigned char boot_edid_info[128]
>  /* Slot 261: machine-to-phys conversion table (256GB). */
>  #define RDWR_MPT_VIRT_START     (PML4_ADDR(261))
>  #define RDWR_MPT_VIRT_END       (RDWR_MPT_VIRT_START + MPT_VIRT_SIZE)
> -/* Slot 261: ioremap()/fixmap area (16GB). */
> -#define IOREMAP_VIRT_START      RDWR_MPT_VIRT_END
> -#define IOREMAP_VIRT_END        (IOREMAP_VIRT_START + GB(16))
> +/* Slot 261: vmap()/ioremap()/fixmap area (16GB). */
> +#define VMAP_VIRT_START         RDWR_MPT_VIRT_END
> +#define VMAP_VIRT_END           (VMAP_VIRT_START + GB(16))
>  /* Slot 261: compatibility machine-to-phys conversion table (1GB). */
> -#define RDWR_COMPAT_MPT_VIRT_START IOREMAP_VIRT_END
> +#define RDWR_COMPAT_MPT_VIRT_START VMAP_VIRT_END
>  #define RDWR_COMPAT_MPT_VIRT_END (RDWR_COMPAT_MPT_VIRT_START + GB(1))
>  /* Slot 261: high read-only compat machine-to-phys conversion table (1GB). */
>  #define HIRO_COMPAT_MPT_VIRT_START RDWR_COMPAT_MPT_VIRT_END
> --- a/xen/include/asm-x86/fixmap.h
> +++ b/xen/include/asm-x86/fixmap.h
> @@ -15,7 +15,7 @@
>  #include <xen/config.h>
>  #include <asm/page.h>
>  
> -#define FIXADDR_TOP (IOREMAP_VIRT_END - PAGE_SIZE)
> +#define FIXADDR_TOP (VMAP_VIRT_END - PAGE_SIZE)
>  
>  #ifndef __ASSEMBLY__
>  
> --- a/xen/include/asm-x86/io.h
> +++ b/xen/include/asm-x86/io.h
> @@ -1,14 +1,10 @@
>  #ifndef _ASM_IO_H
>  #define _ASM_IO_H
>  
> -#include <xen/config.h>
> +#include <xen/vmap.h>
>  #include <xen/types.h>
>  #include <asm/page.h>
>  
> -/* We don't need real ioremap() on Xen/x86. */
> -#define ioremap(x,l) (__va(x))
> -#define iounmap(p)   ((void)0)
> -
>  #define readb(x) (*(volatile char *)(x))
>  #define readw(x) (*(volatile short *)(x))
>  #define readl(x) (*(volatile int *)(x))
> --- /dev/null
> +++ b/xen/include/xen/vmap.h
> @@ -0,0 +1,24 @@
> +#if !defined(__XEN_VMAP_H__) && defined(VMAP_VIRT_START)
> +#define __XEN_VMAP_H__
> +
> +#include <xen/types.h>
> +
> +void *vm_alloc(unsigned int nr, unsigned int align);
> +void vm_free(const void *);
> +
> +void *__vmap(const unsigned long *mfn, unsigned int granularity,
> +             unsigned int nr, unsigned int align, unsigned int flags);
> +void *vmap(const unsigned long *mfn, unsigned int nr);
> +void vunmap(const void *);
> +
> +void __iomem *ioremap(paddr_t, size_t);
> +
> +static inline void iounmap(void __iomem *va)
> +{
> +    vunmap((void __force *)va);
> +}
> +
> +void vm_init(void);
> +void *arch_vmap_virt_end(void);
> +
> +#endif /* __XEN_VMAP_H__ */
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 10:40:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 10:40:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbUCs-0006cS-4w; Thu, 22 Nov 2012 10:40:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TbUCp-0006cN-QQ
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 10:40:28 +0000
Received: from [85.158.138.51:11744] by server-15.bemta-3.messagelabs.com id
	92/D0-09445-6110EA05; Thu, 22 Nov 2012 10:40:22 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1353580819!11322261!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27437 invoked from network); 22 Nov 2012 10:40:21 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-13.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 10:40:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,299,1352073600"; d="scan'208";a="45386913"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	22 Nov 2012 10:40:19 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.318.1;
	Thu, 22 Nov 2012 05:40:19 -0500
Message-ID: <50AE0111.50908@citrix.com>
Date: Thu, 22 Nov 2012 10:40:17 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <1353518365-7386-1-git-send-email-mats.petersson@citrix.com>
	<50ADF39E02000078000AA8A4@nat28.tlf.novell.com>
In-Reply-To: <50ADF39E02000078000AA8A4@nat28.tlf.novell.com>
X-Originating-IP: [10.80.3.146]
Cc: "konrad@kernel.org" <konrad@kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	David Vrabel <david.vrabel@citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH V3] xen/privcmd: improve performance of
 mapping of guest memory to dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/12 08:42, Jan Beulich wrote:
>>>> On 21.11.12 at 18:19, Mats Petersson <mats.petersson@citrix.com> wrote:
>> @@ -2526,19 +2557,94 @@ int xen_remap_domain_mfn_range(struct vm_area_struct
>> *vma,
>>   		if (err)
>>   			goto out;
>>   
>> -		err = HYPERVISOR_mmu_update(mmu_update, batch, NULL, domid);
>> -		if (err < 0)
>> -			goto out;
>> +		/* We record the error for each page that gives an error, but
>> +		 * continue mapping until the whole set is done */
>> +		do {
>> +			err = HYPERVISOR_mmu_update(&mmu_update[index],
>> +						    batch_left, &done, domid);
>> +			if (err < 0) {
>> +				/* incrememnt done so we skip the error item */
> increment
>
>> +				done++;
>> +				if (err_ptr)
>> +					last_err = err_ptr[index] = err;
>> +				else
>> +					/* exit if error and no err_ptr */
>> +					goto out;
> For readability/reduction of indentation, I'd suggest
>
Yes, that's neater (spent far too long programming in environments where 
goto was frowned upon, so I end up taking different routes that don't 
make best use of it...)
>
>
> 				/* exit if error and no err_ptr */
> 				if (!err_ptr)
> 					goto out;
> 				/* increment done so we skip the error item */
> 				done++;
> 				last_err = err_ptr[index] = err;
>
> However, I wonder how a caller of the function would find out
> at which slot the error happened when not passing an error
> indicator array (after all, the function also doesn't undo what
> already succeeded in that case, i.e. the state is completely
> unknown to such a caller).
I agree, which is why the use of err_ptr is the preferred method - I 
have talked to Ian Campbell, and he agrees that the "old" interface, 
which doesn't use the err_ptr, should be removed eventually. However, we 
first have to remove the callers of that method, and since it's a 
different interface.

However, current callers of the "non-errptr" interface already has this 
problem regardless of these changes - there is no indication of how far 
it got in the existing code either, it just exits with an error code if 
one happens. Nothing has changed here except the code to fill in the 
err_ptr moved from privcmd.c to mmu.c. If the caller detects a fail, it 
will (or should, but I'm not aware of any code that doesn't at present) 
call munmap the region, which undoes the entire mapping.

We can't, at this point undo things, as we can't know how many previous 
blocks of mapping has been done to this VMA. The owner of the memory 
region may well have mappe several "bunches" of MFN's before the error, 
which this function only handles one "bunch" at the time. So it's up to 
the caller to deal with the error appropriately.

In summary, I don't see a reason to change it. And the caller still 
needs to call munmap to destroy the memory region it is mapping the MFNs 
into, so it wouldn't be much help to "undo" things here.

--
Mats

>
> Jan
>
>> +			}
>> +			batch_left -= done;
>> +			index += done;
>> +		} while (batch_left);
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 10:40:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 10:40:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbUCs-0006cS-4w; Thu, 22 Nov 2012 10:40:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TbUCp-0006cN-QQ
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 10:40:28 +0000
Received: from [85.158.138.51:11744] by server-15.bemta-3.messagelabs.com id
	92/D0-09445-6110EA05; Thu, 22 Nov 2012 10:40:22 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1353580819!11322261!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27437 invoked from network); 22 Nov 2012 10:40:21 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-13.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 10:40:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,299,1352073600"; d="scan'208";a="45386913"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	22 Nov 2012 10:40:19 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.318.1;
	Thu, 22 Nov 2012 05:40:19 -0500
Message-ID: <50AE0111.50908@citrix.com>
Date: Thu, 22 Nov 2012 10:40:17 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <1353518365-7386-1-git-send-email-mats.petersson@citrix.com>
	<50ADF39E02000078000AA8A4@nat28.tlf.novell.com>
In-Reply-To: <50ADF39E02000078000AA8A4@nat28.tlf.novell.com>
X-Originating-IP: [10.80.3.146]
Cc: "konrad@kernel.org" <konrad@kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	David Vrabel <david.vrabel@citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH V3] xen/privcmd: improve performance of
 mapping of guest memory to dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/12 08:42, Jan Beulich wrote:
>>>> On 21.11.12 at 18:19, Mats Petersson <mats.petersson@citrix.com> wrote:
>> @@ -2526,19 +2557,94 @@ int xen_remap_domain_mfn_range(struct vm_area_struct
>> *vma,
>>   		if (err)
>>   			goto out;
>>   
>> -		err = HYPERVISOR_mmu_update(mmu_update, batch, NULL, domid);
>> -		if (err < 0)
>> -			goto out;
>> +		/* We record the error for each page that gives an error, but
>> +		 * continue mapping until the whole set is done */
>> +		do {
>> +			err = HYPERVISOR_mmu_update(&mmu_update[index],
>> +						    batch_left, &done, domid);
>> +			if (err < 0) {
>> +				/* incrememnt done so we skip the error item */
> increment
>
>> +				done++;
>> +				if (err_ptr)
>> +					last_err = err_ptr[index] = err;
>> +				else
>> +					/* exit if error and no err_ptr */
>> +					goto out;
> For readability/reduction of indentation, I'd suggest
>
Yes, that's neater (spent far too long programming in environments where 
goto was frowned upon, so I end up taking different routes that don't 
make best use of it...)
>
>
> 				/* exit if error and no err_ptr */
> 				if (!err_ptr)
> 					goto out;
> 				/* increment done so we skip the error item */
> 				done++;
> 				last_err = err_ptr[index] = err;
>
> However, I wonder how a caller of the function would find out
> at which slot the error happened when not passing an error
> indicator array (after all, the function also doesn't undo what
> already succeeded in that case, i.e. the state is completely
> unknown to such a caller).
I agree, which is why the use of err_ptr is the preferred method - I 
have talked to Ian Campbell, and he agrees that the "old" interface, 
which doesn't use the err_ptr, should be removed eventually. However, we 
first have to remove the callers of that method, and since it's a 
different interface.

However, current callers of the "non-errptr" interface already has this 
problem regardless of these changes - there is no indication of how far 
it got in the existing code either, it just exits with an error code if 
one happens. Nothing has changed here except the code to fill in the 
err_ptr moved from privcmd.c to mmu.c. If the caller detects a fail, it 
will (or should, but I'm not aware of any code that doesn't at present) 
call munmap the region, which undoes the entire mapping.

We can't, at this point undo things, as we can't know how many previous 
blocks of mapping has been done to this VMA. The owner of the memory 
region may well have mappe several "bunches" of MFN's before the error, 
which this function only handles one "bunch" at the time. So it's up to 
the caller to deal with the error appropriately.

In summary, I don't see a reason to change it. And the caller still 
needs to call munmap to destroy the memory region it is mapping the MFNs 
into, so it wouldn't be much help to "undo" things here.

--
Mats

>
> Jan
>
>> +			}
>> +			batch_left -= done;
>> +			index += done;
>> +		} while (batch_left);
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 10:49:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 10:49:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbUL3-0006rh-6z; Thu, 22 Nov 2012 10:48:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbUL1-0006rc-Kd
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 10:48:55 +0000
Received: from [85.158.138.51:27126] by server-8.bemta-3.messagelabs.com id
	F5/68-07786-6130EA05; Thu, 22 Nov 2012 10:48:54 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1353581333!24687573!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9390 invoked from network); 22 Nov 2012 10:48:53 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 10:48:53 -0000
X-IronPort-AV: E=Sophos;i="4.83,299,1352073600"; d="scan'208";a="15943820"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 10:48:53 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 10:48:53 +0000
Message-ID: <1353581331.13542.148.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Joseph Glanville <joseph.glanville@orionvm.com.au>
Date: Thu, 22 Nov 2012 10:48:51 +0000
In-Reply-To: <CAOzFzEjXpcwi1JReUAjEp5kRa2yKeoVwJz_6tGdMqBPjLFrrOw@mail.gmail.com>
References: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
	<CAOzFzEjXpcwi1JReUAjEp5kRa2yKeoVwJz_6tGdMqBPjLFrrOw@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] Make all public hosting providers
 eligible for the pre-disclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 21:29 +0000, Joseph Glanville wrote:
> a) How they consume Xen, be it via a vendor, distro packages of some
> kind or whether they build and package their own. Those doing their
> own packaging I feel should be given somewhat of a priority because
> they aren't able to rely on their vendor and instead must dedicate
> resources to responding.

I think we've previously discussed whether direct vs. indirect consumers
should be on the list, but I don't recall what the consensus/conclusion
(if any) was. Indirect consumers are not included today.

Since we allow people in the list to tell their consumers about the
existence of an issue (i.e. be ready on this day to deploy) I not sure
why indirect consumers would need to be or expect to be on the list (for
example we don't consider allowing arbitrary distro users).

> b) Their upgrade and security response procedures. It doesn't make
> sense for someone to be on the pre-disclosure list if they lack the
> ability (or more importantly the requirement) to aggressively test and
> push out security fixes.

At the very least they may be able to take advantage of the mitigations
which are often presented or just keep an eye out for suspicious goings
on in their systems.

I'm also not sure why it matters how aggressively they can test and
push. Two weeks is two weeks no matter how long it takes them to
actually get stuff out the door, so it is advantageous in terms of
ensuring that security fixes propagate as quickly as possible to have
such people on the list.

If they are incompetent or slow or their service is poor then that is
something for the market to decide on, not us via the security
pre-disclosure list.

> c) Resources available to assist in testing security patches. This
> might be a non-issue but I personally think it's somewhat important
> that groups on the pre-disclosure list are able to assist in testing
> or reviewing patches, this improves the quality of said patches and
> might allow a greater degree of vulnerability exploration. This is
> however, largely my own opinion on what is considered fair
> contribution in return for the privilege.

It is nice if people on the list can do this (more eyes are always
welcome) but it absolutely is not and should not be a requirement that
they be able to do so in order to receive notification of security
vulnerabilities.

The purpose of the list is to inform users of Xen security issues. It is
not intended only to benefit those who happen to be security savvy, or
developers or even particularly competent which is what your b) and c)
seem to be trying to achieve.

The consensus which I believe we saw from the community was that the
list should be more not less inclusive, while you appear to be
advocating that it should be more exclusive.

I also think we need to be careful about considering membership of this
list to be a privilege for which one must "pay" (whether in "services"
or quid-pro-quo or whatever). It is a service which we should be
providing our users because it is the right thing to do for the Xen.org
community.

> I think there should also be appropriate "guideline" points/criteria
> that should be covered by other categories of organisations seeking to
> join the pre-disclosure group.

That sounds like a good idea.

> Sorry if ideas along the lines of these have already been raised.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 10:49:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 10:49:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbUL3-0006rh-6z; Thu, 22 Nov 2012 10:48:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbUL1-0006rc-Kd
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 10:48:55 +0000
Received: from [85.158.138.51:27126] by server-8.bemta-3.messagelabs.com id
	F5/68-07786-6130EA05; Thu, 22 Nov 2012 10:48:54 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1353581333!24687573!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9390 invoked from network); 22 Nov 2012 10:48:53 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 10:48:53 -0000
X-IronPort-AV: E=Sophos;i="4.83,299,1352073600"; d="scan'208";a="15943820"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 10:48:53 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 10:48:53 +0000
Message-ID: <1353581331.13542.148.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Joseph Glanville <joseph.glanville@orionvm.com.au>
Date: Thu, 22 Nov 2012 10:48:51 +0000
In-Reply-To: <CAOzFzEjXpcwi1JReUAjEp5kRa2yKeoVwJz_6tGdMqBPjLFrrOw@mail.gmail.com>
References: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
	<CAOzFzEjXpcwi1JReUAjEp5kRa2yKeoVwJz_6tGdMqBPjLFrrOw@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] Make all public hosting providers
 eligible for the pre-disclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-19 at 21:29 +0000, Joseph Glanville wrote:
> a) How they consume Xen, be it via a vendor, distro packages of some
> kind or whether they build and package their own. Those doing their
> own packaging I feel should be given somewhat of a priority because
> they aren't able to rely on their vendor and instead must dedicate
> resources to responding.

I think we've previously discussed whether direct vs. indirect consumers
should be on the list, but I don't recall what the consensus/conclusion
(if any) was. Indirect consumers are not included today.

Since we allow people in the list to tell their consumers about the
existence of an issue (i.e. be ready on this day to deploy) I not sure
why indirect consumers would need to be or expect to be on the list (for
example we don't consider allowing arbitrary distro users).

> b) Their upgrade and security response procedures. It doesn't make
> sense for someone to be on the pre-disclosure list if they lack the
> ability (or more importantly the requirement) to aggressively test and
> push out security fixes.

At the very least they may be able to take advantage of the mitigations
which are often presented or just keep an eye out for suspicious goings
on in their systems.

I'm also not sure why it matters how aggressively they can test and
push. Two weeks is two weeks no matter how long it takes them to
actually get stuff out the door, so it is advantageous in terms of
ensuring that security fixes propagate as quickly as possible to have
such people on the list.

If they are incompetent or slow or their service is poor then that is
something for the market to decide on, not us via the security
pre-disclosure list.

> c) Resources available to assist in testing security patches. This
> might be a non-issue but I personally think it's somewhat important
> that groups on the pre-disclosure list are able to assist in testing
> or reviewing patches, this improves the quality of said patches and
> might allow a greater degree of vulnerability exploration. This is
> however, largely my own opinion on what is considered fair
> contribution in return for the privilege.

It is nice if people on the list can do this (more eyes are always
welcome) but it absolutely is not and should not be a requirement that
they be able to do so in order to receive notification of security
vulnerabilities.

The purpose of the list is to inform users of Xen security issues. It is
not intended only to benefit those who happen to be security savvy, or
developers or even particularly competent which is what your b) and c)
seem to be trying to achieve.

The consensus which I believe we saw from the community was that the
list should be more not less inclusive, while you appear to be
advocating that it should be more exclusive.

I also think we need to be careful about considering membership of this
list to be a privilege for which one must "pay" (whether in "services"
or quid-pro-quo or whatever). It is a service which we should be
providing our users because it is the right thing to do for the Xen.org
community.

> I think there should also be appropriate "guideline" points/criteria
> that should be covered by other categories of organisations seeking to
> join the pre-disclosure group.

That sounds like a good idea.

> Sorry if ideas along the lines of these have already been raised.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 10:52:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 10:52:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbUOK-00073g-R1; Thu, 22 Nov 2012 10:52:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbUOJ-00073b-Hi
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 10:52:19 +0000
Received: from [85.158.137.99:59373] by server-16.bemta-3.messagelabs.com id
	46/26-07461-2E30EA05; Thu, 22 Nov 2012 10:52:18 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1353581529!18467519!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4238 invoked from network); 22 Nov 2012 10:52:11 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-10.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 10:52:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,299,1352073600"; d="scan'208";a="45387784"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 10:52:09 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 05:52:09 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbUO8-0002nT-PS;
	Thu, 22 Nov 2012 10:52:08 +0000
Message-ID: <50AE03D8.80703@citrix.com>
Date: Thu, 22 Nov 2012 10:52:08 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel@lists.xen.org, Jan Beulich <jbeulich@suse.com>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50ADF75F02000078000AA8BB@nat28.tlf.novell.com>
In-Reply-To: <50ADF75F02000078000AA8BB@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/12 08:58, Jan Beulich wrote:
>>>> On 13.11.12 at 21:08, Malcolm Crossley <malcolm.crossley@citrix.com> wrote:
>> The self_nmi() code cause's an NMI to be triggered by sending an APIC message
>> to the local processor. Unfortunately there is a delay in the delivery of 
>> the
>> APIC message and we may already have re-entered the HVM guest by the time the
>> NMI is taken. This results in the VMEXIT code calling the self_nmi() 
>> function
>> again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop 
>> before
>> the HVM guest resumes normal operation.
>>
>> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
>>
>> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
>> completes.
>>
>> So we believe it is safe to directly invoke the INT call as NMI's should
>> already be blocked.
>>
>> The INT 2 call will perform an IRET which will unblock later calls to the 
>> NMI
>> handler, according to Intel SDM Volume 3 Chapter 6.7.1. We must ensure that 
>> the
>> IRET from the INT 2 IRET is the first IRET issued to prevent losing an NMI.
>> Moving the INT 2 call to before the interrupts are enabled should ensure we
>> don't lose the NMI.
>>
>> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
>> Acked-by: Tim Deegan <tim@xen.org>
> As (I think) we agreed to not use "int $2", and as I don't recall
> having seen a v3 of this patch - is that something that can be
> expected any time soon? Ideally, I would want to incorporate
> the changes here (and hopefully also the PV issue described
> during the discussion) in the pending 4.2.1 (and, if applicable,
> 4.1.4) release(s).
>
> Jan

Malcolm is out of the office this week.  I will see about respinning a
v3 later today.

~Andrew

>
>> diff -r 62885b3c34c8 -r 7d6fd0219dd7 xen/arch/x86/hvm/vmx/vmx.c
>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>>          vector = intr_info & INTR_INFO_VECTOR_MASK;
>>          if ( vector == TRAP_machine_check )
>>              do_machine_check(regs);
>> +        else if ( vector == TRAP_nmi &&
>> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
>> +                  (X86_EVENTTYPE_NMI << 8) ) )
>> +            /* Must be called before interrupts are enabled to ensure
>> +             * the NMI handler code is run before the first IRET. The
>> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
>> +             */
>> +            asm volatile("int $2"); /* Real NMI, vector 2: normal 
>> processing */
>>          break;
>>      case EXIT_REASON_MCE_DURING_VMENTRY:
>>          do_machine_check(regs);
>> @@ -2442,7 +2450,6 @@ void vmx_vmexit_handler(struct cpu_user_
>>                   (X86_EVENTTYPE_NMI << 8) )
>>                  goto exit_and_crash;
>>              HVMTRACE_0D(NMI);
>> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>>              break;
>>          case TRAP_machine_check:
>>              HVMTRACE_0D(MCE);
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org 
>> http://lists.xen.org/xen-devel 
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 10:52:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 10:52:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbUOK-00073g-R1; Thu, 22 Nov 2012 10:52:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbUOJ-00073b-Hi
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 10:52:19 +0000
Received: from [85.158.137.99:59373] by server-16.bemta-3.messagelabs.com id
	46/26-07461-2E30EA05; Thu, 22 Nov 2012 10:52:18 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1353581529!18467519!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4238 invoked from network); 22 Nov 2012 10:52:11 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-10.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 10:52:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,299,1352073600"; d="scan'208";a="45387784"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 10:52:09 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 05:52:09 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbUO8-0002nT-PS;
	Thu, 22 Nov 2012 10:52:08 +0000
Message-ID: <50AE03D8.80703@citrix.com>
Date: Thu, 22 Nov 2012 10:52:08 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel@lists.xen.org, Jan Beulich <jbeulich@suse.com>
References: <7d6fd0219dd791e5788a.1352837304@malcolmc-Dell>
	<50ADF75F02000078000AA8BB@nat28.tlf.novell.com>
In-Reply-To: <50ADF75F02000078000AA8BB@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Subject: Re: [Xen-devel] [PATCH V2] xen: vmx: Use an INT 2 call to process
 real NMI's instead of self_nmi() in VMEXIT handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/12 08:58, Jan Beulich wrote:
>>>> On 13.11.12 at 21:08, Malcolm Crossley <malcolm.crossley@citrix.com> wrote:
>> The self_nmi() code cause's an NMI to be triggered by sending an APIC message
>> to the local processor. Unfortunately there is a delay in the delivery of 
>> the
>> APIC message and we may already have re-entered the HVM guest by the time the
>> NMI is taken. This results in the VMEXIT code calling the self_nmi() 
>> function
>> again. We have seen hundreds of iterations of this VMEXIT/VMENTER loop 
>> before
>> the HVM guest resumes normal operation.
>>
>> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
>>
>> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
>> completes.
>>
>> So we believe it is safe to directly invoke the INT call as NMI's should
>> already be blocked.
>>
>> The INT 2 call will perform an IRET which will unblock later calls to the 
>> NMI
>> handler, according to Intel SDM Volume 3 Chapter 6.7.1. We must ensure that 
>> the
>> IRET from the INT 2 IRET is the first IRET issued to prevent losing an NMI.
>> Moving the INT 2 call to before the interrupts are enabled should ensure we
>> don't lose the NMI.
>>
>> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
>> Acked-by: Tim Deegan <tim@xen.org>
> As (I think) we agreed to not use "int $2", and as I don't recall
> having seen a v3 of this patch - is that something that can be
> expected any time soon? Ideally, I would want to incorporate
> the changes here (and hopefully also the PV issue described
> during the discussion) in the pending 4.2.1 (and, if applicable,
> 4.1.4) release(s).
>
> Jan

Malcolm is out of the office this week.  I will see about respinning a
v3 later today.

~Andrew

>
>> diff -r 62885b3c34c8 -r 7d6fd0219dd7 xen/arch/x86/hvm/vmx/vmx.c
>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>>          vector = intr_info & INTR_INFO_VECTOR_MASK;
>>          if ( vector == TRAP_machine_check )
>>              do_machine_check(regs);
>> +        else if ( vector == TRAP_nmi &&
>> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
>> +                  (X86_EVENTTYPE_NMI << 8) ) )
>> +            /* Must be called before interrupts are enabled to ensure
>> +             * the NMI handler code is run before the first IRET. The
>> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
>> +             */
>> +            asm volatile("int $2"); /* Real NMI, vector 2: normal 
>> processing */
>>          break;
>>      case EXIT_REASON_MCE_DURING_VMENTRY:
>>          do_machine_check(regs);
>> @@ -2442,7 +2450,6 @@ void vmx_vmexit_handler(struct cpu_user_
>>                   (X86_EVENTTYPE_NMI << 8) )
>>                  goto exit_and_crash;
>>              HVMTRACE_0D(NMI);
>> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>>              break;
>>          case TRAP_machine_check:
>>              HVMTRACE_0D(MCE);
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org 
>> http://lists.xen.org/xen-devel 
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 11:07:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 11:07:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbUd5-0007NW-At; Thu, 22 Nov 2012 11:07:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbUd3-0007NR-Jc
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 11:07:33 +0000
Received: from [85.158.139.83:13815] by server-8.bemta-5.messagelabs.com id
	C2/2A-06050-4770EA05; Thu, 22 Nov 2012 11:07:32 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1353582451!31413898!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19007 invoked from network); 22 Nov 2012 11:07:32 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-182.messagelabs.com with SMTP;
	22 Nov 2012 11:07:32 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 11:07:30 +0000
Message-Id: <50AE15BB02000078000AA903@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 11:08:27 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mats Petersson" <mats.petersson@citrix.com>
References: <1353518365-7386-1-git-send-email-mats.petersson@citrix.com>
	<50ADF39E02000078000AA8A4@nat28.tlf.novell.com>
	<50AE0111.50908@citrix.com>
In-Reply-To: <50AE0111.50908@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "konrad@kernel.org" <konrad@kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	David Vrabel <david.vrabel@citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH V3] xen/privcmd: improve performance of
 mapping of guest memory to dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 11:40, Mats Petersson <mats.petersson@citrix.com> wrote:
> On 22/11/12 08:42, Jan Beulich wrote:
>> However, I wonder how a caller of the function would find out
>> at which slot the error happened when not passing an error
>> indicator array (after all, the function also doesn't undo what
>> already succeeded in that case, i.e. the state is completely
>> unknown to such a caller).
> I agree, which is why the use of err_ptr is the preferred method - I 
> have talked to Ian Campbell, and he agrees that the "old" interface, 
> which doesn't use the err_ptr, should be removed eventually. However, we 
> first have to remove the callers of that method, and since it's a 
> different interface.
> 
> However, current callers of the "non-errptr" interface already has this 
> problem regardless of these changes - there is no indication of how far 
> it got in the existing code either, it just exits with an error code if 
> one happens. Nothing has changed here except the code to fill in the 
> err_ptr moved from privcmd.c to mmu.c. If the caller detects a fail, it 
> will (or should, but I'm not aware of any code that doesn't at present) 
> call munmap the region, which undoes the entire mapping.
> 
> We can't, at this point undo things, as we can't know how many previous 
> blocks of mapping has been done to this VMA. The owner of the memory 
> region may well have mappe several "bunches" of MFN's before the error, 
> which this function only handles one "bunch" at the time. So it's up to 
> the caller to deal with the error appropriately.
> 
> In summary, I don't see a reason to change it. And the caller still 
> needs to call munmap to destroy the memory region it is mapping the MFNs 
> into, so it wouldn't be much help to "undo" things here.

Okay, if things were that way already before, then I agree this is
not a topic for this patch.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 11:07:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 11:07:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbUd5-0007NW-At; Thu, 22 Nov 2012 11:07:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbUd3-0007NR-Jc
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 11:07:33 +0000
Received: from [85.158.139.83:13815] by server-8.bemta-5.messagelabs.com id
	C2/2A-06050-4770EA05; Thu, 22 Nov 2012 11:07:32 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1353582451!31413898!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19007 invoked from network); 22 Nov 2012 11:07:32 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-182.messagelabs.com with SMTP;
	22 Nov 2012 11:07:32 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 11:07:30 +0000
Message-Id: <50AE15BB02000078000AA903@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 11:08:27 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mats Petersson" <mats.petersson@citrix.com>
References: <1353518365-7386-1-git-send-email-mats.petersson@citrix.com>
	<50ADF39E02000078000AA8A4@nat28.tlf.novell.com>
	<50AE0111.50908@citrix.com>
In-Reply-To: <50AE0111.50908@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "konrad@kernel.org" <konrad@kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	David Vrabel <david.vrabel@citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH V3] xen/privcmd: improve performance of
 mapping of guest memory to dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 11:40, Mats Petersson <mats.petersson@citrix.com> wrote:
> On 22/11/12 08:42, Jan Beulich wrote:
>> However, I wonder how a caller of the function would find out
>> at which slot the error happened when not passing an error
>> indicator array (after all, the function also doesn't undo what
>> already succeeded in that case, i.e. the state is completely
>> unknown to such a caller).
> I agree, which is why the use of err_ptr is the preferred method - I 
> have talked to Ian Campbell, and he agrees that the "old" interface, 
> which doesn't use the err_ptr, should be removed eventually. However, we 
> first have to remove the callers of that method, and since it's a 
> different interface.
> 
> However, current callers of the "non-errptr" interface already has this 
> problem regardless of these changes - there is no indication of how far 
> it got in the existing code either, it just exits with an error code if 
> one happens. Nothing has changed here except the code to fill in the 
> err_ptr moved from privcmd.c to mmu.c. If the caller detects a fail, it 
> will (or should, but I'm not aware of any code that doesn't at present) 
> call munmap the region, which undoes the entire mapping.
> 
> We can't, at this point undo things, as we can't know how many previous 
> blocks of mapping has been done to this VMA. The owner of the memory 
> region may well have mappe several "bunches" of MFN's before the error, 
> which this function only handles one "bunch" at the time. So it's up to 
> the caller to deal with the error appropriately.
> 
> In summary, I don't see a reason to change it. And the caller still 
> needs to call munmap to destroy the memory region it is mapping the MFNs 
> into, so it wouldn't be much help to "undo" things here.

Okay, if things were that way already before, then I agree this is
not a topic for this patch.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 11:20:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 11:20:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbUph-0007cu-N4; Thu, 22 Nov 2012 11:20:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbUpg-0007cp-9J
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 11:20:36 +0000
Received: from [85.158.137.99:45898] by server-15.bemta-3.messagelabs.com id
	77/FA-09445-38A0EA05; Thu, 22 Nov 2012 11:20:35 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1353583234!15357362!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24475 invoked from network); 22 Nov 2012 11:20:34 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-217.messagelabs.com with SMTP;
	22 Nov 2012 11:20:34 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 11:20:34 +0000
Message-Id: <50AE18CA02000078000AA90F@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 11:21:30 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"Keir Fraser" <keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: [Xen-devel] freezing of kernel threads
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Keir,

in linux-2.6.18-xen.hg c/s 74:cb50d25a9468 you made blktap
match blkback in calling try_to_freeze() from the main thread loop.
Threads in other drivers didn't get changed, though. Is there a
particular reason why only block, and only backend, threads are in
need of this (the only other one using it is xenfb_thread())?

Konrad, as of 2.6.23 kernel threads are non-freezable by default,
i.e. xen-blkback calling try_to_freeze() is completely pointless
without a prior call to set_freezable(). Also, in case the latter is to
be added, switching to wait_event_freezable() instead of the
direct use of try_to_freeze() might be the right way to go.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 11:20:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 11:20:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbUph-0007cu-N4; Thu, 22 Nov 2012 11:20:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbUpg-0007cp-9J
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 11:20:36 +0000
Received: from [85.158.137.99:45898] by server-15.bemta-3.messagelabs.com id
	77/FA-09445-38A0EA05; Thu, 22 Nov 2012 11:20:35 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1353583234!15357362!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24475 invoked from network); 22 Nov 2012 11:20:34 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-217.messagelabs.com with SMTP;
	22 Nov 2012 11:20:34 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 11:20:34 +0000
Message-Id: <50AE18CA02000078000AA90F@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 11:21:30 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"Keir Fraser" <keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: [Xen-devel] freezing of kernel threads
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Keir,

in linux-2.6.18-xen.hg c/s 74:cb50d25a9468 you made blktap
match blkback in calling try_to_freeze() from the main thread loop.
Threads in other drivers didn't get changed, though. Is there a
particular reason why only block, and only backend, threads are in
need of this (the only other one using it is xenfb_thread())?

Konrad, as of 2.6.23 kernel threads are non-freezable by default,
i.e. xen-blkback calling try_to_freeze() is completely pointless
without a prior call to set_freezable(). Also, in case the latter is to
be added, switching to wait_event_freezable() instead of the
direct use of try_to_freeze() might be the right way to go.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 11:24:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 11:24:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbUsk-0007p2-Ar; Thu, 22 Nov 2012 11:23:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TbUsj-0007ox-7T
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 11:23:45 +0000
Received: from [85.158.143.99:26207] by server-2.bemta-4.messagelabs.com id
	55/6A-28922-04B0EA05; Thu, 22 Nov 2012 11:23:44 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1353583422!28279324!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjMyOTkx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1878 invoked from network); 22 Nov 2012 11:23:43 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-5.tower-216.messagelabs.com with SMTP;
	22 Nov 2012 11:23:43 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga101.ch.intel.com with ESMTP; 22 Nov 2012 03:23:42 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,299,1352102400"; d="scan'208";a="221053677"
Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37])
	by azsmga001.ch.intel.com with ESMTP; 22 Nov 2012 03:23:41 -0800
Received: from fmsmsx151.amr.corp.intel.com (10.19.17.220) by
	FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 22 Nov 2012 03:23:41 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX151.amr.corp.intel.com (10.19.17.220) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 22 Nov 2012 03:23:39 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Thu, 22 Nov 2012 19:23:36 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Jan Beulich <JBeulich@suse.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNx+1ZWSR52N+j5UqhK6CjagaIUZf1tz4Q
Date: Thu, 22 Nov 2012 11:23:35 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335395065@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
	<50ACBC50.4040204@eu.citrix.com>
	<1353499905.13542.139.camel@zakaz.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC82923353944A2@SHSMSX101.ccr.corp.intel.com>
	<50ACE72802000078000AA635@nat28.tlf.novell.com>
In-Reply-To: <50ACE72802000078000AA635@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Jan Beulich wrote:
>>>> On 21.11.12 at 14:26, "Liu, Jinsong" <jinsong.liu@intel.com>
>>>> wrote: Ian Campbell wrote: On Wed, 2012-11-21 at 11:34 +0000,
>>>> George Dunlap wrote: On 20/11/12 18:42, Ian Jackson wrote: 
>>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>>>> broken page with regard to migration"):
>>>>>> Ian Jackson wrote:
>>>>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE:
>>>>>>> handle broken page with regard to migration"):
>>>>>>>> No, at last lter, there are 4 points:
>>>>>>>> 1. start last iter
>>>>>>>> 2. get and transfer pfn_type to target
>>>>>>>> 3. copy page to target
>>>>>>>> 4. end last iter
>>>>> ...
>>>>>> It indeed checks mce after point 3 for each page, but what's the
>>>>>> advantage of keeping a separate list?
>>>>> It avoids yet another loop over all the pages.  Unless I have
>>>>> misunderstood.  Which I may have, because: if it checks for mce
>>>>> after point 3 then surely that is sufficient ?  We don't need to
>>>>> worry about mces after that check.
>>>> 
>>>> It's sufficient, but wouldn't each check require a separate
>>>> hypercall? That would surely be slower than just a single hypercall
>>>> and a loop (which is what Jinsong's patch does).
>>>> 
>>>> We don't actually need a list -- I think we just need to know,
>>>> "Have any pages broken between reading the p2m table (
>>>> xc_get_pfn_type_batch() ); if so, we do another full iteration.
>>> 
>>> If a page fails between 2. and 3. above then what happens at point
>>> 3? I presume we can't map and send the page (since it is broken),
>>> do we get some sort of failure to map?
>>> 
>>> What happens if the failure occurs during stage 3, i.e. while the
>>> page is mapped and we are reading from it?
>>> 
>>> Ian.
>> 
>> If read a broken page, it generates more serious error (say, SRAR
>> error). 
>> I don't think guest has good opportunity to survive under this case
>> --> most probably it kill itself and of course we don't need care
>> migration now. However, if guest can luckly survive (say complete
>> broken page copying to target), it's OK to continue --> its broken
>> pfn_type will transfer to target next iter so guest will kill itself
>> if access then. 
> 
> I think you misread the question - it said "we", as in "the tools/
> kernel/hypervisor" (at least that's how I'm reading it). The MCE
> would surface in host context in this case, and whether that's
> fatal to the host depends on the precise properties of the event.
> 
> Jan

Yes, depending on error types, both hypervisor and guest may crash.
As for tools I think it's OK if only hypervisor OK.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 11:24:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 11:24:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbUsk-0007p2-Ar; Thu, 22 Nov 2012 11:23:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TbUsj-0007ox-7T
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 11:23:45 +0000
Received: from [85.158.143.99:26207] by server-2.bemta-4.messagelabs.com id
	55/6A-28922-04B0EA05; Thu, 22 Nov 2012 11:23:44 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1353583422!28279324!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjMyOTkx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1878 invoked from network); 22 Nov 2012 11:23:43 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-5.tower-216.messagelabs.com with SMTP;
	22 Nov 2012 11:23:43 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga101.ch.intel.com with ESMTP; 22 Nov 2012 03:23:42 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,299,1352102400"; d="scan'208";a="221053677"
Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37])
	by azsmga001.ch.intel.com with ESMTP; 22 Nov 2012 03:23:41 -0800
Received: from fmsmsx151.amr.corp.intel.com (10.19.17.220) by
	FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 22 Nov 2012 03:23:41 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX151.amr.corp.intel.com (10.19.17.220) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 22 Nov 2012 03:23:39 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Thu, 22 Nov 2012 19:23:36 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Jan Beulich <JBeulich@suse.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNx+1ZWSR52N+j5UqhK6CjagaIUZf1tz4Q
Date: Thu, 22 Nov 2012 11:23:35 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335395065@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
	<50ACBC50.4040204@eu.citrix.com>
	<1353499905.13542.139.camel@zakaz.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC82923353944A2@SHSMSX101.ccr.corp.intel.com>
	<50ACE72802000078000AA635@nat28.tlf.novell.com>
In-Reply-To: <50ACE72802000078000AA635@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Jan Beulich wrote:
>>>> On 21.11.12 at 14:26, "Liu, Jinsong" <jinsong.liu@intel.com>
>>>> wrote: Ian Campbell wrote: On Wed, 2012-11-21 at 11:34 +0000,
>>>> George Dunlap wrote: On 20/11/12 18:42, Ian Jackson wrote: 
>>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>>>> broken page with regard to migration"):
>>>>>> Ian Jackson wrote:
>>>>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE:
>>>>>>> handle broken page with regard to migration"):
>>>>>>>> No, at last lter, there are 4 points:
>>>>>>>> 1. start last iter
>>>>>>>> 2. get and transfer pfn_type to target
>>>>>>>> 3. copy page to target
>>>>>>>> 4. end last iter
>>>>> ...
>>>>>> It indeed checks mce after point 3 for each page, but what's the
>>>>>> advantage of keeping a separate list?
>>>>> It avoids yet another loop over all the pages.  Unless I have
>>>>> misunderstood.  Which I may have, because: if it checks for mce
>>>>> after point 3 then surely that is sufficient ?  We don't need to
>>>>> worry about mces after that check.
>>>> 
>>>> It's sufficient, but wouldn't each check require a separate
>>>> hypercall? That would surely be slower than just a single hypercall
>>>> and a loop (which is what Jinsong's patch does).
>>>> 
>>>> We don't actually need a list -- I think we just need to know,
>>>> "Have any pages broken between reading the p2m table (
>>>> xc_get_pfn_type_batch() ); if so, we do another full iteration.
>>> 
>>> If a page fails between 2. and 3. above then what happens at point
>>> 3? I presume we can't map and send the page (since it is broken),
>>> do we get some sort of failure to map?
>>> 
>>> What happens if the failure occurs during stage 3, i.e. while the
>>> page is mapped and we are reading from it?
>>> 
>>> Ian.
>> 
>> If read a broken page, it generates more serious error (say, SRAR
>> error). 
>> I don't think guest has good opportunity to survive under this case
>> --> most probably it kill itself and of course we don't need care
>> migration now. However, if guest can luckly survive (say complete
>> broken page copying to target), it's OK to continue --> its broken
>> pfn_type will transfer to target next iter so guest will kill itself
>> if access then. 
> 
> I think you misread the question - it said "we", as in "the tools/
> kernel/hypervisor" (at least that's how I'm reading it). The MCE
> would surface in host context in this case, and whether that's
> fatal to the host depends on the precise properties of the event.
> 
> Jan

Yes, depending on error types, both hypervisor and guest may crash.
As for tools I think it's OK if only hypervisor OK.

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 11:45:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 11:45:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbVDM-0008Fv-SU; Thu, 22 Nov 2012 11:45:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TbVDM-0008Fq-4W
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 11:45:04 +0000
Received: from [85.158.139.83:44697] by server-13.bemta-5.messagelabs.com id
	F5/54-27809-F301EA05; Thu, 22 Nov 2012 11:45:03 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1353584701!26826998!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjMyOTkx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29004 invoked from network); 22 Nov 2012 11:45:02 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-6.tower-182.messagelabs.com with SMTP;
	22 Nov 2012 11:45:02 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga101.ch.intel.com with ESMTP; 22 Nov 2012 03:45:00 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,299,1352102400"; d="scan'208";a="171368842"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by AZSMGA002.ch.intel.com with ESMTP; 22 Nov 2012 03:45:00 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 22 Nov 2012 03:45:00 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Thu, 22 Nov 2012 19:44:58 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNx/B9WSR52N+j5UqhK6CjagaIUZf1t9FA
Date: Thu, 22 Nov 2012 11:44:57 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353950FD@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
	<50ACBC50.4040204@eu.citrix.com>
	<1353499905.13542.139.camel@zakaz.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC82923353944A2@SHSMSX101.ccr.corp.intel.com>
	<50ACDE5D.302@eu.citrix.com>
In-Reply-To: <50ACDE5D.302@eu.citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> On 21/11/12 13:26, Liu, Jinsong wrote:
>> Ian Campbell wrote:
>>> On Wed, 2012-11-21 at 11:34 +0000, George Dunlap wrote:
>>>> On 20/11/12 18:42, Ian Jackson wrote:
>>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>>>> broken page with regard to migration"):
>>>>>> Ian Jackson wrote:
>>>>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE:
>>>>>>> handle broken page with regard to migration"):
>>>>>>>> No, at last lter, there are 4 points:
>>>>>>>> 1. start last iter
>>>>>>>> 2. get and transfer pfn_type to target
>>>>>>>> 3. copy page to target
>>>>>>>> 4. end last iter
>>>>> ...
>>>>>> It indeed checks mce after point 3 for each page, but what's the
>>>>>> advantage of keeping a separate list?
>>>>> It avoids yet another loop over all the pages.  Unless I have
>>>>> misunderstood.  Which I may have, because: if it checks for mce
>>>>> after point 3 then surely that is sufficient ?  We don't need to
>>>>> worry about mces after that check.
>>>> It's sufficient, but wouldn't each check require a separate
>>>> hypercall? That would surely be slower than just a single hypercall
>>>> and a loop (which is what Jinsong's patch does).
>>>> 
>>>> We don't actually need a list -- I think we just need to know,
>>>> "Have any pages broken between reading the p2m table (
>>>> xc_get_pfn_type_batch() ); if so, we do another full iteration.
>>> If a page fails between 2. and 3. above then what happens at point
>>> 3? I presume we can't map and send the page (since it is broken),
>>> do we get some sort of failure to map?
>>> 
>>> What happens if the failure occurs during stage 3, i.e. while the
>>> page is mapped and we are reading from it?
>>> 
>>> Ian.
>> If read a broken page, it generates more serious error (say, SRAR
>> error). 
>> I don't think guest has good opportunity to survive under this case
>> --> most probably it kill itself and of course we don't need care
>> migration now.  
>> However, if guest can luckly survive (say complete broken page
>> copying to target), it's OK to continue --> its broken pfn_type will
>> transfer to target next iter so guest will kill itself if access
>> then.   
> 
> But in this case, I'm asking what happens if the migration code reads
> the page.  If reading the page in the migration code causes dom0 to
> crash, then the whole "last iteration" stuff is fairly pointless. :-)
> 
>   -George

If migration code read the page it will trigger more serious error and may kill hypervisor or guest.

But unfortunately we cannot prevent it since we cannot predict whether a vmce will occur *during* migration. What we can do is do our best to handle it:
1. for vmce occur before migration, we can safely handle it;
2. for vmce occur during migration, we can only do our best:
  2.1 if fortunately vmce occur at some area (say, before point2), we can successfully prevent page reading;
  2.1 if vmce occur after point2, it will read the page, under such case
    * if guest/hypervisor can survive, it's OK to transfer broken pfn_type to target so that no further harm to target;
    * if guest/hypervisor crash, we definitely needn't care migration any more;
The key point is, before migration we have no way to predict it, and we cannot forbid migration for fear that it potentially crash system.

Thanks,
Jinsong

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 11:45:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 11:45:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbVDM-0008Fv-SU; Thu, 22 Nov 2012 11:45:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TbVDM-0008Fq-4W
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 11:45:04 +0000
Received: from [85.158.139.83:44697] by server-13.bemta-5.messagelabs.com id
	F5/54-27809-F301EA05; Thu, 22 Nov 2012 11:45:03 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1353584701!26826998!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjMyOTkx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29004 invoked from network); 22 Nov 2012 11:45:02 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-6.tower-182.messagelabs.com with SMTP;
	22 Nov 2012 11:45:02 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga101.ch.intel.com with ESMTP; 22 Nov 2012 03:45:00 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,299,1352102400"; d="scan'208";a="171368842"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by AZSMGA002.ch.intel.com with ESMTP; 22 Nov 2012 03:45:00 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 22 Nov 2012 03:45:00 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Thu, 22 Nov 2012 19:44:58 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNx/B9WSR52N+j5UqhK6CjagaIUZf1t9FA
Date: Thu, 22 Nov 2012 11:44:57 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353950FD@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZaCkWhoaT83YbvyTmVnW6Q1FpV5_i+X3+cuGUapLFoSQA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353937DF@SHSMSX101.ccr.corp.intel.com>
	<20651.51754.974511.264479@mariner.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC829233539382D@SHSMSX101.ccr.corp.intel.com>
	<20651.52995.774236.722303@mariner.uk.xensource.com>
	<50ACBC50.4040204@eu.citrix.com>
	<1353499905.13542.139.camel@zakaz.uk.xensource.com>
	<DE8DF0795D48FD4CA783C40EC82923353944A2@SHSMSX101.ccr.corp.intel.com>
	<50ACDE5D.302@eu.citrix.com>
In-Reply-To: <50ACDE5D.302@eu.citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> On 21/11/12 13:26, Liu, Jinsong wrote:
>> Ian Campbell wrote:
>>> On Wed, 2012-11-21 at 11:34 +0000, George Dunlap wrote:
>>>> On 20/11/12 18:42, Ian Jackson wrote:
>>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE: handle
>>>>> broken page with regard to migration"):
>>>>>> Ian Jackson wrote:
>>>>>>> Liu, Jinsong writes ("RE: [Xen-devel] [PATCH V3] X86/vMCE:
>>>>>>> handle broken page with regard to migration"):
>>>>>>>> No, at last lter, there are 4 points:
>>>>>>>> 1. start last iter
>>>>>>>> 2. get and transfer pfn_type to target
>>>>>>>> 3. copy page to target
>>>>>>>> 4. end last iter
>>>>> ...
>>>>>> It indeed checks mce after point 3 for each page, but what's the
>>>>>> advantage of keeping a separate list?
>>>>> It avoids yet another loop over all the pages.  Unless I have
>>>>> misunderstood.  Which I may have, because: if it checks for mce
>>>>> after point 3 then surely that is sufficient ?  We don't need to
>>>>> worry about mces after that check.
>>>> It's sufficient, but wouldn't each check require a separate
>>>> hypercall? That would surely be slower than just a single hypercall
>>>> and a loop (which is what Jinsong's patch does).
>>>> 
>>>> We don't actually need a list -- I think we just need to know,
>>>> "Have any pages broken between reading the p2m table (
>>>> xc_get_pfn_type_batch() ); if so, we do another full iteration.
>>> If a page fails between 2. and 3. above then what happens at point
>>> 3? I presume we can't map and send the page (since it is broken),
>>> do we get some sort of failure to map?
>>> 
>>> What happens if the failure occurs during stage 3, i.e. while the
>>> page is mapped and we are reading from it?
>>> 
>>> Ian.
>> If read a broken page, it generates more serious error (say, SRAR
>> error). 
>> I don't think guest has good opportunity to survive under this case
>> --> most probably it kill itself and of course we don't need care
>> migration now.  
>> However, if guest can luckly survive (say complete broken page
>> copying to target), it's OK to continue --> its broken pfn_type will
>> transfer to target next iter so guest will kill itself if access
>> then.   
> 
> But in this case, I'm asking what happens if the migration code reads
> the page.  If reading the page in the migration code causes dom0 to
> crash, then the whole "last iteration" stuff is fairly pointless. :-)
> 
>   -George

If migration code read the page it will trigger more serious error and may kill hypervisor or guest.

But unfortunately we cannot prevent it since we cannot predict whether a vmce will occur *during* migration. What we can do is do our best to handle it:
1. for vmce occur before migration, we can safely handle it;
2. for vmce occur during migration, we can only do our best:
  2.1 if fortunately vmce occur at some area (say, before point2), we can successfully prevent page reading;
  2.1 if vmce occur after point2, it will read the page, under such case
    * if guest/hypervisor can survive, it's OK to transfer broken pfn_type to target so that no further harm to target;
    * if guest/hypervisor crash, we definitely needn't care migration any more;
The key point is, before migration we have no way to predict it, and we cannot forbid migration for fear that it potentially crash system.

Thanks,
Jinsong

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 12:16:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 12:16:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbVhN-0000ME-2q; Thu, 22 Nov 2012 12:16:05 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ebiederm@xmission.com>) id 1TbVhL-0000M8-Pc
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 12:16:04 +0000
Received: from [85.158.143.99:32513] by server-3.bemta-4.messagelabs.com id
	18/91-06841-3871EA05; Thu, 22 Nov 2012 12:16:03 +0000
X-Env-Sender: ebiederm@xmission.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1353586560!20921965!1
X-Originating-IP: [166.70.13.231]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16996 invoked from network); 22 Nov 2012 12:16:01 -0000
Received: from out01.mta.xmission.com (HELO out01.mta.xmission.com)
	(166.70.13.231) by server-10.tower-216.messagelabs.com with SMTP;
	22 Nov 2012 12:16:01 -0000
Received: from in02.mta.xmission.com ([166.70.13.52])
	by out01.mta.xmission.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.76) (envelope-from <ebiederm@xmission.com>)
	id 1TbVhD-0003Bw-Sd; Thu, 22 Nov 2012 05:15:55 -0700
Received: from 75-135-205-0.dhcp.krny.ne.charter.com ([75.135.205.0]
	helo=eric-ThinkPad-X220.xmission.com)
	by in02.mta.xmission.com with esmtpsa
	(TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76)
	(envelope-from <ebiederm@xmission.com>)
	id 1TbVhB-0004R0-Ev; Thu, 22 Nov 2012 05:15:55 -0700
From: ebiederm@xmission.com (Eric W. Biederman)
To: Daniel Kiper <daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
Date: Thu, 22 Nov 2012 04:15:48 -0800
In-Reply-To: <20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	(Daniel Kiper's message of "Wed, 21 Nov 2012 11:52:21 +0100")
Message-ID: <87txshx28b.fsf@xmission.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)
MIME-Version: 1.0
X-XM-AID: U2FsdGVkX1/TTfycYmLKi8RMMP4QsFc4D0+8/+0a2IY=
X-SA-Exim-Connect-IP: 75.135.205.0
X-SA-Exim-Mail-From: ebiederm@xmission.com
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sa07.xmission.com
X-Spam-Level: 
X-Spam-Status: No, score=-4.0 required=8.0 tests=ALL_TRUSTED,BAYES_00,
	DCC_CHECK_NEGATIVE,TVD_RCVD_IP,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01,
	T_XMDrugObfuBody_14 autolearn=disabled version=3.3.2
X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
	*  0.0 TVD_RCVD_IP TVD_RCVD_IP
	*  0.0 T_TM2_M_HEADER_IN_MSG BODY: T_TM2_M_HEADER_IN_MSG
	* -3.0 BAYES_00 BODY: Bayes spam probability is 0 to 1%
	*      [score: 0.0060]
	* -0.0 DCC_CHECK_NEGATIVE Not listed in DCC
	*      [sa07 1397; Body=1 Fuz1=1 Fuz2=1]
	*  0.0 T_TooManySym_01 4+ unique symbols in subject
	*  0.0 T_XMDrugObfuBody_14 obfuscated drug references
X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 
X-Spam-Combo: ;Daniel Kiper <daniel.kiper@oracle.com>
X-Spam-Relay-Country: 
X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 03:05:19 +0000)
X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com)
Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	jbeulich@suse.com, hpa@zytor.com, tglx@linutronix.de
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Daniel Kiper <daniel.kiper@oracle.com> writes:

> On Tue, Nov 20, 2012 at 08:40:39AM -0800, ebiederm@xmission.com wrote:
>> Daniel Kiper <daniel.kiper@oracle.com> writes:
>>
>> > Some kexec/kdump implementations (e.g. Xen PVOPS) could not use default
>> > functions or require some changes in behavior of kexec/kdump generic code.
>> > To cope with that problem kexec_ops struct was introduced. It allows
>> > a developer to replace all or some functions and control some
>> > functionality of kexec/kdump generic code.
>> >
>> > Default behavior of kexec/kdump generic code is not changed.
>>
>> Ick.
>>
>> > v2 - suggestions/fixes:
>> >    - add comment for kexec_ops.crash_alloc_temp_store member
>> >      (suggested by Konrad Rzeszutek Wilk),
>> >    - simplify kexec_ops usage
>> >      (suggested by Konrad Rzeszutek Wilk).
>> >
>> > Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
>> > ---
>> >  include/linux/kexec.h |   26 ++++++++++
>> >  kernel/kexec.c        |  131 +++++++++++++++++++++++++++++++++++++------------
>> >  2 files changed, 125 insertions(+), 32 deletions(-)
>> >
>> > diff --git a/include/linux/kexec.h b/include/linux/kexec.h
>> > index d0b8458..c8d0b35 100644
>> > --- a/include/linux/kexec.h
>> > +++ b/include/linux/kexec.h
>> > @@ -116,7 +116,33 @@ struct kimage {
>> >  #endif
>> >  };
>> >
>> > +struct kexec_ops {
>> > +	/*
>> > +	 * Some kdump implementations (e.g. Xen PVOPS dom0) could not access
>> > +	 * directly crash kernel memory area. In this situation they must
>> > +	 * allocate memory outside of it and later move contents from temporary
>> > +	 * storage to final resting places (usualy done by relocate_kernel()).
>> > +	 * Such behavior could be enforced by setting
>> > +	 * crash_alloc_temp_store member to true.
>> > +	 */
>>
>> Why in the world would Xen not be able to access crash kernel memory?
>> As currently defined it is normal memory that the kernel chooses not to
>> use.
>>
>> If relocate kernel can access that memory you definitely can access the
>> memory so the comment does not make any sense.
>
> Crash kernel memory is reserved by Xen hypervisor and Xen hypervisor
> only has access to it. dom0 does not have any mapping of this area.
> However, relocate_kernel() has access to crash kernel memory
> because it is executed by Xen hypervisor and whole machine
> memory is identity mapped.

This is all weird.  Doubly so since this code is multi-arch and you have
a set of requirements no other arch has had.

I recall that Xen uses kexec in a unique manner.  What is the hypervisor
interface and how is it used?

Is this for when the hypervisor crashes and we want a crash dump of
that?



>> > +	bool crash_alloc_temp_store;
>> > +	struct page *(*kimage_alloc_pages)(gfp_t gfp_mask,
>> > +						unsigned int order,
>> > +						unsigned long limit);
>> > +	void (*kimage_free_pages)(struct page *page);
>> > +	unsigned long (*page_to_pfn)(struct page *page);
>> > +	struct page *(*pfn_to_page)(unsigned long pfn);
>> > +	unsigned long (*virt_to_phys)(volatile void *address);
>> > +	void *(*phys_to_virt)(unsigned long address);
>> > +	int (*machine_kexec_prepare)(struct kimage *image);
>> > +	int (*machine_kexec_load)(struct kimage *image);
>> > +	void (*machine_kexec_cleanup)(struct kimage *image);
>> > +	void (*machine_kexec_unload)(struct kimage *image);
>> > +	void (*machine_kexec_shutdown)(void);
>> > +	void (*machine_kexec)(struct kimage *image);
>> > +};
>>
>> Ugh.  This is a nasty abstraction.
>>
>> You are mixing and matching a bunch of things together here.
>>
>> If you need to override machine_kexec_xxx please do that on a per
>> architecture basis.
>
> Yes, it is possible but I think that it is worth to do it at that
> level because it could be useful for other archs too (e.g. Xen ARM port
> is under development). Then we do not need to duplicate that functionality
> in arch code. Additionally, Xen requires machine_kexec_load and
> machine_kexec_unload hooks which are not available in current generic
> kexec/kdump code.


Let me be clear.  kexec_ops as you have implemented it is absolutely
unacceptable.

Your kexec_ops is not an abstraction but a hack that enshrines in stone
implementation details.

>> Special case overrides of page_to_pfn, pfn_to_page, virt_to_phys,
>> phys_to_virt, and friends seem completely inappropriate.
>
> They are required in Xen PVOPS case. If we do not do that in that way
> then we at least need to duplicate almost all generic kexec/kdump existing
> code in arch depended files. I do not mention that we need to capture
> relevant syscall and other things. I think that this is wrong way.

A different definition of phys_to_virt and page_to_pfn for one specific
function is total nonsense.

It may actually be better to have a completely different code path.
This looks more like code abuse than code reuse.

Successful code reuse depends upon not breaking the assumptions on which
the code relies, or modifying the code so that the new modified
assumptions are clear.  In this case you might as well define up as down
for all of the sense kexec_ops makes.

>> There may be a point to all of these but you are mixing and matching
>> things badly.
>
> Do you whish to split this kexec_ops struct to something which
> works with addresses and something which is reponsible for
> loading, unloading and executing kexec/kdump? I am able to change
> that but I would like to know a bit about your vision first.

My vision is that we should have code that makes sense.

My suspicion is that what you want is a cousin of the existing kexec
system call.  Perhaps what is needed is a flag to say use the firmware
kexec system call.

I absolutely do not understand what Xen is trying to do.  kexec by
design should not require any firmware specific hooks.  kexec at this
level should only need to care about the processor architeture.  Clearly
what you are doing with Xen requires special hooks separate even from
the normal paravirt hooks.  So I do not understand you are trying to do.

It needs to be clear from the code what is happening differently in the
Xen case.  Otherwise the code is unmaintainable as no one will be able
to understand it.

Eric


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 12:16:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 12:16:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbVhN-0000ME-2q; Thu, 22 Nov 2012 12:16:05 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ebiederm@xmission.com>) id 1TbVhL-0000M8-Pc
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 12:16:04 +0000
Received: from [85.158.143.99:32513] by server-3.bemta-4.messagelabs.com id
	18/91-06841-3871EA05; Thu, 22 Nov 2012 12:16:03 +0000
X-Env-Sender: ebiederm@xmission.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1353586560!20921965!1
X-Originating-IP: [166.70.13.231]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16996 invoked from network); 22 Nov 2012 12:16:01 -0000
Received: from out01.mta.xmission.com (HELO out01.mta.xmission.com)
	(166.70.13.231) by server-10.tower-216.messagelabs.com with SMTP;
	22 Nov 2012 12:16:01 -0000
Received: from in02.mta.xmission.com ([166.70.13.52])
	by out01.mta.xmission.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.76) (envelope-from <ebiederm@xmission.com>)
	id 1TbVhD-0003Bw-Sd; Thu, 22 Nov 2012 05:15:55 -0700
Received: from 75-135-205-0.dhcp.krny.ne.charter.com ([75.135.205.0]
	helo=eric-ThinkPad-X220.xmission.com)
	by in02.mta.xmission.com with esmtpsa
	(TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76)
	(envelope-from <ebiederm@xmission.com>)
	id 1TbVhB-0004R0-Ev; Thu, 22 Nov 2012 05:15:55 -0700
From: ebiederm@xmission.com (Eric W. Biederman)
To: Daniel Kiper <daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
Date: Thu, 22 Nov 2012 04:15:48 -0800
In-Reply-To: <20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	(Daniel Kiper's message of "Wed, 21 Nov 2012 11:52:21 +0100")
Message-ID: <87txshx28b.fsf@xmission.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)
MIME-Version: 1.0
X-XM-AID: U2FsdGVkX1/TTfycYmLKi8RMMP4QsFc4D0+8/+0a2IY=
X-SA-Exim-Connect-IP: 75.135.205.0
X-SA-Exim-Mail-From: ebiederm@xmission.com
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sa07.xmission.com
X-Spam-Level: 
X-Spam-Status: No, score=-4.0 required=8.0 tests=ALL_TRUSTED,BAYES_00,
	DCC_CHECK_NEGATIVE,TVD_RCVD_IP,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01,
	T_XMDrugObfuBody_14 autolearn=disabled version=3.3.2
X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
	*  0.0 TVD_RCVD_IP TVD_RCVD_IP
	*  0.0 T_TM2_M_HEADER_IN_MSG BODY: T_TM2_M_HEADER_IN_MSG
	* -3.0 BAYES_00 BODY: Bayes spam probability is 0 to 1%
	*      [score: 0.0060]
	* -0.0 DCC_CHECK_NEGATIVE Not listed in DCC
	*      [sa07 1397; Body=1 Fuz1=1 Fuz2=1]
	*  0.0 T_TooManySym_01 4+ unique symbols in subject
	*  0.0 T_XMDrugObfuBody_14 obfuscated drug references
X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 
X-Spam-Combo: ;Daniel Kiper <daniel.kiper@oracle.com>
X-Spam-Relay-Country: 
X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 03:05:19 +0000)
X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com)
Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	jbeulich@suse.com, hpa@zytor.com, tglx@linutronix.de
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Daniel Kiper <daniel.kiper@oracle.com> writes:

> On Tue, Nov 20, 2012 at 08:40:39AM -0800, ebiederm@xmission.com wrote:
>> Daniel Kiper <daniel.kiper@oracle.com> writes:
>>
>> > Some kexec/kdump implementations (e.g. Xen PVOPS) could not use default
>> > functions or require some changes in behavior of kexec/kdump generic code.
>> > To cope with that problem kexec_ops struct was introduced. It allows
>> > a developer to replace all or some functions and control some
>> > functionality of kexec/kdump generic code.
>> >
>> > Default behavior of kexec/kdump generic code is not changed.
>>
>> Ick.
>>
>> > v2 - suggestions/fixes:
>> >    - add comment for kexec_ops.crash_alloc_temp_store member
>> >      (suggested by Konrad Rzeszutek Wilk),
>> >    - simplify kexec_ops usage
>> >      (suggested by Konrad Rzeszutek Wilk).
>> >
>> > Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
>> > ---
>> >  include/linux/kexec.h |   26 ++++++++++
>> >  kernel/kexec.c        |  131 +++++++++++++++++++++++++++++++++++++------------
>> >  2 files changed, 125 insertions(+), 32 deletions(-)
>> >
>> > diff --git a/include/linux/kexec.h b/include/linux/kexec.h
>> > index d0b8458..c8d0b35 100644
>> > --- a/include/linux/kexec.h
>> > +++ b/include/linux/kexec.h
>> > @@ -116,7 +116,33 @@ struct kimage {
>> >  #endif
>> >  };
>> >
>> > +struct kexec_ops {
>> > +	/*
>> > +	 * Some kdump implementations (e.g. Xen PVOPS dom0) could not access
>> > +	 * directly crash kernel memory area. In this situation they must
>> > +	 * allocate memory outside of it and later move contents from temporary
>> > +	 * storage to final resting places (usualy done by relocate_kernel()).
>> > +	 * Such behavior could be enforced by setting
>> > +	 * crash_alloc_temp_store member to true.
>> > +	 */
>>
>> Why in the world would Xen not be able to access crash kernel memory?
>> As currently defined it is normal memory that the kernel chooses not to
>> use.
>>
>> If relocate kernel can access that memory you definitely can access the
>> memory so the comment does not make any sense.
>
> Crash kernel memory is reserved by Xen hypervisor and Xen hypervisor
> only has access to it. dom0 does not have any mapping of this area.
> However, relocate_kernel() has access to crash kernel memory
> because it is executed by Xen hypervisor and whole machine
> memory is identity mapped.

This is all weird.  Doubly so since this code is multi-arch and you have
a set of requirements no other arch has had.

I recall that Xen uses kexec in a unique manner.  What is the hypervisor
interface and how is it used?

Is this for when the hypervisor crashes and we want a crash dump of
that?



>> > +	bool crash_alloc_temp_store;
>> > +	struct page *(*kimage_alloc_pages)(gfp_t gfp_mask,
>> > +						unsigned int order,
>> > +						unsigned long limit);
>> > +	void (*kimage_free_pages)(struct page *page);
>> > +	unsigned long (*page_to_pfn)(struct page *page);
>> > +	struct page *(*pfn_to_page)(unsigned long pfn);
>> > +	unsigned long (*virt_to_phys)(volatile void *address);
>> > +	void *(*phys_to_virt)(unsigned long address);
>> > +	int (*machine_kexec_prepare)(struct kimage *image);
>> > +	int (*machine_kexec_load)(struct kimage *image);
>> > +	void (*machine_kexec_cleanup)(struct kimage *image);
>> > +	void (*machine_kexec_unload)(struct kimage *image);
>> > +	void (*machine_kexec_shutdown)(void);
>> > +	void (*machine_kexec)(struct kimage *image);
>> > +};
>>
>> Ugh.  This is a nasty abstraction.
>>
>> You are mixing and matching a bunch of things together here.
>>
>> If you need to override machine_kexec_xxx please do that on a per
>> architecture basis.
>
> Yes, it is possible but I think that it is worth to do it at that
> level because it could be useful for other archs too (e.g. Xen ARM port
> is under development). Then we do not need to duplicate that functionality
> in arch code. Additionally, Xen requires machine_kexec_load and
> machine_kexec_unload hooks which are not available in current generic
> kexec/kdump code.


Let me be clear.  kexec_ops as you have implemented it is absolutely
unacceptable.

Your kexec_ops is not an abstraction but a hack that enshrines in stone
implementation details.

>> Special case overrides of page_to_pfn, pfn_to_page, virt_to_phys,
>> phys_to_virt, and friends seem completely inappropriate.
>
> They are required in Xen PVOPS case. If we do not do that in that way
> then we at least need to duplicate almost all generic kexec/kdump existing
> code in arch depended files. I do not mention that we need to capture
> relevant syscall and other things. I think that this is wrong way.

A different definition of phys_to_virt and page_to_pfn for one specific
function is total nonsense.

It may actually be better to have a completely different code path.
This looks more like code abuse than code reuse.

Successful code reuse depends upon not breaking the assumptions on which
the code relies, or modifying the code so that the new modified
assumptions are clear.  In this case you might as well define up as down
for all of the sense kexec_ops makes.

>> There may be a point to all of these but you are mixing and matching
>> things badly.
>
> Do you whish to split this kexec_ops struct to something which
> works with addresses and something which is reponsible for
> loading, unloading and executing kexec/kdump? I am able to change
> that but I would like to know a bit about your vision first.

My vision is that we should have code that makes sense.

My suspicion is that what you want is a cousin of the existing kexec
system call.  Perhaps what is needed is a flag to say use the firmware
kexec system call.

I absolutely do not understand what Xen is trying to do.  kexec by
design should not require any firmware specific hooks.  kexec at this
level should only need to care about the processor architeture.  Clearly
what you are doing with Xen requires special hooks separate even from
the normal paravirt hooks.  So I do not understand you are trying to do.

It needs to be clear from the code what is happening differently in the
Xen case.  Otherwise the code is unmaintainable as no one will be able
to understand it.

Eric


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 12:20:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 12:20:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbVkw-0000TC-OJ; Thu, 22 Nov 2012 12:19:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbVku-0000T5-UC
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 12:19:45 +0000
Received: from [85.158.143.35:32543] by server-3.bemta-4.messagelabs.com id
	BC/48-06841-0681EA05; Thu, 22 Nov 2012 12:19:44 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1353586754!11755827!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23840 invoked from network); 22 Nov 2012 12:19:15 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-21.messagelabs.com with SMTP;
	22 Nov 2012 12:19:15 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 12:19:14 +0000
Message-Id: <50AE268B02000078000AA952@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 12:20:11 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartE5D4166B.0__="
Subject: [Xen-devel] [PATCH] linux-2.6.18/scsiback: don't let in-flight
 requests defer pending ones
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartE5D4166B.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Running RING_FINAL_CHECK_FOR_REQUESTS from make_response is a bad
idea. It means that in-flight I/O is essentially blocking continued
batches. This essentially kills throughput on frontends which unplug
(or even just notify) early and rightfully assume additional requests
will be picked up on time, not synchronously.

Derived from a similar blkback patch by Daniel Stodden (see c/s
1118:c7c14595c18b).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/drivers/xen/scsiback/scsiback.c
+++ b/drivers/xen/scsiback/scsiback.c
@@ -149,7 +149,6 @@ void scsiback_do_resp_with_sense(char *s
 	vscsiif_response_t *ring_res;
 	struct vscsibk_info *info =3D pending_req->info;
 	int notify;
-	int more_to_do =3D 1;
 	struct scsi_sense_hdr sshdr;
 	unsigned long flags;
=20
@@ -182,17 +181,8 @@ void scsiback_do_resp_with_sense(char *s
 	ring_res->residual_len =3D resid;
=20
 	RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&info->ring, notify);
-	if (info->ring.rsp_prod_pvt =3D=3D info->ring.req_cons) {
-		RING_FINAL_CHECK_FOR_REQUESTS(&info->ring, more_to_do);
-	} else if (RING_HAS_UNCONSUMED_REQUESTS(&info->ring)) {
-		more_to_do =3D 1;
-	}
-=09
 	spin_unlock_irqrestore(&info->ring_lock, flags);
=20
-	if (more_to_do)
-		scsiback_notify_work(info);
-
 	if (notify)
 		notify_remote_via_irq(info->irq);
=20
@@ -586,7 +576,7 @@ invalid_value:
 }
=20
=20
-static int scsiback_do_cmd_fn(struct vscsibk_info *info)
+static int _scsiback_do_cmd_fn(struct vscsibk_info *info)
 {
 	struct vscsiif_back_ring *ring =3D &info->ring;
 	vscsiif_request_t  *ring_req;
@@ -652,6 +642,21 @@ static int scsiback_do_cmd_fn(struct vsc
 	return more_to_do;
 }
=20
+static int scsiback_do_cmd_fn(struct vscsibk_info *info)
+{
+	int more_to_do;
+
+	do {
+		more_to_do =3D _scsiback_do_cmd_fn(info);
+		if (more_to_do)
+			break;
+
+		RING_FINAL_CHECK_FOR_REQUESTS(&info->ring, more_to_do);
+	} while (more_to_do);
+
+	return more_to_do;
+}
+
=20
 int scsiback_schedule(void *data)
 {




--=__PartE5D4166B.0__=
Content-Type: text/plain; name="xen-scsiback-streamline.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-scsiback-streamline.patch"

scsiback: don't let in-flight requests defer pending ones=0A=0ARunning =
RING_FINAL_CHECK_FOR_REQUESTS from make_response is a bad=0Aidea. It means =
that in-flight I/O is essentially blocking continued=0Abatches. This =
essentially kills throughput on frontends which unplug=0A(or even just =
notify) early and rightfully assume additional requests=0Awill be picked =
up on time, not synchronously.=0A=0ADerived from a similar blkback patch =
by Daniel Stodden (see c/s=0A1118:c7c14595c18b).=0A=0ASigned-off-by: Jan =
Beulich <jbeulich@suse.com>=0A=0A--- a/drivers/xen/scsiback/scsiback.c=0A++=
+ b/drivers/xen/scsiback/scsiback.c=0A@@ -149,7 +149,6 @@ void scsiback_do_=
resp_with_sense(char *s=0A 	vscsiif_response_t *ring_res;=0A 	=
struct vscsibk_info *info =3D pending_req->info;=0A 	int notify;=0A-	=
int more_to_do =3D 1;=0A 	struct scsi_sense_hdr sshdr;=0A 	=
unsigned long flags;=0A =0A@@ -182,17 +181,8 @@ void scsiback_do_resp_with_=
sense(char *s=0A 	ring_res->residual_len =3D resid;=0A =0A 	=
RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&info->ring, notify);=0A-	if =
(info->ring.rsp_prod_pvt =3D=3D info->ring.req_cons) {=0A-		=
RING_FINAL_CHECK_FOR_REQUESTS(&info->ring, more_to_do);=0A-	} else if =
(RING_HAS_UNCONSUMED_REQUESTS(&info->ring)) {=0A-		more_to_do =
=3D 1;=0A-	}=0A-	=0A 	spin_unlock_irqrestore(&info->ring_lock, =
flags);=0A =0A-	if (more_to_do)=0A-		scsiback_notify_work(info);=
=0A-=0A 	if (notify)=0A 		notify_remote_via_irq(info->irq);=
=0A =0A@@ -586,7 +576,7 @@ invalid_value:=0A }=0A =0A =0A-static int =
scsiback_do_cmd_fn(struct vscsibk_info *info)=0A+static int _scsiback_do_cm=
d_fn(struct vscsibk_info *info)=0A {=0A 	struct vscsiif_back_ring =
*ring =3D &info->ring;=0A 	vscsiif_request_t  *ring_req;=0A@@ -652,6 =
+642,21 @@ static int scsiback_do_cmd_fn(struct vsc=0A 	return more_to_do;=
=0A }=0A =0A+static int scsiback_do_cmd_fn(struct vscsibk_info *info)=0A+{=
=0A+	int more_to_do;=0A+=0A+	do {=0A+		more_to_do =3D =
_scsiback_do_cmd_fn(info);=0A+		if (more_to_do)=0A+			=
break;=0A+=0A+		RING_FINAL_CHECK_FOR_REQUESTS(&info->ring, =
more_to_do);=0A+	} while (more_to_do);=0A+=0A+	return more_to_do;=
=0A+}=0A+=0A =0A int scsiback_schedule(void *data)=0A {=0A
--=__PartE5D4166B.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.xen.org
http://lists.xen.org/xen-devel

--=__PartE5D4166B.0__=--


From xen-devel-bounces@lists.xen.org Thu Nov 22 12:20:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 12:20:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbVkw-0000TC-OJ; Thu, 22 Nov 2012 12:19:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbVku-0000T5-UC
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 12:19:45 +0000
Received: from [85.158.143.35:32543] by server-3.bemta-4.messagelabs.com id
	BC/48-06841-0681EA05; Thu, 22 Nov 2012 12:19:44 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1353586754!11755827!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23840 invoked from network); 22 Nov 2012 12:19:15 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-21.messagelabs.com with SMTP;
	22 Nov 2012 12:19:15 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 12:19:14 +0000
Message-Id: <50AE268B02000078000AA952@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 12:20:11 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartE5D4166B.0__="
Subject: [Xen-devel] [PATCH] linux-2.6.18/scsiback: don't let in-flight
 requests defer pending ones
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartE5D4166B.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Running RING_FINAL_CHECK_FOR_REQUESTS from make_response is a bad
idea. It means that in-flight I/O is essentially blocking continued
batches. This essentially kills throughput on frontends which unplug
(or even just notify) early and rightfully assume additional requests
will be picked up on time, not synchronously.

Derived from a similar blkback patch by Daniel Stodden (see c/s
1118:c7c14595c18b).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/drivers/xen/scsiback/scsiback.c
+++ b/drivers/xen/scsiback/scsiback.c
@@ -149,7 +149,6 @@ void scsiback_do_resp_with_sense(char *s
 	vscsiif_response_t *ring_res;
 	struct vscsibk_info *info =3D pending_req->info;
 	int notify;
-	int more_to_do =3D 1;
 	struct scsi_sense_hdr sshdr;
 	unsigned long flags;
=20
@@ -182,17 +181,8 @@ void scsiback_do_resp_with_sense(char *s
 	ring_res->residual_len =3D resid;
=20
 	RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&info->ring, notify);
-	if (info->ring.rsp_prod_pvt =3D=3D info->ring.req_cons) {
-		RING_FINAL_CHECK_FOR_REQUESTS(&info->ring, more_to_do);
-	} else if (RING_HAS_UNCONSUMED_REQUESTS(&info->ring)) {
-		more_to_do =3D 1;
-	}
-=09
 	spin_unlock_irqrestore(&info->ring_lock, flags);
=20
-	if (more_to_do)
-		scsiback_notify_work(info);
-
 	if (notify)
 		notify_remote_via_irq(info->irq);
=20
@@ -586,7 +576,7 @@ invalid_value:
 }
=20
=20
-static int scsiback_do_cmd_fn(struct vscsibk_info *info)
+static int _scsiback_do_cmd_fn(struct vscsibk_info *info)
 {
 	struct vscsiif_back_ring *ring =3D &info->ring;
 	vscsiif_request_t  *ring_req;
@@ -652,6 +642,21 @@ static int scsiback_do_cmd_fn(struct vsc
 	return more_to_do;
 }
=20
+static int scsiback_do_cmd_fn(struct vscsibk_info *info)
+{
+	int more_to_do;
+
+	do {
+		more_to_do =3D _scsiback_do_cmd_fn(info);
+		if (more_to_do)
+			break;
+
+		RING_FINAL_CHECK_FOR_REQUESTS(&info->ring, more_to_do);
+	} while (more_to_do);
+
+	return more_to_do;
+}
+
=20
 int scsiback_schedule(void *data)
 {




--=__PartE5D4166B.0__=
Content-Type: text/plain; name="xen-scsiback-streamline.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-scsiback-streamline.patch"

scsiback: don't let in-flight requests defer pending ones=0A=0ARunning =
RING_FINAL_CHECK_FOR_REQUESTS from make_response is a bad=0Aidea. It means =
that in-flight I/O is essentially blocking continued=0Abatches. This =
essentially kills throughput on frontends which unplug=0A(or even just =
notify) early and rightfully assume additional requests=0Awill be picked =
up on time, not synchronously.=0A=0ADerived from a similar blkback patch =
by Daniel Stodden (see c/s=0A1118:c7c14595c18b).=0A=0ASigned-off-by: Jan =
Beulich <jbeulich@suse.com>=0A=0A--- a/drivers/xen/scsiback/scsiback.c=0A++=
+ b/drivers/xen/scsiback/scsiback.c=0A@@ -149,7 +149,6 @@ void scsiback_do_=
resp_with_sense(char *s=0A 	vscsiif_response_t *ring_res;=0A 	=
struct vscsibk_info *info =3D pending_req->info;=0A 	int notify;=0A-	=
int more_to_do =3D 1;=0A 	struct scsi_sense_hdr sshdr;=0A 	=
unsigned long flags;=0A =0A@@ -182,17 +181,8 @@ void scsiback_do_resp_with_=
sense(char *s=0A 	ring_res->residual_len =3D resid;=0A =0A 	=
RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&info->ring, notify);=0A-	if =
(info->ring.rsp_prod_pvt =3D=3D info->ring.req_cons) {=0A-		=
RING_FINAL_CHECK_FOR_REQUESTS(&info->ring, more_to_do);=0A-	} else if =
(RING_HAS_UNCONSUMED_REQUESTS(&info->ring)) {=0A-		more_to_do =
=3D 1;=0A-	}=0A-	=0A 	spin_unlock_irqrestore(&info->ring_lock, =
flags);=0A =0A-	if (more_to_do)=0A-		scsiback_notify_work(info);=
=0A-=0A 	if (notify)=0A 		notify_remote_via_irq(info->irq);=
=0A =0A@@ -586,7 +576,7 @@ invalid_value:=0A }=0A =0A =0A-static int =
scsiback_do_cmd_fn(struct vscsibk_info *info)=0A+static int _scsiback_do_cm=
d_fn(struct vscsibk_info *info)=0A {=0A 	struct vscsiif_back_ring =
*ring =3D &info->ring;=0A 	vscsiif_request_t  *ring_req;=0A@@ -652,6 =
+642,21 @@ static int scsiback_do_cmd_fn(struct vsc=0A 	return more_to_do;=
=0A }=0A =0A+static int scsiback_do_cmd_fn(struct vscsibk_info *info)=0A+{=
=0A+	int more_to_do;=0A+=0A+	do {=0A+		more_to_do =3D =
_scsiback_do_cmd_fn(info);=0A+		if (more_to_do)=0A+			=
break;=0A+=0A+		RING_FINAL_CHECK_FOR_REQUESTS(&info->ring, =
more_to_do);=0A+	} while (more_to_do);=0A+=0A+	return more_to_do;=
=0A+}=0A+=0A =0A int scsiback_schedule(void *data)=0A {=0A
--=__PartE5D4166B.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.xen.org
http://lists.xen.org/xen-devel

--=__PartE5D4166B.0__=--


From xen-devel-bounces@lists.xen.org Thu Nov 22 12:20:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 12:20:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbVlD-0000US-5z; Thu, 22 Nov 2012 12:20:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbVlB-0000UD-DA
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 12:20:01 +0000
Received: from [85.158.143.35:34627] by server-1.bemta-4.messagelabs.com id
	11/3E-27934-0781EA05; Thu, 22 Nov 2012 12:20:00 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1353586717!10853877!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13972 invoked from network); 22 Nov 2012 12:18:37 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-21.messagelabs.com with SMTP;
	22 Nov 2012 12:18:37 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 12:18:36 +0000
Message-Id: <50AE266502000078000AA94E@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 12:19:33 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartCBFA3845.0__="
Subject: [Xen-devel] [PATCH] linux-2.6.18/blktap: don't let in-flight
 requests defer pending ones
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartCBFA3845.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Running RING_FINAL_CHECK_FOR_REQUESTS from make_response is a bad
idea. It means that in-flight I/O is essentially blocking continued
batches. This essentially kills throughput on frontends which unplug
(or even just notify) early and rightfully assume additional requests
will be picked up on time, not synchronously.

Derived from a similar blkback patch by Daniel Stodden (see c/s
1118:c7c14595c18b).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/drivers/xen/blktap/blktap.c
+++ b/drivers/xen/blktap/blktap.c
@@ -1285,7 +1285,7 @@ irqreturn_t tap_blkif_be_int(int irq, vo
  * DOWNWARD CALLS -- These interface with the block-device layer proper.
  */
 static int print_dbug =3D 1;
-static int do_block_io_op(blkif_t *blkif)
+static int _do_block_io_op(blkif_t *blkif)
 {
 	blkif_back_rings_t *blk_rings =3D &blkif->blk_rings;
 	blkif_request_t req;
@@ -1397,6 +1397,22 @@ static int do_block_io_op(blkif_t *blkif
 	return more_to_do;
 }
=20
+static int do_block_io_op(blkif_t *blkif)
+{
+	blkif_back_rings_t *blk_rings =3D &blkif->blk_rings;
+	int more_to_do;
+
+	do {
+		more_to_do =3D _do_block_io_op(blkif);
+		if (more_to_do)
+			break;
+
+		RING_FINAL_CHECK_FOR_REQUESTS(&blk_rings->common, =
more_to_do);
+	} while (more_to_do);
+
+	return more_to_do;
+}
+
 static void dispatch_rw_block_io(blkif_t *blkif,
 				 blkif_request_t *req,
 				 pending_req_t *pending_req)
@@ -1647,7 +1663,6 @@ static void make_response(blkif_t *blkif
 	blkif_response_t  resp;
 	unsigned long     flags;
 	blkif_back_rings_t *blk_rings =3D &blkif->blk_rings;
-	int more_to_do =3D 0;
 	int notify;
=20
 	resp.id        =3D id;
@@ -1678,20 +1693,7 @@ static void make_response(blkif_t *blkif
 	blk_rings->common.rsp_prod_pvt++;
 	RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&blk_rings->common, notify);
=20
-	if (blk_rings->common.rsp_prod_pvt =3D=3D blk_rings->common.req_con=
s) {
-		/*
-		 * Tail check for pending requests. Allows frontend to =
avoid
-		 * notifications if requests are already in flight (lower
-		 * overheads and promotes batching).
-		 */
-		RING_FINAL_CHECK_FOR_REQUESTS(&blk_rings->common, =
more_to_do);
-	} else if (RING_HAS_UNCONSUMED_REQUESTS(&blk_rings->common)) {
-		more_to_do =3D 1;
-	}
-
 	spin_unlock_irqrestore(&blkif->blk_ring_lock, flags);
-	if (more_to_do)
-		blkif_notify_work(blkif);
 	if (notify)
 		notify_remote_via_irq(blkif->irq);
 }




--=__PartCBFA3845.0__=
Content-Type: text/plain; name="xen-blktap-streamline.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-blktap-streamline.patch"

blktap: don't let in-flight requests defer pending ones=0A=0ARunning =
RING_FINAL_CHECK_FOR_REQUESTS from make_response is a bad=0Aidea. It means =
that in-flight I/O is essentially blocking continued=0Abatches. This =
essentially kills throughput on frontends which unplug=0A(or even just =
notify) early and rightfully assume additional requests=0Awill be picked =
up on time, not synchronously.=0A=0ADerived from a similar blkback patch =
by Daniel Stodden (see c/s=0A1118:c7c14595c18b).=0A=0ASigned-off-by: Jan =
Beulich <jbeulich@suse.com>=0A=0A--- a/drivers/xen/blktap/blktap.c=0A+++ =
b/drivers/xen/blktap/blktap.c=0A@@ -1285,7 +1285,7 @@ irqreturn_t =
tap_blkif_be_int(int irq, vo=0A  * DOWNWARD CALLS -- These interface with =
the block-device layer proper.=0A  */=0A static int print_dbug =3D =
1;=0A-static int do_block_io_op(blkif_t *blkif)=0A+static int _do_block_io_=
op(blkif_t *blkif)=0A {=0A 	blkif_back_rings_t *blk_rings =3D =
&blkif->blk_rings;=0A 	blkif_request_t req;=0A@@ -1397,6 +1397,22 @@ =
static int do_block_io_op(blkif_t *blkif=0A 	return more_to_do;=0A }=0A =
=0A+static int do_block_io_op(blkif_t *blkif)=0A+{=0A+	blkif_back_rings_t =
*blk_rings =3D &blkif->blk_rings;=0A+	int more_to_do;=0A+=0A+	do {=0A+	=
	more_to_do =3D _do_block_io_op(blkif);=0A+		if =
(more_to_do)=0A+			break;=0A+=0A+		RING_FINAL_=
CHECK_FOR_REQUESTS(&blk_rings->common, more_to_do);=0A+	} while (more_to_do=
);=0A+=0A+	return more_to_do;=0A+}=0A+=0A static void dispatch_rw_bloc=
k_io(blkif_t *blkif,=0A 				 blkif_request_t =
*req,=0A 				 pending_req_t *pending_req)=0A@@ =
-1647,7 +1663,6 @@ static void make_response(blkif_t *blkif=0A 	blkif_respo=
nse_t  resp;=0A 	unsigned long     flags;=0A 	blkif_back_rings_t =
*blk_rings =3D &blkif->blk_rings;=0A-	int more_to_do =3D 0;=0A 	=
int notify;=0A =0A 	resp.id        =3D id;=0A@@ -1678,20 +1693,7 @@ =
static void make_response(blkif_t *blkif=0A 	blk_rings->common.rsp_prod_=
pvt++;=0A 	RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&blk_rings->common, =
notify);=0A =0A-	if (blk_rings->common.rsp_prod_pvt =3D=3D =
blk_rings->common.req_cons) {=0A-		/*=0A-		 * Tail =
check for pending requests. Allows frontend to avoid=0A-		 * =
notifications if requests are already in flight (lower=0A-		 * =
overheads and promotes batching).=0A-		 */=0A-		RING_FINAL_=
CHECK_FOR_REQUESTS(&blk_rings->common, more_to_do);=0A-	} else if =
(RING_HAS_UNCONSUMED_REQUESTS(&blk_rings->common)) {=0A-		=
more_to_do =3D 1;=0A-	}=0A-=0A 	spin_unlock_irqrestore(&blkif->blk_=
ring_lock, flags);=0A-	if (more_to_do)=0A-		blkif_notify_work(b=
lkif);=0A 	if (notify)=0A 		notify_remote_via_irq(blkif->irq);=
=0A }=0A
--=__PartCBFA3845.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.xen.org
http://lists.xen.org/xen-devel

--=__PartCBFA3845.0__=--


From xen-devel-bounces@lists.xen.org Thu Nov 22 12:20:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 12:20:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbVlD-0000US-5z; Thu, 22 Nov 2012 12:20:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbVlB-0000UD-DA
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 12:20:01 +0000
Received: from [85.158.143.35:34627] by server-1.bemta-4.messagelabs.com id
	11/3E-27934-0781EA05; Thu, 22 Nov 2012 12:20:00 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1353586717!10853877!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13972 invoked from network); 22 Nov 2012 12:18:37 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-21.messagelabs.com with SMTP;
	22 Nov 2012 12:18:37 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 12:18:36 +0000
Message-Id: <50AE266502000078000AA94E@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 12:19:33 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartCBFA3845.0__="
Subject: [Xen-devel] [PATCH] linux-2.6.18/blktap: don't let in-flight
 requests defer pending ones
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartCBFA3845.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Running RING_FINAL_CHECK_FOR_REQUESTS from make_response is a bad
idea. It means that in-flight I/O is essentially blocking continued
batches. This essentially kills throughput on frontends which unplug
(or even just notify) early and rightfully assume additional requests
will be picked up on time, not synchronously.

Derived from a similar blkback patch by Daniel Stodden (see c/s
1118:c7c14595c18b).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/drivers/xen/blktap/blktap.c
+++ b/drivers/xen/blktap/blktap.c
@@ -1285,7 +1285,7 @@ irqreturn_t tap_blkif_be_int(int irq, vo
  * DOWNWARD CALLS -- These interface with the block-device layer proper.
  */
 static int print_dbug =3D 1;
-static int do_block_io_op(blkif_t *blkif)
+static int _do_block_io_op(blkif_t *blkif)
 {
 	blkif_back_rings_t *blk_rings =3D &blkif->blk_rings;
 	blkif_request_t req;
@@ -1397,6 +1397,22 @@ static int do_block_io_op(blkif_t *blkif
 	return more_to_do;
 }
=20
+static int do_block_io_op(blkif_t *blkif)
+{
+	blkif_back_rings_t *blk_rings =3D &blkif->blk_rings;
+	int more_to_do;
+
+	do {
+		more_to_do =3D _do_block_io_op(blkif);
+		if (more_to_do)
+			break;
+
+		RING_FINAL_CHECK_FOR_REQUESTS(&blk_rings->common, =
more_to_do);
+	} while (more_to_do);
+
+	return more_to_do;
+}
+
 static void dispatch_rw_block_io(blkif_t *blkif,
 				 blkif_request_t *req,
 				 pending_req_t *pending_req)
@@ -1647,7 +1663,6 @@ static void make_response(blkif_t *blkif
 	blkif_response_t  resp;
 	unsigned long     flags;
 	blkif_back_rings_t *blk_rings =3D &blkif->blk_rings;
-	int more_to_do =3D 0;
 	int notify;
=20
 	resp.id        =3D id;
@@ -1678,20 +1693,7 @@ static void make_response(blkif_t *blkif
 	blk_rings->common.rsp_prod_pvt++;
 	RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&blk_rings->common, notify);
=20
-	if (blk_rings->common.rsp_prod_pvt =3D=3D blk_rings->common.req_con=
s) {
-		/*
-		 * Tail check for pending requests. Allows frontend to =
avoid
-		 * notifications if requests are already in flight (lower
-		 * overheads and promotes batching).
-		 */
-		RING_FINAL_CHECK_FOR_REQUESTS(&blk_rings->common, =
more_to_do);
-	} else if (RING_HAS_UNCONSUMED_REQUESTS(&blk_rings->common)) {
-		more_to_do =3D 1;
-	}
-
 	spin_unlock_irqrestore(&blkif->blk_ring_lock, flags);
-	if (more_to_do)
-		blkif_notify_work(blkif);
 	if (notify)
 		notify_remote_via_irq(blkif->irq);
 }




--=__PartCBFA3845.0__=
Content-Type: text/plain; name="xen-blktap-streamline.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-blktap-streamline.patch"

blktap: don't let in-flight requests defer pending ones=0A=0ARunning =
RING_FINAL_CHECK_FOR_REQUESTS from make_response is a bad=0Aidea. It means =
that in-flight I/O is essentially blocking continued=0Abatches. This =
essentially kills throughput on frontends which unplug=0A(or even just =
notify) early and rightfully assume additional requests=0Awill be picked =
up on time, not synchronously.=0A=0ADerived from a similar blkback patch =
by Daniel Stodden (see c/s=0A1118:c7c14595c18b).=0A=0ASigned-off-by: Jan =
Beulich <jbeulich@suse.com>=0A=0A--- a/drivers/xen/blktap/blktap.c=0A+++ =
b/drivers/xen/blktap/blktap.c=0A@@ -1285,7 +1285,7 @@ irqreturn_t =
tap_blkif_be_int(int irq, vo=0A  * DOWNWARD CALLS -- These interface with =
the block-device layer proper.=0A  */=0A static int print_dbug =3D =
1;=0A-static int do_block_io_op(blkif_t *blkif)=0A+static int _do_block_io_=
op(blkif_t *blkif)=0A {=0A 	blkif_back_rings_t *blk_rings =3D =
&blkif->blk_rings;=0A 	blkif_request_t req;=0A@@ -1397,6 +1397,22 @@ =
static int do_block_io_op(blkif_t *blkif=0A 	return more_to_do;=0A }=0A =
=0A+static int do_block_io_op(blkif_t *blkif)=0A+{=0A+	blkif_back_rings_t =
*blk_rings =3D &blkif->blk_rings;=0A+	int more_to_do;=0A+=0A+	do {=0A+	=
	more_to_do =3D _do_block_io_op(blkif);=0A+		if =
(more_to_do)=0A+			break;=0A+=0A+		RING_FINAL_=
CHECK_FOR_REQUESTS(&blk_rings->common, more_to_do);=0A+	} while (more_to_do=
);=0A+=0A+	return more_to_do;=0A+}=0A+=0A static void dispatch_rw_bloc=
k_io(blkif_t *blkif,=0A 				 blkif_request_t =
*req,=0A 				 pending_req_t *pending_req)=0A@@ =
-1647,7 +1663,6 @@ static void make_response(blkif_t *blkif=0A 	blkif_respo=
nse_t  resp;=0A 	unsigned long     flags;=0A 	blkif_back_rings_t =
*blk_rings =3D &blkif->blk_rings;=0A-	int more_to_do =3D 0;=0A 	=
int notify;=0A =0A 	resp.id        =3D id;=0A@@ -1678,20 +1693,7 @@ =
static void make_response(blkif_t *blkif=0A 	blk_rings->common.rsp_prod_=
pvt++;=0A 	RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&blk_rings->common, =
notify);=0A =0A-	if (blk_rings->common.rsp_prod_pvt =3D=3D =
blk_rings->common.req_cons) {=0A-		/*=0A-		 * Tail =
check for pending requests. Allows frontend to avoid=0A-		 * =
notifications if requests are already in flight (lower=0A-		 * =
overheads and promotes batching).=0A-		 */=0A-		RING_FINAL_=
CHECK_FOR_REQUESTS(&blk_rings->common, more_to_do);=0A-	} else if =
(RING_HAS_UNCONSUMED_REQUESTS(&blk_rings->common)) {=0A-		=
more_to_do =3D 1;=0A-	}=0A-=0A 	spin_unlock_irqrestore(&blkif->blk_=
ring_lock, flags);=0A-	if (more_to_do)=0A-		blkif_notify_work(b=
lkif);=0A 	if (notify)=0A 		notify_remote_via_irq(blkif->irq);=
=0A }=0A
--=__PartCBFA3845.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.xen.org
http://lists.xen.org/xen-devel

--=__PartCBFA3845.0__=--


From xen-devel-bounces@lists.xen.org Thu Nov 22 12:38:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 12:38:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbW2T-0001ER-JA; Thu, 22 Nov 2012 12:37:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TbW2R-0001EM-R7
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 12:37:52 +0000
Received: from [85.158.137.99:18269] by server-12.bemta-3.messagelabs.com id
	3D/40-22757-A9C1EA05; Thu, 22 Nov 2012 12:37:46 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353587864!20063593!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0NzMxMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20194 invoked from network); 22 Nov 2012 12:37:45 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-2.tower-217.messagelabs.com with SMTP;
	22 Nov 2012 12:37:45 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga101.fm.intel.com with ESMTP; 22 Nov 2012 04:37:43 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,300,1352102400"; 
	d="scan'208,217";a="251047228"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by fmsmga001.fm.intel.com with ESMTP; 22 Nov 2012 04:37:43 -0800
Received: from fmsmsx153.amr.corp.intel.com (10.19.17.7) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 22 Nov 2012 04:37:42 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX153.amr.corp.intel.com (10.19.17.7) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 22 Nov 2012 04:37:42 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Thu, 22 Nov 2012 20:37:41 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNx+IhWSR52N+j5UqhK6CjagaIUZf1y87A
Date: Thu, 22 Nov 2012 12:37:40 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353951D5@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZZq5obGskT0BGKMqEY+Mj4OtY-9DyhAcdo5XU9bidL2zg@mail.gmail.com>
In-Reply-To: <CAFLBxZZq5obGskT0BGKMqEY+Mj4OtY-9DyhAcdo5XU9bidL2zg@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5393238804832303754=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5393238804832303754==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_DE8DF0795D48FD4CA783C40EC82923353951D5SHSMSX101ccrcorpi_"

--_000_DE8DF0795D48FD4CA783C40EC82923353951D5SHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable



________________________________
From: dunlapg@gmail.com [mailto:dunlapg@gmail.com] On Behalf Of George Dunl=
ap
Sent: Wednesday, November 21, 2012 8:17 PM
To: Liu, Jinsong
Cc: Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regar=
d to migration

OK, so now that we seem to have agreed on the overall approach, down to "br=
ass tacks", as we say in English:

On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <jinsong.liu@intel.com<mailto:=
jinsong.liu@intel.com>> wrote:
Generally, there are 2 cases:
1. broken page occurs before migration
2. broken page occurs during migration

I think we probably need to include the "last iteration" subcases here as w=
ell -- although, probably it would be better to put them in the comments.  =
Also make sure to note that now even suspend may do a second iteration if p=
ages are broken during the suspend operation.

Also, what you should do is have the main description always say what the p=
atch does, and then at the bottom have a summary of the changes; for instan=
ce:

v4:
 - Adjust variables and patch description based on feedback
v3:
 - Handle pages broken on the last iteration
&c



We had submitted 2 versions of patches. Their difference is how to handle c=
ase 2:
V1 patch aborted migration for the case 'broken page occurs during migratio=
n';
V2 patch marked broken page to dirty bitmap then got handled next round and=
 no abort;

This is V3 patch, adding handle for vMCE occur at last iteration of migrati=
on:
At the sender
  For case 1, the broken page will be mapped but not copied to target
  (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number will be transferred to target
  so that target take appropriate action.

  For case 2, mce handler marks the broken page to dirty bitmap, so that
  at copypages stage of migration, its pfn_type and pfn number will be
  transferred to target and then take appropriate action.

At the target
  When migration target populates pages for guest. As for the case
  of broken page wrt migration, we prefer to keep the type of the page,
  for the sake of seamless migration.

  At target it will set p2m as p2m_ram_broken for broken page. Guest MCE
  may have good chance to handle its broken page, while if guest access
  the broken page again it will kill itself as expected.

If vMCE occur at the last memory copy iteration of migration, we do one mor=
e
iteration so that the broken page's pfn_type and pfn number has chance to
be transferred to target.

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunl=
ap@eu.citrix.com>>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com<mailto:jinsong.liu@intel.=
com>>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunlap@e=
u.citrix.com>>

- for tools part of the patch
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com<mailto:Ian.Jackson@eu.citr=
ix.com>>

You should remove these until you get another ack (since the patch has chan=
ged materially)


- for hypervisor part of the patch
Acked-by: Jan Beulich <JBeulich@suse.com<mailto:JBeulich@suse.com>>

I think if you haven't changed the HV part since his ack, you can probably =
leave this one.

Jan, for hypervisor side your opinion of acked-by ? I'm updating to V4.

Thanks,
Jinsong

--_000_DE8DF0795D48FD4CA783C40EC82923353951D5SHSMSX101ccrcorpi_
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=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"GENERATOR" content=3D"MSHTML 8.00.6001.19328">
</head>
<body>
<div dir=3D"ltr" align=3D"left"><font color=3D"#0000ff" size=3D"2" face=3D"=
&#23435;&#20307;"></font>&nbsp;</div>
<br>
<div dir=3D"ltr" lang=3D"en-us" class=3D"OutlookMessageHeader" align=3D"lef=
t">
<hr tabindex=3D"-1">
<font size=3D"2" face=3D"Tahoma"><b>From:</b> dunlapg@gmail.com [mailto:dun=
lapg@gmail.com]
<b>On Behalf Of </b>George Dunlap<br>
<b>Sent:</b> Wednesday, November 21, 2012 8:17 PM<br>
<b>To:</b> Liu, Jinsong<br>
<b>Cc:</b> Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensourc=
e.com<br>
<b>Subject:</b> Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page wit=
h regard to migration<br>
</font><br>
</div>
<div></div>
OK, so now that we seem to have agreed on the overall approach, down to &qu=
ot;brass tacks&quot;, as we say in English:<br>
<br>
<div class=3D"gmail_extra">On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <sp=
an dir=3D"ltr">
&lt;<a href=3D"mailto:jinsong.liu@intel.com" target=3D"_blank">jinsong.liu@=
intel.com</a>&gt;</span> wrote:<br>
<div class=3D"gmail_quote">
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<div class=3D"im">Generally, there are 2 cases:<br>
1. broken page occurs before migration<br>
2. broken page occurs during migration<br>
</div>
</blockquote>
<div><br>
I think we probably need to include the &quot;last iteration&quot; subcases=
 here as well -- although, probably it would be better to put them in the c=
omments.&nbsp; Also make sure to note that now even suspend may do a second=
 iteration if pages are broken during the suspend
 operation.<br>
<br>
Also, what you should do is have the main description always say what the p=
atch does, and then at the bottom have a summary of the changes; for instan=
ce:<br>
<br>
v4: <br>
&nbsp;- Adjust variables and patch description based on feedback<br>
v3: <br>
&nbsp;- Handle pages broken on the last iteration<br>
&amp;c<br>
&nbsp;<br>
<br>
</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<div class=3D"im"><br>
</div>
We had submitted 2 versions of patches. Their difference is how to handle c=
ase 2:<br>
V1 patch aborted migration for the case 'broken page occurs during migratio=
n';<br>
V2 patch marked broken page to dirty bitmap then got handled next round and=
 no abort;<br>
<br>
This is V3 patch, adding handle for vMCE occur at last iteration of migrati=
on:<br>
At the sender<br>
&nbsp; For case 1, the broken page will be mapped but not copied to target<=
br>
<div class=3D"im">&nbsp; (otherwise it may trigger more serious error, say,=
 SRAR error).<br>
</div>
&nbsp; While its pfn_type and pfn number will be transferred to target<br>
<div class=3D"im">&nbsp; so that target take appropriate action.<br>
<br>
&nbsp; For case 2, mce handler marks the broken page to dirty bitmap, so th=
at<br>
</div>
&nbsp; at copypages stage of migration, its pfn_type and pfn number will be=
<br>
<div class=3D"im">&nbsp; transferred to target and then take appropriate ac=
tion.<br>
<br>
At the target<br>
</div>
&nbsp; When migration target populates pages for guest. As for the case<br>
&nbsp; of broken page wrt migration, we prefer to keep the type of the page=
,<br>
<div class=3D"im">&nbsp; for the sake of seamless migration.<br>
<br>
</div>
&nbsp; At target it will set p2m as p2m_ram_broken for broken page. Guest M=
CE<br>
<div class=3D"im">&nbsp; may have good chance to handle its broken page, wh=
ile if guest access<br>
</div>
&nbsp; the broken page again it will kill itself as expected.<br>
<br>
If vMCE occur at the last memory copy iteration of migration, we do one mor=
e<br>
iteration so that the broken page's pfn_type and pfn number has chance to<b=
r>
be transferred to target.<br>
<div class=3D"im"><br>
Suggested-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.c=
om">george.dunlap@eu.citrix.com</a>&gt;<br>
Signed-off-by: Liu Jinsong &lt;<a href=3D"mailto:jinsong.liu@intel.com">jin=
song.liu@intel.com</a>&gt;<br>
Acked-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">=
george.dunlap@eu.citrix.com</a>&gt;<br>
<br>
</div>
- for tools part of the patch<br>
Acked-by: Ian Jackson &lt;<a href=3D"mailto:Ian.Jackson@eu.citrix.com">Ian.=
Jackson@eu.citrix.com</a>&gt;<br>
</blockquote>
<div><br>
You should remove these until you get another ack (since the patch has chan=
ged materially)<br>
&nbsp;</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<br>
- for hypervisor part of the patch<br>
Acked-by: Jan Beulich &lt;<a href=3D"mailto:JBeulich@suse.com">JBeulich@sus=
e.com</a>&gt;<br>
</blockquote>
<div><br>
I think if you haven't changed the HV part since his ack, you can probably =
leave this one.<br>
<span class=3D"587593412-22112012"><font color=3D"#0000ff" size=3D"2" face=
=3D"&#23435;&#20307;"></font></span></div>
<div><span class=3D"587593412-22112012"></span>&nbsp;</div>
<div><span class=3D"587593412-22112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"&#23435;&#20307;">Jan,&nbsp;for hypervisor side your opinion of&nbs=
p;acked-by</font>&nbsp;<font color=3D"#0000ff" size=3D"2" face=3D"&#23435;&=
#20307;">? I'm updating to V4.</font></span></div>
<div><span class=3D"587593412-22112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"&#23435;&#20307;"></font></span>&nbsp;</div>
<div><span class=3D"587593412-22112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"&#23435;&#20307;">Thanks,</font></span></div>
<div><span class=3D"587593412-22112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"&#23435;&#20307;">Jinsong</font></span></div>
</div>
</div>
</body>
</html>

--_000_DE8DF0795D48FD4CA783C40EC82923353951D5SHSMSX101ccrcorpi_--


--===============5393238804832303754==
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.xen.org
http://lists.xen.org/xen-devel

--===============5393238804832303754==--


From xen-devel-bounces@lists.xen.org Thu Nov 22 12:38:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 12:38:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbW2T-0001ER-JA; Thu, 22 Nov 2012 12:37:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TbW2R-0001EM-R7
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 12:37:52 +0000
Received: from [85.158.137.99:18269] by server-12.bemta-3.messagelabs.com id
	3D/40-22757-A9C1EA05; Thu, 22 Nov 2012 12:37:46 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353587864!20063593!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0NzMxMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20194 invoked from network); 22 Nov 2012 12:37:45 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-2.tower-217.messagelabs.com with SMTP;
	22 Nov 2012 12:37:45 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga101.fm.intel.com with ESMTP; 22 Nov 2012 04:37:43 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,300,1352102400"; 
	d="scan'208,217";a="251047228"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by fmsmga001.fm.intel.com with ESMTP; 22 Nov 2012 04:37:43 -0800
Received: from fmsmsx153.amr.corp.intel.com (10.19.17.7) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 22 Nov 2012 04:37:42 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX153.amr.corp.intel.com (10.19.17.7) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 22 Nov 2012 04:37:42 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Thu, 22 Nov 2012 20:37:41 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNx+IhWSR52N+j5UqhK6CjagaIUZf1y87A
Date: Thu, 22 Nov 2012 12:37:40 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353951D5@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZZq5obGskT0BGKMqEY+Mj4OtY-9DyhAcdo5XU9bidL2zg@mail.gmail.com>
In-Reply-To: <CAFLBxZZq5obGskT0BGKMqEY+Mj4OtY-9DyhAcdo5XU9bidL2zg@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5393238804832303754=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5393238804832303754==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_DE8DF0795D48FD4CA783C40EC82923353951D5SHSMSX101ccrcorpi_"

--_000_DE8DF0795D48FD4CA783C40EC82923353951D5SHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable



________________________________
From: dunlapg@gmail.com [mailto:dunlapg@gmail.com] On Behalf Of George Dunl=
ap
Sent: Wednesday, November 21, 2012 8:17 PM
To: Liu, Jinsong
Cc: Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regar=
d to migration

OK, so now that we seem to have agreed on the overall approach, down to "br=
ass tacks", as we say in English:

On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <jinsong.liu@intel.com<mailto:=
jinsong.liu@intel.com>> wrote:
Generally, there are 2 cases:
1. broken page occurs before migration
2. broken page occurs during migration

I think we probably need to include the "last iteration" subcases here as w=
ell -- although, probably it would be better to put them in the comments.  =
Also make sure to note that now even suspend may do a second iteration if p=
ages are broken during the suspend operation.

Also, what you should do is have the main description always say what the p=
atch does, and then at the bottom have a summary of the changes; for instan=
ce:

v4:
 - Adjust variables and patch description based on feedback
v3:
 - Handle pages broken on the last iteration
&c



We had submitted 2 versions of patches. Their difference is how to handle c=
ase 2:
V1 patch aborted migration for the case 'broken page occurs during migratio=
n';
V2 patch marked broken page to dirty bitmap then got handled next round and=
 no abort;

This is V3 patch, adding handle for vMCE occur at last iteration of migrati=
on:
At the sender
  For case 1, the broken page will be mapped but not copied to target
  (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number will be transferred to target
  so that target take appropriate action.

  For case 2, mce handler marks the broken page to dirty bitmap, so that
  at copypages stage of migration, its pfn_type and pfn number will be
  transferred to target and then take appropriate action.

At the target
  When migration target populates pages for guest. As for the case
  of broken page wrt migration, we prefer to keep the type of the page,
  for the sake of seamless migration.

  At target it will set p2m as p2m_ram_broken for broken page. Guest MCE
  may have good chance to handle its broken page, while if guest access
  the broken page again it will kill itself as expected.

If vMCE occur at the last memory copy iteration of migration, we do one mor=
e
iteration so that the broken page's pfn_type and pfn number has chance to
be transferred to target.

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunl=
ap@eu.citrix.com>>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com<mailto:jinsong.liu@intel.=
com>>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunlap@e=
u.citrix.com>>

- for tools part of the patch
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com<mailto:Ian.Jackson@eu.citr=
ix.com>>

You should remove these until you get another ack (since the patch has chan=
ged materially)


- for hypervisor part of the patch
Acked-by: Jan Beulich <JBeulich@suse.com<mailto:JBeulich@suse.com>>

I think if you haven't changed the HV part since his ack, you can probably =
leave this one.

Jan, for hypervisor side your opinion of acked-by ? I'm updating to V4.

Thanks,
Jinsong

--_000_DE8DF0795D48FD4CA783C40EC82923353951D5SHSMSX101ccrcorpi_
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=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"GENERATOR" content=3D"MSHTML 8.00.6001.19328">
</head>
<body>
<div dir=3D"ltr" align=3D"left"><font color=3D"#0000ff" size=3D"2" face=3D"=
&#23435;&#20307;"></font>&nbsp;</div>
<br>
<div dir=3D"ltr" lang=3D"en-us" class=3D"OutlookMessageHeader" align=3D"lef=
t">
<hr tabindex=3D"-1">
<font size=3D"2" face=3D"Tahoma"><b>From:</b> dunlapg@gmail.com [mailto:dun=
lapg@gmail.com]
<b>On Behalf Of </b>George Dunlap<br>
<b>Sent:</b> Wednesday, November 21, 2012 8:17 PM<br>
<b>To:</b> Liu, Jinsong<br>
<b>Cc:</b> Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensourc=
e.com<br>
<b>Subject:</b> Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page wit=
h regard to migration<br>
</font><br>
</div>
<div></div>
OK, so now that we seem to have agreed on the overall approach, down to &qu=
ot;brass tacks&quot;, as we say in English:<br>
<br>
<div class=3D"gmail_extra">On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <sp=
an dir=3D"ltr">
&lt;<a href=3D"mailto:jinsong.liu@intel.com" target=3D"_blank">jinsong.liu@=
intel.com</a>&gt;</span> wrote:<br>
<div class=3D"gmail_quote">
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<div class=3D"im">Generally, there are 2 cases:<br>
1. broken page occurs before migration<br>
2. broken page occurs during migration<br>
</div>
</blockquote>
<div><br>
I think we probably need to include the &quot;last iteration&quot; subcases=
 here as well -- although, probably it would be better to put them in the c=
omments.&nbsp; Also make sure to note that now even suspend may do a second=
 iteration if pages are broken during the suspend
 operation.<br>
<br>
Also, what you should do is have the main description always say what the p=
atch does, and then at the bottom have a summary of the changes; for instan=
ce:<br>
<br>
v4: <br>
&nbsp;- Adjust variables and patch description based on feedback<br>
v3: <br>
&nbsp;- Handle pages broken on the last iteration<br>
&amp;c<br>
&nbsp;<br>
<br>
</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<div class=3D"im"><br>
</div>
We had submitted 2 versions of patches. Their difference is how to handle c=
ase 2:<br>
V1 patch aborted migration for the case 'broken page occurs during migratio=
n';<br>
V2 patch marked broken page to dirty bitmap then got handled next round and=
 no abort;<br>
<br>
This is V3 patch, adding handle for vMCE occur at last iteration of migrati=
on:<br>
At the sender<br>
&nbsp; For case 1, the broken page will be mapped but not copied to target<=
br>
<div class=3D"im">&nbsp; (otherwise it may trigger more serious error, say,=
 SRAR error).<br>
</div>
&nbsp; While its pfn_type and pfn number will be transferred to target<br>
<div class=3D"im">&nbsp; so that target take appropriate action.<br>
<br>
&nbsp; For case 2, mce handler marks the broken page to dirty bitmap, so th=
at<br>
</div>
&nbsp; at copypages stage of migration, its pfn_type and pfn number will be=
<br>
<div class=3D"im">&nbsp; transferred to target and then take appropriate ac=
tion.<br>
<br>
At the target<br>
</div>
&nbsp; When migration target populates pages for guest. As for the case<br>
&nbsp; of broken page wrt migration, we prefer to keep the type of the page=
,<br>
<div class=3D"im">&nbsp; for the sake of seamless migration.<br>
<br>
</div>
&nbsp; At target it will set p2m as p2m_ram_broken for broken page. Guest M=
CE<br>
<div class=3D"im">&nbsp; may have good chance to handle its broken page, wh=
ile if guest access<br>
</div>
&nbsp; the broken page again it will kill itself as expected.<br>
<br>
If vMCE occur at the last memory copy iteration of migration, we do one mor=
e<br>
iteration so that the broken page's pfn_type and pfn number has chance to<b=
r>
be transferred to target.<br>
<div class=3D"im"><br>
Suggested-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.c=
om">george.dunlap@eu.citrix.com</a>&gt;<br>
Signed-off-by: Liu Jinsong &lt;<a href=3D"mailto:jinsong.liu@intel.com">jin=
song.liu@intel.com</a>&gt;<br>
Acked-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">=
george.dunlap@eu.citrix.com</a>&gt;<br>
<br>
</div>
- for tools part of the patch<br>
Acked-by: Ian Jackson &lt;<a href=3D"mailto:Ian.Jackson@eu.citrix.com">Ian.=
Jackson@eu.citrix.com</a>&gt;<br>
</blockquote>
<div><br>
You should remove these until you get another ack (since the patch has chan=
ged materially)<br>
&nbsp;</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<br>
- for hypervisor part of the patch<br>
Acked-by: Jan Beulich &lt;<a href=3D"mailto:JBeulich@suse.com">JBeulich@sus=
e.com</a>&gt;<br>
</blockquote>
<div><br>
I think if you haven't changed the HV part since his ack, you can probably =
leave this one.<br>
<span class=3D"587593412-22112012"><font color=3D"#0000ff" size=3D"2" face=
=3D"&#23435;&#20307;"></font></span></div>
<div><span class=3D"587593412-22112012"></span>&nbsp;</div>
<div><span class=3D"587593412-22112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"&#23435;&#20307;">Jan,&nbsp;for hypervisor side your opinion of&nbs=
p;acked-by</font>&nbsp;<font color=3D"#0000ff" size=3D"2" face=3D"&#23435;&=
#20307;">? I'm updating to V4.</font></span></div>
<div><span class=3D"587593412-22112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"&#23435;&#20307;"></font></span>&nbsp;</div>
<div><span class=3D"587593412-22112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"&#23435;&#20307;">Thanks,</font></span></div>
<div><span class=3D"587593412-22112012"><font color=3D"#0000ff" size=3D"2" =
face=3D"&#23435;&#20307;">Jinsong</font></span></div>
</div>
</div>
</body>
</html>

--_000_DE8DF0795D48FD4CA783C40EC82923353951D5SHSMSX101ccrcorpi_--


--===============5393238804832303754==
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.xen.org
http://lists.xen.org/xen-devel

--===============5393238804832303754==--


From xen-devel-bounces@lists.xen.org Thu Nov 22 12:38:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 12:38:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbW36-0001HN-6U; Thu, 22 Nov 2012 12:38:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TbW34-0001H9-P1
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 12:38:31 +0000
Received: from [85.158.138.51:36786] by server-13.bemta-3.messagelabs.com id
	1F/43-24887-5CC1EA05; Thu, 22 Nov 2012 12:38:29 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353587909!31014674!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17645 invoked from network); 22 Nov 2012 12:38:29 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 12:38:29 -0000
Received: by mail-ea0-f173.google.com with SMTP id i13so3801818eaa.32
	for <xen-devel@lists.xen.org>; Thu, 22 Nov 2012 04:38:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=oYpGoM+V2CLxlhEk60uuVdacrQ+qbLwaEZa9puTJykc=;
	b=dWL5Fm856ni4Xa5LvLF95wCOlmaIJ+qpjMzb6LFFJ3wdMtlElHYMhFBzZNZXpE5sqr
	hz/JUAfcyeUG5fEfCov7JBp0KUnN+QcSzNC9e6/g0HLlRkDYbUreDiM+WYVxKmPsnuZC
	gvc+2Vuh9nEPLrZQKVjEWKilWAsyMsKC1UgiqP60Gp0uC7QjaWv+pXxqSLFSLCXZh5LX
	Gg59uLRmVD8h7NXibfNK76XjPXPdQ7CbLfDuD98CYYril23i+rYp67PI1ZGh2lzG2bR0
	MlHjiCUScowpxLb1UR3BBDCfBnjl8TqCU0j2Pyfqc3K9eG9GFLKI4FvgI/a/VxXWxsfC
	xvBw==
Received: by 10.14.3.195 with SMTP id 43mr1099594eeh.36.1353587908544;
	Thu, 22 Nov 2012 04:38:28 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id k2sm6706361eep.15.2012.11.22.04.38.25
	(version=SSLv3 cipher=OTHER); Thu, 22 Nov 2012 04:38:27 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 22 Nov 2012 12:38:22 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Message-ID: <CCD3CD3E.452D4%keir.xen@gmail.com>
Thread-Topic: freezing of kernel threads
Thread-Index: Ac3IrkH0Q/Wtc+FiJU2/4WU8MUNUuQ==
In-Reply-To: <50AE18CA02000078000AA90F@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] freezing of kernel threads
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/2012 11:21, "Jan Beulich" <JBeulich@suse.com> wrote:

> Keir,
> 
> in linux-2.6.18-xen.hg c/s 74:cb50d25a9468 you made blktap
> match blkback in calling try_to_freeze() from the main thread loop.
> Threads in other drivers didn't get changed, though. Is there a
> particular reason why only block, and only backend, threads are in
> need of this (the only other one using it is xenfb_thread())?

I don't really recall. I expect someone pointed out the difference between
the two drivers and so I added the call to blktap. Back then I don't know
that any of our other drivers had kthreads?

 -- Keir

> Konrad, as of 2.6.23 kernel threads are non-freezable by default,
> i.e. xen-blkback calling try_to_freeze() is completely pointless
> without a prior call to set_freezable(). Also, in case the latter is to
> be added, switching to wait_event_freezable() instead of the
> direct use of try_to_freeze() might be the right way to go.
> 
> Jan
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 12:38:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 12:38:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbW36-0001HN-6U; Thu, 22 Nov 2012 12:38:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TbW34-0001H9-P1
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 12:38:31 +0000
Received: from [85.158.138.51:36786] by server-13.bemta-3.messagelabs.com id
	1F/43-24887-5CC1EA05; Thu, 22 Nov 2012 12:38:29 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353587909!31014674!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17645 invoked from network); 22 Nov 2012 12:38:29 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 12:38:29 -0000
Received: by mail-ea0-f173.google.com with SMTP id i13so3801818eaa.32
	for <xen-devel@lists.xen.org>; Thu, 22 Nov 2012 04:38:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=oYpGoM+V2CLxlhEk60uuVdacrQ+qbLwaEZa9puTJykc=;
	b=dWL5Fm856ni4Xa5LvLF95wCOlmaIJ+qpjMzb6LFFJ3wdMtlElHYMhFBzZNZXpE5sqr
	hz/JUAfcyeUG5fEfCov7JBp0KUnN+QcSzNC9e6/g0HLlRkDYbUreDiM+WYVxKmPsnuZC
	gvc+2Vuh9nEPLrZQKVjEWKilWAsyMsKC1UgiqP60Gp0uC7QjaWv+pXxqSLFSLCXZh5LX
	Gg59uLRmVD8h7NXibfNK76XjPXPdQ7CbLfDuD98CYYril23i+rYp67PI1ZGh2lzG2bR0
	MlHjiCUScowpxLb1UR3BBDCfBnjl8TqCU0j2Pyfqc3K9eG9GFLKI4FvgI/a/VxXWxsfC
	xvBw==
Received: by 10.14.3.195 with SMTP id 43mr1099594eeh.36.1353587908544;
	Thu, 22 Nov 2012 04:38:28 -0800 (PST)
Received: from [192.168.1.88] (host86-178-46-35.range86-178.btcentralplus.com.
	[86.178.46.35])
	by mx.google.com with ESMTPS id k2sm6706361eep.15.2012.11.22.04.38.25
	(version=SSLv3 cipher=OTHER); Thu, 22 Nov 2012 04:38:27 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 22 Nov 2012 12:38:22 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Message-ID: <CCD3CD3E.452D4%keir.xen@gmail.com>
Thread-Topic: freezing of kernel threads
Thread-Index: Ac3IrkH0Q/Wtc+FiJU2/4WU8MUNUuQ==
In-Reply-To: <50AE18CA02000078000AA90F@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] freezing of kernel threads
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/2012 11:21, "Jan Beulich" <JBeulich@suse.com> wrote:

> Keir,
> 
> in linux-2.6.18-xen.hg c/s 74:cb50d25a9468 you made blktap
> match blkback in calling try_to_freeze() from the main thread loop.
> Threads in other drivers didn't get changed, though. Is there a
> particular reason why only block, and only backend, threads are in
> need of this (the only other one using it is xenfb_thread())?

I don't really recall. I expect someone pointed out the difference between
the two drivers and so I added the call to blktap. Back then I don't know
that any of our other drivers had kthreads?

 -- Keir

> Konrad, as of 2.6.23 kernel threads are non-freezable by default,
> i.e. xen-blkback calling try_to_freeze() is completely pointless
> without a prior call to set_freezable(). Also, in case the latter is to
> be added, switching to wait_event_freezable() instead of the
> direct use of try_to_freeze() might be the right way to go.
> 
> Jan
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 12:58:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 12:58:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbWLr-0001rC-7o; Thu, 22 Nov 2012 12:57:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbWLp-0001r7-Cq
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 12:57:53 +0000
Received: from [85.158.139.83:15399] by server-16.bemta-5.messagelabs.com id
	FB/0A-04786-0512EA05; Thu, 22 Nov 2012 12:57:52 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353589070!20180793!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29410 invoked from network); 22 Nov 2012 12:57:51 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 12:57:51 -0000
X-IronPort-AV: E=Sophos;i="4.83,300,1352073600"; d="scan'208";a="45396705"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 12:57:50 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 07:57:49 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbWLl-0004lV-Dv;
	Thu, 22 Nov 2012 12:57:49 +0000
Message-ID: <50AE214D.2080304@citrix.com>
Date: Thu, 22 Nov 2012 12:57:49 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, 
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
X-Enigmail-Version: 1.4.6
Subject: [Xen-devel] blkfront failure on migrate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

A friend of mine was having weird ocasional crashes on migration, and I
took a look at the problem

The VM is a very stripped down ubuntu 12.04 environment (3.2.0 kernel)
with a total of 96MB of RAM, but this appears to be a generic driver
problem still present in upstream.

The symptoms were that on about 5% of migrations, one or more block
devices would fail to come back on resume.

The relevant snippets of dmesg are:

[6673983.756117] xenwatch: page allocation failure: order:5, mode:0x4430
[6673983.756123] Pid: 12, comm: xenwatch Not tainted 3.2.0-29-virtual
#46-Ubuntu
...
[6673983.756155]  [<c01fdaac>] __get_free_pages+0x1c/0x30
[6673983.756161]  [<c0232dd7>] kmalloc_order_trace+0x27/0xa0
[6673983.756165]  [<c04998b1>] blkif_recover+0x71/0x550
[6673983.756168]  [<c0499de5>] blkfront_resume+0x55/0x60
[6673983.756172]  [<c044502a>] xenbus_dev_resume+0x4a/0x100
[6673983.756176]  [<c048a2ad>] pm_op+0x17d/0x1a0
...
[6673983.756737] xenbus: resume vbd-51712 failed: -12
[6673983.756743] pm_op(): xenbus_dev_resume+0x0/0x100 returns -12
[6673983.756759] PM: Device vbd-51712 failed to restore: error -12
[6673983.867532] PM: restore of devices complete after 182.808 msecs

Looking at the code in blkif_recover
(http://lxr.linux.no/#linux+v3.6.7/drivers/block/xen-blkfront.c#L1054)

In "Stage 1" as commented, we make a copy of the shadow map.  We then
reset the contents of the real shadow map, and selectively copy the
in-use entries back from the copy to the real map.

Looking at the code, it appears possible to do this rearranging inplace
in the real shadow map, without requiring any memory allocation.

Is this a sensible suggestion or have I overlooked something?  This
order-5 allocation is a disaster lying in wait for VMs with high memory
pressure.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 12:58:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 12:58:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbWLr-0001rC-7o; Thu, 22 Nov 2012 12:57:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbWLp-0001r7-Cq
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 12:57:53 +0000
Received: from [85.158.139.83:15399] by server-16.bemta-5.messagelabs.com id
	FB/0A-04786-0512EA05; Thu, 22 Nov 2012 12:57:52 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353589070!20180793!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29410 invoked from network); 22 Nov 2012 12:57:51 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 12:57:51 -0000
X-IronPort-AV: E=Sophos;i="4.83,300,1352073600"; d="scan'208";a="45396705"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 12:57:50 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 07:57:49 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbWLl-0004lV-Dv;
	Thu, 22 Nov 2012 12:57:49 +0000
Message-ID: <50AE214D.2080304@citrix.com>
Date: Thu, 22 Nov 2012 12:57:49 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, 
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
X-Enigmail-Version: 1.4.6
Subject: [Xen-devel] blkfront failure on migrate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

A friend of mine was having weird ocasional crashes on migration, and I
took a look at the problem

The VM is a very stripped down ubuntu 12.04 environment (3.2.0 kernel)
with a total of 96MB of RAM, but this appears to be a generic driver
problem still present in upstream.

The symptoms were that on about 5% of migrations, one or more block
devices would fail to come back on resume.

The relevant snippets of dmesg are:

[6673983.756117] xenwatch: page allocation failure: order:5, mode:0x4430
[6673983.756123] Pid: 12, comm: xenwatch Not tainted 3.2.0-29-virtual
#46-Ubuntu
...
[6673983.756155]  [<c01fdaac>] __get_free_pages+0x1c/0x30
[6673983.756161]  [<c0232dd7>] kmalloc_order_trace+0x27/0xa0
[6673983.756165]  [<c04998b1>] blkif_recover+0x71/0x550
[6673983.756168]  [<c0499de5>] blkfront_resume+0x55/0x60
[6673983.756172]  [<c044502a>] xenbus_dev_resume+0x4a/0x100
[6673983.756176]  [<c048a2ad>] pm_op+0x17d/0x1a0
...
[6673983.756737] xenbus: resume vbd-51712 failed: -12
[6673983.756743] pm_op(): xenbus_dev_resume+0x0/0x100 returns -12
[6673983.756759] PM: Device vbd-51712 failed to restore: error -12
[6673983.867532] PM: restore of devices complete after 182.808 msecs

Looking at the code in blkif_recover
(http://lxr.linux.no/#linux+v3.6.7/drivers/block/xen-blkfront.c#L1054)

In "Stage 1" as commented, we make a copy of the shadow map.  We then
reset the contents of the real shadow map, and selectively copy the
in-use entries back from the copy to the real map.

Looking at the code, it appears possible to do this rearranging inplace
in the real shadow map, without requiring any memory allocation.

Is this a sensible suggestion or have I overlooked something?  This
order-5 allocation is a disaster lying in wait for VMs with high memory
pressure.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 13:36:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 13:36:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbWwd-0002SL-AD; Thu, 22 Nov 2012 13:35:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbWwb-0002SG-Mg
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 13:35:53 +0000
Received: from [85.158.143.99:64174] by server-2.bemta-4.messagelabs.com id
	EE/6B-28922-83A2EA05; Thu, 22 Nov 2012 13:35:52 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1353591351!20933809!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29027 invoked from network); 22 Nov 2012 13:35:52 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-216.messagelabs.com with SMTP;
	22 Nov 2012 13:35:52 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 13:35:50 +0000
Message-Id: <50AE387F02000078000AA99F@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 13:36:47 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Jinsong Liu" <jinsong.liu@intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZZq5obGskT0BGKMqEY+Mj4OtY-9DyhAcdo5XU9bidL2zg@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353951D5@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923353951D5@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 13:37, "Liu, Jinsong" <jinsong.liu@intel.com> wrote:
> - for hypervisor part of the patch
> Acked-by: Jan Beulich <JBeulich@suse.com<mailto:JBeulich@suse.com>>
> 
> I think if you haven't changed the HV part since his ack, you can probably 
> leave this one.
> 
> Jan, for hypervisor side your opinion of acked-by ? I'm updating to V4.

As George said - if you didn't change the hypervisor bits, you
can keep the ack. Else remove it.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 13:36:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 13:36:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbWwd-0002SL-AD; Thu, 22 Nov 2012 13:35:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbWwb-0002SG-Mg
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 13:35:53 +0000
Received: from [85.158.143.99:64174] by server-2.bemta-4.messagelabs.com id
	EE/6B-28922-83A2EA05; Thu, 22 Nov 2012 13:35:52 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1353591351!20933809!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29027 invoked from network); 22 Nov 2012 13:35:52 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-216.messagelabs.com with SMTP;
	22 Nov 2012 13:35:52 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 13:35:50 +0000
Message-Id: <50AE387F02000078000AA99F@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 13:36:47 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Jinsong Liu" <jinsong.liu@intel.com>
References: <446f6b9bfc89137e1aa0.1353117881@ljsromley.bj.intel.com>
	<CAFLBxZZq5obGskT0BGKMqEY+Mj4OtY-9DyhAcdo5XU9bidL2zg@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353951D5@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923353951D5@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 13:37, "Liu, Jinsong" <jinsong.liu@intel.com> wrote:
> - for hypervisor part of the patch
> Acked-by: Jan Beulich <JBeulich@suse.com<mailto:JBeulich@suse.com>>
> 
> I think if you haven't changed the HV part since his ack, you can probably 
> leave this one.
> 
> Jan, for hypervisor side your opinion of acked-by ? I'm updating to V4.

As George said - if you didn't change the hypervisor bits, you
can keep the ack. Else remove it.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 13:45:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 13:45:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbX5z-0002hq-EP; Thu, 22 Nov 2012 13:45:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbX5x-0002hl-7o
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 13:45:33 +0000
Received: from [85.158.143.99:48462] by server-3.bemta-4.messagelabs.com id
	F8/A1-06841-C7C2EA05; Thu, 22 Nov 2012 13:45:32 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1353591930!25701498!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21225 invoked from network); 22 Nov 2012 13:45:31 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-216.messagelabs.com with SMTP;
	22 Nov 2012 13:45:31 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 13:45:30 +0000
Message-Id: <50AE3AC102000078000AA9B3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 13:46:25 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>
References: <50AE214D.2080304@citrix.com>
In-Reply-To: <50AE214D.2080304@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] blkfront failure on migrate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 13:57, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> In "Stage 1" as commented, we make a copy of the shadow map.  We then
> reset the contents of the real shadow map, and selectively copy the
> in-use entries back from the copy to the real map.
> 
> Looking at the code, it appears possible to do this rearranging inplace
> in the real shadow map, without requiring any memory allocation.
> 
> Is this a sensible suggestion or have I overlooked something?  This
> order-5 allocation is a disaster lying in wait for VMs with high memory
> pressure.

While merging the multi-page ring patches, I think I tried to make
this an in place copy operation, and it didn't work (don't recall
details though). This and/or the need to deal with shrinking ring
size across migration (maybe that was what really didn't work)
made me move stage 3 to kick_pending_request_queues(), and
allocate entries that actually need copying one by one, sticking
them on a list.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 13:45:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 13:45:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbX5z-0002hq-EP; Thu, 22 Nov 2012 13:45:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbX5x-0002hl-7o
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 13:45:33 +0000
Received: from [85.158.143.99:48462] by server-3.bemta-4.messagelabs.com id
	F8/A1-06841-C7C2EA05; Thu, 22 Nov 2012 13:45:32 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1353591930!25701498!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21225 invoked from network); 22 Nov 2012 13:45:31 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-216.messagelabs.com with SMTP;
	22 Nov 2012 13:45:31 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 13:45:30 +0000
Message-Id: <50AE3AC102000078000AA9B3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 13:46:25 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>
References: <50AE214D.2080304@citrix.com>
In-Reply-To: <50AE214D.2080304@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] blkfront failure on migrate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 13:57, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> In "Stage 1" as commented, we make a copy of the shadow map.  We then
> reset the contents of the real shadow map, and selectively copy the
> in-use entries back from the copy to the real map.
> 
> Looking at the code, it appears possible to do this rearranging inplace
> in the real shadow map, without requiring any memory allocation.
> 
> Is this a sensible suggestion or have I overlooked something?  This
> order-5 allocation is a disaster lying in wait for VMs with high memory
> pressure.

While merging the multi-page ring patches, I think I tried to make
this an in place copy operation, and it didn't work (don't recall
details though). This and/or the need to deal with shrinking ring
size across migration (maybe that was what really didn't work)
made me move stage 3 to kick_pending_request_queues(), and
allocate entries that actually need copying one by one, sticking
them on a list.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 13:56:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 13:56:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbXGB-0002xD-Is; Thu, 22 Nov 2012 13:56:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TbXGA-0002x8-23
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 13:56:06 +0000
Received: from [85.158.139.83:5776] by server-8.bemta-5.messagelabs.com id
	54/33-06050-5FE2EA05; Thu, 22 Nov 2012 13:56:05 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-12.tower-182.messagelabs.com!1353592563!31445145!1
X-Originating-IP: [81.169.146.161]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA0OTkwNzk=\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA0OTkwNzk=\n,UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3678 invoked from network); 22 Nov 2012 13:56:04 -0000
Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.161)
	by server-12.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 22 Nov 2012 13:56:04 -0000
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmwtM48/ll287oFL0=
X-RZG-CLASS-ID: mo00
Received: from probook.site
	(dslb-084-057-082-036.pools.arcor-ip.net [84.57.82.36])
	by smtp.strato.de (joses mo3) (RZmta 31.5 DYNA|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id g06e94oAMDI5WN
	for <xen-devel@lists.xen.org>; Thu, 22 Nov 2012 14:56:03 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 380A41884C; Thu, 22 Nov 2012 14:56:03 +0100 (CET)
Date: Thu, 22 Nov 2012 14:56:03 +0100
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xen.org
Message-ID: <20121122135603.GA13807@aepfle.de>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Subject: [Xen-devel] libxen build warnings due to empty XML2_CONFIG or
	CURL_CONFIG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

If XML2_CONFIG or CURL_CONFIG is empty, make in tools/libxen will print
an error 'make[3]: --cflags: Command not found'. I think a simple way to
fix this is:
shell test -n "$(XML2_CONFIG)" ; then $(XML2_CONFIG) --cflags ; fi

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 13:56:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 13:56:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbXGB-0002xD-Is; Thu, 22 Nov 2012 13:56:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TbXGA-0002x8-23
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 13:56:06 +0000
Received: from [85.158.139.83:5776] by server-8.bemta-5.messagelabs.com id
	54/33-06050-5FE2EA05; Thu, 22 Nov 2012 13:56:05 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-12.tower-182.messagelabs.com!1353592563!31445145!1
X-Originating-IP: [81.169.146.161]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA0OTkwNzk=\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA0OTkwNzk=\n,UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3678 invoked from network); 22 Nov 2012 13:56:04 -0000
Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.161)
	by server-12.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 22 Nov 2012 13:56:04 -0000
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmwtM48/ll287oFL0=
X-RZG-CLASS-ID: mo00
Received: from probook.site
	(dslb-084-057-082-036.pools.arcor-ip.net [84.57.82.36])
	by smtp.strato.de (joses mo3) (RZmta 31.5 DYNA|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id g06e94oAMDI5WN
	for <xen-devel@lists.xen.org>; Thu, 22 Nov 2012 14:56:03 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 380A41884C; Thu, 22 Nov 2012 14:56:03 +0100 (CET)
Date: Thu, 22 Nov 2012 14:56:03 +0100
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xen.org
Message-ID: <20121122135603.GA13807@aepfle.de>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Subject: [Xen-devel] libxen build warnings due to empty XML2_CONFIG or
	CURL_CONFIG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

If XML2_CONFIG or CURL_CONFIG is empty, make in tools/libxen will print
an error 'make[3]: --cflags: Command not found'. I think a simple way to
fix this is:
shell test -n "$(XML2_CONFIG)" ; then $(XML2_CONFIG) --cflags ; fi

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 14:11:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 14:11:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbXUm-0003Mz-1o; Thu, 22 Nov 2012 14:11:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbXUk-0003Mu-Pw
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 14:11:10 +0000
Received: from [85.158.137.99:6008] by server-16.bemta-3.messagelabs.com id
	32/DF-07461-D723EA05; Thu, 22 Nov 2012 14:11:09 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1353593468!17048036!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14749 invoked from network); 22 Nov 2012 14:11:08 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 14:11:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="15956351"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 14:11:08 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 14:11:08 +0000
Message-ID: <1353593466.13542.158.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Olaf Hering <olaf@aepfle.de>
Date: Thu, 22 Nov 2012 14:11:06 +0000
In-Reply-To: <20121122135603.GA13807@aepfle.de>
References: <20121122135603.GA13807@aepfle.de>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] libxen build warnings due to empty XML2_CONFIG or
 CURL_CONFIG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-22 at 13:56 +0000, Olaf Hering wrote:
> If XML2_CONFIG or CURL_CONFIG is empty, make in tools/libxen will print
> an error 'make[3]: --cflags: Command not found'. I think a simple way to
> fix this is:
> shell test -n "$(XML2_CONFIG)" ; then $(XML2_CONFIG) --cflags ; fi

XML2_CONFIG/CURL_CONFIG comes from configure.ac so if it is empty things
should be arranged such that either configure fails or libxen isn't
built, probably the second options.

Does anyone even use libxen? AFAIK it targets the incomplete 0.X version
of the XenAPI which xend half implements.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 14:11:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 14:11:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbXUm-0003Mz-1o; Thu, 22 Nov 2012 14:11:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbXUk-0003Mu-Pw
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 14:11:10 +0000
Received: from [85.158.137.99:6008] by server-16.bemta-3.messagelabs.com id
	32/DF-07461-D723EA05; Thu, 22 Nov 2012 14:11:09 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1353593468!17048036!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14749 invoked from network); 22 Nov 2012 14:11:08 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 14:11:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="15956351"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 14:11:08 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 14:11:08 +0000
Message-ID: <1353593466.13542.158.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Olaf Hering <olaf@aepfle.de>
Date: Thu, 22 Nov 2012 14:11:06 +0000
In-Reply-To: <20121122135603.GA13807@aepfle.de>
References: <20121122135603.GA13807@aepfle.de>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] libxen build warnings due to empty XML2_CONFIG or
 CURL_CONFIG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-22 at 13:56 +0000, Olaf Hering wrote:
> If XML2_CONFIG or CURL_CONFIG is empty, make in tools/libxen will print
> an error 'make[3]: --cflags: Command not found'. I think a simple way to
> fix this is:
> shell test -n "$(XML2_CONFIG)" ; then $(XML2_CONFIG) --cflags ; fi

XML2_CONFIG/CURL_CONFIG comes from configure.ac so if it is empty things
should be arranged such that either configure fails or libxen isn't
built, probably the second options.

Does anyone even use libxen? AFAIK it targets the incomplete 0.X version
of the XenAPI which xend half implements.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 14:16:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 14:16:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbXZy-0003Uy-TY; Thu, 22 Nov 2012 14:16:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TbXZx-0003Us-5m
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 14:16:33 +0000
Received: from [193.109.254.147:46474] by server-8.bemta-14.messagelabs.com id
	31/88-05026-0C33EA05; Thu, 22 Nov 2012 14:16:32 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1353593759!5122789!1
X-Originating-IP: [209.85.216.52]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17593 invoked from network); 22 Nov 2012 14:16:00 -0000
Received: from mail-qa0-f52.google.com (HELO mail-qa0-f52.google.com)
	(209.85.216.52)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 14:16:00 -0000
Received: by mail-qa0-f52.google.com with SMTP id g14so995071qab.11
	for <xen-devel@lists.xen.org>; Thu, 22 Nov 2012 06:15:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=0wmSVLIFt3Zlgu6EUDSd54sqgWqEVK8Gl7O2Mn95JoM=;
	b=T5zKTQ4IWAXlPgQv3Wdl1Uoqm9KhZnUQEabHs0vX8aypjF2v1alzXehVTkiO+0w7gR
	u7wzC+SBu7+AoSnxggy+x0eitkadJy8E1VVFjNCxUtXR0w7581AsEgkLrG7vXQMDLv35
	Zv1Wnk0Ck4H95gwFya37pbucgIda/7dIU6Nv1HFo95vt3xDseReVK4iqpbFme5+Y08+Q
	BxnN05m+JXEl6FAhDtVNUvLcL6qSV7Nwmzrgck42L7dF0j1a0yFV7yi5ZoginOFbl21Y
	oqoFJUqz8tniHg318j5nhvBrXhVugBH9dUinip8GzFgIfWAHrdOZqQU++qgGJSSbQ38q
	lbRA==
Received: by 10.49.71.4 with SMTP id q4mr776982qeu.16.1353593758587;
	Thu, 22 Nov 2012 06:15:58 -0800 (PST)
Received: from konrad-lan.dumpdata.com
	(50-195-21-189-static.hfc.comcastbusiness.net. [50.195.21.189])
	by mx.google.com with ESMTPS id m2sm113748qeq.3.2012.11.22.06.15.57
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 22 Nov 2012 06:15:58 -0800 (PST)
Date: Thu, 22 Nov 2012 09:15:52 -0500
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: David Miller <davem@davemloft.net>
Message-ID: <20121122141551.GA20186@konrad-lan.dumpdata.com>
References: <1353499336-28952-1-git-send-email-ian.campbell@citrix.com>
	<20121121151625.GA13127@konrad-lan.dumpdata.com>
	<20121121.114957.441218567286373485.davem@davemloft.net>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121121.114957.441218567286373485.davem@davemloft.net>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: ian.campbell@citrix.com, netdev@vger.kernel.org, edumazet@google.com,
	stefan.bader@canonical.com, xen-devel@lists.xen.org,
	linux@eikelenboom.it, annie.li@oracle.com
Subject: Re: [Xen-devel] [PATCH V3] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 21, 2012 at 11:49:57AM -0500, David Miller wrote:
> From: Konrad Rzeszutek Wilk <konrad@kernel.org>
> Date: Wed, 21 Nov 2012 10:16:27 -0500
> 
> > On Wed, Nov 21, 2012 at 12:02:16PM +0000, Ian Campbell wrote:
> >> An SKB paged fragment can consist of a compound page with order > 0.
> >> However the netchannel protocol deals only in PAGE_SIZE frames.
> >> 
> >> Handle this in xennet_make_frags by iterating over the frames which
> >> make up the page.
> >> 
> >> This is the netfront equivalent to 6a8ed462f16b for netback.
> >> 
> >> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >> Cc: netdev@vger.kernel.org
> >> Cc: xen-devel@lists.xen.org
> >> Cc: Eric Dumazet <edumazet@google.com>
> >> Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
> > 
> > Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > 
> > David, would you like me to send it to Linus via my tree or are you
> > OK sending him a git pull with this patch (and hopefully some other
> > ones?)
> 
> I'll merge this to Linus via my net tree, thanks.

Great. Thank you for doing it at such short notice and sooo close to the release.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 14:16:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 14:16:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbXZy-0003Uy-TY; Thu, 22 Nov 2012 14:16:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TbXZx-0003Us-5m
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 14:16:33 +0000
Received: from [193.109.254.147:46474] by server-8.bemta-14.messagelabs.com id
	31/88-05026-0C33EA05; Thu, 22 Nov 2012 14:16:32 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1353593759!5122789!1
X-Originating-IP: [209.85.216.52]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17593 invoked from network); 22 Nov 2012 14:16:00 -0000
Received: from mail-qa0-f52.google.com (HELO mail-qa0-f52.google.com)
	(209.85.216.52)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 14:16:00 -0000
Received: by mail-qa0-f52.google.com with SMTP id g14so995071qab.11
	for <xen-devel@lists.xen.org>; Thu, 22 Nov 2012 06:15:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=0wmSVLIFt3Zlgu6EUDSd54sqgWqEVK8Gl7O2Mn95JoM=;
	b=T5zKTQ4IWAXlPgQv3Wdl1Uoqm9KhZnUQEabHs0vX8aypjF2v1alzXehVTkiO+0w7gR
	u7wzC+SBu7+AoSnxggy+x0eitkadJy8E1VVFjNCxUtXR0w7581AsEgkLrG7vXQMDLv35
	Zv1Wnk0Ck4H95gwFya37pbucgIda/7dIU6Nv1HFo95vt3xDseReVK4iqpbFme5+Y08+Q
	BxnN05m+JXEl6FAhDtVNUvLcL6qSV7Nwmzrgck42L7dF0j1a0yFV7yi5ZoginOFbl21Y
	oqoFJUqz8tniHg318j5nhvBrXhVugBH9dUinip8GzFgIfWAHrdOZqQU++qgGJSSbQ38q
	lbRA==
Received: by 10.49.71.4 with SMTP id q4mr776982qeu.16.1353593758587;
	Thu, 22 Nov 2012 06:15:58 -0800 (PST)
Received: from konrad-lan.dumpdata.com
	(50-195-21-189-static.hfc.comcastbusiness.net. [50.195.21.189])
	by mx.google.com with ESMTPS id m2sm113748qeq.3.2012.11.22.06.15.57
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 22 Nov 2012 06:15:58 -0800 (PST)
Date: Thu, 22 Nov 2012 09:15:52 -0500
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: David Miller <davem@davemloft.net>
Message-ID: <20121122141551.GA20186@konrad-lan.dumpdata.com>
References: <1353499336-28952-1-git-send-email-ian.campbell@citrix.com>
	<20121121151625.GA13127@konrad-lan.dumpdata.com>
	<20121121.114957.441218567286373485.davem@davemloft.net>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121121.114957.441218567286373485.davem@davemloft.net>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: ian.campbell@citrix.com, netdev@vger.kernel.org, edumazet@google.com,
	stefan.bader@canonical.com, xen-devel@lists.xen.org,
	linux@eikelenboom.it, annie.li@oracle.com
Subject: Re: [Xen-devel] [PATCH V3] xen/netfront: handle compound page
 fragments on transmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 21, 2012 at 11:49:57AM -0500, David Miller wrote:
> From: Konrad Rzeszutek Wilk <konrad@kernel.org>
> Date: Wed, 21 Nov 2012 10:16:27 -0500
> 
> > On Wed, Nov 21, 2012 at 12:02:16PM +0000, Ian Campbell wrote:
> >> An SKB paged fragment can consist of a compound page with order > 0.
> >> However the netchannel protocol deals only in PAGE_SIZE frames.
> >> 
> >> Handle this in xennet_make_frags by iterating over the frames which
> >> make up the page.
> >> 
> >> This is the netfront equivalent to 6a8ed462f16b for netback.
> >> 
> >> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >> Cc: netdev@vger.kernel.org
> >> Cc: xen-devel@lists.xen.org
> >> Cc: Eric Dumazet <edumazet@google.com>
> >> Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
> > 
> > Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > 
> > David, would you like me to send it to Linus via my tree or are you
> > OK sending him a git pull with this patch (and hopefully some other
> > ones?)
> 
> I'll merge this to Linus via my net tree, thanks.

Great. Thank you for doing it at such short notice and sooo close to the release.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 14:17:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 14:17:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbXaF-0003WG-A5; Thu, 22 Nov 2012 14:16:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fantonifabio@tiscali.it>) id 1TbXaD-0003Vi-0Y
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 14:16:49 +0000
Received: from [85.158.143.35:32053] by server-2.bemta-4.messagelabs.com id
	2D/FD-28922-0D33EA05; Thu, 22 Nov 2012 14:16:48 +0000
X-Env-Sender: fantonifabio@tiscali.it
X-Msg-Ref: server-13.tower-21.messagelabs.com!1353593807!14548684!1
X-Originating-IP: [94.23.245.208]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12571 invoked from network); 22 Nov 2012 14:16:47 -0000
Received: from lnx3.fantu.it (HELO lnx3.fantu.it) (94.23.245.208)
	by server-13.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 22 Nov 2012 14:16:47 -0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by lnx3.fantu.it (Postfix) with ESMTP id 0925F4014A8
	for <xen-devel@lists.xensource.com>;
	Thu, 22 Nov 2012 15:16:47 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at lnx3.fantu.it
Received: from lnx3.fantu.it ([127.0.0.1])
	by localhost (lnx3.fantu.it [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 4cjutiUAqh1z for <xen-devel@lists.xensource.com>;
	Thu, 22 Nov 2012 15:16:46 +0100 (CET)
Received: from [192.168.178.50]
	(host51-78-dynamic.2-87-r.retail.telecomitalia.it [87.2.78.51])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: prova@fantu.it)
	by lnx3.fantu.it (Postfix) with ESMTPSA id 6178E40146D
	for <xen-devel@lists.xensource.com>;
	Thu, 22 Nov 2012 15:16:46 +0100 (CET)
Message-ID: <50AE33CA.2070103@tiscali.it>
Date: Thu, 22 Nov 2012 15:16:42 +0100
From: Fabio Fantoni <fantonifabio@tiscali.it>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Fix bug in libxl_cdrom_insert,
 make more robust against bad xenstore data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: fantonifabio@tiscali.it
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3642284628672588706=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--===============3642284628672588706==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms070304010807000200010303"

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--------------ms070304010807000200010303
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: quoted-printable

I tested it with xen-unstable: no more segfault error and in genera good =

debug.
Below the result of my test:

xl cd-insert W7 hdb raw:/mnt/vm/iso/QUANTAL.iso
libxl: error: libxl_device.c:243:libxl__device_disk_set_backend: Disk=20
vdev=3Dhdb failed to stat: raw:/mnt/vm/iso/QUANTAL.iso: No such file or=20
directory

I launched the command based on this syntax:
Usage: xl [-vfN] cd-insert <Domain> <VirtualDevice> <type:path>

I also tried removing "raw:" but  it gave:
xl cd-insert W7 hdb /mnt/vm/iso/QUANTAL.iso
libxl: error: libxl_device.c:269:libxl__device_disk_set_backend: no=20
suitable backend for disk hdb


--------------ms070304010807000200010303
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: Firma crittografica S/MIME

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIINhjCC
BjQwggQcoAMCAQICASAwDQYJKoZIhvcNAQEFBQAwfTELMAkGA1UEBhMCSUwxFjAUBgNVBAoT
DVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNp
Z25pbmcxKTAnBgNVBAMTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA3
MTAyNDIxMDI1NVoXDTE3MTAyNDIxMDI1NVowgYwxCzAJBgNVBAYTAklMMRYwFAYDVQQKEw1T
dGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRhbCBDZXJ0aWZpY2F0ZSBTaWdu
aW5nMTgwNgYDVQQDEy9TdGFydENvbSBDbGFzcyAyIFByaW1hcnkgSW50ZXJtZWRpYXRlIENs
aWVudCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMsohUWcASz7GfKrpTOM
KqANy9BV7V0igWdGxA8IU77L3aTxErQ+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vDnwrOKc2wwSz41bXT/+zR8oJQzmExOn43
oNA0hCYPlHbHdDSsRkUGzm3Me/UfDt26DQGTb9EPq7AB4JUblXX+NOF4hsW2O37OPK9Jla0H
hfQu9CdhVibdrvij/CQhQsfW5U4iZAAAAAAAAA==
--------------ms070304010807000200010303--


--===============3642284628672588706==
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.xen.org
http://lists.xen.org/xen-devel

--===============3642284628672588706==--


From xen-devel-bounces@lists.xen.org Thu Nov 22 14:17:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 14:17:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbXaF-0003WG-A5; Thu, 22 Nov 2012 14:16:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fantonifabio@tiscali.it>) id 1TbXaD-0003Vi-0Y
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 14:16:49 +0000
Received: from [85.158.143.35:32053] by server-2.bemta-4.messagelabs.com id
	2D/FD-28922-0D33EA05; Thu, 22 Nov 2012 14:16:48 +0000
X-Env-Sender: fantonifabio@tiscali.it
X-Msg-Ref: server-13.tower-21.messagelabs.com!1353593807!14548684!1
X-Originating-IP: [94.23.245.208]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12571 invoked from network); 22 Nov 2012 14:16:47 -0000
Received: from lnx3.fantu.it (HELO lnx3.fantu.it) (94.23.245.208)
	by server-13.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 22 Nov 2012 14:16:47 -0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by lnx3.fantu.it (Postfix) with ESMTP id 0925F4014A8
	for <xen-devel@lists.xensource.com>;
	Thu, 22 Nov 2012 15:16:47 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at lnx3.fantu.it
Received: from lnx3.fantu.it ([127.0.0.1])
	by localhost (lnx3.fantu.it [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 4cjutiUAqh1z for <xen-devel@lists.xensource.com>;
	Thu, 22 Nov 2012 15:16:46 +0100 (CET)
Received: from [192.168.178.50]
	(host51-78-dynamic.2-87-r.retail.telecomitalia.it [87.2.78.51])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: prova@fantu.it)
	by lnx3.fantu.it (Postfix) with ESMTPSA id 6178E40146D
	for <xen-devel@lists.xensource.com>;
	Thu, 22 Nov 2012 15:16:46 +0100 (CET)
Message-ID: <50AE33CA.2070103@tiscali.it>
Date: Thu, 22 Nov 2012 15:16:42 +0100
From: Fabio Fantoni <fantonifabio@tiscali.it>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Fix bug in libxl_cdrom_insert,
 make more robust against bad xenstore data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: fantonifabio@tiscali.it
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3642284628672588706=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--===============3642284628672588706==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms070304010807000200010303"

Questo Ã¨ un messaggio firmato digitalmente in formato MIME.

--------------ms070304010807000200010303
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: quoted-printable

I tested it with xen-unstable: no more segfault error and in genera good =

debug.
Below the result of my test:

xl cd-insert W7 hdb raw:/mnt/vm/iso/QUANTAL.iso
libxl: error: libxl_device.c:243:libxl__device_disk_set_backend: Disk=20
vdev=3Dhdb failed to stat: raw:/mnt/vm/iso/QUANTAL.iso: No such file or=20
directory

I launched the command based on this syntax:
Usage: xl [-vfN] cd-insert <Domain> <VirtualDevice> <type:path>

I also tried removing "raw:" but  it gave:
xl cd-insert W7 hdb /mnt/vm/iso/QUANTAL.iso
libxl: error: libxl_device.c:269:libxl__device_disk_set_backend: no=20
suitable backend for disk hdb


--------------ms070304010807000200010303
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: Firma crittografica S/MIME

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIINhjCC
BjQwggQcoAMCAQICASAwDQYJKoZIhvcNAQEFBQAwfTELMAkGA1UEBhMCSUwxFjAUBgNVBAoT
DVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNp
Z25pbmcxKTAnBgNVBAMTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA3
MTAyNDIxMDI1NVoXDTE3MTAyND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GFzcyAyIFByaW1hcnkgSW50ZXJtZWRp
YXRlIENsaWVudCBDQQICHmMwDQYJKoZIhvcNAQEBBQAEggEAIR6tCHPRK9e5J6mlBPAdVey3
L7z+ZUUiRdSt999csRV+1sUdck7n7ir/h3c9Tm4c/Cp1R8Qs9FpXETrLfe/NZuqBKYAIZP/T
PXrHMvElY0zPb0pzsOw6DqZl5r+LYP8kg2cB7Y+a3QKAvbWf8Il2sa3ggMKyx/e9o3y0hqYe
YzUdzU2OxhinTqU2nzf7EqhXvhIW0qHZCBIGttvDnwrOKc2wwSz41bXT/+zR8oJQzmExOn43
oNA0hCYPlHbHdDSsRkUGzm3Me/UfDt26DQGTb9EPq7AB4JUblXX+NOF4hsW2O37OPK9Jla0H
hfQu9CdhVibdrvij/CQhQsfW5U4iZAAAAAAAAA==
--------------ms070304010807000200010303--


--===============3642284628672588706==
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.xen.org
http://lists.xen.org/xen-devel

--===============3642284628672588706==--


From xen-devel-bounces@lists.xen.org Thu Nov 22 14:38:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 14:38:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbXuY-00043J-D7; Thu, 22 Nov 2012 14:37:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TbXuW-00043C-Sz
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 14:37:49 +0000
Received: from [85.158.137.99:37043] by server-9.bemta-3.messagelabs.com id
	48/68-02388-7B83EA05; Thu, 22 Nov 2012 14:37:43 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-13.tower-217.messagelabs.com!1353595062!20202999!1
X-Originating-IP: [81.169.146.162]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MiA9PiA0NjgyMzI=\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MiA9PiA0NjgyMzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11912 invoked from network); 22 Nov 2012 14:37:42 -0000
Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.162)
	by server-13.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 22 Nov 2012 14:37:42 -0000
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmwtM48/ll287oFL0=
X-RZG-CLASS-ID: mo00
Received: from probook.site
	(dslb-084-057-082-036.pools.arcor-ip.net [84.57.82.36])
	by smtp.strato.de (josoe mo1) (RZmta 31.5 DYNA|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id e01d1eoAMDwdDk ;
	Thu, 22 Nov 2012 15:37:42 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id C2E3F1884C; Thu, 22 Nov 2012 15:37:41 +0100 (CET)
Date: Thu, 22 Nov 2012 15:37:41 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121122143741.GA17600@aepfle.de>
References: <20121122135603.GA13807@aepfle.de>
	<1353593466.13542.158.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353593466.13542.158.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] libxen build warnings due to empty XML2_CONFIG or
 CURL_CONFIG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 22, Ian Campbell wrote:

> On Thu, 2012-11-22 at 13:56 +0000, Olaf Hering wrote:
> > If XML2_CONFIG or CURL_CONFIG is empty, make in tools/libxen will print
> > an error 'make[3]: --cflags: Command not found'. I think a simple way to
> > fix this is:
> > shell test -n "$(XML2_CONFIG)" ; then $(XML2_CONFIG) --cflags ; fi
> 
> XML2_CONFIG/CURL_CONFIG comes from configure.ac so if it is empty things
> should be arranged such that either configure fails or libxen isn't
> built, probably the second options.

Now I see, configure is called with --enable-xenapi.
For some reason the linking does not fail due to missing libxml*.so.
curl is only required for the test programs.

> Does anyone even use libxen? AFAIK it targets the incomplete 0.X version
> of the XenAPI which xend half implements.

I dont know.

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 14:38:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 14:38:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbXuY-00043J-D7; Thu, 22 Nov 2012 14:37:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TbXuW-00043C-Sz
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 14:37:49 +0000
Received: from [85.158.137.99:37043] by server-9.bemta-3.messagelabs.com id
	48/68-02388-7B83EA05; Thu, 22 Nov 2012 14:37:43 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-13.tower-217.messagelabs.com!1353595062!20202999!1
X-Originating-IP: [81.169.146.162]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MiA9PiA0NjgyMzI=\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MiA9PiA0NjgyMzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11912 invoked from network); 22 Nov 2012 14:37:42 -0000
Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.162)
	by server-13.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 22 Nov 2012 14:37:42 -0000
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmwtM48/ll287oFL0=
X-RZG-CLASS-ID: mo00
Received: from probook.site
	(dslb-084-057-082-036.pools.arcor-ip.net [84.57.82.36])
	by smtp.strato.de (josoe mo1) (RZmta 31.5 DYNA|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id e01d1eoAMDwdDk ;
	Thu, 22 Nov 2012 15:37:42 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id C2E3F1884C; Thu, 22 Nov 2012 15:37:41 +0100 (CET)
Date: Thu, 22 Nov 2012 15:37:41 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121122143741.GA17600@aepfle.de>
References: <20121122135603.GA13807@aepfle.de>
	<1353593466.13542.158.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353593466.13542.158.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] libxen build warnings due to empty XML2_CONFIG or
 CURL_CONFIG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 22, Ian Campbell wrote:

> On Thu, 2012-11-22 at 13:56 +0000, Olaf Hering wrote:
> > If XML2_CONFIG or CURL_CONFIG is empty, make in tools/libxen will print
> > an error 'make[3]: --cflags: Command not found'. I think a simple way to
> > fix this is:
> > shell test -n "$(XML2_CONFIG)" ; then $(XML2_CONFIG) --cflags ; fi
> 
> XML2_CONFIG/CURL_CONFIG comes from configure.ac so if it is empty things
> should be arranged such that either configure fails or libxen isn't
> built, probably the second options.

Now I see, configure is called with --enable-xenapi.
For some reason the linking does not fail due to missing libxml*.so.
curl is only required for the test programs.

> Does anyone even use libxen? AFAIK it targets the incomplete 0.X version
> of the XenAPI which xend half implements.

I dont know.

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:01:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:01:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbYGs-0004bQ-Jq; Thu, 22 Nov 2012 15:00:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbYGq-0004Zj-U3
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:00:53 +0000
Received: from [85.158.143.35:20991] by server-3.bemta-4.messagelabs.com id
	0E/ED-06841-42E3EA05; Thu, 22 Nov 2012 15:00:52 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1353596447!14087976!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26414 invoked from network); 22 Nov 2012 15:00:50 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-16.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 15:00:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="215281133"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 15:00:47 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 10:00:47 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbYGk-0006f5-QG;
	Thu, 22 Nov 2012 15:00:46 +0000
MIME-Version: 1.0
X-Mercurial-Node: d7ea938044ac0212ce31775fc94a7618abb13947
Message-ID: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Thu, 22 Nov 2012 15:00:46 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Malcolm Crossley <malcolm.crossley@citrix.com>,
	Tim Deegan <tim@xen.org>, Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
	handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The self_nmi() code cause's an NMI to be triggered by sending an APIC
message to the local processor.  However, NMIs are blocked by the
VMEXIT, until the next iret or VMENTER.

Volume 3 Chapter 27 Section 1 of the Intel SDM states:

An NMI causes subsequent NMIs to be blocked, but only after the VM exit
completes.

As a result, as soon as the VMENTER happens, an immediate VMEXIT
happens as a result of the queued NMI.  We have seen hundreds of
iterations of this VMEXIT/VMENTER loop before the HVM guest resumes
normal operation.

Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

--
Changes since v2
 * Switch from 'int $2' to do_nmi()
 * Reworked commit message to more clearly explain the problem

diff -r 2489c2926698 -r d7ea938044ac xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
         vector = intr_info & INTR_INFO_VECTOR_MASK;
         if ( vector == TRAP_machine_check )
             do_machine_check(regs);
+        else if ( vector == TRAP_nmi &&
+                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
+                  (X86_EVENTTYPE_NMI << 8) ) )
+            /* Must be called before interrupts are enabled to ensure
+             * the NMI handler code is run before the first IRET. The
+             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
+             */
+            do_nmi();
         break;
     case EXIT_REASON_MCE_DURING_VMENTRY:
         do_machine_check(regs);
@@ -2442,7 +2450,6 @@ void vmx_vmexit_handler(struct cpu_user_
                  (X86_EVENTTYPE_NMI << 8) )
                 goto exit_and_crash;
             HVMTRACE_0D(NMI);
-            self_nmi(); /* Real NMI, vector 2: normal processing. */
             break;
         case TRAP_machine_check:
             HVMTRACE_0D(MCE);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:01:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:01:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbYGs-0004bQ-Jq; Thu, 22 Nov 2012 15:00:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbYGq-0004Zj-U3
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:00:53 +0000
Received: from [85.158.143.35:20991] by server-3.bemta-4.messagelabs.com id
	0E/ED-06841-42E3EA05; Thu, 22 Nov 2012 15:00:52 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1353596447!14087976!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26414 invoked from network); 22 Nov 2012 15:00:50 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-16.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 15:00:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="215281133"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 15:00:47 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 10:00:47 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbYGk-0006f5-QG;
	Thu, 22 Nov 2012 15:00:46 +0000
MIME-Version: 1.0
X-Mercurial-Node: d7ea938044ac0212ce31775fc94a7618abb13947
Message-ID: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Thu, 22 Nov 2012 15:00:46 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Malcolm Crossley <malcolm.crossley@citrix.com>,
	Tim Deegan <tim@xen.org>, Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
	handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The self_nmi() code cause's an NMI to be triggered by sending an APIC
message to the local processor.  However, NMIs are blocked by the
VMEXIT, until the next iret or VMENTER.

Volume 3 Chapter 27 Section 1 of the Intel SDM states:

An NMI causes subsequent NMIs to be blocked, but only after the VM exit
completes.

As a result, as soon as the VMENTER happens, an immediate VMEXIT
happens as a result of the queued NMI.  We have seen hundreds of
iterations of this VMEXIT/VMENTER loop before the HVM guest resumes
normal operation.

Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

--
Changes since v2
 * Switch from 'int $2' to do_nmi()
 * Reworked commit message to more clearly explain the problem

diff -r 2489c2926698 -r d7ea938044ac xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
         vector = intr_info & INTR_INFO_VECTOR_MASK;
         if ( vector == TRAP_machine_check )
             do_machine_check(regs);
+        else if ( vector == TRAP_nmi &&
+                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
+                  (X86_EVENTTYPE_NMI << 8) ) )
+            /* Must be called before interrupts are enabled to ensure
+             * the NMI handler code is run before the first IRET. The
+             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
+             */
+            do_nmi();
         break;
     case EXIT_REASON_MCE_DURING_VMENTRY:
         do_machine_check(regs);
@@ -2442,7 +2450,6 @@ void vmx_vmexit_handler(struct cpu_user_
                  (X86_EVENTTYPE_NMI << 8) )
                 goto exit_and_crash;
             HVMTRACE_0D(NMI);
-            self_nmi(); /* Real NMI, vector 2: normal processing. */
             break;
         case TRAP_machine_check:
             HVMTRACE_0D(MCE);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:07:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:07:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbYNM-0004kw-F2; Thu, 22 Nov 2012 15:07:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbYNL-0004kq-RY
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:07:36 +0000
Received: from [85.158.139.83:56378] by server-15.bemta-5.messagelabs.com id
	15/F4-26920-6BF3EA05; Thu, 22 Nov 2012 15:07:34 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1353596847!30758267!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10282 invoked from network); 22 Nov 2012 15:07:28 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 15:07:28 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="45405253"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 15:07:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 10:07:22 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbYN8-0006lO-1G;
	Thu, 22 Nov 2012 15:07:22 +0000
Message-ID: <50AE3FA9.9080703@citrix.com>
Date: Thu, 22 Nov 2012 15:07:21 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <50AE214D.2080304@citrix.com>
	<50AE3AC102000078000AA9B3@nat28.tlf.novell.com>
In-Reply-To: <50AE3AC102000078000AA9B3@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] blkfront failure on migrate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/12 13:46, Jan Beulich wrote:
>>>> On 22.11.12 at 13:57, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> In "Stage 1" as commented, we make a copy of the shadow map.  We then
>> reset the contents of the real shadow map, and selectively copy the
>> in-use entries back from the copy to the real map.
>>
>> Looking at the code, it appears possible to do this rearranging inplace
>> in the real shadow map, without requiring any memory allocation.
>>
>> Is this a sensible suggestion or have I overlooked something?  This
>> order-5 allocation is a disaster lying in wait for VMs with high memory
>> pressure.
> While merging the multi-page ring patches, I think I tried to make
> this an in place copy operation, and it didn't work (don't recall
> details though). This and/or the need to deal with shrinking ring
> size across migration (maybe that was what really didn't work)
> made me move stage 3 to kick_pending_request_queues(), and
> allocate entries that actually need copying one by one, sticking
> them on a list.
>
> Jan
>

Where are your multi-page ring patches?  Are you saying this code is
going to change very shortly?

If the copy and copy back really cant be avoided, then making
"sizeof(info->shadow)/PAGE_SIZE" allocations of order 0 would be
substantially more friendly to environments with high memory pressure,
at the cost of slightly more complicated indexing in the loop.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:07:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:07:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbYNM-0004kw-F2; Thu, 22 Nov 2012 15:07:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbYNL-0004kq-RY
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:07:36 +0000
Received: from [85.158.139.83:56378] by server-15.bemta-5.messagelabs.com id
	15/F4-26920-6BF3EA05; Thu, 22 Nov 2012 15:07:34 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1353596847!30758267!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10282 invoked from network); 22 Nov 2012 15:07:28 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 15:07:28 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="45405253"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 15:07:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 10:07:22 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbYN8-0006lO-1G;
	Thu, 22 Nov 2012 15:07:22 +0000
Message-ID: <50AE3FA9.9080703@citrix.com>
Date: Thu, 22 Nov 2012 15:07:21 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <50AE214D.2080304@citrix.com>
	<50AE3AC102000078000AA9B3@nat28.tlf.novell.com>
In-Reply-To: <50AE3AC102000078000AA9B3@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] blkfront failure on migrate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/12 13:46, Jan Beulich wrote:
>>>> On 22.11.12 at 13:57, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> In "Stage 1" as commented, we make a copy of the shadow map.  We then
>> reset the contents of the real shadow map, and selectively copy the
>> in-use entries back from the copy to the real map.
>>
>> Looking at the code, it appears possible to do this rearranging inplace
>> in the real shadow map, without requiring any memory allocation.
>>
>> Is this a sensible suggestion or have I overlooked something?  This
>> order-5 allocation is a disaster lying in wait for VMs with high memory
>> pressure.
> While merging the multi-page ring patches, I think I tried to make
> this an in place copy operation, and it didn't work (don't recall
> details though). This and/or the need to deal with shrinking ring
> size across migration (maybe that was what really didn't work)
> made me move stage 3 to kick_pending_request_queues(), and
> allocate entries that actually need copying one by one, sticking
> them on a list.
>
> Jan
>

Where are your multi-page ring patches?  Are you saying this code is
going to change very shortly?

If the copy and copy back really cant be avoided, then making
"sizeof(info->shadow)/PAGE_SIZE" allocations of order 0 would be
substantially more friendly to environments with high memory pressure,
at the cost of slightly more complicated indexing in the loop.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:14:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:14:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbYTg-00050Y-C1; Thu, 22 Nov 2012 15:14:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbYTe-00050Q-J6
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:14:06 +0000
Received: from [85.158.143.35:13325] by server-2.bemta-4.messagelabs.com id
	26/84-28922-D314EA05; Thu, 22 Nov 2012 15:14:05 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1353597244!8368193!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17068 invoked from network); 22 Nov 2012 15:14:04 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-21.messagelabs.com with SMTP;
	22 Nov 2012 15:14:04 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 15:14:04 +0000
Message-Id: <50AE4F8402000078000AAA02@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 15:15:00 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>,
 "Tim Deegan" <tim@xen.org>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
In-Reply-To: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: MalcolmCrossley <malcolm.crossley@citrix.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
 handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 16:00, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> The self_nmi() code cause's an NMI to be triggered by sending an APIC
> message to the local processor.  However, NMIs are blocked by the
> VMEXIT, until the next iret or VMENTER.
> 
> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
> 
> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
> completes.
> 
> As a result, as soon as the VMENTER happens, an immediate VMEXIT
> happens as a result of the queued NMI.  We have seen hundreds of
> iterations of this VMEXIT/VMENTER loop before the HVM guest resumes
> normal operation.
> 
> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> --
> Changes since v2
>  * Switch from 'int $2' to do_nmi()
>  * Reworked commit message to more clearly explain the problem
> 
> diff -r 2489c2926698 -r d7ea938044ac xen/arch/x86/hvm/vmx/vmx.c
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>          vector = intr_info & INTR_INFO_VECTOR_MASK;
>          if ( vector == TRAP_machine_check )
>              do_machine_check(regs);
> +        else if ( vector == TRAP_nmi &&
> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
> +                  (X86_EVENTTYPE_NMI << 8) ) )
> +            /* Must be called before interrupts are enabled to ensure
> +             * the NMI handler code is run before the first IRET. The
> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
> +             */
> +            do_nmi();

But that's only half of it, at least as far as I recall the outcome of
the discussion: You want an IRET (or VMRESUME) before possibly
going into the scheduler (and hence not back to the current VM).
And the same also on the PV exit path from an NMI.

Jan

>          break;
>      case EXIT_REASON_MCE_DURING_VMENTRY:
>          do_machine_check(regs);
> @@ -2442,7 +2450,6 @@ void vmx_vmexit_handler(struct cpu_user_
>                   (X86_EVENTTYPE_NMI << 8) )
>                  goto exit_and_crash;
>              HVMTRACE_0D(NMI);
> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>              break;
>          case TRAP_machine_check:
>              HVMTRACE_0D(MCE);




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:14:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:14:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbYTg-00050Y-C1; Thu, 22 Nov 2012 15:14:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbYTe-00050Q-J6
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:14:06 +0000
Received: from [85.158.143.35:13325] by server-2.bemta-4.messagelabs.com id
	26/84-28922-D314EA05; Thu, 22 Nov 2012 15:14:05 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1353597244!8368193!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17068 invoked from network); 22 Nov 2012 15:14:04 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-21.messagelabs.com with SMTP;
	22 Nov 2012 15:14:04 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 15:14:04 +0000
Message-Id: <50AE4F8402000078000AAA02@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 15:15:00 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>,
 "Tim Deegan" <tim@xen.org>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
In-Reply-To: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: MalcolmCrossley <malcolm.crossley@citrix.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
 handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 16:00, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> The self_nmi() code cause's an NMI to be triggered by sending an APIC
> message to the local processor.  However, NMIs are blocked by the
> VMEXIT, until the next iret or VMENTER.
> 
> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
> 
> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
> completes.
> 
> As a result, as soon as the VMENTER happens, an immediate VMEXIT
> happens as a result of the queued NMI.  We have seen hundreds of
> iterations of this VMEXIT/VMENTER loop before the HVM guest resumes
> normal operation.
> 
> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> --
> Changes since v2
>  * Switch from 'int $2' to do_nmi()
>  * Reworked commit message to more clearly explain the problem
> 
> diff -r 2489c2926698 -r d7ea938044ac xen/arch/x86/hvm/vmx/vmx.c
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>          vector = intr_info & INTR_INFO_VECTOR_MASK;
>          if ( vector == TRAP_machine_check )
>              do_machine_check(regs);
> +        else if ( vector == TRAP_nmi &&
> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
> +                  (X86_EVENTTYPE_NMI << 8) ) )
> +            /* Must be called before interrupts are enabled to ensure
> +             * the NMI handler code is run before the first IRET. The
> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
> +             */
> +            do_nmi();

But that's only half of it, at least as far as I recall the outcome of
the discussion: You want an IRET (or VMRESUME) before possibly
going into the scheduler (and hence not back to the current VM).
And the same also on the PV exit path from an NMI.

Jan

>          break;
>      case EXIT_REASON_MCE_DURING_VMENTRY:
>          do_machine_check(regs);
> @@ -2442,7 +2450,6 @@ void vmx_vmexit_handler(struct cpu_user_
>                   (X86_EVENTTYPE_NMI << 8) )
>                  goto exit_and_crash;
>              HVMTRACE_0D(NMI);
> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>              break;
>          case TRAP_machine_check:
>              HVMTRACE_0D(MCE);




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:17:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:17:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbYWO-00057I-UM; Thu, 22 Nov 2012 15:16:56 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbYWM-00057A-RQ
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:16:55 +0000
Received: from [85.158.137.99:16322] by server-16.bemta-3.messagelabs.com id
	5F/DE-07461-0E14EA05; Thu, 22 Nov 2012 15:16:48 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1353597407!20209775!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3304 invoked from network); 22 Nov 2012 15:16:48 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 15:16:48 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="215282599"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 15:16:46 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 10:16:46 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbYWE-0006w1-0c;
	Thu, 22 Nov 2012 15:16:46 +0000
Message-ID: <50AE41DD.2030703@citrix.com>
Date: Thu, 22 Nov 2012 15:16:45 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<50AE4F8402000078000AAA02@nat28.tlf.novell.com>
In-Reply-To: <50AE4F8402000078000AAA02@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
	handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 22/11/12 15:15, Jan Beulich wrote:
>>>> On 22.11.12 at 16:00, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> The self_nmi() code cause's an NMI to be triggered by sending an APIC
>> message to the local processor.  However, NMIs are blocked by the
>> VMEXIT, until the next iret or VMENTER.
>>
>> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
>>
>> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
>> completes.
>>
>> As a result, as soon as the VMENTER happens, an immediate VMEXIT
>> happens as a result of the queued NMI.  We have seen hundreds of
>> iterations of this VMEXIT/VMENTER loop before the HVM guest resumes
>> normal operation.
>>
>> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>
>> --
>> Changes since v2
>>  * Switch from 'int $2' to do_nmi()
>>  * Reworked commit message to more clearly explain the problem
>>
>> diff -r 2489c2926698 -r d7ea938044ac xen/arch/x86/hvm/vmx/vmx.c
>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>>          vector = intr_info & INTR_INFO_VECTOR_MASK;
>>          if ( vector == TRAP_machine_check )
>>              do_machine_check(regs);
>> +        else if ( vector == TRAP_nmi &&
>> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
>> +                  (X86_EVENTTYPE_NMI << 8) ) )
>> +            /* Must be called before interrupts are enabled to ensure
>> +             * the NMI handler code is run before the first IRET. The
>> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
>> +             */
>> +            do_nmi();
> But that's only half of it, at least as far as I recall the outcome of
> the discussion: You want an IRET (or VMRESUME) before possibly
> going into the scheduler (and hence not back to the current VM).
> And the same also on the PV exit path from an NMI.
>
> Jan

When I read this codepath, there seemed to be no consideration for
re-scheduling.  I will double check, but I think the VMRESUME is
unconditional if the VMEXIT reason was a real NMI.

~Andrew

>
>>          break;
>>      case EXIT_REASON_MCE_DURING_VMENTRY:
>>          do_machine_check(regs);
>> @@ -2442,7 +2450,6 @@ void vmx_vmexit_handler(struct cpu_user_
>>                   (X86_EVENTTYPE_NMI << 8) )
>>                  goto exit_and_crash;
>>              HVMTRACE_0D(NMI);
>> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>>              break;
>>          case TRAP_machine_check:
>>              HVMTRACE_0D(MCE);
>
>

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:17:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:17:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbYWO-00057I-UM; Thu, 22 Nov 2012 15:16:56 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbYWM-00057A-RQ
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:16:55 +0000
Received: from [85.158.137.99:16322] by server-16.bemta-3.messagelabs.com id
	5F/DE-07461-0E14EA05; Thu, 22 Nov 2012 15:16:48 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1353597407!20209775!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3304 invoked from network); 22 Nov 2012 15:16:48 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 15:16:48 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="215282599"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 15:16:46 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 10:16:46 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbYWE-0006w1-0c;
	Thu, 22 Nov 2012 15:16:46 +0000
Message-ID: <50AE41DD.2030703@citrix.com>
Date: Thu, 22 Nov 2012 15:16:45 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<50AE4F8402000078000AAA02@nat28.tlf.novell.com>
In-Reply-To: <50AE4F8402000078000AAA02@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
	handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 22/11/12 15:15, Jan Beulich wrote:
>>>> On 22.11.12 at 16:00, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> The self_nmi() code cause's an NMI to be triggered by sending an APIC
>> message to the local processor.  However, NMIs are blocked by the
>> VMEXIT, until the next iret or VMENTER.
>>
>> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
>>
>> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
>> completes.
>>
>> As a result, as soon as the VMENTER happens, an immediate VMEXIT
>> happens as a result of the queued NMI.  We have seen hundreds of
>> iterations of this VMEXIT/VMENTER loop before the HVM guest resumes
>> normal operation.
>>
>> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>
>> --
>> Changes since v2
>>  * Switch from 'int $2' to do_nmi()
>>  * Reworked commit message to more clearly explain the problem
>>
>> diff -r 2489c2926698 -r d7ea938044ac xen/arch/x86/hvm/vmx/vmx.c
>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>>          vector = intr_info & INTR_INFO_VECTOR_MASK;
>>          if ( vector == TRAP_machine_check )
>>              do_machine_check(regs);
>> +        else if ( vector == TRAP_nmi &&
>> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
>> +                  (X86_EVENTTYPE_NMI << 8) ) )
>> +            /* Must be called before interrupts are enabled to ensure
>> +             * the NMI handler code is run before the first IRET. The
>> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
>> +             */
>> +            do_nmi();
> But that's only half of it, at least as far as I recall the outcome of
> the discussion: You want an IRET (or VMRESUME) before possibly
> going into the scheduler (and hence not back to the current VM).
> And the same also on the PV exit path from an NMI.
>
> Jan

When I read this codepath, there seemed to be no consideration for
re-scheduling.  I will double check, but I think the VMRESUME is
unconditional if the VMEXIT reason was a real NMI.

~Andrew

>
>>          break;
>>      case EXIT_REASON_MCE_DURING_VMENTRY:
>>          do_machine_check(regs);
>> @@ -2442,7 +2450,6 @@ void vmx_vmexit_handler(struct cpu_user_
>>                   (X86_EVENTTYPE_NMI << 8) )
>>                  goto exit_and_crash;
>>              HVMTRACE_0D(NMI);
>> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>>              break;
>>          case TRAP_machine_check:
>>              HVMTRACE_0D(MCE);
>
>

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:18:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:18:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbYXD-0005B3-EQ; Thu, 22 Nov 2012 15:17:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbYXC-0005Ar-BT
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:17:46 +0000
Received: from [85.158.139.211:31919] by server-13.bemta-5.messagelabs.com id
	83/2D-27809-9124EA05; Thu, 22 Nov 2012 15:17:45 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353597458!21249762!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4919 invoked from network); 22 Nov 2012 15:17:38 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-206.messagelabs.com with SMTP;
	22 Nov 2012 15:17:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 15:17:38 +0000
Message-Id: <50AE505A02000078000AAA11@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 15:18:34 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>
References: <50AE214D.2080304@citrix.com>
	<50AE3AC102000078000AA9B3@nat28.tlf.novell.com>
	<50AE3FA9.9080703@citrix.com>
In-Reply-To: <50AE3FA9.9080703@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] blkfront failure on migrate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 16:07, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> On 22/11/12 13:46, Jan Beulich wrote:
>>>>> On 22.11.12 at 13:57, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>> In "Stage 1" as commented, we make a copy of the shadow map.  We then
>>> reset the contents of the real shadow map, and selectively copy the
>>> in-use entries back from the copy to the real map.
>>>
>>> Looking at the code, it appears possible to do this rearranging inplace
>>> in the real shadow map, without requiring any memory allocation.
>>>
>>> Is this a sensible suggestion or have I overlooked something?  This
>>> order-5 allocation is a disaster lying in wait for VMs with high memory
>>> pressure.
>> While merging the multi-page ring patches, I think I tried to make
>> this an in place copy operation, and it didn't work (don't recall
>> details though). This and/or the need to deal with shrinking ring
>> size across migration (maybe that was what really didn't work)
>> made me move stage 3 to kick_pending_request_queues(), and
>> allocate entries that actually need copying one by one, sticking
>> them on a list.
> 
> Where are your multi-page ring patches?  Are you saying this code is
> going to change very shortly?

Oh, I implied that this was for our (forward ported) kernel (which
can be found at http://kernel.opensuse.org/git, and the master
and SLE11-SP3 branches should have those patches).

> If the copy and copy back really cant be avoided, then making
> "sizeof(info->shadow)/PAGE_SIZE" allocations of order 0 would be
> substantially more friendly to environments with high memory pressure,
> at the cost of slightly more complicated indexing in the loop.

As I said, I converted the one big allocation into per-entry ones
(at once avoiding to allocate space for entries that aren't in use).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:18:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:18:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbYXD-0005B3-EQ; Thu, 22 Nov 2012 15:17:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbYXC-0005Ar-BT
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:17:46 +0000
Received: from [85.158.139.211:31919] by server-13.bemta-5.messagelabs.com id
	83/2D-27809-9124EA05; Thu, 22 Nov 2012 15:17:45 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353597458!21249762!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4919 invoked from network); 22 Nov 2012 15:17:38 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-206.messagelabs.com with SMTP;
	22 Nov 2012 15:17:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 15:17:38 +0000
Message-Id: <50AE505A02000078000AAA11@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 15:18:34 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>
References: <50AE214D.2080304@citrix.com>
	<50AE3AC102000078000AA9B3@nat28.tlf.novell.com>
	<50AE3FA9.9080703@citrix.com>
In-Reply-To: <50AE3FA9.9080703@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] blkfront failure on migrate
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 16:07, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> On 22/11/12 13:46, Jan Beulich wrote:
>>>>> On 22.11.12 at 13:57, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>> In "Stage 1" as commented, we make a copy of the shadow map.  We then
>>> reset the contents of the real shadow map, and selectively copy the
>>> in-use entries back from the copy to the real map.
>>>
>>> Looking at the code, it appears possible to do this rearranging inplace
>>> in the real shadow map, without requiring any memory allocation.
>>>
>>> Is this a sensible suggestion or have I overlooked something?  This
>>> order-5 allocation is a disaster lying in wait for VMs with high memory
>>> pressure.
>> While merging the multi-page ring patches, I think I tried to make
>> this an in place copy operation, and it didn't work (don't recall
>> details though). This and/or the need to deal with shrinking ring
>> size across migration (maybe that was what really didn't work)
>> made me move stage 3 to kick_pending_request_queues(), and
>> allocate entries that actually need copying one by one, sticking
>> them on a list.
> 
> Where are your multi-page ring patches?  Are you saying this code is
> going to change very shortly?

Oh, I implied that this was for our (forward ported) kernel (which
can be found at http://kernel.opensuse.org/git, and the master
and SLE11-SP3 branches should have those patches).

> If the copy and copy back really cant be avoided, then making
> "sizeof(info->shadow)/PAGE_SIZE" allocations of order 0 would be
> substantially more friendly to environments with high memory pressure,
> at the cost of slightly more complicated indexing in the loop.

As I said, I converted the one big allocation into per-entry ones
(at once avoiding to allocate space for entries that aren't in use).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:20:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:20:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbYa5-0005Mh-1j; Thu, 22 Nov 2012 15:20:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbYa4-0005MZ-41
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:20:44 +0000
Received: from [85.158.139.211:7379] by server-7.bemta-5.messagelabs.com id
	EE/BD-23096-BC24EA05; Thu, 22 Nov 2012 15:20:43 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1353597641!19183834!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22136 invoked from network); 22 Nov 2012 15:20:42 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-206.messagelabs.com with SMTP;
	22 Nov 2012 15:20:42 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 15:20:41 +0000
Message-Id: <50AE511302000078000AAA14@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 15:21:39 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<50AE4F8402000078000AAA02@nat28.tlf.novell.com>
	<50AE41DD.2030703@citrix.com>
In-Reply-To: <50AE41DD.2030703@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
 handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 16:16, Andrew Cooper <andrew.cooper3@citrix.com> wrote:

> On 22/11/12 15:15, Jan Beulich wrote:
>>>>> On 22.11.12 at 16:00, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>> The self_nmi() code cause's an NMI to be triggered by sending an APIC
>>> message to the local processor.  However, NMIs are blocked by the
>>> VMEXIT, until the next iret or VMENTER.
>>>
>>> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
>>>
>>> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
>>> completes.
>>>
>>> As a result, as soon as the VMENTER happens, an immediate VMEXIT
>>> happens as a result of the queued NMI.  We have seen hundreds of
>>> iterations of this VMEXIT/VMENTER loop before the HVM guest resumes
>>> normal operation.
>>>
>>> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>>
>>> --
>>> Changes since v2
>>>  * Switch from 'int $2' to do_nmi()
>>>  * Reworked commit message to more clearly explain the problem
>>>
>>> diff -r 2489c2926698 -r d7ea938044ac xen/arch/x86/hvm/vmx/vmx.c
>>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>>> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>>>          vector = intr_info & INTR_INFO_VECTOR_MASK;
>>>          if ( vector == TRAP_machine_check )
>>>              do_machine_check(regs);
>>> +        else if ( vector == TRAP_nmi &&
>>> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
>>> +                  (X86_EVENTTYPE_NMI << 8) ) )
>>> +            /* Must be called before interrupts are enabled to ensure
>>> +             * the NMI handler code is run before the first IRET. The
>>> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
>>> +             */
>>> +            do_nmi();
>> But that's only half of it, at least as far as I recall the outcome of
>> the discussion: You want an IRET (or VMRESUME) before possibly
>> going into the scheduler (and hence not back to the current VM).
>> And the same also on the PV exit path from an NMI.
> 
> When I read this codepath, there seemed to be no consideration for
> re-scheduling.  I will double check, but I think the VMRESUME is
> unconditional if the VMEXIT reason was a real NMI.

Interesting - I see nothing NMI-related in vmx/entry.S, i.e. it is
my understanding that just like in any other case you may end
up calling do_softirq on the way out from handling the NMI.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:20:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:20:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbYa5-0005Mh-1j; Thu, 22 Nov 2012 15:20:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbYa4-0005MZ-41
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:20:44 +0000
Received: from [85.158.139.211:7379] by server-7.bemta-5.messagelabs.com id
	EE/BD-23096-BC24EA05; Thu, 22 Nov 2012 15:20:43 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1353597641!19183834!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22136 invoked from network); 22 Nov 2012 15:20:42 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-206.messagelabs.com with SMTP;
	22 Nov 2012 15:20:42 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 15:20:41 +0000
Message-Id: <50AE511302000078000AAA14@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 15:21:39 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<50AE4F8402000078000AAA02@nat28.tlf.novell.com>
	<50AE41DD.2030703@citrix.com>
In-Reply-To: <50AE41DD.2030703@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
 handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 16:16, Andrew Cooper <andrew.cooper3@citrix.com> wrote:

> On 22/11/12 15:15, Jan Beulich wrote:
>>>>> On 22.11.12 at 16:00, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>> The self_nmi() code cause's an NMI to be triggered by sending an APIC
>>> message to the local processor.  However, NMIs are blocked by the
>>> VMEXIT, until the next iret or VMENTER.
>>>
>>> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
>>>
>>> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
>>> completes.
>>>
>>> As a result, as soon as the VMENTER happens, an immediate VMEXIT
>>> happens as a result of the queued NMI.  We have seen hundreds of
>>> iterations of this VMEXIT/VMENTER loop before the HVM guest resumes
>>> normal operation.
>>>
>>> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>>
>>> --
>>> Changes since v2
>>>  * Switch from 'int $2' to do_nmi()
>>>  * Reworked commit message to more clearly explain the problem
>>>
>>> diff -r 2489c2926698 -r d7ea938044ac xen/arch/x86/hvm/vmx/vmx.c
>>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>>> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>>>          vector = intr_info & INTR_INFO_VECTOR_MASK;
>>>          if ( vector == TRAP_machine_check )
>>>              do_machine_check(regs);
>>> +        else if ( vector == TRAP_nmi &&
>>> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
>>> +                  (X86_EVENTTYPE_NMI << 8) ) )
>>> +            /* Must be called before interrupts are enabled to ensure
>>> +             * the NMI handler code is run before the first IRET. The
>>> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
>>> +             */
>>> +            do_nmi();
>> But that's only half of it, at least as far as I recall the outcome of
>> the discussion: You want an IRET (or VMRESUME) before possibly
>> going into the scheduler (and hence not back to the current VM).
>> And the same also on the PV exit path from an NMI.
> 
> When I read this codepath, there seemed to be no consideration for
> re-scheduling.  I will double check, but I think the VMRESUME is
> unconditional if the VMEXIT reason was a real NMI.

Interesting - I see nothing NMI-related in vmx/entry.S, i.e. it is
my understanding that just like in any other case you may end
up calling do_softirq on the way out from handling the NMI.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:22:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbYbS-0005b9-N4; Thu, 22 Nov 2012 15:22:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TbYbQ-0005ao-RW
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:22:09 +0000
Received: from [85.158.139.211:9078] by server-16.bemta-5.messagelabs.com id
	D2/C0-04786-0234EA05; Thu, 22 Nov 2012 15:22:08 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1353597726!21147068!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29992 invoked from network); 22 Nov 2012 15:22:07 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 15:22:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="215282982"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	22 Nov 2012 15:22:05 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL03.citrite.net
	(10.13.107.80) with Microsoft SMTP Server id 14.2.318.1;
	Thu, 22 Nov 2012 10:22:04 -0500
Message-ID: <50AE431B.5090605@citrix.com>
Date: Thu, 22 Nov 2012 15:22:03 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<50AE4F8402000078000AAA02@nat28.tlf.novell.com>
	<50AE41DD.2030703@citrix.com>
In-Reply-To: <50AE41DD.2030703@citrix.com>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
 handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/12 15:16, Andrew Cooper wrote:
> On 22/11/12 15:15, Jan Beulich wrote:
>>>>> On 22.11.12 at 16:00, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>> The self_nmi() code cause's an NMI to be triggered by sending an APIC
>>> message to the local processor.  However, NMIs are blocked by the
>>> VMEXIT, until the next iret or VMENTER.
>>>
>>> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
>>>
>>> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
>>> completes.
>>>
>>> As a result, as soon as the VMENTER happens, an immediate VMEXIT
>>> happens as a result of the queued NMI.  We have seen hundreds of
>>> iterations of this VMEXIT/VMENTER loop before the HVM guest resumes
>>> normal operation.
>>>
>>> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>>
>>> --
>>> Changes since v2
>>>   * Switch from 'int $2' to do_nmi()
>>>   * Reworked commit message to more clearly explain the problem
>>>
>>> diff -r 2489c2926698 -r d7ea938044ac xen/arch/x86/hvm/vmx/vmx.c
>>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>>> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>>>           vector = intr_info & INTR_INFO_VECTOR_MASK;
>>>           if ( vector == TRAP_machine_check )
>>>               do_machine_check(regs);
>>> +        else if ( vector == TRAP_nmi &&
>>> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
>>> +                  (X86_EVENTTYPE_NMI << 8) ) )
>>> +            /* Must be called before interrupts are enabled to ensure
>>> +             * the NMI handler code is run before the first IRET. The
>>> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
>>> +             */
>>> +            do_nmi();
>> But that's only half of it, at least as far as I recall the outcome of
>> the discussion: You want an IRET (or VMRESUME) before possibly
>> going into the scheduler (and hence not back to the current VM).
>> And the same also on the PV exit path from an NMI.
>>
>> Jan
> When I read this codepath, there seemed to be no consideration for
> re-scheduling.  I will double check, but I think the VMRESUME is
> unconditional if the VMEXIT reason was a real NMI.

Technically, we could probably get a timer interrupt which causes a 
scheduling event, between the NMI and the VMEXIT. However, that timer 
interrupt will have an IRET at the end of it, so it fixes itself.
>
> ~Andrew
>
>>>           break;
>>>       case EXIT_REASON_MCE_DURING_VMENTRY:
>>>           do_machine_check(regs);
>>> @@ -2442,7 +2450,6 @@ void vmx_vmexit_handler(struct cpu_user_
>>>                    (X86_EVENTTYPE_NMI << 8) )
>>>                   goto exit_and_crash;
>>>               HVMTRACE_0D(NMI);
>>> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>>>               break;
>>>           case TRAP_machine_check:
>>>               HVMTRACE_0D(MCE);
>>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:22:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbYbS-0005b9-N4; Thu, 22 Nov 2012 15:22:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TbYbQ-0005ao-RW
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:22:09 +0000
Received: from [85.158.139.211:9078] by server-16.bemta-5.messagelabs.com id
	D2/C0-04786-0234EA05; Thu, 22 Nov 2012 15:22:08 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1353597726!21147068!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29992 invoked from network); 22 Nov 2012 15:22:07 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 15:22:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="215282982"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	22 Nov 2012 15:22:05 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL03.citrite.net
	(10.13.107.80) with Microsoft SMTP Server id 14.2.318.1;
	Thu, 22 Nov 2012 10:22:04 -0500
Message-ID: <50AE431B.5090605@citrix.com>
Date: Thu, 22 Nov 2012 15:22:03 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<50AE4F8402000078000AAA02@nat28.tlf.novell.com>
	<50AE41DD.2030703@citrix.com>
In-Reply-To: <50AE41DD.2030703@citrix.com>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
 handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/12 15:16, Andrew Cooper wrote:
> On 22/11/12 15:15, Jan Beulich wrote:
>>>>> On 22.11.12 at 16:00, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>> The self_nmi() code cause's an NMI to be triggered by sending an APIC
>>> message to the local processor.  However, NMIs are blocked by the
>>> VMEXIT, until the next iret or VMENTER.
>>>
>>> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
>>>
>>> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
>>> completes.
>>>
>>> As a result, as soon as the VMENTER happens, an immediate VMEXIT
>>> happens as a result of the queued NMI.  We have seen hundreds of
>>> iterations of this VMEXIT/VMENTER loop before the HVM guest resumes
>>> normal operation.
>>>
>>> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>>
>>> --
>>> Changes since v2
>>>   * Switch from 'int $2' to do_nmi()
>>>   * Reworked commit message to more clearly explain the problem
>>>
>>> diff -r 2489c2926698 -r d7ea938044ac xen/arch/x86/hvm/vmx/vmx.c
>>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>>> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>>>           vector = intr_info & INTR_INFO_VECTOR_MASK;
>>>           if ( vector == TRAP_machine_check )
>>>               do_machine_check(regs);
>>> +        else if ( vector == TRAP_nmi &&
>>> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
>>> +                  (X86_EVENTTYPE_NMI << 8) ) )
>>> +            /* Must be called before interrupts are enabled to ensure
>>> +             * the NMI handler code is run before the first IRET. The
>>> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
>>> +             */
>>> +            do_nmi();
>> But that's only half of it, at least as far as I recall the outcome of
>> the discussion: You want an IRET (or VMRESUME) before possibly
>> going into the scheduler (and hence not back to the current VM).
>> And the same also on the PV exit path from an NMI.
>>
>> Jan
> When I read this codepath, there seemed to be no consideration for
> re-scheduling.  I will double check, but I think the VMRESUME is
> unconditional if the VMEXIT reason was a real NMI.

Technically, we could probably get a timer interrupt which causes a 
scheduling event, between the NMI and the VMEXIT. However, that timer 
interrupt will have an IRET at the end of it, so it fixes itself.
>
> ~Andrew
>
>>>           break;
>>>       case EXIT_REASON_MCE_DURING_VMENTRY:
>>>           do_machine_check(regs);
>>> @@ -2442,7 +2450,6 @@ void vmx_vmexit_handler(struct cpu_user_
>>>                    (X86_EVENTTYPE_NMI << 8) )
>>>                   goto exit_and_crash;
>>>               HVMTRACE_0D(NMI);
>>> -            self_nmi(); /* Real NMI, vector 2: normal processing. */
>>>               break;
>>>           case TRAP_machine_check:
>>>               HVMTRACE_0D(MCE);
>>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:37:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:37:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbYqI-000603-C4; Thu, 22 Nov 2012 15:37:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbYqG-0005zy-QH
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:37:29 +0000
Received: from [85.158.137.99:56615] by server-15.bemta-3.messagelabs.com id
	EB/33-09445-3B64EA05; Thu, 22 Nov 2012 15:37:23 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1353598642!13366292!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15320 invoked from network); 22 Nov 2012 15:37:23 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 15:37:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="45407847"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 15:37:21 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 10:37:21 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbYq9-0007Fj-1t;
	Thu, 22 Nov 2012 15:37:21 +0000
Message-ID: <50AE46B0.6010807@citrix.com>
Date: Thu, 22 Nov 2012 15:37:20 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<50AE4F8402000078000AAA02@nat28.tlf.novell.com>
	<50AE41DD.2030703@citrix.com>
	<50AE511302000078000AAA14@nat28.tlf.novell.com>
In-Reply-To: <50AE511302000078000AAA14@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
	handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 22/11/12 15:21, Jan Beulich wrote:
>>>> On 22.11.12 at 16:16, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> On 22/11/12 15:15, Jan Beulich wrote:
>>>>>> On 22.11.12 at 16:00, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>>> The self_nmi() code cause's an NMI to be triggered by sending an APIC
>>>> message to the local processor.  However, NMIs are blocked by the
>>>> VMEXIT, until the next iret or VMENTER.
>>>>
>>>> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
>>>>
>>>> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
>>>> completes.
>>>>
>>>> As a result, as soon as the VMENTER happens, an immediate VMEXIT
>>>> happens as a result of the queued NMI.  We have seen hundreds of
>>>> iterations of this VMEXIT/VMENTER loop before the HVM guest resumes
>>>> normal operation.
>>>>
>>>> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
>>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>>>
>>>> --
>>>> Changes since v2
>>>>  * Switch from 'int $2' to do_nmi()
>>>>  * Reworked commit message to more clearly explain the problem
>>>>
>>>> diff -r 2489c2926698 -r d7ea938044ac xen/arch/x86/hvm/vmx/vmx.c
>>>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>>>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>>>> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>>>>          vector = intr_info & INTR_INFO_VECTOR_MASK;
>>>>          if ( vector == TRAP_machine_check )
>>>>              do_machine_check(regs);
>>>> +        else if ( vector == TRAP_nmi &&
>>>> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
>>>> +                  (X86_EVENTTYPE_NMI << 8) ) )
>>>> +            /* Must be called before interrupts are enabled to ensure
>>>> +             * the NMI handler code is run before the first IRET. The
>>>> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
>>>> +             */
>>>> +            do_nmi();
>>> But that's only half of it, at least as far as I recall the outcome of
>>> the discussion: You want an IRET (or VMRESUME) before possibly
>>> going into the scheduler (and hence not back to the current VM).
>>> And the same also on the PV exit path from an NMI.
>> When I read this codepath, there seemed to be no consideration for
>> re-scheduling.  I will double check, but I think the VMRESUME is
>> unconditional if the VMEXIT reason was a real NMI.
> Interesting - I see nothing NMI-related in vmx/entry.S, i.e. it is
> my understanding that just like in any other case you may end
> up calling do_softirq on the way out from handling the NMI.
>
> Jan
>

Ah yes - vmx_asm_do_vmentry does have the potential to process softirqs,
which we will want to do with NMIs enabled.  I missed that last time I
looked.

So we need to deliberately execute an iretd.  int $2 is unusable because
it adds an extra dimension to the fake NMI corruption issue if you get
the combination int $2->MCE->NMI before the int $2 has correctly saved
its exception frame.

A quick solution would be to execute a noop function with
run_in_exception_handler().  Alternatively, I can code enable_nmi() or
so which does an inline iret to itself.  Which of these would you prefer?

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:37:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:37:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbYqI-000603-C4; Thu, 22 Nov 2012 15:37:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbYqG-0005zy-QH
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:37:29 +0000
Received: from [85.158.137.99:56615] by server-15.bemta-3.messagelabs.com id
	EB/33-09445-3B64EA05; Thu, 22 Nov 2012 15:37:23 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1353598642!13366292!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15320 invoked from network); 22 Nov 2012 15:37:23 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 15:37:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="45407847"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 15:37:21 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 10:37:21 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbYq9-0007Fj-1t;
	Thu, 22 Nov 2012 15:37:21 +0000
Message-ID: <50AE46B0.6010807@citrix.com>
Date: Thu, 22 Nov 2012 15:37:20 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<50AE4F8402000078000AAA02@nat28.tlf.novell.com>
	<50AE41DD.2030703@citrix.com>
	<50AE511302000078000AAA14@nat28.tlf.novell.com>
In-Reply-To: <50AE511302000078000AAA14@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
	handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 22/11/12 15:21, Jan Beulich wrote:
>>>> On 22.11.12 at 16:16, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> On 22/11/12 15:15, Jan Beulich wrote:
>>>>>> On 22.11.12 at 16:00, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>>> The self_nmi() code cause's an NMI to be triggered by sending an APIC
>>>> message to the local processor.  However, NMIs are blocked by the
>>>> VMEXIT, until the next iret or VMENTER.
>>>>
>>>> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
>>>>
>>>> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
>>>> completes.
>>>>
>>>> As a result, as soon as the VMENTER happens, an immediate VMEXIT
>>>> happens as a result of the queued NMI.  We have seen hundreds of
>>>> iterations of this VMEXIT/VMENTER loop before the HVM guest resumes
>>>> normal operation.
>>>>
>>>> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
>>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>>>
>>>> --
>>>> Changes since v2
>>>>  * Switch from 'int $2' to do_nmi()
>>>>  * Reworked commit message to more clearly explain the problem
>>>>
>>>> diff -r 2489c2926698 -r d7ea938044ac xen/arch/x86/hvm/vmx/vmx.c
>>>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>>>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>>>> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>>>>          vector = intr_info & INTR_INFO_VECTOR_MASK;
>>>>          if ( vector == TRAP_machine_check )
>>>>              do_machine_check(regs);
>>>> +        else if ( vector == TRAP_nmi &&
>>>> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
>>>> +                  (X86_EVENTTYPE_NMI << 8) ) )
>>>> +            /* Must be called before interrupts are enabled to ensure
>>>> +             * the NMI handler code is run before the first IRET. The
>>>> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
>>>> +             */
>>>> +            do_nmi();
>>> But that's only half of it, at least as far as I recall the outcome of
>>> the discussion: You want an IRET (or VMRESUME) before possibly
>>> going into the scheduler (and hence not back to the current VM).
>>> And the same also on the PV exit path from an NMI.
>> When I read this codepath, there seemed to be no consideration for
>> re-scheduling.  I will double check, but I think the VMRESUME is
>> unconditional if the VMEXIT reason was a real NMI.
> Interesting - I see nothing NMI-related in vmx/entry.S, i.e. it is
> my understanding that just like in any other case you may end
> up calling do_softirq on the way out from handling the NMI.
>
> Jan
>

Ah yes - vmx_asm_do_vmentry does have the potential to process softirqs,
which we will want to do with NMIs enabled.  I missed that last time I
looked.

So we need to deliberately execute an iretd.  int $2 is unusable because
it adds an extra dimension to the fake NMI corruption issue if you get
the combination int $2->MCE->NMI before the int $2 has correctly saved
its exception frame.

A quick solution would be to execute a noop function with
run_in_exception_handler().  Alternatively, I can code enable_nmi() or
so which does an inline iret to itself.  Which of these would you prefer?

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:47:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:47:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbYzq-0006GP-H1; Thu, 22 Nov 2012 15:47:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TbYzo-0006GK-SB
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 15:47:21 +0000
Received: from [193.109.254.147:3561] by server-14.bemta-14.messagelabs.com id
	E4/8B-14517-8094EA05; Thu, 22 Nov 2012 15:47:20 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353599238!9312544!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30301 invoked from network); 22 Nov 2012 15:47:18 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 15:47:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="15958859"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 15:47:18 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 22 Nov 2012 15:47:18 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TbYzl-0002IE-Q2;
	Thu, 22 Nov 2012 15:47:17 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TbYzl-0006dV-Go;
	Thu, 22 Nov 2012 15:47:17 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14465-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 22 Nov 2012 15:47:17 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14465: regressions - trouble:
	broken/fail/pass
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14465 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14465/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-win7-amd64  5 xen-boot                fail REGR. vs. 14464
 test-amd64-i386-xl-credit2    3 host-install(3)         broken REGR. vs. 14464

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14464
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14464
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14464
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14464

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  7b4449bdb980
baseline version:
 xen                  2489c2926698

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   broken  
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26184:7b4449bdb980
tag:         tip
user:        Jan Beulich <jbeulich@suse.com>
date:        Thu Nov 22 10:47:58 2012 +0100
    
    implement vmap()
    
    ... and use it as basis for a proper ioremap() on x86.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26183:c139ca92edca
user:        Jan Beulich <jbeulich@suse.com>
date:        Thu Nov 22 10:03:23 2012 +0100
    
    x86/HPET: fix FSB interrupt masking
    
    HPET_TN_FSB is not really suitable for masking interrupts - it merely
    switches between the two delivery methods. The right way of masking is
    through the HPET_TN_ENABLE bit (which really is an interrupt enable,
    not a counter enable or some such). This is even more so with certain
    chip sets not even allowing HPET_TN_FSB to be cleared on some of the
    channels.
    
    Further, all the setup of the channel should happen before actually
    enabling the interrupt, which requires splitting legacy and FSB logic.
    
    Finally this also fixes an S3 resume problem (HPET_TN_FSB did not get
    set in hpet_broadcast_resume(), and hpet_msi_unmask() doesn't get
    called from the general resume code either afaict).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26182:af6b72a224e9
user:        Jan Beulich <jbeulich@suse.com>
date:        Thu Nov 22 10:02:18 2012 +0100
    
    x86/HPET: include FSB interrupt information in 'M' debug key output
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26181:f004f611bf53
user:        Jan Beulich <jbeulich@suse.com>
date:        Thu Nov 22 09:59:50 2012 +0100
    
    VT-d: clean up map/unmap log messages
    
    - printing file name and line number here is pointless
    - they are guest related, so should get their log level filter
      accordingly
    - include segment numbers and canonicalize number widths
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26180:2489c2926698
user:        Ian Campbell <Ian.Campbell@citrix.com>
date:        Tue Nov 20 17:17:40 2012 +0000
    
    xend: reinstate XendOptionsFile.get_external_migration_tool
    
    This was removed by 26167:31dcc0e08754 "xend: Remove old vtpm support
    from xm" but at least one caller was left. Reinstate with
    s/TPM/device/ since it appears that this functionality could apply
    elsewhere.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:47:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:47:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbYzq-0006GP-H1; Thu, 22 Nov 2012 15:47:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TbYzo-0006GK-SB
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 15:47:21 +0000
Received: from [193.109.254.147:3561] by server-14.bemta-14.messagelabs.com id
	E4/8B-14517-8094EA05; Thu, 22 Nov 2012 15:47:20 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353599238!9312544!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30301 invoked from network); 22 Nov 2012 15:47:18 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 15:47:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="15958859"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 15:47:18 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 22 Nov 2012 15:47:18 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TbYzl-0002IE-Q2;
	Thu, 22 Nov 2012 15:47:17 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TbYzl-0006dV-Go;
	Thu, 22 Nov 2012 15:47:17 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14465-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 22 Nov 2012 15:47:17 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14465: regressions - trouble:
	broken/fail/pass
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14465 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14465/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-win7-amd64  5 xen-boot                fail REGR. vs. 14464
 test-amd64-i386-xl-credit2    3 host-install(3)         broken REGR. vs. 14464

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14464
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14464
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14464
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14464

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  7b4449bdb980
baseline version:
 xen                  2489c2926698

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   broken  
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26184:7b4449bdb980
tag:         tip
user:        Jan Beulich <jbeulich@suse.com>
date:        Thu Nov 22 10:47:58 2012 +0100
    
    implement vmap()
    
    ... and use it as basis for a proper ioremap() on x86.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26183:c139ca92edca
user:        Jan Beulich <jbeulich@suse.com>
date:        Thu Nov 22 10:03:23 2012 +0100
    
    x86/HPET: fix FSB interrupt masking
    
    HPET_TN_FSB is not really suitable for masking interrupts - it merely
    switches between the two delivery methods. The right way of masking is
    through the HPET_TN_ENABLE bit (which really is an interrupt enable,
    not a counter enable or some such). This is even more so with certain
    chip sets not even allowing HPET_TN_FSB to be cleared on some of the
    channels.
    
    Further, all the setup of the channel should happen before actually
    enabling the interrupt, which requires splitting legacy and FSB logic.
    
    Finally this also fixes an S3 resume problem (HPET_TN_FSB did not get
    set in hpet_broadcast_resume(), and hpet_msi_unmask() doesn't get
    called from the general resume code either afaict).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26182:af6b72a224e9
user:        Jan Beulich <jbeulich@suse.com>
date:        Thu Nov 22 10:02:18 2012 +0100
    
    x86/HPET: include FSB interrupt information in 'M' debug key output
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26181:f004f611bf53
user:        Jan Beulich <jbeulich@suse.com>
date:        Thu Nov 22 09:59:50 2012 +0100
    
    VT-d: clean up map/unmap log messages
    
    - printing file name and line number here is pointless
    - they are guest related, so should get their log level filter
      accordingly
    - include segment numbers and canonicalize number widths
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    
changeset:   26180:2489c2926698
user:        Ian Campbell <Ian.Campbell@citrix.com>
date:        Tue Nov 20 17:17:40 2012 +0000
    
    xend: reinstate XendOptionsFile.get_external_migration_tool
    
    This was removed by 26167:31dcc0e08754 "xend: Remove old vtpm support
    from xm" but at least one caller was left. Reinstate with
    s/TPM/device/ since it appears that this functionality could apply
    elsewhere.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:54:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:54:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZ6u-0006W7-Dx; Thu, 22 Nov 2012 15:54:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbZ6s-0006W0-FZ
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:54:38 +0000
Received: from [85.158.139.211:27281] by server-12.bemta-5.messagelabs.com id
	7C/DC-02886-DBA4EA05; Thu, 22 Nov 2012 15:54:37 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353599677!21216633!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14854 invoked from network); 22 Nov 2012 15:54:37 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-206.messagelabs.com with SMTP;
	22 Nov 2012 15:54:37 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 15:54:36 +0000
Message-Id: <50AE590502000078000AAA48@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 15:55:33 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<50AE4F8402000078000AAA02@nat28.tlf.novell.com>
	<50AE41DD.2030703@citrix.com>
	<50AE511302000078000AAA14@nat28.tlf.novell.com>
	<50AE46B0.6010807@citrix.com>
In-Reply-To: <50AE46B0.6010807@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
 handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 16:37, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> A quick solution would be to execute a noop function with
> run_in_exception_handler().  Alternatively, I can code enable_nmi() or
> so which does an inline iret to itself.  Which of these would you prefer?

I would actually consider avoiding to run softirqs altogether in that
case, just like native Linux doesn't do any event or scheduler
processing in that case.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 15:54:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 15:54:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZ6u-0006W7-Dx; Thu, 22 Nov 2012 15:54:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbZ6s-0006W0-FZ
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:54:38 +0000
Received: from [85.158.139.211:27281] by server-12.bemta-5.messagelabs.com id
	7C/DC-02886-DBA4EA05; Thu, 22 Nov 2012 15:54:37 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353599677!21216633!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14854 invoked from network); 22 Nov 2012 15:54:37 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-206.messagelabs.com with SMTP;
	22 Nov 2012 15:54:37 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 15:54:36 +0000
Message-Id: <50AE590502000078000AAA48@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 15:55:33 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<50AE4F8402000078000AAA02@nat28.tlf.novell.com>
	<50AE41DD.2030703@citrix.com>
	<50AE511302000078000AAA14@nat28.tlf.novell.com>
	<50AE46B0.6010807@citrix.com>
In-Reply-To: <50AE46B0.6010807@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
 handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 16:37, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> A quick solution would be to execute a noop function with
> run_in_exception_handler().  Alternatively, I can code enable_nmi() or
> so which does an inline iret to itself.  Which of these would you prefer?

I would actually consider avoiding to run softirqs altogether in that
case, just like native Linux doesn't do any event or scheduler
processing in that case.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:00:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:00:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZBy-0006eD-5d; Thu, 22 Nov 2012 15:59:54 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbZBw-0006e7-OU
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:59:52 +0000
Received: from [193.109.254.147:29384] by server-7.bemta-14.messagelabs.com id
	F8/08-02272-6FB4EA05; Thu, 22 Nov 2012 15:59:50 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353599990!4985759!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12688 invoked from network); 22 Nov 2012 15:59:50 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-27.messagelabs.com with SMTP;
	22 Nov 2012 15:59:50 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 15:59:49 +0000
Message-Id: <50AE5A3F02000078000AAA57@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 16:00:47 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mats Petersson" <mats.petersson@citrix.com>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<50AE4F8402000078000AAA02@nat28.tlf.novell.com>
	<50AE41DD.2030703@citrix.com> <50AE431B.5090605@citrix.com>
In-Reply-To: <50AE431B.5090605@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
 handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 16:22, Mats Petersson <mats.petersson@citrix.com> wrote:
> On 22/11/12 15:16, Andrew Cooper wrote:
>> On 22/11/12 15:15, Jan Beulich wrote:
>>>>>> On 22.11.12 at 16:00, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>>> The self_nmi() code cause's an NMI to be triggered by sending an APIC
>>>> message to the local processor.  However, NMIs are blocked by the
>>>> VMEXIT, until the next iret or VMENTER.
>>>>
>>>> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
>>>>
>>>> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
>>>> completes.
>>>>
>>>> As a result, as soon as the VMENTER happens, an immediate VMEXIT
>>>> happens as a result of the queued NMI.  We have seen hundreds of
>>>> iterations of this VMEXIT/VMENTER loop before the HVM guest resumes
>>>> normal operation.
>>>>
>>>> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
>>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>>>
>>>> --
>>>> Changes since v2
>>>>   * Switch from 'int $2' to do_nmi()
>>>>   * Reworked commit message to more clearly explain the problem
>>>>
>>>> diff -r 2489c2926698 -r d7ea938044ac xen/arch/x86/hvm/vmx/vmx.c
>>>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>>>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>>>> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>>>>           vector = intr_info & INTR_INFO_VECTOR_MASK;
>>>>           if ( vector == TRAP_machine_check )
>>>>               do_machine_check(regs);
>>>> +        else if ( vector == TRAP_nmi &&
>>>> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
>>>> +                  (X86_EVENTTYPE_NMI << 8) ) )
>>>> +            /* Must be called before interrupts are enabled to ensure
>>>> +             * the NMI handler code is run before the first IRET. The
>>>> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
>>>> +             */
>>>> +            do_nmi();
>>> But that's only half of it, at least as far as I recall the outcome of
>>> the discussion: You want an IRET (or VMRESUME) before possibly
>>> going into the scheduler (and hence not back to the current VM).
>>> And the same also on the PV exit path from an NMI.
>>>
>>> Jan
>> When I read this codepath, there seemed to be no consideration for
>> re-scheduling.  I will double check, but I think the VMRESUME is
>> unconditional if the VMEXIT reason was a real NMI.
> 
> Technically, we could probably get a timer interrupt which causes a 
> scheduling event, between the NMI and the VMEXIT. However, that timer 
> interrupt will have an IRET at the end of it, so it fixes itself.

Not exactly - such a timer interrupt wouldn't cause any scheduling
to happen (this and other softirqs get run only when exiting to a
guest, or from an idle vCPU); when exiting to the hypervisor
nothing like that happens (and it would be catastrophic if it did).

Furthermore, interrupts should _never_ get enabled while handling
an NMI.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:00:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:00:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZBy-0006eD-5d; Thu, 22 Nov 2012 15:59:54 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbZBw-0006e7-OU
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 15:59:52 +0000
Received: from [193.109.254.147:29384] by server-7.bemta-14.messagelabs.com id
	F8/08-02272-6FB4EA05; Thu, 22 Nov 2012 15:59:50 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353599990!4985759!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12688 invoked from network); 22 Nov 2012 15:59:50 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-27.messagelabs.com with SMTP;
	22 Nov 2012 15:59:50 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 15:59:49 +0000
Message-Id: <50AE5A3F02000078000AAA57@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 16:00:47 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mats Petersson" <mats.petersson@citrix.com>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<50AE4F8402000078000AAA02@nat28.tlf.novell.com>
	<50AE41DD.2030703@citrix.com> <50AE431B.5090605@citrix.com>
In-Reply-To: <50AE431B.5090605@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
 handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 16:22, Mats Petersson <mats.petersson@citrix.com> wrote:
> On 22/11/12 15:16, Andrew Cooper wrote:
>> On 22/11/12 15:15, Jan Beulich wrote:
>>>>>> On 22.11.12 at 16:00, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>>> The self_nmi() code cause's an NMI to be triggered by sending an APIC
>>>> message to the local processor.  However, NMIs are blocked by the
>>>> VMEXIT, until the next iret or VMENTER.
>>>>
>>>> Volume 3 Chapter 27 Section 1 of the Intel SDM states:
>>>>
>>>> An NMI causes subsequent NMIs to be blocked, but only after the VM exit
>>>> completes.
>>>>
>>>> As a result, as soon as the VMENTER happens, an immediate VMEXIT
>>>> happens as a result of the queued NMI.  We have seen hundreds of
>>>> iterations of this VMEXIT/VMENTER loop before the HVM guest resumes
>>>> normal operation.
>>>>
>>>> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
>>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>>>
>>>> --
>>>> Changes since v2
>>>>   * Switch from 'int $2' to do_nmi()
>>>>   * Reworked commit message to more clearly explain the problem
>>>>
>>>> diff -r 2489c2926698 -r d7ea938044ac xen/arch/x86/hvm/vmx/vmx.c
>>>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>>>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>>>> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>>>>           vector = intr_info & INTR_INFO_VECTOR_MASK;
>>>>           if ( vector == TRAP_machine_check )
>>>>               do_machine_check(regs);
>>>> +        else if ( vector == TRAP_nmi &&
>>>> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
>>>> +                  (X86_EVENTTYPE_NMI << 8) ) )
>>>> +            /* Must be called before interrupts are enabled to ensure
>>>> +             * the NMI handler code is run before the first IRET. The
>>>> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
>>>> +             */
>>>> +            do_nmi();
>>> But that's only half of it, at least as far as I recall the outcome of
>>> the discussion: You want an IRET (or VMRESUME) before possibly
>>> going into the scheduler (and hence not back to the current VM).
>>> And the same also on the PV exit path from an NMI.
>>>
>>> Jan
>> When I read this codepath, there seemed to be no consideration for
>> re-scheduling.  I will double check, but I think the VMRESUME is
>> unconditional if the VMEXIT reason was a real NMI.
> 
> Technically, we could probably get a timer interrupt which causes a 
> scheduling event, between the NMI and the VMEXIT. However, that timer 
> interrupt will have an IRET at the end of it, so it fixes itself.

Not exactly - such a timer interrupt wouldn't cause any scheduling
to happen (this and other softirqs get run only when exiting to a
guest, or from an idle vCPU); when exiting to the hypervisor
nothing like that happens (and it would be catastrophic if it did).

Furthermore, interrupts should _never_ get enabled while handling
an NMI.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:06:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:06:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZIC-0007Jt-0t; Thu, 22 Nov 2012 16:06:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbZIB-0007Jo-2X
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 16:06:19 +0000
Received: from [193.109.254.147:9054] by server-1.bemta-14.messagelabs.com id
	89/AD-25314-A7D4EA05; Thu, 22 Nov 2012 16:06:18 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1353600301!1556373!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26336 invoked from network); 22 Nov 2012 16:05:02 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 16:05:02 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="215285568"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 16:05:00 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 11:05:00 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbZGu-0007eX-C0;
	Thu, 22 Nov 2012 16:05:00 +0000
Message-ID: <50AE4D2C.1040104@citrix.com>
Date: Thu, 22 Nov 2012 16:05:00 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<50AE4F8402000078000AAA02@nat28.tlf.novell.com>
	<50AE41DD.2030703@citrix.com>
	<50AE511302000078000AAA14@nat28.tlf.novell.com>
	<50AE46B0.6010807@citrix.com>
	<50AE590502000078000AAA48@nat28.tlf.novell.com>
In-Reply-To: <50AE590502000078000AAA48@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
	handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/12 15:55, Jan Beulich wrote:
>>>> On 22.11.12 at 16:37, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> A quick solution would be to execute a noop function with
>> run_in_exception_handler().  Alternatively, I can code enable_nmi() or
>> so which does an inline iret to itself.  Which of these would you prefer?
> I would actually consider avoiding to run softirqs altogether in that
> case, just like native Linux doesn't do any event or scheduler
> processing in that case.
>
> Jan
>

That would probably be the easiest solution.

I was already going to do the same for the rentrant NMI and MCE handling
case (and also the process pending upcalls checking), due to the
complexities of fixing the race condition at the end of the handler.

Unfortunately, I don't think I have time to look at this issue
immediately, but if it is ok to wait till the beginning of next week, I
can roll it into the main dev work for the other NMI/MCE work.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:06:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:06:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZIC-0007Jt-0t; Thu, 22 Nov 2012 16:06:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbZIB-0007Jo-2X
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 16:06:19 +0000
Received: from [193.109.254.147:9054] by server-1.bemta-14.messagelabs.com id
	89/AD-25314-A7D4EA05; Thu, 22 Nov 2012 16:06:18 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1353600301!1556373!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26336 invoked from network); 22 Nov 2012 16:05:02 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 16:05:02 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="215285568"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 16:05:00 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 11:05:00 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbZGu-0007eX-C0;
	Thu, 22 Nov 2012 16:05:00 +0000
Message-ID: <50AE4D2C.1040104@citrix.com>
Date: Thu, 22 Nov 2012 16:05:00 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<50AE4F8402000078000AAA02@nat28.tlf.novell.com>
	<50AE41DD.2030703@citrix.com>
	<50AE511302000078000AAA14@nat28.tlf.novell.com>
	<50AE46B0.6010807@citrix.com>
	<50AE590502000078000AAA48@nat28.tlf.novell.com>
In-Reply-To: <50AE590502000078000AAA48@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
	handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/12 15:55, Jan Beulich wrote:
>>>> On 22.11.12 at 16:37, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> A quick solution would be to execute a noop function with
>> run_in_exception_handler().  Alternatively, I can code enable_nmi() or
>> so which does an inline iret to itself.  Which of these would you prefer?
> I would actually consider avoiding to run softirqs altogether in that
> case, just like native Linux doesn't do any event or scheduler
> processing in that case.
>
> Jan
>

That would probably be the easiest solution.

I was already going to do the same for the rentrant NMI and MCE handling
case (and also the process pending upcalls checking), due to the
complexities of fixing the race condition at the end of the handler.

Unfortunately, I don't think I have time to look at this issue
immediately, but if it is ok to wait till the beginning of next week, I
can roll it into the main dev work for the other NMI/MCE work.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:12:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:12:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZNc-0007aa-0N; Thu, 22 Nov 2012 16:11:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbZNa-0007aU-JG
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 16:11:54 +0000
Received: from [85.158.143.99:15467] by server-3.bemta-4.messagelabs.com id
	18/C6-06841-9CE4EA05; Thu, 22 Nov 2012 16:11:53 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1353600713!23469933!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11329 invoked from network); 22 Nov 2012 16:11:53 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-216.messagelabs.com with SMTP;
	22 Nov 2012 16:11:53 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 16:11:53 +0000
Message-Id: <50AE5D1102000078000AAA69@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 16:12:49 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<50AE4F8402000078000AAA02@nat28.tlf.novell.com>
	<50AE41DD.2030703@citrix.com>
	<50AE511302000078000AAA14@nat28.tlf.novell.com>
	<50AE46B0.6010807@citrix.com>
	<50AE590502000078000AAA48@nat28.tlf.novell.com>
	<50AE4D2C.1040104@citrix.com>
In-Reply-To: <50AE4D2C.1040104@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
 handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 17:05, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> On 22/11/12 15:55, Jan Beulich wrote:
>>>>> On 22.11.12 at 16:37, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>> A quick solution would be to execute a noop function with
>>> run_in_exception_handler().  Alternatively, I can code enable_nmi() or
>>> so which does an inline iret to itself.  Which of these would you prefer?
>> I would actually consider avoiding to run softirqs altogether in that
>> case, just like native Linux doesn't do any event or scheduler
>> processing in that case.
> 
> That would probably be the easiest solution.
> 
> I was already going to do the same for the rentrant NMI and MCE handling
> case (and also the process pending upcalls checking), due to the
> complexities of fixing the race condition at the end of the handler.
> 
> Unfortunately, I don't think I have time to look at this issue
> immediately, but if it is ok to wait till the beginning of next week, I

That's fine of course.

> can roll it into the main dev work for the other NMI/MCE work.

Hmm, that would mean it's going to be more difficult to backport.
I'd prefer having this in as simple a fashion as possible in the
patch here, and then have your other patch(es) build on top of
that.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:12:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:12:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZNc-0007aa-0N; Thu, 22 Nov 2012 16:11:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbZNa-0007aU-JG
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 16:11:54 +0000
Received: from [85.158.143.99:15467] by server-3.bemta-4.messagelabs.com id
	18/C6-06841-9CE4EA05; Thu, 22 Nov 2012 16:11:53 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1353600713!23469933!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11329 invoked from network); 22 Nov 2012 16:11:53 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-216.messagelabs.com with SMTP;
	22 Nov 2012 16:11:53 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 22 Nov 2012 16:11:53 +0000
Message-Id: <50AE5D1102000078000AAA69@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 22 Nov 2012 16:12:49 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<50AE4F8402000078000AAA02@nat28.tlf.novell.com>
	<50AE41DD.2030703@citrix.com>
	<50AE511302000078000AAA14@nat28.tlf.novell.com>
	<50AE46B0.6010807@citrix.com>
	<50AE590502000078000AAA48@nat28.tlf.novell.com>
	<50AE4D2C.1040104@citrix.com>
In-Reply-To: <50AE4D2C.1040104@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
 handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 17:05, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> On 22/11/12 15:55, Jan Beulich wrote:
>>>>> On 22.11.12 at 16:37, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>> A quick solution would be to execute a noop function with
>>> run_in_exception_handler().  Alternatively, I can code enable_nmi() or
>>> so which does an inline iret to itself.  Which of these would you prefer?
>> I would actually consider avoiding to run softirqs altogether in that
>> case, just like native Linux doesn't do any event or scheduler
>> processing in that case.
> 
> That would probably be the easiest solution.
> 
> I was already going to do the same for the rentrant NMI and MCE handling
> case (and also the process pending upcalls checking), due to the
> complexities of fixing the race condition at the end of the handler.
> 
> Unfortunately, I don't think I have time to look at this issue
> immediately, but if it is ok to wait till the beginning of next week, I

That's fine of course.

> can roll it into the main dev work for the other NMI/MCE work.

Hmm, that would mean it's going to be more difficult to backport.
I'd prefer having this in as simple a fashion as possible in the
patch here, and then have your other patch(es) build on top of
that.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:18:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:18:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZTX-0007jv-Pe; Thu, 22 Nov 2012 16:18:03 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TbZTX-0007jp-2v
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 16:18:03 +0000
Received: from [85.158.139.211:29631] by server-6.bemta-5.messagelabs.com id
	57/B2-19321-A305EA05; Thu, 22 Nov 2012 16:18:02 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353601080!21157602!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3789 invoked from network); 22 Nov 2012 16:18:01 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 16:18:01 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="215286472"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 16:17:40 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 11:17:40 -0500
Received: from whitby.uk.xensource.com ([10.80.2.60])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<tim@xen.org>) id 1TbZT9-0007pg-T2; Thu, 22 Nov 2012 16:17:39 +0000
Received: from tdeegan by whitby.uk.xensource.com with local (Exim 4.76)
	(envelope-from <tim@xen.org>)	id 1TbZT9-0002Hz-Ln;
	Thu, 22 Nov 2012 16:17:39 +0000
MIME-Version: 1.0
X-Mercurial-Node: ffc59d2fc9980c660941eb24cbe827c1142d1fd0
Message-ID: <ffc59d2fc9980c660941.1353601059@whitby.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.0.1
Date: Thu, 22 Nov 2012 16:17:39 +0000
From: Tim Deegan <tim@xen.org>
To: xen-devel@lists.xen.org
Cc: stefano.stabellini@citrix.com, ian.campbell@citrix.com
Subject: [Xen-devel] [PATCH] arm: Tidy up flush_xen_dcache()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1353600936 0
# Node ID ffc59d2fc9980c660941eb24cbe827c1142d1fd0
# Parent  7b4449bdb980caee8efc498d5ea48f772331df2f
arm: Tidy up flush_xen_dcache().

 - Use a compile-time-constant check for whether we can safely flush
   just one cacheline.  This reduces the common case from 28
   instructions to three.
 - Pass an object to the macro, not a pointer, so we can detect
   attempts to flush arrays.
 - Decode CCSIDR correctly to get cacheline size.
 - Remove some redundant DSBs at the call sites.

Signed-off-by: Tim Deegan <tim@xen.org>

diff -r 7b4449bdb980 -r ffc59d2fc998 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Thu Nov 22 10:47:58 2012 +0100
+++ b/xen/arch/arm/mm.c	Thu Nov 22 16:15:36 2012 +0000
@@ -247,7 +247,7 @@ void __init setup_pagetables(unsigned lo
 
     /* Change pagetables to the copy in the relocated Xen */
     boot_httbr = (unsigned long) xen_pgtable + phys_offset;
-    flush_xen_dcache_va(&boot_httbr);
+    flush_xen_dcache(boot_httbr);
     flush_xen_dcache_va_range((void*)dest_va, _end - _start);
     flush_xen_text_tlb();
 
diff -r 7b4449bdb980 -r ffc59d2fc998 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Thu Nov 22 10:47:58 2012 +0100
+++ b/xen/arch/arm/setup.c	Thu Nov 22 16:15:36 2012 +0000
@@ -175,6 +175,21 @@ static void __init setup_mm(unsigned lon
     end_boot_allocator();
 }
 
+size_t __read_mostly cacheline_bytes;
+
+/* Very early check of the CPU cache properties */
+void __init setup_cache(void)
+{
+    uint32_t ccsid;
+
+    /* Read the cache size ID register for the level-0 data cache */
+    WRITE_CP32(0, CSSELR);
+    ccsid = READ_CP32(CCSIDR);
+
+    /* Low 3 bits are log2(cacheline size in words) - 2. */
+    cacheline_bytes = 1U << (4 + (ccsid & 0x7));
+}
+
 /* C entry point for boot CPU */
 void __init start_xen(unsigned long boot_phys_offset,
                       unsigned long arm_type,
@@ -185,6 +200,8 @@ void __init start_xen(unsigned long boot
     size_t fdt_size;
     int cpus, i;
 
+    setup_cache();
+
     smp_clear_cpu_maps();
 
     fdt = (void *)BOOT_MISC_VIRT_START
diff -r 7b4449bdb980 -r ffc59d2fc998 xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Thu Nov 22 10:47:58 2012 +0100
+++ b/xen/arch/arm/smpboot.c	Thu Nov 22 16:15:36 2012 +0000
@@ -118,8 +118,8 @@ make_cpus_ready(unsigned int max_cpus, u
         /* Tell the next CPU to get ready */
         /* TODO: handle boards where CPUIDs are not contiguous */
         *gate = i;
-        flush_xen_dcache_va(gate);
-        asm volatile("dsb; isb; sev");
+        flush_xen_dcache(*gate);
+        asm volatile("isb; sev");
         /* And wait for it to respond */
         while ( ready_cpus < i )
             smp_rmb();
@@ -217,8 +217,8 @@ int __cpu_up(unsigned int cpu)
     smp_up_cpu = cpu;
     /* we need to make sure that the change to smp_up_cpu is visible to
      * secondary cpus with D-cache off */
-    flush_xen_dcache_va(&smp_up_cpu);
-    asm volatile("dsb; isb; sev");
+    flush_xen_dcache(smp_up_cpu);
+    asm volatile("isb; sev");
 
     while ( !cpu_online(cpu) )
     {
diff -r 7b4449bdb980 -r ffc59d2fc998 xen/include/asm-arm/page.h
--- a/xen/include/asm-arm/page.h	Thu Nov 22 10:47:58 2012 +0100
+++ b/xen/include/asm-arm/page.h	Thu Nov 22 16:15:36 2012 +0000
@@ -248,13 +248,16 @@ static inline void write_pte(lpae_t *p, 
         : : "r" (pte.bits), "r" (p) : "memory");
 }
 
+/* Architectural minimum cacheline size is 4 32-bit words. */
+#define MIN_CACHELINE_BYTES 16
+/* Actual cacheline size on the boot CPU. */
+extern size_t cacheline_bytes;
 
 /* Function for flushing medium-sized areas.
  * if 'range' is large enough we might want to use model-specific
  * full-cache flushes. */
 static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
 {
-    int cacheline_bytes  = READ_CP32(CCSIDR);
     void *end;
     dsb();           /* So the CPU issues all writes to the range */
     for ( end = p + size; p < end; p += cacheline_bytes )
@@ -262,17 +265,13 @@ static inline void flush_xen_dcache_va_r
     dsb();           /* So we know the flushes happen before continuing */
 }
 
-
 /* Macro for flushing a single small item.  The predicate is always
  * compile-time constant so this will compile down to 3 instructions in
- * the common case.  Make sure to call it with the correct type of
- * pointer! */
-#define flush_xen_dcache_va(p) do {                                     \
-    int cacheline_bytes  = READ_CP32(CCSIDR);                           \
-    typeof(p) _p = (p);                                                 \
-    if ( ((unsigned long)_p & ~(cacheline_bytes - 1)) !=                \
-        (((unsigned long)_p + (sizeof *_p)) & ~(cacheline_bytes - 1)) ) \
-        flush_xen_dcache_va_range(_p, sizeof *_p);                      \
+ * the common case. */
+#define flush_xen_dcache(x) do {                                        \
+    typeof(x) *_p = &(x);                                               \
+    if ( sizeof(x) > MIN_CACHELINE_BYTES || sizeof(x) > alignof(x) )    \
+        flush_xen_dcache_va_range(_p, sizeof(x));                       \
     else                                                                \
         asm volatile (                                                  \
             "dsb;"   /* Finish all earlier writes */                    \
diff -r 7b4449bdb980 -r ffc59d2fc998 xen/include/xen/compiler.h
--- a/xen/include/xen/compiler.h	Thu Nov 22 10:47:58 2012 +0100
+++ b/xen/include/xen/compiler.h	Thu Nov 22 16:15:36 2012 +0000
@@ -54,6 +54,10 @@
 
 #define offsetof(a,b) __builtin_offsetof(a,b)
 
+#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L
+#define alignof __alignof__
+#endif
+
 /* &a[0] degrades to a pointer: a different type from an array */
 #define __must_be_array(a) \
   BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:18:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:18:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZTX-0007jv-Pe; Thu, 22 Nov 2012 16:18:03 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TbZTX-0007jp-2v
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 16:18:03 +0000
Received: from [85.158.139.211:29631] by server-6.bemta-5.messagelabs.com id
	57/B2-19321-A305EA05; Thu, 22 Nov 2012 16:18:02 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353601080!21157602!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3789 invoked from network); 22 Nov 2012 16:18:01 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 16:18:01 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="215286472"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 16:17:40 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 11:17:40 -0500
Received: from whitby.uk.xensource.com ([10.80.2.60])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<tim@xen.org>) id 1TbZT9-0007pg-T2; Thu, 22 Nov 2012 16:17:39 +0000
Received: from tdeegan by whitby.uk.xensource.com with local (Exim 4.76)
	(envelope-from <tim@xen.org>)	id 1TbZT9-0002Hz-Ln;
	Thu, 22 Nov 2012 16:17:39 +0000
MIME-Version: 1.0
X-Mercurial-Node: ffc59d2fc9980c660941eb24cbe827c1142d1fd0
Message-ID: <ffc59d2fc9980c660941.1353601059@whitby.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.0.1
Date: Thu, 22 Nov 2012 16:17:39 +0000
From: Tim Deegan <tim@xen.org>
To: xen-devel@lists.xen.org
Cc: stefano.stabellini@citrix.com, ian.campbell@citrix.com
Subject: [Xen-devel] [PATCH] arm: Tidy up flush_xen_dcache()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1353600936 0
# Node ID ffc59d2fc9980c660941eb24cbe827c1142d1fd0
# Parent  7b4449bdb980caee8efc498d5ea48f772331df2f
arm: Tidy up flush_xen_dcache().

 - Use a compile-time-constant check for whether we can safely flush
   just one cacheline.  This reduces the common case from 28
   instructions to three.
 - Pass an object to the macro, not a pointer, so we can detect
   attempts to flush arrays.
 - Decode CCSIDR correctly to get cacheline size.
 - Remove some redundant DSBs at the call sites.

Signed-off-by: Tim Deegan <tim@xen.org>

diff -r 7b4449bdb980 -r ffc59d2fc998 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Thu Nov 22 10:47:58 2012 +0100
+++ b/xen/arch/arm/mm.c	Thu Nov 22 16:15:36 2012 +0000
@@ -247,7 +247,7 @@ void __init setup_pagetables(unsigned lo
 
     /* Change pagetables to the copy in the relocated Xen */
     boot_httbr = (unsigned long) xen_pgtable + phys_offset;
-    flush_xen_dcache_va(&boot_httbr);
+    flush_xen_dcache(boot_httbr);
     flush_xen_dcache_va_range((void*)dest_va, _end - _start);
     flush_xen_text_tlb();
 
diff -r 7b4449bdb980 -r ffc59d2fc998 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Thu Nov 22 10:47:58 2012 +0100
+++ b/xen/arch/arm/setup.c	Thu Nov 22 16:15:36 2012 +0000
@@ -175,6 +175,21 @@ static void __init setup_mm(unsigned lon
     end_boot_allocator();
 }
 
+size_t __read_mostly cacheline_bytes;
+
+/* Very early check of the CPU cache properties */
+void __init setup_cache(void)
+{
+    uint32_t ccsid;
+
+    /* Read the cache size ID register for the level-0 data cache */
+    WRITE_CP32(0, CSSELR);
+    ccsid = READ_CP32(CCSIDR);
+
+    /* Low 3 bits are log2(cacheline size in words) - 2. */
+    cacheline_bytes = 1U << (4 + (ccsid & 0x7));
+}
+
 /* C entry point for boot CPU */
 void __init start_xen(unsigned long boot_phys_offset,
                       unsigned long arm_type,
@@ -185,6 +200,8 @@ void __init start_xen(unsigned long boot
     size_t fdt_size;
     int cpus, i;
 
+    setup_cache();
+
     smp_clear_cpu_maps();
 
     fdt = (void *)BOOT_MISC_VIRT_START
diff -r 7b4449bdb980 -r ffc59d2fc998 xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Thu Nov 22 10:47:58 2012 +0100
+++ b/xen/arch/arm/smpboot.c	Thu Nov 22 16:15:36 2012 +0000
@@ -118,8 +118,8 @@ make_cpus_ready(unsigned int max_cpus, u
         /* Tell the next CPU to get ready */
         /* TODO: handle boards where CPUIDs are not contiguous */
         *gate = i;
-        flush_xen_dcache_va(gate);
-        asm volatile("dsb; isb; sev");
+        flush_xen_dcache(*gate);
+        asm volatile("isb; sev");
         /* And wait for it to respond */
         while ( ready_cpus < i )
             smp_rmb();
@@ -217,8 +217,8 @@ int __cpu_up(unsigned int cpu)
     smp_up_cpu = cpu;
     /* we need to make sure that the change to smp_up_cpu is visible to
      * secondary cpus with D-cache off */
-    flush_xen_dcache_va(&smp_up_cpu);
-    asm volatile("dsb; isb; sev");
+    flush_xen_dcache(smp_up_cpu);
+    asm volatile("isb; sev");
 
     while ( !cpu_online(cpu) )
     {
diff -r 7b4449bdb980 -r ffc59d2fc998 xen/include/asm-arm/page.h
--- a/xen/include/asm-arm/page.h	Thu Nov 22 10:47:58 2012 +0100
+++ b/xen/include/asm-arm/page.h	Thu Nov 22 16:15:36 2012 +0000
@@ -248,13 +248,16 @@ static inline void write_pte(lpae_t *p, 
         : : "r" (pte.bits), "r" (p) : "memory");
 }
 
+/* Architectural minimum cacheline size is 4 32-bit words. */
+#define MIN_CACHELINE_BYTES 16
+/* Actual cacheline size on the boot CPU. */
+extern size_t cacheline_bytes;
 
 /* Function for flushing medium-sized areas.
  * if 'range' is large enough we might want to use model-specific
  * full-cache flushes. */
 static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
 {
-    int cacheline_bytes  = READ_CP32(CCSIDR);
     void *end;
     dsb();           /* So the CPU issues all writes to the range */
     for ( end = p + size; p < end; p += cacheline_bytes )
@@ -262,17 +265,13 @@ static inline void flush_xen_dcache_va_r
     dsb();           /* So we know the flushes happen before continuing */
 }
 
-
 /* Macro for flushing a single small item.  The predicate is always
  * compile-time constant so this will compile down to 3 instructions in
- * the common case.  Make sure to call it with the correct type of
- * pointer! */
-#define flush_xen_dcache_va(p) do {                                     \
-    int cacheline_bytes  = READ_CP32(CCSIDR);                           \
-    typeof(p) _p = (p);                                                 \
-    if ( ((unsigned long)_p & ~(cacheline_bytes - 1)) !=                \
-        (((unsigned long)_p + (sizeof *_p)) & ~(cacheline_bytes - 1)) ) \
-        flush_xen_dcache_va_range(_p, sizeof *_p);                      \
+ * the common case. */
+#define flush_xen_dcache(x) do {                                        \
+    typeof(x) *_p = &(x);                                               \
+    if ( sizeof(x) > MIN_CACHELINE_BYTES || sizeof(x) > alignof(x) )    \
+        flush_xen_dcache_va_range(_p, sizeof(x));                       \
     else                                                                \
         asm volatile (                                                  \
             "dsb;"   /* Finish all earlier writes */                    \
diff -r 7b4449bdb980 -r ffc59d2fc998 xen/include/xen/compiler.h
--- a/xen/include/xen/compiler.h	Thu Nov 22 10:47:58 2012 +0100
+++ b/xen/include/xen/compiler.h	Thu Nov 22 16:15:36 2012 +0000
@@ -54,6 +54,10 @@
 
 #define offsetof(a,b) __builtin_offsetof(a,b)
 
+#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L
+#define alignof __alignof__
+#endif
+
 /* &a[0] degrades to a pointer: a different type from an array */
 #define __must_be_array(a) \
   BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:21:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:21:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZX8-0007yD-FH; Thu, 22 Nov 2012 16:21:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TbZX6-0007y6-O1
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 16:21:45 +0000
Received: from [85.158.137.99:21151] by server-5.bemta-3.messagelabs.com id
	22/F1-26311-7115EA05; Thu, 22 Nov 2012 16:21:43 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1353601300!19330659!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0NzMxMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4943 invoked from network); 22 Nov 2012 16:21:40 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-11.tower-217.messagelabs.com with SMTP;
	22 Nov 2012 16:21:40 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga101.fm.intel.com with ESMTP; 22 Nov 2012 08:21:39 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,301,1352102400"; d="scan'208";a="251123628"
Received: from ljsromley.bj.intel.com ([10.240.192.102])
	by fmsmga001.fm.intel.com with ESMTP; 22 Nov 2012 08:21:37 -0800
MIME-Version: 1.0
X-Mercurial-Node: 446f6b9bfc89137e1aa090b3e50d79b4e72c1e9d
Message-Id: <446f6b9bfc89137e1aa0.1353629629@ljsromley.bj.intel.com>
User-Agent: Mercurial-patchbomb/1.4
Date: Fri, 23 Nov 2012 08:13:49 +0800
From: Liu Jinsong <jinsong.liu@intel.com>
To: ian.campbell@citrix.com, george.dunlap@eu.citrix.com,
	Ian.Jackson@eu.citrix.com, JBeulich@suse.com
Cc: xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard to
	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Generally, there are 2 cases:
1. broken page occurs before migration
2. broken page occurs during migration

We had submitted 2 versions of patches. Their difference is how to handle case 2:
V1 patch aborted migration for the case 'broken page occurs during migration';
V2 patch marked broken page to dirty bitmap then got handled next round and no abort;

This is V3 patch, adding handle for vMCE occur at last iteration of migration:
At the sender
  For case 1, the broken page will be mapped but not copied to target
  (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number will be transferred to target
  so that target take appropriate action.

  For case 2, mce handler marks the broken page to dirty bitmap, so that
  at copypages stage of migration, its pfn_type and pfn number will be
  transferred to target and then take appropriate action.

At the target
  When migration target populates pages for guest. As for the case
  of broken page wrt migration, we prefer to keep the type of the page,
  for the sake of seamless migration.

  At target it will set p2m as p2m_ram_broken for broken page. Guest MCE
  may have good chance to handle its broken page, while if guest access
  the broken page again it will kill itself as expected.

If vMCE occur at the last memory copy iteration of migration, we do one more
iteration so that the broken page's pfn_type and pfn number has chance to
be transferred to target.

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

- for tools part of the patch
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

- for hypervisor part of the patch
Acked-by: Jan Beulich <JBeulich@suse.com>

diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain.c	Sat Nov 17 09:46:05 2012 +0800
@@ -283,6 +283,22 @@
     return ret;
 }
 
+/* set broken page p2m */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn)
+{
+    int ret;
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
+    domctl.domain = (domid_t)domid;
+    domctl.u.set_broken_page_p2m.pfn = pfn;
+    ret = do_domctl(xch, &domctl);
+
+    return ret ? -1 : 0;
+}
+
 /* get info from hvm guest for save */
 int xc_domain_hvm_getcontext(xc_interface *xch,
                              uint32_t domid,
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_restore.c	Sat Nov 17 09:46:05 2012 +0800
@@ -1023,9 +1023,15 @@
 
     countpages = count;
     for (i = oldcount; i < buf->nr_pages; ++i)
-        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
-            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
+    {
+        unsigned long pagetype;
+
+        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
+        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
+             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
+             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
             --countpages;
+    }
 
     if (!countpages)
         return count;
@@ -1267,6 +1273,17 @@
             /* a bogus/unmapped/allocate-only page: skip it */
             continue;
 
+        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
+        {
+            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
+            {
+                ERROR("Set p2m for broken page failed, "
+                      "dom=%d, pfn=%lx\n", dom, pfn);
+                goto err_mapped;
+            }
+            continue;
+        }
+
         if (pfn_err[i])
         {
             ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_save.c	Sat Nov 17 09:46:05 2012 +0800
@@ -1118,7 +1118,7 @@
     /* Now write out each data page, canonicalising page tables as we go... */
     for ( ; ; )
     {
-        unsigned int N, batch, run;
+        unsigned int N, batch, run, broken_page_num1, broken_page_num2;
         char reportbuf[80];
 
         snprintf(reportbuf, sizeof(reportbuf),
@@ -1270,6 +1270,7 @@
                 goto out;
             }
 
+            broken_page_num1 = 0;
             for ( run = j = 0; j < batch; j++ )
             {
                 unsigned long gmfn = pfn_batch[j];
@@ -1277,6 +1278,14 @@
                 if ( !hvm )
                     gmfn = pfn_to_mfn(gmfn);
 
+                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                {
+                    pfn_type[j] |= pfn_batch[j];
+                    ++broken_page_num1;
+                    ++run;
+                    continue;
+                }
+
                 if ( pfn_err[j] )
                 {
                     if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
@@ -1371,8 +1380,12 @@
                     }
                 }
 
-                /* skip pages that aren't present or are alloc-only */
+                /*
+                 * skip pages that aren't present,
+                 * or are broken, or are alloc-only
+                 */
                 if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
+                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
                     || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
                     continue;
 
@@ -1484,6 +1497,35 @@
 
             munmap(region_base, batch*PAGE_SIZE);
 
+            /*
+             * if vMCE occur at last iter, do one more iter so that it get
+             * chance to transfer broken page's pfn_type and pfn number to
+             * target and then take appropriate action
+             */
+            if ( last_iter )
+            {
+                for ( j = 0; j < batch; j++ )
+                {
+                    if ( hvm )
+                        pfn_type[j] = pfn_batch[j];
+                    else
+                        pfn_type[j] = pfn_to_mfn(pfn_batch[j]);
+                }
+
+                if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
+                {
+                    PERROR("get_pfn_type_batch failed");
+                    goto out;
+                }
+
+                broken_page_num2 = 0;
+                for ( j = 0; j < batch; j++ )
+                    if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                        broken_page_num2++;
+
+                if ( broken_page_num1 < broken_page_num2 )
+                    last_iter = 0;
+            }
         } /* end of this while loop for this iteration */
 
       skip:
@@ -1550,23 +1592,22 @@
                     PERROR("Error when writing to state file (tsc)");
                     goto out;
                 }
+            }
+        }
+        else
+            last_iter = 1;
 
+        if ( xc_shadow_control(xch, dom,
+                               XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),
+                               dinfo->p2m_size, NULL, 0, &shadow_stats) != dinfo->p2m_size )
+        {
+            PERROR("Error flushing shadow PT");
+            goto out;
+        }
 
-            }
+        sent_last_iter = sent_this_iter;
 
-            if ( xc_shadow_control(xch, dom,
-                                   XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),
-                                   dinfo->p2m_size, NULL, 0, &shadow_stats) != dinfo->p2m_size )
-            {
-                PERROR("Error flushing shadow PT");
-                goto out;
-            }
-
-            sent_last_iter = sent_this_iter;
-
-            print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, 1);
-
-        }
+        print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, 1);
     } /* end of infinite for loop */
 
     DPRINTF("All memory is saved\n");
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xenctrl.h	Sat Nov 17 09:46:05 2012 +0800
@@ -575,6 +575,17 @@
                           xc_domaininfo_t *info);
 
 /**
+ * This function set p2m for broken page
+ * &parm xch a handle to an open hypervisor interface
+ * @parm domid the domain id which broken page belong to
+ * @parm pfn the pfn number of the broken page
+ * @return 0 on success, -1 on failure
+ */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn);
+
+/**
  * This function returns information about the context of a hvm domain
  * @parm xch a handle to an open hypervisor interface
  * @parm domid the domain to get information from
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 xen/arch/x86/cpu/mcheck/mcaction.c
--- a/xen/arch/x86/cpu/mcheck/mcaction.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Sat Nov 17 09:46:05 2012 +0800
@@ -1,5 +1,6 @@
 #include <xen/types.h>
 #include <xen/sched.h>
+#include <asm/p2m.h>
 #include "mcaction.h"
 #include "vmce.h"
 #include "mce.h"
@@ -91,6 +92,24 @@
                     goto vmce_failed;
                 }
 
+                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram &&
+                     paging_mode_log_dirty(d) )
+                {
+                    /*
+                     * vMCE occur during migration
+                     *
+                     *   At sender, it marks broken page to dirty bitmap,
+                     *   so that at copypages stage of migration, broken
+                     *   page's pfn_type and pfn number would be transferred
+                     *   to target and then take appropriate action.
+                     *
+                     *   At target, it would set p2m as p2m_ram_broken for
+                     *   broken page, so that if guest access the broken page
+                     *   again, it would kill itself as expected.
+                     */
+                    paging_mark_dirty(d, mfn);
+                }
+
                 if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
                 {
                     printk("Unmap broken memory %lx for DOM%d failed\n",
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/arch/x86/domctl.c	Sat Nov 17 09:46:05 2012 +0800
@@ -209,12 +209,18 @@
                 for ( j = 0; j < k; j++ )
                 {
                     unsigned long type = 0;
+                    p2m_type_t t;
 
-                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
+                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
 
                     if ( unlikely(!page) ||
                          unlikely(is_xen_heap_page(page)) )
-                        type = XEN_DOMCTL_PFINFO_XTAB;
+                    {
+                        if ( p2m_is_broken(t) )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
+                        else
+                            type = XEN_DOMCTL_PFINFO_XTAB;
+                    }
                     else
                     {
                         switch( page->u.inuse.type_info & PGT_type_mask )
@@ -235,6 +241,9 @@
 
                         if ( page->u.inuse.type_info & PGT_pinned )
                             type |= XEN_DOMCTL_PFINFO_LPINTAB;
+
+                        if ( page->count_info & PGC_broken )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
                     }
 
                     if ( page )
@@ -1568,6 +1577,29 @@
     }
     break;
 
+    case XEN_DOMCTL_set_broken_page_p2m:
+    {
+        struct domain *d;
+
+        d = rcu_lock_domain_by_id(domctl->domain);
+        if ( d != NULL )
+        {
+            p2m_type_t pt;
+            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
+            mfn_t mfn = get_gfn_query(d, pfn, &pt);
+
+            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
+                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
+                ret = -EINVAL;
+
+            put_gfn(d, pfn);
+            rcu_unlock_domain(d);
+        }
+        else
+            ret = -ESRCH;
+    }
+    break;
+
     default:
         ret = iommu_do_domctl(domctl, u_domctl);
         break;
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/include/public/domctl.h	Sat Nov 17 09:46:05 2012 +0800
@@ -136,6 +136,7 @@
 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
 #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
 #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
+#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
 
 struct xen_domctl_getpageframeinfo {
@@ -834,6 +835,12 @@
 typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
 
+struct xen_domctl_set_broken_page_p2m {
+    uint64_aligned_t pfn;
+};
+typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -899,6 +906,7 @@
 #define XEN_DOMCTL_set_access_required           64
 #define XEN_DOMCTL_audit_p2m                     65
 #define XEN_DOMCTL_set_virq_handler              66
+#define XEN_DOMCTL_set_broken_page_p2m           67
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -954,6 +962,7 @@
         struct xen_domctl_audit_p2m         audit_p2m;
         struct xen_domctl_set_virq_handler  set_virq_handler;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
+        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
         uint8_t                             pad[128];

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:21:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:21:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZX8-0007yD-FH; Thu, 22 Nov 2012 16:21:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TbZX6-0007y6-O1
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 16:21:45 +0000
Received: from [85.158.137.99:21151] by server-5.bemta-3.messagelabs.com id
	22/F1-26311-7115EA05; Thu, 22 Nov 2012 16:21:43 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1353601300!19330659!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0NzMxMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4943 invoked from network); 22 Nov 2012 16:21:40 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-11.tower-217.messagelabs.com with SMTP;
	22 Nov 2012 16:21:40 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga101.fm.intel.com with ESMTP; 22 Nov 2012 08:21:39 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,301,1352102400"; d="scan'208";a="251123628"
Received: from ljsromley.bj.intel.com ([10.240.192.102])
	by fmsmga001.fm.intel.com with ESMTP; 22 Nov 2012 08:21:37 -0800
MIME-Version: 1.0
X-Mercurial-Node: 446f6b9bfc89137e1aa090b3e50d79b4e72c1e9d
Message-Id: <446f6b9bfc89137e1aa0.1353629629@ljsromley.bj.intel.com>
User-Agent: Mercurial-patchbomb/1.4
Date: Fri, 23 Nov 2012 08:13:49 +0800
From: Liu Jinsong <jinsong.liu@intel.com>
To: ian.campbell@citrix.com, george.dunlap@eu.citrix.com,
	Ian.Jackson@eu.citrix.com, JBeulich@suse.com
Cc: xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard to
	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Generally, there are 2 cases:
1. broken page occurs before migration
2. broken page occurs during migration

We had submitted 2 versions of patches. Their difference is how to handle case 2:
V1 patch aborted migration for the case 'broken page occurs during migration';
V2 patch marked broken page to dirty bitmap then got handled next round and no abort;

This is V3 patch, adding handle for vMCE occur at last iteration of migration:
At the sender
  For case 1, the broken page will be mapped but not copied to target
  (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number will be transferred to target
  so that target take appropriate action.

  For case 2, mce handler marks the broken page to dirty bitmap, so that
  at copypages stage of migration, its pfn_type and pfn number will be
  transferred to target and then take appropriate action.

At the target
  When migration target populates pages for guest. As for the case
  of broken page wrt migration, we prefer to keep the type of the page,
  for the sake of seamless migration.

  At target it will set p2m as p2m_ram_broken for broken page. Guest MCE
  may have good chance to handle its broken page, while if guest access
  the broken page again it will kill itself as expected.

If vMCE occur at the last memory copy iteration of migration, we do one more
iteration so that the broken page's pfn_type and pfn number has chance to
be transferred to target.

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

- for tools part of the patch
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

- for hypervisor part of the patch
Acked-by: Jan Beulich <JBeulich@suse.com>

diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain.c	Sat Nov 17 09:46:05 2012 +0800
@@ -283,6 +283,22 @@
     return ret;
 }
 
+/* set broken page p2m */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn)
+{
+    int ret;
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
+    domctl.domain = (domid_t)domid;
+    domctl.u.set_broken_page_p2m.pfn = pfn;
+    ret = do_domctl(xch, &domctl);
+
+    return ret ? -1 : 0;
+}
+
 /* get info from hvm guest for save */
 int xc_domain_hvm_getcontext(xc_interface *xch,
                              uint32_t domid,
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_restore.c	Sat Nov 17 09:46:05 2012 +0800
@@ -1023,9 +1023,15 @@
 
     countpages = count;
     for (i = oldcount; i < buf->nr_pages; ++i)
-        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
-            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
+    {
+        unsigned long pagetype;
+
+        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
+        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
+             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
+             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
             --countpages;
+    }
 
     if (!countpages)
         return count;
@@ -1267,6 +1273,17 @@
             /* a bogus/unmapped/allocate-only page: skip it */
             continue;
 
+        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
+        {
+            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
+            {
+                ERROR("Set p2m for broken page failed, "
+                      "dom=%d, pfn=%lx\n", dom, pfn);
+                goto err_mapped;
+            }
+            continue;
+        }
+
         if (pfn_err[i])
         {
             ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_save.c	Sat Nov 17 09:46:05 2012 +0800
@@ -1118,7 +1118,7 @@
     /* Now write out each data page, canonicalising page tables as we go... */
     for ( ; ; )
     {
-        unsigned int N, batch, run;
+        unsigned int N, batch, run, broken_page_num1, broken_page_num2;
         char reportbuf[80];
 
         snprintf(reportbuf, sizeof(reportbuf),
@@ -1270,6 +1270,7 @@
                 goto out;
             }
 
+            broken_page_num1 = 0;
             for ( run = j = 0; j < batch; j++ )
             {
                 unsigned long gmfn = pfn_batch[j];
@@ -1277,6 +1278,14 @@
                 if ( !hvm )
                     gmfn = pfn_to_mfn(gmfn);
 
+                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                {
+                    pfn_type[j] |= pfn_batch[j];
+                    ++broken_page_num1;
+                    ++run;
+                    continue;
+                }
+
                 if ( pfn_err[j] )
                 {
                     if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
@@ -1371,8 +1380,12 @@
                     }
                 }
 
-                /* skip pages that aren't present or are alloc-only */
+                /*
+                 * skip pages that aren't present,
+                 * or are broken, or are alloc-only
+                 */
                 if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
+                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
                     || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
                     continue;
 
@@ -1484,6 +1497,35 @@
 
             munmap(region_base, batch*PAGE_SIZE);
 
+            /*
+             * if vMCE occur at last iter, do one more iter so that it get
+             * chance to transfer broken page's pfn_type and pfn number to
+             * target and then take appropriate action
+             */
+            if ( last_iter )
+            {
+                for ( j = 0; j < batch; j++ )
+                {
+                    if ( hvm )
+                        pfn_type[j] = pfn_batch[j];
+                    else
+                        pfn_type[j] = pfn_to_mfn(pfn_batch[j]);
+                }
+
+                if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
+                {
+                    PERROR("get_pfn_type_batch failed");
+                    goto out;
+                }
+
+                broken_page_num2 = 0;
+                for ( j = 0; j < batch; j++ )
+                    if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                        broken_page_num2++;
+
+                if ( broken_page_num1 < broken_page_num2 )
+                    last_iter = 0;
+            }
         } /* end of this while loop for this iteration */
 
       skip:
@@ -1550,23 +1592,22 @@
                     PERROR("Error when writing to state file (tsc)");
                     goto out;
                 }
+            }
+        }
+        else
+            last_iter = 1;
 
+        if ( xc_shadow_control(xch, dom,
+                               XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),
+                               dinfo->p2m_size, NULL, 0, &shadow_stats) != dinfo->p2m_size )
+        {
+            PERROR("Error flushing shadow PT");
+            goto out;
+        }
 
-            }
+        sent_last_iter = sent_this_iter;
 
-            if ( xc_shadow_control(xch, dom,
-                                   XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),
-                                   dinfo->p2m_size, NULL, 0, &shadow_stats) != dinfo->p2m_size )
-            {
-                PERROR("Error flushing shadow PT");
-                goto out;
-            }
-
-            sent_last_iter = sent_this_iter;
-
-            print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, 1);
-
-        }
+        print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, 1);
     } /* end of infinite for loop */
 
     DPRINTF("All memory is saved\n");
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xenctrl.h	Sat Nov 17 09:46:05 2012 +0800
@@ -575,6 +575,17 @@
                           xc_domaininfo_t *info);
 
 /**
+ * This function set p2m for broken page
+ * &parm xch a handle to an open hypervisor interface
+ * @parm domid the domain id which broken page belong to
+ * @parm pfn the pfn number of the broken page
+ * @return 0 on success, -1 on failure
+ */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn);
+
+/**
  * This function returns information about the context of a hvm domain
  * @parm xch a handle to an open hypervisor interface
  * @parm domid the domain to get information from
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 xen/arch/x86/cpu/mcheck/mcaction.c
--- a/xen/arch/x86/cpu/mcheck/mcaction.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Sat Nov 17 09:46:05 2012 +0800
@@ -1,5 +1,6 @@
 #include <xen/types.h>
 #include <xen/sched.h>
+#include <asm/p2m.h>
 #include "mcaction.h"
 #include "vmce.h"
 #include "mce.h"
@@ -91,6 +92,24 @@
                     goto vmce_failed;
                 }
 
+                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram &&
+                     paging_mode_log_dirty(d) )
+                {
+                    /*
+                     * vMCE occur during migration
+                     *
+                     *   At sender, it marks broken page to dirty bitmap,
+                     *   so that at copypages stage of migration, broken
+                     *   page's pfn_type and pfn number would be transferred
+                     *   to target and then take appropriate action.
+                     *
+                     *   At target, it would set p2m as p2m_ram_broken for
+                     *   broken page, so that if guest access the broken page
+                     *   again, it would kill itself as expected.
+                     */
+                    paging_mark_dirty(d, mfn);
+                }
+
                 if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
                 {
                     printk("Unmap broken memory %lx for DOM%d failed\n",
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/arch/x86/domctl.c	Sat Nov 17 09:46:05 2012 +0800
@@ -209,12 +209,18 @@
                 for ( j = 0; j < k; j++ )
                 {
                     unsigned long type = 0;
+                    p2m_type_t t;
 
-                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
+                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
 
                     if ( unlikely(!page) ||
                          unlikely(is_xen_heap_page(page)) )
-                        type = XEN_DOMCTL_PFINFO_XTAB;
+                    {
+                        if ( p2m_is_broken(t) )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
+                        else
+                            type = XEN_DOMCTL_PFINFO_XTAB;
+                    }
                     else
                     {
                         switch( page->u.inuse.type_info & PGT_type_mask )
@@ -235,6 +241,9 @@
 
                         if ( page->u.inuse.type_info & PGT_pinned )
                             type |= XEN_DOMCTL_PFINFO_LPINTAB;
+
+                        if ( page->count_info & PGC_broken )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
                     }
 
                     if ( page )
@@ -1568,6 +1577,29 @@
     }
     break;
 
+    case XEN_DOMCTL_set_broken_page_p2m:
+    {
+        struct domain *d;
+
+        d = rcu_lock_domain_by_id(domctl->domain);
+        if ( d != NULL )
+        {
+            p2m_type_t pt;
+            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
+            mfn_t mfn = get_gfn_query(d, pfn, &pt);
+
+            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
+                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
+                ret = -EINVAL;
+
+            put_gfn(d, pfn);
+            rcu_unlock_domain(d);
+        }
+        else
+            ret = -ESRCH;
+    }
+    break;
+
     default:
         ret = iommu_do_domctl(domctl, u_domctl);
         break;
diff -r 8b93ac0c93f3 -r 446f6b9bfc89 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/include/public/domctl.h	Sat Nov 17 09:46:05 2012 +0800
@@ -136,6 +136,7 @@
 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
 #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
 #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
+#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
 
 struct xen_domctl_getpageframeinfo {
@@ -834,6 +835,12 @@
 typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
 
+struct xen_domctl_set_broken_page_p2m {
+    uint64_aligned_t pfn;
+};
+typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -899,6 +906,7 @@
 #define XEN_DOMCTL_set_access_required           64
 #define XEN_DOMCTL_audit_p2m                     65
 #define XEN_DOMCTL_set_virq_handler              66
+#define XEN_DOMCTL_set_broken_page_p2m           67
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -954,6 +962,7 @@
         struct xen_domctl_audit_p2m         audit_p2m;
         struct xen_domctl_set_virq_handler  set_virq_handler;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
+        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
         uint8_t                             pad[128];

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:28:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:28:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZdO-00088w-AX; Thu, 22 Nov 2012 16:28:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TbZdL-00088n-2y
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 16:28:12 +0000
Received: from [85.158.143.99:28131] by server-1.bemta-4.messagelabs.com id
	1A/A6-27934-A925EA05; Thu, 22 Nov 2012 16:28:10 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1353601688!20056160!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0NzMxMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3087 invoked from network); 22 Nov 2012 16:28:08 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-8.tower-216.messagelabs.com with SMTP;
	22 Nov 2012 16:28:08 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga101.fm.intel.com with ESMTP; 22 Nov 2012 08:28:07 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,301,1352102400"; d="scan'208";a="251125497"
Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35])
	by fmsmga001.fm.intel.com with ESMTP; 22 Nov 2012 08:28:06 -0800
Received: from fmsmsx119.amr.corp.intel.com (10.18.22.143) by
	FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 22 Nov 2012 08:28:06 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	fmsmsx119.amr.corp.intel.com (10.18.22.143) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 22 Nov 2012 08:28:06 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Fri, 23 Nov 2012 00:28:04 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>, "ian.campbell@citrix.com"
	<ian.campbell@citrix.com>, "george.dunlap@eu.citrix.com"
	<george.dunlap@eu.citrix.com>, "Ian.Jackson@eu.citrix.com"
	<Ian.Jackson@eu.citrix.com>, "JBeulich@suse.com" <JBeulich@suse.com>
Thread-Topic: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with
	regard to	migration
Thread-Index: AQHNyM3A7yZgukrp6kyfs0al+Ym/bpf2CspA
Date: Thu, 22 Nov 2012 16:28:03 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353955D3@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353629629@ljsromley.bj.intel.com>
In-Reply-To: <446f6b9bfc89137e1aa0.1353629629@ljsromley.bj.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard
 to	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Sorry all, please ignore last 2 email, I mis-operate hg email :(
I'm check the reason and will send out later.

Thanks,
Jinsong

Liu Jinsong wrote:
> Generally, there are 2 cases:
> 1. broken page occurs before migration
> 2. broken page occurs during migration
> 
> We had submitted 2 versions of patches. Their difference is how to
> handle case 2: 
> V1 patch aborted migration for the case 'broken page occurs during
> migration'; 
> V2 patch marked broken page to dirty bitmap then got handled next
> round and no abort; 
> 
> This is V3 patch, adding handle for vMCE occur at last iteration of
> migration: 
> At the sender
>   For case 1, the broken page will be mapped but not copied to target
>   (otherwise it may trigger more serious error, say, SRAR error).
>   While its pfn_type and pfn number will be transferred to target
>   so that target take appropriate action.
> 
>   For case 2, mce handler marks the broken page to dirty bitmap, so
>   that at copypages stage of migration, its pfn_type and pfn number
>   will be transferred to target and then take appropriate action.
> 
> At the target
>   When migration target populates pages for guest. As for the case
>   of broken page wrt migration, we prefer to keep the type of the
>   page, for the sake of seamless migration.
> 
>   At target it will set p2m as p2m_ram_broken for broken page. Guest
>   MCE may have good chance to handle its broken page, while if guest
>   access the broken page again it will kill itself as expected.
> 
> If vMCE occur at the last memory copy iteration of migration, we do
> one more 
> iteration so that the broken page's pfn_type and pfn number has
> chance to 
> be transferred to target.
> 
> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
> 
> - for tools part of the patch
> Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> 
> - for hypervisor part of the patch
> Acked-by: Jan Beulich <JBeulich@suse.com>
> 
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain.c
> --- a/tools/libxc/xc_domain.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xc_domain.c	Sat Nov 17 09:46:05 2012 +0800
> @@ -283,6 +283,22 @@
>      return ret;
>  }
> 
> +/* set broken page p2m */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn)
> +{
> +    int ret;
> +    DECLARE_DOMCTL;
> +
> +    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
> +    domctl.domain = (domid_t)domid;
> +    domctl.u.set_broken_page_p2m.pfn = pfn;
> +    ret = do_domctl(xch, &domctl);
> +
> +    return ret ? -1 : 0;
> +}
> +
>  /* get info from hvm guest for save */
>  int xc_domain_hvm_getcontext(xc_interface *xch,
>                               uint32_t domid,
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_restore.c
> --- a/tools/libxc/xc_domain_restore.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xc_domain_restore.c	Sat Nov 17 09:46:05 2012 +0800
> @@ -1023,9 +1023,15 @@
> 
>      countpages = count;
>      for (i = oldcount; i < buf->nr_pages; ++i)
> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
> XEN_DOMCTL_PFINFO_XTAB 
> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
> XEN_DOMCTL_PFINFO_XALLOC) +    {
> +        unsigned long pagetype;
> +
> +        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
> +        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
> +             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
> +             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>              --countpages;
> +    }
> 
>      if (!countpages)
>          return count;
> @@ -1267,6 +1273,17 @@
>              /* a bogus/unmapped/allocate-only page: skip it */
>              continue;
> 
> +        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
> +        {
> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
> +            {
> +                ERROR("Set p2m for broken page failed, "
> +                      "dom=%d, pfn=%lx\n", dom, pfn);
> +                goto err_mapped;
> +            }
> +            continue;
> +        }
> +
>          if (pfn_err[i])
>          {
>              ERROR("unexpected PFN mapping failure pfn %lx map_mfn
> %lx p2m_mfn %lx", 
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_save.c
> --- a/tools/libxc/xc_domain_save.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xc_domain_save.c	Sat Nov 17 09:46:05 2012 +0800
> @@ -1118,7 +1118,7 @@
>      /* Now write out each data page, canonicalising page tables as
>      we go... */ for ( ; ; )
>      {
> -        unsigned int N, batch, run;
> +        unsigned int N, batch, run, broken_page_num1,
>          broken_page_num2; char reportbuf[80];
> 
>          snprintf(reportbuf, sizeof(reportbuf),
> @@ -1270,6 +1270,7 @@
>                  goto out;
>              }
> 
> +            broken_page_num1 = 0;
>              for ( run = j = 0; j < batch; j++ )
>              {
>                  unsigned long gmfn = pfn_batch[j];
> @@ -1277,6 +1278,14 @@
>                  if ( !hvm )
>                      gmfn = pfn_to_mfn(gmfn);
> 
> +                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                {
> +                    pfn_type[j] |= pfn_batch[j];
> +                    ++broken_page_num1;
> +                    ++run;
> +                    continue;
> +                }
> +
>                  if ( pfn_err[j] )
>                  {
>                      if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
> @@ -1371,8 +1380,12 @@
>                      }
>                  }
> 
> -                /* skip pages that aren't present or are alloc-only
> */ +                /*
> +                 * skip pages that aren't present,
> +                 * or are broken, or are alloc-only
> +                 */
>                  if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
> +                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
>                      || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>                      continue;
> 
> @@ -1484,6 +1497,35 @@
> 
>              munmap(region_base, batch*PAGE_SIZE);
> 
> +            /*
> +             * if vMCE occur at last iter, do one more iter so that
> it get +             * chance to transfer broken page's pfn_type and
> pfn number to +             * target and then take appropriate action
> +             */
> +            if ( last_iter )
> +            {
> +                for ( j = 0; j < batch; j++ )
> +                {
> +                    if ( hvm )
> +                        pfn_type[j] = pfn_batch[j];
> +                    else
> +                        pfn_type[j] = pfn_to_mfn(pfn_batch[j]);
> +                }
> +
> +                if ( xc_get_pfn_type_batch(xch, dom, batch,
> pfn_type) ) +                {
> +                    PERROR("get_pfn_type_batch failed");
> +                    goto out;
> +                }
> +
> +                broken_page_num2 = 0;
> +                for ( j = 0; j < batch; j++ )
> +                    if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                        broken_page_num2++;
> +
> +                if ( broken_page_num1 < broken_page_num2 )
> +                    last_iter = 0;
> +            }
>          } /* end of this while loop for this iteration */
> 
>        skip:
> @@ -1550,23 +1592,22 @@
>                      PERROR("Error when writing to state file (tsc)");
>                      goto out;
>                  }
> +            }
> +        }
> +        else
> +            last_iter = 1;
> 
> +        if ( xc_shadow_control(xch, dom,
> +                               XEN_DOMCTL_SHADOW_OP_CLEAN,
> HYPERCALL_BUFFER(to_send), +                              
> dinfo->p2m_size, NULL, 0, &shadow_stats) != dinfo->p2m_size ) +      
> { +            PERROR("Error flushing shadow PT");
> +            goto out;
> +        }
> 
> -            }
> +        sent_last_iter = sent_this_iter;
> 
> -            if ( xc_shadow_control(xch, dom,
> -                                   XEN_DOMCTL_SHADOW_OP_CLEAN,
> HYPERCALL_BUFFER(to_send), 
> -                                   dinfo->p2m_size, NULL, 0,
> &shadow_stats) != dinfo->p2m_size ) 
> -            {
> -                PERROR("Error flushing shadow PT");
> -                goto out;
> -            }
> -
> -            sent_last_iter = sent_this_iter;
> -
> -            print_stats(xch, dom, sent_this_iter, &time_stats,
> &shadow_stats, 1); -
> -        }
> +        print_stats(xch, dom, sent_this_iter, &time_stats,
>      &shadow_stats, 1); } /* end of infinite for loop */
> 
>      DPRINTF("All memory is saved\n");
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xenctrl.h
> --- a/tools/libxc/xenctrl.h	Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xenctrl.h	Sat Nov 17 09:46:05 2012 +0800
> @@ -575,6 +575,17 @@
>                            xc_domaininfo_t *info);
> 
>  /**
> + * This function set p2m for broken page
> + * &parm xch a handle to an open hypervisor interface
> + * @parm domid the domain id which broken page belong to
> + * @parm pfn the pfn number of the broken page
> + * @return 0 on success, -1 on failure
> + */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn);
> +
> +/**
>   * This function returns information about the context of a hvm
> domain 
>   * @parm xch a handle to an open hypervisor interface
>   * @parm domid the domain to get information from
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89
> xen/arch/x86/cpu/mcheck/mcaction.c ---
> a/xen/arch/x86/cpu/mcheck/mcaction.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Sat Nov 17 09:46:05 2012
>  +0800 @@ -1,5 +1,6 @@ #include <xen/types.h>
>  #include <xen/sched.h>
> +#include <asm/p2m.h>
>  #include "mcaction.h"
>  #include "vmce.h"
>  #include "mce.h"
> @@ -91,6 +92,24 @@
>                      goto vmce_failed;
>                  }
> 
> +                if ( is_hvm_domain(d) &&
> !d->arch.hvm_domain.dirty_vram && +                    
> paging_mode_log_dirty(d) ) +                {
> +                    /*
> +                     * vMCE occur during migration
> +                     *
> +                     *   At sender, it marks broken page to dirty
> bitmap, +                     *   so that at copypages stage of
> migration, broken +                     *   page's pfn_type and pfn
> number would be transferred +                     *   to target and
> then take appropriate action. +                     *
> +                     *   At target, it would set p2m as
> p2m_ram_broken for +                     *   broken page, so that if
> guest access the broken page +                     *   again, it
> would kill itself as expected. +                     */
> +                    paging_mark_dirty(d, mfn);
> +                }
> +
>                  if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
>                  {
>                      printk("Unmap broken memory %lx for DOM%d
> failed\n", 
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89 xen/arch/x86/domctl.c
> --- a/xen/arch/x86/domctl.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/xen/arch/x86/domctl.c	Sat Nov 17 09:46:05 2012 +0800
> @@ -209,12 +209,18 @@
>                  for ( j = 0; j < k; j++ )
>                  {
>                      unsigned long type = 0;
> +                    p2m_type_t t;
> 
> -                    page = get_page_from_gfn(d, arr[j], NULL,
> P2M_ALLOC); +                    page = get_page_from_gfn(d, arr[j],
> &t, P2M_ALLOC); 
> 
>                      if ( unlikely(!page) ||
>                           unlikely(is_xen_heap_page(page)) )
> -                        type = XEN_DOMCTL_PFINFO_XTAB;
> +                    {
> +                        if ( p2m_is_broken(t) )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
> +                        else
> +                            type = XEN_DOMCTL_PFINFO_XTAB;
> +                    }
>                      else
>                      {
>                          switch( page->u.inuse.type_info &
> PGT_type_mask ) @@ -235,6 +241,9 @@
> 
>                          if ( page->u.inuse.type_info & PGT_pinned )
>                              type |= XEN_DOMCTL_PFINFO_LPINTAB;
> +
> +                        if ( page->count_info & PGC_broken )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
>                      }
> 
>                      if ( page )
> @@ -1568,6 +1577,29 @@
>      }
>      break;
> 
> +    case XEN_DOMCTL_set_broken_page_p2m:
> +    {
> +        struct domain *d;
> +
> +        d = rcu_lock_domain_by_id(domctl->domain);
> +        if ( d != NULL )
> +        {
> +            p2m_type_t pt;
> +            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
> +            mfn_t mfn = get_gfn_query(d, pfn, &pt);
> +
> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt)
> || +                         (p2m_change_type(d, pfn, pt,
> p2m_ram_broken) != pt)) ) +                ret = -EINVAL;
> +
> +            put_gfn(d, pfn);
> +            rcu_unlock_domain(d);
> +        }
> +        else
> +            ret = -ESRCH;
> +    }
> +    break;
> +
>      default:
>          ret = iommu_do_domctl(domctl, u_domctl);
>          break;
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89 xen/include/public/domctl.h
> --- a/xen/include/public/domctl.h	Tue Nov 13 11:19:17 2012 +0000
> +++ b/xen/include/public/domctl.h	Sat Nov 17 09:46:05 2012 +0800
> @@ -136,6 +136,7 @@
>  #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
>  #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
>  #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
> +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
>  #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
> 
>  struct xen_domctl_getpageframeinfo {
> @@ -834,6 +835,12 @@
>  typedef struct xen_domctl_set_access_required
>  xen_domctl_set_access_required_t;
> DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t); 
> 
> +struct xen_domctl_set_broken_page_p2m {
> +    uint64_aligned_t pfn;
> +};
> +typedef struct xen_domctl_set_broken_page_p2m
> xen_domctl_set_broken_page_p2m_t;
> +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t); +
>  struct xen_domctl {
>      uint32_t cmd;
>  #define XEN_DOMCTL_createdomain                   1
> @@ -899,6 +906,7 @@
>  #define XEN_DOMCTL_set_access_required           64
>  #define XEN_DOMCTL_audit_p2m                     65
>  #define XEN_DOMCTL_set_virq_handler              66
> +#define XEN_DOMCTL_set_broken_page_p2m           67
>  #define XEN_DOMCTL_gdbsx_guestmemio            1000
>  #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>  #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
> @@ -954,6 +962,7 @@
>          struct xen_domctl_audit_p2m         audit_p2m;
>          struct xen_domctl_set_virq_handler  set_virq_handler;
>          struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>          struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>          struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>          uint8_t                             pad[128];
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:28:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:28:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZdO-00088w-AX; Thu, 22 Nov 2012 16:28:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TbZdL-00088n-2y
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 16:28:12 +0000
Received: from [85.158.143.99:28131] by server-1.bemta-4.messagelabs.com id
	1A/A6-27934-A925EA05; Thu, 22 Nov 2012 16:28:10 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1353601688!20056160!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0NzMxMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3087 invoked from network); 22 Nov 2012 16:28:08 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-8.tower-216.messagelabs.com with SMTP;
	22 Nov 2012 16:28:08 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga101.fm.intel.com with ESMTP; 22 Nov 2012 08:28:07 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,301,1352102400"; d="scan'208";a="251125497"
Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35])
	by fmsmga001.fm.intel.com with ESMTP; 22 Nov 2012 08:28:06 -0800
Received: from fmsmsx119.amr.corp.intel.com (10.18.22.143) by
	FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 22 Nov 2012 08:28:06 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	fmsmsx119.amr.corp.intel.com (10.18.22.143) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 22 Nov 2012 08:28:06 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Fri, 23 Nov 2012 00:28:04 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>, "ian.campbell@citrix.com"
	<ian.campbell@citrix.com>, "george.dunlap@eu.citrix.com"
	<george.dunlap@eu.citrix.com>, "Ian.Jackson@eu.citrix.com"
	<Ian.Jackson@eu.citrix.com>, "JBeulich@suse.com" <JBeulich@suse.com>
Thread-Topic: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with
	regard to	migration
Thread-Index: AQHNyM3A7yZgukrp6kyfs0al+Ym/bpf2CspA
Date: Thu, 22 Nov 2012 16:28:03 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353955D3@SHSMSX101.ccr.corp.intel.com>
References: <446f6b9bfc89137e1aa0.1353629629@ljsromley.bj.intel.com>
In-Reply-To: <446f6b9bfc89137e1aa0.1353629629@ljsromley.bj.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard
 to	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Sorry all, please ignore last 2 email, I mis-operate hg email :(
I'm check the reason and will send out later.

Thanks,
Jinsong

Liu Jinsong wrote:
> Generally, there are 2 cases:
> 1. broken page occurs before migration
> 2. broken page occurs during migration
> 
> We had submitted 2 versions of patches. Their difference is how to
> handle case 2: 
> V1 patch aborted migration for the case 'broken page occurs during
> migration'; 
> V2 patch marked broken page to dirty bitmap then got handled next
> round and no abort; 
> 
> This is V3 patch, adding handle for vMCE occur at last iteration of
> migration: 
> At the sender
>   For case 1, the broken page will be mapped but not copied to target
>   (otherwise it may trigger more serious error, say, SRAR error).
>   While its pfn_type and pfn number will be transferred to target
>   so that target take appropriate action.
> 
>   For case 2, mce handler marks the broken page to dirty bitmap, so
>   that at copypages stage of migration, its pfn_type and pfn number
>   will be transferred to target and then take appropriate action.
> 
> At the target
>   When migration target populates pages for guest. As for the case
>   of broken page wrt migration, we prefer to keep the type of the
>   page, for the sake of seamless migration.
> 
>   At target it will set p2m as p2m_ram_broken for broken page. Guest
>   MCE may have good chance to handle its broken page, while if guest
>   access the broken page again it will kill itself as expected.
> 
> If vMCE occur at the last memory copy iteration of migration, we do
> one more 
> iteration so that the broken page's pfn_type and pfn number has
> chance to 
> be transferred to target.
> 
> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
> 
> - for tools part of the patch
> Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> 
> - for hypervisor part of the patch
> Acked-by: Jan Beulich <JBeulich@suse.com>
> 
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain.c
> --- a/tools/libxc/xc_domain.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xc_domain.c	Sat Nov 17 09:46:05 2012 +0800
> @@ -283,6 +283,22 @@
>      return ret;
>  }
> 
> +/* set broken page p2m */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn)
> +{
> +    int ret;
> +    DECLARE_DOMCTL;
> +
> +    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
> +    domctl.domain = (domid_t)domid;
> +    domctl.u.set_broken_page_p2m.pfn = pfn;
> +    ret = do_domctl(xch, &domctl);
> +
> +    return ret ? -1 : 0;
> +}
> +
>  /* get info from hvm guest for save */
>  int xc_domain_hvm_getcontext(xc_interface *xch,
>                               uint32_t domid,
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_restore.c
> --- a/tools/libxc/xc_domain_restore.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xc_domain_restore.c	Sat Nov 17 09:46:05 2012 +0800
> @@ -1023,9 +1023,15 @@
> 
>      countpages = count;
>      for (i = oldcount; i < buf->nr_pages; ++i)
> -        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
> XEN_DOMCTL_PFINFO_XTAB 
> -            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
> XEN_DOMCTL_PFINFO_XALLOC) +    {
> +        unsigned long pagetype;
> +
> +        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
> +        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
> +             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
> +             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>              --countpages;
> +    }
> 
>      if (!countpages)
>          return count;
> @@ -1267,6 +1273,17 @@
>              /* a bogus/unmapped/allocate-only page: skip it */
>              continue;
> 
> +        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
> +        {
> +            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
> +            {
> +                ERROR("Set p2m for broken page failed, "
> +                      "dom=%d, pfn=%lx\n", dom, pfn);
> +                goto err_mapped;
> +            }
> +            continue;
> +        }
> +
>          if (pfn_err[i])
>          {
>              ERROR("unexpected PFN mapping failure pfn %lx map_mfn
> %lx p2m_mfn %lx", 
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xc_domain_save.c
> --- a/tools/libxc/xc_domain_save.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xc_domain_save.c	Sat Nov 17 09:46:05 2012 +0800
> @@ -1118,7 +1118,7 @@
>      /* Now write out each data page, canonicalising page tables as
>      we go... */ for ( ; ; )
>      {
> -        unsigned int N, batch, run;
> +        unsigned int N, batch, run, broken_page_num1,
>          broken_page_num2; char reportbuf[80];
> 
>          snprintf(reportbuf, sizeof(reportbuf),
> @@ -1270,6 +1270,7 @@
>                  goto out;
>              }
> 
> +            broken_page_num1 = 0;
>              for ( run = j = 0; j < batch; j++ )
>              {
>                  unsigned long gmfn = pfn_batch[j];
> @@ -1277,6 +1278,14 @@
>                  if ( !hvm )
>                      gmfn = pfn_to_mfn(gmfn);
> 
> +                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                {
> +                    pfn_type[j] |= pfn_batch[j];
> +                    ++broken_page_num1;
> +                    ++run;
> +                    continue;
> +                }
> +
>                  if ( pfn_err[j] )
>                  {
>                      if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
> @@ -1371,8 +1380,12 @@
>                      }
>                  }
> 
> -                /* skip pages that aren't present or are alloc-only
> */ +                /*
> +                 * skip pages that aren't present,
> +                 * or are broken, or are alloc-only
> +                 */
>                  if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
> +                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
>                      || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
>                      continue;
> 
> @@ -1484,6 +1497,35 @@
> 
>              munmap(region_base, batch*PAGE_SIZE);
> 
> +            /*
> +             * if vMCE occur at last iter, do one more iter so that
> it get +             * chance to transfer broken page's pfn_type and
> pfn number to +             * target and then take appropriate action
> +             */
> +            if ( last_iter )
> +            {
> +                for ( j = 0; j < batch; j++ )
> +                {
> +                    if ( hvm )
> +                        pfn_type[j] = pfn_batch[j];
> +                    else
> +                        pfn_type[j] = pfn_to_mfn(pfn_batch[j]);
> +                }
> +
> +                if ( xc_get_pfn_type_batch(xch, dom, batch,
> pfn_type) ) +                {
> +                    PERROR("get_pfn_type_batch failed");
> +                    goto out;
> +                }
> +
> +                broken_page_num2 = 0;
> +                for ( j = 0; j < batch; j++ )
> +                    if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
> +                        broken_page_num2++;
> +
> +                if ( broken_page_num1 < broken_page_num2 )
> +                    last_iter = 0;
> +            }
>          } /* end of this while loop for this iteration */
> 
>        skip:
> @@ -1550,23 +1592,22 @@
>                      PERROR("Error when writing to state file (tsc)");
>                      goto out;
>                  }
> +            }
> +        }
> +        else
> +            last_iter = 1;
> 
> +        if ( xc_shadow_control(xch, dom,
> +                               XEN_DOMCTL_SHADOW_OP_CLEAN,
> HYPERCALL_BUFFER(to_send), +                              
> dinfo->p2m_size, NULL, 0, &shadow_stats) != dinfo->p2m_size ) +      
> { +            PERROR("Error flushing shadow PT");
> +            goto out;
> +        }
> 
> -            }
> +        sent_last_iter = sent_this_iter;
> 
> -            if ( xc_shadow_control(xch, dom,
> -                                   XEN_DOMCTL_SHADOW_OP_CLEAN,
> HYPERCALL_BUFFER(to_send), 
> -                                   dinfo->p2m_size, NULL, 0,
> &shadow_stats) != dinfo->p2m_size ) 
> -            {
> -                PERROR("Error flushing shadow PT");
> -                goto out;
> -            }
> -
> -            sent_last_iter = sent_this_iter;
> -
> -            print_stats(xch, dom, sent_this_iter, &time_stats,
> &shadow_stats, 1); -
> -        }
> +        print_stats(xch, dom, sent_this_iter, &time_stats,
>      &shadow_stats, 1); } /* end of infinite for loop */
> 
>      DPRINTF("All memory is saved\n");
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89 tools/libxc/xenctrl.h
> --- a/tools/libxc/xenctrl.h	Tue Nov 13 11:19:17 2012 +0000
> +++ b/tools/libxc/xenctrl.h	Sat Nov 17 09:46:05 2012 +0800
> @@ -575,6 +575,17 @@
>                            xc_domaininfo_t *info);
> 
>  /**
> + * This function set p2m for broken page
> + * &parm xch a handle to an open hypervisor interface
> + * @parm domid the domain id which broken page belong to
> + * @parm pfn the pfn number of the broken page
> + * @return 0 on success, -1 on failure
> + */
> +int xc_set_broken_page_p2m(xc_interface *xch,
> +                           uint32_t domid,
> +                           unsigned long pfn);
> +
> +/**
>   * This function returns information about the context of a hvm
> domain 
>   * @parm xch a handle to an open hypervisor interface
>   * @parm domid the domain to get information from
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89
> xen/arch/x86/cpu/mcheck/mcaction.c ---
> a/xen/arch/x86/cpu/mcheck/mcaction.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Sat Nov 17 09:46:05 2012
>  +0800 @@ -1,5 +1,6 @@ #include <xen/types.h>
>  #include <xen/sched.h>
> +#include <asm/p2m.h>
>  #include "mcaction.h"
>  #include "vmce.h"
>  #include "mce.h"
> @@ -91,6 +92,24 @@
>                      goto vmce_failed;
>                  }
> 
> +                if ( is_hvm_domain(d) &&
> !d->arch.hvm_domain.dirty_vram && +                    
> paging_mode_log_dirty(d) ) +                {
> +                    /*
> +                     * vMCE occur during migration
> +                     *
> +                     *   At sender, it marks broken page to dirty
> bitmap, +                     *   so that at copypages stage of
> migration, broken +                     *   page's pfn_type and pfn
> number would be transferred +                     *   to target and
> then take appropriate action. +                     *
> +                     *   At target, it would set p2m as
> p2m_ram_broken for +                     *   broken page, so that if
> guest access the broken page +                     *   again, it
> would kill itself as expected. +                     */
> +                    paging_mark_dirty(d, mfn);
> +                }
> +
>                  if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
>                  {
>                      printk("Unmap broken memory %lx for DOM%d
> failed\n", 
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89 xen/arch/x86/domctl.c
> --- a/xen/arch/x86/domctl.c	Tue Nov 13 11:19:17 2012 +0000
> +++ b/xen/arch/x86/domctl.c	Sat Nov 17 09:46:05 2012 +0800
> @@ -209,12 +209,18 @@
>                  for ( j = 0; j < k; j++ )
>                  {
>                      unsigned long type = 0;
> +                    p2m_type_t t;
> 
> -                    page = get_page_from_gfn(d, arr[j], NULL,
> P2M_ALLOC); +                    page = get_page_from_gfn(d, arr[j],
> &t, P2M_ALLOC); 
> 
>                      if ( unlikely(!page) ||
>                           unlikely(is_xen_heap_page(page)) )
> -                        type = XEN_DOMCTL_PFINFO_XTAB;
> +                    {
> +                        if ( p2m_is_broken(t) )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
> +                        else
> +                            type = XEN_DOMCTL_PFINFO_XTAB;
> +                    }
>                      else
>                      {
>                          switch( page->u.inuse.type_info &
> PGT_type_mask ) @@ -235,6 +241,9 @@
> 
>                          if ( page->u.inuse.type_info & PGT_pinned )
>                              type |= XEN_DOMCTL_PFINFO_LPINTAB;
> +
> +                        if ( page->count_info & PGC_broken )
> +                            type = XEN_DOMCTL_PFINFO_BROKEN;
>                      }
> 
>                      if ( page )
> @@ -1568,6 +1577,29 @@
>      }
>      break;
> 
> +    case XEN_DOMCTL_set_broken_page_p2m:
> +    {
> +        struct domain *d;
> +
> +        d = rcu_lock_domain_by_id(domctl->domain);
> +        if ( d != NULL )
> +        {
> +            p2m_type_t pt;
> +            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
> +            mfn_t mfn = get_gfn_query(d, pfn, &pt);
> +
> +            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt)
> || +                         (p2m_change_type(d, pfn, pt,
> p2m_ram_broken) != pt)) ) +                ret = -EINVAL;
> +
> +            put_gfn(d, pfn);
> +            rcu_unlock_domain(d);
> +        }
> +        else
> +            ret = -ESRCH;
> +    }
> +    break;
> +
>      default:
>          ret = iommu_do_domctl(domctl, u_domctl);
>          break;
> diff -r 8b93ac0c93f3 -r 446f6b9bfc89 xen/include/public/domctl.h
> --- a/xen/include/public/domctl.h	Tue Nov 13 11:19:17 2012 +0000
> +++ b/xen/include/public/domctl.h	Sat Nov 17 09:46:05 2012 +0800
> @@ -136,6 +136,7 @@
>  #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
>  #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
>  #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
> +#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
>  #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
> 
>  struct xen_domctl_getpageframeinfo {
> @@ -834,6 +835,12 @@
>  typedef struct xen_domctl_set_access_required
>  xen_domctl_set_access_required_t;
> DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t); 
> 
> +struct xen_domctl_set_broken_page_p2m {
> +    uint64_aligned_t pfn;
> +};
> +typedef struct xen_domctl_set_broken_page_p2m
> xen_domctl_set_broken_page_p2m_t;
> +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t); +
>  struct xen_domctl {
>      uint32_t cmd;
>  #define XEN_DOMCTL_createdomain                   1
> @@ -899,6 +906,7 @@
>  #define XEN_DOMCTL_set_access_required           64
>  #define XEN_DOMCTL_audit_p2m                     65
>  #define XEN_DOMCTL_set_virq_handler              66
> +#define XEN_DOMCTL_set_broken_page_p2m           67
>  #define XEN_DOMCTL_gdbsx_guestmemio            1000
>  #define XEN_DOMCTL_gdbsx_pausevcpu             1001
>  #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
> @@ -954,6 +962,7 @@
>          struct xen_domctl_audit_p2m         audit_p2m;
>          struct xen_domctl_set_virq_handler  set_virq_handler;
>          struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
> +        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
>          struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
>          struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
>          uint8_t                             pad[128];
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:31:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:31:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZgS-0008O4-43; Thu, 22 Nov 2012 16:31:24 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbZgQ-0008Nx-Hi
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 16:31:22 +0000
Received: from [193.109.254.147:60232] by server-12.bemta-14.messagelabs.com
	id 4C/EA-00510-9535EA05; Thu, 22 Nov 2012 16:31:21 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353601865!4989876!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20139 invoked from network); 22 Nov 2012 16:31:07 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 16:31:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="215287331"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 16:31:05 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 11:31:04 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbZg8-000833-EQ;
	Thu, 22 Nov 2012 16:31:04 +0000
Message-ID: <50AE5348.502@citrix.com>
Date: Thu, 22 Nov 2012 16:31:04 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<50AE4F8402000078000AAA02@nat28.tlf.novell.com>
	<50AE41DD.2030703@citrix.com>
	<50AE511302000078000AAA14@nat28.tlf.novell.com>
	<50AE46B0.6010807@citrix.com>
	<50AE590502000078000AAA48@nat28.tlf.novell.com>
	<50AE4D2C.1040104@citrix.com>
	<50AE5D1102000078000AAA69@nat28.tlf.novell.com>
In-Reply-To: <50AE5D1102000078000AAA69@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
	handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 22/11/12 16:12, Jan Beulich wrote:
>>>> On 22.11.12 at 17:05, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> On 22/11/12 15:55, Jan Beulich wrote:
>>>>>> On 22.11.12 at 16:37, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>>> A quick solution would be to execute a noop function with
>>>> run_in_exception_handler().  Alternatively, I can code enable_nmi() or
>>>> so which does an inline iret to itself.  Which of these would you prefer?
>>> I would actually consider avoiding to run softirqs altogether in that
>>> case, just like native Linux doesn't do any event or scheduler
>>> processing in that case.
>> That would probably be the easiest solution.
>>
>> I was already going to do the same for the rentrant NMI and MCE handling
>> case (and also the process pending upcalls checking), due to the
>> complexities of fixing the race condition at the end of the handler.
>>
>> Unfortunately, I don't think I have time to look at this issue
>> immediately, but if it is ok to wait till the beginning of next week, I
> That's fine of course.
>
>> can roll it into the main dev work for the other NMI/MCE work.
> Hmm, that would mean it's going to be more difficult to backport.
> I'd prefer having this in as simple a fashion as possible in the
> patch here, and then have your other patch(es) build on top of
> that.
>
> Jan
>

I will ensure that the fix for this is suitably separate in the patch
series, and in the easiest backportable form.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:31:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:31:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZgS-0008O4-43; Thu, 22 Nov 2012 16:31:24 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbZgQ-0008Nx-Hi
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 16:31:22 +0000
Received: from [193.109.254.147:60232] by server-12.bemta-14.messagelabs.com
	id 4C/EA-00510-9535EA05; Thu, 22 Nov 2012 16:31:21 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1353601865!4989876!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20139 invoked from network); 22 Nov 2012 16:31:07 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 16:31:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="215287331"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 16:31:05 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 11:31:04 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbZg8-000833-EQ;
	Thu, 22 Nov 2012 16:31:04 +0000
Message-ID: <50AE5348.502@citrix.com>
Date: Thu, 22 Nov 2012 16:31:04 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<50AE4F8402000078000AAA02@nat28.tlf.novell.com>
	<50AE41DD.2030703@citrix.com>
	<50AE511302000078000AAA14@nat28.tlf.novell.com>
	<50AE46B0.6010807@citrix.com>
	<50AE590502000078000AAA48@nat28.tlf.novell.com>
	<50AE4D2C.1040104@citrix.com>
	<50AE5D1102000078000AAA69@nat28.tlf.novell.com>
In-Reply-To: <50AE5D1102000078000AAA69@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
	handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 22/11/12 16:12, Jan Beulich wrote:
>>>> On 22.11.12 at 17:05, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> On 22/11/12 15:55, Jan Beulich wrote:
>>>>>> On 22.11.12 at 16:37, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>>> A quick solution would be to execute a noop function with
>>>> run_in_exception_handler().  Alternatively, I can code enable_nmi() or
>>>> so which does an inline iret to itself.  Which of these would you prefer?
>>> I would actually consider avoiding to run softirqs altogether in that
>>> case, just like native Linux doesn't do any event or scheduler
>>> processing in that case.
>> That would probably be the easiest solution.
>>
>> I was already going to do the same for the rentrant NMI and MCE handling
>> case (and also the process pending upcalls checking), due to the
>> complexities of fixing the race condition at the end of the handler.
>>
>> Unfortunately, I don't think I have time to look at this issue
>> immediately, but if it is ok to wait till the beginning of next week, I
> That's fine of course.
>
>> can roll it into the main dev work for the other NMI/MCE work.
> Hmm, that would mean it's going to be more difficult to backport.
> I'd prefer having this in as simple a fashion as possible in the
> patch here, and then have your other patch(es) build on top of
> that.
>
> Jan
>

I will ensure that the fix for this is suitably separate in the patch
series, and in the easiest backportable form.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:33:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:33:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZiM-0008UO-Kf; Thu, 22 Nov 2012 16:33:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TbZiL-0008UI-DN
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 16:33:21 +0000
Received: from [193.109.254.147:24882] by server-6.bemta-14.messagelabs.com id
	D9/0E-02788-0D35EA05; Thu, 22 Nov 2012 16:33:20 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353601998!9259595!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0NzMxMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8657 invoked from network); 22 Nov 2012 16:33:19 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-8.tower-27.messagelabs.com with SMTP;
	22 Nov 2012 16:33:19 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga101.fm.intel.com with ESMTP; 22 Nov 2012 08:33:17 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,301,1352102400"; d="scan'208";a="251127015"
Received: from ljsromley.bj.intel.com ([10.240.192.102])
	by fmsmga001.fm.intel.com with ESMTP; 22 Nov 2012 08:33:16 -0800
MIME-Version: 1.0
X-Mercurial-Node: d3378692eece3e552ba24d9800ae72e1547b781f
Message-Id: <d3378692eece3e552ba2.1353630328@ljsromley.bj.intel.com>
User-Agent: Mercurial-patchbomb/1.4
Date: Fri, 23 Nov 2012 08:25:28 +0800
From: Liu Jinsong <jinsong.liu@intel.com>
To: ian.campbell@citrix.com, george.dunlap@eu.citrix.com,
	Ian.Jackson@eu.citrix.com, JBeulich@suse.com
Cc: xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard to
	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch handles broken page wrt migration. Generally there are below cases:
1. broken page occurs before migration
2. broken page occurs during migration
  2.1 broken page occurs during migration but not at the last iteration
  2.2 broken page occurs at the last iteration of migration

For case 1, at the sender the broken page will be mapped but not copied
  to target (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number will be transferred to target so that
  target take appropriate action.

For case 2.1, at the sender mce handler marks the broken page to dirty
  bitmap, so that at next iteration, its pfn_type and pfn number will be
  transferred to the target and then take appropriate action.

For case 2.2, at the sender it adds a check to see if vMCE occurs at the
  last iteration. If yes, it will do more iteration(s) so that the broken
  page's pfn_type and pfn number will be transferred to target.
  Another point is, if guest save to disk and during which vMCE occurs,
  it also need do more iteration(s).

For all cases at the target (if migration not aborted by vMCE):
  Target will populates pages for guest. As for the case of broken page,
  we prefer to keep the type of the page for the sake of seamless migration.
  Target will set p2m as p2m_ram_broken for broken page. If guest access
  the broken page again it will kill itself as expected.

All above description is based on the assumption that migration will success.
However, for case 2 there are scenario that may result in guest or hypervisor
crash. When pfn_type detecting fail to get p2m_ram_broken (vMCE occur after the
detecting) and read the broken page, guest/hypervisor may survive or crash,
depending on error nature and how guest/hypervisor handle it. If guest/hypervisor
survive, migration is OK since it will transfer pfn_type to the target at next
iter and then prevent further harm at target. If guest/hypervisor crash it
definitely needn't care migration any more. Unfortunately we have no way to
predict it, so what we can do is to do the best to handle it, after all we
cannot forbid migration for fear that it may crash guest/hypervisor.

Patch version history:
V4:
  - adjust variables and patch description based on feedback
V3:
  - handle pages broken at the last iteration
V2:
  - migrate continue when broken page occur during migration,
    via marking broken page to dirty bitmap
V1:
  - migration abort when broken page occur during migration
  - transfer pfn_type to target for broken page occur before migration

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

- for hypervisor part of the patch
Acked-by: Jan Beulich <JBeulich@suse.com>

diff -r 8b93ac0c93f3 -r d3378692eece tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain.c	Fri Nov 23 08:21:57 2012 +0800
@@ -283,6 +283,22 @@
     return ret;
 }
 
+/* set broken page p2m */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn)
+{
+    int ret;
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
+    domctl.domain = (domid_t)domid;
+    domctl.u.set_broken_page_p2m.pfn = pfn;
+    ret = do_domctl(xch, &domctl);
+
+    return ret ? -1 : 0;
+}
+
 /* get info from hvm guest for save */
 int xc_domain_hvm_getcontext(xc_interface *xch,
                              uint32_t domid,
diff -r 8b93ac0c93f3 -r d3378692eece tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_restore.c	Fri Nov 23 08:21:57 2012 +0800
@@ -1023,9 +1023,15 @@
 
     countpages = count;
     for (i = oldcount; i < buf->nr_pages; ++i)
-        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
-            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
+    {
+        unsigned long pagetype;
+
+        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
+        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
+             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
+             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
             --countpages;
+    }
 
     if (!countpages)
         return count;
@@ -1267,6 +1273,17 @@
             /* a bogus/unmapped/allocate-only page: skip it */
             continue;
 
+        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
+        {
+            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
+            {
+                ERROR("Set p2m for broken page failed, "
+                      "dom=%d, pfn=%lx\n", dom, pfn);
+                goto err_mapped;
+            }
+            continue;
+        }
+
         if (pfn_err[i])
         {
             ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
diff -r 8b93ac0c93f3 -r d3378692eece tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_save.c	Fri Nov 23 08:21:57 2012 +0800
@@ -1118,7 +1118,7 @@
     /* Now write out each data page, canonicalising page tables as we go... */
     for ( ; ; )
     {
-        unsigned int N, batch, run;
+        unsigned int N, batch, run, broken_before_send, broken_after_send;
         char reportbuf[80];
 
         snprintf(reportbuf, sizeof(reportbuf),
@@ -1270,6 +1270,7 @@
                 goto out;
             }
 
+            broken_before_send = 0;
             for ( run = j = 0; j < batch; j++ )
             {
                 unsigned long gmfn = pfn_batch[j];
@@ -1277,6 +1278,14 @@
                 if ( !hvm )
                     gmfn = pfn_to_mfn(gmfn);
 
+                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                {
+                    pfn_type[j] |= pfn_batch[j];
+                    ++broken_before_send;
+                    ++run;
+                    continue;
+                }
+
                 if ( pfn_err[j] )
                 {
                     if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
@@ -1371,8 +1380,12 @@
                     }
                 }
 
-                /* skip pages that aren't present or are alloc-only */
+                /*
+                 * skip pages that aren't present,
+                 * or are broken, or are alloc-only
+                 */
                 if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
+                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
                     || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
                     continue;
 
@@ -1484,6 +1497,38 @@
 
             munmap(region_base, batch*PAGE_SIZE);
 
+            /*
+             * At the last iter, count the number of broken pages after sending,
+             * and if there are more than before sending, do one or more iter
+             * to make sure the pages are marked broken on the receiving side.
+             */
+            if ( last_iter )
+            {
+                /* Read pfn type again */
+                for ( j = 0; j < batch; j++ )
+                {
+                    if ( hvm )
+                        pfn_type[j] = pfn_batch[j];
+                    else
+                        pfn_type[j] = pfn_to_mfn(pfn_batch[j]);
+                }
+
+                if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
+                {
+                    PERROR("get_pfn_type_batch failed");
+                    goto out;
+                }
+
+                /* Count the number of broken pages */
+                broken_after_send = 0;
+                for ( j = 0; j < batch; j++ )
+                    if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                        broken_after_send++;
+
+                /* If there are more than before sending, do more iter(s) */
+                if ( broken_before_send < broken_after_send )
+                    last_iter = 0;
+            }
         } /* end of this while loop for this iteration */
 
       skip:
@@ -1550,23 +1595,22 @@
                     PERROR("Error when writing to state file (tsc)");
                     goto out;
                 }
+            }
+        }
+        else
+            last_iter = 1;
 
+        if ( xc_shadow_control(xch, dom,
+                               XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),
+                               dinfo->p2m_size, NULL, 0, &shadow_stats) != dinfo->p2m_size )
+        {
+            PERROR("Error flushing shadow PT");
+            goto out;
+        }
 
-            }
+        sent_last_iter = sent_this_iter;
 
-            if ( xc_shadow_control(xch, dom,
-                                   XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),
-                                   dinfo->p2m_size, NULL, 0, &shadow_stats) != dinfo->p2m_size )
-            {
-                PERROR("Error flushing shadow PT");
-                goto out;
-            }
-
-            sent_last_iter = sent_this_iter;
-
-            print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, 1);
-
-        }
+        print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, 1);
     } /* end of infinite for loop */
 
     DPRINTF("All memory is saved\n");
diff -r 8b93ac0c93f3 -r d3378692eece tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xenctrl.h	Fri Nov 23 08:21:57 2012 +0800
@@ -575,6 +575,17 @@
                           xc_domaininfo_t *info);
 
 /**
+ * This function set p2m for broken page
+ * &parm xch a handle to an open hypervisor interface
+ * @parm domid the domain id which broken page belong to
+ * @parm pfn the pfn number of the broken page
+ * @return 0 on success, -1 on failure
+ */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn);
+
+/**
  * This function returns information about the context of a hvm domain
  * @parm xch a handle to an open hypervisor interface
  * @parm domid the domain to get information from
diff -r 8b93ac0c93f3 -r d3378692eece xen/arch/x86/cpu/mcheck/mcaction.c
--- a/xen/arch/x86/cpu/mcheck/mcaction.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Fri Nov 23 08:21:57 2012 +0800
@@ -1,5 +1,6 @@
 #include <xen/types.h>
 #include <xen/sched.h>
+#include <asm/p2m.h>
 #include "mcaction.h"
 #include "vmce.h"
 #include "mce.h"
@@ -91,6 +92,24 @@
                     goto vmce_failed;
                 }
 
+                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram &&
+                     paging_mode_log_dirty(d) )
+                {
+                    /*
+                     * vMCE occur during migration
+                     *
+                     *   At sender, it marks broken page to dirty bitmap,
+                     *   so that at copypages stage of migration, broken
+                     *   page's pfn_type and pfn number would be transferred
+                     *   to target and then take appropriate action.
+                     *
+                     *   At target, it would set p2m as p2m_ram_broken for
+                     *   broken page, so that if guest access the broken page
+                     *   again, it would kill itself as expected.
+                     */
+                    paging_mark_dirty(d, mfn);
+                }
+
                 if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
                 {
                     printk("Unmap broken memory %lx for DOM%d failed\n",
diff -r 8b93ac0c93f3 -r d3378692eece xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/arch/x86/domctl.c	Fri Nov 23 08:21:57 2012 +0800
@@ -209,12 +209,18 @@
                 for ( j = 0; j < k; j++ )
                 {
                     unsigned long type = 0;
+                    p2m_type_t t;
 
-                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
+                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
 
                     if ( unlikely(!page) ||
                          unlikely(is_xen_heap_page(page)) )
-                        type = XEN_DOMCTL_PFINFO_XTAB;
+                    {
+                        if ( p2m_is_broken(t) )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
+                        else
+                            type = XEN_DOMCTL_PFINFO_XTAB;
+                    }
                     else
                     {
                         switch( page->u.inuse.type_info & PGT_type_mask )
@@ -235,6 +241,9 @@
 
                         if ( page->u.inuse.type_info & PGT_pinned )
                             type |= XEN_DOMCTL_PFINFO_LPINTAB;
+
+                        if ( page->count_info & PGC_broken )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
                     }
 
                     if ( page )
@@ -1568,6 +1577,29 @@
     }
     break;
 
+    case XEN_DOMCTL_set_broken_page_p2m:
+    {
+        struct domain *d;
+
+        d = rcu_lock_domain_by_id(domctl->domain);
+        if ( d != NULL )
+        {
+            p2m_type_t pt;
+            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
+            mfn_t mfn = get_gfn_query(d, pfn, &pt);
+
+            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
+                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
+                ret = -EINVAL;
+
+            put_gfn(d, pfn);
+            rcu_unlock_domain(d);
+        }
+        else
+            ret = -ESRCH;
+    }
+    break;
+
     default:
         ret = iommu_do_domctl(domctl, u_domctl);
         break;
diff -r 8b93ac0c93f3 -r d3378692eece xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/include/public/domctl.h	Fri Nov 23 08:21:57 2012 +0800
@@ -136,6 +136,7 @@
 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
 #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
 #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
+#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
 
 struct xen_domctl_getpageframeinfo {
@@ -834,6 +835,12 @@
 typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
 
+struct xen_domctl_set_broken_page_p2m {
+    uint64_aligned_t pfn;
+};
+typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -899,6 +906,7 @@
 #define XEN_DOMCTL_set_access_required           64
 #define XEN_DOMCTL_audit_p2m                     65
 #define XEN_DOMCTL_set_virq_handler              66
+#define XEN_DOMCTL_set_broken_page_p2m           67
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -954,6 +962,7 @@
         struct xen_domctl_audit_p2m         audit_p2m;
         struct xen_domctl_set_virq_handler  set_virq_handler;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
+        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
         uint8_t                             pad[128];

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:33:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:33:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZiM-0008UO-Kf; Thu, 22 Nov 2012 16:33:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TbZiL-0008UI-DN
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 16:33:21 +0000
Received: from [193.109.254.147:24882] by server-6.bemta-14.messagelabs.com id
	D9/0E-02788-0D35EA05; Thu, 22 Nov 2012 16:33:20 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353601998!9259595!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0NzMxMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8657 invoked from network); 22 Nov 2012 16:33:19 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-8.tower-27.messagelabs.com with SMTP;
	22 Nov 2012 16:33:19 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga101.fm.intel.com with ESMTP; 22 Nov 2012 08:33:17 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,301,1352102400"; d="scan'208";a="251127015"
Received: from ljsromley.bj.intel.com ([10.240.192.102])
	by fmsmga001.fm.intel.com with ESMTP; 22 Nov 2012 08:33:16 -0800
MIME-Version: 1.0
X-Mercurial-Node: d3378692eece3e552ba24d9800ae72e1547b781f
Message-Id: <d3378692eece3e552ba2.1353630328@ljsromley.bj.intel.com>
User-Agent: Mercurial-patchbomb/1.4
Date: Fri, 23 Nov 2012 08:25:28 +0800
From: Liu Jinsong <jinsong.liu@intel.com>
To: ian.campbell@citrix.com, george.dunlap@eu.citrix.com,
	Ian.Jackson@eu.citrix.com, JBeulich@suse.com
Cc: xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard to
	migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch handles broken page wrt migration. Generally there are below cases:
1. broken page occurs before migration
2. broken page occurs during migration
  2.1 broken page occurs during migration but not at the last iteration
  2.2 broken page occurs at the last iteration of migration

For case 1, at the sender the broken page will be mapped but not copied
  to target (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number will be transferred to target so that
  target take appropriate action.

For case 2.1, at the sender mce handler marks the broken page to dirty
  bitmap, so that at next iteration, its pfn_type and pfn number will be
  transferred to the target and then take appropriate action.

For case 2.2, at the sender it adds a check to see if vMCE occurs at the
  last iteration. If yes, it will do more iteration(s) so that the broken
  page's pfn_type and pfn number will be transferred to target.
  Another point is, if guest save to disk and during which vMCE occurs,
  it also need do more iteration(s).

For all cases at the target (if migration not aborted by vMCE):
  Target will populates pages for guest. As for the case of broken page,
  we prefer to keep the type of the page for the sake of seamless migration.
  Target will set p2m as p2m_ram_broken for broken page. If guest access
  the broken page again it will kill itself as expected.

All above description is based on the assumption that migration will success.
However, for case 2 there are scenario that may result in guest or hypervisor
crash. When pfn_type detecting fail to get p2m_ram_broken (vMCE occur after the
detecting) and read the broken page, guest/hypervisor may survive or crash,
depending on error nature and how guest/hypervisor handle it. If guest/hypervisor
survive, migration is OK since it will transfer pfn_type to the target at next
iter and then prevent further harm at target. If guest/hypervisor crash it
definitely needn't care migration any more. Unfortunately we have no way to
predict it, so what we can do is to do the best to handle it, after all we
cannot forbid migration for fear that it may crash guest/hypervisor.

Patch version history:
V4:
  - adjust variables and patch description based on feedback
V3:
  - handle pages broken at the last iteration
V2:
  - migrate continue when broken page occur during migration,
    via marking broken page to dirty bitmap
V1:
  - migration abort when broken page occur during migration
  - transfer pfn_type to target for broken page occur before migration

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

- for hypervisor part of the patch
Acked-by: Jan Beulich <JBeulich@suse.com>

diff -r 8b93ac0c93f3 -r d3378692eece tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain.c	Fri Nov 23 08:21:57 2012 +0800
@@ -283,6 +283,22 @@
     return ret;
 }
 
+/* set broken page p2m */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn)
+{
+    int ret;
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
+    domctl.domain = (domid_t)domid;
+    domctl.u.set_broken_page_p2m.pfn = pfn;
+    ret = do_domctl(xch, &domctl);
+
+    return ret ? -1 : 0;
+}
+
 /* get info from hvm guest for save */
 int xc_domain_hvm_getcontext(xc_interface *xch,
                              uint32_t domid,
diff -r 8b93ac0c93f3 -r d3378692eece tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_restore.c	Fri Nov 23 08:21:57 2012 +0800
@@ -1023,9 +1023,15 @@
 
     countpages = count;
     for (i = oldcount; i < buf->nr_pages; ++i)
-        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
-            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
+    {
+        unsigned long pagetype;
+
+        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
+        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
+             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
+             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
             --countpages;
+    }
 
     if (!countpages)
         return count;
@@ -1267,6 +1273,17 @@
             /* a bogus/unmapped/allocate-only page: skip it */
             continue;
 
+        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
+        {
+            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
+            {
+                ERROR("Set p2m for broken page failed, "
+                      "dom=%d, pfn=%lx\n", dom, pfn);
+                goto err_mapped;
+            }
+            continue;
+        }
+
         if (pfn_err[i])
         {
             ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
diff -r 8b93ac0c93f3 -r d3378692eece tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xc_domain_save.c	Fri Nov 23 08:21:57 2012 +0800
@@ -1118,7 +1118,7 @@
     /* Now write out each data page, canonicalising page tables as we go... */
     for ( ; ; )
     {
-        unsigned int N, batch, run;
+        unsigned int N, batch, run, broken_before_send, broken_after_send;
         char reportbuf[80];
 
         snprintf(reportbuf, sizeof(reportbuf),
@@ -1270,6 +1270,7 @@
                 goto out;
             }
 
+            broken_before_send = 0;
             for ( run = j = 0; j < batch; j++ )
             {
                 unsigned long gmfn = pfn_batch[j];
@@ -1277,6 +1278,14 @@
                 if ( !hvm )
                     gmfn = pfn_to_mfn(gmfn);
 
+                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                {
+                    pfn_type[j] |= pfn_batch[j];
+                    ++broken_before_send;
+                    ++run;
+                    continue;
+                }
+
                 if ( pfn_err[j] )
                 {
                     if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
@@ -1371,8 +1380,12 @@
                     }
                 }
 
-                /* skip pages that aren't present or are alloc-only */
+                /*
+                 * skip pages that aren't present,
+                 * or are broken, or are alloc-only
+                 */
                 if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
+                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
                     || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
                     continue;
 
@@ -1484,6 +1497,38 @@
 
             munmap(region_base, batch*PAGE_SIZE);
 
+            /*
+             * At the last iter, count the number of broken pages after sending,
+             * and if there are more than before sending, do one or more iter
+             * to make sure the pages are marked broken on the receiving side.
+             */
+            if ( last_iter )
+            {
+                /* Read pfn type again */
+                for ( j = 0; j < batch; j++ )
+                {
+                    if ( hvm )
+                        pfn_type[j] = pfn_batch[j];
+                    else
+                        pfn_type[j] = pfn_to_mfn(pfn_batch[j]);
+                }
+
+                if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
+                {
+                    PERROR("get_pfn_type_batch failed");
+                    goto out;
+                }
+
+                /* Count the number of broken pages */
+                broken_after_send = 0;
+                for ( j = 0; j < batch; j++ )
+                    if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                        broken_after_send++;
+
+                /* If there are more than before sending, do more iter(s) */
+                if ( broken_before_send < broken_after_send )
+                    last_iter = 0;
+            }
         } /* end of this while loop for this iteration */
 
       skip:
@@ -1550,23 +1595,22 @@
                     PERROR("Error when writing to state file (tsc)");
                     goto out;
                 }
+            }
+        }
+        else
+            last_iter = 1;
 
+        if ( xc_shadow_control(xch, dom,
+                               XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),
+                               dinfo->p2m_size, NULL, 0, &shadow_stats) != dinfo->p2m_size )
+        {
+            PERROR("Error flushing shadow PT");
+            goto out;
+        }
 
-            }
+        sent_last_iter = sent_this_iter;
 
-            if ( xc_shadow_control(xch, dom,
-                                   XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),
-                                   dinfo->p2m_size, NULL, 0, &shadow_stats) != dinfo->p2m_size )
-            {
-                PERROR("Error flushing shadow PT");
-                goto out;
-            }
-
-            sent_last_iter = sent_this_iter;
-
-            print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, 1);
-
-        }
+        print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, 1);
     } /* end of infinite for loop */
 
     DPRINTF("All memory is saved\n");
diff -r 8b93ac0c93f3 -r d3378692eece tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/libxc/xenctrl.h	Fri Nov 23 08:21:57 2012 +0800
@@ -575,6 +575,17 @@
                           xc_domaininfo_t *info);
 
 /**
+ * This function set p2m for broken page
+ * &parm xch a handle to an open hypervisor interface
+ * @parm domid the domain id which broken page belong to
+ * @parm pfn the pfn number of the broken page
+ * @return 0 on success, -1 on failure
+ */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn);
+
+/**
  * This function returns information about the context of a hvm domain
  * @parm xch a handle to an open hypervisor interface
  * @parm domid the domain to get information from
diff -r 8b93ac0c93f3 -r d3378692eece xen/arch/x86/cpu/mcheck/mcaction.c
--- a/xen/arch/x86/cpu/mcheck/mcaction.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Fri Nov 23 08:21:57 2012 +0800
@@ -1,5 +1,6 @@
 #include <xen/types.h>
 #include <xen/sched.h>
+#include <asm/p2m.h>
 #include "mcaction.h"
 #include "vmce.h"
 #include "mce.h"
@@ -91,6 +92,24 @@
                     goto vmce_failed;
                 }
 
+                if ( is_hvm_domain(d) && !d->arch.hvm_domain.dirty_vram &&
+                     paging_mode_log_dirty(d) )
+                {
+                    /*
+                     * vMCE occur during migration
+                     *
+                     *   At sender, it marks broken page to dirty bitmap,
+                     *   so that at copypages stage of migration, broken
+                     *   page's pfn_type and pfn number would be transferred
+                     *   to target and then take appropriate action.
+                     *
+                     *   At target, it would set p2m as p2m_ram_broken for
+                     *   broken page, so that if guest access the broken page
+                     *   again, it would kill itself as expected.
+                     */
+                    paging_mark_dirty(d, mfn);
+                }
+
                 if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
                 {
                     printk("Unmap broken memory %lx for DOM%d failed\n",
diff -r 8b93ac0c93f3 -r d3378692eece xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/arch/x86/domctl.c	Fri Nov 23 08:21:57 2012 +0800
@@ -209,12 +209,18 @@
                 for ( j = 0; j < k; j++ )
                 {
                     unsigned long type = 0;
+                    p2m_type_t t;
 
-                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
+                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
 
                     if ( unlikely(!page) ||
                          unlikely(is_xen_heap_page(page)) )
-                        type = XEN_DOMCTL_PFINFO_XTAB;
+                    {
+                        if ( p2m_is_broken(t) )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
+                        else
+                            type = XEN_DOMCTL_PFINFO_XTAB;
+                    }
                     else
                     {
                         switch( page->u.inuse.type_info & PGT_type_mask )
@@ -235,6 +241,9 @@
 
                         if ( page->u.inuse.type_info & PGT_pinned )
                             type |= XEN_DOMCTL_PFINFO_LPINTAB;
+
+                        if ( page->count_info & PGC_broken )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
                     }
 
                     if ( page )
@@ -1568,6 +1577,29 @@
     }
     break;
 
+    case XEN_DOMCTL_set_broken_page_p2m:
+    {
+        struct domain *d;
+
+        d = rcu_lock_domain_by_id(domctl->domain);
+        if ( d != NULL )
+        {
+            p2m_type_t pt;
+            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
+            mfn_t mfn = get_gfn_query(d, pfn, &pt);
+
+            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
+                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
+                ret = -EINVAL;
+
+            put_gfn(d, pfn);
+            rcu_unlock_domain(d);
+        }
+        else
+            ret = -ESRCH;
+    }
+    break;
+
     default:
         ret = iommu_do_domctl(domctl, u_domctl);
         break;
diff -r 8b93ac0c93f3 -r d3378692eece xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Tue Nov 13 11:19:17 2012 +0000
+++ b/xen/include/public/domctl.h	Fri Nov 23 08:21:57 2012 +0800
@@ -136,6 +136,7 @@
 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
 #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
 #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
+#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
 
 struct xen_domctl_getpageframeinfo {
@@ -834,6 +835,12 @@
 typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
 
+struct xen_domctl_set_broken_page_p2m {
+    uint64_aligned_t pfn;
+};
+typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -899,6 +906,7 @@
 #define XEN_DOMCTL_set_access_required           64
 #define XEN_DOMCTL_audit_p2m                     65
 #define XEN_DOMCTL_set_virq_handler              66
+#define XEN_DOMCTL_set_broken_page_p2m           67
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -954,6 +962,7 @@
         struct xen_domctl_audit_p2m         audit_p2m;
         struct xen_domctl_set_virq_handler  set_virq_handler;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
+        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
         uint8_t                             pad[128];

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:44:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZsq-0000PL-Pv; Thu, 22 Nov 2012 16:44:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TbZso-0000PG-TA
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 16:44:11 +0000
Received: from [85.158.139.83:51404] by server-8.bemta-5.messagelabs.com id
	82/75-06050-9565EA05; Thu, 22 Nov 2012 16:44:09 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1353602647!31192539!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28974 invoked from network); 22 Nov 2012 16:44:09 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 16:44:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="215287919"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 16:44:06 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 11:43:56 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TbZsa-0008ET-2Q;
	Thu, 22 Nov 2012 16:43:56 +0000
Date: Thu, 22 Nov 2012 16:43:15 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: qemu-devel@nongnu.org
Message-ID: <alpine.DEB.2.02.1211221642310.13749@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: xen-devel@lists.xensource.com,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH] xen: implement support for secondary consoles
 in the console backend
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch corresponds to commit
840184a106bc24e745beda5c77e392f6cecd2bc9 from
git://xenbits.xensource.com/qemu-xen-unstable.git.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/hw/xen_console.c b/hw/xen_console.c
index 9426d73..1349881 100644
--- a/hw/xen_console.c
+++ b/hw/xen_console.c
@@ -184,7 +184,11 @@ static int con_init(struct XenDevice *xendev)
 
     /* setup */
     dom = xs_get_domain_path(xenstore, con->xendev.dom);
-    snprintf(con->console, sizeof(con->console), "%s/console", dom);
+    if (!xendev->dev) {
+        snprintf(con->console, sizeof(con->console), "%s/console", dom);
+    } else {
+        snprintf(con->console, sizeof(con->console), "%s/device/console/%d", dom, xendev->dev);
+    }
     free(dom);
 
     type = xenstore_read_str(con->console, "type");
@@ -223,10 +227,16 @@ static int con_initialise(struct XenDevice *xendev)
     if (xenstore_read_int(con->console, "limit", &limit) == 0)
 	con->buffer.max_capacity = limit;
 
-    con->sring = xc_map_foreign_range(xen_xc, con->xendev.dom,
-				      XC_PAGE_SIZE,
-				      PROT_READ|PROT_WRITE,
-				      con->ring_ref);
+    if (!xendev->dev) {
+        con->sring = xc_map_foreign_range(xen_xc, con->xendev.dom,
+                                          XC_PAGE_SIZE,
+                                          PROT_READ|PROT_WRITE,
+                                          con->ring_ref);
+    } else {
+        con->sring = xc_gnttab_map_grant_ref(xendev->gnttabdev, con->xendev.dom,
+                                             con->ring_ref,
+                                             PROT_READ|PROT_WRITE);
+    }
     if (!con->sring)
 	return -1;
 
@@ -255,7 +265,11 @@ static void con_disconnect(struct XenDevice *xendev)
     xen_be_unbind_evtchn(&con->xendev);
 
     if (con->sring) {
-	munmap(con->sring, XC_PAGE_SIZE);
+        if (!xendev->gnttabdev) {
+            munmap(con->sring, XC_PAGE_SIZE);
+        } else {
+            xc_gnttab_munmap(xendev->gnttabdev, con->sring, 1);
+        }
 	con->sring = NULL;
     }
 }
@@ -273,7 +287,7 @@ static void con_event(struct XenDevice *xendev)
 
 struct XenDevOps xen_console_ops = {
     .size       = sizeof(struct XenConsole),
-    .flags      = DEVOPS_FLAG_IGNORE_STATE,
+    .flags      = DEVOPS_FLAG_IGNORE_STATE|DEVOPS_FLAG_NEED_GNTDEV,
     .init       = con_init,
     .initialise = con_initialise,
     .event      = con_event,

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:44:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbZsq-0000PL-Pv; Thu, 22 Nov 2012 16:44:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TbZso-0000PG-TA
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 16:44:11 +0000
Received: from [85.158.139.83:51404] by server-8.bemta-5.messagelabs.com id
	82/75-06050-9565EA05; Thu, 22 Nov 2012 16:44:09 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1353602647!31192539!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28974 invoked from network); 22 Nov 2012 16:44:09 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 16:44:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="215287919"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 16:44:06 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 11:43:56 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TbZsa-0008ET-2Q;
	Thu, 22 Nov 2012 16:43:56 +0000
Date: Thu, 22 Nov 2012 16:43:15 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: qemu-devel@nongnu.org
Message-ID: <alpine.DEB.2.02.1211221642310.13749@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: xen-devel@lists.xensource.com,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH] xen: implement support for secondary consoles
 in the console backend
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch corresponds to commit
840184a106bc24e745beda5c77e392f6cecd2bc9 from
git://xenbits.xensource.com/qemu-xen-unstable.git.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/hw/xen_console.c b/hw/xen_console.c
index 9426d73..1349881 100644
--- a/hw/xen_console.c
+++ b/hw/xen_console.c
@@ -184,7 +184,11 @@ static int con_init(struct XenDevice *xendev)
 
     /* setup */
     dom = xs_get_domain_path(xenstore, con->xendev.dom);
-    snprintf(con->console, sizeof(con->console), "%s/console", dom);
+    if (!xendev->dev) {
+        snprintf(con->console, sizeof(con->console), "%s/console", dom);
+    } else {
+        snprintf(con->console, sizeof(con->console), "%s/device/console/%d", dom, xendev->dev);
+    }
     free(dom);
 
     type = xenstore_read_str(con->console, "type");
@@ -223,10 +227,16 @@ static int con_initialise(struct XenDevice *xendev)
     if (xenstore_read_int(con->console, "limit", &limit) == 0)
 	con->buffer.max_capacity = limit;
 
-    con->sring = xc_map_foreign_range(xen_xc, con->xendev.dom,
-				      XC_PAGE_SIZE,
-				      PROT_READ|PROT_WRITE,
-				      con->ring_ref);
+    if (!xendev->dev) {
+        con->sring = xc_map_foreign_range(xen_xc, con->xendev.dom,
+                                          XC_PAGE_SIZE,
+                                          PROT_READ|PROT_WRITE,
+                                          con->ring_ref);
+    } else {
+        con->sring = xc_gnttab_map_grant_ref(xendev->gnttabdev, con->xendev.dom,
+                                             con->ring_ref,
+                                             PROT_READ|PROT_WRITE);
+    }
     if (!con->sring)
 	return -1;
 
@@ -255,7 +265,11 @@ static void con_disconnect(struct XenDevice *xendev)
     xen_be_unbind_evtchn(&con->xendev);
 
     if (con->sring) {
-	munmap(con->sring, XC_PAGE_SIZE);
+        if (!xendev->gnttabdev) {
+            munmap(con->sring, XC_PAGE_SIZE);
+        } else {
+            xc_gnttab_munmap(xendev->gnttabdev, con->sring, 1);
+        }
 	con->sring = NULL;
     }
 }
@@ -273,7 +287,7 @@ static void con_event(struct XenDevice *xendev)
 
 struct XenDevOps xen_console_ops = {
     .size       = sizeof(struct XenConsole),
-    .flags      = DEVOPS_FLAG_IGNORE_STATE,
+    .flags      = DEVOPS_FLAG_IGNORE_STATE|DEVOPS_FLAG_NEED_GNTDEV,
     .init       = con_init,
     .initialise = con_initialise,
     .event      = con_event,

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:57:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:57:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tba5W-0000kA-9d; Thu, 22 Nov 2012 16:57:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Tba5U-0000k5-Tl
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 16:57:17 +0000
Received: from [85.158.143.99:19483] by server-2.bemta-4.messagelabs.com id
	33/6E-28922-C695EA05; Thu, 22 Nov 2012 16:57:16 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1353603435!28329698!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22633 invoked from network); 22 Nov 2012 16:57:15 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-5.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 22 Nov 2012 16:57:15 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Tba5Q-000MWg-Gj; Thu, 22 Nov 2012 16:57:12 +0000
Date: Thu, 22 Nov 2012 16:57:12 +0000
From: Tim Deegan <tim@xen.org>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Message-ID: <20121122165712.GB83155@ocelot.phlegethon.org>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353423098-16371-6-git-send-email-dgdegra@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353423098-16371-6-git-send-email-dgdegra@tycho.nsa.gov>
User-Agent: Mutt/1.4.2.1i
Cc: keir@xen.org, ian.campbell@citrix.com, JBeulich@suse.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH RFC 5/5] xen/xsm: include default hook
	action in name
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi, 

At 09:51 -0500 on 20 Nov (1353405098), Daniel De Graaf wrote:
> Include the default XSM hook action in the name of the hook in order to
> allow quick understanding of how the call site is expected to be used
> (dom0-only, arbitrary guest, or target-only).

I like this a lot; it's much less worrying than having to follow every
xsm hook to see what it does. 

I would like it even more if the process were automatic -- as it stands
your dummy hooks must be manually coded to do what their name implies,
and if the code gets out of sync with the name it could be a long time
before anyone spotted it.

Would it be acceptable for every XSM hook to take a default action as
its first argument?  Then the call sites look like:

  xsm_do_mca(XSM_PRIV),
  xsm_unbind_pt_irq(XSM_HOOK, d, bind);

and so forth, and every one of the dummy hooks is just a wrapper around
a single central hook that DTRT with the default:

  static XSM_INLINE int xsm_do_mca(xsm_default_t default)
  {
	return xsm_default_action(default);
  }

  static XSM_INLINE int xsm_unbind_pt_irq(xsm_default_t default, struct domain *d, struct xen_domctl_bind_pt_irq *bind)
  {
	return xsm_default_action(default);
  }

and so forth.  It should be very hard to get it wrong.  I guess there
might have to be a standard order for things that take a domain or an
mfn, but do you think something along those lines could work?

If adding an arg is too much overhead I'm sure the dummy ops could 
be autogenerated from the name with some nasty CPP. :)

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 16:57:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 16:57:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tba5W-0000kA-9d; Thu, 22 Nov 2012 16:57:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Tba5U-0000k5-Tl
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 16:57:17 +0000
Received: from [85.158.143.99:19483] by server-2.bemta-4.messagelabs.com id
	33/6E-28922-C695EA05; Thu, 22 Nov 2012 16:57:16 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1353603435!28329698!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22633 invoked from network); 22 Nov 2012 16:57:15 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-5.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 22 Nov 2012 16:57:15 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Tba5Q-000MWg-Gj; Thu, 22 Nov 2012 16:57:12 +0000
Date: Thu, 22 Nov 2012 16:57:12 +0000
From: Tim Deegan <tim@xen.org>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Message-ID: <20121122165712.GB83155@ocelot.phlegethon.org>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353423098-16371-6-git-send-email-dgdegra@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353423098-16371-6-git-send-email-dgdegra@tycho.nsa.gov>
User-Agent: Mutt/1.4.2.1i
Cc: keir@xen.org, ian.campbell@citrix.com, JBeulich@suse.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH RFC 5/5] xen/xsm: include default hook
	action in name
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi, 

At 09:51 -0500 on 20 Nov (1353405098), Daniel De Graaf wrote:
> Include the default XSM hook action in the name of the hook in order to
> allow quick understanding of how the call site is expected to be used
> (dom0-only, arbitrary guest, or target-only).

I like this a lot; it's much less worrying than having to follow every
xsm hook to see what it does. 

I would like it even more if the process were automatic -- as it stands
your dummy hooks must be manually coded to do what their name implies,
and if the code gets out of sync with the name it could be a long time
before anyone spotted it.

Would it be acceptable for every XSM hook to take a default action as
its first argument?  Then the call sites look like:

  xsm_do_mca(XSM_PRIV),
  xsm_unbind_pt_irq(XSM_HOOK, d, bind);

and so forth, and every one of the dummy hooks is just a wrapper around
a single central hook that DTRT with the default:

  static XSM_INLINE int xsm_do_mca(xsm_default_t default)
  {
	return xsm_default_action(default);
  }

  static XSM_INLINE int xsm_unbind_pt_irq(xsm_default_t default, struct domain *d, struct xen_domctl_bind_pt_irq *bind)
  {
	return xsm_default_action(default);
  }

and so forth.  It should be very hard to get it wrong.  I guess there
might have to be a standard order for things that take a domain or an
mfn, but do you think something along those lines could work?

If adding an arg is too much overhead I'm sure the dummy ops could 
be autogenerated from the name with some nasty CPP. :)

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 17:07:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 17:07:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbaFa-00014z-01; Thu, 22 Nov 2012 17:07:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1TbaFX-00014Y-Ej; Thu, 22 Nov 2012 17:07:39 +0000
Received: from [85.158.143.35:22406] by server-2.bemta-4.messagelabs.com id
	0B/4A-28922-ADB5EA05; Thu, 22 Nov 2012 17:07:38 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1353604057!14105200!1
X-Originating-IP: [209.85.214.45]
X-SpamReason: No, hits=1.1 required=7.0 tests=HTML_40_50,HTML_MESSAGE,
	RCVD_BY_IP,RCVD_ILLEGAL_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30937 invoked from network); 22 Nov 2012 17:07:37 -0000
Received: from mail-bk0-f45.google.com (HELO mail-bk0-f45.google.com)
	(209.85.214.45)
	by server-16.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 17:07:37 -0000
Received: by mail-bk0-f45.google.com with SMTP id jk13so2860979bkc.32
	for <multiple recipients>; Thu, 22 Nov 2012 09:07:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:date:from:reply-to:user-agent:mime-version:to
	:subject:content-type;
	bh=Ch1K1MbsuaqMPpGhQ2UFdtc5KPCKGzPu3YniYG5fCqw=;
	b=yKMSP5icbizYqUZhqqNjSNqnCz+n6WJd+KpSstAs41LNgv8Ohh+a4uE5xhns2aXRBR
	Kh+FaMDk/VIjkQasLri+PwydEc4qxW12Qu454l7LFfFcmMxjhYCFAps2Eyi9I9YjjAr+
	zGMee7V2aZeDcGwFf7LRfZOvH3rlNb1h1zImDo4rRIXnPhO1OdQVj3LsDXLHksdtb2d/
	sYstON00K4oGDzNUV5DIO8AYSSyjZTEiAD6JdD7cfjwnGDE9RqMYA2eUT2EB4/6UhEuj
	gIZBx1JsE+3sXOgiMkZSQ5oQSq1W2yYKi01ZssllyJVDW/fnnnJp7Y2EEaPsXwuFgRL5
	L/eA==
Received: by 10.204.11.70 with SMTP id s6mr562999bks.63.1353604056757;
	Thu, 22 Nov 2012 09:07:36 -0800 (PST)
Received: from [172.16.26.11] (027fe853.bb.sky.com. [2.127.232.83])
	by mx.google.com with ESMTPS id e22sm2997848bke.14.2012.11.22.09.07.35
	(version=SSLv3 cipher=OTHER); Thu, 22 Nov 2012 09:07:36 -0800 (PST)
Message-ID: <50AE5BD6.5070804@xen.org>
Date: Thu, 22 Nov 2012 17:07:34 +0000
From: Lars Kurth <lars.kurth@xen.org>
User-Agent: Mozilla/5.0 (Windows NT 6.1;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, 
	"xen-api@lists.xen.org" <xen-api@lists.xen.org>,
	xen-users@lists.xen.org, xen-arm@lists.xen.org
Subject: [Xen-devel] Xen Document Day: Nov 26th,
	2012 on IRC freenode #xendocs
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: lars.kurth@xen.org
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3647616402371648436=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.
--===============3647616402371648436==
Content-Type: multipart/alternative;
 boundary="------------070209000901070603030909"

This is a multi-part message in MIME format.
--------------070209000901070603030909
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

everybody. A quick reminder that the next Xen Document Day is happening 
next Monday. More info on document days at 
http://wiki.xen.org/wiki/Xen_Document_Days

Hope to see you on IRC! Feel free to add stuff to the TODO list 
(http://wiki.xen.org/wiki/Xen_Document_Days/TODO) or put your name 
besides an item if you intend to work on it. I just cleaned up the list 
in preparation for Monday.

Best Regards
Lars

*********************
* Xen Document Days *
*********************

We have another Xen document day come up next Monday. Xen Document Days 
are for people who care about Xen Documentation and want to improve it. 
We introduced Documentation Days, because working on documentation in 
parallel with like minded-people, is just more fun than working alone! 
Everybody who can contribute is welcome to join!

For a list of items that need work, check out the community maintained 
TODO list (http://wiki.xen.org/wiki/Xen_Document_Days/TODO). Of course, 
you can work on anything you like: the list just provides suggestions.

How do I participate?
=====================

- Join us on IRC: freenode channel #xendocs
- Tell people what you intend to work on (to avoid doing something somebody
   else is already working on)
- Fix some documentation
- Help others
- And above all: have fun!

--------------070209000901070603030909
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-text-html" lang="x-western">
      <div class="moz-text-html" lang="x-western">
        <div class="moz-text-flowed" style="font-family: -moz-fixed;
          font-size: 14px;" lang="x-western">Hi, <br>
          <br>
          everybody. A quick reminder that the next Xen Document Day is
          happening next Monday. More info on document days at <a
            class="moz-txt-link-freetext"
            href="http://wiki.xen.org/wiki/Xen_Document_Days">http://wiki.xen.org/wiki/Xen_Document_Days</a>
          <br>
          <br>
          Hope to see you on IRC! Feel free to add stuff to the TODO
          list (<a class="moz-txt-link-freetext"
            href="http://wiki.xen.org/wiki/Xen_Document_Days/TODO">http://wiki.xen.org/wiki/Xen_Document_Days/TODO</a>)
          or put your name besides an item if you intend to work on it.
          I just cleaned up the list in preparation for Monday. <br>
          <br>
          Best Regards <br>
          Lars <br>
          <br>
          ********************* <br>
          * Xen Document Days * <br>
          ********************* <br>
          <br>
          We have another Xen document day come up next Monday. Xen
          Document Days are for people who care about Xen Documentation
          and want to improve it. We introduced Documentation Days,
          because working on documentation in parallel with like
          minded-people, is just more fun than working alone! Everybody
          who can contribute is welcome to join! <br>
          <br>
          For a list of items that need work, check out the community
          maintained TODO list (<a class="moz-txt-link-freetext"
            href="http://wiki.xen.org/wiki/Xen_Document_Days/TODO">http://wiki.xen.org/wiki/Xen_Document_Days/TODO</a>).


          Of course, you can work on anything you like: the list just
          provides suggestions. <br>
          <br>
          How do I participate? <br>
          ===================== <br>
          <br>
          - Join us on IRC: freenode channel #xendocs <br>
          - Tell people what you intend to work on (to avoid doing
          something somebody <br>
          &nbsp; else is already working on) <br>
          - Fix some documentation <br>
          - Help others <br>
          - And above all: have fun! <br>
        </div>
      </div>
    </div>
  </body>
</html>

--------------070209000901070603030909--


--===============3647616402371648436==
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.xen.org
http://lists.xen.org/xen-devel

--===============3647616402371648436==--


From xen-devel-bounces@lists.xen.org Thu Nov 22 17:07:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 17:07:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbaFa-00014z-01; Thu, 22 Nov 2012 17:07:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>)
	id 1TbaFX-00014Y-Ej; Thu, 22 Nov 2012 17:07:39 +0000
Received: from [85.158.143.35:22406] by server-2.bemta-4.messagelabs.com id
	0B/4A-28922-ADB5EA05; Thu, 22 Nov 2012 17:07:38 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1353604057!14105200!1
X-Originating-IP: [209.85.214.45]
X-SpamReason: No, hits=1.1 required=7.0 tests=HTML_40_50,HTML_MESSAGE,
	RCVD_BY_IP,RCVD_ILLEGAL_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30937 invoked from network); 22 Nov 2012 17:07:37 -0000
Received: from mail-bk0-f45.google.com (HELO mail-bk0-f45.google.com)
	(209.85.214.45)
	by server-16.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 17:07:37 -0000
Received: by mail-bk0-f45.google.com with SMTP id jk13so2860979bkc.32
	for <multiple recipients>; Thu, 22 Nov 2012 09:07:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:date:from:reply-to:user-agent:mime-version:to
	:subject:content-type;
	bh=Ch1K1MbsuaqMPpGhQ2UFdtc5KPCKGzPu3YniYG5fCqw=;
	b=yKMSP5icbizYqUZhqqNjSNqnCz+n6WJd+KpSstAs41LNgv8Ohh+a4uE5xhns2aXRBR
	Kh+FaMDk/VIjkQasLri+PwydEc4qxW12Qu454l7LFfFcmMxjhYCFAps2Eyi9I9YjjAr+
	zGMee7V2aZeDcGwFf7LRfZOvH3rlNb1h1zImDo4rRIXnPhO1OdQVj3LsDXLHksdtb2d/
	sYstON00K4oGDzNUV5DIO8AYSSyjZTEiAD6JdD7cfjwnGDE9RqMYA2eUT2EB4/6UhEuj
	gIZBx1JsE+3sXOgiMkZSQ5oQSq1W2yYKi01ZssllyJVDW/fnnnJp7Y2EEaPsXwuFgRL5
	L/eA==
Received: by 10.204.11.70 with SMTP id s6mr562999bks.63.1353604056757;
	Thu, 22 Nov 2012 09:07:36 -0800 (PST)
Received: from [172.16.26.11] (027fe853.bb.sky.com. [2.127.232.83])
	by mx.google.com with ESMTPS id e22sm2997848bke.14.2012.11.22.09.07.35
	(version=SSLv3 cipher=OTHER); Thu, 22 Nov 2012 09:07:36 -0800 (PST)
Message-ID: <50AE5BD6.5070804@xen.org>
Date: Thu, 22 Nov 2012 17:07:34 +0000
From: Lars Kurth <lars.kurth@xen.org>
User-Agent: Mozilla/5.0 (Windows NT 6.1;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, 
	"xen-api@lists.xen.org" <xen-api@lists.xen.org>,
	xen-users@lists.xen.org, xen-arm@lists.xen.org
Subject: [Xen-devel] Xen Document Day: Nov 26th,
	2012 on IRC freenode #xendocs
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: lars.kurth@xen.org
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3647616402371648436=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.
--===============3647616402371648436==
Content-Type: multipart/alternative;
 boundary="------------070209000901070603030909"

This is a multi-part message in MIME format.
--------------070209000901070603030909
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

everybody. A quick reminder that the next Xen Document Day is happening 
next Monday. More info on document days at 
http://wiki.xen.org/wiki/Xen_Document_Days

Hope to see you on IRC! Feel free to add stuff to the TODO list 
(http://wiki.xen.org/wiki/Xen_Document_Days/TODO) or put your name 
besides an item if you intend to work on it. I just cleaned up the list 
in preparation for Monday.

Best Regards
Lars

*********************
* Xen Document Days *
*********************

We have another Xen document day come up next Monday. Xen Document Days 
are for people who care about Xen Documentation and want to improve it. 
We introduced Documentation Days, because working on documentation in 
parallel with like minded-people, is just more fun than working alone! 
Everybody who can contribute is welcome to join!

For a list of items that need work, check out the community maintained 
TODO list (http://wiki.xen.org/wiki/Xen_Document_Days/TODO). Of course, 
you can work on anything you like: the list just provides suggestions.

How do I participate?
=====================

- Join us on IRC: freenode channel #xendocs
- Tell people what you intend to work on (to avoid doing something somebody
   else is already working on)
- Fix some documentation
- Help others
- And above all: have fun!

--------------070209000901070603030909
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-text-html" lang="x-western">
      <div class="moz-text-html" lang="x-western">
        <div class="moz-text-flowed" style="font-family: -moz-fixed;
          font-size: 14px;" lang="x-western">Hi, <br>
          <br>
          everybody. A quick reminder that the next Xen Document Day is
          happening next Monday. More info on document days at <a
            class="moz-txt-link-freetext"
            href="http://wiki.xen.org/wiki/Xen_Document_Days">http://wiki.xen.org/wiki/Xen_Document_Days</a>
          <br>
          <br>
          Hope to see you on IRC! Feel free to add stuff to the TODO
          list (<a class="moz-txt-link-freetext"
            href="http://wiki.xen.org/wiki/Xen_Document_Days/TODO">http://wiki.xen.org/wiki/Xen_Document_Days/TODO</a>)
          or put your name besides an item if you intend to work on it.
          I just cleaned up the list in preparation for Monday. <br>
          <br>
          Best Regards <br>
          Lars <br>
          <br>
          ********************* <br>
          * Xen Document Days * <br>
          ********************* <br>
          <br>
          We have another Xen document day come up next Monday. Xen
          Document Days are for people who care about Xen Documentation
          and want to improve it. We introduced Documentation Days,
          because working on documentation in parallel with like
          minded-people, is just more fun than working alone! Everybody
          who can contribute is welcome to join! <br>
          <br>
          For a list of items that need work, check out the community
          maintained TODO list (<a class="moz-txt-link-freetext"
            href="http://wiki.xen.org/wiki/Xen_Document_Days/TODO">http://wiki.xen.org/wiki/Xen_Document_Days/TODO</a>).


          Of course, you can work on anything you like: the list just
          provides suggestions. <br>
          <br>
          How do I participate? <br>
          ===================== <br>
          <br>
          - Join us on IRC: freenode channel #xendocs <br>
          - Tell people what you intend to work on (to avoid doing
          something somebody <br>
          &nbsp; else is already working on) <br>
          - Fix some documentation <br>
          - Help others <br>
          - And above all: have fun! <br>
        </div>
      </div>
    </div>
  </body>
</html>

--------------070209000901070603030909--


--===============3647616402371648436==
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.xen.org
http://lists.xen.org/xen-devel

--===============3647616402371648436==--


From xen-devel-bounces@lists.xen.org Thu Nov 22 17:10:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 17:10:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbaIF-0001No-BA; Thu, 22 Nov 2012 17:10:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TbaID-0001NU-OP
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 17:10:26 +0000
Received: from [85.158.139.83:4991] by server-11.bemta-5.messagelabs.com id
	F9/57-03409-18C5EA05; Thu, 22 Nov 2012 17:10:25 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1353604222!30778306!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20446 invoked from network); 22 Nov 2012 17:10:23 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 17:10:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="215289352"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 17:10:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 12:10:22 -0500
Received: from whitby.uk.xensource.com ([10.80.2.60])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<tim@xen.org>) id 1TbaI9-0000B3-PY	for xen-devel@lists.xen.org;
	Thu, 22 Nov 2012 17:10:21 +0000
Received: from tdeegan by whitby.uk.xensource.com with local (Exim 4.76)
	(envelope-from <tim@xen.org>)	id 1TbaI9-0001cv-IY	for
	xen-devel@lists.xen.org; Thu, 22 Nov 2012 17:10:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 3ea68d29fd57988d7788450f25ad0cd84cbd2fb4
Message-ID: <3ea68d29fd57988d7788.1353604221@whitby.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.0.1
Date: Thu, 22 Nov 2012 17:10:21 +0000
From: Tim Deegan <tim@xen.org>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] x86/mm: Comment the definitions of _mfn(),
	_gfn() &c
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1353604092 0
# Node ID 3ea68d29fd57988d7788450f25ad0cd84cbd2fb4
# Parent  7b4449bdb980caee8efc498d5ea48f772331df2f
x86/mm: Comment the definitions of _mfn(), _gfn() &c.

It's not very easy to find them if you don't know to look for the
TYPE_SAFE() macro.

Signed-off-by: Tim Deegan <tim@xen.org>

diff -r 7b4449bdb980 -r 3ea68d29fd57 xen/include/asm-x86/guest_pt.h
--- a/xen/include/asm-x86/guest_pt.h	Thu Nov 22 10:47:58 2012 +0100
+++ b/xen/include/asm-x86/guest_pt.h	Thu Nov 22 17:08:12 2012 +0000
@@ -36,6 +36,7 @@
 /* Type of the guest's frame numbers */
 TYPE_SAFE(unsigned long,gfn)
 #define PRI_gfn "05lx"
+/* Grep fodder: gfn_t, _gfn() and gfn_x() are defined here */
 
 #define VALID_GFN(m) (m != INVALID_GFN)
 
diff -r 7b4449bdb980 -r 3ea68d29fd57 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Thu Nov 22 10:47:58 2012 +0100
+++ b/xen/include/asm-x86/mm.h	Thu Nov 22 17:08:12 2012 +0000
@@ -455,6 +455,7 @@ static inline _type _name##_x(_name##_t 
 #endif
 
 TYPE_SAFE(unsigned long,mfn);
+/* Grep fodder: mfn_t, _mfn() and mfn_x() are defined here */
 
 /* Macro for printk formats: use as printk("%"PRI_mfn"\n", mfn_x(foo)); */
 #define PRI_mfn "05lx"

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 17:10:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 17:10:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbaIF-0001No-BA; Thu, 22 Nov 2012 17:10:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TbaID-0001NU-OP
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 17:10:26 +0000
Received: from [85.158.139.83:4991] by server-11.bemta-5.messagelabs.com id
	F9/57-03409-18C5EA05; Thu, 22 Nov 2012 17:10:25 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1353604222!30778306!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20446 invoked from network); 22 Nov 2012 17:10:23 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 17:10:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,301,1352073600"; d="scan'208";a="215289352"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 17:10:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 12:10:22 -0500
Received: from whitby.uk.xensource.com ([10.80.2.60])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<tim@xen.org>) id 1TbaI9-0000B3-PY	for xen-devel@lists.xen.org;
	Thu, 22 Nov 2012 17:10:21 +0000
Received: from tdeegan by whitby.uk.xensource.com with local (Exim 4.76)
	(envelope-from <tim@xen.org>)	id 1TbaI9-0001cv-IY	for
	xen-devel@lists.xen.org; Thu, 22 Nov 2012 17:10:21 +0000
MIME-Version: 1.0
X-Mercurial-Node: 3ea68d29fd57988d7788450f25ad0cd84cbd2fb4
Message-ID: <3ea68d29fd57988d7788.1353604221@whitby.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.0.1
Date: Thu, 22 Nov 2012 17:10:21 +0000
From: Tim Deegan <tim@xen.org>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] x86/mm: Comment the definitions of _mfn(),
	_gfn() &c
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1353604092 0
# Node ID 3ea68d29fd57988d7788450f25ad0cd84cbd2fb4
# Parent  7b4449bdb980caee8efc498d5ea48f772331df2f
x86/mm: Comment the definitions of _mfn(), _gfn() &c.

It's not very easy to find them if you don't know to look for the
TYPE_SAFE() macro.

Signed-off-by: Tim Deegan <tim@xen.org>

diff -r 7b4449bdb980 -r 3ea68d29fd57 xen/include/asm-x86/guest_pt.h
--- a/xen/include/asm-x86/guest_pt.h	Thu Nov 22 10:47:58 2012 +0100
+++ b/xen/include/asm-x86/guest_pt.h	Thu Nov 22 17:08:12 2012 +0000
@@ -36,6 +36,7 @@
 /* Type of the guest's frame numbers */
 TYPE_SAFE(unsigned long,gfn)
 #define PRI_gfn "05lx"
+/* Grep fodder: gfn_t, _gfn() and gfn_x() are defined here */
 
 #define VALID_GFN(m) (m != INVALID_GFN)
 
diff -r 7b4449bdb980 -r 3ea68d29fd57 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Thu Nov 22 10:47:58 2012 +0100
+++ b/xen/include/asm-x86/mm.h	Thu Nov 22 17:08:12 2012 +0000
@@ -455,6 +455,7 @@ static inline _type _name##_x(_name##_t 
 #endif
 
 TYPE_SAFE(unsigned long,mfn);
+/* Grep fodder: mfn_t, _mfn() and mfn_x() are defined here */
 
 /* Macro for printk formats: use as printk("%"PRI_mfn"\n", mfn_x(foo)); */
 #define PRI_mfn "05lx"

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 17:17:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 17:17:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbaOb-0001pg-8D; Thu, 22 Nov 2012 17:17:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TbaOZ-0001pX-Rr
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 17:17:00 +0000
Received: from [85.158.137.99:29728] by server-14.bemta-3.messagelabs.com id
	81/09-12788-60E5EA05; Thu, 22 Nov 2012 17:16:54 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1353604612!15472313!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20573 invoked from network); 22 Nov 2012 17:16:53 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 17:16:53 -0000
X-IronPort-AV: E=Sophos;i="4.83,302,1352073600"; d="scan'208";a="215289647"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 17:16:51 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 12:16:51 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TbaOQ-0000HN-R0;
	Thu, 22 Nov 2012 17:16:50 +0000
Date: Thu, 22 Nov 2012 17:16:10 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Tim Deegan <tim@xen.org>
In-Reply-To: <ffc59d2fc9980c660941.1353601059@whitby.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211221715570.13749@kaball.uk.xensource.com>
References: <ffc59d2fc9980c660941.1353601059@whitby.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] arm: Tidy up flush_xen_dcache()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 22 Nov 2012, Tim Deegan wrote:
> # HG changeset patch
> # User Tim Deegan <tim@xen.org>
> # Date 1353600936 0
> # Node ID ffc59d2fc9980c660941eb24cbe827c1142d1fd0
> # Parent  7b4449bdb980caee8efc498d5ea48f772331df2f
> arm: Tidy up flush_xen_dcache().
> 
>  - Use a compile-time-constant check for whether we can safely flush
>    just one cacheline.  This reduces the common case from 28
>    instructions to three.
>  - Pass an object to the macro, not a pointer, so we can detect
>    attempts to flush arrays.
>  - Decode CCSIDR correctly to get cacheline size.
>  - Remove some redundant DSBs at the call sites.
> 
> Signed-off-by: Tim Deegan <tim@xen.org>

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


> diff -r 7b4449bdb980 -r ffc59d2fc998 xen/arch/arm/mm.c
> --- a/xen/arch/arm/mm.c	Thu Nov 22 10:47:58 2012 +0100
> +++ b/xen/arch/arm/mm.c	Thu Nov 22 16:15:36 2012 +0000
> @@ -247,7 +247,7 @@ void __init setup_pagetables(unsigned lo
>  
>      /* Change pagetables to the copy in the relocated Xen */
>      boot_httbr = (unsigned long) xen_pgtable + phys_offset;
> -    flush_xen_dcache_va(&boot_httbr);
> +    flush_xen_dcache(boot_httbr);
>      flush_xen_dcache_va_range((void*)dest_va, _end - _start);
>      flush_xen_text_tlb();
>  
> diff -r 7b4449bdb980 -r ffc59d2fc998 xen/arch/arm/setup.c
> --- a/xen/arch/arm/setup.c	Thu Nov 22 10:47:58 2012 +0100
> +++ b/xen/arch/arm/setup.c	Thu Nov 22 16:15:36 2012 +0000
> @@ -175,6 +175,21 @@ static void __init setup_mm(unsigned lon
>      end_boot_allocator();
>  }
>  
> +size_t __read_mostly cacheline_bytes;
> +
> +/* Very early check of the CPU cache properties */
> +void __init setup_cache(void)
> +{
> +    uint32_t ccsid;
> +
> +    /* Read the cache size ID register for the level-0 data cache */
> +    WRITE_CP32(0, CSSELR);
> +    ccsid = READ_CP32(CCSIDR);
> +
> +    /* Low 3 bits are log2(cacheline size in words) - 2. */
> +    cacheline_bytes = 1U << (4 + (ccsid & 0x7));
> +}
> +
>  /* C entry point for boot CPU */
>  void __init start_xen(unsigned long boot_phys_offset,
>                        unsigned long arm_type,
> @@ -185,6 +200,8 @@ void __init start_xen(unsigned long boot
>      size_t fdt_size;
>      int cpus, i;
>  
> +    setup_cache();
> +
>      smp_clear_cpu_maps();
>  
>      fdt = (void *)BOOT_MISC_VIRT_START
> diff -r 7b4449bdb980 -r ffc59d2fc998 xen/arch/arm/smpboot.c
> --- a/xen/arch/arm/smpboot.c	Thu Nov 22 10:47:58 2012 +0100
> +++ b/xen/arch/arm/smpboot.c	Thu Nov 22 16:15:36 2012 +0000
> @@ -118,8 +118,8 @@ make_cpus_ready(unsigned int max_cpus, u
>          /* Tell the next CPU to get ready */
>          /* TODO: handle boards where CPUIDs are not contiguous */
>          *gate = i;
> -        flush_xen_dcache_va(gate);
> -        asm volatile("dsb; isb; sev");
> +        flush_xen_dcache(*gate);
> +        asm volatile("isb; sev");
>          /* And wait for it to respond */
>          while ( ready_cpus < i )
>              smp_rmb();
> @@ -217,8 +217,8 @@ int __cpu_up(unsigned int cpu)
>      smp_up_cpu = cpu;
>      /* we need to make sure that the change to smp_up_cpu is visible to
>       * secondary cpus with D-cache off */
> -    flush_xen_dcache_va(&smp_up_cpu);
> -    asm volatile("dsb; isb; sev");
> +    flush_xen_dcache(smp_up_cpu);
> +    asm volatile("isb; sev");
>  
>      while ( !cpu_online(cpu) )
>      {
> diff -r 7b4449bdb980 -r ffc59d2fc998 xen/include/asm-arm/page.h
> --- a/xen/include/asm-arm/page.h	Thu Nov 22 10:47:58 2012 +0100
> +++ b/xen/include/asm-arm/page.h	Thu Nov 22 16:15:36 2012 +0000
> @@ -248,13 +248,16 @@ static inline void write_pte(lpae_t *p, 
>          : : "r" (pte.bits), "r" (p) : "memory");
>  }
>  
> +/* Architectural minimum cacheline size is 4 32-bit words. */
> +#define MIN_CACHELINE_BYTES 16
> +/* Actual cacheline size on the boot CPU. */
> +extern size_t cacheline_bytes;
>  
>  /* Function for flushing medium-sized areas.
>   * if 'range' is large enough we might want to use model-specific
>   * full-cache flushes. */
>  static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
>  {
> -    int cacheline_bytes  = READ_CP32(CCSIDR);
>      void *end;
>      dsb();           /* So the CPU issues all writes to the range */
>      for ( end = p + size; p < end; p += cacheline_bytes )
> @@ -262,17 +265,13 @@ static inline void flush_xen_dcache_va_r
>      dsb();           /* So we know the flushes happen before continuing */
>  }
>  
> -
>  /* Macro for flushing a single small item.  The predicate is always
>   * compile-time constant so this will compile down to 3 instructions in
> - * the common case.  Make sure to call it with the correct type of
> - * pointer! */
> -#define flush_xen_dcache_va(p) do {                                     \
> -    int cacheline_bytes  = READ_CP32(CCSIDR);                           \
> -    typeof(p) _p = (p);                                                 \
> -    if ( ((unsigned long)_p & ~(cacheline_bytes - 1)) !=                \
> -        (((unsigned long)_p + (sizeof *_p)) & ~(cacheline_bytes - 1)) ) \
> -        flush_xen_dcache_va_range(_p, sizeof *_p);                      \
> + * the common case. */
> +#define flush_xen_dcache(x) do {                                        \
> +    typeof(x) *_p = &(x);                                               \
> +    if ( sizeof(x) > MIN_CACHELINE_BYTES || sizeof(x) > alignof(x) )    \
> +        flush_xen_dcache_va_range(_p, sizeof(x));                       \
>      else                                                                \
>          asm volatile (                                                  \
>              "dsb;"   /* Finish all earlier writes */                    \
> diff -r 7b4449bdb980 -r ffc59d2fc998 xen/include/xen/compiler.h
> --- a/xen/include/xen/compiler.h	Thu Nov 22 10:47:58 2012 +0100
> +++ b/xen/include/xen/compiler.h	Thu Nov 22 16:15:36 2012 +0000
> @@ -54,6 +54,10 @@
>  
>  #define offsetof(a,b) __builtin_offsetof(a,b)
>  
> +#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L
> +#define alignof __alignof__
> +#endif
> +
>  /* &a[0] degrades to a pointer: a different type from an array */
>  #define __must_be_array(a) \
>    BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 17:17:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 17:17:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbaOb-0001pg-8D; Thu, 22 Nov 2012 17:17:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TbaOZ-0001pX-Rr
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 17:17:00 +0000
Received: from [85.158.137.99:29728] by server-14.bemta-3.messagelabs.com id
	81/09-12788-60E5EA05; Thu, 22 Nov 2012 17:16:54 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1353604612!15472313!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20573 invoked from network); 22 Nov 2012 17:16:53 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 17:16:53 -0000
X-IronPort-AV: E=Sophos;i="4.83,302,1352073600"; d="scan'208";a="215289647"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 17:16:51 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 12:16:51 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TbaOQ-0000HN-R0;
	Thu, 22 Nov 2012 17:16:50 +0000
Date: Thu, 22 Nov 2012 17:16:10 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Tim Deegan <tim@xen.org>
In-Reply-To: <ffc59d2fc9980c660941.1353601059@whitby.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211221715570.13749@kaball.uk.xensource.com>
References: <ffc59d2fc9980c660941.1353601059@whitby.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] arm: Tidy up flush_xen_dcache()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 22 Nov 2012, Tim Deegan wrote:
> # HG changeset patch
> # User Tim Deegan <tim@xen.org>
> # Date 1353600936 0
> # Node ID ffc59d2fc9980c660941eb24cbe827c1142d1fd0
> # Parent  7b4449bdb980caee8efc498d5ea48f772331df2f
> arm: Tidy up flush_xen_dcache().
> 
>  - Use a compile-time-constant check for whether we can safely flush
>    just one cacheline.  This reduces the common case from 28
>    instructions to three.
>  - Pass an object to the macro, not a pointer, so we can detect
>    attempts to flush arrays.
>  - Decode CCSIDR correctly to get cacheline size.
>  - Remove some redundant DSBs at the call sites.
> 
> Signed-off-by: Tim Deegan <tim@xen.org>

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


> diff -r 7b4449bdb980 -r ffc59d2fc998 xen/arch/arm/mm.c
> --- a/xen/arch/arm/mm.c	Thu Nov 22 10:47:58 2012 +0100
> +++ b/xen/arch/arm/mm.c	Thu Nov 22 16:15:36 2012 +0000
> @@ -247,7 +247,7 @@ void __init setup_pagetables(unsigned lo
>  
>      /* Change pagetables to the copy in the relocated Xen */
>      boot_httbr = (unsigned long) xen_pgtable + phys_offset;
> -    flush_xen_dcache_va(&boot_httbr);
> +    flush_xen_dcache(boot_httbr);
>      flush_xen_dcache_va_range((void*)dest_va, _end - _start);
>      flush_xen_text_tlb();
>  
> diff -r 7b4449bdb980 -r ffc59d2fc998 xen/arch/arm/setup.c
> --- a/xen/arch/arm/setup.c	Thu Nov 22 10:47:58 2012 +0100
> +++ b/xen/arch/arm/setup.c	Thu Nov 22 16:15:36 2012 +0000
> @@ -175,6 +175,21 @@ static void __init setup_mm(unsigned lon
>      end_boot_allocator();
>  }
>  
> +size_t __read_mostly cacheline_bytes;
> +
> +/* Very early check of the CPU cache properties */
> +void __init setup_cache(void)
> +{
> +    uint32_t ccsid;
> +
> +    /* Read the cache size ID register for the level-0 data cache */
> +    WRITE_CP32(0, CSSELR);
> +    ccsid = READ_CP32(CCSIDR);
> +
> +    /* Low 3 bits are log2(cacheline size in words) - 2. */
> +    cacheline_bytes = 1U << (4 + (ccsid & 0x7));
> +}
> +
>  /* C entry point for boot CPU */
>  void __init start_xen(unsigned long boot_phys_offset,
>                        unsigned long arm_type,
> @@ -185,6 +200,8 @@ void __init start_xen(unsigned long boot
>      size_t fdt_size;
>      int cpus, i;
>  
> +    setup_cache();
> +
>      smp_clear_cpu_maps();
>  
>      fdt = (void *)BOOT_MISC_VIRT_START
> diff -r 7b4449bdb980 -r ffc59d2fc998 xen/arch/arm/smpboot.c
> --- a/xen/arch/arm/smpboot.c	Thu Nov 22 10:47:58 2012 +0100
> +++ b/xen/arch/arm/smpboot.c	Thu Nov 22 16:15:36 2012 +0000
> @@ -118,8 +118,8 @@ make_cpus_ready(unsigned int max_cpus, u
>          /* Tell the next CPU to get ready */
>          /* TODO: handle boards where CPUIDs are not contiguous */
>          *gate = i;
> -        flush_xen_dcache_va(gate);
> -        asm volatile("dsb; isb; sev");
> +        flush_xen_dcache(*gate);
> +        asm volatile("isb; sev");
>          /* And wait for it to respond */
>          while ( ready_cpus < i )
>              smp_rmb();
> @@ -217,8 +217,8 @@ int __cpu_up(unsigned int cpu)
>      smp_up_cpu = cpu;
>      /* we need to make sure that the change to smp_up_cpu is visible to
>       * secondary cpus with D-cache off */
> -    flush_xen_dcache_va(&smp_up_cpu);
> -    asm volatile("dsb; isb; sev");
> +    flush_xen_dcache(smp_up_cpu);
> +    asm volatile("isb; sev");
>  
>      while ( !cpu_online(cpu) )
>      {
> diff -r 7b4449bdb980 -r ffc59d2fc998 xen/include/asm-arm/page.h
> --- a/xen/include/asm-arm/page.h	Thu Nov 22 10:47:58 2012 +0100
> +++ b/xen/include/asm-arm/page.h	Thu Nov 22 16:15:36 2012 +0000
> @@ -248,13 +248,16 @@ static inline void write_pte(lpae_t *p, 
>          : : "r" (pte.bits), "r" (p) : "memory");
>  }
>  
> +/* Architectural minimum cacheline size is 4 32-bit words. */
> +#define MIN_CACHELINE_BYTES 16
> +/* Actual cacheline size on the boot CPU. */
> +extern size_t cacheline_bytes;
>  
>  /* Function for flushing medium-sized areas.
>   * if 'range' is large enough we might want to use model-specific
>   * full-cache flushes. */
>  static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
>  {
> -    int cacheline_bytes  = READ_CP32(CCSIDR);
>      void *end;
>      dsb();           /* So the CPU issues all writes to the range */
>      for ( end = p + size; p < end; p += cacheline_bytes )
> @@ -262,17 +265,13 @@ static inline void flush_xen_dcache_va_r
>      dsb();           /* So we know the flushes happen before continuing */
>  }
>  
> -
>  /* Macro for flushing a single small item.  The predicate is always
>   * compile-time constant so this will compile down to 3 instructions in
> - * the common case.  Make sure to call it with the correct type of
> - * pointer! */
> -#define flush_xen_dcache_va(p) do {                                     \
> -    int cacheline_bytes  = READ_CP32(CCSIDR);                           \
> -    typeof(p) _p = (p);                                                 \
> -    if ( ((unsigned long)_p & ~(cacheline_bytes - 1)) !=                \
> -        (((unsigned long)_p + (sizeof *_p)) & ~(cacheline_bytes - 1)) ) \
> -        flush_xen_dcache_va_range(_p, sizeof *_p);                      \
> + * the common case. */
> +#define flush_xen_dcache(x) do {                                        \
> +    typeof(x) *_p = &(x);                                               \
> +    if ( sizeof(x) > MIN_CACHELINE_BYTES || sizeof(x) > alignof(x) )    \
> +        flush_xen_dcache_va_range(_p, sizeof(x));                       \
>      else                                                                \
>          asm volatile (                                                  \
>              "dsb;"   /* Finish all earlier writes */                    \
> diff -r 7b4449bdb980 -r ffc59d2fc998 xen/include/xen/compiler.h
> --- a/xen/include/xen/compiler.h	Thu Nov 22 10:47:58 2012 +0100
> +++ b/xen/include/xen/compiler.h	Thu Nov 22 16:15:36 2012 +0000
> @@ -54,6 +54,10 @@
>  
>  #define offsetof(a,b) __builtin_offsetof(a,b)
>  
> +#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L
> +#define alignof __alignof__
> +#endif
> +
>  /* &a[0] degrades to a pointer: a different type from an array */
>  #define __must_be_array(a) \
>    BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 17:17:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 17:17:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbaP8-0001sm-O0; Thu, 22 Nov 2012 17:17:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbaP6-0001sY-O6
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 17:17:32 +0000
Received: from [85.158.138.51:32607] by server-15.bemta-3.messagelabs.com id
	C1/A0-09445-72E5EA05; Thu, 22 Nov 2012 17:17:27 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353604625!29193706!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26883 invoked from network); 22 Nov 2012 17:17:07 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 17:17:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,302,1352073600"; d="scan'208";a="45413746"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 17:17:04 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 12:17:04 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbaOd-0000HT-Sk;
	Thu, 22 Nov 2012 17:17:03 +0000
Message-ID: <50AE5E0F.8070405@citrix.com>
Date: Thu, 22 Nov 2012 17:17:03 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <3ea68d29fd57988d7788.1353604221@whitby.uk.xensource.com>
In-Reply-To: <3ea68d29fd57988d7788.1353604221@whitby.uk.xensource.com>
X-Enigmail-Version: 1.4.6
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/mm: Comment the definitions of _mfn(),
 _gfn() &c
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/12 17:10, Tim Deegan wrote:
> # HG changeset patch
> # User Tim Deegan <tim@xen.org>
> # Date 1353604092 0
> # Node ID 3ea68d29fd57988d7788450f25ad0cd84cbd2fb4
> # Parent  7b4449bdb980caee8efc498d5ea48f772331df2f
> x86/mm: Comment the definitions of _mfn(), _gfn() &c.
>
> It's not very easy to find them if you don't know to look for the
> TYPE_SAFE() macro.

Ah - fantastic.  I have certainly spent longer than was sensible looking
for these definitions.

Would it be possible/sensible to a quick

#ifndef gfn_t
#define gfn_t /* gfn_t defined around here */
#undef gfn_t
#endif

So the likes of cscope and tags will also pick them up?

~Andrew

>
> Signed-off-by: Tim Deegan <tim@xen.org>
>
> diff -r 7b4449bdb980 -r 3ea68d29fd57 xen/include/asm-x86/guest_pt.h
> --- a/xen/include/asm-x86/guest_pt.h	Thu Nov 22 10:47:58 2012 +0100
> +++ b/xen/include/asm-x86/guest_pt.h	Thu Nov 22 17:08:12 2012 +0000
> @@ -36,6 +36,7 @@
>  /* Type of the guest's frame numbers */
>  TYPE_SAFE(unsigned long,gfn)
>  #define PRI_gfn "05lx"
> +/* Grep fodder: gfn_t, _gfn() and gfn_x() are defined here */
>  
>  #define VALID_GFN(m) (m != INVALID_GFN)
>  
> diff -r 7b4449bdb980 -r 3ea68d29fd57 xen/include/asm-x86/mm.h
> --- a/xen/include/asm-x86/mm.h	Thu Nov 22 10:47:58 2012 +0100
> +++ b/xen/include/asm-x86/mm.h	Thu Nov 22 17:08:12 2012 +0000
> @@ -455,6 +455,7 @@ static inline _type _name##_x(_name##_t 
>  #endif
>  
>  TYPE_SAFE(unsigned long,mfn);
> +/* Grep fodder: mfn_t, _mfn() and mfn_x() are defined here */
>  
>  /* Macro for printk formats: use as printk("%"PRI_mfn"\n", mfn_x(foo)); */
>  #define PRI_mfn "05lx"
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 17:17:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 17:17:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbaP8-0001sm-O0; Thu, 22 Nov 2012 17:17:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbaP6-0001sY-O6
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 17:17:32 +0000
Received: from [85.158.138.51:32607] by server-15.bemta-3.messagelabs.com id
	C1/A0-09445-72E5EA05; Thu, 22 Nov 2012 17:17:27 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1353604625!29193706!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26883 invoked from network); 22 Nov 2012 17:17:07 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 17:17:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,302,1352073600"; d="scan'208";a="45413746"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 17:17:04 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 12:17:04 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbaOd-0000HT-Sk;
	Thu, 22 Nov 2012 17:17:03 +0000
Message-ID: <50AE5E0F.8070405@citrix.com>
Date: Thu, 22 Nov 2012 17:17:03 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <3ea68d29fd57988d7788.1353604221@whitby.uk.xensource.com>
In-Reply-To: <3ea68d29fd57988d7788.1353604221@whitby.uk.xensource.com>
X-Enigmail-Version: 1.4.6
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/mm: Comment the definitions of _mfn(),
 _gfn() &c
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/12 17:10, Tim Deegan wrote:
> # HG changeset patch
> # User Tim Deegan <tim@xen.org>
> # Date 1353604092 0
> # Node ID 3ea68d29fd57988d7788450f25ad0cd84cbd2fb4
> # Parent  7b4449bdb980caee8efc498d5ea48f772331df2f
> x86/mm: Comment the definitions of _mfn(), _gfn() &c.
>
> It's not very easy to find them if you don't know to look for the
> TYPE_SAFE() macro.

Ah - fantastic.  I have certainly spent longer than was sensible looking
for these definitions.

Would it be possible/sensible to a quick

#ifndef gfn_t
#define gfn_t /* gfn_t defined around here */
#undef gfn_t
#endif

So the likes of cscope and tags will also pick them up?

~Andrew

>
> Signed-off-by: Tim Deegan <tim@xen.org>
>
> diff -r 7b4449bdb980 -r 3ea68d29fd57 xen/include/asm-x86/guest_pt.h
> --- a/xen/include/asm-x86/guest_pt.h	Thu Nov 22 10:47:58 2012 +0100
> +++ b/xen/include/asm-x86/guest_pt.h	Thu Nov 22 17:08:12 2012 +0000
> @@ -36,6 +36,7 @@
>  /* Type of the guest's frame numbers */
>  TYPE_SAFE(unsigned long,gfn)
>  #define PRI_gfn "05lx"
> +/* Grep fodder: gfn_t, _gfn() and gfn_x() are defined here */
>  
>  #define VALID_GFN(m) (m != INVALID_GFN)
>  
> diff -r 7b4449bdb980 -r 3ea68d29fd57 xen/include/asm-x86/mm.h
> --- a/xen/include/asm-x86/mm.h	Thu Nov 22 10:47:58 2012 +0100
> +++ b/xen/include/asm-x86/mm.h	Thu Nov 22 17:08:12 2012 +0000
> @@ -455,6 +455,7 @@ static inline _type _name##_x(_name##_t 
>  #endif
>  
>  TYPE_SAFE(unsigned long,mfn);
> +/* Grep fodder: mfn_t, _mfn() and mfn_x() are defined here */
>  
>  /* Macro for printk formats: use as printk("%"PRI_mfn"\n", mfn_x(foo)); */
>  #define PRI_mfn "05lx"
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 17:34:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 17:34:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbafB-0002T5-G8; Thu, 22 Nov 2012 17:34:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TbafA-0002T0-5z
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 17:34:08 +0000
Received: from [85.158.143.99:35539] by server-1.bemta-4.messagelabs.com id
	52/FF-27934-F026EA05; Thu, 22 Nov 2012 17:34:07 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353605646!23969803!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17237 invoked from network); 22 Nov 2012 17:34:07 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 22 Nov 2012 17:34:07 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Tbaf6-000Mct-QE; Thu, 22 Nov 2012 17:34:04 +0000
Date: Thu, 22 Nov 2012 17:34:04 +0000
From: Tim Deegan <tim@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121122173404.GC83155@ocelot.phlegethon.org>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	George Dunlap <George.Dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
	handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 15:00 +0000 on 22 Nov (1353596446), Andrew Cooper wrote:
> diff -r 2489c2926698 -r d7ea938044ac xen/arch/x86/hvm/vmx/vmx.c
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>          vector = intr_info & INTR_INFO_VECTOR_MASK;
>          if ( vector == TRAP_machine_check )
>              do_machine_check(regs);
> +        else if ( vector == TRAP_nmi &&
> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
> +                  (X86_EVENTTYPE_NMI << 8) ) )
> +            /* Must be called before interrupts are enabled to ensure
> +             * the NMI handler code is run before the first IRET. The
> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
> +             */
> +            do_nmi();
>          break;
>      case EXIT_REASON_MCE_DURING_VMENTRY:
>          do_machine_check(regs);

I think it might also make sense to move the HVMTARCE invocations that
are just above here down to after this block.  There's quite a lot of
code behind there and though I don't see any potential faults they might
well get added later (including in places like printk() and
tasklet_schedule()).

I had a look at the rest of the code that runs between the vmexit and
here, and it looks OK to me.

George, would that make the tracing more confusing?

Tim.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 17:34:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 17:34:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbafB-0002T5-G8; Thu, 22 Nov 2012 17:34:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TbafA-0002T0-5z
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 17:34:08 +0000
Received: from [85.158.143.99:35539] by server-1.bemta-4.messagelabs.com id
	52/FF-27934-F026EA05; Thu, 22 Nov 2012 17:34:07 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353605646!23969803!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17237 invoked from network); 22 Nov 2012 17:34:07 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 22 Nov 2012 17:34:07 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Tbaf6-000Mct-QE; Thu, 22 Nov 2012 17:34:04 +0000
Date: Thu, 22 Nov 2012 17:34:04 +0000
From: Tim Deegan <tim@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121122173404.GC83155@ocelot.phlegethon.org>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	George Dunlap <George.Dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
	handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 15:00 +0000 on 22 Nov (1353596446), Andrew Cooper wrote:
> diff -r 2489c2926698 -r d7ea938044ac xen/arch/x86/hvm/vmx/vmx.c
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>          vector = intr_info & INTR_INFO_VECTOR_MASK;
>          if ( vector == TRAP_machine_check )
>              do_machine_check(regs);
> +        else if ( vector == TRAP_nmi &&
> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
> +                  (X86_EVENTTYPE_NMI << 8) ) )
> +            /* Must be called before interrupts are enabled to ensure
> +             * the NMI handler code is run before the first IRET. The
> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
> +             */
> +            do_nmi();
>          break;
>      case EXIT_REASON_MCE_DURING_VMENTRY:
>          do_machine_check(regs);

I think it might also make sense to move the HVMTARCE invocations that
are just above here down to after this block.  There's quite a lot of
code behind there and though I don't see any potential faults they might
well get added later (including in places like printk() and
tasklet_schedule()).

I had a look at the rest of the code that runs between the vmexit and
here, and it looks OK to me.

George, would that make the tracing more confusing?

Tim.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 17:38:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 17:38:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbajI-0002aJ-7a; Thu, 22 Nov 2012 17:38:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <hpa@zytor.com>) id 1TbajH-0002aD-7A
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 17:38:23 +0000
Received: from [85.158.139.83:60227] by server-6.bemta-5.messagelabs.com id
	64/B4-19321-E036EA05; Thu, 22 Nov 2012 17:38:22 +0000
X-Env-Sender: hpa@zytor.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1353605900!31479365!1
X-Originating-IP: [198.137.202.10]
X-SpamReason: No, hits=2.0 required=7.0 tests=BODY_FWORD,
  BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30485 invoked from network); 22 Nov 2012 17:38:21 -0000
Received: from terminus.zytor.com (HELO mail.zytor.com) (198.137.202.10)
	by server-12.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 22 Nov 2012 17:38:21 -0000
Received: from tazenda.hos.anvin.org (c-67-161-22-173.hsd1.ca.comcast.net
	[67.161.22.173]) (authenticated bits=0)
	by mail.zytor.com (8.14.5/8.14.5) with ESMTP id qAMHbkMi003361
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Thu, 22 Nov 2012 09:37:46 -0800
Message-ID: <50AE62E9.3000602@zytor.com>
Date: Thu, 22 Nov 2012 09:37:45 -0800
From: "H. Peter Anvin" <hpa@zytor.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: "Eric W. Biederman" <ebiederm@xmission.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com>
In-Reply-To: <87txshx28b.fsf@xmission.com>
Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com,
	Daniel Kiper <daniel.kiper@oracle.com>, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	jbeulich@suse.com, tglx@linutronix.de
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/22/2012 04:15 AM, Eric W. Biederman wrote:
>
> Let me be clear.  kexec_ops as you have implemented it is absolutely
> unacceptable.
>
> Your kexec_ops is not an abstraction but a hack that enshrines in stone
> implementation details.
>

This is the kind of stuff that is absolutely endemic to the Xen 
endeavour, and which is why Xen is such a disease.  The design principle 
seems to have been "hey, let's go and replace random Linux kernel 
internals with our own stuff, and make them ABIs, so that they can never 
change.  Oh, and let's not bother documenting the constraints we're 
imposing, that might make the code manageable."

I actually talked to Ian Jackson at LCE, and mentioned among other 
things the bogosity of requiring a PUD page for three-level paging in 
Linux -- a bogosity which has spread from Xen into native.  It's a page 
wasted for no good reason, since it only contains 32 bytes worth of 
data, *inherently*.  Furthermore, contrary to popular belief, it is 
*not* pa page table per se.

Ian told me: "I didn't know we did that, and we shouldn't have to." 
Here we have suffered this overhead for at least six years, because *XEN 
FUCKED UP AND NOONE ELSE HAD ANY WAY OF KNOWING THAT*.

Now we know that it can "maybe"(!!!) be fixed, if we are willing to 
spend time working on a dying platform, whereas we have already suffered 
the damage during the height of its importance.

	-hpa


-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 17:38:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 17:38:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbajI-0002aJ-7a; Thu, 22 Nov 2012 17:38:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <hpa@zytor.com>) id 1TbajH-0002aD-7A
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 17:38:23 +0000
Received: from [85.158.139.83:60227] by server-6.bemta-5.messagelabs.com id
	64/B4-19321-E036EA05; Thu, 22 Nov 2012 17:38:22 +0000
X-Env-Sender: hpa@zytor.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1353605900!31479365!1
X-Originating-IP: [198.137.202.10]
X-SpamReason: No, hits=2.0 required=7.0 tests=BODY_FWORD,
  BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30485 invoked from network); 22 Nov 2012 17:38:21 -0000
Received: from terminus.zytor.com (HELO mail.zytor.com) (198.137.202.10)
	by server-12.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 22 Nov 2012 17:38:21 -0000
Received: from tazenda.hos.anvin.org (c-67-161-22-173.hsd1.ca.comcast.net
	[67.161.22.173]) (authenticated bits=0)
	by mail.zytor.com (8.14.5/8.14.5) with ESMTP id qAMHbkMi003361
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Thu, 22 Nov 2012 09:37:46 -0800
Message-ID: <50AE62E9.3000602@zytor.com>
Date: Thu, 22 Nov 2012 09:37:45 -0800
From: "H. Peter Anvin" <hpa@zytor.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: "Eric W. Biederman" <ebiederm@xmission.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com>
In-Reply-To: <87txshx28b.fsf@xmission.com>
Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com,
	Daniel Kiper <daniel.kiper@oracle.com>, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	jbeulich@suse.com, tglx@linutronix.de
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/22/2012 04:15 AM, Eric W. Biederman wrote:
>
> Let me be clear.  kexec_ops as you have implemented it is absolutely
> unacceptable.
>
> Your kexec_ops is not an abstraction but a hack that enshrines in stone
> implementation details.
>

This is the kind of stuff that is absolutely endemic to the Xen 
endeavour, and which is why Xen is such a disease.  The design principle 
seems to have been "hey, let's go and replace random Linux kernel 
internals with our own stuff, and make them ABIs, so that they can never 
change.  Oh, and let's not bother documenting the constraints we're 
imposing, that might make the code manageable."

I actually talked to Ian Jackson at LCE, and mentioned among other 
things the bogosity of requiring a PUD page for three-level paging in 
Linux -- a bogosity which has spread from Xen into native.  It's a page 
wasted for no good reason, since it only contains 32 bytes worth of 
data, *inherently*.  Furthermore, contrary to popular belief, it is 
*not* pa page table per se.

Ian told me: "I didn't know we did that, and we shouldn't have to." 
Here we have suffered this overhead for at least six years, because *XEN 
FUCKED UP AND NOONE ELSE HAD ANY WAY OF KNOWING THAT*.

Now we know that it can "maybe"(!!!) be fixed, if we are willing to 
spend time working on a dying platform, whereas we have already suffered 
the damage during the height of its importance.

	-hpa


-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 17:44:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 17:44:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbap4-0002uM-6u; Thu, 22 Nov 2012 17:44:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Tbap2-0002uE-1O
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 17:44:20 +0000
Received: from [85.158.139.83:28625] by server-4.bemta-5.messagelabs.com id
	50/5B-15011-3746EA05; Thu, 22 Nov 2012 17:44:19 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1353606257!31199347!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23426 invoked from network); 22 Nov 2012 17:44:18 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 17:44:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,302,1352073600"; d="scan'208";a="45414889"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 17:44:17 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 12:44:16 -0500
Received: from whitby.uk.xensource.com ([10.80.2.60])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<tim@xen.org>) id 1Tbaoy-0000fL-FC	for xen-devel@lists.xen.org;
	Thu, 22 Nov 2012 17:44:16 +0000
Received: from tdeegan by whitby.uk.xensource.com with local (Exim 4.76)
	(envelope-from <tim@xen.org>)	id 1Tbaoy-0002vc-7N	for
	xen-devel@lists.xen.org; Thu, 22 Nov 2012 17:44:16 +0000
MIME-Version: 1.0
X-Mercurial-Node: 9b09b379df32cb282aac8c72a553e0862b71502e
Message-ID: <9b09b379df32cb282aac.1353606256@whitby.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.0.1
Date: Thu, 22 Nov 2012 17:44:16 +0000
From: Tim Deegan <tim@xen.org>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH v2] x86/mm: Comment the definitions of _mfn(),
	_gfn() &c
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1353606047 0
# Node ID 9b09b379df32cb282aac8c72a553e0862b71502e
# Parent  7b4449bdb980caee8efc498d5ea48f772331df2f
x86/mm: Comment the definitions of _mfn(), _gfn() &c.

It's not very easy to find them if you don't know to look for the
TYPE_SAFE() macro.

Signed-off-by: Tim Deegan <tim@xen.org>

----
v2: Use a format that will show up in ctags &c.

diff -r 7b4449bdb980 -r 9b09b379df32 xen/include/asm-x86/guest_pt.h
--- a/xen/include/asm-x86/guest_pt.h	Thu Nov 22 10:47:58 2012 +0100
+++ b/xen/include/asm-x86/guest_pt.h	Thu Nov 22 17:40:47 2012 +0000
@@ -37,6 +37,11 @@
 TYPE_SAFE(unsigned long,gfn)
 #define PRI_gfn "05lx"
 
+#ifndef gfn_t
+#define gfn_t /* Grep fodder: gfn_t, _gfn() and gfn_x() are defined above */
+#undef gfn_t
+#endif
+
 #define VALID_GFN(m) (m != INVALID_GFN)
 
 static inline int
diff -r 7b4449bdb980 -r 9b09b379df32 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Thu Nov 22 10:47:58 2012 +0100
+++ b/xen/include/asm-x86/mm.h	Thu Nov 22 17:40:47 2012 +0000
@@ -456,6 +456,11 @@ static inline _type _name##_x(_name##_t 
 
 TYPE_SAFE(unsigned long,mfn);
 
+#ifndef mfn_t
+#define mfn_t /* Grep fodder: mfn_t, _mfn() and mfn_x() are defined above */
+#undef mfn_t
+#endif
+
 /* Macro for printk formats: use as printk("%"PRI_mfn"\n", mfn_x(foo)); */
 #define PRI_mfn "05lx"
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 17:44:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 17:44:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbap4-0002uM-6u; Thu, 22 Nov 2012 17:44:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Tbap2-0002uE-1O
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 17:44:20 +0000
Received: from [85.158.139.83:28625] by server-4.bemta-5.messagelabs.com id
	50/5B-15011-3746EA05; Thu, 22 Nov 2012 17:44:19 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1353606257!31199347!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23426 invoked from network); 22 Nov 2012 17:44:18 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 17:44:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,302,1352073600"; d="scan'208";a="45414889"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 17:44:17 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 12:44:16 -0500
Received: from whitby.uk.xensource.com ([10.80.2.60])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<tim@xen.org>) id 1Tbaoy-0000fL-FC	for xen-devel@lists.xen.org;
	Thu, 22 Nov 2012 17:44:16 +0000
Received: from tdeegan by whitby.uk.xensource.com with local (Exim 4.76)
	(envelope-from <tim@xen.org>)	id 1Tbaoy-0002vc-7N	for
	xen-devel@lists.xen.org; Thu, 22 Nov 2012 17:44:16 +0000
MIME-Version: 1.0
X-Mercurial-Node: 9b09b379df32cb282aac8c72a553e0862b71502e
Message-ID: <9b09b379df32cb282aac.1353606256@whitby.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.0.1
Date: Thu, 22 Nov 2012 17:44:16 +0000
From: Tim Deegan <tim@xen.org>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH v2] x86/mm: Comment the definitions of _mfn(),
	_gfn() &c
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1353606047 0
# Node ID 9b09b379df32cb282aac8c72a553e0862b71502e
# Parent  7b4449bdb980caee8efc498d5ea48f772331df2f
x86/mm: Comment the definitions of _mfn(), _gfn() &c.

It's not very easy to find them if you don't know to look for the
TYPE_SAFE() macro.

Signed-off-by: Tim Deegan <tim@xen.org>

----
v2: Use a format that will show up in ctags &c.

diff -r 7b4449bdb980 -r 9b09b379df32 xen/include/asm-x86/guest_pt.h
--- a/xen/include/asm-x86/guest_pt.h	Thu Nov 22 10:47:58 2012 +0100
+++ b/xen/include/asm-x86/guest_pt.h	Thu Nov 22 17:40:47 2012 +0000
@@ -37,6 +37,11 @@
 TYPE_SAFE(unsigned long,gfn)
 #define PRI_gfn "05lx"
 
+#ifndef gfn_t
+#define gfn_t /* Grep fodder: gfn_t, _gfn() and gfn_x() are defined above */
+#undef gfn_t
+#endif
+
 #define VALID_GFN(m) (m != INVALID_GFN)
 
 static inline int
diff -r 7b4449bdb980 -r 9b09b379df32 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Thu Nov 22 10:47:58 2012 +0100
+++ b/xen/include/asm-x86/mm.h	Thu Nov 22 17:40:47 2012 +0000
@@ -456,6 +456,11 @@ static inline _type _name##_x(_name##_t 
 
 TYPE_SAFE(unsigned long,mfn);
 
+#ifndef mfn_t
+#define mfn_t /* Grep fodder: mfn_t, _mfn() and mfn_x() are defined above */
+#undef mfn_t
+#endif
+
 /* Macro for printk formats: use as printk("%"PRI_mfn"\n", mfn_x(foo)); */
 #define PRI_mfn "05lx"
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 17:48:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 17:48:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbasg-00035h-GK; Thu, 22 Nov 2012 17:48:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <hpa@zytor.com>) id 1Tbasf-00035R-KN
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 17:48:05 +0000
Received: from [85.158.138.51:18236] by server-11.bemta-3.messagelabs.com id
	24/CE-19361-4556EA05; Thu, 22 Nov 2012 17:48:04 +0000
X-Env-Sender: hpa@zytor.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353606482!23080322!1
X-Originating-IP: [198.137.202.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7873 invoked from network); 22 Nov 2012 17:48:03 -0000
Received: from terminus.zytor.com (HELO mail.zytor.com) (198.137.202.10)
	by server-6.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 22 Nov 2012 17:48:03 -0000
Received: from tazenda.hos.anvin.org (c-67-161-22-173.hsd1.ca.comcast.net
	[67.161.22.173]) (authenticated bits=0)
	by mail.zytor.com (8.14.5/8.14.5) with ESMTP id qAMHlkcb006326
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Thu, 22 Nov 2012 09:47:46 -0800
Message-ID: <50AE6542.3020302@zytor.com>
Date: Thu, 22 Nov 2012 09:47:46 -0800
From: "H. Peter Anvin" <hpa@zytor.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: "Eric W. Biederman" <ebiederm@xmission.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com>
In-Reply-To: <87txshx28b.fsf@xmission.com>
Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com,
	Daniel Kiper <daniel.kiper@oracle.com>, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	jbeulich@suse.com, tglx@linutronix.de
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The other thing that should be considered here is how utterly 
preposterous the notion of doing in-guest crash dumping is in a system 
that contains a hypervisor.  The reason for kdump is that on bare metal 
there are no other options, but in a hypervisor system the right thing 
should be for the hypervisor to do the dump (possibly spawning a clean 
I/O domain if the I/O domain is necessary to access the media.)

There is absolutely no reason to have a crashkernel sitting around in 
each guest, consuming memory, and possibly get corrupt.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 17:48:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 17:48:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbasg-00035h-GK; Thu, 22 Nov 2012 17:48:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <hpa@zytor.com>) id 1Tbasf-00035R-KN
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 17:48:05 +0000
Received: from [85.158.138.51:18236] by server-11.bemta-3.messagelabs.com id
	24/CE-19361-4556EA05; Thu, 22 Nov 2012 17:48:04 +0000
X-Env-Sender: hpa@zytor.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353606482!23080322!1
X-Originating-IP: [198.137.202.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7873 invoked from network); 22 Nov 2012 17:48:03 -0000
Received: from terminus.zytor.com (HELO mail.zytor.com) (198.137.202.10)
	by server-6.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 22 Nov 2012 17:48:03 -0000
Received: from tazenda.hos.anvin.org (c-67-161-22-173.hsd1.ca.comcast.net
	[67.161.22.173]) (authenticated bits=0)
	by mail.zytor.com (8.14.5/8.14.5) with ESMTP id qAMHlkcb006326
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Thu, 22 Nov 2012 09:47:46 -0800
Message-ID: <50AE6542.3020302@zytor.com>
Date: Thu, 22 Nov 2012 09:47:46 -0800
From: "H. Peter Anvin" <hpa@zytor.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: "Eric W. Biederman" <ebiederm@xmission.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com>
In-Reply-To: <87txshx28b.fsf@xmission.com>
Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com,
	Daniel Kiper <daniel.kiper@oracle.com>, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	jbeulich@suse.com, tglx@linutronix.de
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The other thing that should be considered here is how utterly 
preposterous the notion of doing in-guest crash dumping is in a system 
that contains a hypervisor.  The reason for kdump is that on bare metal 
there are no other options, but in a hypervisor system the right thing 
should be for the hypervisor to do the dump (possibly spawning a clean 
I/O domain if the I/O domain is necessary to access the media.)

There is absolutely no reason to have a crashkernel sitting around in 
each guest, consuming memory, and possibly get corrupt.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 18:08:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 18:08:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbbBl-0003qx-Ap; Thu, 22 Nov 2012 18:07:49 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbbBj-0003qs-Or
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 18:07:47 +0000
Received: from [193.109.254.147:33443] by server-12.bemta-14.messagelabs.com
	id D9/45-00510-2F96EA05; Thu, 22 Nov 2012 18:07:46 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1353607664!8606397!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20503 invoked from network); 22 Nov 2012 18:07:45 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 18:07:45 -0000
X-IronPort-AV: E=Sophos;i="4.83,302,1352073600"; d="scan'208";a="215291704"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 18:07:44 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 13:07:43 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbbBf-0000z6-CG;
	Thu, 22 Nov 2012 18:07:43 +0000
Message-ID: <50AE69EF.4060909@citrix.com>
Date: Thu, 22 Nov 2012 18:07:43 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "H. Peter Anvin" <hpa@zytor.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
In-Reply-To: <50AE6542.3020302@zytor.com>
X-Enigmail-Version: 1.4.6
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Daniel Kiper <daniel.kiper@oracle.com>, "x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/12 17:47, H. Peter Anvin wrote:
> The other thing that should be considered here is how utterly 
> preposterous the notion of doing in-guest crash dumping is in a system 
> that contains a hypervisor.  The reason for kdump is that on bare metal 
> there are no other options, but in a hypervisor system the right thing 
> should be for the hypervisor to do the dump (possibly spawning a clean 
> I/O domain if the I/O domain is necessary to access the media.)
>
> There is absolutely no reason to have a crashkernel sitting around in 
> each guest, consuming memory, and possibly get corrupt.
>
> 	-hpa
>

I agree that regular guests should not be using the kexec/kdump. 
However, this patch series is required for allowing a pvops kernel to be
a crash kernel for Xen, which is very important from dom0/Xen's point of
view.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 18:08:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 18:08:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbbBl-0003qx-Ap; Thu, 22 Nov 2012 18:07:49 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbbBj-0003qs-Or
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 18:07:47 +0000
Received: from [193.109.254.147:33443] by server-12.bemta-14.messagelabs.com
	id D9/45-00510-2F96EA05; Thu, 22 Nov 2012 18:07:46 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1353607664!8606397!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgyNjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20503 invoked from network); 22 Nov 2012 18:07:45 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 18:07:45 -0000
X-IronPort-AV: E=Sophos;i="4.83,302,1352073600"; d="scan'208";a="215291704"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 18:07:44 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 22 Nov 2012 13:07:43 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TbbBf-0000z6-CG;
	Thu, 22 Nov 2012 18:07:43 +0000
Message-ID: <50AE69EF.4060909@citrix.com>
Date: Thu, 22 Nov 2012 18:07:43 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: "H. Peter Anvin" <hpa@zytor.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
In-Reply-To: <50AE6542.3020302@zytor.com>
X-Enigmail-Version: 1.4.6
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Daniel Kiper <daniel.kiper@oracle.com>, "x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/12 17:47, H. Peter Anvin wrote:
> The other thing that should be considered here is how utterly 
> preposterous the notion of doing in-guest crash dumping is in a system 
> that contains a hypervisor.  The reason for kdump is that on bare metal 
> there are no other options, but in a hypervisor system the right thing 
> should be for the hypervisor to do the dump (possibly spawning a clean 
> I/O domain if the I/O domain is necessary to access the media.)
>
> There is absolutely no reason to have a crashkernel sitting around in 
> each guest, consuming memory, and possibly get corrupt.
>
> 	-hpa
>

I agree that regular guests should not be using the kexec/kdump. 
However, this patch series is required for allowing a pvops kernel to be
a crash kernel for Xen, which is very important from dom0/Xen's point of
view.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 18:55:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 18:55:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbbv9-0004hU-95; Thu, 22 Nov 2012 18:54:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <peter.maloney@brockmann-consult.de>)
	id 1Tbbv7-0004hP-Ac
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 18:54:42 +0000
Received: from [85.158.137.99:53311] by server-6.bemta-3.messagelabs.com id
	8A/FE-28265-0F47EA05; Thu, 22 Nov 2012 18:54:40 +0000
X-Env-Sender: peter.maloney@brockmann-consult.de
X-Msg-Ref: server-5.tower-217.messagelabs.com!1353610477!15481477!1
X-Originating-IP: [212.227.17.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gODI5MTU=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gODI5MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18250 invoked from network); 22 Nov 2012 18:54:38 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.17.9)
	by server-5.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 18:54:38 -0000
Received: from [192.168.179.201] (hmbg-4d069e58.pool.mediaWays.net
	[77.6.158.88])
	by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis)
	id 0MLT3m-1Tb3x11soM-000lKP; Thu, 22 Nov 2012 19:54:33 +0100
Message-ID: <50AE74DA.6080808@brockmann-consult.de>
Date: Thu, 22 Nov 2012 19:54:18 +0100
From: Peter Maloney <peter.maloney@brockmann-consult.de>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121025 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel@lists.xen.org, 
 Andres Lagar-Cavilla <andres@lagarcavilla.org>
References: <5082DD8C.2030608@brockmann-consult.de>
	<20121022135920.GE12577@ocelot.phlegethon.org>
	<20121101170016.GD61948@ocelot.phlegethon.org>
	<E9577EEC-5F2E-4DFB-913F-C470D77CCF5C@gridcentric.ca>
	<50A2484D.309@brockmann-consult.de>
In-Reply-To: <50A2484D.309@brockmann-consult.de>
Content-Type: multipart/mixed; boundary="------------090500060808000206070107"
X-Provags-ID: V02:K0:GsfDOhJjaw9M53bYHCeDG1tBNyMt7bMiHIligPB5dBZ
	xanQZtcrWOWczsfb4rnV6w4HSZ8Y0TD4kVPcNJ0kRBbRH0IR+t
	mq0ZQ5mwcXvYSGGjZoDZhihuVgMHLaSl4Dta6aoxBhlVOtoYbg
	hoXyty4ixWYbm3/q7dKAhR+XsJ8/aFFeMuBB1iUIhAbhrVZpvJ
	hth5WE1jNKwJJNqPG4G/ndfV490U5j3VQLq+o7T7hVjKpEnXhH
	bRldJCvdRO2lgMsiTy/7mAbQtOPuW/pCd8anBlJOR8ipDsVhU/
	6YmNm/b6QMtlohvGnKUnTSLa5IRzUgwjSak7Xu3RWtlfrjv1V8
	o3gaTjhtDRd3+bytgw3JI86v9Mg5d+Qq5DqnobKZTtTev62WTG
	MkQhw1D1f/1HA==
Subject: Re: [Xen-devel] xen-unstable,
 winxp32 very poor performance on AMD FX-8150,
 I bisected and changeset is 24770:7f79475d3de7
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.
--------------090500060808000206070107
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On 11/13/2012 02:17 PM, Peter Maloney wrote:
> On 2012-11-01 18:28, Andres Lagar-Cavilla wrote:
>> On Nov 1, 2012, at 1:00 PM, Tim Deegan <tim@xen.org> wrote:
>>
>>> Hi,
>>>
>>> At 14:59 +0100 on 22 Oct (1350917960), Tim Deegan wrote:
>>>> At 19:21 +0200 on 20 Oct (1350760876), Peter Maloney wrote:
>>>>> The change was 8 months ago
>>>>>
>>>>> changeset:   24770:7f79475d3de7
>>>>> user:        Andres Lagar-Cavilla <andres@lagarcavilla.org>
>>>>> date:        Fri Feb 10 16:07:07 2012 +0000
>>>>> summary:     x86/mm: Make p2m lookups fully synchronized wrt modifications
>>> [...]
>> Not any immediate ideas without profiling.
>>
>> However, most callers of hvmemul_do_io pass a stub zero ram_gpa address. We might be madly hitting the p2m locks for no reason there.
>>
>> How about the following patch, Peter, Tim?
>

I tried the patch applied to xen-unstable 4.2.0-branched
528f0708b6db+ 4.2.0-branched

It seemed the same. It was extremely slow with 7 vcpus, and with 2 vcpus
it was slow, but fast enough that I could bother to log in and out
during the test.

Attached are logs generated with this command (using xm instead of xl):
for i in {1..30}; do xm debug-keys d; xm dmesg -c; done >> nameoflog

xenxp_xm_dmesg_-c_7cpus_idle.log
xenxp_xm_dmesg_-c_7cpus_logintooslow.log
xenxp_xm_dmesg_-c_7cpus_shutdown.log
xenxp_xm_dmesg_-c_duringlogin.log
xenxp_xm_dmesg_-c_idling_login_screen.log

Also there is xenxp_dmesg.log which is output from hitting alt+sysrq+w
and p in case it's relevant.

BTW this time I am testing with kernel 3.6.7

--------------090500060808000206070107
Content-Type: application/x-compressed-tar;
 name="xenxp_logs.tgz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="xenxp_logs.tgz"

H4sIAGNzrlAAA+xdbW/bxpbu5/0VBPol3RvR8z5D46K7aZz2BrjNBm57cYGiECiKsrmRRFek
HHt//Z6h7FjvM5RpUkqPEMQOpTyceWbmzHNInYd36fTupj/Or4qzb17qReClpax+wmv9Z/U7
ZURyoalQ+htCqZb8m0C+WIuWXvOijGdB8M0sz8t9n3O9f6Kvu6fxX/w6nKTFVQgHmjuHHWAl
xNbx50JIGPnH8SdM2/GXhML4k+aasPv1Fx//D/ltwFhAo3MuzpkObtIynQWf0tk0HZ8Hgxk5
D27yWRnwV7fZiIakl07m3wXpFD6VDoNhVsSDMfwCJJbpf6yC8Qew4WBe9IZxOsmnv1NF5R/n
wX/CK3j7jzcffnr/4afgrLgvzobpbZakxdltNivn8fhsMM6TT2fDSY/UhP3t48WbX5uHfffz
+18r2KrZ7y6CUT5r+BSPyLVQOVsbM1jGvcH40yBOPp3PsulVb5aOAqq44a+D9BZGrpdcx1P4
aGBeBzezvMyTfBzQ4NV8WtykSTbK0uHrIC6K+QT+dzCNy+w2/e7Qk7L1k0YHn1SKtZO+/3ir
zoM3FxeXb//n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H
nEzfSICTmawrItiqtxtEhu8bcOIMNe7YbBDxRzH2So3qoonyIj1eo1dq8M790a7zPO4Q08Lo
/eDEzFIMTmbB8gSeFiSe+gAjlDlbc11VvEYLTI8dI1yWLDyBpl/oC0vquaDrmpYxHLrAuu59
cDchgi3b1KrxBgJrYLxqqtlUAFQ2fjd4kkXyv+PZiLl/rus9Aa4MI2iI4Nod1JAAJ/oza/Ch
Ys4+Vep/axITkAcf7hizIiUrM2tWurIt8GHDARO/qVeqZ7PAiCwZLXqR1m/8+M8P0zCDUtR3
/V5lbB2VXD+Lo6CQ8gFBIfGhHAeFaPnIDQrBb5uCQjAfj99gVtl4/CYWT3T8Dt5yvm5gXEVO
UAggOvb4hd5xg0LGJXLP8QuWv7Pj1xRyfaHELRYV2mp5cI7fG4NCxnmad4B7U+CdTyz3JDq7
bHY5SDYzdXb6G/UCu1wdweKet2zW2aXkP16XBV5bl85mnvATstZNUVb9vvBEOrt04lisOszV
8aHedpZgnV0vWNFMR0Mc3uXjynoOtxhhNJGP0S46u4iqLpC6sbLSboW9bEVC6PTK19mNtcNm
nzxmuiydXS4zXbRJ5OnsYGa6DGWWTyto3pUdqXgSFoMT4AGIZ9XZZTLT7amzKyMBiHV2ezHT
XXT2F4PM4xlk9DnRSUxgOvuDGGQoqcsErNjGIKOXHWWN8mDF+QwyCUejE7nlVhlk3NUdktZu
ZpCJkEAkk/PgZqbXbQqvwBOkcGcCAc/FIHNby17D0ehikIFRweVo5AOLr1//u/0HwZz9Q6K3
/9/37398f/uz+/aG9dWj1NDiu3RMFKWV0//77Q/5P+Hs/d960rr/wVVQ+FMX8sIrxP+f/7p+
1+/6Xb/rd/2u3/W7ftfvg//+/6Bf3+0ASD8A
--------------090500060808000206070107
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.xen.org
http://lists.xen.org/xen-devel

--------------090500060808000206070107--


From xen-devel-bounces@lists.xen.org Thu Nov 22 18:55:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 18:55:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbbv9-0004hU-95; Thu, 22 Nov 2012 18:54:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <peter.maloney@brockmann-consult.de>)
	id 1Tbbv7-0004hP-Ac
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 18:54:42 +0000
Received: from [85.158.137.99:53311] by server-6.bemta-3.messagelabs.com id
	8A/FE-28265-0F47EA05; Thu, 22 Nov 2012 18:54:40 +0000
X-Env-Sender: peter.maloney@brockmann-consult.de
X-Msg-Ref: server-5.tower-217.messagelabs.com!1353610477!15481477!1
X-Originating-IP: [212.227.17.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gODI5MTU=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjE3LjkgPT4gODI5MTU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18250 invoked from network); 22 Nov 2012 18:54:38 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.17.9)
	by server-5.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 18:54:38 -0000
Received: from [192.168.179.201] (hmbg-4d069e58.pool.mediaWays.net
	[77.6.158.88])
	by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis)
	id 0MLT3m-1Tb3x11soM-000lKP; Thu, 22 Nov 2012 19:54:33 +0100
Message-ID: <50AE74DA.6080808@brockmann-consult.de>
Date: Thu, 22 Nov 2012 19:54:18 +0100
From: Peter Maloney <peter.maloney@brockmann-consult.de>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121025 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel@lists.xen.org, 
 Andres Lagar-Cavilla <andres@lagarcavilla.org>
References: <5082DD8C.2030608@brockmann-consult.de>
	<20121022135920.GE12577@ocelot.phlegethon.org>
	<20121101170016.GD61948@ocelot.phlegethon.org>
	<E9577EEC-5F2E-4DFB-913F-C470D77CCF5C@gridcentric.ca>
	<50A2484D.309@brockmann-consult.de>
In-Reply-To: <50A2484D.309@brockmann-consult.de>
Content-Type: multipart/mixed; boundary="------------090500060808000206070107"
X-Provags-ID: V02:K0:GsfDOhJjaw9M53bYHCeDG1tBNyMt7bMiHIligPB5dBZ
	xanQZtcrWOWczsfb4rnV6w4HSZ8Y0TD4kVPcNJ0kRBbRH0IR+t
	mq0ZQ5mwcXvYSGGjZoDZhihuVgMHLaSl4Dta6aoxBhlVOtoYbg
	hoXyty4ixWYbm3/q7dKAhR+XsJ8/aFFeMuBB1iUIhAbhrVZpvJ
	hth5WE1jNKwJJNqPG4G/ndfV490U5j3VQLq+o7T7hVjKpEnXhH
	bRldJCvdRO2lgMsiTy/7mAbQtOPuW/pCd8anBlJOR8ipDsVhU/
	6YmNm/b6QMtlohvGnKUnTSLa5IRzUgwjSak7Xu3RWtlfrjv1V8
	o3gaTjhtDRd3+bytgw3JI86v9Mg5d+Qq5DqnobKZTtTev62WTG
	MkQhw1D1f/1HA==
Subject: Re: [Xen-devel] xen-unstable,
 winxp32 very poor performance on AMD FX-8150,
 I bisected and changeset is 24770:7f79475d3de7
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.
--------------090500060808000206070107
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On 11/13/2012 02:17 PM, Peter Maloney wrote:
> On 2012-11-01 18:28, Andres Lagar-Cavilla wrote:
>> On Nov 1, 2012, at 1:00 PM, Tim Deegan <tim@xen.org> wrote:
>>
>>> Hi,
>>>
>>> At 14:59 +0100 on 22 Oct (1350917960), Tim Deegan wrote:
>>>> At 19:21 +0200 on 20 Oct (1350760876), Peter Maloney wrote:
>>>>> The change was 8 months ago
>>>>>
>>>>> changeset:   24770:7f79475d3de7
>>>>> user:        Andres Lagar-Cavilla <andres@lagarcavilla.org>
>>>>> date:        Fri Feb 10 16:07:07 2012 +0000
>>>>> summary:     x86/mm: Make p2m lookups fully synchronized wrt modifications
>>> [...]
>> Not any immediate ideas without profiling.
>>
>> However, most callers of hvmemul_do_io pass a stub zero ram_gpa address. We might be madly hitting the p2m locks for no reason there.
>>
>> How about the following patch, Peter, Tim?
>

I tried the patch applied to xen-unstable 4.2.0-branched
528f0708b6db+ 4.2.0-branched

It seemed the same. It was extremely slow with 7 vcpus, and with 2 vcpus
it was slow, but fast enough that I could bother to log in and out
during the test.

Attached are logs generated with this command (using xm instead of xl):
for i in {1..30}; do xm debug-keys d; xm dmesg -c; done >> nameoflog

xenxp_xm_dmesg_-c_7cpus_idle.log
xenxp_xm_dmesg_-c_7cpus_logintooslow.log
xenxp_xm_dmesg_-c_7cpus_shutdown.log
xenxp_xm_dmesg_-c_duringlogin.log
xenxp_xm_dmesg_-c_idling_login_screen.log

Also there is xenxp_dmesg.log which is output from hitting alt+sysrq+w
and p in case it's relevant.

BTW this time I am testing with kernel 3.6.7

--------------090500060808000206070107
Content-Type: application/x-compressed-tar;
 name="xenxp_logs.tgz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="xenxp_logs.tgz"

H4sIAGNzrlAAA+xdbW/bxpbu5/0VBPol3RvR8z5D46K7aZz2BrjNBm57cYGiECiKsrmRRFek
HHt//Z6h7FjvM5RpUkqPEMQOpTyceWbmzHNInYd36fTupj/Or4qzb17qReClpax+wmv9Z/U7
ZURyoalQ+htCqZb8m0C+WIuWXvOijGdB8M0sz8t9n3O9f6Kvu6fxX/w6nKTFVQgHmjuHHWAl
xNbx50JIGPnH8SdM2/GXhML4k+aasPv1Fx//D/ltwFhAo3MuzpkObtIynQWf0tk0HZ8Hgxk5
D27yWRnwV7fZiIakl07m3wXpFD6VDoNhVsSDMfwCJJbpf6yC8Qew4WBe9IZxOsmnv1NF5R/n
wX/CK3j7jzcffnr/4afgrLgvzobpbZakxdltNivn8fhsMM6TT2fDSY/UhP3t48WbX5uHfffz
+18r2KrZ7y6CUT5r+BSPyLVQOVsbM1jGvcH40yBOPp3PsulVb5aOAqq44a+D9BZGrpdcx1P4
aGBeBzezvMyTfBzQ4NV8WtykSTbK0uHrIC6K+QT+dzCNy+w2/e7Qk7L1k0YHn1SKtZO+/3ir
zoM3FxeXb//nw4+vPrz79eLdv/oLFr87DxYT9jwYZ9NPwSBNcohswSyNh/cO3KdZzx5m/dOM
h1H/HM+GtpFb5nxjUAr+rEH9cl9c/hnAz+v8c3CZXhWOz7/9+FtAAseHPmbD84C8DoCcyXlQ
fI5vbtLZGQk+5GVQxhm0dBjwUIW6R3vDdBTPx+Xfgm9p8FN2FQ/uyzT4NU2upzlsF/fB2zx8
HfyzHIbBT296UUR+/Peb3m8X8mzlX472XL7/eB6khJPz3/8+engZSmA7iOPv/wiCrUev76HR
STwe92/iq/Rv5A4On5E7+ABxne6X6nRscP4EGxOaDkkQvPvxn29++gXYsS8mlAvqzb8fPrv0
Ci5/gKMr2KOhCS7frhxddMSF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UAggOvb4hd5xg0LGJXLP8QuWv7Pj1xRyfaHELRYV2mp5cI7fG4NCxnmad4B7U+CdTyz3JDq7
bHY5SDYzdXb6G/UCu1wdweKet2zW2aXkP16XBV5bl85mnvATstZNUVb9vvBEOrt04lisOszV
8aHedpZgnV0vWNFMR0Mc3uXjynoOtxhhNJGP0S46u4iqLpC6sbLSboW9bEVC6PTK19mNtcNm
nzxmuiydXS4zXbRJ5OnsYGa6DGWWTyto3pUdqXgSFoMT4AGIZ9XZZTLT7amzKyMBiHV2ezHT
XXT2F4PM4xlk9DnRSUxgOvuDGGQoqcsErNjGIKOXHWWN8mDF+QwyCUejE7nlVhlk3NUdktZu
ZpCJkEAkk/PgZqbXbQqvwBOkcGcCAc/FIHNby17D0ehikIFRweVo5AOLr1//u/0HwZz9Q6K3
/9/37398f/uz+/aG9dWj1NDiu3RMFKWV0//77Q/5P+Hs/d960rr/wVVQ+FMX8sIrxP+f/7p+
1+/6Xb/rd/2u3/W7ftfvg//+/6Bf3+0ASD8A
--------------090500060808000206070107
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.xen.org
http://lists.xen.org/xen-devel

--------------090500060808000206070107--


From xen-devel-bounces@lists.xen.org Thu Nov 22 20:09:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 20:09:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbd4u-0006at-NK; Thu, 22 Nov 2012 20:08:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Tbd4s-0006ao-TQ
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 20:08:51 +0000
Received: from [85.158.143.35:61846] by server-3.bemta-4.messagelabs.com id
	08/24-06841-2568EA05; Thu, 22 Nov 2012 20:08:50 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1353614929!16356298!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32292 invoked from network); 22 Nov 2012 20:08:49 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 20:08:49 -0000
X-IronPort-AV: E=Sophos;i="4.83,302,1352073600"; d="scan'208";a="15962158"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 20:08:48 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 22 Nov 2012 20:08:48 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1Tbd4q-00047F-FA;
	Thu, 22 Nov 2012 20:08:48 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1Tbd4q-0007C0-4E;
	Thu, 22 Nov 2012 20:08:48 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14466-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 22 Nov 2012 20:08:48 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14466: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14466 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14466/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14464
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14464
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14464
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14464

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  7b4449bdb980
baseline version:
 xen                  2489c2926698

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=7b4449bdb980
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 7b4449bdb980
+ branch=xen-unstable
+ revision=7b4449bdb980
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 7b4449bdb980 ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 4 changesets with 15 changes to 14 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 20:09:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 20:09:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbd4u-0006at-NK; Thu, 22 Nov 2012 20:08:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Tbd4s-0006ao-TQ
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 20:08:51 +0000
Received: from [85.158.143.35:61846] by server-3.bemta-4.messagelabs.com id
	08/24-06841-2568EA05; Thu, 22 Nov 2012 20:08:50 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1353614929!16356298!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32292 invoked from network); 22 Nov 2012 20:08:49 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 20:08:49 -0000
X-IronPort-AV: E=Sophos;i="4.83,302,1352073600"; d="scan'208";a="15962158"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	22 Nov 2012 20:08:48 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 22 Nov 2012 20:08:48 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1Tbd4q-00047F-FA;
	Thu, 22 Nov 2012 20:08:48 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1Tbd4q-0007C0-4E;
	Thu, 22 Nov 2012 20:08:48 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14466-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 22 Nov 2012 20:08:48 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14466: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14466 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14466/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14464
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14464
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14464
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14464

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  7b4449bdb980
baseline version:
 xen                  2489c2926698

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=7b4449bdb980
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 7b4449bdb980
+ branch=xen-unstable
+ revision=7b4449bdb980
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 7b4449bdb980 ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 4 changesets with 15 changes to 14 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 22:27:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 22:27:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbfEf-0001Lm-P5; Thu, 22 Nov 2012 22:27:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <hpa@zytor.com>) id 1TbfEd-0001Lh-Sn
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 22:27:04 +0000
Received: from [85.158.139.83:37001] by server-8.bemta-5.messagelabs.com id
	E1/F3-06050-7B6AEA05; Thu, 22 Nov 2012 22:27:03 +0000
X-Env-Sender: hpa@zytor.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1353623220!24284060!1
X-Originating-IP: [198.137.202.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26351 invoked from network); 22 Nov 2012 22:27:02 -0000
Received: from terminus.zytor.com (HELO mail.zytor.com) (198.137.202.10)
	by server-11.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 22 Nov 2012 22:27:02 -0000
Received: from wld7.hos.anvin.org (c-67-161-22-173.hsd1.ca.comcast.net
	[67.161.22.173]) (authenticated bits=0)
	by mail.zytor.com (8.14.5/8.14.5) with ESMTP id qAMMQJKI002224
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO);
	Thu, 22 Nov 2012 14:26:23 -0800
User-Agent: K-9 Mail for Android
In-Reply-To: <50AE69EF.4060909@citrix.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AE69EF.4060909@citrix.com>
MIME-Version: 1.0
From: "H. Peter Anvin" <hpa@zytor.com>
Date: Thu, 22 Nov 2012 14:26:10 -0800
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <09b41677-c9e7-4cd4-84a0-a1cb483d551d@email.android.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Daniel Kiper <daniel.kiper@oracle.com>, "x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Bullshit.  This should be a separate domain.

Andrew Cooper <andrew.cooper3@citrix.com> wrote:

>On 22/11/12 17:47, H. Peter Anvin wrote:
>> The other thing that should be considered here is how utterly 
>> preposterous the notion of doing in-guest crash dumping is in a
>system 
>> that contains a hypervisor.  The reason for kdump is that on bare
>metal 
>> there are no other options, but in a hypervisor system the right
>thing 
>> should be for the hypervisor to do the dump (possibly spawning a
>clean 
>> I/O domain if the I/O domain is necessary to access the media.)
>>
>> There is absolutely no reason to have a crashkernel sitting around in
>
>> each guest, consuming memory, and possibly get corrupt.
>>
>> 	-hpa
>>
>
>I agree that regular guests should not be using the kexec/kdump. 
>However, this patch series is required for allowing a pvops kernel to
>be
>a crash kernel for Xen, which is very important from dom0/Xen's point
>of
>view.

-- 
Sent from my mobile phone. Please excuse brevity and lack of formatting.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 22:27:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 22:27:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbfEf-0001Lm-P5; Thu, 22 Nov 2012 22:27:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <hpa@zytor.com>) id 1TbfEd-0001Lh-Sn
	for xen-devel@lists.xensource.com; Thu, 22 Nov 2012 22:27:04 +0000
Received: from [85.158.139.83:37001] by server-8.bemta-5.messagelabs.com id
	E1/F3-06050-7B6AEA05; Thu, 22 Nov 2012 22:27:03 +0000
X-Env-Sender: hpa@zytor.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1353623220!24284060!1
X-Originating-IP: [198.137.202.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26351 invoked from network); 22 Nov 2012 22:27:02 -0000
Received: from terminus.zytor.com (HELO mail.zytor.com) (198.137.202.10)
	by server-11.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 22 Nov 2012 22:27:02 -0000
Received: from wld7.hos.anvin.org (c-67-161-22-173.hsd1.ca.comcast.net
	[67.161.22.173]) (authenticated bits=0)
	by mail.zytor.com (8.14.5/8.14.5) with ESMTP id qAMMQJKI002224
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO);
	Thu, 22 Nov 2012 14:26:23 -0800
User-Agent: K-9 Mail for Android
In-Reply-To: <50AE69EF.4060909@citrix.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AE69EF.4060909@citrix.com>
MIME-Version: 1.0
From: "H. Peter Anvin" <hpa@zytor.com>
Date: Thu, 22 Nov 2012 14:26:10 -0800
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <09b41677-c9e7-4cd4-84a0-a1cb483d551d@email.android.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Daniel Kiper <daniel.kiper@oracle.com>, "x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Bullshit.  This should be a separate domain.

Andrew Cooper <andrew.cooper3@citrix.com> wrote:

>On 22/11/12 17:47, H. Peter Anvin wrote:
>> The other thing that should be considered here is how utterly 
>> preposterous the notion of doing in-guest crash dumping is in a
>system 
>> that contains a hypervisor.  The reason for kdump is that on bare
>metal 
>> there are no other options, but in a hypervisor system the right
>thing 
>> should be for the hypervisor to do the dump (possibly spawning a
>clean 
>> I/O domain if the I/O domain is necessary to access the media.)
>>
>> There is absolutely no reason to have a crashkernel sitting around in
>
>> each guest, consuming memory, and possibly get corrupt.
>>
>> 	-hpa
>>
>
>I agree that regular guests should not be using the kexec/kdump. 
>However, this patch series is required for allowing a pvops kernel to
>be
>a crash kernel for Xen, which is very important from dom0/Xen's point
>of
>view.

-- 
Sent from my mobile phone. Please excuse brevity and lack of formatting.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 23:09:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 23:09:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbftY-0002Pn-Qx; Thu, 22 Nov 2012 23:09:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ronny.hegewald@online.de>) id 1TbftX-0002Pi-9M
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 23:09:19 +0000
Received: from [85.158.137.99:19157] by server-3.bemta-3.messagelabs.com id
	D0/7A-31566-E90BEA05; Thu, 22 Nov 2012 23:09:18 +0000
X-Env-Sender: ronny.hegewald@online.de
X-Msg-Ref: server-11.tower-217.messagelabs.com!1353625757!19363593!1
X-Originating-IP: [212.227.126.186]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xODYgPT4gNzYzNTY=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xODYgPT4gNzYzNTY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22163 invoked from network); 22 Nov 2012 23:09:17 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.126.186)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 23:09:17 -0000
Received: from server2-groupware.localnet (p4FEF84E4.dip0.t-ipconnect.de
	[79.239.132.228])
	by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis)
	id 0LxwHc-1TESa51lY4-015F7W; Fri, 23 Nov 2012 00:09:17 +0100
From: Ronny Hegewald <ronny.hegewald@online.de>
Date: Fri, 23 Nov 2012 00:14:55 +0000
User-Agent: KMail/1.11.4 (Linux/3.0.3; KDE/4.2.4; i686; ; )
MIME-Version: 1.0
Content-Disposition: inline
To: xen-devel@lists.xen.org
Message-Id: <201211230014.55979.ronny.hegewald@online.de>
X-Provags-ID: V02:K0:uuTs70qc0Zw+kL4F5K2r7pfCIiMvxvpfncx30s/ycw4
	gO/nGcpCEzkR3T3V+WDJjMVNJnl/s0zNv8ztMFQPhpUAGLtrY1
	nOl69P9/ZY7Rv8XUK0Zq6HLt5upDFVAkNYslHPyBYL3oW0TYs/
	d3AP7WcxqfbwuD6Y6uwIISHJgZVQgRhcvfK8YNSz2tD4o2MFjs
	bQduykWQk3bABwdg3T/NPhNZs95NParDCg7UPTLX9iDkarPwds
	Cw+yaTVlBSdT84zHuwN/8yjR7O6waIp9Lu389xHY941ANzT2fl
	zQzELKzmNSnoIrX4aEpJS9Dng75rruPTLRWPuAbPBSWqcTlq8c
	zD5z61Ch42QPh5iYsGiSU+sjJpUj+I+Z+B7fDgdfmhkIKTMUSw
	vSkIdxNoMeScxHzEWflL9w/s1Ec6MCeNlE=
Subject: [Xen-devel] [PATCH] libxl - fix a variable underflow in
	libxl_wait_for_free_memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

When xl is called to create a domU and there is not enough memory available, 
then the autoballooning is called to extract memory from dom0. During the 
ballooning a loop in libxl_wait_for_free_memory() waits unless enough memory 
is available to create the domU. 

But because of a variable-underflow the loop can finish too soon and xl 
finally aborts with the message:


xc: error: panic: xc_dom_boot.c:161: xc_dom_boot_mem_init: can't allocate low 
memory for domain: Out of memory                         
libxl: error: libxl_dom.c:430:libxl__build_pv: xc_dom_boot_mem_init failed: 
Device or resource busy                                    
libxl: error: libxl_create.c:901:domcreate_rebuild_done: cannot (re-)build 
domain: -3        


The variable-underflow happens when freemem_slack is larger then 
info.free_pages*4, because the solution of this operation is converted 
implicit to a unsigned int to match the type of memory_kb.

The problem is fixed by a proper casting.


Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>

--- xen-4.3-20121121/tools/libxl/libxl.c.org	2012-11-22 03:34:00.000000000 
+0000
+++ xen-4.3-20121121/tools/libxl/libxl.c	2012-11-22 03:34:47.000000000 +0000
@@ -3763,7 +3763,7 @@ int libxl_wait_for_free_memory(libxl_ctx
         rc = libxl_get_physinfo(ctx, &info);
         if (rc < 0)
             goto out;
-        if (info.free_pages * 4 - freemem_slack >= memory_kb) {
+        if ((int64_t)(info.free_pages * 4 - freemem_slack) >= memory_kb) {
             rc = 0;
             goto out;
         }




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 22 23:09:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Nov 2012 23:09:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbftY-0002Pn-Qx; Thu, 22 Nov 2012 23:09:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ronny.hegewald@online.de>) id 1TbftX-0002Pi-9M
	for xen-devel@lists.xen.org; Thu, 22 Nov 2012 23:09:19 +0000
Received: from [85.158.137.99:19157] by server-3.bemta-3.messagelabs.com id
	D0/7A-31566-E90BEA05; Thu, 22 Nov 2012 23:09:18 +0000
X-Env-Sender: ronny.hegewald@online.de
X-Msg-Ref: server-11.tower-217.messagelabs.com!1353625757!19363593!1
X-Originating-IP: [212.227.126.186]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xODYgPT4gNzYzNTY=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xODYgPT4gNzYzNTY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22163 invoked from network); 22 Nov 2012 23:09:17 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.126.186)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	22 Nov 2012 23:09:17 -0000
Received: from server2-groupware.localnet (p4FEF84E4.dip0.t-ipconnect.de
	[79.239.132.228])
	by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis)
	id 0LxwHc-1TESa51lY4-015F7W; Fri, 23 Nov 2012 00:09:17 +0100
From: Ronny Hegewald <ronny.hegewald@online.de>
Date: Fri, 23 Nov 2012 00:14:55 +0000
User-Agent: KMail/1.11.4 (Linux/3.0.3; KDE/4.2.4; i686; ; )
MIME-Version: 1.0
Content-Disposition: inline
To: xen-devel@lists.xen.org
Message-Id: <201211230014.55979.ronny.hegewald@online.de>
X-Provags-ID: V02:K0:uuTs70qc0Zw+kL4F5K2r7pfCIiMvxvpfncx30s/ycw4
	gO/nGcpCEzkR3T3V+WDJjMVNJnl/s0zNv8ztMFQPhpUAGLtrY1
	nOl69P9/ZY7Rv8XUK0Zq6HLt5upDFVAkNYslHPyBYL3oW0TYs/
	d3AP7WcxqfbwuD6Y6uwIISHJgZVQgRhcvfK8YNSz2tD4o2MFjs
	bQduykWQk3bABwdg3T/NPhNZs95NParDCg7UPTLX9iDkarPwds
	Cw+yaTVlBSdT84zHuwN/8yjR7O6waIp9Lu389xHY941ANzT2fl
	zQzELKzmNSnoIrX4aEpJS9Dng75rruPTLRWPuAbPBSWqcTlq8c
	zD5z61Ch42QPh5iYsGiSU+sjJpUj+I+Z+B7fDgdfmhkIKTMUSw
	vSkIdxNoMeScxHzEWflL9w/s1Ec6MCeNlE=
Subject: [Xen-devel] [PATCH] libxl - fix a variable underflow in
	libxl_wait_for_free_memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

When xl is called to create a domU and there is not enough memory available, 
then the autoballooning is called to extract memory from dom0. During the 
ballooning a loop in libxl_wait_for_free_memory() waits unless enough memory 
is available to create the domU. 

But because of a variable-underflow the loop can finish too soon and xl 
finally aborts with the message:


xc: error: panic: xc_dom_boot.c:161: xc_dom_boot_mem_init: can't allocate low 
memory for domain: Out of memory                         
libxl: error: libxl_dom.c:430:libxl__build_pv: xc_dom_boot_mem_init failed: 
Device or resource busy                                    
libxl: error: libxl_create.c:901:domcreate_rebuild_done: cannot (re-)build 
domain: -3        


The variable-underflow happens when freemem_slack is larger then 
info.free_pages*4, because the solution of this operation is converted 
implicit to a unsigned int to match the type of memory_kb.

The problem is fixed by a proper casting.


Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>

--- xen-4.3-20121121/tools/libxl/libxl.c.org	2012-11-22 03:34:00.000000000 
+0000
+++ xen-4.3-20121121/tools/libxl/libxl.c	2012-11-22 03:34:47.000000000 +0000
@@ -3763,7 +3763,7 @@ int libxl_wait_for_free_memory(libxl_ctx
         rc = libxl_get_physinfo(ctx, &info);
         if (rc < 0)
             goto out;
-        if (info.free_pages * 4 - freemem_slack >= memory_kb) {
+        if ((int64_t)(info.free_pages * 4 - freemem_slack) >= memory_kb) {
             rc = 0;
             goto out;
         }




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 00:13:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 00:13:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbgt6-0003yx-3k; Fri, 23 Nov 2012 00:12:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Tbgt4-0003ys-In
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 00:12:54 +0000
Received: from [85.158.143.35:7804] by server-1.bemta-4.messagelabs.com id
	54/D7-27934-58FBEA05; Fri, 23 Nov 2012 00:12:53 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1353629572!5918892!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32360 invoked from network); 23 Nov 2012 00:12:52 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 00:12:52 -0000
X-IronPort-AV: E=Sophos;i="4.83,303,1352073600"; d="scan'208";a="15963759"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 00:12:52 +0000
Received: from [10.30.249.68] (10.30.249.68) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 00:12:52 +0000
Message-ID: <50AEBF86.50501@citrix.com>
Date: Fri, 23 Nov 2012 00:12:54 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: "H. Peter Anvin" <hpa@zytor.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
In-Reply-To: <50AE6542.3020302@zytor.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Daniel Kiper <daniel.kiper@oracle.com>, "x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/2012 17:47, H. Peter Anvin wrote:
> The other thing that should be considered here is how utterly 
> preposterous the notion of doing in-guest crash dumping is in a system 
> that contains a hypervisor.  The reason for kdump is that on bare metal 
> there are no other options, but in a hypervisor system the right thing 
> should be for the hypervisor to do the dump (possibly spawning a clean 
> I/O domain if the I/O domain is necessary to access the media.)
>
> There is absolutely no reason to have a crashkernel sitting around in 
> each guest, consuming memory, and possibly get corrupt.
>
> 	-hpa
>

(Your reply to my email which I can see on the xen devel archive appears
to have gotten lost somewhere inside the citrix email system, so
apologies for replying out of order)

The kdump kernel loaded by dom0 is for when Xen crashes, not for when
dom0 crashes (although a dom0 crash does admittedly lead to a Xen crash)

There is no possible way it could be a separate domain; Xen completely
ceases to function as soon as jumps to the entry point of the kdump image.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 00:13:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 00:13:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbgt6-0003yx-3k; Fri, 23 Nov 2012 00:12:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Tbgt4-0003ys-In
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 00:12:54 +0000
Received: from [85.158.143.35:7804] by server-1.bemta-4.messagelabs.com id
	54/D7-27934-58FBEA05; Fri, 23 Nov 2012 00:12:53 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1353629572!5918892!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32360 invoked from network); 23 Nov 2012 00:12:52 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 00:12:52 -0000
X-IronPort-AV: E=Sophos;i="4.83,303,1352073600"; d="scan'208";a="15963759"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 00:12:52 +0000
Received: from [10.30.249.68] (10.30.249.68) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 00:12:52 +0000
Message-ID: <50AEBF86.50501@citrix.com>
Date: Fri, 23 Nov 2012 00:12:54 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: "H. Peter Anvin" <hpa@zytor.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
In-Reply-To: <50AE6542.3020302@zytor.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Daniel Kiper <daniel.kiper@oracle.com>, "x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/2012 17:47, H. Peter Anvin wrote:
> The other thing that should be considered here is how utterly 
> preposterous the notion of doing in-guest crash dumping is in a system 
> that contains a hypervisor.  The reason for kdump is that on bare metal 
> there are no other options, but in a hypervisor system the right thing 
> should be for the hypervisor to do the dump (possibly spawning a clean 
> I/O domain if the I/O domain is necessary to access the media.)
>
> There is absolutely no reason to have a crashkernel sitting around in 
> each guest, consuming memory, and possibly get corrupt.
>
> 	-hpa
>

(Your reply to my email which I can see on the xen devel archive appears
to have gotten lost somewhere inside the citrix email system, so
apologies for replying out of order)

The kdump kernel loaded by dom0 is for when Xen crashes, not for when
dom0 crashes (although a dom0 crash does admittedly lead to a Xen crash)

There is no possible way it could be a separate domain; Xen completely
ceases to function as soon as jumps to the entry point of the kdump image.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 01:30:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 01:30:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbi69-0000W7-MT; Fri, 23 Nov 2012 01:30:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1Tbi68-0000W1-I2
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 01:30:28 +0000
Received: from [193.109.254.147:22456] by server-1.bemta-14.messagelabs.com id
	7D/3F-25314-3B1DEA05; Fri, 23 Nov 2012 01:30:27 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353634225!9357056!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzE4Mzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30343 invoked from network); 23 Nov 2012 01:30:26 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-5.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 01:30:26 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAN1UKVp020956
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 23 Nov 2012 01:30:21 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAN1UKNL026432
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 23 Nov 2012 01:30:20 GMT
Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAN1UJVK019033; Thu, 22 Nov 2012 19:30:20 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 22 Nov 2012 17:30:19 -0800
Message-ID: <50AED1A8.30607@oracle.com>
Date: Fri, 23 Nov 2012 09:30:16 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
	<1353426878.13542.59.camel@zakaz.uk.xensource.com>
	<1353427456.13542.65.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353427456.13542.65.camel@zakaz.uk.xensource.com>
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
 xen/netfront: handle compound page fragments on transmit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-21 0:04, Ian Campbell wrote:
> Limiting to just xen-devel folks.
>
> On Tue, 2012-11-20 at 15:54 +0000, Ian Campbell wrote:
>
> This highlights a couple of issues, the main one is that implicitly
> including MAX_SKB_FRAGS in the PV net protocol is just madness. It can
> and has changed in the past. Someone really needs to (retroactively)
> figure out what a sensible default minimum which front and back must
> support is and use it in the front and backends instead of
> MAX_SKB_FRAGS. Probably something derived from the existing 64K limit
> (Linux has used 17 and 18 as MAX_SKB_FRAGS in the past).
>
> Then perhaps implement a feature-flag to allow front and backends to
> negotiate something bigger if they like.
>
> It might also be interesting for front and backends to coalesce multiple
> ring slots into compound pages.

Yes, MAX_SKB_FRAGS is max frag number, not max slot number required.
But I am not so clear about the whole implementation here. Does it mean 
netfront/netback uses something like MAX_SKB_FRAGS*SLOTS_PER_FRAG? and 
SLOTS_PER_FRAG can be adjusted based on different situation? If netfront 
and netback negotiate this value, then xenstore key feature is required, 
right?
As mentioned in another compound page fragments patch, for non-compound 
page, this value could be 64K/PAGE_SIZE + 1, but if taking account into 
compound page, the worse case is around 48 slots(in 1+4096+1 case). It 
is hard to negotiate this between netfront and netback for different 
packets.

Thanks
Annie
> I don't have time for either of those unfortunately
>
> Ian.
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 01:30:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 01:30:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbi69-0000W7-MT; Fri, 23 Nov 2012 01:30:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1Tbi68-0000W1-I2
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 01:30:28 +0000
Received: from [193.109.254.147:22456] by server-1.bemta-14.messagelabs.com id
	7D/3F-25314-3B1DEA05; Fri, 23 Nov 2012 01:30:27 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353634225!9357056!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzE4Mzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30343 invoked from network); 23 Nov 2012 01:30:26 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-5.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 01:30:26 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAN1UKVp020956
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 23 Nov 2012 01:30:21 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAN1UKNL026432
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 23 Nov 2012 01:30:20 GMT
Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAN1UJVK019033; Thu, 22 Nov 2012 19:30:20 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 22 Nov 2012 17:30:19 -0800
Message-ID: <50AED1A8.30607@oracle.com>
Date: Fri, 23 Nov 2012 09:30:16 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
	<1353426878.13542.59.camel@zakaz.uk.xensource.com>
	<1353427456.13542.65.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353427456.13542.65.camel@zakaz.uk.xensource.com>
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
 xen/netfront: handle compound page fragments on transmit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-21 0:04, Ian Campbell wrote:
> Limiting to just xen-devel folks.
>
> On Tue, 2012-11-20 at 15:54 +0000, Ian Campbell wrote:
>
> This highlights a couple of issues, the main one is that implicitly
> including MAX_SKB_FRAGS in the PV net protocol is just madness. It can
> and has changed in the past. Someone really needs to (retroactively)
> figure out what a sensible default minimum which front and back must
> support is and use it in the front and backends instead of
> MAX_SKB_FRAGS. Probably something derived from the existing 64K limit
> (Linux has used 17 and 18 as MAX_SKB_FRAGS in the past).
>
> Then perhaps implement a feature-flag to allow front and backends to
> negotiate something bigger if they like.
>
> It might also be interesting for front and backends to coalesce multiple
> ring slots into compound pages.

Yes, MAX_SKB_FRAGS is max frag number, not max slot number required.
But I am not so clear about the whole implementation here. Does it mean 
netfront/netback uses something like MAX_SKB_FRAGS*SLOTS_PER_FRAG? and 
SLOTS_PER_FRAG can be adjusted based on different situation? If netfront 
and netback negotiate this value, then xenstore key feature is required, 
right?
As mentioned in another compound page fragments patch, for non-compound 
page, this value could be 64K/PAGE_SIZE + 1, but if taking account into 
compound page, the worse case is around 48 slots(in 1+4096+1 case). It 
is hard to negotiate this between netfront and netback for different 
packets.

Thanks
Annie
> I don't have time for either of those unfortunately
>
> Ian.
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 01:36:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 01:36:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbiB9-0000wR-EO; Fri, 23 Nov 2012 01:35:39 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <hpa@zytor.com>) id 1TbiB7-0000wH-SR
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 01:35:38 +0000
Received: from [85.158.143.35:49976] by server-1.bemta-4.messagelabs.com id
	92/87-27934-9E2DEA05; Fri, 23 Nov 2012 01:35:37 +0000
X-Env-Sender: hpa@zytor.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1353634534!14141590!1
X-Originating-IP: [198.137.202.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6283 invoked from network); 23 Nov 2012 01:35:36 -0000
Received: from terminus.zytor.com (HELO mail.zytor.com) (198.137.202.10)
	by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 01:35:36 -0000
Received: from wld7.hos.anvin.org (c-67-161-22-173.hsd1.ca.comcast.net
	[67.161.22.173]) (authenticated bits=0)
	by mail.zytor.com (8.14.5/8.14.5) with ESMTP id qAN1Z2c5013180
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO);
	Thu, 22 Nov 2012 17:35:03 -0800
User-Agent: K-9 Mail for Android
In-Reply-To: <50AEBF86.50501@citrix.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
MIME-Version: 1.0
From: "H. Peter Anvin" <hpa@zytor.com>
Date: Thu, 22 Nov 2012 17:34:56 -0800
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <a1f75604-1f52-4af1-9dd7-b469ed4ea7b6@email.android.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Daniel Kiper <daniel.kiper@oracle.com>, "x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ok... that *sort of* makes sense, but also underscores how utterly different this is from a normal kexec.

Andrew Cooper <andrew.cooper3@citrix.com> wrote:

>On 22/11/2012 17:47, H. Peter Anvin wrote:
>> The other thing that should be considered here is how utterly 
>> preposterous the notion of doing in-guest crash dumping is in a
>system 
>> that contains a hypervisor.  The reason for kdump is that on bare
>metal 
>> there are no other options, but in a hypervisor system the right
>thing 
>> should be for the hypervisor to do the dump (possibly spawning a
>clean 
>> I/O domain if the I/O domain is necessary to access the media.)
>>
>> There is absolutely no reason to have a crashkernel sitting around in
>
>> each guest, consuming memory, and possibly get corrupt.
>>
>> 	-hpa
>>
>
>(Your reply to my email which I can see on the xen devel archive
>appears
>to have gotten lost somewhere inside the citrix email system, so
>apologies for replying out of order)
>
>The kdump kernel loaded by dom0 is for when Xen crashes, not for when
>dom0 crashes (although a dom0 crash does admittedly lead to a Xen
>crash)
>
>There is no possible way it could be a separate domain; Xen completely
>ceases to function as soon as jumps to the entry point of the kdump
>image.
>
>~Andrew

-- 
Sent from my mobile phone. Please excuse brevity and lack of formatting.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 01:36:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 01:36:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbiB9-0000wR-EO; Fri, 23 Nov 2012 01:35:39 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <hpa@zytor.com>) id 1TbiB7-0000wH-SR
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 01:35:38 +0000
Received: from [85.158.143.35:49976] by server-1.bemta-4.messagelabs.com id
	92/87-27934-9E2DEA05; Fri, 23 Nov 2012 01:35:37 +0000
X-Env-Sender: hpa@zytor.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1353634534!14141590!1
X-Originating-IP: [198.137.202.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6283 invoked from network); 23 Nov 2012 01:35:36 -0000
Received: from terminus.zytor.com (HELO mail.zytor.com) (198.137.202.10)
	by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 01:35:36 -0000
Received: from wld7.hos.anvin.org (c-67-161-22-173.hsd1.ca.comcast.net
	[67.161.22.173]) (authenticated bits=0)
	by mail.zytor.com (8.14.5/8.14.5) with ESMTP id qAN1Z2c5013180
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO);
	Thu, 22 Nov 2012 17:35:03 -0800
User-Agent: K-9 Mail for Android
In-Reply-To: <50AEBF86.50501@citrix.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
MIME-Version: 1.0
From: "H. Peter Anvin" <hpa@zytor.com>
Date: Thu, 22 Nov 2012 17:34:56 -0800
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <a1f75604-1f52-4af1-9dd7-b469ed4ea7b6@email.android.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Daniel Kiper <daniel.kiper@oracle.com>, "x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ok... that *sort of* makes sense, but also underscores how utterly different this is from a normal kexec.

Andrew Cooper <andrew.cooper3@citrix.com> wrote:

>On 22/11/2012 17:47, H. Peter Anvin wrote:
>> The other thing that should be considered here is how utterly 
>> preposterous the notion of doing in-guest crash dumping is in a
>system 
>> that contains a hypervisor.  The reason for kdump is that on bare
>metal 
>> there are no other options, but in a hypervisor system the right
>thing 
>> should be for the hypervisor to do the dump (possibly spawning a
>clean 
>> I/O domain if the I/O domain is necessary to access the media.)
>>
>> There is absolutely no reason to have a crashkernel sitting around in
>
>> each guest, consuming memory, and possibly get corrupt.
>>
>> 	-hpa
>>
>
>(Your reply to my email which I can see on the xen devel archive
>appears
>to have gotten lost somewhere inside the citrix email system, so
>apologies for replying out of order)
>
>The kdump kernel loaded by dom0 is for when Xen crashes, not for when
>dom0 crashes (although a dom0 crash does admittedly lead to a Xen
>crash)
>
>There is no possible way it could be a separate domain; Xen completely
>ceases to function as soon as jumps to the entry point of the kdump
>image.
>
>~Andrew

-- 
Sent from my mobile phone. Please excuse brevity and lack of formatting.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 01:39:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 01:39:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbiEw-00018W-A9; Fri, 23 Nov 2012 01:39:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <hpa@zytor.com>) id 1TbiEv-00018R-J3
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 01:39:33 +0000
Received: from [85.158.139.83:50911] by server-6.bemta-5.messagelabs.com id
	1B/26-19321-4D3DEA05; Fri, 23 Nov 2012 01:39:32 +0000
X-Env-Sender: hpa@zytor.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353634770!20262768!1
X-Originating-IP: [198.137.202.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26872 invoked from network); 23 Nov 2012 01:39:31 -0000
Received: from terminus.zytor.com (HELO mail.zytor.com) (198.137.202.10)
	by server-8.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 01:39:31 -0000
Received: from wld7.hos.anvin.org (c-67-161-22-173.hsd1.ca.comcast.net
	[67.161.22.173]) (authenticated bits=0)
	by mail.zytor.com (8.14.5/8.14.5) with ESMTP id qAN1cwSs013738
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO);
	Thu, 22 Nov 2012 17:39:03 -0800
User-Agent: K-9 Mail for Android
In-Reply-To: <50AEBF86.50501@citrix.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
MIME-Version: 1.0
From: "H. Peter Anvin" <hpa@zytor.com>
Date: Thu, 22 Nov 2012 17:38:33 -0800
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Daniel Kiper <daniel.kiper@oracle.com>, "x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I still don't really get why it can't be isolated from dom0, which would make more sense to me, even for a Xen crash.

Andrew Cooper <andrew.cooper3@citrix.com> wrote:

>On 22/11/2012 17:47, H. Peter Anvin wrote:
>> The other thing that should be considered here is how utterly 
>> preposterous the notion of doing in-guest crash dumping is in a
>system 
>> that contains a hypervisor.  The reason for kdump is that on bare
>metal 
>> there are no other options, but in a hypervisor system the right
>thing 
>> should be for the hypervisor to do the dump (possibly spawning a
>clean 
>> I/O domain if the I/O domain is necessary to access the media.)
>>
>> There is absolutely no reason to have a crashkernel sitting around in
>
>> each guest, consuming memory, and possibly get corrupt.
>>
>> 	-hpa
>>
>
>(Your reply to my email which I can see on the xen devel archive
>appears
>to have gotten lost somewhere inside the citrix email system, so
>apologies for replying out of order)
>
>The kdump kernel loaded by dom0 is for when Xen crashes, not for when
>dom0 crashes (although a dom0 crash does admittedly lead to a Xen
>crash)
>
>There is no possible way it could be a separate domain; Xen completely
>ceases to function as soon as jumps to the entry point of the kdump
>image.
>
>~Andrew

-- 
Sent from my mobile phone. Please excuse brevity and lack of formatting.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 01:39:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 01:39:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbiEw-00018W-A9; Fri, 23 Nov 2012 01:39:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <hpa@zytor.com>) id 1TbiEv-00018R-J3
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 01:39:33 +0000
Received: from [85.158.139.83:50911] by server-6.bemta-5.messagelabs.com id
	1B/26-19321-4D3DEA05; Fri, 23 Nov 2012 01:39:32 +0000
X-Env-Sender: hpa@zytor.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353634770!20262768!1
X-Originating-IP: [198.137.202.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26872 invoked from network); 23 Nov 2012 01:39:31 -0000
Received: from terminus.zytor.com (HELO mail.zytor.com) (198.137.202.10)
	by server-8.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 01:39:31 -0000
Received: from wld7.hos.anvin.org (c-67-161-22-173.hsd1.ca.comcast.net
	[67.161.22.173]) (authenticated bits=0)
	by mail.zytor.com (8.14.5/8.14.5) with ESMTP id qAN1cwSs013738
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO);
	Thu, 22 Nov 2012 17:39:03 -0800
User-Agent: K-9 Mail for Android
In-Reply-To: <50AEBF86.50501@citrix.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
MIME-Version: 1.0
From: "H. Peter Anvin" <hpa@zytor.com>
Date: Thu, 22 Nov 2012 17:38:33 -0800
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Daniel Kiper <daniel.kiper@oracle.com>, "x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I still don't really get why it can't be isolated from dom0, which would make more sense to me, even for a Xen crash.

Andrew Cooper <andrew.cooper3@citrix.com> wrote:

>On 22/11/2012 17:47, H. Peter Anvin wrote:
>> The other thing that should be considered here is how utterly 
>> preposterous the notion of doing in-guest crash dumping is in a
>system 
>> that contains a hypervisor.  The reason for kdump is that on bare
>metal 
>> there are no other options, but in a hypervisor system the right
>thing 
>> should be for the hypervisor to do the dump (possibly spawning a
>clean 
>> I/O domain if the I/O domain is necessary to access the media.)
>>
>> There is absolutely no reason to have a crashkernel sitting around in
>
>> each guest, consuming memory, and possibly get corrupt.
>>
>> 	-hpa
>>
>
>(Your reply to my email which I can see on the xen devel archive
>appears
>to have gotten lost somewhere inside the citrix email system, so
>apologies for replying out of order)
>
>The kdump kernel loaded by dom0 is for when Xen crashes, not for when
>dom0 crashes (although a dom0 crash does admittedly lead to a Xen
>crash)
>
>There is no possible way it could be a separate domain; Xen completely
>ceases to function as soon as jumps to the entry point of the kdump
>image.
>
>~Andrew

-- 
Sent from my mobile phone. Please excuse brevity and lack of formatting.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 01:56:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 01:56:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbiV0-0001hB-TC; Fri, 23 Nov 2012 01:56:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbiUz-0001h3-4g
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 01:56:09 +0000
Received: from [85.158.138.51:19454] by server-10.bemta-3.messagelabs.com id
	3D/01-19806-8B7DEA05; Fri, 23 Nov 2012 01:56:08 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353635767!31091656!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28671 invoked from network); 23 Nov 2012 01:56:07 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 01:56:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,304,1352073600"; d="scan'208";a="15964046"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 01:56:07 +0000
Received: from [10.30.249.68] (10.30.249.68) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 01:56:06 +0000
Message-ID: <50AED7B8.7040902@citrix.com>
Date: Fri, 23 Nov 2012 01:56:08 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: "H. Peter Anvin" <hpa@zytor.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
	<18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
In-Reply-To: <18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Daniel Kiper <daniel.kiper@oracle.com>, "x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 23/11/2012 01:38, H. Peter Anvin wrote:
> I still don't really get why it can't be isolated from dom0, which would make more sense to me, even for a Xen crash.
>

The crash region (as specified by crashkernel= on the Xen command line)
is isolated from dom0.

dom0 (using the kexec utility etc) has the task of locating the Xen
crash notes (using the kexec hypercall interface), constructing a binary
blob containing kernel, initram and gubbins, and asking Xen to put this
blob in the crash region (again, using the kexec hypercall interface).

I do not see how this is very much different from the native case
currently (although please correct me if I am misinformed).  Linux has
extra work to do by populating /proc/iomem with the Xen crash regions
boot (so the kexec utility can reference their physical addresses when
constructing the blob), and should just act as a conduit between the
kexec system call and the kexec hypercall to load the blob.

For within-guest kexec/kdump functionality, I agree that it is barking
mad.  However, we do see cloud operators interested in the idea so VM
administrators can look after their crashes themselves.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 01:56:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 01:56:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbiV0-0001hB-TC; Fri, 23 Nov 2012 01:56:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TbiUz-0001h3-4g
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 01:56:09 +0000
Received: from [85.158.138.51:19454] by server-10.bemta-3.messagelabs.com id
	3D/01-19806-8B7DEA05; Fri, 23 Nov 2012 01:56:08 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353635767!31091656!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28671 invoked from network); 23 Nov 2012 01:56:07 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 01:56:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,304,1352073600"; d="scan'208";a="15964046"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 01:56:07 +0000
Received: from [10.30.249.68] (10.30.249.68) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 01:56:06 +0000
Message-ID: <50AED7B8.7040902@citrix.com>
Date: Fri, 23 Nov 2012 01:56:08 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: "H. Peter Anvin" <hpa@zytor.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
	<18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
In-Reply-To: <18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Daniel Kiper <daniel.kiper@oracle.com>, "x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 23/11/2012 01:38, H. Peter Anvin wrote:
> I still don't really get why it can't be isolated from dom0, which would make more sense to me, even for a Xen crash.
>

The crash region (as specified by crashkernel= on the Xen command line)
is isolated from dom0.

dom0 (using the kexec utility etc) has the task of locating the Xen
crash notes (using the kexec hypercall interface), constructing a binary
blob containing kernel, initram and gubbins, and asking Xen to put this
blob in the crash region (again, using the kexec hypercall interface).

I do not see how this is very much different from the native case
currently (although please correct me if I am misinformed).  Linux has
extra work to do by populating /proc/iomem with the Xen crash regions
boot (so the kexec utility can reference their physical addresses when
constructing the blob), and should just act as a conduit between the
kexec system call and the kexec hypercall to load the blob.

For within-guest kexec/kdump functionality, I agree that it is barking
mad.  However, we do see cloud operators interested in the idea so VM
administrators can look after their crashes themselves.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 02:12:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 02:12:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbik1-0002T0-2W; Fri, 23 Nov 2012 02:11:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <james.harper@bendigoit.com.au>) id 1Tbijz-0002Sv-6o
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 02:11:39 +0000
Received: from [85.158.138.51:53421] by server-10.bemta-3.messagelabs.com id
	53/F7-19806-A5BDEA05; Fri, 23 Nov 2012 02:11:38 +0000
X-Env-Sender: james.harper@bendigoit.com.au
X-Msg-Ref: server-7.tower-174.messagelabs.com!1353636694!22253285!1
X-Originating-IP: [203.16.207.99]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13610 invoked from network); 23 Nov 2012 02:11:37 -0000
Received: from mail.bendigoit.com.au (HELO smtp2.bendigoit.com.au)
	(203.16.207.99)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Nov 2012 02:11:37 -0000
Received: from [2001:388:e000:712:a5ca:4fd3:14f:ad5d]
	(helo=BITCOM1.int.sbss.com.au)
	by smtp2.bendigoit.com.au with esmtp (Exim 4.72)
	(envelope-from <james.harper@bendigoit.com.au>)
	id 1Tbije-0006F4-4g; Fri, 23 Nov 2012 13:11:18 +1100
Received: from BITCOM1.int.sbss.com.au ([fe80::a5ca:4fd3:14f:ad5d]) by
	BITCOM1.int.sbss.com.au ([fe80::a5ca:4fd3:14f:ad5d%12]) with mapi id
	14.01.0421.002; Fri, 23 Nov 2012 13:10:42 +1100
From: James Harper <james.harper@bendigoit.com.au>
To: ANNIE LI <annie.li@oracle.com>, Ian Campbell <Ian.Campbell@citrix.com>
Thread-Topic: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
	xen/netfront: handle compound page fragments on transmit)
Thread-Index: AQHNxzllmPJGm/TxqU+yJGXx5KCFQ5f17VQAgADChpA=
Date: Fri, 23 Nov 2012 02:10:41 +0000
Message-ID: <6035A0D088A63A46850C3988ED045A4B32C95411@BITCOM1.int.sbss.com.au>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
	<1353426878.13542.59.camel@zakaz.uk.xensource.com>
	<1353427456.13542.65.camel@zakaz.uk.xensource.com>
	<50AED1A8.30607@oracle.com>
In-Reply-To: <50AED1A8.30607@oracle.com>
Accept-Language: en-AU, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [2001:388:e000:712:3462:596e:389d:c2a6]
x-tm-as-product-ver: SMEX-10.2.0.2087-7.000.1014-19386.002
x-tm-as-result: No--47.132400-0.000000-31
x-tm-as-user-approved-sender: Yes
x-tm-as-user-blocked-sender: No
MIME-Version: 1.0
X-Really-From-Bendigo-IT: magichashvalue
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
 xen/netfront: handle compound page fragments on transmit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> 
> On 2012-11-21 0:04, Ian Campbell wrote:
> > Limiting to just xen-devel folks.
> >
> > On Tue, 2012-11-20 at 15:54 +0000, Ian Campbell wrote:
> >
> > This highlights a couple of issues, the main one is that implicitly
> > including MAX_SKB_FRAGS in the PV net protocol is just madness. It can
> > and has changed in the past. Someone really needs to (retroactively)
> > figure out what a sensible default minimum which front and back must
> > support is and use it in the front and backends instead of
> > MAX_SKB_FRAGS. Probably something derived from the existing 64K limit
> > (Linux has used 17 and 18 as MAX_SKB_FRAGS in the past).
> >
> > Then perhaps implement a feature-flag to allow front and backends to
> > negotiate something bigger if they like.
> >
> > It might also be interesting for front and backends to coalesce
> > multiple ring slots into compound pages.
> 
> Yes, MAX_SKB_FRAGS is max frag number, not max slot number required.
> But I am not so clear about the whole implementation here. Does it mean
> netfront/netback uses something like MAX_SKB_FRAGS*SLOTS_PER_FRAG?
> and SLOTS_PER_FRAG can be adjusted based on different situation? If
> netfront and netback negotiate this value, then xenstore key feature is
> required, right?
> As mentioned in another compound page fragments patch, for non-
> compound page, this value could be 64K/PAGE_SIZE + 1, but if taking account
> into compound page, the worse case is around 48 slots(in 1+4096+1 case). It
> is hard to negotiate this between netfront and netback for different packets.
> 

FWIW, Windows appears to have no real limit in its SG list, and if its >18 then netback (or linux?) just drops such packets. For a 64kb "large" packet, the buffer arrangement would likely be eth hdr + ip hdr + tcp hdr + (64K - total header size)/PAGE_SIZE + 1 frags. It would be good if the documentation of the protocol defined this limitation (which may not even exist if dom0 was something other than Linux anyway).

James

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 02:12:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 02:12:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbik1-0002T0-2W; Fri, 23 Nov 2012 02:11:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <james.harper@bendigoit.com.au>) id 1Tbijz-0002Sv-6o
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 02:11:39 +0000
Received: from [85.158.138.51:53421] by server-10.bemta-3.messagelabs.com id
	53/F7-19806-A5BDEA05; Fri, 23 Nov 2012 02:11:38 +0000
X-Env-Sender: james.harper@bendigoit.com.au
X-Msg-Ref: server-7.tower-174.messagelabs.com!1353636694!22253285!1
X-Originating-IP: [203.16.207.99]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13610 invoked from network); 23 Nov 2012 02:11:37 -0000
Received: from mail.bendigoit.com.au (HELO smtp2.bendigoit.com.au)
	(203.16.207.99)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Nov 2012 02:11:37 -0000
Received: from [2001:388:e000:712:a5ca:4fd3:14f:ad5d]
	(helo=BITCOM1.int.sbss.com.au)
	by smtp2.bendigoit.com.au with esmtp (Exim 4.72)
	(envelope-from <james.harper@bendigoit.com.au>)
	id 1Tbije-0006F4-4g; Fri, 23 Nov 2012 13:11:18 +1100
Received: from BITCOM1.int.sbss.com.au ([fe80::a5ca:4fd3:14f:ad5d]) by
	BITCOM1.int.sbss.com.au ([fe80::a5ca:4fd3:14f:ad5d%12]) with mapi id
	14.01.0421.002; Fri, 23 Nov 2012 13:10:42 +1100
From: James Harper <james.harper@bendigoit.com.au>
To: ANNIE LI <annie.li@oracle.com>, Ian Campbell <Ian.Campbell@citrix.com>
Thread-Topic: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
	xen/netfront: handle compound page fragments on transmit)
Thread-Index: AQHNxzllmPJGm/TxqU+yJGXx5KCFQ5f17VQAgADChpA=
Date: Fri, 23 Nov 2012 02:10:41 +0000
Message-ID: <6035A0D088A63A46850C3988ED045A4B32C95411@BITCOM1.int.sbss.com.au>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
	<1353426878.13542.59.camel@zakaz.uk.xensource.com>
	<1353427456.13542.65.camel@zakaz.uk.xensource.com>
	<50AED1A8.30607@oracle.com>
In-Reply-To: <50AED1A8.30607@oracle.com>
Accept-Language: en-AU, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [2001:388:e000:712:3462:596e:389d:c2a6]
x-tm-as-product-ver: SMEX-10.2.0.2087-7.000.1014-19386.002
x-tm-as-result: No--47.132400-0.000000-31
x-tm-as-user-approved-sender: Yes
x-tm-as-user-blocked-sender: No
MIME-Version: 1.0
X-Really-From-Bendigo-IT: magichashvalue
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
 xen/netfront: handle compound page fragments on transmit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> 
> On 2012-11-21 0:04, Ian Campbell wrote:
> > Limiting to just xen-devel folks.
> >
> > On Tue, 2012-11-20 at 15:54 +0000, Ian Campbell wrote:
> >
> > This highlights a couple of issues, the main one is that implicitly
> > including MAX_SKB_FRAGS in the PV net protocol is just madness. It can
> > and has changed in the past. Someone really needs to (retroactively)
> > figure out what a sensible default minimum which front and back must
> > support is and use it in the front and backends instead of
> > MAX_SKB_FRAGS. Probably something derived from the existing 64K limit
> > (Linux has used 17 and 18 as MAX_SKB_FRAGS in the past).
> >
> > Then perhaps implement a feature-flag to allow front and backends to
> > negotiate something bigger if they like.
> >
> > It might also be interesting for front and backends to coalesce
> > multiple ring slots into compound pages.
> 
> Yes, MAX_SKB_FRAGS is max frag number, not max slot number required.
> But I am not so clear about the whole implementation here. Does it mean
> netfront/netback uses something like MAX_SKB_FRAGS*SLOTS_PER_FRAG?
> and SLOTS_PER_FRAG can be adjusted based on different situation? If
> netfront and netback negotiate this value, then xenstore key feature is
> required, right?
> As mentioned in another compound page fragments patch, for non-
> compound page, this value could be 64K/PAGE_SIZE + 1, but if taking account
> into compound page, the worse case is around 48 slots(in 1+4096+1 case). It
> is hard to negotiate this between netfront and netback for different packets.
> 

FWIW, Windows appears to have no real limit in its SG list, and if its >18 then netback (or linux?) just drops such packets. For a 64kb "large" packet, the buffer arrangement would likely be eth hdr + ip hdr + tcp hdr + (64K - total header size)/PAGE_SIZE + 1 frags. It would be good if the documentation of the protocol defined this limitation (which may not even exist if dom0 was something other than Linux anyway).

James

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 06:08:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 06:08:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbmR7-0006LG-4h; Fri, 23 Nov 2012 06:08:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TbmR5-0006LB-N1
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 06:08:23 +0000
Received: from [85.158.138.51:2028] by server-2.bemta-3.messagelabs.com id
	25/7F-04744-1D21FA05; Fri, 23 Nov 2012 06:08:17 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1353650896!31064111!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14532 invoked from network); 23 Nov 2012 06:08:16 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 06:08:16 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15964872"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 06:07:17 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 23 Nov 2012 06:07:17 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TbmQ0-00077i-SZ;
	Fri, 23 Nov 2012 06:07:16 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TbmQ0-00064B-Ee;
	Fri, 23 Nov 2012 06:07:16 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14468-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 23 Nov 2012 06:07:16 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14468: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14468 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14468/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-rhel6hvm-intel 11 leak-check/check          fail pass in 14466

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14466
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14466
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14466
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14466

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  7b4449bdb980
baseline version:
 xen                  7b4449bdb980

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               fail    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 06:08:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 06:08:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbmR7-0006LG-4h; Fri, 23 Nov 2012 06:08:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TbmR5-0006LB-N1
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 06:08:23 +0000
Received: from [85.158.138.51:2028] by server-2.bemta-3.messagelabs.com id
	25/7F-04744-1D21FA05; Fri, 23 Nov 2012 06:08:17 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1353650896!31064111!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14532 invoked from network); 23 Nov 2012 06:08:16 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 06:08:16 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15964872"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 06:07:17 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 23 Nov 2012 06:07:17 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TbmQ0-00077i-SZ;
	Fri, 23 Nov 2012 06:07:16 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TbmQ0-00064B-Ee;
	Fri, 23 Nov 2012 06:07:16 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14468-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 23 Nov 2012 06:07:16 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14468: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14468 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14468/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-rhel6hvm-intel 11 leak-check/check          fail pass in 14466

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14466
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14466
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14466
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14466

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  7b4449bdb980
baseline version:
 xen                  7b4449bdb980

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               fail    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 06:51:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 06:51:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbn5s-00074H-JZ; Fri, 23 Nov 2012 06:50:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1Tbn5r-00074C-9r
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 06:50:31 +0000
Received: from [85.158.137.99:4511] by server-14.bemta-3.messagelabs.com id
	B5/3D-12788-6BC1FA05; Fri, 23 Nov 2012 06:50:30 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1353653428!17122341!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzE4Mzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12850 invoked from network); 23 Nov 2012 06:50:29 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 06:50:29 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAN6ndSO023318
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 23 Nov 2012 06:49:40 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAN6ncSL008898
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 23 Nov 2012 06:49:38 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAN6nZgs007278; Fri, 23 Nov 2012 00:49:36 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 22 Nov 2012 22:49:35 -0800
Message-ID: <50AF1C85.50604@oracle.com>
Date: Fri, 23 Nov 2012 14:49:41 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: James Harper <james.harper@bendigoit.com.au>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
	<1353426878.13542.59.camel@zakaz.uk.xensource.com>
	<1353427456.13542.65.camel@zakaz.uk.xensource.com>
	<50AED1A8.30607@oracle.com>
	<6035A0D088A63A46850C3988ED045A4B32C95411@BITCOM1.int.sbss.com.au>
In-Reply-To: <6035A0D088A63A46850C3988ED045A4B32C95411@BITCOM1.int.sbss.com.au>
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	Ian Campbell <Ian.Campbell@citrix.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
 xen/netfront: handle compound page fragments on transmit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-23 10:10, James Harper wrote:
>> On 2012-11-21 0:04, Ian Campbell wrote:
>>> Limiting to just xen-devel folks.
>>>
>>> On Tue, 2012-11-20 at 15:54 +0000, Ian Campbell wrote:
>>>
>>> This highlights a couple of issues, the main one is that implicitly
>>> including MAX_SKB_FRAGS in the PV net protocol is just madness. It can
>>> and has changed in the past. Someone really needs to (retroactively)
>>> figure out what a sensible default minimum which front and back must
>>> support is and use it in the front and backends instead of
>>> MAX_SKB_FRAGS. Probably something derived from the existing 64K limit
>>> (Linux has used 17 and 18 as MAX_SKB_FRAGS in the past).
>>>
>>> Then perhaps implement a feature-flag to allow front and backends to
>>> negotiate something bigger if they like.
>>>
>>> It might also be interesting for front and backends to coalesce
>>> multiple ring slots into compound pages.
>> Yes, MAX_SKB_FRAGS is max frag number, not max slot number required.
>> But I am not so clear about the whole implementation here. Does it mean
>> netfront/netback uses something like MAX_SKB_FRAGS*SLOTS_PER_FRAG?
>> and SLOTS_PER_FRAG can be adjusted based on different situation? If
>> netfront and netback negotiate this value, then xenstore key feature is
>> required, right?
>> As mentioned in another compound page fragments patch, for non-
>> compound page, this value could be 64K/PAGE_SIZE + 1, but if taking account
>> into compound page, the worse case is around 48 slots(in 1+4096+1 case). It
>> is hard to negotiate this between netfront and netback for different packets.
>>
> FWIW, Windows appears to have no real limit in its SG list, and if its>18 then netback (or linux?) just drops such packets.

This should be netback dropping packets in function netbk_count_requests,

                 if (unlikely(frags >= MAX_SKB_FRAGS)) {
                         netdev_dbg(vif->dev, "Too many frags\n");
                         return -frags;
                 }

> For a 64kb "large" packet, the buffer arrangement would likely be eth hdr + ip hdr + tcp hdr + (64K - total header size)/PAGE_SIZE + 1 frags. It would be good if the documentation of the protocol defined this limitation (which may not even exist if dom0 was something other than Linux anyway).
Agree.

Thanks
Annie
>
> James
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 06:51:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 06:51:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbn5s-00074H-JZ; Fri, 23 Nov 2012 06:50:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1Tbn5r-00074C-9r
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 06:50:31 +0000
Received: from [85.158.137.99:4511] by server-14.bemta-3.messagelabs.com id
	B5/3D-12788-6BC1FA05; Fri, 23 Nov 2012 06:50:30 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1353653428!17122341!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzE4Mzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12850 invoked from network); 23 Nov 2012 06:50:29 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 06:50:29 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAN6ndSO023318
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 23 Nov 2012 06:49:40 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAN6ncSL008898
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 23 Nov 2012 06:49:38 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAN6nZgs007278; Fri, 23 Nov 2012 00:49:36 -0600
Received: from [10.182.39.161] (/10.182.39.161)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 22 Nov 2012 22:49:35 -0800
Message-ID: <50AF1C85.50604@oracle.com>
Date: Fri, 23 Nov 2012 14:49:41 +0800
From: ANNIE LI <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: James Harper <james.harper@bendigoit.com.au>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
	<1353426878.13542.59.camel@zakaz.uk.xensource.com>
	<1353427456.13542.65.camel@zakaz.uk.xensource.com>
	<50AED1A8.30607@oracle.com>
	<6035A0D088A63A46850C3988ED045A4B32C95411@BITCOM1.int.sbss.com.au>
In-Reply-To: <6035A0D088A63A46850C3988ED045A4B32C95411@BITCOM1.int.sbss.com.au>
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	Ian Campbell <Ian.Campbell@citrix.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
 xen/netfront: handle compound page fragments on transmit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-23 10:10, James Harper wrote:
>> On 2012-11-21 0:04, Ian Campbell wrote:
>>> Limiting to just xen-devel folks.
>>>
>>> On Tue, 2012-11-20 at 15:54 +0000, Ian Campbell wrote:
>>>
>>> This highlights a couple of issues, the main one is that implicitly
>>> including MAX_SKB_FRAGS in the PV net protocol is just madness. It can
>>> and has changed in the past. Someone really needs to (retroactively)
>>> figure out what a sensible default minimum which front and back must
>>> support is and use it in the front and backends instead of
>>> MAX_SKB_FRAGS. Probably something derived from the existing 64K limit
>>> (Linux has used 17 and 18 as MAX_SKB_FRAGS in the past).
>>>
>>> Then perhaps implement a feature-flag to allow front and backends to
>>> negotiate something bigger if they like.
>>>
>>> It might also be interesting for front and backends to coalesce
>>> multiple ring slots into compound pages.
>> Yes, MAX_SKB_FRAGS is max frag number, not max slot number required.
>> But I am not so clear about the whole implementation here. Does it mean
>> netfront/netback uses something like MAX_SKB_FRAGS*SLOTS_PER_FRAG?
>> and SLOTS_PER_FRAG can be adjusted based on different situation? If
>> netfront and netback negotiate this value, then xenstore key feature is
>> required, right?
>> As mentioned in another compound page fragments patch, for non-
>> compound page, this value could be 64K/PAGE_SIZE + 1, but if taking account
>> into compound page, the worse case is around 48 slots(in 1+4096+1 case). It
>> is hard to negotiate this between netfront and netback for different packets.
>>
> FWIW, Windows appears to have no real limit in its SG list, and if its>18 then netback (or linux?) just drops such packets.

This should be netback dropping packets in function netbk_count_requests,

                 if (unlikely(frags >= MAX_SKB_FRAGS)) {
                         netdev_dbg(vif->dev, "Too many frags\n");
                         return -frags;
                 }

> For a 64kb "large" packet, the buffer arrangement would likely be eth hdr + ip hdr + tcp hdr + (64K - total header size)/PAGE_SIZE + 1 frags. It would be good if the documentation of the protocol defined this limitation (which may not even exist if dom0 was something other than Linux anyway).
Agree.

Thanks
Annie
>
> James
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:12:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:12:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbpIO-0001d3-BW; Fri, 23 Nov 2012 09:11:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <louis.bouchard@canonical.com>) id 1TboCN-0000Yi-5A
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 08:01:19 +0000
Received: from [85.158.139.83:10875] by server-12.bemta-5.messagelabs.com id
	A7/8F-02886-E4D2FA05; Fri, 23 Nov 2012 08:01:18 +0000
X-Env-Sender: louis.bouchard@canonical.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353657677!20291356!1
X-Originating-IP: [91.189.89.112]
X-SpamReason: No, hits=2.3 required=7.0 tests=BODY_RANDOM_LONG,
	RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14788 invoked from network); 23 Nov 2012 08:01:17 -0000
Received: from youngberry.canonical.com (HELO youngberry.canonical.com)
	(91.189.89.112) by server-8.tower-182.messagelabs.com with SMTP;
	23 Nov 2012 08:01:17 -0000
Received: from 22.77.194.77.rev.sfr.net ([77.194.77.22] helo=[16.1.1.20])
	by youngberry.canonical.com with esmtpsa
	(TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71)
	(envelope-from <louis.bouchard@canonical.com>)
	id 1TboCC-0008TK-OO; Fri, 23 Nov 2012 08:01:10 +0000
Message-ID: <50AF2D42.8000707@canonical.com>
Date: Fri, 23 Nov 2012 09:01:06 +0100
From: Bouchard Louis <louis.bouchard@canonical.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Andrew Cooper <andrew.cooper3@citrix.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
	<18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
	<50AED7B8.7040902@citrix.com>
In-Reply-To: <50AED7B8.7040902@citrix.com>
X-Enigmail-Version: 1.4.6
X-TagToolbar-Keys: D20121123090106702
X-Mailman-Approved-At: Fri, 23 Nov 2012 09:11:34 +0000
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Daniel Kiper <daniel.kiper@oracle.com>, "x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>, "H. Peter Anvin" <hpa@zytor.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

Le 23/11/2012 02:56, Andrew Cooper a =E9crit :
> For within-guest kexec/kdump functionality, I agree that it is barking
> mad.  However, we do see cloud operators interested in the idea so VM
> administrators can look after their crashes themselves.

It's not "barking mad" when your dayjob is to investigate and fix other
people's kernel problems.  Right now, it's impossible to get a kernel
image of a failing EC2 instance, so every time someone shows up with a
"my kernel crashes in my instance", we're lest with mostly unusable
backtraces and oops messages.

When I'm able to reproduce someone's kernel panic, I'm quite happy to be
able to use virtualization to run a kernel dump analysis on a locally
reproduced context.

It's also quite useful when packaging things like makedumpfile,
kdump-tools to be able to avoid having to rely on bare metal to test new
releases. So yes, in theory it may look barking mad, but real life is
somewhat different.

Kind regards,

...Louis
-- =

Louis Bouchard
Backline Support Analyst
Canonical Ltd
Ubuntu support: http://landscape.canonical.com

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:12:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:12:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbpIO-0001d3-BW; Fri, 23 Nov 2012 09:11:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <louis.bouchard@canonical.com>) id 1TboCN-0000Yi-5A
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 08:01:19 +0000
Received: from [85.158.139.83:10875] by server-12.bemta-5.messagelabs.com id
	A7/8F-02886-E4D2FA05; Fri, 23 Nov 2012 08:01:18 +0000
X-Env-Sender: louis.bouchard@canonical.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353657677!20291356!1
X-Originating-IP: [91.189.89.112]
X-SpamReason: No, hits=2.3 required=7.0 tests=BODY_RANDOM_LONG,
	RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14788 invoked from network); 23 Nov 2012 08:01:17 -0000
Received: from youngberry.canonical.com (HELO youngberry.canonical.com)
	(91.189.89.112) by server-8.tower-182.messagelabs.com with SMTP;
	23 Nov 2012 08:01:17 -0000
Received: from 22.77.194.77.rev.sfr.net ([77.194.77.22] helo=[16.1.1.20])
	by youngberry.canonical.com with esmtpsa
	(TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71)
	(envelope-from <louis.bouchard@canonical.com>)
	id 1TboCC-0008TK-OO; Fri, 23 Nov 2012 08:01:10 +0000
Message-ID: <50AF2D42.8000707@canonical.com>
Date: Fri, 23 Nov 2012 09:01:06 +0100
From: Bouchard Louis <louis.bouchard@canonical.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Andrew Cooper <andrew.cooper3@citrix.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
	<18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
	<50AED7B8.7040902@citrix.com>
In-Reply-To: <50AED7B8.7040902@citrix.com>
X-Enigmail-Version: 1.4.6
X-TagToolbar-Keys: D20121123090106702
X-Mailman-Approved-At: Fri, 23 Nov 2012 09:11:34 +0000
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Daniel Kiper <daniel.kiper@oracle.com>, "x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>, "H. Peter Anvin" <hpa@zytor.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

Le 23/11/2012 02:56, Andrew Cooper a =E9crit :
> For within-guest kexec/kdump functionality, I agree that it is barking
> mad.  However, we do see cloud operators interested in the idea so VM
> administrators can look after their crashes themselves.

It's not "barking mad" when your dayjob is to investigate and fix other
people's kernel problems.  Right now, it's impossible to get a kernel
image of a failing EC2 instance, so every time someone shows up with a
"my kernel crashes in my instance", we're lest with mostly unusable
backtraces and oops messages.

When I'm able to reproduce someone's kernel panic, I'm quite happy to be
able to use virtualization to run a kernel dump analysis on a locally
reproduced context.

It's also quite useful when packaging things like makedumpfile,
kdump-tools to be able to avoid having to rely on bare metal to test new
releases. So yes, in theory it may look barking mad, but real life is
somewhat different.

Kind regards,

...Louis
-- =

Louis Bouchard
Backline Support Analyst
Canonical Ltd
Ubuntu support: http://landscape.canonical.com

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:19:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:19:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbpPS-0001na-E6; Fri, 23 Nov 2012 09:18:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbpPQ-0001nV-HJ
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 09:18:52 +0000
Received: from [85.158.139.211:15292] by server-16.bemta-5.messagelabs.com id
	55/4B-04786-B7F3FA05; Fri, 23 Nov 2012 09:18:51 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1353662330!19268881!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20257 invoked from network); 23 Nov 2012 09:18:51 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 09:18:51 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15967344"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 09:18:50 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 09:18:50 +0000
Message-ID: <1353662328.13542.173.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: ANNIE LI <annie.li@oracle.com>
Date: Fri, 23 Nov 2012 09:18:48 +0000
In-Reply-To: <50AED1A8.30607@oracle.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
	<1353426878.13542.59.camel@zakaz.uk.xensource.com>
	<1353427456.13542.65.camel@zakaz.uk.xensource.com>
	<50AED1A8.30607@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
 xen/netfront: handle compound page fragments on transmit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 01:30 +0000, ANNIE LI wrote:
> 
> On 2012-11-21 0:04, Ian Campbell wrote:
> > Limiting to just xen-devel folks.
> >
> > On Tue, 2012-11-20 at 15:54 +0000, Ian Campbell wrote:
> >
> > This highlights a couple of issues, the main one is that implicitly
> > including MAX_SKB_FRAGS in the PV net protocol is just madness. It can
> > and has changed in the past. Someone really needs to (retroactively)
> > figure out what a sensible default minimum which front and back must
> > support is and use it in the front and backends instead of
> > MAX_SKB_FRAGS. Probably something derived from the existing 64K limit
> > (Linux has used 17 and 18 as MAX_SKB_FRAGS in the past).
> >
> > Then perhaps implement a feature-flag to allow front and backends to
> > negotiate something bigger if they like.
> >
> > It might also be interesting for front and backends to coalesce multiple
> > ring slots into compound pages.
> 
> Yes, MAX_SKB_FRAGS is max frag number, not max slot number required.
> But I am not so clear about the whole implementation here. Does it mean 
> netfront/netback uses something like MAX_SKB_FRAGS*SLOTS_PER_FRAG?

I suppose that's one way of looking at it. SLOTS_PER_FRAG is 1 in the
current Linux implementation.

But really MAX_SKB_FRAGS (and the concept of frags generally, although I
suspect most OSes have something equivalent in their SG mechanism) is a
Linux-ism which has leaked into the protocol. A non-Linux front or
backend might support more or less and have to jump through hoops to
remain compatible with the Linux versions.

So actually maybe it's better to think in terms of MAX_SLOTS_PER_FRAME
with no reference to frags at all. Currently MAX_SLOTS_PER_FRAME ==
MAX_SKB_FRAGS for the Linux implementation of front/back. This has
leaked into the protocol, since Linux is the most commonly used backend,
and so we've placed additional requirements onto non-Linux front and
backends.

>  and 
> SLOTS_PER_FRAG can be adjusted based on different situation? If netfront 
> and netback negotiate this value, then xenstore key feature is required, 
> right?

Yes.

> As mentioned in another compound page fragments patch, for non-compound 
> page, this value could be 64K/PAGE_SIZE + 1, but if taking account into 
> compound page, the worse case is around 48 slots(in 1+4096+1 case).

That's for order 5 compound pages, 

> It is hard to negotiate this between netfront and netback for different 
> packets.

You wouldn't negotiate for each packet, you would negotiate at start of
day.

You'd also need some sort of fallback for the case where you end up
negotiating something smaller than the maximum your upper layer network
stack might give you. I suppose you'd have to do segmentation somewhere
along the line. (We have this problem now, and the Linux implementation
just ignores it and drops the frames.)

Ian.

> 
> Thanks
> Annie
> > I don't have time for either of those unfortunately
> >
> > Ian.
> >
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:19:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:19:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbpPS-0001na-E6; Fri, 23 Nov 2012 09:18:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbpPQ-0001nV-HJ
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 09:18:52 +0000
Received: from [85.158.139.211:15292] by server-16.bemta-5.messagelabs.com id
	55/4B-04786-B7F3FA05; Fri, 23 Nov 2012 09:18:51 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1353662330!19268881!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20257 invoked from network); 23 Nov 2012 09:18:51 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 09:18:51 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15967344"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 09:18:50 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 09:18:50 +0000
Message-ID: <1353662328.13542.173.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: ANNIE LI <annie.li@oracle.com>
Date: Fri, 23 Nov 2012 09:18:48 +0000
In-Reply-To: <50AED1A8.30607@oracle.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
	<1353426878.13542.59.camel@zakaz.uk.xensource.com>
	<1353427456.13542.65.camel@zakaz.uk.xensource.com>
	<50AED1A8.30607@oracle.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
 xen/netfront: handle compound page fragments on transmit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 01:30 +0000, ANNIE LI wrote:
> 
> On 2012-11-21 0:04, Ian Campbell wrote:
> > Limiting to just xen-devel folks.
> >
> > On Tue, 2012-11-20 at 15:54 +0000, Ian Campbell wrote:
> >
> > This highlights a couple of issues, the main one is that implicitly
> > including MAX_SKB_FRAGS in the PV net protocol is just madness. It can
> > and has changed in the past. Someone really needs to (retroactively)
> > figure out what a sensible default minimum which front and back must
> > support is and use it in the front and backends instead of
> > MAX_SKB_FRAGS. Probably something derived from the existing 64K limit
> > (Linux has used 17 and 18 as MAX_SKB_FRAGS in the past).
> >
> > Then perhaps implement a feature-flag to allow front and backends to
> > negotiate something bigger if they like.
> >
> > It might also be interesting for front and backends to coalesce multiple
> > ring slots into compound pages.
> 
> Yes, MAX_SKB_FRAGS is max frag number, not max slot number required.
> But I am not so clear about the whole implementation here. Does it mean 
> netfront/netback uses something like MAX_SKB_FRAGS*SLOTS_PER_FRAG?

I suppose that's one way of looking at it. SLOTS_PER_FRAG is 1 in the
current Linux implementation.

But really MAX_SKB_FRAGS (and the concept of frags generally, although I
suspect most OSes have something equivalent in their SG mechanism) is a
Linux-ism which has leaked into the protocol. A non-Linux front or
backend might support more or less and have to jump through hoops to
remain compatible with the Linux versions.

So actually maybe it's better to think in terms of MAX_SLOTS_PER_FRAME
with no reference to frags at all. Currently MAX_SLOTS_PER_FRAME ==
MAX_SKB_FRAGS for the Linux implementation of front/back. This has
leaked into the protocol, since Linux is the most commonly used backend,
and so we've placed additional requirements onto non-Linux front and
backends.

>  and 
> SLOTS_PER_FRAG can be adjusted based on different situation? If netfront 
> and netback negotiate this value, then xenstore key feature is required, 
> right?

Yes.

> As mentioned in another compound page fragments patch, for non-compound 
> page, this value could be 64K/PAGE_SIZE + 1, but if taking account into 
> compound page, the worse case is around 48 slots(in 1+4096+1 case).

That's for order 5 compound pages, 

> It is hard to negotiate this between netfront and netback for different 
> packets.

You wouldn't negotiate for each packet, you would negotiate at start of
day.

You'd also need some sort of fallback for the case where you end up
negotiating something smaller than the maximum your upper layer network
stack might give you. I suppose you'd have to do segmentation somewhere
along the line. (We have this problem now, and the Linux implementation
just ignores it and drops the frames.)

Ian.

> 
> Thanks
> Annie
> > I don't have time for either of those unfortunately
> >
> > Ian.
> >
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:22:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:22:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbpSw-00023P-2x; Fri, 23 Nov 2012 09:22:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Paul.Durrant@citrix.com>) id 1TbpSu-00023J-MP
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 09:22:28 +0000
Received: from [85.158.137.99:18909] by server-12.bemta-3.messagelabs.com id
	49/E5-22757-3504FA05; Fri, 23 Nov 2012 09:22:27 +0000
X-Env-Sender: Paul.Durrant@citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1353662545!17141374!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8412 invoked from network); 23 Nov 2012 09:22:27 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 09:22:27 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15967425"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 09:21:53 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Fri, 23 Nov 2012
	09:21:43 +0000
From: Paul Durrant <Paul.Durrant@citrix.com>
To: James Harper <james.harper@bendigoit.com.au>, ANNIE LI
	<annie.li@oracle.com>, Ian Campbell <Ian.Campbell@citrix.com>
Date: Fri, 23 Nov 2012 09:22:28 +0000
Thread-Topic: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
	xen/netfront: handle compound page fragments on transmit)
Thread-Index: AQHNxzllmPJGm/TxqU+yJGXx5KCFQ5f17VQAgADChpCAAHldIA==
Message-ID: <291EDFCB1E9E224A99088639C4762022011052FE3434@LONPMAILBOX01.citrite.net>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
	<1353426878.13542.59.camel@zakaz.uk.xensource.com>
	<1353427456.13542.65.camel@zakaz.uk.xensource.com>
	<50AED1A8.30607@oracle.com>
	<6035A0D088A63A46850C3988ED045A4B32C95411@BITCOM1.int.sbss.com.au>
In-Reply-To: <6035A0D088A63A46850C3988ED045A4B32C95411@BITCOM1.int.sbss.com.au>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
 xen/netfront: handle compound page fragments on transmit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> -----Original Message-----
> From: xen-devel-bounces@lists.xen.org [mailto:xen-devel-
> bounces@lists.xen.org] On Behalf Of James Harper
> Sent: 23 November 2012 02:11
> To: ANNIE LI; Ian Campbell
> Cc: KonradRzeszutekWilk; xen-devel
> Subject: Re: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
> xen/netfront: handle compound page fragments on transmit)
> 
> >
> > On 2012-11-21 0:04, Ian Campbell wrote:
> > > Limiting to just xen-devel folks.
> > >
> > > On Tue, 2012-11-20 at 15:54 +0000, Ian Campbell wrote:
> > >
> > > This highlights a couple of issues, the main one is that implicitly
> > > including MAX_SKB_FRAGS in the PV net protocol is just madness. It
> > > can and has changed in the past. Someone really needs to
> > > (retroactively) figure out what a sensible default minimum which
> > > front and back must support is and use it in the front and backends
> > > instead of MAX_SKB_FRAGS. Probably something derived from the
> > > existing 64K limit (Linux has used 17 and 18 as MAX_SKB_FRAGS in the
> past).
> > >
> > > Then perhaps implement a feature-flag to allow front and backends to
> > > negotiate something bigger if they like.
> > >
> > > It might also be interesting for front and backends to coalesce
> > > multiple ring slots into compound pages.
> >
> > Yes, MAX_SKB_FRAGS is max frag number, not max slot number required.
> > But I am not so clear about the whole implementation here. Does it
> > mean netfront/netback uses something like
> MAX_SKB_FRAGS*SLOTS_PER_FRAG?
> > and SLOTS_PER_FRAG can be adjusted based on different situation? If
> > netfront and netback negotiate this value, then xenstore key feature
> > is required, right?
> > As mentioned in another compound page fragments patch, for non-
> > compound page, this value could be 64K/PAGE_SIZE + 1, but if taking
> > account into compound page, the worse case is around 48 slots(in
> > 1+4096+1 case). It is hard to negotiate this between netfront and netback
> for different packets.
> >
> 
> FWIW, Windows appears to have no real limit in its SG list, and if its >18 then
> netback (or linux?) just drops such packets. For a 64kb "large" packet, the
> buffer arrangement would likely be eth hdr + ip hdr + tcp hdr + (64K - total
> header size)/PAGE_SIZE + 1 frags. It would be good if the documentation of
> the protocol defined this limitation (which may not even exist if dom0 was
> something other than Linux anyway).
> 

Given that it's a backend limitation and not a protocol limitation then it's probably not for documentation to define. Instead it may be more useful if the protocol itself allowed the backend to notify the frontend of its fragmentation constraints (and probably vice versa).

  Paul

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:22:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:22:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbpSw-00023P-2x; Fri, 23 Nov 2012 09:22:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Paul.Durrant@citrix.com>) id 1TbpSu-00023J-MP
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 09:22:28 +0000
Received: from [85.158.137.99:18909] by server-12.bemta-3.messagelabs.com id
	49/E5-22757-3504FA05; Fri, 23 Nov 2012 09:22:27 +0000
X-Env-Sender: Paul.Durrant@citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1353662545!17141374!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8412 invoked from network); 23 Nov 2012 09:22:27 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 09:22:27 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15967425"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 09:21:53 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Fri, 23 Nov 2012
	09:21:43 +0000
From: Paul Durrant <Paul.Durrant@citrix.com>
To: James Harper <james.harper@bendigoit.com.au>, ANNIE LI
	<annie.li@oracle.com>, Ian Campbell <Ian.Campbell@citrix.com>
Date: Fri, 23 Nov 2012 09:22:28 +0000
Thread-Topic: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
	xen/netfront: handle compound page fragments on transmit)
Thread-Index: AQHNxzllmPJGm/TxqU+yJGXx5KCFQ5f17VQAgADChpCAAHldIA==
Message-ID: <291EDFCB1E9E224A99088639C4762022011052FE3434@LONPMAILBOX01.citrite.net>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
	<1353426878.13542.59.camel@zakaz.uk.xensource.com>
	<1353427456.13542.65.camel@zakaz.uk.xensource.com>
	<50AED1A8.30607@oracle.com>
	<6035A0D088A63A46850C3988ED045A4B32C95411@BITCOM1.int.sbss.com.au>
In-Reply-To: <6035A0D088A63A46850C3988ED045A4B32C95411@BITCOM1.int.sbss.com.au>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
 xen/netfront: handle compound page fragments on transmit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> -----Original Message-----
> From: xen-devel-bounces@lists.xen.org [mailto:xen-devel-
> bounces@lists.xen.org] On Behalf Of James Harper
> Sent: 23 November 2012 02:11
> To: ANNIE LI; Ian Campbell
> Cc: KonradRzeszutekWilk; xen-devel
> Subject: Re: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
> xen/netfront: handle compound page fragments on transmit)
> 
> >
> > On 2012-11-21 0:04, Ian Campbell wrote:
> > > Limiting to just xen-devel folks.
> > >
> > > On Tue, 2012-11-20 at 15:54 +0000, Ian Campbell wrote:
> > >
> > > This highlights a couple of issues, the main one is that implicitly
> > > including MAX_SKB_FRAGS in the PV net protocol is just madness. It
> > > can and has changed in the past. Someone really needs to
> > > (retroactively) figure out what a sensible default minimum which
> > > front and back must support is and use it in the front and backends
> > > instead of MAX_SKB_FRAGS. Probably something derived from the
> > > existing 64K limit (Linux has used 17 and 18 as MAX_SKB_FRAGS in the
> past).
> > >
> > > Then perhaps implement a feature-flag to allow front and backends to
> > > negotiate something bigger if they like.
> > >
> > > It might also be interesting for front and backends to coalesce
> > > multiple ring slots into compound pages.
> >
> > Yes, MAX_SKB_FRAGS is max frag number, not max slot number required.
> > But I am not so clear about the whole implementation here. Does it
> > mean netfront/netback uses something like
> MAX_SKB_FRAGS*SLOTS_PER_FRAG?
> > and SLOTS_PER_FRAG can be adjusted based on different situation? If
> > netfront and netback negotiate this value, then xenstore key feature
> > is required, right?
> > As mentioned in another compound page fragments patch, for non-
> > compound page, this value could be 64K/PAGE_SIZE + 1, but if taking
> > account into compound page, the worse case is around 48 slots(in
> > 1+4096+1 case). It is hard to negotiate this between netfront and netback
> for different packets.
> >
> 
> FWIW, Windows appears to have no real limit in its SG list, and if its >18 then
> netback (or linux?) just drops such packets. For a 64kb "large" packet, the
> buffer arrangement would likely be eth hdr + ip hdr + tcp hdr + (64K - total
> header size)/PAGE_SIZE + 1 frags. It would be good if the documentation of
> the protocol defined this limitation (which may not even exist if dom0 was
> something other than Linux anyway).
> 

Given that it's a backend limitation and not a protocol limitation then it's probably not for documentation to define. Instead it may be more useful if the protocol itself allowed the backend to notify the frontend of its fragmentation constraints (and probably vice versa).

  Paul

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:27:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:27:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbpXR-0002Cq-Pg; Fri, 23 Nov 2012 09:27:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <james.harper@bendigoit.com.au>) id 1TbpXP-0002Ci-WA
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 09:27:08 +0000
Received: from [85.158.139.211:43637] by server-16.bemta-5.messagelabs.com id
	F4/CB-04786-B614FA05; Fri, 23 Nov 2012 09:27:07 +0000
X-Env-Sender: james.harper@bendigoit.com.au
X-Msg-Ref: server-8.tower-206.messagelabs.com!1353662823!19298664!1
X-Originating-IP: [203.16.207.99]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18339 invoked from network); 23 Nov 2012 09:27:06 -0000
Received: from smtp2.bendigoit.com.au (HELO smtp2.bendigoit.com.au)
	(203.16.207.99)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Nov 2012 09:27:06 -0000
Received: from [2001:388:e000:712:a5ca:4fd3:14f:ad5d]
	(helo=BITCOM1.int.sbss.com.au)
	by smtp2.bendigoit.com.au with esmtp (Exim 4.72)
	(envelope-from <james.harper@bendigoit.com.au>)
	id 1TbpXC-0007VG-6z; Fri, 23 Nov 2012 20:26:54 +1100
Received: from BITCOM1.int.sbss.com.au ([fe80::a5ca:4fd3:14f:ad5d]) by
	BITCOM1.int.sbss.com.au ([fe80::a5ca:4fd3:14f:ad5d%12]) with mapi id
	14.01.0421.002; Fri, 23 Nov 2012 20:26:18 +1100
From: James Harper <james.harper@bendigoit.com.au>
To: Paul Durrant <Paul.Durrant@citrix.com>, ANNIE LI <annie.li@oracle.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Thread-Topic: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
	xen/netfront: handle compound page fragments on transmit)
Thread-Index: AQHNxzllmPJGm/TxqU+yJGXx5KCFQ5f17VQAgADChpCAAHldIIAAAMqA
Date: Fri, 23 Nov 2012 09:26:17 +0000
Message-ID: <6035A0D088A63A46850C3988ED045A4B32C9712D@BITCOM1.int.sbss.com.au>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
	<1353426878.13542.59.camel@zakaz.uk.xensource.com>
	<1353427456.13542.65.camel@zakaz.uk.xensource.com>
	<50AED1A8.30607@oracle.com>
	<6035A0D088A63A46850C3988ED045A4B32C95411@BITCOM1.int.sbss.com.au>
	<291EDFCB1E9E224A99088639C4762022011052FE3434@LONPMAILBOX01.citrite.net>
In-Reply-To: <291EDFCB1E9E224A99088639C4762022011052FE3434@LONPMAILBOX01.citrite.net>
Accept-Language: en-AU, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [203.193.205.129]
x-tm-as-product-ver: SMEX-10.2.0.2087-7.000.1014-19388.001
x-tm-as-result: No--27.474500-0.000000-31
x-tm-as-user-approved-sender: Yes
x-tm-as-user-blocked-sender: No
MIME-Version: 1.0
X-Really-From-Bendigo-IT: magichashvalue
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
 xen/netfront: handle compound page fragments on transmit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> 
> Given that it's a backend limitation and not a protocol limitation then it's
> probably not for documentation to define. Instead it may be more useful if
> the protocol itself allowed the backend to notify the frontend of its
> fragmentation constraints (and probably vice versa).
> 

That would be good. It would have been nice if the feature-sg defined the maximum number of fragments but I guess that can't be changed now without breaking backwards compatibility.

James

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:27:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:27:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbpXR-0002Cq-Pg; Fri, 23 Nov 2012 09:27:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <james.harper@bendigoit.com.au>) id 1TbpXP-0002Ci-WA
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 09:27:08 +0000
Received: from [85.158.139.211:43637] by server-16.bemta-5.messagelabs.com id
	F4/CB-04786-B614FA05; Fri, 23 Nov 2012 09:27:07 +0000
X-Env-Sender: james.harper@bendigoit.com.au
X-Msg-Ref: server-8.tower-206.messagelabs.com!1353662823!19298664!1
X-Originating-IP: [203.16.207.99]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18339 invoked from network); 23 Nov 2012 09:27:06 -0000
Received: from smtp2.bendigoit.com.au (HELO smtp2.bendigoit.com.au)
	(203.16.207.99)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Nov 2012 09:27:06 -0000
Received: from [2001:388:e000:712:a5ca:4fd3:14f:ad5d]
	(helo=BITCOM1.int.sbss.com.au)
	by smtp2.bendigoit.com.au with esmtp (Exim 4.72)
	(envelope-from <james.harper@bendigoit.com.au>)
	id 1TbpXC-0007VG-6z; Fri, 23 Nov 2012 20:26:54 +1100
Received: from BITCOM1.int.sbss.com.au ([fe80::a5ca:4fd3:14f:ad5d]) by
	BITCOM1.int.sbss.com.au ([fe80::a5ca:4fd3:14f:ad5d%12]) with mapi id
	14.01.0421.002; Fri, 23 Nov 2012 20:26:18 +1100
From: James Harper <james.harper@bendigoit.com.au>
To: Paul Durrant <Paul.Durrant@citrix.com>, ANNIE LI <annie.li@oracle.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Thread-Topic: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
	xen/netfront: handle compound page fragments on transmit)
Thread-Index: AQHNxzllmPJGm/TxqU+yJGXx5KCFQ5f17VQAgADChpCAAHldIIAAAMqA
Date: Fri, 23 Nov 2012 09:26:17 +0000
Message-ID: <6035A0D088A63A46850C3988ED045A4B32C9712D@BITCOM1.int.sbss.com.au>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
	<1353426878.13542.59.camel@zakaz.uk.xensource.com>
	<1353427456.13542.65.camel@zakaz.uk.xensource.com>
	<50AED1A8.30607@oracle.com>
	<6035A0D088A63A46850C3988ED045A4B32C95411@BITCOM1.int.sbss.com.au>
	<291EDFCB1E9E224A99088639C4762022011052FE3434@LONPMAILBOX01.citrite.net>
In-Reply-To: <291EDFCB1E9E224A99088639C4762022011052FE3434@LONPMAILBOX01.citrite.net>
Accept-Language: en-AU, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [203.193.205.129]
x-tm-as-product-ver: SMEX-10.2.0.2087-7.000.1014-19388.001
x-tm-as-result: No--27.474500-0.000000-31
x-tm-as-user-approved-sender: Yes
x-tm-as-user-blocked-sender: No
MIME-Version: 1.0
X-Really-From-Bendigo-IT: magichashvalue
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
 xen/netfront: handle compound page fragments on transmit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> 
> Given that it's a backend limitation and not a protocol limitation then it's
> probably not for documentation to define. Instead it may be more useful if
> the protocol itself allowed the backend to notify the frontend of its
> fragmentation constraints (and probably vice versa).
> 

That would be good. It would have been nice if the feature-sg defined the maximum number of fragments but I guess that can't be changed now without breaking backwards compatibility.

James

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:34:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:34:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbpeP-0002Vl-MT; Fri, 23 Nov 2012 09:34:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbpeN-0002Vc-Mr
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 09:34:19 +0000
Received: from [85.158.139.211:27693] by server-3.bemta-5.messagelabs.com id
	5D/47-18736-A134FA05; Fri, 23 Nov 2012 09:34:18 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1353663258!21233839!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1591 invoked from network); 23 Nov 2012 09:34:18 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 09:34:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15967735"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 09:34:18 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 09:34:17 +0000
Message-ID: <1353663256.13542.179.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: James Harper <james.harper@bendigoit.com.au>
Date: Fri, 23 Nov 2012 09:34:16 +0000
In-Reply-To: <6035A0D088A63A46850C3988ED045A4B32C9712D@BITCOM1.int.sbss.com.au>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
	<1353426878.13542.59.camel@zakaz.uk.xensource.com>
	<1353427456.13542.65.camel@zakaz.uk.xensource.com>
	<50AED1A8.30607@oracle.com>
	<6035A0D088A63A46850C3988ED045A4B32C95411@BITCOM1.int.sbss.com.au>
	<291EDFCB1E9E224A99088639C4762022011052FE3434@LONPMAILBOX01.citrite.net>
	<6035A0D088A63A46850C3988ED045A4B32C9712D@BITCOM1.int.sbss.com.au>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: KonradRzeszutekWilk <konrad@kernel.org>, ANNIE LI <annie.li@oracle.com>,
	Paul Durrant <Paul.Durrant@citrix.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
 xen/netfront: handle compound page fragments on transmit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 09:26 +0000, James Harper wrote:
> > 
> > Given that it's a backend limitation and not a protocol limitation then it's
> > probably not for documentation to define. Instead it may be more useful if
> > the protocol itself allowed the backend to notify the frontend of its
> > fragmentation constraints (and probably vice versa).
> > 
> 
> That would be good. It would have been nice if the feature-sg defined
> the maximum number of fragments but I guess that can't be changed now
> without breaking backwards compatibility.

We could add such a node, with the default in its absence being whatever
to status quo is right now (16..18 slots per frame, whatever it actually
is).

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:34:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:34:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbpeP-0002Vl-MT; Fri, 23 Nov 2012 09:34:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbpeN-0002Vc-Mr
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 09:34:19 +0000
Received: from [85.158.139.211:27693] by server-3.bemta-5.messagelabs.com id
	5D/47-18736-A134FA05; Fri, 23 Nov 2012 09:34:18 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1353663258!21233839!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1591 invoked from network); 23 Nov 2012 09:34:18 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 09:34:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15967735"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 09:34:18 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 09:34:17 +0000
Message-ID: <1353663256.13542.179.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: James Harper <james.harper@bendigoit.com.au>
Date: Fri, 23 Nov 2012 09:34:16 +0000
In-Reply-To: <6035A0D088A63A46850C3988ED045A4B32C9712D@BITCOM1.int.sbss.com.au>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
	<1353426878.13542.59.camel@zakaz.uk.xensource.com>
	<1353427456.13542.65.camel@zakaz.uk.xensource.com>
	<50AED1A8.30607@oracle.com>
	<6035A0D088A63A46850C3988ED045A4B32C95411@BITCOM1.int.sbss.com.au>
	<291EDFCB1E9E224A99088639C4762022011052FE3434@LONPMAILBOX01.citrite.net>
	<6035A0D088A63A46850C3988ED045A4B32C9712D@BITCOM1.int.sbss.com.au>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: KonradRzeszutekWilk <konrad@kernel.org>, ANNIE LI <annie.li@oracle.com>,
	Paul Durrant <Paul.Durrant@citrix.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
 xen/netfront: handle compound page fragments on transmit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 09:26 +0000, James Harper wrote:
> > 
> > Given that it's a backend limitation and not a protocol limitation then it's
> > probably not for documentation to define. Instead it may be more useful if
> > the protocol itself allowed the backend to notify the frontend of its
> > fragmentation constraints (and probably vice versa).
> > 
> 
> That would be good. It would have been nice if the feature-sg defined
> the maximum number of fragments but I guess that can't be changed now
> without breaking backwards compatibility.

We could add such a node, with the default in its absence being whatever
to status quo is right now (16..18 slots per frame, whatever it actually
is).

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:44:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:44:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbpnW-0002o1-N2; Fri, 23 Nov 2012 09:43:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbpnU-0002nw-Sm
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 09:43:45 +0000
Received: from [85.158.143.99:36881] by server-3.bemta-4.messagelabs.com id
	4E/9B-06841-0554FA05; Fri, 23 Nov 2012 09:43:44 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1353663823!19868078!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26542 invoked from network); 23 Nov 2012 09:43:43 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 09:43:43 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15968009"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 09:43:43 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 09:43:43 +0000
Message-ID: <1353663822.13542.183.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Bamvor Jian Zhang <bjzhang@suse.com>
Date: Fri, 23 Nov 2012 09:43:42 +0000
In-Reply-To: <0451e6041bdd88c90eee.1353395794@linux-bjrd.bjz>
References: <0451e6041bdd88c90eee.1353395794@linux-bjrd.bjz>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "jfehlig@suse.com" <jfehlig@suse.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] fix race condition between libvirtd event
 handling and libxl fd deregister
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 07:16 +0000, Bamvor Jian Zhang wrote:
> the race condition may be encounted at the following senaro:
> (1), xenlight will remove fd handle just after the transfer is done according to
> the buffer pointer. This action will first mark fd handle deleted in libvirtd
> then remove fd handler from list in libxl. To mark the fd deleted in libvirtd,
> the libvirt event loop mutex must be acquired.
> 
> (2), meanwhile in the libvirt event dispatch process, libvirt will check the fd
> deleted flag while holding the event loop mutex. At this time, "(1)" may be
> blocked from marking the deleted flag. Then libvirt release its mutex temperary
> to run the dispatcher callback. But this callback need xenlight lock(CTX_LOCK)
> which is held by xenlight fd deregister function. So, libvirtd will continue to
> run this callback after fd deregister exit which means xenlight has been marked
> deleted flag, removed this fd handler and set ev->fd as -1. after
> libxl__ev_fd_deregister exit, it is time for callback running. but
> unfortunately, this callback has been removed as I mentioned above.
> 
> reference the following graph:
> libvirt event dispatch                  xenlight transfer done
>        |                              enter libxl__ev_fd_deregister
>        |                                     CTX_LOCK
>        |                                         |
>        |                                         |
>        |                              enter osevent_fd_deregister
>        |                                         |
>        |                              enter virEventRemoveHandle
>        |                                waiting virMutexLock
> check handler delete flag                        |
> virMutexUnlock                                   |
>        |                                    virMutexLock
> enter libxl_osevent_occurred_fd                  |
> waiting CTX_LOCK                          mark delete flag
>        |                                   virMutexUnlock
>        |                                         |
>        |                                exit virEventRemoveHandle
>        |                                exit osevent_fd_deregister
>        |                                         |
>        |                                remove fd handler from list
>        |                                   set ev->fd as -1
>        |                                     CTX_UNLOCK
>    CTX_LOCK
> assert(fd==ev->fd) //lead to crash
> call back in libxl
>    CTX_UNLOCK
> exit libxl_osevent_occurred_fd

This all seems pretty plausible to me, but I'd like to have an Ack from
Ian J before I commit.

> at the same time, i found the times of file handler register is less
> than the times of file handler deregister. is that right? seems that
> it will be better if the register and deregister is paired.

How many extra file handles are we talking about?

Presumably some long lived file handles will stay around until you call
libxl_ctx_free for the ctx. Or are you doing this and saying you are
seeing leaked fd's?

> Signed-off-by: Bamvor Jian Zhang <bjzhang@suse.com>

> 
> diff -r 321f8487379b -r 0451e6041bdd tools/libxl/libxl_event.c
> --- a/tools/libxl/libxl_event.c	Thu Nov 15 10:25:29 2012 +0000
> +++ b/tools/libxl/libxl_event.c	Tue Nov 20 14:56:04 2012 +0800
> @@ -1018,11 +1018,15 @@ void libxl_osevent_occurred_fd(libxl_ctx
>      CTX_LOCK;
>      assert(!CTX->osevent_in_hook);
>  
> +    if (!libxl__ev_fd_isregistered(ev)) {
> +        DBG("ev_fd=%p deregister unregistered",ev);
> +        goto out;
> +    }
>      assert(fd == ev->fd);
>      revents &= ev->events;
>      if (revents)
>          ev->func(egc, ev, fd, ev->events, revents);
> -
> +out:
>      CTX_UNLOCK;
>      EGC_FREE;
>  }
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:44:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:44:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbpnW-0002o1-N2; Fri, 23 Nov 2012 09:43:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbpnU-0002nw-Sm
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 09:43:45 +0000
Received: from [85.158.143.99:36881] by server-3.bemta-4.messagelabs.com id
	4E/9B-06841-0554FA05; Fri, 23 Nov 2012 09:43:44 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1353663823!19868078!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26542 invoked from network); 23 Nov 2012 09:43:43 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 09:43:43 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15968009"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 09:43:43 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 09:43:43 +0000
Message-ID: <1353663822.13542.183.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Bamvor Jian Zhang <bjzhang@suse.com>
Date: Fri, 23 Nov 2012 09:43:42 +0000
In-Reply-To: <0451e6041bdd88c90eee.1353395794@linux-bjrd.bjz>
References: <0451e6041bdd88c90eee.1353395794@linux-bjrd.bjz>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "jfehlig@suse.com" <jfehlig@suse.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] fix race condition between libvirtd event
 handling and libxl fd deregister
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 07:16 +0000, Bamvor Jian Zhang wrote:
> the race condition may be encounted at the following senaro:
> (1), xenlight will remove fd handle just after the transfer is done according to
> the buffer pointer. This action will first mark fd handle deleted in libvirtd
> then remove fd handler from list in libxl. To mark the fd deleted in libvirtd,
> the libvirt event loop mutex must be acquired.
> 
> (2), meanwhile in the libvirt event dispatch process, libvirt will check the fd
> deleted flag while holding the event loop mutex. At this time, "(1)" may be
> blocked from marking the deleted flag. Then libvirt release its mutex temperary
> to run the dispatcher callback. But this callback need xenlight lock(CTX_LOCK)
> which is held by xenlight fd deregister function. So, libvirtd will continue to
> run this callback after fd deregister exit which means xenlight has been marked
> deleted flag, removed this fd handler and set ev->fd as -1. after
> libxl__ev_fd_deregister exit, it is time for callback running. but
> unfortunately, this callback has been removed as I mentioned above.
> 
> reference the following graph:
> libvirt event dispatch                  xenlight transfer done
>        |                              enter libxl__ev_fd_deregister
>        |                                     CTX_LOCK
>        |                                         |
>        |                                         |
>        |                              enter osevent_fd_deregister
>        |                                         |
>        |                              enter virEventRemoveHandle
>        |                                waiting virMutexLock
> check handler delete flag                        |
> virMutexUnlock                                   |
>        |                                    virMutexLock
> enter libxl_osevent_occurred_fd                  |
> waiting CTX_LOCK                          mark delete flag
>        |                                   virMutexUnlock
>        |                                         |
>        |                                exit virEventRemoveHandle
>        |                                exit osevent_fd_deregister
>        |                                         |
>        |                                remove fd handler from list
>        |                                   set ev->fd as -1
>        |                                     CTX_UNLOCK
>    CTX_LOCK
> assert(fd==ev->fd) //lead to crash
> call back in libxl
>    CTX_UNLOCK
> exit libxl_osevent_occurred_fd

This all seems pretty plausible to me, but I'd like to have an Ack from
Ian J before I commit.

> at the same time, i found the times of file handler register is less
> than the times of file handler deregister. is that right? seems that
> it will be better if the register and deregister is paired.

How many extra file handles are we talking about?

Presumably some long lived file handles will stay around until you call
libxl_ctx_free for the ctx. Or are you doing this and saying you are
seeing leaked fd's?

> Signed-off-by: Bamvor Jian Zhang <bjzhang@suse.com>

> 
> diff -r 321f8487379b -r 0451e6041bdd tools/libxl/libxl_event.c
> --- a/tools/libxl/libxl_event.c	Thu Nov 15 10:25:29 2012 +0000
> +++ b/tools/libxl/libxl_event.c	Tue Nov 20 14:56:04 2012 +0800
> @@ -1018,11 +1018,15 @@ void libxl_osevent_occurred_fd(libxl_ctx
>      CTX_LOCK;
>      assert(!CTX->osevent_in_hook);
>  
> +    if (!libxl__ev_fd_isregistered(ev)) {
> +        DBG("ev_fd=%p deregister unregistered",ev);
> +        goto out;
> +    }
>      assert(fd == ev->fd);
>      revents &= ev->events;
>      if (revents)
>          ev->func(egc, ev, fd, ev->events, revents);
> -
> +out:
>      CTX_UNLOCK;
>      EGC_FREE;
>  }
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:49:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:49:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbpsk-0002vt-In; Fri, 23 Nov 2012 09:49:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1Tbpsj-0002vl-0I
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 09:49:09 +0000
Received: from [85.158.139.83:50018] by server-7.bemta-5.messagelabs.com id
	7A/40-23096-4964FA05; Fri, 23 Nov 2012 09:49:08 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1353664115!27285109!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4Mjk4MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26291 invoked from network); 23 Nov 2012 09:48:36 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-14.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 09:48:36 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAN9m5Xw026501
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 23 Nov 2012 09:48:06 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAN9m44s027081
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 23 Nov 2012 09:48:04 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAN9m35g019031; Fri, 23 Nov 2012 03:48:03 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 23 Nov 2012 01:48:03 -0800
Date: Fri, 23 Nov 2012 10:47:38 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: ebiederm@xmission.com
Message-ID: <20121123094516.GA2921@host-192-168-1-59.local.net-space.pl>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <87txshx28b.fsf@xmission.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	jbeulich@suse.com, hpa@zytor.com, tglx@linutronix.de
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 22, 2012 at 04:15:48AM -0800, ebiederm@xmission.com wrote:
> Daniel Kiper <daniel.kiper@oracle.com> writes:
>
> > On Tue, Nov 20, 2012 at 08:40:39AM -0800, ebiederm@xmission.com wrote:
> >> Daniel Kiper <daniel.kiper@oracle.com> writes:
> >>
> >> > Some kexec/kdump implementations (e.g. Xen PVOPS) could not use default
> >> > functions or require some changes in behavior of kexec/kdump generic code.
> >> > To cope with that problem kexec_ops struct was introduced. It allows
> >> > a developer to replace all or some functions and control some
> >> > functionality of kexec/kdump generic code.
> >> >
> >> > Default behavior of kexec/kdump generic code is not changed.
> >>
> >> Ick.
> >>
> >> > v2 - suggestions/fixes:
> >> >    - add comment for kexec_ops.crash_alloc_temp_store member
> >> >      (suggested by Konrad Rzeszutek Wilk),
> >> >    - simplify kexec_ops usage
> >> >      (suggested by Konrad Rzeszutek Wilk).
> >> >
> >> > Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
> >> > ---
> >> >  include/linux/kexec.h |   26 ++++++++++
> >> >  kernel/kexec.c        |  131 +++++++++++++++++++++++++++++++++++++------------
> >> >  2 files changed, 125 insertions(+), 32 deletions(-)
> >> >
> >> > diff --git a/include/linux/kexec.h b/include/linux/kexec.h
> >> > index d0b8458..c8d0b35 100644
> >> > --- a/include/linux/kexec.h
> >> > +++ b/include/linux/kexec.h
> >> > @@ -116,7 +116,33 @@ struct kimage {
> >> >  #endif
> >> >  };
> >> >
> >> > +struct kexec_ops {
> >> > +	/*
> >> > +	 * Some kdump implementations (e.g. Xen PVOPS dom0) could not access
> >> > +	 * directly crash kernel memory area. In this situation they must
> >> > +	 * allocate memory outside of it and later move contents from temporary
> >> > +	 * storage to final resting places (usualy done by relocate_kernel()).
> >> > +	 * Such behavior could be enforced by setting
> >> > +	 * crash_alloc_temp_store member to true.
> >> > +	 */
> >>
> >> Why in the world would Xen not be able to access crash kernel memory?
> >> As currently defined it is normal memory that the kernel chooses not to
> >> use.
> >>
> >> If relocate kernel can access that memory you definitely can access the
> >> memory so the comment does not make any sense.
> >
> > Crash kernel memory is reserved by Xen hypervisor and Xen hypervisor
> > only has access to it. dom0 does not have any mapping of this area.
> > However, relocate_kernel() has access to crash kernel memory
> > because it is executed by Xen hypervisor and whole machine
> > memory is identity mapped.
>
> This is all weird.  Doubly so since this code is multi-arch and you have
> a set of requirements no other arch has had.
>
> I recall that Xen uses kexec in a unique manner.  What is the hypervisor
> interface and how is it used?
>
> Is this for when the hypervisor crashes and we want a crash dump of
> that?

dom0 at boot gets some info about kexec/kdump configuration from Xen hypervisor
(e.g. placement of crash kernel area). Later if you call kexec syscall most
things are done in the same way as on baremetal. However, after placing image
in memory, HYPERVISOR_kexec_op() hypercall must be called to inform hypervisor
that image is loaded (new hook machine_kexec_load is used for this;
machine_kexec_unload is used for unload). Then Xen establishes fixmap for pages
found in page_list[] and returns control to dom0. If dom0 crashes or "kexec execute"
is used by user then dom0 calls HYPERVISOR_kexec_op() to instruct hypervisor that
kexec/kdump image should be executed immediately. Xen calls relocate_kernel()
and all things runs as usual.

> >> > +	bool crash_alloc_temp_store;
> >> > +	struct page *(*kimage_alloc_pages)(gfp_t gfp_mask,
> >> > +						unsigned int order,
> >> > +						unsigned long limit);
> >> > +	void (*kimage_free_pages)(struct page *page);
> >> > +	unsigned long (*page_to_pfn)(struct page *page);
> >> > +	struct page *(*pfn_to_page)(unsigned long pfn);
> >> > +	unsigned long (*virt_to_phys)(volatile void *address);
> >> > +	void *(*phys_to_virt)(unsigned long address);
> >> > +	int (*machine_kexec_prepare)(struct kimage *image);
> >> > +	int (*machine_kexec_load)(struct kimage *image);
> >> > +	void (*machine_kexec_cleanup)(struct kimage *image);
> >> > +	void (*machine_kexec_unload)(struct kimage *image);
> >> > +	void (*machine_kexec_shutdown)(void);
> >> > +	void (*machine_kexec)(struct kimage *image);
> >> > +};
> >>
> >> Ugh.  This is a nasty abstraction.
> >>
> >> You are mixing and matching a bunch of things together here.
> >>
> >> If you need to override machine_kexec_xxx please do that on a per
> >> architecture basis.
> >
> > Yes, it is possible but I think that it is worth to do it at that
> > level because it could be useful for other archs too (e.g. Xen ARM port
> > is under development). Then we do not need to duplicate that functionality
> > in arch code. Additionally, Xen requires machine_kexec_load and
> > machine_kexec_unload hooks which are not available in current generic
> > kexec/kdump code.
>
>
> Let me be clear.  kexec_ops as you have implemented it is absolutely
> unacceptable.
>
> Your kexec_ops is not an abstraction but a hack that enshrines in stone
> implementation details.

Roger.

> >> Special case overrides of page_to_pfn, pfn_to_page, virt_to_phys,
> >> phys_to_virt, and friends seem completely inappropriate.
> >
> > They are required in Xen PVOPS case. If we do not do that in that way
> > then we at least need to duplicate almost all generic kexec/kdump existing
> > code in arch depended files. I do not mention that we need to capture
> > relevant syscall and other things. I think that this is wrong way.
>
> A different definition of phys_to_virt and page_to_pfn for one specific
> function is total nonsense.
>
> It may actually be better to have a completely different code path.
> This looks more like code abuse than code reuse.
>
> Successful code reuse depends upon not breaking the assumptions on which
> the code relies, or modifying the code so that the new modified
> assumptions are clear.  In this case you might as well define up as down
> for all of the sense kexec_ops makes.

Hmmm... Well, problem with above mentioned functions is that they work
on physical addresses. In Xen PVOPS (currently dom0 is PVOPS) they
are useless in kexec/kdump case. It means that physical addresses
must be converted to/from machine addresses which has a real meaning
in Xen PVOPS case. That is why those funtions were introduced.

> >> There may be a point to all of these but you are mixing and matching
> >> things badly.
> >
> > Do you whish to split this kexec_ops struct to something which
> > works with addresses and something which is reponsible for
> > loading, unloading and executing kexec/kdump? I am able to change
> > that but I would like to know a bit about your vision first.
>
> My vision is that we should have code that makes sense.
>
> My suspicion is that what you want is a cousin of the existing kexec
> system call.  Perhaps what is needed is a flag to say use the firmware
> kexec system call.
>
> I absolutely do not understand what Xen is trying to do.  kexec by
> design should not require any firmware specific hooks.  kexec at this
> level should only need to care about the processor architeture.  Clearly
> what you are doing with Xen requires special hooks separate even from
> the normal paravirt hooks.  So I do not understand you are trying to do.
>
> It needs to be clear from the code what is happening differently in the
> Xen case.  Otherwise the code is unmaintainable as no one will be able
> to understand it.

I agree. I could remove all machine_* hooks from kexec_ops and call Xen
specific functions from arch files. However, I need to add two new
machine calls, machine_kexec_load and machine_kexec_unload, in the same
manner as existing machine_* calls. In general they could be used to inform
firmware (in this case Xen) that kexec/kdump image is loaded.

kimage_alloc_pages, kimage_free_pages, page_to_pfn, pfn_to_page, virt_to_phys
and phys_to_virt are worse. If we could not find good solution how to replace
them then we end up with calling Xen specific version of kexec/kdump which
would contain nearly full copy of exisiting kexec/kdump code. Not good.

We could add some code to kernel/kexec.c which depends on CONFIG_XEN.
It could contain above mentioned functions which later will be called
by existing kexec code. This is not nice to be honest. However, I hope
that we could find better solution for that problem.

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:49:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:49:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbpsk-0002vt-In; Fri, 23 Nov 2012 09:49:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1Tbpsj-0002vl-0I
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 09:49:09 +0000
Received: from [85.158.139.83:50018] by server-7.bemta-5.messagelabs.com id
	7A/40-23096-4964FA05; Fri, 23 Nov 2012 09:49:08 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1353664115!27285109!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4Mjk4MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26291 invoked from network); 23 Nov 2012 09:48:36 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-14.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 09:48:36 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAN9m5Xw026501
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 23 Nov 2012 09:48:06 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAN9m44s027081
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 23 Nov 2012 09:48:04 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAN9m35g019031; Fri, 23 Nov 2012 03:48:03 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 23 Nov 2012 01:48:03 -0800
Date: Fri, 23 Nov 2012 10:47:38 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: ebiederm@xmission.com
Message-ID: <20121123094516.GA2921@host-192-168-1-59.local.net-space.pl>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <87txshx28b.fsf@xmission.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	jbeulich@suse.com, hpa@zytor.com, tglx@linutronix.de
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 22, 2012 at 04:15:48AM -0800, ebiederm@xmission.com wrote:
> Daniel Kiper <daniel.kiper@oracle.com> writes:
>
> > On Tue, Nov 20, 2012 at 08:40:39AM -0800, ebiederm@xmission.com wrote:
> >> Daniel Kiper <daniel.kiper@oracle.com> writes:
> >>
> >> > Some kexec/kdump implementations (e.g. Xen PVOPS) could not use default
> >> > functions or require some changes in behavior of kexec/kdump generic code.
> >> > To cope with that problem kexec_ops struct was introduced. It allows
> >> > a developer to replace all or some functions and control some
> >> > functionality of kexec/kdump generic code.
> >> >
> >> > Default behavior of kexec/kdump generic code is not changed.
> >>
> >> Ick.
> >>
> >> > v2 - suggestions/fixes:
> >> >    - add comment for kexec_ops.crash_alloc_temp_store member
> >> >      (suggested by Konrad Rzeszutek Wilk),
> >> >    - simplify kexec_ops usage
> >> >      (suggested by Konrad Rzeszutek Wilk).
> >> >
> >> > Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
> >> > ---
> >> >  include/linux/kexec.h |   26 ++++++++++
> >> >  kernel/kexec.c        |  131 +++++++++++++++++++++++++++++++++++++------------
> >> >  2 files changed, 125 insertions(+), 32 deletions(-)
> >> >
> >> > diff --git a/include/linux/kexec.h b/include/linux/kexec.h
> >> > index d0b8458..c8d0b35 100644
> >> > --- a/include/linux/kexec.h
> >> > +++ b/include/linux/kexec.h
> >> > @@ -116,7 +116,33 @@ struct kimage {
> >> >  #endif
> >> >  };
> >> >
> >> > +struct kexec_ops {
> >> > +	/*
> >> > +	 * Some kdump implementations (e.g. Xen PVOPS dom0) could not access
> >> > +	 * directly crash kernel memory area. In this situation they must
> >> > +	 * allocate memory outside of it and later move contents from temporary
> >> > +	 * storage to final resting places (usualy done by relocate_kernel()).
> >> > +	 * Such behavior could be enforced by setting
> >> > +	 * crash_alloc_temp_store member to true.
> >> > +	 */
> >>
> >> Why in the world would Xen not be able to access crash kernel memory?
> >> As currently defined it is normal memory that the kernel chooses not to
> >> use.
> >>
> >> If relocate kernel can access that memory you definitely can access the
> >> memory so the comment does not make any sense.
> >
> > Crash kernel memory is reserved by Xen hypervisor and Xen hypervisor
> > only has access to it. dom0 does not have any mapping of this area.
> > However, relocate_kernel() has access to crash kernel memory
> > because it is executed by Xen hypervisor and whole machine
> > memory is identity mapped.
>
> This is all weird.  Doubly so since this code is multi-arch and you have
> a set of requirements no other arch has had.
>
> I recall that Xen uses kexec in a unique manner.  What is the hypervisor
> interface and how is it used?
>
> Is this for when the hypervisor crashes and we want a crash dump of
> that?

dom0 at boot gets some info about kexec/kdump configuration from Xen hypervisor
(e.g. placement of crash kernel area). Later if you call kexec syscall most
things are done in the same way as on baremetal. However, after placing image
in memory, HYPERVISOR_kexec_op() hypercall must be called to inform hypervisor
that image is loaded (new hook machine_kexec_load is used for this;
machine_kexec_unload is used for unload). Then Xen establishes fixmap for pages
found in page_list[] and returns control to dom0. If dom0 crashes or "kexec execute"
is used by user then dom0 calls HYPERVISOR_kexec_op() to instruct hypervisor that
kexec/kdump image should be executed immediately. Xen calls relocate_kernel()
and all things runs as usual.

> >> > +	bool crash_alloc_temp_store;
> >> > +	struct page *(*kimage_alloc_pages)(gfp_t gfp_mask,
> >> > +						unsigned int order,
> >> > +						unsigned long limit);
> >> > +	void (*kimage_free_pages)(struct page *page);
> >> > +	unsigned long (*page_to_pfn)(struct page *page);
> >> > +	struct page *(*pfn_to_page)(unsigned long pfn);
> >> > +	unsigned long (*virt_to_phys)(volatile void *address);
> >> > +	void *(*phys_to_virt)(unsigned long address);
> >> > +	int (*machine_kexec_prepare)(struct kimage *image);
> >> > +	int (*machine_kexec_load)(struct kimage *image);
> >> > +	void (*machine_kexec_cleanup)(struct kimage *image);
> >> > +	void (*machine_kexec_unload)(struct kimage *image);
> >> > +	void (*machine_kexec_shutdown)(void);
> >> > +	void (*machine_kexec)(struct kimage *image);
> >> > +};
> >>
> >> Ugh.  This is a nasty abstraction.
> >>
> >> You are mixing and matching a bunch of things together here.
> >>
> >> If you need to override machine_kexec_xxx please do that on a per
> >> architecture basis.
> >
> > Yes, it is possible but I think that it is worth to do it at that
> > level because it could be useful for other archs too (e.g. Xen ARM port
> > is under development). Then we do not need to duplicate that functionality
> > in arch code. Additionally, Xen requires machine_kexec_load and
> > machine_kexec_unload hooks which are not available in current generic
> > kexec/kdump code.
>
>
> Let me be clear.  kexec_ops as you have implemented it is absolutely
> unacceptable.
>
> Your kexec_ops is not an abstraction but a hack that enshrines in stone
> implementation details.

Roger.

> >> Special case overrides of page_to_pfn, pfn_to_page, virt_to_phys,
> >> phys_to_virt, and friends seem completely inappropriate.
> >
> > They are required in Xen PVOPS case. If we do not do that in that way
> > then we at least need to duplicate almost all generic kexec/kdump existing
> > code in arch depended files. I do not mention that we need to capture
> > relevant syscall and other things. I think that this is wrong way.
>
> A different definition of phys_to_virt and page_to_pfn for one specific
> function is total nonsense.
>
> It may actually be better to have a completely different code path.
> This looks more like code abuse than code reuse.
>
> Successful code reuse depends upon not breaking the assumptions on which
> the code relies, or modifying the code so that the new modified
> assumptions are clear.  In this case you might as well define up as down
> for all of the sense kexec_ops makes.

Hmmm... Well, problem with above mentioned functions is that they work
on physical addresses. In Xen PVOPS (currently dom0 is PVOPS) they
are useless in kexec/kdump case. It means that physical addresses
must be converted to/from machine addresses which has a real meaning
in Xen PVOPS case. That is why those funtions were introduced.

> >> There may be a point to all of these but you are mixing and matching
> >> things badly.
> >
> > Do you whish to split this kexec_ops struct to something which
> > works with addresses and something which is reponsible for
> > loading, unloading and executing kexec/kdump? I am able to change
> > that but I would like to know a bit about your vision first.
>
> My vision is that we should have code that makes sense.
>
> My suspicion is that what you want is a cousin of the existing kexec
> system call.  Perhaps what is needed is a flag to say use the firmware
> kexec system call.
>
> I absolutely do not understand what Xen is trying to do.  kexec by
> design should not require any firmware specific hooks.  kexec at this
> level should only need to care about the processor architeture.  Clearly
> what you are doing with Xen requires special hooks separate even from
> the normal paravirt hooks.  So I do not understand you are trying to do.
>
> It needs to be clear from the code what is happening differently in the
> Xen case.  Otherwise the code is unmaintainable as no one will be able
> to understand it.

I agree. I could remove all machine_* hooks from kexec_ops and call Xen
specific functions from arch files. However, I need to add two new
machine calls, machine_kexec_load and machine_kexec_unload, in the same
manner as existing machine_* calls. In general they could be used to inform
firmware (in this case Xen) that kexec/kdump image is loaded.

kimage_alloc_pages, kimage_free_pages, page_to_pfn, pfn_to_page, virt_to_phys
and phys_to_virt are worse. If we could not find good solution how to replace
them then we end up with calling Xen specific version of kexec/kdump which
would contain nearly full copy of exisiting kexec/kdump code. Not good.

We could add some code to kernel/kexec.c which depends on CONFIG_XEN.
It could contain above mentioned functions which later will be called
by existing kexec code. This is not nice to be honest. However, I hope
that we could find better solution for that problem.

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:53:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:53:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbpwG-0003Da-BS; Fri, 23 Nov 2012 09:52:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbpwE-0003DP-UG
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 09:52:47 +0000
Received: from [85.158.138.51:60253] by server-7.bemta-3.messagelabs.com id
	39/86-01713-9674FA05; Fri, 23 Nov 2012 09:52:41 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1353664360!24825076!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8726 invoked from network); 23 Nov 2012 09:52:41 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 09:52:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15968272"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 09:52:40 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 09:52:40 +0000
Message-ID: <1353664359.13542.186.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Chunyan Liu <cyliu@suse.com>
Date: Fri, 23 Nov 2012 09:52:39 +0000
In-Reply-To: <CAERYnoYP0x-iHzys9tGCzxVzneJ9GMm=wvZ-ENhLgWMCrCs-ag@mail.gmail.com>
References: <CAERYnoYP0x-iHzys9tGCzxVzneJ9GMm=wvZ-ENhLgWMCrCs-ag@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH V2]xenstore-chmod: handle arbitrary number
 of perms rather than MAX_PERMS constant
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 02:59 +0000, Chunyan Liu wrote:
> Constant MAX_PERMS 16 is too small to use in some occasions, e.g. if
> there are more than 16 domU(s) on one hypervisor (it's easy to
> achieve) and one wants to do xenstore-chmod PATH to all domU(s). So,
> remove MAX_PERMS limitation and make it as arbitrary number of perms.
> 
> Signed-off-by: Chunyan Liu <cyliu@suse.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

Unfortunately the patch is whitespace damaged and therefore doesn't
apply. There are some stray hard tabs in the source which have turned
into soft tabs in your mail.

http://wiki.xen.org/wiki/Submitting_Xen_Patches has some hints on using
hg patchbomb to avoid this, and also a link to Linux's email-client.txt
which has hints on how to avoid whitespace mangling with various
clients.

BTW, I'd be happy for you to cleanup the hard tabs in lines which you
are touching anyway, but they need to be present in the "-" line for the
patch to apply of course.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:53:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:53:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbpwG-0003Da-BS; Fri, 23 Nov 2012 09:52:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbpwE-0003DP-UG
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 09:52:47 +0000
Received: from [85.158.138.51:60253] by server-7.bemta-3.messagelabs.com id
	39/86-01713-9674FA05; Fri, 23 Nov 2012 09:52:41 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1353664360!24825076!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8726 invoked from network); 23 Nov 2012 09:52:41 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 09:52:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15968272"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 09:52:40 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 09:52:40 +0000
Message-ID: <1353664359.13542.186.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Chunyan Liu <cyliu@suse.com>
Date: Fri, 23 Nov 2012 09:52:39 +0000
In-Reply-To: <CAERYnoYP0x-iHzys9tGCzxVzneJ9GMm=wvZ-ENhLgWMCrCs-ag@mail.gmail.com>
References: <CAERYnoYP0x-iHzys9tGCzxVzneJ9GMm=wvZ-ENhLgWMCrCs-ag@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH V2]xenstore-chmod: handle arbitrary number
 of perms rather than MAX_PERMS constant
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 02:59 +0000, Chunyan Liu wrote:
> Constant MAX_PERMS 16 is too small to use in some occasions, e.g. if
> there are more than 16 domU(s) on one hypervisor (it's easy to
> achieve) and one wants to do xenstore-chmod PATH to all domU(s). So,
> remove MAX_PERMS limitation and make it as arbitrary number of perms.
> 
> Signed-off-by: Chunyan Liu <cyliu@suse.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

Unfortunately the patch is whitespace damaged and therefore doesn't
apply. There are some stray hard tabs in the source which have turned
into soft tabs in your mail.

http://wiki.xen.org/wiki/Submitting_Xen_Patches has some hints on using
hg patchbomb to avoid this, and also a link to Linux's email-client.txt
which has hints on how to avoid whitespace mangling with various
clients.

BTW, I'd be happy for you to cleanup the hard tabs in lines which you
are touching anyway, but they need to be present in the "-" line for the
patch to apply of course.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:53:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:53:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbpwO-0003EJ-OI; Fri, 23 Nov 2012 09:52:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbpwN-0003E4-1w
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 09:52:55 +0000
Received: from [85.158.143.35:60719] by server-1.bemta-4.messagelabs.com id
	7E/37-27934-6774FA05; Fri, 23 Nov 2012 09:52:54 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1353664362!5266303!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1416 invoked from network); 23 Nov 2012 09:52:42 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-21.messagelabs.com with SMTP;
	23 Nov 2012 09:52:42 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 23 Nov 2012 09:52:41 +0000
Message-Id: <50AF55B102000078000AABF3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 23 Nov 2012 09:53:37 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"H. Peter Anvin" <hpa@zytor.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
	<18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
	<50AED7B8.7040902@citrix.com>
In-Reply-To: <50AED7B8.7040902@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Daniel Kiper <daniel.kiper@oracle.com>, "x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 23.11.12 at 02:56, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> On 23/11/2012 01:38, H. Peter Anvin wrote:
>> I still don't really get why it can't be isolated from dom0, which would 
> make more sense to me, even for a Xen crash.
>>
> 
> The crash region (as specified by crashkernel= on the Xen command line)
> is isolated from dom0.
> 
> dom0 (using the kexec utility etc) has the task of locating the Xen
> crash notes (using the kexec hypercall interface), constructing a binary
> blob containing kernel, initram and gubbins, and asking Xen to put this
> blob in the crash region (again, using the kexec hypercall interface).
> 
> I do not see how this is very much different from the native case
> currently (although please correct me if I am misinformed).  Linux has
> extra work to do by populating /proc/iomem with the Xen crash regions
> boot (so the kexec utility can reference their physical addresses when
> constructing the blob), and should just act as a conduit between the
> kexec system call and the kexec hypercall to load the blob.

But all of this _could_ be done completely independent of the
Dom0 kernel's kexec infrastructure (i.e. fully from user space,
invoking the necessary hypercalls through the privcmd driver).
It's just that parts of the kexec infrastructure can be re-used
(and hence that mechanism probably seemed the easier approach
to the implementer of the original kexec-on-Xen). If the kernel
folks dislike that re-use (quite understandably looking at how
much of it needs to be re-done), that shouldn't prevent us from
looking into the existing alternatives.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:53:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:53:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbpwO-0003EJ-OI; Fri, 23 Nov 2012 09:52:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbpwN-0003E4-1w
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 09:52:55 +0000
Received: from [85.158.143.35:60719] by server-1.bemta-4.messagelabs.com id
	7E/37-27934-6774FA05; Fri, 23 Nov 2012 09:52:54 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1353664362!5266303!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1416 invoked from network); 23 Nov 2012 09:52:42 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-21.messagelabs.com with SMTP;
	23 Nov 2012 09:52:42 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 23 Nov 2012 09:52:41 +0000
Message-Id: <50AF55B102000078000AABF3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 23 Nov 2012 09:53:37 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"H. Peter Anvin" <hpa@zytor.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
	<18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
	<50AED7B8.7040902@citrix.com>
In-Reply-To: <50AED7B8.7040902@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Daniel Kiper <daniel.kiper@oracle.com>, "x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 23.11.12 at 02:56, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> On 23/11/2012 01:38, H. Peter Anvin wrote:
>> I still don't really get why it can't be isolated from dom0, which would 
> make more sense to me, even for a Xen crash.
>>
> 
> The crash region (as specified by crashkernel= on the Xen command line)
> is isolated from dom0.
> 
> dom0 (using the kexec utility etc) has the task of locating the Xen
> crash notes (using the kexec hypercall interface), constructing a binary
> blob containing kernel, initram and gubbins, and asking Xen to put this
> blob in the crash region (again, using the kexec hypercall interface).
> 
> I do not see how this is very much different from the native case
> currently (although please correct me if I am misinformed).  Linux has
> extra work to do by populating /proc/iomem with the Xen crash regions
> boot (so the kexec utility can reference their physical addresses when
> constructing the blob), and should just act as a conduit between the
> kexec system call and the kexec hypercall to load the blob.

But all of this _could_ be done completely independent of the
Dom0 kernel's kexec infrastructure (i.e. fully from user space,
invoking the necessary hypercalls through the privcmd driver).
It's just that parts of the kexec infrastructure can be re-used
(and hence that mechanism probably seemed the easier approach
to the implementer of the original kexec-on-Xen). If the kernel
folks dislike that re-use (quite understandably looking at how
much of it needs to be re-done), that shouldn't prevent us from
looking into the existing alternatives.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:56:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:56:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbpzM-0003XK-VW; Fri, 23 Nov 2012 09:56:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbpzL-0003X4-1E
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 09:55:59 +0000
Received: from [85.158.139.211:41721] by server-15.bemta-5.messagelabs.com id
	CF/BC-26920-E284FA05; Fri, 23 Nov 2012 09:55:58 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353664556!21225649!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26139 invoked from network); 23 Nov 2012 09:55:57 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-206.messagelabs.com with SMTP;
	23 Nov 2012 09:55:57 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 23 Nov 2012 09:55:56 +0000
Message-Id: <50AF567402000078000AABF6@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 23 Nov 2012 09:56:52 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "H. Peter Anvin" <hpa@zytor.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE62E9.3000602@zytor.com>
In-Reply-To: <50AE62E9.3000602@zytor.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com,
	Daniel Kiper <daniel.kiper@oracle.com>, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	"Eric W. Biederman" <ebiederm@xmission.com>, tglx@linutronix.de
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 18:37, "H. Peter Anvin" <hpa@zytor.com> wrote:
> I actually talked to Ian Jackson at LCE, and mentioned among other 
> things the bogosity of requiring a PUD page for three-level paging in 
> Linux -- a bogosity which has spread from Xen into native.  It's a page 
> wasted for no good reason, since it only contains 32 bytes worth of 
> data, *inherently*.  Furthermore, contrary to popular belief, it is 
> *not* pa page table per se.
> 
> Ian told me: "I didn't know we did that, and we shouldn't have to." 
> Here we have suffered this overhead for at least six years, ...

Even the Xen kernel only needs the full page when running on a
64-bit hypervisor (now that we don't have a 32-bit hypervisor
anymore, that of course basically means always). But yes, I too
never liked this enforced over-allocation for native kernels (and
was surprised that it was allowed in at all).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 09:56:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 09:56:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbpzM-0003XK-VW; Fri, 23 Nov 2012 09:56:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbpzL-0003X4-1E
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 09:55:59 +0000
Received: from [85.158.139.211:41721] by server-15.bemta-5.messagelabs.com id
	CF/BC-26920-E284FA05; Fri, 23 Nov 2012 09:55:58 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353664556!21225649!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26139 invoked from network); 23 Nov 2012 09:55:57 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-206.messagelabs.com with SMTP;
	23 Nov 2012 09:55:57 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 23 Nov 2012 09:55:56 +0000
Message-Id: <50AF567402000078000AABF6@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 23 Nov 2012 09:56:52 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "H. Peter Anvin" <hpa@zytor.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE62E9.3000602@zytor.com>
In-Reply-To: <50AE62E9.3000602@zytor.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com,
	Daniel Kiper <daniel.kiper@oracle.com>, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	"Eric W. Biederman" <ebiederm@xmission.com>, tglx@linutronix.de
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 22.11.12 at 18:37, "H. Peter Anvin" <hpa@zytor.com> wrote:
> I actually talked to Ian Jackson at LCE, and mentioned among other 
> things the bogosity of requiring a PUD page for three-level paging in 
> Linux -- a bogosity which has spread from Xen into native.  It's a page 
> wasted for no good reason, since it only contains 32 bytes worth of 
> data, *inherently*.  Furthermore, contrary to popular belief, it is 
> *not* pa page table per se.
> 
> Ian told me: "I didn't know we did that, and we shouldn't have to." 
> Here we have suffered this overhead for at least six years, ...

Even the Xen kernel only needs the full page when running on a
64-bit hypervisor (now that we don't have a 32-bit hypervisor
anymore, that of course basically means always). But yes, I too
never liked this enforced over-allocation for native kernels (and
was surprised that it was allowed in at all).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 10:00:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:00:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbq3H-0003uy-9V; Fri, 23 Nov 2012 10:00:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbq3F-0003qz-Lw
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 10:00:01 +0000
Received: from [85.158.138.51:5643] by server-4.bemta-3.messagelabs.com id
	39/C6-30023-0294FA05; Fri, 23 Nov 2012 10:00:00 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353664799!31133928!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21579 invoked from network); 23 Nov 2012 09:59:59 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 09:59:59 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15968501"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 09:59:59 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 09:59:58 +0000
Message-ID: <1353664797.13542.190.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>, Ian Jackson
	<Ian.Jackson@eu.citrix.com>
Date: Fri, 23 Nov 2012 09:59:57 +0000
In-Reply-To: <1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs
 to stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 14:21 +0000, Matthew Fioravante wrote:
> 
> +tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
> +       tar xzf $<
> +       mv tpm_emulator-$(TPMEMU_VERSION) $@
> +       patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
> +       mkdir $@/build
> +       cd $@/build; cmake .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
> +       touch $@ 

Ian -- is the test system ready to copy with this cmake requirement?

Or do we need to make this dependency conditional?

I think at the very least it should be $(CMAKE), at which point we may
as well go the whole hog and make configure.ac do the right thing.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 10:00:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:00:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbq3H-0003uy-9V; Fri, 23 Nov 2012 10:00:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbq3F-0003qz-Lw
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 10:00:01 +0000
Received: from [85.158.138.51:5643] by server-4.bemta-3.messagelabs.com id
	39/C6-30023-0294FA05; Fri, 23 Nov 2012 10:00:00 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353664799!31133928!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21579 invoked from network); 23 Nov 2012 09:59:59 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 09:59:59 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15968501"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 09:59:59 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 09:59:58 +0000
Message-ID: <1353664797.13542.190.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>, Ian Jackson
	<Ian.Jackson@eu.citrix.com>
Date: Fri, 23 Nov 2012 09:59:57 +0000
In-Reply-To: <1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs
 to stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 14:21 +0000, Matthew Fioravante wrote:
> 
> +tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
> +       tar xzf $<
> +       mv tpm_emulator-$(TPMEMU_VERSION) $@
> +       patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
> +       mkdir $@/build
> +       cd $@/build; cmake .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
> +       touch $@ 

Ian -- is the test system ready to copy with this cmake requirement?

Or do we need to make this dependency conditional?

I think at the very least it should be $(CMAKE), at which point we may
as well go the whole hog and make configure.ac do the right thing.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 10:06:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:06:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbq8u-0004I8-3I; Fri, 23 Nov 2012 10:05:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbq8s-0004I2-3O
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 10:05:50 +0000
Received: from [85.158.139.211:17985] by server-11.bemta-5.messagelabs.com id
	AA/73-03409-D7A4FA05; Fri, 23 Nov 2012 10:05:49 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353665148!21342673!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20280 invoked from network); 23 Nov 2012 10:05:48 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 10:05:48 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15968659"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 10:05:48 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 10:05:48 +0000
Message-ID: <1353665146.13542.194.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Fri, 23 Nov 2012 10:05:46 +0000
In-Reply-To: <a4f707f6049a4a8152d2.1353518970@elijah>
References: <a4f707f6049a4a8152d2.1353518970@elijah>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Fix bug in libxl_cdrom_insert,
 make more robust against bad xenstore data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-21 at 17:29 +0000, George Dunlap wrote:
> # HG changeset patch
> # User George Dunlap <george.dunlap@eu.citrix.com>
> # Date 1353518844 0
> # Node ID a4f707f6049a4a8152d2886f1b1d49f9e70ef5eb
> # Parent  ae6fb202b233af815466055d9f1a635802a50855
> libxl: Fix bug in libxl_cdrom_insert, make more robust against bad xenstore data
> 
> libxl_cdrom_insert was failing to initialize the backend type,
> resulting in the wrong default backend.  The result was not only that
> the CD was not inserted properly, but also that some improper xenstore
> entries were created, causing further block commands to fail.
> 
> This patch fixes the bug by setting the disk backend type based on the
> type of the existing device.
> 
> It also makes the system more robust by:
> * Checking to see that it has got a valid path before proceeding to
> write a partial xenstore entry

The above all looked good to me.
Acked-by: Ian Campbell <ian.campbell@citrix.com>
for those bits.

> * Handling non-existent nodes in the backend xenstore entries more
> gracefully

I wonder if it should error out here rather than assume a default -- the
nodes in question should have been written by libxl itself (I think, I
don't think these are backend provided keys) so if they are missing
something has gone pretty wrong in the library, I think it's worth at
least a log message and more than likely an error return.

> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -2201,14 +2201,14 @@ static void libxl__device_disk_from_xs_b
>          disk->removable = 0;
>  
>      tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/mode", be_path));
> -    if (!strcmp(tmp, "w"))
> +    if (tmp && !strcmp(tmp, "w"))
>          disk->readwrite = 1;
>      else
>          disk->readwrite = 0;
>  
>      tmp = libxl__xs_read(gc, XBT_NULL,
>                           libxl__sprintf(gc, "%s/device-type", be_path));
> -    disk->is_cdrom = !strcmp(tmp, "cdrom");
> +    disk->is_cdrom = tmp && !strcmp(tmp, "cdrom");
>  
>      disk->format = LIBXL_DISK_FORMAT_UNKNOWN;
>  }
> @@ -2353,6 +2353,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
>  
>      libxl__device device;
>      const char * path;
> +    char * tmp;
>  
>      flexarray_t *insert = NULL;
>  
> @@ -2383,8 +2384,11 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
>      disks = libxl_device_disk_list(ctx, domid, &num);
>      for (i = 0; i < num; i++) {
>          if (disks[i].is_cdrom && !strcmp(disk->vdev, disks[i].vdev))
> -            /* found */
> +        {
> +            /* Found.  Set backend type appropriately. */
> +            disk->backend=disks[i].backend;
>              break;
> +        }
>      }
>      if (i == num) {
>          LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Virtual device not found");
> @@ -2410,6 +2414,17 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
>  
>      path = libxl__device_backend_path(gc, &device);
>  
> +    /* Sanity check: make sure the backend exists before writing here */
> +    tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/frontend", path));
> +    if (!tmp)
> +    {
> +        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Internal error: %s does not exist",
> +            libxl__sprintf(gc, "%s/frontend", path));
> +        rc = ERROR_FAIL;
> +        goto out;
> +    }
> +
> +
>      insert = flexarray_make(gc, 4, 1);
>  
>      flexarray_append_pair(insert, "type",
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 10:06:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:06:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbq8u-0004I8-3I; Fri, 23 Nov 2012 10:05:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbq8s-0004I2-3O
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 10:05:50 +0000
Received: from [85.158.139.211:17985] by server-11.bemta-5.messagelabs.com id
	AA/73-03409-D7A4FA05; Fri, 23 Nov 2012 10:05:49 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353665148!21342673!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20280 invoked from network); 23 Nov 2012 10:05:48 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 10:05:48 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15968659"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 10:05:48 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 10:05:48 +0000
Message-ID: <1353665146.13542.194.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Fri, 23 Nov 2012 10:05:46 +0000
In-Reply-To: <a4f707f6049a4a8152d2.1353518970@elijah>
References: <a4f707f6049a4a8152d2.1353518970@elijah>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Fix bug in libxl_cdrom_insert,
 make more robust against bad xenstore data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-21 at 17:29 +0000, George Dunlap wrote:
> # HG changeset patch
> # User George Dunlap <george.dunlap@eu.citrix.com>
> # Date 1353518844 0
> # Node ID a4f707f6049a4a8152d2886f1b1d49f9e70ef5eb
> # Parent  ae6fb202b233af815466055d9f1a635802a50855
> libxl: Fix bug in libxl_cdrom_insert, make more robust against bad xenstore data
> 
> libxl_cdrom_insert was failing to initialize the backend type,
> resulting in the wrong default backend.  The result was not only that
> the CD was not inserted properly, but also that some improper xenstore
> entries were created, causing further block commands to fail.
> 
> This patch fixes the bug by setting the disk backend type based on the
> type of the existing device.
> 
> It also makes the system more robust by:
> * Checking to see that it has got a valid path before proceeding to
> write a partial xenstore entry

The above all looked good to me.
Acked-by: Ian Campbell <ian.campbell@citrix.com>
for those bits.

> * Handling non-existent nodes in the backend xenstore entries more
> gracefully

I wonder if it should error out here rather than assume a default -- the
nodes in question should have been written by libxl itself (I think, I
don't think these are backend provided keys) so if they are missing
something has gone pretty wrong in the library, I think it's worth at
least a log message and more than likely an error return.

> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -2201,14 +2201,14 @@ static void libxl__device_disk_from_xs_b
>          disk->removable = 0;
>  
>      tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/mode", be_path));
> -    if (!strcmp(tmp, "w"))
> +    if (tmp && !strcmp(tmp, "w"))
>          disk->readwrite = 1;
>      else
>          disk->readwrite = 0;
>  
>      tmp = libxl__xs_read(gc, XBT_NULL,
>                           libxl__sprintf(gc, "%s/device-type", be_path));
> -    disk->is_cdrom = !strcmp(tmp, "cdrom");
> +    disk->is_cdrom = tmp && !strcmp(tmp, "cdrom");
>  
>      disk->format = LIBXL_DISK_FORMAT_UNKNOWN;
>  }
> @@ -2353,6 +2353,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
>  
>      libxl__device device;
>      const char * path;
> +    char * tmp;
>  
>      flexarray_t *insert = NULL;
>  
> @@ -2383,8 +2384,11 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
>      disks = libxl_device_disk_list(ctx, domid, &num);
>      for (i = 0; i < num; i++) {
>          if (disks[i].is_cdrom && !strcmp(disk->vdev, disks[i].vdev))
> -            /* found */
> +        {
> +            /* Found.  Set backend type appropriately. */
> +            disk->backend=disks[i].backend;
>              break;
> +        }
>      }
>      if (i == num) {
>          LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Virtual device not found");
> @@ -2410,6 +2414,17 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
>  
>      path = libxl__device_backend_path(gc, &device);
>  
> +    /* Sanity check: make sure the backend exists before writing here */
> +    tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/frontend", path));
> +    if (!tmp)
> +    {
> +        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Internal error: %s does not exist",
> +            libxl__sprintf(gc, "%s/frontend", path));
> +        rc = ERROR_FAIL;
> +        goto out;
> +    }
> +
> +
>      insert = flexarray_make(gc, 4, 1);
>  
>      flexarray_append_pair(insert, "type",
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 10:10:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:10:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbqD9-0004RM-Ps; Fri, 23 Nov 2012 10:10:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbqD8-0004RG-Vn
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 10:10:15 +0000
Received: from [85.158.137.99:34165] by server-14.bemta-3.messagelabs.com id
	26/45-12788-68B4FA05; Fri, 23 Nov 2012 10:10:14 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1353665412!13464527!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17729 invoked from network); 23 Nov 2012 10:10:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 10:10:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15968781"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 10:10:12 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 10:10:12 +0000
Message-ID: <1353665411.13542.197.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Olaf Hering <olaf@aepfle.de>
Date: Fri, 23 Nov 2012 10:10:11 +0000
In-Reply-To: <a446956472330fe32bc6.1353530980@probook.site>
References: <a446956472330fe32bc6.1353530980@probook.site>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xend: enable environment passing in xPopen3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-21 at 20:49 +0000, Olaf Hering wrote:
> # HG changeset patch
> # User Olaf Hering <olaf@aepfle.de>
> # Date 1353530937 -3600
> # Node ID a446956472330fe32bc69be764a33f59fb090792
> # Parent  2489c29266982175b5b4e945c97b4549360e947f
> xend: enable environment passing in xPopen3
> 
> In changeset 19990:38dd208e1d95 a new parameter 'env' was added to
> xPopen3, but no code was added to actually pass the environment down to
> execvpe. Also, the new code was unreachable.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

It seems that no callers provide an environment? How did you spot this?

> diff -r 2489c2926698 -r a44695647233 tools/python/xen/util/xpopen.py
> --- a/tools/python/xen/util/xpopen.py
> +++ b/tools/python/xen/util/xpopen.py
> @@ -104,7 +104,7 @@ class xPopen3:
>              os.dup2(c2pwrite, 1)
>              if capturestderr:
>                  os.dup2(errin, 2)
> -            self._run_child(cmd)
> +            self._run_child(cmd, env)
>          os.close(p2cread)
>          self.tochild = os.fdopen(p2cwrite, 'w', bufsize)
>          os.close(c2pwrite)
> @@ -116,7 +116,7 @@ class xPopen3:
>              self.childerr = None
>          _active.append(self)
>  
> -    def _run_child(self, cmd):
> +    def _run_child(self, cmd, env):
>          if isinstance(cmd, basestring):
>              cmd = ['/bin/sh', '-c', cmd]
>          for i in range(3, MAXFD):
> @@ -127,7 +127,6 @@ class xPopen3:
>              except OSError:
>                  pass
>          try:
> -            os.execvp(cmd[0], cmd)
>              if env is None:
>                  os.execvp(cmd[0], cmd)
>              else:
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 10:10:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:10:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbqD9-0004RM-Ps; Fri, 23 Nov 2012 10:10:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbqD8-0004RG-Vn
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 10:10:15 +0000
Received: from [85.158.137.99:34165] by server-14.bemta-3.messagelabs.com id
	26/45-12788-68B4FA05; Fri, 23 Nov 2012 10:10:14 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1353665412!13464527!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17729 invoked from network); 23 Nov 2012 10:10:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 10:10:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15968781"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 10:10:12 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 10:10:12 +0000
Message-ID: <1353665411.13542.197.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Olaf Hering <olaf@aepfle.de>
Date: Fri, 23 Nov 2012 10:10:11 +0000
In-Reply-To: <a446956472330fe32bc6.1353530980@probook.site>
References: <a446956472330fe32bc6.1353530980@probook.site>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xend: enable environment passing in xPopen3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-21 at 20:49 +0000, Olaf Hering wrote:
> # HG changeset patch
> # User Olaf Hering <olaf@aepfle.de>
> # Date 1353530937 -3600
> # Node ID a446956472330fe32bc69be764a33f59fb090792
> # Parent  2489c29266982175b5b4e945c97b4549360e947f
> xend: enable environment passing in xPopen3
> 
> In changeset 19990:38dd208e1d95 a new parameter 'env' was added to
> xPopen3, but no code was added to actually pass the environment down to
> execvpe. Also, the new code was unreachable.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

It seems that no callers provide an environment? How did you spot this?

> diff -r 2489c2926698 -r a44695647233 tools/python/xen/util/xpopen.py
> --- a/tools/python/xen/util/xpopen.py
> +++ b/tools/python/xen/util/xpopen.py
> @@ -104,7 +104,7 @@ class xPopen3:
>              os.dup2(c2pwrite, 1)
>              if capturestderr:
>                  os.dup2(errin, 2)
> -            self._run_child(cmd)
> +            self._run_child(cmd, env)
>          os.close(p2cread)
>          self.tochild = os.fdopen(p2cwrite, 'w', bufsize)
>          os.close(c2pwrite)
> @@ -116,7 +116,7 @@ class xPopen3:
>              self.childerr = None
>          _active.append(self)
>  
> -    def _run_child(self, cmd):
> +    def _run_child(self, cmd, env):
>          if isinstance(cmd, basestring):
>              cmd = ['/bin/sh', '-c', cmd]
>          for i in range(3, MAXFD):
> @@ -127,7 +127,6 @@ class xPopen3:
>              except OSError:
>                  pass
>          try:
> -            os.execvp(cmd[0], cmd)
>              if env is None:
>                  os.execvp(cmd[0], cmd)
>              else:
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 10:20:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:20:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbqMZ-0004nV-Uq; Fri, 23 Nov 2012 10:19:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbqMY-0004nP-QZ
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 10:19:59 +0000
Received: from [85.158.139.211:22084] by server-14.bemta-5.messagelabs.com id
	0F/99-21768-ECD4FA05; Fri, 23 Nov 2012 10:19:58 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1353665997!21311990!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10868 invoked from network); 23 Nov 2012 10:19:57 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 10:19:57 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15969065"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 10:19:56 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 10:19:56 +0000
Message-ID: <1353665995.13542.200.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ronny Hegewald <ronny.hegewald@online.de>
Date: Fri, 23 Nov 2012 10:19:55 +0000
In-Reply-To: <201211230014.55979.ronny.hegewald@online.de>
References: <201211230014.55979.ronny.hegewald@online.de>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] libxl - fix a variable underflow in
 libxl_wait_for_free_memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 00:14 +0000, Ronny Hegewald wrote:
> When xl is called to create a domU and there is not enough memory available, 
> then the autoballooning is called to extract memory from dom0. During the 
> ballooning a loop in libxl_wait_for_free_memory() waits unless enough memory 
> is available to create the domU. 
> 
> But because of a variable-underflow the loop can finish too soon and xl 
> finally aborts with the message:
> 
> 
> xc: error: panic: xc_dom_boot.c:161: xc_dom_boot_mem_init: can't allocate low 
> memory for domain: Out of memory                         
> libxl: error: libxl_dom.c:430:libxl__build_pv: xc_dom_boot_mem_init failed: 
> Device or resource busy                                    
> libxl: error: libxl_create.c:901:domcreate_rebuild_done: cannot (re-)build 
> domain: -3        
> 
> 
> The variable-underflow happens when freemem_slack is larger then 
> info.free_pages*4, because the solution of this operation is converted 
> implicit to a unsigned int to match the type of memory_kb.
> 
> The problem is fixed by a proper casting.

Thanks for your patch.

I think the correct fix is to check for the "freemem_slack >
info.free_pages * 4" case explicitly rather than relying on casts.

Ian.

> 
> 
> Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>
> 
> --- xen-4.3-20121121/tools/libxl/libxl.c.org	2012-11-22 03:34:00.000000000 
> +0000
> +++ xen-4.3-20121121/tools/libxl/libxl.c	2012-11-22 03:34:47.000000000 +0000
> @@ -3763,7 +3763,7 @@ int libxl_wait_for_free_memory(libxl_ctx
>          rc = libxl_get_physinfo(ctx, &info);
>          if (rc < 0)
>              goto out;
> -        if (info.free_pages * 4 - freemem_slack >= memory_kb) {
> +        if ((int64_t)(info.free_pages * 4 - freemem_slack) >= memory_kb) {
>              rc = 0;
>              goto out;
>          }
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 10:20:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:20:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbqMZ-0004nV-Uq; Fri, 23 Nov 2012 10:19:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbqMY-0004nP-QZ
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 10:19:59 +0000
Received: from [85.158.139.211:22084] by server-14.bemta-5.messagelabs.com id
	0F/99-21768-ECD4FA05; Fri, 23 Nov 2012 10:19:58 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1353665997!21311990!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10868 invoked from network); 23 Nov 2012 10:19:57 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 10:19:57 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15969065"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 10:19:56 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 10:19:56 +0000
Message-ID: <1353665995.13542.200.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ronny Hegewald <ronny.hegewald@online.de>
Date: Fri, 23 Nov 2012 10:19:55 +0000
In-Reply-To: <201211230014.55979.ronny.hegewald@online.de>
References: <201211230014.55979.ronny.hegewald@online.de>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] libxl - fix a variable underflow in
 libxl_wait_for_free_memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 00:14 +0000, Ronny Hegewald wrote:
> When xl is called to create a domU and there is not enough memory available, 
> then the autoballooning is called to extract memory from dom0. During the 
> ballooning a loop in libxl_wait_for_free_memory() waits unless enough memory 
> is available to create the domU. 
> 
> But because of a variable-underflow the loop can finish too soon and xl 
> finally aborts with the message:
> 
> 
> xc: error: panic: xc_dom_boot.c:161: xc_dom_boot_mem_init: can't allocate low 
> memory for domain: Out of memory                         
> libxl: error: libxl_dom.c:430:libxl__build_pv: xc_dom_boot_mem_init failed: 
> Device or resource busy                                    
> libxl: error: libxl_create.c:901:domcreate_rebuild_done: cannot (re-)build 
> domain: -3        
> 
> 
> The variable-underflow happens when freemem_slack is larger then 
> info.free_pages*4, because the solution of this operation is converted 
> implicit to a unsigned int to match the type of memory_kb.
> 
> The problem is fixed by a proper casting.

Thanks for your patch.

I think the correct fix is to check for the "freemem_slack >
info.free_pages * 4" case explicitly rather than relying on casts.

Ian.

> 
> 
> Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>
> 
> --- xen-4.3-20121121/tools/libxl/libxl.c.org	2012-11-22 03:34:00.000000000 
> +0000
> +++ xen-4.3-20121121/tools/libxl/libxl.c	2012-11-22 03:34:47.000000000 +0000
> @@ -3763,7 +3763,7 @@ int libxl_wait_for_free_memory(libxl_ctx
>          rc = libxl_get_physinfo(ctx, &info);
>          if (rc < 0)
>              goto out;
> -        if (info.free_pages * 4 - freemem_slack >= memory_kb) {
> +        if ((int64_t)(info.free_pages * 4 - freemem_slack) >= memory_kb) {
>              rc = 0;
>              goto out;
>          }
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 10:38:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:38:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbqeM-0005JR-Op; Fri, 23 Nov 2012 10:38:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1TbqeL-0005JM-Ju
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 10:38:21 +0000
Received: from [85.158.138.51:63985] by server-6.bemta-3.messagelabs.com id
	78/BA-28265-C125FA05; Fri, 23 Nov 2012 10:38:20 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1353667098!31097835!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzI2NjY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32337 invoked from network); 23 Nov 2012 10:38:19 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-16.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 10:38:19 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qANAbeQt024421
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 23 Nov 2012 10:37:41 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qANAbcGN002400
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 23 Nov 2012 10:37:39 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qANAbaPC015553; Fri, 23 Nov 2012 04:37:36 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 23 Nov 2012 02:37:36 -0800
Date: Fri, 23 Nov 2012 11:37:26 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121123103726.GB2921@host-192-168-1-59.local.net-space.pl>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
	<18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
	<50AED7B8.7040902@citrix.com>
	<50AF55B102000078000AABF3@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50AF55B102000078000AABF3@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"H. Peter Anvin" <hpa@zytor.com>, "tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, 2012 at 09:53:37AM +0000, Jan Beulich wrote:
> >>> On 23.11.12 at 02:56, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> > On 23/11/2012 01:38, H. Peter Anvin wrote:
> >> I still don't really get why it can't be isolated from dom0, which would
> > make more sense to me, even for a Xen crash.
> >>
> >
> > The crash region (as specified by crashkernel= on the Xen command line)
> > is isolated from dom0.
> >
> > dom0 (using the kexec utility etc) has the task of locating the Xen
> > crash notes (using the kexec hypercall interface), constructing a binary
> > blob containing kernel, initram and gubbins, and asking Xen to put this
> > blob in the crash region (again, using the kexec hypercall interface).
> >
> > I do not see how this is very much different from the native case
> > currently (although please correct me if I am misinformed).  Linux has
> > extra work to do by populating /proc/iomem with the Xen crash regions
> > boot (so the kexec utility can reference their physical addresses when
> > constructing the blob), and should just act as a conduit between the
> > kexec system call and the kexec hypercall to load the blob.
>
> But all of this _could_ be done completely independent of the
> Dom0 kernel's kexec infrastructure (i.e. fully from user space,
> invoking the necessary hypercalls through the privcmd driver).

No, this is impossible. kexec/kdump image lives in dom0 kernel memory
until execution. That is why privcmd driver itself is not a solution
in this case.

> It's just that parts of the kexec infrastructure can be re-used
> (and hence that mechanism probably seemed the easier approach
> to the implementer of the original kexec-on-Xen). If the kernel
> folks dislike that re-use (quite understandably looking at how
> much of it needs to be re-done), that shouldn't prevent us from
> looking into the existing alternatives.

This is last resort option. First I think we should try to find
good solution which reuses existing code as much as possible.

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 10:38:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:38:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbqeM-0005JR-Op; Fri, 23 Nov 2012 10:38:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1TbqeL-0005JM-Ju
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 10:38:21 +0000
Received: from [85.158.138.51:63985] by server-6.bemta-3.messagelabs.com id
	78/BA-28265-C125FA05; Fri, 23 Nov 2012 10:38:20 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1353667098!31097835!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzI2NjY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32337 invoked from network); 23 Nov 2012 10:38:19 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-16.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 10:38:19 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qANAbeQt024421
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 23 Nov 2012 10:37:41 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qANAbcGN002400
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 23 Nov 2012 10:37:39 GMT
Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qANAbaPC015553; Fri, 23 Nov 2012 04:37:36 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 23 Nov 2012 02:37:36 -0800
Date: Fri, 23 Nov 2012 11:37:26 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121123103726.GB2921@host-192-168-1-59.local.net-space.pl>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
	<18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
	<50AED7B8.7040902@citrix.com>
	<50AF55B102000078000AABF3@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50AF55B102000078000AABF3@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"H. Peter Anvin" <hpa@zytor.com>, "tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, 2012 at 09:53:37AM +0000, Jan Beulich wrote:
> >>> On 23.11.12 at 02:56, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> > On 23/11/2012 01:38, H. Peter Anvin wrote:
> >> I still don't really get why it can't be isolated from dom0, which would
> > make more sense to me, even for a Xen crash.
> >>
> >
> > The crash region (as specified by crashkernel= on the Xen command line)
> > is isolated from dom0.
> >
> > dom0 (using the kexec utility etc) has the task of locating the Xen
> > crash notes (using the kexec hypercall interface), constructing a binary
> > blob containing kernel, initram and gubbins, and asking Xen to put this
> > blob in the crash region (again, using the kexec hypercall interface).
> >
> > I do not see how this is very much different from the native case
> > currently (although please correct me if I am misinformed).  Linux has
> > extra work to do by populating /proc/iomem with the Xen crash regions
> > boot (so the kexec utility can reference their physical addresses when
> > constructing the blob), and should just act as a conduit between the
> > kexec system call and the kexec hypercall to load the blob.
>
> But all of this _could_ be done completely independent of the
> Dom0 kernel's kexec infrastructure (i.e. fully from user space,
> invoking the necessary hypercalls through the privcmd driver).

No, this is impossible. kexec/kdump image lives in dom0 kernel memory
until execution. That is why privcmd driver itself is not a solution
in this case.

> It's just that parts of the kexec infrastructure can be re-used
> (and hence that mechanism probably seemed the easier approach
> to the implementer of the original kexec-on-Xen). If the kernel
> folks dislike that re-use (quite understandably looking at how
> much of it needs to be re-done), that shouldn't prevent us from
> looking into the existing alternatives.

This is last resort option. First I think we should try to find
good solution which reuses existing code as much as possible.

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 10:43:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:43:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbqjL-0005VB-L8; Fri, 23 Nov 2012 10:43:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbqjK-0005V5-KR
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 10:43:31 +0000
Received: from [85.158.137.99:53068] by server-1.bemta-3.messagelabs.com id
	AB/EE-12169-1535FA05; Fri, 23 Nov 2012 10:43:29 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1353667408!18617931!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18627 invoked from network); 23 Nov 2012 10:43:28 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-217.messagelabs.com with SMTP;
	23 Nov 2012 10:43:28 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 23 Nov 2012 10:43:27 +0000
Message-Id: <50AF619802000078000AACF5@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 23 Nov 2012 10:44:24 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part5C6DAE98.0__="
Subject: [Xen-devel] [PATCH] linux-2.6.18/scsifront: respect full ring on
 reset processing
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part5C6DAE98.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Additionally, the error return case of the wait_event_interruptible()
at the end of scsifront_dev_reset_handler() wasn't handled, potentially
causing shadow slot corruption.

Doing this also revealed that io_lock was pointless - it was only used
inside the worker thread, i.e. protected nothing.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/drivers/xen/scsifront/common.h
+++ b/drivers/xen/scsifront/common.h
@@ -99,7 +99,6 @@ struct vscsifrnt_info {
=20
 	struct Scsi_Host *host;
=20
-	spinlock_t io_lock;
 	spinlock_t shadow_lock;
 	unsigned int evtchn;
 	unsigned int irq;
@@ -113,8 +112,9 @@ struct vscsifrnt_info {
=20
 	struct task_struct *kthread;
 	wait_queue_head_t wq;
-	unsigned int waiting_resp;
-
+	wait_queue_head_t wq_sync;
+	unsigned int waiting_resp:1;
+	unsigned int waiting_sync:1;
 };
=20
 #define DPRINTK(_f, _a...)				\
--- a/drivers/xen/scsifront/scsifront.c
+++ b/drivers/xen/scsifront/scsifront.c
@@ -49,16 +49,19 @@ static int get_id_from_freelist(struct v
 	return free;
 }
=20
-static void add_id_to_freelist(struct vscsifrnt_info *info, uint32_t id)
+static void _add_id_to_freelist(struct vscsifrnt_info *info, uint32_t id)
 {
-	unsigned long flags;
-
-	spin_lock_irqsave(&info->shadow_lock, flags);
-
 	info->shadow[id].next_free =3D info->shadow_free;
 	info->shadow[id].sc =3D NULL;
 	info->shadow_free =3D id;
+}
=20
+static void add_id_to_freelist(struct vscsifrnt_info *info, uint32_t id)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&info->shadow_lock, flags);
+	_add_id_to_freelist(info, id);
 	spin_unlock_irqrestore(&info->shadow_lock, flags);
 }
=20
@@ -169,7 +172,19 @@ static void scsifront_sync_cmd_done(stru
 =09
 	spin_lock_irqsave(&info->shadow_lock, flags);
 	info->shadow[id].wait_reset =3D 1;
-	info->shadow[id].rslt_reset =3D ring_res->rslt;
+	switch (info->shadow[id].rslt_reset) {
+	case 0:
+		info->shadow[id].rslt_reset =3D ring_res->rslt;
+		break;
+	case -1:
+		_add_id_to_freelist(info, id);
+		break;
+	default:
+		shost_printk(KERN_ERR "scsifront: ", info->host,
+			     "bad reset state %d, possibly leaking %u\n",
+			     info->shadow[id].rslt_reset, id);
+		break;
+	}
 	spin_unlock_irqrestore(&info->shadow_lock, flags);
=20
 	wake_up(&(info->shadow[id].wq_reset));
@@ -184,7 +199,7 @@ static int scsifront_cmd_done(struct vsc
 	int more_to_do =3D 0;
 	unsigned long flags;
=20
-	spin_lock_irqsave(&info->io_lock, flags);
+	spin_lock_irqsave(info->host->host_lock, flags);
=20
 	rp =3D info->ring.sring->rsp_prod;
 	rmb();
@@ -206,8 +221,11 @@ static int scsifront_cmd_done(struct vsc
 		info->ring.sring->rsp_event =3D i + 1;
 	}
=20
-	spin_unlock_irqrestore(&info->io_lock, flags);
+	info->waiting_sync =3D 0;
=20
+	spin_unlock_irqrestore(info->host->host_lock, flags);
+
+	wake_up(&info->wq_sync);
=20
 	/* Yield point for this unbounded loop. */
 	cond_resched();
@@ -425,17 +443,33 @@ static int scsifront_dev_reset_handler(s
=20
 	vscsiif_request_t *ring_req;
 	uint16_t rqid;
-	int err;
+	int err =3D 0;
=20
+	for (;;) {
 #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,12)
-	spin_lock_irq(host->host_lock);
+		spin_lock_irq(host->host_lock);
 #endif
+		if (!RING_FULL(&info->ring))
+			break;
+		if (err) {
+#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,12)
+			spin_unlock_irq(host->host_lock);
+#endif
+			return FAILED;
+		}
+		info->waiting_sync =3D 1;
+		spin_unlock_irq(host->host_lock);
+		err =3D wait_event_interruptible(info->wq_sync,
+					       !info->waiting_sync);
+		spin_lock_irq(host->host_lock);
+	}
=20
 	ring_req      =3D scsifront_pre_request(info);
 	ring_req->act =3D VSCSIIF_ACT_SCSI_RESET;
=20
 	rqid          =3D ring_req->rqid;
 	info->shadow[rqid].act =3D VSCSIIF_ACT_SCSI_RESET;
+	info->shadow[rqid].rslt_reset =3D 0;
=20
 	ring_req->channel =3D sc->device->channel;
 	ring_req->id      =3D sc->device->id;
@@ -454,13 +488,19 @@ static int scsifront_dev_reset_handler(s
 	scsifront_do_request(info);=09
=20
 	spin_unlock_irq(host->host_lock);
-	wait_event_interruptible(info->shadow[rqid].wq_reset,
-			 info->shadow[rqid].wait_reset);
+	err =3D wait_event_interruptible(info->shadow[rqid].wq_reset,
+				       info->shadow[rqid].wait_reset);
 	spin_lock_irq(host->host_lock);
=20
-	err =3D info->shadow[rqid].rslt_reset;
-
-	add_id_to_freelist(info, rqid);
+	if (!err) {
+		err =3D info->shadow[rqid].rslt_reset;
+		add_id_to_freelist(info, rqid);
+	} else {
+		spin_lock(&info->shadow_lock);
+		info->shadow[rqid].rslt_reset =3D -1;
+		spin_unlock(&info->shadow_lock);
+		err =3D FAILED;
+	}
=20
 #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,12)
 	spin_unlock_irq(host->host_lock);
--- a/drivers/xen/scsifront/xenbus.c
+++ b/drivers/xen/scsifront/xenbus.c
@@ -205,7 +205,7 @@ static int scsifront_probe(struct xenbus
 	}
=20
 	init_waitqueue_head(&info->wq);
-	spin_lock_init(&info->io_lock);
+	init_waitqueue_head(&info->wq_sync);
 	spin_lock_init(&info->shadow_lock);
=20
 	snprintf(name, DEFAULT_TASK_COMM_LEN, "vscsiif.%d", info->host->hos=
t_no);



--=__Part5C6DAE98.0__=
Content-Type: text/plain; name="xen-scsifront-reset-ring-empty.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-scsifront-reset-ring-empty.patch"

scsifront: respect full ring on reset processing=0A=0AAdditionally, the =
error return case of the wait_event_interruptible()=0Aat the end of =
scsifront_dev_reset_handler() wasn't handled, potentially=0Acausing shadow =
slot corruption.=0A=0ADoing this also revealed that io_lock was pointless =
- it was only used=0Ainside the worker thread, i.e. protected nothing.=0A=
=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- a/drivers/xen/sc=
sifront/common.h=0A+++ b/drivers/xen/scsifront/common.h=0A@@ -99,7 +99,6 =
@@ struct vscsifrnt_info {=0A =0A 	struct Scsi_Host *host;=0A =0A-	=
spinlock_t io_lock;=0A 	spinlock_t shadow_lock;=0A 	unsigned int =
evtchn;=0A 	unsigned int irq;=0A@@ -113,8 +112,9 @@ struct vscsifrnt_in=
fo {=0A =0A 	struct task_struct *kthread;=0A 	wait_queue_head_t =
wq;=0A-	unsigned int waiting_resp;=0A-=0A+	wait_queue_head_t =
wq_sync;=0A+	unsigned int waiting_resp:1;=0A+	unsigned int =
waiting_sync:1;=0A };=0A =0A #define DPRINTK(_f, _a...)				=
\=0A--- a/drivers/xen/scsifront/scsifront.c=0A+++ b/drivers/xen/scsifront/s=
csifront.c=0A@@ -49,16 +49,19 @@ static int get_id_from_freelist(struct =
v=0A 	return free;=0A }=0A =0A-static void add_id_to_freelist(struct =
vscsifrnt_info *info, uint32_t id)=0A+static void _add_id_to_freelist(struc=
t vscsifrnt_info *info, uint32_t id)=0A {=0A-	unsigned long flags;=0A-=0A=
-	spin_lock_irqsave(&info->shadow_lock, flags);=0A-=0A 	info->shado=
w[id].next_free =3D info->shadow_free;=0A 	info->shadow[id].sc =3D =
NULL;=0A 	info->shadow_free =3D id;=0A+}=0A =0A+static void =
add_id_to_freelist(struct vscsifrnt_info *info, uint32_t id)=0A+{=0A+	=
unsigned long flags;=0A+=0A+	spin_lock_irqsave(&info->shadow_lock, =
flags);=0A+	_add_id_to_freelist(info, id);=0A 	spin_unlock_irqrest=
ore(&info->shadow_lock, flags);=0A }=0A =0A@@ -169,7 +172,19 @@ static =
void scsifront_sync_cmd_done(stru=0A 	=0A 	spin_lock_irqsave(&info->sh=
adow_lock, flags);=0A 	info->shadow[id].wait_reset =3D 1;=0A-	info->shado=
w[id].rslt_reset =3D ring_res->rslt;=0A+	switch (info->shadow[id].rs=
lt_reset) {=0A+	case 0:=0A+		info->shadow[id].rslt_reset =3D =
ring_res->rslt;=0A+		break;=0A+	case -1:=0A+		=
_add_id_to_freelist(info, id);=0A+		break;=0A+	default:=0A=
+		shost_printk(KERN_ERR "scsifront: ", info->host,=0A+		=
	     "bad reset state %d, possibly leaking %u\n",=0A+			=
     info->shadow[id].rslt_reset, id);=0A+		break;=0A+	=
}=0A 	spin_unlock_irqrestore(&info->shadow_lock, flags);=0A =0A 	=
wake_up(&(info->shadow[id].wq_reset));=0A@@ -184,7 +199,7 @@ static int =
scsifront_cmd_done(struct vsc=0A 	int more_to_do =3D 0;=0A 	=
unsigned long flags;=0A =0A-	spin_lock_irqsave(&info->io_lock, =
flags);=0A+	spin_lock_irqsave(info->host->host_lock, flags);=0A =0A 	=
rp =3D info->ring.sring->rsp_prod;=0A 	rmb();=0A@@ -206,8 +221,11 @@ =
static int scsifront_cmd_done(struct vsc=0A 		info->ring.sring->r=
sp_event =3D i + 1;=0A 	}=0A =0A-	spin_unlock_irqrestore(&info->io_lo=
ck, flags);=0A+	info->waiting_sync =3D 0;=0A =0A+	spin_unlock_irqrest=
ore(info->host->host_lock, flags);=0A+=0A+	wake_up(&info->wq_sync);=0A=
 =0A 	/* Yield point for this unbounded loop. */=0A 	cond_resched();=0A@=
@ -425,17 +443,33 @@ static int scsifront_dev_reset_handler(s=0A =0A 	=
vscsiif_request_t *ring_req;=0A 	uint16_t rqid;=0A-	int =
err;=0A+	int err =3D 0;=0A =0A+	for (;;) {=0A #if LINUX_VERSION_COD=
E >=3D KERNEL_VERSION(2,6,12)=0A-	spin_lock_irq(host->host_lock);=0A+=
		spin_lock_irq(host->host_lock);=0A #endif=0A+		if =
(!RING_FULL(&info->ring))=0A+			break;=0A+		if =
(err) {=0A+#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,12)=0A+		=
	spin_unlock_irq(host->host_lock);=0A+#endif=0A+			=
return FAILED;=0A+		}=0A+		info->waiting_sync =3D =
1;=0A+		spin_unlock_irq(host->host_lock);=0A+		err =3D =
wait_event_interruptible(info->wq_sync,=0A+					=
       !info->waiting_sync);=0A+		spin_lock_irq(host->host_lo=
ck);=0A+	}=0A =0A 	ring_req      =3D scsifront_pre_request(inf=
o);=0A 	ring_req->act =3D VSCSIIF_ACT_SCSI_RESET;=0A =0A 	rqid       =
   =3D ring_req->rqid;=0A 	info->shadow[rqid].act =3D VSCSIIF_ACT_SCSI=
_RESET;=0A+	info->shadow[rqid].rslt_reset =3D 0;=0A =0A 	ring_req->c=
hannel =3D sc->device->channel;=0A 	ring_req->id      =3D sc->device->i=
d;=0A@@ -454,13 +488,19 @@ static int scsifront_dev_reset_handler(s=0A 	=
scsifront_do_request(info);	=0A =0A 	spin_unlock_irq(host->host_=
lock);=0A-	wait_event_interruptible(info->shadow[rqid].wq_reset,=0A-	=
		 info->shadow[rqid].wait_reset);=0A+	err =3D wait_event_=
interruptible(info->shadow[rqid].wq_reset,=0A+				   =
    info->shadow[rqid].wait_reset);=0A 	spin_lock_irq(host->host_lock);=0A =
=0A-	err =3D info->shadow[rqid].rslt_reset;=0A-=0A-	add_id_to_freelist(=
info, rqid);=0A+	if (!err) {=0A+		err =3D info->shadow[rqid].=
rslt_reset;=0A+		add_id_to_freelist(info, rqid);=0A+	} else =
{=0A+		spin_lock(&info->shadow_lock);=0A+		info->shado=
w[rqid].rslt_reset =3D -1;=0A+		spin_unlock(&info->shadow_lock);=0A=
+		err =3D FAILED;=0A+	}=0A =0A #if LINUX_VERSION_CODE =
>=3D KERNEL_VERSION(2,6,12)=0A 	spin_unlock_irq(host->host_lock);=0A--- =
a/drivers/xen/scsifront/xenbus.c=0A+++ b/drivers/xen/scsifront/xenbus.c=0A@=
@ -205,7 +205,7 @@ static int scsifront_probe(struct xenbus=0A 	}=0A =0A 	=
init_waitqueue_head(&info->wq);=0A-	spin_lock_init(&info->io_lock);=0A+=
	init_waitqueue_head(&info->wq_sync);=0A 	spin_lock_init(&inf=
o->shadow_lock);=0A =0A 	snprintf(name, DEFAULT_TASK_COMM_LEN, =
"vscsiif.%d", info->host->host_no);=0A
--=__Part5C6DAE98.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.xen.org
http://lists.xen.org/xen-devel

--=__Part5C6DAE98.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 23 10:43:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:43:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbqjL-0005VB-L8; Fri, 23 Nov 2012 10:43:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TbqjK-0005V5-KR
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 10:43:31 +0000
Received: from [85.158.137.99:53068] by server-1.bemta-3.messagelabs.com id
	AB/EE-12169-1535FA05; Fri, 23 Nov 2012 10:43:29 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1353667408!18617931!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18627 invoked from network); 23 Nov 2012 10:43:28 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-217.messagelabs.com with SMTP;
	23 Nov 2012 10:43:28 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 23 Nov 2012 10:43:27 +0000
Message-Id: <50AF619802000078000AACF5@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 23 Nov 2012 10:44:24 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part5C6DAE98.0__="
Subject: [Xen-devel] [PATCH] linux-2.6.18/scsifront: respect full ring on
 reset processing
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part5C6DAE98.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Additionally, the error return case of the wait_event_interruptible()
at the end of scsifront_dev_reset_handler() wasn't handled, potentially
causing shadow slot corruption.

Doing this also revealed that io_lock was pointless - it was only used
inside the worker thread, i.e. protected nothing.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/drivers/xen/scsifront/common.h
+++ b/drivers/xen/scsifront/common.h
@@ -99,7 +99,6 @@ struct vscsifrnt_info {
=20
 	struct Scsi_Host *host;
=20
-	spinlock_t io_lock;
 	spinlock_t shadow_lock;
 	unsigned int evtchn;
 	unsigned int irq;
@@ -113,8 +112,9 @@ struct vscsifrnt_info {
=20
 	struct task_struct *kthread;
 	wait_queue_head_t wq;
-	unsigned int waiting_resp;
-
+	wait_queue_head_t wq_sync;
+	unsigned int waiting_resp:1;
+	unsigned int waiting_sync:1;
 };
=20
 #define DPRINTK(_f, _a...)				\
--- a/drivers/xen/scsifront/scsifront.c
+++ b/drivers/xen/scsifront/scsifront.c
@@ -49,16 +49,19 @@ static int get_id_from_freelist(struct v
 	return free;
 }
=20
-static void add_id_to_freelist(struct vscsifrnt_info *info, uint32_t id)
+static void _add_id_to_freelist(struct vscsifrnt_info *info, uint32_t id)
 {
-	unsigned long flags;
-
-	spin_lock_irqsave(&info->shadow_lock, flags);
-
 	info->shadow[id].next_free =3D info->shadow_free;
 	info->shadow[id].sc =3D NULL;
 	info->shadow_free =3D id;
+}
=20
+static void add_id_to_freelist(struct vscsifrnt_info *info, uint32_t id)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&info->shadow_lock, flags);
+	_add_id_to_freelist(info, id);
 	spin_unlock_irqrestore(&info->shadow_lock, flags);
 }
=20
@@ -169,7 +172,19 @@ static void scsifront_sync_cmd_done(stru
 =09
 	spin_lock_irqsave(&info->shadow_lock, flags);
 	info->shadow[id].wait_reset =3D 1;
-	info->shadow[id].rslt_reset =3D ring_res->rslt;
+	switch (info->shadow[id].rslt_reset) {
+	case 0:
+		info->shadow[id].rslt_reset =3D ring_res->rslt;
+		break;
+	case -1:
+		_add_id_to_freelist(info, id);
+		break;
+	default:
+		shost_printk(KERN_ERR "scsifront: ", info->host,
+			     "bad reset state %d, possibly leaking %u\n",
+			     info->shadow[id].rslt_reset, id);
+		break;
+	}
 	spin_unlock_irqrestore(&info->shadow_lock, flags);
=20
 	wake_up(&(info->shadow[id].wq_reset));
@@ -184,7 +199,7 @@ static int scsifront_cmd_done(struct vsc
 	int more_to_do =3D 0;
 	unsigned long flags;
=20
-	spin_lock_irqsave(&info->io_lock, flags);
+	spin_lock_irqsave(info->host->host_lock, flags);
=20
 	rp =3D info->ring.sring->rsp_prod;
 	rmb();
@@ -206,8 +221,11 @@ static int scsifront_cmd_done(struct vsc
 		info->ring.sring->rsp_event =3D i + 1;
 	}
=20
-	spin_unlock_irqrestore(&info->io_lock, flags);
+	info->waiting_sync =3D 0;
=20
+	spin_unlock_irqrestore(info->host->host_lock, flags);
+
+	wake_up(&info->wq_sync);
=20
 	/* Yield point for this unbounded loop. */
 	cond_resched();
@@ -425,17 +443,33 @@ static int scsifront_dev_reset_handler(s
=20
 	vscsiif_request_t *ring_req;
 	uint16_t rqid;
-	int err;
+	int err =3D 0;
=20
+	for (;;) {
 #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,12)
-	spin_lock_irq(host->host_lock);
+		spin_lock_irq(host->host_lock);
 #endif
+		if (!RING_FULL(&info->ring))
+			break;
+		if (err) {
+#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,12)
+			spin_unlock_irq(host->host_lock);
+#endif
+			return FAILED;
+		}
+		info->waiting_sync =3D 1;
+		spin_unlock_irq(host->host_lock);
+		err =3D wait_event_interruptible(info->wq_sync,
+					       !info->waiting_sync);
+		spin_lock_irq(host->host_lock);
+	}
=20
 	ring_req      =3D scsifront_pre_request(info);
 	ring_req->act =3D VSCSIIF_ACT_SCSI_RESET;
=20
 	rqid          =3D ring_req->rqid;
 	info->shadow[rqid].act =3D VSCSIIF_ACT_SCSI_RESET;
+	info->shadow[rqid].rslt_reset =3D 0;
=20
 	ring_req->channel =3D sc->device->channel;
 	ring_req->id      =3D sc->device->id;
@@ -454,13 +488,19 @@ static int scsifront_dev_reset_handler(s
 	scsifront_do_request(info);=09
=20
 	spin_unlock_irq(host->host_lock);
-	wait_event_interruptible(info->shadow[rqid].wq_reset,
-			 info->shadow[rqid].wait_reset);
+	err =3D wait_event_interruptible(info->shadow[rqid].wq_reset,
+				       info->shadow[rqid].wait_reset);
 	spin_lock_irq(host->host_lock);
=20
-	err =3D info->shadow[rqid].rslt_reset;
-
-	add_id_to_freelist(info, rqid);
+	if (!err) {
+		err =3D info->shadow[rqid].rslt_reset;
+		add_id_to_freelist(info, rqid);
+	} else {
+		spin_lock(&info->shadow_lock);
+		info->shadow[rqid].rslt_reset =3D -1;
+		spin_unlock(&info->shadow_lock);
+		err =3D FAILED;
+	}
=20
 #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,12)
 	spin_unlock_irq(host->host_lock);
--- a/drivers/xen/scsifront/xenbus.c
+++ b/drivers/xen/scsifront/xenbus.c
@@ -205,7 +205,7 @@ static int scsifront_probe(struct xenbus
 	}
=20
 	init_waitqueue_head(&info->wq);
-	spin_lock_init(&info->io_lock);
+	init_waitqueue_head(&info->wq_sync);
 	spin_lock_init(&info->shadow_lock);
=20
 	snprintf(name, DEFAULT_TASK_COMM_LEN, "vscsiif.%d", info->host->hos=
t_no);



--=__Part5C6DAE98.0__=
Content-Type: text/plain; name="xen-scsifront-reset-ring-empty.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-scsifront-reset-ring-empty.patch"

scsifront: respect full ring on reset processing=0A=0AAdditionally, the =
error return case of the wait_event_interruptible()=0Aat the end of =
scsifront_dev_reset_handler() wasn't handled, potentially=0Acausing shadow =
slot corruption.=0A=0ADoing this also revealed that io_lock was pointless =
- it was only used=0Ainside the worker thread, i.e. protected nothing.=0A=
=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- a/drivers/xen/sc=
sifront/common.h=0A+++ b/drivers/xen/scsifront/common.h=0A@@ -99,7 +99,6 =
@@ struct vscsifrnt_info {=0A =0A 	struct Scsi_Host *host;=0A =0A-	=
spinlock_t io_lock;=0A 	spinlock_t shadow_lock;=0A 	unsigned int =
evtchn;=0A 	unsigned int irq;=0A@@ -113,8 +112,9 @@ struct vscsifrnt_in=
fo {=0A =0A 	struct task_struct *kthread;=0A 	wait_queue_head_t =
wq;=0A-	unsigned int waiting_resp;=0A-=0A+	wait_queue_head_t =
wq_sync;=0A+	unsigned int waiting_resp:1;=0A+	unsigned int =
waiting_sync:1;=0A };=0A =0A #define DPRINTK(_f, _a...)				=
\=0A--- a/drivers/xen/scsifront/scsifront.c=0A+++ b/drivers/xen/scsifront/s=
csifront.c=0A@@ -49,16 +49,19 @@ static int get_id_from_freelist(struct =
v=0A 	return free;=0A }=0A =0A-static void add_id_to_freelist(struct =
vscsifrnt_info *info, uint32_t id)=0A+static void _add_id_to_freelist(struc=
t vscsifrnt_info *info, uint32_t id)=0A {=0A-	unsigned long flags;=0A-=0A=
-	spin_lock_irqsave(&info->shadow_lock, flags);=0A-=0A 	info->shado=
w[id].next_free =3D info->shadow_free;=0A 	info->shadow[id].sc =3D =
NULL;=0A 	info->shadow_free =3D id;=0A+}=0A =0A+static void =
add_id_to_freelist(struct vscsifrnt_info *info, uint32_t id)=0A+{=0A+	=
unsigned long flags;=0A+=0A+	spin_lock_irqsave(&info->shadow_lock, =
flags);=0A+	_add_id_to_freelist(info, id);=0A 	spin_unlock_irqrest=
ore(&info->shadow_lock, flags);=0A }=0A =0A@@ -169,7 +172,19 @@ static =
void scsifront_sync_cmd_done(stru=0A 	=0A 	spin_lock_irqsave(&info->sh=
adow_lock, flags);=0A 	info->shadow[id].wait_reset =3D 1;=0A-	info->shado=
w[id].rslt_reset =3D ring_res->rslt;=0A+	switch (info->shadow[id].rs=
lt_reset) {=0A+	case 0:=0A+		info->shadow[id].rslt_reset =3D =
ring_res->rslt;=0A+		break;=0A+	case -1:=0A+		=
_add_id_to_freelist(info, id);=0A+		break;=0A+	default:=0A=
+		shost_printk(KERN_ERR "scsifront: ", info->host,=0A+		=
	     "bad reset state %d, possibly leaking %u\n",=0A+			=
     info->shadow[id].rslt_reset, id);=0A+		break;=0A+	=
}=0A 	spin_unlock_irqrestore(&info->shadow_lock, flags);=0A =0A 	=
wake_up(&(info->shadow[id].wq_reset));=0A@@ -184,7 +199,7 @@ static int =
scsifront_cmd_done(struct vsc=0A 	int more_to_do =3D 0;=0A 	=
unsigned long flags;=0A =0A-	spin_lock_irqsave(&info->io_lock, =
flags);=0A+	spin_lock_irqsave(info->host->host_lock, flags);=0A =0A 	=
rp =3D info->ring.sring->rsp_prod;=0A 	rmb();=0A@@ -206,8 +221,11 @@ =
static int scsifront_cmd_done(struct vsc=0A 		info->ring.sring->r=
sp_event =3D i + 1;=0A 	}=0A =0A-	spin_unlock_irqrestore(&info->io_lo=
ck, flags);=0A+	info->waiting_sync =3D 0;=0A =0A+	spin_unlock_irqrest=
ore(info->host->host_lock, flags);=0A+=0A+	wake_up(&info->wq_sync);=0A=
 =0A 	/* Yield point for this unbounded loop. */=0A 	cond_resched();=0A@=
@ -425,17 +443,33 @@ static int scsifront_dev_reset_handler(s=0A =0A 	=
vscsiif_request_t *ring_req;=0A 	uint16_t rqid;=0A-	int =
err;=0A+	int err =3D 0;=0A =0A+	for (;;) {=0A #if LINUX_VERSION_COD=
E >=3D KERNEL_VERSION(2,6,12)=0A-	spin_lock_irq(host->host_lock);=0A+=
		spin_lock_irq(host->host_lock);=0A #endif=0A+		if =
(!RING_FULL(&info->ring))=0A+			break;=0A+		if =
(err) {=0A+#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,12)=0A+		=
	spin_unlock_irq(host->host_lock);=0A+#endif=0A+			=
return FAILED;=0A+		}=0A+		info->waiting_sync =3D =
1;=0A+		spin_unlock_irq(host->host_lock);=0A+		err =3D =
wait_event_interruptible(info->wq_sync,=0A+					=
       !info->waiting_sync);=0A+		spin_lock_irq(host->host_lo=
ck);=0A+	}=0A =0A 	ring_req      =3D scsifront_pre_request(inf=
o);=0A 	ring_req->act =3D VSCSIIF_ACT_SCSI_RESET;=0A =0A 	rqid       =
   =3D ring_req->rqid;=0A 	info->shadow[rqid].act =3D VSCSIIF_ACT_SCSI=
_RESET;=0A+	info->shadow[rqid].rslt_reset =3D 0;=0A =0A 	ring_req->c=
hannel =3D sc->device->channel;=0A 	ring_req->id      =3D sc->device->i=
d;=0A@@ -454,13 +488,19 @@ static int scsifront_dev_reset_handler(s=0A 	=
scsifront_do_request(info);	=0A =0A 	spin_unlock_irq(host->host_=
lock);=0A-	wait_event_interruptible(info->shadow[rqid].wq_reset,=0A-	=
		 info->shadow[rqid].wait_reset);=0A+	err =3D wait_event_=
interruptible(info->shadow[rqid].wq_reset,=0A+				   =
    info->shadow[rqid].wait_reset);=0A 	spin_lock_irq(host->host_lock);=0A =
=0A-	err =3D info->shadow[rqid].rslt_reset;=0A-=0A-	add_id_to_freelist(=
info, rqid);=0A+	if (!err) {=0A+		err =3D info->shadow[rqid].=
rslt_reset;=0A+		add_id_to_freelist(info, rqid);=0A+	} else =
{=0A+		spin_lock(&info->shadow_lock);=0A+		info->shado=
w[rqid].rslt_reset =3D -1;=0A+		spin_unlock(&info->shadow_lock);=0A=
+		err =3D FAILED;=0A+	}=0A =0A #if LINUX_VERSION_CODE =
>=3D KERNEL_VERSION(2,6,12)=0A 	spin_unlock_irq(host->host_lock);=0A--- =
a/drivers/xen/scsifront/xenbus.c=0A+++ b/drivers/xen/scsifront/xenbus.c=0A@=
@ -205,7 +205,7 @@ static int scsifront_probe(struct xenbus=0A 	}=0A =0A 	=
init_waitqueue_head(&info->wq);=0A-	spin_lock_init(&info->io_lock);=0A+=
	init_waitqueue_head(&info->wq_sync);=0A 	spin_lock_init(&inf=
o->shadow_lock);=0A =0A 	snprintf(name, DEFAULT_TASK_COMM_LEN, =
"vscsiif.%d", info->host->host_no);=0A
--=__Part5C6DAE98.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.xen.org
http://lists.xen.org/xen-devel

--=__Part5C6DAE98.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 23 10:45:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:45:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbql2-0005hq-5O; Fri, 23 Nov 2012 10:45:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tbql1-0005hi-0P
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 10:45:15 +0000
Received: from [85.158.137.99:13264] by server-11.bemta-3.messagelabs.com id
	95/C2-19361-AB35FA05; Fri, 23 Nov 2012 10:45:14 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353667512!15176212!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21752 invoked from network); 23 Nov 2012 10:45:12 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-217.messagelabs.com with SMTP;
	23 Nov 2012 10:45:12 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 23 Nov 2012 10:45:12 +0000
Message-Id: <50AF620002000078000AACF9@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 23 Nov 2012 10:46:08 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part2415D6E0.0__="
Subject: [Xen-devel] [PATCH] linux-2.6.18/scsifront: consolidate printing
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part2415D6E0.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Use shost_printk() or dev_err() instead of plain printk().

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/drivers/xen/scsifront/scsifront.c
+++ b/drivers/xen/scsifront/scsifront.c
@@ -30,6 +30,8 @@
 =20
 #include "common.h"
=20
+#define PREFIX(lvl) KERN_##lvl "scsifront: "
+
 static int get_id_from_freelist(struct vscsifrnt_info *info)
 {
 	unsigned long flags;
@@ -108,26 +110,22 @@ irqreturn_t scsifront_intr(int irq, void
 }
=20
=20
-static void scsifront_gnttab_done(struct vscsifrnt_shadow *s, uint32_t =
id)
+static void scsifront_gnttab_done(struct vscsifrnt_info *info, uint32_t =
id)
 {
+	struct vscsifrnt_shadow *s =3D &info->shadow[id];
 	int i;
=20
 	if (s->sc->sc_data_direction =3D=3D DMA_NONE)
 		return;
=20
-	if (s->nr_segments) {
-		for (i =3D 0; i < s->nr_segments; i++) {
-			if (unlikely(gnttab_query_foreign_access(
-				s->gref[i]) !=3D 0)) {
-				printk(KERN_ALERT "scsifront: "
-					"grant still in use by backend.\n")=
;
-				BUG();
-			}
-			gnttab_end_foreign_access(s->gref[i], 0UL);
+	for (i =3D 0; i < s->nr_segments; i++) {
+		if (unlikely(gnttab_query_foreign_access(s->gref[i]) !=3D =
0)) {
+			shost_printk(PREFIX(ALERT), info->host,
+				     "grant still in use by backend\n");
+			BUG();
 		}
+		gnttab_end_foreign_access(s->gref[i], 0UL);
 	}
-
-	return;
 }
=20
=20
@@ -144,7 +142,7 @@ static void scsifront_cdb_cmd_done(struc
 	if (sc =3D=3D NULL)
 		BUG();
=20
-	scsifront_gnttab_done(&info->shadow[id], id);
+	scsifront_gnttab_done(info, id);
 	add_id_to_freelist(info, id);
=20
 	sc->result =3D ring_res->rslt;
@@ -180,7 +178,7 @@ static void scsifront_sync_cmd_done(stru
 		_add_id_to_freelist(info, id);
 		break;
 	default:
-		shost_printk(KERN_ERR "scsifront: ", info->host,
+		shost_printk(PREFIX(ERR), info->host,
 			     "bad reset state %d, possibly leaking %u\n",
 			     info->shadow[id].rslt_reset, id);
 		break;
@@ -272,7 +270,8 @@ static int map_data_for_request(struct v
=20
 	err =3D gnttab_alloc_grant_references(VSCSIIF_SG_TABLESIZE, =
&gref_head);
 	if (err) {
-		printk(KERN_ERR "scsifront: gnttab_alloc_grant_references()=
 error\n");
+		shost_printk(PREFIX(ERR), info->host,
+			     "gnttab_alloc_grant_references() error\n");
 		return -ENOMEM;
 	}
=20
@@ -282,7 +281,8 @@ static int map_data_for_request(struct v
 		nr_pages =3D (sc->request_bufflen + sg[0].offset + =
PAGE_SIZE - 1) >> PAGE_SHIFT;
=20
 		if (nr_pages > VSCSIIF_SG_TABLESIZE) {
-			printk(KERN_ERR "scsifront: Unable to map =
request_buffer for command!\n");
+			shost_printk(PREFIX(ERR), info->host,
+				     "Unable to map request_buffer for =
command!\n");
 			ref_cnt =3D (-E2BIG);
 			goto big_to_sg;
 		}
@@ -369,9 +369,11 @@ static int scsifront_queuecommand(struct
 	uint16_t rqid;
=20
 /* debug printk to identify more missing scsi commands
-	printk(KERN_INFO "scsicmd: len=3D%i, 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,=
0x%x,0x%x,0x%x,0x%x",sc->cmd_len,
-		sc->cmnd[0],sc->cmnd[1],sc->cmnd[2],sc->cmnd[3],sc->cmnd[4]=
,
-		sc->cmnd[5],sc->cmnd[6],sc->cmnd[7],sc->cmnd[8],sc->cmnd[9]=
);
+	shost_printk(KERN_INFO "scsicmd: ", sc->device->host,
+		     "len=3D%u %#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x\n",
+		     sc->cmd_len, sc->cmnd[0], sc->cmnd[1],
+		     sc->cmnd[2], sc->cmnd[3], sc->cmnd[4], sc->cmnd[5],
+		     sc->cmnd[6], sc->cmnd[7], sc->cmnd[8], sc->cmnd[9]);
 */
 	if (RING_FULL(&info->ring)) {
 		goto out_host_busy;
--- a/drivers/xen/scsifront/xenbus.c
+++ b/drivers/xen/scsifront/xenbus.c
@@ -214,7 +214,7 @@ static int scsifront_probe(struct xenbus
 	if (IS_ERR(info->kthread)) {
 		err =3D PTR_ERR(info->kthread);
 		info->kthread =3D NULL;
-		printk(KERN_ERR "scsifront: kthread start err %d\n", err);
+		dev_err(&dev->dev, "kthread start err %d\n", err);
 		goto free_sring;
 	}
=20
@@ -226,7 +226,7 @@ static int scsifront_probe(struct xenbus
=20
 	err =3D scsi_add_host(host, &dev->dev);
 	if (err) {
-		printk(KERN_ERR "scsifront: fail to add scsi host %d\n", =
err);
+		dev_err(&dev->dev, "fail to add scsi host %d\n", err);
 		goto free_sring;
 	}
=20
@@ -317,7 +317,7 @@ static void scsifront_do_lun_hotplug(str
 			if (device_state =3D=3D XenbusStateInitialised) {
 				sdev =3D scsi_device_lookup(info->host, =
chn, tgt, lun);
 				if (sdev) {
-					printk(KERN_ERR "scsifront: Device =
already in use.\n");
+					dev_err(&dev->dev, "Device already =
in use.\n");
 					scsi_device_put(sdev);
 					xenbus_printf(XBT_NIL, dev->nodenam=
e,
 						state_str, "%d", XenbusStat=
eClosed);



--=__Part2415D6E0.0__=
Content-Type: text/plain; name="xen-scsifront-printing.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-scsifront-printing.patch"

scsifront: consolidate printing=0A=0AUse shost_printk() or dev_err() =
instead of plain printk().=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.c=
om>=0A=0A--- a/drivers/xen/scsifront/scsifront.c=0A+++ b/drivers/xen/scsifr=
ont/scsifront.c=0A@@ -30,6 +30,8 @@=0A  =0A #include "common.h"=0A =
=0A+#define PREFIX(lvl) KERN_##lvl "scsifront: "=0A+=0A static int =
get_id_from_freelist(struct vscsifrnt_info *info)=0A {=0A 	unsigned =
long flags;=0A@@ -108,26 +110,22 @@ irqreturn_t scsifront_intr(int irq, =
void=0A }=0A =0A =0A-static void scsifront_gnttab_done(struct vscsifrnt_sha=
dow *s, uint32_t id)=0A+static void scsifront_gnttab_done(struct vscsifrnt_=
info *info, uint32_t id)=0A {=0A+	struct vscsifrnt_shadow *s =3D =
&info->shadow[id];=0A 	int i;=0A =0A 	if (s->sc->sc_data_direction =
=3D=3D DMA_NONE)=0A 		return;=0A =0A-	if (s->nr_segments) {=0A-	=
	for (i =3D 0; i < s->nr_segments; i++) {=0A-			if =
(unlikely(gnttab_query_foreign_access(=0A-				=
s->gref[i]) !=3D 0)) {=0A-				printk(KERN_ALERT =
"scsifront: "=0A-					"grant still in =
use by backend.\n");=0A-				BUG();=0A-		=
	}=0A-			gnttab_end_foreign_access(s->gref[i], =
0UL);=0A+	for (i =3D 0; i < s->nr_segments; i++) {=0A+		if =
(unlikely(gnttab_query_foreign_access(s->gref[i]) !=3D 0)) {=0A+		=
	shost_printk(PREFIX(ALERT), info->host,=0A+				=
     "grant still in use by backend\n");=0A+			BUG();=0A 	=
	}=0A+		gnttab_end_foreign_access(s->gref[i], 0UL);=0A 	=
}=0A-=0A-	return;=0A }=0A =0A =0A@@ -144,7 +142,7 @@ static void =
scsifront_cdb_cmd_done(struc=0A 	if (sc =3D=3D NULL)=0A 		=
BUG();=0A =0A-	scsifront_gnttab_done(&info->shadow[id], id);=0A+	=
scsifront_gnttab_done(info, id);=0A 	add_id_to_freelist(info, id);=0A =
=0A 	sc->result =3D ring_res->rslt;=0A@@ -180,7 +178,7 @@ static void =
scsifront_sync_cmd_done(stru=0A 		_add_id_to_freelist(info, =
id);=0A 		break;=0A 	default:=0A-		shost_print=
k(KERN_ERR "scsifront: ", info->host,=0A+		shost_printk(PREFIX=
(ERR), info->host,=0A 			     "bad reset state %d, possibly =
leaking %u\n",=0A 			     info->shadow[id].rslt_reset, =
id);=0A 		break;=0A@@ -272,7 +270,8 @@ static int map_data_fo=
r_request(struct v=0A =0A 	err =3D gnttab_alloc_grant_references(VSCSI=
IF_SG_TABLESIZE, &gref_head);=0A 	if (err) {=0A-		printk(KERN=
_ERR "scsifront: gnttab_alloc_grant_references() error\n");=0A+		=
shost_printk(PREFIX(ERR), info->host,=0A+			     =
"gnttab_alloc_grant_references() error\n");=0A 		return -ENOMEM;=0A =
	}=0A =0A@@ -282,7 +281,8 @@ static int map_data_for_request(struct =
v=0A 		nr_pages =3D (sc->request_bufflen + sg[0].offset + =
PAGE_SIZE - 1) >> PAGE_SHIFT;=0A =0A 		if (nr_pages > VSCSIIF_SG_T=
ABLESIZE) {=0A-			printk(KERN_ERR "scsifront: Unable to map =
request_buffer for command!\n");=0A+			shost_printk(PREFIX=
(ERR), info->host,=0A+				     "Unable to map =
request_buffer for command!\n");=0A 			ref_cnt =3D =
(-E2BIG);=0A 			goto big_to_sg;=0A 		}=0A@@ =
-369,9 +369,11 @@ static int scsifront_queuecommand(struct=0A 	uint16_t =
rqid;=0A =0A /* debug printk to identify more missing scsi commands=0A-	=
printk(KERN_INFO "scsicmd: len=3D%i, 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%=
x,0x%x,0x%x",sc->cmd_len,=0A-		sc->cmnd[0],sc->cmnd[1],sc->cmnd[2]=
,sc->cmnd[3],sc->cmnd[4],=0A-		sc->cmnd[5],sc->cmnd[6],sc->cmnd[7]=
,sc->cmnd[8],sc->cmnd[9]);=0A+	shost_printk(KERN_INFO "scsicmd: ", =
sc->device->host,=0A+		     "len=3D%u %#x,%#x,%#x,%#x,%#x,%#x,%#x,=
%#x,%#x,%#x\n",=0A+		     sc->cmd_len, sc->cmnd[0], sc->cmnd[1],=
=0A+		     sc->cmnd[2], sc->cmnd[3], sc->cmnd[4], sc->cmnd[5],=0A=
+		     sc->cmnd[6], sc->cmnd[7], sc->cmnd[8], sc->cmnd[9]);=
=0A */=0A 	if (RING_FULL(&info->ring)) {=0A 		goto =
out_host_busy;=0A--- a/drivers/xen/scsifront/xenbus.c=0A+++ b/drivers/xen/s=
csifront/xenbus.c=0A@@ -214,7 +214,7 @@ static int scsifront_probe(struct =
xenbus=0A 	if (IS_ERR(info->kthread)) {=0A 		err =3D =
PTR_ERR(info->kthread);=0A 		info->kthread =3D NULL;=0A-		=
printk(KERN_ERR "scsifront: kthread start err %d\n", err);=0A+		=
dev_err(&dev->dev, "kthread start err %d\n", err);=0A 		goto =
free_sring;=0A 	}=0A =0A@@ -226,7 +226,7 @@ static int scsifront_probe(stru=
ct xenbus=0A =0A 	err =3D scsi_add_host(host, &dev->dev);=0A 	if =
(err) {=0A-		printk(KERN_ERR "scsifront: fail to add scsi host =
%d\n", err);=0A+		dev_err(&dev->dev, "fail to add scsi host =
%d\n", err);=0A 		goto free_sring;=0A 	}=0A =0A@@ -317,7 =
+317,7 @@ static void scsifront_do_lun_hotplug(str=0A 			if =
(device_state =3D=3D XenbusStateInitialised) {=0A 				=
sdev =3D scsi_device_lookup(info->host, chn, tgt, lun);=0A 			=
	if (sdev) {=0A-					printk(KERN_ERR =
"scsifront: Device already in use.\n");=0A+					=
dev_err(&dev->dev, "Device already in use.\n");=0A 				=
	scsi_device_put(sdev);=0A 					=
xenbus_printf(XBT_NIL, dev->nodename,=0A 					=
	state_str, "%d", XenbusStateClosed);=0A
--=__Part2415D6E0.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.xen.org
http://lists.xen.org/xen-devel

--=__Part2415D6E0.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 23 10:45:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:45:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbql2-0005hq-5O; Fri, 23 Nov 2012 10:45:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tbql1-0005hi-0P
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 10:45:15 +0000
Received: from [85.158.137.99:13264] by server-11.bemta-3.messagelabs.com id
	95/C2-19361-AB35FA05; Fri, 23 Nov 2012 10:45:14 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353667512!15176212!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21752 invoked from network); 23 Nov 2012 10:45:12 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-217.messagelabs.com with SMTP;
	23 Nov 2012 10:45:12 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 23 Nov 2012 10:45:12 +0000
Message-Id: <50AF620002000078000AACF9@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 23 Nov 2012 10:46:08 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part2415D6E0.0__="
Subject: [Xen-devel] [PATCH] linux-2.6.18/scsifront: consolidate printing
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part2415D6E0.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Use shost_printk() or dev_err() instead of plain printk().

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/drivers/xen/scsifront/scsifront.c
+++ b/drivers/xen/scsifront/scsifront.c
@@ -30,6 +30,8 @@
 =20
 #include "common.h"
=20
+#define PREFIX(lvl) KERN_##lvl "scsifront: "
+
 static int get_id_from_freelist(struct vscsifrnt_info *info)
 {
 	unsigned long flags;
@@ -108,26 +110,22 @@ irqreturn_t scsifront_intr(int irq, void
 }
=20
=20
-static void scsifront_gnttab_done(struct vscsifrnt_shadow *s, uint32_t =
id)
+static void scsifront_gnttab_done(struct vscsifrnt_info *info, uint32_t =
id)
 {
+	struct vscsifrnt_shadow *s =3D &info->shadow[id];
 	int i;
=20
 	if (s->sc->sc_data_direction =3D=3D DMA_NONE)
 		return;
=20
-	if (s->nr_segments) {
-		for (i =3D 0; i < s->nr_segments; i++) {
-			if (unlikely(gnttab_query_foreign_access(
-				s->gref[i]) !=3D 0)) {
-				printk(KERN_ALERT "scsifront: "
-					"grant still in use by backend.\n")=
;
-				BUG();
-			}
-			gnttab_end_foreign_access(s->gref[i], 0UL);
+	for (i =3D 0; i < s->nr_segments; i++) {
+		if (unlikely(gnttab_query_foreign_access(s->gref[i]) !=3D =
0)) {
+			shost_printk(PREFIX(ALERT), info->host,
+				     "grant still in use by backend\n");
+			BUG();
 		}
+		gnttab_end_foreign_access(s->gref[i], 0UL);
 	}
-
-	return;
 }
=20
=20
@@ -144,7 +142,7 @@ static void scsifront_cdb_cmd_done(struc
 	if (sc =3D=3D NULL)
 		BUG();
=20
-	scsifront_gnttab_done(&info->shadow[id], id);
+	scsifront_gnttab_done(info, id);
 	add_id_to_freelist(info, id);
=20
 	sc->result =3D ring_res->rslt;
@@ -180,7 +178,7 @@ static void scsifront_sync_cmd_done(stru
 		_add_id_to_freelist(info, id);
 		break;
 	default:
-		shost_printk(KERN_ERR "scsifront: ", info->host,
+		shost_printk(PREFIX(ERR), info->host,
 			     "bad reset state %d, possibly leaking %u\n",
 			     info->shadow[id].rslt_reset, id);
 		break;
@@ -272,7 +270,8 @@ static int map_data_for_request(struct v
=20
 	err =3D gnttab_alloc_grant_references(VSCSIIF_SG_TABLESIZE, =
&gref_head);
 	if (err) {
-		printk(KERN_ERR "scsifront: gnttab_alloc_grant_references()=
 error\n");
+		shost_printk(PREFIX(ERR), info->host,
+			     "gnttab_alloc_grant_references() error\n");
 		return -ENOMEM;
 	}
=20
@@ -282,7 +281,8 @@ static int map_data_for_request(struct v
 		nr_pages =3D (sc->request_bufflen + sg[0].offset + =
PAGE_SIZE - 1) >> PAGE_SHIFT;
=20
 		if (nr_pages > VSCSIIF_SG_TABLESIZE) {
-			printk(KERN_ERR "scsifront: Unable to map =
request_buffer for command!\n");
+			shost_printk(PREFIX(ERR), info->host,
+				     "Unable to map request_buffer for =
command!\n");
 			ref_cnt =3D (-E2BIG);
 			goto big_to_sg;
 		}
@@ -369,9 +369,11 @@ static int scsifront_queuecommand(struct
 	uint16_t rqid;
=20
 /* debug printk to identify more missing scsi commands
-	printk(KERN_INFO "scsicmd: len=3D%i, 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,=
0x%x,0x%x,0x%x,0x%x",sc->cmd_len,
-		sc->cmnd[0],sc->cmnd[1],sc->cmnd[2],sc->cmnd[3],sc->cmnd[4]=
,
-		sc->cmnd[5],sc->cmnd[6],sc->cmnd[7],sc->cmnd[8],sc->cmnd[9]=
);
+	shost_printk(KERN_INFO "scsicmd: ", sc->device->host,
+		     "len=3D%u %#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x\n",
+		     sc->cmd_len, sc->cmnd[0], sc->cmnd[1],
+		     sc->cmnd[2], sc->cmnd[3], sc->cmnd[4], sc->cmnd[5],
+		     sc->cmnd[6], sc->cmnd[7], sc->cmnd[8], sc->cmnd[9]);
 */
 	if (RING_FULL(&info->ring)) {
 		goto out_host_busy;
--- a/drivers/xen/scsifront/xenbus.c
+++ b/drivers/xen/scsifront/xenbus.c
@@ -214,7 +214,7 @@ static int scsifront_probe(struct xenbus
 	if (IS_ERR(info->kthread)) {
 		err =3D PTR_ERR(info->kthread);
 		info->kthread =3D NULL;
-		printk(KERN_ERR "scsifront: kthread start err %d\n", err);
+		dev_err(&dev->dev, "kthread start err %d\n", err);
 		goto free_sring;
 	}
=20
@@ -226,7 +226,7 @@ static int scsifront_probe(struct xenbus
=20
 	err =3D scsi_add_host(host, &dev->dev);
 	if (err) {
-		printk(KERN_ERR "scsifront: fail to add scsi host %d\n", =
err);
+		dev_err(&dev->dev, "fail to add scsi host %d\n", err);
 		goto free_sring;
 	}
=20
@@ -317,7 +317,7 @@ static void scsifront_do_lun_hotplug(str
 			if (device_state =3D=3D XenbusStateInitialised) {
 				sdev =3D scsi_device_lookup(info->host, =
chn, tgt, lun);
 				if (sdev) {
-					printk(KERN_ERR "scsifront: Device =
already in use.\n");
+					dev_err(&dev->dev, "Device already =
in use.\n");
 					scsi_device_put(sdev);
 					xenbus_printf(XBT_NIL, dev->nodenam=
e,
 						state_str, "%d", XenbusStat=
eClosed);



--=__Part2415D6E0.0__=
Content-Type: text/plain; name="xen-scsifront-printing.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-scsifront-printing.patch"

scsifront: consolidate printing=0A=0AUse shost_printk() or dev_err() =
instead of plain printk().=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.c=
om>=0A=0A--- a/drivers/xen/scsifront/scsifront.c=0A+++ b/drivers/xen/scsifr=
ont/scsifront.c=0A@@ -30,6 +30,8 @@=0A  =0A #include "common.h"=0A =
=0A+#define PREFIX(lvl) KERN_##lvl "scsifront: "=0A+=0A static int =
get_id_from_freelist(struct vscsifrnt_info *info)=0A {=0A 	unsigned =
long flags;=0A@@ -108,26 +110,22 @@ irqreturn_t scsifront_intr(int irq, =
void=0A }=0A =0A =0A-static void scsifront_gnttab_done(struct vscsifrnt_sha=
dow *s, uint32_t id)=0A+static void scsifront_gnttab_done(struct vscsifrnt_=
info *info, uint32_t id)=0A {=0A+	struct vscsifrnt_shadow *s =3D =
&info->shadow[id];=0A 	int i;=0A =0A 	if (s->sc->sc_data_direction =
=3D=3D DMA_NONE)=0A 		return;=0A =0A-	if (s->nr_segments) {=0A-	=
	for (i =3D 0; i < s->nr_segments; i++) {=0A-			if =
(unlikely(gnttab_query_foreign_access(=0A-				=
s->gref[i]) !=3D 0)) {=0A-				printk(KERN_ALERT =
"scsifront: "=0A-					"grant still in =
use by backend.\n");=0A-				BUG();=0A-		=
	}=0A-			gnttab_end_foreign_access(s->gref[i], =
0UL);=0A+	for (i =3D 0; i < s->nr_segments; i++) {=0A+		if =
(unlikely(gnttab_query_foreign_access(s->gref[i]) !=3D 0)) {=0A+		=
	shost_printk(PREFIX(ALERT), info->host,=0A+				=
     "grant still in use by backend\n");=0A+			BUG();=0A 	=
	}=0A+		gnttab_end_foreign_access(s->gref[i], 0UL);=0A 	=
}=0A-=0A-	return;=0A }=0A =0A =0A@@ -144,7 +142,7 @@ static void =
scsifront_cdb_cmd_done(struc=0A 	if (sc =3D=3D NULL)=0A 		=
BUG();=0A =0A-	scsifront_gnttab_done(&info->shadow[id], id);=0A+	=
scsifront_gnttab_done(info, id);=0A 	add_id_to_freelist(info, id);=0A =
=0A 	sc->result =3D ring_res->rslt;=0A@@ -180,7 +178,7 @@ static void =
scsifront_sync_cmd_done(stru=0A 		_add_id_to_freelist(info, =
id);=0A 		break;=0A 	default:=0A-		shost_print=
k(KERN_ERR "scsifront: ", info->host,=0A+		shost_printk(PREFIX=
(ERR), info->host,=0A 			     "bad reset state %d, possibly =
leaking %u\n",=0A 			     info->shadow[id].rslt_reset, =
id);=0A 		break;=0A@@ -272,7 +270,8 @@ static int map_data_fo=
r_request(struct v=0A =0A 	err =3D gnttab_alloc_grant_references(VSCSI=
IF_SG_TABLESIZE, &gref_head);=0A 	if (err) {=0A-		printk(KERN=
_ERR "scsifront: gnttab_alloc_grant_references() error\n");=0A+		=
shost_printk(PREFIX(ERR), info->host,=0A+			     =
"gnttab_alloc_grant_references() error\n");=0A 		return -ENOMEM;=0A =
	}=0A =0A@@ -282,7 +281,8 @@ static int map_data_for_request(struct =
v=0A 		nr_pages =3D (sc->request_bufflen + sg[0].offset + =
PAGE_SIZE - 1) >> PAGE_SHIFT;=0A =0A 		if (nr_pages > VSCSIIF_SG_T=
ABLESIZE) {=0A-			printk(KERN_ERR "scsifront: Unable to map =
request_buffer for command!\n");=0A+			shost_printk(PREFIX=
(ERR), info->host,=0A+				     "Unable to map =
request_buffer for command!\n");=0A 			ref_cnt =3D =
(-E2BIG);=0A 			goto big_to_sg;=0A 		}=0A@@ =
-369,9 +369,11 @@ static int scsifront_queuecommand(struct=0A 	uint16_t =
rqid;=0A =0A /* debug printk to identify more missing scsi commands=0A-	=
printk(KERN_INFO "scsicmd: len=3D%i, 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%=
x,0x%x,0x%x",sc->cmd_len,=0A-		sc->cmnd[0],sc->cmnd[1],sc->cmnd[2]=
,sc->cmnd[3],sc->cmnd[4],=0A-		sc->cmnd[5],sc->cmnd[6],sc->cmnd[7]=
,sc->cmnd[8],sc->cmnd[9]);=0A+	shost_printk(KERN_INFO "scsicmd: ", =
sc->device->host,=0A+		     "len=3D%u %#x,%#x,%#x,%#x,%#x,%#x,%#x,=
%#x,%#x,%#x\n",=0A+		     sc->cmd_len, sc->cmnd[0], sc->cmnd[1],=
=0A+		     sc->cmnd[2], sc->cmnd[3], sc->cmnd[4], sc->cmnd[5],=0A=
+		     sc->cmnd[6], sc->cmnd[7], sc->cmnd[8], sc->cmnd[9]);=
=0A */=0A 	if (RING_FULL(&info->ring)) {=0A 		goto =
out_host_busy;=0A--- a/drivers/xen/scsifront/xenbus.c=0A+++ b/drivers/xen/s=
csifront/xenbus.c=0A@@ -214,7 +214,7 @@ static int scsifront_probe(struct =
xenbus=0A 	if (IS_ERR(info->kthread)) {=0A 		err =3D =
PTR_ERR(info->kthread);=0A 		info->kthread =3D NULL;=0A-		=
printk(KERN_ERR "scsifront: kthread start err %d\n", err);=0A+		=
dev_err(&dev->dev, "kthread start err %d\n", err);=0A 		goto =
free_sring;=0A 	}=0A =0A@@ -226,7 +226,7 @@ static int scsifront_probe(stru=
ct xenbus=0A =0A 	err =3D scsi_add_host(host, &dev->dev);=0A 	if =
(err) {=0A-		printk(KERN_ERR "scsifront: fail to add scsi host =
%d\n", err);=0A+		dev_err(&dev->dev, "fail to add scsi host =
%d\n", err);=0A 		goto free_sring;=0A 	}=0A =0A@@ -317,7 =
+317,7 @@ static void scsifront_do_lun_hotplug(str=0A 			if =
(device_state =3D=3D XenbusStateInitialised) {=0A 				=
sdev =3D scsi_device_lookup(info->host, chn, tgt, lun);=0A 			=
	if (sdev) {=0A-					printk(KERN_ERR =
"scsifront: Device already in use.\n");=0A+					=
dev_err(&dev->dev, "Device already in use.\n");=0A 				=
	scsi_device_put(sdev);=0A 					=
xenbus_printf(XBT_NIL, dev->nodename,=0A 					=
	state_str, "%d", XenbusStateClosed);=0A
--=__Part2415D6E0.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.xen.org
http://lists.xen.org/xen-devel

--=__Part2415D6E0.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 23 10:51:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:51:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbqqg-00064e-VC; Fri, 23 Nov 2012 10:51:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tbqqf-00064X-Ak
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 10:51:05 +0000
Received: from [85.158.137.99:64470] by server-7.bemta-3.messagelabs.com id
	3C/32-01713-8155FA05; Fri, 23 Nov 2012 10:51:04 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353667860!20195308!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3189 invoked from network); 23 Nov 2012 10:51:00 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-217.messagelabs.com with SMTP;
	23 Nov 2012 10:51:00 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 23 Nov 2012 10:50:59 +0000
Message-Id: <50AF635B02000078000AAD0C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 23 Nov 2012 10:51:55 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel Kiper" <daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
	<18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
	<50AED7B8.7040902@citrix.com>
	<50AF55B102000078000AABF3@nat28.tlf.novell.com>
	<20121123103726.GB2921@host-192-168-1-59.local.net-space.pl>
In-Reply-To: <20121123103726.GB2921@host-192-168-1-59.local.net-space.pl>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"H. Peter Anvin" <hpa@zytor.com>, "tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 23.11.12 at 11:37, Daniel Kiper <daniel.kiper@oracle.com> wrote:
> On Fri, Nov 23, 2012 at 09:53:37AM +0000, Jan Beulich wrote:
>> >>> On 23.11.12 at 02:56, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> > On 23/11/2012 01:38, H. Peter Anvin wrote:
>> >> I still don't really get why it can't be isolated from dom0, which would
>> > make more sense to me, even for a Xen crash.
>> >>
>> >
>> > The crash region (as specified by crashkernel= on the Xen command line)
>> > is isolated from dom0.
>> >
>> > dom0 (using the kexec utility etc) has the task of locating the Xen
>> > crash notes (using the kexec hypercall interface), constructing a binary
>> > blob containing kernel, initram and gubbins, and asking Xen to put this
>> > blob in the crash region (again, using the kexec hypercall interface).
>> >
>> > I do not see how this is very much different from the native case
>> > currently (although please correct me if I am misinformed).  Linux has
>> > extra work to do by populating /proc/iomem with the Xen crash regions
>> > boot (so the kexec utility can reference their physical addresses when
>> > constructing the blob), and should just act as a conduit between the
>> > kexec system call and the kexec hypercall to load the blob.
>>
>> But all of this _could_ be done completely independent of the
>> Dom0 kernel's kexec infrastructure (i.e. fully from user space,
>> invoking the necessary hypercalls through the privcmd driver).
> 
> No, this is impossible. kexec/kdump image lives in dom0 kernel memory
> until execution. That is why privcmd driver itself is not a solution
> in this case.

Even if so, there's no fundamental reason why that kernel image
can't be put into Xen controlled space instead.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 10:51:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:51:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbqqg-00064e-VC; Fri, 23 Nov 2012 10:51:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tbqqf-00064X-Ak
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 10:51:05 +0000
Received: from [85.158.137.99:64470] by server-7.bemta-3.messagelabs.com id
	3C/32-01713-8155FA05; Fri, 23 Nov 2012 10:51:04 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353667860!20195308!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3189 invoked from network); 23 Nov 2012 10:51:00 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-217.messagelabs.com with SMTP;
	23 Nov 2012 10:51:00 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 23 Nov 2012 10:50:59 +0000
Message-Id: <50AF635B02000078000AAD0C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 23 Nov 2012 10:51:55 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Daniel Kiper" <daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
	<18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
	<50AED7B8.7040902@citrix.com>
	<50AF55B102000078000AABF3@nat28.tlf.novell.com>
	<20121123103726.GB2921@host-192-168-1-59.local.net-space.pl>
In-Reply-To: <20121123103726.GB2921@host-192-168-1-59.local.net-space.pl>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"H. Peter Anvin" <hpa@zytor.com>, "tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 23.11.12 at 11:37, Daniel Kiper <daniel.kiper@oracle.com> wrote:
> On Fri, Nov 23, 2012 at 09:53:37AM +0000, Jan Beulich wrote:
>> >>> On 23.11.12 at 02:56, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> > On 23/11/2012 01:38, H. Peter Anvin wrote:
>> >> I still don't really get why it can't be isolated from dom0, which would
>> > make more sense to me, even for a Xen crash.
>> >>
>> >
>> > The crash region (as specified by crashkernel= on the Xen command line)
>> > is isolated from dom0.
>> >
>> > dom0 (using the kexec utility etc) has the task of locating the Xen
>> > crash notes (using the kexec hypercall interface), constructing a binary
>> > blob containing kernel, initram and gubbins, and asking Xen to put this
>> > blob in the crash region (again, using the kexec hypercall interface).
>> >
>> > I do not see how this is very much different from the native case
>> > currently (although please correct me if I am misinformed).  Linux has
>> > extra work to do by populating /proc/iomem with the Xen crash regions
>> > boot (so the kexec utility can reference their physical addresses when
>> > constructing the blob), and should just act as a conduit between the
>> > kexec system call and the kexec hypercall to load the blob.
>>
>> But all of this _could_ be done completely independent of the
>> Dom0 kernel's kexec infrastructure (i.e. fully from user space,
>> invoking the necessary hypercalls through the privcmd driver).
> 
> No, this is impossible. kexec/kdump image lives in dom0 kernel memory
> until execution. That is why privcmd driver itself is not a solution
> in this case.

Even if so, there's no fundamental reason why that kernel image
can't be put into Xen controlled space instead.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 10:51:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:51:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbqqo-00065K-Bu; Fri, 23 Nov 2012 10:51:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbqqm-000656-Ai
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 10:51:12 +0000
Received: from [85.158.143.99:40294] by server-3.bemta-4.messagelabs.com id
	76/EA-06841-F155FA05; Fri, 23 Nov 2012 10:51:11 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1353667870!30514133!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18471 invoked from network); 23 Nov 2012 10:51:11 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 10:51:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15970264"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 10:51:10 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 10:51:10 +0000
Message-ID: <1353667868.13542.218.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Daniel Kiper <daniel.kiper@oracle.com>
Date: Fri, 23 Nov 2012 10:51:08 +0000
In-Reply-To: <20121123103726.GB2921@host-192-168-1-59.local.net-space.pl>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
	<18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
	<50AED7B8.7040902@citrix.com>
	<50AF55B102000078000AABF3@nat28.tlf.novell.com>
	<20121123103726.GB2921@host-192-168-1-59.local.net-space.pl>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Jan Beulich <JBeulich@suse.com>, "H. Peter
	Anvin" <hpa@zytor.com>, "tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 10:37 +0000, Daniel Kiper wrote:
> On Fri, Nov 23, 2012 at 09:53:37AM +0000, Jan Beulich wrote:
> > >>> On 23.11.12 at 02:56, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> > > The crash region (as specified by crashkernel= on the Xen command line)
> > > is isolated from dom0.
> > >[...]
> >
> > But all of this _could_ be done completely independent of the
> > Dom0 kernel's kexec infrastructure (i.e. fully from user space,
> > invoking the necessary hypercalls through the privcmd driver).
> 
> No, this is impossible. kexec/kdump image lives in dom0 kernel memory
> until execution.

Are you sure? I could have sworn they lived in the hypervisor owned
memory set aside by the crashkernel= parameter as Andy suggested.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 10:51:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:51:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbqqo-00065K-Bu; Fri, 23 Nov 2012 10:51:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbqqm-000656-Ai
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 10:51:12 +0000
Received: from [85.158.143.99:40294] by server-3.bemta-4.messagelabs.com id
	76/EA-06841-F155FA05; Fri, 23 Nov 2012 10:51:11 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1353667870!30514133!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18471 invoked from network); 23 Nov 2012 10:51:11 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 10:51:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15970264"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 10:51:10 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 10:51:10 +0000
Message-ID: <1353667868.13542.218.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Daniel Kiper <daniel.kiper@oracle.com>
Date: Fri, 23 Nov 2012 10:51:08 +0000
In-Reply-To: <20121123103726.GB2921@host-192-168-1-59.local.net-space.pl>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
	<18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
	<50AED7B8.7040902@citrix.com>
	<50AF55B102000078000AABF3@nat28.tlf.novell.com>
	<20121123103726.GB2921@host-192-168-1-59.local.net-space.pl>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Jan Beulich <JBeulich@suse.com>, "H. Peter
	Anvin" <hpa@zytor.com>, "tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 10:37 +0000, Daniel Kiper wrote:
> On Fri, Nov 23, 2012 at 09:53:37AM +0000, Jan Beulich wrote:
> > >>> On 23.11.12 at 02:56, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> > > The crash region (as specified by crashkernel= on the Xen command line)
> > > is isolated from dom0.
> > >[...]
> >
> > But all of this _could_ be done completely independent of the
> > Dom0 kernel's kexec infrastructure (i.e. fully from user space,
> > invoking the necessary hypercalls through the privcmd driver).
> 
> No, this is impossible. kexec/kdump image lives in dom0 kernel memory
> until execution.

Are you sure? I could have sworn they lived in the hypervisor owned
memory set aside by the crashkernel= parameter as Andy suggested.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 10:53:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:53:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbqst-0006H9-61; Fri, 23 Nov 2012 10:53:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbqsr-0006H0-M0
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 10:53:21 +0000
Received: from [85.158.139.211:37651] by server-9.bemta-5.messagelabs.com id
	09/AC-29295-0A55FA05; Fri, 23 Nov 2012 10:53:20 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353668000!21235364!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7522 invoked from network); 23 Nov 2012 10:53:20 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 10:53:20 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15970336"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 10:53:19 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 10:53:19 +0000
Message-ID: <1353667998.13542.220.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Fri, 23 Nov 2012 10:53:18 +0000
In-Reply-To: <50AF567402000078000AABF6@nat28.tlf.novell.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE62E9.3000602@zytor.com>
	<50AF567402000078000AABF6@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>, Daniel
	Kiper <daniel.kiper@oracle.com>, "x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"H. Peter Anvin" <hpa@zytor.com>, "tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 09:56 +0000, Jan Beulich wrote:
> >>> On 22.11.12 at 18:37, "H. Peter Anvin" <hpa@zytor.com> wrote:
> > I actually talked to Ian Jackson at LCE, and mentioned among other 

That was me actually (this happens surprisingly often ;-)).

> > things the bogosity of requiring a PUD page for three-level paging in 
> > Linux -- a bogosity which has spread from Xen into native.  It's a page 
> > wasted for no good reason, since it only contains 32 bytes worth of 
> > data, *inherently*.  Furthermore, contrary to popular belief, it is 
> > *not* pa page table per se.
> > 
> > Ian told me: "I didn't know we did that, and we shouldn't have to." 
> > Here we have suffered this overhead for at least six years, ...
> 
> Even the Xen kernel only needs the full page when running on a
> 64-bit hypervisor (now that we don't have a 32-bit hypervisor
> anymore, that of course basically means always).

I took an, admittedly very brief, look at it on the plane on the way
home and it seems like the requirement for a complete page on the
pvops-xen side comes from the !SHARED_KERNEL_PMD stuff (so still a Xen
related thing). This requires a struct page for the list_head it
contains (see pgd_list_add et al) rather than because of the use of the
page as a pgd as such.

>  But yes, I too
> never liked this enforced over-allocation for native kernels (and
> was surprised that it was allowed in at all).

Completely agreed.

I did wonder if just doing something like:
-	pgd = (pgd_t *)__get_free_page(PGALLOC_GFP);
+	if (SHARED_KERNEL_PMD)
+		pgd = some_appropriate_allocation_primitive(sizeof(*pgd));
+	else
+		pgd = (pgd_t *)__get_free_page(PGALLOC_GFP);

to pgd_alloc (+ the equivalent for the error path & free case, create
helper funcs as desired etc) would be sufficient to remove the over
allocation for the native case but haven't had time to properly
investigate.

Alternatively push the allocation down into paravirt_pgd_alloc to
taste :-/

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 10:53:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:53:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbqst-0006H9-61; Fri, 23 Nov 2012 10:53:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbqsr-0006H0-M0
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 10:53:21 +0000
Received: from [85.158.139.211:37651] by server-9.bemta-5.messagelabs.com id
	09/AC-29295-0A55FA05; Fri, 23 Nov 2012 10:53:20 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353668000!21235364!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7522 invoked from network); 23 Nov 2012 10:53:20 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 10:53:20 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15970336"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 10:53:19 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 10:53:19 +0000
Message-ID: <1353667998.13542.220.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Fri, 23 Nov 2012 10:53:18 +0000
In-Reply-To: <50AF567402000078000AABF6@nat28.tlf.novell.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE62E9.3000602@zytor.com>
	<50AF567402000078000AABF6@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>, Daniel
	Kiper <daniel.kiper@oracle.com>, "x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"H. Peter Anvin" <hpa@zytor.com>, "tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 09:56 +0000, Jan Beulich wrote:
> >>> On 22.11.12 at 18:37, "H. Peter Anvin" <hpa@zytor.com> wrote:
> > I actually talked to Ian Jackson at LCE, and mentioned among other 

That was me actually (this happens surprisingly often ;-)).

> > things the bogosity of requiring a PUD page for three-level paging in 
> > Linux -- a bogosity which has spread from Xen into native.  It's a page 
> > wasted for no good reason, since it only contains 32 bytes worth of 
> > data, *inherently*.  Furthermore, contrary to popular belief, it is 
> > *not* pa page table per se.
> > 
> > Ian told me: "I didn't know we did that, and we shouldn't have to." 
> > Here we have suffered this overhead for at least six years, ...
> 
> Even the Xen kernel only needs the full page when running on a
> 64-bit hypervisor (now that we don't have a 32-bit hypervisor
> anymore, that of course basically means always).

I took an, admittedly very brief, look at it on the plane on the way
home and it seems like the requirement for a complete page on the
pvops-xen side comes from the !SHARED_KERNEL_PMD stuff (so still a Xen
related thing). This requires a struct page for the list_head it
contains (see pgd_list_add et al) rather than because of the use of the
page as a pgd as such.

>  But yes, I too
> never liked this enforced over-allocation for native kernels (and
> was surprised that it was allowed in at all).

Completely agreed.

I did wonder if just doing something like:
-	pgd = (pgd_t *)__get_free_page(PGALLOC_GFP);
+	if (SHARED_KERNEL_PMD)
+		pgd = some_appropriate_allocation_primitive(sizeof(*pgd));
+	else
+		pgd = (pgd_t *)__get_free_page(PGALLOC_GFP);

to pgd_alloc (+ the equivalent for the error path & free case, create
helper funcs as desired etc) would be sufficient to remove the over
allocation for the native case but haven't had time to properly
investigate.

Alternatively push the allocation down into paravirt_pgd_alloc to
taste :-/

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 10:54:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:54:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbqtg-0006MF-LG; Fri, 23 Nov 2012 10:54:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1Tbqte-0006Lv-VM
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 10:54:11 +0000
Received: from [85.158.143.35:18843] by server-2.bemta-4.messagelabs.com id
	F2/DF-28922-2D55FA05; Fri, 23 Nov 2012 10:54:10 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-11.tower-21.messagelabs.com!1353667963!11791314!1
X-Originating-IP: [81.169.146.161]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA1MDEwNjk=\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA1MDEwNjk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9394 invoked from network); 23 Nov 2012 10:52:44 -0000
Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.161)
	by server-11.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 10:52:44 -0000
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmwtM48/ll387qFkE=
X-RZG-CLASS-ID: mo00
Received: from probook.site
	(dslb-084-057-086-014.pools.arcor-ip.net [84.57.86.14])
	by smtp.strato.de (joses mo9) (RZmta 31.5 DYNA|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id m02d40oANACKI8 ;
	Fri, 23 Nov 2012 11:52:43 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 1B02A1884C; Fri, 23 Nov 2012 11:52:43 +0100 (CET)
Date: Fri, 23 Nov 2012 11:52:42 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121123105242.GA16420@aepfle.de>
References: <a446956472330fe32bc6.1353530980@probook.site>
	<1353665411.13542.197.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353665411.13542.197.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xend: enable environment passing in xPopen3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, Ian Campbell wrote:

> On Wed, 2012-11-21 at 20:49 +0000, Olaf Hering wrote:
> > # HG changeset patch
> > # User Olaf Hering <olaf@aepfle.de>
> > # Date 1353530937 -3600
> > # Node ID a446956472330fe32bc69be764a33f59fb090792
> > # Parent  2489c29266982175b5b4e945c97b4549360e947f
> > xend: enable environment passing in xPopen3
> > 
> > In changeset 19990:38dd208e1d95 a new parameter 'env' was added to
> > xPopen3, but no code was added to actually pass the environment down to
> > execvpe. Also, the new code was unreachable.
> > 
> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> 
> It seems that no callers provide an environment? How did you spot this?

In my testing I did pass options to xc_save via the environment, which
is called via forkhelper (somewhere in python code).

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 10:54:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 10:54:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbqtg-0006MF-LG; Fri, 23 Nov 2012 10:54:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1Tbqte-0006Lv-VM
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 10:54:11 +0000
Received: from [85.158.143.35:18843] by server-2.bemta-4.messagelabs.com id
	F2/DF-28922-2D55FA05; Fri, 23 Nov 2012 10:54:10 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-11.tower-21.messagelabs.com!1353667963!11791314!1
X-Originating-IP: [81.169.146.161]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA1MDEwNjk=\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA1MDEwNjk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9394 invoked from network); 23 Nov 2012 10:52:44 -0000
Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.161)
	by server-11.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 10:52:44 -0000
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmwtM48/ll387qFkE=
X-RZG-CLASS-ID: mo00
Received: from probook.site
	(dslb-084-057-086-014.pools.arcor-ip.net [84.57.86.14])
	by smtp.strato.de (joses mo9) (RZmta 31.5 DYNA|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id m02d40oANACKI8 ;
	Fri, 23 Nov 2012 11:52:43 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 1B02A1884C; Fri, 23 Nov 2012 11:52:43 +0100 (CET)
Date: Fri, 23 Nov 2012 11:52:42 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121123105242.GA16420@aepfle.de>
References: <a446956472330fe32bc6.1353530980@probook.site>
	<1353665411.13542.197.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353665411.13542.197.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xend: enable environment passing in xPopen3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, Ian Campbell wrote:

> On Wed, 2012-11-21 at 20:49 +0000, Olaf Hering wrote:
> > # HG changeset patch
> > # User Olaf Hering <olaf@aepfle.de>
> > # Date 1353530937 -3600
> > # Node ID a446956472330fe32bc69be764a33f59fb090792
> > # Parent  2489c29266982175b5b4e945c97b4549360e947f
> > xend: enable environment passing in xPopen3
> > 
> > In changeset 19990:38dd208e1d95 a new parameter 'env' was added to
> > xPopen3, but no code was added to actually pass the environment down to
> > execvpe. Also, the new code was unreachable.
> > 
> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> 
> It seems that no callers provide an environment? How did you spot this?

In my testing I did pass options to xc_save via the environment, which
is called via forkhelper (somewhere in python code).

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:05:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:05:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbr41-00070C-4w; Fri, 23 Nov 2012 11:04:53 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbr40-000703-09
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 11:04:52 +0000
Received: from [85.158.139.211:37520] by server-5.bemta-5.messagelabs.com id
	61/52-11353-3585FA05; Fri, 23 Nov 2012 11:04:51 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1353668690!17297307!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5286 invoked from network); 23 Nov 2012 11:04:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 11:04:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15970625"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 11:04:08 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 11:04:07 +0000
Message-ID: <1353668646.13542.228.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
Date: Fri, 23 Nov 2012 11:04:06 +0000
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 16:16 +0000, Fioravante, Matthew E. wrote:
> This was something I've been wanting to do for a while so I'm very
> happy you went ahead and fixed it yourself. Once you submit the linux
> version I'll test it on my system.
> 
> Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

Do we need to synchronise with anything else (Linux drivers?) or I can I
just throw this into the tree once it is done?

Are we hanging any existing users of the tpm stuff out to dry? Could we
get a feature-protocol-v2 flag in xenstore so users at least get an
error message from either the front or backend to give a hint why it
isn't working?

>  void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)  {
> -   tpmif_tx_request_t* tx;
> -   int offset;
> -   int i;
> -   uint32_t domid;
> -   int tocopy;
> +   vtpm_shared_page_t* shr;
> +   unsigned int offset;
>     int flags;
> +#ifdef TPMBACK_PRINT_DEBUG
> +int i;
> +#endif

Dodgy indentation? (I saw a bunch of these)

> - * Copyright (c) 2005, IBM Corporation
> - *
> - * Author: Stefan Berger, stefanb@us.ibm.com
> - * Grant table support: Mahadevan Gomathisankaran

Did you really remove everything these guys wrote?

> - * This code has been derived from tools/libxc/xen/io/netif.h
> - *
> - * Copyright (c) 2003-2004, Keir Fraser

I guess I can buy this bit no longer being true given that you reworked
the whole protocol.

Ian


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:05:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:05:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbr41-00070C-4w; Fri, 23 Nov 2012 11:04:53 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbr40-000703-09
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 11:04:52 +0000
Received: from [85.158.139.211:37520] by server-5.bemta-5.messagelabs.com id
	61/52-11353-3585FA05; Fri, 23 Nov 2012 11:04:51 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1353668690!17297307!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5286 invoked from network); 23 Nov 2012 11:04:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 11:04:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15970625"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 11:04:08 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 11:04:07 +0000
Message-ID: <1353668646.13542.228.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
Date: Fri, 23 Nov 2012 11:04:06 +0000
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 16:16 +0000, Fioravante, Matthew E. wrote:
> This was something I've been wanting to do for a while so I'm very
> happy you went ahead and fixed it yourself. Once you submit the linux
> version I'll test it on my system.
> 
> Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

Do we need to synchronise with anything else (Linux drivers?) or I can I
just throw this into the tree once it is done?

Are we hanging any existing users of the tpm stuff out to dry? Could we
get a feature-protocol-v2 flag in xenstore so users at least get an
error message from either the front or backend to give a hint why it
isn't working?

>  void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)  {
> -   tpmif_tx_request_t* tx;
> -   int offset;
> -   int i;
> -   uint32_t domid;
> -   int tocopy;
> +   vtpm_shared_page_t* shr;
> +   unsigned int offset;
>     int flags;
> +#ifdef TPMBACK_PRINT_DEBUG
> +int i;
> +#endif

Dodgy indentation? (I saw a bunch of these)

> - * Copyright (c) 2005, IBM Corporation
> - *
> - * Author: Stefan Berger, stefanb@us.ibm.com
> - * Grant table support: Mahadevan Gomathisankaran

Did you really remove everything these guys wrote?

> - * This code has been derived from tools/libxc/xen/io/netif.h
> - *
> - * Copyright (c) 2003-2004, Keir Fraser

I guess I can buy this bit no longer being true given that you reworked
the whole protocol.

Ian


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:09:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:09:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbr83-00078N-R2; Fri, 23 Nov 2012 11:09:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1Tbr81-00078G-SF
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 11:09:02 +0000
Received: from [85.158.137.99:57733] by server-14.bemta-3.messagelabs.com id
	79/5D-12788-8495FA05; Fri, 23 Nov 2012 11:08:56 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1353668934!17168055!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzI2NjY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5123 invoked from network); 23 Nov 2012 11:08:55 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 11:08:55 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qANB8O6Q020371
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 23 Nov 2012 11:08:24 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qANB8Nh9008672
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 23 Nov 2012 11:08:23 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qANB8M1E007609; Fri, 23 Nov 2012 05:08:22 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 23 Nov 2012 03:08:22 -0800
Date: Fri, 23 Nov 2012 12:08:08 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121123110808.GA3002@host-192-168-1-59.local.net-space.pl>
References: <87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
	<18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
	<50AED7B8.7040902@citrix.com>
	<50AF55B102000078000AABF3@nat28.tlf.novell.com>
	<20121123103726.GB2921@host-192-168-1-59.local.net-space.pl>
	<50AF635B02000078000AAD0C@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50AF635B02000078000AAD0C@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"H. Peter Anvin" <hpa@zytor.com>, "tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, 2012 at 10:51:55AM +0000, Jan Beulich wrote:
> >>> On 23.11.12 at 11:37, Daniel Kiper <daniel.kiper@oracle.com> wrote:
> > On Fri, Nov 23, 2012 at 09:53:37AM +0000, Jan Beulich wrote:
> >> >>> On 23.11.12 at 02:56, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> >> > On 23/11/2012 01:38, H. Peter Anvin wrote:
> >> >> I still don't really get why it can't be isolated from dom0, which would
> >> > make more sense to me, even for a Xen crash.
> >> >>
> >> >
> >> > The crash region (as specified by crashkernel= on the Xen command line)
> >> > is isolated from dom0.
> >> >
> >> > dom0 (using the kexec utility etc) has the task of locating the Xen
> >> > crash notes (using the kexec hypercall interface), constructing a binary
> >> > blob containing kernel, initram and gubbins, and asking Xen to put this
> >> > blob in the crash region (again, using the kexec hypercall interface).
> >> >
> >> > I do not see how this is very much different from the native case
> >> > currently (although please correct me if I am misinformed).  Linux has
> >> > extra work to do by populating /proc/iomem with the Xen crash regions
> >> > boot (so the kexec utility can reference their physical addresses when
> >> > constructing the blob), and should just act as a conduit between the
> >> > kexec system call and the kexec hypercall to load the blob.
> >>
> >> But all of this _could_ be done completely independent of the
> >> Dom0 kernel's kexec infrastructure (i.e. fully from user space,
> >> invoking the necessary hypercalls through the privcmd driver).
> >
> > No, this is impossible. kexec/kdump image lives in dom0 kernel memory
> > until execution. That is why privcmd driver itself is not a solution
> > in this case.
>
> Even if so, there's no fundamental reason why that kernel image
> can't be put into Xen controlled space instead.

Yep, but we must change Xen kexec interface and/or its behavior first.
If we take that option then we could also move almost all needed things
from dom0 kernel to Xen. This way we could simplify Linux Kernel
kexec/kdump infrastructure needed to run on Xen.

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:09:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:09:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbr83-00078N-R2; Fri, 23 Nov 2012 11:09:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1Tbr81-00078G-SF
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 11:09:02 +0000
Received: from [85.158.137.99:57733] by server-14.bemta-3.messagelabs.com id
	79/5D-12788-8495FA05; Fri, 23 Nov 2012 11:08:56 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1353668934!17168055!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzI2NjY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5123 invoked from network); 23 Nov 2012 11:08:55 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 11:08:55 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qANB8O6Q020371
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 23 Nov 2012 11:08:24 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qANB8Nh9008672
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 23 Nov 2012 11:08:23 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qANB8M1E007609; Fri, 23 Nov 2012 05:08:22 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 23 Nov 2012 03:08:22 -0800
Date: Fri, 23 Nov 2012 12:08:08 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121123110808.GA3002@host-192-168-1-59.local.net-space.pl>
References: <87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
	<18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
	<50AED7B8.7040902@citrix.com>
	<50AF55B102000078000AABF3@nat28.tlf.novell.com>
	<20121123103726.GB2921@host-192-168-1-59.local.net-space.pl>
	<50AF635B02000078000AAD0C@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50AF635B02000078000AAD0C@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"H. Peter Anvin" <hpa@zytor.com>, "tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, 2012 at 10:51:55AM +0000, Jan Beulich wrote:
> >>> On 23.11.12 at 11:37, Daniel Kiper <daniel.kiper@oracle.com> wrote:
> > On Fri, Nov 23, 2012 at 09:53:37AM +0000, Jan Beulich wrote:
> >> >>> On 23.11.12 at 02:56, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> >> > On 23/11/2012 01:38, H. Peter Anvin wrote:
> >> >> I still don't really get why it can't be isolated from dom0, which would
> >> > make more sense to me, even for a Xen crash.
> >> >>
> >> >
> >> > The crash region (as specified by crashkernel= on the Xen command line)
> >> > is isolated from dom0.
> >> >
> >> > dom0 (using the kexec utility etc) has the task of locating the Xen
> >> > crash notes (using the kexec hypercall interface), constructing a binary
> >> > blob containing kernel, initram and gubbins, and asking Xen to put this
> >> > blob in the crash region (again, using the kexec hypercall interface).
> >> >
> >> > I do not see how this is very much different from the native case
> >> > currently (although please correct me if I am misinformed).  Linux has
> >> > extra work to do by populating /proc/iomem with the Xen crash regions
> >> > boot (so the kexec utility can reference their physical addresses when
> >> > constructing the blob), and should just act as a conduit between the
> >> > kexec system call and the kexec hypercall to load the blob.
> >>
> >> But all of this _could_ be done completely independent of the
> >> Dom0 kernel's kexec infrastructure (i.e. fully from user space,
> >> invoking the necessary hypercalls through the privcmd driver).
> >
> > No, this is impossible. kexec/kdump image lives in dom0 kernel memory
> > until execution. That is why privcmd driver itself is not a solution
> > in this case.
>
> Even if so, there's no fundamental reason why that kernel image
> can't be put into Xen controlled space instead.

Yep, but we must change Xen kexec interface and/or its behavior first.
If we take that option then we could also move almost all needed things
from dom0 kernel to Xen. This way we could simplify Linux Kernel
kexec/kdump infrastructure needed to run on Xen.

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:09:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:09:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbr8P-0007AC-7d; Fri, 23 Nov 2012 11:09:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbr8N-00079x-Hc
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 11:09:23 +0000
Received: from [85.158.138.51:9397] by server-12.bemta-3.messagelabs.com id
	B9/2C-22757-2695FA05; Fri, 23 Nov 2012 11:09:22 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353668961!23167403!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9439 invoked from network); 23 Nov 2012 11:09:22 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 11:09:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15970786"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 11:09:21 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 11:09:21 +0000
Message-ID: <1353668960.13542.229.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Olaf Hering <olaf@aepfle.de>
Date: Fri, 23 Nov 2012 11:09:20 +0000
In-Reply-To: <20121123105242.GA16420@aepfle.de>
References: <a446956472330fe32bc6.1353530980@probook.site>
	<1353665411.13542.197.camel@zakaz.uk.xensource.com>
	<20121123105242.GA16420@aepfle.de>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xend: enable environment passing in xPopen3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 10:52 +0000, Olaf Hering wrote:
> On Fri, Nov 23, Ian Campbell wrote:
> 
> > On Wed, 2012-11-21 at 20:49 +0000, Olaf Hering wrote:
> > > # HG changeset patch
> > > # User Olaf Hering <olaf@aepfle.de>
> > > # Date 1353530937 -3600
> > > # Node ID a446956472330fe32bc69be764a33f59fb090792
> > > # Parent  2489c29266982175b5b4e945c97b4549360e947f
> > > xend: enable environment passing in xPopen3
> > > 
> > > In changeset 19990:38dd208e1d95 a new parameter 'env' was added to
> > > xPopen3, but no code was added to actually pass the environment down to
> > > execvpe. Also, the new code was unreachable.
> > > 
> > > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> > 
> > It seems that no callers provide an environment? How did you spot this?
> 
> In my testing I did pass options to xc_save via the environment, which
> is called via forkhelper (somewhere in python code).

Thanks. Acked + applied.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:09:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:09:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbr8P-0007AC-7d; Fri, 23 Nov 2012 11:09:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbr8N-00079x-Hc
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 11:09:23 +0000
Received: from [85.158.138.51:9397] by server-12.bemta-3.messagelabs.com id
	B9/2C-22757-2695FA05; Fri, 23 Nov 2012 11:09:22 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353668961!23167403!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9439 invoked from network); 23 Nov 2012 11:09:22 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 11:09:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15970786"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 11:09:21 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 11:09:21 +0000
Message-ID: <1353668960.13542.229.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Olaf Hering <olaf@aepfle.de>
Date: Fri, 23 Nov 2012 11:09:20 +0000
In-Reply-To: <20121123105242.GA16420@aepfle.de>
References: <a446956472330fe32bc6.1353530980@probook.site>
	<1353665411.13542.197.camel@zakaz.uk.xensource.com>
	<20121123105242.GA16420@aepfle.de>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xend: enable environment passing in xPopen3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 10:52 +0000, Olaf Hering wrote:
> On Fri, Nov 23, Ian Campbell wrote:
> 
> > On Wed, 2012-11-21 at 20:49 +0000, Olaf Hering wrote:
> > > # HG changeset patch
> > > # User Olaf Hering <olaf@aepfle.de>
> > > # Date 1353530937 -3600
> > > # Node ID a446956472330fe32bc69be764a33f59fb090792
> > > # Parent  2489c29266982175b5b4e945c97b4549360e947f
> > > xend: enable environment passing in xPopen3
> > > 
> > > In changeset 19990:38dd208e1d95 a new parameter 'env' was added to
> > > xPopen3, but no code was added to actually pass the environment down to
> > > execvpe. Also, the new code was unreachable.
> > > 
> > > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> > 
> > It seems that no callers provide an environment? How did you spot this?
> 
> In my testing I did pass options to xc_save via the environment, which
> is called via forkhelper (somewhere in python code).

Thanks. Acked + applied.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:09:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:09:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbr8R-0007Ae-Je; Fri, 23 Nov 2012 11:09:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbr8Q-0007AQ-Vb
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 11:09:27 +0000
Received: from [85.158.138.51:9656] by server-14.bemta-3.messagelabs.com id
	EF/CE-12788-6695FA05; Fri, 23 Nov 2012 11:09:26 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353668961!23167403!2
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9736 invoked from network); 23 Nov 2012 11:09:25 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 11:09:25 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15970790"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 11:09:25 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 11:09:25 +0000
Message-ID: <1353668963.13542.230.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Fri, 23 Nov 2012 11:09:23 +0000
In-Reply-To: <alpine.DEB.2.02.1211221715570.13749@kaball.uk.xensource.com>
References: <ffc59d2fc9980c660941.1353601059@whitby.uk.xensource.com>
	<alpine.DEB.2.02.1211221715570.13749@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] arm: Tidy up flush_xen_dcache()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-22 at 17:16 +0000, Stefano Stabellini wrote:
> On Thu, 22 Nov 2012, Tim Deegan wrote:
> > # HG changeset patch
> > # User Tim Deegan <tim@xen.org>
> > # Date 1353600936 0
> > # Node ID ffc59d2fc9980c660941eb24cbe827c1142d1fd0
> > # Parent  7b4449bdb980caee8efc498d5ea48f772331df2f
> > arm: Tidy up flush_xen_dcache().
> > 
> >  - Use a compile-time-constant check for whether we can safely flush
> >    just one cacheline.  This reduces the common case from 28
> >    instructions to three.
> >  - Pass an object to the macro, not a pointer, so we can detect
> >    attempts to flush arrays.
> >  - Decode CCSIDR correctly to get cacheline size.
> >  - Remove some redundant DSBs at the call sites.
> > 
> > Signed-off-by: Tim Deegan <tim@xen.org>
> 
> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Applied.

I wonder if flush_xen_dcache_va_range should be out of line?

> 
> 
> > diff -r 7b4449bdb980 -r ffc59d2fc998 xen/arch/arm/mm.c
> > --- a/xen/arch/arm/mm.c	Thu Nov 22 10:47:58 2012 +0100
> > +++ b/xen/arch/arm/mm.c	Thu Nov 22 16:15:36 2012 +0000
> > @@ -247,7 +247,7 @@ void __init setup_pagetables(unsigned lo
> >  
> >      /* Change pagetables to the copy in the relocated Xen */
> >      boot_httbr = (unsigned long) xen_pgtable + phys_offset;
> > -    flush_xen_dcache_va(&boot_httbr);
> > +    flush_xen_dcache(boot_httbr);
> >      flush_xen_dcache_va_range((void*)dest_va, _end - _start);
> >      flush_xen_text_tlb();
> >  
> > diff -r 7b4449bdb980 -r ffc59d2fc998 xen/arch/arm/setup.c
> > --- a/xen/arch/arm/setup.c	Thu Nov 22 10:47:58 2012 +0100
> > +++ b/xen/arch/arm/setup.c	Thu Nov 22 16:15:36 2012 +0000
> > @@ -175,6 +175,21 @@ static void __init setup_mm(unsigned lon
> >      end_boot_allocator();
> >  }
> >  
> > +size_t __read_mostly cacheline_bytes;
> > +
> > +/* Very early check of the CPU cache properties */
> > +void __init setup_cache(void)
> > +{
> > +    uint32_t ccsid;
> > +
> > +    /* Read the cache size ID register for the level-0 data cache */
> > +    WRITE_CP32(0, CSSELR);
> > +    ccsid = READ_CP32(CCSIDR);
> > +
> > +    /* Low 3 bits are log2(cacheline size in words) - 2. */
> > +    cacheline_bytes = 1U << (4 + (ccsid & 0x7));
> > +}
> > +
> >  /* C entry point for boot CPU */
> >  void __init start_xen(unsigned long boot_phys_offset,
> >                        unsigned long arm_type,
> > @@ -185,6 +200,8 @@ void __init start_xen(unsigned long boot
> >      size_t fdt_size;
> >      int cpus, i;
> >  
> > +    setup_cache();
> > +
> >      smp_clear_cpu_maps();
> >  
> >      fdt = (void *)BOOT_MISC_VIRT_START
> > diff -r 7b4449bdb980 -r ffc59d2fc998 xen/arch/arm/smpboot.c
> > --- a/xen/arch/arm/smpboot.c	Thu Nov 22 10:47:58 2012 +0100
> > +++ b/xen/arch/arm/smpboot.c	Thu Nov 22 16:15:36 2012 +0000
> > @@ -118,8 +118,8 @@ make_cpus_ready(unsigned int max_cpus, u
> >          /* Tell the next CPU to get ready */
> >          /* TODO: handle boards where CPUIDs are not contiguous */
> >          *gate = i;
> > -        flush_xen_dcache_va(gate);
> > -        asm volatile("dsb; isb; sev");
> > +        flush_xen_dcache(*gate);
> > +        asm volatile("isb; sev");
> >          /* And wait for it to respond */
> >          while ( ready_cpus < i )
> >              smp_rmb();
> > @@ -217,8 +217,8 @@ int __cpu_up(unsigned int cpu)
> >      smp_up_cpu = cpu;
> >      /* we need to make sure that the change to smp_up_cpu is visible to
> >       * secondary cpus with D-cache off */
> > -    flush_xen_dcache_va(&smp_up_cpu);
> > -    asm volatile("dsb; isb; sev");
> > +    flush_xen_dcache(smp_up_cpu);
> > +    asm volatile("isb; sev");
> >  
> >      while ( !cpu_online(cpu) )
> >      {
> > diff -r 7b4449bdb980 -r ffc59d2fc998 xen/include/asm-arm/page.h
> > --- a/xen/include/asm-arm/page.h	Thu Nov 22 10:47:58 2012 +0100
> > +++ b/xen/include/asm-arm/page.h	Thu Nov 22 16:15:36 2012 +0000
> > @@ -248,13 +248,16 @@ static inline void write_pte(lpae_t *p, 
> >          : : "r" (pte.bits), "r" (p) : "memory");
> >  }
> >  
> > +/* Architectural minimum cacheline size is 4 32-bit words. */
> > +#define MIN_CACHELINE_BYTES 16
> > +/* Actual cacheline size on the boot CPU. */
> > +extern size_t cacheline_bytes;
> >  
> >  /* Function for flushing medium-sized areas.
> >   * if 'range' is large enough we might want to use model-specific
> >   * full-cache flushes. */
> >  static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
> >  {
> > -    int cacheline_bytes  = READ_CP32(CCSIDR);
> >      void *end;
> >      dsb();           /* So the CPU issues all writes to the range */
> >      for ( end = p + size; p < end; p += cacheline_bytes )
> > @@ -262,17 +265,13 @@ static inline void flush_xen_dcache_va_r
> >      dsb();           /* So we know the flushes happen before continuing */
> >  }
> >  
> > -
> >  /* Macro for flushing a single small item.  The predicate is always
> >   * compile-time constant so this will compile down to 3 instructions in
> > - * the common case.  Make sure to call it with the correct type of
> > - * pointer! */
> > -#define flush_xen_dcache_va(p) do {                                     \
> > -    int cacheline_bytes  = READ_CP32(CCSIDR);                           \
> > -    typeof(p) _p = (p);                                                 \
> > -    if ( ((unsigned long)_p & ~(cacheline_bytes - 1)) !=                \
> > -        (((unsigned long)_p + (sizeof *_p)) & ~(cacheline_bytes - 1)) ) \
> > -        flush_xen_dcache_va_range(_p, sizeof *_p);                      \
> > + * the common case. */
> > +#define flush_xen_dcache(x) do {                                        \
> > +    typeof(x) *_p = &(x);                                               \
> > +    if ( sizeof(x) > MIN_CACHELINE_BYTES || sizeof(x) > alignof(x) )    \
> > +        flush_xen_dcache_va_range(_p, sizeof(x));                       \
> >      else                                                                \
> >          asm volatile (                                                  \
> >              "dsb;"   /* Finish all earlier writes */                    \
> > diff -r 7b4449bdb980 -r ffc59d2fc998 xen/include/xen/compiler.h
> > --- a/xen/include/xen/compiler.h	Thu Nov 22 10:47:58 2012 +0100
> > +++ b/xen/include/xen/compiler.h	Thu Nov 22 16:15:36 2012 +0000
> > @@ -54,6 +54,10 @@
> >  
> >  #define offsetof(a,b) __builtin_offsetof(a,b)
> >  
> > +#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L
> > +#define alignof __alignof__
> > +#endif
> > +
> >  /* &a[0] degrades to a pointer: a different type from an array */
> >  #define __must_be_array(a) \
> >    BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
> > 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:09:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:09:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbr8R-0007Ae-Je; Fri, 23 Nov 2012 11:09:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbr8Q-0007AQ-Vb
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 11:09:27 +0000
Received: from [85.158.138.51:9656] by server-14.bemta-3.messagelabs.com id
	EF/CE-12788-6695FA05; Fri, 23 Nov 2012 11:09:26 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353668961!23167403!2
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9736 invoked from network); 23 Nov 2012 11:09:25 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 11:09:25 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15970790"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 11:09:25 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 11:09:25 +0000
Message-ID: <1353668963.13542.230.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Fri, 23 Nov 2012 11:09:23 +0000
In-Reply-To: <alpine.DEB.2.02.1211221715570.13749@kaball.uk.xensource.com>
References: <ffc59d2fc9980c660941.1353601059@whitby.uk.xensource.com>
	<alpine.DEB.2.02.1211221715570.13749@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] arm: Tidy up flush_xen_dcache()
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-22 at 17:16 +0000, Stefano Stabellini wrote:
> On Thu, 22 Nov 2012, Tim Deegan wrote:
> > # HG changeset patch
> > # User Tim Deegan <tim@xen.org>
> > # Date 1353600936 0
> > # Node ID ffc59d2fc9980c660941eb24cbe827c1142d1fd0
> > # Parent  7b4449bdb980caee8efc498d5ea48f772331df2f
> > arm: Tidy up flush_xen_dcache().
> > 
> >  - Use a compile-time-constant check for whether we can safely flush
> >    just one cacheline.  This reduces the common case from 28
> >    instructions to three.
> >  - Pass an object to the macro, not a pointer, so we can detect
> >    attempts to flush arrays.
> >  - Decode CCSIDR correctly to get cacheline size.
> >  - Remove some redundant DSBs at the call sites.
> > 
> > Signed-off-by: Tim Deegan <tim@xen.org>
> 
> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Applied.

I wonder if flush_xen_dcache_va_range should be out of line?

> 
> 
> > diff -r 7b4449bdb980 -r ffc59d2fc998 xen/arch/arm/mm.c
> > --- a/xen/arch/arm/mm.c	Thu Nov 22 10:47:58 2012 +0100
> > +++ b/xen/arch/arm/mm.c	Thu Nov 22 16:15:36 2012 +0000
> > @@ -247,7 +247,7 @@ void __init setup_pagetables(unsigned lo
> >  
> >      /* Change pagetables to the copy in the relocated Xen */
> >      boot_httbr = (unsigned long) xen_pgtable + phys_offset;
> > -    flush_xen_dcache_va(&boot_httbr);
> > +    flush_xen_dcache(boot_httbr);
> >      flush_xen_dcache_va_range((void*)dest_va, _end - _start);
> >      flush_xen_text_tlb();
> >  
> > diff -r 7b4449bdb980 -r ffc59d2fc998 xen/arch/arm/setup.c
> > --- a/xen/arch/arm/setup.c	Thu Nov 22 10:47:58 2012 +0100
> > +++ b/xen/arch/arm/setup.c	Thu Nov 22 16:15:36 2012 +0000
> > @@ -175,6 +175,21 @@ static void __init setup_mm(unsigned lon
> >      end_boot_allocator();
> >  }
> >  
> > +size_t __read_mostly cacheline_bytes;
> > +
> > +/* Very early check of the CPU cache properties */
> > +void __init setup_cache(void)
> > +{
> > +    uint32_t ccsid;
> > +
> > +    /* Read the cache size ID register for the level-0 data cache */
> > +    WRITE_CP32(0, CSSELR);
> > +    ccsid = READ_CP32(CCSIDR);
> > +
> > +    /* Low 3 bits are log2(cacheline size in words) - 2. */
> > +    cacheline_bytes = 1U << (4 + (ccsid & 0x7));
> > +}
> > +
> >  /* C entry point for boot CPU */
> >  void __init start_xen(unsigned long boot_phys_offset,
> >                        unsigned long arm_type,
> > @@ -185,6 +200,8 @@ void __init start_xen(unsigned long boot
> >      size_t fdt_size;
> >      int cpus, i;
> >  
> > +    setup_cache();
> > +
> >      smp_clear_cpu_maps();
> >  
> >      fdt = (void *)BOOT_MISC_VIRT_START
> > diff -r 7b4449bdb980 -r ffc59d2fc998 xen/arch/arm/smpboot.c
> > --- a/xen/arch/arm/smpboot.c	Thu Nov 22 10:47:58 2012 +0100
> > +++ b/xen/arch/arm/smpboot.c	Thu Nov 22 16:15:36 2012 +0000
> > @@ -118,8 +118,8 @@ make_cpus_ready(unsigned int max_cpus, u
> >          /* Tell the next CPU to get ready */
> >          /* TODO: handle boards where CPUIDs are not contiguous */
> >          *gate = i;
> > -        flush_xen_dcache_va(gate);
> > -        asm volatile("dsb; isb; sev");
> > +        flush_xen_dcache(*gate);
> > +        asm volatile("isb; sev");
> >          /* And wait for it to respond */
> >          while ( ready_cpus < i )
> >              smp_rmb();
> > @@ -217,8 +217,8 @@ int __cpu_up(unsigned int cpu)
> >      smp_up_cpu = cpu;
> >      /* we need to make sure that the change to smp_up_cpu is visible to
> >       * secondary cpus with D-cache off */
> > -    flush_xen_dcache_va(&smp_up_cpu);
> > -    asm volatile("dsb; isb; sev");
> > +    flush_xen_dcache(smp_up_cpu);
> > +    asm volatile("isb; sev");
> >  
> >      while ( !cpu_online(cpu) )
> >      {
> > diff -r 7b4449bdb980 -r ffc59d2fc998 xen/include/asm-arm/page.h
> > --- a/xen/include/asm-arm/page.h	Thu Nov 22 10:47:58 2012 +0100
> > +++ b/xen/include/asm-arm/page.h	Thu Nov 22 16:15:36 2012 +0000
> > @@ -248,13 +248,16 @@ static inline void write_pte(lpae_t *p, 
> >          : : "r" (pte.bits), "r" (p) : "memory");
> >  }
> >  
> > +/* Architectural minimum cacheline size is 4 32-bit words. */
> > +#define MIN_CACHELINE_BYTES 16
> > +/* Actual cacheline size on the boot CPU. */
> > +extern size_t cacheline_bytes;
> >  
> >  /* Function for flushing medium-sized areas.
> >   * if 'range' is large enough we might want to use model-specific
> >   * full-cache flushes. */
> >  static inline void flush_xen_dcache_va_range(void *p, unsigned long size)
> >  {
> > -    int cacheline_bytes  = READ_CP32(CCSIDR);
> >      void *end;
> >      dsb();           /* So the CPU issues all writes to the range */
> >      for ( end = p + size; p < end; p += cacheline_bytes )
> > @@ -262,17 +265,13 @@ static inline void flush_xen_dcache_va_r
> >      dsb();           /* So we know the flushes happen before continuing */
> >  }
> >  
> > -
> >  /* Macro for flushing a single small item.  The predicate is always
> >   * compile-time constant so this will compile down to 3 instructions in
> > - * the common case.  Make sure to call it with the correct type of
> > - * pointer! */
> > -#define flush_xen_dcache_va(p) do {                                     \
> > -    int cacheline_bytes  = READ_CP32(CCSIDR);                           \
> > -    typeof(p) _p = (p);                                                 \
> > -    if ( ((unsigned long)_p & ~(cacheline_bytes - 1)) !=                \
> > -        (((unsigned long)_p + (sizeof *_p)) & ~(cacheline_bytes - 1)) ) \
> > -        flush_xen_dcache_va_range(_p, sizeof *_p);                      \
> > + * the common case. */
> > +#define flush_xen_dcache(x) do {                                        \
> > +    typeof(x) *_p = &(x);                                               \
> > +    if ( sizeof(x) > MIN_CACHELINE_BYTES || sizeof(x) > alignof(x) )    \
> > +        flush_xen_dcache_va_range(_p, sizeof(x));                       \
> >      else                                                                \
> >          asm volatile (                                                  \
> >              "dsb;"   /* Finish all earlier writes */                    \
> > diff -r 7b4449bdb980 -r ffc59d2fc998 xen/include/xen/compiler.h
> > --- a/xen/include/xen/compiler.h	Thu Nov 22 10:47:58 2012 +0100
> > +++ b/xen/include/xen/compiler.h	Thu Nov 22 16:15:36 2012 +0000
> > @@ -54,6 +54,10 @@
> >  
> >  #define offsetof(a,b) __builtin_offsetof(a,b)
> >  
> > +#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L
> > +#define alignof __alignof__
> > +#endif
> > +
> >  /* &a[0] degrades to a pointer: a different type from an array */
> >  #define __must_be_array(a) \
> >    BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
> > 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:10:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:10:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbr8q-0007GH-8E; Fri, 23 Nov 2012 11:09:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbr8o-0007Fr-K1
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 11:09:50 +0000
Received: from [85.158.143.99:13123] by server-3.bemta-4.messagelabs.com id
	85/E9-06841-D795FA05; Fri, 23 Nov 2012 11:09:49 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1353668989!27710528!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3804 invoked from network); 23 Nov 2012 11:09:49 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 11:09:49 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15970806"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 11:09:49 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 11:09:48 +0000
Message-ID: <1353668987.13542.231.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>, Ian Jackson
	<Ian.Jackson@eu.citrix.com>
Date: Fri, 23 Nov 2012 11:09:47 +0000
In-Reply-To: <ab313e9521f44bdd91a2.1353427784@elijah>
References: <ab313e9521f44bdd91a2.1353427784@elijah>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] xl: Suppress spurious warning message for
 cpupool-list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 16:09 +0000, George Dunlap wrote:
> # HG changeset patch
> # User George Dunlap <george.dunlap@eu.citrix.com>
> # Date 1353427397 0
> # Node ID ab313e9521f44bdd91a20a1b3eb499b2ee321b5e
> # Parent  ae6fb202b233af815466055d9f1a635802a50855
> xl: Suppress spurious warning message for cpupool-list
> 
> libxl_cpupool_list() enumerates the cpupools by "probing": calling
> cpupool_info, starting at 0 and stopping when it gets an error. However,
> cpupool_info will print an error when the call to xc_cpupool_getinfo() fails,
> resulting in every xl command that uses libxl_list_cpupool (such as
> cpupool-list) printing that error message spuriously.
> 
> Since at the moment the times we want to print the message correspond
> with the use of the existing "exact" parameter, use it to decide
> whether to print the message or not.
> 
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com> + applied, thanks.

Ian J -- a 4.2 backport candidate.
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -593,7 +593,8 @@ static int cpupool_info(libxl__gc *gc,
>      xcinfo = xc_cpupool_getinfo(CTX->xch, poolid);
>      if (xcinfo == NULL)
>      {
> -        LOGE(ERROR, "failed to get info for cpupool%d\n", poolid);
> +        if (exact || errno != ENOENT)
> +            LOGE(ERROR, "failed to get info for cpupool%d\n", poolid);
>          return ERROR_FAIL;
>      }
>  
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:10:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:10:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbr8q-0007GH-8E; Fri, 23 Nov 2012 11:09:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbr8o-0007Fr-K1
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 11:09:50 +0000
Received: from [85.158.143.99:13123] by server-3.bemta-4.messagelabs.com id
	85/E9-06841-D795FA05; Fri, 23 Nov 2012 11:09:49 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1353668989!27710528!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3804 invoked from network); 23 Nov 2012 11:09:49 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 11:09:49 -0000
X-IronPort-AV: E=Sophos;i="4.83,306,1352073600"; d="scan'208";a="15970806"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 11:09:49 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 11:09:48 +0000
Message-ID: <1353668987.13542.231.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>, Ian Jackson
	<Ian.Jackson@eu.citrix.com>
Date: Fri, 23 Nov 2012 11:09:47 +0000
In-Reply-To: <ab313e9521f44bdd91a2.1353427784@elijah>
References: <ab313e9521f44bdd91a2.1353427784@elijah>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] xl: Suppress spurious warning message for
 cpupool-list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-20 at 16:09 +0000, George Dunlap wrote:
> # HG changeset patch
> # User George Dunlap <george.dunlap@eu.citrix.com>
> # Date 1353427397 0
> # Node ID ab313e9521f44bdd91a20a1b3eb499b2ee321b5e
> # Parent  ae6fb202b233af815466055d9f1a635802a50855
> xl: Suppress spurious warning message for cpupool-list
> 
> libxl_cpupool_list() enumerates the cpupools by "probing": calling
> cpupool_info, starting at 0 and stopping when it gets an error. However,
> cpupool_info will print an error when the call to xc_cpupool_getinfo() fails,
> resulting in every xl command that uses libxl_list_cpupool (such as
> cpupool-list) printing that error message spuriously.
> 
> Since at the moment the times we want to print the message correspond
> with the use of the existing "exact" parameter, use it to decide
> whether to print the message or not.
> 
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com> + applied, thanks.

Ian J -- a 4.2 backport candidate.
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -593,7 +593,8 @@ static int cpupool_info(libxl__gc *gc,
>      xcinfo = xc_cpupool_getinfo(CTX->xch, poolid);
>      if (xcinfo == NULL)
>      {
> -        LOGE(ERROR, "failed to get info for cpupool%d\n", poolid);
> +        if (exact || errno != ENOENT)
> +            LOGE(ERROR, "failed to get info for cpupool%d\n", poolid);
>          return ERROR_FAIL;
>      }
>  
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:14:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:14:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbrCy-0007qH-1V; Fri, 23 Nov 2012 11:14:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1TbrCw-0007q8-Of
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 11:14:06 +0000
Received: from [85.158.138.51:18289] by server-10.bemta-3.messagelabs.com id
	2E/06-19806-D7A5FA05; Fri, 23 Nov 2012 11:14:05 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353669242!31272001!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4Mjk4MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13312 invoked from network); 23 Nov 2012 11:14:03 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-5.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 11:14:03 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qANBDIMX011659
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 23 Nov 2012 11:13:19 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qANBDH2x004419
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 23 Nov 2012 11:13:18 GMT
Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qANBDHQa007053; Fri, 23 Nov 2012 05:13:17 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 23 Nov 2012 03:13:16 -0800
Date: Fri, 23 Nov 2012 12:13:08 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121123111308.GB3002@host-192-168-1-59.local.net-space.pl>
References: <87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
	<18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
	<50AED7B8.7040902@citrix.com>
	<50AF55B102000078000AABF3@nat28.tlf.novell.com>
	<20121123103726.GB2921@host-192-168-1-59.local.net-space.pl>
	<1353667868.13542.218.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353667868.13542.218.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Jan Beulich <JBeulich@suse.com>, "H. Peter Anvin" <hpa@zytor.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, 2012 at 10:51:08AM +0000, Ian Campbell wrote:
> On Fri, 2012-11-23 at 10:37 +0000, Daniel Kiper wrote:
> > On Fri, Nov 23, 2012 at 09:53:37AM +0000, Jan Beulich wrote:
> > > >>> On 23.11.12 at 02:56, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> > > > The crash region (as specified by crashkernel= on the Xen command line)
> > > > is isolated from dom0.
> > > >[...]
> > >
> > > But all of this _could_ be done completely independent of the
> > > Dom0 kernel's kexec infrastructure (i.e. fully from user space,
> > > invoking the necessary hypercalls through the privcmd driver).
> >
> > No, this is impossible. kexec/kdump image lives in dom0 kernel memory
> > until execution.
>
> Are you sure? I could have sworn they lived in the hypervisor owned
> memory set aside by the crashkernel= parameter as Andy suggested.

I am sure. It is moved to final resting place when
relocate_kernel() is called by hypervisor.

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:14:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:14:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbrCy-0007qH-1V; Fri, 23 Nov 2012 11:14:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <daniel.kiper@oracle.com>) id 1TbrCw-0007q8-Of
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 11:14:06 +0000
Received: from [85.158.138.51:18289] by server-10.bemta-3.messagelabs.com id
	2E/06-19806-D7A5FA05; Fri, 23 Nov 2012 11:14:05 +0000
X-Env-Sender: daniel.kiper@oracle.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353669242!31272001!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4Mjk4MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13312 invoked from network); 23 Nov 2012 11:14:03 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-5.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 11:14:03 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qANBDIMX011659
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 23 Nov 2012 11:13:19 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qANBDH2x004419
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 23 Nov 2012 11:13:18 GMT
Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qANBDHQa007053; Fri, 23 Nov 2012 05:13:17 -0600
Received: from host-192-168-1-59.local.net-space.pl (/89.174.63.77)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 23 Nov 2012 03:13:16 -0800
Date: Fri, 23 Nov 2012 12:13:08 +0100
From: Daniel Kiper <daniel.kiper@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121123111308.GB3002@host-192-168-1-59.local.net-space.pl>
References: <87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com> <50AE6542.3020302@zytor.com>
	<50AEBF86.50501@citrix.com>
	<18e831d4-910d-4f58-8911-1398b96e3a47@email.android.com>
	<50AED7B8.7040902@citrix.com>
	<50AF55B102000078000AABF3@nat28.tlf.novell.com>
	<20121123103726.GB2921@host-192-168-1-59.local.net-space.pl>
	<1353667868.13542.218.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353667868.13542.218.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Jan Beulich <JBeulich@suse.com>, "H. Peter Anvin" <hpa@zytor.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, 2012 at 10:51:08AM +0000, Ian Campbell wrote:
> On Fri, 2012-11-23 at 10:37 +0000, Daniel Kiper wrote:
> > On Fri, Nov 23, 2012 at 09:53:37AM +0000, Jan Beulich wrote:
> > > >>> On 23.11.12 at 02:56, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> > > > The crash region (as specified by crashkernel= on the Xen command line)
> > > > is isolated from dom0.
> > > >[...]
> > >
> > > But all of this _could_ be done completely independent of the
> > > Dom0 kernel's kexec infrastructure (i.e. fully from user space,
> > > invoking the necessary hypercalls through the privcmd driver).
> >
> > No, this is impossible. kexec/kdump image lives in dom0 kernel memory
> > until execution.
>
> Are you sure? I could have sworn they lived in the hypervisor owned
> memory set aside by the crashkernel= parameter as Andy suggested.

I am sure. It is moved to final resting place when
relocate_kernel() is called by hypervisor.

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:35:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:35:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbrXZ-0008Qh-VR; Fri, 23 Nov 2012 11:35:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <chosi@amd.co.at>) id 1TbrXY-0008Qc-A4
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 11:35:24 +0000
Received: from [85.158.143.99:17041] by server-1.bemta-4.messagelabs.com id
	6B/58-27934-B7F5FA05; Fri, 23 Nov 2012 11:35:23 +0000
X-Env-Sender: chosi@amd.co.at
X-Msg-Ref: server-12.tower-216.messagelabs.com!1353670520!25825271!1
X-Originating-IP: [134.109.228.40]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3066 invoked from network); 23 Nov 2012 11:35:21 -0000
Received: from cora.hrz.tu-chemnitz.de (HELO cora.hrz.tu-chemnitz.de)
	(134.109.228.40)
	by server-12.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 11:35:21 -0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=tu-chemnitz.de; s=dkim2010; 
	h=Content-Transfer-Encoding:Content-Type:Subject:To:MIME-Version:From:Date:Message-ID;
	bh=mur69eGTCj9Rxbh8syF23gTuedHqHBqv+99NTugbnpQ=; 
	b=oiQCptjy5EH24v5WNmGlCsMbDStRoHb9HfcV/6VIl8LY9iqbxyILoLJHNvG0I+LlW4BP2p9kmzyhnuD6rq4CilmaXV5vfWjmDRKFpQyUl0oI4dLdj+WpbW433exQcKdMEx+5Ze8gBpBHpJgZokv8ESpK84lx9N4QoJDtgzfC25U=;
Received: from 023-096-109-134.csn.tu-chemnitz.de ([134.109.96.23]
	helo=[192.168.1.3]) by cora.hrz.tu-chemnitz.de with esmtpsa
	(TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80.1)
	(envelope-from <chosi@amd.co.at>) id 1TbrXT-0006gU-W5
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:35:20 +0100
Message-ID: <50AF5F7E.8030907@amd.co.at>
Date: Fri, 23 Nov 2012 12:35:26 +0100
From: Alexander Bienzeisler <chosi@amd.co.at>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
X-purgate: clean
X-purgate-type: clean
X-purgate-ID: 154106::1353670520-00000CD1-76AEF968/0-0/0-0
X-Scan-AV: cora.hrz.tu-chemnitz.de; 2012-11-23 12:35:19;
	857ae72284815a958ef377c53697f3b6
X-Scan-SA: cora.hrz.tu-chemnitz.de; 2012-11-23 12:35:20;
	710b98900007b77adfbab11b260a9af8
X-Spam-Score: -1.0 (-)
X-Spam-Report: --- Textanalyse SpamAssassin 3.3.1 (-1.0 Punkte)
	Fragen an/questions to: Postmaster TU Chemnitz
	<postmaster@tu-chemnitz.de>
	* -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
	*  0.0 TVD_RCVD_IP TVD_RCVD_IP --- Ende Textanalyse
Subject: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

i just tried to add a domU with 16 gigs of ram (maxmem = 16384, memory = 
16384) with free_memory : 28969 but got an error:

libxl: error: libxl.c:3433:libxl_set_memory_target: new target 0 for 
dom0 is below the minimum threshold

I was able to create it with 8 gigs of ram, ending up with free_memory : 
20776

Is there something wrong with memory in 4.2? I can't seem to use all of it.

Cheers,
Alex

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:35:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:35:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbrXZ-0008Qh-VR; Fri, 23 Nov 2012 11:35:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <chosi@amd.co.at>) id 1TbrXY-0008Qc-A4
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 11:35:24 +0000
Received: from [85.158.143.99:17041] by server-1.bemta-4.messagelabs.com id
	6B/58-27934-B7F5FA05; Fri, 23 Nov 2012 11:35:23 +0000
X-Env-Sender: chosi@amd.co.at
X-Msg-Ref: server-12.tower-216.messagelabs.com!1353670520!25825271!1
X-Originating-IP: [134.109.228.40]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3066 invoked from network); 23 Nov 2012 11:35:21 -0000
Received: from cora.hrz.tu-chemnitz.de (HELO cora.hrz.tu-chemnitz.de)
	(134.109.228.40)
	by server-12.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 11:35:21 -0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=tu-chemnitz.de; s=dkim2010; 
	h=Content-Transfer-Encoding:Content-Type:Subject:To:MIME-Version:From:Date:Message-ID;
	bh=mur69eGTCj9Rxbh8syF23gTuedHqHBqv+99NTugbnpQ=; 
	b=oiQCptjy5EH24v5WNmGlCsMbDStRoHb9HfcV/6VIl8LY9iqbxyILoLJHNvG0I+LlW4BP2p9kmzyhnuD6rq4CilmaXV5vfWjmDRKFpQyUl0oI4dLdj+WpbW433exQcKdMEx+5Ze8gBpBHpJgZokv8ESpK84lx9N4QoJDtgzfC25U=;
Received: from 023-096-109-134.csn.tu-chemnitz.de ([134.109.96.23]
	helo=[192.168.1.3]) by cora.hrz.tu-chemnitz.de with esmtpsa
	(TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80.1)
	(envelope-from <chosi@amd.co.at>) id 1TbrXT-0006gU-W5
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:35:20 +0100
Message-ID: <50AF5F7E.8030907@amd.co.at>
Date: Fri, 23 Nov 2012 12:35:26 +0100
From: Alexander Bienzeisler <chosi@amd.co.at>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
X-purgate: clean
X-purgate-type: clean
X-purgate-ID: 154106::1353670520-00000CD1-76AEF968/0-0/0-0
X-Scan-AV: cora.hrz.tu-chemnitz.de; 2012-11-23 12:35:19;
	857ae72284815a958ef377c53697f3b6
X-Scan-SA: cora.hrz.tu-chemnitz.de; 2012-11-23 12:35:20;
	710b98900007b77adfbab11b260a9af8
X-Spam-Score: -1.0 (-)
X-Spam-Report: --- Textanalyse SpamAssassin 3.3.1 (-1.0 Punkte)
	Fragen an/questions to: Postmaster TU Chemnitz
	<postmaster@tu-chemnitz.de>
	* -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
	*  0.0 TVD_RCVD_IP TVD_RCVD_IP --- Ende Textanalyse
Subject: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

i just tried to add a domU with 16 gigs of ram (maxmem = 16384, memory = 
16384) with free_memory : 28969 but got an error:

libxl: error: libxl.c:3433:libxl_set_memory_target: new target 0 for 
dom0 is below the minimum threshold

I was able to create it with 8 gigs of ram, ending up with free_memory : 
20776

Is there something wrong with memory in 4.2? I can't seem to use all of it.

Cheers,
Alex

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:37:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:37:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbrZh-0008Vj-H7; Fri, 23 Nov 2012 11:37:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TbrZg-0008Vd-Hd
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 11:37:36 +0000
Received: from [85.158.143.99:29188] by server-3.bemta-4.messagelabs.com id
	78/B5-06841-FFF5FA05; Fri, 23 Nov 2012 11:37:35 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1353670652!21059486!1
X-Originating-IP: [209.85.220.171]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17426 invoked from network); 23 Nov 2012 11:37:33 -0000
Received: from mail-vc0-f171.google.com (HELO mail-vc0-f171.google.com)
	(209.85.220.171)
	by server-10.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 11:37:33 -0000
Received: by mail-vc0-f171.google.com with SMTP id fo14so7579550vcb.30
	for <xen-devel@lists.xensource.com>;
	Fri, 23 Nov 2012 03:37:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=vveyvvaZetouo1r349Ug2aObMB1tH4VlVLks0WLYj3M=;
	b=zIriqwq2Iu8caZhYuToo6a4+q+Wpk4VTM+norgMaImJurotkHEJG4ISAfwD7vvnJMu
	rh5NkiyUSZ/gpaXtOqxF6hSzuUCibNqX9VxHoMzy6a0/d/sdxdBQSMjlR2veks3L5NoX
	Npb11EOHoQauVSv2krQMSIRmUvvV2lUrBMRDbouSDrt2KZZwa/Cw3OJ6cUHkaCqpQgH4
	Faaa7mEzAGd/q8j6ByyFlspSEiazLjz6l5bQWRd6acs1Ju342kT3ql3hOuSoD0e0Xx0T
	mCY953+LtW91r9nRgGhX7ZFyAmXxq91FQZ76L0+ZF5dI+lI3dXPl55GvGuEEbi/thFcp
	jXJg==
MIME-Version: 1.0
Received: by 10.220.156.143 with SMTP id x15mr5430161vcw.50.1353670652024;
	Fri, 23 Nov 2012 03:37:32 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Fri, 23 Nov 2012 03:37:31 -0800 (PST)
In-Reply-To: <1353665146.13542.194.camel@zakaz.uk.xensource.com>
References: <a4f707f6049a4a8152d2.1353518970@elijah>
	<1353665146.13542.194.camel@zakaz.uk.xensource.com>
Date: Fri, 23 Nov 2012 11:37:31 +0000
X-Google-Sender-Auth: vAO0kJcWYIv1k6rZAdlvBde-DeM
Message-ID: <CAFLBxZbiQ+Rkpt5bVz8ZOBthi+CAMOSmUaZdJ_vxzwC_FPQ1OQ@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Fix bug in libxl_cdrom_insert,
 make more robust against bad xenstore data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6944172448961055512=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6944172448961055512==
Content-Type: multipart/alternative; boundary=f46d04388ed35b57ed04cf280283

--f46d04388ed35b57ed04cf280283
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Nov 23, 2012 at 10:05 AM, Ian Campbell <Ian.Campbell@citrix.com>wrote:

>
> > * Handling non-existent nodes in the backend xenstore entries more
> > gracefully
>
> I wonder if it should error out here rather than assume a default -- the
> nodes in question should have been written by libxl itself (I think, I
> don't think these are backend provided keys) so if they are missing
> something has gone pretty wrong in the library, I think it's worth at
> least a log message and more than likely an error return.
>

I would have returned an error, but the fuction returns void.  :-)  That
leaves us the options of:
1. Erroring and calling exit() in the middle of the function
2. Just doing a warning
3. Modifying the function to return success / failure

#3 seems like the it shouldn't be too very difficult.  If that sounds good
to you I'll re-post this patch with only the bits you've acked, then post
another patch with #3.

 -George



>
> > Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
> >
> > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> > --- a/tools/libxl/libxl.c
> > +++ b/tools/libxl/libxl.c
> > @@ -2201,14 +2201,14 @@ static void libxl__device_disk_from_xs_b
> >          disk->removable = 0;
> >
> >      tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/mode",
> be_path));
> > -    if (!strcmp(tmp, "w"))
> > +    if (tmp && !strcmp(tmp, "w"))
> >          disk->readwrite = 1;
> >      else
> >          disk->readwrite = 0;
> >
> >      tmp = libxl__xs_read(gc, XBT_NULL,
> >                           libxl__sprintf(gc, "%s/device-type", be_path));
> > -    disk->is_cdrom = !strcmp(tmp, "cdrom");
> > +    disk->is_cdrom = tmp && !strcmp(tmp, "cdrom");
> >
> >      disk->format = LIBXL_DISK_FORMAT_UNKNOWN;
> >  }
> > @@ -2353,6 +2353,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
> >
> >      libxl__device device;
> >      const char * path;
> > +    char * tmp;
> >
> >      flexarray_t *insert = NULL;
> >
> > @@ -2383,8 +2384,11 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
> >      disks = libxl_device_disk_list(ctx, domid, &num);
> >      for (i = 0; i < num; i++) {
> >          if (disks[i].is_cdrom && !strcmp(disk->vdev, disks[i].vdev))
> > -            /* found */
> > +        {
> > +            /* Found.  Set backend type appropriately. */
> > +            disk->backend=disks[i].backend;
> >              break;
> > +        }
> >      }
> >      if (i == num) {
> >          LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Virtual device not found");
> > @@ -2410,6 +2414,17 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
> >
> >      path = libxl__device_backend_path(gc, &device);
> >
> > +    /* Sanity check: make sure the backend exists before writing here */
> > +    tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc,
> "%s/frontend", path));
> > +    if (!tmp)
> > +    {
> > +        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Internal error: %s does not
> exist",
> > +            libxl__sprintf(gc, "%s/frontend", path));
> > +        rc = ERROR_FAIL;
> > +        goto out;
> > +    }
> > +
> > +
> >      insert = flexarray_make(gc, 4, 1);
> >
> >      flexarray_append_pair(insert, "type",
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>

--f46d04388ed35b57ed04cf280283
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 23, 2012 at 10:05 AM, Ian Campbell <span dir=3D"ltr">&lt;<a hre=
f=3D"mailto:Ian.Campbell@citrix.com" target=3D"_blank">Ian.Campbell@citrix.=
com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail=
_quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><br><div class=3D"im">
&gt; * Handling non-existent nodes in the backend xenstore entries more<br>
&gt; gracefully<br>
<br>
</div>I wonder if it should error out here rather than assume a default -- =
the<br>
nodes in question should have been written by libxl itself (I think, I<br>
don&#39;t think these are backend provided keys) so if they are missing<br>
something has gone pretty wrong in the library, I think it&#39;s worth at<b=
r>
least a log message and more than likely an error return.<br></blockquote><=
div><br>I would have returned an error, but the fuction returns void.=A0 :-=
)=A0 That leaves us the options of:<br>1. Erroring and calling exit() in th=
e middle of the function<br>
2. Just doing a warning<br>3. Modifying the function to return success / fa=
ilure<br><br>#3 seems like the it shouldn&#39;t be too very difficult.=A0 I=
f that sounds good to you I&#39;ll re-post this patch with only the bits yo=
u&#39;ve acked, then post another patch with #3.<br>
<br>=A0-George<br><br>=A0</div><blockquote class=3D"gmail_quote" style=3D"m=
argin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class=3D"HOEnZb"><div class=3D"h5"><br>
&gt; Signed-off-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.ci=
trix.com">george.dunlap@eu.citrix.com</a>&gt;<br>
&gt;<br>
&gt; diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c<br>
&gt; --- a/tools/libxl/libxl.c<br>
&gt; +++ b/tools/libxl/libxl.c<br>
&gt; @@ -2201,14 +2201,14 @@ static void libxl__device_disk_from_xs_b<br>
&gt; =A0 =A0 =A0 =A0 =A0disk-&gt;removable =3D 0;<br>
&gt;<br>
&gt; =A0 =A0 =A0tmp =3D libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, &qu=
ot;%s/mode&quot;, be_path));<br>
&gt; - =A0 =A0if (!strcmp(tmp, &quot;w&quot;))<br>
&gt; + =A0 =A0if (tmp &amp;&amp; !strcmp(tmp, &quot;w&quot;))<br>
&gt; =A0 =A0 =A0 =A0 =A0disk-&gt;readwrite =3D 1;<br>
&gt; =A0 =A0 =A0else<br>
&gt; =A0 =A0 =A0 =A0 =A0disk-&gt;readwrite =3D 0;<br>
&gt;<br>
&gt; =A0 =A0 =A0tmp =3D libxl__xs_read(gc, XBT_NULL,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 libxl__sprintf(gc,=
 &quot;%s/device-type&quot;, be_path));<br>
&gt; - =A0 =A0disk-&gt;is_cdrom =3D !strcmp(tmp, &quot;cdrom&quot;);<br>
&gt; + =A0 =A0disk-&gt;is_cdrom =3D tmp &amp;&amp; !strcmp(tmp, &quot;cdrom=
&quot;);<br>
&gt;<br>
&gt; =A0 =A0 =A0disk-&gt;format =3D LIBXL_DISK_FORMAT_UNKNOWN;<br>
&gt; =A0}<br>
&gt; @@ -2353,6 +2353,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u<br>
&gt;<br>
&gt; =A0 =A0 =A0libxl__device device;<br>
&gt; =A0 =A0 =A0const char * path;<br>
&gt; + =A0 =A0char * tmp;<br>
&gt;<br>
&gt; =A0 =A0 =A0flexarray_t *insert =3D NULL;<br>
&gt;<br>
&gt; @@ -2383,8 +2384,11 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u<br>
&gt; =A0 =A0 =A0disks =3D libxl_device_disk_list(ctx, domid, &amp;num);<br>
&gt; =A0 =A0 =A0for (i =3D 0; i &lt; num; i++) {<br>
&gt; =A0 =A0 =A0 =A0 =A0if (disks[i].is_cdrom &amp;&amp; !strcmp(disk-&gt;v=
dev, disks[i].vdev))<br>
&gt; - =A0 =A0 =A0 =A0 =A0 =A0/* found */<br>
&gt; + =A0 =A0 =A0 =A0{<br>
&gt; + =A0 =A0 =A0 =A0 =A0 =A0/* Found. =A0Set backend type appropriately. =
*/<br>
&gt; + =A0 =A0 =A0 =A0 =A0 =A0disk-&gt;backend=3Ddisks[i].backend;<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0break;<br>
&gt; + =A0 =A0 =A0 =A0}<br>
&gt; =A0 =A0 =A0}<br>
&gt; =A0 =A0 =A0if (i =3D=3D num) {<br>
&gt; =A0 =A0 =A0 =A0 =A0LIBXL__LOG(ctx, LIBXL__LOG_ERROR, &quot;Virtual dev=
ice not found&quot;);<br>
&gt; @@ -2410,6 +2414,17 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u<br>
&gt;<br>
&gt; =A0 =A0 =A0path =3D libxl__device_backend_path(gc, &amp;device);<br>
&gt;<br>
&gt; + =A0 =A0/* Sanity check: make sure the backend exists before writing =
here */<br>
&gt; + =A0 =A0tmp =3D libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, &quot=
;%s/frontend&quot;, path));<br>
&gt; + =A0 =A0if (!tmp)<br>
&gt; + =A0 =A0{<br>
&gt; + =A0 =A0 =A0 =A0LIBXL__LOG(ctx, LIBXL__LOG_ERROR, &quot;Internal erro=
r: %s does not exist&quot;,<br>
&gt; + =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf(gc, &quot;%s/frontend&quot;, p=
ath));<br>
&gt; + =A0 =A0 =A0 =A0rc =3D ERROR_FAIL;<br>
&gt; + =A0 =A0 =A0 =A0goto out;<br>
&gt; + =A0 =A0}<br>
&gt; +<br>
&gt; +<br>
&gt; =A0 =A0 =A0insert =3D flexarray_make(gc, 4, 1);<br>
&gt;<br>
&gt; =A0 =A0 =A0flexarray_append_pair(insert, &quot;type&quot;,<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Xen-devel mailing list<br>
&gt; <a href=3D"mailto:Xen-devel@lists.xen.org">Xen-devel@lists.xen.org</a>=
<br>
&gt; <a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://li=
sts.xen.org/xen-devel</a><br>
<br>
<br>
<br>
_______________________________________________<br>
Xen-devel mailing list<br>
<a href=3D"mailto:Xen-devel@lists.xen.org">Xen-devel@lists.xen.org</a><br>
<a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://lists.x=
en.org/xen-devel</a><br>
</div></div></blockquote></div><br></div>

--f46d04388ed35b57ed04cf280283--


--===============6944172448961055512==
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.xen.org
http://lists.xen.org/xen-devel

--===============6944172448961055512==--


From xen-devel-bounces@lists.xen.org Fri Nov 23 11:37:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:37:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbrZh-0008Vj-H7; Fri, 23 Nov 2012 11:37:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TbrZg-0008Vd-Hd
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 11:37:36 +0000
Received: from [85.158.143.99:29188] by server-3.bemta-4.messagelabs.com id
	78/B5-06841-FFF5FA05; Fri, 23 Nov 2012 11:37:35 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1353670652!21059486!1
X-Originating-IP: [209.85.220.171]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17426 invoked from network); 23 Nov 2012 11:37:33 -0000
Received: from mail-vc0-f171.google.com (HELO mail-vc0-f171.google.com)
	(209.85.220.171)
	by server-10.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 11:37:33 -0000
Received: by mail-vc0-f171.google.com with SMTP id fo14so7579550vcb.30
	for <xen-devel@lists.xensource.com>;
	Fri, 23 Nov 2012 03:37:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=vveyvvaZetouo1r349Ug2aObMB1tH4VlVLks0WLYj3M=;
	b=zIriqwq2Iu8caZhYuToo6a4+q+Wpk4VTM+norgMaImJurotkHEJG4ISAfwD7vvnJMu
	rh5NkiyUSZ/gpaXtOqxF6hSzuUCibNqX9VxHoMzy6a0/d/sdxdBQSMjlR2veks3L5NoX
	Npb11EOHoQauVSv2krQMSIRmUvvV2lUrBMRDbouSDrt2KZZwa/Cw3OJ6cUHkaCqpQgH4
	Faaa7mEzAGd/q8j6ByyFlspSEiazLjz6l5bQWRd6acs1Ju342kT3ql3hOuSoD0e0Xx0T
	mCY953+LtW91r9nRgGhX7ZFyAmXxq91FQZ76L0+ZF5dI+lI3dXPl55GvGuEEbi/thFcp
	jXJg==
MIME-Version: 1.0
Received: by 10.220.156.143 with SMTP id x15mr5430161vcw.50.1353670652024;
	Fri, 23 Nov 2012 03:37:32 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Fri, 23 Nov 2012 03:37:31 -0800 (PST)
In-Reply-To: <1353665146.13542.194.camel@zakaz.uk.xensource.com>
References: <a4f707f6049a4a8152d2.1353518970@elijah>
	<1353665146.13542.194.camel@zakaz.uk.xensource.com>
Date: Fri, 23 Nov 2012 11:37:31 +0000
X-Google-Sender-Auth: vAO0kJcWYIv1k6rZAdlvBde-DeM
Message-ID: <CAFLBxZbiQ+Rkpt5bVz8ZOBthi+CAMOSmUaZdJ_vxzwC_FPQ1OQ@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Fix bug in libxl_cdrom_insert,
 make more robust against bad xenstore data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6944172448961055512=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6944172448961055512==
Content-Type: multipart/alternative; boundary=f46d04388ed35b57ed04cf280283

--f46d04388ed35b57ed04cf280283
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Nov 23, 2012 at 10:05 AM, Ian Campbell <Ian.Campbell@citrix.com>wrote:

>
> > * Handling non-existent nodes in the backend xenstore entries more
> > gracefully
>
> I wonder if it should error out here rather than assume a default -- the
> nodes in question should have been written by libxl itself (I think, I
> don't think these are backend provided keys) so if they are missing
> something has gone pretty wrong in the library, I think it's worth at
> least a log message and more than likely an error return.
>

I would have returned an error, but the fuction returns void.  :-)  That
leaves us the options of:
1. Erroring and calling exit() in the middle of the function
2. Just doing a warning
3. Modifying the function to return success / failure

#3 seems like the it shouldn't be too very difficult.  If that sounds good
to you I'll re-post this patch with only the bits you've acked, then post
another patch with #3.

 -George



>
> > Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
> >
> > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> > --- a/tools/libxl/libxl.c
> > +++ b/tools/libxl/libxl.c
> > @@ -2201,14 +2201,14 @@ static void libxl__device_disk_from_xs_b
> >          disk->removable = 0;
> >
> >      tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/mode",
> be_path));
> > -    if (!strcmp(tmp, "w"))
> > +    if (tmp && !strcmp(tmp, "w"))
> >          disk->readwrite = 1;
> >      else
> >          disk->readwrite = 0;
> >
> >      tmp = libxl__xs_read(gc, XBT_NULL,
> >                           libxl__sprintf(gc, "%s/device-type", be_path));
> > -    disk->is_cdrom = !strcmp(tmp, "cdrom");
> > +    disk->is_cdrom = tmp && !strcmp(tmp, "cdrom");
> >
> >      disk->format = LIBXL_DISK_FORMAT_UNKNOWN;
> >  }
> > @@ -2353,6 +2353,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
> >
> >      libxl__device device;
> >      const char * path;
> > +    char * tmp;
> >
> >      flexarray_t *insert = NULL;
> >
> > @@ -2383,8 +2384,11 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
> >      disks = libxl_device_disk_list(ctx, domid, &num);
> >      for (i = 0; i < num; i++) {
> >          if (disks[i].is_cdrom && !strcmp(disk->vdev, disks[i].vdev))
> > -            /* found */
> > +        {
> > +            /* Found.  Set backend type appropriately. */
> > +            disk->backend=disks[i].backend;
> >              break;
> > +        }
> >      }
> >      if (i == num) {
> >          LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Virtual device not found");
> > @@ -2410,6 +2414,17 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
> >
> >      path = libxl__device_backend_path(gc, &device);
> >
> > +    /* Sanity check: make sure the backend exists before writing here */
> > +    tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc,
> "%s/frontend", path));
> > +    if (!tmp)
> > +    {
> > +        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Internal error: %s does not
> exist",
> > +            libxl__sprintf(gc, "%s/frontend", path));
> > +        rc = ERROR_FAIL;
> > +        goto out;
> > +    }
> > +
> > +
> >      insert = flexarray_make(gc, 4, 1);
> >
> >      flexarray_append_pair(insert, "type",
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>

--f46d04388ed35b57ed04cf280283
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 23, 2012 at 10:05 AM, Ian Campbell <span dir=3D"ltr">&lt;<a hre=
f=3D"mailto:Ian.Campbell@citrix.com" target=3D"_blank">Ian.Campbell@citrix.=
com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail=
_quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><br><div class=3D"im">
&gt; * Handling non-existent nodes in the backend xenstore entries more<br>
&gt; gracefully<br>
<br>
</div>I wonder if it should error out here rather than assume a default -- =
the<br>
nodes in question should have been written by libxl itself (I think, I<br>
don&#39;t think these are backend provided keys) so if they are missing<br>
something has gone pretty wrong in the library, I think it&#39;s worth at<b=
r>
least a log message and more than likely an error return.<br></blockquote><=
div><br>I would have returned an error, but the fuction returns void.=A0 :-=
)=A0 That leaves us the options of:<br>1. Erroring and calling exit() in th=
e middle of the function<br>
2. Just doing a warning<br>3. Modifying the function to return success / fa=
ilure<br><br>#3 seems like the it shouldn&#39;t be too very difficult.=A0 I=
f that sounds good to you I&#39;ll re-post this patch with only the bits yo=
u&#39;ve acked, then post another patch with #3.<br>
<br>=A0-George<br><br>=A0</div><blockquote class=3D"gmail_quote" style=3D"m=
argin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class=3D"HOEnZb"><div class=3D"h5"><br>
&gt; Signed-off-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.ci=
trix.com">george.dunlap@eu.citrix.com</a>&gt;<br>
&gt;<br>
&gt; diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c<br>
&gt; --- a/tools/libxl/libxl.c<br>
&gt; +++ b/tools/libxl/libxl.c<br>
&gt; @@ -2201,14 +2201,14 @@ static void libxl__device_disk_from_xs_b<br>
&gt; =A0 =A0 =A0 =A0 =A0disk-&gt;removable =3D 0;<br>
&gt;<br>
&gt; =A0 =A0 =A0tmp =3D libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, &qu=
ot;%s/mode&quot;, be_path));<br>
&gt; - =A0 =A0if (!strcmp(tmp, &quot;w&quot;))<br>
&gt; + =A0 =A0if (tmp &amp;&amp; !strcmp(tmp, &quot;w&quot;))<br>
&gt; =A0 =A0 =A0 =A0 =A0disk-&gt;readwrite =3D 1;<br>
&gt; =A0 =A0 =A0else<br>
&gt; =A0 =A0 =A0 =A0 =A0disk-&gt;readwrite =3D 0;<br>
&gt;<br>
&gt; =A0 =A0 =A0tmp =3D libxl__xs_read(gc, XBT_NULL,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 libxl__sprintf(gc,=
 &quot;%s/device-type&quot;, be_path));<br>
&gt; - =A0 =A0disk-&gt;is_cdrom =3D !strcmp(tmp, &quot;cdrom&quot;);<br>
&gt; + =A0 =A0disk-&gt;is_cdrom =3D tmp &amp;&amp; !strcmp(tmp, &quot;cdrom=
&quot;);<br>
&gt;<br>
&gt; =A0 =A0 =A0disk-&gt;format =3D LIBXL_DISK_FORMAT_UNKNOWN;<br>
&gt; =A0}<br>
&gt; @@ -2353,6 +2353,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u<br>
&gt;<br>
&gt; =A0 =A0 =A0libxl__device device;<br>
&gt; =A0 =A0 =A0const char * path;<br>
&gt; + =A0 =A0char * tmp;<br>
&gt;<br>
&gt; =A0 =A0 =A0flexarray_t *insert =3D NULL;<br>
&gt;<br>
&gt; @@ -2383,8 +2384,11 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u<br>
&gt; =A0 =A0 =A0disks =3D libxl_device_disk_list(ctx, domid, &amp;num);<br>
&gt; =A0 =A0 =A0for (i =3D 0; i &lt; num; i++) {<br>
&gt; =A0 =A0 =A0 =A0 =A0if (disks[i].is_cdrom &amp;&amp; !strcmp(disk-&gt;v=
dev, disks[i].vdev))<br>
&gt; - =A0 =A0 =A0 =A0 =A0 =A0/* found */<br>
&gt; + =A0 =A0 =A0 =A0{<br>
&gt; + =A0 =A0 =A0 =A0 =A0 =A0/* Found. =A0Set backend type appropriately. =
*/<br>
&gt; + =A0 =A0 =A0 =A0 =A0 =A0disk-&gt;backend=3Ddisks[i].backend;<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0break;<br>
&gt; + =A0 =A0 =A0 =A0}<br>
&gt; =A0 =A0 =A0}<br>
&gt; =A0 =A0 =A0if (i =3D=3D num) {<br>
&gt; =A0 =A0 =A0 =A0 =A0LIBXL__LOG(ctx, LIBXL__LOG_ERROR, &quot;Virtual dev=
ice not found&quot;);<br>
&gt; @@ -2410,6 +2414,17 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u<br>
&gt;<br>
&gt; =A0 =A0 =A0path =3D libxl__device_backend_path(gc, &amp;device);<br>
&gt;<br>
&gt; + =A0 =A0/* Sanity check: make sure the backend exists before writing =
here */<br>
&gt; + =A0 =A0tmp =3D libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, &quot=
;%s/frontend&quot;, path));<br>
&gt; + =A0 =A0if (!tmp)<br>
&gt; + =A0 =A0{<br>
&gt; + =A0 =A0 =A0 =A0LIBXL__LOG(ctx, LIBXL__LOG_ERROR, &quot;Internal erro=
r: %s does not exist&quot;,<br>
&gt; + =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf(gc, &quot;%s/frontend&quot;, p=
ath));<br>
&gt; + =A0 =A0 =A0 =A0rc =3D ERROR_FAIL;<br>
&gt; + =A0 =A0 =A0 =A0goto out;<br>
&gt; + =A0 =A0}<br>
&gt; +<br>
&gt; +<br>
&gt; =A0 =A0 =A0insert =3D flexarray_make(gc, 4, 1);<br>
&gt;<br>
&gt; =A0 =A0 =A0flexarray_append_pair(insert, &quot;type&quot;,<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Xen-devel mailing list<br>
&gt; <a href=3D"mailto:Xen-devel@lists.xen.org">Xen-devel@lists.xen.org</a>=
<br>
&gt; <a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://li=
sts.xen.org/xen-devel</a><br>
<br>
<br>
<br>
_______________________________________________<br>
Xen-devel mailing list<br>
<a href=3D"mailto:Xen-devel@lists.xen.org">Xen-devel@lists.xen.org</a><br>
<a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://lists.x=
en.org/xen-devel</a><br>
</div></div></blockquote></div><br></div>

--f46d04388ed35b57ed04cf280283--


--===============6944172448961055512==
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.xen.org
http://lists.xen.org/xen-devel

--===============6944172448961055512==--


From xen-devel-bounces@lists.xen.org Fri Nov 23 11:38:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:38:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbraT-000089-Vs; Fri, 23 Nov 2012 11:38:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <chosi@amd.co.at>) id 1TbraS-00007t-LR
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 11:38:24 +0000
Received: from [85.158.139.83:53167] by server-8.bemta-5.messagelabs.com id
	FE/60-06050-F206FA05; Fri, 23 Nov 2012 11:38:23 +0000
X-Env-Sender: chosi@amd.co.at
X-Msg-Ref: server-3.tower-182.messagelabs.com!1353670702!31601069!1
X-Originating-IP: [134.109.228.40]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22596 invoked from network); 23 Nov 2012 11:38:22 -0000
Received: from cora.hrz.tu-chemnitz.de (HELO cora.hrz.tu-chemnitz.de)
	(134.109.228.40)
	by server-3.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 11:38:22 -0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=tu-chemnitz.de; s=dkim2010; 
	h=Content-Transfer-Encoding:Content-Type:Subject:To:MIME-Version:From:Date:Message-ID;
	bh=mur69eGTCj9Rxbh8syF23gTuedHqHBqv+99NTugbnpQ=; 
	b=zNDBqEiY66vsc2NWDtYCoYjLdpyw1zelfpD1R7BaBJAUXRyQrHsuuBqHoMMdItBB2eWwu0FGdpW65HK2Z2TusXd/IUhADV38VKwvrrB+PSFwhpChcc2fDDOb5RBHCEOLoDAWcgzOTisSAOO0NdmJHysRMKb+0qp+NXjcJNM5L0o=;
Received: from 023-096-109-134.csn.tu-chemnitz.de ([134.109.96.23]
	helo=[192.168.1.3]) by cora.hrz.tu-chemnitz.de with esmtpsa
	(TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80.1)
	(envelope-from <chosi@amd.co.at>) id 1TbraQ-00075j-Co
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 12:38:22 +0100
Message-ID: <50AF6035.8020704@amd.co.at>
Date: Fri, 23 Nov 2012 12:38:29 +0100
From: Alexander Bienzeisler <chosi@amd.co.at>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel@lists.xen.org
X-purgate: clean
X-purgate-type: clean
X-purgate-ID: 154106::1353670702-00000CD1-6B267C07/0-0/0-0
X-Scan-AV: cora.hrz.tu-chemnitz.de; 2012-11-23 12:38:22;
	f61e3f69dff2997001413043eaf53a56
X-Scan-SA: cora.hrz.tu-chemnitz.de; 2012-11-23 12:38:22;
	cbdcacb57727f765df11e05e0a60178c
X-Spam-Score: -1.0 (-)
X-Spam-Report: --- Textanalyse SpamAssassin 3.3.1 (-1.0 Punkte)
	Fragen an/questions to: Postmaster TU Chemnitz
	<postmaster@tu-chemnitz.de>
	* -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
	*  0.0 TVD_RCVD_IP TVD_RCVD_IP --- Ende Textanalyse
Subject: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

i just tried to add a domU with 16 gigs of ram (maxmem = 16384, memory = 
16384) with free_memory : 28969 but got an error:

libxl: error: libxl.c:3433:libxl_set_memory_target: new target 0 for 
dom0 is below the minimum threshold

I was able to create it with 8 gigs of ram, ending up with free_memory : 
20776

Is there something wrong with memory in 4.2? I can't seem to use all of it.

Cheers,
Alex

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:38:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:38:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbraT-000089-Vs; Fri, 23 Nov 2012 11:38:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <chosi@amd.co.at>) id 1TbraS-00007t-LR
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 11:38:24 +0000
Received: from [85.158.139.83:53167] by server-8.bemta-5.messagelabs.com id
	FE/60-06050-F206FA05; Fri, 23 Nov 2012 11:38:23 +0000
X-Env-Sender: chosi@amd.co.at
X-Msg-Ref: server-3.tower-182.messagelabs.com!1353670702!31601069!1
X-Originating-IP: [134.109.228.40]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22596 invoked from network); 23 Nov 2012 11:38:22 -0000
Received: from cora.hrz.tu-chemnitz.de (HELO cora.hrz.tu-chemnitz.de)
	(134.109.228.40)
	by server-3.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 11:38:22 -0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=tu-chemnitz.de; s=dkim2010; 
	h=Content-Transfer-Encoding:Content-Type:Subject:To:MIME-Version:From:Date:Message-ID;
	bh=mur69eGTCj9Rxbh8syF23gTuedHqHBqv+99NTugbnpQ=; 
	b=zNDBqEiY66vsc2NWDtYCoYjLdpyw1zelfpD1R7BaBJAUXRyQrHsuuBqHoMMdItBB2eWwu0FGdpW65HK2Z2TusXd/IUhADV38VKwvrrB+PSFwhpChcc2fDDOb5RBHCEOLoDAWcgzOTisSAOO0NdmJHysRMKb+0qp+NXjcJNM5L0o=;
Received: from 023-096-109-134.csn.tu-chemnitz.de ([134.109.96.23]
	helo=[192.168.1.3]) by cora.hrz.tu-chemnitz.de with esmtpsa
	(TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80.1)
	(envelope-from <chosi@amd.co.at>) id 1TbraQ-00075j-Co
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 12:38:22 +0100
Message-ID: <50AF6035.8020704@amd.co.at>
Date: Fri, 23 Nov 2012 12:38:29 +0100
From: Alexander Bienzeisler <chosi@amd.co.at>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: xen-devel@lists.xen.org
X-purgate: clean
X-purgate-type: clean
X-purgate-ID: 154106::1353670702-00000CD1-6B267C07/0-0/0-0
X-Scan-AV: cora.hrz.tu-chemnitz.de; 2012-11-23 12:38:22;
	f61e3f69dff2997001413043eaf53a56
X-Scan-SA: cora.hrz.tu-chemnitz.de; 2012-11-23 12:38:22;
	cbdcacb57727f765df11e05e0a60178c
X-Spam-Score: -1.0 (-)
X-Spam-Report: --- Textanalyse SpamAssassin 3.3.1 (-1.0 Punkte)
	Fragen an/questions to: Postmaster TU Chemnitz
	<postmaster@tu-chemnitz.de>
	* -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
	*  0.0 TVD_RCVD_IP TVD_RCVD_IP --- Ende Textanalyse
Subject: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

i just tried to add a domU with 16 gigs of ram (maxmem = 16384, memory = 
16384) with free_memory : 28969 but got an error:

libxl: error: libxl.c:3433:libxl_set_memory_target: new target 0 for 
dom0 is below the minimum threshold

I was able to create it with 8 gigs of ram, ending up with free_memory : 
20776

Is there something wrong with memory in 4.2? I can't seem to use all of it.

Cheers,
Alex

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:49:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:49:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbrks-0000bO-4v; Fri, 23 Nov 2012 11:49:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbrkp-0000bJ-Ve
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 11:49:08 +0000
Received: from [85.158.139.211:28616] by server-13.bemta-5.messagelabs.com id
	0C/4D-27809-3B26FA05; Fri, 23 Nov 2012 11:49:07 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1353671346!21320172!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16235 invoked from network); 23 Nov 2012 11:49:06 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 11:49:06 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15971779"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 11:48:47 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 11:48:46 +0000
Message-ID: <1353671325.13542.232.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Date: Fri, 23 Nov 2012 11:48:45 +0000
In-Reply-To: <CAFLBxZbiQ+Rkpt5bVz8ZOBthi+CAMOSmUaZdJ_vxzwC_FPQ1OQ@mail.gmail.com>
References: <a4f707f6049a4a8152d2.1353518970@elijah>
	<1353665146.13542.194.camel@zakaz.uk.xensource.com>
	<CAFLBxZbiQ+Rkpt5bVz8ZOBthi+CAMOSmUaZdJ_vxzwC_FPQ1OQ@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Fix bug in libxl_cdrom_insert,
 make more robust against bad xenstore data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 11:37 +0000, George Dunlap wrote:

> I would have returned an error, but the fuction returns void.  :-)
> That leaves us the options of:
> 1. Erroring and calling exit() in the middle of the function
> 2. Just doing a warning
> 3. Modifying the function to return success / failure
> 
> #3 seems like the it shouldn't be too very difficult.

Yes, it looks like both the callers should manage to do something sane
pretty easily.

>   If that sounds good to you I'll re-post this patch with only the
> bits you've acked, then post another patch with #3.

Sounds good.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:49:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:49:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbrks-0000bO-4v; Fri, 23 Nov 2012 11:49:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbrkp-0000bJ-Ve
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 11:49:08 +0000
Received: from [85.158.139.211:28616] by server-13.bemta-5.messagelabs.com id
	0C/4D-27809-3B26FA05; Fri, 23 Nov 2012 11:49:07 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1353671346!21320172!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16235 invoked from network); 23 Nov 2012 11:49:06 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 11:49:06 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15971779"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 11:48:47 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 11:48:46 +0000
Message-ID: <1353671325.13542.232.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Date: Fri, 23 Nov 2012 11:48:45 +0000
In-Reply-To: <CAFLBxZbiQ+Rkpt5bVz8ZOBthi+CAMOSmUaZdJ_vxzwC_FPQ1OQ@mail.gmail.com>
References: <a4f707f6049a4a8152d2.1353518970@elijah>
	<1353665146.13542.194.camel@zakaz.uk.xensource.com>
	<CAFLBxZbiQ+Rkpt5bVz8ZOBthi+CAMOSmUaZdJ_vxzwC_FPQ1OQ@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Fix bug in libxl_cdrom_insert,
 make more robust against bad xenstore data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 11:37 +0000, George Dunlap wrote:

> I would have returned an error, but the fuction returns void.  :-)
> That leaves us the options of:
> 1. Erroring and calling exit() in the middle of the function
> 2. Just doing a warning
> 3. Modifying the function to return success / failure
> 
> #3 seems like the it shouldn't be too very difficult.

Yes, it looks like both the callers should manage to do something sane
pretty easily.

>   If that sounds good to you I'll re-post this patch with only the
> bits you've acked, then post another patch with #3.

Sounds good.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:53:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:53:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbrod-0000uU-W4; Fri, 23 Nov 2012 11:53:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1Tbroc-0000uN-Ng
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 11:53:02 +0000
Received: from [85.158.137.99:28339] by server-16.bemta-3.messagelabs.com id
	53/AE-07461-9936FA05; Fri, 23 Nov 2012 11:52:57 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-12.tower-217.messagelabs.com!1353671576!17175416!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA0OTkwMTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25740 invoked from network); 23 Nov 2012 11:52:56 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 11:52:56 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id DFA4D13F1;
	Fri, 23 Nov 2012 13:52:54 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 90A77EC027; Fri, 23 Nov 2012 13:52:54 +0200 (EET)
Date: Fri, 23 Nov 2012 13:52:54 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Alexander Bienzeisler <chosi@amd.co.at>
Message-ID: <20121123115254.GU8912@reaktio.net>
References: <50AF5F7E.8030907@amd.co.at>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50AF5F7E.8030907@amd.co.at>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, 2012 at 12:35:26PM +0100, Alexander Bienzeisler wrote:
> Hello,
> 
> i just tried to add a domU with 16 gigs of ram (maxmem = 16384,
> memory = 16384) with free_memory : 28969 but got an error:
> 
> libxl: error: libxl.c:3433:libxl_set_memory_target: new target 0 for
> dom0 is below the minimum threshold
> 
> I was able to create it with 8 gigs of ram, ending up with
> free_memory : 20776
> 
> Is there something wrong with memory in 4.2? I can't seem to use all of it.
> 

What exact Xen version are you using? what dom0 kernel version? 

Also please pastebin "xl info" and "xl list" before and after starting the VM.

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 11:53:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 11:53:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbrod-0000uU-W4; Fri, 23 Nov 2012 11:53:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1Tbroc-0000uN-Ng
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 11:53:02 +0000
Received: from [85.158.137.99:28339] by server-16.bemta-3.messagelabs.com id
	53/AE-07461-9936FA05; Fri, 23 Nov 2012 11:52:57 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-12.tower-217.messagelabs.com!1353671576!17175416!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA0OTkwMTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25740 invoked from network); 23 Nov 2012 11:52:56 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 11:52:56 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id DFA4D13F1;
	Fri, 23 Nov 2012 13:52:54 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 90A77EC027; Fri, 23 Nov 2012 13:52:54 +0200 (EET)
Date: Fri, 23 Nov 2012 13:52:54 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Alexander Bienzeisler <chosi@amd.co.at>
Message-ID: <20121123115254.GU8912@reaktio.net>
References: <50AF5F7E.8030907@amd.co.at>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50AF5F7E.8030907@amd.co.at>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, 2012 at 12:35:26PM +0100, Alexander Bienzeisler wrote:
> Hello,
> 
> i just tried to add a domU with 16 gigs of ram (maxmem = 16384,
> memory = 16384) with free_memory : 28969 but got an error:
> 
> libxl: error: libxl.c:3433:libxl_set_memory_target: new target 0 for
> dom0 is below the minimum threshold
> 
> I was able to create it with 8 gigs of ram, ending up with
> free_memory : 20776
> 
> Is there something wrong with memory in 4.2? I can't seem to use all of it.
> 

What exact Xen version are you using? what dom0 kernel version? 

Also please pastebin "xl info" and "xl list" before and after starting the VM.

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 12:06:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 12:06:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbs1a-0001T4-C5; Fri, 23 Nov 2012 12:06:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <chosi@amd.co.at>) id 1Tbs1Y-0001Sz-Dw
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:06:24 +0000
Received: from [193.109.254.147:25430] by server-6.bemta-14.messagelabs.com id
	37/C2-02788-FB66FA05; Fri, 23 Nov 2012 12:06:23 +0000
X-Env-Sender: chosi@amd.co.at
X-Msg-Ref: server-16.tower-27.messagelabs.com!1353672380!10807253!1
X-Originating-IP: [134.109.228.40]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2359 invoked from network); 23 Nov 2012 12:06:21 -0000
Received: from cora.hrz.tu-chemnitz.de (HELO cora.hrz.tu-chemnitz.de)
	(134.109.228.40)
	by server-16.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 12:06:21 -0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=tu-chemnitz.de; s=dkim2010; 
	h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID;
	bh=zHgh+3ZvGp20ly6hmpUV+rzSzQlxg99bmjKTeektkqQ=; 
	b=OW94WAbQNZ90dK/0cTfeYaX3EV5q3ZZYZFCaOJIf3F11luYhoHn9RiwtI7BEsqiUNX4/EpBaE9H2IzAFpsak89vWMCHH3nG6Coke5T9rk/5mVUEHXmWfRHtfsKlIxbkNoCZWi5zZfRNcXtONyMJeTV/efUh0ECL1gZVyFDnMxq0=;
Received: from 023-096-109-134.csn.tu-chemnitz.de ([134.109.96.23]
	helo=[192.168.1.3]) by cora.hrz.tu-chemnitz.de with esmtpsa
	(TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80.1)
	(envelope-from <chosi@amd.co.at>)
	id 1Tbs1T-00028E-PQ; Fri, 23 Nov 2012 13:06:20 +0100
Message-ID: <50AF66C2.6020402@amd.co.at>
Date: Fri, 23 Nov 2012 13:06:26 +0100
From: Alexander Bienzeisler <chosi@amd.co.at>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: =?ISO-8859-1?Q?Pasi_K=E4rkk=E4inen?= <pasik@iki.fi>
References: <50AF5F7E.8030907@amd.co.at> <20121123115254.GU8912@reaktio.net>
In-Reply-To: <20121123115254.GU8912@reaktio.net>
X-purgate: clean
X-purgate-type: clean
X-purgate-ID: 154106::1353672379-00000CD1-001C6016/0-0/0-0
X-Scan-AV: cora.hrz.tu-chemnitz.de; 2012-11-23 13:06:19;
	92aa12bc3eead3ef58ad25dc3552414d
X-Scan-SA: cora.hrz.tu-chemnitz.de; 2012-11-23 13:06:20;
	c8a9e0a3bd6c40b0dd27a8a3462e06ca
X-Spam-Score: -1.0 (-)
X-Spam-Report: --- Textanalyse SpamAssassin 3.3.1 (-1.0 Punkte)
	Fragen an/questions to: Postmaster TU Chemnitz
	<postmaster@tu-chemnitz.de>
	* -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
	*  0.0 TVD_RCVD_IP TVD_RCVD_IP
	*  0.0 T_FILL_THIS_FORM_SHORT Fill in a short form with personal
	*      information --- Ende Textanalyse
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I am currently using Xen 4.2.1-pre built from git source. Kernel version =

3.1.1

xl info before:

host                   : susi-0
release                : 3.1.1-xen
version                : #1 SMP Fri Nov 18 10:16:22 CET 2011
machine                : x86_64
nr_cpus                : 24
max_cpu_id             : 31
nr_nodes               : 2
cores_per_socket       : 6
threads_per_core       : 2
cpu_mhz                : 3325
hw_caps                : =

bfebfbff:2c100800:00000000:00003f40:029ee3ff:00000000:00000001:00000000
virt_caps              : hvm hvm_directio
total_memory           : 98291
free_memory            : 28969
sharing_freed_memory   : 0
sharing_used_memory    : 0
free_cpus              : 0
xen_major              : 4
xen_minor              : 2
xen_extra              : .1-pre
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 =

hvm-3.0-x86_32p hvm-3.0-x86_64
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=3D0xffff800000000000
xen_changeset          : Wed Nov 14 11:46:07 2012 +0000 25922:8ca6372315f8
xen_commandline        : placeholder loglvl=3Dall dom0_mem=3D2048M =

dom0_max_vcpus=3D2 dom0_vcpus_pin com2=3D115200 console=3Dcom2,vga
cc_compiler            : gcc (Debian 4.4.5-8) 4.4.5
cc_compile_by          : root
cc_compile_domain      : wsk.tu-chemnitz.de
cc_compile_date        : Thu Nov 22 13:50:09 CET 2012
xend_config_format     : 4

xl list before:

Name                                        ID   Mem VCPUs State   Time(s)
Domain-0                                     0  2048     2 r-----    3490.0
Squeeze                                     19  4091     2 -b----     370.3
win2k8_2_susi6                              31 16373    12 -b----    1619.3
win2k8_susi5                                33 32757    12 -b----    1264.0
win7_susi3                                  43  4085     4 -b----     416.0
scientific_susi7                            44  8192    16 -b----      39.9

domU config:

name =3D "centos_susi8"
uuid =3D "2e87b315-fd5a-dfbc-fe9d-6e121fdfa632"
maxmem =3D 16384
memory =3D 16384
vcpus =3D 16
builder =3D "generic"
bootloader =3D "pygrub"
on_poweroff =3D "destroy"
on_reboot =3D "restart"
on_crash =3D "restart"
vfb =3D [ "type=3Dvnc,vncunused=3D1,keymap=3Dde" ]
disk =3D [ "phy:/dev/mapper/storage-SL5,xvda,w" ]
vif =3D [ "mac=3D00:50:56:37:61:17,bridge=3Dxenbr0" ]

error message after:

xl create /root/configs/centos_susi8.cfg
Parsing config from /root/configs/centos_susi8.cfg
libxl: error: libxl.c:3433:libxl_set_memory_target: new target 0 for =

dom0 is below the minimum threshold


with 8gigs:

xl info after:

host                   : susi-0
release                : 3.1.1-xen
version                : #1 SMP Fri Nov 18 10:16:22 CET 2011
machine                : x86_64
nr_cpus                : 24
max_cpu_id             : 31
nr_nodes               : 2
cores_per_socket       : 6
threads_per_core       : 2
cpu_mhz                : 3325
hw_caps                : =

bfebfbff:2c100800:00000000:00003f40:029ee3ff:00000000:00000001:00000000
virt_caps              : hvm hvm_directio
total_memory           : 98291
free_memory            : 20776
sharing_freed_memory   : 0
sharing_used_memory    : 0
free_cpus              : 0
xen_major              : 4
xen_minor              : 2
xen_extra              : .1-pre
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 =

hvm-3.0-x86_32p hvm-3.0-x86_64
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=3D0xffff800000000000
xen_changeset          : Wed Nov 14 11:46:07 2012 +0000 25922:8ca6372315f8
xen_commandline        : placeholder loglvl=3Dall dom0_mem=3D2048M =

dom0_max_vcpus=3D2 dom0_vcpus_pin com2=3D115200 console=3Dcom2,vga
cc_compiler            : gcc (Debian 4.4.5-8) 4.4.5
cc_compile_by          : root
cc_compile_domain      : wsk.tu-chemnitz.de
cc_compile_date        : Thu Nov 22 13:50:09 CET 2012
xend_config_format     : 4

xl list after:

Name                                        ID   Mem VCPUs State   Time(s)
Domain-0                                     0  2048     2 r-----    3550.0
Squeeze                                     19  4091     2 -b----     381.5
win2k8_2_susi6                              31 16373    12 -b----    1627.1
win2k8_susi5                                33 32757    12 ------    1269.0
win7_susi3                                  43  4085     4 -b----     418.7
scientific_susi7                            44  8192    16 -b----      40.3
centos_susi8                                46  8192    16 -b----       4.4




Am 23.11.2012 12:52, schrieb Pasi K=E4rkk=E4inen:
> On Fri, Nov 23, 2012 at 12:35:26PM +0100, Alexander Bienzeisler wrote:
>> Hello,
>>
>> i just tried to add a domU with 16 gigs of ram (maxmem =3D 16384,
>> memory =3D 16384) with free_memory : 28969 but got an error:
>>
>> libxl: error: libxl.c:3433:libxl_set_memory_target: new target 0 for
>> dom0 is below the minimum threshold
>>
>> I was able to create it with 8 gigs of ram, ending up with
>> free_memory : 20776
>>
>> Is there something wrong with memory in 4.2? I can't seem to use all of =
it.
>>
> What exact Xen version are you using? what dom0 kernel version?
>
> Also please pastebin "xl info" and "xl list" before and after starting th=
e VM.
>
> -- Pasi
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 12:06:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 12:06:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbs1a-0001T4-C5; Fri, 23 Nov 2012 12:06:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <chosi@amd.co.at>) id 1Tbs1Y-0001Sz-Dw
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:06:24 +0000
Received: from [193.109.254.147:25430] by server-6.bemta-14.messagelabs.com id
	37/C2-02788-FB66FA05; Fri, 23 Nov 2012 12:06:23 +0000
X-Env-Sender: chosi@amd.co.at
X-Msg-Ref: server-16.tower-27.messagelabs.com!1353672380!10807253!1
X-Originating-IP: [134.109.228.40]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2359 invoked from network); 23 Nov 2012 12:06:21 -0000
Received: from cora.hrz.tu-chemnitz.de (HELO cora.hrz.tu-chemnitz.de)
	(134.109.228.40)
	by server-16.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 12:06:21 -0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=tu-chemnitz.de; s=dkim2010; 
	h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID;
	bh=zHgh+3ZvGp20ly6hmpUV+rzSzQlxg99bmjKTeektkqQ=; 
	b=OW94WAbQNZ90dK/0cTfeYaX3EV5q3ZZYZFCaOJIf3F11luYhoHn9RiwtI7BEsqiUNX4/EpBaE9H2IzAFpsak89vWMCHH3nG6Coke5T9rk/5mVUEHXmWfRHtfsKlIxbkNoCZWi5zZfRNcXtONyMJeTV/efUh0ECL1gZVyFDnMxq0=;
Received: from 023-096-109-134.csn.tu-chemnitz.de ([134.109.96.23]
	helo=[192.168.1.3]) by cora.hrz.tu-chemnitz.de with esmtpsa
	(TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80.1)
	(envelope-from <chosi@amd.co.at>)
	id 1Tbs1T-00028E-PQ; Fri, 23 Nov 2012 13:06:20 +0100
Message-ID: <50AF66C2.6020402@amd.co.at>
Date: Fri, 23 Nov 2012 13:06:26 +0100
From: Alexander Bienzeisler <chosi@amd.co.at>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: =?ISO-8859-1?Q?Pasi_K=E4rkk=E4inen?= <pasik@iki.fi>
References: <50AF5F7E.8030907@amd.co.at> <20121123115254.GU8912@reaktio.net>
In-Reply-To: <20121123115254.GU8912@reaktio.net>
X-purgate: clean
X-purgate-type: clean
X-purgate-ID: 154106::1353672379-00000CD1-001C6016/0-0/0-0
X-Scan-AV: cora.hrz.tu-chemnitz.de; 2012-11-23 13:06:19;
	92aa12bc3eead3ef58ad25dc3552414d
X-Scan-SA: cora.hrz.tu-chemnitz.de; 2012-11-23 13:06:20;
	c8a9e0a3bd6c40b0dd27a8a3462e06ca
X-Spam-Score: -1.0 (-)
X-Spam-Report: --- Textanalyse SpamAssassin 3.3.1 (-1.0 Punkte)
	Fragen an/questions to: Postmaster TU Chemnitz
	<postmaster@tu-chemnitz.de>
	* -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
	*  0.0 TVD_RCVD_IP TVD_RCVD_IP
	*  0.0 T_FILL_THIS_FORM_SHORT Fill in a short form with personal
	*      information --- Ende Textanalyse
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I am currently using Xen 4.2.1-pre built from git source. Kernel version =

3.1.1

xl info before:

host                   : susi-0
release                : 3.1.1-xen
version                : #1 SMP Fri Nov 18 10:16:22 CET 2011
machine                : x86_64
nr_cpus                : 24
max_cpu_id             : 31
nr_nodes               : 2
cores_per_socket       : 6
threads_per_core       : 2
cpu_mhz                : 3325
hw_caps                : =

bfebfbff:2c100800:00000000:00003f40:029ee3ff:00000000:00000001:00000000
virt_caps              : hvm hvm_directio
total_memory           : 98291
free_memory            : 28969
sharing_freed_memory   : 0
sharing_used_memory    : 0
free_cpus              : 0
xen_major              : 4
xen_minor              : 2
xen_extra              : .1-pre
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 =

hvm-3.0-x86_32p hvm-3.0-x86_64
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=3D0xffff800000000000
xen_changeset          : Wed Nov 14 11:46:07 2012 +0000 25922:8ca6372315f8
xen_commandline        : placeholder loglvl=3Dall dom0_mem=3D2048M =

dom0_max_vcpus=3D2 dom0_vcpus_pin com2=3D115200 console=3Dcom2,vga
cc_compiler            : gcc (Debian 4.4.5-8) 4.4.5
cc_compile_by          : root
cc_compile_domain      : wsk.tu-chemnitz.de
cc_compile_date        : Thu Nov 22 13:50:09 CET 2012
xend_config_format     : 4

xl list before:

Name                                        ID   Mem VCPUs State   Time(s)
Domain-0                                     0  2048     2 r-----    3490.0
Squeeze                                     19  4091     2 -b----     370.3
win2k8_2_susi6                              31 16373    12 -b----    1619.3
win2k8_susi5                                33 32757    12 -b----    1264.0
win7_susi3                                  43  4085     4 -b----     416.0
scientific_susi7                            44  8192    16 -b----      39.9

domU config:

name =3D "centos_susi8"
uuid =3D "2e87b315-fd5a-dfbc-fe9d-6e121fdfa632"
maxmem =3D 16384
memory =3D 16384
vcpus =3D 16
builder =3D "generic"
bootloader =3D "pygrub"
on_poweroff =3D "destroy"
on_reboot =3D "restart"
on_crash =3D "restart"
vfb =3D [ "type=3Dvnc,vncunused=3D1,keymap=3Dde" ]
disk =3D [ "phy:/dev/mapper/storage-SL5,xvda,w" ]
vif =3D [ "mac=3D00:50:56:37:61:17,bridge=3Dxenbr0" ]

error message after:

xl create /root/configs/centos_susi8.cfg
Parsing config from /root/configs/centos_susi8.cfg
libxl: error: libxl.c:3433:libxl_set_memory_target: new target 0 for =

dom0 is below the minimum threshold


with 8gigs:

xl info after:

host                   : susi-0
release                : 3.1.1-xen
version                : #1 SMP Fri Nov 18 10:16:22 CET 2011
machine                : x86_64
nr_cpus                : 24
max_cpu_id             : 31
nr_nodes               : 2
cores_per_socket       : 6
threads_per_core       : 2
cpu_mhz                : 3325
hw_caps                : =

bfebfbff:2c100800:00000000:00003f40:029ee3ff:00000000:00000001:00000000
virt_caps              : hvm hvm_directio
total_memory           : 98291
free_memory            : 20776
sharing_freed_memory   : 0
sharing_used_memory    : 0
free_cpus              : 0
xen_major              : 4
xen_minor              : 2
xen_extra              : .1-pre
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 =

hvm-3.0-x86_32p hvm-3.0-x86_64
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=3D0xffff800000000000
xen_changeset          : Wed Nov 14 11:46:07 2012 +0000 25922:8ca6372315f8
xen_commandline        : placeholder loglvl=3Dall dom0_mem=3D2048M =

dom0_max_vcpus=3D2 dom0_vcpus_pin com2=3D115200 console=3Dcom2,vga
cc_compiler            : gcc (Debian 4.4.5-8) 4.4.5
cc_compile_by          : root
cc_compile_domain      : wsk.tu-chemnitz.de
cc_compile_date        : Thu Nov 22 13:50:09 CET 2012
xend_config_format     : 4

xl list after:

Name                                        ID   Mem VCPUs State   Time(s)
Domain-0                                     0  2048     2 r-----    3550.0
Squeeze                                     19  4091     2 -b----     381.5
win2k8_2_susi6                              31 16373    12 -b----    1627.1
win2k8_susi5                                33 32757    12 ------    1269.0
win7_susi3                                  43  4085     4 -b----     418.7
scientific_susi7                            44  8192    16 -b----      40.3
centos_susi8                                46  8192    16 -b----       4.4




Am 23.11.2012 12:52, schrieb Pasi K=E4rkk=E4inen:
> On Fri, Nov 23, 2012 at 12:35:26PM +0100, Alexander Bienzeisler wrote:
>> Hello,
>>
>> i just tried to add a domU with 16 gigs of ram (maxmem =3D 16384,
>> memory =3D 16384) with free_memory : 28969 but got an error:
>>
>> libxl: error: libxl.c:3433:libxl_set_memory_target: new target 0 for
>> dom0 is below the minimum threshold
>>
>> I was able to create it with 8 gigs of ram, ending up with
>> free_memory : 20776
>>
>> Is there something wrong with memory in 4.2? I can't seem to use all of =
it.
>>
> What exact Xen version are you using? what dom0 kernel version?
>
> Also please pastebin "xl info" and "xl list" before and after starting th=
e VM.
>
> -- Pasi
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 12:21:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 12:21:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbsGG-00022G-8C; Fri, 23 Nov 2012 12:21:36 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbsGE-00022A-Vp
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:21:35 +0000
Received: from [193.109.254.147:65099] by server-10.bemta-14.messagelabs.com
	id BD/65-31741-E4A6FA05; Fri, 23 Nov 2012 12:21:34 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1353673293!8699257!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21207 invoked from network); 23 Nov 2012 12:21:33 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-13.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 12:21:33 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15972748"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 12:21:33 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 12:21:33 +0000
Message-ID: <1353673292.13542.238.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Alexander Bienzeisler <chosi@amd.co.at>
Date: Fri, 23 Nov 2012 12:21:32 +0000
In-Reply-To: <50AF5F7E.8030907@amd.co.at>
References: <50AF5F7E.8030907@amd.co.at>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This question belongs on xen-users.

On Fri, 2012-11-23 at 11:35 +0000, Alexander Bienzeisler wrote:
> Hello,
> 
> i just tried to add a domU with 16 gigs of ram (maxmem = 16384, memory = 
> 16384) with free_memory : 28969 but got an error:
> 
> libxl: error: libxl.c:3433:libxl_set_memory_target: new target 0 for 
> dom0 is below the minimum threshold

The clue is in this message -- you cannot safely balloon down a guest
(including dom0) to an arbitrarily small value relative to its initial
size. The kernel will have certain fixed datastructures etc which are
sized according to the maximum amount of RAM at start of day.

If you were to balloon down too low then you would run out of RAM and
the OOM killer would step in and start killing stuff, so xl includes a
safety catch which prevents this.

If you have a huge host and want a small dom0 use the dom0_mem option
and disable xl's autoballoon option or whatever the equivalent xend
option is.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 12:21:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 12:21:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbsGG-00022G-8C; Fri, 23 Nov 2012 12:21:36 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbsGE-00022A-Vp
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:21:35 +0000
Received: from [193.109.254.147:65099] by server-10.bemta-14.messagelabs.com
	id BD/65-31741-E4A6FA05; Fri, 23 Nov 2012 12:21:34 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1353673293!8699257!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21207 invoked from network); 23 Nov 2012 12:21:33 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-13.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 12:21:33 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15972748"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 12:21:33 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 12:21:33 +0000
Message-ID: <1353673292.13542.238.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Alexander Bienzeisler <chosi@amd.co.at>
Date: Fri, 23 Nov 2012 12:21:32 +0000
In-Reply-To: <50AF5F7E.8030907@amd.co.at>
References: <50AF5F7E.8030907@amd.co.at>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This question belongs on xen-users.

On Fri, 2012-11-23 at 11:35 +0000, Alexander Bienzeisler wrote:
> Hello,
> 
> i just tried to add a domU with 16 gigs of ram (maxmem = 16384, memory = 
> 16384) with free_memory : 28969 but got an error:
> 
> libxl: error: libxl.c:3433:libxl_set_memory_target: new target 0 for 
> dom0 is below the minimum threshold

The clue is in this message -- you cannot safely balloon down a guest
(including dom0) to an arbitrarily small value relative to its initial
size. The kernel will have certain fixed datastructures etc which are
sized according to the maximum amount of RAM at start of day.

If you were to balloon down too low then you would run out of RAM and
the OOM killer would step in and start killing stuff, so xl includes a
safety catch which prevents this.

If you have a huge host and want a small dom0 use the dom0_mem option
and disable xl's autoballoon option or whatever the equivalent xend
option is.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 12:28:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 12:28:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbsMX-0002Ci-2m; Fri, 23 Nov 2012 12:28:05 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TbsMV-0002Ca-Oj
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:28:03 +0000
Received: from [85.158.143.35:28084] by server-2.bemta-4.messagelabs.com id
	7B/00-28922-3DB6FA05; Fri, 23 Nov 2012 12:28:03 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-14.tower-21.messagelabs.com!1353673681!15987357!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA0OTkwMTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29200 invoked from network); 23 Nov 2012 12:28:02 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 12:28:02 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 7B7971D31;
	Fri, 23 Nov 2012 14:28:00 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 55346EC027; Fri, 23 Nov 2012 14:28:00 +0200 (EET)
Date: Fri, 23 Nov 2012 14:28:00 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121123122800.GV8912@reaktio.net>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353673292.13542.238.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Alexander Bienzeisler <chosi@amd.co.at>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, 2012 at 12:21:32PM +0000, Ian Campbell wrote:
> This question belongs on xen-users.
> 
> On Fri, 2012-11-23 at 11:35 +0000, Alexander Bienzeisler wrote:
> > Hello,
> > 
> > i just tried to add a domU with 16 gigs of ram (maxmem = 16384, memory = 
> > 16384) with free_memory : 28969 but got an error:
> > 
> > libxl: error: libxl.c:3433:libxl_set_memory_target: new target 0 for 
> > dom0 is below the minimum threshold
> 
> The clue is in this message -- you cannot safely balloon down a guest
> (including dom0) to an arbitrarily small value relative to its initial
> size. The kernel will have certain fixed datastructures etc which are
> sized according to the maximum amount of RAM at start of day.
> 
> If you were to balloon down too low then you would run out of RAM and
> the OOM killer would step in and start killing stuff, so xl includes a
> safety catch which prevents this.
> 
> If you have a huge host and want a small dom0 use the dom0_mem option
> and disable xl's autoballoon option or whatever the equivalent xend
> option is.
> 

I think he was already using dom0_mem. He had 28969 free in Xen as reported by "xl info".

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 12:28:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 12:28:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbsMX-0002Ci-2m; Fri, 23 Nov 2012 12:28:05 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TbsMV-0002Ca-Oj
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:28:03 +0000
Received: from [85.158.143.35:28084] by server-2.bemta-4.messagelabs.com id
	7B/00-28922-3DB6FA05; Fri, 23 Nov 2012 12:28:03 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-14.tower-21.messagelabs.com!1353673681!15987357!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA0OTkwMTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29200 invoked from network); 23 Nov 2012 12:28:02 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 12:28:02 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 7B7971D31;
	Fri, 23 Nov 2012 14:28:00 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 55346EC027; Fri, 23 Nov 2012 14:28:00 +0200 (EET)
Date: Fri, 23 Nov 2012 14:28:00 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121123122800.GV8912@reaktio.net>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353673292.13542.238.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Alexander Bienzeisler <chosi@amd.co.at>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, 2012 at 12:21:32PM +0000, Ian Campbell wrote:
> This question belongs on xen-users.
> 
> On Fri, 2012-11-23 at 11:35 +0000, Alexander Bienzeisler wrote:
> > Hello,
> > 
> > i just tried to add a domU with 16 gigs of ram (maxmem = 16384, memory = 
> > 16384) with free_memory : 28969 but got an error:
> > 
> > libxl: error: libxl.c:3433:libxl_set_memory_target: new target 0 for 
> > dom0 is below the minimum threshold
> 
> The clue is in this message -- you cannot safely balloon down a guest
> (including dom0) to an arbitrarily small value relative to its initial
> size. The kernel will have certain fixed datastructures etc which are
> sized according to the maximum amount of RAM at start of day.
> 
> If you were to balloon down too low then you would run out of RAM and
> the OOM killer would step in and start killing stuff, so xl includes a
> safety catch which prevents this.
> 
> If you have a huge host and want a small dom0 use the dom0_mem option
> and disable xl's autoballoon option or whatever the equivalent xend
> option is.
> 

I think he was already using dom0_mem. He had 28969 free in Xen as reported by "xl info".

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 12:34:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 12:34:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbsSl-0002an-2S; Fri, 23 Nov 2012 12:34:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbsSj-0002ag-7I
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:34:29 +0000
Received: from [85.158.143.99:14224] by server-3.bemta-4.messagelabs.com id
	C1/FD-06841-45D6FA05; Fri, 23 Nov 2012 12:34:28 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1353674068!25793702!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29615 invoked from network); 23 Nov 2012 12:34:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 12:34:28 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15973039"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 12:34:00 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 12:34:00 +0000
Message-ID: <1353674039.16973.3.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Pasi =?ISO-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
Date: Fri, 23 Nov 2012 12:33:59 +0000
In-Reply-To: <20121123122800.GV8912@reaktio.net>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Alexander Bienzeisler <chosi@amd.co.at>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gRnJpLCAyMDEyLTExLTIzIGF0IDEyOjI4ICswMDAwLCBQYXNpIEvDpHJra8OkaW5lbiB3cm90
ZToKPiBPbiBGcmksIE5vdiAyMywgMjAxMiBhdCAxMjoyMTozMlBNICswMDAwLCBJYW4gQ2FtcGJl
bGwgd3JvdGU6Cj4gPiBUaGlzIHF1ZXN0aW9uIGJlbG9uZ3Mgb24geGVuLXVzZXJzLgo+ID4gCj4g
PiBPbiBGcmksIDIwMTItMTEtMjMgYXQgMTE6MzUgKzAwMDAsIEFsZXhhbm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jYXRjaCB3aGljaCBwcmV2ZW50cyB0aGlzLgo+ID4gCj4gPiBJZiB5b3UgaGF2ZSBh
IGh1Z2UgaG9zdCBhbmQgd2FudCBhIHNtYWxsIGRvbTAgdXNlIHRoZSBkb20wX21lbSBvcHRpb24K
PiA+IGFuZCBkaXNhYmxlIHhsJ3MgYXV0b2JhbGxvb24gb3B0aW9uIG9yIHdoYXRldmVyIHRoZSBl
cXVpdmFsZW50IHhlbmQKPiA+IG9wdGlvbiBpcy4KPiA+IAo+IAo+IEkgdGhpbmsgaGUgd2FzIGFs
cmVhZHkgdXNpbmcgZG9tMF9tZW0uIEhlIGhhZCAyODk2OSBmcmVlIGluIFhlbiBhcwo+IHJlcG9y
dGVkIGJ5ICJ4bCBpbmZvIi4KClRoZW4gaGUncyBtaXNzZWQgZGlzYWJsaW5nIGF1dG9iYWxsb29u
LgoKPiAKPiAtLSBQYXNpCj4gCgoKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxpc3RzLnhlbi5v
cmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Fri Nov 23 12:34:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 12:34:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbsSl-0002an-2S; Fri, 23 Nov 2012 12:34:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbsSj-0002ag-7I
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:34:29 +0000
Received: from [85.158.143.99:14224] by server-3.bemta-4.messagelabs.com id
	C1/FD-06841-45D6FA05; Fri, 23 Nov 2012 12:34:28 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1353674068!25793702!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29615 invoked from network); 23 Nov 2012 12:34:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 12:34:28 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15973039"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 12:34:00 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 12:34:00 +0000
Message-ID: <1353674039.16973.3.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Pasi =?ISO-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
Date: Fri, 23 Nov 2012 12:33:59 +0000
In-Reply-To: <20121123122800.GV8912@reaktio.net>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Alexander Bienzeisler <chosi@amd.co.at>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gRnJpLCAyMDEyLTExLTIzIGF0IDEyOjI4ICswMDAwLCBQYXNpIEvDpHJra8OkaW5lbiB3cm90
ZToKPiBPbiBGcmksIE5vdiAyMywgMjAxMiBhdCAxMjoyMTozMlBNICswMDAwLCBJYW4gQ2FtcGJl
bGwgd3JvdGU6Cj4gPiBUaGlzIHF1ZXN0aW9uIGJlbG9uZ3Mgb24geGVuLXVzZXJzLgo+ID4gCj4g
PiBPbiBGcmksIDIwMTItMTEtMjMgYXQgMTE6MzUgKzAwMDAsIEFsZXhhbmRlciBCaWVuemVpc2xl
ciB3cm90ZToKPiA+ID4gSGVsbG8sCj4gPiA+IAo+ID4gPiBpIGp1c3QgdHJpZWQgdG8gYWRkIGEg
ZG9tVSB3aXRoIDE2IGdpZ3Mgb2YgcmFtIChtYXhtZW0gPSAxNjM4NCwgbWVtb3J5ID0gCj4gPiA+
IDE2Mzg0KSB3aXRoIGZyZWVfbWVtb3J5IDogMjg5NjkgYnV0IGdvdCBhbiBlcnJvcjoKPiA+ID4g
Cj4gPiA+IGxpYnhsOiBlcnJvcjogbGlieGwuYzozNDMzOmxpYnhsX3NldF9tZW1vcnlfdGFyZ2V0
OiBuZXcgdGFyZ2V0IDAgZm9yIAo+ID4gPiBkb20wIGlzIGJlbG93IHRoZSBtaW5pbXVtIHRocmVz
aG9sZAo+ID4gCj4gPiBUaGUgY2x1ZSBpcyBpbiB0aGlzIG1lc3NhZ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AtLSBQYXNpCj4gCgoKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxpc3RzLnhlbi5v
cmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Fri Nov 23 12:43:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 12:43:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbsbT-0002v4-3R; Fri, 23 Nov 2012 12:43:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TbsbR-0002uz-Ub
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:43:30 +0000
Received: from [85.158.143.35:40627] by server-3.bemta-4.messagelabs.com id
	64/0B-06841-17F6FA05; Fri, 23 Nov 2012 12:43:29 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-8.tower-21.messagelabs.com!1353674477!12503392!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA0OTkwMTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18087 invoked from network); 23 Nov 2012 12:41:18 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-8.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 12:41:18 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id A834913E4;
	Fri, 23 Nov 2012 14:41:15 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 7AB67EC027; Fri, 23 Nov 2012 14:41:15 +0200 (EET)
Date: Fri, 23 Nov 2012 14:41:15 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121123124115.GW8912@reaktio.net>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353674039.16973.3.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Alexander Bienzeisler <chosi@amd.co.at>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, 2012 at 12:33:59PM +0000, Ian Campbell wrote:
> On Fri, 2012-11-23 at 12:28 +0000, Pasi K=E4rkk=E4inen wrote:
> > On Fri, Nov 23, 2012 at 12:21:32PM +0000, Ian Campbell wrote:
> > > This question belongs on xen-users.
> > > =

> > > On Fri, 2012-11-23 at 11:35 +0000, Alexander Bienzeisler wrote:
> > > > Hello,
> > > > =

> > > > i just tried to add a domU with 16 gigs of ram (maxmem =3D 16384, m=
emory =3D =

> > > > 16384) with free_memory : 28969 but got an error:
> > > > =

> > > > libxl: error: libxl.c:3433:libxl_set_memory_target: new target 0 fo=
r =

> > > > dom0 is below the minimum threshold
> > > =

> > > The clue is in this message -- you cannot safely balloon down a guest
> > > (including dom0) to an arbitrarily small value relative to its initial
> > > size. The kernel will have certain fixed datastructures etc which are
> > > sized according to the maximum amount of RAM at start of day.
> > > =

> > > If you were to balloon down too low then you would run out of RAM and
> > > the OOM killer would step in and start killing stuff, so xl includes a
> > > safety catch which prevents this.
> > > =

> > > If you have a huge host and want a small dom0 use the dom0_mem option
> > > and disable xl's autoballoon option or whatever the equivalent xend
> > > option is.
> > > =

> > =

> > I think he was already using dom0_mem. He had 28969 free in Xen as
> > reported by "xl info".
> =

> Then he's missed disabling autoballoon.
> =


As can be seen from the other email in this thread,
he's using dom0_mem=3D2048M, and he has 28GB of free memory in Xen.

Why is xl trying to balloon down dom0 (and failing) for no reason? =


-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 12:43:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 12:43:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbsbT-0002v4-3R; Fri, 23 Nov 2012 12:43:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TbsbR-0002uz-Ub
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:43:30 +0000
Received: from [85.158.143.35:40627] by server-3.bemta-4.messagelabs.com id
	64/0B-06841-17F6FA05; Fri, 23 Nov 2012 12:43:29 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-8.tower-21.messagelabs.com!1353674477!12503392!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA0OTkwMTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18087 invoked from network); 23 Nov 2012 12:41:18 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-8.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 12:41:18 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id A834913E4;
	Fri, 23 Nov 2012 14:41:15 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 7AB67EC027; Fri, 23 Nov 2012 14:41:15 +0200 (EET)
Date: Fri, 23 Nov 2012 14:41:15 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121123124115.GW8912@reaktio.net>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353674039.16973.3.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Alexander Bienzeisler <chosi@amd.co.at>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, 2012 at 12:33:59PM +0000, Ian Campbell wrote:
> On Fri, 2012-11-23 at 12:28 +0000, Pasi K=E4rkk=E4inen wrote:
> > On Fri, Nov 23, 2012 at 12:21:32PM +0000, Ian Campbell wrote:
> > > This question belongs on xen-users.
> > > =

> > > On Fri, 2012-11-23 at 11:35 +0000, Alexander Bienzeisler wrote:
> > > > Hello,
> > > > =

> > > > i just tried to add a domU with 16 gigs of ram (maxmem =3D 16384, m=
emory =3D =

> > > > 16384) with free_memory : 28969 but got an error:
> > > > =

> > > > libxl: error: libxl.c:3433:libxl_set_memory_target: new target 0 fo=
r =

> > > > dom0 is below the minimum threshold
> > > =

> > > The clue is in this message -- you cannot safely balloon down a guest
> > > (including dom0) to an arbitrarily small value relative to its initial
> > > size. The kernel will have certain fixed datastructures etc which are
> > > sized according to the maximum amount of RAM at start of day.
> > > =

> > > If you were to balloon down too low then you would run out of RAM and
> > > the OOM killer would step in and start killing stuff, so xl includes a
> > > safety catch which prevents this.
> > > =

> > > If you have a huge host and want a small dom0 use the dom0_mem option
> > > and disable xl's autoballoon option or whatever the equivalent xend
> > > option is.
> > > =

> > =

> > I think he was already using dom0_mem. He had 28969 free in Xen as
> > reported by "xl info".
> =

> Then he's missed disabling autoballoon.
> =


As can be seen from the other email in this thread,
he's using dom0_mem=3D2048M, and he has 28GB of free memory in Xen.

Why is xl trying to balloon down dom0 (and failing) for no reason? =


-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 12:46:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 12:46:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbse5-00030l-M9; Fri, 23 Nov 2012 12:46:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <chosi@amd.co.at>) id 1Tbse4-00030e-Lw
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:46:12 +0000
Received: from [85.158.138.51:59296] by server-16.bemta-3.messagelabs.com id
	B8/B0-07461-3107FA05; Fri, 23 Nov 2012 12:46:11 +0000
X-Env-Sender: chosi@amd.co.at
X-Msg-Ref: server-4.tower-174.messagelabs.com!1353674771!31189164!1
X-Originating-IP: [134.109.228.40]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24939 invoked from network); 23 Nov 2012 12:46:11 -0000
Received: from cora.hrz.tu-chemnitz.de (HELO cora.hrz.tu-chemnitz.de)
	(134.109.228.40)
	by server-4.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 12:46:11 -0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=tu-chemnitz.de; s=dkim2010; 
	h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID;
	bh=gITWXuYR/1eYLR9reNVHCcpDdraJQjKgS5mz8eCBvos=; 
	b=cJBaJZrp1MKpzbUHY/eS5NPAXbzDgFkX8SPFoU1bNKLQETb0TKorMOLFQ2ylZ9lQNpL0kUoLniwijC6ToIVjjjYujdXxt15FwQCYRIwF0QoqfcwU3uB+EotcZIzkCZLc2qicaUqE2hXe24YndQYrmViHGm9mZ+mHLVG324uKK7w=;
Received: from 023-096-109-134.csn.tu-chemnitz.de ([134.109.96.23]
	helo=[192.168.1.3]) by cora.hrz.tu-chemnitz.de with esmtpsa
	(TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80.1)
	(envelope-from <chosi@amd.co.at>)
	id 1Tbse1-0006Ic-KX; Fri, 23 Nov 2012 13:46:09 +0100
Message-ID: <50AF7018.2030401@amd.co.at>
Date: Fri, 23 Nov 2012 13:46:16 +0100
From: Alexander Bienzeisler <chosi@amd.co.at>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353674039.16973.3.camel@zakaz.uk.xensource.com>
X-purgate: clean
X-purgate-type: clean
X-purgate-ID: 154106::1353674769-00000CD1-4C7E25F2/0-0/0-0
X-Scan-AV: cora.hrz.tu-chemnitz.de; 2012-11-23 13:46:09;
	f7c46fe705f18cfcd96f674267528ab1
X-Scan-SA: cora.hrz.tu-chemnitz.de; 2012-11-23 13:46:09;
	35f1b013eb3fddbd30def06e1ea90a70
X-Spam-Score: -1.0 (-)
X-Spam-Report: --- Textanalyse SpamAssassin 3.3.1 (-1.0 Punkte)
	Fragen an/questions to: Postmaster TU Chemnitz
	<postmaster@tu-chemnitz.de>
	* -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
	*  0.0 TVD_RCVD_IP TVD_RCVD_IP --- Ende Textanalyse
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

QXMgSWFuIHNhaWQsIGkgZGlkIG5vdCBkaXNhYmxlIGF1dG9iYWxsb29uaW5nLiBJdCB3b3JrcyB3
aXRoIAphdXRvYmFsbG9vbmluZz0wLgoKVGhhbmtzIGV2ZXJ5b25lIGFuZCBzb3JyeSBmb3Igd2Fz
dGluZyB5b3VyIHRpbWUuCgpBbSAyMy4xMS4yMDEyIDEzOjMzLCBzY2hyaWViIElhbiBDYW1wYmVs
bDoKPiBPbiBGcmksIDIwMTItMTEtMjMgYXQgMTI6MjggKzAwMDAsIFBhc2kgS8Okcmtrw6RpbmVu
IHdyb3RlOgo+PiBPbiBGcmksIE5vdiAyMywgMjAxMiBhdCAxMjoyMTozMlBNICswMDAwLCBJYW4g
Q2FtcGJlbGwgd3JvdGU6Cj4+PiBUaGlzIHF1ZXN0aW9uIGJlbG9uZ3Mgb24geGVuLXVzZXJzLgo+
Pj4KPj4+IE9uIEZyaSwgMjAxMi0xMS0yMyBhdCAxMTozNSArMDAwMCwgQWxleGFuZGVyIEJpZW56
ZWlzbGVyIHdyb3RlOgo+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gaHVnZSBob3N0IGFu
ZCB3YW50IGEgc21hbGwgZG9tMCB1c2UgdGhlIGRvbTBfbWVtIG9wdGlvbgo+Pj4gYW5kIGRpc2Fi
bGUgeGwncyBhdXRvYmFsbG9vbiBvcHRpb24gb3Igd2hhdGV2ZXIgdGhlIGVxdWl2YWxlbnQgeGVu
ZAo+Pj4gb3B0aW9uIGlzLgo+Pj4KPj4gSSB0aGluayBoZSB3YXMgYWxyZWFkeSB1c2luZyBkb20w
X21lbS4gSGUgaGFkIDI4OTY5IGZyZWUgaW4gWGVuIGFzCj4+IHJlcG9ydGVkIGJ5ICJ4bCBpbmZv
Ii4KPiBUaGVuIGhlJ3MgbWlzc2VkIGRpc2FibGluZyBhdXRvYmFsbG9vbi4KPgo+PiAtLSBQYXNp
Cj4+Cj4KCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpY
ZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0
cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Fri Nov 23 12:46:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 12:46:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbse5-00030l-M9; Fri, 23 Nov 2012 12:46:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <chosi@amd.co.at>) id 1Tbse4-00030e-Lw
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:46:12 +0000
Received: from [85.158.138.51:59296] by server-16.bemta-3.messagelabs.com id
	B8/B0-07461-3107FA05; Fri, 23 Nov 2012 12:46:11 +0000
X-Env-Sender: chosi@amd.co.at
X-Msg-Ref: server-4.tower-174.messagelabs.com!1353674771!31189164!1
X-Originating-IP: [134.109.228.40]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24939 invoked from network); 23 Nov 2012 12:46:11 -0000
Received: from cora.hrz.tu-chemnitz.de (HELO cora.hrz.tu-chemnitz.de)
	(134.109.228.40)
	by server-4.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 12:46:11 -0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=tu-chemnitz.de; s=dkim2010; 
	h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID;
	bh=gITWXuYR/1eYLR9reNVHCcpDdraJQjKgS5mz8eCBvos=; 
	b=cJBaJZrp1MKpzbUHY/eS5NPAXbzDgFkX8SPFoU1bNKLQETb0TKorMOLFQ2ylZ9lQNpL0kUoLniwijC6ToIVjjjYujdXxt15FwQCYRIwF0QoqfcwU3uB+EotcZIzkCZLc2qicaUqE2hXe24YndQYrmViHGm9mZ+mHLVG324uKK7w=;
Received: from 023-096-109-134.csn.tu-chemnitz.de ([134.109.96.23]
	helo=[192.168.1.3]) by cora.hrz.tu-chemnitz.de with esmtpsa
	(TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80.1)
	(envelope-from <chosi@amd.co.at>)
	id 1Tbse1-0006Ic-KX; Fri, 23 Nov 2012 13:46:09 +0100
Message-ID: <50AF7018.2030401@amd.co.at>
Date: Fri, 23 Nov 2012 13:46:16 +0100
From: Alexander Bienzeisler <chosi@amd.co.at>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353674039.16973.3.camel@zakaz.uk.xensource.com>
X-purgate: clean
X-purgate-type: clean
X-purgate-ID: 154106::1353674769-00000CD1-4C7E25F2/0-0/0-0
X-Scan-AV: cora.hrz.tu-chemnitz.de; 2012-11-23 13:46:09;
	f7c46fe705f18cfcd96f674267528ab1
X-Scan-SA: cora.hrz.tu-chemnitz.de; 2012-11-23 13:46:09;
	35f1b013eb3fddbd30def06e1ea90a70
X-Spam-Score: -1.0 (-)
X-Spam-Report: --- Textanalyse SpamAssassin 3.3.1 (-1.0 Punkte)
	Fragen an/questions to: Postmaster TU Chemnitz
	<postmaster@tu-chemnitz.de>
	* -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
	*  0.0 TVD_RCVD_IP TVD_RCVD_IP --- Ende Textanalyse
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

QXMgSWFuIHNhaWQsIGkgZGlkIG5vdCBkaXNhYmxlIGF1dG9iYWxsb29uaW5nLiBJdCB3b3JrcyB3
aXRoIAphdXRvYmFsbG9vb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=

From xen-devel-bounces@lists.xen.org Fri Nov 23 12:48:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 12:48:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbsfz-00036y-6a; Fri, 23 Nov 2012 12:48:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbsfx-00036n-OL
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:48:09 +0000
Received: from [85.158.139.83:38680] by server-7.bemta-5.messagelabs.com id
	6C/3E-23096-8807FA05; Fri, 23 Nov 2012 12:48:08 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1353674888!31314895!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32503 invoked from network); 23 Nov 2012 12:48:08 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 12:48:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15973302"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 12:47:09 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 12:47:09 +0000
Message-ID: <1353674827.16973.4.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Pasi =?ISO-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
Date: Fri, 23 Nov 2012 12:47:07 +0000
In-Reply-To: <20121123124115.GW8912@reaktio.net>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Alexander Bienzeisler <chosi@amd.co.at>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gRnJpLCAyMDEyLTExLTIzIGF0IDEyOjQxICswMDAwLCBQYXNpIEvDpHJra8OkaW5lbiB3cm90
ZToKPiBPbiBGcmksIE5vdiAyMywgMjAxMiBhdCAxMjozMzo1OVBNICswMDAwLCBJYW4gQ2FtcGJl
bGwgd3JvdGU6Cj4gPiBPbiBGcmksIDIwMTItMTEtMjMgYXQgMTI6MjggKzAwMDAsIFBhc2kgS8Ok
cmtrw6RpbmVuIHdyb3RlOgo+ID4gPiBPbiBGcmksIE5vdiAyMywgMjAxMiBhdCA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3Igbm8gcmVhc29uPyAKCkJl
Y2F1c2UgYXV0b2JhbGxvb24gaXMgZW5hYmxlZC4KClRoaXMgaGFzIGJlZW4gZGlzY3Vzc2VkIGF0
IGxlbmd0aCBvbiB0aGUgbGlzdCBiZWZvcmUsIHBsZWFzZSBjaGVjayB0aGUKYXJjaGl2ZXMuCgpJ
YW4uCgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVu
LWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMu
eGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Fri Nov 23 12:48:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 12:48:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbsfz-00036y-6a; Fri, 23 Nov 2012 12:48:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbsfx-00036n-OL
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:48:09 +0000
Received: from [85.158.139.83:38680] by server-7.bemta-5.messagelabs.com id
	6C/3E-23096-8807FA05; Fri, 23 Nov 2012 12:48:08 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1353674888!31314895!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32503 invoked from network); 23 Nov 2012 12:48:08 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 12:48:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15973302"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 12:47:09 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 12:47:09 +0000
Message-ID: <1353674827.16973.4.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Pasi =?ISO-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
Date: Fri, 23 Nov 2012 12:47:07 +0000
In-Reply-To: <20121123124115.GW8912@reaktio.net>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Alexander Bienzeisler <chosi@amd.co.at>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer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5ICJ4bCBpbmZvIi4KPiA+IAo+ID4gVGhlbiBoZSdzIG1pc3NlZCBk
aXNhYmxpbmcgYXV0b2JhbGxvb24uCj4gPiAKPiAKPiBBcyBjYW4gYmUgc2VlbiBmcm9tIHRoZSBv
dGhlciBlbWFpbCBpbiB0aGlzIHRocmVhZCwKPiBoZSdzIHVzaW5nIGRvbTBfbWVtPTIwNDhNLCBh
bmQgaGUgaGFzIDI4R0Igb2YgZnJlZSBtZW1vcnkgaW4gWGVuLgo+IAo+IFdoeSBpcyB4bCB0cnlp
bmcgdG8gYmFsbG9vbiBkb3duIGRvbTAgKGFuZCBmYWlsaW5nKSBmb3Igbm8gcmVhc29uPyAKCkJl
Y2F1c2UgYXV0b2JhbGxvb24gaXMgZW5hYmxlZC4KClRoaXMgaGFzIGJlZW4gZGlzY3Vzc2VkIGF0
IGxlbmd0aCBvbiB0aGUgbGlzdCBiZWZvcmUsIHBsZWFzZSBjaGVjayB0aGUKYXJjaGl2ZXMuCgpJ
YW4uCgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVu
LWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMu
eGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Fri Nov 23 12:52:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 12:52:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbsjg-0003UV-0e; Fri, 23 Nov 2012 12:52:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1Tbsjf-0003UN-3a
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:51:59 +0000
Received: from [85.158.138.51:39909] by server-3.bemta-3.messagelabs.com id
	03/64-31566-E617FA05; Fri, 23 Nov 2012 12:51:58 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1353675116!27175320!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3ODY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8025 invoked from network); 23 Nov 2012 12:51:57 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-10.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 12:51:57 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="45463424"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 12:51:55 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 07:51:55 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1Tbsja-0000jC-V6;
	Fri, 23 Nov 2012 12:51:55 +0000
Date: Fri, 23 Nov 2012 12:51:13 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: xen-devel@lists.xensource.com
Message-ID: <alpine.DEB.2.02.1211231250330.13749@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH] README: add Pixman as build dependency
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/README b/README
index 21a81b2..88300df 100644
--- a/README
+++ b/README
@@ -51,6 +51,7 @@ provided by your OS distributor:
     * Development install of libaio (e.g. libaio-dev) version 0.3.107 or
       greater. Set CONFIG_SYSTEM_LIBAIO in .config if this is not available.
     * Development install of GLib v2.0 (e.g. libglib2.0-dev)
+    * Development install of Pixman (e.g. libpixman-1-dev)
     * pkg-config
     * bridge-utils package (/sbin/brctl)
     * iproute package (/sbin/ip)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 12:52:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 12:52:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbsjg-0003UV-0e; Fri, 23 Nov 2012 12:52:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1Tbsjf-0003UN-3a
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:51:59 +0000
Received: from [85.158.138.51:39909] by server-3.bemta-3.messagelabs.com id
	03/64-31566-E617FA05; Fri, 23 Nov 2012 12:51:58 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1353675116!27175320!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3ODY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8025 invoked from network); 23 Nov 2012 12:51:57 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-10.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 12:51:57 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="45463424"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 12:51:55 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 07:51:55 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1Tbsja-0000jC-V6;
	Fri, 23 Nov 2012 12:51:55 +0000
Date: Fri, 23 Nov 2012 12:51:13 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: xen-devel@lists.xensource.com
Message-ID: <alpine.DEB.2.02.1211231250330.13749@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH] README: add Pixman as build dependency
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/README b/README
index 21a81b2..88300df 100644
--- a/README
+++ b/README
@@ -51,6 +51,7 @@ provided by your OS distributor:
     * Development install of libaio (e.g. libaio-dev) version 0.3.107 or
       greater. Set CONFIG_SYSTEM_LIBAIO in .config if this is not available.
     * Development install of GLib v2.0 (e.g. libglib2.0-dev)
+    * Development install of Pixman (e.g. libpixman-1-dev)
     * pkg-config
     * bridge-utils package (/sbin/brctl)
     * iproute package (/sbin/ip)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 12:55:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 12:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbsmi-0003dH-KC; Fri, 23 Nov 2012 12:55:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1Tbsmh-0003dA-Cd
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:55:07 +0000
Received: from [85.158.138.51:20630] by server-16.bemta-3.messagelabs.com id
	A3/B0-07461-A227FA05; Fri, 23 Nov 2012 12:55:06 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-11.tower-174.messagelabs.com!1353675304!31209276!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA0OTkwMTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3275 invoked from network); 23 Nov 2012 12:55:05 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-11.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 12:55:05 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id CDF2D267E;
	Fri, 23 Nov 2012 14:55:03 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id A6619EC027; Fri, 23 Nov 2012 14:55:03 +0200 (EET)
Date: Fri, 23 Nov 2012 14:55:03 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121123125503.GX8912@reaktio.net>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353674827.16973.4.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Alexander Bienzeisler <chosi@amd.co.at>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, 2012 at 12:47:07PM +0000, Ian Campbell wrote:
> On Fri, 2012-11-23 at 12:41 +0000, Pasi K=E4rkk=E4inen wrote:
> > On Fri, Nov 23, 2012 at 12:33:59PM +0000, Ian Campbell wrote:
> > > On Fri, 2012-11-23 at 12:28 +0000, Pasi K=E4rkk=E4inen wrote:
> > > > On Fri, Nov 23, 2012 at 12:21:32PM +0000, Ian Campbell wrote:
> > > > > This question belongs on xen-users.
> > > > > =

> > > > > On Fri, 2012-11-23 at 11:35 +0000, Alexander Bienzeisler wrote:
> > > > > > Hello,
> > > > > > =

> > > > > > i just tried to add a domU with 16 gigs of ram (maxmem =3D 1638=
4, memory =3D =

> > > > > > 16384) with free_memory : 28969 but got an error:
> > > > > > =

> > > > > > libxl: error: libxl.c:3433:libxl_set_memory_target: new target =
0 for =

> > > > > > dom0 is below the minimum threshold
> > > > > =

> > > > > The clue is in this message -- you cannot safely balloon down a g=
uest
> > > > > (including dom0) to an arbitrarily small value relative to its in=
itial
> > > > > size. The kernel will have certain fixed datastructures etc which=
 are
> > > > > sized according to the maximum amount of RAM at start of day.
> > > > > =

> > > > > If you were to balloon down too low then you would run out of RAM=
 and
> > > > > the OOM killer would step in and start killing stuff, so xl inclu=
des a
> > > > > safety catch which prevents this.
> > > > > =

> > > > > If you have a huge host and want a small dom0 use the dom0_mem op=
tion
> > > > > and disable xl's autoballoon option or whatever the equivalent xe=
nd
> > > > > option is.
> > > > > =

> > > > =

> > > > I think he was already using dom0_mem. He had 28969 free in Xen as
> > > > reported by "xl info".
> > > =

> > > Then he's missed disabling autoballoon.
> > > =

> > =

> > As can be seen from the other email in this thread,
> > he's using dom0_mem=3D2048M, and he has 28GB of free memory in Xen.
> > =

> > Why is xl trying to balloon down dom0 (and failing) for no reason? =

> =

> Because autoballoon is enabled.
> =


Yep, autoballoon=3D0 fixed the problem.

> This has been discussed at length on the list before, please check the
> archives.
> =


I tried googling quickly but I didn't find anything relevant..

To me this behaviour still seems wrong. What's the point of autoballoon=3D1=
 trying to =

balloon down dom0 if the hypervisor already has enough free memory for the =
VM ? =


In this case:
	- dom0_mem=3D2G
	- new VM to launch with size 16 GB.
	- Xen has 28 GB of free memory.

So clearly there's no need to try to balloon down dom0.. =

not-yet-implemented check/feature in xl, or a bug? =


Thanks,

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 12:55:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 12:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbsmi-0003dH-KC; Fri, 23 Nov 2012 12:55:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1Tbsmh-0003dA-Cd
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 12:55:07 +0000
Received: from [85.158.138.51:20630] by server-16.bemta-3.messagelabs.com id
	A3/B0-07461-A227FA05; Fri, 23 Nov 2012 12:55:06 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-11.tower-174.messagelabs.com!1353675304!31209276!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA0OTkwMTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3275 invoked from network); 23 Nov 2012 12:55:05 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-11.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 12:55:05 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id CDF2D267E;
	Fri, 23 Nov 2012 14:55:03 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id A6619EC027; Fri, 23 Nov 2012 14:55:03 +0200 (EET)
Date: Fri, 23 Nov 2012 14:55:03 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121123125503.GX8912@reaktio.net>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353674827.16973.4.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Alexander Bienzeisler <chosi@amd.co.at>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, 2012 at 12:47:07PM +0000, Ian Campbell wrote:
> On Fri, 2012-11-23 at 12:41 +0000, Pasi K=E4rkk=E4inen wrote:
> > On Fri, Nov 23, 2012 at 12:33:59PM +0000, Ian Campbell wrote:
> > > On Fri, 2012-11-23 at 12:28 +0000, Pasi K=E4rkk=E4inen wrote:
> > > > On Fri, Nov 23, 2012 at 12:21:32PM +0000, Ian Campbell wrote:
> > > > > This question belongs on xen-users.
> > > > > =

> > > > > On Fri, 2012-11-23 at 11:35 +0000, Alexander Bienzeisler wrote:
> > > > > > Hello,
> > > > > > =

> > > > > > i just tried to add a domU with 16 gigs of ram (maxmem =3D 1638=
4, memory =3D =

> > > > > > 16384) with free_memory : 28969 but got an error:
> > > > > > =

> > > > > > libxl: error: libxl.c:3433:libxl_set_memory_target: new target =
0 for =

> > > > > > dom0 is below the minimum threshold
> > > > > =

> > > > > The clue is in this message -- you cannot safely balloon down a g=
uest
> > > > > (including dom0) to an arbitrarily small value relative to its in=
itial
> > > > > size. The kernel will have certain fixed datastructures etc which=
 are
> > > > > sized according to the maximum amount of RAM at start of day.
> > > > > =

> > > > > If you were to balloon down too low then you would run out of RAM=
 and
> > > > > the OOM killer would step in and start killing stuff, so xl inclu=
des a
> > > > > safety catch which prevents this.
> > > > > =

> > > > > If you have a huge host and want a small dom0 use the dom0_mem op=
tion
> > > > > and disable xl's autoballoon option or whatever the equivalent xe=
nd
> > > > > option is.
> > > > > =

> > > > =

> > > > I think he was already using dom0_mem. He had 28969 free in Xen as
> > > > reported by "xl info".
> > > =

> > > Then he's missed disabling autoballoon.
> > > =

> > =

> > As can be seen from the other email in this thread,
> > he's using dom0_mem=3D2048M, and he has 28GB of free memory in Xen.
> > =

> > Why is xl trying to balloon down dom0 (and failing) for no reason? =

> =

> Because autoballoon is enabled.
> =


Yep, autoballoon=3D0 fixed the problem.

> This has been discussed at length on the list before, please check the
> archives.
> =


I tried googling quickly but I didn't find anything relevant..

To me this behaviour still seems wrong. What's the point of autoballoon=3D1=
 trying to =

balloon down dom0 if the hypervisor already has enough free memory for the =
VM ? =


In this case:
	- dom0_mem=3D2G
	- new VM to launch with size 16 GB.
	- Xen has 28 GB of free memory.

So clearly there's no need to try to balloon down dom0.. =

not-yet-implemented check/feature in xl, or a bug? =


Thanks,

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 13:06:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 13:06:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbsxc-000428-Rw; Fri, 23 Nov 2012 13:06:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1Tbsxb-000423-0o
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 13:06:23 +0000
Received: from [85.158.139.211:57319] by server-3.bemta-5.messagelabs.com id
	2E/3A-18736-EC47FA05; Fri, 23 Nov 2012 13:06:22 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1353675980!19333865!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg0MTA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31296 invoked from network); 23 Nov 2012 13:06:21 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 13:06:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="215334764"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 13:06:19 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 08:06:19 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TbsxX-0000wM-69;
	Fri, 23 Nov 2012 13:06:19 +0000
Date: Fri, 23 Nov 2012 13:05:37 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: xen-devel@lists.xensource.com
Message-ID: <alpine.DEB.2.02.1211231252040.13749@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] qemu-xen update to QEMU 1.3.0-rc0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi all,
I have just updated the qemu-xen tree (qemu-upstream-unstable.git) that
we use with xen-unstable for QEMU development to QEMU 1.3.0-rc0 (plus a
couple of commits).

After the updated qemu-xen tree manages to pass the required automated
tests, I'll send a patch to flip the switch in libxl to set qemu-xen as
the *default device model*.

I'll be tracking the QEMU 1.3 RCs very closely from now on and I am aiming at
releasing QEMU 1.3 as the device emulator of choice for Xen 4.3.

Cheers,

Stefano

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 13:06:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 13:06:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbsxc-000428-Rw; Fri, 23 Nov 2012 13:06:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1Tbsxb-000423-0o
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 13:06:23 +0000
Received: from [85.158.139.211:57319] by server-3.bemta-5.messagelabs.com id
	2E/3A-18736-EC47FA05; Fri, 23 Nov 2012 13:06:22 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1353675980!19333865!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg0MTA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31296 invoked from network); 23 Nov 2012 13:06:21 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 13:06:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="215334764"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 13:06:19 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 08:06:19 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TbsxX-0000wM-69;
	Fri, 23 Nov 2012 13:06:19 +0000
Date: Fri, 23 Nov 2012 13:05:37 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: xen-devel@lists.xensource.com
Message-ID: <alpine.DEB.2.02.1211231252040.13749@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] qemu-xen update to QEMU 1.3.0-rc0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi all,
I have just updated the qemu-xen tree (qemu-upstream-unstable.git) that
we use with xen-unstable for QEMU development to QEMU 1.3.0-rc0 (plus a
couple of commits).

After the updated qemu-xen tree manages to pass the required automated
tests, I'll send a patch to flip the switch in libxl to set qemu-xen as
the *default device model*.

I'll be tracking the QEMU 1.3 RCs very closely from now on and I am aiming at
releasing QEMU 1.3 as the device emulator of choice for Xen 4.3.

Cheers,

Stefano

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 13:16:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 13:16:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbt71-0004Mx-1S; Fri, 23 Nov 2012 13:16:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbt6z-0004Ms-TH
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 13:16:06 +0000
Received: from [85.158.139.83:43424] by server-11.bemta-5.messagelabs.com id
	85/6B-03409-5177FA05; Fri, 23 Nov 2012 13:16:05 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353676555!20349866!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22312 invoked from network); 23 Nov 2012 13:15:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 13:15:55 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15973970"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 13:15:55 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 13:15:55 +0000
Message-ID: <1353676553.16973.12.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Pasi =?ISO-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
Date: Fri, 23 Nov 2012 13:15:53 +0000
In-Reply-To: <20121123125503.GX8912@reaktio.net>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Alexander Bienzeisler <chosi@amd.co.at>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gRnJpLCAyMDEyLTExLTIzIGF0IDEyOjU1ICswMDAwLCBQYXNpIEvDpHJra8OkaW5lbiB3cm90
ZToKCj4gPiBUaGlzIGhhcyBiZWVuIGRpc2N1c3NlZCBhdCBsZW5ndGggb24gdGhlIGxpc3QgYmVm
b3JlLCBwbGVhc2UgY2hlY2sgdGhlCj4gPiBhcmNoaXZlcy4KPiA+IAo+IAo+IEkgdHJpZWQgZ29v
Z2xpbmcgcXVpY2tseSBidXQgSSBkaWRuJ3QgZmluZCBhbnl0aGluZyByZWxldmFudC4uCgpJIGZv
dW5kCmh0dHA6Ly93ZWIuYXJjaGl2ZW9yYW5nZS5jb20vYXJjaGl2ZS92L3pDS3o1VDNQTHZ0eVpE
U1BRYzlpCmluIGEgbWF0dGVyIG9mIH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bi4KCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpY
ZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0
cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Fri Nov 23 13:16:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 13:16:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbt71-0004Mx-1S; Fri, 23 Nov 2012 13:16:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbt6z-0004Ms-TH
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 13:16:06 +0000
Received: from [85.158.139.83:43424] by server-11.bemta-5.messagelabs.com id
	85/6B-03409-5177FA05; Fri, 23 Nov 2012 13:16:05 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353676555!20349866!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22312 invoked from network); 23 Nov 2012 13:15:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 13:15:55 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15973970"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 13:15:55 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 13:15:55 +0000
Message-ID: <1353676553.16973.12.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Pasi =?ISO-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
Date: Fri, 23 Nov 2012 13:15:53 +0000
In-Reply-To: <20121123125503.GX8912@reaktio.net>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Alexander Bienzeisler <chosi@amd.co.at>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gRnJpLCAyMDEyLTExLTIzIGF0IDEyOjU1ICswMDAwLCBQYXNpIEvDpHJra8OkaW5lb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mgbm8gbmVlZCB0byB0cnkgdG8gYmFsbG9vbiBk
b3duIGRvbTAuLiAKClJpZ2h0LCBzbyBkb24ndCBzZXQgYXV0b2JhbGxvb24gdGhlbi4KCj4gbm90
LXlldC1pbXBsZW1lbnRlZCBjaGVjay9mZWF0dXJlIGluIHhsLCBvciBhIGJ1Zz8gCgpOZWl0aGVy
LCBpdCBpcyB0aGUgaW50ZW5kZWQgYmVoYXZpb3VyIG9mIHhsIGF1dG9iYWxsb29uLCB0aGlzIG9w
dGlvbgptZWFucyBleGFjdGx5ICJ0YWtlIHRoZSByZXF1aXJlZCBtZW1vcnkgZnJvbSBkb20wIi4K
Cklhbi4KCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpY
ZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0
cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Fri Nov 23 13:29:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 13:29:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbtJs-0004mE-JD; Fri, 23 Nov 2012 13:29:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TbtJq-0004m9-Ue
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 13:29:23 +0000
Received: from [85.158.143.99:31651] by server-2.bemta-4.messagelabs.com id
	DC/94-28922-23A7FA05; Fri, 23 Nov 2012 13:29:22 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-14.tower-216.messagelabs.com!1353677361!20319133!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA0OTkwMTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5996 invoked from network); 23 Nov 2012 13:29:21 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-14.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 13:29:21 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 5ED341EB2;
	Fri, 23 Nov 2012 15:29:20 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 1F7E2EC027; Fri, 23 Nov 2012 15:29:20 +0200 (EET)
Date: Fri, 23 Nov 2012 15:29:20 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121123132920.GY8912@reaktio.net>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353676553.16973.12.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Alexander Bienzeisler <chosi@amd.co.at>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, 2012 at 01:15:53PM +0000, Ian Campbell wrote:
> On Fri, 2012-11-23 at 12:55 +0000, Pasi K=E4rkk=E4inen wrote:
> =

> > > This has been discussed at length on the list before, please check the
> > > archives.
> > > =

> > =

> > I tried googling quickly but I didn't find anything relevant..
> =

> I found
> http://web.archiveorange.com/archive/v/zCKz5T3PLvtyZDSPQc9i
> in a matter of seconds, then:
> http://lists.xen.org/archives/html/xen-devel/2011-11/msg01415.html
> http://lists.xen.org/archives/html/xen-users/2012-05/msg00139.html
> http://lists.xen.org/archives/html/xen-users/2012-05/msg00146.html
> =

> > To me this behaviour still seems wrong. What's the point of autoballoon=
=3D1 trying to =

> > balloon down dom0 if the hypervisor already has enough free memory for =
the VM ? =

> > =

> > In this case:
> > 	- dom0_mem=3D2G
> > 	- new VM to launch with size 16 GB.
> > 	- Xen has 28 GB of free memory.
> > =

> > So clearly there's no need to try to balloon down dom0.. =

> =

> Right, so don't set autoballoon then.
> =


It's enabled as a default.. so many people hit this problem.


> > not-yet-implemented check/feature in xl, or a bug? =

> =

> Neither, it is the intended behaviour of xl autoballoon, this option
> means exactly "take the required memory from dom0".
> =


http://xenbits.xen.org/docs/4.2-testing/man/xl.conf.5.html

"autoballoon=3DBOOLEAN

    If disabled then xl will not attempt to reduce the amount of memory ass=
igned to domain 0 in order to create free memory when starting a new domain=
. You should set this if you use the dom0_mem hypervisor command line to re=
duce the amount of memory given to domain 0 by default.

    Default: 1"


I think we should modify that to say "You should set autoballoon=3D0 if you=
 use the dom0_mem hypervisor command line .." =

At least I understood that text in the opposite way..

Also: What happens if you have autoballoon=3D1 and you start some VMs, then=
 stop the VMs, =

so most of the memory is now free in Xen.. and then you try to start a big =
VM ? =

Aren't you going to hit the same problem as in this thread? =



-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 13:29:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 13:29:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbtJs-0004mE-JD; Fri, 23 Nov 2012 13:29:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TbtJq-0004m9-Ue
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 13:29:23 +0000
Received: from [85.158.143.99:31651] by server-2.bemta-4.messagelabs.com id
	DC/94-28922-23A7FA05; Fri, 23 Nov 2012 13:29:22 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-14.tower-216.messagelabs.com!1353677361!20319133!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA0OTkwMTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5996 invoked from network); 23 Nov 2012 13:29:21 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-14.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 13:29:21 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 5ED341EB2;
	Fri, 23 Nov 2012 15:29:20 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 1F7E2EC027; Fri, 23 Nov 2012 15:29:20 +0200 (EET)
Date: Fri, 23 Nov 2012 15:29:20 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121123132920.GY8912@reaktio.net>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353676553.16973.12.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Alexander Bienzeisler <chosi@amd.co.at>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, 2012 at 01:15:53PM +0000, Ian Campbell wrote:
> On Fri, 2012-11-23 at 12:55 +0000, Pasi K=E4rkk=E4inen wrote:
> =

> > > This has been discussed at length on the list before, please check the
> > > archives.
> > > =

> > =

> > I tried googling quickly but I didn't find anything relevant..
> =

> I found
> http://web.archiveorange.com/archive/v/zCKz5T3PLvtyZDSPQc9i
> in a matter of seconds, then:
> http://lists.xen.org/archives/html/xen-devel/2011-11/msg01415.html
> http://lists.xen.org/archives/html/xen-users/2012-05/msg00139.html
> http://lists.xen.org/archives/html/xen-users/2012-05/msg00146.html
> =

> > To me this behaviour still seems wrong. What's the point of autoballoon=
=3D1 trying to =

> > balloon down dom0 if the hypervisor already has enough free memory for =
the VM ? =

> > =

> > In this case:
> > 	- dom0_mem=3D2G
> > 	- new VM to launch with size 16 GB.
> > 	- Xen has 28 GB of free memory.
> > =

> > So clearly there's no need to try to balloon down dom0.. =

> =

> Right, so don't set autoballoon then.
> =


It's enabled as a default.. so many people hit this problem.


> > not-yet-implemented check/feature in xl, or a bug? =

> =

> Neither, it is the intended behaviour of xl autoballoon, this option
> means exactly "take the required memory from dom0".
> =


http://xenbits.xen.org/docs/4.2-testing/man/xl.conf.5.html

"autoballoon=3DBOOLEAN

    If disabled then xl will not attempt to reduce the amount of memory ass=
igned to domain 0 in order to create free memory when starting a new domain=
. You should set this if you use the dom0_mem hypervisor command line to re=
duce the amount of memory given to domain 0 by default.

    Default: 1"


I think we should modify that to say "You should set autoballoon=3D0 if you=
 use the dom0_mem hypervisor command line .." =

At least I understood that text in the opposite way..

Also: What happens if you have autoballoon=3D1 and you start some VMs, then=
 stop the VMs, =

so most of the memory is now free in Xen.. and then you try to start a big =
VM ? =

Aren't you going to hit the same problem as in this thread? =



-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 13:34:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 13:34:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbtON-00054P-AT; Fri, 23 Nov 2012 13:34:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbtOL-00054K-Pq
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 13:34:02 +0000
Received: from [85.158.138.51:13696] by server-3.bemta-3.messagelabs.com id
	15/FC-31566-A3B7FA05; Fri, 23 Nov 2012 13:33:46 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353677625!23189723!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4807 invoked from network); 23 Nov 2012 13:33:46 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 13:33:46 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15974428"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 13:33:44 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 13:33:44 +0000
Message-ID: <1353677623.16973.13.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Pasi =?ISO-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
Date: Fri, 23 Nov 2012 13:33:43 +0000
In-Reply-To: <20121123132920.GY8912@reaktio.net>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Alexander Bienzeisler <chosi@amd.co.at>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gRnJpLCAyMDEyLTExLTIzIGF0IDEzOjI5ICswMDAwLCBQYXNpIEvDpHJra8OkaW5lbiB3cm90
ZToKPiBPbiBGcmksIE5vdiAyMywgMjAxMiBhdCAwMToxNTo1M1BNICswMDAwLCBJYW4gQ2FtcGJl
bGwgd3JvdGU6Cj4gPiBPbiBGcmksIDIwMTItMTEtMjMgYXQgMT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vcmcveGVuLWRl
dmVsCg==

From xen-devel-bounces@lists.xen.org Fri Nov 23 13:34:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 13:34:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbtON-00054P-AT; Fri, 23 Nov 2012 13:34:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbtOL-00054K-Pq
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 13:34:02 +0000
Received: from [85.158.138.51:13696] by server-3.bemta-3.messagelabs.com id
	15/FC-31566-A3B7FA05; Fri, 23 Nov 2012 13:33:46 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353677625!23189723!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4807 invoked from network); 23 Nov 2012 13:33:46 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 13:33:46 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15974428"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 13:33:44 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 13:33:44 +0000
Message-ID: <1353677623.16973.13.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Pasi =?ISO-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
Date: Fri, 23 Nov 2012 13:33:43 +0000
In-Reply-To: <20121123132920.GY8912@reaktio.net>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Alexander Bienzeisler <chosi@amd.co.at>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gRnJpLCAyMDEyLTExLTIzIGF0IDEzOjI5ICswMDAwLCBQYXNpIEvDpHJra8OkaW5lbiB3cm90
ZToKPiBPbiBGcmksIE5vdiAyMywgMjAxMiBhdCAwMToxNTo1M1BNICswMDAwLCBJYW4gQ2FtcGJl
bGwgd3JvdGU6Cj4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nhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRl
dmVsCg==

From xen-devel-bounces@lists.xen.org Fri Nov 23 14:11:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 14:11:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbtye-0006Mk-2h; Fri, 23 Nov 2012 14:11:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dirk.winning@junidas.de>) id 1TbqYq-0005IV-BE
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 10:32:40 +0000
Received: from [85.158.139.83:46048] by server-14.bemta-5.messagelabs.com id
	BB/F6-21768-7C05FA05; Fri, 23 Nov 2012 10:32:39 +0000
X-Env-Sender: dirk.winning@junidas.de
X-Msg-Ref: server-2.tower-182.messagelabs.com!1353666756!31581139!1
X-Originating-IP: [92.79.175.226]
X-SpamReason: No, hits=0.0 required=7.0 tests=HTML_MESSAGE
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9697 invoked from network); 23 Nov 2012 10:32:37 -0000
Received: from mail.junidas.de (HELO mail.junidas.de) (92.79.175.226)
	by server-2.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 10:32:37 -0000
Received: from [192.168.22.30] (helo=exchange.stgt.junidas.de)
	by mail.junidas.de with esmtp (Exim 4.80.1)
	(envelope-from <dirk.winning@junidas.de>) id 1TbqYm-0007gg-Ir
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 11:32:36 +0100
Received: from localhost (localhost [127.0.0.1])
	by exchange.stgt.junidas.de (Postfix) with ESMTP id 834864A00DD
	for <xen-devel@lists.xensource.com>;
	Fri, 23 Nov 2012 11:32:36 +0100 (CET)
X-Virus-Scanned: amavisd-new at exchange.stgt.junidas.de
Received: from exchange.stgt.junidas.de ([127.0.0.1])
	by localhost (exchange.stgt.junidas.de [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id HJzf+LKBfw5q for <xen-devel@lists.xensource.com>;
	Fri, 23 Nov 2012 11:32:29 +0100 (CET)
Received: from prado-mac.stgt.junidas.de (prado-mac.stgt.junidas.de
	[192.168.210.91])
	by exchange.stgt.junidas.de (Postfix) with ESMTPSA id E01BE4A00DA
	for <xen-devel@lists.xensource.com>;
	Fri, 23 Nov 2012 11:32:29 +0100 (CET)
From: Dirk Winning <dirk.winning@junidas.de>
Date: Fri, 23 Nov 2012 11:32:29 +0100
Message-Id: <C72DD742-4259-4EAD-8656-2992654DA3E6@junidas.de>
To: xen-devel@lists.xensource.com
Mime-Version: 1.0 (Apple Message framework v1085)
X-Mailer: Apple Mail (2.1085)
X-Scanner: 1TbqYm-0007gg-Ir has been scanned for malware on mail.junidas.de
X-Mailman-Approved-At: Fri, 23 Nov 2012 14:11:31 +0000
Subject: [Xen-devel] Bug?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7969190103205678651=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--===============7969190103205678651==
Content-Type: multipart/alternative; boundary=Apple-Mail-2--450088517


--Apple-Mail-2--450088517
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=iso-8859-1

root@graff:~# xm usb-list-assignable-devices
1-6          : ID 14dd:0002 Peppercon AG Multidevice
2-2          : ID 051d:0002 American Power Conversion Smart-UPS 3000 RM =
XL FW:691.16.I USB FW:7.3

root@graff:~# xm usb-hc-create bosch-w2k3-pv 1 1

root@graff:~# xm usb-list bosch-w2k3-pv
Idx BE  state usb-ver  BE-path                      =20
0   0   1     USB1.1  /local/domain/0/backend/vusb/55/0 =20
port 1:=20

root@graff:~# xm usb-attach bosch-w2k3-pv 0 1 2-2
Unexpected error: <class 'xen.util.vusb_util.UsbDeviceParseError'>

Please report to xen-devel@lists.xensource.com
Traceback (most recent call last):
  File "/usr/lib/xen-4.0/bin/xm", line 8, in <module>
    main.main(sys.argv)
  File "/usr/lib/xen-4.0/lib/python/xen/xm/main.py", line 3620, in main
    _, rc =3D _run_cmd(cmd, cmd_name, args)
  File "/usr/lib/xen-4.0/lib/python/xen/xm/main.py", line 3644, in =
_run_cmd
    return True, cmd(args)
  File "/usr/lib/xen-4.0/lib/python/xen/xm/main.py", line 2868, in =
xm_usb_attach
    if vusb_util.bus_is_assigned(bus):
  File "/usr/lib/xen-4.0/lib/python/xen/util/vusb_util.py", line 275, in =
bus_is_assigned
    raise UsbDeviceParseError("Can't get assignment status: (%s)." % =
bus)
xen.util.vusb_util.UsbDeviceParseError: vusb: Error parsing USB device =
info: Can't get assignment status: (2-2).



regards

Dipl. Ing. Dirk Winning, Systemberater
dirk.winning@junidas.de

junidas GmbH, Aixheimer Str. 12, 70619 Stuttgart
Tel. +49 (711) 4599799-12, Fax +49 (711) 4599799-10
Gesch=E4ftsf=FChrer: Dr. Markus Stoll, Matthias Zepf
Amtsgericht Stuttgart, HRB 21939


--Apple-Mail-2--450088517
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=iso-8859-1

<html><head></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; =
"><div><div>root@graff:~# xm usb-list-assignable-devices</div><div>1-6 =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: ID 14dd:0002 Peppercon AG =
Multidevice</div><div>2-2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: ID =
051d:0002 American Power Conversion Smart-UPS 3000 RM XL FW:691.16.I USB =
FW:7.3</div></div><div><br></div><div>root@graff:~# xm usb-hc-create =
bosch-w2k3-pv 1 1</div><div><br></div><div><div>root@graff:~# xm =
usb-list bosch-w2k3-pv</div><div>Idx BE &nbsp;state usb-ver =
&nbsp;BE-path &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp;&nbsp;</div><div>0 &nbsp; 0 &nbsp; 1 &nbsp; &nbsp; =
USB1.1 &nbsp;/local/domain/0/backend/vusb/55/0 &nbsp;</div><div>port =
1:&nbsp;</div></div><div><br></div><div>root@graff:~# xm usb-attach =
bosch-w2k3-pv 0 1 2-2</div><div>Unexpected error: &lt;class =
'xen.util.vusb_util.UsbDeviceParseError'&gt;</div><div><br></div><div>Plea=
se report to <a =
href=3D"mailto:xen-devel@lists.xensource.com">xen-devel@lists.xensource.co=
m</a></div><div>Traceback (most recent call last):</div><div>&nbsp; File =
"/usr/lib/xen-4.0/bin/xm", line 8, in &lt;module&gt;</div><div>&nbsp; =
&nbsp; main.main(sys.argv)</div><div>&nbsp; File =
"/usr/lib/xen-4.0/lib/python/xen/xm/main.py", line 3620, in =
main</div><div>&nbsp; &nbsp; _, rc =3D _run_cmd(cmd, cmd_name, =
args)</div><div>&nbsp; File =
"/usr/lib/xen-4.0/lib/python/xen/xm/main.py", line 3644, in =
_run_cmd</div><div>&nbsp; &nbsp; return True, cmd(args)</div><div>&nbsp; =
File "/usr/lib/xen-4.0/lib/python/xen/xm/main.py", line 2868, in =
xm_usb_attach</div><div>&nbsp; &nbsp; if =
vusb_util.bus_is_assigned(bus):</div><div>&nbsp; File =
"/usr/lib/xen-4.0/lib/python/xen/util/vusb_util.py", line 275, in =
bus_is_assigned</div><div>&nbsp; &nbsp; raise UsbDeviceParseError("Can't =
get assignment status: (%s)." % =
bus)</div><div>xen.util.vusb_util.UsbDeviceParseError: vusb: Error =
parsing USB device info: Can't get assignment status: =
(2-2).</div><div><br></div><div><br></div><div><br></div><div>regards</div=
><div><br></div><div>
<div style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; font-size: 12px; "><div =
style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; "><span class=3D"Apple-style-span" =
style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "><span class=3D"Apple-style-span" =
style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "><span class=3D"Apple-style-span" =
style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "><span class=3D"Apple-style-span" =
style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "><div><div><div style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div =
style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "><div style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div =
style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "><div style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div =
style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; "><div><div>Dipl. Ing. Dirk =
Winning, Systemberater</div><div><a =
href=3D"mailto:dirk.winning@junidas.de">dirk.winning@junidas.de</a></div><=
div><br></div><div><span class=3D"Apple-style-span" style=3D"font-size: =
14px; "><div style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: =
0px; margin-left: 0px; "><font class=3D"Apple-style-span" size=3D"3"><font=
 class=3D"Apple-style-span" color=3D"#0311FF">junidas GmbH, Aixheimer =
Str. 12, 70619 Stuttgart</font></font></div><div style=3D"margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font =
class=3D"Apple-style-span" size=3D"3"><font class=3D"Apple-style-span" =
color=3D"#0311FF">Tel. +49 (711) 4599799-12, Fax +49 (711) =
4599799-10</font></font></div><div style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font =
class=3D"Apple-style-span" size=3D"3"><font class=3D"Apple-style-span" =
color=3D"#0311FF">Gesch=E4ftsf=FChrer: Dr. Markus Stoll, Matthias =
Zepf</font></font></div><div style=3D"margin-top: 0px; margin-right: =
0px; margin-bottom: 0px; margin-left: 0px; "><font =
class=3D"Apple-style-span" size=3D"3"><font class=3D"Apple-style-span" =
color=3D"#0311FF">Amtsgericht Stuttgart, HRB =
21939</font></font></div></span></div></div></div></div></div></div></div>=
</div></div></div></div></div></div></span></div></span></div></span></div=
></span></div></div>
</div>
<br></body></html>=

--Apple-Mail-2--450088517--


--===============7969190103205678651==
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.xen.org
http://lists.xen.org/xen-devel

--===============7969190103205678651==--


From xen-devel-bounces@lists.xen.org Fri Nov 23 14:11:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 14:11:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbtye-0006Mk-2h; Fri, 23 Nov 2012 14:11:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dirk.winning@junidas.de>) id 1TbqYq-0005IV-BE
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 10:32:40 +0000
Received: from [85.158.139.83:46048] by server-14.bemta-5.messagelabs.com id
	BB/F6-21768-7C05FA05; Fri, 23 Nov 2012 10:32:39 +0000
X-Env-Sender: dirk.winning@junidas.de
X-Msg-Ref: server-2.tower-182.messagelabs.com!1353666756!31581139!1
X-Originating-IP: [92.79.175.226]
X-SpamReason: No, hits=0.0 required=7.0 tests=HTML_MESSAGE
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9697 invoked from network); 23 Nov 2012 10:32:37 -0000
Received: from mail.junidas.de (HELO mail.junidas.de) (92.79.175.226)
	by server-2.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 10:32:37 -0000
Received: from [192.168.22.30] (helo=exchange.stgt.junidas.de)
	by mail.junidas.de with esmtp (Exim 4.80.1)
	(envelope-from <dirk.winning@junidas.de>) id 1TbqYm-0007gg-Ir
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 11:32:36 +0100
Received: from localhost (localhost [127.0.0.1])
	by exchange.stgt.junidas.de (Postfix) with ESMTP id 834864A00DD
	for <xen-devel@lists.xensource.com>;
	Fri, 23 Nov 2012 11:32:36 +0100 (CET)
X-Virus-Scanned: amavisd-new at exchange.stgt.junidas.de
Received: from exchange.stgt.junidas.de ([127.0.0.1])
	by localhost (exchange.stgt.junidas.de [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id HJzf+LKBfw5q for <xen-devel@lists.xensource.com>;
	Fri, 23 Nov 2012 11:32:29 +0100 (CET)
Received: from prado-mac.stgt.junidas.de (prado-mac.stgt.junidas.de
	[192.168.210.91])
	by exchange.stgt.junidas.de (Postfix) with ESMTPSA id E01BE4A00DA
	for <xen-devel@lists.xensource.com>;
	Fri, 23 Nov 2012 11:32:29 +0100 (CET)
From: Dirk Winning <dirk.winning@junidas.de>
Date: Fri, 23 Nov 2012 11:32:29 +0100
Message-Id: <C72DD742-4259-4EAD-8656-2992654DA3E6@junidas.de>
To: xen-devel@lists.xensource.com
Mime-Version: 1.0 (Apple Message framework v1085)
X-Mailer: Apple Mail (2.1085)
X-Scanner: 1TbqYm-0007gg-Ir has been scanned for malware on mail.junidas.de
X-Mailman-Approved-At: Fri, 23 Nov 2012 14:11:31 +0000
Subject: [Xen-devel] Bug?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7969190103205678651=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--===============7969190103205678651==
Content-Type: multipart/alternative; boundary=Apple-Mail-2--450088517


--Apple-Mail-2--450088517
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=iso-8859-1

root@graff:~# xm usb-list-assignable-devices
1-6          : ID 14dd:0002 Peppercon AG Multidevice
2-2          : ID 051d:0002 American Power Conversion Smart-UPS 3000 RM =
XL FW:691.16.I USB FW:7.3

root@graff:~# xm usb-hc-create bosch-w2k3-pv 1 1

root@graff:~# xm usb-list bosch-w2k3-pv
Idx BE  state usb-ver  BE-path                      =20
0   0   1     USB1.1  /local/domain/0/backend/vusb/55/0 =20
port 1:=20

root@graff:~# xm usb-attach bosch-w2k3-pv 0 1 2-2
Unexpected error: <class 'xen.util.vusb_util.UsbDeviceParseError'>

Please report to xen-devel@lists.xensource.com
Traceback (most recent call last):
  File "/usr/lib/xen-4.0/bin/xm", line 8, in <module>
    main.main(sys.argv)
  File "/usr/lib/xen-4.0/lib/python/xen/xm/main.py", line 3620, in main
    _, rc =3D _run_cmd(cmd, cmd_name, args)
  File "/usr/lib/xen-4.0/lib/python/xen/xm/main.py", line 3644, in =
_run_cmd
    return True, cmd(args)
  File "/usr/lib/xen-4.0/lib/python/xen/xm/main.py", line 2868, in =
xm_usb_attach
    if vusb_util.bus_is_assigned(bus):
  File "/usr/lib/xen-4.0/lib/python/xen/util/vusb_util.py", line 275, in =
bus_is_assigned
    raise UsbDeviceParseError("Can't get assignment status: (%s)." % =
bus)
xen.util.vusb_util.UsbDeviceParseError: vusb: Error parsing USB device =
info: Can't get assignment status: (2-2).



regards

Dipl. Ing. Dirk Winning, Systemberater
dirk.winning@junidas.de

junidas GmbH, Aixheimer Str. 12, 70619 Stuttgart
Tel. +49 (711) 4599799-12, Fax +49 (711) 4599799-10
Gesch=E4ftsf=FChrer: Dr. Markus Stoll, Matthias Zepf
Amtsgericht Stuttgart, HRB 21939


--Apple-Mail-2--450088517
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=iso-8859-1

<html><head></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; =
"><div><div>root@graff:~# xm usb-list-assignable-devices</div><div>1-6 =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: ID 14dd:0002 Peppercon AG =
Multidevice</div><div>2-2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: ID =
051d:0002 American Power Conversion Smart-UPS 3000 RM XL FW:691.16.I USB =
FW:7.3</div></div><div><br></div><div>root@graff:~# xm usb-hc-create =
bosch-w2k3-pv 1 1</div><div><br></div><div><div>root@graff:~# xm =
usb-list bosch-w2k3-pv</div><div>Idx BE &nbsp;state usb-ver =
&nbsp;BE-path &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp;&nbsp;</div><div>0 &nbsp; 0 &nbsp; 1 &nbsp; &nbsp; =
USB1.1 &nbsp;/local/domain/0/backend/vusb/55/0 &nbsp;</div><div>port =
1:&nbsp;</div></div><div><br></div><div>root@graff:~# xm usb-attach =
bosch-w2k3-pv 0 1 2-2</div><div>Unexpected error: &lt;class =
'xen.util.vusb_util.UsbDeviceParseError'&gt;</div><div><br></div><div>Plea=
se report to <a =
href=3D"mailto:xen-devel@lists.xensource.com">xen-devel@lists.xensource.co=
m</a></div><div>Traceback (most recent call last):</div><div>&nbsp; File =
"/usr/lib/xen-4.0/bin/xm", line 8, in &lt;module&gt;</div><div>&nbsp; =
&nbsp; main.main(sys.argv)</div><div>&nbsp; File =
"/usr/lib/xen-4.0/lib/python/xen/xm/main.py", line 3620, in =
main</div><div>&nbsp; &nbsp; _, rc =3D _run_cmd(cmd, cmd_name, =
args)</div><div>&nbsp; File =
"/usr/lib/xen-4.0/lib/python/xen/xm/main.py", line 3644, in =
_run_cmd</div><div>&nbsp; &nbsp; return True, cmd(args)</div><div>&nbsp; =
File "/usr/lib/xen-4.0/lib/python/xen/xm/main.py", line 2868, in =
xm_usb_attach</div><div>&nbsp; &nbsp; if =
vusb_util.bus_is_assigned(bus):</div><div>&nbsp; File =
"/usr/lib/xen-4.0/lib/python/xen/util/vusb_util.py", line 275, in =
bus_is_assigned</div><div>&nbsp; &nbsp; raise UsbDeviceParseError("Can't =
get assignment status: (%s)." % =
bus)</div><div>xen.util.vusb_util.UsbDeviceParseError: vusb: Error =
parsing USB device info: Can't get assignment status: =
(2-2).</div><div><br></div><div><br></div><div><br></div><div>regards</div=
><div><br></div><div>
<div style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; font-size: 12px; "><div =
style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; "><span class=3D"Apple-style-span" =
style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "><span class=3D"Apple-style-span" =
style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "><span class=3D"Apple-style-span" =
style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "><span class=3D"Apple-style-span" =
style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "><div><div><div style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div =
style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "><div style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div =
style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "><div style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div =
style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; "><div><div>Dipl. Ing. Dirk =
Winning, Systemberater</div><div><a =
href=3D"mailto:dirk.winning@junidas.de">dirk.winning@junidas.de</a></div><=
div><br></div><div><span class=3D"Apple-style-span" style=3D"font-size: =
14px; "><div style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: =
0px; margin-left: 0px; "><font class=3D"Apple-style-span" size=3D"3"><font=
 class=3D"Apple-style-span" color=3D"#0311FF">junidas GmbH, Aixheimer =
Str. 12, 70619 Stuttgart</font></font></div><div style=3D"margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font =
class=3D"Apple-style-span" size=3D"3"><font class=3D"Apple-style-span" =
color=3D"#0311FF">Tel. +49 (711) 4599799-12, Fax +49 (711) =
4599799-10</font></font></div><div style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font =
class=3D"Apple-style-span" size=3D"3"><font class=3D"Apple-style-span" =
color=3D"#0311FF">Gesch=E4ftsf=FChrer: Dr. Markus Stoll, Matthias =
Zepf</font></font></div><div style=3D"margin-top: 0px; margin-right: =
0px; margin-bottom: 0px; margin-left: 0px; "><font =
class=3D"Apple-style-span" size=3D"3"><font class=3D"Apple-style-span" =
color=3D"#0311FF">Amtsgericht Stuttgart, HRB =
21939</font></font></div></span></div></div></div></div></div></div></div>=
</div></div></div></div></div></div></span></div></span></div></span></div=
></span></div></div>
</div>
<br></body></html>=

--Apple-Mail-2--450088517--


--===============7969190103205678651==
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.xen.org
http://lists.xen.org/xen-devel

--===============7969190103205678651==--


From xen-devel-bounces@lists.xen.org Fri Nov 23 14:20:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 14:20:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbu6l-0006ZY-7K; Fri, 23 Nov 2012 14:19:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tbu6j-0006ZT-0P
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 14:19:53 +0000
Received: from [85.158.139.83:36640] by server-4.bemta-5.messagelabs.com id
	FD/0A-15011-7068FA05; Fri, 23 Nov 2012 14:19:51 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1353680280!27652909!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9419 invoked from network); 23 Nov 2012 14:18:00 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-182.messagelabs.com with SMTP;
	23 Nov 2012 14:18:00 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 23 Nov 2012 14:18:00 +0000
Message-Id: <50AF93E102000078000AAE03@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 23 Nov 2012 14:18:57 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartD3E221C1.0__="
Subject: [Xen-devel] [PATCH] linux-2.6.18/x86: adjust unwind info for
 special HYPERVISOR_iret stack layout
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartD3E221C1.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/arch/i386/kernel/head-xen.S
+++ b/arch/i386/kernel/head-xen.S
@@ -70,7 +70,13 @@ ENTRY(startup_32)
 .org HYPERCALL_PAGE_OFFSET
 ENTRY(hypercall_page)
 	CFI_STARTPROC
-.skip 0x1000
+	.skip __HYPERVISOR_iret * 32
+	CFI_REMEMBER_STATE
+	.skip 1 /* push %eax */
+	CFI_ADJUST_CFA_OFFSET	8
+	CFI_REL_OFFSET	eax,0
+	CFI_RESTORE_STATE
+	.balign 0x1000,0
 	CFI_ENDPROC
=20
 /*
--- a/arch/x86_64/kernel/head-xen.S
+++ b/arch/x86_64/kernel/head-xen.S
@@ -23,6 +23,7 @@
 #include <asm/msr.h>
 #include <asm/cache.h>
 #include <asm/dwarf2.h>
+#include <xen/interface/xen.h>
 #include <xen/interface/elfnote.h>
 #include <xen/interface/features.h>
=20
@@ -80,6 +81,7 @@ NEXT_PAGE(level1_fixmap_pgt)
=20
 NEXT_PAGE(hypercall_page)
 	CFI_STARTPROC
+	i =3D 0
 	.rept 0x1000 / 0x20
 	.skip 1 /* push %rcx */
 	CFI_ADJUST_CFA_OFFSET	8
@@ -87,15 +89,25 @@ NEXT_PAGE(hypercall_page)
 	.skip 2 /* push %r11 */
 	CFI_ADJUST_CFA_OFFSET	8
 	CFI_REL_OFFSET	r11,0
+	.if i =3D=3D __HYPERVISOR_iret
+	.skip 1 /* push %rax */
+	CFI_ADJUST_CFA_OFFSET	8
+	CFI_REL_OFFSET	rax,0
+	.endif
 	.skip 5 /* mov $#,%eax */
 	.skip 2 /* syscall */
+	.if i =3D=3D __HYPERVISOR_iret
+	CFI_ADJUST_CFA_OFFSET	-3*8
+	.else
 	.skip 2 /* pop %r11 */
 	CFI_ADJUST_CFA_OFFSET -8
 	CFI_RESTORE r11
 	.skip 1 /* pop %rcx */
 	CFI_ADJUST_CFA_OFFSET -8
 	CFI_RESTORE rcx
-	.align 0x20,0 /* ret */
+	.endif
+	.balign 0x20,0 /* ret */
+	i =3D i + 1
 	.endr
 	CFI_ENDPROC
=20




--=__PartD3E221C1.0__=
Content-Type: text/plain; name="xen-x86-unwind-hypervisor_iret.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-x86-unwind-hypervisor_iret.patch"

x86: adjust unwind info for special HYPERVISOR_iret stack layout=0A=0ASigne=
d-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- a/arch/i386/kernel/head-=
xen.S=0A+++ b/arch/i386/kernel/head-xen.S=0A@@ -70,7 +70,13 @@ ENTRY(startu=
p_32)=0A .org HYPERCALL_PAGE_OFFSET=0A ENTRY(hypercall_page)=0A 	=
CFI_STARTPROC=0A-.skip 0x1000=0A+	.skip __HYPERVISOR_iret * 32=0A+	=
CFI_REMEMBER_STATE=0A+	.skip 1 /* push %eax */=0A+	CFI_ADJUST_CFA_OFFS=
ET	8=0A+	CFI_REL_OFFSET	eax,0=0A+	CFI_RESTORE_STATE=0A+	=
.balign 0x1000,0=0A 	CFI_ENDPROC=0A =0A /*=0A--- a/arch/x86_64/kernel/he=
ad-xen.S=0A+++ b/arch/x86_64/kernel/head-xen.S=0A@@ -23,6 +23,7 @@=0A =
#include <asm/msr.h>=0A #include <asm/cache.h>=0A #include <asm/dwarf2.h>=
=0A+#include <xen/interface/xen.h>=0A #include <xen/interface/elfnote.h>=0A=
 #include <xen/interface/features.h>=0A =0A@@ -80,6 +81,7 @@ NEXT_PAGE(leve=
l1_fixmap_pgt)=0A =0A NEXT_PAGE(hypercall_page)=0A 	CFI_STARTPROC=0A+	=
i =3D 0=0A 	.rept 0x1000 / 0x20=0A 	.skip 1 /* push %rcx */=0A 	=
CFI_ADJUST_CFA_OFFSET	8=0A@@ -87,15 +89,25 @@ NEXT_PAGE(hypercall_page)=
=0A 	.skip 2 /* push %r11 */=0A 	CFI_ADJUST_CFA_OFFSET	8=0A 	=
CFI_REL_OFFSET	r11,0=0A+	.if i =3D=3D __HYPERVISOR_iret=0A+	=
.skip 1 /* push %rax */=0A+	CFI_ADJUST_CFA_OFFSET	8=0A+	CFI_REL_OFF=
SET	rax,0=0A+	.endif=0A 	.skip 5 /* mov $#,%eax */=0A 	=
.skip 2 /* syscall */=0A+	.if i =3D=3D __HYPERVISOR_iret=0A+	=
CFI_ADJUST_CFA_OFFSET	-3*8=0A+	.else=0A 	.skip 2 /* pop =
%r11 */=0A 	CFI_ADJUST_CFA_OFFSET -8=0A 	CFI_RESTORE r11=0A 	=
.skip 1 /* pop %rcx */=0A 	CFI_ADJUST_CFA_OFFSET -8=0A 	CFI_RESTORE=
 rcx=0A-	.align 0x20,0 /* ret */=0A+	.endif=0A+	.balign =
0x20,0 /* ret */=0A+	i =3D i + 1=0A 	.endr=0A 	CFI_ENDPROC=0A =0A
--=__PartD3E221C1.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.xen.org
http://lists.xen.org/xen-devel

--=__PartD3E221C1.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 23 14:20:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 14:20:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbu6l-0006ZY-7K; Fri, 23 Nov 2012 14:19:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tbu6j-0006ZT-0P
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 14:19:53 +0000
Received: from [85.158.139.83:36640] by server-4.bemta-5.messagelabs.com id
	FD/0A-15011-7068FA05; Fri, 23 Nov 2012 14:19:51 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1353680280!27652909!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9419 invoked from network); 23 Nov 2012 14:18:00 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-182.messagelabs.com with SMTP;
	23 Nov 2012 14:18:00 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 23 Nov 2012 14:18:00 +0000
Message-Id: <50AF93E102000078000AAE03@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 23 Nov 2012 14:18:57 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartD3E221C1.0__="
Subject: [Xen-devel] [PATCH] linux-2.6.18/x86: adjust unwind info for
 special HYPERVISOR_iret stack layout
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartD3E221C1.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/arch/i386/kernel/head-xen.S
+++ b/arch/i386/kernel/head-xen.S
@@ -70,7 +70,13 @@ ENTRY(startup_32)
 .org HYPERCALL_PAGE_OFFSET
 ENTRY(hypercall_page)
 	CFI_STARTPROC
-.skip 0x1000
+	.skip __HYPERVISOR_iret * 32
+	CFI_REMEMBER_STATE
+	.skip 1 /* push %eax */
+	CFI_ADJUST_CFA_OFFSET	8
+	CFI_REL_OFFSET	eax,0
+	CFI_RESTORE_STATE
+	.balign 0x1000,0
 	CFI_ENDPROC
=20
 /*
--- a/arch/x86_64/kernel/head-xen.S
+++ b/arch/x86_64/kernel/head-xen.S
@@ -23,6 +23,7 @@
 #include <asm/msr.h>
 #include <asm/cache.h>
 #include <asm/dwarf2.h>
+#include <xen/interface/xen.h>
 #include <xen/interface/elfnote.h>
 #include <xen/interface/features.h>
=20
@@ -80,6 +81,7 @@ NEXT_PAGE(level1_fixmap_pgt)
=20
 NEXT_PAGE(hypercall_page)
 	CFI_STARTPROC
+	i =3D 0
 	.rept 0x1000 / 0x20
 	.skip 1 /* push %rcx */
 	CFI_ADJUST_CFA_OFFSET	8
@@ -87,15 +89,25 @@ NEXT_PAGE(hypercall_page)
 	.skip 2 /* push %r11 */
 	CFI_ADJUST_CFA_OFFSET	8
 	CFI_REL_OFFSET	r11,0
+	.if i =3D=3D __HYPERVISOR_iret
+	.skip 1 /* push %rax */
+	CFI_ADJUST_CFA_OFFSET	8
+	CFI_REL_OFFSET	rax,0
+	.endif
 	.skip 5 /* mov $#,%eax */
 	.skip 2 /* syscall */
+	.if i =3D=3D __HYPERVISOR_iret
+	CFI_ADJUST_CFA_OFFSET	-3*8
+	.else
 	.skip 2 /* pop %r11 */
 	CFI_ADJUST_CFA_OFFSET -8
 	CFI_RESTORE r11
 	.skip 1 /* pop %rcx */
 	CFI_ADJUST_CFA_OFFSET -8
 	CFI_RESTORE rcx
-	.align 0x20,0 /* ret */
+	.endif
+	.balign 0x20,0 /* ret */
+	i =3D i + 1
 	.endr
 	CFI_ENDPROC
=20




--=__PartD3E221C1.0__=
Content-Type: text/plain; name="xen-x86-unwind-hypervisor_iret.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-x86-unwind-hypervisor_iret.patch"

x86: adjust unwind info for special HYPERVISOR_iret stack layout=0A=0ASigne=
d-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- a/arch/i386/kernel/head-=
xen.S=0A+++ b/arch/i386/kernel/head-xen.S=0A@@ -70,7 +70,13 @@ ENTRY(startu=
p_32)=0A .org HYPERCALL_PAGE_OFFSET=0A ENTRY(hypercall_page)=0A 	=
CFI_STARTPROC=0A-.skip 0x1000=0A+	.skip __HYPERVISOR_iret * 32=0A+	=
CFI_REMEMBER_STATE=0A+	.skip 1 /* push %eax */=0A+	CFI_ADJUST_CFA_OFFS=
ET	8=0A+	CFI_REL_OFFSET	eax,0=0A+	CFI_RESTORE_STATE=0A+	=
.balign 0x1000,0=0A 	CFI_ENDPROC=0A =0A /*=0A--- a/arch/x86_64/kernel/he=
ad-xen.S=0A+++ b/arch/x86_64/kernel/head-xen.S=0A@@ -23,6 +23,7 @@=0A =
#include <asm/msr.h>=0A #include <asm/cache.h>=0A #include <asm/dwarf2.h>=
=0A+#include <xen/interface/xen.h>=0A #include <xen/interface/elfnote.h>=0A=
 #include <xen/interface/features.h>=0A =0A@@ -80,6 +81,7 @@ NEXT_PAGE(leve=
l1_fixmap_pgt)=0A =0A NEXT_PAGE(hypercall_page)=0A 	CFI_STARTPROC=0A+	=
i =3D 0=0A 	.rept 0x1000 / 0x20=0A 	.skip 1 /* push %rcx */=0A 	=
CFI_ADJUST_CFA_OFFSET	8=0A@@ -87,15 +89,25 @@ NEXT_PAGE(hypercall_page)=
=0A 	.skip 2 /* push %r11 */=0A 	CFI_ADJUST_CFA_OFFSET	8=0A 	=
CFI_REL_OFFSET	r11,0=0A+	.if i =3D=3D __HYPERVISOR_iret=0A+	=
.skip 1 /* push %rax */=0A+	CFI_ADJUST_CFA_OFFSET	8=0A+	CFI_REL_OFF=
SET	rax,0=0A+	.endif=0A 	.skip 5 /* mov $#,%eax */=0A 	=
.skip 2 /* syscall */=0A+	.if i =3D=3D __HYPERVISOR_iret=0A+	=
CFI_ADJUST_CFA_OFFSET	-3*8=0A+	.else=0A 	.skip 2 /* pop =
%r11 */=0A 	CFI_ADJUST_CFA_OFFSET -8=0A 	CFI_RESTORE r11=0A 	=
.skip 1 /* pop %rcx */=0A 	CFI_ADJUST_CFA_OFFSET -8=0A 	CFI_RESTORE=
 rcx=0A-	.align 0x20,0 /* ret */=0A+	.endif=0A+	.balign =
0x20,0 /* ret */=0A+	i =3D i + 1=0A 	.endr=0A 	CFI_ENDPROC=0A =0A
--=__PartD3E221C1.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.xen.org
http://lists.xen.org/xen-devel

--=__PartD3E221C1.0__=--


From xen-devel-bounces@lists.xen.org Fri Nov 23 14:40:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 14:40:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbuPu-000763-Vn; Fri, 23 Nov 2012 14:39:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TbuPt-00075y-Tr
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 14:39:42 +0000
Received: from [193.109.254.147:40518] by server-14.bemta-14.messagelabs.com
	id 8C/B1-14517-DAA8FA05; Fri, 23 Nov 2012 14:39:41 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-7.tower-27.messagelabs.com!1353681579!1681515!1
X-Originating-IP: [81.169.146.161]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA1MDEwNjk=\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA1MDEwNjk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25715 invoked from network); 23 Nov 2012 14:39:39 -0000
Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.161)
	by server-7.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 14:39:39 -0000
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmwtM48/ll387qFkE=
X-RZG-CLASS-ID: mo00
Received: from probook.site
	(dslb-084-057-086-014.pools.arcor-ip.net [84.57.86.14])
	by smtp.strato.de (jored mo35) (RZmta 31.5 DYNA|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id a04212oANEVOxJ ;
	Fri, 23 Nov 2012 15:39:33 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 2C8261884C; Fri, 23 Nov 2012 15:39:33 +0100 (CET)
Date: Fri, 23 Nov 2012 15:39:33 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Message-ID: <20121123143933.GB27107@aepfle.de>
References: <508E489502000078000A4FC6@nat28.tlf.novell.com>
	<20121030132951.GA4192@aepfle.de>
	<508FE6DD02000078000A56CF@nat28.tlf.novell.com>
	<20623.57765.463131.112836@mariner.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20623.57765.463131.112836@mariner.uk.xensource.com>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] preparing for 4.2.1 and 4.1.4
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Oct 30, Ian Jackson wrote:

> Jan Beulich writes ("Re: [Xen-devel] preparing for 4.2.1 and 4.1.4"):
> > >>> On 30.10.12 at 14:29, Olaf Hering <olaf@aepfle.de> wrote:
> > Tools patches get taken care of by IanJ (i.e. you should
> > probably have Cc-ed him) , but first of all - did you check what
> > is in 4.2-staging already (seems to me you didn't)?
> 
> I think many of these are.  I haven't been through Olaf's whole list.

The locking.sh changes are not in 4.2 yet:

changeset:   26079:b3b03536789a
hotplug/Linux: close lockfd after lock attempt

This changeset fixes perl 5.8, the failure does not happen for me with
perl 5.10+:

changeset:   26146:92c52eb4b270
hotplug/Linux: Fix locking in tools/hotplug/Linux/locking.sh


Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 14:40:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 14:40:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbuPu-000763-Vn; Fri, 23 Nov 2012 14:39:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <olaf@aepfle.de>) id 1TbuPt-00075y-Tr
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 14:39:42 +0000
Received: from [193.109.254.147:40518] by server-14.bemta-14.messagelabs.com
	id 8C/B1-14517-DAA8FA05; Fri, 23 Nov 2012 14:39:41 +0000
X-Env-Sender: olaf@aepfle.de
X-Msg-Ref: server-7.tower-27.messagelabs.com!1353681579!1681515!1
X-Originating-IP: [81.169.146.161]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA1MDEwNjk=\n,sa_preprocessor: 
	QmFkIElQOiA4MS4xNjkuMTQ2LjE2MSA9PiA1MDEwNjk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25715 invoked from network); 23 Nov 2012 14:39:39 -0000
Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.161)
	by server-7.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 14:39:39 -0000
X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmwtM48/ll387qFkE=
X-RZG-CLASS-ID: mo00
Received: from probook.site
	(dslb-084-057-086-014.pools.arcor-ip.net [84.57.86.14])
	by smtp.strato.de (jored mo35) (RZmta 31.5 DYNA|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id a04212oANEVOxJ ;
	Fri, 23 Nov 2012 15:39:33 +0100 (CET)
Received: by probook.site (Postfix, from userid 1000)
	id 2C8261884C; Fri, 23 Nov 2012 15:39:33 +0100 (CET)
Date: Fri, 23 Nov 2012 15:39:33 +0100
From: Olaf Hering <olaf@aepfle.de>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Message-ID: <20121123143933.GB27107@aepfle.de>
References: <508E489502000078000A4FC6@nat28.tlf.novell.com>
	<20121030132951.GA4192@aepfle.de>
	<508FE6DD02000078000A56CF@nat28.tlf.novell.com>
	<20623.57765.463131.112836@mariner.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20623.57765.463131.112836@mariner.uk.xensource.com>
User-Agent: Mutt/1.5.21.rev5558 (2012-10-16)
Cc: Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] preparing for 4.2.1 and 4.1.4
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Oct 30, Ian Jackson wrote:

> Jan Beulich writes ("Re: [Xen-devel] preparing for 4.2.1 and 4.1.4"):
> > >>> On 30.10.12 at 14:29, Olaf Hering <olaf@aepfle.de> wrote:
> > Tools patches get taken care of by IanJ (i.e. you should
> > probably have Cc-ed him) , but first of all - did you check what
> > is in 4.2-staging already (seems to me you didn't)?
> 
> I think many of these are.  I haven't been through Olaf's whole list.

The locking.sh changes are not in 4.2 yet:

changeset:   26079:b3b03536789a
hotplug/Linux: close lockfd after lock attempt

This changeset fixes perl 5.8, the failure does not happen for me with
perl 5.10+:

changeset:   26146:92c52eb4b270
hotplug/Linux: Fix locking in tools/hotplug/Linux/locking.sh


Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 14:47:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 14:47:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbuWj-0007UM-0v; Fri, 23 Nov 2012 14:46:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TbuWi-0007UH-2P
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 14:46:44 +0000
Received: from [193.109.254.147:7832] by server-3.bemta-14.messagelabs.com id
	B3/03-01317-35C8FA05; Fri, 23 Nov 2012 14:46:43 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353681994!9382851!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg0MTA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7177 invoked from network); 23 Nov 2012 14:46:35 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 14:46:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="215342499"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 14:46:33 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 09:46:33 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TbuWW-0002MH-UN;
	Fri, 23 Nov 2012 14:46:32 +0000
MIME-Version: 1.0
X-Mercurial-Node: 54d1bcd211d14cfbae0782f2bf04f8942c2eb726
Message-ID: <54d1bcd211d14cfbae07.1353681656@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 23 Nov 2012 14:40:56 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH v2] libxl: Fix bug in libxl_cdrom_insert,
 make more robust against bad xenstore data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1353681608 0
# Node ID 54d1bcd211d14cfbae0782f2bf04f8942c2eb726
# Parent  ae6fb202b233af815466055d9f1a635802a50855
libxl: Fix bug in libxl_cdrom_insert, make more robust against bad xenstore data

libxl_cdrom_insert was failing to initialize the backend type,
resulting in the wrong default backend.  The result was not only that
the CD was not inserted properly, but also that some improper xenstore
entries were created, causing further block commands to fail.

This patch fixes the bug by setting the disk backend type based on the
type of the existing device.

It also makes the system more robust by checking to see that it has
got a valid path before proceeding to write a partial xenstore entry.

v2:
 - Remove the checks on read, pending a more robust fix in another patch.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2353,6 +2353,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
 
     libxl__device device;
     const char * path;
+    char * tmp;
 
     flexarray_t *insert = NULL;
 
@@ -2383,8 +2384,11 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
     disks = libxl_device_disk_list(ctx, domid, &num);
     for (i = 0; i < num; i++) {
         if (disks[i].is_cdrom && !strcmp(disk->vdev, disks[i].vdev))
-            /* found */
+        {
+            /* Found.  Set backend type appropriately. */
+            disk->backend=disks[i].backend;
             break;
+        }
     }
     if (i == num) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Virtual device not found");
@@ -2410,6 +2414,17 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
 
     path = libxl__device_backend_path(gc, &device);
 
+    /* Sanity check: make sure the backend exists before writing here */
+    tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/frontend", path));
+    if (!tmp)
+    {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Internal error: %s does not exist",
+            libxl__sprintf(gc, "%s/frontend", path));
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+
     insert = flexarray_make(gc, 4, 1);
 
     flexarray_append_pair(insert, "type",

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 14:47:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 14:47:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbuWj-0007UM-0v; Fri, 23 Nov 2012 14:46:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TbuWi-0007UH-2P
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 14:46:44 +0000
Received: from [193.109.254.147:7832] by server-3.bemta-14.messagelabs.com id
	B3/03-01317-35C8FA05; Fri, 23 Nov 2012 14:46:43 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353681994!9382851!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg0MTA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7177 invoked from network); 23 Nov 2012 14:46:35 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 14:46:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="215342499"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 14:46:33 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 09:46:33 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TbuWW-0002MH-UN;
	Fri, 23 Nov 2012 14:46:32 +0000
MIME-Version: 1.0
X-Mercurial-Node: 54d1bcd211d14cfbae0782f2bf04f8942c2eb726
Message-ID: <54d1bcd211d14cfbae07.1353681656@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 23 Nov 2012 14:40:56 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH v2] libxl: Fix bug in libxl_cdrom_insert,
 make more robust against bad xenstore data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1353681608 0
# Node ID 54d1bcd211d14cfbae0782f2bf04f8942c2eb726
# Parent  ae6fb202b233af815466055d9f1a635802a50855
libxl: Fix bug in libxl_cdrom_insert, make more robust against bad xenstore data

libxl_cdrom_insert was failing to initialize the backend type,
resulting in the wrong default backend.  The result was not only that
the CD was not inserted properly, but also that some improper xenstore
entries were created, causing further block commands to fail.

This patch fixes the bug by setting the disk backend type based on the
type of the existing device.

It also makes the system more robust by checking to see that it has
got a valid path before proceeding to write a partial xenstore entry.

v2:
 - Remove the checks on read, pending a more robust fix in another patch.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2353,6 +2353,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
 
     libxl__device device;
     const char * path;
+    char * tmp;
 
     flexarray_t *insert = NULL;
 
@@ -2383,8 +2384,11 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
     disks = libxl_device_disk_list(ctx, domid, &num);
     for (i = 0; i < num; i++) {
         if (disks[i].is_cdrom && !strcmp(disk->vdev, disks[i].vdev))
-            /* found */
+        {
+            /* Found.  Set backend type appropriately. */
+            disk->backend=disks[i].backend;
             break;
+        }
     }
     if (i == num) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Virtual device not found");
@@ -2410,6 +2414,17 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
 
     path = libxl__device_backend_path(gc, &device);
 
+    /* Sanity check: make sure the backend exists before writing here */
+    tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/frontend", path));
+    if (!tmp)
+    {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Internal error: %s does not exist",
+            libxl__sprintf(gc, "%s/frontend", path));
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+
     insert = flexarray_make(gc, 4, 1);
 
     flexarray_append_pair(insert, "type",

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 15:10:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 15:10:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbusy-00084Q-27; Fri, 23 Nov 2012 15:09:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1Tbusw-00084L-K5
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 15:09:42 +0000
Received: from [85.158.143.35:42240] by server-2.bemta-4.messagelabs.com id
	6E/80-28922-5B19FA05; Fri, 23 Nov 2012 15:09:41 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1353683360!8515241!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzI2NjY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32061 invoked from network); 23 Nov 2012 15:09:24 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 15:09:24 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qANF9COr018357
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 23 Nov 2012 15:09:17 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qANF9BWR010247
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 23 Nov 2012 15:09:12 GMT
Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qANF98dr030916; Fri, 23 Nov 2012 09:09:09 -0600
Received: from [10.191.15.113] (/10.191.15.113)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 23 Nov 2012 07:09:08 -0800
Message-ID: <50AF9180.7020701@oracle.com>
Date: Fri, 23 Nov 2012 23:08:48 +0800
From: annie li <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
	<1353426878.13542.59.camel@zakaz.uk.xensource.com>
	<1353427456.13542.65.camel@zakaz.uk.xensource.com>
	<50AED1A8.30607@oracle.com>
	<1353662328.13542.173.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353662328.13542.173.camel@zakaz.uk.xensource.com>
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
 xen/netfront: handle compound page fragments on transmit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-23 17:18, Ian Campbell wrote:
> On Fri, 2012-11-23 at 01:30 +0000, ANNIE LI wrote:
>   
>> It is hard to negotiate this between netfront and netback for different 
>> packets.
>>     
> You wouldn't negotiate for each packet, you would negotiate at start of
> day.
>
> You'd also need some sort of fallback for the case where you end up
> negotiating something smaller than the maximum your upper layer network
> stack might give you. I suppose you'd have to do segmentation somewhere
> along the line. (We have this problem now, and the Linux implementation
> just ignores it and drops the frames.)

What I am thinking is, this negotiation would be implemented during 
xenbus communication.

* netback provides its default value in xenstore
* netfront read out this value and compared this value with itself, then 
write back the larger one
   netback = netfront, use the same value
   netback > netfront, use netfront value and netfront does not need 
more slots
   netback < netfront, use netfront value and netfront does not need to 
do segmentation. But if netfront's total frag numbers exceed the max 
frag number of dom0(like linux's MAX_SKB_FRAGS), segmentation is needed 
for this kind of packets?
* netback read out the negotiated value from xenstore

It seems changing current netback to per-VIF is necessary(persistent 
grant benefit from it too), and every different vif in netback maintains 
its own value.

Thanks
Annie

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 15:10:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 15:10:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbusy-00084Q-27; Fri, 23 Nov 2012 15:09:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <annie.li@oracle.com>) id 1Tbusw-00084L-K5
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 15:09:42 +0000
Received: from [85.158.143.35:42240] by server-2.bemta-4.messagelabs.com id
	6E/80-28922-5B19FA05; Fri, 23 Nov 2012 15:09:41 +0000
X-Env-Sender: annie.li@oracle.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1353683360!8515241!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzI2NjY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32061 invoked from network); 23 Nov 2012 15:09:24 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 23 Nov 2012 15:09:24 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qANF9COr018357
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 23 Nov 2012 15:09:17 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qANF9BWR010247
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 23 Nov 2012 15:09:12 GMT
Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qANF98dr030916; Fri, 23 Nov 2012 09:09:09 -0600
Received: from [10.191.15.113] (/10.191.15.113)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 23 Nov 2012 07:09:08 -0800
Message-ID: <50AF9180.7020701@oracle.com>
Date: Fri, 23 Nov 2012 23:08:48 +0800
From: annie li <annie.li@oracle.com>
Organization: Oracle Corporation
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1353403286.18229.159.camel@zakaz.uk.xensource.com>
	<1353411606-15940-1-git-send-email-ian.campbell@citrix.com>
	<50AB856D02000078000A9EFD@nat28.tlf.novell.com>
	<1353418516.13542.38.camel@zakaz.uk.xensource.com>
	<50AB990602000078000A9F5B@nat28.tlf.novell.com>
	<1353420865.13542.44.camel@zakaz.uk.xensource.com>
	<50ABA29902000078000A9FB1@nat28.tlf.novell.com>
	<1353424014.13542.49.camel@zakaz.uk.xensource.com>
	<1353425308.2590.11.camel@edumazet-glaptop>
	<1353426878.13542.59.camel@zakaz.uk.xensource.com>
	<1353427456.13542.65.camel@zakaz.uk.xensource.com>
	<50AED1A8.30607@oracle.com>
	<1353662328.13542.173.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353662328.13542.173.camel@zakaz.uk.xensource.com>
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: KonradRzeszutekWilk <konrad@kernel.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] netchannel vs MAX_SKB_FRAGS (Was: Re: [PATCH]
 xen/netfront: handle compound page fragments on transmit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 2012-11-23 17:18, Ian Campbell wrote:
> On Fri, 2012-11-23 at 01:30 +0000, ANNIE LI wrote:
>   
>> It is hard to negotiate this between netfront and netback for different 
>> packets.
>>     
> You wouldn't negotiate for each packet, you would negotiate at start of
> day.
>
> You'd also need some sort of fallback for the case where you end up
> negotiating something smaller than the maximum your upper layer network
> stack might give you. I suppose you'd have to do segmentation somewhere
> along the line. (We have this problem now, and the Linux implementation
> just ignores it and drops the frames.)

What I am thinking is, this negotiation would be implemented during 
xenbus communication.

* netback provides its default value in xenstore
* netfront read out this value and compared this value with itself, then 
write back the larger one
   netback = netfront, use the same value
   netback > netfront, use netfront value and netfront does not need 
more slots
   netback < netfront, use netfront value and netfront does not need to 
do segmentation. But if netfront's total frag numbers exceed the max 
frag number of dom0(like linux's MAX_SKB_FRAGS), segmentation is needed 
for this kind of packets?
* netback read out the negotiated value from xenstore

It seems changing current netback to per-VIF is necessary(persistent 
grant benefit from it too), and every different vif in netback maintains 
its own value.

Thanks
Annie

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 15:22:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 15:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbv4n-00008v-B7; Fri, 23 Nov 2012 15:21:57 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1Tbv4m-00008p-K7
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 15:21:56 +0000
Received: from [85.158.139.83:56161] by server-12.bemta-5.messagelabs.com id
	BC/7D-02886-3949FA05; Fri, 23 Nov 2012 15:21:55 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1353684113!30922180!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3ODY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18925 invoked from network); 23 Nov 2012 15:21:55 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 15:21:55 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="45475761"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 15:21:47 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 10:21:46 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1Tbv4c-0002ro-B5;
	Fri, 23 Nov 2012 15:21:46 +0000
Date: Fri, 23 Nov 2012 15:21:04 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: xen-devel@lists.xensource.com
Message-ID: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony.Perard@citrix.com, Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Get the address of the GIC distributor, cpu, virtual and virtual cpu
interfaces registers from device tree.


Note: I couldn't completely get rid of GIC_BASE_ADDRESS, GIC_DR_OFFSET
and friends because we are using them from mode_switch.S, that is
executed before device tree has been parsed. But at least mode_switch.S
is known to contain vexpress specific code anyway.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 0c6fab9..8efbeb3 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -26,6 +26,7 @@
 #include <xen/errno.h>
 #include <xen/softirq.h>
 #include <xen/list.h>
+#include <xen/device_tree.h>
 #include <asm/p2m.h>
 #include <asm/domain.h>
 
@@ -34,9 +35,9 @@
 /* Access to the GIC Distributor registers through the fixmap */
 #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
 #define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
-                                     + (GIC_CR_OFFSET & 0xfff)))
+                                     + ((uint32_t) gic.cbase & 0xfff)))
 #define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
-                                     + (GIC_HR_OFFSET & 0xfff)))
+                                     + ((uint32_t) gic.hbase & 0xfff)))
 static void gic_restore_pending_irqs(struct vcpu *v);
 
 /* Global state */
@@ -44,6 +45,7 @@ static struct {
     paddr_t dbase;       /* Address of distributor registers */
     paddr_t cbase;       /* Address of CPU interface registers */
     paddr_t hbase;       /* Address of virtual interface registers */
+    paddr_t vbase;       /* Address of virtual cpu interface registers */
     unsigned int lines;
     unsigned int cpus;
     spinlock_t lock;
@@ -306,10 +308,10 @@ static void __cpuinit gic_hyp_disable(void)
 /* Set up the GIC */
 void __init gic_init(void)
 {
-    /* XXX FIXME get this from devicetree */
-    gic.dbase = GIC_BASE_ADDRESS + GIC_DR_OFFSET;
-    gic.cbase = GIC_BASE_ADDRESS + GIC_CR_OFFSET;
-    gic.hbase = GIC_BASE_ADDRESS + GIC_HR_OFFSET;
+    gic.dbase = early_info.gic.gic_dist_addr;
+    gic.cbase = early_info.gic.gic_cpu_addr;
+    gic.hbase = early_info.gic.gic_hyp_addr;
+    gic.vbase = early_info.gic.gic_vcpu_addr;
     set_fixmap(FIXMAP_GICD, gic.dbase >> PAGE_SHIFT, DEV_SHARED);
     BUILD_BUG_ON(FIXMAP_ADDR(FIXMAP_GICC1) !=
                  FIXMAP_ADDR(FIXMAP_GICC2)-PAGE_SIZE);
@@ -569,9 +571,9 @@ int gicv_setup(struct domain *d)
 {
     /* map the gic virtual cpu interface in the gic cpu interface region of
      * the guest */
-    return map_mmio_regions(d, GIC_BASE_ADDRESS + GIC_CR_OFFSET,
-                        GIC_BASE_ADDRESS + GIC_CR_OFFSET + (2 * PAGE_SIZE) - 1,
-                        GIC_BASE_ADDRESS + GIC_VR_OFFSET);
+    return map_mmio_regions(d, gic.cbase,
+                        gic.cbase + (2 * PAGE_SIZE) - 1,
+                        gic.vbase);
 }
 
 static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index da0af77..79b1dd1 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -54,6 +54,27 @@ bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
     return !strncmp(prop, match, len);
 }
 
+bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)
+{
+    int len, l;
+    const void *prop;
+
+    prop = fdt_getprop(fdt, node, "compatible", &len);
+    if ( prop == NULL )
+        return 0;
+
+    while ( len > 0 ) {
+        if ( !strncmp(prop, match, strlen(match)) )
+            return 1;
+        l = strlen(prop) + 1;
+        prop += l;
+        len -= l;
+    }
+
+    return 0;
+}
+
+
 static void __init get_val(const u32 **cell, u32 cells, u64 *val)
 {
     *val = 0;
@@ -270,6 +291,50 @@ static void __init process_cpu_node(const void *fdt, int node,
     cpumask_set_cpu(start, &cpu_possible_map);
 }
 
+static void __init process_gic_node(const void *fdt, int node,
+                                    const char *name,
+                                    u32 address_cells, u32 size_cells)
+{
+    const struct fdt_property *prop;
+    const u32 *cell;
+    paddr_t start, size;
+    int reg_cells, interfaces;
+
+    if ( address_cells < 1 || size_cells < 1 )
+    {
+        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
+                     name);
+        return;
+    }
+
+    prop = fdt_get_property(fdt, node, "reg", NULL);
+    if ( !prop )
+    {
+        early_printk("fdt: node `%s': missing `reg' property\n", name);
+        return;
+    }
+
+    cell = (const u32 *)prop->data;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+
+    cell = (const u32 *)prop->data;
+    reg_cells = address_cells + size_cells;
+    interfaces = fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32));
+    if ( interfaces < 4 )
+    {
+        early_printk("fdt: node `%s': invalid `reg' property\n", name);
+        return;
+    }
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_dist_addr = start;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_cpu_addr = start;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_hyp_addr = start;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_vcpu_addr = start;
+}
+
 static int __init early_scan_node(const void *fdt,
                                   int node, const char *name, int depth,
                                   u32 address_cells, u32 size_cells,
@@ -279,6 +344,8 @@ static int __init early_scan_node(const void *fdt,
         process_memory_node(fdt, node, name, address_cells, size_cells);
     else if ( device_tree_type_matches(fdt, node, "cpu") )
         process_cpu_node(fdt, node, name, address_cells, size_cells);
+    else if ( device_tree_node_compatible(fdt, node, "arm,cortex-a15-gic") )
+        process_gic_node(fdt, node, name, address_cells, size_cells);
 
     return 0;
 }
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 4d010c0..a0e3a97 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -26,8 +26,16 @@ struct dt_mem_info {
     struct membank bank[NR_MEM_BANKS];
 };
 
+struct dt_gic_info {
+    paddr_t gic_dist_addr;
+    paddr_t gic_cpu_addr;
+    paddr_t gic_hyp_addr;
+    paddr_t gic_vcpu_addr;
+};
+
 struct dt_early_info {
     struct dt_mem_info mem;
+    struct dt_gic_info gic;
 };
 
 typedef int (*device_tree_node_func)(const void *fdt,

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 15:22:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 15:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbv4n-00008v-B7; Fri, 23 Nov 2012 15:21:57 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1Tbv4m-00008p-K7
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 15:21:56 +0000
Received: from [85.158.139.83:56161] by server-12.bemta-5.messagelabs.com id
	BC/7D-02886-3949FA05; Fri, 23 Nov 2012 15:21:55 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1353684113!30922180!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3ODY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18925 invoked from network); 23 Nov 2012 15:21:55 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 15:21:55 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="45475761"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 15:21:47 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 10:21:46 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1Tbv4c-0002ro-B5;
	Fri, 23 Nov 2012 15:21:46 +0000
Date: Fri, 23 Nov 2012 15:21:04 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: xen-devel@lists.xensource.com
Message-ID: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony.Perard@citrix.com, Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Get the address of the GIC distributor, cpu, virtual and virtual cpu
interfaces registers from device tree.


Note: I couldn't completely get rid of GIC_BASE_ADDRESS, GIC_DR_OFFSET
and friends because we are using them from mode_switch.S, that is
executed before device tree has been parsed. But at least mode_switch.S
is known to contain vexpress specific code anyway.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 0c6fab9..8efbeb3 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -26,6 +26,7 @@
 #include <xen/errno.h>
 #include <xen/softirq.h>
 #include <xen/list.h>
+#include <xen/device_tree.h>
 #include <asm/p2m.h>
 #include <asm/domain.h>
 
@@ -34,9 +35,9 @@
 /* Access to the GIC Distributor registers through the fixmap */
 #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
 #define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
-                                     + (GIC_CR_OFFSET & 0xfff)))
+                                     + ((uint32_t) gic.cbase & 0xfff)))
 #define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
-                                     + (GIC_HR_OFFSET & 0xfff)))
+                                     + ((uint32_t) gic.hbase & 0xfff)))
 static void gic_restore_pending_irqs(struct vcpu *v);
 
 /* Global state */
@@ -44,6 +45,7 @@ static struct {
     paddr_t dbase;       /* Address of distributor registers */
     paddr_t cbase;       /* Address of CPU interface registers */
     paddr_t hbase;       /* Address of virtual interface registers */
+    paddr_t vbase;       /* Address of virtual cpu interface registers */
     unsigned int lines;
     unsigned int cpus;
     spinlock_t lock;
@@ -306,10 +308,10 @@ static void __cpuinit gic_hyp_disable(void)
 /* Set up the GIC */
 void __init gic_init(void)
 {
-    /* XXX FIXME get this from devicetree */
-    gic.dbase = GIC_BASE_ADDRESS + GIC_DR_OFFSET;
-    gic.cbase = GIC_BASE_ADDRESS + GIC_CR_OFFSET;
-    gic.hbase = GIC_BASE_ADDRESS + GIC_HR_OFFSET;
+    gic.dbase = early_info.gic.gic_dist_addr;
+    gic.cbase = early_info.gic.gic_cpu_addr;
+    gic.hbase = early_info.gic.gic_hyp_addr;
+    gic.vbase = early_info.gic.gic_vcpu_addr;
     set_fixmap(FIXMAP_GICD, gic.dbase >> PAGE_SHIFT, DEV_SHARED);
     BUILD_BUG_ON(FIXMAP_ADDR(FIXMAP_GICC1) !=
                  FIXMAP_ADDR(FIXMAP_GICC2)-PAGE_SIZE);
@@ -569,9 +571,9 @@ int gicv_setup(struct domain *d)
 {
     /* map the gic virtual cpu interface in the gic cpu interface region of
      * the guest */
-    return map_mmio_regions(d, GIC_BASE_ADDRESS + GIC_CR_OFFSET,
-                        GIC_BASE_ADDRESS + GIC_CR_OFFSET + (2 * PAGE_SIZE) - 1,
-                        GIC_BASE_ADDRESS + GIC_VR_OFFSET);
+    return map_mmio_regions(d, gic.cbase,
+                        gic.cbase + (2 * PAGE_SIZE) - 1,
+                        gic.vbase);
 }
 
 static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index da0af77..79b1dd1 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -54,6 +54,27 @@ bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
     return !strncmp(prop, match, len);
 }
 
+bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)
+{
+    int len, l;
+    const void *prop;
+
+    prop = fdt_getprop(fdt, node, "compatible", &len);
+    if ( prop == NULL )
+        return 0;
+
+    while ( len > 0 ) {
+        if ( !strncmp(prop, match, strlen(match)) )
+            return 1;
+        l = strlen(prop) + 1;
+        prop += l;
+        len -= l;
+    }
+
+    return 0;
+}
+
+
 static void __init get_val(const u32 **cell, u32 cells, u64 *val)
 {
     *val = 0;
@@ -270,6 +291,50 @@ static void __init process_cpu_node(const void *fdt, int node,
     cpumask_set_cpu(start, &cpu_possible_map);
 }
 
+static void __init process_gic_node(const void *fdt, int node,
+                                    const char *name,
+                                    u32 address_cells, u32 size_cells)
+{
+    const struct fdt_property *prop;
+    const u32 *cell;
+    paddr_t start, size;
+    int reg_cells, interfaces;
+
+    if ( address_cells < 1 || size_cells < 1 )
+    {
+        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
+                     name);
+        return;
+    }
+
+    prop = fdt_get_property(fdt, node, "reg", NULL);
+    if ( !prop )
+    {
+        early_printk("fdt: node `%s': missing `reg' property\n", name);
+        return;
+    }
+
+    cell = (const u32 *)prop->data;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+
+    cell = (const u32 *)prop->data;
+    reg_cells = address_cells + size_cells;
+    interfaces = fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32));
+    if ( interfaces < 4 )
+    {
+        early_printk("fdt: node `%s': invalid `reg' property\n", name);
+        return;
+    }
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_dist_addr = start;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_cpu_addr = start;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_hyp_addr = start;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_vcpu_addr = start;
+}
+
 static int __init early_scan_node(const void *fdt,
                                   int node, const char *name, int depth,
                                   u32 address_cells, u32 size_cells,
@@ -279,6 +344,8 @@ static int __init early_scan_node(const void *fdt,
         process_memory_node(fdt, node, name, address_cells, size_cells);
     else if ( device_tree_type_matches(fdt, node, "cpu") )
         process_cpu_node(fdt, node, name, address_cells, size_cells);
+    else if ( device_tree_node_compatible(fdt, node, "arm,cortex-a15-gic") )
+        process_gic_node(fdt, node, name, address_cells, size_cells);
 
     return 0;
 }
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 4d010c0..a0e3a97 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -26,8 +26,16 @@ struct dt_mem_info {
     struct membank bank[NR_MEM_BANKS];
 };
 
+struct dt_gic_info {
+    paddr_t gic_dist_addr;
+    paddr_t gic_cpu_addr;
+    paddr_t gic_hyp_addr;
+    paddr_t gic_vcpu_addr;
+};
+
 struct dt_early_info {
     struct dt_mem_info mem;
+    struct dt_gic_info gic;
 };
 
 typedef int (*device_tree_node_func)(const void *fdt,

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 15:46:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 15:46:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbvSL-0000gi-HB; Fri, 23 Nov 2012 15:46:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TbvSJ-0000gd-TF
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 15:46:16 +0000
Received: from [85.158.139.211:5544] by server-2.bemta-5.messagelabs.com id
	32/42-04892-74A9FA05; Fri, 23 Nov 2012 15:46:15 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1353685571!21332652!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg0MTA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26075 invoked from network); 23 Nov 2012 15:46:12 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 15:46:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="215346700"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 15:46:11 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 10:46:10 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TbvSE-0003GG-DL;
	Fri, 23 Nov 2012 15:46:10 +0000
Date: Fri, 23 Nov 2012 15:45:28 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: xen-devel@lists.xensource.com
Message-ID: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The zImage format is extremely simple: it only consists of a magic
number and 2 addresses in a specific position (see
http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).

Some bootloaders expect a zImage; considering that it doesn't cost us
much to build Xen compatible with the format, make it so.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 25c4cfe..de9cdb2 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -22,6 +22,9 @@
 #include <asm/processor-ca15.h>
 #include <asm/asm_defns.h>
 
+#define ZIMAGE_MAGIC_NUMBER 0x016f2818
+#define XEN_PHYS_ADDRESS    0x80000000
+
 #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
 #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
 #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
@@ -52,6 +55,18 @@
 	 * or the initial pagetable code below will need adjustment. */
 	.global start
 start:
+
+	.rept	7
+	mov	r0, r0
+	.endr
+	mov	r0, r0
+	b	1f
+
+	.word	ZIMAGE_MAGIC_NUMBER				@ Magic numbers to help the loader
+	.word	(_start + XEN_PHYS_ADDRESS)		@ absolute load/run zImage address
+	.word	(_end + XEN_PHYS_ADDRESS)		@ zImage end address
+
+1:
 	cpsid aif                    /* Disable all interrupts */
 
 	/* Save the bootloader arguments in less-clobberable registers */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 15:46:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 15:46:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbvSL-0000gi-HB; Fri, 23 Nov 2012 15:46:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TbvSJ-0000gd-TF
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 15:46:16 +0000
Received: from [85.158.139.211:5544] by server-2.bemta-5.messagelabs.com id
	32/42-04892-74A9FA05; Fri, 23 Nov 2012 15:46:15 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1353685571!21332652!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg0MTA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26075 invoked from network); 23 Nov 2012 15:46:12 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 15:46:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="215346700"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 15:46:11 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 10:46:10 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TbvSE-0003GG-DL;
	Fri, 23 Nov 2012 15:46:10 +0000
Date: Fri, 23 Nov 2012 15:45:28 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: xen-devel@lists.xensource.com
Message-ID: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The zImage format is extremely simple: it only consists of a magic
number and 2 addresses in a specific position (see
http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).

Some bootloaders expect a zImage; considering that it doesn't cost us
much to build Xen compatible with the format, make it so.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 25c4cfe..de9cdb2 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -22,6 +22,9 @@
 #include <asm/processor-ca15.h>
 #include <asm/asm_defns.h>
 
+#define ZIMAGE_MAGIC_NUMBER 0x016f2818
+#define XEN_PHYS_ADDRESS    0x80000000
+
 #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
 #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
 #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
@@ -52,6 +55,18 @@
 	 * or the initial pagetable code below will need adjustment. */
 	.global start
 start:
+
+	.rept	7
+	mov	r0, r0
+	.endr
+	mov	r0, r0
+	b	1f
+
+	.word	ZIMAGE_MAGIC_NUMBER				@ Magic numbers to help the loader
+	.word	(_start + XEN_PHYS_ADDRESS)		@ absolute load/run zImage address
+	.word	(_end + XEN_PHYS_ADDRESS)		@ zImage end address
+
+1:
 	cpsid aif                    /* Disable all interrupts */
 
 	/* Save the bootloader arguments in less-clobberable registers */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 15:54:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 15:54:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbvZy-00012o-J8; Fri, 23 Nov 2012 15:54:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbvZw-00012f-SX
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 15:54:09 +0000
Received: from [85.158.137.99:39755] by server-16.bemta-3.messagelabs.com id
	0A/51-07461-02C9FA05; Fri, 23 Nov 2012 15:54:08 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1353686047!18000995!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7330 invoked from network); 23 Nov 2012 15:54:07 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 15:54:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15977776"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 15:54:06 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 15:54:04 +0000
Message-ID: <1353686042.16973.19.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Fri, 23 Nov 2012 15:54:02 +0000
In-Reply-To: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 15:45 +0000, Stefano Stabellini wrote:
> The zImage format is extremely simple: it only consists of a magic
> number and 2 addresses in a specific position (see
> http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
> 
> Some bootloaders expect a zImage; considering that it doesn't cost us
> much to build Xen compatible with the format, make it so.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> 
> diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> index 25c4cfe..de9cdb2 100644
> --- a/xen/arch/arm/head.S
> +++ b/xen/arch/arm/head.S
> @@ -22,6 +22,9 @@
>  #include <asm/processor-ca15.h>
>  #include <asm/asm_defns.h>
>  
> +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> +#define XEN_PHYS_ADDRESS    0x80000000

This is platform specific. AIUI you can put 0 in the field and the boot
loader is expected to do something sensible, although that might require
a new enough bootloader (FSVO new enough).

If that doesn't work then this constant is actually in
xen/arch/arm/Makefile too and for the same reason:
        # XXX: VE model loads by VMA so instead of
        # making a proper ELF we link with LMA == VMA and adjust crudely
        $(OBJCOPY) --change-addresses +0x80000000 $< $@
        $(STRIP) $@

How about making this CONFIG_PHYSICAL_LOCAL_ADDR and plumbing through
like we do with CONFIG_DTB_FILE?

> +
>  #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
>  #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
>  #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
> @@ -52,6 +55,18 @@
>  	 * or the initial pagetable code below will need adjustment. */
>  	.global start
>  start:
> +
> +	.rept	7
> +	mov	r0, r0
> +	.endr
> +	mov	r0, r0
> +	b	1f
> +
> +	.word	ZIMAGE_MAGIC_NUMBER				@ Magic numbers to help the loader
> +	.word	(_start + XEN_PHYS_ADDRESS)		@ absolute load/run zImage address

Wacky spaces?

> +	.word	(_end + XEN_PHYS_ADDRESS)		@ zImage end address
> +
> +1:
>  	cpsid aif                    /* Disable all interrupts */
>  
>  	/* Save the bootloader arguments in less-clobberable registers */



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 15:54:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 15:54:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbvZy-00012o-J8; Fri, 23 Nov 2012 15:54:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbvZw-00012f-SX
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 15:54:09 +0000
Received: from [85.158.137.99:39755] by server-16.bemta-3.messagelabs.com id
	0A/51-07461-02C9FA05; Fri, 23 Nov 2012 15:54:08 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1353686047!18000995!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7330 invoked from network); 23 Nov 2012 15:54:07 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 15:54:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15977776"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 15:54:06 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 15:54:04 +0000
Message-ID: <1353686042.16973.19.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Fri, 23 Nov 2012 15:54:02 +0000
In-Reply-To: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 15:45 +0000, Stefano Stabellini wrote:
> The zImage format is extremely simple: it only consists of a magic
> number and 2 addresses in a specific position (see
> http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
> 
> Some bootloaders expect a zImage; considering that it doesn't cost us
> much to build Xen compatible with the format, make it so.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> 
> diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> index 25c4cfe..de9cdb2 100644
> --- a/xen/arch/arm/head.S
> +++ b/xen/arch/arm/head.S
> @@ -22,6 +22,9 @@
>  #include <asm/processor-ca15.h>
>  #include <asm/asm_defns.h>
>  
> +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> +#define XEN_PHYS_ADDRESS    0x80000000

This is platform specific. AIUI you can put 0 in the field and the boot
loader is expected to do something sensible, although that might require
a new enough bootloader (FSVO new enough).

If that doesn't work then this constant is actually in
xen/arch/arm/Makefile too and for the same reason:
        # XXX: VE model loads by VMA so instead of
        # making a proper ELF we link with LMA == VMA and adjust crudely
        $(OBJCOPY) --change-addresses +0x80000000 $< $@
        $(STRIP) $@

How about making this CONFIG_PHYSICAL_LOCAL_ADDR and plumbing through
like we do with CONFIG_DTB_FILE?

> +
>  #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
>  #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
>  #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
> @@ -52,6 +55,18 @@
>  	 * or the initial pagetable code below will need adjustment. */
>  	.global start
>  start:
> +
> +	.rept	7
> +	mov	r0, r0
> +	.endr
> +	mov	r0, r0
> +	b	1f
> +
> +	.word	ZIMAGE_MAGIC_NUMBER				@ Magic numbers to help the loader
> +	.word	(_start + XEN_PHYS_ADDRESS)		@ absolute load/run zImage address

Wacky spaces?

> +	.word	(_end + XEN_PHYS_ADDRESS)		@ zImage end address
> +
> +1:
>  	cpsid aif                    /* Disable all interrupts */
>  
>  	/* Save the bootloader arguments in less-clobberable registers */



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:02:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:02:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbvht-0001w2-52; Fri, 23 Nov 2012 16:02:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1Tbvhr-0001vu-3F
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:02:19 +0000
Received: from [85.158.139.211:21844] by server-16.bemta-5.messagelabs.com id
	BE/AC-04786-A0E9FA05; Fri, 23 Nov 2012 16:02:18 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353686536!21358018!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3ODY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30379 invoked from network); 23 Nov 2012 16:02:17 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 16:02:17 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="45478779"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 16:02:14 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 11:02:14 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1Tbvhm-0003U3-9N;
	Fri, 23 Nov 2012 16:02:14 +0000
MIME-Version: 1.0
X-Mercurial-Node: 85552b648b3cabebd4f5bfb484ab329fe2bb290d
Message-ID: <85552b648b3cabebd4f5.1353686197@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 23 Nov 2012 15:56:37 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH] libxl: Make an internal function explicitly
 check existence of expected paths
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1353686127 0
# Node ID 85552b648b3cabebd4f5bfb484ab329fe2bb290d
# Parent  54d1bcd211d14cfbae0782f2bf04f8942c2eb726
libxl: Make an internal function explicitly check existence of expected paths

libxl__device_disk_from_xs_be() was failing without error for some
missing xenstore nodes in a backend, while assuming (without checking)
that other nodes were valid, causing a crash when another internal
error wrote these nodes in the wrong place.

Make this function consistent by:
* Checking the existence of all nodes before using
* Choosing a default only when the node is not written in device_disk_add()
* Failing with log msg if any node written by device_disk_add() is not present
* Returning an error on failure

Also make the callers of the function pay attention to the error and
behave appropriately.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2168,9 +2168,9 @@ void libxl__device_disk_add(libxl__egc *
     device_disk_add(egc, domid, disk, aodev, NULL, NULL);
 }
 
-static void libxl__device_disk_from_xs_be(libxl__gc *gc,
-                                          const char *be_path,
-                                          libxl_device_disk *disk)
+static int libxl__device_disk_from_xs_be(libxl__gc *gc,
+                                         const char *be_path,
+                                         libxl_device_disk *disk)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     unsigned int len;
@@ -2178,6 +2178,7 @@ static void libxl__device_disk_from_xs_b
 
     libxl_device_disk_init(disk);
 
+    /* "params" may not be present; but everything else must be. */
     tmp = xs_read(ctx->xsh, XBT_NULL,
                   libxl__sprintf(gc, "%s/params", be_path), &len);
     if (tmp && strchr(tmp, ':')) {
@@ -2186,21 +2187,40 @@ static void libxl__device_disk_from_xs_b
     } else {
         disk->pdev_path = tmp;
     }
-    libxl_string_to_backend(ctx,
-                        libxl__xs_read(gc, XBT_NULL,
-                                       libxl__sprintf(gc, "%s/type", be_path)),
-                        &(disk->backend));
+
+    
+    tmp = libxl__xs_read(gc, XBT_NULL,
+                         libxl__sprintf(gc, "%s/type", be_path));
+    if (!tmp) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                   "Internal error: Missing xenstore node %s/type", be_path);
+        return ERROR_FAIL;
+    }
+    libxl_string_to_backend(ctx, tmp, &(disk->backend));
+
     disk->vdev = xs_read(ctx->xsh, XBT_NULL,
                          libxl__sprintf(gc, "%s/dev", be_path), &len);
+    if (!disk->vdev) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                   "Internal error: Missing xenstore node %s/dev", be_path);
+        return ERROR_FAIL;
+    }
+
     tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf
                          (gc, "%s/removable", be_path));
-
-    if (tmp)
-        disk->removable = atoi(tmp);
-    else
-        disk->removable = 0;
+    if (!tmp) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                   "Internal error: Missing xenstore node %s/removable", be_path);
+        return ERROR_FAIL;
+    }
+    disk->removable = atoi(tmp);
 
     tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/mode", be_path));
+    if (!tmp) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                   "Internal error: Missing xenstore node %s/mode", be_path);
+        return ERROR_FAIL;
+    }
     if (!strcmp(tmp, "w"))
         disk->readwrite = 1;
     else
@@ -2208,9 +2228,16 @@ static void libxl__device_disk_from_xs_b
 
     tmp = libxl__xs_read(gc, XBT_NULL,
                          libxl__sprintf(gc, "%s/device-type", be_path));
+    if (!tmp) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                   "Internal error: Missing xenstore node %s/device-type", be_path);
+        return ERROR_FAIL;
+    }
     disk->is_cdrom = !strcmp(tmp, "cdrom");
 
     disk->format = LIBXL_DISK_FORMAT_UNKNOWN;
+
+    return 0;
 }
 
 int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid,
@@ -2236,9 +2263,7 @@ int libxl_vdev_to_device_disk(libxl_ctx 
     if (!path)
         goto out;
 
-    libxl__device_disk_from_xs_be(gc, path, disk);
-
-    rc = 0;
+    rc = libxl__device_disk_from_xs_be(gc, path, disk);
 out:
     GC_FREE;
     return rc;
@@ -2255,6 +2280,7 @@ static int libxl__append_disk_list_of_ty
     char **dir = NULL;
     unsigned int n = 0;
     libxl_device_disk *pdisk = NULL, *pdisk_end = NULL;
+    int rc=0;
 
     be_path = libxl__sprintf(gc, "%s/backend/%s/%d",
                              libxl__xs_get_dompath(gc, 0), type, domid);
@@ -2271,7 +2297,8 @@ static int libxl__append_disk_list_of_ty
         for (; pdisk < pdisk_end; pdisk++, dir++) {
             const char *p;
             p = libxl__sprintf(gc, "%s/%s", be_path, *dir);
-            libxl__device_disk_from_xs_be(gc, p, pdisk);
+            if ((rc=libxl__device_disk_from_xs_be(gc, p, pdisk)))
+                return rc;
             pdisk->backend_domid = 0;
         }
     }

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:02:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:02:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbvht-0001w2-52; Fri, 23 Nov 2012 16:02:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1Tbvhr-0001vu-3F
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:02:19 +0000
Received: from [85.158.139.211:21844] by server-16.bemta-5.messagelabs.com id
	BE/AC-04786-A0E9FA05; Fri, 23 Nov 2012 16:02:18 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353686536!21358018!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3ODY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30379 invoked from network); 23 Nov 2012 16:02:17 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 16:02:17 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="45478779"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 16:02:14 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 11:02:14 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1Tbvhm-0003U3-9N;
	Fri, 23 Nov 2012 16:02:14 +0000
MIME-Version: 1.0
X-Mercurial-Node: 85552b648b3cabebd4f5bfb484ab329fe2bb290d
Message-ID: <85552b648b3cabebd4f5.1353686197@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 23 Nov 2012 15:56:37 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH] libxl: Make an internal function explicitly
 check existence of expected paths
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1353686127 0
# Node ID 85552b648b3cabebd4f5bfb484ab329fe2bb290d
# Parent  54d1bcd211d14cfbae0782f2bf04f8942c2eb726
libxl: Make an internal function explicitly check existence of expected paths

libxl__device_disk_from_xs_be() was failing without error for some
missing xenstore nodes in a backend, while assuming (without checking)
that other nodes were valid, causing a crash when another internal
error wrote these nodes in the wrong place.

Make this function consistent by:
* Checking the existence of all nodes before using
* Choosing a default only when the node is not written in device_disk_add()
* Failing with log msg if any node written by device_disk_add() is not present
* Returning an error on failure

Also make the callers of the function pay attention to the error and
behave appropriately.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2168,9 +2168,9 @@ void libxl__device_disk_add(libxl__egc *
     device_disk_add(egc, domid, disk, aodev, NULL, NULL);
 }
 
-static void libxl__device_disk_from_xs_be(libxl__gc *gc,
-                                          const char *be_path,
-                                          libxl_device_disk *disk)
+static int libxl__device_disk_from_xs_be(libxl__gc *gc,
+                                         const char *be_path,
+                                         libxl_device_disk *disk)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     unsigned int len;
@@ -2178,6 +2178,7 @@ static void libxl__device_disk_from_xs_b
 
     libxl_device_disk_init(disk);
 
+    /* "params" may not be present; but everything else must be. */
     tmp = xs_read(ctx->xsh, XBT_NULL,
                   libxl__sprintf(gc, "%s/params", be_path), &len);
     if (tmp && strchr(tmp, ':')) {
@@ -2186,21 +2187,40 @@ static void libxl__device_disk_from_xs_b
     } else {
         disk->pdev_path = tmp;
     }
-    libxl_string_to_backend(ctx,
-                        libxl__xs_read(gc, XBT_NULL,
-                                       libxl__sprintf(gc, "%s/type", be_path)),
-                        &(disk->backend));
+
+    
+    tmp = libxl__xs_read(gc, XBT_NULL,
+                         libxl__sprintf(gc, "%s/type", be_path));
+    if (!tmp) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                   "Internal error: Missing xenstore node %s/type", be_path);
+        return ERROR_FAIL;
+    }
+    libxl_string_to_backend(ctx, tmp, &(disk->backend));
+
     disk->vdev = xs_read(ctx->xsh, XBT_NULL,
                          libxl__sprintf(gc, "%s/dev", be_path), &len);
+    if (!disk->vdev) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                   "Internal error: Missing xenstore node %s/dev", be_path);
+        return ERROR_FAIL;
+    }
+
     tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf
                          (gc, "%s/removable", be_path));
-
-    if (tmp)
-        disk->removable = atoi(tmp);
-    else
-        disk->removable = 0;
+    if (!tmp) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                   "Internal error: Missing xenstore node %s/removable", be_path);
+        return ERROR_FAIL;
+    }
+    disk->removable = atoi(tmp);
 
     tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/mode", be_path));
+    if (!tmp) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                   "Internal error: Missing xenstore node %s/mode", be_path);
+        return ERROR_FAIL;
+    }
     if (!strcmp(tmp, "w"))
         disk->readwrite = 1;
     else
@@ -2208,9 +2228,16 @@ static void libxl__device_disk_from_xs_b
 
     tmp = libxl__xs_read(gc, XBT_NULL,
                          libxl__sprintf(gc, "%s/device-type", be_path));
+    if (!tmp) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                   "Internal error: Missing xenstore node %s/device-type", be_path);
+        return ERROR_FAIL;
+    }
     disk->is_cdrom = !strcmp(tmp, "cdrom");
 
     disk->format = LIBXL_DISK_FORMAT_UNKNOWN;
+
+    return 0;
 }
 
 int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid,
@@ -2236,9 +2263,7 @@ int libxl_vdev_to_device_disk(libxl_ctx 
     if (!path)
         goto out;
 
-    libxl__device_disk_from_xs_be(gc, path, disk);
-
-    rc = 0;
+    rc = libxl__device_disk_from_xs_be(gc, path, disk);
 out:
     GC_FREE;
     return rc;
@@ -2255,6 +2280,7 @@ static int libxl__append_disk_list_of_ty
     char **dir = NULL;
     unsigned int n = 0;
     libxl_device_disk *pdisk = NULL, *pdisk_end = NULL;
+    int rc=0;
 
     be_path = libxl__sprintf(gc, "%s/backend/%s/%d",
                              libxl__xs_get_dompath(gc, 0), type, domid);
@@ -2271,7 +2297,8 @@ static int libxl__append_disk_list_of_ty
         for (; pdisk < pdisk_end; pdisk++, dir++) {
             const char *p;
             p = libxl__sprintf(gc, "%s/%s", be_path, *dir);
-            libxl__device_disk_from_xs_be(gc, p, pdisk);
+            if ((rc=libxl__device_disk_from_xs_be(gc, p, pdisk)))
+                return rc;
             pdisk->backend_domid = 0;
         }
     }

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:15:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:15:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbvty-0002Rb-G1; Fri, 23 Nov 2012 16:14:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1Tbvtw-0002RW-FT
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:14:48 +0000
Received: from [85.158.138.51:52503] by server-8.bemta-3.messagelabs.com id
	8B/8F-07786-7F0AFA05; Fri, 23 Nov 2012 16:14:47 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353687285!31316130!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3ODY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4038 invoked from network); 23 Nov 2012 16:14:47 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-5.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 16:14:47 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="45479789"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 16:14:45 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 11:14:44 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1Tbvts-0003gQ-Es;
	Fri, 23 Nov 2012 16:14:44 +0000
Date: Fri, 23 Nov 2012 16:14:02 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1353686042.16973.19.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211231604470.13749@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
	<1353686042.16973.19.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 23 Nov 2012, Ian Campbell wrote:
> On Fri, 2012-11-23 at 15:45 +0000, Stefano Stabellini wrote:
> > The zImage format is extremely simple: it only consists of a magic
> > number and 2 addresses in a specific position (see
> > http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
> > 
> > Some bootloaders expect a zImage; considering that it doesn't cost us
> > much to build Xen compatible with the format, make it so.
> > 
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > 
> > 
> > diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> > index 25c4cfe..de9cdb2 100644
> > --- a/xen/arch/arm/head.S
> > +++ b/xen/arch/arm/head.S
> > @@ -22,6 +22,9 @@
> >  #include <asm/processor-ca15.h>
> >  #include <asm/asm_defns.h>
> >  
> > +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> > +#define XEN_PHYS_ADDRESS    0x80000000
> 
> This is platform specific. AIUI you can put 0 in the field and the boot
> loader is expected to do something sensible, although that might require
> a new enough bootloader (FSVO new enough).

It is expected to work with bootloaders other than U-Boot?  My guess is
that it could work with U-Boot, because it uses its own format on top of
zImage, but that it won't probably work with anything else, for example
UEFI/arm, that at the moment seems to support only zImage.


> If that doesn't work then this constant is actually in
> xen/arch/arm/Makefile too and for the same reason:
>         # XXX: VE model loads by VMA so instead of
>         # making a proper ELF we link with LMA == VMA and adjust crudely
>         $(OBJCOPY) --change-addresses +0x80000000 $< $@
>         $(STRIP) $@
> 
> How about making this CONFIG_PHYSICAL_LOCAL_ADDR and plumbing through
> like we do with CONFIG_DTB_FILE?

Yeah, I was thinking about that.
However in this case we would want to set the default somewhere, rather
than forcing the user to specify it.
Also we would need to export CONFIG_PHYSICAL_LOCAL_ADDR to a generated
header file somewhere. Do you have any suggestions on where?

> > +
> >  #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
> >  #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
> >  #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
> > @@ -52,6 +55,18 @@
> >  	 * or the initial pagetable code below will need adjustment. */
> >  	.global start
> >  start:
> > +
> > +	.rept	7
> > +	mov	r0, r0
> > +	.endr
> > +	mov	r0, r0
> > +	b	1f
> > +
> > +	.word	ZIMAGE_MAGIC_NUMBER				@ Magic numbers to help the loader
> > +	.word	(_start + XEN_PHYS_ADDRESS)		@ absolute load/run zImage address
> 
> Wacky spaces?

No, they are all tabs, that's why they look out of place here

> 
> > +	.word	(_end + XEN_PHYS_ADDRESS)		@ zImage end address
> > +
> > +1:
> >  	cpsid aif                    /* Disable all interrupts */
> >  
> >  	/* Save the bootloader arguments in less-clobberable registers */
> 
> 
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:15:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:15:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbvty-0002Rb-G1; Fri, 23 Nov 2012 16:14:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1Tbvtw-0002RW-FT
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:14:48 +0000
Received: from [85.158.138.51:52503] by server-8.bemta-3.messagelabs.com id
	8B/8F-07786-7F0AFA05; Fri, 23 Nov 2012 16:14:47 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353687285!31316130!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3ODY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4038 invoked from network); 23 Nov 2012 16:14:47 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-5.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 16:14:47 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="45479789"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 16:14:45 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 11:14:44 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1Tbvts-0003gQ-Es;
	Fri, 23 Nov 2012 16:14:44 +0000
Date: Fri, 23 Nov 2012 16:14:02 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1353686042.16973.19.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211231604470.13749@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
	<1353686042.16973.19.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 23 Nov 2012, Ian Campbell wrote:
> On Fri, 2012-11-23 at 15:45 +0000, Stefano Stabellini wrote:
> > The zImage format is extremely simple: it only consists of a magic
> > number and 2 addresses in a specific position (see
> > http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
> > 
> > Some bootloaders expect a zImage; considering that it doesn't cost us
> > much to build Xen compatible with the format, make it so.
> > 
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > 
> > 
> > diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> > index 25c4cfe..de9cdb2 100644
> > --- a/xen/arch/arm/head.S
> > +++ b/xen/arch/arm/head.S
> > @@ -22,6 +22,9 @@
> >  #include <asm/processor-ca15.h>
> >  #include <asm/asm_defns.h>
> >  
> > +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> > +#define XEN_PHYS_ADDRESS    0x80000000
> 
> This is platform specific. AIUI you can put 0 in the field and the boot
> loader is expected to do something sensible, although that might require
> a new enough bootloader (FSVO new enough).

It is expected to work with bootloaders other than U-Boot?  My guess is
that it could work with U-Boot, because it uses its own format on top of
zImage, but that it won't probably work with anything else, for example
UEFI/arm, that at the moment seems to support only zImage.


> If that doesn't work then this constant is actually in
> xen/arch/arm/Makefile too and for the same reason:
>         # XXX: VE model loads by VMA so instead of
>         # making a proper ELF we link with LMA == VMA and adjust crudely
>         $(OBJCOPY) --change-addresses +0x80000000 $< $@
>         $(STRIP) $@
> 
> How about making this CONFIG_PHYSICAL_LOCAL_ADDR and plumbing through
> like we do with CONFIG_DTB_FILE?

Yeah, I was thinking about that.
However in this case we would want to set the default somewhere, rather
than forcing the user to specify it.
Also we would need to export CONFIG_PHYSICAL_LOCAL_ADDR to a generated
header file somewhere. Do you have any suggestions on where?

> > +
> >  #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
> >  #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
> >  #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
> > @@ -52,6 +55,18 @@
> >  	 * or the initial pagetable code below will need adjustment. */
> >  	.global start
> >  start:
> > +
> > +	.rept	7
> > +	mov	r0, r0
> > +	.endr
> > +	mov	r0, r0
> > +	b	1f
> > +
> > +	.word	ZIMAGE_MAGIC_NUMBER				@ Magic numbers to help the loader
> > +	.word	(_start + XEN_PHYS_ADDRESS)		@ absolute load/run zImage address
> 
> Wacky spaces?

No, they are all tabs, that's why they look out of place here

> 
> > +	.word	(_end + XEN_PHYS_ADDRESS)		@ zImage end address
> > +
> > +1:
> >  	cpsid aif                    /* Disable all interrupts */
> >  
> >  	/* Save the bootloader arguments in less-clobberable registers */
> 
> 
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:16:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:16:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbvv0-0002VQ-Vp; Fri, 23 Nov 2012 16:15:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1Tbvuz-0002VE-OR
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 16:15:53 +0000
Received: from [85.158.139.83:35214] by server-12.bemta-5.messagelabs.com id
	73/06-02886-831AFA05; Fri, 23 Nov 2012 16:15:52 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-9.tower-182.messagelabs.com!1353687351!30930498!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22979 invoked from network); 23 Nov 2012 16:15:51 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-9.tower-182.messagelabs.com with SMTP;
	23 Nov 2012 16:15:51 -0000
X-TM-IMSS-Message-ID: <0fa8d3e300011be5@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 0fa8d3e300011be5 ;
	Fri, 23 Nov 2012 11:14:56 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qANGFk2Q025172; 
	Fri, 23 Nov 2012 11:15:46 -0500
Message-ID: <50AFA132.5020904@tycho.nsa.gov>
Date: Fri, 23 Nov 2012 11:15:46 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
	<1353668646.13542.228.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353668646.13542.228.camel@zakaz.uk.xensource.com>
Cc: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/23/2012 06:04 AM, Ian Campbell wrote:
> On Tue, 2012-11-20 at 16:16 +0000, Fioravante, Matthew E. wrote:
>> This was something I've been wanting to do for a while so I'm very
>> happy you went ahead and fixed it yourself. Once you submit the linux
>> version I'll test it on my system.
>>
>> Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> 
> Do we need to synchronise with anything else (Linux drivers?) or I can I
> just throw this into the tree once it is done?

I think the only Linux drivers are the ones that were just posted, and the
ones for XenLinux 2.6.18. Assuming the modified Linux module that I posted
works as it should, the v2 version will be the only one upstream.

> Are we hanging any existing users of the tpm stuff out to dry? Could we
> get a feature-protocol-v2 flag in xenstore so users at least get an
> error message from either the front or backend to give a hint why it
> isn't working?

I suppose we could do that, although I'm not sure the "feature-" prefix is
appropriate, since the code doesn't have the ability to fall back to v1.

>>  void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)  {
>> -   tpmif_tx_request_t* tx;
>> -   int offset;
>> -   int i;
>> -   uint32_t domid;
>> -   int tocopy;
>> +   vtpm_shared_page_t* shr;
>> +   unsigned int offset;
>>     int flags;
>> +#ifdef TPMBACK_PRINT_DEBUG
>> +int i;
>> +#endif
> 
> Dodgy indentation? (I saw a bunch of these)

Whoops, I'll have to go fix that. The entire mini-os build is sprinkled with
tabs and spaces mostly at random, so perhaps a generic fix-indent patch is
needed after all the real changes are applied.
 
>> - * Copyright (c) 2005, IBM Corporation
>> - *
>> - * Author: Stefan Berger, stefanb@us.ibm.com
>> - * Grant table support: Mahadevan Gomathisankaran
> 
> Did you really remove everything these guys wrote?

>From this file, yes - unless the #ifndef and header/footer comments count, but
I was under the impression that that is too small to count for copyright, and
is duplicated across the other files in that directory anyway.
 
>> - * This code has been derived from tools/libxc/xen/io/netif.h
>> - *
>> - * Copyright (c) 2003-2004, Keir Fraser
> 
> I guess I can buy this bit no longer being true given that you reworked
> the whole protocol.
> 
> Ian

Basically, the file is a rewrite, although not detected by git/hg as such. I can
add an authorship line if that would be helpful (I see that's normal in other
header files).

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:16:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:16:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbvv0-0002VQ-Vp; Fri, 23 Nov 2012 16:15:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1Tbvuz-0002VE-OR
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 16:15:53 +0000
Received: from [85.158.139.83:35214] by server-12.bemta-5.messagelabs.com id
	73/06-02886-831AFA05; Fri, 23 Nov 2012 16:15:52 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-9.tower-182.messagelabs.com!1353687351!30930498!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22979 invoked from network); 23 Nov 2012 16:15:51 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-9.tower-182.messagelabs.com with SMTP;
	23 Nov 2012 16:15:51 -0000
X-TM-IMSS-Message-ID: <0fa8d3e300011be5@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 0fa8d3e300011be5 ;
	Fri, 23 Nov 2012 11:14:56 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qANGFk2Q025172; 
	Fri, 23 Nov 2012 11:15:46 -0500
Message-ID: <50AFA132.5020904@tycho.nsa.gov>
Date: Fri, 23 Nov 2012 11:15:46 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
	<1353668646.13542.228.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353668646.13542.228.camel@zakaz.uk.xensource.com>
Cc: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/23/2012 06:04 AM, Ian Campbell wrote:
> On Tue, 2012-11-20 at 16:16 +0000, Fioravante, Matthew E. wrote:
>> This was something I've been wanting to do for a while so I'm very
>> happy you went ahead and fixed it yourself. Once you submit the linux
>> version I'll test it on my system.
>>
>> Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> 
> Do we need to synchronise with anything else (Linux drivers?) or I can I
> just throw this into the tree once it is done?

I think the only Linux drivers are the ones that were just posted, and the
ones for XenLinux 2.6.18. Assuming the modified Linux module that I posted
works as it should, the v2 version will be the only one upstream.

> Are we hanging any existing users of the tpm stuff out to dry? Could we
> get a feature-protocol-v2 flag in xenstore so users at least get an
> error message from either the front or backend to give a hint why it
> isn't working?

I suppose we could do that, although I'm not sure the "feature-" prefix is
appropriate, since the code doesn't have the ability to fall back to v1.

>>  void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)  {
>> -   tpmif_tx_request_t* tx;
>> -   int offset;
>> -   int i;
>> -   uint32_t domid;
>> -   int tocopy;
>> +   vtpm_shared_page_t* shr;
>> +   unsigned int offset;
>>     int flags;
>> +#ifdef TPMBACK_PRINT_DEBUG
>> +int i;
>> +#endif
> 
> Dodgy indentation? (I saw a bunch of these)

Whoops, I'll have to go fix that. The entire mini-os build is sprinkled with
tabs and spaces mostly at random, so perhaps a generic fix-indent patch is
needed after all the real changes are applied.
 
>> - * Copyright (c) 2005, IBM Corporation
>> - *
>> - * Author: Stefan Berger, stefanb@us.ibm.com
>> - * Grant table support: Mahadevan Gomathisankaran
> 
> Did you really remove everything these guys wrote?

>From this file, yes - unless the #ifndef and header/footer comments count, but
I was under the impression that that is too small to count for copyright, and
is duplicated across the other files in that directory anyway.
 
>> - * This code has been derived from tools/libxc/xen/io/netif.h
>> - *
>> - * Copyright (c) 2003-2004, Keir Fraser
> 
> I guess I can buy this bit no longer being true given that you reworked
> the whole protocol.
> 
> Ian

Basically, the file is a rewrite, although not detected by git/hg as such. I can
add an authorship line if that would be helpful (I see that's normal in other
header files).

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:22:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:22:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbw1P-0002va-Ra; Fri, 23 Nov 2012 16:22:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Tbw1P-0002vT-34
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:22:31 +0000
Received: from [193.109.254.147:47858] by server-14.bemta-14.messagelabs.com
	id 46/E8-14517-6C2AFA05; Fri, 23 Nov 2012 16:22:30 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353687749!12123503!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20760 invoked from network); 23 Nov 2012 16:22:29 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-3.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 16:22:29 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Tbw1L-0000Bq-Oa; Fri, 23 Nov 2012 16:22:27 +0000
Date: Fri, 23 Nov 2012 16:22:27 +0000
From: Tim Deegan <tim@xen.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121123162227.GA97222@ocelot.phlegethon.org>
References: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Anthony Perard <anthony.perard@citrix.com>, xen-devel@lists.xensource.com,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

At 15:45 +0000 on 23 Nov (1353685528), Stefano Stabellini wrote:
> diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> index 25c4cfe..de9cdb2 100644
> --- a/xen/arch/arm/head.S
> +++ b/xen/arch/arm/head.S
> @@ -22,6 +22,9 @@
>  #include <asm/processor-ca15.h>
>  #include <asm/asm_defns.h>
>  
> +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> +#define XEN_PHYS_ADDRESS    0x80000000

That's a platform-specific constant.  I guess if bootloaders require it
to be baked into the image, we have no choice, but I think it should live
in config.h alongside the equivalent magic for other hardware addresses.

Also, it should probably be called XEN_LOAD_ADDRESS or ZIMAGE_LOAD_ADDRESS
to stop people thinking they can use it for v<->p translations.

> +
>  #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
>  #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
>  #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
> @@ -52,6 +55,18 @@
>  	 * or the initial pagetable code below will need adjustment. */
>  	.global start
>  start:
> +
> +	.rept	7
> +	mov	r0, r0
> +	.endr
> +	mov	r0, r0
> +	b	1f

Please comment this, and align it with the rest of the file (operands
aligned using spaces, 6 chars to the right of the instruction).

Does zImage require these to be nops or could we just start with 
'b real_start ; .skip 32'?

> +	.word	ZIMAGE_MAGIC_NUMBER				@ Magic numbers to help the loader

Please use C-style comments and stick to <80 characters.

> +	.word	(_start + XEN_PHYS_ADDRESS)		@ absolute load/run zImage address

Surely just (XEN_PHYS_ADDRESS).  Or is XEN_PHYS_ADDRESS actually an offset?

> +	.word	(_end + XEN_PHYS_ADDRESS)		@ zImage end address
> +
> +1:

I think this deserves a real label. :)

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:22:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:22:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbw1P-0002va-Ra; Fri, 23 Nov 2012 16:22:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Tbw1P-0002vT-34
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:22:31 +0000
Received: from [193.109.254.147:47858] by server-14.bemta-14.messagelabs.com
	id 46/E8-14517-6C2AFA05; Fri, 23 Nov 2012 16:22:30 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353687749!12123503!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20760 invoked from network); 23 Nov 2012 16:22:29 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-3.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 16:22:29 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Tbw1L-0000Bq-Oa; Fri, 23 Nov 2012 16:22:27 +0000
Date: Fri, 23 Nov 2012 16:22:27 +0000
From: Tim Deegan <tim@xen.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121123162227.GA97222@ocelot.phlegethon.org>
References: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Anthony Perard <anthony.perard@citrix.com>, xen-devel@lists.xensource.com,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

At 15:45 +0000 on 23 Nov (1353685528), Stefano Stabellini wrote:
> diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> index 25c4cfe..de9cdb2 100644
> --- a/xen/arch/arm/head.S
> +++ b/xen/arch/arm/head.S
> @@ -22,6 +22,9 @@
>  #include <asm/processor-ca15.h>
>  #include <asm/asm_defns.h>
>  
> +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> +#define XEN_PHYS_ADDRESS    0x80000000

That's a platform-specific constant.  I guess if bootloaders require it
to be baked into the image, we have no choice, but I think it should live
in config.h alongside the equivalent magic for other hardware addresses.

Also, it should probably be called XEN_LOAD_ADDRESS or ZIMAGE_LOAD_ADDRESS
to stop people thinking they can use it for v<->p translations.

> +
>  #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
>  #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
>  #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
> @@ -52,6 +55,18 @@
>  	 * or the initial pagetable code below will need adjustment. */
>  	.global start
>  start:
> +
> +	.rept	7
> +	mov	r0, r0
> +	.endr
> +	mov	r0, r0
> +	b	1f

Please comment this, and align it with the rest of the file (operands
aligned using spaces, 6 chars to the right of the instruction).

Does zImage require these to be nops or could we just start with 
'b real_start ; .skip 32'?

> +	.word	ZIMAGE_MAGIC_NUMBER				@ Magic numbers to help the loader

Please use C-style comments and stick to <80 characters.

> +	.word	(_start + XEN_PHYS_ADDRESS)		@ absolute load/run zImage address

Surely just (XEN_PHYS_ADDRESS).  Or is XEN_PHYS_ADDRESS actually an offset?

> +	.word	(_end + XEN_PHYS_ADDRESS)		@ zImage end address
> +
> +1:

I think this deserves a real label. :)

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:26:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:26:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbw51-00032K-GB; Fri, 23 Nov 2012 16:26:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1Tbw4z-00032F-UA
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:26:14 +0000
Received: from [85.158.139.83:20470] by server-10.bemta-5.messagelabs.com id
	11/C5-09257-5A3AFA05; Fri, 23 Nov 2012 16:26:13 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1353687970!31649961!1
X-Originating-IP: [209.85.212.43]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_20_30,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4075 invoked from network); 23 Nov 2012 16:26:11 -0000
Received: from mail-vb0-f43.google.com (HELO mail-vb0-f43.google.com)
	(209.85.212.43)
	by server-3.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 16:26:11 -0000
Received: by mail-vb0-f43.google.com with SMTP id fn1so7674199vbb.30
	for <xen-devel@lists.xensource.com>;
	Fri, 23 Nov 2012 08:26:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=1WpUnsepmyqkP5u1zNEg4cGswZVp9GNvmo9FcqqO8K0=;
	b=YHhKFvkHA3RKsKrmCaIT/+rwKIlqYV7r+FNr1ILMWRMItMwwyGt2S41iHkACmMOPkm
	zMkRry5hDflN+g8+k5HHNuZd1nS0miXg7TdDA2czx3Wx9+EMpwX6l7j0pVK6OiCrD1Ep
	4vWqCcXsuX9vb0W0wj4U57TF1hRQVCclJx0+eMBFDZyQqvzkrlWa6qReHtv+xwfotczX
	AyZ5yrCGp9v2aFrW2GJs93/UBOeaN8GFF9UrQ942J2FRmQ6hq9ZNWu+FGOzIk0uyR5H/
	C/m8WDikCNTGrZ3VoEK/9/qVNdP/KSejaChK5lGlB0tgp4cfyyNAiirlBc6inubBzCfB
	Z3jA==
MIME-Version: 1.0
Received: by 10.58.198.135 with SMTP id jc7mr6686048vec.51.1353687970154; Fri,
	23 Nov 2012 08:26:10 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Fri, 23 Nov 2012 08:26:10 -0800 (PST)
In-Reply-To: <d3378692eece3e552ba2.1353630328@ljsromley.bj.intel.com>
References: <d3378692eece3e552ba2.1353630328@ljsromley.bj.intel.com>
Date: Fri, 23 Nov 2012 16:26:10 +0000
X-Google-Sender-Auth: Q1a_Sy7KQJELYyW0yREOclsXbfk
Message-ID: <CAFLBxZZ_W5PMLYiqEwdrpqkjgiMN9NoN2f33ErLriOwNOD9GgA@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Liu Jinsong <jinsong.liu@intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1703029823287295917=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============1703029823287295917==
Content-Type: multipart/alternative; boundary=047d7b5d8cd79907f104cf2c0af7

--047d7b5d8cd79907f104cf2c0af7
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Nov 23, 2012 at 12:25 AM, Liu Jinsong <jinsong.liu@intel.com> wrote:

> This patch handles broken page wrt migration. Generally there are below
> cases:
> 1. broken page occurs before migration
> 2. broken page occurs during migration
>   2.1 broken page occurs during migration but not at the last iteration
>   2.2 broken page occurs at the last iteration of migration
>
> For case 1, at the sender the broken page will be mapped but not copied
>   to target (otherwise it may trigger more serious error, say, SRAR error).
>   While its pfn_type and pfn number will be transferred to target so that
>   target take appropriate action.
>
> For case 2.1, at the sender mce handler marks the broken page to dirty
>   bitmap, so that at next iteration, its pfn_type and pfn number will be
>   transferred to the target and then take appropriate action.
>
> For case 2.2, at the sender it adds a check to see if vMCE occurs at the
>   last iteration. If yes, it will do more iteration(s) so that the broken
>   page's pfn_type and pfn number will be transferred to target.
>   Another point is, if guest save to disk and during which vMCE occurs,
>   it also need do more iteration(s).
>
> For all cases at the target (if migration not aborted by vMCE):
>   Target will populates pages for guest. As for the case of broken page,
>   we prefer to keep the type of the page for the sake of seamless
> migration.
>   Target will set p2m as p2m_ram_broken for broken page. If guest access
>   the broken page again it will kill itself as expected.
>
> All above description is based on the assumption that migration will
> success.
> However, for case 2 there are scenario that may result in guest or
> hypervisor
> crash. When pfn_type detecting fail to get p2m_ram_broken (vMCE occur
> after the
> detecting) and read the broken page, guest/hypervisor may survive or crash,
> depending on error nature and how guest/hypervisor handle it. If
> guest/hypervisor
> survive, migration is OK since it will transfer pfn_type to the target at
> next
> iter and then prevent further harm at target. If guest/hypervisor crash it
> definitely needn't care migration any more. Unfortunately we have no way to
> predict it, so what we can do is to do the best to handle it, after all we
> cannot forbid migration for fear that it may crash guest/hypervisor.
>
> Patch version history:
> V4:
>   - adjust variables and patch description based on feedback
> V3:
>   - handle pages broken at the last iteration
> V2:
>   - migrate continue when broken page occur during migration,
>     via marking broken page to dirty bitmap
> V1:
>   - migration abort when broken page occur during migration
>   - transfer pfn_type to target for broken page occur before migration
>
> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
>

Technically, since you changed part of the code I acked, you should have
removed this ack.  But now I've read the patch:

Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

Thanks Jinsong!

--047d7b5d8cd79907f104cf2c0af7
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 23, 2012 at 12:25 AM, Liu Jinsong <span dir=3D"ltr">&lt;<a href=
=3D"mailto:jinsong.liu@intel.com" target=3D"_blank">jinsong.liu@intel.com</=
a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_quot=
e"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left=
:1px #ccc solid;padding-left:1ex">
This patch handles broken page wrt migration. Generally there are below cas=
es:<br>
<div class=3D"im">1. broken page occurs before migration<br>
2. broken page occurs during migration<br>
</div>=A0 2.1 broken page occurs during migration but not at the last itera=
tion<br>
=A0 2.2 broken page occurs at the last iteration of migration<br>
<br>
For case 1, at the sender the broken page will be mapped but not copied<br>
<div class=3D"im">=A0 to target (otherwise it may trigger more serious erro=
r, say, SRAR error).<br>
=A0 While its pfn_type and pfn number will be transferred to target so that=
<br>
=A0 target take appropriate action.<br>
<br>
</div>For case 2.1, at the sender mce handler marks the broken page to dirt=
y<br>
=A0 bitmap, so that at next iteration, its pfn_type and pfn number will be<=
br>
=A0 transferred to the target and then take appropriate action.<br>
<br>
For case 2.2, at the sender it adds a check to see if vMCE occurs at the<br=
>
=A0 last iteration. If yes, it will do more iteration(s) so that the broken=
<br>
=A0 page&#39;s pfn_type and pfn number will be transferred to target.<br>
=A0 Another point is, if guest save to disk and during which vMCE occurs,<b=
r>
=A0 it also need do more iteration(s).<br>
<br>
For all cases at the target (if migration not aborted by vMCE):<br>
=A0 Target will populates pages for guest. As for the case of broken page,<=
br>
=A0 we prefer to keep the type of the page for the sake of seamless migrati=
on.<br>
=A0 Target will set p2m as p2m_ram_broken for broken page. If guest access<=
br>
<div class=3D"im">=A0 the broken page again it will kill itself as expected=
.<br>
<br>
</div>All above description is based on the assumption that migration will =
success.<br>
However, for case 2 there are scenario that may result in guest or hypervis=
or<br>
crash. When pfn_type detecting fail to get p2m_ram_broken (vMCE occur after=
 the<br>
detecting) and read the broken page, guest/hypervisor may survive or crash,=
<br>
depending on error nature and how guest/hypervisor handle it. If guest/hype=
rvisor<br>
survive, migration is OK since it will transfer pfn_type to the target at n=
ext<br>
iter and then prevent further harm at target. If guest/hypervisor crash it<=
br>
definitely needn&#39;t care migration any more. Unfortunately we have no wa=
y to<br>
predict it, so what we can do is to do the best to handle it, after all we<=
br>
cannot forbid migration for fear that it may crash guest/hypervisor.<br>
<br>
Patch version history:<br>
V4:<br>
=A0 - adjust variables and patch description based on feedback<br>
V3:<br>
=A0 - handle pages broken at the last iteration<br>
V2:<br>
=A0 - migrate continue when broken page occur during migration,<br>
=A0 =A0 via marking broken page to dirty bitmap<br>
V1:<br>
=A0 - migration abort when broken page occur during migration<br>
=A0 - transfer pfn_type to target for broken page occur before migration<br=
>
<div class=3D"im"><br>
Suggested-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.c=
om">george.dunlap@eu.citrix.com</a>&gt;<br>
Signed-off-by: Liu Jinsong &lt;<a href=3D"mailto:jinsong.liu@intel.com">jin=
song.liu@intel.com</a>&gt;<br>
Acked-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">=
george.dunlap@eu.citrix.com</a>&gt;<br></div></blockquote><div><br>Technica=
lly, since you changed part of the code I acked, you should have removed th=
is ack.=A0 But now I&#39;ve read the patch:<br>
<br>Acked-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.c=
om">george.dunlap@eu.citrix.com</a>&gt;<br><br>Thanks Jinsong! <br></div><b=
r></div><br></div>

--047d7b5d8cd79907f104cf2c0af7--


--===============1703029823287295917==
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.xen.org
http://lists.xen.org/xen-devel

--===============1703029823287295917==--


From xen-devel-bounces@lists.xen.org Fri Nov 23 16:26:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:26:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbw51-00032K-GB; Fri, 23 Nov 2012 16:26:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1Tbw4z-00032F-UA
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:26:14 +0000
Received: from [85.158.139.83:20470] by server-10.bemta-5.messagelabs.com id
	11/C5-09257-5A3AFA05; Fri, 23 Nov 2012 16:26:13 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1353687970!31649961!1
X-Originating-IP: [209.85.212.43]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_20_30,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4075 invoked from network); 23 Nov 2012 16:26:11 -0000
Received: from mail-vb0-f43.google.com (HELO mail-vb0-f43.google.com)
	(209.85.212.43)
	by server-3.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 16:26:11 -0000
Received: by mail-vb0-f43.google.com with SMTP id fn1so7674199vbb.30
	for <xen-devel@lists.xensource.com>;
	Fri, 23 Nov 2012 08:26:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=1WpUnsepmyqkP5u1zNEg4cGswZVp9GNvmo9FcqqO8K0=;
	b=YHhKFvkHA3RKsKrmCaIT/+rwKIlqYV7r+FNr1ILMWRMItMwwyGt2S41iHkACmMOPkm
	zMkRry5hDflN+g8+k5HHNuZd1nS0miXg7TdDA2czx3Wx9+EMpwX6l7j0pVK6OiCrD1Ep
	4vWqCcXsuX9vb0W0wj4U57TF1hRQVCclJx0+eMBFDZyQqvzkrlWa6qReHtv+xwfotczX
	AyZ5yrCGp9v2aFrW2GJs93/UBOeaN8GFF9UrQ942J2FRmQ6hq9ZNWu+FGOzIk0uyR5H/
	C/m8WDikCNTGrZ3VoEK/9/qVNdP/KSejaChK5lGlB0tgp4cfyyNAiirlBc6inubBzCfB
	Z3jA==
MIME-Version: 1.0
Received: by 10.58.198.135 with SMTP id jc7mr6686048vec.51.1353687970154; Fri,
	23 Nov 2012 08:26:10 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Fri, 23 Nov 2012 08:26:10 -0800 (PST)
In-Reply-To: <d3378692eece3e552ba2.1353630328@ljsromley.bj.intel.com>
References: <d3378692eece3e552ba2.1353630328@ljsromley.bj.intel.com>
Date: Fri, 23 Nov 2012 16:26:10 +0000
X-Google-Sender-Auth: Q1a_Sy7KQJELYyW0yREOclsXbfk
Message-ID: <CAFLBxZZ_W5PMLYiqEwdrpqkjgiMN9NoN2f33ErLriOwNOD9GgA@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Liu Jinsong <jinsong.liu@intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1703029823287295917=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============1703029823287295917==
Content-Type: multipart/alternative; boundary=047d7b5d8cd79907f104cf2c0af7

--047d7b5d8cd79907f104cf2c0af7
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Nov 23, 2012 at 12:25 AM, Liu Jinsong <jinsong.liu@intel.com> wrote:

> This patch handles broken page wrt migration. Generally there are below
> cases:
> 1. broken page occurs before migration
> 2. broken page occurs during migration
>   2.1 broken page occurs during migration but not at the last iteration
>   2.2 broken page occurs at the last iteration of migration
>
> For case 1, at the sender the broken page will be mapped but not copied
>   to target (otherwise it may trigger more serious error, say, SRAR error).
>   While its pfn_type and pfn number will be transferred to target so that
>   target take appropriate action.
>
> For case 2.1, at the sender mce handler marks the broken page to dirty
>   bitmap, so that at next iteration, its pfn_type and pfn number will be
>   transferred to the target and then take appropriate action.
>
> For case 2.2, at the sender it adds a check to see if vMCE occurs at the
>   last iteration. If yes, it will do more iteration(s) so that the broken
>   page's pfn_type and pfn number will be transferred to target.
>   Another point is, if guest save to disk and during which vMCE occurs,
>   it also need do more iteration(s).
>
> For all cases at the target (if migration not aborted by vMCE):
>   Target will populates pages for guest. As for the case of broken page,
>   we prefer to keep the type of the page for the sake of seamless
> migration.
>   Target will set p2m as p2m_ram_broken for broken page. If guest access
>   the broken page again it will kill itself as expected.
>
> All above description is based on the assumption that migration will
> success.
> However, for case 2 there are scenario that may result in guest or
> hypervisor
> crash. When pfn_type detecting fail to get p2m_ram_broken (vMCE occur
> after the
> detecting) and read the broken page, guest/hypervisor may survive or crash,
> depending on error nature and how guest/hypervisor handle it. If
> guest/hypervisor
> survive, migration is OK since it will transfer pfn_type to the target at
> next
> iter and then prevent further harm at target. If guest/hypervisor crash it
> definitely needn't care migration any more. Unfortunately we have no way to
> predict it, so what we can do is to do the best to handle it, after all we
> cannot forbid migration for fear that it may crash guest/hypervisor.
>
> Patch version history:
> V4:
>   - adjust variables and patch description based on feedback
> V3:
>   - handle pages broken at the last iteration
> V2:
>   - migrate continue when broken page occur during migration,
>     via marking broken page to dirty bitmap
> V1:
>   - migration abort when broken page occur during migration
>   - transfer pfn_type to target for broken page occur before migration
>
> Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
>

Technically, since you changed part of the code I acked, you should have
removed this ack.  But now I've read the patch:

Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

Thanks Jinsong!

--047d7b5d8cd79907f104cf2c0af7
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 23, 2012 at 12:25 AM, Liu Jinsong <span dir=3D"ltr">&lt;<a href=
=3D"mailto:jinsong.liu@intel.com" target=3D"_blank">jinsong.liu@intel.com</=
a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_quot=
e"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left=
:1px #ccc solid;padding-left:1ex">
This patch handles broken page wrt migration. Generally there are below cas=
es:<br>
<div class=3D"im">1. broken page occurs before migration<br>
2. broken page occurs during migration<br>
</div>=A0 2.1 broken page occurs during migration but not at the last itera=
tion<br>
=A0 2.2 broken page occurs at the last iteration of migration<br>
<br>
For case 1, at the sender the broken page will be mapped but not copied<br>
<div class=3D"im">=A0 to target (otherwise it may trigger more serious erro=
r, say, SRAR error).<br>
=A0 While its pfn_type and pfn number will be transferred to target so that=
<br>
=A0 target take appropriate action.<br>
<br>
</div>For case 2.1, at the sender mce handler marks the broken page to dirt=
y<br>
=A0 bitmap, so that at next iteration, its pfn_type and pfn number will be<=
br>
=A0 transferred to the target and then take appropriate action.<br>
<br>
For case 2.2, at the sender it adds a check to see if vMCE occurs at the<br=
>
=A0 last iteration. If yes, it will do more iteration(s) so that the broken=
<br>
=A0 page&#39;s pfn_type and pfn number will be transferred to target.<br>
=A0 Another point is, if guest save to disk and during which vMCE occurs,<b=
r>
=A0 it also need do more iteration(s).<br>
<br>
For all cases at the target (if migration not aborted by vMCE):<br>
=A0 Target will populates pages for guest. As for the case of broken page,<=
br>
=A0 we prefer to keep the type of the page for the sake of seamless migrati=
on.<br>
=A0 Target will set p2m as p2m_ram_broken for broken page. If guest access<=
br>
<div class=3D"im">=A0 the broken page again it will kill itself as expected=
.<br>
<br>
</div>All above description is based on the assumption that migration will =
success.<br>
However, for case 2 there are scenario that may result in guest or hypervis=
or<br>
crash. When pfn_type detecting fail to get p2m_ram_broken (vMCE occur after=
 the<br>
detecting) and read the broken page, guest/hypervisor may survive or crash,=
<br>
depending on error nature and how guest/hypervisor handle it. If guest/hype=
rvisor<br>
survive, migration is OK since it will transfer pfn_type to the target at n=
ext<br>
iter and then prevent further harm at target. If guest/hypervisor crash it<=
br>
definitely needn&#39;t care migration any more. Unfortunately we have no wa=
y to<br>
predict it, so what we can do is to do the best to handle it, after all we<=
br>
cannot forbid migration for fear that it may crash guest/hypervisor.<br>
<br>
Patch version history:<br>
V4:<br>
=A0 - adjust variables and patch description based on feedback<br>
V3:<br>
=A0 - handle pages broken at the last iteration<br>
V2:<br>
=A0 - migrate continue when broken page occur during migration,<br>
=A0 =A0 via marking broken page to dirty bitmap<br>
V1:<br>
=A0 - migration abort when broken page occur during migration<br>
=A0 - transfer pfn_type to target for broken page occur before migration<br=
>
<div class=3D"im"><br>
Suggested-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.c=
om">george.dunlap@eu.citrix.com</a>&gt;<br>
Signed-off-by: Liu Jinsong &lt;<a href=3D"mailto:jinsong.liu@intel.com">jin=
song.liu@intel.com</a>&gt;<br>
Acked-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">=
george.dunlap@eu.citrix.com</a>&gt;<br></div></blockquote><div><br>Technica=
lly, since you changed part of the code I acked, you should have removed th=
is ack.=A0 But now I&#39;ve read the patch:<br>
<br>Acked-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.c=
om">george.dunlap@eu.citrix.com</a>&gt;<br><br>Thanks Jinsong! <br></div><b=
r></div><br></div>

--047d7b5d8cd79907f104cf2c0af7--


--===============1703029823287295917==
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.xen.org
http://lists.xen.org/xen-devel

--===============1703029823287295917==--


From xen-devel-bounces@lists.xen.org Fri Nov 23 16:26:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:26:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbw5N-00034L-1o; Fri, 23 Nov 2012 16:26:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbw5L-000347-Va
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:26:36 +0000
Received: from [85.158.143.99:64846] by server-2.bemta-4.messagelabs.com id
	5C/01-28922-BB3AFA05; Fri, 23 Nov 2012 16:26:35 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1353687993!27755966!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 676 invoked from network); 23 Nov 2012 16:26:34 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 16:26:34 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15978592"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 16:26:33 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 16:26:33 +0000
Message-ID: <1353687991.16973.26.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Fri, 23 Nov 2012 16:26:31 +0000
In-Reply-To: <alpine.DEB.2.02.1211231604470.13749@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
	<1353686042.16973.19.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211231604470.13749@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 16:14 +0000, Stefano Stabellini wrote:
> On Fri, 23 Nov 2012, Ian Campbell wrote:
> > On Fri, 2012-11-23 at 15:45 +0000, Stefano Stabellini wrote:
> > > The zImage format is extremely simple: it only consists of a magic
> > > number and 2 addresses in a specific position (see
> > > http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
> > > 
> > > Some bootloaders expect a zImage; considering that it doesn't cost us
> > > much to build Xen compatible with the format, make it so.
> > > 
> > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > 
> > > 
> > > diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> > > index 25c4cfe..de9cdb2 100644
> > > --- a/xen/arch/arm/head.S
> > > +++ b/xen/arch/arm/head.S
> > > @@ -22,6 +22,9 @@
> > >  #include <asm/processor-ca15.h>
> > >  #include <asm/asm_defns.h>
> > >  
> > > +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> > > +#define XEN_PHYS_ADDRESS    0x80000000
> > 
> > This is platform specific. AIUI you can put 0 in the field and the boot
> > loader is expected to do something sensible, although that might require
> > a new enough bootloader (FSVO new enough).
> 
> It is expected to work with bootloaders other than U-Boot?  My guess is
> that it could work with U-Boot, because it uses its own format on top of
> zImage, but that it won't probably work with anything else, for example
> UEFI/arm, that at the moment seems to support only zImage.

I thought this was a feature of zImage not u-boot, u-boot has its own
header and ignores this field I think.

http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html
says:
        The start address is usually 0 as the zImage code is position
        independent.
        
Of course this has to be true in the modern multiplatform zImage world.

Looking at a random zImage:
        000000 e1a00000 e1a00000 e1a00000 e1a00000
        *
        000020 ea000002 016f2818 00000000 00220548
        
Where 016f2818 is the magic, 0 is the start and 220548 is the
end/length.

I knew I didn't imagine it ;-)

> > If that doesn't work then this constant is actually in
> > xen/arch/arm/Makefile too and for the same reason:
> >         # XXX: VE model loads by VMA so instead of
> >         # making a proper ELF we link with LMA == VMA and adjust crudely
> >         $(OBJCOPY) --change-addresses +0x80000000 $< $@
> >         $(STRIP) $@
> > 
> > How about making this CONFIG_PHYSICAL_LOCAL_ADDR and plumbing through
> > like we do with CONFIG_DTB_FILE?
> 
> Yeah, I was thinking about that.
> However in this case we would want to set the default somewhere, rather
> than forcing the user to specify it.
> Also we would need to export CONFIG_PHYSICAL_LOCAL_ADDR to a generated
> header file somewhere. Do you have any suggestions on where?

For the DTB we just do:
ifdef CONFIG_DTB_FILE
AFLAGS += -DCONFIG_DTB_FILE=\"$(CONFIG_DTB_FILE)\"
else
..

If indeed we need this then we should do it the same way, and probably
set the default == 0.

Ian


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:26:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:26:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbw5N-00034L-1o; Fri, 23 Nov 2012 16:26:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbw5L-000347-Va
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:26:36 +0000
Received: from [85.158.143.99:64846] by server-2.bemta-4.messagelabs.com id
	5C/01-28922-BB3AFA05; Fri, 23 Nov 2012 16:26:35 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1353687993!27755966!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 676 invoked from network); 23 Nov 2012 16:26:34 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 16:26:34 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15978592"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 16:26:33 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 16:26:33 +0000
Message-ID: <1353687991.16973.26.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Fri, 23 Nov 2012 16:26:31 +0000
In-Reply-To: <alpine.DEB.2.02.1211231604470.13749@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
	<1353686042.16973.19.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211231604470.13749@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 16:14 +0000, Stefano Stabellini wrote:
> On Fri, 23 Nov 2012, Ian Campbell wrote:
> > On Fri, 2012-11-23 at 15:45 +0000, Stefano Stabellini wrote:
> > > The zImage format is extremely simple: it only consists of a magic
> > > number and 2 addresses in a specific position (see
> > > http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
> > > 
> > > Some bootloaders expect a zImage; considering that it doesn't cost us
> > > much to build Xen compatible with the format, make it so.
> > > 
> > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > 
> > > 
> > > diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> > > index 25c4cfe..de9cdb2 100644
> > > --- a/xen/arch/arm/head.S
> > > +++ b/xen/arch/arm/head.S
> > > @@ -22,6 +22,9 @@
> > >  #include <asm/processor-ca15.h>
> > >  #include <asm/asm_defns.h>
> > >  
> > > +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> > > +#define XEN_PHYS_ADDRESS    0x80000000
> > 
> > This is platform specific. AIUI you can put 0 in the field and the boot
> > loader is expected to do something sensible, although that might require
> > a new enough bootloader (FSVO new enough).
> 
> It is expected to work with bootloaders other than U-Boot?  My guess is
> that it could work with U-Boot, because it uses its own format on top of
> zImage, but that it won't probably work with anything else, for example
> UEFI/arm, that at the moment seems to support only zImage.

I thought this was a feature of zImage not u-boot, u-boot has its own
header and ignores this field I think.

http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html
says:
        The start address is usually 0 as the zImage code is position
        independent.
        
Of course this has to be true in the modern multiplatform zImage world.

Looking at a random zImage:
        000000 e1a00000 e1a00000 e1a00000 e1a00000
        *
        000020 ea000002 016f2818 00000000 00220548
        
Where 016f2818 is the magic, 0 is the start and 220548 is the
end/length.

I knew I didn't imagine it ;-)

> > If that doesn't work then this constant is actually in
> > xen/arch/arm/Makefile too and for the same reason:
> >         # XXX: VE model loads by VMA so instead of
> >         # making a proper ELF we link with LMA == VMA and adjust crudely
> >         $(OBJCOPY) --change-addresses +0x80000000 $< $@
> >         $(STRIP) $@
> > 
> > How about making this CONFIG_PHYSICAL_LOCAL_ADDR and plumbing through
> > like we do with CONFIG_DTB_FILE?
> 
> Yeah, I was thinking about that.
> However in this case we would want to set the default somewhere, rather
> than forcing the user to specify it.
> Also we would need to export CONFIG_PHYSICAL_LOCAL_ADDR to a generated
> header file somewhere. Do you have any suggestions on where?

For the DTB we just do:
ifdef CONFIG_DTB_FILE
AFLAGS += -DCONFIG_DTB_FILE=\"$(CONFIG_DTB_FILE)\"
else
..

If indeed we need this then we should do it the same way, and probably
set the default == 0.

Ian


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:30:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:30:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbw90-0003L2-SF; Fri, 23 Nov 2012 16:30:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbw8z-0003Kx-Qo
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 16:30:22 +0000
Received: from [193.109.254.147:58437] by server-1.bemta-14.messagelabs.com id
	3A/96-25314-C94AFA05; Fri, 23 Nov 2012 16:30:20 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1353688219!10845668!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16279 invoked from network); 23 Nov 2012 16:30:19 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 16:30:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15978669"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 16:30:19 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 16:30:19 +0000
Message-ID: <1353688217.16973.29.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Date: Fri, 23 Nov 2012 16:30:17 +0000
In-Reply-To: <50AFA132.5020904@tycho.nsa.gov>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
	<1353668646.13542.228.camel@zakaz.uk.xensource.com>
	<50AFA132.5020904@tycho.nsa.gov>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 16:15 +0000, Daniel De Graaf wrote:
> On 11/23/2012 06:04 AM, Ian Campbell wrote:
> > On Tue, 2012-11-20 at 16:16 +0000, Fioravante, Matthew E. wrote:
> >> This was something I've been wanting to do for a while so I'm very
> >> happy you went ahead and fixed it yourself. Once you submit the linux
> >> version I'll test it on my system.
> >>
> >> Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> > 
> > Do we need to synchronise with anything else (Linux drivers?) or I can I
> > just throw this into the tree once it is done?
> 
> I think the only Linux drivers are the ones that were just posted, and the
> ones for XenLinux 2.6.18.

Which people might be using?

>  Assuming the modified Linux module that I posted
> works as it should, the v2 version will be the only one upstream.
> 
> > Are we hanging any existing users of the tpm stuff out to dry? Could we
> > get a feature-protocol-v2 flag in xenstore so users at least get an
> > error message from either the front or backend to give a hint why it
> > isn't working?
> 
> I suppose we could do that, although I'm not sure the "feature-" prefix is
> appropriate, since the code doesn't have the ability to fall back to v1.

I think if the "fallback" is printk("Protocol version mismatch") then
that would suffice.

> 
> >>  void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)  {
> >> -   tpmif_tx_request_t* tx;
> >> -   int offset;
> >> -   int i;
> >> -   uint32_t domid;
> >> -   int tocopy;
> >> +   vtpm_shared_page_t* shr;
> >> +   unsigned int offset;
> >>     int flags;
> >> +#ifdef TPMBACK_PRINT_DEBUG
> >> +int i;
> >> +#endif
> > 
> > Dodgy indentation? (I saw a bunch of these)
> 
> Whoops, I'll have to go fix that. The entire mini-os build is sprinkled with
> tabs and spaces mostly at random,

Yeah it's a mess AFAICT.

>  so perhaps a generic fix-indent patch is
> needed after all the real changes are applied.

It's either that or just try and make things a bit better with each new
patch.

Is it supposed to be Xen coding style or something else I wonder. (I
think it predates Samuel's involvement, but lets ask him...)

It would probably be useful to add the emacs magic to the various files.

>  
> >> - * Copyright (c) 2005, IBM Corporation
> >> - *
> >> - * Author: Stefan Berger, stefanb@us.ibm.com
> >> - * Grant table support: Mahadevan Gomathisankaran
> > 
> > Did you really remove everything these guys wrote?
> 
> From this file, yes - unless the #ifndef and header/footer comments count, but
> I was under the impression that that is too small to count for copyright, and
> is duplicated across the other files in that directory anyway.

OK, I just get wary when I see copyright stuff changing ;-)

>  
> >> - * This code has been derived from tools/libxc/xen/io/netif.h
> >> - *
> >> - * Copyright (c) 2003-2004, Keir Fraser
> > 
> > I guess I can buy this bit no longer being true given that you reworked
> > the whole protocol.
> > 
> > Ian
> 
> Basically, the file is a rewrite, although not detected by git/hg as such. I can
> add an authorship line if that would be helpful (I see that's normal in other
> header files).
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:30:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:30:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tbw90-0003L2-SF; Fri, 23 Nov 2012 16:30:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tbw8z-0003Kx-Qo
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 16:30:22 +0000
Received: from [193.109.254.147:58437] by server-1.bemta-14.messagelabs.com id
	3A/96-25314-C94AFA05; Fri, 23 Nov 2012 16:30:20 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1353688219!10845668!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16279 invoked from network); 23 Nov 2012 16:30:19 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 16:30:19 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15978669"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 16:30:19 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 16:30:19 +0000
Message-ID: <1353688217.16973.29.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Date: Fri, 23 Nov 2012 16:30:17 +0000
In-Reply-To: <50AFA132.5020904@tycho.nsa.gov>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
	<1353668646.13542.228.camel@zakaz.uk.xensource.com>
	<50AFA132.5020904@tycho.nsa.gov>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.3-1 
MIME-Version: 1.0
Cc: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 16:15 +0000, Daniel De Graaf wrote:
> On 11/23/2012 06:04 AM, Ian Campbell wrote:
> > On Tue, 2012-11-20 at 16:16 +0000, Fioravante, Matthew E. wrote:
> >> This was something I've been wanting to do for a while so I'm very
> >> happy you went ahead and fixed it yourself. Once you submit the linux
> >> version I'll test it on my system.
> >>
> >> Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> > 
> > Do we need to synchronise with anything else (Linux drivers?) or I can I
> > just throw this into the tree once it is done?
> 
> I think the only Linux drivers are the ones that were just posted, and the
> ones for XenLinux 2.6.18.

Which people might be using?

>  Assuming the modified Linux module that I posted
> works as it should, the v2 version will be the only one upstream.
> 
> > Are we hanging any existing users of the tpm stuff out to dry? Could we
> > get a feature-protocol-v2 flag in xenstore so users at least get an
> > error message from either the front or backend to give a hint why it
> > isn't working?
> 
> I suppose we could do that, although I'm not sure the "feature-" prefix is
> appropriate, since the code doesn't have the ability to fall back to v1.

I think if the "fallback" is printk("Protocol version mismatch") then
that would suffice.

> 
> >>  void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)  {
> >> -   tpmif_tx_request_t* tx;
> >> -   int offset;
> >> -   int i;
> >> -   uint32_t domid;
> >> -   int tocopy;
> >> +   vtpm_shared_page_t* shr;
> >> +   unsigned int offset;
> >>     int flags;
> >> +#ifdef TPMBACK_PRINT_DEBUG
> >> +int i;
> >> +#endif
> > 
> > Dodgy indentation? (I saw a bunch of these)
> 
> Whoops, I'll have to go fix that. The entire mini-os build is sprinkled with
> tabs and spaces mostly at random,

Yeah it's a mess AFAICT.

>  so perhaps a generic fix-indent patch is
> needed after all the real changes are applied.

It's either that or just try and make things a bit better with each new
patch.

Is it supposed to be Xen coding style or something else I wonder. (I
think it predates Samuel's involvement, but lets ask him...)

It would probably be useful to add the emacs magic to the various files.

>  
> >> - * Copyright (c) 2005, IBM Corporation
> >> - *
> >> - * Author: Stefan Berger, stefanb@us.ibm.com
> >> - * Grant table support: Mahadevan Gomathisankaran
> > 
> > Did you really remove everything these guys wrote?
> 
> From this file, yes - unless the #ifndef and header/footer comments count, but
> I was under the impression that that is too small to count for copyright, and
> is duplicated across the other files in that directory anyway.

OK, I just get wary when I see copyright stuff changing ;-)

>  
> >> - * This code has been derived from tools/libxc/xen/io/netif.h
> >> - *
> >> - * Copyright (c) 2003-2004, Keir Fraser
> > 
> > I guess I can buy this bit no longer being true given that you reworked
> > the whole protocol.
> > 
> > Ian
> 
> Basically, the file is a rewrite, although not detected by git/hg as such. I can
> add an authorship line if that would be helpful (I see that's normal in other
> header files).
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:38:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:38:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbwH4-0003jZ-Rs; Fri, 23 Nov 2012 16:38:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TbwH3-0003jU-Hz
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:38:41 +0000
Received: from [85.158.143.99:57891] by server-3.bemta-4.messagelabs.com id
	64/93-06841-096AFA05; Fri, 23 Nov 2012 16:38:40 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1353688719!25864359!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24362 invoked from network); 23 Nov 2012 16:38:39 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-4.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 16:38:39 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TbwGz-0000FN-Ep; Fri, 23 Nov 2012 16:38:37 +0000
Date: Fri, 23 Nov 2012 16:38:37 +0000
From: Tim Deegan <tim@xen.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121123163837.GB97222@ocelot.phlegethon.org>
References: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
	<1353686042.16973.19.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211231604470.13749@kaball.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1211231604470.13749@kaball.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:14 +0000 on 23 Nov (1353687242), Stefano Stabellini wrote:
> On Fri, 23 Nov 2012, Ian Campbell wrote:
> > If that doesn't work then this constant is actually in
> > xen/arch/arm/Makefile too and for the same reason:
> >         # XXX: VE model loads by VMA so instead of
> >         # making a proper ELF we link with LMA == VMA and adjust crudely
> >         $(OBJCOPY) --change-addresses +0x80000000 $< $@
> >         $(STRIP) $@
> > 
> > How about making this CONFIG_PHYSICAL_LOCAL_ADDR and plumbing through
> > like we do with CONFIG_DTB_FILE?

Good idea.  In fact it already exists, as CONFIG_LOAD_ADDRESS in
config/arm.mk, and should probably be used here, with a bit of $(())
magic to get the right offset.

> Yeah, I was thinking about that.
> However in this case we would want to set the default somewhere, rather
> than forcing the user to specify it.
> Also we would need to export CONFIG_PHYSICAL_LOCAL_ADDR to a generated
> header file somewhere. Do you have any suggestions on where?

We could pass it with -D when we're processing head.S, as we already do
for xen.lds.S.  (Though the XEN_PHYS_START name (un)used in xen.lds.S
should probably also be XEN_LOAD_ADDRESS).

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:38:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:38:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbwH4-0003jZ-Rs; Fri, 23 Nov 2012 16:38:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TbwH3-0003jU-Hz
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:38:41 +0000
Received: from [85.158.143.99:57891] by server-3.bemta-4.messagelabs.com id
	64/93-06841-096AFA05; Fri, 23 Nov 2012 16:38:40 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1353688719!25864359!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24362 invoked from network); 23 Nov 2012 16:38:39 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-4.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 16:38:39 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TbwGz-0000FN-Ep; Fri, 23 Nov 2012 16:38:37 +0000
Date: Fri, 23 Nov 2012 16:38:37 +0000
From: Tim Deegan <tim@xen.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121123163837.GB97222@ocelot.phlegethon.org>
References: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
	<1353686042.16973.19.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211231604470.13749@kaball.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1211231604470.13749@kaball.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:14 +0000 on 23 Nov (1353687242), Stefano Stabellini wrote:
> On Fri, 23 Nov 2012, Ian Campbell wrote:
> > If that doesn't work then this constant is actually in
> > xen/arch/arm/Makefile too and for the same reason:
> >         # XXX: VE model loads by VMA so instead of
> >         # making a proper ELF we link with LMA == VMA and adjust crudely
> >         $(OBJCOPY) --change-addresses +0x80000000 $< $@
> >         $(STRIP) $@
> > 
> > How about making this CONFIG_PHYSICAL_LOCAL_ADDR and plumbing through
> > like we do with CONFIG_DTB_FILE?

Good idea.  In fact it already exists, as CONFIG_LOAD_ADDRESS in
config/arm.mk, and should probably be used here, with a bit of $(())
magic to get the right offset.

> Yeah, I was thinking about that.
> However in this case we would want to set the default somewhere, rather
> than forcing the user to specify it.
> Also we would need to export CONFIG_PHYSICAL_LOCAL_ADDR to a generated
> header file somewhere. Do you have any suggestions on where?

We could pass it with -D when we're processing head.S, as we already do
for xen.lds.S.  (Though the XEN_PHYS_START name (un)used in xen.lds.S
should probably also be XEN_LOAD_ADDRESS).

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:40:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:40:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbwIK-0003nk-Av; Fri, 23 Nov 2012 16:40:00 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TbwIJ-0003nb-81
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:39:59 +0000
Received: from [193.109.254.147:44403] by server-4.bemta-14.messagelabs.com id
	1D/DC-18856-ED6AFA05; Fri, 23 Nov 2012 16:39:58 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353688789!12125298!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6660 invoked from network); 23 Nov 2012 16:39:50 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-3.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 16:39:50 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TbwI8-0000Fo-3A; Fri, 23 Nov 2012 16:39:48 +0000
Date: Fri, 23 Nov 2012 16:39:48 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121123163948.GC97222@ocelot.phlegethon.org>
References: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
	<1353686042.16973.19.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211231604470.13749@kaball.uk.xensource.com>
	<1353687991.16973.26.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353687991.16973.26.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:26 +0000 on 23 Nov (1353687991), Ian Campbell wrote:
> http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html
> says:
>         The start address is usually 0 as the zImage code is position
>         independent.
>         
> Of course this has to be true in the modern multiplatform zImage world.
> 
> Looking at a random zImage:
>         000000 e1a00000 e1a00000 e1a00000 e1a00000
>         *
>         000020 ea000002 016f2818 00000000 00220548
>         
> Where 016f2818 is the magic, 0 is the start and 220548 is the
> end/length.
> 
> I knew I didn't imagine it ;-)

Yay!  We should definitely do that then, at least until we get a report
of it not working. :)

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:40:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:40:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbwIK-0003nk-Av; Fri, 23 Nov 2012 16:40:00 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TbwIJ-0003nb-81
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:39:59 +0000
Received: from [193.109.254.147:44403] by server-4.bemta-14.messagelabs.com id
	1D/DC-18856-ED6AFA05; Fri, 23 Nov 2012 16:39:58 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353688789!12125298!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6660 invoked from network); 23 Nov 2012 16:39:50 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-3.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 16:39:50 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TbwI8-0000Fo-3A; Fri, 23 Nov 2012 16:39:48 +0000
Date: Fri, 23 Nov 2012 16:39:48 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121123163948.GC97222@ocelot.phlegethon.org>
References: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
	<1353686042.16973.19.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211231604470.13749@kaball.uk.xensource.com>
	<1353687991.16973.26.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353687991.16973.26.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:26 +0000 on 23 Nov (1353687991), Ian Campbell wrote:
> http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html
> says:
>         The start address is usually 0 as the zImage code is position
>         independent.
>         
> Of course this has to be true in the modern multiplatform zImage world.
> 
> Looking at a random zImage:
>         000000 e1a00000 e1a00000 e1a00000 e1a00000
>         *
>         000020 ea000002 016f2818 00000000 00220548
>         
> Where 016f2818 is the magic, 0 is the start and 220548 is the
> end/length.
> 
> I knew I didn't imagine it ;-)

Yay!  We should definitely do that then, at least until we get a report
of it not working. :)

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:43:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:43:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbwL1-00049E-TG; Fri, 23 Nov 2012 16:42:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TbwL1-000492-33
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 16:42:47 +0000
Received: from [85.158.138.51:18620] by server-3.bemta-3.messagelabs.com id
	20/F8-31566-687AFA05; Fri, 23 Nov 2012 16:42:46 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-2.tower-174.messagelabs.com!1353688964!27710130!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26175 invoked from network); 23 Nov 2012 16:42:44 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-2.tower-174.messagelabs.com with SMTP;
	23 Nov 2012 16:42:44 -0000
X-TM-IMSS-Message-ID: <0fc153fb00011dfb@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 0fc153fb00011dfb ;
	Fri, 23 Nov 2012 11:41:42 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qANGgW1J026703; 
	Fri, 23 Nov 2012 11:42:32 -0500
Message-ID: <50AFA778.80008@tycho.nsa.gov>
Date: Fri, 23 Nov 2012 11:42:32 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353423098-16371-6-git-send-email-dgdegra@tycho.nsa.gov>
	<20121122165712.GB83155@ocelot.phlegethon.org>
In-Reply-To: <20121122165712.GB83155@ocelot.phlegethon.org>
Cc: keir@xen.org, ian.campbell@citrix.com, JBeulich@suse.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH RFC 5/5] xen/xsm: include default hook
 action in name
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/22/2012 11:57 AM, Tim Deegan wrote:
> Hi, 
> 
> At 09:51 -0500 on 20 Nov (1353405098), Daniel De Graaf wrote:
>> Include the default XSM hook action in the name of the hook in order to
>> allow quick understanding of how the call site is expected to be used
>> (dom0-only, arbitrary guest, or target-only).
> 
> I like this a lot; it's much less worrying than having to follow every
> xsm hook to see what it does. 
> 
> I would like it even more if the process were automatic -- as it stands
> your dummy hooks must be manually coded to do what their name implies,
> and if the code gets out of sync with the name it could be a long time
> before anyone spotted it.

That's one thing I didn't like about this scheme - it's effectively 
coding a default security policy into function names, so changing that 
policy will make larger-than-necessary diffs, assuming all the locations
are changed (although this will produce compile errors if tested with
both XSM enabled and disabled, so not a big problem). However, I don't
think the behavior of the dummy hooks will change very much. In the
event of a change, it is more likely that parameters (such as a new
struct domain*) will need to be added in order to facilitate the new
permission check, so changing the name at that time should be easy to
catch.

> Would it be acceptable for every XSM hook to take a default action as
> its first argument?  Then the call sites look like:
> 
>   xsm_do_mca(XSM_PRIV),
>   xsm_unbind_pt_irq(XSM_HOOK, d, bind);
> 
> and so forth, and every one of the dummy hooks is just a wrapper around
> a single central hook that DTRT with the default:
> 
>   static XSM_INLINE int xsm_do_mca(xsm_default_t default)
>   {
> 	return xsm_default_action(default);
>   }
> 
>   static XSM_INLINE int xsm_unbind_pt_irq(xsm_default_t default, struct domain *d, struct xen_domctl_bind_pt_irq *bind)
>   {
> 	return xsm_default_action(default);
>   }
> 
> and so forth.  It should be very hard to get it wrong.  I guess there
> might have to be a standard order for things that take a domain or an
> mfn, but do you think something along those lines could work?

This would not work for all the hooks, although it would work for most:
domctl and mmu_update are both too complex for this type of hack, and
console_io would need its #define moved back up to the source. For the
other hooks, you would have to code in the domain arguments manually
(sometimes current->domain is available, sometimes it's not) so it's not
automatically an improvement in readability since you still have to look
inside dummy.h to see what domain arguments are being checked.

When I first looked at this, I had thought that it could be implemented
by discarding the xsm_default_t argument if XSM is enabled, but this
would make it very likely that the behavior of the dummy XSM module
would be different from a build with XSM disabled, which we want to
avoid.

And, now that I've actually looked at implementing this, the arguments
to xsm_default_action are difficult to specify. The obvious prototype:
int xsm_default_action(xsm_default_t, struct domain* s, struct domain* d)
would require passing something (either NULL or current->domain) for
those hooks that do not have source and destination domains. This adds 
another possible issue: if someone changes xsm_unbind_pt_irq from 
XSM_HOOK to XSM_TARGET, they might get surprise null dereferences or 
end up checking current->domain instead of the actual target - which 
will pass even when it should not. This also makes the dummy module
larger when compiled: since the compiler can't propagate constants
through a function pointer call, the dummy module will end up needing to
handle all possible values of xsm_default_t even though it will only
ever be called with one.

> If adding an arg is too much overhead I'm sure the dummy ops could 
> be autogenerated from the name with some nasty CPP. :)
> 
> Tim.

I just got rid of some nasty CPP in order to make ctags able to follow
xsm_* to the dummy implementation, which I personally find more helpful
in understanding XSM hooks at a glance - especially if you are trying to
decipher what exactly is implied by the prefixes or constant names.

I think a solution similar to yours could work, although it's not as 
nice looking - use the constants in the source files but have them 
compiled out of the XSM hooks, and have the dummy ops include a
compile-time assertion in the XSM-disabled case to verify that the
constant passed in matches their implementation; something like:

   #define BUILD_ASSERT(x) if (!(x)) cause_linker_error_if_not_inlined_out()
   #ifdef XSM_ENABLE
   /* XSM_INLINE == empty; compiled in to dummy.c */
   #define XSM_DEFAULT_VOID void
   #define XSM_DEFAULT_ARG
   #define XSM_ASSERT_ACTION(action) xsm_default_t default = action
   #else
   /* XSM_INLINE == inline; compiled as a header */
   #define XSM_DEFAULT_VOID xsm_default_t default
   #define XSM_DEFAULT_ARG xsm_default_t default,
   #define XSM_ASSERT_ACTION(action) BUILD_ASSERT(default == action)
   #endif

   static XSM_INLINE int xsm_do_mca(XSM_DEFAULT_VOID)
   {
	XSM_ASSERT_ACTION(XSM_PRIV);
	return xsm_default_action(default, current->domain, NULL);
   }
 
   static XSM_INLINE int xsm_unbind_pt_irq(XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
   {
	XSM_ASSERT_ACTION(XSM_HOOK);
 	return xsm_default_action(default, current->domain, d);
   }

Does this seem reasonable? It would force some level of compiler
optimization to be used at all times, but I think that's already
required due to GCC otherwise wasting lots of stack space.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:43:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:43:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbwL1-00049E-TG; Fri, 23 Nov 2012 16:42:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TbwL1-000492-33
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 16:42:47 +0000
Received: from [85.158.138.51:18620] by server-3.bemta-3.messagelabs.com id
	20/F8-31566-687AFA05; Fri, 23 Nov 2012 16:42:46 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-2.tower-174.messagelabs.com!1353688964!27710130!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26175 invoked from network); 23 Nov 2012 16:42:44 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-2.tower-174.messagelabs.com with SMTP;
	23 Nov 2012 16:42:44 -0000
X-TM-IMSS-Message-ID: <0fc153fb00011dfb@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 0fc153fb00011dfb ;
	Fri, 23 Nov 2012 11:41:42 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qANGgW1J026703; 
	Fri, 23 Nov 2012 11:42:32 -0500
Message-ID: <50AFA778.80008@tycho.nsa.gov>
Date: Fri, 23 Nov 2012 11:42:32 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121029 Thunderbird/16.0.2
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353423098-16371-6-git-send-email-dgdegra@tycho.nsa.gov>
	<20121122165712.GB83155@ocelot.phlegethon.org>
In-Reply-To: <20121122165712.GB83155@ocelot.phlegethon.org>
Cc: keir@xen.org, ian.campbell@citrix.com, JBeulich@suse.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH RFC 5/5] xen/xsm: include default hook
 action in name
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/22/2012 11:57 AM, Tim Deegan wrote:
> Hi, 
> 
> At 09:51 -0500 on 20 Nov (1353405098), Daniel De Graaf wrote:
>> Include the default XSM hook action in the name of the hook in order to
>> allow quick understanding of how the call site is expected to be used
>> (dom0-only, arbitrary guest, or target-only).
> 
> I like this a lot; it's much less worrying than having to follow every
> xsm hook to see what it does. 
> 
> I would like it even more if the process were automatic -- as it stands
> your dummy hooks must be manually coded to do what their name implies,
> and if the code gets out of sync with the name it could be a long time
> before anyone spotted it.

That's one thing I didn't like about this scheme - it's effectively 
coding a default security policy into function names, so changing that 
policy will make larger-than-necessary diffs, assuming all the locations
are changed (although this will produce compile errors if tested with
both XSM enabled and disabled, so not a big problem). However, I don't
think the behavior of the dummy hooks will change very much. In the
event of a change, it is more likely that parameters (such as a new
struct domain*) will need to be added in order to facilitate the new
permission check, so changing the name at that time should be easy to
catch.

> Would it be acceptable for every XSM hook to take a default action as
> its first argument?  Then the call sites look like:
> 
>   xsm_do_mca(XSM_PRIV),
>   xsm_unbind_pt_irq(XSM_HOOK, d, bind);
> 
> and so forth, and every one of the dummy hooks is just a wrapper around
> a single central hook that DTRT with the default:
> 
>   static XSM_INLINE int xsm_do_mca(xsm_default_t default)
>   {
> 	return xsm_default_action(default);
>   }
> 
>   static XSM_INLINE int xsm_unbind_pt_irq(xsm_default_t default, struct domain *d, struct xen_domctl_bind_pt_irq *bind)
>   {
> 	return xsm_default_action(default);
>   }
> 
> and so forth.  It should be very hard to get it wrong.  I guess there
> might have to be a standard order for things that take a domain or an
> mfn, but do you think something along those lines could work?

This would not work for all the hooks, although it would work for most:
domctl and mmu_update are both too complex for this type of hack, and
console_io would need its #define moved back up to the source. For the
other hooks, you would have to code in the domain arguments manually
(sometimes current->domain is available, sometimes it's not) so it's not
automatically an improvement in readability since you still have to look
inside dummy.h to see what domain arguments are being checked.

When I first looked at this, I had thought that it could be implemented
by discarding the xsm_default_t argument if XSM is enabled, but this
would make it very likely that the behavior of the dummy XSM module
would be different from a build with XSM disabled, which we want to
avoid.

And, now that I've actually looked at implementing this, the arguments
to xsm_default_action are difficult to specify. The obvious prototype:
int xsm_default_action(xsm_default_t, struct domain* s, struct domain* d)
would require passing something (either NULL or current->domain) for
those hooks that do not have source and destination domains. This adds 
another possible issue: if someone changes xsm_unbind_pt_irq from 
XSM_HOOK to XSM_TARGET, they might get surprise null dereferences or 
end up checking current->domain instead of the actual target - which 
will pass even when it should not. This also makes the dummy module
larger when compiled: since the compiler can't propagate constants
through a function pointer call, the dummy module will end up needing to
handle all possible values of xsm_default_t even though it will only
ever be called with one.

> If adding an arg is too much overhead I'm sure the dummy ops could 
> be autogenerated from the name with some nasty CPP. :)
> 
> Tim.

I just got rid of some nasty CPP in order to make ctags able to follow
xsm_* to the dummy implementation, which I personally find more helpful
in understanding XSM hooks at a glance - especially if you are trying to
decipher what exactly is implied by the prefixes or constant names.

I think a solution similar to yours could work, although it's not as 
nice looking - use the constants in the source files but have them 
compiled out of the XSM hooks, and have the dummy ops include a
compile-time assertion in the XSM-disabled case to verify that the
constant passed in matches their implementation; something like:

   #define BUILD_ASSERT(x) if (!(x)) cause_linker_error_if_not_inlined_out()
   #ifdef XSM_ENABLE
   /* XSM_INLINE == empty; compiled in to dummy.c */
   #define XSM_DEFAULT_VOID void
   #define XSM_DEFAULT_ARG
   #define XSM_ASSERT_ACTION(action) xsm_default_t default = action
   #else
   /* XSM_INLINE == inline; compiled as a header */
   #define XSM_DEFAULT_VOID xsm_default_t default
   #define XSM_DEFAULT_ARG xsm_default_t default,
   #define XSM_ASSERT_ACTION(action) BUILD_ASSERT(default == action)
   #endif

   static XSM_INLINE int xsm_do_mca(XSM_DEFAULT_VOID)
   {
	XSM_ASSERT_ACTION(XSM_PRIV);
	return xsm_default_action(default, current->domain, NULL);
   }
 
   static XSM_INLINE int xsm_unbind_pt_irq(XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
   {
	XSM_ASSERT_ACTION(XSM_HOOK);
 	return xsm_default_action(default, current->domain, d);
   }

Does this seem reasonable? It would force some level of compiler
optimization to be used at all times, but I think that's already
required due to GCC otherwise wasting lots of stack space.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:45:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:45:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbwNi-0004N8-NM; Fri, 23 Nov 2012 16:45:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TbwNg-0004Mu-PU
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:45:33 +0000
Received: from [85.158.138.51:30940] by server-10.bemta-3.messagelabs.com id
	E4/A5-19806-728AFA05; Fri, 23 Nov 2012 16:45:27 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353689125!31319486!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19795 invoked from network); 23 Nov 2012 16:45:25 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 16:45:25 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15978909"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 16:45:24 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 23 Nov 2012 16:45:24 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TbwNY-00025S-Er;
	Fri, 23 Nov 2012 16:45:24 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TbwNX-0004z9-QV;
	Fri, 23 Nov 2012 16:45:24 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14469-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 23 Nov 2012 16:45:23 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14469: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14469 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14469/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14468
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14468
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14468
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14468

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  0049de3827bc
baseline version:
 xen                  7b4449bdb980

------------------------------------------------------------
People who touched revisions under test:
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Olaf Hering <olaf@aepfle.de>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=0049de3827bc
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 0049de3827bc
+ branch=xen-unstable
+ revision=0049de3827bc
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 0049de3827bc ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 3 changesets with 7 changes to 7 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:45:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:45:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbwNi-0004N8-NM; Fri, 23 Nov 2012 16:45:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TbwNg-0004Mu-PU
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:45:33 +0000
Received: from [85.158.138.51:30940] by server-10.bemta-3.messagelabs.com id
	E4/A5-19806-728AFA05; Fri, 23 Nov 2012 16:45:27 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1353689125!31319486!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19795 invoked from network); 23 Nov 2012 16:45:25 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 16:45:25 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="15978909"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 16:45:24 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 23 Nov 2012 16:45:24 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TbwNY-00025S-Er;
	Fri, 23 Nov 2012 16:45:24 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TbwNX-0004z9-QV;
	Fri, 23 Nov 2012 16:45:24 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14469-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 23 Nov 2012 16:45:23 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14469: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14469 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14469/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14468
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14468
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail like 14468
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail like 14468

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  0049de3827bc
baseline version:
 xen                  7b4449bdb980

------------------------------------------------------------
People who touched revisions under test:
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Olaf Hering <olaf@aepfle.de>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=0049de3827bc
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 0049de3827bc
+ branch=xen-unstable
+ revision=0049de3827bc
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 0049de3827bc ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 3 changesets with 7 changes to 7 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:47:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:47:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbwOu-0004Tp-Bp; Fri, 23 Nov 2012 16:46:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TbwOs-0004Tf-5G
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:46:46 +0000
Received: from [85.158.138.51:36928] by server-3.bemta-3.messagelabs.com id
	0E/6D-31566-578AFA05; Fri, 23 Nov 2012 16:46:45 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1353689200!31222386!1
X-Originating-IP: [209.85.220.171]
X-SpamReason: No, hits=0.6 required=7.0 tests=HTML_60_70,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13154 invoked from network); 23 Nov 2012 16:46:42 -0000
Received: from mail-vc0-f171.google.com (HELO mail-vc0-f171.google.com)
	(209.85.220.171)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 16:46:42 -0000
Received: by mail-vc0-f171.google.com with SMTP id fo14so7963110vcb.30
	for <xen-devel@lists.xensource.com>;
	Fri, 23 Nov 2012 08:46:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=MqGzqo5Yz48icPT4kM3iliwyhGJL7SdTQOVOaCMP/PY=;
	b=BWnene1bnGZQSe9m9/HSYxSlSP4YrTgmXI6in7lSmEElIs69UbJaW4IWlJstYz/c5I
	RSm9/nIfPxbQGgGHvAY1Mzrdmr6WbGQPcvYd3wLdyJ167dUH886QIMgkwAPUaQZKYawF
	Cwwzv/uTZD/UBkX50ZitH/2kYb5U3I4X7Kk1IYDYmZCXOZ3vIv6z90M65abfG+MSz4gB
	ncQ8RufvIXimFJEyG/JLyn/VyVbKezDapxoDsweoVg42+dqaQtp/gIwuGUJ6mOqD2d/X
	Zq8vJcWA71JKL4ZL2d8Y99IB7cTj5Njh02F8OuzRLY283Teqhtx/OaJJ9IfqlhWCRcxR
	dGTg==
MIME-Version: 1.0
Received: by 10.58.162.130 with SMTP id ya2mr7059960veb.2.1353689200431; Fri,
	23 Nov 2012 08:46:40 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Fri, 23 Nov 2012 08:46:40 -0800 (PST)
In-Reply-To: <C72DD742-4259-4EAD-8656-2992654DA3E6@junidas.de>
References: <C72DD742-4259-4EAD-8656-2992654DA3E6@junidas.de>
Date: Fri, 23 Nov 2012 16:46:40 +0000
X-Google-Sender-Auth: ZHyylMjTyWVAPeb_oa6H2Ng_tiY
Message-ID: <CAFLBxZbXw-Q3V=8sdGjC9CNqYJTG7Dk-uzuyUnABRuS64LCm9w@mail.gmail.com>
From: George Dunlap <dunlapg@umich.edu>
To: Dirk Winning <dirk.winning@junidas.de>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] Bug?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2232192237978530997=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============2232192237978530997==
Content-Type: multipart/alternative; boundary=047d7b6766dced905f04cf2c5356

--047d7b6766dced905f04cf2c5356
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 23, 2012 at 10:32 AM, Dirk Winning <dirk.winning@junidas.de>wro=
te:

> root@graff:~# xm usb-list-assignable-devices
> 1-6          : ID 14dd:0002 Peppercon AG Multidevice
> 2-2          : ID 051d:0002 American Power Conversion Smart-UPS 3000 RM X=
L
> FW:691.16.I USB FW:7.3
>
> root@graff:~# xm usb-hc-create bosch-w2k3-pv 1 1
>
> root@graff:~# xm usb-list bosch-w2k3-pv
> Idx BE  state usb-ver  BE-path
> 0   0   1     USB1.1  /local/domain/0/backend/vusb/55/0
> port 1:
>
> root@graff:~# xm usb-attach bosch-w2k3-pv 0 1 2-2
> Unexpected error: <class 'xen.util.vusb_util.UsbDeviceParseError'>
>
> Please report to xen-devel@lists.xensource.com
> Traceback (most recent call last):
>   File "/usr/lib/xen-4.0/bin/xm", line 8, in <module>
>     main.main(sys.argv)
>

It looks like you're using Xen 4.0 -- have you tried 4.1 or 4.2?


>   File "/usr/lib/xen-4.0/lib/python/xen/xm/main.py", line 3620, in main
>     _, rc =3D _run_cmd(cmd, cmd_name, args)
>   File "/usr/lib/xen-4.0/lib/python/xen/xm/main.py", line 3644, in _run_c=
md
>     return True, cmd(args)
>   File "/usr/lib/xen-4.0/lib/python/xen/xm/main.py", line 2868, in
> xm_usb_attach
>     if vusb_util.bus_is_assigned(bus):
>   File "/usr/lib/xen-4.0/lib/python/xen/util/vusb_util.py", line 275, in
> bus_is_assigned
>     raise UsbDeviceParseError("Can't get assignment status: (%s)." % bus)
> xen.util.vusb_util.UsbDeviceParseError: vusb: Error parsing USB device
> info: Can't get assignment status: (2-2).
>
>
>
> regards
>
> Dipl. Ing. Dirk Winning, Systemberater
> dirk.winning@junidas.de
>
> junidas GmbH, Aixheimer Str. 12, 70619 Stuttgart
> Tel. +49 (711) 4599799-12, Fax +49 (711) 4599799-10
> Gesch=E4ftsf=FChrer: Dr. Markus Stoll, Matthias Zepf
> Amtsgericht Stuttgart, HRB 21939
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>

--047d7b6766dced905f04cf2c5356
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 23, 2012 at 10:32 AM, Dirk Winning <span dir=3D"ltr">&lt;<a hre=
f=3D"mailto:dirk.winning@junidas.de" target=3D"_blank">dirk.winning@junidas=
.de</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail=
_quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div style=3D"word-wrap:break-word"><div><di=
v>root@graff:~# xm usb-list-assignable-devices</div><div>1-6 =A0 =A0 =A0 =
=A0 =A0: ID 14dd:0002 Peppercon AG Multidevice</div>
<div>2-2 =A0 =A0 =A0 =A0 =A0: ID 051d:0002 American Power Conversion Smart-=
UPS 3000 RM XL FW:691.16.I USB FW:7.3</div></div><div><br></div><div>root@g=
raff:~# xm usb-hc-create bosch-w2k3-pv 1 1</div><div><br></div><div><div>ro=
ot@graff:~# xm usb-list bosch-w2k3-pv</div>
<div>Idx BE =A0state usb-ver =A0BE-path =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0=A0</div><div>0 =A0 0 =A0 1 =A0 =A0 USB1.1 =A0/local/domain/0/backe=
nd/vusb/55/0 =A0</div><div>port 1:=A0</div></div><div><br></div><div>root@g=
raff:~# xm usb-attach bosch-w2k3-pv 0 1 2-2</div>
<div>Unexpected error: &lt;class &#39;xen.util.vusb_util.UsbDeviceParseErro=
r&#39;&gt;</div><div><br></div><div>Please report to <a href=3D"mailto:xen-=
devel@lists.xensource.com" target=3D"_blank">xen-devel@lists.xensource.com<=
/a></div>
<div>Traceback (most recent call last):</div><div>=A0 File &quot;/usr/lib/x=
en-4.0/bin/xm&quot;, line 8, in &lt;module&gt;</div><div>=A0 =A0 main.main(=
sys.argv)</div></div></blockquote><div><br>It looks like you&#39;re using X=
en 4.0 -- have you tried 4.1 or 4.2?<br>
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex"><div style=3D"word-wrap:break-word"=
><div>=A0 File &quot;/usr/lib/xen-4.0/lib/python/xen/xm/main.py&quot;, line=
 3620, in main</div>
<div>=A0 =A0 _, rc =3D _run_cmd(cmd, cmd_name, args)</div><div>=A0 File &qu=
ot;/usr/lib/xen-4.0/lib/python/xen/xm/main.py&quot;, line 3644, in _run_cmd=
</div><div>=A0 =A0 return True, cmd(args)</div><div>=A0 File &quot;/usr/lib=
/xen-4.0/lib/python/xen/xm/main.py&quot;, line 2868, in xm_usb_attach</div>
<div>=A0 =A0 if vusb_util.bus_is_assigned(bus):</div><div>=A0 File &quot;/u=
sr/lib/xen-4.0/lib/python/xen/util/vusb_util.py&quot;, line 275, in bus_is_=
assigned</div><div>=A0 =A0 raise UsbDeviceParseError(&quot;Can&#39;t get as=
signment status: (%s).&quot; % bus)</div>
<div>xen.util.vusb_util.UsbDeviceParseError: vusb: Error parsing USB device=
 info: Can&#39;t get assignment status: (2-2).</div><div><br></div><div><br=
></div><div><br></div><div>regards</div><div><br></div><div>
<div style=3D"word-wrap:break-word;font-size:12px"><div style=3D"word-wrap:=
break-word"><span style=3D"text-indent:0px;letter-spacing:normal;font-varia=
nt:normal;font-style:normal;font-weight:normal;line-height:normal;border-co=
llapse:separate;text-transform:none;font-size:12px;white-space:normal;font-=
family:Helvetica;word-spacing:0px"><div style=3D"word-wrap:break-word">
<span style=3D"text-indent:0px;letter-spacing:normal;font-variant:normal;fo=
nt-style:normal;font-weight:normal;line-height:normal;border-collapse:separ=
ate;text-transform:none;font-size:12px;white-space:normal;font-family:Helve=
tica;word-spacing:0px"><div style=3D"word-wrap:break-word">
<span style=3D"text-indent:0px;letter-spacing:normal;font-variant:normal;fo=
nt-style:normal;font-weight:normal;line-height:normal;border-collapse:separ=
ate;text-transform:none;font-size:12px;white-space:normal;font-family:Helve=
tica;word-spacing:0px"><div style=3D"word-wrap:break-word">
<span style=3D"text-indent:0px;letter-spacing:normal;font-variant:normal;fo=
nt-style:normal;font-weight:normal;line-height:normal;border-collapse:separ=
ate;text-transform:none;font-size:12px;white-space:normal;font-family:Helve=
tica;word-spacing:0px"><div style=3D"word-wrap:break-word">
<div><div><div style=3D"word-wrap:break-word"><div style=3D"word-wrap:break=
-word"><div style=3D"word-wrap:break-word"><div style=3D"word-wrap:break-wo=
rd"><div style=3D"word-wrap:break-word"><div style=3D"word-wrap:break-word"=
><div style=3D"word-wrap:break-word">
<div style=3D"word-wrap:break-word"><div><div>Dipl. Ing. Dirk Winning, Syst=
emberater</div><div><a href=3D"mailto:dirk.winning@junidas.de" target=3D"_b=
lank">dirk.winning@junidas.de</a></div><div><br></div><div><span style=3D"f=
ont-size:14px"><div style=3D"margin-top:0px;margin-right:0px;margin-bottom:=
0px;margin-left:0px">
<font size=3D"3"><font color=3D"#0311FF">junidas GmbH, Aixheimer Str. 12, 7=
0619 Stuttgart</font></font></div><div style=3D"margin-top:0px;margin-right=
:0px;margin-bottom:0px;margin-left:0px"><font size=3D"3"><font color=3D"#03=
11FF">Tel. <a href=3D"tel:%2B49%20%28711%29%204599799-12" value=3D"+4971145=
9979912" target=3D"_blank">+49 (711) 4599799-12</a>, Fax <a href=3D"tel:%2B=
49%20%28711%29%204599799-10" value=3D"+49711459979910" target=3D"_blank">+4=
9 (711) 4599799-10</a></font></font></div>
<div style=3D"margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left=
:0px"><font size=3D"3"><font color=3D"#0311FF">Gesch=E4ftsf=FChrer: Dr. Mar=
kus Stoll, Matthias Zepf</font></font></div><div style=3D"margin-top:0px;ma=
rgin-right:0px;margin-bottom:0px;margin-left:0px">
<font size=3D"3"><font color=3D"#0311FF">Amtsgericht Stuttgart, HRB 21939</=
font></font></div></span></div></div></div></div></div></div></div></div></=
div></div></div></div></div></span></div></span></div></span></div></span><=
/div>
</div>
</div>
<br></div><br>_______________________________________________<br>
Xen-devel mailing list<br>
<a href=3D"mailto:Xen-devel@lists.xen.org">Xen-devel@lists.xen.org</a><br>
<a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://lists.x=
en.org/xen-devel</a><br>
<br></blockquote></div><br></div>

--047d7b6766dced905f04cf2c5356--


--===============2232192237978530997==
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.xen.org
http://lists.xen.org/xen-devel

--===============2232192237978530997==--


From xen-devel-bounces@lists.xen.org Fri Nov 23 16:47:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:47:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbwOu-0004Tp-Bp; Fri, 23 Nov 2012 16:46:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TbwOs-0004Tf-5G
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:46:46 +0000
Received: from [85.158.138.51:36928] by server-3.bemta-3.messagelabs.com id
	0E/6D-31566-578AFA05; Fri, 23 Nov 2012 16:46:45 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1353689200!31222386!1
X-Originating-IP: [209.85.220.171]
X-SpamReason: No, hits=0.6 required=7.0 tests=HTML_60_70,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13154 invoked from network); 23 Nov 2012 16:46:42 -0000
Received: from mail-vc0-f171.google.com (HELO mail-vc0-f171.google.com)
	(209.85.220.171)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 16:46:42 -0000
Received: by mail-vc0-f171.google.com with SMTP id fo14so7963110vcb.30
	for <xen-devel@lists.xensource.com>;
	Fri, 23 Nov 2012 08:46:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=MqGzqo5Yz48icPT4kM3iliwyhGJL7SdTQOVOaCMP/PY=;
	b=BWnene1bnGZQSe9m9/HSYxSlSP4YrTgmXI6in7lSmEElIs69UbJaW4IWlJstYz/c5I
	RSm9/nIfPxbQGgGHvAY1Mzrdmr6WbGQPcvYd3wLdyJ167dUH886QIMgkwAPUaQZKYawF
	Cwwzv/uTZD/UBkX50ZitH/2kYb5U3I4X7Kk1IYDYmZCXOZ3vIv6z90M65abfG+MSz4gB
	ncQ8RufvIXimFJEyG/JLyn/VyVbKezDapxoDsweoVg42+dqaQtp/gIwuGUJ6mOqD2d/X
	Zq8vJcWA71JKL4ZL2d8Y99IB7cTj5Njh02F8OuzRLY283Teqhtx/OaJJ9IfqlhWCRcxR
	dGTg==
MIME-Version: 1.0
Received: by 10.58.162.130 with SMTP id ya2mr7059960veb.2.1353689200431; Fri,
	23 Nov 2012 08:46:40 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Fri, 23 Nov 2012 08:46:40 -0800 (PST)
In-Reply-To: <C72DD742-4259-4EAD-8656-2992654DA3E6@junidas.de>
References: <C72DD742-4259-4EAD-8656-2992654DA3E6@junidas.de>
Date: Fri, 23 Nov 2012 16:46:40 +0000
X-Google-Sender-Auth: ZHyylMjTyWVAPeb_oa6H2Ng_tiY
Message-ID: <CAFLBxZbXw-Q3V=8sdGjC9CNqYJTG7Dk-uzuyUnABRuS64LCm9w@mail.gmail.com>
From: George Dunlap <dunlapg@umich.edu>
To: Dirk Winning <dirk.winning@junidas.de>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] Bug?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2232192237978530997=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============2232192237978530997==
Content-Type: multipart/alternative; boundary=047d7b6766dced905f04cf2c5356

--047d7b6766dced905f04cf2c5356
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 23, 2012 at 10:32 AM, Dirk Winning <dirk.winning@junidas.de>wro=
te:

> root@graff:~# xm usb-list-assignable-devices
> 1-6          : ID 14dd:0002 Peppercon AG Multidevice
> 2-2          : ID 051d:0002 American Power Conversion Smart-UPS 3000 RM X=
L
> FW:691.16.I USB FW:7.3
>
> root@graff:~# xm usb-hc-create bosch-w2k3-pv 1 1
>
> root@graff:~# xm usb-list bosch-w2k3-pv
> Idx BE  state usb-ver  BE-path
> 0   0   1     USB1.1  /local/domain/0/backend/vusb/55/0
> port 1:
>
> root@graff:~# xm usb-attach bosch-w2k3-pv 0 1 2-2
> Unexpected error: <class 'xen.util.vusb_util.UsbDeviceParseError'>
>
> Please report to xen-devel@lists.xensource.com
> Traceback (most recent call last):
>   File "/usr/lib/xen-4.0/bin/xm", line 8, in <module>
>     main.main(sys.argv)
>

It looks like you're using Xen 4.0 -- have you tried 4.1 or 4.2?


>   File "/usr/lib/xen-4.0/lib/python/xen/xm/main.py", line 3620, in main
>     _, rc =3D _run_cmd(cmd, cmd_name, args)
>   File "/usr/lib/xen-4.0/lib/python/xen/xm/main.py", line 3644, in _run_c=
md
>     return True, cmd(args)
>   File "/usr/lib/xen-4.0/lib/python/xen/xm/main.py", line 2868, in
> xm_usb_attach
>     if vusb_util.bus_is_assigned(bus):
>   File "/usr/lib/xen-4.0/lib/python/xen/util/vusb_util.py", line 275, in
> bus_is_assigned
>     raise UsbDeviceParseError("Can't get assignment status: (%s)." % bus)
> xen.util.vusb_util.UsbDeviceParseError: vusb: Error parsing USB device
> info: Can't get assignment status: (2-2).
>
>
>
> regards
>
> Dipl. Ing. Dirk Winning, Systemberater
> dirk.winning@junidas.de
>
> junidas GmbH, Aixheimer Str. 12, 70619 Stuttgart
> Tel. +49 (711) 4599799-12, Fax +49 (711) 4599799-10
> Gesch=E4ftsf=FChrer: Dr. Markus Stoll, Matthias Zepf
> Amtsgericht Stuttgart, HRB 21939
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>

--047d7b6766dced905f04cf2c5356
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 23, 2012 at 10:32 AM, Dirk Winning <span dir=3D"ltr">&lt;<a hre=
f=3D"mailto:dirk.winning@junidas.de" target=3D"_blank">dirk.winning@junidas=
.de</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail=
_quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div style=3D"word-wrap:break-word"><div><di=
v>root@graff:~# xm usb-list-assignable-devices</div><div>1-6 =A0 =A0 =A0 =
=A0 =A0: ID 14dd:0002 Peppercon AG Multidevice</div>
<div>2-2 =A0 =A0 =A0 =A0 =A0: ID 051d:0002 American Power Conversion Smart-=
UPS 3000 RM XL FW:691.16.I USB FW:7.3</div></div><div><br></div><div>root@g=
raff:~# xm usb-hc-create bosch-w2k3-pv 1 1</div><div><br></div><div><div>ro=
ot@graff:~# xm usb-list bosch-w2k3-pv</div>
<div>Idx BE =A0state usb-ver =A0BE-path =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0=A0</div><div>0 =A0 0 =A0 1 =A0 =A0 USB1.1 =A0/local/domain/0/backe=
nd/vusb/55/0 =A0</div><div>port 1:=A0</div></div><div><br></div><div>root@g=
raff:~# xm usb-attach bosch-w2k3-pv 0 1 2-2</div>
<div>Unexpected error: &lt;class &#39;xen.util.vusb_util.UsbDeviceParseErro=
r&#39;&gt;</div><div><br></div><div>Please report to <a href=3D"mailto:xen-=
devel@lists.xensource.com" target=3D"_blank">xen-devel@lists.xensource.com<=
/a></div>
<div>Traceback (most recent call last):</div><div>=A0 File &quot;/usr/lib/x=
en-4.0/bin/xm&quot;, line 8, in &lt;module&gt;</div><div>=A0 =A0 main.main(=
sys.argv)</div></div></blockquote><div><br>It looks like you&#39;re using X=
en 4.0 -- have you tried 4.1 or 4.2?<br>
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex"><div style=3D"word-wrap:break-word"=
><div>=A0 File &quot;/usr/lib/xen-4.0/lib/python/xen/xm/main.py&quot;, line=
 3620, in main</div>
<div>=A0 =A0 _, rc =3D _run_cmd(cmd, cmd_name, args)</div><div>=A0 File &qu=
ot;/usr/lib/xen-4.0/lib/python/xen/xm/main.py&quot;, line 3644, in _run_cmd=
</div><div>=A0 =A0 return True, cmd(args)</div><div>=A0 File &quot;/usr/lib=
/xen-4.0/lib/python/xen/xm/main.py&quot;, line 2868, in xm_usb_attach</div>
<div>=A0 =A0 if vusb_util.bus_is_assigned(bus):</div><div>=A0 File &quot;/u=
sr/lib/xen-4.0/lib/python/xen/util/vusb_util.py&quot;, line 275, in bus_is_=
assigned</div><div>=A0 =A0 raise UsbDeviceParseError(&quot;Can&#39;t get as=
signment status: (%s).&quot; % bus)</div>
<div>xen.util.vusb_util.UsbDeviceParseError: vusb: Error parsing USB device=
 info: Can&#39;t get assignment status: (2-2).</div><div><br></div><div><br=
></div><div><br></div><div>regards</div><div><br></div><div>
<div style=3D"word-wrap:break-word;font-size:12px"><div style=3D"word-wrap:=
break-word"><span style=3D"text-indent:0px;letter-spacing:normal;font-varia=
nt:normal;font-style:normal;font-weight:normal;line-height:normal;border-co=
llapse:separate;text-transform:none;font-size:12px;white-space:normal;font-=
family:Helvetica;word-spacing:0px"><div style=3D"word-wrap:break-word">
<span style=3D"text-indent:0px;letter-spacing:normal;font-variant:normal;fo=
nt-style:normal;font-weight:normal;line-height:normal;border-collapse:separ=
ate;text-transform:none;font-size:12px;white-space:normal;font-family:Helve=
tica;word-spacing:0px"><div style=3D"word-wrap:break-word">
<span style=3D"text-indent:0px;letter-spacing:normal;font-variant:normal;fo=
nt-style:normal;font-weight:normal;line-height:normal;border-collapse:separ=
ate;text-transform:none;font-size:12px;white-space:normal;font-family:Helve=
tica;word-spacing:0px"><div style=3D"word-wrap:break-word">
<span style=3D"text-indent:0px;letter-spacing:normal;font-variant:normal;fo=
nt-style:normal;font-weight:normal;line-height:normal;border-collapse:separ=
ate;text-transform:none;font-size:12px;white-space:normal;font-family:Helve=
tica;word-spacing:0px"><div style=3D"word-wrap:break-word">
<div><div><div style=3D"word-wrap:break-word"><div style=3D"word-wrap:break=
-word"><div style=3D"word-wrap:break-word"><div style=3D"word-wrap:break-wo=
rd"><div style=3D"word-wrap:break-word"><div style=3D"word-wrap:break-word"=
><div style=3D"word-wrap:break-word">
<div style=3D"word-wrap:break-word"><div><div>Dipl. Ing. Dirk Winning, Syst=
emberater</div><div><a href=3D"mailto:dirk.winning@junidas.de" target=3D"_b=
lank">dirk.winning@junidas.de</a></div><div><br></div><div><span style=3D"f=
ont-size:14px"><div style=3D"margin-top:0px;margin-right:0px;margin-bottom:=
0px;margin-left:0px">
<font size=3D"3"><font color=3D"#0311FF">junidas GmbH, Aixheimer Str. 12, 7=
0619 Stuttgart</font></font></div><div style=3D"margin-top:0px;margin-right=
:0px;margin-bottom:0px;margin-left:0px"><font size=3D"3"><font color=3D"#03=
11FF">Tel. <a href=3D"tel:%2B49%20%28711%29%204599799-12" value=3D"+4971145=
9979912" target=3D"_blank">+49 (711) 4599799-12</a>, Fax <a href=3D"tel:%2B=
49%20%28711%29%204599799-10" value=3D"+49711459979910" target=3D"_blank">+4=
9 (711) 4599799-10</a></font></font></div>
<div style=3D"margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left=
:0px"><font size=3D"3"><font color=3D"#0311FF">Gesch=E4ftsf=FChrer: Dr. Mar=
kus Stoll, Matthias Zepf</font></font></div><div style=3D"margin-top:0px;ma=
rgin-right:0px;margin-bottom:0px;margin-left:0px">
<font size=3D"3"><font color=3D"#0311FF">Amtsgericht Stuttgart, HRB 21939</=
font></font></div></span></div></div></div></div></div></div></div></div></=
div></div></div></div></div></span></div></span></div></span></div></span><=
/div>
</div>
</div>
<br></div><br>_______________________________________________<br>
Xen-devel mailing list<br>
<a href=3D"mailto:Xen-devel@lists.xen.org">Xen-devel@lists.xen.org</a><br>
<a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://lists.x=
en.org/xen-devel</a><br>
<br></blockquote></div><br></div>

--047d7b6766dced905f04cf2c5356--


--===============2232192237978530997==
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.xen.org
http://lists.xen.org/xen-devel

--===============2232192237978530997==--


From xen-devel-bounces@lists.xen.org Fri Nov 23 16:52:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:52:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbwU6-0004w4-4Q; Fri, 23 Nov 2012 16:52:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TbwU4-0004vt-Ry
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:52:09 +0000
Received: from [193.109.254.147:27009] by server-15.bemta-14.messagelabs.com
	id 8D/59-12105-8B9AFA05; Fri, 23 Nov 2012 16:52:08 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353689496!9398705!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3ODY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8872 invoked from network); 23 Nov 2012 16:51:37 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 16:51:37 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="45482315"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 16:51:36 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 11:51:35 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TbwTX-0004GO-IX;
	Fri, 23 Nov 2012 16:51:35 +0000
Date: Fri, 23 Nov 2012 16:50:53 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Tim Deegan <tim@xen.org>
In-Reply-To: <20121123163948.GC97222@ocelot.phlegethon.org>
Message-ID: <alpine.DEB.2.02.1211231650440.13749@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
	<1353686042.16973.19.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211231604470.13749@kaball.uk.xensource.com>
	<1353687991.16973.26.camel@zakaz.uk.xensource.com>
	<20121123163948.GC97222@ocelot.phlegethon.org>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 23 Nov 2012, Tim Deegan wrote:
> At 16:26 +0000 on 23 Nov (1353687991), Ian Campbell wrote:
> > http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html
> > says:
> >         The start address is usually 0 as the zImage code is position
> >         independent.
> >         
> > Of course this has to be true in the modern multiplatform zImage world.
> > 
> > Looking at a random zImage:
> >         000000 e1a00000 e1a00000 e1a00000 e1a00000
> >         *
> >         000020 ea000002 016f2818 00000000 00220548
> >         
> > Where 016f2818 is the magic, 0 is the start and 220548 is the
> > end/length.
> > 
> > I knew I didn't imagine it ;-)
> 
> Yay!  We should definitely do that then, at least until we get a report
> of it not working. :)

Ok, 0 it is then

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 16:52:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 16:52:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbwU6-0004w4-4Q; Fri, 23 Nov 2012 16:52:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TbwU4-0004vt-Ry
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 16:52:09 +0000
Received: from [193.109.254.147:27009] by server-15.bemta-14.messagelabs.com
	id 8D/59-12105-8B9AFA05; Fri, 23 Nov 2012 16:52:08 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353689496!9398705!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3ODY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8872 invoked from network); 23 Nov 2012 16:51:37 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 16:51:37 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="45482315"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 16:51:36 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 11:51:35 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TbwTX-0004GO-IX;
	Fri, 23 Nov 2012 16:51:35 +0000
Date: Fri, 23 Nov 2012 16:50:53 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Tim Deegan <tim@xen.org>
In-Reply-To: <20121123163948.GC97222@ocelot.phlegethon.org>
Message-ID: <alpine.DEB.2.02.1211231650440.13749@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231540190.13749@kaball.uk.xensource.com>
	<1353686042.16973.19.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211231604470.13749@kaball.uk.xensource.com>
	<1353687991.16973.26.camel@zakaz.uk.xensource.com>
	<20121123163948.GC97222@ocelot.phlegethon.org>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 23 Nov 2012, Tim Deegan wrote:
> At 16:26 +0000 on 23 Nov (1353687991), Ian Campbell wrote:
> > http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html
> > says:
> >         The start address is usually 0 as the zImage code is position
> >         independent.
> >         
> > Of course this has to be true in the modern multiplatform zImage world.
> > 
> > Looking at a random zImage:
> >         000000 e1a00000 e1a00000 e1a00000 e1a00000
> >         *
> >         000020 ea000002 016f2818 00000000 00220548
> >         
> > Where 016f2818 is the magic, 0 is the start and 220548 is the
> > end/length.
> > 
> > I knew I didn't imagine it ;-)
> 
> Yay!  We should definitely do that then, at least until we get a report
> of it not working. :)

Ok, 0 it is then

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 17:38:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 17:38:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbxCQ-00062H-Rx; Fri, 23 Nov 2012 17:37:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TbxCO-00062C-UW
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 17:37:57 +0000
Received: from [85.158.137.99:16158] by server-15.bemta-3.messagelabs.com id
	9F/3A-17039-F64BFA05; Fri, 23 Nov 2012 17:37:51 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-15.tower-217.messagelabs.com!1353692270!18013205!1
X-Originating-IP: [192.134.164.82]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21304 invoked from network); 23 Nov 2012 17:37:50 -0000
Received: from mail1-relais-roc.national.inria.fr (HELO
	mail1-relais-roc.national.inria.fr) (192.134.164.82)
	by server-15.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 17:37:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352070000"; d="scan'208";a="182907068"
Received: from unknown (HELO type.ipv6) ([193.50.110.58])
	by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	23 Nov 2012 18:37:49 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TbxCH-0001ZU-Nc; Fri, 23 Nov 2012 18:37:49 +0100
Date: Fri, 23 Nov 2012 18:37:49 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121123173749.GU5954@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
	<1353668646.13542.228.camel@zakaz.uk.xensource.com>
	<50AFA132.5020904@tycho.nsa.gov>
	<1353688217.16973.29.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353688217.16973.29.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell, le Fri 23 Nov 2012 16:30:17 +0000, a =E9crit :
> > Whoops, I'll have to go fix that. The entire mini-os build is sprinkled=
 with
> > tabs and spaces mostly at random,
> =

> Yeah it's a mess AFAICT.
> =

> >  so perhaps a generic fix-indent patch is
> > needed after all the real changes are applied.
> =

> It's either that or just try and make things a bit better with each new
> patch.
> =

> Is it supposed to be Xen coding style or something else I wonder. (I
> think it predates Samuel's involvement, but lets ask him...)

It does predate, yes.

> It would probably be useful to add the emacs magic to the various files.

That could help to keep the files themselves coherent, yes.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 17:38:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 17:38:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbxCQ-00062H-Rx; Fri, 23 Nov 2012 17:37:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TbxCO-00062C-UW
	for xen-devel@lists.xen.org; Fri, 23 Nov 2012 17:37:57 +0000
Received: from [85.158.137.99:16158] by server-15.bemta-3.messagelabs.com id
	9F/3A-17039-F64BFA05; Fri, 23 Nov 2012 17:37:51 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-15.tower-217.messagelabs.com!1353692270!18013205!1
X-Originating-IP: [192.134.164.82]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21304 invoked from network); 23 Nov 2012 17:37:50 -0000
Received: from mail1-relais-roc.national.inria.fr (HELO
	mail1-relais-roc.national.inria.fr) (192.134.164.82)
	by server-15.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 17:37:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352070000"; d="scan'208";a="182907068"
Received: from unknown (HELO type.ipv6) ([193.50.110.58])
	by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	23 Nov 2012 18:37:49 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TbxCH-0001ZU-Nc; Fri, 23 Nov 2012 18:37:49 +0100
Date: Fri, 23 Nov 2012 18:37:49 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121123173749.GU5954@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
	<1353668646.13542.228.camel@zakaz.uk.xensource.com>
	<50AFA132.5020904@tycho.nsa.gov>
	<1353688217.16973.29.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353688217.16973.29.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell, le Fri 23 Nov 2012 16:30:17 +0000, a =E9crit :
> > Whoops, I'll have to go fix that. The entire mini-os build is sprinkled=
 with
> > tabs and spaces mostly at random,
> =

> Yeah it's a mess AFAICT.
> =

> >  so perhaps a generic fix-indent patch is
> > needed after all the real changes are applied.
> =

> It's either that or just try and make things a bit better with each new
> patch.
> =

> Is it supposed to be Xen coding style or something else I wonder. (I
> think it predates Samuel's involvement, but lets ask him...)

It does predate, yes.

> It would probably be useful to add the emacs magic to the various files.

That could help to keep the files themselves coherent, yes.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 18:06:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 18:06:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbxdF-0006qG-99; Fri, 23 Nov 2012 18:05:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TbxdD-0006qB-MO
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 18:05:39 +0000
Received: from [85.158.139.83:64731] by server-13.bemta-5.messagelabs.com id
	7C/CC-27809-2FABFA05; Fri, 23 Nov 2012 18:05:38 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1353693936!31106783!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg0MTA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25810 invoked from network); 23 Nov 2012 18:05:38 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 18:05:38 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="215354743"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 18:05:36 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 13:05:35 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1Tbxd9-0005Lf-Ei;
	Fri, 23 Nov 2012 18:05:35 +0000
Date: Fri, 23 Nov 2012 18:04:53 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: <xen-devel@lists.xensource.com>
Message-ID: <alpine.DEB.2.02.1211231715130.13749@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>, Tim Deegan <tim@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH v2] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The zImage format is extremely simple: it only consists of a magic
number and 2 addresses in a specific position (see
http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).

Some bootloaders expect a zImage; considering that it doesn't cost us
much to build Xen compatible with the format, make it so.

Changes in v2:
- code style;
- pass 0 a start address.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 25c4cfe..347ddcf 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -22,6 +22,8 @@
 #include <asm/processor-ca15.h>
 #include <asm/asm_defns.h>
 
+#define ZIMAGE_MAGIC_NUMBER 0x016f2818
+
 #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
 #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
 #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
@@ -52,6 +54,18 @@
 	 * or the initial pagetable code below will need adjustment. */
 	.global start
 start:
+
+	/* zImage magic header, see:
+	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
+	 */
+	.skip 0x20
+	b     past_zImage
+	.word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
+	.word 0x00000000             /* absolute load/run zImage address or
+	                              * 0 for PiC */
+	.word _end                   /* zImage end address */
+
+past_zImage:
 	cpsid aif                    /* Disable all interrupts */
 
 	/* Save the bootloader arguments in less-clobberable registers */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 18:06:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 18:06:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbxdF-0006qG-99; Fri, 23 Nov 2012 18:05:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TbxdD-0006qB-MO
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 18:05:39 +0000
Received: from [85.158.139.83:64731] by server-13.bemta-5.messagelabs.com id
	7C/CC-27809-2FABFA05; Fri, 23 Nov 2012 18:05:38 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1353693936!31106783!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg0MTA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25810 invoked from network); 23 Nov 2012 18:05:38 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-13.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 18:05:38 -0000
X-IronPort-AV: E=Sophos;i="4.83,307,1352073600"; d="scan'208";a="215354743"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 18:05:36 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 13:05:35 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1Tbxd9-0005Lf-Ei;
	Fri, 23 Nov 2012 18:05:35 +0000
Date: Fri, 23 Nov 2012 18:04:53 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: <xen-devel@lists.xensource.com>
Message-ID: <alpine.DEB.2.02.1211231715130.13749@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>, Tim Deegan <tim@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH v2] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The zImage format is extremely simple: it only consists of a magic
number and 2 addresses in a specific position (see
http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).

Some bootloaders expect a zImage; considering that it doesn't cost us
much to build Xen compatible with the format, make it so.

Changes in v2:
- code style;
- pass 0 a start address.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 25c4cfe..347ddcf 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -22,6 +22,8 @@
 #include <asm/processor-ca15.h>
 #include <asm/asm_defns.h>
 
+#define ZIMAGE_MAGIC_NUMBER 0x016f2818
+
 #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
 #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
 #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
@@ -52,6 +54,18 @@
 	 * or the initial pagetable code below will need adjustment. */
 	.global start
 start:
+
+	/* zImage magic header, see:
+	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
+	 */
+	.skip 0x20
+	b     past_zImage
+	.word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
+	.word 0x00000000             /* absolute load/run zImage address or
+	                              * 0 for PiC */
+	.word _end                   /* zImage end address */
+
+past_zImage:
 	cpsid aif                    /* Disable all interrupts */
 
 	/* Save the bootloader arguments in less-clobberable registers */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 18:49:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 18:49:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbyIk-0007nr-Ox; Fri, 23 Nov 2012 18:48:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbyIj-0007nm-Lj
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 18:48:33 +0000
Received: from [85.158.139.83:36047] by server-15.bemta-5.messagelabs.com id
	B5/84-26920-005CFA05; Fri, 23 Nov 2012 18:48:32 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1353696511!27688158!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12428 invoked from network); 23 Nov 2012 18:48:32 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 18:48:32 -0000
X-IronPort-AV: E=Sophos;i="4.83,309,1352073600"; d="scan'208";a="15980119"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 18:48:31 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 18:48:31 +0000
Message-ID: <1353696510.29837.19.camel@dagon.hellion.org.uk>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Fri, 23 Nov 2012 18:48:30 +0000
In-Reply-To: <alpine.DEB.2.02.1211231715130.13749@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231715130.13749@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH v2] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 18:04 +0000, Stefano Stabellini wrote:
> The zImage format is extremely simple: it only consists of a magic
> number and 2 addresses in a specific position (see
> http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
> 
> Some bootloaders expect a zImage; considering that it doesn't cost us
> much to build Xen compatible with the format, make it so.
> 
> Changes in v2:
> - code style;
> - pass 0 a start address.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> index 25c4cfe..347ddcf 100644
> --- a/xen/arch/arm/head.S
> +++ b/xen/arch/arm/head.S
> @@ -22,6 +22,8 @@
>  #include <asm/processor-ca15.h>
>  #include <asm/asm_defns.h>
>  
> +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> +
>  #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
>  #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
>  #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
> @@ -52,6 +54,18 @@
>  	 * or the initial pagetable code below will need adjustment. */
>  	.global start
>  start:
> +
> +	/* zImage magic header, see:
> +	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
> +	 */
> +	.skip 0x20

This was better as the explicit repeated nops, as it stands it's not at
all clear that you can start executing at start. It might even rely on
the specific assemblers behaviour?

Also this wasn't what Tim suggested, which was branch then skip, not
skip then branch. I think the nops are better for consistency with Linux
though.

> +	b     past_zImage
> +	.word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
> +	.word 0x00000000             /* absolute load/run zImage address or
> +	                              * 0 for PiC */
> +	.word _end                   /* zImage end address */

This needs to be "_end - _start".

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 18:49:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 18:49:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbyIk-0007nr-Ox; Fri, 23 Nov 2012 18:48:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TbyIj-0007nm-Lj
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 18:48:33 +0000
Received: from [85.158.139.83:36047] by server-15.bemta-5.messagelabs.com id
	B5/84-26920-005CFA05; Fri, 23 Nov 2012 18:48:32 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1353696511!27688158!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12428 invoked from network); 23 Nov 2012 18:48:32 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 18:48:32 -0000
X-IronPort-AV: E=Sophos;i="4.83,309,1352073600"; d="scan'208";a="15980119"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 18:48:31 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 23 Nov 2012 18:48:31 +0000
Message-ID: <1353696510.29837.19.camel@dagon.hellion.org.uk>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Fri, 23 Nov 2012 18:48:30 +0000
In-Reply-To: <alpine.DEB.2.02.1211231715130.13749@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231715130.13749@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] [PATCH v2] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 18:04 +0000, Stefano Stabellini wrote:
> The zImage format is extremely simple: it only consists of a magic
> number and 2 addresses in a specific position (see
> http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
> 
> Some bootloaders expect a zImage; considering that it doesn't cost us
> much to build Xen compatible with the format, make it so.
> 
> Changes in v2:
> - code style;
> - pass 0 a start address.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> index 25c4cfe..347ddcf 100644
> --- a/xen/arch/arm/head.S
> +++ b/xen/arch/arm/head.S
> @@ -22,6 +22,8 @@
>  #include <asm/processor-ca15.h>
>  #include <asm/asm_defns.h>
>  
> +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> +
>  #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
>  #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
>  #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
> @@ -52,6 +54,18 @@
>  	 * or the initial pagetable code below will need adjustment. */
>  	.global start
>  start:
> +
> +	/* zImage magic header, see:
> +	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
> +	 */
> +	.skip 0x20

This was better as the explicit repeated nops, as it stands it's not at
all clear that you can start executing at start. It might even rely on
the specific assemblers behaviour?

Also this wasn't what Tim suggested, which was branch then skip, not
skip then branch. I think the nops are better for consistency with Linux
though.

> +	b     past_zImage
> +	.word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
> +	.word 0x00000000             /* absolute load/run zImage address or
> +	                              * 0 for PiC */
> +	.word _end                   /* zImage end address */

This needs to be "_end - _start".

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 18:59:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 18:59:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbySd-00088t-Sa; Fri, 23 Nov 2012 18:58:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TbySc-00088m-NW
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 18:58:46 +0000
Received: from [85.158.138.51:9612] by server-15.bemta-3.messagelabs.com id
	F5/DF-23779-567CFA05; Fri, 23 Nov 2012 18:58:45 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353697125!31203970!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23622 invoked from network); 23 Nov 2012 18:58:45 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-8.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 18:58:45 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TbySa-0000aB-0Y; Fri, 23 Nov 2012 18:58:44 +0000
Date: Fri, 23 Nov 2012 18:58:43 +0000
From: Tim Deegan <tim@xen.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121123185843.GD97222@ocelot.phlegethon.org>
References: <alpine.DEB.2.02.1211231715130.13749@kaball.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1211231715130.13749@kaball.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Anthony Perard <anthony.perard@citrix.com>, xen-devel@lists.xensource.com,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH v2] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 18:04 +0000 on 23 Nov (1353693893), Stefano Stabellini wrote:
> The zImage format is extremely simple: it only consists of a magic
> number and 2 addresses in a specific position (see
> http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
> 
> Some bootloaders expect a zImage; considering that it doesn't cost us
> much to build Xen compatible with the format, make it so.
> 
> Changes in v2:
> - code style;
> - pass 0 a start address.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> index 25c4cfe..347ddcf 100644
> --- a/xen/arch/arm/head.S
> +++ b/xen/arch/arm/head.S
> @@ -22,6 +22,8 @@
>  #include <asm/processor-ca15.h>
>  #include <asm/asm_defns.h>
>  
> +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> +
>  #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
>  #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
>  #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
> @@ -52,6 +54,18 @@
>  	 * or the initial pagetable code below will need adjustment. */
>  	.global start
>  start:
> +
> +	/* zImage magic header, see:
> +	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
> +	 */
> +	.skip 0x20
> +	b     past_zImage

Surely branch _before_ the padding?  

> +	.word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
> +	.word 0x00000000             /* absolute load/run zImage address or
> +	                              * 0 for PiC */
> +	.word _end                   /* zImage end address */

Not (_end - _start)?

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 18:59:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 18:59:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbySd-00088t-Sa; Fri, 23 Nov 2012 18:58:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TbySc-00088m-NW
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 18:58:46 +0000
Received: from [85.158.138.51:9612] by server-15.bemta-3.messagelabs.com id
	F5/DF-23779-567CFA05; Fri, 23 Nov 2012 18:58:45 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353697125!31203970!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23622 invoked from network); 23 Nov 2012 18:58:45 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-8.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 23 Nov 2012 18:58:45 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TbySa-0000aB-0Y; Fri, 23 Nov 2012 18:58:44 +0000
Date: Fri, 23 Nov 2012 18:58:43 +0000
From: Tim Deegan <tim@xen.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121123185843.GD97222@ocelot.phlegethon.org>
References: <alpine.DEB.2.02.1211231715130.13749@kaball.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1211231715130.13749@kaball.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Anthony Perard <anthony.perard@citrix.com>, xen-devel@lists.xensource.com,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH v2] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 18:04 +0000 on 23 Nov (1353693893), Stefano Stabellini wrote:
> The zImage format is extremely simple: it only consists of a magic
> number and 2 addresses in a specific position (see
> http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
> 
> Some bootloaders expect a zImage; considering that it doesn't cost us
> much to build Xen compatible with the format, make it so.
> 
> Changes in v2:
> - code style;
> - pass 0 a start address.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> index 25c4cfe..347ddcf 100644
> --- a/xen/arch/arm/head.S
> +++ b/xen/arch/arm/head.S
> @@ -22,6 +22,8 @@
>  #include <asm/processor-ca15.h>
>  #include <asm/asm_defns.h>
>  
> +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> +
>  #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
>  #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
>  #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
> @@ -52,6 +54,18 @@
>  	 * or the initial pagetable code below will need adjustment. */
>  	.global start
>  start:
> +
> +	/* zImage magic header, see:
> +	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
> +	 */
> +	.skip 0x20
> +	b     past_zImage

Surely branch _before_ the padding?  

> +	.word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
> +	.word 0x00000000             /* absolute load/run zImage address or
> +	                              * 0 for PiC */
> +	.word _end                   /* zImage end address */

Not (_end - _start)?

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 20:25:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 20:25:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbzoR-0001qj-4Q; Fri, 23 Nov 2012 20:25:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ebiederm@xmission.com>) id 1TbzoO-0001qe-Rz
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 20:25:21 +0000
Received: from [85.158.138.51:9786] by server-1.bemta-3.messagelabs.com id
	41/46-12169-BABDFA05; Fri, 23 Nov 2012 20:25:15 +0000
X-Env-Sender: ebiederm@xmission.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353702312!31209491!1
X-Originating-IP: [166.70.13.231]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13930 invoked from network); 23 Nov 2012 20:25:13 -0000
Received: from out01.mta.xmission.com (HELO out01.mta.xmission.com)
	(166.70.13.231) by server-8.tower-174.messagelabs.com with SMTP;
	23 Nov 2012 20:25:13 -0000
Received: from in02.mta.xmission.com ([166.70.13.52])
	by out01.mta.xmission.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.76) (envelope-from <ebiederm@xmission.com>)
	id 1Tbzo4-0000uk-2d; Fri, 23 Nov 2012 13:25:00 -0700
Received: from 75-135-205-0.dhcp.krny.ne.charter.com ([75.135.205.0]
	helo=eric-ThinkPad-X220.xmission.com)
	by in02.mta.xmission.com with esmtpsa
	(TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76)
	(envelope-from <ebiederm@xmission.com>)
	id 1Tbzo0-0005Cc-5M; Fri, 23 Nov 2012 13:24:59 -0700
From: ebiederm@xmission.com (Eric W. Biederman)
To: Daniel Kiper <daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com>
	<20121123094516.GA2921@host-192-168-1-59.local.net-space.pl>
Date: Fri, 23 Nov 2012 12:24:51 -0800
In-Reply-To: <20121123094516.GA2921@host-192-168-1-59.local.net-space.pl>
	(Daniel Kiper's message of "Fri, 23 Nov 2012 10:47:38 +0100")
Message-ID: <877gpct6cs.fsf@xmission.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)
MIME-Version: 1.0
X-XM-AID: U2FsdGVkX18YNNde0h/UaM0/CnIlTzmZ2dbqhCW57a8=
X-SA-Exim-Connect-IP: 75.135.205.0
X-SA-Exim-Mail-From: ebiederm@xmission.com
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sa03.xmission.com
X-Spam-Level: 
X-Spam-Status: No, score=-3.9 required=8.0 tests=ALL_TRUSTED,BAYES_00,
	DCC_CHECK_NEGATIVE,TVD_RCVD_IP,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01,
	T_XMDrugObfuBody_08,XMSolicitRefs_0 autolearn=disabled version=3.3.2
X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
	*  0.0 TVD_RCVD_IP TVD_RCVD_IP
	*  0.0 T_TM2_M_HEADER_IN_MSG BODY: T_TM2_M_HEADER_IN_MSG
	* -3.0 BAYES_00 BODY: Bayes spam probability is 0 to 1%
	*      [score: 0.0000]
	* -0.0 DCC_CHECK_NEGATIVE Not listed in DCC
	*      [sa03 1397; Body=1 Fuz1=1 Fuz2=1]
	*  0.0 T_TooManySym_01 4+ unique symbols in subject
	*  0.0 T_XMDrugObfuBody_08 obfuscated drug references
	*  0.1 XMSolicitRefs_0 Weightloss drug
X-Spam-DCC: XMission; sa03 1397; Body=1 Fuz1=1 Fuz2=1 
X-Spam-Combo: ;Daniel Kiper <daniel.kiper@oracle.com>
X-Spam-Relay-Country: 
X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 03:05:19 +0000)
X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com)
Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	jbeulich@suse.com, hpa@zytor.com, tglx@linutronix.de
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Daniel Kiper <daniel.kiper@oracle.com> writes:

> On Thu, Nov 22, 2012 at 04:15:48AM -0800, ebiederm@xmission.com wrote:
>>
>> Is this for when the hypervisor crashes and we want a crash dump of
>> that?
>
> dom0 at boot gets some info about kexec/kdump configuration from Xen hypervisor
> (e.g. placement of crash kernel area). Later if you call kexec syscall most
> things are done in the same way as on baremetal. However, after placing image
> in memory, HYPERVISOR_kexec_op() hypercall must be called to inform hypervisor
> that image is loaded (new hook machine_kexec_load is used for this;
> machine_kexec_unload is used for unload). Then Xen establishes fixmap for pages
> found in page_list[] and returns control to dom0. If dom0 crashes or "kexec execute"
> is used by user then dom0 calls HYPERVISOR_kexec_op() to instruct hypervisor that
> kexec/kdump image should be executed immediately. Xen calls relocate_kernel()
> and all things runs as usual.


Close

>> Successful code reuse depends upon not breaking the assumptions on which
>> the code relies, or modifying the code so that the new modified
>> assumptions are clear.  In this case you might as well define up as down
>> for all of the sense kexec_ops makes.
>
> Hmmm... Well, problem with above mentioned functions is that they work
> on physical addresses. In Xen PVOPS (currently dom0 is PVOPS) they
> are useless in kexec/kdump case. It means that physical addresses
> must be converted to/from machine addresses which has a real meaning
> in Xen PVOPS case. That is why those funtions were introduced.

Agreed operating on addresses that are relevant to the operation at hand
makes sense.

>> >> There may be a point to all of these but you are mixing and matching
>> >> things badly.
>> >
>> > Do you whish to split this kexec_ops struct to something which
>> > works with addresses and something which is reponsible for
>> > loading, unloading and executing kexec/kdump? I am able to change
>> > that but I would like to know a bit about your vision first.
>>
>> My vision is that we should have code that makes sense.
>>
>> My suspicion is that what you want is a cousin of the existing kexec
>> system call.  Perhaps what is needed is a flag to say use the firmware
>> kexec system call.
>>
>> I absolutely do not understand what Xen is trying to do.  kexec by
>> design should not require any firmware specific hooks.  kexec at this
>> level should only need to care about the processor architeture.  Clearly
>> what you are doing with Xen requires special hooks separate even from
>> the normal paravirt hooks.  So I do not understand you are trying to do.
>>
>> It needs to be clear from the code what is happening differently in the
>> Xen case.  Otherwise the code is unmaintainable as no one will be able
>> to understand it.
>
> I agree. I could remove all machine_* hooks from kexec_ops and call Xen
> specific functions from arch files. However, I need to add two new
> machine calls, machine_kexec_load and machine_kexec_unload, in the same
> manner as existing machine_* calls. In general they could be used to inform
> firmware (in this case Xen) that kexec/kdump image is loaded.
>
> kimage_alloc_pages, kimage_free_pages, page_to_pfn, pfn_to_page, virt_to_phys
> and phys_to_virt are worse. If we could not find good solution how to replace
> them then we end up with calling Xen specific version of kexec/kdump which
> would contain nearly full copy of exisiting kexec/kdump code. Not good.
>
> We could add some code to kernel/kexec.c which depends on CONFIG_XEN.
> It could contain above mentioned functions which later will be called
> by existing kexec code. This is not nice to be honest. However, I hope
> that we could find better solution for that problem.

Since in the Xen case you are not performing a normal kexec or kdump if
you are going to continue to use the kexec system call then another flag
(like the KEXEC_ON_CRASH flag) should be used.

The userspace flag should be something like KEXEC_HYPERVISOR.  From
there we can have a generic interface that feeds into whatever the Xen
infrastructure is.  And if any other hypervisors implement kexec like
functionality it could feed into them if we so choose.

When the choice is clearly between a linux-only kexec and for a hypervisor
level kexec using different functions to understand the target addresses
makes sense.

And of course /sbin/kexec can easity take an additional flag to say load
the kexec image to the hypervisor.

Eric

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 20:25:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 20:25:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TbzoR-0001qj-4Q; Fri, 23 Nov 2012 20:25:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ebiederm@xmission.com>) id 1TbzoO-0001qe-Rz
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 20:25:21 +0000
Received: from [85.158.138.51:9786] by server-1.bemta-3.messagelabs.com id
	41/46-12169-BABDFA05; Fri, 23 Nov 2012 20:25:15 +0000
X-Env-Sender: ebiederm@xmission.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353702312!31209491!1
X-Originating-IP: [166.70.13.231]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13930 invoked from network); 23 Nov 2012 20:25:13 -0000
Received: from out01.mta.xmission.com (HELO out01.mta.xmission.com)
	(166.70.13.231) by server-8.tower-174.messagelabs.com with SMTP;
	23 Nov 2012 20:25:13 -0000
Received: from in02.mta.xmission.com ([166.70.13.52])
	by out01.mta.xmission.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.76) (envelope-from <ebiederm@xmission.com>)
	id 1Tbzo4-0000uk-2d; Fri, 23 Nov 2012 13:25:00 -0700
Received: from 75-135-205-0.dhcp.krny.ne.charter.com ([75.135.205.0]
	helo=eric-ThinkPad-X220.xmission.com)
	by in02.mta.xmission.com with esmtpsa
	(TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76)
	(envelope-from <ebiederm@xmission.com>)
	id 1Tbzo0-0005Cc-5M; Fri, 23 Nov 2012 13:24:59 -0700
From: ebiederm@xmission.com (Eric W. Biederman)
To: Daniel Kiper <daniel.kiper@oracle.com>
References: <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
	<1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
	<87lidwtego.fsf@xmission.com>
	<20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
	<87txshx28b.fsf@xmission.com>
	<20121123094516.GA2921@host-192-168-1-59.local.net-space.pl>
Date: Fri, 23 Nov 2012 12:24:51 -0800
In-Reply-To: <20121123094516.GA2921@host-192-168-1-59.local.net-space.pl>
	(Daniel Kiper's message of "Fri, 23 Nov 2012 10:47:38 +0100")
Message-ID: <877gpct6cs.fsf@xmission.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)
MIME-Version: 1.0
X-XM-AID: U2FsdGVkX18YNNde0h/UaM0/CnIlTzmZ2dbqhCW57a8=
X-SA-Exim-Connect-IP: 75.135.205.0
X-SA-Exim-Mail-From: ebiederm@xmission.com
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sa03.xmission.com
X-Spam-Level: 
X-Spam-Status: No, score=-3.9 required=8.0 tests=ALL_TRUSTED,BAYES_00,
	DCC_CHECK_NEGATIVE,TVD_RCVD_IP,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01,
	T_XMDrugObfuBody_08,XMSolicitRefs_0 autolearn=disabled version=3.3.2
X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
	*  0.0 TVD_RCVD_IP TVD_RCVD_IP
	*  0.0 T_TM2_M_HEADER_IN_MSG BODY: T_TM2_M_HEADER_IN_MSG
	* -3.0 BAYES_00 BODY: Bayes spam probability is 0 to 1%
	*      [score: 0.0000]
	* -0.0 DCC_CHECK_NEGATIVE Not listed in DCC
	*      [sa03 1397; Body=1 Fuz1=1 Fuz2=1]
	*  0.0 T_TooManySym_01 4+ unique symbols in subject
	*  0.0 T_XMDrugObfuBody_08 obfuscated drug references
	*  0.1 XMSolicitRefs_0 Weightloss drug
X-Spam-DCC: XMission; sa03 1397; Body=1 Fuz1=1 Fuz2=1 
X-Spam-Combo: ;Daniel Kiper <daniel.kiper@oracle.com>
X-Spam-Relay-Country: 
X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 03:05:19 +0000)
X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com)
Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	andrew.cooper3@citrix.com, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	jbeulich@suse.com, hpa@zytor.com, tglx@linutronix.de
Subject: Re: [Xen-devel] [PATCH v2 01/11] kexec: introduce kexec_ops struct
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Daniel Kiper <daniel.kiper@oracle.com> writes:

> On Thu, Nov 22, 2012 at 04:15:48AM -0800, ebiederm@xmission.com wrote:
>>
>> Is this for when the hypervisor crashes and we want a crash dump of
>> that?
>
> dom0 at boot gets some info about kexec/kdump configuration from Xen hypervisor
> (e.g. placement of crash kernel area). Later if you call kexec syscall most
> things are done in the same way as on baremetal. However, after placing image
> in memory, HYPERVISOR_kexec_op() hypercall must be called to inform hypervisor
> that image is loaded (new hook machine_kexec_load is used for this;
> machine_kexec_unload is used for unload). Then Xen establishes fixmap for pages
> found in page_list[] and returns control to dom0. If dom0 crashes or "kexec execute"
> is used by user then dom0 calls HYPERVISOR_kexec_op() to instruct hypervisor that
> kexec/kdump image should be executed immediately. Xen calls relocate_kernel()
> and all things runs as usual.


Close

>> Successful code reuse depends upon not breaking the assumptions on which
>> the code relies, or modifying the code so that the new modified
>> assumptions are clear.  In this case you might as well define up as down
>> for all of the sense kexec_ops makes.
>
> Hmmm... Well, problem with above mentioned functions is that they work
> on physical addresses. In Xen PVOPS (currently dom0 is PVOPS) they
> are useless in kexec/kdump case. It means that physical addresses
> must be converted to/from machine addresses which has a real meaning
> in Xen PVOPS case. That is why those funtions were introduced.

Agreed operating on addresses that are relevant to the operation at hand
makes sense.

>> >> There may be a point to all of these but you are mixing and matching
>> >> things badly.
>> >
>> > Do you whish to split this kexec_ops struct to something which
>> > works with addresses and something which is reponsible for
>> > loading, unloading and executing kexec/kdump? I am able to change
>> > that but I would like to know a bit about your vision first.
>>
>> My vision is that we should have code that makes sense.
>>
>> My suspicion is that what you want is a cousin of the existing kexec
>> system call.  Perhaps what is needed is a flag to say use the firmware
>> kexec system call.
>>
>> I absolutely do not understand what Xen is trying to do.  kexec by
>> design should not require any firmware specific hooks.  kexec at this
>> level should only need to care about the processor architeture.  Clearly
>> what you are doing with Xen requires special hooks separate even from
>> the normal paravirt hooks.  So I do not understand you are trying to do.
>>
>> It needs to be clear from the code what is happening differently in the
>> Xen case.  Otherwise the code is unmaintainable as no one will be able
>> to understand it.
>
> I agree. I could remove all machine_* hooks from kexec_ops and call Xen
> specific functions from arch files. However, I need to add two new
> machine calls, machine_kexec_load and machine_kexec_unload, in the same
> manner as existing machine_* calls. In general they could be used to inform
> firmware (in this case Xen) that kexec/kdump image is loaded.
>
> kimage_alloc_pages, kimage_free_pages, page_to_pfn, pfn_to_page, virt_to_phys
> and phys_to_virt are worse. If we could not find good solution how to replace
> them then we end up with calling Xen specific version of kexec/kdump which
> would contain nearly full copy of exisiting kexec/kdump code. Not good.
>
> We could add some code to kernel/kexec.c which depends on CONFIG_XEN.
> It could contain above mentioned functions which later will be called
> by existing kexec code. This is not nice to be honest. However, I hope
> that we could find better solution for that problem.

Since in the Xen case you are not performing a normal kexec or kdump if
you are going to continue to use the kexec system call then another flag
(like the KEXEC_ON_CRASH flag) should be used.

The userspace flag should be something like KEXEC_HYPERVISOR.  From
there we can have a generic interface that feeds into whatever the Xen
infrastructure is.  And if any other hypervisors implement kexec like
functionality it could feed into them if we so choose.

When the choice is clearly between a linux-only kexec and for a hypervisor
level kexec using different functions to understand the target addresses
makes sense.

And of course /sbin/kexec can easity take an additional flag to say load
the kexec image to the hypervisor.

Eric

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 20:48:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 20:48:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tc0Am-0002PH-7p; Fri, 23 Nov 2012 20:48:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Tc0Ak-0002PC-VN
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 20:48:27 +0000
Received: from [85.158.139.83:44703] by server-1.bemta-5.messagelabs.com id
	B4/A9-05877-A11EFA05; Fri, 23 Nov 2012 20:48:26 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353703701!20405433!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10607 invoked from network); 23 Nov 2012 20:48:21 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 20:48:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,309,1352073600"; d="scan'208";a="15981285"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 20:48:21 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 23 Nov 2012 20:48:21 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1Tc0Af-0003W2-9a;
	Fri, 23 Nov 2012 20:48:21 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1Tc0Af-0000IB-6g;
	Fri, 23 Nov 2012 20:48:21 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14472-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 23 Nov 2012 20:48:21 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [qemu-upstream-unstable test] 14472: tolerable FAIL -
	PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14472 qemu-upstream-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14472/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-i386-xl-qemuu-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-xend-qemuu-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-qemuu-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-qemuu-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-i386-xl-qemuu-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-xl-qemuu-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-amd64-xl-qemuu-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-amd64-qemuu-win   16 leak-check/check             fail   never pass

version targeted for testing:
 qemuu                1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c
baseline version:
 qemuu                cdf4d2bb4006805f209712fbb8ed1f83127e9984

------------------------------------------------------------
People who touched revisions under test:
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-win-vcpus1                             fail    
 test-amd64-i386-xl-qemuu-win-vcpus1                          fail    
 test-amd64-i386-xl-qemuu-winxpsp3-vcpus1                     fail    
 test-amd64-amd64-qemuu-win                                   fail    
 test-amd64-i386-qemuu-win                                    fail    
 test-amd64-amd64-xl-qemuu-win                                fail    
 test-amd64-i386-xend-qemuu-winxpsp3                          fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=qemu-upstream-unstable
+ revision=1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push qemu-upstream-unstable 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c
+ branch=qemu-upstream-unstable
+ revision=1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=qemuu
+ xenbranch=xen-unstable
+ '[' xqemuu = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.qemu-upstream-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.qemu-upstream-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree qemu-upstream-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/qemu-upstream-unstable
+ git push xen@xenbits.xensource.com:git/qemu-upstream-unstable.git 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c:master
Counting objects: 1   
Counting objects: 173   
Counting objects: 1819   
Counting objects: 8466   
Counting objects: 32705, done.
Compressing objects:   0% (1/7103)   
Compressing objects:   1% (72/7103)   
Compressing objects:   2% (143/7103)   
Compressing objects:   3% (214/7103)   
Compressing objects:   4% (285/7103)   
Compressing objects:   5% (356/7103)   
Compressing objects:   6% (427/7103)   
Compressing objects:   7% (498/7103)   
Compressing objects:   8% (569/7103)   
Compressing objects:   9% (640/7103)   
Compressing objects:  10% (711/7103)   
Compressing objects:  11% (782/7103)   
Compressing objects:  12% (853/7103)   
Compressing objects:  13% (924/7103)   
Compressing objects:  14% (995/7103)   
Compressing objects:  15% (1066/7103)   
Compressing objects:  16% (1137/7103)   
Compressing objects:  17% (1208/7103)   
Compressing objects:  18% (1279/7103)   
Compressing objects:  19% (1350/7103)   
Compressing objects:  20% (1421/7103)   
Compressing objects:  21% (1492/7103)   
Compressing objects:  22% (1563/7103)   
Compressing objects:  23% (1634/7103)   
Compressing objects:  24% (1705/7103)   
Compressing objects:  25% (1776/7103)   
Compressing objects:  26% (1847/7103)   
Compressing objects:  27% (1918/7103)   
Compressing objects:  28% (1989/7103)   
Compressing objects:  29% (2060/7103)   
Compressing objects:  30% (2131/7103)   
Compressing objects:  31% (2202/7103)   
Compressing objects:  32% (2273/7103)   
Compressing objects:  33% (2344/7103)   
Compressing objects:  34% (2416/7103)   
Compressing objects:  35% (2487/7103)   
Compressing objects:  36% (2558/7103)   
Compressing objects:  37% (2629/7103)   
Compressing objects:  38% (2700/7103)   
Compressing objects:  39% (2771/7103)   
Compressing objects:  40% (2842/7103)   
Compressing objects:  41% (2913/7103)   
Compressing objects:  42% (2984/7103)   
Compressing objects:  43% (3055/7103)   
Compressing objects:  44% (3126/7103)   
Compressing objects:  45% (3197/7103)   
Compressing objects:  46% (3268/7103)   
Compressing objects:  47% (3339/7103)   
Compressing objects:  48% (3410/7103)   
Compressing objects:  49% (3481/7103)   
Compressing objects:  50% (3552/7103)   
Compressing objects:  51% (3623/7103)   
Compressing objects:  52% (3694/7103)   
Compressing objects:  53% (3765/7103)   
Compressing objects:  54% (3836/7103)   
Compressing objects:  55% (3907/7103)   
Compressing objects:  56% (3978/7103)   
Compressing objects:  57% (4049/7103)   
Compressing objects:  58% (4120/7103)   
Compressing objects:  59% (4191/7103)   
Compressing objects:  60% (4262/7103)   
Compressing objects:  61% (4333/7103)   
Compressing objects:  62% (4404/7103)   
Compressing objects:  63% (4475/7103)   
Compressing objects:  64% (4546/7103)   
Compressing objects:  65% (4617/7103)   
Compressing objects:  66% (4688/7103)   
Compressing objects:  67% (4760/7103)   
Compressing objects:  68% (4831/7103)   
Compressing objects:  69% (4902/7103)   
Compressing objects:  70% (4973/7103)   
Compressing objects:  71% (5044/7103)   
Compressing objects:  72% (5115/7103)   
Compressing objects:  73% (5186/7103)   
Compressing objects:  74% (5257/7103)   
Compressing objects:  75% (5328/7103)   
Compressing objects:  76% (5399/7103)   
Compressing objects:  77% (5470/7103)   
Compressing objects:  78% (5541/7103)   
Compressing objects:  79% (5612/7103)   
Compressing objects:  80% (5683/7103)   
Compressing objects:  81% (5754/7103)   
Compressing objects:  82% (5825/7103)   
Compressing objects:  83% (5896/7103)   
Compressing objects:  84% (5967/7103)   
Compressing objects:  85% (6038/7103)   
Compressing objects:  86% (6109/7103)   
Compressing objects:  87% (6180/7103)   
Compressing objects:  88% (6251/7103)   
Compressing objects:  89% (6322/7103)   
Compressing objects:  90% (6393/7103)   
Compressing objects:  91% (6464/7103)   
Compressing objects:  92% (6535/7103)   
Compressing objects:  93% (6606/7103)   
Compressing objects:  94% (6677/7103)   
Compressing objects:  95% (6748/7103)   
Compressing objects:  96% (6819/7103)   
Compressing objects:  97% (6890/7103)   
Compressing objects:  98% (6961/7103)   
Compressing objects:  99% (7032/7103)   
Compressing objects: 100% (7103/7103)   
Compressing objects: 100% (7103/7103), done.
Writing objects:   0% (1/31440)   
Writing objects:   1% (315/31440)   
Writing objects:   2% (629/31440)   
Writing objects:   3% (944/31440)   
Writing objects:   4% (1258/31440)   
Writing objects:   5% (1572/31440)   
Writing objects:   6% (1887/31440)   
Writing objects:   7% (2201/31440)   
Writing objects:   8% (2516/31440)   
Writing objects:   9% (2830/31440)   
Writing objects:  10% (3144/31440)   
Writing objects:  11% (3459/31440)   
Writing objects:  12% (3773/31440)   
Writing objects:  13% (4088/31440)   
Writing objects:  14% (4402/31440)   
Writing objects:  15% (4716/31440)   
Writing objects:  16% (5031/31440)   
Writing objects:  17% (5345/31440)   
Writing objects:  18% (5660/31440)   
Writing objects:  19% (5978/31440)   
Writing objects:  20% (6288/31440), 2.07 MiB | 3896 KiB/s   
Writing objects:  20% (6401/31440), 2.27 MiB | 2153 KiB/s   
Writing objects:  21% (6603/31440), 2.27 MiB | 2153 KiB/s   
Writing objects:  22% (6919/31440), 2.27 MiB | 2153 KiB/s   
Writing objects:  23% (7233/31440), 2.64 MiB | 1561 KiB/s   
Writing objects:  23% (7530/31440), 2.64 MiB | 1561 KiB/s   
Writing objects:  24% (7547/31440), 2.64 MiB | 1561 KiB/s   
Writing objects:  25% (7860/31440), 3.02 MiB | 1294 KiB/s   
Writing objects:  25% (8070/31440), 3.39 MiB | 1139 KiB/s   
Writing objects:  26% (8175/31440), 3.77 MiB | 1040 KiB/s   
Writing objects:  26% (8484/31440), 3.77 MiB | 1040 KiB/s   
Writing objects:  27% (8490/31440), 3.77 MiB | 1040 KiB/s   
Writing objects:  28% (8805/31440), 4.14 MiB | 950 KiB/s   
Writing objects:  28% (8896/31440), 4.52 MiB | 900 KiB/s   
Writing objects:  29% (9119/31440), 4.52 MiB | 900 KiB/s   
Writing objects:  29% (9373/31440), 4.89 MiB | 865 KiB/s   
Writing objects:  30% (9433/31440), 4.89 MiB | 865 KiB/s   
Writing objects:  31% (9748/31440), 4.89 MiB | 865 KiB/s   
Writing objects:  32% (10061/31440), 4.89 MiB | 865 KiB/s   
Writing objects:  33% (10376/31440), 5.27 MiB | 555 KiB/s   
Writing objects:  34% (10690/31440), 5.27 MiB | 555 KiB/s   
Writing objects:  35% (11004/31440), 5.27 MiB | 555 KiB/s   
Writing objects:  36% (11319/31440), 5.27 MiB | 555 KiB/s   
Writing objects:  37% (11633/31440), 5.27 MiB | 555 KiB/s   
Writing objects:  38% (11948/31440), 5.27 MiB | 555 KiB/s   
Writing objects:  39% (12262/31440), 5.27 MiB | 555 KiB/s   
Writing objects:  39% (12525/31440), 5.64 MiB | 573 KiB/s   
Writing objects:  40% (12576/31440), 5.64 MiB | 573 KiB/s   
Writing objects:  41% (12891/31440), 5.64 MiB | 573 KiB/s   
Writing objects:  42% (13205/31440), 5.64 MiB | 573 KiB/s   
Writing objects:  43% (13520/31440), 5.64 MiB | 573 KiB/s   
Writing objects:  44% (13834/31440), 5.64 MiB | 573 KiB/s   
Writing objects:  45% (14148/31440), 5.89 MiB | 565 KiB/s   
Writing objects:  46% (14464/31440), 5.89 MiB | 565 KiB/s   
Writing objects:  47% (14777/31440), 5.89 MiB | 565 KiB/s   
Writing objects:  48% (15092/31440), 5.89 MiB | 565 KiB/s   
Writing objects:  48% (15341/31440), 5.89 MiB | 565 KiB/s   
Writing objects:  49% (15406/31440), 5.89 MiB | 565 KiB/s   
Writing objects:  50% (15720/31440), 5.89 MiB | 565 KiB/s   
Writing objects:  51% (16036/31440), 5.89 MiB | 565 KiB/s   
Writing objects:  52% (16349/31440), 6.27 MiB | 563 KiB/s   
Writing objects:  53% (16666/31440), 6.27 MiB | 563 KiB/s   
Writing objects:  54% (16978/31440), 6.27 MiB | 563 KiB/s   
Writing objects:  55% (17293/31440), 6.27 MiB | 563 KiB/s   
Writing objects:  56% (17607/31440), 6.27 MiB | 563 KiB/s   
Writing objects:  57% (17932/31440), 6.27 MiB | 563 KiB/s   
Writing objects:  58% (18236/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  59% (18550/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  60% (18864/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  60% (19082/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  61% (19179/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  62% (19493/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  63% (19808/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  64% (20122/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  65% (20436/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  66% (20753/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  67% (21065/31440), 7.02 MiB | 561 KiB/s   
Writing objects:  68% (21380/31440), 7.02 MiB | 561 KiB/s   
Writing objects:  69% (21694/31440), 7.02 MiB | 561 KiB/s   
Writing objects:  70% (22008/31440), 7.02 MiB | 561 KiB/s   
Writing objects:  71% (22323/31440), 7.02 MiB | 561 KiB/s   
Writing objects:  71% (22408/31440), 7.02 MiB | 561 KiB/s   
Writing objects:  72% (22637/31440), 7.02 MiB | 561 KiB/s   
Writing objects:  73% (22952/31440), 7.02 MiB | 561 KiB/s   
Writing objects:  74% (23266/31440), 7.39 MiB | 570 KiB/s   
Writing objects:  75% (23580/31440), 7.39 MiB | 570 KiB/s   
Writing objects:  76% (23895/31440), 7.39 MiB | 570 KiB/s   
Writing objects:  77% (24209/31440), 7.39 MiB | 570 KiB/s   
Writing objects:  78% (24524/31440), 7.39 MiB | 570 KiB/s   
Writing objects:  78% (24630/31440), 7.77 MiB | 567 KiB/s   
Writing objects:  79% (24838/31440), 7.77 MiB | 567 KiB/s   
Writing objects:  80% (25152/31440), 7.77 MiB | 567 KiB/s   
Writing objects:  81% (25467/31440), 7.77 MiB | 567 KiB/s   
Writing objects:  82% (25781/31440), 7.77 MiB | 567 KiB/s   
Writing objects:  83% (26096/31440), 8.14 MiB | 564 KiB/s   
Writing objects:  84% (26410/31440), 8.14 MiB | 564 KiB/s   
Writing objects:  84% (26430/31440), 8.14 MiB | 564 KiB/s   
Writing objects:  85% (26724/31440), 8.14 MiB | 564 KiB/s   
Writing objects:  86% (27039/31440), 8.52 MiB | 564 KiB/s   
Writing objects:  87% (27353/31440), 8.52 MiB | 564 KiB/s   
Writing objects:  88% (27668/31440), 8.52 MiB | 564 KiB/s   
Writing objects:  88% (27905/31440), 8.80 MiB | 563 KiB/s   
Writing objects:  89% (27982/31440), 8.80 MiB | 563 KiB/s   
Writing objects:  90% (28296/31440), 8.80 MiB | 563 KiB/s   
Writing objects:  91% (28611/31440), 8.80 MiB | 563 KiB/s   
Writing objects:  92% (28925/31440), 9.14 MiB | 565 KiB/s   
Writing objects:  93% (29240/31440), 9.14 MiB | 565 KiB/s   
Writing objects:  94% (29554/31440), 9.14 MiB | 565 KiB/s   
Writing objects:  95% (29869/31440), 9.14 MiB | 565 KiB/s   
Writing objects:  96% (30184/31440), 9.14 MiB | 565 KiB/s   
Writing objects:  97% (30497/31440), 9.14 MiB | 565 KiB/s   
Writing objects:  98% (30812/31440), 9.14 MiB | 565 KiB/s   
Writing objects:  99% (31126/31440), 9.14 MiB | 565 KiB/s   
Writing objects: 100% (31440/31440), 9.14 MiB | 565 KiB/s   
Writing objects: 100% (31440/31440), 9.48 MiB | 564 KiB/s, done.
Total 31440 (delta 24645), reused 30861 (delta 24085)
To xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
   cdf4d2b..1e6f3bf  1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c -> master

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 23 20:48:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Nov 2012 20:48:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tc0Am-0002PH-7p; Fri, 23 Nov 2012 20:48:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Tc0Ak-0002PC-VN
	for xen-devel@lists.xensource.com; Fri, 23 Nov 2012 20:48:27 +0000
Received: from [85.158.139.83:44703] by server-1.bemta-5.messagelabs.com id
	B4/A9-05877-A11EFA05; Fri, 23 Nov 2012 20:48:26 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1353703701!20405433!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10607 invoked from network); 23 Nov 2012 20:48:21 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	23 Nov 2012 20:48:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,309,1352073600"; d="scan'208";a="15981285"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	23 Nov 2012 20:48:21 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 23 Nov 2012 20:48:21 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1Tc0Af-0003W2-9a;
	Fri, 23 Nov 2012 20:48:21 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1Tc0Af-0000IB-6g;
	Fri, 23 Nov 2012 20:48:21 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14472-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 23 Nov 2012 20:48:21 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [qemu-upstream-unstable test] 14472: tolerable FAIL -
	PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14472 qemu-upstream-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14472/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-i386-xl-qemuu-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-xend-qemuu-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-qemuu-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-qemuu-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-i386-xl-qemuu-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-xl-qemuu-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-amd64-xl-qemuu-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-amd64-qemuu-win   16 leak-check/check             fail   never pass

version targeted for testing:
 qemuu                1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c
baseline version:
 qemuu                cdf4d2bb4006805f209712fbb8ed1f83127e9984

------------------------------------------------------------
People who touched revisions under test:
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-win-vcpus1                             fail    
 test-amd64-i386-xl-qemuu-win-vcpus1                          fail    
 test-amd64-i386-xl-qemuu-winxpsp3-vcpus1                     fail    
 test-amd64-amd64-qemuu-win                                   fail    
 test-amd64-i386-qemuu-win                                    fail    
 test-amd64-amd64-xl-qemuu-win                                fail    
 test-amd64-i386-xend-qemuu-winxpsp3                          fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=qemu-upstream-unstable
+ revision=1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push qemu-upstream-unstable 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c
+ branch=qemu-upstream-unstable
+ revision=1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=qemuu
+ xenbranch=xen-unstable
+ '[' xqemuu = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.qemu-upstream-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.qemu-upstream-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree qemu-upstream-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/qemu-upstream-unstable
+ git push xen@xenbits.xensource.com:git/qemu-upstream-unstable.git 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c:master
Counting objects: 1   
Counting objects: 173   
Counting objects: 1819   
Counting objects: 8466   
Counting objects: 32705, done.
Compressing objects:   0% (1/7103)   
Compressing objects:   1% (72/7103)   
Compressing objects:   2% (143/7103)   
Compressing objects:   3% (214/7103)   
Compressing objects:   4% (285/7103)   
Compressing objects:   5% (356/7103)   
Compressing objects:   6% (427/7103)   
Compressing objects:   7% (498/7103)   
Compressing objects:   8% (569/7103)   
Compressing objects:   9% (640/7103)   
Compressing objects:  10% (711/7103)   
Compressing objects:  11% (782/7103)   
Compressing objects:  12% (853/7103)   
Compressing objects:  13% (924/7103)   
Compressing objects:  14% (995/7103)   
Compressing objects:  15% (1066/7103)   
Compressing objects:  16% (1137/7103)   
Compressing objects:  17% (1208/7103)   
Compressing objects:  18% (1279/7103)   
Compressing objects:  19% (1350/7103)   
Compressing objects:  20% (1421/7103)   
Compressing objects:  21% (1492/7103)   
Compressing objects:  22% (1563/7103)   
Compressing objects:  23% (1634/7103)   
Compressing objects:  24% (1705/7103)   
Compressing objects:  25% (1776/7103)   
Compressing objects:  26% (1847/7103)   
Compressing objects:  27% (1918/7103)   
Compressing objects:  28% (1989/7103)   
Compressing objects:  29% (2060/7103)   
Compressing objects:  30% (2131/7103)   
Compressing objects:  31% (2202/7103)   
Compressing objects:  32% (2273/7103)   
Compressing objects:  33% (2344/7103)   
Compressing objects:  34% (2416/7103)   
Compressing objects:  35% (2487/7103)   
Compressing objects:  36% (2558/7103)   
Compressing objects:  37% (2629/7103)   
Compressing objects:  38% (2700/7103)   
Compressing objects:  39% (2771/7103)   
Compressing objects:  40% (2842/7103)   
Compressing objects:  41% (2913/7103)   
Compressing objects:  42% (2984/7103)   
Compressing objects:  43% (3055/7103)   
Compressing objects:  44% (3126/7103)   
Compressing objects:  45% (3197/7103)   
Compressing objects:  46% (3268/7103)   
Compressing objects:  47% (3339/7103)   
Compressing objects:  48% (3410/7103)   
Compressing objects:  49% (3481/7103)   
Compressing objects:  50% (3552/7103)   
Compressing objects:  51% (3623/7103)   
Compressing objects:  52% (3694/7103)   
Compressing objects:  53% (3765/7103)   
Compressing objects:  54% (3836/7103)   
Compressing objects:  55% (3907/7103)   
Compressing objects:  56% (3978/7103)   
Compressing objects:  57% (4049/7103)   
Compressing objects:  58% (4120/7103)   
Compressing objects:  59% (4191/7103)   
Compressing objects:  60% (4262/7103)   
Compressing objects:  61% (4333/7103)   
Compressing objects:  62% (4404/7103)   
Compressing objects:  63% (4475/7103)   
Compressing objects:  64% (4546/7103)   
Compressing objects:  65% (4617/7103)   
Compressing objects:  66% (4688/7103)   
Compressing objects:  67% (4760/7103)   
Compressing objects:  68% (4831/7103)   
Compressing objects:  69% (4902/7103)   
Compressing objects:  70% (4973/7103)   
Compressing objects:  71% (5044/7103)   
Compressing objects:  72% (5115/7103)   
Compressing objects:  73% (5186/7103)   
Compressing objects:  74% (5257/7103)   
Compressing objects:  75% (5328/7103)   
Compressing objects:  76% (5399/7103)   
Compressing objects:  77% (5470/7103)   
Compressing objects:  78% (5541/7103)   
Compressing objects:  79% (5612/7103)   
Compressing objects:  80% (5683/7103)   
Compressing objects:  81% (5754/7103)   
Compressing objects:  82% (5825/7103)   
Compressing objects:  83% (5896/7103)   
Compressing objects:  84% (5967/7103)   
Compressing objects:  85% (6038/7103)   
Compressing objects:  86% (6109/7103)   
Compressing objects:  87% (6180/7103)   
Compressing objects:  88% (6251/7103)   
Compressing objects:  89% (6322/7103)   
Compressing objects:  90% (6393/7103)   
Compressing objects:  91% (6464/7103)   
Compressing objects:  92% (6535/7103)   
Compressing objects:  93% (6606/7103)   
Compressing objects:  94% (6677/7103)   
Compressing objects:  95% (6748/7103)   
Compressing objects:  96% (6819/7103)   
Compressing objects:  97% (6890/7103)   
Compressing objects:  98% (6961/7103)   
Compressing objects:  99% (7032/7103)   
Compressing objects: 100% (7103/7103)   
Compressing objects: 100% (7103/7103), done.
Writing objects:   0% (1/31440)   
Writing objects:   1% (315/31440)   
Writing objects:   2% (629/31440)   
Writing objects:   3% (944/31440)   
Writing objects:   4% (1258/31440)   
Writing objects:   5% (1572/31440)   
Writing objects:   6% (1887/31440)   
Writing objects:   7% (2201/31440)   
Writing objects:   8% (2516/31440)   
Writing objects:   9% (2830/31440)   
Writing objects:  10% (3144/31440)   
Writing objects:  11% (3459/31440)   
Writing objects:  12% (3773/31440)   
Writing objects:  13% (4088/31440)   
Writing objects:  14% (4402/31440)   
Writing objects:  15% (4716/31440)   
Writing objects:  16% (5031/31440)   
Writing objects:  17% (5345/31440)   
Writing objects:  18% (5660/31440)   
Writing objects:  19% (5978/31440)   
Writing objects:  20% (6288/31440), 2.07 MiB | 3896 KiB/s   
Writing objects:  20% (6401/31440), 2.27 MiB | 2153 KiB/s   
Writing objects:  21% (6603/31440), 2.27 MiB | 2153 KiB/s   
Writing objects:  22% (6919/31440), 2.27 MiB | 2153 KiB/s   
Writing objects:  23% (7233/31440), 2.64 MiB | 1561 KiB/s   
Writing objects:  23% (7530/31440), 2.64 MiB | 1561 KiB/s   
Writing objects:  24% (7547/31440), 2.64 MiB | 1561 KiB/s   
Writing objects:  25% (7860/31440), 3.02 MiB | 1294 KiB/s   
Writing objects:  25% (8070/31440), 3.39 MiB | 1139 KiB/s   
Writing objects:  26% (8175/31440), 3.77 MiB | 1040 KiB/s   
Writing objects:  26% (8484/31440), 3.77 MiB | 1040 KiB/s   
Writing objects:  27% (8490/31440), 3.77 MiB | 1040 KiB/s   
Writing objects:  28% (8805/31440), 4.14 MiB | 950 KiB/s   
Writing objects:  28% (8896/31440), 4.52 MiB | 900 KiB/s   
Writing objects:  29% (9119/31440), 4.52 MiB | 900 KiB/s   
Writing objects:  29% (9373/31440), 4.89 MiB | 865 KiB/s   
Writing objects:  30% (9433/31440), 4.89 MiB | 865 KiB/s   
Writing objects:  31% (9748/31440), 4.89 MiB | 865 KiB/s   
Writing objects:  32% (10061/31440), 4.89 MiB | 865 KiB/s   
Writing objects:  33% (10376/31440), 5.27 MiB | 555 KiB/s   
Writing objects:  34% (10690/31440), 5.27 MiB | 555 KiB/s   
Writing objects:  35% (11004/31440), 5.27 MiB | 555 KiB/s   
Writing objects:  36% (11319/31440), 5.27 MiB | 555 KiB/s   
Writing objects:  37% (11633/31440), 5.27 MiB | 555 KiB/s   
Writing objects:  38% (11948/31440), 5.27 MiB | 555 KiB/s   
Writing objects:  39% (12262/31440), 5.27 MiB | 555 KiB/s   
Writing objects:  39% (12525/31440), 5.64 MiB | 573 KiB/s   
Writing objects:  40% (12576/31440), 5.64 MiB | 573 KiB/s   
Writing objects:  41% (12891/31440), 5.64 MiB | 573 KiB/s   
Writing objects:  42% (13205/31440), 5.64 MiB | 573 KiB/s   
Writing objects:  43% (13520/31440), 5.64 MiB | 573 KiB/s   
Writing objects:  44% (13834/31440), 5.64 MiB | 573 KiB/s   
Writing objects:  45% (14148/31440), 5.89 MiB | 565 KiB/s   
Writing objects:  46% (14464/31440), 5.89 MiB | 565 KiB/s   
Writing objects:  47% (14777/31440), 5.89 MiB | 565 KiB/s   
Writing objects:  48% (15092/31440), 5.89 MiB | 565 KiB/s   
Writing objects:  48% (15341/31440), 5.89 MiB | 565 KiB/s   
Writing objects:  49% (15406/31440), 5.89 MiB | 565 KiB/s   
Writing objects:  50% (15720/31440), 5.89 MiB | 565 KiB/s   
Writing objects:  51% (16036/31440), 5.89 MiB | 565 KiB/s   
Writing objects:  52% (16349/31440), 6.27 MiB | 563 KiB/s   
Writing objects:  53% (16666/31440), 6.27 MiB | 563 KiB/s   
Writing objects:  54% (16978/31440), 6.27 MiB | 563 KiB/s   
Writing objects:  55% (17293/31440), 6.27 MiB | 563 KiB/s   
Writing objects:  56% (17607/31440), 6.27 MiB | 563 KiB/s   
Writing objects:  57% (17932/31440), 6.27 MiB | 563 KiB/s   
Writing objects:  58% (18236/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  59% (18550/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  60% (18864/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  60% (19082/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  61% (19179/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  62% (19493/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  63% (19808/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  64% (20122/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  65% (20436/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  66% (20753/31440), 6.64 MiB | 564 KiB/s   
Writing objects:  67% (21065/31440), 7.02 MiB | 561 KiB/s   
Writing objects:  68% (21380/31440), 7.02 MiB | 561 KiB/s   
Writing objects:  69% (21694/31440), 7.02 MiB | 561 KiB/s   
Writing objects:  70% (22008/31440), 7.02 MiB | 561 KiB/s   
Writing objects:  71% (22323/31440), 7.02 MiB | 561 KiB/s   
Writing objects:  71% (22408/31440), 7.02 MiB | 561 KiB/s   
Writing objects:  72% (22637/31440), 7.02 MiB | 561 KiB/s   
Writing objects:  73% (22952/31440), 7.02 MiB | 561 KiB/s   
Writing objects:  74% (23266/31440), 7.39 MiB | 570 KiB/s   
Writing objects:  75% (23580/31440), 7.39 MiB | 570 KiB/s   
Writing objects:  76% (23895/31440), 7.39 MiB | 570 KiB/s   
Writing objects:  77% (24209/31440), 7.39 MiB | 570 KiB/s   
Writing objects:  78% (24524/31440), 7.39 MiB | 570 KiB/s   
Writing objects:  78% (24630/31440), 7.77 MiB | 567 KiB/s   
Writing objects:  79% (24838/31440), 7.77 MiB | 567 KiB/s   
Writing objects:  80% (25152/31440), 7.77 MiB | 567 KiB/s   
Writing objects:  81% (25467/31440), 7.77 MiB | 567 KiB/s   
Writing objects:  82% (25781/31440), 7.77 MiB | 567 KiB/s   
Writing objects:  83% (26096/31440), 8.14 MiB | 564 KiB/s   
Writing objects:  84% (26410/31440), 8.14 MiB | 564 KiB/s   
Writing objects:  84% (26430/31440), 8.14 MiB | 564 KiB/s   
Writing objects:  85% (26724/31440), 8.14 MiB | 564 KiB/s   
Writing objects:  86% (27039/31440), 8.52 MiB | 564 KiB/s   
Writing objects:  87% (27353/31440), 8.52 MiB | 564 KiB/s   
Writing objects:  88% (27668/31440), 8.52 MiB | 564 KiB/s   
Writing objects:  88% (27905/31440), 8.80 MiB | 563 KiB/s   
Writing objects:  89% (27982/31440), 8.80 MiB | 563 KiB/s   
Writing objects:  90% (28296/31440), 8.80 MiB | 563 KiB/s   
Writing objects:  91% (28611/31440), 8.80 MiB | 563 KiB/s   
Writing objects:  92% (28925/31440), 9.14 MiB | 565 KiB/s   
Writing objects:  93% (29240/31440), 9.14 MiB | 565 KiB/s   
Writing objects:  94% (29554/31440), 9.14 MiB | 565 KiB/s   
Writing objects:  95% (29869/31440), 9.14 MiB | 565 KiB/s   
Writing objects:  96% (30184/31440), 9.14 MiB | 565 KiB/s   
Writing objects:  97% (30497/31440), 9.14 MiB | 565 KiB/s   
Writing objects:  98% (30812/31440), 9.14 MiB | 565 KiB/s   
Writing objects:  99% (31126/31440), 9.14 MiB | 565 KiB/s   
Writing objects: 100% (31440/31440), 9.14 MiB | 565 KiB/s   
Writing objects: 100% (31440/31440), 9.48 MiB | 564 KiB/s, done.
Total 31440 (delta 24645), reused 30861 (delta 24085)
To xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
   cdf4d2b..1e6f3bf  1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c -> master

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 24 00:32:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Nov 2012 00:32:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tc3f9-0007nt-0T; Sat, 24 Nov 2012 00:32:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <darren.s.shepherd@gmail.com>) id 1Tc3f7-0007no-Gl
	for xen-devel@lists.xen.org; Sat, 24 Nov 2012 00:32:01 +0000
Received: from [193.109.254.147:41913] by server-13.bemta-14.messagelabs.com
	id CB/A3-11239-08510B05; Sat, 24 Nov 2012 00:32:00 +0000
X-Env-Sender: darren.s.shepherd@gmail.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1353717118!10257906!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=1.5 required=7.0 tests=HTML_00_10,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19074 invoked from network); 24 Nov 2012 00:31:59 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	24 Nov 2012 00:31:59 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so11817565vbi.32
	for <xen-devel@lists.xen.org>; Fri, 23 Nov 2012 16:31:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=2e22CGklO5riAKEevp8Gp86QoUF5s47BbJ5XyIlhYqg=;
	b=ynZMAPmrw1VYko4HZwp7456z7IM1Srw2lm6iBlnJKmzuyvfGE/xD/gSFx/HxciyWSG
	ruQ9aR5dkD52TYIjHCmAwqJI5vwA+lfuk14riayBEp2+6W+7IfVkpYN45GE1xGRZ6IOg
	GsXqKA7q9q84LSdOOZhcVwu5u04RA4au8NYXgr6Co9NCdiO44lg9blZCAvHNx7iMW641
	pG1E9ZfvPx5z8gacoSGnv99gWbVksfTO2a/sVy00moQLHY9exFQJtbKR5wUNu0UMdrwl
	rkwj4gGQYJvsOoNmpnd5Sn4kFTTRmzbpog1nYKT68aQ2cdwvb/4IFEV3+1VDIll+2jZA
	Bx5A==
MIME-Version: 1.0
Received: by 10.52.99.40 with SMTP id en8mr7209749vdb.70.1353717118674; Fri,
	23 Nov 2012 16:31:58 -0800 (PST)
Received: by 10.220.210.77 with HTTP; Fri, 23 Nov 2012 16:31:58 -0800 (PST)
Date: Fri, 23 Nov 2012 17:31:58 -0700
Message-ID: <CAMCEDC0sU+kBkGWmUoWwyOJ8pURZGwVgN1_xqDkt1MvxR-vE4A@mail.gmail.com>
From: Darren Shepherd <darren.s.shepherd@gmail.com>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] blktap3 as a block device?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============9189021185320804871=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============9189021185320804871==
Content-Type: multipart/alternative; boundary=20cf307c9f6afc275a04cf32d305

--20cf307c9f6afc275a04cf32d305
Content-Type: text/plain; charset=ISO-8859-1

So currently blktap2 can be used outside of Xen, but I don't think many
people do that.  I have a use case now where I must support KVM (I
currently run only Xen servers) and found the disk snapshotting to be not
as nice as what I can do with vhd's in blktap2 (and a half).  So I was
thinking of actually trying to just run blktap for the storage.  So I'm
pretty pleased with that solution and functionally it works just fine.

The problem now is blktap3.  So is there going to be any way to use blktap3
outside of Xen?  If blktap3 is the future I probably won't continue with my
blktap/kvm solution.

Thanks,
Darren

--20cf307c9f6afc275a04cf32d305
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

So currently blktap2 can be used outside of Xen, but I don&#39;t think many=
 people do that.=A0 I have a use case now where I must support KVM (I curre=
ntly run only Xen servers) and found the disk snapshotting to be not as nic=
e as what I can do with vhd&#39;s in blktap2 (and a half).=A0 So I was thin=
king of actually trying to just run blktap for the storage.=A0 So I&#39;m p=
retty pleased with that solution and functionally it works just fine.=A0 <b=
r>
<br>The problem now is blktap3.=A0 So is there going to be any way to use b=
lktap3 outside of Xen?=A0 If blktap3 is the future I probably won&#39;t con=
tinue with my blktap/kvm solution.<br><br>Thanks,<br>Darren<br>

--20cf307c9f6afc275a04cf32d305--


--===============9189021185320804871==
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.xen.org
http://lists.xen.org/xen-devel

--===============9189021185320804871==--


From xen-devel-bounces@lists.xen.org Sat Nov 24 00:32:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Nov 2012 00:32:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tc3f9-0007nt-0T; Sat, 24 Nov 2012 00:32:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <darren.s.shepherd@gmail.com>) id 1Tc3f7-0007no-Gl
	for xen-devel@lists.xen.org; Sat, 24 Nov 2012 00:32:01 +0000
Received: from [193.109.254.147:41913] by server-13.bemta-14.messagelabs.com
	id CB/A3-11239-08510B05; Sat, 24 Nov 2012 00:32:00 +0000
X-Env-Sender: darren.s.shepherd@gmail.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1353717118!10257906!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=1.5 required=7.0 tests=HTML_00_10,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19074 invoked from network); 24 Nov 2012 00:31:59 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	24 Nov 2012 00:31:59 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so11817565vbi.32
	for <xen-devel@lists.xen.org>; Fri, 23 Nov 2012 16:31:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=2e22CGklO5riAKEevp8Gp86QoUF5s47BbJ5XyIlhYqg=;
	b=ynZMAPmrw1VYko4HZwp7456z7IM1Srw2lm6iBlnJKmzuyvfGE/xD/gSFx/HxciyWSG
	ruQ9aR5dkD52TYIjHCmAwqJI5vwA+lfuk14riayBEp2+6W+7IfVkpYN45GE1xGRZ6IOg
	GsXqKA7q9q84LSdOOZhcVwu5u04RA4au8NYXgr6Co9NCdiO44lg9blZCAvHNx7iMW641
	pG1E9ZfvPx5z8gacoSGnv99gWbVksfTO2a/sVy00moQLHY9exFQJtbKR5wUNu0UMdrwl
	rkwj4gGQYJvsOoNmpnd5Sn4kFTTRmzbpog1nYKT68aQ2cdwvb/4IFEV3+1VDIll+2jZA
	Bx5A==
MIME-Version: 1.0
Received: by 10.52.99.40 with SMTP id en8mr7209749vdb.70.1353717118674; Fri,
	23 Nov 2012 16:31:58 -0800 (PST)
Received: by 10.220.210.77 with HTTP; Fri, 23 Nov 2012 16:31:58 -0800 (PST)
Date: Fri, 23 Nov 2012 17:31:58 -0700
Message-ID: <CAMCEDC0sU+kBkGWmUoWwyOJ8pURZGwVgN1_xqDkt1MvxR-vE4A@mail.gmail.com>
From: Darren Shepherd <darren.s.shepherd@gmail.com>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] blktap3 as a block device?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============9189021185320804871=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============9189021185320804871==
Content-Type: multipart/alternative; boundary=20cf307c9f6afc275a04cf32d305

--20cf307c9f6afc275a04cf32d305
Content-Type: text/plain; charset=ISO-8859-1

So currently blktap2 can be used outside of Xen, but I don't think many
people do that.  I have a use case now where I must support KVM (I
currently run only Xen servers) and found the disk snapshotting to be not
as nice as what I can do with vhd's in blktap2 (and a half).  So I was
thinking of actually trying to just run blktap for the storage.  So I'm
pretty pleased with that solution and functionally it works just fine.

The problem now is blktap3.  So is there going to be any way to use blktap3
outside of Xen?  If blktap3 is the future I probably won't continue with my
blktap/kvm solution.

Thanks,
Darren

--20cf307c9f6afc275a04cf32d305
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

So currently blktap2 can be used outside of Xen, but I don&#39;t think many=
 people do that.=A0 I have a use case now where I must support KVM (I curre=
ntly run only Xen servers) and found the disk snapshotting to be not as nic=
e as what I can do with vhd&#39;s in blktap2 (and a half).=A0 So I was thin=
king of actually trying to just run blktap for the storage.=A0 So I&#39;m p=
retty pleased with that solution and functionally it works just fine.=A0 <b=
r>
<br>The problem now is blktap3.=A0 So is there going to be any way to use b=
lktap3 outside of Xen?=A0 If blktap3 is the future I probably won&#39;t con=
tinue with my blktap/kvm solution.<br><br>Thanks,<br>Darren<br>

--20cf307c9f6afc275a04cf32d305--


--===============9189021185320804871==
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.xen.org
http://lists.xen.org/xen-devel

--===============9189021185320804871==--


From xen-devel-bounces@lists.xen.org Sat Nov 24 00:40:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Nov 2012 00:40:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tc3ma-0007yK-4y; Sat, 24 Nov 2012 00:39:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fajar@fajar.net>) id 1Tc3mY-0007yC-Ij
	for xen-devel@lists.xen.org; Sat, 24 Nov 2012 00:39:42 +0000
Received: from [85.158.143.99:20865] by server-2.bemta-4.messagelabs.com id
	35/15-28922-D4710B05; Sat, 24 Nov 2012 00:39:41 +0000
X-Env-Sender: fajar@fajar.net
X-Msg-Ref: server-2.tower-216.messagelabs.com!1353717580!25859306!1
X-Originating-IP: [209.85.219.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13412 invoked from network); 24 Nov 2012 00:39:41 -0000
Received: from mail-oa0-f45.google.com (HELO mail-oa0-f45.google.com)
	(209.85.219.45)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	24 Nov 2012 00:39:41 -0000
Received: by mail-oa0-f45.google.com with SMTP id i18so11206204oag.32
	for <xen-devel@lists.xen.org>; Fri, 23 Nov 2012 16:39:39 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=Q/8ul+BFbV0vq7/BuTj3zwwBwyGASSchbFcUkW/NGpY=;
	b=DwBtNByu9FFpwCPBTX5H3vRwM/J0qKuIJVI3yDjqyo4+kngBnYDZoSmqM511G5gDQN
	qvy6ECqkpTIREXDQ/fXjxmCUBtCAs9SZVynfJn0j8psyZQ+ENgPIimjy3IaWxOrsfol4
	x9MpEbtMp43U/GNOlYB+AtDaTlST4JQRHEyxINZp5C0Ic4uchZC1gK89brF1Xz+TWuGK
	NRcWRBDN94ocOfZCXco2mMBSLY1uFTZ+3UifM+IBHHK6KslTobNKDs4tovxmdHnwlVQ/
	8N3wIKStzDQKECKSaqccIFHAiqszVyamYVFW3HBH5DdShhVjAI13Vsb5Ja7EVRccvO+u
	9y4w==
MIME-Version: 1.0
Received: by 10.60.11.197 with SMTP id s5mr4184107oeb.29.1353717579813; Fri,
	23 Nov 2012 16:39:39 -0800 (PST)
Received: by 10.76.79.231 with HTTP; Fri, 23 Nov 2012 16:39:39 -0800 (PST)
In-Reply-To: <CAMCEDC0sU+kBkGWmUoWwyOJ8pURZGwVgN1_xqDkt1MvxR-vE4A@mail.gmail.com>
References: <CAMCEDC0sU+kBkGWmUoWwyOJ8pURZGwVgN1_xqDkt1MvxR-vE4A@mail.gmail.com>
Date: Sat, 24 Nov 2012 07:39:39 +0700
Message-ID: <CAG1y0sci4Q8=Vy7i3NPfdYmH6e9rbvrHUPeoz_03+9_GvaHTwA@mail.gmail.com>
From: "Fajar A. Nugraha" <list@fajar.net>
To: Darren Shepherd <darren.s.shepherd@gmail.com>
X-Gm-Message-State: ALoCoQnGIlZvpEWX/DF1jo+he/KwKe7+UvsLYB1mIkgbDodg3co+5eXPRlVdXH4BrMuxIeQhAGmQ
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] blktap3 as a block device?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, Nov 24, 2012 at 7:31 AM, Darren Shepherd
<darren.s.shepherd@gmail.com> wrote:
> So currently blktap2 can be used outside of Xen, but I don't think many
> people do that.  I have a use case now where I must support KVM (I currently
> run only Xen servers) and found the disk snapshotting to be not as nice as
> what I can do with vhd's in blktap2 (and a half).  So I was thinking of
> actually trying to just run blktap for the storage.  So I'm pretty pleased
> with that solution and functionally it works just fine.
>
> The problem now is blktap3.  So is there going to be any way to use blktap3
> outside of Xen?  If blktap3 is the future I probably won't continue with my
> blktap/kvm solution.

Since AFAIK blktap3 is not even in xen-unstable, personally I'd just
use something with more userbase and better tested. Something like
zfsonlinux. It has support for sparse zvols, as well as snapshot and
clones.

-- 
Fajar

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 24 00:40:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Nov 2012 00:40:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tc3ma-0007yK-4y; Sat, 24 Nov 2012 00:39:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fajar@fajar.net>) id 1Tc3mY-0007yC-Ij
	for xen-devel@lists.xen.org; Sat, 24 Nov 2012 00:39:42 +0000
Received: from [85.158.143.99:20865] by server-2.bemta-4.messagelabs.com id
	35/15-28922-D4710B05; Sat, 24 Nov 2012 00:39:41 +0000
X-Env-Sender: fajar@fajar.net
X-Msg-Ref: server-2.tower-216.messagelabs.com!1353717580!25859306!1
X-Originating-IP: [209.85.219.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13412 invoked from network); 24 Nov 2012 00:39:41 -0000
Received: from mail-oa0-f45.google.com (HELO mail-oa0-f45.google.com)
	(209.85.219.45)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	24 Nov 2012 00:39:41 -0000
Received: by mail-oa0-f45.google.com with SMTP id i18so11206204oag.32
	for <xen-devel@lists.xen.org>; Fri, 23 Nov 2012 16:39:39 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=Q/8ul+BFbV0vq7/BuTj3zwwBwyGASSchbFcUkW/NGpY=;
	b=DwBtNByu9FFpwCPBTX5H3vRwM/J0qKuIJVI3yDjqyo4+kngBnYDZoSmqM511G5gDQN
	qvy6ECqkpTIREXDQ/fXjxmCUBtCAs9SZVynfJn0j8psyZQ+ENgPIimjy3IaWxOrsfol4
	x9MpEbtMp43U/GNOlYB+AtDaTlST4JQRHEyxINZp5C0Ic4uchZC1gK89brF1Xz+TWuGK
	NRcWRBDN94ocOfZCXco2mMBSLY1uFTZ+3UifM+IBHHK6KslTobNKDs4tovxmdHnwlVQ/
	8N3wIKStzDQKECKSaqccIFHAiqszVyamYVFW3HBH5DdShhVjAI13Vsb5Ja7EVRccvO+u
	9y4w==
MIME-Version: 1.0
Received: by 10.60.11.197 with SMTP id s5mr4184107oeb.29.1353717579813; Fri,
	23 Nov 2012 16:39:39 -0800 (PST)
Received: by 10.76.79.231 with HTTP; Fri, 23 Nov 2012 16:39:39 -0800 (PST)
In-Reply-To: <CAMCEDC0sU+kBkGWmUoWwyOJ8pURZGwVgN1_xqDkt1MvxR-vE4A@mail.gmail.com>
References: <CAMCEDC0sU+kBkGWmUoWwyOJ8pURZGwVgN1_xqDkt1MvxR-vE4A@mail.gmail.com>
Date: Sat, 24 Nov 2012 07:39:39 +0700
Message-ID: <CAG1y0sci4Q8=Vy7i3NPfdYmH6e9rbvrHUPeoz_03+9_GvaHTwA@mail.gmail.com>
From: "Fajar A. Nugraha" <list@fajar.net>
To: Darren Shepherd <darren.s.shepherd@gmail.com>
X-Gm-Message-State: ALoCoQnGIlZvpEWX/DF1jo+he/KwKe7+UvsLYB1mIkgbDodg3co+5eXPRlVdXH4BrMuxIeQhAGmQ
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] blktap3 as a block device?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, Nov 24, 2012 at 7:31 AM, Darren Shepherd
<darren.s.shepherd@gmail.com> wrote:
> So currently blktap2 can be used outside of Xen, but I don't think many
> people do that.  I have a use case now where I must support KVM (I currently
> run only Xen servers) and found the disk snapshotting to be not as nice as
> what I can do with vhd's in blktap2 (and a half).  So I was thinking of
> actually trying to just run blktap for the storage.  So I'm pretty pleased
> with that solution and functionally it works just fine.
>
> The problem now is blktap3.  So is there going to be any way to use blktap3
> outside of Xen?  If blktap3 is the future I probably won't continue with my
> blktap/kvm solution.

Since AFAIK blktap3 is not even in xen-unstable, personally I'd just
use something with more userbase and better tested. Something like
zfsonlinux. It has support for sparse zvols, as well as snapshot and
clones.

-- 
Fajar

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 24 01:09:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Nov 2012 01:09:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tc4Ec-0003yZ-GY; Sat, 24 Nov 2012 01:08:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <darren.s.shepherd@gmail.com>) id 1Tc4Ea-0003yU-Nk
	for xen-devel@lists.xen.org; Sat, 24 Nov 2012 01:08:40 +0000
Received: from [85.158.143.35:18307] by server-3.bemta-4.messagelabs.com id
	87/A2-06841-81E10B05; Sat, 24 Nov 2012 01:08:40 +0000
X-Env-Sender: darren.s.shepherd@gmail.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1353719317!16035199!1
X-Originating-IP: [209.85.220.45]
X-SpamReason: No, hits=0.4 required=7.0 tests=MIME_QP_LONG_LINE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18826 invoked from network); 24 Nov 2012 01:08:39 -0000
Received: from mail-pa0-f45.google.com (HELO mail-pa0-f45.google.com)
	(209.85.220.45)
	by server-14.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	24 Nov 2012 01:08:39 -0000
Received: by mail-pa0-f45.google.com with SMTP id bg2so4364912pad.32
	for <xen-devel@lists.xen.org>; Fri, 23 Nov 2012 17:08:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=references:mime-version:in-reply-to:content-type
	:content-transfer-encoding:message-id:cc:x-mailer:from:subject:date
	:to; bh=aX1kq/JbhwsTr5hO5vPridJ7ZtgIywRwge+lzi4b0+Y=;
	b=OvvoPPFcs+kDCcSCrPOtJSRYphmljnlWO9iYDcXxCgnxDWLK2/iE7DrFPtlaz9Ld2k
	28chf913HwlsfysztDsGIB/O/GbZ+978wfbGJyZUpAHDpUg9TOEErqRBod8e/2w2Eheq
	z+Lzsdb59qTlOQgmaBySZpTi5sdlkkqzyShS7TGChTlnM1K3yNqYWsIu2mCidcn6ZgR/
	Nzw/eA+BQJGldkYGJb4D+ddVglHq/V1r3C2t5nsI9grHML9CLLTFMiHzjd22AG+NlTTW
	/GBXzFtTBMlVJd1fjyUUvI2aPUzqJyjvqEGubQSJup8yYpPq0S4B1PzBQt8LH+lbYfir
	JI1Q==
Received: by 10.66.78.199 with SMTP id d7mr14285206pax.77.1353719317246;
	Fri, 23 Nov 2012 17:08:37 -0800 (PST)
Received: from [192.168.1.9] (cpe-98-151-200-215.socal.res.rr.com.
	[98.151.200.215])
	by mx.google.com with ESMTPS id o1sm4485928paz.34.2012.11.23.17.08.35
	(version=SSLv3 cipher=OTHER); Fri, 23 Nov 2012 17:08:36 -0800 (PST)
References: <CAMCEDC0sU+kBkGWmUoWwyOJ8pURZGwVgN1_xqDkt1MvxR-vE4A@mail.gmail.com>
	<CAG1y0sci4Q8=Vy7i3NPfdYmH6e9rbvrHUPeoz_03+9_GvaHTwA@mail.gmail.com>
Mime-Version: 1.0 (1.0)
In-Reply-To: <CAG1y0sci4Q8=Vy7i3NPfdYmH6e9rbvrHUPeoz_03+9_GvaHTwA@mail.gmail.com>
Message-Id: <D8B61355-4276-418B-8207-35D806928C20@gmail.com>
X-Mailer: iPhone Mail (10A525)
From: Darren Shepherd <darren.s.shepherd@gmail.com>
Date: Fri, 23 Nov 2012 17:08:34 -0800
To: "Fajar A. Nugraha" <list@fajar.net>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] blktap3 as a block device?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On Nov 23, 2012, at 4:39 PM, "Fajar A. Nugraha" <list@fajar.net> wrote:

> On Sat, Nov 24, 2012 at 7:31 AM, Darren Shepherd
> <darren.s.shepherd@gmail.com> wrote:
>> So currently blktap2 can be used outside of Xen, but I don't think many
>> people do that.  I have a use case now where I must support KVM (I currently
>> run only Xen servers) and found the disk snapshotting to be not as nice as
>> what I can do with vhd's in blktap2 (and a half).  So I was thinking of
>> actually trying to just run blktap for the storage.  So I'm pretty pleased
>> with that solution and functionally it works just fine.
>> 
>> The problem now is blktap3.  So is there going to be any way to use blktap3
>> outside of Xen?  If blktap3 is the future I probably won't continue with my
>> blktap/kvm solution.
> 
> Since AFAIK blktap3 is not even in xen-unstable, personally I'd just
> use something with more userbase and better tested. Something like
> zfsonlinux. It has support for sparse zvols, as well as snapshot and
> clones.
> 
> -- 
> Fajar

I'm using blktap2, but that's really besides the point.  

The more direct question is going forward with blktap3 is there going to be a way to see the blktap device as a block device in dom0?

Darren


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 24 01:09:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Nov 2012 01:09:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tc4Ec-0003yZ-GY; Sat, 24 Nov 2012 01:08:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <darren.s.shepherd@gmail.com>) id 1Tc4Ea-0003yU-Nk
	for xen-devel@lists.xen.org; Sat, 24 Nov 2012 01:08:40 +0000
Received: from [85.158.143.35:18307] by server-3.bemta-4.messagelabs.com id
	87/A2-06841-81E10B05; Sat, 24 Nov 2012 01:08:40 +0000
X-Env-Sender: darren.s.shepherd@gmail.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1353719317!16035199!1
X-Originating-IP: [209.85.220.45]
X-SpamReason: No, hits=0.4 required=7.0 tests=MIME_QP_LONG_LINE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18826 invoked from network); 24 Nov 2012 01:08:39 -0000
Received: from mail-pa0-f45.google.com (HELO mail-pa0-f45.google.com)
	(209.85.220.45)
	by server-14.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	24 Nov 2012 01:08:39 -0000
Received: by mail-pa0-f45.google.com with SMTP id bg2so4364912pad.32
	for <xen-devel@lists.xen.org>; Fri, 23 Nov 2012 17:08:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=references:mime-version:in-reply-to:content-type
	:content-transfer-encoding:message-id:cc:x-mailer:from:subject:date
	:to; bh=aX1kq/JbhwsTr5hO5vPridJ7ZtgIywRwge+lzi4b0+Y=;
	b=OvvoPPFcs+kDCcSCrPOtJSRYphmljnlWO9iYDcXxCgnxDWLK2/iE7DrFPtlaz9Ld2k
	28chf913HwlsfysztDsGIB/O/GbZ+978wfbGJyZUpAHDpUg9TOEErqRBod8e/2w2Eheq
	z+Lzsdb59qTlOQgmaBySZpTi5sdlkkqzyShS7TGChTlnM1K3yNqYWsIu2mCidcn6ZgR/
	Nzw/eA+BQJGldkYGJb4D+ddVglHq/V1r3C2t5nsI9grHML9CLLTFMiHzjd22AG+NlTTW
	/GBXzFtTBMlVJd1fjyUUvI2aPUzqJyjvqEGubQSJup8yYpPq0S4B1PzBQt8LH+lbYfir
	JI1Q==
Received: by 10.66.78.199 with SMTP id d7mr14285206pax.77.1353719317246;
	Fri, 23 Nov 2012 17:08:37 -0800 (PST)
Received: from [192.168.1.9] (cpe-98-151-200-215.socal.res.rr.com.
	[98.151.200.215])
	by mx.google.com with ESMTPS id o1sm4485928paz.34.2012.11.23.17.08.35
	(version=SSLv3 cipher=OTHER); Fri, 23 Nov 2012 17:08:36 -0800 (PST)
References: <CAMCEDC0sU+kBkGWmUoWwyOJ8pURZGwVgN1_xqDkt1MvxR-vE4A@mail.gmail.com>
	<CAG1y0sci4Q8=Vy7i3NPfdYmH6e9rbvrHUPeoz_03+9_GvaHTwA@mail.gmail.com>
Mime-Version: 1.0 (1.0)
In-Reply-To: <CAG1y0sci4Q8=Vy7i3NPfdYmH6e9rbvrHUPeoz_03+9_GvaHTwA@mail.gmail.com>
Message-Id: <D8B61355-4276-418B-8207-35D806928C20@gmail.com>
X-Mailer: iPhone Mail (10A525)
From: Darren Shepherd <darren.s.shepherd@gmail.com>
Date: Fri, 23 Nov 2012 17:08:34 -0800
To: "Fajar A. Nugraha" <list@fajar.net>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] blktap3 as a block device?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On Nov 23, 2012, at 4:39 PM, "Fajar A. Nugraha" <list@fajar.net> wrote:

> On Sat, Nov 24, 2012 at 7:31 AM, Darren Shepherd
> <darren.s.shepherd@gmail.com> wrote:
>> So currently blktap2 can be used outside of Xen, but I don't think many
>> people do that.  I have a use case now where I must support KVM (I currently
>> run only Xen servers) and found the disk snapshotting to be not as nice as
>> what I can do with vhd's in blktap2 (and a half).  So I was thinking of
>> actually trying to just run blktap for the storage.  So I'm pretty pleased
>> with that solution and functionally it works just fine.
>> 
>> The problem now is blktap3.  So is there going to be any way to use blktap3
>> outside of Xen?  If blktap3 is the future I probably won't continue with my
>> blktap/kvm solution.
> 
> Since AFAIK blktap3 is not even in xen-unstable, personally I'd just
> use something with more userbase and better tested. Something like
> zfsonlinux. It has support for sparse zvols, as well as snapshot and
> clones.
> 
> -- 
> Fajar

I'm using blktap2, but that's really besides the point.  

The more direct question is going forward with blktap3 is there going to be a way to see the blktap device as a block device in dom0?

Darren


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 24 05:43:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Nov 2012 05:43:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tc8Vp-0000xC-QE; Sat, 24 Nov 2012 05:42:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xinxinjin89@gmail.com>) id 1Tc8Vo-0000x7-9E
	for Xen-devel@lists.xen.org; Sat, 24 Nov 2012 05:42:44 +0000
Received: from [85.158.139.211:8730] by server-15.bemta-5.messagelabs.com id
	80/3F-26920-35E50B05; Sat, 24 Nov 2012 05:42:43 +0000
X-Env-Sender: xinxinjin89@gmail.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353735762!21344833!1
X-Originating-IP: [209.85.216.173]
X-SpamReason: No, hits=1.5 required=7.0 tests=HTML_00_10,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8204 invoked from network); 24 Nov 2012 05:42:43 -0000
Received: from mail-qc0-f173.google.com (HELO mail-qc0-f173.google.com)
	(209.85.216.173)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	24 Nov 2012 05:42:43 -0000
Received: by mail-qc0-f173.google.com with SMTP id b12so7955278qca.32
	for <Xen-devel@lists.xen.org>; Fri, 23 Nov 2012 21:42:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:content-type;
	bh=l24MstYyjZmMr+z9GNPBWe5geTSmybABjJlzBoGKD1U=;
	b=J6eb4dAvvVmr7PeBqljb9MUjvWW4PQExKjkI6sADvczqpma0oLlfznwRGOj/vJ6x9g
	VlhOwf+qO+r3P9dAg5yNl1MRSslVGFt2Qa+wp6UV+DtNxOmzWqOaDnDS8polk/x/dCx6
	ZzRlETY+tQy7cjHO0/jEU0rF8aU9nO3Y4+bCQFtTvXa3R6aCG346/htI5CRMy4vVkSzw
	Ojpi5GYzGh24TVOA4NNZSjPv7q6nXHJSXNBf/tMQInB92D+SI90kFkQVC5qN4b6BlqTA
	eVQSZEwOIqOJY0idCwOEjEgZ2bJNliNYD+ihGcvEytttpCJcjDS/0X0EFRkmSX3zQ074
	xWFA==
MIME-Version: 1.0
Received: by 10.229.173.142 with SMTP id p14mr1375682qcz.49.1353735761647;
	Fri, 23 Nov 2012 21:42:41 -0800 (PST)
Received: by 10.229.207.195 with HTTP; Fri, 23 Nov 2012 21:42:41 -0800 (PST)
Date: Fri, 23 Nov 2012 21:42:41 -0800
X-Google-Sender-Auth: YOXkZhtSAyqe1xnPQ-ZxGu4Rq0k
Message-ID: <CAJJWZczguabmzCU5joaHDy261PfeJi3DrE5+nKFvKaKwCZdFOQ@mail.gmail.com>
From: Xinxin Jin <x7jin@cs.ucsd.edu>
To: "Xen-devel@lists.xen.org" <Xen-devel@lists.xen.org>
Subject: [Xen-devel] Is Xen's kernel stack address fixed?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1259626693120127161=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============1259626693120127161==
Content-Type: multipart/alternative; boundary=0016e6d271c9315a3b04cf372b64

--0016e6d271c9315a3b04cf372b64
Content-Type: text/plain; charset=ISO-8859-1

Hi, if Xen's kernel stack address is fixed? I print the esp value at the
entry of exception handler and find that esp has fixed value. But Xen
should support reentrancy, right? Then why it has fixed stack address ?
Thanks,
-- 
Xinxin

--0016e6d271c9315a3b04cf372b64
Content-Type: text/html; charset=ISO-8859-1

Hi, if Xen&#39;s kernel stack address is fixed? I print the esp value at the entry of exception handler and find that esp has fixed value. But Xen should support reentrancy, right? Then why it has fixed stack address ?<div>
Thanks,<br>-- <br>Xinxin<br>
</div>

--0016e6d271c9315a3b04cf372b64--


--===============1259626693120127161==
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.xen.org
http://lists.xen.org/xen-devel

--===============1259626693120127161==--


From xen-devel-bounces@lists.xen.org Sat Nov 24 05:43:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Nov 2012 05:43:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tc8Vp-0000xC-QE; Sat, 24 Nov 2012 05:42:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xinxinjin89@gmail.com>) id 1Tc8Vo-0000x7-9E
	for Xen-devel@lists.xen.org; Sat, 24 Nov 2012 05:42:44 +0000
Received: from [85.158.139.211:8730] by server-15.bemta-5.messagelabs.com id
	80/3F-26920-35E50B05; Sat, 24 Nov 2012 05:42:43 +0000
X-Env-Sender: xinxinjin89@gmail.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1353735762!21344833!1
X-Originating-IP: [209.85.216.173]
X-SpamReason: No, hits=1.5 required=7.0 tests=HTML_00_10,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8204 invoked from network); 24 Nov 2012 05:42:43 -0000
Received: from mail-qc0-f173.google.com (HELO mail-qc0-f173.google.com)
	(209.85.216.173)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	24 Nov 2012 05:42:43 -0000
Received: by mail-qc0-f173.google.com with SMTP id b12so7955278qca.32
	for <Xen-devel@lists.xen.org>; Fri, 23 Nov 2012 21:42:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:content-type;
	bh=l24MstYyjZmMr+z9GNPBWe5geTSmybABjJlzBoGKD1U=;
	b=J6eb4dAvvVmr7PeBqljb9MUjvWW4PQExKjkI6sADvczqpma0oLlfznwRGOj/vJ6x9g
	VlhOwf+qO+r3P9dAg5yNl1MRSslVGFt2Qa+wp6UV+DtNxOmzWqOaDnDS8polk/x/dCx6
	ZzRlETY+tQy7cjHO0/jEU0rF8aU9nO3Y4+bCQFtTvXa3R6aCG346/htI5CRMy4vVkSzw
	Ojpi5GYzGh24TVOA4NNZSjPv7q6nXHJSXNBf/tMQInB92D+SI90kFkQVC5qN4b6BlqTA
	eVQSZEwOIqOJY0idCwOEjEgZ2bJNliNYD+ihGcvEytttpCJcjDS/0X0EFRkmSX3zQ074
	xWFA==
MIME-Version: 1.0
Received: by 10.229.173.142 with SMTP id p14mr1375682qcz.49.1353735761647;
	Fri, 23 Nov 2012 21:42:41 -0800 (PST)
Received: by 10.229.207.195 with HTTP; Fri, 23 Nov 2012 21:42:41 -0800 (PST)
Date: Fri, 23 Nov 2012 21:42:41 -0800
X-Google-Sender-Auth: YOXkZhtSAyqe1xnPQ-ZxGu4Rq0k
Message-ID: <CAJJWZczguabmzCU5joaHDy261PfeJi3DrE5+nKFvKaKwCZdFOQ@mail.gmail.com>
From: Xinxin Jin <x7jin@cs.ucsd.edu>
To: "Xen-devel@lists.xen.org" <Xen-devel@lists.xen.org>
Subject: [Xen-devel] Is Xen's kernel stack address fixed?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1259626693120127161=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============1259626693120127161==
Content-Type: multipart/alternative; boundary=0016e6d271c9315a3b04cf372b64

--0016e6d271c9315a3b04cf372b64
Content-Type: text/plain; charset=ISO-8859-1

Hi, if Xen's kernel stack address is fixed? I print the esp value at the
entry of exception handler and find that esp has fixed value. But Xen
should support reentrancy, right? Then why it has fixed stack address ?
Thanks,
-- 
Xinxin

--0016e6d271c9315a3b04cf372b64
Content-Type: text/html; charset=ISO-8859-1

Hi, if Xen&#39;s kernel stack address is fixed? I print the esp value at the entry of exception handler and find that esp has fixed value. But Xen should support reentrancy, right? Then why it has fixed stack address ?<div>
Thanks,<br>-- <br>Xinxin<br>
</div>

--0016e6d271c9315a3b04cf372b64--


--===============1259626693120127161==
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.xen.org
http://lists.xen.org/xen-devel

--===============1259626693120127161==--


From xen-devel-bounces@lists.xen.org Sat Nov 24 06:54:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Nov 2012 06:54:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tc9cW-0002LS-Hs; Sat, 24 Nov 2012 06:53:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Tc9cV-0002LN-6V
	for xen-devel@lists.xensource.com; Sat, 24 Nov 2012 06:53:43 +0000
Received: from [85.158.139.211:45204] by server-6.bemta-5.messagelabs.com id
	15/08-19321-6FE60B05; Sat, 24 Nov 2012 06:53:42 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353740021!21410769!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5205 invoked from network); 24 Nov 2012 06:53:41 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	24 Nov 2012 06:53:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,312,1352073600"; d="scan'208";a="15982595"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	24 Nov 2012 06:53:41 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sat, 24 Nov 2012 06:53:41 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1Tc9cS-0006X6-Rp;
	Sat, 24 Nov 2012 06:53:40 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1Tc9cS-0007oJ-CT;
	Sat, 24 Nov 2012 06:53:40 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14473-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sat, 24 Nov 2012 06:53:40 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14473: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14473 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14473/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup             fail pass in 14469
 test-amd64-amd64-xl-qemuu-winxpsp3 9 guest-localmigrate fail in 14469 pass in 14473
 test-amd64-amd64-xl-qemuu-win7-amd64 9 guest-localmigrate fail in 14469 pass in 14473

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14469
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14469

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-pcipt-intel  9 guest-start        fail in 14469 never pass

version targeted for testing:
 xen                  0049de3827bc
baseline version:
 xen                  0049de3827bc

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sat Nov 24 06:54:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Nov 2012 06:54:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tc9cW-0002LS-Hs; Sat, 24 Nov 2012 06:53:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Tc9cV-0002LN-6V
	for xen-devel@lists.xensource.com; Sat, 24 Nov 2012 06:53:43 +0000
Received: from [85.158.139.211:45204] by server-6.bemta-5.messagelabs.com id
	15/08-19321-6FE60B05; Sat, 24 Nov 2012 06:53:42 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353740021!21410769!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5205 invoked from network); 24 Nov 2012 06:53:41 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	24 Nov 2012 06:53:41 -0000
X-IronPort-AV: E=Sophos;i="4.83,312,1352073600"; d="scan'208";a="15982595"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	24 Nov 2012 06:53:41 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sat, 24 Nov 2012 06:53:41 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1Tc9cS-0006X6-Rp;
	Sat, 24 Nov 2012 06:53:40 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1Tc9cS-0007oJ-CT;
	Sat, 24 Nov 2012 06:53:40 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14473-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sat, 24 Nov 2012 06:53:40 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14473: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14473 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14473/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup             fail pass in 14469
 test-amd64-amd64-xl-qemuu-winxpsp3 9 guest-localmigrate fail in 14469 pass in 14473
 test-amd64-amd64-xl-qemuu-win7-amd64 9 guest-localmigrate fail in 14469 pass in 14473

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14469
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14469

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-pcipt-intel  9 guest-start        fail in 14469 never pass

version targeted for testing:
 xen                  0049de3827bc
baseline version:
 xen                  0049de3827bc

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 25 07:37:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Nov 2012 07:37:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcWlK-0004mJ-KH; Sun, 25 Nov 2012 07:36:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TcWlI-0004mE-8f
	for xen-devel@lists.xensource.com; Sun, 25 Nov 2012 07:36:20 +0000
Received: from [85.158.139.211:38890] by server-9.bemta-5.messagelabs.com id
	A3/10-29295-37AC1B05; Sun, 25 Nov 2012 07:36:19 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1353828978!19454441!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12564 invoked from network); 25 Nov 2012 07:36:18 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	25 Nov 2012 07:36:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,315,1352073600"; d="scan'208";a="15986399"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	25 Nov 2012 07:36:17 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sun, 25 Nov 2012 07:36:17 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TcWlF-0005R8-8x;
	Sun, 25 Nov 2012 07:36:17 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TcWlF-00030i-3U;
	Sun, 25 Nov 2012 07:36:17 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14474-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sun, 25 Nov 2012 07:36:17 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14474: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14474 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14474/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14473
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14473

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass

version targeted for testing:
 xen                  0049de3827bc
baseline version:
 xen                  0049de3827bc

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 25 07:37:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Nov 2012 07:37:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcWlK-0004mJ-KH; Sun, 25 Nov 2012 07:36:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TcWlI-0004mE-8f
	for xen-devel@lists.xensource.com; Sun, 25 Nov 2012 07:36:20 +0000
Received: from [85.158.139.211:38890] by server-9.bemta-5.messagelabs.com id
	A3/10-29295-37AC1B05; Sun, 25 Nov 2012 07:36:19 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1353828978!19454441!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12564 invoked from network); 25 Nov 2012 07:36:18 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	25 Nov 2012 07:36:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,315,1352073600"; d="scan'208";a="15986399"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	25 Nov 2012 07:36:17 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Sun, 25 Nov 2012 07:36:17 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TcWlF-0005R8-8x;
	Sun, 25 Nov 2012 07:36:17 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TcWlF-00030i-3U;
	Sun, 25 Nov 2012 07:36:17 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14474-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Sun, 25 Nov 2012 07:36:17 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14474: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14474 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14474/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14473
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14473

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass

version targeted for testing:
 xen                  0049de3827bc
baseline version:
 xen                  0049de3827bc

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Sun Nov 25 13:25:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Nov 2012 13:25:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TccCk-0006Mf-93; Sun, 25 Nov 2012 13:25:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TccCi-0006Ma-54
	for xen-devel@lists.xensource.com; Sun, 25 Nov 2012 13:25:00 +0000
Received: from [85.158.139.83:17504] by server-16.bemta-5.messagelabs.com id
	E4/FA-04786-B2C12B05; Sun, 25 Nov 2012 13:24:59 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1353849897!27523484!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjMzMjc5\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14310 invoked from network); 25 Nov 2012 13:24:58 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-14.tower-182.messagelabs.com with SMTP;
	25 Nov 2012 13:24:58 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga102.ch.intel.com with ESMTP; 25 Nov 2012 05:24:55 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,315,1352102400"; 
	d="scan'208,217";a="222052225"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by azsmga001.ch.intel.com with ESMTP; 25 Nov 2012 05:24:35 -0800
Received: from fmsmsx101.amr.corp.intel.com (10.19.9.52) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Sun, 25 Nov 2012 05:24:34 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX101.amr.corp.intel.com (10.19.9.52) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Sun, 25 Nov 2012 05:24:35 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Sun, 25 Nov 2012 21:24:33 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNyZdIH+TZqbearkyCq5DrDs2IGJf6jQGA
Date: Sun, 25 Nov 2012 13:24:33 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335396CED@SHSMSX101.ccr.corp.intel.com>
References: <d3378692eece3e552ba2.1353630328@ljsromley.bj.intel.com>
	<CAFLBxZZ_W5PMLYiqEwdrpqkjgiMN9NoN2f33ErLriOwNOD9GgA@mail.gmail.com>
In-Reply-To: <CAFLBxZZ_W5PMLYiqEwdrpqkjgiMN9NoN2f33ErLriOwNOD9GgA@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3370268823370613467=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============3370268823370613467==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_DE8DF0795D48FD4CA783C40EC8292335396CEDSHSMSX101ccrcorpi_"

--_000_DE8DF0795D48FD4CA783C40EC8292335396CEDSHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Thanks George!

________________________________
From: dunlapg@gmail.com [mailto:dunlapg@gmail.com] On Behalf Of George Dunl=
ap
Sent: Saturday, November 24, 2012 12:26 AM
To: Liu, Jinsong
Cc: Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regar=
d to migration

On Fri, Nov 23, 2012 at 12:25 AM, Liu Jinsong <jinsong.liu@intel.com<mailto=
:jinsong.liu@intel.com>> wrote:
This patch handles broken page wrt migration. Generally there are below cas=
es:
1. broken page occurs before migration
2. broken page occurs during migration
  2.1 broken page occurs during migration but not at the last iteration
  2.2 broken page occurs at the last iteration of migration

For case 1, at the sender the broken page will be mapped but not copied
  to target (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number will be transferred to target so that
  target take appropriate action.

For case 2.1, at the sender mce handler marks the broken page to dirty
  bitmap, so that at next iteration, its pfn_type and pfn number will be
  transferred to the target and then take appropriate action.

For case 2.2, at the sender it adds a check to see if vMCE occurs at the
  last iteration. If yes, it will do more iteration(s) so that the broken
  page's pfn_type and pfn number will be transferred to target.
  Another point is, if guest save to disk and during which vMCE occurs,
  it also need do more iteration(s).

For all cases at the target (if migration not aborted by vMCE):
  Target will populates pages for guest. As for the case of broken page,
  we prefer to keep the type of the page for the sake of seamless migration=
.
  Target will set p2m as p2m_ram_broken for broken page. If guest access
  the broken page again it will kill itself as expected.

All above description is based on the assumption that migration will succes=
s.
However, for case 2 there are scenario that may result in guest or hypervis=
or
crash. When pfn_type detecting fail to get p2m_ram_broken (vMCE occur after=
 the
detecting) and read the broken page, guest/hypervisor may survive or crash,
depending on error nature and how guest/hypervisor handle it. If guest/hype=
rvisor
survive, migration is OK since it will transfer pfn_type to the target at n=
ext
iter and then prevent further harm at target. If guest/hypervisor crash it
definitely needn't care migration any more. Unfortunately we have no way to
predict it, so what we can do is to do the best to handle it, after all we
cannot forbid migration for fear that it may crash guest/hypervisor.

Patch version history:
V4:
  - adjust variables and patch description based on feedback
V3:
  - handle pages broken at the last iteration
V2:
  - migrate continue when broken page occur during migration,
    via marking broken page to dirty bitmap
V1:
  - migration abort when broken page occur during migration
  - transfer pfn_type to target for broken page occur before migration

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunl=
ap@eu.citrix.com>>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com<mailto:jinsong.liu@intel.=
com>>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunlap@e=
u.citrix.com>>

Technically, since you changed part of the code I acked, you should have re=
moved this ack.  But now I've read the patch:

Acked-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunlap@e=
u.citrix.com>>

Thanks Jinsong!



--_000_DE8DF0795D48FD4CA783C40EC8292335396CEDSHSMSX101ccrcorpi_
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=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"GENERATOR" content=3D"MSHTML 8.00.6001.19328">
</head>
<body>
<div dir=3D"ltr" align=3D"left"><span class=3D"739442313-25112012"><font co=
lor=3D"#0000ff" size=3D"2" face=3D"Arial">Thanks George!</font></span></div=
>
<br>
<div dir=3D"ltr" lang=3D"en-us" class=3D"OutlookMessageHeader" align=3D"lef=
t">
<hr tabindex=3D"-1">
<font size=3D"2" face=3D"Tahoma"><b>From:</b> dunlapg@gmail.com [mailto:dun=
lapg@gmail.com]
<b>On Behalf Of </b>George Dunlap<br>
<b>Sent:</b> Saturday, November 24, 2012 12:26 AM<br>
<b>To:</b> Liu, Jinsong<br>
<b>Cc:</b> Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensourc=
e.com<br>
<b>Subject:</b> Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page wit=
h regard to migration<br>
</font><br>
</div>
<div></div>
On Fri, Nov 23, 2012 at 12:25 AM, Liu Jinsong <span dir=3D"ltr">&lt;<a href=
=3D"mailto:jinsong.liu@intel.com" target=3D"_blank">jinsong.liu@intel.com</=
a>&gt;</span> wrote:<br>
<div class=3D"gmail_extra">
<div class=3D"gmail_quote">
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
This patch handles broken page wrt migration. Generally there are below cas=
es:<br>
<div class=3D"im">1. broken page occurs before migration<br>
2. broken page occurs during migration<br>
</div>
&nbsp; 2.1 broken page occurs during migration but not at the last iteratio=
n<br>
&nbsp; 2.2 broken page occurs at the last iteration of migration<br>
<br>
For case 1, at the sender the broken page will be mapped but not copied<br>
<div class=3D"im">&nbsp; to target (otherwise it may trigger more serious e=
rror, say, SRAR error).<br>
&nbsp; While its pfn_type and pfn number will be transferred to target so t=
hat<br>
&nbsp; target take appropriate action.<br>
<br>
</div>
For case 2.1, at the sender mce handler marks the broken page to dirty<br>
&nbsp; bitmap, so that at next iteration, its pfn_type and pfn number will =
be<br>
&nbsp; transferred to the target and then take appropriate action.<br>
<br>
For case 2.2, at the sender it adds a check to see if vMCE occurs at the<br=
>
&nbsp; last iteration. If yes, it will do more iteration(s) so that the bro=
ken<br>
&nbsp; page's pfn_type and pfn number will be transferred to target.<br>
&nbsp; Another point is, if guest save to disk and during which vMCE occurs=
,<br>
&nbsp; it also need do more iteration(s).<br>
<br>
For all cases at the target (if migration not aborted by vMCE):<br>
&nbsp; Target will populates pages for guest. As for the case of broken pag=
e,<br>
&nbsp; we prefer to keep the type of the page for the sake of seamless migr=
ation.<br>
&nbsp; Target will set p2m as p2m_ram_broken for broken page. If guest acce=
ss<br>
<div class=3D"im">&nbsp; the broken page again it will kill itself as expec=
ted.<br>
<br>
</div>
All above description is based on the assumption that migration will succes=
s.<br>
However, for case 2 there are scenario that may result in guest or hypervis=
or<br>
crash. When pfn_type detecting fail to get p2m_ram_broken (vMCE occur after=
 the<br>
detecting) and read the broken page, guest/hypervisor may survive or crash,=
<br>
depending on error nature and how guest/hypervisor handle it. If guest/hype=
rvisor<br>
survive, migration is OK since it will transfer pfn_type to the target at n=
ext<br>
iter and then prevent further harm at target. If guest/hypervisor crash it<=
br>
definitely needn't care migration any more. Unfortunately we have no way to=
<br>
predict it, so what we can do is to do the best to handle it, after all we<=
br>
cannot forbid migration for fear that it may crash guest/hypervisor.<br>
<br>
Patch version history:<br>
V4:<br>
&nbsp; - adjust variables and patch description based on feedback<br>
V3:<br>
&nbsp; - handle pages broken at the last iteration<br>
V2:<br>
&nbsp; - migrate continue when broken page occur during migration,<br>
&nbsp; &nbsp; via marking broken page to dirty bitmap<br>
V1:<br>
&nbsp; - migration abort when broken page occur during migration<br>
&nbsp; - transfer pfn_type to target for broken page occur before migration=
<br>
<div class=3D"im"><br>
Suggested-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.c=
om">george.dunlap@eu.citrix.com</a>&gt;<br>
Signed-off-by: Liu Jinsong &lt;<a href=3D"mailto:jinsong.liu@intel.com">jin=
song.liu@intel.com</a>&gt;<br>
Acked-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">=
george.dunlap@eu.citrix.com</a>&gt;<br>
</div>
</blockquote>
<div><br>
Technically, since you changed part of the code I acked, you should have re=
moved this ack.&nbsp; But now I've read the patch:<br>
<br>
Acked-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">=
george.dunlap@eu.citrix.com</a>&gt;<br>
<br>
Thanks Jinsong! <br>
</div>
<br>
</div>
<br>
</div>
</body>
</html>

--_000_DE8DF0795D48FD4CA783C40EC8292335396CEDSHSMSX101ccrcorpi_--


--===============3370268823370613467==
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.xen.org
http://lists.xen.org/xen-devel

--===============3370268823370613467==--


From xen-devel-bounces@lists.xen.org Sun Nov 25 13:25:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Nov 2012 13:25:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TccCk-0006Mf-93; Sun, 25 Nov 2012 13:25:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TccCi-0006Ma-54
	for xen-devel@lists.xensource.com; Sun, 25 Nov 2012 13:25:00 +0000
Received: from [85.158.139.83:17504] by server-16.bemta-5.messagelabs.com id
	E4/FA-04786-B2C12B05; Sun, 25 Nov 2012 13:24:59 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1353849897!27523484!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjMzMjc5\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14310 invoked from network); 25 Nov 2012 13:24:58 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-14.tower-182.messagelabs.com with SMTP;
	25 Nov 2012 13:24:58 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga102.ch.intel.com with ESMTP; 25 Nov 2012 05:24:55 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,315,1352102400"; 
	d="scan'208,217";a="222052225"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by azsmga001.ch.intel.com with ESMTP; 25 Nov 2012 05:24:35 -0800
Received: from fmsmsx101.amr.corp.intel.com (10.19.9.52) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Sun, 25 Nov 2012 05:24:34 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX101.amr.corp.intel.com (10.19.9.52) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Sun, 25 Nov 2012 05:24:35 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Sun, 25 Nov 2012 21:24:33 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Thread-Topic: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNyZdIH+TZqbearkyCq5DrDs2IGJf6jQGA
Date: Sun, 25 Nov 2012 13:24:33 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC8292335396CED@SHSMSX101.ccr.corp.intel.com>
References: <d3378692eece3e552ba2.1353630328@ljsromley.bj.intel.com>
	<CAFLBxZZ_W5PMLYiqEwdrpqkjgiMN9NoN2f33ErLriOwNOD9GgA@mail.gmail.com>
In-Reply-To: <CAFLBxZZ_W5PMLYiqEwdrpqkjgiMN9NoN2f33ErLriOwNOD9GgA@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3370268823370613467=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============3370268823370613467==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_DE8DF0795D48FD4CA783C40EC8292335396CEDSHSMSX101ccrcorpi_"

--_000_DE8DF0795D48FD4CA783C40EC8292335396CEDSHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Thanks George!

________________________________
From: dunlapg@gmail.com [mailto:dunlapg@gmail.com] On Behalf Of George Dunl=
ap
Sent: Saturday, November 24, 2012 12:26 AM
To: Liu, Jinsong
Cc: Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regar=
d to migration

On Fri, Nov 23, 2012 at 12:25 AM, Liu Jinsong <jinsong.liu@intel.com<mailto=
:jinsong.liu@intel.com>> wrote:
This patch handles broken page wrt migration. Generally there are below cas=
es:
1. broken page occurs before migration
2. broken page occurs during migration
  2.1 broken page occurs during migration but not at the last iteration
  2.2 broken page occurs at the last iteration of migration

For case 1, at the sender the broken page will be mapped but not copied
  to target (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number will be transferred to target so that
  target take appropriate action.

For case 2.1, at the sender mce handler marks the broken page to dirty
  bitmap, so that at next iteration, its pfn_type and pfn number will be
  transferred to the target and then take appropriate action.

For case 2.2, at the sender it adds a check to see if vMCE occurs at the
  last iteration. If yes, it will do more iteration(s) so that the broken
  page's pfn_type and pfn number will be transferred to target.
  Another point is, if guest save to disk and during which vMCE occurs,
  it also need do more iteration(s).

For all cases at the target (if migration not aborted by vMCE):
  Target will populates pages for guest. As for the case of broken page,
  we prefer to keep the type of the page for the sake of seamless migration=
.
  Target will set p2m as p2m_ram_broken for broken page. If guest access
  the broken page again it will kill itself as expected.

All above description is based on the assumption that migration will succes=
s.
However, for case 2 there are scenario that may result in guest or hypervis=
or
crash. When pfn_type detecting fail to get p2m_ram_broken (vMCE occur after=
 the
detecting) and read the broken page, guest/hypervisor may survive or crash,
depending on error nature and how guest/hypervisor handle it. If guest/hype=
rvisor
survive, migration is OK since it will transfer pfn_type to the target at n=
ext
iter and then prevent further harm at target. If guest/hypervisor crash it
definitely needn't care migration any more. Unfortunately we have no way to
predict it, so what we can do is to do the best to handle it, after all we
cannot forbid migration for fear that it may crash guest/hypervisor.

Patch version history:
V4:
  - adjust variables and patch description based on feedback
V3:
  - handle pages broken at the last iteration
V2:
  - migrate continue when broken page occur during migration,
    via marking broken page to dirty bitmap
V1:
  - migration abort when broken page occur during migration
  - transfer pfn_type to target for broken page occur before migration

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunl=
ap@eu.citrix.com>>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com<mailto:jinsong.liu@intel.=
com>>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunlap@e=
u.citrix.com>>

Technically, since you changed part of the code I acked, you should have re=
moved this ack.  But now I've read the patch:

Acked-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunlap@e=
u.citrix.com>>

Thanks Jinsong!



--_000_DE8DF0795D48FD4CA783C40EC8292335396CEDSHSMSX101ccrcorpi_
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=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"GENERATOR" content=3D"MSHTML 8.00.6001.19328">
</head>
<body>
<div dir=3D"ltr" align=3D"left"><span class=3D"739442313-25112012"><font co=
lor=3D"#0000ff" size=3D"2" face=3D"Arial">Thanks George!</font></span></div=
>
<br>
<div dir=3D"ltr" lang=3D"en-us" class=3D"OutlookMessageHeader" align=3D"lef=
t">
<hr tabindex=3D"-1">
<font size=3D"2" face=3D"Tahoma"><b>From:</b> dunlapg@gmail.com [mailto:dun=
lapg@gmail.com]
<b>On Behalf Of </b>George Dunlap<br>
<b>Sent:</b> Saturday, November 24, 2012 12:26 AM<br>
<b>To:</b> Liu, Jinsong<br>
<b>Cc:</b> Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensourc=
e.com<br>
<b>Subject:</b> Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page wit=
h regard to migration<br>
</font><br>
</div>
<div></div>
On Fri, Nov 23, 2012 at 12:25 AM, Liu Jinsong <span dir=3D"ltr">&lt;<a href=
=3D"mailto:jinsong.liu@intel.com" target=3D"_blank">jinsong.liu@intel.com</=
a>&gt;</span> wrote:<br>
<div class=3D"gmail_extra">
<div class=3D"gmail_quote">
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
This patch handles broken page wrt migration. Generally there are below cas=
es:<br>
<div class=3D"im">1. broken page occurs before migration<br>
2. broken page occurs during migration<br>
</div>
&nbsp; 2.1 broken page occurs during migration but not at the last iteratio=
n<br>
&nbsp; 2.2 broken page occurs at the last iteration of migration<br>
<br>
For case 1, at the sender the broken page will be mapped but not copied<br>
<div class=3D"im">&nbsp; to target (otherwise it may trigger more serious e=
rror, say, SRAR error).<br>
&nbsp; While its pfn_type and pfn number will be transferred to target so t=
hat<br>
&nbsp; target take appropriate action.<br>
<br>
</div>
For case 2.1, at the sender mce handler marks the broken page to dirty<br>
&nbsp; bitmap, so that at next iteration, its pfn_type and pfn number will =
be<br>
&nbsp; transferred to the target and then take appropriate action.<br>
<br>
For case 2.2, at the sender it adds a check to see if vMCE occurs at the<br=
>
&nbsp; last iteration. If yes, it will do more iteration(s) so that the bro=
ken<br>
&nbsp; page's pfn_type and pfn number will be transferred to target.<br>
&nbsp; Another point is, if guest save to disk and during which vMCE occurs=
,<br>
&nbsp; it also need do more iteration(s).<br>
<br>
For all cases at the target (if migration not aborted by vMCE):<br>
&nbsp; Target will populates pages for guest. As for the case of broken pag=
e,<br>
&nbsp; we prefer to keep the type of the page for the sake of seamless migr=
ation.<br>
&nbsp; Target will set p2m as p2m_ram_broken for broken page. If guest acce=
ss<br>
<div class=3D"im">&nbsp; the broken page again it will kill itself as expec=
ted.<br>
<br>
</div>
All above description is based on the assumption that migration will succes=
s.<br>
However, for case 2 there are scenario that may result in guest or hypervis=
or<br>
crash. When pfn_type detecting fail to get p2m_ram_broken (vMCE occur after=
 the<br>
detecting) and read the broken page, guest/hypervisor may survive or crash,=
<br>
depending on error nature and how guest/hypervisor handle it. If guest/hype=
rvisor<br>
survive, migration is OK since it will transfer pfn_type to the target at n=
ext<br>
iter and then prevent further harm at target. If guest/hypervisor crash it<=
br>
definitely needn't care migration any more. Unfortunately we have no way to=
<br>
predict it, so what we can do is to do the best to handle it, after all we<=
br>
cannot forbid migration for fear that it may crash guest/hypervisor.<br>
<br>
Patch version history:<br>
V4:<br>
&nbsp; - adjust variables and patch description based on feedback<br>
V3:<br>
&nbsp; - handle pages broken at the last iteration<br>
V2:<br>
&nbsp; - migrate continue when broken page occur during migration,<br>
&nbsp; &nbsp; via marking broken page to dirty bitmap<br>
V1:<br>
&nbsp; - migration abort when broken page occur during migration<br>
&nbsp; - transfer pfn_type to target for broken page occur before migration=
<br>
<div class=3D"im"><br>
Suggested-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.c=
om">george.dunlap@eu.citrix.com</a>&gt;<br>
Signed-off-by: Liu Jinsong &lt;<a href=3D"mailto:jinsong.liu@intel.com">jin=
song.liu@intel.com</a>&gt;<br>
Acked-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">=
george.dunlap@eu.citrix.com</a>&gt;<br>
</div>
</blockquote>
<div><br>
Technically, since you changed part of the code I acked, you should have re=
moved this ack.&nbsp; But now I've read the patch:<br>
<br>
Acked-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">=
george.dunlap@eu.citrix.com</a>&gt;<br>
<br>
Thanks Jinsong! <br>
</div>
<br>
</div>
<br>
</div>
</body>
</html>

--_000_DE8DF0795D48FD4CA783C40EC8292335396CEDSHSMSX101ccrcorpi_--


--===============3370268823370613467==
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.xen.org
http://lists.xen.org/xen-devel

--===============3370268823370613467==--


From xen-devel-bounces@lists.xen.org Mon Nov 26 00:13:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 00:13:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcmK3-0002Ec-DD; Mon, 26 Nov 2012 00:13:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <afaerber@suse.de>) id 1TcmK1-0002EX-1o
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 00:13:13 +0000
Received: from [85.158.137.99:52292] by server-12.bemta-3.messagelabs.com id
	FF/70-22757-314B2B05; Mon, 26 Nov 2012 00:13:07 +0000
X-Env-Sender: afaerber@suse.de
X-Msg-Ref: server-16.tower-217.messagelabs.com!1353888782!20533656!1
X-Originating-IP: [195.135.220.15]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24657 invoked from network); 26 Nov 2012 00:13:03 -0000
Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15)
	by server-16.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 00:13:03 -0000
Received: from relay1.suse.de (unknown [195.135.220.254])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx2.suse.de (Postfix) with ESMTP id 18EC0A0FF6;
	Mon, 26 Nov 2012 01:12:58 +0100 (CET)
From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
To: qemu-devel@nongnu.org
Date: Mon, 26 Nov 2012 01:12:13 +0100
Message-Id: <1353888766-6951-2-git-send-email-afaerber@suse.de>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1353888766-6951-1-git-send-email-afaerber@suse.de>
References: <1353888766-6951-1-git-send-email-afaerber@suse.de>
MIME-Version: 1.0
Cc: "open list:X86" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	"Michael S. Tsirkin" <mst@redhat.com>, anthony@codemonkey.ws,
	Paolo Bonzini <pbonzini@redhat.com>,
	=?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
Subject: [Xen-devel] [PATCH 01/34] qdev: Eliminate qdev_free() in favor of
	QOM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

cWRldl9mcmVlKCkgd2FzIHRyaXZpYWxseSB3cmFwcGluZyBvYmplY3RfZGVsZXRlKCkuIElubGlu
ZSBpdCBhbmQgZHJvcAp0aGUgd3JhcHBlciBhcyBhIGZ1cnRoZXIgc3RlcCB0byBRT00naWZ5IHFk
ZXYuCgpTaWduZWQtb2ZmLWJ5OiBBbmRyZWFzIEbDpHJiZXIgPGFmYWVyYmVyQHN1c2UuZGU+CkNj
OiBQYW9sbyBCb256aW5pIDxwYm9uemluaUByZWRoYXQuY29tPgotLS0KIGh3L2FjcGlfcGlpeDQu
YyAgICAgIHwgICAgMiArLQogaHcvcGNpLWhvdHBsdWcuYyAgICAgfCAgICAyICstCiBody9wY2lf
YnJpZGdlLmMgICAgICB8ICAgIDIgKy0KIGh3L3BjaWUuYyAgICAgICAgICAgIHwgICAgMiArLQog
aHcvcWRldi1jb3JlLmggICAgICAgfCAgICAxIC0KIGh3L3FkZXYtbW9uaXRvci5jICAgIHwgICAg
MiArLQogaHcvcWRldi5jICAgICAgICAgICAgfCAgIDEyICsrKy0tLS0tLS0tLQogaHcvc2NzaS1i
dXMuYyAgIC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-bounces@lists.xen.org Mon Nov 26 00:13:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 00:13:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcmK3-0002Ec-DD; Mon, 26 Nov 2012 00:13:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <afaerber@suse.de>) id 1TcmK1-0002EX-1o
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 00:13:13 +0000
Received: from [85.158.137.99:52292] by server-12.bemta-3.messagelabs.com id
	FF/70-22757-314B2B05; Mon, 26 Nov 2012 00:13:07 +0000
X-Env-Sender: afaerber@suse.de
X-Msg-Ref: server-16.tower-217.messagelabs.com!1353888782!20533656!1
X-Originating-IP: [195.135.220.15]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24657 invoked from network); 26 Nov 2012 00:13:03 -0000
Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15)
	by server-16.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 00:13:03 -0000
Received: from relay1.suse.de (unknown [195.135.220.254])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx2.suse.de (Postfix) with ESMTP id 18EC0A0FF6;
	Mon, 26 Nov 2012 01:12:58 +0100 (CET)
From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
To: qemu-devel@nongnu.org
Date: Mon, 26 Nov 2012 01:12:13 +0100
Message-Id: <1353888766-6951-2-git-send-email-afaerber@suse.de>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1353888766-6951-1-git-send-email-afaerber@suse.de>
References: <1353888766-6951-1-git-send-email-afaerber@suse.de>
MIME-Version: 1.0
Cc: "open list:X86" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	"Michael S. Tsirkin" <mst@redhat.com>, anthony@codemonkey.ws,
	Paolo Bonzini <pbonzini@redhat.com>,
	=?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
Subject: [Xen-devel] [PATCH 01/34] qdev: Eliminate qdev_free() in favor of
	QOM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

cWRldl9mcmVlKCkgd2FzIHRyaXZpYWxseSB3cmFwcGluZyBvYmplY3RfZGVsZXRlKCkuIElubGlu
ZSBpdCBhbmQgZHJvcAp0aGUgd3JhcHBlciBhcyBhIGZ1cnRoZXIgc3RlcCB0byBRT00naWZ5IHFk
ZXYuCgpTaWduZWQtb2ZmLWJ5OiBBbmRyZWFzIEbDpHJiZXIgPGFmYWVyYmVyQHN1c2UuZGU+CkNj
OiBQYW9sbyBCb256aW5pIDxwYm9uemluaUByZWRoYXQuY29tPgotLS0KIGh3L2FjcGlfcGlpeDQu
YyAgICAgIHwgICAgMiArLQogaHcvcGNpLWhvdHBsdWcuYyAgICAgfCAgICAyICstCiBody9wY2lf
YnJpZGdlLmMgICAgICB8ICAgIDIg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AgICB9CiB9CiAKLS0gCjEuNy4xMC40CgoKX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlz
dApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Mon Nov 26 03:39:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 03:39:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcpWm-0007Sc-Ve; Mon, 26 Nov 2012 03:38:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <cyliu@suse.com>) id 1TcpWl-0007SX-96
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 03:38:35 +0000
Received: from [85.158.143.99:16355] by server-2.bemta-4.messagelabs.com id
	DA/24-28922-A34E2B05; Mon, 26 Nov 2012 03:38:34 +0000
X-Env-Sender: cyliu@suse.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1353901112!30413282!1
X-Originating-IP: [137.65.250.26]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1557 invoked from network); 26 Nov 2012 03:38:33 -0000
Received: from victor.provo.novell.com (HELO victor.provo.novell.com)
	(137.65.250.26)
	by server-13.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 03:38:33 -0000
Received: from linux-1.site (prv-ext-foundry1int.gns.novell.com
	[137.65.251.240])
	by victor.provo.novell.com with ESMTP (TLS encrypted);
	Sun, 25 Nov 2012 20:37:20 -0700
MIME-Version: 1.0
X-Mercurial-Node: d0f86e88e3c1dc69e897736081acc3bac706c797
Message-Id: <d0f86e88e3c1dc69e897.1353901039@linux-1.site>
User-Agent: Mercurial-patchbomb/1.7.5
Date: Mon, 26 Nov 2012 11:37:19 +0800
From: Chunyan Liu <cyliu@suse.com>
To: xen-devel@lists.xensource.com
Cc: ian.campbell@citrix.com
Subject: [Xen-devel] [PATCH v3] xenstore-chmod: handle arbitrary number of
 perms rather than MAX_PERMS constant
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Constant MAX_PERMS 16 is too small to use in some occasions, e.g. if
there are more than 16 domU(s) on one hypervisor (it's easy to
achieve) and one wants to do xenstore-chmod PATH to all domU(s). So,
remove MAX_PERMS limitation and make it as arbitrary number of perms.

Signed-off-by: Chunyan Liu <cyliu@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>

---
Change to V2:
Cleanup hard tabs in lines touched in the patch.
Resend patch by hg patchbomb to avoid whitespace damage.

diff -r 8b93ac0c93f3 -r d0f86e88e3c1 tools/xenstore/xenstore_client.c
--- a/tools/xenstore/xenstore_client.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/xenstore/xenstore_client.c	Mon Nov 26 11:33:39 2012 +0800
@@ -25,7 +25,6 @@
 #define PATH_SEP '/'
 #define MAX_PATH_LEN 256
 
-#define MAX_PERMS 16
 
 enum mode {
     MODE_unknown,
@@ -407,44 +406,41 @@ perform(enum mode mode, int optind, int 
                 output("%s\n", list[i]);
             }
             free(list);
-	    optind++;
-	    break;
-	}
-	case MODE_ls: {
-	    do_ls(xsh, argv[optind], 0, prefix);
- 	    optind++;
- 	    break;
+            optind++;
+            break;
+        }
+        case MODE_ls: {
+            do_ls(xsh, argv[optind], 0, prefix);
+            optind++;
+            break;
         }
         case MODE_chmod: {
-            struct xs_permissions perms[MAX_PERMS];
-            int nperms = 0;
             /* save path pointer: */
             char *path = argv[optind++];
-            for (; argv[optind]; optind++, nperms++)
+            int nperms = argc - optind;
+            struct xs_permissions perms[nperms];
+            int i;
+            for (i = 0; argv[optind]; optind++, i++)
             {
-                if (MAX_PERMS <= nperms)
-                    errx(1, "Too many permissions specified.  "
-			 "Maximum per invocation is %d.", MAX_PERMS);
-
-                perms[nperms].id = atoi(argv[optind]+1);
+                perms[i].id = atoi(argv[optind]+1);
 
                 switch (argv[optind][0])
                 {
                 case 'n':
-                    perms[nperms].perms = XS_PERM_NONE;
+                    perms[i].perms = XS_PERM_NONE;
                     break;
                 case 'r':
-                    perms[nperms].perms = XS_PERM_READ;
+                    perms[i].perms = XS_PERM_READ;
                     break;
                 case 'w':
-                    perms[nperms].perms = XS_PERM_WRITE;
+                    perms[i].perms = XS_PERM_WRITE;
                     break;
                 case 'b':
-                    perms[nperms].perms = XS_PERM_READ | XS_PERM_WRITE;
+                    perms[i].perms = XS_PERM_READ | XS_PERM_WRITE;
                     break;
                 default:
                     errx(1, "Invalid permission specification: '%c'",
-			 argv[optind][0]);
+                         argv[optind][0]);
                 }
             }
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 03:39:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 03:39:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcpWm-0007Sc-Ve; Mon, 26 Nov 2012 03:38:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <cyliu@suse.com>) id 1TcpWl-0007SX-96
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 03:38:35 +0000
Received: from [85.158.143.99:16355] by server-2.bemta-4.messagelabs.com id
	DA/24-28922-A34E2B05; Mon, 26 Nov 2012 03:38:34 +0000
X-Env-Sender: cyliu@suse.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1353901112!30413282!1
X-Originating-IP: [137.65.250.26]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1557 invoked from network); 26 Nov 2012 03:38:33 -0000
Received: from victor.provo.novell.com (HELO victor.provo.novell.com)
	(137.65.250.26)
	by server-13.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 03:38:33 -0000
Received: from linux-1.site (prv-ext-foundry1int.gns.novell.com
	[137.65.251.240])
	by victor.provo.novell.com with ESMTP (TLS encrypted);
	Sun, 25 Nov 2012 20:37:20 -0700
MIME-Version: 1.0
X-Mercurial-Node: d0f86e88e3c1dc69e897736081acc3bac706c797
Message-Id: <d0f86e88e3c1dc69e897.1353901039@linux-1.site>
User-Agent: Mercurial-patchbomb/1.7.5
Date: Mon, 26 Nov 2012 11:37:19 +0800
From: Chunyan Liu <cyliu@suse.com>
To: xen-devel@lists.xensource.com
Cc: ian.campbell@citrix.com
Subject: [Xen-devel] [PATCH v3] xenstore-chmod: handle arbitrary number of
 perms rather than MAX_PERMS constant
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Constant MAX_PERMS 16 is too small to use in some occasions, e.g. if
there are more than 16 domU(s) on one hypervisor (it's easy to
achieve) and one wants to do xenstore-chmod PATH to all domU(s). So,
remove MAX_PERMS limitation and make it as arbitrary number of perms.

Signed-off-by: Chunyan Liu <cyliu@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>

---
Change to V2:
Cleanup hard tabs in lines touched in the patch.
Resend patch by hg patchbomb to avoid whitespace damage.

diff -r 8b93ac0c93f3 -r d0f86e88e3c1 tools/xenstore/xenstore_client.c
--- a/tools/xenstore/xenstore_client.c	Tue Nov 13 11:19:17 2012 +0000
+++ b/tools/xenstore/xenstore_client.c	Mon Nov 26 11:33:39 2012 +0800
@@ -25,7 +25,6 @@
 #define PATH_SEP '/'
 #define MAX_PATH_LEN 256
 
-#define MAX_PERMS 16
 
 enum mode {
     MODE_unknown,
@@ -407,44 +406,41 @@ perform(enum mode mode, int optind, int 
                 output("%s\n", list[i]);
             }
             free(list);
-	    optind++;
-	    break;
-	}
-	case MODE_ls: {
-	    do_ls(xsh, argv[optind], 0, prefix);
- 	    optind++;
- 	    break;
+            optind++;
+            break;
+        }
+        case MODE_ls: {
+            do_ls(xsh, argv[optind], 0, prefix);
+            optind++;
+            break;
         }
         case MODE_chmod: {
-            struct xs_permissions perms[MAX_PERMS];
-            int nperms = 0;
             /* save path pointer: */
             char *path = argv[optind++];
-            for (; argv[optind]; optind++, nperms++)
+            int nperms = argc - optind;
+            struct xs_permissions perms[nperms];
+            int i;
+            for (i = 0; argv[optind]; optind++, i++)
             {
-                if (MAX_PERMS <= nperms)
-                    errx(1, "Too many permissions specified.  "
-			 "Maximum per invocation is %d.", MAX_PERMS);
-
-                perms[nperms].id = atoi(argv[optind]+1);
+                perms[i].id = atoi(argv[optind]+1);
 
                 switch (argv[optind][0])
                 {
                 case 'n':
-                    perms[nperms].perms = XS_PERM_NONE;
+                    perms[i].perms = XS_PERM_NONE;
                     break;
                 case 'r':
-                    perms[nperms].perms = XS_PERM_READ;
+                    perms[i].perms = XS_PERM_READ;
                     break;
                 case 'w':
-                    perms[nperms].perms = XS_PERM_WRITE;
+                    perms[i].perms = XS_PERM_WRITE;
                     break;
                 case 'b':
-                    perms[nperms].perms = XS_PERM_READ | XS_PERM_WRITE;
+                    perms[i].perms = XS_PERM_READ | XS_PERM_WRITE;
                     break;
                 default:
                     errx(1, "Invalid permission specification: '%c'",
-			 argv[optind][0]);
+                         argv[optind][0]);
                 }
             }
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 03:40:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 03:40:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcpYP-0007W3-H4; Mon, 26 Nov 2012 03:40:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <davidxu06@gmail.com>) id 1TcpYO-0007Vy-Bx
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 03:40:16 +0000
Received: from [85.158.139.211:10029] by server-10.bemta-5.messagelabs.com id
	FD/32-09257-E94E2B05; Mon, 26 Nov 2012 03:40:14 +0000
X-Env-Sender: davidxu06@gmail.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353901211!21589094!1
X-Originating-IP: [209.85.216.173]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_10_20,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30489 invoked from network); 26 Nov 2012 03:40:12 -0000
Received: from mail-qc0-f173.google.com (HELO mail-qc0-f173.google.com)
	(209.85.216.173)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 03:40:12 -0000
Received: by mail-qc0-f173.google.com with SMTP id b12so8966099qca.32
	for <xen-devel@lists.xen.org>; Sun, 25 Nov 2012 19:40:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=nSkLbxfN1hUbFAn9Ma6dv4wrTv4w02KgFPKVwIVTny0=;
	b=SWjgu06rTxZhSdB01EaoZ6VYb25MW2loWdrwP81EfMygE8Jabyu1MTnrLnDEKN61G+
	VdYbhxTrYmK73H33Wyyk5PWMWvfhFBPBCP9OmSwltArJBhcXBVlKBkFDaddFqUs+mm/o
	b+pD8GXOw22UIcP+JezscBAvPhy0vxyOXnoWr6Sfthfc0ZDzZIs6j0P4Ycfy6isEi3be
	OiStauYnqwbZtrh4rDnNqRiJKZYrrYS3InpS65zCUj596rvuFtDIMZ0FvjHnuXPvOTlG
	1GQ6eGbAgM/+9/xav1MGhDu608Qwe4hZCMk8cgdOqGiw75Y1k4FKv1ypb4Ul2Rmnp1F4
	M61w==
MIME-Version: 1.0
Received: by 10.224.116.12 with SMTP id k12mr11050529qaq.47.1353901210757;
	Sun, 25 Nov 2012 19:40:10 -0800 (PST)
Received: by 10.49.1.116 with HTTP; Sun, 25 Nov 2012 19:40:10 -0800 (PST)
Date: Sun, 25 Nov 2012 22:40:10 -0500
Message-ID: <CAGjowiTaWSbyWH-NEXz2FEdeXdxHMVbOf9Kj7t25tNj0fvUZ-w@mail.gmail.com>
From: David Xu <davidxu06@gmail.com>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] kernel panic on Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8252185711209429015=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============8252185711209429015==
Content-Type: multipart/alternative; boundary=20cf3074d7e0ba69ad04cf5db02d

--20cf3074d7e0ba69ad04cf5db02d
Content-Type: text/plain; charset=ISO-8859-1

Hi all,

When I run the iperf benchmark to measure the TCP throughput between a
physical machine and a VM, the TCP server which is a Xen VM crashed. Do you
know what's the problem of this bug? Thanks.

[  100.973027] BUG: unable to handle kernel NULL pointer dereference at
0000000000000008
[  100.973040] IP: [<ffffffff81455f16>] xennet_alloc_rx_buffers+0x166/0x350
[  100.973050] PGD 1cc98067 PUD 1d74c067 PMD 0
[  100.973051] Oops: 0002 [#1] SMP
[  100.973051] CPU 1
[  100.973051] Modules linked in:
[  100.973051]
[  100.973051] Pid: 9, comm: ksoftirqd/1 Not tainted 3.2.23 #131
[  100.973051] RIP: e030:[<ffffffff81455f16>]  [<ffffffff81455f16>]
xennet_alloc_rx_buffers+0x166/0x350
[  100.973051] RSP: e02b:ffff88001e8f1c10  EFLAGS: 00010206
[  100.973051] RAX: 0000000000000000 RBX: ffff88001da98000 RCX:
00000000000012b0
[  100.973051] RDX: 0000000000000000 RSI: 0000000000000000 RDI:
0000000000000256
[  100.973051] RBP: ffff88001e8f1c60 R08: ffffc90000000000 R09:
0000000000017a41
[  100.973051] R10: 0000000000000002 R11: 0000000000017298 R12:
ffff880019a7b700
[  100.973051] R13: 0000000000000256 R14: 0000000000012092 R15:
0000000000000092
[  100.973051] FS:  00007f7ace91f700(0000) GS:ffff88001fd00000(0000)
knlGS:0000000000000000
[  100.973051] CS:  e033 DS: 0000 ES: 0000 CR0: 000000008005003b
[  100.973051] CR2: 0000000000000008 CR3: 000000001da64000 CR4:
0000000000002660
[  100.973051] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
[  100.973051] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
0000000000000400
[  100.973051] Process ksoftirqd/1 (pid: 9, threadinfo ffff88001e8f0000,
task ffff88001e8d7000)
[  100.973051] Stack:
[  100.973051]  0000000000000091 ffff88001da99c80 ffff88001da99400
0000000100012091
[  100.973051]  ffff88001e8f1c60 000000000000002d ffff880019a8ac4e
ffff88001fd1a590
[  100.973051]  0000160000000000 ffff880000000000 ffff88001e8f1db0
ffffffff8145699a
[  100.973051] Call Trace:
[  100.973051]  [<ffffffff8145699a>] xennet_poll+0x7ca/0xe80
[  100.973051]  [<ffffffff814e3e51>] net_rx_action+0x151/0x2b0
[  100.973051]  [<ffffffff8106090d>] __do_softirq+0xbd/0x250
[  100.973051]  [<ffffffff81060b67>] run_ksoftirqd+0xc7/0x170
[  100.973051]  [<ffffffff81060aa0>] ? __do_softirq+0x250/0x250
[  100.973051]  [<ffffffff8107b0ac>] kthread+0x8c/0xa0
[  100.973051]  [<ffffffff8167ca04>] kernel_thread_helper+0x4/0x10
[  100.973051]  [<ffffffff81672d21>] ? retint_restore_args+0x13/0x13
[  100.973051]  [<ffffffff8167ca00>] ? gs_change+0x13/0x13
[  100.973051] Code: 0f 84 19 01 00 00 83 ab 10 14 00 00 01 45 0f b6 fe 49
8b 14 24 49 8b 44 24 08 49 c7 04 24 00 00 00 00 49 c7 44 24 08 00 00 00 00
<48> 89 42 08 48 89 10 41 0f b6 d7 49 89 5c 24 20 48 8d 82 b8 01
[  100.973051] RIP  [<ffffffff81455f16>] xennet_alloc_rx_buffers+0x166/0x350
[  100.973051]  RSP <ffff88001e8f1c10>
[  100.973051] CR2: 0000000000000008
[  100.973259] ---[ end trace b0530821c3527d70 ]---
[  100.973263] Kernel panic - not syncing: Fatal exception in interrupt
[  100.973267] Pid: 9, comm: ksoftirqd/1 Tainted: G      D      3.2.23 #131
[  100.973270] Call Trace:
[  100.973273]  [<ffffffff816674ae>] panic+0x91/0x1a2
[  100.973278]  [<ffffffff8100adb2>] ? check_events+0x12/0x20
[  100.973282]  [<ffffffff81673b0a>] oops_end+0xea/0xf0
[  100.973286]  [<ffffffff81666e6b>] no_context+0x214/0x223
[  100.973291]  [<ffffffff8113cf94>] ? kmem_cache_free+0x104/0x110
[  100.973295]  [<ffffffff8166704b>] __bad_area_nosemaphore+0x1d1/0x1f0
[  100.973299]  [<ffffffff8166707d>] bad_area_nosemaphore+0x13/0x15
[  100.973304]  [<ffffffff816763fb>] do_page_fault+0x35b/0x4f0
[  100.973308]  [<ffffffff814d6044>] ? __netdev_alloc_skb+0x24/0x50
[  100.973313]  [<ffffffff8129f75a>] ? trace_hardirqs_off_thunk+0x3a/0x6c
[  100.973318]  [<ffffffff81672fa5>] page_fault+0x25/0x30
[  100.973322]  [<ffffffff81455f16>] ? xennet_alloc_rx_buffers+0x166/0x350
[  100.973326]  [<ffffffff8145699a>] xennet_poll+0x7ca/0xe80
[  100.973330]  [<ffffffff814e3e51>] net_rx_action+0x151/0x2b0
[  100.973334]  [<ffffffff8106090d>] __do_softirq+0xbd/0x250
[  100.973338]  [<ffffffff81060b67>] run_ksoftirqd+0xc7/0x170
[  100.973342]  [<ffffffff81060aa0>] ? __do_softirq+0x250/0x250
[  100.973346]  [<ffffffff8107b0ac>] kthread+0x8c/0xa0
[  100.973350]  [<ffffffff8167ca04>] kernel_thread_helper+0x4/0x10
[  100.973354]  [<ffffffff81672d21>] ? retint_restore_args+0x13/0x13
[  100.973358]  [<ffffffff8167ca00>] ? gs_change+0x13/0x13

Regards,
Cong

--20cf3074d7e0ba69ad04cf5db02d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi all,<div><br></div><div>When I run the iperf benchmark to measure the TC=
P throughput between a physical machine and a VM, the TCP server which is a=
 Xen VM crashed. Do you know what&#39;s the problem of this bug? Thanks.</d=
iv>
<div><br></div><div><div>[ =A0100.973027] BUG: unable to handle kernel NULL=
 pointer dereference at 0000000000000008</div><div>[ =A0100.973040] IP: [&l=
t;ffffffff81455f16&gt;] xennet_alloc_rx_buffers+0x166/0x350</div><div>[ =A0=
100.973050] PGD 1cc98067 PUD 1d74c067 PMD 0=A0</div>
<div>[ =A0100.973051] Oops: 0002 [#1] SMP=A0</div><div>[ =A0100.973051] CPU=
 1=A0</div><div>[ =A0100.973051] Modules linked in:</div><div>[ =A0100.9730=
51]=A0</div><div>[ =A0100.973051] Pid: 9, comm: ksoftirqd/1 Not tainted 3.2=
.23 #131 =A0</div>
<div>[ =A0100.973051] RIP: e030:[&lt;ffffffff81455f16&gt;] =A0[&lt;ffffffff=
81455f16&gt;] xennet_alloc_rx_buffers+0x166/0x350</div><div>[ =A0100.973051=
] RSP: e02b:ffff88001e8f1c10 =A0EFLAGS: 00010206</div><div>[ =A0100.973051]=
 RAX: 0000000000000000 RBX: ffff88001da98000 RCX: 00000000000012b0</div>
<div>[ =A0100.973051] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000=
000000000256</div><div>[ =A0100.973051] RBP: ffff88001e8f1c60 R08: ffffc900=
00000000 R09: 0000000000017a41</div><div>[ =A0100.973051] R10: 000000000000=
0002 R11: 0000000000017298 R12: ffff880019a7b700</div>
<div>[ =A0100.973051] R13: 0000000000000256 R14: 0000000000012092 R15: 0000=
000000000092</div><div>[ =A0100.973051] FS: =A000007f7ace91f700(0000) GS:ff=
ff88001fd00000(0000) knlGS:0000000000000000</div><div>[ =A0100.973051] CS: =
=A0e033 DS: 0000 ES: 0000 CR0: 000000008005003b</div>
<div>[ =A0100.973051] CR2: 0000000000000008 CR3: 000000001da64000 CR4: 0000=
000000002660</div><div>[ =A0100.973051] DR0: 0000000000000000 DR1: 00000000=
00000000 DR2: 0000000000000000</div><div>[ =A0100.973051] DR3: 000000000000=
0000 DR6: 00000000ffff0ff0 DR7: 0000000000000400</div>
<div>[ =A0100.973051] Process ksoftirqd/1 (pid: 9, threadinfo ffff88001e8f0=
000, task ffff88001e8d7000)</div><div>[ =A0100.973051] Stack:</div><div>[ =
=A0100.973051] =A00000000000000091 ffff88001da99c80 ffff88001da99400 000000=
0100012091</div>
<div>[ =A0100.973051] =A0ffff88001e8f1c60 000000000000002d ffff880019a8ac4e=
 ffff88001fd1a590</div><div>[ =A0100.973051] =A00000160000000000 ffff880000=
000000 ffff88001e8f1db0 ffffffff8145699a</div><div>[ =A0100.973051] Call Tr=
ace:</div>
<div>[ =A0100.973051] =A0[&lt;ffffffff8145699a&gt;] xennet_poll+0x7ca/0xe80=
</div><div>[ =A0100.973051] =A0[&lt;ffffffff814e3e51&gt;] net_rx_action+0x1=
51/0x2b0</div><div>[ =A0100.973051] =A0[&lt;ffffffff8106090d&gt;] __do_soft=
irq+0xbd/0x250</div>
<div>[ =A0100.973051] =A0[&lt;ffffffff81060b67&gt;] run_ksoftirqd+0xc7/0x17=
0</div><div>[ =A0100.973051] =A0[&lt;ffffffff81060aa0&gt;] ? __do_softirq+0=
x250/0x250</div><div>[ =A0100.973051] =A0[&lt;ffffffff8107b0ac&gt;] kthread=
+0x8c/0xa0</div>
<div>[ =A0100.973051] =A0[&lt;ffffffff8167ca04&gt;] kernel_thread_helper+0x=
4/0x10</div><div>[ =A0100.973051] =A0[&lt;ffffffff81672d21&gt;] ? retint_re=
store_args+0x13/0x13</div><div>[ =A0100.973051] =A0[&lt;ffffffff8167ca00&gt=
;] ? gs_change+0x13/0x13</div>
<div>[ =A0100.973051] Code: 0f 84 19 01 00 00 83 ab 10 14 00 00 01 45 0f b6=
 fe 49 8b 14 24 49 8b 44 24 08 49 c7 04 24 00 00 00 00 49 c7 44 24 08 00 00=
 00 00 &lt;48&gt; 89 42 08 48 89 10 41 0f b6 d7 49 89 5c 24 20 48 8d 82 b8 =
01=A0</div>
<div>[ =A0100.973051] RIP =A0[&lt;ffffffff81455f16&gt;] xennet_alloc_rx_buf=
fers+0x166/0x350</div><div>[ =A0100.973051] =A0RSP &lt;ffff88001e8f1c10&gt;=
</div><div>[ =A0100.973051] CR2: 0000000000000008</div><div>[ =A0100.973259=
] ---[ end trace b0530821c3527d70 ]---</div>
<div>[ =A0100.973263] Kernel panic - not syncing: Fatal exception in interr=
upt</div><div>[ =A0100.973267] Pid: 9, comm: ksoftirqd/1 Tainted: G =A0 =A0=
 =A0D =A0 =A0 =A03.2.23 #131</div><div>[ =A0100.973270] Call Trace:</div><d=
iv>[ =A0100.973273] =A0[&lt;ffffffff816674ae&gt;] panic+0x91/0x1a2</div>
<div>[ =A0100.973278] =A0[&lt;ffffffff8100adb2&gt;] ? check_events+0x12/0x2=
0</div><div>[ =A0100.973282] =A0[&lt;ffffffff81673b0a&gt;] oops_end+0xea/0x=
f0</div><div>[ =A0100.973286] =A0[&lt;ffffffff81666e6b&gt;] no_context+0x21=
4/0x223</div>
<div>[ =A0100.973291] =A0[&lt;ffffffff8113cf94&gt;] ? kmem_cache_free+0x104=
/0x110</div><div>[ =A0100.973295] =A0[&lt;ffffffff8166704b&gt;] __bad_area_=
nosemaphore+0x1d1/0x1f0</div><div>[ =A0100.973299] =A0[&lt;ffffffff8166707d=
&gt;] bad_area_nosemaphore+0x13/0x15</div>
<div>[ =A0100.973304] =A0[&lt;ffffffff816763fb&gt;] do_page_fault+0x35b/0x4=
f0</div><div>[ =A0100.973308] =A0[&lt;ffffffff814d6044&gt;] ? __netdev_allo=
c_skb+0x24/0x50</div><div>[ =A0100.973313] =A0[&lt;ffffffff8129f75a&gt;] ? =
trace_hardirqs_off_thunk+0x3a/0x6c</div>
<div>[ =A0100.973318] =A0[&lt;ffffffff81672fa5&gt;] page_fault+0x25/0x30</d=
iv><div>[ =A0100.973322] =A0[&lt;ffffffff81455f16&gt;] ? xennet_alloc_rx_bu=
ffers+0x166/0x350</div><div>[ =A0100.973326] =A0[&lt;ffffffff8145699a&gt;] =
xennet_poll+0x7ca/0xe80</div>
<div>[ =A0100.973330] =A0[&lt;ffffffff814e3e51&gt;] net_rx_action+0x151/0x2=
b0</div><div>[ =A0100.973334] =A0[&lt;ffffffff8106090d&gt;] __do_softirq+0x=
bd/0x250</div><div>[ =A0100.973338] =A0[&lt;ffffffff81060b67&gt;] run_ksoft=
irqd+0xc7/0x170</div>
<div>[ =A0100.973342] =A0[&lt;ffffffff81060aa0&gt;] ? __do_softirq+0x250/0x=
250</div><div>[ =A0100.973346] =A0[&lt;ffffffff8107b0ac&gt;] kthread+0x8c/0=
xa0</div><div>[ =A0100.973350] =A0[&lt;ffffffff8167ca04&gt;] kernel_thread_=
helper+0x4/0x10</div>
<div>[ =A0100.973354] =A0[&lt;ffffffff81672d21&gt;] ? retint_restore_args+0=
x13/0x13</div><div>[ =A0100.973358] =A0[&lt;ffffffff8167ca00&gt;] ? gs_chan=
ge+0x13/0x13</div></div><div><br></div><div>Regards,</div><div>Cong</div>

--20cf3074d7e0ba69ad04cf5db02d--


--===============8252185711209429015==
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.xen.org
http://lists.xen.org/xen-devel

--===============8252185711209429015==--


From xen-devel-bounces@lists.xen.org Mon Nov 26 03:40:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 03:40:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcpYP-0007W3-H4; Mon, 26 Nov 2012 03:40:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <davidxu06@gmail.com>) id 1TcpYO-0007Vy-Bx
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 03:40:16 +0000
Received: from [85.158.139.211:10029] by server-10.bemta-5.messagelabs.com id
	FD/32-09257-E94E2B05; Mon, 26 Nov 2012 03:40:14 +0000
X-Env-Sender: davidxu06@gmail.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353901211!21589094!1
X-Originating-IP: [209.85.216.173]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_10_20,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30489 invoked from network); 26 Nov 2012 03:40:12 -0000
Received: from mail-qc0-f173.google.com (HELO mail-qc0-f173.google.com)
	(209.85.216.173)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 03:40:12 -0000
Received: by mail-qc0-f173.google.com with SMTP id b12so8966099qca.32
	for <xen-devel@lists.xen.org>; Sun, 25 Nov 2012 19:40:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=nSkLbxfN1hUbFAn9Ma6dv4wrTv4w02KgFPKVwIVTny0=;
	b=SWjgu06rTxZhSdB01EaoZ6VYb25MW2loWdrwP81EfMygE8Jabyu1MTnrLnDEKN61G+
	VdYbhxTrYmK73H33Wyyk5PWMWvfhFBPBCP9OmSwltArJBhcXBVlKBkFDaddFqUs+mm/o
	b+pD8GXOw22UIcP+JezscBAvPhy0vxyOXnoWr6Sfthfc0ZDzZIs6j0P4Ycfy6isEi3be
	OiStauYnqwbZtrh4rDnNqRiJKZYrrYS3InpS65zCUj596rvuFtDIMZ0FvjHnuXPvOTlG
	1GQ6eGbAgM/+9/xav1MGhDu608Qwe4hZCMk8cgdOqGiw75Y1k4FKv1ypb4Ul2Rmnp1F4
	M61w==
MIME-Version: 1.0
Received: by 10.224.116.12 with SMTP id k12mr11050529qaq.47.1353901210757;
	Sun, 25 Nov 2012 19:40:10 -0800 (PST)
Received: by 10.49.1.116 with HTTP; Sun, 25 Nov 2012 19:40:10 -0800 (PST)
Date: Sun, 25 Nov 2012 22:40:10 -0500
Message-ID: <CAGjowiTaWSbyWH-NEXz2FEdeXdxHMVbOf9Kj7t25tNj0fvUZ-w@mail.gmail.com>
From: David Xu <davidxu06@gmail.com>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] kernel panic on Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8252185711209429015=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============8252185711209429015==
Content-Type: multipart/alternative; boundary=20cf3074d7e0ba69ad04cf5db02d

--20cf3074d7e0ba69ad04cf5db02d
Content-Type: text/plain; charset=ISO-8859-1

Hi all,

When I run the iperf benchmark to measure the TCP throughput between a
physical machine and a VM, the TCP server which is a Xen VM crashed. Do you
know what's the problem of this bug? Thanks.

[  100.973027] BUG: unable to handle kernel NULL pointer dereference at
0000000000000008
[  100.973040] IP: [<ffffffff81455f16>] xennet_alloc_rx_buffers+0x166/0x350
[  100.973050] PGD 1cc98067 PUD 1d74c067 PMD 0
[  100.973051] Oops: 0002 [#1] SMP
[  100.973051] CPU 1
[  100.973051] Modules linked in:
[  100.973051]
[  100.973051] Pid: 9, comm: ksoftirqd/1 Not tainted 3.2.23 #131
[  100.973051] RIP: e030:[<ffffffff81455f16>]  [<ffffffff81455f16>]
xennet_alloc_rx_buffers+0x166/0x350
[  100.973051] RSP: e02b:ffff88001e8f1c10  EFLAGS: 00010206
[  100.973051] RAX: 0000000000000000 RBX: ffff88001da98000 RCX:
00000000000012b0
[  100.973051] RDX: 0000000000000000 RSI: 0000000000000000 RDI:
0000000000000256
[  100.973051] RBP: ffff88001e8f1c60 R08: ffffc90000000000 R09:
0000000000017a41
[  100.973051] R10: 0000000000000002 R11: 0000000000017298 R12:
ffff880019a7b700
[  100.973051] R13: 0000000000000256 R14: 0000000000012092 R15:
0000000000000092
[  100.973051] FS:  00007f7ace91f700(0000) GS:ffff88001fd00000(0000)
knlGS:0000000000000000
[  100.973051] CS:  e033 DS: 0000 ES: 0000 CR0: 000000008005003b
[  100.973051] CR2: 0000000000000008 CR3: 000000001da64000 CR4:
0000000000002660
[  100.973051] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
[  100.973051] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
0000000000000400
[  100.973051] Process ksoftirqd/1 (pid: 9, threadinfo ffff88001e8f0000,
task ffff88001e8d7000)
[  100.973051] Stack:
[  100.973051]  0000000000000091 ffff88001da99c80 ffff88001da99400
0000000100012091
[  100.973051]  ffff88001e8f1c60 000000000000002d ffff880019a8ac4e
ffff88001fd1a590
[  100.973051]  0000160000000000 ffff880000000000 ffff88001e8f1db0
ffffffff8145699a
[  100.973051] Call Trace:
[  100.973051]  [<ffffffff8145699a>] xennet_poll+0x7ca/0xe80
[  100.973051]  [<ffffffff814e3e51>] net_rx_action+0x151/0x2b0
[  100.973051]  [<ffffffff8106090d>] __do_softirq+0xbd/0x250
[  100.973051]  [<ffffffff81060b67>] run_ksoftirqd+0xc7/0x170
[  100.973051]  [<ffffffff81060aa0>] ? __do_softirq+0x250/0x250
[  100.973051]  [<ffffffff8107b0ac>] kthread+0x8c/0xa0
[  100.973051]  [<ffffffff8167ca04>] kernel_thread_helper+0x4/0x10
[  100.973051]  [<ffffffff81672d21>] ? retint_restore_args+0x13/0x13
[  100.973051]  [<ffffffff8167ca00>] ? gs_change+0x13/0x13
[  100.973051] Code: 0f 84 19 01 00 00 83 ab 10 14 00 00 01 45 0f b6 fe 49
8b 14 24 49 8b 44 24 08 49 c7 04 24 00 00 00 00 49 c7 44 24 08 00 00 00 00
<48> 89 42 08 48 89 10 41 0f b6 d7 49 89 5c 24 20 48 8d 82 b8 01
[  100.973051] RIP  [<ffffffff81455f16>] xennet_alloc_rx_buffers+0x166/0x350
[  100.973051]  RSP <ffff88001e8f1c10>
[  100.973051] CR2: 0000000000000008
[  100.973259] ---[ end trace b0530821c3527d70 ]---
[  100.973263] Kernel panic - not syncing: Fatal exception in interrupt
[  100.973267] Pid: 9, comm: ksoftirqd/1 Tainted: G      D      3.2.23 #131
[  100.973270] Call Trace:
[  100.973273]  [<ffffffff816674ae>] panic+0x91/0x1a2
[  100.973278]  [<ffffffff8100adb2>] ? check_events+0x12/0x20
[  100.973282]  [<ffffffff81673b0a>] oops_end+0xea/0xf0
[  100.973286]  [<ffffffff81666e6b>] no_context+0x214/0x223
[  100.973291]  [<ffffffff8113cf94>] ? kmem_cache_free+0x104/0x110
[  100.973295]  [<ffffffff8166704b>] __bad_area_nosemaphore+0x1d1/0x1f0
[  100.973299]  [<ffffffff8166707d>] bad_area_nosemaphore+0x13/0x15
[  100.973304]  [<ffffffff816763fb>] do_page_fault+0x35b/0x4f0
[  100.973308]  [<ffffffff814d6044>] ? __netdev_alloc_skb+0x24/0x50
[  100.973313]  [<ffffffff8129f75a>] ? trace_hardirqs_off_thunk+0x3a/0x6c
[  100.973318]  [<ffffffff81672fa5>] page_fault+0x25/0x30
[  100.973322]  [<ffffffff81455f16>] ? xennet_alloc_rx_buffers+0x166/0x350
[  100.973326]  [<ffffffff8145699a>] xennet_poll+0x7ca/0xe80
[  100.973330]  [<ffffffff814e3e51>] net_rx_action+0x151/0x2b0
[  100.973334]  [<ffffffff8106090d>] __do_softirq+0xbd/0x250
[  100.973338]  [<ffffffff81060b67>] run_ksoftirqd+0xc7/0x170
[  100.973342]  [<ffffffff81060aa0>] ? __do_softirq+0x250/0x250
[  100.973346]  [<ffffffff8107b0ac>] kthread+0x8c/0xa0
[  100.973350]  [<ffffffff8167ca04>] kernel_thread_helper+0x4/0x10
[  100.973354]  [<ffffffff81672d21>] ? retint_restore_args+0x13/0x13
[  100.973358]  [<ffffffff8167ca00>] ? gs_change+0x13/0x13

Regards,
Cong

--20cf3074d7e0ba69ad04cf5db02d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi all,<div><br></div><div>When I run the iperf benchmark to measure the TC=
P throughput between a physical machine and a VM, the TCP server which is a=
 Xen VM crashed. Do you know what&#39;s the problem of this bug? Thanks.</d=
iv>
<div><br></div><div><div>[ =A0100.973027] BUG: unable to handle kernel NULL=
 pointer dereference at 0000000000000008</div><div>[ =A0100.973040] IP: [&l=
t;ffffffff81455f16&gt;] xennet_alloc_rx_buffers+0x166/0x350</div><div>[ =A0=
100.973050] PGD 1cc98067 PUD 1d74c067 PMD 0=A0</div>
<div>[ =A0100.973051] Oops: 0002 [#1] SMP=A0</div><div>[ =A0100.973051] CPU=
 1=A0</div><div>[ =A0100.973051] Modules linked in:</div><div>[ =A0100.9730=
51]=A0</div><div>[ =A0100.973051] Pid: 9, comm: ksoftirqd/1 Not tainted 3.2=
.23 #131 =A0</div>
<div>[ =A0100.973051] RIP: e030:[&lt;ffffffff81455f16&gt;] =A0[&lt;ffffffff=
81455f16&gt;] xennet_alloc_rx_buffers+0x166/0x350</div><div>[ =A0100.973051=
] RSP: e02b:ffff88001e8f1c10 =A0EFLAGS: 00010206</div><div>[ =A0100.973051]=
 RAX: 0000000000000000 RBX: ffff88001da98000 RCX: 00000000000012b0</div>
<div>[ =A0100.973051] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000=
000000000256</div><div>[ =A0100.973051] RBP: ffff88001e8f1c60 R08: ffffc900=
00000000 R09: 0000000000017a41</div><div>[ =A0100.973051] R10: 000000000000=
0002 R11: 0000000000017298 R12: ffff880019a7b700</div>
<div>[ =A0100.973051] R13: 0000000000000256 R14: 0000000000012092 R15: 0000=
000000000092</div><div>[ =A0100.973051] FS: =A000007f7ace91f700(0000) GS:ff=
ff88001fd00000(0000) knlGS:0000000000000000</div><div>[ =A0100.973051] CS: =
=A0e033 DS: 0000 ES: 0000 CR0: 000000008005003b</div>
<div>[ =A0100.973051] CR2: 0000000000000008 CR3: 000000001da64000 CR4: 0000=
000000002660</div><div>[ =A0100.973051] DR0: 0000000000000000 DR1: 00000000=
00000000 DR2: 0000000000000000</div><div>[ =A0100.973051] DR3: 000000000000=
0000 DR6: 00000000ffff0ff0 DR7: 0000000000000400</div>
<div>[ =A0100.973051] Process ksoftirqd/1 (pid: 9, threadinfo ffff88001e8f0=
000, task ffff88001e8d7000)</div><div>[ =A0100.973051] Stack:</div><div>[ =
=A0100.973051] =A00000000000000091 ffff88001da99c80 ffff88001da99400 000000=
0100012091</div>
<div>[ =A0100.973051] =A0ffff88001e8f1c60 000000000000002d ffff880019a8ac4e=
 ffff88001fd1a590</div><div>[ =A0100.973051] =A00000160000000000 ffff880000=
000000 ffff88001e8f1db0 ffffffff8145699a</div><div>[ =A0100.973051] Call Tr=
ace:</div>
<div>[ =A0100.973051] =A0[&lt;ffffffff8145699a&gt;] xennet_poll+0x7ca/0xe80=
</div><div>[ =A0100.973051] =A0[&lt;ffffffff814e3e51&gt;] net_rx_action+0x1=
51/0x2b0</div><div>[ =A0100.973051] =A0[&lt;ffffffff8106090d&gt;] __do_soft=
irq+0xbd/0x250</div>
<div>[ =A0100.973051] =A0[&lt;ffffffff81060b67&gt;] run_ksoftirqd+0xc7/0x17=
0</div><div>[ =A0100.973051] =A0[&lt;ffffffff81060aa0&gt;] ? __do_softirq+0=
x250/0x250</div><div>[ =A0100.973051] =A0[&lt;ffffffff8107b0ac&gt;] kthread=
+0x8c/0xa0</div>
<div>[ =A0100.973051] =A0[&lt;ffffffff8167ca04&gt;] kernel_thread_helper+0x=
4/0x10</div><div>[ =A0100.973051] =A0[&lt;ffffffff81672d21&gt;] ? retint_re=
store_args+0x13/0x13</div><div>[ =A0100.973051] =A0[&lt;ffffffff8167ca00&gt=
;] ? gs_change+0x13/0x13</div>
<div>[ =A0100.973051] Code: 0f 84 19 01 00 00 83 ab 10 14 00 00 01 45 0f b6=
 fe 49 8b 14 24 49 8b 44 24 08 49 c7 04 24 00 00 00 00 49 c7 44 24 08 00 00=
 00 00 &lt;48&gt; 89 42 08 48 89 10 41 0f b6 d7 49 89 5c 24 20 48 8d 82 b8 =
01=A0</div>
<div>[ =A0100.973051] RIP =A0[&lt;ffffffff81455f16&gt;] xennet_alloc_rx_buf=
fers+0x166/0x350</div><div>[ =A0100.973051] =A0RSP &lt;ffff88001e8f1c10&gt;=
</div><div>[ =A0100.973051] CR2: 0000000000000008</div><div>[ =A0100.973259=
] ---[ end trace b0530821c3527d70 ]---</div>
<div>[ =A0100.973263] Kernel panic - not syncing: Fatal exception in interr=
upt</div><div>[ =A0100.973267] Pid: 9, comm: ksoftirqd/1 Tainted: G =A0 =A0=
 =A0D =A0 =A0 =A03.2.23 #131</div><div>[ =A0100.973270] Call Trace:</div><d=
iv>[ =A0100.973273] =A0[&lt;ffffffff816674ae&gt;] panic+0x91/0x1a2</div>
<div>[ =A0100.973278] =A0[&lt;ffffffff8100adb2&gt;] ? check_events+0x12/0x2=
0</div><div>[ =A0100.973282] =A0[&lt;ffffffff81673b0a&gt;] oops_end+0xea/0x=
f0</div><div>[ =A0100.973286] =A0[&lt;ffffffff81666e6b&gt;] no_context+0x21=
4/0x223</div>
<div>[ =A0100.973291] =A0[&lt;ffffffff8113cf94&gt;] ? kmem_cache_free+0x104=
/0x110</div><div>[ =A0100.973295] =A0[&lt;ffffffff8166704b&gt;] __bad_area_=
nosemaphore+0x1d1/0x1f0</div><div>[ =A0100.973299] =A0[&lt;ffffffff8166707d=
&gt;] bad_area_nosemaphore+0x13/0x15</div>
<div>[ =A0100.973304] =A0[&lt;ffffffff816763fb&gt;] do_page_fault+0x35b/0x4=
f0</div><div>[ =A0100.973308] =A0[&lt;ffffffff814d6044&gt;] ? __netdev_allo=
c_skb+0x24/0x50</div><div>[ =A0100.973313] =A0[&lt;ffffffff8129f75a&gt;] ? =
trace_hardirqs_off_thunk+0x3a/0x6c</div>
<div>[ =A0100.973318] =A0[&lt;ffffffff81672fa5&gt;] page_fault+0x25/0x30</d=
iv><div>[ =A0100.973322] =A0[&lt;ffffffff81455f16&gt;] ? xennet_alloc_rx_bu=
ffers+0x166/0x350</div><div>[ =A0100.973326] =A0[&lt;ffffffff8145699a&gt;] =
xennet_poll+0x7ca/0xe80</div>
<div>[ =A0100.973330] =A0[&lt;ffffffff814e3e51&gt;] net_rx_action+0x151/0x2=
b0</div><div>[ =A0100.973334] =A0[&lt;ffffffff8106090d&gt;] __do_softirq+0x=
bd/0x250</div><div>[ =A0100.973338] =A0[&lt;ffffffff81060b67&gt;] run_ksoft=
irqd+0xc7/0x170</div>
<div>[ =A0100.973342] =A0[&lt;ffffffff81060aa0&gt;] ? __do_softirq+0x250/0x=
250</div><div>[ =A0100.973346] =A0[&lt;ffffffff8107b0ac&gt;] kthread+0x8c/0=
xa0</div><div>[ =A0100.973350] =A0[&lt;ffffffff8167ca04&gt;] kernel_thread_=
helper+0x4/0x10</div>
<div>[ =A0100.973354] =A0[&lt;ffffffff81672d21&gt;] ? retint_restore_args+0=
x13/0x13</div><div>[ =A0100.973358] =A0[&lt;ffffffff8167ca00&gt;] ? gs_chan=
ge+0x13/0x13</div></div><div><br></div><div>Regards,</div><div>Cong</div>

--20cf3074d7e0ba69ad04cf5db02d--


--===============8252185711209429015==
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.xen.org
http://lists.xen.org/xen-devel

--===============8252185711209429015==--


From xen-devel-bounces@lists.xen.org Mon Nov 26 07:21:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 07:21:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tct04-0000Ca-OZ; Mon, 26 Nov 2012 07:21:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <paolo.bonzini@gmail.com>) id 1Tct03-0000CV-2T
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 07:21:03 +0000
Received: from [85.158.139.211:26445] by server-13.bemta-5.messagelabs.com id
	18/D1-27809-E5813B05; Mon, 26 Nov 2012 07:21:02 +0000
X-Env-Sender: paolo.bonzini@gmail.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353914460!21604272!1
X-Originating-IP: [209.85.215.171]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13848 invoked from network); 26 Nov 2012 07:21:01 -0000
Received: from mail-ea0-f171.google.com (HELO mail-ea0-f171.google.com)
	(209.85.215.171)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 07:21:01 -0000
Received: by mail-ea0-f171.google.com with SMTP id n10so3595956eaa.30
	for <xen-devel@lists.xensource.com>;
	Sun, 25 Nov 2012 23:21:00 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	bh=TpcwWlsggDBI/c6AdK6wOv6ASd8ez1HMMY+cS+/J+gk=;
	b=yv6FI3tVbsbtHr7IKDEVoTxYmTvhOqFwBTK8twH78SOanH2Oju6nYeRFwyrg+gF7Bi
	+HouYf16CcgW++Sh6VNl0DI/7yVwD7UpXrS8XAdlk/rikc8TSGJttr036rTu6C9CZCI2
	TzGyOmcmb/oPxlRu9YlvM1YO9moOawd0t3apiwAi5S+ZvSxxoIn+oM8oJ43bqU1mD2a0
	KrFqCdtsDzUgy32MmwCMYXUDOtWwRkxSl3oeQpgXuaRRdyBILzcNY1Q/3Iyjfi2rH5gR
	+mdSbUbJLrir5Eec5iMt4gE6FajiGQv7mfCa0s9E4706aFRS3YQogHX6p3/ryUqq5xrP
	TWmA==
Received: by 10.14.223.200 with SMTP id v48mr42476373eep.24.1353914460505;
	Sun, 25 Nov 2012 23:21:00 -0800 (PST)
Received: from yakj.usersys.redhat.com (93-34-169-1.ip50.fastwebnet.it.
	[93.34.169.1])
	by mx.google.com with ESMTPS id g47sm32441767eeo.6.2012.11.25.23.20.58
	(version=TLSv1/SSLv3 cipher=OTHER);
	Sun, 25 Nov 2012 23:20:59 -0800 (PST)
Message-ID: <50B3185A.3080005@redhat.com>
Date: Mon, 26 Nov 2012 08:20:58 +0100
From: Paolo Bonzini <pbonzini@redhat.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121016 Thunderbird/16.0.1
MIME-Version: 1.0
To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= <afaerber@suse.de>
References: <1353888766-6951-1-git-send-email-afaerber@suse.de>
	<1353888766-6951-2-git-send-email-afaerber@suse.de>
In-Reply-To: <1353888766-6951-2-git-send-email-afaerber@suse.de>
Cc: X86 <xen-devel@lists.xensource.com>, "Michael S. Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org, anthony@codemonkey.ws,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 01/34] qdev: Eliminate qdev_free() in favor
	of QOM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

SWwgMjYvMTEvMjAxMiAwMToxMiwgQW5kcmVhcyBGw6RyYmVyIGhhIHNjcml0dG86Cj4gcWRldl9m
cmVlKCkgd2FzIHRyaXZpYWxseSB3cmFwcGluZyBvYmplY3RfZGVsZXRlKCkuIElubGluZSBpdCBh
bmQgZHJvcAo+IHRoZSB3cmFwcGVyIGFzIGEgZnVydGhlciBzdGVwIHRvIFFPTSdpZnkgcWRldi4K
ClRoZSByZWZlcmVuY2UgY291bnRzIG9mIGRldmljZXMgYW5kIGJ1c2VzIGFyZSBjb21wbGV0ZWx5
IGRpc2Nvbm5lY3RlZApmcm9tIHJlYWxpdHksIGFuZCB0aGF0J3Mgd2h5IG9iamVjdF9kZWxldGUo
KSB3b3Jrcy4KCkknZCBwcmVmZXIgdGhpcyBwYXRjaCBub3QgdG8gYmUgYXBwbGllZCB1bnRpbCB0
aGlzIGlzIHN0cmFpZ2h0ZW5lZCBvd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RlbGV0ZShPQkpFQ1Qo
ZCkpOwo+ICAgICAgfQo+ICB9Cj4gIAo+IAoKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxpc3Rz
Lnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Mon Nov 26 07:21:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 07:21:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tct04-0000Ca-OZ; Mon, 26 Nov 2012 07:21:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <paolo.bonzini@gmail.com>) id 1Tct03-0000CV-2T
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 07:21:03 +0000
Received: from [85.158.139.211:26445] by server-13.bemta-5.messagelabs.com id
	18/D1-27809-E5813B05; Mon, 26 Nov 2012 07:21:02 +0000
X-Env-Sender: paolo.bonzini@gmail.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353914460!21604272!1
X-Originating-IP: [209.85.215.171]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13848 invoked from network); 26 Nov 2012 07:21:01 -0000
Received: from mail-ea0-f171.google.com (HELO mail-ea0-f171.google.com)
	(209.85.215.171)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 07:21:01 -0000
Received: by mail-ea0-f171.google.com with SMTP id n10so3595956eaa.30
	for <xen-devel@lists.xensource.com>;
	Sun, 25 Nov 2012 23:21:00 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	bh=TpcwWlsggDBI/c6AdK6wOv6ASd8ez1HMMY+cS+/J+gk=;
	b=yv6FI3tVbsbtHr7IKDEVoTxYmTvhOqFwBTK8twH78SOanH2Oju6nYeRFwyrg+gF7Bi
	+HouYf16CcgW++Sh6VNl0DI/7yVwD7UpXrS8XAdlk/rikc8TSGJttr036rTu6C9CZCI2
	TzGyOmcmb/oPxlRu9YlvM1YO9moOawd0t3apiwAi5S+ZvSxxoIn+oM8oJ43bqU1mD2a0
	KrFqCdtsDzUgy32MmwCMYXUDOtWwRkxSl3oeQpgXuaRRdyBILzcNY1Q/3Iyjfi2rH5gR
	+mdSbUbJLrir5Eec5iMt4gE6FajiGQv7mfCa0s9E4706aFRS3YQogHX6p3/ryUqq5xrP
	TWmA==
Received: by 10.14.223.200 with SMTP id v48mr42476373eep.24.1353914460505;
	Sun, 25 Nov 2012 23:21:00 -0800 (PST)
Received: from yakj.usersys.redhat.com (93-34-169-1.ip50.fastwebnet.it.
	[93.34.169.1])
	by mx.google.com with ESMTPS id g47sm32441767eeo.6.2012.11.25.23.20.58
	(version=TLSv1/SSLv3 cipher=OTHER);
	Sun, 25 Nov 2012 23:20:59 -0800 (PST)
Message-ID: <50B3185A.3080005@redhat.com>
Date: Mon, 26 Nov 2012 08:20:58 +0100
From: Paolo Bonzini <pbonzini@redhat.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121016 Thunderbird/16.0.1
MIME-Version: 1.0
To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= <afaerber@suse.de>
References: <1353888766-6951-1-git-send-email-afaerber@suse.de>
	<1353888766-6951-2-git-send-email-afaerber@suse.de>
In-Reply-To: <1353888766-6951-2-git-send-email-afaerber@suse.de>
Cc: X86 <xen-devel@lists.xensource.com>, "Michael S. Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org, anthony@codemonkey.ws,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 01/34] qdev: Eliminate qdev_free() in favor
	of QOM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

SWwgMjYvMTEvMjAxMiAwMToxMiwgQW5kcmVhcyBGw6RyYmVyIGhhIHNjcml0dG86Cj4gcWRldl9m
cmVlKCkgd2FzIHRyaXZpYWxseSB3cmFwcGluZyBvYmplY3RfZGVsZXRlKCkuIElubGluZSBpdCBh
bmQgZHJvcAo+IHRoZSB3cmFwcGVyIGFzIGEgZnVydGhlciBzdGVwIHRvIFFPTSdpZnkgcWRldi4K
ClRoZSByZWZlcmVuY2UgY291bnRzIG9mIGRldmljZXMgYW5kIGJ1c2VzIGFyZSBjb21wbGV0ZWx5
IGRpc2Nvbm5lY3RlZApmcm9tIHJlYWxpdHksIGFuZCB0aGF0J3Mgd2h5IG9iamVjdF9kZWxldGUo
KSB3b3Jrcy4KCkknZCBwcmVmZXIgdGhpcyBwYXRjaCBub3QgdG8gYmUgYXBwbGllZCB1bnRpbCB0
aGlzIGlzIHN0cmFpZ2h0ZW5lZCBvdXQuLi4KClBhb2xvCgo+I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o
ZCkpOwo+ICAgICAgfQo+ICB9Cj4gIAo+IAoKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxpc3Rz
Lnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Mon Nov 26 07:44:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 07:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TctM9-0000NY-RD; Mon, 26 Nov 2012 07:43:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TctM8-0000NT-SR
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 07:43:53 +0000
Received: from [85.158.143.35:35377] by server-3.bemta-4.messagelabs.com id
	D7/23-06841-8BD13B05; Mon, 26 Nov 2012 07:43:52 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1353915831!14274082!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12183 invoked from network); 26 Nov 2012 07:43:51 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 07:43:51 -0000
X-IronPort-AV: E=Sophos;i="4.83,318,1352073600"; d="scan'208";a="15991779"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 07:43:51 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 26 Nov 2012 07:43:51 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TctM6-0004Eb-NT;
	Mon, 26 Nov 2012 07:43:50 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TctM6-0006uT-FZ;
	Mon, 26 Nov 2012 07:43:50 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14475-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 26 Nov 2012 07:43:50 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14475: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14475 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14475/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 12 guest-localmigrate/x10 fail pass in 14474

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14474
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14474

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop fail in 14474 never pass

version targeted for testing:
 xen                  0049de3827bc
baseline version:
 xen                  0049de3827bc

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 07:44:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 07:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TctM9-0000NY-RD; Mon, 26 Nov 2012 07:43:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TctM8-0000NT-SR
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 07:43:53 +0000
Received: from [85.158.143.35:35377] by server-3.bemta-4.messagelabs.com id
	D7/23-06841-8BD13B05; Mon, 26 Nov 2012 07:43:52 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1353915831!14274082!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12183 invoked from network); 26 Nov 2012 07:43:51 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 07:43:51 -0000
X-IronPort-AV: E=Sophos;i="4.83,318,1352073600"; d="scan'208";a="15991779"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 07:43:51 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 26 Nov 2012 07:43:51 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TctM6-0004Eb-NT;
	Mon, 26 Nov 2012 07:43:50 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TctM6-0006uT-FZ;
	Mon, 26 Nov 2012 07:43:50 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14475-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 26 Nov 2012 07:43:50 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14475: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14475 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14475/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 12 guest-localmigrate/x10 fail pass in 14474

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14474
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14474

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop fail in 14474 never pass

version targeted for testing:
 xen                  0049de3827bc
baseline version:
 xen                  0049de3827bc

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 10:20:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 10:20:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tcvn9-0001Q1-KO; Mon, 26 Nov 2012 10:19:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tcvn8-0001Pw-QN
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 10:19:54 +0000
Received: from [85.158.138.51:9173] by server-10.bemta-3.messagelabs.com id
	2C/25-19806-94243B05; Mon, 26 Nov 2012 10:19:53 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1353925177!31463995!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16038 invoked from network); 26 Nov 2012 10:19:38 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-174.messagelabs.com with SMTP;
	26 Nov 2012 10:19:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 10:19:38 +0000
Message-Id: <50B3507E02000078000AB0D9@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 10:20:30 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mauro" <mrsanna1@gmail.com>
References: <CAE17a0XdxhaoCZaDDT6RXm1DPnabf2hWXAnzU5NukHeXX45grA@mail.gmail.com>
	<CCCD845A.44DB0%keir.xen@gmail.com>
	<CAE17a0Xit58cLiJ+pE7uKuCDq3Xn+7-5+iDpV2+5S+TX3yuT+Q@mail.gmail.com>
In-Reply-To: <CAE17a0Xit58cLiJ+pE7uKuCDq3Xn+7-5+iDpV2+5S+TX3yuT+Q@mail.gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Philippe.Simonet@swisscom.com, Keir Fraser <keir.xen@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>, ijc@hellion.org.uk
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 24.11.12 at 13:06, Mauro <mrsanna1@gmail.com> wrote:
> (XEN) XXX plt_overflow: plt_now=569ed0c10fa3 plt_wrap=569ed0bd2ac3
> now=569ed0bf15a4 old_stamp=36f62 new_stamp=800377ce
> plt_stamp64=13d800377ce plt_mask=ffffffff tsc=cfdf69d72c82
> tsc_stamp=cfdf69ccc91d
> (XEN) XXX pts=13d80036988/13d80036988 sps=569ed0bd2ac3/569ed0bd2ac3
> (XEN) XXX ps=7:8baebcb8/7:8baebcb8

I.e. plt_wrap == stime_platform_stamp, which would imply
plt_stamp64 + plt_mask + 1 == platform_timer_stamp, which
visibly isn't the case.

Having to consider mis-compilation of some sort at this point,
can you please attach the xen-syms matching the xen.gz from
the run above?

The only other alternative would appear to be register or stack
corruption (which of the two might also be visible from the
xen-syms, so it would be needed for that determination too). As
the code in question runs with interrupts disabled, the only
sources for that would be NMI, MCE, or SMI. Adding logging of
instances of the former two would be possible, but otoh the
entry/exit code of them is uniform with other exceptions and
hence can pretty much be excluded to corrupt anything.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 10:20:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 10:20:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tcvn9-0001Q1-KO; Mon, 26 Nov 2012 10:19:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tcvn8-0001Pw-QN
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 10:19:54 +0000
Received: from [85.158.138.51:9173] by server-10.bemta-3.messagelabs.com id
	2C/25-19806-94243B05; Mon, 26 Nov 2012 10:19:53 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1353925177!31463995!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16038 invoked from network); 26 Nov 2012 10:19:38 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-174.messagelabs.com with SMTP;
	26 Nov 2012 10:19:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 10:19:38 +0000
Message-Id: <50B3507E02000078000AB0D9@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 10:20:30 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mauro" <mrsanna1@gmail.com>
References: <CAE17a0XdxhaoCZaDDT6RXm1DPnabf2hWXAnzU5NukHeXX45grA@mail.gmail.com>
	<CCCD845A.44DB0%keir.xen@gmail.com>
	<CAE17a0Xit58cLiJ+pE7uKuCDq3Xn+7-5+iDpV2+5S+TX3yuT+Q@mail.gmail.com>
In-Reply-To: <CAE17a0Xit58cLiJ+pE7uKuCDq3Xn+7-5+iDpV2+5S+TX3yuT+Q@mail.gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Philippe.Simonet@swisscom.com, Keir Fraser <keir.xen@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>, ijc@hellion.org.uk
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 24.11.12 at 13:06, Mauro <mrsanna1@gmail.com> wrote:
> (XEN) XXX plt_overflow: plt_now=569ed0c10fa3 plt_wrap=569ed0bd2ac3
> now=569ed0bf15a4 old_stamp=36f62 new_stamp=800377ce
> plt_stamp64=13d800377ce plt_mask=ffffffff tsc=cfdf69d72c82
> tsc_stamp=cfdf69ccc91d
> (XEN) XXX pts=13d80036988/13d80036988 sps=569ed0bd2ac3/569ed0bd2ac3
> (XEN) XXX ps=7:8baebcb8/7:8baebcb8

I.e. plt_wrap == stime_platform_stamp, which would imply
plt_stamp64 + plt_mask + 1 == platform_timer_stamp, which
visibly isn't the case.

Having to consider mis-compilation of some sort at this point,
can you please attach the xen-syms matching the xen.gz from
the run above?

The only other alternative would appear to be register or stack
corruption (which of the two might also be visible from the
xen-syms, so it would be needed for that determination too). As
the code in question runs with interrupts disabled, the only
sources for that would be NMI, MCE, or SMI. Adding logging of
instances of the former two would be possible, but otoh the
entry/exit code of them is uniform with other exceptions and
hence can pretty much be excluded to corrupt anything.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 10:28:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 10:28:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tcvv8-0001Z1-Lg; Mon, 26 Nov 2012 10:28:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mrsanna1@gmail.com>) id 1Tcvv7-0001Ys-GP
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 10:28:09 +0000
Received: from [85.158.138.51:52329] by server-2.bemta-3.messagelabs.com id
	C3/E7-04744-83443B05; Mon, 26 Nov 2012 10:28:08 +0000
X-Env-Sender: mrsanna1@gmail.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1353925685!31465642!1
X-Originating-IP: [209.85.219.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21880 invoked from network); 26 Nov 2012 10:28:07 -0000
Received: from mail-oa0-f45.google.com (HELO mail-oa0-f45.google.com)
	(209.85.219.45)
	by server-9.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 10:28:07 -0000
Received: by mail-oa0-f45.google.com with SMTP id i18so12733574oag.32
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 02:28:05 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=5dqww4fqD4UVSEtNMK9IX1HAyGDoUi+zJMCx58VACOQ=;
	b=wp+pXx1vWvPVzpVc4YiV/6ZWgJJhoWenDLkaky25gWDcEybfAde7j6HGp493Moc/GC
	OIZ0oS9N1HW84QEWIJbJAAqLmhyEg4VJ4gN3YSKi/n0GQ2MuWQP9DJmHxYtByfjRr2FE
	fhPagzLGQvqd5OMBBDCkG6ugwmlQkTlV9Pnl4uQr6Q0Rep5AYeuvKSwu78rw5hXufbcn
	DTAhs1JaLshXg8GzNnSzHi/h0wdcHtm2+t18tnk9CQ2nbUaZc0gG3MUc5V3kkh0QAuX2
	08ZVdC8YsuWmrp26ZyG5L+z0CZc4FEG4mzkr7jYMUFCrEvNa3XwSScks6rFI5EsHpN5p
	6SbA==
MIME-Version: 1.0
Received: by 10.60.28.132 with SMTP id b4mr3330429oeh.41.1353925685359; Mon,
	26 Nov 2012 02:28:05 -0800 (PST)
Received: by 10.76.143.40 with HTTP; Mon, 26 Nov 2012 02:28:05 -0800 (PST)
In-Reply-To: <50B3507E02000078000AB0D9@nat28.tlf.novell.com>
References: <CAE17a0XdxhaoCZaDDT6RXm1DPnabf2hWXAnzU5NukHeXX45grA@mail.gmail.com>
	<CCCD845A.44DB0%keir.xen@gmail.com>
	<CAE17a0Xit58cLiJ+pE7uKuCDq3Xn+7-5+iDpV2+5S+TX3yuT+Q@mail.gmail.com>
	<50B3507E02000078000AB0D9@nat28.tlf.novell.com>
Date: Mon, 26 Nov 2012 11:28:05 +0100
Message-ID: <CAE17a0WpzYTgOa9J-DJCKnQ4VgcoeX1GPtnSN2+jUw34DRNxCg@mail.gmail.com>
From: Mauro <mrsanna1@gmail.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Philippe.Simonet@swisscom.com, Keir Fraser <keir.xen@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>, ijc@hellion.org.uk
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 26 November 2012 11:20, Jan Beulich <JBeulich@suse.com> wrote:
>>>> On 24.11.12 at 13:06, Mauro <mrsanna1@gmail.com> wrote:
>> (XEN) XXX plt_overflow: plt_now=569ed0c10fa3 plt_wrap=569ed0bd2ac3
>> now=569ed0bf15a4 old_stamp=36f62 new_stamp=800377ce
>> plt_stamp64=13d800377ce plt_mask=ffffffff tsc=cfdf69d72c82
>> tsc_stamp=cfdf69ccc91d
>> (XEN) XXX pts=13d80036988/13d80036988 sps=569ed0bd2ac3/569ed0bd2ac3
>> (XEN) XXX ps=7:8baebcb8/7:8baebcb8
>
> I.e. plt_wrap == stime_platform_stamp, which would imply
> plt_stamp64 + plt_mask + 1 == platform_timer_stamp, which
> visibly isn't the case.
>
> Having to consider mis-compilation of some sort at this point,
> can you please attach the xen-syms matching the xen.gz from
> the run above?

how can I do?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 10:28:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 10:28:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tcvv8-0001Z1-Lg; Mon, 26 Nov 2012 10:28:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mrsanna1@gmail.com>) id 1Tcvv7-0001Ys-GP
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 10:28:09 +0000
Received: from [85.158.138.51:52329] by server-2.bemta-3.messagelabs.com id
	C3/E7-04744-83443B05; Mon, 26 Nov 2012 10:28:08 +0000
X-Env-Sender: mrsanna1@gmail.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1353925685!31465642!1
X-Originating-IP: [209.85.219.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21880 invoked from network); 26 Nov 2012 10:28:07 -0000
Received: from mail-oa0-f45.google.com (HELO mail-oa0-f45.google.com)
	(209.85.219.45)
	by server-9.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 10:28:07 -0000
Received: by mail-oa0-f45.google.com with SMTP id i18so12733574oag.32
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 02:28:05 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=5dqww4fqD4UVSEtNMK9IX1HAyGDoUi+zJMCx58VACOQ=;
	b=wp+pXx1vWvPVzpVc4YiV/6ZWgJJhoWenDLkaky25gWDcEybfAde7j6HGp493Moc/GC
	OIZ0oS9N1HW84QEWIJbJAAqLmhyEg4VJ4gN3YSKi/n0GQ2MuWQP9DJmHxYtByfjRr2FE
	fhPagzLGQvqd5OMBBDCkG6ugwmlQkTlV9Pnl4uQr6Q0Rep5AYeuvKSwu78rw5hXufbcn
	DTAhs1JaLshXg8GzNnSzHi/h0wdcHtm2+t18tnk9CQ2nbUaZc0gG3MUc5V3kkh0QAuX2
	08ZVdC8YsuWmrp26ZyG5L+z0CZc4FEG4mzkr7jYMUFCrEvNa3XwSScks6rFI5EsHpN5p
	6SbA==
MIME-Version: 1.0
Received: by 10.60.28.132 with SMTP id b4mr3330429oeh.41.1353925685359; Mon,
	26 Nov 2012 02:28:05 -0800 (PST)
Received: by 10.76.143.40 with HTTP; Mon, 26 Nov 2012 02:28:05 -0800 (PST)
In-Reply-To: <50B3507E02000078000AB0D9@nat28.tlf.novell.com>
References: <CAE17a0XdxhaoCZaDDT6RXm1DPnabf2hWXAnzU5NukHeXX45grA@mail.gmail.com>
	<CCCD845A.44DB0%keir.xen@gmail.com>
	<CAE17a0Xit58cLiJ+pE7uKuCDq3Xn+7-5+iDpV2+5S+TX3yuT+Q@mail.gmail.com>
	<50B3507E02000078000AB0D9@nat28.tlf.novell.com>
Date: Mon, 26 Nov 2012 11:28:05 +0100
Message-ID: <CAE17a0WpzYTgOa9J-DJCKnQ4VgcoeX1GPtnSN2+jUw34DRNxCg@mail.gmail.com>
From: Mauro <mrsanna1@gmail.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Philippe.Simonet@swisscom.com, Keir Fraser <keir.xen@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>, ijc@hellion.org.uk
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 26 November 2012 11:20, Jan Beulich <JBeulich@suse.com> wrote:
>>>> On 24.11.12 at 13:06, Mauro <mrsanna1@gmail.com> wrote:
>> (XEN) XXX plt_overflow: plt_now=569ed0c10fa3 plt_wrap=569ed0bd2ac3
>> now=569ed0bf15a4 old_stamp=36f62 new_stamp=800377ce
>> plt_stamp64=13d800377ce plt_mask=ffffffff tsc=cfdf69d72c82
>> tsc_stamp=cfdf69ccc91d
>> (XEN) XXX pts=13d80036988/13d80036988 sps=569ed0bd2ac3/569ed0bd2ac3
>> (XEN) XXX ps=7:8baebcb8/7:8baebcb8
>
> I.e. plt_wrap == stime_platform_stamp, which would imply
> plt_stamp64 + plt_mask + 1 == platform_timer_stamp, which
> visibly isn't the case.
>
> Having to consider mis-compilation of some sort at this point,
> can you please attach the xen-syms matching the xen.gz from
> the run above?

how can I do?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 10:41:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 10:41:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tcw7F-0001jL-Tq; Mon, 26 Nov 2012 10:40:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tcw7D-0001jG-Mi
	for Xen-devel@lists.xen.org; Mon, 26 Nov 2012 10:40:39 +0000
Received: from [85.158.143.35:6254] by server-2.bemta-4.messagelabs.com id
	59/EF-28922-62743B05; Mon, 26 Nov 2012 10:40:38 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1353926410!4126912!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12752 invoked from network); 26 Nov 2012 10:40:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 10:40:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,319,1352073600"; d="scan'208";a="15995922"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 10:40:10 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 10:40:10 +0000
Message-ID: <1353926408.5830.4.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Xinxin Jin <x7jin@cs.ucsd.edu>
Date: Mon, 26 Nov 2012 10:40:08 +0000
In-Reply-To: <CAJJWZczguabmzCU5joaHDy261PfeJi3DrE5+nKFvKaKwCZdFOQ@mail.gmail.com>
References: <CAJJWZczguabmzCU5joaHDy261PfeJi3DrE5+nKFvKaKwCZdFOQ@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Xen-devel@lists.xen.org" <Xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Is Xen's kernel stack address fixed?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, 2012-11-24 at 05:42 +0000, Xinxin Jin wrote:
> Hi, if Xen's kernel stack address is fixed? I print the esp value at
> the entry of exception handler and find that esp has fixed value. But
> Xen should support reentrancy, right? Then why it has fixed stack
> address ?

Are you looking at nested exceptions? Because if you only ever look at
the outermost exception (i.e. the trap from guest mode) the stack will
indeed appear to be at the same address.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 10:41:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 10:41:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tcw7F-0001jL-Tq; Mon, 26 Nov 2012 10:40:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tcw7D-0001jG-Mi
	for Xen-devel@lists.xen.org; Mon, 26 Nov 2012 10:40:39 +0000
Received: from [85.158.143.35:6254] by server-2.bemta-4.messagelabs.com id
	59/EF-28922-62743B05; Mon, 26 Nov 2012 10:40:38 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1353926410!4126912!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12752 invoked from network); 26 Nov 2012 10:40:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 10:40:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,319,1352073600"; d="scan'208";a="15995922"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 10:40:10 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 10:40:10 +0000
Message-ID: <1353926408.5830.4.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Xinxin Jin <x7jin@cs.ucsd.edu>
Date: Mon, 26 Nov 2012 10:40:08 +0000
In-Reply-To: <CAJJWZczguabmzCU5joaHDy261PfeJi3DrE5+nKFvKaKwCZdFOQ@mail.gmail.com>
References: <CAJJWZczguabmzCU5joaHDy261PfeJi3DrE5+nKFvKaKwCZdFOQ@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Xen-devel@lists.xen.org" <Xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Is Xen's kernel stack address fixed?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, 2012-11-24 at 05:42 +0000, Xinxin Jin wrote:
> Hi, if Xen's kernel stack address is fixed? I print the esp value at
> the entry of exception handler and find that esp has fixed value. But
> Xen should support reentrancy, right? Then why it has fixed stack
> address ?

Are you looking at nested exceptions? Because if you only ever look at
the outermost exception (i.e. the trap from guest mode) the stack will
indeed appear to be at the same address.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 10:41:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 10:41:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tcw7j-0001lb-FP; Mon, 26 Nov 2012 10:41:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>) id 1Tcw7i-0001lT-J2
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 10:41:10 +0000
Received: from [85.158.139.83:23552] by server-14.bemta-5.messagelabs.com id
	94/83-21768-54743B05; Mon, 26 Nov 2012 10:41:09 +0000
X-Env-Sender: ijc@hellion.org.uk
X-Msg-Ref: server-6.tower-182.messagelabs.com!1353926468!27311772!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28316 invoked from network); 26 Nov 2012 10:41:08 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2012 10:41:08 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1Tcw7e-000869-Iw; Mon, 26 Nov 2012 10:41:06 +0000
Received: from firewall.ctxuk.citrix.com ([46.33.159.2] helo=[10.80.2.42])
	by hopkins.hellion.org.uk with esmtpsa (SSL3.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <ijc@hellion.org.uk>)
	id 1Tcw7c-0005s9-2h; Mon, 26 Nov 2012 10:41:06 +0000
Message-ID: <1353926458.5830.5.camel@zakaz.uk.xensource.com>
From: Ian Campbell <ijc@hellion.org.uk>
To: Mauro <mrsanna1@gmail.com>
Date: Mon, 26 Nov 2012 10:40:58 +0000
In-Reply-To: <CAE17a0WpzYTgOa9J-DJCKnQ4VgcoeX1GPtnSN2+jUw34DRNxCg@mail.gmail.com>
References: <CAE17a0XdxhaoCZaDDT6RXm1DPnabf2hWXAnzU5NukHeXX45grA@mail.gmail.com>
	<CCCD845A.44DB0%keir.xen@gmail.com>
	<CAE17a0Xit58cLiJ+pE7uKuCDq3Xn+7-5+iDpV2+5S+TX3yuT+Q@mail.gmail.com>
	<50B3507E02000078000AB0D9@nat28.tlf.novell.com>
	<CAE17a0WpzYTgOa9J-DJCKnQ4VgcoeX1GPtnSN2+jUw34DRNxCg@mail.gmail.com>
X-Mailer: Evolution 3.4.4-1 
Mime-Version: 1.0
X-SA-Exim-Connect-IP: 46.33.159.2
X-SA-Exim-Mail-From: ijc@hellion.org.uk
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: Philippe.Simonet@swisscom.com, Keir Fraser <keir.xen@gmail.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 11:28 +0100, Mauro wrote:
> On 26 November 2012 11:20, Jan Beulich <JBeulich@suse.com> wrote:
> >>>> On 24.11.12 at 13:06, Mauro <mrsanna1@gmail.com> wrote:
> >> (XEN) XXX plt_overflow: plt_now=569ed0c10fa3 plt_wrap=569ed0bd2ac3
> >> now=569ed0bf15a4 old_stamp=36f62 new_stamp=800377ce
> >> plt_stamp64=13d800377ce plt_mask=ffffffff tsc=cfdf69d72c82
> >> tsc_stamp=cfdf69ccc91d
> >> (XEN) XXX pts=13d80036988/13d80036988 sps=569ed0bd2ac3/569ed0bd2ac3
> >> (XEN) XXX ps=7:8baebcb8/7:8baebcb8
> >
> > I.e. plt_wrap == stime_platform_stamp, which would imply
> > plt_stamp64 + plt_mask + 1 == platform_timer_stamp, which
> > visibly isn't the case.
> >
> > Having to consider mis-compilation of some sort at this point,
> > can you please attach the xen-syms matching the xen.gz from
> > the run above?
> 
> how can I do?

xen/xen-syms should be in the place where you built the hypervisor.

-- 
Ian Campbell

It is not doing the thing we like to do, but liking the thing we have to do,
that makes life blessed.
		-- Goethe


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 10:41:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 10:41:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tcw7j-0001lb-FP; Mon, 26 Nov 2012 10:41:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>) id 1Tcw7i-0001lT-J2
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 10:41:10 +0000
Received: from [85.158.139.83:23552] by server-14.bemta-5.messagelabs.com id
	94/83-21768-54743B05; Mon, 26 Nov 2012 10:41:09 +0000
X-Env-Sender: ijc@hellion.org.uk
X-Msg-Ref: server-6.tower-182.messagelabs.com!1353926468!27311772!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28316 invoked from network); 26 Nov 2012 10:41:08 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2012 10:41:08 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1Tcw7e-000869-Iw; Mon, 26 Nov 2012 10:41:06 +0000
Received: from firewall.ctxuk.citrix.com ([46.33.159.2] helo=[10.80.2.42])
	by hopkins.hellion.org.uk with esmtpsa (SSL3.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <ijc@hellion.org.uk>)
	id 1Tcw7c-0005s9-2h; Mon, 26 Nov 2012 10:41:06 +0000
Message-ID: <1353926458.5830.5.camel@zakaz.uk.xensource.com>
From: Ian Campbell <ijc@hellion.org.uk>
To: Mauro <mrsanna1@gmail.com>
Date: Mon, 26 Nov 2012 10:40:58 +0000
In-Reply-To: <CAE17a0WpzYTgOa9J-DJCKnQ4VgcoeX1GPtnSN2+jUw34DRNxCg@mail.gmail.com>
References: <CAE17a0XdxhaoCZaDDT6RXm1DPnabf2hWXAnzU5NukHeXX45grA@mail.gmail.com>
	<CCCD845A.44DB0%keir.xen@gmail.com>
	<CAE17a0Xit58cLiJ+pE7uKuCDq3Xn+7-5+iDpV2+5S+TX3yuT+Q@mail.gmail.com>
	<50B3507E02000078000AB0D9@nat28.tlf.novell.com>
	<CAE17a0WpzYTgOa9J-DJCKnQ4VgcoeX1GPtnSN2+jUw34DRNxCg@mail.gmail.com>
X-Mailer: Evolution 3.4.4-1 
Mime-Version: 1.0
X-SA-Exim-Connect-IP: 46.33.159.2
X-SA-Exim-Mail-From: ijc@hellion.org.uk
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: Philippe.Simonet@swisscom.com, Keir Fraser <keir.xen@gmail.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 11:28 +0100, Mauro wrote:
> On 26 November 2012 11:20, Jan Beulich <JBeulich@suse.com> wrote:
> >>>> On 24.11.12 at 13:06, Mauro <mrsanna1@gmail.com> wrote:
> >> (XEN) XXX plt_overflow: plt_now=569ed0c10fa3 plt_wrap=569ed0bd2ac3
> >> now=569ed0bf15a4 old_stamp=36f62 new_stamp=800377ce
> >> plt_stamp64=13d800377ce plt_mask=ffffffff tsc=cfdf69d72c82
> >> tsc_stamp=cfdf69ccc91d
> >> (XEN) XXX pts=13d80036988/13d80036988 sps=569ed0bd2ac3/569ed0bd2ac3
> >> (XEN) XXX ps=7:8baebcb8/7:8baebcb8
> >
> > I.e. plt_wrap == stime_platform_stamp, which would imply
> > plt_stamp64 + plt_mask + 1 == platform_timer_stamp, which
> > visibly isn't the case.
> >
> > Having to consider mis-compilation of some sort at this point,
> > can you please attach the xen-syms matching the xen.gz from
> > the run above?
> 
> how can I do?

xen/xen-syms should be in the place where you built the hypervisor.

-- 
Ian Campbell

It is not doing the thing we like to do, but liking the thing we have to do,
that makes life blessed.
		-- Goethe


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 10:45:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 10:45:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcwBe-00023K-K4; Mon, 26 Nov 2012 10:45:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TcwBc-000239-P6
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 10:45:12 +0000
Received: from [85.158.138.51:11087] by server-1.bemta-3.messagelabs.com id
	FC/F6-12169-33843B05; Mon, 26 Nov 2012 10:45:07 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1353926706!23559809!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2806 invoked from network); 26 Nov 2012 10:45:07 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 10:45:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,319,1352073600"; d="scan'208";a="15996034"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 10:45:06 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 10:45:06 +0000
Message-ID: <1353926705.5830.9.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Darren Shepherd <darren.s.shepherd@gmail.com>
Date: Mon, 26 Nov 2012 10:45:05 +0000
In-Reply-To: <D8B61355-4276-418B-8207-35D806928C20@gmail.com>
References: <CAMCEDC0sU+kBkGWmUoWwyOJ8pURZGwVgN1_xqDkt1MvxR-vE4A@mail.gmail.com>
	<CAG1y0sci4Q8=Vy7i3NPfdYmH6e9rbvrHUPeoz_03+9_GvaHTwA@mail.gmail.com>
	<D8B61355-4276-418B-8207-35D806928C20@gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Thanos Makatos <thanos.makatos@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Fajar A. Nugraha" <list@fajar.net>
Subject: Re: [Xen-devel] blktap3 as a block device?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, 2012-11-24 at 01:08 +0000, Darren Shepherd wrote:
> The more direct question is going forward with blktap3 is there going
> to be a way to see the blktap device as a block device in dom0?

There will have to be, e.g. to support pygrub and similar uses.

I'm not sure what form this will eventually take though (CCing Thanos,
blktap3 maintainer). Ideas which I've heard floating about are to have
tapdisk export an nbd server or supporting running a vbd device in dom0
in a loopback type mode.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 10:45:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 10:45:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcwBe-00023K-K4; Mon, 26 Nov 2012 10:45:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TcwBc-000239-P6
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 10:45:12 +0000
Received: from [85.158.138.51:11087] by server-1.bemta-3.messagelabs.com id
	FC/F6-12169-33843B05; Mon, 26 Nov 2012 10:45:07 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1353926706!23559809!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2806 invoked from network); 26 Nov 2012 10:45:07 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 10:45:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,319,1352073600"; d="scan'208";a="15996034"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 10:45:06 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 10:45:06 +0000
Message-ID: <1353926705.5830.9.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Darren Shepherd <darren.s.shepherd@gmail.com>
Date: Mon, 26 Nov 2012 10:45:05 +0000
In-Reply-To: <D8B61355-4276-418B-8207-35D806928C20@gmail.com>
References: <CAMCEDC0sU+kBkGWmUoWwyOJ8pURZGwVgN1_xqDkt1MvxR-vE4A@mail.gmail.com>
	<CAG1y0sci4Q8=Vy7i3NPfdYmH6e9rbvrHUPeoz_03+9_GvaHTwA@mail.gmail.com>
	<D8B61355-4276-418B-8207-35D806928C20@gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Thanos Makatos <thanos.makatos@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Fajar A. Nugraha" <list@fajar.net>
Subject: Re: [Xen-devel] blktap3 as a block device?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, 2012-11-24 at 01:08 +0000, Darren Shepherd wrote:
> The more direct question is going forward with blktap3 is there going
> to be a way to see the blktap device as a block device in dom0?

There will have to be, e.g. to support pygrub and similar uses.

I'm not sure what form this will eventually take though (CCing Thanos,
blktap3 maintainer). Ideas which I've heard floating about are to have
tapdisk export an nbd server or supporting running a vbd device in dom0
in a loopback type mode.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 10:55:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 10:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcwL2-0002N4-N6; Mon, 26 Nov 2012 10:54:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TcwL2-0002Mz-4b
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 10:54:56 +0000
Received: from [85.158.143.99:13521] by server-2.bemta-4.messagelabs.com id
	2D/38-28922-F7A43B05; Mon, 26 Nov 2012 10:54:55 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353927294!24346123!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1530 invoked from network); 26 Nov 2012 10:54:54 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 10:54:54 -0000
X-IronPort-AV: E=Sophos;i="4.83,319,1352073600"; d="scan'208";a="15996274"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 10:54:54 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Mon, 26 Nov 2012
	10:54:54 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, Darren Shepherd
	<darren.s.shepherd@gmail.com>
Date: Mon, 26 Nov 2012 10:54:53 +0000
Thread-Topic: [Xen-devel] blktap3 as a block device?
Thread-Index: Ac3LwxlycHwp2vOsS2SasjDDh6ZUgwAAGcZw
Message-ID: <4B45B535F7F6BE4CB1C044ED5115CDDE012D552FE2E3@LONPMAILBOX01.citrite.net>
References: <CAMCEDC0sU+kBkGWmUoWwyOJ8pURZGwVgN1_xqDkt1MvxR-vE4A@mail.gmail.com>
	<CAG1y0sci4Q8=Vy7i3NPfdYmH6e9rbvrHUPeoz_03+9_GvaHTwA@mail.gmail.com>
	<D8B61355-4276-418B-8207-35D806928C20@gmail.com>
	<1353926705.5830.9.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353926705.5830.9.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Fajar A. Nugraha" <list@fajar.net>
Subject: Re: [Xen-devel] blktap3 as a block device?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



> -----Original Message-----
> From: Ian Campbell
> Sent: 26 November 2012 10:45
> To: Darren Shepherd
> Cc: Fajar A. Nugraha; xen-devel@lists.xen.org; Thanos Makatos
> Subject: Re: [Xen-devel] blktap3 as a block device?
> 
> On Sat, 2012-11-24 at 01:08 +0000, Darren Shepherd wrote:
> > The more direct question is going forward with blktap3 is there going
> > to be a way to see the blktap device as a block device in dom0?
> 
> There will have to be, e.g. to support pygrub and similar uses.
> 
> I'm not sure what form this will eventually take though (CCing Thanos,
> blktap3 maintainer). Ideas which I've heard floating about are to have
> tapdisk export an nbd server or supporting running a vbd device in dom0
> in a loopback type mode.

Yes this is one of the possibilities; this functionality is already on blktap2.5 (where blktap3 is based on).

Another idea could be to use both blkfront and tapdisk on dom0, haven't considered that thoroughly though.

> 
> Ian.
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 10:55:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 10:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcwL2-0002N4-N6; Mon, 26 Nov 2012 10:54:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TcwL2-0002Mz-4b
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 10:54:56 +0000
Received: from [85.158.143.99:13521] by server-2.bemta-4.messagelabs.com id
	2D/38-28922-F7A43B05; Mon, 26 Nov 2012 10:54:55 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353927294!24346123!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1530 invoked from network); 26 Nov 2012 10:54:54 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 10:54:54 -0000
X-IronPort-AV: E=Sophos;i="4.83,319,1352073600"; d="scan'208";a="15996274"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 10:54:54 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Mon, 26 Nov 2012
	10:54:54 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, Darren Shepherd
	<darren.s.shepherd@gmail.com>
Date: Mon, 26 Nov 2012 10:54:53 +0000
Thread-Topic: [Xen-devel] blktap3 as a block device?
Thread-Index: Ac3LwxlycHwp2vOsS2SasjDDh6ZUgwAAGcZw
Message-ID: <4B45B535F7F6BE4CB1C044ED5115CDDE012D552FE2E3@LONPMAILBOX01.citrite.net>
References: <CAMCEDC0sU+kBkGWmUoWwyOJ8pURZGwVgN1_xqDkt1MvxR-vE4A@mail.gmail.com>
	<CAG1y0sci4Q8=Vy7i3NPfdYmH6e9rbvrHUPeoz_03+9_GvaHTwA@mail.gmail.com>
	<D8B61355-4276-418B-8207-35D806928C20@gmail.com>
	<1353926705.5830.9.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353926705.5830.9.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Fajar A. Nugraha" <list@fajar.net>
Subject: Re: [Xen-devel] blktap3 as a block device?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



> -----Original Message-----
> From: Ian Campbell
> Sent: 26 November 2012 10:45
> To: Darren Shepherd
> Cc: Fajar A. Nugraha; xen-devel@lists.xen.org; Thanos Makatos
> Subject: Re: [Xen-devel] blktap3 as a block device?
> 
> On Sat, 2012-11-24 at 01:08 +0000, Darren Shepherd wrote:
> > The more direct question is going forward with blktap3 is there going
> > to be a way to see the blktap device as a block device in dom0?
> 
> There will have to be, e.g. to support pygrub and similar uses.
> 
> I'm not sure what form this will eventually take though (CCing Thanos,
> blktap3 maintainer). Ideas which I've heard floating about are to have
> tapdisk export an nbd server or supporting running a vbd device in dom0
> in a loopback type mode.

Yes this is one of the possibilities; this functionality is already on blktap2.5 (where blktap3 is based on).

Another idea could be to use both blkfront and tapdisk on dom0, haven't considered that thoroughly though.

> 
> Ian.
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 11:48:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 11:48:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcxAg-0002lg-JU; Mon, 26 Nov 2012 11:48:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TcxAf-0002lb-7v
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 11:48:17 +0000
Received: from [85.158.138.51:44409] by server-2.bemta-3.messagelabs.com id
	BC/92-04744-00753B05; Mon, 26 Nov 2012 11:48:16 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353930493!23466057!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28547 invoked from network); 26 Nov 2012 11:48:13 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 11:48:13 -0000
X-IronPort-AV: E=Sophos;i="4.83,320,1352073600"; d="scan'208";a="15997803"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 11:48:12 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:48:12 +0000
Message-ID: <50B356FB.70601@citrix.com>
Date: Mon, 26 Nov 2012 12:48:11 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Thanos Makatos <thanos.makatos@citrix.com>
References: <CAMCEDC0sU+kBkGWmUoWwyOJ8pURZGwVgN1_xqDkt1MvxR-vE4A@mail.gmail.com>
	<CAG1y0sci4Q8=Vy7i3NPfdYmH6e9rbvrHUPeoz_03+9_GvaHTwA@mail.gmail.com>
	<D8B61355-4276-418B-8207-35D806928C20@gmail.com>
	<1353926705.5830.9.camel@zakaz.uk.xensource.com>
	<4B45B535F7F6BE4CB1C044ED5115CDDE012D552FE2E3@LONPMAILBOX01.citrite.net>
In-Reply-To: <4B45B535F7F6BE4CB1C044ED5115CDDE012D552FE2E3@LONPMAILBOX01.citrite.net>
Cc: Darren Shepherd <darren.s.shepherd@gmail.com>,
	"Fajar A. Nugraha" <list@fajar.net>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] blktap3 as a block device?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 26/11/12 11:54, Thanos Makatos wrote:
> 
> 
>> -----Original Message-----
>> From: Ian Campbell
>> Sent: 26 November 2012 10:45
>> To: Darren Shepherd
>> Cc: Fajar A. Nugraha; xen-devel@lists.xen.org; Thanos Makatos
>> Subject: Re: [Xen-devel] blktap3 as a block device?
>>
>> On Sat, 2012-11-24 at 01:08 +0000, Darren Shepherd wrote:
>>> The more direct question is going forward with blktap3 is there going
>>> to be a way to see the blktap device as a block device in dom0?
>>
>> There will have to be, e.g. to support pygrub and similar uses.
>>
>> I'm not sure what form this will eventually take though (CCing Thanos,
>> blktap3 maintainer). Ideas which I've heard floating about are to have
>> tapdisk export an nbd server or supporting running a vbd device in dom0
>> in a loopback type mode.
> 
> Yes this is one of the possibilities; this functionality is already on blktap2.5 (where blktap3 is based on).
> 
> Another idea could be to use both blkfront and tapdisk on dom0, haven't considered that thoroughly though.

>From my point of view using blkfront on Dom0 should be used instead of
nbd. nbd is Linux specific, on the other hand all Dom0s have a blkfront
implementation.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 11:48:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 11:48:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcxAg-0002lg-JU; Mon, 26 Nov 2012 11:48:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TcxAf-0002lb-7v
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 11:48:17 +0000
Received: from [85.158.138.51:44409] by server-2.bemta-3.messagelabs.com id
	BC/92-04744-00753B05; Mon, 26 Nov 2012 11:48:16 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1353930493!23466057!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28547 invoked from network); 26 Nov 2012 11:48:13 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 11:48:13 -0000
X-IronPort-AV: E=Sophos;i="4.83,320,1352073600"; d="scan'208";a="15997803"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 11:48:12 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:48:12 +0000
Message-ID: <50B356FB.70601@citrix.com>
Date: Mon, 26 Nov 2012 12:48:11 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Thanos Makatos <thanos.makatos@citrix.com>
References: <CAMCEDC0sU+kBkGWmUoWwyOJ8pURZGwVgN1_xqDkt1MvxR-vE4A@mail.gmail.com>
	<CAG1y0sci4Q8=Vy7i3NPfdYmH6e9rbvrHUPeoz_03+9_GvaHTwA@mail.gmail.com>
	<D8B61355-4276-418B-8207-35D806928C20@gmail.com>
	<1353926705.5830.9.camel@zakaz.uk.xensource.com>
	<4B45B535F7F6BE4CB1C044ED5115CDDE012D552FE2E3@LONPMAILBOX01.citrite.net>
In-Reply-To: <4B45B535F7F6BE4CB1C044ED5115CDDE012D552FE2E3@LONPMAILBOX01.citrite.net>
Cc: Darren Shepherd <darren.s.shepherd@gmail.com>,
	"Fajar A. Nugraha" <list@fajar.net>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] blktap3 as a block device?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 26/11/12 11:54, Thanos Makatos wrote:
> 
> 
>> -----Original Message-----
>> From: Ian Campbell
>> Sent: 26 November 2012 10:45
>> To: Darren Shepherd
>> Cc: Fajar A. Nugraha; xen-devel@lists.xen.org; Thanos Makatos
>> Subject: Re: [Xen-devel] blktap3 as a block device?
>>
>> On Sat, 2012-11-24 at 01:08 +0000, Darren Shepherd wrote:
>>> The more direct question is going forward with blktap3 is there going
>>> to be a way to see the blktap device as a block device in dom0?
>>
>> There will have to be, e.g. to support pygrub and similar uses.
>>
>> I'm not sure what form this will eventually take though (CCing Thanos,
>> blktap3 maintainer). Ideas which I've heard floating about are to have
>> tapdisk export an nbd server or supporting running a vbd device in dom0
>> in a loopback type mode.
> 
> Yes this is one of the possibilities; this functionality is already on blktap2.5 (where blktap3 is based on).
> 
> Another idea could be to use both blkfront and tapdisk on dom0, haven't considered that thoroughly though.

>From my point of view using blkfront on Dom0 should be used instead of
nbd. nbd is Linux specific, on the other hand all Dom0s have a blkfront
implementation.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 11:51:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 11:51:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcxDQ-0002s8-DT; Mon, 26 Nov 2012 11:51:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TcxDO-0002rz-Nn
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 11:51:06 +0000
Received: from [85.158.137.99:32395] by server-13.bemta-3.messagelabs.com id
	1F/C1-24887-9A753B05; Mon, 26 Nov 2012 11:51:05 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1353930664!18931401!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22155 invoked from network); 26 Nov 2012 11:51:04 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 11:51:04 -0000
X-IronPort-AV: E=Sophos;i="4.83,320,1352073600"; d="scan'208";a="15997896"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 11:51:04 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:51:03 +0000
Message-ID: <50B357A7.6050905@citrix.com>
Date: Mon, 26 Nov 2012 12:51:03 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211231250330.13749@kaball.uk.xensource.com>
In-Reply-To: <alpine.DEB.2.02.1211231250330.13749@kaball.uk.xensource.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] README: add Pixman as build dependency
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 23/11/12 13:51, Stefano Stabellini wrote:
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> diff --git a/README b/README
> index 21a81b2..88300df 100644
> --- a/README
> +++ b/README
> @@ -51,6 +51,7 @@ provided by your OS distributor:
>      * Development install of libaio (e.g. libaio-dev) version 0.3.107 or
>        greater. Set CONFIG_SYSTEM_LIBAIO in .config if this is not available.
>      * Development install of GLib v2.0 (e.g. libglib2.0-dev)
> +    * Development install of Pixman (e.g. libpixman-1-dev)

Should we add a configure test for Pixman? I guess this is needed by Qemu.

>      * pkg-config
>      * bridge-utils package (/sbin/brctl)
>      * iproute package (/sbin/ip)
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 11:51:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 11:51:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcxDQ-0002s8-DT; Mon, 26 Nov 2012 11:51:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TcxDO-0002rz-Nn
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 11:51:06 +0000
Received: from [85.158.137.99:32395] by server-13.bemta-3.messagelabs.com id
	1F/C1-24887-9A753B05; Mon, 26 Nov 2012 11:51:05 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1353930664!18931401!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22155 invoked from network); 26 Nov 2012 11:51:04 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 11:51:04 -0000
X-IronPort-AV: E=Sophos;i="4.83,320,1352073600"; d="scan'208";a="15997896"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 11:51:04 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:51:03 +0000
Message-ID: <50B357A7.6050905@citrix.com>
Date: Mon, 26 Nov 2012 12:51:03 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211231250330.13749@kaball.uk.xensource.com>
In-Reply-To: <alpine.DEB.2.02.1211231250330.13749@kaball.uk.xensource.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] README: add Pixman as build dependency
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 23/11/12 13:51, Stefano Stabellini wrote:
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> diff --git a/README b/README
> index 21a81b2..88300df 100644
> --- a/README
> +++ b/README
> @@ -51,6 +51,7 @@ provided by your OS distributor:
>      * Development install of libaio (e.g. libaio-dev) version 0.3.107 or
>        greater. Set CONFIG_SYSTEM_LIBAIO in .config if this is not available.
>      * Development install of GLib v2.0 (e.g. libglib2.0-dev)
> +    * Development install of Pixman (e.g. libpixman-1-dev)

Should we add a configure test for Pixman? I guess this is needed by Qemu.

>      * pkg-config
>      * bridge-utils package (/sbin/brctl)
>      * iproute package (/sbin/ip)
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 11:57:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 11:57:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcxJB-00032d-7I; Mon, 26 Nov 2012 11:57:05 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TcxJ9-00032Y-Nm
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 11:57:03 +0000
Received: from [193.109.254.147:27785] by server-10.bemta-14.messagelabs.com
	id 7E/0E-31741-E0953B05; Mon, 26 Nov 2012 11:57:02 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353930997!8617192!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31970 invoked from network); 26 Nov 2012 11:56:39 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 11:56:39 -0000
X-IronPort-AV: E=Sophos;i="4.83,320,1352073600"; d="scan'208";a="215448513"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 11:56:37 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 06:56:37 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TcxIi-0000p0-OW;
	Mon, 26 Nov 2012 11:56:36 +0000
Message-ID: <50B357A2.2050205@eu.citrix.com>
Date: Mon, 26 Nov 2012 11:50:58 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<20121122173404.GC83155@ocelot.phlegethon.org>
In-Reply-To: <20121122173404.GC83155@ocelot.phlegethon.org>
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Malcolm Crossley <malcolm.crossley@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
 handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/12 17:34, Tim Deegan wrote:
> At 15:00 +0000 on 22 Nov (1353596446), Andrew Cooper wrote:
>> diff -r 2489c2926698 -r d7ea938044ac xen/arch/x86/hvm/vmx/vmx.c
>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>>           vector = intr_info & INTR_INFO_VECTOR_MASK;
>>           if ( vector == TRAP_machine_check )
>>               do_machine_check(regs);
>> +        else if ( vector == TRAP_nmi &&
>> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
>> +                  (X86_EVENTTYPE_NMI << 8) ) )
>> +            /* Must be called before interrupts are enabled to ensure
>> +             * the NMI handler code is run before the first IRET. The
>> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
>> +             */
>> +            do_nmi();
>>           break;
>>       case EXIT_REASON_MCE_DURING_VMENTRY:
>>           do_machine_check(regs);
> I think it might also make sense to move the HVMTARCE invocations that
> are just above here down to after this block.  There's quite a lot of
> code behind there and though I don't see any potential faults they might
> well get added later (including in places like printk() and
> tasklet_schedule()).
>
> I had a look at the rest of the code that runs between the vmexit and
> here, and it looks OK to me.
>
> George, would that make the tracing more confusing?

Well, it would mildly, because you'd get the trace in vmx_do_extint() 
before the trace for the VMEXIT that caused it. :-) If it's important 
for correctness, then xenalyze will just have to deal.  But it would be 
a lot nicer not to have to deal.

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 11:57:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 11:57:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcxJB-00032d-7I; Mon, 26 Nov 2012 11:57:05 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TcxJ9-00032Y-Nm
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 11:57:03 +0000
Received: from [193.109.254.147:27785] by server-10.bemta-14.messagelabs.com
	id 7E/0E-31741-E0953B05; Mon, 26 Nov 2012 11:57:02 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353930997!8617192!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31970 invoked from network); 26 Nov 2012 11:56:39 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 11:56:39 -0000
X-IronPort-AV: E=Sophos;i="4.83,320,1352073600"; d="scan'208";a="215448513"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 11:56:37 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 06:56:37 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TcxIi-0000p0-OW;
	Mon, 26 Nov 2012 11:56:36 +0000
Message-ID: <50B357A2.2050205@eu.citrix.com>
Date: Mon, 26 Nov 2012 11:50:58 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <d7ea938044ac0212ce31.1353596446@andrewcoop.uk.xensource.com>
	<20121122173404.GC83155@ocelot.phlegethon.org>
In-Reply-To: <20121122173404.GC83155@ocelot.phlegethon.org>
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Malcolm Crossley <malcolm.crossley@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT
 handler
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 22/11/12 17:34, Tim Deegan wrote:
> At 15:00 +0000 on 22 Nov (1353596446), Andrew Cooper wrote:
>> diff -r 2489c2926698 -r d7ea938044ac xen/arch/x86/hvm/vmx/vmx.c
>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>> @@ -2269,6 +2269,14 @@ void vmx_vmexit_handler(struct cpu_user_
>>           vector = intr_info & INTR_INFO_VECTOR_MASK;
>>           if ( vector == TRAP_machine_check )
>>               do_machine_check(regs);
>> +        else if ( vector == TRAP_nmi &&
>> +                ( (intr_info & INTR_INFO_INTR_TYPE_MASK) ==
>> +                  (X86_EVENTTYPE_NMI << 8) ) )
>> +            /* Must be called before interrupts are enabled to ensure
>> +             * the NMI handler code is run before the first IRET. The
>> +             * IRET unblocks subsequent NMI's (Intel SDM Vol 3, 6.7.1)
>> +             */
>> +            do_nmi();
>>           break;
>>       case EXIT_REASON_MCE_DURING_VMENTRY:
>>           do_machine_check(regs);
> I think it might also make sense to move the HVMTARCE invocations that
> are just above here down to after this block.  There's quite a lot of
> code behind there and though I don't see any potential faults they might
> well get added later (including in places like printk() and
> tasklet_schedule()).
>
> I had a look at the rest of the code that runs between the vmexit and
> here, and it looks OK to me.
>
> George, would that make the tracing more confusing?

Well, it would mildly, because you'd get the trace in vmx_do_extint() 
before the trace for the VMEXIT that caused it. :-) If it's important 
for correctness, then xenalyze will just have to deal.  But it would be 
a lot nicer not to have to deal.

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 12:18:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 12:18:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcxdK-0003VQ-VT; Mon, 26 Nov 2012 12:17:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TcxdJ-0003VL-Op
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 12:17:53 +0000
Received: from [85.158.143.35:4735] by server-2.bemta-4.messagelabs.com id
	70/76-28922-1FD53B05; Mon, 26 Nov 2012 12:17:53 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1353932233!16207465!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21868 invoked from network); 26 Nov 2012 12:17:13 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-21.messagelabs.com with SMTP;
	26 Nov 2012 12:17:13 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 12:17:13 +0000
Message-Id: <50B36C0D02000078000AB15B@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 12:18:05 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mauro" <mrsanna1@gmail.com>
References: <CAE17a0XdxhaoCZaDDT6RXm1DPnabf2hWXAnzU5NukHeXX45grA@mail.gmail.com>
	<CCCD845A.44DB0%keir.xen@gmail.com>
	<CAE17a0Xit58cLiJ+pE7uKuCDq3Xn+7-5+iDpV2+5S+TX3yuT+Q@mail.gmail.com>
	<50B3507E02000078000AB0D9@nat28.tlf.novell.com>
	<CAE17a0WpzYTgOa9J-DJCKnQ4VgcoeX1GPtnSN2+jUw34DRNxCg@mail.gmail.com>
	<1353926458.5830.5.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353926458.5830.5.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Philippe.Simonet@swisscom.com, Keir Fraser <keir.xen@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>, Ian Campbell <ijc@hellion.org.uk>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 11:40, Ian Campbell <ijc@hellion.org.uk> wrote:
> On Mon, 2012-11-26 at 11:28 +0100, Mauro wrote:
>> On 26 November 2012 11:20, Jan Beulich <JBeulich@suse.com> wrote:
>> >>>> On 24.11.12 at 13:06, Mauro <mrsanna1@gmail.com> wrote:
>> >> (XEN) XXX plt_overflow: plt_now=569ed0c10fa3 plt_wrap=569ed0bd2ac3
>> >> now=569ed0bf15a4 old_stamp=36f62 new_stamp=800377ce
>> >> plt_stamp64=13d800377ce plt_mask=ffffffff tsc=cfdf69d72c82
>> >> tsc_stamp=cfdf69ccc91d
>> >> (XEN) XXX pts=13d80036988/13d80036988 sps=569ed0bd2ac3/569ed0bd2ac3
>> >> (XEN) XXX ps=7:8baebcb8/7:8baebcb8
>> >
>> > I.e. plt_wrap == stime_platform_stamp, which would imply
>> > plt_stamp64 + plt_mask + 1 == platform_timer_stamp, which
>> > visibly isn't the case.
>> >
>> > Having to consider mis-compilation of some sort at this point,
>> > can you please attach the xen-syms matching the xen.gz from
>> > the run above?
>> 
>> how can I do?
> 
> xen/xen-syms should be in the place where you built the hypervisor.

... or, if you didn't build the hypervisor yourself, you should check
the package you were handed.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 12:18:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 12:18:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcxdK-0003VQ-VT; Mon, 26 Nov 2012 12:17:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TcxdJ-0003VL-Op
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 12:17:53 +0000
Received: from [85.158.143.35:4735] by server-2.bemta-4.messagelabs.com id
	70/76-28922-1FD53B05; Mon, 26 Nov 2012 12:17:53 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1353932233!16207465!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21868 invoked from network); 26 Nov 2012 12:17:13 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-21.messagelabs.com with SMTP;
	26 Nov 2012 12:17:13 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 12:17:13 +0000
Message-Id: <50B36C0D02000078000AB15B@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 12:18:05 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mauro" <mrsanna1@gmail.com>
References: <CAE17a0XdxhaoCZaDDT6RXm1DPnabf2hWXAnzU5NukHeXX45grA@mail.gmail.com>
	<CCCD845A.44DB0%keir.xen@gmail.com>
	<CAE17a0Xit58cLiJ+pE7uKuCDq3Xn+7-5+iDpV2+5S+TX3yuT+Q@mail.gmail.com>
	<50B3507E02000078000AB0D9@nat28.tlf.novell.com>
	<CAE17a0WpzYTgOa9J-DJCKnQ4VgcoeX1GPtnSN2+jUw34DRNxCg@mail.gmail.com>
	<1353926458.5830.5.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353926458.5830.5.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Philippe.Simonet@swisscom.com, Keir Fraser <keir.xen@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>, Ian Campbell <ijc@hellion.org.uk>
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 11:40, Ian Campbell <ijc@hellion.org.uk> wrote:
> On Mon, 2012-11-26 at 11:28 +0100, Mauro wrote:
>> On 26 November 2012 11:20, Jan Beulich <JBeulich@suse.com> wrote:
>> >>>> On 24.11.12 at 13:06, Mauro <mrsanna1@gmail.com> wrote:
>> >> (XEN) XXX plt_overflow: plt_now=569ed0c10fa3 plt_wrap=569ed0bd2ac3
>> >> now=569ed0bf15a4 old_stamp=36f62 new_stamp=800377ce
>> >> plt_stamp64=13d800377ce plt_mask=ffffffff tsc=cfdf69d72c82
>> >> tsc_stamp=cfdf69ccc91d
>> >> (XEN) XXX pts=13d80036988/13d80036988 sps=569ed0bd2ac3/569ed0bd2ac3
>> >> (XEN) XXX ps=7:8baebcb8/7:8baebcb8
>> >
>> > I.e. plt_wrap == stime_platform_stamp, which would imply
>> > plt_stamp64 + plt_mask + 1 == platform_timer_stamp, which
>> > visibly isn't the case.
>> >
>> > Having to consider mis-compilation of some sort at this point,
>> > can you please attach the xen-syms matching the xen.gz from
>> > the run above?
>> 
>> how can I do?
> 
> xen/xen-syms should be in the place where you built the hypervisor.

... or, if you didn't build the hypervisor yourself, you should check
the package you were handed.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 12:52:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 12:52:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcyAj-0003jC-Uo; Mon, 26 Nov 2012 12:52:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dietmar.hahn@ts.fujitsu.com>) id 1TcyAi-0003j7-GI
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 12:52:24 +0000
Received: from [85.158.143.99:32496] by server-3.bemta-4.messagelabs.com id
	B6/CA-06841-70663B05; Mon, 26 Nov 2012 12:52:23 +0000
X-Env-Sender: dietmar.hahn@ts.fujitsu.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1353934329!31430726!1
X-Originating-IP: [80.70.172.49]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuNzAuMTcyLjQ5ID0+IDI2Njg1MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30200 invoked from network); 26 Nov 2012 12:52:09 -0000
Received: from dgate10.ts.fujitsu.com (HELO dgate10.ts.fujitsu.com)
	(80.70.172.49)
	by server-9.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 12:52:09 -0000
DomainKey-Signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns;
	h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV:
	Received:Received:From:To:Subject:Date:Message-ID:
	User-Agent:MIME-Version:Content-Transfer-Encoding:
	Content-Type;
	b=VdDTbx2t5cmlsXaYRai1E++MA2wZIn3ZzYMH3A8TNKITBO5QVbw0uE/t
	kmZPz4+jvuqi7UQ+p5KEU/MP1cYrMDkK3s4dIX34GTZtsK8GlGQbYBSZQ
	PxBK79cQmVwZ/XuG8wvvoSiBNhY8ttCbjdo7BHadYNpiAZPcF9/EYFr8+
	WmZDqrjCgnpYx+2uU8vjKLbmn6qrxc6+zegazEcQZwKOzyNEvMGinxmDE
	tcxG4nwl1j/7GiCtP9kmP8QV/TxH9;
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
	d=ts.fujitsu.com; i=@ts.fujitsu.com; q=dns/txt;
	s=s1536b; t=1353934330; x=1385470330;
	h=from:to:subject:date:message-id:mime-version:
	content-transfer-encoding;
	bh=lAhFWDqB5jrk1jL+qJaLadwS807sWQoU0VRR2NWW2sE=;
	b=lplmY56iuAWBy59FowzDndAEJEU2QzTCH/WrvujrD8V5Wc40GedEtiaS
	5G0TJ3USZ1gCguhkdloBXPzih+CAA/ZweAk0+2wl/chk8g0Fp+p8dBDmp
	1nK25oflrgPRi3qxK+DJBamVg4ewBpovHguwsiO9i+KcIcURpihdaEaBR
	lcJJV+DaYX1G5CE2ZoqAvuVx2sl/THuSHVRl9EKQNc9gVOFR62VAjYS1v
	e8DCVG8OMC3JKHdauQZdtpDg3Iy7T;
X-SBRSScore: None
X-IronPort-AV: E=Sophos;i="4.83,320,1352070000"; d="scan'208";a="129344042"
Received: from abgdgate40u.abg.fsc.net ([172.25.138.90])
	by dgate10u.abg.fsc.net with ESMTP; 26 Nov 2012 13:52:09 +0100
X-IronPort-AV: E=Sophos;i="4.83,319,1352070000"; d="scan'208";a="150851911"
Received: from sanpedro.mch.fsc.net ([172.17.20.6])
	by abgdgate40u.abg.fsc.net with SMTP; 26 Nov 2012 13:52:09 +0100
Received: from amur.localnet (amur.mch.fsc.net [10.172.102.19])
	by sanpedro.mch.fsc.net (Postfix) with ESMTP id 295E896B7E3
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 13:52:09 +0100 (CET)
From: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Date: Mon, 26 Nov 2012 13:52:08 +0100
Message-ID: <1449364.BXBucXMpuY@amur>
User-Agent: KMail/4.7.2 (Linux/3.1.10-1.16-xen; KDE/4.7.2; x86_64; ; )
MIME-Version: 1.0
Subject: [Xen-devel] [PATCH] oprofile: Add X7542 and E7-8837 to the list of
	supported cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add intel cpus X7542 and E7-8837 to the list of supported cpus.

Thanks.
Dietmar.

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>

diff -r 0049de3827bc -r 6fb0129600cd xen/arch/x86/oprofile/nmi_int.c
--- a/xen/arch/x86/oprofile/nmi_int.c   Fri Nov 23 11:06:15 2012 +0000
+++ b/xen/arch/x86/oprofile/nmi_int.c   Mon Nov 26 13:36:00 2012 +0100
@@ -366,6 +366,8 @@ static int __init ppro_init(char ** cpu_
                ppro_has_global_ctrl = 1;
                break;
        case 26:
+       case 46:
+       case 47:
                arch_perfmon_setup_counters();
                *cpu_type = "i386/core_i7";
                ppro_has_global_ctrl = 1;


-- 
Company details: http://ts.fujitsu.com/imprint.html

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 12:52:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 12:52:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcyAj-0003jC-Uo; Mon, 26 Nov 2012 12:52:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dietmar.hahn@ts.fujitsu.com>) id 1TcyAi-0003j7-GI
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 12:52:24 +0000
Received: from [85.158.143.99:32496] by server-3.bemta-4.messagelabs.com id
	B6/CA-06841-70663B05; Mon, 26 Nov 2012 12:52:23 +0000
X-Env-Sender: dietmar.hahn@ts.fujitsu.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1353934329!31430726!1
X-Originating-IP: [80.70.172.49]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuNzAuMTcyLjQ5ID0+IDI2Njg1MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30200 invoked from network); 26 Nov 2012 12:52:09 -0000
Received: from dgate10.ts.fujitsu.com (HELO dgate10.ts.fujitsu.com)
	(80.70.172.49)
	by server-9.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 12:52:09 -0000
DomainKey-Signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns;
	h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV:
	Received:Received:From:To:Subject:Date:Message-ID:
	User-Agent:MIME-Version:Content-Transfer-Encoding:
	Content-Type;
	b=VdDTbx2t5cmlsXaYRai1E++MA2wZIn3ZzYMH3A8TNKITBO5QVbw0uE/t
	kmZPz4+jvuqi7UQ+p5KEU/MP1cYrMDkK3s4dIX34GTZtsK8GlGQbYBSZQ
	PxBK79cQmVwZ/XuG8wvvoSiBNhY8ttCbjdo7BHadYNpiAZPcF9/EYFr8+
	WmZDqrjCgnpYx+2uU8vjKLbmn6qrxc6+zegazEcQZwKOzyNEvMGinxmDE
	tcxG4nwl1j/7GiCtP9kmP8QV/TxH9;
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
	d=ts.fujitsu.com; i=@ts.fujitsu.com; q=dns/txt;
	s=s1536b; t=1353934330; x=1385470330;
	h=from:to:subject:date:message-id:mime-version:
	content-transfer-encoding;
	bh=lAhFWDqB5jrk1jL+qJaLadwS807sWQoU0VRR2NWW2sE=;
	b=lplmY56iuAWBy59FowzDndAEJEU2QzTCH/WrvujrD8V5Wc40GedEtiaS
	5G0TJ3USZ1gCguhkdloBXPzih+CAA/ZweAk0+2wl/chk8g0Fp+p8dBDmp
	1nK25oflrgPRi3qxK+DJBamVg4ewBpovHguwsiO9i+KcIcURpihdaEaBR
	lcJJV+DaYX1G5CE2ZoqAvuVx2sl/THuSHVRl9EKQNc9gVOFR62VAjYS1v
	e8DCVG8OMC3JKHdauQZdtpDg3Iy7T;
X-SBRSScore: None
X-IronPort-AV: E=Sophos;i="4.83,320,1352070000"; d="scan'208";a="129344042"
Received: from abgdgate40u.abg.fsc.net ([172.25.138.90])
	by dgate10u.abg.fsc.net with ESMTP; 26 Nov 2012 13:52:09 +0100
X-IronPort-AV: E=Sophos;i="4.83,319,1352070000"; d="scan'208";a="150851911"
Received: from sanpedro.mch.fsc.net ([172.17.20.6])
	by abgdgate40u.abg.fsc.net with SMTP; 26 Nov 2012 13:52:09 +0100
Received: from amur.localnet (amur.mch.fsc.net [10.172.102.19])
	by sanpedro.mch.fsc.net (Postfix) with ESMTP id 295E896B7E3
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 13:52:09 +0100 (CET)
From: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Date: Mon, 26 Nov 2012 13:52:08 +0100
Message-ID: <1449364.BXBucXMpuY@amur>
User-Agent: KMail/4.7.2 (Linux/3.1.10-1.16-xen; KDE/4.7.2; x86_64; ; )
MIME-Version: 1.0
Subject: [Xen-devel] [PATCH] oprofile: Add X7542 and E7-8837 to the list of
	supported cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add intel cpus X7542 and E7-8837 to the list of supported cpus.

Thanks.
Dietmar.

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>

diff -r 0049de3827bc -r 6fb0129600cd xen/arch/x86/oprofile/nmi_int.c
--- a/xen/arch/x86/oprofile/nmi_int.c   Fri Nov 23 11:06:15 2012 +0000
+++ b/xen/arch/x86/oprofile/nmi_int.c   Mon Nov 26 13:36:00 2012 +0100
@@ -366,6 +366,8 @@ static int __init ppro_init(char ** cpu_
                ppro_has_global_ctrl = 1;
                break;
        case 26:
+       case 46:
+       case 47:
                arch_perfmon_setup_counters();
                *cpu_type = "i386/core_i7";
                ppro_has_global_ctrl = 1;


-- 
Company details: http://ts.fujitsu.com/imprint.html

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 13:09:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 13:09:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcyQv-0003wd-VD; Mon, 26 Nov 2012 13:09:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Philippe.Simonet@swisscom.com>) id 1TcyQu-0003wV-LO
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 13:09:08 +0000
Received: from [85.158.138.51:57669] by server-15.bemta-3.messagelabs.com id
	2B/D4-23779-3F963B05; Mon, 26 Nov 2012 13:09:07 +0000
X-Env-Sender: Philippe.Simonet@swisscom.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353935338!31456596!1
X-Originating-IP: [193.222.81.100]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkzLjIyMi44MS4xMDAgPT4gMTAxMTAw\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25155 invoked from network); 26 Nov 2012 13:08:58 -0000
Received: from outmail100.swisscom.com (HELO mail.swisscom.com)
	(193.222.81.100)
	by server-8.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 13:08:58 -0000
Received: by mail.swisscom.com; Mon, 26 Nov 2012 14:08:44 +0100
From: <Philippe.Simonet@swisscom.com>
To: <JBeulich@suse.com>, <mrsanna1@gmail.com>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
	50 minutes" bug.
Thread-Index: Ac280B6CWUiPuRIkTkmJRMKB8zdEqQAEnBqAAAkCjQAAIYFoAAAKGgkAAAADMQAAKDdR8ADKVKEAABrm6qAAE0c4gACdz2+AAAtOQQAAAp0PAAFTNgIAAGDiFwAAAEPNgAAAcy8AAANkS4AAA9V/UA==
Date: Mon, 26 Nov 2012 13:08:43 +0000
Message-ID: <FF93AF260AC2BB499A119CC65B092CF731533B8F@sg000713.corproot.net>
References: <CAE17a0XdxhaoCZaDDT6RXm1DPnabf2hWXAnzU5NukHeXX45grA@mail.gmail.com>
	<CCCD845A.44DB0%keir.xen@gmail.com>
	<CAE17a0Xit58cLiJ+pE7uKuCDq3Xn+7-5+iDpV2+5S+TX3yuT+Q@mail.gmail.com>
	<50B3507E02000078000AB0D9@nat28.tlf.novell.com>
	<CAE17a0WpzYTgOa9J-DJCKnQ4VgcoeX1GPtnSN2+jUw34DRNxCg@mail.gmail.com>
	<1353926458.5830.5.camel@zakaz.uk.xensource.com>
	<50B36C0D02000078000AB15B@nat28.tlf.novell.com>
In-Reply-To: <50B36C0D02000078000AB15B@nat28.tlf.novell.com>
Accept-Language: en-US, de-CH
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.65.122.53]
MIME-Version: 1.0
Cc: keir.xen@gmail.com, xen-devel@lists.xen.org, ijc@hellion.org.uk
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi jan

I've done that for Mauro, here are the symbols : http://www.ncube.ch/xen-syms.gz

MANY thanks and regards

Philippe




> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Monday, November 26, 2012 1:18 PM
> To: Mauro
> Cc: Keir Fraser; Ian Campbell; xen-devel; Simonet Philippe, ITS-OUS-OP-
> IFM-NW-IPE
> Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
> minutes" bug.
> 
> >>> On 26.11.12 at 11:40, Ian Campbell <ijc@hellion.org.uk> wrote:
> > On Mon, 2012-11-26 at 11:28 +0100, Mauro wrote:
> >> On 26 November 2012 11:20, Jan Beulich <JBeulich@suse.com> wrote:
> >> >>>> On 24.11.12 at 13:06, Mauro <mrsanna1@gmail.com> wrote:
> >> >> (XEN) XXX plt_overflow: plt_now=569ed0c10fa3
> plt_wrap=569ed0bd2ac3
> >> >> now=569ed0bf15a4 old_stamp=36f62 new_stamp=800377ce
> >> >> plt_stamp64=13d800377ce plt_mask=ffffffff tsc=cfdf69d72c82
> >> >> tsc_stamp=cfdf69ccc91d
> >> >> (XEN) XXX pts=13d80036988/13d80036988
> >> >> sps=569ed0bd2ac3/569ed0bd2ac3
> >> >> (XEN) XXX ps=7:8baebcb8/7:8baebcb8
> >> >
> >> > I.e. plt_wrap == stime_platform_stamp, which would imply
> >> > plt_stamp64 + plt_mask + 1 == platform_timer_stamp, which visibly
> >> > isn't the case.
> >> >
> >> > Having to consider mis-compilation of some sort at this point, can
> >> > you please attach the xen-syms matching the xen.gz from the run
> >> > above?
> >>
> >> how can I do?
> >
> > xen/xen-syms should be in the place where you built the hypervisor.
> 
> ... or, if you didn't build the hypervisor yourself, you should check the
> package you were handed.
> 
> Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 13:09:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 13:09:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcyQv-0003wd-VD; Mon, 26 Nov 2012 13:09:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Philippe.Simonet@swisscom.com>) id 1TcyQu-0003wV-LO
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 13:09:08 +0000
Received: from [85.158.138.51:57669] by server-15.bemta-3.messagelabs.com id
	2B/D4-23779-3F963B05; Mon, 26 Nov 2012 13:09:07 +0000
X-Env-Sender: Philippe.Simonet@swisscom.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1353935338!31456596!1
X-Originating-IP: [193.222.81.100]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkzLjIyMi44MS4xMDAgPT4gMTAxMTAw\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25155 invoked from network); 26 Nov 2012 13:08:58 -0000
Received: from outmail100.swisscom.com (HELO mail.swisscom.com)
	(193.222.81.100)
	by server-8.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 13:08:58 -0000
Received: by mail.swisscom.com; Mon, 26 Nov 2012 14:08:44 +0100
From: <Philippe.Simonet@swisscom.com>
To: <JBeulich@suse.com>, <mrsanna1@gmail.com>
Thread-Topic: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
	50 minutes" bug.
Thread-Index: Ac280B6CWUiPuRIkTkmJRMKB8zdEqQAEnBqAAAkCjQAAIYFoAAAKGgkAAAADMQAAKDdR8ADKVKEAABrm6qAAE0c4gACdz2+AAAtOQQAAAp0PAAFTNgIAAGDiFwAAAEPNgAAAcy8AAANkS4AAA9V/UA==
Date: Mon, 26 Nov 2012 13:08:43 +0000
Message-ID: <FF93AF260AC2BB499A119CC65B092CF731533B8F@sg000713.corproot.net>
References: <CAE17a0XdxhaoCZaDDT6RXm1DPnabf2hWXAnzU5NukHeXX45grA@mail.gmail.com>
	<CCCD845A.44DB0%keir.xen@gmail.com>
	<CAE17a0Xit58cLiJ+pE7uKuCDq3Xn+7-5+iDpV2+5S+TX3yuT+Q@mail.gmail.com>
	<50B3507E02000078000AB0D9@nat28.tlf.novell.com>
	<CAE17a0WpzYTgOa9J-DJCKnQ4VgcoeX1GPtnSN2+jUw34DRNxCg@mail.gmail.com>
	<1353926458.5830.5.camel@zakaz.uk.xensource.com>
	<50B36C0D02000078000AB15B@nat28.tlf.novell.com>
In-Reply-To: <50B36C0D02000078000AB15B@nat28.tlf.novell.com>
Accept-Language: en-US, de-CH
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.65.122.53]
MIME-Version: 1.0
Cc: keir.xen@gmail.com, xen-devel@lists.xen.org, ijc@hellion.org.uk
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi jan

I've done that for Mauro, here are the symbols : http://www.ncube.ch/xen-syms.gz

MANY thanks and regards

Philippe




> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Monday, November 26, 2012 1:18 PM
> To: Mauro
> Cc: Keir Fraser; Ian Campbell; xen-devel; Simonet Philippe, ITS-OUS-OP-
> IFM-NW-IPE
> Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by 50
> minutes" bug.
> 
> >>> On 26.11.12 at 11:40, Ian Campbell <ijc@hellion.org.uk> wrote:
> > On Mon, 2012-11-26 at 11:28 +0100, Mauro wrote:
> >> On 26 November 2012 11:20, Jan Beulich <JBeulich@suse.com> wrote:
> >> >>>> On 24.11.12 at 13:06, Mauro <mrsanna1@gmail.com> wrote:
> >> >> (XEN) XXX plt_overflow: plt_now=569ed0c10fa3
> plt_wrap=569ed0bd2ac3
> >> >> now=569ed0bf15a4 old_stamp=36f62 new_stamp=800377ce
> >> >> plt_stamp64=13d800377ce plt_mask=ffffffff tsc=cfdf69d72c82
> >> >> tsc_stamp=cfdf69ccc91d
> >> >> (XEN) XXX pts=13d80036988/13d80036988
> >> >> sps=569ed0bd2ac3/569ed0bd2ac3
> >> >> (XEN) XXX ps=7:8baebcb8/7:8baebcb8
> >> >
> >> > I.e. plt_wrap == stime_platform_stamp, which would imply
> >> > plt_stamp64 + plt_mask + 1 == platform_timer_stamp, which visibly
> >> > isn't the case.
> >> >
> >> > Having to consider mis-compilation of some sort at this point, can
> >> > you please attach the xen-syms matching the xen.gz from the run
> >> > above?
> >>
> >> how can I do?
> >
> > xen/xen-syms should be in the place where you built the hypervisor.
> 
> ... or, if you didn't build the hypervisor yourself, you should check the
> package you were handed.
> 
> Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 13:09:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 13:09:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcyQr-0003wM-Il; Mon, 26 Nov 2012 13:09:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TcyQp-0003wH-OZ
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 13:09:03 +0000
Received: from [85.158.138.51:61932] by server-14.bemta-3.messagelabs.com id
	85/D9-31424-AE963B05; Mon, 26 Nov 2012 13:08:58 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-16.tower-174.messagelabs.com!1353935336!31412743!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2042 invoked from network); 26 Nov 2012 13:08:57 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-16.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 13:08:57 -0000
Received: from ([128.244.198.91])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149910417;
	Mon, 26 Nov 2012 08:08:52 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas2.dom1.jhuapl.edu ([128.244.198.91]) with mapi; Mon, 26 Nov 2012
	08:08:08 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Ian Campbell
	<Ian.Campbell@citrix.com>
Date: Mon, 26 Nov 2012 08:03:15 -0500
Thread-Topic: [PATCH RFC] stubdom: Change vTPM shared page ABI
Thread-Index: Ac3Jlbsf2pnujzSXRS2R9LyYJsnSwQCQKsPW
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48B78C3E48@aplesstripe.dom1.jhuapl.edu>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
	<1353668646.13542.228.camel@zakaz.uk.xensource.com>,
	<50AFA132.5020904@tycho.nsa.gov>
In-Reply-To: <50AFA132.5020904@tycho.nsa.gov>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


________________________________________
From: Daniel De Graaf [dgdegra@tycho.nsa.gov]
Sent: Friday, November 23, 2012 11:15 AM
To: Ian Campbell
Cc: Fioravante, Matthew E.; xen-devel@lists.xen.org
Subject: Re: [PATCH RFC] stubdom: Change vTPM shared page ABI

On 11/23/2012 06:04 AM, Ian Campbell wrote:
> On Tue, 2012-11-20 at 16:16 +0000, Fioravante, Matthew E. wrote:
>> This was something I've been wanting to do for a while so I'm very
>> happy you went ahead and fixed it yourself. Once you submit the linux
>> version I'll test it on my system.
>>
>> Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>
> Do we need to synchronise with anything else (Linux drivers?) or I can I
> just throw this into the tree once it is done?

I think the only Linux drivers are the ones that were just posted, and the
ones for XenLinux 2.6.18. Assuming the modified Linux module that I posted
works as it should, the v2 version will be the only one upstream.

> Are we hanging any existing users of the tpm stuff out to dry? Could we
> get a feature-protocol-v2 flag in xenstore so users at least get an
> error message from either the front or backend to give a hint why it
> isn't working?

I suppose we could do that, although I'm not sure the "feature-" prefix is
appropriate, since the code doesn't have the ability to fall back to v1.

I'd rather just let existing users hang out to dry. First off there aren't really 
any existing users. Anyone who is or might be a user is probably following 
these threads closely. Second the xen tpm driver hasn't even been 
accepted into linux yet so there really is not any "official" version 1.

I can update the documentation to state the requirements on the new
tpm driver version so that nobody tries to use the old version in the
xen 2.6.18 tree.

>>  void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)  {
>> -   tpmif_tx_request_t* tx;
>> -   int offset;
>> -   int i;
>> -   uint32_t domid;
>> -   int tocopy;
>> +   vtpm_shared_page_t* shr;
>> +   unsigned int offset;
>>     int flags;
>> +#ifdef TPMBACK_PRINT_DEBUG
>> +int i;
>> +#endif
>
> Dodgy indentation? (I saw a bunch of these)

Whoops, I'll have to go fix that. The entire mini-os build is sprinkled with
tabs and spaces mostly at random, so perhaps a generic fix-indent patch is
needed after all the real changes are applied.

>> - * Copyright (c) 2005, IBM Corporation
>> - *
>> - * Author: Stefan Berger, stefanb@us.ibm.com
>> - * Grant table support: Mahadevan Gomathisankaran
>
> Did you really remove everything these guys wrote?

>From this file, yes - unless the #ifndef and header/footer comments count, but
I was under the impression that that is too small to count for copyright, and
is duplicated across the other files in that directory anyway.

>> - * This code has been derived from tools/libxc/xen/io/netif.h
>> - *
>> - * Copyright (c) 2003-2004, Keir Fraser
>
> I guess I can buy this bit no longer being true given that you reworked
> the whole protocol.
>
> Ian

Basically, the file is a rewrite, although not detected by git/hg as such. I can
add an authorship line if that would be helpful (I see that's normal in other
header files).

--
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 13:09:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 13:09:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcyQr-0003wM-Il; Mon, 26 Nov 2012 13:09:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TcyQp-0003wH-OZ
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 13:09:03 +0000
Received: from [85.158.138.51:61932] by server-14.bemta-3.messagelabs.com id
	85/D9-31424-AE963B05; Mon, 26 Nov 2012 13:08:58 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-16.tower-174.messagelabs.com!1353935336!31412743!1
X-Originating-IP: [128.244.251.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2042 invoked from network); 26 Nov 2012 13:08:57 -0000
Received: from piper.jhuapl.edu (HELO jhuapl.edu) (128.244.251.37)
	by server-16.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 13:08:57 -0000
Received: from ([128.244.198.91])
	by piper.jhuapl.edu with ESMTP with TLS id 5Y8HCH1.149910417;
	Mon, 26 Nov 2012 08:08:52 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas2.dom1.jhuapl.edu ([128.244.198.91]) with mapi; Mon, 26 Nov 2012
	08:08:08 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Ian Campbell
	<Ian.Campbell@citrix.com>
Date: Mon, 26 Nov 2012 08:03:15 -0500
Thread-Topic: [PATCH RFC] stubdom: Change vTPM shared page ABI
Thread-Index: Ac3Jlbsf2pnujzSXRS2R9LyYJsnSwQCQKsPW
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48B78C3E48@aplesstripe.dom1.jhuapl.edu>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
	<1353668646.13542.228.camel@zakaz.uk.xensource.com>,
	<50AFA132.5020904@tycho.nsa.gov>
In-Reply-To: <50AFA132.5020904@tycho.nsa.gov>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


________________________________________
From: Daniel De Graaf [dgdegra@tycho.nsa.gov]
Sent: Friday, November 23, 2012 11:15 AM
To: Ian Campbell
Cc: Fioravante, Matthew E.; xen-devel@lists.xen.org
Subject: Re: [PATCH RFC] stubdom: Change vTPM shared page ABI

On 11/23/2012 06:04 AM, Ian Campbell wrote:
> On Tue, 2012-11-20 at 16:16 +0000, Fioravante, Matthew E. wrote:
>> This was something I've been wanting to do for a while so I'm very
>> happy you went ahead and fixed it yourself. Once you submit the linux
>> version I'll test it on my system.
>>
>> Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>
> Do we need to synchronise with anything else (Linux drivers?) or I can I
> just throw this into the tree once it is done?

I think the only Linux drivers are the ones that were just posted, and the
ones for XenLinux 2.6.18. Assuming the modified Linux module that I posted
works as it should, the v2 version will be the only one upstream.

> Are we hanging any existing users of the tpm stuff out to dry? Could we
> get a feature-protocol-v2 flag in xenstore so users at least get an
> error message from either the front or backend to give a hint why it
> isn't working?

I suppose we could do that, although I'm not sure the "feature-" prefix is
appropriate, since the code doesn't have the ability to fall back to v1.

I'd rather just let existing users hang out to dry. First off there aren't really 
any existing users. Anyone who is or might be a user is probably following 
these threads closely. Second the xen tpm driver hasn't even been 
accepted into linux yet so there really is not any "official" version 1.

I can update the documentation to state the requirements on the new
tpm driver version so that nobody tries to use the old version in the
xen 2.6.18 tree.

>>  void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)  {
>> -   tpmif_tx_request_t* tx;
>> -   int offset;
>> -   int i;
>> -   uint32_t domid;
>> -   int tocopy;
>> +   vtpm_shared_page_t* shr;
>> +   unsigned int offset;
>>     int flags;
>> +#ifdef TPMBACK_PRINT_DEBUG
>> +int i;
>> +#endif
>
> Dodgy indentation? (I saw a bunch of these)

Whoops, I'll have to go fix that. The entire mini-os build is sprinkled with
tabs and spaces mostly at random, so perhaps a generic fix-indent patch is
needed after all the real changes are applied.

>> - * Copyright (c) 2005, IBM Corporation
>> - *
>> - * Author: Stefan Berger, stefanb@us.ibm.com
>> - * Grant table support: Mahadevan Gomathisankaran
>
> Did you really remove everything these guys wrote?

>From this file, yes - unless the #ifndef and header/footer comments count, but
I was under the impression that that is too small to count for copyright, and
is duplicated across the other files in that directory anyway.

>> - * This code has been derived from tools/libxc/xen/io/netif.h
>> - *
>> - * Copyright (c) 2003-2004, Keir Fraser
>
> I guess I can buy this bit no longer being true given that you reworked
> the whole protocol.
>
> Ian

Basically, the file is a rewrite, although not detected by git/hg as such. I can
add an authorship line if that would be helpful (I see that's normal in other
header files).

--
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 13:15:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 13:15:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcyWJ-0004Cg-RY; Mon, 26 Nov 2012 13:14:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TcyWI-0004Cb-Dp
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 13:14:42 +0000
Received: from [85.158.137.99:39602] by server-15.bemta-3.messagelabs.com id
	48/FF-23779-14B63B05; Mon, 26 Nov 2012 13:14:41 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-8.tower-217.messagelabs.com!1353935679!13796925!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12098 invoked from network); 26 Nov 2012 13:14:40 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-8.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 13:14:40 -0000
Received: from ([128.244.198.90])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158061354;
	Mon, 26 Nov 2012 08:14:36 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas1.dom1.jhuapl.edu ([128.244.198.90]) with mapi; Mon, 26 Nov 2012
	08:13:52 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>, Daniel De Graaf
	<dgdegra@tycho.nsa.gov>, Ian Campbell <Ian.Campbell@citrix.com>
Date: Mon, 26 Nov 2012 08:11:10 -0500
Thread-Topic: [PATCH RFC] stubdom: Change vTPM shared page ABI
Thread-Index: Ac3Jlbsf2pnujzSXRS2R9LyYJsnSwQCQKsPWAABGqjM=
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48B78C3E49@aplesstripe.dom1.jhuapl.edu>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
	<1353668646.13542.228.camel@zakaz.uk.xensource.com>,
	<50AFA132.5020904@tycho.nsa.gov>,
	<068F06DC4D106941B297C0C5F9F446EA48B78C3E48@aplesstripe.dom1.jhuapl.edu>
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48B78C3E48@aplesstripe.dom1.jhuapl.edu>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ok outlook web email client is horrible. My reply was:

>> Are we hanging any existing users of the tpm stuff out to dry? Could we
>> get a feature-protocol-v2 flag in xenstore so users at least get an
>> error message from either the front or backend to give a hint why it
>> isn't working?

>I suppose we could do that, although I'm not sure the "feature-" prefix is
>appropriate, since the code doesn't have the ability to fall back to v1.

I'd rather just let existing users hang out to dry. First off there aren't really 
any existing users. Anyone who is or might be a user of the new code is 
probably following these threads closely. Second the xen tpm driver 
hasn't even been accepted into linux yet so there really is not any 
"official" version 1.

I can update the documentation to state the requirements on the new
tpm driver version in the current linux tree so that nobody tries to use the old version in the
xen 2.6.18 tree.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 13:15:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 13:15:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcyWJ-0004Cg-RY; Mon, 26 Nov 2012 13:14:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TcyWI-0004Cb-Dp
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 13:14:42 +0000
Received: from [85.158.137.99:39602] by server-15.bemta-3.messagelabs.com id
	48/FF-23779-14B63B05; Mon, 26 Nov 2012 13:14:41 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-8.tower-217.messagelabs.com!1353935679!13796925!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12098 invoked from network); 26 Nov 2012 13:14:40 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-8.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 13:14:40 -0000
Received: from ([128.244.198.90])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158061354;
	Mon, 26 Nov 2012 08:14:36 -0500
Received: from aplesstripe.dom1.jhuapl.edu ([128.244.198.211]) by
	aplexcas1.dom1.jhuapl.edu ([128.244.198.90]) with mapi; Mon, 26 Nov 2012
	08:13:52 -0500
From: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>
To: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>, Daniel De Graaf
	<dgdegra@tycho.nsa.gov>, Ian Campbell <Ian.Campbell@citrix.com>
Date: Mon, 26 Nov 2012 08:11:10 -0500
Thread-Topic: [PATCH RFC] stubdom: Change vTPM shared page ABI
Thread-Index: Ac3Jlbsf2pnujzSXRS2R9LyYJsnSwQCQKsPWAABGqjM=
Message-ID: <068F06DC4D106941B297C0C5F9F446EA48B78C3E49@aplesstripe.dom1.jhuapl.edu>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
	<1353668646.13542.228.camel@zakaz.uk.xensource.com>,
	<50AFA132.5020904@tycho.nsa.gov>,
	<068F06DC4D106941B297C0C5F9F446EA48B78C3E48@aplesstripe.dom1.jhuapl.edu>
In-Reply-To: <068F06DC4D106941B297C0C5F9F446EA48B78C3E48@aplesstripe.dom1.jhuapl.edu>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ok outlook web email client is horrible. My reply was:

>> Are we hanging any existing users of the tpm stuff out to dry? Could we
>> get a feature-protocol-v2 flag in xenstore so users at least get an
>> error message from either the front or backend to give a hint why it
>> isn't working?

>I suppose we could do that, although I'm not sure the "feature-" prefix is
>appropriate, since the code doesn't have the ability to fall back to v1.

I'd rather just let existing users hang out to dry. First off there aren't really 
any existing users. Anyone who is or might be a user of the new code is 
probably following these threads closely. Second the xen tpm driver 
hasn't even been accepted into linux yet so there really is not any 
"official" version 1.

I can update the documentation to state the requirements on the new
tpm driver version in the current linux tree so that nobody tries to use the old version in the
xen 2.6.18 tree.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 13:21:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 13:21:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tcycu-0004Mr-Np; Mon, 26 Nov 2012 13:21:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>) id 1Tcyct-0004Mk-5q
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 13:21:31 +0000
Received: from [193.109.254.147:10821] by server-11.bemta-14.messagelabs.com
	id CF/F3-29027-ADC63B05; Mon, 26 Nov 2012 13:21:30 +0000
X-Env-Sender: ijc@hellion.org.uk
X-Msg-Ref: server-12.tower-27.messagelabs.com!1353936086!8573915!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23255 invoked from network); 26 Nov 2012 13:21:27 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2012 13:21:27 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1Tcyco-00017f-Fx; Mon, 26 Nov 2012 13:21:26 +0000
Received: from firewall.ctxuk.citrix.com ([46.33.159.2] helo=[10.80.2.42])
	by hopkins.hellion.org.uk with esmtpsa (SSL3.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <ijc@hellion.org.uk>)
	id 1Tcycl-0006Oq-GW; Mon, 26 Nov 2012 13:21:26 +0000
Message-ID: <1353936077.5830.30.camel@zakaz.uk.xensource.com>
From: Ian Campbell <ijc@hellion.org.uk>
To: xen-devel@lists.xen.org
Date: Mon, 26 Nov 2012 13:21:17 +0000
X-Mailer: Evolution 3.4.4-1 
Mime-Version: 1.0
X-SA-Exim-Connect-IP: 46.33.159.2
X-SA-Exim-Mail-From: ijc@hellion.org.uk
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: Jan Beulich <JBeulich@suse.com>,
	debian-kernel <debian-kernel@lists.debian.org>
Subject: [Xen-devel] pvops microcode support for AMD FAM >= 15
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Debian has decided to take Jeremy's microcode patch [0] as an interim
measure for their next release. (TL;DR -- Debian is shipping pvops Linux
3.2 and Xen 4.1 in the next release. See http://bugs.debian.org/693053
and https://lists.debian.org/debian-devel/2012/11/msg00141.html for some
more background).

However the patch is a bit old and predates the use introduction of
separate firmware files for AMD family >= 15h. Looking at the SuSE
forward ported classic Xen patches it seems like the following patch is
all that is required. But it seems a little too simple to be true and I
don't have any such processors to test on.

Jan, can you recall if it really is that easy on the kernel side ;-)

Ian.

[0]
http://git.kernel.org/?p=linux/kernel/git/jeremy/xen.git;a=shortlog;h=refs/heads/upstream/microcode

commit 109cf37876567ef346c0ecde8b473e7ad1e74e07
Author: Ian Campbell <ijc@hellion.org.uk>
Date:   Mon Nov 26 09:41:02 2012 +0000

    microcode_xen: Add support for AMD family >= 15h
    
    Signed-off-by: Ian Campbell <ijc@hellion.org.uk>

diff --git a/arch/x86/kernel/microcode_xen.c b/arch/x86/kernel/microcode_xen.c
index 9d2a06b..2b8a78a 100644
--- a/arch/x86/kernel/microcode_xen.c
+++ b/arch/x86/kernel/microcode_xen.c
@@ -74,7 +74,11 @@ static enum ucode_state xen_request_microcode_fw(int cpu, struct device *device)
 		break;
 
 	case X86_VENDOR_AMD:
-		snprintf(name, sizeof(name), "amd-ucode/microcode_amd.bin");
+		/* Beginning with family 15h AMD uses family-specific firmware files. */
+		if (c->x86 >= 0x15)
+			snprintf(name, sizeof(name), "amd-ucode/microcode_amd_fam%.2xh.bin", c->x86);
+		else
+			snprintf(name, sizeof(name), "amd-ucode/microcode_amd.bin");
 		break;
 
 	default:


-- 
Ian Campbell
Current Noise: Dew-Scented - Metal Militia

Now KEN and BARBIE are PERMANENTLY ADDICTED to MIND-ALTERING DRUGS ...


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 13:21:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 13:21:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tcycu-0004Mr-Np; Mon, 26 Nov 2012 13:21:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>) id 1Tcyct-0004Mk-5q
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 13:21:31 +0000
Received: from [193.109.254.147:10821] by server-11.bemta-14.messagelabs.com
	id CF/F3-29027-ADC63B05; Mon, 26 Nov 2012 13:21:30 +0000
X-Env-Sender: ijc@hellion.org.uk
X-Msg-Ref: server-12.tower-27.messagelabs.com!1353936086!8573915!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23255 invoked from network); 26 Nov 2012 13:21:27 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2012 13:21:27 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1Tcyco-00017f-Fx; Mon, 26 Nov 2012 13:21:26 +0000
Received: from firewall.ctxuk.citrix.com ([46.33.159.2] helo=[10.80.2.42])
	by hopkins.hellion.org.uk with esmtpsa (SSL3.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <ijc@hellion.org.uk>)
	id 1Tcycl-0006Oq-GW; Mon, 26 Nov 2012 13:21:26 +0000
Message-ID: <1353936077.5830.30.camel@zakaz.uk.xensource.com>
From: Ian Campbell <ijc@hellion.org.uk>
To: xen-devel@lists.xen.org
Date: Mon, 26 Nov 2012 13:21:17 +0000
X-Mailer: Evolution 3.4.4-1 
Mime-Version: 1.0
X-SA-Exim-Connect-IP: 46.33.159.2
X-SA-Exim-Mail-From: ijc@hellion.org.uk
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: Jan Beulich <JBeulich@suse.com>,
	debian-kernel <debian-kernel@lists.debian.org>
Subject: [Xen-devel] pvops microcode support for AMD FAM >= 15
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Debian has decided to take Jeremy's microcode patch [0] as an interim
measure for their next release. (TL;DR -- Debian is shipping pvops Linux
3.2 and Xen 4.1 in the next release. See http://bugs.debian.org/693053
and https://lists.debian.org/debian-devel/2012/11/msg00141.html for some
more background).

However the patch is a bit old and predates the use introduction of
separate firmware files for AMD family >= 15h. Looking at the SuSE
forward ported classic Xen patches it seems like the following patch is
all that is required. But it seems a little too simple to be true and I
don't have any such processors to test on.

Jan, can you recall if it really is that easy on the kernel side ;-)

Ian.

[0]
http://git.kernel.org/?p=linux/kernel/git/jeremy/xen.git;a=shortlog;h=refs/heads/upstream/microcode

commit 109cf37876567ef346c0ecde8b473e7ad1e74e07
Author: Ian Campbell <ijc@hellion.org.uk>
Date:   Mon Nov 26 09:41:02 2012 +0000

    microcode_xen: Add support for AMD family >= 15h
    
    Signed-off-by: Ian Campbell <ijc@hellion.org.uk>

diff --git a/arch/x86/kernel/microcode_xen.c b/arch/x86/kernel/microcode_xen.c
index 9d2a06b..2b8a78a 100644
--- a/arch/x86/kernel/microcode_xen.c
+++ b/arch/x86/kernel/microcode_xen.c
@@ -74,7 +74,11 @@ static enum ucode_state xen_request_microcode_fw(int cpu, struct device *device)
 		break;
 
 	case X86_VENDOR_AMD:
-		snprintf(name, sizeof(name), "amd-ucode/microcode_amd.bin");
+		/* Beginning with family 15h AMD uses family-specific firmware files. */
+		if (c->x86 >= 0x15)
+			snprintf(name, sizeof(name), "amd-ucode/microcode_amd_fam%.2xh.bin", c->x86);
+		else
+			snprintf(name, sizeof(name), "amd-ucode/microcode_amd.bin");
 		break;
 
 	default:


-- 
Ian Campbell
Current Noise: Dew-Scented - Metal Militia

Now KEN and BARBIE are PERMANENTLY ADDICTED to MIND-ALTERING DRUGS ...


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 13:39:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 13:39:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tcytn-0004Zc-D9; Mon, 26 Nov 2012 13:38:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tcytl-0004ZX-GF
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 13:38:57 +0000
Received: from [85.158.137.99:3577] by server-15.bemta-3.messagelabs.com id
	A2/3F-23779-0F073B05; Mon, 26 Nov 2012 13:38:56 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1353937107!20637577!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4742 invoked from network); 26 Nov 2012 13:38:28 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-217.messagelabs.com with SMTP;
	26 Nov 2012 13:38:28 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 13:38:27 +0000
Message-Id: <50B37F1802000078000AB1AE@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 13:39:20 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dietmar Hahn" <dietmar.hahn@ts.fujitsu.com>
References: <1449364.BXBucXMpuY@amur>
In-Reply-To: <1449364.BXBucXMpuY@amur>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] oprofile: Add X7542 and E7-8837 to the list
 of supported cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 13:52, Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> wrote:
> Add intel cpus X7542 and E7-8837 to the list of supported cpus.

I suppose these two random additions originate from whatever
you happen to run your code on? To be honest, I'd prefer the list
here to actually be put into proper shape...

Jan

> Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
> 
> diff -r 0049de3827bc -r 6fb0129600cd xen/arch/x86/oprofile/nmi_int.c
> --- a/xen/arch/x86/oprofile/nmi_int.c   Fri Nov 23 11:06:15 2012 +0000
> +++ b/xen/arch/x86/oprofile/nmi_int.c   Mon Nov 26 13:36:00 2012 +0100
> @@ -366,6 +366,8 @@ static int __init ppro_init(char ** cpu_
>                 ppro_has_global_ctrl = 1;
>                 break;
>         case 26:
> +       case 46:
> +       case 47:
>                 arch_perfmon_setup_counters();
>                 *cpu_type = "i386/core_i7";
>                 ppro_has_global_ctrl = 1;
> 
> 
> -- 
> Company details: http://ts.fujitsu.com/imprint.html 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 13:39:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 13:39:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tcytn-0004Zc-D9; Mon, 26 Nov 2012 13:38:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tcytl-0004ZX-GF
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 13:38:57 +0000
Received: from [85.158.137.99:3577] by server-15.bemta-3.messagelabs.com id
	A2/3F-23779-0F073B05; Mon, 26 Nov 2012 13:38:56 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1353937107!20637577!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4742 invoked from network); 26 Nov 2012 13:38:28 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-217.messagelabs.com with SMTP;
	26 Nov 2012 13:38:28 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 13:38:27 +0000
Message-Id: <50B37F1802000078000AB1AE@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 13:39:20 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dietmar Hahn" <dietmar.hahn@ts.fujitsu.com>
References: <1449364.BXBucXMpuY@amur>
In-Reply-To: <1449364.BXBucXMpuY@amur>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] oprofile: Add X7542 and E7-8837 to the list
 of supported cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 13:52, Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> wrote:
> Add intel cpus X7542 and E7-8837 to the list of supported cpus.

I suppose these two random additions originate from whatever
you happen to run your code on? To be honest, I'd prefer the list
here to actually be put into proper shape...

Jan

> Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
> 
> diff -r 0049de3827bc -r 6fb0129600cd xen/arch/x86/oprofile/nmi_int.c
> --- a/xen/arch/x86/oprofile/nmi_int.c   Fri Nov 23 11:06:15 2012 +0000
> +++ b/xen/arch/x86/oprofile/nmi_int.c   Mon Nov 26 13:36:00 2012 +0100
> @@ -366,6 +366,8 @@ static int __init ppro_init(char ** cpu_
>                 ppro_has_global_ctrl = 1;
>                 break;
>         case 26:
> +       case 46:
> +       case 47:
>                 arch_perfmon_setup_counters();
>                 *cpu_type = "i386/core_i7";
>                 ppro_has_global_ctrl = 1;
> 
> 
> -- 
> Company details: http://ts.fujitsu.com/imprint.html 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 13:44:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 13:44:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcyyW-0004iC-3i; Mon, 26 Nov 2012 13:43:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TcyyV-0004i6-2P
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 13:43:51 +0000
Received: from [85.158.137.99:19621] by server-7.bemta-3.messagelabs.com id
	19/F4-01713-61273B05; Mon, 26 Nov 2012 13:43:50 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1353937429!17487544!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16750 invoked from network); 26 Nov 2012 13:43:49 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-217.messagelabs.com with SMTP;
	26 Nov 2012 13:43:49 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 13:43:49 +0000
Message-Id: <50B3805A02000078000AB1B8@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 13:44:42 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <ijc@hellion.org.uk>
References: <1353936077.5830.30.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353936077.5830.30.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org, debian-kernel <debian-kernel@lists.debian.org>
Subject: Re: [Xen-devel] pvops microcode support for AMD FAM >= 15
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 14:21, Ian Campbell <ijc@hellion.org.uk> wrote:
> Debian has decided to take Jeremy's microcode patch [0] as an interim
> measure for their next release. (TL;DR -- Debian is shipping pvops Linux
> 3.2 and Xen 4.1 in the next release. See http://bugs.debian.org/693053 
> and https://lists.debian.org/debian-devel/2012/11/msg00141.html for some
> more background).
> 
> However the patch is a bit old and predates the use introduction of
> separate firmware files for AMD family >= 15h. Looking at the SuSE
> forward ported classic Xen patches it seems like the following patch is
> all that is required. But it seems a little too simple to be true and I
> don't have any such processors to test on.
> 
> Jan, can you recall if it really is that easy on the kernel side ;-)

While so far I didn't myself run anything on post-Fam10 systems
either, it really ought to be that easy - the patch format didn't
change, it's just that they decided to spit the files by family to
keep them manageable.

The only other thing to check for is that you don't have any
artificial size restriction left in that code (I think patch files early
on were limited to 4k in size, and that got lifted during the last
couple of years).

The hypervisor is really going to take care of all other aspects
here.

Jan

> [0]
> http://git.kernel.org/?p=linux/kernel/git/jeremy/xen.git;a=shortlog;h=refs/h 
> eads/upstream/microcode
> 
> commit 109cf37876567ef346c0ecde8b473e7ad1e74e07
> Author: Ian Campbell <ijc@hellion.org.uk>
> Date:   Mon Nov 26 09:41:02 2012 +0000
> 
>     microcode_xen: Add support for AMD family >= 15h
>     
>     Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
> 
> diff --git a/arch/x86/kernel/microcode_xen.c 
> b/arch/x86/kernel/microcode_xen.c
> index 9d2a06b..2b8a78a 100644
> --- a/arch/x86/kernel/microcode_xen.c
> +++ b/arch/x86/kernel/microcode_xen.c
> @@ -74,7 +74,11 @@ static enum ucode_state xen_request_microcode_fw(int cpu, 
> struct device *device)
>  		break;
>  
>  	case X86_VENDOR_AMD:
> -		snprintf(name, sizeof(name), "amd-ucode/microcode_amd.bin");
> +		/* Beginning with family 15h AMD uses family-specific firmware files. */
> +		if (c->x86 >= 0x15)
> +			snprintf(name, sizeof(name), "amd-ucode/microcode_amd_fam%.2xh.bin", 
> c->x86);
> +		else
> +			snprintf(name, sizeof(name), "amd-ucode/microcode_amd.bin");
>  		break;
>  
>  	default:
> 
> 
> -- 
> Ian Campbell
> Current Noise: Dew-Scented - Metal Militia
> 
> Now KEN and BARBIE are PERMANENTLY ADDICTED to MIND-ALTERING DRUGS ...




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 13:44:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 13:44:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TcyyW-0004iC-3i; Mon, 26 Nov 2012 13:43:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TcyyV-0004i6-2P
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 13:43:51 +0000
Received: from [85.158.137.99:19621] by server-7.bemta-3.messagelabs.com id
	19/F4-01713-61273B05; Mon, 26 Nov 2012 13:43:50 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1353937429!17487544!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16750 invoked from network); 26 Nov 2012 13:43:49 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-217.messagelabs.com with SMTP;
	26 Nov 2012 13:43:49 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 13:43:49 +0000
Message-Id: <50B3805A02000078000AB1B8@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 13:44:42 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <ijc@hellion.org.uk>
References: <1353936077.5830.30.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353936077.5830.30.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org, debian-kernel <debian-kernel@lists.debian.org>
Subject: Re: [Xen-devel] pvops microcode support for AMD FAM >= 15
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 14:21, Ian Campbell <ijc@hellion.org.uk> wrote:
> Debian has decided to take Jeremy's microcode patch [0] as an interim
> measure for their next release. (TL;DR -- Debian is shipping pvops Linux
> 3.2 and Xen 4.1 in the next release. See http://bugs.debian.org/693053 
> and https://lists.debian.org/debian-devel/2012/11/msg00141.html for some
> more background).
> 
> However the patch is a bit old and predates the use introduction of
> separate firmware files for AMD family >= 15h. Looking at the SuSE
> forward ported classic Xen patches it seems like the following patch is
> all that is required. But it seems a little too simple to be true and I
> don't have any such processors to test on.
> 
> Jan, can you recall if it really is that easy on the kernel side ;-)

While so far I didn't myself run anything on post-Fam10 systems
either, it really ought to be that easy - the patch format didn't
change, it's just that they decided to spit the files by family to
keep them manageable.

The only other thing to check for is that you don't have any
artificial size restriction left in that code (I think patch files early
on were limited to 4k in size, and that got lifted during the last
couple of years).

The hypervisor is really going to take care of all other aspects
here.

Jan

> [0]
> http://git.kernel.org/?p=linux/kernel/git/jeremy/xen.git;a=shortlog;h=refs/h 
> eads/upstream/microcode
> 
> commit 109cf37876567ef346c0ecde8b473e7ad1e74e07
> Author: Ian Campbell <ijc@hellion.org.uk>
> Date:   Mon Nov 26 09:41:02 2012 +0000
> 
>     microcode_xen: Add support for AMD family >= 15h
>     
>     Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
> 
> diff --git a/arch/x86/kernel/microcode_xen.c 
> b/arch/x86/kernel/microcode_xen.c
> index 9d2a06b..2b8a78a 100644
> --- a/arch/x86/kernel/microcode_xen.c
> +++ b/arch/x86/kernel/microcode_xen.c
> @@ -74,7 +74,11 @@ static enum ucode_state xen_request_microcode_fw(int cpu, 
> struct device *device)
>  		break;
>  
>  	case X86_VENDOR_AMD:
> -		snprintf(name, sizeof(name), "amd-ucode/microcode_amd.bin");
> +		/* Beginning with family 15h AMD uses family-specific firmware files. */
> +		if (c->x86 >= 0x15)
> +			snprintf(name, sizeof(name), "amd-ucode/microcode_amd_fam%.2xh.bin", 
> c->x86);
> +		else
> +			snprintf(name, sizeof(name), "amd-ucode/microcode_amd.bin");
>  		break;
>  
>  	default:
> 
> 
> -- 
> Ian Campbell
> Current Noise: Dew-Scented - Metal Militia
> 
> Now KEN and BARBIE are PERMANENTLY ADDICTED to MIND-ALTERING DRUGS ...




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 13:46:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 13:46:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tcz0W-0004po-S2; Mon, 26 Nov 2012 13:45:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <s.munaut@whatever-company.com>) id 1Tcz0V-0004pf-FP
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 13:45:55 +0000
Received: from [85.158.139.211:25102] by server-6.bemta-5.messagelabs.com id
	F5/9F-19321-29273B05; Mon, 26 Nov 2012 13:45:54 +0000
X-Env-Sender: s.munaut@whatever-company.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1353937552!19598711!1
X-Originating-IP: [209.85.219.45]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27501 invoked from network); 26 Nov 2012 13:45:54 -0000
Received: from mail-oa0-f45.google.com (HELO mail-oa0-f45.google.com)
	(209.85.219.45)
	by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 13:45:54 -0000
Received: by mail-oa0-f45.google.com with SMTP id i18so13019943oag.32
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 05:45:52 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=hEsjZgtJ6OXtEUGL3JeCweOOzWxnBzplSN1+hgvLiJs=;
	b=CwFNKMg8z6VNvZkQfsUM3/O2Wp4u388L2oEgogCXVJdj9EMJRiMmZ+fcO+EjZHNqPM
	6hNlQMrXOehHL0f3EEMPubhKl9FPQbHiSIGh+eYWKvycH3CFY51DOTX+V2RdkA25bZib
	JhYoR02/4n3I/uOryAqNqsKhD8R+FCrCiiElp6LOQOsoFCVZNtFRzikNq3isNthHIhdi
	2xYBkozVxtygTQWD+PayyFlklWyy038/o1OMzYF5D20afD4jlVNzuon4EI2UbXGvBeCn
	Wq6utUFBFWVuKUpzanvLAXQa0uBK+Q/5DAyXWJN3XcfCQjCw4a1Dj+X3cIlWla/m+l10
	gD0w==
MIME-Version: 1.0
Received: by 10.60.172.48 with SMTP id az16mr9020214oec.64.1353937552542; Mon,
	26 Nov 2012 05:45:52 -0800 (PST)
Received: by 10.76.28.234 with HTTP; Mon, 26 Nov 2012 05:45:52 -0800 (PST)
In-Reply-To: <50A27A37.2090506@citrix.com>
References: <CAF6-1L51R5yMBNO1wQe7YWoeGoM_bFJcAb0XN0cVg6cm7+Kzaw@mail.gmail.com>
	<1352363172.12977.87.camel@hastur.hellion.org.uk>
	<509D22E6.2090005@citrix.com> <50A27A37.2090506@citrix.com>
Date: Mon, 26 Nov 2012 14:45:52 +0100
Message-ID: <CAF6-1L7q-m00CVTMPx4ySWuSBqqwnfP+-=Wz92Nh1C6_2RQ82A@mail.gmail.com>
From: Sylvain Munaut <s.munaut@whatever-company.com>
To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
X-Gm-Message-State: ALoCoQli/GO/A0xuzyi+DnuWsbkg8lNuuFGDj78nGkFVsxBNYoK95Mkr0cE/Pnb84JQlhTAtyEys
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Custom block script started twice for root block
 but only stopped once
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

Sorry for the delayed response, I didn't see anyone had answered ...
bad mail tagging rules.

For the moment I still have to use Xen 4.1.3 shipped with Debian, so
I'm still under the XM toolset and there is no -vvv AFAICT.

Cheers,

    Sylvain

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 13:46:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 13:46:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tcz0W-0004po-S2; Mon, 26 Nov 2012 13:45:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <s.munaut@whatever-company.com>) id 1Tcz0V-0004pf-FP
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 13:45:55 +0000
Received: from [85.158.139.211:25102] by server-6.bemta-5.messagelabs.com id
	F5/9F-19321-29273B05; Mon, 26 Nov 2012 13:45:54 +0000
X-Env-Sender: s.munaut@whatever-company.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1353937552!19598711!1
X-Originating-IP: [209.85.219.45]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27501 invoked from network); 26 Nov 2012 13:45:54 -0000
Received: from mail-oa0-f45.google.com (HELO mail-oa0-f45.google.com)
	(209.85.219.45)
	by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 13:45:54 -0000
Received: by mail-oa0-f45.google.com with SMTP id i18so13019943oag.32
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 05:45:52 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=hEsjZgtJ6OXtEUGL3JeCweOOzWxnBzplSN1+hgvLiJs=;
	b=CwFNKMg8z6VNvZkQfsUM3/O2Wp4u388L2oEgogCXVJdj9EMJRiMmZ+fcO+EjZHNqPM
	6hNlQMrXOehHL0f3EEMPubhKl9FPQbHiSIGh+eYWKvycH3CFY51DOTX+V2RdkA25bZib
	JhYoR02/4n3I/uOryAqNqsKhD8R+FCrCiiElp6LOQOsoFCVZNtFRzikNq3isNthHIhdi
	2xYBkozVxtygTQWD+PayyFlklWyy038/o1OMzYF5D20afD4jlVNzuon4EI2UbXGvBeCn
	Wq6utUFBFWVuKUpzanvLAXQa0uBK+Q/5DAyXWJN3XcfCQjCw4a1Dj+X3cIlWla/m+l10
	gD0w==
MIME-Version: 1.0
Received: by 10.60.172.48 with SMTP id az16mr9020214oec.64.1353937552542; Mon,
	26 Nov 2012 05:45:52 -0800 (PST)
Received: by 10.76.28.234 with HTTP; Mon, 26 Nov 2012 05:45:52 -0800 (PST)
In-Reply-To: <50A27A37.2090506@citrix.com>
References: <CAF6-1L51R5yMBNO1wQe7YWoeGoM_bFJcAb0XN0cVg6cm7+Kzaw@mail.gmail.com>
	<1352363172.12977.87.camel@hastur.hellion.org.uk>
	<509D22E6.2090005@citrix.com> <50A27A37.2090506@citrix.com>
Date: Mon, 26 Nov 2012 14:45:52 +0100
Message-ID: <CAF6-1L7q-m00CVTMPx4ySWuSBqqwnfP+-=Wz92Nh1C6_2RQ82A@mail.gmail.com>
From: Sylvain Munaut <s.munaut@whatever-company.com>
To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
X-Gm-Message-State: ALoCoQli/GO/A0xuzyi+DnuWsbkg8lNuuFGDj78nGkFVsxBNYoK95Mkr0cE/Pnb84JQlhTAtyEys
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Custom block script started twice for root block
 but only stopped once
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

Sorry for the delayed response, I didn't see anyone had answered ...
bad mail tagging rules.

For the moment I still have to use Xen 4.1.3 shipped with Debian, so
I'm still under the XM toolset and there is no -vvv AFAICT.

Cheers,

    Sylvain

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 14:01:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 14:01:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TczFS-0005AF-HV; Mon, 26 Nov 2012 14:01:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1TczFR-0005A2-F3; Mon, 26 Nov 2012 14:01:21 +0000
Received: from [85.158.143.35:26018] by server-2.bemta-4.messagelabs.com id
	EC/AC-28922-03673B05; Mon, 26 Nov 2012 14:01:20 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1353938469!6289102!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11340 invoked from network); 26 Nov 2012 14:01:10 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 14:01:10 -0000
X-IronPort-AV: E=Sophos;i="4.83,320,1352073600"; d="scan'208";a="16001324"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 14:01:09 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Mon, 26 Nov 2012
	14:01:09 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Mon, 26 Nov 2012 14:01:09 +0000
Thread-Topic: [Xen-devel] [PATCH 00 of 15] libxl: ocaml: improve the bindings
Thread-Index: Ac3HRAlCgWCsnrOgSRumLzIrPcu6TAEl+qzQ
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107A1@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 00 of 15] libxl: ocaml: improve the bindings
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi Ian,

> The following series makes the libxl ocaml bindings somewhat more useful
> (for some small value of useful).

Great timing: I am currently investigating how to port xenopsd/xapi to libxl (for XCP and XenServer), and have been playing with these bindings as well. I indeed noticed a few shortcomings and omissions.
 
> As well as defining some of the more useful types in the bindings they
> switch to a model of long lived libxl contexts rather than per-call ones. This
> is necessary to use the stuff like events, signal handling etc.

I think that is a good idea.

> I got half way through implementing a useful binding for building a domain
> before I got distracted by other things, hence posting what I have. Most of
> the early part of the series could go in, the last couple of patches probably
> need more work.
> 
> There are plenty of code paths here which have never been even slightly
> exercised. This is true of these bindings in general I think.

I'll use your patches as a base for my own improvements to the bindings. Thanks for releasing these.

Cheers,
Rob

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 14:01:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 14:01:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TczFS-0005AF-HV; Mon, 26 Nov 2012 14:01:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1TczFR-0005A2-F3; Mon, 26 Nov 2012 14:01:21 +0000
Received: from [85.158.143.35:26018] by server-2.bemta-4.messagelabs.com id
	EC/AC-28922-03673B05; Mon, 26 Nov 2012 14:01:20 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1353938469!6289102!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11340 invoked from network); 26 Nov 2012 14:01:10 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 14:01:10 -0000
X-IronPort-AV: E=Sophos;i="4.83,320,1352073600"; d="scan'208";a="16001324"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 14:01:09 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Mon, 26 Nov 2012
	14:01:09 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Mon, 26 Nov 2012 14:01:09 +0000
Thread-Topic: [Xen-devel] [PATCH 00 of 15] libxl: ocaml: improve the bindings
Thread-Index: Ac3HRAlCgWCsnrOgSRumLzIrPcu6TAEl+qzQ
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107A1@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1353432200@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 00 of 15] libxl: ocaml: improve the bindings
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi Ian,

> The following series makes the libxl ocaml bindings somewhat more useful
> (for some small value of useful).

Great timing: I am currently investigating how to port xenopsd/xapi to libxl (for XCP and XenServer), and have been playing with these bindings as well. I indeed noticed a few shortcomings and omissions.
 
> As well as defining some of the more useful types in the bindings they
> switch to a model of long lived libxl contexts rather than per-call ones. This
> is necessary to use the stuff like events, signal handling etc.

I think that is a good idea.

> I got half way through implementing a useful binding for building a domain
> before I got distracted by other things, hence posting what I have. Most of
> the early part of the series could go in, the last couple of patches probably
> need more work.
> 
> There are plenty of code paths here which have never been even slightly
> exercised. This is true of these bindings in general I think.

I'll use your patches as a base for my own improvements to the bindings. Thanks for releasing these.

Cheers,
Rob

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 14:14:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 14:14:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TczRv-0005aS-15; Mon, 26 Nov 2012 14:14:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>) id 1TczRt-0005aN-DX
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 14:14:13 +0000
Received: from [85.158.139.211:44160] by server-1.bemta-5.messagelabs.com id
	9A/16-21985-43973B05; Mon, 26 Nov 2012 14:14:12 +0000
X-Env-Sender: ijc@hellion.org.uk
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353939251!21552601!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2952 invoked from network); 26 Nov 2012 14:14:12 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2012 14:14:12 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1TczRW-0001bC-JX; Mon, 26 Nov 2012 14:13:50 +0000
Received: from firewall.ctxuk.citrix.com ([46.33.159.2] helo=[10.80.2.42])
	by hopkins.hellion.org.uk with esmtpsa (SSL3.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <ijc@hellion.org.uk>)
	id 1TczRQ-0006Zc-Ec; Mon, 26 Nov 2012 14:13:50 +0000
Message-ID: <1353939218.5830.34.camel@zakaz.uk.xensource.com>
From: Ian Campbell <ijc@hellion.org.uk>
To: Jan Beulich <JBeulich@suse.com>
Date: Mon, 26 Nov 2012 14:13:38 +0000
In-Reply-To: <50B3805A02000078000AB1B8@nat28.tlf.novell.com>
References: <1353936077.5830.30.camel@zakaz.uk.xensource.com>
	<50B3805A02000078000AB1B8@nat28.tlf.novell.com>
X-Mailer: Evolution 3.4.4-1 
Mime-Version: 1.0
X-SA-Exim-Connect-IP: 46.33.159.2
X-SA-Exim-Mail-From: ijc@hellion.org.uk
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: debian-kernel <debian-kernel@lists.debian.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] pvops microcode support for AMD FAM >= 15
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 13:44 +0000, Jan Beulich wrote:
> >>> On 26.11.12 at 14:21, Ian Campbell <ijc@hellion.org.uk> wrote:
> > Debian has decided to take Jeremy's microcode patch [0] as an interim
> > measure for their next release. (TL;DR -- Debian is shipping pvops Linux
> > 3.2 and Xen 4.1 in the next release. See http://bugs.debian.org/693053 
> > and https://lists.debian.org/debian-devel/2012/11/msg00141.html for some
> > more background).
> > 
> > However the patch is a bit old and predates the use introduction of
> > separate firmware files for AMD family >= 15h. Looking at the SuSE
> > forward ported classic Xen patches it seems like the following patch is
> > all that is required. But it seems a little too simple to be true and I
> > don't have any such processors to test on.
> > 
> > Jan, can you recall if it really is that easy on the kernel side ;-)
> 
> While so far I didn't myself run anything on post-Fam10 systems
> either, it really ought to be that easy - the patch format didn't
> change, it's just that they decided to spit the files by family to
> keep them manageable.
> 
> The only other thing to check for is that you don't have any
> artificial size restriction left in that code (I think patch files early
> on were limited to 4k in size, and that got lifted during the last
> couple of years).

I can't find one by inspection, it uses the standard request_firmware
interface and stashes the result in a valloc'd buffer, neither of which
suffer from any 4K related limitations AFAIK.

I'll try and track something more recent down to test but the worst
downside of applying this patch seems to be that something which doesn't
work still doesn't work.

> The hypervisor is really going to take care of all other aspects
> here.

Sweet, thanks.

Ian.

-- 
Ian Campbell
Current Noise: Testament - The Ritual

Chemist who falls in acid will be tripping for weeks.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 14:14:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 14:14:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TczRv-0005aS-15; Mon, 26 Nov 2012 14:14:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>) id 1TczRt-0005aN-DX
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 14:14:13 +0000
Received: from [85.158.139.211:44160] by server-1.bemta-5.messagelabs.com id
	9A/16-21985-43973B05; Mon, 26 Nov 2012 14:14:12 +0000
X-Env-Sender: ijc@hellion.org.uk
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353939251!21552601!1
X-Originating-IP: [212.110.190.137]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2952 invoked from network); 26 Nov 2012 14:14:12 -0000
Received: from benson.vm.bytemark.co.uk (HELO benson.vm.bytemark.co.uk)
	(212.110.190.137)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2012 14:14:12 -0000
Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginmedia.com
	([86.6.25.227] helo=hopkins.hellion.org.uk)
	by benson.vm.bytemark.co.uk with esmtpsa
	(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72)
	(envelope-from <ijc@hellion.org.uk>)
	id 1TczRW-0001bC-JX; Mon, 26 Nov 2012 14:13:50 +0000
Received: from firewall.ctxuk.citrix.com ([46.33.159.2] helo=[10.80.2.42])
	by hopkins.hellion.org.uk with esmtpsa (SSL3.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <ijc@hellion.org.uk>)
	id 1TczRQ-0006Zc-Ec; Mon, 26 Nov 2012 14:13:50 +0000
Message-ID: <1353939218.5830.34.camel@zakaz.uk.xensource.com>
From: Ian Campbell <ijc@hellion.org.uk>
To: Jan Beulich <JBeulich@suse.com>
Date: Mon, 26 Nov 2012 14:13:38 +0000
In-Reply-To: <50B3805A02000078000AB1B8@nat28.tlf.novell.com>
References: <1353936077.5830.30.camel@zakaz.uk.xensource.com>
	<50B3805A02000078000AB1B8@nat28.tlf.novell.com>
X-Mailer: Evolution 3.4.4-1 
Mime-Version: 1.0
X-SA-Exim-Connect-IP: 46.33.159.2
X-SA-Exim-Mail-From: ijc@hellion.org.uk
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on hopkins.hellion.org.uk)
Cc: debian-kernel <debian-kernel@lists.debian.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] pvops microcode support for AMD FAM >= 15
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 13:44 +0000, Jan Beulich wrote:
> >>> On 26.11.12 at 14:21, Ian Campbell <ijc@hellion.org.uk> wrote:
> > Debian has decided to take Jeremy's microcode patch [0] as an interim
> > measure for their next release. (TL;DR -- Debian is shipping pvops Linux
> > 3.2 and Xen 4.1 in the next release. See http://bugs.debian.org/693053 
> > and https://lists.debian.org/debian-devel/2012/11/msg00141.html for some
> > more background).
> > 
> > However the patch is a bit old and predates the use introduction of
> > separate firmware files for AMD family >= 15h. Looking at the SuSE
> > forward ported classic Xen patches it seems like the following patch is
> > all that is required. But it seems a little too simple to be true and I
> > don't have any such processors to test on.
> > 
> > Jan, can you recall if it really is that easy on the kernel side ;-)
> 
> While so far I didn't myself run anything on post-Fam10 systems
> either, it really ought to be that easy - the patch format didn't
> change, it's just that they decided to spit the files by family to
> keep them manageable.
> 
> The only other thing to check for is that you don't have any
> artificial size restriction left in that code (I think patch files early
> on were limited to 4k in size, and that got lifted during the last
> couple of years).

I can't find one by inspection, it uses the standard request_firmware
interface and stashes the result in a valloc'd buffer, neither of which
suffer from any 4K related limitations AFAIK.

I'll try and track something more recent down to test but the worst
downside of applying this patch seems to be that something which doesn't
work still doesn't work.

> The hypervisor is really going to take care of all other aspects
> here.

Sweet, thanks.

Ian.

-- 
Ian Campbell
Current Noise: Testament - The Ritual

Chemist who falls in acid will be tripping for weeks.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 14:16:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 14:16:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TczTM-0005ed-Gn; Mon, 26 Nov 2012 14:15:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <s.munaut@whatever-company.com>) id 1TczTK-0005eT-L5
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 14:15:42 +0000
Received: from [85.158.143.35:50497] by server-3.bemta-4.messagelabs.com id
	EC/0B-06841-D8973B05; Mon, 26 Nov 2012 14:15:41 +0000
X-Env-Sender: s.munaut@whatever-company.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1353939311!13397043!1
X-Originating-IP: [209.85.219.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32423 invoked from network); 26 Nov 2012 14:15:16 -0000
Received: from mail-oa0-f45.google.com (HELO mail-oa0-f45.google.com)
	(209.85.219.45)
	by server-16.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 14:15:16 -0000
Received: by mail-oa0-f45.google.com with SMTP id i18so13081996oag.32
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 06:15:11 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=RZ7nZFGlvllW4n/UmZnyeUjzQEhwzYqfhosrhyoZHuk=;
	b=Ong2cyYzvcTEFrvZyt+tStNS84D1pXdUC5jLgER+btBzX5Aty/8/ANhgnKW0cUHcjO
	vMGb9CAwIUNl9e79Z5P8xmVrFn9iZq5LGwQFwsRyAu49zmSxtRMsPaCwtbGJq//kDxU0
	RNe+Bee7j1hjiSsS6sVBKiok7/l96PmX3Yt2Ycj+t1ktPqptNx9b/K8FubjHiZf9K1hW
	oTdieFyLZyDT5LznDscDfNGC1Ws2dh3xKQon8oZRF5pw5ORh+Fo8jB0AMLcx4p9jxDQL
	nl6Q3wCjdhxa1bQnxYxxi6yZG3KbElpObeo9beDVf0XbYeQPnsBLGsKLylcS4DS6DdVb
	uZSQ==
MIME-Version: 1.0
Received: by 10.60.13.73 with SMTP id f9mr9082452oec.131.1353939310937; Mon,
	26 Nov 2012 06:15:10 -0800 (PST)
Received: by 10.76.28.234 with HTTP; Mon, 26 Nov 2012 06:15:10 -0800 (PST)
In-Reply-To: <FF93AF260AC2BB499A119CC65B092CF731533B8F@sg000713.corproot.net>
References: <CAE17a0XdxhaoCZaDDT6RXm1DPnabf2hWXAnzU5NukHeXX45grA@mail.gmail.com>
	<CCCD845A.44DB0%keir.xen@gmail.com>
	<CAE17a0Xit58cLiJ+pE7uKuCDq3Xn+7-5+iDpV2+5S+TX3yuT+Q@mail.gmail.com>
	<50B3507E02000078000AB0D9@nat28.tlf.novell.com>
	<CAE17a0WpzYTgOa9J-DJCKnQ4VgcoeX1GPtnSN2+jUw34DRNxCg@mail.gmail.com>
	<1353926458.5830.5.camel@zakaz.uk.xensource.com>
	<50B36C0D02000078000AB15B@nat28.tlf.novell.com>
	<FF93AF260AC2BB499A119CC65B092CF731533B8F@sg000713.corproot.net>
Date: Mon, 26 Nov 2012 15:15:10 +0100
Message-ID: <CAF6-1L4SauK+WYQUDB730fnEcr_Lf=9jO76T8Y365fk0hf-ACA@mail.gmail.com>
From: Sylvain Munaut <s.munaut@whatever-company.com>
To: Philippe.Simonet@swisscom.com
X-Gm-Message-State: ALoCoQkJvQEuD3X4fdrKQJodC8ITm1oF01SUaBsjGW/+FhPgGMA9UjfTb23NKl0cttyKVLZflu0W
Cc: ijc@hellion.org.uk, keir.xen@gmail.com, mrsanna1@gmail.com,
	JBeulich@suse.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,


I just wanted to say I've also been hitting this problem for years on
some servers.
That was originally under xen 4.0 when I originally installed the
machines, but even after update to 4.1.3 and more recently a 3.6.4
dom0 kernel, the problem is still present.

More specifically the two hw platforms I'm sure are concerned (hw +
cpu info + debug-key 's' info)

Sun Fire x2250:

    cpu family : 6
    model : 23
    model name : Intel(R) Xeon(R) CPU           L5420  @ 2.50GHz
    stepping : 6
    microcode : 0x60b

(XEN) TSC has constant rate, deep Cstates possible, so not reliable,
warp=3292 (count=1)
(XEN) dom1: mode=0,ofs=0x56eb699774,khz=2500128,inc=1,vtsc count:
1168090 kernel, 18678 user


Sun Fire x4150:

    cpu family : 6
    model : 23
    model name : Intel(R) Xeon(R) CPU           E5450  @ 3.00GHz
    stepping : 10
    microcode : 0xa07

(XEN) TSC has constant rate, deep Cstates possible, so not reliable,
warp=3789 (count=1)
(XEN) dom2: mode=0,ofs=0x3a652aed7d,khz=2992564,inc=1,vtsc count:
4247396065 kernel, 712543 user
(XEN) dom3: mode=0,ofs=0x9eb4c44593,khz=2500147,inc=2,vtsc count:
1967559486 kernel, 192516 user


When the problem appears, I can also see the "(XEN) Platform timer
appears to have unexpectedly wrapped 10 or more times." message.

I have now deployed a freshly compiled 4.1.3 with the latest tsc debug
patched compiled and loglvl=all option to a test server with the same
hw where the problem happenned and I'll report if I see anything.

The problem is pretty rare so not sure when it will happen next ...


Cheers,

     Sylvain

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 14:16:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 14:16:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TczTM-0005ed-Gn; Mon, 26 Nov 2012 14:15:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <s.munaut@whatever-company.com>) id 1TczTK-0005eT-L5
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 14:15:42 +0000
Received: from [85.158.143.35:50497] by server-3.bemta-4.messagelabs.com id
	EC/0B-06841-D8973B05; Mon, 26 Nov 2012 14:15:41 +0000
X-Env-Sender: s.munaut@whatever-company.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1353939311!13397043!1
X-Originating-IP: [209.85.219.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32423 invoked from network); 26 Nov 2012 14:15:16 -0000
Received: from mail-oa0-f45.google.com (HELO mail-oa0-f45.google.com)
	(209.85.219.45)
	by server-16.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 14:15:16 -0000
Received: by mail-oa0-f45.google.com with SMTP id i18so13081996oag.32
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 06:15:11 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=RZ7nZFGlvllW4n/UmZnyeUjzQEhwzYqfhosrhyoZHuk=;
	b=Ong2cyYzvcTEFrvZyt+tStNS84D1pXdUC5jLgER+btBzX5Aty/8/ANhgnKW0cUHcjO
	vMGb9CAwIUNl9e79Z5P8xmVrFn9iZq5LGwQFwsRyAu49zmSxtRMsPaCwtbGJq//kDxU0
	RNe+Bee7j1hjiSsS6sVBKiok7/l96PmX3Yt2Ycj+t1ktPqptNx9b/K8FubjHiZf9K1hW
	oTdieFyLZyDT5LznDscDfNGC1Ws2dh3xKQon8oZRF5pw5ORh+Fo8jB0AMLcx4p9jxDQL
	nl6Q3wCjdhxa1bQnxYxxi6yZG3KbElpObeo9beDVf0XbYeQPnsBLGsKLylcS4DS6DdVb
	uZSQ==
MIME-Version: 1.0
Received: by 10.60.13.73 with SMTP id f9mr9082452oec.131.1353939310937; Mon,
	26 Nov 2012 06:15:10 -0800 (PST)
Received: by 10.76.28.234 with HTTP; Mon, 26 Nov 2012 06:15:10 -0800 (PST)
In-Reply-To: <FF93AF260AC2BB499A119CC65B092CF731533B8F@sg000713.corproot.net>
References: <CAE17a0XdxhaoCZaDDT6RXm1DPnabf2hWXAnzU5NukHeXX45grA@mail.gmail.com>
	<CCCD845A.44DB0%keir.xen@gmail.com>
	<CAE17a0Xit58cLiJ+pE7uKuCDq3Xn+7-5+iDpV2+5S+TX3yuT+Q@mail.gmail.com>
	<50B3507E02000078000AB0D9@nat28.tlf.novell.com>
	<CAE17a0WpzYTgOa9J-DJCKnQ4VgcoeX1GPtnSN2+jUw34DRNxCg@mail.gmail.com>
	<1353926458.5830.5.camel@zakaz.uk.xensource.com>
	<50B36C0D02000078000AB15B@nat28.tlf.novell.com>
	<FF93AF260AC2BB499A119CC65B092CF731533B8F@sg000713.corproot.net>
Date: Mon, 26 Nov 2012 15:15:10 +0100
Message-ID: <CAF6-1L4SauK+WYQUDB730fnEcr_Lf=9jO76T8Y365fk0hf-ACA@mail.gmail.com>
From: Sylvain Munaut <s.munaut@whatever-company.com>
To: Philippe.Simonet@swisscom.com
X-Gm-Message-State: ALoCoQkJvQEuD3X4fdrKQJodC8ITm1oF01SUaBsjGW/+FhPgGMA9UjfTb23NKl0cttyKVLZflu0W
Cc: ijc@hellion.org.uk, keir.xen@gmail.com, mrsanna1@gmail.com,
	JBeulich@suse.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,


I just wanted to say I've also been hitting this problem for years on
some servers.
That was originally under xen 4.0 when I originally installed the
machines, but even after update to 4.1.3 and more recently a 3.6.4
dom0 kernel, the problem is still present.

More specifically the two hw platforms I'm sure are concerned (hw +
cpu info + debug-key 's' info)

Sun Fire x2250:

    cpu family : 6
    model : 23
    model name : Intel(R) Xeon(R) CPU           L5420  @ 2.50GHz
    stepping : 6
    microcode : 0x60b

(XEN) TSC has constant rate, deep Cstates possible, so not reliable,
warp=3292 (count=1)
(XEN) dom1: mode=0,ofs=0x56eb699774,khz=2500128,inc=1,vtsc count:
1168090 kernel, 18678 user


Sun Fire x4150:

    cpu family : 6
    model : 23
    model name : Intel(R) Xeon(R) CPU           E5450  @ 3.00GHz
    stepping : 10
    microcode : 0xa07

(XEN) TSC has constant rate, deep Cstates possible, so not reliable,
warp=3789 (count=1)
(XEN) dom2: mode=0,ofs=0x3a652aed7d,khz=2992564,inc=1,vtsc count:
4247396065 kernel, 712543 user
(XEN) dom3: mode=0,ofs=0x9eb4c44593,khz=2500147,inc=2,vtsc count:
1967559486 kernel, 192516 user


When the problem appears, I can also see the "(XEN) Platform timer
appears to have unexpectedly wrapped 10 or more times." message.

I have now deployed a freshly compiled 4.1.3 with the latest tsc debug
patched compiled and loglvl=all option to a test server with the same
hw where the problem happenned and I'll report if I see anything.

The problem is pretty rare so not sure when it will happen next ...


Cheers,

     Sylvain

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 14:19:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 14:19:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TczX6-0005pU-BE; Mon, 26 Nov 2012 14:19:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1TczX5-0005pF-2b; Mon, 26 Nov 2012 14:19:35 +0000
Received: from [85.158.143.99:44666] by server-2.bemta-4.messagelabs.com id
	B4/5E-28922-67A73B05; Mon, 26 Nov 2012 14:19:34 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1353939573!23891924!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25670 invoked from network); 26 Nov 2012 14:19:33 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 14:19:33 -0000
X-IronPort-AV: E=Sophos;i="4.83,320,1352073600"; d="scan'208";a="16001865"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 14:18:46 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Mon, 26 Nov 2012
	14:18:46 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Mon, 26 Nov 2012 14:18:46 +0000
Thread-Topic: [Xen-devel] [PATCH 02 of 15] libxl: Add
	LIBXL_SHUTDOWN_REASON_UNKNOWN
Thread-Index: Ac3HRADXKEszDP6cRruVJTUnVj0EZAEm64Mw
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107A3@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<8195cb0ebac691ae94e9.1353432202@cosworth.uk.xensource.com>
In-Reply-To: <8195cb0ebac691ae94e9.1353432202@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 02 of 15] libxl:
	Add	LIBXL_SHUTDOWN_REASON_UNKNOWN
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> 8195cb0ebac691ae94e97939362f4d345891b4a7
> # Parent  601dc257a740d3a6047667731007283a4dcb9600
> libxl: Add LIBXL_SHUTDOWN_REASON_UNKNOWN
> 
> libxl_dominfo.shutdown_reason is valid iff (shutdown||dying). This is a bit
> annoying when generating language bindings since it needs all sorts of
> special casing. Just introduce an explicit value instead.

I have a patch in my queue that is almost identical to this one, for exactly this reason.
It is very handy for the ocaml binding to have all possible values of an enum explicitly
defined in this way.

Cheers,
Rob

> Signed-off-by: Ian Campbell <ian.cambell@citrix.com>
> 
> diff -r 601dc257a740 -r 8195cb0ebac6 tools/libxl/libxl.c
> --- a/tools/libxl/libxl.c	Tue Nov 20 17:22:16 2012 +0000
> +++ b/tools/libxl/libxl.c	Tue Nov 20 17:22:21 2012 +0000
> @@ -526,7 +526,7 @@ static void xcinfo2xlinfo(const xc_domai
>      if (xlinfo->shutdown || xlinfo->dying)
>          xlinfo->shutdown_reason = (xcinfo-
> >flags>>XEN_DOMINF_shutdownshift) & XEN_DOMINF_shutdownmask;
>      else
> -        xlinfo->shutdown_reason  = ~0;
> +        xlinfo->shutdown_reason = LIBXL_SHUTDOWN_REASON_UNKNOWN;
> 
>      xlinfo->current_memkb = PAGE_TO_MEMKB(xcinfo->tot_pages);
>      xlinfo->shared_memkb = PAGE_TO_MEMKB(xcinfo->shr_pages); diff -r
> 601dc257a740 -r 8195cb0ebac6 tools/libxl/libxl_types.idl
> --- a/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:16 2012 +0000
> +++ b/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:21 2012 +0000
> @@ -118,14 +118,15 @@ libxl_scheduler = Enumeration("scheduler
>      (7, "arinc653"),
>      ])
> 
> -# Consistent with SHUTDOWN_* in sched.h
> +# Consistent with SHUTDOWN_* in sched.h (apart from UNKNOWN)
>  libxl_shutdown_reason = Enumeration("shutdown_reason", [
> +    (-1, "unknown"),
>      (0, "poweroff"),
>      (1, "reboot"),
>      (2, "suspend"),
>      (3, "crash"),
>      (4, "watchdog"),
> -    ])
> +    ], init_val = "LIBXL_SHUTDOWN_REASON_UNKNOWN")
> 
>  libxl_vga_interface_type = Enumeration("vga_interface_type", [
>      (1, "CIRRUS"),
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 14:19:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 14:19:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TczX6-0005pU-BE; Mon, 26 Nov 2012 14:19:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1TczX5-0005pF-2b; Mon, 26 Nov 2012 14:19:35 +0000
Received: from [85.158.143.99:44666] by server-2.bemta-4.messagelabs.com id
	B4/5E-28922-67A73B05; Mon, 26 Nov 2012 14:19:34 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1353939573!23891924!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25670 invoked from network); 26 Nov 2012 14:19:33 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 14:19:33 -0000
X-IronPort-AV: E=Sophos;i="4.83,320,1352073600"; d="scan'208";a="16001865"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 14:18:46 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Mon, 26 Nov 2012
	14:18:46 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Mon, 26 Nov 2012 14:18:46 +0000
Thread-Topic: [Xen-devel] [PATCH 02 of 15] libxl: Add
	LIBXL_SHUTDOWN_REASON_UNKNOWN
Thread-Index: Ac3HRADXKEszDP6cRruVJTUnVj0EZAEm64Mw
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107A3@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<8195cb0ebac691ae94e9.1353432202@cosworth.uk.xensource.com>
In-Reply-To: <8195cb0ebac691ae94e9.1353432202@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 02 of 15] libxl:
	Add	LIBXL_SHUTDOWN_REASON_UNKNOWN
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> 8195cb0ebac691ae94e97939362f4d345891b4a7
> # Parent  601dc257a740d3a6047667731007283a4dcb9600
> libxl: Add LIBXL_SHUTDOWN_REASON_UNKNOWN
> 
> libxl_dominfo.shutdown_reason is valid iff (shutdown||dying). This is a bit
> annoying when generating language bindings since it needs all sorts of
> special casing. Just introduce an explicit value instead.

I have a patch in my queue that is almost identical to this one, for exactly this reason.
It is very handy for the ocaml binding to have all possible values of an enum explicitly
defined in this way.

Cheers,
Rob

> Signed-off-by: Ian Campbell <ian.cambell@citrix.com>
> 
> diff -r 601dc257a740 -r 8195cb0ebac6 tools/libxl/libxl.c
> --- a/tools/libxl/libxl.c	Tue Nov 20 17:22:16 2012 +0000
> +++ b/tools/libxl/libxl.c	Tue Nov 20 17:22:21 2012 +0000
> @@ -526,7 +526,7 @@ static void xcinfo2xlinfo(const xc_domai
>      if (xlinfo->shutdown || xlinfo->dying)
>          xlinfo->shutdown_reason = (xcinfo-
> >flags>>XEN_DOMINF_shutdownshift) & XEN_DOMINF_shutdownmask;
>      else
> -        xlinfo->shutdown_reason  = ~0;
> +        xlinfo->shutdown_reason = LIBXL_SHUTDOWN_REASON_UNKNOWN;
> 
>      xlinfo->current_memkb = PAGE_TO_MEMKB(xcinfo->tot_pages);
>      xlinfo->shared_memkb = PAGE_TO_MEMKB(xcinfo->shr_pages); diff -r
> 601dc257a740 -r 8195cb0ebac6 tools/libxl/libxl_types.idl
> --- a/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:16 2012 +0000
> +++ b/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:21 2012 +0000
> @@ -118,14 +118,15 @@ libxl_scheduler = Enumeration("scheduler
>      (7, "arinc653"),
>      ])
> 
> -# Consistent with SHUTDOWN_* in sched.h
> +# Consistent with SHUTDOWN_* in sched.h (apart from UNKNOWN)
>  libxl_shutdown_reason = Enumeration("shutdown_reason", [
> +    (-1, "unknown"),
>      (0, "poweroff"),
>      (1, "reboot"),
>      (2, "suspend"),
>      (3, "crash"),
>      (4, "watchdog"),
> -    ])
> +    ], init_val = "LIBXL_SHUTDOWN_REASON_UNKNOWN")
> 
>  libxl_vga_interface_type = Enumeration("vga_interface_type", [
>      (1, "CIRRUS"),
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 14:23:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 14:23:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TczaW-00064s-0H; Mon, 26 Nov 2012 14:23:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dietmar.hahn@ts.fujitsu.com>) id 1TczaU-00064l-77
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 14:23:06 +0000
Received: from [85.158.137.99:25138] by server-10.bemta-3.messagelabs.com id
	BA/31-19806-94B73B05; Mon, 26 Nov 2012 14:23:05 +0000
X-Env-Sender: dietmar.hahn@ts.fujitsu.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353939773!20534890!1
X-Originating-IP: [80.70.172.49]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuNzAuMTcyLjQ5ID0+IDI2Njg1MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7530 invoked from network); 26 Nov 2012 14:22:53 -0000
Received: from dgate10.ts.fujitsu.com (HELO dgate10.ts.fujitsu.com)
	(80.70.172.49)
	by server-2.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 14:22:53 -0000
DomainKey-Signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns;
	h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV:
	Received:Received:From:To:Cc:Subject:Date:Message-ID:
	User-Agent:In-Reply-To:References:MIME-Version:
	Content-Transfer-Encoding:Content-Type;
	b=ZT73+5nio4GQdBSl8V12FbS5LXj7grQ2wCIGnAM4fMKqK828701FM8Cw
	nMgJe7eeXW5puYGS+zNG1C/BCe2vNRWABc+fP6iEbk3RFOn/fU0S2Ra4+
	8Qsr0jQyN+x0y9fsbrP+f6ruUXOH5rDK4Oks2f7LM3CHhFBzqrY514z6J
	TDisEPvi1WuQrFC8lRhYov91mEkxRtzfaBvg5Bc5vYbWBePbVYFnJDWbB
	8+FFoJOymFCZxz63AQXN9hy/DQ76D;
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
	d=ts.fujitsu.com; i=@ts.fujitsu.com; q=dns/txt;
	s=s1536b; t=1353939773; x=1385475773;
	h=from:to:cc:subject:date:message-id:in-reply-to:
	references:mime-version:content-transfer-encoding;
	bh=Y9s3bvNYU90CPOKp5+GR7JzIM77kN2kmAvb6jpyjmSg=;
	b=NoB6J3NKPp/wIIQhuw/i8cvmNVrMfrwlBe3dairufCdRkaYO/JKxmzqh
	q4KCoWOcJwXLILhEL2y5RrlyDtOZlLgmIjuhWDXr7tWx6p/IWjAmc4aG0
	ghyRHU7bHibv8Yj3sQqVUPLw88u36ORH5Fz0ZXQ+JhD5GrgR98QiDOP9m
	XyZNSjwHHmNBEIbrJuiM9Au26QYCqqQrt71VsniOnXjFw1nJy2ourCVi8
	0BDj+fLFdAPH15yRP8y8y2uxKOk+K;
X-SBRSScore: None
X-IronPort-AV: E=Sophos;i="4.83,320,1352070000"; d="scan'208";a="129359615"
Received: from abgdgate40u.abg.fsc.net ([172.25.138.90])
	by dgate10u.abg.fsc.net with ESMTP; 26 Nov 2012 15:21:53 +0100
X-IronPort-AV: E=Sophos;i="4.83,320,1352070000"; d="scan'208";a="150860186"
Received: from sanpedro.mch.fsc.net ([172.17.20.6])
	by abgdgate40u.abg.fsc.net with SMTP; 26 Nov 2012 15:21:53 +0100
Received: from amur.localnet (amur.mch.fsc.net [10.172.102.19])
	by sanpedro.mch.fsc.net (Postfix) with ESMTP id 7ACA695ABA1;
	Mon, 26 Nov 2012 15:21:53 +0100 (CET)
From: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
To: xen-devel@lists.xen.org
Date: Mon, 26 Nov 2012 15:21:53 +0100
Message-ID: <3069888.i3lL5Dz2s5@amur>
User-Agent: KMail/4.7.2 (Linux/3.1.10-1.16-xen; KDE/4.7.2; x86_64; ; )
In-Reply-To: <50B37F1802000078000AB1AE@nat28.tlf.novell.com>
References: <1449364.BXBucXMpuY@amur>
	<50B37F1802000078000AB1AE@nat28.tlf.novell.com>
MIME-Version: 1.0
Cc: Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] oprofile: Add X7542 and E7-8837 to the list
	of supported cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Am Montag 26 November 2012, 13:39:20 schrieb Jan Beulich:
> >>> On 26.11.12 at 13:52, Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> wrote:
> > Add intel cpus X7542 and E7-8837 to the list of supported cpus.
> 
> I suppose these two random additions originate from whatever
> you happen to run your code on?

Yes. The machines I can test this.

> To be honest, I'd prefer the list
> here to actually be put into proper shape...

Here I must look at the specs or see in vpmu parts.
Dietmar.

> 
> Jan
> 
> > Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
> > 
> > diff -r 0049de3827bc -r 6fb0129600cd xen/arch/x86/oprofile/nmi_int.c
> > --- a/xen/arch/x86/oprofile/nmi_int.c   Fri Nov 23 11:06:15 2012 +0000
> > +++ b/xen/arch/x86/oprofile/nmi_int.c   Mon Nov 26 13:36:00 2012 +0100
> > @@ -366,6 +366,8 @@ static int __init ppro_init(char ** cpu_
> >                 ppro_has_global_ctrl = 1;
> >                 break;
> >         case 26:
> > +       case 46:
> > +       case 47:
> >                 arch_perfmon_setup_counters();
> >                 *cpu_type = "i386/core_i7";
> >                 ppro_has_global_ctrl = 1;
> > 
> > 
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 
-- 
Company details: http://ts.fujitsu.com/imprint.html

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 14:23:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 14:23:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TczaW-00064s-0H; Mon, 26 Nov 2012 14:23:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dietmar.hahn@ts.fujitsu.com>) id 1TczaU-00064l-77
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 14:23:06 +0000
Received: from [85.158.137.99:25138] by server-10.bemta-3.messagelabs.com id
	BA/31-19806-94B73B05; Mon, 26 Nov 2012 14:23:05 +0000
X-Env-Sender: dietmar.hahn@ts.fujitsu.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1353939773!20534890!1
X-Originating-IP: [80.70.172.49]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuNzAuMTcyLjQ5ID0+IDI2Njg1MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7530 invoked from network); 26 Nov 2012 14:22:53 -0000
Received: from dgate10.ts.fujitsu.com (HELO dgate10.ts.fujitsu.com)
	(80.70.172.49)
	by server-2.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 14:22:53 -0000
DomainKey-Signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns;
	h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV:
	Received:Received:From:To:Cc:Subject:Date:Message-ID:
	User-Agent:In-Reply-To:References:MIME-Version:
	Content-Transfer-Encoding:Content-Type;
	b=ZT73+5nio4GQdBSl8V12FbS5LXj7grQ2wCIGnAM4fMKqK828701FM8Cw
	nMgJe7eeXW5puYGS+zNG1C/BCe2vNRWABc+fP6iEbk3RFOn/fU0S2Ra4+
	8Qsr0jQyN+x0y9fsbrP+f6ruUXOH5rDK4Oks2f7LM3CHhFBzqrY514z6J
	TDisEPvi1WuQrFC8lRhYov91mEkxRtzfaBvg5Bc5vYbWBePbVYFnJDWbB
	8+FFoJOymFCZxz63AQXN9hy/DQ76D;
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
	d=ts.fujitsu.com; i=@ts.fujitsu.com; q=dns/txt;
	s=s1536b; t=1353939773; x=1385475773;
	h=from:to:cc:subject:date:message-id:in-reply-to:
	references:mime-version:content-transfer-encoding;
	bh=Y9s3bvNYU90CPOKp5+GR7JzIM77kN2kmAvb6jpyjmSg=;
	b=NoB6J3NKPp/wIIQhuw/i8cvmNVrMfrwlBe3dairufCdRkaYO/JKxmzqh
	q4KCoWOcJwXLILhEL2y5RrlyDtOZlLgmIjuhWDXr7tWx6p/IWjAmc4aG0
	ghyRHU7bHibv8Yj3sQqVUPLw88u36ORH5Fz0ZXQ+JhD5GrgR98QiDOP9m
	XyZNSjwHHmNBEIbrJuiM9Au26QYCqqQrt71VsniOnXjFw1nJy2ourCVi8
	0BDj+fLFdAPH15yRP8y8y2uxKOk+K;
X-SBRSScore: None
X-IronPort-AV: E=Sophos;i="4.83,320,1352070000"; d="scan'208";a="129359615"
Received: from abgdgate40u.abg.fsc.net ([172.25.138.90])
	by dgate10u.abg.fsc.net with ESMTP; 26 Nov 2012 15:21:53 +0100
X-IronPort-AV: E=Sophos;i="4.83,320,1352070000"; d="scan'208";a="150860186"
Received: from sanpedro.mch.fsc.net ([172.17.20.6])
	by abgdgate40u.abg.fsc.net with SMTP; 26 Nov 2012 15:21:53 +0100
Received: from amur.localnet (amur.mch.fsc.net [10.172.102.19])
	by sanpedro.mch.fsc.net (Postfix) with ESMTP id 7ACA695ABA1;
	Mon, 26 Nov 2012 15:21:53 +0100 (CET)
From: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
To: xen-devel@lists.xen.org
Date: Mon, 26 Nov 2012 15:21:53 +0100
Message-ID: <3069888.i3lL5Dz2s5@amur>
User-Agent: KMail/4.7.2 (Linux/3.1.10-1.16-xen; KDE/4.7.2; x86_64; ; )
In-Reply-To: <50B37F1802000078000AB1AE@nat28.tlf.novell.com>
References: <1449364.BXBucXMpuY@amur>
	<50B37F1802000078000AB1AE@nat28.tlf.novell.com>
MIME-Version: 1.0
Cc: Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] oprofile: Add X7542 and E7-8837 to the list
	of supported cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Am Montag 26 November 2012, 13:39:20 schrieb Jan Beulich:
> >>> On 26.11.12 at 13:52, Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> wrote:
> > Add intel cpus X7542 and E7-8837 to the list of supported cpus.
> 
> I suppose these two random additions originate from whatever
> you happen to run your code on?

Yes. The machines I can test this.

> To be honest, I'd prefer the list
> here to actually be put into proper shape...

Here I must look at the specs or see in vpmu parts.
Dietmar.

> 
> Jan
> 
> > Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
> > 
> > diff -r 0049de3827bc -r 6fb0129600cd xen/arch/x86/oprofile/nmi_int.c
> > --- a/xen/arch/x86/oprofile/nmi_int.c   Fri Nov 23 11:06:15 2012 +0000
> > +++ b/xen/arch/x86/oprofile/nmi_int.c   Mon Nov 26 13:36:00 2012 +0100
> > @@ -366,6 +366,8 @@ static int __init ppro_init(char ** cpu_
> >                 ppro_has_global_ctrl = 1;
> >                 break;
> >         case 26:
> > +       case 46:
> > +       case 47:
> >                 arch_perfmon_setup_counters();
> >                 *cpu_type = "i386/core_i7";
> >                 ppro_has_global_ctrl = 1;
> > 
> > 
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 
-- 
Company details: http://ts.fujitsu.com/imprint.html

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 14:28:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 14:28:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tczfd-0006Ed-P0; Mon, 26 Nov 2012 14:28:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tczfc-0006EV-CM
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 14:28:24 +0000
Received: from [85.158.139.211:35257] by server-10.bemta-5.messagelabs.com id
	9C/67-09257-78C73B05; Mon, 26 Nov 2012 14:28:23 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353940102!21671273!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19519 invoked from network); 26 Nov 2012 14:28:22 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-206.messagelabs.com with SMTP;
	26 Nov 2012 14:28:22 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 14:28:21 +0000
Message-Id: <50B38ACB02000078000AB364@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 14:29:15 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <mrsanna1@gmail.com>,<Philippe.Simonet@swisscom.com>
References: <CAE17a0XdxhaoCZaDDT6RXm1DPnabf2hWXAnzU5NukHeXX45grA@mail.gmail.com>
	<CCCD845A.44DB0%keir.xen@gmail.com>
	<CAE17a0Xit58cLiJ+pE7uKuCDq3Xn+7-5+iDpV2+5S+TX3yuT+Q@mail.gmail.com>
	<50B3507E02000078000AB0D9@nat28.tlf.novell.com>
	<CAE17a0WpzYTgOa9J-DJCKnQ4VgcoeX1GPtnSN2+jUw34DRNxCg@mail.gmail.com>
	<1353926458.5830.5.camel@zakaz.uk.xensource.com>
	<50B36C0D02000078000AB15B@nat28.tlf.novell.com>
	<FF93AF260AC2BB499A119CC65B092CF731533B8F@sg000713.corproot.net>
In-Reply-To: <FF93AF260AC2BB499A119CC65B092CF731533B8F@sg000713.corproot.net>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir.xen@gmail.com, xen-devel@lists.xen.org, ijc@hellion.org.uk
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 14:08, <Philippe.Simonet@swisscom.com> wrote:
> I've done that for Mauro, here are the symbols : 
> http://www.ncube.ch/xen-syms.gz 

That helped; I'll send a patch shortly.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 14:28:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 14:28:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tczfd-0006Ed-P0; Mon, 26 Nov 2012 14:28:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tczfc-0006EV-CM
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 14:28:24 +0000
Received: from [85.158.139.211:35257] by server-10.bemta-5.messagelabs.com id
	9C/67-09257-78C73B05; Mon, 26 Nov 2012 14:28:23 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353940102!21671273!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19519 invoked from network); 26 Nov 2012 14:28:22 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-206.messagelabs.com with SMTP;
	26 Nov 2012 14:28:22 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 14:28:21 +0000
Message-Id: <50B38ACB02000078000AB364@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 14:29:15 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <mrsanna1@gmail.com>,<Philippe.Simonet@swisscom.com>
References: <CAE17a0XdxhaoCZaDDT6RXm1DPnabf2hWXAnzU5NukHeXX45grA@mail.gmail.com>
	<CCCD845A.44DB0%keir.xen@gmail.com>
	<CAE17a0Xit58cLiJ+pE7uKuCDq3Xn+7-5+iDpV2+5S+TX3yuT+Q@mail.gmail.com>
	<50B3507E02000078000AB0D9@nat28.tlf.novell.com>
	<CAE17a0WpzYTgOa9J-DJCKnQ4VgcoeX1GPtnSN2+jUw34DRNxCg@mail.gmail.com>
	<1353926458.5830.5.camel@zakaz.uk.xensource.com>
	<50B36C0D02000078000AB15B@nat28.tlf.novell.com>
	<FF93AF260AC2BB499A119CC65B092CF731533B8F@sg000713.corproot.net>
In-Reply-To: <FF93AF260AC2BB499A119CC65B092CF731533B8F@sg000713.corproot.net>
Mime-Version: 1.0
Content-Disposition: inline
Cc: keir.xen@gmail.com, xen-devel@lists.xen.org, ijc@hellion.org.uk
Subject: Re: [Xen-devel] #599161: Xen debug patch for the "clock shifts by
 50 minutes" bug.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 14:08, <Philippe.Simonet@swisscom.com> wrote:
> I've done that for Mauro, here are the symbols : 
> http://www.ncube.ch/xen-syms.gz 

That helped; I'll send a patch shortly.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 14:51:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 14:51:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td01M-0006TS-RG; Mon, 26 Nov 2012 14:50:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rshriram@cs.ubc.ca>) id 1Td01L-0006TG-V2
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 14:50:52 +0000
Received: from [85.158.139.211:40542] by server-7.bemta-5.messagelabs.com id
	E2/AD-23096-BC183B05; Mon, 26 Nov 2012 14:50:51 +0000
X-Env-Sender: rshriram@cs.ubc.ca
X-Msg-Ref: server-8.tower-206.messagelabs.com!1353941448!19640189!1
X-Originating-IP: [142.103.6.52]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_50_60,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19162 invoked from network); 26 Nov 2012 14:50:49 -0000
Received: from smtp.cs.ubc.ca (HELO smtp.cs.ubc.ca) (142.103.6.52)
	by server-8.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 14:50:49 -0000
Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41])
	(authenticated bits=0)
	by smtp.cs.ubc.ca (8.14.3/8.13.6) with ESMTP id qAQEoVgw007766
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL)
	for <xen-devel@lists.xensource.com>; Mon, 26 Nov 2012 06:50:32 -0800
Received: by mail-wg0-f41.google.com with SMTP id ds1so1899062wgb.0
	for <xen-devel@lists.xensource.com>;
	Mon, 26 Nov 2012 06:50:30 -0800 (PST)
Received: by 10.216.28.141 with SMTP id g13mr4084392wea.178.1353941429823;
	Mon, 26 Nov 2012 06:50:29 -0800 (PST)
MIME-Version: 1.0
Received: by 10.194.84.71 with HTTP; Mon, 26 Nov 2012 06:49:49 -0800 (PST)
In-Reply-To: <50ABB66B.7090004@eu.citrix.com>
References: <DE8DF0795D48FD4CA783C40EC829233534A645@SHSMSX101.ccr.corp.intel.com>
	<20609.28264.158580.995717@mariner.uk.xensource.com>
	<CAFLBxZZvU9GQ4jjFvWK25jjmkbhRXZjvKSJZajz2Qu9m8n+H0w@mail.gmail.com>
	<20613.9696.715106.47187@mariner.uk.xensource.com>
	<CAP8mzPNYECd_nrO6Y7CL3X+3AFZ-ibSxwPFi1ZTJ75d7h6En1A@mail.gmail.com>
	<50ABB66B.7090004@eu.citrix.com>
From: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Date: Mon, 26 Nov 2012 09:49:49 -0500
Message-ID: <CAP8mzPNioEzAz3QT005vR5mjmT9+n864-81J7esJOgZGwK47Tg@mail.gmail.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH 5/5] X86/vMCE: guest broken page handling
	when migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: rshriram@cs.ubc.ca
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5245645206645223108=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5245645206645223108==
Content-Type: multipart/alternative; boundary=0016e6db6c15f8a98a04cf670d18

--0016e6db6c15f8a98a04cf670d18
Content-Type: text/plain; charset=ISO-8859-1

Sorry for the delayed response.

On Tue, Nov 20, 2012 at 11:57 AM, George Dunlap <george.dunlap@eu.citrix.com
> wrote:

>  On 22/10/12 20:26, Shriram Rajagopalan wrote:
>
>  On Mon, Oct 22, 2012 at 3:54 AM, Ian Jackson <Ian.Jackson@eu.citrix.com>wrote:
>
>> George Dunlap writes ("Re: [Xen-devel] [PATCH 5/5] X86/vMCE: guest broken
>> page handling when migration"):
>> > On Fri, Oct 19, 2012 at 4:14 PM, Ian Jackson <Ian.Jackson@eu.citrix.com>
>> wrote:
>>  > > This looks plausible to me, as far as the tools go.  Can you explain
>> > > how you have tested this ?  Did you manage to do any tests of the
>> > > remus codepaths ?
>> >
>> > I'm pretty sure that this shouldn't cause any problems with Remus.  If
>> > it's difficult for Jinsong to test Remus, I think probably OK to
>> > commit it, and then revert it if the Remus guys have any problems.
>>
>>  OK.
>>
>>
>  You can easily test it with Remus. With xl, memory replication
> functionality is already
> in place. so xl remus command should work.
>
>
> Should "xl remus $domain localhost" work?  How would one test the
> fail-over mechanism?  Are there any other requirements for the guest, the
> kernel, &c?
>
>
xl remus $domain localhost should work. And xl remus $domain remoteHost
will work too.
Atleast that was the case, when the patches went in a few months ago.

If you are using a 3.0+ kernel for the Guest, things should work.
There are no other requirements for the Guest/Kernel - HVM wise it should
work, since its basically
 doing xl migrate -l $domain $host continually (just memory).


> I just ran the above command on xen-unstable, and after 10 minutes or so
> the guest crashed with some kind of a kernel double-fault.
>
>
As far as the kernel double-fault, I have one possible candidate. The dirty
page compression could
potentially be causing this - since iirc there were some proposals to
re-introduce superpages, etc
which changed a lot of xc_domain_restore code.

So try "xl remus -u $domain localhost" [disables checkpoint compression].

 Are we running any remus stuff in our testing infrastructure?
>
>
Nope. Wish I could though :).

shriram

>   -George
>
>

--0016e6db6c15f8a98a04cf670d18
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Sorry for the delayed response.<div><br><div class=3D"gmail_extra"><div cla=
ss=3D"gmail_quote">On Tue, Nov 20, 2012 at 11:57 AM, George Dunlap <span di=
r=3D"ltr">&lt;<a href=3D"mailto:george.dunlap@eu.citrix.com" target=3D"_bla=
nk">george.dunlap@eu.citrix.com</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex">
 =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000"><div class=3D"im">
    <div>On 22/10/12 20:26, Shriram Rajagopalan
      wrote:<br>
    </div>
    <blockquote type=3D"cite">
      <div>
        <div>On Mon, Oct 22, 2012 at 3:54 AM, Ian Jackson <span dir=3D"ltr"=
>&lt;<a href=3D"mailto:Ian.Jackson@eu.citrix.com" target=3D"_blank">Ian.Jac=
kson@eu.citrix.com</a>&gt;</span>
          wrote:</div>
        <div>
          <div>
            <div class=3D"gmail_quote">
              <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px=
 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left=
-style:solid;padding-left:1ex">George
                Dunlap writes (&quot;Re: [Xen-devel] [PATCH 5/5] X86/vMCE:
                guest broken page handling when migration&quot;):<br>
                <div>&gt; On Fri, Oct 19, 2012 at 4:14 PM,
                  Ian Jackson &lt;<a href=3D"mailto:Ian.Jackson@eu.citrix.c=
om" target=3D"_blank">Ian.Jackson@eu.citrix.com</a>&gt;
                  wrote:<br>
                </div>
                <div>&gt; &gt; This looks plausible to me, as
                  far as the tools go. =A0Can you explain<br>
                  &gt; &gt; how you have tested this ? =A0Did you manage
                  to do any tests of the<br>
                  &gt; &gt; remus codepaths ?<br>
                  &gt;<br>
                  &gt; I&#39;m pretty sure that this shouldn&#39;t cause an=
y
                  problems with Remus. =A0If<br>
                  &gt; it&#39;s difficult for Jinsong to test Remus, I thin=
k
                  probably OK to<br>
                  &gt; commit it, and then revert it if the Remus guys
                  have any problems.<br>
                  <br>
                </div>
                OK.<br>
                <span><font color=3D"#888888"><br>
                  </font></span></blockquote>
              <div><br>
              </div>
              You can easily test it with Remus. With xl, memory
              replication functionality is already
              <div>in place. so xl remus command should work.</div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br></div>
    Should &quot;xl remus $domain localhost&quot; work?=A0 How would one te=
st the
    fail-over mechanism?=A0 Are there any other requirements for the
    guest, the kernel, &amp;c?<br>
    <br></div></blockquote><div><br></div><div>xl remus $domain localhost s=
hould work. And xl remus $domain remoteHost will work too.</div><div>Atleas=
t that was the case, when=A0the patches went in a few months ago.</div><div=
>

<br></div><div>If you are using a 3.0+ kernel for the Guest, things should =
work.=A0</div><div>There are no other requirements for the Guest/Kernel - H=
VM wise it should work, since its basically</div><div>=A0doing xl migrate -=
l $domain $host continually (just memory).</div>

<div>=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px=
 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left=
-style:solid;padding-left:1ex"><div bgcolor=3D"#FFFFFF" text=3D"#000000">
    I just ran the above command on xen-unstable, and after 10 minutes
    or so the guest crashed with some kind of a kernel double-fault.<br>
    <br></div></blockquote><div><br></div><div>As far as the kernel double-=
fault, I have one possible candidate. The dirty page compression could</div=
><div>potentially be causing this - since iirc there were some proposals to=
 re-introduce superpages, etc</div>

<div>which changed a lot of xc_domain_restore code.</div><div><br></div><di=
v>So try &quot;xl remus -u $domain localhost&quot; [disables checkpoint com=
pression].</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"m=
argin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204=
,204);border-left-style:solid;padding-left:1ex">

<div bgcolor=3D"#FFFFFF" text=3D"#000000">
    Are we running any remus stuff in our testing infrastructure?<span clas=
s=3D""><font color=3D"#888888"><br>
    <br></font></span></div></blockquote><div><br></div><div>Nope. Wish I c=
ould though :).</div><div><br></div><div>shriram=A0</div><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;bo=
rder-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div bgcolor=3D"#FFFFFF" text=3D"#000000"><span class=3D""><font color=3D"#=
888888">
    =A0-George<br>
    <br>
  </font></span></div>

</blockquote></div><br></div></div>

--0016e6db6c15f8a98a04cf670d18--


--===============5245645206645223108==
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.xen.org
http://lists.xen.org/xen-devel

--===============5245645206645223108==--


From xen-devel-bounces@lists.xen.org Mon Nov 26 14:51:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 14:51:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td01M-0006TS-RG; Mon, 26 Nov 2012 14:50:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rshriram@cs.ubc.ca>) id 1Td01L-0006TG-V2
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 14:50:52 +0000
Received: from [85.158.139.211:40542] by server-7.bemta-5.messagelabs.com id
	E2/AD-23096-BC183B05; Mon, 26 Nov 2012 14:50:51 +0000
X-Env-Sender: rshriram@cs.ubc.ca
X-Msg-Ref: server-8.tower-206.messagelabs.com!1353941448!19640189!1
X-Originating-IP: [142.103.6.52]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_50_60,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19162 invoked from network); 26 Nov 2012 14:50:49 -0000
Received: from smtp.cs.ubc.ca (HELO smtp.cs.ubc.ca) (142.103.6.52)
	by server-8.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 14:50:49 -0000
Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41])
	(authenticated bits=0)
	by smtp.cs.ubc.ca (8.14.3/8.13.6) with ESMTP id qAQEoVgw007766
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL)
	for <xen-devel@lists.xensource.com>; Mon, 26 Nov 2012 06:50:32 -0800
Received: by mail-wg0-f41.google.com with SMTP id ds1so1899062wgb.0
	for <xen-devel@lists.xensource.com>;
	Mon, 26 Nov 2012 06:50:30 -0800 (PST)
Received: by 10.216.28.141 with SMTP id g13mr4084392wea.178.1353941429823;
	Mon, 26 Nov 2012 06:50:29 -0800 (PST)
MIME-Version: 1.0
Received: by 10.194.84.71 with HTTP; Mon, 26 Nov 2012 06:49:49 -0800 (PST)
In-Reply-To: <50ABB66B.7090004@eu.citrix.com>
References: <DE8DF0795D48FD4CA783C40EC829233534A645@SHSMSX101.ccr.corp.intel.com>
	<20609.28264.158580.995717@mariner.uk.xensource.com>
	<CAFLBxZZvU9GQ4jjFvWK25jjmkbhRXZjvKSJZajz2Qu9m8n+H0w@mail.gmail.com>
	<20613.9696.715106.47187@mariner.uk.xensource.com>
	<CAP8mzPNYECd_nrO6Y7CL3X+3AFZ-ibSxwPFi1ZTJ75d7h6En1A@mail.gmail.com>
	<50ABB66B.7090004@eu.citrix.com>
From: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Date: Mon, 26 Nov 2012 09:49:49 -0500
Message-ID: <CAP8mzPNioEzAz3QT005vR5mjmT9+n864-81J7esJOgZGwK47Tg@mail.gmail.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH 5/5] X86/vMCE: guest broken page handling
	when migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: rshriram@cs.ubc.ca
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5245645206645223108=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5245645206645223108==
Content-Type: multipart/alternative; boundary=0016e6db6c15f8a98a04cf670d18

--0016e6db6c15f8a98a04cf670d18
Content-Type: text/plain; charset=ISO-8859-1

Sorry for the delayed response.

On Tue, Nov 20, 2012 at 11:57 AM, George Dunlap <george.dunlap@eu.citrix.com
> wrote:

>  On 22/10/12 20:26, Shriram Rajagopalan wrote:
>
>  On Mon, Oct 22, 2012 at 3:54 AM, Ian Jackson <Ian.Jackson@eu.citrix.com>wrote:
>
>> George Dunlap writes ("Re: [Xen-devel] [PATCH 5/5] X86/vMCE: guest broken
>> page handling when migration"):
>> > On Fri, Oct 19, 2012 at 4:14 PM, Ian Jackson <Ian.Jackson@eu.citrix.com>
>> wrote:
>>  > > This looks plausible to me, as far as the tools go.  Can you explain
>> > > how you have tested this ?  Did you manage to do any tests of the
>> > > remus codepaths ?
>> >
>> > I'm pretty sure that this shouldn't cause any problems with Remus.  If
>> > it's difficult for Jinsong to test Remus, I think probably OK to
>> > commit it, and then revert it if the Remus guys have any problems.
>>
>>  OK.
>>
>>
>  You can easily test it with Remus. With xl, memory replication
> functionality is already
> in place. so xl remus command should work.
>
>
> Should "xl remus $domain localhost" work?  How would one test the
> fail-over mechanism?  Are there any other requirements for the guest, the
> kernel, &c?
>
>
xl remus $domain localhost should work. And xl remus $domain remoteHost
will work too.
Atleast that was the case, when the patches went in a few months ago.

If you are using a 3.0+ kernel for the Guest, things should work.
There are no other requirements for the Guest/Kernel - HVM wise it should
work, since its basically
 doing xl migrate -l $domain $host continually (just memory).


> I just ran the above command on xen-unstable, and after 10 minutes or so
> the guest crashed with some kind of a kernel double-fault.
>
>
As far as the kernel double-fault, I have one possible candidate. The dirty
page compression could
potentially be causing this - since iirc there were some proposals to
re-introduce superpages, etc
which changed a lot of xc_domain_restore code.

So try "xl remus -u $domain localhost" [disables checkpoint compression].

 Are we running any remus stuff in our testing infrastructure?
>
>
Nope. Wish I could though :).

shriram

>   -George
>
>

--0016e6db6c15f8a98a04cf670d18
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Sorry for the delayed response.<div><br><div class=3D"gmail_extra"><div cla=
ss=3D"gmail_quote">On Tue, Nov 20, 2012 at 11:57 AM, George Dunlap <span di=
r=3D"ltr">&lt;<a href=3D"mailto:george.dunlap@eu.citrix.com" target=3D"_bla=
nk">george.dunlap@eu.citrix.com</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex">
 =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000"><div class=3D"im">
    <div>On 22/10/12 20:26, Shriram Rajagopalan
      wrote:<br>
    </div>
    <blockquote type=3D"cite">
      <div>
        <div>On Mon, Oct 22, 2012 at 3:54 AM, Ian Jackson <span dir=3D"ltr"=
>&lt;<a href=3D"mailto:Ian.Jackson@eu.citrix.com" target=3D"_blank">Ian.Jac=
kson@eu.citrix.com</a>&gt;</span>
          wrote:</div>
        <div>
          <div>
            <div class=3D"gmail_quote">
              <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px=
 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left=
-style:solid;padding-left:1ex">George
                Dunlap writes (&quot;Re: [Xen-devel] [PATCH 5/5] X86/vMCE:
                guest broken page handling when migration&quot;):<br>
                <div>&gt; On Fri, Oct 19, 2012 at 4:14 PM,
                  Ian Jackson &lt;<a href=3D"mailto:Ian.Jackson@eu.citrix.c=
om" target=3D"_blank">Ian.Jackson@eu.citrix.com</a>&gt;
                  wrote:<br>
                </div>
                <div>&gt; &gt; This looks plausible to me, as
                  far as the tools go. =A0Can you explain<br>
                  &gt; &gt; how you have tested this ? =A0Did you manage
                  to do any tests of the<br>
                  &gt; &gt; remus codepaths ?<br>
                  &gt;<br>
                  &gt; I&#39;m pretty sure that this shouldn&#39;t cause an=
y
                  problems with Remus. =A0If<br>
                  &gt; it&#39;s difficult for Jinsong to test Remus, I thin=
k
                  probably OK to<br>
                  &gt; commit it, and then revert it if the Remus guys
                  have any problems.<br>
                  <br>
                </div>
                OK.<br>
                <span><font color=3D"#888888"><br>
                  </font></span></blockquote>
              <div><br>
              </div>
              You can easily test it with Remus. With xl, memory
              replication functionality is already
              <div>in place. so xl remus command should work.</div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br></div>
    Should &quot;xl remus $domain localhost&quot; work?=A0 How would one te=
st the
    fail-over mechanism?=A0 Are there any other requirements for the
    guest, the kernel, &amp;c?<br>
    <br></div></blockquote><div><br></div><div>xl remus $domain localhost s=
hould work. And xl remus $domain remoteHost will work too.</div><div>Atleas=
t that was the case, when=A0the patches went in a few months ago.</div><div=
>

<br></div><div>If you are using a 3.0+ kernel for the Guest, things should =
work.=A0</div><div>There are no other requirements for the Guest/Kernel - H=
VM wise it should work, since its basically</div><div>=A0doing xl migrate -=
l $domain $host continually (just memory).</div>

<div>=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px=
 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left=
-style:solid;padding-left:1ex"><div bgcolor=3D"#FFFFFF" text=3D"#000000">
    I just ran the above command on xen-unstable, and after 10 minutes
    or so the guest crashed with some kind of a kernel double-fault.<br>
    <br></div></blockquote><div><br></div><div>As far as the kernel double-=
fault, I have one possible candidate. The dirty page compression could</div=
><div>potentially be causing this - since iirc there were some proposals to=
 re-introduce superpages, etc</div>

<div>which changed a lot of xc_domain_restore code.</div><div><br></div><di=
v>So try &quot;xl remus -u $domain localhost&quot; [disables checkpoint com=
pression].</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"m=
argin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204=
,204);border-left-style:solid;padding-left:1ex">

<div bgcolor=3D"#FFFFFF" text=3D"#000000">
    Are we running any remus stuff in our testing infrastructure?<span clas=
s=3D""><font color=3D"#888888"><br>
    <br></font></span></div></blockquote><div><br></div><div>Nope. Wish I c=
ould though :).</div><div><br></div><div>shriram=A0</div><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;bo=
rder-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div bgcolor=3D"#FFFFFF" text=3D"#000000"><span class=3D""><font color=3D"#=
888888">
    =A0-George<br>
    <br>
  </font></span></div>

</blockquote></div><br></div></div>

--0016e6db6c15f8a98a04cf670d18--


--===============5245645206645223108==
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.xen.org
http://lists.xen.org/xen-devel

--===============5245645206645223108==--


From xen-devel-bounces@lists.xen.org Mon Nov 26 15:00:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 15:00:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td0AE-0006h9-9R; Mon, 26 Nov 2012 15:00:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Boris.Ostrovsky@amd.com>) id 1Td0AC-0006fD-Kz
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 15:00:00 +0000
Received: from [85.158.143.35:54770] by server-2.bemta-4.messagelabs.com id
	C6/E2-28922-FE383B05; Mon, 26 Nov 2012 14:59:59 +0000
X-Env-Sender: Boris.Ostrovsky@amd.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1353941946!11825960!1
X-Originating-IP: [207.46.163.27]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26066 invoked from network); 26 Nov 2012 14:59:07 -0000
Received: from co9ehsobe004.messaging.microsoft.com (HELO
	co9outboundpool.messaging.microsoft.com) (207.46.163.27)
	by server-7.tower-21.messagelabs.com with AES128-SHA encrypted SMTP;
	26 Nov 2012 14:59:07 -0000
Received: from mail77-co9-R.bigfish.com (10.236.132.237) by
	CO9EHSOBE007.bigfish.com (10.236.130.70) with Microsoft SMTP Server id
	14.1.225.23; Mon, 26 Nov 2012 14:59:05 +0000
Received: from mail77-co9 (localhost [127.0.0.1])	by mail77-co9-R.bigfish.com
	(Postfix) with ESMTP id 6073E201A5;
	Mon, 26 Nov 2012 14:59:05 +0000 (UTC)
X-Forefront-Antispam-Report: CIP:163.181.249.109; KIP:(null); UIP:(null);
	IPV:NLI; H:ausb3twp02.amd.com; RD:none; EFVD:NLI
X-SpamScore: -4
X-BigFish: VPS-4(z551bizbb2dI98dI9371I936eI1102I1432Izz1de0h1202h1d1ah1d2ahzz17326ah8275dh18b566iz2dh668h839hd25he5bhf0ah1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh162dh1631h1155h)
Received: from mail77-co9 (localhost.localdomain [127.0.0.1]) by mail77-co9
	(MessageSwitch) id 1353941943992894_15133;
	Mon, 26 Nov 2012 14:59:03 +0000 (UTC)
Received: from CO9EHSMHS031.bigfish.com (unknown [10.236.132.234])	by
	mail77-co9.bigfish.com (Postfix) with ESMTP id E5E26140293;
	Mon, 26 Nov 2012 14:59:03 +0000 (UTC)
Received: from ausb3twp02.amd.com (163.181.249.109) by
	CO9EHSMHS031.bigfish.com (10.236.130.41) with Microsoft SMTP Server id
	14.1.225.23; Mon, 26 Nov 2012 14:59:01 +0000
X-WSS-ID: 0ME3OAB-02-1B1-02
X-M-MSG: 
Received: from sausexedgep01.amd.com (sausexedgep01-ext.amd.com
	[163.181.249.72])	(using TLSv1 with cipher AES128-SHA (128/128
	bits))	(No
	client certificate requested)	by ausb3twp02.amd.com (Axway MailGate
	3.8.1)
	with ESMTP id 2C6DCC84DA;	Mon, 26 Nov 2012 08:58:59 -0600 (CST)
Received: from SAUSEXDAG02.amd.com (163.181.55.2) by sausexedgep01.amd.com
	(163.181.36.54) with Microsoft SMTP Server (TLS) id 8.3.192.1;
	Mon, 26 Nov 2012 08:59:17 -0600
Received: from [10.234.222.132] (163.181.55.254) by sausexdag02.amd.com
	(163.181.55.2) with Microsoft SMTP Server id 14.2.318.4;
	Mon, 26 Nov 2012 08:58:59 -0600
Message-ID: <50B383B2.9060503@amd.com>
Date: Mon, 26 Nov 2012 09:58:58 -0500
From: Boris Ostrovsky <boris.ostrovsky@amd.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121025 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <ijc@hellion.org.uk>
References: <1353936077.5830.30.camel@zakaz.uk.xensource.com>
	<50B3805A02000078000AB1B8@nat28.tlf.novell.com>
	<1353939218.5830.34.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353939218.5830.34.camel@zakaz.uk.xensource.com>
X-OriginatorOrg: amd.com
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>,
	debian-kernel <debian-kernel@lists.debian.org>
Subject: Re: [Xen-devel] pvops microcode support for AMD FAM >= 15
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 11/26/2012 09:13 AM, Ian Campbell wrote:
> On Mon, 2012-11-26 at 13:44 +0000, Jan Beulich wrote:
>>>>> On 26.11.12 at 14:21, Ian Campbell <ijc@hellion.org.uk> wrote:
>>> Debian has decided to take Jeremy's microcode patch [0] as an interim
>>> measure for their next release. (TL;DR -- Debian is shipping pvops Linux
>>> 3.2 and Xen 4.1 in the next release. See http://bugs.debian.org/693053
>>> and https://lists.debian.org/debian-devel/2012/11/msg00141.html for some
>>> more background).
>>>
>>> However the patch is a bit old and predates the use introduction of
>>> separate firmware files for AMD family >= 15h. Looking at the SuSE
>>> forward ported classic Xen patches it seems like the following patch is
>>> all that is required. But it seems a little too simple to be true and I
>>> don't have any such processors to test on.
>>>
>>> Jan, can you recall if it really is that easy on the kernel side ;-)
>>
>> While so far I didn't myself run anything on post-Fam10 systems
>> either, it really ought to be that easy - the patch format didn't
>> change, it's just that they decided to spit the files by family to
>> keep them manageable.
>>
>> The only other thing to check for is that you don't have any
>> artificial size restriction left in that code (I think patch files early
>> on were limited to 4k in size, and that got lifted during the last
>> couple of years).
>
> I can't find one by inspection, it uses the standard request_firmware
> interface and stashes the result in a valloc'd buffer, neither of which
> suffer from any 4K related limitations AFAIK.
>
> I'll try and track something more recent down to test but the worst
> downside of applying this patch seems to be that something which doesn't
> work still doesn't work.

I submitted a fix for fam 16h to Linux right before the Thanksgiving 
break in US and was planning to look at Xen as well. Give me a day or 
two to test it.

-boris

>
>> The hypervisor is really going to take care of all other aspects
>> here.
>
> Sweet, thanks.
>
> Ian.
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 15:00:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 15:00:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td0AE-0006h9-9R; Mon, 26 Nov 2012 15:00:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Boris.Ostrovsky@amd.com>) id 1Td0AC-0006fD-Kz
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 15:00:00 +0000
Received: from [85.158.143.35:54770] by server-2.bemta-4.messagelabs.com id
	C6/E2-28922-FE383B05; Mon, 26 Nov 2012 14:59:59 +0000
X-Env-Sender: Boris.Ostrovsky@amd.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1353941946!11825960!1
X-Originating-IP: [207.46.163.27]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26066 invoked from network); 26 Nov 2012 14:59:07 -0000
Received: from co9ehsobe004.messaging.microsoft.com (HELO
	co9outboundpool.messaging.microsoft.com) (207.46.163.27)
	by server-7.tower-21.messagelabs.com with AES128-SHA encrypted SMTP;
	26 Nov 2012 14:59:07 -0000
Received: from mail77-co9-R.bigfish.com (10.236.132.237) by
	CO9EHSOBE007.bigfish.com (10.236.130.70) with Microsoft SMTP Server id
	14.1.225.23; Mon, 26 Nov 2012 14:59:05 +0000
Received: from mail77-co9 (localhost [127.0.0.1])	by mail77-co9-R.bigfish.com
	(Postfix) with ESMTP id 6073E201A5;
	Mon, 26 Nov 2012 14:59:05 +0000 (UTC)
X-Forefront-Antispam-Report: CIP:163.181.249.109; KIP:(null); UIP:(null);
	IPV:NLI; H:ausb3twp02.amd.com; RD:none; EFVD:NLI
X-SpamScore: -4
X-BigFish: VPS-4(z551bizbb2dI98dI9371I936eI1102I1432Izz1de0h1202h1d1ah1d2ahzz17326ah8275dh18b566iz2dh668h839hd25he5bhf0ah1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh162dh1631h1155h)
Received: from mail77-co9 (localhost.localdomain [127.0.0.1]) by mail77-co9
	(MessageSwitch) id 1353941943992894_15133;
	Mon, 26 Nov 2012 14:59:03 +0000 (UTC)
Received: from CO9EHSMHS031.bigfish.com (unknown [10.236.132.234])	by
	mail77-co9.bigfish.com (Postfix) with ESMTP id E5E26140293;
	Mon, 26 Nov 2012 14:59:03 +0000 (UTC)
Received: from ausb3twp02.amd.com (163.181.249.109) by
	CO9EHSMHS031.bigfish.com (10.236.130.41) with Microsoft SMTP Server id
	14.1.225.23; Mon, 26 Nov 2012 14:59:01 +0000
X-WSS-ID: 0ME3OAB-02-1B1-02
X-M-MSG: 
Received: from sausexedgep01.amd.com (sausexedgep01-ext.amd.com
	[163.181.249.72])	(using TLSv1 with cipher AES128-SHA (128/128
	bits))	(No
	client certificate requested)	by ausb3twp02.amd.com (Axway MailGate
	3.8.1)
	with ESMTP id 2C6DCC84DA;	Mon, 26 Nov 2012 08:58:59 -0600 (CST)
Received: from SAUSEXDAG02.amd.com (163.181.55.2) by sausexedgep01.amd.com
	(163.181.36.54) with Microsoft SMTP Server (TLS) id 8.3.192.1;
	Mon, 26 Nov 2012 08:59:17 -0600
Received: from [10.234.222.132] (163.181.55.254) by sausexdag02.amd.com
	(163.181.55.2) with Microsoft SMTP Server id 14.2.318.4;
	Mon, 26 Nov 2012 08:58:59 -0600
Message-ID: <50B383B2.9060503@amd.com>
Date: Mon, 26 Nov 2012 09:58:58 -0500
From: Boris Ostrovsky <boris.ostrovsky@amd.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121025 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <ijc@hellion.org.uk>
References: <1353936077.5830.30.camel@zakaz.uk.xensource.com>
	<50B3805A02000078000AB1B8@nat28.tlf.novell.com>
	<1353939218.5830.34.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353939218.5830.34.camel@zakaz.uk.xensource.com>
X-OriginatorOrg: amd.com
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>,
	debian-kernel <debian-kernel@lists.debian.org>
Subject: Re: [Xen-devel] pvops microcode support for AMD FAM >= 15
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 11/26/2012 09:13 AM, Ian Campbell wrote:
> On Mon, 2012-11-26 at 13:44 +0000, Jan Beulich wrote:
>>>>> On 26.11.12 at 14:21, Ian Campbell <ijc@hellion.org.uk> wrote:
>>> Debian has decided to take Jeremy's microcode patch [0] as an interim
>>> measure for their next release. (TL;DR -- Debian is shipping pvops Linux
>>> 3.2 and Xen 4.1 in the next release. See http://bugs.debian.org/693053
>>> and https://lists.debian.org/debian-devel/2012/11/msg00141.html for some
>>> more background).
>>>
>>> However the patch is a bit old and predates the use introduction of
>>> separate firmware files for AMD family >= 15h. Looking at the SuSE
>>> forward ported classic Xen patches it seems like the following patch is
>>> all that is required. But it seems a little too simple to be true and I
>>> don't have any such processors to test on.
>>>
>>> Jan, can you recall if it really is that easy on the kernel side ;-)
>>
>> While so far I didn't myself run anything on post-Fam10 systems
>> either, it really ought to be that easy - the patch format didn't
>> change, it's just that they decided to spit the files by family to
>> keep them manageable.
>>
>> The only other thing to check for is that you don't have any
>> artificial size restriction left in that code (I think patch files early
>> on were limited to 4k in size, and that got lifted during the last
>> couple of years).
>
> I can't find one by inspection, it uses the standard request_firmware
> interface and stashes the result in a valloc'd buffer, neither of which
> suffer from any 4K related limitations AFAIK.
>
> I'll try and track something more recent down to test but the worst
> downside of applying this patch seems to be that something which doesn't
> work still doesn't work.

I submitted a fix for fam 16h to Linux right before the Thanksgiving 
break in US and was planning to look at Xen as well. Give me a day or 
two to test it.

-boris

>
>> The hypervisor is really going to take care of all other aspects
>> here.
>
> Sweet, thanks.
>
> Ian.
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 15:24:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 15:24:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td0Xh-0006vp-Iv; Mon, 26 Nov 2012 15:24:17 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Td0Xf-0006vk-BA
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 15:24:15 +0000
Received: from [193.109.254.147:36536] by server-13.bemta-14.messagelabs.com
	id EB/9C-11239-E9983B05; Mon, 26 Nov 2012 15:24:14 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1353943369!8426966!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17181 invoked from network); 26 Nov 2012 15:22:50 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-27.messagelabs.com with SMTP;
	26 Nov 2012 15:22:50 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 15:22:49 +0000
Message-Id: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 15:23:43 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part6D5C836F.0__="
Subject: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part6D5C836F.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

The way it was coded, it clobbered %rdx without telling the compiler.
This generally didn't cause any problems except when there are two back
to back invocations (as in plt_overflow()), as in that case the
compiler may validly assume that it can re-use for the second instance
the value loaded into %rdx before the first one.

Once at it, also properly relax the second operand of "mul" (there's no
need for it to be in %rdx, or a register at all), and switch away from
using explicit register names in the instruction operands.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -127,8 +127,9 @@ static inline u64 scale_delta(u64 delta,
         delta <<=3D scale->shift;
=20
     asm (
-        "mul %%rdx ; shrd $32,%%rdx,%%rax"
-        : "=3Da" (product) : "0" (delta), "d" ((u64)scale->mul_frac) );
+        "mul %2 ; shrd $32,%1,%0"
+        : "=3Da" (product), "=3Dd" (delta)
+        : "rm" (delta), "0" ((u64)scale->mul_frac) );
=20
     return product;
 }




--=__Part6D5C836F.0__=
Content-Type: text/plain; name="x86-time-scale-asm.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="x86-time-scale-asm.patch"

x86/time: fix scale_delta() inline assembly=0A=0AThe way it was coded, it =
clobbered %rdx without telling the compiler.=0AThis generally didn't cause =
any problems except when there are two back=0Ato back invocations (as in =
plt_overflow()), as in that case the=0Acompiler may validly assume that it =
can re-use for the second instance=0Athe value loaded into %rdx before the =
first one.=0A=0AOnce at it, also properly relax the second operand of =
"mul" (there's no=0Aneed for it to be in %rdx, or a register at all), and =
switch away from=0Ausing explicit register names in the instruction =
operands.=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- =
a/xen/arch/x86/time.c=0A+++ b/xen/arch/x86/time.c=0A@@ -127,8 +127,9 @@ =
static inline u64 scale_delta(u64 delta,=0A         delta <<=3D scale->shif=
t;=0A =0A     asm (=0A-        "mul %%rdx ; shrd $32,%%rdx,%%rax"=0A-      =
  : "=3Da" (product) : "0" (delta), "d" ((u64)scale->mul_frac) );=0A+      =
  "mul %2 ; shrd $32,%1,%0"=0A+        : "=3Da" (product), "=3Dd" =
(delta)=0A+        : "rm" (delta), "0" ((u64)scale->mul_frac) );=0A =0A    =
 return product;=0A }=0A
--=__Part6D5C836F.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.xen.org
http://lists.xen.org/xen-devel

--=__Part6D5C836F.0__=--


From xen-devel-bounces@lists.xen.org Mon Nov 26 15:24:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 15:24:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td0Xh-0006vp-Iv; Mon, 26 Nov 2012 15:24:17 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Td0Xf-0006vk-BA
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 15:24:15 +0000
Received: from [193.109.254.147:36536] by server-13.bemta-14.messagelabs.com
	id EB/9C-11239-E9983B05; Mon, 26 Nov 2012 15:24:14 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1353943369!8426966!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17181 invoked from network); 26 Nov 2012 15:22:50 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-27.messagelabs.com with SMTP;
	26 Nov 2012 15:22:50 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 15:22:49 +0000
Message-Id: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 15:23:43 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part6D5C836F.0__="
Subject: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part6D5C836F.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

The way it was coded, it clobbered %rdx without telling the compiler.
This generally didn't cause any problems except when there are two back
to back invocations (as in plt_overflow()), as in that case the
compiler may validly assume that it can re-use for the second instance
the value loaded into %rdx before the first one.

Once at it, also properly relax the second operand of "mul" (there's no
need for it to be in %rdx, or a register at all), and switch away from
using explicit register names in the instruction operands.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -127,8 +127,9 @@ static inline u64 scale_delta(u64 delta,
         delta <<=3D scale->shift;
=20
     asm (
-        "mul %%rdx ; shrd $32,%%rdx,%%rax"
-        : "=3Da" (product) : "0" (delta), "d" ((u64)scale->mul_frac) );
+        "mul %2 ; shrd $32,%1,%0"
+        : "=3Da" (product), "=3Dd" (delta)
+        : "rm" (delta), "0" ((u64)scale->mul_frac) );
=20
     return product;
 }




--=__Part6D5C836F.0__=
Content-Type: text/plain; name="x86-time-scale-asm.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="x86-time-scale-asm.patch"

x86/time: fix scale_delta() inline assembly=0A=0AThe way it was coded, it =
clobbered %rdx without telling the compiler.=0AThis generally didn't cause =
any problems except when there are two back=0Ato back invocations (as in =
plt_overflow()), as in that case the=0Acompiler may validly assume that it =
can re-use for the second instance=0Athe value loaded into %rdx before the =
first one.=0A=0AOnce at it, also properly relax the second operand of =
"mul" (there's no=0Aneed for it to be in %rdx, or a register at all), and =
switch away from=0Ausing explicit register names in the instruction =
operands.=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- =
a/xen/arch/x86/time.c=0A+++ b/xen/arch/x86/time.c=0A@@ -127,8 +127,9 @@ =
static inline u64 scale_delta(u64 delta,=0A         delta <<=3D scale->shif=
t;=0A =0A     asm (=0A-        "mul %%rdx ; shrd $32,%%rdx,%%rax"=0A-      =
  : "=3Da" (product) : "0" (delta), "d" ((u64)scale->mul_frac) );=0A+      =
  "mul %2 ; shrd $32,%1,%0"=0A+        : "=3Da" (product), "=3Dd" =
(delta)=0A+        : "rm" (delta), "0" ((u64)scale->mul_frac) );=0A =0A    =
 return product;=0A }=0A
--=__Part6D5C836F.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.xen.org
http://lists.xen.org/xen-devel

--=__Part6D5C836F.0__=--


From xen-devel-bounces@lists.xen.org Mon Nov 26 15:31:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 15:31:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td0ec-00075o-LN; Mon, 26 Nov 2012 15:31:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1Td0eb-00075b-7B; Mon, 26 Nov 2012 15:31:25 +0000
Received: from [85.158.138.51:22885] by server-11.bemta-3.messagelabs.com id
	AC/3B-19361-C4B83B05; Mon, 26 Nov 2012 15:31:24 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1353943881!22642654!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23035 invoked from network); 26 Nov 2012 15:31:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 15:31:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16004108"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 15:31:21 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Mon, 26 Nov 2012
	15:31:21 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Mon, 26 Nov 2012 15:31:21 +0000
Thread-Topic: [Xen-devel] [PATCH 07 of 15] libxl: ocaml: support for
	KeyedUnion in the bindings generator
Thread-Index: Ac3HRAU3yXQQH3ijS+6fQHRhPaelgwEpTDOQ
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107A4@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<0cf342afa9e6b506fad6.1353432207@cosworth.uk.xensource.com>
In-Reply-To: <0cf342afa9e6b506fad6.1353432207@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 07 of 15] libxl: ocaml: support for
 KeyedUnion in the bindings generator
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> 0cf342afa9e6b506fad68346cb3a1207030372eb
> # Parent  f618acdeea1bf60b3b68da4062de018d8162fe8c
> libxl: ocaml: support for KeyedUnion in the bindings generator.
> 
> A KeyedUnion consists of two fields in the containing struct. First an enum
> field ("e") used as a descriminator and second a union ("u") containing
> potentially anonymous structs associated with each enum value.
> 
> We map the anonymous structs to structs named after the descriminator
> field ("e") and the specific enum values. We then declare an ocaml variant
> type name e__union mapping each enum value to its associated struct.
> 
> So given IDL:
> 
>  foo = Enumeration("foo",
> 	(0, "BAR"),
> 	(1, "BAZ"),
>  s = Struct("s", [
>         ("u", KeyedUnion(none, foo, "blargle", [
> 		("bar", Struct(...xxx...)),
> 		("baz", Struct(...yyy...)),
> 	])),
>  ])
> 
> We generate C:
> 
>  enum { FOO, BAR } foo;
>  struct s {
>  	enum foo blargle;
>  	union {
>  		struct { ...xxx... } bar;
>  		struct { ...yyy... } baz;
>  	} u;
>  }
> 
> and map this to ocaml
> 
>  type foo = BAR | BAZ;
> 
>  module	s = Struct
> 
>  	type blargle_bar = ...xxx...;
> 
>  	type blargle_baz = ...yyy...;
> 
>  	type blargle__union = Bar of blargle_bar | Baz of blargle_baz;
> 
>  	type t =
>  	{
>  		blargle : blargle__union;
>  	}
> 
> These type names are OK because they are already within the namespace
> associated with the struct "s".

I think this is a useful representation of KeyedUnion types in ocaml.
I'll play around a bit with this implementation.

Cheers,
Rob
 
> If the struct assiated with bar is empty then we don't bother iwht
> blargle_bar of "of blargle_bar".
> 
> No actually change in the gnerated code since we don't generated any
> KeyedUnions yet.
> 
> The actual implementation was inspired by http://www.linux-
> nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php#ref_constvrnt
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 
> diff -r f618acdeea1b -r 0cf342afa9e6 tools/libxl/idl.py
> --- a/tools/libxl/idl.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/libxl/idl.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -216,6 +216,9 @@ class Struct(Aggregate):
>          kwargs.setdefault('passby', PASS_BY_REFERENCE)
>          Aggregate.__init__(self, "struct", name, fields, **kwargs)
> 
> +    def has_fields(self):
> +        return len(self.fields) != 0
> +
>  class Union(Aggregate):
>      def __init__(self, name, fields, **kwargs):
>          # Generally speaking some intelligence is required to free a diff -r
> f618acdeea1b -r 0cf342afa9e6 tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -65,6 +65,8 @@ def ocaml_type_of(ty):
>          if not typename:
>              raise NotImplementedError("No typename for Builtin %s (%s)" %
> (ty.typename, type(ty)))
>          return typename
> +    elif isinstance(ty,idl.KeyedUnion):
> +        return ty.union_name
>      elif isinstance(ty,idl.Aggregate):
>          return ty.rawname.capitalize() + ".t"
>      else:
> @@ -76,8 +78,67 @@ def munge_name(name):
>      else:
>          return name
> 
> -def ocaml_instance_of(type, name):
> -    return "%s : %s" % (munge_name(name), ocaml_type_of(type))
> +def ocaml_instance_of_field(f):
> +    if isinstance(f.type, idl.KeyedUnion):
> +        name = f.type.keyvar.name
> +    else:
> +        name = f.name
> +    return "%s : %s" % (munge_name(name), ocaml_type_of(f.type))
> +
> +def gen_struct(ty):
> +    s = ""
> +    for f in ty.fields:
> +        if f.type.private:
> +            continue
> +        x = ocaml_instance_of_field(f)
> +        x = x.replace("\n", "\n\t\t")
> +        s += "\t\t" + x + ";\n"
> +    return s
> +
> +def gen_ocaml_keyedunions(ty, interface, indent, parent = None):
> +    s = ""
> +
> +    if ty.rawname is not None:
> +        # Non-anonymous types need no special handling
> +        pass
> +    elif isinstance(ty, idl.KeyedUnion):
> +        if parent is None:
> +            nparent = ty.keyvar.name
> +        else:
> +            nparent = parent + "_" + ty.keyvar.name
> +
> +        for f in ty.fields:
> +            if f.type is None: continue
> +            if f.type.rawname is not None: continue
> +            if isinstance(f.type, idl.Struct) and not f.type.has_fields(): continue
> +            s += "\ntype %s_%s =\n" % (nparent,f.name)
> +            s += "{\n"
> +            s += gen_struct(f.type)
> +            s += "}\n"
> +
> +        name = "%s__union" % ty.keyvar.name
> +        s += "\n"
> +        s += "type %s = " % name
> +        u = []
> +        for f in ty.fields:
> +            if f.type is None:
> +                u.append("%s" % (f.name.capitalize()))
> +            elif isinstance(f.type, idl.Struct):
> +                if f.type.rawname is not None:
> +                    u.append("%s of %s" % (f.name.capitalize(),
> f.type.rawname.capitalize()))
> +                elif f.type.has_fields():
> +                    u.append("%s of %s_%s" % (f.name.capitalize(), nparent,
> f.name))
> +                else:
> +                    u.append("%s" % (f.name.capitalize()))
> +            else:
> +                raise NotImplementedError("Cannot handle KeyedUnion
> + fields which are not Structs")
> +
> +        s += " | ".join(u) + "\n"
> +        ty.union_name = name
> +
> +    if s == "":
> +        return None
> +    return s.replace("\n", "\n%s" % indent)
> 
>  def gen_ocaml_ml(ty, interface, indent=""):
> 
> @@ -103,16 +164,17 @@ def gen_ocaml_ml(ty, interface, indent="
>                  s += "module %s : sig\n" % module_name
>              else:
>                  s += "module %s = struct\n" % module_name
> -            s += "\ttype t =\n"
> -            s += "\t{\n"
> -
> +
> +        # Handle KeyedUnions...
>          for f in ty.fields:
> -            if f.type.private:
> -                continue
> -            x = ocaml_instance_of(f.type, f.name)
> -            x = x.replace("\n", "\n\t\t")
> -            s += "\t\t" + x + ";\n"
> +            ku = gen_ocaml_keyedunions(f.type, interface, "\t")
> +            if ku is not None:
> +                s += ku
> +                s += "\n"
> 
> +        s += "\ttype t =\n"
> +        s += "\t{\n"
> +        s += gen_struct(ty)
>          s += "\t}\n"
> 
>          if functions.has_key(ty.rawname):
> @@ -164,12 +226,43 @@ def c_val(ty, c, o, indent="", parent =
>              n += 1
>          s += "    default: failwith_xl(\"cannot convert value to %s\", lg);
> break;\n" % ty.typename
>          s += "}"
> -    elif isinstance(ty, idl.Aggregate) and (parent is None):
> +    elif isinstance(ty, idl.KeyedUnion):
> +        s += "{\n"
> +        s += "\tif(Is_long(%s)) {\n" % o
> +        n = 0
> +        s += "\t\tswitch(Int_val(%s)) {\n" % o
> +        for f in ty.fields:
> +            if f.type is None or not f.type.has_fields():
> +                s += "\t\t    case %d: %s = %s; break;\n" % (n,
> +                                                    parent + ty.keyvar.name,
> +                                                    f.enumname)
> +            n += 1
> +        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (long)\",
> lg); break;\n" % (parent, ty.keyvar.name)
> +        s += "\t\t}\n"
> +        s += "\t} else {\n"
> +        s += "\t\t/* Is block... */\n"
> +        s += "\t\tswitch(Tag_val(%s)) {\n" % o
> +        n = 0
> +        for f in ty.fields:
> +            if f.type is not None and f.type.has_fields():
> +                if f.type.private:
> +                    continue
> +                s += "\t\t    case %d:\n" % (n)
> +                s += "\t\t        %s = %s;\n" % (parent + ty.keyvar.name, f.enumname)
> +                (nparent,fexpr) = ty.member(c, f, False)
> +                s += "%s" % c_val(f.type, fexpr, o, indent=indent+"\t\t        ")
> +                s += "break;\n"
> +            n += 1
> +        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (block)\",
> lg); break;\n" % (parent, ty.keyvar.name)
> +        s += "\t\t}\n"
> +        s += "\t}\n"
> +        s += "}"
> +    elif isinstance(ty, idl.Aggregate) and (parent is None or ty.rawname is
> None):
>          n = 0
>          for f in ty.fields:
>              if f.type.private:
>                  continue
> -            (nparent,fexpr) = ty.member(c, f, parent is None)
> +            (nparent,fexpr) = ty.member(c, f, ty.rawname is not None)
>              s += "%s\n" % c_val(f.type, fexpr, "Field(%s, %d)" % (o,n),
> parent=nparent)
>              n = n + 1
>      else:
> @@ -191,8 +284,8 @@ def gen_c_val(ty, indent=""):
>      s += "}\n"
> 
>      return s.replace("\n", "\n%s" % indent)
> -
> -def ocaml_Val(ty, o, c, indent="", parent = None):
> +
> +def ocaml_Val(ty, o, c, indent="", parent = None, struct_tag = None):
>      s = indent
>      if isinstance(ty,idl.UInt):
>          if ty.width in [8, 16]:
> @@ -231,11 +324,39 @@ def ocaml_Val(ty, o, c, indent="", paren
>              n += 1
>          s += "    default: failwith_xl(\"cannot convert value from %s\", lg);
> break;\n" % ty.typename
>          s += "}"
> -    elif isinstance(ty,idl.Aggregate) and (parent is None):
> +    elif isinstance(ty, idl.KeyedUnion):
> +        n = 0
> +        s += "switch(%s) {\n" % (parent + ty.keyvar.name)
> +        for f in ty.fields:
> +            s += "\t    case %s:\n" % f.enumname
> +            if f.type is None:
> +                s += "\t        /* %d: None */\n" % n
> +                s += "\t        %s = Val_long(%d);\n" % (o,n)
> +            elif not f.type.has_fields():
> +                s += "\t        /* %d: Long */\n" % n
> +                s += "\t        %s = Val_long(%d);\n" % (o,n)
> +            else:
> +                s += "\t        /* %d: Block */\n" % n
> +                (nparent,fexpr) = ty.member(c, f, parent is None)
> +                s += ocaml_Val(f.type, o, fexpr, struct_tag = n, indent="\t        ",
> parent=nparent)
> +                s += "\n"
> +                #s += "\t        %s = caml_alloc(%d,%d);\n" % (o,len(f.type.fields),n)
> +            s += "\t        break;\n"
> +            n += 1
> +        s += "\t    default: failwith_xl(\"cannot convert value from %s\", lg);
> break;\n" % ty.typename
> +        s += "\t}"
> +    elif isinstance(ty,idl.Aggregate) and (parent is None or ty.rawname is
> None):
>          s += "{\n"
> -        s += "\tvalue %s_field;\n" % ty.rawname
> +        if ty.rawname is None:
> +            fn = "anon_field"
> +        else:
> +            fn = "%s_field" % ty.rawname
> +        s += "\tvalue %s;\n" % fn
>          s += "\n"
> -        s += "\t%s = caml_alloc_tuple(%d);\n" % (o, len(ty.fields))
> +        if struct_tag is not None:
> +            s += "\t%s = caml_alloc(%d,%d);\n" % (o, len(ty.fields), struct_tag)
> +        else:
> +            s += "\t%s = caml_alloc_tuple(%d);\n" % (o, len(ty.fields))
> 
>          n = 0
>          for f in ty.fields:
> @@ -245,8 +366,8 @@ def ocaml_Val(ty, o, c, indent="", paren
>              (nparent,fexpr) = ty.member(c, f, parent is None)
> 
>              s += "\n"
> -            s += "\t%s\n" % ocaml_Val(f.type, "%s_field" % ty.rawname,
> ty.pass_arg(fexpr, c), parent=nparent)
> -            s += "\tStore_field(%s, %d, %s);\n" % (o, n, "%s_field" % ty.rawname)
> +            s += "\t%s\n" % ocaml_Val(f.type, fn, ty.pass_arg(fexpr, c),
> parent=nparent)
> +            s += "\tStore_field(%s, %d, %s);\n" % (o, n, fn)
>              n = n + 1
>          s += "}"
>      else:
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 15:31:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 15:31:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td0ec-00075o-LN; Mon, 26 Nov 2012 15:31:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1Td0eb-00075b-7B; Mon, 26 Nov 2012 15:31:25 +0000
Received: from [85.158.138.51:22885] by server-11.bemta-3.messagelabs.com id
	AC/3B-19361-C4B83B05; Mon, 26 Nov 2012 15:31:24 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1353943881!22642654!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23035 invoked from network); 26 Nov 2012 15:31:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 15:31:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16004108"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 15:31:21 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Mon, 26 Nov 2012
	15:31:21 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Mon, 26 Nov 2012 15:31:21 +0000
Thread-Topic: [Xen-devel] [PATCH 07 of 15] libxl: ocaml: support for
	KeyedUnion in the bindings generator
Thread-Index: Ac3HRAU3yXQQH3ijS+6fQHRhPaelgwEpTDOQ
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107A4@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<0cf342afa9e6b506fad6.1353432207@cosworth.uk.xensource.com>
In-Reply-To: <0cf342afa9e6b506fad6.1353432207@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 07 of 15] libxl: ocaml: support for
 KeyedUnion in the bindings generator
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> 0cf342afa9e6b506fad68346cb3a1207030372eb
> # Parent  f618acdeea1bf60b3b68da4062de018d8162fe8c
> libxl: ocaml: support for KeyedUnion in the bindings generator.
> 
> A KeyedUnion consists of two fields in the containing struct. First an enum
> field ("e") used as a descriminator and second a union ("u") containing
> potentially anonymous structs associated with each enum value.
> 
> We map the anonymous structs to structs named after the descriminator
> field ("e") and the specific enum values. We then declare an ocaml variant
> type name e__union mapping each enum value to its associated struct.
> 
> So given IDL:
> 
>  foo = Enumeration("foo",
> 	(0, "BAR"),
> 	(1, "BAZ"),
>  s = Struct("s", [
>         ("u", KeyedUnion(none, foo, "blargle", [
> 		("bar", Struct(...xxx...)),
> 		("baz", Struct(...yyy...)),
> 	])),
>  ])
> 
> We generate C:
> 
>  enum { FOO, BAR } foo;
>  struct s {
>  	enum foo blargle;
>  	union {
>  		struct { ...xxx... } bar;
>  		struct { ...yyy... } baz;
>  	} u;
>  }
> 
> and map this to ocaml
> 
>  type foo = BAR | BAZ;
> 
>  module	s = Struct
> 
>  	type blargle_bar = ...xxx...;
> 
>  	type blargle_baz = ...yyy...;
> 
>  	type blargle__union = Bar of blargle_bar | Baz of blargle_baz;
> 
>  	type t =
>  	{
>  		blargle : blargle__union;
>  	}
> 
> These type names are OK because they are already within the namespace
> associated with the struct "s".

I think this is a useful representation of KeyedUnion types in ocaml.
I'll play around a bit with this implementation.

Cheers,
Rob
 
> If the struct assiated with bar is empty then we don't bother iwht
> blargle_bar of "of blargle_bar".
> 
> No actually change in the gnerated code since we don't generated any
> KeyedUnions yet.
> 
> The actual implementation was inspired by http://www.linux-
> nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php#ref_constvrnt
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 
> diff -r f618acdeea1b -r 0cf342afa9e6 tools/libxl/idl.py
> --- a/tools/libxl/idl.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/libxl/idl.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -216,6 +216,9 @@ class Struct(Aggregate):
>          kwargs.setdefault('passby', PASS_BY_REFERENCE)
>          Aggregate.__init__(self, "struct", name, fields, **kwargs)
> 
> +    def has_fields(self):
> +        return len(self.fields) != 0
> +
>  class Union(Aggregate):
>      def __init__(self, name, fields, **kwargs):
>          # Generally speaking some intelligence is required to free a diff -r
> f618acdeea1b -r 0cf342afa9e6 tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -65,6 +65,8 @@ def ocaml_type_of(ty):
>          if not typename:
>              raise NotImplementedError("No typename for Builtin %s (%s)" %
> (ty.typename, type(ty)))
>          return typename
> +    elif isinstance(ty,idl.KeyedUnion):
> +        return ty.union_name
>      elif isinstance(ty,idl.Aggregate):
>          return ty.rawname.capitalize() + ".t"
>      else:
> @@ -76,8 +78,67 @@ def munge_name(name):
>      else:
>          return name
> 
> -def ocaml_instance_of(type, name):
> -    return "%s : %s" % (munge_name(name), ocaml_type_of(type))
> +def ocaml_instance_of_field(f):
> +    if isinstance(f.type, idl.KeyedUnion):
> +        name = f.type.keyvar.name
> +    else:
> +        name = f.name
> +    return "%s : %s" % (munge_name(name), ocaml_type_of(f.type))
> +
> +def gen_struct(ty):
> +    s = ""
> +    for f in ty.fields:
> +        if f.type.private:
> +            continue
> +        x = ocaml_instance_of_field(f)
> +        x = x.replace("\n", "\n\t\t")
> +        s += "\t\t" + x + ";\n"
> +    return s
> +
> +def gen_ocaml_keyedunions(ty, interface, indent, parent = None):
> +    s = ""
> +
> +    if ty.rawname is not None:
> +        # Non-anonymous types need no special handling
> +        pass
> +    elif isinstance(ty, idl.KeyedUnion):
> +        if parent is None:
> +            nparent = ty.keyvar.name
> +        else:
> +            nparent = parent + "_" + ty.keyvar.name
> +
> +        for f in ty.fields:
> +            if f.type is None: continue
> +            if f.type.rawname is not None: continue
> +            if isinstance(f.type, idl.Struct) and not f.type.has_fields(): continue
> +            s += "\ntype %s_%s =\n" % (nparent,f.name)
> +            s += "{\n"
> +            s += gen_struct(f.type)
> +            s += "}\n"
> +
> +        name = "%s__union" % ty.keyvar.name
> +        s += "\n"
> +        s += "type %s = " % name
> +        u = []
> +        for f in ty.fields:
> +            if f.type is None:
> +                u.append("%s" % (f.name.capitalize()))
> +            elif isinstance(f.type, idl.Struct):
> +                if f.type.rawname is not None:
> +                    u.append("%s of %s" % (f.name.capitalize(),
> f.type.rawname.capitalize()))
> +                elif f.type.has_fields():
> +                    u.append("%s of %s_%s" % (f.name.capitalize(), nparent,
> f.name))
> +                else:
> +                    u.append("%s" % (f.name.capitalize()))
> +            else:
> +                raise NotImplementedError("Cannot handle KeyedUnion
> + fields which are not Structs")
> +
> +        s += " | ".join(u) + "\n"
> +        ty.union_name = name
> +
> +    if s == "":
> +        return None
> +    return s.replace("\n", "\n%s" % indent)
> 
>  def gen_ocaml_ml(ty, interface, indent=""):
> 
> @@ -103,16 +164,17 @@ def gen_ocaml_ml(ty, interface, indent="
>                  s += "module %s : sig\n" % module_name
>              else:
>                  s += "module %s = struct\n" % module_name
> -            s += "\ttype t =\n"
> -            s += "\t{\n"
> -
> +
> +        # Handle KeyedUnions...
>          for f in ty.fields:
> -            if f.type.private:
> -                continue
> -            x = ocaml_instance_of(f.type, f.name)
> -            x = x.replace("\n", "\n\t\t")
> -            s += "\t\t" + x + ";\n"
> +            ku = gen_ocaml_keyedunions(f.type, interface, "\t")
> +            if ku is not None:
> +                s += ku
> +                s += "\n"
> 
> +        s += "\ttype t =\n"
> +        s += "\t{\n"
> +        s += gen_struct(ty)
>          s += "\t}\n"
> 
>          if functions.has_key(ty.rawname):
> @@ -164,12 +226,43 @@ def c_val(ty, c, o, indent="", parent =
>              n += 1
>          s += "    default: failwith_xl(\"cannot convert value to %s\", lg);
> break;\n" % ty.typename
>          s += "}"
> -    elif isinstance(ty, idl.Aggregate) and (parent is None):
> +    elif isinstance(ty, idl.KeyedUnion):
> +        s += "{\n"
> +        s += "\tif(Is_long(%s)) {\n" % o
> +        n = 0
> +        s += "\t\tswitch(Int_val(%s)) {\n" % o
> +        for f in ty.fields:
> +            if f.type is None or not f.type.has_fields():
> +                s += "\t\t    case %d: %s = %s; break;\n" % (n,
> +                                                    parent + ty.keyvar.name,
> +                                                    f.enumname)
> +            n += 1
> +        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (long)\",
> lg); break;\n" % (parent, ty.keyvar.name)
> +        s += "\t\t}\n"
> +        s += "\t} else {\n"
> +        s += "\t\t/* Is block... */\n"
> +        s += "\t\tswitch(Tag_val(%s)) {\n" % o
> +        n = 0
> +        for f in ty.fields:
> +            if f.type is not None and f.type.has_fields():
> +                if f.type.private:
> +                    continue
> +                s += "\t\t    case %d:\n" % (n)
> +                s += "\t\t        %s = %s;\n" % (parent + ty.keyvar.name, f.enumname)
> +                (nparent,fexpr) = ty.member(c, f, False)
> +                s += "%s" % c_val(f.type, fexpr, o, indent=indent+"\t\t        ")
> +                s += "break;\n"
> +            n += 1
> +        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (block)\",
> lg); break;\n" % (parent, ty.keyvar.name)
> +        s += "\t\t}\n"
> +        s += "\t}\n"
> +        s += "}"
> +    elif isinstance(ty, idl.Aggregate) and (parent is None or ty.rawname is
> None):
>          n = 0
>          for f in ty.fields:
>              if f.type.private:
>                  continue
> -            (nparent,fexpr) = ty.member(c, f, parent is None)
> +            (nparent,fexpr) = ty.member(c, f, ty.rawname is not None)
>              s += "%s\n" % c_val(f.type, fexpr, "Field(%s, %d)" % (o,n),
> parent=nparent)
>              n = n + 1
>      else:
> @@ -191,8 +284,8 @@ def gen_c_val(ty, indent=""):
>      s += "}\n"
> 
>      return s.replace("\n", "\n%s" % indent)
> -
> -def ocaml_Val(ty, o, c, indent="", parent = None):
> +
> +def ocaml_Val(ty, o, c, indent="", parent = None, struct_tag = None):
>      s = indent
>      if isinstance(ty,idl.UInt):
>          if ty.width in [8, 16]:
> @@ -231,11 +324,39 @@ def ocaml_Val(ty, o, c, indent="", paren
>              n += 1
>          s += "    default: failwith_xl(\"cannot convert value from %s\", lg);
> break;\n" % ty.typename
>          s += "}"
> -    elif isinstance(ty,idl.Aggregate) and (parent is None):
> +    elif isinstance(ty, idl.KeyedUnion):
> +        n = 0
> +        s += "switch(%s) {\n" % (parent + ty.keyvar.name)
> +        for f in ty.fields:
> +            s += "\t    case %s:\n" % f.enumname
> +            if f.type is None:
> +                s += "\t        /* %d: None */\n" % n
> +                s += "\t        %s = Val_long(%d);\n" % (o,n)
> +            elif not f.type.has_fields():
> +                s += "\t        /* %d: Long */\n" % n
> +                s += "\t        %s = Val_long(%d);\n" % (o,n)
> +            else:
> +                s += "\t        /* %d: Block */\n" % n
> +                (nparent,fexpr) = ty.member(c, f, parent is None)
> +                s += ocaml_Val(f.type, o, fexpr, struct_tag = n, indent="\t        ",
> parent=nparent)
> +                s += "\n"
> +                #s += "\t        %s = caml_alloc(%d,%d);\n" % (o,len(f.type.fields),n)
> +            s += "\t        break;\n"
> +            n += 1
> +        s += "\t    default: failwith_xl(\"cannot convert value from %s\", lg);
> break;\n" % ty.typename
> +        s += "\t}"
> +    elif isinstance(ty,idl.Aggregate) and (parent is None or ty.rawname is
> None):
>          s += "{\n"
> -        s += "\tvalue %s_field;\n" % ty.rawname
> +        if ty.rawname is None:
> +            fn = "anon_field"
> +        else:
> +            fn = "%s_field" % ty.rawname
> +        s += "\tvalue %s;\n" % fn
>          s += "\n"
> -        s += "\t%s = caml_alloc_tuple(%d);\n" % (o, len(ty.fields))
> +        if struct_tag is not None:
> +            s += "\t%s = caml_alloc(%d,%d);\n" % (o, len(ty.fields), struct_tag)
> +        else:
> +            s += "\t%s = caml_alloc_tuple(%d);\n" % (o, len(ty.fields))
> 
>          n = 0
>          for f in ty.fields:
> @@ -245,8 +366,8 @@ def ocaml_Val(ty, o, c, indent="", paren
>              (nparent,fexpr) = ty.member(c, f, parent is None)
> 
>              s += "\n"
> -            s += "\t%s\n" % ocaml_Val(f.type, "%s_field" % ty.rawname,
> ty.pass_arg(fexpr, c), parent=nparent)
> -            s += "\tStore_field(%s, %d, %s);\n" % (o, n, "%s_field" % ty.rawname)
> +            s += "\t%s\n" % ocaml_Val(f.type, fn, ty.pass_arg(fexpr, c),
> parent=nparent)
> +            s += "\tStore_field(%s, %d, %s);\n" % (o, n, fn)
>              n = n + 1
>          s += "}"
>      else:
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 15:36:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 15:36:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td0jA-0007JG-Lr; Mon, 26 Nov 2012 15:36:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Td0j9-0007Iz-9f; Mon, 26 Nov 2012 15:36:07 +0000
Received: from [85.158.139.83:12318] by server-5.bemta-5.messagelabs.com id
	C6/C8-11353-46C83B05; Mon, 26 Nov 2012 15:36:04 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1353944142!28003243!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5862 invoked from network); 26 Nov 2012 15:35:42 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 15:35:42 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16004237"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 15:35:18 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 15:35:18 +0000
Message-ID: <1353944117.5830.77.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Rob Hoes <Rob.Hoes@citrix.com>
Date: Mon, 26 Nov 2012 15:35:17 +0000
In-Reply-To: <7EA643C653F17F4C80DE959E978F10EDFA101107A1@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<7EA643C653F17F4C80DE959E978F10EDFA101107A1@LONPMAILBOX01.citrite.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-api@lists.xen.org" <xen-api@lists.xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 00 of 15] libxl: ocaml: improve the bindings
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 14:01 +0000, Rob Hoes wrote:
> Hi Ian,
> 
> > The following series makes the libxl ocaml bindings somewhat more useful
> > (for some small value of useful).
> 
> Great timing: I am currently investigating how to port xenopsd/xapi to
> libxl (for XCP and XenServer),

Awesome!

>  and have been playing with these bindings as well. I indeed noticed a
> few shortcomings and omissions.

Hopefully they are somewhat fewer in number after this series ;-)

[...]
> I'll use your patches as a base for my own improvements to the bindings. Thanks for releasing these.

Cool, let me know if you have any trouble or I can do anything (the
binding generator is a bit of a beast for example).

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 15:36:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 15:36:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td0jA-0007JG-Lr; Mon, 26 Nov 2012 15:36:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Td0j9-0007Iz-9f; Mon, 26 Nov 2012 15:36:07 +0000
Received: from [85.158.139.83:12318] by server-5.bemta-5.messagelabs.com id
	C6/C8-11353-46C83B05; Mon, 26 Nov 2012 15:36:04 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1353944142!28003243!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5862 invoked from network); 26 Nov 2012 15:35:42 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 15:35:42 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16004237"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 15:35:18 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 15:35:18 +0000
Message-ID: <1353944117.5830.77.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Rob Hoes <Rob.Hoes@citrix.com>
Date: Mon, 26 Nov 2012 15:35:17 +0000
In-Reply-To: <7EA643C653F17F4C80DE959E978F10EDFA101107A1@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<7EA643C653F17F4C80DE959E978F10EDFA101107A1@LONPMAILBOX01.citrite.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-api@lists.xen.org" <xen-api@lists.xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 00 of 15] libxl: ocaml: improve the bindings
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 14:01 +0000, Rob Hoes wrote:
> Hi Ian,
> 
> > The following series makes the libxl ocaml bindings somewhat more useful
> > (for some small value of useful).
> 
> Great timing: I am currently investigating how to port xenopsd/xapi to
> libxl (for XCP and XenServer),

Awesome!

>  and have been playing with these bindings as well. I indeed noticed a
> few shortcomings and omissions.

Hopefully they are somewhat fewer in number after this series ;-)

[...]
> I'll use your patches as a base for my own improvements to the bindings. Thanks for releasing these.

Cool, let me know if you have any trouble or I can do anything (the
binding generator is a bit of a beast for example).

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 15:36:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 15:36:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td0jD-0007Jl-8X; Mon, 26 Nov 2012 15:36:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Td0jC-0007JO-DY; Mon, 26 Nov 2012 15:36:10 +0000
Received: from [85.158.139.83:12925] by server-15.bemta-5.messagelabs.com id
	FD/60-26920-96C83B05; Mon, 26 Nov 2012 15:36:09 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1353944142!28003243!2
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6630 invoked from network); 26 Nov 2012 15:35:57 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 15:35:57 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16004250"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 15:35:42 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 15:35:42 +0000
Message-ID: <1353944141.5830.79.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Rob Hoes <Rob.Hoes@citrix.com>
Date: Mon, 26 Nov 2012 15:35:41 +0000
In-Reply-To: <7EA643C653F17F4C80DE959E978F10EDFA101107A4@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<0cf342afa9e6b506fad6.1353432207@cosworth.uk.xensource.com>
	<7EA643C653F17F4C80DE959E978F10EDFA101107A4@LONPMAILBOX01.citrite.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-api@lists.xen.org" <xen-api@lists.xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 07 of 15] libxl: ocaml: support for
 KeyedUnion in the bindings generator
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 15:31 +0000, Rob Hoes wrote:
> I think this is a useful representation of KeyedUnion types in ocaml.
> I'll play around a bit with this implementation.

Thanks, one of the problem I have with these bindings is that although I
can clone and hack ocaml OK I'm not sure what constructs are expected by
proper ocaml programmers ;-)

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 15:36:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 15:36:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td0jD-0007Jl-8X; Mon, 26 Nov 2012 15:36:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Td0jC-0007JO-DY; Mon, 26 Nov 2012 15:36:10 +0000
Received: from [85.158.139.83:12925] by server-15.bemta-5.messagelabs.com id
	FD/60-26920-96C83B05; Mon, 26 Nov 2012 15:36:09 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1353944142!28003243!2
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6630 invoked from network); 26 Nov 2012 15:35:57 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 15:35:57 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16004250"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 15:35:42 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 15:35:42 +0000
Message-ID: <1353944141.5830.79.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Rob Hoes <Rob.Hoes@citrix.com>
Date: Mon, 26 Nov 2012 15:35:41 +0000
In-Reply-To: <7EA643C653F17F4C80DE959E978F10EDFA101107A4@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<0cf342afa9e6b506fad6.1353432207@cosworth.uk.xensource.com>
	<7EA643C653F17F4C80DE959E978F10EDFA101107A4@LONPMAILBOX01.citrite.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-api@lists.xen.org" <xen-api@lists.xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 07 of 15] libxl: ocaml: support for
 KeyedUnion in the bindings generator
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 15:31 +0000, Rob Hoes wrote:
> I think this is a useful representation of KeyedUnion types in ocaml.
> I'll play around a bit with this implementation.

Thanks, one of the problem I have with these bindings is that although I
can clone and hack ocaml OK I'm not sure what constructs are expected by
proper ocaml programmers ;-)

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 15:37:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 15:37:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td0k0-0007TA-2e; Mon, 26 Nov 2012 15:37:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Td0jy-0007SF-3J; Mon, 26 Nov 2012 15:36:58 +0000
Received: from [85.158.143.99:8501] by server-1.bemta-4.messagelabs.com id
	6F/D2-27934-99C83B05; Mon, 26 Nov 2012 15:36:57 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1353944215!20930254!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2233 invoked from network); 26 Nov 2012 15:36:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 15:36:55 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16004293"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 15:36:54 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 15:36:54 +0000
Message-ID: <1353944213.5830.80.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Rob Hoes <Rob.Hoes@citrix.com>
Date: Mon, 26 Nov 2012 15:36:53 +0000
In-Reply-To: <7EA643C653F17F4C80DE959E978F10EDFA101107A1@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<7EA643C653F17F4C80DE959E978F10EDFA101107A1@LONPMAILBOX01.citrite.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-api@lists.xen.org" <xen-api@lists.xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 00 of 15] libxl: ocaml: improve the bindings
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 14:01 +0000, Rob Hoes wrote:
> I'll use your patches as a base for my own improvements to the bindings.

BTW, I'd happily commit any which you care to attach an "Acked-by" to.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 15:37:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 15:37:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td0k0-0007TA-2e; Mon, 26 Nov 2012 15:37:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Td0jy-0007SF-3J; Mon, 26 Nov 2012 15:36:58 +0000
Received: from [85.158.143.99:8501] by server-1.bemta-4.messagelabs.com id
	6F/D2-27934-99C83B05; Mon, 26 Nov 2012 15:36:57 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1353944215!20930254!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2233 invoked from network); 26 Nov 2012 15:36:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 15:36:55 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16004293"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 15:36:54 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 15:36:54 +0000
Message-ID: <1353944213.5830.80.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Rob Hoes <Rob.Hoes@citrix.com>
Date: Mon, 26 Nov 2012 15:36:53 +0000
In-Reply-To: <7EA643C653F17F4C80DE959E978F10EDFA101107A1@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<7EA643C653F17F4C80DE959E978F10EDFA101107A1@LONPMAILBOX01.citrite.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-api@lists.xen.org" <xen-api@lists.xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 00 of 15] libxl: ocaml: improve the bindings
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 14:01 +0000, Rob Hoes wrote:
> I'll use your patches as a base for my own improvements to the bindings.

BTW, I'd happily commit any which you care to attach an "Acked-by" to.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 15:59:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 15:59:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td15P-00084l-2d; Mon, 26 Nov 2012 15:59:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td15N-00084g-T5
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 15:59:06 +0000
Received: from [193.109.254.147:20600] by server-1.bemta-14.messagelabs.com id
	9F/51-25314-9C193B05; Mon, 26 Nov 2012 15:59:05 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1353945516!1742819!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15336 invoked from network); 26 Nov 2012 15:58:37 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 15:58:37 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16005147"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 15:58:36 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 15:58:36 +0000
Message-ID: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: xen-devel <xen-devel@lists.xen.org>
Date: Mon, 26 Nov 2012 15:58:34 +0000
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>, Lars Kurth <lars.kurth@xen.org>,
	Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>
Subject: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Lars (I presume it was he who added this TODO) would like to have a
policy written down.
http://wiki.xen.org/wiki/Xen_Document_Days/TODO#Document_Policy_on_Maintenance_Releases says:
        Which releases are supported, for how long. Owners. As well as a
        mechanism for individuals (or vendors) to take ownership of
        older releases (as is the case for Xen 4.3). 

(I think s/4.3/3.4/ was intended in the above)

I thought it would be worth sketching out my understanding of the
informal process we have for people to pick holes in. I've tried to
stick to what we actually do rather than defining policy.

Ian.

8<--------------------

Each new Xen release X.Y.0 starts a new stable maintenance branch.

Each such branch is in in its own mercurial repository
xen-X.Y-testing.hg. Releases happen roughly every 3 months. The first
release on a stable branch is often sooner and as the branch reaches the
end of its life the interval may be longer.

In general Xen.org supports the two most recent stable branches at any
given time. When a new X.Y.0 release is made there is usually one more
release on the to-be-retired stable branch to mop up any loose patches
sitting in the repo at which point the branch is retired. For example we
are currently in the 4.3 development cycle and are supporting two stable
branches: 4.1-testing and 4.2-testing. After 4.2.0 was released there
was one more release in the 4.0-testing stream (4.0.4 IIRC) and then the
4.0 branch was been retired.

        XXX how did Jan become stable maintainer, I think he just
        volunteered at the developer meeting and was accepted via the
        usual consensus driven approach? Lets try:

Each stable branch has a maintainer who is nominated/volunteers and is
accepted via consensus among the maintainers and committers (XXX or just
committers?). For the branches maintained by Xen.org this would usually
be one of the xen-unstable committers or maintainers. However community
members can step up to maintain a release once Xen.org no longer does so
(e.g. as happened with Keith and xen-3.4-testing.hg).

Currently Jan Beulich is the stable maintainer for both 4.1-testing and
4.2-testing having taken over from Keir Fraser when 4.2.0 was released.
Jan delegates tools backports to Ian Jackson. Community member Keith
Coleman continues to maintain the 3.4-testing branch (XXX does he
still?) which he took over when 4.1.0 was released.

No new development happens in the X.Y-testing branches, instead
changesets are backported from xen-unstable. Where this is not possible
(perhaps unstable has moved on such that the patch cannot be applied or
the approach used in unstable is otherwise not valid for the stable
branch) then a specific fix can be created for the stable branch.
However it is a requirement that the issue will always be fixed in
unstable first (this is to avoid regressions on the next stable
release).

In general only bug fixes are accepted into stable branches and new
features are not normally accepted. (There can be exceptions, e.g. it
was agreed that 4.2.1 would take a more relaxed approach to features
which improved xl compatibility with xm). As time passes each stable
branch becomes more conservative and the barrier to accepting a patch
for backport becomes higher.

Changesets are nominated for inclusion in the stable branch by making a
request to the stable maintainer on xen-devel either by noting it as
such in the submission of the original patch to xen-unstable or by a
subsequent explicit email to xen-devel. In addition as part of the the
stable release process the stable maintainer will send one or more
requests to xen-devel soliciting suggestions for patches which should be
included.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 15:59:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 15:59:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td15P-00084l-2d; Mon, 26 Nov 2012 15:59:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td15N-00084g-T5
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 15:59:06 +0000
Received: from [193.109.254.147:20600] by server-1.bemta-14.messagelabs.com id
	9F/51-25314-9C193B05; Mon, 26 Nov 2012 15:59:05 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1353945516!1742819!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15336 invoked from network); 26 Nov 2012 15:58:37 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 15:58:37 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16005147"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 15:58:36 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 15:58:36 +0000
Message-ID: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: xen-devel <xen-devel@lists.xen.org>
Date: Mon, 26 Nov 2012 15:58:34 +0000
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>, Lars Kurth <lars.kurth@xen.org>,
	Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>
Subject: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Lars (I presume it was he who added this TODO) would like to have a
policy written down.
http://wiki.xen.org/wiki/Xen_Document_Days/TODO#Document_Policy_on_Maintenance_Releases says:
        Which releases are supported, for how long. Owners. As well as a
        mechanism for individuals (or vendors) to take ownership of
        older releases (as is the case for Xen 4.3). 

(I think s/4.3/3.4/ was intended in the above)

I thought it would be worth sketching out my understanding of the
informal process we have for people to pick holes in. I've tried to
stick to what we actually do rather than defining policy.

Ian.

8<--------------------

Each new Xen release X.Y.0 starts a new stable maintenance branch.

Each such branch is in in its own mercurial repository
xen-X.Y-testing.hg. Releases happen roughly every 3 months. The first
release on a stable branch is often sooner and as the branch reaches the
end of its life the interval may be longer.

In general Xen.org supports the two most recent stable branches at any
given time. When a new X.Y.0 release is made there is usually one more
release on the to-be-retired stable branch to mop up any loose patches
sitting in the repo at which point the branch is retired. For example we
are currently in the 4.3 development cycle and are supporting two stable
branches: 4.1-testing and 4.2-testing. After 4.2.0 was released there
was one more release in the 4.0-testing stream (4.0.4 IIRC) and then the
4.0 branch was been retired.

        XXX how did Jan become stable maintainer, I think he just
        volunteered at the developer meeting and was accepted via the
        usual consensus driven approach? Lets try:

Each stable branch has a maintainer who is nominated/volunteers and is
accepted via consensus among the maintainers and committers (XXX or just
committers?). For the branches maintained by Xen.org this would usually
be one of the xen-unstable committers or maintainers. However community
members can step up to maintain a release once Xen.org no longer does so
(e.g. as happened with Keith and xen-3.4-testing.hg).

Currently Jan Beulich is the stable maintainer for both 4.1-testing and
4.2-testing having taken over from Keir Fraser when 4.2.0 was released.
Jan delegates tools backports to Ian Jackson. Community member Keith
Coleman continues to maintain the 3.4-testing branch (XXX does he
still?) which he took over when 4.1.0 was released.

No new development happens in the X.Y-testing branches, instead
changesets are backported from xen-unstable. Where this is not possible
(perhaps unstable has moved on such that the patch cannot be applied or
the approach used in unstable is otherwise not valid for the stable
branch) then a specific fix can be created for the stable branch.
However it is a requirement that the issue will always be fixed in
unstable first (this is to avoid regressions on the next stable
release).

In general only bug fixes are accepted into stable branches and new
features are not normally accepted. (There can be exceptions, e.g. it
was agreed that 4.2.1 would take a more relaxed approach to features
which improved xl compatibility with xm). As time passes each stable
branch becomes more conservative and the barrier to accepting a patch
for backport becomes higher.

Changesets are nominated for inclusion in the stable branch by making a
request to the stable maintainer on xen-devel either by noting it as
such in the submission of the original patch to xen-unstable or by a
subsequent explicit email to xen-devel. In addition as part of the the
stable release process the stable maintainer will send one or more
requests to xen-devel soliciting suggestions for patches which should be
included.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:11:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1Gz-0000Dt-AB; Mon, 26 Nov 2012 16:11:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Td1Gx-0000Do-LP
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:11:03 +0000
Received: from [85.158.137.99:29248] by server-10.bemta-3.messagelabs.com id
	1C/2B-19806-69493B05; Mon, 26 Nov 2012 16:11:02 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1353946262!17523673!1
X-Originating-IP: [209.85.212.175]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7492 invoked from network); 26 Nov 2012 16:11:02 -0000
Received: from mail-wi0-f175.google.com (HELO mail-wi0-f175.google.com)
	(209.85.212.175)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:11:02 -0000
Received: by mail-wi0-f175.google.com with SMTP id hm11so3103969wib.14
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 08:11:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=CO5dgwFdD2dnt4skF7EPcSXk8Lot9H4ikQbAuC4aBXc=;
	b=LLe2WBVdJxqRlgV0NNl2eF3eqJSKGJW8VuqSXAXkMvBMNHljwVH8m81glpBmwHCJLl
	JXpkJI2QD5y2hmmdEuvqhzdztm62XUWJjYbd8aweIA58fy1oQtCXcR6yg6+mMOTnt0cG
	lAXrDpjeq3CTv8EiuwJbwAUIEPm9YLP0PBNO6OTm57jD61kRyKocrRQsuekILmlBDq4q
	30xk2r3IdSuJyUY9vghxRLTPribL15oxZabDRivrBVCw/OWtWPIp5BIzku5lZHQfiycs
	NRYWcSCNuTKPjl4gp2GxmwgndNrlPyD9brw9+sx4NRBmhd6ye2pumF8rMQVSAm8LQz2u
	EZoA==
Received: by 10.181.13.75 with SMTP id ew11mr18511374wid.9.1353946262081;
	Mon, 26 Nov 2012 08:11:02 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id p2sm24406651wic.7.2012.11.26.08.10.57
	(version=SSLv3 cipher=OTHER); Mon, 26 Nov 2012 08:11:01 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Mon, 26 Nov 2012 16:10:53 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCD9450D.53691%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
Thread-Index: Ac3L8JvLaGwWpI2GKkWdDCw99VvpHQ==
In-Reply-To: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 26/11/2012 15:23, "Jan Beulich" <JBeulich@suse.com> wrote:

> The way it was coded, it clobbered %rdx without telling the compiler.
> This generally didn't cause any problems except when there are two back
> to back invocations (as in plt_overflow()), as in that case the
> compiler may validly assume that it can re-use for the second instance
> the value loaded into %rdx before the first one.
> 
> Once at it, also properly relax the second operand of "mul" (there's no
> need for it to be in %rdx, or a register at all), and switch away from
> using explicit register names in the instruction operands.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Ugh. Thank you very much, Jan! What a horrible bug.

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/arch/x86/time.c
> +++ b/xen/arch/x86/time.c
> @@ -127,8 +127,9 @@ static inline u64 scale_delta(u64 delta,
>          delta <<= scale->shift;
>  
>      asm (
> -        "mul %%rdx ; shrd $32,%%rdx,%%rax"
> -        : "=a" (product) : "0" (delta), "d" ((u64)scale->mul_frac) );
> +        "mul %2 ; shrd $32,%1,%0"
> +        : "=a" (product), "=d" (delta)
> +        : "rm" (delta), "0" ((u64)scale->mul_frac) );
>  
>      return product;
>  }
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:11:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1Gz-0000Dt-AB; Mon, 26 Nov 2012 16:11:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Td1Gx-0000Do-LP
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:11:03 +0000
Received: from [85.158.137.99:29248] by server-10.bemta-3.messagelabs.com id
	1C/2B-19806-69493B05; Mon, 26 Nov 2012 16:11:02 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1353946262!17523673!1
X-Originating-IP: [209.85.212.175]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7492 invoked from network); 26 Nov 2012 16:11:02 -0000
Received: from mail-wi0-f175.google.com (HELO mail-wi0-f175.google.com)
	(209.85.212.175)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:11:02 -0000
Received: by mail-wi0-f175.google.com with SMTP id hm11so3103969wib.14
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 08:11:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=CO5dgwFdD2dnt4skF7EPcSXk8Lot9H4ikQbAuC4aBXc=;
	b=LLe2WBVdJxqRlgV0NNl2eF3eqJSKGJW8VuqSXAXkMvBMNHljwVH8m81glpBmwHCJLl
	JXpkJI2QD5y2hmmdEuvqhzdztm62XUWJjYbd8aweIA58fy1oQtCXcR6yg6+mMOTnt0cG
	lAXrDpjeq3CTv8EiuwJbwAUIEPm9YLP0PBNO6OTm57jD61kRyKocrRQsuekILmlBDq4q
	30xk2r3IdSuJyUY9vghxRLTPribL15oxZabDRivrBVCw/OWtWPIp5BIzku5lZHQfiycs
	NRYWcSCNuTKPjl4gp2GxmwgndNrlPyD9brw9+sx4NRBmhd6ye2pumF8rMQVSAm8LQz2u
	EZoA==
Received: by 10.181.13.75 with SMTP id ew11mr18511374wid.9.1353946262081;
	Mon, 26 Nov 2012 08:11:02 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id p2sm24406651wic.7.2012.11.26.08.10.57
	(version=SSLv3 cipher=OTHER); Mon, 26 Nov 2012 08:11:01 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Mon, 26 Nov 2012 16:10:53 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCD9450D.53691%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
Thread-Index: Ac3L8JvLaGwWpI2GKkWdDCw99VvpHQ==
In-Reply-To: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 26/11/2012 15:23, "Jan Beulich" <JBeulich@suse.com> wrote:

> The way it was coded, it clobbered %rdx without telling the compiler.
> This generally didn't cause any problems except when there are two back
> to back invocations (as in plt_overflow()), as in that case the
> compiler may validly assume that it can re-use for the second instance
> the value loaded into %rdx before the first one.
> 
> Once at it, also properly relax the second operand of "mul" (there's no
> need for it to be in %rdx, or a register at all), and switch away from
> using explicit register names in the instruction operands.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Ugh. Thank you very much, Jan! What a horrible bug.

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/arch/x86/time.c
> +++ b/xen/arch/x86/time.c
> @@ -127,8 +127,9 @@ static inline u64 scale_delta(u64 delta,
>          delta <<= scale->shift;
>  
>      asm (
> -        "mul %%rdx ; shrd $32,%%rdx,%%rax"
> -        : "=a" (product) : "0" (delta), "d" ((u64)scale->mul_frac) );
> +        "mul %2 ; shrd $32,%1,%0"
> +        : "=a" (product), "=d" (delta)
> +        : "rm" (delta), "0" ((u64)scale->mul_frac) );
>  
>      return product;
>  }
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:30:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:30:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1ZW-0000We-Fd; Mon, 26 Nov 2012 16:30:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1ZT-0000W5-Bc
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:30:11 +0000
Received: from [85.158.139.211:44184] by server-13.bemta-5.messagelabs.com id
	98/05-27809-21993B05; Mon, 26 Nov 2012 16:30:10 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353947406!21579563!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27526 invoked from network); 26 Nov 2012 16:30:07 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:30:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215485649"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:30:05 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:30:05 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1Tz-0005Uf-EN;
	Mon, 26 Nov 2012 16:24:31 +0000
MIME-Version: 1.0
Message-ID: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:24:08 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 0 of 4] Minios improvements for app development
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch series contains a set of patches making minios rather easier
to use, from an application development point of view.

Overview of patches:
 1  Command line argument parsing support, from Xen.
 2  Weak console handler function.
 3  Build system tweaks for application directories.
 4  Trailing whitespace cleanup. (because it is very messy)

Patch 4 is likely to be more controversial than the others, so I am less
fussed if it gets nacked, but would still appreciate the issue being
fixed.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:30:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:30:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1ZW-0000We-Fd; Mon, 26 Nov 2012 16:30:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1ZT-0000W5-Bc
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:30:11 +0000
Received: from [85.158.139.211:44184] by server-13.bemta-5.messagelabs.com id
	98/05-27809-21993B05; Mon, 26 Nov 2012 16:30:10 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353947406!21579563!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27526 invoked from network); 26 Nov 2012 16:30:07 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:30:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215485649"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:30:05 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:30:05 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1Tz-0005Uf-EN;
	Mon, 26 Nov 2012 16:24:31 +0000
MIME-Version: 1.0
Message-ID: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:24:08 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 0 of 4] Minios improvements for app development
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch series contains a set of patches making minios rather easier
to use, from an application development point of view.

Overview of patches:
 1  Command line argument parsing support, from Xen.
 2  Weak console handler function.
 3  Build system tweaks for application directories.
 4  Trailing whitespace cleanup. (because it is very messy)

Patch 4 is likely to be more controversial than the others, so I am less
fussed if it gets nacked, but would still appreciate the issue being
fixed.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:30:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:30:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1ZX-0000Ww-48; Mon, 26 Nov 2012 16:30:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1ZU-0000WO-Ve
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:30:13 +0000
Received: from [193.109.254.147:14060] by server-4.bemta-14.messagelabs.com id
	9E/BF-18856-41993B05; Mon, 26 Nov 2012 16:30:12 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353947405!8617414!3
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU5NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2310 invoked from network); 26 Nov 2012 16:30:09 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:30:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="45627152"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:30:05 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:30:04 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1Tz-0005Uf-GO;
	Mon, 26 Nov 2012 16:24:31 +0000
MIME-Version: 1.0
X-Mercurial-Node: 7784cd3925c571903e75f19edf42efc4cc31749e
Message-ID: <7784cd3925c571903e75.1353947052@andrewcoop.uk.xensource.com>
In-Reply-To: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:24:12 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 4 of 4] minios/whitespace: Clean up trailing
	whitespace
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch was generated using

find . -name "*.[hcS]" | xargs sed -e "s/[         ]\+$//g" -i

from the minios directory.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/apps/daytime/daytime.c
--- a/extras/mini-os/apps/daytime/daytime.c
+++ b/extras/mini-os/apps/daytime/daytime.c
@@ -1,6 +1,6 @@
-/* 
+/*
  * daytime.c: a simple network service based on lwIP and mini-os
- * 
+ *
  * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
  */
 
@@ -48,7 +48,7 @@ void run_server(void *p)
 
     while (1) {
         session = netconn_accept(listener);
-        if (session == NULL) 
+        if (session == NULL)
             continue;
 
         gettimeofday(&tv, NULL);
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/arch/x86/ioremap.c
--- a/extras/mini-os/arch/x86/ioremap.c
+++ b/extras/mini-os/arch/x86/ioremap.c
@@ -1,22 +1,22 @@
 /*
  * Copyright (C) 2009,  Netronome Systems, Inc.
- *                
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (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 
+ *
+ * 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.
  */
 
@@ -29,7 +29,7 @@
 
 /* Map a physical address range into virtual address space with provided
  * flags. Return a virtual address range it is mapped to. */
-static void *__do_ioremap(unsigned long phys_addr, unsigned long size, 
+static void *__do_ioremap(unsigned long phys_addr, unsigned long size,
                           unsigned long prot)
 {
     unsigned long va;
@@ -41,7 +41,7 @@ static void *__do_ioremap(unsigned long 
     num_pages = (offset + size + PAGE_SIZE - 1) / PAGE_SIZE;
     phys_addr &= PAGE_MASK;
     mfns = mfn = phys_addr >> PAGE_SHIFT;
-    
+
     va = (unsigned long)map_frames_ex(&mfns, num_pages, 0, 1, 1,
                                       DOMID_IO, NULL, prot);
     return (void *)(va + offset);
@@ -60,7 +60,7 @@ void *ioremap_nocache(unsigned long phys
 /* Un-map the io-remapped region. Currently no list of existing mappings is
  * maintained, so the caller has to supply the size */
 void iounmap(void *virt_addr, unsigned long size)
-{   
+{
     unsigned long num_pages;
     unsigned long va = (unsigned long)virt_addr;
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/arch/x86/mm.c
--- a/extras/mini-os/arch/x86/mm.c
+++ b/extras/mini-os/arch/x86/mm.c
@@ -1,4 +1,4 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2003 - Rolf Neugebauer - Intel Research Cambridge
  * (C) 2005 - Grzegorz Milos - Intel Research Cambridge
@@ -7,9 +7,9 @@
  *        File: mm.c
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
  *     Changes: Grzegorz Milos
- *              
+ *
  *        Date: Aug 2003, chages Aug 2005
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: memory management related functions
  *              contains buddy page allocator from Xen.
@@ -21,16 +21,16 @@
  * 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 
+ *
+ * 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.
  */
 
@@ -59,24 +59,24 @@ extern void page_walk(unsigned long va);
  * table at offset in previous level MFN (pref_l_mfn). pt_pfn is a guest
  * PFN.
  */
-static void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn, 
+static void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn,
                          unsigned long offset, unsigned long level)
-{   
+{
     pgentry_t *tab = (pgentry_t *)start_info.pt_base;
-    unsigned long pt_page = (unsigned long)pfn_to_virt(*pt_pfn); 
+    unsigned long pt_page = (unsigned long)pfn_to_virt(*pt_pfn);
     pgentry_t prot_e, prot_t;
     mmu_update_t mmu_updates[1];
     int rc;
-    
+
     prot_e = prot_t = 0;
     DEBUG("Allocating new L%d pt frame for pfn=%lx, "
-          "prev_l_mfn=%lx, offset=%lx", 
+          "prev_l_mfn=%lx, offset=%lx",
           level, *pt_pfn, prev_l_mfn, offset);
 
     /* We need to clear the page, otherwise we might fail to map it
        as a page table page */
-    memset((void*) pt_page, 0, PAGE_SIZE);  
- 
+    memset((void*) pt_page, 0, PAGE_SIZE);
+
     switch ( level )
     {
     case L1_FRAME:
@@ -105,11 +105,11 @@ static void new_pt_frame(unsigned long *
 #endif
     tab = pte_to_virt(tab[l3_table_offset(pt_page)]);
 
-    mmu_updates[0].ptr = (tab[l2_table_offset(pt_page)] & PAGE_MASK) + 
+    mmu_updates[0].ptr = (tab[l2_table_offset(pt_page)] & PAGE_MASK) +
         sizeof(pgentry_t) * l1_table_offset(pt_page);
-    mmu_updates[0].val = (pgentry_t)pfn_to_mfn(*pt_pfn) << PAGE_SHIFT | 
+    mmu_updates[0].val = (pgentry_t)pfn_to_mfn(*pt_pfn) << PAGE_SHIFT |
         (prot_e & ~_PAGE_RW);
-    
+
     if ( (rc = HYPERVISOR_mmu_update(mmu_updates, 1, NULL, DOMID_SELF)) < 0 )
     {
         printk("ERROR: PTE for new page table page could not be updated\n");
@@ -122,7 +122,7 @@ static void new_pt_frame(unsigned long *
         ((pgentry_t)prev_l_mfn << PAGE_SHIFT) + sizeof(pgentry_t) * offset;
     mmu_updates[0].val = (pgentry_t)pfn_to_mfn(*pt_pfn) << PAGE_SHIFT | prot_t;
 
-    if ( (rc = HYPERVISOR_mmu_update(mmu_updates, 1, NULL, DOMID_SELF)) < 0 ) 
+    if ( (rc = HYPERVISOR_mmu_update(mmu_updates, 1, NULL, DOMID_SELF)) < 0 )
     {
         printk("ERROR: mmu_update failed with rc=%d\n", rc);
         do_exit();
@@ -150,38 +150,38 @@ static int need_pt_frame(unsigned long v
 #if defined(__x86_64__)
     if ( level == L3_FRAME )
     {
-        if ( l4_table_offset(va) >= 
+        if ( l4_table_offset(va) >=
              l4_table_offset(hyp_virt_start) &&
-             l4_table_offset(va) <= 
+             l4_table_offset(va) <=
              l4_table_offset(hyp_virt_end))
             return 0;
         return 1;
-    } 
+    }
     else
 #endif
 
     if ( level == L2_FRAME )
     {
 #if defined(__x86_64__)
-        if ( l4_table_offset(va) >= 
+        if ( l4_table_offset(va) >=
              l4_table_offset(hyp_virt_start) &&
-             l4_table_offset(va) <= 
+             l4_table_offset(va) <=
              l4_table_offset(hyp_virt_end))
 #endif
-            if ( l3_table_offset(va) >= 
+            if ( l3_table_offset(va) >=
                  l3_table_offset(hyp_virt_start) &&
-                 l3_table_offset(va) <= 
+                 l3_table_offset(va) <=
                  l3_table_offset(hyp_virt_end))
                 return 0;
 
         return 1;
-    } 
-    else 
+    }
+    else
         /* Always need l1 frames */
         if ( level == L1_FRAME )
             return 1;
 
-    printk("ERROR: Unknown frame level %d, hypervisor %llx,%llx\n", 
+    printk("ERROR: Unknown frame level %d, hypervisor %llx,%llx\n",
            level, hyp_virt_start, hyp_virt_end);
     return -1;
 }
@@ -200,7 +200,7 @@ static void build_pagetable(unsigned lon
     int count = 0;
     int rc;
 
-    pfn_to_map = 
+    pfn_to_map =
         (start_info.nr_pt_frames - NOT_L1_FRAMES) * L1_PAGETABLE_ENTRIES;
 
     if ( *max_pfn >= virt_to_pfn(HYPERVISOR_VIRT_START) )
@@ -211,7 +211,7 @@ static void build_pagetable(unsigned lon
                 (unsigned long)&_text)>>20);
         *max_pfn = virt_to_pfn(HYPERVISOR_VIRT_START - PAGE_SIZE);
         printk("%dMB\n",
-               ((unsigned long)pfn_to_virt(*max_pfn) - 
+               ((unsigned long)pfn_to_virt(*max_pfn) -
                 (unsigned long)&_text)>>20);
     }
 
@@ -230,7 +230,7 @@ static void build_pagetable(unsigned lon
         offset = l4_table_offset(start_address);
         /* Need new L3 pt frame */
         if ( !(start_address & L3_MASK) )
-            if ( need_pt_frame(start_address, L3_FRAME) ) 
+            if ( need_pt_frame(start_address, L3_FRAME) )
                 new_pt_frame(&pt_pfn, pt_mfn, offset, L3_FRAME);
 
         page = tab[offset];
@@ -246,7 +246,7 @@ static void build_pagetable(unsigned lon
         page = tab[offset];
         pt_mfn = pte_to_mfn(page);
         tab = to_virt(mfn_to_pfn(pt_mfn) << PAGE_SHIFT);
-        offset = l2_table_offset(start_address);        
+        offset = l2_table_offset(start_address);
         /* Need new L1 pt frame */
         if ( !(start_address & L1_MASK) )
             if ( need_pt_frame(start_address, L1_FRAME) )
@@ -258,7 +258,7 @@ static void build_pagetable(unsigned lon
 
         mmu_updates[count].ptr =
             ((pgentry_t)pt_mfn << PAGE_SHIFT) + sizeof(pgentry_t) * offset;
-        mmu_updates[count].val = 
+        mmu_updates[count].val =
             (pgentry_t)pfn_to_mfn(pfn_to_map++) << PAGE_SHIFT | L1_PROT;
         count++;
         if ( count == L1_PAGETABLE_ENTRIES || pfn_to_map == *max_pfn )
@@ -311,7 +311,7 @@ static void set_readonly(void *text, voi
         page = tab[offset];
         mfn = pte_to_mfn(page);
         tab = to_virt(mfn_to_pfn(mfn) << PAGE_SHIFT);
-        offset = l2_table_offset(start_address);        
+        offset = l2_table_offset(start_address);
         page = tab[offset];
         mfn = pte_to_mfn(page);
         tab = to_virt(mfn_to_pfn(mfn) << PAGE_SHIFT);
@@ -320,7 +320,7 @@ static void set_readonly(void *text, voi
 
         if ( start_address != (unsigned long)&shared_info )
         {
-            mmu_updates[count].ptr = 
+            mmu_updates[count].ptr =
                 ((pgentry_t)mfn << PAGE_SHIFT) + sizeof(pgentry_t) * offset;
             mmu_updates[count].val = tab[offset] & ~_PAGE_RW;
             count++;
@@ -330,7 +330,7 @@ static void set_readonly(void *text, voi
 
         start_address += PAGE_SIZE;
 
-        if ( count == L1_PAGETABLE_ENTRIES || 
+        if ( count == L1_PAGETABLE_ENTRIES ||
              start_address + PAGE_SIZE > end_address )
         {
             rc = HYPERVISOR_mmu_update(mmu_updates, count, NULL, DOMID_SELF);
@@ -356,16 +356,16 @@ static void set_readonly(void *text, voi
  * A useful mem testing function. Write the address to every address in the
  * range provided and read back the value. If verbose, print page walk to
  * some VA
- * 
+ *
  * If we get MEM_TEST_MAX_ERRORS we might as well stop
  */
-#define MEM_TEST_MAX_ERRORS 10 
+#define MEM_TEST_MAX_ERRORS 10
 int mem_test(unsigned long *start_va, unsigned long *end_va, int verbose)
 {
     unsigned long mask = 0x10000;
     unsigned long *pointer;
     int error_count = 0;
- 
+
     /* write values and print page walks */
     if ( verbose && (((unsigned long)start_va) & 0xfffff) )
     {
@@ -386,14 +386,14 @@ int mem_test(unsigned long *start_va, un
         printk("MemTest End: %lx\n", end_va-1);
         page_walk((unsigned long)end_va-1);
     }
- 
+
     /* verify values */
     for ( pointer = start_va; pointer < end_va; pointer++ )
     {
         if ( ((unsigned long)pointer & ~mask) != *pointer )
         {
             printk("Read error at 0x%lx. Read: 0x%lx, should read 0x%lx\n",
-                   (unsigned long)pointer, *pointer, 
+                   (unsigned long)pointer, *pointer,
                    ((unsigned long)pointer & ~mask));
             error_count++;
             if ( error_count >= MEM_TEST_MAX_ERRORS )
@@ -467,7 +467,7 @@ pgentry_t *need_pgt(unsigned long va)
     tab = mfn_to_virt(pt_mfn);
 #endif
     offset = l3_table_offset(va);
-    if ( !(tab[offset] & _PAGE_PRESENT) ) 
+    if ( !(tab[offset] & _PAGE_PRESENT) )
     {
         pt_pfn = virt_to_pfn(alloc_page());
         new_pt_frame(&pt_pfn, pt_mfn, offset, L2_FRAME);
@@ -516,7 +516,7 @@ void arch_init_demand_mapping_area(unsig
 
     demand_map_area_start = (unsigned long) pfn_to_virt(cur_pfn);
     cur_pfn += DEMAND_MAP_PAGES;
-    printk("Demand map pfns at %lx-%lx.\n", 
+    printk("Demand map pfns at %lx-%lx.\n",
            demand_map_area_start, pfn_to_virt(cur_pfn));
 
 #ifdef HAVE_LIBC
@@ -535,12 +535,12 @@ unsigned long allocate_ondemand(unsigned
 
     /* Find a properly aligned run of n contiguous frames */
     for ( x = 0;
-          x <= DEMAND_MAP_PAGES - n; 
+          x <= DEMAND_MAP_PAGES - n;
           x = (x + y + 1 + alignment - 1) & ~(alignment - 1) )
     {
         unsigned long addr = demand_map_area_start + x * PAGE_SIZE;
         pgentry_t *pgt = get_pgt(addr);
-        for ( y = 0; y < n; y++, addr += PAGE_SIZE ) 
+        for ( y = 0; y < n; y++, addr += PAGE_SIZE )
         {
             if ( !(addr & L1_MASK) )
                 pgt = get_pgt(addr);
@@ -568,8 +568,8 @@ unsigned long allocate_ondemand(unsigned
  */
 #define MAP_BATCH ((STACK_SIZE / 2) / sizeof(mmu_update_t))
 void do_map_frames(unsigned long va,
-                   const unsigned long *mfns, unsigned long n, 
-                   unsigned long stride, unsigned long incr, 
+                   const unsigned long *mfns, unsigned long n,
+                   unsigned long stride, unsigned long incr,
                    domid_t id, int *err, unsigned long prot)
 {
     pgentry_t *pgt = NULL;
@@ -577,7 +577,7 @@ void do_map_frames(unsigned long va,
     unsigned long i;
     int rc;
 
-    if ( !mfns ) 
+    if ( !mfns )
     {
         printk("do_map_frames: no mfns supplied\n");
         return;
@@ -602,11 +602,11 @@ void do_map_frames(unsigned long va,
         {
             mmu_update_t mmu_updates[todo];
 
-            for ( i = 0; i < todo; i++, va += PAGE_SIZE, pgt++) 
+            for ( i = 0; i < todo; i++, va += PAGE_SIZE, pgt++)
             {
                 if ( !pgt || !(va & L1_MASK) )
                     pgt = need_pgt(va);
-                
+
                 mmu_updates[i].ptr = virt_to_mach(pgt) | MMU_NORMAL_PT_UPDATE;
                 mmu_updates[i].val = ((pgentry_t)(mfns[(done + i) * stride] +
                                                   (done + i) * incr)
@@ -633,7 +633,7 @@ void do_map_frames(unsigned long va,
  * Map an array of MFNs contiguous into virtual address space. Virtual
  * addresses are allocated from the on demand area.
  */
-void *map_frames_ex(const unsigned long *mfns, unsigned long n, 
+void *map_frames_ex(const unsigned long *mfns, unsigned long n,
                     unsigned long stride, unsigned long incr,
                     unsigned long alignment,
                     domid_t id, int *err, unsigned long prot)
@@ -676,7 +676,7 @@ int unmap_frames(unsigned long va, unsig
             call[i].args[arg++] = 0;
 #ifdef __i386__
             call[i].args[arg++] = 0;
-#endif  
+#endif
             call[i].args[arg++] = UVMF_INVLPG;
 
             va += PAGE_SIZE;
@@ -691,7 +691,7 @@ int unmap_frames(unsigned long va, unsig
 
         for ( i = 0; i < n; i++ )
         {
-            if ( call[i].result ) 
+            if ( call[i].result )
             {
                 printk("update_va_mapping failed for with rc=%d.\n", ret);
                 return -(call[i].result);
@@ -705,12 +705,12 @@ int unmap_frames(unsigned long va, unsig
 /*
  * Allocate pages which are contiguous in machine memory.
  * Returns a VA to where they are mapped or 0 on failure.
- * 
+ *
  * addr_bits indicates if the region has restrictions on where it is
  * located. Typical values are 32 (if for example PCI devices can't access
  * 64bit memory) or 0 for no restrictions.
  *
- * Allocated pages can be freed using the page allocators free_pages() 
+ * Allocated pages can be freed using the page allocators free_pages()
  * function.
  *
  * based on Linux function xen_create_contiguous_region()
@@ -778,7 +778,7 @@ unsigned long alloc_contig_pages(int ord
         call[i].args[arg++] = 0;
 #ifdef __i386__
         call[i].args[arg++] = 0;
-#endif  
+#endif
         call[i].args[arg++] = UVMF_INVLPG;
     }
 
@@ -793,10 +793,10 @@ unsigned long alloc_contig_pages(int ord
     out_frames = virt_to_pfn(in_va); /* PFNs to populate */
     ret = HYPERVISOR_memory_op(XENMEM_exchange, &exchange);
     if ( ret ) {
-        printk("mem exchanged order=0x%x failed with rc=%d, nr_exchanged=%d\n", 
+        printk("mem exchanged order=0x%x failed with rc=%d, nr_exchanged=%d\n",
                order, ret, exchange.nr_exchanged);
         /* we still need to return the allocated pages above to the pool
-         * ie. map them back into the 1:1 mapping etc. so we continue but 
+         * ie. map them back into the 1:1 mapping etc. so we continue but
          * in the end return the pages to the page allocator and return 0. */
         exch_success = 0;
     }
@@ -824,7 +824,7 @@ unsigned long alloc_contig_pages(int ord
 #else
         call[i].args[arg++] = pte.pte_low;
         call[i].args[arg++] = pte.pte_high;
-#endif  
+#endif
         call[i].args[arg++] = UVMF_INVLPG;
     }
     ret = HYPERVISOR_multicall(call, i);
@@ -840,7 +840,7 @@ unsigned long alloc_contig_pages(int ord
         free_pages((void *) in_va, order);
         return 0;
     }
-    
+
     return in_va;
 }
 
@@ -863,24 +863,24 @@ void arch_init_p2m(unsigned long max_pfn
 {
 #ifdef __x86_64__
 #define L1_P2M_SHIFT    9
-#define L2_P2M_SHIFT    18    
-#define L3_P2M_SHIFT    27    
+#define L2_P2M_SHIFT    18
+#define L3_P2M_SHIFT    27
 #else
 #define L1_P2M_SHIFT    10
-#define L2_P2M_SHIFT    20    
-#define L3_P2M_SHIFT    30    
+#define L2_P2M_SHIFT    20
+#define L3_P2M_SHIFT    30
 #endif
-#define L1_P2M_ENTRIES  (1 << L1_P2M_SHIFT)    
-#define L2_P2M_ENTRIES  (1 << (L2_P2M_SHIFT - L1_P2M_SHIFT))    
-#define L3_P2M_ENTRIES  (1 << (L3_P2M_SHIFT - L2_P2M_SHIFT))    
-#define L1_P2M_MASK     (L1_P2M_ENTRIES - 1)    
-#define L2_P2M_MASK     (L2_P2M_ENTRIES - 1)    
-#define L3_P2M_MASK     (L3_P2M_ENTRIES - 1)    
-    
+#define L1_P2M_ENTRIES  (1 << L1_P2M_SHIFT)
+#define L2_P2M_ENTRIES  (1 << (L2_P2M_SHIFT - L1_P2M_SHIFT))
+#define L3_P2M_ENTRIES  (1 << (L3_P2M_SHIFT - L2_P2M_SHIFT))
+#define L1_P2M_MASK     (L1_P2M_ENTRIES - 1)
+#define L2_P2M_MASK     (L2_P2M_ENTRIES - 1)
+#define L3_P2M_MASK     (L3_P2M_ENTRIES - 1)
+
     unsigned long *l1_list = NULL, *l2_list = NULL, *l3_list;
     unsigned long pfn;
-    
-    l3_list = (unsigned long *)alloc_page(); 
+
+    l3_list = (unsigned long *)alloc_page();
     for ( pfn=0; pfn<max_pfn; pfn++ )
     {
         if ( !(pfn % (L1_P2M_ENTRIES * L2_P2M_ENTRIES)) )
@@ -891,18 +891,18 @@ void arch_init_p2m(unsigned long max_pfn
                 printk("Error: Too many pfns.\n");
                 do_exit();
             }
-            l3_list[(pfn >> L2_P2M_SHIFT)] = virt_to_mfn(l2_list);  
+            l3_list[(pfn >> L2_P2M_SHIFT)] = virt_to_mfn(l2_list);
         }
         if ( !(pfn % (L1_P2M_ENTRIES)) )
         {
             l1_list = (unsigned long*)alloc_page();
-            l2_list[(pfn >> L1_P2M_SHIFT) & L2_P2M_MASK] = 
-                virt_to_mfn(l1_list); 
+            l2_list[(pfn >> L1_P2M_SHIFT) & L2_P2M_MASK] =
+                virt_to_mfn(l1_list);
         }
 
-        l1_list[pfn & L1_P2M_MASK] = pfn_to_mfn(pfn); 
+        l1_list[pfn & L1_P2M_MASK] = pfn_to_mfn(pfn);
     }
-    HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list = 
+    HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list =
         virt_to_mfn(l3_list);
     HYPERVISOR_shared_info->arch.max_pfn = max_pfn;
 }
@@ -919,7 +919,7 @@ void arch_init_mm(unsigned long* start_p
     printk("       _end: %p(VA)\n", &_end);
 
     /* First page follows page table pages and 3 more pages (store page etc) */
-    start_pfn = PFN_UP(to_phys(start_info.pt_base)) + 
+    start_pfn = PFN_UP(to_phys(start_info.pt_base)) +
         start_info.nr_pt_frames + 3;
     max_pfn = start_info.nr_pages;
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/arch/x86/sched.c
--- a/extras/mini-os/arch/x86/sched.c
+++ b/extras/mini-os/arch/x86/sched.c
@@ -1,4 +1,4 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2005 - Grzegorz Milos - Intel Research Cambridge
  ****************************************************************************
@@ -6,13 +6,13 @@
  *        File: sched.c
  *      Author: Grzegorz Milos
  *     Changes: Robert Kaiser
- *              
+ *
  *        Date: Aug 2005
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: simple scheduler for Mini-Os
  *
- * The scheduler is non-preemptive (cooperative), and schedules according 
+ * The scheduler is non-preemptive (cooperative), and schedules according
  * to Round Robin algorithm.
  *
  ****************************************************************************
@@ -22,16 +22,16 @@
  * 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 
+ *
+ * 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.
  */
 
@@ -57,12 +57,12 @@
 
 void dump_stack(struct thread *thread)
 {
-    unsigned long *bottom = (unsigned long *)(thread->stack + STACK_SIZE); 
+    unsigned long *bottom = (unsigned long *)(thread->stack + STACK_SIZE);
     unsigned long *pointer = (unsigned long *)thread->sp;
     int count;
     if(thread == current)
     {
-#ifdef __i386__    
+#ifdef __i386__
         asm("movl %%esp,%0"
             : "=r"(pointer));
 #else
@@ -76,11 +76,11 @@ void dump_stack(struct thread *thread)
         printk("[0x%lx] 0x%lx\n", pointer, *pointer);
         pointer++;
     }
-    
+
     if(pointer < bottom) printk(" ... continues.\n");
 }
 
-/* Gets run when a new thread is scheduled the first time ever, 
+/* Gets run when a new thread is scheduled the first time ever,
    defined in x86_[32/64].S */
 extern void thread_starter(void);
 
@@ -96,18 +96,18 @@ struct thread* arch_create_thread(char *
                                   void *data)
 {
     struct thread *thread;
-    
+
     thread = xmalloc(struct thread);
     /* We can't use lazy allocation here since the trap handler runs on the stack */
     thread->stack = (char *)alloc_pages(STACK_SIZE_PAGE_ORDER);
     thread->name = name;
-    printk("Thread \"%s\": pointer: 0x%lx, stack: 0x%lx\n", name, thread, 
+    printk("Thread \"%s\": pointer: 0x%lx, stack: 0x%lx\n", name, thread,
             thread->stack);
-    
+
     thread->sp = (unsigned long)thread->stack + STACK_SIZE;
     /* Save pointer to the thread on the stack, used by current macro */
     *((unsigned long *)thread->stack) = (unsigned long)thread;
-    
+
     stack_push(thread, (unsigned long) function);
     stack_push(thread, (unsigned long) data);
     thread->ip = (unsigned long) thread_starter;
@@ -116,19 +116,19 @@ struct thread* arch_create_thread(char *
 
 void run_idle_thread(void)
 {
-    /* Switch stacks and run the thread */ 
+    /* Switch stacks and run the thread */
 #if defined(__i386__)
     __asm__ __volatile__("mov %0,%%esp\n\t"
-                         "push %1\n\t" 
-                         "ret"                                            
+                         "push %1\n\t"
+                         "ret"
                          :"=m" (idle_thread->sp)
-                         :"m" (idle_thread->ip));                          
+                         :"m" (idle_thread->ip));
 #elif defined(__x86_64__)
     __asm__ __volatile__("mov %0,%%rsp\n\t"
-                         "push %1\n\t" 
-                         "ret"                                            
+                         "push %1\n\t"
+                         "ret"
                          :"=m" (idle_thread->sp)
-                         :"m" (idle_thread->ip));                                                    
+                         :"m" (idle_thread->ip));
 #endif
 }
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/arch/x86/setup.c
--- a/extras/mini-os/arch/x86/setup.c
+++ b/extras/mini-os/arch/x86/setup.c
@@ -1,27 +1,27 @@
 /******************************************************************************
  * common.c
- * 
+ *
  * Common stuff special to x86 goes here.
- * 
+ *
  * Copyright (c) 2002-2003, K A Fraser & R Neugebauer
  * Copyright (c) 2005, Grzegorz Milos, Intel Research Cambridge
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (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 
+ *
+ * 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.
  *
  */
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/arch/x86/time.c
--- a/extras/mini-os/arch/x86/time.c
+++ b/extras/mini-os/arch/x86/time.c
@@ -1,7 +1,7 @@
 /* -*-  Mode:C; c-basic-offset:4; tab-width:4 -*-
  ****************************************************************************
  * (C) 2003 - Rolf Neugebauer - Intel Research Cambridge
- * (C) 2002-2003 - Keir Fraser - University of Cambridge 
+ * (C) 2002-2003 - Keir Fraser - University of Cambridge
  * (C) 2005 - Grzegorz Milos - Intel Research Cambridge
  * (C) 2006 - Robert Kaiser - FH Wiesbaden
  ****************************************************************************
@@ -18,16 +18,16 @@
  * 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 
+ *
+ * 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.
  */
 
@@ -74,7 +74,7 @@ static struct shadow_time_info shadow;
 
 static inline int time_values_up_to_date(void)
 {
-	struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time; 
+	struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time;
 
 	return (shadow.version == src->version);
 }
@@ -187,8 +187,8 @@ int gettimeofday(struct timeval *tv, voi
 {
     uint64_t nsec = monotonic_clock();
     nsec += shadow_ts.tv_nsec;
-    
-    
+
+
     tv->tv_sec = shadow_ts.tv_sec;
     tv->tv_sec += NSEC_TO_SEC(nsec);
     tv->tv_usec = NSEC_TO_USEC(nsec % 1000000000UL);
@@ -212,7 +212,7 @@ void block_domain(s_time_t until)
 
 
 /*
- * Just a dummy 
+ * Just a dummy
  */
 static void timer_handler(evtchn_port_t ev, struct pt_regs *regs, void *ign)
 {
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/arch/x86/traps.c
--- a/extras/mini-os/arch/x86/traps.c
+++ b/extras/mini-os/arch/x86/traps.c
@@ -33,7 +33,7 @@ void machine_check(void);
 void dump_regs(struct pt_regs *regs)
 {
     printk("Thread: %s\n", current->name);
-#ifdef __i386__    
+#ifdef __i386__
     printk("EIP: %x, EFLAGS %x.\n", regs->eip, regs->eflags);
     printk("EBX: %08x ECX: %08x EDX: %08x\n",
 	   regs->ebx, regs->ecx, regs->edx);
@@ -45,18 +45,18 @@ void dump_regs(struct pt_regs *regs)
 	   regs->xcs, regs->eflags, regs->esp, regs->xss);
 #else
     printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->rip);
-    printk("\nRSP: %04lx:%016lx  EFLAGS: %08lx\n", 
+    printk("\nRSP: %04lx:%016lx  EFLAGS: %08lx\n",
            regs->ss, regs->rsp, regs->eflags);
     printk("RAX: %016lx RBX: %016lx RCX: %016lx\n",
            regs->rax, regs->rbx, regs->rcx);
     printk("RDX: %016lx RSI: %016lx RDI: %016lx\n",
-           regs->rdx, regs->rsi, regs->rdi); 
+           regs->rdx, regs->rsi, regs->rdi);
     printk("RBP: %016lx R08: %016lx R09: %016lx\n",
-           regs->rbp, regs->r8, regs->r9); 
+           regs->rbp, regs->r8, regs->r9);
     printk("R10: %016lx R11: %016lx R12: %016lx\n",
-           regs->r10, regs->r11, regs->r12); 
+           regs->r10, regs->r11, regs->r12);
     printk("R13: %016lx R14: %016lx R15: %016lx\n",
-           regs->r13, regs->r14, regs->r15); 
+           regs->r13, regs->r14, regs->r15);
 #endif
 }
 
@@ -98,7 +98,7 @@ void page_walk(unsigned long virt_addres
         pgentry_t *tab = (pgentry_t *)start_info.pt_base, page;
         unsigned long addr = virt_address;
         printk("Pagetable walk from virt %lx, base %lx:\n", virt_address, start_info.pt_base);
-    
+
 #if defined(__x86_64__)
         page = tab[l4_table_offset(addr)];
         tab = pte_to_virt(page);
@@ -110,7 +110,7 @@ void page_walk(unsigned long virt_addres
         page = tab[l2_table_offset(addr)];
         tab = pte_to_virt(page);
         printk("   L2 = %"PRIpte" (%p)  [offset = %lx]\n", page, tab, l2_table_offset(addr));
-        
+
         page = tab[l1_table_offset(addr)];
         printk("    L1 = %"PRIpte" [offset = %lx]\n", page, l1_table_offset(addr));
 
@@ -136,7 +136,7 @@ static int handle_cow(unsigned long addr
 	if (!(page & _PAGE_PRESENT))
 	    return 0;
         tab = pte_to_virt(page);
-        
+
         page = tab[l1_table_offset(addr)];
 	if (!(page & _PAGE_PRESENT))
 	    return 0;
@@ -204,10 +204,10 @@ void do_page_fault(struct pt_regs *regs,
 
     /* If we are already handling a page fault, and got another one
        that means we faulted in pagetable walk. Continuing here would cause
-       a recursive fault */       
-    if(handling_pg_fault == 1) 
+       a recursive fault */
+    if(handling_pg_fault == 1)
     {
-        printk("Page fault in pagetable walk (access to invalid memory?).\n"); 
+        printk("Page fault in pagetable walk (access to invalid memory?).\n");
         HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
     }
     handling_pg_fault++;
@@ -244,7 +244,7 @@ void do_general_protection(struct pt_reg
     struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_crash };
 #ifdef __i386__
     printk("GPF eip: %p, error_code=%lx\n", regs->eip, error_code);
-#else    
+#else
     printk("GPF rip: %p, error_code=%lx\n", regs->rip, error_code);
 #endif
     dump_regs(regs);
@@ -319,12 +319,12 @@ static trap_info_t trap_table[] = {
     { 19, 0, __KERNEL_CS, (unsigned long)simd_coprocessor_error      },
     {  0, 0,           0, 0                           }
 };
-    
+
 
 
 void trap_init(void)
 {
-    HYPERVISOR_set_trap_table(trap_table);    
+    HYPERVISOR_set_trap_table(trap_table);
 }
 
 void trap_fini(void)
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/arch/x86/x86_32.S
--- a/extras/mini-os/arch/x86/x86_32.S
+++ b/extras/mini-os/arch/x86/x86_32.S
@@ -14,12 +14,12 @@
 .text
 
 .globl _start, shared_info, hypercall_page
-                        
+
 _start:
         cld
         lss stack_start,%esp
         andl $(~(__STACK_SIZE-1)), %esp
-        push %esi 
+        push %esi
         call start_kernel
 
 stack_start:
@@ -67,7 +67,7 @@ CS		= 0x2C
 	popl %ds;	\
 	popl %es;	\
 	addl $4,%esp;	\
-	iret;		
+	iret;
 
 ENTRY(divide_error)
 	pushl $0		# no error code
@@ -97,7 +97,7 @@ do_exception:
     pushl %eax
 	call *%edi
     jmp ret_from_exception
-    
+
 ret_from_exception:
     movb CS(%esp),%cl
     addl $8,%esp
@@ -145,7 +145,7 @@ ecrit:  /**** END OF CRITICAL REGION ***
 # registers are in each frame. We do this quickly using the lookup table
 # 'critical_fixup_table'. For each byte offset in the critical region, it
 # provides the number of bytes which have already been popped from the
-# interrupted stack frame. 
+# interrupted stack frame.
 critical_region_fixup:
         addl $critical_fixup_table-scrit,%eax
         movzbl (%eax),%eax    # %eax contains num bytes popped
@@ -163,8 +163,8 @@ 15:     subl $4,%esi          # pre-decr
         loop 15b
 16:     movl %edi,%esp        # final %edi is top of merged stack
         jmp  11b
-         
-critical_fixup_table:        
+
+critical_fixup_table:
         .byte 0x00,0x00,0x00                  # testb $0xff,(%esi)
         .byte 0x00,0x00                       # jne  14f
         .byte 0x00                            # pop  %ebx
@@ -180,7 +180,7 @@ critical_fixup_table:
         .byte 0x28                            # iret
         .byte 0x00,0x00,0x00,0x00             # movb $1,1(%esi)
         .byte 0x00,0x00                       # jmp  11b
-       
+
 # Hypervisor uses this for application faults while it executes.
 ENTRY(failsafe_callback)
       pop  %ds
@@ -188,7 +188,7 @@ ENTRY(failsafe_callback)
       pop  %fs
       pop  %gs
       iret
-                
+
 ENTRY(coprocessor_error)
 	pushl $0
 	pushl $do_coprocessor_error
@@ -262,7 +262,7 @@ ENTRY(alignment_check)
 ENTRY(page_fault)
     pushl $do_page_fault
     jmp do_exception
-    
+
 ENTRY(machine_check)
 	pushl $0
 	pushl $do_machine_check
@@ -283,8 +283,8 @@ ENTRY(thread_starter)
     xorl %ebp,%ebp
     pushl %eax
     call *%ebx
-    call exit_thread 
-    
+    call exit_thread
+
 ENTRY(__arch_switch_threads)
     movl 4(%esp), %ecx		/* prev */
     movl 8(%esp), %edx		/* next */
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/arch/x86/x86_64.S
--- a/extras/mini-os/arch/x86/x86_64.S
+++ b/extras/mini-os/arch/x86/x86_64.S
@@ -36,14 +36,14 @@ hypercall_page:
         .org 0x3000
 
 
-/* Offsets into shared_info_t. */                
+/* Offsets into shared_info_t. */
 #define evtchn_upcall_pending		/* 0 */
 #define evtchn_upcall_mask		1
 
 NMI_MASK = 0x80000000
 
 #define RDI 112
-#define ORIG_RAX 120       /* + error_code */ 
+#define ORIG_RAX 120       /* + error_code */
 #define EFLAGS 144
 
 .macro RESTORE_ALL
@@ -57,7 +57,7 @@ NMI_MASK = 0x80000000
 	movq 7*8(%rsp),%rsi
 	movq 8*8(%rsp),%rdi
 	addq $9*8+8,%rsp
-.endm	
+.endm
 
 
 .macro HYPERVISOR_IRET flag
@@ -80,32 +80,32 @@ 2:	/* Slow iret via hypervisor. */
 
 /*
  * Exception entry point. This expects an error code/orig_rax on the stack
- * and the exception handler in %rax.	
- */ 		  				
+ * and the exception handler in %rax.
+ */
 ENTRY(error_entry)
 	/* rdi slot contains rax, oldrax contains error code */
-	cld	
+	cld
 	subq  $14*8,%rsp
 	movq %rsi,13*8(%rsp)
 	movq 14*8(%rsp),%rsi	/* load rax from rdi slot */
 	movq %rdx,12*8(%rsp)
 	movq %rcx,11*8(%rsp)
-	movq %rsi,10*8(%rsp)	/* store rax */ 
+	movq %rsi,10*8(%rsp)	/* store rax */
 	movq %r8, 9*8(%rsp)
 	movq %r9, 8*8(%rsp)
 	movq %r10,7*8(%rsp)
 	movq %r11,6*8(%rsp)
-	movq %rbx,5*8(%rsp) 
-	movq %rbp,4*8(%rsp) 
-	movq %r12,3*8(%rsp) 
-	movq %r13,2*8(%rsp) 
-	movq %r14,1*8(%rsp) 
-	movq %r15,(%rsp) 
+	movq %rbx,5*8(%rsp)
+	movq %rbp,4*8(%rsp)
+	movq %r12,3*8(%rsp)
+	movq %r13,2*8(%rsp)
+	movq %r14,1*8(%rsp)
+	movq %r15,(%rsp)
 
 error_call_handler:
-	movq %rdi, RDI(%rsp)            
+	movq %rdi, RDI(%rsp)
 	movq %rsp,%rdi
-	movq ORIG_RAX(%rsp),%rsi	# get error code 
+	movq ORIG_RAX(%rsp),%rsi	# get error code
 	movq $-1,ORIG_RAX(%rsp)
 	call *%rax
 	jmp error_exit
@@ -114,11 +114,11 @@ error_call_handler:
     movq (%rsp),%rcx
     movq 8(%rsp),%r11
     addq $0x10,%rsp /* skip rcx and r11 */
-	pushq $0	/* push error code/oldrax */ 
-	pushq %rax	/* push real oldrax to the rdi slot */ 
+	pushq $0	/* push error code/oldrax */
+	pushq %rax	/* push real oldrax to the rdi slot */
 	leaq  \sym(%rip),%rax
 	jmp error_entry
-.endm	
+.endm
 
 .macro errorentry sym
         movq (%rsp),%rcx
@@ -150,17 +150,17 @@ ENTRY(hypervisor_callback)
     zeroentry hypervisor_callback2
 
 ENTRY(hypervisor_callback2)
-        movq %rdi, %rsp 
+        movq %rdi, %rsp
 11:     movq %gs:8,%rax
         incl %gs:0
         cmovzq %rax,%rsp
         pushq %rdi
-        call do_hypervisor_callback 
+        call do_hypervisor_callback
         popq %rsp
         decl %gs:0
         jmp error_exit
 
-restore_all_enable_events:  
+restore_all_enable_events:
 	XEN_UNBLOCK_EVENTS(%rsi)        # %rsi is already set up...
 
 scrit:	/**** START OF CRITICAL REGION ****/
@@ -169,16 +169,16 @@ scrit:	/**** START OF CRITICAL REGION **
 	XEN_PUT_VCPU_INFO(%rsi)
         RESTORE_ALL
         HYPERVISOR_IRET 0
-        
+
 14:	XEN_LOCKED_BLOCK_EVENTS(%rsi)
 	XEN_PUT_VCPU_INFO(%rsi)
 	subq $6*8,%rsp
-	movq %rbx,5*8(%rsp) 
-	movq %rbp,4*8(%rsp) 
-	movq %r12,3*8(%rsp) 
-	movq %r13,2*8(%rsp) 
-	movq %r14,1*8(%rsp) 
-	movq %r15,(%rsp) 
+	movq %rbx,5*8(%rsp)
+	movq %rbp,4*8(%rsp)
+	movq %r12,3*8(%rsp)
+	movq %r13,2*8(%rsp)
+	movq %r14,1*8(%rsp)
+	movq %r15,(%rsp)
         movq %rsp,%rdi                  # set the argument again
 	jmp  11b
 ecrit:  /**** END OF CRITICAL REGION ****/
@@ -193,12 +193,12 @@ retint_restore_args:
 	andb $1,%al			# EAX[0] == IRET_EFLAGS.IF & event_mask
 	jnz restore_all_enable_events	#        != 0 => enable event delivery
 	XEN_PUT_VCPU_INFO(%rsi)
-		
+
 	RESTORE_ALL
 	HYPERVISOR_IRET 0
 
 
-error_exit:		
+error_exit:
 	movq (%rsp),%r15
 	movq 1*8(%rsp),%r14
 	movq 2*8(%rsp),%r13
@@ -206,7 +206,7 @@ error_exit:
 	movq 4*8(%rsp),%rbp
 	movq 5*8(%rsp),%rbx
 	addq $6*8,%rsp
-	XEN_BLOCK_EVENTS(%rsi)		
+	XEN_BLOCK_EVENTS(%rsi)
 	jmp retint_kernel
 
 
@@ -242,8 +242,8 @@ ENTRY(overflow)
 
 ENTRY(bounds)
         zeroentry do_bounds
-    
-    
+
+
 ENTRY(invalid_op)
         zeroentry do_invalid_op
 
@@ -263,7 +263,7 @@ ENTRY(segment_not_present)
 /* runs on exception stack */
 ENTRY(stack_segment)
         errorentry do_stack_segment
-                    
+
 
 ENTRY(general_protection)
         errorentry do_general_protection
@@ -279,7 +279,7 @@ ENTRY(divide_error)
 
 ENTRY(spurious_interrupt_bug)
         zeroentry do_spurious_interrupt_bug
-            
+
 
 ENTRY(page_fault)
         errorentry do_page_fault
@@ -294,8 +294,8 @@ ENTRY(thread_starter)
         pushq $0
         xorq %rbp,%rbp
         call *%rbx
-        call exit_thread 
-        
+        call exit_thread
+
 
 ENTRY(__arch_switch_threads)
 	pushq %rbp
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/blkfront.c
--- a/extras/mini-os/blkfront.c
+++ b/extras/mini-os/blkfront.c
@@ -1,4 +1,4 @@
-/* Minimal block driver for Mini-OS. 
+/* Minimal block driver for Mini-OS.
  * Copyright (c) 2007-2008 Samuel Thibault.
  * Based on netfront.c.
  */
@@ -111,7 +111,7 @@ struct blkfront_dev *init_blkfront(char 
 #endif
 
     snprintf(path, sizeof(path), "%s/backend-id", nodename);
-    dev->dom = xenbus_read_integer(path); 
+    dev->dom = xenbus_read_integer(path);
     evtchn_alloc_unbound(dev->dom, blkfront_handler, dev, &dev->evtchn);
 
     s = (struct blkif_sring*) alloc_page();
@@ -587,7 +587,7 @@ int blkfront_posix_rwop(int fd, uint8_t*
    /* Write mode checks */
    if(write) {
       /*Make sure we have write permission */
-      if(dev->info.info & VDISK_READONLY 
+      if(dev->info.info & VDISK_READONLY
             || (dev->info.mode != O_RDWR  && dev->info.mode !=  O_WRONLY)) {
          errno = EACCES;
          return -1;
@@ -651,7 +651,7 @@ int blkfront_posix_rwop(int fd, uint8_t*
          }
 
          /* For an aligned R/W we can read up to the maximum transfer size */
-         bytes = count > (BLKIF_MAX_SEGMENTS_PER_REQUEST-not_page_aligned)*PAGE_SIZE 
+         bytes = count > (BLKIF_MAX_SEGMENTS_PER_REQUEST-not_page_aligned)*PAGE_SIZE
             ? (BLKIF_MAX_SEGMENTS_PER_REQUEST-not_page_aligned)*PAGE_SIZE
             : count & ~(blocksize -1);
          aiocb.aio_nbytes = bytes;
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/console/console.c
--- a/extras/mini-os/console/console.c
+++ b/extras/mini-os/console/console.c
@@ -1,14 +1,14 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2006 - Grzegorz Milos - Cambridge University
  ****************************************************************************
  *
  *        File: console.h
  *      Author: Grzegorz Milos
- *     Changes: 
- *              
+ *     Changes:
+ *
  *        Date: Mar 2006
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Console interface.
  *
@@ -21,19 +21,19 @@
  * 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 
+ *
+ * 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.
  */
- 
+
 #include <mini-os/types.h>
 #include <mini-os/wait.h>
 #include <mini-os/mm.h>
@@ -50,7 +50,7 @@
 #define USE_XEN_CONSOLE
 
 
-/* If console not initialised the printk will be sent to xen serial line 
+/* If console not initialised the printk will be sent to xen serial line
    NOTE: you need to enable verbose in xen/Rules.mk for it to work. */
 static int console_initialised = 0;
 
@@ -61,7 +61,7 @@ static int console_initialised = 0;
         /* Just repeat what's written */
         buf[len] = '\0';
         printk("%s", buf);
-        
+
         if(buf[len-1] == '\r')
             printk("\nNo console input handler.\n");
     }
@@ -115,16 +115,16 @@ void console_print(struct consfront_dev 
         copied_ptr[length] = '\n';
         length++;
     }
-    
+
     ring_send_fn(dev, copied_ptr, length);
 }
 
 void print(int direct, const char *fmt, va_list args)
 {
     static char   buf[1024];
-    
+
     (void)vsnprintf(buf, sizeof(buf), fmt, args);
- 
+
     if(direct)
     {
         (void)HYPERVISOR_console_io(CONSOLEIO_write, strlen(buf), buf);
@@ -132,9 +132,9 @@ void print(int direct, const char *fmt, 
     } else {
 #ifndef USE_XEN_CONSOLE
     if(!console_initialised)
-#endif    
+#endif
             (void)HYPERVISOR_console_io(CONSOLEIO_write, strlen(buf), buf);
-        
+
         console_print(NULL, buf, strlen(buf));
     }
 }
@@ -144,7 +144,7 @@ void printk(const char *fmt, ...)
     va_list       args;
     va_start(args, fmt);
     print(0, fmt, args);
-    va_end(args);        
+    va_end(args);
 }
 
 void xprintk(const char *fmt, ...)
@@ -152,12 +152,12 @@ void xprintk(const char *fmt, ...)
     va_list       args;
     va_start(args, fmt);
     print(1, fmt, args);
-    va_end(args);        
+    va_end(args);
 }
 void init_console(void)
-{   
+{
     printk("Initialising console ... ");
-    xencons_ring_init();    
+    xencons_ring_init();
     console_initialised = 1;
     /* This is also required to notify the daemon */
     printk("done.\n");
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/console/xenbus.c
--- a/extras/mini-os/console/xenbus.c
+++ b/extras/mini-os/console/xenbus.c
@@ -84,7 +84,7 @@ struct consfront_dev *init_consfront(cha
 #endif
 
     snprintf(path, sizeof(path), "%s/backend-id", nodename);
-    if ((res = xenbus_read_integer(path)) < 0) 
+    if ((res = xenbus_read_integer(path)) < 0)
         return NULL;
     else
         dev->dom = res;
@@ -166,7 +166,7 @@ done:
         XenbusState state;
         char path[strlen(dev->backend) + 1 + 19 + 1];
         snprintf(path, sizeof(path), "%s/state", dev->backend);
-        
+
 	xenbus_watch_path_token(XBT_NIL, path, path, &dev->events);
         msg = NULL;
         state = xenbus_read_integer(path);
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/console/xencons_ring.c
--- a/extras/mini-os/console/xencons_ring.c
+++ b/extras/mini-os/console/xencons_ring.c
@@ -30,10 +30,10 @@ static inline struct xencons_interface *
         return mfn_to_virt(start_info.console.domU.mfn);
     else
         return NULL;
-} 
- 
+}
+
 int xencons_ring_send_no_notify(struct consfront_dev *dev, const char *data, unsigned len)
-{	
+{
     int sent = 0;
 	struct xencons_interface *intf;
 	XENCONS_RING_IDX cons, prod;
@@ -55,7 +55,7 @@ int xencons_ring_send_no_notify(struct c
 
 	wmb();
 	intf->out_prod = prod;
-    
+
     return sent;
 }
 
@@ -67,7 +67,7 @@ int xencons_ring_send(struct consfront_d
     notify_daemon(dev);
 
     return sent;
-}	
+}
 
 
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/events.c
--- a/extras/mini-os/events.c
+++ b/extras/mini-os/events.c
@@ -7,9 +7,9 @@
  *        File: events.c
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
  *     Changes: Grzegorz Milos (gm281@cam.ac.uk)
- *              
+ *
  *        Date: Jul 2003, changes Jun 2005
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Deals with events recieved on event channels
  *
@@ -125,7 +125,7 @@ void unbind_evtchn(evtchn_port_t port )
 	rc = HYPERVISOR_event_channel_op(EVTCHNOP_close, &close);
     if ( rc )
         printk("WARN: close_port %s failed rc=%d. ignored\n", port, rc);
-        
+
 }
 
 evtchn_port_t bind_virq(uint32_t virq, evtchn_handler_t handler, void *data)
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/fbfront.c
--- a/extras/mini-os/fbfront.c
+++ b/extras/mini-os/fbfront.c
@@ -1,5 +1,5 @@
 /*
- * Frame Buffer + Keyboard driver for Mini-OS. 
+ * Frame Buffer + Keyboard driver for Mini-OS.
  * Samuel Thibault <samuel.thibault@eu.citrix.com>, 2008
  * Based on blkfront.c.
  */
@@ -87,7 +87,7 @@ struct kbdfront_dev *init_kbdfront(char 
 #endif
 
     snprintf(path, sizeof(path), "%s/backend-id", nodename);
-    dev->dom = xenbus_read_integer(path); 
+    dev->dom = xenbus_read_integer(path);
     evtchn_alloc_unbound(dev->dom, kbdfront_handler, dev, &dev->evtchn);
 
     dev->page = s = (struct xenkbd_page*) alloc_page();
@@ -425,7 +425,7 @@ struct fbfront_dev *init_fbfront(char *_
 #endif
 
     snprintf(path, sizeof(path), "%s/backend-id", nodename);
-    dev->dom = xenbus_read_integer(path); 
+    dev->dom = xenbus_read_integer(path);
     evtchn_alloc_unbound(dev->dom, fbfront_handler, dev, &dev->evtchn);
 
     dev->page = s = (struct xenfb_page*) alloc_page();
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/gntmap.c
--- a/extras/mini-os/gntmap.c
+++ b/extras/mini-os/gntmap.c
@@ -21,12 +21,12 @@
  * 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 
+ * 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.
  */
 
@@ -100,7 +100,7 @@ gntmap_set_max_grants(struct gntmap *map
 }
 
 static int
-_gntmap_map_grant_ref(struct gntmap_entry *entry, 
+_gntmap_map_grant_ref(struct gntmap_entry *entry,
                       unsigned long host_addr,
                       uint32_t domid,
                       uint32_t ref,
@@ -178,7 +178,7 @@ gntmap_munmap(struct gntmap *map, unsign
 }
 
 void*
-gntmap_map_grant_refs(struct gntmap *map, 
+gntmap_map_grant_refs(struct gntmap *map,
                       uint32_t count,
                       uint32_t *domids,
                       int domids_stride,
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/gnttab.c
--- a/extras/mini-os/gnttab.c
+++ b/extras/mini-os/gnttab.c
@@ -1,14 +1,14 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2006 - Cambridge University
  ****************************************************************************
  *
  *        File: gnttab.c
- *      Author: Steven Smith (sos22@cam.ac.uk) 
+ *      Author: Steven Smith (sos22@cam.ac.uk)
  *     Changes: Grzegorz Milos (gm281@cam.ac.uk)
- *              
+ *
  *        Date: July 2006
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Simple grant tables implementation. About as stupid as it's
  *  possible to be and still work.
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/hypervisor.c
--- a/extras/mini-os/hypervisor.c
+++ b/extras/mini-os/hypervisor.c
@@ -1,27 +1,27 @@
 /******************************************************************************
  * hypervisor.c
- * 
+ *
  * Communication to/from hypervisor.
- * 
+ *
  * Copyright (c) 2002-2003, K A Fraser
  * Copyright (c) 2005, Grzegorz Milos, gm281@cam.ac.uk,Intel Research Cambridge
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (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 
+ *
+ * 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.
  */
 
@@ -45,7 +45,7 @@ void do_hypervisor_callback(struct pt_re
     vcpu_info_t   *vcpu_info = &s->vcpu_info[cpu];
 
     in_callback = 1;
-   
+
     vcpu_info->evtchn_upcall_pending = 0;
     /* NB x86. No need for a barrier here -- XCHG is a barrier on x86. */
 #if !defined(__i386__) && !defined(__x86_64__)
@@ -57,7 +57,7 @@ void do_hypervisor_callback(struct pt_re
     {
         l1i = __ffs(l1);
         l1 &= ~(1UL << l1i);
-        
+
         while ( (l2 = active_evtchns(cpu, s, l1i)) != 0 )
         {
             l2i = __ffs(l2);
@@ -105,7 +105,7 @@ inline void unmask_evtchn(uint32_t port)
      * The following is basically the equivalent of 'hw_resend_irq'. Just like
      * a real IO-APIC we 'lose the interrupt edge' if the channel is masked.
      */
-    if (  synch_test_bit        (port,    &s->evtchn_pending[0]) && 
+    if (  synch_test_bit        (port,    &s->evtchn_pending[0]) &&
          !synch_test_and_set_bit(port / (sizeof(unsigned long) * 8),
               &vcpu_info->evtchn_pending_sel) )
     {
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/arch/cc.h
--- a/extras/mini-os/include/arch/cc.h
+++ b/extras/mini-os/include/arch/cc.h
@@ -1,7 +1,7 @@
-/* 
+/*
  * lwip/arch/cc.h
  *
- * Compiler-specific types and macros for lwIP running on mini-os 
+ * Compiler-specific types and macros for lwIP running on mini-os
  *
  * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
  */
@@ -28,7 +28,7 @@ typedef uint16_t u_short;
 /*   Compiler hints for packing lwip's structures - */
 #define PACK_STRUCT_FIELD(_x)  _x
 #define PACK_STRUCT_STRUCT     __attribute__ ((packed))
-#define PACK_STRUCT_BEGIN 
+#define PACK_STRUCT_BEGIN
 #define PACK_STRUCT_END
 
 /*   Platform specific diagnostic output - */
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/arch/perf.h
--- a/extras/mini-os/include/arch/perf.h
+++ b/extras/mini-os/include/arch/perf.h
@@ -1,7 +1,7 @@
-/* 
+/*
  * lwip/arch/perf.h
  *
- * Arch-specific performance measurement for lwIP running on mini-os 
+ * Arch-specific performance measurement for lwIP running on mini-os
  *
  * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
  */
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/arch/sys_arch.h
--- a/extras/mini-os/include/arch/sys_arch.h
+++ b/extras/mini-os/include/arch/sys_arch.h
@@ -1,7 +1,7 @@
-/* 
+/*
  * lwip/arch/sys_arch.h
  *
- * Arch-specific semaphores and mailboxes for lwIP running on mini-os 
+ * Arch-specific semaphores and mailboxes for lwIP running on mini-os
  *
  * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
  */
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/console.h
--- a/extras/mini-os/include/console.h
+++ b/extras/mini-os/include/console.h
@@ -1,14 +1,14 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2006 - Grzegorz Milos - Cambridge University
  ****************************************************************************
  *
  *        File: console.h
  *      Author: Grzegorz Milos
- *     Changes: 
- *              
+ *     Changes:
+ *
  *        Date: Mar 2006
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Console interface.
  *
@@ -21,16 +21,16 @@
  * 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 
+ *
+ * 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 _LIB_CONSOLE_H_
@@ -67,7 +67,7 @@ void print(int direct, const char *fmt, 
 void printk(const char *fmt, ...);
 void xprintk(const char *fmt, ...);
 
-#define tprintk(_fmt, _args...) printk("[%s] " _fmt, current->name, ##_args) 
+#define tprintk(_fmt, _args...) printk("[%s] " _fmt, current->name, ##_args)
 
 void xencons_rx(char *buf, unsigned len, struct pt_regs *regs);
 void xencons_tx(void);
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/events.h
--- a/extras/mini-os/include/events.h
+++ b/extras/mini-os/include/events.h
@@ -7,9 +7,9 @@
  *        File: events.h
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
  *     Changes: Grzegorz Milos (gm281@cam.ac.uk)
- *              
+ *
  *        Date: Jul 2003, changes Jun 2005
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Deals with events on the event channels
  *
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/gntmap.h
--- a/extras/mini-os/include/gntmap.h
+++ b/extras/mini-os/include/gntmap.h
@@ -19,7 +19,7 @@ int
 gntmap_munmap(struct gntmap *map, unsigned long start_address, int count);
 
 void*
-gntmap_map_grant_refs(struct gntmap *map, 
+gntmap_map_grant_refs(struct gntmap *map,
                       uint32_t count,
                       uint32_t *domids,
                       int domids_stride,
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/hypervisor.h
--- a/extras/mini-os/include/hypervisor.h
+++ b/extras/mini-os/include/hypervisor.h
@@ -1,8 +1,8 @@
 /******************************************************************************
  * hypervisor.h
- * 
+ *
  * Hypervisor handling.
- * 
+ *
  *
  * Copyright (c) 2002, K A Fraser
  * Copyright (c) 2005, Grzegorz Milos
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/ioremap.h
--- a/extras/mini-os/include/ioremap.h
+++ b/extras/mini-os/include/ioremap.h
@@ -7,16 +7,16 @@
  * 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 
+ *
+ * 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.
  */
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/lib-gpl.h
--- a/extras/mini-os/include/lib-gpl.h
+++ b/extras/mini-os/include/lib-gpl.h
@@ -5,10 +5,10 @@
  *
  *        File: lib.h
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
- *     Changes: 
- *              
+ *     Changes:
+ *
  *        Date: Aug 2003
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Random useful library functions, from Linux'
  * include/linux/kernel.h
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/lib.h
--- a/extras/mini-os/include/lib.h
+++ b/extras/mini-os/include/lib.h
@@ -5,10 +5,10 @@
  *
  *        File: lib.h
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
- *     Changes: 
- *              
+ *     Changes:
+ *
  *        Date: Aug 2003
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Random useful library functions, contains some freebsd stuff
  *
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/lwipopts.h
--- a/extras/mini-os/include/lwipopts.h
+++ b/extras/mini-os/include/lwipopts.h
@@ -1,7 +1,7 @@
 /*
  * lwipopts.h
  *
- * Configuration for lwIP running on mini-os 
+ * Configuration for lwIP running on mini-os
  *
  * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
  */
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/mm.h
--- a/extras/mini-os/include/mm.h
+++ b/extras/mini-os/include/mm.h
@@ -9,16 +9,16 @@
  * 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 
+ *
+ * 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.
  */
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/netfront.h
--- a/extras/mini-os/include/netfront.h
+++ b/extras/mini-os/include/netfront.h
@@ -15,7 +15,7 @@ extern struct wait_queue_head netfront_q
 
 #ifdef HAVE_LWIP
 /* Call this to bring up the netfront interface and the lwIP stack.
- * N.B. _must_ be called from a thread; it's not safe to call this from 
+ * N.B. _must_ be called from a thread; it's not safe to call this from
  * app_main(). */
 void start_networking(void);
 void stop_networking(void);
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/posix/net/if.h
--- a/extras/mini-os/include/posix/net/if.h
+++ b/extras/mini-os/include/posix/net/if.h
@@ -1,5 +1,5 @@
 /*
- * This code is mostly taken from NetBSD net/if.h 
+ * This code is mostly taken from NetBSD net/if.h
  * Changes: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  *
  ******************************************************************************
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/posix/sys/poll.h
--- a/extras/mini-os/include/posix/sys/poll.h
+++ b/extras/mini-os/include/posix/sys/poll.h
@@ -1,5 +1,5 @@
 /*
- * This code is mostly taken from FreeBSD sys/sys/poll.h 
+ * This code is mostly taken from FreeBSD sys/sys/poll.h
  * Changes: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  *
  ****************************************************************************
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/sched.h
--- a/extras/mini-os/include/sched.h
+++ b/extras/mini-os/include/sched.h
@@ -33,7 +33,7 @@ void idle_thread_fn(void *unused);
 #define clear_runnable(_thread) (_thread->flags &= ~RUNNABLE_FLAG)
 
 #define switch_threads(prev, next) arch_switch_threads(prev, next)
- 
+
     /* Architecture specific setup of thread creation. */
 struct thread* arch_create_thread(char *name, void (*function)(void *),
                                   void *data);
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/semaphore.h
--- a/extras/mini-os/include/semaphore.h
+++ b/extras/mini-os/include/semaphore.h
@@ -5,7 +5,7 @@
 #include <mini-os/spinlock.h>
 
 /*
- * Implementation of semaphore in Mini-os is simple, because 
+ * Implementation of semaphore in Mini-os is simple, because
  * there are no preemptive threads, the atomicity is guaranteed.
  */
 
@@ -32,10 +32,10 @@ struct rw_semaphore {
 
 #define __MUTEX_INITIALIZER(name) \
     __SEMAPHORE_INITIALIZER(name,1)
-                           
+
 #define __DECLARE_SEMAPHORE_GENERIC(name,count) \
     struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
-    
+
 #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
 
 #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/sys/time.h
--- a/extras/mini-os/include/sys/time.h
+++ b/extras/mini-os/include/sys/time.h
@@ -8,9 +8,9 @@
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
  *     Changes: Grzegorz Milos (gm281@cam.ac.uk)
  *              Robert Kaiser (kaiser@informatik.fh-wiesbaden.de)
- *              
+ *
  *        Date: Jul 2003, changes: Jun 2005, Sep 2006
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Time and timer functions
  *
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/time.h
--- a/extras/mini-os/include/time.h
+++ b/extras/mini-os/include/time.h
@@ -8,9 +8,9 @@
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
  *     Changes: Grzegorz Milos (gm281@cam.ac.uk)
  *              Robert Kaiser (kaiser@informatik.fh-wiesbaden.de)
- *              
+ *
  *        Date: Jul 2003, changes: Jun 2005, Sep 2006
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Time and timer functions
  *
@@ -27,7 +27,7 @@
  * This value is adjusted by frequency drift.
  * NOW() returns the current time.
  * The other macros are for convenience to approximate short intervals
- * of real time into system time 
+ * of real time into system time
  */
 typedef int64_t s_time_t;
 #define NOW()                   ((s_time_t)monotonic_clock())
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/types.h
--- a/extras/mini-os/include/types.h
+++ b/extras/mini-os/include/types.h
@@ -5,10 +5,10 @@
  *
  *        File: types.h
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
- *     Changes: 
- *              
+ *     Changes:
+ *
  *        Date: May 2003
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: a random collection of type definitions
  *
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/wait.h
--- a/extras/mini-os/include/wait.h
+++ b/extras/mini-os/include/wait.h
@@ -86,9 +86,9 @@ static inline void wake_up(struct wait_q
     wake(get_current());                                        \
     remove_wait_queue(&wq, &__wait);                            \
     local_irq_restore(flags);                                   \
-} while(0) 
+} while(0)
 
-#define wait_event(wq, condition) wait_event_deadline(wq, condition, 0) 
+#define wait_event(wq, condition) wait_event_deadline(wq, condition, 0)
 
 
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/x86/arch_limits.h
--- a/extras/mini-os/include/x86/arch_limits.h
+++ b/extras/mini-os/include/x86/arch_limits.h
@@ -16,5 +16,5 @@
 
 #define __STACK_SIZE_PAGE_ORDER  4
 #define __STACK_SIZE             (__PAGE_SIZE * (1 << __STACK_SIZE_PAGE_ORDER))
-          
+
 #endif /* __ARCH_LIMITS_H__ */
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/x86/arch_mm.h
--- a/extras/mini-os/include/x86/arch_mm.h
+++ b/extras/mini-os/include/x86/arch_mm.h
@@ -9,16 +9,16 @@
  * 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 
+ *
+ * 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.
  */
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/x86/arch_sched.h
--- a/extras/mini-os/include/x86/arch_sched.h
+++ b/extras/mini-os/include/x86/arch_sched.h
@@ -7,11 +7,11 @@
 static inline struct thread* get_current(void)
 {
     struct thread **current;
-#ifdef __i386__    
+#ifdef __i386__
     register unsigned long sp asm("esp");
 #else
     register unsigned long sp asm("rsp");
-#endif 
+#endif
     current = (void *)(unsigned long)(sp & ~(__STACK_SIZE-1));
     return *current;
 }
@@ -21,5 +21,5 @@ extern void __arch_switch_threads(unsign
 #define arch_switch_threads(prev,next) __arch_switch_threads(&(prev)->sp, &(next)->sp)
 
 
-          
+
 #endif /* __ARCH_SCHED_H__ */
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/x86/os.h
--- a/extras/mini-os/include/x86/os.h
+++ b/extras/mini-os/include/x86/os.h
@@ -1,6 +1,6 @@
 /******************************************************************************
  * os.h
- * 
+ *
  * random collection of macros and definition
  */
 
@@ -72,7 +72,7 @@ void arch_fini(void);
 
 
 
-/* 
+/*
  * The use of 'barrier' in the following reflects their use as local-lock
  * operations. Reentrancy must be prevented (e.g., __cli()) /before/ following
  * critical operations are executed. All critical operations must complete
@@ -347,7 +347,7 @@ static inline unsigned long __xchg(unsig
  * @nr: Bit to clear
  * @addr: Address to count from
  *
- * This operation is atomic and cannot be reordered.  
+ * This operation is atomic and cannot be reordered.
  * It also implies a memory barrier.
  */
 static __inline__ int test_and_clear_bit(int nr, volatile void * addr)
@@ -515,7 +515,7 @@ static inline unsigned long __synch_cmpx
 
 static __inline__ void synch_set_bit(int nr, volatile void * addr)
 {
-    __asm__ __volatile__ ( 
+    __asm__ __volatile__ (
         "lock btsl %1,%0"
         : "=m" (ADDR) : "Ir" (nr) : "memory" );
 }
@@ -547,7 +547,7 @@ static __inline__ int synch_test_and_cle
 
 static __inline__ int synch_const_test_bit(int nr, const volatile void * addr)
 {
-    return ((1UL << (nr & 31)) & 
+    return ((1UL << (nr & 31)) &
             (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
 }
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/x86/traps.h
--- a/extras/mini-os/include/x86/traps.h
+++ b/extras/mini-os/include/x86/traps.h
@@ -1,13 +1,13 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2005 - Grzegorz Milos - Intel Reseach Cambridge
  ****************************************************************************
  *
  *        File: traps.h
  *      Author: Grzegorz Milos (gm281@cam.ac.uk)
- *              
+ *
  *        Date: Jun 2005
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Deals with traps
  *
@@ -46,7 +46,7 @@ struct pt_regs {
 	unsigned long rbx;
 /* arguments: non interrupts/non tracing syscalls only save upto here*/
  	unsigned long r11;
-	unsigned long r10;	
+	unsigned long r10;
 	unsigned long r9;
 	unsigned long r8;
 	unsigned long rax;
@@ -55,14 +55,14 @@ struct pt_regs {
 	unsigned long rsi;
 	unsigned long rdi;
 	unsigned long orig_rax;
-/* end of arguments */ 	
+/* end of arguments */
 /* cpu exception frame or undefined */
 	unsigned long rip;
 	unsigned long cs;
-	unsigned long eflags; 
-	unsigned long rsp; 
+	unsigned long eflags;
+	unsigned long rsp;
 	unsigned long ss;
-/* top of stack page */ 
+/* top of stack page */
 };
 
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/x86/x86_32/hypercall-x86_32.h
--- a/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h
+++ b/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h
@@ -1,23 +1,23 @@
 /******************************************************************************
  * hypercall-x86_32.h
- * 
+ *
  * Copied from XenLinux.
- * 
+ *
  * Copyright (c) 2002-2004, K A Fraser
- * 
+ *
  * This file may be 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
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/x86/x86_64/hypercall-x86_64.h
--- a/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h
+++ b/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h
@@ -1,27 +1,27 @@
 /******************************************************************************
  * hypercall-x86_64.h
- * 
+ *
  * Copied from XenLinux.
- * 
+ *
  * Copyright (c) 2002-2004, K A Fraser
- * 
+ *
  * 64-bit updates:
  *   Benjamin Liu <benjamin.liu@intel.com>
  *   Jun Nakajima <jun.nakajima@intel.com>
- * 
+ *
  * This file may be 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
@@ -155,7 +155,7 @@ HYPERVISOR_stack_switch(
 
 static inline int
 HYPERVISOR_set_callbacks(
-	unsigned long event_address, unsigned long failsafe_address, 
+	unsigned long event_address, unsigned long failsafe_address,
 	unsigned long syscall_address)
 {
 	return _hypercall3(int, set_callbacks,
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c
+++ b/extras/mini-os/kernel.c
@@ -1,29 +1,29 @@
 /******************************************************************************
  * kernel.c
- * 
+ *
  * Assorted crap goes here, including the initial C entry point, jumped at
  * from head.S.
- * 
+ *
  * Copyright (c) 2002-2003, K A Fraser & R Neugebauer
  * Copyright (c) 2005, Grzegorz Milos, Intel Research Cambridge
  * Copyright (c) 2006, Robert Kaiser, FH Wiesbaden
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (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 
+ *
+ * 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.
  */
 
@@ -54,12 +54,12 @@ void setup_xen_features(void)
     xen_feature_info_t fi;
     int i, j;
 
-    for (i = 0; i < XENFEAT_NR_SUBMAPS; i++) 
+    for (i = 0; i < XENFEAT_NR_SUBMAPS; i++)
     {
         fi.submap_idx = i;
         if (HYPERVISOR_xen_version(XENVER_get_features, &fi) < 0)
             break;
-        
+
         for (j=0; j<32; j++)
             xen_features[i*32+j] = !!(fi.submap & 1<<j);
     }
@@ -90,18 +90,18 @@ void start_kernel(start_info_t *si)
     printk("  start_info: %p(VA)\n", si);
     printk("    nr_pages: 0x%lx\n", si->nr_pages);
     printk("  shared_inf: 0x%08lx(MA)\n", si->shared_info);
-    printk("     pt_base: %p(VA)\n", (void *)si->pt_base); 
+    printk("     pt_base: %p(VA)\n", (void *)si->pt_base);
     printk("nr_pt_frames: 0x%lx\n", si->nr_pt_frames);
-    printk("    mfn_list: %p(VA)\n", (void *)si->mfn_list); 
+    printk("    mfn_list: %p(VA)\n", (void *)si->mfn_list);
     printk("   mod_start: 0x%lx(VA)\n", si->mod_start);
-    printk("     mod_len: %lu\n", si->mod_len); 
+    printk("     mod_len: %lu\n", si->mod_len);
     printk("       flags: 0x%x\n", (unsigned int)si->flags);
-    printk("    cmd_line: %s\n",  
+    printk("    cmd_line: %s\n",
            si->cmd_line ? (const char *)si->cmd_line : "NULL");
 
     /* Set up events. */
     init_events();
-    
+
     /* ENABLE EVENT DELIVERY. This is disabled at start of day. */
     __sti();
 
@@ -124,10 +124,10 @@ void start_kernel(start_info_t *si)
 
     /* Init grant tables */
     init_gnttab();
-    
+
     /* Init scheduler. */
     init_sched();
- 
+
     /* Init XenBus */
     init_xenbus();
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/lib/math.c
--- a/extras/mini-os/lib/math.c
+++ b/extras/mini-os/lib/math.c
@@ -5,10 +5,10 @@
  *
  *        File: math.c
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
- *     Changes: 
- *              
+ *     Changes:
+ *
  *        Date: Aug 2003
- * 
+ *
  * Environment: Xen Minimal OS
  * Description:  Library functions for 64bit arith and other
  *               from freebsd, files in sys/libkern/ (qdivrem.c, etc)
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/lib/printf.c
--- a/extras/mini-os/lib/printf.c
+++ b/extras/mini-os/lib/printf.c
@@ -5,7 +5,7 @@
  *
  *        File: printf.c
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
- *     Changes: Grzegorz Milos (gm281@cam.ac.uk) 
+ *     Changes: Grzegorz Milos (gm281@cam.ac.uk)
  *
  *        Date: Aug 2003, Aug 2005
  *
@@ -199,7 +199,7 @@ static char * number(char * buf, char * 
     i = 0;
     if (num == 0)
         tmp[i++]='0';
-    else 
+    else
     {
         /* XXX KAF: force unsigned mod and div. */
         unsigned long long num2=(unsigned long long)num;
@@ -589,7 +589,7 @@ int vsscanf(const char * buf, const char
 		if (!*fmt)
 			break;
 		++fmt;
-		
+
 		/* skip this conversion.
 		 * advance both strings to next white space
 		 */
@@ -678,7 +678,7 @@ int vsscanf(const char * buf, const char
 			break;
 		case '%':
 			/* looking for '%' in str */
-			if (*str++ != '%') 
+			if (*str++ != '%')
 				return num;
 			continue;
 		default:
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/lib/string.c
--- a/extras/mini-os/lib/string.c
+++ b/extras/mini-os/lib/string.c
@@ -5,10 +5,10 @@
  *
  *        File: string.c
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
- *     Changes: 
- *              
+ *     Changes:
+ *
  *        Date: Aug 2003
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Library function for string and memory manipulation
  *              Origin unknown
@@ -151,12 +151,12 @@ size_t strnlen(const char * s, size_t co
 char * strcat(char * dest, const char * src)
 {
     char *tmp = dest;
-    
+
     while (*dest)
         dest++;
-    
+
     while ((*dest++ = *src++) != '\0');
-    
+
     return tmp;
 }
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/lib/sys.c
--- a/extras/mini-os/lib/sys.c
+++ b/extras/mini-os/lib/sys.c
@@ -529,8 +529,8 @@ int fstat(int fd, struct stat *buf)
 	    buf->st_uid = 0;
 	    buf->st_gid = 0;
 	    buf->st_size = 0;
-	    buf->st_atime = 
-	    buf->st_mtime = 
+	    buf->st_atime =
+	    buf->st_mtime =
 	    buf->st_ctime = time(NULL);
 	    return 0;
 	}
@@ -618,7 +618,7 @@ DIR *opendir(const char *name)
 struct dirent *readdir(DIR *dir)
 {
     return NULL;
-} 
+}
 
 int closedir(DIR *dir)
 {
@@ -1328,7 +1328,7 @@ unsupported_function_crash(umask);
 /* We could support that.  */
 unsupported_function_log(int, chdir, -1);
 
-/* No dynamic library support.  */ 
+/* No dynamic library support.  */
 unsupported_function_log(void *, dlopen, NULL);
 unsupported_function_log(void *, dlsym, NULL);
 unsupported_function_log(char *, dlerror, NULL);
@@ -1368,7 +1368,7 @@ unsupported_function_log(char *, if_inde
 unsupported_function_log(struct  if_nameindex *, if_nameindex, (struct  if_nameindex *) NULL);
 unsupported_function_crash(if_freenameindex);
 
-/* Linuxish abi for the Caml runtime, don't support 
+/* Linuxish abi for the Caml runtime, don't support
    Log, and return an error code if possible.  If it is not possible
    to inform the application of an error, then crash instead!
 */
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/lib/xmalloc.c
--- a/extras/mini-os/lib/xmalloc.c
+++ b/extras/mini-os/lib/xmalloc.c
@@ -1,4 +1,4 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2005 - Grzegorz Milos - Intel Research Cambridge
  ****************************************************************************
@@ -6,11 +6,11 @@
  *        File: xmaloc.c
  *      Author: Grzegorz Milos (gm281@cam.ac.uk)
  *              Samuel Thibault (samuel.thibault@eu.citrix.com)
- *     Changes: 
- *              
+ *     Changes:
+ *
  *        Date: Aug 2005
  *              Jan 2008
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: simple memory allocator
  *
@@ -286,9 +286,9 @@ void *_realloc(void *ptr, size_t size)
 	maybe_split(hdr, pad->hdr_size + size, hdr->size);
         return ptr;
     }
-    
+
     new = _xmalloc(size, DEFAULT_ALIGN);
-    if (new == NULL) 
+    if (new == NULL)
         return NULL;
 
     memcpy(new, ptr, old_data_size);
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/lwip-arch.c
--- a/extras/mini-os/lwip-arch.c
+++ b/extras/mini-os/lwip-arch.c
@@ -1,7 +1,7 @@
-/* 
+/*
  * lwip-arch.c
  *
- * Arch-specific semaphores and mailboxes for lwIP running on mini-os 
+ * Arch-specific semaphores and mailboxes for lwIP running on mini-os
  *
  * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
  */
@@ -44,7 +44,7 @@ void sys_sem_signal(sys_sem_t sem)
  * signaled. If the "timeout" argument is non-zero, the thread should
  * only be blocked for the specified time (measured in
  * milliseconds).
- * 
+ *
  * If the timeout argument is non-zero, the return value is the number of
  * milliseconds spent waiting for the semaphore to be signaled. If the
  * semaphore wasn't signaled within the specified time, the return value is
@@ -76,9 +76,9 @@ uint32_t sys_arch_sem_wait(sys_sem_t sem
     if (sem->count > 0) {
         sem->count--;
         sys_arch_unprotect(prot);
-        return NSEC_TO_MSEC(NOW() - then); 
+        return NSEC_TO_MSEC(NOW() - then);
     }
-    
+
     sys_arch_unprotect(prot);
     return SYS_ARCH_TIMEOUT;
 }
@@ -215,12 +215,12 @@ uint32_t sys_arch_mbox_tryfetch(sys_mbox
  * each thread has a list of timeouts which is repressented as a linked
  * list of sys_timeout structures. The sys_timeouts structure holds a
  * pointer to a linked list of timeouts. This function is called by
- * the lwIP timeout scheduler and must not return a NULL value. 
+ * the lwIP timeout scheduler and must not return a NULL value.
  *
  * In a single threadd sys_arch implementation, this function will
  * simply return a pointer to a global sys_timeouts variable stored in
  * the sys_arch module. */
-struct sys_timeouts *sys_arch_timeouts(void) 
+struct sys_timeouts *sys_arch_timeouts(void)
 {
     static struct sys_timeouts timeout;
     return &timeout;
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/lwip-net.c
--- a/extras/mini-os/lwip-net.c
+++ b/extras/mini-os/lwip-net.c
@@ -1,4 +1,4 @@
-/* 
+/*
  * lwip-net.c
  *
  * interface between lwIP's ethernet and Mini-os's netfront.
@@ -11,9 +11,9 @@
 
 /*
  * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
- * All rights reserved. 
- * 
- * Redistribution and use in source and binary forms, with or without modification, 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
  * are permitted provided that the following conditions are met:
  *
  * 1. Redistributions of source code must retain the above copyright notice,
@@ -22,21 +22,21 @@
  *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
  * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission. 
+ *    derived from this software without specific prior written permission.
  *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
- * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
+ * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  * OF SUCH DAMAGE.
  *
  * This file is part of the lwIP TCP/IP stack.
- * 
+ *
  * Author: Adam Dunkels <adam@sics.se>
  *
  */
@@ -118,7 +118,7 @@ low_level_output(struct netif *netif, st
 #if ETH_PAD_SIZE
   pbuf_header(p, ETH_PAD_SIZE);			/* reclaim the padding word */
 #endif
-  
+
   LINK_STATS_INC(link.xmit);
 
   return ERR_OK;
@@ -139,17 +139,17 @@ static err_t
 netfront_output(struct netif *netif, struct pbuf *p,
       struct ip_addr *ipaddr)
 {
-  
+
  /* resolve hardware address, then send (or queue) packet */
   return etharp_output(netif, p, ipaddr);
- 
+
 }
 
 /*
  * netfront_input():
  *
  * This function should be called when a packet is ready to be read
- * from the interface. 
+ * from the interface.
  *
  */
 
@@ -162,7 +162,7 @@ netfront_input(struct netif *netif, unsi
 #if ETH_PAD_SIZE
   len += ETH_PAD_SIZE; /* allow room for Ethernet padding */
 #endif
-  
+
   /* move received packet into a new pbuf */
   p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
   if (p == NULL) {
@@ -174,7 +174,7 @@ netfront_input(struct netif *netif, unsi
 #if ETH_PAD_SIZE
   pbuf_header(p, -ETH_PAD_SIZE); /* drop the padding word */
 #endif
-  
+
   /* We iterate over the pbuf chain until we have read the entire
    * packet into the pbuf. */
   for(q = p; q != NULL && len > 0; q = q->next) {
@@ -196,7 +196,7 @@ netfront_input(struct netif *netif, unsi
   ethhdr = p->payload;
 
   ethhdr = p->payload;
-    
+
   switch (htons(ethhdr->type)) {
   /* IP packet? */
   case ETHTYPE_IP:
@@ -213,7 +213,7 @@ netfront_input(struct netif *netif, unsi
       /* Could not store it, drop */
       pbuf_free(p);
     break;
-      
+
   case ETHTYPE_ARP:
     /* pass p to ARP module  */
     etharp_arp_input(netif, (struct eth_addr *) netif->hwaddr, p);
@@ -227,10 +227,10 @@ netfront_input(struct netif *netif, unsi
 }
 
 
-/* 
+/*
  * netif_rx(): overrides the default netif_rx behaviour in the netfront driver.
- * 
- * Pull received packets into a pbuf queue for the low_level_input() 
+ *
+ * Pull received packets into a pbuf queue for the low_level_input()
  * function to pass up to lwIP.
  */
 
@@ -290,14 +290,14 @@ netif_netfront_init(struct netif *netif)
   netif->ifoutnucastpkts = 0;
   netif->ifoutdiscards = 0;
 #endif
-  
+
   netif->name[0] = IFNAME0;
   netif->name[1] = IFNAME1;
   netif->output = netfront_output;
   netif->linkoutput = low_level_output;
-  
+
   the_interface = netif;
-  
+
   /* set MAC hardware address */
   netif->hwaddr_len = 6;
   netif->hwaddr[0] = mac[0];
@@ -312,7 +312,7 @@ netif_netfront_init(struct netif *netif)
 
   /* maximum transfer unit */
   netif->mtu = 1500;
-  
+
   /* broadcast capability */
   netif->flags = NETIF_FLAG_BROADCAST;
 
@@ -333,10 +333,10 @@ static void tcpip_bringup_finished(void 
   up(&tcpip_is_up);
 }
 
-/* 
- * Utility function to bring the whole lot up.  Call this from app_main() 
+/*
+ * Utility function to bring the whole lot up.  Call this from app_main()
  * or similar -- it starts netfront and have lwIP start its thread,
- * which calls back to tcpip_bringup_finished(), which 
+ * which calls back to tcpip_bringup_finished(), which
  * lets us know it's OK to continue.
  */
 void start_networking(void)
@@ -350,7 +350,7 @@ void start_networking(void)
   tprintk("Waiting for network.\n");
 
   dev = init_netfront(NULL, NULL, rawmac, &ip);
-  
+
   if (ip) {
     ipaddr.addr = inet_addr(ip);
     if (IN_CLASSA(ntohl(ipaddr.addr)))
@@ -364,13 +364,13 @@ void start_networking(void)
   }
   tprintk("IP %x netmask %x gateway %x.\n",
           ntohl(ipaddr.addr), ntohl(netmask.addr), ntohl(gw.addr));
-  
+
   tprintk("TCP/IP bringup begins.\n");
-  
+
   netif = xmalloc(struct netif);
   tcpip_init(tcpip_bringup_finished, netif);
-    
-  netif_add(netif, &ipaddr, &netmask, &gw, rawmac, 
+
+  netif_add(netif, &ipaddr, &netmask, &gw, rawmac,
             netif_netfront_init, ip_input);
   netif_set_default(netif);
   netif_set_up(netif);
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/mm.c
--- a/extras/mini-os/mm.c
+++ b/extras/mini-os/mm.c
@@ -1,4 +1,4 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2003 - Rolf Neugebauer - Intel Research Cambridge
  * (C) 2005 - Grzegorz Milos - Intel Research Cambridge
@@ -7,9 +7,9 @@
  *        File: mm.c
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
  *     Changes: Grzegorz Milos
- *              
+ *
  *        Date: Aug 2003, chages Aug 2005
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: memory management related functions
  *              contains buddy page allocator from Xen.
@@ -21,16 +21,16 @@
  * 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 
+ *
+ * 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.
  */
 
@@ -62,7 +62,7 @@ static unsigned long *alloc_bitmap;
 
 /*
  * Hint regarding bitwise arithmetic in map_{alloc,free}:
- *  -(1<<n)  sets all bits >= n. 
+ *  -(1<<n)  sets all bits >= n.
  *  (1<<n)-1 sets all bits <  n.
  * Variable names in map_{alloc,free}:
  *  *_idx == Index into `alloc_bitmap' array.
@@ -82,7 +82,7 @@ static void map_alloc(unsigned long firs
     {
         alloc_bitmap[curr_idx] |= ((1UL<<end_off)-1) & -(1UL<<start_off);
     }
-    else 
+    else
     {
         alloc_bitmap[curr_idx] |= -(1UL<<start_off);
         while ( ++curr_idx < end_idx ) alloc_bitmap[curr_idx] = ~0UL;
@@ -104,7 +104,7 @@ static void map_free(unsigned long first
     {
         alloc_bitmap[curr_idx] &= -(1UL<<end_off) | ((1UL<<start_off)-1);
     }
-    else 
+    else
     {
         alloc_bitmap[curr_idx] &= (1UL<<start_off)-1;
         while ( ++curr_idx != end_idx ) alloc_bitmap[curr_idx] = 0;
@@ -152,8 +152,8 @@ USED static void print_allocation(void *
     for(count = 0; count < nr_pages; count++)
         if(allocated_in_map(pfn_start + count)) printk("1");
         else printk("0");
-        
-    printk("\n");        
+
+    printk("\n");
 }
 
 /*
@@ -166,13 +166,13 @@ USED static void print_chunks(void *star
     int order, count;
     chunk_head_t *head;
     unsigned long pfn_start = virt_to_pfn(start);
-   
+
     memset(chunks, (int)'_', 1000);
-    if(nr_pages > 1000) 
+    if(nr_pages > 1000)
     {
         DEBUG("Can only pring 1000 pages. Increase buffer size.");
     }
-    
+
     for(order=0; order < FREELIST_SIZE; order++)
     {
         head = free_head[order];
@@ -264,12 +264,12 @@ unsigned long alloc_pages(int order)
 
     /* Find smallest order which can satisfy the request. */
     for ( i = order; i < FREELIST_SIZE; i++ ) {
-	if ( !FREELIST_EMPTY(free_head[i]) ) 
+	if ( !FREELIST_EMPTY(free_head[i]) )
 	    break;
     }
 
     if ( i == FREELIST_SIZE ) goto no_memory;
- 
+
     /* Unlink a chunk. */
     alloc_ch = free_head[i];
     free_head[i] = alloc_ch->next;
@@ -293,7 +293,7 @@ unsigned long alloc_pages(int order)
         spare_ch->next->pprev = &spare_ch->next;
         free_head[i] = spare_ch;
     }
-    
+
     map_alloc(PHYS_PFN(to_phys(alloc_ch)), 1UL<<order);
 
     return((unsigned long)alloc_ch);
@@ -310,43 +310,43 @@ void free_pages(void *pointer, int order
     chunk_head_t *freed_ch, *to_merge_ch;
     chunk_tail_t *freed_ct;
     unsigned long mask;
-    
+
     /* First free the chunk */
     map_free(virt_to_pfn(pointer), 1UL << order);
-    
+
     /* Create free chunk */
     freed_ch = (chunk_head_t *)pointer;
     freed_ct = (chunk_tail_t *)((char *)pointer + (1UL<<(order + PAGE_SHIFT)))-1;
-    
+
     /* Now, possibly we can conseal chunks together */
     while(order < FREELIST_SIZE)
     {
         mask = 1UL << (order + PAGE_SHIFT);
-        if((unsigned long)freed_ch & mask) 
+        if((unsigned long)freed_ch & mask)
         {
             to_merge_ch = (chunk_head_t *)((char *)freed_ch - mask);
             if(allocated_in_map(virt_to_pfn(to_merge_ch)) ||
                     to_merge_ch->level != order)
                 break;
-            
+
             /* Merge with predecessor */
-            freed_ch = to_merge_ch;   
+            freed_ch = to_merge_ch;
         }
-        else 
+        else
         {
             to_merge_ch = (chunk_head_t *)((char *)freed_ch + mask);
             if(allocated_in_map(virt_to_pfn(to_merge_ch)) ||
                     to_merge_ch->level != order)
                 break;
-            
+
             /* Merge with successor */
             freed_ct = (chunk_tail_t *)((char *)to_merge_ch + mask) - 1;
         }
-        
+
         /* We are commited to merging, unlink the chunk */
         *(to_merge_ch->pprev) = to_merge_ch->next;
         to_merge_ch->next->pprev = to_merge_ch->pprev;
-        
+
         order++;
     }
 
@@ -355,10 +355,10 @@ void free_pages(void *pointer, int order
     freed_ch->next  = free_head[order];
     freed_ch->pprev = &free_head[order];
     freed_ct->level = order;
-    
+
     freed_ch->next->pprev = &freed_ch->next;
-    free_head[order] = freed_ch;   
-   
+    free_head[order] = freed_ch;
+
 }
 
 int free_physical_pages(xen_pfn_t *mfns, int n)
@@ -382,7 +382,7 @@ void *sbrk(ptrdiff_t increment)
 	printk("Heap exhausted: %p + %lx = %p > %p\n", old_brk, increment, new_brk, heap_end);
 	return NULL;
     }
-    
+
     if (new_brk > heap_mapped) {
         unsigned long n = (new_brk - heap_mapped + PAGE_SIZE - 1) / PAGE_SIZE;
         do_map_zero(heap_mapped, n);
@@ -409,13 +409,13 @@ void init_mm(void)
      * now we can initialise the page allocator
      */
     printk("MM: Initialise page allocator for %lx(%lx)-%lx(%lx)\n",
-           (u_long)to_virt(PFN_PHYS(start_pfn)), PFN_PHYS(start_pfn), 
+           (u_long)to_virt(PFN_PHYS(start_pfn)), PFN_PHYS(start_pfn),
            (u_long)to_virt(PFN_PHYS(max_pfn)), PFN_PHYS(max_pfn));
     init_page_allocator(PFN_PHYS(start_pfn), PFN_PHYS(max_pfn));
     printk("MM: done\n");
 
     arch_init_p2m(max_pfn);
-    
+
     arch_init_demand_mapping_area(max_pfn);
 }
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/netfront.c
--- a/extras/mini-os/netfront.c
+++ b/extras/mini-os/netfront.c
@@ -1,4 +1,4 @@
-/* Minimal network driver for Mini-OS. 
+/* Minimal network driver for Mini-OS.
  * Copyright (c) 2006-2007 Jacob Gorm Hansen, University of Copenhagen.
  * Based on netfront.c from Xen Linux.
  *
@@ -162,7 +162,7 @@ moretodo:
         void* page = buf->page;
 
         /* We are sure to have free gnttab entries since they got released above */
-        buf->gref = req->gref = 
+        buf->gref = req->gref =
             gnttab_grant_access(dev->dom,virt_to_mfn(page),0);
 
         req->id = id;
@@ -171,7 +171,7 @@ moretodo:
     wmb();
 
     dev->rx.req_prod_pvt = req_prod + i;
-    
+
     RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&dev->rx, notify);
     if (notify)
         notify_remote_via_evtchn(dev->evtchn);
@@ -189,7 +189,7 @@ void network_tx_buf_gc(struct netfront_d
         prod = dev->tx.sring->rsp_prod;
         rmb(); /* Ensure we see responses up to 'rp'. */
 
-        for (cons = dev->tx.rsp_cons; cons != prod; cons++) 
+        for (cons = dev->tx.rsp_cons; cons != prod; cons++)
         {
             struct netif_tx_response *txrsp;
             struct net_buffer *buf;
@@ -571,12 +571,12 @@ void init_rx_buffers(struct netfront_dev
     int notify;
 
     /* Rebuild the RX buffer freelist and the RX ring itself. */
-    for (requeue_idx = 0, i = 0; i < NET_RX_RING_SIZE; i++) 
+    for (requeue_idx = 0, i = 0; i < NET_RX_RING_SIZE; i++)
     {
         struct net_buffer* buf = &dev->rx_buffers[requeue_idx];
         req = RING_GET_REQUEST(&dev->rx, requeue_idx);
 
-        buf->gref = req->gref = 
+        buf->gref = req->gref =
             gnttab_grant_access(dev->dom,virt_to_mfn(buf->page),0);
 
         req->id = requeue_idx;
@@ -588,7 +588,7 @@ void init_rx_buffers(struct netfront_dev
 
     RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&dev->rx, notify);
 
-    if (notify) 
+    if (notify)
         notify_remote_via_evtchn(dev->evtchn);
 
     dev->rx.sring->rsp_event = dev->rx.rsp_cons + 1;
@@ -623,7 +623,7 @@ void netfront_xmit(struct netfront_dev *
 
     memcpy(page,data,len);
 
-    buf->gref = 
+    buf->gref =
         tx->gref = gnttab_grant_access(dev->dom,virt_to_mfn(page),1);
 
     tx->offset=0;
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/pcifront.c
--- a/extras/mini-os/pcifront.c
+++ b/extras/mini-os/pcifront.c
@@ -1,4 +1,4 @@
-/* Minimal PCI driver for Mini-OS. 
+/* Minimal PCI driver for Mini-OS.
  * Copyright (c) 2007-2008 Samuel Thibault.
  * Based on blkfront.c.
  */
@@ -157,7 +157,7 @@ struct pcifront_dev *init_pcifront(char 
     printk("******************* PCIFRONT for %s **********\n\n\n", nodename);
 
     snprintf(path, sizeof(path), "%s/backend-id", nodename);
-    dom = xenbus_read_integer(path); 
+    dom = xenbus_read_integer(path);
     if (dom == -1) {
         printk("no backend\n");
         return NULL;
@@ -518,7 +518,7 @@ int pcifront_enable_msi(struct pcifront_
     op.devfn = PCI_DEVFN(slot, fun);
 
     pcifront_op(dev, &op);
-    
+
     if (op.err)
         return op.err;
     else
@@ -543,7 +543,7 @@ int pcifront_disable_msi(struct pcifront
     op.devfn = PCI_DEVFN(slot, fun);
 
     pcifront_op(dev, &op);
-    
+
     return op.err;
 }
 
@@ -572,7 +572,7 @@ int pcifront_enable_msix(struct pcifront
     memcpy(op.msix_entries, entries, n * sizeof(*entries));
 
     pcifront_op(dev, &op);
-    
+
     if (op.err)
         return op.err;
 
@@ -600,6 +600,6 @@ int pcifront_disable_msix(struct pcifron
     op.devfn = PCI_DEVFN(slot, fun);
 
     pcifront_op(dev, &op);
-    
+
     return op.err;
 }
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/sched.c
--- a/extras/mini-os/sched.c
+++ b/extras/mini-os/sched.c
@@ -1,4 +1,4 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2005 - Grzegorz Milos - Intel Research Cambridge
  ****************************************************************************
@@ -6,13 +6,13 @@
  *        File: sched.c
  *      Author: Grzegorz Milos
  *     Changes: Robert Kaiser
- *              
+ *
  *        Date: Aug 2005
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: simple scheduler for Mini-Os
  *
- * The scheduler is non-preemptive (cooperative), and schedules according 
+ * The scheduler is non-preemptive (cooperative), and schedules according
  * to Round Robin algorithm.
  *
  ****************************************************************************
@@ -22,16 +22,16 @@
  * 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 
+ *
+ * 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.
  */
 
@@ -79,7 +79,7 @@ void schedule(void)
     unsigned long flags;
 
     prev = current;
-    local_irq_save(flags); 
+    local_irq_save(flags);
 
     if (in_callback) {
         printk("Must not call schedule() from a callback\n");
@@ -106,7 +106,7 @@ void schedule(void)
                 else if (thread->wakeup_time < min_wakeup_time)
                     min_wakeup_time = thread->wakeup_time;
             }
-            if(is_runnable(thread)) 
+            if(is_runnable(thread))
             {
                 next = thread;
                 /* Put this thread on the end of the list */
@@ -255,17 +255,17 @@ void th_f1(void *data)
         schedule();
         printk("Thread \"%s\" releases the semaphore\n", current->name);
         up(&mutex);
-        
-        
+
+
         gettimeofday(&tv1, NULL);
         for(;;)
         {
             gettimeofday(&tv2, NULL);
             if(tv2.tv_sec - tv1.tv_sec > 2) break;
         }
-                
-        
-        schedule(); 
+
+
+        schedule();
     }
 }
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/test.c
--- a/extras/mini-os/test.c
+++ b/extras/mini-os/test.c
@@ -1,28 +1,28 @@
 /******************************************************************************
  * test.c
- * 
+ *
  * Test code for all the various frontends; split from kernel.c
- * 
+ *
  * Copyright (c) 2002-2003, K A Fraser & R Neugebauer
  * Copyright (c) 2005, Grzegorz Milos, Intel Research Cambridge
  * Copyright (c) 2006, Robert Kaiser, FH Wiesbaden
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (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 
+ *
+ * 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.
  */
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/xenbus/xenbus.c
--- a/extras/mini-os/xenbus/xenbus.c
+++ b/extras/mini-os/xenbus/xenbus.c
@@ -1,15 +1,15 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2006 - Cambridge University
  ****************************************************************************
  *
  *        File: xenbus.c
- *      Author: Steven Smith (sos22@cam.ac.uk) 
+ *      Author: Steven Smith (sos22@cam.ac.uk)
  *     Changes: Grzegorz Milos (gm281@cam.ac.uk)
  *     Changes: John D. Ramsdell
- *              
+ *
  *        Date: Jun 2006, chages Aug 2005
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Minimal implementation of xenbus
  *
@@ -51,7 +51,7 @@ static struct watch {
     xenbus_event_queue *events;
     struct watch *next;
 } *watches;
-struct xenbus_req_info 
+struct xenbus_req_info
 {
     int in_use:1;
     struct wait_queue_head waitq;
@@ -196,10 +196,10 @@ static void xenbus_thread_func(void *ign
     struct xsd_sockmsg msg;
     unsigned prod = xenstore_buf->rsp_prod;
 
-    for (;;) 
+    for (;;)
     {
         wait_event(xb_waitq, prod != xenstore_buf->rsp_prod);
-        while (1) 
+        while (1)
         {
             prod = xenstore_buf->rsp_prod;
             DEBUG("Rsp_cons %d, rsp_prod %d.\n", xenstore_buf->rsp_cons,
@@ -298,7 +298,7 @@ static int allocate_xenbus_id(void)
     static int probe;
     int o_probe;
 
-    while (1) 
+    while (1)
     {
         spin_lock(&req_lock);
         if (nr_live_reqs < NR_REQS)
@@ -308,7 +308,7 @@ static int allocate_xenbus_id(void)
     }
 
     o_probe = probe;
-    for (;;) 
+    for (;;)
     {
         if (!req_info[o_probe].in_use)
             break;
@@ -373,7 +373,7 @@ static void xb_write(int type, int req_i
     /* Wait for the ring to drain to the point where we can send the
        message. */
     prod = xenstore_buf->req_prod;
-    if (prod + len - xenstore_buf->req_cons > XENSTORE_RING_SIZE) 
+    if (prod + len - xenstore_buf->req_cons > XENSTORE_RING_SIZE)
     {
         /* Wait for there to be space on the ring */
         DEBUG("prod %d, len %d, cons %d, size %d; waiting.\n",
@@ -389,7 +389,7 @@ static void xb_write(int type, int req_i
        overflowing the ring.  Do so. */
     total_off = 0;
     req_off = 0;
-    while (total_off < len) 
+    while (total_off < len)
     {
         this_chunk = min(cur_req->len - req_off,
                 XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(prod));
@@ -398,7 +398,7 @@ static void xb_write(int type, int req_i
         prod += this_chunk;
         req_off += this_chunk;
         total_off += this_chunk;
-        if (req_off == cur_req->len) 
+        if (req_off == cur_req->len)
         {
             req_off = 0;
             if (cur_req == &header_req)
@@ -465,7 +465,7 @@ static char *errmsg(struct xsd_sockmsg *
     res[rep->len] = 0;
     free(rep);
     return res;
-}	
+}
 
 /* Send a debug message to xenbus.  Can block. */
 static void xenbus_debug_msg(const char *msg)
@@ -535,7 +535,7 @@ char *xenbus_read(xenbus_transaction_t x
 
 char *xenbus_write(xenbus_transaction_t xbt, const char *path, const char *value)
 {
-    struct write_req req[] = { 
+    struct write_req req[] = {
 	{path, strlen(path) + 1},
 	{value, strlen(value)},
     };
@@ -552,7 +552,7 @@ char* xenbus_watch_path_token( xenbus_tr
 {
     struct xsd_sockmsg *rep;
 
-    struct write_req req[] = { 
+    struct write_req req[] = {
         {path, strlen(path) + 1},
 	{token, strlen(token) + 1},
     };
@@ -582,7 +582,7 @@ char* xenbus_unwatch_path_token( xenbus_
 {
     struct xsd_sockmsg *rep;
 
-    struct write_req req[] = { 
+    struct write_req req[] = {
         {path, strlen(path) + 1},
 	{token, strlen(token) + 1},
     };
@@ -644,7 +644,7 @@ char *xenbus_get_perms(xenbus_transactio
 char *xenbus_set_perms(xenbus_transaction_t xbt, const char *path, domid_t dom, char perm)
 {
     char value[PERM_MAX_SIZE];
-    struct write_req req[] = { 
+    struct write_req req[] = {
 	{path, strlen(path) + 1},
 	{value, 0},
     };
@@ -786,7 +786,7 @@ static void do_ls_test(const char *pre)
 	free(msg);
 	return;
     }
-    for (x = 0; dirs[x]; x++) 
+    for (x = 0; dirs[x]; x++)
     {
         printk("ls %s[%d] -> %s\n", pre, x, dirs[x]);
         free(dirs[x]);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:30:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:30:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1ZX-0000Ww-48; Mon, 26 Nov 2012 16:30:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1ZU-0000WO-Ve
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:30:13 +0000
Received: from [193.109.254.147:14060] by server-4.bemta-14.messagelabs.com id
	9E/BF-18856-41993B05; Mon, 26 Nov 2012 16:30:12 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353947405!8617414!3
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU5NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2310 invoked from network); 26 Nov 2012 16:30:09 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:30:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="45627152"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:30:05 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:30:04 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1Tz-0005Uf-GO;
	Mon, 26 Nov 2012 16:24:31 +0000
MIME-Version: 1.0
X-Mercurial-Node: 7784cd3925c571903e75f19edf42efc4cc31749e
Message-ID: <7784cd3925c571903e75.1353947052@andrewcoop.uk.xensource.com>
In-Reply-To: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:24:12 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 4 of 4] minios/whitespace: Clean up trailing
	whitespace
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch was generated using

find . -name "*.[hcS]" | xargs sed -e "s/[         ]\+$//g" -i

from the minios directory.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/apps/daytime/daytime.c
--- a/extras/mini-os/apps/daytime/daytime.c
+++ b/extras/mini-os/apps/daytime/daytime.c
@@ -1,6 +1,6 @@
-/* 
+/*
  * daytime.c: a simple network service based on lwIP and mini-os
- * 
+ *
  * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
  */
 
@@ -48,7 +48,7 @@ void run_server(void *p)
 
     while (1) {
         session = netconn_accept(listener);
-        if (session == NULL) 
+        if (session == NULL)
             continue;
 
         gettimeofday(&tv, NULL);
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/arch/x86/ioremap.c
--- a/extras/mini-os/arch/x86/ioremap.c
+++ b/extras/mini-os/arch/x86/ioremap.c
@@ -1,22 +1,22 @@
 /*
  * Copyright (C) 2009,  Netronome Systems, Inc.
- *                
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (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 
+ *
+ * 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.
  */
 
@@ -29,7 +29,7 @@
 
 /* Map a physical address range into virtual address space with provided
  * flags. Return a virtual address range it is mapped to. */
-static void *__do_ioremap(unsigned long phys_addr, unsigned long size, 
+static void *__do_ioremap(unsigned long phys_addr, unsigned long size,
                           unsigned long prot)
 {
     unsigned long va;
@@ -41,7 +41,7 @@ static void *__do_ioremap(unsigned long 
     num_pages = (offset + size + PAGE_SIZE - 1) / PAGE_SIZE;
     phys_addr &= PAGE_MASK;
     mfns = mfn = phys_addr >> PAGE_SHIFT;
-    
+
     va = (unsigned long)map_frames_ex(&mfns, num_pages, 0, 1, 1,
                                       DOMID_IO, NULL, prot);
     return (void *)(va + offset);
@@ -60,7 +60,7 @@ void *ioremap_nocache(unsigned long phys
 /* Un-map the io-remapped region. Currently no list of existing mappings is
  * maintained, so the caller has to supply the size */
 void iounmap(void *virt_addr, unsigned long size)
-{   
+{
     unsigned long num_pages;
     unsigned long va = (unsigned long)virt_addr;
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/arch/x86/mm.c
--- a/extras/mini-os/arch/x86/mm.c
+++ b/extras/mini-os/arch/x86/mm.c
@@ -1,4 +1,4 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2003 - Rolf Neugebauer - Intel Research Cambridge
  * (C) 2005 - Grzegorz Milos - Intel Research Cambridge
@@ -7,9 +7,9 @@
  *        File: mm.c
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
  *     Changes: Grzegorz Milos
- *              
+ *
  *        Date: Aug 2003, chages Aug 2005
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: memory management related functions
  *              contains buddy page allocator from Xen.
@@ -21,16 +21,16 @@
  * 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 
+ *
+ * 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.
  */
 
@@ -59,24 +59,24 @@ extern void page_walk(unsigned long va);
  * table at offset in previous level MFN (pref_l_mfn). pt_pfn is a guest
  * PFN.
  */
-static void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn, 
+static void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn,
                          unsigned long offset, unsigned long level)
-{   
+{
     pgentry_t *tab = (pgentry_t *)start_info.pt_base;
-    unsigned long pt_page = (unsigned long)pfn_to_virt(*pt_pfn); 
+    unsigned long pt_page = (unsigned long)pfn_to_virt(*pt_pfn);
     pgentry_t prot_e, prot_t;
     mmu_update_t mmu_updates[1];
     int rc;
-    
+
     prot_e = prot_t = 0;
     DEBUG("Allocating new L%d pt frame for pfn=%lx, "
-          "prev_l_mfn=%lx, offset=%lx", 
+          "prev_l_mfn=%lx, offset=%lx",
           level, *pt_pfn, prev_l_mfn, offset);
 
     /* We need to clear the page, otherwise we might fail to map it
        as a page table page */
-    memset((void*) pt_page, 0, PAGE_SIZE);  
- 
+    memset((void*) pt_page, 0, PAGE_SIZE);
+
     switch ( level )
     {
     case L1_FRAME:
@@ -105,11 +105,11 @@ static void new_pt_frame(unsigned long *
 #endif
     tab = pte_to_virt(tab[l3_table_offset(pt_page)]);
 
-    mmu_updates[0].ptr = (tab[l2_table_offset(pt_page)] & PAGE_MASK) + 
+    mmu_updates[0].ptr = (tab[l2_table_offset(pt_page)] & PAGE_MASK) +
         sizeof(pgentry_t) * l1_table_offset(pt_page);
-    mmu_updates[0].val = (pgentry_t)pfn_to_mfn(*pt_pfn) << PAGE_SHIFT | 
+    mmu_updates[0].val = (pgentry_t)pfn_to_mfn(*pt_pfn) << PAGE_SHIFT |
         (prot_e & ~_PAGE_RW);
-    
+
     if ( (rc = HYPERVISOR_mmu_update(mmu_updates, 1, NULL, DOMID_SELF)) < 0 )
     {
         printk("ERROR: PTE for new page table page could not be updated\n");
@@ -122,7 +122,7 @@ static void new_pt_frame(unsigned long *
         ((pgentry_t)prev_l_mfn << PAGE_SHIFT) + sizeof(pgentry_t) * offset;
     mmu_updates[0].val = (pgentry_t)pfn_to_mfn(*pt_pfn) << PAGE_SHIFT | prot_t;
 
-    if ( (rc = HYPERVISOR_mmu_update(mmu_updates, 1, NULL, DOMID_SELF)) < 0 ) 
+    if ( (rc = HYPERVISOR_mmu_update(mmu_updates, 1, NULL, DOMID_SELF)) < 0 )
     {
         printk("ERROR: mmu_update failed with rc=%d\n", rc);
         do_exit();
@@ -150,38 +150,38 @@ static int need_pt_frame(unsigned long v
 #if defined(__x86_64__)
     if ( level == L3_FRAME )
     {
-        if ( l4_table_offset(va) >= 
+        if ( l4_table_offset(va) >=
              l4_table_offset(hyp_virt_start) &&
-             l4_table_offset(va) <= 
+             l4_table_offset(va) <=
              l4_table_offset(hyp_virt_end))
             return 0;
         return 1;
-    } 
+    }
     else
 #endif
 
     if ( level == L2_FRAME )
     {
 #if defined(__x86_64__)
-        if ( l4_table_offset(va) >= 
+        if ( l4_table_offset(va) >=
              l4_table_offset(hyp_virt_start) &&
-             l4_table_offset(va) <= 
+             l4_table_offset(va) <=
              l4_table_offset(hyp_virt_end))
 #endif
-            if ( l3_table_offset(va) >= 
+            if ( l3_table_offset(va) >=
                  l3_table_offset(hyp_virt_start) &&
-                 l3_table_offset(va) <= 
+                 l3_table_offset(va) <=
                  l3_table_offset(hyp_virt_end))
                 return 0;
 
         return 1;
-    } 
-    else 
+    }
+    else
         /* Always need l1 frames */
         if ( level == L1_FRAME )
             return 1;
 
-    printk("ERROR: Unknown frame level %d, hypervisor %llx,%llx\n", 
+    printk("ERROR: Unknown frame level %d, hypervisor %llx,%llx\n",
            level, hyp_virt_start, hyp_virt_end);
     return -1;
 }
@@ -200,7 +200,7 @@ static void build_pagetable(unsigned lon
     int count = 0;
     int rc;
 
-    pfn_to_map = 
+    pfn_to_map =
         (start_info.nr_pt_frames - NOT_L1_FRAMES) * L1_PAGETABLE_ENTRIES;
 
     if ( *max_pfn >= virt_to_pfn(HYPERVISOR_VIRT_START) )
@@ -211,7 +211,7 @@ static void build_pagetable(unsigned lon
                 (unsigned long)&_text)>>20);
         *max_pfn = virt_to_pfn(HYPERVISOR_VIRT_START - PAGE_SIZE);
         printk("%dMB\n",
-               ((unsigned long)pfn_to_virt(*max_pfn) - 
+               ((unsigned long)pfn_to_virt(*max_pfn) -
                 (unsigned long)&_text)>>20);
     }
 
@@ -230,7 +230,7 @@ static void build_pagetable(unsigned lon
         offset = l4_table_offset(start_address);
         /* Need new L3 pt frame */
         if ( !(start_address & L3_MASK) )
-            if ( need_pt_frame(start_address, L3_FRAME) ) 
+            if ( need_pt_frame(start_address, L3_FRAME) )
                 new_pt_frame(&pt_pfn, pt_mfn, offset, L3_FRAME);
 
         page = tab[offset];
@@ -246,7 +246,7 @@ static void build_pagetable(unsigned lon
         page = tab[offset];
         pt_mfn = pte_to_mfn(page);
         tab = to_virt(mfn_to_pfn(pt_mfn) << PAGE_SHIFT);
-        offset = l2_table_offset(start_address);        
+        offset = l2_table_offset(start_address);
         /* Need new L1 pt frame */
         if ( !(start_address & L1_MASK) )
             if ( need_pt_frame(start_address, L1_FRAME) )
@@ -258,7 +258,7 @@ static void build_pagetable(unsigned lon
 
         mmu_updates[count].ptr =
             ((pgentry_t)pt_mfn << PAGE_SHIFT) + sizeof(pgentry_t) * offset;
-        mmu_updates[count].val = 
+        mmu_updates[count].val =
             (pgentry_t)pfn_to_mfn(pfn_to_map++) << PAGE_SHIFT | L1_PROT;
         count++;
         if ( count == L1_PAGETABLE_ENTRIES || pfn_to_map == *max_pfn )
@@ -311,7 +311,7 @@ static void set_readonly(void *text, voi
         page = tab[offset];
         mfn = pte_to_mfn(page);
         tab = to_virt(mfn_to_pfn(mfn) << PAGE_SHIFT);
-        offset = l2_table_offset(start_address);        
+        offset = l2_table_offset(start_address);
         page = tab[offset];
         mfn = pte_to_mfn(page);
         tab = to_virt(mfn_to_pfn(mfn) << PAGE_SHIFT);
@@ -320,7 +320,7 @@ static void set_readonly(void *text, voi
 
         if ( start_address != (unsigned long)&shared_info )
         {
-            mmu_updates[count].ptr = 
+            mmu_updates[count].ptr =
                 ((pgentry_t)mfn << PAGE_SHIFT) + sizeof(pgentry_t) * offset;
             mmu_updates[count].val = tab[offset] & ~_PAGE_RW;
             count++;
@@ -330,7 +330,7 @@ static void set_readonly(void *text, voi
 
         start_address += PAGE_SIZE;
 
-        if ( count == L1_PAGETABLE_ENTRIES || 
+        if ( count == L1_PAGETABLE_ENTRIES ||
              start_address + PAGE_SIZE > end_address )
         {
             rc = HYPERVISOR_mmu_update(mmu_updates, count, NULL, DOMID_SELF);
@@ -356,16 +356,16 @@ static void set_readonly(void *text, voi
  * A useful mem testing function. Write the address to every address in the
  * range provided and read back the value. If verbose, print page walk to
  * some VA
- * 
+ *
  * If we get MEM_TEST_MAX_ERRORS we might as well stop
  */
-#define MEM_TEST_MAX_ERRORS 10 
+#define MEM_TEST_MAX_ERRORS 10
 int mem_test(unsigned long *start_va, unsigned long *end_va, int verbose)
 {
     unsigned long mask = 0x10000;
     unsigned long *pointer;
     int error_count = 0;
- 
+
     /* write values and print page walks */
     if ( verbose && (((unsigned long)start_va) & 0xfffff) )
     {
@@ -386,14 +386,14 @@ int mem_test(unsigned long *start_va, un
         printk("MemTest End: %lx\n", end_va-1);
         page_walk((unsigned long)end_va-1);
     }
- 
+
     /* verify values */
     for ( pointer = start_va; pointer < end_va; pointer++ )
     {
         if ( ((unsigned long)pointer & ~mask) != *pointer )
         {
             printk("Read error at 0x%lx. Read: 0x%lx, should read 0x%lx\n",
-                   (unsigned long)pointer, *pointer, 
+                   (unsigned long)pointer, *pointer,
                    ((unsigned long)pointer & ~mask));
             error_count++;
             if ( error_count >= MEM_TEST_MAX_ERRORS )
@@ -467,7 +467,7 @@ pgentry_t *need_pgt(unsigned long va)
     tab = mfn_to_virt(pt_mfn);
 #endif
     offset = l3_table_offset(va);
-    if ( !(tab[offset] & _PAGE_PRESENT) ) 
+    if ( !(tab[offset] & _PAGE_PRESENT) )
     {
         pt_pfn = virt_to_pfn(alloc_page());
         new_pt_frame(&pt_pfn, pt_mfn, offset, L2_FRAME);
@@ -516,7 +516,7 @@ void arch_init_demand_mapping_area(unsig
 
     demand_map_area_start = (unsigned long) pfn_to_virt(cur_pfn);
     cur_pfn += DEMAND_MAP_PAGES;
-    printk("Demand map pfns at %lx-%lx.\n", 
+    printk("Demand map pfns at %lx-%lx.\n",
            demand_map_area_start, pfn_to_virt(cur_pfn));
 
 #ifdef HAVE_LIBC
@@ -535,12 +535,12 @@ unsigned long allocate_ondemand(unsigned
 
     /* Find a properly aligned run of n contiguous frames */
     for ( x = 0;
-          x <= DEMAND_MAP_PAGES - n; 
+          x <= DEMAND_MAP_PAGES - n;
           x = (x + y + 1 + alignment - 1) & ~(alignment - 1) )
     {
         unsigned long addr = demand_map_area_start + x * PAGE_SIZE;
         pgentry_t *pgt = get_pgt(addr);
-        for ( y = 0; y < n; y++, addr += PAGE_SIZE ) 
+        for ( y = 0; y < n; y++, addr += PAGE_SIZE )
         {
             if ( !(addr & L1_MASK) )
                 pgt = get_pgt(addr);
@@ -568,8 +568,8 @@ unsigned long allocate_ondemand(unsigned
  */
 #define MAP_BATCH ((STACK_SIZE / 2) / sizeof(mmu_update_t))
 void do_map_frames(unsigned long va,
-                   const unsigned long *mfns, unsigned long n, 
-                   unsigned long stride, unsigned long incr, 
+                   const unsigned long *mfns, unsigned long n,
+                   unsigned long stride, unsigned long incr,
                    domid_t id, int *err, unsigned long prot)
 {
     pgentry_t *pgt = NULL;
@@ -577,7 +577,7 @@ void do_map_frames(unsigned long va,
     unsigned long i;
     int rc;
 
-    if ( !mfns ) 
+    if ( !mfns )
     {
         printk("do_map_frames: no mfns supplied\n");
         return;
@@ -602,11 +602,11 @@ void do_map_frames(unsigned long va,
         {
             mmu_update_t mmu_updates[todo];
 
-            for ( i = 0; i < todo; i++, va += PAGE_SIZE, pgt++) 
+            for ( i = 0; i < todo; i++, va += PAGE_SIZE, pgt++)
             {
                 if ( !pgt || !(va & L1_MASK) )
                     pgt = need_pgt(va);
-                
+
                 mmu_updates[i].ptr = virt_to_mach(pgt) | MMU_NORMAL_PT_UPDATE;
                 mmu_updates[i].val = ((pgentry_t)(mfns[(done + i) * stride] +
                                                   (done + i) * incr)
@@ -633,7 +633,7 @@ void do_map_frames(unsigned long va,
  * Map an array of MFNs contiguous into virtual address space. Virtual
  * addresses are allocated from the on demand area.
  */
-void *map_frames_ex(const unsigned long *mfns, unsigned long n, 
+void *map_frames_ex(const unsigned long *mfns, unsigned long n,
                     unsigned long stride, unsigned long incr,
                     unsigned long alignment,
                     domid_t id, int *err, unsigned long prot)
@@ -676,7 +676,7 @@ int unmap_frames(unsigned long va, unsig
             call[i].args[arg++] = 0;
 #ifdef __i386__
             call[i].args[arg++] = 0;
-#endif  
+#endif
             call[i].args[arg++] = UVMF_INVLPG;
 
             va += PAGE_SIZE;
@@ -691,7 +691,7 @@ int unmap_frames(unsigned long va, unsig
 
         for ( i = 0; i < n; i++ )
         {
-            if ( call[i].result ) 
+            if ( call[i].result )
             {
                 printk("update_va_mapping failed for with rc=%d.\n", ret);
                 return -(call[i].result);
@@ -705,12 +705,12 @@ int unmap_frames(unsigned long va, unsig
 /*
  * Allocate pages which are contiguous in machine memory.
  * Returns a VA to where they are mapped or 0 on failure.
- * 
+ *
  * addr_bits indicates if the region has restrictions on where it is
  * located. Typical values are 32 (if for example PCI devices can't access
  * 64bit memory) or 0 for no restrictions.
  *
- * Allocated pages can be freed using the page allocators free_pages() 
+ * Allocated pages can be freed using the page allocators free_pages()
  * function.
  *
  * based on Linux function xen_create_contiguous_region()
@@ -778,7 +778,7 @@ unsigned long alloc_contig_pages(int ord
         call[i].args[arg++] = 0;
 #ifdef __i386__
         call[i].args[arg++] = 0;
-#endif  
+#endif
         call[i].args[arg++] = UVMF_INVLPG;
     }
 
@@ -793,10 +793,10 @@ unsigned long alloc_contig_pages(int ord
     out_frames = virt_to_pfn(in_va); /* PFNs to populate */
     ret = HYPERVISOR_memory_op(XENMEM_exchange, &exchange);
     if ( ret ) {
-        printk("mem exchanged order=0x%x failed with rc=%d, nr_exchanged=%d\n", 
+        printk("mem exchanged order=0x%x failed with rc=%d, nr_exchanged=%d\n",
                order, ret, exchange.nr_exchanged);
         /* we still need to return the allocated pages above to the pool
-         * ie. map them back into the 1:1 mapping etc. so we continue but 
+         * ie. map them back into the 1:1 mapping etc. so we continue but
          * in the end return the pages to the page allocator and return 0. */
         exch_success = 0;
     }
@@ -824,7 +824,7 @@ unsigned long alloc_contig_pages(int ord
 #else
         call[i].args[arg++] = pte.pte_low;
         call[i].args[arg++] = pte.pte_high;
-#endif  
+#endif
         call[i].args[arg++] = UVMF_INVLPG;
     }
     ret = HYPERVISOR_multicall(call, i);
@@ -840,7 +840,7 @@ unsigned long alloc_contig_pages(int ord
         free_pages((void *) in_va, order);
         return 0;
     }
-    
+
     return in_va;
 }
 
@@ -863,24 +863,24 @@ void arch_init_p2m(unsigned long max_pfn
 {
 #ifdef __x86_64__
 #define L1_P2M_SHIFT    9
-#define L2_P2M_SHIFT    18    
-#define L3_P2M_SHIFT    27    
+#define L2_P2M_SHIFT    18
+#define L3_P2M_SHIFT    27
 #else
 #define L1_P2M_SHIFT    10
-#define L2_P2M_SHIFT    20    
-#define L3_P2M_SHIFT    30    
+#define L2_P2M_SHIFT    20
+#define L3_P2M_SHIFT    30
 #endif
-#define L1_P2M_ENTRIES  (1 << L1_P2M_SHIFT)    
-#define L2_P2M_ENTRIES  (1 << (L2_P2M_SHIFT - L1_P2M_SHIFT))    
-#define L3_P2M_ENTRIES  (1 << (L3_P2M_SHIFT - L2_P2M_SHIFT))    
-#define L1_P2M_MASK     (L1_P2M_ENTRIES - 1)    
-#define L2_P2M_MASK     (L2_P2M_ENTRIES - 1)    
-#define L3_P2M_MASK     (L3_P2M_ENTRIES - 1)    
-    
+#define L1_P2M_ENTRIES  (1 << L1_P2M_SHIFT)
+#define L2_P2M_ENTRIES  (1 << (L2_P2M_SHIFT - L1_P2M_SHIFT))
+#define L3_P2M_ENTRIES  (1 << (L3_P2M_SHIFT - L2_P2M_SHIFT))
+#define L1_P2M_MASK     (L1_P2M_ENTRIES - 1)
+#define L2_P2M_MASK     (L2_P2M_ENTRIES - 1)
+#define L3_P2M_MASK     (L3_P2M_ENTRIES - 1)
+
     unsigned long *l1_list = NULL, *l2_list = NULL, *l3_list;
     unsigned long pfn;
-    
-    l3_list = (unsigned long *)alloc_page(); 
+
+    l3_list = (unsigned long *)alloc_page();
     for ( pfn=0; pfn<max_pfn; pfn++ )
     {
         if ( !(pfn % (L1_P2M_ENTRIES * L2_P2M_ENTRIES)) )
@@ -891,18 +891,18 @@ void arch_init_p2m(unsigned long max_pfn
                 printk("Error: Too many pfns.\n");
                 do_exit();
             }
-            l3_list[(pfn >> L2_P2M_SHIFT)] = virt_to_mfn(l2_list);  
+            l3_list[(pfn >> L2_P2M_SHIFT)] = virt_to_mfn(l2_list);
         }
         if ( !(pfn % (L1_P2M_ENTRIES)) )
         {
             l1_list = (unsigned long*)alloc_page();
-            l2_list[(pfn >> L1_P2M_SHIFT) & L2_P2M_MASK] = 
-                virt_to_mfn(l1_list); 
+            l2_list[(pfn >> L1_P2M_SHIFT) & L2_P2M_MASK] =
+                virt_to_mfn(l1_list);
         }
 
-        l1_list[pfn & L1_P2M_MASK] = pfn_to_mfn(pfn); 
+        l1_list[pfn & L1_P2M_MASK] = pfn_to_mfn(pfn);
     }
-    HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list = 
+    HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list =
         virt_to_mfn(l3_list);
     HYPERVISOR_shared_info->arch.max_pfn = max_pfn;
 }
@@ -919,7 +919,7 @@ void arch_init_mm(unsigned long* start_p
     printk("       _end: %p(VA)\n", &_end);
 
     /* First page follows page table pages and 3 more pages (store page etc) */
-    start_pfn = PFN_UP(to_phys(start_info.pt_base)) + 
+    start_pfn = PFN_UP(to_phys(start_info.pt_base)) +
         start_info.nr_pt_frames + 3;
     max_pfn = start_info.nr_pages;
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/arch/x86/sched.c
--- a/extras/mini-os/arch/x86/sched.c
+++ b/extras/mini-os/arch/x86/sched.c
@@ -1,4 +1,4 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2005 - Grzegorz Milos - Intel Research Cambridge
  ****************************************************************************
@@ -6,13 +6,13 @@
  *        File: sched.c
  *      Author: Grzegorz Milos
  *     Changes: Robert Kaiser
- *              
+ *
  *        Date: Aug 2005
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: simple scheduler for Mini-Os
  *
- * The scheduler is non-preemptive (cooperative), and schedules according 
+ * The scheduler is non-preemptive (cooperative), and schedules according
  * to Round Robin algorithm.
  *
  ****************************************************************************
@@ -22,16 +22,16 @@
  * 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 
+ *
+ * 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.
  */
 
@@ -57,12 +57,12 @@
 
 void dump_stack(struct thread *thread)
 {
-    unsigned long *bottom = (unsigned long *)(thread->stack + STACK_SIZE); 
+    unsigned long *bottom = (unsigned long *)(thread->stack + STACK_SIZE);
     unsigned long *pointer = (unsigned long *)thread->sp;
     int count;
     if(thread == current)
     {
-#ifdef __i386__    
+#ifdef __i386__
         asm("movl %%esp,%0"
             : "=r"(pointer));
 #else
@@ -76,11 +76,11 @@ void dump_stack(struct thread *thread)
         printk("[0x%lx] 0x%lx\n", pointer, *pointer);
         pointer++;
     }
-    
+
     if(pointer < bottom) printk(" ... continues.\n");
 }
 
-/* Gets run when a new thread is scheduled the first time ever, 
+/* Gets run when a new thread is scheduled the first time ever,
    defined in x86_[32/64].S */
 extern void thread_starter(void);
 
@@ -96,18 +96,18 @@ struct thread* arch_create_thread(char *
                                   void *data)
 {
     struct thread *thread;
-    
+
     thread = xmalloc(struct thread);
     /* We can't use lazy allocation here since the trap handler runs on the stack */
     thread->stack = (char *)alloc_pages(STACK_SIZE_PAGE_ORDER);
     thread->name = name;
-    printk("Thread \"%s\": pointer: 0x%lx, stack: 0x%lx\n", name, thread, 
+    printk("Thread \"%s\": pointer: 0x%lx, stack: 0x%lx\n", name, thread,
             thread->stack);
-    
+
     thread->sp = (unsigned long)thread->stack + STACK_SIZE;
     /* Save pointer to the thread on the stack, used by current macro */
     *((unsigned long *)thread->stack) = (unsigned long)thread;
-    
+
     stack_push(thread, (unsigned long) function);
     stack_push(thread, (unsigned long) data);
     thread->ip = (unsigned long) thread_starter;
@@ -116,19 +116,19 @@ struct thread* arch_create_thread(char *
 
 void run_idle_thread(void)
 {
-    /* Switch stacks and run the thread */ 
+    /* Switch stacks and run the thread */
 #if defined(__i386__)
     __asm__ __volatile__("mov %0,%%esp\n\t"
-                         "push %1\n\t" 
-                         "ret"                                            
+                         "push %1\n\t"
+                         "ret"
                          :"=m" (idle_thread->sp)
-                         :"m" (idle_thread->ip));                          
+                         :"m" (idle_thread->ip));
 #elif defined(__x86_64__)
     __asm__ __volatile__("mov %0,%%rsp\n\t"
-                         "push %1\n\t" 
-                         "ret"                                            
+                         "push %1\n\t"
+                         "ret"
                          :"=m" (idle_thread->sp)
-                         :"m" (idle_thread->ip));                                                    
+                         :"m" (idle_thread->ip));
 #endif
 }
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/arch/x86/setup.c
--- a/extras/mini-os/arch/x86/setup.c
+++ b/extras/mini-os/arch/x86/setup.c
@@ -1,27 +1,27 @@
 /******************************************************************************
  * common.c
- * 
+ *
  * Common stuff special to x86 goes here.
- * 
+ *
  * Copyright (c) 2002-2003, K A Fraser & R Neugebauer
  * Copyright (c) 2005, Grzegorz Milos, Intel Research Cambridge
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (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 
+ *
+ * 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.
  *
  */
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/arch/x86/time.c
--- a/extras/mini-os/arch/x86/time.c
+++ b/extras/mini-os/arch/x86/time.c
@@ -1,7 +1,7 @@
 /* -*-  Mode:C; c-basic-offset:4; tab-width:4 -*-
  ****************************************************************************
  * (C) 2003 - Rolf Neugebauer - Intel Research Cambridge
- * (C) 2002-2003 - Keir Fraser - University of Cambridge 
+ * (C) 2002-2003 - Keir Fraser - University of Cambridge
  * (C) 2005 - Grzegorz Milos - Intel Research Cambridge
  * (C) 2006 - Robert Kaiser - FH Wiesbaden
  ****************************************************************************
@@ -18,16 +18,16 @@
  * 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 
+ *
+ * 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.
  */
 
@@ -74,7 +74,7 @@ static struct shadow_time_info shadow;
 
 static inline int time_values_up_to_date(void)
 {
-	struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time; 
+	struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time;
 
 	return (shadow.version == src->version);
 }
@@ -187,8 +187,8 @@ int gettimeofday(struct timeval *tv, voi
 {
     uint64_t nsec = monotonic_clock();
     nsec += shadow_ts.tv_nsec;
-    
-    
+
+
     tv->tv_sec = shadow_ts.tv_sec;
     tv->tv_sec += NSEC_TO_SEC(nsec);
     tv->tv_usec = NSEC_TO_USEC(nsec % 1000000000UL);
@@ -212,7 +212,7 @@ void block_domain(s_time_t until)
 
 
 /*
- * Just a dummy 
+ * Just a dummy
  */
 static void timer_handler(evtchn_port_t ev, struct pt_regs *regs, void *ign)
 {
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/arch/x86/traps.c
--- a/extras/mini-os/arch/x86/traps.c
+++ b/extras/mini-os/arch/x86/traps.c
@@ -33,7 +33,7 @@ void machine_check(void);
 void dump_regs(struct pt_regs *regs)
 {
     printk("Thread: %s\n", current->name);
-#ifdef __i386__    
+#ifdef __i386__
     printk("EIP: %x, EFLAGS %x.\n", regs->eip, regs->eflags);
     printk("EBX: %08x ECX: %08x EDX: %08x\n",
 	   regs->ebx, regs->ecx, regs->edx);
@@ -45,18 +45,18 @@ void dump_regs(struct pt_regs *regs)
 	   regs->xcs, regs->eflags, regs->esp, regs->xss);
 #else
     printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->rip);
-    printk("\nRSP: %04lx:%016lx  EFLAGS: %08lx\n", 
+    printk("\nRSP: %04lx:%016lx  EFLAGS: %08lx\n",
            regs->ss, regs->rsp, regs->eflags);
     printk("RAX: %016lx RBX: %016lx RCX: %016lx\n",
            regs->rax, regs->rbx, regs->rcx);
     printk("RDX: %016lx RSI: %016lx RDI: %016lx\n",
-           regs->rdx, regs->rsi, regs->rdi); 
+           regs->rdx, regs->rsi, regs->rdi);
     printk("RBP: %016lx R08: %016lx R09: %016lx\n",
-           regs->rbp, regs->r8, regs->r9); 
+           regs->rbp, regs->r8, regs->r9);
     printk("R10: %016lx R11: %016lx R12: %016lx\n",
-           regs->r10, regs->r11, regs->r12); 
+           regs->r10, regs->r11, regs->r12);
     printk("R13: %016lx R14: %016lx R15: %016lx\n",
-           regs->r13, regs->r14, regs->r15); 
+           regs->r13, regs->r14, regs->r15);
 #endif
 }
 
@@ -98,7 +98,7 @@ void page_walk(unsigned long virt_addres
         pgentry_t *tab = (pgentry_t *)start_info.pt_base, page;
         unsigned long addr = virt_address;
         printk("Pagetable walk from virt %lx, base %lx:\n", virt_address, start_info.pt_base);
-    
+
 #if defined(__x86_64__)
         page = tab[l4_table_offset(addr)];
         tab = pte_to_virt(page);
@@ -110,7 +110,7 @@ void page_walk(unsigned long virt_addres
         page = tab[l2_table_offset(addr)];
         tab = pte_to_virt(page);
         printk("   L2 = %"PRIpte" (%p)  [offset = %lx]\n", page, tab, l2_table_offset(addr));
-        
+
         page = tab[l1_table_offset(addr)];
         printk("    L1 = %"PRIpte" [offset = %lx]\n", page, l1_table_offset(addr));
 
@@ -136,7 +136,7 @@ static int handle_cow(unsigned long addr
 	if (!(page & _PAGE_PRESENT))
 	    return 0;
         tab = pte_to_virt(page);
-        
+
         page = tab[l1_table_offset(addr)];
 	if (!(page & _PAGE_PRESENT))
 	    return 0;
@@ -204,10 +204,10 @@ void do_page_fault(struct pt_regs *regs,
 
     /* If we are already handling a page fault, and got another one
        that means we faulted in pagetable walk. Continuing here would cause
-       a recursive fault */       
-    if(handling_pg_fault == 1) 
+       a recursive fault */
+    if(handling_pg_fault == 1)
     {
-        printk("Page fault in pagetable walk (access to invalid memory?).\n"); 
+        printk("Page fault in pagetable walk (access to invalid memory?).\n");
         HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
     }
     handling_pg_fault++;
@@ -244,7 +244,7 @@ void do_general_protection(struct pt_reg
     struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_crash };
 #ifdef __i386__
     printk("GPF eip: %p, error_code=%lx\n", regs->eip, error_code);
-#else    
+#else
     printk("GPF rip: %p, error_code=%lx\n", regs->rip, error_code);
 #endif
     dump_regs(regs);
@@ -319,12 +319,12 @@ static trap_info_t trap_table[] = {
     { 19, 0, __KERNEL_CS, (unsigned long)simd_coprocessor_error      },
     {  0, 0,           0, 0                           }
 };
-    
+
 
 
 void trap_init(void)
 {
-    HYPERVISOR_set_trap_table(trap_table);    
+    HYPERVISOR_set_trap_table(trap_table);
 }
 
 void trap_fini(void)
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/arch/x86/x86_32.S
--- a/extras/mini-os/arch/x86/x86_32.S
+++ b/extras/mini-os/arch/x86/x86_32.S
@@ -14,12 +14,12 @@
 .text
 
 .globl _start, shared_info, hypercall_page
-                        
+
 _start:
         cld
         lss stack_start,%esp
         andl $(~(__STACK_SIZE-1)), %esp
-        push %esi 
+        push %esi
         call start_kernel
 
 stack_start:
@@ -67,7 +67,7 @@ CS		= 0x2C
 	popl %ds;	\
 	popl %es;	\
 	addl $4,%esp;	\
-	iret;		
+	iret;
 
 ENTRY(divide_error)
 	pushl $0		# no error code
@@ -97,7 +97,7 @@ do_exception:
     pushl %eax
 	call *%edi
     jmp ret_from_exception
-    
+
 ret_from_exception:
     movb CS(%esp),%cl
     addl $8,%esp
@@ -145,7 +145,7 @@ ecrit:  /**** END OF CRITICAL REGION ***
 # registers are in each frame. We do this quickly using the lookup table
 # 'critical_fixup_table'. For each byte offset in the critical region, it
 # provides the number of bytes which have already been popped from the
-# interrupted stack frame. 
+# interrupted stack frame.
 critical_region_fixup:
         addl $critical_fixup_table-scrit,%eax
         movzbl (%eax),%eax    # %eax contains num bytes popped
@@ -163,8 +163,8 @@ 15:     subl $4,%esi          # pre-decr
         loop 15b
 16:     movl %edi,%esp        # final %edi is top of merged stack
         jmp  11b
-         
-critical_fixup_table:        
+
+critical_fixup_table:
         .byte 0x00,0x00,0x00                  # testb $0xff,(%esi)
         .byte 0x00,0x00                       # jne  14f
         .byte 0x00                            # pop  %ebx
@@ -180,7 +180,7 @@ critical_fixup_table:
         .byte 0x28                            # iret
         .byte 0x00,0x00,0x00,0x00             # movb $1,1(%esi)
         .byte 0x00,0x00                       # jmp  11b
-       
+
 # Hypervisor uses this for application faults while it executes.
 ENTRY(failsafe_callback)
       pop  %ds
@@ -188,7 +188,7 @@ ENTRY(failsafe_callback)
       pop  %fs
       pop  %gs
       iret
-                
+
 ENTRY(coprocessor_error)
 	pushl $0
 	pushl $do_coprocessor_error
@@ -262,7 +262,7 @@ ENTRY(alignment_check)
 ENTRY(page_fault)
     pushl $do_page_fault
     jmp do_exception
-    
+
 ENTRY(machine_check)
 	pushl $0
 	pushl $do_machine_check
@@ -283,8 +283,8 @@ ENTRY(thread_starter)
     xorl %ebp,%ebp
     pushl %eax
     call *%ebx
-    call exit_thread 
-    
+    call exit_thread
+
 ENTRY(__arch_switch_threads)
     movl 4(%esp), %ecx		/* prev */
     movl 8(%esp), %edx		/* next */
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/arch/x86/x86_64.S
--- a/extras/mini-os/arch/x86/x86_64.S
+++ b/extras/mini-os/arch/x86/x86_64.S
@@ -36,14 +36,14 @@ hypercall_page:
         .org 0x3000
 
 
-/* Offsets into shared_info_t. */                
+/* Offsets into shared_info_t. */
 #define evtchn_upcall_pending		/* 0 */
 #define evtchn_upcall_mask		1
 
 NMI_MASK = 0x80000000
 
 #define RDI 112
-#define ORIG_RAX 120       /* + error_code */ 
+#define ORIG_RAX 120       /* + error_code */
 #define EFLAGS 144
 
 .macro RESTORE_ALL
@@ -57,7 +57,7 @@ NMI_MASK = 0x80000000
 	movq 7*8(%rsp),%rsi
 	movq 8*8(%rsp),%rdi
 	addq $9*8+8,%rsp
-.endm	
+.endm
 
 
 .macro HYPERVISOR_IRET flag
@@ -80,32 +80,32 @@ 2:	/* Slow iret via hypervisor. */
 
 /*
  * Exception entry point. This expects an error code/orig_rax on the stack
- * and the exception handler in %rax.	
- */ 		  				
+ * and the exception handler in %rax.
+ */
 ENTRY(error_entry)
 	/* rdi slot contains rax, oldrax contains error code */
-	cld	
+	cld
 	subq  $14*8,%rsp
 	movq %rsi,13*8(%rsp)
 	movq 14*8(%rsp),%rsi	/* load rax from rdi slot */
 	movq %rdx,12*8(%rsp)
 	movq %rcx,11*8(%rsp)
-	movq %rsi,10*8(%rsp)	/* store rax */ 
+	movq %rsi,10*8(%rsp)	/* store rax */
 	movq %r8, 9*8(%rsp)
 	movq %r9, 8*8(%rsp)
 	movq %r10,7*8(%rsp)
 	movq %r11,6*8(%rsp)
-	movq %rbx,5*8(%rsp) 
-	movq %rbp,4*8(%rsp) 
-	movq %r12,3*8(%rsp) 
-	movq %r13,2*8(%rsp) 
-	movq %r14,1*8(%rsp) 
-	movq %r15,(%rsp) 
+	movq %rbx,5*8(%rsp)
+	movq %rbp,4*8(%rsp)
+	movq %r12,3*8(%rsp)
+	movq %r13,2*8(%rsp)
+	movq %r14,1*8(%rsp)
+	movq %r15,(%rsp)
 
 error_call_handler:
-	movq %rdi, RDI(%rsp)            
+	movq %rdi, RDI(%rsp)
 	movq %rsp,%rdi
-	movq ORIG_RAX(%rsp),%rsi	# get error code 
+	movq ORIG_RAX(%rsp),%rsi	# get error code
 	movq $-1,ORIG_RAX(%rsp)
 	call *%rax
 	jmp error_exit
@@ -114,11 +114,11 @@ error_call_handler:
     movq (%rsp),%rcx
     movq 8(%rsp),%r11
     addq $0x10,%rsp /* skip rcx and r11 */
-	pushq $0	/* push error code/oldrax */ 
-	pushq %rax	/* push real oldrax to the rdi slot */ 
+	pushq $0	/* push error code/oldrax */
+	pushq %rax	/* push real oldrax to the rdi slot */
 	leaq  \sym(%rip),%rax
 	jmp error_entry
-.endm	
+.endm
 
 .macro errorentry sym
         movq (%rsp),%rcx
@@ -150,17 +150,17 @@ ENTRY(hypervisor_callback)
     zeroentry hypervisor_callback2
 
 ENTRY(hypervisor_callback2)
-        movq %rdi, %rsp 
+        movq %rdi, %rsp
 11:     movq %gs:8,%rax
         incl %gs:0
         cmovzq %rax,%rsp
         pushq %rdi
-        call do_hypervisor_callback 
+        call do_hypervisor_callback
         popq %rsp
         decl %gs:0
         jmp error_exit
 
-restore_all_enable_events:  
+restore_all_enable_events:
 	XEN_UNBLOCK_EVENTS(%rsi)        # %rsi is already set up...
 
 scrit:	/**** START OF CRITICAL REGION ****/
@@ -169,16 +169,16 @@ scrit:	/**** START OF CRITICAL REGION **
 	XEN_PUT_VCPU_INFO(%rsi)
         RESTORE_ALL
         HYPERVISOR_IRET 0
-        
+
 14:	XEN_LOCKED_BLOCK_EVENTS(%rsi)
 	XEN_PUT_VCPU_INFO(%rsi)
 	subq $6*8,%rsp
-	movq %rbx,5*8(%rsp) 
-	movq %rbp,4*8(%rsp) 
-	movq %r12,3*8(%rsp) 
-	movq %r13,2*8(%rsp) 
-	movq %r14,1*8(%rsp) 
-	movq %r15,(%rsp) 
+	movq %rbx,5*8(%rsp)
+	movq %rbp,4*8(%rsp)
+	movq %r12,3*8(%rsp)
+	movq %r13,2*8(%rsp)
+	movq %r14,1*8(%rsp)
+	movq %r15,(%rsp)
         movq %rsp,%rdi                  # set the argument again
 	jmp  11b
 ecrit:  /**** END OF CRITICAL REGION ****/
@@ -193,12 +193,12 @@ retint_restore_args:
 	andb $1,%al			# EAX[0] == IRET_EFLAGS.IF & event_mask
 	jnz restore_all_enable_events	#        != 0 => enable event delivery
 	XEN_PUT_VCPU_INFO(%rsi)
-		
+
 	RESTORE_ALL
 	HYPERVISOR_IRET 0
 
 
-error_exit:		
+error_exit:
 	movq (%rsp),%r15
 	movq 1*8(%rsp),%r14
 	movq 2*8(%rsp),%r13
@@ -206,7 +206,7 @@ error_exit:
 	movq 4*8(%rsp),%rbp
 	movq 5*8(%rsp),%rbx
 	addq $6*8,%rsp
-	XEN_BLOCK_EVENTS(%rsi)		
+	XEN_BLOCK_EVENTS(%rsi)
 	jmp retint_kernel
 
 
@@ -242,8 +242,8 @@ ENTRY(overflow)
 
 ENTRY(bounds)
         zeroentry do_bounds
-    
-    
+
+
 ENTRY(invalid_op)
         zeroentry do_invalid_op
 
@@ -263,7 +263,7 @@ ENTRY(segment_not_present)
 /* runs on exception stack */
 ENTRY(stack_segment)
         errorentry do_stack_segment
-                    
+
 
 ENTRY(general_protection)
         errorentry do_general_protection
@@ -279,7 +279,7 @@ ENTRY(divide_error)
 
 ENTRY(spurious_interrupt_bug)
         zeroentry do_spurious_interrupt_bug
-            
+
 
 ENTRY(page_fault)
         errorentry do_page_fault
@@ -294,8 +294,8 @@ ENTRY(thread_starter)
         pushq $0
         xorq %rbp,%rbp
         call *%rbx
-        call exit_thread 
-        
+        call exit_thread
+
 
 ENTRY(__arch_switch_threads)
 	pushq %rbp
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/blkfront.c
--- a/extras/mini-os/blkfront.c
+++ b/extras/mini-os/blkfront.c
@@ -1,4 +1,4 @@
-/* Minimal block driver for Mini-OS. 
+/* Minimal block driver for Mini-OS.
  * Copyright (c) 2007-2008 Samuel Thibault.
  * Based on netfront.c.
  */
@@ -111,7 +111,7 @@ struct blkfront_dev *init_blkfront(char 
 #endif
 
     snprintf(path, sizeof(path), "%s/backend-id", nodename);
-    dev->dom = xenbus_read_integer(path); 
+    dev->dom = xenbus_read_integer(path);
     evtchn_alloc_unbound(dev->dom, blkfront_handler, dev, &dev->evtchn);
 
     s = (struct blkif_sring*) alloc_page();
@@ -587,7 +587,7 @@ int blkfront_posix_rwop(int fd, uint8_t*
    /* Write mode checks */
    if(write) {
       /*Make sure we have write permission */
-      if(dev->info.info & VDISK_READONLY 
+      if(dev->info.info & VDISK_READONLY
             || (dev->info.mode != O_RDWR  && dev->info.mode !=  O_WRONLY)) {
          errno = EACCES;
          return -1;
@@ -651,7 +651,7 @@ int blkfront_posix_rwop(int fd, uint8_t*
          }
 
          /* For an aligned R/W we can read up to the maximum transfer size */
-         bytes = count > (BLKIF_MAX_SEGMENTS_PER_REQUEST-not_page_aligned)*PAGE_SIZE 
+         bytes = count > (BLKIF_MAX_SEGMENTS_PER_REQUEST-not_page_aligned)*PAGE_SIZE
             ? (BLKIF_MAX_SEGMENTS_PER_REQUEST-not_page_aligned)*PAGE_SIZE
             : count & ~(blocksize -1);
          aiocb.aio_nbytes = bytes;
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/console/console.c
--- a/extras/mini-os/console/console.c
+++ b/extras/mini-os/console/console.c
@@ -1,14 +1,14 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2006 - Grzegorz Milos - Cambridge University
  ****************************************************************************
  *
  *        File: console.h
  *      Author: Grzegorz Milos
- *     Changes: 
- *              
+ *     Changes:
+ *
  *        Date: Mar 2006
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Console interface.
  *
@@ -21,19 +21,19 @@
  * 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 
+ *
+ * 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.
  */
- 
+
 #include <mini-os/types.h>
 #include <mini-os/wait.h>
 #include <mini-os/mm.h>
@@ -50,7 +50,7 @@
 #define USE_XEN_CONSOLE
 
 
-/* If console not initialised the printk will be sent to xen serial line 
+/* If console not initialised the printk will be sent to xen serial line
    NOTE: you need to enable verbose in xen/Rules.mk for it to work. */
 static int console_initialised = 0;
 
@@ -61,7 +61,7 @@ static int console_initialised = 0;
         /* Just repeat what's written */
         buf[len] = '\0';
         printk("%s", buf);
-        
+
         if(buf[len-1] == '\r')
             printk("\nNo console input handler.\n");
     }
@@ -115,16 +115,16 @@ void console_print(struct consfront_dev 
         copied_ptr[length] = '\n';
         length++;
     }
-    
+
     ring_send_fn(dev, copied_ptr, length);
 }
 
 void print(int direct, const char *fmt, va_list args)
 {
     static char   buf[1024];
-    
+
     (void)vsnprintf(buf, sizeof(buf), fmt, args);
- 
+
     if(direct)
     {
         (void)HYPERVISOR_console_io(CONSOLEIO_write, strlen(buf), buf);
@@ -132,9 +132,9 @@ void print(int direct, const char *fmt, 
     } else {
 #ifndef USE_XEN_CONSOLE
     if(!console_initialised)
-#endif    
+#endif
             (void)HYPERVISOR_console_io(CONSOLEIO_write, strlen(buf), buf);
-        
+
         console_print(NULL, buf, strlen(buf));
     }
 }
@@ -144,7 +144,7 @@ void printk(const char *fmt, ...)
     va_list       args;
     va_start(args, fmt);
     print(0, fmt, args);
-    va_end(args);        
+    va_end(args);
 }
 
 void xprintk(const char *fmt, ...)
@@ -152,12 +152,12 @@ void xprintk(const char *fmt, ...)
     va_list       args;
     va_start(args, fmt);
     print(1, fmt, args);
-    va_end(args);        
+    va_end(args);
 }
 void init_console(void)
-{   
+{
     printk("Initialising console ... ");
-    xencons_ring_init();    
+    xencons_ring_init();
     console_initialised = 1;
     /* This is also required to notify the daemon */
     printk("done.\n");
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/console/xenbus.c
--- a/extras/mini-os/console/xenbus.c
+++ b/extras/mini-os/console/xenbus.c
@@ -84,7 +84,7 @@ struct consfront_dev *init_consfront(cha
 #endif
 
     snprintf(path, sizeof(path), "%s/backend-id", nodename);
-    if ((res = xenbus_read_integer(path)) < 0) 
+    if ((res = xenbus_read_integer(path)) < 0)
         return NULL;
     else
         dev->dom = res;
@@ -166,7 +166,7 @@ done:
         XenbusState state;
         char path[strlen(dev->backend) + 1 + 19 + 1];
         snprintf(path, sizeof(path), "%s/state", dev->backend);
-        
+
 	xenbus_watch_path_token(XBT_NIL, path, path, &dev->events);
         msg = NULL;
         state = xenbus_read_integer(path);
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/console/xencons_ring.c
--- a/extras/mini-os/console/xencons_ring.c
+++ b/extras/mini-os/console/xencons_ring.c
@@ -30,10 +30,10 @@ static inline struct xencons_interface *
         return mfn_to_virt(start_info.console.domU.mfn);
     else
         return NULL;
-} 
- 
+}
+
 int xencons_ring_send_no_notify(struct consfront_dev *dev, const char *data, unsigned len)
-{	
+{
     int sent = 0;
 	struct xencons_interface *intf;
 	XENCONS_RING_IDX cons, prod;
@@ -55,7 +55,7 @@ int xencons_ring_send_no_notify(struct c
 
 	wmb();
 	intf->out_prod = prod;
-    
+
     return sent;
 }
 
@@ -67,7 +67,7 @@ int xencons_ring_send(struct consfront_d
     notify_daemon(dev);
 
     return sent;
-}	
+}
 
 
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/events.c
--- a/extras/mini-os/events.c
+++ b/extras/mini-os/events.c
@@ -7,9 +7,9 @@
  *        File: events.c
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
  *     Changes: Grzegorz Milos (gm281@cam.ac.uk)
- *              
+ *
  *        Date: Jul 2003, changes Jun 2005
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Deals with events recieved on event channels
  *
@@ -125,7 +125,7 @@ void unbind_evtchn(evtchn_port_t port )
 	rc = HYPERVISOR_event_channel_op(EVTCHNOP_close, &close);
     if ( rc )
         printk("WARN: close_port %s failed rc=%d. ignored\n", port, rc);
-        
+
 }
 
 evtchn_port_t bind_virq(uint32_t virq, evtchn_handler_t handler, void *data)
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/fbfront.c
--- a/extras/mini-os/fbfront.c
+++ b/extras/mini-os/fbfront.c
@@ -1,5 +1,5 @@
 /*
- * Frame Buffer + Keyboard driver for Mini-OS. 
+ * Frame Buffer + Keyboard driver for Mini-OS.
  * Samuel Thibault <samuel.thibault@eu.citrix.com>, 2008
  * Based on blkfront.c.
  */
@@ -87,7 +87,7 @@ struct kbdfront_dev *init_kbdfront(char 
 #endif
 
     snprintf(path, sizeof(path), "%s/backend-id", nodename);
-    dev->dom = xenbus_read_integer(path); 
+    dev->dom = xenbus_read_integer(path);
     evtchn_alloc_unbound(dev->dom, kbdfront_handler, dev, &dev->evtchn);
 
     dev->page = s = (struct xenkbd_page*) alloc_page();
@@ -425,7 +425,7 @@ struct fbfront_dev *init_fbfront(char *_
 #endif
 
     snprintf(path, sizeof(path), "%s/backend-id", nodename);
-    dev->dom = xenbus_read_integer(path); 
+    dev->dom = xenbus_read_integer(path);
     evtchn_alloc_unbound(dev->dom, fbfront_handler, dev, &dev->evtchn);
 
     dev->page = s = (struct xenfb_page*) alloc_page();
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/gntmap.c
--- a/extras/mini-os/gntmap.c
+++ b/extras/mini-os/gntmap.c
@@ -21,12 +21,12 @@
  * 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 
+ * 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.
  */
 
@@ -100,7 +100,7 @@ gntmap_set_max_grants(struct gntmap *map
 }
 
 static int
-_gntmap_map_grant_ref(struct gntmap_entry *entry, 
+_gntmap_map_grant_ref(struct gntmap_entry *entry,
                       unsigned long host_addr,
                       uint32_t domid,
                       uint32_t ref,
@@ -178,7 +178,7 @@ gntmap_munmap(struct gntmap *map, unsign
 }
 
 void*
-gntmap_map_grant_refs(struct gntmap *map, 
+gntmap_map_grant_refs(struct gntmap *map,
                       uint32_t count,
                       uint32_t *domids,
                       int domids_stride,
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/gnttab.c
--- a/extras/mini-os/gnttab.c
+++ b/extras/mini-os/gnttab.c
@@ -1,14 +1,14 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2006 - Cambridge University
  ****************************************************************************
  *
  *        File: gnttab.c
- *      Author: Steven Smith (sos22@cam.ac.uk) 
+ *      Author: Steven Smith (sos22@cam.ac.uk)
  *     Changes: Grzegorz Milos (gm281@cam.ac.uk)
- *              
+ *
  *        Date: July 2006
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Simple grant tables implementation. About as stupid as it's
  *  possible to be and still work.
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/hypervisor.c
--- a/extras/mini-os/hypervisor.c
+++ b/extras/mini-os/hypervisor.c
@@ -1,27 +1,27 @@
 /******************************************************************************
  * hypervisor.c
- * 
+ *
  * Communication to/from hypervisor.
- * 
+ *
  * Copyright (c) 2002-2003, K A Fraser
  * Copyright (c) 2005, Grzegorz Milos, gm281@cam.ac.uk,Intel Research Cambridge
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (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 
+ *
+ * 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.
  */
 
@@ -45,7 +45,7 @@ void do_hypervisor_callback(struct pt_re
     vcpu_info_t   *vcpu_info = &s->vcpu_info[cpu];
 
     in_callback = 1;
-   
+
     vcpu_info->evtchn_upcall_pending = 0;
     /* NB x86. No need for a barrier here -- XCHG is a barrier on x86. */
 #if !defined(__i386__) && !defined(__x86_64__)
@@ -57,7 +57,7 @@ void do_hypervisor_callback(struct pt_re
     {
         l1i = __ffs(l1);
         l1 &= ~(1UL << l1i);
-        
+
         while ( (l2 = active_evtchns(cpu, s, l1i)) != 0 )
         {
             l2i = __ffs(l2);
@@ -105,7 +105,7 @@ inline void unmask_evtchn(uint32_t port)
      * The following is basically the equivalent of 'hw_resend_irq'. Just like
      * a real IO-APIC we 'lose the interrupt edge' if the channel is masked.
      */
-    if (  synch_test_bit        (port,    &s->evtchn_pending[0]) && 
+    if (  synch_test_bit        (port,    &s->evtchn_pending[0]) &&
          !synch_test_and_set_bit(port / (sizeof(unsigned long) * 8),
               &vcpu_info->evtchn_pending_sel) )
     {
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/arch/cc.h
--- a/extras/mini-os/include/arch/cc.h
+++ b/extras/mini-os/include/arch/cc.h
@@ -1,7 +1,7 @@
-/* 
+/*
  * lwip/arch/cc.h
  *
- * Compiler-specific types and macros for lwIP running on mini-os 
+ * Compiler-specific types and macros for lwIP running on mini-os
  *
  * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
  */
@@ -28,7 +28,7 @@ typedef uint16_t u_short;
 /*   Compiler hints for packing lwip's structures - */
 #define PACK_STRUCT_FIELD(_x)  _x
 #define PACK_STRUCT_STRUCT     __attribute__ ((packed))
-#define PACK_STRUCT_BEGIN 
+#define PACK_STRUCT_BEGIN
 #define PACK_STRUCT_END
 
 /*   Platform specific diagnostic output - */
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/arch/perf.h
--- a/extras/mini-os/include/arch/perf.h
+++ b/extras/mini-os/include/arch/perf.h
@@ -1,7 +1,7 @@
-/* 
+/*
  * lwip/arch/perf.h
  *
- * Arch-specific performance measurement for lwIP running on mini-os 
+ * Arch-specific performance measurement for lwIP running on mini-os
  *
  * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
  */
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/arch/sys_arch.h
--- a/extras/mini-os/include/arch/sys_arch.h
+++ b/extras/mini-os/include/arch/sys_arch.h
@@ -1,7 +1,7 @@
-/* 
+/*
  * lwip/arch/sys_arch.h
  *
- * Arch-specific semaphores and mailboxes for lwIP running on mini-os 
+ * Arch-specific semaphores and mailboxes for lwIP running on mini-os
  *
  * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
  */
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/console.h
--- a/extras/mini-os/include/console.h
+++ b/extras/mini-os/include/console.h
@@ -1,14 +1,14 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2006 - Grzegorz Milos - Cambridge University
  ****************************************************************************
  *
  *        File: console.h
  *      Author: Grzegorz Milos
- *     Changes: 
- *              
+ *     Changes:
+ *
  *        Date: Mar 2006
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Console interface.
  *
@@ -21,16 +21,16 @@
  * 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 
+ *
+ * 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 _LIB_CONSOLE_H_
@@ -67,7 +67,7 @@ void print(int direct, const char *fmt, 
 void printk(const char *fmt, ...);
 void xprintk(const char *fmt, ...);
 
-#define tprintk(_fmt, _args...) printk("[%s] " _fmt, current->name, ##_args) 
+#define tprintk(_fmt, _args...) printk("[%s] " _fmt, current->name, ##_args)
 
 void xencons_rx(char *buf, unsigned len, struct pt_regs *regs);
 void xencons_tx(void);
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/events.h
--- a/extras/mini-os/include/events.h
+++ b/extras/mini-os/include/events.h
@@ -7,9 +7,9 @@
  *        File: events.h
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
  *     Changes: Grzegorz Milos (gm281@cam.ac.uk)
- *              
+ *
  *        Date: Jul 2003, changes Jun 2005
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Deals with events on the event channels
  *
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/gntmap.h
--- a/extras/mini-os/include/gntmap.h
+++ b/extras/mini-os/include/gntmap.h
@@ -19,7 +19,7 @@ int
 gntmap_munmap(struct gntmap *map, unsigned long start_address, int count);
 
 void*
-gntmap_map_grant_refs(struct gntmap *map, 
+gntmap_map_grant_refs(struct gntmap *map,
                       uint32_t count,
                       uint32_t *domids,
                       int domids_stride,
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/hypervisor.h
--- a/extras/mini-os/include/hypervisor.h
+++ b/extras/mini-os/include/hypervisor.h
@@ -1,8 +1,8 @@
 /******************************************************************************
  * hypervisor.h
- * 
+ *
  * Hypervisor handling.
- * 
+ *
  *
  * Copyright (c) 2002, K A Fraser
  * Copyright (c) 2005, Grzegorz Milos
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/ioremap.h
--- a/extras/mini-os/include/ioremap.h
+++ b/extras/mini-os/include/ioremap.h
@@ -7,16 +7,16 @@
  * 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 
+ *
+ * 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.
  */
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/lib-gpl.h
--- a/extras/mini-os/include/lib-gpl.h
+++ b/extras/mini-os/include/lib-gpl.h
@@ -5,10 +5,10 @@
  *
  *        File: lib.h
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
- *     Changes: 
- *              
+ *     Changes:
+ *
  *        Date: Aug 2003
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Random useful library functions, from Linux'
  * include/linux/kernel.h
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/lib.h
--- a/extras/mini-os/include/lib.h
+++ b/extras/mini-os/include/lib.h
@@ -5,10 +5,10 @@
  *
  *        File: lib.h
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
- *     Changes: 
- *              
+ *     Changes:
+ *
  *        Date: Aug 2003
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Random useful library functions, contains some freebsd stuff
  *
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/lwipopts.h
--- a/extras/mini-os/include/lwipopts.h
+++ b/extras/mini-os/include/lwipopts.h
@@ -1,7 +1,7 @@
 /*
  * lwipopts.h
  *
- * Configuration for lwIP running on mini-os 
+ * Configuration for lwIP running on mini-os
  *
  * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
  */
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/mm.h
--- a/extras/mini-os/include/mm.h
+++ b/extras/mini-os/include/mm.h
@@ -9,16 +9,16 @@
  * 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 
+ *
+ * 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.
  */
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/netfront.h
--- a/extras/mini-os/include/netfront.h
+++ b/extras/mini-os/include/netfront.h
@@ -15,7 +15,7 @@ extern struct wait_queue_head netfront_q
 
 #ifdef HAVE_LWIP
 /* Call this to bring up the netfront interface and the lwIP stack.
- * N.B. _must_ be called from a thread; it's not safe to call this from 
+ * N.B. _must_ be called from a thread; it's not safe to call this from
  * app_main(). */
 void start_networking(void);
 void stop_networking(void);
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/posix/net/if.h
--- a/extras/mini-os/include/posix/net/if.h
+++ b/extras/mini-os/include/posix/net/if.h
@@ -1,5 +1,5 @@
 /*
- * This code is mostly taken from NetBSD net/if.h 
+ * This code is mostly taken from NetBSD net/if.h
  * Changes: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  *
  ******************************************************************************
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/posix/sys/poll.h
--- a/extras/mini-os/include/posix/sys/poll.h
+++ b/extras/mini-os/include/posix/sys/poll.h
@@ -1,5 +1,5 @@
 /*
- * This code is mostly taken from FreeBSD sys/sys/poll.h 
+ * This code is mostly taken from FreeBSD sys/sys/poll.h
  * Changes: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  *
  ****************************************************************************
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/sched.h
--- a/extras/mini-os/include/sched.h
+++ b/extras/mini-os/include/sched.h
@@ -33,7 +33,7 @@ void idle_thread_fn(void *unused);
 #define clear_runnable(_thread) (_thread->flags &= ~RUNNABLE_FLAG)
 
 #define switch_threads(prev, next) arch_switch_threads(prev, next)
- 
+
     /* Architecture specific setup of thread creation. */
 struct thread* arch_create_thread(char *name, void (*function)(void *),
                                   void *data);
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/semaphore.h
--- a/extras/mini-os/include/semaphore.h
+++ b/extras/mini-os/include/semaphore.h
@@ -5,7 +5,7 @@
 #include <mini-os/spinlock.h>
 
 /*
- * Implementation of semaphore in Mini-os is simple, because 
+ * Implementation of semaphore in Mini-os is simple, because
  * there are no preemptive threads, the atomicity is guaranteed.
  */
 
@@ -32,10 +32,10 @@ struct rw_semaphore {
 
 #define __MUTEX_INITIALIZER(name) \
     __SEMAPHORE_INITIALIZER(name,1)
-                           
+
 #define __DECLARE_SEMAPHORE_GENERIC(name,count) \
     struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
-    
+
 #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
 
 #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/sys/time.h
--- a/extras/mini-os/include/sys/time.h
+++ b/extras/mini-os/include/sys/time.h
@@ -8,9 +8,9 @@
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
  *     Changes: Grzegorz Milos (gm281@cam.ac.uk)
  *              Robert Kaiser (kaiser@informatik.fh-wiesbaden.de)
- *              
+ *
  *        Date: Jul 2003, changes: Jun 2005, Sep 2006
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Time and timer functions
  *
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/time.h
--- a/extras/mini-os/include/time.h
+++ b/extras/mini-os/include/time.h
@@ -8,9 +8,9 @@
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
  *     Changes: Grzegorz Milos (gm281@cam.ac.uk)
  *              Robert Kaiser (kaiser@informatik.fh-wiesbaden.de)
- *              
+ *
  *        Date: Jul 2003, changes: Jun 2005, Sep 2006
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Time and timer functions
  *
@@ -27,7 +27,7 @@
  * This value is adjusted by frequency drift.
  * NOW() returns the current time.
  * The other macros are for convenience to approximate short intervals
- * of real time into system time 
+ * of real time into system time
  */
 typedef int64_t s_time_t;
 #define NOW()                   ((s_time_t)monotonic_clock())
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/types.h
--- a/extras/mini-os/include/types.h
+++ b/extras/mini-os/include/types.h
@@ -5,10 +5,10 @@
  *
  *        File: types.h
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
- *     Changes: 
- *              
+ *     Changes:
+ *
  *        Date: May 2003
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: a random collection of type definitions
  *
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/wait.h
--- a/extras/mini-os/include/wait.h
+++ b/extras/mini-os/include/wait.h
@@ -86,9 +86,9 @@ static inline void wake_up(struct wait_q
     wake(get_current());                                        \
     remove_wait_queue(&wq, &__wait);                            \
     local_irq_restore(flags);                                   \
-} while(0) 
+} while(0)
 
-#define wait_event(wq, condition) wait_event_deadline(wq, condition, 0) 
+#define wait_event(wq, condition) wait_event_deadline(wq, condition, 0)
 
 
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/x86/arch_limits.h
--- a/extras/mini-os/include/x86/arch_limits.h
+++ b/extras/mini-os/include/x86/arch_limits.h
@@ -16,5 +16,5 @@
 
 #define __STACK_SIZE_PAGE_ORDER  4
 #define __STACK_SIZE             (__PAGE_SIZE * (1 << __STACK_SIZE_PAGE_ORDER))
-          
+
 #endif /* __ARCH_LIMITS_H__ */
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/x86/arch_mm.h
--- a/extras/mini-os/include/x86/arch_mm.h
+++ b/extras/mini-os/include/x86/arch_mm.h
@@ -9,16 +9,16 @@
  * 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 
+ *
+ * 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.
  */
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/x86/arch_sched.h
--- a/extras/mini-os/include/x86/arch_sched.h
+++ b/extras/mini-os/include/x86/arch_sched.h
@@ -7,11 +7,11 @@
 static inline struct thread* get_current(void)
 {
     struct thread **current;
-#ifdef __i386__    
+#ifdef __i386__
     register unsigned long sp asm("esp");
 #else
     register unsigned long sp asm("rsp");
-#endif 
+#endif
     current = (void *)(unsigned long)(sp & ~(__STACK_SIZE-1));
     return *current;
 }
@@ -21,5 +21,5 @@ extern void __arch_switch_threads(unsign
 #define arch_switch_threads(prev,next) __arch_switch_threads(&(prev)->sp, &(next)->sp)
 
 
-          
+
 #endif /* __ARCH_SCHED_H__ */
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/x86/os.h
--- a/extras/mini-os/include/x86/os.h
+++ b/extras/mini-os/include/x86/os.h
@@ -1,6 +1,6 @@
 /******************************************************************************
  * os.h
- * 
+ *
  * random collection of macros and definition
  */
 
@@ -72,7 +72,7 @@ void arch_fini(void);
 
 
 
-/* 
+/*
  * The use of 'barrier' in the following reflects their use as local-lock
  * operations. Reentrancy must be prevented (e.g., __cli()) /before/ following
  * critical operations are executed. All critical operations must complete
@@ -347,7 +347,7 @@ static inline unsigned long __xchg(unsig
  * @nr: Bit to clear
  * @addr: Address to count from
  *
- * This operation is atomic and cannot be reordered.  
+ * This operation is atomic and cannot be reordered.
  * It also implies a memory barrier.
  */
 static __inline__ int test_and_clear_bit(int nr, volatile void * addr)
@@ -515,7 +515,7 @@ static inline unsigned long __synch_cmpx
 
 static __inline__ void synch_set_bit(int nr, volatile void * addr)
 {
-    __asm__ __volatile__ ( 
+    __asm__ __volatile__ (
         "lock btsl %1,%0"
         : "=m" (ADDR) : "Ir" (nr) : "memory" );
 }
@@ -547,7 +547,7 @@ static __inline__ int synch_test_and_cle
 
 static __inline__ int synch_const_test_bit(int nr, const volatile void * addr)
 {
-    return ((1UL << (nr & 31)) & 
+    return ((1UL << (nr & 31)) &
             (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
 }
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/x86/traps.h
--- a/extras/mini-os/include/x86/traps.h
+++ b/extras/mini-os/include/x86/traps.h
@@ -1,13 +1,13 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2005 - Grzegorz Milos - Intel Reseach Cambridge
  ****************************************************************************
  *
  *        File: traps.h
  *      Author: Grzegorz Milos (gm281@cam.ac.uk)
- *              
+ *
  *        Date: Jun 2005
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Deals with traps
  *
@@ -46,7 +46,7 @@ struct pt_regs {
 	unsigned long rbx;
 /* arguments: non interrupts/non tracing syscalls only save upto here*/
  	unsigned long r11;
-	unsigned long r10;	
+	unsigned long r10;
 	unsigned long r9;
 	unsigned long r8;
 	unsigned long rax;
@@ -55,14 +55,14 @@ struct pt_regs {
 	unsigned long rsi;
 	unsigned long rdi;
 	unsigned long orig_rax;
-/* end of arguments */ 	
+/* end of arguments */
 /* cpu exception frame or undefined */
 	unsigned long rip;
 	unsigned long cs;
-	unsigned long eflags; 
-	unsigned long rsp; 
+	unsigned long eflags;
+	unsigned long rsp;
 	unsigned long ss;
-/* top of stack page */ 
+/* top of stack page */
 };
 
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/x86/x86_32/hypercall-x86_32.h
--- a/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h
+++ b/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h
@@ -1,23 +1,23 @@
 /******************************************************************************
  * hypercall-x86_32.h
- * 
+ *
  * Copied from XenLinux.
- * 
+ *
  * Copyright (c) 2002-2004, K A Fraser
- * 
+ *
  * This file may be 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
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/include/x86/x86_64/hypercall-x86_64.h
--- a/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h
+++ b/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h
@@ -1,27 +1,27 @@
 /******************************************************************************
  * hypercall-x86_64.h
- * 
+ *
  * Copied from XenLinux.
- * 
+ *
  * Copyright (c) 2002-2004, K A Fraser
- * 
+ *
  * 64-bit updates:
  *   Benjamin Liu <benjamin.liu@intel.com>
  *   Jun Nakajima <jun.nakajima@intel.com>
- * 
+ *
  * This file may be 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
@@ -155,7 +155,7 @@ HYPERVISOR_stack_switch(
 
 static inline int
 HYPERVISOR_set_callbacks(
-	unsigned long event_address, unsigned long failsafe_address, 
+	unsigned long event_address, unsigned long failsafe_address,
 	unsigned long syscall_address)
 {
 	return _hypercall3(int, set_callbacks,
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c
+++ b/extras/mini-os/kernel.c
@@ -1,29 +1,29 @@
 /******************************************************************************
  * kernel.c
- * 
+ *
  * Assorted crap goes here, including the initial C entry point, jumped at
  * from head.S.
- * 
+ *
  * Copyright (c) 2002-2003, K A Fraser & R Neugebauer
  * Copyright (c) 2005, Grzegorz Milos, Intel Research Cambridge
  * Copyright (c) 2006, Robert Kaiser, FH Wiesbaden
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (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 
+ *
+ * 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.
  */
 
@@ -54,12 +54,12 @@ void setup_xen_features(void)
     xen_feature_info_t fi;
     int i, j;
 
-    for (i = 0; i < XENFEAT_NR_SUBMAPS; i++) 
+    for (i = 0; i < XENFEAT_NR_SUBMAPS; i++)
     {
         fi.submap_idx = i;
         if (HYPERVISOR_xen_version(XENVER_get_features, &fi) < 0)
             break;
-        
+
         for (j=0; j<32; j++)
             xen_features[i*32+j] = !!(fi.submap & 1<<j);
     }
@@ -90,18 +90,18 @@ void start_kernel(start_info_t *si)
     printk("  start_info: %p(VA)\n", si);
     printk("    nr_pages: 0x%lx\n", si->nr_pages);
     printk("  shared_inf: 0x%08lx(MA)\n", si->shared_info);
-    printk("     pt_base: %p(VA)\n", (void *)si->pt_base); 
+    printk("     pt_base: %p(VA)\n", (void *)si->pt_base);
     printk("nr_pt_frames: 0x%lx\n", si->nr_pt_frames);
-    printk("    mfn_list: %p(VA)\n", (void *)si->mfn_list); 
+    printk("    mfn_list: %p(VA)\n", (void *)si->mfn_list);
     printk("   mod_start: 0x%lx(VA)\n", si->mod_start);
-    printk("     mod_len: %lu\n", si->mod_len); 
+    printk("     mod_len: %lu\n", si->mod_len);
     printk("       flags: 0x%x\n", (unsigned int)si->flags);
-    printk("    cmd_line: %s\n",  
+    printk("    cmd_line: %s\n",
            si->cmd_line ? (const char *)si->cmd_line : "NULL");
 
     /* Set up events. */
     init_events();
-    
+
     /* ENABLE EVENT DELIVERY. This is disabled at start of day. */
     __sti();
 
@@ -124,10 +124,10 @@ void start_kernel(start_info_t *si)
 
     /* Init grant tables */
     init_gnttab();
-    
+
     /* Init scheduler. */
     init_sched();
- 
+
     /* Init XenBus */
     init_xenbus();
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/lib/math.c
--- a/extras/mini-os/lib/math.c
+++ b/extras/mini-os/lib/math.c
@@ -5,10 +5,10 @@
  *
  *        File: math.c
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
- *     Changes: 
- *              
+ *     Changes:
+ *
  *        Date: Aug 2003
- * 
+ *
  * Environment: Xen Minimal OS
  * Description:  Library functions for 64bit arith and other
  *               from freebsd, files in sys/libkern/ (qdivrem.c, etc)
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/lib/printf.c
--- a/extras/mini-os/lib/printf.c
+++ b/extras/mini-os/lib/printf.c
@@ -5,7 +5,7 @@
  *
  *        File: printf.c
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
- *     Changes: Grzegorz Milos (gm281@cam.ac.uk) 
+ *     Changes: Grzegorz Milos (gm281@cam.ac.uk)
  *
  *        Date: Aug 2003, Aug 2005
  *
@@ -199,7 +199,7 @@ static char * number(char * buf, char * 
     i = 0;
     if (num == 0)
         tmp[i++]='0';
-    else 
+    else
     {
         /* XXX KAF: force unsigned mod and div. */
         unsigned long long num2=(unsigned long long)num;
@@ -589,7 +589,7 @@ int vsscanf(const char * buf, const char
 		if (!*fmt)
 			break;
 		++fmt;
-		
+
 		/* skip this conversion.
 		 * advance both strings to next white space
 		 */
@@ -678,7 +678,7 @@ int vsscanf(const char * buf, const char
 			break;
 		case '%':
 			/* looking for '%' in str */
-			if (*str++ != '%') 
+			if (*str++ != '%')
 				return num;
 			continue;
 		default:
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/lib/string.c
--- a/extras/mini-os/lib/string.c
+++ b/extras/mini-os/lib/string.c
@@ -5,10 +5,10 @@
  *
  *        File: string.c
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
- *     Changes: 
- *              
+ *     Changes:
+ *
  *        Date: Aug 2003
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Library function for string and memory manipulation
  *              Origin unknown
@@ -151,12 +151,12 @@ size_t strnlen(const char * s, size_t co
 char * strcat(char * dest, const char * src)
 {
     char *tmp = dest;
-    
+
     while (*dest)
         dest++;
-    
+
     while ((*dest++ = *src++) != '\0');
-    
+
     return tmp;
 }
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/lib/sys.c
--- a/extras/mini-os/lib/sys.c
+++ b/extras/mini-os/lib/sys.c
@@ -529,8 +529,8 @@ int fstat(int fd, struct stat *buf)
 	    buf->st_uid = 0;
 	    buf->st_gid = 0;
 	    buf->st_size = 0;
-	    buf->st_atime = 
-	    buf->st_mtime = 
+	    buf->st_atime =
+	    buf->st_mtime =
 	    buf->st_ctime = time(NULL);
 	    return 0;
 	}
@@ -618,7 +618,7 @@ DIR *opendir(const char *name)
 struct dirent *readdir(DIR *dir)
 {
     return NULL;
-} 
+}
 
 int closedir(DIR *dir)
 {
@@ -1328,7 +1328,7 @@ unsupported_function_crash(umask);
 /* We could support that.  */
 unsupported_function_log(int, chdir, -1);
 
-/* No dynamic library support.  */ 
+/* No dynamic library support.  */
 unsupported_function_log(void *, dlopen, NULL);
 unsupported_function_log(void *, dlsym, NULL);
 unsupported_function_log(char *, dlerror, NULL);
@@ -1368,7 +1368,7 @@ unsupported_function_log(char *, if_inde
 unsupported_function_log(struct  if_nameindex *, if_nameindex, (struct  if_nameindex *) NULL);
 unsupported_function_crash(if_freenameindex);
 
-/* Linuxish abi for the Caml runtime, don't support 
+/* Linuxish abi for the Caml runtime, don't support
    Log, and return an error code if possible.  If it is not possible
    to inform the application of an error, then crash instead!
 */
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/lib/xmalloc.c
--- a/extras/mini-os/lib/xmalloc.c
+++ b/extras/mini-os/lib/xmalloc.c
@@ -1,4 +1,4 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2005 - Grzegorz Milos - Intel Research Cambridge
  ****************************************************************************
@@ -6,11 +6,11 @@
  *        File: xmaloc.c
  *      Author: Grzegorz Milos (gm281@cam.ac.uk)
  *              Samuel Thibault (samuel.thibault@eu.citrix.com)
- *     Changes: 
- *              
+ *     Changes:
+ *
  *        Date: Aug 2005
  *              Jan 2008
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: simple memory allocator
  *
@@ -286,9 +286,9 @@ void *_realloc(void *ptr, size_t size)
 	maybe_split(hdr, pad->hdr_size + size, hdr->size);
         return ptr;
     }
-    
+
     new = _xmalloc(size, DEFAULT_ALIGN);
-    if (new == NULL) 
+    if (new == NULL)
         return NULL;
 
     memcpy(new, ptr, old_data_size);
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/lwip-arch.c
--- a/extras/mini-os/lwip-arch.c
+++ b/extras/mini-os/lwip-arch.c
@@ -1,7 +1,7 @@
-/* 
+/*
  * lwip-arch.c
  *
- * Arch-specific semaphores and mailboxes for lwIP running on mini-os 
+ * Arch-specific semaphores and mailboxes for lwIP running on mini-os
  *
  * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
  */
@@ -44,7 +44,7 @@ void sys_sem_signal(sys_sem_t sem)
  * signaled. If the "timeout" argument is non-zero, the thread should
  * only be blocked for the specified time (measured in
  * milliseconds).
- * 
+ *
  * If the timeout argument is non-zero, the return value is the number of
  * milliseconds spent waiting for the semaphore to be signaled. If the
  * semaphore wasn't signaled within the specified time, the return value is
@@ -76,9 +76,9 @@ uint32_t sys_arch_sem_wait(sys_sem_t sem
     if (sem->count > 0) {
         sem->count--;
         sys_arch_unprotect(prot);
-        return NSEC_TO_MSEC(NOW() - then); 
+        return NSEC_TO_MSEC(NOW() - then);
     }
-    
+
     sys_arch_unprotect(prot);
     return SYS_ARCH_TIMEOUT;
 }
@@ -215,12 +215,12 @@ uint32_t sys_arch_mbox_tryfetch(sys_mbox
  * each thread has a list of timeouts which is repressented as a linked
  * list of sys_timeout structures. The sys_timeouts structure holds a
  * pointer to a linked list of timeouts. This function is called by
- * the lwIP timeout scheduler and must not return a NULL value. 
+ * the lwIP timeout scheduler and must not return a NULL value.
  *
  * In a single threadd sys_arch implementation, this function will
  * simply return a pointer to a global sys_timeouts variable stored in
  * the sys_arch module. */
-struct sys_timeouts *sys_arch_timeouts(void) 
+struct sys_timeouts *sys_arch_timeouts(void)
 {
     static struct sys_timeouts timeout;
     return &timeout;
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/lwip-net.c
--- a/extras/mini-os/lwip-net.c
+++ b/extras/mini-os/lwip-net.c
@@ -1,4 +1,4 @@
-/* 
+/*
  * lwip-net.c
  *
  * interface between lwIP's ethernet and Mini-os's netfront.
@@ -11,9 +11,9 @@
 
 /*
  * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
- * All rights reserved. 
- * 
- * Redistribution and use in source and binary forms, with or without modification, 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
  * are permitted provided that the following conditions are met:
  *
  * 1. Redistributions of source code must retain the above copyright notice,
@@ -22,21 +22,21 @@
  *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
  * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission. 
+ *    derived from this software without specific prior written permission.
  *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
- * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
+ * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  * OF SUCH DAMAGE.
  *
  * This file is part of the lwIP TCP/IP stack.
- * 
+ *
  * Author: Adam Dunkels <adam@sics.se>
  *
  */
@@ -118,7 +118,7 @@ low_level_output(struct netif *netif, st
 #if ETH_PAD_SIZE
   pbuf_header(p, ETH_PAD_SIZE);			/* reclaim the padding word */
 #endif
-  
+
   LINK_STATS_INC(link.xmit);
 
   return ERR_OK;
@@ -139,17 +139,17 @@ static err_t
 netfront_output(struct netif *netif, struct pbuf *p,
       struct ip_addr *ipaddr)
 {
-  
+
  /* resolve hardware address, then send (or queue) packet */
   return etharp_output(netif, p, ipaddr);
- 
+
 }
 
 /*
  * netfront_input():
  *
  * This function should be called when a packet is ready to be read
- * from the interface. 
+ * from the interface.
  *
  */
 
@@ -162,7 +162,7 @@ netfront_input(struct netif *netif, unsi
 #if ETH_PAD_SIZE
   len += ETH_PAD_SIZE; /* allow room for Ethernet padding */
 #endif
-  
+
   /* move received packet into a new pbuf */
   p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
   if (p == NULL) {
@@ -174,7 +174,7 @@ netfront_input(struct netif *netif, unsi
 #if ETH_PAD_SIZE
   pbuf_header(p, -ETH_PAD_SIZE); /* drop the padding word */
 #endif
-  
+
   /* We iterate over the pbuf chain until we have read the entire
    * packet into the pbuf. */
   for(q = p; q != NULL && len > 0; q = q->next) {
@@ -196,7 +196,7 @@ netfront_input(struct netif *netif, unsi
   ethhdr = p->payload;
 
   ethhdr = p->payload;
-    
+
   switch (htons(ethhdr->type)) {
   /* IP packet? */
   case ETHTYPE_IP:
@@ -213,7 +213,7 @@ netfront_input(struct netif *netif, unsi
       /* Could not store it, drop */
       pbuf_free(p);
     break;
-      
+
   case ETHTYPE_ARP:
     /* pass p to ARP module  */
     etharp_arp_input(netif, (struct eth_addr *) netif->hwaddr, p);
@@ -227,10 +227,10 @@ netfront_input(struct netif *netif, unsi
 }
 
 
-/* 
+/*
  * netif_rx(): overrides the default netif_rx behaviour in the netfront driver.
- * 
- * Pull received packets into a pbuf queue for the low_level_input() 
+ *
+ * Pull received packets into a pbuf queue for the low_level_input()
  * function to pass up to lwIP.
  */
 
@@ -290,14 +290,14 @@ netif_netfront_init(struct netif *netif)
   netif->ifoutnucastpkts = 0;
   netif->ifoutdiscards = 0;
 #endif
-  
+
   netif->name[0] = IFNAME0;
   netif->name[1] = IFNAME1;
   netif->output = netfront_output;
   netif->linkoutput = low_level_output;
-  
+
   the_interface = netif;
-  
+
   /* set MAC hardware address */
   netif->hwaddr_len = 6;
   netif->hwaddr[0] = mac[0];
@@ -312,7 +312,7 @@ netif_netfront_init(struct netif *netif)
 
   /* maximum transfer unit */
   netif->mtu = 1500;
-  
+
   /* broadcast capability */
   netif->flags = NETIF_FLAG_BROADCAST;
 
@@ -333,10 +333,10 @@ static void tcpip_bringup_finished(void 
   up(&tcpip_is_up);
 }
 
-/* 
- * Utility function to bring the whole lot up.  Call this from app_main() 
+/*
+ * Utility function to bring the whole lot up.  Call this from app_main()
  * or similar -- it starts netfront and have lwIP start its thread,
- * which calls back to tcpip_bringup_finished(), which 
+ * which calls back to tcpip_bringup_finished(), which
  * lets us know it's OK to continue.
  */
 void start_networking(void)
@@ -350,7 +350,7 @@ void start_networking(void)
   tprintk("Waiting for network.\n");
 
   dev = init_netfront(NULL, NULL, rawmac, &ip);
-  
+
   if (ip) {
     ipaddr.addr = inet_addr(ip);
     if (IN_CLASSA(ntohl(ipaddr.addr)))
@@ -364,13 +364,13 @@ void start_networking(void)
   }
   tprintk("IP %x netmask %x gateway %x.\n",
           ntohl(ipaddr.addr), ntohl(netmask.addr), ntohl(gw.addr));
-  
+
   tprintk("TCP/IP bringup begins.\n");
-  
+
   netif = xmalloc(struct netif);
   tcpip_init(tcpip_bringup_finished, netif);
-    
-  netif_add(netif, &ipaddr, &netmask, &gw, rawmac, 
+
+  netif_add(netif, &ipaddr, &netmask, &gw, rawmac,
             netif_netfront_init, ip_input);
   netif_set_default(netif);
   netif_set_up(netif);
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/mm.c
--- a/extras/mini-os/mm.c
+++ b/extras/mini-os/mm.c
@@ -1,4 +1,4 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2003 - Rolf Neugebauer - Intel Research Cambridge
  * (C) 2005 - Grzegorz Milos - Intel Research Cambridge
@@ -7,9 +7,9 @@
  *        File: mm.c
  *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
  *     Changes: Grzegorz Milos
- *              
+ *
  *        Date: Aug 2003, chages Aug 2005
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: memory management related functions
  *              contains buddy page allocator from Xen.
@@ -21,16 +21,16 @@
  * 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 
+ *
+ * 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.
  */
 
@@ -62,7 +62,7 @@ static unsigned long *alloc_bitmap;
 
 /*
  * Hint regarding bitwise arithmetic in map_{alloc,free}:
- *  -(1<<n)  sets all bits >= n. 
+ *  -(1<<n)  sets all bits >= n.
  *  (1<<n)-1 sets all bits <  n.
  * Variable names in map_{alloc,free}:
  *  *_idx == Index into `alloc_bitmap' array.
@@ -82,7 +82,7 @@ static void map_alloc(unsigned long firs
     {
         alloc_bitmap[curr_idx] |= ((1UL<<end_off)-1) & -(1UL<<start_off);
     }
-    else 
+    else
     {
         alloc_bitmap[curr_idx] |= -(1UL<<start_off);
         while ( ++curr_idx < end_idx ) alloc_bitmap[curr_idx] = ~0UL;
@@ -104,7 +104,7 @@ static void map_free(unsigned long first
     {
         alloc_bitmap[curr_idx] &= -(1UL<<end_off) | ((1UL<<start_off)-1);
     }
-    else 
+    else
     {
         alloc_bitmap[curr_idx] &= (1UL<<start_off)-1;
         while ( ++curr_idx != end_idx ) alloc_bitmap[curr_idx] = 0;
@@ -152,8 +152,8 @@ USED static void print_allocation(void *
     for(count = 0; count < nr_pages; count++)
         if(allocated_in_map(pfn_start + count)) printk("1");
         else printk("0");
-        
-    printk("\n");        
+
+    printk("\n");
 }
 
 /*
@@ -166,13 +166,13 @@ USED static void print_chunks(void *star
     int order, count;
     chunk_head_t *head;
     unsigned long pfn_start = virt_to_pfn(start);
-   
+
     memset(chunks, (int)'_', 1000);
-    if(nr_pages > 1000) 
+    if(nr_pages > 1000)
     {
         DEBUG("Can only pring 1000 pages. Increase buffer size.");
     }
-    
+
     for(order=0; order < FREELIST_SIZE; order++)
     {
         head = free_head[order];
@@ -264,12 +264,12 @@ unsigned long alloc_pages(int order)
 
     /* Find smallest order which can satisfy the request. */
     for ( i = order; i < FREELIST_SIZE; i++ ) {
-	if ( !FREELIST_EMPTY(free_head[i]) ) 
+	if ( !FREELIST_EMPTY(free_head[i]) )
 	    break;
     }
 
     if ( i == FREELIST_SIZE ) goto no_memory;
- 
+
     /* Unlink a chunk. */
     alloc_ch = free_head[i];
     free_head[i] = alloc_ch->next;
@@ -293,7 +293,7 @@ unsigned long alloc_pages(int order)
         spare_ch->next->pprev = &spare_ch->next;
         free_head[i] = spare_ch;
     }
-    
+
     map_alloc(PHYS_PFN(to_phys(alloc_ch)), 1UL<<order);
 
     return((unsigned long)alloc_ch);
@@ -310,43 +310,43 @@ void free_pages(void *pointer, int order
     chunk_head_t *freed_ch, *to_merge_ch;
     chunk_tail_t *freed_ct;
     unsigned long mask;
-    
+
     /* First free the chunk */
     map_free(virt_to_pfn(pointer), 1UL << order);
-    
+
     /* Create free chunk */
     freed_ch = (chunk_head_t *)pointer;
     freed_ct = (chunk_tail_t *)((char *)pointer + (1UL<<(order + PAGE_SHIFT)))-1;
-    
+
     /* Now, possibly we can conseal chunks together */
     while(order < FREELIST_SIZE)
     {
         mask = 1UL << (order + PAGE_SHIFT);
-        if((unsigned long)freed_ch & mask) 
+        if((unsigned long)freed_ch & mask)
         {
             to_merge_ch = (chunk_head_t *)((char *)freed_ch - mask);
             if(allocated_in_map(virt_to_pfn(to_merge_ch)) ||
                     to_merge_ch->level != order)
                 break;
-            
+
             /* Merge with predecessor */
-            freed_ch = to_merge_ch;   
+            freed_ch = to_merge_ch;
         }
-        else 
+        else
         {
             to_merge_ch = (chunk_head_t *)((char *)freed_ch + mask);
             if(allocated_in_map(virt_to_pfn(to_merge_ch)) ||
                     to_merge_ch->level != order)
                 break;
-            
+
             /* Merge with successor */
             freed_ct = (chunk_tail_t *)((char *)to_merge_ch + mask) - 1;
         }
-        
+
         /* We are commited to merging, unlink the chunk */
         *(to_merge_ch->pprev) = to_merge_ch->next;
         to_merge_ch->next->pprev = to_merge_ch->pprev;
-        
+
         order++;
     }
 
@@ -355,10 +355,10 @@ void free_pages(void *pointer, int order
     freed_ch->next  = free_head[order];
     freed_ch->pprev = &free_head[order];
     freed_ct->level = order;
-    
+
     freed_ch->next->pprev = &freed_ch->next;
-    free_head[order] = freed_ch;   
-   
+    free_head[order] = freed_ch;
+
 }
 
 int free_physical_pages(xen_pfn_t *mfns, int n)
@@ -382,7 +382,7 @@ void *sbrk(ptrdiff_t increment)
 	printk("Heap exhausted: %p + %lx = %p > %p\n", old_brk, increment, new_brk, heap_end);
 	return NULL;
     }
-    
+
     if (new_brk > heap_mapped) {
         unsigned long n = (new_brk - heap_mapped + PAGE_SIZE - 1) / PAGE_SIZE;
         do_map_zero(heap_mapped, n);
@@ -409,13 +409,13 @@ void init_mm(void)
      * now we can initialise the page allocator
      */
     printk("MM: Initialise page allocator for %lx(%lx)-%lx(%lx)\n",
-           (u_long)to_virt(PFN_PHYS(start_pfn)), PFN_PHYS(start_pfn), 
+           (u_long)to_virt(PFN_PHYS(start_pfn)), PFN_PHYS(start_pfn),
            (u_long)to_virt(PFN_PHYS(max_pfn)), PFN_PHYS(max_pfn));
     init_page_allocator(PFN_PHYS(start_pfn), PFN_PHYS(max_pfn));
     printk("MM: done\n");
 
     arch_init_p2m(max_pfn);
-    
+
     arch_init_demand_mapping_area(max_pfn);
 }
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/netfront.c
--- a/extras/mini-os/netfront.c
+++ b/extras/mini-os/netfront.c
@@ -1,4 +1,4 @@
-/* Minimal network driver for Mini-OS. 
+/* Minimal network driver for Mini-OS.
  * Copyright (c) 2006-2007 Jacob Gorm Hansen, University of Copenhagen.
  * Based on netfront.c from Xen Linux.
  *
@@ -162,7 +162,7 @@ moretodo:
         void* page = buf->page;
 
         /* We are sure to have free gnttab entries since they got released above */
-        buf->gref = req->gref = 
+        buf->gref = req->gref =
             gnttab_grant_access(dev->dom,virt_to_mfn(page),0);
 
         req->id = id;
@@ -171,7 +171,7 @@ moretodo:
     wmb();
 
     dev->rx.req_prod_pvt = req_prod + i;
-    
+
     RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&dev->rx, notify);
     if (notify)
         notify_remote_via_evtchn(dev->evtchn);
@@ -189,7 +189,7 @@ void network_tx_buf_gc(struct netfront_d
         prod = dev->tx.sring->rsp_prod;
         rmb(); /* Ensure we see responses up to 'rp'. */
 
-        for (cons = dev->tx.rsp_cons; cons != prod; cons++) 
+        for (cons = dev->tx.rsp_cons; cons != prod; cons++)
         {
             struct netif_tx_response *txrsp;
             struct net_buffer *buf;
@@ -571,12 +571,12 @@ void init_rx_buffers(struct netfront_dev
     int notify;
 
     /* Rebuild the RX buffer freelist and the RX ring itself. */
-    for (requeue_idx = 0, i = 0; i < NET_RX_RING_SIZE; i++) 
+    for (requeue_idx = 0, i = 0; i < NET_RX_RING_SIZE; i++)
     {
         struct net_buffer* buf = &dev->rx_buffers[requeue_idx];
         req = RING_GET_REQUEST(&dev->rx, requeue_idx);
 
-        buf->gref = req->gref = 
+        buf->gref = req->gref =
             gnttab_grant_access(dev->dom,virt_to_mfn(buf->page),0);
 
         req->id = requeue_idx;
@@ -588,7 +588,7 @@ void init_rx_buffers(struct netfront_dev
 
     RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&dev->rx, notify);
 
-    if (notify) 
+    if (notify)
         notify_remote_via_evtchn(dev->evtchn);
 
     dev->rx.sring->rsp_event = dev->rx.rsp_cons + 1;
@@ -623,7 +623,7 @@ void netfront_xmit(struct netfront_dev *
 
     memcpy(page,data,len);
 
-    buf->gref = 
+    buf->gref =
         tx->gref = gnttab_grant_access(dev->dom,virt_to_mfn(page),1);
 
     tx->offset=0;
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/pcifront.c
--- a/extras/mini-os/pcifront.c
+++ b/extras/mini-os/pcifront.c
@@ -1,4 +1,4 @@
-/* Minimal PCI driver for Mini-OS. 
+/* Minimal PCI driver for Mini-OS.
  * Copyright (c) 2007-2008 Samuel Thibault.
  * Based on blkfront.c.
  */
@@ -157,7 +157,7 @@ struct pcifront_dev *init_pcifront(char 
     printk("******************* PCIFRONT for %s **********\n\n\n", nodename);
 
     snprintf(path, sizeof(path), "%s/backend-id", nodename);
-    dom = xenbus_read_integer(path); 
+    dom = xenbus_read_integer(path);
     if (dom == -1) {
         printk("no backend\n");
         return NULL;
@@ -518,7 +518,7 @@ int pcifront_enable_msi(struct pcifront_
     op.devfn = PCI_DEVFN(slot, fun);
 
     pcifront_op(dev, &op);
-    
+
     if (op.err)
         return op.err;
     else
@@ -543,7 +543,7 @@ int pcifront_disable_msi(struct pcifront
     op.devfn = PCI_DEVFN(slot, fun);
 
     pcifront_op(dev, &op);
-    
+
     return op.err;
 }
 
@@ -572,7 +572,7 @@ int pcifront_enable_msix(struct pcifront
     memcpy(op.msix_entries, entries, n * sizeof(*entries));
 
     pcifront_op(dev, &op);
-    
+
     if (op.err)
         return op.err;
 
@@ -600,6 +600,6 @@ int pcifront_disable_msix(struct pcifron
     op.devfn = PCI_DEVFN(slot, fun);
 
     pcifront_op(dev, &op);
-    
+
     return op.err;
 }
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/sched.c
--- a/extras/mini-os/sched.c
+++ b/extras/mini-os/sched.c
@@ -1,4 +1,4 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2005 - Grzegorz Milos - Intel Research Cambridge
  ****************************************************************************
@@ -6,13 +6,13 @@
  *        File: sched.c
  *      Author: Grzegorz Milos
  *     Changes: Robert Kaiser
- *              
+ *
  *        Date: Aug 2005
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: simple scheduler for Mini-Os
  *
- * The scheduler is non-preemptive (cooperative), and schedules according 
+ * The scheduler is non-preemptive (cooperative), and schedules according
  * to Round Robin algorithm.
  *
  ****************************************************************************
@@ -22,16 +22,16 @@
  * 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 
+ *
+ * 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.
  */
 
@@ -79,7 +79,7 @@ void schedule(void)
     unsigned long flags;
 
     prev = current;
-    local_irq_save(flags); 
+    local_irq_save(flags);
 
     if (in_callback) {
         printk("Must not call schedule() from a callback\n");
@@ -106,7 +106,7 @@ void schedule(void)
                 else if (thread->wakeup_time < min_wakeup_time)
                     min_wakeup_time = thread->wakeup_time;
             }
-            if(is_runnable(thread)) 
+            if(is_runnable(thread))
             {
                 next = thread;
                 /* Put this thread on the end of the list */
@@ -255,17 +255,17 @@ void th_f1(void *data)
         schedule();
         printk("Thread \"%s\" releases the semaphore\n", current->name);
         up(&mutex);
-        
-        
+
+
         gettimeofday(&tv1, NULL);
         for(;;)
         {
             gettimeofday(&tv2, NULL);
             if(tv2.tv_sec - tv1.tv_sec > 2) break;
         }
-                
-        
-        schedule(); 
+
+
+        schedule();
     }
 }
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/test.c
--- a/extras/mini-os/test.c
+++ b/extras/mini-os/test.c
@@ -1,28 +1,28 @@
 /******************************************************************************
  * test.c
- * 
+ *
  * Test code for all the various frontends; split from kernel.c
- * 
+ *
  * Copyright (c) 2002-2003, K A Fraser & R Neugebauer
  * Copyright (c) 2005, Grzegorz Milos, Intel Research Cambridge
  * Copyright (c) 2006, Robert Kaiser, FH Wiesbaden
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (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 
+ *
+ * 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.
  */
 
diff -r 121ae49aabcb -r 7784cd3925c5 extras/mini-os/xenbus/xenbus.c
--- a/extras/mini-os/xenbus/xenbus.c
+++ b/extras/mini-os/xenbus/xenbus.c
@@ -1,15 +1,15 @@
-/* 
+/*
  ****************************************************************************
  * (C) 2006 - Cambridge University
  ****************************************************************************
  *
  *        File: xenbus.c
- *      Author: Steven Smith (sos22@cam.ac.uk) 
+ *      Author: Steven Smith (sos22@cam.ac.uk)
  *     Changes: Grzegorz Milos (gm281@cam.ac.uk)
  *     Changes: John D. Ramsdell
- *              
+ *
  *        Date: Jun 2006, chages Aug 2005
- * 
+ *
  * Environment: Xen Minimal OS
  * Description: Minimal implementation of xenbus
  *
@@ -51,7 +51,7 @@ static struct watch {
     xenbus_event_queue *events;
     struct watch *next;
 } *watches;
-struct xenbus_req_info 
+struct xenbus_req_info
 {
     int in_use:1;
     struct wait_queue_head waitq;
@@ -196,10 +196,10 @@ static void xenbus_thread_func(void *ign
     struct xsd_sockmsg msg;
     unsigned prod = xenstore_buf->rsp_prod;
 
-    for (;;) 
+    for (;;)
     {
         wait_event(xb_waitq, prod != xenstore_buf->rsp_prod);
-        while (1) 
+        while (1)
         {
             prod = xenstore_buf->rsp_prod;
             DEBUG("Rsp_cons %d, rsp_prod %d.\n", xenstore_buf->rsp_cons,
@@ -298,7 +298,7 @@ static int allocate_xenbus_id(void)
     static int probe;
     int o_probe;
 
-    while (1) 
+    while (1)
     {
         spin_lock(&req_lock);
         if (nr_live_reqs < NR_REQS)
@@ -308,7 +308,7 @@ static int allocate_xenbus_id(void)
     }
 
     o_probe = probe;
-    for (;;) 
+    for (;;)
     {
         if (!req_info[o_probe].in_use)
             break;
@@ -373,7 +373,7 @@ static void xb_write(int type, int req_i
     /* Wait for the ring to drain to the point where we can send the
        message. */
     prod = xenstore_buf->req_prod;
-    if (prod + len - xenstore_buf->req_cons > XENSTORE_RING_SIZE) 
+    if (prod + len - xenstore_buf->req_cons > XENSTORE_RING_SIZE)
     {
         /* Wait for there to be space on the ring */
         DEBUG("prod %d, len %d, cons %d, size %d; waiting.\n",
@@ -389,7 +389,7 @@ static void xb_write(int type, int req_i
        overflowing the ring.  Do so. */
     total_off = 0;
     req_off = 0;
-    while (total_off < len) 
+    while (total_off < len)
     {
         this_chunk = min(cur_req->len - req_off,
                 XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(prod));
@@ -398,7 +398,7 @@ static void xb_write(int type, int req_i
         prod += this_chunk;
         req_off += this_chunk;
         total_off += this_chunk;
-        if (req_off == cur_req->len) 
+        if (req_off == cur_req->len)
         {
             req_off = 0;
             if (cur_req == &header_req)
@@ -465,7 +465,7 @@ static char *errmsg(struct xsd_sockmsg *
     res[rep->len] = 0;
     free(rep);
     return res;
-}	
+}
 
 /* Send a debug message to xenbus.  Can block. */
 static void xenbus_debug_msg(const char *msg)
@@ -535,7 +535,7 @@ char *xenbus_read(xenbus_transaction_t x
 
 char *xenbus_write(xenbus_transaction_t xbt, const char *path, const char *value)
 {
-    struct write_req req[] = { 
+    struct write_req req[] = {
 	{path, strlen(path) + 1},
 	{value, strlen(value)},
     };
@@ -552,7 +552,7 @@ char* xenbus_watch_path_token( xenbus_tr
 {
     struct xsd_sockmsg *rep;
 
-    struct write_req req[] = { 
+    struct write_req req[] = {
         {path, strlen(path) + 1},
 	{token, strlen(token) + 1},
     };
@@ -582,7 +582,7 @@ char* xenbus_unwatch_path_token( xenbus_
 {
     struct xsd_sockmsg *rep;
 
-    struct write_req req[] = { 
+    struct write_req req[] = {
         {path, strlen(path) + 1},
 	{token, strlen(token) + 1},
     };
@@ -644,7 +644,7 @@ char *xenbus_get_perms(xenbus_transactio
 char *xenbus_set_perms(xenbus_transaction_t xbt, const char *path, domid_t dom, char perm)
 {
     char value[PERM_MAX_SIZE];
-    struct write_req req[] = { 
+    struct write_req req[] = {
 	{path, strlen(path) + 1},
 	{value, 0},
     };
@@ -786,7 +786,7 @@ static void do_ls_test(const char *pre)
 	free(msg);
 	return;
     }
-    for (x = 0; dirs[x]; x++) 
+    for (x = 0; dirs[x]; x++)
     {
         printk("ls %s[%d] -> %s\n", pre, x, dirs[x]);
         free(dirs[x]);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:30:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:30:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1ZW-0000WX-2o; Mon, 26 Nov 2012 16:30:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1ZS-0000Vt-06
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:30:10 +0000
Received: from [85.158.139.211:40382] by server-7.bemta-5.messagelabs.com id
	7C/77-23096-11993B05; Mon, 26 Nov 2012 16:30:09 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353947406!21579563!2
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27546 invoked from network); 26 Nov 2012 16:30:08 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:30:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215485650"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:30:05 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:30:05 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1Tz-0005Uf-Er;
	Mon, 26 Nov 2012 16:24:31 +0000
MIME-Version: 1.0
X-Mercurial-Node: 505992114832722bd63b4d0b593eae17da0657d6
Message-ID: <505992114832722bd63b.1353947049@andrewcoop.uk.xensource.com>
In-Reply-To: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:24:09 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 1 of 4] minios/cmdline: Port Xen command line
 argument handling to minios
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a direct port of the core command line functional, and some
tweaking with the linker setup.  It required adding some extra consts to
some of the library functions to compile.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 0049de3827bc -r 505992114832 extras/mini-os/Makefile
--- a/extras/mini-os/Makefile
+++ b/extras/mini-os/Makefile
@@ -76,6 +76,7 @@ src-$(CONFIG_BLKFRONT) += blkfront.c
 src-$(CONFIG_TPMFRONT) += tpmfront.c
 src-$(CONFIG_TPM_TIS) += tpm_tis.c
 src-$(CONFIG_TPMBACK) += tpmback.c
+src-y += cmdline.c
 src-y += daytime.c
 src-y += events.c
 src-$(CONFIG_FBFRONT) += fbfront.c
diff -r 0049de3827bc -r 505992114832 extras/mini-os/arch/x86/minios-x86_32.lds
--- a/extras/mini-os/arch/x86/minios-x86_32.lds
+++ b/extras/mini-os/arch/x86/minios-x86_32.lds
@@ -45,6 +45,9 @@ SECTIONS
 
   .data : {			/* Data */
 	*(.data)
+	__setup_start = .;
+	*(.initsetup)
+	__setup_end = .;
 	}
 
   _edata = .;			/* End of data section */
diff -r 0049de3827bc -r 505992114832 extras/mini-os/arch/x86/minios-x86_64.lds
--- a/extras/mini-os/arch/x86/minios-x86_64.lds
+++ b/extras/mini-os/arch/x86/minios-x86_64.lds
@@ -45,6 +45,9 @@ SECTIONS
 
   .data : {			/* Data */
 	*(.data)
+	__setup_start = .;
+	*(.initsetup)
+	__setup_end = .;
 	}
 
   _edata = .;			/* End of data section */
diff -r 0049de3827bc -r 505992114832 extras/mini-os/cmdline.c
--- /dev/null
+++ b/extras/mini-os/cmdline.c
@@ -0,0 +1,165 @@
+#include <mini-os/cmdline.h>
+#include <mini-os/lib.h>
+#include <mini-os/ctype.h>
+
+size_t strlcpy(char *dest, const char *src, size_t size)
+{
+	size_t ret = strlen(src);
+
+	if (size) {
+		size_t len = (ret >= size) ? size-1 : ret;
+		memcpy(dest, src, len);
+		dest[len] = '\0';
+	}
+	return ret;
+}
+
+unsigned long long parse_size_and_unit(const char *s, const char **ps)
+{
+    unsigned long long ret;
+    const char *s1;
+
+    ret = simple_strtoull(s, &s1, 0);
+
+    switch ( *s1 )
+    {
+    case 'G': case 'g':
+        ret <<= 10;
+    case 'M': case 'm':
+        ret <<= 10;
+    case 'K': case 'k':
+        ret <<= 10;
+    case 'B': case 'b':
+        s1++;
+        break;
+    default:
+        ret <<= 10; /* default to kB */
+        break;
+    }
+
+    if ( ps != NULL )
+        *ps = s1;
+
+    return ret;
+}
+
+static void __init assign_integer_param(
+    struct kernel_param *param, uint64_t val)
+{
+    switch ( param->len )
+    {
+    case sizeof(uint8_t):
+        *(uint8_t *)param->var = val;
+        break;
+    case sizeof(uint16_t):
+        *(uint16_t *)param->var = val;
+        break;
+    case sizeof(uint32_t):
+        *(uint32_t *)param->var = val;
+        break;
+    case sizeof(uint64_t):
+        *(uint64_t *)param->var = val;
+        break;
+    default:
+        BUG();
+    }
+}
+
+static int __init parse_bool(const char *s)
+{
+    if ( !strcmp("no", s) ||
+         !strcmp("off", s) ||
+         !strcmp("false", s) ||
+         !strcmp("disable", s) ||
+         !strcmp("0", s) )
+        return 0;
+
+    if ( !strcmp("yes", s) ||
+         !strcmp("on", s) ||
+         !strcmp("true", s) ||
+         !strcmp("enable", s) ||
+         !strcmp("1", s) )
+        return 1;
+
+    return -1;
+}
+
+void __init cmdline_parse(char *cmdline)
+{
+    char opt[100], *optval, *optkey, *q;
+    const char *p = cmdline;
+    struct kernel_param *param;
+    int bool_assert;
+
+    if ( p == NULL )
+        return;
+
+    for ( ; ; )
+    {
+        /* Skip whitespace. */
+        while ( *p == ' ' )
+            p++;
+        if ( *p == '\0' )
+            break;
+
+        /* Grab the next whitespace-delimited option. */
+        q = optkey = opt;
+        while ( (*p != ' ') && (*p != '\0') )
+        {
+            if ( (q-opt) < (sizeof(opt)-1) ) /* avoid overflow */
+                *q++ = *p;
+            p++;
+        }
+        *q = '\0';
+
+        /* Search for value part of a key=value option. */
+        optval = strchr(opt, '=');
+        if ( optval != NULL )
+            *optval++ = '\0'; /* nul-terminate the option value */
+        else
+            optval = q;       /* default option value is empty string */
+
+        /* Boolean parameters can be inverted with 'no-' prefix. */
+        bool_assert = !!strncmp("no-", optkey, 3);
+        if ( !bool_assert )
+            optkey += 3;
+
+        for ( param = &__setup_start; param < &__setup_end; param++ )
+        {
+            if ( strcmp(param->name, optkey) )
+                continue;
+
+            switch ( param->type )
+            {
+            case OPT_STR:
+                strlcpy(param->var, optval, param->len);
+                break;
+            case OPT_UINT:
+                assign_integer_param(
+                    param,
+                    simple_strtoll(optval, NULL, 0));
+                break;
+            case OPT_BOOL:
+            case OPT_INVBOOL:
+                if ( !parse_bool(optval) )
+                    bool_assert = !bool_assert;
+                assign_integer_param(
+                    param,
+                    (param->type == OPT_BOOL) == bool_assert);
+                break;
+            case OPT_SIZE:
+                assign_integer_param(
+                    param,
+                    parse_size_and_unit(optval, NULL));
+                break;
+            case OPT_CUSTOM:
+                printk("Would call 0x%08lx\n", param->var);
+                ((void (*)(const char *))param->var)(optval);
+                break;
+            default:
+                BUG();
+                break;
+            }
+        }
+    }
+}
diff -r 0049de3827bc -r 505992114832 extras/mini-os/include/cmdline.h
--- /dev/null
+++ b/extras/mini-os/include/cmdline.h
@@ -0,0 +1,63 @@
+#ifndef _MINIOS_CMDLINE_H
+#define _MINIOS_CMDLINE_H
+
+#include <mini-os/types.h>
+#include <sys/cdefs.h>
+
+#define __init __attribute__ ((__section__ (".text")))
+#define __initdata __attribute_used__ __attribute__ ((__section__ (".data")))
+#define __initsetup __attribute_used__ __attribute__ ((__section__ (".initsetup")))
+
+/*
+ * Used for kernel command line parameter setup
+ */
+struct kernel_param {
+    const char *name;
+    enum {
+        OPT_STR,
+        OPT_UINT,
+        OPT_BOOL,
+        OPT_INVBOOL,
+        OPT_SIZE,
+        OPT_CUSTOM
+    } type;
+    void *var;
+    unsigned int len;
+};
+
+extern struct kernel_param __setup_start, __setup_end;
+
+#define __setup_str static __initdata __attribute__((__aligned__(1))) char
+#define __kparam static __attribute_used__ __initsetup struct kernel_param
+
+#define custom_param(_name, _var) \
+    __setup_str __setup_str_##_var[] = _name; \
+    __kparam __setup_##_var = { __setup_str_##_var, OPT_CUSTOM, _var, 0 }
+#define boolean_param(_name, _var) \
+    __setup_str __setup_str_##_var[] = _name; \
+    __kparam __setup_##_var = \
+    { __setup_str_##_var, OPT_BOOL, &_var, sizeof(_var) }
+#define invbool_param(_name, _var) \
+    __setup_str __setup_str_##_var[] = _name; \
+    __kparam __setup_##_var = \
+    { __setup_str_##_var, OPT_INVBOOL, &_var, sizeof(_var) }
+#define integer_param(_name, _var) \
+    __setup_str __setup_str_##_var[] = _name; \
+    __kparam __setup_##_var = \
+    { __setup_str_##_var, OPT_UINT, &_var, sizeof(_var) }
+#define size_param(_name, _var) \
+    __setup_str __setup_str_##_var[] = _name; \
+    __kparam __setup_##_var = \
+    { __setup_str_##_var, OPT_SIZE, &_var, sizeof(_var) }
+#define string_param(_name, _var) \
+    __setup_str __setup_str_##_var[] = _name; \
+    __kparam __setup_##_var = \
+    { __setup_str_##_var, OPT_STR, &_var, sizeof(_var) }
+
+/* Make sure obsolete cmdline params don't break the build. */
+#define __setup(_name, _fn) static void * __attribute_used__ _dummy_##_fn = _fn
+
+
+void __init cmdline_parse(char *cmdline);
+
+#endif
diff -r 0049de3827bc -r 505992114832 extras/mini-os/include/lib-gpl.h
--- a/extras/mini-os/include/lib-gpl.h
+++ b/extras/mini-os/include/lib-gpl.h
@@ -33,10 +33,10 @@
 
 #ifndef HAVE_LIBC
 /* printing */
-extern unsigned long simple_strtoul(const char *,char **,unsigned int);
-extern long simple_strtol(const char *,char **,unsigned int);
-extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
-extern long long simple_strtoll(const char *,char **,unsigned int);
+extern unsigned long simple_strtoul(const char *,const char **,unsigned int);
+extern long simple_strtol(const char *,const char **,unsigned int);
+extern unsigned long long simple_strtoull(const char *,const char **,unsigned int);
+extern long long simple_strtoll(const char *,const char **,unsigned int);
 
 extern int sprintf(char * buf, const char * fmt, ...)
 	__attribute__ ((format (printf, 2, 3)));
diff -r 0049de3827bc -r 505992114832 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c
+++ b/extras/mini-os/kernel.c
@@ -42,6 +42,7 @@
 #include <mini-os/fbfront.h>
 #include <mini-os/pcifront.h>
 #include <mini-os/xmalloc.h>
+#include <mini-os/cmdline.h>
 #include <fcntl.h>
 #include <xen/features.h>
 #include <xen/version.h>
@@ -117,6 +118,10 @@ void start_kernel(start_info_t *si)
     /* Init the console driver. */
     init_console();
 
+    /* Parse the command line options. */
+    if ( si->cmd_line )
+        cmdline_parse((char*)si->cmd_line);
+
     /* Init grant tables */
     init_gnttab();
     
diff -r 0049de3827bc -r 505992114832 extras/mini-os/lib/printf.c
--- a/extras/mini-os/lib/printf.c
+++ b/extras/mini-os/lib/printf.c
@@ -63,7 +63,7 @@
  * @endp: A pointer to the end of the parsed string will be placed here
  * @base: The number base to use
  */
-unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base)
+unsigned long simple_strtoul(const char *cp,const char **endp,unsigned int base)
 {
     unsigned long result = 0,value;
 
@@ -94,7 +94,7 @@ unsigned long simple_strtoul(const char 
  * @endp: A pointer to the end of the parsed string will be placed here
  * @base: The number base to use
  */
-long simple_strtol(const char *cp,char **endp,unsigned int base)
+long simple_strtol(const char *cp,const char **endp,unsigned int base)
 {
     if(*cp=='-')
         return -simple_strtoul(cp+1,endp,base);
@@ -107,7 +107,7 @@ long simple_strtol(const char *cp,char *
  * @endp: A pointer to the end of the parsed string will be placed here
  * @base: The number base to use
  */
-unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base)
+unsigned long long simple_strtoull(const char *cp,const char **endp,unsigned int base)
 {
     unsigned long long result = 0,value;
 
@@ -138,7 +138,7 @@ unsigned long long simple_strtoull(const
  * @endp: A pointer to the end of the parsed string will be placed here
  * @base: The number base to use
  */
-long long simple_strtoll(const char *cp,char **endp,unsigned int base)
+long long simple_strtoll(const char *cp,const char **endp,unsigned int base)
 {
     if(*cp=='-')
         return -simple_strtoull(cp+1,endp,base);
@@ -559,7 +559,7 @@ int sprintf(char * buf, const char *fmt,
 int vsscanf(const char * buf, const char * fmt, va_list args)
 {
 	const char *str = buf;
-	char *next;
+	const char *next;
 	char digit;
 	int num = 0;
 	int qualifier;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:30:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:30:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1ZW-0000WX-2o; Mon, 26 Nov 2012 16:30:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1ZS-0000Vt-06
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:30:10 +0000
Received: from [85.158.139.211:40382] by server-7.bemta-5.messagelabs.com id
	7C/77-23096-11993B05; Mon, 26 Nov 2012 16:30:09 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1353947406!21579563!2
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27546 invoked from network); 26 Nov 2012 16:30:08 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:30:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215485650"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:30:05 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:30:05 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1Tz-0005Uf-Er;
	Mon, 26 Nov 2012 16:24:31 +0000
MIME-Version: 1.0
X-Mercurial-Node: 505992114832722bd63b4d0b593eae17da0657d6
Message-ID: <505992114832722bd63b.1353947049@andrewcoop.uk.xensource.com>
In-Reply-To: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:24:09 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 1 of 4] minios/cmdline: Port Xen command line
 argument handling to minios
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a direct port of the core command line functional, and some
tweaking with the linker setup.  It required adding some extra consts to
some of the library functions to compile.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 0049de3827bc -r 505992114832 extras/mini-os/Makefile
--- a/extras/mini-os/Makefile
+++ b/extras/mini-os/Makefile
@@ -76,6 +76,7 @@ src-$(CONFIG_BLKFRONT) += blkfront.c
 src-$(CONFIG_TPMFRONT) += tpmfront.c
 src-$(CONFIG_TPM_TIS) += tpm_tis.c
 src-$(CONFIG_TPMBACK) += tpmback.c
+src-y += cmdline.c
 src-y += daytime.c
 src-y += events.c
 src-$(CONFIG_FBFRONT) += fbfront.c
diff -r 0049de3827bc -r 505992114832 extras/mini-os/arch/x86/minios-x86_32.lds
--- a/extras/mini-os/arch/x86/minios-x86_32.lds
+++ b/extras/mini-os/arch/x86/minios-x86_32.lds
@@ -45,6 +45,9 @@ SECTIONS
 
   .data : {			/* Data */
 	*(.data)
+	__setup_start = .;
+	*(.initsetup)
+	__setup_end = .;
 	}
 
   _edata = .;			/* End of data section */
diff -r 0049de3827bc -r 505992114832 extras/mini-os/arch/x86/minios-x86_64.lds
--- a/extras/mini-os/arch/x86/minios-x86_64.lds
+++ b/extras/mini-os/arch/x86/minios-x86_64.lds
@@ -45,6 +45,9 @@ SECTIONS
 
   .data : {			/* Data */
 	*(.data)
+	__setup_start = .;
+	*(.initsetup)
+	__setup_end = .;
 	}
 
   _edata = .;			/* End of data section */
diff -r 0049de3827bc -r 505992114832 extras/mini-os/cmdline.c
--- /dev/null
+++ b/extras/mini-os/cmdline.c
@@ -0,0 +1,165 @@
+#include <mini-os/cmdline.h>
+#include <mini-os/lib.h>
+#include <mini-os/ctype.h>
+
+size_t strlcpy(char *dest, const char *src, size_t size)
+{
+	size_t ret = strlen(src);
+
+	if (size) {
+		size_t len = (ret >= size) ? size-1 : ret;
+		memcpy(dest, src, len);
+		dest[len] = '\0';
+	}
+	return ret;
+}
+
+unsigned long long parse_size_and_unit(const char *s, const char **ps)
+{
+    unsigned long long ret;
+    const char *s1;
+
+    ret = simple_strtoull(s, &s1, 0);
+
+    switch ( *s1 )
+    {
+    case 'G': case 'g':
+        ret <<= 10;
+    case 'M': case 'm':
+        ret <<= 10;
+    case 'K': case 'k':
+        ret <<= 10;
+    case 'B': case 'b':
+        s1++;
+        break;
+    default:
+        ret <<= 10; /* default to kB */
+        break;
+    }
+
+    if ( ps != NULL )
+        *ps = s1;
+
+    return ret;
+}
+
+static void __init assign_integer_param(
+    struct kernel_param *param, uint64_t val)
+{
+    switch ( param->len )
+    {
+    case sizeof(uint8_t):
+        *(uint8_t *)param->var = val;
+        break;
+    case sizeof(uint16_t):
+        *(uint16_t *)param->var = val;
+        break;
+    case sizeof(uint32_t):
+        *(uint32_t *)param->var = val;
+        break;
+    case sizeof(uint64_t):
+        *(uint64_t *)param->var = val;
+        break;
+    default:
+        BUG();
+    }
+}
+
+static int __init parse_bool(const char *s)
+{
+    if ( !strcmp("no", s) ||
+         !strcmp("off", s) ||
+         !strcmp("false", s) ||
+         !strcmp("disable", s) ||
+         !strcmp("0", s) )
+        return 0;
+
+    if ( !strcmp("yes", s) ||
+         !strcmp("on", s) ||
+         !strcmp("true", s) ||
+         !strcmp("enable", s) ||
+         !strcmp("1", s) )
+        return 1;
+
+    return -1;
+}
+
+void __init cmdline_parse(char *cmdline)
+{
+    char opt[100], *optval, *optkey, *q;
+    const char *p = cmdline;
+    struct kernel_param *param;
+    int bool_assert;
+
+    if ( p == NULL )
+        return;
+
+    for ( ; ; )
+    {
+        /* Skip whitespace. */
+        while ( *p == ' ' )
+            p++;
+        if ( *p == '\0' )
+            break;
+
+        /* Grab the next whitespace-delimited option. */
+        q = optkey = opt;
+        while ( (*p != ' ') && (*p != '\0') )
+        {
+            if ( (q-opt) < (sizeof(opt)-1) ) /* avoid overflow */
+                *q++ = *p;
+            p++;
+        }
+        *q = '\0';
+
+        /* Search for value part of a key=value option. */
+        optval = strchr(opt, '=');
+        if ( optval != NULL )
+            *optval++ = '\0'; /* nul-terminate the option value */
+        else
+            optval = q;       /* default option value is empty string */
+
+        /* Boolean parameters can be inverted with 'no-' prefix. */
+        bool_assert = !!strncmp("no-", optkey, 3);
+        if ( !bool_assert )
+            optkey += 3;
+
+        for ( param = &__setup_start; param < &__setup_end; param++ )
+        {
+            if ( strcmp(param->name, optkey) )
+                continue;
+
+            switch ( param->type )
+            {
+            case OPT_STR:
+                strlcpy(param->var, optval, param->len);
+                break;
+            case OPT_UINT:
+                assign_integer_param(
+                    param,
+                    simple_strtoll(optval, NULL, 0));
+                break;
+            case OPT_BOOL:
+            case OPT_INVBOOL:
+                if ( !parse_bool(optval) )
+                    bool_assert = !bool_assert;
+                assign_integer_param(
+                    param,
+                    (param->type == OPT_BOOL) == bool_assert);
+                break;
+            case OPT_SIZE:
+                assign_integer_param(
+                    param,
+                    parse_size_and_unit(optval, NULL));
+                break;
+            case OPT_CUSTOM:
+                printk("Would call 0x%08lx\n", param->var);
+                ((void (*)(const char *))param->var)(optval);
+                break;
+            default:
+                BUG();
+                break;
+            }
+        }
+    }
+}
diff -r 0049de3827bc -r 505992114832 extras/mini-os/include/cmdline.h
--- /dev/null
+++ b/extras/mini-os/include/cmdline.h
@@ -0,0 +1,63 @@
+#ifndef _MINIOS_CMDLINE_H
+#define _MINIOS_CMDLINE_H
+
+#include <mini-os/types.h>
+#include <sys/cdefs.h>
+
+#define __init __attribute__ ((__section__ (".text")))
+#define __initdata __attribute_used__ __attribute__ ((__section__ (".data")))
+#define __initsetup __attribute_used__ __attribute__ ((__section__ (".initsetup")))
+
+/*
+ * Used for kernel command line parameter setup
+ */
+struct kernel_param {
+    const char *name;
+    enum {
+        OPT_STR,
+        OPT_UINT,
+        OPT_BOOL,
+        OPT_INVBOOL,
+        OPT_SIZE,
+        OPT_CUSTOM
+    } type;
+    void *var;
+    unsigned int len;
+};
+
+extern struct kernel_param __setup_start, __setup_end;
+
+#define __setup_str static __initdata __attribute__((__aligned__(1))) char
+#define __kparam static __attribute_used__ __initsetup struct kernel_param
+
+#define custom_param(_name, _var) \
+    __setup_str __setup_str_##_var[] = _name; \
+    __kparam __setup_##_var = { __setup_str_##_var, OPT_CUSTOM, _var, 0 }
+#define boolean_param(_name, _var) \
+    __setup_str __setup_str_##_var[] = _name; \
+    __kparam __setup_##_var = \
+    { __setup_str_##_var, OPT_BOOL, &_var, sizeof(_var) }
+#define invbool_param(_name, _var) \
+    __setup_str __setup_str_##_var[] = _name; \
+    __kparam __setup_##_var = \
+    { __setup_str_##_var, OPT_INVBOOL, &_var, sizeof(_var) }
+#define integer_param(_name, _var) \
+    __setup_str __setup_str_##_var[] = _name; \
+    __kparam __setup_##_var = \
+    { __setup_str_##_var, OPT_UINT, &_var, sizeof(_var) }
+#define size_param(_name, _var) \
+    __setup_str __setup_str_##_var[] = _name; \
+    __kparam __setup_##_var = \
+    { __setup_str_##_var, OPT_SIZE, &_var, sizeof(_var) }
+#define string_param(_name, _var) \
+    __setup_str __setup_str_##_var[] = _name; \
+    __kparam __setup_##_var = \
+    { __setup_str_##_var, OPT_STR, &_var, sizeof(_var) }
+
+/* Make sure obsolete cmdline params don't break the build. */
+#define __setup(_name, _fn) static void * __attribute_used__ _dummy_##_fn = _fn
+
+
+void __init cmdline_parse(char *cmdline);
+
+#endif
diff -r 0049de3827bc -r 505992114832 extras/mini-os/include/lib-gpl.h
--- a/extras/mini-os/include/lib-gpl.h
+++ b/extras/mini-os/include/lib-gpl.h
@@ -33,10 +33,10 @@
 
 #ifndef HAVE_LIBC
 /* printing */
-extern unsigned long simple_strtoul(const char *,char **,unsigned int);
-extern long simple_strtol(const char *,char **,unsigned int);
-extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
-extern long long simple_strtoll(const char *,char **,unsigned int);
+extern unsigned long simple_strtoul(const char *,const char **,unsigned int);
+extern long simple_strtol(const char *,const char **,unsigned int);
+extern unsigned long long simple_strtoull(const char *,const char **,unsigned int);
+extern long long simple_strtoll(const char *,const char **,unsigned int);
 
 extern int sprintf(char * buf, const char * fmt, ...)
 	__attribute__ ((format (printf, 2, 3)));
diff -r 0049de3827bc -r 505992114832 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c
+++ b/extras/mini-os/kernel.c
@@ -42,6 +42,7 @@
 #include <mini-os/fbfront.h>
 #include <mini-os/pcifront.h>
 #include <mini-os/xmalloc.h>
+#include <mini-os/cmdline.h>
 #include <fcntl.h>
 #include <xen/features.h>
 #include <xen/version.h>
@@ -117,6 +118,10 @@ void start_kernel(start_info_t *si)
     /* Init the console driver. */
     init_console();
 
+    /* Parse the command line options. */
+    if ( si->cmd_line )
+        cmdline_parse((char*)si->cmd_line);
+
     /* Init grant tables */
     init_gnttab();
     
diff -r 0049de3827bc -r 505992114832 extras/mini-os/lib/printf.c
--- a/extras/mini-os/lib/printf.c
+++ b/extras/mini-os/lib/printf.c
@@ -63,7 +63,7 @@
  * @endp: A pointer to the end of the parsed string will be placed here
  * @base: The number base to use
  */
-unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base)
+unsigned long simple_strtoul(const char *cp,const char **endp,unsigned int base)
 {
     unsigned long result = 0,value;
 
@@ -94,7 +94,7 @@ unsigned long simple_strtoul(const char 
  * @endp: A pointer to the end of the parsed string will be placed here
  * @base: The number base to use
  */
-long simple_strtol(const char *cp,char **endp,unsigned int base)
+long simple_strtol(const char *cp,const char **endp,unsigned int base)
 {
     if(*cp=='-')
         return -simple_strtoul(cp+1,endp,base);
@@ -107,7 +107,7 @@ long simple_strtol(const char *cp,char *
  * @endp: A pointer to the end of the parsed string will be placed here
  * @base: The number base to use
  */
-unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base)
+unsigned long long simple_strtoull(const char *cp,const char **endp,unsigned int base)
 {
     unsigned long long result = 0,value;
 
@@ -138,7 +138,7 @@ unsigned long long simple_strtoull(const
  * @endp: A pointer to the end of the parsed string will be placed here
  * @base: The number base to use
  */
-long long simple_strtoll(const char *cp,char **endp,unsigned int base)
+long long simple_strtoll(const char *cp,const char **endp,unsigned int base)
 {
     if(*cp=='-')
         return -simple_strtoull(cp+1,endp,base);
@@ -559,7 +559,7 @@ int sprintf(char * buf, const char *fmt,
 int vsscanf(const char * buf, const char * fmt, va_list args)
 {
 	const char *str = buf;
-	char *next;
+	const char *next;
 	char digit;
 	int num = 0;
 	int qualifier;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:30:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:30:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1ZT-0000WH-MA; Mon, 26 Nov 2012 16:30:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1ZR-0000Vs-RZ
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:30:10 +0000
Received: from [193.109.254.147:19701] by server-1.bemta-14.messagelabs.com id
	FF/D9-25314-11993B05; Mon, 26 Nov 2012 16:30:09 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353947405!8617414!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU5NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2187 invoked from network); 26 Nov 2012 16:30:08 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:30:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="45627151"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:30:05 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:30:04 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1Tz-0005Uf-Fl;
	Mon, 26 Nov 2012 16:24:31 +0000
MIME-Version: 1.0
X-Mercurial-Node: 121ae49aabcb57d4c9d333b662140abef463e8d6
Message-ID: <121ae49aabcb57d4c9d3.1353947051@andrewcoop.uk.xensource.com>
In-Reply-To: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:24:11 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 3 of 4] minios/build: Introduce application
	directories
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Allow for separate application subdirectories when developing with
minios.

The new system allows a developer to run:

make XEN_TARGET_ARCH=<arch> APP=<foo>

While maintaining separate apps in apps/<foo>/

There is now a requirement to have apps/<foo>/app.mk which lists the
source files, and can provide application specific configuration of
settings.

The default application, daytime, has been moved to use this system, and
remains the default if no APP is provided to the invocation of make.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/Config.mk
--- a/extras/mini-os/Config.mk
+++ b/extras/mini-os/Config.mk
@@ -2,6 +2,10 @@
 MINI-OS_ROOT=$(XEN_ROOT)/extras/mini-os
 export MINI-OS_ROOT
 
+# Default to the daytime app
+MINIOS_APP_DIR := apps
+APP ?= daytime
+
 libc = $(stubdom)
 
 XEN_INTERFACE_VERSION := 0x00030205
diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/Makefile
--- a/extras/mini-os/Makefile
+++ b/extras/mini-os/Makefile
@@ -15,6 +15,9 @@ EXTRA_DEPS += $(MINIOS_CONFIG)
 include $(MINIOS_CONFIG)
 endif
 
+EXTRA_DEPS += $(MINIOS_APP_DIR)/$(APP)/app.mk
+include $(MINIOS_APP_DIR)/$(APP)/app.mk
+
 # Configuration defaults
 CONFIG_START_NETWORK ?= y
 CONFIG_SPARSE_BSS ?= y
@@ -77,7 +80,6 @@ src-$(CONFIG_TPMFRONT) += tpmfront.c
 src-$(CONFIG_TPM_TIS) += tpm_tis.c
 src-$(CONFIG_TPMBACK) += tpmback.c
 src-y += cmdline.c
-src-y += daytime.c
 src-y += events.c
 src-$(CONFIG_FBFRONT) += fbfront.c
 src-y += gntmap.c
@@ -108,7 +110,6 @@ src-y += console/xencons_ring.c
 src-$(CONFIG_CONSFRONT) += console/xenbus.c
 
 # The common mini-os objects to build.
-APP_OBJS :=
 OBJS := $(patsubst %.c,$(OBJ_DIR)/%.o,$(src-y))
 
 .PHONY: default
@@ -181,12 +182,15 @@ endif
 	$(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@
 	gzip -f -9 -c $@ >$@.gz
 
-.PHONY: clean arch_clean
+.PHONY: clean arch_clean apps_clean
 
 arch_clean:
 	$(MAKE) --directory=$(TARGET_ARCH_DIR) OBJ_DIR=$(OBJ_DIR)/$(TARGET_ARCH_DIR) clean || exit 1;
 
-clean:	arch_clean
+apps_clean:
+	find $(OBJ_DIR)/$(MINIOS_APP_DIR) -name '*.o' | xargs rm -f
+
+clean:	arch_clean apps_clean
 	for dir in $(addprefix $(OBJ_DIR)/,$(SUBDIRS)); do \
 		rm -f $$dir/*.o; \
 	done
diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/apps/daytime/app.mk
--- /dev/null
+++ b/extras/mini-os/apps/daytime/app.mk
@@ -0,0 +1,1 @@
+src-y += $(MINIOS_APP_DIR)/$(APP)/daytime.c
diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/apps/daytime/daytime.c
--- /dev/null
+++ b/extras/mini-os/apps/daytime/daytime.c
@@ -0,0 +1,67 @@
+/* 
+ * daytime.c: a simple network service based on lwIP and mini-os
+ * 
+ * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
+ */
+
+#include <os.h>
+#include <xmalloc.h>
+#include <console.h>
+#include <netfront.h>
+#include <lwip/api.h>
+
+static char message[29];
+
+void run_server(void *p)
+{
+    struct ip_addr listenaddr = { 0 };
+    struct netconn *listener;
+    struct netconn *session;
+    struct timeval tv;
+    err_t rc;
+
+    start_networking();
+
+    if (0) {
+        struct ip_addr ipaddr = { htonl(0x0a000001) };
+        struct ip_addr netmask = { htonl(0xff000000) };
+        struct ip_addr gw = { 0 };
+        networking_set_addr(&ipaddr, &netmask, &gw);
+    }
+
+    tprintk("Opening connection\n");
+
+    listener = netconn_new(NETCONN_TCP);
+    tprintk("Connection at %p\n", listener);
+
+    rc = netconn_bind(listener, &listenaddr, 13);
+    if (rc != ERR_OK) {
+        tprintk("Failed to bind connection: %i\n", rc);
+        return;
+    }
+
+    rc = netconn_listen(listener);
+    if (rc != ERR_OK) {
+        tprintk("Failed to listen on connection: %i\n", rc);
+        return;
+    }
+
+    while (1) {
+        session = netconn_accept(listener);
+        if (session == NULL) 
+            continue;
+
+        gettimeofday(&tv, NULL);
+        sprintf(message, "%20lu.%6.6lu\n", tv.tv_sec, tv.tv_usec);
+        (void) netconn_write(session, message, strlen(message), NETCONN_COPY);
+        (void) netconn_disconnect(session);
+        (void) netconn_delete(session);
+    }
+}
+
+
+int app_main(start_info_t *si)
+{
+    create_thread("server", run_server, NULL);
+    return 0;
+}
diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/daytime.c
--- a/extras/mini-os/daytime.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* 
- * daytime.c: a simple network service based on lwIP and mini-os
- * 
- * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
- */
-
-#include <os.h>
-#include <xmalloc.h>
-#include <console.h>
-#include <netfront.h>
-#include <lwip/api.h>
-
-static char message[29];
-
-void run_server(void *p)
-{
-    struct ip_addr listenaddr = { 0 };
-    struct netconn *listener;
-    struct netconn *session;
-    struct timeval tv;
-    err_t rc;
-
-    start_networking();
-
-    if (0) {
-        struct ip_addr ipaddr = { htonl(0x0a000001) };
-        struct ip_addr netmask = { htonl(0xff000000) };
-        struct ip_addr gw = { 0 };
-        networking_set_addr(&ipaddr, &netmask, &gw);
-    }
-
-    tprintk("Opening connection\n");
-
-    listener = netconn_new(NETCONN_TCP);
-    tprintk("Connection at %p\n", listener);
-
-    rc = netconn_bind(listener, &listenaddr, 13);
-    if (rc != ERR_OK) {
-        tprintk("Failed to bind connection: %i\n", rc);
-        return;
-    }
-
-    rc = netconn_listen(listener);
-    if (rc != ERR_OK) {
-        tprintk("Failed to listen on connection: %i\n", rc);
-        return;
-    }
-
-    while (1) {
-        session = netconn_accept(listener);
-        if (session == NULL) 
-            continue;
-
-        gettimeofday(&tv, NULL);
-        sprintf(message, "%20lu.%6.6lu\n", tv.tv_sec, tv.tv_usec);
-        (void) netconn_write(session, message, strlen(message), NETCONN_COPY);
-        (void) netconn_disconnect(session);
-        (void) netconn_delete(session);
-    }
-}
-
-
-int app_main(start_info_t *si)
-{
-    create_thread("server", run_server, NULL);
-    return 0;
-}

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:30:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:30:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1ZT-0000WH-MA; Mon, 26 Nov 2012 16:30:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1ZR-0000Vs-RZ
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:30:10 +0000
Received: from [193.109.254.147:19701] by server-1.bemta-14.messagelabs.com id
	FF/D9-25314-11993B05; Mon, 26 Nov 2012 16:30:09 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353947405!8617414!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU5NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2187 invoked from network); 26 Nov 2012 16:30:08 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:30:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="45627151"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:30:05 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:30:04 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1Tz-0005Uf-Fl;
	Mon, 26 Nov 2012 16:24:31 +0000
MIME-Version: 1.0
X-Mercurial-Node: 121ae49aabcb57d4c9d333b662140abef463e8d6
Message-ID: <121ae49aabcb57d4c9d3.1353947051@andrewcoop.uk.xensource.com>
In-Reply-To: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:24:11 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 3 of 4] minios/build: Introduce application
	directories
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Allow for separate application subdirectories when developing with
minios.

The new system allows a developer to run:

make XEN_TARGET_ARCH=<arch> APP=<foo>

While maintaining separate apps in apps/<foo>/

There is now a requirement to have apps/<foo>/app.mk which lists the
source files, and can provide application specific configuration of
settings.

The default application, daytime, has been moved to use this system, and
remains the default if no APP is provided to the invocation of make.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/Config.mk
--- a/extras/mini-os/Config.mk
+++ b/extras/mini-os/Config.mk
@@ -2,6 +2,10 @@
 MINI-OS_ROOT=$(XEN_ROOT)/extras/mini-os
 export MINI-OS_ROOT
 
+# Default to the daytime app
+MINIOS_APP_DIR := apps
+APP ?= daytime
+
 libc = $(stubdom)
 
 XEN_INTERFACE_VERSION := 0x00030205
diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/Makefile
--- a/extras/mini-os/Makefile
+++ b/extras/mini-os/Makefile
@@ -15,6 +15,9 @@ EXTRA_DEPS += $(MINIOS_CONFIG)
 include $(MINIOS_CONFIG)
 endif
 
+EXTRA_DEPS += $(MINIOS_APP_DIR)/$(APP)/app.mk
+include $(MINIOS_APP_DIR)/$(APP)/app.mk
+
 # Configuration defaults
 CONFIG_START_NETWORK ?= y
 CONFIG_SPARSE_BSS ?= y
@@ -77,7 +80,6 @@ src-$(CONFIG_TPMFRONT) += tpmfront.c
 src-$(CONFIG_TPM_TIS) += tpm_tis.c
 src-$(CONFIG_TPMBACK) += tpmback.c
 src-y += cmdline.c
-src-y += daytime.c
 src-y += events.c
 src-$(CONFIG_FBFRONT) += fbfront.c
 src-y += gntmap.c
@@ -108,7 +110,6 @@ src-y += console/xencons_ring.c
 src-$(CONFIG_CONSFRONT) += console/xenbus.c
 
 # The common mini-os objects to build.
-APP_OBJS :=
 OBJS := $(patsubst %.c,$(OBJ_DIR)/%.o,$(src-y))
 
 .PHONY: default
@@ -181,12 +182,15 @@ endif
 	$(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@
 	gzip -f -9 -c $@ >$@.gz
 
-.PHONY: clean arch_clean
+.PHONY: clean arch_clean apps_clean
 
 arch_clean:
 	$(MAKE) --directory=$(TARGET_ARCH_DIR) OBJ_DIR=$(OBJ_DIR)/$(TARGET_ARCH_DIR) clean || exit 1;
 
-clean:	arch_clean
+apps_clean:
+	find $(OBJ_DIR)/$(MINIOS_APP_DIR) -name '*.o' | xargs rm -f
+
+clean:	arch_clean apps_clean
 	for dir in $(addprefix $(OBJ_DIR)/,$(SUBDIRS)); do \
 		rm -f $$dir/*.o; \
 	done
diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/apps/daytime/app.mk
--- /dev/null
+++ b/extras/mini-os/apps/daytime/app.mk
@@ -0,0 +1,1 @@
+src-y += $(MINIOS_APP_DIR)/$(APP)/daytime.c
diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/apps/daytime/daytime.c
--- /dev/null
+++ b/extras/mini-os/apps/daytime/daytime.c
@@ -0,0 +1,67 @@
+/* 
+ * daytime.c: a simple network service based on lwIP and mini-os
+ * 
+ * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
+ */
+
+#include <os.h>
+#include <xmalloc.h>
+#include <console.h>
+#include <netfront.h>
+#include <lwip/api.h>
+
+static char message[29];
+
+void run_server(void *p)
+{
+    struct ip_addr listenaddr = { 0 };
+    struct netconn *listener;
+    struct netconn *session;
+    struct timeval tv;
+    err_t rc;
+
+    start_networking();
+
+    if (0) {
+        struct ip_addr ipaddr = { htonl(0x0a000001) };
+        struct ip_addr netmask = { htonl(0xff000000) };
+        struct ip_addr gw = { 0 };
+        networking_set_addr(&ipaddr, &netmask, &gw);
+    }
+
+    tprintk("Opening connection\n");
+
+    listener = netconn_new(NETCONN_TCP);
+    tprintk("Connection at %p\n", listener);
+
+    rc = netconn_bind(listener, &listenaddr, 13);
+    if (rc != ERR_OK) {
+        tprintk("Failed to bind connection: %i\n", rc);
+        return;
+    }
+
+    rc = netconn_listen(listener);
+    if (rc != ERR_OK) {
+        tprintk("Failed to listen on connection: %i\n", rc);
+        return;
+    }
+
+    while (1) {
+        session = netconn_accept(listener);
+        if (session == NULL) 
+            continue;
+
+        gettimeofday(&tv, NULL);
+        sprintf(message, "%20lu.%6.6lu\n", tv.tv_sec, tv.tv_usec);
+        (void) netconn_write(session, message, strlen(message), NETCONN_COPY);
+        (void) netconn_disconnect(session);
+        (void) netconn_delete(session);
+    }
+}
+
+
+int app_main(start_info_t *si)
+{
+    create_thread("server", run_server, NULL);
+    return 0;
+}
diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/daytime.c
--- a/extras/mini-os/daytime.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* 
- * daytime.c: a simple network service based on lwIP and mini-os
- * 
- * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
- */
-
-#include <os.h>
-#include <xmalloc.h>
-#include <console.h>
-#include <netfront.h>
-#include <lwip/api.h>
-
-static char message[29];
-
-void run_server(void *p)
-{
-    struct ip_addr listenaddr = { 0 };
-    struct netconn *listener;
-    struct netconn *session;
-    struct timeval tv;
-    err_t rc;
-
-    start_networking();
-
-    if (0) {
-        struct ip_addr ipaddr = { htonl(0x0a000001) };
-        struct ip_addr netmask = { htonl(0xff000000) };
-        struct ip_addr gw = { 0 };
-        networking_set_addr(&ipaddr, &netmask, &gw);
-    }
-
-    tprintk("Opening connection\n");
-
-    listener = netconn_new(NETCONN_TCP);
-    tprintk("Connection at %p\n", listener);
-
-    rc = netconn_bind(listener, &listenaddr, 13);
-    if (rc != ERR_OK) {
-        tprintk("Failed to bind connection: %i\n", rc);
-        return;
-    }
-
-    rc = netconn_listen(listener);
-    if (rc != ERR_OK) {
-        tprintk("Failed to listen on connection: %i\n", rc);
-        return;
-    }
-
-    while (1) {
-        session = netconn_accept(listener);
-        if (session == NULL) 
-            continue;
-
-        gettimeofday(&tv, NULL);
-        sprintf(message, "%20lu.%6.6lu\n", tv.tv_sec, tv.tv_usec);
-        (void) netconn_write(session, message, strlen(message), NETCONN_COPY);
-        (void) netconn_disconnect(session);
-        (void) netconn_delete(session);
-    }
-}
-
-
-int app_main(start_info_t *si)
-{
-    create_thread("server", run_server, NULL);
-    return 0;
-}

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:30:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:30:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1ZT-0000W6-8x; Mon, 26 Nov 2012 16:30:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1ZR-0000Vn-1m
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:30:09 +0000
Received: from [193.109.254.147:13728] by server-10.bemta-14.messagelabs.com
	id C8/75-31741-01993B05; Mon, 26 Nov 2012 16:30:08 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353947405!8617414!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU5NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2106 invoked from network); 26 Nov 2012 16:30:07 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:30:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="45627149"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:30:04 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:30:04 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1Tz-0005Uf-FJ;
	Mon, 26 Nov 2012 16:24:31 +0000
MIME-Version: 1.0
X-Mercurial-Node: 29138c27eb72e56027519150d20c8495cdec54f6
Message-ID: <29138c27eb72e5602751.1353947050@andrewcoop.uk.xensource.com>
In-Reply-To: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:24:10 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 2 of 4] minios/console: console_input() weak
	reference
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

In exactly the same style as app_main() in kernel.c, create a weak
reference console_input() function for applications to override to
quickly gain access to the console.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 505992114832 -r 29138c27eb72 extras/mini-os/console/console.c
--- a/extras/mini-os/console/console.c
+++ b/extras/mini-os/console/console.c
@@ -54,9 +54,7 @@
    NOTE: you need to enable verbose in xen/Rules.mk for it to work. */
 static int console_initialised = 0;
 
-
-#ifndef HAVE_LIBC
-void xencons_rx(char *buf, unsigned len, struct pt_regs *regs)
+__attribute__((weak)) void console_input(char * buf, unsigned len)
 {
     if(len > 0)
     {
@@ -69,6 +67,12 @@ void xencons_rx(char *buf, unsigned len,
     }
 }
 
+#ifndef HAVE_LIBC
+void xencons_rx(char *buf, unsigned len, struct pt_regs *regs)
+{
+    console_input(buf, len);
+}
+
 void xencons_tx(void)
 {
     /* Do nothing, handled by _rx */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:30:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:30:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1ZT-0000W6-8x; Mon, 26 Nov 2012 16:30:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1ZR-0000Vn-1m
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:30:09 +0000
Received: from [193.109.254.147:13728] by server-10.bemta-14.messagelabs.com
	id C8/75-31741-01993B05; Mon, 26 Nov 2012 16:30:08 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1353947405!8617414!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU5NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2106 invoked from network); 26 Nov 2012 16:30:07 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:30:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="45627149"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:30:04 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:30:04 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1Tz-0005Uf-FJ;
	Mon, 26 Nov 2012 16:24:31 +0000
MIME-Version: 1.0
X-Mercurial-Node: 29138c27eb72e56027519150d20c8495cdec54f6
Message-ID: <29138c27eb72e5602751.1353947050@andrewcoop.uk.xensource.com>
In-Reply-To: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:24:10 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 2 of 4] minios/console: console_input() weak
	reference
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

In exactly the same style as app_main() in kernel.c, create a weak
reference console_input() function for applications to override to
quickly gain access to the console.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 505992114832 -r 29138c27eb72 extras/mini-os/console/console.c
--- a/extras/mini-os/console/console.c
+++ b/extras/mini-os/console/console.c
@@ -54,9 +54,7 @@
    NOTE: you need to enable verbose in xen/Rules.mk for it to work. */
 static int console_initialised = 0;
 
-
-#ifndef HAVE_LIBC
-void xencons_rx(char *buf, unsigned len, struct pt_regs *regs)
+__attribute__((weak)) void console_input(char * buf, unsigned len)
 {
     if(len > 0)
     {
@@ -69,6 +67,12 @@ void xencons_rx(char *buf, unsigned len,
     }
 }
 
+#ifndef HAVE_LIBC
+void xencons_rx(char *buf, unsigned len, struct pt_regs *regs)
+{
+    console_input(buf, len);
+}
+
 void xencons_tx(void)
 {
     /* Do nothing, handled by _rx */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:32:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:32:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1bA-0000yg-LA; Mon, 26 Nov 2012 16:31:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td1b8-0000xT-TQ
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:31:55 +0000
Received: from [85.158.139.211:10277] by server-15.bemta-5.messagelabs.com id
	D2/62-26920-77993B05; Mon, 26 Nov 2012 16:31:51 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1353947510!19627746!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14764 invoked from network); 26 Nov 2012 16:31:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:31:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16006163"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:31:27 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 16:31:27 +0000
Message-ID: <1353947485.5830.104.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Mon, 26 Nov 2012 16:31:25 +0000
In-Reply-To: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 15:23 +0000, Jan Beulich wrote:
> The way it was coded, it clobbered %rdx without telling the compiler.
> This generally didn't cause any problems except when there are two back
> to back invocations (as in plt_overflow()), as in that case the
> compiler may validly assume that it can re-use for the second instance
> the value loaded into %rdx before the first one.
> 
> Once at it, also properly relax the second operand of "mul" (there's no
> need for it to be in %rdx, or a register at all), and switch away from
> using explicit register names in the instruction operands.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/arch/x86/time.c
> +++ b/xen/arch/x86/time.c
> @@ -127,8 +127,9 @@ static inline u64 scale_delta(u64 delta,
>          delta <<= scale->shift;
>  
>      asm (
> -        "mul %%rdx ; shrd $32,%%rdx,%%rax"
> -        : "=a" (product) : "0" (delta), "d" ((u64)scale->mul_frac) );
> +        "mul %2 ; shrd $32,%1,%0"
> +        : "=a" (product), "=d" (delta)
> +        : "rm" (delta), "0" ((u64)scale->mul_frac) );

OOI is there a reason to favour an output constraint overwriting delta,
which is then thrown away, over a straightforward clobber of rdx?

It took me ages to figure out that you had swapped which of the two
inputs to the multiply was in rax (I was very confused until I spotted
that!).

It's also a bit confusing to use %1 and %0 with the shrd since you
aren't actually using the things specified by the constraints but rather
the outputs of the mul which happen to (now) be in those registers, I'd
argue that the previous use of the explicit names was more correctly
describing what was going on. As it is I was wondering how
        shrd $32,delta,product
could possibly make sense.

Since delta is the first argument to the containing function would it be
helpful to put that in rax, where it already is due to the calling
convention? I suppose any difference is overwhelmed by the multiply
anyway.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:32:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:32:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1bA-0000yg-LA; Mon, 26 Nov 2012 16:31:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td1b8-0000xT-TQ
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:31:55 +0000
Received: from [85.158.139.211:10277] by server-15.bemta-5.messagelabs.com id
	D2/62-26920-77993B05; Mon, 26 Nov 2012 16:31:51 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1353947510!19627746!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14764 invoked from network); 26 Nov 2012 16:31:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:31:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16006163"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:31:27 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 16:31:27 +0000
Message-ID: <1353947485.5830.104.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Mon, 26 Nov 2012 16:31:25 +0000
In-Reply-To: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 15:23 +0000, Jan Beulich wrote:
> The way it was coded, it clobbered %rdx without telling the compiler.
> This generally didn't cause any problems except when there are two back
> to back invocations (as in plt_overflow()), as in that case the
> compiler may validly assume that it can re-use for the second instance
> the value loaded into %rdx before the first one.
> 
> Once at it, also properly relax the second operand of "mul" (there's no
> need for it to be in %rdx, or a register at all), and switch away from
> using explicit register names in the instruction operands.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/arch/x86/time.c
> +++ b/xen/arch/x86/time.c
> @@ -127,8 +127,9 @@ static inline u64 scale_delta(u64 delta,
>          delta <<= scale->shift;
>  
>      asm (
> -        "mul %%rdx ; shrd $32,%%rdx,%%rax"
> -        : "=a" (product) : "0" (delta), "d" ((u64)scale->mul_frac) );
> +        "mul %2 ; shrd $32,%1,%0"
> +        : "=a" (product), "=d" (delta)
> +        : "rm" (delta), "0" ((u64)scale->mul_frac) );

OOI is there a reason to favour an output constraint overwriting delta,
which is then thrown away, over a straightforward clobber of rdx?

It took me ages to figure out that you had swapped which of the two
inputs to the multiply was in rax (I was very confused until I spotted
that!).

It's also a bit confusing to use %1 and %0 with the shrd since you
aren't actually using the things specified by the constraints but rather
the outputs of the mul which happen to (now) be in those registers, I'd
argue that the previous use of the explicit names was more correctly
describing what was going on. As it is I was wondering how
        shrd $32,delta,product
could possibly make sense.

Since delta is the first argument to the containing function would it be
helpful to put that in rax, where it already is due to the calling
convention? I suppose any difference is overwhelmed by the multiply
anyway.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:36:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:36:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1fl-0001U4-Cg; Mon, 26 Nov 2012 16:36:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Td1fk-0001Tq-2o
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:36:40 +0000
Received: from [193.109.254.147:43233] by server-7.bemta-14.messagelabs.com id
	3F/C5-02272-79A93B05; Mon, 26 Nov 2012 16:36:39 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1353947796!1748517!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30268 invoked from network); 26 Nov 2012 16:36:37 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-27.messagelabs.com with SMTP;
	26 Nov 2012 16:36:37 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 16:36:36 +0000
Message-Id: <50B3A8DA02000078000AB460@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 16:37:30 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Lars Kurth <lars.kurth@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 16:58, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> Each new Xen release X.Y.0 starts a new stable maintenance branch.
> 
> Each such branch is in in its own mercurial repository
> xen-X.Y-testing.hg.

Should we indeed switch to git (which I'm in no way trying to
accelerate), one of the points I actually wanted to bring up is
this very duplication. I'm not sure about Mercurial in this regard,
but git certainly can easily deal with all branches in a single repo
(and the extra data volume and traffic shouldn't be so high that
it could be expected to cause problems to anyone).

> Releases happen roughly every 3 months. The first

... are intended to ...

> release on a stable branch is often sooner and as the branch reaches the
> end of its life the interval may be longer.
> 
> In general Xen.org supports the two most recent stable branches at any
> given time. When a new X.Y.0 release is made there is usually one more
> release on the to-be-retired stable branch to mop up any loose patches
> sitting in the repo at which point the branch is retired. For example we
> are currently in the 4.3 development cycle and are supporting two stable
> branches: 4.1-testing and 4.2-testing. After 4.2.0 was released there
> was one more release in the 4.0-testing stream (4.0.4 IIRC) and then the
> 4.0 branch was been retired.
> 
>         XXX how did Jan become stable maintainer, I think he just
>         volunteered at the developer meeting and was accepted via the
>         usual consensus driven approach? Lets try:
> 
> Each stable branch has a maintainer who is nominated/volunteers and is
> accepted via consensus among the maintainers and committers (XXX or just
> committers?). For the branches maintained by Xen.org this would usually
> be one of the xen-unstable committers or maintainers. However community
> members can step up to maintain a release once Xen.org no longer does so
> (e.g. as happened with Keith and xen-3.4-testing.hg).
> 
> Currently Jan Beulich is the stable maintainer for both 4.1-testing and
> 4.2-testing having taken over from Keir Fraser when 4.2.0 was released.
> Jan delegates tools backports to Ian Jackson. Community member Keith
> Coleman continues to maintain the 3.4-testing branch (XXX does he
> still?) which he took over when 4.1.0 was released.
> 
> No new development happens in the X.Y-testing branches, instead
> changesets are backported from xen-unstable. Where this is not possible
> (perhaps unstable has moved on such that the patch cannot be applied or
> the approach used in unstable is otherwise not valid for the stable
> branch) then a specific fix can be created for the stable branch.
> However it is a requirement that the issue will always be fixed in
> unstable first (this is to avoid regressions on the next stable

Did you mean "major" here?

> release).
> 
> In general only bug fixes are accepted into stable branches and new
> features are not normally accepted. (There can be exceptions, e.g. it
> was agreed that 4.2.1 would take a more relaxed approach to features
> which improved xl compatibility with xm). As time passes each stable
> branch becomes more conservative and the barrier to accepting a patch
> for backport becomes higher.
> 
> Changesets are nominated for inclusion in the stable branch by making a
> request to the stable maintainer on xen-devel either by noting it as
> such in the submission of the original patch to xen-unstable or by a
> subsequent explicit email to xen-devel.

I think we should explicitly require the person expected to do the
backport to be Cc-ed; I for myself don't get around to read _all_
mails on xen-devel, and hence with a badly chosen subject it is not
impossible (albeit also not likely) for me to miss such a request
otherwise.

Furthermore, the branch maintainer should imo explicitly be given
discretion to pull in patches without explicit request on the list (I
have been actively doing so thus far, and apparently not without
success, considering that post-RC1 there were no further
hypervisor side backports requested for either branch so far). In
the hopefully not very likely event that too much was backported,
a revert request would then need to be sent/discussed instead.

Jan

> In addition as part of the the
> stable release process the stable maintainer will send one or more
> requests to xen-devel soliciting suggestions for patches which should be
> included.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:36:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:36:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1fl-0001U4-Cg; Mon, 26 Nov 2012 16:36:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Td1fk-0001Tq-2o
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:36:40 +0000
Received: from [193.109.254.147:43233] by server-7.bemta-14.messagelabs.com id
	3F/C5-02272-79A93B05; Mon, 26 Nov 2012 16:36:39 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1353947796!1748517!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30268 invoked from network); 26 Nov 2012 16:36:37 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-15.tower-27.messagelabs.com with SMTP;
	26 Nov 2012 16:36:37 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 16:36:36 +0000
Message-Id: <50B3A8DA02000078000AB460@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 16:37:30 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Lars Kurth <lars.kurth@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 16:58, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> Each new Xen release X.Y.0 starts a new stable maintenance branch.
> 
> Each such branch is in in its own mercurial repository
> xen-X.Y-testing.hg.

Should we indeed switch to git (which I'm in no way trying to
accelerate), one of the points I actually wanted to bring up is
this very duplication. I'm not sure about Mercurial in this regard,
but git certainly can easily deal with all branches in a single repo
(and the extra data volume and traffic shouldn't be so high that
it could be expected to cause problems to anyone).

> Releases happen roughly every 3 months. The first

... are intended to ...

> release on a stable branch is often sooner and as the branch reaches the
> end of its life the interval may be longer.
> 
> In general Xen.org supports the two most recent stable branches at any
> given time. When a new X.Y.0 release is made there is usually one more
> release on the to-be-retired stable branch to mop up any loose patches
> sitting in the repo at which point the branch is retired. For example we
> are currently in the 4.3 development cycle and are supporting two stable
> branches: 4.1-testing and 4.2-testing. After 4.2.0 was released there
> was one more release in the 4.0-testing stream (4.0.4 IIRC) and then the
> 4.0 branch was been retired.
> 
>         XXX how did Jan become stable maintainer, I think he just
>         volunteered at the developer meeting and was accepted via the
>         usual consensus driven approach? Lets try:
> 
> Each stable branch has a maintainer who is nominated/volunteers and is
> accepted via consensus among the maintainers and committers (XXX or just
> committers?). For the branches maintained by Xen.org this would usually
> be one of the xen-unstable committers or maintainers. However community
> members can step up to maintain a release once Xen.org no longer does so
> (e.g. as happened with Keith and xen-3.4-testing.hg).
> 
> Currently Jan Beulich is the stable maintainer for both 4.1-testing and
> 4.2-testing having taken over from Keir Fraser when 4.2.0 was released.
> Jan delegates tools backports to Ian Jackson. Community member Keith
> Coleman continues to maintain the 3.4-testing branch (XXX does he
> still?) which he took over when 4.1.0 was released.
> 
> No new development happens in the X.Y-testing branches, instead
> changesets are backported from xen-unstable. Where this is not possible
> (perhaps unstable has moved on such that the patch cannot be applied or
> the approach used in unstable is otherwise not valid for the stable
> branch) then a specific fix can be created for the stable branch.
> However it is a requirement that the issue will always be fixed in
> unstable first (this is to avoid regressions on the next stable

Did you mean "major" here?

> release).
> 
> In general only bug fixes are accepted into stable branches and new
> features are not normally accepted. (There can be exceptions, e.g. it
> was agreed that 4.2.1 would take a more relaxed approach to features
> which improved xl compatibility with xm). As time passes each stable
> branch becomes more conservative and the barrier to accepting a patch
> for backport becomes higher.
> 
> Changesets are nominated for inclusion in the stable branch by making a
> request to the stable maintainer on xen-devel either by noting it as
> such in the submission of the original patch to xen-unstable or by a
> subsequent explicit email to xen-devel.

I think we should explicitly require the person expected to do the
backport to be Cc-ed; I for myself don't get around to read _all_
mails on xen-devel, and hence with a badly chosen subject it is not
impossible (albeit also not likely) for me to miss such a request
otherwise.

Furthermore, the branch maintainer should imo explicitly be given
discretion to pull in patches without explicit request on the list (I
have been actively doing so thus far, and apparently not without
success, considering that post-RC1 there were no further
hypervisor side backports requested for either branch so far). In
the hopefully not very likely event that too much was backported,
a revert request would then need to be sent/discussed instead.

Jan

> In addition as part of the the
> stable release process the stable maintainer will send one or more
> requests to xen-devel soliciting suggestions for patches which should be
> included.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:37:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:37:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1gN-0001b4-QY; Mon, 26 Nov 2012 16:37:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td1gM-0001ag-Ox
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:37:18 +0000
Received: from [85.158.137.99:58125] by server-9.bemta-3.messagelabs.com id
	38/58-02388-9BA93B05; Mon, 26 Nov 2012 16:37:13 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1353947832!17516700!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30400 invoked from network); 26 Nov 2012 16:37:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:37:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16006296"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:36:56 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 16:36:56 +0000
Message-ID: <1353947815.5830.108.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Date: Mon, 26 Nov 2012 16:36:55 +0000
In-Reply-To: <505992114832722bd63b.1353947049@andrewcoop.uk.xensource.com>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
	<505992114832722bd63b.1353947049@andrewcoop.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1 of 4] minios/cmdline: Port Xen command
 line argument handling to minios
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 16:24 +0000, Andrew Cooper wrote:
> This is a direct port of the core command line functional,

Careful: Xen is GPL while mini-os is BSD.

You would need to track down all the contributors to the relevant bits
of Xen if you want to relicense it (this may be trival-ish in practice,
I doubt many people touch this area).

If you don't want to relicense then it needs to be conditionally
compiled and the statement about GPL submodules in
extras/mini-os/COPYING needs to be extended to include it.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:37:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:37:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1gN-0001b4-QY; Mon, 26 Nov 2012 16:37:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td1gM-0001ag-Ox
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:37:18 +0000
Received: from [85.158.137.99:58125] by server-9.bemta-3.messagelabs.com id
	38/58-02388-9BA93B05; Mon, 26 Nov 2012 16:37:13 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1353947832!17516700!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30400 invoked from network); 26 Nov 2012 16:37:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:37:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16006296"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:36:56 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 16:36:56 +0000
Message-ID: <1353947815.5830.108.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Date: Mon, 26 Nov 2012 16:36:55 +0000
In-Reply-To: <505992114832722bd63b.1353947049@andrewcoop.uk.xensource.com>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
	<505992114832722bd63b.1353947049@andrewcoop.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1 of 4] minios/cmdline: Port Xen command
 line argument handling to minios
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 16:24 +0000, Andrew Cooper wrote:
> This is a direct port of the core command line functional,

Careful: Xen is GPL while mini-os is BSD.

You would need to track down all the contributors to the relevant bits
of Xen if you want to relicense it (this may be trival-ish in practice,
I doubt many people touch this area).

If you don't want to relicense then it needs to be conditionally
compiled and the statement about GPL submodules in
extras/mini-os/COPYING needs to be extended to include it.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:38:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:38:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1hR-0001mj-9v; Mon, 26 Nov 2012 16:38:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td1hP-0001mT-T9
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:38:24 +0000
Received: from [193.109.254.147:2525] by server-16.bemta-14.messagelabs.com id
	CD/82-09215-FFA93B05; Mon, 26 Nov 2012 16:38:23 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1353947901!8488675!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19413 invoked from network); 26 Nov 2012 16:38:22 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:38:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16006347"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:38:21 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 16:38:21 +0000
Message-ID: <1353947900.5830.109.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Date: Mon, 26 Nov 2012 16:38:20 +0000
In-Reply-To: <121ae49aabcb57d4c9d3.1353947051@andrewcoop.uk.xensource.com>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
	<121ae49aabcb57d4c9d3.1353947051@andrewcoop.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 3 of 4] minios/build: Introduce application
 directories
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 16:24 +0000, Andrew Cooper wrote:
> Allow for separate application subdirectories when developing with
> minios.
> 
> The new system allows a developer to run:
> 
> make XEN_TARGET_ARCH=<arch> APP=<foo>
> 
> While maintaining separate apps in apps/<foo>/
> 
> There is now a requirement to have apps/<foo>/app.mk which lists the
> source files, and can provide application specific configuration of
> settings.

How does this affect building stub domains?

> The default application, daytime, has been moved to use this system, and
> remains the default if no APP is provided to the invocation of make.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/Config.mk
> --- a/extras/mini-os/Config.mk
> +++ b/extras/mini-os/Config.mk
> @@ -2,6 +2,10 @@
>  MINI-OS_ROOT=$(XEN_ROOT)/extras/mini-os
>  export MINI-OS_ROOT
>  
> +# Default to the daytime app
> +MINIOS_APP_DIR := apps
> +APP ?= daytime
> +
>  libc = $(stubdom)
>  
>  XEN_INTERFACE_VERSION := 0x00030205
> diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/Makefile
> --- a/extras/mini-os/Makefile
> +++ b/extras/mini-os/Makefile
> @@ -15,6 +15,9 @@ EXTRA_DEPS += $(MINIOS_CONFIG)
>  include $(MINIOS_CONFIG)
>  endif
>  
> +EXTRA_DEPS += $(MINIOS_APP_DIR)/$(APP)/app.mk
> +include $(MINIOS_APP_DIR)/$(APP)/app.mk
> +
>  # Configuration defaults
>  CONFIG_START_NETWORK ?= y
>  CONFIG_SPARSE_BSS ?= y
> @@ -77,7 +80,6 @@ src-$(CONFIG_TPMFRONT) += tpmfront.c
>  src-$(CONFIG_TPM_TIS) += tpm_tis.c
>  src-$(CONFIG_TPMBACK) += tpmback.c
>  src-y += cmdline.c
> -src-y += daytime.c
>  src-y += events.c
>  src-$(CONFIG_FBFRONT) += fbfront.c
>  src-y += gntmap.c
> @@ -108,7 +110,6 @@ src-y += console/xencons_ring.c
>  src-$(CONFIG_CONSFRONT) += console/xenbus.c
>  
>  # The common mini-os objects to build.
> -APP_OBJS :=
>  OBJS := $(patsubst %.c,$(OBJ_DIR)/%.o,$(src-y))
>  
>  .PHONY: default
> @@ -181,12 +182,15 @@ endif
>  	$(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@
>  	gzip -f -9 -c $@ >$@.gz
>  
> -.PHONY: clean arch_clean
> +.PHONY: clean arch_clean apps_clean
>  
>  arch_clean:
>  	$(MAKE) --directory=$(TARGET_ARCH_DIR) OBJ_DIR=$(OBJ_DIR)/$(TARGET_ARCH_DIR) clean || exit 1;
>  
> -clean:	arch_clean
> +apps_clean:
> +	find $(OBJ_DIR)/$(MINIOS_APP_DIR) -name '*.o' | xargs rm -f
> +
> +clean:	arch_clean apps_clean
>  	for dir in $(addprefix $(OBJ_DIR)/,$(SUBDIRS)); do \
>  		rm -f $$dir/*.o; \
>  	done
> diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/apps/daytime/app.mk
> --- /dev/null
> +++ b/extras/mini-os/apps/daytime/app.mk
> @@ -0,0 +1,1 @@
> +src-y += $(MINIOS_APP_DIR)/$(APP)/daytime.c
> diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/apps/daytime/daytime.c
> --- /dev/null
> +++ b/extras/mini-os/apps/daytime/daytime.c
> @@ -0,0 +1,67 @@
> +/* 
> + * daytime.c: a simple network service based on lwIP and mini-os
> + * 
> + * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
> + */
> +
> +#include <os.h>
> +#include <xmalloc.h>
> +#include <console.h>
> +#include <netfront.h>
> +#include <lwip/api.h>
> +
> +static char message[29];
> +
> +void run_server(void *p)
> +{
> +    struct ip_addr listenaddr = { 0 };
> +    struct netconn *listener;
> +    struct netconn *session;
> +    struct timeval tv;
> +    err_t rc;
> +
> +    start_networking();
> +
> +    if (0) {
> +        struct ip_addr ipaddr = { htonl(0x0a000001) };
> +        struct ip_addr netmask = { htonl(0xff000000) };
> +        struct ip_addr gw = { 0 };
> +        networking_set_addr(&ipaddr, &netmask, &gw);
> +    }
> +
> +    tprintk("Opening connection\n");
> +
> +    listener = netconn_new(NETCONN_TCP);
> +    tprintk("Connection at %p\n", listener);
> +
> +    rc = netconn_bind(listener, &listenaddr, 13);
> +    if (rc != ERR_OK) {
> +        tprintk("Failed to bind connection: %i\n", rc);
> +        return;
> +    }
> +
> +    rc = netconn_listen(listener);
> +    if (rc != ERR_OK) {
> +        tprintk("Failed to listen on connection: %i\n", rc);
> +        return;
> +    }
> +
> +    while (1) {
> +        session = netconn_accept(listener);
> +        if (session == NULL) 
> +            continue;
> +
> +        gettimeofday(&tv, NULL);
> +        sprintf(message, "%20lu.%6.6lu\n", tv.tv_sec, tv.tv_usec);
> +        (void) netconn_write(session, message, strlen(message), NETCONN_COPY);
> +        (void) netconn_disconnect(session);
> +        (void) netconn_delete(session);
> +    }
> +}
> +
> +
> +int app_main(start_info_t *si)
> +{
> +    create_thread("server", run_server, NULL);
> +    return 0;
> +}
> diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/daytime.c
> --- a/extras/mini-os/daytime.c
> +++ /dev/null
> @@ -1,67 +0,0 @@
> -/* 
> - * daytime.c: a simple network service based on lwIP and mini-os
> - * 
> - * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
> - */
> -
> -#include <os.h>
> -#include <xmalloc.h>
> -#include <console.h>
> -#include <netfront.h>
> -#include <lwip/api.h>
> -
> -static char message[29];
> -
> -void run_server(void *p)
> -{
> -    struct ip_addr listenaddr = { 0 };
> -    struct netconn *listener;
> -    struct netconn *session;
> -    struct timeval tv;
> -    err_t rc;
> -
> -    start_networking();
> -
> -    if (0) {
> -        struct ip_addr ipaddr = { htonl(0x0a000001) };
> -        struct ip_addr netmask = { htonl(0xff000000) };
> -        struct ip_addr gw = { 0 };
> -        networking_set_addr(&ipaddr, &netmask, &gw);
> -    }
> -
> -    tprintk("Opening connection\n");
> -
> -    listener = netconn_new(NETCONN_TCP);
> -    tprintk("Connection at %p\n", listener);
> -
> -    rc = netconn_bind(listener, &listenaddr, 13);
> -    if (rc != ERR_OK) {
> -        tprintk("Failed to bind connection: %i\n", rc);
> -        return;
> -    }
> -
> -    rc = netconn_listen(listener);
> -    if (rc != ERR_OK) {
> -        tprintk("Failed to listen on connection: %i\n", rc);
> -        return;
> -    }
> -
> -    while (1) {
> -        session = netconn_accept(listener);
> -        if (session == NULL) 
> -            continue;
> -
> -        gettimeofday(&tv, NULL);
> -        sprintf(message, "%20lu.%6.6lu\n", tv.tv_sec, tv.tv_usec);
> -        (void) netconn_write(session, message, strlen(message), NETCONN_COPY);
> -        (void) netconn_disconnect(session);
> -        (void) netconn_delete(session);
> -    }
> -}
> -
> -
> -int app_main(start_info_t *si)
> -{
> -    create_thread("server", run_server, NULL);
> -    return 0;
> -}
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:38:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:38:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1hR-0001mj-9v; Mon, 26 Nov 2012 16:38:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td1hP-0001mT-T9
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:38:24 +0000
Received: from [193.109.254.147:2525] by server-16.bemta-14.messagelabs.com id
	CD/82-09215-FFA93B05; Mon, 26 Nov 2012 16:38:23 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1353947901!8488675!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19413 invoked from network); 26 Nov 2012 16:38:22 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:38:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16006347"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:38:21 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 16:38:21 +0000
Message-ID: <1353947900.5830.109.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Date: Mon, 26 Nov 2012 16:38:20 +0000
In-Reply-To: <121ae49aabcb57d4c9d3.1353947051@andrewcoop.uk.xensource.com>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
	<121ae49aabcb57d4c9d3.1353947051@andrewcoop.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 3 of 4] minios/build: Introduce application
 directories
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 16:24 +0000, Andrew Cooper wrote:
> Allow for separate application subdirectories when developing with
> minios.
> 
> The new system allows a developer to run:
> 
> make XEN_TARGET_ARCH=<arch> APP=<foo>
> 
> While maintaining separate apps in apps/<foo>/
> 
> There is now a requirement to have apps/<foo>/app.mk which lists the
> source files, and can provide application specific configuration of
> settings.

How does this affect building stub domains?

> The default application, daytime, has been moved to use this system, and
> remains the default if no APP is provided to the invocation of make.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/Config.mk
> --- a/extras/mini-os/Config.mk
> +++ b/extras/mini-os/Config.mk
> @@ -2,6 +2,10 @@
>  MINI-OS_ROOT=$(XEN_ROOT)/extras/mini-os
>  export MINI-OS_ROOT
>  
> +# Default to the daytime app
> +MINIOS_APP_DIR := apps
> +APP ?= daytime
> +
>  libc = $(stubdom)
>  
>  XEN_INTERFACE_VERSION := 0x00030205
> diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/Makefile
> --- a/extras/mini-os/Makefile
> +++ b/extras/mini-os/Makefile
> @@ -15,6 +15,9 @@ EXTRA_DEPS += $(MINIOS_CONFIG)
>  include $(MINIOS_CONFIG)
>  endif
>  
> +EXTRA_DEPS += $(MINIOS_APP_DIR)/$(APP)/app.mk
> +include $(MINIOS_APP_DIR)/$(APP)/app.mk
> +
>  # Configuration defaults
>  CONFIG_START_NETWORK ?= y
>  CONFIG_SPARSE_BSS ?= y
> @@ -77,7 +80,6 @@ src-$(CONFIG_TPMFRONT) += tpmfront.c
>  src-$(CONFIG_TPM_TIS) += tpm_tis.c
>  src-$(CONFIG_TPMBACK) += tpmback.c
>  src-y += cmdline.c
> -src-y += daytime.c
>  src-y += events.c
>  src-$(CONFIG_FBFRONT) += fbfront.c
>  src-y += gntmap.c
> @@ -108,7 +110,6 @@ src-y += console/xencons_ring.c
>  src-$(CONFIG_CONSFRONT) += console/xenbus.c
>  
>  # The common mini-os objects to build.
> -APP_OBJS :=
>  OBJS := $(patsubst %.c,$(OBJ_DIR)/%.o,$(src-y))
>  
>  .PHONY: default
> @@ -181,12 +182,15 @@ endif
>  	$(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@
>  	gzip -f -9 -c $@ >$@.gz
>  
> -.PHONY: clean arch_clean
> +.PHONY: clean arch_clean apps_clean
>  
>  arch_clean:
>  	$(MAKE) --directory=$(TARGET_ARCH_DIR) OBJ_DIR=$(OBJ_DIR)/$(TARGET_ARCH_DIR) clean || exit 1;
>  
> -clean:	arch_clean
> +apps_clean:
> +	find $(OBJ_DIR)/$(MINIOS_APP_DIR) -name '*.o' | xargs rm -f
> +
> +clean:	arch_clean apps_clean
>  	for dir in $(addprefix $(OBJ_DIR)/,$(SUBDIRS)); do \
>  		rm -f $$dir/*.o; \
>  	done
> diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/apps/daytime/app.mk
> --- /dev/null
> +++ b/extras/mini-os/apps/daytime/app.mk
> @@ -0,0 +1,1 @@
> +src-y += $(MINIOS_APP_DIR)/$(APP)/daytime.c
> diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/apps/daytime/daytime.c
> --- /dev/null
> +++ b/extras/mini-os/apps/daytime/daytime.c
> @@ -0,0 +1,67 @@
> +/* 
> + * daytime.c: a simple network service based on lwIP and mini-os
> + * 
> + * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
> + */
> +
> +#include <os.h>
> +#include <xmalloc.h>
> +#include <console.h>
> +#include <netfront.h>
> +#include <lwip/api.h>
> +
> +static char message[29];
> +
> +void run_server(void *p)
> +{
> +    struct ip_addr listenaddr = { 0 };
> +    struct netconn *listener;
> +    struct netconn *session;
> +    struct timeval tv;
> +    err_t rc;
> +
> +    start_networking();
> +
> +    if (0) {
> +        struct ip_addr ipaddr = { htonl(0x0a000001) };
> +        struct ip_addr netmask = { htonl(0xff000000) };
> +        struct ip_addr gw = { 0 };
> +        networking_set_addr(&ipaddr, &netmask, &gw);
> +    }
> +
> +    tprintk("Opening connection\n");
> +
> +    listener = netconn_new(NETCONN_TCP);
> +    tprintk("Connection at %p\n", listener);
> +
> +    rc = netconn_bind(listener, &listenaddr, 13);
> +    if (rc != ERR_OK) {
> +        tprintk("Failed to bind connection: %i\n", rc);
> +        return;
> +    }
> +
> +    rc = netconn_listen(listener);
> +    if (rc != ERR_OK) {
> +        tprintk("Failed to listen on connection: %i\n", rc);
> +        return;
> +    }
> +
> +    while (1) {
> +        session = netconn_accept(listener);
> +        if (session == NULL) 
> +            continue;
> +
> +        gettimeofday(&tv, NULL);
> +        sprintf(message, "%20lu.%6.6lu\n", tv.tv_sec, tv.tv_usec);
> +        (void) netconn_write(session, message, strlen(message), NETCONN_COPY);
> +        (void) netconn_disconnect(session);
> +        (void) netconn_delete(session);
> +    }
> +}
> +
> +
> +int app_main(start_info_t *si)
> +{
> +    create_thread("server", run_server, NULL);
> +    return 0;
> +}
> diff -r 29138c27eb72 -r 121ae49aabcb extras/mini-os/daytime.c
> --- a/extras/mini-os/daytime.c
> +++ /dev/null
> @@ -1,67 +0,0 @@
> -/* 
> - * daytime.c: a simple network service based on lwIP and mini-os
> - * 
> - * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
> - */
> -
> -#include <os.h>
> -#include <xmalloc.h>
> -#include <console.h>
> -#include <netfront.h>
> -#include <lwip/api.h>
> -
> -static char message[29];
> -
> -void run_server(void *p)
> -{
> -    struct ip_addr listenaddr = { 0 };
> -    struct netconn *listener;
> -    struct netconn *session;
> -    struct timeval tv;
> -    err_t rc;
> -
> -    start_networking();
> -
> -    if (0) {
> -        struct ip_addr ipaddr = { htonl(0x0a000001) };
> -        struct ip_addr netmask = { htonl(0xff000000) };
> -        struct ip_addr gw = { 0 };
> -        networking_set_addr(&ipaddr, &netmask, &gw);
> -    }
> -
> -    tprintk("Opening connection\n");
> -
> -    listener = netconn_new(NETCONN_TCP);
> -    tprintk("Connection at %p\n", listener);
> -
> -    rc = netconn_bind(listener, &listenaddr, 13);
> -    if (rc != ERR_OK) {
> -        tprintk("Failed to bind connection: %i\n", rc);
> -        return;
> -    }
> -
> -    rc = netconn_listen(listener);
> -    if (rc != ERR_OK) {
> -        tprintk("Failed to listen on connection: %i\n", rc);
> -        return;
> -    }
> -
> -    while (1) {
> -        session = netconn_accept(listener);
> -        if (session == NULL) 
> -            continue;
> -
> -        gettimeofday(&tv, NULL);
> -        sprintf(message, "%20lu.%6.6lu\n", tv.tv_sec, tv.tv_usec);
> -        (void) netconn_write(session, message, strlen(message), NETCONN_COPY);
> -        (void) netconn_disconnect(session);
> -        (void) netconn_delete(session);
> -    }
> -}
> -
> -
> -int app_main(start_info_t *si)
> -{
> -    create_thread("server", run_server, NULL);
> -    return 0;
> -}
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:42:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:42:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1km-00025K-M6; Mon, 26 Nov 2012 16:41:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1kl-00024Q-C1
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:41:51 +0000
Received: from [85.158.139.83:37670] by server-9.bemta-5.messagelabs.com id
	E9/95-29295-ECB93B05; Mon, 26 Nov 2012 16:41:50 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1353948108!29279169!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30913 invoked from network); 26 Nov 2012 16:41:50 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:41:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215487538"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:41:46 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:41:46 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1kg-0005lj-1h;
	Mon, 26 Nov 2012 16:41:46 +0000
MIME-Version: 1.0
X-Mercurial-Node: 8dbcbde1391497fc7d94f4c56d8cc03b610db3aa
Message-ID: <8dbcbde1391497fc7d94.1353948095@andrewcoop.uk.xensource.com>
In-Reply-To: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:41:35 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 4 of 5] rombios/ata Remove more needless traps
 from the int 0x13 path
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The return value from await_ide() is always ignored, and most calls to await_ide()
immediately reread the status register.

Therefore, making await_ide() return the last value of the status register removes
a further two traps on the int 0x13 path, with a similar reduction in the total
number of traps during Win7 boot.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r a8645d836a0e -r 8dbcbde13914 tools/firmware/rombios/rombios.c
--- a/tools/firmware/rombios/rombios.c
+++ b/tools/firmware/rombios/rombios.c
@@ -2531,14 +2531,14 @@ void ata_init( )
 
 #define IDE_TIMEOUT 32000u //32 seconds max for IDE ops
 
-int await_ide();
-static int await_ide(when_done,base,timeout)
+Bit8u await_ide();
+static Bit8u await_ide(when_done,base,timeout)
   Bit8u when_done;
   Bit16u base;
   Bit16u timeout;
 {
   Bit32u time=0,last=0;
-  Bit16u status;
+  Bit8u status;
   Bit8u result;
   for(;;) {
     status = inb(base+ATA_CB_STAT);
@@ -2556,7 +2556,7 @@ static int await_ide(when_done,base,time
     else if (when_done == TIMEOUT)
       result = 0;
 
-    if (result) return 0;
+    if (result) return status;
     if (time>>16 != last) // mod 2048 each 16 ms
     {
       last = time >>16;
@@ -2565,12 +2565,12 @@ static int await_ide(when_done,base,time
     if (status & ATA_CB_STAT_ERR)
     {
       BX_DEBUG_ATA("await_ide: ERROR (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) %d time= %ld timeout= %d\n",when_done,time>>11, timeout);
-      return -1;
+      return status;
     }
     if ((timeout == 0) || ((time>>11) > timeout)) break;
   }
   BX_INFO("IDE time out\n");
-  return -1;
+  return status;
 }
 
 // ---------------------------------------------------------------------------
@@ -3016,8 +3016,7 @@ Bit32u lba_low, lba_high;
   outb(iobase1 + ATA_CB_DH, (slave ? ATA_CB_DH_DEV1 : ATA_CB_DH_DEV0) | (Bit8u) head );
   outb(iobase1 + ATA_CB_CMD, command);
 
-  await_ide(NOT_BSY_DRQ, iobase1, IDE_TIMEOUT);
-  status = inb(iobase1 + ATA_CB_STAT);
+  status = await_ide(NOT_BSY_DRQ, iobase1, IDE_TIMEOUT);
 
   if (status & ATA_CB_STAT_ERR) {
     BX_DEBUG_ATA("ata_cmd_data_in : read error\n");
@@ -3077,8 +3076,7 @@ ASM_END
     current++;
     write_word(ebda_seg, &EbdaData->ata.trsfsectors,current);
     count--;
-    await_ide(NOT_BSY, iobase1, IDE_TIMEOUT);
-    status = inb(iobase1 + ATA_CB_STAT);
+    status = await_ide(NOT_BSY, iobase1, IDE_TIMEOUT);
     if (count == 0) {
       if ( (status & (ATA_CB_STAT_BSY | ATA_CB_STAT_RDY | ATA_CB_STAT_DRQ | ATA_CB_STAT_ERR) )
           != ATA_CB_STAT_RDY ) {
@@ -3167,8 +3165,7 @@ Bit32u lba_low, lba_high;
   outb(iobase1 + ATA_CB_DH, (slave ? ATA_CB_DH_DEV1 : ATA_CB_DH_DEV0) | (Bit8u) head );
   outb(iobase1 + ATA_CB_CMD, command);
 
-  await_ide(NOT_BSY_DRQ, iobase1, IDE_TIMEOUT);
-  status = inb(iobase1 + ATA_CB_STAT);
+  status = await_ide(NOT_BSY_DRQ, iobase1, IDE_TIMEOUT);
 
   if (status & ATA_CB_STAT_ERR) {
     BX_DEBUG_ATA("ata_cmd_data_out : read error\n");
@@ -3316,8 +3313,7 @@ Bit32u length;
   outb(iobase1 + ATA_CB_CMD, ATA_CMD_PACKET);
 
   // Device should ok to receive command
-  await_ide(NOT_BSY_DRQ, iobase1, IDE_TIMEOUT);
-  status = inb(iobase1 + ATA_CB_STAT);
+  status = await_ide(NOT_BSY_DRQ, iobase1, IDE_TIMEOUT);
 
   if (status & ATA_CB_STAT_ERR) {
     BX_DEBUG_ATA("ata_cmd_packet : error, status is %02x\n",status);
@@ -3353,8 +3349,7 @@ ASM_START
 ASM_END
 
   if (inout == ATA_DATA_NO) {
-    await_ide(NOT_BSY, iobase1, IDE_TIMEOUT);
-    status = inb(iobase1 + ATA_CB_STAT);
+    status = await_ide(NOT_BSY, iobase1, IDE_TIMEOUT);
     }
   else {
         Bit16u loops = 0;
@@ -3363,13 +3358,12 @@ ASM_END
 
       if (loops == 0) {//first time through
         status = inb(iobase2 + ATA_CB_ASTAT);
-        await_ide(NOT_BSY_DRQ, iobase1, IDE_TIMEOUT);
+        status = await_ide(NOT_BSY_DRQ, iobase1, IDE_TIMEOUT);
       }
       else
-        await_ide(NOT_BSY, iobase1, IDE_TIMEOUT);
+        status = await_ide(NOT_BSY, iobase1, IDE_TIMEOUT);
       loops++;
 
-      status = inb(iobase1 + ATA_CB_STAT);
       sc = inb(iobase1 + ATA_CB_SC);
 
       // Check if command completed

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:42:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:42:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1km-00025K-M6; Mon, 26 Nov 2012 16:41:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1kl-00024Q-C1
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:41:51 +0000
Received: from [85.158.139.83:37670] by server-9.bemta-5.messagelabs.com id
	E9/95-29295-ECB93B05; Mon, 26 Nov 2012 16:41:50 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1353948108!29279169!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30913 invoked from network); 26 Nov 2012 16:41:50 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:41:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215487538"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:41:46 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:41:46 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1kg-0005lj-1h;
	Mon, 26 Nov 2012 16:41:46 +0000
MIME-Version: 1.0
X-Mercurial-Node: 8dbcbde1391497fc7d94f4c56d8cc03b610db3aa
Message-ID: <8dbcbde1391497fc7d94.1353948095@andrewcoop.uk.xensource.com>
In-Reply-To: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:41:35 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 4 of 5] rombios/ata Remove more needless traps
 from the int 0x13 path
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The return value from await_ide() is always ignored, and most calls to await_ide()
immediately reread the status register.

Therefore, making await_ide() return the last value of the status register removes
a further two traps on the int 0x13 path, with a similar reduction in the total
number of traps during Win7 boot.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r a8645d836a0e -r 8dbcbde13914 tools/firmware/rombios/rombios.c
--- a/tools/firmware/rombios/rombios.c
+++ b/tools/firmware/rombios/rombios.c
@@ -2531,14 +2531,14 @@ void ata_init( )
 
 #define IDE_TIMEOUT 32000u //32 seconds max for IDE ops
 
-int await_ide();
-static int await_ide(when_done,base,timeout)
+Bit8u await_ide();
+static Bit8u await_ide(when_done,base,timeout)
   Bit8u when_done;
   Bit16u base;
   Bit16u timeout;
 {
   Bit32u time=0,last=0;
-  Bit16u status;
+  Bit8u status;
   Bit8u result;
   for(;;) {
     status = inb(base+ATA_CB_STAT);
@@ -2556,7 +2556,7 @@ static int await_ide(when_done,base,time
     else if (when_done == TIMEOUT)
       result = 0;
 
-    if (result) return 0;
+    if (result) return status;
     if (time>>16 != last) // mod 2048 each 16 ms
     {
       last = time >>16;
@@ -2565,12 +2565,12 @@ static int await_ide(when_done,base,time
     if (status & ATA_CB_STAT_ERR)
     {
       BX_DEBUG_ATA("await_ide: ERROR (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) %d time= %ld timeout= %d\n",when_done,time>>11, timeout);
-      return -1;
+      return status;
     }
     if ((timeout == 0) || ((time>>11) > timeout)) break;
   }
   BX_INFO("IDE time out\n");
-  return -1;
+  return status;
 }
 
 // ---------------------------------------------------------------------------
@@ -3016,8 +3016,7 @@ Bit32u lba_low, lba_high;
   outb(iobase1 + ATA_CB_DH, (slave ? ATA_CB_DH_DEV1 : ATA_CB_DH_DEV0) | (Bit8u) head );
   outb(iobase1 + ATA_CB_CMD, command);
 
-  await_ide(NOT_BSY_DRQ, iobase1, IDE_TIMEOUT);
-  status = inb(iobase1 + ATA_CB_STAT);
+  status = await_ide(NOT_BSY_DRQ, iobase1, IDE_TIMEOUT);
 
   if (status & ATA_CB_STAT_ERR) {
     BX_DEBUG_ATA("ata_cmd_data_in : read error\n");
@@ -3077,8 +3076,7 @@ ASM_END
     current++;
     write_word(ebda_seg, &EbdaData->ata.trsfsectors,current);
     count--;
-    await_ide(NOT_BSY, iobase1, IDE_TIMEOUT);
-    status = inb(iobase1 + ATA_CB_STAT);
+    status = await_ide(NOT_BSY, iobase1, IDE_TIMEOUT);
     if (count == 0) {
       if ( (status & (ATA_CB_STAT_BSY | ATA_CB_STAT_RDY | ATA_CB_STAT_DRQ | ATA_CB_STAT_ERR) )
           != ATA_CB_STAT_RDY ) {
@@ -3167,8 +3165,7 @@ Bit32u lba_low, lba_high;
   outb(iobase1 + ATA_CB_DH, (slave ? ATA_CB_DH_DEV1 : ATA_CB_DH_DEV0) | (Bit8u) head );
   outb(iobase1 + ATA_CB_CMD, command);
 
-  await_ide(NOT_BSY_DRQ, iobase1, IDE_TIMEOUT);
-  status = inb(iobase1 + ATA_CB_STAT);
+  status = await_ide(NOT_BSY_DRQ, iobase1, IDE_TIMEOUT);
 
   if (status & ATA_CB_STAT_ERR) {
     BX_DEBUG_ATA("ata_cmd_data_out : read error\n");
@@ -3316,8 +3313,7 @@ Bit32u length;
   outb(iobase1 + ATA_CB_CMD, ATA_CMD_PACKET);
 
   // Device should ok to receive command
-  await_ide(NOT_BSY_DRQ, iobase1, IDE_TIMEOUT);
-  status = inb(iobase1 + ATA_CB_STAT);
+  status = await_ide(NOT_BSY_DRQ, iobase1, IDE_TIMEOUT);
 
   if (status & ATA_CB_STAT_ERR) {
     BX_DEBUG_ATA("ata_cmd_packet : error, status is %02x\n",status);
@@ -3353,8 +3349,7 @@ ASM_START
 ASM_END
 
   if (inout == ATA_DATA_NO) {
-    await_ide(NOT_BSY, iobase1, IDE_TIMEOUT);
-    status = inb(iobase1 + ATA_CB_STAT);
+    status = await_ide(NOT_BSY, iobase1, IDE_TIMEOUT);
     }
   else {
         Bit16u loops = 0;
@@ -3363,13 +3358,12 @@ ASM_END
 
       if (loops == 0) {//first time through
         status = inb(iobase2 + ATA_CB_ASTAT);
-        await_ide(NOT_BSY_DRQ, iobase1, IDE_TIMEOUT);
+        status = await_ide(NOT_BSY_DRQ, iobase1, IDE_TIMEOUT);
       }
       else
-        await_ide(NOT_BSY, iobase1, IDE_TIMEOUT);
+        status = await_ide(NOT_BSY, iobase1, IDE_TIMEOUT);
       loops++;
 
-      status = inb(iobase1 + ATA_CB_STAT);
       sc = inb(iobase1 + ATA_CB_SC);
 
       // Check if command completed

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:42:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:42:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1kn-00025l-It; Mon, 26 Nov 2012 16:41:53 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1kl-00024f-Ve
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:41:52 +0000
Received: from [85.158.139.83:37716] by server-8.bemta-5.messagelabs.com id
	C5/8D-06050-FCB93B05; Mon, 26 Nov 2012 16:41:51 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1353948108!29279169!2
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30961 invoked from network); 26 Nov 2012 16:41:50 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:41:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215487540"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:41:46 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:41:46 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1kg-0005lj-0K;
	Mon, 26 Nov 2012 16:41:46 +0000
MIME-Version: 1.0
X-Mercurial-Node: 1728fb78994054ad369505af708ddd1b90e95938
Message-ID: <1728fb78994054ad3695.1353948092@andrewcoop.uk.xensource.com>
In-Reply-To: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:41:32 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 1 of 5] rombios/keyboard: Don't needlessly poll
 the status register
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Repeated polling of the status register is not going to change its value, so
don't needlessly take 8192 traps to Qemu when 1 will do.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 0049de3827bc -r 1728fb789940 tools/firmware/rombios/rombios.c
--- a/tools/firmware/rombios/rombios.c
+++ b/tools/firmware/rombios/rombios.c
@@ -1805,12 +1805,12 @@ keyboard_init()
     while ( (inb(0x64) & 0x02) && (--max>0)) outb(0x80, 0x00);
 
     /* flush incoming keys */
-    max=0x2000;
+    max=2;
     while (--max > 0) {
         outb(0x80, 0x00);
         if (inb(0x64) & 0x01) {
             inb(0x60);
-            max = 0x2000;
+            max = 2;
             }
         }
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:42:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:42:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1kn-00025l-It; Mon, 26 Nov 2012 16:41:53 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1kl-00024f-Ve
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:41:52 +0000
Received: from [85.158.139.83:37716] by server-8.bemta-5.messagelabs.com id
	C5/8D-06050-FCB93B05; Mon, 26 Nov 2012 16:41:51 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1353948108!29279169!2
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30961 invoked from network); 26 Nov 2012 16:41:50 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:41:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215487540"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:41:46 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:41:46 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1kg-0005lj-0K;
	Mon, 26 Nov 2012 16:41:46 +0000
MIME-Version: 1.0
X-Mercurial-Node: 1728fb78994054ad369505af708ddd1b90e95938
Message-ID: <1728fb78994054ad3695.1353948092@andrewcoop.uk.xensource.com>
In-Reply-To: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:41:32 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 1 of 5] rombios/keyboard: Don't needlessly poll
 the status register
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Repeated polling of the status register is not going to change its value, so
don't needlessly take 8192 traps to Qemu when 1 will do.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 0049de3827bc -r 1728fb789940 tools/firmware/rombios/rombios.c
--- a/tools/firmware/rombios/rombios.c
+++ b/tools/firmware/rombios/rombios.c
@@ -1805,12 +1805,12 @@ keyboard_init()
     while ( (inb(0x64) & 0x02) && (--max>0)) outb(0x80, 0x00);
 
     /* flush incoming keys */
-    max=0x2000;
+    max=2;
     while (--max > 0) {
         outb(0x80, 0x00);
         if (inb(0x64) & 0x01) {
             inb(0x60);
-            max = 0x2000;
+            max = 2;
             }
         }
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:42:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:42:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1kl-00024e-Cm; Mon, 26 Nov 2012 16:41:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1kk-00024I-Hg
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:41:50 +0000
Received: from [85.158.139.211:11745] by server-4.bemta-5.messagelabs.com id
	B8/2B-15011-DCB93B05; Mon, 26 Nov 2012 16:41:49 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353948106!21656305!2
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9581 invoked from network); 26 Nov 2012 16:41:48 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:41:48 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215487536"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:41:46 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:41:46 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1kg-0005lj-0l;
	Mon, 26 Nov 2012 16:41:46 +0000
MIME-Version: 1.0
X-Mercurial-Node: c223c044afbf9505c138adbb38b7a24a604335d5
Message-ID: <c223c044afbf9505c138.1353948093@andrewcoop.uk.xensource.com>
In-Reply-To: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:41:33 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 2 of 5] rombios/ata: Do not wait for BSY to be
	set
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I can't find any guarantee in the ATA specification that this will happen, and it
certainly does not with Qemu.  SeaBIOS has replaced it with a call to udelay(5)
instead.

As rombios does not have an equivalent udelay(), replace the wait with a write
to port 0x80 which is whitelisted by Xen for 'a small delay'.

This causes roughly 42k fewer traps to Qemu, which is very roughly 10% of the
number of traps during boot of a Win7 guest.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 1728fb789940 -r c223c044afbf tools/firmware/rombios/rombios.c
--- a/tools/firmware/rombios/rombios.c
+++ b/tools/firmware/rombios/rombios.c
@@ -2914,8 +2914,8 @@ Bit16u device;
 // 8.2.1 (a) -- set SRST in DC
   outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN | ATA_CB_DC_SRST);
 
-// 8.2.1 (b) -- wait for BSY
-  await_ide(BSY, iobase1, 20);
+// 8.2.1 (b) -- wait
+  outb(0x80, 0x00);
 
 // 8.2.1 (f) -- clear SRST
   outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:42:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:42:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1kl-00024e-Cm; Mon, 26 Nov 2012 16:41:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1kk-00024I-Hg
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:41:50 +0000
Received: from [85.158.139.211:11745] by server-4.bemta-5.messagelabs.com id
	B8/2B-15011-DCB93B05; Mon, 26 Nov 2012 16:41:49 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353948106!21656305!2
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9581 invoked from network); 26 Nov 2012 16:41:48 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:41:48 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215487536"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:41:46 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:41:46 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1kg-0005lj-0l;
	Mon, 26 Nov 2012 16:41:46 +0000
MIME-Version: 1.0
X-Mercurial-Node: c223c044afbf9505c138adbb38b7a24a604335d5
Message-ID: <c223c044afbf9505c138.1353948093@andrewcoop.uk.xensource.com>
In-Reply-To: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:41:33 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 2 of 5] rombios/ata: Do not wait for BSY to be
	set
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I can't find any guarantee in the ATA specification that this will happen, and it
certainly does not with Qemu.  SeaBIOS has replaced it with a call to udelay(5)
instead.

As rombios does not have an equivalent udelay(), replace the wait with a write
to port 0x80 which is whitelisted by Xen for 'a small delay'.

This causes roughly 42k fewer traps to Qemu, which is very roughly 10% of the
number of traps during boot of a Win7 guest.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 1728fb789940 -r c223c044afbf tools/firmware/rombios/rombios.c
--- a/tools/firmware/rombios/rombios.c
+++ b/tools/firmware/rombios/rombios.c
@@ -2914,8 +2914,8 @@ Bit16u device;
 // 8.2.1 (a) -- set SRST in DC
   outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN | ATA_CB_DC_SRST);
 
-// 8.2.1 (b) -- wait for BSY
-  await_ide(BSY, iobase1, 20);
+// 8.2.1 (b) -- wait
+  outb(0x80, 0x00);
 
 // 8.2.1 (f) -- clear SRST
   outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:42:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:42:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1kk-00024R-Uw; Mon, 26 Nov 2012 16:41:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1kj-00024A-PT
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:41:49 +0000
Received: from [85.158.139.211:45795] by server-13.bemta-5.messagelabs.com id
	62/5C-27809-CCB93B05; Mon, 26 Nov 2012 16:41:48 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353948106!21656305!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9554 invoked from network); 26 Nov 2012 16:41:48 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:41:48 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215487535"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:41:46 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:41:46 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1kf-0005lj-W5;
	Mon, 26 Nov 2012 16:41:45 +0000
MIME-Version: 1.0
Message-ID: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:41:31 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 0 of 5] HVM performance improvements
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch series contains the results of an investigation by XenServer
to try and reduce dom0 load during a VDI bootstorm.

All patches reduce the number of polled IO traps to qemu that a booting
HVM domain uses.

The patches are unmodified from the last time I posted them to the list,
but are presented now outside of a feature freeze.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:42:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:42:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1kk-00024R-Uw; Mon, 26 Nov 2012 16:41:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1kj-00024A-PT
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:41:49 +0000
Received: from [85.158.139.211:45795] by server-13.bemta-5.messagelabs.com id
	62/5C-27809-CCB93B05; Mon, 26 Nov 2012 16:41:48 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353948106!21656305!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9554 invoked from network); 26 Nov 2012 16:41:48 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:41:48 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215487535"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:41:46 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:41:46 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1kf-0005lj-W5;
	Mon, 26 Nov 2012 16:41:45 +0000
MIME-Version: 1.0
Message-ID: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:41:31 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 0 of 5] HVM performance improvements
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch series contains the results of an investigation by XenServer
to try and reduce dom0 load during a VDI bootstorm.

All patches reduce the number of polled IO traps to qemu that a booting
HVM domain uses.

The patches are unmodified from the last time I posted them to the list,
but are presented now outside of a feature freeze.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:42:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:42:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1kn-00025V-2s; Mon, 26 Nov 2012 16:41:53 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1kl-00024X-K9
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:41:51 +0000
Received: from [85.158.139.211:30124] by server-14.bemta-5.messagelabs.com id
	19/FE-21768-ECB93B05; Mon, 26 Nov 2012 16:41:50 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353948106!21656305!4
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9645 invoked from network); 26 Nov 2012 16:41:50 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:41:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215487539"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:41:46 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:41:46 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1kg-0005lj-2A;
	Mon, 26 Nov 2012 16:41:46 +0000
MIME-Version: 1.0
X-Mercurial-Node: f997ed9b64abe1cefde1112fb6d1491a0fdeeeaa
Message-ID: <f997ed9b64abe1cefde1.1353948096@andrewcoop.uk.xensource.com>
In-Reply-To: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:41:36 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 5 of 5] rombios/debug: Reduce verbosity of
	rombios
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Default builds of Qemu appear not to log the Bochs debug port, so having rombios
write to the port causes pointless traps.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 8dbcbde13914 -r f997ed9b64ab tools/firmware/rombios/rombios.h
--- a/tools/firmware/rombios/rombios.h
+++ b/tools/firmware/rombios/rombios.h
@@ -48,10 +48,11 @@
 // per-device basis. Debug info are sent only in debug mode
 #if DEBUG_ROMBIOS
 #  define BX_DEBUG(format, p...)  bios_printf(BIOS_PRINTF_INFO, format, ##p)
+#  define BX_INFO(format, p...)   bios_printf(BIOS_PRINTF_INFO, format, ##p)
 #else
 #  define BX_DEBUG(format, p...)
+#  define BX_INFO(format, p...)
 #endif
-#define BX_INFO(format, p...)   bios_printf(BIOS_PRINTF_INFO, format, ##p)
 #define BX_PANIC(format, p...)  bios_printf(BIOS_PRINTF_DEBHALT, format, ##p)
 
 #define ACPI_DATA_SIZE    0x00010000L

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:42:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:42:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1kl-00024u-Q5; Mon, 26 Nov 2012 16:41:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1kl-00024L-2K
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:41:51 +0000
Received: from [85.158.139.211:45858] by server-1.bemta-5.messagelabs.com id
	08/82-09311-ECB93B05; Mon, 26 Nov 2012 16:41:50 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353948106!21656305!3
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9629 invoked from network); 26 Nov 2012 16:41:49 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:41:49 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215487537"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:41:46 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:41:46 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1kg-0005lj-1G;
	Mon, 26 Nov 2012 16:41:46 +0000
MIME-Version: 1.0
X-Mercurial-Node: a8645d836a0eae796443aee1aaba3f599d607d88
Message-ID: <a8645d836a0eae796443.1353948094@andrewcoop.uk.xensource.com>
In-Reply-To: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:41:34 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 3 of 5] rombios/ata: Reading this status
 register has no relevant side effects
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

So taking two traps when one will do is pointless.  This codepath is on the int
0x13 hot path, and removing it has about a 30% reduction in the number of traps
to Qemu during Win7 boot.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r c223c044afbf -r a8645d836a0e tools/firmware/rombios/rombios.c
--- a/tools/firmware/rombios/rombios.c
+++ b/tools/firmware/rombios/rombios.c
@@ -2540,7 +2540,6 @@ static int await_ide(when_done,base,time
   Bit32u time=0,last=0;
   Bit16u status;
   Bit8u result;
-  status = inb(base + ATA_CB_STAT); // for the times you're supposed to throw one away
   for(;;) {
     status = inb(base+ATA_CB_STAT);
     time++;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:42:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:42:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1kn-00025V-2s; Mon, 26 Nov 2012 16:41:53 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1kl-00024X-K9
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:41:51 +0000
Received: from [85.158.139.211:30124] by server-14.bemta-5.messagelabs.com id
	19/FE-21768-ECB93B05; Mon, 26 Nov 2012 16:41:50 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353948106!21656305!4
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9645 invoked from network); 26 Nov 2012 16:41:50 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:41:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215487539"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:41:46 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:41:46 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1kg-0005lj-2A;
	Mon, 26 Nov 2012 16:41:46 +0000
MIME-Version: 1.0
X-Mercurial-Node: f997ed9b64abe1cefde1112fb6d1491a0fdeeeaa
Message-ID: <f997ed9b64abe1cefde1.1353948096@andrewcoop.uk.xensource.com>
In-Reply-To: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:41:36 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 5 of 5] rombios/debug: Reduce verbosity of
	rombios
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Default builds of Qemu appear not to log the Bochs debug port, so having rombios
write to the port causes pointless traps.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 8dbcbde13914 -r f997ed9b64ab tools/firmware/rombios/rombios.h
--- a/tools/firmware/rombios/rombios.h
+++ b/tools/firmware/rombios/rombios.h
@@ -48,10 +48,11 @@
 // per-device basis. Debug info are sent only in debug mode
 #if DEBUG_ROMBIOS
 #  define BX_DEBUG(format, p...)  bios_printf(BIOS_PRINTF_INFO, format, ##p)
+#  define BX_INFO(format, p...)   bios_printf(BIOS_PRINTF_INFO, format, ##p)
 #else
 #  define BX_DEBUG(format, p...)
+#  define BX_INFO(format, p...)
 #endif
-#define BX_INFO(format, p...)   bios_printf(BIOS_PRINTF_INFO, format, ##p)
 #define BX_PANIC(format, p...)  bios_printf(BIOS_PRINTF_DEBHALT, format, ##p)
 
 #define ACPI_DATA_SIZE    0x00010000L

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:42:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:42:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1kl-00024u-Q5; Mon, 26 Nov 2012 16:41:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1kl-00024L-2K
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:41:51 +0000
Received: from [85.158.139.211:45858] by server-1.bemta-5.messagelabs.com id
	08/82-09311-ECB93B05; Mon, 26 Nov 2012 16:41:50 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353948106!21656305!3
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9629 invoked from network); 26 Nov 2012 16:41:49 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:41:49 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215487537"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:41:46 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:41:46 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1kg-0005lj-1G;
	Mon, 26 Nov 2012 16:41:46 +0000
MIME-Version: 1.0
X-Mercurial-Node: a8645d836a0eae796443aee1aaba3f599d607d88
Message-ID: <a8645d836a0eae796443.1353948094@andrewcoop.uk.xensource.com>
In-Reply-To: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
User-Agent: Mercurial-patchbomb/2.3.2
Date: Mon, 26 Nov 2012 16:41:34 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 3 of 5] rombios/ata: Reading this status
 register has no relevant side effects
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

So taking two traps when one will do is pointless.  This codepath is on the int
0x13 hot path, and removing it has about a 30% reduction in the number of traps
to Qemu during Win7 boot.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r c223c044afbf -r a8645d836a0e tools/firmware/rombios/rombios.c
--- a/tools/firmware/rombios/rombios.c
+++ b/tools/firmware/rombios/rombios.c
@@ -2540,7 +2540,6 @@ static int await_ide(when_done,base,time
   Bit32u time=0,last=0;
   Bit16u status;
   Bit8u result;
-  status = inb(base + ATA_CB_STAT); // for the times you're supposed to throw one away
   for(;;) {
     status = inb(base+ATA_CB_STAT);
     time++;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:42:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:42:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1lQ-0002Np-1l; Mon, 26 Nov 2012 16:42:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Td1lO-0002N8-IL
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:42:30 +0000
Received: from [193.109.254.147:5392] by server-3.bemta-14.messagelabs.com id
	68/1E-01317-5FB93B05; Mon, 26 Nov 2012 16:42:29 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1353948147!8489206!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4322 invoked from network); 26 Nov 2012 16:42:27 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-27.messagelabs.com with SMTP;
	26 Nov 2012 16:42:27 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 16:42:27 +0000
Message-Id: <50B3AA3902000078000AB47D@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 16:43:21 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
	<1353947485.5830.104.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353947485.5830.104.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 17:31, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Mon, 2012-11-26 at 15:23 +0000, Jan Beulich wrote:
>> The way it was coded, it clobbered %rdx without telling the compiler.
>> This generally didn't cause any problems except when there are two back
>> to back invocations (as in plt_overflow()), as in that case the
>> compiler may validly assume that it can re-use for the second instance
>> the value loaded into %rdx before the first one.
>> 
>> Once at it, also properly relax the second operand of "mul" (there's no
>> need for it to be in %rdx, or a register at all), and switch away from
>> using explicit register names in the instruction operands.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> 
>> --- a/xen/arch/x86/time.c
>> +++ b/xen/arch/x86/time.c
>> @@ -127,8 +127,9 @@ static inline u64 scale_delta(u64 delta,
>>          delta <<= scale->shift;
>>  
>>      asm (
>> -        "mul %%rdx ; shrd $32,%%rdx,%%rax"
>> -        : "=a" (product) : "0" (delta), "d" ((u64)scale->mul_frac) );
>> +        "mul %2 ; shrd $32,%1,%0"
>> +        : "=a" (product), "=d" (delta)
>> +        : "rm" (delta), "0" ((u64)scale->mul_frac) );
> 
> OOI is there a reason to favour an output constraint overwriting delta,
> which is then thrown away, over a straightforward clobber of rdx?

Yes - with a clobber of %rdx the compiler can't pass "delta" in that
register.

> It took me ages to figure out that you had swapped which of the two
> inputs to the multiply was in rax (I was very confused until I spotted
> that!).

Sorry. The resulting code was better (and less different from the
prior version) with the operands swapped.

> It's also a bit confusing to use %1 and %0 with the shrd since you
> aren't actually using the things specified by the constraints but rather
> the outputs of the mul which happen to (now) be in those registers, I'd
> argue that the previous use of the explicit names was more correctly
> describing what was going on. As it is I was wondering how
>         shrd $32,delta,product
> could possibly make sense.

That's how things are with multi-insn asm-s (and even with single-
insn ones when an output different from an input get tied together
through using the same register). I continue to think that using the
numbered forms here is better.

> Since delta is the first argument to the containing function would it be
> helpful to put that in rax, where it already is due to the calling
> convention? I suppose any difference is overwhelmed by the multiply
> anyway.

The first argument of a "real" function would be in %rdi. This being
an inline function, there's no calling convention anyway.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:42:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:42:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1lQ-0002Np-1l; Mon, 26 Nov 2012 16:42:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Td1lO-0002N8-IL
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:42:30 +0000
Received: from [193.109.254.147:5392] by server-3.bemta-14.messagelabs.com id
	68/1E-01317-5FB93B05; Mon, 26 Nov 2012 16:42:29 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1353948147!8489206!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4322 invoked from network); 26 Nov 2012 16:42:27 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-27.messagelabs.com with SMTP;
	26 Nov 2012 16:42:27 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 16:42:27 +0000
Message-Id: <50B3AA3902000078000AB47D@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 16:43:21 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
	<1353947485.5830.104.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353947485.5830.104.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 17:31, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Mon, 2012-11-26 at 15:23 +0000, Jan Beulich wrote:
>> The way it was coded, it clobbered %rdx without telling the compiler.
>> This generally didn't cause any problems except when there are two back
>> to back invocations (as in plt_overflow()), as in that case the
>> compiler may validly assume that it can re-use for the second instance
>> the value loaded into %rdx before the first one.
>> 
>> Once at it, also properly relax the second operand of "mul" (there's no
>> need for it to be in %rdx, or a register at all), and switch away from
>> using explicit register names in the instruction operands.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> 
>> --- a/xen/arch/x86/time.c
>> +++ b/xen/arch/x86/time.c
>> @@ -127,8 +127,9 @@ static inline u64 scale_delta(u64 delta,
>>          delta <<= scale->shift;
>>  
>>      asm (
>> -        "mul %%rdx ; shrd $32,%%rdx,%%rax"
>> -        : "=a" (product) : "0" (delta), "d" ((u64)scale->mul_frac) );
>> +        "mul %2 ; shrd $32,%1,%0"
>> +        : "=a" (product), "=d" (delta)
>> +        : "rm" (delta), "0" ((u64)scale->mul_frac) );
> 
> OOI is there a reason to favour an output constraint overwriting delta,
> which is then thrown away, over a straightforward clobber of rdx?

Yes - with a clobber of %rdx the compiler can't pass "delta" in that
register.

> It took me ages to figure out that you had swapped which of the two
> inputs to the multiply was in rax (I was very confused until I spotted
> that!).

Sorry. The resulting code was better (and less different from the
prior version) with the operands swapped.

> It's also a bit confusing to use %1 and %0 with the shrd since you
> aren't actually using the things specified by the constraints but rather
> the outputs of the mul which happen to (now) be in those registers, I'd
> argue that the previous use of the explicit names was more correctly
> describing what was going on. As it is I was wondering how
>         shrd $32,delta,product
> could possibly make sense.

That's how things are with multi-insn asm-s (and even with single-
insn ones when an output different from an input get tied together
through using the same register). I continue to think that using the
numbered forms here is better.

> Since delta is the first argument to the containing function would it be
> helpful to put that in rax, where it already is due to the calling
> convention? I suppose any difference is overwhelmed by the multiply
> anyway.

The first argument of a "real" function would be in %rdi. This being
an inline function, there's no calling convention anyway.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:44:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1mw-0002oW-Ky; Mon, 26 Nov 2012 16:44:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td1mv-0002oE-L0
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:44:05 +0000
Received: from [193.109.254.147:3273] by server-9.bemta-14.messagelabs.com id
	04/B5-30773-55C93B05; Mon, 26 Nov 2012 16:44:05 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353948191!6161045!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NTMzMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7584 invoked from network); 26 Nov 2012 16:43:14 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-5.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 16:43:14 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQGhAsm027075
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 16:43:11 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQGh9mG020951
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 16:43:09 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQGh9IV009451; Mon, 26 Nov 2012 10:43:09 -0600
MIME-Version: 1.0
Message-ID: <9efb590f-8c59-496b-97ea-8c39d77c203a@default>
Date: Mon, 26 Nov 2012 08:43:07 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>, xen-devel
	<xen-devel@lists.xen.org>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
	<CCD9450D.53691%keir@xen.org>
In-Reply-To: <CCD9450D.53691%keir@xen.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Keir Fraser [mailto:keir@xen.org]
> Sent: Monday, November 26, 2012 9:11 AM
> To: Jan Beulich; xen-devel
> Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
> 
> On 26/11/2012 15:23, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
> > The way it was coded, it clobbered %rdx without telling the compiler.
> > This generally didn't cause any problems except when there are two back
> > to back invocations (as in plt_overflow()), as in that case the
> > compiler may validly assume that it can re-use for the second instance
> > the value loaded into %rdx before the first one.
> >
> > Once at it, also properly relax the second operand of "mul" (there's no
> > need for it to be in %rdx, or a register at all), and switch away from
> > using explicit register names in the instruction operands.
> >
> > Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Ugh. Thank you very much, Jan! What a horrible bug.
> 
> Acked-by: Keir Fraser <keir@xen.org>

Amazing work Jan!

Suggestion (especially since this is DOCDAY)...

Since this has caused a number of people a lot of pain
over a period of years, might it make sense to very
clearly call out the user-visible problem(s) fixed by this
in the commit message -- possibly including a few
xen-devel archive URLs and/or subject lines?  Other
than the reference to plt_overflow() (and the fact that
I've been following this thread for years), I wouldn't
have any idea from the commit message that this bug
fixes the "clock shifts by 50min" problem.

It would probably also be nice to cc the various people
who have contributed their time to provide supporting
information that helped isolate the bug.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:44:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1mw-0002oW-Ky; Mon, 26 Nov 2012 16:44:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td1mv-0002oE-L0
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:44:05 +0000
Received: from [193.109.254.147:3273] by server-9.bemta-14.messagelabs.com id
	04/B5-30773-55C93B05; Mon, 26 Nov 2012 16:44:05 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353948191!6161045!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NTMzMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7584 invoked from network); 26 Nov 2012 16:43:14 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-5.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 16:43:14 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQGhAsm027075
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 16:43:11 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQGh9mG020951
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 16:43:09 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQGh9IV009451; Mon, 26 Nov 2012 10:43:09 -0600
MIME-Version: 1.0
Message-ID: <9efb590f-8c59-496b-97ea-8c39d77c203a@default>
Date: Mon, 26 Nov 2012 08:43:07 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>, xen-devel
	<xen-devel@lists.xen.org>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
	<CCD9450D.53691%keir@xen.org>
In-Reply-To: <CCD9450D.53691%keir@xen.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Keir Fraser [mailto:keir@xen.org]
> Sent: Monday, November 26, 2012 9:11 AM
> To: Jan Beulich; xen-devel
> Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
> 
> On 26/11/2012 15:23, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
> > The way it was coded, it clobbered %rdx without telling the compiler.
> > This generally didn't cause any problems except when there are two back
> > to back invocations (as in plt_overflow()), as in that case the
> > compiler may validly assume that it can re-use for the second instance
> > the value loaded into %rdx before the first one.
> >
> > Once at it, also properly relax the second operand of "mul" (there's no
> > need for it to be in %rdx, or a register at all), and switch away from
> > using explicit register names in the instruction operands.
> >
> > Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Ugh. Thank you very much, Jan! What a horrible bug.
> 
> Acked-by: Keir Fraser <keir@xen.org>

Amazing work Jan!

Suggestion (especially since this is DOCDAY)...

Since this has caused a number of people a lot of pain
over a period of years, might it make sense to very
clearly call out the user-visible problem(s) fixed by this
in the commit message -- possibly including a few
xen-devel archive URLs and/or subject lines?  Other
than the reference to plt_overflow() (and the fact that
I've been following this thread for years), I wouldn't
have any idea from the commit message that this bug
fixes the "clock shifts by 50min" problem.

It would probably also be nice to cc the various people
who have contributed their time to provide supporting
information that helped isolate the bug.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:46:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:46:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1op-00037r-71; Mon, 26 Nov 2012 16:46:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td1on-00037Z-RM
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:46:02 +0000
Received: from [85.158.138.51:46408] by server-8.bemta-3.messagelabs.com id
	59/7E-07786-4CC93B05; Mon, 26 Nov 2012 16:45:56 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1353948355!23458656!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11276 invoked from network); 26 Nov 2012 16:45:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:45:55 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16006545"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:45:55 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 16:45:55 +0000
Message-ID: <1353948353.5830.116.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Mon, 26 Nov 2012 16:45:53 +0000
In-Reply-To: <50B3A8DA02000078000AB460@nat28.tlf.novell.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<50B3A8DA02000078000AB460@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Lars Kurth <lars.kurth@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 16:37 +0000, Jan Beulich wrote:
> >>> On 26.11.12 at 16:58, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > Each new Xen release X.Y.0 starts a new stable maintenance branch.
> > 
> > Each such branch is in in its own mercurial repository
> > xen-X.Y-testing.hg.
> 
> Should we indeed switch to git (which I'm in no way trying to
> accelerate), one of the points I actually wanted to bring up is
> this very duplication. I'm not sure about Mercurial in this regard,
> but git certainly can easily deal with all branches in a single repo
> (and the extra data volume and traffic shouldn't be so high that
> it could be expected to cause problems to anyone).

I think a single xen.git would make sense, and indeed the current git
mirror implements this.

> 
> > Releases happen roughly every 3 months. The first
> 
> ... are intended to ...

ACK ;-)

> 
> > release on a stable branch is often sooner and as the branch reaches the
> > end of its life the interval may be longer.
> > 
> > In general Xen.org supports the two most recent stable branches at any
> > given time. When a new X.Y.0 release is made there is usually one more
> > release on the to-be-retired stable branch to mop up any loose patches
> > sitting in the repo at which point the branch is retired. For example we
> > are currently in the 4.3 development cycle and are supporting two stable
> > branches: 4.1-testing and 4.2-testing. After 4.2.0 was released there
> > was one more release in the 4.0-testing stream (4.0.4 IIRC) and then the
> > 4.0 branch was been retired.
> > 
> >         XXX how did Jan become stable maintainer, I think he just
> >         volunteered at the developer meeting and was accepted via the
> >         usual consensus driven approach? Lets try:
> > 
> > Each stable branch has a maintainer who is nominated/volunteers and is
> > accepted via consensus among the maintainers and committers (XXX or just
> > committers?). For the branches maintained by Xen.org this would usually
> > be one of the xen-unstable committers or maintainers. However community
> > members can step up to maintain a release once Xen.org no longer does so
> > (e.g. as happened with Keith and xen-3.4-testing.hg).
> > 
> > Currently Jan Beulich is the stable maintainer for both 4.1-testing and
> > 4.2-testing having taken over from Keir Fraser when 4.2.0 was released.
> > Jan delegates tools backports to Ian Jackson. Community member Keith
> > Coleman continues to maintain the 3.4-testing branch (XXX does he
> > still?) which he took over when 4.1.0 was released.
> > 
> > No new development happens in the X.Y-testing branches, instead
> > changesets are backported from xen-unstable. Where this is not possible
> > (perhaps unstable has moved on such that the patch cannot be applied or
> > the approach used in unstable is otherwise not valid for the stable
> > branch) then a specific fix can be created for the stable branch.
> > However it is a requirement that the issue will always be fixed in
> > unstable first (this is to avoid regressions on the next stable
> 
> Did you mean "major" here?

Where? Before "regressions"? I'd like to think we were striving to avoid
regressions of either sort ;-)

> 
> > release).
> > 
> > In general only bug fixes are accepted into stable branches and new
> > features are not normally accepted. (There can be exceptions, e.g. it
> > was agreed that 4.2.1 would take a more relaxed approach to features
> > which improved xl compatibility with xm). As time passes each stable
> > branch becomes more conservative and the barrier to accepting a patch
> > for backport becomes higher.
> > 
> > Changesets are nominated for inclusion in the stable branch by making a
> > request to the stable maintainer on xen-devel either by noting it as
> > such in the submission of the original patch to xen-unstable or by a
> > subsequent explicit email to xen-devel.
> 
> I think we should explicitly require the person expected to do the
> backport to be Cc-ed; I for myself don't get around to read _all_
> mails on xen-devel, and hence with a badly chosen subject it is not
> impossible (albeit also not likely) for me to miss such a request
> otherwise.

That makes sense to me. Should we add entries to MAINTAINERS to cover
stable trees as well?

I also wondered if it might be useful to have a greppable string, like
Linux's "CC: stable@kernel.org"? AIUI the Linux stable guys don't
actually use this as a mailing list, even though it technically does
exist as such, instead they use it as grep fodder for their tooling. We
could certainly setup stable@xen.org, directed to a blackhole if
necessary.

> Furthermore, the branch maintainer should imo explicitly be given
> discretion to pull in patches without explicit request on the list

Agreed.

>  (I
> have been actively doing so thus far, and apparently not without
> success, considering that post-RC1 there were no further
> hypervisor side backports requested for either branch so far). In
> the hopefully not very likely event that too much was backported,
> a revert request would then need to be sent/discussed instead.

Ack.

I'll update and resend without your comments addressed, although perhaps
not today.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:46:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:46:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1op-00037r-71; Mon, 26 Nov 2012 16:46:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td1on-00037Z-RM
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:46:02 +0000
Received: from [85.158.138.51:46408] by server-8.bemta-3.messagelabs.com id
	59/7E-07786-4CC93B05; Mon, 26 Nov 2012 16:45:56 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1353948355!23458656!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11276 invoked from network); 26 Nov 2012 16:45:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:45:55 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16006545"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:45:55 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 16:45:55 +0000
Message-ID: <1353948353.5830.116.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Mon, 26 Nov 2012 16:45:53 +0000
In-Reply-To: <50B3A8DA02000078000AB460@nat28.tlf.novell.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<50B3A8DA02000078000AB460@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Lars Kurth <lars.kurth@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 16:37 +0000, Jan Beulich wrote:
> >>> On 26.11.12 at 16:58, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > Each new Xen release X.Y.0 starts a new stable maintenance branch.
> > 
> > Each such branch is in in its own mercurial repository
> > xen-X.Y-testing.hg.
> 
> Should we indeed switch to git (which I'm in no way trying to
> accelerate), one of the points I actually wanted to bring up is
> this very duplication. I'm not sure about Mercurial in this regard,
> but git certainly can easily deal with all branches in a single repo
> (and the extra data volume and traffic shouldn't be so high that
> it could be expected to cause problems to anyone).

I think a single xen.git would make sense, and indeed the current git
mirror implements this.

> 
> > Releases happen roughly every 3 months. The first
> 
> ... are intended to ...

ACK ;-)

> 
> > release on a stable branch is often sooner and as the branch reaches the
> > end of its life the interval may be longer.
> > 
> > In general Xen.org supports the two most recent stable branches at any
> > given time. When a new X.Y.0 release is made there is usually one more
> > release on the to-be-retired stable branch to mop up any loose patches
> > sitting in the repo at which point the branch is retired. For example we
> > are currently in the 4.3 development cycle and are supporting two stable
> > branches: 4.1-testing and 4.2-testing. After 4.2.0 was released there
> > was one more release in the 4.0-testing stream (4.0.4 IIRC) and then the
> > 4.0 branch was been retired.
> > 
> >         XXX how did Jan become stable maintainer, I think he just
> >         volunteered at the developer meeting and was accepted via the
> >         usual consensus driven approach? Lets try:
> > 
> > Each stable branch has a maintainer who is nominated/volunteers and is
> > accepted via consensus among the maintainers and committers (XXX or just
> > committers?). For the branches maintained by Xen.org this would usually
> > be one of the xen-unstable committers or maintainers. However community
> > members can step up to maintain a release once Xen.org no longer does so
> > (e.g. as happened with Keith and xen-3.4-testing.hg).
> > 
> > Currently Jan Beulich is the stable maintainer for both 4.1-testing and
> > 4.2-testing having taken over from Keir Fraser when 4.2.0 was released.
> > Jan delegates tools backports to Ian Jackson. Community member Keith
> > Coleman continues to maintain the 3.4-testing branch (XXX does he
> > still?) which he took over when 4.1.0 was released.
> > 
> > No new development happens in the X.Y-testing branches, instead
> > changesets are backported from xen-unstable. Where this is not possible
> > (perhaps unstable has moved on such that the patch cannot be applied or
> > the approach used in unstable is otherwise not valid for the stable
> > branch) then a specific fix can be created for the stable branch.
> > However it is a requirement that the issue will always be fixed in
> > unstable first (this is to avoid regressions on the next stable
> 
> Did you mean "major" here?

Where? Before "regressions"? I'd like to think we were striving to avoid
regressions of either sort ;-)

> 
> > release).
> > 
> > In general only bug fixes are accepted into stable branches and new
> > features are not normally accepted. (There can be exceptions, e.g. it
> > was agreed that 4.2.1 would take a more relaxed approach to features
> > which improved xl compatibility with xm). As time passes each stable
> > branch becomes more conservative and the barrier to accepting a patch
> > for backport becomes higher.
> > 
> > Changesets are nominated for inclusion in the stable branch by making a
> > request to the stable maintainer on xen-devel either by noting it as
> > such in the submission of the original patch to xen-unstable or by a
> > subsequent explicit email to xen-devel.
> 
> I think we should explicitly require the person expected to do the
> backport to be Cc-ed; I for myself don't get around to read _all_
> mails on xen-devel, and hence with a badly chosen subject it is not
> impossible (albeit also not likely) for me to miss such a request
> otherwise.

That makes sense to me. Should we add entries to MAINTAINERS to cover
stable trees as well?

I also wondered if it might be useful to have a greppable string, like
Linux's "CC: stable@kernel.org"? AIUI the Linux stable guys don't
actually use this as a mailing list, even though it technically does
exist as such, instead they use it as grep fodder for their tooling. We
could certainly setup stable@xen.org, directed to a blackhole if
necessary.

> Furthermore, the branch maintainer should imo explicitly be given
> discretion to pull in patches without explicit request on the list

Agreed.

>  (I
> have been actively doing so thus far, and apparently not without
> success, considering that post-RC1 there were no further
> hypervisor side backports requested for either branch so far). In
> the hopefully not very likely event that too much was backported,
> a revert request would then need to be sent/discussed instead.

Ack.

I'll update and resend without your comments addressed, although perhaps
not today.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:48:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:48:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1rJ-0003SA-VW; Mon, 26 Nov 2012 16:48:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td1rI-0003S2-8m
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:48:36 +0000
Received: from [85.158.143.99:25394] by server-1.bemta-4.messagelabs.com id
	BF/8B-27934-36D93B05; Mon, 26 Nov 2012 16:48:35 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1353948514!28767975!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2031 invoked from network); 26 Nov 2012 16:48:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:48:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16006615"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:48:34 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 16:48:34 +0000
Message-ID: <1353948513.5830.117.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Date: Mon, 26 Nov 2012 16:48:33 +0000
In-Reply-To: <1728fb78994054ad3695.1353948092@andrewcoop.uk.xensource.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<1728fb78994054ad3695.1353948092@andrewcoop.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1 of 5] rombios/keyboard: Don't needlessly
 poll the status register
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 16:41 +0000, Andrew Cooper wrote:
> Repeated polling of the status register is not going to change its value,

but the passage of time while doing multiple polls might? If this is not
the case then something needs to be said about why not.

>  so
> don't needlessly take 8192 traps to Qemu when 1 will do.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> diff -r 0049de3827bc -r 1728fb789940 tools/firmware/rombios/rombios.c
> --- a/tools/firmware/rombios/rombios.c
> +++ b/tools/firmware/rombios/rombios.c
> @@ -1805,12 +1805,12 @@ keyboard_init()
>      while ( (inb(0x64) & 0x02) && (--max>0)) outb(0x80, 0x00);
>  
>      /* flush incoming keys */
> -    max=0x2000;
> +    max=2;
>      while (--max > 0) {
>          outb(0x80, 0x00);
>          if (inb(0x64) & 0x01) {
>              inb(0x60);
> -            max = 0x2000;
> +            max = 2;
>              }
>          }
>  
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:48:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:48:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1rJ-0003SA-VW; Mon, 26 Nov 2012 16:48:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td1rI-0003S2-8m
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:48:36 +0000
Received: from [85.158.143.99:25394] by server-1.bemta-4.messagelabs.com id
	BF/8B-27934-36D93B05; Mon, 26 Nov 2012 16:48:35 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1353948514!28767975!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2031 invoked from network); 26 Nov 2012 16:48:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:48:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16006615"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:48:34 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 16:48:34 +0000
Message-ID: <1353948513.5830.117.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Date: Mon, 26 Nov 2012 16:48:33 +0000
In-Reply-To: <1728fb78994054ad3695.1353948092@andrewcoop.uk.xensource.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<1728fb78994054ad3695.1353948092@andrewcoop.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1 of 5] rombios/keyboard: Don't needlessly
 poll the status register
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 16:41 +0000, Andrew Cooper wrote:
> Repeated polling of the status register is not going to change its value,

but the passage of time while doing multiple polls might? If this is not
the case then something needs to be said about why not.

>  so
> don't needlessly take 8192 traps to Qemu when 1 will do.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> diff -r 0049de3827bc -r 1728fb789940 tools/firmware/rombios/rombios.c
> --- a/tools/firmware/rombios/rombios.c
> +++ b/tools/firmware/rombios/rombios.c
> @@ -1805,12 +1805,12 @@ keyboard_init()
>      while ( (inb(0x64) & 0x02) && (--max>0)) outb(0x80, 0x00);
>  
>      /* flush incoming keys */
> -    max=0x2000;
> +    max=2;
>      while (--max > 0) {
>          outb(0x80, 0x00);
>          if (inb(0x64) & 0x01) {
>              inb(0x60);
> -            max = 0x2000;
> +            max = 2;
>              }
>          }
>  
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:50:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:50:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1sv-0003ZR-IL; Mon, 26 Nov 2012 16:50:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1Td1st-0003ZI-NX
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:50:15 +0000
Received: from [85.158.143.35:33127] by server-2.bemta-4.messagelabs.com id
	9A/29-28922-7CD93B05; Mon, 26 Nov 2012 16:50:15 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1353948612!16787567!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30238 invoked from network); 26 Nov 2012 16:50:13 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:50:13 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215488957"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	26 Nov 2012 16:50:11 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Mon, 26 Nov 2012 11:50:11 -0500
Message-ID: <50B39DC2.4020805@citrix.com>
Date: Mon, 26 Nov 2012 16:50:10 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
	<1353947485.5830.104.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353947485.5830.104.camel@zakaz.uk.xensource.com>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 26/11/12 16:31, Ian Campbell wrote:
> On Mon, 2012-11-26 at 15:23 +0000, Jan Beulich wrote:
>> The way it was coded, it clobbered %rdx without telling the compiler.
>> This generally didn't cause any problems except when there are two back
>> to back invocations (as in plt_overflow()), as in that case the
>> compiler may validly assume that it can re-use for the second instance
>> the value loaded into %rdx before the first one.
>>
>> Once at it, also properly relax the second operand of "mul" (there's no
>> need for it to be in %rdx, or a register at all), and switch away from
>> using explicit register names in the instruction operands.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>
>> --- a/xen/arch/x86/time.c
>> +++ b/xen/arch/x86/time.c
>> @@ -127,8 +127,9 @@ static inline u64 scale_delta(u64 delta,
>>           delta <<= scale->shift;
>>   
>>       asm (
>> -        "mul %%rdx ; shrd $32,%%rdx,%%rax"
>> -        : "=a" (product) : "0" (delta), "d" ((u64)scale->mul_frac) );
>> +        "mul %2 ; shrd $32,%1,%0"
>> +        : "=a" (product), "=d" (delta)
>> +        : "rm" (delta), "0" ((u64)scale->mul_frac) );
> OOI is there a reason to favour an output constraint overwriting delta,
> which is then thrown away, over a straightforward clobber of rdx?
>
> It took me ages to figure out that you had swapped which of the two
> inputs to the multiply was in rax (I was very confused until I spotted
> that!).
>
> It's also a bit confusing to use %1 and %0 with the shrd since you
> aren't actually using the things specified by the constraints but rather
> the outputs of the mul which happen to (now) be in those registers, I'd
> argue that the previous use of the explicit names was more correctly
> describing what was going on. As it is I was wondering how
>          shrd $32,delta,product
> could possibly make sense.
>
> Since delta is the first argument to the containing function would it be
> helpful to put that in rax, where it already is due to the calling
> convention? I suppose any difference is overwhelmed by the multiply
> anyway.

Probably makes no difference which register is used for the input, as 
the compiler is hopefully inlining the entire function, and thus the 
register which is used as "first argument" is whatever that value 
happens to be in when the compiler gets there. This is one of many 
reasons that makes inlining more efficient - less register pressure. 
Hard-coding register usage in the assembler is a good way to "make life 
difficult for the compiler" (as it now has to make sure the value is in 
that register).

And multiply on modern processors is pretty quick - 8 clocks latency in 
the case of MUL of 64 x 64 bit number on AMD processors - I'm pretty 
sure Intel figures are similar, but not sure where to find that 
information quickly, so couldn't be bothered to look it up. The shrd 
instruction adds another 6 clocks of latency to the whole thing (again 
AMD number).

I'm not sure how many cycles you'd change the code by if the registers 
are hard-coded or compiler can choose... But not hardcoding it would be 
the better choice.

--
Mats
>
> Ian.
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:50:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:50:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1sv-0003ZR-IL; Mon, 26 Nov 2012 16:50:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1Td1st-0003ZI-NX
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:50:15 +0000
Received: from [85.158.143.35:33127] by server-2.bemta-4.messagelabs.com id
	9A/29-28922-7CD93B05; Mon, 26 Nov 2012 16:50:15 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1353948612!16787567!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30238 invoked from network); 26 Nov 2012 16:50:13 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:50:13 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215488957"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	26 Nov 2012 16:50:11 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Mon, 26 Nov 2012 11:50:11 -0500
Message-ID: <50B39DC2.4020805@citrix.com>
Date: Mon, 26 Nov 2012 16:50:10 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
	<1353947485.5830.104.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353947485.5830.104.camel@zakaz.uk.xensource.com>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 26/11/12 16:31, Ian Campbell wrote:
> On Mon, 2012-11-26 at 15:23 +0000, Jan Beulich wrote:
>> The way it was coded, it clobbered %rdx without telling the compiler.
>> This generally didn't cause any problems except when there are two back
>> to back invocations (as in plt_overflow()), as in that case the
>> compiler may validly assume that it can re-use for the second instance
>> the value loaded into %rdx before the first one.
>>
>> Once at it, also properly relax the second operand of "mul" (there's no
>> need for it to be in %rdx, or a register at all), and switch away from
>> using explicit register names in the instruction operands.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>
>> --- a/xen/arch/x86/time.c
>> +++ b/xen/arch/x86/time.c
>> @@ -127,8 +127,9 @@ static inline u64 scale_delta(u64 delta,
>>           delta <<= scale->shift;
>>   
>>       asm (
>> -        "mul %%rdx ; shrd $32,%%rdx,%%rax"
>> -        : "=a" (product) : "0" (delta), "d" ((u64)scale->mul_frac) );
>> +        "mul %2 ; shrd $32,%1,%0"
>> +        : "=a" (product), "=d" (delta)
>> +        : "rm" (delta), "0" ((u64)scale->mul_frac) );
> OOI is there a reason to favour an output constraint overwriting delta,
> which is then thrown away, over a straightforward clobber of rdx?
>
> It took me ages to figure out that you had swapped which of the two
> inputs to the multiply was in rax (I was very confused until I spotted
> that!).
>
> It's also a bit confusing to use %1 and %0 with the shrd since you
> aren't actually using the things specified by the constraints but rather
> the outputs of the mul which happen to (now) be in those registers, I'd
> argue that the previous use of the explicit names was more correctly
> describing what was going on. As it is I was wondering how
>          shrd $32,delta,product
> could possibly make sense.
>
> Since delta is the first argument to the containing function would it be
> helpful to put that in rax, where it already is due to the calling
> convention? I suppose any difference is overwhelmed by the multiply
> anyway.

Probably makes no difference which register is used for the input, as 
the compiler is hopefully inlining the entire function, and thus the 
register which is used as "first argument" is whatever that value 
happens to be in when the compiler gets there. This is one of many 
reasons that makes inlining more efficient - less register pressure. 
Hard-coding register usage in the assembler is a good way to "make life 
difficult for the compiler" (as it now has to make sure the value is in 
that register).

And multiply on modern processors is pretty quick - 8 clocks latency in 
the case of MUL of 64 x 64 bit number on AMD processors - I'm pretty 
sure Intel figures are similar, but not sure where to find that 
information quickly, so couldn't be bothered to look it up. The shrd 
instruction adds another 6 clocks of latency to the whole thing (again 
AMD number).

I'm not sure how many cycles you'd change the code by if the registers 
are hard-coded or compiler can choose... But not hardcoding it would be 
the better choice.

--
Mats
>
> Ian.
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:51:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:51:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1u0-0003hY-65; Mon, 26 Nov 2012 16:51:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <s.munaut@whatever-company.com>) id 1Td1tz-0003h7-A2
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:51:23 +0000
Received: from [85.158.139.83:45738] by server-12.bemta-5.messagelabs.com id
	34/57-02886-A0E93B05; Mon, 26 Nov 2012 16:51:22 +0000
X-Env-Sender: s.munaut@whatever-company.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1353948680!28016380!1
X-Originating-IP: [209.85.219.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22443 invoked from network); 26 Nov 2012 16:51:21 -0000
Received: from mail-oa0-f45.google.com (HELO mail-oa0-f45.google.com)
	(209.85.219.45)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:51:21 -0000
Received: by mail-oa0-f45.google.com with SMTP id i18so13451615oag.32
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 08:51:20 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=w92ad4G5PAnO8TN+3lcDQOiDLoHuBbuxejYO3TdFsnk=;
	b=b7Or8Lqj51jWOFgUlUgSZgkqTUmeocIyI/ro7LFXNTDpJwLh/gDG7Qc5Q0K0RKnQow
	xq/R93UbtpUcDIe3JRV9JWBR2tLmL67KQLgY2/eJzla0D6pABfBiFuAhyyGALsuaMXMe
	YcwDqS+ChbKjY5+tPCz0UXd5/OFIZKW7eQ33WNyPN5qhfhStuIB6YTw1gTxbacptabeb
	UnA40LqOYPqkAx6fxD6+esOwettZUZIXsswCOog/nRM0WjkajsoIQPzY79HOgfd7QOyG
	ECYT7QVWgcS0B24OL/gSzcb6t9GNnAXd8nn59qw3q/pH9JuxJE87gK1Skpi8LpMjsMeU
	Uwqg==
MIME-Version: 1.0
Received: by 10.60.172.48 with SMTP id az16mr9521150oec.64.1353948675555; Mon,
	26 Nov 2012 08:51:15 -0800 (PST)
Received: by 10.76.28.234 with HTTP; Mon, 26 Nov 2012 08:51:15 -0800 (PST)
In-Reply-To: <9efb590f-8c59-496b-97ea-8c39d77c203a@default>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
	<CCD9450D.53691%keir@xen.org>
	<9efb590f-8c59-496b-97ea-8c39d77c203a@default>
Date: Mon, 26 Nov 2012 17:51:15 +0100
Message-ID: <CAF6-1L4++pq7nYVVHnOT-dV1tqPMFcJM1JVycMoKYBV6oehPJw@mail.gmail.com>
From: Sylvain Munaut <s.munaut@whatever-company.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
X-Gm-Message-State: ALoCoQlScy844yVE6shpv30g7LIxIL/qBnT+dZFhMZNU7o6/MC30AxpjIEr2ruAXsubKm9KAHsyY
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I've just deployed this to a couple test servers that exhibited the problem.

What I don't really understand is why are some HW affected and not others ?


Cheers,

    Sylvain

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:51:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:51:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1u0-0003hY-65; Mon, 26 Nov 2012 16:51:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <s.munaut@whatever-company.com>) id 1Td1tz-0003h7-A2
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:51:23 +0000
Received: from [85.158.139.83:45738] by server-12.bemta-5.messagelabs.com id
	34/57-02886-A0E93B05; Mon, 26 Nov 2012 16:51:22 +0000
X-Env-Sender: s.munaut@whatever-company.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1353948680!28016380!1
X-Originating-IP: [209.85.219.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22443 invoked from network); 26 Nov 2012 16:51:21 -0000
Received: from mail-oa0-f45.google.com (HELO mail-oa0-f45.google.com)
	(209.85.219.45)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:51:21 -0000
Received: by mail-oa0-f45.google.com with SMTP id i18so13451615oag.32
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 08:51:20 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=w92ad4G5PAnO8TN+3lcDQOiDLoHuBbuxejYO3TdFsnk=;
	b=b7Or8Lqj51jWOFgUlUgSZgkqTUmeocIyI/ro7LFXNTDpJwLh/gDG7Qc5Q0K0RKnQow
	xq/R93UbtpUcDIe3JRV9JWBR2tLmL67KQLgY2/eJzla0D6pABfBiFuAhyyGALsuaMXMe
	YcwDqS+ChbKjY5+tPCz0UXd5/OFIZKW7eQ33WNyPN5qhfhStuIB6YTw1gTxbacptabeb
	UnA40LqOYPqkAx6fxD6+esOwettZUZIXsswCOog/nRM0WjkajsoIQPzY79HOgfd7QOyG
	ECYT7QVWgcS0B24OL/gSzcb6t9GNnAXd8nn59qw3q/pH9JuxJE87gK1Skpi8LpMjsMeU
	Uwqg==
MIME-Version: 1.0
Received: by 10.60.172.48 with SMTP id az16mr9521150oec.64.1353948675555; Mon,
	26 Nov 2012 08:51:15 -0800 (PST)
Received: by 10.76.28.234 with HTTP; Mon, 26 Nov 2012 08:51:15 -0800 (PST)
In-Reply-To: <9efb590f-8c59-496b-97ea-8c39d77c203a@default>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
	<CCD9450D.53691%keir@xen.org>
	<9efb590f-8c59-496b-97ea-8c39d77c203a@default>
Date: Mon, 26 Nov 2012 17:51:15 +0100
Message-ID: <CAF6-1L4++pq7nYVVHnOT-dV1tqPMFcJM1JVycMoKYBV6oehPJw@mail.gmail.com>
From: Sylvain Munaut <s.munaut@whatever-company.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
X-Gm-Message-State: ALoCoQlScy844yVE6shpv30g7LIxIL/qBnT+dZFhMZNU7o6/MC30AxpjIEr2ruAXsubKm9KAHsyY
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I've just deployed this to a couple test servers that exhibited the problem.

What I don't really understand is why are some HW affected and not others ?


Cheers,

    Sylvain

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:51:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:51:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1u8-0003iz-1T; Mon, 26 Nov 2012 16:51:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td1u6-0003iS-Lb
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:51:30 +0000
Received: from [193.109.254.147:65227] by server-14.bemta-14.messagelabs.com
	id CA/13-14517-21E93B05; Mon, 26 Nov 2012 16:51:30 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353948686!8660625!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9667 invoked from network); 26 Nov 2012 16:51:29 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:51:29 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16006705"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:51:26 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 16:51:12 +0000
Message-ID: <1353948671.5830.118.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Date: Mon, 26 Nov 2012 16:51:11 +0000
In-Reply-To: <a8645d836a0eae796443.1353948094@andrewcoop.uk.xensource.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<a8645d836a0eae796443.1353948094@andrewcoop.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 3 of 5] rombios/ata: Reading this status
 register has no relevant side effects
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

No relevant side effects according to some spec or according to the
current qemu implementation?

Does it have any "irrelevant" side effects?

On Mon, 2012-11-26 at 16:41 +0000, Andrew Cooper wrote:
> So taking two traps when one will do is pointless.  This codepath is on the int
> 0x13 hot path, and removing it has about a 30% reduction in the number of traps
> to Qemu during Win7 boot.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> diff -r c223c044afbf -r a8645d836a0e tools/firmware/rombios/rombios.c
> --- a/tools/firmware/rombios/rombios.c
> +++ b/tools/firmware/rombios/rombios.c
> @@ -2540,7 +2540,6 @@ static int await_ide(when_done,base,time
>    Bit32u time=0,last=0;
>    Bit16u status;
>    Bit8u result;
> -  status = inb(base + ATA_CB_STAT); // for the times you're supposed to throw one away
>    for(;;) {
>      status = inb(base+ATA_CB_STAT);
>      time++;
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:51:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:51:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1u8-0003iz-1T; Mon, 26 Nov 2012 16:51:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td1u6-0003iS-Lb
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:51:30 +0000
Received: from [193.109.254.147:65227] by server-14.bemta-14.messagelabs.com
	id CA/13-14517-21E93B05; Mon, 26 Nov 2012 16:51:30 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353948686!8660625!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9667 invoked from network); 26 Nov 2012 16:51:29 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:51:29 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16006705"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:51:26 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 16:51:12 +0000
Message-ID: <1353948671.5830.118.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Date: Mon, 26 Nov 2012 16:51:11 +0000
In-Reply-To: <a8645d836a0eae796443.1353948094@andrewcoop.uk.xensource.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<a8645d836a0eae796443.1353948094@andrewcoop.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 3 of 5] rombios/ata: Reading this status
 register has no relevant side effects
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

No relevant side effects according to some spec or according to the
current qemu implementation?

Does it have any "irrelevant" side effects?

On Mon, 2012-11-26 at 16:41 +0000, Andrew Cooper wrote:
> So taking two traps when one will do is pointless.  This codepath is on the int
> 0x13 hot path, and removing it has about a 30% reduction in the number of traps
> to Qemu during Win7 boot.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> diff -r c223c044afbf -r a8645d836a0e tools/firmware/rombios/rombios.c
> --- a/tools/firmware/rombios/rombios.c
> +++ b/tools/firmware/rombios/rombios.c
> @@ -2540,7 +2540,6 @@ static int await_ide(when_done,base,time
>    Bit32u time=0,last=0;
>    Bit16u status;
>    Bit8u result;
> -  status = inb(base + ATA_CB_STAT); // for the times you're supposed to throw one away
>    for(;;) {
>      status = inb(base+ATA_CB_STAT);
>      time++;
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:53:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:53:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1vr-0003xQ-UF; Mon, 26 Nov 2012 16:53:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1vq-0003x9-EB
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:53:18 +0000
Received: from [85.158.137.99:13040] by server-3.bemta-3.messagelabs.com id
	CF/83-31566-87E93B05; Mon, 26 Nov 2012 16:53:12 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1353948790!15868463!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17313 invoked from network); 26 Nov 2012 16:53:12 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:53:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215489363"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:53:09 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:53:08 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1vg-0005xJ-Dv;
	Mon, 26 Nov 2012 16:53:08 +0000
Message-ID: <50B39E74.7080605@citrix.com>
Date: Mon, 26 Nov 2012 16:53:08 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<1728fb78994054ad3695.1353948092@andrewcoop.uk.xensource.com>
	<1353948513.5830.117.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353948513.5830.117.camel@zakaz.uk.xensource.com>
X-Enigmail-Version: 1.4.6
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1 of 5] rombios/keyboard: Don't needlessly
 poll the status register
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 26/11/12 16:48, Ian Campbell wrote:
> On Mon, 2012-11-26 at 16:41 +0000, Andrew Cooper wrote:
>> Repeated polling of the status register is not going to change its value,
> but the passage of time while doing multiple polls might? If this is not
> the case then something needs to be said about why not.

In reality, we failed to ever get a keypress on the console to appear
here, even when trying.  If I remember correctly (it was a long time ago
now), this code runs before the PCI bus is scanned, so is really early
on during boot.

>
>>  so
>> don't needlessly take 8192 traps to Qemu when 1 will do.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>
>> diff -r 0049de3827bc -r 1728fb789940 tools/firmware/rombios/rombios.c
>> --- a/tools/firmware/rombios/rombios.c
>> +++ b/tools/firmware/rombios/rombios.c
>> @@ -1805,12 +1805,12 @@ keyboard_init()
>>      while ( (inb(0x64) & 0x02) && (--max>0)) outb(0x80, 0x00);
>>  
>>      /* flush incoming keys */
>> -    max=0x2000;
>> +    max=2;
>>      while (--max > 0) {
>>          outb(0x80, 0x00);
>>          if (inb(0x64) & 0x01) {
>>              inb(0x60);
>> -            max = 0x2000;
>> +            max = 2;
>>              }
>>          }
>>  
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:53:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:53:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1vr-0003xQ-UF; Mon, 26 Nov 2012 16:53:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1vq-0003x9-EB
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:53:18 +0000
Received: from [85.158.137.99:13040] by server-3.bemta-3.messagelabs.com id
	CF/83-31566-87E93B05; Mon, 26 Nov 2012 16:53:12 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1353948790!15868463!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17313 invoked from network); 26 Nov 2012 16:53:12 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:53:12 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215489363"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:53:09 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:53:08 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1vg-0005xJ-Dv;
	Mon, 26 Nov 2012 16:53:08 +0000
Message-ID: <50B39E74.7080605@citrix.com>
Date: Mon, 26 Nov 2012 16:53:08 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<1728fb78994054ad3695.1353948092@andrewcoop.uk.xensource.com>
	<1353948513.5830.117.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353948513.5830.117.camel@zakaz.uk.xensource.com>
X-Enigmail-Version: 1.4.6
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1 of 5] rombios/keyboard: Don't needlessly
 poll the status register
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 26/11/12 16:48, Ian Campbell wrote:
> On Mon, 2012-11-26 at 16:41 +0000, Andrew Cooper wrote:
>> Repeated polling of the status register is not going to change its value,
> but the passage of time while doing multiple polls might? If this is not
> the case then something needs to be said about why not.

In reality, we failed to ever get a keypress on the console to appear
here, even when trying.  If I remember correctly (it was a long time ago
now), this code runs before the PCI bus is scanned, so is really early
on during boot.

>
>>  so
>> don't needlessly take 8192 traps to Qemu when 1 will do.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>
>> diff -r 0049de3827bc -r 1728fb789940 tools/firmware/rombios/rombios.c
>> --- a/tools/firmware/rombios/rombios.c
>> +++ b/tools/firmware/rombios/rombios.c
>> @@ -1805,12 +1805,12 @@ keyboard_init()
>>      while ( (inb(0x64) & 0x02) && (--max>0)) outb(0x80, 0x00);
>>  
>>      /* flush incoming keys */
>> -    max=0x2000;
>> +    max=2;
>>      while (--max > 0) {
>>          outb(0x80, 0x00);
>>          if (inb(0x64) & 0x01) {
>>              inb(0x60);
>> -            max = 0x2000;
>> +            max = 2;
>>              }
>>          }
>>  
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:56:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:56:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1yY-0004Cm-H1; Mon, 26 Nov 2012 16:56:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1yW-0004Cb-Rw
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:56:05 +0000
Received: from [85.158.143.35:14111] by server-3.bemta-4.messagelabs.com id
	B4/7E-06841-42F93B05; Mon, 26 Nov 2012 16:56:04 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1353948962!11844094!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU5NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30447 invoked from network); 26 Nov 2012 16:56:03 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:56:03 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="45631416"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:56:01 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:56:01 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1yT-0005z1-9S;
	Mon, 26 Nov 2012 16:56:01 +0000
Message-ID: <50B39F21.5040009@citrix.com>
Date: Mon, 26 Nov 2012 16:56:01 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<a8645d836a0eae796443.1353948094@andrewcoop.uk.xensource.com>
	<1353948671.5830.118.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353948671.5830.118.camel@zakaz.uk.xensource.com>
X-Enigmail-Version: 1.4.6
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 3 of 5] rombios/ata: Reading this status
 register has no relevant side effects
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 26/11/12 16:51, Ian Campbell wrote:
> No relevant side effects according to some spec or according to the
> current qemu implementation?
>
> Does it have any "irrelevant" side effects?

I am not sure whether the spec gurarentees no side effects, but this is
according to the qemu implementation.  The codepath has no side effects
we could determine.

~Andrew

>
> On Mon, 2012-11-26 at 16:41 +0000, Andrew Cooper wrote:
>> So taking two traps when one will do is pointless.  This codepath is on the int
>> 0x13 hot path, and removing it has about a 30% reduction in the number of traps
>> to Qemu during Win7 boot.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>
>> diff -r c223c044afbf -r a8645d836a0e tools/firmware/rombios/rombios.c
>> --- a/tools/firmware/rombios/rombios.c
>> +++ b/tools/firmware/rombios/rombios.c
>> @@ -2540,7 +2540,6 @@ static int await_ide(when_done,base,time
>>    Bit32u time=0,last=0;
>>    Bit16u status;
>>    Bit8u result;
>> -  status = inb(base + ATA_CB_STAT); // for the times you're supposed to throw one away
>>    for(;;) {
>>      status = inb(base+ATA_CB_STAT);
>>      time++;
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:56:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:56:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td1yY-0004Cm-H1; Mon, 26 Nov 2012 16:56:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td1yW-0004Cb-Rw
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:56:05 +0000
Received: from [85.158.143.35:14111] by server-3.bemta-4.messagelabs.com id
	B4/7E-06841-42F93B05; Mon, 26 Nov 2012 16:56:04 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1353948962!11844094!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU5NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30447 invoked from network); 26 Nov 2012 16:56:03 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:56:03 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="45631416"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 16:56:01 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 11:56:01 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td1yT-0005z1-9S;
	Mon, 26 Nov 2012 16:56:01 +0000
Message-ID: <50B39F21.5040009@citrix.com>
Date: Mon, 26 Nov 2012 16:56:01 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<a8645d836a0eae796443.1353948094@andrewcoop.uk.xensource.com>
	<1353948671.5830.118.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353948671.5830.118.camel@zakaz.uk.xensource.com>
X-Enigmail-Version: 1.4.6
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 3 of 5] rombios/ata: Reading this status
 register has no relevant side effects
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 26/11/12 16:51, Ian Campbell wrote:
> No relevant side effects according to some spec or according to the
> current qemu implementation?
>
> Does it have any "irrelevant" side effects?

I am not sure whether the spec gurarentees no side effects, but this is
according to the qemu implementation.  The codepath has no side effects
we could determine.

~Andrew

>
> On Mon, 2012-11-26 at 16:41 +0000, Andrew Cooper wrote:
>> So taking two traps when one will do is pointless.  This codepath is on the int
>> 0x13 hot path, and removing it has about a 30% reduction in the number of traps
>> to Qemu during Win7 boot.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>
>> diff -r c223c044afbf -r a8645d836a0e tools/firmware/rombios/rombios.c
>> --- a/tools/firmware/rombios/rombios.c
>> +++ b/tools/firmware/rombios/rombios.c
>> @@ -2540,7 +2540,6 @@ static int await_ide(when_done,base,time
>>    Bit32u time=0,last=0;
>>    Bit16u status;
>>    Bit8u result;
>> -  status = inb(base + ATA_CB_STAT); // for the times you're supposed to throw one away
>>    for(;;) {
>>      status = inb(base+ATA_CB_STAT);
>>      time++;
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:59:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:59:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td21D-0004NG-34; Mon, 26 Nov 2012 16:58:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td21B-0004N6-SC
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 16:58:50 +0000
Received: from [85.158.137.99:5088] by server-15.bemta-3.messagelabs.com id
	AD/D2-23779-9CF93B05; Mon, 26 Nov 2012 16:58:49 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353949126!15547464!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzUxMjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25428 invoked from network); 26 Nov 2012 16:58:47 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 16:58:47 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQGwV4g023409
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 16:58:32 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQGwUvU000833
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 16:58:31 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQGwUfW029048; Mon, 26 Nov 2012 10:58:30 -0600
MIME-Version: 1.0
Message-ID: <cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
Date: Mon, 26 Nov 2012 08:58:28 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>,
	=?utf-8?B?UGFzaSBLw6Rya2vDpGluZW4=?= <pasik@iki.fi>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353677623.16973.13.camel@zakaz.uk.xensource.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: xen-devel@lists.xensource.com, Alexander Bienzeisler <chosi@amd.co.at>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

PiBGcm9tOiBJYW4gQ2FtcGJlbGwgW21haWx0bzpJYW4uQ2FtcGJlbGxAY2l0cml4LmNvbV0KPiBT
ZW50OiBGcmlkYXksIE5vdmVtYmVyIDIzLCAyMDEyIDY6MzQgQU0KPiBUbzogUGFzaSBLw6Rya2vD
pGluZW4KPiBDYzogeGVuLWRldmVsQGxpc3RzLnhlbnNvdXJjZS5jb207IEFsZXhhbmRlciBCaWVu
emVpc2xlcgo+IFN1YmplY3Q6IFJlOiBbWGVuLWRldmVsXSBjYW4gbm90IHVzZSBhbGwgYXZhaWxh
YmxlIG1lbW9yeQo+IAo+IE9uIEZyaSwgMjAxMi0xMS0yMyBhdCAx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zZXJ2aWNlCnByb3ZpZGVycyBJ
IGFtIHRyeWluZyB0byBoZWxwIGhlcmUuCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54
ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:59:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:59:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td21D-0004NG-34; Mon, 26 Nov 2012 16:58:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td21B-0004N6-SC
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 16:58:50 +0000
Received: from [85.158.137.99:5088] by server-15.bemta-3.messagelabs.com id
	AD/D2-23779-9CF93B05; Mon, 26 Nov 2012 16:58:49 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1353949126!15547464!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzUxMjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25428 invoked from network); 26 Nov 2012 16:58:47 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 16:58:47 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQGwV4g023409
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 16:58:32 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQGwUvU000833
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 16:58:31 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQGwUfW029048; Mon, 26 Nov 2012 10:58:30 -0600
MIME-Version: 1.0
Message-ID: <cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
Date: Mon, 26 Nov 2012 08:58:28 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>,
	=?utf-8?B?UGFzaSBLw6Rya2vDpGluZW4=?= <pasik@iki.fi>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353677623.16973.13.camel@zakaz.uk.xensource.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: xen-devel@lists.xensource.com, Alexander Bienzeisler <chosi@amd.co.at>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

PiBGcm9tOiBJYW4gQ2FtcGJlbGwgW21haWx0bzpJYW4uQ2FtcGJlbGxAY2l0cml4LmNvbV0KPiBT
ZW50OiBGcmlkYXksIE5vdmVtYmVyIDIzLCAyMDEyIDY6MzQgQU0KPiBUbzogUGFzaSBLw6Rya2vD
pGluZW4KPiBDYzogeGVuLWRldmVsQGxpc3RzLnhlbnNvdXJjZS5jb207IEFsZXhhbmRlciBCaWVu
emVpc2xlcgo+IFN1YmplY3Q6IFJlOiBbWGVuLWRldmVsXSBjYW4gbm90IHVzZSBhbGwgYXZhaWxh
YmxlIG1lbW9yeQo+IAo+IE9uIEZyaSwgMjAxMi0xMS0yMyBhdCAxMzoyOSArMDAwMCwgUGFzaSBL
w6Rya2vDpGluZW4gd3JvdGU6Cj4gPiBPbiBGcmksIE5vdiAyMywgMjAxMiBhdCAwMToxNTo1M1BN
ICswMDAwLCBJYW4gQ2FtcGJlbGwgd3JvdGU6Cj4gPiA+IE9uIEZyaSwgMjAxMi0xMS0yMyBhdCAx
Mjo1NSArMDAwMCwgUGFzaSBLw6Rya2vDpGluZW4gd3JvdGU6Cj4gPiA+Cj4gPiA+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26 16:59:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:59:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td228-0004Sd-NZ; Mon, 26 Nov 2012 16:59:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1Td227-0004SV-NV
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:59:47 +0000
Received: from [193.109.254.147:38294] by server-5.bemta-14.messagelabs.com id
	4A/78-10257-300A3B05; Mon, 26 Nov 2012 16:59:47 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1353949185!8592464!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6938 invoked from network); 26 Nov 2012 16:59:46 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:59:46 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215490463"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	26 Nov 2012 16:59:45 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.318.1;
	Mon, 26 Nov 2012 11:59:44 -0500
Message-ID: <50B39FFF.6000209@citrix.com>
Date: Mon, 26 Nov 2012 16:59:43 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
	<CCD9450D.53691%keir@xen.org>	<9efb590f-8c59-496b-97ea-8c39d77c203a@default>
	<CAF6-1L4++pq7nYVVHnOT-dV1tqPMFcJM1JVycMoKYBV6oehPJw@mail.gmail.com>
In-Reply-To: <CAF6-1L4++pq7nYVVHnOT-dV1tqPMFcJM1JVycMoKYBV6oehPJw@mail.gmail.com>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 26/11/12 16:51, Sylvain Munaut wrote:
> I've just deployed this to a couple test servers that exhibited the problem.
>
> What I don't really understand is why are some HW affected and not others ?
I have no idea why some machines are more affected than others, but I 
can clearly see what Jan is saying, and how it will cause "weird" things 
to happen - but only if you hit the case where the calls are made in the 
right pattern, which I think is a matter of "luck". It will probably 
also matter what version of gcc is used to compile the code - different 
compiler versions will use registers in different ways.

--
Mats
>
>
> Cheers,
>
>      Sylvain
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 16:59:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 16:59:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td228-0004Sd-NZ; Mon, 26 Nov 2012 16:59:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1Td227-0004SV-NV
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 16:59:47 +0000
Received: from [193.109.254.147:38294] by server-5.bemta-14.messagelabs.com id
	4A/78-10257-300A3B05; Mon, 26 Nov 2012 16:59:47 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1353949185!8592464!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6938 invoked from network); 26 Nov 2012 16:59:46 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 16:59:46 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215490463"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	26 Nov 2012 16:59:45 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.318.1;
	Mon, 26 Nov 2012 11:59:44 -0500
Message-ID: <50B39FFF.6000209@citrix.com>
Date: Mon, 26 Nov 2012 16:59:43 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
	<CCD9450D.53691%keir@xen.org>	<9efb590f-8c59-496b-97ea-8c39d77c203a@default>
	<CAF6-1L4++pq7nYVVHnOT-dV1tqPMFcJM1JVycMoKYBV6oehPJw@mail.gmail.com>
In-Reply-To: <CAF6-1L4++pq7nYVVHnOT-dV1tqPMFcJM1JVycMoKYBV6oehPJw@mail.gmail.com>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 26/11/12 16:51, Sylvain Munaut wrote:
> I've just deployed this to a couple test servers that exhibited the problem.
>
> What I don't really understand is why are some HW affected and not others ?
I have no idea why some machines are more affected than others, but I 
can clearly see what Jan is saying, and how it will cause "weird" things 
to happen - but only if you hit the case where the calls are made in the 
right pattern, which I think is a matter of "luck". It will probably 
also matter what version of gcc is used to compile the code - different 
compiler versions will use registers in different ways.

--
Mats
>
>
> Cheers,
>
>      Sylvain
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 17:01:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 17:01:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td23j-0004h2-BW; Mon, 26 Nov 2012 17:01:27 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td23h-0004gq-Ok
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 17:01:25 +0000
Received: from [193.109.254.147:49202] by server-13.bemta-14.messagelabs.com
	id E2/ED-11239-560A3B05; Mon, 26 Nov 2012 17:01:25 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1353949282!897497!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1277 invoked from network); 26 Nov 2012 17:01:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 17:01:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16006954"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 17:01:22 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 17:01:22 +0000
Message-ID: <1353949281.5830.126.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Date: Mon, 26 Nov 2012 17:01:21 +0000
In-Reply-To: <50B39F21.5040009@citrix.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<a8645d836a0eae796443.1353948094@andrewcoop.uk.xensource.com>
	<1353948671.5830.118.camel@zakaz.uk.xensource.com>
	<50B39F21.5040009@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 3 of 5] rombios/ata: Reading this status
 register has no relevant side effects
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 16:56 +0000, Andrew Cooper wrote:
> On 26/11/12 16:51, Ian Campbell wrote:
> > No relevant side effects according to some spec or according to the
> > current qemu implementation?
> >
> > Does it have any "irrelevant" side effects?
> 
> I am not sure whether the spec gurarentees no side effects, but this is
> according to the qemu implementation.

This sort of thing is a critical part of the commit message, for the
benefit of some future bug hunter if qemu ever changes this. Although to
be honest this possibility makes me rather sceptical of this sort of
change in the first place.

>   The codepath has no side effects
> we could determine.
> 
> ~Andrew
> 
> >
> > On Mon, 2012-11-26 at 16:41 +0000, Andrew Cooper wrote:
> >> So taking two traps when one will do is pointless.  This codepath is on the int
> >> 0x13 hot path, and removing it has about a 30% reduction in the number of traps
> >> to Qemu during Win7 boot.
> >>
> >> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> >>
> >> diff -r c223c044afbf -r a8645d836a0e tools/firmware/rombios/rombios.c
> >> --- a/tools/firmware/rombios/rombios.c
> >> +++ b/tools/firmware/rombios/rombios.c
> >> @@ -2540,7 +2540,6 @@ static int await_ide(when_done,base,time
> >>    Bit32u time=0,last=0;
> >>    Bit16u status;
> >>    Bit8u result;
> >> -  status = inb(base + ATA_CB_STAT); // for the times you're supposed to throw one away
> >>    for(;;) {
> >>      status = inb(base+ATA_CB_STAT);
> >>      time++;
> >>
> >> _______________________________________________
> >> Xen-devel mailing list
> >> Xen-devel@lists.xen.org
> >> http://lists.xen.org/xen-devel
> >
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 17:01:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 17:01:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td23j-0004h2-BW; Mon, 26 Nov 2012 17:01:27 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td23h-0004gq-Ok
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 17:01:25 +0000
Received: from [193.109.254.147:49202] by server-13.bemta-14.messagelabs.com
	id E2/ED-11239-560A3B05; Mon, 26 Nov 2012 17:01:25 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1353949282!897497!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1277 invoked from network); 26 Nov 2012 17:01:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 17:01:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16006954"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 17:01:22 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 17:01:22 +0000
Message-ID: <1353949281.5830.126.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Date: Mon, 26 Nov 2012 17:01:21 +0000
In-Reply-To: <50B39F21.5040009@citrix.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<a8645d836a0eae796443.1353948094@andrewcoop.uk.xensource.com>
	<1353948671.5830.118.camel@zakaz.uk.xensource.com>
	<50B39F21.5040009@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 3 of 5] rombios/ata: Reading this status
 register has no relevant side effects
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 16:56 +0000, Andrew Cooper wrote:
> On 26/11/12 16:51, Ian Campbell wrote:
> > No relevant side effects according to some spec or according to the
> > current qemu implementation?
> >
> > Does it have any "irrelevant" side effects?
> 
> I am not sure whether the spec gurarentees no side effects, but this is
> according to the qemu implementation.

This sort of thing is a critical part of the commit message, for the
benefit of some future bug hunter if qemu ever changes this. Although to
be honest this possibility makes me rather sceptical of this sort of
change in the first place.

>   The codepath has no side effects
> we could determine.
> 
> ~Andrew
> 
> >
> > On Mon, 2012-11-26 at 16:41 +0000, Andrew Cooper wrote:
> >> So taking two traps when one will do is pointless.  This codepath is on the int
> >> 0x13 hot path, and removing it has about a 30% reduction in the number of traps
> >> to Qemu during Win7 boot.
> >>
> >> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> >>
> >> diff -r c223c044afbf -r a8645d836a0e tools/firmware/rombios/rombios.c
> >> --- a/tools/firmware/rombios/rombios.c
> >> +++ b/tools/firmware/rombios/rombios.c
> >> @@ -2540,7 +2540,6 @@ static int await_ide(when_done,base,time
> >>    Bit32u time=0,last=0;
> >>    Bit16u status;
> >>    Bit8u result;
> >> -  status = inb(base + ATA_CB_STAT); // for the times you're supposed to throw one away
> >>    for(;;) {
> >>      status = inb(base+ATA_CB_STAT);
> >>      time++;
> >>
> >> _______________________________________________
> >> Xen-devel mailing list
> >> Xen-devel@lists.xen.org
> >> http://lists.xen.org/xen-devel
> >
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 17:12:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 17:12:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td2Ee-00055D-Lj; Mon, 26 Nov 2012 17:12:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td2Ed-000558-Dh
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 17:12:43 +0000
Received: from [85.158.143.35:23729] by server-3.bemta-4.messagelabs.com id
	67/74-06841-A03A3B05; Mon, 26 Nov 2012 17:12:42 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1353949960!4191090!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzUxMjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2763 invoked from network); 26 Nov 2012 17:12:41 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-5.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 17:12:41 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQHCdUN010889
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 17:12:39 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQHCcou008893
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 17:12:38 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQHCb9B008970; Mon, 26 Nov 2012 11:12:38 -0600
MIME-Version: 1.0
Message-ID: <fd048b2a-ec5d-4c0e-a800-7567eecc4211@default>
Date: Mon, 26 Nov 2012 09:12:36 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Sylvain Munaut <s.munaut@whatever-company.com>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
	<CCD9450D.53691%keir@xen.org>
	<9efb590f-8c59-496b-97ea-8c39d77c203a@default>
	<CAF6-1L4++pq7nYVVHnOT-dV1tqPMFcJM1JVycMoKYBV6oehPJw@mail.gmail.com>
In-Reply-To: <CAF6-1L4++pq7nYVVHnOT-dV1tqPMFcJM1JVycMoKYBV6oehPJw@mail.gmail.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Sylvain Munaut [mailto:s.munaut@whatever-company.com]
> Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
> 
> I've just deployed this to a couple test servers that exhibited the problem.
> 
> What I don't really understand is why are some HW affected and not others ?

I don't know, but I'd imagine there is something in the x86 platform
software (aka firmware) of those machines that runs and blocks execution
of Xen for long enough (via NMI/MCE/SMI) for the platform timer to
overflow, and this doesn't occur on other machines.

Maybe Jan has a better idea...

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 17:12:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 17:12:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td2Ee-00055D-Lj; Mon, 26 Nov 2012 17:12:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td2Ed-000558-Dh
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 17:12:43 +0000
Received: from [85.158.143.35:23729] by server-3.bemta-4.messagelabs.com id
	67/74-06841-A03A3B05; Mon, 26 Nov 2012 17:12:42 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1353949960!4191090!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzUxMjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2763 invoked from network); 26 Nov 2012 17:12:41 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-5.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 17:12:41 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQHCdUN010889
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 17:12:39 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQHCcou008893
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 17:12:38 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQHCb9B008970; Mon, 26 Nov 2012 11:12:38 -0600
MIME-Version: 1.0
Message-ID: <fd048b2a-ec5d-4c0e-a800-7567eecc4211@default>
Date: Mon, 26 Nov 2012 09:12:36 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Sylvain Munaut <s.munaut@whatever-company.com>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
	<CCD9450D.53691%keir@xen.org>
	<9efb590f-8c59-496b-97ea-8c39d77c203a@default>
	<CAF6-1L4++pq7nYVVHnOT-dV1tqPMFcJM1JVycMoKYBV6oehPJw@mail.gmail.com>
In-Reply-To: <CAF6-1L4++pq7nYVVHnOT-dV1tqPMFcJM1JVycMoKYBV6oehPJw@mail.gmail.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Sylvain Munaut [mailto:s.munaut@whatever-company.com]
> Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
> 
> I've just deployed this to a couple test servers that exhibited the problem.
> 
> What I don't really understand is why are some HW affected and not others ?

I don't know, but I'd imagine there is something in the x86 platform
software (aka firmware) of those machines that runs and blocks execution
of Xen for long enough (via NMI/MCE/SMI) for the platform timer to
overflow, and this doesn't occur on other machines.

Maybe Jan has a better idea...

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 17:13:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 17:13:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td2Ew-00056w-3A; Mon, 26 Nov 2012 17:13:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td2Eu-00056m-Ss
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 17:13:01 +0000
Received: from [85.158.143.35:14412] by server-1.bemta-4.messagelabs.com id
	EC/5C-27934-C13A3B05; Mon, 26 Nov 2012 17:13:00 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1353949972!15016331!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25273 invoked from network); 26 Nov 2012 17:12:53 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-13.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 17:12:53 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16007226"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 17:12:33 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 17:12:33 +0000
Message-ID: <1353949952.5830.131.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Mon, 26 Nov 2012 17:12:32 +0000
In-Reply-To: <50B3AA3902000078000AB47D@nat28.tlf.novell.com>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
	<1353947485.5830.104.camel@zakaz.uk.xensource.com>
	<50B3AA3902000078000AB47D@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 16:43 +0000, Jan Beulich wrote:
> >>> On 26.11.12 at 17:31, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Mon, 2012-11-26 at 15:23 +0000, Jan Beulich wrote:
> >> The way it was coded, it clobbered %rdx without telling the compiler.
> >> This generally didn't cause any problems except when there are two back
> >> to back invocations (as in plt_overflow()), as in that case the
> >> compiler may validly assume that it can re-use for the second instance
> >> the value loaded into %rdx before the first one.
> >> 
> >> Once at it, also properly relax the second operand of "mul" (there's no
> >> need for it to be in %rdx, or a register at all), and switch away from
> >> using explicit register names in the instruction operands.
> >> 
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >> 
> >> --- a/xen/arch/x86/time.c
> >> +++ b/xen/arch/x86/time.c
> >> @@ -127,8 +127,9 @@ static inline u64 scale_delta(u64 delta,
> >>          delta <<= scale->shift;
> >>  
> >>      asm (
> >> -        "mul %%rdx ; shrd $32,%%rdx,%%rax"
> >> -        : "=a" (product) : "0" (delta), "d" ((u64)scale->mul_frac) );
> >> +        "mul %2 ; shrd $32,%1,%0"
> >> +        : "=a" (product), "=d" (delta)
> >> +        : "rm" (delta), "0" ((u64)scale->mul_frac) );
> > 
> > OOI is there a reason to favour an output constraint overwriting delta,
> > which is then thrown away, over a straightforward clobber of rdx?
> 
> Yes - with a clobber of %rdx the compiler can't pass "delta" in that
> register.

Ah, of course.

> > It's also a bit confusing to use %1 and %0 with the shrd since you
> > aren't actually using the things specified by the constraints but rather
> > the outputs of the mul which happen to (now) be in those registers, I'd
> > argue that the previous use of the explicit names was more correctly
> > describing what was going on. As it is I was wondering how
> >         shrd $32,delta,product
> > could possibly make sense.
> 
> That's how things are with multi-insn asm-s (and even with single-
> insn ones when an output different from an input get tied together
> through using the same register). I continue to think that using the
> numbered forms here is better.

I think the important difference here is that the mul generates its
result specifically in rdx:rax rather than user specified registers.
Since the output is not specified via the constraints IMHO using the
constraints when subsequently consuming those outputs is confusing.

I'd agree with you if mul was something like "mul %2,%0,%1" (where %2*%
rax =>%0:%1) then "shrd $32,%0,%1" would be perfectly fine.

Anyway I guess we'll have to agree to disagree. In any case your opinion
trumps mine on this code ;-)

> > Since delta is the first argument to the containing function would it be
> > helpful to put that in rax, where it already is due to the calling
> > convention? I suppose any difference is overwhelmed by the multiply
> > anyway.
> 
> The first argument of a "real" function would be in %rdi.

Oops, yes.

> This being an inline function, there's no calling convention anyway.

Right.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 17:13:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 17:13:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td2Ew-00056w-3A; Mon, 26 Nov 2012 17:13:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td2Eu-00056m-Ss
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 17:13:01 +0000
Received: from [85.158.143.35:14412] by server-1.bemta-4.messagelabs.com id
	EC/5C-27934-C13A3B05; Mon, 26 Nov 2012 17:13:00 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1353949972!15016331!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25273 invoked from network); 26 Nov 2012 17:12:53 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-13.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 17:12:53 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16007226"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 17:12:33 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 17:12:33 +0000
Message-ID: <1353949952.5830.131.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Mon, 26 Nov 2012 17:12:32 +0000
In-Reply-To: <50B3AA3902000078000AB47D@nat28.tlf.novell.com>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
	<1353947485.5830.104.camel@zakaz.uk.xensource.com>
	<50B3AA3902000078000AB47D@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 16:43 +0000, Jan Beulich wrote:
> >>> On 26.11.12 at 17:31, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Mon, 2012-11-26 at 15:23 +0000, Jan Beulich wrote:
> >> The way it was coded, it clobbered %rdx without telling the compiler.
> >> This generally didn't cause any problems except when there are two back
> >> to back invocations (as in plt_overflow()), as in that case the
> >> compiler may validly assume that it can re-use for the second instance
> >> the value loaded into %rdx before the first one.
> >> 
> >> Once at it, also properly relax the second operand of "mul" (there's no
> >> need for it to be in %rdx, or a register at all), and switch away from
> >> using explicit register names in the instruction operands.
> >> 
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >> 
> >> --- a/xen/arch/x86/time.c
> >> +++ b/xen/arch/x86/time.c
> >> @@ -127,8 +127,9 @@ static inline u64 scale_delta(u64 delta,
> >>          delta <<= scale->shift;
> >>  
> >>      asm (
> >> -        "mul %%rdx ; shrd $32,%%rdx,%%rax"
> >> -        : "=a" (product) : "0" (delta), "d" ((u64)scale->mul_frac) );
> >> +        "mul %2 ; shrd $32,%1,%0"
> >> +        : "=a" (product), "=d" (delta)
> >> +        : "rm" (delta), "0" ((u64)scale->mul_frac) );
> > 
> > OOI is there a reason to favour an output constraint overwriting delta,
> > which is then thrown away, over a straightforward clobber of rdx?
> 
> Yes - with a clobber of %rdx the compiler can't pass "delta" in that
> register.

Ah, of course.

> > It's also a bit confusing to use %1 and %0 with the shrd since you
> > aren't actually using the things specified by the constraints but rather
> > the outputs of the mul which happen to (now) be in those registers, I'd
> > argue that the previous use of the explicit names was more correctly
> > describing what was going on. As it is I was wondering how
> >         shrd $32,delta,product
> > could possibly make sense.
> 
> That's how things are with multi-insn asm-s (and even with single-
> insn ones when an output different from an input get tied together
> through using the same register). I continue to think that using the
> numbered forms here is better.

I think the important difference here is that the mul generates its
result specifically in rdx:rax rather than user specified registers.
Since the output is not specified via the constraints IMHO using the
constraints when subsequently consuming those outputs is confusing.

I'd agree with you if mul was something like "mul %2,%0,%1" (where %2*%
rax =>%0:%1) then "shrd $32,%0,%1" would be perfectly fine.

Anyway I guess we'll have to agree to disagree. In any case your opinion
trumps mine on this code ;-)

> > Since delta is the first argument to the containing function would it be
> > helpful to put that in rax, where it already is due to the calling
> > convention? I suppose any difference is overwhelmed by the multiply
> > anyway.
> 
> The first argument of a "real" function would be in %rdi.

Oops, yes.

> This being an inline function, there's no calling convention anyway.

Right.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 17:24:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 17:24:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td2Pg-0005Y7-AQ; Mon, 26 Nov 2012 17:24:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td2Pe-0005Y2-D2
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 17:24:06 +0000
Received: from [85.158.143.35:7124] by server-3.bemta-4.messagelabs.com id
	1A/61-06841-5B5A3B05; Mon, 26 Nov 2012 17:24:05 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1353950643!4192542!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13141 invoked from network); 26 Nov 2012 17:24:04 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 17:24:04 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16007444"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 17:24:03 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 17:24:03 +0000
Message-ID: <1353950642.5830.134.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Mon, 26 Nov 2012 17:24:02 +0000
In-Reply-To: <50B3A8DA02000078000AB460@nat28.tlf.novell.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<50B3A8DA02000078000AB460@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Lars Kurth <lars.kurth@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 16:37 +0000, Jan Beulich wrote:
> >>> On 26.11.12 at 16:58, Ian Campbell <Ian.Campbell@citrix.com> wrote:

> > Changesets are nominated for inclusion in the stable branch by making a
> > request to the stable maintainer on xen-devel either by noting it as
> > such in the submission of the original patch to xen-unstable or by a
> > subsequent explicit email to xen-devel.
> 
> I think we should explicitly require the person expected to do the
> backport to be Cc-ed; I for myself don't get around to read _all_
> mails on xen-devel, and hence with a badly chosen subject it is not
> impossible (albeit also not likely) for me to miss such a request
> otherwise.
> 
> Furthermore, the branch maintainer should imo explicitly be given
> discretion to pull in patches without explicit request on the list

How about this, I don't think we need to explicitly consider the "please
revert it" case -- should be self evident?

8<----------------------------------------

Changesets are included in the stable branch at the discretion of the
branch maintainer.

As well as changesets identified by the branch maintainer as being suitable
for backport changes can also be nominated for inclusion in the stable
branch by making a request to the stable maintainer on xen-devel
either by noting it as such in the submission of the original patch to
xen-unstable or by a subsequent explicit email to xen-devel. Such
requests should be copied to the relevant stable maintainer. In
addition as part of the the stable release process the stable
maintainer will send one or more requests to xen-devel soliciting
suggestions for patches which should be included.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 17:24:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 17:24:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td2Pg-0005Y7-AQ; Mon, 26 Nov 2012 17:24:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Td2Pe-0005Y2-D2
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 17:24:06 +0000
Received: from [85.158.143.35:7124] by server-3.bemta-4.messagelabs.com id
	1A/61-06841-5B5A3B05; Mon, 26 Nov 2012 17:24:05 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1353950643!4192542!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13141 invoked from network); 26 Nov 2012 17:24:04 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 17:24:04 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="16007444"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 17:24:03 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 17:24:03 +0000
Message-ID: <1353950642.5830.134.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Mon, 26 Nov 2012 17:24:02 +0000
In-Reply-To: <50B3A8DA02000078000AB460@nat28.tlf.novell.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<50B3A8DA02000078000AB460@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Lars Kurth <lars.kurth@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 16:37 +0000, Jan Beulich wrote:
> >>> On 26.11.12 at 16:58, Ian Campbell <Ian.Campbell@citrix.com> wrote:

> > Changesets are nominated for inclusion in the stable branch by making a
> > request to the stable maintainer on xen-devel either by noting it as
> > such in the submission of the original patch to xen-unstable or by a
> > subsequent explicit email to xen-devel.
> 
> I think we should explicitly require the person expected to do the
> backport to be Cc-ed; I for myself don't get around to read _all_
> mails on xen-devel, and hence with a badly chosen subject it is not
> impossible (albeit also not likely) for me to miss such a request
> otherwise.
> 
> Furthermore, the branch maintainer should imo explicitly be given
> discretion to pull in patches without explicit request on the list

How about this, I don't think we need to explicitly consider the "please
revert it" case -- should be self evident?

8<----------------------------------------

Changesets are included in the stable branch at the discretion of the
branch maintainer.

As well as changesets identified by the branch maintainer as being suitable
for backport changes can also be nominated for inclusion in the stable
branch by making a request to the stable maintainer on xen-devel
either by noting it as such in the submission of the original patch to
xen-unstable or by a subsequent explicit email to xen-devel. Such
requests should be copied to the relevant stable maintainer. In
addition as part of the the stable release process the stable
maintainer will send one or more requests to xen-devel soliciting
suggestions for patches which should be included.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 17:57:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 17:57:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td2vv-0005sc-DI; Mon, 26 Nov 2012 17:57:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1Td2vt-0005sX-QM
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 17:57:26 +0000
Received: from [85.158.138.51:63793] by server-3.bemta-3.messagelabs.com id
	FD/CD-31566-08DA3B05; Mon, 26 Nov 2012 17:57:20 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1353952639!23630382!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=1.5 required=7.0 tests=HTML_00_10,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12469 invoked from network); 26 Nov 2012 17:57:20 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 17:57:20 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl17so4208855vcb.32
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 09:57:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:content-type;
	bh=2qOq1J2xHNJpwsiN698CJkxFVKYOYx+ZF4fjDgeW4ig=;
	b=ZG2RHXLM++4BeYzepwiW2QA8Rzf7qrwDhEUsfjk8Ct3Iyh+F4BTu6pxOPHC9isrYa1
	n+x8n9JMx+9yTKHHjqd2rOeii9yZvU0RuPFWU9cFXchy00brepC/r7Mt+H6RVUmHEB5E
	EC+4kgAA/Mi20NvdWzcGzTgan8g2/npG9KMpXWyYwYS3be2ko8DR3nnIfYvWPJlT9g5u
	EVQJTIfyZvZVXZZ8joVrFq+qZG8hndBQe0l7zNQA5TBu90pXv68FMSFkRC7b+6O84jJg
	l8N/0SPckqZJWpd7tNEIsWMhSzKaEFLPelAn9QtAirTcNs0HmR05CrunzWr804kr8a7R
	uyfQ==
MIME-Version: 1.0
Received: by 10.52.92.144 with SMTP id cm16mr17540363vdb.36.1353952638716;
	Mon, 26 Nov 2012 09:57:18 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Mon, 26 Nov 2012 09:57:18 -0800 (PST)
Date: Mon, 26 Nov 2012 17:57:18 +0000
X-Google-Sender-Auth: zJVCX1SAaS_P_Liwwg0ItlS_K6w
Message-ID: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
From: George Dunlap <dunlapg@umich.edu>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, 
	Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
Subject: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0085240835899701453=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0085240835899701453==
Content-Type: multipart/alternative; boundary=20cf307cff9612cb3504cf69aa01

--20cf307cff9612cb3504cf69aa01
Content-Type: text/plain; charset=ISO-8859-1

So while doing a bit of investigation into a request that we have
instructions for how to sign a Xen binary, I came across a related pair of
questions.  If we boot from a signed Xen binary, then:
1. Will Xen then successfully boot a signed dom0 kernel / initrd?
2. Will Xen fail to boot an unsigned dom0 kernel / initrd?

I think if Xen is signed, then ideally we want both 1 and 2 to be true,
right?  Does UEFI provide a way to check the signature of files?  Does it
happen automatically, or would we need to add extra support?  Or would we
need to embed a public key within the Xen binary and have Xen check the
signatures of files that it reads?

 -George

--20cf307cff9612cb3504cf69aa01
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

So while doing a bit of investigation into a request that we have instructi=
ons for how to sign a Xen binary, I came across a related pair of questions=
.=A0 If we boot from a signed Xen binary, then:<br>1. Will Xen then success=
fully boot a signed dom0 kernel / initrd?<br>
2. Will Xen fail to boot an unsigned dom0 kernel / initrd?<br><br>I think i=
f Xen is signed, then ideally we want both 1 and 2 to be true, right?=A0 Do=
es UEFI provide a way to check the signature of files?=A0 Does it happen au=
tomatically, or would we need to add extra support?=A0 Or would we need to =
embed a public key within the Xen binary and have Xen check the signatures =
of files that it reads?<br>
<br>=A0-George<br>

--20cf307cff9612cb3504cf69aa01--


--===============0085240835899701453==
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.xen.org
http://lists.xen.org/xen-devel

--===============0085240835899701453==--


From xen-devel-bounces@lists.xen.org Mon Nov 26 17:57:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 17:57:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td2vv-0005sc-DI; Mon, 26 Nov 2012 17:57:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1Td2vt-0005sX-QM
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 17:57:26 +0000
Received: from [85.158.138.51:63793] by server-3.bemta-3.messagelabs.com id
	FD/CD-31566-08DA3B05; Mon, 26 Nov 2012 17:57:20 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1353952639!23630382!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=1.5 required=7.0 tests=HTML_00_10,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12469 invoked from network); 26 Nov 2012 17:57:20 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 17:57:20 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl17so4208855vcb.32
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 09:57:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:content-type;
	bh=2qOq1J2xHNJpwsiN698CJkxFVKYOYx+ZF4fjDgeW4ig=;
	b=ZG2RHXLM++4BeYzepwiW2QA8Rzf7qrwDhEUsfjk8Ct3Iyh+F4BTu6pxOPHC9isrYa1
	n+x8n9JMx+9yTKHHjqd2rOeii9yZvU0RuPFWU9cFXchy00brepC/r7Mt+H6RVUmHEB5E
	EC+4kgAA/Mi20NvdWzcGzTgan8g2/npG9KMpXWyYwYS3be2ko8DR3nnIfYvWPJlT9g5u
	EVQJTIfyZvZVXZZ8joVrFq+qZG8hndBQe0l7zNQA5TBu90pXv68FMSFkRC7b+6O84jJg
	l8N/0SPckqZJWpd7tNEIsWMhSzKaEFLPelAn9QtAirTcNs0HmR05CrunzWr804kr8a7R
	uyfQ==
MIME-Version: 1.0
Received: by 10.52.92.144 with SMTP id cm16mr17540363vdb.36.1353952638716;
	Mon, 26 Nov 2012 09:57:18 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Mon, 26 Nov 2012 09:57:18 -0800 (PST)
Date: Mon, 26 Nov 2012 17:57:18 +0000
X-Google-Sender-Auth: zJVCX1SAaS_P_Liwwg0ItlS_K6w
Message-ID: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
From: George Dunlap <dunlapg@umich.edu>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, 
	Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
Subject: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0085240835899701453=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0085240835899701453==
Content-Type: multipart/alternative; boundary=20cf307cff9612cb3504cf69aa01

--20cf307cff9612cb3504cf69aa01
Content-Type: text/plain; charset=ISO-8859-1

So while doing a bit of investigation into a request that we have
instructions for how to sign a Xen binary, I came across a related pair of
questions.  If we boot from a signed Xen binary, then:
1. Will Xen then successfully boot a signed dom0 kernel / initrd?
2. Will Xen fail to boot an unsigned dom0 kernel / initrd?

I think if Xen is signed, then ideally we want both 1 and 2 to be true,
right?  Does UEFI provide a way to check the signature of files?  Does it
happen automatically, or would we need to add extra support?  Or would we
need to embed a public key within the Xen binary and have Xen check the
signatures of files that it reads?

 -George

--20cf307cff9612cb3504cf69aa01
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

So while doing a bit of investigation into a request that we have instructi=
ons for how to sign a Xen binary, I came across a related pair of questions=
.=A0 If we boot from a signed Xen binary, then:<br>1. Will Xen then success=
fully boot a signed dom0 kernel / initrd?<br>
2. Will Xen fail to boot an unsigned dom0 kernel / initrd?<br><br>I think i=
f Xen is signed, then ideally we want both 1 and 2 to be true, right?=A0 Do=
es UEFI provide a way to check the signature of files?=A0 Does it happen au=
tomatically, or would we need to add extra support?=A0 Or would we need to =
embed a public key within the Xen binary and have Xen check the signatures =
of files that it reads?<br>
<br>=A0-George<br>

--20cf307cff9612cb3504cf69aa01--


--===============0085240835899701453==
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.xen.org
http://lists.xen.org/xen-devel

--===============0085240835899701453==--


From xen-devel-bounces@lists.xen.org Mon Nov 26 18:01:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 18:01:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td2zh-00063J-3m; Mon, 26 Nov 2012 18:01:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td2zg-000635-29
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 18:01:20 +0000
Received: from [85.158.143.35:19343] by server-3.bemta-4.messagelabs.com id
	13/E4-06841-E6EA3B05; Mon, 26 Nov 2012 18:01:18 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1353952876!15021898!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzUxMjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4479 invoked from network); 26 Nov 2012 18:01:17 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-13.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 18:01:17 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQI1DEG002351
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 18:01:14 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQI1CkX003739
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 18:01:13 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQI1CwE008650; Mon, 26 Nov 2012 12:01:12 -0600
MIME-Version: 1.0
Message-ID: <29526822-237d-45f0-87eb-0b5ca53f010b@default>
Date: Mon, 26 Nov 2012 10:01:10 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Andres Lagar-Cavilla <andreslc@gridcentric.ca>, xen-devel@lists.xen.org,
	Jan Beulich <JBeulich@suse.com>
References: <mailman.16877.1353355647.1399.xen-devel@lists.xen.org>
	<1F985F20-30DE-4E12-AC8B-68FCA5DABF8F@gridcentric.ca>
	<e87e0192-e0d5-4f35-8b20-fb82c431c918@default>
In-Reply-To: <e87e0192-e0d5-4f35-8b20-fb82c431c918@default>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Zhigang Wang <zhigang.x.wang@oracle.com>,
	Tim Deegan <tim@xen.org>, Konrad Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Dan Magenheimer
> Subject: RE: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> 
> > From: Andres Lagar-Cavilla [mailto:andreslc@gridcentric.ca]
> > Subject: Re: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> > > Fair enough.
> > >
> > > After reviewing the thread where low_mem was submitted, I have to admit
> > > that I am a bit baffled as to when the low_mem handling would ever be
> > > necessary.   I suspect it is because the author and I are approaching
> >
> > Little to be baffled at, as per above explanation. And probably a good idea to cc the author if so.
> >
> > Andres
> >
> > > memory management from a completely different paradigm (per discussion
> > > in an earlier thread where "claim" was first proposed), so that
> > > is probably better left for the deferred discussion of the
> > > integration.
> > >
> > > So since you (Jan) do not consider this (lack of integration with
> > > low_mem) a showstopper for claim, I will set myself a reminder
> > > to initiate a new thread about this later.
> 
>      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> Hi Andres (and sorry for the typo in your name earlier in the thread) --
> 
> > ...And probably a good idea to cc the author if so.
> 
> No offense intended, I certainly intended for you to be not just on
> the "Cc" list but on the "To" list of the new thread, but you are too
> quick for me and, due to time constraints, I may not get to that
> new thread until next week (it's a holiday week in the US).  But until
> then... a quick clarification:
> 
> > > After reviewing the thread where low_mem was submitted, I have to admit
> > > that I am a bit baffled as to when the low_mem handling would ever be
> > > necessary.   I suspect it is because the author and I are approaching
> 
> I meant "ever be necessary in the dynamic memory (e.g. tmem) paradigm",
> not the squeezed (or MS -memory-balancing-engine) paradigm, where I can
> at least fathom it.

Hmmm... it appear that, while it might be fun and illuminating,
a new thread is probably not worth our time, as I think the fix
to allow co-existence of XENMEM_claim_pages and the low_mem_virq
code is one additional line.

I'll include it in v7.

Dan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 18:01:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 18:01:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td2zh-00063J-3m; Mon, 26 Nov 2012 18:01:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td2zg-000635-29
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 18:01:20 +0000
Received: from [85.158.143.35:19343] by server-3.bemta-4.messagelabs.com id
	13/E4-06841-E6EA3B05; Mon, 26 Nov 2012 18:01:18 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1353952876!15021898!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzUxMjE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4479 invoked from network); 26 Nov 2012 18:01:17 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-13.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 18:01:17 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQI1DEG002351
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 18:01:14 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQI1CkX003739
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 18:01:13 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQI1CwE008650; Mon, 26 Nov 2012 12:01:12 -0600
MIME-Version: 1.0
Message-ID: <29526822-237d-45f0-87eb-0b5ca53f010b@default>
Date: Mon, 26 Nov 2012 10:01:10 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Andres Lagar-Cavilla <andreslc@gridcentric.ca>, xen-devel@lists.xen.org,
	Jan Beulich <JBeulich@suse.com>
References: <mailman.16877.1353355647.1399.xen-devel@lists.xen.org>
	<1F985F20-30DE-4E12-AC8B-68FCA5DABF8F@gridcentric.ca>
	<e87e0192-e0d5-4f35-8b20-fb82c431c918@default>
In-Reply-To: <e87e0192-e0d5-4f35-8b20-fb82c431c918@default>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Zhigang Wang <zhigang.x.wang@oracle.com>,
	Tim Deegan <tim@xen.org>, Konrad Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Dan Magenheimer
> Subject: RE: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> 
> > From: Andres Lagar-Cavilla [mailto:andreslc@gridcentric.ca]
> > Subject: Re: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
> > > Fair enough.
> > >
> > > After reviewing the thread where low_mem was submitted, I have to admit
> > > that I am a bit baffled as to when the low_mem handling would ever be
> > > necessary.   I suspect it is because the author and I are approaching
> >
> > Little to be baffled at, as per above explanation. And probably a good idea to cc the author if so.
> >
> > Andres
> >
> > > memory management from a completely different paradigm (per discussion
> > > in an earlier thread where "claim" was first proposed), so that
> > > is probably better left for the deferred discussion of the
> > > integration.
> > >
> > > So since you (Jan) do not consider this (lack of integration with
> > > low_mem) a showstopper for claim, I will set myself a reminder
> > > to initiate a new thread about this later.
> 
>      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> Hi Andres (and sorry for the typo in your name earlier in the thread) --
> 
> > ...And probably a good idea to cc the author if so.
> 
> No offense intended, I certainly intended for you to be not just on
> the "Cc" list but on the "To" list of the new thread, but you are too
> quick for me and, due to time constraints, I may not get to that
> new thread until next week (it's a holiday week in the US).  But until
> then... a quick clarification:
> 
> > > After reviewing the thread where low_mem was submitted, I have to admit
> > > that I am a bit baffled as to when the low_mem handling would ever be
> > > necessary.   I suspect it is because the author and I are approaching
> 
> I meant "ever be necessary in the dynamic memory (e.g. tmem) paradigm",
> not the squeezed (or MS -memory-balancing-engine) paradigm, where I can
> at least fathom it.

Hmmm... it appear that, while it might be fun and illuminating,
a new thread is probably not worth our time, as I think the fix
to allow co-existence of XENMEM_claim_pages and the low_mem_virq
code is one additional line.

I'll include it in v7.

Dan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 18:06:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 18:06:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td344-0006D6-0C; Mon, 26 Nov 2012 18:05:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1Td342-0006D1-Kd
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 18:05:50 +0000
Received: from [85.158.137.99:57158] by server-12.bemta-3.messagelabs.com id
	D0/9C-22757-D7FA3B05; Mon, 26 Nov 2012 18:05:49 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-16.tower-217.messagelabs.com!1353953147!20663222!1
X-Originating-IP: [209.85.210.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12834 invoked from network); 26 Nov 2012 18:05:49 -0000
Received: from mail-ia0-f173.google.com (HELO mail-ia0-f173.google.com)
	(209.85.210.173)
	by server-16.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 18:05:49 -0000
Received: by mail-ia0-f173.google.com with SMTP id w21so8184562iac.32
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 10:05:47 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=subject:mime-version:content-type:from:x-priority:in-reply-to:date
	:cc:content-transfer-encoding:message-id:references:to:x-mailer
	:x-gm-message-state;
	bh=j3VwOpyaEyTVwM7rpJA5GXXeyP2XyXzD13AFd6r9SOo=;
	b=po/lNNc4HeFtUH5CPo3g8fFazXYoWUnCV2nCRneanTpEdrI8o5Vnf3wUv3Q5lne38I
	Cc2pwf6uBUnwlgYZO+Zp3JIodWckd+fnlx9lKBUKoaif3OGIgzKAYCpnYueI40fjfGoc
	NYUXTirIfCKam0rQrhaeJTcbK//BjBE0L4k9FcJLLRFWcmGIpMdBSJRCb76yrvaprqpw
	EZmK4XpzSa7oonTuXkEkcIfF3LWrmJ37M5Da9eLoUo10Y9Hv89RH5+WKVIvRfXVmUFTT
	39PZ5d2mbYQhEjGMZjcY0idIH64V+QeKB5LajmQqoIBFO2+IIJQnTGgcaTS//4ekVx4B
	Mevg==
Received: by 10.50.40.225 with SMTP id a1mr15245115igl.7.1353953147170;
	Mon, 26 Nov 2012 10:05:47 -0800 (PST)
Received: from [192.168.15.1] ([206.223.182.18])
	by mx.google.com with ESMTPS id gs6sm26213igc.11.2012.11.26.10.05.44
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 26 Nov 2012 10:05:46 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
X-Priority: 3
In-Reply-To: <29526822-237d-45f0-87eb-0b5ca53f010b@default>
Date: Mon, 26 Nov 2012 13:05:51 -0500
Message-Id: <1EF30224-406B-4453-9D87-7800F5860F9A@gridcentric.ca>
References: <mailman.16877.1353355647.1399.xen-devel@lists.xen.org>
	<1F985F20-30DE-4E12-AC8B-68FCA5DABF8F@gridcentric.ca>
	<e87e0192-e0d5-4f35-8b20-fb82c431c918@default>
	<29526822-237d-45f0-87eb-0b5ca53f010b@default>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQl0wwS6HM/tnan2PynT+GkVw3puYMbOV1VINjcTLJSlp9T/Zp7zEKgOb90Xe2OXvAQJqGVN
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Konrad Wilk <konrad.wilk@oracle.com>,
	Tim Deegan <tim@xen.org>, xen-devel@lists.xen.org,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Nov 26, 2012, at 1:01 PM, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:

>> From: Dan Magenheimer
>> Subject: RE: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
>> 
>>> From: Andres Lagar-Cavilla [mailto:andreslc@gridcentric.ca]
>>> Subject: Re: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
>>>> Fair enough.
>>>> 
>>>> After reviewing the thread where low_mem was submitted, I have to admit
>>>> that I am a bit baffled as to when the low_mem handling would ever be
>>>> necessary.   I suspect it is because the author and I are approaching
>>> 
>>> Little to be baffled at, as per above explanation. And probably a good idea to cc the author if so.
>>> 
>>> Andres
>>> 
>>>> memory management from a completely different paradigm (per discussion
>>>> in an earlier thread where "claim" was first proposed), so that
>>>> is probably better left for the deferred discussion of the
>>>> integration.
>>>> 
>>>> So since you (Jan) do not consider this (lack of integration with
>>>> low_mem) a showstopper for claim, I will set myself a reminder
>>>> to initiate a new thread about this later.
>> 
>>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> 
>> Hi Andres (and sorry for the typo in your name earlier in the thread) --
>> 
>>> ...And probably a good idea to cc the author if so.
>> 
>> No offense intended, I certainly intended for you to be not just on
>> the "Cc" list but on the "To" list of the new thread, but you are too
>> quick for me and, due to time constraints, I may not get to that
>> new thread until next week (it's a holiday week in the US).  But until
>> then... a quick clarification:
>> 
>>>> After reviewing the thread where low_mem was submitted, I have to admit
>>>> that I am a bit baffled as to when the low_mem handling would ever be
>>>> necessary.   I suspect it is because the author and I are approaching
>> 
>> I meant "ever be necessary in the dynamic memory (e.g. tmem) paradigm",
>> not the squeezed (or MS -memory-balancing-engine) paradigm, where I can
>> at least fathom it.
> 
> Hmmm... it appear that, while it might be fun and illuminating,
> a new thread is probably not worth our time, as I think the fix
> to allow co-existence of XENMEM_claim_pages and the low_mem_virq
> code is one additional line.

Agreed, just factor in the global unclaimed count into the arithmetic the virq code performs to decide whether to fire.

Andres
> 
> I'll include it in v7.
> 
> Dan
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 18:06:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 18:06:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td344-0006D6-0C; Mon, 26 Nov 2012 18:05:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <andreslc@gridcentric.ca>) id 1Td342-0006D1-Kd
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 18:05:50 +0000
Received: from [85.158.137.99:57158] by server-12.bemta-3.messagelabs.com id
	D0/9C-22757-D7FA3B05; Mon, 26 Nov 2012 18:05:49 +0000
X-Env-Sender: andreslc@gridcentric.ca
X-Msg-Ref: server-16.tower-217.messagelabs.com!1353953147!20663222!1
X-Originating-IP: [209.85.210.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12834 invoked from network); 26 Nov 2012 18:05:49 -0000
Received: from mail-ia0-f173.google.com (HELO mail-ia0-f173.google.com)
	(209.85.210.173)
	by server-16.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 18:05:49 -0000
Received: by mail-ia0-f173.google.com with SMTP id w21so8184562iac.32
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 10:05:47 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=subject:mime-version:content-type:from:x-priority:in-reply-to:date
	:cc:content-transfer-encoding:message-id:references:to:x-mailer
	:x-gm-message-state;
	bh=j3VwOpyaEyTVwM7rpJA5GXXeyP2XyXzD13AFd6r9SOo=;
	b=po/lNNc4HeFtUH5CPo3g8fFazXYoWUnCV2nCRneanTpEdrI8o5Vnf3wUv3Q5lne38I
	Cc2pwf6uBUnwlgYZO+Zp3JIodWckd+fnlx9lKBUKoaif3OGIgzKAYCpnYueI40fjfGoc
	NYUXTirIfCKam0rQrhaeJTcbK//BjBE0L4k9FcJLLRFWcmGIpMdBSJRCb76yrvaprqpw
	EZmK4XpzSa7oonTuXkEkcIfF3LWrmJ37M5Da9eLoUo10Y9Hv89RH5+WKVIvRfXVmUFTT
	39PZ5d2mbYQhEjGMZjcY0idIH64V+QeKB5LajmQqoIBFO2+IIJQnTGgcaTS//4ekVx4B
	Mevg==
Received: by 10.50.40.225 with SMTP id a1mr15245115igl.7.1353953147170;
	Mon, 26 Nov 2012 10:05:47 -0800 (PST)
Received: from [192.168.15.1] ([206.223.182.18])
	by mx.google.com with ESMTPS id gs6sm26213igc.11.2012.11.26.10.05.44
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 26 Nov 2012 10:05:46 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
X-Priority: 3
In-Reply-To: <29526822-237d-45f0-87eb-0b5ca53f010b@default>
Date: Mon, 26 Nov 2012 13:05:51 -0500
Message-Id: <1EF30224-406B-4453-9D87-7800F5860F9A@gridcentric.ca>
References: <mailman.16877.1353355647.1399.xen-devel@lists.xen.org>
	<1F985F20-30DE-4E12-AC8B-68FCA5DABF8F@gridcentric.ca>
	<e87e0192-e0d5-4f35-8b20-fb82c431c918@default>
	<29526822-237d-45f0-87eb-0b5ca53f010b@default>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
X-Mailer: Apple Mail (2.1499)
X-Gm-Message-State: ALoCoQl0wwS6HM/tnan2PynT+GkVw3puYMbOV1VINjcTLJSlp9T/Zp7zEKgOb90Xe2OXvAQJqGVN
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Konrad Wilk <konrad.wilk@oracle.com>,
	Tim Deegan <tim@xen.org>, xen-devel@lists.xen.org,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of
	existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Nov 26, 2012, at 1:01 PM, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:

>> From: Dan Magenheimer
>> Subject: RE: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
>> 
>>> From: Andres Lagar-Cavilla [mailto:andreslc@gridcentric.ca]
>>> Subject: Re: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall
>>>> Fair enough.
>>>> 
>>>> After reviewing the thread where low_mem was submitted, I have to admit
>>>> that I am a bit baffled as to when the low_mem handling would ever be
>>>> necessary.   I suspect it is because the author and I are approaching
>>> 
>>> Little to be baffled at, as per above explanation. And probably a good idea to cc the author if so.
>>> 
>>> Andres
>>> 
>>>> memory management from a completely different paradigm (per discussion
>>>> in an earlier thread where "claim" was first proposed), so that
>>>> is probably better left for the deferred discussion of the
>>>> integration.
>>>> 
>>>> So since you (Jan) do not consider this (lack of integration with
>>>> low_mem) a showstopper for claim, I will set myself a reminder
>>>> to initiate a new thread about this later.
>> 
>>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> 
>> Hi Andres (and sorry for the typo in your name earlier in the thread) --
>> 
>>> ...And probably a good idea to cc the author if so.
>> 
>> No offense intended, I certainly intended for you to be not just on
>> the "Cc" list but on the "To" list of the new thread, but you are too
>> quick for me and, due to time constraints, I may not get to that
>> new thread until next week (it's a holiday week in the US).  But until
>> then... a quick clarification:
>> 
>>>> After reviewing the thread where low_mem was submitted, I have to admit
>>>> that I am a bit baffled as to when the low_mem handling would ever be
>>>> necessary.   I suspect it is because the author and I are approaching
>> 
>> I meant "ever be necessary in the dynamic memory (e.g. tmem) paradigm",
>> not the squeezed (or MS -memory-balancing-engine) paradigm, where I can
>> at least fathom it.
> 
> Hmmm... it appear that, while it might be fun and illuminating,
> a new thread is probably not worth our time, as I think the fix
> to allow co-existence of XENMEM_claim_pages and the low_mem_virq
> code is one additional line.

Agreed, just factor in the global unclaimed count into the arithmetic the virq code performs to decide whether to fire.

Andres
> 
> I'll include it in v7.
> 
> Dan
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 18:11:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 18:11:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td39D-0006U2-OI; Mon, 26 Nov 2012 18:11:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dtor@vmware.com>) id 1Td2ab-0005lI-B3
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 17:35:25 +0000
Received: from [85.158.139.83:24983] by server-10.bemta-5.messagelabs.com id
	A1/08-09257-C58A3B05; Mon, 26 Nov 2012 17:35:24 +0000
X-Env-Sender: dtor@vmware.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1353951321!32035862!1
X-Originating-IP: [208.91.2.12]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA4LjkxLjIuMTIgPT4gMTU3NTkx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18556 invoked from network); 26 Nov 2012 17:35:22 -0000
Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com)
	(208.91.2.12)
	by server-5.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 17:35:22 -0000
Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com
	[10.113.161.72])
	by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 839CF28A91;
	Mon, 26 Nov 2012 09:35:18 -0800 (PST)
Received: from dtor-ws.eng.vmware.com (dtor-ws.eng.vmware.com [10.20.94.123])
	by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 79DF5B047F;
	Mon, 26 Nov 2012 09:35:18 -0800 (PST)
Date: Mon, 26 Nov 2012 09:35:18 -0800
From: Dmitry Torokhov <dtor@vmware.com>
To: Bill Pemberton <wfp5p@virginia.edu>
Message-ID: <20121126173518.GA11127@dtor-ws.eng.vmware.com>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
	<1353349642-3677-86-git-send-email-wfp5p@virginia.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353349642-3677-86-git-send-email-wfp5p@virginia.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Mailman-Approved-At: Mon, 26 Nov 2012 18:11:11 +0000
Cc: xen-devel@lists.xensource.com, "Michael S. Tsirkin" <mst@redhat.com>,
	"VMware, Inc." <pv-drivers@vmware.com>, gregkh@linuxfoundation.org,
	Rusty Russell <rusty@rustcorp.com.au>,
	virtualization@lists.linux-foundation.org,
	Francois Romieu <romieu@fr.zoreil.com>, netdev@vger.kernel.org
Subject: Re: [Xen-devel] [Pv-drivers] [PATCH 086/493] net: remove use of
	__devexit_p
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 19, 2012 at 01:20:35PM -0500, Bill Pemberton wrote:
> CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
> needed.
> 
> Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
> Cc: Rusty Russell <rusty@rustcorp.com.au> 
> Cc: "Michael S. Tsirkin" <mst@redhat.com> 
> Cc: Shreyas Bhatewara <sbhatewara@vmware.com> 
> Cc: "VMware, Inc." <pv-drivers@vmware.com> 
> Cc: Francois Romieu <romieu@fr.zoreil.com> 
> Cc: virtualization@lists.linux-foundation.org 
> Cc: netdev@vger.kernel.org 
> Cc: xen-devel@lists.xensource.com 
> ---
>  drivers/net/virtio_net.c          | 2 +-
>  drivers/net/vmxnet3/vmxnet3_drv.c | 2 +-

For VMXNET3:
 
Acked-by: Dmitry Torokhov <dtor@vmware.com>

Thanks,
Dmitry



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 18:11:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 18:11:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td39D-0006U2-OI; Mon, 26 Nov 2012 18:11:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dtor@vmware.com>) id 1Td2ab-0005lI-B3
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 17:35:25 +0000
Received: from [85.158.139.83:24983] by server-10.bemta-5.messagelabs.com id
	A1/08-09257-C58A3B05; Mon, 26 Nov 2012 17:35:24 +0000
X-Env-Sender: dtor@vmware.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1353951321!32035862!1
X-Originating-IP: [208.91.2.12]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA4LjkxLjIuMTIgPT4gMTU3NTkx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18556 invoked from network); 26 Nov 2012 17:35:22 -0000
Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com)
	(208.91.2.12)
	by server-5.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 17:35:22 -0000
Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com
	[10.113.161.72])
	by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 839CF28A91;
	Mon, 26 Nov 2012 09:35:18 -0800 (PST)
Received: from dtor-ws.eng.vmware.com (dtor-ws.eng.vmware.com [10.20.94.123])
	by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 79DF5B047F;
	Mon, 26 Nov 2012 09:35:18 -0800 (PST)
Date: Mon, 26 Nov 2012 09:35:18 -0800
From: Dmitry Torokhov <dtor@vmware.com>
To: Bill Pemberton <wfp5p@virginia.edu>
Message-ID: <20121126173518.GA11127@dtor-ws.eng.vmware.com>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
	<1353349642-3677-86-git-send-email-wfp5p@virginia.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353349642-3677-86-git-send-email-wfp5p@virginia.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Mailman-Approved-At: Mon, 26 Nov 2012 18:11:11 +0000
Cc: xen-devel@lists.xensource.com, "Michael S. Tsirkin" <mst@redhat.com>,
	"VMware, Inc." <pv-drivers@vmware.com>, gregkh@linuxfoundation.org,
	Rusty Russell <rusty@rustcorp.com.au>,
	virtualization@lists.linux-foundation.org,
	Francois Romieu <romieu@fr.zoreil.com>, netdev@vger.kernel.org
Subject: Re: [Xen-devel] [Pv-drivers] [PATCH 086/493] net: remove use of
	__devexit_p
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 19, 2012 at 01:20:35PM -0500, Bill Pemberton wrote:
> CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
> needed.
> 
> Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
> Cc: Rusty Russell <rusty@rustcorp.com.au> 
> Cc: "Michael S. Tsirkin" <mst@redhat.com> 
> Cc: Shreyas Bhatewara <sbhatewara@vmware.com> 
> Cc: "VMware, Inc." <pv-drivers@vmware.com> 
> Cc: Francois Romieu <romieu@fr.zoreil.com> 
> Cc: virtualization@lists.linux-foundation.org 
> Cc: netdev@vger.kernel.org 
> Cc: xen-devel@lists.xensource.com 
> ---
>  drivers/net/virtio_net.c          | 2 +-
>  drivers/net/vmxnet3/vmxnet3_drv.c | 2 +-

For VMXNET3:
 
Acked-by: Dmitry Torokhov <dtor@vmware.com>

Thanks,
Dmitry



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 18:11:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 18:11:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td39E-0006UG-Ft; Mon, 26 Nov 2012 18:11:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dtor@vmware.com>) id 1Td2eM-0005mC-5J
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 17:39:18 +0000
Received: from [85.158.139.83:46918] by server-16.bemta-5.messagelabs.com id
	3C/EE-04786-549A3B05; Mon, 26 Nov 2012 17:39:17 +0000
X-Env-Sender: dtor@vmware.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1353951555!27705467!1
X-Originating-IP: [208.91.2.12]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA4LjkxLjIuMTIgPT4gMTU3NTkx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6152 invoked from network); 26 Nov 2012 17:39:16 -0000
Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com)
	(208.91.2.12)
	by server-14.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 17:39:16 -0000
Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com
	[10.113.161.72])
	by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 4AFB7285BA;
	Mon, 26 Nov 2012 09:39:15 -0800 (PST)
Received: from dtor-ws.eng.vmware.com (dtor-ws.eng.vmware.com [10.20.94.123])
	by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 38ED2B04A9;
	Mon, 26 Nov 2012 09:39:15 -0800 (PST)
Date: Mon, 26 Nov 2012 09:39:15 -0800
From: Dmitry Torokhov <dtor@vmware.com>
To: Bill Pemberton <wfp5p@virginia.edu>
Message-ID: <20121126173915.GE11127@dtor-ws.eng.vmware.com>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
	<1353349642-3677-471-git-send-email-wfp5p@virginia.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353349642-3677-471-git-send-email-wfp5p@virginia.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Mailman-Approved-At: Mon, 26 Nov 2012 18:11:11 +0000
Cc: Jiri Slaby <jirislaby@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>,
	"VMware, Inc." <pv-drivers@vmware.com>,
	virtualization@lists.linux-foundation.org,
	"Maciej W. Rozycki" <macro@linux-mips.org>,
	Christian Lamparter <chunkeey@googlemail.com>,
	Hin-Tak Leung <htl10@users.sourceforge.net>,
	Luciano Coelho <coelho@ti.com>, Stefano Brivio <stefano.brivio@polimi.it>,
	libertas-dev@lists.infradead.org, Dan Williams <dcbw@redhat.com>,
	ath5k-devel@lists.ath5k.org, "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>,
	linux-hippi@sunsite.dk, Nick Kossifidis <mickflemm@gmail.com>,
	Francois Romieu <romieu@fr.zoreil.com>,
	Herton Ronaldo Krzesinski <herton@canonical.com>,
	Stanislav Yakovlev <stas.yakovlev@gmail.com>, b43-dev@lists.infradead.org,
	Jes Sorensen <jes@trained-monkey.org>, Samuel Ortiz <samuel@sortiz.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	"John W. Linville" <linville@tuxdriver.com>,
	linux-can@vger.kernel.org, xen-devel@lists.xensource.com,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	gregkh@linuxfoundation.org, linux-wireless@vger.kernel.org,
	Wolfgang Grandegger <wg@grandegger.com>, netdev@vger.kernel.org,
	Simon Kelley <simon@thekelleys.org.uk>, Krzysztof Halasa <khc@pm.waw.pl>,
	Larry Finger <Larry.Finger@lwfinger.net>
Subject: Re: [Xen-devel] [Pv-drivers] [PATCH 471/493] net: remove use of
	__devexit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 19, 2012 at 01:27:00PM -0500, Bill Pemberton wrote:
> CONFIG_HOTPLUG is going away as an option so __devexit is no
> longer needed.

...

>  drivers/net/vmxnet3/vmxnet3_drv.c             |  2 +-

For VMXNET3:

Acked-by: Dmitry Torokhov <dtor@vmware.com>

Thanks,
Dmitry


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 18:11:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 18:11:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td39E-0006UG-Ft; Mon, 26 Nov 2012 18:11:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dtor@vmware.com>) id 1Td2eM-0005mC-5J
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 17:39:18 +0000
Received: from [85.158.139.83:46918] by server-16.bemta-5.messagelabs.com id
	3C/EE-04786-549A3B05; Mon, 26 Nov 2012 17:39:17 +0000
X-Env-Sender: dtor@vmware.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1353951555!27705467!1
X-Originating-IP: [208.91.2.12]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA4LjkxLjIuMTIgPT4gMTU3NTkx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6152 invoked from network); 26 Nov 2012 17:39:16 -0000
Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com)
	(208.91.2.12)
	by server-14.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 17:39:16 -0000
Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com
	[10.113.161.72])
	by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 4AFB7285BA;
	Mon, 26 Nov 2012 09:39:15 -0800 (PST)
Received: from dtor-ws.eng.vmware.com (dtor-ws.eng.vmware.com [10.20.94.123])
	by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 38ED2B04A9;
	Mon, 26 Nov 2012 09:39:15 -0800 (PST)
Date: Mon, 26 Nov 2012 09:39:15 -0800
From: Dmitry Torokhov <dtor@vmware.com>
To: Bill Pemberton <wfp5p@virginia.edu>
Message-ID: <20121126173915.GE11127@dtor-ws.eng.vmware.com>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
	<1353349642-3677-471-git-send-email-wfp5p@virginia.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353349642-3677-471-git-send-email-wfp5p@virginia.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Mailman-Approved-At: Mon, 26 Nov 2012 18:11:11 +0000
Cc: Jiri Slaby <jirislaby@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>,
	"VMware, Inc." <pv-drivers@vmware.com>,
	virtualization@lists.linux-foundation.org,
	"Maciej W. Rozycki" <macro@linux-mips.org>,
	Christian Lamparter <chunkeey@googlemail.com>,
	Hin-Tak Leung <htl10@users.sourceforge.net>,
	Luciano Coelho <coelho@ti.com>, Stefano Brivio <stefano.brivio@polimi.it>,
	libertas-dev@lists.infradead.org, Dan Williams <dcbw@redhat.com>,
	ath5k-devel@lists.ath5k.org, "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>,
	linux-hippi@sunsite.dk, Nick Kossifidis <mickflemm@gmail.com>,
	Francois Romieu <romieu@fr.zoreil.com>,
	Herton Ronaldo Krzesinski <herton@canonical.com>,
	Stanislav Yakovlev <stas.yakovlev@gmail.com>, b43-dev@lists.infradead.org,
	Jes Sorensen <jes@trained-monkey.org>, Samuel Ortiz <samuel@sortiz.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	"John W. Linville" <linville@tuxdriver.com>,
	linux-can@vger.kernel.org, xen-devel@lists.xensource.com,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	gregkh@linuxfoundation.org, linux-wireless@vger.kernel.org,
	Wolfgang Grandegger <wg@grandegger.com>, netdev@vger.kernel.org,
	Simon Kelley <simon@thekelleys.org.uk>, Krzysztof Halasa <khc@pm.waw.pl>,
	Larry Finger <Larry.Finger@lwfinger.net>
Subject: Re: [Xen-devel] [Pv-drivers] [PATCH 471/493] net: remove use of
	__devexit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 19, 2012 at 01:27:00PM -0500, Bill Pemberton wrote:
> CONFIG_HOTPLUG is going away as an option so __devexit is no
> longer needed.

...

>  drivers/net/vmxnet3/vmxnet3_drv.c             |  2 +-

For VMXNET3:

Acked-by: Dmitry Torokhov <dtor@vmware.com>

Thanks,
Dmitry


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 18:11:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 18:11:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td39E-0006U9-3m; Mon, 26 Nov 2012 18:11:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dtor@vmware.com>) id 1Td2dt-0005lr-Hy
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 17:38:49 +0000
Received: from [85.158.139.211:59089] by server-14.bemta-5.messagelabs.com id
	BA/23-21768-829A3B05; Mon, 26 Nov 2012 17:38:48 +0000
X-Env-Sender: dtor@vmware.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353951526!21700163!1
X-Originating-IP: [208.91.2.13]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA4LjkxLjIuMTMgPT4gMTU5NTA2\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23125 invoked from network); 26 Nov 2012 17:38:48 -0000
Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com)
	(208.91.2.13)
	by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 17:38:48 -0000
Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com
	[10.113.161.72])
	by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 3DB5B287EC;
	Mon, 26 Nov 2012 09:38:46 -0800 (PST)
Received: from dtor-ws.eng.vmware.com (dtor-ws.eng.vmware.com [10.20.94.123])
	by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 2AE94B0461;
	Mon, 26 Nov 2012 09:38:46 -0800 (PST)
Date: Mon, 26 Nov 2012 09:38:46 -0800
From: Dmitry Torokhov <dtor@vmware.com>
To: Bill Pemberton <wfp5p@virginia.edu>
Message-ID: <20121126173846.GD11127@dtor-ws.eng.vmware.com>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
	<1353349642-3677-203-git-send-email-wfp5p@virginia.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353349642-3677-203-git-send-email-wfp5p@virginia.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Mailman-Approved-At: Mon, 26 Nov 2012 18:11:11 +0000
Cc: Jes Sorensen <jes@trained-monkey.org>, xen-devel@lists.xensource.com,
	"VMware, Inc." <pv-drivers@vmware.com>, gregkh@linuxfoundation.org,
	Francois Romieu <romieu@fr.zoreil.com>,
	virtualization@lists.linux-foundation.org, linux-hippi@sunsite.dk,
	"Maciej W. Rozycki" <macro@linux-mips.org>,
	netdev@vger.kernel.org, Krzysztof Halasa <khc@pm.waw.pl>
Subject: Re: [Xen-devel] [Pv-drivers] [PATCH 203/493] net: remove use of
	__devinit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 19, 2012 at 01:22:32PM -0500, Bill Pemberton wrote:
> CONFIG_HOTPLUG is going away as an option so __devinit is no longer
> needed.

...

>  drivers/net/vmxnet3/vmxnet3_drv.c  |  2 +-

For VMXNET3:

Acked-by: Dmitry Torokhov <dtor@vmware.com>

Thanks,
Dmitry



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 18:11:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 18:11:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td39E-0006U9-3m; Mon, 26 Nov 2012 18:11:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dtor@vmware.com>) id 1Td2dt-0005lr-Hy
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 17:38:49 +0000
Received: from [85.158.139.211:59089] by server-14.bemta-5.messagelabs.com id
	BA/23-21768-829A3B05; Mon, 26 Nov 2012 17:38:48 +0000
X-Env-Sender: dtor@vmware.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353951526!21700163!1
X-Originating-IP: [208.91.2.13]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA4LjkxLjIuMTMgPT4gMTU5NTA2\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23125 invoked from network); 26 Nov 2012 17:38:48 -0000
Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com)
	(208.91.2.13)
	by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 17:38:48 -0000
Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com
	[10.113.161.72])
	by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 3DB5B287EC;
	Mon, 26 Nov 2012 09:38:46 -0800 (PST)
Received: from dtor-ws.eng.vmware.com (dtor-ws.eng.vmware.com [10.20.94.123])
	by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 2AE94B0461;
	Mon, 26 Nov 2012 09:38:46 -0800 (PST)
Date: Mon, 26 Nov 2012 09:38:46 -0800
From: Dmitry Torokhov <dtor@vmware.com>
To: Bill Pemberton <wfp5p@virginia.edu>
Message-ID: <20121126173846.GD11127@dtor-ws.eng.vmware.com>
References: <1353349642-3677-1-git-send-email-wfp5p@virginia.edu>
	<1353349642-3677-203-git-send-email-wfp5p@virginia.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353349642-3677-203-git-send-email-wfp5p@virginia.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Mailman-Approved-At: Mon, 26 Nov 2012 18:11:11 +0000
Cc: Jes Sorensen <jes@trained-monkey.org>, xen-devel@lists.xensource.com,
	"VMware, Inc." <pv-drivers@vmware.com>, gregkh@linuxfoundation.org,
	Francois Romieu <romieu@fr.zoreil.com>,
	virtualization@lists.linux-foundation.org, linux-hippi@sunsite.dk,
	"Maciej W. Rozycki" <macro@linux-mips.org>,
	netdev@vger.kernel.org, Krzysztof Halasa <khc@pm.waw.pl>
Subject: Re: [Xen-devel] [Pv-drivers] [PATCH 203/493] net: remove use of
	__devinit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 19, 2012 at 01:22:32PM -0500, Bill Pemberton wrote:
> CONFIG_HOTPLUG is going away as an option so __devinit is no longer
> needed.

...

>  drivers/net/vmxnet3/vmxnet3_drv.c  |  2 +-

For VMXNET3:

Acked-by: Dmitry Torokhov <dtor@vmware.com>

Thanks,
Dmitry



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 18:11:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 18:11:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td39Q-0006WJ-UA; Mon, 26 Nov 2012 18:11:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td39P-0006Vl-4u
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 18:11:23 +0000
Received: from [85.158.137.99:47102] by server-10.bemta-3.messagelabs.com id
	AD/04-19806-AC0B3B05; Mon, 26 Nov 2012 18:11:22 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1353953479!15613494!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NTMzMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29323 invoked from network); 26 Nov 2012 18:11:21 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-3.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 18:11:21 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQIBEVu006969
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 18:11:15 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQIBDtT023921
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 18:11:14 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQIBCUE016553; Mon, 26 Nov 2012 12:11:13 -0600
MIME-Version: 1.0
Message-ID: <07fd91ec-8b57-47d8-a44d-3b593de6bb9f@default>
Date: Mon, 26 Nov 2012 10:11:09 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__135395347276233805abhmt116.oracle.com"
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Andres Lagar-Cavilla <andreslc@gridcentric.ca>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, Matthew Daley <mattjd@gmail.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH v7 1/2] hypervisor: XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__135395347276233805abhmt116.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

(Note: After sufficient review, this is now a PATCH,
not an RFC/PATCH)

This is patch 1of2 of a seventh cut of the patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account review
feedback from Jan and Keir and IanC and Matthew Daley, plus some
fixes found via runtime debugging (using printk and privcmd only).

v6->v7:
- Need co-existence with low_mem_virq [JBeulich]

v5->v6:
- Fix post-inc problem [mattjd]

v4->v5:
- Split tools part into separate patch [JBeulich]
- Minor coding style fixups [JBeulich]
- Use rcu_lock_domain_by_id, not _target version [JBeulich]

v3->v4: (please ignore v3)
- Process error, sent stale patch, sorry [djm]

v2->v3:
- Add per-domain and global "get" for unclaimed info [JBeulich]
- New hypercall(s) should fail for unpriv callers [IanC]
- Non-zero extent_order disallowed [JBeulich]
- Remove bonehead ASSERTs [JBeulich]
- Need not hold heaplock for decrease case too [JBeulich]
- More descriptive failure return values [JBeulich]
- Don't allow a claim to exceed max_pages [IanC]
- Subops must be in correct ifdef block in memory.c [keir]

v1->v2:
- Add reset-to-zero page claim in domain_kill [JBeulich]
- Proper handling of struct passed to hypercall [JBeulich]
- Fix alloc_heap_pages when a domain has a claim [JBeulich]
- Need not hold heap_lock if !d->unclaimed_pages [keir]
- Fix missed tot_pages call in donate_page [djm]
- Remove domain_reset_unclaimed_pages; use set with zero [djm]
- Bugfixes found through testing in set_unclaimed [djm]
- More comments in code [djm]
- Code formatting fixes [djm]

=3D=3D=3D

Motivation:

The goal of this hypercall is to attempt to atomically and very
quickly determine if there are sufficient pages available in the
system and, if so, "set aside" that quantity of pages for future
allocations by that domain.  Unlike an existing hypercall such as
increase_reservation or populate_physmap, specific physical
pageframes are not assigned to the domain because this
cannot be done sufficiently quickly (especially for very large
allocations in an arbitrarily fragmented system) and so the
existing mechanisms result in classic time-of-check-time-of-use
(TOCTOU) races.  One can think of claiming as similar to a
"lazy" allocation, but subsequent hypercalls are required
to do the actual physical pageframe allocation.

In order for a toolstack to "get" information about whether
a domain has a claim and, if so, how large, and also for
the toolstack to measure the total system-wide claim, a
second subop has been added and exposed through domctl
and libxl (see PATCH 2/2).

Note that this patchset does not include a full toolstack
implementation, in part because Oracle uses xm/xend and a
proprietary toolstack and Citrix apparently does not plan
to use the new mechanism.  The following pseudo-code
describes the proposed claim-based use model, which could
easily be implemented as an xl option such as "xl create --claim".

Current:
- call populate_physmap repeatedly to achieve mem=3DN memory
- if any populate_physmap call fails, report -ENOMEM up the stack
- memory is held until domain dies or the toolstack decreases it

Proposed:
- call claim for mem=3DN amount of memory
- if claim succeeds:
    call populate_physmap repeatedly to achieve mem=3DN memory (failsafe)
  else
    report -ENOMEM up the stack
- claim is held until mem=3DN is achieved or the domain dies or
   the toolstack changes it to 0
- memory is held until domain dies or the toolstack decreases it

It has been noted that this claim mechanism solves the
underlying problem (slow failure of domain creation) for
a large class of domains not not all, specifically not
handling (but also not making the problem worse for) PV
domains that specify the "superpages" flag, and 32-bit PV
domains on large RAM systems.  These may be addressed at a
later time.

Code overview:

Though the hypercall simply does arithmetic within locks,
some of the semantics in the code may be a bit subtle
so let me explain a bit.

The key variables (d->unclaimed_pages and total_unclaimed_pages)
start at zero if no claim has yet been staked for any domain.
(Perhaps a better name is "claimed_but_not_yet_possessed" but that's
a bit unwieldy.)  If no claim hypercalls are executed, there
should be no impact on existing usage.

When a claim is successfully staked by a domain, it is like a
watermark but there is no record kept of the size of the claim.
Instead, d->unclaimed_pages is set to the difference between
d->tot_pages and the claim.  When d->tot_pages increases or decreases,
d->unclaimed_pages atomically decreases or increases.  Once
d->unclaimed_pages reaches zero, the claim is satisfied and
d->unclaimed pages stays at zero -- unless a new claim is
subsequently staked.

The systemwide variable total_unclaimed_pages is always the sum
of d->unclaimed_pages, across all domains.  A non-domain-
specific heap allocation will fail if total_unclaimed_pages
exceeds free (plus, on tmem enabled systems, freeable) pages.

Claim semantics may be modified by flags.  The initial
implementation has one flag, which discerns whether the
caller would like tmem freeable pages to be considered
in determining whether or not the claim can be successfully
staked. Future flags may, for example, specify that the
caller would like the claim to be successful only if there
are sufficient pages available on a single node (per Dario's
suggestion).

A claim can be cancelled by requesting a claim of zero pages.

A second subop returns the total outstanding claimed pages
systemwide.

Note: Save/restore/migrate may need to be modified,
else it can be documented that all claims are cancelled.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 arch/x86/mm.c             |    2=20
 arch/x86/mm/mem_sharing.c |    4 -
 common/domain.c           |    1=20
 common/domctl.c           |    1=20
 common/grant_table.c      |    2=20
 common/memory.c           |   33 ++++++++++++
 common/page_alloc.c       |  120 +++++++++++++++++++++++++++++++++++++++++=
+++--
 include/public/domctl.h   |    3 -
 include/public/memory.h   |   39 ++++++++++++++
 include/xen/mm.h          |    7 ++
 include/xen/sched.h       |    1=20
 11 files changed, 204 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fad3d33..7e55908 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3841,7 +3841,7 @@ int donate_page(
     {
         if ( d->tot_pages >=3D d->max_pages )
             goto fail;
-        d->tot_pages++;
+        domain_increase_tot_pages(d, 1);
     }
=20
     page->count_info =3D PGC_allocated | 1;
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..3d29e35 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d,
     }
=20
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_decrease_tot_pages(d, 1);
     drop_dom_ref =3D (d->tot_pages =3D=3D 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct p=
age_info *page)
     ASSERT(page_get_owner(page) =3D=3D dom_cow);
     page_set_owner(page, d);
=20
-    if ( d->tot_pages++ =3D=3D 0 )
+    if ( domain_increase_tot_pages(d, 1) =3D=3D 1 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 12c8e24..f2cc4f5 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -492,6 +492,7 @@ int domain_kill(struct domain *d)
         evtchn_destroy(d);
         gnttab_release_mappings(d);
         tmem_destroy(d->tmem);
+        domain_set_unclaimed_pages(d, 0, 0);
         d->tmem =3D NULL;
         /* fallthrough */
     case DOMDYING_dying:
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index a7a6b9f..e47a991 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -154,6 +154,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_=
getdomaininfo *info)
=20
     info->tot_pages         =3D d->tot_pages;
     info->max_pages         =3D d->max_pages;
+    info->unclaimed_pages   =3D d->unclaimed_pages;
     info->shr_pages         =3D atomic_read(&d->shr_pages);
     info->paged_pages       =3D atomic_read(&d->paged_pages);
     info->shared_info_frame =3D mfn_to_gmfn(d, __pa(d->shared_info)>>PAGE_=
SHIFT);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..04bfda1 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1656,7 +1656,7 @@ gnttab_transfer(
         }
=20
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ =3D=3D 0) )
+        if ( unlikely(domain_increase_tot_pages(e, 1) =3D=3D 1) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..adb7581 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_=
memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
=20
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -=3D dec_count;
+                domain_decrease_tot_pages(d, dec_count);
                 drop_dom_ref =3D (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
=20
@@ -685,6 +685,37 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_=
PARAM(void) arg)
         break;
     }
=20
+    case XENMEM_claim_pages:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+
+        if ( copy_from_guest(&reservation, arg, 1) )
+            return -EFAULT;
+
+        if ( !guest_handle_is_null(reservation.extent_start) )
+            return -EINVAL;
+
+        if ( reservation.extent_order !=3D 0 )
+            return -EINVAL;
+
+        d =3D rcu_lock_domain_by_id(reservation.domid);
+        if ( d =3D=3D NULL )
+            return -EINVAL;
+
+        rc =3D domain_set_unclaimed_pages(d, reservation.nr_extents,
+                                        reservation.mem_flags);
+
+        rcu_unlock_domain(d);
+
+        break;
+
+    case XENMEM_get_unclaimed_pages:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+
+        rc =3D get_total_unclaimed_pages();
+        break;
+
     default:
         rc =3D arch_memory_op(op, arg);
         break;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 15ebc66..2fea9bf 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -238,6 +238,111 @@ static long midsize_alloc_zone_pages;
 #define MIDSIZE_ALLOC_FRAC 128
=20
 static DEFINE_SPINLOCK(heap_lock);
+static long total_unclaimed_pages; /* total outstanding claims by all doma=
ins */
+
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
+
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages +=3D pages;
+    spin_lock(&heap_lock);
+    dom_before =3D d->unclaimed_pages;
+    dom_after =3D dom_before - pages;
+    if ( (dom_before > 0) && (dom_after < 0) )
+        dom_claimed =3D 0;
+    else
+        dom_claimed =3D dom_after;
+    sys_before =3D total_unclaimed_pages;
+    sys_after =3D sys_before - (dom_before - dom_claimed);
+    BUG_ON( (sys_before > 0) && (sys_after < 0) );
+    total_unclaimed_pages =3D sys_after;
+    d->unclaimed_pages =3D dom_claimed;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages -=3D pages;
+
+    spin_lock(&heap_lock);
+    d->tot_pages -=3D pages;
+    d->unclaimed_pages +=3D pages;
+    total_unclaimed_pages +=3D pages;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
+                                unsigned long flags)
+{
+    int ret =3D -ENOMEM;
+    unsigned long claim, avail_pages;
+
+    /*
+     * take the domain's page_alloc_lock, else all increases/decreases
+     * must always take the global heap_lock rather than only in the much
+     * rarer case that d->unclaimed_pages is non-zero
+     */
+    spin_lock(&d->page_alloc_lock);
+    spin_lock(&heap_lock);
+
+    /* pages=3D=3D0 means "unset" the claim (and flags is ignored) */
+    if ( pages =3D=3D 0 )
+    {
+        total_unclaimed_pages -=3D d->unclaimed_pages;
+        d->unclaimed_pages =3D 0;
+        ret =3D 0;
+        goto out;
+    }
+
+    /* only one active claim per domain please */
+    if ( d->unclaimed_pages )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* disallow a claim not exceeding current tot_pages or above max_pages=
 */
+    if ( (pages <=3D d->tot_pages) || (pages > d->max_pages) )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* how much memory is available? */
+    avail_pages =3D total_avail_pages;
+    if ( !(flags & XENMEM_CLAIMF_free_only) )
+        avail_pages +=3D tmem_freeable_pages();
+    avail_pages -=3D total_unclaimed_pages;
+
+    /*
+     * note, if domain has already allocated memory before making a claim=
=20
+     * then the claim must take tot_pages into account
+     */
+    claim =3D pages - d->tot_pages;
+    if ( claim > avail_pages )
+        goto out;
+
+    /* yay, claim fits in available memory, stake the claim, success! */
+    d->unclaimed_pages =3D claim;
+    total_unclaimed_pages +=3D d->unclaimed_pages;
+    ret =3D 0;
+
+out:
+    spin_unlock(&heap_lock);
+    spin_unlock(&d->page_alloc_lock);
+    return ret;
+}
+
+long get_total_unclaimed_pages(void)
+{
+    return total_unclaimed_pages;
+}
=20
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
@@ -374,7 +479,7 @@ static void __init setup_low_mem_virq(void)
 static void check_low_mem_virq(void)
 {
     unsigned long avail_pages =3D total_avail_pages +
-        (opt_tmem ? tmem_freeable_pages() : 0);
+        (opt_tmem ? tmem_freeable_pages() : 0) - total_unclaimed_pages;
=20
     if ( unlikely(avail_pages <=3D low_mem_virq_th) )
     {
@@ -443,6 +548,15 @@ static struct page_info *alloc_heap_pages(
     spin_lock(&heap_lock);
=20
     /*
+     * Claimed memory is considered unavailable unless the request
+     * is made by a domain with sufficient unclaimed pages.
+     */
+    if ( (total_unclaimed_pages + request >
+          total_avail_pages + tmem_freeable_pages()) &&
+          (d =3D=3D NULL || d->unclaimed_pages < request) )
+        goto not_found;
+
+    /*
      * TMEM: When available memory is scarce due to tmem absorbing it, all=
ow
      * only mid-size allocations to avoid worst of fragmentation issues.
      * Others try tmem pools then fail.  This is a workaround until all
@@ -1291,7 +1405,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages =3D=3D 0) )
             get_knownalive_domain(d);
=20
-        d->tot_pages +=3D 1 << order;
+        domain_increase_tot_pages(d, 1 << order);
     }
=20
     for ( i =3D 0; i < (1 << order); i++ )
@@ -1375,7 +1489,7 @@ void free_domheap_pages(struct page_info *pg, unsigne=
d int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
=20
-        d->tot_pages -=3D 1 << order;
+        domain_decrease_tot_pages(d, 1 << order);
         drop_dom_ref =3D (d->tot_pages =3D=3D 0);
=20
         spin_unlock_recursive(&d->page_alloc_lock);
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 7c0f23d..5735c28 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -36,7 +36,7 @@
 #include "grant_table.h"
 #include "hvm/save.h"
=20
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000009
=20
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -95,6 +95,7 @@ struct xen_domctl_getdomaininfo {
     uint32_t flags;              /* XEN_DOMINF_* */
     uint64_aligned_t tot_pages;
     uint64_aligned_t max_pages;
+    uint64_aligned_t unclaimed_pages;
     uint64_aligned_t shr_pages;
     uint64_aligned_t paged_pages;
     uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index f1ddbc0..15d6c72 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -68,6 +68,8 @@ struct xen_memory_reservation {
      *   IN:  GPFN bases of extents to populate with memory
      *   OUT: GMFN bases of extents that were allocated
      *   (NB. This command also updates the mach_to_phys translation table=
)
+     * XENMEM_claim_pages:
+     *   IN: must be zero
      */
     XEN_GUEST_HANDLE(xen_pfn_t) extent_start;
=20
@@ -421,6 +423,43 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
=20
+/*
+ * Attempt to stake a claim for a domain on a quantity of pages
+ * of system RAM, but _not_ assign specific pageframes.  Only
+ * arithmetic is performed so the hypercall is very fast and need
+ * not be preemptible, thus sidestepping time-of-check-time-of-use
+ * races for memory allocation.  Returns 0 if the hypervisor page
+ * allocator has atomically and successfully claimed the requested
+ * number of pages, else non-zero.
+ *
+ * Any domain may have only one active claim.  When sufficient memory
+ * has been allocated to resolve the claim, the claim silently expires.
+ * Claiming zero pages effectively resets any outstanding claim and
+ * is always successful.
+ *
+ * Note that a valid claim may be staked even after memory has been
+ * allocated for a domain.  In this case, the claim is not incremental,
+ * i.e. if the domain's tot_pages is 3, and a claim is staked for 10,
+ * only 7 additional pages are claimed.
+ *
+ * Caller must be privileged or the hypercall fails.
+ */
+#define XENMEM_claim_pages                  24
+/*
+ * XENMEM_claim_pages flags:
+ *  free_only: claim is successful only if sufficient free pages
+ *    are available.  If not set and tmem is enabled, hypervisor
+ *    may also consider tmem "freeable" pages to satisfy the claim.
+ */
+#define _XENMEM_CLAIMF_free_only            0
+#define XENMEM_CLAIMF_free_only             (1U<<_XENMEM_CLAIMF_free_only)
+/*
+ * Get the number of pages currently claimed (but not yet "possessed")
+ * across all domains.  The caller must be privileged but otherwise
+ * the call never fails.=20
+ */
+#define XENMEM_get_unclaimed_pages            25
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
=20
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 64a0cc1..b4dee92 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,13 @@ void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
=20
+/* Claim handling */
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges);
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges);
+int domain_set_unclaimed_pages(
+    struct domain *d, unsigned long pages, unsigned long flags);
+long get_total_unclaimed_pages(void);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..480ef39 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -242,6 +242,7 @@ struct domain
     struct page_list_head page_list;  /* linked list */
     struct page_list_head xenpage_list; /* linked list (size xenheap_pages=
) */
     unsigned int     tot_pages;       /* number of pages currently possese=
d */
+    unsigned int     unclaimed_pages; /* pages claimed but not possessed  =
  */
     unsigned int     max_pages;       /* maximum value for tot_pages      =
  */
     atomic_t         shr_pages;       /* number of shared pages           =
  */
     atomic_t         paged_pages;     /* number of paged-out pages        =
  */

--__135395347276233805abhmt116.oracle.com
Content-Type: application/octet-stream; name="claim-121126-hyp.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-121126-hyp.patch"

ZGlmZiAtLWd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ODUsMzcgQEAgbG9uZyBkb19tZW1vcnlfb3AodW5zaWduZWQgbG9uZyBjbWQsIFhFTl9HVUVTVF9I
QU5ETEVfUEFSQU0odm9pZCkgYXJnKQogICAgICAgICBicmVhazsKICAgICB9CiAKKyAgICBjYXNl
IFhFTk1FTV9jbGFpbV9wYWdlczoKKyAgICAgICAgaWYgKCAhSVNfUFJJVihjdXJyZW50LT5kb21h
aW4pICkKKyAgICAgICAgICAgIHJldHVybiAtRVBFUk07CisKKyAgICAgICAgaWYgKCBjb3B5X2Zy
b21fZ3Vlc3QoJnJlc2VydmF0aW9uLCBhcmcsIDEpICkKKyAgICAgICAgICAgIHJldHVybiAtRUZB
VUxUOworCisgICAgICAgIGlmICggIWd1ZXN0X2hhbmRsZV9pc19udWxsKHJlc2VydmF0aW9uLmV4
dGVudF9zdGFydCkgKQorICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisKKyAgICAgICAgaWYg
KCByZXNlcnZhdGlvbi5leHRlbnRfb3JkZXIgIT0gMCApCisgICAgICAgICAgICByZXR1cm4gLUVJ
TlZBTDsKKworICAgICAgICBkID0gcmN1X2xvY2tfZG9tYWluX2J5X2lkKHJlc2VydmF0aW9uLmRv
bWlkKTsKKyAgICAgICAgaWYgKCBkID09IE5VTEwgKQorICAgICAgICAgICAgcmV0dXJuIC1FSU5W
QUw7CisKKyAgICAgICAgcmMgPSBkb21haW5fc2V0X3VuY2xhaW1lZF9wYWdlcyhkLCByZXNlcnZh
dGlvbi5ucl9leHRlbnRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
IHJlc2VydmF0aW9uLm1lbV9mbGFncyk7CisKKyAgICAgICAgcmN1X3VubG9ja19kb21haW4oZCk7
CisKKyAgICAgICAgYnJlYWs7CisKKyAgICBjYXNlIFhFTk1FTV9nZXRfdW5jbGFpbWVkX3BhZ2Vz
OgorICAgICAgICBpZiAoICFJU19QUklWKGN1cnJlbnQtPmRvbWFpbikgKQorICAgICAg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YWdl
cykgKi8KICAgICB1bnNpZ25lZCBpbnQgICAgIHRvdF9wYWdlczsgICAgICAgLyogbnVtYmVyIG9m
IHBhZ2VzIGN1cnJlbnRseSBwb3NzZXNlZCAqLworICAgIHVuc2lnbmVkIGludCAgICAgdW5jbGFp
bWVkX3BhZ2VzOyAvKiBwYWdlcyBjbGFpbWVkIGJ1dCBub3QgcG9zc2Vzc2VkICAgICovCiAgICAg
dW5zaWduZWQgaW50ICAgICBtYXhfcGFnZXM7ICAgICAgIC8qIG1heGltdW0gdmFsdWUgZm9yIHRv
dF9wYWdlcyAgICAgICAgKi8KICAgICBhdG9taWNfdCAgICAgICAgIHNocl9wYWdlczsgICAgICAg
LyogbnVtYmVyIG9mIHNoYXJlZCBwYWdlcyAgICAgICAgICAgICAqLwogICAgIGF0b21pY190ICAg
ICAgICAgcGFnZWRfcGFnZXM7ICAgICAvKiBudW1iZXIgb2YgcGFnZWQtb3V0IHBhZ2VzICAgICAg
ICAgICovCg==
--__135395347276233805abhmt116.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__135395347276233805abhmt116.oracle.com--


From xen-devel-bounces@lists.xen.org Mon Nov 26 18:11:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 18:11:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td39Q-0006WJ-UA; Mon, 26 Nov 2012 18:11:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td39P-0006Vl-4u
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 18:11:23 +0000
Received: from [85.158.137.99:47102] by server-10.bemta-3.messagelabs.com id
	AD/04-19806-AC0B3B05; Mon, 26 Nov 2012 18:11:22 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1353953479!15613494!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NTMzMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29323 invoked from network); 26 Nov 2012 18:11:21 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-3.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 18:11:21 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQIBEVu006969
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 18:11:15 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQIBDtT023921
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 18:11:14 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQIBCUE016553; Mon, 26 Nov 2012 12:11:13 -0600
MIME-Version: 1.0
Message-ID: <07fd91ec-8b57-47d8-a44d-3b593de6bb9f@default>
Date: Mon, 26 Nov 2012 10:11:09 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__135395347276233805abhmt116.oracle.com"
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Andres Lagar-Cavilla <andreslc@gridcentric.ca>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, Matthew Daley <mattjd@gmail.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH v7 1/2] hypervisor: XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__135395347276233805abhmt116.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

(Note: After sufficient review, this is now a PATCH,
not an RFC/PATCH)

This is patch 1of2 of a seventh cut of the patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account review
feedback from Jan and Keir and IanC and Matthew Daley, plus some
fixes found via runtime debugging (using printk and privcmd only).

v6->v7:
- Need co-existence with low_mem_virq [JBeulich]

v5->v6:
- Fix post-inc problem [mattjd]

v4->v5:
- Split tools part into separate patch [JBeulich]
- Minor coding style fixups [JBeulich]
- Use rcu_lock_domain_by_id, not _target version [JBeulich]

v3->v4: (please ignore v3)
- Process error, sent stale patch, sorry [djm]

v2->v3:
- Add per-domain and global "get" for unclaimed info [JBeulich]
- New hypercall(s) should fail for unpriv callers [IanC]
- Non-zero extent_order disallowed [JBeulich]
- Remove bonehead ASSERTs [JBeulich]
- Need not hold heaplock for decrease case too [JBeulich]
- More descriptive failure return values [JBeulich]
- Don't allow a claim to exceed max_pages [IanC]
- Subops must be in correct ifdef block in memory.c [keir]

v1->v2:
- Add reset-to-zero page claim in domain_kill [JBeulich]
- Proper handling of struct passed to hypercall [JBeulich]
- Fix alloc_heap_pages when a domain has a claim [JBeulich]
- Need not hold heap_lock if !d->unclaimed_pages [keir]
- Fix missed tot_pages call in donate_page [djm]
- Remove domain_reset_unclaimed_pages; use set with zero [djm]
- Bugfixes found through testing in set_unclaimed [djm]
- More comments in code [djm]
- Code formatting fixes [djm]

=3D=3D=3D

Motivation:

The goal of this hypercall is to attempt to atomically and very
quickly determine if there are sufficient pages available in the
system and, if so, "set aside" that quantity of pages for future
allocations by that domain.  Unlike an existing hypercall such as
increase_reservation or populate_physmap, specific physical
pageframes are not assigned to the domain because this
cannot be done sufficiently quickly (especially for very large
allocations in an arbitrarily fragmented system) and so the
existing mechanisms result in classic time-of-check-time-of-use
(TOCTOU) races.  One can think of claiming as similar to a
"lazy" allocation, but subsequent hypercalls are required
to do the actual physical pageframe allocation.

In order for a toolstack to "get" information about whether
a domain has a claim and, if so, how large, and also for
the toolstack to measure the total system-wide claim, a
second subop has been added and exposed through domctl
and libxl (see PATCH 2/2).

Note that this patchset does not include a full toolstack
implementation, in part because Oracle uses xm/xend and a
proprietary toolstack and Citrix apparently does not plan
to use the new mechanism.  The following pseudo-code
describes the proposed claim-based use model, which could
easily be implemented as an xl option such as "xl create --claim".

Current:
- call populate_physmap repeatedly to achieve mem=3DN memory
- if any populate_physmap call fails, report -ENOMEM up the stack
- memory is held until domain dies or the toolstack decreases it

Proposed:
- call claim for mem=3DN amount of memory
- if claim succeeds:
    call populate_physmap repeatedly to achieve mem=3DN memory (failsafe)
  else
    report -ENOMEM up the stack
- claim is held until mem=3DN is achieved or the domain dies or
   the toolstack changes it to 0
- memory is held until domain dies or the toolstack decreases it

It has been noted that this claim mechanism solves the
underlying problem (slow failure of domain creation) for
a large class of domains not not all, specifically not
handling (but also not making the problem worse for) PV
domains that specify the "superpages" flag, and 32-bit PV
domains on large RAM systems.  These may be addressed at a
later time.

Code overview:

Though the hypercall simply does arithmetic within locks,
some of the semantics in the code may be a bit subtle
so let me explain a bit.

The key variables (d->unclaimed_pages and total_unclaimed_pages)
start at zero if no claim has yet been staked for any domain.
(Perhaps a better name is "claimed_but_not_yet_possessed" but that's
a bit unwieldy.)  If no claim hypercalls are executed, there
should be no impact on existing usage.

When a claim is successfully staked by a domain, it is like a
watermark but there is no record kept of the size of the claim.
Instead, d->unclaimed_pages is set to the difference between
d->tot_pages and the claim.  When d->tot_pages increases or decreases,
d->unclaimed_pages atomically decreases or increases.  Once
d->unclaimed_pages reaches zero, the claim is satisfied and
d->unclaimed pages stays at zero -- unless a new claim is
subsequently staked.

The systemwide variable total_unclaimed_pages is always the sum
of d->unclaimed_pages, across all domains.  A non-domain-
specific heap allocation will fail if total_unclaimed_pages
exceeds free (plus, on tmem enabled systems, freeable) pages.

Claim semantics may be modified by flags.  The initial
implementation has one flag, which discerns whether the
caller would like tmem freeable pages to be considered
in determining whether or not the claim can be successfully
staked. Future flags may, for example, specify that the
caller would like the claim to be successful only if there
are sufficient pages available on a single node (per Dario's
suggestion).

A claim can be cancelled by requesting a claim of zero pages.

A second subop returns the total outstanding claimed pages
systemwide.

Note: Save/restore/migrate may need to be modified,
else it can be documented that all claims are cancelled.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 arch/x86/mm.c             |    2=20
 arch/x86/mm/mem_sharing.c |    4 -
 common/domain.c           |    1=20
 common/domctl.c           |    1=20
 common/grant_table.c      |    2=20
 common/memory.c           |   33 ++++++++++++
 common/page_alloc.c       |  120 +++++++++++++++++++++++++++++++++++++++++=
+++--
 include/public/domctl.h   |    3 -
 include/public/memory.h   |   39 ++++++++++++++
 include/xen/mm.h          |    7 ++
 include/xen/sched.h       |    1=20
 11 files changed, 204 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fad3d33..7e55908 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3841,7 +3841,7 @@ int donate_page(
     {
         if ( d->tot_pages >=3D d->max_pages )
             goto fail;
-        d->tot_pages++;
+        domain_increase_tot_pages(d, 1);
     }
=20
     page->count_info =3D PGC_allocated | 1;
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..3d29e35 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d,
     }
=20
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_decrease_tot_pages(d, 1);
     drop_dom_ref =3D (d->tot_pages =3D=3D 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct p=
age_info *page)
     ASSERT(page_get_owner(page) =3D=3D dom_cow);
     page_set_owner(page, d);
=20
-    if ( d->tot_pages++ =3D=3D 0 )
+    if ( domain_increase_tot_pages(d, 1) =3D=3D 1 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 12c8e24..f2cc4f5 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -492,6 +492,7 @@ int domain_kill(struct domain *d)
         evtchn_destroy(d);
         gnttab_release_mappings(d);
         tmem_destroy(d->tmem);
+        domain_set_unclaimed_pages(d, 0, 0);
         d->tmem =3D NULL;
         /* fallthrough */
     case DOMDYING_dying:
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index a7a6b9f..e47a991 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -154,6 +154,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_=
getdomaininfo *info)
=20
     info->tot_pages         =3D d->tot_pages;
     info->max_pages         =3D d->max_pages;
+    info->unclaimed_pages   =3D d->unclaimed_pages;
     info->shr_pages         =3D atomic_read(&d->shr_pages);
     info->paged_pages       =3D atomic_read(&d->paged_pages);
     info->shared_info_frame =3D mfn_to_gmfn(d, __pa(d->shared_info)>>PAGE_=
SHIFT);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..04bfda1 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1656,7 +1656,7 @@ gnttab_transfer(
         }
=20
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ =3D=3D 0) )
+        if ( unlikely(domain_increase_tot_pages(e, 1) =3D=3D 1) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..adb7581 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_=
memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
=20
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -=3D dec_count;
+                domain_decrease_tot_pages(d, dec_count);
                 drop_dom_ref =3D (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
=20
@@ -685,6 +685,37 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_=
PARAM(void) arg)
         break;
     }
=20
+    case XENMEM_claim_pages:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+
+        if ( copy_from_guest(&reservation, arg, 1) )
+            return -EFAULT;
+
+        if ( !guest_handle_is_null(reservation.extent_start) )
+            return -EINVAL;
+
+        if ( reservation.extent_order !=3D 0 )
+            return -EINVAL;
+
+        d =3D rcu_lock_domain_by_id(reservation.domid);
+        if ( d =3D=3D NULL )
+            return -EINVAL;
+
+        rc =3D domain_set_unclaimed_pages(d, reservation.nr_extents,
+                                        reservation.mem_flags);
+
+        rcu_unlock_domain(d);
+
+        break;
+
+    case XENMEM_get_unclaimed_pages:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+
+        rc =3D get_total_unclaimed_pages();
+        break;
+
     default:
         rc =3D arch_memory_op(op, arg);
         break;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 15ebc66..2fea9bf 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -238,6 +238,111 @@ static long midsize_alloc_zone_pages;
 #define MIDSIZE_ALLOC_FRAC 128
=20
 static DEFINE_SPINLOCK(heap_lock);
+static long total_unclaimed_pages; /* total outstanding claims by all doma=
ins */
+
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
+
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages +=3D pages;
+    spin_lock(&heap_lock);
+    dom_before =3D d->unclaimed_pages;
+    dom_after =3D dom_before - pages;
+    if ( (dom_before > 0) && (dom_after < 0) )
+        dom_claimed =3D 0;
+    else
+        dom_claimed =3D dom_after;
+    sys_before =3D total_unclaimed_pages;
+    sys_after =3D sys_before - (dom_before - dom_claimed);
+    BUG_ON( (sys_before > 0) && (sys_after < 0) );
+    total_unclaimed_pages =3D sys_after;
+    d->unclaimed_pages =3D dom_claimed;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges)
+{
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    if ( !d->unclaimed_pages )
+        return d->tot_pages -=3D pages;
+
+    spin_lock(&heap_lock);
+    d->tot_pages -=3D pages;
+    d->unclaimed_pages +=3D pages;
+    total_unclaimed_pages +=3D pages;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
+                                unsigned long flags)
+{
+    int ret =3D -ENOMEM;
+    unsigned long claim, avail_pages;
+
+    /*
+     * take the domain's page_alloc_lock, else all increases/decreases
+     * must always take the global heap_lock rather than only in the much
+     * rarer case that d->unclaimed_pages is non-zero
+     */
+    spin_lock(&d->page_alloc_lock);
+    spin_lock(&heap_lock);
+
+    /* pages=3D=3D0 means "unset" the claim (and flags is ignored) */
+    if ( pages =3D=3D 0 )
+    {
+        total_unclaimed_pages -=3D d->unclaimed_pages;
+        d->unclaimed_pages =3D 0;
+        ret =3D 0;
+        goto out;
+    }
+
+    /* only one active claim per domain please */
+    if ( d->unclaimed_pages )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* disallow a claim not exceeding current tot_pages or above max_pages=
 */
+    if ( (pages <=3D d->tot_pages) || (pages > d->max_pages) )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* how much memory is available? */
+    avail_pages =3D total_avail_pages;
+    if ( !(flags & XENMEM_CLAIMF_free_only) )
+        avail_pages +=3D tmem_freeable_pages();
+    avail_pages -=3D total_unclaimed_pages;
+
+    /*
+     * note, if domain has already allocated memory before making a claim=
=20
+     * then the claim must take tot_pages into account
+     */
+    claim =3D pages - d->tot_pages;
+    if ( claim > avail_pages )
+        goto out;
+
+    /* yay, claim fits in available memory, stake the claim, success! */
+    d->unclaimed_pages =3D claim;
+    total_unclaimed_pages +=3D d->unclaimed_pages;
+    ret =3D 0;
+
+out:
+    spin_unlock(&heap_lock);
+    spin_unlock(&d->page_alloc_lock);
+    return ret;
+}
+
+long get_total_unclaimed_pages(void)
+{
+    return total_unclaimed_pages;
+}
=20
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
@@ -374,7 +479,7 @@ static void __init setup_low_mem_virq(void)
 static void check_low_mem_virq(void)
 {
     unsigned long avail_pages =3D total_avail_pages +
-        (opt_tmem ? tmem_freeable_pages() : 0);
+        (opt_tmem ? tmem_freeable_pages() : 0) - total_unclaimed_pages;
=20
     if ( unlikely(avail_pages <=3D low_mem_virq_th) )
     {
@@ -443,6 +548,15 @@ static struct page_info *alloc_heap_pages(
     spin_lock(&heap_lock);
=20
     /*
+     * Claimed memory is considered unavailable unless the request
+     * is made by a domain with sufficient unclaimed pages.
+     */
+    if ( (total_unclaimed_pages + request >
+          total_avail_pages + tmem_freeable_pages()) &&
+          (d =3D=3D NULL || d->unclaimed_pages < request) )
+        goto not_found;
+
+    /*
      * TMEM: When available memory is scarce due to tmem absorbing it, all=
ow
      * only mid-size allocations to avoid worst of fragmentation issues.
      * Others try tmem pools then fail.  This is a workaround until all
@@ -1291,7 +1405,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages =3D=3D 0) )
             get_knownalive_domain(d);
=20
-        d->tot_pages +=3D 1 << order;
+        domain_increase_tot_pages(d, 1 << order);
     }
=20
     for ( i =3D 0; i < (1 << order); i++ )
@@ -1375,7 +1489,7 @@ void free_domheap_pages(struct page_info *pg, unsigne=
d int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
=20
-        d->tot_pages -=3D 1 << order;
+        domain_decrease_tot_pages(d, 1 << order);
         drop_dom_ref =3D (d->tot_pages =3D=3D 0);
=20
         spin_unlock_recursive(&d->page_alloc_lock);
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 7c0f23d..5735c28 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -36,7 +36,7 @@
 #include "grant_table.h"
 #include "hvm/save.h"
=20
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000009
=20
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -95,6 +95,7 @@ struct xen_domctl_getdomaininfo {
     uint32_t flags;              /* XEN_DOMINF_* */
     uint64_aligned_t tot_pages;
     uint64_aligned_t max_pages;
+    uint64_aligned_t unclaimed_pages;
     uint64_aligned_t shr_pages;
     uint64_aligned_t paged_pages;
     uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index f1ddbc0..15d6c72 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -68,6 +68,8 @@ struct xen_memory_reservation {
      *   IN:  GPFN bases of extents to populate with memory
      *   OUT: GMFN bases of extents that were allocated
      *   (NB. This command also updates the mach_to_phys translation table=
)
+     * XENMEM_claim_pages:
+     *   IN: must be zero
      */
     XEN_GUEST_HANDLE(xen_pfn_t) extent_start;
=20
@@ -421,6 +423,43 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
=20
+/*
+ * Attempt to stake a claim for a domain on a quantity of pages
+ * of system RAM, but _not_ assign specific pageframes.  Only
+ * arithmetic is performed so the hypercall is very fast and need
+ * not be preemptible, thus sidestepping time-of-check-time-of-use
+ * races for memory allocation.  Returns 0 if the hypervisor page
+ * allocator has atomically and successfully claimed the requested
+ * number of pages, else non-zero.
+ *
+ * Any domain may have only one active claim.  When sufficient memory
+ * has been allocated to resolve the claim, the claim silently expires.
+ * Claiming zero pages effectively resets any outstanding claim and
+ * is always successful.
+ *
+ * Note that a valid claim may be staked even after memory has been
+ * allocated for a domain.  In this case, the claim is not incremental,
+ * i.e. if the domain's tot_pages is 3, and a claim is staked for 10,
+ * only 7 additional pages are claimed.
+ *
+ * Caller must be privileged or the hypercall fails.
+ */
+#define XENMEM_claim_pages                  24
+/*
+ * XENMEM_claim_pages flags:
+ *  free_only: claim is successful only if sufficient free pages
+ *    are available.  If not set and tmem is enabled, hypervisor
+ *    may also consider tmem "freeable" pages to satisfy the claim.
+ */
+#define _XENMEM_CLAIMF_free_only            0
+#define XENMEM_CLAIMF_free_only             (1U<<_XENMEM_CLAIMF_free_only)
+/*
+ * Get the number of pages currently claimed (but not yet "possessed")
+ * across all domains.  The caller must be privileged but otherwise
+ * the call never fails.=20
+ */
+#define XENMEM_get_unclaimed_pages            25
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
=20
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 64a0cc1..b4dee92 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,13 @@ void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
=20
+/* Claim handling */
+unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pa=
ges);
+unsigned long domain_decrease_tot_pages(struct domain *d, unsigned long pa=
ges);
+int domain_set_unclaimed_pages(
+    struct domain *d, unsigned long pages, unsigned long flags);
+long get_total_unclaimed_pages(void);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..480ef39 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -242,6 +242,7 @@ struct domain
     struct page_list_head page_list;  /* linked list */
     struct page_list_head xenpage_list; /* linked list (size xenheap_pages=
) */
     unsigned int     tot_pages;       /* number of pages currently possese=
d */
+    unsigned int     unclaimed_pages; /* pages claimed but not possessed  =
  */
     unsigned int     max_pages;       /* maximum value for tot_pages      =
  */
     atomic_t         shr_pages;       /* number of shared pages           =
  */
     atomic_t         paged_pages;     /* number of paged-out pages        =
  */

--__135395347276233805abhmt116.oracle.com
Content-Type: application/octet-stream; name="claim-121126-hyp.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-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k7CiAKQEAgLTY4NSw2ICs2
ODUsMzcgQEAgbG9uZyBkb19tZW1vcnlfb3AodW5zaWduZWQgbG9uZyBjbWQsIFhFTl9HVUVTVF9I
QU5ETEVfUEFSQU0odm9pZCkgYXJnKQogICAgICAgICBicmVhazsKICAgICB9CiAKKyAgICBjYXNl
IFhFTk1FTV9jbGFpbV9wYWdlczoKKyAgICAgICAgaWYgKCAhSVNfUFJJVihjdXJyZW50LT5kb21h
aW4pICkKKyAgICAgICAgICAgIHJldHVybiAtRVBFUk07CisKKyAgICAgICAgaWYgKCBjb3B5X2Zy
b21fZ3Vlc3QoJnJlc2VydmF0aW9uLCBhcmcsIDEpICkKKyAgICAgICAgICAgIHJldHVybiAtRUZB
VUxUOworCisgICAgICAgIGlmICggIWd1ZXN0X2hhbmRsZV9pc19udWxsKHJlc2VydmF0aW9uLmV4
dGVudF9zdGFydCkgKQorICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisKKyAgICAgICAgaWYg
KCByZXNlcnZhdGlvbi5leHRlbnRfb3JkZXIgIT0gMCApCisgICAgICAgICAgICByZXR1cm4gLUVJ
TlZBTDsKKworICAgICAgICBkID0gcmN1X2xvY2tfZG9tYWluX2J5X2lkKHJlc2VydmF0aW9uLmRv
bWlkKTsKKyAgICAgICAgaWYgKCBkID09IE5VTEwgKQorICAgICAgICAgICAgcmV0dXJuIC1FSU5W
QUw7CisKKyAgICAgICAgcmMgPSBkb21haW5fc2V0X3VuY2xhaW1lZF9wYWdlcyhkLCByZXNlcnZh
dGlvbi5ucl9leHRlbnRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
IHJlc2VydmF0aW9uLm1lbV9mbGFncyk7CisKKyAgICAgICAgcmN1X3VubG9ja19kb21haW4oZCk7
CisKKyAgICAgICAgYnJlYWs7CisKKyAgICBjYXNlIFhFTk1FTV9nZXRfdW5jbGFpbWVkX3BhZ2Vz
OgorICAgICAgICBpZiAoICFJU19QUklWKGN1cnJlb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c3QgKHNpemUgeGVuaGVhcF9wYWdl
cykgKi8KICAgICB1bnNpZ25lZCBpbnQgICAgIHRvdF9wYWdlczsgICAgICAgLyogbnVtYmVyIG9m
IHBhZ2VzIGN1cnJlbnRseSBwb3NzZXNlZCAqLworICAgIHVuc2lnbmVkIGludCAgICAgdW5jbGFp
bWVkX3BhZ2VzOyAvKiBwYWdlcyBjbGFpbWVkIGJ1dCBub3QgcG9zc2Vzc2VkICAgICovCiAgICAg
dW5zaWduZWQgaW50ICAgICBtYXhfcGFnZXM7ICAgICAgIC8qIG1heGltdW0gdmFsdWUgZm9yIHRv
dF9wYWdlcyAgICAgICAgKi8KICAgICBhdG9taWNfdCAgICAgICAgIHNocl9wYWdlczsgICAgICAg
LyogbnVtYmVyIG9mIHNoYXJlZCBwYWdlcyAgICAgICAgICAgICAqLwogICAgIGF0b21pY190ICAg
ICAgICAgcGFnZWRfcGFnZXM7ICAgICAvKiBudW1iZXIgb2YgcGFnZWQtb3V0IHBhZ2VzICAgICAg
ICAgICovCg==
--__135395347276233805abhmt116.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__135395347276233805abhmt116.oracle.com--


From xen-devel-bounces@lists.xen.org Mon Nov 26 18:13:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 18:13:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td3Ax-0006rN-Li; Mon, 26 Nov 2012 18:12:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td3Aw-0006qy-7R
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 18:12:58 +0000
Received: from [193.109.254.147:7428] by server-13.bemta-14.messagelabs.com id
	16/1F-11239-821B3B05; Mon, 26 Nov 2012 18:12:56 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353953567!8669752!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NTMzMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11224 invoked from network); 26 Nov 2012 18:12:49 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-3.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 18:12:49 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQICha6008500
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 18:12:44 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQICgDD026887
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 18:12:43 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQICgVu018774; Mon, 26 Nov 2012 12:12:42 -0600
MIME-Version: 1.0
Message-ID: <30eeb3d9-8627-4290-9843-c571a14a02c0@default>
Date: Mon, 26 Nov 2012 10:12:40 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Andres Lagar-Cavilla <andreslc@gridcentric.ca>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, Matthew Daley <mattjd@gmail.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH v7 2/2] tools: XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is patch 2of2 of a seventh cut of the patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account
feedback from Jan and Keir and IanC and Matthew Daley.

As requested by Jan, this is a separate post of the tools
part of the patch.  NOTE: This patch must be applied after
the hypervisor part of the patchset or otherwise may break
the build!

v6->v7:
- no change in this patch (only in patch 1of2)

v5->v6:
- no change in this patch (only in patch 1of2)

Thanks for any feedback!

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 xc_domain.c |    1 +
 xenctrl.h   |    1 +
 2 files changed, 2 insertions(+)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index d98e68b..6d06f7c 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -234,6 +234,7 @@ int xc_domain_getinfo(xc_interface *xch,
 
         info->ssidref  = domctl.u.getdomaininfo.ssidref;
         info->nr_pages = domctl.u.getdomaininfo.tot_pages;
+        info->nr_unclaimed_pages = domctl.u.getdomaininfo.unclaimed_pages;
         info->nr_shared_pages = domctl.u.getdomaininfo.shr_pages;
         info->nr_paged_pages = domctl.u.getdomaininfo.paged_pages;
         info->max_memkb = domctl.u.getdomaininfo.max_pages << (PAGE_SHIFT-10);
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..325f4a3 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -364,6 +364,7 @@ typedef struct xc_dominfo {
                   hvm:1, debugged:1;
     unsigned int  shutdown_reason; /* only meaningful if shutdown==1 */
     unsigned long nr_pages; /* current number, not maximum */
+    unsigned long nr_unclaimed_pages;
     unsigned long nr_shared_pages;
     unsigned long nr_paged_pages;
     unsigned long shared_info_frame;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 18:13:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 18:13:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td3Ax-0006rN-Li; Mon, 26 Nov 2012 18:12:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td3Aw-0006qy-7R
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 18:12:58 +0000
Received: from [193.109.254.147:7428] by server-13.bemta-14.messagelabs.com id
	16/1F-11239-821B3B05; Mon, 26 Nov 2012 18:12:56 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353953567!8669752!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NTMzMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11224 invoked from network); 26 Nov 2012 18:12:49 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-3.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 18:12:49 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQICha6008500
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 18:12:44 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQICgDD026887
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 18:12:43 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQICgVu018774; Mon, 26 Nov 2012 12:12:42 -0600
MIME-Version: 1.0
Message-ID: <30eeb3d9-8627-4290-9843-c571a14a02c0@default>
Date: Mon, 26 Nov 2012 10:12:40 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Andres Lagar-Cavilla <andreslc@gridcentric.ca>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, Matthew Daley <mattjd@gmail.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH v7 2/2] tools: XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is patch 2of2 of a seventh cut of the patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account
feedback from Jan and Keir and IanC and Matthew Daley.

As requested by Jan, this is a separate post of the tools
part of the patch.  NOTE: This patch must be applied after
the hypervisor part of the patchset or otherwise may break
the build!

v6->v7:
- no change in this patch (only in patch 1of2)

v5->v6:
- no change in this patch (only in patch 1of2)

Thanks for any feedback!

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 xc_domain.c |    1 +
 xenctrl.h   |    1 +
 2 files changed, 2 insertions(+)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index d98e68b..6d06f7c 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -234,6 +234,7 @@ int xc_domain_getinfo(xc_interface *xch,
 
         info->ssidref  = domctl.u.getdomaininfo.ssidref;
         info->nr_pages = domctl.u.getdomaininfo.tot_pages;
+        info->nr_unclaimed_pages = domctl.u.getdomaininfo.unclaimed_pages;
         info->nr_shared_pages = domctl.u.getdomaininfo.shr_pages;
         info->nr_paged_pages = domctl.u.getdomaininfo.paged_pages;
         info->max_memkb = domctl.u.getdomaininfo.max_pages << (PAGE_SHIFT-10);
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..325f4a3 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -364,6 +364,7 @@ typedef struct xc_dominfo {
                   hvm:1, debugged:1;
     unsigned int  shutdown_reason; /* only meaningful if shutdown==1 */
     unsigned long nr_pages; /* current number, not maximum */
+    unsigned long nr_unclaimed_pages;
     unsigned long nr_shared_pages;
     unsigned long nr_paged_pages;
     unsigned long shared_info_frame;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 18:17:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 18:17:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td3Er-00078F-Bc; Mon, 26 Nov 2012 18:17:01 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td3Eq-000788-48
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 18:17:00 +0000
Received: from [193.109.254.147:28876] by server-12.bemta-14.messagelabs.com
	id C7/D5-00510-B12B3B05; Mon, 26 Nov 2012 18:16:59 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353953815!8670161!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20280 invoked from network); 26 Nov 2012 18:16:56 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 18:16:56 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215501253"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 18:16:54 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 13:16:53 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td3Ej-00078p-GC;
	Mon, 26 Nov 2012 18:16:53 +0000
Message-ID: <50B3B215.3020000@citrix.com>
Date: Mon, 26 Nov 2012 18:16:53 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: George Dunlap <dunlapg@umich.edu>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
In-Reply-To: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
X-Enigmail-Version: 1.4.6
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 26/11/12 17:57, George Dunlap wrote:
> So while doing a bit of investigation into a request that we have
> instructions for how to sign a Xen binary, I came across a related
> pair of questions.  If we boot from a signed Xen binary, then:
> 1. Will Xen then successfully boot a signed dom0 kernel / initrd?
> 2. Will Xen fail to boot an unsigned dom0 kernel / initrd?
>
> I think if Xen is signed, then ideally we want both 1 and 2 to be
> true, right?  Does UEFI provide a way to check the signature of
> files?  Does it happen automatically, or would we need to add extra
> support?  Or would we need to embed a public key within the Xen binary
> and have Xen check the signatures of files that it reads?
>
>  -George

The problem is deeper than that.

The idea of secure boot is that only signed/verified code can perform
privileged operations.  One can argue as to exactly where this boundary
lies, but in the native case, it contains any kernel level code. 
Userspace uses the kernel API/ABI subject to the permissions checks
present and (assuming no security holes), everyone is happy.

In the Xen case, Xen will happily accept any privileged hypercalls from
dom0.  So you could argue that anything able to make ioctls against
/dev/xen/privcmd (and friends) would need to be within the signed code. 
This is the entire toolstack, and all root processes.

Furthermore, cross-domain systems like xenbus/xenstore would also need
to be signed.  Imagine the carnage a malicious xenstored could cause!

I am struggling to think of a way of getting secure boot working
correctly without signing all of dom0.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 18:17:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 18:17:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td3Er-00078F-Bc; Mon, 26 Nov 2012 18:17:01 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Td3Eq-000788-48
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 18:17:00 +0000
Received: from [193.109.254.147:28876] by server-12.bemta-14.messagelabs.com
	id C7/D5-00510-B12B3B05; Mon, 26 Nov 2012 18:16:59 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1353953815!8670161!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20280 invoked from network); 26 Nov 2012 18:16:56 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 18:16:56 -0000
X-IronPort-AV: E=Sophos;i="4.83,321,1352073600"; d="scan'208";a="215501253"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 18:16:54 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 13:16:53 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Td3Ej-00078p-GC;
	Mon, 26 Nov 2012 18:16:53 +0000
Message-ID: <50B3B215.3020000@citrix.com>
Date: Mon, 26 Nov 2012 18:16:53 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: George Dunlap <dunlapg@umich.edu>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
In-Reply-To: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
X-Enigmail-Version: 1.4.6
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 26/11/12 17:57, George Dunlap wrote:
> So while doing a bit of investigation into a request that we have
> instructions for how to sign a Xen binary, I came across a related
> pair of questions.  If we boot from a signed Xen binary, then:
> 1. Will Xen then successfully boot a signed dom0 kernel / initrd?
> 2. Will Xen fail to boot an unsigned dom0 kernel / initrd?
>
> I think if Xen is signed, then ideally we want both 1 and 2 to be
> true, right?  Does UEFI provide a way to check the signature of
> files?  Does it happen automatically, or would we need to add extra
> support?  Or would we need to embed a public key within the Xen binary
> and have Xen check the signatures of files that it reads?
>
>  -George

The problem is deeper than that.

The idea of secure boot is that only signed/verified code can perform
privileged operations.  One can argue as to exactly where this boundary
lies, but in the native case, it contains any kernel level code. 
Userspace uses the kernel API/ABI subject to the permissions checks
present and (assuming no security holes), everyone is happy.

In the Xen case, Xen will happily accept any privileged hypercalls from
dom0.  So you could argue that anything able to make ioctls against
/dev/xen/privcmd (and friends) would need to be within the signed code. 
This is the entire toolstack, and all root processes.

Furthermore, cross-domain systems like xenbus/xenstore would also need
to be signed.  Imagine the carnage a malicious xenstored could cause!

I am struggling to think of a way of getting secure boot working
correctly without signing all of dom0.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 18:25:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 18:25:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td3NG-0007QR-C8; Mon, 26 Nov 2012 18:25:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1Td3NE-0007QM-Mj
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 18:25:40 +0000
Received: from [193.109.254.147:20324] by server-13.bemta-14.messagelabs.com
	id C5/07-11239-324B3B05; Mon, 26 Nov 2012 18:25:39 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-16.tower-27.messagelabs.com!1353954338!8450278!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32733 invoked from network); 26 Nov 2012 18:25:38 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2012 18:25:38 -0000
Received: from 136-70-ftth.on.nl ([88.159.70.136]:53433 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1Td3QW-00007c-Bt; Mon, 26 Nov 2012 19:29:04 +0100
Date: Mon, 26 Nov 2012 19:25:33 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <1545900898.20121126192533@eikelenboom.it>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
In-Reply-To: <cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
	<cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
MIME-Version: 1.0
Cc: xen-devel@lists.xensource.com, Alexander Bienzeisler <chosi@amd.co.at>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

DQpNb25kYXksIE5vdmVtYmVyIDI2LCAyMDEyLCA1OjU4OjI4IFBNLCB5b3Ugd3JvdGU6Cgo+PiBG
cm9tOiBJYW4gQ2FtcGJlbGwgW21haWx0bzpJYW4uQ2FtcGJlbGxAY2l0cml4LmNvbV0KPj4gU2Vu
dDogRnJpZGF5LCBOb3ZlbWJlciAyMywgMjAxMiA2OjM0IEFNCj4+IFRvOiBQYXNpIEvDpHJra8Ok
aW5lbgo+PiBDYzogeGVuLWRldmVsQGxpc3RzLnhlbnNvdXJjZS5jb207IEFsZXhhbmRlciBCaWVu
emVpc2xlcgo+PiBTdWJqZWN0OiBSZTogW1hlbi1kZXZlbF0gY2FuIG5vdCB1c2UgYWxsIGF2YWls
YWJsZSBtZW1vcnkKPj4gCj4+IE9uIEZyaSwgMjAxMi0xMS0yMyBhdCAxMzoyOSArMDAwMCwgUGFz
aS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CdzIHRoZSBsYXJnZSBudW1iZXIg
b2Ygbm9uLUNpdHJpeC1ub24tT3JhY2xlIFhlbi1hcy1hLXNlcnZpY2UKPiBwcm92aWRlcnMgSSBh
bSB0cnlpbmcgdG8gaGVscCBoZXJlLgoKCgpIbW0gaSB3YXMgYml0dGVuIGJ5IHRoaXMgMiB3ZWVr
cyBhZ28sIGkgZm91bmQgaXQgYSBiaXQgbm90IGludHVpdGl2ZSB0aGF0OgotIFdoaWxlIHRoZSBn
dWVzdCBpIHdhcyB0cnlpbmcgdG8gc3RhcnQgcmVxdWlyZWQgbGVzcyBtZW1vcnkgdGhhbiB3YXMg
ZnJlZWx5IGF2YWlsYWJsZSAoYWNjb3JkaW5nIHRvIHhlbnRvcCkgb3V0c2lkZSBvZiBkb20wCi0g
SXQgd291bGQgZmFpbCwgYmVjYXVzZSB4bCBzdGFydGVkIHRvIHRyeSB0byBiYWxsb29uIGRvbTAg
ZG93biB3aGljaCBmYWlsZWQuCgotLQpTYW5kZXIKCgpfX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBs
aXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Mon Nov 26 18:25:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 18:25:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td3NG-0007QR-C8; Mon, 26 Nov 2012 18:25:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1Td3NE-0007QM-Mj
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 18:25:40 +0000
Received: from [193.109.254.147:20324] by server-13.bemta-14.messagelabs.com
	id C5/07-11239-324B3B05; Mon, 26 Nov 2012 18:25:39 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-16.tower-27.messagelabs.com!1353954338!8450278!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32733 invoked from network); 26 Nov 2012 18:25:38 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2012 18:25:38 -0000
Received: from 136-70-ftth.on.nl ([88.159.70.136]:53433 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1Td3QW-00007c-Bt; Mon, 26 Nov 2012 19:29:04 +0100
Date: Mon, 26 Nov 2012 19:25:33 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <1545900898.20121126192533@eikelenboom.it>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
In-Reply-To: <cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
	<cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
MIME-Version: 1.0
Cc: xen-devel@lists.xensource.com, Alexander Bienzeisler <chosi@amd.co.at>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

DQpNb25kYXksIE5vdmVtYmVyIDI2LCAyMDEyLCA1OjU4OjI4IFBNLCB5b3Ugd3JvdGU6Cgo+PiBG
cm9tOiBJYW4gQ2FtcGJlbGwgW21haWx0bzpJYW4uQ2FtcGJlbGxAY2l0cml4LmNvbV0KPj4gU2Vu
dDogRnJpZGF5LCBOb3ZlbWJlciAyMywgMjAxMiA2OjM0IEFNCj4+IFRvOiBQYXNpIEvDpHJra8Ok
aW5lbgo+PiBDYzogeGVuLWRldmVsQGxpc3RzLnhlbnNvdXJjZS5jb207IEFsZXhhbmRlciBCaWVu
emVpc2xlcgo+PiBTdWJqZWN0OiBSZTogW1hlbi1kZXZlbF0gY2FuIG5vdCB1c2UgYWxsIGF2YWls
YWJsZSBtZW1vcnkKPj4gCj4+IE9uIEZyaSwgMjAxMi0xMS0yMyBhdCAxMzoyOSArMDAwMCwgUGFz
aSBLw6Rya2vDpGluZW4gd3JvdGU6Cj4+ID4gT24gRnJpLCBOb3YgMjMsIDIwMTIgYXQgMDE6MTU6
NTNQTSArMDAwMCwgSWFuIEN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nMgSSBh
bSB0cnlpbmcgdG8gaGVscCBoZXJlLgoKCgpIbW0gaSB3YXMgYml0dGVuIGJ5IHRoaXMgMiB3ZWVr
cyBhZ28sIGkgZm91bmQgaXQgYSBiaXQgbm90IGludHVpdGl2ZSB0aGF0OgotIFdoaWxlIHRoZSBn
dWVzdCBpIHdhcyB0cnlpbmcgdG8gc3RhcnQgcmVxdWlyZWQgbGVzcyBtZW1vcnkgdGhhbiB3YXMg
ZnJlZWx5IGF2YWlsYWJsZSAoYWNjb3JkaW5nIHRvIHhlbnRvcCkgb3V0c2lkZSBvZiBkb20wCi0g
SXQgd291bGQgZmFpbCwgYmVjYXVzZSB4bCBzdGFydGVkIHRvIHRyeSB0byBiYWxsb29uIGRvbTAg
ZG93biB3aGljaCBmYWlsZWQuCgotLQpTYW5kZXIKCgpfX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBs
aXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Mon Nov 26 19:08:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 19:08:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td424-00081x-TU; Mon, 26 Nov 2012 19:07:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td423-00081s-IX
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 19:07:51 +0000
Received: from [85.158.137.99:22463] by server-9.bemta-3.messagelabs.com id
	7C/0C-02388-60EB3B05; Mon, 26 Nov 2012 19:07:50 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1353956868!17533775!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NTMzMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6896 invoked from network); 26 Nov 2012 19:07:50 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 19:07:50 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQJ7gga003743
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 19:07:43 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQJ7fDQ029730
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 19:07:41 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQJ7eAY002244; Mon, 26 Nov 2012 13:07:40 -0600
MIME-Version: 1.0
Message-ID: <38a09df7-3d82-403f-9153-9a151b220a41@default>
Date: Mon, 26 Nov 2012 11:07:38 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>, Ian Campbell
	<Ian.Campbell@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, TimDeegan <tim@xen.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Keir Fraser <keir@xen.org>, Konrad Wilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George, Ian, Ian, Tim --

After the very extended debate about Oracle's proposed
"memory capacity claim" hypercall, it seemed prudent to
first implement and demonstrate a working model.

A hypervisor patch (and a two-line libxc patch) has
now been completed and reviewed and Jan Beulich has found
it acceptable, so it is now time to return to the
discussion of whether the feature is needed.  The
patch description provides the detailed technical argument:
http://lists.xen.org/archives/html/xen-devel/2012-11/msg01427.html 

I believe, in the earlier debate, you were the most
vociferous opponents of this proposed hypercall,
primarily -- if I may attempt to summarize -- because
you believe that your paradigm of a how a toolstack
should manage memory ("omnisciently") renders the proposed
feature unnecessary.  I believe I adequately described
the differences between your paradigm and Oracle's, and
also demonstrated Oracle's customer need for the feature,
but the debate fell silent without your acknowledgement.

While it has always been my understanding that the
hypervisor is intended to be toolstack-independent,
Jan would like your Ack before committing the hypervisor
changes.

So if you still object, please state your objections.
Otherwise, please ack, so Jan can commit it and Oracle
can move forward with toolstack development built
on the hypercall.

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 19:08:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 19:08:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td424-00081x-TU; Mon, 26 Nov 2012 19:07:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td423-00081s-IX
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 19:07:51 +0000
Received: from [85.158.137.99:22463] by server-9.bemta-3.messagelabs.com id
	7C/0C-02388-60EB3B05; Mon, 26 Nov 2012 19:07:50 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1353956868!17533775!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NTMzMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6896 invoked from network); 26 Nov 2012 19:07:50 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 19:07:50 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQJ7gga003743
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 19:07:43 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQJ7fDQ029730
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 19:07:41 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQJ7eAY002244; Mon, 26 Nov 2012 13:07:40 -0600
MIME-Version: 1.0
Message-ID: <38a09df7-3d82-403f-9153-9a151b220a41@default>
Date: Mon, 26 Nov 2012 11:07:38 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>, Ian Campbell
	<Ian.Campbell@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, TimDeegan <tim@xen.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Keir Fraser <keir@xen.org>, Konrad Wilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George, Ian, Ian, Tim --

After the very extended debate about Oracle's proposed
"memory capacity claim" hypercall, it seemed prudent to
first implement and demonstrate a working model.

A hypervisor patch (and a two-line libxc patch) has
now been completed and reviewed and Jan Beulich has found
it acceptable, so it is now time to return to the
discussion of whether the feature is needed.  The
patch description provides the detailed technical argument:
http://lists.xen.org/archives/html/xen-devel/2012-11/msg01427.html 

I believe, in the earlier debate, you were the most
vociferous opponents of this proposed hypercall,
primarily -- if I may attempt to summarize -- because
you believe that your paradigm of a how a toolstack
should manage memory ("omnisciently") renders the proposed
feature unnecessary.  I believe I adequately described
the differences between your paradigm and Oracle's, and
also demonstrated Oracle's customer need for the feature,
but the debate fell silent without your acknowledgement.

While it has always been my understanding that the
hypervisor is intended to be toolstack-independent,
Jan would like your Ack before committing the hypervisor
changes.

So if you still object, please state your objections.
Otherwise, please ack, so Jan can commit it and Oracle
can move forward with toolstack development built
on the hypercall.

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 19:23:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 19:23:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td4Gd-0008F5-CX; Mon, 26 Nov 2012 19:22:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Td4Gb-0008F0-Uz
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 19:22:54 +0000
Received: from [85.158.139.83:24132] by server-7.bemta-5.messagelabs.com id
	44/48-23096-D81C3B05; Mon, 26 Nov 2012 19:22:53 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1353957771!32005249!1
X-Originating-IP: [209.85.212.175]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11375 invoked from network); 26 Nov 2012 19:22:51 -0000
Received: from mail-wi0-f175.google.com (HELO mail-wi0-f175.google.com)
	(209.85.212.175)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 19:22:51 -0000
Received: by mail-wi0-f175.google.com with SMTP id hm11so3258784wib.14
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 11:22:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=0po2ubjrWywdM7cjsF9kr4JnIl+ReDzkvuJWxE8tgCw=;
	b=HpbJD0fMrdwbqb4MuHvM1xDZsbbe8qd4X0oEELfteFBGDMhQq3+nhyHZ8TT592vGoX
	7nq6dpHSk1mZEbPC/rxSw5KP+J3huB/BAXmn2Uul4V5PWSRYLvoj7KRSL17+8EpTmpZb
	FSzeNnkoatLEFfy72UhHzwasM6ppRjYfO+XYf5qYzKvn0nzfGi+nEoNokhBmdlF4DuaE
	CFg2C/c9yAYcCR2/iMFuvl4UsX4t9wTqThDtc4LmmsSOt/8hbYoF5XGlp6Rt1kXOkfcZ
	WcLkTat5rUFUSrrl0dNEnwGGnx6oYMtfq/b6JY8m6iF2lU55KiD5ar+tMxIQNKJo4n/u
	u3ig==
Received: by 10.180.20.109 with SMTP id m13mr22946219wie.16.1353957771692;
	Mon, 26 Nov 2012 11:22:51 -0800 (PST)
Received: from [192.168.1.88]
	(host86-183-153-239.range86-183.btcentralplus.com. [86.183.153.239])
	by mx.google.com with ESMTPS id bd7sm350833wib.8.2012.11.26.11.22.49
	(version=SSLv3 cipher=OTHER); Mon, 26 Nov 2012 11:22:50 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Mon, 26 Nov 2012 19:22:46 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>,
	Jan Beulich <JBeulich@suse.com>
Message-ID: <CCD97206.460F3%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
Thread-Index: Ac3MC2oT+Xrwgn2fxUaVAJzi0dVEEw==
In-Reply-To: <1353949952.5830.131.camel@zakaz.uk.xensource.com>
Mime-version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 26/11/2012 17:12, "Ian Campbell" <Ian.Campbell@citrix.com> wrote:

>> That's how things are with multi-insn asm-s (and even with single-
>> insn ones when an output different from an input get tied together
>> through using the same register). I continue to think that using the
>> numbered forms here is better.
> 
> I think the important difference here is that the mul generates its
> result specifically in rdx:rax rather than user specified registers.
> Since the output is not specified via the constraints IMHO using the
> constraints when subsequently consuming those outputs is confusing.
> 
> I'd agree with you if mul was something like "mul %2,%0,%1" (where %2*%
> rax =>%0:%1) then "shrd $32,%0,%1" would be perfectly fine.
> 
> Anyway I guess we'll have to agree to disagree. In any case your opinion
> trumps mine on this code ;-)

I didn't find Jan's asm particularly confusing, any more than it kind of
fundamentally is. It's fine by me for it to go in as it is.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 19:23:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 19:23:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td4Gd-0008F5-CX; Mon, 26 Nov 2012 19:22:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Td4Gb-0008F0-Uz
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 19:22:54 +0000
Received: from [85.158.139.83:24132] by server-7.bemta-5.messagelabs.com id
	44/48-23096-D81C3B05; Mon, 26 Nov 2012 19:22:53 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1353957771!32005249!1
X-Originating-IP: [209.85.212.175]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11375 invoked from network); 26 Nov 2012 19:22:51 -0000
Received: from mail-wi0-f175.google.com (HELO mail-wi0-f175.google.com)
	(209.85.212.175)
	by server-2.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 19:22:51 -0000
Received: by mail-wi0-f175.google.com with SMTP id hm11so3258784wib.14
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 11:22:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=0po2ubjrWywdM7cjsF9kr4JnIl+ReDzkvuJWxE8tgCw=;
	b=HpbJD0fMrdwbqb4MuHvM1xDZsbbe8qd4X0oEELfteFBGDMhQq3+nhyHZ8TT592vGoX
	7nq6dpHSk1mZEbPC/rxSw5KP+J3huB/BAXmn2Uul4V5PWSRYLvoj7KRSL17+8EpTmpZb
	FSzeNnkoatLEFfy72UhHzwasM6ppRjYfO+XYf5qYzKvn0nzfGi+nEoNokhBmdlF4DuaE
	CFg2C/c9yAYcCR2/iMFuvl4UsX4t9wTqThDtc4LmmsSOt/8hbYoF5XGlp6Rt1kXOkfcZ
	WcLkTat5rUFUSrrl0dNEnwGGnx6oYMtfq/b6JY8m6iF2lU55KiD5ar+tMxIQNKJo4n/u
	u3ig==
Received: by 10.180.20.109 with SMTP id m13mr22946219wie.16.1353957771692;
	Mon, 26 Nov 2012 11:22:51 -0800 (PST)
Received: from [192.168.1.88]
	(host86-183-153-239.range86-183.btcentralplus.com. [86.183.153.239])
	by mx.google.com with ESMTPS id bd7sm350833wib.8.2012.11.26.11.22.49
	(version=SSLv3 cipher=OTHER); Mon, 26 Nov 2012 11:22:50 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Mon, 26 Nov 2012 19:22:46 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>,
	Jan Beulich <JBeulich@suse.com>
Message-ID: <CCD97206.460F3%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
Thread-Index: Ac3MC2oT+Xrwgn2fxUaVAJzi0dVEEw==
In-Reply-To: <1353949952.5830.131.camel@zakaz.uk.xensource.com>
Mime-version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 26/11/2012 17:12, "Ian Campbell" <Ian.Campbell@citrix.com> wrote:

>> That's how things are with multi-insn asm-s (and even with single-
>> insn ones when an output different from an input get tied together
>> through using the same register). I continue to think that using the
>> numbered forms here is better.
> 
> I think the important difference here is that the mul generates its
> result specifically in rdx:rax rather than user specified registers.
> Since the output is not specified via the constraints IMHO using the
> constraints when subsequently consuming those outputs is confusing.
> 
> I'd agree with you if mul was something like "mul %2,%0,%1" (where %2*%
> rax =>%0:%1) then "shrd $32,%0,%1" would be perfectly fine.
> 
> Anyway I guess we'll have to agree to disagree. In any case your opinion
> trumps mine on this code ;-)

I didn't find Jan's asm particularly confusing, any more than it kind of
fundamentally is. It's fine by me for it to go in as it is.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 19:24:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 19:24:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td4HI-0008HN-R0; Mon, 26 Nov 2012 19:23:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Td4HG-0008H6-Mn
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 19:23:34 +0000
Received: from [85.158.143.99:64937] by server-2.bemta-4.messagelabs.com id
	56/AA-28922-5B1C3B05; Mon, 26 Nov 2012 19:23:33 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1353957813!26181251!1
X-Originating-IP: [209.85.212.179]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3045 invoked from network); 26 Nov 2012 19:23:33 -0000
Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com)
	(209.85.212.179)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 19:23:33 -0000
Received: by mail-wi0-f179.google.com with SMTP id hj6so3178500wib.14
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 11:23:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=b0A/jVbSL/9xnV9fgDbgAIf+8rChdBagS0nCAOD1XSY=;
	b=YT9oJifOJMSz94dO9//V39dU3HBUcHF0kYG2QM14CfbjwIItRQNis1jX2d6Ovh+EZR
	z7uIVtEUZiU+aNCxZFsIdMtfB/GxqtS5uHT5opH2sAxfMPcCVp1ZFSBfWlX1bwzl1Awf
	AvbELdvoa4AnFrHGguWrIlYboD13YxZV1gwi4qAPB8HWS6SpUwgR8HCK1zLRLl8rO9ca
	SQN7zdcG5LyEoXC8BPRlbpzSvL+hwfP9+MfFSW6b4qzbKRyrNkcCrDbI/w+yDLZNdcQo
	Xk0nuzfcUijd16bphEoXoquh//fh4tdHscyJ8UV2sehUa5Ps996tSnjX95MgfgD94lcr
	Ko4g==
Received: by 10.180.20.177 with SMTP id o17mr4366068wie.18.1353957813243;
	Mon, 26 Nov 2012 11:23:33 -0800 (PST)
Received: from [192.168.1.88]
	(host86-183-153-239.range86-183.btcentralplus.com. [86.183.153.239])
	by mx.google.com with ESMTPS id s12sm304593wik.11.2012.11.26.11.23.31
	(version=SSLv3 cipher=OTHER); Mon, 26 Nov 2012 11:23:32 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Mon, 26 Nov 2012 19:23:28 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Sylvain Munaut <s.munaut@whatever-company.com>
Message-ID: <CCD97230.460F4%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
Thread-Index: Ac3MC4McfJ4BVvipHkG3vFs4nPHr4A==
In-Reply-To: <fd048b2a-ec5d-4c0e-a800-7567eecc4211@default>
Mime-version: 1.0
Cc: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 26/11/2012 17:12, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:

>> From: Sylvain Munaut [mailto:s.munaut@whatever-company.com]
>> Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
>> 
>> I've just deployed this to a couple test servers that exhibited the problem.
>> 
>> What I don't really understand is why are some HW affected and not others ?
> 
> I don't know, but I'd imagine there is something in the x86 platform
> software (aka firmware) of those machines that runs and blocks execution
> of Xen for long enough (via NMI/MCE/SMI) for the platform timer to
> overflow, and this doesn't occur on other machines.

It is just luck of the draw. There is no actual platform timer overflow
happening when this bug triggers.

 -- Keir

> Maybe Jan has a better idea...



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 19:24:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 19:24:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td4HI-0008HN-R0; Mon, 26 Nov 2012 19:23:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Td4HG-0008H6-Mn
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 19:23:34 +0000
Received: from [85.158.143.99:64937] by server-2.bemta-4.messagelabs.com id
	56/AA-28922-5B1C3B05; Mon, 26 Nov 2012 19:23:33 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1353957813!26181251!1
X-Originating-IP: [209.85.212.179]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3045 invoked from network); 26 Nov 2012 19:23:33 -0000
Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com)
	(209.85.212.179)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 19:23:33 -0000
Received: by mail-wi0-f179.google.com with SMTP id hj6so3178500wib.14
	for <xen-devel@lists.xen.org>; Mon, 26 Nov 2012 11:23:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=b0A/jVbSL/9xnV9fgDbgAIf+8rChdBagS0nCAOD1XSY=;
	b=YT9oJifOJMSz94dO9//V39dU3HBUcHF0kYG2QM14CfbjwIItRQNis1jX2d6Ovh+EZR
	z7uIVtEUZiU+aNCxZFsIdMtfB/GxqtS5uHT5opH2sAxfMPcCVp1ZFSBfWlX1bwzl1Awf
	AvbELdvoa4AnFrHGguWrIlYboD13YxZV1gwi4qAPB8HWS6SpUwgR8HCK1zLRLl8rO9ca
	SQN7zdcG5LyEoXC8BPRlbpzSvL+hwfP9+MfFSW6b4qzbKRyrNkcCrDbI/w+yDLZNdcQo
	Xk0nuzfcUijd16bphEoXoquh//fh4tdHscyJ8UV2sehUa5Ps996tSnjX95MgfgD94lcr
	Ko4g==
Received: by 10.180.20.177 with SMTP id o17mr4366068wie.18.1353957813243;
	Mon, 26 Nov 2012 11:23:33 -0800 (PST)
Received: from [192.168.1.88]
	(host86-183-153-239.range86-183.btcentralplus.com. [86.183.153.239])
	by mx.google.com with ESMTPS id s12sm304593wik.11.2012.11.26.11.23.31
	(version=SSLv3 cipher=OTHER); Mon, 26 Nov 2012 11:23:32 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Mon, 26 Nov 2012 19:23:28 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Sylvain Munaut <s.munaut@whatever-company.com>
Message-ID: <CCD97230.460F4%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
Thread-Index: Ac3MC4McfJ4BVvipHkG3vFs4nPHr4A==
In-Reply-To: <fd048b2a-ec5d-4c0e-a800-7567eecc4211@default>
Mime-version: 1.0
Cc: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 26/11/2012 17:12, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:

>> From: Sylvain Munaut [mailto:s.munaut@whatever-company.com]
>> Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
>> 
>> I've just deployed this to a couple test servers that exhibited the problem.
>> 
>> What I don't really understand is why are some HW affected and not others ?
> 
> I don't know, but I'd imagine there is something in the x86 platform
> software (aka firmware) of those machines that runs and blocks execution
> of Xen for long enough (via NMI/MCE/SMI) for the platform timer to
> overflow, and this doesn't occur on other machines.

It is just luck of the draw. There is no actual platform timer overflow
happening when this bug triggers.

 -- Keir

> Maybe Jan has a better idea...



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 19:36:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 19:36:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td4Tl-0000Dy-63; Mon, 26 Nov 2012 19:36:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1Td4Tj-0000Dt-Qz
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 19:36:28 +0000
Received: from [85.158.143.99:36604] by server-1.bemta-4.messagelabs.com id
	A0/54-27934-BB4C3B05; Mon, 26 Nov 2012 19:36:27 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1353958585!26188252!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13639 invoked from network); 26 Nov 2012 19:36:26 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 19:36:26 -0000
X-IronPort-AV: E=Sophos;i="4.83,323,1352073600"; d="scan'208";a="215510584"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 19:35:45 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 14:35:45 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1Td4T3-0008D1-4r;
	Mon, 26 Nov 2012 19:35:45 +0000
Date: Mon, 26 Nov 2012 19:35:43 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Roger Pau Monne <roger.pau@citrix.com>
In-Reply-To: <50B357A7.6050905@citrix.com>
Message-ID: <alpine.DEB.2.02.1211261934370.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231250330.13749@kaball.uk.xensource.com>
	<50B357A7.6050905@citrix.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] README: add Pixman as build dependency
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 26 Nov 2012, Roger Pau Monne wrote:
> On 23/11/12 13:51, Stefano Stabellini wrote:
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > 
> > diff --git a/README b/README
> > index 21a81b2..88300df 100644
> > --- a/README
> > +++ b/README
> > @@ -51,6 +51,7 @@ provided by your OS distributor:
> >      * Development install of libaio (e.g. libaio-dev) version 0.3.107 or
> >        greater. Set CONFIG_SYSTEM_LIBAIO in .config if this is not available.
> >      * Development install of GLib v2.0 (e.g. libglib2.0-dev)
> > +    * Development install of Pixman (e.g. libpixman-1-dev)
> 
> Should we add a configure test for Pixman? I guess this is needed by Qemu.

Yes, it is a QEMU dependency.

Is it actually a good idea to replicate all the configure checks done by
QEMU's configure script in the Xen configure script?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 19:36:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 19:36:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td4Tl-0000Dy-63; Mon, 26 Nov 2012 19:36:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1Td4Tj-0000Dt-Qz
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 19:36:28 +0000
Received: from [85.158.143.99:36604] by server-1.bemta-4.messagelabs.com id
	A0/54-27934-BB4C3B05; Mon, 26 Nov 2012 19:36:27 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1353958585!26188252!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13639 invoked from network); 26 Nov 2012 19:36:26 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 19:36:26 -0000
X-IronPort-AV: E=Sophos;i="4.83,323,1352073600"; d="scan'208";a="215510584"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 19:35:45 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 14:35:45 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1Td4T3-0008D1-4r;
	Mon, 26 Nov 2012 19:35:45 +0000
Date: Mon, 26 Nov 2012 19:35:43 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Roger Pau Monne <roger.pau@citrix.com>
In-Reply-To: <50B357A7.6050905@citrix.com>
Message-ID: <alpine.DEB.2.02.1211261934370.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231250330.13749@kaball.uk.xensource.com>
	<50B357A7.6050905@citrix.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] README: add Pixman as build dependency
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 26 Nov 2012, Roger Pau Monne wrote:
> On 23/11/12 13:51, Stefano Stabellini wrote:
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > 
> > diff --git a/README b/README
> > index 21a81b2..88300df 100644
> > --- a/README
> > +++ b/README
> > @@ -51,6 +51,7 @@ provided by your OS distributor:
> >      * Development install of libaio (e.g. libaio-dev) version 0.3.107 or
> >        greater. Set CONFIG_SYSTEM_LIBAIO in .config if this is not available.
> >      * Development install of GLib v2.0 (e.g. libglib2.0-dev)
> > +    * Development install of Pixman (e.g. libpixman-1-dev)
> 
> Should we add a configure test for Pixman? I guess this is needed by Qemu.

Yes, it is a QEMU dependency.

Is it actually a good idea to replicate all the configure checks done by
QEMU's configure script in the Xen configure script?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 19:50:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 19:50:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td4h3-0000T0-OO; Mon, 26 Nov 2012 19:50:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1Td4h1-0000Sv-RE
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 19:50:12 +0000
Received: from [85.158.139.83:64604] by server-7.bemta-5.messagelabs.com id
	57/FC-23096-2F7C3B05; Mon, 26 Nov 2012 19:50:10 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1353959408!23397552!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU5NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1583 invoked from network); 26 Nov 2012 19:50:09 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-16.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 19:50:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,323,1352073600"; d="scan'208";a="45654347"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 19:50:07 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 14:50:07 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1Td4gw-0008PA-Oc;
	Mon, 26 Nov 2012 19:50:06 +0000
Date: Mon, 26 Nov 2012 19:50:05 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Darren Shepherd <darren.s.shepherd@gmail.com>
In-Reply-To: <D8B61355-4276-418B-8207-35D806928C20@gmail.com>
Message-ID: <alpine.DEB.2.02.1211261949060.5310@kaball.uk.xensource.com>
References: <CAMCEDC0sU+kBkGWmUoWwyOJ8pURZGwVgN1_xqDkt1MvxR-vE4A@mail.gmail.com>
	<CAG1y0sci4Q8=Vy7i3NPfdYmH6e9rbvrHUPeoz_03+9_GvaHTwA@mail.gmail.com>
	<D8B61355-4276-418B-8207-35D806928C20@gmail.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Fajar A. Nugraha" <list@fajar.net>
Subject: Re: [Xen-devel] blktap3 as a block device?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, 24 Nov 2012, Darren Shepherd wrote:
> On Nov 23, 2012, at 4:39 PM, "Fajar A. Nugraha" <list@fajar.net> wrote:
> 
> > On Sat, Nov 24, 2012 at 7:31 AM, Darren Shepherd
> > <darren.s.shepherd@gmail.com> wrote:
> >> So currently blktap2 can be used outside of Xen, but I don't think many
> >> people do that.  I have a use case now where I must support KVM (I currently
> >> run only Xen servers) and found the disk snapshotting to be not as nice as
> >> what I can do with vhd's in blktap2 (and a half).  So I was thinking of
> >> actually trying to just run blktap for the storage.  So I'm pretty pleased
> >> with that solution and functionally it works just fine.
> >> 
> >> The problem now is blktap3.  So is there going to be any way to use blktap3
> >> outside of Xen?  If blktap3 is the future I probably won't continue with my
> >> blktap/kvm solution.
> > 
> > Since AFAIK blktap3 is not even in xen-unstable, personally I'd just
> > use something with more userbase and better tested. Something like
> > zfsonlinux. It has support for sparse zvols, as well as snapshot and
> > clones.
> > 
> > -- 
> > Fajar
> 
> I'm using blktap2, but that's really besides the point.  
> 
> The more direct question is going forward with blktap3 is there going to be a way to see the blktap device as a block device in dom0?

Yes, setting up a local frontend/backend connection in dom0: the backend is
blktap3, the frontend is the blkfront driver in the dom0 kernel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 19:50:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 19:50:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td4h3-0000T0-OO; Mon, 26 Nov 2012 19:50:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1Td4h1-0000Sv-RE
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 19:50:12 +0000
Received: from [85.158.139.83:64604] by server-7.bemta-5.messagelabs.com id
	57/FC-23096-2F7C3B05; Mon, 26 Nov 2012 19:50:10 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1353959408!23397552!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU5NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1583 invoked from network); 26 Nov 2012 19:50:09 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-16.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 19:50:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,323,1352073600"; d="scan'208";a="45654347"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 19:50:07 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 14:50:07 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1Td4gw-0008PA-Oc;
	Mon, 26 Nov 2012 19:50:06 +0000
Date: Mon, 26 Nov 2012 19:50:05 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Darren Shepherd <darren.s.shepherd@gmail.com>
In-Reply-To: <D8B61355-4276-418B-8207-35D806928C20@gmail.com>
Message-ID: <alpine.DEB.2.02.1211261949060.5310@kaball.uk.xensource.com>
References: <CAMCEDC0sU+kBkGWmUoWwyOJ8pURZGwVgN1_xqDkt1MvxR-vE4A@mail.gmail.com>
	<CAG1y0sci4Q8=Vy7i3NPfdYmH6e9rbvrHUPeoz_03+9_GvaHTwA@mail.gmail.com>
	<D8B61355-4276-418B-8207-35D806928C20@gmail.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Fajar A. Nugraha" <list@fajar.net>
Subject: Re: [Xen-devel] blktap3 as a block device?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, 24 Nov 2012, Darren Shepherd wrote:
> On Nov 23, 2012, at 4:39 PM, "Fajar A. Nugraha" <list@fajar.net> wrote:
> 
> > On Sat, Nov 24, 2012 at 7:31 AM, Darren Shepherd
> > <darren.s.shepherd@gmail.com> wrote:
> >> So currently blktap2 can be used outside of Xen, but I don't think many
> >> people do that.  I have a use case now where I must support KVM (I currently
> >> run only Xen servers) and found the disk snapshotting to be not as nice as
> >> what I can do with vhd's in blktap2 (and a half).  So I was thinking of
> >> actually trying to just run blktap for the storage.  So I'm pretty pleased
> >> with that solution and functionally it works just fine.
> >> 
> >> The problem now is blktap3.  So is there going to be any way to use blktap3
> >> outside of Xen?  If blktap3 is the future I probably won't continue with my
> >> blktap/kvm solution.
> > 
> > Since AFAIK blktap3 is not even in xen-unstable, personally I'd just
> > use something with more userbase and better tested. Something like
> > zfsonlinux. It has support for sparse zvols, as well as snapshot and
> > clones.
> > 
> > -- 
> > Fajar
> 
> I'm using blktap2, but that's really besides the point.  
> 
> The more direct question is going forward with blktap3 is there going to be a way to see the blktap device as a block device in dom0?

Yes, setting up a local frontend/backend connection in dom0: the backend is
blktap3, the frontend is the blkfront driver in the dom0 kernel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 19:54:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 19:54:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td4kt-0000a2-Ee; Mon, 26 Nov 2012 19:54:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1Td4kr-0000Zu-NX
	for Xen-devel@lists.xensource.com; Mon, 26 Nov 2012 19:54:09 +0000
Received: from [85.158.143.99:21153] by server-1.bemta-4.messagelabs.com id
	D2/3E-27934-1E8C3B05; Mon, 26 Nov 2012 19:54:09 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353959647!24423197!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NTMzMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8611 invoked from network); 26 Nov 2012 19:54:08 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 19:54:08 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQJs5qi022955
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 19:54:06 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQJs4jp025804
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 19:54:05 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQJs4tq031786; Mon, 26 Nov 2012 13:54:04 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Mon, 26 Nov 2012 11:54:04 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id BD5ADE00B5D; Mon, 26 Nov 2012 14:54:00 -0500 (EST)
Date: Mon, 26 Nov 2012 14:54:00 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>
Message-ID: <20121126195400.GA8025@phenom.dumpdata.com>
References: <20121114181933.1ffb5f09@mantra.us.oracle.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121114181933.1ffb5f09@mantra.us.oracle.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH]:  PVH: remove FEATURES_PVH macro
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 14, 2012 at 06:19:33PM -0800, Mukesh Rathor wrote:
> PVH: remove macro FEATURES_PVH and put PVH strings in the ELFNOTE line, because there's a null char before FEATURES_PVH and in the FEATURES_PVH strings since this is not C file

ping? Jan had a comment about it to keep the #ifdef at the top
and combine ascii and asiz?

http://lists.xen.org/archives/html/xen-devel/2012-11/msg00676.html

> 
> Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
> ---
>  arch/x86/xen/xen-head.S |   14 +++++---------
>  1 files changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
> index 1a6bca1..340fd4e 100644
> --- a/arch/x86/xen/xen-head.S
> +++ b/arch/x86/xen/xen-head.S
> @@ -13,14 +13,6 @@
>  #include <xen/interface/elfnote.h>
>  #include <asm/xen/interface.h>
>  
> -#ifdef CONFIG_XEN_X86_PVH
> -#define FEATURES_PVH "|writable_descriptor_tables" \
> -		     "|auto_translated_physmap" \
> -		     "|supervisor_mode_kernel" \
> -		     "|hvm_callback_vector"
> -#else
> -#define FEATURES_PVH /* Not supported */
> -#endif
>  
>  	__INIT
>  ENTRY(startup_xen)
> @@ -104,7 +96,11 @@ NEXT_HYPERCALL(arch_6)
>  #endif
>  	ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          _ASM_PTR startup_xen)
>  	ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _ASM_PTR hypercall_page)
> -	ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "!writable_page_tables|pae_pgdir_above_4gb"FEATURES_PVH)
> +#ifdef CONFIG_XEN_X86_PVH
> +        ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "!writable_page_tables|pae_pgdir_above_4gb|writable_descriptor_tables|auto_translated_physmap|supervisor_mode_kernel|hvm_callback_vector")
> +#else
> +        ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "!writable_page_tables|pae_pgdir_above_4gb")
> +#endif
>  	ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz "yes")
>  	ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz "generic")
>  	ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,
> -- 
> 1.7.2.3

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 19:54:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 19:54:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td4kt-0000a2-Ee; Mon, 26 Nov 2012 19:54:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1Td4kr-0000Zu-NX
	for Xen-devel@lists.xensource.com; Mon, 26 Nov 2012 19:54:09 +0000
Received: from [85.158.143.99:21153] by server-1.bemta-4.messagelabs.com id
	D2/3E-27934-1E8C3B05; Mon, 26 Nov 2012 19:54:09 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353959647!24423197!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NTMzMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8611 invoked from network); 26 Nov 2012 19:54:08 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 19:54:08 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQJs5qi022955
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 19:54:06 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQJs4jp025804
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 19:54:05 GMT
Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQJs4tq031786; Mon, 26 Nov 2012 13:54:04 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Mon, 26 Nov 2012 11:54:04 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id BD5ADE00B5D; Mon, 26 Nov 2012 14:54:00 -0500 (EST)
Date: Mon, 26 Nov 2012 14:54:00 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>
Message-ID: <20121126195400.GA8025@phenom.dumpdata.com>
References: <20121114181933.1ffb5f09@mantra.us.oracle.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121114181933.1ffb5f09@mantra.us.oracle.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH]:  PVH: remove FEATURES_PVH macro
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 14, 2012 at 06:19:33PM -0800, Mukesh Rathor wrote:
> PVH: remove macro FEATURES_PVH and put PVH strings in the ELFNOTE line, because there's a null char before FEATURES_PVH and in the FEATURES_PVH strings since this is not C file

ping? Jan had a comment about it to keep the #ifdef at the top
and combine ascii and asiz?

http://lists.xen.org/archives/html/xen-devel/2012-11/msg00676.html

> 
> Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
> ---
>  arch/x86/xen/xen-head.S |   14 +++++---------
>  1 files changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
> index 1a6bca1..340fd4e 100644
> --- a/arch/x86/xen/xen-head.S
> +++ b/arch/x86/xen/xen-head.S
> @@ -13,14 +13,6 @@
>  #include <xen/interface/elfnote.h>
>  #include <asm/xen/interface.h>
>  
> -#ifdef CONFIG_XEN_X86_PVH
> -#define FEATURES_PVH "|writable_descriptor_tables" \
> -		     "|auto_translated_physmap" \
> -		     "|supervisor_mode_kernel" \
> -		     "|hvm_callback_vector"
> -#else
> -#define FEATURES_PVH /* Not supported */
> -#endif
>  
>  	__INIT
>  ENTRY(startup_xen)
> @@ -104,7 +96,11 @@ NEXT_HYPERCALL(arch_6)
>  #endif
>  	ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          _ASM_PTR startup_xen)
>  	ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _ASM_PTR hypercall_page)
> -	ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "!writable_page_tables|pae_pgdir_above_4gb"FEATURES_PVH)
> +#ifdef CONFIG_XEN_X86_PVH
> +        ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "!writable_page_tables|pae_pgdir_above_4gb|writable_descriptor_tables|auto_translated_physmap|supervisor_mode_kernel|hvm_callback_vector")
> +#else
> +        ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "!writable_page_tables|pae_pgdir_above_4gb")
> +#endif
>  	ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz "yes")
>  	ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz "generic")
>  	ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,
> -- 
> 1.7.2.3

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 20:12:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 20:12:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td52K-0000xw-8b; Mon, 26 Nov 2012 20:12:12 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1Td52I-0000xr-T6
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 20:12:10 +0000
Received: from [193.109.254.147:29224] by server-6.bemta-14.messagelabs.com id
	27/49-02788-A1DC3B05; Mon, 26 Nov 2012 20:12:10 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1353960728!1744408!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21586 invoked from network); 26 Nov 2012 20:12:09 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-14.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 20:12:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,323,1352073600"; d="scan'208";a="215514827"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 20:12:07 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 15:12:06 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1Td52E-0000Gf-Ds;
	Mon, 26 Nov 2012 20:12:06 +0000
Date: Mon, 26 Nov 2012 20:12:04 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: George Dunlap <dunlapg@umich.edu>
In-Reply-To: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1211262011190.5310@kaball.uk.xensource.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="1342847746-1155614798-1353960724=:5310"
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--1342847746-1155614798-1353960724=:5310
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Mon, 26 Nov 2012, George Dunlap wrote:
> So while doing a bit of investigation into a request that we have instruc=
tions for how to sign a Xen binary, I came across a related pair of questio=
ns.=C2=A0 If we
> boot from a signed Xen binary, then:
> 1. Will Xen then successfully boot a signed dom0 kernel / initrd?
> 2. Will Xen fail to boot an unsigned dom0 kernel / initrd?
>=20
> I think if Xen is signed, then ideally we want both 1 and 2 to be true, r=
ight?=C2=A0

I think that you are right
--1342847746-1155614798-1353960724=:5310
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.xen.org
http://lists.xen.org/xen-devel

--1342847746-1155614798-1353960724=:5310--


From xen-devel-bounces@lists.xen.org Mon Nov 26 20:12:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 20:12:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td52K-0000xw-8b; Mon, 26 Nov 2012 20:12:12 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1Td52I-0000xr-T6
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 20:12:10 +0000
Received: from [193.109.254.147:29224] by server-6.bemta-14.messagelabs.com id
	27/49-02788-A1DC3B05; Mon, 26 Nov 2012 20:12:10 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1353960728!1744408!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODg1OTk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21586 invoked from network); 26 Nov 2012 20:12:09 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-14.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 20:12:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,323,1352073600"; d="scan'208";a="215514827"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 20:12:07 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Mon, 26 Nov 2012 15:12:06 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1Td52E-0000Gf-Ds;
	Mon, 26 Nov 2012 20:12:06 +0000
Date: Mon, 26 Nov 2012 20:12:04 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: George Dunlap <dunlapg@umich.edu>
In-Reply-To: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1211262011190.5310@kaball.uk.xensource.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="1342847746-1155614798-1353960724=:5310"
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--1342847746-1155614798-1353960724=:5310
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Mon, 26 Nov 2012, George Dunlap wrote:
> So while doing a bit of investigation into a request that we have instruc=
tions for how to sign a Xen binary, I came across a related pair of questio=
ns.=C2=A0 If we
> boot from a signed Xen binary, then:
> 1. Will Xen then successfully boot a signed dom0 kernel / initrd?
> 2. Will Xen fail to boot an unsigned dom0 kernel / initrd?
>=20
> I think if Xen is signed, then ideally we want both 1 and 2 to be true, r=
ight?=C2=A0

I think that you are right
--1342847746-1155614798-1353960724=:5310
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.xen.org
http://lists.xen.org/xen-devel

--1342847746-1155614798-1353960724=:5310--


From xen-devel-bounces@lists.xen.org Mon Nov 26 20:21:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 20:21:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td5Ax-0001Ai-9r; Mon, 26 Nov 2012 20:21:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td5Av-0001Ad-JD
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 20:21:05 +0000
Received: from [85.158.139.83:59565] by server-14.bemta-5.messagelabs.com id
	3E/8E-21768-03FC3B05; Mon, 26 Nov 2012 20:21:04 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1353961262!31719243!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NTMzMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18478 invoked from network); 26 Nov 2012 20:21:03 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-15.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 20:21:03 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQKKiiL018352
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 20:20:45 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQKKhJA012921
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 20:20:43 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQKKgrP025528; Mon, 26 Nov 2012 14:20:42 -0600
MIME-Version: 1.0
Message-ID: <672d364a-6d34-4c89-b0fb-5af989877117@default>
Date: Mon, 26 Nov 2012 12:20:40 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Sander Eikelenboom <linux@eikelenboom.it>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
	<cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
	<1545900898.20121126192533@eikelenboom.it>
In-Reply-To: <1545900898.20121126192533@eikelenboom.it>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: xen-devel@lists.xensource.com, Alexander Bienzeisler <chosi@amd.co.at>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

PiBGcm9tOiBTYW5kZXIgRWlrZWxlbmJvb20gW21haWx0bzpsaW51eEBlaWtlbGVuYm9vbS5pdF0K
PiBTdWJqZWN0OiBSZTogW1hlbi1kZXZlbF0gY2FuIG5vdCB1c2UgYWxsIGF2YWlsYWJsZSBtZW1v
cnkKPiAKPiBNb25kYXksIE5vdmVtYmVyIDI2LCAyMDEyLCA1OjU4OjI4IFBNLCB5b3Ugd3JvdGU6
Cj4gCj4gPj4gRnJvbTogSWFuIENhbXBiZWxsIFttYWlsdG86SWFuLkNhbXBiZWxsQGNpdHJpeC5j
b21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xsb29uIGRvbTAgZG93biB3aGljaCBmYWlsZWQuCgpIaSBTYW5kZXIgLS0KCkkgY291
bGQgYmUgd3JvbmcgKGFuZCBJIGFtIGNvbmZpZGVudCBzb21lb25lIHdpbGwgY29ycmVjdCBtZSBp
ZiBJIGFtKSBidXQKSSB0aGluayB0aGlzIGlzIGJlY2F1c2UgdGhlIENpdHJpeCBtZW1vcnkgbW9k
ZWwgYXNzdW1lcyB0aGVyZSBpcyBhbgppbmZlcmVuY2UtZHJpdmVuIHBvbGljeSBlbmdpbmUgZm9y
IGxvYWQtYmFsYW5jaW5nIG1lbW9yeSBhY3Jvc3MgY29tcGV0aW5nCnZpcnR1YWwgbWFjaGluZXMg
KCJzcXVlZXplZCIpLiAgSSBzdXNwZWN0IHNxdWVlemVkIHJldHVybnMgdW5hbGxvY2F0ZWQKeGVu
ICJmcmVlIiBtZW1vcnkgdG8gZG9tMC4KCklNSE8sIHN1Y2ggcG9saWN5IGVuZ2luZXMgYXJlIGdv
b2QgZm9yIGRlbW9zIGFuZCBzbyBzYWxlc3Blb3BsZSBjYW4Kc2F5ICJ5ZXMsIHRoaXMgcHJvZHVj
dCBzdXBwb3J0cyBtZW1vcnkgb3ZlcmNvbW1pdCIgYnV0IFRyYW5zY2VuZGVudApNZW1vcnkgZ29l
cyBxdWl0ZSBhIGJpdCBmdXJ0aGVyIChhbGJlaXQgbm90IGZvciBndWVzdHMgd2l0aCBwcm9wcmll
dGFyeQpPUydzKS4KCkRhbgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpo
dHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Mon Nov 26 20:21:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 20:21:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td5Ax-0001Ai-9r; Mon, 26 Nov 2012 20:21:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td5Av-0001Ad-JD
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 20:21:05 +0000
Received: from [85.158.139.83:59565] by server-14.bemta-5.messagelabs.com id
	3E/8E-21768-03FC3B05; Mon, 26 Nov 2012 20:21:04 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1353961262!31719243!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NTMzMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18478 invoked from network); 26 Nov 2012 20:21:03 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-15.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 20:21:03 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQKKiiL018352
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 20:20:45 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQKKhJA012921
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 20:20:43 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQKKgrP025528; Mon, 26 Nov 2012 14:20:42 -0600
MIME-Version: 1.0
Message-ID: <672d364a-6d34-4c89-b0fb-5af989877117@default>
Date: Mon, 26 Nov 2012 12:20:40 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Sander Eikelenboom <linux@eikelenboom.it>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
	<cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
	<1545900898.20121126192533@eikelenboom.it>
In-Reply-To: <1545900898.20121126192533@eikelenboom.it>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: xen-devel@lists.xensource.com, Alexander Bienzeisler <chosi@amd.co.at>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

PiBGcm9tOiBTYW5kZXIgRWlrZWxlbmJvb20gW21haWx0bzpsaW51eEBlaWtlbGVuYm9vbS5pdF0K
PiBTdWJqZWN0OiBSZTogW1hlbi1kZXZlbF0gY2FuIG5vdCB1c2UgYWxsIGF2YWlsYWJsZSBtZW1v
cnkKPiAKPiBNb25kYXksIE5vdmVtYmVyIDI2LCAyMDEyLCA1OjU4OjI4IFBNLCB5b3Ugd3JvdGU6
Cj4gCj4gPj4gRnJvbTogSWFuIENhbXBiZWxsIFttYWlsdG86SWFuLkNhbXBiZWxsQGNpdHJpeC5j
b21dCj4gPj4gU2VudDogRnJpZGF5LCBOb3ZlbWJlciAyMywgMjAxMiA2OjM0IEFNCj4gPj4gVG86
IFBhc2kgS8Okcmtrw6RpbmVuCj4gPj4gQ2M6IHhlbi1kZXZlbEBsaXN0cy54ZW5zb3VyY2UuY29t
OyBBbGV4YW5kZXIgQmllbnplaXNsZXIKPiA+PiBTdWJqZWN0OiBSZTogW1hlbi1kZXZlbF0gY2Fu
IG5vdCB1c2UgYWxsIGF2YWlsYWJsZSBtZW1vcnkKPiA+Pgo+ID4+IE9uIEZyaSwgMjAxMi0xMS0y
MyBhdCAxMzoyOSArMDAwMCwgUGFzaSBLw6Rya2vDpGluZW4gd3JvdGU6Cj4gPj4gPiBPbiBGcmks
IE5vdiAyMywgMjAxMiBhdCAwMToxNTo1M1BNICswMDAwLCBJYW4gQ2FtcGJlbGwgd3JvdGU6Cj4g
Pj4gPiA+IE9uIEZyaSwgMjAxMi0xMS0yMyBhdCAxMjo1NSArMDAwMCwgUGFzaSBLw6Rya2vDpGlu
ZW4gd3JvdGU6Cj4gPj4gPiA+Cj4gPj4gPiA+ID4gPiBUaGlzIGhhcyBiZWVuIGRpc2N1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b3J0cyBtZW1vcnkgb3ZlcmNvbW1pdCIgYnV0IFRyYW5zY2VuZGVudApNZW1vcnkgZ29l
cyBxdWl0ZSBhIGJpdCBmdXJ0aGVyIChhbGJlaXQgbm90IGZvciBndWVzdHMgd2l0aCBwcm9wcmll
dGFyeQpPUydzKS4KCkRhbgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpo
dHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Mon Nov 26 20:24:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 20:24:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td5E0-0001KZ-TS; Mon, 26 Nov 2012 20:24:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1Td5Dz-0001KS-F0
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 20:24:15 +0000
Received: from [85.158.139.211:22064] by server-12.bemta-5.messagelabs.com id
	46/A9-02886-EEFC3B05; Mon, 26 Nov 2012 20:24:14 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353961453!21714475!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDI3MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31496 invoked from network); 26 Nov 2012 20:24:14 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 20:24:14 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id EF8822946;
	Mon, 26 Nov 2012 22:24:11 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id D03A4EC027; Mon, 26 Nov 2012 22:24:11 +0200 (EET)
Date: Mon, 26 Nov 2012 22:24:11 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <20121126202411.GA8912@reaktio.net>
References: <1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
	<cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
	<1545900898.20121126192533@eikelenboom.it>
	<672d364a-6d34-4c89-b0fb-5af989877117@default>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <672d364a-6d34-4c89-b0fb-5af989877117@default>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: Sander Eikelenboom <linux@eikelenboom.it>, xen-devel@lists.xensource.com,
	Alexander Bienzeisler <chosi@amd.co.at>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 26, 2012 at 12:20:40PM -0800, Dan Magenheimer wrote:
> > From: Sander Eikelenboom [mailto:linux@eikelenboom.it]
> > Subject: Re: [Xen-devel] can not use all available memory
> > =

> > Monday, November 26, 2012, 5:58:28 PM, you wrote:
> > =

> > >> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> > >> Sent: Friday, November 23, 2012 6:34 AM
> > >> To: Pasi K=E4rkk=E4inen
> > >> Cc: xen-devel@lists.xensource.com; Alexander Bienzeisler
> > >> Subject: Re: [Xen-devel] can not use all available memory
> > >>
> > >> On Fri, 2012-11-23 at 13:29 +0000, Pasi K=E4rkk=E4inen wrote:
> > >> > On Fri, Nov 23, 2012 at 01:15:53PM +0000, Ian Campbell wrote:
> > >> > > On Fri, 2012-11-23 at 12:55 +0000, Pasi K=E4rkk=E4inen wrote:
> > >> > >
> > >> > > > > This has been discussed at length on the list before, please=
 check the
> > >> > > > > archives.
> > >> > > > >
> > >> > > >
> > >> > > > I tried googling quickly but I didn't find anything relevant..
> > >> > >
> > >> > > I found
> > >> > > http://web.archiveorange.com/archive/v/zCKz5T3PLvtyZDSPQc9i
> > >> > > in a matter of seconds, then:
> > >> > > http://lists.xen.org/archives/html/xen-devel/2011-11/msg01415.ht=
ml
> > >> > > http://lists.xen.org/archives/html/xen-users/2012-05/msg00139.ht=
ml
> > >> > > http://lists.xen.org/archives/html/xen-users/2012-05/msg00146.ht=
ml
> > >> > >
> > >> > > > To me this behaviour still seems wrong. What's the point of au=
toballoon=3D1 trying to
> > >> > > > balloon down dom0 if the hypervisor already has enough free me=
mory for the VM ?
> > >> > > >
> > >> > > > In this case:
> > >> > > >         - dom0_mem=3D2G
> > >> > > >         - new VM to launch with size 16 GB.
> > >> > > >         - Xen has 28 GB of free memory.
> > >> > > >
> > >> > > > So clearly there's no need to try to balloon down dom0..
> > >> > >
> > >> > > Right, so don't set autoballoon then.
> > >> > >
> > >> >
> > >> > It's enabled as a default.. so many people hit this problem.
> > >> >
> > >> >
> > >> > > > not-yet-implemented check/feature in xl, or a bug?
> > >> > >
> > >> > > Neither, it is the intended behaviour of xl autoballoon, this op=
tion
> > >> > > means exactly "take the required memory from dom0".
> > >> > >
> > >> >
> > >> > http://xenbits.xen.org/docs/4.2-testing/man/xl.conf.5.html
> > >> >
> > >> > "autoballoon=3DBOOLEAN
> > >> >
> > >> >     If disabled then xl will not attempt to reduce the amount of
> > >> > memory assigned to domain 0 in order to create free memory when
> > >> > starting a new domain. You should set this if you use the dom0_mem
> > >> > hypervisor command line to reduce the amount of memory given to do=
main
> > >> > 0 by default.
> > >> >
> > >> >     Default: 1"
> > >> >
> > >> >
> > >> > I think we should modify that to say "You should set autoballoon=
=3D0 if you use the dom0_mem
> > >> hypervisor command line .."
> > >> > At least I understood that text in the opposite way..
> > >>
> > >> Yes, there should be a s/set/unset/ in there I think.
> > >>
> > >> > Also: What happens if you have autoballoon=3D1 and you start some =
VMs, then stop the VMs,
> > >> > so most of the memory is now free in Xen..
> > >>
> > >> xl balloons dom0 back up when it destroy domains with autoballoon=3D=
1.
> > >>
> > >> > and then you try to start a big VM ?
> > >> > Aren't you going to hit the same problem as in this thread?
> > =

> > > Hmmm... this behavior and default may make sense for the Citrix
> > > memory model (single machine, dom0 is "the user" so you want it
> > > to always hold most of physical RAM not used by guests).  But
> > > probably not so for a more cloud-like memory model.
> > =

> > > Is there any (easy) way to force autoballoon=3D0 if the hypervisor
> > > dom0_mem boot option is specified?  Or is there some reasonably
> > > sane case I am missing where a user would want both dom0_mem
> > > and autoballoon=3D1?
> > =

> > > Oracle VM always boots servers with dom0_mem=3D set so (if/when
> > > OVM switches to use xl), OVM will always set autoballoon off.
> > > So it's the large number of non-Citrix-non-Oracle Xen-as-a-service
> > > providers I am trying to help here.
> > =

> > =

> > =

> > Hmm i was bitten by this 2 weeks ago, i found it a bit not intuitive th=
at:
> > - While the guest i was trying to start required less memory than was f=
reely available (according to
> > xentop) outside of dom0
> > - It would fail, because xl started to try to balloon dom0 down which f=
ailed.
> =

> Hi Sander --
> =

> I could be wrong (and I am confident someone will correct me if I am) but
> I think this is because the Citrix memory model assumes there is an
> inference-driven policy engine for load-balancing memory across competing
> virtual machines ("squeezed").  I suspect squeezed returns unallocated
> xen "free" memory to dom0.
> =

> IMHO, such policy engines are good for demos and so salespeople can
> say "yes, this product supports memory overcommit" but Transcendent
> Memory goes quite a bit further (albeit not for guests with proprietary
> OS's).
> =


Afaik XenServer/XCP and XenClient both use dom0_mem=3D option for Xen.

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 20:24:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 20:24:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td5E0-0001KZ-TS; Mon, 26 Nov 2012 20:24:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1Td5Dz-0001KS-F0
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 20:24:15 +0000
Received: from [85.158.139.211:22064] by server-12.bemta-5.messagelabs.com id
	46/A9-02886-EEFC3B05; Mon, 26 Nov 2012 20:24:14 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353961453!21714475!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDI3MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31496 invoked from network); 26 Nov 2012 20:24:14 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 20:24:14 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id EF8822946;
	Mon, 26 Nov 2012 22:24:11 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id D03A4EC027; Mon, 26 Nov 2012 22:24:11 +0200 (EET)
Date: Mon, 26 Nov 2012 22:24:11 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <20121126202411.GA8912@reaktio.net>
References: <1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
	<cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
	<1545900898.20121126192533@eikelenboom.it>
	<672d364a-6d34-4c89-b0fb-5af989877117@default>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <672d364a-6d34-4c89-b0fb-5af989877117@default>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: Sander Eikelenboom <linux@eikelenboom.it>, xen-devel@lists.xensource.com,
	Alexander Bienzeisler <chosi@amd.co.at>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 26, 2012 at 12:20:40PM -0800, Dan Magenheimer wrote:
> > From: Sander Eikelenboom [mailto:linux@eikelenboom.it]
> > Subject: Re: [Xen-devel] can not use all available memory
> > =

> > Monday, November 26, 2012, 5:58:28 PM, you wrote:
> > =

> > >> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> > >> Sent: Friday, November 23, 2012 6:34 AM
> > >> To: Pasi K=E4rkk=E4inen
> > >> Cc: xen-devel@lists.xensource.com; Alexander Bienzeisler
> > >> Subject: Re: [Xen-devel] can not use all available memory
> > >>
> > >> On Fri, 2012-11-23 at 13:29 +0000, Pasi K=E4rkk=E4inen wrote:
> > >> > On Fri, Nov 23, 2012 at 01:15:53PM +0000, Ian Campbell wrote:
> > >> > > On Fri, 2012-11-23 at 12:55 +0000, Pasi K=E4rkk=E4inen wrote:
> > >> > >
> > >> > > > > This has been discussed at length on the list before, please=
 check the
> > >> > > > > archives.
> > >> > > > >
> > >> > > >
> > >> > > > I tried googling quickly but I didn't find anything relevant..
> > >> > >
> > >> > > I found
> > >> > > http://web.archiveorange.com/archive/v/zCKz5T3PLvtyZDSPQc9i
> > >> > > in a matter of seconds, then:
> > >> > > http://lists.xen.org/archives/html/xen-devel/2011-11/msg01415.ht=
ml
> > >> > > http://lists.xen.org/archives/html/xen-users/2012-05/msg00139.ht=
ml
> > >> > > http://lists.xen.org/archives/html/xen-users/2012-05/msg00146.ht=
ml
> > >> > >
> > >> > > > To me this behaviour still seems wrong. What's the point of au=
toballoon=3D1 trying to
> > >> > > > balloon down dom0 if the hypervisor already has enough free me=
mory for the VM ?
> > >> > > >
> > >> > > > In this case:
> > >> > > >         - dom0_mem=3D2G
> > >> > > >         - new VM to launch with size 16 GB.
> > >> > > >         - Xen has 28 GB of free memory.
> > >> > > >
> > >> > > > So clearly there's no need to try to balloon down dom0..
> > >> > >
> > >> > > Right, so don't set autoballoon then.
> > >> > >
> > >> >
> > >> > It's enabled as a default.. so many people hit this problem.
> > >> >
> > >> >
> > >> > > > not-yet-implemented check/feature in xl, or a bug?
> > >> > >
> > >> > > Neither, it is the intended behaviour of xl autoballoon, this op=
tion
> > >> > > means exactly "take the required memory from dom0".
> > >> > >
> > >> >
> > >> > http://xenbits.xen.org/docs/4.2-testing/man/xl.conf.5.html
> > >> >
> > >> > "autoballoon=3DBOOLEAN
> > >> >
> > >> >     If disabled then xl will not attempt to reduce the amount of
> > >> > memory assigned to domain 0 in order to create free memory when
> > >> > starting a new domain. You should set this if you use the dom0_mem
> > >> > hypervisor command line to reduce the amount of memory given to do=
main
> > >> > 0 by default.
> > >> >
> > >> >     Default: 1"
> > >> >
> > >> >
> > >> > I think we should modify that to say "You should set autoballoon=
=3D0 if you use the dom0_mem
> > >> hypervisor command line .."
> > >> > At least I understood that text in the opposite way..
> > >>
> > >> Yes, there should be a s/set/unset/ in there I think.
> > >>
> > >> > Also: What happens if you have autoballoon=3D1 and you start some =
VMs, then stop the VMs,
> > >> > so most of the memory is now free in Xen..
> > >>
> > >> xl balloons dom0 back up when it destroy domains with autoballoon=3D=
1.
> > >>
> > >> > and then you try to start a big VM ?
> > >> > Aren't you going to hit the same problem as in this thread?
> > =

> > > Hmmm... this behavior and default may make sense for the Citrix
> > > memory model (single machine, dom0 is "the user" so you want it
> > > to always hold most of physical RAM not used by guests).  But
> > > probably not so for a more cloud-like memory model.
> > =

> > > Is there any (easy) way to force autoballoon=3D0 if the hypervisor
> > > dom0_mem boot option is specified?  Or is there some reasonably
> > > sane case I am missing where a user would want both dom0_mem
> > > and autoballoon=3D1?
> > =

> > > Oracle VM always boots servers with dom0_mem=3D set so (if/when
> > > OVM switches to use xl), OVM will always set autoballoon off.
> > > So it's the large number of non-Citrix-non-Oracle Xen-as-a-service
> > > providers I am trying to help here.
> > =

> > =

> > =

> > Hmm i was bitten by this 2 weeks ago, i found it a bit not intuitive th=
at:
> > - While the guest i was trying to start required less memory than was f=
reely available (according to
> > xentop) outside of dom0
> > - It would fail, because xl started to try to balloon dom0 down which f=
ailed.
> =

> Hi Sander --
> =

> I could be wrong (and I am confident someone will correct me if I am) but
> I think this is because the Citrix memory model assumes there is an
> inference-driven policy engine for load-balancing memory across competing
> virtual machines ("squeezed").  I suspect squeezed returns unallocated
> xen "free" memory to dom0.
> =

> IMHO, such policy engines are good for demos and so salespeople can
> say "yes, this product supports memory overcommit" but Transcendent
> Memory goes quite a bit further (albeit not for guests with proprietary
> OS's).
> =


Afaik XenServer/XCP and XenClient both use dom0_mem=3D option for Xen.

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 20:36:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 20:36:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td5PL-0001an-5c; Mon, 26 Nov 2012 20:35:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1Td5PK-0001ai-24
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 20:35:58 +0000
Received: from [85.158.139.211:50537] by server-12.bemta-5.messagelabs.com id
	AF/72-02886-DA2D3B05; Mon, 26 Nov 2012 20:35:57 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353962155!21678362!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13764 invoked from network); 26 Nov 2012 20:35:56 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2012 20:35:56 -0000
Received: from 136-70-ftth.on.nl ([88.159.70.136]:54640 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1Td5Sb-0000qm-HN; Mon, 26 Nov 2012 21:39:21 +0100
Date: Mon, 26 Nov 2012 21:35:50 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <1172801797.20121126213550@eikelenboom.it>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
In-Reply-To: <672d364a-6d34-4c89-b0fb-5af989877117@default>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
	<cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
	<1545900898.20121126192533@eikelenboom.it>
	<672d364a-6d34-4c89-b0fb-5af989877117@default>
MIME-Version: 1.0
Cc: xen-devel@lists.xensource.com, Alexander Bienzeisler <chosi@amd.co.at>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

DQpNb25kYXksIE5vdmVtYmVyIDI2LCAyMDEyLCA5OjIwOjQwIFBNLCB5b3Ugd3JvdGU6Cgo+PiBG
cm9tOiBTYW5kZXIgRWlrZWxlbmJvb20gW21haWx0bzpsaW51eEBlaWtlbGVuYm9vbS5pdF0KPj4g
U3ViamVjdDogUmU6IFtYZW4tZGV2ZWxdIGNhbiBub3QgdXNlIGFsbCBhdmFpbGFibGUgbWVtb3J5
Cj4+IAo+PiBNb25kYXksIE5vdmVtYmVyIDI2LCAyMDEyLCA1OjU4OjI4IFBNLCB5b3Ugd3JvdGU6
Cj4+IAo+PiA+PiBGcm9tOiBJYW4gQ2FtcGJlbGwgW21haWx0bzpJYW4uQ2FtcGJlbGxAY2l0cml4
LmNvbV0KPj4gPj4gU2VudDogRnJpZGF5LCBOb3ZlbWJlciAyMywgMjAxMiA2OjM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
biBvdmVyY29tbWl0aW5nIG1lbW9yeSBhbmQgImhvcGUgZm9yIHRoZSBiZXN0IiBhbGwgdGhlIGFs
Z29yaXRobXMgaW52b2x2ZWQgY2FuIG1hbmFnZSBpdC4KSSBsaWtlIHRoaW5ncyB0byBwcmVkaWN0
YWJseSBmYWlsIChhbmQgZmFpbCBkaXJlY3QgaWYgcG9zc2libGUpLCBzbyBnb29kIG1lYXN1cmVz
IGNhbiBiZSB0YWtlbi4gQSBiaXQgb2xkLWZhc2hpb25lZCBwZXJoYXBzLgoKLS0KU2FuZGVyCgoK
CgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRl
dmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVu
Lm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Mon Nov 26 20:36:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 20:36:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td5PL-0001an-5c; Mon, 26 Nov 2012 20:35:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <linux@eikelenboom.it>) id 1Td5PK-0001ai-24
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 20:35:58 +0000
Received: from [85.158.139.211:50537] by server-12.bemta-5.messagelabs.com id
	AF/72-02886-DA2D3B05; Mon, 26 Nov 2012 20:35:57 +0000
X-Env-Sender: linux@eikelenboom.it
X-Msg-Ref: server-6.tower-206.messagelabs.com!1353962155!21678362!1
X-Originating-IP: [188.40.164.121]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13764 invoked from network); 26 Nov 2012 20:35:56 -0000
Received: from static.121.164.40.188.clients.your-server.de (HELO
	smtp.eikelenboom.it) (188.40.164.121)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2012 20:35:56 -0000
Received: from 136-70-ftth.on.nl ([88.159.70.136]:54640 helo=[172.16.1.20])
	by smtp.eikelenboom.it with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <linux@eikelenboom.it>)
	id 1Td5Sb-0000qm-HN; Mon, 26 Nov 2012 21:39:21 +0100
Date: Mon, 26 Nov 2012 21:35:50 +0100
From: Sander Eikelenboom <linux@eikelenboom.it>
Organization: Eikelenboom IT services
X-Priority: 3 (Normal)
Message-ID: <1172801797.20121126213550@eikelenboom.it>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
In-Reply-To: <672d364a-6d34-4c89-b0fb-5af989877117@default>
References: <50AF5F7E.8030907@amd.co.at>
	<1353673292.13542.238.camel@zakaz.uk.xensource.com>
	<20121123122800.GV8912@reaktio.net>
	<1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
	<cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
	<1545900898.20121126192533@eikelenboom.it>
	<672d364a-6d34-4c89-b0fb-5af989877117@default>
MIME-Version: 1.0
Cc: xen-devel@lists.xensource.com, Alexander Bienzeisler <chosi@amd.co.at>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

DQpNb25kYXksIE5vdmVtYmVyIDI2LCAyMDEyLCA5OjIwOjQwIFBNLCB5b3Ugd3JvdGU6Cgo+PiBG
cm9tOiBTYW5kZXIgRWlrZWxlbmJvb20gW21haWx0bzpsaW51eEBlaWtlbGVuYm9vbS5pdF0KPj4g
U3ViamVjdDogUmU6IFtYZW4tZGV2ZWxdIGNhbiBub3QgdXNlIGFsbCBhdmFpbGFibGUgbWVtb3J5
Cj4+IAo+PiBNb25kYXksIE5vdmVtYmVyIDI2LCAyMDEyLCA1OjU4OjI4IFBNLCB5b3Ugd3JvdGU6
Cj4+IAo+PiA+PiBGcm9tOiBJYW4gQ2FtcGJlbGwgW21haWx0bzpJYW4uQ2FtcGJlbGxAY2l0cml4
LmNvbV0KPj4gPj4gU2VudDogRnJpZGF5LCBOb3ZlbWJlciAyMywgMjAxMiA2OjM0IEFNCj4+ID4+
IFRvOiBQYXNpIEvDpHJra8OkaW5lbgo+PiA+PiBDYzogeGVuLWRldmVsQGxpc3RzLnhlbnNvdXJj
ZS5jb207IEFsZXhhbmRlciBCaWVuemVpc2xlcgo+PiA+PiBTdWJqZWN0OiBSZTogW1hlbi1kZXZl
bF0gY2FuIG5vdCB1c2UgYWxsIGF2YWlsYWJsZSBtZW1vcnkKPj4gPj4KPj4gPj4gT24gRnJpLCAy
MDEyLTExLTIzIGF0IDEzOjI5ICswMDAwLCB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XJoYXBzLgoKLS0KU2FuZGVyCgoK
CgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRl
dmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVu
Lm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Mon Nov 26 20:38:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 20:38:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td5RB-0001hO-Rv; Mon, 26 Nov 2012 20:37:53 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td5RA-0001hH-0r
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 20:37:52 +0000
Received: from [85.158.139.211:9502] by server-14.bemta-5.messagelabs.com id
	90/7B-21768-F13D3B05; Mon, 26 Nov 2012 20:37:51 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353962269!21598955!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NTMzMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22772 invoked from network); 26 Nov 2012 20:37:50 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-12.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 20:37:50 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQKbWwD003817
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 20:37:33 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQKbWPL009117
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 20:37:32 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQKbV3V030570; Mon, 26 Nov 2012 14:37:31 -0600
MIME-Version: 1.0
Message-ID: <b7ad6baf-e085-4ef7-860e-f9755b756339@default>
Date: Mon, 26 Nov 2012 12:37:29 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: =?iso-8859-1?B?UGFzaSBL5HJra+RpbmVu?= <pasik@iki.fi>
References: <1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
	<cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
	<1545900898.20121126192533@eikelenboom.it>
	<672d364a-6d34-4c89-b0fb-5af989877117@default>
	<20121126202411.GA8912@reaktio.net>
In-Reply-To: <20121126202411.GA8912@reaktio.net>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Sander Eikelenboom <linux@eikelenboom.it>, xen-devel@lists.xensource.com,
	Alexander Bienzeisler <chosi@amd.co.at>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Pasi K=E4rkk=E4inen [mailto:pasik@iki.fi]
> Subject: Re: [Xen-devel] can not use all available memory
> =

> On Mon, Nov 26, 2012 at 12:20:40PM -0800, Dan Magenheimer wrote:
> > > From: Sander Eikelenboom [mailto:linux@eikelenboom.it]
> > > Subject: Re: [Xen-devel] can not use all available memory
> > >
> > > Monday, November 26, 2012, 5:58:28 PM, you wrote:
> > >
> > > >> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> > > >> Sent: Friday, November 23, 2012 6:34 AM
> > > >> To: Pasi K=E4rkk=E4inen
> > > >> Cc: xen-devel@lists.xensource.com; Alexander Bienzeisler
> > > >> Subject: Re: [Xen-devel] can not use all available memory
> > > >>
> > > >> On Fri, 2012-11-23 at 13:29 +0000, Pasi K=E4rkk=E4inen wrote:
> > > >> > On Fri, Nov 23, 2012 at 01:15:53PM +0000, Ian Campbell wrote:
> > > >> > > On Fri, 2012-11-23 at 12:55 +0000, Pasi K=E4rkk=E4inen wrote:
> > > >> > >
> > > >> > > > > This has been discussed at length on the list before, plea=
se check the
> > > >> > > > > archives.
> > > >> > > > >
> > > >> > > >
> > > >> > > > I tried googling quickly but I didn't find anything relevant=
..
> > > >> > >
> > > >> > > I found
> > > >> > > http://web.archiveorange.com/archive/v/zCKz5T3PLvtyZDSPQc9i
> > > >> > > in a matter of seconds, then:
> > > >> > > http://lists.xen.org/archives/html/xen-devel/2011-11/msg01415.=
html
> > > >> > > http://lists.xen.org/archives/html/xen-users/2012-05/msg00139.=
html
> > > >> > > http://lists.xen.org/archives/html/xen-users/2012-05/msg00146.=
html
> > > >> > >
> > > >> > > > To me this behaviour still seems wrong. What's the point of =
autoballoon=3D1 trying to
> > > >> > > > balloon down dom0 if the hypervisor already has enough free =
memory for the VM ?
> > > >> > > >
> > > >> > > > In this case:
> > > >> > > >         - dom0_mem=3D2G
> > > >> > > >         - new VM to launch with size 16 GB.
> > > >> > > >         - Xen has 28 GB of free memory.
> > > >> > > >
> > > >> > > > So clearly there's no need to try to balloon down dom0..
> > > >> > >
> > > >> > > Right, so don't set autoballoon then.
> > > >> > >
> > > >> >
> > > >> > It's enabled as a default.. so many people hit this problem.
> > > >> >
> > > >> >
> > > >> > > > not-yet-implemented check/feature in xl, or a bug?
> > > >> > >
> > > >> > > Neither, it is the intended behaviour of xl autoballoon, this =
option
> > > >> > > means exactly "take the required memory from dom0".
> > > >> > >
> > > >> >
> > > >> > http://xenbits.xen.org/docs/4.2-testing/man/xl.conf.5.html
> > > >> >
> > > >> > "autoballoon=3DBOOLEAN
> > > >> >
> > > >> >     If disabled then xl will not attempt to reduce the amount of
> > > >> > memory assigned to domain 0 in order to create free memory when
> > > >> > starting a new domain. You should set this if you use the dom0_m=
em
> > > >> > hypervisor command line to reduce the amount of memory given to =
domain
> > > >> > 0 by default.
> > > >> >
> > > >> >     Default: 1"
> > > >> >
> > > >> >
> > > >> > I think we should modify that to say "You should set autoballoon=
=3D0 if you use the dom0_mem
> > > >> hypervisor command line .."
> > > >> > At least I understood that text in the opposite way..
> > > >>
> > > >> Yes, there should be a s/set/unset/ in there I think.
> > > >>
> > > >> > Also: What happens if you have autoballoon=3D1 and you start som=
e VMs, then stop the VMs,
> > > >> > so most of the memory is now free in Xen..
> > > >>
> > > >> xl balloons dom0 back up when it destroy domains with autoballoon=
=3D1.
> > > >>
> > > >> > and then you try to start a big VM ?
> > > >> > Aren't you going to hit the same problem as in this thread?
> > >
> > > > Hmmm... this behavior and default may make sense for the Citrix
> > > > memory model (single machine, dom0 is "the user" so you want it
> > > > to always hold most of physical RAM not used by guests).  But
> > > > probably not so for a more cloud-like memory model.
> > >
> > > > Is there any (easy) way to force autoballoon=3D0 if the hypervisor
> > > > dom0_mem boot option is specified?  Or is there some reasonably
> > > > sane case I am missing where a user would want both dom0_mem
> > > > and autoballoon=3D1?
> > >
> > > > Oracle VM always boots servers with dom0_mem=3D set so (if/when
> > > > OVM switches to use xl), OVM will always set autoballoon off.
> > > > So it's the large number of non-Citrix-non-Oracle Xen-as-a-service
> > > > providers I am trying to help here.
> > >
> > >
> > >
> > > Hmm i was bitten by this 2 weeks ago, i found it a bit not intuitive =
that:
> > > - While the guest i was trying to start required less memory than was=
 freely available (according
> to
> > > xentop) outside of dom0
> > > - It would fail, because xl started to try to balloon dom0 down which=
 failed.
> >
> > Hi Sander --
> >
> > I could be wrong (and I am confident someone will correct me if I am) b=
ut
> > I think this is because the Citrix memory model assumes there is an
> > inference-driven policy engine for load-balancing memory across competi=
ng
> > virtual machines ("squeezed").  I suspect squeezed returns unallocated
> > xen "free" memory to dom0.

I forgot... it is called Dynamic Memory Control (DMC), not squeezed
in the XenServer product.

> > IMHO, such policy engines are good for demos and so salespeople can
> > say "yes, this product supports memory overcommit" but Transcendent
> > Memory goes quite a bit further (albeit not for guests with proprietary
> > OS's).
> =

> Afaik XenServer/XCP and XenClient both use dom0_mem=3D option for Xen.

Hmmm... looks like you are right.

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 20:38:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 20:38:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td5RB-0001hO-Rv; Mon, 26 Nov 2012 20:37:53 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td5RA-0001hH-0r
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 20:37:52 +0000
Received: from [85.158.139.211:9502] by server-14.bemta-5.messagelabs.com id
	90/7B-21768-F13D3B05; Mon, 26 Nov 2012 20:37:51 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1353962269!21598955!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NTMzMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22772 invoked from network); 26 Nov 2012 20:37:50 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-12.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 20:37:50 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQKbWwD003817
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 20:37:33 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQKbWPL009117
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 20:37:32 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQKbV3V030570; Mon, 26 Nov 2012 14:37:31 -0600
MIME-Version: 1.0
Message-ID: <b7ad6baf-e085-4ef7-860e-f9755b756339@default>
Date: Mon, 26 Nov 2012 12:37:29 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: =?iso-8859-1?B?UGFzaSBL5HJra+RpbmVu?= <pasik@iki.fi>
References: <1353674039.16973.3.camel@zakaz.uk.xensource.com>
	<20121123124115.GW8912@reaktio.net>
	<1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
	<cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
	<1545900898.20121126192533@eikelenboom.it>
	<672d364a-6d34-4c89-b0fb-5af989877117@default>
	<20121126202411.GA8912@reaktio.net>
In-Reply-To: <20121126202411.GA8912@reaktio.net>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Sander Eikelenboom <linux@eikelenboom.it>, xen-devel@lists.xensource.com,
	Alexander Bienzeisler <chosi@amd.co.at>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Pasi K=E4rkk=E4inen [mailto:pasik@iki.fi]
> Subject: Re: [Xen-devel] can not use all available memory
> =

> On Mon, Nov 26, 2012 at 12:20:40PM -0800, Dan Magenheimer wrote:
> > > From: Sander Eikelenboom [mailto:linux@eikelenboom.it]
> > > Subject: Re: [Xen-devel] can not use all available memory
> > >
> > > Monday, November 26, 2012, 5:58:28 PM, you wrote:
> > >
> > > >> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> > > >> Sent: Friday, November 23, 2012 6:34 AM
> > > >> To: Pasi K=E4rkk=E4inen
> > > >> Cc: xen-devel@lists.xensource.com; Alexander Bienzeisler
> > > >> Subject: Re: [Xen-devel] can not use all available memory
> > > >>
> > > >> On Fri, 2012-11-23 at 13:29 +0000, Pasi K=E4rkk=E4inen wrote:
> > > >> > On Fri, Nov 23, 2012 at 01:15:53PM +0000, Ian Campbell wrote:
> > > >> > > On Fri, 2012-11-23 at 12:55 +0000, Pasi K=E4rkk=E4inen wrote:
> > > >> > >
> > > >> > > > > This has been discussed at length on the list before, plea=
se check the
> > > >> > > > > archives.
> > > >> > > > >
> > > >> > > >
> > > >> > > > I tried googling quickly but I didn't find anything relevant=
..
> > > >> > >
> > > >> > > I found
> > > >> > > http://web.archiveorange.com/archive/v/zCKz5T3PLvtyZDSPQc9i
> > > >> > > in a matter of seconds, then:
> > > >> > > http://lists.xen.org/archives/html/xen-devel/2011-11/msg01415.=
html
> > > >> > > http://lists.xen.org/archives/html/xen-users/2012-05/msg00139.=
html
> > > >> > > http://lists.xen.org/archives/html/xen-users/2012-05/msg00146.=
html
> > > >> > >
> > > >> > > > To me this behaviour still seems wrong. What's the point of =
autoballoon=3D1 trying to
> > > >> > > > balloon down dom0 if the hypervisor already has enough free =
memory for the VM ?
> > > >> > > >
> > > >> > > > In this case:
> > > >> > > >         - dom0_mem=3D2G
> > > >> > > >         - new VM to launch with size 16 GB.
> > > >> > > >         - Xen has 28 GB of free memory.
> > > >> > > >
> > > >> > > > So clearly there's no need to try to balloon down dom0..
> > > >> > >
> > > >> > > Right, so don't set autoballoon then.
> > > >> > >
> > > >> >
> > > >> > It's enabled as a default.. so many people hit this problem.
> > > >> >
> > > >> >
> > > >> > > > not-yet-implemented check/feature in xl, or a bug?
> > > >> > >
> > > >> > > Neither, it is the intended behaviour of xl autoballoon, this =
option
> > > >> > > means exactly "take the required memory from dom0".
> > > >> > >
> > > >> >
> > > >> > http://xenbits.xen.org/docs/4.2-testing/man/xl.conf.5.html
> > > >> >
> > > >> > "autoballoon=3DBOOLEAN
> > > >> >
> > > >> >     If disabled then xl will not attempt to reduce the amount of
> > > >> > memory assigned to domain 0 in order to create free memory when
> > > >> > starting a new domain. You should set this if you use the dom0_m=
em
> > > >> > hypervisor command line to reduce the amount of memory given to =
domain
> > > >> > 0 by default.
> > > >> >
> > > >> >     Default: 1"
> > > >> >
> > > >> >
> > > >> > I think we should modify that to say "You should set autoballoon=
=3D0 if you use the dom0_mem
> > > >> hypervisor command line .."
> > > >> > At least I understood that text in the opposite way..
> > > >>
> > > >> Yes, there should be a s/set/unset/ in there I think.
> > > >>
> > > >> > Also: What happens if you have autoballoon=3D1 and you start som=
e VMs, then stop the VMs,
> > > >> > so most of the memory is now free in Xen..
> > > >>
> > > >> xl balloons dom0 back up when it destroy domains with autoballoon=
=3D1.
> > > >>
> > > >> > and then you try to start a big VM ?
> > > >> > Aren't you going to hit the same problem as in this thread?
> > >
> > > > Hmmm... this behavior and default may make sense for the Citrix
> > > > memory model (single machine, dom0 is "the user" so you want it
> > > > to always hold most of physical RAM not used by guests).  But
> > > > probably not so for a more cloud-like memory model.
> > >
> > > > Is there any (easy) way to force autoballoon=3D0 if the hypervisor
> > > > dom0_mem boot option is specified?  Or is there some reasonably
> > > > sane case I am missing where a user would want both dom0_mem
> > > > and autoballoon=3D1?
> > >
> > > > Oracle VM always boots servers with dom0_mem=3D set so (if/when
> > > > OVM switches to use xl), OVM will always set autoballoon off.
> > > > So it's the large number of non-Citrix-non-Oracle Xen-as-a-service
> > > > providers I am trying to help here.
> > >
> > >
> > >
> > > Hmm i was bitten by this 2 weeks ago, i found it a bit not intuitive =
that:
> > > - While the guest i was trying to start required less memory than was=
 freely available (according
> to
> > > xentop) outside of dom0
> > > - It would fail, because xl started to try to balloon dom0 down which=
 failed.
> >
> > Hi Sander --
> >
> > I could be wrong (and I am confident someone will correct me if I am) b=
ut
> > I think this is because the Citrix memory model assumes there is an
> > inference-driven policy engine for load-balancing memory across competi=
ng
> > virtual machines ("squeezed").  I suspect squeezed returns unallocated
> > xen "free" memory to dom0.

I forgot... it is called Dynamic Memory Control (DMC), not squeezed
in the XenServer product.

> > IMHO, such policy engines are good for demos and so salespeople can
> > say "yes, this product supports memory overcommit" but Transcendent
> > Memory goes quite a bit further (albeit not for guests with proprietary
> > OS's).
> =

> Afaik XenServer/XCP and XenClient both use dom0_mem=3D option for Xen.

Hmmm... looks like you are right.

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 21:33:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 21:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td6If-0002Ox-EC; Mon, 26 Nov 2012 21:33:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Td6Id-0002Oq-7b
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 21:33:07 +0000
Received: from [85.158.137.99:38062] by server-16.bemta-3.messagelabs.com id
	6D/4F-07461-210E3B05; Mon, 26 Nov 2012 21:33:06 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-3.tower-217.messagelabs.com!1353965585!15630852!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7041 invoked from network); 26 Nov 2012 21:33:06 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-3.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 21:33:06 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Td6IL-000Bcj-Qs; Mon, 26 Nov 2012 21:32:49 +0000
Date: Mon, 26 Nov 2012 21:32:49 +0000
From: Tim Deegan <tim@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <20121126213249.GA37842@ocelot.phlegethon.org>
References: <1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
	<cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
	<1545900898.20121126192533@eikelenboom.it>
	<672d364a-6d34-4c89-b0fb-5af989877117@default>
	<20121126202411.GA8912@reaktio.net>
	<b7ad6baf-e085-4ef7-860e-f9755b756339@default>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <b7ad6baf-e085-4ef7-860e-f9755b756339@default>
User-Agent: Mutt/1.4.2.1i
Cc: Sander Eikelenboom <linux@eikelenboom.it>, xen-devel@lists.xensource.com,
	Alexander Bienzeisler <chosi@amd.co.at>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 12:37 -0800 on 26 Nov (1353933449), Dan Magenheimer wrote:
> > > I could be wrong (and I am confident someone will correct me if I am) but
> > > I think this is because the Citrix memory model assumes there is an
> > > inference-driven policy engine for load-balancing memory across competing
> > > virtual machines ("squeezed").  I suspect squeezed returns unallocated
> > > xen "free" memory to dom0.
> 
> I forgot... it is called Dynamic Memory Control (DMC), not squeezed
> in the XenServer product.

AFAIK XenServer uses dom0_mem= and doesn't balloon com0 after boot time.
The idea of ballooning all free memory into dom0 is a xl-ism, inherited
from xend, and not really a "Citrix" one.  It's useful if you've
installed xen on a machine where dom0 is otherwise your main OS, but not
particularly for a dedicated platform.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 21:33:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 21:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td6If-0002Ox-EC; Mon, 26 Nov 2012 21:33:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Td6Id-0002Oq-7b
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 21:33:07 +0000
Received: from [85.158.137.99:38062] by server-16.bemta-3.messagelabs.com id
	6D/4F-07461-210E3B05; Mon, 26 Nov 2012 21:33:06 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-3.tower-217.messagelabs.com!1353965585!15630852!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7041 invoked from network); 26 Nov 2012 21:33:06 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-3.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 21:33:06 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Td6IL-000Bcj-Qs; Mon, 26 Nov 2012 21:32:49 +0000
Date: Mon, 26 Nov 2012 21:32:49 +0000
From: Tim Deegan <tim@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <20121126213249.GA37842@ocelot.phlegethon.org>
References: <1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
	<cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
	<1545900898.20121126192533@eikelenboom.it>
	<672d364a-6d34-4c89-b0fb-5af989877117@default>
	<20121126202411.GA8912@reaktio.net>
	<b7ad6baf-e085-4ef7-860e-f9755b756339@default>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <b7ad6baf-e085-4ef7-860e-f9755b756339@default>
User-Agent: Mutt/1.4.2.1i
Cc: Sander Eikelenboom <linux@eikelenboom.it>, xen-devel@lists.xensource.com,
	Alexander Bienzeisler <chosi@amd.co.at>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 12:37 -0800 on 26 Nov (1353933449), Dan Magenheimer wrote:
> > > I could be wrong (and I am confident someone will correct me if I am) but
> > > I think this is because the Citrix memory model assumes there is an
> > > inference-driven policy engine for load-balancing memory across competing
> > > virtual machines ("squeezed").  I suspect squeezed returns unallocated
> > > xen "free" memory to dom0.
> 
> I forgot... it is called Dynamic Memory Control (DMC), not squeezed
> in the XenServer product.

AFAIK XenServer uses dom0_mem= and doesn't balloon com0 after boot time.
The idea of ballooning all free memory into dom0 is a xl-ism, inherited
from xend, and not really a "Citrix" one.  It's useful if you've
installed xen on a machine where dom0 is otherwise your main OS, but not
particularly for a dedicated platform.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 21:42:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 21:42:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td6RW-0002hm-Fg; Mon, 26 Nov 2012 21:42:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1Td6RV-0002hh-Ac
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 21:42:17 +0000
Received: from [85.158.143.35:22464] by server-3.bemta-4.messagelabs.com id
	AF/FD-06841-832E3B05; Mon, 26 Nov 2012 21:42:16 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1353966135!12872242!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 828 invoked from network); 26 Nov 2012 21:42:15 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-8.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 21:42:15 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id AF3018406F;
	Mon, 26 Nov 2012 22:42:14 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id zgyIDk0X7ZRX; Mon, 26 Nov 2012 22:42:14 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id 4E5A084067;
	Mon, 26 Nov 2012 22:42:14 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1Td6RQ-0003tz-DE; Mon, 26 Nov 2012 22:42:12 +0100
Date: Mon, 26 Nov 2012 22:42:12 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121126214212.GL7556@type.youpi.perso.aquilenet.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xen.org,
	Keir Fraser <keir@xen.org>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
	<29138c27eb72e5602751.1353947050@andrewcoop.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <29138c27eb72e5602751.1353947050@andrewcoop.uk.xensource.com>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Keir Fraser <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 2 of 4] minios/console: console_input() weak
 reference
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Andrew Cooper, le Mon 26 Nov 2012 16:24:10 +0000, a =E9crit :
> In exactly the same style as app_main() in kernel.c, create a weak
> reference console_input() function for applications to override to
> quickly gain access to the console.
> =

> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> diff -r 505992114832 -r 29138c27eb72 extras/mini-os/console/console.c
> --- a/extras/mini-os/console/console.c
> +++ b/extras/mini-os/console/console.c
> @@ -54,9 +54,7 @@
>     NOTE: you need to enable verbose in xen/Rules.mk for it to work. */
>  static int console_initialised =3D 0;
>  =

> -
> -#ifndef HAVE_LIBC
> -void xencons_rx(char *buf, unsigned len, struct pt_regs *regs)
> +__attribute__((weak)) void console_input(char * buf, unsigned len)
>  {
>      if(len > 0)
>      {
> @@ -69,6 +67,12 @@ void xencons_rx(char *buf, unsigned len,
>      }
>  }
>  =

> +#ifndef HAVE_LIBC
> +void xencons_rx(char *buf, unsigned len, struct pt_regs *regs)
> +{
> +    console_input(buf, len);
> +}
> +
>  void xencons_tx(void)
>  {
>      /* Do nothing, handled by _rx */
> =

> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> =


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 21:42:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 21:42:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td6RW-0002hm-Fg; Mon, 26 Nov 2012 21:42:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1Td6RV-0002hh-Ac
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 21:42:17 +0000
Received: from [85.158.143.35:22464] by server-3.bemta-4.messagelabs.com id
	AF/FD-06841-832E3B05; Mon, 26 Nov 2012 21:42:16 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1353966135!12872242!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 828 invoked from network); 26 Nov 2012 21:42:15 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-8.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 21:42:15 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id AF3018406F;
	Mon, 26 Nov 2012 22:42:14 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id zgyIDk0X7ZRX; Mon, 26 Nov 2012 22:42:14 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id 4E5A084067;
	Mon, 26 Nov 2012 22:42:14 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1Td6RQ-0003tz-DE; Mon, 26 Nov 2012 22:42:12 +0100
Date: Mon, 26 Nov 2012 22:42:12 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121126214212.GL7556@type.youpi.perso.aquilenet.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xen.org,
	Keir Fraser <keir@xen.org>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
	<29138c27eb72e5602751.1353947050@andrewcoop.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <29138c27eb72e5602751.1353947050@andrewcoop.uk.xensource.com>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Keir Fraser <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 2 of 4] minios/console: console_input() weak
 reference
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Andrew Cooper, le Mon 26 Nov 2012 16:24:10 +0000, a =E9crit :
> In exactly the same style as app_main() in kernel.c, create a weak
> reference console_input() function for applications to override to
> quickly gain access to the console.
> =

> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> diff -r 505992114832 -r 29138c27eb72 extras/mini-os/console/console.c
> --- a/extras/mini-os/console/console.c
> +++ b/extras/mini-os/console/console.c
> @@ -54,9 +54,7 @@
>     NOTE: you need to enable verbose in xen/Rules.mk for it to work. */
>  static int console_initialised =3D 0;
>  =

> -
> -#ifndef HAVE_LIBC
> -void xencons_rx(char *buf, unsigned len, struct pt_regs *regs)
> +__attribute__((weak)) void console_input(char * buf, unsigned len)
>  {
>      if(len > 0)
>      {
> @@ -69,6 +67,12 @@ void xencons_rx(char *buf, unsigned len,
>      }
>  }
>  =

> +#ifndef HAVE_LIBC
> +void xencons_rx(char *buf, unsigned len, struct pt_regs *regs)
> +{
> +    console_input(buf, len);
> +}
> +
>  void xencons_tx(void)
>  {
>      /* Do nothing, handled by _rx */
> =

> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> =


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 21:46:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 21:46:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td6Vh-0002oe-7W; Mon, 26 Nov 2012 21:46:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <alan@lxorguk.ukuu.org.uk>) id 1Td6Vg-0002oZ-1T
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 21:46:36 +0000
Received: from [85.158.143.35:4400] by server-2.bemta-4.messagelabs.com id
	30/6E-28922-B33E3B05; Mon, 26 Nov 2012 21:46:35 +0000
X-Env-Sender: alan@lxorguk.ukuu.org.uk
X-Msg-Ref: server-4.tower-21.messagelabs.com!1353966348!5636114!1
X-Originating-IP: [81.2.110.251]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21171 invoked from network); 26 Nov 2012 21:45:49 -0000
Received: from lxorguk.ukuu.org.uk (HELO lxorguk.ukuu.org.uk) (81.2.110.251)
	by server-4.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 21:45:49 -0000
Received: from pyramind.ukuu.org.uk (earthlight.etchedpixels.co.uk
	[81.2.110.250])
	by lxorguk.ukuu.org.uk (8.14.5/8.14.1) with ESMTP id qAQMHFqK020160;
	Mon, 26 Nov 2012 22:17:20 GMT
Received: from pyramind.ukuu.org.uk (localhost [127.0.0.1])
	by pyramind.ukuu.org.uk (8.14.5/8.14.5) with ESMTP id qAQLp4Jh000828;
	Mon, 26 Nov 2012 21:51:05 GMT
Date: Mon, 26 Nov 2012 21:51:04 +0000
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121126215104.2343b419@pyramind.ukuu.org.uk>
In-Reply-To: <alpine.DEB.2.02.1211262011190.5310@kaball.uk.xensource.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<alpine.DEB.2.02.1211262011190.5310@kaball.uk.xensource.com>
X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.8; x86_64-redhat-linux-gnu)
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEWysKsSBQMIAwIZCwj///8wIhxoRDXH9QHCAAABeUlEQVQ4jaXTvW7DIBAAYCQTzz2hdq+rdg494ZmBeE5KYHZjm/d/hJ6NfzBJpp5kRb5PHJwvMPMk2L9As5Y9AmYRBL+HAyJKeOU5aHRhsAAvORQ+UEgAvgddj/lwAXndw2laEDqA4x6KEBhjYRCg9tBFCOuJFxg2OKegbWjbsRTk8PPhKPD7HcRxB7cqhgBRp9Dcqs+B8v4CQvFdqeot3Kov6hBUn0AJitrzY+sgUuiA8i0r7+B3AfqKcN6t8M6HtqQ+AOoELCikgQSbgabKaJW3kn5lBs47JSGDhhLKDUh1UMipwwinMYPTBuIBjEclSaGZUk9hDlTb5sUTYN2SFFQuPe4Gox1X0FZOufjgBiV1Vls7b+GvK3SU4wfmcGo9rPPQzgIabfj4TYQo15k3bTHX9RIw/kniir5YbtJF4jkFG+dsDK1IgE413zAthU/vR2HVMmFUPIHTvF6jWCpFaGw/A3qWgnbxpSm9MSmY5b3pM1gvNc/gQfwBsGwF0VCtxZgAAAAASUVORK5CYII=
Mime-Version: 1.0
Cc: George Dunlap <dunlapg@umich.edu>, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 26 Nov 2012 20:12:04 +0000
Stefano Stabellini <stefano.stabellini@eu.citrix.com> wrote:

> On Mon, 26 Nov 2012, George Dunlap wrote:
> > So while doing a bit of investigation into a request that we have instr=
uctions for how to sign a Xen binary, I came across a related pair of quest=
ions.=A0 If we
> > boot from a signed Xen binary, then:
> > 1. Will Xen then successfully boot a signed dom0 kernel / initrd?
> > 2. Will Xen fail to boot an unsigned dom0 kernel / initrd?
> > =

> > I think if Xen is signed, then ideally we want both 1 and 2 to be true,=
 right?=A0
> =

> I think that you are right

I think you'd have to be out of your tree to try and sign Xen itself
using the MS setup - assuming you can ever get a key and get it to work
which seems to be an issue of its own.

You want to sign a small bootloader that is tightly auditable and do your
own key management within that for anything else. I would think you'd be
able to make use of the Linux bootloader work.

Better yet would be to take the entire sorry EFI and 'secure' boot mess
and kick it where the sun won't shine but alas that may be a challenge
until the PC manufacturers realise they can't handle the support costs of
things in the current state and fix it.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 21:46:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 21:46:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td6Vh-0002oe-7W; Mon, 26 Nov 2012 21:46:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <alan@lxorguk.ukuu.org.uk>) id 1Td6Vg-0002oZ-1T
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 21:46:36 +0000
Received: from [85.158.143.35:4400] by server-2.bemta-4.messagelabs.com id
	30/6E-28922-B33E3B05; Mon, 26 Nov 2012 21:46:35 +0000
X-Env-Sender: alan@lxorguk.ukuu.org.uk
X-Msg-Ref: server-4.tower-21.messagelabs.com!1353966348!5636114!1
X-Originating-IP: [81.2.110.251]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21171 invoked from network); 26 Nov 2012 21:45:49 -0000
Received: from lxorguk.ukuu.org.uk (HELO lxorguk.ukuu.org.uk) (81.2.110.251)
	by server-4.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 21:45:49 -0000
Received: from pyramind.ukuu.org.uk (earthlight.etchedpixels.co.uk
	[81.2.110.250])
	by lxorguk.ukuu.org.uk (8.14.5/8.14.1) with ESMTP id qAQMHFqK020160;
	Mon, 26 Nov 2012 22:17:20 GMT
Received: from pyramind.ukuu.org.uk (localhost [127.0.0.1])
	by pyramind.ukuu.org.uk (8.14.5/8.14.5) with ESMTP id qAQLp4Jh000828;
	Mon, 26 Nov 2012 21:51:05 GMT
Date: Mon, 26 Nov 2012 21:51:04 +0000
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121126215104.2343b419@pyramind.ukuu.org.uk>
In-Reply-To: <alpine.DEB.2.02.1211262011190.5310@kaball.uk.xensource.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<alpine.DEB.2.02.1211262011190.5310@kaball.uk.xensource.com>
X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.8; x86_64-redhat-linux-gnu)
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEWysKsSBQMIAwIZCwj///8wIhxoRDXH9QHCAAABeUlEQVQ4jaXTvW7DIBAAYCQTzz2hdq+rdg494ZmBeE5KYHZjm/d/hJ6NfzBJpp5kRb5PHJwvMPMk2L9As5Y9AmYRBL+HAyJKeOU5aHRhsAAvORQ+UEgAvgddj/lwAXndw2laEDqA4x6KEBhjYRCg9tBFCOuJFxg2OKegbWjbsRTk8PPhKPD7HcRxB7cqhgBRp9Dcqs+B8v4CQvFdqeot3Kov6hBUn0AJitrzY+sgUuiA8i0r7+B3AfqKcN6t8M6HtqQ+AOoELCikgQSbgabKaJW3kn5lBs47JSGDhhLKDUh1UMipwwinMYPTBuIBjEclSaGZUk9hDlTb5sUTYN2SFFQuPe4Gox1X0FZOufjgBiV1Vls7b+GvK3SU4wfmcGo9rPPQzgIabfj4TYQo15k3bTHX9RIw/kniir5YbtJF4jkFG+dsDK1IgE413zAthU/vR2HVMmFUPIHTvF6jWCpFaGw/A3qWgnbxpSm9MSmY5b3pM1gvNc/gQfwBsGwF0VCtxZgAAAAASUVORK5CYII=
Mime-Version: 1.0
Cc: George Dunlap <dunlapg@umich.edu>, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 26 Nov 2012 20:12:04 +0000
Stefano Stabellini <stefano.stabellini@eu.citrix.com> wrote:

> On Mon, 26 Nov 2012, George Dunlap wrote:
> > So while doing a bit of investigation into a request that we have instr=
uctions for how to sign a Xen binary, I came across a related pair of quest=
ions.=A0 If we
> > boot from a signed Xen binary, then:
> > 1. Will Xen then successfully boot a signed dom0 kernel / initrd?
> > 2. Will Xen fail to boot an unsigned dom0 kernel / initrd?
> > =

> > I think if Xen is signed, then ideally we want both 1 and 2 to be true,=
 right?=A0
> =

> I think that you are right

I think you'd have to be out of your tree to try and sign Xen itself
using the MS setup - assuming you can ever get a key and get it to work
which seems to be an issue of its own.

You want to sign a small bootloader that is tightly auditable and do your
own key management within that for anything else. I would think you'd be
able to make use of the Linux bootloader work.

Better yet would be to take the entire sorry EFI and 'secure' boot mess
and kick it where the sun won't shine but alas that may be a challenge
until the PC manufacturers realise they can't handle the support costs of
things in the current state and fix it.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 21:47:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 21:47:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td6WZ-0002sQ-TK; Mon, 26 Nov 2012 21:47:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1Td6WZ-0002sG-AK
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 21:47:31 +0000
Received: from [193.109.254.147:18737] by server-1.bemta-14.messagelabs.com id
	0A/D8-25314-273E3B05; Mon, 26 Nov 2012 21:47:30 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353966441!6187693!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26189 invoked from network); 26 Nov 2012 21:47:22 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-5.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 21:47:22 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 2D40884072;
	Mon, 26 Nov 2012 22:47:21 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id tMQtMsSX5IkD; Mon, 26 Nov 2012 22:47:21 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id 16AD08406F;
	Mon, 26 Nov 2012 22:47:20 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1Td6WE-0003zO-AN; Mon, 26 Nov 2012 22:47:10 +0100
Date: Mon, 26 Nov 2012 22:47:10 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121126214710.GM7556@type.youpi.perso.aquilenet.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xen.org,
	Keir Fraser <keir@xen.org>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Keir Fraser <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 0 of 4] Minios improvements for app
 development
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Andrew Cooper, le Mon 26 Nov 2012 16:24:08 +0000, a =E9crit :
>  4  Trailing whitespace cleanup. (because it is very messy)
> =

> Patch 4 is likely to be more controversial than the others, so I am less
> fussed if it gets nacked, but would still appreciate the issue being
> fixed.

Well, it does not actually bring any more readability, while it brings
more difficult browsing of the history...

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 21:47:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 21:47:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td6WZ-0002sQ-TK; Mon, 26 Nov 2012 21:47:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1Td6WZ-0002sG-AK
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 21:47:31 +0000
Received: from [193.109.254.147:18737] by server-1.bemta-14.messagelabs.com id
	0A/D8-25314-273E3B05; Mon, 26 Nov 2012 21:47:30 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1353966441!6187693!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26189 invoked from network); 26 Nov 2012 21:47:22 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-5.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 21:47:22 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 2D40884072;
	Mon, 26 Nov 2012 22:47:21 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id tMQtMsSX5IkD; Mon, 26 Nov 2012 22:47:21 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id 16AD08406F;
	Mon, 26 Nov 2012 22:47:20 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1Td6WE-0003zO-AN; Mon, 26 Nov 2012 22:47:10 +0100
Date: Mon, 26 Nov 2012 22:47:10 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121126214710.GM7556@type.youpi.perso.aquilenet.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xen.org,
	Keir Fraser <keir@xen.org>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Keir Fraser <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 0 of 4] Minios improvements for app
 development
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Andrew Cooper, le Mon 26 Nov 2012 16:24:08 +0000, a =E9crit :
>  4  Trailing whitespace cleanup. (because it is very messy)
> =

> Patch 4 is likely to be more controversial than the others, so I am less
> fussed if it gets nacked, but would still appreciate the issue being
> fixed.

Well, it does not actually bring any more readability, while it brings
more difficult browsing of the history...

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 21:48:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 21:48:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td6X8-0002w8-BI; Mon, 26 Nov 2012 21:48:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td6X6-0002w0-UD
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 21:48:05 +0000
Received: from [85.158.137.99:46051] by server-15.bemta-3.messagelabs.com id
	CF/A2-23779-493E3B05; Mon, 26 Nov 2012 21:48:04 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1353966481!17547155!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzY1NTY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6650 invoked from network); 26 Nov 2012 21:48:03 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 21:48:03 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQLlhHL014459
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 21:47:44 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQLlgu2008511
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 21:47:43 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQLlf4f014289; Mon, 26 Nov 2012 15:47:41 -0600
MIME-Version: 1.0
Message-ID: <fff756e7-ae31-49ab-91f2-d5e455cca1bd@default>
Date: Mon, 26 Nov 2012 13:47:39 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Tim Deegan <tim@xen.org>
References: <1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
	<cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
	<1545900898.20121126192533@eikelenboom.it>
	<672d364a-6d34-4c89-b0fb-5af989877117@default>
	<20121126202411.GA8912@reaktio.net>
	<b7ad6baf-e085-4ef7-860e-f9755b756339@default>
	<20121126213249.GA37842@ocelot.phlegethon.org>
In-Reply-To: <20121126213249.GA37842@ocelot.phlegethon.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Sander Eikelenboom <linux@eikelenboom.it>, xen-devel@lists.xensource.com,
	Alexander Bienzeisler <chosi@amd.co.at>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Tim Deegan [mailto:tim@xen.org]
> Subject: Re: [Xen-devel] can not use all available memory
> 
> At 12:37 -0800 on 26 Nov (1353933449), Dan Magenheimer wrote:
> > > > I could be wrong (and I am confident someone will correct me if I am) but
> > > > I think this is because the Citrix memory model assumes there is an
> > > > inference-driven policy engine for load-balancing memory across competing
> > > > virtual machines ("squeezed").  I suspect squeezed returns unallocated
> > > > xen "free" memory to dom0.
> >
> > I forgot... it is called Dynamic Memory Control (DMC), not squeezed
> > in the XenServer product.
> 
> AFAIK XenServer uses dom0_mem= and doesn't balloon com0 after boot time.
> The idea of ballooning all free memory into dom0 is a xl-ism, inherited
> from xend, and not really a "Citrix" one.  It's useful if you've
> installed xen on a machine where dom0 is otherwise your main OS, but not
> particularly for a dedicated platform.

"inherited from xend"... was the autoballoon default the same in xend?
I don't recall ever turning it off manually and, when testing tmem,
I'm sure I would have had to.  Or maybe xend did use hypervisor free
memory before trying to autoballoon dom0?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 21:48:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 21:48:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td6X8-0002w8-BI; Mon, 26 Nov 2012 21:48:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td6X6-0002w0-UD
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 21:48:05 +0000
Received: from [85.158.137.99:46051] by server-15.bemta-3.messagelabs.com id
	CF/A2-23779-493E3B05; Mon, 26 Nov 2012 21:48:04 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1353966481!17547155!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzY1NTY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6650 invoked from network); 26 Nov 2012 21:48:03 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 26 Nov 2012 21:48:03 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAQLlhHL014459
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 26 Nov 2012 21:47:44 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAQLlgu2008511
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 26 Nov 2012 21:47:43 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAQLlf4f014289; Mon, 26 Nov 2012 15:47:41 -0600
MIME-Version: 1.0
Message-ID: <fff756e7-ae31-49ab-91f2-d5e455cca1bd@default>
Date: Mon, 26 Nov 2012 13:47:39 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Tim Deegan <tim@xen.org>
References: <1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
	<cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
	<1545900898.20121126192533@eikelenboom.it>
	<672d364a-6d34-4c89-b0fb-5af989877117@default>
	<20121126202411.GA8912@reaktio.net>
	<b7ad6baf-e085-4ef7-860e-f9755b756339@default>
	<20121126213249.GA37842@ocelot.phlegethon.org>
In-Reply-To: <20121126213249.GA37842@ocelot.phlegethon.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Sander Eikelenboom <linux@eikelenboom.it>, xen-devel@lists.xensource.com,
	Alexander Bienzeisler <chosi@amd.co.at>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Tim Deegan [mailto:tim@xen.org]
> Subject: Re: [Xen-devel] can not use all available memory
> 
> At 12:37 -0800 on 26 Nov (1353933449), Dan Magenheimer wrote:
> > > > I could be wrong (and I am confident someone will correct me if I am) but
> > > > I think this is because the Citrix memory model assumes there is an
> > > > inference-driven policy engine for load-balancing memory across competing
> > > > virtual machines ("squeezed").  I suspect squeezed returns unallocated
> > > > xen "free" memory to dom0.
> >
> > I forgot... it is called Dynamic Memory Control (DMC), not squeezed
> > in the XenServer product.
> 
> AFAIK XenServer uses dom0_mem= and doesn't balloon com0 after boot time.
> The idea of ballooning all free memory into dom0 is a xl-ism, inherited
> from xend, and not really a "Citrix" one.  It's useful if you've
> installed xen on a machine where dom0 is otherwise your main OS, but not
> particularly for a dedicated platform.

"inherited from xend"... was the autoballoon default the same in xend?
I don't recall ever turning it off manually and, when testing tmem,
I'm sure I would have had to.  Or maybe xend did use hypervisor free
memory before trying to autoballoon dom0?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 22:17:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 22:17:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td6z3-0003WH-Rv; Mon, 26 Nov 2012 22:16:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Td6z2-0003WC-G0
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 22:16:56 +0000
Received: from [85.158.143.35:34533] by server-2.bemta-4.messagelabs.com id
	01/BA-28922-75AE3B05; Mon, 26 Nov 2012 22:16:55 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1353968214!8864913!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15112 invoked from network); 26 Nov 2012 22:16:55 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 22:16:55 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 19:43:09 +0000
Message-Id: <50B3ACAD02000078000AB505@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 16:53:49 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
	<CCD9450D.53691%keir@xen.org>
	<9efb590f-8c59-496b-97ea-8c39d77c203a@default>
In-Reply-To: <9efb590f-8c59-496b-97ea-8c39d77c203a@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 17:43, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> It would probably also be nice to cc the various people
> who have contributed their time to provide supporting
> information that helped isolate the bug.

That was done with the backported version that I sent
subsequently. Beyond that, I don#t think our Cc-ing rules (if we
can call them such in the first place, i.e. if they exist at all) don't
really request that. Plus - apart from the two guys I worked with
to debug this, I don't even know who else might have spent time
on it earlier on.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 22:17:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 22:17:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td6z3-0003WH-Rv; Mon, 26 Nov 2012 22:16:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Td6z2-0003WC-G0
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 22:16:56 +0000
Received: from [85.158.143.35:34533] by server-2.bemta-4.messagelabs.com id
	01/BA-28922-75AE3B05; Mon, 26 Nov 2012 22:16:55 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1353968214!8864913!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15112 invoked from network); 26 Nov 2012 22:16:55 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 22:16:55 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 19:43:09 +0000
Message-Id: <50B3ACAD02000078000AB505@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 16:53:49 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
	<CCD9450D.53691%keir@xen.org>
	<9efb590f-8c59-496b-97ea-8c39d77c203a@default>
In-Reply-To: <9efb590f-8c59-496b-97ea-8c39d77c203a@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 17:43, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> It would probably also be nice to cc the various people
> who have contributed their time to provide supporting
> information that helped isolate the bug.

That was done with the backported version that I sent
subsequently. Beyond that, I don#t think our Cc-ing rules (if we
can call them such in the first place, i.e. if they exist at all) don't
really request that. Plus - apart from the two guys I worked with
to debug this, I don't even know who else might have spent time
on it earlier on.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 22:26:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 22:26:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td78Q-0003lG-9u; Mon, 26 Nov 2012 22:26:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Td78O-0003lB-Jo
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 22:26:36 +0000
Received: from [85.158.137.99:10533] by server-9.bemta-3.messagelabs.com id
	9B/BE-02388-A9CE3B05; Mon, 26 Nov 2012 22:26:34 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1353968793!19820060!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24364 invoked from network); 26 Nov 2012 22:26:33 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 22:26:33 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 19:43:40 +0000
Message-Id: <50B3ADD602000078000AB518@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 16:58:46 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<50B3A8DA02000078000AB460@nat28.tlf.novell.com>
	<1353948353.5830.116.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353948353.5830.116.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Lars Kurth <lars.kurth@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 17:45, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Mon, 2012-11-26 at 16:37 +0000, Jan Beulich wrote:
>> >>> On 26.11.12 at 16:58, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> > No new development happens in the X.Y-testing branches, instead
>> > changesets are backported from xen-unstable. Where this is not possible
>> > (perhaps unstable has moved on such that the patch cannot be applied or
>> > the approach used in unstable is otherwise not valid for the stable
>> > branch) then a specific fix can be created for the stable branch.
>> > However it is a requirement that the issue will always be fixed in
>> > unstable first (this is to avoid regressions on the next stable
>> 
>> Did you mean "major" here?
> 
> Where? Before "regressions"? I'd like to think we were striving to avoid
> regressions of either sort ;-)

Oh, sorry, I thought it to be clear that I wanted "stable" replaced
by "major" (because that's where a regression would occur with a
fix that wasn't a backport). But as always, I should have made this
explicit.

>> > Changesets are nominated for inclusion in the stable branch by making a
>> > request to the stable maintainer on xen-devel either by noting it as
>> > such in the submission of the original patch to xen-unstable or by a
>> > subsequent explicit email to xen-devel.
>> 
>> I think we should explicitly require the person expected to do the
>> backport to be Cc-ed; I for myself don't get around to read _all_
>> mails on xen-devel, and hence with a badly chosen subject it is not
>> impossible (albeit also not likely) for me to miss such a request
>> otherwise.
> 
> That makes sense to me. Should we add entries to MAINTAINERS to cover
> stable trees as well?

Maybe specifically on the stable branches?

> I also wondered if it might be useful to have a greppable string, like
> Linux's "CC: stable@kernel.org"? AIUI the Linux stable guys don't
> actually use this as a mailing list, even though it technically does
> exist as such, instead they use it as grep fodder for their tooling. We
> could certainly setup stable@xen.org, directed to a blackhole if
> necessary.

Since we don't generally include Cc-s in commit messages, I don't
think that would help much. But I'm not opposed to this either.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 22:26:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 22:26:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td78Q-0003lG-9u; Mon, 26 Nov 2012 22:26:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Td78O-0003lB-Jo
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 22:26:36 +0000
Received: from [85.158.137.99:10533] by server-9.bemta-3.messagelabs.com id
	9B/BE-02388-A9CE3B05; Mon, 26 Nov 2012 22:26:34 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1353968793!19820060!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24364 invoked from network); 26 Nov 2012 22:26:33 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 22:26:33 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 19:43:40 +0000
Message-Id: <50B3ADD602000078000AB518@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 16:58:46 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<50B3A8DA02000078000AB460@nat28.tlf.novell.com>
	<1353948353.5830.116.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353948353.5830.116.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Lars Kurth <lars.kurth@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 17:45, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Mon, 2012-11-26 at 16:37 +0000, Jan Beulich wrote:
>> >>> On 26.11.12 at 16:58, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> > No new development happens in the X.Y-testing branches, instead
>> > changesets are backported from xen-unstable. Where this is not possible
>> > (perhaps unstable has moved on such that the patch cannot be applied or
>> > the approach used in unstable is otherwise not valid for the stable
>> > branch) then a specific fix can be created for the stable branch.
>> > However it is a requirement that the issue will always be fixed in
>> > unstable first (this is to avoid regressions on the next stable
>> 
>> Did you mean "major" here?
> 
> Where? Before "regressions"? I'd like to think we were striving to avoid
> regressions of either sort ;-)

Oh, sorry, I thought it to be clear that I wanted "stable" replaced
by "major" (because that's where a regression would occur with a
fix that wasn't a backport). But as always, I should have made this
explicit.

>> > Changesets are nominated for inclusion in the stable branch by making a
>> > request to the stable maintainer on xen-devel either by noting it as
>> > such in the submission of the original patch to xen-unstable or by a
>> > subsequent explicit email to xen-devel.
>> 
>> I think we should explicitly require the person expected to do the
>> backport to be Cc-ed; I for myself don't get around to read _all_
>> mails on xen-devel, and hence with a badly chosen subject it is not
>> impossible (albeit also not likely) for me to miss such a request
>> otherwise.
> 
> That makes sense to me. Should we add entries to MAINTAINERS to cover
> stable trees as well?

Maybe specifically on the stable branches?

> I also wondered if it might be useful to have a greppable string, like
> Linux's "CC: stable@kernel.org"? AIUI the Linux stable guys don't
> actually use this as a mailing list, even though it technically does
> exist as such, instead they use it as grep fodder for their tooling. We
> could certainly setup stable@xen.org, directed to a blackhole if
> necessary.

Since we don't generally include Cc-s in commit messages, I don't
think that would help much. But I'm not opposed to this either.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 22:28:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 22:28:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td7AH-0003qK-Sw; Mon, 26 Nov 2012 22:28:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jfehlig@suse.com>) id 1Td7AF-0003q6-FF
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 22:28:32 +0000
Received: from [85.158.139.211:28420] by server-13.bemta-5.messagelabs.com id
	FE/97-27809-E0DE3B05; Mon, 26 Nov 2012 22:28:30 +0000
X-Env-Sender: jfehlig@suse.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1353968906!19658953!1
X-Originating-IP: [137.65.248.124]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11806 invoked from network); 26 Nov 2012 22:28:26 -0000
Received: from inet-orm.provo.novell.com (HELO mail.novell.com)
	(137.65.248.124) by server-10.tower-206.messagelabs.com with SMTP;
	26 Nov 2012 22:28:26 -0000
Received: from jfehlig1.provo.novell.com ([137.65.135.33])
	by mail.novell.com with ESMTP; Mon, 26 Nov 2012 15:28:20 -0700
From: Jim Fehlig <jfehlig@suse.com>
To: libvir-list@redhat.com
Date: Mon, 26 Nov 2012 15:28:15 -0700
Message-Id: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
X-Mailer: git-send-email 1.7.10.4
Cc: xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] Convert libxl driver to Xen 4.2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Based on a patch originally authored by Daniel De Graaf

  http://lists.xen.org/archives/html/xen-devel/2012-05/msg00565.html

This patch converts the Xen libxl driver to support only Xen >= 4.2.
Support for Xen 4.1 libxl is dropped since that version of libxl is
designated 'technology preview' only and is incompatible with Xen 4.2
libxl.  Additionally, the default toolstack in Xen 4.1 is still xend,
for which libvirt has a stable, functional driver.
---
 configure.ac             |    8 +-
 docs/drvxen.html.in      |    8 +
 libvirt.spec.in          |    4 +-
 src/libxl/libxl_conf.c   |  370 ++++++++++++++---------------------
 src/libxl/libxl_conf.h   |   17 +-
 src/libxl/libxl_driver.c |  488 +++++++++++++++++++++++++++-------------------
 6 files changed, 459 insertions(+), 436 deletions(-)

diff --git a/configure.ac b/configure.ac
index 849d787..c1a9943 100644
--- a/configure.ac
+++ b/configure.ac
@@ -717,16 +717,14 @@ if test "$with_libxl" != "no" ; then
     fi
     CFLAGS="$CFLAGS $LIBXL_CFLAGS"
     LIBS="$LIBS $LIBXL_LIBS"
-    AC_CHECK_LIB([xenlight], [libxl_domain_create_new], [
+    AC_CHECK_LIB([xenlight], [libxl_ctx_alloc], [
         with_libxl=yes
-        LIBXL_LIBS="$LIBXL_LIBS -lxenlight -lxenstore -lxenctrl -lxenguest -luuid -lutil -lblktapctl"
+        LIBXL_LIBS="$LIBXL_LIBS -lxenlight"
     ],[
         if test "$with_libxl" = "yes"; then
             fail=1
         fi
         with_libxl=no
-    ],[
-        -lxenstore -lxenctrl -lxenguest -luuid -lutil -lblktapctl
     ])
 fi
 
@@ -734,7 +732,7 @@ LIBS="$old_LIBS"
 CFLAGS="$old_CFLAGS"
 
 if test $fail = 1; then
-    AC_MSG_ERROR([You must install the libxl Library to compile libxenlight driver with -lxl])
+    AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.2 to compile libxenlight driver with -lxl])
 fi
 
 if test "$with_libxl" = "yes"; then
diff --git a/docs/drvxen.html.in b/docs/drvxen.html.in
index 0bca935..06bd911 100644
--- a/docs/drvxen.html.in
+++ b/docs/drvxen.html.in
@@ -53,6 +53,14 @@
         the <code>/etc/xen</code> directory. It is important not to place
         any other non-config files in this directory.
       </li>
+      <li>
+        <strong>libxl</strong>: Starting with Xen 4.2, the legacy XenD/xm
+        toolstack is deprecated in favor of libxl, also commonly called
+        libxenlight.  libvirt supports this new Xen toolstack via the
+        libxl driver.  If XenD is enabled, the legacy xen driver consisting
+        of the above mentioned channels will be used.  If XenD is disabled,
+        the libxl driver will be used.
+      </li>
     </ul>
 
     <h2><a name="uri">Connections to Xen driver</a></h2>
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 35c103b..bb274f5 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -188,8 +188,8 @@
 %endif
 %endif
 
-# Fedora doesn't have new enough Xen for libxl until F16
-%if 0%{?fedora} && 0%{?fedora} < 16
+# Fedora doesn't have new enough Xen for libxl until F18
+%if 0%{?fedora} && 0%{?fedora} < 18
 %define with_libxl 0
 %endif
 
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 1c3130b..73abdfa 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -41,6 +41,7 @@
 #include "capabilities.h"
 #include "libxl_driver.h"
 #include "libxl_conf.h"
+#include "libxl_utils.h"
 #include "storage_file.h"
 
 
@@ -62,6 +63,52 @@ struct guest_arch {
 static const char *xen_cap_re = "(xen|hvm)-[[:digit:]]+\\.[[:digit:]]+-(x86_32|x86_64|ia64|powerpc64)(p|be)?";
 static regex_t xen_cap_rec;
 
+/*
+ * Copied from split_string_into_string_list() in
+ * $xen-sources/tools/libxl/xl_cmdimpl.c, which is licensed LGPL v2.1.
+ */
+static int
+libxlSplitStringIntoStringList(const char *str,
+                               const char *delim,
+                               libxl_string_list *psl)
+{
+    char *s, *saveptr;
+    const char *p;
+    libxl_string_list sl;
+    int i = 0, nr = 0;
+
+    s = strdup(str);
+    if (s == NULL) {
+        virReportOOMError();
+        return -1;
+    }
+
+    /* Count number of entries */
+    p = strtok_r(s, delim, &saveptr);
+    do {
+        nr++;
+    } while ((p = strtok_r(NULL, delim, &saveptr)));
+
+    VIR_FREE(s);
+    s = strdup(str);
+
+    if (VIR_ALLOC_N(sl, nr + 1) < 0) {
+        virReportOOMError();
+        VIR_FREE(s);
+        return -1;
+    }
+
+    p = strtok_r(s, delim, &saveptr);
+    do {
+        sl[i] = strdup(p);
+        i++;
+    } while ((p = strtok_r(NULL, delim, &saveptr)));
+    sl[i] = NULL;
+
+    *psl = sl;
+    VIR_FREE(s);
+    return 0;
+}
 
 static int
 libxlNextFreeVncPort(libxlDriverPrivatePtr driver, int startPort)
@@ -360,18 +407,36 @@ libxlMakeCapabilitiesInternal(const char *hostmachine,
 }
 
 static int
-libxlMakeDomCreateInfo(virDomainDefPtr def, libxl_domain_create_info *c_info)
+libxlMakeDomCreateInfo(libxlDriverPrivatePtr driver,
+                       virDomainDefPtr def,
+                       libxl_domain_create_info *c_info)
 {
     char uuidstr[VIR_UUID_STRING_BUFLEN];
 
-    libxl_init_create_info(c_info);
+    libxl_domain_create_info_init(c_info);
+
+    if (STREQ(def->os.type, "hvm"))
+        c_info->type = LIBXL_DOMAIN_TYPE_HVM;
+    else
+        c_info->type = LIBXL_DOMAIN_TYPE_PV;
 
-    c_info->hvm = STREQ(def->os.type, "hvm");
     if ((c_info->name = strdup(def->name)) == NULL) {
         virReportOOMError();
         goto error;
     }
 
+    if (def->nseclabels &&
+        def->seclabels[0]->type == VIR_DOMAIN_SECLABEL_STATIC) {
+        if (libxl_flask_context_to_sid(driver->ctx,
+                                       def->seclabels[0]->label,
+                                       strlen(def->seclabels[0]->label),
+                                       &c_info->ssidref)) {
+            virReportError(VIR_ERR_INTERNAL_ERROR,
+                           _("libxenlight failed to resolve security label '%s'"),
+                           def->seclabels[0]->label);
+        }
+    }
+
     virUUIDFormat(def->uuid, uuidstr);
     if (libxl_uuid_from_string(&c_info->uuid, uuidstr)) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -382,7 +447,7 @@ libxlMakeDomCreateInfo(virDomainDefPtr def, libxl_domain_create_info *c_info)
     return 0;
 
 error:
-    libxl_domain_create_info_destroy(c_info);
+    libxl_domain_create_info_dispose(c_info);
     return -1;
 }
 
@@ -393,26 +458,25 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
     int hvm = STREQ(def->os.type, "hvm");
     int i;
 
-    /* Currently, libxenlight only supports 32 vcpus per domain.
-     * cur_vcpus member of struct libxl_domain_build_info is defined
-     * as an int, but its semantic is a bitmap of online vcpus, so
-     * only 32 can be represented.
+    /*
+     * libxl in Xen 4.2 supports up to 128 vcpus, cur_vcpus was replaced
+     * by avail_vcpus of type libxl_bitmap
      */
-    if (def->maxvcpus > 32 || def->vcpus > 32) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("This version of libxenlight only supports 32 "
-                         "vcpus per domain"));
+    if (def->maxvcpus > LIBXL_MAXVCPUS || def->vcpus > LIBXL_MAXVCPUS) {
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       _("This version of libxenlight only supports %u "
+                         "vcpus per domain"), LIBXL_MAXVCPUS);
         return -1;
     }
 
-    libxl_init_build_info(b_info, &d_config->c_info);
+    libxl_domain_build_info_init(b_info);
 
-    b_info->hvm = hvm;
-    b_info->max_vcpus = def->maxvcpus;
-    if (def->vcpus == 32)
-        b_info->cur_vcpus = (uint32_t) -1;
+    if (hvm)
+        libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_HVM);
     else
-        b_info->cur_vcpus = (1 << def->vcpus) - 1;
+        libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_PV);
+    b_info->max_vcpus = def->maxvcpus;
+    libxl_bitmap_set((&b_info->avail_vcpus), def->vcpus);
     if (def->clock.ntimers > 0 &&
         def->clock.timers[0]->name == VIR_DOMAIN_TIMER_NAME_TSC) {
         switch (def->clock.timers[0]->mode) {
@@ -426,16 +490,20 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
                 b_info->tsc_mode = 1;
         }
     }
+    b_info->sched_params.weight = 1000;
     b_info->max_memkb = def->mem.max_balloon;
     b_info->target_memkb = def->mem.cur_balloon;
     if (hvm) {
-        b_info->u.hvm.pae = def->features & (1 << VIR_DOMAIN_FEATURE_PAE);
-        b_info->u.hvm.apic = def->features & (1 << VIR_DOMAIN_FEATURE_APIC);
-        b_info->u.hvm.acpi = def->features & (1 << VIR_DOMAIN_FEATURE_ACPI);
+        libxl_defbool_set(&b_info->u.hvm.pae,
+                          def->features & (1 << VIR_DOMAIN_FEATURE_PAE));
+        libxl_defbool_set(&b_info->u.hvm.apic,
+                          def->features & (1 << VIR_DOMAIN_FEATURE_APIC));
+        libxl_defbool_set(&b_info->u.hvm.acpi,
+                          def->features & (1 << VIR_DOMAIN_FEATURE_ACPI));
         for (i = 0; i < def->clock.ntimers; i++) {
             if (def->clock.timers[i]->name == VIR_DOMAIN_TIMER_NAME_HPET &&
                 def->clock.timers[i]->present == 1) {
-                b_info->u.hvm.hpet = 1;
+                libxl_defbool_set(&b_info->u.hvm.hpet, 1);
             }
         }
 
@@ -446,7 +514,7 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
          * 256 pages (1MB) per vcpu, plus 1 page per MiB of RAM for the P2M map,
          * plus 1 page per MiB of RAM to shadow the resident processes.
          */
-        b_info->shadow_memkb = 4 * (256 * b_info->cur_vcpus +
+        b_info->shadow_memkb = 4 * (256 * libxl_bitmap_count_set(&b_info->avail_vcpus) +
                                     2 * (b_info->max_memkb / 1024));
     } else {
         if (def->os.bootloader) {
@@ -456,10 +524,11 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
             }
         }
         if (def->os.bootloaderArgs) {
-            if ((b_info->u.pv.bootloader_args = strdup(def->os.bootloaderArgs)) == NULL) {
-                virReportOOMError();
+            if (libxlSplitStringIntoStringList(def->os.bootloaderArgs,
+                                               " \t\n",
+                                               &b_info->u.pv.bootloader_args)
+                < 0)
                 goto error;
-            }
         }
         if (def->os.cmdline) {
             if ((b_info->u.pv.cmdline = strdup(def->os.cmdline)) == NULL) {
@@ -469,14 +538,14 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
         }
         if (def->os.kernel) {
             /* libxl_init_build_info() sets kernel.path = strdup("hvmloader") */
-            VIR_FREE(b_info->kernel.path);
-            if ((b_info->kernel.path = strdup(def->os.kernel)) == NULL) {
+            VIR_FREE(b_info->u.pv.kernel);
+            if ((b_info->u.pv.kernel = strdup(def->os.kernel)) == NULL) {
                 virReportOOMError();
                 goto error;
             }
         }
         if (def->os.initrd) {
-            if ((b_info->u.pv.ramdisk.path = strdup(def->os.initrd)) == NULL) {
+            if ((b_info->u.pv.ramdisk = strdup(def->os.initrd)) == NULL) {
                 virReportOOMError();
                 goto error;
             }
@@ -486,13 +555,12 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
     return 0;
 
 error:
-    libxl_domain_build_info_destroy(b_info);
+    libxl_domain_build_info_dispose(b_info);
     return -1;
 }
 
 int
-libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
-              libxl_device_disk *x_disk)
+libxlMakeDisk(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk)
 {
     if (l_disk->src && (x_disk->pdev_path = strdup(l_disk->src)) == NULL) {
         virReportOOMError();
@@ -509,22 +577,22 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
             STREQ(l_disk->driverName, "tap2")) {
             switch (l_disk->format) {
             case VIR_STORAGE_FILE_QCOW:
-                x_disk->format = DISK_FORMAT_QCOW;
-                x_disk->backend = DISK_BACKEND_QDISK;
+                x_disk->format = LIBXL_DISK_FORMAT_QCOW;
+                x_disk->backend = LIBXL_DISK_BACKEND_QDISK;
                 break;
             case VIR_STORAGE_FILE_QCOW2:
-                x_disk->format = DISK_FORMAT_QCOW2;
-                x_disk->backend = DISK_BACKEND_QDISK;
+                x_disk->format = LIBXL_DISK_FORMAT_QCOW2;
+                x_disk->backend = LIBXL_DISK_BACKEND_QDISK;
                 break;
             case VIR_STORAGE_FILE_VHD:
-                x_disk->format = DISK_FORMAT_VHD;
-                x_disk->backend = DISK_BACKEND_TAP;
+                x_disk->format = LIBXL_DISK_FORMAT_VHD;
+                x_disk->backend = LIBXL_DISK_BACKEND_TAP;
                 break;
             case VIR_STORAGE_FILE_NONE:
                 /* No subtype specified, default to raw/tap */
             case VIR_STORAGE_FILE_RAW:
-                x_disk->format = DISK_FORMAT_RAW;
-                x_disk->backend = DISK_BACKEND_TAP;
+                x_disk->format = LIBXL_DISK_FORMAT_RAW;
+                x_disk->backend = LIBXL_DISK_BACKEND_TAP;
                 break;
             default:
                 virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -533,11 +601,11 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
                 return -1;
             }
         } else if (STREQ(l_disk->driverName, "file")) {
-            x_disk->format = DISK_FORMAT_RAW;
-            x_disk->backend = DISK_BACKEND_TAP;
+            x_disk->format = LIBXL_DISK_FORMAT_RAW;
+            x_disk->backend = LIBXL_DISK_BACKEND_TAP;
         } else if (STREQ(l_disk->driverName, "phy")) {
-            x_disk->format = DISK_FORMAT_RAW;
-            x_disk->backend = DISK_BACKEND_PHY;
+            x_disk->format = LIBXL_DISK_FORMAT_RAW;
+            x_disk->backend = LIBXL_DISK_BACKEND_PHY;
         } else {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("libxenlight does not support disk driver %s"),
@@ -546,12 +614,12 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
         }
     } else {
         /* No driverName - default to raw/tap?? */
-        x_disk->format = DISK_FORMAT_RAW;
-        x_disk->backend = DISK_BACKEND_TAP;
+        x_disk->format = LIBXL_DISK_FORMAT_RAW;
+        x_disk->backend = LIBXL_DISK_BACKEND_TAP;
     }
 
-    /* How to set unpluggable? */
-    x_disk->unpluggable = 1;
+    /* XXX is this right? */
+    x_disk->removable = 1;
     x_disk->readwrite = !l_disk->readonly;
     x_disk->is_cdrom = l_disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM ? 1 : 0;
     if (l_disk->transient) {
@@ -560,8 +628,6 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
         return -1;
     }
 
-    x_disk->domid = def->id;
-
     return 0;
 }
 
@@ -579,7 +645,7 @@ libxlMakeDiskList(virDomainDefPtr def, libxl_domain_config *d_config)
     }
 
     for (i = 0; i < ndisks; i++) {
-        if (libxlMakeDisk(def, l_disks[i], &x_disks[i]) < 0)
+        if (libxlMakeDisk(l_disks[i], &x_disks[i]) < 0)
             goto error;
     }
 
@@ -590,19 +656,19 @@ libxlMakeDiskList(virDomainDefPtr def, libxl_domain_config *d_config)
 
 error:
     for (i = 0; i < ndisks; i++)
-        libxl_device_disk_destroy(&x_disks[i]);
+        libxl_device_disk_dispose(&x_disks[i]);
     VIR_FREE(x_disks);
     return -1;
 }
 
 int
-libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
-             libxl_device_nic *x_nic)
+libxlMakeNic(virDomainNetDefPtr l_nic, libxl_device_nic *x_nic)
 {
-    // TODO: Where is mtu stored?
-    //x_nics[i].mtu = 1492;
+    /* TODO: Where is mtu stored?
+     *
+     * x_nics[i].mtu = 1492;
+     */
 
-    x_nic->domid = def->id;
     virMacAddrGetRaw(&l_nic->mac, x_nic->mac);
 
     if (l_nic->model && !STREQ(l_nic->model, "netfront")) {
@@ -610,9 +676,9 @@ libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
             virReportOOMError();
             return -1;
         }
-        x_nic->nictype = NICTYPE_IOEMU;
+        x_nic->nictype = LIBXL_NIC_TYPE_VIF_IOEMU;
     } else {
-        x_nic->nictype = NICTYPE_VIF;
+        x_nic->nictype = LIBXL_NIC_TYPE_VIF;
     }
 
     if (l_nic->ifname && (x_nic->ifname = strdup(l_nic->ifname)) == NULL) {
@@ -659,48 +725,49 @@ libxlMakeNicList(virDomainDefPtr def,  libxl_domain_config *d_config)
     for (i = 0; i < nnics; i++) {
         x_nics[i].devid = i;
 
-        if (libxlMakeNic(def, l_nics[i], &x_nics[i]))
+        if (libxlMakeNic(l_nics[i], &x_nics[i]))
             goto error;
     }
 
-    d_config->vifs = x_nics;
-    d_config->num_vifs = nnics;
+    d_config->nics = x_nics;
+    d_config->num_nics = nnics;
 
     return 0;
 
 error:
     for (i = 0; i < nnics; i++)
-        libxl_device_nic_destroy(&x_nics[i]);
+        libxl_device_nic_dispose(&x_nics[i]);
     VIR_FREE(x_nics);
     return -1;
 }
 
 int
-libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
-             virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb)
+libxlMakeVfb(libxlDriverPrivatePtr driver,
+             virDomainGraphicsDefPtr l_vfb,
+             libxl_device_vfb *x_vfb)
 {
     int port;
     const char *listenAddr;
 
     switch (l_vfb->type) {
         case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
-            x_vfb->sdl = 1;
+            libxl_defbool_set(&x_vfb->sdl.enable, 1);
             if (l_vfb->data.sdl.display &&
-                (x_vfb->display = strdup(l_vfb->data.sdl.display)) == NULL) {
+                (x_vfb->sdl.display = strdup(l_vfb->data.sdl.display)) == NULL) {
                 virReportOOMError();
                 return -1;
             }
             if (l_vfb->data.sdl.xauth &&
-                (x_vfb->xauthority =
+                (x_vfb->sdl.xauthority =
                     strdup(l_vfb->data.sdl.xauth)) == NULL) {
                 virReportOOMError();
                 return -1;
             }
             break;
         case  VIR_DOMAIN_GRAPHICS_TYPE_VNC:
-            x_vfb->vnc = 1;
+            libxl_defbool_set(&x_vfb->vnc.enable, 1);
             /* driver handles selection of free port */
-            x_vfb->vncunused = 0;
+            libxl_defbool_set(&x_vfb->vnc.findunused, 0);
             if (l_vfb->data.vnc.autoport) {
                 port = libxlNextFreeVncPort(driver, LIBXL_VNC_PORT_MIN);
                 if (port < 0) {
@@ -710,13 +777,13 @@ libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
                 }
                 l_vfb->data.vnc.port = port;
             }
-            x_vfb->vncdisplay = l_vfb->data.vnc.port - LIBXL_VNC_PORT_MIN;
+            x_vfb->vnc.display = l_vfb->data.vnc.port - LIBXL_VNC_PORT_MIN;
 
             listenAddr = virDomainGraphicsListenGetAddress(l_vfb, 0);
             if (listenAddr) {
                 /* libxl_device_vfb_init() does strdup("127.0.0.1") */
-                VIR_FREE(x_vfb->vnclisten);
-                if ((x_vfb->vnclisten = strdup(listenAddr)) == NULL) {
+                VIR_FREE(x_vfb->vnc.listen);
+                if ((x_vfb->vnc.listen = strdup(listenAddr)) == NULL) {
                     virReportOOMError();
                     return -1;
                 }
@@ -729,13 +796,14 @@ libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
             }
             break;
     }
-    x_vfb->domid = def->id;
+
     return 0;
 }
 
 static int
 libxlMakeVfbList(libxlDriverPrivatePtr driver,
-                 virDomainDefPtr def, libxl_domain_config *d_config)
+                 virDomainDefPtr def,
+                 libxl_domain_config *d_config)
 {
     virDomainGraphicsDefPtr *l_vfbs = def->graphics;
     int nvfbs = def->ngraphics;
@@ -757,10 +825,10 @@ libxlMakeVfbList(libxlDriverPrivatePtr driver,
     }
 
     for (i = 0; i < nvfbs; i++) {
-        libxl_device_vfb_init(&x_vfbs[i], i);
-        libxl_device_vkb_init(&x_vkbs[i], i);
+        libxl_device_vfb_init(&x_vfbs[i]);
+        libxl_device_vkb_init(&x_vkbs[i]);
 
-        if (libxlMakeVfb(driver, def, l_vfbs[i], &x_vfbs[i]) < 0)
+        if (libxlMakeVfb(driver, l_vfbs[i], &x_vfbs[i]) < 0)
             goto error;
     }
 
@@ -772,148 +840,14 @@ libxlMakeVfbList(libxlDriverPrivatePtr driver,
 
 error:
     for (i = 0; i < nvfbs; i++) {
-        libxl_device_vfb_destroy(&x_vfbs[i]);
-        libxl_device_vkb_destroy(&x_vkbs[i]);
+        libxl_device_vfb_dispose(&x_vfbs[i]);
+        libxl_device_vkb_dispose(&x_vkbs[i]);
     }
     VIR_FREE(x_vfbs);
     VIR_FREE(x_vkbs);
     return -1;
 }
 
-static int
-libxlMakeChrdevStr(virDomainChrDefPtr def, char **buf)
-{
-    const char *type = virDomainChrTypeToString(def->source.type);
-
-    if (!type) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       "%s", _("unexpected chr device type"));
-        return -1;
-    }
-
-    switch (def->source.type) {
-        case VIR_DOMAIN_CHR_TYPE_NULL:
-        case VIR_DOMAIN_CHR_TYPE_STDIO:
-        case VIR_DOMAIN_CHR_TYPE_VC:
-        case VIR_DOMAIN_CHR_TYPE_PTY:
-            if (virAsprintf(buf, "%s", type) < 0) {
-                virReportOOMError();
-                return -1;
-            }
-            break;
-
-        case VIR_DOMAIN_CHR_TYPE_FILE:
-        case VIR_DOMAIN_CHR_TYPE_PIPE:
-            if (virAsprintf(buf, "%s:%s", type,
-                            def->source.data.file.path) < 0) {
-                virReportOOMError();
-                return -1;
-            }
-            break;
-
-        case VIR_DOMAIN_CHR_TYPE_DEV:
-            if (virAsprintf(buf, "%s", def->source.data.file.path) < 0) {
-                virReportOOMError();
-                return -1;
-            }
-            break;
-    }
-
-    return 0;
-}
-
-static int
-libxlMakeDeviceModelInfo(virDomainDefPtr def, libxl_domain_config *d_config)
-{
-    libxl_device_model_info *dm_info = &d_config->dm_info;
-    int i;
-    char b_order[VIR_DOMAIN_BOOT_LAST+1];
-
-    libxl_init_dm_info(dm_info, &d_config->c_info, &d_config->b_info);
-
-    if (d_config->b_info.hvm) {
-        /* HVM-specific device model info */
-        dm_info->type = XENFV;
-        if (def->os.nBootDevs > 0) {
-            VIR_FREE(dm_info->boot);
-            for (i = 0; i < def->os.nBootDevs; i++) {
-                switch (def->os.bootDevs[i]) {
-                    case VIR_DOMAIN_BOOT_FLOPPY:
-                        b_order[i] = 'a';
-                        break;
-                    default:
-                    case VIR_DOMAIN_BOOT_DISK:
-                        b_order[i] = 'c';
-                        break;
-                    case VIR_DOMAIN_BOOT_CDROM:
-                        b_order[i] = 'd';
-                        break;
-                    case VIR_DOMAIN_BOOT_NET:
-                        b_order[i] = 'n';
-                        break;
-                }
-            }
-            b_order[def->os.nBootDevs] = '\0';
-            if ((dm_info->boot = strdup(b_order)) == NULL) {
-                virReportOOMError();
-                goto error;
-            }
-        }
-        if (def->serials &&
-            (libxlMakeChrdevStr(def->serials[0], &dm_info->serial) < 0))
-            goto error;
-    } else {
-        /* PV-specific device model info */
-        dm_info->type = XENPV;
-    }
-
-    /* Build qemu graphics options from previously parsed vfb */
-    if (d_config->num_vfbs > 0) {
-        if (d_config->vfbs[0].vnc) {
-            dm_info->vnc = 1;
-            /* driver handles selection of free port */
-            dm_info->vncunused = 0;
-            if (d_config->vfbs[0].vnclisten) {
-                VIR_FREE(dm_info->vnclisten);
-                if ((dm_info->vnclisten =
-                     strdup(d_config->vfbs[0].vnclisten)) == NULL) {
-                    virReportOOMError();
-                    goto error;
-                }
-            }
-            if (d_config->vfbs[0].keymap &&
-                (dm_info->keymap = strdup(d_config->vfbs[0].keymap)) == NULL) {
-                virReportOOMError();
-                goto error;
-            }
-            dm_info->vncdisplay = d_config->vfbs[0].vncdisplay;
-            if (d_config->vfbs[0].vncpasswd &&
-                (dm_info->vncpasswd =
-                 strdup(d_config->vfbs[0].vncpasswd)) == NULL) {
-                virReportOOMError();
-                goto error;
-            }
-        } else if (d_config->vfbs[0].sdl) {
-            dm_info->sdl = 1;
-            dm_info->vnc = 0;
-        }
-    } else if (d_config->num_vfbs == 0) {
-        dm_info->nographic = 1;
-        dm_info->vnc = 0;
-    }
-
-    // TODO
-    //dm_info->usb = ;
-    //dm_info->usbdevice = ;
-    //dm_info->soundhw = ;
-
-    return 0;
-
-error:
-    libxl_device_model_info_destroy(dm_info);
-    return -1;
-}
-
 virCapsPtr
 libxlMakeCapabilities(libxl_ctx *ctx)
 {
@@ -947,7 +881,7 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
                        virDomainDefPtr def, libxl_domain_config *d_config)
 {
 
-    if (libxlMakeDomCreateInfo(def, &d_config->c_info) < 0)
+    if (libxlMakeDomCreateInfo(driver, def, &d_config->c_info) < 0)
         return -1;
 
     if (libxlMakeDomBuildInfo(def, d_config) < 0) {
@@ -966,10 +900,6 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
         goto error;
     }
 
-    if (libxlMakeDeviceModelInfo(def, d_config) < 0) {
-        goto error;
-    }
-
     d_config->on_reboot = def->onReboot;
     d_config->on_poweroff = def->onPoweroff;
     d_config->on_crash = def->onCrash;
@@ -977,6 +907,6 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
     return 0;
 
 error:
-    libxl_domain_config_destroy(d_config);
+    libxl_domain_config_dispose(d_config);
     return -1;
 }
diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
index 56bf85c..ea62b68 100644
--- a/src/libxl/libxl_conf.h
+++ b/src/libxl/libxl_conf.h
@@ -37,6 +37,7 @@
 # include "bitmap.h"
 
 
+# define LIBXL_MAXVCPUS      128
 # define LIBXL_VNC_PORT_MIN  5900
 # define LIBXL_VNC_PORT_MAX  65535
 
@@ -58,7 +59,7 @@ struct _libxlDriverPrivate {
     FILE *logger_file;
     xentoollog_logger *logger;
     /* libxl ctx for driver wide ops; getVersion, getNodeInfo, ... */
-    libxl_ctx ctx;
+    libxl_ctx *ctx;
 
     virBitmapPtr reservedVNCPorts;
     virDomainObjList domains;
@@ -77,10 +78,8 @@ typedef struct _libxlDomainObjPrivate libxlDomainObjPrivate;
 typedef libxlDomainObjPrivate *libxlDomainObjPrivatePtr;
 struct _libxlDomainObjPrivate {
     /* per domain libxl ctx */
-    libxl_ctx ctx;
-    libxl_waiter *dWaiter;
-    int waiterFD;
-    int eventHdl;
+    libxl_ctx *ctx;
+    libxl_evgen_domain_death *deathW;
 };
 
 # define LIBXL_SAVE_MAGIC "libvirt-xml\n \0 \r"
@@ -100,13 +99,11 @@ virCapsPtr
 libxlMakeCapabilities(libxl_ctx *ctx);
 
 int
-libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_dev,
-              libxl_device_disk *x_dev);
+libxlMakeDisk(virDomainDiskDefPtr l_dev, libxl_device_disk *x_dev);
 int
-libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
-             libxl_device_nic *x_nic);
+libxlMakeNic(virDomainNetDefPtr l_nic, libxl_device_nic *x_nic);
 int
-libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
+libxlMakeVfb(libxlDriverPrivatePtr driver,
              virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb);
 
 int
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index bc75730..f15129f 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -40,6 +40,7 @@
 #include "memory.h"
 #include "uuid.h"
 #include "command.h"
+#include "libxl.h"
 #include "libxl_driver.h"
 #include "libxl_conf.h"
 #include "xen_xm.h"
@@ -59,6 +60,19 @@
 /* Number of Xen scheduler parameters */
 #define XEN_SCHED_CREDIT_NPARAM   2
 
+struct libxlOSEventHookFDInfo {
+    libxlDomainObjPrivatePtr priv;
+    void *xl_priv;
+    int watch;
+};
+
+struct libxlOSEventHookTimerInfo {
+    libxlDomainObjPrivatePtr priv;
+    void *xl_priv;
+    int id;
+};
+
+
 static void libxlDomainManagedSaveLoad(void *payload,
                                        const void *n ATTRIBUTE_UNUSED,
                                        void *opaque);
@@ -84,6 +98,163 @@ libxlDriverUnlock(libxlDriverPrivatePtr driver)
     virMutexUnlock(&driver->lock);
 }
 
+
+static void libxlFDEventCallback(int watch ATTRIBUTE_UNUSED,
+                                 int fd,
+                                 int vir_events,
+                                 void *fdinfo)
+{
+    struct libxlOSEventHookFDInfo *info = fdinfo;
+    int events = 0;
+
+    if (vir_events & VIR_EVENT_HANDLE_READABLE)
+        events |= POLLIN;
+    if (vir_events & VIR_EVENT_HANDLE_WRITABLE)
+        events |= POLLOUT;
+    if (vir_events & VIR_EVENT_HANDLE_ERROR)
+        events |= POLLERR;
+    if (vir_events & VIR_EVENT_HANDLE_HANGUP)
+        events |= POLLHUP;
+
+    libxl_osevent_occurred_fd(info->priv->ctx, info->xl_priv, fd, 0, events);
+}
+
+static void libxlFreeFDInfo(void *obj)
+{
+    VIR_FREE(obj);
+}
+
+static int libxlFDRegisterEventHook(void *priv, int fd, void **hndp,
+                                    short events, void *xl_priv)
+{
+    int vir_events = VIR_EVENT_HANDLE_ERROR;
+    struct libxlOSEventHookFDInfo *fdinfo;
+
+    if (VIR_ALLOC(fdinfo) < 0) {
+        virReportOOMError();
+        return -1;
+    }
+
+    fdinfo->priv = priv;
+    fdinfo->xl_priv = xl_priv;
+    *hndp = fdinfo;
+
+    if (events & POLLIN)
+        vir_events |= VIR_EVENT_HANDLE_READABLE;
+    if (events & POLLOUT)
+        vir_events |= VIR_EVENT_HANDLE_WRITABLE;
+    fdinfo->watch = virEventAddHandle(fd, vir_events, libxlFDEventCallback,
+                                      fdinfo, libxlFreeFDInfo);
+    if (fdinfo->watch < 0) {
+        VIR_FREE(fdinfo);
+        return fdinfo->watch;
+    }
+
+    return 0;
+}
+
+static int libxlFDModifyEventHook(void *priv ATTRIBUTE_UNUSED,
+                                  int fd ATTRIBUTE_UNUSED,
+                                  void **hndp,
+                                  short events)
+{
+    struct libxlOSEventHookFDInfo *fdinfo = *hndp;
+    int vir_events = VIR_EVENT_HANDLE_ERROR;
+
+    if (events & POLLIN)
+        vir_events |= VIR_EVENT_HANDLE_READABLE;
+    if (events & POLLOUT)
+        vir_events |= VIR_EVENT_HANDLE_WRITABLE;
+
+    virEventUpdateHandle(fdinfo->watch, vir_events);
+    return 0;
+}
+
+static void libxlFDDeregisterEventHook(void *priv ATTRIBUTE_UNUSED,
+                                       int fd ATTRIBUTE_UNUSED,
+                                       void *hnd)
+{
+    struct libxlOSEventHookFDInfo *fdinfo = hnd;
+
+    virEventRemoveHandle(fdinfo->watch);
+}
+
+
+static void libxlTimerCallback(int timer ATTRIBUTE_UNUSED, void *timer_v)
+{
+    struct libxlOSEventHookTimerInfo *timer_info = timer_v;
+
+    libxl_osevent_occurred_timeout(timer_info->priv->ctx, timer_info->xl_priv);
+}
+
+static void libxlTimerInfoFree(void* obj)
+{
+    VIR_FREE(obj);
+}
+
+static int libxlTimeoutRegisterEventHook(void *priv,
+                                         void **hndp,
+                                         struct timeval abs_t,
+                                         void *for_libxl)
+{
+    struct timeval now;
+    struct libxlOSEventHookTimerInfo *timer_info;
+    int timeout, timer_id;
+
+    if (VIR_ALLOC(timer_info) < 0) {
+        virReportOOMError();
+        return -1;
+    }
+
+    gettimeofday(&now, NULL);
+    timeout = (abs_t.tv_usec - now.tv_usec) / 1000;
+    timeout += (abs_t.tv_sec - now.tv_sec) * 1000;
+    timer_id = virEventAddTimeout(timeout, libxlTimerCallback,
+                                  timer_info, libxlTimerInfoFree);
+    if (timer_id < 0) {
+        VIR_FREE(timer_info);
+        return timer_id;
+    }
+
+    timer_info->priv = priv;
+    timer_info->xl_priv = for_libxl;
+    timer_info->id = timer_id;
+    *hndp = timer_info;
+    return 0;
+}
+
+static int libxlTimeoutModifyEventHook(void *priv ATTRIBUTE_UNUSED,
+                                       void **hndp,
+                                       struct timeval abs_t)
+{
+    struct timeval now;
+    int timeout;
+    struct libxlOSEventHookTimerInfo *timer_info = *hndp;
+
+    gettimeofday(&now, NULL);
+    timeout = (abs_t.tv_usec - now.tv_usec) / 1000;
+    timeout += (abs_t.tv_sec - now.tv_sec) * 1000;
+    virEventUpdateTimeout(timer_info->id, timeout);
+    return 0;
+}
+
+static void libxlTimeoutDeregisterEventHook(void *priv ATTRIBUTE_UNUSED,
+                                            void *hnd)
+{
+    struct libxlOSEventHookTimerInfo *timer_info = hnd;
+
+    virEventRemoveTimeout(timer_info->id);
+}
+
+static const libxl_osevent_hooks libxl_event_callbacks = {
+    .fd_register = libxlFDRegisterEventHook,
+    .fd_modify = libxlFDModifyEventHook,
+    .fd_deregister = libxlFDDeregisterEventHook,
+    .timeout_register = libxlTimeoutRegisterEventHook,
+    .timeout_modify = libxlTimeoutModifyEventHook,
+    .timeout_deregister = libxlTimeoutDeregisterEventHook,
+};
+
 static void *
 libxlDomainObjPrivateAlloc(void)
 {
@@ -92,9 +263,9 @@ libxlDomainObjPrivateAlloc(void)
     if (VIR_ALLOC(priv) < 0)
         return NULL;
 
-    libxl_ctx_init(&priv->ctx, LIBXL_VERSION, libxl_driver->logger);
-    priv->waiterFD = -1;
-    priv->eventHdl = -1;
+    libxl_ctx_alloc(&priv->ctx, LIBXL_VERSION, 0, libxl_driver->logger);
+    priv->deathW = NULL;
+    libxl_osevent_register_hooks(priv->ctx, &libxl_event_callbacks, priv);
 
     return priv;
 }
@@ -104,16 +275,12 @@ libxlDomainObjPrivateFree(void *data)
 {
     libxlDomainObjPrivatePtr priv = data;
 
-    if (priv->eventHdl >= 0)
-        virEventRemoveHandle(priv->eventHdl);
-
-    if (priv->dWaiter) {
-        libxl_stop_waiting(&priv->ctx, priv->dWaiter);
-        libxl_free_waiter(priv->dWaiter);
-        VIR_FREE(priv->dWaiter);
+    if (priv->deathW) {
+        libxl_evdisable_domain_death(priv->ctx, priv->deathW);
+        VIR_FREE(priv->deathW);
     }
 
-    libxl_ctx_free(&priv->ctx);
+    libxl_ctx_free(priv->ctx);
     VIR_FREE(priv);
 }
 
@@ -125,17 +292,6 @@ libxlDomainEventQueue(libxlDriverPrivatePtr driver, virDomainEventPtr event)
     virDomainEventStateQueue(driver->domainEventState, event);
 }
 
-/*
- * Remove reference to domain object.
- */
-static void
-libxlDomainObjUnref(void *data)
-{
-    virDomainObjPtr vm = data;
-
-    virObjectUnref(vm);
-}
-
 static void
 libxlAutostartDomain(void *payload, const void *name ATTRIBUTE_UNUSED,
                      void *opaque)
@@ -166,13 +322,13 @@ libxlDoNodeGetInfo(libxlDriverPrivatePtr driver, virNodeInfoPtr info)
     const libxl_version_info* ver_info;
     struct utsname utsname;
 
-    if (libxl_get_physinfo(&driver->ctx, &phy_info)) {
+    if (libxl_get_physinfo(driver->ctx, &phy_info)) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxl_get_physinfo_info failed"));
         return -1;
     }
 
-    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxl_get_version_info failed"));
         return -1;
@@ -296,15 +452,9 @@ libxlVmCleanup(libxlDriverPrivatePtr driver,
     char *file;
     int i;
 
-    if (priv->eventHdl >= 0) {
-        virEventRemoveHandle(priv->eventHdl);
-        priv->eventHdl = -1;
-    }
-
-    if (priv->dWaiter) {
-        libxl_stop_waiting(&priv->ctx, priv->dWaiter);
-        libxl_free_waiter(priv->dWaiter);
-        VIR_FREE(priv->dWaiter);
+    if (priv->deathW) {
+        libxl_evdisable_domain_death(priv->ctx, priv->deathW);
+        priv->deathW = NULL;
     }
 
     if (vm->persistent) {
@@ -355,12 +505,11 @@ libxlVmCleanup(libxlDriverPrivatePtr driver,
 static int
 libxlVmReap(libxlDriverPrivatePtr driver,
             virDomainObjPtr vm,
-            int force,
             virDomainShutoffReason reason)
 {
     libxlDomainObjPrivatePtr priv = vm->privateData;
 
-    if (libxl_domain_destroy(&priv->ctx, vm->def->id, force) < 0) {
+    if (libxl_domain_destroy(priv->ctx, vm->def->id, NULL) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Unable to cleanup domain %d"), vm->def->id);
         return -1;
@@ -373,56 +522,26 @@ libxlVmReap(libxlDriverPrivatePtr driver,
 /*
  * Handle previously registered event notification from libxenlight
  */
-static void libxlEventHandler(int watch,
-                              int fd,
-                              int events,
-                              void *data)
+static void libxlEventHandler(void *data, const libxl_event *event)
 {
     libxlDriverPrivatePtr driver = libxl_driver;
     virDomainObjPtr vm = data;
-    libxlDomainObjPrivatePtr priv;
     virDomainEventPtr dom_event = NULL;
-    libxl_event event;
-    libxl_dominfo info;
 
     libxlDriverLock(driver);
     virDomainObjLock(vm);
     libxlDriverUnlock(driver);
 
-    priv = vm->privateData;
-
-    memset(&event, 0, sizeof(event));
-    memset(&info, 0, sizeof(info));
-
-    if (priv->waiterFD != fd || priv->eventHdl != watch) {
-        virEventRemoveHandle(watch);
-        priv->eventHdl = -1;
-        goto cleanup;
-    }
-
-    if (!(events & VIR_EVENT_HANDLE_READABLE))
-        goto cleanup;
-
-    if (libxl_get_event(&priv->ctx, &event))
-        goto cleanup;
-
-    if (event.type == LIBXL_EVENT_DOMAIN_DEATH) {
+    if (event->type == LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN) {
         virDomainShutoffReason reason;
 
-        /* libxl_event_get_domain_death_info returns 1 if death
-         * event was for this domid */
-        if (libxl_event_get_domain_death_info(&priv->ctx,
-                                              vm->def->id,
-                                              &event,
-                                              &info) != 1)
+        if (event->domid != vm->def->id)
             goto cleanup;
 
-        virEventRemoveHandle(watch);
-        priv->eventHdl = -1;
-        switch (info.shutdown_reason) {
-            case SHUTDOWN_poweroff:
-            case SHUTDOWN_crash:
-                if (info.shutdown_reason == SHUTDOWN_crash) {
+        switch (event->u.domain_shutdown.shutdown_reason) {
+            case LIBXL_SHUTDOWN_REASON_POWEROFF:
+            case LIBXL_SHUTDOWN_REASON_CRASH:
+                if (event->u.domain_shutdown.shutdown_reason == LIBXL_SHUTDOWN_REASON_CRASH) {
                     dom_event = virDomainEventNewFromObj(vm,
                                               VIR_DOMAIN_EVENT_STOPPED,
                                               VIR_DOMAIN_EVENT_STOPPED_CRASHED);
@@ -430,18 +549,18 @@ static void libxlEventHandler(int watch,
                 } else {
                     reason = VIR_DOMAIN_SHUTOFF_SHUTDOWN;
                 }
-                libxlVmReap(driver, vm, 0, reason);
+                libxlVmReap(driver, vm, reason);
                 if (!vm->persistent) {
                     virDomainRemoveInactive(&driver->domains, vm);
                     vm = NULL;
                 }
                 break;
-            case SHUTDOWN_reboot:
-                libxlVmReap(driver, vm, 0, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
+            case LIBXL_SHUTDOWN_REASON_REBOOT:
+                libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
                 libxlVmStart(driver, vm, 0, -1);
                 break;
             default:
-                VIR_INFO("Unhandled shutdown_reason %d", info.shutdown_reason);
+                VIR_INFO("Unhandled shutdown_reason %d", event->u.domain_shutdown.shutdown_reason);
                 break;
         }
     }
@@ -454,9 +573,14 @@ cleanup:
         libxlDomainEventQueue(driver, dom_event);
         libxlDriverUnlock(driver);
     }
-    libxl_free_event(&event);
 }
 
+static const struct libxl_event_hooks ev_hooks = {
+    .event_occurs_mask = LIBXL_EVENTMASK_ALL,
+    .event_occurs = libxlEventHandler,
+    .disaster = NULL,
+};
+
 /*
  * Register domain events with libxenlight and insert event handles
  * in libvirt's event loop.
@@ -465,40 +589,18 @@ static int
 libxlCreateDomEvents(virDomainObjPtr vm)
 {
     libxlDomainObjPrivatePtr priv = vm->privateData;
-    int fd;
 
-    if (VIR_ALLOC(priv->dWaiter) < 0) {
-        virReportOOMError();
-        return -1;
-    }
-
-    if (libxl_wait_for_domain_death(&priv->ctx, vm->def->id, priv->dWaiter))
-        goto error;
-
-    libxl_get_wait_fd(&priv->ctx, &fd);
-    if (fd < 0)
-        goto error;
+    libxl_event_register_callbacks(priv->ctx, &ev_hooks, vm);
 
-    priv->waiterFD = fd;
-    /* Add a reference to the domain object while it is injected in
-     * the event loop.
-     */
-    virObjectRef(vm);
-    if ((priv->eventHdl = virEventAddHandle(
-             fd,
-             VIR_EVENT_HANDLE_READABLE | VIR_EVENT_HANDLE_ERROR,
-             libxlEventHandler,
-             vm, libxlDomainObjUnref)) < 0) {
-        virObjectUnref(vm);
+    if (libxl_evenable_domain_death(priv->ctx, vm->def->id, 0, &priv->deathW))
         goto error;
-    }
 
     return 0;
 
 error:
-    libxl_free_waiter(priv->dWaiter);
-    VIR_FREE(priv->dWaiter);
-    priv->eventHdl = -1;
+    if (priv->deathW)
+        libxl_evdisable_domain_death(priv->ctx, priv->deathW);
+    VIR_FREE(priv->deathW);
     return -1;
 }
 
@@ -507,7 +609,7 @@ libxlDomainSetVcpuAffinites(libxlDriverPrivatePtr driver, virDomainObjPtr vm)
 {
     libxlDomainObjPrivatePtr priv = vm->privateData;
     virDomainDefPtr def = vm->def;
-    libxl_cpumap map;
+    libxl_bitmap map;
     uint8_t *cpumask = NULL;
     uint8_t *cpumap = NULL;
     virNodeInfo nodeinfo;
@@ -539,7 +641,7 @@ libxlDomainSetVcpuAffinites(libxlDriverPrivatePtr driver, virDomainObjPtr vm)
         map.size = cpumaplen;
         map.map = cpumap;
 
-        if (libxl_set_vcpuaffinity(&priv->ctx, def->id, vcpu, &map) != 0) {
+        if (libxl_set_vcpuaffinity(priv->ctx, def->id, vcpu, &map) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to pin vcpu '%d' with libxenlight"), vcpu);
             goto cleanup;
@@ -565,11 +667,10 @@ libxlFreeMem(libxlDomainObjPrivatePtr priv, libxl_domain_config *d_config)
     int tries = 3;
     int wait_secs = 10;
 
-    if ((ret = libxl_domain_need_memory(&priv->ctx, &d_config->b_info,
-                                        &d_config->dm_info,
+    if ((ret = libxl_domain_need_memory(priv->ctx, &d_config->b_info,
                                         &needed_mem)) >= 0) {
         for (i = 0; i < tries; ++i) {
-            if ((ret = libxl_get_free_memory(&priv->ctx, &free_mem)) < 0)
+            if ((ret = libxl_get_free_memory(priv->ctx, &free_mem)) < 0)
                 break;
 
             if (free_mem >= needed_mem) {
@@ -577,17 +678,17 @@ libxlFreeMem(libxlDomainObjPrivatePtr priv, libxl_domain_config *d_config)
                 break;
             }
 
-            if ((ret = libxl_set_memory_target(&priv->ctx, 0,
+            if ((ret = libxl_set_memory_target(priv->ctx, 0,
                                                free_mem - needed_mem,
                                                /* relative */ 1, 0)) < 0)
                 break;
 
-            ret = libxl_wait_for_free_memory(&priv->ctx, 0, needed_mem,
+            ret = libxl_wait_for_free_memory(priv->ctx, 0, needed_mem,
                                              wait_secs);
             if (ret == 0 || ret != ERROR_NOMEM)
                 break;
 
-            if ((ret = libxl_wait_for_memory_target(&priv->ctx, 0, 1)) < 0)
+            if ((ret = libxl_wait_for_memory_target(priv->ctx, 0, 1)) < 0)
                 break;
         }
     }
@@ -613,7 +714,6 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
     char *dom_xml = NULL;
     char *managed_save_path = NULL;
     int managed_save_fd = -1;
-    pid_t child_console_pid = -1;
     libxlDomainObjPrivatePtr priv = vm->privateData;
 
     /* If there is a managed saved state restore it instead of starting
@@ -657,7 +757,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         VIR_FREE(managed_save_path);
     }
 
-    memset(&d_config, 0, sizeof(d_config));
+    libxl_domain_config_init(&d_config);
 
     if (libxlBuildDomainConfig(driver, vm->def, &d_config) < 0)
         return -1;
@@ -669,13 +769,14 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         goto error;
     }
 
+    /* use as synchronous operations => ao_how = NULL and no intermediate reports => ao_progress = NULL */
+
     if (restore_fd < 0)
-        ret = libxl_domain_create_new(&priv->ctx, &d_config,
-                                      NULL, &child_console_pid, &domid);
+        ret = libxl_domain_create_new(priv->ctx, &d_config,
+                                      &domid, NULL, NULL);
     else
-        ret = libxl_domain_create_restore(&priv->ctx, &d_config, NULL,
-                                          &child_console_pid, &domid,
-                                          restore_fd);
+        ret = libxl_domain_create_restore(priv->ctx, &d_config, &domid,
+                                          restore_fd, NULL, NULL);
 
     if (ret) {
         if (restore_fd < 0)
@@ -693,7 +794,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
     if ((dom_xml = virDomainDefFormat(vm->def, 0)) == NULL)
         goto error;
 
-    if (libxl_userdata_store(&priv->ctx, domid, "libvirt-xml",
+    if (libxl_userdata_store(priv->ctx, domid, "libvirt-xml",
                              (uint8_t *)dom_xml, strlen(dom_xml) + 1)) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxenlight failed to store userdata"));
@@ -707,7 +808,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         goto error;
 
     if (!start_paused) {
-        libxl_domain_unpause(&priv->ctx, domid);
+        libxl_domain_unpause(priv->ctx, domid);
         virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_BOOTED);
     } else {
         virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER);
@@ -723,18 +824,18 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
                                          VIR_DOMAIN_EVENT_STARTED_RESTORED);
     libxlDomainEventQueue(driver, event);
 
-    libxl_domain_config_destroy(&d_config);
+    libxl_domain_config_dispose(&d_config);
     VIR_FREE(dom_xml);
     VIR_FORCE_CLOSE(managed_save_fd);
     return 0;
 
 error:
     if (domid > 0) {
-        libxl_domain_destroy(&priv->ctx, domid, 0);
+        libxl_domain_destroy(priv->ctx, domid, NULL);
         vm->def->id = -1;
         virDomainObjSetState(vm, VIR_DOMAIN_SHUTOFF, VIR_DOMAIN_SHUTOFF_FAILED);
     }
-    libxl_domain_config_destroy(&d_config);
+    libxl_domain_config_dispose(&d_config);
     VIR_FREE(dom_xml);
     VIR_FREE(managed_save_path);
     virDomainDefFree(def);
@@ -762,7 +863,7 @@ libxlReconnectDomain(void *payload,
     virDomainObjLock(vm);
 
     /* Does domain still exist? */
-    rc = libxl_domain_info(&driver->ctx, &d_info, vm->def->id);
+    rc = libxl_domain_info(driver->ctx, &d_info, vm->def->id);
     if (rc == ERROR_INVAL) {
         goto out;
     } else if (rc != 0) {
@@ -772,7 +873,7 @@ libxlReconnectDomain(void *payload,
     }
 
     /* Is this a domain that was under libvirt control? */
-    if (libxl_userdata_retrieve(&driver->ctx, vm->def->id,
+    if (libxl_userdata_retrieve(driver->ctx, vm->def->id,
                                 "libvirt-xml", &data, &len)) {
         VIR_DEBUG("libxl_userdata_retrieve failed, ignoring domain %d", vm->def->id);
         goto out;
@@ -810,7 +911,7 @@ libxlShutdown(void)
     libxlDriverLock(libxl_driver);
     virCapabilitiesFree(libxl_driver->caps);
     virDomainObjListDeinit(&libxl_driver->domains);
-    libxl_ctx_free(&libxl_driver->ctx);
+    libxl_ctx_free(libxl_driver->ctx);
     xtl_logger_destroy(libxl_driver->logger);
     if (libxl_driver->logger_file)
         VIR_FORCE_FCLOSE(libxl_driver->logger_file);
@@ -943,14 +1044,14 @@ libxlStartup(int privileged) {
         goto fail;
     }
 
-    if (libxl_ctx_init(&libxl_driver->ctx,
-                       LIBXL_VERSION,
+    if (libxl_ctx_alloc(&libxl_driver->ctx,
+                       LIBXL_VERSION, 0,
                        libxl_driver->logger)) {
         VIR_INFO("cannot initialize libxenlight context, probably not running in a Xen Dom0, disabling driver");
         goto fail;
     }
 
-    if ((ver_info = libxl_get_version_info(&libxl_driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(libxl_driver->ctx)) == NULL) {
         VIR_INFO("cannot version information from libxenlight, disabling driver");
         goto fail;
     }
@@ -958,7 +1059,7 @@ libxlStartup(int privileged) {
             (ver_info->xen_version_minor * 1000);
 
     if ((libxl_driver->caps =
-         libxlMakeCapabilities(&libxl_driver->ctx)) == NULL) {
+         libxlMakeCapabilities(libxl_driver->ctx)) == NULL) {
         VIR_ERROR(_("cannot create capabilities for libxenlight"));
         goto error;
     }
@@ -1115,7 +1216,7 @@ libxlGetMaxVcpus(virConnectPtr conn, const char *type ATTRIBUTE_UNUSED)
     int ret;
     libxlDriverPrivatePtr driver = conn->privateData;
 
-    ret = libxl_get_max_cpus(&driver->ctx);
+    ret = libxl_get_max_cpus(driver->ctx);
     /* libxl_get_max_cpus() will return 0 if there were any failures,
        e.g. xc_physinfo() failing */
     if (ret == 0)
@@ -1320,7 +1421,7 @@ libxlDomainSuspend(virDomainPtr dom)
     priv = vm->privateData;
 
     if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_PAUSED) {
-        if (libxl_domain_pause(&priv->ctx, dom->id) != 0) {
+        if (libxl_domain_pause(priv->ctx, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to suspend domain '%d' with libxenlight"),
                            dom->id);
@@ -1379,7 +1480,7 @@ libxlDomainResume(virDomainPtr dom)
     priv = vm->privateData;
 
     if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
-        if (libxl_domain_unpause(&priv->ctx, dom->id) != 0) {
+        if (libxl_domain_unpause(priv->ctx, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to resume domain '%d' with libxenlight"),
                            dom->id);
@@ -1436,7 +1537,7 @@ libxlDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
     }
 
     priv = vm->privateData;
-    if (libxl_domain_shutdown(&priv->ctx, dom->id, LIBXL_DOM_REQ_POWEROFF) != 0) {
+    if (libxl_domain_shutdown(priv->ctx, dom->id) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to shutdown domain '%d' with libxenlight"),
                        dom->id);
@@ -1489,7 +1590,7 @@ libxlDomainReboot(virDomainPtr dom, unsigned int flags)
     }
 
     priv = vm->privateData;
-    if (libxl_domain_shutdown(&priv->ctx, dom->id, LIBXL_DOM_REQ_REBOOT) != 0) {
+    if (libxl_domain_reboot(priv->ctx, dom->id) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to reboot domain '%d' with libxenlight"),
                        dom->id);
@@ -1534,7 +1635,7 @@ libxlDomainDestroyFlags(virDomainPtr dom,
     event = virDomainEventNewFromObj(vm,VIR_DOMAIN_EVENT_STOPPED,
                                      VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
 
-    if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_DESTROYED) != 0) {
+    if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to destroy domain '%d'"), dom->id);
         goto cleanup;
@@ -1672,7 +1773,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
 
         if (flags & VIR_DOMAIN_MEM_LIVE) {
             priv = vm->privateData;
-            if (libxl_domain_setmaxmem(&priv->ctx, dom->id, newmem) < 0) {
+            if (libxl_domain_setmaxmem(priv->ctx, dom->id, newmem) < 0) {
                 virReportError(VIR_ERR_INTERNAL_ERROR,
                                _("Failed to set maximum memory for domain '%d'"
                                  " with libxenlight"), dom->id);
@@ -1701,7 +1802,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
 
         if (flags & VIR_DOMAIN_MEM_LIVE) {
             priv = vm->privateData;
-            if (libxl_set_memory_target(&priv->ctx, dom->id, newmem, 0,
+            if (libxl_set_memory_target(priv->ctx, dom->id, newmem, 0,
                                         /* force */ 1) < 0) {
                 virReportError(VIR_ERR_INTERNAL_ERROR,
                                _("Failed to set memory for domain '%d'"
@@ -1761,7 +1862,7 @@ libxlDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info)
         info->memory = vm->def->mem.cur_balloon;
         info->maxMem = vm->def->mem.max_balloon;
     } else {
-        if (libxl_domain_info(&driver->ctx, &d_info, dom->id) != 0) {
+        if (libxl_domain_info(driver->ctx, &d_info, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("libxl_domain_info failed for domain '%d'"), dom->id);
             goto cleanup;
@@ -1861,7 +1962,7 @@ libxlDoDomainSave(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         goto cleanup;
     }
 
-    if (libxl_domain_suspend(&priv->ctx, NULL, vm->def->id, fd) != 0) {
+    if (libxl_domain_suspend(priv->ctx, vm->def->id, fd, 0, NULL) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to save domain '%d' with libxenlight"),
                        vm->def->id);
@@ -1871,7 +1972,7 @@ libxlDoDomainSave(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
     event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
                                          VIR_DOMAIN_EVENT_STOPPED_SAVED);
 
-    if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_SAVED) != 0) {
+    if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_SAVED) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to destroy domain '%d'"), vm->def->id);
         goto cleanup;
@@ -2028,7 +2129,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
 
     if (!(flags & VIR_DUMP_LIVE) &&
         virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
-        if (libxl_domain_pause(&priv->ctx, dom->id) != 0) {
+        if (libxl_domain_pause(priv->ctx, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Before dumping core, failed to suspend domain '%d'"
                              " with libxenlight"),
@@ -2039,7 +2140,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
         paused = true;
     }
 
-    if (libxl_domain_core_dump(&priv->ctx, dom->id, to) != 0) {
+    if (libxl_domain_core_dump(priv->ctx, dom->id, to, NULL) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to dump core of domain '%d' with libxenlight"),
                        dom->id);
@@ -2048,7 +2149,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
 
     libxlDriverLock(driver);
     if (flags & VIR_DUMP_CRASH) {
-        if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_CRASHED) != 0) {
+        if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_CRASHED) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to destroy domain '%d'"), dom->id);
             goto cleanup_unlock;
@@ -2069,7 +2170,7 @@ cleanup_unlock:
     libxlDriverUnlock(driver);
 cleanup_unpause:
     if (virDomainObjIsActive(vm) && paused) {
-        if (libxl_domain_unpause(&priv->ctx, dom->id) != 0) {
+        if (libxl_domain_unpause(priv->ctx, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("After dumping core, failed to resume domain '%d' with"
                              " libxenlight"), dom->id);
@@ -2227,7 +2328,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
     libxlDomainObjPrivatePtr priv;
     virDomainDefPtr def;
     virDomainObjPtr vm;
-    libxl_cpumap map;
+    libxl_bitmap map;
     uint8_t *bitmask = NULL;
     unsigned int maplen;
     unsigned int i, pos;
@@ -2322,7 +2423,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
         break;
 
     case VIR_DOMAIN_VCPU_LIVE:
-        if (libxl_set_vcpuonline(&priv->ctx, dom->id, &map) != 0) {
+        if (libxl_set_vcpuonline(priv->ctx, dom->id, &map) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to set vcpus for domain '%d'"
                              " with libxenlight"), dom->id);
@@ -2331,7 +2432,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
         break;
 
     case VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG:
-        if (libxl_set_vcpuonline(&priv->ctx, dom->id, &map) != 0) {
+        if (libxl_set_vcpuonline(priv->ctx, dom->id, &map) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to set vcpus for domain '%d'"
                              " with libxenlight"), dom->id);
@@ -2427,7 +2528,7 @@ libxlDomainPinVcpu(virDomainPtr dom, unsigned int vcpu, unsigned char *cpumap,
     libxlDomainObjPrivatePtr priv;
     virDomainObjPtr vm;
     int ret = -1;
-    libxl_cpumap map;
+    libxl_bitmap map;
 
     libxlDriverLock(driver);
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
@@ -2448,7 +2549,7 @@ libxlDomainPinVcpu(virDomainPtr dom, unsigned int vcpu, unsigned char *cpumap,
 
     map.size = maplen;
     map.map = cpumap;
-    if (libxl_set_vcpuaffinity(&priv->ctx, dom->id, vcpu, &map) != 0) {
+    if (libxl_set_vcpuaffinity(priv->ctx, dom->id, vcpu, &map) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to pin vcpu '%d' with libxenlight"), vcpu);
         goto cleanup;
@@ -2511,7 +2612,7 @@ libxlDomainGetVcpus(virDomainPtr dom, virVcpuInfoPtr info, int maxinfo,
     }
 
     priv = vm->privateData;
-    if ((vcpuinfo = libxl_list_vcpu(&priv->ctx, dom->id, &maxcpu,
+    if ((vcpuinfo = libxl_list_vcpu(priv->ctx, dom->id, &maxcpu,
                                     &hostcpus)) == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to list vcpus for domain '%d' with libxenlight"),
@@ -2538,7 +2639,7 @@ libxlDomainGetVcpus(virDomainPtr dom, virVcpuInfoPtr info, int maxinfo,
                    MIN(maplen, vcpuinfo[i].cpumap.size));
         }
 
-        libxl_vcpuinfo_destroy(&vcpuinfo[i]);
+        libxl_vcpuinfo_dispose(&vcpuinfo[i]);
     }
     VIR_FREE(vcpuinfo);
 
@@ -2596,7 +2697,7 @@ libxlDomainXMLFromNative(virConnectPtr conn, const char * nativeFormat,
         goto cleanup;
     }
 
-    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
         VIR_ERROR(_("cannot get version information from libxenlight"));
         goto cleanup;
     }
@@ -2639,7 +2740,7 @@ libxlDomainXMLToNative(virConnectPtr conn, const char * nativeFormat,
         goto cleanup;
     }
 
-    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
         VIR_ERROR(_("cannot get version information from libxenlight"));
         goto cleanup;
     }
@@ -2899,10 +3000,10 @@ libxlDomainChangeEjectableMedia(libxlDomainObjPrivatePtr priv,
         return -1;
     }
 
-    if (libxlMakeDisk(vm->def, disk, &x_disk) < 0)
+    if (libxlMakeDisk(disk, &x_disk) < 0)
         goto cleanup;
 
-    if ((ret = libxl_cdrom_insert(&priv->ctx, vm->def->id, &x_disk)) < 0) {
+    if ((ret = libxl_cdrom_insert(priv->ctx, vm->def->id, &x_disk, NULL)) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("libxenlight failed to change media for disk '%s'"),
                        disk->dst);
@@ -2954,11 +3055,11 @@ libxlDomainAttachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
                     goto cleanup;
                 }
 
-                if (libxlMakeDisk(vm->def, l_disk, &x_disk) < 0)
+                if (libxlMakeDisk(l_disk, &x_disk) < 0)
                     goto cleanup;
 
-                if ((ret = libxl_device_disk_add(&priv->ctx, vm->def->id,
-                                                &x_disk)) < 0) {
+                if ((ret = libxl_device_disk_add(priv->ctx, vm->def->id,
+                                                &x_disk, NULL)) < 0) {
                     virReportError(VIR_ERR_INTERNAL_ERROR,
                                    _("libxenlight failed to attach disk '%s'"),
                                    l_disk->dst);
@@ -2991,7 +3092,6 @@ libxlDomainDetachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
     virDomainDiskDefPtr l_disk = NULL;
     libxl_device_disk x_disk;
     int i;
-    int wait_secs = 2;
     int ret = -1;
 
     switch (dev->data.disk->device)  {
@@ -3008,11 +3108,11 @@ libxlDomainDetachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
 
                 l_disk = vm->def->disks[i];
 
-                if (libxlMakeDisk(vm->def, l_disk, &x_disk) < 0)
+                if (libxlMakeDisk(l_disk, &x_disk) < 0)
                     goto cleanup;
 
-                if ((ret = libxl_device_disk_del(&priv->ctx, &x_disk,
-                                                 wait_secs)) < 0) {
+                if ((ret = libxl_device_disk_remove(priv->ctx, vm->def->id,
+                                                    &x_disk, NULL)) < 0) {
                     virReportError(VIR_ERR_INTERNAL_ERROR,
                                    _("libxenlight failed to detach disk '%s'"),
                                    l_disk->dst);
@@ -3383,13 +3483,13 @@ libxlNodeGetFreeMemory(virConnectPtr conn)
     const libxl_version_info* ver_info;
     libxlDriverPrivatePtr driver = conn->privateData;
 
-    if (libxl_get_physinfo(&driver->ctx, &phy_info)) {
+    if (libxl_get_physinfo(driver->ctx, &phy_info)) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxl_get_physinfo_info failed"));
         return 0;
     }
 
-    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxl_get_version_info failed"));
         return 0;
@@ -3536,7 +3636,7 @@ libxlDomainGetSchedulerType(virDomainPtr dom, int *nparams)
     libxlDomainObjPrivatePtr priv;
     virDomainObjPtr vm;
     char * ret = NULL;
-    int sched_id;
+    libxl_scheduler sched_id;
 
     libxlDriverLock(driver);
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
@@ -3553,31 +3653,29 @@ libxlDomainGetSchedulerType(virDomainPtr dom, int *nparams)
     }
 
     priv = vm->privateData;
-    if ((sched_id = libxl_get_sched_id(&priv->ctx)) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to get scheduler id for domain '%d'"
-                         " with libxenlight"), dom->id);
-        goto cleanup;
-    }
+    sched_id = libxl_get_scheduler(priv->ctx);
 
     if (nparams)
         *nparams = 0;
     switch (sched_id) {
-    case XEN_SCHEDULER_SEDF:
+    case LIBXL_SCHEDULER_SEDF:
         ret = strdup("sedf");
         break;
-    case XEN_SCHEDULER_CREDIT:
+    case LIBXL_SCHEDULER_CREDIT:
         ret = strdup("credit");
         if (nparams)
             *nparams = XEN_SCHED_CREDIT_NPARAM;
         break;
-    case XEN_SCHEDULER_CREDIT2:
+    case LIBXL_SCHEDULER_CREDIT2:
         ret = strdup("credit2");
         break;
-    case XEN_SCHEDULER_ARINC653:
+    case LIBXL_SCHEDULER_ARINC653:
         ret = strdup("arinc653");
         break;
     default:
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                   _("Failed to get scheduler id for domain '%d'"
+                     " with libxenlight"), dom->id);
         goto cleanup;
     }
 
@@ -3599,8 +3697,8 @@ libxlDomainGetSchedulerParametersFlags(virDomainPtr dom,
     libxlDriverPrivatePtr driver = dom->conn->privateData;
     libxlDomainObjPrivatePtr priv;
     virDomainObjPtr vm;
-    libxl_sched_credit sc_info;
-    int sched_id;
+    libxl_domain_sched_params sc_info;
+    libxl_scheduler sched_id;
     int ret = -1;
 
     virCheckFlags(0, -1);
@@ -3610,31 +3708,28 @@ libxlDomainGetSchedulerParametersFlags(virDomainPtr dom,
     libxlDriverUnlock(driver);
 
     if (!vm) {
-        virReportError(VIR_ERR_NO_DOMAIN, "%s", _("no domain with matching uuid"));
+        virReportError(VIR_ERR_NO_DOMAIN, "%s",
+                       _("no domain with matching uuid"));
         goto cleanup;
     }
 
     if (!virDomainObjIsActive(vm)) {
-        virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("Domain is not running"));
+        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+                       _("Domain is not running"));
         goto cleanup;
     }
 
     priv = vm->privateData;
 
-    if ((sched_id = libxl_get_sched_id(&priv->ctx)) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to get scheduler id for domain '%d'"
-                         " with libxenlight"), dom->id);
-        goto cleanup;
-    }
+    sched_id = libxl_get_scheduler(priv->ctx);
 
-    if (sched_id != XEN_SCHEDULER_CREDIT) {
+    if (sched_id != LIBXL_SCHEDULER_CREDIT) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("Only 'credit' scheduler is supported"));
         goto cleanup;
     }
 
-    if (libxl_sched_credit_domain_get(&priv->ctx, dom->id, &sc_info) != 0) {
+    if (libxl_domain_sched_params_get(priv->ctx, dom->id, &sc_info) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to get scheduler parameters for domain '%d'"
                          " with libxenlight"), dom->id);
@@ -3677,7 +3772,7 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
     libxlDriverPrivatePtr driver = dom->conn->privateData;
     libxlDomainObjPrivatePtr priv;
     virDomainObjPtr vm;
-    libxl_sched_credit sc_info;
+    libxl_domain_sched_params sc_info;
     int sched_id;
     int i;
     int ret = -1;
@@ -3707,20 +3802,15 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
 
     priv = vm->privateData;
 
-    if ((sched_id = libxl_get_sched_id(&priv->ctx)) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to get scheduler id for domain '%d'"
-                         " with libxenlight"), dom->id);
-        goto cleanup;
-    }
+    sched_id = libxl_get_scheduler(priv->ctx);
 
-    if (sched_id != XEN_SCHEDULER_CREDIT) {
+    if (sched_id != LIBXL_SCHEDULER_CREDIT) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("Only 'credit' scheduler is supported"));
         goto cleanup;
     }
 
-    if (libxl_sched_credit_domain_get(&priv->ctx, dom->id, &sc_info) != 0) {
+    if (libxl_domain_sched_params_get(priv->ctx, dom->id, &sc_info) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to get scheduler parameters for domain '%d'"
                          " with libxenlight"), dom->id);
@@ -3737,7 +3827,7 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
         }
     }
 
-    if (libxl_sched_credit_domain_set(&priv->ctx, dom->id, &sc_info) != 0) {
+    if (libxl_domain_sched_params_set(priv->ctx, dom->id, &sc_info) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to set scheduler parameters for domain '%d'"
                          " with libxenlight"), dom->id);
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 22:28:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 22:28:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td7AH-0003qK-Sw; Mon, 26 Nov 2012 22:28:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jfehlig@suse.com>) id 1Td7AF-0003q6-FF
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 22:28:32 +0000
Received: from [85.158.139.211:28420] by server-13.bemta-5.messagelabs.com id
	FE/97-27809-E0DE3B05; Mon, 26 Nov 2012 22:28:30 +0000
X-Env-Sender: jfehlig@suse.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1353968906!19658953!1
X-Originating-IP: [137.65.248.124]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11806 invoked from network); 26 Nov 2012 22:28:26 -0000
Received: from inet-orm.provo.novell.com (HELO mail.novell.com)
	(137.65.248.124) by server-10.tower-206.messagelabs.com with SMTP;
	26 Nov 2012 22:28:26 -0000
Received: from jfehlig1.provo.novell.com ([137.65.135.33])
	by mail.novell.com with ESMTP; Mon, 26 Nov 2012 15:28:20 -0700
From: Jim Fehlig <jfehlig@suse.com>
To: libvir-list@redhat.com
Date: Mon, 26 Nov 2012 15:28:15 -0700
Message-Id: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
X-Mailer: git-send-email 1.7.10.4
Cc: xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] Convert libxl driver to Xen 4.2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Based on a patch originally authored by Daniel De Graaf

  http://lists.xen.org/archives/html/xen-devel/2012-05/msg00565.html

This patch converts the Xen libxl driver to support only Xen >= 4.2.
Support for Xen 4.1 libxl is dropped since that version of libxl is
designated 'technology preview' only and is incompatible with Xen 4.2
libxl.  Additionally, the default toolstack in Xen 4.1 is still xend,
for which libvirt has a stable, functional driver.
---
 configure.ac             |    8 +-
 docs/drvxen.html.in      |    8 +
 libvirt.spec.in          |    4 +-
 src/libxl/libxl_conf.c   |  370 ++++++++++++++---------------------
 src/libxl/libxl_conf.h   |   17 +-
 src/libxl/libxl_driver.c |  488 +++++++++++++++++++++++++++-------------------
 6 files changed, 459 insertions(+), 436 deletions(-)

diff --git a/configure.ac b/configure.ac
index 849d787..c1a9943 100644
--- a/configure.ac
+++ b/configure.ac
@@ -717,16 +717,14 @@ if test "$with_libxl" != "no" ; then
     fi
     CFLAGS="$CFLAGS $LIBXL_CFLAGS"
     LIBS="$LIBS $LIBXL_LIBS"
-    AC_CHECK_LIB([xenlight], [libxl_domain_create_new], [
+    AC_CHECK_LIB([xenlight], [libxl_ctx_alloc], [
         with_libxl=yes
-        LIBXL_LIBS="$LIBXL_LIBS -lxenlight -lxenstore -lxenctrl -lxenguest -luuid -lutil -lblktapctl"
+        LIBXL_LIBS="$LIBXL_LIBS -lxenlight"
     ],[
         if test "$with_libxl" = "yes"; then
             fail=1
         fi
         with_libxl=no
-    ],[
-        -lxenstore -lxenctrl -lxenguest -luuid -lutil -lblktapctl
     ])
 fi
 
@@ -734,7 +732,7 @@ LIBS="$old_LIBS"
 CFLAGS="$old_CFLAGS"
 
 if test $fail = 1; then
-    AC_MSG_ERROR([You must install the libxl Library to compile libxenlight driver with -lxl])
+    AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.2 to compile libxenlight driver with -lxl])
 fi
 
 if test "$with_libxl" = "yes"; then
diff --git a/docs/drvxen.html.in b/docs/drvxen.html.in
index 0bca935..06bd911 100644
--- a/docs/drvxen.html.in
+++ b/docs/drvxen.html.in
@@ -53,6 +53,14 @@
         the <code>/etc/xen</code> directory. It is important not to place
         any other non-config files in this directory.
       </li>
+      <li>
+        <strong>libxl</strong>: Starting with Xen 4.2, the legacy XenD/xm
+        toolstack is deprecated in favor of libxl, also commonly called
+        libxenlight.  libvirt supports this new Xen toolstack via the
+        libxl driver.  If XenD is enabled, the legacy xen driver consisting
+        of the above mentioned channels will be used.  If XenD is disabled,
+        the libxl driver will be used.
+      </li>
     </ul>
 
     <h2><a name="uri">Connections to Xen driver</a></h2>
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 35c103b..bb274f5 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -188,8 +188,8 @@
 %endif
 %endif
 
-# Fedora doesn't have new enough Xen for libxl until F16
-%if 0%{?fedora} && 0%{?fedora} < 16
+# Fedora doesn't have new enough Xen for libxl until F18
+%if 0%{?fedora} && 0%{?fedora} < 18
 %define with_libxl 0
 %endif
 
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 1c3130b..73abdfa 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -41,6 +41,7 @@
 #include "capabilities.h"
 #include "libxl_driver.h"
 #include "libxl_conf.h"
+#include "libxl_utils.h"
 #include "storage_file.h"
 
 
@@ -62,6 +63,52 @@ struct guest_arch {
 static const char *xen_cap_re = "(xen|hvm)-[[:digit:]]+\\.[[:digit:]]+-(x86_32|x86_64|ia64|powerpc64)(p|be)?";
 static regex_t xen_cap_rec;
 
+/*
+ * Copied from split_string_into_string_list() in
+ * $xen-sources/tools/libxl/xl_cmdimpl.c, which is licensed LGPL v2.1.
+ */
+static int
+libxlSplitStringIntoStringList(const char *str,
+                               const char *delim,
+                               libxl_string_list *psl)
+{
+    char *s, *saveptr;
+    const char *p;
+    libxl_string_list sl;
+    int i = 0, nr = 0;
+
+    s = strdup(str);
+    if (s == NULL) {
+        virReportOOMError();
+        return -1;
+    }
+
+    /* Count number of entries */
+    p = strtok_r(s, delim, &saveptr);
+    do {
+        nr++;
+    } while ((p = strtok_r(NULL, delim, &saveptr)));
+
+    VIR_FREE(s);
+    s = strdup(str);
+
+    if (VIR_ALLOC_N(sl, nr + 1) < 0) {
+        virReportOOMError();
+        VIR_FREE(s);
+        return -1;
+    }
+
+    p = strtok_r(s, delim, &saveptr);
+    do {
+        sl[i] = strdup(p);
+        i++;
+    } while ((p = strtok_r(NULL, delim, &saveptr)));
+    sl[i] = NULL;
+
+    *psl = sl;
+    VIR_FREE(s);
+    return 0;
+}
 
 static int
 libxlNextFreeVncPort(libxlDriverPrivatePtr driver, int startPort)
@@ -360,18 +407,36 @@ libxlMakeCapabilitiesInternal(const char *hostmachine,
 }
 
 static int
-libxlMakeDomCreateInfo(virDomainDefPtr def, libxl_domain_create_info *c_info)
+libxlMakeDomCreateInfo(libxlDriverPrivatePtr driver,
+                       virDomainDefPtr def,
+                       libxl_domain_create_info *c_info)
 {
     char uuidstr[VIR_UUID_STRING_BUFLEN];
 
-    libxl_init_create_info(c_info);
+    libxl_domain_create_info_init(c_info);
+
+    if (STREQ(def->os.type, "hvm"))
+        c_info->type = LIBXL_DOMAIN_TYPE_HVM;
+    else
+        c_info->type = LIBXL_DOMAIN_TYPE_PV;
 
-    c_info->hvm = STREQ(def->os.type, "hvm");
     if ((c_info->name = strdup(def->name)) == NULL) {
         virReportOOMError();
         goto error;
     }
 
+    if (def->nseclabels &&
+        def->seclabels[0]->type == VIR_DOMAIN_SECLABEL_STATIC) {
+        if (libxl_flask_context_to_sid(driver->ctx,
+                                       def->seclabels[0]->label,
+                                       strlen(def->seclabels[0]->label),
+                                       &c_info->ssidref)) {
+            virReportError(VIR_ERR_INTERNAL_ERROR,
+                           _("libxenlight failed to resolve security label '%s'"),
+                           def->seclabels[0]->label);
+        }
+    }
+
     virUUIDFormat(def->uuid, uuidstr);
     if (libxl_uuid_from_string(&c_info->uuid, uuidstr)) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -382,7 +447,7 @@ libxlMakeDomCreateInfo(virDomainDefPtr def, libxl_domain_create_info *c_info)
     return 0;
 
 error:
-    libxl_domain_create_info_destroy(c_info);
+    libxl_domain_create_info_dispose(c_info);
     return -1;
 }
 
@@ -393,26 +458,25 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
     int hvm = STREQ(def->os.type, "hvm");
     int i;
 
-    /* Currently, libxenlight only supports 32 vcpus per domain.
-     * cur_vcpus member of struct libxl_domain_build_info is defined
-     * as an int, but its semantic is a bitmap of online vcpus, so
-     * only 32 can be represented.
+    /*
+     * libxl in Xen 4.2 supports up to 128 vcpus, cur_vcpus was replaced
+     * by avail_vcpus of type libxl_bitmap
      */
-    if (def->maxvcpus > 32 || def->vcpus > 32) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("This version of libxenlight only supports 32 "
-                         "vcpus per domain"));
+    if (def->maxvcpus > LIBXL_MAXVCPUS || def->vcpus > LIBXL_MAXVCPUS) {
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       _("This version of libxenlight only supports %u "
+                         "vcpus per domain"), LIBXL_MAXVCPUS);
         return -1;
     }
 
-    libxl_init_build_info(b_info, &d_config->c_info);
+    libxl_domain_build_info_init(b_info);
 
-    b_info->hvm = hvm;
-    b_info->max_vcpus = def->maxvcpus;
-    if (def->vcpus == 32)
-        b_info->cur_vcpus = (uint32_t) -1;
+    if (hvm)
+        libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_HVM);
     else
-        b_info->cur_vcpus = (1 << def->vcpus) - 1;
+        libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_PV);
+    b_info->max_vcpus = def->maxvcpus;
+    libxl_bitmap_set((&b_info->avail_vcpus), def->vcpus);
     if (def->clock.ntimers > 0 &&
         def->clock.timers[0]->name == VIR_DOMAIN_TIMER_NAME_TSC) {
         switch (def->clock.timers[0]->mode) {
@@ -426,16 +490,20 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
                 b_info->tsc_mode = 1;
         }
     }
+    b_info->sched_params.weight = 1000;
     b_info->max_memkb = def->mem.max_balloon;
     b_info->target_memkb = def->mem.cur_balloon;
     if (hvm) {
-        b_info->u.hvm.pae = def->features & (1 << VIR_DOMAIN_FEATURE_PAE);
-        b_info->u.hvm.apic = def->features & (1 << VIR_DOMAIN_FEATURE_APIC);
-        b_info->u.hvm.acpi = def->features & (1 << VIR_DOMAIN_FEATURE_ACPI);
+        libxl_defbool_set(&b_info->u.hvm.pae,
+                          def->features & (1 << VIR_DOMAIN_FEATURE_PAE));
+        libxl_defbool_set(&b_info->u.hvm.apic,
+                          def->features & (1 << VIR_DOMAIN_FEATURE_APIC));
+        libxl_defbool_set(&b_info->u.hvm.acpi,
+                          def->features & (1 << VIR_DOMAIN_FEATURE_ACPI));
         for (i = 0; i < def->clock.ntimers; i++) {
             if (def->clock.timers[i]->name == VIR_DOMAIN_TIMER_NAME_HPET &&
                 def->clock.timers[i]->present == 1) {
-                b_info->u.hvm.hpet = 1;
+                libxl_defbool_set(&b_info->u.hvm.hpet, 1);
             }
         }
 
@@ -446,7 +514,7 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
          * 256 pages (1MB) per vcpu, plus 1 page per MiB of RAM for the P2M map,
          * plus 1 page per MiB of RAM to shadow the resident processes.
          */
-        b_info->shadow_memkb = 4 * (256 * b_info->cur_vcpus +
+        b_info->shadow_memkb = 4 * (256 * libxl_bitmap_count_set(&b_info->avail_vcpus) +
                                     2 * (b_info->max_memkb / 1024));
     } else {
         if (def->os.bootloader) {
@@ -456,10 +524,11 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
             }
         }
         if (def->os.bootloaderArgs) {
-            if ((b_info->u.pv.bootloader_args = strdup(def->os.bootloaderArgs)) == NULL) {
-                virReportOOMError();
+            if (libxlSplitStringIntoStringList(def->os.bootloaderArgs,
+                                               " \t\n",
+                                               &b_info->u.pv.bootloader_args)
+                < 0)
                 goto error;
-            }
         }
         if (def->os.cmdline) {
             if ((b_info->u.pv.cmdline = strdup(def->os.cmdline)) == NULL) {
@@ -469,14 +538,14 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
         }
         if (def->os.kernel) {
             /* libxl_init_build_info() sets kernel.path = strdup("hvmloader") */
-            VIR_FREE(b_info->kernel.path);
-            if ((b_info->kernel.path = strdup(def->os.kernel)) == NULL) {
+            VIR_FREE(b_info->u.pv.kernel);
+            if ((b_info->u.pv.kernel = strdup(def->os.kernel)) == NULL) {
                 virReportOOMError();
                 goto error;
             }
         }
         if (def->os.initrd) {
-            if ((b_info->u.pv.ramdisk.path = strdup(def->os.initrd)) == NULL) {
+            if ((b_info->u.pv.ramdisk = strdup(def->os.initrd)) == NULL) {
                 virReportOOMError();
                 goto error;
             }
@@ -486,13 +555,12 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
     return 0;
 
 error:
-    libxl_domain_build_info_destroy(b_info);
+    libxl_domain_build_info_dispose(b_info);
     return -1;
 }
 
 int
-libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
-              libxl_device_disk *x_disk)
+libxlMakeDisk(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk)
 {
     if (l_disk->src && (x_disk->pdev_path = strdup(l_disk->src)) == NULL) {
         virReportOOMError();
@@ -509,22 +577,22 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
             STREQ(l_disk->driverName, "tap2")) {
             switch (l_disk->format) {
             case VIR_STORAGE_FILE_QCOW:
-                x_disk->format = DISK_FORMAT_QCOW;
-                x_disk->backend = DISK_BACKEND_QDISK;
+                x_disk->format = LIBXL_DISK_FORMAT_QCOW;
+                x_disk->backend = LIBXL_DISK_BACKEND_QDISK;
                 break;
             case VIR_STORAGE_FILE_QCOW2:
-                x_disk->format = DISK_FORMAT_QCOW2;
-                x_disk->backend = DISK_BACKEND_QDISK;
+                x_disk->format = LIBXL_DISK_FORMAT_QCOW2;
+                x_disk->backend = LIBXL_DISK_BACKEND_QDISK;
                 break;
             case VIR_STORAGE_FILE_VHD:
-                x_disk->format = DISK_FORMAT_VHD;
-                x_disk->backend = DISK_BACKEND_TAP;
+                x_disk->format = LIBXL_DISK_FORMAT_VHD;
+                x_disk->backend = LIBXL_DISK_BACKEND_TAP;
                 break;
             case VIR_STORAGE_FILE_NONE:
                 /* No subtype specified, default to raw/tap */
             case VIR_STORAGE_FILE_RAW:
-                x_disk->format = DISK_FORMAT_RAW;
-                x_disk->backend = DISK_BACKEND_TAP;
+                x_disk->format = LIBXL_DISK_FORMAT_RAW;
+                x_disk->backend = LIBXL_DISK_BACKEND_TAP;
                 break;
             default:
                 virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -533,11 +601,11 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
                 return -1;
             }
         } else if (STREQ(l_disk->driverName, "file")) {
-            x_disk->format = DISK_FORMAT_RAW;
-            x_disk->backend = DISK_BACKEND_TAP;
+            x_disk->format = LIBXL_DISK_FORMAT_RAW;
+            x_disk->backend = LIBXL_DISK_BACKEND_TAP;
         } else if (STREQ(l_disk->driverName, "phy")) {
-            x_disk->format = DISK_FORMAT_RAW;
-            x_disk->backend = DISK_BACKEND_PHY;
+            x_disk->format = LIBXL_DISK_FORMAT_RAW;
+            x_disk->backend = LIBXL_DISK_BACKEND_PHY;
         } else {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("libxenlight does not support disk driver %s"),
@@ -546,12 +614,12 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
         }
     } else {
         /* No driverName - default to raw/tap?? */
-        x_disk->format = DISK_FORMAT_RAW;
-        x_disk->backend = DISK_BACKEND_TAP;
+        x_disk->format = LIBXL_DISK_FORMAT_RAW;
+        x_disk->backend = LIBXL_DISK_BACKEND_TAP;
     }
 
-    /* How to set unpluggable? */
-    x_disk->unpluggable = 1;
+    /* XXX is this right? */
+    x_disk->removable = 1;
     x_disk->readwrite = !l_disk->readonly;
     x_disk->is_cdrom = l_disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM ? 1 : 0;
     if (l_disk->transient) {
@@ -560,8 +628,6 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
         return -1;
     }
 
-    x_disk->domid = def->id;
-
     return 0;
 }
 
@@ -579,7 +645,7 @@ libxlMakeDiskList(virDomainDefPtr def, libxl_domain_config *d_config)
     }
 
     for (i = 0; i < ndisks; i++) {
-        if (libxlMakeDisk(def, l_disks[i], &x_disks[i]) < 0)
+        if (libxlMakeDisk(l_disks[i], &x_disks[i]) < 0)
             goto error;
     }
 
@@ -590,19 +656,19 @@ libxlMakeDiskList(virDomainDefPtr def, libxl_domain_config *d_config)
 
 error:
     for (i = 0; i < ndisks; i++)
-        libxl_device_disk_destroy(&x_disks[i]);
+        libxl_device_disk_dispose(&x_disks[i]);
     VIR_FREE(x_disks);
     return -1;
 }
 
 int
-libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
-             libxl_device_nic *x_nic)
+libxlMakeNic(virDomainNetDefPtr l_nic, libxl_device_nic *x_nic)
 {
-    // TODO: Where is mtu stored?
-    //x_nics[i].mtu = 1492;
+    /* TODO: Where is mtu stored?
+     *
+     * x_nics[i].mtu = 1492;
+     */
 
-    x_nic->domid = def->id;
     virMacAddrGetRaw(&l_nic->mac, x_nic->mac);
 
     if (l_nic->model && !STREQ(l_nic->model, "netfront")) {
@@ -610,9 +676,9 @@ libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
             virReportOOMError();
             return -1;
         }
-        x_nic->nictype = NICTYPE_IOEMU;
+        x_nic->nictype = LIBXL_NIC_TYPE_VIF_IOEMU;
     } else {
-        x_nic->nictype = NICTYPE_VIF;
+        x_nic->nictype = LIBXL_NIC_TYPE_VIF;
     }
 
     if (l_nic->ifname && (x_nic->ifname = strdup(l_nic->ifname)) == NULL) {
@@ -659,48 +725,49 @@ libxlMakeNicList(virDomainDefPtr def,  libxl_domain_config *d_config)
     for (i = 0; i < nnics; i++) {
         x_nics[i].devid = i;
 
-        if (libxlMakeNic(def, l_nics[i], &x_nics[i]))
+        if (libxlMakeNic(l_nics[i], &x_nics[i]))
             goto error;
     }
 
-    d_config->vifs = x_nics;
-    d_config->num_vifs = nnics;
+    d_config->nics = x_nics;
+    d_config->num_nics = nnics;
 
     return 0;
 
 error:
     for (i = 0; i < nnics; i++)
-        libxl_device_nic_destroy(&x_nics[i]);
+        libxl_device_nic_dispose(&x_nics[i]);
     VIR_FREE(x_nics);
     return -1;
 }
 
 int
-libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
-             virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb)
+libxlMakeVfb(libxlDriverPrivatePtr driver,
+             virDomainGraphicsDefPtr l_vfb,
+             libxl_device_vfb *x_vfb)
 {
     int port;
     const char *listenAddr;
 
     switch (l_vfb->type) {
         case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
-            x_vfb->sdl = 1;
+            libxl_defbool_set(&x_vfb->sdl.enable, 1);
             if (l_vfb->data.sdl.display &&
-                (x_vfb->display = strdup(l_vfb->data.sdl.display)) == NULL) {
+                (x_vfb->sdl.display = strdup(l_vfb->data.sdl.display)) == NULL) {
                 virReportOOMError();
                 return -1;
             }
             if (l_vfb->data.sdl.xauth &&
-                (x_vfb->xauthority =
+                (x_vfb->sdl.xauthority =
                     strdup(l_vfb->data.sdl.xauth)) == NULL) {
                 virReportOOMError();
                 return -1;
             }
             break;
         case  VIR_DOMAIN_GRAPHICS_TYPE_VNC:
-            x_vfb->vnc = 1;
+            libxl_defbool_set(&x_vfb->vnc.enable, 1);
             /* driver handles selection of free port */
-            x_vfb->vncunused = 0;
+            libxl_defbool_set(&x_vfb->vnc.findunused, 0);
             if (l_vfb->data.vnc.autoport) {
                 port = libxlNextFreeVncPort(driver, LIBXL_VNC_PORT_MIN);
                 if (port < 0) {
@@ -710,13 +777,13 @@ libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
                 }
                 l_vfb->data.vnc.port = port;
             }
-            x_vfb->vncdisplay = l_vfb->data.vnc.port - LIBXL_VNC_PORT_MIN;
+            x_vfb->vnc.display = l_vfb->data.vnc.port - LIBXL_VNC_PORT_MIN;
 
             listenAddr = virDomainGraphicsListenGetAddress(l_vfb, 0);
             if (listenAddr) {
                 /* libxl_device_vfb_init() does strdup("127.0.0.1") */
-                VIR_FREE(x_vfb->vnclisten);
-                if ((x_vfb->vnclisten = strdup(listenAddr)) == NULL) {
+                VIR_FREE(x_vfb->vnc.listen);
+                if ((x_vfb->vnc.listen = strdup(listenAddr)) == NULL) {
                     virReportOOMError();
                     return -1;
                 }
@@ -729,13 +796,14 @@ libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
             }
             break;
     }
-    x_vfb->domid = def->id;
+
     return 0;
 }
 
 static int
 libxlMakeVfbList(libxlDriverPrivatePtr driver,
-                 virDomainDefPtr def, libxl_domain_config *d_config)
+                 virDomainDefPtr def,
+                 libxl_domain_config *d_config)
 {
     virDomainGraphicsDefPtr *l_vfbs = def->graphics;
     int nvfbs = def->ngraphics;
@@ -757,10 +825,10 @@ libxlMakeVfbList(libxlDriverPrivatePtr driver,
     }
 
     for (i = 0; i < nvfbs; i++) {
-        libxl_device_vfb_init(&x_vfbs[i], i);
-        libxl_device_vkb_init(&x_vkbs[i], i);
+        libxl_device_vfb_init(&x_vfbs[i]);
+        libxl_device_vkb_init(&x_vkbs[i]);
 
-        if (libxlMakeVfb(driver, def, l_vfbs[i], &x_vfbs[i]) < 0)
+        if (libxlMakeVfb(driver, l_vfbs[i], &x_vfbs[i]) < 0)
             goto error;
     }
 
@@ -772,148 +840,14 @@ libxlMakeVfbList(libxlDriverPrivatePtr driver,
 
 error:
     for (i = 0; i < nvfbs; i++) {
-        libxl_device_vfb_destroy(&x_vfbs[i]);
-        libxl_device_vkb_destroy(&x_vkbs[i]);
+        libxl_device_vfb_dispose(&x_vfbs[i]);
+        libxl_device_vkb_dispose(&x_vkbs[i]);
     }
     VIR_FREE(x_vfbs);
     VIR_FREE(x_vkbs);
     return -1;
 }
 
-static int
-libxlMakeChrdevStr(virDomainChrDefPtr def, char **buf)
-{
-    const char *type = virDomainChrTypeToString(def->source.type);
-
-    if (!type) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       "%s", _("unexpected chr device type"));
-        return -1;
-    }
-
-    switch (def->source.type) {
-        case VIR_DOMAIN_CHR_TYPE_NULL:
-        case VIR_DOMAIN_CHR_TYPE_STDIO:
-        case VIR_DOMAIN_CHR_TYPE_VC:
-        case VIR_DOMAIN_CHR_TYPE_PTY:
-            if (virAsprintf(buf, "%s", type) < 0) {
-                virReportOOMError();
-                return -1;
-            }
-            break;
-
-        case VIR_DOMAIN_CHR_TYPE_FILE:
-        case VIR_DOMAIN_CHR_TYPE_PIPE:
-            if (virAsprintf(buf, "%s:%s", type,
-                            def->source.data.file.path) < 0) {
-                virReportOOMError();
-                return -1;
-            }
-            break;
-
-        case VIR_DOMAIN_CHR_TYPE_DEV:
-            if (virAsprintf(buf, "%s", def->source.data.file.path) < 0) {
-                virReportOOMError();
-                return -1;
-            }
-            break;
-    }
-
-    return 0;
-}
-
-static int
-libxlMakeDeviceModelInfo(virDomainDefPtr def, libxl_domain_config *d_config)
-{
-    libxl_device_model_info *dm_info = &d_config->dm_info;
-    int i;
-    char b_order[VIR_DOMAIN_BOOT_LAST+1];
-
-    libxl_init_dm_info(dm_info, &d_config->c_info, &d_config->b_info);
-
-    if (d_config->b_info.hvm) {
-        /* HVM-specific device model info */
-        dm_info->type = XENFV;
-        if (def->os.nBootDevs > 0) {
-            VIR_FREE(dm_info->boot);
-            for (i = 0; i < def->os.nBootDevs; i++) {
-                switch (def->os.bootDevs[i]) {
-                    case VIR_DOMAIN_BOOT_FLOPPY:
-                        b_order[i] = 'a';
-                        break;
-                    default:
-                    case VIR_DOMAIN_BOOT_DISK:
-                        b_order[i] = 'c';
-                        break;
-                    case VIR_DOMAIN_BOOT_CDROM:
-                        b_order[i] = 'd';
-                        break;
-                    case VIR_DOMAIN_BOOT_NET:
-                        b_order[i] = 'n';
-                        break;
-                }
-            }
-            b_order[def->os.nBootDevs] = '\0';
-            if ((dm_info->boot = strdup(b_order)) == NULL) {
-                virReportOOMError();
-                goto error;
-            }
-        }
-        if (def->serials &&
-            (libxlMakeChrdevStr(def->serials[0], &dm_info->serial) < 0))
-            goto error;
-    } else {
-        /* PV-specific device model info */
-        dm_info->type = XENPV;
-    }
-
-    /* Build qemu graphics options from previously parsed vfb */
-    if (d_config->num_vfbs > 0) {
-        if (d_config->vfbs[0].vnc) {
-            dm_info->vnc = 1;
-            /* driver handles selection of free port */
-            dm_info->vncunused = 0;
-            if (d_config->vfbs[0].vnclisten) {
-                VIR_FREE(dm_info->vnclisten);
-                if ((dm_info->vnclisten =
-                     strdup(d_config->vfbs[0].vnclisten)) == NULL) {
-                    virReportOOMError();
-                    goto error;
-                }
-            }
-            if (d_config->vfbs[0].keymap &&
-                (dm_info->keymap = strdup(d_config->vfbs[0].keymap)) == NULL) {
-                virReportOOMError();
-                goto error;
-            }
-            dm_info->vncdisplay = d_config->vfbs[0].vncdisplay;
-            if (d_config->vfbs[0].vncpasswd &&
-                (dm_info->vncpasswd =
-                 strdup(d_config->vfbs[0].vncpasswd)) == NULL) {
-                virReportOOMError();
-                goto error;
-            }
-        } else if (d_config->vfbs[0].sdl) {
-            dm_info->sdl = 1;
-            dm_info->vnc = 0;
-        }
-    } else if (d_config->num_vfbs == 0) {
-        dm_info->nographic = 1;
-        dm_info->vnc = 0;
-    }
-
-    // TODO
-    //dm_info->usb = ;
-    //dm_info->usbdevice = ;
-    //dm_info->soundhw = ;
-
-    return 0;
-
-error:
-    libxl_device_model_info_destroy(dm_info);
-    return -1;
-}
-
 virCapsPtr
 libxlMakeCapabilities(libxl_ctx *ctx)
 {
@@ -947,7 +881,7 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
                        virDomainDefPtr def, libxl_domain_config *d_config)
 {
 
-    if (libxlMakeDomCreateInfo(def, &d_config->c_info) < 0)
+    if (libxlMakeDomCreateInfo(driver, def, &d_config->c_info) < 0)
         return -1;
 
     if (libxlMakeDomBuildInfo(def, d_config) < 0) {
@@ -966,10 +900,6 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
         goto error;
     }
 
-    if (libxlMakeDeviceModelInfo(def, d_config) < 0) {
-        goto error;
-    }
-
     d_config->on_reboot = def->onReboot;
     d_config->on_poweroff = def->onPoweroff;
     d_config->on_crash = def->onCrash;
@@ -977,6 +907,6 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
     return 0;
 
 error:
-    libxl_domain_config_destroy(d_config);
+    libxl_domain_config_dispose(d_config);
     return -1;
 }
diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
index 56bf85c..ea62b68 100644
--- a/src/libxl/libxl_conf.h
+++ b/src/libxl/libxl_conf.h
@@ -37,6 +37,7 @@
 # include "bitmap.h"
 
 
+# define LIBXL_MAXVCPUS      128
 # define LIBXL_VNC_PORT_MIN  5900
 # define LIBXL_VNC_PORT_MAX  65535
 
@@ -58,7 +59,7 @@ struct _libxlDriverPrivate {
     FILE *logger_file;
     xentoollog_logger *logger;
     /* libxl ctx for driver wide ops; getVersion, getNodeInfo, ... */
-    libxl_ctx ctx;
+    libxl_ctx *ctx;
 
     virBitmapPtr reservedVNCPorts;
     virDomainObjList domains;
@@ -77,10 +78,8 @@ typedef struct _libxlDomainObjPrivate libxlDomainObjPrivate;
 typedef libxlDomainObjPrivate *libxlDomainObjPrivatePtr;
 struct _libxlDomainObjPrivate {
     /* per domain libxl ctx */
-    libxl_ctx ctx;
-    libxl_waiter *dWaiter;
-    int waiterFD;
-    int eventHdl;
+    libxl_ctx *ctx;
+    libxl_evgen_domain_death *deathW;
 };
 
 # define LIBXL_SAVE_MAGIC "libvirt-xml\n \0 \r"
@@ -100,13 +99,11 @@ virCapsPtr
 libxlMakeCapabilities(libxl_ctx *ctx);
 
 int
-libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_dev,
-              libxl_device_disk *x_dev);
+libxlMakeDisk(virDomainDiskDefPtr l_dev, libxl_device_disk *x_dev);
 int
-libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
-             libxl_device_nic *x_nic);
+libxlMakeNic(virDomainNetDefPtr l_nic, libxl_device_nic *x_nic);
 int
-libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
+libxlMakeVfb(libxlDriverPrivatePtr driver,
              virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb);
 
 int
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index bc75730..f15129f 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -40,6 +40,7 @@
 #include "memory.h"
 #include "uuid.h"
 #include "command.h"
+#include "libxl.h"
 #include "libxl_driver.h"
 #include "libxl_conf.h"
 #include "xen_xm.h"
@@ -59,6 +60,19 @@
 /* Number of Xen scheduler parameters */
 #define XEN_SCHED_CREDIT_NPARAM   2
 
+struct libxlOSEventHookFDInfo {
+    libxlDomainObjPrivatePtr priv;
+    void *xl_priv;
+    int watch;
+};
+
+struct libxlOSEventHookTimerInfo {
+    libxlDomainObjPrivatePtr priv;
+    void *xl_priv;
+    int id;
+};
+
+
 static void libxlDomainManagedSaveLoad(void *payload,
                                        const void *n ATTRIBUTE_UNUSED,
                                        void *opaque);
@@ -84,6 +98,163 @@ libxlDriverUnlock(libxlDriverPrivatePtr driver)
     virMutexUnlock(&driver->lock);
 }
 
+
+static void libxlFDEventCallback(int watch ATTRIBUTE_UNUSED,
+                                 int fd,
+                                 int vir_events,
+                                 void *fdinfo)
+{
+    struct libxlOSEventHookFDInfo *info = fdinfo;
+    int events = 0;
+
+    if (vir_events & VIR_EVENT_HANDLE_READABLE)
+        events |= POLLIN;
+    if (vir_events & VIR_EVENT_HANDLE_WRITABLE)
+        events |= POLLOUT;
+    if (vir_events & VIR_EVENT_HANDLE_ERROR)
+        events |= POLLERR;
+    if (vir_events & VIR_EVENT_HANDLE_HANGUP)
+        events |= POLLHUP;
+
+    libxl_osevent_occurred_fd(info->priv->ctx, info->xl_priv, fd, 0, events);
+}
+
+static void libxlFreeFDInfo(void *obj)
+{
+    VIR_FREE(obj);
+}
+
+static int libxlFDRegisterEventHook(void *priv, int fd, void **hndp,
+                                    short events, void *xl_priv)
+{
+    int vir_events = VIR_EVENT_HANDLE_ERROR;
+    struct libxlOSEventHookFDInfo *fdinfo;
+
+    if (VIR_ALLOC(fdinfo) < 0) {
+        virReportOOMError();
+        return -1;
+    }
+
+    fdinfo->priv = priv;
+    fdinfo->xl_priv = xl_priv;
+    *hndp = fdinfo;
+
+    if (events & POLLIN)
+        vir_events |= VIR_EVENT_HANDLE_READABLE;
+    if (events & POLLOUT)
+        vir_events |= VIR_EVENT_HANDLE_WRITABLE;
+    fdinfo->watch = virEventAddHandle(fd, vir_events, libxlFDEventCallback,
+                                      fdinfo, libxlFreeFDInfo);
+    if (fdinfo->watch < 0) {
+        VIR_FREE(fdinfo);
+        return fdinfo->watch;
+    }
+
+    return 0;
+}
+
+static int libxlFDModifyEventHook(void *priv ATTRIBUTE_UNUSED,
+                                  int fd ATTRIBUTE_UNUSED,
+                                  void **hndp,
+                                  short events)
+{
+    struct libxlOSEventHookFDInfo *fdinfo = *hndp;
+    int vir_events = VIR_EVENT_HANDLE_ERROR;
+
+    if (events & POLLIN)
+        vir_events |= VIR_EVENT_HANDLE_READABLE;
+    if (events & POLLOUT)
+        vir_events |= VIR_EVENT_HANDLE_WRITABLE;
+
+    virEventUpdateHandle(fdinfo->watch, vir_events);
+    return 0;
+}
+
+static void libxlFDDeregisterEventHook(void *priv ATTRIBUTE_UNUSED,
+                                       int fd ATTRIBUTE_UNUSED,
+                                       void *hnd)
+{
+    struct libxlOSEventHookFDInfo *fdinfo = hnd;
+
+    virEventRemoveHandle(fdinfo->watch);
+}
+
+
+static void libxlTimerCallback(int timer ATTRIBUTE_UNUSED, void *timer_v)
+{
+    struct libxlOSEventHookTimerInfo *timer_info = timer_v;
+
+    libxl_osevent_occurred_timeout(timer_info->priv->ctx, timer_info->xl_priv);
+}
+
+static void libxlTimerInfoFree(void* obj)
+{
+    VIR_FREE(obj);
+}
+
+static int libxlTimeoutRegisterEventHook(void *priv,
+                                         void **hndp,
+                                         struct timeval abs_t,
+                                         void *for_libxl)
+{
+    struct timeval now;
+    struct libxlOSEventHookTimerInfo *timer_info;
+    int timeout, timer_id;
+
+    if (VIR_ALLOC(timer_info) < 0) {
+        virReportOOMError();
+        return -1;
+    }
+
+    gettimeofday(&now, NULL);
+    timeout = (abs_t.tv_usec - now.tv_usec) / 1000;
+    timeout += (abs_t.tv_sec - now.tv_sec) * 1000;
+    timer_id = virEventAddTimeout(timeout, libxlTimerCallback,
+                                  timer_info, libxlTimerInfoFree);
+    if (timer_id < 0) {
+        VIR_FREE(timer_info);
+        return timer_id;
+    }
+
+    timer_info->priv = priv;
+    timer_info->xl_priv = for_libxl;
+    timer_info->id = timer_id;
+    *hndp = timer_info;
+    return 0;
+}
+
+static int libxlTimeoutModifyEventHook(void *priv ATTRIBUTE_UNUSED,
+                                       void **hndp,
+                                       struct timeval abs_t)
+{
+    struct timeval now;
+    int timeout;
+    struct libxlOSEventHookTimerInfo *timer_info = *hndp;
+
+    gettimeofday(&now, NULL);
+    timeout = (abs_t.tv_usec - now.tv_usec) / 1000;
+    timeout += (abs_t.tv_sec - now.tv_sec) * 1000;
+    virEventUpdateTimeout(timer_info->id, timeout);
+    return 0;
+}
+
+static void libxlTimeoutDeregisterEventHook(void *priv ATTRIBUTE_UNUSED,
+                                            void *hnd)
+{
+    struct libxlOSEventHookTimerInfo *timer_info = hnd;
+
+    virEventRemoveTimeout(timer_info->id);
+}
+
+static const libxl_osevent_hooks libxl_event_callbacks = {
+    .fd_register = libxlFDRegisterEventHook,
+    .fd_modify = libxlFDModifyEventHook,
+    .fd_deregister = libxlFDDeregisterEventHook,
+    .timeout_register = libxlTimeoutRegisterEventHook,
+    .timeout_modify = libxlTimeoutModifyEventHook,
+    .timeout_deregister = libxlTimeoutDeregisterEventHook,
+};
+
 static void *
 libxlDomainObjPrivateAlloc(void)
 {
@@ -92,9 +263,9 @@ libxlDomainObjPrivateAlloc(void)
     if (VIR_ALLOC(priv) < 0)
         return NULL;
 
-    libxl_ctx_init(&priv->ctx, LIBXL_VERSION, libxl_driver->logger);
-    priv->waiterFD = -1;
-    priv->eventHdl = -1;
+    libxl_ctx_alloc(&priv->ctx, LIBXL_VERSION, 0, libxl_driver->logger);
+    priv->deathW = NULL;
+    libxl_osevent_register_hooks(priv->ctx, &libxl_event_callbacks, priv);
 
     return priv;
 }
@@ -104,16 +275,12 @@ libxlDomainObjPrivateFree(void *data)
 {
     libxlDomainObjPrivatePtr priv = data;
 
-    if (priv->eventHdl >= 0)
-        virEventRemoveHandle(priv->eventHdl);
-
-    if (priv->dWaiter) {
-        libxl_stop_waiting(&priv->ctx, priv->dWaiter);
-        libxl_free_waiter(priv->dWaiter);
-        VIR_FREE(priv->dWaiter);
+    if (priv->deathW) {
+        libxl_evdisable_domain_death(priv->ctx, priv->deathW);
+        VIR_FREE(priv->deathW);
     }
 
-    libxl_ctx_free(&priv->ctx);
+    libxl_ctx_free(priv->ctx);
     VIR_FREE(priv);
 }
 
@@ -125,17 +292,6 @@ libxlDomainEventQueue(libxlDriverPrivatePtr driver, virDomainEventPtr event)
     virDomainEventStateQueue(driver->domainEventState, event);
 }
 
-/*
- * Remove reference to domain object.
- */
-static void
-libxlDomainObjUnref(void *data)
-{
-    virDomainObjPtr vm = data;
-
-    virObjectUnref(vm);
-}
-
 static void
 libxlAutostartDomain(void *payload, const void *name ATTRIBUTE_UNUSED,
                      void *opaque)
@@ -166,13 +322,13 @@ libxlDoNodeGetInfo(libxlDriverPrivatePtr driver, virNodeInfoPtr info)
     const libxl_version_info* ver_info;
     struct utsname utsname;
 
-    if (libxl_get_physinfo(&driver->ctx, &phy_info)) {
+    if (libxl_get_physinfo(driver->ctx, &phy_info)) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxl_get_physinfo_info failed"));
         return -1;
     }
 
-    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxl_get_version_info failed"));
         return -1;
@@ -296,15 +452,9 @@ libxlVmCleanup(libxlDriverPrivatePtr driver,
     char *file;
     int i;
 
-    if (priv->eventHdl >= 0) {
-        virEventRemoveHandle(priv->eventHdl);
-        priv->eventHdl = -1;
-    }
-
-    if (priv->dWaiter) {
-        libxl_stop_waiting(&priv->ctx, priv->dWaiter);
-        libxl_free_waiter(priv->dWaiter);
-        VIR_FREE(priv->dWaiter);
+    if (priv->deathW) {
+        libxl_evdisable_domain_death(priv->ctx, priv->deathW);
+        priv->deathW = NULL;
     }
 
     if (vm->persistent) {
@@ -355,12 +505,11 @@ libxlVmCleanup(libxlDriverPrivatePtr driver,
 static int
 libxlVmReap(libxlDriverPrivatePtr driver,
             virDomainObjPtr vm,
-            int force,
             virDomainShutoffReason reason)
 {
     libxlDomainObjPrivatePtr priv = vm->privateData;
 
-    if (libxl_domain_destroy(&priv->ctx, vm->def->id, force) < 0) {
+    if (libxl_domain_destroy(priv->ctx, vm->def->id, NULL) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Unable to cleanup domain %d"), vm->def->id);
         return -1;
@@ -373,56 +522,26 @@ libxlVmReap(libxlDriverPrivatePtr driver,
 /*
  * Handle previously registered event notification from libxenlight
  */
-static void libxlEventHandler(int watch,
-                              int fd,
-                              int events,
-                              void *data)
+static void libxlEventHandler(void *data, const libxl_event *event)
 {
     libxlDriverPrivatePtr driver = libxl_driver;
     virDomainObjPtr vm = data;
-    libxlDomainObjPrivatePtr priv;
     virDomainEventPtr dom_event = NULL;
-    libxl_event event;
-    libxl_dominfo info;
 
     libxlDriverLock(driver);
     virDomainObjLock(vm);
     libxlDriverUnlock(driver);
 
-    priv = vm->privateData;
-
-    memset(&event, 0, sizeof(event));
-    memset(&info, 0, sizeof(info));
-
-    if (priv->waiterFD != fd || priv->eventHdl != watch) {
-        virEventRemoveHandle(watch);
-        priv->eventHdl = -1;
-        goto cleanup;
-    }
-
-    if (!(events & VIR_EVENT_HANDLE_READABLE))
-        goto cleanup;
-
-    if (libxl_get_event(&priv->ctx, &event))
-        goto cleanup;
-
-    if (event.type == LIBXL_EVENT_DOMAIN_DEATH) {
+    if (event->type == LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN) {
         virDomainShutoffReason reason;
 
-        /* libxl_event_get_domain_death_info returns 1 if death
-         * event was for this domid */
-        if (libxl_event_get_domain_death_info(&priv->ctx,
-                                              vm->def->id,
-                                              &event,
-                                              &info) != 1)
+        if (event->domid != vm->def->id)
             goto cleanup;
 
-        virEventRemoveHandle(watch);
-        priv->eventHdl = -1;
-        switch (info.shutdown_reason) {
-            case SHUTDOWN_poweroff:
-            case SHUTDOWN_crash:
-                if (info.shutdown_reason == SHUTDOWN_crash) {
+        switch (event->u.domain_shutdown.shutdown_reason) {
+            case LIBXL_SHUTDOWN_REASON_POWEROFF:
+            case LIBXL_SHUTDOWN_REASON_CRASH:
+                if (event->u.domain_shutdown.shutdown_reason == LIBXL_SHUTDOWN_REASON_CRASH) {
                     dom_event = virDomainEventNewFromObj(vm,
                                               VIR_DOMAIN_EVENT_STOPPED,
                                               VIR_DOMAIN_EVENT_STOPPED_CRASHED);
@@ -430,18 +549,18 @@ static void libxlEventHandler(int watch,
                 } else {
                     reason = VIR_DOMAIN_SHUTOFF_SHUTDOWN;
                 }
-                libxlVmReap(driver, vm, 0, reason);
+                libxlVmReap(driver, vm, reason);
                 if (!vm->persistent) {
                     virDomainRemoveInactive(&driver->domains, vm);
                     vm = NULL;
                 }
                 break;
-            case SHUTDOWN_reboot:
-                libxlVmReap(driver, vm, 0, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
+            case LIBXL_SHUTDOWN_REASON_REBOOT:
+                libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
                 libxlVmStart(driver, vm, 0, -1);
                 break;
             default:
-                VIR_INFO("Unhandled shutdown_reason %d", info.shutdown_reason);
+                VIR_INFO("Unhandled shutdown_reason %d", event->u.domain_shutdown.shutdown_reason);
                 break;
         }
     }
@@ -454,9 +573,14 @@ cleanup:
         libxlDomainEventQueue(driver, dom_event);
         libxlDriverUnlock(driver);
     }
-    libxl_free_event(&event);
 }
 
+static const struct libxl_event_hooks ev_hooks = {
+    .event_occurs_mask = LIBXL_EVENTMASK_ALL,
+    .event_occurs = libxlEventHandler,
+    .disaster = NULL,
+};
+
 /*
  * Register domain events with libxenlight and insert event handles
  * in libvirt's event loop.
@@ -465,40 +589,18 @@ static int
 libxlCreateDomEvents(virDomainObjPtr vm)
 {
     libxlDomainObjPrivatePtr priv = vm->privateData;
-    int fd;
 
-    if (VIR_ALLOC(priv->dWaiter) < 0) {
-        virReportOOMError();
-        return -1;
-    }
-
-    if (libxl_wait_for_domain_death(&priv->ctx, vm->def->id, priv->dWaiter))
-        goto error;
-
-    libxl_get_wait_fd(&priv->ctx, &fd);
-    if (fd < 0)
-        goto error;
+    libxl_event_register_callbacks(priv->ctx, &ev_hooks, vm);
 
-    priv->waiterFD = fd;
-    /* Add a reference to the domain object while it is injected in
-     * the event loop.
-     */
-    virObjectRef(vm);
-    if ((priv->eventHdl = virEventAddHandle(
-             fd,
-             VIR_EVENT_HANDLE_READABLE | VIR_EVENT_HANDLE_ERROR,
-             libxlEventHandler,
-             vm, libxlDomainObjUnref)) < 0) {
-        virObjectUnref(vm);
+    if (libxl_evenable_domain_death(priv->ctx, vm->def->id, 0, &priv->deathW))
         goto error;
-    }
 
     return 0;
 
 error:
-    libxl_free_waiter(priv->dWaiter);
-    VIR_FREE(priv->dWaiter);
-    priv->eventHdl = -1;
+    if (priv->deathW)
+        libxl_evdisable_domain_death(priv->ctx, priv->deathW);
+    VIR_FREE(priv->deathW);
     return -1;
 }
 
@@ -507,7 +609,7 @@ libxlDomainSetVcpuAffinites(libxlDriverPrivatePtr driver, virDomainObjPtr vm)
 {
     libxlDomainObjPrivatePtr priv = vm->privateData;
     virDomainDefPtr def = vm->def;
-    libxl_cpumap map;
+    libxl_bitmap map;
     uint8_t *cpumask = NULL;
     uint8_t *cpumap = NULL;
     virNodeInfo nodeinfo;
@@ -539,7 +641,7 @@ libxlDomainSetVcpuAffinites(libxlDriverPrivatePtr driver, virDomainObjPtr vm)
         map.size = cpumaplen;
         map.map = cpumap;
 
-        if (libxl_set_vcpuaffinity(&priv->ctx, def->id, vcpu, &map) != 0) {
+        if (libxl_set_vcpuaffinity(priv->ctx, def->id, vcpu, &map) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to pin vcpu '%d' with libxenlight"), vcpu);
             goto cleanup;
@@ -565,11 +667,10 @@ libxlFreeMem(libxlDomainObjPrivatePtr priv, libxl_domain_config *d_config)
     int tries = 3;
     int wait_secs = 10;
 
-    if ((ret = libxl_domain_need_memory(&priv->ctx, &d_config->b_info,
-                                        &d_config->dm_info,
+    if ((ret = libxl_domain_need_memory(priv->ctx, &d_config->b_info,
                                         &needed_mem)) >= 0) {
         for (i = 0; i < tries; ++i) {
-            if ((ret = libxl_get_free_memory(&priv->ctx, &free_mem)) < 0)
+            if ((ret = libxl_get_free_memory(priv->ctx, &free_mem)) < 0)
                 break;
 
             if (free_mem >= needed_mem) {
@@ -577,17 +678,17 @@ libxlFreeMem(libxlDomainObjPrivatePtr priv, libxl_domain_config *d_config)
                 break;
             }
 
-            if ((ret = libxl_set_memory_target(&priv->ctx, 0,
+            if ((ret = libxl_set_memory_target(priv->ctx, 0,
                                                free_mem - needed_mem,
                                                /* relative */ 1, 0)) < 0)
                 break;
 
-            ret = libxl_wait_for_free_memory(&priv->ctx, 0, needed_mem,
+            ret = libxl_wait_for_free_memory(priv->ctx, 0, needed_mem,
                                              wait_secs);
             if (ret == 0 || ret != ERROR_NOMEM)
                 break;
 
-            if ((ret = libxl_wait_for_memory_target(&priv->ctx, 0, 1)) < 0)
+            if ((ret = libxl_wait_for_memory_target(priv->ctx, 0, 1)) < 0)
                 break;
         }
     }
@@ -613,7 +714,6 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
     char *dom_xml = NULL;
     char *managed_save_path = NULL;
     int managed_save_fd = -1;
-    pid_t child_console_pid = -1;
     libxlDomainObjPrivatePtr priv = vm->privateData;
 
     /* If there is a managed saved state restore it instead of starting
@@ -657,7 +757,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         VIR_FREE(managed_save_path);
     }
 
-    memset(&d_config, 0, sizeof(d_config));
+    libxl_domain_config_init(&d_config);
 
     if (libxlBuildDomainConfig(driver, vm->def, &d_config) < 0)
         return -1;
@@ -669,13 +769,14 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         goto error;
     }
 
+    /* use as synchronous operations => ao_how = NULL and no intermediate reports => ao_progress = NULL */
+
     if (restore_fd < 0)
-        ret = libxl_domain_create_new(&priv->ctx, &d_config,
-                                      NULL, &child_console_pid, &domid);
+        ret = libxl_domain_create_new(priv->ctx, &d_config,
+                                      &domid, NULL, NULL);
     else
-        ret = libxl_domain_create_restore(&priv->ctx, &d_config, NULL,
-                                          &child_console_pid, &domid,
-                                          restore_fd);
+        ret = libxl_domain_create_restore(priv->ctx, &d_config, &domid,
+                                          restore_fd, NULL, NULL);
 
     if (ret) {
         if (restore_fd < 0)
@@ -693,7 +794,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
     if ((dom_xml = virDomainDefFormat(vm->def, 0)) == NULL)
         goto error;
 
-    if (libxl_userdata_store(&priv->ctx, domid, "libvirt-xml",
+    if (libxl_userdata_store(priv->ctx, domid, "libvirt-xml",
                              (uint8_t *)dom_xml, strlen(dom_xml) + 1)) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxenlight failed to store userdata"));
@@ -707,7 +808,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         goto error;
 
     if (!start_paused) {
-        libxl_domain_unpause(&priv->ctx, domid);
+        libxl_domain_unpause(priv->ctx, domid);
         virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_BOOTED);
     } else {
         virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER);
@@ -723,18 +824,18 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
                                          VIR_DOMAIN_EVENT_STARTED_RESTORED);
     libxlDomainEventQueue(driver, event);
 
-    libxl_domain_config_destroy(&d_config);
+    libxl_domain_config_dispose(&d_config);
     VIR_FREE(dom_xml);
     VIR_FORCE_CLOSE(managed_save_fd);
     return 0;
 
 error:
     if (domid > 0) {
-        libxl_domain_destroy(&priv->ctx, domid, 0);
+        libxl_domain_destroy(priv->ctx, domid, NULL);
         vm->def->id = -1;
         virDomainObjSetState(vm, VIR_DOMAIN_SHUTOFF, VIR_DOMAIN_SHUTOFF_FAILED);
     }
-    libxl_domain_config_destroy(&d_config);
+    libxl_domain_config_dispose(&d_config);
     VIR_FREE(dom_xml);
     VIR_FREE(managed_save_path);
     virDomainDefFree(def);
@@ -762,7 +863,7 @@ libxlReconnectDomain(void *payload,
     virDomainObjLock(vm);
 
     /* Does domain still exist? */
-    rc = libxl_domain_info(&driver->ctx, &d_info, vm->def->id);
+    rc = libxl_domain_info(driver->ctx, &d_info, vm->def->id);
     if (rc == ERROR_INVAL) {
         goto out;
     } else if (rc != 0) {
@@ -772,7 +873,7 @@ libxlReconnectDomain(void *payload,
     }
 
     /* Is this a domain that was under libvirt control? */
-    if (libxl_userdata_retrieve(&driver->ctx, vm->def->id,
+    if (libxl_userdata_retrieve(driver->ctx, vm->def->id,
                                 "libvirt-xml", &data, &len)) {
         VIR_DEBUG("libxl_userdata_retrieve failed, ignoring domain %d", vm->def->id);
         goto out;
@@ -810,7 +911,7 @@ libxlShutdown(void)
     libxlDriverLock(libxl_driver);
     virCapabilitiesFree(libxl_driver->caps);
     virDomainObjListDeinit(&libxl_driver->domains);
-    libxl_ctx_free(&libxl_driver->ctx);
+    libxl_ctx_free(libxl_driver->ctx);
     xtl_logger_destroy(libxl_driver->logger);
     if (libxl_driver->logger_file)
         VIR_FORCE_FCLOSE(libxl_driver->logger_file);
@@ -943,14 +1044,14 @@ libxlStartup(int privileged) {
         goto fail;
     }
 
-    if (libxl_ctx_init(&libxl_driver->ctx,
-                       LIBXL_VERSION,
+    if (libxl_ctx_alloc(&libxl_driver->ctx,
+                       LIBXL_VERSION, 0,
                        libxl_driver->logger)) {
         VIR_INFO("cannot initialize libxenlight context, probably not running in a Xen Dom0, disabling driver");
         goto fail;
     }
 
-    if ((ver_info = libxl_get_version_info(&libxl_driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(libxl_driver->ctx)) == NULL) {
         VIR_INFO("cannot version information from libxenlight, disabling driver");
         goto fail;
     }
@@ -958,7 +1059,7 @@ libxlStartup(int privileged) {
             (ver_info->xen_version_minor * 1000);
 
     if ((libxl_driver->caps =
-         libxlMakeCapabilities(&libxl_driver->ctx)) == NULL) {
+         libxlMakeCapabilities(libxl_driver->ctx)) == NULL) {
         VIR_ERROR(_("cannot create capabilities for libxenlight"));
         goto error;
     }
@@ -1115,7 +1216,7 @@ libxlGetMaxVcpus(virConnectPtr conn, const char *type ATTRIBUTE_UNUSED)
     int ret;
     libxlDriverPrivatePtr driver = conn->privateData;
 
-    ret = libxl_get_max_cpus(&driver->ctx);
+    ret = libxl_get_max_cpus(driver->ctx);
     /* libxl_get_max_cpus() will return 0 if there were any failures,
        e.g. xc_physinfo() failing */
     if (ret == 0)
@@ -1320,7 +1421,7 @@ libxlDomainSuspend(virDomainPtr dom)
     priv = vm->privateData;
 
     if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_PAUSED) {
-        if (libxl_domain_pause(&priv->ctx, dom->id) != 0) {
+        if (libxl_domain_pause(priv->ctx, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to suspend domain '%d' with libxenlight"),
                            dom->id);
@@ -1379,7 +1480,7 @@ libxlDomainResume(virDomainPtr dom)
     priv = vm->privateData;
 
     if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
-        if (libxl_domain_unpause(&priv->ctx, dom->id) != 0) {
+        if (libxl_domain_unpause(priv->ctx, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to resume domain '%d' with libxenlight"),
                            dom->id);
@@ -1436,7 +1537,7 @@ libxlDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
     }
 
     priv = vm->privateData;
-    if (libxl_domain_shutdown(&priv->ctx, dom->id, LIBXL_DOM_REQ_POWEROFF) != 0) {
+    if (libxl_domain_shutdown(priv->ctx, dom->id) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to shutdown domain '%d' with libxenlight"),
                        dom->id);
@@ -1489,7 +1590,7 @@ libxlDomainReboot(virDomainPtr dom, unsigned int flags)
     }
 
     priv = vm->privateData;
-    if (libxl_domain_shutdown(&priv->ctx, dom->id, LIBXL_DOM_REQ_REBOOT) != 0) {
+    if (libxl_domain_reboot(priv->ctx, dom->id) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to reboot domain '%d' with libxenlight"),
                        dom->id);
@@ -1534,7 +1635,7 @@ libxlDomainDestroyFlags(virDomainPtr dom,
     event = virDomainEventNewFromObj(vm,VIR_DOMAIN_EVENT_STOPPED,
                                      VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
 
-    if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_DESTROYED) != 0) {
+    if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to destroy domain '%d'"), dom->id);
         goto cleanup;
@@ -1672,7 +1773,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
 
         if (flags & VIR_DOMAIN_MEM_LIVE) {
             priv = vm->privateData;
-            if (libxl_domain_setmaxmem(&priv->ctx, dom->id, newmem) < 0) {
+            if (libxl_domain_setmaxmem(priv->ctx, dom->id, newmem) < 0) {
                 virReportError(VIR_ERR_INTERNAL_ERROR,
                                _("Failed to set maximum memory for domain '%d'"
                                  " with libxenlight"), dom->id);
@@ -1701,7 +1802,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
 
         if (flags & VIR_DOMAIN_MEM_LIVE) {
             priv = vm->privateData;
-            if (libxl_set_memory_target(&priv->ctx, dom->id, newmem, 0,
+            if (libxl_set_memory_target(priv->ctx, dom->id, newmem, 0,
                                         /* force */ 1) < 0) {
                 virReportError(VIR_ERR_INTERNAL_ERROR,
                                _("Failed to set memory for domain '%d'"
@@ -1761,7 +1862,7 @@ libxlDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info)
         info->memory = vm->def->mem.cur_balloon;
         info->maxMem = vm->def->mem.max_balloon;
     } else {
-        if (libxl_domain_info(&driver->ctx, &d_info, dom->id) != 0) {
+        if (libxl_domain_info(driver->ctx, &d_info, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("libxl_domain_info failed for domain '%d'"), dom->id);
             goto cleanup;
@@ -1861,7 +1962,7 @@ libxlDoDomainSave(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         goto cleanup;
     }
 
-    if (libxl_domain_suspend(&priv->ctx, NULL, vm->def->id, fd) != 0) {
+    if (libxl_domain_suspend(priv->ctx, vm->def->id, fd, 0, NULL) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to save domain '%d' with libxenlight"),
                        vm->def->id);
@@ -1871,7 +1972,7 @@ libxlDoDomainSave(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
     event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
                                          VIR_DOMAIN_EVENT_STOPPED_SAVED);
 
-    if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_SAVED) != 0) {
+    if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_SAVED) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to destroy domain '%d'"), vm->def->id);
         goto cleanup;
@@ -2028,7 +2129,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
 
     if (!(flags & VIR_DUMP_LIVE) &&
         virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
-        if (libxl_domain_pause(&priv->ctx, dom->id) != 0) {
+        if (libxl_domain_pause(priv->ctx, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Before dumping core, failed to suspend domain '%d'"
                              " with libxenlight"),
@@ -2039,7 +2140,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
         paused = true;
     }
 
-    if (libxl_domain_core_dump(&priv->ctx, dom->id, to) != 0) {
+    if (libxl_domain_core_dump(priv->ctx, dom->id, to, NULL) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to dump core of domain '%d' with libxenlight"),
                        dom->id);
@@ -2048,7 +2149,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
 
     libxlDriverLock(driver);
     if (flags & VIR_DUMP_CRASH) {
-        if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_CRASHED) != 0) {
+        if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_CRASHED) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to destroy domain '%d'"), dom->id);
             goto cleanup_unlock;
@@ -2069,7 +2170,7 @@ cleanup_unlock:
     libxlDriverUnlock(driver);
 cleanup_unpause:
     if (virDomainObjIsActive(vm) && paused) {
-        if (libxl_domain_unpause(&priv->ctx, dom->id) != 0) {
+        if (libxl_domain_unpause(priv->ctx, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("After dumping core, failed to resume domain '%d' with"
                              " libxenlight"), dom->id);
@@ -2227,7 +2328,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
     libxlDomainObjPrivatePtr priv;
     virDomainDefPtr def;
     virDomainObjPtr vm;
-    libxl_cpumap map;
+    libxl_bitmap map;
     uint8_t *bitmask = NULL;
     unsigned int maplen;
     unsigned int i, pos;
@@ -2322,7 +2423,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
         break;
 
     case VIR_DOMAIN_VCPU_LIVE:
-        if (libxl_set_vcpuonline(&priv->ctx, dom->id, &map) != 0) {
+        if (libxl_set_vcpuonline(priv->ctx, dom->id, &map) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to set vcpus for domain '%d'"
                              " with libxenlight"), dom->id);
@@ -2331,7 +2432,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
         break;
 
     case VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG:
-        if (libxl_set_vcpuonline(&priv->ctx, dom->id, &map) != 0) {
+        if (libxl_set_vcpuonline(priv->ctx, dom->id, &map) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to set vcpus for domain '%d'"
                              " with libxenlight"), dom->id);
@@ -2427,7 +2528,7 @@ libxlDomainPinVcpu(virDomainPtr dom, unsigned int vcpu, unsigned char *cpumap,
     libxlDomainObjPrivatePtr priv;
     virDomainObjPtr vm;
     int ret = -1;
-    libxl_cpumap map;
+    libxl_bitmap map;
 
     libxlDriverLock(driver);
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
@@ -2448,7 +2549,7 @@ libxlDomainPinVcpu(virDomainPtr dom, unsigned int vcpu, unsigned char *cpumap,
 
     map.size = maplen;
     map.map = cpumap;
-    if (libxl_set_vcpuaffinity(&priv->ctx, dom->id, vcpu, &map) != 0) {
+    if (libxl_set_vcpuaffinity(priv->ctx, dom->id, vcpu, &map) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to pin vcpu '%d' with libxenlight"), vcpu);
         goto cleanup;
@@ -2511,7 +2612,7 @@ libxlDomainGetVcpus(virDomainPtr dom, virVcpuInfoPtr info, int maxinfo,
     }
 
     priv = vm->privateData;
-    if ((vcpuinfo = libxl_list_vcpu(&priv->ctx, dom->id, &maxcpu,
+    if ((vcpuinfo = libxl_list_vcpu(priv->ctx, dom->id, &maxcpu,
                                     &hostcpus)) == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to list vcpus for domain '%d' with libxenlight"),
@@ -2538,7 +2639,7 @@ libxlDomainGetVcpus(virDomainPtr dom, virVcpuInfoPtr info, int maxinfo,
                    MIN(maplen, vcpuinfo[i].cpumap.size));
         }
 
-        libxl_vcpuinfo_destroy(&vcpuinfo[i]);
+        libxl_vcpuinfo_dispose(&vcpuinfo[i]);
     }
     VIR_FREE(vcpuinfo);
 
@@ -2596,7 +2697,7 @@ libxlDomainXMLFromNative(virConnectPtr conn, const char * nativeFormat,
         goto cleanup;
     }
 
-    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
         VIR_ERROR(_("cannot get version information from libxenlight"));
         goto cleanup;
     }
@@ -2639,7 +2740,7 @@ libxlDomainXMLToNative(virConnectPtr conn, const char * nativeFormat,
         goto cleanup;
     }
 
-    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
         VIR_ERROR(_("cannot get version information from libxenlight"));
         goto cleanup;
     }
@@ -2899,10 +3000,10 @@ libxlDomainChangeEjectableMedia(libxlDomainObjPrivatePtr priv,
         return -1;
     }
 
-    if (libxlMakeDisk(vm->def, disk, &x_disk) < 0)
+    if (libxlMakeDisk(disk, &x_disk) < 0)
         goto cleanup;
 
-    if ((ret = libxl_cdrom_insert(&priv->ctx, vm->def->id, &x_disk)) < 0) {
+    if ((ret = libxl_cdrom_insert(priv->ctx, vm->def->id, &x_disk, NULL)) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("libxenlight failed to change media for disk '%s'"),
                        disk->dst);
@@ -2954,11 +3055,11 @@ libxlDomainAttachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
                     goto cleanup;
                 }
 
-                if (libxlMakeDisk(vm->def, l_disk, &x_disk) < 0)
+                if (libxlMakeDisk(l_disk, &x_disk) < 0)
                     goto cleanup;
 
-                if ((ret = libxl_device_disk_add(&priv->ctx, vm->def->id,
-                                                &x_disk)) < 0) {
+                if ((ret = libxl_device_disk_add(priv->ctx, vm->def->id,
+                                                &x_disk, NULL)) < 0) {
                     virReportError(VIR_ERR_INTERNAL_ERROR,
                                    _("libxenlight failed to attach disk '%s'"),
                                    l_disk->dst);
@@ -2991,7 +3092,6 @@ libxlDomainDetachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
     virDomainDiskDefPtr l_disk = NULL;
     libxl_device_disk x_disk;
     int i;
-    int wait_secs = 2;
     int ret = -1;
 
     switch (dev->data.disk->device)  {
@@ -3008,11 +3108,11 @@ libxlDomainDetachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
 
                 l_disk = vm->def->disks[i];
 
-                if (libxlMakeDisk(vm->def, l_disk, &x_disk) < 0)
+                if (libxlMakeDisk(l_disk, &x_disk) < 0)
                     goto cleanup;
 
-                if ((ret = libxl_device_disk_del(&priv->ctx, &x_disk,
-                                                 wait_secs)) < 0) {
+                if ((ret = libxl_device_disk_remove(priv->ctx, vm->def->id,
+                                                    &x_disk, NULL)) < 0) {
                     virReportError(VIR_ERR_INTERNAL_ERROR,
                                    _("libxenlight failed to detach disk '%s'"),
                                    l_disk->dst);
@@ -3383,13 +3483,13 @@ libxlNodeGetFreeMemory(virConnectPtr conn)
     const libxl_version_info* ver_info;
     libxlDriverPrivatePtr driver = conn->privateData;
 
-    if (libxl_get_physinfo(&driver->ctx, &phy_info)) {
+    if (libxl_get_physinfo(driver->ctx, &phy_info)) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxl_get_physinfo_info failed"));
         return 0;
     }
 
-    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxl_get_version_info failed"));
         return 0;
@@ -3536,7 +3636,7 @@ libxlDomainGetSchedulerType(virDomainPtr dom, int *nparams)
     libxlDomainObjPrivatePtr priv;
     virDomainObjPtr vm;
     char * ret = NULL;
-    int sched_id;
+    libxl_scheduler sched_id;
 
     libxlDriverLock(driver);
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
@@ -3553,31 +3653,29 @@ libxlDomainGetSchedulerType(virDomainPtr dom, int *nparams)
     }
 
     priv = vm->privateData;
-    if ((sched_id = libxl_get_sched_id(&priv->ctx)) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to get scheduler id for domain '%d'"
-                         " with libxenlight"), dom->id);
-        goto cleanup;
-    }
+    sched_id = libxl_get_scheduler(priv->ctx);
 
     if (nparams)
         *nparams = 0;
     switch (sched_id) {
-    case XEN_SCHEDULER_SEDF:
+    case LIBXL_SCHEDULER_SEDF:
         ret = strdup("sedf");
         break;
-    case XEN_SCHEDULER_CREDIT:
+    case LIBXL_SCHEDULER_CREDIT:
         ret = strdup("credit");
         if (nparams)
             *nparams = XEN_SCHED_CREDIT_NPARAM;
         break;
-    case XEN_SCHEDULER_CREDIT2:
+    case LIBXL_SCHEDULER_CREDIT2:
         ret = strdup("credit2");
         break;
-    case XEN_SCHEDULER_ARINC653:
+    case LIBXL_SCHEDULER_ARINC653:
         ret = strdup("arinc653");
         break;
     default:
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                   _("Failed to get scheduler id for domain '%d'"
+                     " with libxenlight"), dom->id);
         goto cleanup;
     }
 
@@ -3599,8 +3697,8 @@ libxlDomainGetSchedulerParametersFlags(virDomainPtr dom,
     libxlDriverPrivatePtr driver = dom->conn->privateData;
     libxlDomainObjPrivatePtr priv;
     virDomainObjPtr vm;
-    libxl_sched_credit sc_info;
-    int sched_id;
+    libxl_domain_sched_params sc_info;
+    libxl_scheduler sched_id;
     int ret = -1;
 
     virCheckFlags(0, -1);
@@ -3610,31 +3708,28 @@ libxlDomainGetSchedulerParametersFlags(virDomainPtr dom,
     libxlDriverUnlock(driver);
 
     if (!vm) {
-        virReportError(VIR_ERR_NO_DOMAIN, "%s", _("no domain with matching uuid"));
+        virReportError(VIR_ERR_NO_DOMAIN, "%s",
+                       _("no domain with matching uuid"));
         goto cleanup;
     }
 
     if (!virDomainObjIsActive(vm)) {
-        virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("Domain is not running"));
+        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+                       _("Domain is not running"));
         goto cleanup;
     }
 
     priv = vm->privateData;
 
-    if ((sched_id = libxl_get_sched_id(&priv->ctx)) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to get scheduler id for domain '%d'"
-                         " with libxenlight"), dom->id);
-        goto cleanup;
-    }
+    sched_id = libxl_get_scheduler(priv->ctx);
 
-    if (sched_id != XEN_SCHEDULER_CREDIT) {
+    if (sched_id != LIBXL_SCHEDULER_CREDIT) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("Only 'credit' scheduler is supported"));
         goto cleanup;
     }
 
-    if (libxl_sched_credit_domain_get(&priv->ctx, dom->id, &sc_info) != 0) {
+    if (libxl_domain_sched_params_get(priv->ctx, dom->id, &sc_info) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to get scheduler parameters for domain '%d'"
                          " with libxenlight"), dom->id);
@@ -3677,7 +3772,7 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
     libxlDriverPrivatePtr driver = dom->conn->privateData;
     libxlDomainObjPrivatePtr priv;
     virDomainObjPtr vm;
-    libxl_sched_credit sc_info;
+    libxl_domain_sched_params sc_info;
     int sched_id;
     int i;
     int ret = -1;
@@ -3707,20 +3802,15 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
 
     priv = vm->privateData;
 
-    if ((sched_id = libxl_get_sched_id(&priv->ctx)) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to get scheduler id for domain '%d'"
-                         " with libxenlight"), dom->id);
-        goto cleanup;
-    }
+    sched_id = libxl_get_scheduler(priv->ctx);
 
-    if (sched_id != XEN_SCHEDULER_CREDIT) {
+    if (sched_id != LIBXL_SCHEDULER_CREDIT) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("Only 'credit' scheduler is supported"));
         goto cleanup;
     }
 
-    if (libxl_sched_credit_domain_get(&priv->ctx, dom->id, &sc_info) != 0) {
+    if (libxl_domain_sched_params_get(priv->ctx, dom->id, &sc_info) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to get scheduler parameters for domain '%d'"
                          " with libxenlight"), dom->id);
@@ -3737,7 +3827,7 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
         }
     }
 
-    if (libxl_sched_credit_domain_set(&priv->ctx, dom->id, &sc_info) != 0) {
+    if (libxl_domain_sched_params_set(priv->ctx, dom->id, &sc_info) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to set scheduler parameters for domain '%d'"
                          " with libxenlight"), dom->id);
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 22:29:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 22:29:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td7At-0003tT-KS; Mon, 26 Nov 2012 22:29:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Td7As-0003tL-RU
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 22:29:10 +0000
Received: from [85.158.137.99:47170] by server-5.bemta-3.messagelabs.com id
	61/F2-26311-13DE3B05; Mon, 26 Nov 2012 22:29:05 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1353968943!20701884!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12030 invoked from network); 26 Nov 2012 22:29:03 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 22:29:03 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 19:43:40 +0000
Message-Id: <50B3AED502000078000AB530@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 17:03:01 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Sylvain Munaut" <s.munaut@whatever-company.com>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
	<CCD9450D.53691%keir@xen.org>
	<9efb590f-8c59-496b-97ea-8c39d77c203a@default>
	<CAF6-1L4++pq7nYVVHnOT-dV1tqPMFcJM1JVycMoKYBV6oehPJw@mail.gmail.com>
In-Reply-To: <CAF6-1L4++pq7nYVVHnOT-dV1tqPMFcJM1JVycMoKYBV6oehPJw@mail.gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>, Keir Fraser <keir@xen.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 17:51, Sylvain Munaut <s.munaut@whatever-company.com> wrote:
> I've just deployed this to a couple test servers that exhibited the problem.
> 
> What I don't really understand is why are some HW affected and not others ?

The multiplication is most likely to produce a zero upper half when
the multiplier is close to its smallest possible value (0x80000000);
as soon as the upper half is non-zero, chances shrink dramatically
for the warp value to be less than the current one.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 22:29:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 22:29:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td7At-0003tT-KS; Mon, 26 Nov 2012 22:29:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Td7As-0003tL-RU
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 22:29:10 +0000
Received: from [85.158.137.99:47170] by server-5.bemta-3.messagelabs.com id
	61/F2-26311-13DE3B05; Mon, 26 Nov 2012 22:29:05 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1353968943!20701884!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12030 invoked from network); 26 Nov 2012 22:29:03 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 22:29:03 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Mon, 26 Nov 2012 19:43:40 +0000
Message-Id: <50B3AED502000078000AB530@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Mon, 26 Nov 2012 17:03:01 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Sylvain Munaut" <s.munaut@whatever-company.com>
References: <50B3978F02000078000AB3A3@nat28.tlf.novell.com>
	<CCD9450D.53691%keir@xen.org>
	<9efb590f-8c59-496b-97ea-8c39d77c203a@default>
	<CAF6-1L4++pq7nYVVHnOT-dV1tqPMFcJM1JVycMoKYBV6oehPJw@mail.gmail.com>
In-Reply-To: <CAF6-1L4++pq7nYVVHnOT-dV1tqPMFcJM1JVycMoKYBV6oehPJw@mail.gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>, Keir Fraser <keir@xen.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] x86/time: fix scale_delta() inline assembly
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 17:51, Sylvain Munaut <s.munaut@whatever-company.com> wrote:
> I've just deployed this to a couple test servers that exhibited the problem.
> 
> What I don't really understand is why are some HW affected and not others ?

The multiplication is most likely to produce a zero upper half when
the multiplier is close to its smallest possible value (0x80000000);
as soon as the upper half is non-zero, chances shrink dramatically
for the warp value to be less than the current one.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 22:57:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 22:57:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td7bw-0004kc-Re; Mon, 26 Nov 2012 22:57:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ronny.hegewald@online.de>) id 1Td7bv-0004kV-Ob
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 22:57:07 +0000
Received: from [85.158.137.99:40210] by server-13.bemta-3.messagelabs.com id
	F9/D8-24887-EB3F3B05; Mon, 26 Nov 2012 22:57:02 +0000
X-Env-Sender: ronny.hegewald@online.de
X-Msg-Ref: server-13.tower-217.messagelabs.com!1353970621!20708640!1
X-Originating-IP: [212.227.126.187]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xODcgPT4gNzk4NzQ=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xODcgPT4gNzk4NzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6068 invoked from network); 26 Nov 2012 22:57:01 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.126.187)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 22:57:01 -0000
Received: from server2-groupware.localnet (kons-d9be1ecb.pool.mediaWays.net
	[217.190.30.203])
	by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis)
	id 0M9GoA-1TX33b0nl8-00C8Fy; Mon, 26 Nov 2012 23:57:01 +0100
From: Ronny Hegewald <ronny.hegewald@online.de>
To: xen-devel@lists.xen.org
Date: Mon, 26 Nov 2012 23:53:15 +0000
User-Agent: KMail/1.11.4 (Linux/3.0.3; KDE/4.2.4; i686; ; )
MIME-Version: 1.0
Content-Disposition: inline
Message-Id: <201211262353.15915.ronny.hegewald@online.de>
X-Provags-ID: V02:K0:s0qX8wJzZ5iGfAUiDmr+zSwNHkfrGLeL+3lyQSYtPVl
	8/V1/lpA6n5AVh2nFTOtWweb7JZQXdCoNGmughBIGCfrTkPg8L
	ymmnjs1pWvsPy/dM9H9sSUo/BqWDksqPjM7IuSLxibd37nOeq1
	eRKO99C5WErNMPWgqZdc3dlcJzIHBIcd3ZetCCftaw59G0c3t8
	OkflmWjpCt19j91IUNAvdX0YIq41LkL/WoJ2BGreUfghX7ItvV
	PTnoDLb/FAdJ/6wOpxpNlC7F+qbzvqe/WxrYgh0IPweSxriH8R
	T1sLknPuIi6Lju6cD46mSk+rZpC+hfgzICkVfZRgCNtBsbvPN+
	P9PaFYW9Y0KZDAF7bvtILR3ir6XiBaqkD3JkcO93d5nI9LMKGd
	c4blxnRNLKWSE3kwBIO6J8Vfaw5qCwtUBQ=
Subject: [Xen-devel] [PATCH V2] libxl: fix a variable underflow in
	libxl_wait_for_free_memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

When xl is called to create a domU and there is not enough memory available, 
then the autoballooning is called to extract memory from dom0. During the 
ballooning a loop in libxl_wait_for_free_memory() waits unless enough memory 
is available to create the domU. 

But because of a variable-underflow the loop can finish too soon and xl 
finally aborts with the message:


xc: error: panic: xc_dom_boot.c:161: xc_dom_boot_mem_init: can't allocate low 
memory for domain: Out of memory                         
libxl: error: libxl_dom.c:430:libxl__build_pv: xc_dom_boot_mem_init failed: 
Device or resource busy                                    
libxl: error: libxl_create.c:901:domcreate_rebuild_done: cannot (re-)build 
domain: -3        


The variable-underflow happens when freemem_slack is larger then 
info.free_pages*4, because the solution of this operation is converted 
implicit to a unsigned int to match the type of memory_kb.

Add a extra check for this condition to solve the problem.

---

Changes since V1:
  * check for valid ranges of freemem_slack instead of casting around values, 
    as suggested by Ian Campbell   


Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>

--- xen-4.3-20121121/tools/libxl/libxl.c.org	2012-11-22 03:34:00.000000000 
+0000
+++ xen-4.3-20121121/tools/libxl/libxl.c	2012-11-26 21:29:42.000000000 +0000
@@ -3763,7 +3763,8 @@ int libxl_wait_for_free_memory(libxl_ctx
         rc = libxl_get_physinfo(ctx, &info);
         if (rc < 0)
             goto out;
-        if (info.free_pages * 4 - freemem_slack >= memory_kb) {
+        if (info.free_pages * 4 >= freemem_slack && 
+            info.free_pages * 4 - freemem_slack >= memory_kb) {
             rc = 0;
             goto out;
         }




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 22:57:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 22:57:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td7bw-0004kc-Re; Mon, 26 Nov 2012 22:57:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ronny.hegewald@online.de>) id 1Td7bv-0004kV-Ob
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 22:57:07 +0000
Received: from [85.158.137.99:40210] by server-13.bemta-3.messagelabs.com id
	F9/D8-24887-EB3F3B05; Mon, 26 Nov 2012 22:57:02 +0000
X-Env-Sender: ronny.hegewald@online.de
X-Msg-Ref: server-13.tower-217.messagelabs.com!1353970621!20708640!1
X-Originating-IP: [212.227.126.187]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xODcgPT4gNzk4NzQ=\n,sa_preprocessor: 
	QmFkIElQOiAyMTIuMjI3LjEyNi4xODcgPT4gNzk4NzQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6068 invoked from network); 26 Nov 2012 22:57:01 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de)
	(212.227.126.187)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 22:57:01 -0000
Received: from server2-groupware.localnet (kons-d9be1ecb.pool.mediaWays.net
	[217.190.30.203])
	by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis)
	id 0M9GoA-1TX33b0nl8-00C8Fy; Mon, 26 Nov 2012 23:57:01 +0100
From: Ronny Hegewald <ronny.hegewald@online.de>
To: xen-devel@lists.xen.org
Date: Mon, 26 Nov 2012 23:53:15 +0000
User-Agent: KMail/1.11.4 (Linux/3.0.3; KDE/4.2.4; i686; ; )
MIME-Version: 1.0
Content-Disposition: inline
Message-Id: <201211262353.15915.ronny.hegewald@online.de>
X-Provags-ID: V02:K0:s0qX8wJzZ5iGfAUiDmr+zSwNHkfrGLeL+3lyQSYtPVl
	8/V1/lpA6n5AVh2nFTOtWweb7JZQXdCoNGmughBIGCfrTkPg8L
	ymmnjs1pWvsPy/dM9H9sSUo/BqWDksqPjM7IuSLxibd37nOeq1
	eRKO99C5WErNMPWgqZdc3dlcJzIHBIcd3ZetCCftaw59G0c3t8
	OkflmWjpCt19j91IUNAvdX0YIq41LkL/WoJ2BGreUfghX7ItvV
	PTnoDLb/FAdJ/6wOpxpNlC7F+qbzvqe/WxrYgh0IPweSxriH8R
	T1sLknPuIi6Lju6cD46mSk+rZpC+hfgzICkVfZRgCNtBsbvPN+
	P9PaFYW9Y0KZDAF7bvtILR3ir6XiBaqkD3JkcO93d5nI9LMKGd
	c4blxnRNLKWSE3kwBIO6J8Vfaw5qCwtUBQ=
Subject: [Xen-devel] [PATCH V2] libxl: fix a variable underflow in
	libxl_wait_for_free_memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

When xl is called to create a domU and there is not enough memory available, 
then the autoballooning is called to extract memory from dom0. During the 
ballooning a loop in libxl_wait_for_free_memory() waits unless enough memory 
is available to create the domU. 

But because of a variable-underflow the loop can finish too soon and xl 
finally aborts with the message:


xc: error: panic: xc_dom_boot.c:161: xc_dom_boot_mem_init: can't allocate low 
memory for domain: Out of memory                         
libxl: error: libxl_dom.c:430:libxl__build_pv: xc_dom_boot_mem_init failed: 
Device or resource busy                                    
libxl: error: libxl_create.c:901:domcreate_rebuild_done: cannot (re-)build 
domain: -3        


The variable-underflow happens when freemem_slack is larger then 
info.free_pages*4, because the solution of this operation is converted 
implicit to a unsigned int to match the type of memory_kb.

Add a extra check for this condition to solve the problem.

---

Changes since V1:
  * check for valid ranges of freemem_slack instead of casting around values, 
    as suggested by Ian Campbell   


Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>

--- xen-4.3-20121121/tools/libxl/libxl.c.org	2012-11-22 03:34:00.000000000 
+0000
+++ xen-4.3-20121121/tools/libxl/libxl.c	2012-11-26 21:29:42.000000000 +0000
@@ -3763,7 +3763,8 @@ int libxl_wait_for_free_memory(libxl_ctx
         rc = libxl_get_physinfo(ctx, &info);
         if (rc < 0)
             goto out;
-        if (info.free_pages * 4 - freemem_slack >= memory_kb) {
+        if (info.free_pages * 4 >= freemem_slack && 
+            info.free_pages * 4 - freemem_slack >= memory_kb) {
             rc = 0;
             goto out;
         }




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 23:23:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 23:23:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td810-0005B0-61; Mon, 26 Nov 2012 23:23:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jfehlig@suse.com>) id 1Td80y-0005Av-Nx
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 23:23:00 +0000
Received: from [85.158.137.99:15071] by server-8.bemta-3.messagelabs.com id
	49/3B-07786-4D9F3B05; Mon, 26 Nov 2012 23:23:00 +0000
X-Env-Sender: jfehlig@suse.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1353972177!20581748!1
X-Originating-IP: [137.65.250.26]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28242 invoked from network); 26 Nov 2012 23:22:59 -0000
Received: from victor.provo.novell.com (HELO victor.provo.novell.com)
	(137.65.250.26)
	by server-14.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 23:22:59 -0000
Received: from [137.65.135.33] (prv-ext-foundry1int.gns.novell.com
	[137.65.251.240])
	by victor.provo.novell.com with ESMTP (TLS encrypted);
	Mon, 26 Nov 2012 16:22:51 -0700
Message-ID: <50B3F9CA.4030208@suse.com>
Date: Mon, 26 Nov 2012 16:22:50 -0700
From: Jim Fehlig <jfehlig@suse.com>
User-Agent: Thunderbird 2.0.0.24 (X11/20100302)
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <0451e6041bdd88c90eee.1353395794@linux-bjrd.bjz>
	<1353663822.13542.183.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353663822.13542.183.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Bamvor Jian Zhang <bjzhang@suse.com>
Subject: Re: [Xen-devel] [PATCH] fix race condition between libvirtd event
 handling and libxl fd deregister
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell wrote:
> On Tue, 2012-11-20 at 07:16 +0000, Bamvor Jian Zhang wrote:
>   
>> the race condition may be encounted at the following senaro:
>> (1), xenlight will remove fd handle just after the transfer is done according to
>> the buffer pointer. This action will first mark fd handle deleted in libvirtd
>> then remove fd handler from list in libxl. To mark the fd deleted in libvirtd,
>> the libvirt event loop mutex must be acquired.
>>
>> (2), meanwhile in the libvirt event dispatch process, libvirt will check the fd
>> deleted flag while holding the event loop mutex. At this time, "(1)" may be
>> blocked from marking the deleted flag. Then libvirt release its mutex temperary
>> to run the dispatcher callback. But this callback need xenlight lock(CTX_LOCK)
>> which is held by xenlight fd deregister function. So, libvirtd will continue to
>> run this callback after fd deregister exit which means xenlight has been marked
>> deleted flag, removed this fd handler and set ev->fd as -1. after
>> libxl__ev_fd_deregister exit, it is time for callback running. but
>> unfortunately, this callback has been removed as I mentioned above.
>>
>> reference the following graph:
>> libvirt event dispatch                  xenlight transfer done
>>        |                              enter libxl__ev_fd_deregister
>>        |                                     CTX_LOCK
>>        |                                         |
>>        |                                         |
>>        |                              enter osevent_fd_deregister
>>        |                                         |
>>        |                              enter virEventRemoveHandle
>>        |                                waiting virMutexLock
>> check handler delete flag                        |
>> virMutexUnlock                                   |
>>        |                                    virMutexLock
>> enter libxl_osevent_occurred_fd                  |
>> waiting CTX_LOCK                          mark delete flag
>>        |                                   virMutexUnlock
>>        |                                         |
>>        |                                exit virEventRemoveHandle
>>        |                                exit osevent_fd_deregister
>>        |                                         |
>>        |                                remove fd handler from list
>>        |                                   set ev->fd as -1
>>        |                                     CTX_UNLOCK
>>    CTX_LOCK
>> assert(fd==ev->fd) //lead to crash
>> call back in libxl
>>    CTX_UNLOCK
>> exit libxl_osevent_occurred_fd
>>     
>
> This all seems pretty plausible to me, but I'd like to have an Ack from
> Ian J before I commit.
>   

FYI, I hit the race again today on a test machine without this patch,
and no longer encountered the race after applying the patch.  So

    Tested-by: Jim Fehlig <jfehlig@suse.com>

If ACK'ed by Ian J., can this also be added to 4.2-testing?

Thanks!
Jim

>   
>> at the same time, i found the times of file handler register is less
>> than the times of file handler deregister. is that right? seems that
>> it will be better if the register and deregister is paired.
>>     
>
> How many extra file handles are we talking about?
>
> Presumably some long lived file handles will stay around until you call
> libxl_ctx_free for the ctx. Or are you doing this and saying you are
> seeing leaked fd's?
>
>   
>> Signed-off-by: Bamvor Jian Zhang <bjzhang@suse.com>
>>     
>
>   
>> diff -r 321f8487379b -r 0451e6041bdd tools/libxl/libxl_event.c
>> --- a/tools/libxl/libxl_event.c	Thu Nov 15 10:25:29 2012 +0000
>> +++ b/tools/libxl/libxl_event.c	Tue Nov 20 14:56:04 2012 +0800
>> @@ -1018,11 +1018,15 @@ void libxl_osevent_occurred_fd(libxl_ctx
>>      CTX_LOCK;
>>      assert(!CTX->osevent_in_hook);
>>  
>> +    if (!libxl__ev_fd_isregistered(ev)) {
>> +        DBG("ev_fd=%p deregister unregistered",ev);
>> +        goto out;
>> +    }
>>      assert(fd == ev->fd);
>>      revents &= ev->events;
>>      if (revents)
>>          ev->func(egc, ev, fd, ev->events, revents);
>> -
>> +out:
>>      CTX_UNLOCK;
>>      EGC_FREE;
>>  }
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>>     
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>   

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 23:23:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 23:23:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td810-0005B0-61; Mon, 26 Nov 2012 23:23:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jfehlig@suse.com>) id 1Td80y-0005Av-Nx
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 23:23:00 +0000
Received: from [85.158.137.99:15071] by server-8.bemta-3.messagelabs.com id
	49/3B-07786-4D9F3B05; Mon, 26 Nov 2012 23:23:00 +0000
X-Env-Sender: jfehlig@suse.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1353972177!20581748!1
X-Originating-IP: [137.65.250.26]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28242 invoked from network); 26 Nov 2012 23:22:59 -0000
Received: from victor.provo.novell.com (HELO victor.provo.novell.com)
	(137.65.250.26)
	by server-14.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 26 Nov 2012 23:22:59 -0000
Received: from [137.65.135.33] (prv-ext-foundry1int.gns.novell.com
	[137.65.251.240])
	by victor.provo.novell.com with ESMTP (TLS encrypted);
	Mon, 26 Nov 2012 16:22:51 -0700
Message-ID: <50B3F9CA.4030208@suse.com>
Date: Mon, 26 Nov 2012 16:22:50 -0700
From: Jim Fehlig <jfehlig@suse.com>
User-Agent: Thunderbird 2.0.0.24 (X11/20100302)
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <0451e6041bdd88c90eee.1353395794@linux-bjrd.bjz>
	<1353663822.13542.183.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353663822.13542.183.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Bamvor Jian Zhang <bjzhang@suse.com>
Subject: Re: [Xen-devel] [PATCH] fix race condition between libvirtd event
 handling and libxl fd deregister
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell wrote:
> On Tue, 2012-11-20 at 07:16 +0000, Bamvor Jian Zhang wrote:
>   
>> the race condition may be encounted at the following senaro:
>> (1), xenlight will remove fd handle just after the transfer is done according to
>> the buffer pointer. This action will first mark fd handle deleted in libvirtd
>> then remove fd handler from list in libxl. To mark the fd deleted in libvirtd,
>> the libvirt event loop mutex must be acquired.
>>
>> (2), meanwhile in the libvirt event dispatch process, libvirt will check the fd
>> deleted flag while holding the event loop mutex. At this time, "(1)" may be
>> blocked from marking the deleted flag. Then libvirt release its mutex temperary
>> to run the dispatcher callback. But this callback need xenlight lock(CTX_LOCK)
>> which is held by xenlight fd deregister function. So, libvirtd will continue to
>> run this callback after fd deregister exit which means xenlight has been marked
>> deleted flag, removed this fd handler and set ev->fd as -1. after
>> libxl__ev_fd_deregister exit, it is time for callback running. but
>> unfortunately, this callback has been removed as I mentioned above.
>>
>> reference the following graph:
>> libvirt event dispatch                  xenlight transfer done
>>        |                              enter libxl__ev_fd_deregister
>>        |                                     CTX_LOCK
>>        |                                         |
>>        |                                         |
>>        |                              enter osevent_fd_deregister
>>        |                                         |
>>        |                              enter virEventRemoveHandle
>>        |                                waiting virMutexLock
>> check handler delete flag                        |
>> virMutexUnlock                                   |
>>        |                                    virMutexLock
>> enter libxl_osevent_occurred_fd                  |
>> waiting CTX_LOCK                          mark delete flag
>>        |                                   virMutexUnlock
>>        |                                         |
>>        |                                exit virEventRemoveHandle
>>        |                                exit osevent_fd_deregister
>>        |                                         |
>>        |                                remove fd handler from list
>>        |                                   set ev->fd as -1
>>        |                                     CTX_UNLOCK
>>    CTX_LOCK
>> assert(fd==ev->fd) //lead to crash
>> call back in libxl
>>    CTX_UNLOCK
>> exit libxl_osevent_occurred_fd
>>     
>
> This all seems pretty plausible to me, but I'd like to have an Ack from
> Ian J before I commit.
>   

FYI, I hit the race again today on a test machine without this patch,
and no longer encountered the race after applying the patch.  So

    Tested-by: Jim Fehlig <jfehlig@suse.com>

If ACK'ed by Ian J., can this also be added to 4.2-testing?

Thanks!
Jim

>   
>> at the same time, i found the times of file handler register is less
>> than the times of file handler deregister. is that right? seems that
>> it will be better if the register and deregister is paired.
>>     
>
> How many extra file handles are we talking about?
>
> Presumably some long lived file handles will stay around until you call
> libxl_ctx_free for the ctx. Or are you doing this and saying you are
> seeing leaked fd's?
>
>   
>> Signed-off-by: Bamvor Jian Zhang <bjzhang@suse.com>
>>     
>
>   
>> diff -r 321f8487379b -r 0451e6041bdd tools/libxl/libxl_event.c
>> --- a/tools/libxl/libxl_event.c	Thu Nov 15 10:25:29 2012 +0000
>> +++ b/tools/libxl/libxl_event.c	Tue Nov 20 14:56:04 2012 +0800
>> @@ -1018,11 +1018,15 @@ void libxl_osevent_occurred_fd(libxl_ctx
>>      CTX_LOCK;
>>      assert(!CTX->osevent_in_hook);
>>  
>> +    if (!libxl__ev_fd_isregistered(ev)) {
>> +        DBG("ev_fd=%p deregister unregistered",ev);
>> +        goto out;
>> +    }
>>      assert(fd == ev->fd);
>>      revents &= ev->events;
>>      if (revents)
>>          ev->func(egc, ev, fd, ev->events, revents);
>> -
>> +out:
>>      CTX_UNLOCK;
>>      EGC_FREE;
>>  }
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>>     
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>   

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 23:32:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 23:32:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td8A6-0005OH-5z; Mon, 26 Nov 2012 23:32:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Td8A5-0005OC-3h
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 23:32:25 +0000
Received: from [85.158.143.35:2562] by server-2.bemta-4.messagelabs.com id
	AA/44-28922-80CF3B05; Mon, 26 Nov 2012 23:32:24 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1353972743!16290048!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27938 invoked from network); 26 Nov 2012 23:32:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 23:32:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,323,1352073600"; d="scan'208";a="16012097"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 23:32:23 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 26 Nov 2012 23:32:23 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1Td8A3-0001AF-5U;
	Mon, 26 Nov 2012 23:32:23 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1Td8A2-0006eX-Hk;
	Mon, 26 Nov 2012 23:32:22 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14476-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 26 Nov 2012 23:32:22 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14476: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14476 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14476/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-xl-win-vcpus1 12 guest-localmigrate/x10   fail REGR. vs. 14475

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14475
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14475

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass

version targeted for testing:
 xen                  16bf7f3069a7
baseline version:
 xen                  0049de3827bc

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Olaf Hering <olaf@aepfle.de>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26188:16bf7f3069a7
tag:         tip
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 26 17:20:39 2012 +0100
    
    x86/time: fix scale_delta() inline assembly
    
    The way it was coded, it clobbered %rdx without telling the compiler.
    This generally didn't cause any problems except when there are two back
    to back invocations (as in plt_overflow()), as in that case the
    compiler may validly assume that it can re-use for the second instance
    the value loaded into %rdx before the first one.
    
    Once at it, also properly relax the second operand of "mul" (there's no
    need for it to be in %rdx, or a register at all), and switch away from
    using explicit register names in the instruction operands.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26187:0049de3827bc
user:        Olaf Hering <olaf@aepfle.de>
date:        Fri Nov 23 11:06:15 2012 +0000
    
    xend: enable environment passing in xPopen3
    
    In changeset 19990:38dd208e1d95 a new parameter 'env' was added to
    xPopen3, but no code was added to actually pass the environment down to
    execvpe. Also, the new code was unreachable.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 23:32:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 23:32:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td8A6-0005OH-5z; Mon, 26 Nov 2012 23:32:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Td8A5-0005OC-3h
	for xen-devel@lists.xensource.com; Mon, 26 Nov 2012 23:32:25 +0000
Received: from [85.158.143.35:2562] by server-2.bemta-4.messagelabs.com id
	AA/44-28922-80CF3B05; Mon, 26 Nov 2012 23:32:24 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1353972743!16290048!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27938 invoked from network); 26 Nov 2012 23:32:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	26 Nov 2012 23:32:23 -0000
X-IronPort-AV: E=Sophos;i="4.83,323,1352073600"; d="scan'208";a="16012097"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	26 Nov 2012 23:32:23 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Mon, 26 Nov 2012 23:32:23 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1Td8A3-0001AF-5U;
	Mon, 26 Nov 2012 23:32:23 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1Td8A2-0006eX-Hk;
	Mon, 26 Nov 2012 23:32:22 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14476-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Mon, 26 Nov 2012 23:32:22 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14476: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14476 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14476/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-xl-win-vcpus1 12 guest-localmigrate/x10   fail REGR. vs. 14475

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14475
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14475

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass

version targeted for testing:
 xen                  16bf7f3069a7
baseline version:
 xen                  0049de3827bc

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Olaf Hering <olaf@aepfle.de>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26188:16bf7f3069a7
tag:         tip
user:        Jan Beulich <jbeulich@suse.com>
date:        Mon Nov 26 17:20:39 2012 +0100
    
    x86/time: fix scale_delta() inline assembly
    
    The way it was coded, it clobbered %rdx without telling the compiler.
    This generally didn't cause any problems except when there are two back
    to back invocations (as in plt_overflow()), as in that case the
    compiler may validly assume that it can re-use for the second instance
    the value loaded into %rdx before the first one.
    
    Once at it, also properly relax the second operand of "mul" (there's no
    need for it to be in %rdx, or a register at all), and switch away from
    using explicit register names in the instruction operands.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26187:0049de3827bc
user:        Olaf Hering <olaf@aepfle.de>
date:        Fri Nov 23 11:06:15 2012 +0000
    
    xend: enable environment passing in xPopen3
    
    In changeset 19990:38dd208e1d95 a new parameter 'env' was added to
    xPopen3, but no code was added to actually pass the environment down to
    execvpe. Also, the new code was unreachable.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 23:48:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 23:48:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td8Oy-0005cE-M0; Mon, 26 Nov 2012 23:47:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Boris.Ostrovsky@amd.com>) id 1Td8Ow-0005c7-H0
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 23:47:46 +0000
Received: from [85.158.143.99:15408] by server-1.bemta-4.messagelabs.com id
	F1/7C-27934-1AFF3B05; Mon, 26 Nov 2012 23:47:45 +0000
X-Env-Sender: Boris.Ostrovsky@amd.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1353973663!20977073!1
X-Originating-IP: [207.46.163.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14294 invoked from network); 26 Nov 2012 23:47:45 -0000
Received: from co9ehsobe002.messaging.microsoft.com (HELO
	co9outboundpool.messaging.microsoft.com) (207.46.163.25)
	by server-10.tower-216.messagelabs.com with AES128-SHA encrypted SMTP;
	26 Nov 2012 23:47:45 -0000
Received: from mail62-co9-R.bigfish.com (10.236.132.235) by
	CO9EHSOBE019.bigfish.com (10.236.130.82) with Microsoft SMTP Server id
	14.1.225.23; Mon, 26 Nov 2012 23:47:28 +0000
Received: from mail62-co9 (localhost [127.0.0.1])	by mail62-co9-R.bigfish.com
	(Postfix) with ESMTP id B76DDA201A1;
	Mon, 26 Nov 2012 23:47:28 +0000 (UTC)
X-Forefront-Antispam-Report: CIP:163.181.249.108; KIP:(null); UIP:(null);
	IPV:NLI; H:ausb3twp01.amd.com; RD:none; EFVD:NLI
X-SpamScore: -4
X-BigFish: VPS-4(z551bizbb2dI98dI9371I936eI1432Izz1de0h1202h1d1ah1d2ahzzz2dh668h839hd25he5bhf0ah1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh162dh1631h1155h)
Received: from mail62-co9 (localhost.localdomain [127.0.0.1]) by mail62-co9
	(MessageSwitch) id 1353973646541836_16125;
	Mon, 26 Nov 2012 23:47:26 +0000 (UTC)
Received: from CO9EHSMHS015.bigfish.com (unknown [10.236.132.228])	by
	mail62-co9.bigfish.com (Postfix) with ESMTP id 81188A00049;
	Mon, 26 Nov 2012 23:47:26 +0000 (UTC)
Received: from ausb3twp01.amd.com (163.181.249.108) by
	CO9EHSMHS015.bigfish.com (10.236.130.25) with Microsoft SMTP Server id
	14.1.225.23; Mon, 26 Nov 2012 23:47:24 +0000
X-WSS-ID: 0ME4CQZ-01-HWR-02
X-M-MSG: 
Received: from sausexedgep02.amd.com (sausexedgep02-ext.amd.com
	[163.181.249.73])	(using TLSv1 with cipher AES128-SHA (128/128
	bits))	(No
	client certificate requested)	by ausb3twp01.amd.com (Axway MailGate
	3.8.1)
	with ESMTP id 21DBF10284CE;	Mon, 26 Nov 2012 17:47:23 -0600 (CST)
Received: from SAUSEXDAG01.amd.com (163.181.55.1) by sausexedgep02.amd.com
	(163.181.36.59) with Microsoft SMTP Server (TLS) id 8.3.192.1;
	Mon, 26 Nov 2012 17:47:29 -0600
Received: from [10.234.222.132] (163.181.55.254) by sausexdag01.amd.com
	(163.181.55.1) with Microsoft SMTP Server id 14.2.318.4;
	Mon, 26 Nov 2012 17:47:23 -0600
Message-ID: <50B3FF8A.4050909@amd.com>
Date: Mon, 26 Nov 2012 18:47:22 -0500
From: Boris Ostrovsky <boris.ostrovsky@amd.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121025 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <ijc@hellion.org.uk>
References: <1353936077.5830.30.camel@zakaz.uk.xensource.com>
	<50B3805A02000078000AB1B8@nat28.tlf.novell.com>
	<1353939218.5830.34.camel@zakaz.uk.xensource.com>
	<50B383B2.9060503@amd.com>
In-Reply-To: <50B383B2.9060503@amd.com>
X-OriginatorOrg: amd.com
Cc: debian-kernel <debian-kernel@lists.debian.org>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] pvops microcode support for AMD FAM >= 15
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 11/26/2012 09:58 AM, Boris Ostrovsky wrote:
>
>
> On 11/26/2012 09:13 AM, Ian Campbell wrote:
>> On Mon, 2012-11-26 at 13:44 +0000, Jan Beulich wrote:

>>>
>>> The only other thing to check for is that you don't have any
>>> artificial size restriction left in that code (I think patch files early
>>> on were limited to 4k in size, and that got lifted during the last
>>> couple of years).
>>
>> I can't find one by inspection, it uses the standard request_firmware
>> interface and stashes the result in a valloc'd buffer, neither of which
>> suffer from any 4K related limitations AFAIK.
>>
>> I'll try and track something more recent down to test but the worst
>> downside of applying this patch seems to be that something which doesn't
>> work still doesn't work.
>
> I submitted a fix for fam 16h to Linux right before the Thanksgiving
> break in US and was planning to look at Xen as well. Give me a day or
> two to test it.

It works fine, no issues with size (which is different from other families).

-boris


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Mon Nov 26 23:48:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Nov 2012 23:48:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td8Oy-0005cE-M0; Mon, 26 Nov 2012 23:47:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Boris.Ostrovsky@amd.com>) id 1Td8Ow-0005c7-H0
	for xen-devel@lists.xen.org; Mon, 26 Nov 2012 23:47:46 +0000
Received: from [85.158.143.99:15408] by server-1.bemta-4.messagelabs.com id
	F1/7C-27934-1AFF3B05; Mon, 26 Nov 2012 23:47:45 +0000
X-Env-Sender: Boris.Ostrovsky@amd.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1353973663!20977073!1
X-Originating-IP: [207.46.163.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14294 invoked from network); 26 Nov 2012 23:47:45 -0000
Received: from co9ehsobe002.messaging.microsoft.com (HELO
	co9outboundpool.messaging.microsoft.com) (207.46.163.25)
	by server-10.tower-216.messagelabs.com with AES128-SHA encrypted SMTP;
	26 Nov 2012 23:47:45 -0000
Received: from mail62-co9-R.bigfish.com (10.236.132.235) by
	CO9EHSOBE019.bigfish.com (10.236.130.82) with Microsoft SMTP Server id
	14.1.225.23; Mon, 26 Nov 2012 23:47:28 +0000
Received: from mail62-co9 (localhost [127.0.0.1])	by mail62-co9-R.bigfish.com
	(Postfix) with ESMTP id B76DDA201A1;
	Mon, 26 Nov 2012 23:47:28 +0000 (UTC)
X-Forefront-Antispam-Report: CIP:163.181.249.108; KIP:(null); UIP:(null);
	IPV:NLI; H:ausb3twp01.amd.com; RD:none; EFVD:NLI
X-SpamScore: -4
X-BigFish: VPS-4(z551bizbb2dI98dI9371I936eI1432Izz1de0h1202h1d1ah1d2ahzzz2dh668h839hd25he5bhf0ah1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh162dh1631h1155h)
Received: from mail62-co9 (localhost.localdomain [127.0.0.1]) by mail62-co9
	(MessageSwitch) id 1353973646541836_16125;
	Mon, 26 Nov 2012 23:47:26 +0000 (UTC)
Received: from CO9EHSMHS015.bigfish.com (unknown [10.236.132.228])	by
	mail62-co9.bigfish.com (Postfix) with ESMTP id 81188A00049;
	Mon, 26 Nov 2012 23:47:26 +0000 (UTC)
Received: from ausb3twp01.amd.com (163.181.249.108) by
	CO9EHSMHS015.bigfish.com (10.236.130.25) with Microsoft SMTP Server id
	14.1.225.23; Mon, 26 Nov 2012 23:47:24 +0000
X-WSS-ID: 0ME4CQZ-01-HWR-02
X-M-MSG: 
Received: from sausexedgep02.amd.com (sausexedgep02-ext.amd.com
	[163.181.249.73])	(using TLSv1 with cipher AES128-SHA (128/128
	bits))	(No
	client certificate requested)	by ausb3twp01.amd.com (Axway MailGate
	3.8.1)
	with ESMTP id 21DBF10284CE;	Mon, 26 Nov 2012 17:47:23 -0600 (CST)
Received: from SAUSEXDAG01.amd.com (163.181.55.1) by sausexedgep02.amd.com
	(163.181.36.59) with Microsoft SMTP Server (TLS) id 8.3.192.1;
	Mon, 26 Nov 2012 17:47:29 -0600
Received: from [10.234.222.132] (163.181.55.254) by sausexdag01.amd.com
	(163.181.55.1) with Microsoft SMTP Server id 14.2.318.4;
	Mon, 26 Nov 2012 17:47:23 -0600
Message-ID: <50B3FF8A.4050909@amd.com>
Date: Mon, 26 Nov 2012 18:47:22 -0500
From: Boris Ostrovsky <boris.ostrovsky@amd.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121025 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <ijc@hellion.org.uk>
References: <1353936077.5830.30.camel@zakaz.uk.xensource.com>
	<50B3805A02000078000AB1B8@nat28.tlf.novell.com>
	<1353939218.5830.34.camel@zakaz.uk.xensource.com>
	<50B383B2.9060503@amd.com>
In-Reply-To: <50B383B2.9060503@amd.com>
X-OriginatorOrg: amd.com
Cc: debian-kernel <debian-kernel@lists.debian.org>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] pvops microcode support for AMD FAM >= 15
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



On 11/26/2012 09:58 AM, Boris Ostrovsky wrote:
>
>
> On 11/26/2012 09:13 AM, Ian Campbell wrote:
>> On Mon, 2012-11-26 at 13:44 +0000, Jan Beulich wrote:

>>>
>>> The only other thing to check for is that you don't have any
>>> artificial size restriction left in that code (I think patch files early
>>> on were limited to 4k in size, and that got lifted during the last
>>> couple of years).
>>
>> I can't find one by inspection, it uses the standard request_firmware
>> interface and stashes the result in a valloc'd buffer, neither of which
>> suffer from any 4K related limitations AFAIK.
>>
>> I'll try and track something more recent down to test but the worst
>> downside of applying this patch seems to be that something which doesn't
>> work still doesn't work.
>
> I submitted a fix for fam 16h to Linux right before the Thanksgiving
> break in US and was planning to look at Xen as well. Give me a day or
> two to test it.

It works fine, no issues with size (which is different from other families).

-boris


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 00:33:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 00:33:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td96w-0006a2-Bl; Tue, 27 Nov 2012 00:33:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td96v-0006Zx-2i
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 00:33:13 +0000
Received: from [85.158.139.211:54170] by server-11.bemta-5.messagelabs.com id
	1C/88-03409-84A04B05; Tue, 27 Nov 2012 00:33:12 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353976390!21730961!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzY1NTY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29467 invoked from network); 27 Nov 2012 00:33:11 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 00:33:11 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAR0X8Rb022553
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 27 Nov 2012 00:33:09 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAR0X77T004829
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 27 Nov 2012 00:33:08 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAR0X73g021846; Mon, 26 Nov 2012 18:33:07 -0600
MIME-Version: 1.0
Message-ID: <f433c3e9-4874-4613-aa81-99a9cfe57986@default>
Date: Mon, 26 Nov 2012 16:33:05 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: markus@oberhumer.com, xen-devel@lists.xen.org
Subject: [Xen-devel] lzo update in hypervisor?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Keir, Jan --

In theory, would there be any objections to updating
Xen's lzo.c and unlzo.c to accomodate Markus Oberhumer's
dramatic performance improvements recently posted to
upstream Linux targeted for 3.8 and briefly described here:

https://lkml.org/lkml/2012/8/21/350 
(short version: typically 2x faster)

Also, might it be reasonable/acceptable for
this to retain the Linux formatting so that
this and future updates need not be reformatted?

AFAIK, tmem is the only user of this code.

Thanks,
Dan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 00:33:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 00:33:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Td96w-0006a2-Bl; Tue, 27 Nov 2012 00:33:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Td96v-0006Zx-2i
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 00:33:13 +0000
Received: from [85.158.139.211:54170] by server-11.bemta-5.messagelabs.com id
	1C/88-03409-84A04B05; Tue, 27 Nov 2012 00:33:12 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1353976390!21730961!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzY1NTY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29467 invoked from network); 27 Nov 2012 00:33:11 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 00:33:11 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAR0X8Rb022553
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 27 Nov 2012 00:33:09 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAR0X77T004829
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 27 Nov 2012 00:33:08 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAR0X73g021846; Mon, 26 Nov 2012 18:33:07 -0600
MIME-Version: 1.0
Message-ID: <f433c3e9-4874-4613-aa81-99a9cfe57986@default>
Date: Mon, 26 Nov 2012 16:33:05 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: markus@oberhumer.com, xen-devel@lists.xen.org
Subject: [Xen-devel] lzo update in hypervisor?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Keir, Jan --

In theory, would there be any objections to updating
Xen's lzo.c and unlzo.c to accomodate Markus Oberhumer's
dramatic performance improvements recently posted to
upstream Linux targeted for 3.8 and briefly described here:

https://lkml.org/lkml/2012/8/21/350 
(short version: typically 2x faster)

Also, might it be reasonable/acceptable for
this to retain the Linux formatting so that
this and future updates need not be reformatted?

AFAIK, tmem is the only user of this code.

Thanks,
Dan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 02:41:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 02:41:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdB6v-00032q-BM; Tue, 27 Nov 2012 02:41:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <gabrielx.wu@intel.com>) id 1TdB6t-00032l-IH
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 02:41:19 +0000
Received: from [85.158.137.99:37990] by server-13.bemta-3.messagelabs.com id
	4F/00-24887-E4824B05; Tue, 27 Nov 2012 02:41:18 +0000
X-Env-Sender: gabrielx.wu@intel.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1353984076!20701350!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY3NTMw\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25686 invoked from network); 27 Nov 2012 02:41:17 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-16.tower-217.messagelabs.com with SMTP;
	27 Nov 2012 02:41:17 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 26 Nov 2012 18:40:33 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,325,1352102400"; d="scan'208";a="224761629"
Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37])
	by orsmga001.jf.intel.com with ESMTP; 26 Nov 2012 18:41:15 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Mon, 26 Nov 2012 18:41:14 -0800
Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.85]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Tue, 27 Nov 2012 10:41:13 +0800
From: "Wu, GabrielX" <gabrielx.wu@intel.com>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Thread-Topic: VMX status report. Xen:26180 & Dom0:3.6.7
Thread-Index: AQHNQKNIzN9DYzRe7EmcNins26UkQJb+skTggBKA8xCABFRNQIAVWItggAQG5GCADlPDsIAacyQwgBT48ZCAFeXQ0IAWO4fggADtiSCAH4HfcIABva3wgBTqUFCAAO5pQIAUG4UAgAGL0hCAFnHQwIABJbYQ
Date: Tue, 27 Nov 2012 02:41:12 +0000
Message-ID: <E4558C0C96688748837EB1B05BEED75A0FD8D621@SHSMSX102.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Wu, GabrielX" <gabrielx.wu@intel.com>, "Ren,
	Yongjie" <yongjie.ren@intel.com>, "Liu,
	RongrongX" <rongrongx.liu@intel.com>, "Liu,
	SongtaoX" <songtaox.liu@intel.com>, "Zhou, Chao" <chao.zhou@intel.com>
Subject: [Xen-devel] VMX status report. Xen:26180 & Dom0:3.6.7
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi all,

This is the test report of xen-unstable tree, no new issue found and three issue fixed.

Version Info:
=================================================================
xen-changeset:   26180:2489c2926698
Dom0:          linux.git  3.6.7
=================================================================

New issue(0)
==============

Fixed issues(3)
==============
1. guest failed to reboot after L-Migration it
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1738
2. Poor performance when do guest save/restore and migration with linux 3.x dom0
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1784
  -- Now, the cost time for save/restore and migration is less than that when we used Jeremy's Linux 2.6 dom0.
  -- You can visit the bugzilla link to get detailed data in our experiments.
3. after detaching a VF from a guest, shutdown the guest is very slow
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1812
  -- When reporting the bug, it took more than 2 min for a guest shutdown.
  -- Now, it can be shut down in 20 seconds.

Old issues(7)
==============
1. [ACPI] Dom0 can't resume from S3 sleep
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1707
2. [XL]"xl vcpu-set" causes dom0 crash or panic
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1730
3. [VT-D]fail to detach NIC from guest  
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1736
4. Sometimes Xen panic on ia32pae Sandybridge when restore guest
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1747
5. 'xl vcpu-set' can't decrease the vCPU number of a HVM guest
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1822
6. Dom0 cannot be shutdown before PCI device detachment from guest
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1826
7. xl pci-list shows one PCI device (PF or VF) could be assigned to two different guests
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1834

Best Regards,
Ronghui Wu(Gabriel)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 02:41:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 02:41:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdB6v-00032q-BM; Tue, 27 Nov 2012 02:41:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <gabrielx.wu@intel.com>) id 1TdB6t-00032l-IH
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 02:41:19 +0000
Received: from [85.158.137.99:37990] by server-13.bemta-3.messagelabs.com id
	4F/00-24887-E4824B05; Tue, 27 Nov 2012 02:41:18 +0000
X-Env-Sender: gabrielx.wu@intel.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1353984076!20701350!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY3NTMw\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25686 invoked from network); 27 Nov 2012 02:41:17 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-16.tower-217.messagelabs.com with SMTP;
	27 Nov 2012 02:41:17 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 26 Nov 2012 18:40:33 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.83,325,1352102400"; d="scan'208";a="224761629"
Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37])
	by orsmga001.jf.intel.com with ESMTP; 26 Nov 2012 18:41:15 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Mon, 26 Nov 2012 18:41:14 -0800
Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.85]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Tue, 27 Nov 2012 10:41:13 +0800
From: "Wu, GabrielX" <gabrielx.wu@intel.com>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Thread-Topic: VMX status report. Xen:26180 & Dom0:3.6.7
Thread-Index: AQHNQKNIzN9DYzRe7EmcNins26UkQJb+skTggBKA8xCABFRNQIAVWItggAQG5GCADlPDsIAacyQwgBT48ZCAFeXQ0IAWO4fggADtiSCAH4HfcIABva3wgBTqUFCAAO5pQIAUG4UAgAGL0hCAFnHQwIABJbYQ
Date: Tue, 27 Nov 2012 02:41:12 +0000
Message-ID: <E4558C0C96688748837EB1B05BEED75A0FD8D621@SHSMSX102.ccr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Wu, GabrielX" <gabrielx.wu@intel.com>, "Ren,
	Yongjie" <yongjie.ren@intel.com>, "Liu,
	RongrongX" <rongrongx.liu@intel.com>, "Liu,
	SongtaoX" <songtaox.liu@intel.com>, "Zhou, Chao" <chao.zhou@intel.com>
Subject: [Xen-devel] VMX status report. Xen:26180 & Dom0:3.6.7
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi all,

This is the test report of xen-unstable tree, no new issue found and three issue fixed.

Version Info:
=================================================================
xen-changeset:   26180:2489c2926698
Dom0:          linux.git  3.6.7
=================================================================

New issue(0)
==============

Fixed issues(3)
==============
1. guest failed to reboot after L-Migration it
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1738
2. Poor performance when do guest save/restore and migration with linux 3.x dom0
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1784
  -- Now, the cost time for save/restore and migration is less than that when we used Jeremy's Linux 2.6 dom0.
  -- You can visit the bugzilla link to get detailed data in our experiments.
3. after detaching a VF from a guest, shutdown the guest is very slow
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1812
  -- When reporting the bug, it took more than 2 min for a guest shutdown.
  -- Now, it can be shut down in 20 seconds.

Old issues(7)
==============
1. [ACPI] Dom0 can't resume from S3 sleep
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1707
2. [XL]"xl vcpu-set" causes dom0 crash or panic
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1730
3. [VT-D]fail to detach NIC from guest  
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1736
4. Sometimes Xen panic on ia32pae Sandybridge when restore guest
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1747
5. 'xl vcpu-set' can't decrease the vCPU number of a HVM guest
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1822
6. Dom0 cannot be shutdown before PCI device detachment from guest
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1826
7. xl pci-list shows one PCI device (PF or VF) could be assigned to two different guests
  http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1834

Best Regards,
Ronghui Wu(Gabriel)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 02:52:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 02:52:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdBHQ-0003EJ-PN; Tue, 27 Nov 2012 02:52:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <nenolod@dereferenced.org>) id 1TdBHP-0003EE-PJ
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 02:52:12 +0000
Received: from [85.158.138.51:8824] by server-12.bemta-3.messagelabs.com id
	8B/23-22757-ADA24B05; Tue, 27 Nov 2012 02:52:10 +0000
X-Env-Sender: nenolod@dereferenced.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1353984728!23669647!1
X-Originating-IP: [209.85.216.43]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1010 invoked from network); 27 Nov 2012 02:52:10 -0000
Received: from mail-qa0-f43.google.com (HELO mail-qa0-f43.google.com)
	(209.85.216.43)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 02:52:10 -0000
Received: by mail-qa0-f43.google.com with SMTP id a16so3693775qae.9
	for <xen-devel@lists.xensource.com>;
	Mon, 26 Nov 2012 18:52:08 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=7MnMsklXYdJ+HGqNexysQtCy0j1mW12E7Gv/2DsShgE=;
	b=ORlrsQ8N0GRoxuzCG5R00CiKvxiAyfaI+ExGEzQWrzc2oEttG6GT6JQLra3Yr/2zir
	2BjTX0XoFfn1CN4xpesPKHSJT1G0RSKwpzNGDGrk4xxasq7PyHTX3xYAMhP3CU2Edm20
	chUD0BI9KC6a4tm+jSCofWzAeMHWttftoPj3vKySfaZQAbWZ5ULt8arxc77U83ZsI2XM
	hYnoGkqewbPophwDVcQ53i30QPGxrpJG49Lh4uF4QuVpy6yKA2uvB+baFOpMhtHc+Vq3
	rHPWyyM2UTYxlopYTPLqrNl5KpxWlqUAxjEAdNVwqypJgyBmHSNVS37Yjc9cyhsQBMCw
	jTCg==
MIME-Version: 1.0
Received: by 10.224.185.212 with SMTP id cp20mr14921449qab.2.1353984728678;
	Mon, 26 Nov 2012 18:52:08 -0800 (PST)
Received: by 10.49.98.100 with HTTP; Mon, 26 Nov 2012 18:52:08 -0800 (PST)
In-Reply-To: <fff756e7-ae31-49ab-91f2-d5e455cca1bd@default>
References: <1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
	<cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
	<1545900898.20121126192533@eikelenboom.it>
	<672d364a-6d34-4c89-b0fb-5af989877117@default>
	<20121126202411.GA8912@reaktio.net>
	<b7ad6baf-e085-4ef7-860e-f9755b756339@default>
	<20121126213249.GA37842@ocelot.phlegethon.org>
	<fff756e7-ae31-49ab-91f2-d5e455cca1bd@default>
Date: Mon, 26 Nov 2012 20:52:08 -0600
Message-ID: <CA+T2pCFgVcJUQchyKT-_bk=1bT-1ZQNn=MGJgMTTPFQcwrYcfQ@mail.gmail.com>
From: William Pitcock <nenolod@dereferenced.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
X-Gm-Message-State: ALoCoQnZ9iW79syzgK/WtC8uVh85k2fIVOY9AEelOJoNoU9K2bYk2UJ3pogTyZwr1wx8F6c/u5ws
Cc: Sander Eikelenboom <linux@eikelenboom.it>,
	Alexander Bienzeisler <chosi@amd.co.at>,
	xen-devel@lists.xensource.com, Tim Deegan <tim@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi!

On Mon, Nov 26, 2012 at 3:47 PM, Dan Magenheimer
<dan.magenheimer@oracle.com> wrote:
>> From: Tim Deegan [mailto:tim@xen.org]
>> Subject: Re: [Xen-devel] can not use all available memory
>>
>> At 12:37 -0800 on 26 Nov (1353933449), Dan Magenheimer wrote:
>> > > > I could be wrong (and I am confident someone will correct me if I am) but
>> > > > I think this is because the Citrix memory model assumes there is an
>> > > > inference-driven policy engine for load-balancing memory across competing
>> > > > virtual machines ("squeezed").  I suspect squeezed returns unallocated
>> > > > xen "free" memory to dom0.
>> >
>> > I forgot... it is called Dynamic Memory Control (DMC), not squeezed
>> > in the XenServer product.
>>
>> AFAIK XenServer uses dom0_mem= and doesn't balloon com0 after boot time.
>> The idea of ballooning all free memory into dom0 is a xl-ism, inherited
>> from xend, and not really a "Citrix" one.  It's useful if you've
>> installed xen on a machine where dom0 is otherwise your main OS, but not
>> particularly for a dedicated platform.
>
> "inherited from xend"... was the autoballoon default the same in xend?
> I don't recall ever turning it off manually and, when testing tmem,
> I'm sure I would have had to.  Or maybe xend did use hypervisor free
> memory before trying to autoballoon dom0?

My Xen 3.4 cluster at my old job used available hypervisor memory
before ballooning from dom0 on the hosts which had that enabled.

So, I believe the behaviour of the xl toolstack is different than that
of xend.  My newer Xen 4.2 cluster at my new job has autoballoon
disabled across all nodes, however.  But we are having some problems
with running our dom0 environment without udev, which I need to figure
out at some point...

William

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 02:52:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 02:52:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdBHQ-0003EJ-PN; Tue, 27 Nov 2012 02:52:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <nenolod@dereferenced.org>) id 1TdBHP-0003EE-PJ
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 02:52:12 +0000
Received: from [85.158.138.51:8824] by server-12.bemta-3.messagelabs.com id
	8B/23-22757-ADA24B05; Tue, 27 Nov 2012 02:52:10 +0000
X-Env-Sender: nenolod@dereferenced.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1353984728!23669647!1
X-Originating-IP: [209.85.216.43]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1010 invoked from network); 27 Nov 2012 02:52:10 -0000
Received: from mail-qa0-f43.google.com (HELO mail-qa0-f43.google.com)
	(209.85.216.43)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 02:52:10 -0000
Received: by mail-qa0-f43.google.com with SMTP id a16so3693775qae.9
	for <xen-devel@lists.xensource.com>;
	Mon, 26 Nov 2012 18:52:08 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=7MnMsklXYdJ+HGqNexysQtCy0j1mW12E7Gv/2DsShgE=;
	b=ORlrsQ8N0GRoxuzCG5R00CiKvxiAyfaI+ExGEzQWrzc2oEttG6GT6JQLra3Yr/2zir
	2BjTX0XoFfn1CN4xpesPKHSJT1G0RSKwpzNGDGrk4xxasq7PyHTX3xYAMhP3CU2Edm20
	chUD0BI9KC6a4tm+jSCofWzAeMHWttftoPj3vKySfaZQAbWZ5ULt8arxc77U83ZsI2XM
	hYnoGkqewbPophwDVcQ53i30QPGxrpJG49Lh4uF4QuVpy6yKA2uvB+baFOpMhtHc+Vq3
	rHPWyyM2UTYxlopYTPLqrNl5KpxWlqUAxjEAdNVwqypJgyBmHSNVS37Yjc9cyhsQBMCw
	jTCg==
MIME-Version: 1.0
Received: by 10.224.185.212 with SMTP id cp20mr14921449qab.2.1353984728678;
	Mon, 26 Nov 2012 18:52:08 -0800 (PST)
Received: by 10.49.98.100 with HTTP; Mon, 26 Nov 2012 18:52:08 -0800 (PST)
In-Reply-To: <fff756e7-ae31-49ab-91f2-d5e455cca1bd@default>
References: <1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
	<cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
	<1545900898.20121126192533@eikelenboom.it>
	<672d364a-6d34-4c89-b0fb-5af989877117@default>
	<20121126202411.GA8912@reaktio.net>
	<b7ad6baf-e085-4ef7-860e-f9755b756339@default>
	<20121126213249.GA37842@ocelot.phlegethon.org>
	<fff756e7-ae31-49ab-91f2-d5e455cca1bd@default>
Date: Mon, 26 Nov 2012 20:52:08 -0600
Message-ID: <CA+T2pCFgVcJUQchyKT-_bk=1bT-1ZQNn=MGJgMTTPFQcwrYcfQ@mail.gmail.com>
From: William Pitcock <nenolod@dereferenced.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
X-Gm-Message-State: ALoCoQnZ9iW79syzgK/WtC8uVh85k2fIVOY9AEelOJoNoU9K2bYk2UJ3pogTyZwr1wx8F6c/u5ws
Cc: Sander Eikelenboom <linux@eikelenboom.it>,
	Alexander Bienzeisler <chosi@amd.co.at>,
	xen-devel@lists.xensource.com, Tim Deegan <tim@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi!

On Mon, Nov 26, 2012 at 3:47 PM, Dan Magenheimer
<dan.magenheimer@oracle.com> wrote:
>> From: Tim Deegan [mailto:tim@xen.org]
>> Subject: Re: [Xen-devel] can not use all available memory
>>
>> At 12:37 -0800 on 26 Nov (1353933449), Dan Magenheimer wrote:
>> > > > I could be wrong (and I am confident someone will correct me if I am) but
>> > > > I think this is because the Citrix memory model assumes there is an
>> > > > inference-driven policy engine for load-balancing memory across competing
>> > > > virtual machines ("squeezed").  I suspect squeezed returns unallocated
>> > > > xen "free" memory to dom0.
>> >
>> > I forgot... it is called Dynamic Memory Control (DMC), not squeezed
>> > in the XenServer product.
>>
>> AFAIK XenServer uses dom0_mem= and doesn't balloon com0 after boot time.
>> The idea of ballooning all free memory into dom0 is a xl-ism, inherited
>> from xend, and not really a "Citrix" one.  It's useful if you've
>> installed xen on a machine where dom0 is otherwise your main OS, but not
>> particularly for a dedicated platform.
>
> "inherited from xend"... was the autoballoon default the same in xend?
> I don't recall ever turning it off manually and, when testing tmem,
> I'm sure I would have had to.  Or maybe xend did use hypervisor free
> memory before trying to autoballoon dom0?

My Xen 3.4 cluster at my old job used available hypervisor memory
before ballooning from dom0 on the hosts which had that enabled.

So, I believe the behaviour of the xl toolstack is different than that
of xend.  My newer Xen 4.2 cluster at my new job has autoballoon
disabled across all nodes, however.  But we are having some problems
with running our dom0 environment without udev, which I need to figure
out at some point...

William

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 03:00:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 03:00:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdBOu-0003NG-NW; Tue, 27 Nov 2012 02:59:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <msw@amazon.com>) id 1TdBOt-0003NA-Kn
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 02:59:55 +0000
Received: from [85.158.143.99:13069] by server-2.bemta-4.messagelabs.com id
	FF/96-28922-BAC24B05; Tue, 27 Nov 2012 02:59:55 +0000
X-Env-Sender: msw@amazon.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1353985193!28815389!1
X-Originating-IP: [72.21.196.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNzIuMjEuMTk2LjI1ID0+IDE1NzY1NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13177 invoked from network); 27 Nov 2012 02:59:54 -0000
Received: from smtp-fw-2101.amazon.com (HELO smtp-fw-2101.amazon.com)
	(72.21.196.25)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 02:59:54 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=amazon.com; i=msw@amazon.com; q=dns/txt;
	s=amazon201209; t=1353985194; x=1385521194;
	h=date:from:to:cc:subject:message-id:references:
	mime-version:in-reply-to;
	bh=2Wd6TwdjNWh4tI+mLlSbmm4ii21nHAzleP8Qtv8x/4g=;
	b=TB8tGA7SP6cuztqmqYHqadGleO4p2XOoJ8IjyswQeKAnDcIybtJE16T2
	Hg9la1eX5INpYPD/yFJqOzkDuJCZWmR1j/BCGxcUCLRFjen1XxHxYgoHF
	1xaFe9RwaE10pd9oG/FkPS8Xl8Hd1uBPFAu5D6sXkj2LAIKIwlmDaPLDB I=;
X-IronPort-AV: E=McAfee;i="5400,1158,6908"; a="483909486"
Received: from smtp-in-6002.iad6.amazon.com ([10.195.76.108])
	by smtp-border-fw-out-2101.iad2.amazon.com with
	ESMTP/TLS/DHE-RSA-AES256-SHA; 27 Nov 2012 02:59:50 +0000
Received: from ex10-hub-31005.ant.amazon.com (ex10-hub-31005.sea31.amazon.com
	[10.185.176.12])
	by smtp-in-6002.iad6.amazon.com (8.13.8/8.13.8) with ESMTP id
	qAR2xmJ6022770
	(version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=OK);
	Tue, 27 Nov 2012 02:59:49 GMT
Received: from u109add4315675089e695.ant.amazon.com (10.184.8.82) by
	ex10-hub-31005.ant.amazon.com (10.185.176.12) with Microsoft SMTP
	Server id 14.2.247.3; Mon, 26 Nov 2012 18:59:41 -0800
Received: by u109add4315675089e695.ant.amazon.com (sSMTP sendmail emulation); 
	Mon, 26 Nov 2012 18:59:41 -0800
Date: Mon, 26 Nov 2012 18:59:41 -0800
From: Matt Wilson <msw@amazon.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121127025938.GA3854@u109add4315675089e695.ant.amazon.com>
References: <alpine.DEB.2.02.1211231250330.13749@kaball.uk.xensource.com>
	<50B357A7.6050905@citrix.com>
	<alpine.DEB.2.02.1211261934370.5310@kaball.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1211261934370.5310@kaball.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH] README: add Pixman as build dependency
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 26, 2012 at 07:35:43PM +0000, Stefano Stabellini wrote:
> On Mon, 26 Nov 2012, Roger Pau Monne wrote:
> > On 23/11/12 13:51, Stefano Stabellini wrote:
> > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > 
> > > diff --git a/README b/README
> > > index 21a81b2..88300df 100644
> > > --- a/README
> > > +++ b/README
> > > @@ -51,6 +51,7 @@ provided by your OS distributor:
> > >      * Development install of libaio (e.g. libaio-dev) version 0.3.107 or
> > >        greater. Set CONFIG_SYSTEM_LIBAIO in .config if this is not available.
> > >      * Development install of GLib v2.0 (e.g. libglib2.0-dev)
> > > +    * Development install of Pixman (e.g. libpixman-1-dev)
> > 
> > Should we add a configure test for Pixman? I guess this is needed by Qemu.
> 
> Yes, it is a QEMU dependency.
> 
> Is it actually a good idea to replicate all the configure checks done by
> QEMU's configure script in the Xen configure script?

I don't think it's a good idea to duplicate checks. We should call
qemu's ./configure early, perhaps from our ./configure, and make sure
that errors are clearly propagated and messaged to the user.

Matt

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 03:00:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 03:00:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdBOu-0003NG-NW; Tue, 27 Nov 2012 02:59:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <msw@amazon.com>) id 1TdBOt-0003NA-Kn
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 02:59:55 +0000
Received: from [85.158.143.99:13069] by server-2.bemta-4.messagelabs.com id
	FF/96-28922-BAC24B05; Tue, 27 Nov 2012 02:59:55 +0000
X-Env-Sender: msw@amazon.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1353985193!28815389!1
X-Originating-IP: [72.21.196.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNzIuMjEuMTk2LjI1ID0+IDE1NzY1NA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13177 invoked from network); 27 Nov 2012 02:59:54 -0000
Received: from smtp-fw-2101.amazon.com (HELO smtp-fw-2101.amazon.com)
	(72.21.196.25)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 02:59:54 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=amazon.com; i=msw@amazon.com; q=dns/txt;
	s=amazon201209; t=1353985194; x=1385521194;
	h=date:from:to:cc:subject:message-id:references:
	mime-version:in-reply-to;
	bh=2Wd6TwdjNWh4tI+mLlSbmm4ii21nHAzleP8Qtv8x/4g=;
	b=TB8tGA7SP6cuztqmqYHqadGleO4p2XOoJ8IjyswQeKAnDcIybtJE16T2
	Hg9la1eX5INpYPD/yFJqOzkDuJCZWmR1j/BCGxcUCLRFjen1XxHxYgoHF
	1xaFe9RwaE10pd9oG/FkPS8Xl8Hd1uBPFAu5D6sXkj2LAIKIwlmDaPLDB I=;
X-IronPort-AV: E=McAfee;i="5400,1158,6908"; a="483909486"
Received: from smtp-in-6002.iad6.amazon.com ([10.195.76.108])
	by smtp-border-fw-out-2101.iad2.amazon.com with
	ESMTP/TLS/DHE-RSA-AES256-SHA; 27 Nov 2012 02:59:50 +0000
Received: from ex10-hub-31005.ant.amazon.com (ex10-hub-31005.sea31.amazon.com
	[10.185.176.12])
	by smtp-in-6002.iad6.amazon.com (8.13.8/8.13.8) with ESMTP id
	qAR2xmJ6022770
	(version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=OK);
	Tue, 27 Nov 2012 02:59:49 GMT
Received: from u109add4315675089e695.ant.amazon.com (10.184.8.82) by
	ex10-hub-31005.ant.amazon.com (10.185.176.12) with Microsoft SMTP
	Server id 14.2.247.3; Mon, 26 Nov 2012 18:59:41 -0800
Received: by u109add4315675089e695.ant.amazon.com (sSMTP sendmail emulation); 
	Mon, 26 Nov 2012 18:59:41 -0800
Date: Mon, 26 Nov 2012 18:59:41 -0800
From: Matt Wilson <msw@amazon.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121127025938.GA3854@u109add4315675089e695.ant.amazon.com>
References: <alpine.DEB.2.02.1211231250330.13749@kaball.uk.xensource.com>
	<50B357A7.6050905@citrix.com>
	<alpine.DEB.2.02.1211261934370.5310@kaball.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1211261934370.5310@kaball.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH] README: add Pixman as build dependency
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, Nov 26, 2012 at 07:35:43PM +0000, Stefano Stabellini wrote:
> On Mon, 26 Nov 2012, Roger Pau Monne wrote:
> > On 23/11/12 13:51, Stefano Stabellini wrote:
> > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > 
> > > diff --git a/README b/README
> > > index 21a81b2..88300df 100644
> > > --- a/README
> > > +++ b/README
> > > @@ -51,6 +51,7 @@ provided by your OS distributor:
> > >      * Development install of libaio (e.g. libaio-dev) version 0.3.107 or
> > >        greater. Set CONFIG_SYSTEM_LIBAIO in .config if this is not available.
> > >      * Development install of GLib v2.0 (e.g. libglib2.0-dev)
> > > +    * Development install of Pixman (e.g. libpixman-1-dev)
> > 
> > Should we add a configure test for Pixman? I guess this is needed by Qemu.
> 
> Yes, it is a QEMU dependency.
> 
> Is it actually a good idea to replicate all the configure checks done by
> QEMU's configure script in the Xen configure script?

I don't think it's a good idea to duplicate checks. We should call
qemu's ./configure early, perhaps from our ./configure, and make sure
that errors are clearly propagated and messaged to the user.

Matt

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 05:10:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 05:10:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdDQJ-00041b-Py; Tue, 27 Nov 2012 05:09:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TdDQI-00041W-WB
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 05:09:31 +0000
Received: from [85.158.137.99:8426] by server-16.bemta-3.messagelabs.com id
	FD/1F-07461-90B44B05; Tue, 27 Nov 2012 05:09:29 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1353992969!18373115!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11413 invoked from network); 27 Nov 2012 05:09:29 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 05:09:29 -0000
X-IronPort-AV: E=Sophos;i="4.83,325,1352073600"; d="scan'208";a="16013710"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 05:09:28 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 27 Nov 2012 05:09:27 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TdDQF-0002q9-IP;
	Tue, 27 Nov 2012 05:09:27 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TdDQF-0006rX-I5;
	Tue, 27 Nov 2012 05:09:27 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14477-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 27 Nov 2012 05:09:27 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14477: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14477 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14477/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14475
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14475

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass

version targeted for testing:
 xen                  16bf7f3069a7
baseline version:
 xen                  0049de3827bc

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Olaf Hering <olaf@aepfle.de>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=16bf7f3069a7
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 16bf7f3069a7
+ branch=xen-unstable
+ revision=16bf7f3069a7
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 16bf7f3069a7 ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 05:10:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 05:10:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdDQJ-00041b-Py; Tue, 27 Nov 2012 05:09:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TdDQI-00041W-WB
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 05:09:31 +0000
Received: from [85.158.137.99:8426] by server-16.bemta-3.messagelabs.com id
	FD/1F-07461-90B44B05; Tue, 27 Nov 2012 05:09:29 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1353992969!18373115!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11413 invoked from network); 27 Nov 2012 05:09:29 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 05:09:29 -0000
X-IronPort-AV: E=Sophos;i="4.83,325,1352073600"; d="scan'208";a="16013710"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 05:09:28 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 27 Nov 2012 05:09:27 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TdDQF-0002q9-IP;
	Tue, 27 Nov 2012 05:09:27 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TdDQF-0006rX-I5;
	Tue, 27 Nov 2012 05:09:27 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14477-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 27 Nov 2012 05:09:27 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14477: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14477 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14477/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14475
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14475

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass

version targeted for testing:
 xen                  16bf7f3069a7
baseline version:
 xen                  0049de3827bc

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Olaf Hering <olaf@aepfle.de>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=16bf7f3069a7
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 16bf7f3069a7
+ branch=xen-unstable
+ revision=16bf7f3069a7
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 16bf7f3069a7 ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 07:23:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 07:23:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdFV4-0004e5-Cj; Tue, 27 Nov 2012 07:22:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <sachin.kamat@linaro.org>) id 1TdBvM-0003cU-WE
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 03:33:29 +0000
Received: from [85.158.143.99:11955] by server-2.bemta-4.messagelabs.com id
	EB/40-28922-88434B05; Tue, 27 Nov 2012 03:33:28 +0000
X-Env-Sender: sachin.kamat@linaro.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353987206!24453184!1
X-Originating-IP: [209.85.220.171]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18239 invoked from network); 27 Nov 2012 03:33:27 -0000
Received: from mail-vc0-f171.google.com (HELO mail-vc0-f171.google.com)
	(209.85.220.171)
	by server-6.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 03:33:27 -0000
Received: by mail-vc0-f171.google.com with SMTP id fo14so11479783vcb.30
	for <xen-devel@lists.xensource.com>;
	Mon, 26 Nov 2012 19:33:26 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=BoyR8yxR44Wr0zksZQoNXj3IVBcLw86dYlUbweLyn6o=;
	b=cRp5UxHnvZO684aOH7oJOtu7oBnlg0/iXJG53Rit3wboEDXQyNOMj25gbEAs1Y0f43
	cG7TTL85jLqEcM8IY2OsKrCmlrJ4pTWTKUdR0iE4wcDCUPHa+AsVDUgQj7fc4QJdQI7p
	aBzX7d83ITCRPvwtBRQkWrKVCjEf6MqdG8DCszob61B80YJYEzgv5N+kEAtHa+RwJTw1
	f6HIEX/hb0zbJ/8HulZl6BoYxNrEO8zv0E9juW41ONigQ5YwnNMOtxZZ9yjJQfjpMHBP
	r/RQalDl9rjISlK/Pko5r+V7c1ZscOel0yXHm3hBfLsUqgFwAqeWgYx+iVWzuGy668a+
	Ad+w==
MIME-Version: 1.0
Received: by 10.58.74.40 with SMTP id q8mr23221760vev.36.1353987206446; Mon,
	26 Nov 2012 19:33:26 -0800 (PST)
Received: by 10.58.252.226 with HTTP; Mon, 26 Nov 2012 19:33:26 -0800 (PST)
In-Reply-To: <1353324150-21785-1-git-send-email-sachin.kamat@linaro.org>
References: <1353324150-21785-1-git-send-email-sachin.kamat@linaro.org>
Date: Tue, 27 Nov 2012 09:03:26 +0530
Message-ID: <CAK9yfHwz3jUpT6tRR4hUC9kLfocEbC-pkmwjiOkgmAmkPrZ-6Q@mail.gmail.com>
From: Sachin Kamat <sachin.kamat@linaro.org>
To: xen-devel@lists.xensource.com, virtualization@lists.linux-foundation.org
X-Gm-Message-State: ALoCoQldGt5BZhv+XOrnmYxsv7bW7tyFGR77SEgaUVfvkmJhqSNZ+0obDFW9N5mxsUZZf1o53CT1
X-Mailman-Approved-At: Tue, 27 Nov 2012 07:22:33 +0000
Cc: sachin.kamat@linaro.org, patches@linaro.org, konrad.wilk@oracle.com
Subject: Re: [Xen-devel] [PATCH 1/1] xen/xenbus: Remove duplicate inclusion
	of asm/xen/hypervisor.h
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

ping

On 19 November 2012 16:52, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> asm/xen/hypervisor.h was included twice.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  drivers/xen/xenbus/xenbus_xs.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
> index acedeab..88e677b 100644
> --- a/drivers/xen/xenbus/xenbus_xs.c
> +++ b/drivers/xen/xenbus/xenbus_xs.c
> @@ -48,7 +48,6 @@
>  #include <xen/xenbus.h>
>  #include <xen/xen.h>
>  #include "xenbus_comms.h"
> -#include <asm/xen/hypervisor.h>
>
>  struct xs_stored_msg {
>         struct list_head list;
> --
> 1.7.4.1
>



-- 
With warm regards,
Sachin

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 07:23:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 07:23:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdFV4-0004e5-Cj; Tue, 27 Nov 2012 07:22:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <sachin.kamat@linaro.org>) id 1TdBvM-0003cU-WE
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 03:33:29 +0000
Received: from [85.158.143.99:11955] by server-2.bemta-4.messagelabs.com id
	EB/40-28922-88434B05; Tue, 27 Nov 2012 03:33:28 +0000
X-Env-Sender: sachin.kamat@linaro.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1353987206!24453184!1
X-Originating-IP: [209.85.220.171]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18239 invoked from network); 27 Nov 2012 03:33:27 -0000
Received: from mail-vc0-f171.google.com (HELO mail-vc0-f171.google.com)
	(209.85.220.171)
	by server-6.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 03:33:27 -0000
Received: by mail-vc0-f171.google.com with SMTP id fo14so11479783vcb.30
	for <xen-devel@lists.xensource.com>;
	Mon, 26 Nov 2012 19:33:26 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=BoyR8yxR44Wr0zksZQoNXj3IVBcLw86dYlUbweLyn6o=;
	b=cRp5UxHnvZO684aOH7oJOtu7oBnlg0/iXJG53Rit3wboEDXQyNOMj25gbEAs1Y0f43
	cG7TTL85jLqEcM8IY2OsKrCmlrJ4pTWTKUdR0iE4wcDCUPHa+AsVDUgQj7fc4QJdQI7p
	aBzX7d83ITCRPvwtBRQkWrKVCjEf6MqdG8DCszob61B80YJYEzgv5N+kEAtHa+RwJTw1
	f6HIEX/hb0zbJ/8HulZl6BoYxNrEO8zv0E9juW41ONigQ5YwnNMOtxZZ9yjJQfjpMHBP
	r/RQalDl9rjISlK/Pko5r+V7c1ZscOel0yXHm3hBfLsUqgFwAqeWgYx+iVWzuGy668a+
	Ad+w==
MIME-Version: 1.0
Received: by 10.58.74.40 with SMTP id q8mr23221760vev.36.1353987206446; Mon,
	26 Nov 2012 19:33:26 -0800 (PST)
Received: by 10.58.252.226 with HTTP; Mon, 26 Nov 2012 19:33:26 -0800 (PST)
In-Reply-To: <1353324150-21785-1-git-send-email-sachin.kamat@linaro.org>
References: <1353324150-21785-1-git-send-email-sachin.kamat@linaro.org>
Date: Tue, 27 Nov 2012 09:03:26 +0530
Message-ID: <CAK9yfHwz3jUpT6tRR4hUC9kLfocEbC-pkmwjiOkgmAmkPrZ-6Q@mail.gmail.com>
From: Sachin Kamat <sachin.kamat@linaro.org>
To: xen-devel@lists.xensource.com, virtualization@lists.linux-foundation.org
X-Gm-Message-State: ALoCoQldGt5BZhv+XOrnmYxsv7bW7tyFGR77SEgaUVfvkmJhqSNZ+0obDFW9N5mxsUZZf1o53CT1
X-Mailman-Approved-At: Tue, 27 Nov 2012 07:22:33 +0000
Cc: sachin.kamat@linaro.org, patches@linaro.org, konrad.wilk@oracle.com
Subject: Re: [Xen-devel] [PATCH 1/1] xen/xenbus: Remove duplicate inclusion
	of asm/xen/hypervisor.h
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

ping

On 19 November 2012 16:52, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> asm/xen/hypervisor.h was included twice.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  drivers/xen/xenbus/xenbus_xs.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
> index acedeab..88e677b 100644
> --- a/drivers/xen/xenbus/xenbus_xs.c
> +++ b/drivers/xen/xenbus/xenbus_xs.c
> @@ -48,7 +48,6 @@
>  #include <xen/xenbus.h>
>  #include <xen/xen.h>
>  #include "xenbus_comms.h"
> -#include <asm/xen/hypervisor.h>
>
>  struct xs_stored_msg {
>         struct list_head list;
> --
> 1.7.4.1
>



-- 
With warm regards,
Sachin

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 08:01:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 08:01:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdG6H-0005PW-Py; Tue, 27 Nov 2012 08:01:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdG6G-0005PR-KK
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 08:01:00 +0000
Received: from [85.158.143.99:4897] by server-1.bemta-4.messagelabs.com id
	56/6B-27934-B3374B05; Tue, 27 Nov 2012 08:00:59 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1354003259!20715755!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26101 invoked from network); 27 Nov 2012 08:00:59 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 08:00:59 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 08:00:57 +0000
Message-Id: <50B4817D02000078000AB7F5@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 08:01:49 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<50B3A8DA02000078000AB460@nat28.tlf.novell.com>
	<1353950642.5830.134.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353950642.5830.134.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Lars Kurth <lars.kurth@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 18:24, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Mon, 2012-11-26 at 16:37 +0000, Jan Beulich wrote:
>> >>> On 26.11.12 at 16:58, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> 
>> > Changesets are nominated for inclusion in the stable branch by making a
>> > request to the stable maintainer on xen-devel either by noting it as
>> > such in the submission of the original patch to xen-unstable or by a
>> > subsequent explicit email to xen-devel.
>> 
>> I think we should explicitly require the person expected to do the
>> backport to be Cc-ed; I for myself don't get around to read _all_
>> mails on xen-devel, and hence with a badly chosen subject it is not
>> impossible (albeit also not likely) for me to miss such a request
>> otherwise.
>> 
>> Furthermore, the branch maintainer should imo explicitly be given
>> discretion to pull in patches without explicit request on the list
> 
> How about this, I don't think we need to explicitly consider the "please
> revert it" case -- should be self evident?

Looks good to me.

Jan

> 8<----------------------------------------
> 
> Changesets are included in the stable branch at the discretion of the
> branch maintainer.
> 
> As well as changesets identified by the branch maintainer as being suitable
> for backport changes can also be nominated for inclusion in the stable
> branch by making a request to the stable maintainer on xen-devel
> either by noting it as such in the submission of the original patch to
> xen-unstable or by a subsequent explicit email to xen-devel. Such
> requests should be copied to the relevant stable maintainer. In
> addition as part of the the stable release process the stable
> maintainer will send one or more requests to xen-devel soliciting
> suggestions for patches which should be included.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 08:01:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 08:01:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdG6H-0005PW-Py; Tue, 27 Nov 2012 08:01:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdG6G-0005PR-KK
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 08:01:00 +0000
Received: from [85.158.143.99:4897] by server-1.bemta-4.messagelabs.com id
	56/6B-27934-B3374B05; Tue, 27 Nov 2012 08:00:59 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1354003259!20715755!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26101 invoked from network); 27 Nov 2012 08:00:59 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 08:00:59 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 08:00:57 +0000
Message-Id: <50B4817D02000078000AB7F5@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 08:01:49 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<50B3A8DA02000078000AB460@nat28.tlf.novell.com>
	<1353950642.5830.134.camel@zakaz.uk.xensource.com>
In-Reply-To: <1353950642.5830.134.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Lars Kurth <lars.kurth@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 18:24, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Mon, 2012-11-26 at 16:37 +0000, Jan Beulich wrote:
>> >>> On 26.11.12 at 16:58, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> 
>> > Changesets are nominated for inclusion in the stable branch by making a
>> > request to the stable maintainer on xen-devel either by noting it as
>> > such in the submission of the original patch to xen-unstable or by a
>> > subsequent explicit email to xen-devel.
>> 
>> I think we should explicitly require the person expected to do the
>> backport to be Cc-ed; I for myself don't get around to read _all_
>> mails on xen-devel, and hence with a badly chosen subject it is not
>> impossible (albeit also not likely) for me to miss such a request
>> otherwise.
>> 
>> Furthermore, the branch maintainer should imo explicitly be given
>> discretion to pull in patches without explicit request on the list
> 
> How about this, I don't think we need to explicitly consider the "please
> revert it" case -- should be self evident?

Looks good to me.

Jan

> 8<----------------------------------------
> 
> Changesets are included in the stable branch at the discretion of the
> branch maintainer.
> 
> As well as changesets identified by the branch maintainer as being suitable
> for backport changes can also be nominated for inclusion in the stable
> branch by making a request to the stable maintainer on xen-devel
> either by noting it as such in the submission of the original patch to
> xen-unstable or by a subsequent explicit email to xen-devel. Such
> requests should be copied to the relevant stable maintainer. In
> addition as part of the the stable release process the stable
> maintainer will send one or more requests to xen-devel soliciting
> suggestions for patches which should be included.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 08:05:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 08:05:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdG9u-0005W5-EP; Tue, 27 Nov 2012 08:04:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdG9t-0005W0-6y
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 08:04:45 +0000
Received: from [85.158.143.99:38401] by server-3.bemta-4.messagelabs.com id
	7A/B0-06841-C1474B05; Tue, 27 Nov 2012 08:04:44 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1354003483!30933319!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 829 invoked from network); 27 Nov 2012 08:04:43 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 08:04:43 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 08:04:43 +0000
Message-Id: <50B4825F02000078000AB7FD@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 08:05:35 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "George Dunlap" <dunlapg@umich.edu>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
In-Reply-To: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 18:57, George Dunlap <dunlapg@umich.edu> wrote:
> So while doing a bit of investigation into a request that we have
> instructions for how to sign a Xen binary, I came across a related pair of
> questions.  If we boot from a signed Xen binary, then:
> 1. Will Xen then successfully boot a signed dom0 kernel / initrd?
> 2. Will Xen fail to boot an unsigned dom0 kernel / initrd?
> 
> I think if Xen is signed, then ideally we want both 1 and 2 to be true,
> right?  Does UEFI provide a way to check the signature of files?  Does it
> happen automatically, or would we need to add extra support?  Or would we
> need to embed a public key within the Xen binary and have Xen check the
> signatures of files that it reads?

I don't have any answers to these questions yet; as we need to
do this for our upcoming SLE11 SP3, I'm expecting our EFI and/or
kernel folks to come forward with an outline of what needs to be
done (and ideally with an implementation in the boot loader) that
I could then just clone for the Xen code. I had expected that to
happen already, but it's apparently not making enough progress
(or the progress is not visible to me).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 08:05:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 08:05:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdG9u-0005W5-EP; Tue, 27 Nov 2012 08:04:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdG9t-0005W0-6y
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 08:04:45 +0000
Received: from [85.158.143.99:38401] by server-3.bemta-4.messagelabs.com id
	7A/B0-06841-C1474B05; Tue, 27 Nov 2012 08:04:44 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1354003483!30933319!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 829 invoked from network); 27 Nov 2012 08:04:43 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 08:04:43 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 08:04:43 +0000
Message-Id: <50B4825F02000078000AB7FD@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 08:05:35 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "George Dunlap" <dunlapg@umich.edu>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
In-Reply-To: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 18:57, George Dunlap <dunlapg@umich.edu> wrote:
> So while doing a bit of investigation into a request that we have
> instructions for how to sign a Xen binary, I came across a related pair of
> questions.  If we boot from a signed Xen binary, then:
> 1. Will Xen then successfully boot a signed dom0 kernel / initrd?
> 2. Will Xen fail to boot an unsigned dom0 kernel / initrd?
> 
> I think if Xen is signed, then ideally we want both 1 and 2 to be true,
> right?  Does UEFI provide a way to check the signature of files?  Does it
> happen automatically, or would we need to add extra support?  Or would we
> need to embed a public key within the Xen binary and have Xen check the
> signatures of files that it reads?

I don't have any answers to these questions yet; as we need to
do this for our upcoming SLE11 SP3, I'm expecting our EFI and/or
kernel folks to come forward with an outline of what needs to be
done (and ideally with an implementation in the boot loader) that
I could then just clone for the Xen code. I had expected that to
happen already, but it's apparently not making enough progress
(or the progress is not visible to me).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 08:25:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 08:25:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdGTC-0005ij-9q; Tue, 27 Nov 2012 08:24:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdGTB-0005ie-K7
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 08:24:41 +0000
Received: from [85.158.143.99:24010] by server-3.bemta-4.messagelabs.com id
	A8/1A-06841-8C874B05; Tue, 27 Nov 2012 08:24:40 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1354004679!26237836!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24296 invoked from network); 27 Nov 2012 08:24:39 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 08:24:39 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 08:24:39 +0000
Message-Id: <50B4870C02000078000AB81A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 08:25:32 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <f433c3e9-4874-4613-aa81-99a9cfe57986@default>
In-Reply-To: <f433c3e9-4874-4613-aa81-99a9cfe57986@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: markus@oberhumer.com, Keir Fraser <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] lzo update in hypervisor?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 27.11.12 at 01:33, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> In theory, would there be any objections to updating
> Xen's lzo.c and unlzo.c to accomodate Markus Oberhumer's
> dramatic performance improvements recently posted to
> upstream Linux targeted for 3.8 and briefly described here:
> 
> https://lkml.org/lkml/2012/8/21/350 
> (short version: typically 2x faster)

No objection from me.

> Also, might it be reasonable/acceptable for
> this to retain the Linux formatting so that
> this and future updates need not be reformatted?

You contributed that file originally with not-really-Linux,
not-really-Xen formatting. The decompressors I added later
based on Linux code all retained the Linux coding style, so getting
the LZO code aligned back is certainly in line with that (and our
general policy).

> AFAIK, tmem is the only user of this code.

Not anymore - the Dom0 kernel may come LZO-compressed, and
hence the decompression code is also being used there.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 08:25:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 08:25:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdGTC-0005ij-9q; Tue, 27 Nov 2012 08:24:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdGTB-0005ie-K7
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 08:24:41 +0000
Received: from [85.158.143.99:24010] by server-3.bemta-4.messagelabs.com id
	A8/1A-06841-8C874B05; Tue, 27 Nov 2012 08:24:40 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1354004679!26237836!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24296 invoked from network); 27 Nov 2012 08:24:39 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 08:24:39 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 08:24:39 +0000
Message-Id: <50B4870C02000078000AB81A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 08:25:32 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <f433c3e9-4874-4613-aa81-99a9cfe57986@default>
In-Reply-To: <f433c3e9-4874-4613-aa81-99a9cfe57986@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: markus@oberhumer.com, Keir Fraser <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] lzo update in hypervisor?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 27.11.12 at 01:33, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> In theory, would there be any objections to updating
> Xen's lzo.c and unlzo.c to accomodate Markus Oberhumer's
> dramatic performance improvements recently posted to
> upstream Linux targeted for 3.8 and briefly described here:
> 
> https://lkml.org/lkml/2012/8/21/350 
> (short version: typically 2x faster)

No objection from me.

> Also, might it be reasonable/acceptable for
> this to retain the Linux formatting so that
> this and future updates need not be reformatted?

You contributed that file originally with not-really-Linux,
not-really-Xen formatting. The decompressors I added later
based on Linux code all retained the Linux coding style, so getting
the LZO code aligned back is certainly in line with that (and our
general policy).

> AFAIK, tmem is the only user of this code.

Not anymore - the Dom0 kernel may come LZO-compressed, and
hence the decompression code is also being used there.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 08:38:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 08:38:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdGfw-0005sj-LS; Tue, 27 Nov 2012 08:37:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdGfv-0005se-MQ
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 08:37:51 +0000
Received: from [85.158.139.83:30643] by server-14.bemta-5.messagelabs.com id
	49/38-21768-EDB74B05; Tue, 27 Nov 2012 08:37:50 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1354005470!26949077!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16421 invoked from network); 27 Nov 2012 08:37:50 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 08:37:50 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 08:37:49 +0000
Message-Id: <50B48A2302000078000AB837@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 08:38:43 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <07fd91ec-8b57-47d8-a44d-3b593de6bb9f@default>
In-Reply-To: <07fd91ec-8b57-47d8-a44d-3b593de6bb9f@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	KonradWilk <konrad.wilk@oracle.com>,
	AndresLagar-Cavilla <andreslc@gridcentric.ca>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [PATCH v7 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 19:11, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> +unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pages)
> +{
> +    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
> +
> +    ASSERT(spin_is_locked(&d->page_alloc_lock));
> +    if ( !d->unclaimed_pages )
> +        return d->tot_pages += pages;

So after the conditional adjustment above, I fail to see where
d->tot_pages would get adjusted in the code below. Which gets
me to ask ...

> +    spin_lock(&heap_lock);
> +    dom_before = d->unclaimed_pages;
> +    dom_after = dom_before - pages;
> +    if ( (dom_before > 0) && (dom_after < 0) )
> +        dom_claimed = 0;
> +    else
> +        dom_claimed = dom_after;
> +    sys_before = total_unclaimed_pages;
> +    sys_after = sys_before - (dom_before - dom_claimed);
> +    BUG_ON( (sys_before > 0) && (sys_after < 0) );
> +    total_unclaimed_pages = sys_after;
> +    d->unclaimed_pages = dom_claimed;
> +    spin_unlock(&heap_lock);
> +    return d->tot_pages;
> +}

...: Is there actually a strong reason why there needs to be an
"increase" and a "decrease" version of this, rather than just
having an "adjust" operation with a signed page count
parameter?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 08:38:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 08:38:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdGfw-0005sj-LS; Tue, 27 Nov 2012 08:37:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdGfv-0005se-MQ
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 08:37:51 +0000
Received: from [85.158.139.83:30643] by server-14.bemta-5.messagelabs.com id
	49/38-21768-EDB74B05; Tue, 27 Nov 2012 08:37:50 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1354005470!26949077!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16421 invoked from network); 27 Nov 2012 08:37:50 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 08:37:50 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 08:37:49 +0000
Message-Id: <50B48A2302000078000AB837@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 08:38:43 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <07fd91ec-8b57-47d8-a44d-3b593de6bb9f@default>
In-Reply-To: <07fd91ec-8b57-47d8-a44d-3b593de6bb9f@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	KonradWilk <konrad.wilk@oracle.com>,
	AndresLagar-Cavilla <andreslc@gridcentric.ca>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [PATCH v7 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 19:11, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> +unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pages)
> +{
> +    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
> +
> +    ASSERT(spin_is_locked(&d->page_alloc_lock));
> +    if ( !d->unclaimed_pages )
> +        return d->tot_pages += pages;

So after the conditional adjustment above, I fail to see where
d->tot_pages would get adjusted in the code below. Which gets
me to ask ...

> +    spin_lock(&heap_lock);
> +    dom_before = d->unclaimed_pages;
> +    dom_after = dom_before - pages;
> +    if ( (dom_before > 0) && (dom_after < 0) )
> +        dom_claimed = 0;
> +    else
> +        dom_claimed = dom_after;
> +    sys_before = total_unclaimed_pages;
> +    sys_after = sys_before - (dom_before - dom_claimed);
> +    BUG_ON( (sys_before > 0) && (sys_after < 0) );
> +    total_unclaimed_pages = sys_after;
> +    d->unclaimed_pages = dom_claimed;
> +    spin_unlock(&heap_lock);
> +    return d->tot_pages;
> +}

...: Is there actually a strong reason why there needs to be an
"increase" and a "decrease" version of this, rather than just
having an "adjust" operation with a signed page count
parameter?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 08:48:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 08:48:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdGq7-00062O-S8; Tue, 27 Nov 2012 08:48:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdGq5-00062J-Nd
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 08:48:21 +0000
Received: from [85.158.143.35:64668] by server-3.bemta-4.messagelabs.com id
	14/6C-06841-55E74B05; Tue, 27 Nov 2012 08:48:21 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354006085!16332376!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16609 invoked from network); 27 Nov 2012 08:48:05 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 08:48:05 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 08:48:05 +0000
Message-Id: <50B48C8A02000078000AB851@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 08:48:58 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <38a09df7-3d82-403f-9153-9a151b220a41@default>
In-Reply-To: <38a09df7-3d82-403f-9153-9a151b220a41@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: KeirFraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	TimDeegan <tim@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 20:07, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> While it has always been my understanding that the
> hypervisor is intended to be toolstack-independent,
> Jan would like your Ack before committing the hypervisor
> changes.
> 
> So if you still object, please state your objections.
> Otherwise, please ack, so Jan can commit it and Oracle
> can move forward with toolstack development built
> on the hypercall.

Sorry, there must have been some misunderstanding here: First
of all, without a maintainer's ack (Keir's in this case) I can't commit
anything to code that I'm not explicitly listed for as maintainer.

Second, while I said the code itself looks acceptable, I also pointed
out that in the shape it is right now it is dead code, as there's no
user for it. So all we would get would be the risk of new bugs (and
the one I just pointed out worries me in so far as how much testing
this code really has seen).

Third, deferral (or denial) of the patch going in is certainly not a
blocking factor for tools side development at Oracle. In the worst
case, you'd have to maintain the patch in your own tree(s); I do
realize that you want to avoid that (as I would, but there are
examples of patches that we carry in our trees that didn't get
accepted into the community one - luckily they're of smaller size).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 08:48:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 08:48:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdGq7-00062O-S8; Tue, 27 Nov 2012 08:48:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdGq5-00062J-Nd
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 08:48:21 +0000
Received: from [85.158.143.35:64668] by server-3.bemta-4.messagelabs.com id
	14/6C-06841-55E74B05; Tue, 27 Nov 2012 08:48:21 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354006085!16332376!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16609 invoked from network); 27 Nov 2012 08:48:05 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 08:48:05 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 08:48:05 +0000
Message-Id: <50B48C8A02000078000AB851@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 08:48:58 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <38a09df7-3d82-403f-9153-9a151b220a41@default>
In-Reply-To: <38a09df7-3d82-403f-9153-9a151b220a41@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: KeirFraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	TimDeegan <tim@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 20:07, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> While it has always been my understanding that the
> hypervisor is intended to be toolstack-independent,
> Jan would like your Ack before committing the hypervisor
> changes.
> 
> So if you still object, please state your objections.
> Otherwise, please ack, so Jan can commit it and Oracle
> can move forward with toolstack development built
> on the hypercall.

Sorry, there must have been some misunderstanding here: First
of all, without a maintainer's ack (Keir's in this case) I can't commit
anything to code that I'm not explicitly listed for as maintainer.

Second, while I said the code itself looks acceptable, I also pointed
out that in the shape it is right now it is dead code, as there's no
user for it. So all we would get would be the risk of new bugs (and
the one I just pointed out worries me in so far as how much testing
this code really has seen).

Third, deferral (or denial) of the patch going in is certainly not a
blocking factor for tools side development at Oracle. In the worst
case, you'd have to maintain the patch in your own tree(s); I do
realize that you want to avoid that (as I would, but there are
examples of patches that we carry in our trees that didn't get
accepted into the community one - luckily they're of smaller size).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 08:57:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 08:57:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdGyD-0006C6-Rq; Tue, 27 Nov 2012 08:56:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TdGyC-0006C1-GN
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 08:56:44 +0000
Received: from [193.109.254.147:4444] by server-9.bemta-14.messagelabs.com id
	59/C6-30773-B4084B05; Tue, 27 Nov 2012 08:56:43 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1354006602!8565356!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27336 invoked from network); 27 Nov 2012 08:56:42 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 08:56:42 -0000
Received: by mail-we0-f173.google.com with SMTP id z2so3212003wey.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 00:56:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=VcaHZJLjTavlMN4CaMv84niPJBYise8/XM1gsIMp54M=;
	b=0t1LUDV+go6OhRNdrg0b2cOWR8sMsL+rFhnzbap/4MEsZFQg2l42v64Mlx48qc9Xa+
	pARNnEAxQb+cV1ho1iHnJIL5DRcC4N+bx8K2tnCRjSPSvCNS4a/Y/8P2/fyrffEDRCRH
	QPLs8lHq0ffL5RnCPXaLJ9xGH/QMaum5fr9GWg6Z9QoEOpmYVUDmIDfK6USsVoxtssmN
	PAog6rwEVszCmfi7DCBm0hok9Poqh0s1aWdUeORr5IjsieBKzA4FDYYZQQwgpaIUIoBt
	wtSw8RdNlQw2B/xOJ/mysnc7o7bw33SO03a6pbqgqbVGBY+pcP5HSbhXSAbYQI2i6zYG
	Lv/Q==
Received: by 10.216.90.73 with SMTP id d51mr4505310wef.188.1354006602341;
	Tue, 27 Nov 2012 00:56:42 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id dd4sm1863666wib.2.2012.11.27.00.56.38
	(version=SSLv3 cipher=OTHER); Tue, 27 Nov 2012 00:56:41 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Tue, 27 Nov 2012 08:56:34 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <CCDA30C2.5380E%keir@xen.org>
Thread-Topic: [Xen-devel] lzo update in hypervisor?
Thread-Index: Ac3MfRnV6b6IA6D+PUWw1nwBbLuvWg==
In-Reply-To: <50B4870C02000078000AB81A@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: markus@oberhumer.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] lzo update in hypervisor?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 27/11/2012 08:25, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 27.11.12 at 01:33, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>> In theory, would there be any objections to updating
>> Xen's lzo.c and unlzo.c to accomodate Markus Oberhumer's
>> dramatic performance improvements recently posted to
>> upstream Linux targeted for 3.8 and briefly described here:
>> 
>> https://lkml.org/lkml/2012/8/21/350
>> (short version: typically 2x faster)
> 
> No objection from me.

Nor me, I agree with all Jan says.

 K.

>> Also, might it be reasonable/acceptable for
>> this to retain the Linux formatting so that
>> this and future updates need not be reformatted?
> 
> You contributed that file originally with not-really-Linux,
> not-really-Xen formatting. The decompressors I added later
> based on Linux code all retained the Linux coding style, so getting
> the LZO code aligned back is certainly in line with that (and our
> general policy).
> 
>> AFAIK, tmem is the only user of this code.
> 
> Not anymore - the Dom0 kernel may come LZO-compressed, and
> hence the decompression code is also being used there.
> 
> Jan
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 08:57:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 08:57:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdGyD-0006C6-Rq; Tue, 27 Nov 2012 08:56:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TdGyC-0006C1-GN
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 08:56:44 +0000
Received: from [193.109.254.147:4444] by server-9.bemta-14.messagelabs.com id
	59/C6-30773-B4084B05; Tue, 27 Nov 2012 08:56:43 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1354006602!8565356!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27336 invoked from network); 27 Nov 2012 08:56:42 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 08:56:42 -0000
Received: by mail-we0-f173.google.com with SMTP id z2so3212003wey.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 00:56:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=VcaHZJLjTavlMN4CaMv84niPJBYise8/XM1gsIMp54M=;
	b=0t1LUDV+go6OhRNdrg0b2cOWR8sMsL+rFhnzbap/4MEsZFQg2l42v64Mlx48qc9Xa+
	pARNnEAxQb+cV1ho1iHnJIL5DRcC4N+bx8K2tnCRjSPSvCNS4a/Y/8P2/fyrffEDRCRH
	QPLs8lHq0ffL5RnCPXaLJ9xGH/QMaum5fr9GWg6Z9QoEOpmYVUDmIDfK6USsVoxtssmN
	PAog6rwEVszCmfi7DCBm0hok9Poqh0s1aWdUeORr5IjsieBKzA4FDYYZQQwgpaIUIoBt
	wtSw8RdNlQw2B/xOJ/mysnc7o7bw33SO03a6pbqgqbVGBY+pcP5HSbhXSAbYQI2i6zYG
	Lv/Q==
Received: by 10.216.90.73 with SMTP id d51mr4505310wef.188.1354006602341;
	Tue, 27 Nov 2012 00:56:42 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id dd4sm1863666wib.2.2012.11.27.00.56.38
	(version=SSLv3 cipher=OTHER); Tue, 27 Nov 2012 00:56:41 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Tue, 27 Nov 2012 08:56:34 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <CCDA30C2.5380E%keir@xen.org>
Thread-Topic: [Xen-devel] lzo update in hypervisor?
Thread-Index: Ac3MfRnV6b6IA6D+PUWw1nwBbLuvWg==
In-Reply-To: <50B4870C02000078000AB81A@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: markus@oberhumer.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] lzo update in hypervisor?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 27/11/2012 08:25, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 27.11.12 at 01:33, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>> In theory, would there be any objections to updating
>> Xen's lzo.c and unlzo.c to accomodate Markus Oberhumer's
>> dramatic performance improvements recently posted to
>> upstream Linux targeted for 3.8 and briefly described here:
>> 
>> https://lkml.org/lkml/2012/8/21/350
>> (short version: typically 2x faster)
> 
> No objection from me.

Nor me, I agree with all Jan says.

 K.

>> Also, might it be reasonable/acceptable for
>> this to retain the Linux formatting so that
>> this and future updates need not be reformatted?
> 
> You contributed that file originally with not-really-Linux,
> not-really-Xen formatting. The decompressors I added later
> based on Linux code all retained the Linux coding style, so getting
> the LZO code aligned back is certainly in line with that (and our
> general policy).
> 
>> AFAIK, tmem is the only user of this code.
> 
> Not anymore - the Dom0 kernel may come LZO-compressed, and
> hence the decompression code is also being used there.
> 
> Jan
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 09:14:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 09:14:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdHEr-0006PM-M4; Tue, 27 Nov 2012 09:13:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdHEq-0006PH-N4
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 09:13:56 +0000
Received: from [85.158.143.99:41673] by server-1.bemta-4.messagelabs.com id
	E2/46-27934-45484B05; Tue, 27 Nov 2012 09:13:56 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1354007635!20308544!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27528 invoked from network); 27 Nov 2012 09:13:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 09:13:55 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16016844"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 09:13:55 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 09:13:55 +0000
Message-ID: <1354007634.5830.136.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matt Wilson <msw@amazon.com>
Date: Tue, 27 Nov 2012 09:13:54 +0000
In-Reply-To: <20121127025938.GA3854@u109add4315675089e695.ant.amazon.com>
References: <alpine.DEB.2.02.1211231250330.13749@kaball.uk.xensource.com>
	<50B357A7.6050905@citrix.com>
	<alpine.DEB.2.02.1211261934370.5310@kaball.uk.xensource.com>
	<20121127025938.GA3854@u109add4315675089e695.ant.amazon.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Roger Pau Monne <roger.pau@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] README: add Pixman as build dependency
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 02:59 +0000, Matt Wilson wrote:
> On Mon, Nov 26, 2012 at 07:35:43PM +0000, Stefano Stabellini wrote:
> > On Mon, 26 Nov 2012, Roger Pau Monne wrote:
> > > On 23/11/12 13:51, Stefano Stabellini wrote:
> > > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > > 
> > > > diff --git a/README b/README
> > > > index 21a81b2..88300df 100644
> > > > --- a/README
> > > > +++ b/README
> > > > @@ -51,6 +51,7 @@ provided by your OS distributor:
> > > >      * Development install of libaio (e.g. libaio-dev) version 0.3.107 or
> > > >        greater. Set CONFIG_SYSTEM_LIBAIO in .config if this is not available.
> > > >      * Development install of GLib v2.0 (e.g. libglib2.0-dev)
> > > > +    * Development install of Pixman (e.g. libpixman-1-dev)
> > > 
> > > Should we add a configure test for Pixman? I guess this is needed by Qemu.
> > 
> > Yes, it is a QEMU dependency.
> > 
> > Is it actually a good idea to replicate all the configure checks done by
> > QEMU's configure script in the Xen configure script?
> 
> I don't think it's a good idea to duplicate checks.

Ack.

>  We should call
> qemu's ./configure early, perhaps from our ./configure, and

Problem is that tools/qemu-blah/configure isn't available until it is
cloned, which happens at build rather than configure time.

>  make sure
> that errors are clearly propagated and messaged to the user.

We should strive for this no matter when/where the qemu configure is
run. So long as qemu's configure fails cleanly and we abort when that
fails we should be in reasonable shape?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 09:14:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 09:14:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdHEr-0006PM-M4; Tue, 27 Nov 2012 09:13:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdHEq-0006PH-N4
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 09:13:56 +0000
Received: from [85.158.143.99:41673] by server-1.bemta-4.messagelabs.com id
	E2/46-27934-45484B05; Tue, 27 Nov 2012 09:13:56 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1354007635!20308544!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM2NDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27528 invoked from network); 27 Nov 2012 09:13:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 09:13:55 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16016844"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 09:13:55 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 09:13:55 +0000
Message-ID: <1354007634.5830.136.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matt Wilson <msw@amazon.com>
Date: Tue, 27 Nov 2012 09:13:54 +0000
In-Reply-To: <20121127025938.GA3854@u109add4315675089e695.ant.amazon.com>
References: <alpine.DEB.2.02.1211231250330.13749@kaball.uk.xensource.com>
	<50B357A7.6050905@citrix.com>
	<alpine.DEB.2.02.1211261934370.5310@kaball.uk.xensource.com>
	<20121127025938.GA3854@u109add4315675089e695.ant.amazon.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Roger Pau Monne <roger.pau@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] README: add Pixman as build dependency
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 02:59 +0000, Matt Wilson wrote:
> On Mon, Nov 26, 2012 at 07:35:43PM +0000, Stefano Stabellini wrote:
> > On Mon, 26 Nov 2012, Roger Pau Monne wrote:
> > > On 23/11/12 13:51, Stefano Stabellini wrote:
> > > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > > 
> > > > diff --git a/README b/README
> > > > index 21a81b2..88300df 100644
> > > > --- a/README
> > > > +++ b/README
> > > > @@ -51,6 +51,7 @@ provided by your OS distributor:
> > > >      * Development install of libaio (e.g. libaio-dev) version 0.3.107 or
> > > >        greater. Set CONFIG_SYSTEM_LIBAIO in .config if this is not available.
> > > >      * Development install of GLib v2.0 (e.g. libglib2.0-dev)
> > > > +    * Development install of Pixman (e.g. libpixman-1-dev)
> > > 
> > > Should we add a configure test for Pixman? I guess this is needed by Qemu.
> > 
> > Yes, it is a QEMU dependency.
> > 
> > Is it actually a good idea to replicate all the configure checks done by
> > QEMU's configure script in the Xen configure script?
> 
> I don't think it's a good idea to duplicate checks.

Ack.

>  We should call
> qemu's ./configure early, perhaps from our ./configure, and

Problem is that tools/qemu-blah/configure isn't available until it is
cloned, which happens at build rather than configure time.

>  make sure
> that errors are clearly propagated and messaged to the user.

We should strive for this no matter when/where the qemu configure is
run. So long as qemu's configure fails cleanly and we abort when that
fails we should be in reasonable shape?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 09:41:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 09:41:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdHf0-0006aW-0P; Tue, 27 Nov 2012 09:40:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdHey-0006aQ-Ho
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 09:40:56 +0000
Received: from [85.158.139.211:11321] by server-6.bemta-5.messagelabs.com id
	70/C9-19321-7AA84B05; Tue, 27 Nov 2012 09:40:55 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354009249!17561317!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30625 invoked from network); 27 Nov 2012 09:40:49 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 09:40:49 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 09:40:46 +0000
Message-Id: <50B498E502000078000AB8B3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 09:41:41 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <xiantao.zhang@intel.com>,"xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Subject: [Xen-devel] ATS and dependent features
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

All,

while investigating an issue with some device not working under Xen
without "ats=off", I started wondering whether it is correct to allow
the Dom0 kernel concurrent control over ATS, PRI, and PASID - it
would seem to me that with Xen controlling the IOMMU, it should
also have exclusive control over the enabling of those features.

Thanks for any comments in this regard,
Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 09:41:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 09:41:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdHf0-0006aW-0P; Tue, 27 Nov 2012 09:40:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdHey-0006aQ-Ho
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 09:40:56 +0000
Received: from [85.158.139.211:11321] by server-6.bemta-5.messagelabs.com id
	70/C9-19321-7AA84B05; Tue, 27 Nov 2012 09:40:55 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354009249!17561317!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30625 invoked from network); 27 Nov 2012 09:40:49 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 09:40:49 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 09:40:46 +0000
Message-Id: <50B498E502000078000AB8B3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 09:41:41 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <xiantao.zhang@intel.com>,"xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Subject: [Xen-devel] ATS and dependent features
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

All,

while investigating an issue with some device not working under Xen
without "ats=off", I started wondering whether it is correct to allow
the Dom0 kernel concurrent control over ATS, PRI, and PASID - it
would seem to me that with Xen controlling the IOMMU, it should
also have exclusive control over the enabling of those features.

Thanks for any comments in this regard,
Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 09:51:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 09:51:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdHp2-0006jv-4I; Tue, 27 Nov 2012 09:51:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TdHoz-0006jq-S8
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 09:51:18 +0000
Received: from [85.158.139.211:22400] by server-11.bemta-5.messagelabs.com id
	6B/8D-03409-51D84B05; Tue, 27 Nov 2012 09:51:17 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354009856!17564008!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 495 invoked from network); 27 Nov 2012 09:50:58 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 09:50:58 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so14946888vbi.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 01:50:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=cAuzXzkMUAErJZddpESehFe+UKiTCIL2IsriLvhOXhM=;
	b=zowR2NuLjwu0EOkgjleY3X62gNpsLUCsK1hdC+ztwqhcsy7LEv+gJSy4x3pmUuciKq
	U5KpAHx2YJz0KE1/a2ZsB7/6kPMqxW9QRz8I5rsK+2FhcIgvGTBxFrbY3ugddwfTkP47
	se/LXyypu8tpW/7NabD6rmuOS1iYC5IeZGvoJNmW4YD0B1jZ3BGp+iZs6cbPgJ+kIa2M
	JjvB2+wA18usvBAcZoAkqhwBlQDZvGRQlsq9kxA3DFFu1MHA7qUVOiewPdS7xQiNkDMo
	p+vtO3Y7218Z1mNQe/PXsC4AvQv8NXZYqAza4xXoD685qGHXX/VHvQrTmlFekNI82Wy3
	f7Rg==
MIME-Version: 1.0
Received: by 10.52.92.144 with SMTP id cm16mr20207351vdb.36.1354009855718;
	Tue, 27 Nov 2012 01:50:55 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Tue, 27 Nov 2012 01:50:55 -0800 (PST)
In-Reply-To: <20121126215104.2343b419@pyramind.ukuu.org.uk>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<alpine.DEB.2.02.1211262011190.5310@kaball.uk.xensource.com>
	<20121126215104.2343b419@pyramind.ukuu.org.uk>
Date: Tue, 27 Nov 2012 09:50:55 +0000
X-Google-Sender-Auth: q8gZKUH5F_mGFFad1fVoWR7VUrs
Message-ID: <CAFLBxZYmgJEHB4ipg-s2Tasyg+Wc3NTg=ESifMqiswSGajSsmg@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8870787158439854631=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============8870787158439854631==
Content-Type: multipart/alternative; boundary=20cf307cff9678f69504cf76fcd9

--20cf307cff9678f69504cf76fcd9
Content-Type: text/plain; charset=ISO-8859-1

On Mon, Nov 26, 2012 at 9:51 PM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

> I think you'd have to be out of your tree to try and sign Xen itself
> using the MS setup - assuming you can ever get a key and get it to work
> which seems to be an issue of its own.
>

> You want to sign a small bootloader that is tightly auditable and do your
> own key management within that for anything else. I would think you'd be
> able to make use of the Linux bootloader work.
>

I was thinking of people who wanted to install their own keys.  Some people
think that since you have EFI you shouldn't need a bootloader. :-)

But you're right, I think on the whole the critical thing is just to make
sure that "secure" bootloaders from distros know how to load signed Xen /
Linux images.  Booting Xen directly is probably going to be a bit niche.
That said, I'm sure there are people who will want to do it, so it probably
should be on our "to-do" list.


>
> Better yet would be to take the entire sorry EFI and 'secure' boot mess
> and kick it where the sun won't shine but alas that may be a challenge
> until the PC manufacturers realise they can't handle the support costs of
> things in the current state and fix it.
>

I'm not sure the vendors have much choice in the matter, as long as a
single vendor controls the majority of the market and can dictate terms.

 -George

--20cf307cff9678f69504cf76fcd9
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Mon, Nov 26, 2012 at 9:51 PM, Alan Cox <span dir=3D"ltr">&lt;<a href=3D"=
mailto:alan@lxorguk.ukuu.org.uk" target=3D"_blank">alan@lxorguk.ukuu.org.uk=
</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_qu=
ote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bo=
rder-left:1px solid rgb(204,204,204);padding-left:1ex">
I think you&#39;d have to be out of your tree to try and sign Xen itself<br=
>
using the MS setup - assuming you can ever get a key and get it to work<br>
which seems to be an issue of its own. <br></blockquote><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex">
<br>
You want to sign a small bootloader that is tightly auditable and do your<b=
r>
own key management within that for anything else. I would think you&#39;d b=
e<br>
able to make use of the Linux bootloader work.<br></blockquote><div><br>I w=
as thinking of people who wanted to install their own keys.=A0 Some people =
think that since you have EFI you shouldn&#39;t need a bootloader. :-) <br>
<br>But you&#39;re right, I think on the whole the critical thing is just t=
o make sure that &quot;secure&quot; bootloaders from distros know how to lo=
ad signed Xen / Linux images.=A0 Booting Xen directly is probably going to =
be a bit niche.=A0 That said, I&#39;m sure there are people who will want t=
o do it, so it probably should be on our &quot;to-do&quot; list.<br>
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e=
x;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Better yet would be to take the entire sorry EFI and &#39;secure&#39; boot =
mess<br>
and kick it where the sun won&#39;t shine but alas that may be a challenge<=
br>
until the PC manufacturers realise they can&#39;t handle the support costs =
of<br>
things in the current state and fix it.<br></blockquote><div><br>I&#39;m no=
t sure the vendors have much choice in the matter, as long as a single vend=
or controls the majority of the market and can dictate terms.<br></div>
</div><br>=A0-George<br></div>

--20cf307cff9678f69504cf76fcd9--


--===============8870787158439854631==
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.xen.org
http://lists.xen.org/xen-devel

--===============8870787158439854631==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 09:51:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 09:51:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdHp2-0006jv-4I; Tue, 27 Nov 2012 09:51:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TdHoz-0006jq-S8
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 09:51:18 +0000
Received: from [85.158.139.211:22400] by server-11.bemta-5.messagelabs.com id
	6B/8D-03409-51D84B05; Tue, 27 Nov 2012 09:51:17 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354009856!17564008!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 495 invoked from network); 27 Nov 2012 09:50:58 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 09:50:58 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so14946888vbi.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 01:50:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=cAuzXzkMUAErJZddpESehFe+UKiTCIL2IsriLvhOXhM=;
	b=zowR2NuLjwu0EOkgjleY3X62gNpsLUCsK1hdC+ztwqhcsy7LEv+gJSy4x3pmUuciKq
	U5KpAHx2YJz0KE1/a2ZsB7/6kPMqxW9QRz8I5rsK+2FhcIgvGTBxFrbY3ugddwfTkP47
	se/LXyypu8tpW/7NabD6rmuOS1iYC5IeZGvoJNmW4YD0B1jZ3BGp+iZs6cbPgJ+kIa2M
	JjvB2+wA18usvBAcZoAkqhwBlQDZvGRQlsq9kxA3DFFu1MHA7qUVOiewPdS7xQiNkDMo
	p+vtO3Y7218Z1mNQe/PXsC4AvQv8NXZYqAza4xXoD685qGHXX/VHvQrTmlFekNI82Wy3
	f7Rg==
MIME-Version: 1.0
Received: by 10.52.92.144 with SMTP id cm16mr20207351vdb.36.1354009855718;
	Tue, 27 Nov 2012 01:50:55 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Tue, 27 Nov 2012 01:50:55 -0800 (PST)
In-Reply-To: <20121126215104.2343b419@pyramind.ukuu.org.uk>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<alpine.DEB.2.02.1211262011190.5310@kaball.uk.xensource.com>
	<20121126215104.2343b419@pyramind.ukuu.org.uk>
Date: Tue, 27 Nov 2012 09:50:55 +0000
X-Google-Sender-Auth: q8gZKUH5F_mGFFad1fVoWR7VUrs
Message-ID: <CAFLBxZYmgJEHB4ipg-s2Tasyg+Wc3NTg=ESifMqiswSGajSsmg@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8870787158439854631=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============8870787158439854631==
Content-Type: multipart/alternative; boundary=20cf307cff9678f69504cf76fcd9

--20cf307cff9678f69504cf76fcd9
Content-Type: text/plain; charset=ISO-8859-1

On Mon, Nov 26, 2012 at 9:51 PM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

> I think you'd have to be out of your tree to try and sign Xen itself
> using the MS setup - assuming you can ever get a key and get it to work
> which seems to be an issue of its own.
>

> You want to sign a small bootloader that is tightly auditable and do your
> own key management within that for anything else. I would think you'd be
> able to make use of the Linux bootloader work.
>

I was thinking of people who wanted to install their own keys.  Some people
think that since you have EFI you shouldn't need a bootloader. :-)

But you're right, I think on the whole the critical thing is just to make
sure that "secure" bootloaders from distros know how to load signed Xen /
Linux images.  Booting Xen directly is probably going to be a bit niche.
That said, I'm sure there are people who will want to do it, so it probably
should be on our "to-do" list.


>
> Better yet would be to take the entire sorry EFI and 'secure' boot mess
> and kick it where the sun won't shine but alas that may be a challenge
> until the PC manufacturers realise they can't handle the support costs of
> things in the current state and fix it.
>

I'm not sure the vendors have much choice in the matter, as long as a
single vendor controls the majority of the market and can dictate terms.

 -George

--20cf307cff9678f69504cf76fcd9
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Mon, Nov 26, 2012 at 9:51 PM, Alan Cox <span dir=3D"ltr">&lt;<a href=3D"=
mailto:alan@lxorguk.ukuu.org.uk" target=3D"_blank">alan@lxorguk.ukuu.org.uk=
</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_qu=
ote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bo=
rder-left:1px solid rgb(204,204,204);padding-left:1ex">
I think you&#39;d have to be out of your tree to try and sign Xen itself<br=
>
using the MS setup - assuming you can ever get a key and get it to work<br>
which seems to be an issue of its own. <br></blockquote><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex">
<br>
You want to sign a small bootloader that is tightly auditable and do your<b=
r>
own key management within that for anything else. I would think you&#39;d b=
e<br>
able to make use of the Linux bootloader work.<br></blockquote><div><br>I w=
as thinking of people who wanted to install their own keys.=A0 Some people =
think that since you have EFI you shouldn&#39;t need a bootloader. :-) <br>
<br>But you&#39;re right, I think on the whole the critical thing is just t=
o make sure that &quot;secure&quot; bootloaders from distros know how to lo=
ad signed Xen / Linux images.=A0 Booting Xen directly is probably going to =
be a bit niche.=A0 That said, I&#39;m sure there are people who will want t=
o do it, so it probably should be on our &quot;to-do&quot; list.<br>
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e=
x;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Better yet would be to take the entire sorry EFI and &#39;secure&#39; boot =
mess<br>
and kick it where the sun won&#39;t shine but alas that may be a challenge<=
br>
until the PC manufacturers realise they can&#39;t handle the support costs =
of<br>
things in the current state and fix it.<br></blockquote><div><br>I&#39;m no=
t sure the vendors have much choice in the matter, as long as a single vend=
or controls the majority of the market and can dictate terms.<br></div>
</div><br>=A0-George<br></div>

--20cf307cff9678f69504cf76fcd9--


--===============8870787158439854631==
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.xen.org
http://lists.xen.org/xen-devel

--===============8870787158439854631==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 09:56:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 09:56:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdHtv-0006sx-2P; Tue, 27 Nov 2012 09:56:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>) id 1TdHtt-0006sr-N3
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 09:56:22 +0000
Received: from [85.158.139.211:9315] by server-8.bemta-5.messagelabs.com id
	C0/4C-06050-44E84B05; Tue, 27 Nov 2012 09:56:20 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1354010173!17967723!1
X-Originating-IP: [209.85.217.173]
X-SpamReason: No, hits=1.7 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_10_20, HTML_MESSAGE, ML_RADAR_SPEW_LINKS_14, RCVD_BY_IP,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27222 invoked from network); 27 Nov 2012 09:56:14 -0000
Received: from mail-lb0-f173.google.com (HELO mail-lb0-f173.google.com)
	(209.85.217.173)
	by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 09:56:14 -0000
Received: by mail-lb0-f173.google.com with SMTP id c1so8192541lbg.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 01:56:13 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=zsmgEfSShDi+Mvc4RnuMV35BhYtxjEW/6cTfmb7xVnc=;
	b=ylJhJDLN6MabI5soma+X4SlpGdNZlXczGvmXKYSXBVpgwm/o+W3intwt5ijFMJL1Rx
	kpZzsf5mVDIQKYsA8NnwAiPWgYDJ7urjXQhaZcxRgF7apAgUL1DHGQectbLoji1DytTW
	+hOk6zo+RMB2K0lpWG23wo+KFNtcgYDc3pNOPPTXkGrHi5neRUeG2zVuNrEx2lGeBSzp
	ibqq8vKJsuElEhca31G7pulSIXJfsMewk6tRPeNSoVc1EnJF7lmGl1WACfKX7UCKpgN8
	D5VbEYjiz+9iR3gCn0oWWIacrVSrUB3hs/dQ/mZi+bS3F2xIuMbQaRYf1ZsRI4ycatho
	pW5Q==
MIME-Version: 1.0
Received: by 10.112.24.170 with SMTP id v10mr6260253lbf.88.1354010173154; Tue,
	27 Nov 2012 01:56:13 -0800 (PST)
Received: by 10.112.135.7 with HTTP; Tue, 27 Nov 2012 01:56:13 -0800 (PST)
In-Reply-To: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
Date: Tue, 27 Nov 2012 09:56:13 +0000
Message-ID: <CAOqnZH4qVRoDCpaCGT3zuJu85t17XkuUJSoxBoMhXd95p9b5tg@mail.gmail.com>
From: Lars Kurth <lars.kurth.xen@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>, Keir Fraser <keir@xen.org>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2246411556748621189=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============2246411556748621189==
Content-Type: multipart/alternative; boundary=e0cb4efe2ee864a5dd04cf770f66

--e0cb4efe2ee864a5dd04cf770f66
Content-Type: text/plain; charset=ISO-8859-1

> (I think s/4.3/3.4/ was intended in the above)
Yes, it was me and this indeed a typo

Defining what we do is actually what I was looking for, as this is not
clear to everybody.

> Each stable branch has a maintainer who is nominated/volunteers and is
> accepted via consensus among the maintainers and committers (XXX or just
> committers?).
I am wondering whether we should treat this exactly like maintainership.
It's the same idea.
We could just add a "stable release" section to the MAINTAINERS file and
follow the same
process of nominating a maintainer. Or track the stable release maintainer
in the branched
versions of the file. Does anybody have any views?

Maybe a short section of what the responsibilities of a release
maintainer would be useful (view a view to making it a little easier for
somebody to
step up should they wish to) and a little section on what to do if a
contributor feels that
a bug-fix should be backported (with a view to making the release
maintainers life
easier). Anyway, this is just a suggestion.

Otherwise this sounds like a good proposal and starting point. Thanks for
putting it together.

Regards
Lars


On Mon, Nov 26, 2012 at 3:58 PM, Ian Campbell <Ian.Campbell@citrix.com>wrote:

> Lars (I presume it was he who added this TODO) would like to have a
> policy written down.
>
> http://wiki.xen.org/wiki/Xen_Document_Days/TODO#Document_Policy_on_Maintenance_Releasessays:
>         Which releases are supported, for how long. Owners. As well as a
>         mechanism for individuals (or vendors) to take ownership of
>         older releases (as is the case for Xen 4.3).
>
> (I think s/4.3/3.4/ was intended in the above)
>
> I thought it would be worth sketching out my understanding of the
> informal process we have for people to pick holes in. I've tried to
> stick to what we actually do rather than defining policy.
>
> Ian.
>
> 8<--------------------
>
> Each new Xen release X.Y.0 starts a new stable maintenance branch.
>
> Each such branch is in in its own mercurial repository
> xen-X.Y-testing.hg. Releases happen roughly every 3 months. The first
> release on a stable branch is often sooner and as the branch reaches the
> end of its life the interval may be longer.
>
> In general Xen.org supports the two most recent stable branches at any
> given time. When a new X.Y.0 release is made there is usually one more
> release on the to-be-retired stable branch to mop up any loose patches
> sitting in the repo at which point the branch is retired. For example we
> are currently in the 4.3 development cycle and are supporting two stable
> branches: 4.1-testing and 4.2-testing. After 4.2.0 was released there
> was one more release in the 4.0-testing stream (4.0.4 IIRC) and then the
> 4.0 branch was been retired.
>
>         XXX how did Jan become stable maintainer, I think he just
>         volunteered at the developer meeting and was accepted via the
>         usual consensus driven approach? Lets try:
>
> Each stable branch has a maintainer who is nominated/volunteers and is
> accepted via consensus among the maintainers and committers (XXX or just
> committers?). For the branches maintained by Xen.org this would usually
> be one of the xen-unstable committers or maintainers. However community
> members can step up to maintain a release once Xen.org no longer does so
> (e.g. as happened with Keith and xen-3.4-testing.hg).
>
> Currently Jan Beulich is the stable maintainer for both 4.1-testing and
> 4.2-testing having taken over from Keir Fraser when 4.2.0 was released.
> Jan delegates tools backports to Ian Jackson. Community member Keith
> Coleman continues to maintain the 3.4-testing branch (XXX does he
> still?) which he took over when 4.1.0 was released.
>
> No new development happens in the X.Y-testing branches, instead
> changesets are backported from xen-unstable. Where this is not possible
> (perhaps unstable has moved on such that the patch cannot be applied or
> the approach used in unstable is otherwise not valid for the stable
> branch) then a specific fix can be created for the stable branch.
> However it is a requirement that the issue will always be fixed in
> unstable first (this is to avoid regressions on the next stable
> release).
>
> In general only bug fixes are accepted into stable branches and new
> features are not normally accepted. (There can be exceptions, e.g. it
> was agreed that 4.2.1 would take a more relaxed approach to features
> which improved xl compatibility with xm). As time passes each stable
> branch becomes more conservative and the barrier to accepting a patch
> for backport becomes higher.
>
> Changesets are nominated for inclusion in the stable branch by making a
> request to the stable maintainer on xen-devel either by noting it as
> such in the submission of the original patch to xen-unstable or by a
> subsequent explicit email to xen-devel. In addition as part of the the
> stable release process the stable maintainer will send one or more
> requests to xen-devel soliciting suggestions for patches which should be
> included.
>
>
>

--e0cb4efe2ee864a5dd04cf770f66
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

&gt; (I think s/4.3/3.4/ was intended in the above)<br>Yes, it was me and t=
his indeed a typo<br><br>Defining what we do is actually what I was looking=
 for, as this is not clear to everybody.<br><br>&gt; Each stable branch has=
 a maintainer who is nominated/volunteers and is<br>

&gt; accepted via consensus among the maintainers and committers (XXX or ju=
st<br>&gt; committers?). <br>I am wondering whether we should treat this ex=
actly like maintainership. It&#39;s the same idea.<br>We could just add a &=
quot;stable release&quot; section to the MAINTAINERS file and follow the sa=
me <br>
process of nominating a maintainer. Or track the stable release maintainer =
in the branched<br>versions of the file. Does anybody have any views?<br><b=
r>Maybe a short section of what the responsibilities of a release<br>mainta=
iner would be useful (view a view to making it a little easier for somebody=
 to<br>
step up should they wish to) and a little section on what to do if a contri=
butor feels that<br>a bug-fix should be backported (with a view to making t=
he release maintainers life<br>easier). Anyway, this is just a suggestion.<=
br>
<br>Otherwise this sounds like a good proposal and starting point. Thanks f=
or putting it together.<br><br>Regards<br>Lars<br><br><br><div class=3D"gma=
il_quote">On Mon, Nov 26, 2012 at 3:58 PM, Ian Campbell <span dir=3D"ltr">&=
lt;<a href=3D"mailto:Ian.Campbell@citrix.com" target=3D"_blank">Ian.Campbel=
l@citrix.com</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">Lars (I presume it was he who added this TOD=
O) would like to have a<br>
policy written down.<br>
<a href=3D"http://wiki.xen.org/wiki/Xen_Document_Days/TODO#Document_Policy_=
on_Maintenance_Releases" target=3D"_blank">http://wiki.xen.org/wiki/Xen_Doc=
ument_Days/TODO#Document_Policy_on_Maintenance_Releases</a> says:<br>
=A0 =A0 =A0 =A0 Which releases are supported, for how long. Owners. As well=
 as a<br>
=A0 =A0 =A0 =A0 mechanism for individuals (or vendors) to take ownership of=
<br>
=A0 =A0 =A0 =A0 older releases (as is the case for Xen 4.3).<br>
<br>
(I think s/4.3/3.4/ was intended in the above)<br>
<br>
I thought it would be worth sketching out my understanding of the<br>
informal process we have for people to pick holes in. I&#39;ve tried to<br>
stick to what we actually do rather than defining policy.<br>
<br>
Ian.<br>
<br>
8&lt;--------------------<br>
<br>
Each new Xen release X.Y.0 starts a new stable maintenance branch.<br>
<br>
Each such branch is in in its own mercurial repository<br>
xen-X.Y-testing.hg. Releases happen roughly every 3 months. The first<br>
release on a stable branch is often sooner and as the branch reaches the<br=
>
end of its life the interval may be longer.<br>
<br>
In general Xen.org supports the two most recent stable branches at any<br>
given time. When a new X.Y.0 release is made there is usually one more<br>
release on the to-be-retired stable branch to mop up any loose patches<br>
sitting in the repo at which point the branch is retired. For example we<br=
>
are currently in the 4.3 development cycle and are supporting two stable<br=
>
branches: 4.1-testing and 4.2-testing. After 4.2.0 was released there<br>
was one more release in the 4.0-testing stream (4.0.4 IIRC) and then the<br=
>
4.0 branch was been retired.<br>
<br>
=A0 =A0 =A0 =A0 XXX how did Jan become stable maintainer, I think he just<b=
r>
=A0 =A0 =A0 =A0 volunteered at the developer meeting and was accepted via t=
he<br>
=A0 =A0 =A0 =A0 usual consensus driven approach? Lets try:<br>
<br>
Each stable branch has a maintainer who is nominated/volunteers and is<br>
accepted via consensus among the maintainers and committers (XXX or just<br=
>
committers?). For the branches maintained by Xen.org this would usually<br>
be one of the xen-unstable committers or maintainers. However community<br>
members can step up to maintain a release once Xen.org no longer does so<br=
>
(e.g. as happened with Keith and xen-3.4-testing.hg).<br>
<br>
Currently Jan Beulich is the stable maintainer for both 4.1-testing and<br>
4.2-testing having taken over from Keir Fraser when 4.2.0 was released.<br>
Jan delegates tools backports to Ian Jackson. Community member Keith<br>
Coleman continues to maintain the 3.4-testing branch (XXX does he<br>
still?) which he took over when 4.1.0 was released.<br>
<br>
No new development happens in the X.Y-testing branches, instead<br>
changesets are backported from xen-unstable. Where this is not possible<br>
(perhaps unstable has moved on such that the patch cannot be applied or<br>
the approach used in unstable is otherwise not valid for the stable<br>
branch) then a specific fix can be created for the stable branch.<br>
However it is a requirement that the issue will always be fixed in<br>
unstable first (this is to avoid regressions on the next stable<br>
release).<br>
<br>
In general only bug fixes are accepted into stable branches and new<br>
features are not normally accepted. (There can be exceptions, e.g. it<br>
was agreed that 4.2.1 would take a more relaxed approach to features<br>
which improved xl compatibility with xm). As time passes each stable<br>
branch becomes more conservative and the barrier to accepting a patch<br>
for backport becomes higher.<br>
<br>
Changesets are nominated for inclusion in the stable branch by making a<br>
request to the stable maintainer on xen-devel either by noting it as<br>
such in the submission of the original patch to xen-unstable or by a<br>
subsequent explicit email to xen-devel. In addition as part of the the<br>
stable release process the stable maintainer will send one or more<br>
requests to xen-devel soliciting suggestions for patches which should be<br=
>
included.<br>
<br>
<br>
</blockquote></div><br>

--e0cb4efe2ee864a5dd04cf770f66--


--===============2246411556748621189==
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.xen.org
http://lists.xen.org/xen-devel

--===============2246411556748621189==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 09:56:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 09:56:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdHtv-0006sx-2P; Tue, 27 Nov 2012 09:56:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>) id 1TdHtt-0006sr-N3
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 09:56:22 +0000
Received: from [85.158.139.211:9315] by server-8.bemta-5.messagelabs.com id
	C0/4C-06050-44E84B05; Tue, 27 Nov 2012 09:56:20 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1354010173!17967723!1
X-Originating-IP: [209.85.217.173]
X-SpamReason: No, hits=1.7 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_10_20, HTML_MESSAGE, ML_RADAR_SPEW_LINKS_14, RCVD_BY_IP,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27222 invoked from network); 27 Nov 2012 09:56:14 -0000
Received: from mail-lb0-f173.google.com (HELO mail-lb0-f173.google.com)
	(209.85.217.173)
	by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 09:56:14 -0000
Received: by mail-lb0-f173.google.com with SMTP id c1so8192541lbg.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 01:56:13 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=zsmgEfSShDi+Mvc4RnuMV35BhYtxjEW/6cTfmb7xVnc=;
	b=ylJhJDLN6MabI5soma+X4SlpGdNZlXczGvmXKYSXBVpgwm/o+W3intwt5ijFMJL1Rx
	kpZzsf5mVDIQKYsA8NnwAiPWgYDJ7urjXQhaZcxRgF7apAgUL1DHGQectbLoji1DytTW
	+hOk6zo+RMB2K0lpWG23wo+KFNtcgYDc3pNOPPTXkGrHi5neRUeG2zVuNrEx2lGeBSzp
	ibqq8vKJsuElEhca31G7pulSIXJfsMewk6tRPeNSoVc1EnJF7lmGl1WACfKX7UCKpgN8
	D5VbEYjiz+9iR3gCn0oWWIacrVSrUB3hs/dQ/mZi+bS3F2xIuMbQaRYf1ZsRI4ycatho
	pW5Q==
MIME-Version: 1.0
Received: by 10.112.24.170 with SMTP id v10mr6260253lbf.88.1354010173154; Tue,
	27 Nov 2012 01:56:13 -0800 (PST)
Received: by 10.112.135.7 with HTTP; Tue, 27 Nov 2012 01:56:13 -0800 (PST)
In-Reply-To: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
Date: Tue, 27 Nov 2012 09:56:13 +0000
Message-ID: <CAOqnZH4qVRoDCpaCGT3zuJu85t17XkuUJSoxBoMhXd95p9b5tg@mail.gmail.com>
From: Lars Kurth <lars.kurth.xen@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>, Keir Fraser <keir@xen.org>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2246411556748621189=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============2246411556748621189==
Content-Type: multipart/alternative; boundary=e0cb4efe2ee864a5dd04cf770f66

--e0cb4efe2ee864a5dd04cf770f66
Content-Type: text/plain; charset=ISO-8859-1

> (I think s/4.3/3.4/ was intended in the above)
Yes, it was me and this indeed a typo

Defining what we do is actually what I was looking for, as this is not
clear to everybody.

> Each stable branch has a maintainer who is nominated/volunteers and is
> accepted via consensus among the maintainers and committers (XXX or just
> committers?).
I am wondering whether we should treat this exactly like maintainership.
It's the same idea.
We could just add a "stable release" section to the MAINTAINERS file and
follow the same
process of nominating a maintainer. Or track the stable release maintainer
in the branched
versions of the file. Does anybody have any views?

Maybe a short section of what the responsibilities of a release
maintainer would be useful (view a view to making it a little easier for
somebody to
step up should they wish to) and a little section on what to do if a
contributor feels that
a bug-fix should be backported (with a view to making the release
maintainers life
easier). Anyway, this is just a suggestion.

Otherwise this sounds like a good proposal and starting point. Thanks for
putting it together.

Regards
Lars


On Mon, Nov 26, 2012 at 3:58 PM, Ian Campbell <Ian.Campbell@citrix.com>wrote:

> Lars (I presume it was he who added this TODO) would like to have a
> policy written down.
>
> http://wiki.xen.org/wiki/Xen_Document_Days/TODO#Document_Policy_on_Maintenance_Releasessays:
>         Which releases are supported, for how long. Owners. As well as a
>         mechanism for individuals (or vendors) to take ownership of
>         older releases (as is the case for Xen 4.3).
>
> (I think s/4.3/3.4/ was intended in the above)
>
> I thought it would be worth sketching out my understanding of the
> informal process we have for people to pick holes in. I've tried to
> stick to what we actually do rather than defining policy.
>
> Ian.
>
> 8<--------------------
>
> Each new Xen release X.Y.0 starts a new stable maintenance branch.
>
> Each such branch is in in its own mercurial repository
> xen-X.Y-testing.hg. Releases happen roughly every 3 months. The first
> release on a stable branch is often sooner and as the branch reaches the
> end of its life the interval may be longer.
>
> In general Xen.org supports the two most recent stable branches at any
> given time. When a new X.Y.0 release is made there is usually one more
> release on the to-be-retired stable branch to mop up any loose patches
> sitting in the repo at which point the branch is retired. For example we
> are currently in the 4.3 development cycle and are supporting two stable
> branches: 4.1-testing and 4.2-testing. After 4.2.0 was released there
> was one more release in the 4.0-testing stream (4.0.4 IIRC) and then the
> 4.0 branch was been retired.
>
>         XXX how did Jan become stable maintainer, I think he just
>         volunteered at the developer meeting and was accepted via the
>         usual consensus driven approach? Lets try:
>
> Each stable branch has a maintainer who is nominated/volunteers and is
> accepted via consensus among the maintainers and committers (XXX or just
> committers?). For the branches maintained by Xen.org this would usually
> be one of the xen-unstable committers or maintainers. However community
> members can step up to maintain a release once Xen.org no longer does so
> (e.g. as happened with Keith and xen-3.4-testing.hg).
>
> Currently Jan Beulich is the stable maintainer for both 4.1-testing and
> 4.2-testing having taken over from Keir Fraser when 4.2.0 was released.
> Jan delegates tools backports to Ian Jackson. Community member Keith
> Coleman continues to maintain the 3.4-testing branch (XXX does he
> still?) which he took over when 4.1.0 was released.
>
> No new development happens in the X.Y-testing branches, instead
> changesets are backported from xen-unstable. Where this is not possible
> (perhaps unstable has moved on such that the patch cannot be applied or
> the approach used in unstable is otherwise not valid for the stable
> branch) then a specific fix can be created for the stable branch.
> However it is a requirement that the issue will always be fixed in
> unstable first (this is to avoid regressions on the next stable
> release).
>
> In general only bug fixes are accepted into stable branches and new
> features are not normally accepted. (There can be exceptions, e.g. it
> was agreed that 4.2.1 would take a more relaxed approach to features
> which improved xl compatibility with xm). As time passes each stable
> branch becomes more conservative and the barrier to accepting a patch
> for backport becomes higher.
>
> Changesets are nominated for inclusion in the stable branch by making a
> request to the stable maintainer on xen-devel either by noting it as
> such in the submission of the original patch to xen-unstable or by a
> subsequent explicit email to xen-devel. In addition as part of the the
> stable release process the stable maintainer will send one or more
> requests to xen-devel soliciting suggestions for patches which should be
> included.
>
>
>

--e0cb4efe2ee864a5dd04cf770f66
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

&gt; (I think s/4.3/3.4/ was intended in the above)<br>Yes, it was me and t=
his indeed a typo<br><br>Defining what we do is actually what I was looking=
 for, as this is not clear to everybody.<br><br>&gt; Each stable branch has=
 a maintainer who is nominated/volunteers and is<br>

&gt; accepted via consensus among the maintainers and committers (XXX or ju=
st<br>&gt; committers?). <br>I am wondering whether we should treat this ex=
actly like maintainership. It&#39;s the same idea.<br>We could just add a &=
quot;stable release&quot; section to the MAINTAINERS file and follow the sa=
me <br>
process of nominating a maintainer. Or track the stable release maintainer =
in the branched<br>versions of the file. Does anybody have any views?<br><b=
r>Maybe a short section of what the responsibilities of a release<br>mainta=
iner would be useful (view a view to making it a little easier for somebody=
 to<br>
step up should they wish to) and a little section on what to do if a contri=
butor feels that<br>a bug-fix should be backported (with a view to making t=
he release maintainers life<br>easier). Anyway, this is just a suggestion.<=
br>
<br>Otherwise this sounds like a good proposal and starting point. Thanks f=
or putting it together.<br><br>Regards<br>Lars<br><br><br><div class=3D"gma=
il_quote">On Mon, Nov 26, 2012 at 3:58 PM, Ian Campbell <span dir=3D"ltr">&=
lt;<a href=3D"mailto:Ian.Campbell@citrix.com" target=3D"_blank">Ian.Campbel=
l@citrix.com</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">Lars (I presume it was he who added this TOD=
O) would like to have a<br>
policy written down.<br>
<a href=3D"http://wiki.xen.org/wiki/Xen_Document_Days/TODO#Document_Policy_=
on_Maintenance_Releases" target=3D"_blank">http://wiki.xen.org/wiki/Xen_Doc=
ument_Days/TODO#Document_Policy_on_Maintenance_Releases</a> says:<br>
=A0 =A0 =A0 =A0 Which releases are supported, for how long. Owners. As well=
 as a<br>
=A0 =A0 =A0 =A0 mechanism for individuals (or vendors) to take ownership of=
<br>
=A0 =A0 =A0 =A0 older releases (as is the case for Xen 4.3).<br>
<br>
(I think s/4.3/3.4/ was intended in the above)<br>
<br>
I thought it would be worth sketching out my understanding of the<br>
informal process we have for people to pick holes in. I&#39;ve tried to<br>
stick to what we actually do rather than defining policy.<br>
<br>
Ian.<br>
<br>
8&lt;--------------------<br>
<br>
Each new Xen release X.Y.0 starts a new stable maintenance branch.<br>
<br>
Each such branch is in in its own mercurial repository<br>
xen-X.Y-testing.hg. Releases happen roughly every 3 months. The first<br>
release on a stable branch is often sooner and as the branch reaches the<br=
>
end of its life the interval may be longer.<br>
<br>
In general Xen.org supports the two most recent stable branches at any<br>
given time. When a new X.Y.0 release is made there is usually one more<br>
release on the to-be-retired stable branch to mop up any loose patches<br>
sitting in the repo at which point the branch is retired. For example we<br=
>
are currently in the 4.3 development cycle and are supporting two stable<br=
>
branches: 4.1-testing and 4.2-testing. After 4.2.0 was released there<br>
was one more release in the 4.0-testing stream (4.0.4 IIRC) and then the<br=
>
4.0 branch was been retired.<br>
<br>
=A0 =A0 =A0 =A0 XXX how did Jan become stable maintainer, I think he just<b=
r>
=A0 =A0 =A0 =A0 volunteered at the developer meeting and was accepted via t=
he<br>
=A0 =A0 =A0 =A0 usual consensus driven approach? Lets try:<br>
<br>
Each stable branch has a maintainer who is nominated/volunteers and is<br>
accepted via consensus among the maintainers and committers (XXX or just<br=
>
committers?). For the branches maintained by Xen.org this would usually<br>
be one of the xen-unstable committers or maintainers. However community<br>
members can step up to maintain a release once Xen.org no longer does so<br=
>
(e.g. as happened with Keith and xen-3.4-testing.hg).<br>
<br>
Currently Jan Beulich is the stable maintainer for both 4.1-testing and<br>
4.2-testing having taken over from Keir Fraser when 4.2.0 was released.<br>
Jan delegates tools backports to Ian Jackson. Community member Keith<br>
Coleman continues to maintain the 3.4-testing branch (XXX does he<br>
still?) which he took over when 4.1.0 was released.<br>
<br>
No new development happens in the X.Y-testing branches, instead<br>
changesets are backported from xen-unstable. Where this is not possible<br>
(perhaps unstable has moved on such that the patch cannot be applied or<br>
the approach used in unstable is otherwise not valid for the stable<br>
branch) then a specific fix can be created for the stable branch.<br>
However it is a requirement that the issue will always be fixed in<br>
unstable first (this is to avoid regressions on the next stable<br>
release).<br>
<br>
In general only bug fixes are accepted into stable branches and new<br>
features are not normally accepted. (There can be exceptions, e.g. it<br>
was agreed that 4.2.1 would take a more relaxed approach to features<br>
which improved xl compatibility with xm). As time passes each stable<br>
branch becomes more conservative and the barrier to accepting a patch<br>
for backport becomes higher.<br>
<br>
Changesets are nominated for inclusion in the stable branch by making a<br>
request to the stable maintainer on xen-devel either by noting it as<br>
such in the submission of the original patch to xen-unstable or by a<br>
subsequent explicit email to xen-devel. In addition as part of the the<br>
stable release process the stable maintainer will send one or more<br>
requests to xen-devel soliciting suggestions for patches which should be<br=
>
included.<br>
<br>
<br>
</blockquote></div><br>

--e0cb4efe2ee864a5dd04cf770f66--


--===============2246411556748621189==
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.xen.org
http://lists.xen.org/xen-devel

--===============2246411556748621189==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 10:03:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:03:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdI0X-00077Q-Uo; Tue, 27 Nov 2012 10:03:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdI0W-00077L-Rh
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:03:12 +0000
Received: from [85.158.139.83:29470] by server-12.bemta-5.messagelabs.com id
	AA/C3-02886-0EF84B05; Tue, 27 Nov 2012 10:03:12 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1354010591!29382528!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30724 invoked from network); 27 Nov 2012 10:03:11 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:03:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16018218"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:03:11 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:03:11 +0000
Message-ID: <1354010590.5830.165.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jim Fehlig <jfehlig@suse.com>
Date: Tue, 27 Nov 2012 10:03:10 +0000
In-Reply-To: <50B3F9CA.4030208@suse.com>
References: <0451e6041bdd88c90eee.1353395794@linux-bjrd.bjz>
	<1353663822.13542.183.camel@zakaz.uk.xensource.com>
	<50B3F9CA.4030208@suse.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Bamvor Jian Zhang <bjzhang@suse.com>
Subject: Re: [Xen-devel] [PATCH] fix race condition between libvirtd event
 handling and libxl fd deregister
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 23:22 +0000, Jim Fehlig wrote:
> FYI, I hit the race again today on a test machine without this patch,
> and no longer encountered the race after applying the patch.  So
> 
>     Tested-by: Jim Fehlig <jfehlig@suse.com>
> 
> If ACK'ed by Ian J., can this also be added to 4.2-testing?

IMHO, Yes, absolutely.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:03:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:03:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdI0X-00077Q-Uo; Tue, 27 Nov 2012 10:03:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdI0W-00077L-Rh
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:03:12 +0000
Received: from [85.158.139.83:29470] by server-12.bemta-5.messagelabs.com id
	AA/C3-02886-0EF84B05; Tue, 27 Nov 2012 10:03:12 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1354010591!29382528!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30724 invoked from network); 27 Nov 2012 10:03:11 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:03:11 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16018218"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:03:11 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:03:11 +0000
Message-ID: <1354010590.5830.165.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jim Fehlig <jfehlig@suse.com>
Date: Tue, 27 Nov 2012 10:03:10 +0000
In-Reply-To: <50B3F9CA.4030208@suse.com>
References: <0451e6041bdd88c90eee.1353395794@linux-bjrd.bjz>
	<1353663822.13542.183.camel@zakaz.uk.xensource.com>
	<50B3F9CA.4030208@suse.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Bamvor Jian Zhang <bjzhang@suse.com>
Subject: Re: [Xen-devel] [PATCH] fix race condition between libvirtd event
 handling and libxl fd deregister
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 23:22 +0000, Jim Fehlig wrote:
> FYI, I hit the race again today on a test machine without this patch,
> and no longer encountered the race after applying the patch.  So
> 
>     Tested-by: Jim Fehlig <jfehlig@suse.com>
> 
> If ACK'ed by Ian J., can this also be added to 4.2-testing?

IMHO, Yes, absolutely.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:04:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:04:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdI17-0007AH-CT; Tue, 27 Nov 2012 10:03:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TdI15-00079q-AN
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:03:47 +0000
Received: from [85.158.143.35:48160] by server-1.bemta-4.messagelabs.com id
	8C/FF-27934-20094B05; Tue, 27 Nov 2012 10:03:46 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354010625!12734536!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3589 invoked from network); 27 Nov 2012 10:03:46 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:03:46 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16018249"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:03:45 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:03:45 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>
Date: Tue, 27 Nov 2012 11:03:39 +0100
Message-ID: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH 1/2] docs: fix persistent grants doc typo
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

U2lnbmVkLW9mZi1ieTogUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+Ci0t
LQogeGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmggfCAgICAyICstCiAxIGZpbGVzIGNoYW5n
ZWQsIDEgaW5zZXJ0aW9ucygrKSwgMSBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS94ZW4vaW5j
bHVkZS9wdWJsaWMvaW8vYmxraWYuaCBiL3hlbi9pbmNsdWRlL3B1YmxpYy9pby9ibGtpZi5oCmlu
ZGV4IGFjY2RkYTQuLmRiOWMzNzkgMTAwNjQ0Ci0tLSBhL3hlbi9pbmNsdWRlL3B1YmxpYy9pby9i
bGtpZi5oCisrKyBiL3hlbi9pbmNsdWRlL3B1YmxpYy9pby9ibGtpZi5oCkBAIC0zMDcsNyArMzA3
LDcgQEAKICAqICAgICB0aGUgZ3JhbnRzLgogICogKDgpIFRoZSBmcm9udGVuZCBkcml2ZXIgaGFz
IHRvIGFsbG93IHRoZSBiYWNrZW5kIGRyaXZlciB0byBtYXAgYWxsIGdyYW50cwogICogICAgIHdp
dGggd3JpdGUgYWNjZXNzLCBldmVuIHdoZW4gdGhleSBzaG91bGQgYmUgbWFwcGVkIHJlYWQtb25s
eSwgc2luY2UKLSAqICAgICBmdXJ0aGVyIHJlcXVlc3RzIG1heSByZXVzZSB0aGlzIGdyYW50cyBh
bmQgcmVxdWlyZSB3cml0ZSBwZXJtaXNpb25zLgorICogICAgIGZ1cnRoZXIgcmVxdWVzdHMgbWF5
IHJldXNlIHRoaXMgZ3JhbnRzIGFuZCByZXF1aXJlIHdyaXRlIHBlcm1pc3Npb25zLgogICovCiAK
IC8qCi0tIAoxLjcuNy41IChBcHBsZSBHaXQtMjYpCgoKX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxA
bGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:04:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:04:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdI17-0007AH-CT; Tue, 27 Nov 2012 10:03:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TdI15-00079q-AN
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:03:47 +0000
Received: from [85.158.143.35:48160] by server-1.bemta-4.messagelabs.com id
	8C/FF-27934-20094B05; Tue, 27 Nov 2012 10:03:46 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354010625!12734536!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3589 invoked from network); 27 Nov 2012 10:03:46 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:03:46 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16018249"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:03:45 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:03:45 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>
Date: Tue, 27 Nov 2012 11:03:39 +0100
Message-ID: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH 1/2] docs: fix persistent grants doc typo
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

U2lnbmVkLW9mZi1ieTogUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+Ci0t
LQogeGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmggfCAgICAyICstCiAxIGZpbGVzIGNoYW5n
ZWQsIDEgaW5zZXJ0aW9ucygrKSwgMSBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS94ZW4vaW5j
bHVkZS9wdWJsaWMvaW8vYmxraWYuaCBiL3hlbi9pbmNsdWRlL3B1YmxpYy9pby9ibGtpZi5oCmlu
ZGV4IGFjY2RkYTQuLmRiOWMzNzkgMTAwNjQ0Ci0tLSBhL3hlbi9pbmNsdWRlL3B1YmxpYy9pby9i
bGtpZi5oCisrKyBiL3hlbi9pbmNsdWRlL3B1YmxpYy9pby9ibGtpZi5oCkBAIC0zMDcsNyArMzA3
LDcgQEAKICAqICAgICB0aGUgZ3JhbnRzLgogICogKDgpIFRoZSBmcm9udGVuZCBkcml2ZXIgaGFz
IHRvIGFsbG93IHRoZSBiYWNrZW5kIGRyaXZlciB0byBtYXAgYWxsIGdyYW50cwogICogICAgIHdp
dGggd3JpdGUgYWNjZXNzLCBldmVuIHdoZW4gdGhleSBzaG91bGQgYmUgbWFwcGVkIHJlYWQtb25s
eSwgc2luY2UKLSAqICAgICBmdXJ0aGVyIHJlcXVlc3RzIG1heSByZXVzZSB0aGlzIGdyYW50cyBh
bmQgcmVxdWlyZSB3cml0ZSBwZXJtaXNpb25zLgorICogICAgIGZ1cnRoZXIgcmVxdWVzdHMgbWF5
IHJldXNlIHRoaXMgZ3JhbnRzIGFuZCByZXF1aXJlIHdyaXRlIHBlcm1pc3Npb25zLgogICovCiAK
IC8qCi0tIAoxLjcuNy41IChBcHBsZSBHaXQtMjYpCgoKX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxA
bGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:04:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:04:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdI17-0007AQ-O3; Tue, 27 Nov 2012 10:03:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TdI15-00079t-CP
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:03:47 +0000
Received: from [85.158.143.35:48165] by server-3.bemta-4.messagelabs.com id
	B7/46-06841-20094B05; Tue, 27 Nov 2012 10:03:46 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354010625!12734536!2
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3594 invoked from network); 27 Nov 2012 10:03:46 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:03:46 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16018250"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:03:46 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:03:46 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>
Date: Tue, 27 Nov 2012 11:03:40 +0100
Message-ID: <1354010620-31788-2-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
In-Reply-To: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
References: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH 2/2] docs: expand persistent grants protocol
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

U2lnbmVkLW9mZi1ieTogUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+Ci0t
LQogeGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmggfCAgIDI0ICsrKysrKysrKysrKysrKysr
KysrKy0tLQogMSBmaWxlcyBjaGFuZ2VkLCAyMSBpbnNlcnRpb25zKCspLCAzIGRlbGV0aW9ucygt
KQoKZGlmZiAtLWdpdCBhL3hlbi9pbmNsdWRlL3B1YmxpYy9pby9ibGtpZi5oIGIveGVuL2luY2x1
ZGUvcHVibGljL2lvL2Jsa2lmLmgKaW5kZXggZGI5YzM3OS4uNWE0YjlhZSAxMDA2NDQKLS0tIGEv
eGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmgKKysrIGIveGVuL2luY2x1ZGUvcHVibGljL2lv
L2Jsa2lmLmgKQEAgLTEzNyw3ICsxMzcsMTUgQEAKICAqICAgICAgY2FuIG1hcCBwZXJzaXN0ZW50
bHkgZGVwZW5kcyBvbiB0aGUgaW1wbGVtZW50YXRpb24sIGJ1dCBpZGVhbGx5IGl0CiAgKiAgICAg
IHNob3VsZCBiZSBSSU5HX1NJWkUgKiBCTEtJRl9NQVhfU0VHTUVOVFNfUEVSX1JFUVVFU1QuIFVz
aW5nIHRoaXMKICAqICAgICAgZmVhdHVyZSB0aGUgYmFja2VuZCBkb2Vzbid0IG5lZWQgdG8gdW5t
YXAgZWFjaCBncmFudCwgcHJldmVudGluZwotICogICAgICBjb3N0bHkgVExCIGZsdXNoZXMuCisg
KiAgICAgIGNvc3RseSBUTEIgZmx1c2hlcy4gVGhlIGJhY2tlbmQgZHJpdmVyIHNob3VsZCBvbmx5
IG1hcCBncmFudHMKKyAqICAgICAgcGVyc2lzdGVudGx5IGlmIHRoZSBmcm9udGVu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S0tLS0t
LS0tLS0KICAqCkBAIC0zMDgsNiArMzIyLDEwIEBACiAgKiAoOCkgVGhlIGZyb250ZW5kIGRyaXZl
ciBoYXMgdG8gYWxsb3cgdGhlIGJhY2tlbmQgZHJpdmVyIHRvIG1hcCBhbGwgZ3JhbnRzCiAgKiAg
ICAgd2l0aCB3cml0ZSBhY2Nlc3MsIGV2ZW4gd2hlbiB0aGV5IHNob3VsZCBiZSBtYXBwZWQgcmVh
ZC1vbmx5LCBzaW5jZQogICogICAgIGZ1cnRoZXIgcmVxdWVzdHMgbWF5IHJldXNlIHRoaXMgZ3Jh
bnRzIGFuZCByZXF1aXJlIHdyaXRlIHBlcm1pc3Npb25zLgorICogKDkpIExpbnV4IGltcGxlbWVu
dGF0aW9uIGRvZXNuJ3QgaGF2ZSBhIGxpbWl0IG9uIHRoZSBtYXhpbXVtIG51bWJlciBvZgorICog
ICAgIGdyYW50cyB0aGF0IGNhbiBiZSBwZXJzaXNudGx5IG1hcHBlZCBpbiB0aGUgZnJvbnRlbmQg
ZHJpdmVyLCBidXQKKyAqICAgICBkdWUgdG8gdGhlIGZyb250ZW50IGRyaXZlciBpbXBsZW1lbnRh
dGlvbiBpdCBzaG91bGQgbmV2ZXIgYmUgYmlnZ2VyCisgKiAgICAgdGhhbiBSSU5HX1NJWkUgKiBC
TEtJRl9NQVhfU0VHTUVOVFNfUEVSX1JFUVVFU1QuCiAgKi8KIAogLyoKLS0gCjEuNy43LjUgKEFw
cGxlIEdpdC0yNikKCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fXwpYZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6
Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:04:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:04:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdI17-0007AQ-O3; Tue, 27 Nov 2012 10:03:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TdI15-00079t-CP
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:03:47 +0000
Received: from [85.158.143.35:48165] by server-3.bemta-4.messagelabs.com id
	B7/46-06841-20094B05; Tue, 27 Nov 2012 10:03:46 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354010625!12734536!2
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3594 invoked from network); 27 Nov 2012 10:03:46 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:03:46 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16018250"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:03:46 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:03:46 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>
Date: Tue, 27 Nov 2012 11:03:40 +0100
Message-ID: <1354010620-31788-2-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
In-Reply-To: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
References: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH 2/2] docs: expand persistent grants protocol
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

U2lnbmVkLW9mZi1ieTogUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+Ci0t
LQogeGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmggfCAgIDI0ICsrKysrKysrKysrKysrKysr
KysrKy0tLQogMSBmaWxlcyBjaGFuZ2VkLCAyMSBpbnNlcnRpb25zKCspLCAzIGRlbGV0aW9ucygt
KQoKZGlmZiAtLWdpdCBhL3hlbi9pbmNsdWRlL3B1YmxpYy9pby9ibGtpZi5oIGIveGVuL2luY2x1
ZGUvcHVibGljL2lvL2Jsa2lmLmgKaW5kZXggZGI5YzM3OS4uNWE0YjlhZSAxMDA2NDQKLS0tIGEv
eGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmgKKysrIGIveGVuL2luY2x1ZGUvcHVibGljL2lv
L2Jsa2lmLmgKQEAgLTEzNyw3ICsxMzcs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gdG8gdGhlIGZyb250ZW50IGRyaXZlciBpbXBsZW1lbnRh
dGlvbiBpdCBzaG91bGQgbmV2ZXIgYmUgYmlnZ2VyCisgKiAgICAgdGhhbiBSSU5HX1NJWkUgKiBC
TEtJRl9NQVhfU0VHTUVOVFNfUEVSX1JFUVVFU1QuCiAgKi8KIAogLyoKLS0gCjEuNy43LjUgKEFw
cGxlIEdpdC0yNikKCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fXwpYZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6
Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:13:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:13:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIAR-0007Z8-Rw; Tue, 27 Nov 2012 10:13:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdIAQ-0007Z3-31
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:13:26 +0000
Received: from [85.158.139.83:49614] by server-10.bemta-5.messagelabs.com id
	CE/D1-09257-54294B05; Tue, 27 Nov 2012 10:13:25 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1354011203!23481414!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ3Mzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28065 invoked from network); 27 Nov 2012 10:13:24 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-16.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:13:24 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="45714512"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:13:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 05:13:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TdIAM-0003ek-05;
	Tue, 27 Nov 2012 10:13:22 +0000
MIME-Version: 1.0
X-Mercurial-Node: 3174dc24e3efb0c5b964c244dbfb0218a03a38cf
Message-ID: <3174dc24e3efb0c5b964.1354011201@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 27 Nov 2012 10:13:21 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Cc: ian.jackson@citrix.com, stefano.stabellini@eu.citrix.com
Subject: [Xen-devel] [PATCH] xl: xl.conf(5): correct advice re
	autoballooning vs. dom0_mem
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1354011148 0
# Node ID 3174dc24e3efb0c5b964c244dbfb0218a03a38cf
# Parent  541b0e1a36c86db5df04988dd4ade5430776a7f2
xl: xl.conf(5): correct advice re autoballooning vs. dom0_mem.

The advice was backwards, you should really disable autoballoon if you
use dom0_mem. Also add a reference to the command-line docs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 541b0e1a36c8 -r 3174dc24e3ef docs/man/xl.conf.pod.5
--- a/docs/man/xl.conf.pod.5	Tue Nov 27 10:05:35 2012 +0000
+++ b/docs/man/xl.conf.pod.5	Tue Nov 27 10:12:28 2012 +0000
@@ -49,9 +49,9 @@ The semantics of each C<KEY> defines whi
 
 If disabled then C<xl> will not attempt to reduce the amount of memory
 assigned to domain 0 in order to create free memory when starting a
-new domain. You should set this if you use the C<dom0_mem> hypervisor
-command line to reduce the amount of memory given to domain 0 by
-default.
+new domain. You are strongly recommended to set this to C<0>
+(C<False>) if you use the C<dom0_mem> hypervisor command line to
+reduce the amount of memory given to domain 0 by default.
 
 Default: C<1>
 
diff -r 541b0e1a36c8 -r 3174dc24e3ef docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Tue Nov 27 10:05:35 2012 +0000
+++ b/docs/misc/xen-command-line.markdown	Tue Nov 27 10:12:28 2012 +0000
@@ -440,6 +440,11 @@ reservation is unlimited.
 For example, to set dom0's initial memory allocation to 512MB but
 allow it to balloon up as far as 1GB use `dom0_mem=512M,max:1G`
 
+If you use this option then it is highly recommended that you disable
+any dom0 autoballooning feature present in your toolstack. See the
+_xl.conf(5)_ man page or [Xen Best
+Practices](http://wiki.xen.org/wiki/Xen_Best_Practices#Xen_dom0_dedicated_memory_and_preventing_dom0_memory_ballooning).
+
 ### dom0\_shadow
 > `= <boolean>`
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:13:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:13:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIAR-0007Z8-Rw; Tue, 27 Nov 2012 10:13:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdIAQ-0007Z3-31
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:13:26 +0000
Received: from [85.158.139.83:49614] by server-10.bemta-5.messagelabs.com id
	CE/D1-09257-54294B05; Tue, 27 Nov 2012 10:13:25 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1354011203!23481414!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ3Mzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28065 invoked from network); 27 Nov 2012 10:13:24 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-16.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:13:24 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="45714512"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:13:22 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 05:13:22 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TdIAM-0003ek-05;
	Tue, 27 Nov 2012 10:13:22 +0000
MIME-Version: 1.0
X-Mercurial-Node: 3174dc24e3efb0c5b964c244dbfb0218a03a38cf
Message-ID: <3174dc24e3efb0c5b964.1354011201@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 27 Nov 2012 10:13:21 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Cc: ian.jackson@citrix.com, stefano.stabellini@eu.citrix.com
Subject: [Xen-devel] [PATCH] xl: xl.conf(5): correct advice re
	autoballooning vs. dom0_mem
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1354011148 0
# Node ID 3174dc24e3efb0c5b964c244dbfb0218a03a38cf
# Parent  541b0e1a36c86db5df04988dd4ade5430776a7f2
xl: xl.conf(5): correct advice re autoballooning vs. dom0_mem.

The advice was backwards, you should really disable autoballoon if you
use dom0_mem. Also add a reference to the command-line docs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 541b0e1a36c8 -r 3174dc24e3ef docs/man/xl.conf.pod.5
--- a/docs/man/xl.conf.pod.5	Tue Nov 27 10:05:35 2012 +0000
+++ b/docs/man/xl.conf.pod.5	Tue Nov 27 10:12:28 2012 +0000
@@ -49,9 +49,9 @@ The semantics of each C<KEY> defines whi
 
 If disabled then C<xl> will not attempt to reduce the amount of memory
 assigned to domain 0 in order to create free memory when starting a
-new domain. You should set this if you use the C<dom0_mem> hypervisor
-command line to reduce the amount of memory given to domain 0 by
-default.
+new domain. You are strongly recommended to set this to C<0>
+(C<False>) if you use the C<dom0_mem> hypervisor command line to
+reduce the amount of memory given to domain 0 by default.
 
 Default: C<1>
 
diff -r 541b0e1a36c8 -r 3174dc24e3ef docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Tue Nov 27 10:05:35 2012 +0000
+++ b/docs/misc/xen-command-line.markdown	Tue Nov 27 10:12:28 2012 +0000
@@ -440,6 +440,11 @@ reservation is unlimited.
 For example, to set dom0's initial memory allocation to 512MB but
 allow it to balloon up as far as 1GB use `dom0_mem=512M,max:1G`
 
+If you use this option then it is highly recommended that you disable
+any dom0 autoballooning feature present in your toolstack. See the
+_xl.conf(5)_ man page or [Xen Best
+Practices](http://wiki.xen.org/wiki/Xen_Best_Practices#Xen_dom0_dedicated_memory_and_preventing_dom0_memory_ballooning).
+
 ### dom0\_shadow
 > `= <boolean>`
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:22:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIIw-0007im-SY; Tue, 27 Nov 2012 10:22:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TdIIv-0007ih-IF
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:22:13 +0000
Received: from [85.158.139.211:55118] by server-13.bemta-5.messagelabs.com id
	33/1A-27809-45494B05; Tue, 27 Nov 2012 10:22:12 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1354011729!18064141!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3436 invoked from network); 27 Nov 2012 10:22:09 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:22:09 -0000
Received: by mail-ea0-f173.google.com with SMTP id i13so5663104eaa.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 02:22:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=459iGmsswu+VuE1DxuzuQxAbrmtIi0yfqKykpuEpJ6Y=;
	b=x/VWPu6whk/QuJD6hJzwZWfYJJFMIXwEoHn1lDo+9B5Nj3svB8fKBkoYCztToU1jup
	Sr78kt1ANNkV5Z+FfaTS5d5NSX8E058TOejQNHWkOnxgGDcWR7VSJjfuwVUknUX7e6sQ
	eP0umggtmFF3DJn57garvGXdyJRTYmaNvQgp1hS3sCo6U8hOewI9vngzFKb7imglencV
	Ev3eTYbutzIrnZzNsvXUOp344p07XoLZ5wDW7CMfiOSdu/rkwJKYaS1Ml77zEhYqzC3m
	94s99MC+dlQV2SR+/GnLI1HA1bhhTkz+cLbTot7neK1HIT5gOwgquz6WLEDA+0G4+PfX
	hIAg==
Received: by 10.14.205.198 with SMTP id j46mr56609430eeo.27.1354011729117;
	Tue, 27 Nov 2012 02:22:09 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id e7sm39867140eep.1.2012.11.27.02.22.06
	(version=SSLv3 cipher=OTHER); Tue, 27 Nov 2012 02:22:08 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Tue, 27 Nov 2012 10:22:02 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <CCDA44CA.5383C%keir@xen.org>
Thread-Topic: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
Thread-Index: Ac3MiQpcfNhj3MGx5UOPwcMIYpQnkA==
In-Reply-To: <50B48C8A02000078000AB851@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	TimDeegan <tim@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 27/11/2012 08:48, "Jan Beulich" <JBeulich@suse.com> wrote:

> Sorry, there must have been some misunderstanding here: First
> of all, without a maintainer's ack (Keir's in this case) I can't commit
> anything to code that I'm not explicitly listed for as maintainer.
> 
> Second, while I said the code itself looks acceptable, I also pointed
> out that in the shape it is right now it is dead code, as there's no
> user for it. So all we would get would be the risk of new bugs (and
> the one I just pointed out worries me in so far as how much testing
> this code really has seen).
> 
> Third, deferral (or denial) of the patch going in is certainly not a
> blocking factor for tools side development at Oracle. In the worst
> case, you'd have to maintain the patch in your own tree(s); I do
> realize that you want to avoid that (as I would, but there are
> examples of patches that we carry in our trees that didn't get
> accepted into the community one - luckily they're of smaller size).

It's actually not that large a patch, and perhaps we could take a
domain_adjust_tot_pages() hook which would reduce the size of any private
patch, while not inflicting a maintenance or bug burden on mainline.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:22:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIIw-0007im-SY; Tue, 27 Nov 2012 10:22:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TdIIv-0007ih-IF
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:22:13 +0000
Received: from [85.158.139.211:55118] by server-13.bemta-5.messagelabs.com id
	33/1A-27809-45494B05; Tue, 27 Nov 2012 10:22:12 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1354011729!18064141!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3436 invoked from network); 27 Nov 2012 10:22:09 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:22:09 -0000
Received: by mail-ea0-f173.google.com with SMTP id i13so5663104eaa.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 02:22:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=459iGmsswu+VuE1DxuzuQxAbrmtIi0yfqKykpuEpJ6Y=;
	b=x/VWPu6whk/QuJD6hJzwZWfYJJFMIXwEoHn1lDo+9B5Nj3svB8fKBkoYCztToU1jup
	Sr78kt1ANNkV5Z+FfaTS5d5NSX8E058TOejQNHWkOnxgGDcWR7VSJjfuwVUknUX7e6sQ
	eP0umggtmFF3DJn57garvGXdyJRTYmaNvQgp1hS3sCo6U8hOewI9vngzFKb7imglencV
	Ev3eTYbutzIrnZzNsvXUOp344p07XoLZ5wDW7CMfiOSdu/rkwJKYaS1Ml77zEhYqzC3m
	94s99MC+dlQV2SR+/GnLI1HA1bhhTkz+cLbTot7neK1HIT5gOwgquz6WLEDA+0G4+PfX
	hIAg==
Received: by 10.14.205.198 with SMTP id j46mr56609430eeo.27.1354011729117;
	Tue, 27 Nov 2012 02:22:09 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id e7sm39867140eep.1.2012.11.27.02.22.06
	(version=SSLv3 cipher=OTHER); Tue, 27 Nov 2012 02:22:08 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Tue, 27 Nov 2012 10:22:02 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <CCDA44CA.5383C%keir@xen.org>
Thread-Topic: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
Thread-Index: Ac3MiQpcfNhj3MGx5UOPwcMIYpQnkA==
In-Reply-To: <50B48C8A02000078000AB851@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	TimDeegan <tim@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 27/11/2012 08:48, "Jan Beulich" <JBeulich@suse.com> wrote:

> Sorry, there must have been some misunderstanding here: First
> of all, without a maintainer's ack (Keir's in this case) I can't commit
> anything to code that I'm not explicitly listed for as maintainer.
> 
> Second, while I said the code itself looks acceptable, I also pointed
> out that in the shape it is right now it is dead code, as there's no
> user for it. So all we would get would be the risk of new bugs (and
> the one I just pointed out worries me in so far as how much testing
> this code really has seen).
> 
> Third, deferral (or denial) of the patch going in is certainly not a
> blocking factor for tools side development at Oracle. In the worst
> case, you'd have to maintain the patch in your own tree(s); I do
> realize that you want to avoid that (as I would, but there are
> examples of patches that we carry in our trees that didn't get
> accepted into the community one - luckily they're of smaller size).

It's actually not that large a patch, and perhaps we could take a
domain_adjust_tot_pages() hook which would reduce the size of any private
patch, while not inflicting a maintenance or bug burden on mainline.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:32:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:32:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdISw-0007uk-AX; Tue, 27 Nov 2012 10:32:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdISu-0007uf-Te
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:32:33 +0000
Received: from [85.158.137.99:38394] by server-1.bemta-3.messagelabs.com id
	B1/A4-12169-0C694B05; Tue, 27 Nov 2012 10:32:32 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1354012348!15972994!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19201 invoked from network); 27 Nov 2012 10:32:29 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:32:29 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16019192"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:31:49 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:31:49 +0000
Message-ID: <1354012308.5830.175.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 27 Nov 2012 10:31:48 +0000
In-Reply-To: <50B48C8A02000078000AB851@nat28.tlf.novell.com>
References: <38a09df7-3d82-403f-9153-9a151b220a41@default>
	<50B48C8A02000078000AB851@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>, "Keir
	\(Xen.org\)" <keir@xen.org>, Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 08:48 +0000, Jan Beulich wrote:
> Second, while I said the code itself looks acceptable, I also pointed
> out that in the shape it is right now it is dead code, as there's no
> user for it. So all we would get would be the risk of new bugs (and
> the one I just pointed out worries me in so far as how much testing
> this code really has seen).

I agree with this.

> Third, deferral (or denial) of the patch going in is certainly not a
> blocking factor for tools side development at Oracle. In the worst
> case, you'd have to maintain the patch in your own tree(s); I do
> realize that you want to avoid that (as I would, but there are
> examples of patches that we carry in our trees that didn't get
> accepted into the community one - luckily they're of smaller size).

I think Oracle carrying this patch in their tree is probably the best
approach for now.

I'm also a little surprised that this patch is being so aggressively
pushed upstream when the toolstack work which would use it is seemingly
not fully formed yet.

Anyway, it seems to me that this argument seems to me to be starting
from the wrong end, it starts from the hypercall and tries to justify it
based on requirements imposed by an toolstack which is presented as
something of a fixed black box from the xen-devel point of view, which
is not something I find particularly convincing.

So a possible alternative to Oracle carrying this patch long term is
that someone who understands Oracle's toolstack's requirements and
constraints takes over from Dan (who I think has said several times that
he is not familiar with all the details of the Oracle toolstack) as
advocate for finding a solution to the underlying issue here and can
engage xen-devel in a discussion about the design decisions involved
from the toolstack downwards. Either this leads to the proposed solution
in the hypervisor (or something similar) or it results in a completely
different solution which everyone is happy with (or I suppose it might
still end up with Oracle carrying this patch long term).

I also feel I should also point out that contrary to the claims in
http://lists.xen.org/archives/html/xen-devel/2012-11/msg01427.html and
elsewhere the acceptance or otherwise of this patch has nothing to do
with Citrix. Although some of the folks involved in the discussion are
employed by Citrix they are all members of the "platform team" which
operates independently, is concerned with the state of Xen.org provided
Xen bits and is not tied to any product team (Citrix or otherwise). So
this has nothing whatsoever to do with Citrix's plans to use this
mechanism (and such conspiracy theories IMHO add nothing to the
discussion). AFAIK no one who is involved with any of Citrix's products
has said anything at all in any thread on the matter one way or the
other.

Ian



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:32:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:32:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdISw-0007uk-AX; Tue, 27 Nov 2012 10:32:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdISu-0007uf-Te
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:32:33 +0000
Received: from [85.158.137.99:38394] by server-1.bemta-3.messagelabs.com id
	B1/A4-12169-0C694B05; Tue, 27 Nov 2012 10:32:32 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1354012348!15972994!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19201 invoked from network); 27 Nov 2012 10:32:29 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:32:29 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16019192"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:31:49 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:31:49 +0000
Message-ID: <1354012308.5830.175.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 27 Nov 2012 10:31:48 +0000
In-Reply-To: <50B48C8A02000078000AB851@nat28.tlf.novell.com>
References: <38a09df7-3d82-403f-9153-9a151b220a41@default>
	<50B48C8A02000078000AB851@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>, "Keir
	\(Xen.org\)" <keir@xen.org>, Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 08:48 +0000, Jan Beulich wrote:
> Second, while I said the code itself looks acceptable, I also pointed
> out that in the shape it is right now it is dead code, as there's no
> user for it. So all we would get would be the risk of new bugs (and
> the one I just pointed out worries me in so far as how much testing
> this code really has seen).

I agree with this.

> Third, deferral (or denial) of the patch going in is certainly not a
> blocking factor for tools side development at Oracle. In the worst
> case, you'd have to maintain the patch in your own tree(s); I do
> realize that you want to avoid that (as I would, but there are
> examples of patches that we carry in our trees that didn't get
> accepted into the community one - luckily they're of smaller size).

I think Oracle carrying this patch in their tree is probably the best
approach for now.

I'm also a little surprised that this patch is being so aggressively
pushed upstream when the toolstack work which would use it is seemingly
not fully formed yet.

Anyway, it seems to me that this argument seems to me to be starting
from the wrong end, it starts from the hypercall and tries to justify it
based on requirements imposed by an toolstack which is presented as
something of a fixed black box from the xen-devel point of view, which
is not something I find particularly convincing.

So a possible alternative to Oracle carrying this patch long term is
that someone who understands Oracle's toolstack's requirements and
constraints takes over from Dan (who I think has said several times that
he is not familiar with all the details of the Oracle toolstack) as
advocate for finding a solution to the underlying issue here and can
engage xen-devel in a discussion about the design decisions involved
from the toolstack downwards. Either this leads to the proposed solution
in the hypervisor (or something similar) or it results in a completely
different solution which everyone is happy with (or I suppose it might
still end up with Oracle carrying this patch long term).

I also feel I should also point out that contrary to the claims in
http://lists.xen.org/archives/html/xen-devel/2012-11/msg01427.html and
elsewhere the acceptance or otherwise of this patch has nothing to do
with Citrix. Although some of the folks involved in the discussion are
employed by Citrix they are all members of the "platform team" which
operates independently, is concerned with the state of Xen.org provided
Xen bits and is not tied to any product team (Citrix or otherwise). So
this has nothing whatsoever to do with Citrix's plans to use this
mechanism (and such conspiracy theories IMHO add nothing to the
discussion). AFAIK no one who is involved with any of Citrix's products
has said anything at all in any thread on the matter one way or the
other.

Ian



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:35:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:35:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIVX-00080j-T1; Tue, 27 Nov 2012 10:35:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TdIVW-00080d-UF
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:35:15 +0000
Received: from [85.158.139.83:5983] by server-16.bemta-5.messagelabs.com id
	BC/06-04786-26794B05; Tue, 27 Nov 2012 10:35:14 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1354012509!28126822!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8334 invoked from network); 27 Nov 2012 10:35:11 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:35:11 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl17so5150485vcb.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 02:35:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=cf19cW1cmsl3Xgt45ZCZc1lP4YE++luO9KMU1yGaGvo=;
	b=X5HBjLGH3NbjVnK5OAb8cCSxp9kjGxLbCRcZxN5+A5MwOSVDtwslj+JOLQuwvFHfPT
	vvBHC+ZTHUKf3ZrY6fgJF8BRAy82eecsPUKovqghrFsm1G9tuQhzjMcMRLC7DWtsGS2M
	pn1zwE1Y6Sylgwk86Ha7JvmYsv8W7+xuPtLaDPf5vJrKCk733lOMFyo47wqIt7lWXPpC
	sibxNpRTkZBT2fo/cxMTlkO4HhDWo0tDpwivCVdDhfDVd/LMi2yT+TgbKU8dH1EZOO3j
	/MZpXL8ZO/3N1wn0Um8Kl0pyyeologaOJBupe242CV3JkWtzFtanRnBNvuJhKOzMAZ7Y
	jmFw==
MIME-Version: 1.0
Received: by 10.58.162.130 with SMTP id ya2mr24489880veb.2.1354012509610; Tue,
	27 Nov 2012 02:35:09 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Tue, 27 Nov 2012 02:35:09 -0800 (PST)
In-Reply-To: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
References: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
Date: Tue, 27 Nov 2012 10:35:09 +0000
X-Google-Sender-Auth: Zy4ui4QSjd-fT3x-wwEzR8PcvY0
Message-ID: <CAFLBxZYjcij+20baWQZwh+7RSXw1SJjk7PkZ7g-1DoX6EsOa8w@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Jim Fehlig <jfehlig@suse.com>
Cc: libvir-list@redhat.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Convert libxl driver to Xen 4.2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3002305539904612864=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============3002305539904612864==
Content-Type: multipart/alternative; boundary=047d7b6766dca8230f04cf779a19

--047d7b6766dca8230f04cf779a19
Content-Type: text/plain; charset=ISO-8859-1

On Mon, Nov 26, 2012 at 10:28 PM, Jim Fehlig <jfehlig@suse.com> wrote:

> Based on a patch originally authored by Daniel De Graaf
>
>   http://lists.xen.org/archives/html/xen-devel/2012-05/msg00565.html
>
> This patch converts the Xen libxl driver to support only Xen >= 4.2.
> Support for Xen 4.1 libxl is dropped since that version of libxl is
> designated 'technology preview' only and is incompatible with Xen 4.2
> libxl.  Additionally, the default toolstack in Xen 4.1 is still xend,
> for which libvirt has a stable, functional driver.
>

Great!  Just one question -- does this patch add any new functionality
(e.g., migration for libxl), or just switch the existing functionality over
to the new interface?

 -George

--047d7b6766dca8230f04cf779a19
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Mon, Nov 26, 2012 at 10:28 PM, Jim Fehlig <span dir=3D"ltr">&lt;<a href=
=3D"mailto:jfehlig@suse.com" target=3D"_blank">jfehlig@suse.com</a>&gt;</sp=
an> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_quote"><blockq=
uote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1p=
x solid rgb(204,204,204);padding-left:1ex">
Based on a patch originally authored by Daniel De Graaf<br>
<br>
=A0 <a href=3D"http://lists.xen.org/archives/html/xen-devel/2012-05/msg0056=
5.html" target=3D"_blank">http://lists.xen.org/archives/html/xen-devel/2012=
-05/msg00565.html</a><br>
<br>
This patch converts the Xen libxl driver to support only Xen &gt;=3D 4.2.<b=
r>
Support for Xen 4.1 libxl is dropped since that version of libxl is<br>
designated &#39;technology preview&#39; only and is incompatible with Xen 4=
.2<br>
libxl. =A0Additionally, the default toolstack in Xen 4.1 is still xend,<br>
for which libvirt has a stable, functional driver.<br></blockquote><div><br=
>Great!=A0 Just one question -- does this patch add any new functionality=
=20
(e.g., migration for libxl), or just switch the existing functionality=20
over to the new interface?<br><br>=A0-George<br></div></div></div>

--047d7b6766dca8230f04cf779a19--


--===============3002305539904612864==
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.xen.org
http://lists.xen.org/xen-devel

--===============3002305539904612864==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 10:35:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:35:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIVX-00080j-T1; Tue, 27 Nov 2012 10:35:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TdIVW-00080d-UF
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:35:15 +0000
Received: from [85.158.139.83:5983] by server-16.bemta-5.messagelabs.com id
	BC/06-04786-26794B05; Tue, 27 Nov 2012 10:35:14 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1354012509!28126822!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8334 invoked from network); 27 Nov 2012 10:35:11 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:35:11 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl17so5150485vcb.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 02:35:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=cf19cW1cmsl3Xgt45ZCZc1lP4YE++luO9KMU1yGaGvo=;
	b=X5HBjLGH3NbjVnK5OAb8cCSxp9kjGxLbCRcZxN5+A5MwOSVDtwslj+JOLQuwvFHfPT
	vvBHC+ZTHUKf3ZrY6fgJF8BRAy82eecsPUKovqghrFsm1G9tuQhzjMcMRLC7DWtsGS2M
	pn1zwE1Y6Sylgwk86Ha7JvmYsv8W7+xuPtLaDPf5vJrKCk733lOMFyo47wqIt7lWXPpC
	sibxNpRTkZBT2fo/cxMTlkO4HhDWo0tDpwivCVdDhfDVd/LMi2yT+TgbKU8dH1EZOO3j
	/MZpXL8ZO/3N1wn0Um8Kl0pyyeologaOJBupe242CV3JkWtzFtanRnBNvuJhKOzMAZ7Y
	jmFw==
MIME-Version: 1.0
Received: by 10.58.162.130 with SMTP id ya2mr24489880veb.2.1354012509610; Tue,
	27 Nov 2012 02:35:09 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Tue, 27 Nov 2012 02:35:09 -0800 (PST)
In-Reply-To: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
References: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
Date: Tue, 27 Nov 2012 10:35:09 +0000
X-Google-Sender-Auth: Zy4ui4QSjd-fT3x-wwEzR8PcvY0
Message-ID: <CAFLBxZYjcij+20baWQZwh+7RSXw1SJjk7PkZ7g-1DoX6EsOa8w@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Jim Fehlig <jfehlig@suse.com>
Cc: libvir-list@redhat.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Convert libxl driver to Xen 4.2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3002305539904612864=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============3002305539904612864==
Content-Type: multipart/alternative; boundary=047d7b6766dca8230f04cf779a19

--047d7b6766dca8230f04cf779a19
Content-Type: text/plain; charset=ISO-8859-1

On Mon, Nov 26, 2012 at 10:28 PM, Jim Fehlig <jfehlig@suse.com> wrote:

> Based on a patch originally authored by Daniel De Graaf
>
>   http://lists.xen.org/archives/html/xen-devel/2012-05/msg00565.html
>
> This patch converts the Xen libxl driver to support only Xen >= 4.2.
> Support for Xen 4.1 libxl is dropped since that version of libxl is
> designated 'technology preview' only and is incompatible with Xen 4.2
> libxl.  Additionally, the default toolstack in Xen 4.1 is still xend,
> for which libvirt has a stable, functional driver.
>

Great!  Just one question -- does this patch add any new functionality
(e.g., migration for libxl), or just switch the existing functionality over
to the new interface?

 -George

--047d7b6766dca8230f04cf779a19
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Mon, Nov 26, 2012 at 10:28 PM, Jim Fehlig <span dir=3D"ltr">&lt;<a href=
=3D"mailto:jfehlig@suse.com" target=3D"_blank">jfehlig@suse.com</a>&gt;</sp=
an> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_quote"><blockq=
uote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1p=
x solid rgb(204,204,204);padding-left:1ex">
Based on a patch originally authored by Daniel De Graaf<br>
<br>
=A0 <a href=3D"http://lists.xen.org/archives/html/xen-devel/2012-05/msg0056=
5.html" target=3D"_blank">http://lists.xen.org/archives/html/xen-devel/2012=
-05/msg00565.html</a><br>
<br>
This patch converts the Xen libxl driver to support only Xen &gt;=3D 4.2.<b=
r>
Support for Xen 4.1 libxl is dropped since that version of libxl is<br>
designated &#39;technology preview&#39; only and is incompatible with Xen 4=
.2<br>
libxl. =A0Additionally, the default toolstack in Xen 4.1 is still xend,<br>
for which libvirt has a stable, functional driver.<br></blockquote><div><br=
>Great!=A0 Just one question -- does this patch add any new functionality=
=20
(e.g., migration for libxl), or just switch the existing functionality=20
over to the new interface?<br><br>=A0-George<br></div></div></div>

--047d7b6766dca8230f04cf779a19--


--===============3002305539904612864==
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.xen.org
http://lists.xen.org/xen-devel

--===============3002305539904612864==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 10:51:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:51:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIkx-0008F8-Ei; Tue, 27 Nov 2012 10:51:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TdIkw-0008Ex-3W
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:51:10 +0000
Received: from [85.158.137.99:14508] by server-13.bemta-3.messagelabs.com id
	26/B6-24887-D1B94B05; Tue, 27 Nov 2012 10:51:09 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354013466!20778508!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_20_30,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26155 invoked from network); 27 Nov 2012 10:51:08 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:51:08 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so15010008vbi.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 02:51:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=Su7i90wz9q0yYFr4KwN9LVAFy3D535tqA+68vq9XstQ=;
	b=Solbj42mmuld/0+9Vqeik7Dsthqnw9lKDtPcBofKUqE99PsH7JmpJrVlF+3drrcDbu
	n6VJT0TX1Re4ZSszox0+4CA4ZIZqSAk722btu07HgVhr7+WU+cRpfvAEF9ZxK3ZCMRG7
	E3eJGyvz5MfUAZLs8/L2otUhpwMeP3L85o35PRWaZP5YMb73/LuJ4KhnECS6+EpQtQ3J
	dYG45m5X398YWrs6uw+yOP04Ao+WPVRW/G47PBvq8aIbQIlt0419eal45GKDxuuuXhkK
	klBJJiNHr4ZovmWLbIoq5F9n/UzNrfwmKfBqabk03Sncq+Qnxf6cxlemSauUljcPdKJ4
	LPAg==
MIME-Version: 1.0
Received: by 10.52.64.131 with SMTP id o3mr20312588vds.116.1354013466417; Tue,
	27 Nov 2012 02:51:06 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Tue, 27 Nov 2012 02:51:06 -0800 (PST)
In-Reply-To: <50B3B215.3020000@citrix.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B3B215.3020000@citrix.com>
Date: Tue, 27 Nov 2012 10:51:06 +0000
X-Google-Sender-Auth: oSDhnFqNcJZYFHxZtGnbpFlncgc
Message-ID: <CAFLBxZYgnLdT3OE+akGYqg2qvJmcfxb5xx0=U0SHsZiHMErWJw@mail.gmail.com>
From: George Dunlap <dunlapg@umich.edu>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5961489816166214572=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5961489816166214572==
Content-Type: multipart/alternative; boundary=20cf307ac797afd88904cf77d3a5

--20cf307ac797afd88904cf77d3a5
Content-Type: text/plain; charset=ISO-8859-1

On Mon, Nov 26, 2012 at 6:16 PM, Andrew Cooper <andrew.cooper3@citrix.com>wrote:

> The idea of secure boot is that only signed/verified code can perform
> privileged operations.  One can argue as to exactly where this boundary
> lies, but in the native case, it contains any kernel level code.
> Userspace uses the kernel API/ABI subject to the permissions checks
> present and (assuming no security holes), everyone is happy.
>

Different people have different opinions on this.  Fedora are signing all
the way down to modules, but not user-space; as a result, IIUC, they are
ruling out third-party or out-of-tree drivers.  Ubuntu are not signing
modules AIUI, so in theory someone could install a rootkit; but they think
that it's likely any local attacker is going to be able to attack the
kernel anyway; on the balance having third-party drivers is more important
to them.

Nonetheless, Ubuntu are still signing kernels, so that the kernel can still
do some of the "boot mode" UEFI operations. (Not sure the correct term
here.)  The idea is that the kernel will disable the "boot mode" UEFI
operations before it loads any kernel modules.  Someone booting Xen
directly from EFI may want to do the same thing.

 -George


>
> In the Xen case, Xen will happily accept any privileged hypercalls from
> dom0.  So you could argue that anything able to make ioctls against
> /dev/xen/privcmd (and friends) would need to be within the signed code.
> This is the entire toolstack, and all root processes.
>
> Furthermore, cross-domain systems like xenbus/xenstore would also need
> to be signed.  Imagine the carnage a malicious xenstored could cause!
>
> I am struggling to think of a way of getting secure boot working
> correctly without signing all of dom0.
>
> --
> Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
> T: +44 (0)1223 225 900, http://www.citrix.com
>
>

--20cf307ac797afd88904cf77d3a5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Mon, Nov 26, 2012 at 6:16 PM, Andrew Cooper <span dir=3D"ltr">&lt;<a hre=
f=3D"mailto:andrew.cooper3@citrix.com" target=3D"_blank">andrew.cooper3@cit=
rix.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"g=
mail_quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">The idea of secure boot is that only signed/=
verified code can perform<br>
privileged operations. =A0One can argue as to exactly where this boundary<b=
r>
lies, but in the native case, it contains any kernel level code.<br>
Userspace uses the kernel API/ABI subject to the permissions checks<br>
present and (assuming no security holes), everyone is happy.<br></blockquot=
e><div><br>Different people have different opinions on this.=A0 Fedora are =
signing all the way down to modules, but not user-space; as a result, IIUC,=
 they are ruling out third-party or out-of-tree drivers.=A0 Ubuntu are not =
signing modules AIUI, so in theory someone could install a rootkit; but the=
y think that it&#39;s likely any local attacker is going to be able to atta=
ck the kernel anyway; on the balance having third-party drivers is more imp=
ortant to them.<br>
<br>Nonetheless, Ubuntu are still signing kernels, so that the kernel can s=
till do some of the &quot;boot mode&quot; UEFI operations. (Not sure the co=
rrect term here.)=A0 The idea is that the kernel will disable the &quot;boo=
t mode&quot; UEFI operations before it loads any kernel modules.=A0 Someone=
 booting Xen directly from EFI may want to do the same thing.<br>
<br>=A0-George<br>=A0</div><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
In the Xen case, Xen will happily accept any privileged hypercalls from<br>
dom0. =A0So you could argue that anything able to make ioctls against<br>
/dev/xen/privcmd (and friends) would need to be within the signed code.<br>
This is the entire toolstack, and all root processes.<br>
<br>
Furthermore, cross-domain systems like xenbus/xenstore would also need<br>
to be signed. =A0Imagine the carnage a malicious xenstored could cause!<br>
<br>
I am struggling to think of a way of getting secure boot working<br>
correctly without signing all of dom0.<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
--<br>
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer<br>
T: <a href=3D"tel:%2B44%20%280%291223%20225%20900" value=3D"+441223225900">=
+44 (0)1223 225 900</a>, <a href=3D"http://www.citrix.com" target=3D"_blank=
">http://www.citrix.com</a><br>
<br>
</font></span></blockquote></div><br></div>

--20cf307ac797afd88904cf77d3a5--


--===============5961489816166214572==
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.xen.org
http://lists.xen.org/xen-devel

--===============5961489816166214572==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 10:51:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:51:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIkx-0008F8-Ei; Tue, 27 Nov 2012 10:51:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TdIkw-0008Ex-3W
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:51:10 +0000
Received: from [85.158.137.99:14508] by server-13.bemta-3.messagelabs.com id
	26/B6-24887-D1B94B05; Tue, 27 Nov 2012 10:51:09 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354013466!20778508!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_20_30,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26155 invoked from network); 27 Nov 2012 10:51:08 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:51:08 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so15010008vbi.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 02:51:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=Su7i90wz9q0yYFr4KwN9LVAFy3D535tqA+68vq9XstQ=;
	b=Solbj42mmuld/0+9Vqeik7Dsthqnw9lKDtPcBofKUqE99PsH7JmpJrVlF+3drrcDbu
	n6VJT0TX1Re4ZSszox0+4CA4ZIZqSAk722btu07HgVhr7+WU+cRpfvAEF9ZxK3ZCMRG7
	E3eJGyvz5MfUAZLs8/L2otUhpwMeP3L85o35PRWaZP5YMb73/LuJ4KhnECS6+EpQtQ3J
	dYG45m5X398YWrs6uw+yOP04Ao+WPVRW/G47PBvq8aIbQIlt0419eal45GKDxuuuXhkK
	klBJJiNHr4ZovmWLbIoq5F9n/UzNrfwmKfBqabk03Sncq+Qnxf6cxlemSauUljcPdKJ4
	LPAg==
MIME-Version: 1.0
Received: by 10.52.64.131 with SMTP id o3mr20312588vds.116.1354013466417; Tue,
	27 Nov 2012 02:51:06 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Tue, 27 Nov 2012 02:51:06 -0800 (PST)
In-Reply-To: <50B3B215.3020000@citrix.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B3B215.3020000@citrix.com>
Date: Tue, 27 Nov 2012 10:51:06 +0000
X-Google-Sender-Auth: oSDhnFqNcJZYFHxZtGnbpFlncgc
Message-ID: <CAFLBxZYgnLdT3OE+akGYqg2qvJmcfxb5xx0=U0SHsZiHMErWJw@mail.gmail.com>
From: George Dunlap <dunlapg@umich.edu>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5961489816166214572=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5961489816166214572==
Content-Type: multipart/alternative; boundary=20cf307ac797afd88904cf77d3a5

--20cf307ac797afd88904cf77d3a5
Content-Type: text/plain; charset=ISO-8859-1

On Mon, Nov 26, 2012 at 6:16 PM, Andrew Cooper <andrew.cooper3@citrix.com>wrote:

> The idea of secure boot is that only signed/verified code can perform
> privileged operations.  One can argue as to exactly where this boundary
> lies, but in the native case, it contains any kernel level code.
> Userspace uses the kernel API/ABI subject to the permissions checks
> present and (assuming no security holes), everyone is happy.
>

Different people have different opinions on this.  Fedora are signing all
the way down to modules, but not user-space; as a result, IIUC, they are
ruling out third-party or out-of-tree drivers.  Ubuntu are not signing
modules AIUI, so in theory someone could install a rootkit; but they think
that it's likely any local attacker is going to be able to attack the
kernel anyway; on the balance having third-party drivers is more important
to them.

Nonetheless, Ubuntu are still signing kernels, so that the kernel can still
do some of the "boot mode" UEFI operations. (Not sure the correct term
here.)  The idea is that the kernel will disable the "boot mode" UEFI
operations before it loads any kernel modules.  Someone booting Xen
directly from EFI may want to do the same thing.

 -George


>
> In the Xen case, Xen will happily accept any privileged hypercalls from
> dom0.  So you could argue that anything able to make ioctls against
> /dev/xen/privcmd (and friends) would need to be within the signed code.
> This is the entire toolstack, and all root processes.
>
> Furthermore, cross-domain systems like xenbus/xenstore would also need
> to be signed.  Imagine the carnage a malicious xenstored could cause!
>
> I am struggling to think of a way of getting secure boot working
> correctly without signing all of dom0.
>
> --
> Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
> T: +44 (0)1223 225 900, http://www.citrix.com
>
>

--20cf307ac797afd88904cf77d3a5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Mon, Nov 26, 2012 at 6:16 PM, Andrew Cooper <span dir=3D"ltr">&lt;<a hre=
f=3D"mailto:andrew.cooper3@citrix.com" target=3D"_blank">andrew.cooper3@cit=
rix.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"g=
mail_quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">The idea of secure boot is that only signed/=
verified code can perform<br>
privileged operations. =A0One can argue as to exactly where this boundary<b=
r>
lies, but in the native case, it contains any kernel level code.<br>
Userspace uses the kernel API/ABI subject to the permissions checks<br>
present and (assuming no security holes), everyone is happy.<br></blockquot=
e><div><br>Different people have different opinions on this.=A0 Fedora are =
signing all the way down to modules, but not user-space; as a result, IIUC,=
 they are ruling out third-party or out-of-tree drivers.=A0 Ubuntu are not =
signing modules AIUI, so in theory someone could install a rootkit; but the=
y think that it&#39;s likely any local attacker is going to be able to atta=
ck the kernel anyway; on the balance having third-party drivers is more imp=
ortant to them.<br>
<br>Nonetheless, Ubuntu are still signing kernels, so that the kernel can s=
till do some of the &quot;boot mode&quot; UEFI operations. (Not sure the co=
rrect term here.)=A0 The idea is that the kernel will disable the &quot;boo=
t mode&quot; UEFI operations before it loads any kernel modules.=A0 Someone=
 booting Xen directly from EFI may want to do the same thing.<br>
<br>=A0-George<br>=A0</div><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
In the Xen case, Xen will happily accept any privileged hypercalls from<br>
dom0. =A0So you could argue that anything able to make ioctls against<br>
/dev/xen/privcmd (and friends) would need to be within the signed code.<br>
This is the entire toolstack, and all root processes.<br>
<br>
Furthermore, cross-domain systems like xenbus/xenstore would also need<br>
to be signed. =A0Imagine the carnage a malicious xenstored could cause!<br>
<br>
I am struggling to think of a way of getting secure boot working<br>
correctly without signing all of dom0.<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
--<br>
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer<br>
T: <a href=3D"tel:%2B44%20%280%291223%20225%20900" value=3D"+441223225900">=
+44 (0)1223 225 900</a>, <a href=3D"http://www.citrix.com" target=3D"_blank=
">http://www.citrix.com</a><br>
<br>
</font></span></blockquote></div><br></div>

--20cf307ac797afd88904cf77d3a5--


--===============5961489816166214572==
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.xen.org
http://lists.xen.org/xen-devel

--===============5961489816166214572==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 10:52:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:52:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIlu-0008Ie-U9; Tue, 27 Nov 2012 10:52:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdIls-0008IO-Lj
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:52:09 +0000
Received: from [193.109.254.147:30288] by server-7.bemta-14.messagelabs.com id
	47/BA-02272-85B94B05; Tue, 27 Nov 2012 10:52:08 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1354013506!8750297!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12288 invoked from network); 27 Nov 2012 10:51:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:51:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16019779"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:51:31 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:51:31 +0000
Message-ID: <1354013490.5830.181.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jim Fehlig <jfehlig@suse.com>
Date: Tue, 27 Nov 2012 10:51:30 +0000
In-Reply-To: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
References: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "libvir-list@redhat.com" <libvir-list@redhat.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Convert libxl driver to Xen 4.2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 22:28 +0000, Jim Fehlig wrote:
> 
> @@ -62,6 +63,52 @@ struct guest_arch {
>  static const char *xen_cap_re = "(xen|hvm)-[[:digit:]]+\
> \.[[:digit:]]+-(x86_32|x86_64|ia64|powerpc64)(p|be)?";
>  static regex_t xen_cap_rec;
> 
> +/*
> + * Copied from split_string_into_string_list() in
> + * $xen-sources/tools/libxl/xl_cmdimpl.c, which is licensed LGPL v2.1.
> + */

Looks like I am the sole author of that original function
(24250:71ecbef5645f xen-unstable.hg). I'd more than likely be happy to
relicence under whatever terms would be suitable for libvirt -- what are
they?

In particular I'd be happy with LGPL v2.1+ if that's what it takes.

> +static int
> +libxlSplitStringIntoStringList(const char *str,
> +                               const char *delim,
> +                               libxl_string_list *psl) 
[...]

> @@ -393,26 +458,25 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
>      int hvm = STREQ(def->os.type, "hvm");
>      int i;
> 
> -    /* Currently, libxenlight only supports 32 vcpus per domain.
> -     * cur_vcpus member of struct libxl_domain_build_info is defined
> -     * as an int, but its semantic is a bitmap of online vcpus, so
> -     * only 32 can be represented.
> +    /*
> +     * libxl in Xen 4.2 supports up to 128 vcpus, cur_vcpus was replaced
> +     * by avail_vcpus of type libxl_bitmap

Do you happen to know where the 128 number comes from? I think libxl is
mostly agnostic about the size of this bitmap and should just be
exposing whatever the hypervisor supports.

>       */
> -    if (def->maxvcpus > 32 || def->vcpus > 32) {
> -        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> -                       _("This version of libxenlight only supports 32 "
> -                         "vcpus per domain"));
> +    if (def->maxvcpus > LIBXL_MAXVCPUS || def->vcpus > LIBXL_MAXVCPUS) {
> +        virReportError(VIR_ERR_INTERNAL_ERROR,
> +                       _("This version of libxenlight only supports %u "
> +                         "vcpus per domain"), LIBXL_MAXVCPUS);
>          return -1;
>      }


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:52:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:52:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIlu-0008Ie-U9; Tue, 27 Nov 2012 10:52:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdIls-0008IO-Lj
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:52:09 +0000
Received: from [193.109.254.147:30288] by server-7.bemta-14.messagelabs.com id
	47/BA-02272-85B94B05; Tue, 27 Nov 2012 10:52:08 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1354013506!8750297!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12288 invoked from network); 27 Nov 2012 10:51:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:51:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16019779"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:51:31 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:51:31 +0000
Message-ID: <1354013490.5830.181.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jim Fehlig <jfehlig@suse.com>
Date: Tue, 27 Nov 2012 10:51:30 +0000
In-Reply-To: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
References: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "libvir-list@redhat.com" <libvir-list@redhat.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Convert libxl driver to Xen 4.2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 22:28 +0000, Jim Fehlig wrote:
> 
> @@ -62,6 +63,52 @@ struct guest_arch {
>  static const char *xen_cap_re = "(xen|hvm)-[[:digit:]]+\
> \.[[:digit:]]+-(x86_32|x86_64|ia64|powerpc64)(p|be)?";
>  static regex_t xen_cap_rec;
> 
> +/*
> + * Copied from split_string_into_string_list() in
> + * $xen-sources/tools/libxl/xl_cmdimpl.c, which is licensed LGPL v2.1.
> + */

Looks like I am the sole author of that original function
(24250:71ecbef5645f xen-unstable.hg). I'd more than likely be happy to
relicence under whatever terms would be suitable for libvirt -- what are
they?

In particular I'd be happy with LGPL v2.1+ if that's what it takes.

> +static int
> +libxlSplitStringIntoStringList(const char *str,
> +                               const char *delim,
> +                               libxl_string_list *psl) 
[...]

> @@ -393,26 +458,25 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
>      int hvm = STREQ(def->os.type, "hvm");
>      int i;
> 
> -    /* Currently, libxenlight only supports 32 vcpus per domain.
> -     * cur_vcpus member of struct libxl_domain_build_info is defined
> -     * as an int, but its semantic is a bitmap of online vcpus, so
> -     * only 32 can be represented.
> +    /*
> +     * libxl in Xen 4.2 supports up to 128 vcpus, cur_vcpus was replaced
> +     * by avail_vcpus of type libxl_bitmap

Do you happen to know where the 128 number comes from? I think libxl is
mostly agnostic about the size of this bitmap and should just be
exposing whatever the hypervisor supports.

>       */
> -    if (def->maxvcpus > 32 || def->vcpus > 32) {
> -        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> -                       _("This version of libxenlight only supports 32 "
> -                         "vcpus per domain"));
> +    if (def->maxvcpus > LIBXL_MAXVCPUS || def->vcpus > LIBXL_MAXVCPUS) {
> +        virReportError(VIR_ERR_INTERNAL_ERROR,
> +                       _("This version of libxenlight only supports %u "
> +                         "vcpus per domain"), LIBXL_MAXVCPUS);
>          return -1;
>      }


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:53:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:53:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdImt-0008OK-D8; Tue, 27 Nov 2012 10:53:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TdImr-0008O9-Rm
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 10:53:10 +0000
Received: from [85.158.138.51:16507] by server-9.bemta-3.messagelabs.com id
	08/88-02388-19B94B05; Tue, 27 Nov 2012 10:53:05 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1354013585!31629500!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31338 invoked from network); 27 Nov 2012 10:53:05 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:53:05 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16019840"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:52:16 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 27 Nov 2012 10:52:16 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TdIlz-0004oZ-QL;
	Tue, 27 Nov 2012 10:52:15 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TdIlz-0001kz-Fp;
	Tue, 27 Nov 2012 10:52:15 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14480-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 27 Nov 2012 10:52:15 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14480: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14480 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14480/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-win7-amd64  7 windows-install           fail pass in 14477

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14477
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14477

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop          fail in 14477 never pass

version targeted for testing:
 xen                  16bf7f3069a7
baseline version:
 xen                  16bf7f3069a7

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:53:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:53:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdImt-0008OK-D8; Tue, 27 Nov 2012 10:53:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TdImr-0008O9-Rm
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 10:53:10 +0000
Received: from [85.158.138.51:16507] by server-9.bemta-3.messagelabs.com id
	08/88-02388-19B94B05; Tue, 27 Nov 2012 10:53:05 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1354013585!31629500!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31338 invoked from network); 27 Nov 2012 10:53:05 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:53:05 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16019840"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:52:16 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 27 Nov 2012 10:52:16 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TdIlz-0004oZ-QL;
	Tue, 27 Nov 2012 10:52:15 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TdIlz-0001kz-Fp;
	Tue, 27 Nov 2012 10:52:15 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14480-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 27 Nov 2012 10:52:15 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14480: tolerable FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14480 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14480/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-win7-amd64  7 windows-install           fail pass in 14477

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14477
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14477

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop          fail in 14477 never pass

version targeted for testing:
 xen                  16bf7f3069a7
baseline version:
 xen                  16bf7f3069a7

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:53:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:53:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdInN-0008Ro-0L; Tue, 27 Nov 2012 10:53:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdInK-0008RU-Vf
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 10:53:39 +0000
Received: from [85.158.139.211:58509] by server-15.bemta-5.messagelabs.com id
	A8/61-26920-2BB94B05; Tue, 27 Nov 2012 10:53:38 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1354013595!16520405!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29585 invoked from network); 27 Nov 2012 10:53:15 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:53:15 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16019854"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:52:42 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:52:42 +0000
Message-ID: <1354013561.5830.183.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Date: Tue, 27 Nov 2012 10:52:41 +0000
In-Reply-To: <fff756e7-ae31-49ab-91f2-d5e455cca1bd@default>
References: <1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
	<cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
	<1545900898.20121126192533@eikelenboom.it>
	<672d364a-6d34-4c89-b0fb-5af989877117@default>
	<20121126202411.GA8912@reaktio.net>
	<b7ad6baf-e085-4ef7-860e-f9755b756339@default>
	<20121126213249.GA37842@ocelot.phlegethon.org>
	<fff756e7-ae31-49ab-91f2-d5e455cca1bd@default>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Sander Eikelenboom <linux@eikelenboom.it>,
	Alexander Bienzeisler <chosi@amd.co.at>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"Tim \(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 21:47 +0000, Dan Magenheimer wrote:
> > From: Tim Deegan [mailto:tim@xen.org]
> > Subject: Re: [Xen-devel] can not use all available memory
> > 
> > At 12:37 -0800 on 26 Nov (1353933449), Dan Magenheimer wrote:
> > > > > I could be wrong (and I am confident someone will correct me if I am) but
> > > > > I think this is because the Citrix memory model assumes there is an
> > > > > inference-driven policy engine for load-balancing memory across competing
> > > > > virtual machines ("squeezed").  I suspect squeezed returns unallocated
> > > > > xen "free" memory to dom0.
> > >
> > > I forgot... it is called Dynamic Memory Control (DMC), not squeezed
> > > in the XenServer product.
> > 
> > AFAIK XenServer uses dom0_mem= and doesn't balloon com0 after boot time.
> > The idea of ballooning all free memory into dom0 is a xl-ism, inherited
> > from xend, and not really a "Citrix" one.  It's useful if you've
> > installed xen on a machine where dom0 is otherwise your main OS, but not
> > particularly for a dedicated platform.
> 
> "inherited from xend"... was the autoballoon default the same in xend?
> I don't recall ever turning it off manually and, when testing tmem,
> I'm sure I would have had to.  Or maybe xend did use hypervisor free
> memory before trying to autoballoon dom0?

http://wiki.xen.org/wiki/XenBestPractices#Xen_dom0_dedicated_memory_and_preventing_dom0_memory_ballooning
indicates that you should have been using "(enable-dom0-ballooning no)"
when using dom0_mem= with xend. Perhaps the failure case is not so bad
with xend as with xl though, perhaps because xend has a central daemon
which lets it make different choices.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:53:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:53:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdInN-0008Ro-0L; Tue, 27 Nov 2012 10:53:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdInK-0008RU-Vf
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 10:53:39 +0000
Received: from [85.158.139.211:58509] by server-15.bemta-5.messagelabs.com id
	A8/61-26920-2BB94B05; Tue, 27 Nov 2012 10:53:38 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1354013595!16520405!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29585 invoked from network); 27 Nov 2012 10:53:15 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:53:15 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16019854"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:52:42 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:52:42 +0000
Message-ID: <1354013561.5830.183.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Date: Tue, 27 Nov 2012 10:52:41 +0000
In-Reply-To: <fff756e7-ae31-49ab-91f2-d5e455cca1bd@default>
References: <1353674827.16973.4.camel@zakaz.uk.xensource.com>
	<20121123125503.GX8912@reaktio.net>
	<1353676553.16973.12.camel@zakaz.uk.xensource.com>
	<20121123132920.GY8912@reaktio.net>
	<1353677623.16973.13.camel@zakaz.uk.xensource.com>
	<cd100676-79fb-438b-8d1e-105fd2f8ec5e@default>
	<1545900898.20121126192533@eikelenboom.it>
	<672d364a-6d34-4c89-b0fb-5af989877117@default>
	<20121126202411.GA8912@reaktio.net>
	<b7ad6baf-e085-4ef7-860e-f9755b756339@default>
	<20121126213249.GA37842@ocelot.phlegethon.org>
	<fff756e7-ae31-49ab-91f2-d5e455cca1bd@default>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Sander Eikelenboom <linux@eikelenboom.it>,
	Alexander Bienzeisler <chosi@amd.co.at>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"Tim \(Xen.org\)" <tim@xen.org>
Subject: Re: [Xen-devel] can not use all available memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 21:47 +0000, Dan Magenheimer wrote:
> > From: Tim Deegan [mailto:tim@xen.org]
> > Subject: Re: [Xen-devel] can not use all available memory
> > 
> > At 12:37 -0800 on 26 Nov (1353933449), Dan Magenheimer wrote:
> > > > > I could be wrong (and I am confident someone will correct me if I am) but
> > > > > I think this is because the Citrix memory model assumes there is an
> > > > > inference-driven policy engine for load-balancing memory across competing
> > > > > virtual machines ("squeezed").  I suspect squeezed returns unallocated
> > > > > xen "free" memory to dom0.
> > >
> > > I forgot... it is called Dynamic Memory Control (DMC), not squeezed
> > > in the XenServer product.
> > 
> > AFAIK XenServer uses dom0_mem= and doesn't balloon com0 after boot time.
> > The idea of ballooning all free memory into dom0 is a xl-ism, inherited
> > from xend, and not really a "Citrix" one.  It's useful if you've
> > installed xen on a machine where dom0 is otherwise your main OS, but not
> > particularly for a dedicated platform.
> 
> "inherited from xend"... was the autoballoon default the same in xend?
> I don't recall ever turning it off manually and, when testing tmem,
> I'm sure I would have had to.  Or maybe xend did use hypervisor free
> memory before trying to autoballoon dom0?

http://wiki.xen.org/wiki/XenBestPractices#Xen_dom0_dedicated_memory_and_preventing_dom0_memory_ballooning
indicates that you should have been using "(enable-dom0-ballooning no)"
when using dom0_mem= with xend. Perhaps the failure case is not so bad
with xend as with xl though, perhaps because xend has a central daemon
which lets it make different choices.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:54:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:54:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdInq-0008WV-E9; Tue, 27 Nov 2012 10:54:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdInp-0008WD-Aj
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:54:09 +0000
Received: from [85.158.143.99:43166] by server-2.bemta-4.messagelabs.com id
	47/F3-28922-0DB94B05; Tue, 27 Nov 2012 10:54:08 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1354013647!20588264!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22277 invoked from network); 27 Nov 2012 10:54:08 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:54:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16019848"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:52:27 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:52:27 +0000
Message-ID: <1354013546.5830.182.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Lars Kurth <lars.kurth.xen@gmail.com>
Date: Tue, 27 Nov 2012 10:52:26 +0000
In-Reply-To: <CAOqnZH4qVRoDCpaCGT3zuJu85t17XkuUJSoxBoMhXd95p9b5tg@mail.gmail.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<CAOqnZH4qVRoDCpaCGT3zuJu85t17XkuUJSoxBoMhXd95p9b5tg@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>, "Keir \(Xen.org\)" <keir@xen.org>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 09:56 +0000, Lars Kurth wrote:
> > (I think s/4.3/3.4/ was intended in the above)
> Yes, it was me and this indeed a typo

Fixed.

> Defining what we do is actually what I was looking for, as this is not
> clear to everybody.
> 
> > Each stable branch has a maintainer who is nominated/volunteers and
> is
> > accepted via consensus among the maintainers and committers (XXX or
> just
> > committers?). 
> I am wondering whether we should treat this exactly like
> maintainership. It's the same idea.
> We could just add a "stable release" section to the MAINTAINERS file
> and follow the same 
> process of nominating a maintainer. Or track the stable release
> maintainer in the branched
> versions of the file. Does anybody have any views?

I think we could reasonably do both?

> Maybe a short section of what the responsibilities of a release
> maintainer would be useful (view a view to making it a little easier
> for somebody to step up should they wish to) and a little section on
> what to do if a contributor feels that a bug-fix should be backported
> (with a view to making the release maintainers life easier). Anyway,
> this is just a suggestion.

This second might make a reasonable independent wiki page?

> Otherwise this sounds like a good proposal and starting point. Thanks
> for putting it together.

No problem. Do you have any preference for formatting or want me to put
this anywhere in particular or will you just take the text and run with
it?

> 
> Regards
> Lars
> 
> 
> On Mon, Nov 26, 2012 at 3:58 PM, Ian Campbell
> <Ian.Campbell@citrix.com> wrote:
>         Lars (I presume it was he who added this TODO) would like to
>         have a
>         policy written down.
>         http://wiki.xen.org/wiki/Xen_Document_Days/TODO#Document_Policy_on_Maintenance_Releases says:
>                 Which releases are supported, for how long. Owners. As
>         well as a
>                 mechanism for individuals (or vendors) to take
>         ownership of
>                 older releases (as is the case for Xen 4.3).
>         
>         (I think s/4.3/3.4/ was intended in the above)
>         
>         I thought it would be worth sketching out my understanding of
>         the
>         informal process we have for people to pick holes in. I've
>         tried to
>         stick to what we actually do rather than defining policy.
>         
>         Ian.
>         
>         8<--------------------
>         
>         Each new Xen release X.Y.0 starts a new stable maintenance
>         branch.
>         
>         Each such branch is in in its own mercurial repository
>         xen-X.Y-testing.hg. Releases happen roughly every 3 months.
>         The first
>         release on a stable branch is often sooner and as the branch
>         reaches the
>         end of its life the interval may be longer.
>         
>         In general Xen.org supports the two most recent stable
>         branches at any
>         given time. When a new X.Y.0 release is made there is usually
>         one more
>         release on the to-be-retired stable branch to mop up any loose
>         patches
>         sitting in the repo at which point the branch is retired. For
>         example we
>         are currently in the 4.3 development cycle and are supporting
>         two stable
>         branches: 4.1-testing and 4.2-testing. After 4.2.0 was
>         released there
>         was one more release in the 4.0-testing stream (4.0.4 IIRC)
>         and then the
>         4.0 branch was been retired.
>         
>                 XXX how did Jan become stable maintainer, I think he
>         just
>                 volunteered at the developer meeting and was accepted
>         via the
>                 usual consensus driven approach? Lets try:
>         
>         Each stable branch has a maintainer who is
>         nominated/volunteers and is
>         accepted via consensus among the maintainers and committers
>         (XXX or just
>         committers?). For the branches maintained by Xen.org this
>         would usually
>         be one of the xen-unstable committers or maintainers. However
>         community
>         members can step up to maintain a release once Xen.org no
>         longer does so
>         (e.g. as happened with Keith and xen-3.4-testing.hg).
>         
>         Currently Jan Beulich is the stable maintainer for both
>         4.1-testing and
>         4.2-testing having taken over from Keir Fraser when 4.2.0 was
>         released.
>         Jan delegates tools backports to Ian Jackson. Community member
>         Keith
>         Coleman continues to maintain the 3.4-testing branch (XXX does
>         he
>         still?) which he took over when 4.1.0 was released.
>         
>         No new development happens in the X.Y-testing branches,
>         instead
>         changesets are backported from xen-unstable. Where this is not
>         possible
>         (perhaps unstable has moved on such that the patch cannot be
>         applied or
>         the approach used in unstable is otherwise not valid for the
>         stable
>         branch) then a specific fix can be created for the stable
>         branch.
>         However it is a requirement that the issue will always be
>         fixed in
>         unstable first (this is to avoid regressions on the next
>         stable
>         release).
>         
>         In general only bug fixes are accepted into stable branches
>         and new
>         features are not normally accepted. (There can be exceptions,
>         e.g. it
>         was agreed that 4.2.1 would take a more relaxed approach to
>         features
>         which improved xl compatibility with xm). As time passes each
>         stable
>         branch becomes more conservative and the barrier to accepting
>         a patch
>         for backport becomes higher.
>         
>         Changesets are nominated for inclusion in the stable branch by
>         making a
>         request to the stable maintainer on xen-devel either by noting
>         it as
>         such in the submission of the original patch to xen-unstable
>         or by a
>         subsequent explicit email to xen-devel. In addition as part of
>         the the
>         stable release process the stable maintainer will send one or
>         more
>         requests to xen-devel soliciting suggestions for patches which
>         should be
>         included.
>         
>         
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:54:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:54:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdInq-0008WV-E9; Tue, 27 Nov 2012 10:54:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdInp-0008WD-Aj
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:54:09 +0000
Received: from [85.158.143.99:43166] by server-2.bemta-4.messagelabs.com id
	47/F3-28922-0DB94B05; Tue, 27 Nov 2012 10:54:08 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1354013647!20588264!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22277 invoked from network); 27 Nov 2012 10:54:08 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:54:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16019848"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:52:27 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:52:27 +0000
Message-ID: <1354013546.5830.182.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Lars Kurth <lars.kurth.xen@gmail.com>
Date: Tue, 27 Nov 2012 10:52:26 +0000
In-Reply-To: <CAOqnZH4qVRoDCpaCGT3zuJu85t17XkuUJSoxBoMhXd95p9b5tg@mail.gmail.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<CAOqnZH4qVRoDCpaCGT3zuJu85t17XkuUJSoxBoMhXd95p9b5tg@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>, "Keir \(Xen.org\)" <keir@xen.org>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 09:56 +0000, Lars Kurth wrote:
> > (I think s/4.3/3.4/ was intended in the above)
> Yes, it was me and this indeed a typo

Fixed.

> Defining what we do is actually what I was looking for, as this is not
> clear to everybody.
> 
> > Each stable branch has a maintainer who is nominated/volunteers and
> is
> > accepted via consensus among the maintainers and committers (XXX or
> just
> > committers?). 
> I am wondering whether we should treat this exactly like
> maintainership. It's the same idea.
> We could just add a "stable release" section to the MAINTAINERS file
> and follow the same 
> process of nominating a maintainer. Or track the stable release
> maintainer in the branched
> versions of the file. Does anybody have any views?

I think we could reasonably do both?

> Maybe a short section of what the responsibilities of a release
> maintainer would be useful (view a view to making it a little easier
> for somebody to step up should they wish to) and a little section on
> what to do if a contributor feels that a bug-fix should be backported
> (with a view to making the release maintainers life easier). Anyway,
> this is just a suggestion.

This second might make a reasonable independent wiki page?

> Otherwise this sounds like a good proposal and starting point. Thanks
> for putting it together.

No problem. Do you have any preference for formatting or want me to put
this anywhere in particular or will you just take the text and run with
it?

> 
> Regards
> Lars
> 
> 
> On Mon, Nov 26, 2012 at 3:58 PM, Ian Campbell
> <Ian.Campbell@citrix.com> wrote:
>         Lars (I presume it was he who added this TODO) would like to
>         have a
>         policy written down.
>         http://wiki.xen.org/wiki/Xen_Document_Days/TODO#Document_Policy_on_Maintenance_Releases says:
>                 Which releases are supported, for how long. Owners. As
>         well as a
>                 mechanism for individuals (or vendors) to take
>         ownership of
>                 older releases (as is the case for Xen 4.3).
>         
>         (I think s/4.3/3.4/ was intended in the above)
>         
>         I thought it would be worth sketching out my understanding of
>         the
>         informal process we have for people to pick holes in. I've
>         tried to
>         stick to what we actually do rather than defining policy.
>         
>         Ian.
>         
>         8<--------------------
>         
>         Each new Xen release X.Y.0 starts a new stable maintenance
>         branch.
>         
>         Each such branch is in in its own mercurial repository
>         xen-X.Y-testing.hg. Releases happen roughly every 3 months.
>         The first
>         release on a stable branch is often sooner and as the branch
>         reaches the
>         end of its life the interval may be longer.
>         
>         In general Xen.org supports the two most recent stable
>         branches at any
>         given time. When a new X.Y.0 release is made there is usually
>         one more
>         release on the to-be-retired stable branch to mop up any loose
>         patches
>         sitting in the repo at which point the branch is retired. For
>         example we
>         are currently in the 4.3 development cycle and are supporting
>         two stable
>         branches: 4.1-testing and 4.2-testing. After 4.2.0 was
>         released there
>         was one more release in the 4.0-testing stream (4.0.4 IIRC)
>         and then the
>         4.0 branch was been retired.
>         
>                 XXX how did Jan become stable maintainer, I think he
>         just
>                 volunteered at the developer meeting and was accepted
>         via the
>                 usual consensus driven approach? Lets try:
>         
>         Each stable branch has a maintainer who is
>         nominated/volunteers and is
>         accepted via consensus among the maintainers and committers
>         (XXX or just
>         committers?). For the branches maintained by Xen.org this
>         would usually
>         be one of the xen-unstable committers or maintainers. However
>         community
>         members can step up to maintain a release once Xen.org no
>         longer does so
>         (e.g. as happened with Keith and xen-3.4-testing.hg).
>         
>         Currently Jan Beulich is the stable maintainer for both
>         4.1-testing and
>         4.2-testing having taken over from Keir Fraser when 4.2.0 was
>         released.
>         Jan delegates tools backports to Ian Jackson. Community member
>         Keith
>         Coleman continues to maintain the 3.4-testing branch (XXX does
>         he
>         still?) which he took over when 4.1.0 was released.
>         
>         No new development happens in the X.Y-testing branches,
>         instead
>         changesets are backported from xen-unstable. Where this is not
>         possible
>         (perhaps unstable has moved on such that the patch cannot be
>         applied or
>         the approach used in unstable is otherwise not valid for the
>         stable
>         branch) then a specific fix can be created for the stable
>         branch.
>         However it is a requirement that the issue will always be
>         fixed in
>         unstable first (this is to avoid regressions on the next
>         stable
>         release).
>         
>         In general only bug fixes are accepted into stable branches
>         and new
>         features are not normally accepted. (There can be exceptions,
>         e.g. it
>         was agreed that 4.2.1 would take a more relaxed approach to
>         features
>         which improved xl compatibility with xm). As time passes each
>         stable
>         branch becomes more conservative and the barrier to accepting
>         a patch
>         for backport becomes higher.
>         
>         Changesets are nominated for inclusion in the stable branch by
>         making a
>         request to the stable maintainer on xen-devel either by noting
>         it as
>         such in the submission of the original patch to xen-unstable
>         or by a
>         subsequent explicit email to xen-devel. In addition as part of
>         the the
>         stable release process the stable maintainer will send one or
>         more
>         requests to xen-devel soliciting suggestions for patches which
>         should be
>         included.
>         
>         
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:56:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:56:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIq1-0000LX-2o; Tue, 27 Nov 2012 10:56:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdIpz-0000LC-MR
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:56:23 +0000
Received: from [85.158.138.51:46110] by server-2.bemta-3.messagelabs.com id
	BA/FA-04744-65C94B05; Tue, 27 Nov 2012 10:56:22 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1354013780!23729693!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12281 invoked from network); 27 Nov 2012 10:56:20 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:56:20 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16019970"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:56:20 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:56:20 +0000
Message-ID: <1354013779.5830.187.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Date: Tue, 27 Nov 2012 10:56:19 +0000
In-Reply-To: <50B3B215.3020000@citrix.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B3B215.3020000@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: George Dunlap <dunlapg@umich.edu>, "Keir \(Xen.org\)" <keir@xen.org>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 18:16 +0000, Andrew Cooper wrote:
> On 26/11/12 17:57, George Dunlap wrote:
> > So while doing a bit of investigation into a request that we have
> > instructions for how to sign a Xen binary, I came across a related
> > pair of questions.  If we boot from a signed Xen binary, then:
> > 1. Will Xen then successfully boot a signed dom0 kernel / initrd?
> > 2. Will Xen fail to boot an unsigned dom0 kernel / initrd?
> >
> > I think if Xen is signed, then ideally we want both 1 and 2 to be
> > true, right?  Does UEFI provide a way to check the signature of
> > files?  Does it happen automatically, or would we need to add extra
> > support?  Or would we need to embed a public key within the Xen binary
> > and have Xen check the signatures of files that it reads?
> >
> >  -George
> 
> The problem is deeper than that.
> 
> The idea of secure boot is that only signed/verified code can perform
> privileged operations.  One can argue as to exactly where this boundary
> lies, but in the native case, it contains any kernel level code. 
> Userspace uses the kernel API/ABI subject to the permissions checks
> present and (assuming no security holes), everyone is happy.
> 
> In the Xen case, Xen will happily accept any privileged hypercalls from
> dom0.  So you could argue that anything able to make ioctls against
> /dev/xen/privcmd (and friends) would need to be within the signed code. 
> This is the entire toolstack, and all root processes.

AIUI Restricted Boot doesn't really concern itself with the integrity of
the system post boot, just with the integrity of the bits which are
being booted. I think this extends to booting dom0 but anything relating
to booting guests could reasonably be considered to be handled
separately.

Given that it's very possible that the hypervisor could lock down even
dom0 from being able to make calls which would allow the firmware to be
subverted (i.e. access to I/O ports or MMIO regions which would allow
the BIOS to be reflashed or whatever), at which point dom0 root user and
toolstack becomes irrelevant.

That probably involves some sort of black/whitelisting scheme for I/O
ports and such which is pretty tedious but not overwhelming I don't
think.

> Furthermore, cross-domain systems like xenbus/xenstore would also need
> to be signed.  Imagine the carnage a malicious xenstored could cause!

It would need to be able to subvert the bootloader and system firmware
or something, which seems like a bit of a stretch.

> I am struggling to think of a way of getting secure boot working
> correctly without signing all of dom0.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:56:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:56:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIq1-0000LX-2o; Tue, 27 Nov 2012 10:56:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdIpz-0000LC-MR
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:56:23 +0000
Received: from [85.158.138.51:46110] by server-2.bemta-3.messagelabs.com id
	BA/FA-04744-65C94B05; Tue, 27 Nov 2012 10:56:22 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1354013780!23729693!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12281 invoked from network); 27 Nov 2012 10:56:20 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 10:56:20 -0000
X-IronPort-AV: E=Sophos;i="4.83,326,1352073600"; d="scan'208";a="16019970"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 10:56:20 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:56:20 +0000
Message-ID: <1354013779.5830.187.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Date: Tue, 27 Nov 2012 10:56:19 +0000
In-Reply-To: <50B3B215.3020000@citrix.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B3B215.3020000@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: George Dunlap <dunlapg@umich.edu>, "Keir \(Xen.org\)" <keir@xen.org>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 18:16 +0000, Andrew Cooper wrote:
> On 26/11/12 17:57, George Dunlap wrote:
> > So while doing a bit of investigation into a request that we have
> > instructions for how to sign a Xen binary, I came across a related
> > pair of questions.  If we boot from a signed Xen binary, then:
> > 1. Will Xen then successfully boot a signed dom0 kernel / initrd?
> > 2. Will Xen fail to boot an unsigned dom0 kernel / initrd?
> >
> > I think if Xen is signed, then ideally we want both 1 and 2 to be
> > true, right?  Does UEFI provide a way to check the signature of
> > files?  Does it happen automatically, or would we need to add extra
> > support?  Or would we need to embed a public key within the Xen binary
> > and have Xen check the signatures of files that it reads?
> >
> >  -George
> 
> The problem is deeper than that.
> 
> The idea of secure boot is that only signed/verified code can perform
> privileged operations.  One can argue as to exactly where this boundary
> lies, but in the native case, it contains any kernel level code. 
> Userspace uses the kernel API/ABI subject to the permissions checks
> present and (assuming no security holes), everyone is happy.
> 
> In the Xen case, Xen will happily accept any privileged hypercalls from
> dom0.  So you could argue that anything able to make ioctls against
> /dev/xen/privcmd (and friends) would need to be within the signed code. 
> This is the entire toolstack, and all root processes.

AIUI Restricted Boot doesn't really concern itself with the integrity of
the system post boot, just with the integrity of the bits which are
being booted. I think this extends to booting dom0 but anything relating
to booting guests could reasonably be considered to be handled
separately.

Given that it's very possible that the hypervisor could lock down even
dom0 from being able to make calls which would allow the firmware to be
subverted (i.e. access to I/O ports or MMIO regions which would allow
the BIOS to be reflashed or whatever), at which point dom0 root user and
toolstack becomes irrelevant.

That probably involves some sort of black/whitelisting scheme for I/O
ports and such which is pretty tedious but not overwhelming I don't
think.

> Furthermore, cross-domain systems like xenbus/xenstore would also need
> to be signed.  Imagine the carnage a malicious xenstored could cause!

It would need to be able to subvert the bootloader and system firmware
or something, which seems like a bit of a stretch.

> I am struggling to think of a way of getting secure boot working
> correctly without signing all of dom0.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:57:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:57:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIqt-0000Sy-Iz; Tue, 27 Nov 2012 10:57:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdIqr-0000Sh-L8
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:57:17 +0000
Received: from [85.158.139.211:37115] by server-2.bemta-5.messagelabs.com id
	79/C6-04892-C8C94B05; Tue, 27 Nov 2012 10:57:16 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354013826!18037830!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2939 invoked from network); 27 Nov 2012 10:57:07 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 10:57:07 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 10:57:06 +0000
Message-Id: <50B4AAC702000078000AB988@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 10:57:59 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>,
	"Lars Kurth" <lars.kurth.xen@gmail.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<CAOqnZH4qVRoDCpaCGT3zuJu85t17XkuUJSoxBoMhXd95p9b5tg@mail.gmail.com>
	<1354013546.5830.182.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354013546.5830.182.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 27.11.12 at 11:52, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Tue, 2012-11-27 at 09:56 +0000, Lars Kurth wrote:
>> > Each stable branch has a maintainer who is nominated/volunteers and
>> is
>> > accepted via consensus among the maintainers and committers (XXX or
>> just
>> > committers?). 
>> I am wondering whether we should treat this exactly like
>> maintainership. It's the same idea.
>> We could just add a "stable release" section to the MAINTAINERS file
>> and follow the same 
>> process of nominating a maintainer. Or track the stable release
>> maintainer in the branched
>> versions of the file. Does anybody have any views?
> 
> I think we could reasonably do both?

I'm not certain tracking stable branch maintainers in the -unstable
MAINTAINERS file is of much use, plus I would be afraid this would
then be forgotten to get updated upon releases (and hence getting
stale quite quickly).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:57:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:57:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIqt-0000Sy-Iz; Tue, 27 Nov 2012 10:57:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdIqr-0000Sh-L8
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:57:17 +0000
Received: from [85.158.139.211:37115] by server-2.bemta-5.messagelabs.com id
	79/C6-04892-C8C94B05; Tue, 27 Nov 2012 10:57:16 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354013826!18037830!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2939 invoked from network); 27 Nov 2012 10:57:07 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 10:57:07 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 10:57:06 +0000
Message-Id: <50B4AAC702000078000AB988@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 10:57:59 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>,
	"Lars Kurth" <lars.kurth.xen@gmail.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<CAOqnZH4qVRoDCpaCGT3zuJu85t17XkuUJSoxBoMhXd95p9b5tg@mail.gmail.com>
	<1354013546.5830.182.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354013546.5830.182.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 27.11.12 at 11:52, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Tue, 2012-11-27 at 09:56 +0000, Lars Kurth wrote:
>> > Each stable branch has a maintainer who is nominated/volunteers and
>> is
>> > accepted via consensus among the maintainers and committers (XXX or
>> just
>> > committers?). 
>> I am wondering whether we should treat this exactly like
>> maintainership. It's the same idea.
>> We could just add a "stable release" section to the MAINTAINERS file
>> and follow the same 
>> process of nominating a maintainer. Or track the stable release
>> maintainer in the branched
>> versions of the file. Does anybody have any views?
> 
> I think we could reasonably do both?

I'm not certain tracking stable branch maintainers in the -unstable
MAINTAINERS file is of much use, plus I would be afraid this would
then be forgotten to get updated upon releases (and hence getting
stale quite quickly).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:59:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:59:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIsv-0000go-4M; Tue, 27 Nov 2012 10:59:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdIss-0000ga-Sj
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:59:23 +0000
Received: from [85.158.139.211:34033] by server-1.bemta-5.messagelabs.com id
	7D/96-09311-90D94B05; Tue, 27 Nov 2012 10:59:21 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1354013955!18072376!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14831 invoked from network); 27 Nov 2012 10:59:15 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 10:59:15 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 10:59:15 +0000
Message-Id: <50B4AB4802000078000AB98B@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 11:00:08 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "George Dunlap" <George.Dunlap@eu.citrix.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<alpine.DEB.2.02.1211262011190.5310@kaball.uk.xensource.com>
	<20121126215104.2343b419@pyramind.ukuu.org.uk>
	<CAFLBxZYmgJEHB4ipg-s2Tasyg+Wc3NTg=ESifMqiswSGajSsmg@mail.gmail.com>
In-Reply-To: <CAFLBxZYmgJEHB4ipg-s2Tasyg+Wc3NTg=ESifMqiswSGajSsmg@mail.gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 27.11.12 at 10:50, George Dunlap <George.Dunlap@eu.citrix.com> wrote:
> On Mon, Nov 26, 2012 at 9:51 PM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
>> You want to sign a small bootloader that is tightly auditable and do your
>> own key management within that for anything else. I would think you'd be
>> able to make use of the Linux bootloader work.
>>
> 
> I was thinking of people who wanted to install their own keys.  Some people
> think that since you have EFI you shouldn't need a bootloader. :-)

I think boot loader is the wrong term - shim loader is what our folks
use (i.e. just a wrapper to deal with the key problem). That would
wrap grub2.efi (or whatever its name) as well as xen.efi or (if
someone cares) elilo.efi.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 10:59:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 10:59:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIsv-0000go-4M; Tue, 27 Nov 2012 10:59:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdIss-0000ga-Sj
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 10:59:23 +0000
Received: from [85.158.139.211:34033] by server-1.bemta-5.messagelabs.com id
	7D/96-09311-90D94B05; Tue, 27 Nov 2012 10:59:21 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1354013955!18072376!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14831 invoked from network); 27 Nov 2012 10:59:15 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 10:59:15 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 10:59:15 +0000
Message-Id: <50B4AB4802000078000AB98B@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 11:00:08 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "George Dunlap" <George.Dunlap@eu.citrix.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<alpine.DEB.2.02.1211262011190.5310@kaball.uk.xensource.com>
	<20121126215104.2343b419@pyramind.ukuu.org.uk>
	<CAFLBxZYmgJEHB4ipg-s2Tasyg+Wc3NTg=ESifMqiswSGajSsmg@mail.gmail.com>
In-Reply-To: <CAFLBxZYmgJEHB4ipg-s2Tasyg+Wc3NTg=ESifMqiswSGajSsmg@mail.gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 27.11.12 at 10:50, George Dunlap <George.Dunlap@eu.citrix.com> wrote:
> On Mon, Nov 26, 2012 at 9:51 PM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
>> You want to sign a small bootloader that is tightly auditable and do your
>> own key management within that for anything else. I would think you'd be
>> able to make use of the Linux bootloader work.
>>
> 
> I was thinking of people who wanted to install their own keys.  Some people
> think that since you have EFI you shouldn't need a bootloader. :-)

I think boot loader is the wrong term - shim loader is what our folks
use (i.e. just a wrapper to deal with the key problem). That would
wrap grub2.efi (or whatever its name) as well as xen.efi or (if
someone cares) elilo.efi.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:01:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:01:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIuR-0000ux-AW; Tue, 27 Nov 2012 11:00:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <berrange@redhat.com>) id 1TdIuP-0000ub-NS
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:00:57 +0000
Received: from [85.158.143.99:30043] by server-1.bemta-4.messagelabs.com id
	D0/A5-27934-96D94B05; Tue, 27 Nov 2012 11:00:57 +0000
X-Env-Sender: berrange@redhat.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1354014052!31556925!1
X-Originating-IP: [209.132.183.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTU0Njc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18368 invoked from network); 27 Nov 2012 11:00:53 -0000
Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28)
	by server-9.tower-216.messagelabs.com with SMTP;
	27 Nov 2012 11:00:53 -0000
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qARB0o93026213
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 27 Nov 2012 06:00:50 -0500
Received: from redhat.com (vpn1-7-240.ams2.redhat.com [10.36.7.240])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id qARB0bjW008585
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO);
	Tue, 27 Nov 2012 06:00:40 -0500
Date: Tue, 27 Nov 2012 11:00:37 +0000
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121127110037.GG24370@redhat.com>
References: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
	<1354013490.5830.181.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354013490.5830.181.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
Cc: "libvir-list@redhat.com" <libvir-list@redhat.com>,
	Jim Fehlig <jfehlig@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [libvirt]  [PATCH] Convert libxl driver to Xen 4.2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: "Daniel P. Berrange" <berrange@redhat.com>
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 27, 2012 at 10:51:30AM +0000, Ian Campbell wrote:
> On Mon, 2012-11-26 at 22:28 +0000, Jim Fehlig wrote:
> > 
> > @@ -62,6 +63,52 @@ struct guest_arch {
> >  static const char *xen_cap_re = "(xen|hvm)-[[:digit:]]+\
> > \.[[:digit:]]+-(x86_32|x86_64|ia64|powerpc64)(p|be)?";
> >  static regex_t xen_cap_rec;
> > 
> > +/*
> > + * Copied from split_string_into_string_list() in
> > + * $xen-sources/tools/libxl/xl_cmdimpl.c, which is licensed LGPL v2.1.
> > + */
> 
> Looks like I am the sole author of that original function
> (24250:71ecbef5645f xen-unstable.hg). I'd more than likely be happy to
> relicence under whatever terms would be suitable for libvirt -- what are
> they?
> 
> In particular I'd be happy with LGPL v2.1+ if that's what it takes.

Yes, LGPL v2.1+ is what libvirt uses.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:01:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:01:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIuR-0000ux-AW; Tue, 27 Nov 2012 11:00:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <berrange@redhat.com>) id 1TdIuP-0000ub-NS
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:00:57 +0000
Received: from [85.158.143.99:30043] by server-1.bemta-4.messagelabs.com id
	D0/A5-27934-96D94B05; Tue, 27 Nov 2012 11:00:57 +0000
X-Env-Sender: berrange@redhat.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1354014052!31556925!1
X-Originating-IP: [209.132.183.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTU0Njc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18368 invoked from network); 27 Nov 2012 11:00:53 -0000
Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28)
	by server-9.tower-216.messagelabs.com with SMTP;
	27 Nov 2012 11:00:53 -0000
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qARB0o93026213
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 27 Nov 2012 06:00:50 -0500
Received: from redhat.com (vpn1-7-240.ams2.redhat.com [10.36.7.240])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id qARB0bjW008585
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO);
	Tue, 27 Nov 2012 06:00:40 -0500
Date: Tue, 27 Nov 2012 11:00:37 +0000
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121127110037.GG24370@redhat.com>
References: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
	<1354013490.5830.181.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354013490.5830.181.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
Cc: "libvir-list@redhat.com" <libvir-list@redhat.com>,
	Jim Fehlig <jfehlig@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [libvirt]  [PATCH] Convert libxl driver to Xen 4.2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: "Daniel P. Berrange" <berrange@redhat.com>
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 27, 2012 at 10:51:30AM +0000, Ian Campbell wrote:
> On Mon, 2012-11-26 at 22:28 +0000, Jim Fehlig wrote:
> > 
> > @@ -62,6 +63,52 @@ struct guest_arch {
> >  static const char *xen_cap_re = "(xen|hvm)-[[:digit:]]+\
> > \.[[:digit:]]+-(x86_32|x86_64|ia64|powerpc64)(p|be)?";
> >  static regex_t xen_cap_rec;
> > 
> > +/*
> > + * Copied from split_string_into_string_list() in
> > + * $xen-sources/tools/libxl/xl_cmdimpl.c, which is licensed LGPL v2.1.
> > + */
> 
> Looks like I am the sole author of that original function
> (24250:71ecbef5645f xen-unstable.hg). I'd more than likely be happy to
> relicence under whatever terms would be suitable for libvirt -- what are
> they?
> 
> In particular I'd be happy with LGPL v2.1+ if that's what it takes.

Yes, LGPL v2.1+ is what libvirt uses.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:04:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:04:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIxo-0001GD-WA; Tue, 27 Nov 2012 11:04:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdIxn-0001G1-H7
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:04:27 +0000
Received: from [85.158.137.99:39047] by server-8.bemta-3.messagelabs.com id
	D5/8E-07786-63E94B05; Tue, 27 Nov 2012 11:04:22 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1354014261!17635555!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21741 invoked from network); 27 Nov 2012 11:04:22 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:04:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16020174"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:03:16 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 11:03:16 +0000
Message-ID: <1354014194.5830.191.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 27 Nov 2012 11:03:14 +0000
In-Reply-To: <50B3ADD602000078000AB518@nat28.tlf.novell.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<50B3A8DA02000078000AB460@nat28.tlf.novell.com>
	<1353948353.5830.116.camel@zakaz.uk.xensource.com>
	<50B3ADD602000078000AB518@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>, Lars Kurth <lars.kurth@xen.org>,
	"Keir \(Xen.org\)" <keir@xen.org>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 16:58 +0000, Jan Beulich wrote:
> >>> On 26.11.12 at 17:45, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Mon, 2012-11-26 at 16:37 +0000, Jan Beulich wrote:
> >> >>> On 26.11.12 at 16:58, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> >> > No new development happens in the X.Y-testing branches, instead
> >> > changesets are backported from xen-unstable. Where this is not possible
> >> > (perhaps unstable has moved on such that the patch cannot be applied or
> >> > the approach used in unstable is otherwise not valid for the stable
> >> > branch) then a specific fix can be created for the stable branch.
> >> > However it is a requirement that the issue will always be fixed in
> >> > unstable first (this is to avoid regressions on the next stable
> >> 
> >> Did you mean "major" here?
> > 
> > Where? Before "regressions"? I'd like to think we were striving to avoid
> > regressions of either sort ;-)
> 
> Oh, sorry, I thought it to be clear that I wanted "stable" replaced
> by "major" (because that's where a regression would occur with a
> fix that wasn't a backport). But as always, I should have made this
> explicit.

Got it, yes you are absolutely right.

I was a bit worried about "major" implying the X being bumped, not just
the Y. But we don't really distinguish these (cf the 4.0 bump being
nothing especially significant) so I think I worried needlessly.

> 
> >> > Changesets are nominated for inclusion in the stable branch by making a
> >> > request to the stable maintainer on xen-devel either by noting it as
> >> > such in the submission of the original patch to xen-unstable or by a
> >> > subsequent explicit email to xen-devel.
> >> 
> >> I think we should explicitly require the person expected to do the
> >> backport to be Cc-ed; I for myself don't get around to read _all_
> >> mails on xen-devel, and hence with a badly chosen subject it is not
> >> impossible (albeit also not likely) for me to miss such a request
> >> otherwise.
> > 
> > That makes sense to me. Should we add entries to MAINTAINERS to cover
> > stable trees as well?
> 
> Maybe specifically on the stable branches?

Yes, or both?

> > I also wondered if it might be useful to have a greppable string, like
> > Linux's "CC: stable@kernel.org"? AIUI the Linux stable guys don't
> > actually use this as a mailing list, even though it technically does
> > exist as such, instead they use it as grep fodder for their tooling. We
> > could certainly setup stable@xen.org, directed to a blackhole if
> > necessary.
> 
> Since we don't generally include Cc-s in commit messages, I don't
> think that would help much. But I'm not opposed to this either.

I guess we could always start.

I think its pretty likely that having switched to git folks are likely
to start making more use of this (IMHO very convenient) feature of git
format-patch/send-email anyway.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:04:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:04:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIxo-0001GD-WA; Tue, 27 Nov 2012 11:04:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdIxn-0001G1-H7
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:04:27 +0000
Received: from [85.158.137.99:39047] by server-8.bemta-3.messagelabs.com id
	D5/8E-07786-63E94B05; Tue, 27 Nov 2012 11:04:22 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1354014261!17635555!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21741 invoked from network); 27 Nov 2012 11:04:22 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:04:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16020174"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:03:16 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 11:03:16 +0000
Message-ID: <1354014194.5830.191.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 27 Nov 2012 11:03:14 +0000
In-Reply-To: <50B3ADD602000078000AB518@nat28.tlf.novell.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<50B3A8DA02000078000AB460@nat28.tlf.novell.com>
	<1353948353.5830.116.camel@zakaz.uk.xensource.com>
	<50B3ADD602000078000AB518@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>, Lars Kurth <lars.kurth@xen.org>,
	"Keir \(Xen.org\)" <keir@xen.org>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 16:58 +0000, Jan Beulich wrote:
> >>> On 26.11.12 at 17:45, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Mon, 2012-11-26 at 16:37 +0000, Jan Beulich wrote:
> >> >>> On 26.11.12 at 16:58, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> >> > No new development happens in the X.Y-testing branches, instead
> >> > changesets are backported from xen-unstable. Where this is not possible
> >> > (perhaps unstable has moved on such that the patch cannot be applied or
> >> > the approach used in unstable is otherwise not valid for the stable
> >> > branch) then a specific fix can be created for the stable branch.
> >> > However it is a requirement that the issue will always be fixed in
> >> > unstable first (this is to avoid regressions on the next stable
> >> 
> >> Did you mean "major" here?
> > 
> > Where? Before "regressions"? I'd like to think we were striving to avoid
> > regressions of either sort ;-)
> 
> Oh, sorry, I thought it to be clear that I wanted "stable" replaced
> by "major" (because that's where a regression would occur with a
> fix that wasn't a backport). But as always, I should have made this
> explicit.

Got it, yes you are absolutely right.

I was a bit worried about "major" implying the X being bumped, not just
the Y. But we don't really distinguish these (cf the 4.0 bump being
nothing especially significant) so I think I worried needlessly.

> 
> >> > Changesets are nominated for inclusion in the stable branch by making a
> >> > request to the stable maintainer on xen-devel either by noting it as
> >> > such in the submission of the original patch to xen-unstable or by a
> >> > subsequent explicit email to xen-devel.
> >> 
> >> I think we should explicitly require the person expected to do the
> >> backport to be Cc-ed; I for myself don't get around to read _all_
> >> mails on xen-devel, and hence with a badly chosen subject it is not
> >> impossible (albeit also not likely) for me to miss such a request
> >> otherwise.
> > 
> > That makes sense to me. Should we add entries to MAINTAINERS to cover
> > stable trees as well?
> 
> Maybe specifically on the stable branches?

Yes, or both?

> > I also wondered if it might be useful to have a greppable string, like
> > Linux's "CC: stable@kernel.org"? AIUI the Linux stable guys don't
> > actually use this as a mailing list, even though it technically does
> > exist as such, instead they use it as grep fodder for their tooling. We
> > could certainly setup stable@xen.org, directed to a blackhole if
> > necessary.
> 
> Since we don't generally include Cc-s in commit messages, I don't
> think that would help much. But I'm not opposed to this either.

I guess we could always start.

I think its pretty likely that having switched to git folks are likely
to start making more use of this (IMHO very convenient) feature of git
format-patch/send-email anyway.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:05:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:05:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIyC-0001JI-Kd; Tue, 27 Nov 2012 11:04:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdIyA-0001J0-Ow
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:04:50 +0000
Received: from [85.158.137.99:46119] by server-11.bemta-3.messagelabs.com id
	76/05-19361-D4E94B05; Tue, 27 Nov 2012 11:04:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354014283!20670681!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8344 invoked from network); 27 Nov 2012 11:04:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:04:44 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16020229"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:04:43 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 11:04:43 +0000
Message-ID: <1354014281.5830.193.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 27 Nov 2012 11:04:41 +0000
In-Reply-To: <50B4AAC702000078000AB988@nat28.tlf.novell.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<CAOqnZH4qVRoDCpaCGT3zuJu85t17XkuUJSoxBoMhXd95p9b5tg@mail.gmail.com>
	<1354013546.5830.182.camel@zakaz.uk.xensource.com>
	<50B4AAC702000078000AB988@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Lars Kurth <lars.kurth.xen@gmail.com>, "Keir
	\(Xen.org\)" <keir@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 10:57 +0000, Jan Beulich wrote:
> >>> On 27.11.12 at 11:52, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Tue, 2012-11-27 at 09:56 +0000, Lars Kurth wrote:
> >> > Each stable branch has a maintainer who is nominated/volunteers and
> >> is
> >> > accepted via consensus among the maintainers and committers (XXX or
> >> just
> >> > committers?). 
> >> I am wondering whether we should treat this exactly like
> >> maintainership. It's the same idea.
> >> We could just add a "stable release" section to the MAINTAINERS file
> >> and follow the same 
> >> process of nominating a maintainer. Or track the stable release
> >> maintainer in the branched
> >> versions of the file. Does anybody have any views?
> > 
> > I think we could reasonably do both?
> 
> I'm not certain tracking stable branch maintainers in the -unstable
> MAINTAINERS file is of much use, plus I would be afraid this would
> then be forgotten to get updated upon releases (and hence getting
> stale quite quickly).

My theory was that people looking in unstable for the fix the their
problem might just look in to the unstable MAINTAINERS file. In reality
I suspect no one ever looks in there for any reason anyway (we don't
really have a culture of CCing maintainers).

We could at least include a reference in unstable to the stable backport
docs, even if we don't list specific maintainers.

Ian.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:05:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:05:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdIyC-0001JI-Kd; Tue, 27 Nov 2012 11:04:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdIyA-0001J0-Ow
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:04:50 +0000
Received: from [85.158.137.99:46119] by server-11.bemta-3.messagelabs.com id
	76/05-19361-D4E94B05; Tue, 27 Nov 2012 11:04:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354014283!20670681!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8344 invoked from network); 27 Nov 2012 11:04:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:04:44 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16020229"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:04:43 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 11:04:43 +0000
Message-ID: <1354014281.5830.193.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Tue, 27 Nov 2012 11:04:41 +0000
In-Reply-To: <50B4AAC702000078000AB988@nat28.tlf.novell.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<CAOqnZH4qVRoDCpaCGT3zuJu85t17XkuUJSoxBoMhXd95p9b5tg@mail.gmail.com>
	<1354013546.5830.182.camel@zakaz.uk.xensource.com>
	<50B4AAC702000078000AB988@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Lars Kurth <lars.kurth.xen@gmail.com>, "Keir
	\(Xen.org\)" <keir@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 10:57 +0000, Jan Beulich wrote:
> >>> On 27.11.12 at 11:52, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Tue, 2012-11-27 at 09:56 +0000, Lars Kurth wrote:
> >> > Each stable branch has a maintainer who is nominated/volunteers and
> >> is
> >> > accepted via consensus among the maintainers and committers (XXX or
> >> just
> >> > committers?). 
> >> I am wondering whether we should treat this exactly like
> >> maintainership. It's the same idea.
> >> We could just add a "stable release" section to the MAINTAINERS file
> >> and follow the same 
> >> process of nominating a maintainer. Or track the stable release
> >> maintainer in the branched
> >> versions of the file. Does anybody have any views?
> > 
> > I think we could reasonably do both?
> 
> I'm not certain tracking stable branch maintainers in the -unstable
> MAINTAINERS file is of much use, plus I would be afraid this would
> then be forgotten to get updated upon releases (and hence getting
> stale quite quickly).

My theory was that people looking in unstable for the fix the their
problem might just look in to the unstable MAINTAINERS file. In reality
I suspect no one ever looks in there for any reason anyway (we don't
really have a culture of CCing maintainers).

We could at least include a reference in unstable to the stable backport
docs, even if we don't list specific maintainers.

Ian.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:10:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:10:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJ3Y-0001n9-35; Tue, 27 Nov 2012 11:10:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TdJ3X-0001n1-4z
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:10:23 +0000
Received: from [85.158.139.83:51489] by server-14.bemta-5.messagelabs.com id
	D4/53-21768-E9F94B05; Tue, 27 Nov 2012 11:10:22 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1354014619!26987871!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22345 invoked from network); 27 Nov 2012 11:10:21 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:10:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215575373"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:10:19 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 06:10:18 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TdJ3S-0004Rx-Jp;
	Tue, 27 Nov 2012 11:10:18 +0000
Date: Tue, 27 Nov 2012 11:10:16 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <ian.campbell@citrix.com>
In-Reply-To: <3174dc24e3efb0c5b964.1354011201@cosworth.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211271109190.5310@kaball.uk.xensource.com>
References: <3174dc24e3efb0c5b964.1354011201@cosworth.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xl: xl.conf(5): correct advice re
 autoballooning vs. dom0_mem
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 27 Nov 2012, Ian Campbell wrote:
> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk>
> # Date 1354011148 0
> # Node ID 3174dc24e3efb0c5b964c244dbfb0218a03a38cf
> # Parent  541b0e1a36c86db5df04988dd4ade5430776a7f2
> xl: xl.conf(5): correct advice re autoballooning vs. dom0_mem.
> 
> The advice was backwards, you should really disable autoballoon if you
> use dom0_mem. Also add a reference to the command-line docs.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

> diff -r 541b0e1a36c8 -r 3174dc24e3ef docs/man/xl.conf.pod.5
> --- a/docs/man/xl.conf.pod.5	Tue Nov 27 10:05:35 2012 +0000
> +++ b/docs/man/xl.conf.pod.5	Tue Nov 27 10:12:28 2012 +0000
> @@ -49,9 +49,9 @@ The semantics of each C<KEY> defines whi
>  
>  If disabled then C<xl> will not attempt to reduce the amount of memory
>  assigned to domain 0 in order to create free memory when starting a
> -new domain. You should set this if you use the C<dom0_mem> hypervisor
> -command line to reduce the amount of memory given to domain 0 by
> -default.
> +new domain. You are strongly recommended to set this to C<0>
> +(C<False>) if you use the C<dom0_mem> hypervisor command line to
> +reduce the amount of memory given to domain 0 by default.
>  
>  Default: C<1>
>  
> diff -r 541b0e1a36c8 -r 3174dc24e3ef docs/misc/xen-command-line.markdown
> --- a/docs/misc/xen-command-line.markdown	Tue Nov 27 10:05:35 2012 +0000
> +++ b/docs/misc/xen-command-line.markdown	Tue Nov 27 10:12:28 2012 +0000
> @@ -440,6 +440,11 @@ reservation is unlimited.
>  For example, to set dom0's initial memory allocation to 512MB but
>  allow it to balloon up as far as 1GB use `dom0_mem=512M,max:1G`
>  
> +If you use this option then it is highly recommended that you disable
> +any dom0 autoballooning feature present in your toolstack. See the
> +_xl.conf(5)_ man page or [Xen Best
> +Practices](http://wiki.xen.org/wiki/Xen_Best_Practices#Xen_dom0_dedicated_memory_and_preventing_dom0_memory_ballooning).
> +
>  ### dom0\_shadow
>  > `= <boolean>`
>  
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:10:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:10:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJ3Y-0001n9-35; Tue, 27 Nov 2012 11:10:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TdJ3X-0001n1-4z
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:10:23 +0000
Received: from [85.158.139.83:51489] by server-14.bemta-5.messagelabs.com id
	D4/53-21768-E9F94B05; Tue, 27 Nov 2012 11:10:22 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1354014619!26987871!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22345 invoked from network); 27 Nov 2012 11:10:21 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:10:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215575373"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:10:19 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 06:10:18 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TdJ3S-0004Rx-Jp;
	Tue, 27 Nov 2012 11:10:18 +0000
Date: Tue, 27 Nov 2012 11:10:16 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <ian.campbell@citrix.com>
In-Reply-To: <3174dc24e3efb0c5b964.1354011201@cosworth.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211271109190.5310@kaball.uk.xensource.com>
References: <3174dc24e3efb0c5b964.1354011201@cosworth.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xl: xl.conf(5): correct advice re
 autoballooning vs. dom0_mem
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 27 Nov 2012, Ian Campbell wrote:
> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk>
> # Date 1354011148 0
> # Node ID 3174dc24e3efb0c5b964c244dbfb0218a03a38cf
> # Parent  541b0e1a36c86db5df04988dd4ade5430776a7f2
> xl: xl.conf(5): correct advice re autoballooning vs. dom0_mem.
> 
> The advice was backwards, you should really disable autoballoon if you
> use dom0_mem. Also add a reference to the command-line docs.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

> diff -r 541b0e1a36c8 -r 3174dc24e3ef docs/man/xl.conf.pod.5
> --- a/docs/man/xl.conf.pod.5	Tue Nov 27 10:05:35 2012 +0000
> +++ b/docs/man/xl.conf.pod.5	Tue Nov 27 10:12:28 2012 +0000
> @@ -49,9 +49,9 @@ The semantics of each C<KEY> defines whi
>  
>  If disabled then C<xl> will not attempt to reduce the amount of memory
>  assigned to domain 0 in order to create free memory when starting a
> -new domain. You should set this if you use the C<dom0_mem> hypervisor
> -command line to reduce the amount of memory given to domain 0 by
> -default.
> +new domain. You are strongly recommended to set this to C<0>
> +(C<False>) if you use the C<dom0_mem> hypervisor command line to
> +reduce the amount of memory given to domain 0 by default.
>  
>  Default: C<1>
>  
> diff -r 541b0e1a36c8 -r 3174dc24e3ef docs/misc/xen-command-line.markdown
> --- a/docs/misc/xen-command-line.markdown	Tue Nov 27 10:05:35 2012 +0000
> +++ b/docs/misc/xen-command-line.markdown	Tue Nov 27 10:12:28 2012 +0000
> @@ -440,6 +440,11 @@ reservation is unlimited.
>  For example, to set dom0's initial memory allocation to 512MB but
>  allow it to balloon up as far as 1GB use `dom0_mem=512M,max:1G`
>  
> +If you use this option then it is highly recommended that you disable
> +any dom0 autoballooning feature present in your toolstack. See the
> +_xl.conf(5)_ man page or [Xen Best
> +Practices](http://wiki.xen.org/wiki/Xen_Best_Practices#Xen_dom0_dedicated_memory_and_preventing_dom0_memory_ballooning).
> +
>  ### dom0\_shadow
>  > `= <boolean>`
>  
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:16:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:16:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJ8m-00025R-Sb; Tue, 27 Nov 2012 11:15:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <alan@lxorguk.ukuu.org.uk>) id 1TdJ8l-00025J-EX
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:15:47 +0000
Received: from [85.158.137.99:12356] by server-4.bemta-3.messagelabs.com id
	8C/07-30023-2E0A4B05; Tue, 27 Nov 2012 11:15:46 +0000
X-Env-Sender: alan@lxorguk.ukuu.org.uk
X-Msg-Ref: server-8.tower-217.messagelabs.com!1354014945!13949972!1
X-Originating-IP: [81.2.110.251]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12208 invoked from network); 27 Nov 2012 11:15:45 -0000
Received: from lxorguk.ukuu.org.uk (HELO lxorguk.ukuu.org.uk) (81.2.110.251)
	by server-8.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 11:15:45 -0000
Received: from pyramind.ukuu.org.uk (earthlight.etchedpixels.co.uk
	[81.2.110.250])
	by lxorguk.ukuu.org.uk (8.14.5/8.14.1) with ESMTP id qARBkEdQ031009;
	Tue, 27 Nov 2012 11:46:19 GMT
Received: from pyramind.ukuu.org.uk (localhost [127.0.0.1])
	by pyramind.ukuu.org.uk (8.14.5/8.14.5) with ESMTP id qARBK3PT026524;
	Tue, 27 Nov 2012 11:20:04 GMT
Date: Tue, 27 Nov 2012 11:20:03 +0000
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: George Dunlap <dunlapg@umich.edu>
Message-ID: <20121127112003.7bbae497@pyramind.ukuu.org.uk>
In-Reply-To: <CAFLBxZYgnLdT3OE+akGYqg2qvJmcfxb5xx0=U0SHsZiHMErWJw@mail.gmail.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B3B215.3020000@citrix.com>
	<CAFLBxZYgnLdT3OE+akGYqg2qvJmcfxb5xx0=U0SHsZiHMErWJw@mail.gmail.com>
X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.8; x86_64-redhat-linux-gnu)
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEWysKsSBQMIAwIZCwj///8wIhxoRDXH9QHCAAABeUlEQVQ4jaXTvW7DIBAAYCQTzz2hdq+rdg494ZmBeE5KYHZjm/d/hJ6NfzBJpp5kRb5PHJwvMPMk2L9As5Y9AmYRBL+HAyJKeOU5aHRhsAAvORQ+UEgAvgddj/lwAXndw2laEDqA4x6KEBhjYRCg9tBFCOuJFxg2OKegbWjbsRTk8PPhKPD7HcRxB7cqhgBRp9Dcqs+B8v4CQvFdqeot3Kov6hBUn0AJitrzY+sgUuiA8i0r7+B3AfqKcN6t8M6HtqQ+AOoELCikgQSbgabKaJW3kn5lBs47JSGDhhLKDUh1UMipwwinMYPTBuIBjEclSaGZUk9hDlTb5sUTYN2SFFQuPe4Gox1X0FZOufjgBiV1Vls7b+GvK3SU4wfmcGo9rPPQzgIabfj4TYQo15k3bTHX9RIw/kniir5YbtJF4jkFG+dsDK1IgE413zAthU/vR2HVMmFUPIHTvF6jWCpFaGw/A3qWgnbxpSm9MSmY5b3pM1gvNc/gQfwBsGwF0VCtxZgAAAAASUVORK5CYII=
Mime-Version: 1.0
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	"Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> ruling out third-party or out-of-tree drivers.  Ubuntu are not signing
> modules AIUI, so in theory someone could install a rootkit; but they think

They can anyway. If the kernel has a hole you can just stuff something
hidden in early early userspace boot (eg in the initrd) to re-trojan it.

Plus the next generation of devices mostly suspend/resume so its hardly
that important anyway.

> that it's likely any local attacker is going to be able to attack the
> kernel anyway; on the balance having third-party drivers is more important
> to them.

Don't be misled into thinking this has anything much to do with security.
If you are trying to do security use the TPM and do a trusted measured
boot which gives you the keys to the file system which then uses signing
of its own.
 
> Nonetheless, Ubuntu are still signing kernels

In the UEFI sense they are not - nor are Fedora. They are signing a tiny
boot loader and implementing their own policy behind that. It's basically
a way around the Windows 8 lock down.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:16:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:16:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJ8m-00025R-Sb; Tue, 27 Nov 2012 11:15:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <alan@lxorguk.ukuu.org.uk>) id 1TdJ8l-00025J-EX
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:15:47 +0000
Received: from [85.158.137.99:12356] by server-4.bemta-3.messagelabs.com id
	8C/07-30023-2E0A4B05; Tue, 27 Nov 2012 11:15:46 +0000
X-Env-Sender: alan@lxorguk.ukuu.org.uk
X-Msg-Ref: server-8.tower-217.messagelabs.com!1354014945!13949972!1
X-Originating-IP: [81.2.110.251]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12208 invoked from network); 27 Nov 2012 11:15:45 -0000
Received: from lxorguk.ukuu.org.uk (HELO lxorguk.ukuu.org.uk) (81.2.110.251)
	by server-8.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 11:15:45 -0000
Received: from pyramind.ukuu.org.uk (earthlight.etchedpixels.co.uk
	[81.2.110.250])
	by lxorguk.ukuu.org.uk (8.14.5/8.14.1) with ESMTP id qARBkEdQ031009;
	Tue, 27 Nov 2012 11:46:19 GMT
Received: from pyramind.ukuu.org.uk (localhost [127.0.0.1])
	by pyramind.ukuu.org.uk (8.14.5/8.14.5) with ESMTP id qARBK3PT026524;
	Tue, 27 Nov 2012 11:20:04 GMT
Date: Tue, 27 Nov 2012 11:20:03 +0000
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: George Dunlap <dunlapg@umich.edu>
Message-ID: <20121127112003.7bbae497@pyramind.ukuu.org.uk>
In-Reply-To: <CAFLBxZYgnLdT3OE+akGYqg2qvJmcfxb5xx0=U0SHsZiHMErWJw@mail.gmail.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B3B215.3020000@citrix.com>
	<CAFLBxZYgnLdT3OE+akGYqg2qvJmcfxb5xx0=U0SHsZiHMErWJw@mail.gmail.com>
X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.8; x86_64-redhat-linux-gnu)
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEWysKsSBQMIAwIZCwj///8wIhxoRDXH9QHCAAABeUlEQVQ4jaXTvW7DIBAAYCQTzz2hdq+rdg494ZmBeE5KYHZjm/d/hJ6NfzBJpp5kRb5PHJwvMPMk2L9As5Y9AmYRBL+HAyJKeOU5aHRhsAAvORQ+UEgAvgddj/lwAXndw2laEDqA4x6KEBhjYRCg9tBFCOuJFxg2OKegbWjbsRTk8PPhKPD7HcRxB7cqhgBRp9Dcqs+B8v4CQvFdqeot3Kov6hBUn0AJitrzY+sgUuiA8i0r7+B3AfqKcN6t8M6HtqQ+AOoELCikgQSbgabKaJW3kn5lBs47JSGDhhLKDUh1UMipwwinMYPTBuIBjEclSaGZUk9hDlTb5sUTYN2SFFQuPe4Gox1X0FZOufjgBiV1Vls7b+GvK3SU4wfmcGo9rPPQzgIabfj4TYQo15k3bTHX9RIw/kniir5YbtJF4jkFG+dsDK1IgE413zAthU/vR2HVMmFUPIHTvF6jWCpFaGw/A3qWgnbxpSm9MSmY5b3pM1gvNc/gQfwBsGwF0VCtxZgAAAAASUVORK5CYII=
Mime-Version: 1.0
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	"Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> ruling out third-party or out-of-tree drivers.  Ubuntu are not signing
> modules AIUI, so in theory someone could install a rootkit; but they think

They can anyway. If the kernel has a hole you can just stuff something
hidden in early early userspace boot (eg in the initrd) to re-trojan it.

Plus the next generation of devices mostly suspend/resume so its hardly
that important anyway.

> that it's likely any local attacker is going to be able to attack the
> kernel anyway; on the balance having third-party drivers is more important
> to them.

Don't be misled into thinking this has anything much to do with security.
If you are trying to do security use the TPM and do a trusted measured
boot which gives you the keys to the file system which then uses signing
of its own.
 
> Nonetheless, Ubuntu are still signing kernels

In the UEFI sense they are not - nor are Fedora. They are signing a tiny
boot loader and implementing their own policy behind that. It's basically
a way around the Windows 8 lock down.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:18:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:18:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJAp-0002F9-2T; Tue, 27 Nov 2012 11:17:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <alan@lxorguk.ukuu.org.uk>) id 1TdJAn-0002En-FU
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:17:53 +0000
Received: from [85.158.138.51:60439] by server-15.bemta-3.messagelabs.com id
	03/12-23779-061A4B05; Tue, 27 Nov 2012 11:17:52 +0000
X-Env-Sender: alan@lxorguk.ukuu.org.uk
X-Msg-Ref: server-5.tower-174.messagelabs.com!1354015068!31731767!1
X-Originating-IP: [81.2.110.251]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23557 invoked from network); 27 Nov 2012 11:17:48 -0000
Received: from lxorguk.ukuu.org.uk (HELO lxorguk.ukuu.org.uk) (81.2.110.251)
	by server-5.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 11:17:48 -0000
Received: from pyramind.ukuu.org.uk (earthlight.etchedpixels.co.uk
	[81.2.110.250])
	by lxorguk.ukuu.org.uk (8.14.5/8.14.1) with ESMTP id qARBnIV0031051;
	Tue, 27 Nov 2012 11:49:23 GMT
Received: from pyramind.ukuu.org.uk (localhost [127.0.0.1])
	by pyramind.ukuu.org.uk (8.14.5/8.14.5) with ESMTP id qARBN8JP026747;
	Tue, 27 Nov 2012 11:23:08 GMT
Date: Tue, 27 Nov 2012 11:23:08 +0000
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121127112308.09013725@pyramind.ukuu.org.uk>
In-Reply-To: <1354013779.5830.187.camel@zakaz.uk.xensource.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B3B215.3020000@citrix.com>
	<1354013779.5830.187.camel@zakaz.uk.xensource.com>
X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.8; x86_64-redhat-linux-gnu)
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEWysKsSBQMIAwIZCwj///8wIhxoRDXH9QHCAAABeUlEQVQ4jaXTvW7DIBAAYCQTzz2hdq+rdg494ZmBeE5KYHZjm/d/hJ6NfzBJpp5kRb5PHJwvMPMk2L9As5Y9AmYRBL+HAyJKeOU5aHRhsAAvORQ+UEgAvgddj/lwAXndw2laEDqA4x6KEBhjYRCg9tBFCOuJFxg2OKegbWjbsRTk8PPhKPD7HcRxB7cqhgBRp9Dcqs+B8v4CQvFdqeot3Kov6hBUn0AJitrzY+sgUuiA8i0r7+B3AfqKcN6t8M6HtqQ+AOoELCikgQSbgabKaJW3kn5lBs47JSGDhhLKDUh1UMipwwinMYPTBuIBjEclSaGZUk9hDlTb5sUTYN2SFFQuPe4Gox1X0FZOufjgBiV1Vls7b+GvK3SU4wfmcGo9rPPQzgIabfj4TYQo15k3bTHX9RIw/kniir5YbtJF4jkFG+dsDK1IgE413zAthU/vR2HVMmFUPIHTvF6jWCpFaGw/A3qWgnbxpSm9MSmY5b3pM1gvNc/gQfwBsGwF0VCtxZgAAAAASUVORK5CYII=
Mime-Version: 1.0
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <dunlapg@umich.edu>, "Keir \(Xen.org\)" <keir@xen.org>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> That probably involves some sort of black/whitelisting scheme for I/O
> ports and such which is pretty tedious but not overwhelming I don't
> think.

Until you start to think about indirect access via DMA or using one
device to set up an I/O window into another, or the ACPI EC or the GPU ...

its nigh on impossible. PC hardware isn't designed for restricted boot.

Alan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:18:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:18:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJAp-0002F9-2T; Tue, 27 Nov 2012 11:17:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <alan@lxorguk.ukuu.org.uk>) id 1TdJAn-0002En-FU
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:17:53 +0000
Received: from [85.158.138.51:60439] by server-15.bemta-3.messagelabs.com id
	03/12-23779-061A4B05; Tue, 27 Nov 2012 11:17:52 +0000
X-Env-Sender: alan@lxorguk.ukuu.org.uk
X-Msg-Ref: server-5.tower-174.messagelabs.com!1354015068!31731767!1
X-Originating-IP: [81.2.110.251]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23557 invoked from network); 27 Nov 2012 11:17:48 -0000
Received: from lxorguk.ukuu.org.uk (HELO lxorguk.ukuu.org.uk) (81.2.110.251)
	by server-5.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 11:17:48 -0000
Received: from pyramind.ukuu.org.uk (earthlight.etchedpixels.co.uk
	[81.2.110.250])
	by lxorguk.ukuu.org.uk (8.14.5/8.14.1) with ESMTP id qARBnIV0031051;
	Tue, 27 Nov 2012 11:49:23 GMT
Received: from pyramind.ukuu.org.uk (localhost [127.0.0.1])
	by pyramind.ukuu.org.uk (8.14.5/8.14.5) with ESMTP id qARBN8JP026747;
	Tue, 27 Nov 2012 11:23:08 GMT
Date: Tue, 27 Nov 2012 11:23:08 +0000
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121127112308.09013725@pyramind.ukuu.org.uk>
In-Reply-To: <1354013779.5830.187.camel@zakaz.uk.xensource.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B3B215.3020000@citrix.com>
	<1354013779.5830.187.camel@zakaz.uk.xensource.com>
X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.8; x86_64-redhat-linux-gnu)
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEWysKsSBQMIAwIZCwj///8wIhxoRDXH9QHCAAABeUlEQVQ4jaXTvW7DIBAAYCQTzz2hdq+rdg494ZmBeE5KYHZjm/d/hJ6NfzBJpp5kRb5PHJwvMPMk2L9As5Y9AmYRBL+HAyJKeOU5aHRhsAAvORQ+UEgAvgddj/lwAXndw2laEDqA4x6KEBhjYRCg9tBFCOuJFxg2OKegbWjbsRTk8PPhKPD7HcRxB7cqhgBRp9Dcqs+B8v4CQvFdqeot3Kov6hBUn0AJitrzY+sgUuiA8i0r7+B3AfqKcN6t8M6HtqQ+AOoELCikgQSbgabKaJW3kn5lBs47JSGDhhLKDUh1UMipwwinMYPTBuIBjEclSaGZUk9hDlTb5sUTYN2SFFQuPe4Gox1X0FZOufjgBiV1Vls7b+GvK3SU4wfmcGo9rPPQzgIabfj4TYQo15k3bTHX9RIw/kniir5YbtJF4jkFG+dsDK1IgE413zAthU/vR2HVMmFUPIHTvF6jWCpFaGw/A3qWgnbxpSm9MSmY5b3pM1gvNc/gQfwBsGwF0VCtxZgAAAAASUVORK5CYII=
Mime-Version: 1.0
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <dunlapg@umich.edu>, "Keir \(Xen.org\)" <keir@xen.org>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> That probably involves some sort of black/whitelisting scheme for I/O
> ports and such which is pretty tedious but not overwhelming I don't
> think.

Until you start to think about indirect access via DMA or using one
device to set up an I/O window into another, or the ACPI EC or the GPU ...

its nigh on impossible. PC hardware isn't designed for restricted boot.

Alan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:29:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:29:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJLo-0002oo-Ce; Tue, 27 Nov 2012 11:29:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdJLm-0002oi-My
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:29:14 +0000
Received: from [85.158.138.51:62896] by server-4.bemta-3.messagelabs.com id
	5B/7E-30023-904A4B05; Tue, 27 Nov 2012 11:29:13 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1354015746!23735692!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12813 invoked from network); 27 Nov 2012 11:29:07 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:29:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16021057"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:29:05 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 11:29:05 +0000
Message-ID: <1354015744.5830.199.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Date: Tue, 27 Nov 2012 11:29:04 +0000
In-Reply-To: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
References: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] docs: fix persistent grants doc typo
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVHVlLCAyMDEyLTExLTI3IGF0IDEwOjAzICswMDAwLCBSb2dlciBQYXUgTW9ubmUgd3JvdGU6
Cj4gU2lnbmVkLW9mZi1ieTogUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+
Cj4gLS0tCj4gIHhlbi9pbmNsdWRlL3B1YmxpYy9pby9ibGtpZi5oIHwgICAgMiArLQo+ICAxIGZp
bGVzIGNoYW5nZWQsIDEgaW5zZXJ0aW9ucygrKSwgMSBkZWxldGlvbnMoLSkKPiAKPiBkaWZmIC0t
Z2l0IGEveGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmggYi94ZW4vaW5jbHVkZS9wdWJsaWMv
aW8vYmxraWYuaAo+IGluZGV4IGFjY2RkYTQuLmRiOWMzNzkgMTAwNjQ0Cj4gLS0tIGEveGVuL2lu
Y2x1ZGUvcHVibGljL2lvL2Jsa2lmLmgKPiArKysgYi94ZW4vaW5jbHVkZS9wdWJsaWMvaW8vYmxr
aWYuaAo+IEBAIC0zMDcsNyArMzA3LDcgQEAKPiAgICogICAgIHRoZSBncmFudHMuCj4gICAqICg4
KSBUaGUgZnJvbnRlbmQgZHJpdmVyIGhhcyB0byBhbGxvdyB0aGUgYmFja2VuZCBkcml2ZXIgdG8g
bWFwIGFsbCBncmFudHMKPiAgICogICAgIHdpdGggd3JpdGUgYWNjZXNzLCBldmVuIHdoZW4gdGhl
eSBzaG91bGQgYmUgbWFwcGVkIHJlYWQtb25seSwgc2luY2UKPiAtICogICAgIGZ1cnRoZXIgcmVx
dWVzdHMgbWF5IHJldXNlIHRoaXMgZ3JhbnRzIGFuZCByZXF1aXJlIHdyaXRlIHBlcm1pc2lvbnMu
Cj4gKyAqICAgICBmdXJ0aGVyIHJlcXVlc3RzIG1heSByZXVzZSB0aGlzIGdyYW50cyBhbmQgcmVx
dWlyZSB3cml0ZSBwZXJtaXNzaW9ucy4KCiJ0aGVzZSBncmFudHMiIHByb2JhYmx5PyAoYWx0ZXJu
YXRpdmVseSAidGhpcyBncmFudCIgYnV0IEkgZG9uJ3QgIHRoaW5rCnRoYXQgaXMgd2hhdCBpcyBt
ZWFudCkuCgo+ICAgKi8KPiAgCj4gIC8qCgoKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxpc3Rz
Lnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:29:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:29:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJLo-0002oo-Ce; Tue, 27 Nov 2012 11:29:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdJLm-0002oi-My
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:29:14 +0000
Received: from [85.158.138.51:62896] by server-4.bemta-3.messagelabs.com id
	5B/7E-30023-904A4B05; Tue, 27 Nov 2012 11:29:13 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1354015746!23735692!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12813 invoked from network); 27 Nov 2012 11:29:07 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:29:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16021057"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:29:05 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 11:29:05 +0000
Message-ID: <1354015744.5830.199.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Date: Tue, 27 Nov 2012 11:29:04 +0000
In-Reply-To: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
References: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] docs: fix persistent grants doc typo
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVHVlLCAyMDEyLTExLTI3IGF0IDEwOjAzICswMDAwLCBSb2dlciBQYXUgTW9ubmUgd3JvdGU6
Cj4gU2lnbmVkLW9mZi1ieTogUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+
Cj4gLS0tCj4gIHhlbi9pbmNsdWRlL3B1YmxpYy9pby9ibGtpZi5oIHwgICAgMiArLQo+ICAxIGZp
bGVzIGNoYW5nZWQsIDEgaW5zZXJ0aW9ucygrKSwgMSBkZWxldGlvbnMoLSkKPiAKPiBkaWZmIC0t
Z2l0IGEveGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmggYi94ZW4vaW5jbHVkZS9wdWJsaWMv
aW8vYmxraWYuaAo+IGluZGV4IGFjY2RkYTQuLmRiOWMzNzkgMTAwNjQ0Cj4gLS0tIGEveGVuL2lu
Y2x1ZGUvcHVibGljL2lvL2Jsa2lmLmgKPiArKysgYi94ZW4vaW5jbHVkZS9wdWJsaWMvaW8vYmxr
aWYuaAo+IEBAIC0zMDcsNyArMzA3LDcgQEAKPiAgICogICAgIHRoZSBncmFudHMuCj4gICAqICg4
KSBUaGUgZnJvbnRlbmQgZHJpdmVyIGhhcyB0byBhbGxvdyB0aGUgYmFja2VuZCBkcml2ZXIgdG8g
bWFwIGFsbCBncmFudHMKPiAgICogICAgIHdpdGggd3JpdGUgYWNjZXNzLCBldmVuIHdoZW4gdGhl
eSBzaG91bGQgYmUgbWFwcGVkIHJlYWQtb25seSwgc2luY2UKPiAtICogICAgIGZ1cnRoZXIgcmVx
dWVzdHMgbWF5IHJldXNlIHRoaXMgZ3JhbnRzIGFuZCByZXF1aXJlIHdyaXRlIHBlcm1pc2lvbnMu
Cj4gKyAqICAgICBmdXJ0aGVyIHJlcXVlc3RzIG1heSByZXVzZSB0aGlzIGdyYW50cyBhbmQgcmVx
dWlyZSB3cml0ZSBwZXJtaXNzaW9ucy4KCiJ0aGVzZSBncmFudHMiIHByb2JhYmx5PyAoYWx0ZXJu
YXRpdmVseSAidGhpcyBncmFudCIgYnV0IEkgZG9uJ3QgIHRoaW5rCnRoYXQgaXMgd2hhdCBpcyBt
ZWFudCkuCgo+ICAgKi8KPiAgCj4gIC8qCgoKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxpc3Rz
Lnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:36:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:36:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJSK-00030z-8p; Tue, 27 Nov 2012 11:36:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdJSI-00030n-W6
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:35:59 +0000
Received: from [85.158.137.99:62159] by server-6.bemta-3.messagelabs.com id
	E4/0A-28265-E95A4B05; Tue, 27 Nov 2012 11:35:58 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354016139!20676894!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23477 invoked from network); 27 Nov 2012 11:35:40 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:35:40 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16021222"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:34:40 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 11:34:40 +0000
Message-ID: <1354016079.17985.8.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Tue, 27 Nov 2012 11:34:39 +0000
In-Reply-To: <20121126214212.GL7556@type.youpi.perso.aquilenet.fr>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
	<29138c27eb72e5602751.1353947050@andrewcoop.uk.xensource.com>
	<20121126214212.GL7556@type.youpi.perso.aquilenet.fr>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 4] minios/console: console_input() weak
 reference
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gTW9uLCAyMDEyLTExLTI2IGF0IDIxOjQyICswMDAwLCBTYW11ZWwgVGhpYmF1bHQgd3JvdGU6
Cj4gQW5kcmV3IENvb3BlciwgbGUgTW9uIDI2IE5vdiAyMDEyIDE2OjI0OjEwICswMDAwLCBhIMOp
Y3JpdCA6Cj4gPiBJbiBleGFjdGx5IHRoZSBzYW1lIHN0eWxlIGFzIGFwcF9tYWluKCkgaW4ga2Vy
bmVsLmMsIGNyZWF0ZSBhIHdlYWsKPiA+IHJlZmVyZW5jZSBjb25zb2xlX2lucHV0KCkgZnVuY3Rp
b24gZm9yIGFwcGxpY2F0aW9ucyB0byBvdmVycmlkZSB0bwo+ID4gcXVpY2tseSBnYWluIGFjY2Vz
cyB0byB0aGUgY29uc29sZS4KPiA+IAo+ID4gU2lnbmVkLW9mZi1ieTogQW5kcmV3IENvb3BlciA8
YW5kcmV3LmNvb3BlcjNAY2l0cml4LmNvbT4KPiAKPiBBY2tlZC1ieTogU2FtdWVsIFRoaWJhdWx0
IDxzYW11ZWwudGhpYmF1bHRAZW5zLWx5b24ub3JnPgoKQW55IHJlYXNvbiBub3QgdG8gbWFrZSB4
ZW5jb25zX3J4IGl0c2VsZiB0aGUgd2VhayBmdW5jdGlvbj8gQW5kIGJ5CmV4dGVuc2lvbiBJIHN1
cHBvc2UgeGVuY29uc190eCB0b28sIGZvciBwYXJpdHkgaWYgbm90aGluZyBlbHNlLgoKVGhlIGV4
aXN0aW5nIG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dHJ1Y3QgcHRfcmVncyAqcmVncykKPiA+ICt7Cj4gPiArICAgIGNvbnNvbGVfaW5wdXQoYnVm
LCBsZW4pOwo+ID4gK30KPiA+ICsKPiA+ICB2b2lkIHhlbmNvbnNfdHgodm9pZCkKPiA+ICB7Cj4g
PiAgICAgIC8qIERvIG5vdGhpbmcsIGhhbmRsZWQgYnkgX3J4ICovCj4gPiAKPiA+IF9fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCj4gPiBYZW4tZGV2ZWwgbWFp
bGluZyBsaXN0Cj4gPiBYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwo+ID4gaHR0cDovL2xpc3RzLnhl
bi5vcmcveGVuLWRldmVsCj4gPiAKPiAKPiBfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fXwo+IFhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKPiBYZW4tZGV2ZWxAbGlz
dHMueGVuLm9yZwo+IGh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZlbAoKCgpfX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwgbWFpbGluZyBs
aXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZl
bAo=

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:36:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:36:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJSK-00030z-8p; Tue, 27 Nov 2012 11:36:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdJSI-00030n-W6
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:35:59 +0000
Received: from [85.158.137.99:62159] by server-6.bemta-3.messagelabs.com id
	E4/0A-28265-E95A4B05; Tue, 27 Nov 2012 11:35:58 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354016139!20676894!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23477 invoked from network); 27 Nov 2012 11:35:40 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:35:40 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16021222"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:34:40 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 11:34:40 +0000
Message-ID: <1354016079.17985.8.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Tue, 27 Nov 2012 11:34:39 +0000
In-Reply-To: <20121126214212.GL7556@type.youpi.perso.aquilenet.fr>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
	<29138c27eb72e5602751.1353947050@andrewcoop.uk.xensource.com>
	<20121126214212.GL7556@type.youpi.perso.aquilenet.fr>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 4] minios/console: console_input() weak
 reference
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gTW9uLCAyMDEyLTExLTI2IGF0IDIxOjQyICswMDAwLCBTYW11ZWwgVGhpYmF1bHQgd3JvdGU6
Cj4gQW5kcmV3IENvb3BlciwgbGUgTW9uIDI2IE5vdiAyMDEyIDE2OjI0OjEwICswMDAwLCBhIMOp
Y3JpdCA6Cj4gPiBJbiBleGFjdGx5IHRoZSBzYW1lIHN0eWxlIGFzIGFwcF9tYWluKCkgaW4ga2Vy
bmVsLmMsIGNyZWF0ZSBhIHdlYWsKPiA+IHJlZmVyZW5jZSBjb25zb2xlX2lucHV0KCkgZnVuY3Rp
b24gZm9yIGFwcGxpY2F0aW9ucyB0byBvdmVycmlkZSB0bwo+ID4gcXVpY2tseSBnYWluIGFjY2Vz
cyB0byB0aGUgY29uc29sZS4KPiA+IAo+ID4gU2lnbmVkLW9mZi1ieTogQW5kcmV3IENvb3BlciA8
YW5kcmV3LmNvb3BlcjNAY2l0cml4LmNvbT4KPiAKPiBBY2tlZC1ieTogU2FtdWVsIFRoaWJhdW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PiAwKQo+ID4gICAgICB7Cj4gPiBAQCAtNjksNiArNjcsMTIgQEAgdm9pZCB4ZW5jb25zX3J4KGNo
YXIgKmJ1ZiwgdW5zaWduZWQgbGVuLAo+ID4gICAgICB9Cj4gPiAgfQo+ID4gIAo+ID4gKyNpZm5k
ZWYgSEFWRV9MSUJDCj4gPiArdm9pZCB4ZW5jb25zX3J4KGNoYXIgKmJ1ZiwgdW5zaWduZWQgbGVu
LCBzdHJ1Y3QgcHRfcmVncyAqcmVncykKPiA+ICt7Cj4gPiArICAgIGNvbnNvbGVfaW5wdXQoYnVm
LCBsZW4pOwo+ID4gK30KPiA+ICsKPiA+ICB2b2lkIHhlbmNvbnNfdHgodm9pZCkKPiA+ICB7Cj4g
PiAgICAgIC8qIERvIG5vdGhpbmcsIGhhbmRsZWQgYnkgX3J4ICovCj4gPiAKPiA+IF9fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCj4gPiBYZW4tZGV2ZWwgbWFp
bGluZyBsaXN0Cj4gPiBYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwo+ID4gaHR0cDovL2xpc3RzLnhl
bi5vcmcveGVuLWRldmVsCj4gPiAKPiAKPiBfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fXwo+IFhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKPiBYZW4tZGV2ZWxAbGlz
dHMueGVuLm9yZwo+IGh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZlbAoKCgpfX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwgbWFpbGluZyBs
aXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZl
bAo=

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:36:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:36:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJT4-000343-0g; Tue, 27 Nov 2012 11:36:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdJT2-00033t-F2
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:36:44 +0000
Received: from [85.158.137.99:49821] by server-7.bemta-3.messagelabs.com id
	42/77-01713-9C5A4B05; Tue, 27 Nov 2012 11:36:41 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1354016199!20794585!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2130 invoked from network); 27 Nov 2012 11:36:39 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 11:36:39 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 11:36:38 +0000
Message-Id: <50B4B40B02000078000ABA19@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 11:37:31 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartC2F32BEB.0__="
Subject: [Xen-devel] [PATCH] vscsiif: allow larger segments-per-request
	values
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartC2F32BEB.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

At least certain tape devices require fixed size blocks to be operated
upon, i.e. breaking up of I/O requests is not permitted. Consequently
we need an interface extension that (leaving aside implementation
limitations) doesn't impose a limit on the number of segments that can
be associated with an individual request.

This, in turn, excludes the blkif extension FreeBSD folks implemented,
as that still imposes an upper limit (the actual I/O request still
specifies the full number of segments - as an 8-bit quantity -, and
subsequent ring slots get used to carry the excess segment
descriptors).

The alternative therefore is to allow the frontend to pre-set segment
descriptors _before_ actually issuing the I/O request. I/O will then
be done by the backend for the accumulated set of segments.

To properly associate segment preset operations with the main request,
the rqid-s between them should match (originally I had hoped to use
this to avoid producing individual responses for the pre-set
operations, but that turned out to violate the underlying shared ring
implementation).

Negotiation of the maximum number of segments a particular backend
implementation supports happens through a new "segs-per-req" xenstore
node.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
As I have no plans to backport this to the 2.6.18 tree, I'm attaching
for reference the full kernel side patch we're intending to use.

--- a/xen/include/public/io/vscsiif.h
+++ b/xen/include/public/io/vscsiif.h
@@ -34,6 +34,7 @@
 #define VSCSIIF_ACT_SCSI_CDB         1    /* SCSI CDB command */
 #define VSCSIIF_ACT_SCSI_ABORT       2    /* SCSI Device(Lun) Abort*/
 #define VSCSIIF_ACT_SCSI_RESET       3    /* SCSI Device(Lun) Reset*/
+#define VSCSIIF_ACT_SCSI_SG_PRESET   4    /* Preset SG elements */
=20
 /*
  * Maximum scatter/gather segments per request.
@@ -50,6 +51,12 @@
 #define VSCSIIF_MAX_COMMAND_SIZE         16
 #define VSCSIIF_SENSE_BUFFERSIZE         96
=20
+struct scsiif_request_segment {
+    grant_ref_t gref;
+    uint16_t offset;
+    uint16_t length;
+};
+typedef struct scsiif_request_segment vscsiif_segment_t;
=20
 struct vscsiif_request {
     uint16_t rqid;          /* private guest value, echoed in resp  */
@@ -66,18 +73,26 @@ struct vscsiif_request {
                                          DMA_NONE(3) requests  */
     uint8_t nr_segments;              /* Number of pieces of scatter-gathe=
r */
=20
-    struct scsiif_request_segment {
-        grant_ref_t gref;
-        uint16_t offset;
-        uint16_t length;
-    } seg[VSCSIIF_SG_TABLESIZE];
+    vscsiif_segment_t seg[VSCSIIF_SG_TABLESIZE];
     uint32_t reserved[3];
 };
 typedef struct vscsiif_request vscsiif_request_t;
=20
+#define VSCSIIF_SG_LIST_SIZE ((sizeof(vscsiif_request_t) - 4) \
+                              / sizeof(vscsiif_segment_t))
+
+struct vscsiif_sg_list {
+    /* First two fields must match struct vscsiif_request! */
+    uint16_t rqid;          /* private guest value, must match main req =
*/
+    uint8_t act;            /* VSCSIIF_ACT_SCSI_SG_PRESET */
+    uint8_t nr_segments;    /* Number of pieces of scatter-gather */
+    vscsiif_segment_t seg[VSCSIIF_SG_LIST_SIZE];
+};
+typedef struct vscsiif_sg_list vscsiif_sg_list_t;
+
 struct vscsiif_response {
     uint16_t rqid;
-    uint8_t padding;
+    uint8_t act;               /* valid only when backend supports =
SG_PRESET */
     uint8_t sense_len;
     uint8_t sense_buffer[VSCSIIF_SENSE_BUFFERSIZE];
     int32_t rslt;




--=__PartC2F32BEB.0__=
Content-Type: text/plain; name="xen-vscsiif-large-requests.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-vscsiif-large-requests.patch"

vscsiif: allow larger segments-per-request values=0A=0AAt least certain =
tape devices require fixed size blocks to be operated=0Aupon, i.e. =
breaking up of I/O requests is not permitted. Consequently=0Awe need an =
interface extension that (leaving aside implementation=0Alimitations) =
doesn't impose a limit on the number of segments that can=0Abe associated =
with an individual request.=0A=0AThis, in turn, excludes the blkif =
extension FreeBSD folks implemented,=0Aas that still imposes an upper =
limit (the actual I/O request still=0Aspecifies the full number of =
segments - as an 8-bit quantity -, and=0Asubsequent ring slots get used to =
carry the excess segment=0Adescriptors).=0A=0AThe alternative therefore is =
to allow the frontend to pre-set segment=0Adescriptors _before_ actually =
issuing the I/O request. I/O will then=0Abe done by the backend for the =
accumulated set of segments.=0A=0ATo properly associate segment preset =
operations with the main request,=0Athe rqid-s between them should match =
(originally I had hoped to use=0Athis to avoid producing individual =
responses for the pre-set=0Aoperations, but that turned out to violate the =
underlying shared ring=0Aimplementation).=0A=0ANegotiation of the maximum =
number of segments a particular backend=0Aimplementation supports happens =
through a new "segs-per-req" xenstore=0Anode.=0A=0ASigned-off-by: Jan =
Beulich <jbeulich@suse.com>=0A---=0AAs I have no plans to backport this to =
the 2.6.18 tree, I'm attaching=0Afor reference the full kernel side patch =
we're intending to use.=0A=0A--- a/xen/include/public/io/vscsiif.h=0A+++ =
b/xen/include/public/io/vscsiif.h=0A@@ -34,6 +34,7 @@=0A #define VSCSIIF_AC=
T_SCSI_CDB         1    /* SCSI CDB command */=0A #define VSCSIIF_ACT_SCSI_=
ABORT       2    /* SCSI Device(Lun) Abort*/=0A #define VSCSIIF_ACT_SCSI_RE=
SET       3    /* SCSI Device(Lun) Reset*/=0A+#define VSCSIIF_ACT_SCSI_SG_P=
RESET   4    /* Preset SG elements */=0A =0A /*=0A  * Maximum scatter/gathe=
r segments per request.=0A@@ -50,6 +51,12 @@=0A #define VSCSIIF_MAX_COMMAND=
_SIZE         16=0A #define VSCSIIF_SENSE_BUFFERSIZE         96=0A =
=0A+struct scsiif_request_segment {=0A+    grant_ref_t gref;=0A+    =
uint16_t offset;=0A+    uint16_t length;=0A+};=0A+typedef struct scsiif_req=
uest_segment vscsiif_segment_t;=0A =0A struct vscsiif_request {=0A     =
uint16_t rqid;          /* private guest value, echoed in resp  */=0A@@ =
-66,18 +73,26 @@ struct vscsiif_request {=0A                               =
           DMA_NONE(3) requests  */=0A     uint8_t nr_segments;            =
  /* Number of pieces of scatter-gather */=0A =0A-    struct scsiif_request=
_segment {=0A-        grant_ref_t gref;=0A-        uint16_t offset;=0A-    =
    uint16_t length;=0A-    } seg[VSCSIIF_SG_TABLESIZE];=0A+    vscsiif_seg=
ment_t seg[VSCSIIF_SG_TABLESIZE];=0A     uint32_t reserved[3];=0A };=0A =
typedef struct vscsiif_request vscsiif_request_t;=0A =0A+#define VSCSIIF_SG=
_LIST_SIZE ((sizeof(vscsiif_request_t) - 4) \=0A+                          =
    / sizeof(vscsiif_segment_t))=0A+=0A+struct vscsiif_sg_list {=0A+    /* =
First two fields must match struct vscsiif_request! */=0A+    uint16_t =
rqid;          /* private guest value, must match main req */=0A+    =
uint8_t act;            /* VSCSIIF_ACT_SCSI_SG_PRESET */=0A+    uint8_t =
nr_segments;    /* Number of pieces of scatter-gather */=0A+    vscsiif_seg=
ment_t seg[VSCSIIF_SG_LIST_SIZE];=0A+};=0A+typedef struct vscsiif_sg_list =
vscsiif_sg_list_t;=0A+=0A struct vscsiif_response {=0A     uint16_t =
rqid;=0A-    uint8_t padding;=0A+    uint8_t act;               /* valid =
only when backend supports SG_PRESET */=0A     uint8_t sense_len;=0A     =
uint8_t sense_buffer[VSCSIIF_SENSE_BUFFERSIZE];=0A     int32_t rslt;=0A
--=__PartC2F32BEB.0__=
Content-Type: text/plain; name="vscsi-large-requests.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="vscsi-large-requests.patch"

--- sle11sp3.orig/drivers/xen/scsiback/common.h	2012-06-06 13:53:26.0000000=
00 +0200=0A+++ sle11sp3/drivers/xen/scsiback/common.h	2012-11-22 =
14:55:58.000000000 +0100=0A@@ -94,10 +94,15 @@ struct vscsibk_info {=0A 	=
unsigned int waiting_reqs;=0A 	struct page **mmap_pages;=0A =0A+	=
struct pending_req *preq;=0A+=0A+	union {=0A+		struct =
gnttab_map_grant_ref   *gmap;=0A+		struct gnttab_unmap_grant_r=
ef *gunmap;=0A+	};=0A };=0A =0A-typedef struct {=0A-	unsigned char =
act;=0A+typedef struct pending_req {=0A 	struct vscsibk_info =
*info;=0A 	struct scsi_device *sdev;=0A =0A@@ -114,7 +119,8 @@ =
typedef struct {=0A 	=0A 	uint32_t request_bufflen;=0A 	struct =
scatterlist *sgl;=0A-	grant_ref_t gref[VSCSIIF_SG_TABLESIZE];=0A+	=
grant_ref_t *gref;=0A+	vscsiif_segment_t *segs;=0A =0A 	int32_t =
rslt;=0A 	uint32_t resid;=0A@@ -123,7 +129,7 @@ typedef struct {=0A 	=
struct list_head free_list;=0A } pending_req_t;=0A =0A-=0A+extern unsigned =
int vscsiif_segs;=0A =0A #define scsiback_get(_b) (atomic_inc(&(_b)->nr_unr=
eplied_reqs))=0A #define scsiback_put(_b)				=
\=0A@@ -163,7 +169,7 @@ void scsiback_release_translation_entry(=0A =0A =
void scsiback_cmd_exec(pending_req_t *pending_req);=0A void scsiback_do_res=
p_with_sense(char *sense_buffer, int32_t result,=0A-			=
uint32_t resid, pending_req_t *pending_req);=0A+			=
uint32_t resid, pending_req_t *, uint8_t act);=0A void scsiback_fast_flush_=
area(pending_req_t *req);=0A =0A void scsiback_rsp_emulation(pending_req_t =
*pending_req);=0A--- sle11sp3.orig/drivers/xen/scsiback/emulate.c	=
2012-01-11 12:14:54.000000000 +0100=0A+++ sle11sp3/drivers/xen/scsiback/emu=
late.c	2012-11-22 14:29:27.000000000 +0100=0A@@ -352,7 +352,9 @@ void =
scsiback_req_emulation_or_cmdexec(p=0A 	else {=0A 		scsiback_fa=
st_flush_area(pending_req);=0A 		scsiback_do_resp_with_sense(pending=
_req->sense_buffer,=0A-		  pending_req->rslt, pending_req->resid, =
pending_req);=0A+					    pending_req->rs=
lt,=0A+					    pending_req->resid, pending_req=
,=0A+					    VSCSIIF_ACT_SCSI_CDB);=0A 	=
}=0A }=0A =0A--- sle11sp3.orig/drivers/xen/scsiback/interface.c	2011-10-10 =
11:58:37.000000000 +0200=0A+++ sle11sp3/drivers/xen/scsiback/interface.c	=
2012-11-13 13:21:10.000000000 +0100=0A@@ -51,6 +51,13 @@ struct vscsibk_inf=
o *vscsibk_info_alloc(=0A 	if (!info)=0A 		return ERR_PTR(-ENO=
MEM);=0A =0A+	info->gmap =3D kcalloc(max(sizeof(*info->gmap), sizeof(*inf=
o->gunmap)),=0A+			     vscsiif_segs, GFP_KERNEL);=0A+=
	if (!info->gmap) {=0A+		kfree(info);=0A+		=
return ERR_PTR(-ENOMEM);=0A+	}=0A+=0A 	info->domid =3D domid;=0A 	=
spin_lock_init(&info->ring_lock);=0A 	atomic_set(&info->nr_unreplied_reqs=
, 0);=0A@@ -120,6 +127,7 @@ void scsiback_disconnect(struct vscsibk_=0A =
=0A void scsiback_free(struct vscsibk_info *info)=0A {=0A+	kfree(info-=
>gmap);=0A 	kmem_cache_free(scsiback_cachep, info);=0A }=0A =0A--- =
sle11sp3.orig/drivers/xen/scsiback/scsiback.c	2012-11-22 15:36:11.0000000=
00 +0100=0A+++ sle11sp3/drivers/xen/scsiback/scsiback.c	2012-11-22 =
15:36:16.000000000 +0100=0A@@ -56,6 +56,10 @@ int vscsiif_reqs =3D =
VSCSIIF_BACK_MAX_PEND=0A module_param_named(reqs, vscsiif_reqs, int, =
0);=0A MODULE_PARM_DESC(reqs, "Number of scsiback requests to allocate");=
=0A =0A+unsigned int vscsiif_segs =3D VSCSIIF_SG_TABLESIZE;=0A+module_param=
_named(segs, vscsiif_segs, uint, 0);=0A+MODULE_PARM_DESC(segs, "Number of =
segments to allow per request");=0A+=0A static unsigned int log_print_stat =
=3D 0;=0A module_param(log_print_stat, int, 0644);=0A =0A@@ -67,7 +71,7 @@ =
static grant_handle_t *pending_grant_han=0A =0A static int vaddr_pagenr(pen=
ding_req_t *req, int seg)=0A {=0A-	return (req - pending_reqs) * =
VSCSIIF_SG_TABLESIZE + seg;=0A+	return (req - pending_reqs) * vscsiif_segs =
+ seg;=0A }=0A =0A static unsigned long vaddr(pending_req_t *req, int =
seg)=0A@@ -82,7 +86,7 @@ static unsigned long vaddr(pending_req_t=0A =0A =
void scsiback_fast_flush_area(pending_req_t *req)=0A {=0A-	struct =
gnttab_unmap_grant_ref unmap[VSCSIIF_SG_TABLESIZE];=0A+	struct gnttab_unmap=
_grant_ref *unmap =3D req->info->gunmap;=0A 	unsigned int i, invcount =
=3D 0;=0A 	grant_handle_t handle;=0A 	int err;=0A@@ -117,6 =
+121,7 @@ static pending_req_t * alloc_req(struct =0A 	if (!list_empty(&pe=
nding_free)) {=0A 		req =3D list_entry(pending_free.next, =
pending_req_t, free_list);=0A 		list_del(&req->free_list);=0A+		=
req->nr_segments =3D 0;=0A 	}=0A 	spin_unlock_irqrestore(&pending_fre=
e_lock, flags);=0A 	return req;=0A@@ -144,7 +149,8 @@ static void =
scsiback_notify_work(struct =0A }=0A =0A void scsiback_do_resp_with_sense(c=
har *sense_buffer, int32_t result,=0A-			uint32_t resid, =
pending_req_t *pending_req)=0A+				 uint32_t resid, =
pending_req_t *pending_req,=0A+				 uint8_t act)=0A =
{=0A 	vscsiif_response_t *ring_res;=0A 	struct vscsibk_info *info =
=3D pending_req->info;=0A@@ -159,6 +165,7 @@ void scsiback_do_resp_with_sen=
se(char *s=0A 	ring_res =3D RING_GET_RESPONSE(&info->ring, info->ring.rsp_=
prod_pvt);=0A 	info->ring.rsp_prod_pvt++;=0A =0A+	ring_res->act    =
=3D act;=0A 	ring_res->rslt   =3D result;=0A 	ring_res->rqid   =
=3D pending_req->rqid;=0A =0A@@ -186,7 +193,8 @@ void scsiback_do_resp_with=
_sense(char *s=0A 	if (notify)=0A 		notify_remote_via_irq(info-=
>irq);=0A =0A-	free_req(pending_req);=0A+	if (act !=3D VSCSIIF_ACT_SC=
SI_SG_PRESET)=0A+		free_req(pending_req);=0A }=0A =0A static =
void scsiback_print_status(char *sense_buffer, int errors,=0A@@ -225,25 =
+233,25 @@ static void scsiback_cmd_done(struct req=0A 		scsiback_rs=
p_emulation(pending_req);=0A =0A 	scsiback_fast_flush_area(pending_re=
q);=0A-	scsiback_do_resp_with_sense(sense_buffer, errors, resid, pending_re=
q);=0A+	scsiback_do_resp_with_sense(sense_buffer, errors, resid, pending_re=
q,=0A+				    VSCSIIF_ACT_SCSI_CDB);=0A 	scsiback_pu=
t(pending_req->info);=0A =0A 	__blk_put_request(req->q, req);=0A }=0A =
=0A =0A-static int scsiback_gnttab_data_map(vscsiif_request_t *ring_req,=0A=
-					pending_req_t *pending_req)=0A+stat=
ic int scsiback_gnttab_data_map(const vscsiif_segment_t *segs,=0A+		=
		    unsigned int nr_segs,=0A+				   =
 pending_req_t *pending_req)=0A {=0A 	u32 flags;=0A-	int write;=0A-	=
int i, err =3D 0;=0A-	unsigned int data_len =3D 0;=0A-	struct =
gnttab_map_grant_ref map[VSCSIIF_SG_TABLESIZE];=0A+	int write, err =3D =
0;=0A+	unsigned int i, j, data_len =3D 0;=0A 	struct vscsibk_info *info  =
 =3D pending_req->info;=0A-=0A+	struct gnttab_map_grant_ref *map =3D =
info->gmap;=0A 	int data_dir =3D (int)pending_req->sc_data_direction;=0A-	=
unsigned int nr_segments =3D (unsigned int)pending_req->nr_segments;=0A+	=
unsigned int nr_segments =3D pending_req->nr_segments + nr_segs;=0A =0A 	=
write =3D (data_dir =3D=3D DMA_TO_DEVICE);=0A =0A@@ -264,14 +272,20 @@ =
static int scsiback_gnttab_data_map(vscs=0A 		if (write)=0A 		=
	flags |=3D GNTMAP_readonly;=0A =0A-		for (i =3D 0; i < =
nr_segments; i++)=0A+		for (i =3D 0; i < pending_req->nr_segments;=
 i++)=0A 			gnttab_set_map_op(&map[i], vaddr(pending_re=
q, i), flags,=0A-						ring_req->s=
eg[i].gref,=0A+						pending_req->segs[i=
].gref,=0A+						info->domid);=0A+	=
	for (j =3D 0; i < nr_segments; i++, j++)=0A+			=
gnttab_set_map_op(&map[i], vaddr(pending_req, i), flags,=0A+			=
			segs[j].gref,=0A 					=
	info->domid);=0A =0A+=0A 		err =3D HYPERVISOR_grant_ta=
ble_op(GNTTABOP_map_grant_ref, map, nr_segments);=0A 		BUG_ON(err)=
;=0A =0A+		j =3D 0;=0A 		for_each_sg (pending_req->s=
gl, sg, nr_segments, i) {=0A 			struct page *pg;=0A =0A@@ =
-294,8 +308,15 @@ static int scsiback_gnttab_data_map(vscs=0A 			=
set_phys_to_machine(page_to_pfn(pg),=0A 				=
FOREIGN_FRAME(map[i].dev_bus_addr >> PAGE_SHIFT));=0A =0A-			=
sg_set_page(sg, pg, ring_req->seg[i].length,=0A-				=
    ring_req->seg[i].offset);=0A+			if (i < pending_req=
->nr_segments)=0A+				sg_set_page(sg, pg,=0A+		=
			    pending_req->segs[i].length,=0A+			=
		    pending_req->segs[i].offset);=0A+			=
else {=0A+				sg_set_page(sg, pg, segs[j].length,=
=0A+					    segs[j].offset);=0A+		=
		++j;=0A+			}=0A 			=
data_len +=3D sg->length;=0A =0A 			barrier();=0A@@ =
-306,6 +327,8 @@ static int scsiback_gnttab_data_map(vscs=0A =0A 		=
}=0A =0A+		pending_req->nr_segments =3D nr_segments;=0A+=0A 	=
	if (err)=0A 			goto fail_flush;=0A 	}=0A@@ =
-471,7 +494,8 @@ static void scsiback_device_reset_exec(p=0A 	scsiback_ge=
t(info);=0A 	err =3D scsi_reset_provider(sdev, SCSI_TRY_RESET_DEVICE);=
=0A =0A-	scsiback_do_resp_with_sense(NULL, err, 0, pending_req);=0A+=
	scsiback_do_resp_with_sense(NULL, err, 0, pending_req,=0A+		=
		    VSCSIIF_ACT_SCSI_RESET);=0A 	scsiback_put(info);=
=0A =0A 	return;=0A@@ -489,13 +513,11 @@ static int prepare_pending_=
reqs(struct v=0A {=0A 	struct scsi_device *sdev;=0A 	struct ids_tuple =
vir;=0A+	unsigned int nr_segs;=0A 	int err =3D -EINVAL;=0A =
=0A 	DPRINTK("%s\n",__FUNCTION__);=0A =0A-	pending_req->rqid       =
=3D ring_req->rqid;=0A-	pending_req->act        =3D ring_req->act;=0A-=0A 	=
pending_req->info       =3D info;=0A =0A 	pending_req->v_chn =3D =
vir.chn =3D ring_req->channel;=0A@@ -525,11 +547,10 @@ static int =
prepare_pending_reqs(struct v=0A 		goto invalid_value;=0A 	=
}=0A =0A-	pending_req->nr_segments =3D ring_req->nr_segments;=0A+	=
nr_segs =3D ring_req->nr_segments;=0A 	barrier();=0A-	if (pending_req->nr=
_segments > VSCSIIF_SG_TABLESIZE) {=0A-		DPRINTK("scsiback: invalid =
parameter nr_seg =3D %d\n",=0A-			pending_req->nr_segments);=
=0A+	if (pending_req->nr_segments + nr_segs > vscsiif_segs) {=0A+		=
DPRINTK("scsiback: invalid nr_segs =3D %u\n", nr_segs);=0A 		=
err =3D -EINVAL;=0A 		goto invalid_value;=0A 	}=0A@@ -546,7 =
+567,7 @@ static int prepare_pending_reqs(struct v=0A 	=0A 	pending_req=
->timeout_per_command =3D ring_req->timeout_per_command;=0A =0A-	=
if(scsiback_gnttab_data_map(ring_req, pending_req)) {=0A+	if =
(scsiback_gnttab_data_map(ring_req->seg, nr_segs, pending_req)) {=0A 		=
DPRINTK("scsiback: invalid buffer\n");=0A 		err =3D -EINVAL;=0A=
 		goto invalid_value;=0A@@ -558,6 +579,20 @@ invalid_value:=
=0A 	return err;=0A }=0A =0A+static void latch_segments(pending_req_t =
*pending_req,=0A+			   const struct vscsiif_sg_list =
*sgl)=0A+{=0A+	unsigned int nr_segs =3D sgl->nr_segments;=0A+=0A+	=
barrier();=0A+	if (pending_req->nr_segments + nr_segs <=3D vscsiif_segs) =
{=0A+		memcpy(pending_req->segs + pending_req->nr_segments,=0A+	=
	       sgl->seg, nr_segs * sizeof(*sgl->seg));=0A+		=
pending_req->nr_segments +=3D nr_segs;=0A+	}=0A+	else=0A+		=
DPRINTK("scsiback: invalid nr_segs =3D %u\n", nr_segs);=0A+}=0A =0A static =
int _scsiback_do_cmd_fn(struct vscsibk_info *info)=0A {=0A@@ -575,9 =
+610,11 @@ static int _scsiback_do_cmd_fn(struct vs=0A 	rmb();=0A =0A 	=
while ((rc !=3D rp)) {=0A+		int act, rqid;=0A+=0A 		if =
(RING_REQUEST_CONS_OVERFLOW(ring, rc))=0A 			break;=0A-	=
	pending_req =3D alloc_req(info);=0A+		pending_req =3D =
info->preq ?: alloc_req(info);=0A 		if (NULL =3D=3D pending_req=
) {=0A 			more_to_do =3D 1;=0A 			break;=0A@@=
 -586,32 +623,55 @@ static int _scsiback_do_cmd_fn(struct vs=0A 		=
ring_req =3D RING_GET_REQUEST(ring, rc);=0A 		ring->req_cons =3D =
++rc;=0A =0A+		act =3D ring_req->act;=0A+		rqid =3D =
ring_req->rqid;=0A+		barrier();=0A+		if (!pending_req->n=
r_segments)=0A+			pending_req->rqid =3D rqid;=0A+		=
else if (pending_req->rqid !=3D rqid)=0A+			DPRINTK("sc=
siback: invalid rqid %04x, expected %04x\n",=0A+				=
rqid, pending_req->rqid);=0A+=0A+		info->preq =3D NULL;=0A+	=
	if (pending_req->rqid !=3D rqid) {=0A+			scsiback_do=
_resp_with_sense(NULL, DRIVER_INVALID << 24,=0A+				=
		    0, pending_req, act);=0A+			=
continue;=0A+		}=0A+=0A+		if (act =3D=3D VSCSIIF_ACT_=
SCSI_SG_PRESET) {=0A+			latch_segments(pending_req, (void =
*)ring_req);=0A+			info->preq =3D pending_req;=0A+		=
	scsiback_do_resp_with_sense(NULL, 0, 0,=0A+				=
		    pending_req, act);=0A+			=
continue;=0A+		}=0A+=0A 		err =3D prepare_pending_req=
s(info, ring_req,=0A 						pending_req=
);=0A 		if (err =3D=3D -EINVAL) {=0A 			scsiback_do=
_resp_with_sense(NULL, (DRIVER_ERROR << 24),=0A-				=
0, pending_req);=0A+						    0, =
pending_req, act);=0A 			continue;=0A 		} else if =
(err =3D=3D -ENODEV) {=0A 			scsiback_do_resp_with_sense=
(NULL, (DID_NO_CONNECT << 16),=0A-				0, =
pending_req);=0A+						    0, =
pending_req, act);=0A 			continue;=0A 		}=0A =0A-	=
	if (pending_req->act =3D=3D VSCSIIF_ACT_SCSI_CDB) {=0A-=0A+		=
if (act =3D=3D VSCSIIF_ACT_SCSI_CDB) {=0A 			/* The =
Host mode is through as for Emulation. */=0A 			if =
(info->feature =3D=3D VSCSI_TYPE_HOST)=0A 				=
scsiback_cmd_exec(pending_req);=0A 			else=0A 		=
		scsiback_req_emulation_or_cmdexec(pending_req);=0A =0A-		=
} else if (pending_req->act =3D=3D VSCSIIF_ACT_SCSI_RESET) {=0A+		=
} else if (act =3D=3D VSCSIIF_ACT_SCSI_RESET) {=0A 			=
scsiback_device_reset_exec(pending_req);=0A 		} else {=0A 		=
	pr_err("scsiback: invalid parameter for request\n");=0A 		=
	scsiback_do_resp_with_sense(NULL, (DRIVER_ERROR << 24),=0A-		=
		0, pending_req);=0A+						=
    0, pending_req, act);=0A 			continue;=0A 		=
}=0A 	}=0A@@ -673,17 +733,32 @@ static int __init scsiback_init(void)=0A =
	if (!is_running_on_xen())=0A 		return -ENODEV;=0A =0A-	=
mmap_pages =3D vscsiif_reqs * VSCSIIF_SG_TABLESIZE;=0A+	if (vscsiif_segs < =
VSCSIIF_SG_TABLESIZE)=0A+		vscsiif_segs =3D VSCSIIF_SG_TABLESI=
ZE;=0A+	if (vscsiif_segs !=3D (uint8_t)vscsiif_segs)=0A+		=
return -EINVAL;=0A+	mmap_pages =3D vscsiif_reqs * vscsiif_segs;=0A =0A =
	pending_reqs          =3D kzalloc(sizeof(pending_reqs[0]) *=0A 		=
			vscsiif_reqs, GFP_KERNEL);=0A+	if (!pending_reqs)=
=0A+		return -ENOMEM;=0A 	pending_grant_handles =3D =
kmalloc(sizeof(pending_grant_handles[0]) *=0A 					=
mmap_pages, GFP_KERNEL);=0A 	pending_pages         =3D alloc_empty_pages=
_and_pagevec(mmap_pages);=0A =0A-	if (!pending_reqs || !pending_grant=
_handles || !pending_pages)=0A+	if (!pending_grant_handles || !pending_page=
s)=0A 		goto out_of_memory;=0A =0A+	for (i =3D 0; i < =
vscsiif_reqs; ++i) {=0A+		pending_reqs[i].gref =3D kcalloc(si=
zeof(*pending_reqs->gref),=0A+					       =
vscsiif_segs, GFP_KERNEL);=0A+		pending_reqs[i].segs =3D kcalloc(si=
zeof(*pending_reqs->segs),=0A+					       =
vscsiif_segs, GFP_KERNEL);=0A+		if (!pending_reqs[i].gref || =
!pending_reqs[i].segs)=0A+			goto out_of_memory;=0A+	=
}=0A+=0A 	for (i =3D 0; i < mmap_pages; i++)=0A 		pending_gra=
nt_handles[i] =3D SCSIBACK_INVALID_HANDLE;=0A =0A@@ -705,6 +780,10 @@ =
static int __init scsiback_init(void)=0A out_interface:=0A 	scsiback_in=
terface_exit();=0A out_of_memory:=0A+	for (i =3D 0; i < vscsiif_reqs; =
++i) {=0A+		kfree(pending_reqs[i].gref);=0A+		=
kfree(pending_reqs[i].segs);=0A+	}=0A 	kfree(pending_reqs);=0A 	=
kfree(pending_grant_handles);=0A 	free_empty_pages_and_pagevec(pendin=
g_pages, mmap_pages);=0A@@ -715,12 +794,17 @@ out_of_memory:=0A #if 0=0A =
static void __exit scsiback_exit(void)=0A {=0A+	unsigned int i;=0A+=0A 	=
scsiback_xenbus_unregister();=0A 	scsiback_interface_exit();=0A+	=
for (i =3D 0; i < vscsiif_reqs; ++i) {=0A+		kfree(pending_reqs[=
i].gref);=0A+		kfree(pending_reqs[i].segs);=0A+	}=0A 	=
kfree(pending_reqs);=0A 	kfree(pending_grant_handles);=0A-	=
free_empty_pages_and_pagevec(pending_pages, (vscsiif_reqs * VSCSIIF_SG_TABL=
ESIZE));=0A-=0A+	free_empty_pages_and_pagevec(pending_pages, =
vscsiif_reqs * vscsiif_segs);=0A }=0A #endif=0A =0A--- sle11sp3.orig/driver=
s/xen/scsiback/xenbus.c	2011-06-30 17:04:59.000000000 +0200=0A+++ =
sle11sp3/drivers/xen/scsiback/xenbus.c	2012-11-13 14:36:16.000000000 =
+0100=0A@@ -339,6 +339,13 @@ static int scsiback_probe(struct xenbus_=0A 	=
if (val)=0A 		be->info->feature =3D VSCSI_TYPE_HOST;=0A =0A+	if =
(vscsiif_segs > VSCSIIF_SG_TABLESIZE) {=0A+		err =3D xenbus_prin=
tf(XBT_NIL, dev->nodename, "segs-per-req",=0A+				   =
 "%u", vscsiif_segs);=0A+		if (err)=0A+			=
xenbus_dev_error(dev, err, "writing segs-per-req");=0A+	}=0A+=0A 	=
err =3D xenbus_switch_state(dev, XenbusStateInitWait);=0A 	if =
(err)=0A 		goto fail;=0A--- sle11sp3.orig/drivers/xen/scsifron=
t/common.h	2011-01-31 17:29:16.000000000 +0100=0A+++ sle11sp3/drivers/=
xen/scsifront/common.h	2012-11-22 13:45:50.000000000 +0100=0A@@ -95,7 =
+95,7 @@ struct vscsifrnt_shadow {=0A =0A 	/* requested struct =
scsi_cmnd is stored from kernel */=0A 	unsigned long req_scsi_cmnd;=0A-	=
int gref[VSCSIIF_SG_TABLESIZE];=0A+	int gref[SG_ALL];=0A };=0A =0A =
struct vscsifrnt_info {=0A@@ -110,7 +110,6 @@ struct vscsifrnt_info {=0A =
=0A 	grant_ref_t ring_ref;=0A 	struct vscsiif_front_ring =
ring;=0A-	struct vscsiif_response	ring_res;=0A =0A 	struct =
vscsifrnt_shadow shadow[VSCSIIF_MAX_REQS];=0A 	uint32_t shadow_free;=0A@@ =
-119,6 +118,12 @@ struct vscsifrnt_info {=0A 	wait_queue_head_t wq;=0A 	=
unsigned int waiting_resp;=0A =0A+	struct {=0A+		struct =
scsi_cmnd *sc;=0A+		unsigned int rqid;=0A+		unsigned =
int done;=0A+		vscsiif_segment_t segs[];=0A+	} active;=0A };=0A =
=0A #define DPRINTK(_f, _a...)				\=0A--- sle11sp3.or=
ig/drivers/xen/scsifront/scsifront.c	2011-06-28 18:57:14.000000000 =
+0200=0A+++ sle11sp3/drivers/xen/scsifront/scsifront.c	2012-11-22 =
16:37:35.000000000 +0100=0A@@ -106,6 +106,66 @@ irqreturn_t scsifront_intr(=
int irq, void=0A 	return IRQ_HANDLED;=0A }=0A =0A+static bool =
push_cmd_to_ring(struct vscsifrnt_info *info,=0A+			   =
  vscsiif_request_t *ring_req)=0A+{=0A+	unsigned int left, rqid =3D =
info->active.rqid;=0A+	struct scsi_cmnd *sc;=0A+=0A+	for (; ; ring_req =
=3D NULL) {=0A+		struct vscsiif_sg_list *sgl;=0A+=0A+		if =
(!ring_req) {=0A+			struct vscsiif_front_ring *ring =
=3D &info->ring;=0A+=0A+			ring_req =3D RING_GET_REQUE=
ST(ring, ring->req_prod_pvt);=0A+			ring->req_prod_pvt+=
+;=0A+			ring_req->rqid =3D rqid;=0A+		}=0A+=0A+	=
	left =3D info->shadow[rqid].nr_segments - info->active.done;=0A+	=
	if (left <=3D VSCSIIF_SG_TABLESIZE)=0A+			break;=0A+=
=0A+		sgl =3D (void *)ring_req;=0A+		sgl->act =3D =
VSCSIIF_ACT_SCSI_SG_PRESET;=0A+=0A+		if (left > VSCSIIF_SG_LIST_=
SIZE)=0A+			left =3D VSCSIIF_SG_LIST_SIZE;=0A+		=
memcpy(sgl->seg, info->active.segs + info->active.done,=0A+		   =
    left * sizeof(*sgl->seg));=0A+=0A+		sgl->nr_segments =3D =
left;=0A+		info->active.done +=3D left;=0A+=0A+		if =
(RING_FULL(&info->ring))=0A+			return false;=0A+	=
}=0A+=0A+	sc =3D info->active.sc;=0A+=0A+	ring_req->act     =3D =
VSCSIIF_ACT_SCSI_CDB;=0A+	ring_req->id      =3D sc->device->id;=0A+	=
ring_req->lun     =3D sc->device->lun;=0A+	ring_req->channel =3D =
sc->device->channel;=0A+	ring_req->cmd_len =3D sc->cmd_len;=0A+=0A+	=
if ( sc->cmd_len )=0A+		memcpy(ring_req->cmnd, sc->cmnd, sc->cmd_le=
n);=0A+	else=0A+		memset(ring_req->cmnd, 0, VSCSIIF_MAX_COMMA=
ND_SIZE);=0A+=0A+	ring_req->sc_data_direction   =3D sc->sc_data_direc=
tion;=0A+	ring_req->timeout_per_command =3D sc->request->timeout / =
HZ;=0A+	ring_req->nr_segments         =3D left;=0A+=0A+	memcpy(ring_req->se=
g, info->active.segs + info->active.done,=0A+               left * =
sizeof(*ring_req->seg));=0A+=0A+	info->active.sc =3D NULL;=0A+=0A+	=
return !RING_FULL(&info->ring);=0A+}=0A =0A static void scsifront_gnttab_do=
ne(struct vscsifrnt_shadow *s, uint32_t id)=0A {=0A@@ -194,6 +254,16 @@ =
int scsifront_cmd_done(struct vscsifrnt_=0A 		=0A 		=
ring_res =3D RING_GET_RESPONSE(&info->ring, i);=0A =0A+		if =
(info->host->sg_tablesize > VSCSIIF_SG_TABLESIZE) {=0A+			u8 =
act =3D ring_res->act;=0A+=0A+			if (act =3D=3D VSCSIIF_ACT_=
SCSI_SG_PRESET)=0A+				continue;=0A+			=
if (act !=3D info->shadow[ring_res->rqid].act)=0A+				=
DPRINTK("Bogus backend response (%02x vs %02x)\n",=0A+				=
	act, info->shadow[ring_res->rqid].act);=0A+		}=0A+=0A 	=
	if (info->shadow[ring_res->rqid].act =3D=3D VSCSIIF_ACT_SCSI_CDB)=
=0A 			scsifront_cdb_cmd_done(info, ring_res);=0A 		=
else=0A@@ -208,8 +278,16 @@ int scsifront_cmd_done(struct vscsifrnt_=0A 	=
	info->ring.sring->rsp_event =3D i + 1;=0A 	}=0A =0A-	=
spin_unlock_irqrestore(&info->io_lock, flags);=0A+	spin_unlock(&info->=
io_lock);=0A+=0A+	spin_lock(info->host->host_lock);=0A+=0A+	if =
(info->active.sc && !RING_FULL(&info->ring)) {=0A+		push_cmd_to=
_ring(info, NULL);=0A+		scsifront_do_request(info);=0A+	}=0A =0A+	=
spin_unlock_irqrestore(info->host->host_lock, flags);=0A =0A 	/* Yield =
point for this unbounded loop. */=0A 	cond_resched();=0A@@ -242,7 +320,8 =
@@ int scsifront_schedule(void *data)=0A =0A =0A static int map_data_for_re=
quest(struct vscsifrnt_info *info,=0A-		struct scsi_cmnd *sc, =
vscsiif_request_t *ring_req, uint32_t id)=0A+				=
struct scsi_cmnd *sc,=0A+				struct vscsifrnt_sh=
adow *shadow)=0A {=0A 	grant_ref_t gref_head;=0A 	struct page =
*page;=0A@@ -254,7 +333,7 @@ static int map_data_for_request(struct v=0A 	=
if (sc->sc_data_direction =3D=3D DMA_NONE)=0A 		return 0;=0A =0A-	=
err =3D gnttab_alloc_grant_references(VSCSIIF_SG_TABLESIZE, &gref_head);=0A=
+	err =3D gnttab_alloc_grant_references(info->host->sg_tablesize, =
&gref_head);=0A 	if (err) {=0A 		pr_err("scsifront: =
gnttab_alloc_grant_references() error\n");=0A 		return -ENOMEM;=0A@=
@ -266,7 +345,7 @@ static int map_data_for_request(struct v=0A 		=
unsigned int data_len =3D scsi_bufflen(sc);=0A =0A 		nr_pages =
=3D (data_len + sgl->offset + PAGE_SIZE - 1) >> PAGE_SHIFT;=0A-		if =
(nr_pages > VSCSIIF_SG_TABLESIZE) {=0A+		if (nr_pages > info->host->=
sg_tablesize) {=0A 			pr_err("scsifront: Unable to map =
request_buffer for command!\n");=0A 			ref_cnt =3D =
(-E2BIG);=0A 			goto big_to_sg;=0A@@ -294,10 +373,10 @@ =
static int map_data_for_request(struct v=0A 				=
gnttab_grant_foreign_access_ref(ref, info->dev->otherend_id,=0A 		=
			buffer_pfn, write);=0A =0A-				=
info->shadow[id].gref[ref_cnt]  =3D ref;=0A-				=
ring_req->seg[ref_cnt].gref     =3D ref;=0A-				=
ring_req->seg[ref_cnt].offset   =3D (uint16_t)off;=0A-				=
ring_req->seg[ref_cnt].length   =3D (uint16_t)bytes;=0A+			=
	shadow->gref[ref_cnt] =3D ref;=0A+				=
info->active.segs[ref_cnt].gref   =3D ref;=0A+				=
info->active.segs[ref_cnt].offset =3D off;=0A+				=
info->active.segs[ref_cnt].length =3D bytes;=0A =0A 				=
buffer_pfn++;=0A 				len -=3D bytes;=0A@@ =
-336,34 +415,27 @@ static int scsifront_queuecommand(struct=0A 		=
return SCSI_MLQUEUE_HOST_BUSY;=0A 	}=0A =0A+	if (info->active.sc=
 && !push_cmd_to_ring(info, NULL)) {=0A+		scsifront_do_reques=
t(info);=0A+		spin_unlock_irqrestore(shost->host_lock, flags);=0A=
+		return SCSI_MLQUEUE_HOST_BUSY;=0A+	}=0A+=0A 	=
sc->result    =3D 0;=0A =0A 	ring_req          =3D scsifront_pre_request=
(info);=0A 	rqid              =3D ring_req->rqid;=0A-	ring_req->a=
ct     =3D VSCSIIF_ACT_SCSI_CDB;=0A-=0A-	ring_req->id      =3D =
sc->device->id;=0A-	ring_req->lun     =3D sc->device->lun;=0A-	=
ring_req->channel =3D sc->device->channel;=0A-	ring_req->cmd_len =3D =
sc->cmd_len;=0A =0A 	BUG_ON(sc->cmd_len > VSCSIIF_MAX_COMMAND_SIZE);=0A =
=0A-	if ( sc->cmd_len )=0A-		memcpy(ring_req->cmnd, sc->cmnd, =
sc->cmd_len);=0A-	else=0A-		memset(ring_req->cmnd, 0, =
VSCSIIF_MAX_COMMAND_SIZE);=0A-=0A-	ring_req->sc_data_direction   =3D =
(uint8_t)sc->sc_data_direction;=0A-	ring_req->timeout_per_command =3D =
(sc->request->timeout / HZ);=0A-=0A 	info->shadow[rqid].req_scsi_cmnd   =
  =3D (unsigned long)sc;=0A 	info->shadow[rqid].sc_data_direction =3D =
sc->sc_data_direction;=0A-	info->shadow[rqid].act               =3D =
ring_req->act;=0A+	info->shadow[rqid].act               =3D VSCSIIF_AC=
T_SCSI_CDB;=0A =0A-	ref_cnt =3D map_data_for_request(info, sc, =
ring_req, rqid);=0A+	ref_cnt =3D map_data_for_request(info, sc, =
&info->shadow[rqid]);=0A 	if (ref_cnt < 0) {=0A 		add_id_to_f=
reelist(info, rqid);=0A+		scsifront_do_request(info);=0A 		=
spin_unlock_irqrestore(shost->host_lock, flags);=0A 		if =
(ref_cnt =3D=3D (-ENOMEM))=0A 			return SCSI_MLQUEUE_HOST_BU=
SY;=0A@@ -372,9 +444,13 @@ static int scsifront_queuecommand(struct=0A 		=
return 0;=0A 	}=0A =0A-	ring_req->nr_segments          =3D =
(uint8_t)ref_cnt;=0A 	info->shadow[rqid].nr_segments =3D ref_cnt;=0A =
=0A+	info->active.sc  =3D sc;=0A+	info->active.rqid =3D rqid;=0A+	=
info->active.done =3D 0;=0A+	push_cmd_to_ring(info, ring_req);=0A+=0A 	=
scsifront_do_request(info);=0A 	spin_unlock_irqrestore(shost->host_lock, =
flags);=0A =0A--- sle11sp3.orig/drivers/xen/scsifront/xenbus.c	2012-10-02 =
14:32:45.000000000 +0200=0A+++ sle11sp3/drivers/xen/scsifront/xenbus.c	=
2012-11-21 13:35:47.000000000 +0100=0A@@ -43,6 +43,10 @@=0A   #define =
DEFAULT_TASK_COMM_LEN	TASK_COMM_LEN=0A #endif=0A =0A+static unsigned int =
max_nr_segs =3D VSCSIIF_SG_TABLESIZE;=0A+module_param_named(max_segs, =
max_nr_segs, uint, 0);=0A+MODULE_PARM_DESC(max_segs, "Maximum number of =
segments per request");=0A+=0A extern struct scsi_host_template scsifront_s=
ht;=0A =0A static void scsifront_free(struct vscsifrnt_info *info)=0A@@ =
-181,7 +185,9 @@ static int scsifront_probe(struct xenbus=0A 	int i, err =
=3D -ENOMEM;=0A 	char name[DEFAULT_TASK_COMM_LEN];=0A =0A-	=
host =3D scsi_host_alloc(&scsifront_sht, sizeof(*info));=0A+	host =3D =
scsi_host_alloc(&scsifront_sht,=0A+			       offsetof(str=
uct vscsifrnt_info,=0A+					active.segs[max_nr_=
segs]));=0A 	if (!host) {=0A 		xenbus_dev_fatal(dev, err, =
"fail to allocate scsi host");=0A 		return err;=0A@@ -223,7 =
+229,7 @@ static int scsifront_probe(struct xenbus=0A 	host->max_id      =
=3D VSCSIIF_MAX_TARGET;=0A 	host->max_channel =3D 0;=0A 	host->max_l=
un     =3D VSCSIIF_MAX_LUN;=0A-	host->max_sectors =3D (VSCSIIF_SG_TABLESIZE=
 - 1) * PAGE_SIZE / 512;=0A+	host->max_sectors =3D (host->sg_tablesize =
- 1) * PAGE_SIZE / 512;=0A 	host->max_cmd_len =3D VSCSIIF_MAX_COMMAND_S=
IZE;=0A =0A 	err =3D scsi_add_host(host, &dev->dev);=0A@@ -278,6 =
+284,23 @@ static int scsifront_disconnect(struct v=0A 	return 0;=0A }=0A =
=0A+static void scsifront_read_backend_params(struct xenbus_device =
*dev,=0A+					  struct vscsifrnt_info =
*info)=0A+{=0A+	unsigned int nr_segs;=0A+	int ret;=0A+	struct =
Scsi_Host *host =3D info->host;=0A+=0A+	ret =3D xenbus_scanf(XBT_NIL, =
dev->otherend, "segs-per-req", "%u",=0A+			   =
&nr_segs);=0A+	if (ret =3D=3D 1 && nr_segs > host->sg_tablesize) {=0A+		=
host->sg_tablesize =3D min(nr_segs, max_nr_segs);=0A+		dev_info(&d=
ev->dev, "using up to %d SG entries\n",=0A+			 host->sg_t=
ablesize);=0A+		host->max_sectors =3D (host->sg_tablesize - 1) * =
PAGE_SIZE / 512;=0A+	}=0A+}=0A+=0A #define VSCSIFRONT_OP_ADD_LUN	=
1=0A #define VSCSIFRONT_OP_DEL_LUN	2=0A =0A@@ -368,6 +391,7 @@ static =
void scsifront_backend_changed(st=0A 		break;=0A =0A 	case =
XenbusStateConnected:=0A+		scsifront_read_backend_params(dev, =
info);=0A 		if (xenbus_read_driver_state(dev->nodename) =
=3D=3D=0A 			XenbusStateInitialised) {=0A 			=
scsifront_do_lun_hotplug(info, VSCSIFRONT_OP_ADD_LUN);=0A@@ -413,8 +437,13 =
@@ static DEFINE_XENBUS_DRIVER(scsifront, ,=0A 	.otherend_changed	=
=3D scsifront_backend_changed,=0A );=0A =0A-int scsifront_xenbus_init(void)=
=0A+int __init scsifront_xenbus_init(void)=0A {=0A+	if (max_nr_segs > =
SG_ALL)=0A+		max_nr_segs =3D SG_ALL;=0A+	if (max_nr_segs < =
VSCSIIF_SG_TABLESIZE)=0A+		max_nr_segs =3D VSCSIIF_SG_TABLESIZ=
E;=0A+=0A 	return xenbus_register_frontend(&scsifront_driver);=0A =
}=0A =0A--- sle11sp3.orig/include/xen/interface/io/vscsiif.h	2008-07-21 =
11:00:33.000000000 +0200=0A+++ sle11sp3/include/xen/interface/io/vscsiif.h	=
2012-11-22 14:32:31.000000000 +0100=0A@@ -34,6 +34,7 @@=0A #define =
VSCSIIF_ACT_SCSI_CDB         1    /* SCSI CDB command */=0A #define =
VSCSIIF_ACT_SCSI_ABORT       2    /* SCSI Device(Lun) Abort*/=0A #define =
VSCSIIF_ACT_SCSI_RESET       3    /* SCSI Device(Lun) Reset*/=0A+#define =
VSCSIIF_ACT_SCSI_SG_PRESET   4    /* Preset SG elements */=0A =0A =0A =
#define VSCSIIF_BACK_MAX_PENDING_REQS    128=0A@@ -53,6 +54,12 @@=0A =
#define VSCSIIF_MAX_COMMAND_SIZE         16=0A #define VSCSIIF_SENSE_BUFFER=
SIZE         96=0A =0A+struct scsiif_request_segment {=0A+    grant_ref_t =
gref;=0A+    uint16_t offset;=0A+    uint16_t length;=0A+};=0A+typedef =
struct scsiif_request_segment vscsiif_segment_t;=0A =0A struct vscsiif_requ=
est {=0A     uint16_t rqid;          /* private guest value, echoed in =
resp  */=0A@@ -69,18 +76,26 @@ struct vscsiif_request {=0A                 =
                         DMA_NONE(3) requests  */=0A     uint8_t nr_segment=
s;              /* Number of pieces of scatter-gather */=0A =0A-    struct =
scsiif_request_segment {=0A-        grant_ref_t gref;=0A-        uint16_t =
offset;=0A-        uint16_t length;=0A-    } seg[VSCSIIF_SG_TABLESIZE];=0A+=
    vscsiif_segment_t seg[VSCSIIF_SG_TABLESIZE];=0A     uint32_t reserved[3=
];=0A };=0A typedef struct vscsiif_request vscsiif_request_t;=0A =0A+#defin=
e VSCSIIF_SG_LIST_SIZE ((sizeof(vscsiif_request_t) - 4) \=0A+              =
                / sizeof(vscsiif_segment_t))=0A+=0A+struct vscsiif_sg_list =
{=0A+    /* First two fields must match struct vscsiif_request! */=0A+    =
uint16_t rqid;          /* private guest value, must match main req */=0A+ =
   uint8_t act;            /* VSCSIIF_ACT_SCSI_SG_PRESET */=0A+    uint8_t =
nr_segments;    /* Number of pieces of scatter-gather */=0A+    vscsiif_seg=
ment_t seg[VSCSIIF_SG_LIST_SIZE];=0A+};=0A+typedef struct vscsiif_sg_list =
vscsiif_sg_list_t;=0A+=0A struct vscsiif_response {=0A     uint16_t =
rqid;=0A-    uint8_t padding;=0A+    uint8_t act;               /* valid =
only when backend supports SG_PRESET */=0A     uint8_t sense_len;=0A     =
uint8_t sense_buffer[VSCSIIF_SENSE_BUFFERSIZE];=0A     int32_t rslt;=0A
--=__PartC2F32BEB.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.xen.org
http://lists.xen.org/xen-devel

--=__PartC2F32BEB.0__=--


From xen-devel-bounces@lists.xen.org Tue Nov 27 11:36:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:36:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJT4-000343-0g; Tue, 27 Nov 2012 11:36:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdJT2-00033t-F2
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:36:44 +0000
Received: from [85.158.137.99:49821] by server-7.bemta-3.messagelabs.com id
	42/77-01713-9C5A4B05; Tue, 27 Nov 2012 11:36:41 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1354016199!20794585!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2130 invoked from network); 27 Nov 2012 11:36:39 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 11:36:39 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 11:36:38 +0000
Message-Id: <50B4B40B02000078000ABA19@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 11:37:31 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartC2F32BEB.0__="
Subject: [Xen-devel] [PATCH] vscsiif: allow larger segments-per-request
	values
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartC2F32BEB.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

At least certain tape devices require fixed size blocks to be operated
upon, i.e. breaking up of I/O requests is not permitted. Consequently
we need an interface extension that (leaving aside implementation
limitations) doesn't impose a limit on the number of segments that can
be associated with an individual request.

This, in turn, excludes the blkif extension FreeBSD folks implemented,
as that still imposes an upper limit (the actual I/O request still
specifies the full number of segments - as an 8-bit quantity -, and
subsequent ring slots get used to carry the excess segment
descriptors).

The alternative therefore is to allow the frontend to pre-set segment
descriptors _before_ actually issuing the I/O request. I/O will then
be done by the backend for the accumulated set of segments.

To properly associate segment preset operations with the main request,
the rqid-s between them should match (originally I had hoped to use
this to avoid producing individual responses for the pre-set
operations, but that turned out to violate the underlying shared ring
implementation).

Negotiation of the maximum number of segments a particular backend
implementation supports happens through a new "segs-per-req" xenstore
node.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
As I have no plans to backport this to the 2.6.18 tree, I'm attaching
for reference the full kernel side patch we're intending to use.

--- a/xen/include/public/io/vscsiif.h
+++ b/xen/include/public/io/vscsiif.h
@@ -34,6 +34,7 @@
 #define VSCSIIF_ACT_SCSI_CDB         1    /* SCSI CDB command */
 #define VSCSIIF_ACT_SCSI_ABORT       2    /* SCSI Device(Lun) Abort*/
 #define VSCSIIF_ACT_SCSI_RESET       3    /* SCSI Device(Lun) Reset*/
+#define VSCSIIF_ACT_SCSI_SG_PRESET   4    /* Preset SG elements */
=20
 /*
  * Maximum scatter/gather segments per request.
@@ -50,6 +51,12 @@
 #define VSCSIIF_MAX_COMMAND_SIZE         16
 #define VSCSIIF_SENSE_BUFFERSIZE         96
=20
+struct scsiif_request_segment {
+    grant_ref_t gref;
+    uint16_t offset;
+    uint16_t length;
+};
+typedef struct scsiif_request_segment vscsiif_segment_t;
=20
 struct vscsiif_request {
     uint16_t rqid;          /* private guest value, echoed in resp  */
@@ -66,18 +73,26 @@ struct vscsiif_request {
                                          DMA_NONE(3) requests  */
     uint8_t nr_segments;              /* Number of pieces of scatter-gathe=
r */
=20
-    struct scsiif_request_segment {
-        grant_ref_t gref;
-        uint16_t offset;
-        uint16_t length;
-    } seg[VSCSIIF_SG_TABLESIZE];
+    vscsiif_segment_t seg[VSCSIIF_SG_TABLESIZE];
     uint32_t reserved[3];
 };
 typedef struct vscsiif_request vscsiif_request_t;
=20
+#define VSCSIIF_SG_LIST_SIZE ((sizeof(vscsiif_request_t) - 4) \
+                              / sizeof(vscsiif_segment_t))
+
+struct vscsiif_sg_list {
+    /* First two fields must match struct vscsiif_request! */
+    uint16_t rqid;          /* private guest value, must match main req =
*/
+    uint8_t act;            /* VSCSIIF_ACT_SCSI_SG_PRESET */
+    uint8_t nr_segments;    /* Number of pieces of scatter-gather */
+    vscsiif_segment_t seg[VSCSIIF_SG_LIST_SIZE];
+};
+typedef struct vscsiif_sg_list vscsiif_sg_list_t;
+
 struct vscsiif_response {
     uint16_t rqid;
-    uint8_t padding;
+    uint8_t act;               /* valid only when backend supports =
SG_PRESET */
     uint8_t sense_len;
     uint8_t sense_buffer[VSCSIIF_SENSE_BUFFERSIZE];
     int32_t rslt;




--=__PartC2F32BEB.0__=
Content-Type: text/plain; name="xen-vscsiif-large-requests.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xen-vscsiif-large-requests.patch"

vscsiif: allow larger segments-per-request values=0A=0AAt least certain =
tape devices require fixed size blocks to be operated=0Aupon, i.e. =
breaking up of I/O requests is not permitted. Consequently=0Awe need an =
interface extension that (leaving aside implementation=0Alimitations) =
doesn't impose a limit on the number of segments that can=0Abe associated =
with an individual request.=0A=0AThis, in turn, excludes the blkif =
extension FreeBSD folks implemented,=0Aas that still imposes an upper =
limit (the actual I/O request still=0Aspecifies the full number of =
segments - as an 8-bit quantity -, and=0Asubsequent ring slots get used to =
carry the excess segment=0Adescriptors).=0A=0AThe alternative therefore is =
to allow the frontend to pre-set segment=0Adescriptors _before_ actually =
issuing the I/O request. I/O will then=0Abe done by the backend for the =
accumulated set of segments.=0A=0ATo properly associate segment preset =
operations with the main request,=0Athe rqid-s between them should match =
(originally I had hoped to use=0Athis to avoid producing individual =
responses for the pre-set=0Aoperations, but that turned out to violate the =
underlying shared ring=0Aimplementation).=0A=0ANegotiation of the maximum =
number of segments a particular backend=0Aimplementation supports happens =
through a new "segs-per-req" xenstore=0Anode.=0A=0ASigned-off-by: Jan =
Beulich <jbeulich@suse.com>=0A---=0AAs I have no plans to backport this to =
the 2.6.18 tree, I'm attaching=0Afor reference the full kernel side patch =
we're intending to use.=0A=0A--- a/xen/include/public/io/vscsiif.h=0A+++ =
b/xen/include/public/io/vscsiif.h=0A@@ -34,6 +34,7 @@=0A #define VSCSIIF_AC=
T_SCSI_CDB         1    /* SCSI CDB command */=0A #define VSCSIIF_ACT_SCSI_=
ABORT       2    /* SCSI Device(Lun) Abort*/=0A #define VSCSIIF_ACT_SCSI_RE=
SET       3    /* SCSI Device(Lun) Reset*/=0A+#define VSCSIIF_ACT_SCSI_SG_P=
RESET   4    /* Preset SG elements */=0A =0A /*=0A  * Maximum scatter/gathe=
r segments per request.=0A@@ -50,6 +51,12 @@=0A #define VSCSIIF_MAX_COMMAND=
_SIZE         16=0A #define VSCSIIF_SENSE_BUFFERSIZE         96=0A =
=0A+struct scsiif_request_segment {=0A+    grant_ref_t gref;=0A+    =
uint16_t offset;=0A+    uint16_t length;=0A+};=0A+typedef struct scsiif_req=
uest_segment vscsiif_segment_t;=0A =0A struct vscsiif_request {=0A     =
uint16_t rqid;          /* private guest value, echoed in resp  */=0A@@ =
-66,18 +73,26 @@ struct vscsiif_request {=0A                               =
           DMA_NONE(3) requests  */=0A     uint8_t nr_segments;            =
  /* Number of pieces of scatter-gather */=0A =0A-    struct scsiif_request=
_segment {=0A-        grant_ref_t gref;=0A-        uint16_t offset;=0A-    =
    uint16_t length;=0A-    } seg[VSCSIIF_SG_TABLESIZE];=0A+    vscsiif_seg=
ment_t seg[VSCSIIF_SG_TABLESIZE];=0A     uint32_t reserved[3];=0A };=0A =
typedef struct vscsiif_request vscsiif_request_t;=0A =0A+#define VSCSIIF_SG=
_LIST_SIZE ((sizeof(vscsiif_request_t) - 4) \=0A+                          =
    / sizeof(vscsiif_segment_t))=0A+=0A+struct vscsiif_sg_list {=0A+    /* =
First two fields must match struct vscsiif_request! */=0A+    uint16_t =
rqid;          /* private guest value, must match main req */=0A+    =
uint8_t act;            /* VSCSIIF_ACT_SCSI_SG_PRESET */=0A+    uint8_t =
nr_segments;    /* Number of pieces of scatter-gather */=0A+    vscsiif_seg=
ment_t seg[VSCSIIF_SG_LIST_SIZE];=0A+};=0A+typedef struct vscsiif_sg_list =
vscsiif_sg_list_t;=0A+=0A struct vscsiif_response {=0A     uint16_t =
rqid;=0A-    uint8_t padding;=0A+    uint8_t act;               /* valid =
only when backend supports SG_PRESET */=0A     uint8_t sense_len;=0A     =
uint8_t sense_buffer[VSCSIIF_SENSE_BUFFERSIZE];=0A     int32_t rslt;=0A
--=__PartC2F32BEB.0__=
Content-Type: text/plain; name="vscsi-large-requests.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="vscsi-large-requests.patch"

--- sle11sp3.orig/drivers/xen/scsiback/common.h	2012-06-06 13:53:26.0000000=
00 +0200=0A+++ sle11sp3/drivers/xen/scsiback/common.h	2012-11-22 =
14:55:58.000000000 +0100=0A@@ -94,10 +94,15 @@ struct vscsibk_info {=0A 	=
unsigned int waiting_reqs;=0A 	struct page **mmap_pages;=0A =0A+	=
struct pending_req *preq;=0A+=0A+	union {=0A+		struct =
gnttab_map_grant_ref   *gmap;=0A+		struct gnttab_unmap_grant_r=
ef *gunmap;=0A+	};=0A };=0A =0A-typedef struct {=0A-	unsigned char =
act;=0A+typedef struct pending_req {=0A 	struct vscsibk_info =
*info;=0A 	struct scsi_device *sdev;=0A =0A@@ -114,7 +119,8 @@ =
typedef struct {=0A 	=0A 	uint32_t request_bufflen;=0A 	struct =
scatterlist *sgl;=0A-	grant_ref_t gref[VSCSIIF_SG_TABLESIZE];=0A+	=
grant_ref_t *gref;=0A+	vscsiif_segment_t *segs;=0A =0A 	int32_t =
rslt;=0A 	uint32_t resid;=0A@@ -123,7 +129,7 @@ typedef struct {=0A 	=
struct list_head free_list;=0A } pending_req_t;=0A =0A-=0A+extern unsigned =
int vscsiif_segs;=0A =0A #define scsiback_get(_b) (atomic_inc(&(_b)->nr_unr=
eplied_reqs))=0A #define scsiback_put(_b)				=
\=0A@@ -163,7 +169,7 @@ void scsiback_release_translation_entry(=0A =0A =
void scsiback_cmd_exec(pending_req_t *pending_req);=0A void scsiback_do_res=
p_with_sense(char *sense_buffer, int32_t result,=0A-			=
uint32_t resid, pending_req_t *pending_req);=0A+			=
uint32_t resid, pending_req_t *, uint8_t act);=0A void scsiback_fast_flush_=
area(pending_req_t *req);=0A =0A void scsiback_rsp_emulation(pending_req_t =
*pending_req);=0A--- sle11sp3.orig/drivers/xen/scsiback/emulate.c	=
2012-01-11 12:14:54.000000000 +0100=0A+++ sle11sp3/drivers/xen/scsiback/emu=
late.c	2012-11-22 14:29:27.000000000 +0100=0A@@ -352,7 +352,9 @@ void =
scsiback_req_emulation_or_cmdexec(p=0A 	else {=0A 		scsiback_fa=
st_flush_area(pending_req);=0A 		scsiback_do_resp_with_sense(pending=
_req->sense_buffer,=0A-		  pending_req->rslt, pending_req->resid, =
pending_req);=0A+					    pending_req->rs=
lt,=0A+					    pending_req->resid, pending_req=
,=0A+					    VSCSIIF_ACT_SCSI_CDB);=0A 	=
}=0A }=0A =0A--- sle11sp3.orig/drivers/xen/scsiback/interface.c	2011-10-10 =
11:58:37.000000000 +0200=0A+++ sle11sp3/drivers/xen/scsiback/interface.c	=
2012-11-13 13:21:10.000000000 +0100=0A@@ -51,6 +51,13 @@ struct vscsibk_inf=
o *vscsibk_info_alloc(=0A 	if (!info)=0A 		return ERR_PTR(-ENO=
MEM);=0A =0A+	info->gmap =3D kcalloc(max(sizeof(*info->gmap), sizeof(*inf=
o->gunmap)),=0A+			     vscsiif_segs, GFP_KERNEL);=0A+=
	if (!info->gmap) {=0A+		kfree(info);=0A+		=
return ERR_PTR(-ENOMEM);=0A+	}=0A+=0A 	info->domid =3D domid;=0A 	=
spin_lock_init(&info->ring_lock);=0A 	atomic_set(&info->nr_unreplied_reqs=
, 0);=0A@@ -120,6 +127,7 @@ void scsiback_disconnect(struct vscsibk_=0A =
=0A void scsiback_free(struct vscsibk_info *info)=0A {=0A+	kfree(info-=
>gmap);=0A 	kmem_cache_free(scsiback_cachep, info);=0A }=0A =0A--- =
sle11sp3.orig/drivers/xen/scsiback/scsiback.c	2012-11-22 15:36:11.0000000=
00 +0100=0A+++ sle11sp3/drivers/xen/scsiback/scsiback.c	2012-11-22 =
15:36:16.000000000 +0100=0A@@ -56,6 +56,10 @@ int vscsiif_reqs =3D =
VSCSIIF_BACK_MAX_PEND=0A module_param_named(reqs, vscsiif_reqs, int, =
0);=0A MODULE_PARM_DESC(reqs, "Number of scsiback requests to allocate");=
=0A =0A+unsigned int vscsiif_segs =3D VSCSIIF_SG_TABLESIZE;=0A+module_param=
_named(segs, vscsiif_segs, uint, 0);=0A+MODULE_PARM_DESC(segs, "Number of =
segments to allow per request");=0A+=0A static unsigned int log_print_stat =
=3D 0;=0A module_param(log_print_stat, int, 0644);=0A =0A@@ -67,7 +71,7 @@ =
static grant_handle_t *pending_grant_han=0A =0A static int vaddr_pagenr(pen=
ding_req_t *req, int seg)=0A {=0A-	return (req - pending_reqs) * =
VSCSIIF_SG_TABLESIZE + seg;=0A+	return (req - pending_reqs) * vscsiif_segs =
+ seg;=0A }=0A =0A static unsigned long vaddr(pending_req_t *req, int =
seg)=0A@@ -82,7 +86,7 @@ static unsigned long vaddr(pending_req_t=0A =0A =
void scsiback_fast_flush_area(pending_req_t *req)=0A {=0A-	struct =
gnttab_unmap_grant_ref unmap[VSCSIIF_SG_TABLESIZE];=0A+	struct gnttab_unmap=
_grant_ref *unmap =3D req->info->gunmap;=0A 	unsigned int i, invcount =
=3D 0;=0A 	grant_handle_t handle;=0A 	int err;=0A@@ -117,6 =
+121,7 @@ static pending_req_t * alloc_req(struct =0A 	if (!list_empty(&pe=
nding_free)) {=0A 		req =3D list_entry(pending_free.next, =
pending_req_t, free_list);=0A 		list_del(&req->free_list);=0A+		=
req->nr_segments =3D 0;=0A 	}=0A 	spin_unlock_irqrestore(&pending_fre=
e_lock, flags);=0A 	return req;=0A@@ -144,7 +149,8 @@ static void =
scsiback_notify_work(struct =0A }=0A =0A void scsiback_do_resp_with_sense(c=
har *sense_buffer, int32_t result,=0A-			uint32_t resid, =
pending_req_t *pending_req)=0A+				 uint32_t resid, =
pending_req_t *pending_req,=0A+				 uint8_t act)=0A =
{=0A 	vscsiif_response_t *ring_res;=0A 	struct vscsibk_info *info =
=3D pending_req->info;=0A@@ -159,6 +165,7 @@ void scsiback_do_resp_with_sen=
se(char *s=0A 	ring_res =3D RING_GET_RESPONSE(&info->ring, info->ring.rsp_=
prod_pvt);=0A 	info->ring.rsp_prod_pvt++;=0A =0A+	ring_res->act    =
=3D act;=0A 	ring_res->rslt   =3D result;=0A 	ring_res->rqid   =
=3D pending_req->rqid;=0A =0A@@ -186,7 +193,8 @@ void scsiback_do_resp_with=
_sense(char *s=0A 	if (notify)=0A 		notify_remote_via_irq(info-=
>irq);=0A =0A-	free_req(pending_req);=0A+	if (act !=3D VSCSIIF_ACT_SC=
SI_SG_PRESET)=0A+		free_req(pending_req);=0A }=0A =0A static =
void scsiback_print_status(char *sense_buffer, int errors,=0A@@ -225,25 =
+233,25 @@ static void scsiback_cmd_done(struct req=0A 		scsiback_rs=
p_emulation(pending_req);=0A =0A 	scsiback_fast_flush_area(pending_re=
q);=0A-	scsiback_do_resp_with_sense(sense_buffer, errors, resid, pending_re=
q);=0A+	scsiback_do_resp_with_sense(sense_buffer, errors, resid, pending_re=
q,=0A+				    VSCSIIF_ACT_SCSI_CDB);=0A 	scsiback_pu=
t(pending_req->info);=0A =0A 	__blk_put_request(req->q, req);=0A }=0A =
=0A =0A-static int scsiback_gnttab_data_map(vscsiif_request_t *ring_req,=0A=
-					pending_req_t *pending_req)=0A+stat=
ic int scsiback_gnttab_data_map(const vscsiif_segment_t *segs,=0A+		=
		    unsigned int nr_segs,=0A+				   =
 pending_req_t *pending_req)=0A {=0A 	u32 flags;=0A-	int write;=0A-	=
int i, err =3D 0;=0A-	unsigned int data_len =3D 0;=0A-	struct =
gnttab_map_grant_ref map[VSCSIIF_SG_TABLESIZE];=0A+	int write, err =3D =
0;=0A+	unsigned int i, j, data_len =3D 0;=0A 	struct vscsibk_info *info  =
 =3D pending_req->info;=0A-=0A+	struct gnttab_map_grant_ref *map =3D =
info->gmap;=0A 	int data_dir =3D (int)pending_req->sc_data_direction;=0A-	=
unsigned int nr_segments =3D (unsigned int)pending_req->nr_segments;=0A+	=
unsigned int nr_segments =3D pending_req->nr_segments + nr_segs;=0A =0A 	=
write =3D (data_dir =3D=3D DMA_TO_DEVICE);=0A =0A@@ -264,14 +272,20 @@ =
static int scsiback_gnttab_data_map(vscs=0A 		if (write)=0A 		=
	flags |=3D GNTMAP_readonly;=0A =0A-		for (i =3D 0; i < =
nr_segments; i++)=0A+		for (i =3D 0; i < pending_req->nr_segments;=
 i++)=0A 			gnttab_set_map_op(&map[i], vaddr(pending_re=
q, i), flags,=0A-						ring_req->s=
eg[i].gref,=0A+						pending_req->segs[i=
].gref,=0A+						info->domid);=0A+	=
	for (j =3D 0; i < nr_segments; i++, j++)=0A+			=
gnttab_set_map_op(&map[i], vaddr(pending_req, i), flags,=0A+			=
			segs[j].gref,=0A 					=
	info->domid);=0A =0A+=0A 		err =3D HYPERVISOR_grant_ta=
ble_op(GNTTABOP_map_grant_ref, map, nr_segments);=0A 		BUG_ON(err)=
;=0A =0A+		j =3D 0;=0A 		for_each_sg (pending_req->s=
gl, sg, nr_segments, i) {=0A 			struct page *pg;=0A =0A@@ =
-294,8 +308,15 @@ static int scsiback_gnttab_data_map(vscs=0A 			=
set_phys_to_machine(page_to_pfn(pg),=0A 				=
FOREIGN_FRAME(map[i].dev_bus_addr >> PAGE_SHIFT));=0A =0A-			=
sg_set_page(sg, pg, ring_req->seg[i].length,=0A-				=
    ring_req->seg[i].offset);=0A+			if (i < pending_req=
->nr_segments)=0A+				sg_set_page(sg, pg,=0A+		=
			    pending_req->segs[i].length,=0A+			=
		    pending_req->segs[i].offset);=0A+			=
else {=0A+				sg_set_page(sg, pg, segs[j].length,=
=0A+					    segs[j].offset);=0A+		=
		++j;=0A+			}=0A 			=
data_len +=3D sg->length;=0A =0A 			barrier();=0A@@ =
-306,6 +327,8 @@ static int scsiback_gnttab_data_map(vscs=0A =0A 		=
}=0A =0A+		pending_req->nr_segments =3D nr_segments;=0A+=0A 	=
	if (err)=0A 			goto fail_flush;=0A 	}=0A@@ =
-471,7 +494,8 @@ static void scsiback_device_reset_exec(p=0A 	scsiback_ge=
t(info);=0A 	err =3D scsi_reset_provider(sdev, SCSI_TRY_RESET_DEVICE);=
=0A =0A-	scsiback_do_resp_with_sense(NULL, err, 0, pending_req);=0A+=
	scsiback_do_resp_with_sense(NULL, err, 0, pending_req,=0A+		=
		    VSCSIIF_ACT_SCSI_RESET);=0A 	scsiback_put(info);=
=0A =0A 	return;=0A@@ -489,13 +513,11 @@ static int prepare_pending_=
reqs(struct v=0A {=0A 	struct scsi_device *sdev;=0A 	struct ids_tuple =
vir;=0A+	unsigned int nr_segs;=0A 	int err =3D -EINVAL;=0A =
=0A 	DPRINTK("%s\n",__FUNCTION__);=0A =0A-	pending_req->rqid       =
=3D ring_req->rqid;=0A-	pending_req->act        =3D ring_req->act;=0A-=0A 	=
pending_req->info       =3D info;=0A =0A 	pending_req->v_chn =3D =
vir.chn =3D ring_req->channel;=0A@@ -525,11 +547,10 @@ static int =
prepare_pending_reqs(struct v=0A 		goto invalid_value;=0A 	=
}=0A =0A-	pending_req->nr_segments =3D ring_req->nr_segments;=0A+	=
nr_segs =3D ring_req->nr_segments;=0A 	barrier();=0A-	if (pending_req->nr=
_segments > VSCSIIF_SG_TABLESIZE) {=0A-		DPRINTK("scsiback: invalid =
parameter nr_seg =3D %d\n",=0A-			pending_req->nr_segments);=
=0A+	if (pending_req->nr_segments + nr_segs > vscsiif_segs) {=0A+		=
DPRINTK("scsiback: invalid nr_segs =3D %u\n", nr_segs);=0A 		=
err =3D -EINVAL;=0A 		goto invalid_value;=0A 	}=0A@@ -546,7 =
+567,7 @@ static int prepare_pending_reqs(struct v=0A 	=0A 	pending_req=
->timeout_per_command =3D ring_req->timeout_per_command;=0A =0A-	=
if(scsiback_gnttab_data_map(ring_req, pending_req)) {=0A+	if =
(scsiback_gnttab_data_map(ring_req->seg, nr_segs, pending_req)) {=0A 		=
DPRINTK("scsiback: invalid buffer\n");=0A 		err =3D -EINVAL;=0A=
 		goto invalid_value;=0A@@ -558,6 +579,20 @@ invalid_value:=
=0A 	return err;=0A }=0A =0A+static void latch_segments(pending_req_t =
*pending_req,=0A+			   const struct vscsiif_sg_list =
*sgl)=0A+{=0A+	unsigned int nr_segs =3D sgl->nr_segments;=0A+=0A+	=
barrier();=0A+	if (pending_req->nr_segments + nr_segs <=3D vscsiif_segs) =
{=0A+		memcpy(pending_req->segs + pending_req->nr_segments,=0A+	=
	       sgl->seg, nr_segs * sizeof(*sgl->seg));=0A+		=
pending_req->nr_segments +=3D nr_segs;=0A+	}=0A+	else=0A+		=
DPRINTK("scsiback: invalid nr_segs =3D %u\n", nr_segs);=0A+}=0A =0A static =
int _scsiback_do_cmd_fn(struct vscsibk_info *info)=0A {=0A@@ -575,9 =
+610,11 @@ static int _scsiback_do_cmd_fn(struct vs=0A 	rmb();=0A =0A 	=
while ((rc !=3D rp)) {=0A+		int act, rqid;=0A+=0A 		if =
(RING_REQUEST_CONS_OVERFLOW(ring, rc))=0A 			break;=0A-	=
	pending_req =3D alloc_req(info);=0A+		pending_req =3D =
info->preq ?: alloc_req(info);=0A 		if (NULL =3D=3D pending_req=
) {=0A 			more_to_do =3D 1;=0A 			break;=0A@@=
 -586,32 +623,55 @@ static int _scsiback_do_cmd_fn(struct vs=0A 		=
ring_req =3D RING_GET_REQUEST(ring, rc);=0A 		ring->req_cons =3D =
++rc;=0A =0A+		act =3D ring_req->act;=0A+		rqid =3D =
ring_req->rqid;=0A+		barrier();=0A+		if (!pending_req->n=
r_segments)=0A+			pending_req->rqid =3D rqid;=0A+		=
else if (pending_req->rqid !=3D rqid)=0A+			DPRINTK("sc=
siback: invalid rqid %04x, expected %04x\n",=0A+				=
rqid, pending_req->rqid);=0A+=0A+		info->preq =3D NULL;=0A+	=
	if (pending_req->rqid !=3D rqid) {=0A+			scsiback_do=
_resp_with_sense(NULL, DRIVER_INVALID << 24,=0A+				=
		    0, pending_req, act);=0A+			=
continue;=0A+		}=0A+=0A+		if (act =3D=3D VSCSIIF_ACT_=
SCSI_SG_PRESET) {=0A+			latch_segments(pending_req, (void =
*)ring_req);=0A+			info->preq =3D pending_req;=0A+		=
	scsiback_do_resp_with_sense(NULL, 0, 0,=0A+				=
		    pending_req, act);=0A+			=
continue;=0A+		}=0A+=0A 		err =3D prepare_pending_req=
s(info, ring_req,=0A 						pending_req=
);=0A 		if (err =3D=3D -EINVAL) {=0A 			scsiback_do=
_resp_with_sense(NULL, (DRIVER_ERROR << 24),=0A-				=
0, pending_req);=0A+						    0, =
pending_req, act);=0A 			continue;=0A 		} else if =
(err =3D=3D -ENODEV) {=0A 			scsiback_do_resp_with_sense=
(NULL, (DID_NO_CONNECT << 16),=0A-				0, =
pending_req);=0A+						    0, =
pending_req, act);=0A 			continue;=0A 		}=0A =0A-	=
	if (pending_req->act =3D=3D VSCSIIF_ACT_SCSI_CDB) {=0A-=0A+		=
if (act =3D=3D VSCSIIF_ACT_SCSI_CDB) {=0A 			/* The =
Host mode is through as for Emulation. */=0A 			if =
(info->feature =3D=3D VSCSI_TYPE_HOST)=0A 				=
scsiback_cmd_exec(pending_req);=0A 			else=0A 		=
		scsiback_req_emulation_or_cmdexec(pending_req);=0A =0A-		=
} else if (pending_req->act =3D=3D VSCSIIF_ACT_SCSI_RESET) {=0A+		=
} else if (act =3D=3D VSCSIIF_ACT_SCSI_RESET) {=0A 			=
scsiback_device_reset_exec(pending_req);=0A 		} else {=0A 		=
	pr_err("scsiback: invalid parameter for request\n");=0A 		=
	scsiback_do_resp_with_sense(NULL, (DRIVER_ERROR << 24),=0A-		=
		0, pending_req);=0A+						=
    0, pending_req, act);=0A 			continue;=0A 		=
}=0A 	}=0A@@ -673,17 +733,32 @@ static int __init scsiback_init(void)=0A =
	if (!is_running_on_xen())=0A 		return -ENODEV;=0A =0A-	=
mmap_pages =3D vscsiif_reqs * VSCSIIF_SG_TABLESIZE;=0A+	if (vscsiif_segs < =
VSCSIIF_SG_TABLESIZE)=0A+		vscsiif_segs =3D VSCSIIF_SG_TABLESI=
ZE;=0A+	if (vscsiif_segs !=3D (uint8_t)vscsiif_segs)=0A+		=
return -EINVAL;=0A+	mmap_pages =3D vscsiif_reqs * vscsiif_segs;=0A =0A =
	pending_reqs          =3D kzalloc(sizeof(pending_reqs[0]) *=0A 		=
			vscsiif_reqs, GFP_KERNEL);=0A+	if (!pending_reqs)=
=0A+		return -ENOMEM;=0A 	pending_grant_handles =3D =
kmalloc(sizeof(pending_grant_handles[0]) *=0A 					=
mmap_pages, GFP_KERNEL);=0A 	pending_pages         =3D alloc_empty_pages=
_and_pagevec(mmap_pages);=0A =0A-	if (!pending_reqs || !pending_grant=
_handles || !pending_pages)=0A+	if (!pending_grant_handles || !pending_page=
s)=0A 		goto out_of_memory;=0A =0A+	for (i =3D 0; i < =
vscsiif_reqs; ++i) {=0A+		pending_reqs[i].gref =3D kcalloc(si=
zeof(*pending_reqs->gref),=0A+					       =
vscsiif_segs, GFP_KERNEL);=0A+		pending_reqs[i].segs =3D kcalloc(si=
zeof(*pending_reqs->segs),=0A+					       =
vscsiif_segs, GFP_KERNEL);=0A+		if (!pending_reqs[i].gref || =
!pending_reqs[i].segs)=0A+			goto out_of_memory;=0A+	=
}=0A+=0A 	for (i =3D 0; i < mmap_pages; i++)=0A 		pending_gra=
nt_handles[i] =3D SCSIBACK_INVALID_HANDLE;=0A =0A@@ -705,6 +780,10 @@ =
static int __init scsiback_init(void)=0A out_interface:=0A 	scsiback_in=
terface_exit();=0A out_of_memory:=0A+	for (i =3D 0; i < vscsiif_reqs; =
++i) {=0A+		kfree(pending_reqs[i].gref);=0A+		=
kfree(pending_reqs[i].segs);=0A+	}=0A 	kfree(pending_reqs);=0A 	=
kfree(pending_grant_handles);=0A 	free_empty_pages_and_pagevec(pendin=
g_pages, mmap_pages);=0A@@ -715,12 +794,17 @@ out_of_memory:=0A #if 0=0A =
static void __exit scsiback_exit(void)=0A {=0A+	unsigned int i;=0A+=0A 	=
scsiback_xenbus_unregister();=0A 	scsiback_interface_exit();=0A+	=
for (i =3D 0; i < vscsiif_reqs; ++i) {=0A+		kfree(pending_reqs[=
i].gref);=0A+		kfree(pending_reqs[i].segs);=0A+	}=0A 	=
kfree(pending_reqs);=0A 	kfree(pending_grant_handles);=0A-	=
free_empty_pages_and_pagevec(pending_pages, (vscsiif_reqs * VSCSIIF_SG_TABL=
ESIZE));=0A-=0A+	free_empty_pages_and_pagevec(pending_pages, =
vscsiif_reqs * vscsiif_segs);=0A }=0A #endif=0A =0A--- sle11sp3.orig/driver=
s/xen/scsiback/xenbus.c	2011-06-30 17:04:59.000000000 +0200=0A+++ =
sle11sp3/drivers/xen/scsiback/xenbus.c	2012-11-13 14:36:16.000000000 =
+0100=0A@@ -339,6 +339,13 @@ static int scsiback_probe(struct xenbus_=0A 	=
if (val)=0A 		be->info->feature =3D VSCSI_TYPE_HOST;=0A =0A+	if =
(vscsiif_segs > VSCSIIF_SG_TABLESIZE) {=0A+		err =3D xenbus_prin=
tf(XBT_NIL, dev->nodename, "segs-per-req",=0A+				   =
 "%u", vscsiif_segs);=0A+		if (err)=0A+			=
xenbus_dev_error(dev, err, "writing segs-per-req");=0A+	}=0A+=0A 	=
err =3D xenbus_switch_state(dev, XenbusStateInitWait);=0A 	if =
(err)=0A 		goto fail;=0A--- sle11sp3.orig/drivers/xen/scsifron=
t/common.h	2011-01-31 17:29:16.000000000 +0100=0A+++ sle11sp3/drivers/=
xen/scsifront/common.h	2012-11-22 13:45:50.000000000 +0100=0A@@ -95,7 =
+95,7 @@ struct vscsifrnt_shadow {=0A =0A 	/* requested struct =
scsi_cmnd is stored from kernel */=0A 	unsigned long req_scsi_cmnd;=0A-	=
int gref[VSCSIIF_SG_TABLESIZE];=0A+	int gref[SG_ALL];=0A };=0A =0A =
struct vscsifrnt_info {=0A@@ -110,7 +110,6 @@ struct vscsifrnt_info {=0A =
=0A 	grant_ref_t ring_ref;=0A 	struct vscsiif_front_ring =
ring;=0A-	struct vscsiif_response	ring_res;=0A =0A 	struct =
vscsifrnt_shadow shadow[VSCSIIF_MAX_REQS];=0A 	uint32_t shadow_free;=0A@@ =
-119,6 +118,12 @@ struct vscsifrnt_info {=0A 	wait_queue_head_t wq;=0A 	=
unsigned int waiting_resp;=0A =0A+	struct {=0A+		struct =
scsi_cmnd *sc;=0A+		unsigned int rqid;=0A+		unsigned =
int done;=0A+		vscsiif_segment_t segs[];=0A+	} active;=0A };=0A =
=0A #define DPRINTK(_f, _a...)				\=0A--- sle11sp3.or=
ig/drivers/xen/scsifront/scsifront.c	2011-06-28 18:57:14.000000000 =
+0200=0A+++ sle11sp3/drivers/xen/scsifront/scsifront.c	2012-11-22 =
16:37:35.000000000 +0100=0A@@ -106,6 +106,66 @@ irqreturn_t scsifront_intr(=
int irq, void=0A 	return IRQ_HANDLED;=0A }=0A =0A+static bool =
push_cmd_to_ring(struct vscsifrnt_info *info,=0A+			   =
  vscsiif_request_t *ring_req)=0A+{=0A+	unsigned int left, rqid =3D =
info->active.rqid;=0A+	struct scsi_cmnd *sc;=0A+=0A+	for (; ; ring_req =
=3D NULL) {=0A+		struct vscsiif_sg_list *sgl;=0A+=0A+		if =
(!ring_req) {=0A+			struct vscsiif_front_ring *ring =
=3D &info->ring;=0A+=0A+			ring_req =3D RING_GET_REQUE=
ST(ring, ring->req_prod_pvt);=0A+			ring->req_prod_pvt+=
+;=0A+			ring_req->rqid =3D rqid;=0A+		}=0A+=0A+	=
	left =3D info->shadow[rqid].nr_segments - info->active.done;=0A+	=
	if (left <=3D VSCSIIF_SG_TABLESIZE)=0A+			break;=0A+=
=0A+		sgl =3D (void *)ring_req;=0A+		sgl->act =3D =
VSCSIIF_ACT_SCSI_SG_PRESET;=0A+=0A+		if (left > VSCSIIF_SG_LIST_=
SIZE)=0A+			left =3D VSCSIIF_SG_LIST_SIZE;=0A+		=
memcpy(sgl->seg, info->active.segs + info->active.done,=0A+		   =
    left * sizeof(*sgl->seg));=0A+=0A+		sgl->nr_segments =3D =
left;=0A+		info->active.done +=3D left;=0A+=0A+		if =
(RING_FULL(&info->ring))=0A+			return false;=0A+	=
}=0A+=0A+	sc =3D info->active.sc;=0A+=0A+	ring_req->act     =3D =
VSCSIIF_ACT_SCSI_CDB;=0A+	ring_req->id      =3D sc->device->id;=0A+	=
ring_req->lun     =3D sc->device->lun;=0A+	ring_req->channel =3D =
sc->device->channel;=0A+	ring_req->cmd_len =3D sc->cmd_len;=0A+=0A+	=
if ( sc->cmd_len )=0A+		memcpy(ring_req->cmnd, sc->cmnd, sc->cmd_le=
n);=0A+	else=0A+		memset(ring_req->cmnd, 0, VSCSIIF_MAX_COMMA=
ND_SIZE);=0A+=0A+	ring_req->sc_data_direction   =3D sc->sc_data_direc=
tion;=0A+	ring_req->timeout_per_command =3D sc->request->timeout / =
HZ;=0A+	ring_req->nr_segments         =3D left;=0A+=0A+	memcpy(ring_req->se=
g, info->active.segs + info->active.done,=0A+               left * =
sizeof(*ring_req->seg));=0A+=0A+	info->active.sc =3D NULL;=0A+=0A+	=
return !RING_FULL(&info->ring);=0A+}=0A =0A static void scsifront_gnttab_do=
ne(struct vscsifrnt_shadow *s, uint32_t id)=0A {=0A@@ -194,6 +254,16 @@ =
int scsifront_cmd_done(struct vscsifrnt_=0A 		=0A 		=
ring_res =3D RING_GET_RESPONSE(&info->ring, i);=0A =0A+		if =
(info->host->sg_tablesize > VSCSIIF_SG_TABLESIZE) {=0A+			u8 =
act =3D ring_res->act;=0A+=0A+			if (act =3D=3D VSCSIIF_ACT_=
SCSI_SG_PRESET)=0A+				continue;=0A+			=
if (act !=3D info->shadow[ring_res->rqid].act)=0A+				=
DPRINTK("Bogus backend response (%02x vs %02x)\n",=0A+				=
	act, info->shadow[ring_res->rqid].act);=0A+		}=0A+=0A 	=
	if (info->shadow[ring_res->rqid].act =3D=3D VSCSIIF_ACT_SCSI_CDB)=
=0A 			scsifront_cdb_cmd_done(info, ring_res);=0A 		=
else=0A@@ -208,8 +278,16 @@ int scsifront_cmd_done(struct vscsifrnt_=0A 	=
	info->ring.sring->rsp_event =3D i + 1;=0A 	}=0A =0A-	=
spin_unlock_irqrestore(&info->io_lock, flags);=0A+	spin_unlock(&info->=
io_lock);=0A+=0A+	spin_lock(info->host->host_lock);=0A+=0A+	if =
(info->active.sc && !RING_FULL(&info->ring)) {=0A+		push_cmd_to=
_ring(info, NULL);=0A+		scsifront_do_request(info);=0A+	}=0A =0A+	=
spin_unlock_irqrestore(info->host->host_lock, flags);=0A =0A 	/* Yield =
point for this unbounded loop. */=0A 	cond_resched();=0A@@ -242,7 +320,8 =
@@ int scsifront_schedule(void *data)=0A =0A =0A static int map_data_for_re=
quest(struct vscsifrnt_info *info,=0A-		struct scsi_cmnd *sc, =
vscsiif_request_t *ring_req, uint32_t id)=0A+				=
struct scsi_cmnd *sc,=0A+				struct vscsifrnt_sh=
adow *shadow)=0A {=0A 	grant_ref_t gref_head;=0A 	struct page =
*page;=0A@@ -254,7 +333,7 @@ static int map_data_for_request(struct v=0A 	=
if (sc->sc_data_direction =3D=3D DMA_NONE)=0A 		return 0;=0A =0A-	=
err =3D gnttab_alloc_grant_references(VSCSIIF_SG_TABLESIZE, &gref_head);=0A=
+	err =3D gnttab_alloc_grant_references(info->host->sg_tablesize, =
&gref_head);=0A 	if (err) {=0A 		pr_err("scsifront: =
gnttab_alloc_grant_references() error\n");=0A 		return -ENOMEM;=0A@=
@ -266,7 +345,7 @@ static int map_data_for_request(struct v=0A 		=
unsigned int data_len =3D scsi_bufflen(sc);=0A =0A 		nr_pages =
=3D (data_len + sgl->offset + PAGE_SIZE - 1) >> PAGE_SHIFT;=0A-		if =
(nr_pages > VSCSIIF_SG_TABLESIZE) {=0A+		if (nr_pages > info->host->=
sg_tablesize) {=0A 			pr_err("scsifront: Unable to map =
request_buffer for command!\n");=0A 			ref_cnt =3D =
(-E2BIG);=0A 			goto big_to_sg;=0A@@ -294,10 +373,10 @@ =
static int map_data_for_request(struct v=0A 				=
gnttab_grant_foreign_access_ref(ref, info->dev->otherend_id,=0A 		=
			buffer_pfn, write);=0A =0A-				=
info->shadow[id].gref[ref_cnt]  =3D ref;=0A-				=
ring_req->seg[ref_cnt].gref     =3D ref;=0A-				=
ring_req->seg[ref_cnt].offset   =3D (uint16_t)off;=0A-				=
ring_req->seg[ref_cnt].length   =3D (uint16_t)bytes;=0A+			=
	shadow->gref[ref_cnt] =3D ref;=0A+				=
info->active.segs[ref_cnt].gref   =3D ref;=0A+				=
info->active.segs[ref_cnt].offset =3D off;=0A+				=
info->active.segs[ref_cnt].length =3D bytes;=0A =0A 				=
buffer_pfn++;=0A 				len -=3D bytes;=0A@@ =
-336,34 +415,27 @@ static int scsifront_queuecommand(struct=0A 		=
return SCSI_MLQUEUE_HOST_BUSY;=0A 	}=0A =0A+	if (info->active.sc=
 && !push_cmd_to_ring(info, NULL)) {=0A+		scsifront_do_reques=
t(info);=0A+		spin_unlock_irqrestore(shost->host_lock, flags);=0A=
+		return SCSI_MLQUEUE_HOST_BUSY;=0A+	}=0A+=0A 	=
sc->result    =3D 0;=0A =0A 	ring_req          =3D scsifront_pre_request=
(info);=0A 	rqid              =3D ring_req->rqid;=0A-	ring_req->a=
ct     =3D VSCSIIF_ACT_SCSI_CDB;=0A-=0A-	ring_req->id      =3D =
sc->device->id;=0A-	ring_req->lun     =3D sc->device->lun;=0A-	=
ring_req->channel =3D sc->device->channel;=0A-	ring_req->cmd_len =3D =
sc->cmd_len;=0A =0A 	BUG_ON(sc->cmd_len > VSCSIIF_MAX_COMMAND_SIZE);=0A =
=0A-	if ( sc->cmd_len )=0A-		memcpy(ring_req->cmnd, sc->cmnd, =
sc->cmd_len);=0A-	else=0A-		memset(ring_req->cmnd, 0, =
VSCSIIF_MAX_COMMAND_SIZE);=0A-=0A-	ring_req->sc_data_direction   =3D =
(uint8_t)sc->sc_data_direction;=0A-	ring_req->timeout_per_command =3D =
(sc->request->timeout / HZ);=0A-=0A 	info->shadow[rqid].req_scsi_cmnd   =
  =3D (unsigned long)sc;=0A 	info->shadow[rqid].sc_data_direction =3D =
sc->sc_data_direction;=0A-	info->shadow[rqid].act               =3D =
ring_req->act;=0A+	info->shadow[rqid].act               =3D VSCSIIF_AC=
T_SCSI_CDB;=0A =0A-	ref_cnt =3D map_data_for_request(info, sc, =
ring_req, rqid);=0A+	ref_cnt =3D map_data_for_request(info, sc, =
&info->shadow[rqid]);=0A 	if (ref_cnt < 0) {=0A 		add_id_to_f=
reelist(info, rqid);=0A+		scsifront_do_request(info);=0A 		=
spin_unlock_irqrestore(shost->host_lock, flags);=0A 		if =
(ref_cnt =3D=3D (-ENOMEM))=0A 			return SCSI_MLQUEUE_HOST_BU=
SY;=0A@@ -372,9 +444,13 @@ static int scsifront_queuecommand(struct=0A 		=
return 0;=0A 	}=0A =0A-	ring_req->nr_segments          =3D =
(uint8_t)ref_cnt;=0A 	info->shadow[rqid].nr_segments =3D ref_cnt;=0A =
=0A+	info->active.sc  =3D sc;=0A+	info->active.rqid =3D rqid;=0A+	=
info->active.done =3D 0;=0A+	push_cmd_to_ring(info, ring_req);=0A+=0A 	=
scsifront_do_request(info);=0A 	spin_unlock_irqrestore(shost->host_lock, =
flags);=0A =0A--- sle11sp3.orig/drivers/xen/scsifront/xenbus.c	2012-10-02 =
14:32:45.000000000 +0200=0A+++ sle11sp3/drivers/xen/scsifront/xenbus.c	=
2012-11-21 13:35:47.000000000 +0100=0A@@ -43,6 +43,10 @@=0A   #define =
DEFAULT_TASK_COMM_LEN	TASK_COMM_LEN=0A #endif=0A =0A+static unsigned int =
max_nr_segs =3D VSCSIIF_SG_TABLESIZE;=0A+module_param_named(max_segs, =
max_nr_segs, uint, 0);=0A+MODULE_PARM_DESC(max_segs, "Maximum number of =
segments per request");=0A+=0A extern struct scsi_host_template scsifront_s=
ht;=0A =0A static void scsifront_free(struct vscsifrnt_info *info)=0A@@ =
-181,7 +185,9 @@ static int scsifront_probe(struct xenbus=0A 	int i, err =
=3D -ENOMEM;=0A 	char name[DEFAULT_TASK_COMM_LEN];=0A =0A-	=
host =3D scsi_host_alloc(&scsifront_sht, sizeof(*info));=0A+	host =3D =
scsi_host_alloc(&scsifront_sht,=0A+			       offsetof(str=
uct vscsifrnt_info,=0A+					active.segs[max_nr_=
segs]));=0A 	if (!host) {=0A 		xenbus_dev_fatal(dev, err, =
"fail to allocate scsi host");=0A 		return err;=0A@@ -223,7 =
+229,7 @@ static int scsifront_probe(struct xenbus=0A 	host->max_id      =
=3D VSCSIIF_MAX_TARGET;=0A 	host->max_channel =3D 0;=0A 	host->max_l=
un     =3D VSCSIIF_MAX_LUN;=0A-	host->max_sectors =3D (VSCSIIF_SG_TABLESIZE=
 - 1) * PAGE_SIZE / 512;=0A+	host->max_sectors =3D (host->sg_tablesize =
- 1) * PAGE_SIZE / 512;=0A 	host->max_cmd_len =3D VSCSIIF_MAX_COMMAND_S=
IZE;=0A =0A 	err =3D scsi_add_host(host, &dev->dev);=0A@@ -278,6 =
+284,23 @@ static int scsifront_disconnect(struct v=0A 	return 0;=0A }=0A =
=0A+static void scsifront_read_backend_params(struct xenbus_device =
*dev,=0A+					  struct vscsifrnt_info =
*info)=0A+{=0A+	unsigned int nr_segs;=0A+	int ret;=0A+	struct =
Scsi_Host *host =3D info->host;=0A+=0A+	ret =3D xenbus_scanf(XBT_NIL, =
dev->otherend, "segs-per-req", "%u",=0A+			   =
&nr_segs);=0A+	if (ret =3D=3D 1 && nr_segs > host->sg_tablesize) {=0A+		=
host->sg_tablesize =3D min(nr_segs, max_nr_segs);=0A+		dev_info(&d=
ev->dev, "using up to %d SG entries\n",=0A+			 host->sg_t=
ablesize);=0A+		host->max_sectors =3D (host->sg_tablesize - 1) * =
PAGE_SIZE / 512;=0A+	}=0A+}=0A+=0A #define VSCSIFRONT_OP_ADD_LUN	=
1=0A #define VSCSIFRONT_OP_DEL_LUN	2=0A =0A@@ -368,6 +391,7 @@ static =
void scsifront_backend_changed(st=0A 		break;=0A =0A 	case =
XenbusStateConnected:=0A+		scsifront_read_backend_params(dev, =
info);=0A 		if (xenbus_read_driver_state(dev->nodename) =
=3D=3D=0A 			XenbusStateInitialised) {=0A 			=
scsifront_do_lun_hotplug(info, VSCSIFRONT_OP_ADD_LUN);=0A@@ -413,8 +437,13 =
@@ static DEFINE_XENBUS_DRIVER(scsifront, ,=0A 	.otherend_changed	=
=3D scsifront_backend_changed,=0A );=0A =0A-int scsifront_xenbus_init(void)=
=0A+int __init scsifront_xenbus_init(void)=0A {=0A+	if (max_nr_segs > =
SG_ALL)=0A+		max_nr_segs =3D SG_ALL;=0A+	if (max_nr_segs < =
VSCSIIF_SG_TABLESIZE)=0A+		max_nr_segs =3D VSCSIIF_SG_TABLESIZ=
E;=0A+=0A 	return xenbus_register_frontend(&scsifront_driver);=0A =
}=0A =0A--- sle11sp3.orig/include/xen/interface/io/vscsiif.h	2008-07-21 =
11:00:33.000000000 +0200=0A+++ sle11sp3/include/xen/interface/io/vscsiif.h	=
2012-11-22 14:32:31.000000000 +0100=0A@@ -34,6 +34,7 @@=0A #define =
VSCSIIF_ACT_SCSI_CDB         1    /* SCSI CDB command */=0A #define =
VSCSIIF_ACT_SCSI_ABORT       2    /* SCSI Device(Lun) Abort*/=0A #define =
VSCSIIF_ACT_SCSI_RESET       3    /* SCSI Device(Lun) Reset*/=0A+#define =
VSCSIIF_ACT_SCSI_SG_PRESET   4    /* Preset SG elements */=0A =0A =0A =
#define VSCSIIF_BACK_MAX_PENDING_REQS    128=0A@@ -53,6 +54,12 @@=0A =
#define VSCSIIF_MAX_COMMAND_SIZE         16=0A #define VSCSIIF_SENSE_BUFFER=
SIZE         96=0A =0A+struct scsiif_request_segment {=0A+    grant_ref_t =
gref;=0A+    uint16_t offset;=0A+    uint16_t length;=0A+};=0A+typedef =
struct scsiif_request_segment vscsiif_segment_t;=0A =0A struct vscsiif_requ=
est {=0A     uint16_t rqid;          /* private guest value, echoed in =
resp  */=0A@@ -69,18 +76,26 @@ struct vscsiif_request {=0A                 =
                         DMA_NONE(3) requests  */=0A     uint8_t nr_segment=
s;              /* Number of pieces of scatter-gather */=0A =0A-    struct =
scsiif_request_segment {=0A-        grant_ref_t gref;=0A-        uint16_t =
offset;=0A-        uint16_t length;=0A-    } seg[VSCSIIF_SG_TABLESIZE];=0A+=
    vscsiif_segment_t seg[VSCSIIF_SG_TABLESIZE];=0A     uint32_t reserved[3=
];=0A };=0A typedef struct vscsiif_request vscsiif_request_t;=0A =0A+#defin=
e VSCSIIF_SG_LIST_SIZE ((sizeof(vscsiif_request_t) - 4) \=0A+              =
                / sizeof(vscsiif_segment_t))=0A+=0A+struct vscsiif_sg_list =
{=0A+    /* First two fields must match struct vscsiif_request! */=0A+    =
uint16_t rqid;          /* private guest value, must match main req */=0A+ =
   uint8_t act;            /* VSCSIIF_ACT_SCSI_SG_PRESET */=0A+    uint8_t =
nr_segments;    /* Number of pieces of scatter-gather */=0A+    vscsiif_seg=
ment_t seg[VSCSIIF_SG_LIST_SIZE];=0A+};=0A+typedef struct vscsiif_sg_list =
vscsiif_sg_list_t;=0A+=0A struct vscsiif_response {=0A     uint16_t =
rqid;=0A-    uint8_t padding;=0A+    uint8_t act;               /* valid =
only when backend supports SG_PRESET */=0A     uint8_t sense_len;=0A     =
uint8_t sense_buffer[VSCSIIF_SENSE_BUFFERSIZE];=0A     int32_t rslt;=0A
--=__PartC2F32BEB.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.xen.org
http://lists.xen.org/xen-devel

--=__PartC2F32BEB.0__=--


From xen-devel-bounces@lists.xen.org Tue Nov 27 11:38:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:38:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJUW-0003Cc-Mm; Tue, 27 Nov 2012 11:38:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdJUU-0003CU-9b
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:38:14 +0000
Received: from [85.158.137.99:12763] by server-6.bemta-3.messagelabs.com id
	85/9D-28265-526A4B05; Tue, 27 Nov 2012 11:38:13 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354016292!17643484!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10915 invoked from network); 27 Nov 2012 11:38:13 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 11:38:13 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 11:38:12 +0000
Message-Id: <50B4B46B02000078000ABA1C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 11:39:07 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<CAOqnZH4qVRoDCpaCGT3zuJu85t17XkuUJSoxBoMhXd95p9b5tg@mail.gmail.com>
	<1354013546.5830.182.camel@zakaz.uk.xensource.com>
	<50B4AAC702000078000AB988@nat28.tlf.novell.com>
	<1354014281.5830.193.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354014281.5830.193.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Lars Kurth <lars.kurth.xen@gmail.com>, "Keir\(Xen.org\)" <keir@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 27.11.12 at 12:04, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> We could at least include a reference in unstable to the stable backport
> docs, even if we don't list specific maintainers.

Yes, that we should do.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:38:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:38:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJUW-0003Cc-Mm; Tue, 27 Nov 2012 11:38:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdJUU-0003CU-9b
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:38:14 +0000
Received: from [85.158.137.99:12763] by server-6.bemta-3.messagelabs.com id
	85/9D-28265-526A4B05; Tue, 27 Nov 2012 11:38:13 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354016292!17643484!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10915 invoked from network); 27 Nov 2012 11:38:13 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 11:38:13 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 11:38:12 +0000
Message-Id: <50B4B46B02000078000ABA1C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 11:39:07 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<CAOqnZH4qVRoDCpaCGT3zuJu85t17XkuUJSoxBoMhXd95p9b5tg@mail.gmail.com>
	<1354013546.5830.182.camel@zakaz.uk.xensource.com>
	<50B4AAC702000078000AB988@nat28.tlf.novell.com>
	<1354014281.5830.193.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354014281.5830.193.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Lars Kurth <lars.kurth.xen@gmail.com>, "Keir\(Xen.org\)" <keir@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 27.11.12 at 12:04, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> We could at least include a reference in unstable to the stable backport
> docs, even if we don't list specific maintainers.

Yes, that we should do.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:40:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:40:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJW9-0003M4-6s; Tue, 27 Nov 2012 11:39:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdJW7-0003Ls-JC
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:39:55 +0000
Received: from [85.158.138.51:9956] by server-10.bemta-3.messagelabs.com id
	1D/A1-19806-A86A4B05; Tue, 27 Nov 2012 11:39:54 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1354016394!28120621!1
X-Originating-IP: [192.134.164.82]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7879 invoked from network); 27 Nov 2012 11:39:54 -0000
Received: from mail1-relais-roc.national.inria.fr (HELO
	mail1-relais-roc.national.inria.fr) (192.134.164.82)
	by server-2.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:39:54 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352070000"; d="scan'208";a="183421171"
Received: from unknown (HELO type.ipv6) ([193.50.110.127])
	by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	27 Nov 2012 12:39:53 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdJW5-0003mP-HD; Tue, 27 Nov 2012 12:39:53 +0100
Date: Tue, 27 Nov 2012 12:39:53 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121127113953.GB5956@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"Keir (Xen.org)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
	<29138c27eb72e5602751.1353947050@andrewcoop.uk.xensource.com>
	<20121126214212.GL7556@type.youpi.perso.aquilenet.fr>
	<1354016079.17985.8.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354016079.17985.8.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 4] minios/console: console_input() weak
 reference
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell, le Tue 27 Nov 2012 11:34:39 +0000, a =E9crit :
> On Mon, 2012-11-26 at 21:42 +0000, Samuel Thibault wrote:
> > Andrew Cooper, le Mon 26 Nov 2012 16:24:10 +0000, a =E9crit :
> > > In exactly the same style as app_main() in kernel.c, create a weak
> > > reference console_input() function for applications to override to
> > > quickly gain access to the console.
> > > =

> > > Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> > =

> > Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> =

> Any reason not to make xencons_rx itself the weak function?

I'd avoid exposing the pt_regs structure. Maybe we could drop the
parameter from the xencons_rx function itself indeed, it has no use.

> And by extension I suppose xencons_tx too, for parity if nothing else.

I actually wonder what the purpose of xencons_tx is.

> The existing console_input function (previously xencons_rx) is pretty
> odd, it relies on something reusing a tx buffer for rx?

? I don't see what you are referring to.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:40:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:40:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJW9-0003M4-6s; Tue, 27 Nov 2012 11:39:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdJW7-0003Ls-JC
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:39:55 +0000
Received: from [85.158.138.51:9956] by server-10.bemta-3.messagelabs.com id
	1D/A1-19806-A86A4B05; Tue, 27 Nov 2012 11:39:54 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1354016394!28120621!1
X-Originating-IP: [192.134.164.82]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7879 invoked from network); 27 Nov 2012 11:39:54 -0000
Received: from mail1-relais-roc.national.inria.fr (HELO
	mail1-relais-roc.national.inria.fr) (192.134.164.82)
	by server-2.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:39:54 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352070000"; d="scan'208";a="183421171"
Received: from unknown (HELO type.ipv6) ([193.50.110.127])
	by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	27 Nov 2012 12:39:53 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdJW5-0003mP-HD; Tue, 27 Nov 2012 12:39:53 +0100
Date: Tue, 27 Nov 2012 12:39:53 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121127113953.GB5956@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"Keir (Xen.org)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
	<29138c27eb72e5602751.1353947050@andrewcoop.uk.xensource.com>
	<20121126214212.GL7556@type.youpi.perso.aquilenet.fr>
	<1354016079.17985.8.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354016079.17985.8.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 4] minios/console: console_input() weak
 reference
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell, le Tue 27 Nov 2012 11:34:39 +0000, a =E9crit :
> On Mon, 2012-11-26 at 21:42 +0000, Samuel Thibault wrote:
> > Andrew Cooper, le Mon 26 Nov 2012 16:24:10 +0000, a =E9crit :
> > > In exactly the same style as app_main() in kernel.c, create a weak
> > > reference console_input() function for applications to override to
> > > quickly gain access to the console.
> > > =

> > > Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> > =

> > Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> =

> Any reason not to make xencons_rx itself the weak function?

I'd avoid exposing the pt_regs structure. Maybe we could drop the
parameter from the xencons_rx function itself indeed, it has no use.

> And by extension I suppose xencons_tx too, for parity if nothing else.

I actually wonder what the purpose of xencons_tx is.

> The existing console_input function (previously xencons_rx) is pretty
> odd, it relies on something reusing a tx buffer for rx?

? I don't see what you are referring to.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:44:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:44:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJaV-0003dL-Tv; Tue, 27 Nov 2012 11:44:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdJaU-0003dD-62
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 11:44:26 +0000
Received: from [85.158.137.99:63442] by server-13.bemta-3.messagelabs.com id
	54/30-24887-997A4B05; Tue, 27 Nov 2012 11:44:25 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1354016662!20796276!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16834 invoked from network); 27 Nov 2012 11:44:22 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:44:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16021470"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:44:09 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 11:44:09 +0000
Message-ID: <1354016648.17985.13.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Tue, 27 Nov 2012 11:44:08 +0000
In-Reply-To: <85552b648b3cabebd4f5.1353686197@elijah>
References: <85552b648b3cabebd4f5.1353686197@elijah>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Make an internal function explicitly
 check existence of expected paths
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 15:56 +0000, George Dunlap wrote:
> +        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
> +                   "Internal error: Missing xenstore node %s/removable", be_path);

One or two of these new log lines are > 80 columns. You might find that
using the shorthand LOG*() macros helps with this.

Personally I don't think the "Internal error" tag is necessary either,
but maybe a new return code ERROR_INTERNAL might make sense? or even an
assert() if this is really a "libxl failed to maintain internal
consistency" ?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:44:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:44:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJaV-0003dL-Tv; Tue, 27 Nov 2012 11:44:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdJaU-0003dD-62
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 11:44:26 +0000
Received: from [85.158.137.99:63442] by server-13.bemta-3.messagelabs.com id
	54/30-24887-997A4B05; Tue, 27 Nov 2012 11:44:25 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1354016662!20796276!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16834 invoked from network); 27 Nov 2012 11:44:22 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:44:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16021470"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:44:09 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 11:44:09 +0000
Message-ID: <1354016648.17985.13.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Tue, 27 Nov 2012 11:44:08 +0000
In-Reply-To: <85552b648b3cabebd4f5.1353686197@elijah>
References: <85552b648b3cabebd4f5.1353686197@elijah>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Make an internal function explicitly
 check existence of expected paths
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 15:56 +0000, George Dunlap wrote:
> +        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
> +                   "Internal error: Missing xenstore node %s/removable", be_path);

One or two of these new log lines are > 80 columns. You might find that
using the shorthand LOG*() macros helps with this.

Personally I don't think the "Internal error" tag is necessary either,
but maybe a new return code ERROR_INTERNAL might make sense? or even an
assert() if this is really a "libxl failed to maintain internal
consistency" ?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:47:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:47:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJd6-0003l6-Gw; Tue, 27 Nov 2012 11:47:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdJd4-0003kv-LP
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:47:06 +0000
Received: from [85.158.139.211:49721] by server-4.bemta-5.messagelabs.com id
	07/AF-15011-938A4B05; Tue, 27 Nov 2012 11:47:05 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1354016808!17991339!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5554 invoked from network); 27 Nov 2012 11:46:48 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:46:48 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16021544"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:46:42 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 11:46:42 +0000
Message-ID: <1354016801.17985.16.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Tue, 27 Nov 2012 11:46:41 +0000
In-Reply-To: <20121127113953.GB5956@type.bordeaux.inria.fr>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
	<29138c27eb72e5602751.1353947050@andrewcoop.uk.xensource.com>
	<20121126214212.GL7556@type.youpi.perso.aquilenet.fr>
	<1354016079.17985.8.camel@zakaz.uk.xensource.com>
	<20121127113953.GB5956@type.bordeaux.inria.fr>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 4] minios/console: console_input() weak
 reference
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVHVlLCAyMDEyLTExLTI3IGF0IDExOjM5ICswMDAwLCBTYW11ZWwgVGhpYmF1bHQgd3JvdGU6
Cj4gSWFuIENhbXBiZWxsLCBsZSBUdWUgMjcgTm92IDIwMTIgMTE6MzQ6MzkgKzAwMDAsIGEgw6lj
cml0IDoKPiA+IE9uIE1vbiwgMjAxMi0xMS0yNiBhdCAyMTo0MiArMDAwMCwgU2FtdWVsIFRoaWJh
dWx0IHdyb3RlOgo+ID4gPiBBbmRyZXcgQ29vcGVyLCBsZSBNb24gMjYgTm92IDIwMTIgMTY6MjQ6
MTAgKzAwMDAsIGEgw6ljcml0IDoKPiA+ID4gPiBJbiBleGFjdGx5IHRoZSBzYW1lIHN0eWxlIGFz
IGFwcF9tYWluKCkgaW4ga2VybmVsLmMsIGNyZWF0ZSBhIHdlYWsKPiA+ID4gPiByZWZlcmVuY2Ug
Y29uc29sZV9pbnB1dCgpIGZ1bmN0aW9uIGZvciBhcHBsaWNhdGlvbnMgdG8gb3ZlcnJpZGUgdG8K
PiA+ID4gPiBxdWlja2x5IGdhaW4gYWNjZXNzIHRvIHRoZSBjb25zb2xlLgo+ID4gPiA+IAo+ID4g
PiA+IFNpZ25lZC1vZmYtYnk6IEFuZHJldyBDb29wZXIgPGFuZHJldy5jb29wZXIzQGNpdHJpeC5j
b20+Cj4gPiA+IAo+ID4gPiBBY2tlZC1ieTogU2FtdWVsIFRoaWJhdWx0IDxzYW11ZWwudGhpYmF1
bHRAZW5zLWx5b24ub3JnPgo+ID4gCj4gPiBBbnkgcmVhc29uIG5vdCB0byBtYWtlIHhlbmNvbnNf
cnggaXRzZWxmIHR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aHQgdG8g
YmUgYW4gb3V0cHV0CmJ1ZmZlciwgbm90IGlucHV0KSB3aGlsZSB4ZW5jb25zX3R4IGp1c3Qgc2F5
cyAvKiBEbyBub3RoaW5nLCBoYW5kbGVkIGJ5Cl9yeCAqLy4KCgo+IAo+IFNhbXVlbAoKCgpfX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwgbWFp
bGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hl
bi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:47:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:47:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJd6-0003l6-Gw; Tue, 27 Nov 2012 11:47:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdJd4-0003kv-LP
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:47:06 +0000
Received: from [85.158.139.211:49721] by server-4.bemta-5.messagelabs.com id
	07/AF-15011-938A4B05; Tue, 27 Nov 2012 11:47:05 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1354016808!17991339!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5554 invoked from network); 27 Nov 2012 11:46:48 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:46:48 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16021544"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:46:42 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 11:46:42 +0000
Message-ID: <1354016801.17985.16.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Tue, 27 Nov 2012 11:46:41 +0000
In-Reply-To: <20121127113953.GB5956@type.bordeaux.inria.fr>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
	<29138c27eb72e5602751.1353947050@andrewcoop.uk.xensource.com>
	<20121126214212.GL7556@type.youpi.perso.aquilenet.fr>
	<1354016079.17985.8.camel@zakaz.uk.xensource.com>
	<20121127113953.GB5956@type.bordeaux.inria.fr>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 4] minios/console: console_input() weak
 reference
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVHVlLCAyMDEyLTExLTI3IGF0IDExOjM5ICswMDAwLCBTYW11ZWwgVGhpYmF1bHQgd3JvdGU6
Cj4gSWFuIENhbXBiZWxsLCBsZSBUdWUgMjcgTm92IDIwMTIgMTE6MzQ6MzkgKzAwMDAsIGEgw6lj
cml0IDoKPiA+IE9uIE1vbiwgMjAxMi0xMS0yNiBhdCAyMTo0MiArMDAwMCwgU2FtdWVsIFRoaWJh
dWx0IHdyb3RlOgo+ID4gPiBBbmRyZXcgQ29vcGVyLCBsZSBNb24gMjYgTm92IDIwMTIgMTY6MjQ6
MTAgKzAwMDAsIGEgw6ljcml0IDoKPiA+ID4gPiBJbiBleGFjdGx5IHRoZSBzYW1lIHN0eWxlIGFz
IGFwcF9tYWluKCkgaW4ga2VybmVsLmMsIGNyZWF0ZSBhIHdlYWsKPiA+ID4gPiByZWZlcmVuY2Ug
Y29uc29sZV9pbnB1dCgpIGZ1bmN0aW9uIGZvciBhcHBsaWNhdGlvbnMgdG8gb3ZlcnJpZGUgdG8K
PiA+ID4gPiBxdWlja2x5IGdhaW4gYWNjZXNzIHRvIHRoZSBjb25zb2xlLgo+ID4gPiA+IAo+ID4g
PiA+IFNpZ25lZC1vZmYtYnk6IEFuZHJldyBDb29wZXIgPGFuZHJldy5jb29wZXIzQGNpdHJpeC5j
b20+Cj4gPiA+IAo+ID4gPiBBY2tlZC1ieTogU2FtdWVsIFRoaWJhdWx0IDxzYW11ZWwudGhpYmF1
bHRAZW5zLWx5b24ub3JnPgo+ID4gCj4gPiBBbnkgcmVhc29uIG5vdCB0byBtYWtlIHhlbmNvbnNf
cnggaXRzZWxmIHRoZSB3ZWFrIGZ1bmN0aW9uPw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CmJ1ZmZlciwgbm90IGlucHV0KSB3aGlsZSB4ZW5jb25zX3R4IGp1c3Qgc2F5
cyAvKiBEbyBub3RoaW5nLCBoYW5kbGVkIGJ5Cl9yeCAqLy4KCgo+IAo+IFNhbXVlbAoKCgpfX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwgbWFp
bGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hl
bi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:50:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:50:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJgC-0003uC-4K; Tue, 27 Nov 2012 11:50:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TdJgB-0003u6-FO
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 11:50:19 +0000
Received: from [85.158.137.99:43820] by server-11.bemta-3.messagelabs.com id
	7B/39-19361-AF8A4B05; Tue, 27 Nov 2012 11:50:18 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1354017016!17644542!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27144 invoked from network); 27 Nov 2012 11:50:18 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:50:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215579158"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:50:16 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 06:50:16 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[0.0.0.0])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TdJg7-00051d-IZ;
	Tue, 27 Nov 2012 11:50:15 +0000
Message-ID: <50B4A8F7.5050702@eu.citrix.com>
Date: Tue, 27 Nov 2012 11:50:15 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <85552b648b3cabebd4f5.1353686197@elijah>
	<1354016648.17985.13.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354016648.17985.13.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Make an internal function explicitly
 check existence of expected paths
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 27/11/12 11:44, Ian Campbell wrote:
> On Fri, 2012-11-23 at 15:56 +0000, George Dunlap wrote:
>> +        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
>> +                   "Internal error: Missing xenstore node %s/removable", be_path);
>
> One or two of these new log lines are > 80 columns. You might find that
> using the shorthand LOG*() macros helps with this.

Oops -- I'll fix that up.

>
> Personally I don't think the "Internal error" tag is necessary either,
> but maybe a new return code ERROR_INTERNAL might make sense? or even an
> assert() if this is really a "libxl failed to maintain internal
> consistency" ?

The idea behind the "Internal" tag is to tell users, "Unless you've been 
manually messing around with xenstore removing nodes, this is definitely 
not your fault."

I guess normally an ASSERT communicates that pretty well, but I guess 
I'm used to ASSERTs that disappear when DEBUG is turned off. :-)  Is 
that not the case for libxl?

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:50:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:50:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJgC-0003uC-4K; Tue, 27 Nov 2012 11:50:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TdJgB-0003u6-FO
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 11:50:19 +0000
Received: from [85.158.137.99:43820] by server-11.bemta-3.messagelabs.com id
	7B/39-19361-AF8A4B05; Tue, 27 Nov 2012 11:50:18 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1354017016!17644542!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27144 invoked from network); 27 Nov 2012 11:50:18 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:50:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215579158"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:50:16 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 06:50:16 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[0.0.0.0])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TdJg7-00051d-IZ;
	Tue, 27 Nov 2012 11:50:15 +0000
Message-ID: <50B4A8F7.5050702@eu.citrix.com>
Date: Tue, 27 Nov 2012 11:50:15 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <85552b648b3cabebd4f5.1353686197@elijah>
	<1354016648.17985.13.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354016648.17985.13.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Make an internal function explicitly
 check existence of expected paths
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 27/11/12 11:44, Ian Campbell wrote:
> On Fri, 2012-11-23 at 15:56 +0000, George Dunlap wrote:
>> +        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
>> +                   "Internal error: Missing xenstore node %s/removable", be_path);
>
> One or two of these new log lines are > 80 columns. You might find that
> using the shorthand LOG*() macros helps with this.

Oops -- I'll fix that up.

>
> Personally I don't think the "Internal error" tag is necessary either,
> but maybe a new return code ERROR_INTERNAL might make sense? or even an
> assert() if this is really a "libxl failed to maintain internal
> consistency" ?

The idea behind the "Internal" tag is to tell users, "Unless you've been 
manually messing around with xenstore removing nodes, this is definitely 
not your fault."

I guess normally an ASSERT communicates that pretty well, but I guess 
I'm used to ASSERTs that disappear when DEBUG is turned off. :-)  Is 
that not the case for libxl?

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:52:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:52:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJiC-00042I-Lg; Tue, 27 Nov 2012 11:52:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdJiA-000427-OO
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:52:22 +0000
Received: from [85.158.138.51:54487] by server-7.bemta-3.messagelabs.com id
	C8/D0-01713-579A4B05; Tue, 27 Nov 2012 11:52:21 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1354017141!31648203!1
X-Originating-IP: [192.134.164.82]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16657 invoked from network); 27 Nov 2012 11:52:21 -0000
Received: from mail1-relais-roc.national.inria.fr (HELO
	mail1-relais-roc.national.inria.fr) (192.134.164.82)
	by server-9.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:52:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352070000"; d="scan'208";a="183423399"
Received: from unknown (HELO type.ipv6) ([193.50.110.127])
	by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	27 Nov 2012 12:52:20 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdJi8-0004DW-Hq; Tue, 27 Nov 2012 12:52:20 +0100
Date: Tue, 27 Nov 2012 12:52:20 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121127115220.GG5956@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"Keir (Xen.org)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
	<29138c27eb72e5602751.1353947050@andrewcoop.uk.xensource.com>
	<20121126214212.GL7556@type.youpi.perso.aquilenet.fr>
	<1354016079.17985.8.camel@zakaz.uk.xensource.com>
	<20121127113953.GB5956@type.bordeaux.inria.fr>
	<1354016801.17985.16.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354016801.17985.16.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 4] minios/console: console_input() weak
 reference
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell, le Tue 27 Nov 2012 11:46:41 +0000, a =E9crit :
> > > And by extension I suppose xencons_tx too, for parity if nothing else.
> > =

> > I actually wonder what the purpose of xencons_tx is.
> =

> I suppose if you had a shared ring serial console you could accept
> input?

I'm afraid I still don't understand :)

> > > The existing console_input function (previously xencons_rx) is pretty
> > > odd, it relies on something reusing a tx buffer for rx?
> > =

> > ? I don't see what you are referring to.
> =

> xencons_rx says /* Just repeat what's written */ and prints the contents
> of the buffer

Yes, it echoes what was typed on the console by the user.

> (this is rx remember, so buffer ought to be an output buffer, not
> input)

Really?  It's not what I understand from console_handle_input, which
just consumes data from the ring and gives it to xencons_rx, without
emiting any.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:52:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:52:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJiC-00042I-Lg; Tue, 27 Nov 2012 11:52:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdJiA-000427-OO
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:52:22 +0000
Received: from [85.158.138.51:54487] by server-7.bemta-3.messagelabs.com id
	C8/D0-01713-579A4B05; Tue, 27 Nov 2012 11:52:21 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1354017141!31648203!1
X-Originating-IP: [192.134.164.82]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16657 invoked from network); 27 Nov 2012 11:52:21 -0000
Received: from mail1-relais-roc.national.inria.fr (HELO
	mail1-relais-roc.national.inria.fr) (192.134.164.82)
	by server-9.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:52:21 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352070000"; d="scan'208";a="183423399"
Received: from unknown (HELO type.ipv6) ([193.50.110.127])
	by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	27 Nov 2012 12:52:20 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdJi8-0004DW-Hq; Tue, 27 Nov 2012 12:52:20 +0100
Date: Tue, 27 Nov 2012 12:52:20 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121127115220.GG5956@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"Keir (Xen.org)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
	<29138c27eb72e5602751.1353947050@andrewcoop.uk.xensource.com>
	<20121126214212.GL7556@type.youpi.perso.aquilenet.fr>
	<1354016079.17985.8.camel@zakaz.uk.xensource.com>
	<20121127113953.GB5956@type.bordeaux.inria.fr>
	<1354016801.17985.16.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354016801.17985.16.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 4] minios/console: console_input() weak
 reference
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell, le Tue 27 Nov 2012 11:46:41 +0000, a =E9crit :
> > > And by extension I suppose xencons_tx too, for parity if nothing else.
> > =

> > I actually wonder what the purpose of xencons_tx is.
> =

> I suppose if you had a shared ring serial console you could accept
> input?

I'm afraid I still don't understand :)

> > > The existing console_input function (previously xencons_rx) is pretty
> > > odd, it relies on something reusing a tx buffer for rx?
> > =

> > ? I don't see what you are referring to.
> =

> xencons_rx says /* Just repeat what's written */ and prints the contents
> of the buffer

Yes, it echoes what was typed on the console by the user.

> (this is rx remember, so buffer ought to be an output buffer, not
> input)

Really?  It's not what I understand from console_handle_input, which
just consumes data from the ring and gives it to xencons_rx, without
emiting any.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:56:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:56:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJll-0004Cv-B9; Tue, 27 Nov 2012 11:56:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdJlj-0004Cn-J8
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 11:56:03 +0000
Received: from [85.158.137.99:59703] by server-2.bemta-3.messagelabs.com id
	2D/23-04744-25AA4B05; Tue, 27 Nov 2012 11:56:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1354017361!15995341!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30939 invoked from network); 27 Nov 2012 11:56:01 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:56:01 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16021775"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:56:01 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 11:56:00 +0000
Message-ID: <1354017359.17985.23.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Tue, 27 Nov 2012 11:55:59 +0000
In-Reply-To: <50B4A8F7.5050702@eu.citrix.com>
References: <85552b648b3cabebd4f5.1353686197@elijah>
	<1354016648.17985.13.camel@zakaz.uk.xensource.com>
	<50B4A8F7.5050702@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Make an internal function explicitly
 check existence of expected paths
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 11:50 +0000, George Dunlap wrote:
> On 27/11/12 11:44, Ian Campbell wrote:
> > On Fri, 2012-11-23 at 15:56 +0000, George Dunlap wrote:
> >> +        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
> >> +                   "Internal error: Missing xenstore node %s/removable", be_path);
> >
> > One or two of these new log lines are > 80 columns. You might find that
> > using the shorthand LOG*() macros helps with this.
> 
> Oops -- I'll fix that up.
> 
> >
> > Personally I don't think the "Internal error" tag is necessary either,
> > but maybe a new return code ERROR_INTERNAL might make sense? or even an
> > assert() if this is really a "libxl failed to maintain internal
> > consistency" ?
> 
> The idea behind the "Internal" tag is to tell users, "Unless you've been 
> manually messing around with xenstore removing nodes, this is definitely 
> not your fault."

OK. Perhaps in order to do this consistently we could have a libxl
helper which logs a message with this tag added and then aborts?
(libxl_assert?)

Might be worth leaving some time for others to weigh in before
implementing that though, since adding aborts is something which might
be considered controversial.

> I guess normally an ASSERT communicates that pretty well, but I guess 
> I'm used to ASSERTs that disappear when DEBUG is turned off. :-)  Is 
> that not the case for libxl?

I don't think assert(3) has this property?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:56:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:56:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJll-0004Cv-B9; Tue, 27 Nov 2012 11:56:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdJlj-0004Cn-J8
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 11:56:03 +0000
Received: from [85.158.137.99:59703] by server-2.bemta-3.messagelabs.com id
	2D/23-04744-25AA4B05; Tue, 27 Nov 2012 11:56:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1354017361!15995341!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30939 invoked from network); 27 Nov 2012 11:56:01 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:56:01 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16021775"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:56:01 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 11:56:00 +0000
Message-ID: <1354017359.17985.23.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Tue, 27 Nov 2012 11:55:59 +0000
In-Reply-To: <50B4A8F7.5050702@eu.citrix.com>
References: <85552b648b3cabebd4f5.1353686197@elijah>
	<1354016648.17985.13.camel@zakaz.uk.xensource.com>
	<50B4A8F7.5050702@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] libxl: Make an internal function explicitly
 check existence of expected paths
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 11:50 +0000, George Dunlap wrote:
> On 27/11/12 11:44, Ian Campbell wrote:
> > On Fri, 2012-11-23 at 15:56 +0000, George Dunlap wrote:
> >> +        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
> >> +                   "Internal error: Missing xenstore node %s/removable", be_path);
> >
> > One or two of these new log lines are > 80 columns. You might find that
> > using the shorthand LOG*() macros helps with this.
> 
> Oops -- I'll fix that up.
> 
> >
> > Personally I don't think the "Internal error" tag is necessary either,
> > but maybe a new return code ERROR_INTERNAL might make sense? or even an
> > assert() if this is really a "libxl failed to maintain internal
> > consistency" ?
> 
> The idea behind the "Internal" tag is to tell users, "Unless you've been 
> manually messing around with xenstore removing nodes, this is definitely 
> not your fault."

OK. Perhaps in order to do this consistently we could have a libxl
helper which logs a message with this tag added and then aborts?
(libxl_assert?)

Might be worth leaving some time for others to weigh in before
implementing that though, since adding aborts is something which might
be considered controversial.

> I guess normally an ASSERT communicates that pretty well, but I guess 
> I'm used to ASSERTs that disappear when DEBUG is turned off. :-)  Is 
> that not the case for libxl?

I don't think assert(3) has this property?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:57:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:57:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJmh-0004IA-S2; Tue, 27 Nov 2012 11:57:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TdJmf-0004Hv-Sx
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:57:02 +0000
Received: from [85.158.138.51:14431] by server-2.bemta-3.messagelabs.com id
	AE/94-04744-D8AA4B05; Tue, 27 Nov 2012 11:57:01 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354017415!25303253!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ3Mzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32448 invoked from network); 27 Nov 2012 11:56:56 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:56:56 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="45723601"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:56:53 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 06:56:52 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TdJmV-000574-VL;
	Tue, 27 Nov 2012 11:56:51 +0000
Date: Tue, 27 Nov 2012 11:56:49 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Jim Fehlig <jfehlig@suse.com>
In-Reply-To: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
Message-ID: <alpine.DEB.2.02.1211271156330.5310@kaball.uk.xensource.com>
References: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "libvir-list@redhat.com" <libvir-list@redhat.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Convert libxl driver to Xen 4.2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 26 Nov 2012, Jim Fehlig wrote:
> Based on a patch originally authored by Daniel De Graaf
> 
>   http://lists.xen.org/archives/html/xen-devel/2012-05/msg00565.html
> 
> This patch converts the Xen libxl driver to support only Xen >= 4.2.
> Support for Xen 4.1 libxl is dropped since that version of libxl is
> designated 'technology preview' only and is incompatible with Xen 4.2
> libxl.  Additionally, the default toolstack in Xen 4.1 is still xend,
> for which libvirt has a stable, functional driver.

It looks pretty good to me, thanks!



>  configure.ac             |    8 +-
>  docs/drvxen.html.in      |    8 +
>  libvirt.spec.in          |    4 +-
>  src/libxl/libxl_conf.c   |  370 ++++++++++++++---------------------
>  src/libxl/libxl_conf.h   |   17 +-
>  src/libxl/libxl_driver.c |  488 +++++++++++++++++++++++++++-------------------
>  6 files changed, 459 insertions(+), 436 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 849d787..c1a9943 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -717,16 +717,14 @@ if test "$with_libxl" != "no" ; then
>      fi
>      CFLAGS="$CFLAGS $LIBXL_CFLAGS"
>      LIBS="$LIBS $LIBXL_LIBS"
> -    AC_CHECK_LIB([xenlight], [libxl_domain_create_new], [
> +    AC_CHECK_LIB([xenlight], [libxl_ctx_alloc], [
>          with_libxl=yes
> -        LIBXL_LIBS="$LIBXL_LIBS -lxenlight -lxenstore -lxenctrl -lxenguest -luuid -lutil -lblktapctl"
> +        LIBXL_LIBS="$LIBXL_LIBS -lxenlight"
>      ],[
>          if test "$with_libxl" = "yes"; then
>              fail=1
>          fi
>          with_libxl=no
> -    ],[
> -        -lxenstore -lxenctrl -lxenguest -luuid -lutil -lblktapctl
>      ])
>  fi
> 
> @@ -734,7 +732,7 @@ LIBS="$old_LIBS"
>  CFLAGS="$old_CFLAGS"
> 
>  if test $fail = 1; then
> -    AC_MSG_ERROR([You must install the libxl Library to compile libxenlight driver with -lxl])
> +    AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.2 to compile libxenlight driver with -lxl])
>  fi
> 
>  if test "$with_libxl" = "yes"; then
> diff --git a/docs/drvxen.html.in b/docs/drvxen.html.in
> index 0bca935..06bd911 100644
> --- a/docs/drvxen.html.in
> +++ b/docs/drvxen.html.in
> @@ -53,6 +53,14 @@
>          the <code>/etc/xen</code> directory. It is important not to place
>          any other non-config files in this directory.
>        </li>
> +      <li>
> +        <strong>libxl</strong>: Starting with Xen 4.2, the legacy XenD/xm
> +        toolstack is deprecated in favor of libxl, also commonly called
> +        libxenlight.  libvirt supports this new Xen toolstack via the
> +        libxl driver.  If XenD is enabled, the legacy xen driver consisting
> +        of the above mentioned channels will be used.  If XenD is disabled,
> +        the libxl driver will be used.
> +      </li>
>      </ul>
> 
>      <h2><a name="uri">Connections to Xen driver</a></h2>
> diff --git a/libvirt.spec.in b/libvirt.spec.in
> index 35c103b..bb274f5 100644
> --- a/libvirt.spec.in
> +++ b/libvirt.spec.in
> @@ -188,8 +188,8 @@
>  %endif
>  %endif
> 
> -# Fedora doesn't have new enough Xen for libxl until F16
> -%if 0%{?fedora} && 0%{?fedora} < 16
> +# Fedora doesn't have new enough Xen for libxl until F18
> +%if 0%{?fedora} && 0%{?fedora} < 18
>  %define with_libxl 0
>  %endif
> 
> diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
> index 1c3130b..73abdfa 100644
> --- a/src/libxl/libxl_conf.c
> +++ b/src/libxl/libxl_conf.c
> @@ -41,6 +41,7 @@
>  #include "capabilities.h"
>  #include "libxl_driver.h"
>  #include "libxl_conf.h"
> +#include "libxl_utils.h"
>  #include "storage_file.h"
> 
> 
> @@ -62,6 +63,52 @@ struct guest_arch {
>  static const char *xen_cap_re = "(xen|hvm)-[[:digit:]]+\\.[[:digit:]]+-(x86_32|x86_64|ia64|powerpc64)(p|be)?";
>  static regex_t xen_cap_rec;
> 
> +/*
> + * Copied from split_string_into_string_list() in
> + * $xen-sources/tools/libxl/xl_cmdimpl.c, which is licensed LGPL v2.1.
> + */
> +static int
> +libxlSplitStringIntoStringList(const char *str,
> +                               const char *delim,
> +                               libxl_string_list *psl)
> +{
> +    char *s, *saveptr;
> +    const char *p;
> +    libxl_string_list sl;
> +    int i = 0, nr = 0;
> +
> +    s = strdup(str);
> +    if (s == NULL) {
> +        virReportOOMError();
> +        return -1;
> +    }
> +
> +    /* Count number of entries */
> +    p = strtok_r(s, delim, &saveptr);
> +    do {
> +        nr++;
> +    } while ((p = strtok_r(NULL, delim, &saveptr)));
> +
> +    VIR_FREE(s);
> +    s = strdup(str);
> +
> +    if (VIR_ALLOC_N(sl, nr + 1) < 0) {
> +        virReportOOMError();
> +        VIR_FREE(s);
> +        return -1;
> +    }
> +
> +    p = strtok_r(s, delim, &saveptr);
> +    do {
> +        sl[i] = strdup(p);
> +        i++;
> +    } while ((p = strtok_r(NULL, delim, &saveptr)));
> +    sl[i] = NULL;
> +
> +    *psl = sl;
> +    VIR_FREE(s);
> +    return 0;
> +}
> 
>  static int
>  libxlNextFreeVncPort(libxlDriverPrivatePtr driver, int startPort)
> @@ -360,18 +407,36 @@ libxlMakeCapabilitiesInternal(const char *hostmachine,
>  }
> 
>  static int
> -libxlMakeDomCreateInfo(virDomainDefPtr def, libxl_domain_create_info *c_info)
> +libxlMakeDomCreateInfo(libxlDriverPrivatePtr driver,
> +                       virDomainDefPtr def,
> +                       libxl_domain_create_info *c_info)
>  {
>      char uuidstr[VIR_UUID_STRING_BUFLEN];
> 
> -    libxl_init_create_info(c_info);
> +    libxl_domain_create_info_init(c_info);
> +
> +    if (STREQ(def->os.type, "hvm"))
> +        c_info->type = LIBXL_DOMAIN_TYPE_HVM;
> +    else
> +        c_info->type = LIBXL_DOMAIN_TYPE_PV;
> 
> -    c_info->hvm = STREQ(def->os.type, "hvm");
>      if ((c_info->name = strdup(def->name)) == NULL) {
>          virReportOOMError();
>          goto error;
>      }
> 
> +    if (def->nseclabels &&
> +        def->seclabels[0]->type == VIR_DOMAIN_SECLABEL_STATIC) {
> +        if (libxl_flask_context_to_sid(driver->ctx,
> +                                       def->seclabels[0]->label,
> +                                       strlen(def->seclabels[0]->label),
> +                                       &c_info->ssidref)) {
> +            virReportError(VIR_ERR_INTERNAL_ERROR,
> +                           _("libxenlight failed to resolve security label '%s'"),
> +                           def->seclabels[0]->label);
> +        }
> +    }
> +
>      virUUIDFormat(def->uuid, uuidstr);
>      if (libxl_uuid_from_string(&c_info->uuid, uuidstr)) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
> @@ -382,7 +447,7 @@ libxlMakeDomCreateInfo(virDomainDefPtr def, libxl_domain_create_info *c_info)
>      return 0;
> 
>  error:
> -    libxl_domain_create_info_destroy(c_info);
> +    libxl_domain_create_info_dispose(c_info);
>      return -1;
>  }
> 
> @@ -393,26 +458,25 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
>      int hvm = STREQ(def->os.type, "hvm");
>      int i;
> 
> -    /* Currently, libxenlight only supports 32 vcpus per domain.
> -     * cur_vcpus member of struct libxl_domain_build_info is defined
> -     * as an int, but its semantic is a bitmap of online vcpus, so
> -     * only 32 can be represented.
> +    /*
> +     * libxl in Xen 4.2 supports up to 128 vcpus, cur_vcpus was replaced
> +     * by avail_vcpus of type libxl_bitmap
>       */
> -    if (def->maxvcpus > 32 || def->vcpus > 32) {
> -        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> -                       _("This version of libxenlight only supports 32 "
> -                         "vcpus per domain"));
> +    if (def->maxvcpus > LIBXL_MAXVCPUS || def->vcpus > LIBXL_MAXVCPUS) {
> +        virReportError(VIR_ERR_INTERNAL_ERROR,
> +                       _("This version of libxenlight only supports %u "
> +                         "vcpus per domain"), LIBXL_MAXVCPUS);
>          return -1;
>      }
> 
> -    libxl_init_build_info(b_info, &d_config->c_info);
> +    libxl_domain_build_info_init(b_info);
> 
> -    b_info->hvm = hvm;
> -    b_info->max_vcpus = def->maxvcpus;
> -    if (def->vcpus == 32)
> -        b_info->cur_vcpus = (uint32_t) -1;
> +    if (hvm)
> +        libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_HVM);
>      else
> -        b_info->cur_vcpus = (1 << def->vcpus) - 1;
> +        libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_PV);
> +    b_info->max_vcpus = def->maxvcpus;
> +    libxl_bitmap_set((&b_info->avail_vcpus), def->vcpus);
>      if (def->clock.ntimers > 0 &&
>          def->clock.timers[0]->name == VIR_DOMAIN_TIMER_NAME_TSC) {
>          switch (def->clock.timers[0]->mode) {
> @@ -426,16 +490,20 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
>                  b_info->tsc_mode = 1;
>          }
>      }
> +    b_info->sched_params.weight = 1000;
>      b_info->max_memkb = def->mem.max_balloon;
>      b_info->target_memkb = def->mem.cur_balloon;
>      if (hvm) {
> -        b_info->u.hvm.pae = def->features & (1 << VIR_DOMAIN_FEATURE_PAE);
> -        b_info->u.hvm.apic = def->features & (1 << VIR_DOMAIN_FEATURE_APIC);
> -        b_info->u.hvm.acpi = def->features & (1 << VIR_DOMAIN_FEATURE_ACPI);
> +        libxl_defbool_set(&b_info->u.hvm.pae,
> +                          def->features & (1 << VIR_DOMAIN_FEATURE_PAE));
> +        libxl_defbool_set(&b_info->u.hvm.apic,
> +                          def->features & (1 << VIR_DOMAIN_FEATURE_APIC));
> +        libxl_defbool_set(&b_info->u.hvm.acpi,
> +                          def->features & (1 << VIR_DOMAIN_FEATURE_ACPI));
>          for (i = 0; i < def->clock.ntimers; i++) {
>              if (def->clock.timers[i]->name == VIR_DOMAIN_TIMER_NAME_HPET &&
>                  def->clock.timers[i]->present == 1) {
> -                b_info->u.hvm.hpet = 1;
> +                libxl_defbool_set(&b_info->u.hvm.hpet, 1);
>              }
>          }
> 
> @@ -446,7 +514,7 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
>           * 256 pages (1MB) per vcpu, plus 1 page per MiB of RAM for the P2M map,
>           * plus 1 page per MiB of RAM to shadow the resident processes.
>           */
> -        b_info->shadow_memkb = 4 * (256 * b_info->cur_vcpus +
> +        b_info->shadow_memkb = 4 * (256 * libxl_bitmap_count_set(&b_info->avail_vcpus) +
>                                      2 * (b_info->max_memkb / 1024));
>      } else {
>          if (def->os.bootloader) {
> @@ -456,10 +524,11 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
>              }
>          }
>          if (def->os.bootloaderArgs) {
> -            if ((b_info->u.pv.bootloader_args = strdup(def->os.bootloaderArgs)) == NULL) {
> -                virReportOOMError();
> +            if (libxlSplitStringIntoStringList(def->os.bootloaderArgs,
> +                                               " \t\n",
> +                                               &b_info->u.pv.bootloader_args)
> +                < 0)
>                  goto error;
> -            }
>          }
>          if (def->os.cmdline) {
>              if ((b_info->u.pv.cmdline = strdup(def->os.cmdline)) == NULL) {
> @@ -469,14 +538,14 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
>          }
>          if (def->os.kernel) {
>              /* libxl_init_build_info() sets kernel.path = strdup("hvmloader") */
> -            VIR_FREE(b_info->kernel.path);
> -            if ((b_info->kernel.path = strdup(def->os.kernel)) == NULL) {
> +            VIR_FREE(b_info->u.pv.kernel);
> +            if ((b_info->u.pv.kernel = strdup(def->os.kernel)) == NULL) {
>                  virReportOOMError();
>                  goto error;
>              }
>          }
>          if (def->os.initrd) {
> -            if ((b_info->u.pv.ramdisk.path = strdup(def->os.initrd)) == NULL) {
> +            if ((b_info->u.pv.ramdisk = strdup(def->os.initrd)) == NULL) {
>                  virReportOOMError();
>                  goto error;
>              }
> @@ -486,13 +555,12 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
>      return 0;
> 
>  error:
> -    libxl_domain_build_info_destroy(b_info);
> +    libxl_domain_build_info_dispose(b_info);
>      return -1;
>  }
> 
>  int
> -libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
> -              libxl_device_disk *x_disk)
> +libxlMakeDisk(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk)
>  {
>      if (l_disk->src && (x_disk->pdev_path = strdup(l_disk->src)) == NULL) {
>          virReportOOMError();
> @@ -509,22 +577,22 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
>              STREQ(l_disk->driverName, "tap2")) {
>              switch (l_disk->format) {
>              case VIR_STORAGE_FILE_QCOW:
> -                x_disk->format = DISK_FORMAT_QCOW;
> -                x_disk->backend = DISK_BACKEND_QDISK;
> +                x_disk->format = LIBXL_DISK_FORMAT_QCOW;
> +                x_disk->backend = LIBXL_DISK_BACKEND_QDISK;
>                  break;
>              case VIR_STORAGE_FILE_QCOW2:
> -                x_disk->format = DISK_FORMAT_QCOW2;
> -                x_disk->backend = DISK_BACKEND_QDISK;
> +                x_disk->format = LIBXL_DISK_FORMAT_QCOW2;
> +                x_disk->backend = LIBXL_DISK_BACKEND_QDISK;
>                  break;
>              case VIR_STORAGE_FILE_VHD:
> -                x_disk->format = DISK_FORMAT_VHD;
> -                x_disk->backend = DISK_BACKEND_TAP;
> +                x_disk->format = LIBXL_DISK_FORMAT_VHD;
> +                x_disk->backend = LIBXL_DISK_BACKEND_TAP;
>                  break;
>              case VIR_STORAGE_FILE_NONE:
>                  /* No subtype specified, default to raw/tap */
>              case VIR_STORAGE_FILE_RAW:
> -                x_disk->format = DISK_FORMAT_RAW;
> -                x_disk->backend = DISK_BACKEND_TAP;
> +                x_disk->format = LIBXL_DISK_FORMAT_RAW;
> +                x_disk->backend = LIBXL_DISK_BACKEND_TAP;
>                  break;
>              default:
>                  virReportError(VIR_ERR_INTERNAL_ERROR,
> @@ -533,11 +601,11 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
>                  return -1;
>              }
>          } else if (STREQ(l_disk->driverName, "file")) {
> -            x_disk->format = DISK_FORMAT_RAW;
> -            x_disk->backend = DISK_BACKEND_TAP;
> +            x_disk->format = LIBXL_DISK_FORMAT_RAW;
> +            x_disk->backend = LIBXL_DISK_BACKEND_TAP;
>          } else if (STREQ(l_disk->driverName, "phy")) {
> -            x_disk->format = DISK_FORMAT_RAW;
> -            x_disk->backend = DISK_BACKEND_PHY;
> +            x_disk->format = LIBXL_DISK_FORMAT_RAW;
> +            x_disk->backend = LIBXL_DISK_BACKEND_PHY;
>          } else {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("libxenlight does not support disk driver %s"),
> @@ -546,12 +614,12 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
>          }
>      } else {
>          /* No driverName - default to raw/tap?? */
> -        x_disk->format = DISK_FORMAT_RAW;
> -        x_disk->backend = DISK_BACKEND_TAP;
> +        x_disk->format = LIBXL_DISK_FORMAT_RAW;
> +        x_disk->backend = LIBXL_DISK_BACKEND_TAP;
>      }
> 
> -    /* How to set unpluggable? */
> -    x_disk->unpluggable = 1;
> +    /* XXX is this right? */
> +    x_disk->removable = 1;
>      x_disk->readwrite = !l_disk->readonly;
>      x_disk->is_cdrom = l_disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM ? 1 : 0;
>      if (l_disk->transient) {
> @@ -560,8 +628,6 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
>          return -1;
>      }
> 
> -    x_disk->domid = def->id;
> -
>      return 0;
>  }
> 
> @@ -579,7 +645,7 @@ libxlMakeDiskList(virDomainDefPtr def, libxl_domain_config *d_config)
>      }
> 
>      for (i = 0; i < ndisks; i++) {
> -        if (libxlMakeDisk(def, l_disks[i], &x_disks[i]) < 0)
> +        if (libxlMakeDisk(l_disks[i], &x_disks[i]) < 0)
>              goto error;
>      }
> 
> @@ -590,19 +656,19 @@ libxlMakeDiskList(virDomainDefPtr def, libxl_domain_config *d_config)
> 
>  error:
>      for (i = 0; i < ndisks; i++)
> -        libxl_device_disk_destroy(&x_disks[i]);
> +        libxl_device_disk_dispose(&x_disks[i]);
>      VIR_FREE(x_disks);
>      return -1;
>  }
> 
>  int
> -libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
> -             libxl_device_nic *x_nic)
> +libxlMakeNic(virDomainNetDefPtr l_nic, libxl_device_nic *x_nic)
>  {
> -    // TODO: Where is mtu stored?
> -    //x_nics[i].mtu = 1492;
> +    /* TODO: Where is mtu stored?
> +     *
> +     * x_nics[i].mtu = 1492;
> +     */
> 
> -    x_nic->domid = def->id;
>      virMacAddrGetRaw(&l_nic->mac, x_nic->mac);
> 
>      if (l_nic->model && !STREQ(l_nic->model, "netfront")) {
> @@ -610,9 +676,9 @@ libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
>              virReportOOMError();
>              return -1;
>          }
> -        x_nic->nictype = NICTYPE_IOEMU;
> +        x_nic->nictype = LIBXL_NIC_TYPE_VIF_IOEMU;
>      } else {
> -        x_nic->nictype = NICTYPE_VIF;
> +        x_nic->nictype = LIBXL_NIC_TYPE_VIF;
>      }
> 
>      if (l_nic->ifname && (x_nic->ifname = strdup(l_nic->ifname)) == NULL) {
> @@ -659,48 +725,49 @@ libxlMakeNicList(virDomainDefPtr def,  libxl_domain_config *d_config)
>      for (i = 0; i < nnics; i++) {
>          x_nics[i].devid = i;
> 
> -        if (libxlMakeNic(def, l_nics[i], &x_nics[i]))
> +        if (libxlMakeNic(l_nics[i], &x_nics[i]))
>              goto error;
>      }
> 
> -    d_config->vifs = x_nics;
> -    d_config->num_vifs = nnics;
> +    d_config->nics = x_nics;
> +    d_config->num_nics = nnics;
> 
>      return 0;
> 
>  error:
>      for (i = 0; i < nnics; i++)
> -        libxl_device_nic_destroy(&x_nics[i]);
> +        libxl_device_nic_dispose(&x_nics[i]);
>      VIR_FREE(x_nics);
>      return -1;
>  }
> 
>  int
> -libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
> -             virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb)
> +libxlMakeVfb(libxlDriverPrivatePtr driver,
> +             virDomainGraphicsDefPtr l_vfb,
> +             libxl_device_vfb *x_vfb)
>  {
>      int port;
>      const char *listenAddr;
> 
>      switch (l_vfb->type) {
>          case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
> -            x_vfb->sdl = 1;
> +            libxl_defbool_set(&x_vfb->sdl.enable, 1);
>              if (l_vfb->data.sdl.display &&
> -                (x_vfb->display = strdup(l_vfb->data.sdl.display)) == NULL) {
> +                (x_vfb->sdl.display = strdup(l_vfb->data.sdl.display)) == NULL) {
>                  virReportOOMError();
>                  return -1;
>              }
>              if (l_vfb->data.sdl.xauth &&
> -                (x_vfb->xauthority =
> +                (x_vfb->sdl.xauthority =
>                      strdup(l_vfb->data.sdl.xauth)) == NULL) {
>                  virReportOOMError();
>                  return -1;
>              }
>              break;
>          case  VIR_DOMAIN_GRAPHICS_TYPE_VNC:
> -            x_vfb->vnc = 1;
> +            libxl_defbool_set(&x_vfb->vnc.enable, 1);
>              /* driver handles selection of free port */
> -            x_vfb->vncunused = 0;
> +            libxl_defbool_set(&x_vfb->vnc.findunused, 0);
>              if (l_vfb->data.vnc.autoport) {
>                  port = libxlNextFreeVncPort(driver, LIBXL_VNC_PORT_MIN);
>                  if (port < 0) {
> @@ -710,13 +777,13 @@ libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
>                  }
>                  l_vfb->data.vnc.port = port;
>              }
> -            x_vfb->vncdisplay = l_vfb->data.vnc.port - LIBXL_VNC_PORT_MIN;
> +            x_vfb->vnc.display = l_vfb->data.vnc.port - LIBXL_VNC_PORT_MIN;
> 
>              listenAddr = virDomainGraphicsListenGetAddress(l_vfb, 0);
>              if (listenAddr) {
>                  /* libxl_device_vfb_init() does strdup("127.0.0.1") */
> -                VIR_FREE(x_vfb->vnclisten);
> -                if ((x_vfb->vnclisten = strdup(listenAddr)) == NULL) {
> +                VIR_FREE(x_vfb->vnc.listen);
> +                if ((x_vfb->vnc.listen = strdup(listenAddr)) == NULL) {
>                      virReportOOMError();
>                      return -1;
>                  }
> @@ -729,13 +796,14 @@ libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
>              }
>              break;
>      }
> -    x_vfb->domid = def->id;
> +
>      return 0;
>  }
> 
>  static int
>  libxlMakeVfbList(libxlDriverPrivatePtr driver,
> -                 virDomainDefPtr def, libxl_domain_config *d_config)
> +                 virDomainDefPtr def,
> +                 libxl_domain_config *d_config)
>  {
>      virDomainGraphicsDefPtr *l_vfbs = def->graphics;
>      int nvfbs = def->ngraphics;
> @@ -757,10 +825,10 @@ libxlMakeVfbList(libxlDriverPrivatePtr driver,
>      }
> 
>      for (i = 0; i < nvfbs; i++) {
> -        libxl_device_vfb_init(&x_vfbs[i], i);
> -        libxl_device_vkb_init(&x_vkbs[i], i);
> +        libxl_device_vfb_init(&x_vfbs[i]);
> +        libxl_device_vkb_init(&x_vkbs[i]);
> 
> -        if (libxlMakeVfb(driver, def, l_vfbs[i], &x_vfbs[i]) < 0)
> +        if (libxlMakeVfb(driver, l_vfbs[i], &x_vfbs[i]) < 0)
>              goto error;
>      }
> 
> @@ -772,148 +840,14 @@ libxlMakeVfbList(libxlDriverPrivatePtr driver,
> 
>  error:
>      for (i = 0; i < nvfbs; i++) {
> -        libxl_device_vfb_destroy(&x_vfbs[i]);
> -        libxl_device_vkb_destroy(&x_vkbs[i]);
> +        libxl_device_vfb_dispose(&x_vfbs[i]);
> +        libxl_device_vkb_dispose(&x_vkbs[i]);
>      }
>      VIR_FREE(x_vfbs);
>      VIR_FREE(x_vkbs);
>      return -1;
>  }
> 
> -static int
> -libxlMakeChrdevStr(virDomainChrDefPtr def, char **buf)
> -{
> -    const char *type = virDomainChrTypeToString(def->source.type);
> -
> -    if (!type) {
> -        virReportError(VIR_ERR_INTERNAL_ERROR,
> -                       "%s", _("unexpected chr device type"));
> -        return -1;
> -    }
> -
> -    switch (def->source.type) {
> -        case VIR_DOMAIN_CHR_TYPE_NULL:
> -        case VIR_DOMAIN_CHR_TYPE_STDIO:
> -        case VIR_DOMAIN_CHR_TYPE_VC:
> -        case VIR_DOMAIN_CHR_TYPE_PTY:
> -            if (virAsprintf(buf, "%s", type) < 0) {
> -                virReportOOMError();
> -                return -1;
> -            }
> -            break;
> -
> -        case VIR_DOMAIN_CHR_TYPE_FILE:
> -        case VIR_DOMAIN_CHR_TYPE_PIPE:
> -            if (virAsprintf(buf, "%s:%s", type,
> -                            def->source.data.file.path) < 0) {
> -                virReportOOMError();
> -                return -1;
> -            }
> -            break;
> -
> -        case VIR_DOMAIN_CHR_TYPE_DEV:
> -            if (virAsprintf(buf, "%s", def->source.data.file.path) < 0) {
> -                virReportOOMError();
> -                return -1;
> -            }
> -            break;
> -    }
> -
> -    return 0;
> -}
> -
> -static int
> -libxlMakeDeviceModelInfo(virDomainDefPtr def, libxl_domain_config *d_config)
> -{
> -    libxl_device_model_info *dm_info = &d_config->dm_info;
> -    int i;
> -    char b_order[VIR_DOMAIN_BOOT_LAST+1];
> -
> -    libxl_init_dm_info(dm_info, &d_config->c_info, &d_config->b_info);
> -
> -    if (d_config->b_info.hvm) {
> -        /* HVM-specific device model info */
> -        dm_info->type = XENFV;
> -        if (def->os.nBootDevs > 0) {
> -            VIR_FREE(dm_info->boot);
> -            for (i = 0; i < def->os.nBootDevs; i++) {
> -                switch (def->os.bootDevs[i]) {
> -                    case VIR_DOMAIN_BOOT_FLOPPY:
> -                        b_order[i] = 'a';
> -                        break;
> -                    default:
> -                    case VIR_DOMAIN_BOOT_DISK:
> -                        b_order[i] = 'c';
> -                        break;
> -                    case VIR_DOMAIN_BOOT_CDROM:
> -                        b_order[i] = 'd';
> -                        break;
> -                    case VIR_DOMAIN_BOOT_NET:
> -                        b_order[i] = 'n';
> -                        break;
> -                }
> -            }
> -            b_order[def->os.nBootDevs] = '\0';
> -            if ((dm_info->boot = strdup(b_order)) == NULL) {
> -                virReportOOMError();
> -                goto error;
> -            }
> -        }
> -        if (def->serials &&
> -            (libxlMakeChrdevStr(def->serials[0], &dm_info->serial) < 0))
> -            goto error;
> -    } else {
> -        /* PV-specific device model info */
> -        dm_info->type = XENPV;
> -    }
> -
> -    /* Build qemu graphics options from previously parsed vfb */
> -    if (d_config->num_vfbs > 0) {
> -        if (d_config->vfbs[0].vnc) {
> -            dm_info->vnc = 1;
> -            /* driver handles selection of free port */
> -            dm_info->vncunused = 0;
> -            if (d_config->vfbs[0].vnclisten) {
> -                VIR_FREE(dm_info->vnclisten);
> -                if ((dm_info->vnclisten =
> -                     strdup(d_config->vfbs[0].vnclisten)) == NULL) {
> -                    virReportOOMError();
> -                    goto error;
> -                }
> -            }
> -            if (d_config->vfbs[0].keymap &&
> -                (dm_info->keymap = strdup(d_config->vfbs[0].keymap)) == NULL) {
> -                virReportOOMError();
> -                goto error;
> -            }
> -            dm_info->vncdisplay = d_config->vfbs[0].vncdisplay;
> -            if (d_config->vfbs[0].vncpasswd &&
> -                (dm_info->vncpasswd =
> -                 strdup(d_config->vfbs[0].vncpasswd)) == NULL) {
> -                virReportOOMError();
> -                goto error;
> -            }
> -        } else if (d_config->vfbs[0].sdl) {
> -            dm_info->sdl = 1;
> -            dm_info->vnc = 0;
> -        }
> -    } else if (d_config->num_vfbs == 0) {
> -        dm_info->nographic = 1;
> -        dm_info->vnc = 0;
> -    }
> -
> -    // TODO
> -    //dm_info->usb = ;
> -    //dm_info->usbdevice = ;
> -    //dm_info->soundhw = ;
> -
> -    return 0;
> -
> -error:
> -    libxl_device_model_info_destroy(dm_info);
> -    return -1;
> -}
> -
>  virCapsPtr
>  libxlMakeCapabilities(libxl_ctx *ctx)
>  {
> @@ -947,7 +881,7 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
>                         virDomainDefPtr def, libxl_domain_config *d_config)
>  {
> 
> -    if (libxlMakeDomCreateInfo(def, &d_config->c_info) < 0)
> +    if (libxlMakeDomCreateInfo(driver, def, &d_config->c_info) < 0)
>          return -1;
> 
>      if (libxlMakeDomBuildInfo(def, d_config) < 0) {
> @@ -966,10 +900,6 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
>          goto error;
>      }
> 
> -    if (libxlMakeDeviceModelInfo(def, d_config) < 0) {
> -        goto error;
> -    }
> -
>      d_config->on_reboot = def->onReboot;
>      d_config->on_poweroff = def->onPoweroff;
>      d_config->on_crash = def->onCrash;
> @@ -977,6 +907,6 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
>      return 0;
> 
>  error:
> -    libxl_domain_config_destroy(d_config);
> +    libxl_domain_config_dispose(d_config);
>      return -1;
>  }
> diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
> index 56bf85c..ea62b68 100644
> --- a/src/libxl/libxl_conf.h
> +++ b/src/libxl/libxl_conf.h
> @@ -37,6 +37,7 @@
>  # include "bitmap.h"
> 
> 
> +# define LIBXL_MAXVCPUS      128
>  # define LIBXL_VNC_PORT_MIN  5900
>  # define LIBXL_VNC_PORT_MAX  65535
> 
> @@ -58,7 +59,7 @@ struct _libxlDriverPrivate {
>      FILE *logger_file;
>      xentoollog_logger *logger;
>      /* libxl ctx for driver wide ops; getVersion, getNodeInfo, ... */
> -    libxl_ctx ctx;
> +    libxl_ctx *ctx;
> 
>      virBitmapPtr reservedVNCPorts;
>      virDomainObjList domains;
> @@ -77,10 +78,8 @@ typedef struct _libxlDomainObjPrivate libxlDomainObjPrivate;
>  typedef libxlDomainObjPrivate *libxlDomainObjPrivatePtr;
>  struct _libxlDomainObjPrivate {
>      /* per domain libxl ctx */
> -    libxl_ctx ctx;
> -    libxl_waiter *dWaiter;
> -    int waiterFD;
> -    int eventHdl;
> +    libxl_ctx *ctx;
> +    libxl_evgen_domain_death *deathW;
>  };
> 
>  # define LIBXL_SAVE_MAGIC "libvirt-xml\n \0 \r"
> @@ -100,13 +99,11 @@ virCapsPtr
>  libxlMakeCapabilities(libxl_ctx *ctx);
> 
>  int
> -libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_dev,
> -              libxl_device_disk *x_dev);
> +libxlMakeDisk(virDomainDiskDefPtr l_dev, libxl_device_disk *x_dev);
>  int
> -libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
> -             libxl_device_nic *x_nic);
> +libxlMakeNic(virDomainNetDefPtr l_nic, libxl_device_nic *x_nic);
>  int
> -libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
> +libxlMakeVfb(libxlDriverPrivatePtr driver,
>               virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb);
> 
>  int
> diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
> index bc75730..f15129f 100644
> --- a/src/libxl/libxl_driver.c
> +++ b/src/libxl/libxl_driver.c
> @@ -40,6 +40,7 @@
>  #include "memory.h"
>  #include "uuid.h"
>  #include "command.h"
> +#include "libxl.h"
>  #include "libxl_driver.h"
>  #include "libxl_conf.h"
>  #include "xen_xm.h"
> @@ -59,6 +60,19 @@
>  /* Number of Xen scheduler parameters */
>  #define XEN_SCHED_CREDIT_NPARAM   2
> 
> +struct libxlOSEventHookFDInfo {
> +    libxlDomainObjPrivatePtr priv;
> +    void *xl_priv;
> +    int watch;
> +};
> +
> +struct libxlOSEventHookTimerInfo {
> +    libxlDomainObjPrivatePtr priv;
> +    void *xl_priv;
> +    int id;
> +};
> +
> +
>  static void libxlDomainManagedSaveLoad(void *payload,
>                                         const void *n ATTRIBUTE_UNUSED,
>                                         void *opaque);
> @@ -84,6 +98,163 @@ libxlDriverUnlock(libxlDriverPrivatePtr driver)
>      virMutexUnlock(&driver->lock);
>  }
> 
> +
> +static void libxlFDEventCallback(int watch ATTRIBUTE_UNUSED,
> +                                 int fd,
> +                                 int vir_events,
> +                                 void *fdinfo)
> +{
> +    struct libxlOSEventHookFDInfo *info = fdinfo;
> +    int events = 0;
> +
> +    if (vir_events & VIR_EVENT_HANDLE_READABLE)
> +        events |= POLLIN;
> +    if (vir_events & VIR_EVENT_HANDLE_WRITABLE)
> +        events |= POLLOUT;
> +    if (vir_events & VIR_EVENT_HANDLE_ERROR)
> +        events |= POLLERR;
> +    if (vir_events & VIR_EVENT_HANDLE_HANGUP)
> +        events |= POLLHUP;
> +
> +    libxl_osevent_occurred_fd(info->priv->ctx, info->xl_priv, fd, 0, events);
> +}
> +
> +static void libxlFreeFDInfo(void *obj)
> +{
> +    VIR_FREE(obj);
> +}
> +
> +static int libxlFDRegisterEventHook(void *priv, int fd, void **hndp,
> +                                    short events, void *xl_priv)
> +{
> +    int vir_events = VIR_EVENT_HANDLE_ERROR;
> +    struct libxlOSEventHookFDInfo *fdinfo;
> +
> +    if (VIR_ALLOC(fdinfo) < 0) {
> +        virReportOOMError();
> +        return -1;
> +    }
> +
> +    fdinfo->priv = priv;
> +    fdinfo->xl_priv = xl_priv;
> +    *hndp = fdinfo;
> +
> +    if (events & POLLIN)
> +        vir_events |= VIR_EVENT_HANDLE_READABLE;
> +    if (events & POLLOUT)
> +        vir_events |= VIR_EVENT_HANDLE_WRITABLE;
> +    fdinfo->watch = virEventAddHandle(fd, vir_events, libxlFDEventCallback,
> +                                      fdinfo, libxlFreeFDInfo);
> +    if (fdinfo->watch < 0) {
> +        VIR_FREE(fdinfo);
> +        return fdinfo->watch;
> +    }
> +
> +    return 0;
> +}
> +
> +static int libxlFDModifyEventHook(void *priv ATTRIBUTE_UNUSED,
> +                                  int fd ATTRIBUTE_UNUSED,
> +                                  void **hndp,
> +                                  short events)
> +{
> +    struct libxlOSEventHookFDInfo *fdinfo = *hndp;
> +    int vir_events = VIR_EVENT_HANDLE_ERROR;
> +
> +    if (events & POLLIN)
> +        vir_events |= VIR_EVENT_HANDLE_READABLE;
> +    if (events & POLLOUT)
> +        vir_events |= VIR_EVENT_HANDLE_WRITABLE;
> +
> +    virEventUpdateHandle(fdinfo->watch, vir_events);
> +    return 0;
> +}
> +
> +static void libxlFDDeregisterEventHook(void *priv ATTRIBUTE_UNUSED,
> +                                       int fd ATTRIBUTE_UNUSED,
> +                                       void *hnd)
> +{
> +    struct libxlOSEventHookFDInfo *fdinfo = hnd;
> +
> +    virEventRemoveHandle(fdinfo->watch);
> +}
> +
> +
> +static void libxlTimerCallback(int timer ATTRIBUTE_UNUSED, void *timer_v)
> +{
> +    struct libxlOSEventHookTimerInfo *timer_info = timer_v;
> +
> +    libxl_osevent_occurred_timeout(timer_info->priv->ctx, timer_info->xl_priv);
> +}
> +
> +static void libxlTimerInfoFree(void* obj)
> +{
> +    VIR_FREE(obj);
> +}
> +
> +static int libxlTimeoutRegisterEventHook(void *priv,
> +                                         void **hndp,
> +                                         struct timeval abs_t,
> +                                         void *for_libxl)
> +{
> +    struct timeval now;
> +    struct libxlOSEventHookTimerInfo *timer_info;
> +    int timeout, timer_id;
> +
> +    if (VIR_ALLOC(timer_info) < 0) {
> +        virReportOOMError();
> +        return -1;
> +    }
> +
> +    gettimeofday(&now, NULL);
> +    timeout = (abs_t.tv_usec - now.tv_usec) / 1000;
> +    timeout += (abs_t.tv_sec - now.tv_sec) * 1000;
> +    timer_id = virEventAddTimeout(timeout, libxlTimerCallback,
> +                                  timer_info, libxlTimerInfoFree);
> +    if (timer_id < 0) {
> +        VIR_FREE(timer_info);
> +        return timer_id;
> +    }
> +
> +    timer_info->priv = priv;
> +    timer_info->xl_priv = for_libxl;
> +    timer_info->id = timer_id;
> +    *hndp = timer_info;
> +    return 0;
> +}
> +
> +static int libxlTimeoutModifyEventHook(void *priv ATTRIBUTE_UNUSED,
> +                                       void **hndp,
> +                                       struct timeval abs_t)
> +{
> +    struct timeval now;
> +    int timeout;
> +    struct libxlOSEventHookTimerInfo *timer_info = *hndp;
> +
> +    gettimeofday(&now, NULL);
> +    timeout = (abs_t.tv_usec - now.tv_usec) / 1000;
> +    timeout += (abs_t.tv_sec - now.tv_sec) * 1000;
> +    virEventUpdateTimeout(timer_info->id, timeout);
> +    return 0;
> +}
> +
> +static void libxlTimeoutDeregisterEventHook(void *priv ATTRIBUTE_UNUSED,
> +                                            void *hnd)
> +{
> +    struct libxlOSEventHookTimerInfo *timer_info = hnd;
> +
> +    virEventRemoveTimeout(timer_info->id);
> +}
> +
> +static const libxl_osevent_hooks libxl_event_callbacks = {
> +    .fd_register = libxlFDRegisterEventHook,
> +    .fd_modify = libxlFDModifyEventHook,
> +    .fd_deregister = libxlFDDeregisterEventHook,
> +    .timeout_register = libxlTimeoutRegisterEventHook,
> +    .timeout_modify = libxlTimeoutModifyEventHook,
> +    .timeout_deregister = libxlTimeoutDeregisterEventHook,
> +};
> +
>  static void *
>  libxlDomainObjPrivateAlloc(void)
>  {
> @@ -92,9 +263,9 @@ libxlDomainObjPrivateAlloc(void)
>      if (VIR_ALLOC(priv) < 0)
>          return NULL;
> 
> -    libxl_ctx_init(&priv->ctx, LIBXL_VERSION, libxl_driver->logger);
> -    priv->waiterFD = -1;
> -    priv->eventHdl = -1;
> +    libxl_ctx_alloc(&priv->ctx, LIBXL_VERSION, 0, libxl_driver->logger);
> +    priv->deathW = NULL;
> +    libxl_osevent_register_hooks(priv->ctx, &libxl_event_callbacks, priv);
> 
>      return priv;
>  }
> @@ -104,16 +275,12 @@ libxlDomainObjPrivateFree(void *data)
>  {
>      libxlDomainObjPrivatePtr priv = data;
> 
> -    if (priv->eventHdl >= 0)
> -        virEventRemoveHandle(priv->eventHdl);
> -
> -    if (priv->dWaiter) {
> -        libxl_stop_waiting(&priv->ctx, priv->dWaiter);
> -        libxl_free_waiter(priv->dWaiter);
> -        VIR_FREE(priv->dWaiter);
> +    if (priv->deathW) {
> +        libxl_evdisable_domain_death(priv->ctx, priv->deathW);
> +        VIR_FREE(priv->deathW);
>      }
> 
> -    libxl_ctx_free(&priv->ctx);
> +    libxl_ctx_free(priv->ctx);
>      VIR_FREE(priv);
>  }
> 
> @@ -125,17 +292,6 @@ libxlDomainEventQueue(libxlDriverPrivatePtr driver, virDomainEventPtr event)
>      virDomainEventStateQueue(driver->domainEventState, event);
>  }
> 
> -/*
> - * Remove reference to domain object.
> - */
> -static void
> -libxlDomainObjUnref(void *data)
> -{
> -    virDomainObjPtr vm = data;
> -
> -    virObjectUnref(vm);
> -}
> -
>  static void
>  libxlAutostartDomain(void *payload, const void *name ATTRIBUTE_UNUSED,
>                       void *opaque)
> @@ -166,13 +322,13 @@ libxlDoNodeGetInfo(libxlDriverPrivatePtr driver, virNodeInfoPtr info)
>      const libxl_version_info* ver_info;
>      struct utsname utsname;
> 
> -    if (libxl_get_physinfo(&driver->ctx, &phy_info)) {
> +    if (libxl_get_physinfo(driver->ctx, &phy_info)) {
>          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                         _("libxl_get_physinfo_info failed"));
>          return -1;
>      }
> 
> -    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
> +    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
>          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                         _("libxl_get_version_info failed"));
>          return -1;
> @@ -296,15 +452,9 @@ libxlVmCleanup(libxlDriverPrivatePtr driver,
>      char *file;
>      int i;
> 
> -    if (priv->eventHdl >= 0) {
> -        virEventRemoveHandle(priv->eventHdl);
> -        priv->eventHdl = -1;
> -    }
> -
> -    if (priv->dWaiter) {
> -        libxl_stop_waiting(&priv->ctx, priv->dWaiter);
> -        libxl_free_waiter(priv->dWaiter);
> -        VIR_FREE(priv->dWaiter);
> +    if (priv->deathW) {
> +        libxl_evdisable_domain_death(priv->ctx, priv->deathW);
> +        priv->deathW = NULL;
>      }
> 
>      if (vm->persistent) {
> @@ -355,12 +505,11 @@ libxlVmCleanup(libxlDriverPrivatePtr driver,
>  static int
>  libxlVmReap(libxlDriverPrivatePtr driver,
>              virDomainObjPtr vm,
> -            int force,
>              virDomainShutoffReason reason)
>  {
>      libxlDomainObjPrivatePtr priv = vm->privateData;
> 
> -    if (libxl_domain_destroy(&priv->ctx, vm->def->id, force) < 0) {
> +    if (libxl_domain_destroy(priv->ctx, vm->def->id, NULL) < 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Unable to cleanup domain %d"), vm->def->id);
>          return -1;
> @@ -373,56 +522,26 @@ libxlVmReap(libxlDriverPrivatePtr driver,
>  /*
>   * Handle previously registered event notification from libxenlight
>   */
> -static void libxlEventHandler(int watch,
> -                              int fd,
> -                              int events,
> -                              void *data)
> +static void libxlEventHandler(void *data, const libxl_event *event)
>  {
>      libxlDriverPrivatePtr driver = libxl_driver;
>      virDomainObjPtr vm = data;
> -    libxlDomainObjPrivatePtr priv;
>      virDomainEventPtr dom_event = NULL;
> -    libxl_event event;
> -    libxl_dominfo info;
> 
>      libxlDriverLock(driver);
>      virDomainObjLock(vm);
>      libxlDriverUnlock(driver);
> 
> -    priv = vm->privateData;
> -
> -    memset(&event, 0, sizeof(event));
> -    memset(&info, 0, sizeof(info));
> -
> -    if (priv->waiterFD != fd || priv->eventHdl != watch) {
> -        virEventRemoveHandle(watch);
> -        priv->eventHdl = -1;
> -        goto cleanup;
> -    }
> -
> -    if (!(events & VIR_EVENT_HANDLE_READABLE))
> -        goto cleanup;
> -
> -    if (libxl_get_event(&priv->ctx, &event))
> -        goto cleanup;
> -
> -    if (event.type == LIBXL_EVENT_DOMAIN_DEATH) {
> +    if (event->type == LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN) {
>          virDomainShutoffReason reason;
> 
> -        /* libxl_event_get_domain_death_info returns 1 if death
> -         * event was for this domid */
> -        if (libxl_event_get_domain_death_info(&priv->ctx,
> -                                              vm->def->id,
> -                                              &event,
> -                                              &info) != 1)
> +        if (event->domid != vm->def->id)
>              goto cleanup;
> 
> -        virEventRemoveHandle(watch);
> -        priv->eventHdl = -1;
> -        switch (info.shutdown_reason) {
> -            case SHUTDOWN_poweroff:
> -            case SHUTDOWN_crash:
> -                if (info.shutdown_reason == SHUTDOWN_crash) {
> +        switch (event->u.domain_shutdown.shutdown_reason) {
> +            case LIBXL_SHUTDOWN_REASON_POWEROFF:
> +            case LIBXL_SHUTDOWN_REASON_CRASH:
> +                if (event->u.domain_shutdown.shutdown_reason == LIBXL_SHUTDOWN_REASON_CRASH) {
>                      dom_event = virDomainEventNewFromObj(vm,
>                                                VIR_DOMAIN_EVENT_STOPPED,
>                                                VIR_DOMAIN_EVENT_STOPPED_CRASHED);
> @@ -430,18 +549,18 @@ static void libxlEventHandler(int watch,
>                  } else {
>                      reason = VIR_DOMAIN_SHUTOFF_SHUTDOWN;
>                  }
> -                libxlVmReap(driver, vm, 0, reason);
> +                libxlVmReap(driver, vm, reason);
>                  if (!vm->persistent) {
>                      virDomainRemoveInactive(&driver->domains, vm);
>                      vm = NULL;
>                  }
>                  break;
> -            case SHUTDOWN_reboot:
> -                libxlVmReap(driver, vm, 0, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
> +            case LIBXL_SHUTDOWN_REASON_REBOOT:
> +                libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
>                  libxlVmStart(driver, vm, 0, -1);
>                  break;
>              default:
> -                VIR_INFO("Unhandled shutdown_reason %d", info.shutdown_reason);
> +                VIR_INFO("Unhandled shutdown_reason %d", event->u.domain_shutdown.shutdown_reason);
>                  break;
>          }
>      }
> @@ -454,9 +573,14 @@ cleanup:
>          libxlDomainEventQueue(driver, dom_event);
>          libxlDriverUnlock(driver);
>      }
> -    libxl_free_event(&event);
>  }
> 
> +static const struct libxl_event_hooks ev_hooks = {
> +    .event_occurs_mask = LIBXL_EVENTMASK_ALL,
> +    .event_occurs = libxlEventHandler,
> +    .disaster = NULL,
> +};
> +
>  /*
>   * Register domain events with libxenlight and insert event handles
>   * in libvirt's event loop.
> @@ -465,40 +589,18 @@ static int
>  libxlCreateDomEvents(virDomainObjPtr vm)
>  {
>      libxlDomainObjPrivatePtr priv = vm->privateData;
> -    int fd;
> 
> -    if (VIR_ALLOC(priv->dWaiter) < 0) {
> -        virReportOOMError();
> -        return -1;
> -    }
> -
> -    if (libxl_wait_for_domain_death(&priv->ctx, vm->def->id, priv->dWaiter))
> -        goto error;
> -
> -    libxl_get_wait_fd(&priv->ctx, &fd);
> -    if (fd < 0)
> -        goto error;
> +    libxl_event_register_callbacks(priv->ctx, &ev_hooks, vm);
> 
> -    priv->waiterFD = fd;
> -    /* Add a reference to the domain object while it is injected in
> -     * the event loop.
> -     */
> -    virObjectRef(vm);
> -    if ((priv->eventHdl = virEventAddHandle(
> -             fd,
> -             VIR_EVENT_HANDLE_READABLE | VIR_EVENT_HANDLE_ERROR,
> -             libxlEventHandler,
> -             vm, libxlDomainObjUnref)) < 0) {
> -        virObjectUnref(vm);
> +    if (libxl_evenable_domain_death(priv->ctx, vm->def->id, 0, &priv->deathW))
>          goto error;
> -    }
> 
>      return 0;
> 
>  error:
> -    libxl_free_waiter(priv->dWaiter);
> -    VIR_FREE(priv->dWaiter);
> -    priv->eventHdl = -1;
> +    if (priv->deathW)
> +        libxl_evdisable_domain_death(priv->ctx, priv->deathW);
> +    VIR_FREE(priv->deathW);
>      return -1;
>  }
> 
> @@ -507,7 +609,7 @@ libxlDomainSetVcpuAffinites(libxlDriverPrivatePtr driver, virDomainObjPtr vm)
>  {
>      libxlDomainObjPrivatePtr priv = vm->privateData;
>      virDomainDefPtr def = vm->def;
> -    libxl_cpumap map;
> +    libxl_bitmap map;
>      uint8_t *cpumask = NULL;
>      uint8_t *cpumap = NULL;
>      virNodeInfo nodeinfo;
> @@ -539,7 +641,7 @@ libxlDomainSetVcpuAffinites(libxlDriverPrivatePtr driver, virDomainObjPtr vm)
>          map.size = cpumaplen;
>          map.map = cpumap;
> 
> -        if (libxl_set_vcpuaffinity(&priv->ctx, def->id, vcpu, &map) != 0) {
> +        if (libxl_set_vcpuaffinity(priv->ctx, def->id, vcpu, &map) != 0) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("Failed to pin vcpu '%d' with libxenlight"), vcpu);
>              goto cleanup;
> @@ -565,11 +667,10 @@ libxlFreeMem(libxlDomainObjPrivatePtr priv, libxl_domain_config *d_config)
>      int tries = 3;
>      int wait_secs = 10;
> 
> -    if ((ret = libxl_domain_need_memory(&priv->ctx, &d_config->b_info,
> -                                        &d_config->dm_info,
> +    if ((ret = libxl_domain_need_memory(priv->ctx, &d_config->b_info,
>                                          &needed_mem)) >= 0) {
>          for (i = 0; i < tries; ++i) {
> -            if ((ret = libxl_get_free_memory(&priv->ctx, &free_mem)) < 0)
> +            if ((ret = libxl_get_free_memory(priv->ctx, &free_mem)) < 0)
>                  break;
> 
>              if (free_mem >= needed_mem) {
> @@ -577,17 +678,17 @@ libxlFreeMem(libxlDomainObjPrivatePtr priv, libxl_domain_config *d_config)
>                  break;
>              }
> 
> -            if ((ret = libxl_set_memory_target(&priv->ctx, 0,
> +            if ((ret = libxl_set_memory_target(priv->ctx, 0,
>                                                 free_mem - needed_mem,
>                                                 /* relative */ 1, 0)) < 0)
>                  break;
> 
> -            ret = libxl_wait_for_free_memory(&priv->ctx, 0, needed_mem,
> +            ret = libxl_wait_for_free_memory(priv->ctx, 0, needed_mem,
>                                               wait_secs);
>              if (ret == 0 || ret != ERROR_NOMEM)
>                  break;
> 
> -            if ((ret = libxl_wait_for_memory_target(&priv->ctx, 0, 1)) < 0)
> +            if ((ret = libxl_wait_for_memory_target(priv->ctx, 0, 1)) < 0)
>                  break;
>          }
>      }
> @@ -613,7 +714,6 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>      char *dom_xml = NULL;
>      char *managed_save_path = NULL;
>      int managed_save_fd = -1;
> -    pid_t child_console_pid = -1;
>      libxlDomainObjPrivatePtr priv = vm->privateData;
> 
>      /* If there is a managed saved state restore it instead of starting
> @@ -657,7 +757,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>          VIR_FREE(managed_save_path);
>      }
> 
> -    memset(&d_config, 0, sizeof(d_config));
> +    libxl_domain_config_init(&d_config);
> 
>      if (libxlBuildDomainConfig(driver, vm->def, &d_config) < 0)
>          return -1;
> @@ -669,13 +769,14 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>          goto error;
>      }
> 
> +    /* use as synchronous operations => ao_how = NULL and no intermediate reports => ao_progress = NULL */
> +
>      if (restore_fd < 0)
> -        ret = libxl_domain_create_new(&priv->ctx, &d_config,
> -                                      NULL, &child_console_pid, &domid);
> +        ret = libxl_domain_create_new(priv->ctx, &d_config,
> +                                      &domid, NULL, NULL);
>      else
> -        ret = libxl_domain_create_restore(&priv->ctx, &d_config, NULL,
> -                                          &child_console_pid, &domid,
> -                                          restore_fd);
> +        ret = libxl_domain_create_restore(priv->ctx, &d_config, &domid,
> +                                          restore_fd, NULL, NULL);
> 
>      if (ret) {
>          if (restore_fd < 0)
> @@ -693,7 +794,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>      if ((dom_xml = virDomainDefFormat(vm->def, 0)) == NULL)
>          goto error;
> 
> -    if (libxl_userdata_store(&priv->ctx, domid, "libvirt-xml",
> +    if (libxl_userdata_store(priv->ctx, domid, "libvirt-xml",
>                               (uint8_t *)dom_xml, strlen(dom_xml) + 1)) {
>          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                         _("libxenlight failed to store userdata"));
> @@ -707,7 +808,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>          goto error;
> 
>      if (!start_paused) {
> -        libxl_domain_unpause(&priv->ctx, domid);
> +        libxl_domain_unpause(priv->ctx, domid);
>          virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_BOOTED);
>      } else {
>          virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER);
> @@ -723,18 +824,18 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>                                           VIR_DOMAIN_EVENT_STARTED_RESTORED);
>      libxlDomainEventQueue(driver, event);
> 
> -    libxl_domain_config_destroy(&d_config);
> +    libxl_domain_config_dispose(&d_config);
>      VIR_FREE(dom_xml);
>      VIR_FORCE_CLOSE(managed_save_fd);
>      return 0;
> 
>  error:
>      if (domid > 0) {
> -        libxl_domain_destroy(&priv->ctx, domid, 0);
> +        libxl_domain_destroy(priv->ctx, domid, NULL);
>          vm->def->id = -1;
>          virDomainObjSetState(vm, VIR_DOMAIN_SHUTOFF, VIR_DOMAIN_SHUTOFF_FAILED);
>      }
> -    libxl_domain_config_destroy(&d_config);
> +    libxl_domain_config_dispose(&d_config);
>      VIR_FREE(dom_xml);
>      VIR_FREE(managed_save_path);
>      virDomainDefFree(def);
> @@ -762,7 +863,7 @@ libxlReconnectDomain(void *payload,
>      virDomainObjLock(vm);
> 
>      /* Does domain still exist? */
> -    rc = libxl_domain_info(&driver->ctx, &d_info, vm->def->id);
> +    rc = libxl_domain_info(driver->ctx, &d_info, vm->def->id);
>      if (rc == ERROR_INVAL) {
>          goto out;
>      } else if (rc != 0) {
> @@ -772,7 +873,7 @@ libxlReconnectDomain(void *payload,
>      }
> 
>      /* Is this a domain that was under libvirt control? */
> -    if (libxl_userdata_retrieve(&driver->ctx, vm->def->id,
> +    if (libxl_userdata_retrieve(driver->ctx, vm->def->id,
>                                  "libvirt-xml", &data, &len)) {
>          VIR_DEBUG("libxl_userdata_retrieve failed, ignoring domain %d", vm->def->id);
>          goto out;
> @@ -810,7 +911,7 @@ libxlShutdown(void)
>      libxlDriverLock(libxl_driver);
>      virCapabilitiesFree(libxl_driver->caps);
>      virDomainObjListDeinit(&libxl_driver->domains);
> -    libxl_ctx_free(&libxl_driver->ctx);
> +    libxl_ctx_free(libxl_driver->ctx);
>      xtl_logger_destroy(libxl_driver->logger);
>      if (libxl_driver->logger_file)
>          VIR_FORCE_FCLOSE(libxl_driver->logger_file);
> @@ -943,14 +1044,14 @@ libxlStartup(int privileged) {
>          goto fail;
>      }
> 
> -    if (libxl_ctx_init(&libxl_driver->ctx,
> -                       LIBXL_VERSION,
> +    if (libxl_ctx_alloc(&libxl_driver->ctx,
> +                       LIBXL_VERSION, 0,
>                         libxl_driver->logger)) {
>          VIR_INFO("cannot initialize libxenlight context, probably not running in a Xen Dom0, disabling driver");
>          goto fail;
>      }
> 
> -    if ((ver_info = libxl_get_version_info(&libxl_driver->ctx)) == NULL) {
> +    if ((ver_info = libxl_get_version_info(libxl_driver->ctx)) == NULL) {
>          VIR_INFO("cannot version information from libxenlight, disabling driver");
>          goto fail;
>      }
> @@ -958,7 +1059,7 @@ libxlStartup(int privileged) {
>              (ver_info->xen_version_minor * 1000);
> 
>      if ((libxl_driver->caps =
> -         libxlMakeCapabilities(&libxl_driver->ctx)) == NULL) {
> +         libxlMakeCapabilities(libxl_driver->ctx)) == NULL) {
>          VIR_ERROR(_("cannot create capabilities for libxenlight"));
>          goto error;
>      }
> @@ -1115,7 +1216,7 @@ libxlGetMaxVcpus(virConnectPtr conn, const char *type ATTRIBUTE_UNUSED)
>      int ret;
>      libxlDriverPrivatePtr driver = conn->privateData;
> 
> -    ret = libxl_get_max_cpus(&driver->ctx);
> +    ret = libxl_get_max_cpus(driver->ctx);
>      /* libxl_get_max_cpus() will return 0 if there were any failures,
>         e.g. xc_physinfo() failing */
>      if (ret == 0)
> @@ -1320,7 +1421,7 @@ libxlDomainSuspend(virDomainPtr dom)
>      priv = vm->privateData;
> 
>      if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_PAUSED) {
> -        if (libxl_domain_pause(&priv->ctx, dom->id) != 0) {
> +        if (libxl_domain_pause(priv->ctx, dom->id) != 0) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("Failed to suspend domain '%d' with libxenlight"),
>                             dom->id);
> @@ -1379,7 +1480,7 @@ libxlDomainResume(virDomainPtr dom)
>      priv = vm->privateData;
> 
>      if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
> -        if (libxl_domain_unpause(&priv->ctx, dom->id) != 0) {
> +        if (libxl_domain_unpause(priv->ctx, dom->id) != 0) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("Failed to resume domain '%d' with libxenlight"),
>                             dom->id);
> @@ -1436,7 +1537,7 @@ libxlDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
>      }
> 
>      priv = vm->privateData;
> -    if (libxl_domain_shutdown(&priv->ctx, dom->id, LIBXL_DOM_REQ_POWEROFF) != 0) {
> +    if (libxl_domain_shutdown(priv->ctx, dom->id) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to shutdown domain '%d' with libxenlight"),
>                         dom->id);
> @@ -1489,7 +1590,7 @@ libxlDomainReboot(virDomainPtr dom, unsigned int flags)
>      }
> 
>      priv = vm->privateData;
> -    if (libxl_domain_shutdown(&priv->ctx, dom->id, LIBXL_DOM_REQ_REBOOT) != 0) {
> +    if (libxl_domain_reboot(priv->ctx, dom->id) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to reboot domain '%d' with libxenlight"),
>                         dom->id);
> @@ -1534,7 +1635,7 @@ libxlDomainDestroyFlags(virDomainPtr dom,
>      event = virDomainEventNewFromObj(vm,VIR_DOMAIN_EVENT_STOPPED,
>                                       VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
> 
> -    if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_DESTROYED) != 0) {
> +    if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to destroy domain '%d'"), dom->id);
>          goto cleanup;
> @@ -1672,7 +1773,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
> 
>          if (flags & VIR_DOMAIN_MEM_LIVE) {
>              priv = vm->privateData;
> -            if (libxl_domain_setmaxmem(&priv->ctx, dom->id, newmem) < 0) {
> +            if (libxl_domain_setmaxmem(priv->ctx, dom->id, newmem) < 0) {
>                  virReportError(VIR_ERR_INTERNAL_ERROR,
>                                 _("Failed to set maximum memory for domain '%d'"
>                                   " with libxenlight"), dom->id);
> @@ -1701,7 +1802,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
> 
>          if (flags & VIR_DOMAIN_MEM_LIVE) {
>              priv = vm->privateData;
> -            if (libxl_set_memory_target(&priv->ctx, dom->id, newmem, 0,
> +            if (libxl_set_memory_target(priv->ctx, dom->id, newmem, 0,
>                                          /* force */ 1) < 0) {
>                  virReportError(VIR_ERR_INTERNAL_ERROR,
>                                 _("Failed to set memory for domain '%d'"
> @@ -1761,7 +1862,7 @@ libxlDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info)
>          info->memory = vm->def->mem.cur_balloon;
>          info->maxMem = vm->def->mem.max_balloon;
>      } else {
> -        if (libxl_domain_info(&driver->ctx, &d_info, dom->id) != 0) {
> +        if (libxl_domain_info(driver->ctx, &d_info, dom->id) != 0) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("libxl_domain_info failed for domain '%d'"), dom->id);
>              goto cleanup;
> @@ -1861,7 +1962,7 @@ libxlDoDomainSave(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>          goto cleanup;
>      }
> 
> -    if (libxl_domain_suspend(&priv->ctx, NULL, vm->def->id, fd) != 0) {
> +    if (libxl_domain_suspend(priv->ctx, vm->def->id, fd, 0, NULL) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to save domain '%d' with libxenlight"),
>                         vm->def->id);
> @@ -1871,7 +1972,7 @@ libxlDoDomainSave(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>      event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
>                                           VIR_DOMAIN_EVENT_STOPPED_SAVED);
> 
> -    if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_SAVED) != 0) {
> +    if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_SAVED) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to destroy domain '%d'"), vm->def->id);
>          goto cleanup;
> @@ -2028,7 +2129,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
> 
>      if (!(flags & VIR_DUMP_LIVE) &&
>          virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
> -        if (libxl_domain_pause(&priv->ctx, dom->id) != 0) {
> +        if (libxl_domain_pause(priv->ctx, dom->id) != 0) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("Before dumping core, failed to suspend domain '%d'"
>                               " with libxenlight"),
> @@ -2039,7 +2140,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
>          paused = true;
>      }
> 
> -    if (libxl_domain_core_dump(&priv->ctx, dom->id, to) != 0) {
> +    if (libxl_domain_core_dump(priv->ctx, dom->id, to, NULL) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to dump core of domain '%d' with libxenlight"),
>                         dom->id);
> @@ -2048,7 +2149,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
> 
>      libxlDriverLock(driver);
>      if (flags & VIR_DUMP_CRASH) {
> -        if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_CRASHED) != 0) {
> +        if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_CRASHED) != 0) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("Failed to destroy domain '%d'"), dom->id);
>              goto cleanup_unlock;
> @@ -2069,7 +2170,7 @@ cleanup_unlock:
>      libxlDriverUnlock(driver);
>  cleanup_unpause:
>      if (virDomainObjIsActive(vm) && paused) {
> -        if (libxl_domain_unpause(&priv->ctx, dom->id) != 0) {
> +        if (libxl_domain_unpause(priv->ctx, dom->id) != 0) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("After dumping core, failed to resume domain '%d' with"
>                               " libxenlight"), dom->id);
> @@ -2227,7 +2328,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
>      libxlDomainObjPrivatePtr priv;
>      virDomainDefPtr def;
>      virDomainObjPtr vm;
> -    libxl_cpumap map;
> +    libxl_bitmap map;
>      uint8_t *bitmask = NULL;
>      unsigned int maplen;
>      unsigned int i, pos;
> @@ -2322,7 +2423,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
>          break;
> 
>      case VIR_DOMAIN_VCPU_LIVE:
> -        if (libxl_set_vcpuonline(&priv->ctx, dom->id, &map) != 0) {
> +        if (libxl_set_vcpuonline(priv->ctx, dom->id, &map) != 0) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("Failed to set vcpus for domain '%d'"
>                               " with libxenlight"), dom->id);
> @@ -2331,7 +2432,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
>          break;
> 
>      case VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG:
> -        if (libxl_set_vcpuonline(&priv->ctx, dom->id, &map) != 0) {
> +        if (libxl_set_vcpuonline(priv->ctx, dom->id, &map) != 0) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("Failed to set vcpus for domain '%d'"
>                               " with libxenlight"), dom->id);
> @@ -2427,7 +2528,7 @@ libxlDomainPinVcpu(virDomainPtr dom, unsigned int vcpu, unsigned char *cpumap,
>      libxlDomainObjPrivatePtr priv;
>      virDomainObjPtr vm;
>      int ret = -1;
> -    libxl_cpumap map;
> +    libxl_bitmap map;
> 
>      libxlDriverLock(driver);
>      vm = virDomainFindByUUID(&driver->domains, dom->uuid);
> @@ -2448,7 +2549,7 @@ libxlDomainPinVcpu(virDomainPtr dom, unsigned int vcpu, unsigned char *cpumap,
> 
>      map.size = maplen;
>      map.map = cpumap;
> -    if (libxl_set_vcpuaffinity(&priv->ctx, dom->id, vcpu, &map) != 0) {
> +    if (libxl_set_vcpuaffinity(priv->ctx, dom->id, vcpu, &map) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to pin vcpu '%d' with libxenlight"), vcpu);
>          goto cleanup;
> @@ -2511,7 +2612,7 @@ libxlDomainGetVcpus(virDomainPtr dom, virVcpuInfoPtr info, int maxinfo,
>      }
> 
>      priv = vm->privateData;
> -    if ((vcpuinfo = libxl_list_vcpu(&priv->ctx, dom->id, &maxcpu,
> +    if ((vcpuinfo = libxl_list_vcpu(priv->ctx, dom->id, &maxcpu,
>                                      &hostcpus)) == NULL) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to list vcpus for domain '%d' with libxenlight"),
> @@ -2538,7 +2639,7 @@ libxlDomainGetVcpus(virDomainPtr dom, virVcpuInfoPtr info, int maxinfo,
>                     MIN(maplen, vcpuinfo[i].cpumap.size));
>          }
> 
> -        libxl_vcpuinfo_destroy(&vcpuinfo[i]);
> +        libxl_vcpuinfo_dispose(&vcpuinfo[i]);
>      }
>      VIR_FREE(vcpuinfo);
> 
> @@ -2596,7 +2697,7 @@ libxlDomainXMLFromNative(virConnectPtr conn, const char * nativeFormat,
>          goto cleanup;
>      }
> 
> -    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
> +    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
>          VIR_ERROR(_("cannot get version information from libxenlight"));
>          goto cleanup;
>      }
> @@ -2639,7 +2740,7 @@ libxlDomainXMLToNative(virConnectPtr conn, const char * nativeFormat,
>          goto cleanup;
>      }
> 
> -    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
> +    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
>          VIR_ERROR(_("cannot get version information from libxenlight"));
>          goto cleanup;
>      }
> @@ -2899,10 +3000,10 @@ libxlDomainChangeEjectableMedia(libxlDomainObjPrivatePtr priv,
>          return -1;
>      }
> 
> -    if (libxlMakeDisk(vm->def, disk, &x_disk) < 0)
> +    if (libxlMakeDisk(disk, &x_disk) < 0)
>          goto cleanup;
> 
> -    if ((ret = libxl_cdrom_insert(&priv->ctx, vm->def->id, &x_disk)) < 0) {
> +    if ((ret = libxl_cdrom_insert(priv->ctx, vm->def->id, &x_disk, NULL)) < 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("libxenlight failed to change media for disk '%s'"),
>                         disk->dst);
> @@ -2954,11 +3055,11 @@ libxlDomainAttachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
>                      goto cleanup;
>                  }
> 
> -                if (libxlMakeDisk(vm->def, l_disk, &x_disk) < 0)
> +                if (libxlMakeDisk(l_disk, &x_disk) < 0)
>                      goto cleanup;
> 
> -                if ((ret = libxl_device_disk_add(&priv->ctx, vm->def->id,
> -                                                &x_disk)) < 0) {
> +                if ((ret = libxl_device_disk_add(priv->ctx, vm->def->id,
> +                                                &x_disk, NULL)) < 0) {
>                      virReportError(VIR_ERR_INTERNAL_ERROR,
>                                     _("libxenlight failed to attach disk '%s'"),
>                                     l_disk->dst);
> @@ -2991,7 +3092,6 @@ libxlDomainDetachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
>      virDomainDiskDefPtr l_disk = NULL;
>      libxl_device_disk x_disk;
>      int i;
> -    int wait_secs = 2;
>      int ret = -1;
> 
>      switch (dev->data.disk->device)  {
> @@ -3008,11 +3108,11 @@ libxlDomainDetachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
> 
>                  l_disk = vm->def->disks[i];
> 
> -                if (libxlMakeDisk(vm->def, l_disk, &x_disk) < 0)
> +                if (libxlMakeDisk(l_disk, &x_disk) < 0)
>                      goto cleanup;
> 
> -                if ((ret = libxl_device_disk_del(&priv->ctx, &x_disk,
> -                                                 wait_secs)) < 0) {
> +                if ((ret = libxl_device_disk_remove(priv->ctx, vm->def->id,
> +                                                    &x_disk, NULL)) < 0) {
>                      virReportError(VIR_ERR_INTERNAL_ERROR,
>                                     _("libxenlight failed to detach disk '%s'"),
>                                     l_disk->dst);
> @@ -3383,13 +3483,13 @@ libxlNodeGetFreeMemory(virConnectPtr conn)
>      const libxl_version_info* ver_info;
>      libxlDriverPrivatePtr driver = conn->privateData;
> 
> -    if (libxl_get_physinfo(&driver->ctx, &phy_info)) {
> +    if (libxl_get_physinfo(driver->ctx, &phy_info)) {
>          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                         _("libxl_get_physinfo_info failed"));
>          return 0;
>      }
> 
> -    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
> +    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
>          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                         _("libxl_get_version_info failed"));
>          return 0;
> @@ -3536,7 +3636,7 @@ libxlDomainGetSchedulerType(virDomainPtr dom, int *nparams)
>      libxlDomainObjPrivatePtr priv;
>      virDomainObjPtr vm;
>      char * ret = NULL;
> -    int sched_id;
> +    libxl_scheduler sched_id;
> 
>      libxlDriverLock(driver);
>      vm = virDomainFindByUUID(&driver->domains, dom->uuid);
> @@ -3553,31 +3653,29 @@ libxlDomainGetSchedulerType(virDomainPtr dom, int *nparams)
>      }
> 
>      priv = vm->privateData;
> -    if ((sched_id = libxl_get_sched_id(&priv->ctx)) < 0) {
> -        virReportError(VIR_ERR_INTERNAL_ERROR,
> -                       _("Failed to get scheduler id for domain '%d'"
> -                         " with libxenlight"), dom->id);
> -        goto cleanup;
> -    }
> +    sched_id = libxl_get_scheduler(priv->ctx);
> 
>      if (nparams)
>          *nparams = 0;
>      switch (sched_id) {
> -    case XEN_SCHEDULER_SEDF:
> +    case LIBXL_SCHEDULER_SEDF:
>          ret = strdup("sedf");
>          break;
> -    case XEN_SCHEDULER_CREDIT:
> +    case LIBXL_SCHEDULER_CREDIT:
>          ret = strdup("credit");
>          if (nparams)
>              *nparams = XEN_SCHED_CREDIT_NPARAM;
>          break;
> -    case XEN_SCHEDULER_CREDIT2:
> +    case LIBXL_SCHEDULER_CREDIT2:
>          ret = strdup("credit2");
>          break;
> -    case XEN_SCHEDULER_ARINC653:
> +    case LIBXL_SCHEDULER_ARINC653:
>          ret = strdup("arinc653");
>          break;
>      default:
> +        virReportError(VIR_ERR_INTERNAL_ERROR,
> +                   _("Failed to get scheduler id for domain '%d'"
> +                     " with libxenlight"), dom->id);
>          goto cleanup;
>      }
> 
> @@ -3599,8 +3697,8 @@ libxlDomainGetSchedulerParametersFlags(virDomainPtr dom,
>      libxlDriverPrivatePtr driver = dom->conn->privateData;
>      libxlDomainObjPrivatePtr priv;
>      virDomainObjPtr vm;
> -    libxl_sched_credit sc_info;
> -    int sched_id;
> +    libxl_domain_sched_params sc_info;
> +    libxl_scheduler sched_id;
>      int ret = -1;
> 
>      virCheckFlags(0, -1);
> @@ -3610,31 +3708,28 @@ libxlDomainGetSchedulerParametersFlags(virDomainPtr dom,
>      libxlDriverUnlock(driver);
> 
>      if (!vm) {
> -        virReportError(VIR_ERR_NO_DOMAIN, "%s", _("no domain with matching uuid"));
> +        virReportError(VIR_ERR_NO_DOMAIN, "%s",
> +                       _("no domain with matching uuid"));
>          goto cleanup;
>      }
> 
>      if (!virDomainObjIsActive(vm)) {
> -        virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("Domain is not running"));
> +        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
> +                       _("Domain is not running"));
>          goto cleanup;
>      }
> 
>      priv = vm->privateData;
> 
> -    if ((sched_id = libxl_get_sched_id(&priv->ctx)) < 0) {
> -        virReportError(VIR_ERR_INTERNAL_ERROR,
> -                       _("Failed to get scheduler id for domain '%d'"
> -                         " with libxenlight"), dom->id);
> -        goto cleanup;
> -    }
> +    sched_id = libxl_get_scheduler(priv->ctx);
> 
> -    if (sched_id != XEN_SCHEDULER_CREDIT) {
> +    if (sched_id != LIBXL_SCHEDULER_CREDIT) {
>          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                         _("Only 'credit' scheduler is supported"));
>          goto cleanup;
>      }
> 
> -    if (libxl_sched_credit_domain_get(&priv->ctx, dom->id, &sc_info) != 0) {
> +    if (libxl_domain_sched_params_get(priv->ctx, dom->id, &sc_info) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to get scheduler parameters for domain '%d'"
>                           " with libxenlight"), dom->id);
> @@ -3677,7 +3772,7 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
>      libxlDriverPrivatePtr driver = dom->conn->privateData;
>      libxlDomainObjPrivatePtr priv;
>      virDomainObjPtr vm;
> -    libxl_sched_credit sc_info;
> +    libxl_domain_sched_params sc_info;
>      int sched_id;
>      int i;
>      int ret = -1;
> @@ -3707,20 +3802,15 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
> 
>      priv = vm->privateData;
> 
> -    if ((sched_id = libxl_get_sched_id(&priv->ctx)) < 0) {
> -        virReportError(VIR_ERR_INTERNAL_ERROR,
> -                       _("Failed to get scheduler id for domain '%d'"
> -                         " with libxenlight"), dom->id);
> -        goto cleanup;
> -    }
> +    sched_id = libxl_get_scheduler(priv->ctx);
> 
> -    if (sched_id != XEN_SCHEDULER_CREDIT) {
> +    if (sched_id != LIBXL_SCHEDULER_CREDIT) {
>          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                         _("Only 'credit' scheduler is supported"));
>          goto cleanup;
>      }
> 
> -    if (libxl_sched_credit_domain_get(&priv->ctx, dom->id, &sc_info) != 0) {
> +    if (libxl_domain_sched_params_get(priv->ctx, dom->id, &sc_info) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to get scheduler parameters for domain '%d'"
>                           " with libxenlight"), dom->id);
> @@ -3737,7 +3827,7 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
>          }
>      }
> 
> -    if (libxl_sched_credit_domain_set(&priv->ctx, dom->id, &sc_info) != 0) {
> +    if (libxl_domain_sched_params_set(priv->ctx, dom->id, &sc_info) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to set scheduler parameters for domain '%d'"
>                           " with libxenlight"), dom->id);
> --
> 1.7.10.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:57:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:57:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJmh-0004IA-S2; Tue, 27 Nov 2012 11:57:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TdJmf-0004Hv-Sx
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:57:02 +0000
Received: from [85.158.138.51:14431] by server-2.bemta-3.messagelabs.com id
	AE/94-04744-D8AA4B05; Tue, 27 Nov 2012 11:57:01 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354017415!25303253!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ3Mzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32448 invoked from network); 27 Nov 2012 11:56:56 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:56:56 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="45723601"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:56:53 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 06:56:52 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TdJmV-000574-VL;
	Tue, 27 Nov 2012 11:56:51 +0000
Date: Tue, 27 Nov 2012 11:56:49 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Jim Fehlig <jfehlig@suse.com>
In-Reply-To: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
Message-ID: <alpine.DEB.2.02.1211271156330.5310@kaball.uk.xensource.com>
References: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "libvir-list@redhat.com" <libvir-list@redhat.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Convert libxl driver to Xen 4.2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 26 Nov 2012, Jim Fehlig wrote:
> Based on a patch originally authored by Daniel De Graaf
> 
>   http://lists.xen.org/archives/html/xen-devel/2012-05/msg00565.html
> 
> This patch converts the Xen libxl driver to support only Xen >= 4.2.
> Support for Xen 4.1 libxl is dropped since that version of libxl is
> designated 'technology preview' only and is incompatible with Xen 4.2
> libxl.  Additionally, the default toolstack in Xen 4.1 is still xend,
> for which libvirt has a stable, functional driver.

It looks pretty good to me, thanks!



>  configure.ac             |    8 +-
>  docs/drvxen.html.in      |    8 +
>  libvirt.spec.in          |    4 +-
>  src/libxl/libxl_conf.c   |  370 ++++++++++++++---------------------
>  src/libxl/libxl_conf.h   |   17 +-
>  src/libxl/libxl_driver.c |  488 +++++++++++++++++++++++++++-------------------
>  6 files changed, 459 insertions(+), 436 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 849d787..c1a9943 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -717,16 +717,14 @@ if test "$with_libxl" != "no" ; then
>      fi
>      CFLAGS="$CFLAGS $LIBXL_CFLAGS"
>      LIBS="$LIBS $LIBXL_LIBS"
> -    AC_CHECK_LIB([xenlight], [libxl_domain_create_new], [
> +    AC_CHECK_LIB([xenlight], [libxl_ctx_alloc], [
>          with_libxl=yes
> -        LIBXL_LIBS="$LIBXL_LIBS -lxenlight -lxenstore -lxenctrl -lxenguest -luuid -lutil -lblktapctl"
> +        LIBXL_LIBS="$LIBXL_LIBS -lxenlight"
>      ],[
>          if test "$with_libxl" = "yes"; then
>              fail=1
>          fi
>          with_libxl=no
> -    ],[
> -        -lxenstore -lxenctrl -lxenguest -luuid -lutil -lblktapctl
>      ])
>  fi
> 
> @@ -734,7 +732,7 @@ LIBS="$old_LIBS"
>  CFLAGS="$old_CFLAGS"
> 
>  if test $fail = 1; then
> -    AC_MSG_ERROR([You must install the libxl Library to compile libxenlight driver with -lxl])
> +    AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.2 to compile libxenlight driver with -lxl])
>  fi
> 
>  if test "$with_libxl" = "yes"; then
> diff --git a/docs/drvxen.html.in b/docs/drvxen.html.in
> index 0bca935..06bd911 100644
> --- a/docs/drvxen.html.in
> +++ b/docs/drvxen.html.in
> @@ -53,6 +53,14 @@
>          the <code>/etc/xen</code> directory. It is important not to place
>          any other non-config files in this directory.
>        </li>
> +      <li>
> +        <strong>libxl</strong>: Starting with Xen 4.2, the legacy XenD/xm
> +        toolstack is deprecated in favor of libxl, also commonly called
> +        libxenlight.  libvirt supports this new Xen toolstack via the
> +        libxl driver.  If XenD is enabled, the legacy xen driver consisting
> +        of the above mentioned channels will be used.  If XenD is disabled,
> +        the libxl driver will be used.
> +      </li>
>      </ul>
> 
>      <h2><a name="uri">Connections to Xen driver</a></h2>
> diff --git a/libvirt.spec.in b/libvirt.spec.in
> index 35c103b..bb274f5 100644
> --- a/libvirt.spec.in
> +++ b/libvirt.spec.in
> @@ -188,8 +188,8 @@
>  %endif
>  %endif
> 
> -# Fedora doesn't have new enough Xen for libxl until F16
> -%if 0%{?fedora} && 0%{?fedora} < 16
> +# Fedora doesn't have new enough Xen for libxl until F18
> +%if 0%{?fedora} && 0%{?fedora} < 18
>  %define with_libxl 0
>  %endif
> 
> diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
> index 1c3130b..73abdfa 100644
> --- a/src/libxl/libxl_conf.c
> +++ b/src/libxl/libxl_conf.c
> @@ -41,6 +41,7 @@
>  #include "capabilities.h"
>  #include "libxl_driver.h"
>  #include "libxl_conf.h"
> +#include "libxl_utils.h"
>  #include "storage_file.h"
> 
> 
> @@ -62,6 +63,52 @@ struct guest_arch {
>  static const char *xen_cap_re = "(xen|hvm)-[[:digit:]]+\\.[[:digit:]]+-(x86_32|x86_64|ia64|powerpc64)(p|be)?";
>  static regex_t xen_cap_rec;
> 
> +/*
> + * Copied from split_string_into_string_list() in
> + * $xen-sources/tools/libxl/xl_cmdimpl.c, which is licensed LGPL v2.1.
> + */
> +static int
> +libxlSplitStringIntoStringList(const char *str,
> +                               const char *delim,
> +                               libxl_string_list *psl)
> +{
> +    char *s, *saveptr;
> +    const char *p;
> +    libxl_string_list sl;
> +    int i = 0, nr = 0;
> +
> +    s = strdup(str);
> +    if (s == NULL) {
> +        virReportOOMError();
> +        return -1;
> +    }
> +
> +    /* Count number of entries */
> +    p = strtok_r(s, delim, &saveptr);
> +    do {
> +        nr++;
> +    } while ((p = strtok_r(NULL, delim, &saveptr)));
> +
> +    VIR_FREE(s);
> +    s = strdup(str);
> +
> +    if (VIR_ALLOC_N(sl, nr + 1) < 0) {
> +        virReportOOMError();
> +        VIR_FREE(s);
> +        return -1;
> +    }
> +
> +    p = strtok_r(s, delim, &saveptr);
> +    do {
> +        sl[i] = strdup(p);
> +        i++;
> +    } while ((p = strtok_r(NULL, delim, &saveptr)));
> +    sl[i] = NULL;
> +
> +    *psl = sl;
> +    VIR_FREE(s);
> +    return 0;
> +}
> 
>  static int
>  libxlNextFreeVncPort(libxlDriverPrivatePtr driver, int startPort)
> @@ -360,18 +407,36 @@ libxlMakeCapabilitiesInternal(const char *hostmachine,
>  }
> 
>  static int
> -libxlMakeDomCreateInfo(virDomainDefPtr def, libxl_domain_create_info *c_info)
> +libxlMakeDomCreateInfo(libxlDriverPrivatePtr driver,
> +                       virDomainDefPtr def,
> +                       libxl_domain_create_info *c_info)
>  {
>      char uuidstr[VIR_UUID_STRING_BUFLEN];
> 
> -    libxl_init_create_info(c_info);
> +    libxl_domain_create_info_init(c_info);
> +
> +    if (STREQ(def->os.type, "hvm"))
> +        c_info->type = LIBXL_DOMAIN_TYPE_HVM;
> +    else
> +        c_info->type = LIBXL_DOMAIN_TYPE_PV;
> 
> -    c_info->hvm = STREQ(def->os.type, "hvm");
>      if ((c_info->name = strdup(def->name)) == NULL) {
>          virReportOOMError();
>          goto error;
>      }
> 
> +    if (def->nseclabels &&
> +        def->seclabels[0]->type == VIR_DOMAIN_SECLABEL_STATIC) {
> +        if (libxl_flask_context_to_sid(driver->ctx,
> +                                       def->seclabels[0]->label,
> +                                       strlen(def->seclabels[0]->label),
> +                                       &c_info->ssidref)) {
> +            virReportError(VIR_ERR_INTERNAL_ERROR,
> +                           _("libxenlight failed to resolve security label '%s'"),
> +                           def->seclabels[0]->label);
> +        }
> +    }
> +
>      virUUIDFormat(def->uuid, uuidstr);
>      if (libxl_uuid_from_string(&c_info->uuid, uuidstr)) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
> @@ -382,7 +447,7 @@ libxlMakeDomCreateInfo(virDomainDefPtr def, libxl_domain_create_info *c_info)
>      return 0;
> 
>  error:
> -    libxl_domain_create_info_destroy(c_info);
> +    libxl_domain_create_info_dispose(c_info);
>      return -1;
>  }
> 
> @@ -393,26 +458,25 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
>      int hvm = STREQ(def->os.type, "hvm");
>      int i;
> 
> -    /* Currently, libxenlight only supports 32 vcpus per domain.
> -     * cur_vcpus member of struct libxl_domain_build_info is defined
> -     * as an int, but its semantic is a bitmap of online vcpus, so
> -     * only 32 can be represented.
> +    /*
> +     * libxl in Xen 4.2 supports up to 128 vcpus, cur_vcpus was replaced
> +     * by avail_vcpus of type libxl_bitmap
>       */
> -    if (def->maxvcpus > 32 || def->vcpus > 32) {
> -        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> -                       _("This version of libxenlight only supports 32 "
> -                         "vcpus per domain"));
> +    if (def->maxvcpus > LIBXL_MAXVCPUS || def->vcpus > LIBXL_MAXVCPUS) {
> +        virReportError(VIR_ERR_INTERNAL_ERROR,
> +                       _("This version of libxenlight only supports %u "
> +                         "vcpus per domain"), LIBXL_MAXVCPUS);
>          return -1;
>      }
> 
> -    libxl_init_build_info(b_info, &d_config->c_info);
> +    libxl_domain_build_info_init(b_info);
> 
> -    b_info->hvm = hvm;
> -    b_info->max_vcpus = def->maxvcpus;
> -    if (def->vcpus == 32)
> -        b_info->cur_vcpus = (uint32_t) -1;
> +    if (hvm)
> +        libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_HVM);
>      else
> -        b_info->cur_vcpus = (1 << def->vcpus) - 1;
> +        libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_PV);
> +    b_info->max_vcpus = def->maxvcpus;
> +    libxl_bitmap_set((&b_info->avail_vcpus), def->vcpus);
>      if (def->clock.ntimers > 0 &&
>          def->clock.timers[0]->name == VIR_DOMAIN_TIMER_NAME_TSC) {
>          switch (def->clock.timers[0]->mode) {
> @@ -426,16 +490,20 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
>                  b_info->tsc_mode = 1;
>          }
>      }
> +    b_info->sched_params.weight = 1000;
>      b_info->max_memkb = def->mem.max_balloon;
>      b_info->target_memkb = def->mem.cur_balloon;
>      if (hvm) {
> -        b_info->u.hvm.pae = def->features & (1 << VIR_DOMAIN_FEATURE_PAE);
> -        b_info->u.hvm.apic = def->features & (1 << VIR_DOMAIN_FEATURE_APIC);
> -        b_info->u.hvm.acpi = def->features & (1 << VIR_DOMAIN_FEATURE_ACPI);
> +        libxl_defbool_set(&b_info->u.hvm.pae,
> +                          def->features & (1 << VIR_DOMAIN_FEATURE_PAE));
> +        libxl_defbool_set(&b_info->u.hvm.apic,
> +                          def->features & (1 << VIR_DOMAIN_FEATURE_APIC));
> +        libxl_defbool_set(&b_info->u.hvm.acpi,
> +                          def->features & (1 << VIR_DOMAIN_FEATURE_ACPI));
>          for (i = 0; i < def->clock.ntimers; i++) {
>              if (def->clock.timers[i]->name == VIR_DOMAIN_TIMER_NAME_HPET &&
>                  def->clock.timers[i]->present == 1) {
> -                b_info->u.hvm.hpet = 1;
> +                libxl_defbool_set(&b_info->u.hvm.hpet, 1);
>              }
>          }
> 
> @@ -446,7 +514,7 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
>           * 256 pages (1MB) per vcpu, plus 1 page per MiB of RAM for the P2M map,
>           * plus 1 page per MiB of RAM to shadow the resident processes.
>           */
> -        b_info->shadow_memkb = 4 * (256 * b_info->cur_vcpus +
> +        b_info->shadow_memkb = 4 * (256 * libxl_bitmap_count_set(&b_info->avail_vcpus) +
>                                      2 * (b_info->max_memkb / 1024));
>      } else {
>          if (def->os.bootloader) {
> @@ -456,10 +524,11 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
>              }
>          }
>          if (def->os.bootloaderArgs) {
> -            if ((b_info->u.pv.bootloader_args = strdup(def->os.bootloaderArgs)) == NULL) {
> -                virReportOOMError();
> +            if (libxlSplitStringIntoStringList(def->os.bootloaderArgs,
> +                                               " \t\n",
> +                                               &b_info->u.pv.bootloader_args)
> +                < 0)
>                  goto error;
> -            }
>          }
>          if (def->os.cmdline) {
>              if ((b_info->u.pv.cmdline = strdup(def->os.cmdline)) == NULL) {
> @@ -469,14 +538,14 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
>          }
>          if (def->os.kernel) {
>              /* libxl_init_build_info() sets kernel.path = strdup("hvmloader") */
> -            VIR_FREE(b_info->kernel.path);
> -            if ((b_info->kernel.path = strdup(def->os.kernel)) == NULL) {
> +            VIR_FREE(b_info->u.pv.kernel);
> +            if ((b_info->u.pv.kernel = strdup(def->os.kernel)) == NULL) {
>                  virReportOOMError();
>                  goto error;
>              }
>          }
>          if (def->os.initrd) {
> -            if ((b_info->u.pv.ramdisk.path = strdup(def->os.initrd)) == NULL) {
> +            if ((b_info->u.pv.ramdisk = strdup(def->os.initrd)) == NULL) {
>                  virReportOOMError();
>                  goto error;
>              }
> @@ -486,13 +555,12 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
>      return 0;
> 
>  error:
> -    libxl_domain_build_info_destroy(b_info);
> +    libxl_domain_build_info_dispose(b_info);
>      return -1;
>  }
> 
>  int
> -libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
> -              libxl_device_disk *x_disk)
> +libxlMakeDisk(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk)
>  {
>      if (l_disk->src && (x_disk->pdev_path = strdup(l_disk->src)) == NULL) {
>          virReportOOMError();
> @@ -509,22 +577,22 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
>              STREQ(l_disk->driverName, "tap2")) {
>              switch (l_disk->format) {
>              case VIR_STORAGE_FILE_QCOW:
> -                x_disk->format = DISK_FORMAT_QCOW;
> -                x_disk->backend = DISK_BACKEND_QDISK;
> +                x_disk->format = LIBXL_DISK_FORMAT_QCOW;
> +                x_disk->backend = LIBXL_DISK_BACKEND_QDISK;
>                  break;
>              case VIR_STORAGE_FILE_QCOW2:
> -                x_disk->format = DISK_FORMAT_QCOW2;
> -                x_disk->backend = DISK_BACKEND_QDISK;
> +                x_disk->format = LIBXL_DISK_FORMAT_QCOW2;
> +                x_disk->backend = LIBXL_DISK_BACKEND_QDISK;
>                  break;
>              case VIR_STORAGE_FILE_VHD:
> -                x_disk->format = DISK_FORMAT_VHD;
> -                x_disk->backend = DISK_BACKEND_TAP;
> +                x_disk->format = LIBXL_DISK_FORMAT_VHD;
> +                x_disk->backend = LIBXL_DISK_BACKEND_TAP;
>                  break;
>              case VIR_STORAGE_FILE_NONE:
>                  /* No subtype specified, default to raw/tap */
>              case VIR_STORAGE_FILE_RAW:
> -                x_disk->format = DISK_FORMAT_RAW;
> -                x_disk->backend = DISK_BACKEND_TAP;
> +                x_disk->format = LIBXL_DISK_FORMAT_RAW;
> +                x_disk->backend = LIBXL_DISK_BACKEND_TAP;
>                  break;
>              default:
>                  virReportError(VIR_ERR_INTERNAL_ERROR,
> @@ -533,11 +601,11 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
>                  return -1;
>              }
>          } else if (STREQ(l_disk->driverName, "file")) {
> -            x_disk->format = DISK_FORMAT_RAW;
> -            x_disk->backend = DISK_BACKEND_TAP;
> +            x_disk->format = LIBXL_DISK_FORMAT_RAW;
> +            x_disk->backend = LIBXL_DISK_BACKEND_TAP;
>          } else if (STREQ(l_disk->driverName, "phy")) {
> -            x_disk->format = DISK_FORMAT_RAW;
> -            x_disk->backend = DISK_BACKEND_PHY;
> +            x_disk->format = LIBXL_DISK_FORMAT_RAW;
> +            x_disk->backend = LIBXL_DISK_BACKEND_PHY;
>          } else {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("libxenlight does not support disk driver %s"),
> @@ -546,12 +614,12 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
>          }
>      } else {
>          /* No driverName - default to raw/tap?? */
> -        x_disk->format = DISK_FORMAT_RAW;
> -        x_disk->backend = DISK_BACKEND_TAP;
> +        x_disk->format = LIBXL_DISK_FORMAT_RAW;
> +        x_disk->backend = LIBXL_DISK_BACKEND_TAP;
>      }
> 
> -    /* How to set unpluggable? */
> -    x_disk->unpluggable = 1;
> +    /* XXX is this right? */
> +    x_disk->removable = 1;
>      x_disk->readwrite = !l_disk->readonly;
>      x_disk->is_cdrom = l_disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM ? 1 : 0;
>      if (l_disk->transient) {
> @@ -560,8 +628,6 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
>          return -1;
>      }
> 
> -    x_disk->domid = def->id;
> -
>      return 0;
>  }
> 
> @@ -579,7 +645,7 @@ libxlMakeDiskList(virDomainDefPtr def, libxl_domain_config *d_config)
>      }
> 
>      for (i = 0; i < ndisks; i++) {
> -        if (libxlMakeDisk(def, l_disks[i], &x_disks[i]) < 0)
> +        if (libxlMakeDisk(l_disks[i], &x_disks[i]) < 0)
>              goto error;
>      }
> 
> @@ -590,19 +656,19 @@ libxlMakeDiskList(virDomainDefPtr def, libxl_domain_config *d_config)
> 
>  error:
>      for (i = 0; i < ndisks; i++)
> -        libxl_device_disk_destroy(&x_disks[i]);
> +        libxl_device_disk_dispose(&x_disks[i]);
>      VIR_FREE(x_disks);
>      return -1;
>  }
> 
>  int
> -libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
> -             libxl_device_nic *x_nic)
> +libxlMakeNic(virDomainNetDefPtr l_nic, libxl_device_nic *x_nic)
>  {
> -    // TODO: Where is mtu stored?
> -    //x_nics[i].mtu = 1492;
> +    /* TODO: Where is mtu stored?
> +     *
> +     * x_nics[i].mtu = 1492;
> +     */
> 
> -    x_nic->domid = def->id;
>      virMacAddrGetRaw(&l_nic->mac, x_nic->mac);
> 
>      if (l_nic->model && !STREQ(l_nic->model, "netfront")) {
> @@ -610,9 +676,9 @@ libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
>              virReportOOMError();
>              return -1;
>          }
> -        x_nic->nictype = NICTYPE_IOEMU;
> +        x_nic->nictype = LIBXL_NIC_TYPE_VIF_IOEMU;
>      } else {
> -        x_nic->nictype = NICTYPE_VIF;
> +        x_nic->nictype = LIBXL_NIC_TYPE_VIF;
>      }
> 
>      if (l_nic->ifname && (x_nic->ifname = strdup(l_nic->ifname)) == NULL) {
> @@ -659,48 +725,49 @@ libxlMakeNicList(virDomainDefPtr def,  libxl_domain_config *d_config)
>      for (i = 0; i < nnics; i++) {
>          x_nics[i].devid = i;
> 
> -        if (libxlMakeNic(def, l_nics[i], &x_nics[i]))
> +        if (libxlMakeNic(l_nics[i], &x_nics[i]))
>              goto error;
>      }
> 
> -    d_config->vifs = x_nics;
> -    d_config->num_vifs = nnics;
> +    d_config->nics = x_nics;
> +    d_config->num_nics = nnics;
> 
>      return 0;
> 
>  error:
>      for (i = 0; i < nnics; i++)
> -        libxl_device_nic_destroy(&x_nics[i]);
> +        libxl_device_nic_dispose(&x_nics[i]);
>      VIR_FREE(x_nics);
>      return -1;
>  }
> 
>  int
> -libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
> -             virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb)
> +libxlMakeVfb(libxlDriverPrivatePtr driver,
> +             virDomainGraphicsDefPtr l_vfb,
> +             libxl_device_vfb *x_vfb)
>  {
>      int port;
>      const char *listenAddr;
> 
>      switch (l_vfb->type) {
>          case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
> -            x_vfb->sdl = 1;
> +            libxl_defbool_set(&x_vfb->sdl.enable, 1);
>              if (l_vfb->data.sdl.display &&
> -                (x_vfb->display = strdup(l_vfb->data.sdl.display)) == NULL) {
> +                (x_vfb->sdl.display = strdup(l_vfb->data.sdl.display)) == NULL) {
>                  virReportOOMError();
>                  return -1;
>              }
>              if (l_vfb->data.sdl.xauth &&
> -                (x_vfb->xauthority =
> +                (x_vfb->sdl.xauthority =
>                      strdup(l_vfb->data.sdl.xauth)) == NULL) {
>                  virReportOOMError();
>                  return -1;
>              }
>              break;
>          case  VIR_DOMAIN_GRAPHICS_TYPE_VNC:
> -            x_vfb->vnc = 1;
> +            libxl_defbool_set(&x_vfb->vnc.enable, 1);
>              /* driver handles selection of free port */
> -            x_vfb->vncunused = 0;
> +            libxl_defbool_set(&x_vfb->vnc.findunused, 0);
>              if (l_vfb->data.vnc.autoport) {
>                  port = libxlNextFreeVncPort(driver, LIBXL_VNC_PORT_MIN);
>                  if (port < 0) {
> @@ -710,13 +777,13 @@ libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
>                  }
>                  l_vfb->data.vnc.port = port;
>              }
> -            x_vfb->vncdisplay = l_vfb->data.vnc.port - LIBXL_VNC_PORT_MIN;
> +            x_vfb->vnc.display = l_vfb->data.vnc.port - LIBXL_VNC_PORT_MIN;
> 
>              listenAddr = virDomainGraphicsListenGetAddress(l_vfb, 0);
>              if (listenAddr) {
>                  /* libxl_device_vfb_init() does strdup("127.0.0.1") */
> -                VIR_FREE(x_vfb->vnclisten);
> -                if ((x_vfb->vnclisten = strdup(listenAddr)) == NULL) {
> +                VIR_FREE(x_vfb->vnc.listen);
> +                if ((x_vfb->vnc.listen = strdup(listenAddr)) == NULL) {
>                      virReportOOMError();
>                      return -1;
>                  }
> @@ -729,13 +796,14 @@ libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
>              }
>              break;
>      }
> -    x_vfb->domid = def->id;
> +
>      return 0;
>  }
> 
>  static int
>  libxlMakeVfbList(libxlDriverPrivatePtr driver,
> -                 virDomainDefPtr def, libxl_domain_config *d_config)
> +                 virDomainDefPtr def,
> +                 libxl_domain_config *d_config)
>  {
>      virDomainGraphicsDefPtr *l_vfbs = def->graphics;
>      int nvfbs = def->ngraphics;
> @@ -757,10 +825,10 @@ libxlMakeVfbList(libxlDriverPrivatePtr driver,
>      }
> 
>      for (i = 0; i < nvfbs; i++) {
> -        libxl_device_vfb_init(&x_vfbs[i], i);
> -        libxl_device_vkb_init(&x_vkbs[i], i);
> +        libxl_device_vfb_init(&x_vfbs[i]);
> +        libxl_device_vkb_init(&x_vkbs[i]);
> 
> -        if (libxlMakeVfb(driver, def, l_vfbs[i], &x_vfbs[i]) < 0)
> +        if (libxlMakeVfb(driver, l_vfbs[i], &x_vfbs[i]) < 0)
>              goto error;
>      }
> 
> @@ -772,148 +840,14 @@ libxlMakeVfbList(libxlDriverPrivatePtr driver,
> 
>  error:
>      for (i = 0; i < nvfbs; i++) {
> -        libxl_device_vfb_destroy(&x_vfbs[i]);
> -        libxl_device_vkb_destroy(&x_vkbs[i]);
> +        libxl_device_vfb_dispose(&x_vfbs[i]);
> +        libxl_device_vkb_dispose(&x_vkbs[i]);
>      }
>      VIR_FREE(x_vfbs);
>      VIR_FREE(x_vkbs);
>      return -1;
>  }
> 
> -static int
> -libxlMakeChrdevStr(virDomainChrDefPtr def, char **buf)
> -{
> -    const char *type = virDomainChrTypeToString(def->source.type);
> -
> -    if (!type) {
> -        virReportError(VIR_ERR_INTERNAL_ERROR,
> -                       "%s", _("unexpected chr device type"));
> -        return -1;
> -    }
> -
> -    switch (def->source.type) {
> -        case VIR_DOMAIN_CHR_TYPE_NULL:
> -        case VIR_DOMAIN_CHR_TYPE_STDIO:
> -        case VIR_DOMAIN_CHR_TYPE_VC:
> -        case VIR_DOMAIN_CHR_TYPE_PTY:
> -            if (virAsprintf(buf, "%s", type) < 0) {
> -                virReportOOMError();
> -                return -1;
> -            }
> -            break;
> -
> -        case VIR_DOMAIN_CHR_TYPE_FILE:
> -        case VIR_DOMAIN_CHR_TYPE_PIPE:
> -            if (virAsprintf(buf, "%s:%s", type,
> -                            def->source.data.file.path) < 0) {
> -                virReportOOMError();
> -                return -1;
> -            }
> -            break;
> -
> -        case VIR_DOMAIN_CHR_TYPE_DEV:
> -            if (virAsprintf(buf, "%s", def->source.data.file.path) < 0) {
> -                virReportOOMError();
> -                return -1;
> -            }
> -            break;
> -    }
> -
> -    return 0;
> -}
> -
> -static int
> -libxlMakeDeviceModelInfo(virDomainDefPtr def, libxl_domain_config *d_config)
> -{
> -    libxl_device_model_info *dm_info = &d_config->dm_info;
> -    int i;
> -    char b_order[VIR_DOMAIN_BOOT_LAST+1];
> -
> -    libxl_init_dm_info(dm_info, &d_config->c_info, &d_config->b_info);
> -
> -    if (d_config->b_info.hvm) {
> -        /* HVM-specific device model info */
> -        dm_info->type = XENFV;
> -        if (def->os.nBootDevs > 0) {
> -            VIR_FREE(dm_info->boot);
> -            for (i = 0; i < def->os.nBootDevs; i++) {
> -                switch (def->os.bootDevs[i]) {
> -                    case VIR_DOMAIN_BOOT_FLOPPY:
> -                        b_order[i] = 'a';
> -                        break;
> -                    default:
> -                    case VIR_DOMAIN_BOOT_DISK:
> -                        b_order[i] = 'c';
> -                        break;
> -                    case VIR_DOMAIN_BOOT_CDROM:
> -                        b_order[i] = 'd';
> -                        break;
> -                    case VIR_DOMAIN_BOOT_NET:
> -                        b_order[i] = 'n';
> -                        break;
> -                }
> -            }
> -            b_order[def->os.nBootDevs] = '\0';
> -            if ((dm_info->boot = strdup(b_order)) == NULL) {
> -                virReportOOMError();
> -                goto error;
> -            }
> -        }
> -        if (def->serials &&
> -            (libxlMakeChrdevStr(def->serials[0], &dm_info->serial) < 0))
> -            goto error;
> -    } else {
> -        /* PV-specific device model info */
> -        dm_info->type = XENPV;
> -    }
> -
> -    /* Build qemu graphics options from previously parsed vfb */
> -    if (d_config->num_vfbs > 0) {
> -        if (d_config->vfbs[0].vnc) {
> -            dm_info->vnc = 1;
> -            /* driver handles selection of free port */
> -            dm_info->vncunused = 0;
> -            if (d_config->vfbs[0].vnclisten) {
> -                VIR_FREE(dm_info->vnclisten);
> -                if ((dm_info->vnclisten =
> -                     strdup(d_config->vfbs[0].vnclisten)) == NULL) {
> -                    virReportOOMError();
> -                    goto error;
> -                }
> -            }
> -            if (d_config->vfbs[0].keymap &&
> -                (dm_info->keymap = strdup(d_config->vfbs[0].keymap)) == NULL) {
> -                virReportOOMError();
> -                goto error;
> -            }
> -            dm_info->vncdisplay = d_config->vfbs[0].vncdisplay;
> -            if (d_config->vfbs[0].vncpasswd &&
> -                (dm_info->vncpasswd =
> -                 strdup(d_config->vfbs[0].vncpasswd)) == NULL) {
> -                virReportOOMError();
> -                goto error;
> -            }
> -        } else if (d_config->vfbs[0].sdl) {
> -            dm_info->sdl = 1;
> -            dm_info->vnc = 0;
> -        }
> -    } else if (d_config->num_vfbs == 0) {
> -        dm_info->nographic = 1;
> -        dm_info->vnc = 0;
> -    }
> -
> -    // TODO
> -    //dm_info->usb = ;
> -    //dm_info->usbdevice = ;
> -    //dm_info->soundhw = ;
> -
> -    return 0;
> -
> -error:
> -    libxl_device_model_info_destroy(dm_info);
> -    return -1;
> -}
> -
>  virCapsPtr
>  libxlMakeCapabilities(libxl_ctx *ctx)
>  {
> @@ -947,7 +881,7 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
>                         virDomainDefPtr def, libxl_domain_config *d_config)
>  {
> 
> -    if (libxlMakeDomCreateInfo(def, &d_config->c_info) < 0)
> +    if (libxlMakeDomCreateInfo(driver, def, &d_config->c_info) < 0)
>          return -1;
> 
>      if (libxlMakeDomBuildInfo(def, d_config) < 0) {
> @@ -966,10 +900,6 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
>          goto error;
>      }
> 
> -    if (libxlMakeDeviceModelInfo(def, d_config) < 0) {
> -        goto error;
> -    }
> -
>      d_config->on_reboot = def->onReboot;
>      d_config->on_poweroff = def->onPoweroff;
>      d_config->on_crash = def->onCrash;
> @@ -977,6 +907,6 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
>      return 0;
> 
>  error:
> -    libxl_domain_config_destroy(d_config);
> +    libxl_domain_config_dispose(d_config);
>      return -1;
>  }
> diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
> index 56bf85c..ea62b68 100644
> --- a/src/libxl/libxl_conf.h
> +++ b/src/libxl/libxl_conf.h
> @@ -37,6 +37,7 @@
>  # include "bitmap.h"
> 
> 
> +# define LIBXL_MAXVCPUS      128
>  # define LIBXL_VNC_PORT_MIN  5900
>  # define LIBXL_VNC_PORT_MAX  65535
> 
> @@ -58,7 +59,7 @@ struct _libxlDriverPrivate {
>      FILE *logger_file;
>      xentoollog_logger *logger;
>      /* libxl ctx for driver wide ops; getVersion, getNodeInfo, ... */
> -    libxl_ctx ctx;
> +    libxl_ctx *ctx;
> 
>      virBitmapPtr reservedVNCPorts;
>      virDomainObjList domains;
> @@ -77,10 +78,8 @@ typedef struct _libxlDomainObjPrivate libxlDomainObjPrivate;
>  typedef libxlDomainObjPrivate *libxlDomainObjPrivatePtr;
>  struct _libxlDomainObjPrivate {
>      /* per domain libxl ctx */
> -    libxl_ctx ctx;
> -    libxl_waiter *dWaiter;
> -    int waiterFD;
> -    int eventHdl;
> +    libxl_ctx *ctx;
> +    libxl_evgen_domain_death *deathW;
>  };
> 
>  # define LIBXL_SAVE_MAGIC "libvirt-xml\n \0 \r"
> @@ -100,13 +99,11 @@ virCapsPtr
>  libxlMakeCapabilities(libxl_ctx *ctx);
> 
>  int
> -libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_dev,
> -              libxl_device_disk *x_dev);
> +libxlMakeDisk(virDomainDiskDefPtr l_dev, libxl_device_disk *x_dev);
>  int
> -libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
> -             libxl_device_nic *x_nic);
> +libxlMakeNic(virDomainNetDefPtr l_nic, libxl_device_nic *x_nic);
>  int
> -libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
> +libxlMakeVfb(libxlDriverPrivatePtr driver,
>               virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb);
> 
>  int
> diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
> index bc75730..f15129f 100644
> --- a/src/libxl/libxl_driver.c
> +++ b/src/libxl/libxl_driver.c
> @@ -40,6 +40,7 @@
>  #include "memory.h"
>  #include "uuid.h"
>  #include "command.h"
> +#include "libxl.h"
>  #include "libxl_driver.h"
>  #include "libxl_conf.h"
>  #include "xen_xm.h"
> @@ -59,6 +60,19 @@
>  /* Number of Xen scheduler parameters */
>  #define XEN_SCHED_CREDIT_NPARAM   2
> 
> +struct libxlOSEventHookFDInfo {
> +    libxlDomainObjPrivatePtr priv;
> +    void *xl_priv;
> +    int watch;
> +};
> +
> +struct libxlOSEventHookTimerInfo {
> +    libxlDomainObjPrivatePtr priv;
> +    void *xl_priv;
> +    int id;
> +};
> +
> +
>  static void libxlDomainManagedSaveLoad(void *payload,
>                                         const void *n ATTRIBUTE_UNUSED,
>                                         void *opaque);
> @@ -84,6 +98,163 @@ libxlDriverUnlock(libxlDriverPrivatePtr driver)
>      virMutexUnlock(&driver->lock);
>  }
> 
> +
> +static void libxlFDEventCallback(int watch ATTRIBUTE_UNUSED,
> +                                 int fd,
> +                                 int vir_events,
> +                                 void *fdinfo)
> +{
> +    struct libxlOSEventHookFDInfo *info = fdinfo;
> +    int events = 0;
> +
> +    if (vir_events & VIR_EVENT_HANDLE_READABLE)
> +        events |= POLLIN;
> +    if (vir_events & VIR_EVENT_HANDLE_WRITABLE)
> +        events |= POLLOUT;
> +    if (vir_events & VIR_EVENT_HANDLE_ERROR)
> +        events |= POLLERR;
> +    if (vir_events & VIR_EVENT_HANDLE_HANGUP)
> +        events |= POLLHUP;
> +
> +    libxl_osevent_occurred_fd(info->priv->ctx, info->xl_priv, fd, 0, events);
> +}
> +
> +static void libxlFreeFDInfo(void *obj)
> +{
> +    VIR_FREE(obj);
> +}
> +
> +static int libxlFDRegisterEventHook(void *priv, int fd, void **hndp,
> +                                    short events, void *xl_priv)
> +{
> +    int vir_events = VIR_EVENT_HANDLE_ERROR;
> +    struct libxlOSEventHookFDInfo *fdinfo;
> +
> +    if (VIR_ALLOC(fdinfo) < 0) {
> +        virReportOOMError();
> +        return -1;
> +    }
> +
> +    fdinfo->priv = priv;
> +    fdinfo->xl_priv = xl_priv;
> +    *hndp = fdinfo;
> +
> +    if (events & POLLIN)
> +        vir_events |= VIR_EVENT_HANDLE_READABLE;
> +    if (events & POLLOUT)
> +        vir_events |= VIR_EVENT_HANDLE_WRITABLE;
> +    fdinfo->watch = virEventAddHandle(fd, vir_events, libxlFDEventCallback,
> +                                      fdinfo, libxlFreeFDInfo);
> +    if (fdinfo->watch < 0) {
> +        VIR_FREE(fdinfo);
> +        return fdinfo->watch;
> +    }
> +
> +    return 0;
> +}
> +
> +static int libxlFDModifyEventHook(void *priv ATTRIBUTE_UNUSED,
> +                                  int fd ATTRIBUTE_UNUSED,
> +                                  void **hndp,
> +                                  short events)
> +{
> +    struct libxlOSEventHookFDInfo *fdinfo = *hndp;
> +    int vir_events = VIR_EVENT_HANDLE_ERROR;
> +
> +    if (events & POLLIN)
> +        vir_events |= VIR_EVENT_HANDLE_READABLE;
> +    if (events & POLLOUT)
> +        vir_events |= VIR_EVENT_HANDLE_WRITABLE;
> +
> +    virEventUpdateHandle(fdinfo->watch, vir_events);
> +    return 0;
> +}
> +
> +static void libxlFDDeregisterEventHook(void *priv ATTRIBUTE_UNUSED,
> +                                       int fd ATTRIBUTE_UNUSED,
> +                                       void *hnd)
> +{
> +    struct libxlOSEventHookFDInfo *fdinfo = hnd;
> +
> +    virEventRemoveHandle(fdinfo->watch);
> +}
> +
> +
> +static void libxlTimerCallback(int timer ATTRIBUTE_UNUSED, void *timer_v)
> +{
> +    struct libxlOSEventHookTimerInfo *timer_info = timer_v;
> +
> +    libxl_osevent_occurred_timeout(timer_info->priv->ctx, timer_info->xl_priv);
> +}
> +
> +static void libxlTimerInfoFree(void* obj)
> +{
> +    VIR_FREE(obj);
> +}
> +
> +static int libxlTimeoutRegisterEventHook(void *priv,
> +                                         void **hndp,
> +                                         struct timeval abs_t,
> +                                         void *for_libxl)
> +{
> +    struct timeval now;
> +    struct libxlOSEventHookTimerInfo *timer_info;
> +    int timeout, timer_id;
> +
> +    if (VIR_ALLOC(timer_info) < 0) {
> +        virReportOOMError();
> +        return -1;
> +    }
> +
> +    gettimeofday(&now, NULL);
> +    timeout = (abs_t.tv_usec - now.tv_usec) / 1000;
> +    timeout += (abs_t.tv_sec - now.tv_sec) * 1000;
> +    timer_id = virEventAddTimeout(timeout, libxlTimerCallback,
> +                                  timer_info, libxlTimerInfoFree);
> +    if (timer_id < 0) {
> +        VIR_FREE(timer_info);
> +        return timer_id;
> +    }
> +
> +    timer_info->priv = priv;
> +    timer_info->xl_priv = for_libxl;
> +    timer_info->id = timer_id;
> +    *hndp = timer_info;
> +    return 0;
> +}
> +
> +static int libxlTimeoutModifyEventHook(void *priv ATTRIBUTE_UNUSED,
> +                                       void **hndp,
> +                                       struct timeval abs_t)
> +{
> +    struct timeval now;
> +    int timeout;
> +    struct libxlOSEventHookTimerInfo *timer_info = *hndp;
> +
> +    gettimeofday(&now, NULL);
> +    timeout = (abs_t.tv_usec - now.tv_usec) / 1000;
> +    timeout += (abs_t.tv_sec - now.tv_sec) * 1000;
> +    virEventUpdateTimeout(timer_info->id, timeout);
> +    return 0;
> +}
> +
> +static void libxlTimeoutDeregisterEventHook(void *priv ATTRIBUTE_UNUSED,
> +                                            void *hnd)
> +{
> +    struct libxlOSEventHookTimerInfo *timer_info = hnd;
> +
> +    virEventRemoveTimeout(timer_info->id);
> +}
> +
> +static const libxl_osevent_hooks libxl_event_callbacks = {
> +    .fd_register = libxlFDRegisterEventHook,
> +    .fd_modify = libxlFDModifyEventHook,
> +    .fd_deregister = libxlFDDeregisterEventHook,
> +    .timeout_register = libxlTimeoutRegisterEventHook,
> +    .timeout_modify = libxlTimeoutModifyEventHook,
> +    .timeout_deregister = libxlTimeoutDeregisterEventHook,
> +};
> +
>  static void *
>  libxlDomainObjPrivateAlloc(void)
>  {
> @@ -92,9 +263,9 @@ libxlDomainObjPrivateAlloc(void)
>      if (VIR_ALLOC(priv) < 0)
>          return NULL;
> 
> -    libxl_ctx_init(&priv->ctx, LIBXL_VERSION, libxl_driver->logger);
> -    priv->waiterFD = -1;
> -    priv->eventHdl = -1;
> +    libxl_ctx_alloc(&priv->ctx, LIBXL_VERSION, 0, libxl_driver->logger);
> +    priv->deathW = NULL;
> +    libxl_osevent_register_hooks(priv->ctx, &libxl_event_callbacks, priv);
> 
>      return priv;
>  }
> @@ -104,16 +275,12 @@ libxlDomainObjPrivateFree(void *data)
>  {
>      libxlDomainObjPrivatePtr priv = data;
> 
> -    if (priv->eventHdl >= 0)
> -        virEventRemoveHandle(priv->eventHdl);
> -
> -    if (priv->dWaiter) {
> -        libxl_stop_waiting(&priv->ctx, priv->dWaiter);
> -        libxl_free_waiter(priv->dWaiter);
> -        VIR_FREE(priv->dWaiter);
> +    if (priv->deathW) {
> +        libxl_evdisable_domain_death(priv->ctx, priv->deathW);
> +        VIR_FREE(priv->deathW);
>      }
> 
> -    libxl_ctx_free(&priv->ctx);
> +    libxl_ctx_free(priv->ctx);
>      VIR_FREE(priv);
>  }
> 
> @@ -125,17 +292,6 @@ libxlDomainEventQueue(libxlDriverPrivatePtr driver, virDomainEventPtr event)
>      virDomainEventStateQueue(driver->domainEventState, event);
>  }
> 
> -/*
> - * Remove reference to domain object.
> - */
> -static void
> -libxlDomainObjUnref(void *data)
> -{
> -    virDomainObjPtr vm = data;
> -
> -    virObjectUnref(vm);
> -}
> -
>  static void
>  libxlAutostartDomain(void *payload, const void *name ATTRIBUTE_UNUSED,
>                       void *opaque)
> @@ -166,13 +322,13 @@ libxlDoNodeGetInfo(libxlDriverPrivatePtr driver, virNodeInfoPtr info)
>      const libxl_version_info* ver_info;
>      struct utsname utsname;
> 
> -    if (libxl_get_physinfo(&driver->ctx, &phy_info)) {
> +    if (libxl_get_physinfo(driver->ctx, &phy_info)) {
>          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                         _("libxl_get_physinfo_info failed"));
>          return -1;
>      }
> 
> -    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
> +    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
>          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                         _("libxl_get_version_info failed"));
>          return -1;
> @@ -296,15 +452,9 @@ libxlVmCleanup(libxlDriverPrivatePtr driver,
>      char *file;
>      int i;
> 
> -    if (priv->eventHdl >= 0) {
> -        virEventRemoveHandle(priv->eventHdl);
> -        priv->eventHdl = -1;
> -    }
> -
> -    if (priv->dWaiter) {
> -        libxl_stop_waiting(&priv->ctx, priv->dWaiter);
> -        libxl_free_waiter(priv->dWaiter);
> -        VIR_FREE(priv->dWaiter);
> +    if (priv->deathW) {
> +        libxl_evdisable_domain_death(priv->ctx, priv->deathW);
> +        priv->deathW = NULL;
>      }
> 
>      if (vm->persistent) {
> @@ -355,12 +505,11 @@ libxlVmCleanup(libxlDriverPrivatePtr driver,
>  static int
>  libxlVmReap(libxlDriverPrivatePtr driver,
>              virDomainObjPtr vm,
> -            int force,
>              virDomainShutoffReason reason)
>  {
>      libxlDomainObjPrivatePtr priv = vm->privateData;
> 
> -    if (libxl_domain_destroy(&priv->ctx, vm->def->id, force) < 0) {
> +    if (libxl_domain_destroy(priv->ctx, vm->def->id, NULL) < 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Unable to cleanup domain %d"), vm->def->id);
>          return -1;
> @@ -373,56 +522,26 @@ libxlVmReap(libxlDriverPrivatePtr driver,
>  /*
>   * Handle previously registered event notification from libxenlight
>   */
> -static void libxlEventHandler(int watch,
> -                              int fd,
> -                              int events,
> -                              void *data)
> +static void libxlEventHandler(void *data, const libxl_event *event)
>  {
>      libxlDriverPrivatePtr driver = libxl_driver;
>      virDomainObjPtr vm = data;
> -    libxlDomainObjPrivatePtr priv;
>      virDomainEventPtr dom_event = NULL;
> -    libxl_event event;
> -    libxl_dominfo info;
> 
>      libxlDriverLock(driver);
>      virDomainObjLock(vm);
>      libxlDriverUnlock(driver);
> 
> -    priv = vm->privateData;
> -
> -    memset(&event, 0, sizeof(event));
> -    memset(&info, 0, sizeof(info));
> -
> -    if (priv->waiterFD != fd || priv->eventHdl != watch) {
> -        virEventRemoveHandle(watch);
> -        priv->eventHdl = -1;
> -        goto cleanup;
> -    }
> -
> -    if (!(events & VIR_EVENT_HANDLE_READABLE))
> -        goto cleanup;
> -
> -    if (libxl_get_event(&priv->ctx, &event))
> -        goto cleanup;
> -
> -    if (event.type == LIBXL_EVENT_DOMAIN_DEATH) {
> +    if (event->type == LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN) {
>          virDomainShutoffReason reason;
> 
> -        /* libxl_event_get_domain_death_info returns 1 if death
> -         * event was for this domid */
> -        if (libxl_event_get_domain_death_info(&priv->ctx,
> -                                              vm->def->id,
> -                                              &event,
> -                                              &info) != 1)
> +        if (event->domid != vm->def->id)
>              goto cleanup;
> 
> -        virEventRemoveHandle(watch);
> -        priv->eventHdl = -1;
> -        switch (info.shutdown_reason) {
> -            case SHUTDOWN_poweroff:
> -            case SHUTDOWN_crash:
> -                if (info.shutdown_reason == SHUTDOWN_crash) {
> +        switch (event->u.domain_shutdown.shutdown_reason) {
> +            case LIBXL_SHUTDOWN_REASON_POWEROFF:
> +            case LIBXL_SHUTDOWN_REASON_CRASH:
> +                if (event->u.domain_shutdown.shutdown_reason == LIBXL_SHUTDOWN_REASON_CRASH) {
>                      dom_event = virDomainEventNewFromObj(vm,
>                                                VIR_DOMAIN_EVENT_STOPPED,
>                                                VIR_DOMAIN_EVENT_STOPPED_CRASHED);
> @@ -430,18 +549,18 @@ static void libxlEventHandler(int watch,
>                  } else {
>                      reason = VIR_DOMAIN_SHUTOFF_SHUTDOWN;
>                  }
> -                libxlVmReap(driver, vm, 0, reason);
> +                libxlVmReap(driver, vm, reason);
>                  if (!vm->persistent) {
>                      virDomainRemoveInactive(&driver->domains, vm);
>                      vm = NULL;
>                  }
>                  break;
> -            case SHUTDOWN_reboot:
> -                libxlVmReap(driver, vm, 0, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
> +            case LIBXL_SHUTDOWN_REASON_REBOOT:
> +                libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
>                  libxlVmStart(driver, vm, 0, -1);
>                  break;
>              default:
> -                VIR_INFO("Unhandled shutdown_reason %d", info.shutdown_reason);
> +                VIR_INFO("Unhandled shutdown_reason %d", event->u.domain_shutdown.shutdown_reason);
>                  break;
>          }
>      }
> @@ -454,9 +573,14 @@ cleanup:
>          libxlDomainEventQueue(driver, dom_event);
>          libxlDriverUnlock(driver);
>      }
> -    libxl_free_event(&event);
>  }
> 
> +static const struct libxl_event_hooks ev_hooks = {
> +    .event_occurs_mask = LIBXL_EVENTMASK_ALL,
> +    .event_occurs = libxlEventHandler,
> +    .disaster = NULL,
> +};
> +
>  /*
>   * Register domain events with libxenlight and insert event handles
>   * in libvirt's event loop.
> @@ -465,40 +589,18 @@ static int
>  libxlCreateDomEvents(virDomainObjPtr vm)
>  {
>      libxlDomainObjPrivatePtr priv = vm->privateData;
> -    int fd;
> 
> -    if (VIR_ALLOC(priv->dWaiter) < 0) {
> -        virReportOOMError();
> -        return -1;
> -    }
> -
> -    if (libxl_wait_for_domain_death(&priv->ctx, vm->def->id, priv->dWaiter))
> -        goto error;
> -
> -    libxl_get_wait_fd(&priv->ctx, &fd);
> -    if (fd < 0)
> -        goto error;
> +    libxl_event_register_callbacks(priv->ctx, &ev_hooks, vm);
> 
> -    priv->waiterFD = fd;
> -    /* Add a reference to the domain object while it is injected in
> -     * the event loop.
> -     */
> -    virObjectRef(vm);
> -    if ((priv->eventHdl = virEventAddHandle(
> -             fd,
> -             VIR_EVENT_HANDLE_READABLE | VIR_EVENT_HANDLE_ERROR,
> -             libxlEventHandler,
> -             vm, libxlDomainObjUnref)) < 0) {
> -        virObjectUnref(vm);
> +    if (libxl_evenable_domain_death(priv->ctx, vm->def->id, 0, &priv->deathW))
>          goto error;
> -    }
> 
>      return 0;
> 
>  error:
> -    libxl_free_waiter(priv->dWaiter);
> -    VIR_FREE(priv->dWaiter);
> -    priv->eventHdl = -1;
> +    if (priv->deathW)
> +        libxl_evdisable_domain_death(priv->ctx, priv->deathW);
> +    VIR_FREE(priv->deathW);
>      return -1;
>  }
> 
> @@ -507,7 +609,7 @@ libxlDomainSetVcpuAffinites(libxlDriverPrivatePtr driver, virDomainObjPtr vm)
>  {
>      libxlDomainObjPrivatePtr priv = vm->privateData;
>      virDomainDefPtr def = vm->def;
> -    libxl_cpumap map;
> +    libxl_bitmap map;
>      uint8_t *cpumask = NULL;
>      uint8_t *cpumap = NULL;
>      virNodeInfo nodeinfo;
> @@ -539,7 +641,7 @@ libxlDomainSetVcpuAffinites(libxlDriverPrivatePtr driver, virDomainObjPtr vm)
>          map.size = cpumaplen;
>          map.map = cpumap;
> 
> -        if (libxl_set_vcpuaffinity(&priv->ctx, def->id, vcpu, &map) != 0) {
> +        if (libxl_set_vcpuaffinity(priv->ctx, def->id, vcpu, &map) != 0) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("Failed to pin vcpu '%d' with libxenlight"), vcpu);
>              goto cleanup;
> @@ -565,11 +667,10 @@ libxlFreeMem(libxlDomainObjPrivatePtr priv, libxl_domain_config *d_config)
>      int tries = 3;
>      int wait_secs = 10;
> 
> -    if ((ret = libxl_domain_need_memory(&priv->ctx, &d_config->b_info,
> -                                        &d_config->dm_info,
> +    if ((ret = libxl_domain_need_memory(priv->ctx, &d_config->b_info,
>                                          &needed_mem)) >= 0) {
>          for (i = 0; i < tries; ++i) {
> -            if ((ret = libxl_get_free_memory(&priv->ctx, &free_mem)) < 0)
> +            if ((ret = libxl_get_free_memory(priv->ctx, &free_mem)) < 0)
>                  break;
> 
>              if (free_mem >= needed_mem) {
> @@ -577,17 +678,17 @@ libxlFreeMem(libxlDomainObjPrivatePtr priv, libxl_domain_config *d_config)
>                  break;
>              }
> 
> -            if ((ret = libxl_set_memory_target(&priv->ctx, 0,
> +            if ((ret = libxl_set_memory_target(priv->ctx, 0,
>                                                 free_mem - needed_mem,
>                                                 /* relative */ 1, 0)) < 0)
>                  break;
> 
> -            ret = libxl_wait_for_free_memory(&priv->ctx, 0, needed_mem,
> +            ret = libxl_wait_for_free_memory(priv->ctx, 0, needed_mem,
>                                               wait_secs);
>              if (ret == 0 || ret != ERROR_NOMEM)
>                  break;
> 
> -            if ((ret = libxl_wait_for_memory_target(&priv->ctx, 0, 1)) < 0)
> +            if ((ret = libxl_wait_for_memory_target(priv->ctx, 0, 1)) < 0)
>                  break;
>          }
>      }
> @@ -613,7 +714,6 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>      char *dom_xml = NULL;
>      char *managed_save_path = NULL;
>      int managed_save_fd = -1;
> -    pid_t child_console_pid = -1;
>      libxlDomainObjPrivatePtr priv = vm->privateData;
> 
>      /* If there is a managed saved state restore it instead of starting
> @@ -657,7 +757,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>          VIR_FREE(managed_save_path);
>      }
> 
> -    memset(&d_config, 0, sizeof(d_config));
> +    libxl_domain_config_init(&d_config);
> 
>      if (libxlBuildDomainConfig(driver, vm->def, &d_config) < 0)
>          return -1;
> @@ -669,13 +769,14 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>          goto error;
>      }
> 
> +    /* use as synchronous operations => ao_how = NULL and no intermediate reports => ao_progress = NULL */
> +
>      if (restore_fd < 0)
> -        ret = libxl_domain_create_new(&priv->ctx, &d_config,
> -                                      NULL, &child_console_pid, &domid);
> +        ret = libxl_domain_create_new(priv->ctx, &d_config,
> +                                      &domid, NULL, NULL);
>      else
> -        ret = libxl_domain_create_restore(&priv->ctx, &d_config, NULL,
> -                                          &child_console_pid, &domid,
> -                                          restore_fd);
> +        ret = libxl_domain_create_restore(priv->ctx, &d_config, &domid,
> +                                          restore_fd, NULL, NULL);
> 
>      if (ret) {
>          if (restore_fd < 0)
> @@ -693,7 +794,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>      if ((dom_xml = virDomainDefFormat(vm->def, 0)) == NULL)
>          goto error;
> 
> -    if (libxl_userdata_store(&priv->ctx, domid, "libvirt-xml",
> +    if (libxl_userdata_store(priv->ctx, domid, "libvirt-xml",
>                               (uint8_t *)dom_xml, strlen(dom_xml) + 1)) {
>          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                         _("libxenlight failed to store userdata"));
> @@ -707,7 +808,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>          goto error;
> 
>      if (!start_paused) {
> -        libxl_domain_unpause(&priv->ctx, domid);
> +        libxl_domain_unpause(priv->ctx, domid);
>          virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_BOOTED);
>      } else {
>          virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER);
> @@ -723,18 +824,18 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>                                           VIR_DOMAIN_EVENT_STARTED_RESTORED);
>      libxlDomainEventQueue(driver, event);
> 
> -    libxl_domain_config_destroy(&d_config);
> +    libxl_domain_config_dispose(&d_config);
>      VIR_FREE(dom_xml);
>      VIR_FORCE_CLOSE(managed_save_fd);
>      return 0;
> 
>  error:
>      if (domid > 0) {
> -        libxl_domain_destroy(&priv->ctx, domid, 0);
> +        libxl_domain_destroy(priv->ctx, domid, NULL);
>          vm->def->id = -1;
>          virDomainObjSetState(vm, VIR_DOMAIN_SHUTOFF, VIR_DOMAIN_SHUTOFF_FAILED);
>      }
> -    libxl_domain_config_destroy(&d_config);
> +    libxl_domain_config_dispose(&d_config);
>      VIR_FREE(dom_xml);
>      VIR_FREE(managed_save_path);
>      virDomainDefFree(def);
> @@ -762,7 +863,7 @@ libxlReconnectDomain(void *payload,
>      virDomainObjLock(vm);
> 
>      /* Does domain still exist? */
> -    rc = libxl_domain_info(&driver->ctx, &d_info, vm->def->id);
> +    rc = libxl_domain_info(driver->ctx, &d_info, vm->def->id);
>      if (rc == ERROR_INVAL) {
>          goto out;
>      } else if (rc != 0) {
> @@ -772,7 +873,7 @@ libxlReconnectDomain(void *payload,
>      }
> 
>      /* Is this a domain that was under libvirt control? */
> -    if (libxl_userdata_retrieve(&driver->ctx, vm->def->id,
> +    if (libxl_userdata_retrieve(driver->ctx, vm->def->id,
>                                  "libvirt-xml", &data, &len)) {
>          VIR_DEBUG("libxl_userdata_retrieve failed, ignoring domain %d", vm->def->id);
>          goto out;
> @@ -810,7 +911,7 @@ libxlShutdown(void)
>      libxlDriverLock(libxl_driver);
>      virCapabilitiesFree(libxl_driver->caps);
>      virDomainObjListDeinit(&libxl_driver->domains);
> -    libxl_ctx_free(&libxl_driver->ctx);
> +    libxl_ctx_free(libxl_driver->ctx);
>      xtl_logger_destroy(libxl_driver->logger);
>      if (libxl_driver->logger_file)
>          VIR_FORCE_FCLOSE(libxl_driver->logger_file);
> @@ -943,14 +1044,14 @@ libxlStartup(int privileged) {
>          goto fail;
>      }
> 
> -    if (libxl_ctx_init(&libxl_driver->ctx,
> -                       LIBXL_VERSION,
> +    if (libxl_ctx_alloc(&libxl_driver->ctx,
> +                       LIBXL_VERSION, 0,
>                         libxl_driver->logger)) {
>          VIR_INFO("cannot initialize libxenlight context, probably not running in a Xen Dom0, disabling driver");
>          goto fail;
>      }
> 
> -    if ((ver_info = libxl_get_version_info(&libxl_driver->ctx)) == NULL) {
> +    if ((ver_info = libxl_get_version_info(libxl_driver->ctx)) == NULL) {
>          VIR_INFO("cannot version information from libxenlight, disabling driver");
>          goto fail;
>      }
> @@ -958,7 +1059,7 @@ libxlStartup(int privileged) {
>              (ver_info->xen_version_minor * 1000);
> 
>      if ((libxl_driver->caps =
> -         libxlMakeCapabilities(&libxl_driver->ctx)) == NULL) {
> +         libxlMakeCapabilities(libxl_driver->ctx)) == NULL) {
>          VIR_ERROR(_("cannot create capabilities for libxenlight"));
>          goto error;
>      }
> @@ -1115,7 +1216,7 @@ libxlGetMaxVcpus(virConnectPtr conn, const char *type ATTRIBUTE_UNUSED)
>      int ret;
>      libxlDriverPrivatePtr driver = conn->privateData;
> 
> -    ret = libxl_get_max_cpus(&driver->ctx);
> +    ret = libxl_get_max_cpus(driver->ctx);
>      /* libxl_get_max_cpus() will return 0 if there were any failures,
>         e.g. xc_physinfo() failing */
>      if (ret == 0)
> @@ -1320,7 +1421,7 @@ libxlDomainSuspend(virDomainPtr dom)
>      priv = vm->privateData;
> 
>      if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_PAUSED) {
> -        if (libxl_domain_pause(&priv->ctx, dom->id) != 0) {
> +        if (libxl_domain_pause(priv->ctx, dom->id) != 0) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("Failed to suspend domain '%d' with libxenlight"),
>                             dom->id);
> @@ -1379,7 +1480,7 @@ libxlDomainResume(virDomainPtr dom)
>      priv = vm->privateData;
> 
>      if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
> -        if (libxl_domain_unpause(&priv->ctx, dom->id) != 0) {
> +        if (libxl_domain_unpause(priv->ctx, dom->id) != 0) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("Failed to resume domain '%d' with libxenlight"),
>                             dom->id);
> @@ -1436,7 +1537,7 @@ libxlDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
>      }
> 
>      priv = vm->privateData;
> -    if (libxl_domain_shutdown(&priv->ctx, dom->id, LIBXL_DOM_REQ_POWEROFF) != 0) {
> +    if (libxl_domain_shutdown(priv->ctx, dom->id) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to shutdown domain '%d' with libxenlight"),
>                         dom->id);
> @@ -1489,7 +1590,7 @@ libxlDomainReboot(virDomainPtr dom, unsigned int flags)
>      }
> 
>      priv = vm->privateData;
> -    if (libxl_domain_shutdown(&priv->ctx, dom->id, LIBXL_DOM_REQ_REBOOT) != 0) {
> +    if (libxl_domain_reboot(priv->ctx, dom->id) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to reboot domain '%d' with libxenlight"),
>                         dom->id);
> @@ -1534,7 +1635,7 @@ libxlDomainDestroyFlags(virDomainPtr dom,
>      event = virDomainEventNewFromObj(vm,VIR_DOMAIN_EVENT_STOPPED,
>                                       VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
> 
> -    if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_DESTROYED) != 0) {
> +    if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to destroy domain '%d'"), dom->id);
>          goto cleanup;
> @@ -1672,7 +1773,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
> 
>          if (flags & VIR_DOMAIN_MEM_LIVE) {
>              priv = vm->privateData;
> -            if (libxl_domain_setmaxmem(&priv->ctx, dom->id, newmem) < 0) {
> +            if (libxl_domain_setmaxmem(priv->ctx, dom->id, newmem) < 0) {
>                  virReportError(VIR_ERR_INTERNAL_ERROR,
>                                 _("Failed to set maximum memory for domain '%d'"
>                                   " with libxenlight"), dom->id);
> @@ -1701,7 +1802,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
> 
>          if (flags & VIR_DOMAIN_MEM_LIVE) {
>              priv = vm->privateData;
> -            if (libxl_set_memory_target(&priv->ctx, dom->id, newmem, 0,
> +            if (libxl_set_memory_target(priv->ctx, dom->id, newmem, 0,
>                                          /* force */ 1) < 0) {
>                  virReportError(VIR_ERR_INTERNAL_ERROR,
>                                 _("Failed to set memory for domain '%d'"
> @@ -1761,7 +1862,7 @@ libxlDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info)
>          info->memory = vm->def->mem.cur_balloon;
>          info->maxMem = vm->def->mem.max_balloon;
>      } else {
> -        if (libxl_domain_info(&driver->ctx, &d_info, dom->id) != 0) {
> +        if (libxl_domain_info(driver->ctx, &d_info, dom->id) != 0) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("libxl_domain_info failed for domain '%d'"), dom->id);
>              goto cleanup;
> @@ -1861,7 +1962,7 @@ libxlDoDomainSave(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>          goto cleanup;
>      }
> 
> -    if (libxl_domain_suspend(&priv->ctx, NULL, vm->def->id, fd) != 0) {
> +    if (libxl_domain_suspend(priv->ctx, vm->def->id, fd, 0, NULL) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to save domain '%d' with libxenlight"),
>                         vm->def->id);
> @@ -1871,7 +1972,7 @@ libxlDoDomainSave(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>      event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
>                                           VIR_DOMAIN_EVENT_STOPPED_SAVED);
> 
> -    if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_SAVED) != 0) {
> +    if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_SAVED) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to destroy domain '%d'"), vm->def->id);
>          goto cleanup;
> @@ -2028,7 +2129,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
> 
>      if (!(flags & VIR_DUMP_LIVE) &&
>          virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
> -        if (libxl_domain_pause(&priv->ctx, dom->id) != 0) {
> +        if (libxl_domain_pause(priv->ctx, dom->id) != 0) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("Before dumping core, failed to suspend domain '%d'"
>                               " with libxenlight"),
> @@ -2039,7 +2140,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
>          paused = true;
>      }
> 
> -    if (libxl_domain_core_dump(&priv->ctx, dom->id, to) != 0) {
> +    if (libxl_domain_core_dump(priv->ctx, dom->id, to, NULL) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to dump core of domain '%d' with libxenlight"),
>                         dom->id);
> @@ -2048,7 +2149,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
> 
>      libxlDriverLock(driver);
>      if (flags & VIR_DUMP_CRASH) {
> -        if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_CRASHED) != 0) {
> +        if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_CRASHED) != 0) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("Failed to destroy domain '%d'"), dom->id);
>              goto cleanup_unlock;
> @@ -2069,7 +2170,7 @@ cleanup_unlock:
>      libxlDriverUnlock(driver);
>  cleanup_unpause:
>      if (virDomainObjIsActive(vm) && paused) {
> -        if (libxl_domain_unpause(&priv->ctx, dom->id) != 0) {
> +        if (libxl_domain_unpause(priv->ctx, dom->id) != 0) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("After dumping core, failed to resume domain '%d' with"
>                               " libxenlight"), dom->id);
> @@ -2227,7 +2328,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
>      libxlDomainObjPrivatePtr priv;
>      virDomainDefPtr def;
>      virDomainObjPtr vm;
> -    libxl_cpumap map;
> +    libxl_bitmap map;
>      uint8_t *bitmask = NULL;
>      unsigned int maplen;
>      unsigned int i, pos;
> @@ -2322,7 +2423,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
>          break;
> 
>      case VIR_DOMAIN_VCPU_LIVE:
> -        if (libxl_set_vcpuonline(&priv->ctx, dom->id, &map) != 0) {
> +        if (libxl_set_vcpuonline(priv->ctx, dom->id, &map) != 0) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("Failed to set vcpus for domain '%d'"
>                               " with libxenlight"), dom->id);
> @@ -2331,7 +2432,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
>          break;
> 
>      case VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG:
> -        if (libxl_set_vcpuonline(&priv->ctx, dom->id, &map) != 0) {
> +        if (libxl_set_vcpuonline(priv->ctx, dom->id, &map) != 0) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,
>                             _("Failed to set vcpus for domain '%d'"
>                               " with libxenlight"), dom->id);
> @@ -2427,7 +2528,7 @@ libxlDomainPinVcpu(virDomainPtr dom, unsigned int vcpu, unsigned char *cpumap,
>      libxlDomainObjPrivatePtr priv;
>      virDomainObjPtr vm;
>      int ret = -1;
> -    libxl_cpumap map;
> +    libxl_bitmap map;
> 
>      libxlDriverLock(driver);
>      vm = virDomainFindByUUID(&driver->domains, dom->uuid);
> @@ -2448,7 +2549,7 @@ libxlDomainPinVcpu(virDomainPtr dom, unsigned int vcpu, unsigned char *cpumap,
> 
>      map.size = maplen;
>      map.map = cpumap;
> -    if (libxl_set_vcpuaffinity(&priv->ctx, dom->id, vcpu, &map) != 0) {
> +    if (libxl_set_vcpuaffinity(priv->ctx, dom->id, vcpu, &map) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to pin vcpu '%d' with libxenlight"), vcpu);
>          goto cleanup;
> @@ -2511,7 +2612,7 @@ libxlDomainGetVcpus(virDomainPtr dom, virVcpuInfoPtr info, int maxinfo,
>      }
> 
>      priv = vm->privateData;
> -    if ((vcpuinfo = libxl_list_vcpu(&priv->ctx, dom->id, &maxcpu,
> +    if ((vcpuinfo = libxl_list_vcpu(priv->ctx, dom->id, &maxcpu,
>                                      &hostcpus)) == NULL) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to list vcpus for domain '%d' with libxenlight"),
> @@ -2538,7 +2639,7 @@ libxlDomainGetVcpus(virDomainPtr dom, virVcpuInfoPtr info, int maxinfo,
>                     MIN(maplen, vcpuinfo[i].cpumap.size));
>          }
> 
> -        libxl_vcpuinfo_destroy(&vcpuinfo[i]);
> +        libxl_vcpuinfo_dispose(&vcpuinfo[i]);
>      }
>      VIR_FREE(vcpuinfo);
> 
> @@ -2596,7 +2697,7 @@ libxlDomainXMLFromNative(virConnectPtr conn, const char * nativeFormat,
>          goto cleanup;
>      }
> 
> -    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
> +    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
>          VIR_ERROR(_("cannot get version information from libxenlight"));
>          goto cleanup;
>      }
> @@ -2639,7 +2740,7 @@ libxlDomainXMLToNative(virConnectPtr conn, const char * nativeFormat,
>          goto cleanup;
>      }
> 
> -    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
> +    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
>          VIR_ERROR(_("cannot get version information from libxenlight"));
>          goto cleanup;
>      }
> @@ -2899,10 +3000,10 @@ libxlDomainChangeEjectableMedia(libxlDomainObjPrivatePtr priv,
>          return -1;
>      }
> 
> -    if (libxlMakeDisk(vm->def, disk, &x_disk) < 0)
> +    if (libxlMakeDisk(disk, &x_disk) < 0)
>          goto cleanup;
> 
> -    if ((ret = libxl_cdrom_insert(&priv->ctx, vm->def->id, &x_disk)) < 0) {
> +    if ((ret = libxl_cdrom_insert(priv->ctx, vm->def->id, &x_disk, NULL)) < 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("libxenlight failed to change media for disk '%s'"),
>                         disk->dst);
> @@ -2954,11 +3055,11 @@ libxlDomainAttachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
>                      goto cleanup;
>                  }
> 
> -                if (libxlMakeDisk(vm->def, l_disk, &x_disk) < 0)
> +                if (libxlMakeDisk(l_disk, &x_disk) < 0)
>                      goto cleanup;
> 
> -                if ((ret = libxl_device_disk_add(&priv->ctx, vm->def->id,
> -                                                &x_disk)) < 0) {
> +                if ((ret = libxl_device_disk_add(priv->ctx, vm->def->id,
> +                                                &x_disk, NULL)) < 0) {
>                      virReportError(VIR_ERR_INTERNAL_ERROR,
>                                     _("libxenlight failed to attach disk '%s'"),
>                                     l_disk->dst);
> @@ -2991,7 +3092,6 @@ libxlDomainDetachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
>      virDomainDiskDefPtr l_disk = NULL;
>      libxl_device_disk x_disk;
>      int i;
> -    int wait_secs = 2;
>      int ret = -1;
> 
>      switch (dev->data.disk->device)  {
> @@ -3008,11 +3108,11 @@ libxlDomainDetachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
> 
>                  l_disk = vm->def->disks[i];
> 
> -                if (libxlMakeDisk(vm->def, l_disk, &x_disk) < 0)
> +                if (libxlMakeDisk(l_disk, &x_disk) < 0)
>                      goto cleanup;
> 
> -                if ((ret = libxl_device_disk_del(&priv->ctx, &x_disk,
> -                                                 wait_secs)) < 0) {
> +                if ((ret = libxl_device_disk_remove(priv->ctx, vm->def->id,
> +                                                    &x_disk, NULL)) < 0) {
>                      virReportError(VIR_ERR_INTERNAL_ERROR,
>                                     _("libxenlight failed to detach disk '%s'"),
>                                     l_disk->dst);
> @@ -3383,13 +3483,13 @@ libxlNodeGetFreeMemory(virConnectPtr conn)
>      const libxl_version_info* ver_info;
>      libxlDriverPrivatePtr driver = conn->privateData;
> 
> -    if (libxl_get_physinfo(&driver->ctx, &phy_info)) {
> +    if (libxl_get_physinfo(driver->ctx, &phy_info)) {
>          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                         _("libxl_get_physinfo_info failed"));
>          return 0;
>      }
> 
> -    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
> +    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
>          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                         _("libxl_get_version_info failed"));
>          return 0;
> @@ -3536,7 +3636,7 @@ libxlDomainGetSchedulerType(virDomainPtr dom, int *nparams)
>      libxlDomainObjPrivatePtr priv;
>      virDomainObjPtr vm;
>      char * ret = NULL;
> -    int sched_id;
> +    libxl_scheduler sched_id;
> 
>      libxlDriverLock(driver);
>      vm = virDomainFindByUUID(&driver->domains, dom->uuid);
> @@ -3553,31 +3653,29 @@ libxlDomainGetSchedulerType(virDomainPtr dom, int *nparams)
>      }
> 
>      priv = vm->privateData;
> -    if ((sched_id = libxl_get_sched_id(&priv->ctx)) < 0) {
> -        virReportError(VIR_ERR_INTERNAL_ERROR,
> -                       _("Failed to get scheduler id for domain '%d'"
> -                         " with libxenlight"), dom->id);
> -        goto cleanup;
> -    }
> +    sched_id = libxl_get_scheduler(priv->ctx);
> 
>      if (nparams)
>          *nparams = 0;
>      switch (sched_id) {
> -    case XEN_SCHEDULER_SEDF:
> +    case LIBXL_SCHEDULER_SEDF:
>          ret = strdup("sedf");
>          break;
> -    case XEN_SCHEDULER_CREDIT:
> +    case LIBXL_SCHEDULER_CREDIT:
>          ret = strdup("credit");
>          if (nparams)
>              *nparams = XEN_SCHED_CREDIT_NPARAM;
>          break;
> -    case XEN_SCHEDULER_CREDIT2:
> +    case LIBXL_SCHEDULER_CREDIT2:
>          ret = strdup("credit2");
>          break;
> -    case XEN_SCHEDULER_ARINC653:
> +    case LIBXL_SCHEDULER_ARINC653:
>          ret = strdup("arinc653");
>          break;
>      default:
> +        virReportError(VIR_ERR_INTERNAL_ERROR,
> +                   _("Failed to get scheduler id for domain '%d'"
> +                     " with libxenlight"), dom->id);
>          goto cleanup;
>      }
> 
> @@ -3599,8 +3697,8 @@ libxlDomainGetSchedulerParametersFlags(virDomainPtr dom,
>      libxlDriverPrivatePtr driver = dom->conn->privateData;
>      libxlDomainObjPrivatePtr priv;
>      virDomainObjPtr vm;
> -    libxl_sched_credit sc_info;
> -    int sched_id;
> +    libxl_domain_sched_params sc_info;
> +    libxl_scheduler sched_id;
>      int ret = -1;
> 
>      virCheckFlags(0, -1);
> @@ -3610,31 +3708,28 @@ libxlDomainGetSchedulerParametersFlags(virDomainPtr dom,
>      libxlDriverUnlock(driver);
> 
>      if (!vm) {
> -        virReportError(VIR_ERR_NO_DOMAIN, "%s", _("no domain with matching uuid"));
> +        virReportError(VIR_ERR_NO_DOMAIN, "%s",
> +                       _("no domain with matching uuid"));
>          goto cleanup;
>      }
> 
>      if (!virDomainObjIsActive(vm)) {
> -        virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("Domain is not running"));
> +        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
> +                       _("Domain is not running"));
>          goto cleanup;
>      }
> 
>      priv = vm->privateData;
> 
> -    if ((sched_id = libxl_get_sched_id(&priv->ctx)) < 0) {
> -        virReportError(VIR_ERR_INTERNAL_ERROR,
> -                       _("Failed to get scheduler id for domain '%d'"
> -                         " with libxenlight"), dom->id);
> -        goto cleanup;
> -    }
> +    sched_id = libxl_get_scheduler(priv->ctx);
> 
> -    if (sched_id != XEN_SCHEDULER_CREDIT) {
> +    if (sched_id != LIBXL_SCHEDULER_CREDIT) {
>          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                         _("Only 'credit' scheduler is supported"));
>          goto cleanup;
>      }
> 
> -    if (libxl_sched_credit_domain_get(&priv->ctx, dom->id, &sc_info) != 0) {
> +    if (libxl_domain_sched_params_get(priv->ctx, dom->id, &sc_info) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to get scheduler parameters for domain '%d'"
>                           " with libxenlight"), dom->id);
> @@ -3677,7 +3772,7 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
>      libxlDriverPrivatePtr driver = dom->conn->privateData;
>      libxlDomainObjPrivatePtr priv;
>      virDomainObjPtr vm;
> -    libxl_sched_credit sc_info;
> +    libxl_domain_sched_params sc_info;
>      int sched_id;
>      int i;
>      int ret = -1;
> @@ -3707,20 +3802,15 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
> 
>      priv = vm->privateData;
> 
> -    if ((sched_id = libxl_get_sched_id(&priv->ctx)) < 0) {
> -        virReportError(VIR_ERR_INTERNAL_ERROR,
> -                       _("Failed to get scheduler id for domain '%d'"
> -                         " with libxenlight"), dom->id);
> -        goto cleanup;
> -    }
> +    sched_id = libxl_get_scheduler(priv->ctx);
> 
> -    if (sched_id != XEN_SCHEDULER_CREDIT) {
> +    if (sched_id != LIBXL_SCHEDULER_CREDIT) {
>          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                         _("Only 'credit' scheduler is supported"));
>          goto cleanup;
>      }
> 
> -    if (libxl_sched_credit_domain_get(&priv->ctx, dom->id, &sc_info) != 0) {
> +    if (libxl_domain_sched_params_get(priv->ctx, dom->id, &sc_info) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to get scheduler parameters for domain '%d'"
>                           " with libxenlight"), dom->id);
> @@ -3737,7 +3827,7 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
>          }
>      }
> 
> -    if (libxl_sched_credit_domain_set(&priv->ctx, dom->id, &sc_info) != 0) {
> +    if (libxl_domain_sched_params_set(priv->ctx, dom->id, &sc_info) != 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Failed to set scheduler parameters for domain '%d'"
>                           " with libxenlight"), dom->id);
> --
> 1.7.10.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:57:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:57:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJnI-0004MR-LD; Tue, 27 Nov 2012 11:57:40 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TdJnH-0004MC-3J
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:57:39 +0000
Received: from [85.158.137.99:42785] by server-7.bemta-3.messagelabs.com id
	A0/19-01713-0BAA4B05; Tue, 27 Nov 2012 11:57:36 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354017452!17646966!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10259 invoked from network); 27 Nov 2012 11:57:35 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:57:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215579614"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:57:14 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 06:57:14 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TdJmr-00057b-QG;
	Tue, 27 Nov 2012 11:57:13 +0000
Date: Tue, 27 Nov 2012 11:57:11 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: George Dunlap <George.Dunlap@eu.citrix.com>
In-Reply-To: <CAFLBxZYjcij+20baWQZwh+7RSXw1SJjk7PkZ7g-1DoX6EsOa8w@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1211271156530.5310@kaball.uk.xensource.com>
References: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
	<CAFLBxZYjcij+20baWQZwh+7RSXw1SJjk7PkZ7g-1DoX6EsOa8w@mail.gmail.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="1342847746-1765838671-1354017431=:5310"
Cc: "libvir-list@redhat.com" <libvir-list@redhat.com>,
	Jim Fehlig <jfehlig@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Convert libxl driver to Xen 4.2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--1342847746-1765838671-1354017431=:5310
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Tue, 27 Nov 2012, George Dunlap wrote:
> On Mon, Nov 26, 2012 at 10:28 PM, Jim Fehlig <jfehlig@suse.com> wrote:
>       Based on a patch originally authored by Daniel De Graaf
>=20
>       =C2=A0 http://lists.xen.org/archives/html/xen-devel/2012-05/msg0056=
5.html
>=20
>       This patch converts the Xen libxl driver to support only Xen >=3D 4=
=2E2.
>       Support for Xen 4.1 libxl is dropped since that version of libxl is
>       designated 'technology preview' only and is incompatible with Xen 4=
=2E2
>       libxl. =C2=A0Additionally, the default toolstack in Xen 4.1 is stil=
l xend,
>       for which libvirt has a stable, functional driver.
>=20
>=20
> Great!=C2=A0 Just one question -- does this patch add any new functionali=
ty (e.g., migration for libxl), or just switch the
> existing functionality over to the new interface?

It does not add any new functionalities AFAICT.
--1342847746-1765838671-1354017431=:5310
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.xen.org
http://lists.xen.org/xen-devel

--1342847746-1765838671-1354017431=:5310--


From xen-devel-bounces@lists.xen.org Tue Nov 27 11:57:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:57:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJnI-0004MR-LD; Tue, 27 Nov 2012 11:57:40 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TdJnH-0004MC-3J
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:57:39 +0000
Received: from [85.158.137.99:42785] by server-7.bemta-3.messagelabs.com id
	A0/19-01713-0BAA4B05; Tue, 27 Nov 2012 11:57:36 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354017452!17646966!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10259 invoked from network); 27 Nov 2012 11:57:35 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:57:35 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215579614"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:57:14 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 06:57:14 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TdJmr-00057b-QG;
	Tue, 27 Nov 2012 11:57:13 +0000
Date: Tue, 27 Nov 2012 11:57:11 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: George Dunlap <George.Dunlap@eu.citrix.com>
In-Reply-To: <CAFLBxZYjcij+20baWQZwh+7RSXw1SJjk7PkZ7g-1DoX6EsOa8w@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1211271156530.5310@kaball.uk.xensource.com>
References: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
	<CAFLBxZYjcij+20baWQZwh+7RSXw1SJjk7PkZ7g-1DoX6EsOa8w@mail.gmail.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="1342847746-1765838671-1354017431=:5310"
Cc: "libvir-list@redhat.com" <libvir-list@redhat.com>,
	Jim Fehlig <jfehlig@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Convert libxl driver to Xen 4.2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--1342847746-1765838671-1354017431=:5310
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Tue, 27 Nov 2012, George Dunlap wrote:
> On Mon, Nov 26, 2012 at 10:28 PM, Jim Fehlig <jfehlig@suse.com> wrote:
>       Based on a patch originally authored by Daniel De Graaf
>=20
>       =C2=A0 http://lists.xen.org/archives/html/xen-devel/2012-05/msg0056=
5.html
>=20
>       This patch converts the Xen libxl driver to support only Xen >=3D 4=
=2E2.
>       Support for Xen 4.1 libxl is dropped since that version of libxl is
>       designated 'technology preview' only and is incompatible with Xen 4=
=2E2
>       libxl. =C2=A0Additionally, the default toolstack in Xen 4.1 is stil=
l xend,
>       for which libvirt has a stable, functional driver.
>=20
>=20
> Great!=C2=A0 Just one question -- does this patch add any new functionali=
ty (e.g., migration for libxl), or just switch the
> existing functionality over to the new interface?

It does not add any new functionalities AFAICT.
--1342847746-1765838671-1354017431=:5310
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.xen.org
http://lists.xen.org/xen-devel

--1342847746-1765838671-1354017431=:5310--


From xen-devel-bounces@lists.xen.org Tue Nov 27 11:59:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:59:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJp9-0004YM-7s; Tue, 27 Nov 2012 11:59:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdJp7-0004YF-PF
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:59:34 +0000
Received: from [85.158.138.51:53902] by server-14.bemta-3.messagelabs.com id
	CC/6B-31424-42BA4B05; Tue, 27 Nov 2012 11:59:32 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1354017572!11940805!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13739 invoked from network); 27 Nov 2012 11:59:32 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-13.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:59:32 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16021850"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:58:48 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 11:58:48 +0000
Message-ID: <1354017527.17985.26.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Tue, 27 Nov 2012 11:58:47 +0000
In-Reply-To: <20121127115220.GG5956@type.bordeaux.inria.fr>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
	<29138c27eb72e5602751.1353947050@andrewcoop.uk.xensource.com>
	<20121126214212.GL7556@type.youpi.perso.aquilenet.fr>
	<1354016079.17985.8.camel@zakaz.uk.xensource.com>
	<20121127113953.GB5956@type.bordeaux.inria.fr>
	<1354016801.17985.16.camel@zakaz.uk.xensource.com>
	<20121127115220.GG5956@type.bordeaux.inria.fr>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 4] minios/console: console_input() weak
 reference
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer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Cj4gWWVzLCBpdCBlY2hvZXMgd2hhdCB3YXMgdHlwZWQgb24gdGhlIGNvbnNvbGUgYnkgdGhlIHVz
ZXIuCj4gCj4gPiAodGhpcyBpcyByeCByZW1lbWJlciwgc28gYnVmZmVyIG91Z2h0IHRvIGJlIGFu
IG91dHB1dCBidWZmZXIsIG5vdAo+ID4gaW5wdXQpCj4gCj4gUmVhbGx5PyAgSXQncyBub3Qgd2hh
dCBJIHVuZGVyc3RhbmQgZnJvbSBjb25zb2xlX2hhbmRsZV9pbnB1dCwgd2hpY2gKPiBqdXN0IGNv
bnN1bWVzIGRhdGEgZnJvbSB0aGUgcmluZyBhbmQgZ2l2ZXMgaXQgdG8geGVuY29uc19yeCwgd2l0
aG91dAo+IGVtaXRpbmcgYW55LgoKT2gsIHhlbmNvbnNfcnggaXMgdGhlIGZ1bmN0aW9uIGNhbGxl
ZCB3aGVuIGRhdGEgaXMgcmVjZWl2ZWQgb24gdGhlCmNvbnNvbGUsIGFzIG9wcG9zZWQgdG8gYSBm
dW5jdGlvbiB3aGljaCBpcyBleHBlY3RlZCB0byByZWNlaXZlIGRhdGEgZnJvbQp0aGUgY29uc29s
ZSBpdHNlbGYgKHdoaWNoIGlzIHRoZSBvdGhlciBwb3NzaWJsZSByZWFkaW5nIG9mIHRoZSBuYW1l
KS4KU29ycnksIG15IGNvbmZ1c2lvbiwgcGx1cyBiZWluZyB0b28gbGF6eSB0byBydW4gY3Njb3Bl
IGluIG9yZGVyIHRvIGZpbmQKdGhlIGNhbGxlci4KCklhbi4KCgoKX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlzdApYZW4t
ZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Tue Nov 27 11:59:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 11:59:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJp9-0004YM-7s; Tue, 27 Nov 2012 11:59:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdJp7-0004YF-PF
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 11:59:34 +0000
Received: from [85.158.138.51:53902] by server-14.bemta-3.messagelabs.com id
	CC/6B-31424-42BA4B05; Tue, 27 Nov 2012 11:59:32 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1354017572!11940805!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13739 invoked from network); 27 Nov 2012 11:59:32 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-13.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 11:59:32 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16021850"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 11:58:48 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 11:58:48 +0000
Message-ID: <1354017527.17985.26.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Tue, 27 Nov 2012 11:58:47 +0000
In-Reply-To: <20121127115220.GG5956@type.bordeaux.inria.fr>
References: <patchbomb.1353947048@andrewcoop.uk.xensource.com>
	<29138c27eb72e5602751.1353947050@andrewcoop.uk.xensource.com>
	<20121126214212.GL7556@type.youpi.perso.aquilenet.fr>
	<1354016079.17985.8.camel@zakaz.uk.xensource.com>
	<20121127113953.GB5956@type.bordeaux.inria.fr>
	<1354016801.17985.16.camel@zakaz.uk.xensource.com>
	<20121127115220.GG5956@type.bordeaux.inria.fr>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 4] minios/console: console_input() weak
 reference
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVHVlLCAyMDEyLTExLTI3IGF0IDExOjUyICswMDAwLCBTYW11ZWwgVGhpYmF1bHQgd3JvdGU6
Cj4gSWFuIENhbXBiZWxsLCBsZSBUdWUgMjcgTm92IDIwMTIgMTE6NDY6NDEgKzAwMDAsIGEgw6lj
cml0IDoKPiA+ID4gPiBBbmQgYnk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HVuZGVyc3RhbmQgZnJvbSBjb25zb2xlX2hhbmRsZV9pbnB1dCwgd2hpY2gKPiBqdXN0IGNv
bnN1bWVzIGRhdGEgZnJvbSB0aGUgcmluZyBhbmQgZ2l2ZXMgaXQgdG8geGVuY29uc19yeCwgd2l0
aG91dAo+IGVtaXRpbmcgYW55LgoKT2gsIHhlbmNvbnNfcnggaXMgdGhlIGZ1bmN0aW9uIGNhbGxl
ZCB3aGVuIGRhdGEgaXMgcmVjZWl2ZWQgb24gdGhlCmNvbnNvbGUsIGFzIG9wcG9zZWQgdG8gYSBm
dW5jdGlvbiB3aGljaCBpcyBleHBlY3RlZCB0byByZWNlaXZlIGRhdGEgZnJvbQp0aGUgY29uc29s
ZSBpdHNlbGYgKHdoaWNoIGlzIHRoZSBvdGhlciBwb3NzaWJsZSByZWFkaW5nIG9mIHRoZSBuYW1l
KS4KU29ycnksIG15IGNvbmZ1c2lvbiwgcGx1cyBiZWluZyB0b28gbGF6eSB0byBydW4gY3Njb3Bl
IGluIG9yZGVyIHRvIGZpbmQKdGhlIGNhbGxlci4KCklhbi4KCgoKX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlzdApYZW4t
ZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Tue Nov 27 12:06:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 12:06:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJvu-00053L-1p; Tue, 27 Nov 2012 12:06:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jefranca@gmail.com>) id 1TdJvs-00053G-8o
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 12:06:32 +0000
Received: from [85.158.139.83:56888] by server-5.bemta-5.messagelabs.com id
	E1/90-11353-7CCA4B05; Tue, 27 Nov 2012 12:06:31 +0000
X-Env-Sender: jefranca@gmail.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1354017989!27514803!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31854 invoked from network); 27 Nov 2012 12:06:30 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-6.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 12:06:30 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so15095464vbi.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 04:06:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=LV4aQ1TM4mTNGsbetLI2u1cQKKuKZSgdr6esCvKdig8=;
	b=J9OkySWzZSbuJaysbcJk/umiCjjy6efvwurtt3hIsfLCPAC+ZqKNTtfjjBDFuMVNxq
	TJlidjnlupXVadAUchgRSewk1Kpeo/HvCrnYtwQzLQX2Vi59wPkq6FKOofQRi6/wPXNw
	tPcQ6oNk+kF9HLj2Rn2I4XHp+jNPXQUuwAnoFH2r9EaC2kmOA4utq9H+HrFRVGY7pBhX
	v/5SqC15vyTAS/67ZmyBjsljSCa+fIJbZu1s3jE8GNywrCTiQe6hjLDFj5AOekWUZoPI
	viTn+iqhTS0LhtDzgrjAcaj3V+Bm8AY3wUuge3ChEmOUGsh218TEpHUCmhPygr8H4ic5
	FBeA==
MIME-Version: 1.0
Received: by 10.52.72.104 with SMTP id c8mr21116917vdv.20.1354017989237; Tue,
	27 Nov 2012 04:06:29 -0800 (PST)
Received: by 10.58.117.105 with HTTP; Tue, 27 Nov 2012 04:06:29 -0800 (PST)
Date: Tue, 27 Nov 2012 10:06:29 -0200
Message-ID: <CAJP76_AA2C0pz8zu1_UJTReyyGsJVTMeBM8MMqf+Au6tBYAcBA@mail.gmail.com>
From: =?ISO-8859-1?Q?Jos=E9_Eduardo_Fran=E7a?= <jefranca@gmail.com>
To: xen-devel@lists.xen.org, rshriram@cs.ubc.ca
Subject: [Xen-devel] How to get dirty page count in Remus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4363188086847146700=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4363188086847146700==
Content-Type: multipart/alternative; boundary=bcaec50162bd449bfe04cf78e152

--bcaec50162bd449bfe04cf78e152
Content-Type: text/plain; charset=ISO-8859-1

Hi guys,

During my research (see:
http://lists.xen.org/archives/html/xen-devel/2012-10/msg00035.html), I
managed to evolve. For example, I can change the checkpoint interval while
the remus was running.

Now I need to get dirty page count into remus or save.py codes. I can get
this data in xc_domain_save.c (with stats.dirty_count), but I don't know
how to transport it to remus or save.py codes.

Is there a way to do this?

Thanks jefranca

PS: My English is terrible coz I'm not native

--bcaec50162bd449bfe04cf78e152
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi guys,<br><br>During my research (see: <a href=3D"http://lists.xen.org/ar=
chives/html/xen-devel/2012-10/msg00035.html">http://lists.xen.org/archives/=
html/xen-devel/2012-10/msg00035.html</a>), <span id=3D"result_box" class=3D=
"" lang=3D"en"><span class=3D"">I managed to</span> <span class=3D"">evolve=
. For example, I can change the </span></span>checkpoint interval while the=
 remus was running.<br>
<br>Now I need to get dirty page count into remus or save.py codes. I can g=
et this data in xc_domain_save.c (with stats.dirty_count), but I don&#39;t =
know how to transport it to remus or save.py codes.<br><br>Is there a way t=
o do this?<br>
<br>Thanks jefranca<br><br>PS: My English is terrible coz I&#39;m not nativ=
e<br>

--bcaec50162bd449bfe04cf78e152--


--===============4363188086847146700==
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.xen.org
http://lists.xen.org/xen-devel

--===============4363188086847146700==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 12:06:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 12:06:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJvu-00053L-1p; Tue, 27 Nov 2012 12:06:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jefranca@gmail.com>) id 1TdJvs-00053G-8o
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 12:06:32 +0000
Received: from [85.158.139.83:56888] by server-5.bemta-5.messagelabs.com id
	E1/90-11353-7CCA4B05; Tue, 27 Nov 2012 12:06:31 +0000
X-Env-Sender: jefranca@gmail.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1354017989!27514803!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31854 invoked from network); 27 Nov 2012 12:06:30 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-6.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 12:06:30 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so15095464vbi.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 04:06:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=LV4aQ1TM4mTNGsbetLI2u1cQKKuKZSgdr6esCvKdig8=;
	b=J9OkySWzZSbuJaysbcJk/umiCjjy6efvwurtt3hIsfLCPAC+ZqKNTtfjjBDFuMVNxq
	TJlidjnlupXVadAUchgRSewk1Kpeo/HvCrnYtwQzLQX2Vi59wPkq6FKOofQRi6/wPXNw
	tPcQ6oNk+kF9HLj2Rn2I4XHp+jNPXQUuwAnoFH2r9EaC2kmOA4utq9H+HrFRVGY7pBhX
	v/5SqC15vyTAS/67ZmyBjsljSCa+fIJbZu1s3jE8GNywrCTiQe6hjLDFj5AOekWUZoPI
	viTn+iqhTS0LhtDzgrjAcaj3V+Bm8AY3wUuge3ChEmOUGsh218TEpHUCmhPygr8H4ic5
	FBeA==
MIME-Version: 1.0
Received: by 10.52.72.104 with SMTP id c8mr21116917vdv.20.1354017989237; Tue,
	27 Nov 2012 04:06:29 -0800 (PST)
Received: by 10.58.117.105 with HTTP; Tue, 27 Nov 2012 04:06:29 -0800 (PST)
Date: Tue, 27 Nov 2012 10:06:29 -0200
Message-ID: <CAJP76_AA2C0pz8zu1_UJTReyyGsJVTMeBM8MMqf+Au6tBYAcBA@mail.gmail.com>
From: =?ISO-8859-1?Q?Jos=E9_Eduardo_Fran=E7a?= <jefranca@gmail.com>
To: xen-devel@lists.xen.org, rshriram@cs.ubc.ca
Subject: [Xen-devel] How to get dirty page count in Remus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4363188086847146700=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4363188086847146700==
Content-Type: multipart/alternative; boundary=bcaec50162bd449bfe04cf78e152

--bcaec50162bd449bfe04cf78e152
Content-Type: text/plain; charset=ISO-8859-1

Hi guys,

During my research (see:
http://lists.xen.org/archives/html/xen-devel/2012-10/msg00035.html), I
managed to evolve. For example, I can change the checkpoint interval while
the remus was running.

Now I need to get dirty page count into remus or save.py codes. I can get
this data in xc_domain_save.c (with stats.dirty_count), but I don't know
how to transport it to remus or save.py codes.

Is there a way to do this?

Thanks jefranca

PS: My English is terrible coz I'm not native

--bcaec50162bd449bfe04cf78e152
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi guys,<br><br>During my research (see: <a href=3D"http://lists.xen.org/ar=
chives/html/xen-devel/2012-10/msg00035.html">http://lists.xen.org/archives/=
html/xen-devel/2012-10/msg00035.html</a>), <span id=3D"result_box" class=3D=
"" lang=3D"en"><span class=3D"">I managed to</span> <span class=3D"">evolve=
. For example, I can change the </span></span>checkpoint interval while the=
 remus was running.<br>
<br>Now I need to get dirty page count into remus or save.py codes. I can g=
et this data in xc_domain_save.c (with stats.dirty_count), but I don&#39;t =
know how to transport it to remus or save.py codes.<br><br>Is there a way t=
o do this?<br>
<br>Thanks jefranca<br><br>PS: My English is terrible coz I&#39;m not nativ=
e<br>

--bcaec50162bd449bfe04cf78e152--


--===============4363188086847146700==
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.xen.org
http://lists.xen.org/xen-devel

--===============4363188086847146700==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 12:06:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 12:06:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJw5-00054E-Hn; Tue, 27 Nov 2012 12:06:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TdJw4-000540-3T
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 12:06:44 +0000
Received: from [85.158.139.211:32135] by server-12.bemta-5.messagelabs.com id
	4A/5C-02886-3DCA4B05; Tue, 27 Nov 2012 12:06:43 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1354017923!17990775!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_20_30,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18102 invoked from network); 27 Nov 2012 12:05:24 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 12:05:24 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl17so5251313vcb.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 04:05:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=T+l4fd4zp9YWwtulAH9euh2i3Ogx21JYI1QSbKDY2KU=;
	b=x56uyaY083wJY+ZlsO3WpfZFKPegnh8ACMnlUkrkN8xgXN9XbQfRhC2AgIRMhXsqqb
	GX3Sr/4GdSsiyv1IOjB3C2ZDU7gaE6EbT/6UfBR6ygqySGCCtNnzRfYLUoMjS37UEOVd
	yytmqZdgTVHAgNpiB1kJ31eJoxc+s1R2P6OI9RXi5k1iCIWQXaPRprqjZEYWs5OTHY0N
	GuHRnh80DJ8qdUOg36Srk2MOuRpvmBaaKPjKYf+6nxihlPFeIpwxBtCRXW0o//D9xBKT
	oJR3oQ4XInvm6KSyV3cyEBSXWxd5dqBux6R6OvHii3IYTUSUHr6NIpb+94qwxS8iLmDZ
	0myA==
MIME-Version: 1.0
Received: by 10.58.162.130 with SMTP id ya2mr24828360veb.2.1354017923124; Tue,
	27 Nov 2012 04:05:23 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Tue, 27 Nov 2012 04:05:23 -0800 (PST)
In-Reply-To: <1353346964.18229.151.camel@zakaz.uk.xensource.com>
References: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
	<1353346964.18229.151.camel@zakaz.uk.xensource.com>
Date: Tue, 27 Nov 2012 12:05:23 +0000
X-Google-Sender-Auth: EaFWEdmT5fDTtPc9GwwXtGUrP7g
Message-ID: <CAFLBxZYZWtargvXXUDrVNpRKouLgqmPth09qwqxmBFYnuGTGMw@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] Make all public hosting providers
 eligible for the pre-disclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8399410163204298870=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============8399410163204298870==
Content-Type: multipart/alternative; boundary=047d7b6766dc53cf8e04cf78ddad

--047d7b6766dc53cf8e04cf78ddad
Content-Type: text/plain; charset=ISO-8859-1

On Mon, Nov 19, 2012 at 5:42 PM, Ian Campbell <Ian.Campbell@citrix.com>wrote:

> > +    <p>Here as a rule of thumb, "public hosting provider" means
> > +    "selling virtualization services to the general public";
> > +    "large-scale" and "widely deployed" means an installed base of
> > +    300,000 or more Xen guests.  Other well-established organisations
> > +    with a mature security response process will be considered on a
> > +    case-by-case basis.</p>
>
> I agree with Ian that relaxing this for software vendors also seems the
> correct thing to do.
>

If we're going to include software vendors, we need some simple criteria to
define what a "real" software vendor is.  The idea of asking for a link
from cloud providers pointing to public rates and a security policy, which
Ian Jackson proffered, was a good one.  I suppose we could do something
similar for software providers: a link to a web page with either
download-able install images, or prices, perhaps?


>
> > +     <li>A web page with your security policy statement</li>
> > +     <li>If you are a public hosting provider, a web page with your
> public rates</li>
>
> For the last two "a link to ...". Seems obvious but some people are very
> literal ;-)
>

Ack.


> I think it would be good to also include something like:
>                 <li>A statement to the effect that you have read this
>                 policy and agree to abide by the terms for inclusion in
>                 the list, specifically the requirements to regarding
>                 confidentiality during an embargo period</li>
>
> Or something like that.
>

Ack.


> I wonder if we shouldn't also include under the list of "pre-disclosure
> list members should not make available," include "Failure to adhere to
> this will be grounds for removal from the list".
>
> I suppose then we need an appeals process though. How about
> "Reinstatement will require a post to the xen-devel mailing list
> explaining the procedures which have been put in place to prevent any
> further breach of confidentiality" + a three strikes rule (any org who
> managed so mess this up three times isn't likely to stay in business
> long enough to require an appeals process against that ;-)).
>

I think this is a slightly separate topic -- I think it would be easier if
we handle criteria for inclusion separately from procedure for removal /
reinstatement.


> Also, and I understand this is most likely taking things way too far, I
> was wondering about requiring the request to be signed by a key which
> itself has a signature from a key in the "strong
> set" (http://pgp.cs.uu.nl/plot/) of PGP keys (implemented by me being
> able to find a path from my key to it). This is just another hurdle
> which serves to ensure that list members are in some sense legitimate.
> (NB I'm not sure I buy this argument, surely there are corrupt types in
> the strong set). This hurdle might be too big in practice? It doesn't
> seem so to me but then I hang around with a lot of Debian types ;-)
>

Well that might work for open-source providers, but would it work for say,
Rackspace, Linode, Amazon?  Huawei?  Or another company like Citrix, whose
product team isn't heavily involved in open-source community things?

It might be sensible to say that such a signature would be considered in
the application process -- that would allow small groups that are very
active in the OSS community to balance out large companies that can spend a
lot on marketing &c to make themselves known.

 -George

--047d7b6766dc53cf8e04cf78ddad
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Mon, Nov 19, 2012 at 5:42 PM, Ian Campbell <span dir=3D"ltr">&lt;<a href=
=3D"mailto:Ian.Campbell@citrix.com" target=3D"_blank">Ian.Campbell@citrix.c=
om</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_=
quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">&gt; + =A0 =A0&lt;p&gt;Here as a rule of thu=
mb, &quot;public hosting provider&quot; means<br><div><div class=3D"h5">
&gt; + =A0 =A0&quot;selling virtualization services to the general public&q=
uot;;<br>
&gt; + =A0 =A0&quot;large-scale&quot; and &quot;widely deployed&quot; means=
 an installed base of<br>
&gt; + =A0 =A0300,000 or more Xen guests. =A0Other well-established organis=
ations<br>
&gt; + =A0 =A0with a mature security response process will be considered on=
 a<br>
&gt; + =A0 =A0case-by-case basis.&lt;/p&gt;<br>
<br>
</div></div>I agree with Ian that relaxing this for software vendors also s=
eems the<br>
correct thing to do.<br></blockquote><div><br>If we&#39;re going to include=
 software vendors, we need some simple criteria to define what a &quot;real=
&quot; software vendor is.=A0 The idea of asking for a link from cloud prov=
iders pointing to public rates and a security policy, which Ian Jackson pro=
ffered, was a good one.=A0 I suppose we could do something similar for soft=
ware providers: a link to a web page with either download-able install imag=
es, or prices, perhaps?<br>
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex">
<div class=3D"im"><br>
&gt; + =A0 =A0 &lt;li&gt;A web page with your security policy statement&lt;=
/li&gt;<br>
&gt; + =A0 =A0 &lt;li&gt;If you are a public hosting provider, a web page w=
ith your public rates&lt;/li&gt;<br>
<br>
</div>For the last two &quot;a link to ...&quot;. Seems obvious but some pe=
ople are very<br>
literal ;-)<br></blockquote><div><br>Ack.<br>=A0</div><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex">
I think it would be good to also include something like:<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &lt;li&gt;A statement to the effect that yo=
u have read this<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 policy and agree to abide by the terms for =
inclusion in<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 the list, specifically the requirements to =
regarding<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 confidentiality during an embargo period&lt=
;/li&gt;<br>
<br>
Or something like that.<br></blockquote><div><br>Ack.<br>=A0</div><blockquo=
te class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc so=
lid;padding-left:1ex">
I wonder if we shouldn&#39;t also include under the list of &quot;pre-discl=
osure<br>
list members should not make available,&quot; include &quot;Failure to adhe=
re to<br>
this will be grounds for removal from the list&quot;.<br>
<br>
I suppose then we need an appeals process though. How about<br>
&quot;Reinstatement will require a post to the xen-devel mailing list<br>
explaining the procedures which have been put in place to prevent any<br>
further breach of confidentiality&quot; + a three strikes rule (any org who=
<br>
managed so mess this up three times isn&#39;t likely to stay in business<br=
>
long enough to require an appeals process against that ;-)).<br></blockquot=
e><div><br>I think this is a slightly separate topic -- I think it would be=
 easier if we handle criteria for inclusion separately from procedure for r=
emoval / reinstatement.<br>
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex">
Also, and I understand this is most likely taking things way too far, I<br>
was wondering about requiring the request to be signed by a key which<br>
itself has a signature from a key in the &quot;strong<br>
set&quot; (<a href=3D"http://pgp.cs.uu.nl/plot/" target=3D"_blank">http://p=
gp.cs.uu.nl/plot/</a>) of PGP keys (implemented by me being<br>
able to find a path from my key to it). This is just another hurdle<br>
which serves to ensure that list members are in some sense legitimate.<br>
(NB I&#39;m not sure I buy this argument, surely there are corrupt types in=
<br>
the strong set). This hurdle might be too big in practice? It doesn&#39;t<b=
r>
seem so to me but then I hang around with a lot of Debian types ;-)<br></bl=
ockquote><div><br>Well that might work for open-source providers, but would=
 it work for say, Rackspace, Linode, Amazon?=A0 Huawei?=A0 Or another compa=
ny like Citrix, whose product team isn&#39;t heavily involved in open-sourc=
e community things?<br>
<br>It might be sensible to say that such a signature would be considered i=
n the application process -- that would allow small groups that are very ac=
tive in the OSS community to balance out large companies that can spend a l=
ot on marketing &amp;c to make themselves known.<br>
=A0</div></div>=A0-George<br></div>

--047d7b6766dc53cf8e04cf78ddad--


--===============8399410163204298870==
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.xen.org
http://lists.xen.org/xen-devel

--===============8399410163204298870==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 12:06:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 12:06:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdJw5-00054E-Hn; Tue, 27 Nov 2012 12:06:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TdJw4-000540-3T
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 12:06:44 +0000
Received: from [85.158.139.211:32135] by server-12.bemta-5.messagelabs.com id
	4A/5C-02886-3DCA4B05; Tue, 27 Nov 2012 12:06:43 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1354017923!17990775!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_20_30,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18102 invoked from network); 27 Nov 2012 12:05:24 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 12:05:24 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl17so5251313vcb.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 04:05:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=T+l4fd4zp9YWwtulAH9euh2i3Ogx21JYI1QSbKDY2KU=;
	b=x56uyaY083wJY+ZlsO3WpfZFKPegnh8ACMnlUkrkN8xgXN9XbQfRhC2AgIRMhXsqqb
	GX3Sr/4GdSsiyv1IOjB3C2ZDU7gaE6EbT/6UfBR6ygqySGCCtNnzRfYLUoMjS37UEOVd
	yytmqZdgTVHAgNpiB1kJ31eJoxc+s1R2P6OI9RXi5k1iCIWQXaPRprqjZEYWs5OTHY0N
	GuHRnh80DJ8qdUOg36Srk2MOuRpvmBaaKPjKYf+6nxihlPFeIpwxBtCRXW0o//D9xBKT
	oJR3oQ4XInvm6KSyV3cyEBSXWxd5dqBux6R6OvHii3IYTUSUHr6NIpb+94qwxS8iLmDZ
	0myA==
MIME-Version: 1.0
Received: by 10.58.162.130 with SMTP id ya2mr24828360veb.2.1354017923124; Tue,
	27 Nov 2012 04:05:23 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Tue, 27 Nov 2012 04:05:23 -0800 (PST)
In-Reply-To: <1353346964.18229.151.camel@zakaz.uk.xensource.com>
References: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
	<1353346964.18229.151.camel@zakaz.uk.xensource.com>
Date: Tue, 27 Nov 2012 12:05:23 +0000
X-Google-Sender-Auth: EaFWEdmT5fDTtPc9GwwXtGUrP7g
Message-ID: <CAFLBxZYZWtargvXXUDrVNpRKouLgqmPth09qwqxmBFYnuGTGMw@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] Make all public hosting providers
 eligible for the pre-disclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8399410163204298870=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============8399410163204298870==
Content-Type: multipart/alternative; boundary=047d7b6766dc53cf8e04cf78ddad

--047d7b6766dc53cf8e04cf78ddad
Content-Type: text/plain; charset=ISO-8859-1

On Mon, Nov 19, 2012 at 5:42 PM, Ian Campbell <Ian.Campbell@citrix.com>wrote:

> > +    <p>Here as a rule of thumb, "public hosting provider" means
> > +    "selling virtualization services to the general public";
> > +    "large-scale" and "widely deployed" means an installed base of
> > +    300,000 or more Xen guests.  Other well-established organisations
> > +    with a mature security response process will be considered on a
> > +    case-by-case basis.</p>
>
> I agree with Ian that relaxing this for software vendors also seems the
> correct thing to do.
>

If we're going to include software vendors, we need some simple criteria to
define what a "real" software vendor is.  The idea of asking for a link
from cloud providers pointing to public rates and a security policy, which
Ian Jackson proffered, was a good one.  I suppose we could do something
similar for software providers: a link to a web page with either
download-able install images, or prices, perhaps?


>
> > +     <li>A web page with your security policy statement</li>
> > +     <li>If you are a public hosting provider, a web page with your
> public rates</li>
>
> For the last two "a link to ...". Seems obvious but some people are very
> literal ;-)
>

Ack.


> I think it would be good to also include something like:
>                 <li>A statement to the effect that you have read this
>                 policy and agree to abide by the terms for inclusion in
>                 the list, specifically the requirements to regarding
>                 confidentiality during an embargo period</li>
>
> Or something like that.
>

Ack.


> I wonder if we shouldn't also include under the list of "pre-disclosure
> list members should not make available," include "Failure to adhere to
> this will be grounds for removal from the list".
>
> I suppose then we need an appeals process though. How about
> "Reinstatement will require a post to the xen-devel mailing list
> explaining the procedures which have been put in place to prevent any
> further breach of confidentiality" + a three strikes rule (any org who
> managed so mess this up three times isn't likely to stay in business
> long enough to require an appeals process against that ;-)).
>

I think this is a slightly separate topic -- I think it would be easier if
we handle criteria for inclusion separately from procedure for removal /
reinstatement.


> Also, and I understand this is most likely taking things way too far, I
> was wondering about requiring the request to be signed by a key which
> itself has a signature from a key in the "strong
> set" (http://pgp.cs.uu.nl/plot/) of PGP keys (implemented by me being
> able to find a path from my key to it). This is just another hurdle
> which serves to ensure that list members are in some sense legitimate.
> (NB I'm not sure I buy this argument, surely there are corrupt types in
> the strong set). This hurdle might be too big in practice? It doesn't
> seem so to me but then I hang around with a lot of Debian types ;-)
>

Well that might work for open-source providers, but would it work for say,
Rackspace, Linode, Amazon?  Huawei?  Or another company like Citrix, whose
product team isn't heavily involved in open-source community things?

It might be sensible to say that such a signature would be considered in
the application process -- that would allow small groups that are very
active in the OSS community to balance out large companies that can spend a
lot on marketing &c to make themselves known.

 -George

--047d7b6766dc53cf8e04cf78ddad
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Mon, Nov 19, 2012 at 5:42 PM, Ian Campbell <span dir=3D"ltr">&lt;<a href=
=3D"mailto:Ian.Campbell@citrix.com" target=3D"_blank">Ian.Campbell@citrix.c=
om</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_=
quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">&gt; + =A0 =A0&lt;p&gt;Here as a rule of thu=
mb, &quot;public hosting provider&quot; means<br><div><div class=3D"h5">
&gt; + =A0 =A0&quot;selling virtualization services to the general public&q=
uot;;<br>
&gt; + =A0 =A0&quot;large-scale&quot; and &quot;widely deployed&quot; means=
 an installed base of<br>
&gt; + =A0 =A0300,000 or more Xen guests. =A0Other well-established organis=
ations<br>
&gt; + =A0 =A0with a mature security response process will be considered on=
 a<br>
&gt; + =A0 =A0case-by-case basis.&lt;/p&gt;<br>
<br>
</div></div>I agree with Ian that relaxing this for software vendors also s=
eems the<br>
correct thing to do.<br></blockquote><div><br>If we&#39;re going to include=
 software vendors, we need some simple criteria to define what a &quot;real=
&quot; software vendor is.=A0 The idea of asking for a link from cloud prov=
iders pointing to public rates and a security policy, which Ian Jackson pro=
ffered, was a good one.=A0 I suppose we could do something similar for soft=
ware providers: a link to a web page with either download-able install imag=
es, or prices, perhaps?<br>
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex">
<div class=3D"im"><br>
&gt; + =A0 =A0 &lt;li&gt;A web page with your security policy statement&lt;=
/li&gt;<br>
&gt; + =A0 =A0 &lt;li&gt;If you are a public hosting provider, a web page w=
ith your public rates&lt;/li&gt;<br>
<br>
</div>For the last two &quot;a link to ...&quot;. Seems obvious but some pe=
ople are very<br>
literal ;-)<br></blockquote><div><br>Ack.<br>=A0</div><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex">
I think it would be good to also include something like:<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &lt;li&gt;A statement to the effect that yo=
u have read this<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 policy and agree to abide by the terms for =
inclusion in<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 the list, specifically the requirements to =
regarding<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 confidentiality during an embargo period&lt=
;/li&gt;<br>
<br>
Or something like that.<br></blockquote><div><br>Ack.<br>=A0</div><blockquo=
te class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc so=
lid;padding-left:1ex">
I wonder if we shouldn&#39;t also include under the list of &quot;pre-discl=
osure<br>
list members should not make available,&quot; include &quot;Failure to adhe=
re to<br>
this will be grounds for removal from the list&quot;.<br>
<br>
I suppose then we need an appeals process though. How about<br>
&quot;Reinstatement will require a post to the xen-devel mailing list<br>
explaining the procedures which have been put in place to prevent any<br>
further breach of confidentiality&quot; + a three strikes rule (any org who=
<br>
managed so mess this up three times isn&#39;t likely to stay in business<br=
>
long enough to require an appeals process against that ;-)).<br></blockquot=
e><div><br>I think this is a slightly separate topic -- I think it would be=
 easier if we handle criteria for inclusion separately from procedure for r=
emoval / reinstatement.<br>
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex">
Also, and I understand this is most likely taking things way too far, I<br>
was wondering about requiring the request to be signed by a key which<br>
itself has a signature from a key in the &quot;strong<br>
set&quot; (<a href=3D"http://pgp.cs.uu.nl/plot/" target=3D"_blank">http://p=
gp.cs.uu.nl/plot/</a>) of PGP keys (implemented by me being<br>
able to find a path from my key to it). This is just another hurdle<br>
which serves to ensure that list members are in some sense legitimate.<br>
(NB I&#39;m not sure I buy this argument, surely there are corrupt types in=
<br>
the strong set). This hurdle might be too big in practice? It doesn&#39;t<b=
r>
seem so to me but then I hang around with a lot of Debian types ;-)<br></bl=
ockquote><div><br>Well that might work for open-source providers, but would=
 it work for say, Rackspace, Linode, Amazon?=A0 Huawei?=A0 Or another compa=
ny like Citrix, whose product team isn&#39;t heavily involved in open-sourc=
e community things?<br>
<br>It might be sensible to say that such a signature would be considered i=
n the application process -- that would allow small groups that are very ac=
tive in the OSS community to balance out large companies that can spend a l=
ot on marketing &amp;c to make themselves known.<br>
=A0</div></div>=A0-George<br></div>

--047d7b6766dc53cf8e04cf78ddad--


--===============8399410163204298870==
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.xen.org
http://lists.xen.org/xen-devel

--===============8399410163204298870==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 12:11:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 12:11:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdK0X-0005Jm-BS; Tue, 27 Nov 2012 12:11:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TdK0W-0005Je-5o
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 12:11:20 +0000
Received: from [85.158.139.83:63569] by server-13.bemta-5.messagelabs.com id
	A9/F9-27809-7EDA4B05; Tue, 27 Nov 2012 12:11:19 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1354018277!32159657!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29416 invoked from network); 27 Nov 2012 12:11:18 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 12:11:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215581507"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 12:11:16 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 07:11:16 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TdK0S-0005JE-7m;
	Tue, 27 Nov 2012 12:11:16 +0000
Date: Tue, 27 Nov 2012 12:11:13 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1353696510.29837.19.camel@dagon.hellion.org.uk>
Message-ID: <alpine.DEB.2.02.1211271208420.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231715130.13749@kaball.uk.xensource.com>
	<1353696510.29837.19.camel@dagon.hellion.org.uk>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH v2] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 23 Nov 2012, Ian Campbell wrote:
> On Fri, 2012-11-23 at 18:04 +0000, Stefano Stabellini wrote:
> > The zImage format is extremely simple: it only consists of a magic
> > number and 2 addresses in a specific position (see
> > http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
> > 
> > Some bootloaders expect a zImage; considering that it doesn't cost us
> > much to build Xen compatible with the format, make it so.
> > 
> > Changes in v2:
> > - code style;
> > - pass 0 a start address.
> > 
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > 
> > diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> > index 25c4cfe..347ddcf 100644
> > --- a/xen/arch/arm/head.S
> > +++ b/xen/arch/arm/head.S
> > @@ -22,6 +22,8 @@
> >  #include <asm/processor-ca15.h>
> >  #include <asm/asm_defns.h>
> >  
> > +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> > +
> >  #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
> >  #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
> >  #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
> > @@ -52,6 +54,18 @@
> >  	 * or the initial pagetable code below will need adjustment. */
> >  	.global start
> >  start:
> > +
> > +	/* zImage magic header, see:
> > +	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
> > +	 */
> > +	.skip 0x20
> 
> This was better as the explicit repeated nops, as it stands it's not at
> all clear that you can start executing at start. It might even rely on
> the specific assemblers behaviour?
>
> Also this wasn't what Tim suggested, which was branch then skip, not
> skip then branch. I think the nops are better for consistency with Linux
> though.

You are right. Thinking twice about it, I would rather keep the code as
it was originally, for consistency with Linux.


> 
> > +	b     past_zImage
> > +	.word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
> > +	.word 0x00000000             /* absolute load/run zImage address or
> > +	                              * 0 for PiC */
> > +	.word _end                   /* zImage end address */
> 
> This needs to be "_end - _start".

Yep.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 12:11:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 12:11:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdK0X-0005Jm-BS; Tue, 27 Nov 2012 12:11:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TdK0W-0005Je-5o
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 12:11:20 +0000
Received: from [85.158.139.83:63569] by server-13.bemta-5.messagelabs.com id
	A9/F9-27809-7EDA4B05; Tue, 27 Nov 2012 12:11:19 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1354018277!32159657!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29416 invoked from network); 27 Nov 2012 12:11:18 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 12:11:18 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215581507"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 12:11:16 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 07:11:16 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TdK0S-0005JE-7m;
	Tue, 27 Nov 2012 12:11:16 +0000
Date: Tue, 27 Nov 2012 12:11:13 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1353696510.29837.19.camel@dagon.hellion.org.uk>
Message-ID: <alpine.DEB.2.02.1211271208420.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231715130.13749@kaball.uk.xensource.com>
	<1353696510.29837.19.camel@dagon.hellion.org.uk>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Tim
	\(Xen.org\)" <tim@xen.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH v2] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 23 Nov 2012, Ian Campbell wrote:
> On Fri, 2012-11-23 at 18:04 +0000, Stefano Stabellini wrote:
> > The zImage format is extremely simple: it only consists of a magic
> > number and 2 addresses in a specific position (see
> > http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
> > 
> > Some bootloaders expect a zImage; considering that it doesn't cost us
> > much to build Xen compatible with the format, make it so.
> > 
> > Changes in v2:
> > - code style;
> > - pass 0 a start address.
> > 
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > 
> > diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> > index 25c4cfe..347ddcf 100644
> > --- a/xen/arch/arm/head.S
> > +++ b/xen/arch/arm/head.S
> > @@ -22,6 +22,8 @@
> >  #include <asm/processor-ca15.h>
> >  #include <asm/asm_defns.h>
> >  
> > +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> > +
> >  #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
> >  #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
> >  #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
> > @@ -52,6 +54,18 @@
> >  	 * or the initial pagetable code below will need adjustment. */
> >  	.global start
> >  start:
> > +
> > +	/* zImage magic header, see:
> > +	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
> > +	 */
> > +	.skip 0x20
> 
> This was better as the explicit repeated nops, as it stands it's not at
> all clear that you can start executing at start. It might even rely on
> the specific assemblers behaviour?
>
> Also this wasn't what Tim suggested, which was branch then skip, not
> skip then branch. I think the nops are better for consistency with Linux
> though.

You are right. Thinking twice about it, I would rather keep the code as
it was originally, for consistency with Linux.


> 
> > +	b     past_zImage
> > +	.word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
> > +	.word 0x00000000             /* absolute load/run zImage address or
> > +	                              * 0 for PiC */
> > +	.word _end                   /* zImage end address */
> 
> This needs to be "_end - _start".

Yep.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 12:16:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 12:16:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdK4t-0005VF-8J; Tue, 27 Nov 2012 12:15:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TdK4s-0005V5-96
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 12:15:50 +0000
Received: from [85.158.143.99:10782] by server-3.bemta-4.messagelabs.com id
	F0/B3-06841-5FEA4B05; Tue, 27 Nov 2012 12:15:49 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1354018546!26232338!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29402 invoked from network); 27 Nov 2012 12:15:48 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 12:15:48 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215582109"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 12:15:45 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 07:15:45 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TdK4d-0005Ms-Ri;
	Tue, 27 Nov 2012 12:15:35 +0000
Date: Tue, 27 Nov 2012 12:15:33 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Message-ID: <alpine.DEB.2.02.1211271212010.5310@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>, "Tim \(Xen.org\)" <tim@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH v3] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The zImage format is extremely simple: it only consists of a magic
number and 2 addresses in a specific position (see
http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).

Some bootloaders expect a zImage; considering that it doesn't cost us
much to build Xen compatible with the format, make it so.

Changes in v3:
- pass the correct size;
- go back to the original no-ops plus branch for consistency with Linux.

Changes in v2:
- code style;
- pass 0 a start address.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 25c4cfe..a78363b 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -22,6 +22,8 @@
 #include <asm/processor-ca15.h>
 #include <asm/asm_defns.h>
 
+#define ZIMAGE_MAGIC_NUMBER 0x016f2818
+
 #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
 #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
 #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
@@ -52,6 +54,22 @@
 	 * or the initial pagetable code below will need adjustment. */
 	.global start
 start:
+
+	/* zImage magic header, see:
+	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
+	 */
+	.rept 7
+	mov   r0, r0
+	.endr
+	mov   r0, r0
+	b     past_zImage
+
+	.word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
+	.word 0x00000000             /* absolute load/run zImage address or
+	                              * 0 for PiC */
+	.word (_end - _start)        /* zImage end address */
+
+past_zImage:
 	cpsid aif                    /* Disable all interrupts */
 
 	/* Save the bootloader arguments in less-clobberable registers */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 12:16:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 12:16:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdK4t-0005VF-8J; Tue, 27 Nov 2012 12:15:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TdK4s-0005V5-96
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 12:15:50 +0000
Received: from [85.158.143.99:10782] by server-3.bemta-4.messagelabs.com id
	F0/B3-06841-5FEA4B05; Tue, 27 Nov 2012 12:15:49 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1354018546!26232338!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29402 invoked from network); 27 Nov 2012 12:15:48 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 12:15:48 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215582109"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 12:15:45 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 07:15:45 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TdK4d-0005Ms-Ri;
	Tue, 27 Nov 2012 12:15:35 +0000
Date: Tue, 27 Nov 2012 12:15:33 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Message-ID: <alpine.DEB.2.02.1211271212010.5310@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>, "Tim \(Xen.org\)" <tim@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH v3] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The zImage format is extremely simple: it only consists of a magic
number and 2 addresses in a specific position (see
http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).

Some bootloaders expect a zImage; considering that it doesn't cost us
much to build Xen compatible with the format, make it so.

Changes in v3:
- pass the correct size;
- go back to the original no-ops plus branch for consistency with Linux.

Changes in v2:
- code style;
- pass 0 a start address.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 25c4cfe..a78363b 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -22,6 +22,8 @@
 #include <asm/processor-ca15.h>
 #include <asm/asm_defns.h>
 
+#define ZIMAGE_MAGIC_NUMBER 0x016f2818
+
 #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
 #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
 #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
@@ -52,6 +54,22 @@
 	 * or the initial pagetable code below will need adjustment. */
 	.global start
 start:
+
+	/* zImage magic header, see:
+	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
+	 */
+	.rept 7
+	mov   r0, r0
+	.endr
+	mov   r0, r0
+	b     past_zImage
+
+	.word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
+	.word 0x00000000             /* absolute load/run zImage address or
+	                              * 0 for PiC */
+	.word (_end - _start)        /* zImage end address */
+
+past_zImage:
 	cpsid aif                    /* Disable all interrupts */
 
 	/* Save the bootloader arguments in less-clobberable registers */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 12:42:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 12:42:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdKUr-0005sc-R8; Tue, 27 Nov 2012 12:42:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TdKUq-0005sX-Jo
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 12:42:40 +0000
Received: from [85.158.143.35:57439] by server-1.bemta-4.messagelabs.com id
	4E/92-27934-F35B4B05; Tue, 27 Nov 2012 12:42:39 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1354020125!11247332!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ3Mzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27892 invoked from network); 27 Nov 2012 12:42:06 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-11.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 12:42:06 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="45728211"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 12:42:04 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 07:42:04 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TdKUG-0005ja-8E;
	Tue, 27 Nov 2012 12:42:04 +0000
Date: Tue, 27 Nov 2012 12:42:01 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
In-Reply-To: <alpine.DEB.2.02.1211271212010.5310@kaball.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211271240250.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211271212010.5310@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"Tim \(Xen.org\)" <tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH v3] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 27 Nov 2012, Stefano Stabellini wrote:
> +	.word (_end - _start)        /* zImage end address */

Actually the assembler has problems digesting this expression.
This patch actually compiles:

---

xen/arm: build as zImage

The zImage format is extremely simple: it only consists of a magic
number and 2 addresses in a specific position (see
http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).

Some bootloaders expect a zImage; considering that it doesn't cost us
much to build Xen compatible with the format, make it so.

Changes in v3:
- pass the correct size;
- go back to the original no-ops plus branch for consistency with Linux.

Changes in v2:
- code style;
- pass 0 a start address.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 25c4cfe..6cb5d1b 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -22,6 +22,8 @@
 #include <asm/processor-ca15.h>
 #include <asm/asm_defns.h>
 
+#define ZIMAGE_MAGIC_NUMBER 0x016f2818
+
 #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
 #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
 #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
@@ -52,6 +54,22 @@
 	 * or the initial pagetable code below will need adjustment. */
 	.global start
 start:
+
+	/* zImage magic header, see:
+	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
+	 */
+	.rept 7
+	mov   r0, r0
+	.endr
+	mov   r0, r0
+	b     past_zImage
+
+	.word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
+	.word 0x00000000             /* absolute load/run zImage address or
+	                              * 0 for PiC */
+	.word (_end - start)         /* zImage end address */
+
+past_zImage:
 	cpsid aif                    /* Disable all interrupts */
 
 	/* Save the bootloader arguments in less-clobberable registers */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 12:42:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 12:42:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdKUr-0005sc-R8; Tue, 27 Nov 2012 12:42:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TdKUq-0005sX-Jo
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 12:42:40 +0000
Received: from [85.158.143.35:57439] by server-1.bemta-4.messagelabs.com id
	4E/92-27934-F35B4B05; Tue, 27 Nov 2012 12:42:39 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1354020125!11247332!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ3Mzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27892 invoked from network); 27 Nov 2012 12:42:06 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-11.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 12:42:06 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="45728211"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 12:42:04 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 07:42:04 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TdKUG-0005ja-8E;
	Tue, 27 Nov 2012 12:42:04 +0000
Date: Tue, 27 Nov 2012 12:42:01 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
In-Reply-To: <alpine.DEB.2.02.1211271212010.5310@kaball.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211271240250.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211271212010.5310@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"Tim \(Xen.org\)" <tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH v3] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 27 Nov 2012, Stefano Stabellini wrote:
> +	.word (_end - _start)        /* zImage end address */

Actually the assembler has problems digesting this expression.
This patch actually compiles:

---

xen/arm: build as zImage

The zImage format is extremely simple: it only consists of a magic
number and 2 addresses in a specific position (see
http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).

Some bootloaders expect a zImage; considering that it doesn't cost us
much to build Xen compatible with the format, make it so.

Changes in v3:
- pass the correct size;
- go back to the original no-ops plus branch for consistency with Linux.

Changes in v2:
- code style;
- pass 0 a start address.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 25c4cfe..6cb5d1b 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -22,6 +22,8 @@
 #include <asm/processor-ca15.h>
 #include <asm/asm_defns.h>
 
+#define ZIMAGE_MAGIC_NUMBER 0x016f2818
+
 #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
 #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
 #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
@@ -52,6 +54,22 @@
 	 * or the initial pagetable code below will need adjustment. */
 	.global start
 start:
+
+	/* zImage magic header, see:
+	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
+	 */
+	.rept 7
+	mov   r0, r0
+	.endr
+	mov   r0, r0
+	b     past_zImage
+
+	.word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
+	.word 0x00000000             /* absolute load/run zImage address or
+	                              * 0 for PiC */
+	.word (_end - start)         /* zImage end address */
+
+past_zImage:
 	cpsid aif                    /* Disable all interrupts */
 
 	/* Save the bootloader arguments in less-clobberable registers */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 13:04:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 13:04:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdKpG-000672-S9; Tue, 27 Nov 2012 13:03:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdKpF-00066x-3P
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 13:03:45 +0000
Received: from [85.158.138.51:42716] by server-9.bemta-3.messagelabs.com id
	9B/08-02388-03AB4B05; Tue, 27 Nov 2012 13:03:44 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1354021423!22787962!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29888 invoked from network); 27 Nov 2012 13:03:43 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 13:03:43 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 13:03:43 +0000
Message-Id: <50B4C87402000078000ABA9F@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 13:04:36 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dietmar Hahn" <dietmar.hahn@ts.fujitsu.com>
References: <1449364.BXBucXMpuY@amur>
In-Reply-To: <1449364.BXBucXMpuY@amur>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] oprofile: Add X7542 and E7-8837 to the list
 of supported cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 13:52, Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> wrote:
> Add intel cpus X7542 and E7-8837 to the list of supported cpus.
> 
> Thanks.
> Dietmar.
> 
> Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
> 
> diff -r 0049de3827bc -r 6fb0129600cd xen/arch/x86/oprofile/nmi_int.c
> --- a/xen/arch/x86/oprofile/nmi_int.c   Fri Nov 23 11:06:15 2012 +0000
> +++ b/xen/arch/x86/oprofile/nmi_int.c   Mon Nov 26 13:36:00 2012 +0100
> @@ -366,6 +366,8 @@ static int __init ppro_init(char ** cpu_
>                 ppro_has_global_ctrl = 1;
>                 break;
>         case 26:
> +       case 46:
> +       case 47:
>                 arch_perfmon_setup_counters();
>                 *cpu_type = "i386/core_i7";
>                 ppro_has_global_ctrl = 1;

Actually, and apart from the patch being white space damaged,
after a closer look I think this is wrong - these newer CPUs
shouldn't get be handled here, but instead should be covered by
arch_perfmon_init(). Are you observing X86_FEATURE_ARCH_PERFMON
not getting set on these CPUs by init_intel()?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 13:04:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 13:04:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdKpG-000672-S9; Tue, 27 Nov 2012 13:03:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdKpF-00066x-3P
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 13:03:45 +0000
Received: from [85.158.138.51:42716] by server-9.bemta-3.messagelabs.com id
	9B/08-02388-03AB4B05; Tue, 27 Nov 2012 13:03:44 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1354021423!22787962!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29888 invoked from network); 27 Nov 2012 13:03:43 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 13:03:43 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 13:03:43 +0000
Message-Id: <50B4C87402000078000ABA9F@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 13:04:36 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dietmar Hahn" <dietmar.hahn@ts.fujitsu.com>
References: <1449364.BXBucXMpuY@amur>
In-Reply-To: <1449364.BXBucXMpuY@amur>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] oprofile: Add X7542 and E7-8837 to the list
 of supported cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 13:52, Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> wrote:
> Add intel cpus X7542 and E7-8837 to the list of supported cpus.
> 
> Thanks.
> Dietmar.
> 
> Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
> 
> diff -r 0049de3827bc -r 6fb0129600cd xen/arch/x86/oprofile/nmi_int.c
> --- a/xen/arch/x86/oprofile/nmi_int.c   Fri Nov 23 11:06:15 2012 +0000
> +++ b/xen/arch/x86/oprofile/nmi_int.c   Mon Nov 26 13:36:00 2012 +0100
> @@ -366,6 +366,8 @@ static int __init ppro_init(char ** cpu_
>                 ppro_has_global_ctrl = 1;
>                 break;
>         case 26:
> +       case 46:
> +       case 47:
>                 arch_perfmon_setup_counters();
>                 *cpu_type = "i386/core_i7";
>                 ppro_has_global_ctrl = 1;

Actually, and apart from the patch being white space damaged,
after a closer look I think this is wrong - these newer CPUs
shouldn't get be handled here, but instead should be covered by
arch_perfmon_init(). Are you observing X86_FEATURE_ARCH_PERFMON
not getting set on these CPUs by init_intel()?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 13:19:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 13:19:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdL3j-0006Hl-Hz; Tue, 27 Nov 2012 13:18:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdL3i-0006Hg-TN
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 13:18:43 +0000
Received: from [85.158.139.211:10213] by server-1.bemta-5.messagelabs.com id
	BB/FB-09311-2BDB4B05; Tue, 27 Nov 2012 13:18:42 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1354022321!18026425!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13660 invoked from network); 27 Nov 2012 13:18:41 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 13:18:41 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 13:18:40 +0000
Message-Id: <50B4CBF602000078000ABABB@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 13:19:34 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dietmar Hahn" <dietmar.hahn@ts.fujitsu.com>
References: <1449364.BXBucXMpuY@amur>
	<50B4C87402000078000ABA9F@nat28.tlf.novell.com>
In-Reply-To: <50B4C87402000078000ABA9F@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Jun Nakajima <jun.nakajima@intel.com>,
	Donald D Dugger <donald.d.dugger@intel.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] oprofile: Add X7542 and E7-8837 to the list
 of supported cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 27.11.12 at 14:04, "Jan Beulich" <JBeulich@suse.com> wrote:
>>>> On 26.11.12 at 13:52, Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> wrote:
>> Add intel cpus X7542 and E7-8837 to the list of supported cpus.
>> 
>> Thanks.
>> Dietmar.
>> 
>> Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
>> 
>> diff -r 0049de3827bc -r 6fb0129600cd xen/arch/x86/oprofile/nmi_int.c
>> --- a/xen/arch/x86/oprofile/nmi_int.c   Fri Nov 23 11:06:15 2012 +0000
>> +++ b/xen/arch/x86/oprofile/nmi_int.c   Mon Nov 26 13:36:00 2012 +0100
>> @@ -366,6 +366,8 @@ static int __init ppro_init(char ** cpu_
>>                 ppro_has_global_ctrl = 1;
>>                 break;
>>         case 26:
>> +       case 46:
>> +       case 47:
>>                 arch_perfmon_setup_counters();
>>                 *cpu_type = "i386/core_i7";
>>                 ppro_has_global_ctrl = 1;
> 
> Actually, and apart from the patch being white space damaged,
> after a closer look I think this is wrong - these newer CPUs
> shouldn't get be handled here, but instead should be covered by
> arch_perfmon_init(). Are you observing X86_FEATURE_ARCH_PERFMON
> not getting set on these CPUs by init_intel()?

I.e. the below would be the patch I'd expect when merely
taking the SDM as reference (with the "todo remove?" ones
also fully removed of course).

Jan

--- a/xen/arch/x86/oprofile/nmi_int.c
+++ b/xen/arch/x86/oprofile/nmi_int.c
@@ -342,30 +342,22 @@ static int __init ppro_init(char ** cpu_
 		return 0;
 
 	switch (cpu_model) {
-	case 0 ... 2:
-		*cpu_type = "i386/ppro";
-		break;
-	case 3 ... 5:
-		*cpu_type = "i386/pii";
-		break;
-	case 6 ... 8:
-	case 10 ... 11:
-		*cpu_type = "i386/piii";
-		break;
-	case 9:
-	case 13:
-		*cpu_type = "i386/p6_mobile";
-		break;
 	case 14:
 		*cpu_type = "i386/core";
 		break;
 	case 15:
+#if 0//todo remove?
 	case 23:
 	case 29:
+#endif//todo
 		*cpu_type = "i386/core_2";
 		ppro_has_global_ctrl = 1;
 		break;
-	case 26:
+#if 0//todo remove?
+	/* Nehalem */
+	case 26: case 30: case 31: case 46:
+	/ Westmere */
+	case 37: case 44: case 47:
 		arch_perfmon_setup_counters();
 		*cpu_type = "i386/core_i7";
 		ppro_has_global_ctrl = 1;
@@ -373,6 +365,7 @@ static int __init ppro_init(char ** cpu_
 	case 28:
 		*cpu_type = "i386/atom";
 		break;
+#endif//todo
 	default:
 		/* Unknown */
 		return 0;
@@ -389,6 +382,7 @@ static int __init arch_perfmon_init(char
 	*cpu_type = "i386/arch_perfmon";
 	model = &op_arch_perfmon_spec;
 	arch_perfmon_setup_counters();
+	ppro_has_global_ctrl = 1;
 	return 1;
 }
 
@@ -413,14 +407,8 @@ static int __init nmi_init(void)
 				       "AMD processor family %d is not "
 				       "supported\n", family);
 				return -ENODEV;
-			case 6:
-				model = &op_athlon_spec;
-				cpu_type = "i386/athlon";
-				break;
 			case 0xf:
 				model = &op_athlon_spec;
-				/* Actually it could be i386/hammer too, but
-				   give user space an consistent name. */
 				cpu_type = "x86-64/hammer";
 				break;
 			case 0x10:



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 13:19:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 13:19:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdL3j-0006Hl-Hz; Tue, 27 Nov 2012 13:18:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdL3i-0006Hg-TN
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 13:18:43 +0000
Received: from [85.158.139.211:10213] by server-1.bemta-5.messagelabs.com id
	BB/FB-09311-2BDB4B05; Tue, 27 Nov 2012 13:18:42 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1354022321!18026425!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13660 invoked from network); 27 Nov 2012 13:18:41 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 13:18:41 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 13:18:40 +0000
Message-Id: <50B4CBF602000078000ABABB@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 13:19:34 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dietmar Hahn" <dietmar.hahn@ts.fujitsu.com>
References: <1449364.BXBucXMpuY@amur>
	<50B4C87402000078000ABA9F@nat28.tlf.novell.com>
In-Reply-To: <50B4C87402000078000ABA9F@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Jun Nakajima <jun.nakajima@intel.com>,
	Donald D Dugger <donald.d.dugger@intel.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] oprofile: Add X7542 and E7-8837 to the list
 of supported cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 27.11.12 at 14:04, "Jan Beulich" <JBeulich@suse.com> wrote:
>>>> On 26.11.12 at 13:52, Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> wrote:
>> Add intel cpus X7542 and E7-8837 to the list of supported cpus.
>> 
>> Thanks.
>> Dietmar.
>> 
>> Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
>> 
>> diff -r 0049de3827bc -r 6fb0129600cd xen/arch/x86/oprofile/nmi_int.c
>> --- a/xen/arch/x86/oprofile/nmi_int.c   Fri Nov 23 11:06:15 2012 +0000
>> +++ b/xen/arch/x86/oprofile/nmi_int.c   Mon Nov 26 13:36:00 2012 +0100
>> @@ -366,6 +366,8 @@ static int __init ppro_init(char ** cpu_
>>                 ppro_has_global_ctrl = 1;
>>                 break;
>>         case 26:
>> +       case 46:
>> +       case 47:
>>                 arch_perfmon_setup_counters();
>>                 *cpu_type = "i386/core_i7";
>>                 ppro_has_global_ctrl = 1;
> 
> Actually, and apart from the patch being white space damaged,
> after a closer look I think this is wrong - these newer CPUs
> shouldn't get be handled here, but instead should be covered by
> arch_perfmon_init(). Are you observing X86_FEATURE_ARCH_PERFMON
> not getting set on these CPUs by init_intel()?

I.e. the below would be the patch I'd expect when merely
taking the SDM as reference (with the "todo remove?" ones
also fully removed of course).

Jan

--- a/xen/arch/x86/oprofile/nmi_int.c
+++ b/xen/arch/x86/oprofile/nmi_int.c
@@ -342,30 +342,22 @@ static int __init ppro_init(char ** cpu_
 		return 0;
 
 	switch (cpu_model) {
-	case 0 ... 2:
-		*cpu_type = "i386/ppro";
-		break;
-	case 3 ... 5:
-		*cpu_type = "i386/pii";
-		break;
-	case 6 ... 8:
-	case 10 ... 11:
-		*cpu_type = "i386/piii";
-		break;
-	case 9:
-	case 13:
-		*cpu_type = "i386/p6_mobile";
-		break;
 	case 14:
 		*cpu_type = "i386/core";
 		break;
 	case 15:
+#if 0//todo remove?
 	case 23:
 	case 29:
+#endif//todo
 		*cpu_type = "i386/core_2";
 		ppro_has_global_ctrl = 1;
 		break;
-	case 26:
+#if 0//todo remove?
+	/* Nehalem */
+	case 26: case 30: case 31: case 46:
+	/ Westmere */
+	case 37: case 44: case 47:
 		arch_perfmon_setup_counters();
 		*cpu_type = "i386/core_i7";
 		ppro_has_global_ctrl = 1;
@@ -373,6 +365,7 @@ static int __init ppro_init(char ** cpu_
 	case 28:
 		*cpu_type = "i386/atom";
 		break;
+#endif//todo
 	default:
 		/* Unknown */
 		return 0;
@@ -389,6 +382,7 @@ static int __init arch_perfmon_init(char
 	*cpu_type = "i386/arch_perfmon";
 	model = &op_arch_perfmon_spec;
 	arch_perfmon_setup_counters();
+	ppro_has_global_ctrl = 1;
 	return 1;
 }
 
@@ -413,14 +407,8 @@ static int __init nmi_init(void)
 				       "AMD processor family %d is not "
 				       "supported\n", family);
 				return -ENODEV;
-			case 6:
-				model = &op_athlon_spec;
-				cpu_type = "i386/athlon";
-				break;
 			case 0xf:
 				model = &op_athlon_spec;
-				/* Actually it could be i386/hammer too, but
-				   give user space an consistent name. */
 				cpu_type = "x86-64/hammer";
 				break;
 			case 0x10:



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 13:35:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 13:35:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLJL-0006Sd-1R; Tue, 27 Nov 2012 13:34:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>) id 1TdLJJ-0006SY-K6
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 13:34:49 +0000
Received: from [85.158.137.99:16538] by server-14.bemta-3.messagelabs.com id
	C8/72-31424-871C4B05; Tue, 27 Nov 2012 13:34:48 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354023287!20702981!1
X-Originating-IP: [209.85.215.45]
X-SpamReason: No, hits=3.0 required=7.0 tests=HTML_30_40,
	HTML_IMAGE_ONLY_08,HTML_MESSAGE,ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15707 invoked from network); 27 Nov 2012 13:34:48 -0000
Received: from mail-la0-f45.google.com (HELO mail-la0-f45.google.com)
	(209.85.215.45)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 13:34:48 -0000
Received: by mail-la0-f45.google.com with SMTP id p9so9163232laa.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 05:34:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=QhzJ3ku22wEE0Ewt4JnXNQPJU6Ul68wnxolZCHvxcEU=;
	b=bVO5+IOCfFixvZ6fzYsnI2vYMfFS4I+hH+K6ZQGcG+e5H3LFkwIaWJ0mAt5UXFqf7k
	bYuSCHSQwH3VM4LpUv6M6FjH0NtldwESS8IohMjmrd0LfrymuNYR0ev4D9plskQrN0+w
	9YD0h+PtNiWQqVXbRdJJ1kEQXN0dPG+GJFSeszza9DxB2hI/JOUv8su9XBAWeszfxCYm
	DZXMkb3sTNSnQWzsyeBuiPdVFJO2kRGWsLSmi6liMK6svF63ByLiBh/bf5lv6y0/ZVpo
	/Q4yOwKkwpW3OhF7MNcOhOR9oUI8IdXtZ22IfcrDndvtl2nqTsArcBAJLXMQiimfh9m5
	11nw==
MIME-Version: 1.0
Received: by 10.112.24.170 with SMTP id v10mr6515303lbf.88.1354023287089; Tue,
	27 Nov 2012 05:34:47 -0800 (PST)
Received: by 10.112.135.7 with HTTP; Tue, 27 Nov 2012 05:34:47 -0800 (PST)
In-Reply-To: <1354014194.5830.191.camel@zakaz.uk.xensource.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<50B3A8DA02000078000AB460@nat28.tlf.novell.com>
	<1353948353.5830.116.camel@zakaz.uk.xensource.com>
	<50B3ADD602000078000AB518@nat28.tlf.novell.com>
	<1354014194.5830.191.camel@zakaz.uk.xensource.com>
Date: Tue, 27 Nov 2012 13:34:47 +0000
Message-ID: <CAOqnZH4f-=9K7B07M6xYuf3dCWMfkBEVYBsusV1We5vkwuzQgA@mail.gmail.com>
From: Lars Kurth <lars.kurth.xen@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2740537705542242465=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============2740537705542242465==
Content-Type: multipart/alternative; boundary=e0cb4efe2ee80b6a3e04cf7a1d45

--e0cb4efe2ee80b6a3e04cf7a1d45
Content-Type: text/plain; charset=ISO-8859-1

> No problem. Do you have any preference for formatting or want me to put
> this anywhere in particular or will you just take the text and run with
> it?

Let's put it on the wiki say under "Xen Maintenance Releases". I lost track
a little of the changes (but then I am side-tracked with the XCP release),
so why don't you put it on the wiki for now. I can handle the formatting
and link to the page from xen.org

--e0cb4efe2ee80b6a3e04cf7a1d45
Content-Type: text/html; charset=ISO-8859-1

<div class="ajy"><br><img class="ajz" id=":108" tabindex="0" src="https://mail.google.com/mail/u/0/images/cleardot.gif" alt=""></div><div class="im">&gt; No problem. Do you have any preference for formatting or want me to put<br>

&gt; this anywhere in particular or will you just take the text and run with<br>
&gt; it?<br></div><br>Let&#39;s put it on the wiki say under &quot;Xen Maintenance 
Releases&quot;. I lost track a little of the changes (but then I am 
side-tracked with the XCP release), so why don&#39;t you put it on the wiki 
for now. I can handle the formatting and link to the page from <a href="http://xen.org" target="_blank">xen.org</a>

--e0cb4efe2ee80b6a3e04cf7a1d45--


--===============2740537705542242465==
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.xen.org
http://lists.xen.org/xen-devel

--===============2740537705542242465==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 13:35:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 13:35:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLJL-0006Sd-1R; Tue, 27 Nov 2012 13:34:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>) id 1TdLJJ-0006SY-K6
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 13:34:49 +0000
Received: from [85.158.137.99:16538] by server-14.bemta-3.messagelabs.com id
	C8/72-31424-871C4B05; Tue, 27 Nov 2012 13:34:48 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354023287!20702981!1
X-Originating-IP: [209.85.215.45]
X-SpamReason: No, hits=3.0 required=7.0 tests=HTML_30_40,
	HTML_IMAGE_ONLY_08,HTML_MESSAGE,ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15707 invoked from network); 27 Nov 2012 13:34:48 -0000
Received: from mail-la0-f45.google.com (HELO mail-la0-f45.google.com)
	(209.85.215.45)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 13:34:48 -0000
Received: by mail-la0-f45.google.com with SMTP id p9so9163232laa.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 05:34:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=QhzJ3ku22wEE0Ewt4JnXNQPJU6Ul68wnxolZCHvxcEU=;
	b=bVO5+IOCfFixvZ6fzYsnI2vYMfFS4I+hH+K6ZQGcG+e5H3LFkwIaWJ0mAt5UXFqf7k
	bYuSCHSQwH3VM4LpUv6M6FjH0NtldwESS8IohMjmrd0LfrymuNYR0ev4D9plskQrN0+w
	9YD0h+PtNiWQqVXbRdJJ1kEQXN0dPG+GJFSeszza9DxB2hI/JOUv8su9XBAWeszfxCYm
	DZXMkb3sTNSnQWzsyeBuiPdVFJO2kRGWsLSmi6liMK6svF63ByLiBh/bf5lv6y0/ZVpo
	/Q4yOwKkwpW3OhF7MNcOhOR9oUI8IdXtZ22IfcrDndvtl2nqTsArcBAJLXMQiimfh9m5
	11nw==
MIME-Version: 1.0
Received: by 10.112.24.170 with SMTP id v10mr6515303lbf.88.1354023287089; Tue,
	27 Nov 2012 05:34:47 -0800 (PST)
Received: by 10.112.135.7 with HTTP; Tue, 27 Nov 2012 05:34:47 -0800 (PST)
In-Reply-To: <1354014194.5830.191.camel@zakaz.uk.xensource.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<50B3A8DA02000078000AB460@nat28.tlf.novell.com>
	<1353948353.5830.116.camel@zakaz.uk.xensource.com>
	<50B3ADD602000078000AB518@nat28.tlf.novell.com>
	<1354014194.5830.191.camel@zakaz.uk.xensource.com>
Date: Tue, 27 Nov 2012 13:34:47 +0000
Message-ID: <CAOqnZH4f-=9K7B07M6xYuf3dCWMfkBEVYBsusV1We5vkwuzQgA@mail.gmail.com>
From: Lars Kurth <lars.kurth.xen@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2740537705542242465=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============2740537705542242465==
Content-Type: multipart/alternative; boundary=e0cb4efe2ee80b6a3e04cf7a1d45

--e0cb4efe2ee80b6a3e04cf7a1d45
Content-Type: text/plain; charset=ISO-8859-1

> No problem. Do you have any preference for formatting or want me to put
> this anywhere in particular or will you just take the text and run with
> it?

Let's put it on the wiki say under "Xen Maintenance Releases". I lost track
a little of the changes (but then I am side-tracked with the XCP release),
so why don't you put it on the wiki for now. I can handle the formatting
and link to the page from xen.org

--e0cb4efe2ee80b6a3e04cf7a1d45
Content-Type: text/html; charset=ISO-8859-1

<div class="ajy"><br><img class="ajz" id=":108" tabindex="0" src="https://mail.google.com/mail/u/0/images/cleardot.gif" alt=""></div><div class="im">&gt; No problem. Do you have any preference for formatting or want me to put<br>

&gt; this anywhere in particular or will you just take the text and run with<br>
&gt; it?<br></div><br>Let&#39;s put it on the wiki say under &quot;Xen Maintenance 
Releases&quot;. I lost track a little of the changes (but then I am 
side-tracked with the XCP release), so why don&#39;t you put it on the wiki 
for now. I can handle the formatting and link to the page from <a href="http://xen.org" target="_blank">xen.org</a>

--e0cb4efe2ee80b6a3e04cf7a1d45--


--===============2740537705542242465==
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.xen.org
http://lists.xen.org/xen-devel

--===============2740537705542242465==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 13:43:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 13:43:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLRL-0006cg-3i; Tue, 27 Nov 2012 13:43:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TdLRJ-0006cb-Sr
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 13:43:06 +0000
Received: from [85.158.138.51:49261] by server-6.bemta-3.messagelabs.com id
	E2/65-28265-963C4B05; Tue, 27 Nov 2012 13:43:05 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-5.tower-174.messagelabs.com!1354023784!31757835!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDQ0NTg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20173 invoked from network); 27 Nov 2012 13:43:04 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-5.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 13:43:04 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id E4E3D2A0C;
	Tue, 27 Nov 2012 15:43:02 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id C0EFEEC027; Tue, 27 Nov 2012 15:43:02 +0200 (EET)
Date: Tue, 27 Nov 2012 15:43:02 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: George Dunlap <dunlapg@umich.edu>
Message-ID: <20121127134302.GB8912@reaktio.net>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B3B215.3020000@citrix.com>
	<CAFLBxZYgnLdT3OE+akGYqg2qvJmcfxb5xx0=U0SHsZiHMErWJw@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CAFLBxZYgnLdT3OE+akGYqg2qvJmcfxb5xx0=U0SHsZiHMErWJw@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	"Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 27, 2012 at 10:51:06AM +0000, George Dunlap wrote:
>    On Mon, Nov 26, 2012 at 6:16 PM, Andrew Cooper
>    <[1]andrew.cooper3@citrix.com> wrote:
> 
>      The idea of secure boot is that only signed/verified code can perform
>      privileged operations.  One can argue as to exactly where this boundary
>      lies, but in the native case, it contains any kernel level code.
>      Userspace uses the kernel API/ABI subject to the permissions checks
>      present and (assuming no security holes), everyone is happy.
> 
>    Different people have different opinions on this.  Fedora are signing all
>    the way down to modules, but not user-space; as a result, IIUC, they are
>    ruling out third-party or out-of-tree drivers.
>

Fedora/Redhat are planning to support custom/out-of-tree drivers by allowing
the user to install trusted custom signing keys, so you can sign the kernel drivers
using those keys.

The process was described for example in Matthew Garrett's UEFI presentation at 
LinuxCon 2012 NA after XenSummit 2012.

Some info:
http://mjg59.dreamwidth.org/16863.html:

"We're planning on using Suse's approach of permitting local key management at the shim level, and I spent some time discussing this with Vojtech last week. In combination with the above, this should provide a workable mechanism for permitting the end-user to install module signing keys."

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 13:43:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 13:43:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLRL-0006cg-3i; Tue, 27 Nov 2012 13:43:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TdLRJ-0006cb-Sr
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 13:43:06 +0000
Received: from [85.158.138.51:49261] by server-6.bemta-3.messagelabs.com id
	E2/65-28265-963C4B05; Tue, 27 Nov 2012 13:43:05 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-5.tower-174.messagelabs.com!1354023784!31757835!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDQ0NTg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20173 invoked from network); 27 Nov 2012 13:43:04 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-5.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 13:43:04 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id E4E3D2A0C;
	Tue, 27 Nov 2012 15:43:02 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id C0EFEEC027; Tue, 27 Nov 2012 15:43:02 +0200 (EET)
Date: Tue, 27 Nov 2012 15:43:02 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: George Dunlap <dunlapg@umich.edu>
Message-ID: <20121127134302.GB8912@reaktio.net>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B3B215.3020000@citrix.com>
	<CAFLBxZYgnLdT3OE+akGYqg2qvJmcfxb5xx0=U0SHsZiHMErWJw@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CAFLBxZYgnLdT3OE+akGYqg2qvJmcfxb5xx0=U0SHsZiHMErWJw@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	"Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 27, 2012 at 10:51:06AM +0000, George Dunlap wrote:
>    On Mon, Nov 26, 2012 at 6:16 PM, Andrew Cooper
>    <[1]andrew.cooper3@citrix.com> wrote:
> 
>      The idea of secure boot is that only signed/verified code can perform
>      privileged operations.  One can argue as to exactly where this boundary
>      lies, but in the native case, it contains any kernel level code.
>      Userspace uses the kernel API/ABI subject to the permissions checks
>      present and (assuming no security holes), everyone is happy.
> 
>    Different people have different opinions on this.  Fedora are signing all
>    the way down to modules, but not user-space; as a result, IIUC, they are
>    ruling out third-party or out-of-tree drivers.
>

Fedora/Redhat are planning to support custom/out-of-tree drivers by allowing
the user to install trusted custom signing keys, so you can sign the kernel drivers
using those keys.

The process was described for example in Matthew Garrett's UEFI presentation at 
LinuxCon 2012 NA after XenSummit 2012.

Some info:
http://mjg59.dreamwidth.org/16863.html:

"We're planning on using Suse's approach of permitting local key management at the shim level, and I spent some time discussing this with Vojtech last week. In combination with the above, this should provide a workable mechanism for permitting the end-user to install module signing keys."

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 13:55:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 13:55:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLck-0006mX-B8; Tue, 27 Nov 2012 13:54:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdLcj-0006mS-Mi
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 13:54:53 +0000
Received: from [85.158.138.51:62032] by server-9.bemta-3.messagelabs.com id
	79/DC-02388-C26C4B05; Tue, 27 Nov 2012 13:54:52 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354024489!25323002!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12455 invoked from network); 27 Nov 2012 13:54:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 13:54:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16024853"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 13:54:49 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 13:54:49 +0000
Message-ID: <1354024488.17985.30.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Date: Tue, 27 Nov 2012 13:54:48 +0000
In-Reply-To: <CAFLBxZYZWtargvXXUDrVNpRKouLgqmPth09qwqxmBFYnuGTGMw@mail.gmail.com>
References: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
	<1353346964.18229.151.camel@zakaz.uk.xensource.com>
	<CAFLBxZYZWtargvXXUDrVNpRKouLgqmPth09qwqxmBFYnuGTGMw@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] Make all public hosting providers
 eligible for the pre-disclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 12:05 +0000, George Dunlap wrote:
> On Mon, Nov 19, 2012 at 5:42 PM, Ian Campbell
> <Ian.Campbell@citrix.com> wrote:

>  
>         I wonder if we shouldn't also include under the list of "pre-disclosure
>         list members should not make available," include "Failure to adhere to
>         this will be grounds for removal from the list".
>         
>         I suppose then we need an appeals process though. How about
>         "Reinstatement will require a post to the xen-devel mailing list
>         explaining the procedures which have been put in place to prevent any
>         further breach of confidentiality" + a three strikes rule (any org who
>         managed so mess this up three times isn't likely to stay in business
>         long enough to require an appeals process against that ;-)).
> 
> I think this is a slightly separate topic -- I think it would be
> easier if we handle criteria for inclusion separately from procedure
> for removal / reinstatement.

OK.
 
>         Also, and I understand this is most likely taking things way too far, I
>         was wondering about requiring the request to be signed by a key which
>         itself has a signature from a key in the "strong
>         set" (http://pgp.cs.uu.nl/plot/) of PGP keys (implemented by me being
>         able to find a path from my key to it). This is just another hurdle
>         which serves to ensure that list members are in some sense legitimate.
>         (NB I'm not sure I buy this argument, surely there are corrupt types in
>         the strong set). This hurdle might be too big in practice? It doesn't
>         seem so to me but then I hang around with a lot of Debian types ;-)
> 
> Well that might work for open-source providers, but would it work for
> say, Rackspace, Linode, Amazon?  Huawei?  Or another company like
> Citrix, whose product team isn't heavily involved in open-source
> community things?

The PGP Web of Trust isn't an OSS thing by any means.

We (security@) have easily had as many encrypted emails from the
commercial parts of various organisations as we have had from "OSS"
people.

> It might be sensible to say that such a signature would be considered
> in the application process -- that would allow small groups that are
> very active in the OSS community to balance out large companies that
> can spend a lot on marketing &c to make themselves known.

Yes, it could certainly be one of several criteria.

>  
>  -George
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 13:55:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 13:55:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLck-0006mX-B8; Tue, 27 Nov 2012 13:54:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdLcj-0006mS-Mi
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 13:54:53 +0000
Received: from [85.158.138.51:62032] by server-9.bemta-3.messagelabs.com id
	79/DC-02388-C26C4B05; Tue, 27 Nov 2012 13:54:52 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354024489!25323002!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12455 invoked from network); 27 Nov 2012 13:54:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 13:54:50 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16024853"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 13:54:49 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 13:54:49 +0000
Message-ID: <1354024488.17985.30.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Date: Tue, 27 Nov 2012 13:54:48 +0000
In-Reply-To: <CAFLBxZYZWtargvXXUDrVNpRKouLgqmPth09qwqxmBFYnuGTGMw@mail.gmail.com>
References: <1352999682-11535-1-git-send-email-george.dunlap@eu.citrix.com>
	<1353346964.18229.151.camel@zakaz.uk.xensource.com>
	<CAFLBxZYZWtargvXXUDrVNpRKouLgqmPth09qwqxmBFYnuGTGMw@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] Make all public hosting providers
 eligible for the pre-disclosure list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 12:05 +0000, George Dunlap wrote:
> On Mon, Nov 19, 2012 at 5:42 PM, Ian Campbell
> <Ian.Campbell@citrix.com> wrote:

>  
>         I wonder if we shouldn't also include under the list of "pre-disclosure
>         list members should not make available," include "Failure to adhere to
>         this will be grounds for removal from the list".
>         
>         I suppose then we need an appeals process though. How about
>         "Reinstatement will require a post to the xen-devel mailing list
>         explaining the procedures which have been put in place to prevent any
>         further breach of confidentiality" + a three strikes rule (any org who
>         managed so mess this up three times isn't likely to stay in business
>         long enough to require an appeals process against that ;-)).
> 
> I think this is a slightly separate topic -- I think it would be
> easier if we handle criteria for inclusion separately from procedure
> for removal / reinstatement.

OK.
 
>         Also, and I understand this is most likely taking things way too far, I
>         was wondering about requiring the request to be signed by a key which
>         itself has a signature from a key in the "strong
>         set" (http://pgp.cs.uu.nl/plot/) of PGP keys (implemented by me being
>         able to find a path from my key to it). This is just another hurdle
>         which serves to ensure that list members are in some sense legitimate.
>         (NB I'm not sure I buy this argument, surely there are corrupt types in
>         the strong set). This hurdle might be too big in practice? It doesn't
>         seem so to me but then I hang around with a lot of Debian types ;-)
> 
> Well that might work for open-source providers, but would it work for
> say, Rackspace, Linode, Amazon?  Huawei?  Or another company like
> Citrix, whose product team isn't heavily involved in open-source
> community things?

The PGP Web of Trust isn't an OSS thing by any means.

We (security@) have easily had as many encrypted emails from the
commercial parts of various organisations as we have had from "OSS"
people.

> It might be sensible to say that such a signature would be considered
> in the application process -- that would allow small groups that are
> very active in the OSS community to balance out large companies that
> can spend a lot on marketing &c to make themselves known.

Yes, it could certainly be one of several criteria.

>  
>  -George
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 13:59:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 13:59:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLgi-0006tO-0X; Tue, 27 Nov 2012 13:59:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TdLgh-0006tI-2w
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 13:58:59 +0000
Received: from [85.158.143.35:43775] by server-1.bemta-4.messagelabs.com id
	5A/0F-27934-227C4B05; Tue, 27 Nov 2012 13:58:58 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354024725!4611227!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3598 invoked from network); 27 Nov 2012 13:58:46 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 13:58:46 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TdLgQ-000EDP-9y; Tue, 27 Nov 2012 13:58:42 +0000
Date: Tue, 27 Nov 2012 13:58:42 +0000
From: Tim Deegan <tim@xen.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121127135842.GA51942@ocelot.phlegethon.org>
References: <alpine.DEB.2.02.1211231715130.13749@kaball.uk.xensource.com>
	<1353696510.29837.19.camel@dagon.hellion.org.uk>
	<alpine.DEB.2.02.1211271208420.5310@kaball.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1211271208420.5310@kaball.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH v2] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 12:11 +0000 on 27 Nov (1354018273), Stefano Stabellini wrote:
> On Fri, 23 Nov 2012, Ian Campbell wrote:
> > On Fri, 2012-11-23 at 18:04 +0000, Stefano Stabellini wrote:
> > > The zImage format is extremely simple: it only consists of a magic
> > > number and 2 addresses in a specific position (see
> > > http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
> > > 
> > > Some bootloaders expect a zImage; considering that it doesn't cost us
> > > much to build Xen compatible with the format, make it so.
> > > 
> > > Changes in v2:
> > > - code style;
> > > - pass 0 a start address.
> > > 
> > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > 
> > > diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> > > index 25c4cfe..347ddcf 100644
> > > --- a/xen/arch/arm/head.S
> > > +++ b/xen/arch/arm/head.S
> > > @@ -22,6 +22,8 @@
> > >  #include <asm/processor-ca15.h>
> > >  #include <asm/asm_defns.h>
> > >  
> > > +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> > > +
> > >  #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
> > >  #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
> > >  #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
> > > @@ -52,6 +54,18 @@
> > >  	 * or the initial pagetable code below will need adjustment. */
> > >  	.global start
> > >  start:
> > > +
> > > +	/* zImage magic header, see:
> > > +	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
> > > +	 */
> > > +	.skip 0x20
> > 
> > This was better as the explicit repeated nops, as it stands it's not at
> > all clear that you can start executing at start. It might even rely on
> > the specific assemblers behaviour?
> >
> > Also this wasn't what Tim suggested, which was branch then skip, not
> > skip then branch. I think the nops are better for consistency with Linux
> > though.
> 
> You are right. Thinking twice about it, I would rather keep the code as
> it was originally, for consistency with Linux.

Does consistency with linux buy us anything (beyond untidy code)?
I very much prefer the other way.  And if we do need to fill with nops,
why 7 repeated and one standalone?

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 13:59:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 13:59:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLgi-0006tO-0X; Tue, 27 Nov 2012 13:59:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TdLgh-0006tI-2w
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 13:58:59 +0000
Received: from [85.158.143.35:43775] by server-1.bemta-4.messagelabs.com id
	5A/0F-27934-227C4B05; Tue, 27 Nov 2012 13:58:58 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354024725!4611227!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3598 invoked from network); 27 Nov 2012 13:58:46 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 13:58:46 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TdLgQ-000EDP-9y; Tue, 27 Nov 2012 13:58:42 +0000
Date: Tue, 27 Nov 2012 13:58:42 +0000
From: Tim Deegan <tim@xen.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121127135842.GA51942@ocelot.phlegethon.org>
References: <alpine.DEB.2.02.1211231715130.13749@kaball.uk.xensource.com>
	<1353696510.29837.19.camel@dagon.hellion.org.uk>
	<alpine.DEB.2.02.1211271208420.5310@kaball.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1211271208420.5310@kaball.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH v2] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 12:11 +0000 on 27 Nov (1354018273), Stefano Stabellini wrote:
> On Fri, 23 Nov 2012, Ian Campbell wrote:
> > On Fri, 2012-11-23 at 18:04 +0000, Stefano Stabellini wrote:
> > > The zImage format is extremely simple: it only consists of a magic
> > > number and 2 addresses in a specific position (see
> > > http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
> > > 
> > > Some bootloaders expect a zImage; considering that it doesn't cost us
> > > much to build Xen compatible with the format, make it so.
> > > 
> > > Changes in v2:
> > > - code style;
> > > - pass 0 a start address.
> > > 
> > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > 
> > > diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> > > index 25c4cfe..347ddcf 100644
> > > --- a/xen/arch/arm/head.S
> > > +++ b/xen/arch/arm/head.S
> > > @@ -22,6 +22,8 @@
> > >  #include <asm/processor-ca15.h>
> > >  #include <asm/asm_defns.h>
> > >  
> > > +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> > > +
> > >  #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
> > >  #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
> > >  #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
> > > @@ -52,6 +54,18 @@
> > >  	 * or the initial pagetable code below will need adjustment. */
> > >  	.global start
> > >  start:
> > > +
> > > +	/* zImage magic header, see:
> > > +	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
> > > +	 */
> > > +	.skip 0x20
> > 
> > This was better as the explicit repeated nops, as it stands it's not at
> > all clear that you can start executing at start. It might even rely on
> > the specific assemblers behaviour?
> >
> > Also this wasn't what Tim suggested, which was branch then skip, not
> > skip then branch. I think the nops are better for consistency with Linux
> > though.
> 
> You are right. Thinking twice about it, I would rather keep the code as
> it was originally, for consistency with Linux.

Does consistency with linux buy us anything (beyond untidy code)?
I very much prefer the other way.  And if we do need to fill with nops,
why 7 repeated and one standalone?

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:07:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:07:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLoK-0007HO-M1; Tue, 27 Nov 2012 14:06:52 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TdLoJ-0007HI-Rf
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:06:52 +0000
Received: from [193.109.254.147:15284] by server-8.bemta-14.messagelabs.com id
	F1/9E-05026-AF8C4B05; Tue, 27 Nov 2012 14:06:50 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1354025198!8499013!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NzUxMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23250 invoked from network); 27 Nov 2012 14:06:40 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 14:06:40 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qARE6XA8016276
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 27 Nov 2012 14:06:33 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qARE6WnN021387
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 27 Nov 2012 14:06:32 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qARE6VZI013634; Tue, 27 Nov 2012 08:06:32 -0600
MIME-Version: 1.0
Message-ID: <c1e106c0-47fe-4423-8bd2-236045af1baa@default>
Date: Tue, 27 Nov 2012 06:06:30 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <38a09df7-3d82-403f-9153-9a151b220a41@default>
	<50B48C8A02000078000AB851@nat28.tlf.novell.com>
In-Reply-To: <50B48C8A02000078000AB851@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: KeirFraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	TimDeegan <tim@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Subject: Re: Please ack XENMEM_claim_pages hypercall?

Hi Jan --

> >>> On 26.11.12 at 20:07, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> > While it has always been my understanding that the
> > hypervisor is intended to be toolstack-independent,
> > Jan would like your Ack before committing the hypervisor
> > changes.
> >
> > So if you still object, please state your objections.
> > Otherwise, please ack, so Jan can commit it and Oracle
> > can move forward with toolstack development built
> > on the hypercall.
> 
> Sorry, there must have been some misunderstanding here: First
> of all, without a maintainer's ack (Keir's in this case) I can't commit
> anything to code that I'm not explicitly listed for as maintainer.

Oops, sorry.  Since you contribute so widely to the hypervisor,
the maintainership division between you and Keir is not particularly 
clear.
 
> Second, while I said the code itself looks acceptable, I also pointed
> out that in the shape it is right now it is dead code, as there's no
> user for it. So all we would get would be the risk of new bugs (and
> the one I just pointed out worries me in so far as how much testing
> this code really has seen).

The proposed hypercall is dead code to the _xl_ toolstack.
As I said, I personally can write an xm/xend patch that uses it
(which will undoubtedly launch another firestorm, so I was
trying to avoid that).

But most importantly, many of the code changes _will_ be
tested without any toolstack changes at all, as the existing
toolstack (with no claim hypercalls) exercises the changes.
Perhaps this is the most important testing of all and,
as I understand it, is a primary purpose of xen-unstable.

I do agree though that it is difficult to get adequate testing
without a toolstack user.  I, too, would like to see that fixed. :-(

> Third, deferral (or denial) of the patch going in is certainly not a
> blocking factor for tools side development at Oracle. In the worst
> case, you'd have to maintain the patch in your own tree(s); I do
> realize that you want to avoid that (as I would, but there are
> examples of patches that we carry in our trees that didn't get
> accepted into the community one - luckily they're of smaller size).

I guess I've failed to make a very important point because
I thought it was obvious... Because of the addition of the
hypercall subops, this is an ABI change.  I think you would
agree that maintaining an ABI change out-of-tree is much
more difficult than maintaining non-ABI changes out-of-tree.

If the hypercall subops are reserved, whether the remainder
of the patch is accepted now or not, that might be a
reasonable compromise to Oracle.

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:07:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:07:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLoK-0007HO-M1; Tue, 27 Nov 2012 14:06:52 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TdLoJ-0007HI-Rf
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:06:52 +0000
Received: from [193.109.254.147:15284] by server-8.bemta-14.messagelabs.com id
	F1/9E-05026-AF8C4B05; Tue, 27 Nov 2012 14:06:50 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1354025198!8499013!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NzUxMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23250 invoked from network); 27 Nov 2012 14:06:40 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 14:06:40 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qARE6XA8016276
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 27 Nov 2012 14:06:33 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qARE6WnN021387
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 27 Nov 2012 14:06:32 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qARE6VZI013634; Tue, 27 Nov 2012 08:06:32 -0600
MIME-Version: 1.0
Message-ID: <c1e106c0-47fe-4423-8bd2-236045af1baa@default>
Date: Tue, 27 Nov 2012 06:06:30 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <38a09df7-3d82-403f-9153-9a151b220a41@default>
	<50B48C8A02000078000AB851@nat28.tlf.novell.com>
In-Reply-To: <50B48C8A02000078000AB851@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: KeirFraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	TimDeegan <tim@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Subject: Re: Please ack XENMEM_claim_pages hypercall?

Hi Jan --

> >>> On 26.11.12 at 20:07, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> > While it has always been my understanding that the
> > hypervisor is intended to be toolstack-independent,
> > Jan would like your Ack before committing the hypervisor
> > changes.
> >
> > So if you still object, please state your objections.
> > Otherwise, please ack, so Jan can commit it and Oracle
> > can move forward with toolstack development built
> > on the hypercall.
> 
> Sorry, there must have been some misunderstanding here: First
> of all, without a maintainer's ack (Keir's in this case) I can't commit
> anything to code that I'm not explicitly listed for as maintainer.

Oops, sorry.  Since you contribute so widely to the hypervisor,
the maintainership division between you and Keir is not particularly 
clear.
 
> Second, while I said the code itself looks acceptable, I also pointed
> out that in the shape it is right now it is dead code, as there's no
> user for it. So all we would get would be the risk of new bugs (and
> the one I just pointed out worries me in so far as how much testing
> this code really has seen).

The proposed hypercall is dead code to the _xl_ toolstack.
As I said, I personally can write an xm/xend patch that uses it
(which will undoubtedly launch another firestorm, so I was
trying to avoid that).

But most importantly, many of the code changes _will_ be
tested without any toolstack changes at all, as the existing
toolstack (with no claim hypercalls) exercises the changes.
Perhaps this is the most important testing of all and,
as I understand it, is a primary purpose of xen-unstable.

I do agree though that it is difficult to get adequate testing
without a toolstack user.  I, too, would like to see that fixed. :-(

> Third, deferral (or denial) of the patch going in is certainly not a
> blocking factor for tools side development at Oracle. In the worst
> case, you'd have to maintain the patch in your own tree(s); I do
> realize that you want to avoid that (as I would, but there are
> examples of patches that we carry in our trees that didn't get
> accepted into the community one - luckily they're of smaller size).

I guess I've failed to make a very important point because
I thought it was obvious... Because of the addition of the
hypercall subops, this is an ABI change.  I think you would
agree that maintaining an ABI change out-of-tree is much
more difficult than maintaining non-ABI changes out-of-tree.

If the hypercall subops are reserved, whether the remainder
of the patch is accepted now or not, that might be a
reasonable compromise to Oracle.

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:08:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:08:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLpy-0007Pu-Bo; Tue, 27 Nov 2012 14:08:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TdLpw-0007Pl-Jd
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:08:32 +0000
Received: from [85.158.143.99:27225] by server-2.bemta-4.messagelabs.com id
	39/6E-28922-F59C4B05; Tue, 27 Nov 2012 14:08:31 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1354025308!30985635!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NzUxMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17690 invoked from network); 27 Nov 2012 14:08:30 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-3.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 14:08:30 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qARE8Mvs018485
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 27 Nov 2012 14:08:23 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qARE8M8m017091
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 27 Nov 2012 14:08:22 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qARE8M96015030; Tue, 27 Nov 2012 08:08:22 -0600
MIME-Version: 1.0
Message-ID: <baacb3cd-998f-4885-b7f1-28cd9f8c5c90@default>
Date: Tue, 27 Nov 2012 06:08:20 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>
References: <50B48C8A02000078000AB851@nat28.tlf.novell.com>
	<CCDA44CA.5383C%keir@xen.org>
In-Reply-To: <CCDA44CA.5383C%keir@xen.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	TimDeegan <tim@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Keir Fraser [mailto:keir@xen.org]
> Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
> 
> On 27/11/2012 08:48, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
> > Sorry, there must have been some misunderstanding here: First
> > of all, without a maintainer's ack (Keir's in this case) I can't commit
> > anything to code that I'm not explicitly listed for as maintainer.
> >
> > Second, while I said the code itself looks acceptable, I also pointed
> > out that in the shape it is right now it is dead code, as there's no
> > user for it. So all we would get would be the risk of new bugs (and
> > the one I just pointed out worries me in so far as how much testing
> > this code really has seen).
> >
> > Third, deferral (or denial) of the patch going in is certainly not a
> > blocking factor for tools side development at Oracle. In the worst
> > case, you'd have to maintain the patch in your own tree(s); I do
> > realize that you want to avoid that (as I would, but there are
> > examples of patches that we carry in our trees that didn't get
> > accepted into the community one - luckily they're of smaller size).
> 
> It's actually not that large a patch, and perhaps we could take a
> domain_adjust_tot_pages() hook which would reduce the size of any private
> patch, while not inflicting a maintenance or bug burden on mainline.

Thanks for your kind words.  That would be very helpful.
Also reserving the subops would be much more valuable.

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:08:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:08:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLpy-0007Pu-Bo; Tue, 27 Nov 2012 14:08:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TdLpw-0007Pl-Jd
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:08:32 +0000
Received: from [85.158.143.99:27225] by server-2.bemta-4.messagelabs.com id
	39/6E-28922-F59C4B05; Tue, 27 Nov 2012 14:08:31 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1354025308!30985635!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NzUxMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17690 invoked from network); 27 Nov 2012 14:08:30 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-3.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 14:08:30 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qARE8Mvs018485
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 27 Nov 2012 14:08:23 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qARE8M8m017091
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 27 Nov 2012 14:08:22 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qARE8M96015030; Tue, 27 Nov 2012 08:08:22 -0600
MIME-Version: 1.0
Message-ID: <baacb3cd-998f-4885-b7f1-28cd9f8c5c90@default>
Date: Tue, 27 Nov 2012 06:08:20 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>
References: <50B48C8A02000078000AB851@nat28.tlf.novell.com>
	<CCDA44CA.5383C%keir@xen.org>
In-Reply-To: <CCDA44CA.5383C%keir@xen.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	TimDeegan <tim@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Keir Fraser [mailto:keir@xen.org]
> Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
> 
> On 27/11/2012 08:48, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
> > Sorry, there must have been some misunderstanding here: First
> > of all, without a maintainer's ack (Keir's in this case) I can't commit
> > anything to code that I'm not explicitly listed for as maintainer.
> >
> > Second, while I said the code itself looks acceptable, I also pointed
> > out that in the shape it is right now it is dead code, as there's no
> > user for it. So all we would get would be the risk of new bugs (and
> > the one I just pointed out worries me in so far as how much testing
> > this code really has seen).
> >
> > Third, deferral (or denial) of the patch going in is certainly not a
> > blocking factor for tools side development at Oracle. In the worst
> > case, you'd have to maintain the patch in your own tree(s); I do
> > realize that you want to avoid that (as I would, but there are
> > examples of patches that we carry in our trees that didn't get
> > accepted into the community one - luckily they're of smaller size).
> 
> It's actually not that large a patch, and perhaps we could take a
> domain_adjust_tot_pages() hook which would reduce the size of any private
> patch, while not inflicting a maintenance or bug burden on mainline.

Thanks for your kind words.  That would be very helpful.
Also reserving the subops would be much more valuable.

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:09:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:09:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLqR-0007TB-Om; Tue, 27 Nov 2012 14:09:03 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdLqP-0007Sh-3u
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 14:09:01 +0000
Received: from [85.158.139.211:27205] by server-13.bemta-5.messagelabs.com id
	D8/DA-27809-C79C4B05; Tue, 27 Nov 2012 14:09:00 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1354025339!18106280!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25145 invoked from network); 27 Nov 2012 14:08:59 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 14:08:59 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16025239"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 14:08:59 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 14:08:59 +0000
Message-ID: <1354025338.17985.34.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Tue, 27 Nov 2012 14:08:58 +0000
In-Reply-To: <20121127135842.GA51942@ocelot.phlegethon.org>
References: <alpine.DEB.2.02.1211231715130.13749@kaball.uk.xensource.com>
	<1353696510.29837.19.camel@dagon.hellion.org.uk>
	<alpine.DEB.2.02.1211271208420.5310@kaball.uk.xensource.com>
	<20121127135842.GA51942@ocelot.phlegethon.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH v2] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 13:58 +0000, Tim Deegan wrote:
> At 12:11 +0000 on 27 Nov (1354018273), Stefano Stabellini wrote:
> > On Fri, 23 Nov 2012, Ian Campbell wrote:
> > > On Fri, 2012-11-23 at 18:04 +0000, Stefano Stabellini wrote:
> > > > The zImage format is extremely simple: it only consists of a magic
> > > > number and 2 addresses in a specific position (see
> > > > http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
> > > > 
> > > > Some bootloaders expect a zImage; considering that it doesn't cost us
> > > > much to build Xen compatible with the format, make it so.
> > > > 
> > > > Changes in v2:
> > > > - code style;
> > > > - pass 0 a start address.
> > > > 
> > > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > > 
> > > > diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> > > > index 25c4cfe..347ddcf 100644
> > > > --- a/xen/arch/arm/head.S
> > > > +++ b/xen/arch/arm/head.S
> > > > @@ -22,6 +22,8 @@
> > > >  #include <asm/processor-ca15.h>
> > > >  #include <asm/asm_defns.h>
> > > >  
> > > > +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> > > > +
> > > >  #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
> > > >  #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
> > > >  #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
> > > > @@ -52,6 +54,18 @@
> > > >  	 * or the initial pagetable code below will need adjustment. */
> > > >  	.global start
> > > >  start:
> > > > +
> > > > +	/* zImage magic header, see:
> > > > +	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
> > > > +	 */
> > > > +	.skip 0x20
> > > 
> > > This was better as the explicit repeated nops, as it stands it's not at
> > > all clear that you can start executing at start. It might even rely on
> > > the specific assemblers behaviour?
> > >
> > > Also this wasn't what Tim suggested, which was branch then skip, not
> > > skip then branch. I think the nops are better for consistency with Linux
> > > though.
> > 
> > You are right. Thinking twice about it, I would rather keep the code as
> > it was originally, for consistency with Linux.
> 
> Does consistency with linux buy us anything (beyond untidy code)?
> I very much prefer the other way.

I suspect the reason for this run of nops is some buggy bootloader which
jumped to byte 4*N instead of the start, for whatever reason. They may
well be historical but I don't see any reason to risk it.

Given that we are mimicing Linux's protocol I think remaining blindly
compatible is worth it.

>   And if we do need to fill with nops,
> why 7 repeated and one standalone?

In the original Linux it is actually:
                mov     r0, r0
                .endr
   ARM(         mov     r0, r0          )
   ARM(         b       1f              )
 THUMB(         adr     r12, BSYM(1f)   )
 THUMB(         bx      r12             )

i.e. once you strip out the thumb stuff (because we don't do thumb mode
hypervisor) you end up with what Stefano had. So indeed we could just do
8 in our case.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:09:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:09:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLqR-0007TB-Om; Tue, 27 Nov 2012 14:09:03 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdLqP-0007Sh-3u
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 14:09:01 +0000
Received: from [85.158.139.211:27205] by server-13.bemta-5.messagelabs.com id
	D8/DA-27809-C79C4B05; Tue, 27 Nov 2012 14:09:00 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1354025339!18106280!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25145 invoked from network); 27 Nov 2012 14:08:59 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 14:08:59 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16025239"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 14:08:59 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 14:08:59 +0000
Message-ID: <1354025338.17985.34.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Tue, 27 Nov 2012 14:08:58 +0000
In-Reply-To: <20121127135842.GA51942@ocelot.phlegethon.org>
References: <alpine.DEB.2.02.1211231715130.13749@kaball.uk.xensource.com>
	<1353696510.29837.19.camel@dagon.hellion.org.uk>
	<alpine.DEB.2.02.1211271208420.5310@kaball.uk.xensource.com>
	<20121127135842.GA51942@ocelot.phlegethon.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH v2] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 13:58 +0000, Tim Deegan wrote:
> At 12:11 +0000 on 27 Nov (1354018273), Stefano Stabellini wrote:
> > On Fri, 23 Nov 2012, Ian Campbell wrote:
> > > On Fri, 2012-11-23 at 18:04 +0000, Stefano Stabellini wrote:
> > > > The zImage format is extremely simple: it only consists of a magic
> > > > number and 2 addresses in a specific position (see
> > > > http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
> > > > 
> > > > Some bootloaders expect a zImage; considering that it doesn't cost us
> > > > much to build Xen compatible with the format, make it so.
> > > > 
> > > > Changes in v2:
> > > > - code style;
> > > > - pass 0 a start address.
> > > > 
> > > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > > 
> > > > diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> > > > index 25c4cfe..347ddcf 100644
> > > > --- a/xen/arch/arm/head.S
> > > > +++ b/xen/arch/arm/head.S
> > > > @@ -22,6 +22,8 @@
> > > >  #include <asm/processor-ca15.h>
> > > >  #include <asm/asm_defns.h>
> > > >  
> > > > +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> > > > +
> > > >  #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
> > > >  #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
> > > >  #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
> > > > @@ -52,6 +54,18 @@
> > > >  	 * or the initial pagetable code below will need adjustment. */
> > > >  	.global start
> > > >  start:
> > > > +
> > > > +	/* zImage magic header, see:
> > > > +	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
> > > > +	 */
> > > > +	.skip 0x20
> > > 
> > > This was better as the explicit repeated nops, as it stands it's not at
> > > all clear that you can start executing at start. It might even rely on
> > > the specific assemblers behaviour?
> > >
> > > Also this wasn't what Tim suggested, which was branch then skip, not
> > > skip then branch. I think the nops are better for consistency with Linux
> > > though.
> > 
> > You are right. Thinking twice about it, I would rather keep the code as
> > it was originally, for consistency with Linux.
> 
> Does consistency with linux buy us anything (beyond untidy code)?
> I very much prefer the other way.

I suspect the reason for this run of nops is some buggy bootloader which
jumped to byte 4*N instead of the start, for whatever reason. They may
well be historical but I don't see any reason to risk it.

Given that we are mimicing Linux's protocol I think remaining blindly
compatible is worth it.

>   And if we do need to fill with nops,
> why 7 repeated and one standalone?

In the original Linux it is actually:
                mov     r0, r0
                .endr
   ARM(         mov     r0, r0          )
   ARM(         b       1f              )
 THUMB(         adr     r12, BSYM(1f)   )
 THUMB(         bx      r12             )

i.e. once you strip out the thumb stuff (because we don't do thumb mode
hypervisor) you end up with what Stefano had. So indeed we could just do
8 in our case.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:13:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:13:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLuk-0007mq-Fy; Tue, 27 Nov 2012 14:13:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dietmar.hahn@ts.fujitsu.com>) id 1TdLuj-0007mk-3H
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:13:29 +0000
Received: from [85.158.143.99:63908] by server-2.bemta-4.messagelabs.com id
	5B/77-28922-88AC4B05; Tue, 27 Nov 2012 14:13:28 +0000
X-Env-Sender: dietmar.hahn@ts.fujitsu.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1354025607!21063257!1
X-Originating-IP: [80.70.172.51]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuNzAuMTcyLjUxID0+IDE4ODU3OA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21042 invoked from network); 27 Nov 2012 14:13:27 -0000
Received: from dgate20.ts.fujitsu.com (HELO dgate20.ts.fujitsu.com)
	(80.70.172.51)
	by server-10.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 14:13:27 -0000
DomainKey-Signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns;
	h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV:
	Received:Received:From:To:Cc:Subject:Date:Message-ID:
	User-Agent:In-Reply-To:References:MIME-Version:
	Content-Transfer-Encoding:Content-Type;
	b=Q8cwmFf391Vgp9OLLokH8h8G+SVdNQms773q2y/RA2sBq+xzgfhjyjil
	qx4KYwEfUhBHo6jn60nsnwxFy240m+KdOi8UIofpcxm5w1s2+vBzvFeyZ
	saXO5kigiGon08KlyOMPDy5Iz3ydY232/uIxl4KJf6cck3inhWeZAJbIy
	bf9gxxt0LwwoB2GVayteGih9Fe0uimeQBglNI8SjLSKgdK2ObST/HqbfQ
	nc5unA81F9u+mUUOEwacJ3g5f40lT;
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
	d=ts.fujitsu.com; i=@ts.fujitsu.com; q=dns/txt;
	s=s1536b; t=1354025608; x=1385561608;
	h=from:to:cc:subject:date:message-id:in-reply-to:
	references:mime-version:content-transfer-encoding;
	bh=hV78vdZ9oe4AZGUhG6x83zimTo8c6IOF+R6B9ZIWPr8=;
	b=eqq25kw/Sc9+nXvFbfkjr0MmyylBNGbaIXXtAII/WXRYAKYm49zSWKBa
	kIhAolohhhVZ4wMtW+tHQeaBSiDCsWjxcdDvFqAlNCyBJilfqyyAOfp2v
	0N4AniqVmMgRSL+GiHxM1NkInIw7YopAVi0AccReg8K2GC75zzFYJFSXh
	1KyX1Rzd1nRkZqSm05TfEtpEzvi+QJLnvCvccBWw65OJ82QryjIsA/Mqz
	Fchi1Wi/DjGFKW/fiJO0Af9/ZXfGX;
X-SBRSScore: None
X-IronPort-AV: E=Sophos;i="4.83,328,1352070000"; d="scan'208";a="109777319"
Received: from abgdgate40u.abg.fsc.net ([172.25.138.90])
	by dgate20u.abg.fsc.net with ESMTP; 27 Nov 2012 15:13:18 +0100
X-IronPort-AV: E=Sophos;i="4.83,326,1352070000"; d="scan'208";a="150937828"
Received: from sanpedro.mch.fsc.net ([172.17.20.6])
	by abgdgate40u.abg.fsc.net with SMTP; 27 Nov 2012 15:13:18 +0100
Received: from amur.localnet (amur.mch.fsc.net [10.172.102.19])
	by sanpedro.mch.fsc.net (Postfix) with ESMTP id 0D06096A770;
	Tue, 27 Nov 2012 15:13:18 +0100 (CET)
From: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
To: xen-devel@lists.xen.org
Date: Tue, 27 Nov 2012 15:13:17 +0100
Message-ID: <1568155.vSrY4pmdPT@amur>
User-Agent: KMail/4.7.2 (Linux/3.1.10-1.16-xen; KDE/4.7.2; x86_64; ; )
In-Reply-To: <50B4C87402000078000ABA9F@nat28.tlf.novell.com>
References: <1449364.BXBucXMpuY@amur>
	<50B4C87402000078000ABA9F@nat28.tlf.novell.com>
MIME-Version: 1.0
Cc: Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] oprofile: Add X7542 and E7-8837 to the list
	of supported cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Am Dienstag 27 November 2012, 13:04:36 schrieb Jan Beulich:
> >>> On 26.11.12 at 13:52, Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> wrote:
> > Add intel cpus X7542 and E7-8837 to the list of supported cpus.
> > 
> > Thanks.
> > Dietmar.
> > 
> > Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
> > 
> > diff -r 0049de3827bc -r 6fb0129600cd xen/arch/x86/oprofile/nmi_int.c
> > --- a/xen/arch/x86/oprofile/nmi_int.c   Fri Nov 23 11:06:15 2012 +0000
> > +++ b/xen/arch/x86/oprofile/nmi_int.c   Mon Nov 26 13:36:00 2012 +0100
> > @@ -366,6 +366,8 @@ static int __init ppro_init(char ** cpu_
> >                 ppro_has_global_ctrl = 1;
> >                 break;
> >         case 26:
> > +       case 46:
> > +       case 47:
> >                 arch_perfmon_setup_counters();
> >                 *cpu_type = "i386/core_i7";
> >                 ppro_has_global_ctrl = 1;
> 
> Actually, and apart from the patch being white space damaged,
> after a closer look I think this is wrong - these newer CPUs
> shouldn't get be handled here, but instead should be covered by
> arch_perfmon_init(). Are you observing X86_FEATURE_ARCH_PERFMON
> not getting set on these CPUs by init_intel()?

Yes you are right. I wasn't aware of this!
Dietmar.

> 
> Jan
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 
-- 
Company details: http://ts.fujitsu.com/imprint.html

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:13:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:13:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLuk-0007mq-Fy; Tue, 27 Nov 2012 14:13:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dietmar.hahn@ts.fujitsu.com>) id 1TdLuj-0007mk-3H
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:13:29 +0000
Received: from [85.158.143.99:63908] by server-2.bemta-4.messagelabs.com id
	5B/77-28922-88AC4B05; Tue, 27 Nov 2012 14:13:28 +0000
X-Env-Sender: dietmar.hahn@ts.fujitsu.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1354025607!21063257!1
X-Originating-IP: [80.70.172.51]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuNzAuMTcyLjUxID0+IDE4ODU3OA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21042 invoked from network); 27 Nov 2012 14:13:27 -0000
Received: from dgate20.ts.fujitsu.com (HELO dgate20.ts.fujitsu.com)
	(80.70.172.51)
	by server-10.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 14:13:27 -0000
DomainKey-Signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns;
	h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV:
	Received:Received:From:To:Cc:Subject:Date:Message-ID:
	User-Agent:In-Reply-To:References:MIME-Version:
	Content-Transfer-Encoding:Content-Type;
	b=Q8cwmFf391Vgp9OLLokH8h8G+SVdNQms773q2y/RA2sBq+xzgfhjyjil
	qx4KYwEfUhBHo6jn60nsnwxFy240m+KdOi8UIofpcxm5w1s2+vBzvFeyZ
	saXO5kigiGon08KlyOMPDy5Iz3ydY232/uIxl4KJf6cck3inhWeZAJbIy
	bf9gxxt0LwwoB2GVayteGih9Fe0uimeQBglNI8SjLSKgdK2ObST/HqbfQ
	nc5unA81F9u+mUUOEwacJ3g5f40lT;
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
	d=ts.fujitsu.com; i=@ts.fujitsu.com; q=dns/txt;
	s=s1536b; t=1354025608; x=1385561608;
	h=from:to:cc:subject:date:message-id:in-reply-to:
	references:mime-version:content-transfer-encoding;
	bh=hV78vdZ9oe4AZGUhG6x83zimTo8c6IOF+R6B9ZIWPr8=;
	b=eqq25kw/Sc9+nXvFbfkjr0MmyylBNGbaIXXtAII/WXRYAKYm49zSWKBa
	kIhAolohhhVZ4wMtW+tHQeaBSiDCsWjxcdDvFqAlNCyBJilfqyyAOfp2v
	0N4AniqVmMgRSL+GiHxM1NkInIw7YopAVi0AccReg8K2GC75zzFYJFSXh
	1KyX1Rzd1nRkZqSm05TfEtpEzvi+QJLnvCvccBWw65OJ82QryjIsA/Mqz
	Fchi1Wi/DjGFKW/fiJO0Af9/ZXfGX;
X-SBRSScore: None
X-IronPort-AV: E=Sophos;i="4.83,328,1352070000"; d="scan'208";a="109777319"
Received: from abgdgate40u.abg.fsc.net ([172.25.138.90])
	by dgate20u.abg.fsc.net with ESMTP; 27 Nov 2012 15:13:18 +0100
X-IronPort-AV: E=Sophos;i="4.83,326,1352070000"; d="scan'208";a="150937828"
Received: from sanpedro.mch.fsc.net ([172.17.20.6])
	by abgdgate40u.abg.fsc.net with SMTP; 27 Nov 2012 15:13:18 +0100
Received: from amur.localnet (amur.mch.fsc.net [10.172.102.19])
	by sanpedro.mch.fsc.net (Postfix) with ESMTP id 0D06096A770;
	Tue, 27 Nov 2012 15:13:18 +0100 (CET)
From: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
To: xen-devel@lists.xen.org
Date: Tue, 27 Nov 2012 15:13:17 +0100
Message-ID: <1568155.vSrY4pmdPT@amur>
User-Agent: KMail/4.7.2 (Linux/3.1.10-1.16-xen; KDE/4.7.2; x86_64; ; )
In-Reply-To: <50B4C87402000078000ABA9F@nat28.tlf.novell.com>
References: <1449364.BXBucXMpuY@amur>
	<50B4C87402000078000ABA9F@nat28.tlf.novell.com>
MIME-Version: 1.0
Cc: Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] oprofile: Add X7542 and E7-8837 to the list
	of supported cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Am Dienstag 27 November 2012, 13:04:36 schrieb Jan Beulich:
> >>> On 26.11.12 at 13:52, Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> wrote:
> > Add intel cpus X7542 and E7-8837 to the list of supported cpus.
> > 
> > Thanks.
> > Dietmar.
> > 
> > Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
> > 
> > diff -r 0049de3827bc -r 6fb0129600cd xen/arch/x86/oprofile/nmi_int.c
> > --- a/xen/arch/x86/oprofile/nmi_int.c   Fri Nov 23 11:06:15 2012 +0000
> > +++ b/xen/arch/x86/oprofile/nmi_int.c   Mon Nov 26 13:36:00 2012 +0100
> > @@ -366,6 +366,8 @@ static int __init ppro_init(char ** cpu_
> >                 ppro_has_global_ctrl = 1;
> >                 break;
> >         case 26:
> > +       case 46:
> > +       case 47:
> >                 arch_perfmon_setup_counters();
> >                 *cpu_type = "i386/core_i7";
> >                 ppro_has_global_ctrl = 1;
> 
> Actually, and apart from the patch being white space damaged,
> after a closer look I think this is wrong - these newer CPUs
> shouldn't get be handled here, but instead should be covered by
> arch_perfmon_init(). Are you observing X86_FEATURE_ARCH_PERFMON
> not getting set on these CPUs by init_intel()?

Yes you are right. I wasn't aware of this!
Dietmar.

> 
> Jan
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 
-- 
Company details: http://ts.fujitsu.com/imprint.html

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:15:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:15:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLw4-0007tq-V1; Tue, 27 Nov 2012 14:14:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdLw3-0007te-5V
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:14:51 +0000
Received: from [85.158.138.51:55132] by server-8.bemta-3.messagelabs.com id
	41/B4-07786-ADAC4B05; Tue, 27 Nov 2012 14:14:50 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1354025689!31672888!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2147 invoked from network); 27 Nov 2012 14:14:49 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 14:14:49 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16025418"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 14:14:49 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 14:14:49 +0000
Message-ID: <1354025687.17985.35.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ronny Hegewald <ronny.hegewald@online.de>
Date: Tue, 27 Nov 2012 14:14:47 +0000
In-Reply-To: <201211262353.15915.ronny.hegewald@online.de>
References: <201211262353.15915.ronny.hegewald@online.de>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] libxl: fix a variable underflow in
 libxl_wait_for_free_memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 23:53 +0000, Ronny Hegewald wrote:
> When xl is called to create a domU and there is not enough memory available, 
> then the autoballooning is called to extract memory from dom0. During the 
> ballooning a loop in libxl_wait_for_free_memory() waits unless enough memory 
> is available to create the domU. 
> 
> But because of a variable-underflow the loop can finish too soon and xl 
> finally aborts with the message:
> 
> 
> xc: error: panic: xc_dom_boot.c:161: xc_dom_boot_mem_init: can't allocate low 
> memory for domain: Out of memory                         
> libxl: error: libxl_dom.c:430:libxl__build_pv: xc_dom_boot_mem_init failed: 
> Device or resource busy                                    
> libxl: error: libxl_create.c:901:domcreate_rebuild_done: cannot (re-)build 
> domain: -3        
> 
> 
> The variable-underflow happens when freemem_slack is larger then 
> info.free_pages*4, because the solution of this operation is converted 
> implicit to a unsigned int to match the type of memory_kb.
> 
> Add a extra check for this condition to solve the problem.
> 
> ---
> 
> Changes since V1:
>   * check for valid ranges of freemem_slack instead of casting around values, 
>     as suggested by Ian Campbell   
> 
> 
> Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>

(moved this above the "---" so it got included in the commit message).

Acked-by: Ian Campbell <ian.campbell@citrix.com>

There was some minor whitespace damage but for once it was trival  to
fix up so I have applied it, thanks.

Ian J -- this is a stable branch candidate IMHO.

> --- xen-4.3-20121121/tools/libxl/libxl.c.org	2012-11-22 03:34:00.000000000 
> +0000
> +++ xen-4.3-20121121/tools/libxl/libxl.c	2012-11-26 21:29:42.000000000 +0000
> @@ -3763,7 +3763,8 @@ int libxl_wait_for_free_memory(libxl_ctx
>          rc = libxl_get_physinfo(ctx, &info);
>          if (rc < 0)
>              goto out;
> -        if (info.free_pages * 4 - freemem_slack >= memory_kb) {
> +        if (info.free_pages * 4 >= freemem_slack && 
> +            info.free_pages * 4 - freemem_slack >= memory_kb) {
>              rc = 0;
>              goto out;
>          }
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:15:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:15:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLw4-0007tq-V1; Tue, 27 Nov 2012 14:14:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdLw3-0007te-5V
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:14:51 +0000
Received: from [85.158.138.51:55132] by server-8.bemta-3.messagelabs.com id
	41/B4-07786-ADAC4B05; Tue, 27 Nov 2012 14:14:50 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1354025689!31672888!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2147 invoked from network); 27 Nov 2012 14:14:49 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 14:14:49 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16025418"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 14:14:49 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 14:14:49 +0000
Message-ID: <1354025687.17985.35.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ronny Hegewald <ronny.hegewald@online.de>
Date: Tue, 27 Nov 2012 14:14:47 +0000
In-Reply-To: <201211262353.15915.ronny.hegewald@online.de>
References: <201211262353.15915.ronny.hegewald@online.de>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] libxl: fix a variable underflow in
 libxl_wait_for_free_memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 23:53 +0000, Ronny Hegewald wrote:
> When xl is called to create a domU and there is not enough memory available, 
> then the autoballooning is called to extract memory from dom0. During the 
> ballooning a loop in libxl_wait_for_free_memory() waits unless enough memory 
> is available to create the domU. 
> 
> But because of a variable-underflow the loop can finish too soon and xl 
> finally aborts with the message:
> 
> 
> xc: error: panic: xc_dom_boot.c:161: xc_dom_boot_mem_init: can't allocate low 
> memory for domain: Out of memory                         
> libxl: error: libxl_dom.c:430:libxl__build_pv: xc_dom_boot_mem_init failed: 
> Device or resource busy                                    
> libxl: error: libxl_create.c:901:domcreate_rebuild_done: cannot (re-)build 
> domain: -3        
> 
> 
> The variable-underflow happens when freemem_slack is larger then 
> info.free_pages*4, because the solution of this operation is converted 
> implicit to a unsigned int to match the type of memory_kb.
> 
> Add a extra check for this condition to solve the problem.
> 
> ---
> 
> Changes since V1:
>   * check for valid ranges of freemem_slack instead of casting around values, 
>     as suggested by Ian Campbell   
> 
> 
> Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>

(moved this above the "---" so it got included in the commit message).

Acked-by: Ian Campbell <ian.campbell@citrix.com>

There was some minor whitespace damage but for once it was trival  to
fix up so I have applied it, thanks.

Ian J -- this is a stable branch candidate IMHO.

> --- xen-4.3-20121121/tools/libxl/libxl.c.org	2012-11-22 03:34:00.000000000 
> +0000
> +++ xen-4.3-20121121/tools/libxl/libxl.c	2012-11-26 21:29:42.000000000 +0000
> @@ -3763,7 +3763,8 @@ int libxl_wait_for_free_memory(libxl_ctx
>          rc = libxl_get_physinfo(ctx, &info);
>          if (rc < 0)
>              goto out;
> -        if (info.free_pages * 4 - freemem_slack >= memory_kb) {
> +        if (info.free_pages * 4 >= freemem_slack && 
> +            info.free_pages * 4 - freemem_slack >= memory_kb) {
>              rc = 0;
>              goto out;
>          }
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:15:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:15:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLwB-0007uf-Aq; Tue, 27 Nov 2012 14:14:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdLw9-0007uM-VR
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 14:14:58 +0000
Received: from [85.158.143.99:12018] by server-3.bemta-4.messagelabs.com id
	F8/62-06841-1EAC4B05; Tue, 27 Nov 2012 14:14:57 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1354025696!28181968!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5275 invoked from network); 27 Nov 2012 14:14:57 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 14:14:57 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16025420"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 14:14:56 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 14:14:56 +0000
Message-ID: <1354025695.17985.36.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Tue, 27 Nov 2012 14:14:55 +0000
In-Reply-To: <54d1bcd211d14cfbae07.1353681656@elijah>
References: <54d1bcd211d14cfbae07.1353681656@elijah>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH v2] libxl: Fix bug in libxl_cdrom_insert,
 make more robust against bad xenstore data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 14:40 +0000, George Dunlap wrote:
> # HG changeset patch
> # User George Dunlap <george.dunlap@eu.citrix.com>
> # Date 1353681608 0
> # Node ID 54d1bcd211d14cfbae0782f2bf04f8942c2eb726
> # Parent  ae6fb202b233af815466055d9f1a635802a50855
> libxl: Fix bug in libxl_cdrom_insert, make more robust against bad xenstore data
> 
> libxl_cdrom_insert was failing to initialize the backend type,
> resulting in the wrong default backend.  The result was not only that
> the CD was not inserted properly, but also that some improper xenstore
> entries were created, causing further block commands to fail.
> 
> This patch fixes the bug by setting the disk backend type based on the
> type of the existing device.
> 
> It also makes the system more robust by checking to see that it has
> got a valid path before proceeding to write a partial xenstore entry.
> 
> v2:
>  - Remove the checks on read, pending a more robust fix in another patch.
> 
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

Acked + applied. Thanks.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:15:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:15:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLwB-0007uf-Aq; Tue, 27 Nov 2012 14:14:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdLw9-0007uM-VR
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 14:14:58 +0000
Received: from [85.158.143.99:12018] by server-3.bemta-4.messagelabs.com id
	F8/62-06841-1EAC4B05; Tue, 27 Nov 2012 14:14:57 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1354025696!28181968!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5275 invoked from network); 27 Nov 2012 14:14:57 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 14:14:57 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16025420"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 14:14:56 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 14:14:56 +0000
Message-ID: <1354025695.17985.36.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Tue, 27 Nov 2012 14:14:55 +0000
In-Reply-To: <54d1bcd211d14cfbae07.1353681656@elijah>
References: <54d1bcd211d14cfbae07.1353681656@elijah>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH v2] libxl: Fix bug in libxl_cdrom_insert,
 make more robust against bad xenstore data
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 14:40 +0000, George Dunlap wrote:
> # HG changeset patch
> # User George Dunlap <george.dunlap@eu.citrix.com>
> # Date 1353681608 0
> # Node ID 54d1bcd211d14cfbae0782f2bf04f8942c2eb726
> # Parent  ae6fb202b233af815466055d9f1a635802a50855
> libxl: Fix bug in libxl_cdrom_insert, make more robust against bad xenstore data
> 
> libxl_cdrom_insert was failing to initialize the backend type,
> resulting in the wrong default backend.  The result was not only that
> the CD was not inserted properly, but also that some improper xenstore
> entries were created, causing further block commands to fail.
> 
> This patch fixes the bug by setting the disk backend type based on the
> type of the existing device.
> 
> It also makes the system more robust by checking to see that it has
> got a valid path before proceeding to write a partial xenstore entry.
> 
> v2:
>  - Remove the checks on read, pending a more robust fix in another patch.
> 
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

Acked + applied. Thanks.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:15:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:15:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLww-00082x-Ov; Tue, 27 Nov 2012 14:15:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdLwv-00082h-VM
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 14:15:46 +0000
Received: from [85.158.137.99:8218] by server-7.bemta-3.messagelabs.com id
	B0/7C-01713-11BC4B05; Tue, 27 Nov 2012 14:15:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1354025744!19947011!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11453 invoked from network); 27 Nov 2012 14:15:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 14:15:44 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16025446"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 14:15:43 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 14:15:43 +0000
Message-ID: <1354025742.17985.38.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Tue, 27 Nov 2012 14:15:42 +0000
In-Reply-To: <alpine.DEB.2.02.1211231250330.13749@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231250330.13749@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] README: add Pixman as build dependency
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 12:51 +0000, Stefano Stabellini wrote:
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Any build/error reporting improvements can be done separately IMHO, this
patch is factually accurate in itself.

Acked-by: Ian Campbell <ian.campbell@citrix.com> + applied.

Ian


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:15:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:15:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLww-00082x-Ov; Tue, 27 Nov 2012 14:15:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdLwv-00082h-VM
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 14:15:46 +0000
Received: from [85.158.137.99:8218] by server-7.bemta-3.messagelabs.com id
	B0/7C-01713-11BC4B05; Tue, 27 Nov 2012 14:15:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1354025744!19947011!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11453 invoked from network); 27 Nov 2012 14:15:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 14:15:44 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16025446"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 14:15:43 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 14:15:43 +0000
Message-ID: <1354025742.17985.38.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Tue, 27 Nov 2012 14:15:42 +0000
In-Reply-To: <alpine.DEB.2.02.1211231250330.13749@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231250330.13749@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] README: add Pixman as build dependency
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 12:51 +0000, Stefano Stabellini wrote:
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Any build/error reporting improvements can be done separately IMHO, this
patch is factually accurate in itself.

Acked-by: Ian Campbell <ian.campbell@citrix.com> + applied.

Ian


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:16:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:16:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLx3-00084L-5x; Tue, 27 Nov 2012 14:15:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdLx2-000841-7d
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 14:15:52 +0000
Received: from [85.158.143.35:39468] by server-3.bemta-4.messagelabs.com id
	A2/04-06841-71BC4B05; Tue, 27 Nov 2012 14:15:51 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354025708!12353969!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2014 invoked from network); 27 Nov 2012 14:15:09 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 14:15:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16025426"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 14:15:08 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 14:15:08 +0000
Message-ID: <1354025706.17985.37.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Chunyan Liu <cyliu@suse.com>
Date: Tue, 27 Nov 2012 14:15:06 +0000
In-Reply-To: <d0f86e88e3c1dc69e897.1353901039@linux-1.site>
References: <d0f86e88e3c1dc69e897.1353901039@linux-1.site>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH v3] xenstore-chmod: handle arbitrary number
 of perms rather than MAX_PERMS constant
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 03:37 +0000, Chunyan Liu wrote:
> Constant MAX_PERMS 16 is too small to use in some occasions, e.g. if
> there are more than 16 domU(s) on one hypervisor (it's easy to
> achieve) and one wants to do xenstore-chmod PATH to all domU(s). So,
> remove MAX_PERMS limitation and make it as arbitrary number of perms.
> 
> Signed-off-by: Chunyan Liu <cyliu@suse.com>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>

Applied, thanks.

> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:16:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:16:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLx3-00084L-5x; Tue, 27 Nov 2012 14:15:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdLx2-000841-7d
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 14:15:52 +0000
Received: from [85.158.143.35:39468] by server-3.bemta-4.messagelabs.com id
	A2/04-06841-71BC4B05; Tue, 27 Nov 2012 14:15:51 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354025708!12353969!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2014 invoked from network); 27 Nov 2012 14:15:09 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 14:15:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16025426"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 14:15:08 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 14:15:08 +0000
Message-ID: <1354025706.17985.37.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Chunyan Liu <cyliu@suse.com>
Date: Tue, 27 Nov 2012 14:15:06 +0000
In-Reply-To: <d0f86e88e3c1dc69e897.1353901039@linux-1.site>
References: <d0f86e88e3c1dc69e897.1353901039@linux-1.site>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH v3] xenstore-chmod: handle arbitrary number
 of perms rather than MAX_PERMS constant
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 2012-11-26 at 03:37 +0000, Chunyan Liu wrote:
> Constant MAX_PERMS 16 is too small to use in some occasions, e.g. if
> there are more than 16 domU(s) on one hypervisor (it's easy to
> achieve) and one wants to do xenstore-chmod PATH to all domU(s). So,
> remove MAX_PERMS limitation and make it as arbitrary number of perms.
> 
> Signed-off-by: Chunyan Liu <cyliu@suse.com>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>

Applied, thanks.

> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:16:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:16:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLx5-00085E-St; Tue, 27 Nov 2012 14:15:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdLx4-00084e-Hx
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:15:54 +0000
Received: from [85.158.139.83:14407] by server-5.bemta-5.messagelabs.com id
	29/2A-11353-91BC4B05; Tue, 27 Nov 2012 14:15:53 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1354025752!29748524!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18624 invoked from network); 27 Nov 2012 14:15:52 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 14:15:52 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16025456"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 14:15:52 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 14:15:52 +0000
Message-ID: <1354025751.17985.39.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Tue, 27 Nov 2012 14:15:51 +0000
In-Reply-To: <alpine.DEB.2.02.1211271109190.5310@kaball.uk.xensource.com>
References: <3174dc24e3efb0c5b964.1354011201@cosworth.uk.xensource.com>
	<alpine.DEB.2.02.1211271109190.5310@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xl: xl.conf(5): correct advice re
 autoballooning vs. dom0_mem
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 11:10 +0000, Stefano Stabellini wrote:
> On Tue, 27 Nov 2012, Ian Campbell wrote:
> > # HG changeset patch
> > # User Ian Campbell <ijc@hellion.org.uk>
> > # Date 1354011148 0
> > # Node ID 3174dc24e3efb0c5b964c244dbfb0218a03a38cf
> > # Parent  541b0e1a36c86db5df04988dd4ade5430776a7f2
> > xl: xl.conf(5): correct advice re autoballooning vs. dom0_mem.
> > 
> > The advice was backwards, you should really disable autoballoon if you
> > use dom0_mem. Also add a reference to the command-line docs.
> > 
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 
> 
> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Applied, thanks.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:16:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:16:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLx5-00085E-St; Tue, 27 Nov 2012 14:15:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdLx4-00084e-Hx
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:15:54 +0000
Received: from [85.158.139.83:14407] by server-5.bemta-5.messagelabs.com id
	29/2A-11353-91BC4B05; Tue, 27 Nov 2012 14:15:53 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1354025752!29748524!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18624 invoked from network); 27 Nov 2012 14:15:52 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 14:15:52 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16025456"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 14:15:52 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 14:15:52 +0000
Message-ID: <1354025751.17985.39.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Tue, 27 Nov 2012 14:15:51 +0000
In-Reply-To: <alpine.DEB.2.02.1211271109190.5310@kaball.uk.xensource.com>
References: <3174dc24e3efb0c5b964.1354011201@cosworth.uk.xensource.com>
	<alpine.DEB.2.02.1211271109190.5310@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xl: xl.conf(5): correct advice re
 autoballooning vs. dom0_mem
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 11:10 +0000, Stefano Stabellini wrote:
> On Tue, 27 Nov 2012, Ian Campbell wrote:
> > # HG changeset patch
> > # User Ian Campbell <ijc@hellion.org.uk>
> > # Date 1354011148 0
> > # Node ID 3174dc24e3efb0c5b964c244dbfb0218a03a38cf
> > # Parent  541b0e1a36c86db5df04988dd4ade5430776a7f2
> > xl: xl.conf(5): correct advice re autoballooning vs. dom0_mem.
> > 
> > The advice was backwards, you should really disable autoballoon if you
> > use dom0_mem. Also add a reference to the command-line docs.
> > 
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 
> 
> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Applied, thanks.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:16:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:16:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLx9-000877-Ic; Tue, 27 Nov 2012 14:15:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TdLx6-00085H-DI
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:15:58 +0000
Received: from [85.158.138.51:20885] by server-12.bemta-3.messagelabs.com id
	36/33-22757-B1BC4B05; Tue, 27 Nov 2012 14:15:55 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354025731!25326796!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9024 invoked from network); 27 Nov 2012 14:15:32 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 14:15:32 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TdLwa-000EHD-Uk; Tue, 27 Nov 2012 14:15:24 +0000
Date: Tue, 27 Nov 2012 14:15:24 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121127141524.GB51942@ocelot.phlegethon.org>
References: <38a09df7-3d82-403f-9153-9a151b220a41@default>
	<50B48C8A02000078000AB851@nat28.tlf.novell.com>
	<1354012308.5830.175.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354012308.5830.175.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	"Keir \(Xen.org\)" <keir@xen.org>, Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 10:31 +0000 on 27 Nov (1354012308), Ian Campbell wrote:
> On Tue, 2012-11-27 at 08:48 +0000, Jan Beulich wrote:
> > Second, while I said the code itself looks acceptable, I also pointed
> > out that in the shape it is right now it is dead code, as there's no
> > user for it. So all we would get would be the risk of new bugs (and
> > the one I just pointed out worries me in so far as how much testing
> > this code really has seen).
> 
> I agree with this.

Me too (and with Jan and Ian's other points).

> > Third, deferral (or denial) of the patch going in is certainly not a
> > blocking factor for tools side development at Oracle. In the worst
> > case, you'd have to maintain the patch in your own tree(s); I do
> > realize that you want to avoid that (as I would, but there are
> > examples of patches that we carry in our trees that didn't get
> > accepted into the community one - luckily they're of smaller size).
> 
> I think Oracle carrying this patch in their tree is probably the best
> approach for now.

Agreed.  We can always take a patch reserving hypercall numbers for now,
so there's no risk that an Oracle private patch will clash with an
upstream allocation later on.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:16:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:16:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdLx9-000877-Ic; Tue, 27 Nov 2012 14:15:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TdLx6-00085H-DI
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:15:58 +0000
Received: from [85.158.138.51:20885] by server-12.bemta-3.messagelabs.com id
	36/33-22757-B1BC4B05; Tue, 27 Nov 2012 14:15:55 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354025731!25326796!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9024 invoked from network); 27 Nov 2012 14:15:32 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 14:15:32 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TdLwa-000EHD-Uk; Tue, 27 Nov 2012 14:15:24 +0000
Date: Tue, 27 Nov 2012 14:15:24 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121127141524.GB51942@ocelot.phlegethon.org>
References: <38a09df7-3d82-403f-9153-9a151b220a41@default>
	<50B48C8A02000078000AB851@nat28.tlf.novell.com>
	<1354012308.5830.175.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354012308.5830.175.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	"Keir \(Xen.org\)" <keir@xen.org>, Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 10:31 +0000 on 27 Nov (1354012308), Ian Campbell wrote:
> On Tue, 2012-11-27 at 08:48 +0000, Jan Beulich wrote:
> > Second, while I said the code itself looks acceptable, I also pointed
> > out that in the shape it is right now it is dead code, as there's no
> > user for it. So all we would get would be the risk of new bugs (and
> > the one I just pointed out worries me in so far as how much testing
> > this code really has seen).
> 
> I agree with this.

Me too (and with Jan and Ian's other points).

> > Third, deferral (or denial) of the patch going in is certainly not a
> > blocking factor for tools side development at Oracle. In the worst
> > case, you'd have to maintain the patch in your own tree(s); I do
> > realize that you want to avoid that (as I would, but there are
> > examples of patches that we carry in our trees that didn't get
> > accepted into the community one - luckily they're of smaller size).
> 
> I think Oracle carrying this patch in their tree is probably the best
> approach for now.

Agreed.  We can always take a patch reserving hypercall numbers for now,
so there's no risk that an Oracle private patch will clash with an
upstream allocation later on.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:22:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdM2q-0000Te-43; Tue, 27 Nov 2012 14:21:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dietmar.hahn@ts.fujitsu.com>) id 1TdM2o-0000TV-75
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:21:50 +0000
Received: from [85.158.139.211:43189] by server-6.bemta-5.messagelabs.com id
	2F/99-19321-D7CC4B05; Tue, 27 Nov 2012 14:21:49 +0000
X-Env-Sender: dietmar.hahn@ts.fujitsu.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354026108!14078184!1
X-Originating-IP: [80.70.172.51]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuNzAuMTcyLjUxID0+IDE4ODU3OA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9531 invoked from network); 27 Nov 2012 14:21:48 -0000
Received: from dgate20.ts.fujitsu.com (HELO dgate20.ts.fujitsu.com)
	(80.70.172.51)
	by server-13.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 14:21:48 -0000
DomainKey-Signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns;
	h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV:
	Received:Received:From:To:Cc:Subject:Date:Message-ID:
	User-Agent:In-Reply-To:References:MIME-Version:
	Content-Transfer-Encoding:Content-Type;
	b=BRz8+1efolYrJb/EDYOPuNTfEK1GCFIdnWVKdLSaV47GO7X6yey/wult
	FK8mitxexnzJs1Q9DpHmzDooXHDHakrVB25D7lIBSlO99P/NJhpmSi85q
	5rPYnqQ83QMsyTiLP7JAYfa0lMy+3fm7qJNDSaURAUrOQfrwQPV055OPc
	ui53BS+d0RjQ53ChwZF5+JNjLGXEWVORYxDgSw8Eej8Dx2ZstqkB33z3P
	tuhusnDVJSNC+/65IV0NwJbFmgUf6;
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
	d=ts.fujitsu.com; i=@ts.fujitsu.com; q=dns/txt;
	s=s1536b; t=1354026109; x=1385562109;
	h=from:to:cc:subject:date:message-id:in-reply-to:
	references:mime-version:content-transfer-encoding;
	bh=yIg3ZU9pJk89SITGGmbHQ/De21Zv9lizXp9lLKp+/o8=;
	b=oYCHlOczSriCxRExufJhQyfMXX1LxY8gr57N7fqP/jkzygkF6KjAwYu8
	RHQQgU1cC5MEDI0uKtuYTIhpjIGYZG9YXKl2VNWfDPCON+eFX47FagIgG
	DYeQdHNtPDR+z6jfeoAC355SRSc+2o5z2Ow6dBq5f79c7L40OnfvM08sy
	5LdQwIoaXGDBfJBpEBjMNLKZHCwBz4o6NDq4FjV2IvXI0zzkZ9rSDSdBe
	SvL/mV38CYaT/rsNlM/Kt0n8bXtSb;
X-SBRSScore: None
X-IronPort-AV: E=Sophos;i="4.83,328,1352070000"; d="scan'208";a="109778704"
Received: from abgdgate30u.abg.fsc.net ([172.25.138.66])
	by dgate20u.abg.fsc.net with ESMTP; 27 Nov 2012 15:21:48 +0100
X-IronPort-AV: E=Sophos;i="4.83,328,1352070000"; d="scan'208";a="150305411"
Received: from sanpedro.mch.fsc.net ([172.17.20.6])
	by abgdgate30u.abg.fsc.net with SMTP; 27 Nov 2012 15:21:48 +0100
Received: from amur.localnet (amur.mch.fsc.net [10.172.102.19])
	by sanpedro.mch.fsc.net (Postfix) with ESMTP id 25DE496A770;
	Tue, 27 Nov 2012 15:21:48 +0100 (CET)
From: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
To: xen-devel@lists.xen.org
Date: Tue, 27 Nov 2012 15:21:47 +0100
Message-ID: <1883792.BQDJ6uZviQ@amur>
User-Agent: KMail/4.7.2 (Linux/3.1.10-1.16-xen; KDE/4.7.2; x86_64; ; )
In-Reply-To: <50B4CBF602000078000ABABB@nat28.tlf.novell.com>
References: <1449364.BXBucXMpuY@amur>
	<50B4C87402000078000ABA9F@nat28.tlf.novell.com>
	<50B4CBF602000078000ABABB@nat28.tlf.novell.com>
MIME-Version: 1.0
Cc: Donald D Dugger <donald.d.dugger@intel.com>,
	Jun Nakajima <jun.nakajima@intel.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] oprofile: Add X7542 and E7-8837 to the list
	of supported cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Am Dienstag 27 November 2012, 13:19:34 schrieb Jan Beulich:
> >>> On 27.11.12 at 14:04, "Jan Beulich" <JBeulich@suse.com> wrote:
> >>>> On 26.11.12 at 13:52, Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> wrote:
> >> Add intel cpus X7542 and E7-8837 to the list of supported cpus.
> >> 
> >> Thanks.
> >> Dietmar.
> >> 
> >> Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
> >> 
> >> diff -r 0049de3827bc -r 6fb0129600cd xen/arch/x86/oprofile/nmi_int.c
> >> --- a/xen/arch/x86/oprofile/nmi_int.c   Fri Nov 23 11:06:15 2012 +0000
> >> +++ b/xen/arch/x86/oprofile/nmi_int.c   Mon Nov 26 13:36:00 2012 +0100
> >> @@ -366,6 +366,8 @@ static int __init ppro_init(char ** cpu_
> >>                 ppro_has_global_ctrl = 1;
> >>                 break;
> >>         case 26:
> >> +       case 46:
> >> +       case 47:
> >>                 arch_perfmon_setup_counters();
> >>                 *cpu_type = "i386/core_i7";
> >>                 ppro_has_global_ctrl = 1;
> > 
> > Actually, and apart from the patch being white space damaged,
> > after a closer look I think this is wrong - these newer CPUs
> > shouldn't get be handled here, but instead should be covered by
> > arch_perfmon_init(). Are you observing X86_FEATURE_ARCH_PERFMON
> > not getting set on these CPUs by init_intel()?
> 
> I.e. the below would be the patch I'd expect when merely
> taking the SDM as reference (with the "todo remove?" ones
> also fully removed of course).

Yes, looks much cleaner.
Thanks.
Dietmar.

> 
> Jan
> 
> --- a/xen/arch/x86/oprofile/nmi_int.c
> +++ b/xen/arch/x86/oprofile/nmi_int.c
> @@ -342,30 +342,22 @@ static int __init ppro_init(char ** cpu_
>  		return 0;
>  
>  	switch (cpu_model) {
> -	case 0 ... 2:
> -		*cpu_type = "i386/ppro";
> -		break;
> -	case 3 ... 5:
> -		*cpu_type = "i386/pii";
> -		break;
> -	case 6 ... 8:
> -	case 10 ... 11:
> -		*cpu_type = "i386/piii";
> -		break;
> -	case 9:
> -	case 13:
> -		*cpu_type = "i386/p6_mobile";
> -		break;
>  	case 14:
>  		*cpu_type = "i386/core";
>  		break;
>  	case 15:
> +#if 0//todo remove?
>  	case 23:
>  	case 29:
> +#endif//todo
>  		*cpu_type = "i386/core_2";
>  		ppro_has_global_ctrl = 1;
>  		break;
> -	case 26:
> +#if 0//todo remove?
> +	/* Nehalem */
> +	case 26: case 30: case 31: case 46:
> +	/ Westmere */
> +	case 37: case 44: case 47:
>  		arch_perfmon_setup_counters();
>  		*cpu_type = "i386/core_i7";
>  		ppro_has_global_ctrl = 1;
> @@ -373,6 +365,7 @@ static int __init ppro_init(char ** cpu_
>  	case 28:
>  		*cpu_type = "i386/atom";
>  		break;
> +#endif//todo
>  	default:
>  		/* Unknown */
>  		return 0;
> @@ -389,6 +382,7 @@ static int __init arch_perfmon_init(char
>  	*cpu_type = "i386/arch_perfmon";
>  	model = &op_arch_perfmon_spec;
>  	arch_perfmon_setup_counters();
> +	ppro_has_global_ctrl = 1;
>  	return 1;
>  }
>  
> @@ -413,14 +407,8 @@ static int __init nmi_init(void)
>  				       "AMD processor family %d is not "
>  				       "supported\n", family);
>  				return -ENODEV;
> -			case 6:
> -				model = &op_athlon_spec;
> -				cpu_type = "i386/athlon";
> -				break;
>  			case 0xf:
>  				model = &op_athlon_spec;
> -				/* Actually it could be i386/hammer too, but
> -				   give user space an consistent name. */
>  				cpu_type = "x86-64/hammer";
>  				break;
>  			case 0x10:
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:22:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdM2q-0000Te-43; Tue, 27 Nov 2012 14:21:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dietmar.hahn@ts.fujitsu.com>) id 1TdM2o-0000TV-75
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:21:50 +0000
Received: from [85.158.139.211:43189] by server-6.bemta-5.messagelabs.com id
	2F/99-19321-D7CC4B05; Tue, 27 Nov 2012 14:21:49 +0000
X-Env-Sender: dietmar.hahn@ts.fujitsu.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354026108!14078184!1
X-Originating-IP: [80.70.172.51]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODAuNzAuMTcyLjUxID0+IDE4ODU3OA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9531 invoked from network); 27 Nov 2012 14:21:48 -0000
Received: from dgate20.ts.fujitsu.com (HELO dgate20.ts.fujitsu.com)
	(80.70.172.51)
	by server-13.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 14:21:48 -0000
DomainKey-Signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns;
	h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV:
	Received:Received:From:To:Cc:Subject:Date:Message-ID:
	User-Agent:In-Reply-To:References:MIME-Version:
	Content-Transfer-Encoding:Content-Type;
	b=BRz8+1efolYrJb/EDYOPuNTfEK1GCFIdnWVKdLSaV47GO7X6yey/wult
	FK8mitxexnzJs1Q9DpHmzDooXHDHakrVB25D7lIBSlO99P/NJhpmSi85q
	5rPYnqQ83QMsyTiLP7JAYfa0lMy+3fm7qJNDSaURAUrOQfrwQPV055OPc
	ui53BS+d0RjQ53ChwZF5+JNjLGXEWVORYxDgSw8Eej8Dx2ZstqkB33z3P
	tuhusnDVJSNC+/65IV0NwJbFmgUf6;
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
	d=ts.fujitsu.com; i=@ts.fujitsu.com; q=dns/txt;
	s=s1536b; t=1354026109; x=1385562109;
	h=from:to:cc:subject:date:message-id:in-reply-to:
	references:mime-version:content-transfer-encoding;
	bh=yIg3ZU9pJk89SITGGmbHQ/De21Zv9lizXp9lLKp+/o8=;
	b=oYCHlOczSriCxRExufJhQyfMXX1LxY8gr57N7fqP/jkzygkF6KjAwYu8
	RHQQgU1cC5MEDI0uKtuYTIhpjIGYZG9YXKl2VNWfDPCON+eFX47FagIgG
	DYeQdHNtPDR+z6jfeoAC355SRSc+2o5z2Ow6dBq5f79c7L40OnfvM08sy
	5LdQwIoaXGDBfJBpEBjMNLKZHCwBz4o6NDq4FjV2IvXI0zzkZ9rSDSdBe
	SvL/mV38CYaT/rsNlM/Kt0n8bXtSb;
X-SBRSScore: None
X-IronPort-AV: E=Sophos;i="4.83,328,1352070000"; d="scan'208";a="109778704"
Received: from abgdgate30u.abg.fsc.net ([172.25.138.66])
	by dgate20u.abg.fsc.net with ESMTP; 27 Nov 2012 15:21:48 +0100
X-IronPort-AV: E=Sophos;i="4.83,328,1352070000"; d="scan'208";a="150305411"
Received: from sanpedro.mch.fsc.net ([172.17.20.6])
	by abgdgate30u.abg.fsc.net with SMTP; 27 Nov 2012 15:21:48 +0100
Received: from amur.localnet (amur.mch.fsc.net [10.172.102.19])
	by sanpedro.mch.fsc.net (Postfix) with ESMTP id 25DE496A770;
	Tue, 27 Nov 2012 15:21:48 +0100 (CET)
From: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
To: xen-devel@lists.xen.org
Date: Tue, 27 Nov 2012 15:21:47 +0100
Message-ID: <1883792.BQDJ6uZviQ@amur>
User-Agent: KMail/4.7.2 (Linux/3.1.10-1.16-xen; KDE/4.7.2; x86_64; ; )
In-Reply-To: <50B4CBF602000078000ABABB@nat28.tlf.novell.com>
References: <1449364.BXBucXMpuY@amur>
	<50B4C87402000078000ABA9F@nat28.tlf.novell.com>
	<50B4CBF602000078000ABABB@nat28.tlf.novell.com>
MIME-Version: 1.0
Cc: Donald D Dugger <donald.d.dugger@intel.com>,
	Jun Nakajima <jun.nakajima@intel.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] oprofile: Add X7542 and E7-8837 to the list
	of supported cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Am Dienstag 27 November 2012, 13:19:34 schrieb Jan Beulich:
> >>> On 27.11.12 at 14:04, "Jan Beulich" <JBeulich@suse.com> wrote:
> >>>> On 26.11.12 at 13:52, Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> wrote:
> >> Add intel cpus X7542 and E7-8837 to the list of supported cpus.
> >> 
> >> Thanks.
> >> Dietmar.
> >> 
> >> Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
> >> 
> >> diff -r 0049de3827bc -r 6fb0129600cd xen/arch/x86/oprofile/nmi_int.c
> >> --- a/xen/arch/x86/oprofile/nmi_int.c   Fri Nov 23 11:06:15 2012 +0000
> >> +++ b/xen/arch/x86/oprofile/nmi_int.c   Mon Nov 26 13:36:00 2012 +0100
> >> @@ -366,6 +366,8 @@ static int __init ppro_init(char ** cpu_
> >>                 ppro_has_global_ctrl = 1;
> >>                 break;
> >>         case 26:
> >> +       case 46:
> >> +       case 47:
> >>                 arch_perfmon_setup_counters();
> >>                 *cpu_type = "i386/core_i7";
> >>                 ppro_has_global_ctrl = 1;
> > 
> > Actually, and apart from the patch being white space damaged,
> > after a closer look I think this is wrong - these newer CPUs
> > shouldn't get be handled here, but instead should be covered by
> > arch_perfmon_init(). Are you observing X86_FEATURE_ARCH_PERFMON
> > not getting set on these CPUs by init_intel()?
> 
> I.e. the below would be the patch I'd expect when merely
> taking the SDM as reference (with the "todo remove?" ones
> also fully removed of course).

Yes, looks much cleaner.
Thanks.
Dietmar.

> 
> Jan
> 
> --- a/xen/arch/x86/oprofile/nmi_int.c
> +++ b/xen/arch/x86/oprofile/nmi_int.c
> @@ -342,30 +342,22 @@ static int __init ppro_init(char ** cpu_
>  		return 0;
>  
>  	switch (cpu_model) {
> -	case 0 ... 2:
> -		*cpu_type = "i386/ppro";
> -		break;
> -	case 3 ... 5:
> -		*cpu_type = "i386/pii";
> -		break;
> -	case 6 ... 8:
> -	case 10 ... 11:
> -		*cpu_type = "i386/piii";
> -		break;
> -	case 9:
> -	case 13:
> -		*cpu_type = "i386/p6_mobile";
> -		break;
>  	case 14:
>  		*cpu_type = "i386/core";
>  		break;
>  	case 15:
> +#if 0//todo remove?
>  	case 23:
>  	case 29:
> +#endif//todo
>  		*cpu_type = "i386/core_2";
>  		ppro_has_global_ctrl = 1;
>  		break;
> -	case 26:
> +#if 0//todo remove?
> +	/* Nehalem */
> +	case 26: case 30: case 31: case 46:
> +	/ Westmere */
> +	case 37: case 44: case 47:
>  		arch_perfmon_setup_counters();
>  		*cpu_type = "i386/core_i7";
>  		ppro_has_global_ctrl = 1;
> @@ -373,6 +365,7 @@ static int __init ppro_init(char ** cpu_
>  	case 28:
>  		*cpu_type = "i386/atom";
>  		break;
> +#endif//todo
>  	default:
>  		/* Unknown */
>  		return 0;
> @@ -389,6 +382,7 @@ static int __init arch_perfmon_init(char
>  	*cpu_type = "i386/arch_perfmon";
>  	model = &op_arch_perfmon_spec;
>  	arch_perfmon_setup_counters();
> +	ppro_has_global_ctrl = 1;
>  	return 1;
>  }
>  
> @@ -413,14 +407,8 @@ static int __init nmi_init(void)
>  				       "AMD processor family %d is not "
>  				       "supported\n", family);
>  				return -ENODEV;
> -			case 6:
> -				model = &op_athlon_spec;
> -				cpu_type = "i386/athlon";
> -				break;
>  			case 0xf:
>  				model = &op_athlon_spec;
> -				/* Actually it could be i386/hammer too, but
> -				   give user space an consistent name. */
>  				cpu_type = "x86-64/hammer";
>  				break;
>  			case 0x10:
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:31:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:31:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMC7-0000x6-Cj; Tue, 27 Nov 2012 14:31:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TdMC6-0000wz-0U
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 14:31:26 +0000
Received: from [85.158.137.99:31152] by server-16.bemta-3.messagelabs.com id
	76/B1-07461-DBEC4B05; Tue, 27 Nov 2012 14:31:25 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1354026683!16027509!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21729 invoked from network); 27 Nov 2012 14:31:23 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-7.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 14:31:23 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TdMC1-000EKF-9r; Tue, 27 Nov 2012 14:31:21 +0000
Date: Tue, 27 Nov 2012 14:31:21 +0000
From: Tim Deegan <tim@xen.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121127143121.GC51942@ocelot.phlegethon.org>
References: <alpine.DEB.2.02.1211271212010.5310@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1211271240250.5310@kaball.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1211271240250.5310@kaball.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH v3] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 12:42 +0000 on 27 Nov (1354020121), Stefano Stabellini wrote:
> On Tue, 27 Nov 2012, Stefano Stabellini wrote:
> > +	.word (_end - _start)        /* zImage end address */
> 
> Actually the assembler has problems digesting this expression.
> This patch actually compiles:
> 
> ---
> 
> xen/arm: build as zImage
> 
> The zImage format is extremely simple: it only consists of a magic
> number and 2 addresses in a specific position (see
> http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
> 
> Some bootloaders expect a zImage; considering that it doesn't cost us
> much to build Xen compatible with the format, make it so.
> 
> Changes in v3:
> - pass the correct size;
> - go back to the original no-ops plus branch for consistency with Linux.
> 
> Changes in v2:
> - code style;
> - pass 0 a start address.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> index 25c4cfe..6cb5d1b 100644
> --- a/xen/arch/arm/head.S
> +++ b/xen/arch/arm/head.S
> @@ -22,6 +22,8 @@
>  #include <asm/processor-ca15.h>
>  #include <asm/asm_defns.h>
>  
> +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> +
>  #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
>  #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
>  #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
> @@ -52,6 +54,22 @@
>  	 * or the initial pagetable code below will need adjustment. */
>  	.global start
>  start:
> +
> +	/* zImage magic header, see:
> +	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
> +	 */
> +	.rept 7
> +	mov   r0, r0
> +	.endr
> +	mov   r0, r0

OK, with this changed to a .rept 8 and the singleton removed,
Acked-by: Tim Deegan <tim@xen.org>

> +	b     past_zImage
> +
> +	.word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
> +	.word 0x00000000             /* absolute load/run zImage address or
> +	                              * 0 for PiC */
> +	.word (_end - start)         /* zImage end address */
> +
> +past_zImage:
>  	cpsid aif                    /* Disable all interrupts */
>  
>  	/* Save the bootloader arguments in less-clobberable registers */
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:31:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:31:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMC7-0000x6-Cj; Tue, 27 Nov 2012 14:31:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TdMC6-0000wz-0U
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 14:31:26 +0000
Received: from [85.158.137.99:31152] by server-16.bemta-3.messagelabs.com id
	76/B1-07461-DBEC4B05; Tue, 27 Nov 2012 14:31:25 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1354026683!16027509!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21729 invoked from network); 27 Nov 2012 14:31:23 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-7.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 14:31:23 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TdMC1-000EKF-9r; Tue, 27 Nov 2012 14:31:21 +0000
Date: Tue, 27 Nov 2012 14:31:21 +0000
From: Tim Deegan <tim@xen.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121127143121.GC51942@ocelot.phlegethon.org>
References: <alpine.DEB.2.02.1211271212010.5310@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1211271240250.5310@kaball.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1211271240250.5310@kaball.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH v3] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 12:42 +0000 on 27 Nov (1354020121), Stefano Stabellini wrote:
> On Tue, 27 Nov 2012, Stefano Stabellini wrote:
> > +	.word (_end - _start)        /* zImage end address */
> 
> Actually the assembler has problems digesting this expression.
> This patch actually compiles:
> 
> ---
> 
> xen/arm: build as zImage
> 
> The zImage format is extremely simple: it only consists of a magic
> number and 2 addresses in a specific position (see
> http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
> 
> Some bootloaders expect a zImage; considering that it doesn't cost us
> much to build Xen compatible with the format, make it so.
> 
> Changes in v3:
> - pass the correct size;
> - go back to the original no-ops plus branch for consistency with Linux.
> 
> Changes in v2:
> - code style;
> - pass 0 a start address.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
> index 25c4cfe..6cb5d1b 100644
> --- a/xen/arch/arm/head.S
> +++ b/xen/arch/arm/head.S
> @@ -22,6 +22,8 @@
>  #include <asm/processor-ca15.h>
>  #include <asm/asm_defns.h>
>  
> +#define ZIMAGE_MAGIC_NUMBER 0x016f2818
> +
>  #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
>  #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
>  #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
> @@ -52,6 +54,22 @@
>  	 * or the initial pagetable code below will need adjustment. */
>  	.global start
>  start:
> +
> +	/* zImage magic header, see:
> +	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
> +	 */
> +	.rept 7
> +	mov   r0, r0
> +	.endr
> +	mov   r0, r0

OK, with this changed to a .rept 8 and the singleton removed,
Acked-by: Tim Deegan <tim@xen.org>

> +	b     past_zImage
> +
> +	.word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
> +	.word 0x00000000             /* absolute load/run zImage address or
> +	                              * 0 for PiC */
> +	.word (_end - start)         /* zImage end address */
> +
> +past_zImage:
>  	cpsid aif                    /* Disable all interrupts */
>  
>  	/* Save the bootloader arguments in less-clobberable registers */
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:38:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:38:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMJ7-0001AG-Av; Tue, 27 Nov 2012 14:38:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TdMJ4-0001A5-Rm
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:38:39 +0000
Received: from [85.158.139.83:17147] by server-2.bemta-5.messagelabs.com id
	BE/41-04892-E60D4B05; Tue, 27 Nov 2012 14:38:38 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-14.tower-182.messagelabs.com!1354027114!27857534!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20896 invoked from network); 27 Nov 2012 14:38:35 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-14.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 14:38:35 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158168608;
	Tue, 27 Nov 2012 09:38:29 -0500
Message-ID: <50B4D060.9070403@jhuapl.edu>
Date: Tue, 27 Nov 2012 09:38:24 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7445083734668621205=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============7445083734668621205==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms080701040502050304060506"

This is a cryptographically signed message in MIME format.

--------------ms080701040502050304060506
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

Daniel I just tried your patch and it didn't apply cleanly. The tpm=20
drivers have changed slightly from the original versions you are=20
probably working with. The vtpm domains have also changed.

Please pull the latest xen unstable and rebase your patches ontop of the =

tpm drivers there. You can apply my VTPM v4 patches in the mailing list=20
ontop of xen-unstable to test. It looks like everything except the=20
stubdoms and documentation is currently in xen-unstable.

On 11/20/2012 11:11 AM, Daniel De Graaf wrote:
> Since the vTPM implementations are being incorproated into Xen and
> possibly upstream Linux, I would like to see if this protocol change
> could be added before we have significant legacy implementations. If
> not, I still think it would be useful as either a v2 or negotiated
> protocol change.
>
> The current vTPM protocol is a copy of the network protocol. This was
> likely done for ease of implementation, since support for the network
> backend/frontend existed in Linux and minios. However, this
> implementation is overly complex when dealing with vTPM packets: for
> example, a vTPM never needs to deal with having more than one packet in=

> flight at any given time.
>
> I will send the corresponding patch for the Linux kernel module once I
> have adapted it for the file names used in the upstream version.
>
> ------------------------------------>8---------------------------------=
-
>
> This changes the vTPM shared page ABI from a copy of the Xen network
> interface to a single-page interface that better reflects the expected
> behavior of a TPM: only a single request packet can be sent at any give=
n
> time, and every packet sent generates a single response packet. This
> protocol change should also increase efficiency as it avoids mapping an=
d
> unmapping grants when possible.
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>   extras/mini-os/include/tpmback.h  |   1 +
>   extras/mini-os/include/tpmfront.h |   7 +-
>   extras/mini-os/tpmback.c          | 132 ++++++++++++++---------------=
----
>   extras/mini-os/tpmfront.c         | 150 +++++++++++++++++++----------=
---------
>   xen/include/public/io/tpmif.h     |  45 +++---------
>   5 files changed, 148 insertions(+), 187 deletions(-)
>
> diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/=
tpmback.h
> index ff86732..ec9eda4 100644
> --- a/extras/mini-os/include/tpmback.h
> +++ b/extras/mini-os/include/tpmback.h
> @@ -43,6 +43,7 @@
>
>   struct tpmcmd {
>      domid_t domid;              /* Domid of the frontend */
> +   uint8_t locality;    /* Locality requested by the frontend */
>      unsigned int handle;        /* Handle of the frontend */
>      unsigned char uuid[16];                     /* uuid of the tpm int=
erface */
>
> diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include=
/tpmfront.h
> index fd2cb17..a0c7c4d 100644
> --- a/extras/mini-os/include/tpmfront.h
> +++ b/extras/mini-os/include/tpmfront.h
> @@ -37,9 +37,7 @@ struct tpmfront_dev {
>      grant_ref_t ring_ref;
>      evtchn_port_t evtchn;
>
> -   tpmif_tx_interface_t* tx;
> -
> -   void** pages;
> +   vtpm_shared_page_t *page;
>
>      domid_t bedomid;
>      char* nodename;
> @@ -77,6 +75,9 @@ void shutdown_tpmfront(struct tpmfront_dev* dev);
>    * */
>   int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqle=
n, uint8_t** resp, size_t* resplen);
>
> +/* Set the locality used for communicating with a vTPM */
> +int tpmfront_set_locality(struct tpmfront_dev* dev, int locality);
> +
>   #ifdef HAVE_LIBC
>   #include <sys/stat.h>
>   /* POSIX IO functions:
> diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
> index 658fed1..29aced9 100644
> --- a/extras/mini-os/tpmback.c
> +++ b/extras/mini-os/tpmback.c
> @@ -86,10 +86,7 @@ struct tpmif {
>      evtchn_port_t evtchn;
>
>      /* Shared page */
> -   tpmif_tx_interface_t* tx;
> -
> -   /* pointer to TPMIF_RX_RING_SIZE pages */
> -   void** pages;
> +   vtpm_shared_page_t *page;
>
>      enum xenbus_state state;
>      enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
> @@ -386,8 +383,7 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigne=
d int handle)
>      tpmif->fe_state_path =3D NULL;
>      tpmif->state =3D XenbusStateInitialising;
>      tpmif->status =3D DISCONNECTED;
> -   tpmif->tx =3D NULL;
> -   tpmif->pages =3D NULL;
> +   tpmif->page =3D NULL;
>      tpmif->flags =3D 0;
>      memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
>      return tpmif;
> @@ -395,9 +391,6 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigne=
d int handle)
>
>   void __free_tpmif(tpmif_t* tpmif)
>   {
> -   if(tpmif->pages) {
> -      free(tpmif->pages);
> -   }
>      if(tpmif->fe_path) {
>         free(tpmif->fe_path);
>      }
> @@ -430,12 +423,6 @@ tpmif_t* new_tpmif(domid_t domid, unsigned int han=
dle)
>         goto error;
>      }
>
> -   /* allocate pages to be used for shared mapping */
> -   if((tpmif->pages =3D malloc(sizeof(void*) * TPMIF_TX_RING_SIZE)) =3D=
=3D NULL) {
> -      goto error;
> -   }
> -   memset(tpmif->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
> -
>      if(tpmif_change_state(tpmif, XenbusStateInitWait)) {
>         goto error;
>      }
> @@ -486,7 +473,7 @@ void free_tpmif(tpmif_t* tpmif)
>         tpmif->status =3D DISCONNECTING;
>         mask_evtchn(tpmif->evtchn);
>
> -      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1)) {
> +      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {=

>           TPMBACK_ERR("%u/%u Error occured while trying to unmap shared=
 page\n", (unsigned int) tpmif->domid, tpmif->handle);
>         }
>
> @@ -529,9 +516,10 @@ void free_tpmif(tpmif_t* tpmif)
>   void tpmback_handler(evtchn_port_t port, struct pt_regs *regs, void *=
data)
>   {
>      tpmif_t* tpmif =3D (tpmif_t*) data;
> -   tpmif_tx_request_t* tx =3D &tpmif->tx->ring[0].req;
> -   /* Throw away 0 size events, these can trigger from event channel u=
nmasking */
> -   if(tx->size =3D=3D 0)
> +   vtpm_shared_page_t* pg =3D tpmif->page;
> +
> +   /* Only pay attention if the request is ready */
> +   if (pg->state =3D=3D 0)
>         return;
>
>      TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->=
domid, tpmif->handle);
> @@ -585,11 +573,10 @@ int connect_fe(tpmif_t* tpmif)
>      free(value);
>
>      domid =3D tpmif->domid;
> -   if((tpmif->tx =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0,=
 &ringref, PROT_READ | PROT_WRITE)) =3D=3D NULL) {
> +   if((tpmif->page =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, =
0, &ringref, PROT_READ | PROT_WRITE)) =3D=3D NULL) {
>         TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned =
int) tpmif->domid, tpmif->handle);
>         return -1;
>      }
> -   memset(tpmif->tx, 0, PAGE_SIZE);
>
>      /*Bind the event channel */
>      if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler,=
 tpmif, &tpmif->evtchn)))
> @@ -618,10 +605,28 @@ error_post_evtchn:
>      mask_evtchn(tpmif->evtchn);
>      unbind_evtchn(tpmif->evtchn);
>   error_post_map:
> -   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1);
> +   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1);
>      return -1;
>   }
>
> +static void disconnect_fe(tpmif_t* tpmif)
> +{
> +   if (tpmif->status =3D=3D CONNECTED) {
> +      tpmif->status =3D DISCONNECTING;
> +      mask_evtchn(tpmif->evtchn);
> +
> +      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {=

> +        TPMBACK_ERR("%u/%u Error occured while trying to unmap shared =
page\n", (unsigned int) tpmif->domid, tpmif->handle);
> +      }
> +
> +      unbind_evtchn(tpmif->evtchn);
> +   }
> +   tpmif->status =3D DISCONNECTED;
> +   tpmif_change_state(tpmif, XenbusStateReconfigured);
> +
> +   TPMBACK_LOG("Frontend %u/%u disconnected\n", (unsigned int) tpmif->=
domid, tpmif->handle);
> +}
> +
>   static int frontend_changed(tpmif_t* tpmif)
>   {
>      int state =3D xenbus_read_integer(tpmif->fe_state_path);
> @@ -874,6 +879,7 @@ void shutdown_tpmback(void)
>   inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int=
 handle, unsigned char uuid[16])
>   {
>      tpmcmd->domid =3D domid;
> +   tpmcmd->locality =3D -1;
>      tpmcmd->handle =3D handle;
>      memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
>      tpmcmd->req =3D NULL;
> @@ -884,12 +890,12 @@ inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t=
 domid, unsigned int handle, un
>
>   tpmcmd_t* get_request(tpmif_t* tpmif) {
>      tpmcmd_t* cmd;
> -   tpmif_tx_request_t* tx;
> -   int offset;
> -   int tocopy;
> -   int i;
> -   uint32_t domid;
> +   vtpm_shared_page_t* shr;
> +   unsigned int offset;
>      int flags;
> +#ifdef TPMBACK_PRINT_DEBUG
> +int i;
> +#endif
>
>      local_irq_save(flags);
>
> @@ -899,35 +905,22 @@ tpmcmd_t* get_request(tpmif_t* tpmif) {
>      }
>      init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);
>
> -   tx =3D &tpmif->tx->ring[0].req;
> -   cmd->req_len =3D tx->size;
> +   shr =3D tpmif->page;
> +   cmd->req_len =3D shr->length;
> +   cmd->locality =3D shr->locality;
> +   offset =3D sizeof(*shr) + 4*shr->nr_extra_pages;
> +   if (offset > PAGE_SIZE || offset + cmd->req_len > PAGE_SIZE) {
> +      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (u=
nsigned int) tpmif->domid, tpmif->handle);
> +      goto error;
> +   }
>      /* Allocate the buffer */
>      if(cmd->req_len) {
>         if((cmd->req =3D malloc(cmd->req_len)) =3D=3D NULL) {
>           goto error;
>         }
>      }
> -   /* Copy the bits from the shared pages */
> -   offset =3D 0;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && offset < cmd->req_len; ++i) =
{
> -      tx =3D &tpmif->tx->ring[i].req;
> -
> -      /* Map the page with the data */
> -      domid =3D (uint32_t)tpmif->domid;
> -      if((tpmif->pages[i] =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &=
domid, 0, &tx->ref, PROT_READ)) =3D=3D NULL) {
> -        TPMBACK_ERR("%u/%u Unable to map shared page during read!\n", =
(unsigned int) tpmif->domid, tpmif->handle);
> -        goto error;
> -      }
> -
> -      /* do the copy now */
> -      tocopy =3D min(cmd->req_len - offset, PAGE_SIZE);
> -      memcpy(&cmd->req[offset], tpmif->pages[i], tocopy);
> -      offset +=3D tocopy;
> -
> -      /* release the page */
> -      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
> -
> -   }
> +   /* Copy the bits from the shared page(s) */
> +   memcpy(cmd->req, offset + (uint8_t*)shr, cmd->req_len);
>
>   #ifdef TPMBACK_PRINT_DEBUG
>      TPMBACK_DEBUG("Received Tpm Command from %u/%u of size %u", (unsig=
ned int) tpmif->domid, tpmif->handle, cmd->req_len);
> @@ -958,38 +951,24 @@ error:
>
>   void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
>   {
> -   tpmif_tx_request_t* tx;
> -   int offset;
> -   int i;
> -   uint32_t domid;
> -   int tocopy;
> +   vtpm_shared_page_t* shr;
> +   unsigned int offset;
>      int flags;
> +#ifdef TPMBACK_PRINT_DEBUG
> +int i;
> +#endif
>
>      local_irq_save(flags);
>
> -   tx =3D &tpmif->tx->ring[0].req;
> -   tx->size =3D cmd->resp_len;
> -
> -   offset =3D 0;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && offset < cmd->resp_len; ++i)=
 {
> -      tx =3D &tpmif->tx->ring[i].req;
> -
> -      /* Map the page with the data */
> -      domid =3D (uint32_t)tpmif->domid;
> -      if((tpmif->pages[i] =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &=
domid, 0, &tx->ref, PROT_WRITE)) =3D=3D NULL) {
> -        TPMBACK_ERR("%u/%u Unable to map shared page during write!\n",=
 (unsigned int) tpmif->domid, tpmif->handle);
> -        goto error;
> -      }
> -
> -      /* do the copy now */
> -      tocopy =3D min(cmd->resp_len - offset, PAGE_SIZE);
> -      memcpy(tpmif->pages[i], &cmd->resp[offset], tocopy);
> -      offset +=3D tocopy;
> -
> -      /* release the page */
> -      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
> +   shr =3D tpmif->page;
> +   shr->length =3D cmd->resp_len;
>
> +   offset =3D sizeof(*shr) + 4*shr->nr_extra_pages;
> +   if (offset > PAGE_SIZE || offset + cmd->resp_len > PAGE_SIZE) {
> +      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (u=
nsigned int) tpmif->domid, tpmif->handle);
> +      goto error;
>      }
> +   memcpy(offset + (uint8_t*)shr, cmd->resp, cmd->resp_len);
>
>   #ifdef TPMBACK_PRINT_DEBUG
>      TPMBACK_DEBUG("Sent response to %u/%u of size %u", (unsigned int) =
tpmif->domid, tpmif->handle, cmd->resp_len);
> @@ -1003,6 +982,7 @@ void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
>   #endif
>      /* clear the ready flag and send the event channel notice to the f=
rontend */
>      tpmif_req_finished(tpmif);
> +   shr->state =3D 0;
>      notify_remote_via_evtchn(tpmif->evtchn);
>   error:
>      local_irq_restore(flags);
> diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
> index 0218d7f..bcee93d 100644
> --- a/extras/mini-os/tpmfront.c
> +++ b/extras/mini-os/tpmfront.c
> @@ -153,6 +153,32 @@ static int wait_for_backend_closed(xenbus_event_qu=
eue* events, char* path)
>
>   }
>
> +static int wait_for_backend_reconfig(xenbus_event_queue* events, char*=
 path)
> +{
> +   int state;
> +
> +   TPMFRONT_LOG("Waiting for backend to reconfigure...\n");
> +   while(1) {
> +      state =3D xenbus_read_integer(path);
> +      if ( state < 0)
> +        state =3D XenbusStateUnknown;
> +      switch(state) {
> +        case XenbusStateUnknown:
> +           TPMFRONT_ERR("Backend Unknown state, forcing shutdown\n");
> +           return -1;
> +        case XenbusStateClosed:
> +           TPMFRONT_LOG("Backend Closed\n");
> +           return 0;
> +        case XenbusStateReconfigured:
> +           TPMFRONT_LOG("Backend Reconfigured\n");
> +           return 0;
> +        default:
> +           xenbus_wait_for_watch(events);
> +      }
> +   }
> +
> +}
> +
>   static int wait_for_backend_state_changed(struct tpmfront_dev* dev, X=
enbusState state) {
>      char* err;
>      int ret =3D 0;
> @@ -175,8 +201,11 @@ static int wait_for_backend_state_changed(struct t=
pmfront_dev* dev, XenbusState
>         case XenbusStateClosed:
>           ret =3D wait_for_backend_closed(&events, path);
>           break;
> -      default:
> +      case XenbusStateReconfigured:
> +        ret =3D wait_for_backend_reconfig(&events, path);
>           break;
> +      default:
> +         TPMFRONT_ERR("Bad wait state %d, ignoring\n", state);
>      }
>
>      if((err =3D xenbus_unwatch_path_token(XBT_NIL, path, path))) {
> @@ -190,13 +219,13 @@ static int tpmfront_connect(struct tpmfront_dev* =
dev)
>   {
>      char* err;
>      /* Create shared page */
> -   dev->tx =3D (tpmif_tx_interface_t*) alloc_page();
> -   if(dev->tx =3D=3D NULL) {
> +   dev->page =3D (vtpm_shared_page_t*) alloc_page();
> +   if(dev->page =3D=3D NULL) {
>         TPMFRONT_ERR("Unable to allocate page for shared memory\n");
>         goto error;
>      }
> -   memset(dev->tx, 0, PAGE_SIZE);
> -   dev->ring_ref =3D gnttab_grant_access(dev->bedomid, virt_to_mfn(dev=
->tx), 0);
> +   memset(dev->page, 0, PAGE_SIZE);
> +   dev->ring_ref =3D gnttab_grant_access(dev->bedomid, virt_to_mfn(dev=
->page), 0);
>      TPMFRONT_DEBUG("grant ref is %lu\n", (unsigned long) dev->ring_ref=
);
>
>      /*Create event channel */
> @@ -228,7 +257,7 @@ error_postevtchn:
>         unbind_evtchn(dev->evtchn);
>   error_postmap:
>         gnttab_end_access(dev->ring_ref);
> -      free_page(dev->tx);
> +      free_page(dev->page);
>   error:
>      return -1;
>   }
> @@ -240,7 +269,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nod=
ename)
>      char path[512];
>      char* value, *err;
>      unsigned long long ival;
> -   int i;
>
>      printk("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Init TPM Front =3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n");
>
> @@ -289,19 +317,6 @@ struct tpmfront_dev* init_tpmfront(const char* _no=
dename)
>         goto error;
>      }
>
> -   /* Allocate pages that will contain the messages */
> -   dev->pages =3D malloc(sizeof(void*) * TPMIF_TX_RING_SIZE);
> -   if(dev->pages =3D=3D NULL) {
> -      goto error;
> -   }
> -   memset(dev->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE; ++i) {
> -      dev->pages[i] =3D (void*)alloc_page();
> -      if(dev->pages[i] =3D=3D NULL) {
> -        goto error;
> -      }
> -   }
> -
>      TPMFRONT_LOG("Initialization Completed successfully\n");
>
>      return dev;
> @@ -314,12 +329,10 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>   {
>      char* err;
>      char path[512];
> -   int i;
> -   tpmif_tx_request_t* tx;
>      if(dev =3D=3D NULL) {
>         return;
>      }
> -   TPMFRONT_LOG("Shutting down tpmfront\n");
> +   TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for rec=
onfigure" : "");
>      /* disconnect */
>      if(dev->state =3D=3D XenbusStateConnected) {
>         dev->state =3D XenbusStateClosing;
> @@ -349,27 +362,12 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>         /* Wait for the backend to close and unmap shared pages, ignore=
 any errors */
>         wait_for_backend_state_changed(dev, XenbusStateClosed);
>
> -      /* Cleanup any shared pages */
> -      if(dev->pages) {
> -        for(i =3D 0; i < TPMIF_TX_RING_SIZE; ++i) {
> -           if(dev->pages[i]) {
> -              tx =3D &dev->tx->ring[i].req;
> -              if(tx->ref !=3D 0) {
> -                 gnttab_end_access(tx->ref);
> -              }
> -              free_page(dev->pages[i]);
> -           }
> -        }
> -        free(dev->pages);
> -      }
> -
>         /* Close event channel and unmap shared page */
>         mask_evtchn(dev->evtchn);
>         unbind_evtchn(dev->evtchn);
>         gnttab_end_access(dev->ring_ref);
>
> -      free_page(dev->tx);
> -
> +      free_page(dev->page);
>      }
>
>      /* Cleanup memory usage */
> @@ -387,13 +385,17 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>
>   int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_=
t length)
>   {
> -   int i;
> -   tpmif_tx_request_t* tx =3D NULL;
> +   unsigned int offset;
> +   vtpm_shared_page_t* shr =3D NULL;
> +#ifdef TPMFRONT_PRINT_DEBUG
> +int i;
> +#endif
>      /* Error Checking */
>      if(dev =3D=3D NULL || dev->state !=3D XenbusStateConnected) {
>         TPMFRONT_ERR("Tried to send message through disconnected fronte=
nd\n");
>         return -1;
>      }
> +   shr =3D dev->page;
>
>   #ifdef TPMFRONT_PRINT_DEBUG
>      TPMFRONT_DEBUG("Sending Msg to backend size=3D%u", (unsigned int) =
length);
> @@ -407,19 +409,16 @@ int tpmfront_send(struct tpmfront_dev* dev, const=
 uint8_t* msg, size_t length)
>   #endif
>
>      /* Copy to shared pages now */
> -   for(i =3D 0; length > 0 && i < TPMIF_TX_RING_SIZE; ++i) {
> -      /* Share the page */
> -      tx =3D &dev->tx->ring[i].req;
> -      tx->unused =3D 0;
> -      tx->addr =3D virt_to_mach(dev->pages[i]);
> -      tx->ref =3D gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->p=
ages[i]), 0);
> -      /* Copy the bits to the page */
> -      tx->size =3D length > PAGE_SIZE ? PAGE_SIZE : length;
> -      memcpy(dev->pages[i], &msg[i * PAGE_SIZE], tx->size);
> -
> -      /* Update counters */
> -      length -=3D tx->size;
> +   offset =3D sizeof(*shr);
> +   if (length + offset > PAGE_SIZE) {
> +      TPMFRONT_ERR("Message too long for shared page\n");
> +      return -1;
>      }
> +   memcpy(offset + (uint8_t*)shr, msg, length);
> +   shr->length =3D length;
> +   barrier();
> +   shr->state =3D 1;
> +
>      dev->waiting =3D 1;
>      dev->resplen =3D 0;
>   #ifdef HAVE_LIBC
> @@ -434,44 +433,41 @@ int tpmfront_send(struct tpmfront_dev* dev, const=
 uint8_t* msg, size_t length)
>   }
>   int tpmfront_recv(struct tpmfront_dev* dev, uint8_t** msg, size_t *le=
ngth)
>   {
> -   tpmif_tx_request_t* tx;
> -   int i;
> +   unsigned int offset;
> +   vtpm_shared_page_t* shr =3D NULL;
> +#ifdef TPMFRONT_PRINT_DEBUG
> +int i;
> +#endif
>      if(dev =3D=3D NULL || dev->state !=3D XenbusStateConnected) {
>         TPMFRONT_ERR("Tried to receive message from disconnected fronte=
nd\n");
>         return -1;
>      }
>      /*Wait for the response */
>      wait_event(dev->waitq, (!dev->waiting));
> +   shr =3D dev->page;
> +   if (shr->state !=3D 0)
> +      goto quit;
>
>      /* Initialize */
>      *msg =3D NULL;
> -   *length =3D 0;
> +   *length =3D shr->length;
> +   offset =3D sizeof(*shr);
>
> -   /* special case, just quit */
> -   tx =3D &dev->tx->ring[0].req;
> -   if(tx->size =3D=3D 0 ) {
> -       goto quit;
> -   }
> -   /* Get the total size */
> -   tx =3D &dev->tx->ring[0].req;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
> -      tx =3D &dev->tx->ring[i].req;
> -      *length +=3D tx->size;
> +   if (*length + offset > PAGE_SIZE) {
> +      TPMFRONT_ERR("Reply too long for shared page\n");
> +      return -1;
>      }
> +
>      /* Alloc the buffer */
>      if(dev->respbuf) {
>         free(dev->respbuf);
>      }
>      *msg =3D dev->respbuf =3D malloc(*length);
>      dev->resplen =3D *length;
> +
>      /* Copy the bits */
> -   tx =3D &dev->tx->ring[0].req;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
> -      tx =3D &dev->tx->ring[i].req;
> -      memcpy(&(*msg)[i * PAGE_SIZE], dev->pages[i], tx->size);
> -      gnttab_end_access(tx->ref);
> -      tx->ref =3D 0;
> -   }
> +   memcpy(*msg, offset + (uint8_t*)shr, *length);
> +
>   #ifdef TPMFRONT_PRINT_DEBUG
>      TPMFRONT_DEBUG("Received response from backend size=3D%u", (unsign=
ed int) *length);
>      for(i =3D 0; i < *length; ++i) {
> @@ -504,6 +500,14 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t=
* req, size_t reqlen, uint8_t*
>      return 0;
>   }
>
> +int tpmfront_set_locality(struct tpmfront_dev* dev, int locality)
> +{
> +   if (!dev || !dev->page)
> +      return -1;
> +   dev->page->locality =3D locality;
> +   return 0;
> +}
> +
>   #ifdef HAVE_LIBC
>   #include <errno.h>
>   int tpmfront_open(struct tpmfront_dev* dev)
> diff --git a/xen/include/public/io/tpmif.h b/xen/include/public/io/tpmi=
f.h
> index 02ccdab..afc9181 100644
> --- a/xen/include/public/io/tpmif.h
> +++ b/xen/include/public/io/tpmif.h
> @@ -1,7 +1,7 @@
>   /********************************************************************=
**********
>    * tpmif.h
>    *
> - * TPM I/O interface for Xen guest OSes.
> + * TPM I/O interface for Xen guest OSes, v2
>    *
>    * Permission is hereby granted, free of charge, to any person obtain=
ing a copy
>    * of this software and associated documentation files (the "Software=
"), to
> @@ -21,48 +21,23 @@
>    * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHE=
R
>    * DEALINGS IN THE SOFTWARE.
>    *
> - * Copyright (c) 2005, IBM Corporation
> - *
> - * Author: Stefan Berger, stefanb@us.ibm.com
> - * Grant table support: Mahadevan Gomathisankaran
> - *
> - * This code has been derived from tools/libxc/xen/io/netif.h
> - *
> - * Copyright (c) 2003-2004, Keir Fraser
>    */
>
>   #ifndef __XEN_PUBLIC_IO_TPMIF_H__
>   #define __XEN_PUBLIC_IO_TPMIF_H__
>
> -#include "../grant_table.h"
> +struct vtpm_shared_page {
> +    uint16_t length;         /* request/response length in bytes */
>
> -struct tpmif_tx_request {
> -    unsigned long addr;   /* Machine address of packet.   */
> -    grant_ref_t ref;      /* grant table access reference */
> -    uint16_t unused;
> -    uint16_t size;        /* Packet size in bytes.        */
> -};
> -typedef struct tpmif_tx_request tpmif_tx_request_t;
> -
> -/*
> - * The TPMIF_TX_RING_SIZE defines the number of pages the
> - * front-end and backend can exchange (=3D size of array).
> - */
> -typedef uint32_t TPMIF_RING_IDX;
> -
> -#define TPMIF_TX_RING_SIZE 1
> -
> -/* This structure must fit in a memory page. */
> -
> -struct tpmif_ring {
> -    struct tpmif_tx_request req;
> -};
> -typedef struct tpmif_ring tpmif_ring_t;
> +    uint8_t state;           /* 0 - response ready / idle
> +                              * 1 - request ready / working */
> +    uint8_t locality;        /* for the current request */
> +    uint8_t padding[3];
>
> -struct tpmif_tx_interface {
> -    struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
> +    uint8_t nr_extra_pages;  /* extra pages for long packets; may be z=
ero */
> +    uint32_t extra_pages[0]; /* grant IDs; length is actually nr_extra=
_pages */
>   };
> -typedef struct tpmif_tx_interface tpmif_tx_interface_t;
> +typedef struct vtpm_shared_page vtpm_shared_page_t;
>
>   #endif
>
> --
> 1.7.11.7
>



--------------ms080701040502050304060506
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlCwMBAQEBBAoWCGZpb3JhbWUxMBsGDSsGAQQBsyUL
AwEBAQIEChIIMDAxMDQyNjEwWAYJYIZIAYb6ax4BBEsMSVRoZSBwcml2YXRlIGtleSBjb3Jy
ZXNwb25kaW5nIHRvIHRoaXMgY2VydGlm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zPgTRrrtBvAsdGSY4oZ8OFZ
m97XsPeLaBgn7zbeEQYZ7zBjn8dMTynHewlQ7uQsMkllqj+ZXhJuYdWprJGwLc28WAAAAAAA
AA==
--------------ms080701040502050304060506--


--===============7445083734668621205==
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.xen.org
http://lists.xen.org/xen-devel

--===============7445083734668621205==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 14:38:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:38:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMJ7-0001AG-Av; Tue, 27 Nov 2012 14:38:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TdMJ4-0001A5-Rm
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:38:39 +0000
Received: from [85.158.139.83:17147] by server-2.bemta-5.messagelabs.com id
	BE/41-04892-E60D4B05; Tue, 27 Nov 2012 14:38:38 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-14.tower-182.messagelabs.com!1354027114!27857534!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20896 invoked from network); 27 Nov 2012 14:38:35 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-14.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 14:38:35 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158168608;
	Tue, 27 Nov 2012 09:38:29 -0500
Message-ID: <50B4D060.9070403@jhuapl.edu>
Date: Tue, 27 Nov 2012 09:38:24 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7445083734668621205=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============7445083734668621205==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms080701040502050304060506"

This is a cryptographically signed message in MIME format.

--------------ms080701040502050304060506
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

Daniel I just tried your patch and it didn't apply cleanly. The tpm=20
drivers have changed slightly from the original versions you are=20
probably working with. The vtpm domains have also changed.

Please pull the latest xen unstable and rebase your patches ontop of the =

tpm drivers there. You can apply my VTPM v4 patches in the mailing list=20
ontop of xen-unstable to test. It looks like everything except the=20
stubdoms and documentation is currently in xen-unstable.

On 11/20/2012 11:11 AM, Daniel De Graaf wrote:
> Since the vTPM implementations are being incorproated into Xen and
> possibly upstream Linux, I would like to see if this protocol change
> could be added before we have significant legacy implementations. If
> not, I still think it would be useful as either a v2 or negotiated
> protocol change.
>
> The current vTPM protocol is a copy of the network protocol. This was
> likely done for ease of implementation, since support for the network
> backend/frontend existed in Linux and minios. However, this
> implementation is overly complex when dealing with vTPM packets: for
> example, a vTPM never needs to deal with having more than one packet in=

> flight at any given time.
>
> I will send the corresponding patch for the Linux kernel module once I
> have adapted it for the file names used in the upstream version.
>
> ------------------------------------>8---------------------------------=
-
>
> This changes the vTPM shared page ABI from a copy of the Xen network
> interface to a single-page interface that better reflects the expected
> behavior of a TPM: only a single request packet can be sent at any give=
n
> time, and every packet sent generates a single response packet. This
> protocol change should also increase efficiency as it avoids mapping an=
d
> unmapping grants when possible.
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>   extras/mini-os/include/tpmback.h  |   1 +
>   extras/mini-os/include/tpmfront.h |   7 +-
>   extras/mini-os/tpmback.c          | 132 ++++++++++++++---------------=
----
>   extras/mini-os/tpmfront.c         | 150 +++++++++++++++++++----------=
---------
>   xen/include/public/io/tpmif.h     |  45 +++---------
>   5 files changed, 148 insertions(+), 187 deletions(-)
>
> diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/=
tpmback.h
> index ff86732..ec9eda4 100644
> --- a/extras/mini-os/include/tpmback.h
> +++ b/extras/mini-os/include/tpmback.h
> @@ -43,6 +43,7 @@
>
>   struct tpmcmd {
>      domid_t domid;              /* Domid of the frontend */
> +   uint8_t locality;    /* Locality requested by the frontend */
>      unsigned int handle;        /* Handle of the frontend */
>      unsigned char uuid[16];                     /* uuid of the tpm int=
erface */
>
> diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include=
/tpmfront.h
> index fd2cb17..a0c7c4d 100644
> --- a/extras/mini-os/include/tpmfront.h
> +++ b/extras/mini-os/include/tpmfront.h
> @@ -37,9 +37,7 @@ struct tpmfront_dev {
>      grant_ref_t ring_ref;
>      evtchn_port_t evtchn;
>
> -   tpmif_tx_interface_t* tx;
> -
> -   void** pages;
> +   vtpm_shared_page_t *page;
>
>      domid_t bedomid;
>      char* nodename;
> @@ -77,6 +75,9 @@ void shutdown_tpmfront(struct tpmfront_dev* dev);
>    * */
>   int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqle=
n, uint8_t** resp, size_t* resplen);
>
> +/* Set the locality used for communicating with a vTPM */
> +int tpmfront_set_locality(struct tpmfront_dev* dev, int locality);
> +
>   #ifdef HAVE_LIBC
>   #include <sys/stat.h>
>   /* POSIX IO functions:
> diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
> index 658fed1..29aced9 100644
> --- a/extras/mini-os/tpmback.c
> +++ b/extras/mini-os/tpmback.c
> @@ -86,10 +86,7 @@ struct tpmif {
>      evtchn_port_t evtchn;
>
>      /* Shared page */
> -   tpmif_tx_interface_t* tx;
> -
> -   /* pointer to TPMIF_RX_RING_SIZE pages */
> -   void** pages;
> +   vtpm_shared_page_t *page;
>
>      enum xenbus_state state;
>      enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
> @@ -386,8 +383,7 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigne=
d int handle)
>      tpmif->fe_state_path =3D NULL;
>      tpmif->state =3D XenbusStateInitialising;
>      tpmif->status =3D DISCONNECTED;
> -   tpmif->tx =3D NULL;
> -   tpmif->pages =3D NULL;
> +   tpmif->page =3D NULL;
>      tpmif->flags =3D 0;
>      memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
>      return tpmif;
> @@ -395,9 +391,6 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigne=
d int handle)
>
>   void __free_tpmif(tpmif_t* tpmif)
>   {
> -   if(tpmif->pages) {
> -      free(tpmif->pages);
> -   }
>      if(tpmif->fe_path) {
>         free(tpmif->fe_path);
>      }
> @@ -430,12 +423,6 @@ tpmif_t* new_tpmif(domid_t domid, unsigned int han=
dle)
>         goto error;
>      }
>
> -   /* allocate pages to be used for shared mapping */
> -   if((tpmif->pages =3D malloc(sizeof(void*) * TPMIF_TX_RING_SIZE)) =3D=
=3D NULL) {
> -      goto error;
> -   }
> -   memset(tpmif->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
> -
>      if(tpmif_change_state(tpmif, XenbusStateInitWait)) {
>         goto error;
>      }
> @@ -486,7 +473,7 @@ void free_tpmif(tpmif_t* tpmif)
>         tpmif->status =3D DISCONNECTING;
>         mask_evtchn(tpmif->evtchn);
>
> -      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1)) {
> +      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {=

>           TPMBACK_ERR("%u/%u Error occured while trying to unmap shared=
 page\n", (unsigned int) tpmif->domid, tpmif->handle);
>         }
>
> @@ -529,9 +516,10 @@ void free_tpmif(tpmif_t* tpmif)
>   void tpmback_handler(evtchn_port_t port, struct pt_regs *regs, void *=
data)
>   {
>      tpmif_t* tpmif =3D (tpmif_t*) data;
> -   tpmif_tx_request_t* tx =3D &tpmif->tx->ring[0].req;
> -   /* Throw away 0 size events, these can trigger from event channel u=
nmasking */
> -   if(tx->size =3D=3D 0)
> +   vtpm_shared_page_t* pg =3D tpmif->page;
> +
> +   /* Only pay attention if the request is ready */
> +   if (pg->state =3D=3D 0)
>         return;
>
>      TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->=
domid, tpmif->handle);
> @@ -585,11 +573,10 @@ int connect_fe(tpmif_t* tpmif)
>      free(value);
>
>      domid =3D tpmif->domid;
> -   if((tpmif->tx =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0,=
 &ringref, PROT_READ | PROT_WRITE)) =3D=3D NULL) {
> +   if((tpmif->page =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, =
0, &ringref, PROT_READ | PROT_WRITE)) =3D=3D NULL) {
>         TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned =
int) tpmif->domid, tpmif->handle);
>         return -1;
>      }
> -   memset(tpmif->tx, 0, PAGE_SIZE);
>
>      /*Bind the event channel */
>      if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler,=
 tpmif, &tpmif->evtchn)))
> @@ -618,10 +605,28 @@ error_post_evtchn:
>      mask_evtchn(tpmif->evtchn);
>      unbind_evtchn(tpmif->evtchn);
>   error_post_map:
> -   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1);
> +   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1);
>      return -1;
>   }
>
> +static void disconnect_fe(tpmif_t* tpmif)
> +{
> +   if (tpmif->status =3D=3D CONNECTED) {
> +      tpmif->status =3D DISCONNECTING;
> +      mask_evtchn(tpmif->evtchn);
> +
> +      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {=

> +        TPMBACK_ERR("%u/%u Error occured while trying to unmap shared =
page\n", (unsigned int) tpmif->domid, tpmif->handle);
> +      }
> +
> +      unbind_evtchn(tpmif->evtchn);
> +   }
> +   tpmif->status =3D DISCONNECTED;
> +   tpmif_change_state(tpmif, XenbusStateReconfigured);
> +
> +   TPMBACK_LOG("Frontend %u/%u disconnected\n", (unsigned int) tpmif->=
domid, tpmif->handle);
> +}
> +
>   static int frontend_changed(tpmif_t* tpmif)
>   {
>      int state =3D xenbus_read_integer(tpmif->fe_state_path);
> @@ -874,6 +879,7 @@ void shutdown_tpmback(void)
>   inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int=
 handle, unsigned char uuid[16])
>   {
>      tpmcmd->domid =3D domid;
> +   tpmcmd->locality =3D -1;
>      tpmcmd->handle =3D handle;
>      memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
>      tpmcmd->req =3D NULL;
> @@ -884,12 +890,12 @@ inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t=
 domid, unsigned int handle, un
>
>   tpmcmd_t* get_request(tpmif_t* tpmif) {
>      tpmcmd_t* cmd;
> -   tpmif_tx_request_t* tx;
> -   int offset;
> -   int tocopy;
> -   int i;
> -   uint32_t domid;
> +   vtpm_shared_page_t* shr;
> +   unsigned int offset;
>      int flags;
> +#ifdef TPMBACK_PRINT_DEBUG
> +int i;
> +#endif
>
>      local_irq_save(flags);
>
> @@ -899,35 +905,22 @@ tpmcmd_t* get_request(tpmif_t* tpmif) {
>      }
>      init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);
>
> -   tx =3D &tpmif->tx->ring[0].req;
> -   cmd->req_len =3D tx->size;
> +   shr =3D tpmif->page;
> +   cmd->req_len =3D shr->length;
> +   cmd->locality =3D shr->locality;
> +   offset =3D sizeof(*shr) + 4*shr->nr_extra_pages;
> +   if (offset > PAGE_SIZE || offset + cmd->req_len > PAGE_SIZE) {
> +      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (u=
nsigned int) tpmif->domid, tpmif->handle);
> +      goto error;
> +   }
>      /* Allocate the buffer */
>      if(cmd->req_len) {
>         if((cmd->req =3D malloc(cmd->req_len)) =3D=3D NULL) {
>           goto error;
>         }
>      }
> -   /* Copy the bits from the shared pages */
> -   offset =3D 0;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && offset < cmd->req_len; ++i) =
{
> -      tx =3D &tpmif->tx->ring[i].req;
> -
> -      /* Map the page with the data */
> -      domid =3D (uint32_t)tpmif->domid;
> -      if((tpmif->pages[i] =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &=
domid, 0, &tx->ref, PROT_READ)) =3D=3D NULL) {
> -        TPMBACK_ERR("%u/%u Unable to map shared page during read!\n", =
(unsigned int) tpmif->domid, tpmif->handle);
> -        goto error;
> -      }
> -
> -      /* do the copy now */
> -      tocopy =3D min(cmd->req_len - offset, PAGE_SIZE);
> -      memcpy(&cmd->req[offset], tpmif->pages[i], tocopy);
> -      offset +=3D tocopy;
> -
> -      /* release the page */
> -      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
> -
> -   }
> +   /* Copy the bits from the shared page(s) */
> +   memcpy(cmd->req, offset + (uint8_t*)shr, cmd->req_len);
>
>   #ifdef TPMBACK_PRINT_DEBUG
>      TPMBACK_DEBUG("Received Tpm Command from %u/%u of size %u", (unsig=
ned int) tpmif->domid, tpmif->handle, cmd->req_len);
> @@ -958,38 +951,24 @@ error:
>
>   void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
>   {
> -   tpmif_tx_request_t* tx;
> -   int offset;
> -   int i;
> -   uint32_t domid;
> -   int tocopy;
> +   vtpm_shared_page_t* shr;
> +   unsigned int offset;
>      int flags;
> +#ifdef TPMBACK_PRINT_DEBUG
> +int i;
> +#endif
>
>      local_irq_save(flags);
>
> -   tx =3D &tpmif->tx->ring[0].req;
> -   tx->size =3D cmd->resp_len;
> -
> -   offset =3D 0;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && offset < cmd->resp_len; ++i)=
 {
> -      tx =3D &tpmif->tx->ring[i].req;
> -
> -      /* Map the page with the data */
> -      domid =3D (uint32_t)tpmif->domid;
> -      if((tpmif->pages[i] =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &=
domid, 0, &tx->ref, PROT_WRITE)) =3D=3D NULL) {
> -        TPMBACK_ERR("%u/%u Unable to map shared page during write!\n",=
 (unsigned int) tpmif->domid, tpmif->handle);
> -        goto error;
> -      }
> -
> -      /* do the copy now */
> -      tocopy =3D min(cmd->resp_len - offset, PAGE_SIZE);
> -      memcpy(tpmif->pages[i], &cmd->resp[offset], tocopy);
> -      offset +=3D tocopy;
> -
> -      /* release the page */
> -      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
> +   shr =3D tpmif->page;
> +   shr->length =3D cmd->resp_len;
>
> +   offset =3D sizeof(*shr) + 4*shr->nr_extra_pages;
> +   if (offset > PAGE_SIZE || offset + cmd->resp_len > PAGE_SIZE) {
> +      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (u=
nsigned int) tpmif->domid, tpmif->handle);
> +      goto error;
>      }
> +   memcpy(offset + (uint8_t*)shr, cmd->resp, cmd->resp_len);
>
>   #ifdef TPMBACK_PRINT_DEBUG
>      TPMBACK_DEBUG("Sent response to %u/%u of size %u", (unsigned int) =
tpmif->domid, tpmif->handle, cmd->resp_len);
> @@ -1003,6 +982,7 @@ void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
>   #endif
>      /* clear the ready flag and send the event channel notice to the f=
rontend */
>      tpmif_req_finished(tpmif);
> +   shr->state =3D 0;
>      notify_remote_via_evtchn(tpmif->evtchn);
>   error:
>      local_irq_restore(flags);
> diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
> index 0218d7f..bcee93d 100644
> --- a/extras/mini-os/tpmfront.c
> +++ b/extras/mini-os/tpmfront.c
> @@ -153,6 +153,32 @@ static int wait_for_backend_closed(xenbus_event_qu=
eue* events, char* path)
>
>   }
>
> +static int wait_for_backend_reconfig(xenbus_event_queue* events, char*=
 path)
> +{
> +   int state;
> +
> +   TPMFRONT_LOG("Waiting for backend to reconfigure...\n");
> +   while(1) {
> +      state =3D xenbus_read_integer(path);
> +      if ( state < 0)
> +        state =3D XenbusStateUnknown;
> +      switch(state) {
> +        case XenbusStateUnknown:
> +           TPMFRONT_ERR("Backend Unknown state, forcing shutdown\n");
> +           return -1;
> +        case XenbusStateClosed:
> +           TPMFRONT_LOG("Backend Closed\n");
> +           return 0;
> +        case XenbusStateReconfigured:
> +           TPMFRONT_LOG("Backend Reconfigured\n");
> +           return 0;
> +        default:
> +           xenbus_wait_for_watch(events);
> +      }
> +   }
> +
> +}
> +
>   static int wait_for_backend_state_changed(struct tpmfront_dev* dev, X=
enbusState state) {
>      char* err;
>      int ret =3D 0;
> @@ -175,8 +201,11 @@ static int wait_for_backend_state_changed(struct t=
pmfront_dev* dev, XenbusState
>         case XenbusStateClosed:
>           ret =3D wait_for_backend_closed(&events, path);
>           break;
> -      default:
> +      case XenbusStateReconfigured:
> +        ret =3D wait_for_backend_reconfig(&events, path);
>           break;
> +      default:
> +         TPMFRONT_ERR("Bad wait state %d, ignoring\n", state);
>      }
>
>      if((err =3D xenbus_unwatch_path_token(XBT_NIL, path, path))) {
> @@ -190,13 +219,13 @@ static int tpmfront_connect(struct tpmfront_dev* =
dev)
>   {
>      char* err;
>      /* Create shared page */
> -   dev->tx =3D (tpmif_tx_interface_t*) alloc_page();
> -   if(dev->tx =3D=3D NULL) {
> +   dev->page =3D (vtpm_shared_page_t*) alloc_page();
> +   if(dev->page =3D=3D NULL) {
>         TPMFRONT_ERR("Unable to allocate page for shared memory\n");
>         goto error;
>      }
> -   memset(dev->tx, 0, PAGE_SIZE);
> -   dev->ring_ref =3D gnttab_grant_access(dev->bedomid, virt_to_mfn(dev=
->tx), 0);
> +   memset(dev->page, 0, PAGE_SIZE);
> +   dev->ring_ref =3D gnttab_grant_access(dev->bedomid, virt_to_mfn(dev=
->page), 0);
>      TPMFRONT_DEBUG("grant ref is %lu\n", (unsigned long) dev->ring_ref=
);
>
>      /*Create event channel */
> @@ -228,7 +257,7 @@ error_postevtchn:
>         unbind_evtchn(dev->evtchn);
>   error_postmap:
>         gnttab_end_access(dev->ring_ref);
> -      free_page(dev->tx);
> +      free_page(dev->page);
>   error:
>      return -1;
>   }
> @@ -240,7 +269,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nod=
ename)
>      char path[512];
>      char* value, *err;
>      unsigned long long ival;
> -   int i;
>
>      printk("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Init TPM Front =3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n");
>
> @@ -289,19 +317,6 @@ struct tpmfront_dev* init_tpmfront(const char* _no=
dename)
>         goto error;
>      }
>
> -   /* Allocate pages that will contain the messages */
> -   dev->pages =3D malloc(sizeof(void*) * TPMIF_TX_RING_SIZE);
> -   if(dev->pages =3D=3D NULL) {
> -      goto error;
> -   }
> -   memset(dev->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE; ++i) {
> -      dev->pages[i] =3D (void*)alloc_page();
> -      if(dev->pages[i] =3D=3D NULL) {
> -        goto error;
> -      }
> -   }
> -
>      TPMFRONT_LOG("Initialization Completed successfully\n");
>
>      return dev;
> @@ -314,12 +329,10 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>   {
>      char* err;
>      char path[512];
> -   int i;
> -   tpmif_tx_request_t* tx;
>      if(dev =3D=3D NULL) {
>         return;
>      }
> -   TPMFRONT_LOG("Shutting down tpmfront\n");
> +   TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for rec=
onfigure" : "");
>      /* disconnect */
>      if(dev->state =3D=3D XenbusStateConnected) {
>         dev->state =3D XenbusStateClosing;
> @@ -349,27 +362,12 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>         /* Wait for the backend to close and unmap shared pages, ignore=
 any errors */
>         wait_for_backend_state_changed(dev, XenbusStateClosed);
>
> -      /* Cleanup any shared pages */
> -      if(dev->pages) {
> -        for(i =3D 0; i < TPMIF_TX_RING_SIZE; ++i) {
> -           if(dev->pages[i]) {
> -              tx =3D &dev->tx->ring[i].req;
> -              if(tx->ref !=3D 0) {
> -                 gnttab_end_access(tx->ref);
> -              }
> -              free_page(dev->pages[i]);
> -           }
> -        }
> -        free(dev->pages);
> -      }
> -
>         /* Close event channel and unmap shared page */
>         mask_evtchn(dev->evtchn);
>         unbind_evtchn(dev->evtchn);
>         gnttab_end_access(dev->ring_ref);
>
> -      free_page(dev->tx);
> -
> +      free_page(dev->page);
>      }
>
>      /* Cleanup memory usage */
> @@ -387,13 +385,17 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>
>   int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_=
t length)
>   {
> -   int i;
> -   tpmif_tx_request_t* tx =3D NULL;
> +   unsigned int offset;
> +   vtpm_shared_page_t* shr =3D NULL;
> +#ifdef TPMFRONT_PRINT_DEBUG
> +int i;
> +#endif
>      /* Error Checking */
>      if(dev =3D=3D NULL || dev->state !=3D XenbusStateConnected) {
>         TPMFRONT_ERR("Tried to send message through disconnected fronte=
nd\n");
>         return -1;
>      }
> +   shr =3D dev->page;
>
>   #ifdef TPMFRONT_PRINT_DEBUG
>      TPMFRONT_DEBUG("Sending Msg to backend size=3D%u", (unsigned int) =
length);
> @@ -407,19 +409,16 @@ int tpmfront_send(struct tpmfront_dev* dev, const=
 uint8_t* msg, size_t length)
>   #endif
>
>      /* Copy to shared pages now */
> -   for(i =3D 0; length > 0 && i < TPMIF_TX_RING_SIZE; ++i) {
> -      /* Share the page */
> -      tx =3D &dev->tx->ring[i].req;
> -      tx->unused =3D 0;
> -      tx->addr =3D virt_to_mach(dev->pages[i]);
> -      tx->ref =3D gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->p=
ages[i]), 0);
> -      /* Copy the bits to the page */
> -      tx->size =3D length > PAGE_SIZE ? PAGE_SIZE : length;
> -      memcpy(dev->pages[i], &msg[i * PAGE_SIZE], tx->size);
> -
> -      /* Update counters */
> -      length -=3D tx->size;
> +   offset =3D sizeof(*shr);
> +   if (length + offset > PAGE_SIZE) {
> +      TPMFRONT_ERR("Message too long for shared page\n");
> +      return -1;
>      }
> +   memcpy(offset + (uint8_t*)shr, msg, length);
> +   shr->length =3D length;
> +   barrier();
> +   shr->state =3D 1;
> +
>      dev->waiting =3D 1;
>      dev->resplen =3D 0;
>   #ifdef HAVE_LIBC
> @@ -434,44 +433,41 @@ int tpmfront_send(struct tpmfront_dev* dev, const=
 uint8_t* msg, size_t length)
>   }
>   int tpmfront_recv(struct tpmfront_dev* dev, uint8_t** msg, size_t *le=
ngth)
>   {
> -   tpmif_tx_request_t* tx;
> -   int i;
> +   unsigned int offset;
> +   vtpm_shared_page_t* shr =3D NULL;
> +#ifdef TPMFRONT_PRINT_DEBUG
> +int i;
> +#endif
>      if(dev =3D=3D NULL || dev->state !=3D XenbusStateConnected) {
>         TPMFRONT_ERR("Tried to receive message from disconnected fronte=
nd\n");
>         return -1;
>      }
>      /*Wait for the response */
>      wait_event(dev->waitq, (!dev->waiting));
> +   shr =3D dev->page;
> +   if (shr->state !=3D 0)
> +      goto quit;
>
>      /* Initialize */
>      *msg =3D NULL;
> -   *length =3D 0;
> +   *length =3D shr->length;
> +   offset =3D sizeof(*shr);
>
> -   /* special case, just quit */
> -   tx =3D &dev->tx->ring[0].req;
> -   if(tx->size =3D=3D 0 ) {
> -       goto quit;
> -   }
> -   /* Get the total size */
> -   tx =3D &dev->tx->ring[0].req;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
> -      tx =3D &dev->tx->ring[i].req;
> -      *length +=3D tx->size;
> +   if (*length + offset > PAGE_SIZE) {
> +      TPMFRONT_ERR("Reply too long for shared page\n");
> +      return -1;
>      }
> +
>      /* Alloc the buffer */
>      if(dev->respbuf) {
>         free(dev->respbuf);
>      }
>      *msg =3D dev->respbuf =3D malloc(*length);
>      dev->resplen =3D *length;
> +
>      /* Copy the bits */
> -   tx =3D &dev->tx->ring[0].req;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
> -      tx =3D &dev->tx->ring[i].req;
> -      memcpy(&(*msg)[i * PAGE_SIZE], dev->pages[i], tx->size);
> -      gnttab_end_access(tx->ref);
> -      tx->ref =3D 0;
> -   }
> +   memcpy(*msg, offset + (uint8_t*)shr, *length);
> +
>   #ifdef TPMFRONT_PRINT_DEBUG
>      TPMFRONT_DEBUG("Received response from backend size=3D%u", (unsign=
ed int) *length);
>      for(i =3D 0; i < *length; ++i) {
> @@ -504,6 +500,14 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t=
* req, size_t reqlen, uint8_t*
>      return 0;
>   }
>
> +int tpmfront_set_locality(struct tpmfront_dev* dev, int locality)
> +{
> +   if (!dev || !dev->page)
> +      return -1;
> +   dev->page->locality =3D locality;
> +   return 0;
> +}
> +
>   #ifdef HAVE_LIBC
>   #include <errno.h>
>   int tpmfront_open(struct tpmfront_dev* dev)
> diff --git a/xen/include/public/io/tpmif.h b/xen/include/public/io/tpmi=
f.h
> index 02ccdab..afc9181 100644
> --- a/xen/include/public/io/tpmif.h
> +++ b/xen/include/public/io/tpmif.h
> @@ -1,7 +1,7 @@
>   /********************************************************************=
**********
>    * tpmif.h
>    *
> - * TPM I/O interface for Xen guest OSes.
> + * TPM I/O interface for Xen guest OSes, v2
>    *
>    * Permission is hereby granted, free of charge, to any person obtain=
ing a copy
>    * of this software and associated documentation files (the "Software=
"), to
> @@ -21,48 +21,23 @@
>    * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHE=
R
>    * DEALINGS IN THE SOFTWARE.
>    *
> - * Copyright (c) 2005, IBM Corporation
> - *
> - * Author: Stefan Berger, stefanb@us.ibm.com
> - * Grant table support: Mahadevan Gomathisankaran
> - *
> - * This code has been derived from tools/libxc/xen/io/netif.h
> - *
> - * Copyright (c) 2003-2004, Keir Fraser
>    */
>
>   #ifndef __XEN_PUBLIC_IO_TPMIF_H__
>   #define __XEN_PUBLIC_IO_TPMIF_H__
>
> -#include "../grant_table.h"
> +struct vtpm_shared_page {
> +    uint16_t length;         /* request/response length in bytes */
>
> -struct tpmif_tx_request {
> -    unsigned long addr;   /* Machine address of packet.   */
> -    grant_ref_t ref;      /* grant table access reference */
> -    uint16_t unused;
> -    uint16_t size;        /* Packet size in bytes.        */
> -};
> -typedef struct tpmif_tx_request tpmif_tx_request_t;
> -
> -/*
> - * The TPMIF_TX_RING_SIZE defines the number of pages the
> - * front-end and backend can exchange (=3D size of array).
> - */
> -typedef uint32_t TPMIF_RING_IDX;
> -
> -#define TPMIF_TX_RING_SIZE 1
> -
> -/* This structure must fit in a memory page. */
> -
> -struct tpmif_ring {
> -    struct tpmif_tx_request req;
> -};
> -typedef struct tpmif_ring tpmif_ring_t;
> +    uint8_t state;           /* 0 - response ready / idle
> +                              * 1 - request ready / working */
> +    uint8_t locality;        /* for the current request */
> +    uint8_t padding[3];
>
> -struct tpmif_tx_interface {
> -    struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
> +    uint8_t nr_extra_pages;  /* extra pages for long packets; may be z=
ero */
> +    uint32_t extra_pages[0]; /* grant IDs; length is actually nr_extra=
_pages */
>   };
> -typedef struct tpmif_tx_interface tpmif_tx_interface_t;
> +typedef struct vtpm_shared_page vtpm_shared_page_t;
>
>   #endif
>
> --
> 1.7.11.7
>



--------------ms080701040502050304060506
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD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NAQkFMQ8XDTEyMTEyNzE0MzgyNFowIwYJKoZIhvcNAQkEMRYEFKClLuMwB+zzay7B
Mfz1VxNBDn/kMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAJfnpGIQIX/TMfGk/2FU8N8ml2mem6Uj9b
Hd+fUP3TX+yFHyEHiIxKa5m8wQWDZ7NHeKO7scPeunuBkUEwJzPgTRrrtBvAsdGSY4oZ8OFZ
m97XsPeLaBgn7zbeEQYZ7zBjn8dMTynHewlQ7uQsMkllqj+ZXhJuYdWprJGwLc28WAAAAAAA
AA==
--------------ms080701040502050304060506--


--===============7445083734668621205==
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.xen.org
http://lists.xen.org/xen-devel

--===============7445083734668621205==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 14:39:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:39:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMJP-0001C7-V9; Tue, 27 Nov 2012 14:38:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TdMJO-0001Bq-DF
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:38:58 +0000
Received: from [85.158.143.35:27029] by server-1.bemta-4.messagelabs.com id
	E9/E4-27934-180D4B05; Tue, 27 Nov 2012 14:38:57 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1354027135!11267356!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzgyNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25671 invoked from network); 27 Nov 2012 14:38:57 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-11.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 14:38:57 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAREcoK4029176
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 27 Nov 2012 14:38:51 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAREcnYs004122
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 27 Nov 2012 14:38:50 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAREcn8P000958; Tue, 27 Nov 2012 08:38:49 -0600
MIME-Version: 1.0
Message-ID: <4e524dad-b67a-4115-b0fd-72f9b372abf1@default>
Date: Tue, 27 Nov 2012 06:38:47 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
References: <38a09df7-3d82-403f-9153-9a151b220a41@default>
	<50B48C8A02000078000AB851@nat28.tlf.novell.com>
	<1354012308.5830.175.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354012308.5830.175.camel@zakaz.uk.xensource.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, xen-devel@lists.xen.org,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> Sent: Tuesday, November 27, 2012 3:32 AM
> To: Jan Beulich
> Cc: Dan Magenheimer; George Dunlap; Ian Jackson; xen-devel@lists.xen.org; Konrad Wilk; Zhigang Wang;
> Keir (Xen.org); Tim (Xen.org)
> Subject: Re: Please ack XENMEM_claim_pages hypercall?

Hi Ian --
 
> I'm also a little surprised that this patch is being so aggressively
> pushed upstream when the toolstack work which would use it is seemingly
> not fully formed yet.

The deficiency in the Oracle toolstack has been known for years
and this solution has been discussed and approved at the VP level.
 
> Anyway, it seems to me that this argument seems to me to be starting
> from the wrong end, it starts from the hypercall and tries to justify it
> based on requirements imposed by an toolstack which is presented as
> something of a fixed black box from the xen-devel point of view, which
> is not something I find particularly convincing.

I fully recognize that the existence of the black box is annoying.
But the argument began not with a hypercall but with a real
customer problem.  The early discussion, in which others suggested
"change your toolstack", uncovered a rather dramatic paradigm
difference that re-emphasized the need for the hypercall.
See below.

> So a possible alternative to Oracle carrying this patch long term is
> that someone who understands Oracle's toolstack's requirements and
> constraints takes over from Dan (who I think has said several times that
> he is not familiar with all the details of the Oracle toolstack) as
> advocate for finding a solution to the underlying issue here and can
> engage xen-devel in a discussion about the design decisions involved
> from the toolstack downwards. Either this leads to the proposed solution
> in the hypervisor (or something similar) or it results in a completely
> different solution which everyone is happy with (or I suppose it might
> still end up with Oracle carrying this patch long term).

>From a single-system-xl-toolstack-centric perspective ("paradigm"),
I can see your point.  This is not an xl-toolstack-centric problem.

> I also feel I should also point out that contrary to the claims in
> http://lists.xen.org/archives/html/xen-devel/2012-11/msg01427.html and
> elsewhere the acceptance or otherwise of this patch has nothing to do
> with Citrix. Although some of the folks involved in the discussion are
> employed by Citrix they are all members of the "platform team" which
> operates independently, is concerned with the state of Xen.org provided
> Xen bits and is not tied to any product team (Citrix or otherwise). So
> this has nothing whatsoever to do with Citrix's plans to use this
> mechanism (and such conspiracy theories IMHO add nothing to the
> discussion). AFAIK no one who is involved with any of Citrix's products
> has said anything at all in any thread on the matter one way or the
> other.

Conspiracy theory?  Some old guy from your neck of the woods said
something like: "Methinks, the maintainer doth protest too much." ;-)

I apologize if my words have implied that maintainers employed
by Citrix are intentionally making decisions that favor Citrix.
I _am_ implying, however, that the single-system-inference/policy-driven
memory-load-balancer paradigm _has_ influenced the open source
hypervisor _and_ heavily influenced the objections to this proposal.
AFAIK, Citrix's Dynamic Memory Controller (DMC) in XenServer is
the only shipping example (in the Xen universe) of that, so I call
it the "Citrix paradigm".  Xen decisions made with this paradigm
in mind heavily favor a single-system model, which lead to
solutions to problems which are not as applicable to a data-center
paradigm such as Oracle's.  I _do_ consider this a serious issue
and suggest that the maintainers consider it deeply because
the hypervisor must serve both paradigms.

Now, with that in mind, I still haven't heard any objections
other than insufficient testing (fair, but also very true of
most patches accepted into xen-unstable months before a release);
and "your toolstack should use the 'Citrix paradigm'" (and
I believe I have adequately explained why we cannot).  Are
there other valid objections?

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:39:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:39:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMJP-0001C7-V9; Tue, 27 Nov 2012 14:38:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TdMJO-0001Bq-DF
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:38:58 +0000
Received: from [85.158.143.35:27029] by server-1.bemta-4.messagelabs.com id
	E9/E4-27934-180D4B05; Tue, 27 Nov 2012 14:38:57 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1354027135!11267356!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzgyNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25671 invoked from network); 27 Nov 2012 14:38:57 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-11.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 14:38:57 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAREcoK4029176
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 27 Nov 2012 14:38:51 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAREcnYs004122
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 27 Nov 2012 14:38:50 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAREcn8P000958; Tue, 27 Nov 2012 08:38:49 -0600
MIME-Version: 1.0
Message-ID: <4e524dad-b67a-4115-b0fd-72f9b372abf1@default>
Date: Tue, 27 Nov 2012 06:38:47 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
References: <38a09df7-3d82-403f-9153-9a151b220a41@default>
	<50B48C8A02000078000AB851@nat28.tlf.novell.com>
	<1354012308.5830.175.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354012308.5830.175.camel@zakaz.uk.xensource.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, xen-devel@lists.xen.org,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> Sent: Tuesday, November 27, 2012 3:32 AM
> To: Jan Beulich
> Cc: Dan Magenheimer; George Dunlap; Ian Jackson; xen-devel@lists.xen.org; Konrad Wilk; Zhigang Wang;
> Keir (Xen.org); Tim (Xen.org)
> Subject: Re: Please ack XENMEM_claim_pages hypercall?

Hi Ian --
 
> I'm also a little surprised that this patch is being so aggressively
> pushed upstream when the toolstack work which would use it is seemingly
> not fully formed yet.

The deficiency in the Oracle toolstack has been known for years
and this solution has been discussed and approved at the VP level.
 
> Anyway, it seems to me that this argument seems to me to be starting
> from the wrong end, it starts from the hypercall and tries to justify it
> based on requirements imposed by an toolstack which is presented as
> something of a fixed black box from the xen-devel point of view, which
> is not something I find particularly convincing.

I fully recognize that the existence of the black box is annoying.
But the argument began not with a hypercall but with a real
customer problem.  The early discussion, in which others suggested
"change your toolstack", uncovered a rather dramatic paradigm
difference that re-emphasized the need for the hypercall.
See below.

> So a possible alternative to Oracle carrying this patch long term is
> that someone who understands Oracle's toolstack's requirements and
> constraints takes over from Dan (who I think has said several times that
> he is not familiar with all the details of the Oracle toolstack) as
> advocate for finding a solution to the underlying issue here and can
> engage xen-devel in a discussion about the design decisions involved
> from the toolstack downwards. Either this leads to the proposed solution
> in the hypervisor (or something similar) or it results in a completely
> different solution which everyone is happy with (or I suppose it might
> still end up with Oracle carrying this patch long term).

>From a single-system-xl-toolstack-centric perspective ("paradigm"),
I can see your point.  This is not an xl-toolstack-centric problem.

> I also feel I should also point out that contrary to the claims in
> http://lists.xen.org/archives/html/xen-devel/2012-11/msg01427.html and
> elsewhere the acceptance or otherwise of this patch has nothing to do
> with Citrix. Although some of the folks involved in the discussion are
> employed by Citrix they are all members of the "platform team" which
> operates independently, is concerned with the state of Xen.org provided
> Xen bits and is not tied to any product team (Citrix or otherwise). So
> this has nothing whatsoever to do with Citrix's plans to use this
> mechanism (and such conspiracy theories IMHO add nothing to the
> discussion). AFAIK no one who is involved with any of Citrix's products
> has said anything at all in any thread on the matter one way or the
> other.

Conspiracy theory?  Some old guy from your neck of the woods said
something like: "Methinks, the maintainer doth protest too much." ;-)

I apologize if my words have implied that maintainers employed
by Citrix are intentionally making decisions that favor Citrix.
I _am_ implying, however, that the single-system-inference/policy-driven
memory-load-balancer paradigm _has_ influenced the open source
hypervisor _and_ heavily influenced the objections to this proposal.
AFAIK, Citrix's Dynamic Memory Controller (DMC) in XenServer is
the only shipping example (in the Xen universe) of that, so I call
it the "Citrix paradigm".  Xen decisions made with this paradigm
in mind heavily favor a single-system model, which lead to
solutions to problems which are not as applicable to a data-center
paradigm such as Oracle's.  I _do_ consider this a serious issue
and suggest that the maintainers consider it deeply because
the hypervisor must serve both paradigms.

Now, with that in mind, I still haven't heard any objections
other than insufficient testing (fair, but also very true of
most patches accepted into xen-unstable months before a release);
and "your toolstack should use the 'Citrix paradigm'" (and
I believe I have adequately explained why we cannot).  Are
there other valid objections?

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:47:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:47:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMRZ-0001XB-VX; Tue, 27 Nov 2012 14:47:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TdMRY-0001X6-MR
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:47:24 +0000
Received: from [85.158.143.35:58035] by server-2.bemta-4.messagelabs.com id
	85/C0-28922-C72D4B05; Tue, 27 Nov 2012 14:47:24 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354027627!15624163!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30180 invoked from network); 27 Nov 2012 14:47:09 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 14:47:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215601533"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 14:46:07 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 09:46:07 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[0.0.0.0])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TdMQI-0007Rs-PS;
	Tue, 27 Nov 2012 14:46:06 +0000
Message-ID: <50B4D22D.20809@eu.citrix.com>
Date: Tue, 27 Nov 2012 14:46:05 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Dan Magenheimer <dan.magenheimer@oracle.com>
References: <38a09df7-3d82-403f-9153-9a151b220a41@default>
	<50B48C8A02000078000AB851@nat28.tlf.novell.com>
	<1354012308.5830.175.camel@zakaz.uk.xensource.com>
	<4e524dad-b67a-4115-b0fd-72f9b372abf1@default>
In-Reply-To: <4e524dad-b67a-4115-b0fd-72f9b372abf1@default>
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, "Tim \(Xen.org\)" <tim@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 27/11/12 14:38, Dan Magenheimer wrote:
> Now, with that in mind, I still haven't heard any objections
> other than insufficient testing (fair, but also very true of
> most patches accepted into xen-unstable months before a release);
> and "your toolstack should use the 'Citrix paradigm'" (and
> I believe I have adequately explained why we cannot).  Are
> there other valid objections?

Yes -- the main one being, you have not convinced anyone it's necessary 
yet.  Maybe you should ask someone else to take up this cause -- we seem 
to have major problems communicating with you.

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:47:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:47:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMRZ-0001XB-VX; Tue, 27 Nov 2012 14:47:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TdMRY-0001X6-MR
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:47:24 +0000
Received: from [85.158.143.35:58035] by server-2.bemta-4.messagelabs.com id
	85/C0-28922-C72D4B05; Tue, 27 Nov 2012 14:47:24 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354027627!15624163!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30180 invoked from network); 27 Nov 2012 14:47:09 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 14:47:09 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215601533"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 14:46:07 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 09:46:07 -0500
Received: from gateway-1.uk.xensource.com ([10.80.16.66] helo=[0.0.0.0])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TdMQI-0007Rs-PS;
	Tue, 27 Nov 2012 14:46:06 +0000
Message-ID: <50B4D22D.20809@eu.citrix.com>
Date: Tue, 27 Nov 2012 14:46:05 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Dan Magenheimer <dan.magenheimer@oracle.com>
References: <38a09df7-3d82-403f-9153-9a151b220a41@default>
	<50B48C8A02000078000AB851@nat28.tlf.novell.com>
	<1354012308.5830.175.camel@zakaz.uk.xensource.com>
	<4e524dad-b67a-4115-b0fd-72f9b372abf1@default>
In-Reply-To: <4e524dad-b67a-4115-b0fd-72f9b372abf1@default>
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, "Tim \(Xen.org\)" <tim@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 27/11/12 14:38, Dan Magenheimer wrote:
> Now, with that in mind, I still haven't heard any objections
> other than insufficient testing (fair, but also very true of
> most patches accepted into xen-unstable months before a release);
> and "your toolstack should use the 'Citrix paradigm'" (and
> I believe I have adequately explained why we cannot).  Are
> there other valid objections?

Yes -- the main one being, you have not convinced anyone it's necessary 
yet.  Maybe you should ask someone else to take up this cause -- we seem 
to have major problems communicating with you.

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:48:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:48:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMS4-0001ZY-DZ; Tue, 27 Nov 2012 14:47:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TdMS3-0001ZQ-Gp
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:47:55 +0000
Received: from [193.109.254.147:9090] by server-9.bemta-14.messagelabs.com id
	A5/D5-30773-A92D4B05; Tue, 27 Nov 2012 14:47:54 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1354027673!8530689!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21294 invoked from network); 27 Nov 2012 14:47:54 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 14:47:54 -0000
Received: by mail-ea0-f173.google.com with SMTP id i13so5777358eaa.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 06:47:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=Sn8a7DFAD9MR40x1m3ZnPqKK3zE75fWk85POSA+x12g=;
	b=kItH8VBH/ZZpXObzoqc9b7hTqqOs11ud27qUhJFPXysKZ9OXkXeG34dxdn9dLw17X1
	Ekamran330ygNhoALp+Qxsut+88SZvN2FRwVCfCO8MDF/A4Np08M5w28uDq4YuMN/1v/
	rDw4p1fAQgkZewycMWzS00PSx33+e0ML/ifdtqqOXFwe6+jplhTAullyV3BSNpd4fcmF
	38xOdmhr5FVJoLWNM/VSTOPP5cCJx5xWr089F2+1lIkMU8hTnrYpUVDBw+UX6R+QnMFv
	pU5B4O9idy7CiOc2yBjl7FyZFyTJLiNsrmjgLWw/RzUsBuw9kkRVuJKyswEcLzGKnbU2
	/ypw==
Received: by 10.14.175.198 with SMTP id z46mr58635666eel.26.1354027659159;
	Tue, 27 Nov 2012 06:47:39 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id e7sm41105666eep.1.2012.11.27.06.47.34
	(version=SSLv3 cipher=OTHER); Tue, 27 Nov 2012 06:47:37 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Tue, 27 Nov 2012 14:47:30 +0000
From: Keir Fraser <keir@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Jan Beulich <JBeulich@suse.com>
Message-ID: <CCDA8302.538B2%keir@xen.org>
Thread-Topic: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
Thread-Index: Ac3MriAvsXbCCIeatk+0aAbSWBU+qg==
In-Reply-To: <baacb3cd-998f-4885-b7f1-28cd9f8c5c90@default>
Mime-version: 1.0
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	TimDeegan <tim@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 27/11/2012 14:08, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:

>> It's actually not that large a patch, and perhaps we could take a
>> domain_adjust_tot_pages() hook which would reduce the size of any private
>> patch, while not inflicting a maintenance or bug burden on mainline.
> 
> Thanks for your kind words.  That would be very helpful.
> Also reserving the subops would be much more valuable.

Yes yes, reserving subop(s) is certainly doable. We've done it for other
vendors in the past, and happy to again, within reason.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:48:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:48:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMS4-0001ZY-DZ; Tue, 27 Nov 2012 14:47:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TdMS3-0001ZQ-Gp
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:47:55 +0000
Received: from [193.109.254.147:9090] by server-9.bemta-14.messagelabs.com id
	A5/D5-30773-A92D4B05; Tue, 27 Nov 2012 14:47:54 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1354027673!8530689!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21294 invoked from network); 27 Nov 2012 14:47:54 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 14:47:54 -0000
Received: by mail-ea0-f173.google.com with SMTP id i13so5777358eaa.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 06:47:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=Sn8a7DFAD9MR40x1m3ZnPqKK3zE75fWk85POSA+x12g=;
	b=kItH8VBH/ZZpXObzoqc9b7hTqqOs11ud27qUhJFPXysKZ9OXkXeG34dxdn9dLw17X1
	Ekamran330ygNhoALp+Qxsut+88SZvN2FRwVCfCO8MDF/A4Np08M5w28uDq4YuMN/1v/
	rDw4p1fAQgkZewycMWzS00PSx33+e0ML/ifdtqqOXFwe6+jplhTAullyV3BSNpd4fcmF
	38xOdmhr5FVJoLWNM/VSTOPP5cCJx5xWr089F2+1lIkMU8hTnrYpUVDBw+UX6R+QnMFv
	pU5B4O9idy7CiOc2yBjl7FyZFyTJLiNsrmjgLWw/RzUsBuw9kkRVuJKyswEcLzGKnbU2
	/ypw==
Received: by 10.14.175.198 with SMTP id z46mr58635666eel.26.1354027659159;
	Tue, 27 Nov 2012 06:47:39 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id e7sm41105666eep.1.2012.11.27.06.47.34
	(version=SSLv3 cipher=OTHER); Tue, 27 Nov 2012 06:47:37 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Tue, 27 Nov 2012 14:47:30 +0000
From: Keir Fraser <keir@xen.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	Jan Beulich <JBeulich@suse.com>
Message-ID: <CCDA8302.538B2%keir@xen.org>
Thread-Topic: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
Thread-Index: Ac3MriAvsXbCCIeatk+0aAbSWBU+qg==
In-Reply-To: <baacb3cd-998f-4885-b7f1-28cd9f8c5c90@default>
Mime-version: 1.0
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	TimDeegan <tim@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 27/11/2012 14:08, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:

>> It's actually not that large a patch, and perhaps we could take a
>> domain_adjust_tot_pages() hook which would reduce the size of any private
>> patch, while not inflicting a maintenance or bug burden on mainline.
> 
> Thanks for your kind words.  That would be very helpful.
> Also reserving the subops would be much more valuable.

Yes yes, reserving subop(s) is certainly doable. We've done it for other
vendors in the past, and happy to again, within reason.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:49:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:49:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMTi-0001hl-Us; Tue, 27 Nov 2012 14:49:38 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TdMTi-0001he-2o
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:49:38 +0000
Received: from [193.109.254.147:58665] by server-14.bemta-14.messagelabs.com
	id 5C/0C-14517-103D4B05; Tue, 27 Nov 2012 14:49:37 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1354027776!1651336!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4794 invoked from network); 27 Nov 2012 14:49:36 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 14:49:36 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TdMTe-000EOI-U0; Tue, 27 Nov 2012 14:49:34 +0000
Date: Tue, 27 Nov 2012 14:49:34 +0000
From: Tim Deegan <tim@xen.org>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Message-ID: <20121127144934.GD51942@ocelot.phlegethon.org>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353423098-16371-6-git-send-email-dgdegra@tycho.nsa.gov>
	<20121122165712.GB83155@ocelot.phlegethon.org>
	<50AFA778.80008@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50AFA778.80008@tycho.nsa.gov>
User-Agent: Mutt/1.4.2.1i
Cc: keir@xen.org, ian.campbell@citrix.com, JBeulich@suse.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH RFC 5/5] xen/xsm: include default hook
	action in name
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 11:42 -0500 on 23 Nov (1353670952), Daniel De Graaf wrote:
> This would not work for all the hooks, although it would work for most:
> domctl and mmu_update are both too complex for this type of hack, and
> console_io would need its #define moved back up to the source. For the
> other hooks, you would have to code in the domain arguments manually
> (sometimes current->domain is available, sometimes it's not) so it's not
> automatically an improvement in readability since you still have to look
> inside dummy.h to see what domain arguments are being checked.

Hrmn.  Yes, I see.

> I think a solution similar to yours could work, although it's not as 
> nice looking - use the constants in the source files but have them 
> compiled out of the XSM hooks, and have the dummy ops include a
> compile-time assertion in the XSM-disabled case to verify that the
> constant passed in matches their implementation; something like:
> 
>    #define BUILD_ASSERT(x) if (!(x)) cause_linker_error_if_not_inlined_out()
>    #ifdef XSM_ENABLE
>    /* XSM_INLINE == empty; compiled in to dummy.c */
>    #define XSM_DEFAULT_VOID void
>    #define XSM_DEFAULT_ARG
>    #define XSM_ASSERT_ACTION(action) xsm_default_t default = action
>    #else
>    /* XSM_INLINE == inline; compiled as a header */
>    #define XSM_DEFAULT_VOID xsm_default_t default
>    #define XSM_DEFAULT_ARG xsm_default_t default,
>    #define XSM_ASSERT_ACTION(action) BUILD_ASSERT(default == action)
>    #endif
> 
>    static XSM_INLINE int xsm_do_mca(XSM_DEFAULT_VOID)
>    {
> 	XSM_ASSERT_ACTION(XSM_PRIV);
> 	return xsm_default_action(default, current->domain, NULL);
>    }

So on an xsm-disabled build this checks that the action is the right one.
And if it's changed the author has to touch this file so will be more
likely to see that there is some other code to be changed.  Nice.

The CPP gore is a bit unfortunate, but I think it's worth it (as long as
it gets a great big comment explaining how it should be used, of course!).

>    static XSM_INLINE int xsm_unbind_pt_irq(XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
>    {
> 	XSM_ASSERT_ACTION(XSM_HOOK);
>  	return xsm_default_action(default, current->domain, d);
>    }
> 
> Does this seem reasonable? It would force some level of compiler
> optimization to be used at all times, but I think that's already
> required due to GCC otherwise wasting lots of stack space.

Yes, even debug builds get -O1.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 14:49:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 14:49:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMTi-0001hl-Us; Tue, 27 Nov 2012 14:49:38 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TdMTi-0001he-2o
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 14:49:38 +0000
Received: from [193.109.254.147:58665] by server-14.bemta-14.messagelabs.com
	id 5C/0C-14517-103D4B05; Tue, 27 Nov 2012 14:49:37 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1354027776!1651336!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4794 invoked from network); 27 Nov 2012 14:49:36 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 14:49:36 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TdMTe-000EOI-U0; Tue, 27 Nov 2012 14:49:34 +0000
Date: Tue, 27 Nov 2012 14:49:34 +0000
From: Tim Deegan <tim@xen.org>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Message-ID: <20121127144934.GD51942@ocelot.phlegethon.org>
References: <50AA5521.6080907@tycho.nsa.gov>
	<1353423098-16371-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1353423098-16371-6-git-send-email-dgdegra@tycho.nsa.gov>
	<20121122165712.GB83155@ocelot.phlegethon.org>
	<50AFA778.80008@tycho.nsa.gov>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50AFA778.80008@tycho.nsa.gov>
User-Agent: Mutt/1.4.2.1i
Cc: keir@xen.org, ian.campbell@citrix.com, JBeulich@suse.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH RFC 5/5] xen/xsm: include default hook
	action in name
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 11:42 -0500 on 23 Nov (1353670952), Daniel De Graaf wrote:
> This would not work for all the hooks, although it would work for most:
> domctl and mmu_update are both too complex for this type of hack, and
> console_io would need its #define moved back up to the source. For the
> other hooks, you would have to code in the domain arguments manually
> (sometimes current->domain is available, sometimes it's not) so it's not
> automatically an improvement in readability since you still have to look
> inside dummy.h to see what domain arguments are being checked.

Hrmn.  Yes, I see.

> I think a solution similar to yours could work, although it's not as 
> nice looking - use the constants in the source files but have them 
> compiled out of the XSM hooks, and have the dummy ops include a
> compile-time assertion in the XSM-disabled case to verify that the
> constant passed in matches their implementation; something like:
> 
>    #define BUILD_ASSERT(x) if (!(x)) cause_linker_error_if_not_inlined_out()
>    #ifdef XSM_ENABLE
>    /* XSM_INLINE == empty; compiled in to dummy.c */
>    #define XSM_DEFAULT_VOID void
>    #define XSM_DEFAULT_ARG
>    #define XSM_ASSERT_ACTION(action) xsm_default_t default = action
>    #else
>    /* XSM_INLINE == inline; compiled as a header */
>    #define XSM_DEFAULT_VOID xsm_default_t default
>    #define XSM_DEFAULT_ARG xsm_default_t default,
>    #define XSM_ASSERT_ACTION(action) BUILD_ASSERT(default == action)
>    #endif
> 
>    static XSM_INLINE int xsm_do_mca(XSM_DEFAULT_VOID)
>    {
> 	XSM_ASSERT_ACTION(XSM_PRIV);
> 	return xsm_default_action(default, current->domain, NULL);
>    }

So on an xsm-disabled build this checks that the action is the right one.
And if it's changed the author has to touch this file so will be more
likely to see that there is some other code to be changed.  Nice.

The CPP gore is a bit unfortunate, but I think it's worth it (as long as
it gets a great big comment explaining how it should be used, of course!).

>    static XSM_INLINE int xsm_unbind_pt_irq(XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
>    {
> 	XSM_ASSERT_ACTION(XSM_HOOK);
>  	return xsm_default_action(default, current->domain, d);
>    }
> 
> Does this seem reasonable? It would force some level of compiler
> optimization to be used at all times, but I think that's already
> required due to GCC otherwise wasting lots of stack space.

Yes, even debug builds get -O1.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:14:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:14:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMrv-000267-8J; Tue, 27 Nov 2012 15:14:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jfehlig@suse.com>) id 1TdMrt-000262-UV
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:14:38 +0000
Received: from [85.158.138.51:47421] by server-10.bemta-3.messagelabs.com id
	CB/6C-19806-DD8D4B05; Tue, 27 Nov 2012 15:14:37 +0000
X-Env-Sender: jfehlig@suse.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354029265!25336847!1
X-Originating-IP: [137.65.250.26]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1460 invoked from network); 27 Nov 2012 15:14:35 -0000
Received: from victor.provo.novell.com (HELO victor.provo.novell.com)
	(137.65.250.26)
	by server-14.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 15:14:35 -0000
Received: from [137.65.135.33] (prv-ext-foundry1int.gns.novell.com
	[137.65.251.240])
	by victor.provo.novell.com with ESMTP (TLS encrypted);
	Tue, 27 Nov 2012 08:14:20 -0700
Message-ID: <50B4D8CB.1070303@suse.com>
Date: Tue, 27 Nov 2012 08:14:19 -0700
From: Jim Fehlig <jfehlig@suse.com>
User-Agent: Thunderbird 2.0.0.24 (X11/20100302)
MIME-Version: 1.0
To: George Dunlap <George.Dunlap@eu.citrix.com>
References: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
	<CAFLBxZYjcij+20baWQZwh+7RSXw1SJjk7PkZ7g-1DoX6EsOa8w@mail.gmail.com>
In-Reply-To: <CAFLBxZYjcij+20baWQZwh+7RSXw1SJjk7PkZ7g-1DoX6EsOa8w@mail.gmail.com>
Cc: libvir-list@redhat.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Convert libxl driver to Xen 4.2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> On Mon, Nov 26, 2012 at 10:28 PM, Jim Fehlig <jfehlig@suse.com
> <mailto:jfehlig@suse.com>> wrote:
>
>     Based on a patch originally authored by Daniel De Graaf
>
>       http://lists.xen.org/archives/html/xen-devel/2012-05/msg00565.html
>
>     This patch converts the Xen libxl driver to support only Xen >= 4.2.
>     Support for Xen 4.1 libxl is dropped since that version of libxl is
>     designated 'technology preview' only and is incompatible with Xen 4.2
>     libxl.  Additionally, the default toolstack in Xen 4.1 is still xend,
>     for which libvirt has a stable, functional driver.
>
>
> Great!  Just one question -- does this patch add any new functionality
> (e.g., migration for libxl), or just switch the existing functionality
> over to the new interface?

This patch just switches all existing functionality to the new libxl
interface.  There are other patches in the oven which add new functionality.

Regards,
Jim


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:14:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:14:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMrv-000267-8J; Tue, 27 Nov 2012 15:14:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jfehlig@suse.com>) id 1TdMrt-000262-UV
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:14:38 +0000
Received: from [85.158.138.51:47421] by server-10.bemta-3.messagelabs.com id
	CB/6C-19806-DD8D4B05; Tue, 27 Nov 2012 15:14:37 +0000
X-Env-Sender: jfehlig@suse.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354029265!25336847!1
X-Originating-IP: [137.65.250.26]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1460 invoked from network); 27 Nov 2012 15:14:35 -0000
Received: from victor.provo.novell.com (HELO victor.provo.novell.com)
	(137.65.250.26)
	by server-14.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 15:14:35 -0000
Received: from [137.65.135.33] (prv-ext-foundry1int.gns.novell.com
	[137.65.251.240])
	by victor.provo.novell.com with ESMTP (TLS encrypted);
	Tue, 27 Nov 2012 08:14:20 -0700
Message-ID: <50B4D8CB.1070303@suse.com>
Date: Tue, 27 Nov 2012 08:14:19 -0700
From: Jim Fehlig <jfehlig@suse.com>
User-Agent: Thunderbird 2.0.0.24 (X11/20100302)
MIME-Version: 1.0
To: George Dunlap <George.Dunlap@eu.citrix.com>
References: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
	<CAFLBxZYjcij+20baWQZwh+7RSXw1SJjk7PkZ7g-1DoX6EsOa8w@mail.gmail.com>
In-Reply-To: <CAFLBxZYjcij+20baWQZwh+7RSXw1SJjk7PkZ7g-1DoX6EsOa8w@mail.gmail.com>
Cc: libvir-list@redhat.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Convert libxl driver to Xen 4.2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> On Mon, Nov 26, 2012 at 10:28 PM, Jim Fehlig <jfehlig@suse.com
> <mailto:jfehlig@suse.com>> wrote:
>
>     Based on a patch originally authored by Daniel De Graaf
>
>       http://lists.xen.org/archives/html/xen-devel/2012-05/msg00565.html
>
>     This patch converts the Xen libxl driver to support only Xen >= 4.2.
>     Support for Xen 4.1 libxl is dropped since that version of libxl is
>     designated 'technology preview' only and is incompatible with Xen 4.2
>     libxl.  Additionally, the default toolstack in Xen 4.1 is still xend,
>     for which libvirt has a stable, functional driver.
>
>
> Great!  Just one question -- does this patch add any new functionality
> (e.g., migration for libxl), or just switch the existing functionality
> over to the new interface?

This patch just switches all existing functionality to the new libxl
interface.  There are other patches in the oven which add new functionality.

Regards,
Jim


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:15:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:15:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMsC-000279-Ku; Tue, 27 Nov 2012 15:14:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdMsA-00026t-Ol
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:14:54 +0000
Received: from [85.158.143.35:43316] by server-2.bemta-4.messagelabs.com id
	A6/40-28922-DE8D4B05; Tue, 27 Nov 2012 15:14:53 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-13.tower-21.messagelabs.com!1354029292!14406172!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9670 invoked from network); 27 Nov 2012 15:14:53 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-13.tower-21.messagelabs.com with SMTP;
	27 Nov 2012 15:14:53 -0000
X-TM-IMSS-Message-ID: <240a5bd200000a29@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 240a5bd200000a29 ;
	Tue, 27 Nov 2012 10:13:52 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARFEpPs007688; 
	Tue, 27 Nov 2012 10:14:51 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu
Date: Tue, 27 Nov 2012 10:14:42 -0500
Message-Id: <1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <50B4D060.9070403@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
Cc: dgdegra@tycho.nsa.gov, Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 0/4] stubdom/vtpm improvements
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Patch 1/4 is the (updated) version of the patch starting this thread.
The series is based off the v4 vTPM series posted to xen-devel. The
other 3 patches add support for using the locality field and extending a
static root of trust to a user-specified kernel loaded with pv-grub.

Since pv-grub is already GPL, there should be no licensing issues
created by adding the vTPM code and the Linux SHA1 implementation.

Contents:
  [PATCH 1/4] stubdom: Change vTPM shared page ABI
  [PATCH 2/4] stubdom/vtpm: Add reconfiguration support
  [PATCH 3/4] stubdom/grub: send kernel measurements to vTPM
  [PATCH 4/4] stubdom/vtpm: Support multiple backends and locality

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:15:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:15:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMsC-000279-Ku; Tue, 27 Nov 2012 15:14:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdMsA-00026t-Ol
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:14:54 +0000
Received: from [85.158.143.35:43316] by server-2.bemta-4.messagelabs.com id
	A6/40-28922-DE8D4B05; Tue, 27 Nov 2012 15:14:53 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-13.tower-21.messagelabs.com!1354029292!14406172!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9670 invoked from network); 27 Nov 2012 15:14:53 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-13.tower-21.messagelabs.com with SMTP;
	27 Nov 2012 15:14:53 -0000
X-TM-IMSS-Message-ID: <240a5bd200000a29@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 240a5bd200000a29 ;
	Tue, 27 Nov 2012 10:13:52 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARFEpPs007688; 
	Tue, 27 Nov 2012 10:14:51 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu
Date: Tue, 27 Nov 2012 10:14:42 -0500
Message-Id: <1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <50B4D060.9070403@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
Cc: dgdegra@tycho.nsa.gov, Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 0/4] stubdom/vtpm improvements
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Patch 1/4 is the (updated) version of the patch starting this thread.
The series is based off the v4 vTPM series posted to xen-devel. The
other 3 patches add support for using the locality field and extending a
static root of trust to a user-specified kernel loaded with pv-grub.

Since pv-grub is already GPL, there should be no licensing issues
created by adding the vTPM code and the Linux SHA1 implementation.

Contents:
  [PATCH 1/4] stubdom: Change vTPM shared page ABI
  [PATCH 2/4] stubdom/vtpm: Add reconfiguration support
  [PATCH 3/4] stubdom/grub: send kernel measurements to vTPM
  [PATCH 4/4] stubdom/vtpm: Support multiple backends and locality

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:15:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:15:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMsE-00027Q-1I; Tue, 27 Nov 2012 15:14:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdMsC-00026t-E6
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:14:56 +0000
Received: from [85.158.143.35:43464] by server-2.bemta-4.messagelabs.com id
	C6/50-28922-0F8D4B05; Tue, 27 Nov 2012 15:14:56 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-4.tower-21.messagelabs.com!1354029294!5223023!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5494 invoked from network); 27 Nov 2012 15:14:55 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-4.tower-21.messagelabs.com with SMTP;
	27 Nov 2012 15:14:55 -0000
X-TM-IMSS-Message-ID: <c1192e1d0002f246@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id c1192e1d0002f246 ;
	Tue, 27 Nov 2012 10:14:04 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARFEpPw007688; 
	Tue, 27 Nov 2012 10:14:52 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu
Date: Tue, 27 Nov 2012 10:14:46 -0500
Message-Id: <1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: dgdegra@tycho.nsa.gov, Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends and
	locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The vTPM protocol now contains a field allowing the locality of a
command to be specified; pass this to the TPM when processing a packet.
This also enables a single vTPM to provide multiple tpmback interfaces
so that several closely related domains can share a vTPM (for example, a
qemu device stubdom and its target domain).

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/tpmemu-0.7.4.patch | 61 ++++++++++++++++++++++++++++++++++++++++++----
 stubdom/vtpm/vtpm.c        | 16 +++---------
 2 files changed, 59 insertions(+), 18 deletions(-)

diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
index b84eff1..31ace1a 100644
--- a/stubdom/tpmemu-0.7.4.patch
+++ b/stubdom/tpmemu-0.7.4.patch
@@ -1,9 +1,60 @@
-diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c	2012-04-27 10:55:46.581963398 -0400
-+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c	2012-04-27 10:56:02.193034152 -0400
-@@ -249,7 +249,7 @@
+diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
+index 60bbb90..f8f7f0f 100644
+--- a/tpm/tpm_capability.c
++++ b/tpm/tpm_capability.c
+@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *setValue,
+                              UINT32 setValueSize, BOOL ownerAuth,
+                              BOOL deactivated, BOOL disabled)
+ {
++  if (tpmData.stany.flags.localityModifier != 8)
++    return TPM_BAD_PARAMETER;
+   /* set the capability area with the specified data, on failure
+      deactivate the TPM */
+   switch (subCap) {
+diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
+index 288d1ce..9e1cfb4 100644
+--- a/tpm/tpm_cmd_handler.c
++++ b/tpm/tpm_cmd_handler.c
+@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
+   tpm_extern_release();
+ }
+ 
+-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size)
++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality)
+ {
+   TPM_REQUEST req;
+   TPM_RESPONSE rsp;
+@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint3
+   UINT32 len;
+   BOOL free_out;
+ 
+-  debug("tpm_handle_command()");
++  debug("tpm_handle_command(%d)", locality);
++  if (locality != -1)
++    tpmData.stany.flags.localityModifier = locality;
+ 
+   /* we need the whole packet at once, otherwise unmarshalling will fail */
+   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) != 0) {
+diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
+index eed749e..4c228bd 100644
+--- a/tpm/tpm_emulator.h
++++ b/tpm/tpm_emulator.h
+@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
+  * its usage. In case of an error, all internally allocated memory
+  * is released and the the state of out and out_size is unspecified.
+  */ 
+-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size);
++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality);
+ 
+ #endif /* _TPM_EMULATOR_H_ */
+ 
+diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c
+index aabe6c3..440a01b 100644
+--- a/tpm/tpm_emulator_extern.c
++++ b/tpm/tpm_emulator_extern.c
+@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length) = _tpm_read_fr
  #else /* TPM_NO_EXTERN */
-
+ 
  int (*tpm_extern_init)(void)                                      = NULL;
 -int (*tpm_extern_release)(void)                                   = NULL;
 +void (*tpm_extern_release)(void)                                   = NULL;
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
index c33e078..dcfc3b9 100644
--- a/stubdom/vtpm/vtpm.c
+++ b/stubdom/vtpm/vtpm.c
@@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
 
 static void main_loop(void) {
    tpmcmd_t* tpmcmd = NULL;
-   domid_t domid;		/* Domid of frontend */
-   unsigned int handle;	/* handle of frontend */
    int res = -1;
 
    info("VTPM Initializing\n");
@@ -162,15 +160,7 @@ static void main_loop(void) {
       goto abort_postpcrs;
    }
 
-   /* Wait for the frontend domain to connect */
-   info("Waiting for frontend domain to connect..");
-   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
-      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
-   } else {
-      error("Unable to attach to a frontend");
-   }
-
-   tpmcmd = tpmback_req(domid, handle);
+   tpmcmd = tpmback_req_any();
    while(tpmcmd) {
       /* Handle the request */
       if(tpmcmd->req_len) {
@@ -183,7 +173,7 @@ static void main_loop(void) {
          }
          /* If not disabled, do the command */
          else {
-            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
+            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) != 0) {
                error("tpm_handle_command() failed");
                create_error_response(tpmcmd, TPM_FAIL);
             }
@@ -194,7 +184,7 @@ static void main_loop(void) {
       tpmback_resp(tpmcmd);
 
       /* Wait for the next request */
-      tpmcmd = tpmback_req(domid, handle);
+      tpmcmd = tpmback_req_any();
 
    }
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:15:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:15:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMsE-00027Q-1I; Tue, 27 Nov 2012 15:14:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdMsC-00026t-E6
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:14:56 +0000
Received: from [85.158.143.35:43464] by server-2.bemta-4.messagelabs.com id
	C6/50-28922-0F8D4B05; Tue, 27 Nov 2012 15:14:56 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-4.tower-21.messagelabs.com!1354029294!5223023!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5494 invoked from network); 27 Nov 2012 15:14:55 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-4.tower-21.messagelabs.com with SMTP;
	27 Nov 2012 15:14:55 -0000
X-TM-IMSS-Message-ID: <c1192e1d0002f246@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id c1192e1d0002f246 ;
	Tue, 27 Nov 2012 10:14:04 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARFEpPw007688; 
	Tue, 27 Nov 2012 10:14:52 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu
Date: Tue, 27 Nov 2012 10:14:46 -0500
Message-Id: <1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: dgdegra@tycho.nsa.gov, Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends and
	locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The vTPM protocol now contains a field allowing the locality of a
command to be specified; pass this to the TPM when processing a packet.
This also enables a single vTPM to provide multiple tpmback interfaces
so that several closely related domains can share a vTPM (for example, a
qemu device stubdom and its target domain).

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/tpmemu-0.7.4.patch | 61 ++++++++++++++++++++++++++++++++++++++++++----
 stubdom/vtpm/vtpm.c        | 16 +++---------
 2 files changed, 59 insertions(+), 18 deletions(-)

diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
index b84eff1..31ace1a 100644
--- a/stubdom/tpmemu-0.7.4.patch
+++ b/stubdom/tpmemu-0.7.4.patch
@@ -1,9 +1,60 @@
-diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c	2012-04-27 10:55:46.581963398 -0400
-+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c	2012-04-27 10:56:02.193034152 -0400
-@@ -249,7 +249,7 @@
+diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
+index 60bbb90..f8f7f0f 100644
+--- a/tpm/tpm_capability.c
++++ b/tpm/tpm_capability.c
+@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *setValue,
+                              UINT32 setValueSize, BOOL ownerAuth,
+                              BOOL deactivated, BOOL disabled)
+ {
++  if (tpmData.stany.flags.localityModifier != 8)
++    return TPM_BAD_PARAMETER;
+   /* set the capability area with the specified data, on failure
+      deactivate the TPM */
+   switch (subCap) {
+diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
+index 288d1ce..9e1cfb4 100644
+--- a/tpm/tpm_cmd_handler.c
++++ b/tpm/tpm_cmd_handler.c
+@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
+   tpm_extern_release();
+ }
+ 
+-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size)
++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality)
+ {
+   TPM_REQUEST req;
+   TPM_RESPONSE rsp;
+@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint3
+   UINT32 len;
+   BOOL free_out;
+ 
+-  debug("tpm_handle_command()");
++  debug("tpm_handle_command(%d)", locality);
++  if (locality != -1)
++    tpmData.stany.flags.localityModifier = locality;
+ 
+   /* we need the whole packet at once, otherwise unmarshalling will fail */
+   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) != 0) {
+diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
+index eed749e..4c228bd 100644
+--- a/tpm/tpm_emulator.h
++++ b/tpm/tpm_emulator.h
+@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
+  * its usage. In case of an error, all internally allocated memory
+  * is released and the the state of out and out_size is unspecified.
+  */ 
+-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size);
++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality);
+ 
+ #endif /* _TPM_EMULATOR_H_ */
+ 
+diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c
+index aabe6c3..440a01b 100644
+--- a/tpm/tpm_emulator_extern.c
++++ b/tpm/tpm_emulator_extern.c
+@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length) = _tpm_read_fr
  #else /* TPM_NO_EXTERN */
-
+ 
  int (*tpm_extern_init)(void)                                      = NULL;
 -int (*tpm_extern_release)(void)                                   = NULL;
 +void (*tpm_extern_release)(void)                                   = NULL;
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
index c33e078..dcfc3b9 100644
--- a/stubdom/vtpm/vtpm.c
+++ b/stubdom/vtpm/vtpm.c
@@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
 
 static void main_loop(void) {
    tpmcmd_t* tpmcmd = NULL;
-   domid_t domid;		/* Domid of frontend */
-   unsigned int handle;	/* handle of frontend */
    int res = -1;
 
    info("VTPM Initializing\n");
@@ -162,15 +160,7 @@ static void main_loop(void) {
       goto abort_postpcrs;
    }
 
-   /* Wait for the frontend domain to connect */
-   info("Waiting for frontend domain to connect..");
-   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
-      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
-   } else {
-      error("Unable to attach to a frontend");
-   }
-
-   tpmcmd = tpmback_req(domid, handle);
+   tpmcmd = tpmback_req_any();
    while(tpmcmd) {
       /* Handle the request */
       if(tpmcmd->req_len) {
@@ -183,7 +173,7 @@ static void main_loop(void) {
          }
          /* If not disabled, do the command */
          else {
-            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
+            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) != 0) {
                error("tpm_handle_command() failed");
                create_error_response(tpmcmd, TPM_FAIL);
             }
@@ -194,7 +184,7 @@ static void main_loop(void) {
       tpmback_resp(tpmcmd);
 
       /* Wait for the next request */
-      tpmcmd = tpmback_req(domid, handle);
+      tpmcmd = tpmback_req_any();
 
    }
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:15:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:15:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMsS-0002B5-Js; Tue, 27 Nov 2012 15:15:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdMsQ-0002AG-KR
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:15:11 +0000
Received: from [85.158.143.35:26713] by server-2.bemta-4.messagelabs.com id
	A2/B0-28922-DF8D4B05; Tue, 27 Nov 2012 15:15:09 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-2.tower-21.messagelabs.com!1354029294!4715396!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2457 invoked from network); 27 Nov 2012 15:14:55 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-2.tower-21.messagelabs.com with SMTP;
	27 Nov 2012 15:14:55 -0000
X-TM-IMSS-Message-ID: <c1192c870002f243@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id c1192c870002f243 ;
	Tue, 27 Nov 2012 10:14:03 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARFEpPt007688; 
	Tue, 27 Nov 2012 10:14:51 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu
Date: Tue, 27 Nov 2012 10:14:43 -0500
Message-Id: <1354029286-17652-2-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: dgdegra@tycho.nsa.gov, Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 1/4] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This changes the vTPM shared page ABI from a copy of the Xen network
interface to a single-page interface that better reflects the expected
behavior of a TPM: only a single request packet can be sent at any given
time, and every packet sent generates a single response packet. This
protocol change should also increase efficiency as it avoids mapping and
unmapping grants when possible.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/include/tpmback.h  |   1 +
 extras/mini-os/include/tpmfront.h |   7 +-
 extras/mini-os/tpmback.c          | 159 +++++++++++++++++++------------------
 extras/mini-os/tpmfront.c         | 162 ++++++++++++++++++++++----------------
 xen/include/public/io/tpmif.h     |  45 +++--------
 5 files changed, 191 insertions(+), 183 deletions(-)

diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
index ff86732..ec9eda4 100644
--- a/extras/mini-os/include/tpmback.h
+++ b/extras/mini-os/include/tpmback.h
@@ -43,6 +43,7 @@
 
 struct tpmcmd {
    domid_t domid;		/* Domid of the frontend */
+   uint8_t locality;    /* Locality requested by the frontend */
    unsigned int handle;	/* Handle of the frontend */
    unsigned char uuid[16];			/* uuid of the tpm interface */
 
diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include/tpmfront.h
index fd2cb17..a0c7c4d 100644
--- a/extras/mini-os/include/tpmfront.h
+++ b/extras/mini-os/include/tpmfront.h
@@ -37,9 +37,7 @@ struct tpmfront_dev {
    grant_ref_t ring_ref;
    evtchn_port_t evtchn;
 
-   tpmif_tx_interface_t* tx;
-
-   void** pages;
+   vtpm_shared_page_t *page;
 
    domid_t bedomid;
    char* nodename;
@@ -77,6 +75,9 @@ void shutdown_tpmfront(struct tpmfront_dev* dev);
  * */
 int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen);
 
+/* Set the locality used for communicating with a vTPM */
+int tpmfront_set_locality(struct tpmfront_dev* dev, int locality);
+
 #ifdef HAVE_LIBC
 #include <sys/stat.h>
 /* POSIX IO functions:
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index 658fed1..2d31061 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -86,10 +86,7 @@ struct tpmif {
    evtchn_port_t evtchn;
 
    /* Shared page */
-   tpmif_tx_interface_t* tx;
-
-   /* pointer to TPMIF_RX_RING_SIZE pages */
-   void** pages;
+   vtpm_shared_page_t *page;
 
    enum xenbus_state state;
    enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
@@ -266,6 +263,7 @@ int insert_tpmif(tpmif_t* tpmif)
    unsigned int i, j;
    tpmif_t* tmp;
    char* err;
+   char path[512];
 
    local_irq_save(flags);
 
@@ -303,6 +301,16 @@ int insert_tpmif(tpmif_t* tpmif)
 
    local_irq_restore(flags);
 
+   snprintf(path, 512, "backend/vtpm/%u/%u/feature-protocol-v2", (unsigned int) tpmif->domid, tpmif->handle);
+   if ((err = xenbus_write(XBT_NIL, path, "1")))
+   {
+      /* if we got an error here we should carefully remove the interface and then return */
+      TPMBACK_ERR("Unable to write feature-protocol-v2 node: %s\n", err);
+      free(err);
+      remove_tpmif(tpmif);
+      goto error_post_irq;
+   }
+
    /*Listen for state changes on the new interface */
    if((err = xenbus_watch_path_token(XBT_NIL, tpmif->fe_state_path, tpmif->fe_state_path, &gtpmdev.events)))
    {
@@ -312,7 +320,6 @@ int insert_tpmif(tpmif_t* tpmif)
       remove_tpmif(tpmif);
       goto error_post_irq;
    }
-
    return 0;
 error:
    local_irq_restore(flags);
@@ -386,8 +393,7 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
    tpmif->fe_state_path = NULL;
    tpmif->state = XenbusStateInitialising;
    tpmif->status = DISCONNECTED;
-   tpmif->tx = NULL;
-   tpmif->pages = NULL;
+   tpmif->page = NULL;
    tpmif->flags = 0;
    memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
    return tpmif;
@@ -395,9 +401,6 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
 
 void __free_tpmif(tpmif_t* tpmif)
 {
-   if(tpmif->pages) {
-      free(tpmif->pages);
-   }
    if(tpmif->fe_path) {
       free(tpmif->fe_path);
    }
@@ -430,12 +433,6 @@ tpmif_t* new_tpmif(domid_t domid, unsigned int handle)
       goto error;
    }
 
-   /* allocate pages to be used for shared mapping */
-   if((tpmif->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE)) == NULL) {
-      goto error;
-   }
-   memset(tpmif->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-
    if(tpmif_change_state(tpmif, XenbusStateInitWait)) {
       goto error;
    }
@@ -486,7 +483,7 @@ void free_tpmif(tpmif_t* tpmif)
       tpmif->status = DISCONNECTING;
       mask_evtchn(tpmif->evtchn);
 
-      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1)) {
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
 	 TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
       }
 
@@ -529,9 +526,10 @@ void free_tpmif(tpmif_t* tpmif)
 void tpmback_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
 {
    tpmif_t* tpmif = (tpmif_t*) data;
-   tpmif_tx_request_t* tx = &tpmif->tx->ring[0].req;
-   /* Throw away 0 size events, these can trigger from event channel unmasking */
-   if(tx->size == 0)
+   vtpm_shared_page_t* pg = tpmif->page;
+
+   /* Only pay attention if the request is ready */
+   if (pg->state == 0)
       return;
 
    TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
@@ -584,12 +582,26 @@ int connect_fe(tpmif_t* tpmif)
    }
    free(value);
 
+   /* Check that protocol v2 is being used */
+   snprintf(path, 512, "%s/feature-protocol-v2", tpmif->fe_path);
+   if((err = xenbus_read(XBT_NIL, path, &value))) {
+      TPMBACK_ERR("Unable to read %s during tpmback initialization! error = %s\n", path, err);
+      free(err);
+      return -1;
+   }
+   if(strcmp(value, "1")) {
+      TPMBACK_ERR("%s has an invalid value (%s)\n", path, value);
+      free(value);
+      return -1;
+   }
+   free(value);
+
+
    domid = tpmif->domid;
-   if((tpmif->tx = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
+   if((tpmif->page = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
       TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
       return -1;
    }
-   memset(tpmif->tx, 0, PAGE_SIZE);
 
    /*Bind the event channel */
    if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler, tpmif, &tpmif->evtchn)))
@@ -618,10 +630,28 @@ error_post_evtchn:
    mask_evtchn(tpmif->evtchn);
    unbind_evtchn(tpmif->evtchn);
 error_post_map:
-   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1);
+   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1);
    return -1;
 }
 
+static void disconnect_fe(tpmif_t* tpmif)
+{
+   if (tpmif->status == CONNECTED) {
+      tpmif->status = DISCONNECTING;
+      mask_evtchn(tpmif->evtchn);
+
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
+	 TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
+      }
+
+      unbind_evtchn(tpmif->evtchn);
+   }
+   tpmif->status = DISCONNECTED;
+   tpmif_change_state(tpmif, XenbusStateReconfigured);
+
+   TPMBACK_LOG("Frontend %u/%u disconnected\n", (unsigned int) tpmif->domid, tpmif->handle);
+}
+
 static int frontend_changed(tpmif_t* tpmif)
 {
    int state = xenbus_read_integer(tpmif->fe_state_path);
@@ -874,6 +904,7 @@ void shutdown_tpmback(void)
 inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, unsigned char uuid[16])
 {
    tpmcmd->domid = domid;
+   tpmcmd->locality = -1;
    tpmcmd->handle = handle;
    memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
    tpmcmd->req = NULL;
@@ -884,12 +915,12 @@ inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, un
 
 tpmcmd_t* get_request(tpmif_t* tpmif) {
    tpmcmd_t* cmd;
-   tpmif_tx_request_t* tx;
-   int offset;
-   int tocopy;
-   int i;
-   uint32_t domid;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+   int i;
+#endif
 
    local_irq_save(flags);
 
@@ -899,35 +930,22 @@ tpmcmd_t* get_request(tpmif_t* tpmif) {
    }
    init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);
 
-   tx = &tpmif->tx->ring[0].req;
-   cmd->req_len = tx->size;
+   shr = tpmif->page;
+   cmd->req_len = shr->length;
+   cmd->locality = shr->locality;
+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->req_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
+   }
    /* Allocate the buffer */
    if(cmd->req_len) {
       if((cmd->req = malloc(cmd->req_len)) == NULL) {
 	 goto error;
       }
    }
-   /* Copy the bits from the shared pages */
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->req_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_READ)) == NULL) {
-	 TPMBACK_ERR("%u/%u Unable to map shared page during read!\n", (unsigned int) tpmif->domid, tpmif->handle);
-	 goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->req_len - offset, PAGE_SIZE);
-      memcpy(&cmd->req[offset], tpmif->pages[i], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
-
-   }
+   /* Copy the bits from the shared page(s) */
+   memcpy(cmd->req, offset + (uint8_t*)shr, cmd->req_len);
 
 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Received Tpm Command from %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->req_len);
@@ -958,38 +976,24 @@ error:
 
 void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
 {
-   tpmif_tx_request_t* tx;
-   int offset;
-   int i;
-   uint32_t domid;
-   int tocopy;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+int i;
+#endif
 
    local_irq_save(flags);
 
-   tx = &tpmif->tx->ring[0].req;
-   tx->size = cmd->resp_len;
-
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->resp_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_WRITE)) == NULL) {
-	 TPMBACK_ERR("%u/%u Unable to map shared page during write!\n", (unsigned int) tpmif->domid, tpmif->handle);
-	 goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->resp_len - offset, PAGE_SIZE);
-      memcpy(tpmif->pages[i], &cmd->resp[offset], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
+   shr = tpmif->page;
+   shr->length = cmd->resp_len;
 
+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->resp_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
    }
+   memcpy(offset + (uint8_t*)shr, cmd->resp, cmd->resp_len);
 
 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Sent response to %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->resp_len);
@@ -1003,6 +1007,7 @@ void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
 #endif
    /* clear the ready flag and send the event channel notice to the frontend */
    tpmif_req_finished(tpmif);
+   shr->state = 0;
    notify_remote_via_evtchn(tpmif->evtchn);
 error:
    local_irq_restore(flags);
diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
index 0218d7f..c1cbab3 100644
--- a/extras/mini-os/tpmfront.c
+++ b/extras/mini-os/tpmfront.c
@@ -153,6 +153,32 @@ static int wait_for_backend_closed(xenbus_event_queue* events, char* path)
 
 }
 
+static int wait_for_backend_reconfig(xenbus_event_queue* events, char* path)
+{
+   int state;
+
+   TPMFRONT_LOG("Waiting for backend to reconfigure...\n");
+   while(1) {
+      state = xenbus_read_integer(path);
+      if ( state < 0)
+	 state = XenbusStateUnknown;
+      switch(state) {
+	 case XenbusStateUnknown:
+	    TPMFRONT_ERR("Backend Unknown state, forcing shutdown\n");
+	    return -1;
+	 case XenbusStateClosed:
+	    TPMFRONT_LOG("Backend Closed\n");
+	    return 0;
+	 case XenbusStateReconfigured:
+	    TPMFRONT_LOG("Backend Reconfigured\n");
+	    return 0;
+	 default:
+	    xenbus_wait_for_watch(events);
+      }
+   }
+
+}
+
 static int wait_for_backend_state_changed(struct tpmfront_dev* dev, XenbusState state) {
    char* err;
    int ret = 0;
@@ -175,8 +201,11 @@ static int wait_for_backend_state_changed(struct tpmfront_dev* dev, XenbusState
       case XenbusStateClosed:
 	 ret = wait_for_backend_closed(&events, path);
 	 break;
-      default:
+      case XenbusStateReconfigured:
+	 ret = wait_for_backend_reconfig(&events, path);
 	 break;
+      default:
+         TPMFRONT_ERR("Bad wait state %d, ignoring\n", state);
    }
 
    if((err = xenbus_unwatch_path_token(XBT_NIL, path, path))) {
@@ -190,13 +219,13 @@ static int tpmfront_connect(struct tpmfront_dev* dev)
 {
    char* err;
    /* Create shared page */
-   dev->tx = (tpmif_tx_interface_t*) alloc_page();
-   if(dev->tx == NULL) {
+   dev->page = (vtpm_shared_page_t*) alloc_page();
+   if(dev->page == NULL) {
       TPMFRONT_ERR("Unable to allocate page for shared memory\n");
       goto error;
    }
-   memset(dev->tx, 0, PAGE_SIZE);
-   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->tx), 0);
+   memset(dev->page, 0, PAGE_SIZE);
+   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->page), 0);
    TPMFRONT_DEBUG("grant ref is %lu\n", (unsigned long) dev->ring_ref);
 
    /*Create event channel */
@@ -228,7 +257,7 @@ error_postevtchn:
       unbind_evtchn(dev->evtchn);
 error_postmap:
       gnttab_end_access(dev->ring_ref);
-      free_page(dev->tx);
+      free_page(dev->page);
 error:
    return -1;
 }
@@ -240,7 +269,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
    char path[512];
    char* value, *err;
    unsigned long long ival;
-   int i;
 
    printk("============= Init TPM Front ================\n");
 
@@ -279,6 +307,15 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
       goto error;
    }
 
+   /* Publish protocol v2 feature */
+   snprintf(path, 512, "%s/feature-protocol-v2", dev->nodename);
+   if ((err = xenbus_write(XBT_NIL, path, "1")))
+   {
+      TPMFRONT_ERR("Unable to write feature-protocol-v2 node: %s\n", err);
+	  free(err);
+      goto error;
+   }
+
    /* Create and publish grant reference and event channel */
    if (tpmfront_connect(dev)) {
       goto error;
@@ -289,18 +326,18 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
       goto error;
    }
 
-   /* Allocate pages that will contain the messages */
-   dev->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE);
-   if(dev->pages == NULL) {
+   snprintf(path, 512, "%s/feature-protocol-v2", dev->bepath);
+   if((err = xenbus_read(XBT_NIL, path, &value))) {
+      TPMFRONT_ERR("Unable to read %s during tpmfront initialization! error = %s\n", path, err);
+      free(err);
       goto error;
    }
-   memset(dev->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-   for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-      dev->pages[i] = (void*)alloc_page();
-      if(dev->pages[i] == NULL) {
-	 goto error;
-      }
+   if(strcmp(value, "1")) {
+      TPMFRONT_ERR("%s has an invalid value (%s)\n", path, value);
+      free(value);
+      goto error;
    }
+   free(value);
 
    TPMFRONT_LOG("Initialization Completed successfully\n");
 
@@ -314,12 +351,10 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
 {
    char* err;
    char path[512];
-   int i;
-   tpmif_tx_request_t* tx;
    if(dev == NULL) {
       return;
    }
-   TPMFRONT_LOG("Shutting down tpmfront\n");
+   TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for reconfigure" : "");
    /* disconnect */
    if(dev->state == XenbusStateConnected) {
       dev->state = XenbusStateClosing;
@@ -349,27 +384,12 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
       /* Wait for the backend to close and unmap shared pages, ignore any errors */
       wait_for_backend_state_changed(dev, XenbusStateClosed);
 
-      /* Cleanup any shared pages */
-      if(dev->pages) {
-	 for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-	    if(dev->pages[i]) {
-	       tx = &dev->tx->ring[i].req;
-	       if(tx->ref != 0) {
-		  gnttab_end_access(tx->ref);
-	       }
-	       free_page(dev->pages[i]);
-	    }
-	 }
-	 free(dev->pages);
-      }
-
       /* Close event channel and unmap shared page */
       mask_evtchn(dev->evtchn);
       unbind_evtchn(dev->evtchn);
       gnttab_end_access(dev->ring_ref);
 
-      free_page(dev->tx);
-
+      free_page(dev->page);
    }
 
    /* Cleanup memory usage */
@@ -387,13 +407,17 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
 
 int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 {
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
    int i;
-   tpmif_tx_request_t* tx = NULL;
+#endif
    /* Error Checking */
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to send message through disconnected frontend\n");
       return -1;
    }
+   shr = dev->page;
 
 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Sending Msg to backend size=%u", (unsigned int) length);
@@ -407,19 +431,16 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 #endif
 
    /* Copy to shared pages now */
-   for(i = 0; length > 0 && i < TPMIF_TX_RING_SIZE; ++i) {
-      /* Share the page */
-      tx = &dev->tx->ring[i].req;
-      tx->unused = 0;
-      tx->addr = virt_to_mach(dev->pages[i]);
-      tx->ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->pages[i]), 0);
-      /* Copy the bits to the page */
-      tx->size = length > PAGE_SIZE ? PAGE_SIZE : length;
-      memcpy(dev->pages[i], &msg[i * PAGE_SIZE], tx->size);
-
-      /* Update counters */
-      length -= tx->size;
+   offset = sizeof(*shr);
+   if (length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Message too long for shared page\n");
+      return -1;
    }
+   memcpy(offset + (uint8_t*)shr, msg, length);
+   shr->length = length;
+   barrier();
+   shr->state = 1;
+
    dev->waiting = 1;
    dev->resplen = 0;
 #ifdef HAVE_LIBC
@@ -434,44 +455,41 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 }
 int tpmfront_recv(struct tpmfront_dev* dev, uint8_t** msg, size_t *length)
 {
-   tpmif_tx_request_t* tx;
-   int i;
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
+int i;
+#endif
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to receive message from disconnected frontend\n");
       return -1;
    }
    /*Wait for the response */
    wait_event(dev->waitq, (!dev->waiting));
+   shr = dev->page;
+   if (shr->state != 0)
+      goto quit;
 
    /* Initialize */
    *msg = NULL;
-   *length = 0;
+   *length = shr->length;
+   offset = sizeof(*shr);
 
-   /* special case, just quit */
-   tx = &dev->tx->ring[0].req;
-   if(tx->size == 0 ) {
-       goto quit;
-   }
-   /* Get the total size */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      *length += tx->size;
+   if (*length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Reply too long for shared page\n");
+      return -1;
    }
+
    /* Alloc the buffer */
    if(dev->respbuf) {
       free(dev->respbuf);
    }
    *msg = dev->respbuf = malloc(*length);
    dev->resplen = *length;
+
    /* Copy the bits */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      memcpy(&(*msg)[i * PAGE_SIZE], dev->pages[i], tx->size);
-      gnttab_end_access(tx->ref);
-      tx->ref = 0;
-   }
+   memcpy(*msg, offset + (uint8_t*)shr, *length);
+
 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Received response from backend size=%u", (unsigned int) *length);
    for(i = 0; i < *length; ++i) {
@@ -504,6 +522,14 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t*
    return 0;
 }
 
+int tpmfront_set_locality(struct tpmfront_dev* dev, int locality)
+{
+   if (!dev || !dev->page)
+      return -1;
+   dev->page->locality = locality;
+   return 0;
+}
+
 #ifdef HAVE_LIBC
 #include <errno.h>
 int tpmfront_open(struct tpmfront_dev* dev)
diff --git a/xen/include/public/io/tpmif.h b/xen/include/public/io/tpmif.h
index 02ccdab..afc9181 100644
--- a/xen/include/public/io/tpmif.h
+++ b/xen/include/public/io/tpmif.h
@@ -1,7 +1,7 @@
 /******************************************************************************
  * tpmif.h
  *
- * TPM I/O interface for Xen guest OSes.
+ * TPM I/O interface for Xen guest OSes, v2
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -21,48 +21,23 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  *
- * Copyright (c) 2005, IBM Corporation
- *
- * Author: Stefan Berger, stefanb@us.ibm.com
- * Grant table support: Mahadevan Gomathisankaran
- *
- * This code has been derived from tools/libxc/xen/io/netif.h
- *
- * Copyright (c) 2003-2004, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_IO_TPMIF_H__
 #define __XEN_PUBLIC_IO_TPMIF_H__
 
-#include "../grant_table.h"
+struct vtpm_shared_page {
+    uint16_t length;         /* request/response length in bytes */
 
-struct tpmif_tx_request {
-    unsigned long addr;   /* Machine address of packet.   */
-    grant_ref_t ref;      /* grant table access reference */
-    uint16_t unused;
-    uint16_t size;        /* Packet size in bytes.        */
-};
-typedef struct tpmif_tx_request tpmif_tx_request_t;
-
-/*
- * The TPMIF_TX_RING_SIZE defines the number of pages the
- * front-end and backend can exchange (= size of array).
- */
-typedef uint32_t TPMIF_RING_IDX;
-
-#define TPMIF_TX_RING_SIZE 1
-
-/* This structure must fit in a memory page. */
-
-struct tpmif_ring {
-    struct tpmif_tx_request req;
-};
-typedef struct tpmif_ring tpmif_ring_t;
+    uint8_t state;           /* 0 - response ready / idle
+                              * 1 - request ready / working */
+    uint8_t locality;        /* for the current request */
+    uint8_t padding[3];
 
-struct tpmif_tx_interface {
-    struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
+    uint8_t nr_extra_pages;  /* extra pages for long packets; may be zero */
+    uint32_t extra_pages[0]; /* grant IDs; length is actually nr_extra_pages */
 };
-typedef struct tpmif_tx_interface tpmif_tx_interface_t;
+typedef struct vtpm_shared_page vtpm_shared_page_t;
 
 #endif
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:15:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:15:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMsS-0002B5-Js; Tue, 27 Nov 2012 15:15:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdMsQ-0002AG-KR
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:15:11 +0000
Received: from [85.158.143.35:26713] by server-2.bemta-4.messagelabs.com id
	A2/B0-28922-DF8D4B05; Tue, 27 Nov 2012 15:15:09 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-2.tower-21.messagelabs.com!1354029294!4715396!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2457 invoked from network); 27 Nov 2012 15:14:55 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-2.tower-21.messagelabs.com with SMTP;
	27 Nov 2012 15:14:55 -0000
X-TM-IMSS-Message-ID: <c1192c870002f243@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id c1192c870002f243 ;
	Tue, 27 Nov 2012 10:14:03 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARFEpPt007688; 
	Tue, 27 Nov 2012 10:14:51 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu
Date: Tue, 27 Nov 2012 10:14:43 -0500
Message-Id: <1354029286-17652-2-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: dgdegra@tycho.nsa.gov, Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 1/4] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This changes the vTPM shared page ABI from a copy of the Xen network
interface to a single-page interface that better reflects the expected
behavior of a TPM: only a single request packet can be sent at any given
time, and every packet sent generates a single response packet. This
protocol change should also increase efficiency as it avoids mapping and
unmapping grants when possible.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/include/tpmback.h  |   1 +
 extras/mini-os/include/tpmfront.h |   7 +-
 extras/mini-os/tpmback.c          | 159 +++++++++++++++++++------------------
 extras/mini-os/tpmfront.c         | 162 ++++++++++++++++++++++----------------
 xen/include/public/io/tpmif.h     |  45 +++--------
 5 files changed, 191 insertions(+), 183 deletions(-)

diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
index ff86732..ec9eda4 100644
--- a/extras/mini-os/include/tpmback.h
+++ b/extras/mini-os/include/tpmback.h
@@ -43,6 +43,7 @@
 
 struct tpmcmd {
    domid_t domid;		/* Domid of the frontend */
+   uint8_t locality;    /* Locality requested by the frontend */
    unsigned int handle;	/* Handle of the frontend */
    unsigned char uuid[16];			/* uuid of the tpm interface */
 
diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include/tpmfront.h
index fd2cb17..a0c7c4d 100644
--- a/extras/mini-os/include/tpmfront.h
+++ b/extras/mini-os/include/tpmfront.h
@@ -37,9 +37,7 @@ struct tpmfront_dev {
    grant_ref_t ring_ref;
    evtchn_port_t evtchn;
 
-   tpmif_tx_interface_t* tx;
-
-   void** pages;
+   vtpm_shared_page_t *page;
 
    domid_t bedomid;
    char* nodename;
@@ -77,6 +75,9 @@ void shutdown_tpmfront(struct tpmfront_dev* dev);
  * */
 int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen);
 
+/* Set the locality used for communicating with a vTPM */
+int tpmfront_set_locality(struct tpmfront_dev* dev, int locality);
+
 #ifdef HAVE_LIBC
 #include <sys/stat.h>
 /* POSIX IO functions:
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index 658fed1..2d31061 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -86,10 +86,7 @@ struct tpmif {
    evtchn_port_t evtchn;
 
    /* Shared page */
-   tpmif_tx_interface_t* tx;
-
-   /* pointer to TPMIF_RX_RING_SIZE pages */
-   void** pages;
+   vtpm_shared_page_t *page;
 
    enum xenbus_state state;
    enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
@@ -266,6 +263,7 @@ int insert_tpmif(tpmif_t* tpmif)
    unsigned int i, j;
    tpmif_t* tmp;
    char* err;
+   char path[512];
 
    local_irq_save(flags);
 
@@ -303,6 +301,16 @@ int insert_tpmif(tpmif_t* tpmif)
 
    local_irq_restore(flags);
 
+   snprintf(path, 512, "backend/vtpm/%u/%u/feature-protocol-v2", (unsigned int) tpmif->domid, tpmif->handle);
+   if ((err = xenbus_write(XBT_NIL, path, "1")))
+   {
+      /* if we got an error here we should carefully remove the interface and then return */
+      TPMBACK_ERR("Unable to write feature-protocol-v2 node: %s\n", err);
+      free(err);
+      remove_tpmif(tpmif);
+      goto error_post_irq;
+   }
+
    /*Listen for state changes on the new interface */
    if((err = xenbus_watch_path_token(XBT_NIL, tpmif->fe_state_path, tpmif->fe_state_path, &gtpmdev.events)))
    {
@@ -312,7 +320,6 @@ int insert_tpmif(tpmif_t* tpmif)
       remove_tpmif(tpmif);
       goto error_post_irq;
    }
-
    return 0;
 error:
    local_irq_restore(flags);
@@ -386,8 +393,7 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
    tpmif->fe_state_path = NULL;
    tpmif->state = XenbusStateInitialising;
    tpmif->status = DISCONNECTED;
-   tpmif->tx = NULL;
-   tpmif->pages = NULL;
+   tpmif->page = NULL;
    tpmif->flags = 0;
    memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
    return tpmif;
@@ -395,9 +401,6 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
 
 void __free_tpmif(tpmif_t* tpmif)
 {
-   if(tpmif->pages) {
-      free(tpmif->pages);
-   }
    if(tpmif->fe_path) {
       free(tpmif->fe_path);
    }
@@ -430,12 +433,6 @@ tpmif_t* new_tpmif(domid_t domid, unsigned int handle)
       goto error;
    }
 
-   /* allocate pages to be used for shared mapping */
-   if((tpmif->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE)) == NULL) {
-      goto error;
-   }
-   memset(tpmif->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-
    if(tpmif_change_state(tpmif, XenbusStateInitWait)) {
       goto error;
    }
@@ -486,7 +483,7 @@ void free_tpmif(tpmif_t* tpmif)
       tpmif->status = DISCONNECTING;
       mask_evtchn(tpmif->evtchn);
 
-      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1)) {
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
 	 TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
       }
 
@@ -529,9 +526,10 @@ void free_tpmif(tpmif_t* tpmif)
 void tpmback_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
 {
    tpmif_t* tpmif = (tpmif_t*) data;
-   tpmif_tx_request_t* tx = &tpmif->tx->ring[0].req;
-   /* Throw away 0 size events, these can trigger from event channel unmasking */
-   if(tx->size == 0)
+   vtpm_shared_page_t* pg = tpmif->page;
+
+   /* Only pay attention if the request is ready */
+   if (pg->state == 0)
       return;
 
    TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
@@ -584,12 +582,26 @@ int connect_fe(tpmif_t* tpmif)
    }
    free(value);
 
+   /* Check that protocol v2 is being used */
+   snprintf(path, 512, "%s/feature-protocol-v2", tpmif->fe_path);
+   if((err = xenbus_read(XBT_NIL, path, &value))) {
+      TPMBACK_ERR("Unable to read %s during tpmback initialization! error = %s\n", path, err);
+      free(err);
+      return -1;
+   }
+   if(strcmp(value, "1")) {
+      TPMBACK_ERR("%s has an invalid value (%s)\n", path, value);
+      free(value);
+      return -1;
+   }
+   free(value);
+
+
    domid = tpmif->domid;
-   if((tpmif->tx = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
+   if((tpmif->page = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
       TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
       return -1;
    }
-   memset(tpmif->tx, 0, PAGE_SIZE);
 
    /*Bind the event channel */
    if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler, tpmif, &tpmif->evtchn)))
@@ -618,10 +630,28 @@ error_post_evtchn:
    mask_evtchn(tpmif->evtchn);
    unbind_evtchn(tpmif->evtchn);
 error_post_map:
-   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1);
+   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1);
    return -1;
 }
 
+static void disconnect_fe(tpmif_t* tpmif)
+{
+   if (tpmif->status == CONNECTED) {
+      tpmif->status = DISCONNECTING;
+      mask_evtchn(tpmif->evtchn);
+
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
+	 TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
+      }
+
+      unbind_evtchn(tpmif->evtchn);
+   }
+   tpmif->status = DISCONNECTED;
+   tpmif_change_state(tpmif, XenbusStateReconfigured);
+
+   TPMBACK_LOG("Frontend %u/%u disconnected\n", (unsigned int) tpmif->domid, tpmif->handle);
+}
+
 static int frontend_changed(tpmif_t* tpmif)
 {
    int state = xenbus_read_integer(tpmif->fe_state_path);
@@ -874,6 +904,7 @@ void shutdown_tpmback(void)
 inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, unsigned char uuid[16])
 {
    tpmcmd->domid = domid;
+   tpmcmd->locality = -1;
    tpmcmd->handle = handle;
    memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
    tpmcmd->req = NULL;
@@ -884,12 +915,12 @@ inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, un
 
 tpmcmd_t* get_request(tpmif_t* tpmif) {
    tpmcmd_t* cmd;
-   tpmif_tx_request_t* tx;
-   int offset;
-   int tocopy;
-   int i;
-   uint32_t domid;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+   int i;
+#endif
 
    local_irq_save(flags);
 
@@ -899,35 +930,22 @@ tpmcmd_t* get_request(tpmif_t* tpmif) {
    }
    init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);
 
-   tx = &tpmif->tx->ring[0].req;
-   cmd->req_len = tx->size;
+   shr = tpmif->page;
+   cmd->req_len = shr->length;
+   cmd->locality = shr->locality;
+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->req_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
+   }
    /* Allocate the buffer */
    if(cmd->req_len) {
       if((cmd->req = malloc(cmd->req_len)) == NULL) {
 	 goto error;
       }
    }
-   /* Copy the bits from the shared pages */
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->req_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_READ)) == NULL) {
-	 TPMBACK_ERR("%u/%u Unable to map shared page during read!\n", (unsigned int) tpmif->domid, tpmif->handle);
-	 goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->req_len - offset, PAGE_SIZE);
-      memcpy(&cmd->req[offset], tpmif->pages[i], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
-
-   }
+   /* Copy the bits from the shared page(s) */
+   memcpy(cmd->req, offset + (uint8_t*)shr, cmd->req_len);
 
 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Received Tpm Command from %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->req_len);
@@ -958,38 +976,24 @@ error:
 
 void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
 {
-   tpmif_tx_request_t* tx;
-   int offset;
-   int i;
-   uint32_t domid;
-   int tocopy;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+int i;
+#endif
 
    local_irq_save(flags);
 
-   tx = &tpmif->tx->ring[0].req;
-   tx->size = cmd->resp_len;
-
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->resp_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_WRITE)) == NULL) {
-	 TPMBACK_ERR("%u/%u Unable to map shared page during write!\n", (unsigned int) tpmif->domid, tpmif->handle);
-	 goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->resp_len - offset, PAGE_SIZE);
-      memcpy(tpmif->pages[i], &cmd->resp[offset], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
+   shr = tpmif->page;
+   shr->length = cmd->resp_len;
 
+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->resp_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
    }
+   memcpy(offset + (uint8_t*)shr, cmd->resp, cmd->resp_len);
 
 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Sent response to %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->resp_len);
@@ -1003,6 +1007,7 @@ void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
 #endif
    /* clear the ready flag and send the event channel notice to the frontend */
    tpmif_req_finished(tpmif);
+   shr->state = 0;
    notify_remote_via_evtchn(tpmif->evtchn);
 error:
    local_irq_restore(flags);
diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
index 0218d7f..c1cbab3 100644
--- a/extras/mini-os/tpmfront.c
+++ b/extras/mini-os/tpmfront.c
@@ -153,6 +153,32 @@ static int wait_for_backend_closed(xenbus_event_queue* events, char* path)
 
 }
 
+static int wait_for_backend_reconfig(xenbus_event_queue* events, char* path)
+{
+   int state;
+
+   TPMFRONT_LOG("Waiting for backend to reconfigure...\n");
+   while(1) {
+      state = xenbus_read_integer(path);
+      if ( state < 0)
+	 state = XenbusStateUnknown;
+      switch(state) {
+	 case XenbusStateUnknown:
+	    TPMFRONT_ERR("Backend Unknown state, forcing shutdown\n");
+	    return -1;
+	 case XenbusStateClosed:
+	    TPMFRONT_LOG("Backend Closed\n");
+	    return 0;
+	 case XenbusStateReconfigured:
+	    TPMFRONT_LOG("Backend Reconfigured\n");
+	    return 0;
+	 default:
+	    xenbus_wait_for_watch(events);
+      }
+   }
+
+}
+
 static int wait_for_backend_state_changed(struct tpmfront_dev* dev, XenbusState state) {
    char* err;
    int ret = 0;
@@ -175,8 +201,11 @@ static int wait_for_backend_state_changed(struct tpmfront_dev* dev, XenbusState
       case XenbusStateClosed:
 	 ret = wait_for_backend_closed(&events, path);
 	 break;
-      default:
+      case XenbusStateReconfigured:
+	 ret = wait_for_backend_reconfig(&events, path);
 	 break;
+      default:
+         TPMFRONT_ERR("Bad wait state %d, ignoring\n", state);
    }
 
    if((err = xenbus_unwatch_path_token(XBT_NIL, path, path))) {
@@ -190,13 +219,13 @@ static int tpmfront_connect(struct tpmfront_dev* dev)
 {
    char* err;
    /* Create shared page */
-   dev->tx = (tpmif_tx_interface_t*) alloc_page();
-   if(dev->tx == NULL) {
+   dev->page = (vtpm_shared_page_t*) alloc_page();
+   if(dev->page == NULL) {
       TPMFRONT_ERR("Unable to allocate page for shared memory\n");
       goto error;
    }
-   memset(dev->tx, 0, PAGE_SIZE);
-   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->tx), 0);
+   memset(dev->page, 0, PAGE_SIZE);
+   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->page), 0);
    TPMFRONT_DEBUG("grant ref is %lu\n", (unsigned long) dev->ring_ref);
 
    /*Create event channel */
@@ -228,7 +257,7 @@ error_postevtchn:
       unbind_evtchn(dev->evtchn);
 error_postmap:
       gnttab_end_access(dev->ring_ref);
-      free_page(dev->tx);
+      free_page(dev->page);
 error:
    return -1;
 }
@@ -240,7 +269,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
    char path[512];
    char* value, *err;
    unsigned long long ival;
-   int i;
 
    printk("============= Init TPM Front ================\n");
 
@@ -279,6 +307,15 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
       goto error;
    }
 
+   /* Publish protocol v2 feature */
+   snprintf(path, 512, "%s/feature-protocol-v2", dev->nodename);
+   if ((err = xenbus_write(XBT_NIL, path, "1")))
+   {
+      TPMFRONT_ERR("Unable to write feature-protocol-v2 node: %s\n", err);
+	  free(err);
+      goto error;
+   }
+
    /* Create and publish grant reference and event channel */
    if (tpmfront_connect(dev)) {
       goto error;
@@ -289,18 +326,18 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
       goto error;
    }
 
-   /* Allocate pages that will contain the messages */
-   dev->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE);
-   if(dev->pages == NULL) {
+   snprintf(path, 512, "%s/feature-protocol-v2", dev->bepath);
+   if((err = xenbus_read(XBT_NIL, path, &value))) {
+      TPMFRONT_ERR("Unable to read %s during tpmfront initialization! error = %s\n", path, err);
+      free(err);
       goto error;
    }
-   memset(dev->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-   for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-      dev->pages[i] = (void*)alloc_page();
-      if(dev->pages[i] == NULL) {
-	 goto error;
-      }
+   if(strcmp(value, "1")) {
+      TPMFRONT_ERR("%s has an invalid value (%s)\n", path, value);
+      free(value);
+      goto error;
    }
+   free(value);
 
    TPMFRONT_LOG("Initialization Completed successfully\n");
 
@@ -314,12 +351,10 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
 {
    char* err;
    char path[512];
-   int i;
-   tpmif_tx_request_t* tx;
    if(dev == NULL) {
       return;
    }
-   TPMFRONT_LOG("Shutting down tpmfront\n");
+   TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for reconfigure" : "");
    /* disconnect */
    if(dev->state == XenbusStateConnected) {
       dev->state = XenbusStateClosing;
@@ -349,27 +384,12 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
       /* Wait for the backend to close and unmap shared pages, ignore any errors */
       wait_for_backend_state_changed(dev, XenbusStateClosed);
 
-      /* Cleanup any shared pages */
-      if(dev->pages) {
-	 for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-	    if(dev->pages[i]) {
-	       tx = &dev->tx->ring[i].req;
-	       if(tx->ref != 0) {
-		  gnttab_end_access(tx->ref);
-	       }
-	       free_page(dev->pages[i]);
-	    }
-	 }
-	 free(dev->pages);
-      }
-
       /* Close event channel and unmap shared page */
       mask_evtchn(dev->evtchn);
       unbind_evtchn(dev->evtchn);
       gnttab_end_access(dev->ring_ref);
 
-      free_page(dev->tx);
-
+      free_page(dev->page);
    }
 
    /* Cleanup memory usage */
@@ -387,13 +407,17 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
 
 int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 {
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
    int i;
-   tpmif_tx_request_t* tx = NULL;
+#endif
    /* Error Checking */
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to send message through disconnected frontend\n");
       return -1;
    }
+   shr = dev->page;
 
 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Sending Msg to backend size=%u", (unsigned int) length);
@@ -407,19 +431,16 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 #endif
 
    /* Copy to shared pages now */
-   for(i = 0; length > 0 && i < TPMIF_TX_RING_SIZE; ++i) {
-      /* Share the page */
-      tx = &dev->tx->ring[i].req;
-      tx->unused = 0;
-      tx->addr = virt_to_mach(dev->pages[i]);
-      tx->ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->pages[i]), 0);
-      /* Copy the bits to the page */
-      tx->size = length > PAGE_SIZE ? PAGE_SIZE : length;
-      memcpy(dev->pages[i], &msg[i * PAGE_SIZE], tx->size);
-
-      /* Update counters */
-      length -= tx->size;
+   offset = sizeof(*shr);
+   if (length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Message too long for shared page\n");
+      return -1;
    }
+   memcpy(offset + (uint8_t*)shr, msg, length);
+   shr->length = length;
+   barrier();
+   shr->state = 1;
+
    dev->waiting = 1;
    dev->resplen = 0;
 #ifdef HAVE_LIBC
@@ -434,44 +455,41 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 }
 int tpmfront_recv(struct tpmfront_dev* dev, uint8_t** msg, size_t *length)
 {
-   tpmif_tx_request_t* tx;
-   int i;
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
+int i;
+#endif
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to receive message from disconnected frontend\n");
       return -1;
    }
    /*Wait for the response */
    wait_event(dev->waitq, (!dev->waiting));
+   shr = dev->page;
+   if (shr->state != 0)
+      goto quit;
 
    /* Initialize */
    *msg = NULL;
-   *length = 0;
+   *length = shr->length;
+   offset = sizeof(*shr);
 
-   /* special case, just quit */
-   tx = &dev->tx->ring[0].req;
-   if(tx->size == 0 ) {
-       goto quit;
-   }
-   /* Get the total size */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      *length += tx->size;
+   if (*length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Reply too long for shared page\n");
+      return -1;
    }
+
    /* Alloc the buffer */
    if(dev->respbuf) {
       free(dev->respbuf);
    }
    *msg = dev->respbuf = malloc(*length);
    dev->resplen = *length;
+
    /* Copy the bits */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      memcpy(&(*msg)[i * PAGE_SIZE], dev->pages[i], tx->size);
-      gnttab_end_access(tx->ref);
-      tx->ref = 0;
-   }
+   memcpy(*msg, offset + (uint8_t*)shr, *length);
+
 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Received response from backend size=%u", (unsigned int) *length);
    for(i = 0; i < *length; ++i) {
@@ -504,6 +522,14 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t*
    return 0;
 }
 
+int tpmfront_set_locality(struct tpmfront_dev* dev, int locality)
+{
+   if (!dev || !dev->page)
+      return -1;
+   dev->page->locality = locality;
+   return 0;
+}
+
 #ifdef HAVE_LIBC
 #include <errno.h>
 int tpmfront_open(struct tpmfront_dev* dev)
diff --git a/xen/include/public/io/tpmif.h b/xen/include/public/io/tpmif.h
index 02ccdab..afc9181 100644
--- a/xen/include/public/io/tpmif.h
+++ b/xen/include/public/io/tpmif.h
@@ -1,7 +1,7 @@
 /******************************************************************************
  * tpmif.h
  *
- * TPM I/O interface for Xen guest OSes.
+ * TPM I/O interface for Xen guest OSes, v2
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -21,48 +21,23 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  *
- * Copyright (c) 2005, IBM Corporation
- *
- * Author: Stefan Berger, stefanb@us.ibm.com
- * Grant table support: Mahadevan Gomathisankaran
- *
- * This code has been derived from tools/libxc/xen/io/netif.h
- *
- * Copyright (c) 2003-2004, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_IO_TPMIF_H__
 #define __XEN_PUBLIC_IO_TPMIF_H__
 
-#include "../grant_table.h"
+struct vtpm_shared_page {
+    uint16_t length;         /* request/response length in bytes */
 
-struct tpmif_tx_request {
-    unsigned long addr;   /* Machine address of packet.   */
-    grant_ref_t ref;      /* grant table access reference */
-    uint16_t unused;
-    uint16_t size;        /* Packet size in bytes.        */
-};
-typedef struct tpmif_tx_request tpmif_tx_request_t;
-
-/*
- * The TPMIF_TX_RING_SIZE defines the number of pages the
- * front-end and backend can exchange (= size of array).
- */
-typedef uint32_t TPMIF_RING_IDX;
-
-#define TPMIF_TX_RING_SIZE 1
-
-/* This structure must fit in a memory page. */
-
-struct tpmif_ring {
-    struct tpmif_tx_request req;
-};
-typedef struct tpmif_ring tpmif_ring_t;
+    uint8_t state;           /* 0 - response ready / idle
+                              * 1 - request ready / working */
+    uint8_t locality;        /* for the current request */
+    uint8_t padding[3];
 
-struct tpmif_tx_interface {
-    struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
+    uint8_t nr_extra_pages;  /* extra pages for long packets; may be zero */
+    uint32_t extra_pages[0]; /* grant IDs; length is actually nr_extra_pages */
 };
-typedef struct tpmif_tx_interface tpmif_tx_interface_t;
+typedef struct vtpm_shared_page vtpm_shared_page_t;
 
 #endif
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:15:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:15:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMsr-0002GN-1b; Tue, 27 Nov 2012 15:15:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdMsp-0002Fy-EF
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:15:35 +0000
Received: from [85.158.143.35:47950] by server-1.bemta-4.messagelabs.com id
	42/74-27934-619D4B05; Tue, 27 Nov 2012 15:15:34 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354029294!4625521!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23151 invoked from network); 27 Nov 2012 15:14:54 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-9.tower-21.messagelabs.com with SMTP;
	27 Nov 2012 15:14:54 -0000
X-TM-IMSS-Message-ID: <c1192d900002f245@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id c1192d900002f245 ;
	Tue, 27 Nov 2012 10:14:04 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARFEpPv007688; 
	Tue, 27 Nov 2012 10:14:52 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu
Date: Tue, 27 Nov 2012 10:14:45 -0500
Message-Id: <1354029286-17652-4-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: dgdegra@tycho.nsa.gov, Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 3/4] stubdom/grub: send kernel measurements to
	vTPM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This allows a domU with an arbitrary kernel and initrd to take advantage
of the static root of trust provided by a vTPM.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/grub/Makefile   |   2 +-
 stubdom/grub/kexec.c    |  62 ++++++++++++
 stubdom/grub/minios.cfg |   1 +
 stubdom/grub/sha1.c     | 260 ++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 324 insertions(+), 1 deletion(-)
 create mode 100644 stubdom/grub/sha1.c

diff --git a/stubdom/grub/Makefile b/stubdom/grub/Makefile
index d6e3a1e..f1b5c3e 100644
--- a/stubdom/grub/Makefile
+++ b/stubdom/grub/Makefile
@@ -59,7 +59,7 @@ NETBOOT_SOURCES:=$(addprefix netboot/,$(NETBOOT_SOURCES))
 
 $(BOOT): DEF_CPPFLAGS+=-D__ASSEMBLY__
 
-PV_GRUB_SOURCES = kexec.c mini-os.c
+PV_GRUB_SOURCES = sha1.c kexec.c mini-os.c
 
 SOURCES = $(NETBOOT_SOURCES) $(STAGE2_SOURCES) $(PV_GRUB_SOURCES)
 
diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index b21c91a..ba48cb7 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -117,6 +117,66 @@ int kexec_allocate(struct xc_dom_image *dom, xen_vaddr_t up_to)
     return 0;
 }
 
+static inline uint16_t be16(uint16_t v)
+{
+	return (v >> 8) | (v << 8);
+}
+
+static inline uint32_t be32(uint32_t v)
+{
+	return (be16(v) << 16) | be16(v >> 16);
+}
+
+void sha_compute(uint32_t *buf, void *src, uint32_t len);
+
+#include <tpmfront.h>
+
+#define TPM_TAG_RQU_COMMAND 0xC1
+#define TPM_ORD_Extend 20
+
+struct pcr_extend_cmd {
+	uint16_t tag;
+	uint32_t size;
+	uint32_t ord;
+
+	uint32_t pcr;
+	uint32_t hash[5];
+} __attribute__((packed));
+
+static void tpm_hash2pcr(struct xc_dom_image *dom, char *cmdline)
+{
+	struct tpmfront_dev* tpm = init_tpmfront(NULL);
+	uint8_t *resp;
+	size_t resplen = 0;
+	struct pcr_extend_cmd cmd;
+
+	/* If all guests have access to a vTPM, it may be useful to replace this
+	 * with ASSERT(tpm) to prevent configuration errors from allowing a guest
+	 * to boot without a TPM (or with a TPM that has not been sent any
+	 * measurements, which could allow forging the measurements).
+	 */
+	if (!tpm)
+		return;
+
+	cmd.tag = be16(TPM_TAG_RQU_COMMAND);
+	cmd.size = be32(sizeof(cmd));
+	cmd.ord = be32(TPM_ORD_Extend);
+	cmd.pcr = be32(4); // PCR #4 for kernel
+	sha_compute(cmd.hash, dom->kernel_blob, dom->kernel_size);
+
+	tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
+
+	cmd.pcr = be32(5); // PCR #5 for cmdline
+	sha_compute(cmd.hash, cmdline, strlen(cmdline));
+	tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
+
+	cmd.pcr = be32(5); // PCR #5 for initrd
+	sha_compute(cmd.hash, dom->ramdisk_blob, dom->ramdisk_size);
+	tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
+
+	shutdown_tpmfront(tpm, 1);
+}
+
 void kexec(void *kernel, long kernel_size, void *module, long module_size, char *cmdline, unsigned long flags)
 {
     struct xc_dom_image *dom;
@@ -151,6 +211,8 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
     dom->console_evtchn = start_info.console.domU.evtchn;
     dom->xenstore_evtchn = start_info.store_evtchn;
 
+    tpm_hash2pcr(dom, cmdline);
+
     if ( (rc = xc_dom_boot_xen_init(dom, xc_handle, domid)) != 0 ) {
         grub_printf("xc_dom_boot_xen_init returned %d\n", rc);
         errnum = ERR_BOOT_FAILURE;
diff --git a/stubdom/grub/minios.cfg b/stubdom/grub/minios.cfg
index 40cfa68..8df4909 100644
--- a/stubdom/grub/minios.cfg
+++ b/stubdom/grub/minios.cfg
@@ -1,2 +1,3 @@
 CONFIG_START_NETWORK=n
 CONFIG_SPARSE_BSS=n
+CONFIG_TPMFRONT=y
diff --git a/stubdom/grub/sha1.c b/stubdom/grub/sha1.c
new file mode 100644
index 0000000..2ad2e07
--- /dev/null
+++ b/stubdom/grub/sha1.c
@@ -0,0 +1,260 @@
+/*
+ * SHA1 routine optimized to do word accesses rather than byte accesses,
+ * and to avoid unnecessary copies into the context array.
+ *
+ * This was based on the git SHA1 implementation.
+ */
+
+#include <stdint.h>
+#include <string.h>
+
+static inline uint16_t be16(uint16_t v)
+{
+	return (v >> 8) | (v << 8);
+}
+
+static inline uint32_t be32(uint32_t v)
+{
+	return (be16(v) << 16) | be16(v >> 16);
+}
+
+static inline uint32_t get_unaligned_be32(uint32_t *v)
+{
+	return be32(*v);
+}
+
+/*
+ * rol32 - rotate a 32-bit value left
+ *
+ * @word: value to rotate
+ * @shift: bits to roll
+ */
+static inline uint32_t rol32(uint32_t word, unsigned int shift)
+{
+    return (word << shift) | (word >> (32 - shift));
+}
+
+/*
+ * ror32 - rotate a 32-bit value right
+ *
+ * @word: value to rotate
+ * @shift: bits to roll
+ */
+static inline uint32_t ror32(uint32_t word, unsigned int shift)
+{
+    return (word >> shift) | (word << (32 - shift));
+}
+
+
+/*
+ * If you have 32 registers or more, the compiler can (and should)
+ * try to change the array[] accesses into registers. However, on
+ * machines with less than ~25 registers, that won't really work,
+ * and at least gcc will make an unholy mess of it.
+ *
+ * So to avoid that mess which just slows things down, we force
+ * the stores to memory to actually happen (we might be better off
+ * with a 'W(t)=(val);asm("":"+m" (W(t))' there instead, as
+ * suggested by Artur Skawina - that will also make gcc unable to
+ * try to do the silly "optimize away loads" part because it won't
+ * see what the value will be).
+ *
+ * Ben Herrenschmidt reports that on PPC, the C version comes close
+ * to the optimized asm with this (ie on PPC you don't want that
+ * 'volatile', since there are lots of registers).
+ *
+ * On ARM we get the best code generation by forcing a full memory barrier
+ * between each SHA_ROUND, otherwise gcc happily get wild with spilling and
+ * the stack frame size simply explode and performance goes down the drain.
+ */
+
+#if 1
+  #define setW(x, val) (*(volatile uint32_t *)&W(x) = (val))
+#else
+  #define setW(x, val) (W(x) = (val))
+#endif
+
+/* This "rolls" over the 512-bit array */
+#define W(x) (array[(x)&15])
+
+/*
+ * Where do we get the source from? The first 16 iterations get it from
+ * the input data, the next mix it from the 512-bit array.
+ */
+#define SHA_SRC(t) get_unaligned_be32((uint32_t *)data + t)
+#define SHA_MIX(t) rol32(W(t+13) ^ W(t+8) ^ W(t+2) ^ W(t), 1)
+
+#define SHA_ROUND(t, input, fn, constant, A, B, C, D, E) do { \
+	uint32_t TEMP = input(t); setW(t, TEMP); \
+	E += TEMP + rol32(A,5) + (fn) + (constant); \
+	B = ror32(B, 2); } while (0)
+
+#define T_0_15(t, A, B, C, D, E)  SHA_ROUND(t, SHA_SRC, (((C^D)&B)^D) , 0x5a827999, A, B, C, D, E )
+#define T_16_19(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (((C^D)&B)^D) , 0x5a827999, A, B, C, D, E )
+#define T_20_39(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (B^C^D) , 0x6ed9eba1, A, B, C, D, E )
+#define T_40_59(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, ((B&C)+(D&(B^C))) , 0x8f1bbcdc, A, B, C, D, E )
+#define T_60_79(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (B^C^D) ,  0xca62c1d6, A, B, C, D, E )
+
+/**
+ * sha_transform - single block SHA1 transform
+ *
+ * @digest: 160 bit digest to update
+ * @data:   512 bits of data to hash
+ * @array:  16 words of workspace (see note)
+ *
+ * This function generates a SHA1 digest for a single 512-bit block.
+ * Be warned, it does not handle padding and message digest, do not
+ * confuse it with the full FIPS 180-1 digest algorithm for variable
+ * length messages.
+ *
+ * Note: If the hash is security sensitive, the caller should be sure
+ * to clear the workspace. This is left to the caller to avoid
+ * unnecessary clears between chained hashing operations.
+ */
+void sha_transform(uint32_t *digest, const char *data, uint32_t *array)
+{
+	uint32_t A, B, C, D, E;
+
+	A = digest[0];
+	B = digest[1];
+	C = digest[2];
+	D = digest[3];
+	E = digest[4];
+
+	/* Round 1 - iterations 0-16 take their input from 'data' */
+	T_0_15( 0, A, B, C, D, E);
+	T_0_15( 1, E, A, B, C, D);
+	T_0_15( 2, D, E, A, B, C);
+	T_0_15( 3, C, D, E, A, B);
+	T_0_15( 4, B, C, D, E, A);
+	T_0_15( 5, A, B, C, D, E);
+	T_0_15( 6, E, A, B, C, D);
+	T_0_15( 7, D, E, A, B, C);
+	T_0_15( 8, C, D, E, A, B);
+	T_0_15( 9, B, C, D, E, A);
+	T_0_15(10, A, B, C, D, E);
+	T_0_15(11, E, A, B, C, D);
+	T_0_15(12, D, E, A, B, C);
+	T_0_15(13, C, D, E, A, B);
+	T_0_15(14, B, C, D, E, A);
+	T_0_15(15, A, B, C, D, E);
+
+	/* Round 1 - tail. Input from 512-bit mixing array */
+	T_16_19(16, E, A, B, C, D);
+	T_16_19(17, D, E, A, B, C);
+	T_16_19(18, C, D, E, A, B);
+	T_16_19(19, B, C, D, E, A);
+
+	/* Round 2 */
+	T_20_39(20, A, B, C, D, E);
+	T_20_39(21, E, A, B, C, D);
+	T_20_39(22, D, E, A, B, C);
+	T_20_39(23, C, D, E, A, B);
+	T_20_39(24, B, C, D, E, A);
+	T_20_39(25, A, B, C, D, E);
+	T_20_39(26, E, A, B, C, D);
+	T_20_39(27, D, E, A, B, C);
+	T_20_39(28, C, D, E, A, B);
+	T_20_39(29, B, C, D, E, A);
+	T_20_39(30, A, B, C, D, E);
+	T_20_39(31, E, A, B, C, D);
+	T_20_39(32, D, E, A, B, C);
+	T_20_39(33, C, D, E, A, B);
+	T_20_39(34, B, C, D, E, A);
+	T_20_39(35, A, B, C, D, E);
+	T_20_39(36, E, A, B, C, D);
+	T_20_39(37, D, E, A, B, C);
+	T_20_39(38, C, D, E, A, B);
+	T_20_39(39, B, C, D, E, A);
+
+	/* Round 3 */
+	T_40_59(40, A, B, C, D, E);
+	T_40_59(41, E, A, B, C, D);
+	T_40_59(42, D, E, A, B, C);
+	T_40_59(43, C, D, E, A, B);
+	T_40_59(44, B, C, D, E, A);
+	T_40_59(45, A, B, C, D, E);
+	T_40_59(46, E, A, B, C, D);
+	T_40_59(47, D, E, A, B, C);
+	T_40_59(48, C, D, E, A, B);
+	T_40_59(49, B, C, D, E, A);
+	T_40_59(50, A, B, C, D, E);
+	T_40_59(51, E, A, B, C, D);
+	T_40_59(52, D, E, A, B, C);
+	T_40_59(53, C, D, E, A, B);
+	T_40_59(54, B, C, D, E, A);
+	T_40_59(55, A, B, C, D, E);
+	T_40_59(56, E, A, B, C, D);
+	T_40_59(57, D, E, A, B, C);
+	T_40_59(58, C, D, E, A, B);
+	T_40_59(59, B, C, D, E, A);
+
+	/* Round 4 */
+	T_60_79(60, A, B, C, D, E);
+	T_60_79(61, E, A, B, C, D);
+	T_60_79(62, D, E, A, B, C);
+	T_60_79(63, C, D, E, A, B);
+	T_60_79(64, B, C, D, E, A);
+	T_60_79(65, A, B, C, D, E);
+	T_60_79(66, E, A, B, C, D);
+	T_60_79(67, D, E, A, B, C);
+	T_60_79(68, C, D, E, A, B);
+	T_60_79(69, B, C, D, E, A);
+	T_60_79(70, A, B, C, D, E);
+	T_60_79(71, E, A, B, C, D);
+	T_60_79(72, D, E, A, B, C);
+	T_60_79(73, C, D, E, A, B);
+	T_60_79(74, B, C, D, E, A);
+	T_60_79(75, A, B, C, D, E);
+	T_60_79(76, E, A, B, C, D);
+	T_60_79(77, D, E, A, B, C);
+	T_60_79(78, C, D, E, A, B);
+	T_60_79(79, B, C, D, E, A);
+
+	digest[0] += A;
+	digest[1] += B;
+	digest[2] += C;
+	digest[3] += D;
+	digest[4] += E;
+}
+
+/**
+ * sha_init - initialize the vectors for a SHA1 digest
+ * @buf: vector to initialize
+ */
+void sha_init(uint32_t *buf)
+{
+	buf[0] = 0x67452301;
+	buf[1] = 0xefcdab89;
+	buf[2] = 0x98badcfe;
+	buf[3] = 0x10325476;
+	buf[4] = 0xc3d2e1f0;
+}
+
+void sha_compute(uint32_t *buf, void *src, uint32_t len)
+{
+	uint32_t pos = 0;
+	uint8_t final[64];
+	uint32_t work[16];
+	sha_init(buf);
+	while (len >= pos + 64) {
+		sha_transform(buf, src + pos, work);
+		pos += 64;
+	}
+	memcpy(final, src + pos, len - pos);
+	// done with src; pos is now relative to final
+	pos = len - pos;
+	final[pos++] = 0x80;
+	memset(final + pos, 0, sizeof(final) - pos);
+	if (pos > 56) {
+		sha_transform(buf, (void*)final, work);
+		memset(final, 0, sizeof(final));
+	}
+	*(uint32_t*)(final + 60) = be32(len << 3);
+	sha_transform(buf, (void*)final, work);
+	buf[0] = be32(buf[0]);
+	buf[1] = be32(buf[1]);
+	buf[2] = be32(buf[2]);
+	buf[3] = be32(buf[3]);
+	buf[4] = be32(buf[4]);
+}
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:15:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:15:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMsr-0002GN-1b; Tue, 27 Nov 2012 15:15:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdMsp-0002Fy-EF
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:15:35 +0000
Received: from [85.158.143.35:47950] by server-1.bemta-4.messagelabs.com id
	42/74-27934-619D4B05; Tue, 27 Nov 2012 15:15:34 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354029294!4625521!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23151 invoked from network); 27 Nov 2012 15:14:54 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-9.tower-21.messagelabs.com with SMTP;
	27 Nov 2012 15:14:54 -0000
X-TM-IMSS-Message-ID: <c1192d900002f245@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id c1192d900002f245 ;
	Tue, 27 Nov 2012 10:14:04 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARFEpPv007688; 
	Tue, 27 Nov 2012 10:14:52 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu
Date: Tue, 27 Nov 2012 10:14:45 -0500
Message-Id: <1354029286-17652-4-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: dgdegra@tycho.nsa.gov, Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 3/4] stubdom/grub: send kernel measurements to
	vTPM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This allows a domU with an arbitrary kernel and initrd to take advantage
of the static root of trust provided by a vTPM.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/grub/Makefile   |   2 +-
 stubdom/grub/kexec.c    |  62 ++++++++++++
 stubdom/grub/minios.cfg |   1 +
 stubdom/grub/sha1.c     | 260 ++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 324 insertions(+), 1 deletion(-)
 create mode 100644 stubdom/grub/sha1.c

diff --git a/stubdom/grub/Makefile b/stubdom/grub/Makefile
index d6e3a1e..f1b5c3e 100644
--- a/stubdom/grub/Makefile
+++ b/stubdom/grub/Makefile
@@ -59,7 +59,7 @@ NETBOOT_SOURCES:=$(addprefix netboot/,$(NETBOOT_SOURCES))
 
 $(BOOT): DEF_CPPFLAGS+=-D__ASSEMBLY__
 
-PV_GRUB_SOURCES = kexec.c mini-os.c
+PV_GRUB_SOURCES = sha1.c kexec.c mini-os.c
 
 SOURCES = $(NETBOOT_SOURCES) $(STAGE2_SOURCES) $(PV_GRUB_SOURCES)
 
diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index b21c91a..ba48cb7 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -117,6 +117,66 @@ int kexec_allocate(struct xc_dom_image *dom, xen_vaddr_t up_to)
     return 0;
 }
 
+static inline uint16_t be16(uint16_t v)
+{
+	return (v >> 8) | (v << 8);
+}
+
+static inline uint32_t be32(uint32_t v)
+{
+	return (be16(v) << 16) | be16(v >> 16);
+}
+
+void sha_compute(uint32_t *buf, void *src, uint32_t len);
+
+#include <tpmfront.h>
+
+#define TPM_TAG_RQU_COMMAND 0xC1
+#define TPM_ORD_Extend 20
+
+struct pcr_extend_cmd {
+	uint16_t tag;
+	uint32_t size;
+	uint32_t ord;
+
+	uint32_t pcr;
+	uint32_t hash[5];
+} __attribute__((packed));
+
+static void tpm_hash2pcr(struct xc_dom_image *dom, char *cmdline)
+{
+	struct tpmfront_dev* tpm = init_tpmfront(NULL);
+	uint8_t *resp;
+	size_t resplen = 0;
+	struct pcr_extend_cmd cmd;
+
+	/* If all guests have access to a vTPM, it may be useful to replace this
+	 * with ASSERT(tpm) to prevent configuration errors from allowing a guest
+	 * to boot without a TPM (or with a TPM that has not been sent any
+	 * measurements, which could allow forging the measurements).
+	 */
+	if (!tpm)
+		return;
+
+	cmd.tag = be16(TPM_TAG_RQU_COMMAND);
+	cmd.size = be32(sizeof(cmd));
+	cmd.ord = be32(TPM_ORD_Extend);
+	cmd.pcr = be32(4); // PCR #4 for kernel
+	sha_compute(cmd.hash, dom->kernel_blob, dom->kernel_size);
+
+	tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
+
+	cmd.pcr = be32(5); // PCR #5 for cmdline
+	sha_compute(cmd.hash, cmdline, strlen(cmdline));
+	tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
+
+	cmd.pcr = be32(5); // PCR #5 for initrd
+	sha_compute(cmd.hash, dom->ramdisk_blob, dom->ramdisk_size);
+	tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
+
+	shutdown_tpmfront(tpm, 1);
+}
+
 void kexec(void *kernel, long kernel_size, void *module, long module_size, char *cmdline, unsigned long flags)
 {
     struct xc_dom_image *dom;
@@ -151,6 +211,8 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
     dom->console_evtchn = start_info.console.domU.evtchn;
     dom->xenstore_evtchn = start_info.store_evtchn;
 
+    tpm_hash2pcr(dom, cmdline);
+
     if ( (rc = xc_dom_boot_xen_init(dom, xc_handle, domid)) != 0 ) {
         grub_printf("xc_dom_boot_xen_init returned %d\n", rc);
         errnum = ERR_BOOT_FAILURE;
diff --git a/stubdom/grub/minios.cfg b/stubdom/grub/minios.cfg
index 40cfa68..8df4909 100644
--- a/stubdom/grub/minios.cfg
+++ b/stubdom/grub/minios.cfg
@@ -1,2 +1,3 @@
 CONFIG_START_NETWORK=n
 CONFIG_SPARSE_BSS=n
+CONFIG_TPMFRONT=y
diff --git a/stubdom/grub/sha1.c b/stubdom/grub/sha1.c
new file mode 100644
index 0000000..2ad2e07
--- /dev/null
+++ b/stubdom/grub/sha1.c
@@ -0,0 +1,260 @@
+/*
+ * SHA1 routine optimized to do word accesses rather than byte accesses,
+ * and to avoid unnecessary copies into the context array.
+ *
+ * This was based on the git SHA1 implementation.
+ */
+
+#include <stdint.h>
+#include <string.h>
+
+static inline uint16_t be16(uint16_t v)
+{
+	return (v >> 8) | (v << 8);
+}
+
+static inline uint32_t be32(uint32_t v)
+{
+	return (be16(v) << 16) | be16(v >> 16);
+}
+
+static inline uint32_t get_unaligned_be32(uint32_t *v)
+{
+	return be32(*v);
+}
+
+/*
+ * rol32 - rotate a 32-bit value left
+ *
+ * @word: value to rotate
+ * @shift: bits to roll
+ */
+static inline uint32_t rol32(uint32_t word, unsigned int shift)
+{
+    return (word << shift) | (word >> (32 - shift));
+}
+
+/*
+ * ror32 - rotate a 32-bit value right
+ *
+ * @word: value to rotate
+ * @shift: bits to roll
+ */
+static inline uint32_t ror32(uint32_t word, unsigned int shift)
+{
+    return (word >> shift) | (word << (32 - shift));
+}
+
+
+/*
+ * If you have 32 registers or more, the compiler can (and should)
+ * try to change the array[] accesses into registers. However, on
+ * machines with less than ~25 registers, that won't really work,
+ * and at least gcc will make an unholy mess of it.
+ *
+ * So to avoid that mess which just slows things down, we force
+ * the stores to memory to actually happen (we might be better off
+ * with a 'W(t)=(val);asm("":"+m" (W(t))' there instead, as
+ * suggested by Artur Skawina - that will also make gcc unable to
+ * try to do the silly "optimize away loads" part because it won't
+ * see what the value will be).
+ *
+ * Ben Herrenschmidt reports that on PPC, the C version comes close
+ * to the optimized asm with this (ie on PPC you don't want that
+ * 'volatile', since there are lots of registers).
+ *
+ * On ARM we get the best code generation by forcing a full memory barrier
+ * between each SHA_ROUND, otherwise gcc happily get wild with spilling and
+ * the stack frame size simply explode and performance goes down the drain.
+ */
+
+#if 1
+  #define setW(x, val) (*(volatile uint32_t *)&W(x) = (val))
+#else
+  #define setW(x, val) (W(x) = (val))
+#endif
+
+/* This "rolls" over the 512-bit array */
+#define W(x) (array[(x)&15])
+
+/*
+ * Where do we get the source from? The first 16 iterations get it from
+ * the input data, the next mix it from the 512-bit array.
+ */
+#define SHA_SRC(t) get_unaligned_be32((uint32_t *)data + t)
+#define SHA_MIX(t) rol32(W(t+13) ^ W(t+8) ^ W(t+2) ^ W(t), 1)
+
+#define SHA_ROUND(t, input, fn, constant, A, B, C, D, E) do { \
+	uint32_t TEMP = input(t); setW(t, TEMP); \
+	E += TEMP + rol32(A,5) + (fn) + (constant); \
+	B = ror32(B, 2); } while (0)
+
+#define T_0_15(t, A, B, C, D, E)  SHA_ROUND(t, SHA_SRC, (((C^D)&B)^D) , 0x5a827999, A, B, C, D, E )
+#define T_16_19(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (((C^D)&B)^D) , 0x5a827999, A, B, C, D, E )
+#define T_20_39(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (B^C^D) , 0x6ed9eba1, A, B, C, D, E )
+#define T_40_59(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, ((B&C)+(D&(B^C))) , 0x8f1bbcdc, A, B, C, D, E )
+#define T_60_79(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (B^C^D) ,  0xca62c1d6, A, B, C, D, E )
+
+/**
+ * sha_transform - single block SHA1 transform
+ *
+ * @digest: 160 bit digest to update
+ * @data:   512 bits of data to hash
+ * @array:  16 words of workspace (see note)
+ *
+ * This function generates a SHA1 digest for a single 512-bit block.
+ * Be warned, it does not handle padding and message digest, do not
+ * confuse it with the full FIPS 180-1 digest algorithm for variable
+ * length messages.
+ *
+ * Note: If the hash is security sensitive, the caller should be sure
+ * to clear the workspace. This is left to the caller to avoid
+ * unnecessary clears between chained hashing operations.
+ */
+void sha_transform(uint32_t *digest, const char *data, uint32_t *array)
+{
+	uint32_t A, B, C, D, E;
+
+	A = digest[0];
+	B = digest[1];
+	C = digest[2];
+	D = digest[3];
+	E = digest[4];
+
+	/* Round 1 - iterations 0-16 take their input from 'data' */
+	T_0_15( 0, A, B, C, D, E);
+	T_0_15( 1, E, A, B, C, D);
+	T_0_15( 2, D, E, A, B, C);
+	T_0_15( 3, C, D, E, A, B);
+	T_0_15( 4, B, C, D, E, A);
+	T_0_15( 5, A, B, C, D, E);
+	T_0_15( 6, E, A, B, C, D);
+	T_0_15( 7, D, E, A, B, C);
+	T_0_15( 8, C, D, E, A, B);
+	T_0_15( 9, B, C, D, E, A);
+	T_0_15(10, A, B, C, D, E);
+	T_0_15(11, E, A, B, C, D);
+	T_0_15(12, D, E, A, B, C);
+	T_0_15(13, C, D, E, A, B);
+	T_0_15(14, B, C, D, E, A);
+	T_0_15(15, A, B, C, D, E);
+
+	/* Round 1 - tail. Input from 512-bit mixing array */
+	T_16_19(16, E, A, B, C, D);
+	T_16_19(17, D, E, A, B, C);
+	T_16_19(18, C, D, E, A, B);
+	T_16_19(19, B, C, D, E, A);
+
+	/* Round 2 */
+	T_20_39(20, A, B, C, D, E);
+	T_20_39(21, E, A, B, C, D);
+	T_20_39(22, D, E, A, B, C);
+	T_20_39(23, C, D, E, A, B);
+	T_20_39(24, B, C, D, E, A);
+	T_20_39(25, A, B, C, D, E);
+	T_20_39(26, E, A, B, C, D);
+	T_20_39(27, D, E, A, B, C);
+	T_20_39(28, C, D, E, A, B);
+	T_20_39(29, B, C, D, E, A);
+	T_20_39(30, A, B, C, D, E);
+	T_20_39(31, E, A, B, C, D);
+	T_20_39(32, D, E, A, B, C);
+	T_20_39(33, C, D, E, A, B);
+	T_20_39(34, B, C, D, E, A);
+	T_20_39(35, A, B, C, D, E);
+	T_20_39(36, E, A, B, C, D);
+	T_20_39(37, D, E, A, B, C);
+	T_20_39(38, C, D, E, A, B);
+	T_20_39(39, B, C, D, E, A);
+
+	/* Round 3 */
+	T_40_59(40, A, B, C, D, E);
+	T_40_59(41, E, A, B, C, D);
+	T_40_59(42, D, E, A, B, C);
+	T_40_59(43, C, D, E, A, B);
+	T_40_59(44, B, C, D, E, A);
+	T_40_59(45, A, B, C, D, E);
+	T_40_59(46, E, A, B, C, D);
+	T_40_59(47, D, E, A, B, C);
+	T_40_59(48, C, D, E, A, B);
+	T_40_59(49, B, C, D, E, A);
+	T_40_59(50, A, B, C, D, E);
+	T_40_59(51, E, A, B, C, D);
+	T_40_59(52, D, E, A, B, C);
+	T_40_59(53, C, D, E, A, B);
+	T_40_59(54, B, C, D, E, A);
+	T_40_59(55, A, B, C, D, E);
+	T_40_59(56, E, A, B, C, D);
+	T_40_59(57, D, E, A, B, C);
+	T_40_59(58, C, D, E, A, B);
+	T_40_59(59, B, C, D, E, A);
+
+	/* Round 4 */
+	T_60_79(60, A, B, C, D, E);
+	T_60_79(61, E, A, B, C, D);
+	T_60_79(62, D, E, A, B, C);
+	T_60_79(63, C, D, E, A, B);
+	T_60_79(64, B, C, D, E, A);
+	T_60_79(65, A, B, C, D, E);
+	T_60_79(66, E, A, B, C, D);
+	T_60_79(67, D, E, A, B, C);
+	T_60_79(68, C, D, E, A, B);
+	T_60_79(69, B, C, D, E, A);
+	T_60_79(70, A, B, C, D, E);
+	T_60_79(71, E, A, B, C, D);
+	T_60_79(72, D, E, A, B, C);
+	T_60_79(73, C, D, E, A, B);
+	T_60_79(74, B, C, D, E, A);
+	T_60_79(75, A, B, C, D, E);
+	T_60_79(76, E, A, B, C, D);
+	T_60_79(77, D, E, A, B, C);
+	T_60_79(78, C, D, E, A, B);
+	T_60_79(79, B, C, D, E, A);
+
+	digest[0] += A;
+	digest[1] += B;
+	digest[2] += C;
+	digest[3] += D;
+	digest[4] += E;
+}
+
+/**
+ * sha_init - initialize the vectors for a SHA1 digest
+ * @buf: vector to initialize
+ */
+void sha_init(uint32_t *buf)
+{
+	buf[0] = 0x67452301;
+	buf[1] = 0xefcdab89;
+	buf[2] = 0x98badcfe;
+	buf[3] = 0x10325476;
+	buf[4] = 0xc3d2e1f0;
+}
+
+void sha_compute(uint32_t *buf, void *src, uint32_t len)
+{
+	uint32_t pos = 0;
+	uint8_t final[64];
+	uint32_t work[16];
+	sha_init(buf);
+	while (len >= pos + 64) {
+		sha_transform(buf, src + pos, work);
+		pos += 64;
+	}
+	memcpy(final, src + pos, len - pos);
+	// done with src; pos is now relative to final
+	pos = len - pos;
+	final[pos++] = 0x80;
+	memset(final + pos, 0, sizeof(final) - pos);
+	if (pos > 56) {
+		sha_transform(buf, (void*)final, work);
+		memset(final, 0, sizeof(final));
+	}
+	*(uint32_t*)(final + 60) = be32(len << 3);
+	sha_transform(buf, (void*)final, work);
+	buf[0] = be32(buf[0]);
+	buf[1] = be32(buf[1]);
+	buf[2] = be32(buf[2]);
+	buf[3] = be32(buf[3]);
+	buf[4] = be32(buf[4]);
+}
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:16:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:16:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMt7-0002L8-Le; Tue, 27 Nov 2012 15:15:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdMt6-0002KV-7M
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:15:52 +0000
Received: from [85.158.143.35:33237] by server-3.bemta-4.messagelabs.com id
	B8/CC-06841-729D4B05; Tue, 27 Nov 2012 15:15:51 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-21.messagelabs.com!1354029294!11274430!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1678 invoked from network); 27 Nov 2012 15:14:56 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-11.tower-21.messagelabs.com with SMTP;
	27 Nov 2012 15:14:56 -0000
X-TM-IMSS-Message-ID: <c1192cf40002f244@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id c1192cf40002f244 ;
	Tue, 27 Nov 2012 10:14:04 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARFEpPu007688; 
	Tue, 27 Nov 2012 10:14:51 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu
Date: Tue, 27 Nov 2012 10:14:44 -0500
Message-Id: <1354029286-17652-3-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: dgdegra@tycho.nsa.gov, Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 2/4] stubdom/vtpm: Add reconfiguration support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Allow the vtpm device to be disconnected and reconnected so that a
bootloader (like pv-grub) can submit measurements and return the vtpm
device to its initial state before booting the target kernel.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/include/tpmfront.h |  2 +-
 extras/mini-os/lib/sys.c          |  2 +-
 extras/mini-os/tpmback.c          |  5 +++++
 extras/mini-os/tpmfront.c         | 15 +++++++++------
 stubdom/vtpm/vtpm.c               |  2 +-
 5 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include/tpmfront.h
index a0c7c4d..913faa4 100644
--- a/extras/mini-os/include/tpmfront.h
+++ b/extras/mini-os/include/tpmfront.h
@@ -61,7 +61,7 @@ struct tpmfront_dev {
 /*Initialize frontend */
 struct tpmfront_dev* init_tpmfront(const char* nodename);
 /*Shutdown frontend */
-void shutdown_tpmfront(struct tpmfront_dev* dev);
+void shutdown_tpmfront(struct tpmfront_dev* dev, int for_reconfig);
 
 /* Send a tpm command to the backend and wait for the response
  *
diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
index 3cc3340..03da4f0 100644
--- a/extras/mini-os/lib/sys.c
+++ b/extras/mini-os/lib/sys.c
@@ -459,7 +459,7 @@ int close(int fd)
 #endif
 #ifdef CONFIG_TPMFRONT
 	case FTYPE_TPMFRONT:
-            shutdown_tpmfront(files[fd].tpmfront.dev);
+            shutdown_tpmfront(files[fd].tpmfront.dev, 0);
 	    files[fd].type = FTYPE_NONE;
 	    return 0;
 #endif
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index 2d31061..ea42235 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -664,6 +664,7 @@ static int frontend_changed(tpmif_t* tpmif)
    switch (state) {
       case XenbusStateInitialising:
       case XenbusStateInitialised:
+      case XenbusStateReconfigured:
 	 break;
 
       case XenbusStateConnected:
@@ -678,6 +679,10 @@ static int frontend_changed(tpmif_t* tpmif)
 	 tpmif_change_state(tpmif, XenbusStateClosing);
 	 break;
 
+      case XenbusStateReconfiguring:
+         disconnect_fe(tpmif);
+	 break;
+
       case XenbusStateUnknown: /* keep it here */
       case XenbusStateClosed:
 	 free_tpmif(tpmif);
diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
index c1cbab3..b725ba0 100644
--- a/extras/mini-os/tpmfront.c
+++ b/extras/mini-os/tpmfront.c
@@ -344,10 +344,10 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
    return dev;
 
 error:
-   shutdown_tpmfront(dev);
+   shutdown_tpmfront(dev, 0);
    return NULL;
 }
-void shutdown_tpmfront(struct tpmfront_dev* dev)
+void shutdown_tpmfront(struct tpmfront_dev* dev, int for_reconfig)
 {
    char* err;
    char path[512];
@@ -357,8 +357,7 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
    TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for reconfigure" : "");
    /* disconnect */
    if(dev->state == XenbusStateConnected) {
-      dev->state = XenbusStateClosing;
-      //FIXME: Transaction for this?
+      dev->state = for_reconfig ? XenbusStateReconfiguring : XenbusStateClosing;
       /* Tell backend we are closing */
       if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
 	 free(err);
@@ -374,15 +373,19 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
 	 free(err);
       }
 
+      if (for_reconfig)
+         wait_for_backend_state_changed(dev, XenbusStateReconfigured);
+
       /* Tell backend we are closed */
-      dev->state = XenbusStateClosed;
+      dev->state = for_reconfig ? XenbusStateInitialising : XenbusStateClosed;
       if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
 	 TPMFRONT_ERR("Unable to write to %s, error was %s", dev->nodename, err);
 	 free(err);
       }
 
       /* Wait for the backend to close and unmap shared pages, ignore any errors */
-      wait_for_backend_state_changed(dev, XenbusStateClosed);
+      if (!for_reconfig)
+         wait_for_backend_state_changed(dev, XenbusStateClosed);
 
       /* Close event channel and unmap shared page */
       mask_evtchn(dev->evtchn);
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
index 71aef78..c33e078 100644
--- a/stubdom/vtpm/vtpm.c
+++ b/stubdom/vtpm/vtpm.c
@@ -394,7 +394,7 @@ abort_postvtpmblk:
 abort_postrng:
 
    /* Close devices */
-   shutdown_tpmfront(tpmfront_dev);
+   shutdown_tpmfront(tpmfront_dev, 0);
 abort_posttpmfront:
    shutdown_tpmback();
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:16:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:16:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMt7-0002L8-Le; Tue, 27 Nov 2012 15:15:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdMt6-0002KV-7M
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:15:52 +0000
Received: from [85.158.143.35:33237] by server-3.bemta-4.messagelabs.com id
	B8/CC-06841-729D4B05; Tue, 27 Nov 2012 15:15:51 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-21.messagelabs.com!1354029294!11274430!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1678 invoked from network); 27 Nov 2012 15:14:56 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-11.tower-21.messagelabs.com with SMTP;
	27 Nov 2012 15:14:56 -0000
X-TM-IMSS-Message-ID: <c1192cf40002f244@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id c1192cf40002f244 ;
	Tue, 27 Nov 2012 10:14:04 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARFEpPu007688; 
	Tue, 27 Nov 2012 10:14:51 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu
Date: Tue, 27 Nov 2012 10:14:44 -0500
Message-Id: <1354029286-17652-3-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: dgdegra@tycho.nsa.gov, Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 2/4] stubdom/vtpm: Add reconfiguration support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Allow the vtpm device to be disconnected and reconnected so that a
bootloader (like pv-grub) can submit measurements and return the vtpm
device to its initial state before booting the target kernel.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/include/tpmfront.h |  2 +-
 extras/mini-os/lib/sys.c          |  2 +-
 extras/mini-os/tpmback.c          |  5 +++++
 extras/mini-os/tpmfront.c         | 15 +++++++++------
 stubdom/vtpm/vtpm.c               |  2 +-
 5 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include/tpmfront.h
index a0c7c4d..913faa4 100644
--- a/extras/mini-os/include/tpmfront.h
+++ b/extras/mini-os/include/tpmfront.h
@@ -61,7 +61,7 @@ struct tpmfront_dev {
 /*Initialize frontend */
 struct tpmfront_dev* init_tpmfront(const char* nodename);
 /*Shutdown frontend */
-void shutdown_tpmfront(struct tpmfront_dev* dev);
+void shutdown_tpmfront(struct tpmfront_dev* dev, int for_reconfig);
 
 /* Send a tpm command to the backend and wait for the response
  *
diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
index 3cc3340..03da4f0 100644
--- a/extras/mini-os/lib/sys.c
+++ b/extras/mini-os/lib/sys.c
@@ -459,7 +459,7 @@ int close(int fd)
 #endif
 #ifdef CONFIG_TPMFRONT
 	case FTYPE_TPMFRONT:
-            shutdown_tpmfront(files[fd].tpmfront.dev);
+            shutdown_tpmfront(files[fd].tpmfront.dev, 0);
 	    files[fd].type = FTYPE_NONE;
 	    return 0;
 #endif
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index 2d31061..ea42235 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -664,6 +664,7 @@ static int frontend_changed(tpmif_t* tpmif)
    switch (state) {
       case XenbusStateInitialising:
       case XenbusStateInitialised:
+      case XenbusStateReconfigured:
 	 break;
 
       case XenbusStateConnected:
@@ -678,6 +679,10 @@ static int frontend_changed(tpmif_t* tpmif)
 	 tpmif_change_state(tpmif, XenbusStateClosing);
 	 break;
 
+      case XenbusStateReconfiguring:
+         disconnect_fe(tpmif);
+	 break;
+
       case XenbusStateUnknown: /* keep it here */
       case XenbusStateClosed:
 	 free_tpmif(tpmif);
diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
index c1cbab3..b725ba0 100644
--- a/extras/mini-os/tpmfront.c
+++ b/extras/mini-os/tpmfront.c
@@ -344,10 +344,10 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
    return dev;
 
 error:
-   shutdown_tpmfront(dev);
+   shutdown_tpmfront(dev, 0);
    return NULL;
 }
-void shutdown_tpmfront(struct tpmfront_dev* dev)
+void shutdown_tpmfront(struct tpmfront_dev* dev, int for_reconfig)
 {
    char* err;
    char path[512];
@@ -357,8 +357,7 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
    TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for reconfigure" : "");
    /* disconnect */
    if(dev->state == XenbusStateConnected) {
-      dev->state = XenbusStateClosing;
-      //FIXME: Transaction for this?
+      dev->state = for_reconfig ? XenbusStateReconfiguring : XenbusStateClosing;
       /* Tell backend we are closing */
       if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
 	 free(err);
@@ -374,15 +373,19 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
 	 free(err);
       }
 
+      if (for_reconfig)
+         wait_for_backend_state_changed(dev, XenbusStateReconfigured);
+
       /* Tell backend we are closed */
-      dev->state = XenbusStateClosed;
+      dev->state = for_reconfig ? XenbusStateInitialising : XenbusStateClosed;
       if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
 	 TPMFRONT_ERR("Unable to write to %s, error was %s", dev->nodename, err);
 	 free(err);
       }
 
       /* Wait for the backend to close and unmap shared pages, ignore any errors */
-      wait_for_backend_state_changed(dev, XenbusStateClosed);
+      if (!for_reconfig)
+         wait_for_backend_state_changed(dev, XenbusStateClosed);
 
       /* Close event channel and unmap shared page */
       mask_evtchn(dev->evtchn);
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
index 71aef78..c33e078 100644
--- a/stubdom/vtpm/vtpm.c
+++ b/stubdom/vtpm/vtpm.c
@@ -394,7 +394,7 @@ abort_postvtpmblk:
 abort_postrng:
 
    /* Close devices */
-   shutdown_tpmfront(tpmfront_dev);
+   shutdown_tpmfront(tpmfront_dev, 0);
 abort_posttpmfront:
    shutdown_tpmback();
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:17:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:17:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMuN-0002by-5a; Tue, 27 Nov 2012 15:17:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TdMuM-0002bd-0g
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 15:17:10 +0000
Received: from [85.158.143.99:64145] by server-2.bemta-4.messagelabs.com id
	62/F3-28922-579D4B05; Tue, 27 Nov 2012 15:17:09 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1354029427!26265302!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ3Mzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9851 invoked from network); 27 Nov 2012 15:17:08 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 15:17:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="45752224"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 15:17:06 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:17:05 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TdMuH-000844-Ek;
	Tue, 27 Nov 2012 15:17:05 +0000
Date: Tue, 27 Nov 2012 15:17:03 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: xen-devel@lists.xensource.com
Message-ID: <alpine.DEB.2.02.1211271511520.5310@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH] libxl: use qemu-xen (upstream QEMU) as device
 model by default
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 9d20086..c40f597 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -144,7 +144,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
     if (!b_info->device_model_version) {
         if (b_info->type == LIBXL_DOMAIN_TYPE_HVM)
             b_info->device_model_version =
-                LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
+                LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN;
         else {
             const char *dm;
             int rc;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:17:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:17:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdMuN-0002by-5a; Tue, 27 Nov 2012 15:17:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TdMuM-0002bd-0g
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 15:17:10 +0000
Received: from [85.158.143.99:64145] by server-2.bemta-4.messagelabs.com id
	62/F3-28922-579D4B05; Tue, 27 Nov 2012 15:17:09 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1354029427!26265302!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ3Mzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9851 invoked from network); 27 Nov 2012 15:17:08 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-2.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 15:17:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="45752224"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 15:17:06 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:17:05 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TdMuH-000844-Ek;
	Tue, 27 Nov 2012 15:17:05 +0000
Date: Tue, 27 Nov 2012 15:17:03 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: xen-devel@lists.xensource.com
Message-ID: <alpine.DEB.2.02.1211271511520.5310@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH] libxl: use qemu-xen (upstream QEMU) as device
 model by default
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 9d20086..c40f597 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -144,7 +144,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
     if (!b_info->device_model_version) {
         if (b_info->type == LIBXL_DOMAIN_TYPE_HVM)
             b_info->device_model_version =
-                LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
+                LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN;
         else {
             const char *dm;
             int rc;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:26:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:26:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdN32-00038e-6a; Tue, 27 Nov 2012 15:26:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdN30-00038Z-Sa
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 15:26:07 +0000
Received: from [85.158.143.35:2914] by server-2.bemta-4.messagelabs.com id
	6B/A1-28922-E8BD4B05; Tue, 27 Nov 2012 15:26:06 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1354029874!13104474!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1757 invoked from network); 27 Nov 2012 15:24:36 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 15:24:36 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16027719"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 15:23:48 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 15:23:48 +0000
Message-ID: <1354029827.17985.56.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Tue, 27 Nov 2012 15:23:47 +0000
In-Reply-To: <alpine.DEB.2.02.1211271511520.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211271511520.5310@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, Ian
	Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] libxl: use qemu-xen (upstream QEMU) as
 device model by default
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Is the test system prepared for this change?

Unless someone tells me otherwise I'm going to leave this one to Ian J
to apply when the ducks are all in the appropriate rows.

On Tue, 2012-11-27 at 15:17 +0000, Stefano Stabellini wrote:
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index 9d20086..c40f597 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -144,7 +144,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
>      if (!b_info->device_model_version) {
>          if (b_info->type == LIBXL_DOMAIN_TYPE_HVM)
>              b_info->device_model_version =
> -                LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
> +                LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN;
>          else {
>              const char *dm;
>              int rc;
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:26:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:26:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdN32-00038e-6a; Tue, 27 Nov 2012 15:26:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdN30-00038Z-Sa
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 15:26:07 +0000
Received: from [85.158.143.35:2914] by server-2.bemta-4.messagelabs.com id
	6B/A1-28922-E8BD4B05; Tue, 27 Nov 2012 15:26:06 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1354029874!13104474!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1757 invoked from network); 27 Nov 2012 15:24:36 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 15:24:36 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16027719"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 15:23:48 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 15:23:48 +0000
Message-ID: <1354029827.17985.56.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Tue, 27 Nov 2012 15:23:47 +0000
In-Reply-To: <alpine.DEB.2.02.1211271511520.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211271511520.5310@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, Ian
	Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] libxl: use qemu-xen (upstream QEMU) as
 device model by default
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Is the test system prepared for this change?

Unless someone tells me otherwise I'm going to leave this one to Ian J
to apply when the ducks are all in the appropriate rows.

On Tue, 2012-11-27 at 15:17 +0000, Stefano Stabellini wrote:
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index 9d20086..c40f597 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -144,7 +144,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
>      if (!b_info->device_model_version) {
>          if (b_info->type == LIBXL_DOMAIN_TYPE_HVM)
>              b_info->device_model_version =
> -                LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
> +                LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN;
>          else {
>              const char *dm;
>              int rc;
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:40:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:40:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdNGm-0003OE-RN; Tue, 27 Nov 2012 15:40:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdNGl-0003O9-I3
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:40:19 +0000
Received: from [85.158.137.99:27137] by server-15.bemta-3.messagelabs.com id
	6B/01-23779-0EED4B05; Tue, 27 Nov 2012 15:40:16 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1354030814!20839877!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16360 invoked from network); 27 Nov 2012 15:40:14 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 15:40:14 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16028149"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 15:40:13 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 15:40:13 +0000
Message-ID: <1354030812.17985.65.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Lars Kurth <lars.kurth.xen@gmail.com>
Date: Tue, 27 Nov 2012 15:40:12 +0000
In-Reply-To: <CAOqnZH4qVRoDCpaCGT3zuJu85t17XkuUJSoxBoMhXd95p9b5tg@mail.gmail.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<CAOqnZH4qVRoDCpaCGT3zuJu85t17XkuUJSoxBoMhXd95p9b5tg@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>, "Keir \(Xen.org\)" <keir@xen.org>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 09:56 +0000, Lars Kurth wrote:
> > (I think s/4.3/3.4/ was intended in the above)
> Yes, it was me and this indeed a typo
> 
> Defining what we do is actually what I was looking for, as this is not clear to everybody.
> 
> > Each stable branch has a maintainer who is nominated/volunteers and is
> > accepted via consensus among the maintainers and committers (XXX or just
> > committers?). 
> I am wondering whether we should treat this exactly like maintainership. It's the same idea.
> We could just add a "stable release" section to the MAINTAINERS file and follow the same 
> process of nominating a maintainer. Or track the stable release maintainer in the branched
> versions of the file. Does anybody have any views?

Lets do it in the stable branch version for now with a reference. I'll
send out some patches.

> Maybe a short section of what the responsibilities of a release
> maintainer would be useful (view a view to making it a little easier for somebody to
> step up should they wish to) and a little section on what to do if a contributor feels that
> a bug-fix should be backported (with a view to making the release maintainers life
> easier). Anyway, this is just a suggestion.
> 
> Otherwise this sounds like a good proposal and starting point. Thanks
> for putting it together.

No problem.

Final draft is below, incorporating your suggestions (which has meant
substantial changes to a few paragraphs). I'm shortly going to be adding
it to http://wiki.xen.org/wiki/Xen_Maintenance_Releases and fix up the
formatting / links etc.

Ian.

8<-------------------------------------

= Stable Maintenance Branches =

Each new Xen release X.Y.0 starts a new stable maintenance branch.

Each such branch is in its own mercurial repository
xen-X.Y-testing.hg. See [[Xen Repositories]] for more information
about the current branches.

Releases are intended to happen roughly every 3 months. The first
release on a stable branch is often sooner and as the branch reaches
the end of its life the interval may be longer.

In general Xen.org supports the two most recent stable branches at any
given time. When a new X.Y.0 release is made there is usually one more
release on the to-be-retired stable branch to mop up any loose patches
sitting in the repository at which point the branch is retired. For
example we are currently in the 4.3 development cycle and are
supporting two stable branches: 4.1-testing and 4.2-testing. After
4.2.0 was released there was one more release in the 4.0-testing
stream (4.0.4) and then the 4.0 branch was retired.

= Stable Branch Maintainer =

Each stable branch has a maintainer who is nominated/volunteers
according to the "Maintainer Election" process described in the
[http://www.xen.org/projects/governance.html project governance],
resulting in the patching the MAINTAINERS file in the relevant branch.

For the branches maintained by Xen.org one of the regular xen-unstable
committers or maintainers would usually step up as maintainer. However
other community members can also step up to maintain a stable release,
typically once Xen.org no longer does so.

The stable branch maintainer is responsible for identifying suitable
candidates for inclusion in the stable branch both according to their
own judgment and by evaluating requests from the community (see
below).

= Stable Branch Patch Inclusion Policy =

No new development happens in the X.Y-testing branches, instead
changesets are backported from xen-unstable. Where this is not possible
(perhaps unstable has moved on such that the patch cannot be applied or
the approach used in unstable is otherwise not valid for the stable
branch) then a specific fix can be created for the stable branch.
However it is a requirement that the issue will always be fixed in
unstable first (this is to avoid regressions on the next major
release).

In general only bug fixes are accepted into stable branches and new
features are not normally accepted. (There can be exceptions, e.g. it
was agreed that 4.2.1 would take a more relaxed approach to features
which improved xl compatibility with xm). As time passes each stable
branch becomes more conservative and the barrier to accepting a patch
for backport becomes higher.

Changesets are included in the stable branch at the discretion of the
branch maintainer.

= Requesting A Backport =

As well as changesets identified by the branch maintainer as being suitable
for backport changes can also be nominated for inclusion in the stable
branch by making a request to the stable maintainer on xen-devel
either by noting it as such in the submission of the original patch to
xen-unstable or by a subsequent explicit email to xen-devel. Such
requests should be copied to the relevant stable maintainer. In
addition as part of the the stable release process the stable
maintainer will send one or more requests to xen-devel soliciting
suggestions for patches which should be included.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:40:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:40:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdNGm-0003OE-RN; Tue, 27 Nov 2012 15:40:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdNGl-0003O9-I3
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:40:19 +0000
Received: from [85.158.137.99:27137] by server-15.bemta-3.messagelabs.com id
	6B/01-23779-0EED4B05; Tue, 27 Nov 2012 15:40:16 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1354030814!20839877!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16360 invoked from network); 27 Nov 2012 15:40:14 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 15:40:14 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16028149"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 15:40:13 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 15:40:13 +0000
Message-ID: <1354030812.17985.65.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Lars Kurth <lars.kurth.xen@gmail.com>
Date: Tue, 27 Nov 2012 15:40:12 +0000
In-Reply-To: <CAOqnZH4qVRoDCpaCGT3zuJu85t17XkuUJSoxBoMhXd95p9b5tg@mail.gmail.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<CAOqnZH4qVRoDCpaCGT3zuJu85t17XkuUJSoxBoMhXd95p9b5tg@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>, "Keir \(Xen.org\)" <keir@xen.org>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 09:56 +0000, Lars Kurth wrote:
> > (I think s/4.3/3.4/ was intended in the above)
> Yes, it was me and this indeed a typo
> 
> Defining what we do is actually what I was looking for, as this is not clear to everybody.
> 
> > Each stable branch has a maintainer who is nominated/volunteers and is
> > accepted via consensus among the maintainers and committers (XXX or just
> > committers?). 
> I am wondering whether we should treat this exactly like maintainership. It's the same idea.
> We could just add a "stable release" section to the MAINTAINERS file and follow the same 
> process of nominating a maintainer. Or track the stable release maintainer in the branched
> versions of the file. Does anybody have any views?

Lets do it in the stable branch version for now with a reference. I'll
send out some patches.

> Maybe a short section of what the responsibilities of a release
> maintainer would be useful (view a view to making it a little easier for somebody to
> step up should they wish to) and a little section on what to do if a contributor feels that
> a bug-fix should be backported (with a view to making the release maintainers life
> easier). Anyway, this is just a suggestion.
> 
> Otherwise this sounds like a good proposal and starting point. Thanks
> for putting it together.

No problem.

Final draft is below, incorporating your suggestions (which has meant
substantial changes to a few paragraphs). I'm shortly going to be adding
it to http://wiki.xen.org/wiki/Xen_Maintenance_Releases and fix up the
formatting / links etc.

Ian.

8<-------------------------------------

= Stable Maintenance Branches =

Each new Xen release X.Y.0 starts a new stable maintenance branch.

Each such branch is in its own mercurial repository
xen-X.Y-testing.hg. See [[Xen Repositories]] for more information
about the current branches.

Releases are intended to happen roughly every 3 months. The first
release on a stable branch is often sooner and as the branch reaches
the end of its life the interval may be longer.

In general Xen.org supports the two most recent stable branches at any
given time. When a new X.Y.0 release is made there is usually one more
release on the to-be-retired stable branch to mop up any loose patches
sitting in the repository at which point the branch is retired. For
example we are currently in the 4.3 development cycle and are
supporting two stable branches: 4.1-testing and 4.2-testing. After
4.2.0 was released there was one more release in the 4.0-testing
stream (4.0.4) and then the 4.0 branch was retired.

= Stable Branch Maintainer =

Each stable branch has a maintainer who is nominated/volunteers
according to the "Maintainer Election" process described in the
[http://www.xen.org/projects/governance.html project governance],
resulting in the patching the MAINTAINERS file in the relevant branch.

For the branches maintained by Xen.org one of the regular xen-unstable
committers or maintainers would usually step up as maintainer. However
other community members can also step up to maintain a stable release,
typically once Xen.org no longer does so.

The stable branch maintainer is responsible for identifying suitable
candidates for inclusion in the stable branch both according to their
own judgment and by evaluating requests from the community (see
below).

= Stable Branch Patch Inclusion Policy =

No new development happens in the X.Y-testing branches, instead
changesets are backported from xen-unstable. Where this is not possible
(perhaps unstable has moved on such that the patch cannot be applied or
the approach used in unstable is otherwise not valid for the stable
branch) then a specific fix can be created for the stable branch.
However it is a requirement that the issue will always be fixed in
unstable first (this is to avoid regressions on the next major
release).

In general only bug fixes are accepted into stable branches and new
features are not normally accepted. (There can be exceptions, e.g. it
was agreed that 4.2.1 would take a more relaxed approach to features
which improved xl compatibility with xm). As time passes each stable
branch becomes more conservative and the barrier to accepting a patch
for backport becomes higher.

Changesets are included in the stable branch at the discretion of the
branch maintainer.

= Requesting A Backport =

As well as changesets identified by the branch maintainer as being suitable
for backport changes can also be nominated for inclusion in the stable
branch by making a request to the stable maintainer on xen-devel
either by noting it as such in the submission of the original patch to
xen-unstable or by a subsequent explicit email to xen-devel. Such
requests should be copied to the relevant stable maintainer. In
addition as part of the the stable release process the stable
maintainer will send one or more requests to xen-devel soliciting
suggestions for patches which should be included.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:46:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:46:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdNM6-0003YT-Q3; Tue, 27 Nov 2012 15:45:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdNM5-0003YH-V5
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:45:50 +0000
Received: from [85.158.139.211:51609] by server-9.bemta-5.messagelabs.com id
	02/81-29295-D20E4B05; Tue, 27 Nov 2012 15:45:49 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354031148!14092159!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9487 invoked from network); 27 Nov 2012 15:45:48 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 15:45:48 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 15:45:49 +0000
Message-Id: <50B4EE7102000078000ABC70@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 15:46:41 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dietmar Hahn" <dietmar.hahn@ts.fujitsu.com>
References: <1449364.BXBucXMpuY@amur>
	<50B4C87402000078000ABA9F@nat28.tlf.novell.com>
	<50B4CBF602000078000ABABB@nat28.tlf.novell.com>
	<1883792.BQDJ6uZviQ@amur>
In-Reply-To: <1883792.BQDJ6uZviQ@amur>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Jun Nakajima <jun.nakajima@intel.com>,
	Donald D Dugger <donald.d.dugger@intel.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] oprofile: Add X7542 and E7-8837 to the list
 of supported cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 27.11.12 at 15:21, Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> wrote:
> Am Dienstag 27 November 2012, 13:19:34 schrieb Jan Beulich:
>> >>> On 27.11.12 at 14:04, "Jan Beulich" <JBeulich@suse.com> wrote:
>> >>>> On 26.11.12 at 13:52, Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> wrote:
>> >> Add intel cpus X7542 and E7-8837 to the list of supported cpus.
>> >> 
>> >> Thanks.
>> >> Dietmar.
>> >> 
>> >> Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
>> >> 
>> >> diff -r 0049de3827bc -r 6fb0129600cd xen/arch/x86/oprofile/nmi_int.c
>> >> --- a/xen/arch/x86/oprofile/nmi_int.c   Fri Nov 23 11:06:15 2012 +0000
>> >> +++ b/xen/arch/x86/oprofile/nmi_int.c   Mon Nov 26 13:36:00 2012 +0100
>> >> @@ -366,6 +366,8 @@ static int __init ppro_init(char ** cpu_
>> >>                 ppro_has_global_ctrl = 1;
>> >>                 break;
>> >>         case 26:
>> >> +       case 46:
>> >> +       case 47:
>> >>                 arch_perfmon_setup_counters();
>> >>                 *cpu_type = "i386/core_i7";
>> >>                 ppro_has_global_ctrl = 1;
>> > 
>> > Actually, and apart from the patch being white space damaged,
>> > after a closer look I think this is wrong - these newer CPUs
>> > shouldn't get be handled here, but instead should be covered by
>> > arch_perfmon_init(). Are you observing X86_FEATURE_ARCH_PERFMON
>> > not getting set on these CPUs by init_intel()?
>> 
>> I.e. the below would be the patch I'd expect when merely
>> taking the SDM as reference (with the "todo remove?" ones
>> also fully removed of course).
> 
> Yes, looks much cleaner.

Question is - does it work for you? And if it does, why would it not
have worked without any change? After all, the patch in this form,
apart from the setting of ppro_has_global_ctrl in
arch_perfmon_init(), only removes code.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:46:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:46:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdNM6-0003YT-Q3; Tue, 27 Nov 2012 15:45:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdNM5-0003YH-V5
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:45:50 +0000
Received: from [85.158.139.211:51609] by server-9.bemta-5.messagelabs.com id
	02/81-29295-D20E4B05; Tue, 27 Nov 2012 15:45:49 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354031148!14092159!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9487 invoked from network); 27 Nov 2012 15:45:48 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 15:45:48 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 15:45:49 +0000
Message-Id: <50B4EE7102000078000ABC70@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 15:46:41 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dietmar Hahn" <dietmar.hahn@ts.fujitsu.com>
References: <1449364.BXBucXMpuY@amur>
	<50B4C87402000078000ABA9F@nat28.tlf.novell.com>
	<50B4CBF602000078000ABABB@nat28.tlf.novell.com>
	<1883792.BQDJ6uZviQ@amur>
In-Reply-To: <1883792.BQDJ6uZviQ@amur>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Jun Nakajima <jun.nakajima@intel.com>,
	Donald D Dugger <donald.d.dugger@intel.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] oprofile: Add X7542 and E7-8837 to the list
 of supported cpus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 27.11.12 at 15:21, Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> wrote:
> Am Dienstag 27 November 2012, 13:19:34 schrieb Jan Beulich:
>> >>> On 27.11.12 at 14:04, "Jan Beulich" <JBeulich@suse.com> wrote:
>> >>>> On 26.11.12 at 13:52, Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> wrote:
>> >> Add intel cpus X7542 and E7-8837 to the list of supported cpus.
>> >> 
>> >> Thanks.
>> >> Dietmar.
>> >> 
>> >> Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
>> >> 
>> >> diff -r 0049de3827bc -r 6fb0129600cd xen/arch/x86/oprofile/nmi_int.c
>> >> --- a/xen/arch/x86/oprofile/nmi_int.c   Fri Nov 23 11:06:15 2012 +0000
>> >> +++ b/xen/arch/x86/oprofile/nmi_int.c   Mon Nov 26 13:36:00 2012 +0100
>> >> @@ -366,6 +366,8 @@ static int __init ppro_init(char ** cpu_
>> >>                 ppro_has_global_ctrl = 1;
>> >>                 break;
>> >>         case 26:
>> >> +       case 46:
>> >> +       case 47:
>> >>                 arch_perfmon_setup_counters();
>> >>                 *cpu_type = "i386/core_i7";
>> >>                 ppro_has_global_ctrl = 1;
>> > 
>> > Actually, and apart from the patch being white space damaged,
>> > after a closer look I think this is wrong - these newer CPUs
>> > shouldn't get be handled here, but instead should be covered by
>> > arch_perfmon_init(). Are you observing X86_FEATURE_ARCH_PERFMON
>> > not getting set on these CPUs by init_intel()?
>> 
>> I.e. the below would be the patch I'd expect when merely
>> taking the SDM as reference (with the "todo remove?" ones
>> also fully removed of course).
> 
> Yes, looks much cleaner.

Question is - does it work for you? And if it does, why would it not
have worked without any change? After all, the patch in this form,
apart from the setting of ppro_has_global_ctrl in
arch_perfmon_init(), only removes code.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:53:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:53:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdNTd-0003mL-Rp; Tue, 27 Nov 2012 15:53:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <robert.phillips@citrix.com>) id 1TdNTc-0003mG-MS
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:53:37 +0000
Received: from [85.158.143.35:19053] by server-2.bemta-4.messagelabs.com id
	DA/33-28922-002E4B05; Tue, 27 Nov 2012 15:53:36 +0000
X-Env-Sender: robert.phillips@citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1354031601!13860350!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ3Mzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28174 invoked from network); 27 Nov 2012 15:53:26 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 15:53:26 -0000
X-SBRS: None
X-MesageID: 45758669
X-Ironport-Server: ftlpip01.citrite.net
X-Remote-IP: 75.150.106.249
X-Policy: $Relay
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="45758669"
Received: from 75-150-106-249-newengland.hfc.comcastbusiness.net (HELO
	paine.oldroadcomputing.net) ([75.150.106.249])
	by SMTP.CITRIX.COM with ESMTP; 27 Nov 2012 15:53:19 +0000
From: Robert Phillips <robert.phillips@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 27 Nov 2012 10:52:55 -0500
Message-Id: <1354031575-11897-1-git-send-email-robert.phillips@citrix.com>
X-Mailer: git-send-email 1.7.9.5
Cc: Robert Phillips <robert.phillips@citrix.com>
Subject: [Xen-devel] [PATCH] Provide support for multiple frame buffers in
	Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Support is provided for both shadow and hardware assisted paging (HAP) modes.
This code bookkeeps the set of video frame buffers (vram),
detects when the guest has modified any of those buffers and, upon request,
returns a bitmap of the modified pages.
This lets other software components re-paint the portions of the monitor (or monitors) that have changed.
Each monitor has a frame buffer of some size at some position in guest physical memory.
The set of frame buffers being tracked can change over time as monitors are plugged and unplugged.
(Version 4 of this patch.)

Signed-Off-By: Robert Phillips <robert.phillips@citrix.com>
---
 tools/libxc/xenctrl.h            |   17 +-
 xen/arch/x86/hvm/hvm.c           |    9 +-
 xen/arch/x86/mm/Makefile         |    1 +
 xen/arch/x86/mm/dirty_vram.c     | 1000 ++++++++++++++++++++++++++++++++++++++
 xen/arch/x86/mm/hap/hap.c        |  140 +-----
 xen/arch/x86/mm/paging.c         |  222 +++------
 xen/arch/x86/mm/shadow/common.c  |  334 +++++++------
 xen/arch/x86/mm/shadow/multi.c   |  174 +++----
 xen/arch/x86/mm/shadow/multi.h   |    7 +-
 xen/arch/x86/mm/shadow/types.h   |    1 +
 xen/include/asm-x86/dirty_vram.h |  202 ++++++++
 xen/include/asm-x86/hap.h        |    4 -
 xen/include/asm-x86/hvm/domain.h |    2 +-
 xen/include/asm-x86/paging.h     |   23 +-
 xen/include/asm-x86/shadow.h     |    6 -
 15 files changed, 1574 insertions(+), 568 deletions(-)
 create mode 100644 xen/arch/x86/mm/dirty_vram.c
 create mode 100644 xen/include/asm-x86/dirty_vram.h

diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..693d7fe 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -1552,15 +1552,20 @@ int xc_hvm_inject_msi(
     xc_interface *xch, domid_t dom, uint64_t addr, uint32_t data);
 
 /*
- * Track dirty bit changes in the VRAM area
+ * Track dirty bit changes in a VRAM region defined by
+ * [ first_pfn : first_pfn + nr - 1 ]
  *
  * All of this is done atomically:
- * - get the dirty bitmap since the last call
- * - set up dirty tracking area for period up to the next call
- * - clear the dirty tracking area.
+ * - gets the dirty bitmap since the last call, all zeroes for
+ *   the first call with some new region
+ * - sets up a dirty tracking region for period up to the next call
+ * - clears the specified dirty tracking region.
  *
- * Returns -ENODATA and does not fill bitmap if the area has changed since the
- * last call.
+ * Creating a new region causes any existing regions that it overlaps
+ * to be discarded.
+ *
+ * Specifying nr == 0 causes all regions to be discarded and
+ * disables dirty bit tracking.
  */
 int xc_hvm_track_dirty_vram(
     xc_interface *xch, domid_t dom,
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 34da2f5..4c4d438 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -57,6 +57,7 @@
 #include <asm/hvm/cacheattr.h>
 #include <asm/hvm/trace.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/dirty_vram.h>
 #include <asm/mtrr.h>
 #include <asm/apic.h>
 #include <public/sched.h>
@@ -66,6 +67,7 @@
 #include <asm/mem_event.h>
 #include <asm/mem_access.h>
 #include <public/mem_event.h>
+#include "../mm/mm-locks.h"
 
 bool_t __read_mostly hvm_enabled;
 
@@ -1433,8 +1435,11 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
          */
         if ( access_w )
         {
-            paging_mark_dirty(v->domain, mfn_x(mfn));
-            p2m_change_type(v->domain, gfn, p2m_ram_logdirty, p2m_ram_rw);
+            if ( p2m_change_type(v->domain, gfn, p2m_ram_logdirty,
+                                 p2m_ram_rw) == p2m_ram_logdirty )
+            {
+                paging_mark_dirty_gpfn(v->domain, gfn);
+            }
         }
         rc = 1;
         goto out_put_gfn;
diff --git a/xen/arch/x86/mm/Makefile b/xen/arch/x86/mm/Makefile
index 73dcdf4..becd0c9 100644
--- a/xen/arch/x86/mm/Makefile
+++ b/xen/arch/x86/mm/Makefile
@@ -5,6 +5,7 @@ obj-y += paging.o
 obj-y += p2m.o p2m-pt.o p2m-ept.o p2m-pod.o
 obj-y += guest_walk_2.o
 obj-y += guest_walk_3.o
+obj-y += dirty_vram.o
 obj-$(x86_64) += guest_walk_4.o
 obj-$(x86_64) += mem_event.o
 obj-$(x86_64) += mem_paging.o
diff --git a/xen/arch/x86/mm/dirty_vram.c b/xen/arch/x86/mm/dirty_vram.c
new file mode 100644
index 0000000..32fcc13
--- /dev/null
+++ b/xen/arch/x86/mm/dirty_vram.c
@@ -0,0 +1,1000 @@
+/*
+ * arch/x86/mm/dirty_vram.c: Bookkeep/query dirty VRAM pages
+ * with support for multiple frame buffers.
+ *
+ * Copyright (c) 2012, Citrix Systems, Inc. (Robert Phillips)
+ * Parts of this code are Copyright (c) 2007 Advanced Micro Devices (Wei Huang)
+ * Parts of this code are Copyright (c) 2007 XenSource Inc.
+ * Parts of this code are Copyright (c) 2006 by Michael A Fetterman
+ * Parts based on earlier work by Michael A Fetterman, Ian Pratt et al.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+
+#include <xen/types.h>
+#include <xen/sched.h>
+#include <xen/guest_access.h>
+#include <asm/shadow.h>
+#include <asm/dirty_vram.h>
+#include "mm-locks.h"
+
+#define DEBUG_stop_tracking_all_vram          0
+#define DEBUG_allocating_dirty_vram_range     0
+#define DEBUG_high_water_mark_for_vram_ranges 0
+#define DEBUG_freeing_dirty_vram_range        0
+#define DEBUG_allocate_paddr_links_page       0
+#define DEBUG_update_vram_mapping             0
+#define DEBUG_alloc_paddr_inject_fault        0
+
+/* Allocates domain's dirty_vram structure */
+dv_dirty_vram_t *
+dirty_vram_alloc(struct domain *d)
+{
+    dv_dirty_vram_t *dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    dirty_vram = d->arch.hvm_domain.dirty_vram = xzalloc(dv_dirty_vram_t);
+    if ( dirty_vram )
+    {
+        INIT_LIST_HEAD(&dirty_vram->range_head);
+        INIT_LIST_HEAD(&dirty_vram->ext_head);
+    }
+    return dirty_vram;
+}
+
+/*
+ * Returns domain's dirty_vram structure,
+ * allocating it if necessary
+ */
+dv_dirty_vram_t *
+dirty_vram_find_or_alloc(struct domain *d)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( !dirty_vram )
+        dirty_vram = dirty_vram_alloc(d);
+    return dirty_vram;
+}
+
+
+/* Free domain's dirty_vram structure */
+void dirty_vram_free(struct domain *d)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        struct list_head *curr, *next;
+        /* Free all the ranges */
+        list_for_each_safe(curr, next, &dirty_vram->range_head)
+        {
+            dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+#if DEBUG_stop_tracking_all_vram
+            gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] stop tracking all vram\n",
+                     range->begin_pfn, range->end_pfn);
+#endif
+            xfree(range->pl_tab);
+            xfree(range);
+        }
+        /* Free all the extension pages */
+        list_for_each_safe(curr, next, &dirty_vram->ext_head)
+        {
+            struct dv_paddr_link_ext *ext =
+                container_of(
+                    curr, struct dv_paddr_link_ext, ext_link);
+            struct page_info *pg = __virt_to_page(ext);
+            d->arch.paging.free_page(d, pg);
+        }
+
+        xfree(dirty_vram);
+        d->arch.hvm_domain.dirty_vram = NULL;
+    }
+}
+
+/* Returns dirty vram range containing gfn, NULL if none */
+struct dv_range *
+dirty_vram_range_find_gfn(struct domain *d,
+                          unsigned long gfn)
+{
+    struct dv_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        struct list_head *curr;
+        list_for_each(curr, &dirty_vram->range_head)
+        {
+            dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+            if ( gfn >= range->begin_pfn &&
+                 gfn <  range->end_pfn )
+                return range;
+        }
+    }
+    return NULL;
+}
+
+/*
+ * Returns pointer to dirty vram range matching [begin_pfn .. end_pfn ),
+ * NULL if none.
+ */
+dv_range_t *
+dirty_vram_range_find(struct domain *d,
+                      unsigned long begin_pfn,
+                      unsigned long nr)
+{
+    unsigned long end_pfn = begin_pfn + nr;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        struct list_head *curr;
+        list_for_each(curr, &dirty_vram->range_head)
+        {
+            dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+            if ( begin_pfn == range->begin_pfn &&
+                 end_pfn   == range->end_pfn )
+                return range;
+        }
+    }
+    return NULL;
+}
+
+/* Allocate specified dirty_vram range */
+static dv_range_t *
+_dirty_vram_range_alloc(struct domain *d,
+                        unsigned long begin_pfn,
+                        unsigned long nr)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_range_t *range = NULL;
+    unsigned long end_pfn = begin_pfn + nr;
+    dv_pl_entry_t *pl_tab = NULL;
+    int i;
+
+    ASSERT( paging_locked_by_me(d) );
+    ASSERT( dirty_vram != NULL );
+
+#if DEBUG_allocating_dirty_vram_range
+    gdprintk(XENLOG_DEBUG,
+             "[%05lx:%05lx] Allocating dirty vram range hap:%d\n",
+             begin_pfn, end_pfn,
+             d->arch.hvm_domain.hap_enabled);
+#endif
+
+    range = xzalloc(dv_range_t);
+    if ( range == NULL )
+        goto err_out;
+
+    INIT_LIST_HEAD(&range->range_link);
+
+    range->begin_pfn = begin_pfn;
+    range->end_pfn = end_pfn;
+
+    if ( !hap_enabled(d) )
+    {
+        if ( (pl_tab = xzalloc_array(dv_pl_entry_t, nr)) == NULL )
+            goto err_out;
+
+        for ( i = 0; i != nr; i++ )
+        {
+            pl_tab[i].mapping.sl1ma = INVALID_PADDR;
+        }
+    }
+
+    range->pl_tab = pl_tab;
+    range->mappings_hwm = 1;
+
+    list_add(&range->range_link, &dirty_vram->range_head);
+    if ( ++dirty_vram->nr_ranges > dirty_vram->ranges_hwm )
+    {
+        dirty_vram->ranges_hwm = dirty_vram->nr_ranges;
+#if DEBUG_high_water_mark_for_vram_ranges
+        gdprintk(XENLOG_DEBUG,
+                 "High water mark for number of vram ranges is now:%d\n",
+                 dirty_vram->ranges_hwm);
+#endif
+    }
+    return range;
+
+ err_out:
+    xfree(pl_tab);
+    xfree(range);
+    return NULL;
+}
+
+
+/* Frees specified dirty_vram range */
+void dirty_vram_range_free(struct domain *d,
+                           dv_range_t *range)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        int i, nr = range->end_pfn - range->begin_pfn;
+
+#if DEBUG_freeing_dirty_vram_range
+        gdprintk(XENLOG_DEBUG,
+                 "[%05lx:%05lx] Freeing dirty vram range\n",
+                 range->begin_pfn, range->end_pfn);
+#endif
+
+        if ( range->pl_tab )
+        {
+            for ( i = 0; i != nr; i++ )
+            {
+                dv_paddr_link_t *plx;
+                plx = range->pl_tab[i].mapping.pl_next;
+                /* Does current FB page have multiple mappings? */
+                if ( plx ) /* yes */
+                {
+                    /* Find the last element in singly-linked list */
+                    while ( plx->pl_next != NULL )
+                        plx = plx->pl_next;
+                    
+                    /* Prepend whole list to the free list */
+                    plx->pl_next = dirty_vram->pl_free;
+                    dirty_vram->pl_free = range->pl_tab[i].mapping.pl_next;
+                }
+            }
+            xfree(range->pl_tab);
+            range->pl_tab = NULL;
+        }
+
+        /* Remove range from the linked list, free it, and adjust count*/
+        list_del(&range->range_link);
+        xfree(range);
+        dirty_vram->nr_ranges--;
+    }
+}
+
+/*
+ * dirty_vram_range_alloc()
+ * This function ensures that the new range does not overlap any existing
+ * ranges -- deleting them if necessary -- and then calls
+ * _dirty_vram_range_alloc to actually allocate the new range.
+ */
+dv_range_t *
+dirty_vram_range_alloc(struct domain *d,
+                        unsigned long begin_pfn,
+                        unsigned long nr)
+{
+    unsigned long end_pfn = begin_pfn + nr;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_range_t *range;
+    struct list_head *curr, *next;
+
+    ASSERT( paging_locked_by_me(d) );
+    ASSERT( dirty_vram != NULL );
+
+    /*
+     * Ranges cannot overlap so
+     * free any range that overlaps [ begin_pfn .. end_pfn )
+     */
+    list_for_each_safe(curr, next, &dirty_vram->range_head)
+    {
+        dv_range_t *rng = list_entry(curr, dv_range_t, range_link);
+        if ( ( ( rng->begin_pfn <= begin_pfn ) &&
+               ( begin_pfn <  rng->end_pfn   )
+                 ) ||
+             ( ( begin_pfn <= rng->begin_pfn ) &&
+               ( rng->begin_pfn < end_pfn    )
+                 ) )
+        {
+            /* Different tracking, tear the previous down. */
+            dirty_vram_range_free(d, rng);
+        }
+    }
+
+    range = _dirty_vram_range_alloc(d, begin_pfn, nr);
+    if ( !range )
+        goto out;
+
+ out:
+    return range;
+}
+
+/*
+ * dirty_vram_range_find_or_alloc()
+ * Find the range for [begin_pfn:begin_pfn+nr).
+ * If it doesn't exists, create it.
+ */
+dv_range_t *
+dirty_vram_range_find_or_alloc(struct domain *d,
+                                unsigned long begin_pfn,
+                                unsigned long nr)
+{
+    dv_range_t *range;
+    ASSERT( paging_locked_by_me(d) );
+    range = dirty_vram_range_find(d, begin_pfn, nr);
+    if ( !range )
+        range = dirty_vram_range_alloc(d, begin_pfn, nr);
+    
+    return range;
+}
+
+
+
+/* Allocate a dv_paddr_link struct */
+static dv_paddr_link_t *
+alloc_paddr_link(struct domain *d)
+{
+    dv_paddr_link_t * pl = NULL;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+
+    ASSERT( paging_locked_by_me(d) );
+    BUILD_BUG_ON(sizeof(dv_paddr_link_ext_t) > PAGE_SIZE);
+    /* Is the list of free pl's empty? */
+    if ( dirty_vram->pl_free == NULL ) /* yes */
+    {
+        /*
+         * Allocate another page of pl's.
+         * Link them all together and point the free list head at them
+         */
+        int i;
+        struct page_info *pg = d->arch.paging.alloc_page(d);
+        dv_paddr_link_ext_t *ext = __page_to_virt(pg);
+        if ( ext == NULL )
+            goto out;
+
+#if DEBUG_allocate_paddr_links_page
+        gdprintk(XENLOG_DEBUG, "Allocated another page of paddr_links\n");
+#endif
+        list_add(&ext->ext_link, &dirty_vram->ext_head);
+
+        /* initialize and link together the new pl entries */
+        for ( i = 0; i != ARRAY_SIZE(ext->entries); i++ )
+        {
+            ext->entries[i].sl1ma = INVALID_PADDR;
+            ext->entries[i].pl_next = &ext->entries[i+1];
+        }
+        ext->entries[ARRAY_SIZE(ext->entries) - 1].pl_next = NULL;
+        dirty_vram->pl_free = &ext->entries[0];
+    }
+    pl = dirty_vram->pl_free;
+    dirty_vram->pl_free = pl->pl_next;
+
+    pl->sl1ma = INVALID_PADDR;
+    pl->pl_next = NULL;
+ out:
+    return pl;
+}
+
+
+/*
+ * Free a paddr_link struct.
+ *
+ * The caller has walked the singly-linked list of elements
+ * that have, as their head, an element in a pl_tab cell.
+ * The list walks has reached the element to be freed.
+ * (Each element is a dv_paddr_link_t struct.)
+ *
+ * @pl points to the element to be freed.
+ * @ppl points to its predecessor element's next member.
+ *
+ * After linking the precessor to the element's successor,
+ * we can free @pl by prepending it to the list of free
+ * elements.
+ *
+ * As a boundary case (which happens to be the common case),
+ * @pl points to a cell in the pl_tab rather than to some
+ * extension element danging from that cell.
+ * We recognize this case because @ppl is NULL.
+ * In that case we promote the first extension element by
+ * copying it into the pl_tab cell and free it.
+ */
+
+dv_paddr_link_t *
+free_paddr_link(struct domain *d,
+                dv_paddr_link_t **ppl,
+                dv_paddr_link_t *pl)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_paddr_link_t *npl; /* next pl */
+
+    ASSERT( paging_locked_by_me(d) );
+    /* extension mapping? */
+    if ( ppl ) /* yes. free it */
+    {
+        ASSERT(pl == (*ppl));
+        (*ppl) = npl = pl->pl_next;
+    }
+    else  /* main table */
+    {
+        /*
+         * move 2nd mapping to main table.
+         * and free 2nd mapping
+         */
+        dv_paddr_link_t * spl;
+        spl = pl->pl_next;
+        if ( spl == NULL )
+        {
+            pl->sl1ma = INVALID_PADDR;
+            return pl;
+        }
+        pl->sl1ma = spl->sl1ma;
+        pl->pl_next = spl->pl_next;
+        npl = pl; /* reprocess main table entry again */
+        pl = spl;
+    }
+    pl->sl1ma = INVALID_PADDR;
+    pl->pl_next = dirty_vram->pl_free;
+    dirty_vram->pl_free = pl;
+    return npl;
+}
+
+
+/*
+ * dirty_vram_range_update()
+ *
+ * This is called whenever a level 1 page table entry is modified.
+ * If the L1PTE is being cleared, the function removes any paddr_links
+ * that refer to it.
+ * If the L1PTE is being set to a frame buffer page, a paddr_link is
+ * created for that page's entry in pl_tab.
+ * Returns 1 iff entry found and set or cleared.
+ */
+int dirty_vram_range_update(struct domain *d,
+                            unsigned long gfn,
+                            paddr_t sl1ma,
+                            int set)
+{
+    int effective = 0;
+    dv_range_t *range;
+    unsigned long i;
+    dv_paddr_link_t *pl;
+    dv_paddr_link_t **ppl;
+    int len = 0;
+
+    ASSERT(paging_locked_by_me(d));
+    range = dirty_vram_range_find_gfn(d, gfn);
+    if ( !range )
+        return effective;
+
+    
+    i = gfn - range->begin_pfn;
+    pl = &range->pl_tab[ i ].mapping;
+    ppl = NULL;
+
+    /*
+     * find matching entry (pl), if any, and its predecessor
+     * in linked list (ppl)
+     */
+    while ( pl != NULL )
+    {
+        if ( pl->sl1ma == sl1ma || pl->sl1ma == INVALID_PADDR )
+            break;
+            
+        ppl = &pl->pl_next;
+        pl = *ppl;
+        len++;
+    }
+
+    if ( set )
+    {
+        /* Did we find sl1ma in either the main table or the linked list? */
+        if ( pl == NULL ) /* no, so we'll need to alloc a link */
+        {
+            ASSERT(ppl != NULL);
+            
+#if DEBUG_alloc_paddr_inject_fault
+            {
+                static int counter;
+                
+                /* Test stuck_dirty logic for some cases */
+                if ( (++counter) % 4 == 0 )
+                {
+                    /* Simply mark the frame buffer page as always dirty */
+                    range->pl_tab[ i ].stuck_dirty = 1;
+                    gdprintk(XENLOG_DEBUG,
+                             "[%lx] inject stuck dirty fault\n",
+                             gfn );
+                    goto out;
+                }
+            }
+#endif
+            /*
+             * Have we reached the limit of mappings we're willing
+             * to bookkeep?
+             */
+            if (len > DV_ADDR_LINK_LIST_LIMIT) /* yes */
+            {
+                /* Simply mark the frame buffer page as always dirty */
+                range->pl_tab[ i ].stuck_dirty = 1;
+                
+                gdprintk(XENLOG_DEBUG,
+                         "[%lx] link limit exceeded\n",
+                         gfn );
+                
+                goto out;
+            }
+
+            /* alloc link and append it to list */
+            (*ppl) = pl = alloc_paddr_link(d);
+            /* Were we able to allocate a link? */
+            if ( pl == NULL ) /* no */
+            {
+                /* Simply mark the frame buffer page as always dirty */
+                range->pl_tab[ i ].stuck_dirty = 1;
+                
+                gdprintk(XENLOG_DEBUG,
+                         "[%lx] alloc failure\n",
+                         gfn );
+                
+                goto out;
+            }
+        }
+        if ( pl->sl1ma != sl1ma )
+        {
+            ASSERT(pl->sl1ma == INVALID_PADDR);
+            pl->sl1ma = sl1ma;
+            range->nr_mappings++;
+        }
+        effective = 1;
+        if ( len > range->mappings_hwm )
+        {
+            range->mappings_hwm = len;
+#if DEBUG_update_vram_mapping
+            gdprintk(XENLOG_DEBUG,
+                     "[%lx] set      sl1ma:%lx hwm:%d mappings:%d "
+                     "freepages:%d\n",
+                     gfn, sl1ma,
+                     range->mappings_hwm,
+                     range->nr_mappings,
+                     d->arch.paging.shadow.free_pages);
+#endif
+        }
+    }
+    else /* clear */
+    {
+        if ( pl && pl->sl1ma == sl1ma )
+        {
+#if DEBUG_update_vram_mapping
+            gdprintk(XENLOG_DEBUG,
+                     "[%lx] clear    sl1ma:%lx mappings:%d\n",
+                     gfn, sl1ma,
+                     range->nr_mappings - 1);
+#endif
+            free_paddr_link(d, ppl, pl);
+            --range->nr_mappings;
+            effective = 1;
+        }
+    }
+ out:
+    return effective;
+}
+
+
+/*
+ * shadow_scan_dirty_flags()
+ * This produces a dirty bitmap for the range by examining every
+ * L1PTE referenced by some dv_paddr_link in the range's pl_tab table.
+ * It tests and clears each such L1PTE's dirty flag.
+ */
+static int shadow_scan_dirty_flags(struct domain *d,
+                                   dv_range_t *range,
+                                   uint8_t *dirty_bitmap)
+{
+    int flush_tlb = 0;
+    unsigned long i;
+    unsigned long nr = range->end_pfn - range->begin_pfn;
+
+    ASSERT( paging_locked_by_me(d) );
+    /* Iterate over VRAM to track dirty bits. */
+    for ( i = 0; i < nr; i++ )
+    {
+        int dirty = 0, len = 1;
+        dv_paddr_link_t *pl;
+        /* Does the frame buffer have an incomplete set of mappings? */
+        if ( unlikely(range->pl_tab[i].stuck_dirty) ) /* yes */
+            dirty = 1;
+        else /* The frame buffer's set of mappings is complete.  Scan it. */
+            for ( pl = &range->pl_tab[i].mapping;
+                  pl;
+                  pl = pl->pl_next, len++ )
+            {
+                l1_pgentry_t *sl1e;
+                paddr_t sl1ma = pl->sl1ma;
+                if (sl1ma == INVALID_PADDR) /* FB page is unmapped */
+                    continue;
+                sl1e = maddr_to_virt(sl1ma);
+                if ( l1e_get_flags(*sl1e) & _PAGE_DIRTY )
+                {
+                    dirty = 1;
+                    /* Clear dirty so we can detect if page gets re-dirtied.
+                     * Note: this is atomic, so we may clear a
+                     * _PAGE_ACCESSED set by another processor.
+                     */
+                    l1e_remove_flags(*sl1e, _PAGE_DIRTY);
+                    flush_tlb = 1;
+                }
+            } /* for */
+        
+        if ( dirty )
+            dirty_bitmap[i >> 3] |= (1 << (i & 7));
+
+    }
+
+    return flush_tlb;
+}
+
+
+/*
+ * shadow_track_dirty_vram()
+ * This is the API called by the guest to determine which pages in the range
+ * from [begin_pfn:begin_pfn+nr) have been dirtied since the last call.
+ * It creates the domain's dv_dirty_vram on demand.
+ * It creates ranges on demand when some [begin_pfn:nr) is first encountered.
+ * To collect the dirty bitmask it calls shadow_scan_dirty_flags().
+ * It copies the dirty bitmask into guest storage.
+ */
+int shadow_track_dirty_vram(struct domain *d,
+                            unsigned long begin_pfn,
+                            unsigned long nr,
+                            XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
+{
+    int rc = 0;
+    unsigned long end_pfn = begin_pfn + nr;
+    int flush_tlb = 0;
+    dv_range_t *range;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+
+    /*
+     * This range test is tricky.
+     *
+     * The range [begin_pfn..end_pfn) is an open interval, so end_pfn
+     * is a pfn beyond the end of the range.
+     *
+     * p2m->max_mapped_pfn is a valid PFN so p2m->max_mapped_pfn + 1 is an
+     * invalid PFN.
+     *
+     * If end_pfn is beyond *that* then the range is invalid.
+     */
+    if ( end_pfn < begin_pfn
+         || begin_pfn > p2m->max_mapped_pfn
+         || end_pfn > p2m->max_mapped_pfn + 1 )
+        return -EINVAL;
+
+    paging_lock(d);
+
+    if (!nr)
+    {
+        dirty_vram_free(d);
+        goto out;
+    }
+
+    if ( guest_handle_is_null(guest_dirty_bitmap) )
+        goto out;
+
+    if ( !dirty_vram_find_or_alloc(d) )
+    {
+        rc = -ENOMEM;
+        goto out;
+    }
+
+    range = dirty_vram_range_find(d, begin_pfn, nr);
+    if ( !range )
+    {
+        range = dirty_vram_range_alloc(d, begin_pfn, nr);
+        if ( range )
+            sh_find_all_vram_mappings(d->vcpu[0], range);
+    }
+    if ( range )
+    {
+        int size = (nr + BITS_PER_LONG - 1) / BITS_PER_LONG;
+        unsigned long dirty_bitmap[size];
+
+        memset(dirty_bitmap, 0x00, size * BYTES_PER_LONG);
+
+	flush_tlb |= shadow_scan_dirty_flags(d, range, (uint8_t*)dirty_bitmap);
+
+        rc = -EFAULT;
+        if ( copy_to_guest(guest_dirty_bitmap,
+                           (uint8_t*)dirty_bitmap,
+                           size * BYTES_PER_LONG) == 0 )
+            rc = 0;
+    }
+    
+    if ( flush_tlb )
+        flush_tlb_mask(d->domain_dirty_cpumask);
+
+out:
+    paging_unlock(d);
+    return rc;
+}
+
+
+/************************************************/
+/*          HAP VRAM TRACKING SUPPORT           */
+/************************************************/
+
+/*
+ * hap_enable_vram_tracking()
+ * For all ranges, mark all vram pages in range as logdirty read-only.
+ */
+static int hap_enable_vram_tracking(struct domain *d)
+{
+    int rc = 0;
+    dv_dirty_vram_t *dirty_vram;
+    struct list_head *curr;
+
+    /* turn on PG_log_dirty bit in paging mode */
+    paging_lock(d);
+    d->arch.paging.mode |= PG_log_dirty;
+    paging_unlock(d);
+
+    p2m_lock(p2m_get_hostp2m(d));
+    paging_lock(d);
+
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+
+    /*
+     * dirty_vram != NULL iff we're tracking dirty vram.
+     * If we start tracking dirty pages for all memory then
+     * the dirty_vram structure is freed.
+     */
+    if ( !dirty_vram )
+    {
+        rc = -EINVAL;
+        goto out;
+    }
+
+    /* set l1e entries of P2M table to be read-only. */
+    list_for_each(curr, &dirty_vram->range_head)
+    {
+	dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+	gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] enable  vram tracking\n",
+		 range->begin_pfn, range->end_pfn);
+	p2m_change_type_range(d, range->begin_pfn, range->end_pfn,
+			      p2m_ram_rw, p2m_ram_logdirty);
+    }
+
+    flush_tlb_mask(d->domain_dirty_cpumask);
+ out:
+    paging_unlock(d);
+    p2m_unlock(p2m_get_hostp2m(d));
+    if ( rc )
+    {
+        paging_lock(d);
+        d->arch.paging.mode &= ~PG_log_dirty;
+        paging_unlock(d);
+    }
+    return rc;
+}
+
+/*
+ * hap_disable_vram_tracking()
+ * For all ranges, mark all vram pages in range as logdirty read-write.
+ */
+static int hap_disable_vram_tracking(struct domain *d)
+{
+    int rc = 0;
+    dv_dirty_vram_t *dirty_vram;
+    struct list_head *curr;
+
+    paging_lock(d);
+    d->arch.paging.mode &= ~PG_log_dirty;
+    paging_unlock(d);
+
+    p2m_lock(p2m_get_hostp2m(d));
+    paging_lock(d);
+
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+    if ( !dirty_vram )
+    {
+        rc = -EINVAL;
+        goto out;
+    }
+
+    /* set l1e entries of P2M table with normal mode */
+    list_for_each(curr, &dirty_vram->range_head)
+    {
+	dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+	gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] disable vram tracking\n",
+		 range->begin_pfn, range->end_pfn);
+	p2m_change_type_range(d, range->begin_pfn, range->end_pfn,
+			      p2m_ram_logdirty, p2m_ram_rw);
+    }
+    flush_tlb_mask(d->domain_dirty_cpumask);
+ out:
+    paging_unlock(d);
+    p2m_unlock(p2m_get_hostp2m(d));
+    if ( rc )
+    {
+        paging_lock(d);
+        d->arch.paging.mode |= PG_log_dirty;
+        paging_unlock(d);
+    }
+    return rc;
+}
+
+/*
+ * hap_clean_vram_tracking_range()
+ * For all the pages in the range specified by [begin_pfn,nr),
+ * note in the dirty bitmap any page that has been marked as read-write,
+ * which signifies that the page has been dirtied, and reset the page
+ * to ram_logdirty.
+ */
+void hap_clean_vram_tracking_range(struct domain *d,
+                                   unsigned long begin_pfn,
+                                   unsigned long nr,
+                                   uint8_t *dirty_bitmap)
+{
+    int i;
+    unsigned long pfn;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_range_t *range;
+
+    ASSERT(p2m_locked_by_me(p2m_get_hostp2m(d)));
+    ASSERT(paging_locked_by_me(d));
+
+    if ( !dirty_vram )
+    {
+        gdprintk(XENLOG_DEBUG,
+                 "Should only be called while tracking dirty vram.\n");
+        return;
+    }
+
+    range = dirty_vram_range_find(d, begin_pfn, nr);
+    if ( !range )
+        return;
+
+    /* set l1e entries of P2M table to be read-only. */
+    /*
+     * On first write, it page faults, its entry is changed to read-write,
+     * its bit in the dirty bitmap is set, and on retry the write succeeds.
+     */
+    for ( i = 0, pfn = range->begin_pfn; pfn < range->end_pfn; i++, pfn++ )
+    {
+        p2m_type_t pt;
+        pt = p2m_change_type(d, pfn, p2m_ram_rw, p2m_ram_logdirty);
+        if ( pt == p2m_ram_rw )
+            dirty_bitmap[i >> 3] |= (1 << (i & 7));
+    }
+    flush_tlb_mask(d->domain_dirty_cpumask);
+}
+
+static void hap_vram_tracking_init(struct domain *d)
+{
+    paging_log_dirty_init(d, hap_enable_vram_tracking,
+                          hap_disable_vram_tracking,
+                          NULL);
+}
+
+/*
+ * hap_track_dirty_vram()
+ * Create the domain's dv_dirty_vram struct on demand.
+ * Create a dirty vram range on demand when some [begin_pfn:begin_pfn+nr] is
+ * first encountered.
+ * Collect the guest_dirty bitmask, a bit mask of the dirty vram pages, by
+ * calling paging_log_dirty_range().
+ */
+int hap_track_dirty_vram(struct domain *d,
+                         unsigned long begin_pfn,
+                         unsigned long nr,
+                         XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
+{
+    long rc = 0;
+    dv_dirty_vram_t *dirty_vram;
+
+    paging_lock(d);
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+    if ( nr )
+    {
+        dv_range_t *range = NULL;
+        int size = ( nr + BITS_PER_LONG - 1 ) & ~( BITS_PER_LONG - 1 );
+        uint8_t dirty_bitmap[size];
+        bool_t new_range = 0;
+
+        /* Already tracking dirty vram? */
+        if ( paging_mode_log_dirty(d) && dirty_vram ) /* yes */
+        {
+            /* Handle the addition of another range */
+            range = dirty_vram_range_find(d, begin_pfn, nr);
+            if ( !range )
+            {
+                rc = -ENOMEM;
+                if ( !(range = dirty_vram_range_alloc(d, begin_pfn, nr)) )
+                    goto param_fail;
+                new_range = 1;
+            }
+        }
+        /* Just starting to track dirty vram? */
+        else if ( !paging_mode_log_dirty(d) && !dirty_vram ) /* yes */
+        {
+            rc = -ENOMEM;
+            if ( !(dirty_vram = dirty_vram_alloc(d)) )
+                goto param_fail;
+
+            if ( !(range = dirty_vram_range_find_or_alloc(d, begin_pfn,
+                                                          nr)) )
+                goto param_fail;
+
+            new_range = 1;
+            
+            /* Initialize callbacks for vram tracking */
+            hap_vram_tracking_init(d);
+
+            /* Enable HAP vram tracking */
+            paging_unlock(d);
+            rc = paging_log_dirty_enable(d);
+            paging_lock(d);
+            
+            if ( rc != 0 )
+                goto param_fail;
+        }
+        else
+        {
+            /* Test for invalid combination */
+            if ( !paging_mode_log_dirty(d) && dirty_vram )
+                rc = -EINVAL;
+            else /* logging dirty of all memory, not tracking dirty vram */
+                rc = -ENODATA;
+            goto param_fail;
+        }
+
+        paging_unlock(d);
+        /* Is this query the very first for this range? */
+        if ( new_range ) /* yes */
+            memset(dirty_bitmap, 0xff, size); /* consider all pages dirty */
+        else
+        {
+            memset(dirty_bitmap, 0x00, size);
+            paging_log_dirty_range(d, begin_pfn, nr, dirty_bitmap);
+        }
+        rc = -EFAULT;
+        if ( copy_to_guest(guest_dirty_bitmap,
+                           dirty_bitmap,
+                           size) == 0 )
+        {
+            rc = 0;
+        }
+    }
+    else
+    {
+        /*
+         * If zero pages specified while already tracking dirty vram
+         * then stop tracking
+         */
+        if ( paging_mode_log_dirty(d) && dirty_vram )
+        {
+            /* Disable HAP vram tracking */
+            paging_unlock(d);
+            rc = paging_log_dirty_disable(d);
+            paging_lock(d);
+            
+            dirty_vram_free(d);
+        }
+        else /* benign no-op */
+        {
+            rc = 0;
+        }
+        paging_unlock(d);
+    }
+
+    return rc;
+
+param_fail:
+    dirty_vram_free(d);
+    paging_unlock(d);
+    return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index fd99cde..09cdba2 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -41,6 +41,7 @@
 #include <asm/domain.h>
 #include <xen/numa.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/dirty_vram.h>
 
 #include "private.h"
 
@@ -53,139 +54,6 @@
 #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
 
 /************************************************/
-/*          HAP VRAM TRACKING SUPPORT           */
-/************************************************/
-
-static int hap_enable_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return -EINVAL;
-
-    /* turn on PG_log_dirty bit in paging mode */
-    paging_lock(d);
-    d->arch.paging.mode |= PG_log_dirty;
-    paging_unlock(d);
-
-    /* set l1e entries of P2M table to be read-only. */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_rw, p2m_ram_logdirty);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-    return 0;
-}
-
-static int hap_disable_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return -EINVAL;
-
-    paging_lock(d);
-    d->arch.paging.mode &= ~PG_log_dirty;
-    paging_unlock(d);
-
-    /* set l1e entries of P2M table with normal mode */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_logdirty, p2m_ram_rw);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-    return 0;
-}
-
-static void hap_clean_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return;
-
-    /* set l1e entries of P2M table to be read-only. */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_rw, p2m_ram_logdirty);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-}
-
-static void hap_vram_tracking_init(struct domain *d)
-{
-    paging_log_dirty_init(d, hap_enable_vram_tracking,
-                          hap_disable_vram_tracking,
-                          hap_clean_vram_tracking);
-}
-
-int hap_track_dirty_vram(struct domain *d,
-                         unsigned long begin_pfn,
-                         unsigned long nr,
-                         XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
-{
-    long rc = 0;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( nr )
-    {
-        if ( paging_mode_log_dirty(d) && dirty_vram )
-        {
-            if ( begin_pfn != dirty_vram->begin_pfn ||
-                 begin_pfn + nr != dirty_vram->end_pfn )
-            {
-                paging_log_dirty_disable(d);
-                dirty_vram->begin_pfn = begin_pfn;
-                dirty_vram->end_pfn = begin_pfn + nr;
-                rc = paging_log_dirty_enable(d);
-                if (rc != 0)
-                    goto param_fail;
-            }
-        }
-        else if ( !paging_mode_log_dirty(d) && !dirty_vram )
-        {
-            rc = -ENOMEM;
-            if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL )
-                goto param_fail;
-
-            dirty_vram->begin_pfn = begin_pfn;
-            dirty_vram->end_pfn = begin_pfn + nr;
-            d->arch.hvm_domain.dirty_vram = dirty_vram;
-            hap_vram_tracking_init(d);
-            rc = paging_log_dirty_enable(d);
-            if (rc != 0)
-                goto param_fail;
-        }
-        else
-        {
-            if ( !paging_mode_log_dirty(d) && dirty_vram )
-                rc = -EINVAL;
-            else
-                rc = -ENODATA;
-            goto param_fail;
-        }
-        /* get the bitmap */
-        rc = paging_log_dirty_range(d, begin_pfn, nr, dirty_bitmap);
-    }
-    else
-    {
-        if ( paging_mode_log_dirty(d) && dirty_vram ) {
-            rc = paging_log_dirty_disable(d);
-            xfree(dirty_vram);
-            dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-        } else
-            rc = 0;
-    }
-
-    return rc;
-
-param_fail:
-    if ( dirty_vram )
-    {
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-    }
-    return rc;
-}
-
-/************************************************/
 /*            HAP LOG DIRTY SUPPORT             */
 /************************************************/
 
@@ -223,14 +91,12 @@ static void hap_clean_dirty_bitmap(struct domain *d)
 
 void hap_logdirty_init(struct domain *d)
 {
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    struct dv_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
     if ( paging_mode_log_dirty(d) && dirty_vram )
     {
         paging_log_dirty_disable(d);
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
+        dirty_vram_free(d);
     }
-
     /* Reinitialize logdirty mechanism */
     paging_log_dirty_init(d, hap_enable_log_dirty,
                           hap_disable_log_dirty,
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index ea44e39..f0ac512 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -27,6 +27,7 @@
 #include <asm/p2m.h>
 #include <asm/hap.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/dirty_vram.h>
 #include <xen/numa.h>
 #include <xsm/xsm.h>
 
@@ -192,15 +193,11 @@ int paging_log_dirty_disable(struct domain *d)
     return ret;
 }
 
-/* Mark a page as dirty */
+/* Given a guest mfn, mark a page as dirty */
 void paging_mark_dirty(struct domain *d, unsigned long guest_mfn)
 {
     unsigned long pfn;
     mfn_t gmfn;
-    int changed;
-    mfn_t mfn, *l4, *l3, *l2;
-    unsigned long *l1;
-    int i1, i2, i3, i4;
 
     gmfn = _mfn(guest_mfn);
 
@@ -210,6 +207,19 @@ void paging_mark_dirty(struct domain *d, unsigned long guest_mfn)
 
     /* We /really/ mean PFN here, even for non-translated guests. */
     pfn = get_gpfn_from_mfn(mfn_x(gmfn));
+    paging_mark_dirty_gpfn(d, pfn);
+}
+
+
+/* Given a guest pfn, mark a page as dirty */
+void paging_mark_dirty_gpfn(struct domain *d, unsigned long pfn)
+{
+    int changed;
+    mfn_t mfn, *l4, *l3, *l2;
+    unsigned long *l1;
+    int i1, i2, i3, i4;
+    dv_range_t *range;
+    
     /* Shared MFNs should NEVER be marked dirty */
     BUG_ON(SHARED_M2P(pfn));
 
@@ -229,6 +239,11 @@ void paging_mark_dirty(struct domain *d, unsigned long guest_mfn)
     /* Recursive: this is called from inside the shadow code */
     paging_lock_recursive(d);
 
+    d->arch.paging.log_dirty.dirty_count++;
+    range = dirty_vram_range_find_gfn(d, pfn);
+    if ( range )
+        range->dirty_count++;
+
     if ( unlikely(!mfn_valid(d->arch.paging.log_dirty.top)) ) 
     {
          d->arch.paging.log_dirty.top = paging_new_log_dirty_node(d);
@@ -333,8 +348,11 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
     mfn_t *l4, *l3, *l2;
     unsigned long *l1;
     int i4, i3, i2;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
 
     domain_pause(d);
+    /* Locking hierarchy requires p2m lock to be taken first */
+    p2m_lock(p2m);
     paging_lock(d);
 
     clean = (sc->op == XEN_DOMCTL_SHADOW_OP_CLEAN);
@@ -345,6 +363,16 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
                  d->arch.paging.log_dirty.fault_count,
                  d->arch.paging.log_dirty.dirty_count);
 
+    if ( hap_enabled(d) && d->arch.hvm_domain.dirty_vram )
+    {
+        /*
+         * If we're cleaning/peeking all guest memory, we should not
+         * be tracking dirty vram.
+         */
+        rv = -EINVAL;
+        goto out;
+    }
+
     sc->stats.fault_count = d->arch.paging.log_dirty.fault_count;
     sc->stats.dirty_count = d->arch.paging.log_dirty.dirty_count;
 
@@ -424,170 +452,64 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
 
     if ( clean )
     {
-        /* We need to further call clean_dirty_bitmap() functions of specific
-         * paging modes (shadow or hap).  Safe because the domain is paused. */
-        d->arch.paging.log_dirty.clean_dirty_bitmap(d);
+        /* Is null if tracking dirty vram */
+        if ( d->arch.paging.log_dirty.clean_dirty_bitmap )
+        {
+            /*
+             * We need to call clean_dirty_bitmap() functions of specific
+             * paging modes (shadow or hap).
+             * Safe because the domain is paused.
+             */
+            d->arch.paging.log_dirty.clean_dirty_bitmap(d);
+        }
     }
     domain_unpause(d);
     return rv;
 
  out:
     paging_unlock(d);
+    p2m_unlock(p2m);
     domain_unpause(d);
     return rv;
 }
 
-int paging_log_dirty_range(struct domain *d,
-                            unsigned long begin_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
+void paging_log_dirty_range(struct domain *d,
+                           unsigned long begin_pfn,
+                           unsigned long nr,
+                           uint8_t *dirty_bitmap)
 {
-    int rv = 0;
-    unsigned long pages = 0;
-    mfn_t *l4, *l3, *l2;
-    unsigned long *l1;
-    int b1, b2, b3, b4;
-    int i2, i3, i4;
-
-    d->arch.paging.log_dirty.clean_dirty_bitmap(d);
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    dv_range_t *range;
+    unsigned int range_dirty_count = 0;
+    
+    p2m_lock(p2m);
     paging_lock(d);
 
-    PAGING_DEBUG(LOGDIRTY, "log-dirty-range: dom %u faults=%u dirty=%u\n",
-                 d->domain_id,
-                 d->arch.paging.log_dirty.fault_count,
-                 d->arch.paging.log_dirty.dirty_count);
-
-    if ( unlikely(d->arch.paging.log_dirty.failed_allocs) ) {
-        printk("%s: %d failed page allocs while logging dirty pages\n",
-               __FUNCTION__, d->arch.paging.log_dirty.failed_allocs);
-        rv = -ENOMEM;
-        goto out;
-    }
-
-    if ( !d->arch.paging.log_dirty.fault_count &&
-         !d->arch.paging.log_dirty.dirty_count ) {
-        unsigned int size = BITS_TO_LONGS(nr);
-
-        if ( clear_guest(dirty_bitmap, size * BYTES_PER_LONG) != 0 )
-            rv = -EFAULT;
-        goto out;
-    }
-    d->arch.paging.log_dirty.fault_count = 0;
-    d->arch.paging.log_dirty.dirty_count = 0;
-
-    b1 = L1_LOGDIRTY_IDX(begin_pfn);
-    b2 = L2_LOGDIRTY_IDX(begin_pfn);
-    b3 = L3_LOGDIRTY_IDX(begin_pfn);
-    b4 = L4_LOGDIRTY_IDX(begin_pfn);
-    l4 = paging_map_log_dirty_bitmap(d);
-
-    for ( i4 = b4;
-          (pages < nr) && (i4 < LOGDIRTY_NODE_ENTRIES);
-          i4++ )
+    /* Only called when tracking dirty vram in HAP mode */
+    ASSERT(hap_enabled(d) && d->arch.hvm_domain.dirty_vram);
+    
+    range = dirty_vram_range_find_gfn(d, begin_pfn);
+    if ( range )
     {
-        l3 = (l4 && mfn_valid(l4[i4])) ? map_domain_page(mfn_x(l4[i4])) : NULL;
-        for ( i3 = b3;
-              (pages < nr) && (i3 < LOGDIRTY_NODE_ENTRIES);
-              i3++ )
-        {
-            l2 = ((l3 && mfn_valid(l3[i3])) ?
-                  map_domain_page(mfn_x(l3[i3])) : NULL);
-            for ( i2 = b2;
-                  (pages < nr) && (i2 < LOGDIRTY_NODE_ENTRIES);
-                  i2++ )
-            {
-                unsigned int bytes = PAGE_SIZE;
-                uint8_t *s;
-                l1 = ((l2 && mfn_valid(l2[i2])) ?
-                      map_domain_page(mfn_x(l2[i2])) : NULL);
-
-                s = ((uint8_t*)l1) + (b1 >> 3);
-                bytes -= b1 >> 3;
-
-                if ( likely(((nr - pages + 7) >> 3) < bytes) )
-                    bytes = (unsigned int)((nr - pages + 7) >> 3);
-
-                if ( !l1 )
-                {
-                    if ( clear_guest_offset(dirty_bitmap, pages >> 3,
-                                            bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-                /* begin_pfn is not 32K aligned, hence we have to bit
-                 * shift the bitmap */
-                else if ( b1 & 0x7 )
-                {
-                    int i, j;
-                    uint32_t *l = (uint32_t*) s;
-                    int bits = b1 & 0x7;
-                    int bitmask = (1 << bits) - 1;
-                    int size = (bytes + BYTES_PER_LONG - 1) / BYTES_PER_LONG;
-                    unsigned long bitmap[size];
-                    static unsigned long printed = 0;
-
-                    if ( printed != begin_pfn )
-                    {
-                        dprintk(XENLOG_DEBUG, "%s: begin_pfn %lx is not 32K aligned!\n",
-                                __FUNCTION__, begin_pfn);
-                        printed = begin_pfn;
-                    }
-
-                    for ( i = 0; i < size - 1; i++, l++ ) {
-                        bitmap[i] = ((*l) >> bits) |
-                            (((*((uint8_t*)(l + 1))) & bitmask) << (sizeof(*l) * 8 - bits));
-                    }
-                    s = (uint8_t*) l;
-                    size = BYTES_PER_LONG - ((b1 >> 3) & 0x3);
-                    bitmap[i] = 0;
-                    for ( j = 0; j < size; j++, s++ )
-                        bitmap[i] |= (*s) << (j * 8);
-                    bitmap[i] = (bitmap[i] >> bits) | (bitmask << (size * 8 - bits));
-                    if ( copy_to_guest_offset(dirty_bitmap, (pages >> 3),
-                                (uint8_t*) bitmap, bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-                else
-                {
-                    if ( copy_to_guest_offset(dirty_bitmap, pages >> 3,
-                                              s, bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-
-                pages += bytes << 3;
-                if ( l1 )
-                {
-                    clear_page(l1);
-                    unmap_domain_page(l1);
-                }
-                b1 = b1 & 0x7;
-            }
-            b2 = 0;
-            if ( l2 )
-                unmap_domain_page(l2);
-        }
-        b3 = 0;
-        if ( l3 )
-            unmap_domain_page(l3);
+        range_dirty_count = range->dirty_count;
+        range->dirty_count = 0;
     }
-    if ( l4 )
-        unmap_domain_page(l4);
-
-    paging_unlock(d);
+    
+    if ( !range_dirty_count)
+        goto out;
 
-    return rv;
+    PAGING_DEBUG(LOGDIRTY,
+                 "log-dirty-range: dom %u [%05lx:%05lx] range_dirty=%u\n",
+                 d->domain_id,
+                 begin_pfn,
+                 range->end_pfn,
+                 range_dirty_count);
 
+    hap_clean_vram_tracking_range(d, begin_pfn, nr, dirty_bitmap);
  out:
     paging_unlock(d);
-    return rv;
+    p2m_unlock(p2m);
+    return;
 }
 
 /* Note that this function takes three function pointers. Callers must supply
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index ce79131..30829b6 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -36,6 +36,7 @@
 #include <asm/current.h>
 #include <asm/flushtlb.h>
 #include <asm/shadow.h>
+#include <asm/dirty_vram.h>
 #include <xen/numa.h>
 #include "private.h"
 
@@ -3121,12 +3122,7 @@ void shadow_teardown(struct domain *d)
      * calls now that we've torn down the bitmap */
     d->arch.paging.mode &= ~PG_log_dirty;
 
-    if (d->arch.hvm_domain.dirty_vram) {
-        xfree(d->arch.hvm_domain.dirty_vram->sl1ma);
-        xfree(d->arch.hvm_domain.dirty_vram->dirty_bitmap);
-        xfree(d->arch.hvm_domain.dirty_vram);
-        d->arch.hvm_domain.dirty_vram = NULL;
-    }
+    dirty_vram_free(d);
 
     paging_unlock(d);
 
@@ -3463,177 +3459,209 @@ void shadow_clean_dirty_bitmap(struct domain *d)
 
 
 /**************************************************************************/
-/* VRAM dirty tracking support */
-int shadow_track_dirty_vram(struct domain *d,
-                            unsigned long begin_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
-{
-    int rc;
-    unsigned long end_pfn = begin_pfn + nr;
-    unsigned long dirty_size = (nr + 7) / 8;
-    int flush_tlb = 0;
-    unsigned long i;
-    p2m_type_t t;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-    struct p2m_domain *p2m = p2m_get_hostp2m(d);
-
-    if (end_pfn < begin_pfn
-            || begin_pfn > p2m->max_mapped_pfn
-            || end_pfn >= p2m->max_mapped_pfn)
-        return -EINVAL;
-
-    /* We perform p2m lookups, so lock the p2m upfront to avoid deadlock */
-    p2m_lock(p2m_get_hostp2m(d));
-    paging_lock(d);
+/* Support functions for shadow-based dirty VRAM code */
 
-    if ( dirty_vram && (!nr ||
-             ( begin_pfn != dirty_vram->begin_pfn
-            || end_pfn   != dirty_vram->end_pfn )) )
-    {
-        /* Different tracking, tear the previous down. */
-        gdprintk(XENLOG_INFO, "stopping tracking VRAM %lx - %lx\n", dirty_vram->begin_pfn, dirty_vram->end_pfn);
-        xfree(dirty_vram->sl1ma);
-        xfree(dirty_vram->dirty_bitmap);
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-    }
+#define DEBUG_unshadow_sl1ma                  0          
+#define DEBUG_unshadow_sl1ma_detail           0
+#define DEBUG_count_initial_mappings          1
 
-    if ( !nr )
+/* smfn is no longer a shadow page.  Remove it from any
+ * dirty vram range mapping. */
+void
+dirty_vram_delete_shadow(struct vcpu *v,
+                         unsigned long gfn,
+                         unsigned int shadow_type, 
+                         mfn_t smfn)
+{
+    static unsigned int l1_shadow_mask = 
+          1 << SH_type_l1_32_shadow
+        | 1 << SH_type_fl1_32_shadow
+        | 1 << SH_type_l1_pae_shadow
+        | 1 << SH_type_fl1_pae_shadow
+        | 1 << SH_type_l1_64_shadow
+        | 1 << SH_type_fl1_64_shadow
+        ;
+    struct domain *d = v->domain;
+    dv_dirty_vram_t *dirty_vram;
+    struct list_head *curr, *next;
+    
+    ASSERT(paging_locked_by_me(d));
+    /* Ignore all but level 1 shadows */
+    
+    if ((l1_shadow_mask & (1 << shadow_type)) == 0)
     {
-        rc = 0;
         goto out;
     }
 
-    /* This should happen seldomly (Video mode change),
-     * no need to be careful. */
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
     if ( !dirty_vram )
     {
-        /* Throw away all the shadows rather than walking through them 
-         * up to nr times getting rid of mappings of each pfn */
-        shadow_blow_tables(d);
-
-        gdprintk(XENLOG_INFO, "tracking VRAM %lx - %lx\n", begin_pfn, end_pfn);
-
-        rc = -ENOMEM;
-        if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL )
-            goto out;
-        dirty_vram->begin_pfn = begin_pfn;
-        dirty_vram->end_pfn = end_pfn;
-        d->arch.hvm_domain.dirty_vram = dirty_vram;
-
-        if ( (dirty_vram->sl1ma = xmalloc_array(paddr_t, nr)) == NULL )
-            goto out_dirty_vram;
-        memset(dirty_vram->sl1ma, ~0, sizeof(paddr_t) * nr);
-
-        if ( (dirty_vram->dirty_bitmap = xzalloc_array(uint8_t, dirty_size)) == NULL )
-            goto out_sl1ma;
-
-        dirty_vram->last_dirty = NOW();
-
-        /* Tell the caller that this time we could not track dirty bits. */
-        rc = -ENODATA;
-    }
-    else if (dirty_vram->last_dirty == -1)
-    {
-        /* still completely clean, just copy our empty bitmap */
-        rc = -EFAULT;
-        if ( copy_to_guest(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size) == 0 )
-            rc = 0;
+        goto out;
     }
-    else
+        
+    list_for_each_safe(curr, next, &dirty_vram->range_head)
     {
-        /* Iterate over VRAM to track dirty bits. */
-        for ( i = 0; i < nr; i++ ) {
-            mfn_t mfn = get_gfn_query_unlocked(d, begin_pfn + i, &t);
-            struct page_info *page;
-            int dirty = 0;
-            paddr_t sl1ma = dirty_vram->sl1ma[i];
-
-            if (mfn_x(mfn) == INVALID_MFN)
-            {
-                dirty = 1;
-            }
-            else
+        dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+        unsigned long i;
+        int max_mappings = 1, mappings = 0;
+        int unshadowed = 0;
+        for (i = 0; i != range->end_pfn - range->begin_pfn; i++)
+        {
+            dv_paddr_link_t *pl = &range->pl_tab[ i ].mapping;
+            dv_paddr_link_t **ppl = NULL;
+            mappings = 0;
+            
+            while (pl != NULL)
             {
-                page = mfn_to_page(mfn);
-                switch (page->u.inuse.type_info & PGT_count_mask)
-                {
-                case 0:
-                    /* No guest reference, nothing to track. */
-                    break;
-                case 1:
-                    /* One guest reference. */
-                    if ( sl1ma == INVALID_PADDR )
-                    {
-                        /* We don't know which sl1e points to this, too bad. */
-                        dirty = 1;
-                        /* TODO: Heuristics for finding the single mapping of
-                         * this gmfn */
-                        flush_tlb |= sh_remove_all_mappings(d->vcpu[0], mfn);
-                    }
-                    else
-                    {
-                        /* Hopefully the most common case: only one mapping,
-                         * whose dirty bit we can use. */
-                        l1_pgentry_t *sl1e = maddr_to_virt(sl1ma);
-
-                        if ( l1e_get_flags(*sl1e) & _PAGE_DIRTY )
-                        {
-                            dirty = 1;
-                            /* Note: this is atomic, so we may clear a
-                             * _PAGE_ACCESSED set by another processor. */
-                            l1e_remove_flags(*sl1e, _PAGE_DIRTY);
-                            flush_tlb = 1;
-                        }
-                    }
-                    break;
-                default:
-                    /* More than one guest reference,
-                     * we don't afford tracking that. */
-                    dirty = 1;
+                paddr_t sl1ma = pl->sl1ma;
+                unsigned long sl1mn;
+                
+                if (sl1ma == INVALID_PADDR )
                     break;
+                
+                sl1mn = sl1ma >> PAGE_SHIFT;
+                if (sl1mn == mfn_x(smfn)) {
+#if DEBUG_unshadow_sl1ma_detail
+                    gdprintk(XENLOG_DEBUG,
+                             "[%lx] gfn[%lx] unshadow sl1ma:%lx\n",
+                             mfn_x(smfn),
+                             range->begin_pfn + i,
+                             sl1ma);
+#endif
+                    unshadowed++;
+                    pl = free_paddr_link(d, ppl, pl);
+                    --range->nr_mappings;
+                }
+                else
+                {
+                    ppl = &pl->pl_next;
+                    pl = *ppl;
+                    mappings++;
                 }
             }
-
-            if ( dirty )
+        }
+        if (mappings > max_mappings)
+            max_mappings = mappings;
+        
+        if (unshadowed) {
+#if DEBUG_unshadow_sl1ma
+            gdprintk(XENLOG_DEBUG,
+                     "[%lx] gfn[%05lx:%05lx] unshadowed:%d mappings:0x%x max_mappings:%d\n",
+                     mfn_x(smfn),
+                     range->begin_pfn, range->end_pfn,
+                     unshadowed, range->nr_mappings, max_mappings);
+#endif
+            if ( range->nr_mappings == 0 )
             {
-                dirty_vram->dirty_bitmap[i / 8] |= 1 << (i % 8);
-                dirty_vram->last_dirty = NOW();
+                dirty_vram_range_free(d, range);                    
             }
         }
+    }
+ out:
+    return;
+}
+
+
+typedef int (*hash_pfn_callback_t)(struct vcpu *v,
+                                   mfn_t smfn,
+                                   unsigned long begin_pfn,
+                                   unsigned long end_pfn,
+                                   int *removed);
 
-        rc = -EFAULT;
-        if ( copy_to_guest(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size) == 0 ) {
-            memset(dirty_vram->dirty_bitmap, 0, dirty_size);
-            if (dirty_vram->last_dirty + SECONDS(2) < NOW())
+static int hash_pfn_foreach(struct vcpu *v, 
+                            unsigned int callback_mask, 
+                            hash_pfn_callback_t callbacks[], 
+                            unsigned long begin_pfn,
+                            unsigned long end_pfn)
+/* Walk the hash table looking at the types of the entries and 
+ * calling the appropriate callback function for each entry. 
+ * The mask determines which shadow types we call back for, and the array
+ * of callbacks tells us which function to call.
+ * Any callback may return non-zero to let us skip the rest of the scan. 
+ *
+ * WARNING: Callbacks MUST NOT add or remove hash entries unless they 
+ * then return non-zero to terminate the scan. */
+{
+    int i, done = 0, removed = 0;
+    struct domain *d = v->domain;
+    struct page_info *x;
+
+    /* Say we're here, to stop hash-lookups reordering the chains */
+    ASSERT(paging_locked_by_me(d));
+    ASSERT(d->arch.paging.shadow.hash_walking == 0);
+    d->arch.paging.shadow.hash_walking = 1;
+
+    for ( i = 0; i < SHADOW_HASH_BUCKETS; i++ ) 
+    {
+        /* WARNING: This is not safe against changes to the hash table.
+         * The callback *must* return non-zero if it has inserted or
+         * deleted anything from the hash (lookups are OK, though). */
+        for ( x = d->arch.paging.shadow.hash_table[i]; x; x = next_shadow(x) )
+        {
+            if ( callback_mask & (1 << x->u.sh.type) )
             {
-                /* was clean for more than two seconds, try to disable guest
-                 * write access */
-                for ( i = begin_pfn; i < end_pfn; i++ ) {
-                    mfn_t mfn = get_gfn_query_unlocked(d, i, &t);
-                    if (mfn_x(mfn) != INVALID_MFN)
-                        flush_tlb |= sh_remove_write_access(d->vcpu[0], mfn, 1, 0);
-                }
-                dirty_vram->last_dirty = -1;
+                ASSERT(x->u.sh.type <= 15);
+                ASSERT(callbacks[x->u.sh.type] != NULL);
+                done = callbacks[x->u.sh.type](v, page_to_mfn(x), 
+                                               begin_pfn, end_pfn,
+                                               &removed);
+                if ( done ) break;
             }
-            rc = 0;
         }
+        if ( done ) break; 
     }
-    if ( flush_tlb )
-        flush_tlb_mask(d->domain_dirty_cpumask);
-    goto out;
+    d->arch.paging.shadow.hash_walking = 0;
+    return removed;
+}
+
+void sh_find_all_vram_mappings(struct vcpu *v,
+                               dv_range_t *range)
+{
+    /* Dispatch table for getting per-type functions */
+    static hash_pfn_callback_t callbacks[SH_type_unused] = {
+        NULL, /* none    */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 2), /* l1_32   */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 2), /* fl1_32  */
+        NULL, /* l2_32   */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 3), /* l1_pae  */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 3), /* fl1_pae */
+        NULL, /* l2_pae  */
+        NULL, /* l2h_pae */
+#if CONFIG_PAGING_LEVELS >= 4
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 4), /* l1_64   */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 4), /* fl1_64  */
+#else
+        NULL, /* l1_64   */
+        NULL, /* fl1_64  */
+#endif
+        NULL, /* l2_64   */
+        NULL, /* l2h_64  */
+        NULL, /* l3_64   */
+        NULL, /* l4_64   */
+        NULL, /* p2m     */
+        NULL  /* unused  */
+    };
 
-out_sl1ma:
-    xfree(dirty_vram->sl1ma);
-out_dirty_vram:
-    xfree(dirty_vram);
-    dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
+    static unsigned int callback_mask = 
+          1 << SH_type_l1_32_shadow
+        | 1 << SH_type_fl1_32_shadow
+        | 1 << SH_type_l1_pae_shadow
+        | 1 << SH_type_fl1_pae_shadow
+        | 1 << SH_type_l1_64_shadow
+        | 1 << SH_type_fl1_64_shadow
+        ;
 
-out:
-    paging_unlock(d);
-    p2m_unlock(p2m_get_hostp2m(d));
-    return rc;
+    perfc_incr(shadow_mappings);
+
+    hash_pfn_foreach(v, callback_mask, callbacks,
+                     range->begin_pfn,
+                     range->end_pfn);
+
+#if DEBUG_count_initial_mappings
+    gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] count of initial mappings:%d\n",
+             range->begin_pfn, range->end_pfn,
+             range->nr_mappings);
+#endif
 }
 
 /**************************************************************************/
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 4967da1..bb983bc 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -35,6 +35,7 @@
 #include <asm/flushtlb.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/cacheattr.h>
+#include <asm/dirty_vram.h>
 #include <asm/mtrr.h>
 #include <asm/guest_pt.h>
 #include <public/sched.h>
@@ -149,6 +150,10 @@ delete_fl1_shadow_status(struct vcpu *v, gfn_t gfn, mfn_t smfn)
     SHADOW_PRINTK("gfn=%"SH_PRI_gfn", type=%08x, smfn=%05lx\n",
                    gfn_x(gfn), SH_type_fl1_shadow, mfn_x(smfn));
     ASSERT(mfn_to_page(smfn)->u.sh.head);
+
+    /* Removing any dv_paddr_links to the erstwhile shadow page */
+    dirty_vram_delete_shadow(v, gfn_x(gfn), SH_type_fl1_shadow, smfn);
+    
     shadow_hash_delete(v, gfn_x(gfn), SH_type_fl1_shadow, smfn);
 }
 
@@ -160,6 +165,10 @@ delete_shadow_status(struct vcpu *v, mfn_t gmfn, u32 shadow_type, mfn_t smfn)
                    v->domain->domain_id, v->vcpu_id,
                    mfn_x(gmfn), shadow_type, mfn_x(smfn));
     ASSERT(mfn_to_page(smfn)->u.sh.head);
+    
+    /* Removing any dv_paddr_links to the erstwhile shadow page */
+    dirty_vram_delete_shadow(v, mfn_x(gmfn), shadow_type, smfn);
+    
     shadow_hash_delete(v, mfn_x(gmfn), shadow_type, smfn);
     /* 32-on-64 PV guests don't own their l4 pages; see set_shadow_status */
     if ( !is_pv_32on64_vcpu(v) || shadow_type != SH_type_l4_64_shadow )
@@ -516,7 +525,6 @@ _sh_propagate(struct vcpu *v,
     guest_l1e_t guest_entry = { guest_intpte };
     shadow_l1e_t *sp = shadow_entry_ptr;
     struct domain *d = v->domain;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
     gfn_t target_gfn = guest_l1e_get_gfn(guest_entry);
     u32 pass_thru_flags;
     u32 gflags, sflags;
@@ -663,17 +671,6 @@ _sh_propagate(struct vcpu *v,
         }
     }
 
-    if ( unlikely((level == 1) && dirty_vram
-            && dirty_vram->last_dirty == -1
-            && gfn_x(target_gfn) >= dirty_vram->begin_pfn
-            && gfn_x(target_gfn) < dirty_vram->end_pfn) )
-    {
-        if ( ft & FETCH_TYPE_WRITE )
-            dirty_vram->last_dirty = NOW();
-        else
-            sflags &= ~_PAGE_RW;
-    }
-
     /* Read-only memory */
     if ( p2m_is_readonly(p2mt) ||
          (p2mt == p2m_mmio_direct &&
@@ -1072,101 +1069,60 @@ static int shadow_set_l2e(struct vcpu *v,
     return flags;
 }
 
-static inline void shadow_vram_get_l1e(shadow_l1e_t new_sl1e,
+/* shadow_vram_fix_l1e()
+ *
+ * Tests L1PTEs as they are modified, looking for when they start to (or
+ * cease to) point to frame buffer pages.  If the old and new gfns differ,
+ * calls dirty_vram_range_update() to updates the dirty_vram structures.
+ */
+static inline void shadow_vram_fix_l1e(shadow_l1e_t old_sl1e,
+                                       shadow_l1e_t new_sl1e,
                                        shadow_l1e_t *sl1e,
                                        mfn_t sl1mfn,
                                        struct domain *d)
 { 
-    mfn_t mfn = shadow_l1e_get_mfn(new_sl1e);
-    int flags = shadow_l1e_get_flags(new_sl1e);
-    unsigned long gfn;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    mfn_t new_mfn, old_mfn;
+    unsigned long new_gfn = INVALID_M2P_ENTRY, old_gfn = INVALID_M2P_ENTRY;
+    paddr_t sl1ma;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
 
-    if ( !dirty_vram         /* tracking disabled? */
-         || !(flags & _PAGE_RW) /* read-only mapping? */
-         || !mfn_valid(mfn) )   /* mfn can be invalid in mmio_direct */
+    if ( !dirty_vram )
         return;
 
-    gfn = mfn_to_gfn(d, mfn);
-    /* Page sharing not supported on shadow PTs */
-    BUG_ON(SHARED_M2P(gfn));
+    sl1ma = pfn_to_paddr(mfn_x(sl1mfn)) | ((unsigned long)sl1e & ~PAGE_MASK);
 
-    if ( (gfn >= dirty_vram->begin_pfn) && (gfn < dirty_vram->end_pfn) )
+    old_mfn = shadow_l1e_get_mfn(old_sl1e);
+
+    if ( !sh_l1e_is_magic(old_sl1e) &&
+         (l1e_get_flags(old_sl1e) & _PAGE_PRESENT) &&
+         mfn_valid(old_mfn))
     {
-        unsigned long i = gfn - dirty_vram->begin_pfn;
-        struct page_info *page = mfn_to_page(mfn);
-        
-        if ( (page->u.inuse.type_info & PGT_count_mask) == 1 )
-            /* Initial guest reference, record it */
-            dirty_vram->sl1ma[i] = pfn_to_paddr(mfn_x(sl1mfn))
-                | ((unsigned long)sl1e & ~PAGE_MASK);
+        old_gfn = mfn_to_gfn(d, old_mfn);
     }
-}
-
-static inline void shadow_vram_put_l1e(shadow_l1e_t old_sl1e,
-                                       shadow_l1e_t *sl1e,
-                                       mfn_t sl1mfn,
-                                       struct domain *d)
-{
-    mfn_t mfn = shadow_l1e_get_mfn(old_sl1e);
-    int flags = shadow_l1e_get_flags(old_sl1e);
-    unsigned long gfn;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram         /* tracking disabled? */
-         || !(flags & _PAGE_RW) /* read-only mapping? */
-         || !mfn_valid(mfn) )   /* mfn can be invalid in mmio_direct */
-        return;
-
-    gfn = mfn_to_gfn(d, mfn);
-    /* Page sharing not supported on shadow PTs */
-    BUG_ON(SHARED_M2P(gfn));
-
-    if ( (gfn >= dirty_vram->begin_pfn) && (gfn < dirty_vram->end_pfn) )
+    
+    new_mfn = shadow_l1e_get_mfn(new_sl1e);
+    if ( !sh_l1e_is_magic(new_sl1e) &&
+         (l1e_get_flags(new_sl1e) & _PAGE_PRESENT) &&
+         mfn_valid(new_mfn))
     {
-        unsigned long i = gfn - dirty_vram->begin_pfn;
-        struct page_info *page = mfn_to_page(mfn);
-        int dirty = 0;
-        paddr_t sl1ma = pfn_to_paddr(mfn_x(sl1mfn))
-            | ((unsigned long)sl1e & ~PAGE_MASK);
+        new_gfn = mfn_to_gfn(d, new_mfn);
+    }
 
-        if ( (page->u.inuse.type_info & PGT_count_mask) == 1 )
-        {
-            /* Last reference */
-            if ( dirty_vram->sl1ma[i] == INVALID_PADDR ) {
-                /* We didn't know it was that one, let's say it is dirty */
-                dirty = 1;
-            }
-            else
-            {
-                ASSERT(dirty_vram->sl1ma[i] == sl1ma);
-                dirty_vram->sl1ma[i] = INVALID_PADDR;
-                if ( flags & _PAGE_DIRTY )
-                    dirty = 1;
-            }
-        }
-        else
+    if ( old_gfn == new_gfn ) return;
+
+    if ( VALID_M2P(old_gfn) )
+        if ( dirty_vram_range_update(d, old_gfn, sl1ma, 0/*clear*/) )
         {
-            /* We had more than one reference, just consider the page dirty. */
-            dirty = 1;
-            /* Check that it's not the one we recorded. */
-            if ( dirty_vram->sl1ma[i] == sl1ma )
-            {
-                /* Too bad, we remembered the wrong one... */
-                dirty_vram->sl1ma[i] = INVALID_PADDR;
-            }
-            else
-            {
-                /* Ok, our recorded sl1e is still pointing to this page, let's
-                 * just hope it will remain. */
-            }
+            SHADOW_PRINTK("gfn %lx (mfn %lx) cleared vram pte\n",
+                          old_gfn, mfn_x(old_mfn));
         }
-        if ( dirty )
+
+    if ( VALID_M2P(new_gfn) )
+        if ( dirty_vram_range_update(d, new_gfn, sl1ma, 1/*set*/) )
         {
-            dirty_vram->dirty_bitmap[i / 8] |= 1 << (i % 8);
-            dirty_vram->last_dirty = NOW();
+            SHADOW_PRINTK("gfn %lx (mfn %lx) set vram pte\n",
+                          new_gfn, mfn_x(new_mfn));
         }
-    }
 }
 
 static int shadow_set_l1e(struct vcpu *v, 
@@ -1211,12 +1167,13 @@ static int shadow_set_l1e(struct vcpu *v,
                 shadow_l1e_remove_flags(new_sl1e, _PAGE_RW);
                 /* fall through */
             case 0:
-                shadow_vram_get_l1e(new_sl1e, sl1e, sl1mfn, d);
                 break;
             }
         }
     } 
 
+    shadow_vram_fix_l1e(old_sl1e, new_sl1e, sl1e, sl1mfn, d);
+
     /* Write the new entry */
     shadow_write_entries(sl1e, &new_sl1e, 1, sl1mfn);
     flags |= SHADOW_SET_CHANGED;
@@ -1231,7 +1188,6 @@ static int shadow_set_l1e(struct vcpu *v,
          * trigger a flush later. */
         if ( shadow_mode_refcounts(d) ) 
         {
-            shadow_vram_put_l1e(old_sl1e, sl1e, sl1mfn, d);
             shadow_put_page_from_l1e(old_sl1e, d);
             TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_SHADOW_L1_PUT_REF);
         } 
@@ -2018,7 +1974,6 @@ void sh_destroy_l1_shadow(struct vcpu *v, mfn_t smfn)
         SHADOW_FOREACH_L1E(sl1mfn, sl1e, 0, 0, {
             if ( (shadow_l1e_get_flags(*sl1e) & _PAGE_PRESENT)
                  && !sh_l1e_is_magic(*sl1e) ) {
-                shadow_vram_put_l1e(*sl1e, sl1e, sl1mfn, d);
                 shadow_put_page_from_l1e(*sl1e, d);
             }
         });
@@ -4336,6 +4291,37 @@ int sh_rm_mappings_from_l1(struct vcpu *v, mfn_t sl1mfn, mfn_t target_mfn)
     return done;
 }
 
+
+int sh_find_vram_mappings_in_l1(struct vcpu *v,
+                                mfn_t sl1mfn,
+                                unsigned long begin_pfn,
+                                unsigned long end_pfn,
+                                int *removed)
+/* Find all VRAM mappings in this shadow l1 table */
+{
+    struct domain *d = v->domain;
+    shadow_l1e_t *sl1e;
+    int done = 0;
+
+    /* only returns _PAGE_PRESENT entries */
+    SHADOW_FOREACH_L1E(sl1mfn, sl1e, 0, done, 
+    {
+        unsigned long gfn;
+        mfn_t gmfn = shadow_l1e_get_mfn(*sl1e);
+        if ( !mfn_valid(gmfn) )
+            continue;
+        gfn = mfn_to_gfn(d, gmfn);
+        if ( VALID_M2P(gfn) && (begin_pfn <= gfn) && (gfn < end_pfn) ) 
+        {
+            paddr_t sl1ma =
+                pfn_to_paddr(mfn_x(sl1mfn)) |
+                ( (unsigned long)sl1e & ~PAGE_MASK );
+            dirty_vram_range_update(v->domain, gfn, sl1ma, 1/*set*/);
+        }
+    });
+    return 0;
+}
+
 /**************************************************************************/
 /* Functions to excise all pointers to shadows from higher-level shadows. */
 
diff --git a/xen/arch/x86/mm/shadow/multi.h b/xen/arch/x86/mm/shadow/multi.h
index 835121e..436a4ac 100644
--- a/xen/arch/x86/mm/shadow/multi.h
+++ b/xen/arch/x86/mm/shadow/multi.h
@@ -66,7 +66,12 @@ SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, GUEST_LEVELS)
 extern int
 SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, GUEST_LEVELS)
     (struct vcpu *v, mfn_t sl1mfn, mfn_t target_mfn);
-
+extern int
+SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, GUEST_LEVELS)
+     (struct vcpu *v, mfn_t sl1mfn, 
+      unsigned long begin_pfn,
+      unsigned long end_pfn,
+      int *removed);
 extern void
 SHADOW_INTERNAL_NAME(sh_clear_shadow_entry, GUEST_LEVELS)
     (struct vcpu *v, void *ep, mfn_t smfn);
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index 43ce1db..5b0f9f7 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -229,6 +229,7 @@ static inline shadow_l4e_t shadow_l4e_from_mfn(mfn_t mfn, u32 flags)
 #define sh_update_cr3              INTERNAL_NAME(sh_update_cr3)
 #define sh_rm_write_access_from_l1 INTERNAL_NAME(sh_rm_write_access_from_l1)
 #define sh_rm_mappings_from_l1     INTERNAL_NAME(sh_rm_mappings_from_l1)
+#define sh_find_vram_mappings_in_l1 INTERNAL_NAME(sh_find_vram_mappings_in_l1)
 #define sh_remove_l1_shadow        INTERNAL_NAME(sh_remove_l1_shadow)
 #define sh_remove_l2_shadow        INTERNAL_NAME(sh_remove_l2_shadow)
 #define sh_remove_l3_shadow        INTERNAL_NAME(sh_remove_l3_shadow)
diff --git a/xen/include/asm-x86/dirty_vram.h b/xen/include/asm-x86/dirty_vram.h
new file mode 100644
index 0000000..b107d0e
--- /dev/null
+++ b/xen/include/asm-x86/dirty_vram.h
@@ -0,0 +1,202 @@
+/****************************************************************************
+ * include/asm-x86/dirty_vram.h
+ *
+ * Interface for tracking dirty VRAM pages
+ *
+ * Copyright (c) 2012 Citrix Systems, Inc. (Robert Phillips)
+ * Parts of this code are Copyright (c) 2007 Advanced Micro Devices (Wei Huang)
+ * Parts of this code are Copyright (c) 2006 by XenSource Inc.
+ * Parts of this code are Copyright (c) 2006 by Michael A Fetterman
+ * Parts based on earlier work by Michael A Fetterman, Ian Pratt et al.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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
+ */
+
+#ifndef _DIRTY_VRAM_H
+#define _DIRTY_VRAM_H
+
+/*
+ * In shadow mode we need to bookkeep all the L1 page table entries that
+ * map a frame buffer page.  Struct dv_paddr_link does this by
+ * recording the address of a L1 page table entry for some frame buffer page.
+ * Also has a link to additional pl entries if the frame buffer page
+ * has multiple mappings.
+ * In practice very few pages have multiple mappings.
+ * But to rule out some pathological situation, we limit the number of
+ * mappings we're willing to bookkeep.
+ */
+
+#define DV_ADDR_LINK_LIST_LIMIT 20
+
+typedef struct dv_paddr_link {
+    paddr_t sl1ma;
+    struct dv_paddr_link *pl_next;
+} dv_paddr_link_t;
+
+typedef struct dv_pl_entry {
+    dv_paddr_link_t mapping;
+    bool_t stuck_dirty;
+} dv_pl_entry_t;
+
+/*
+ * This defines an extension page of pl entries for FB pages with multiple
+ * mappings. All such pages (of a domain) are linked together.
+ */
+typedef struct dv_paddr_link_ext {
+    struct list_head ext_link;
+    dv_paddr_link_t entries[ ( PAGE_SIZE - sizeof( struct list_head ) ) /
+                             sizeof( dv_paddr_link_t ) ];
+} dv_paddr_link_ext_t;
+
+/*
+ * This defines a single frame buffer range.  It bookkeeps all the
+ * level 1 PTEs that map guest pages within that range.
+ * All such ranges (of a domain) are linked together.
+ */
+typedef struct dv_range {
+    struct list_head range_link; /* the several ranges form a linked list */
+    unsigned long begin_pfn;
+    unsigned long end_pfn;
+    dv_pl_entry_t *pl_tab; /* table has 1 pl entry per pfn in range */
+    int nr_mappings;  /* total number of mappings in this range */
+    int mappings_hwm; /* high water mark of max mapping count */
+    unsigned int dirty_count;
+} dv_range_t;
+
+/*
+ * This contains all the data structures required by a domain to
+ * bookkeep the dirty pages within its frame buffers.
+ */
+typedef struct dv_dirty_vram {
+    struct list_head range_head; /* head of the linked list of ranges */
+    struct list_head ext_head; /* head of list of extension pages */
+    dv_paddr_link_t *pl_free; /* free list of pl's within extension pages */
+    int nr_ranges; /* bookkeeps number of ranges */
+    int ranges_hwm; /* high water mark of max number of ranges */
+} dv_dirty_vram_t;
+
+/* Allocates domain's dirty_vram structure */
+dv_dirty_vram_t *
+dirty_vram_alloc(struct domain *d);
+
+/*
+ * Returns domain's dirty_vram structure,
+ * allocating it if necessary
+ */
+dv_dirty_vram_t *
+dirty_vram_find_or_alloc(struct domain *d);
+
+/* Frees domain's dirty_vram structure */
+void dirty_vram_free(struct domain *d);
+
+/* Returns dirty vram range containing gfn, NULL if none */
+struct dv_range *
+dirty_vram_range_find_gfn(struct domain *d,
+                          unsigned long gfn);
+
+/*
+ * Returns dirty vram range matching [ begin_pfn .. begin_pfn+nr ),
+ * NULL if none
+ */
+dv_range_t *
+dirty_vram_range_find(struct domain *d,
+                      unsigned long begin_pfn,
+                      unsigned long nr);
+
+/*
+ * Allocate dirty vram range containing [ begin_pfn .. begin_pfn+nr ),
+ * freeing any existing range that overlaps the new range.
+ */
+dv_range_t *
+dirty_vram_range_alloc(struct domain *d,
+                       unsigned long begin_pfn,
+                       unsigned long nr);
+
+/*
+ * Returns dirty vram range matching [ begin_pfn .. begin_pfn+nr ),
+ * creating a range if none already exists and
+ * freeing any existing range that overlaps the new range.
+ */
+dv_range_t *
+dirty_vram_range_find_or_alloc(struct domain *d,
+                               unsigned long begin_pfn,
+                               unsigned long nr);
+
+void dirty_vram_range_free(struct domain *d,
+                           dv_range_t *range);
+
+/* Bookkeep PTE address of a frame buffer page */
+int dirty_vram_range_update(struct domain *d,
+                            unsigned long gfn,
+                            paddr_t sl1ma,
+                            int set);
+
+/*
+ * smfn is no longer a shadow page.  Remove it from any
+ * dirty vram range mapping.
+ */
+void
+dirty_vram_delete_shadow(struct vcpu *v,
+                         unsigned long gfn,
+                         unsigned int shadow_type,
+                         mfn_t smfn);
+
+
+/*
+ * Scan all the L1 tables looking for VRAM mappings.
+ * Record them in the domain's dv_dirty_vram structure
+ */
+void sh_find_all_vram_mappings(struct vcpu *v,
+                               dv_range_t *range);
+
+/*
+ * Free a paddr_link struct, given address of its
+ * predecessor in singly-linked list
+ */
+dv_paddr_link_t *
+free_paddr_link(struct domain *d,
+                dv_paddr_link_t **ppl,
+                dv_paddr_link_t *pl);
+
+
+/* Enable VRAM dirty tracking. */
+int
+shadow_track_dirty_vram(struct domain *d,
+			unsigned long first_pfn,
+			unsigned long nr,
+			XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+
+int
+hap_track_dirty_vram(struct domain *d,
+		     unsigned long begin_pfn,
+		     unsigned long nr,
+		     XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+
+void
+hap_clean_vram_tracking_range(struct domain *d,
+			      unsigned long begin_pfn,
+			      unsigned long nr,
+			      uint8_t *dirty_bitmap);
+
+#endif /* _DIRTY_VRAM_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-x86/hap.h b/xen/include/asm-x86/hap.h
index 916a35b..3e3a1f5 100644
--- a/xen/include/asm-x86/hap.h
+++ b/xen/include/asm-x86/hap.h
@@ -57,10 +57,6 @@ void  hap_final_teardown(struct domain *d);
 void  hap_teardown(struct domain *d);
 void  hap_vcpu_init(struct vcpu *v);
 void  hap_logdirty_init(struct domain *d);
-int   hap_track_dirty_vram(struct domain *d,
-                           unsigned long begin_pfn,
-                           unsigned long nr,
-                           XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
 
 extern const struct paging_mode *hap_paging_get_mode(struct vcpu *);
 
diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h
index 27b3de5..6146542 100644
--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -74,7 +74,7 @@ struct hvm_domain {
     struct list_head       pinned_cacheattr_ranges;
 
     /* VRAM dirty support. */
-    struct sh_dirty_vram *dirty_vram;
+    struct dv_dirty_vram * dirty_vram;
 
     /* If one of vcpus of this domain is in no_fill_mode or
      * mtrr/pat between vcpus is not the same, set is_in_uc_mode
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 9a40f2c..e7d4cb3 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -137,10 +137,10 @@ struct paging_mode {
 void paging_free_log_dirty_bitmap(struct domain *d);
 
 /* get the dirty bitmap for a specific range of pfns */
-int paging_log_dirty_range(struct domain *d,
-                           unsigned long begin_pfn,
-                           unsigned long nr,
-                           XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+void paging_log_dirty_range(struct domain *d,
+                            unsigned long begin_pfn,
+                            unsigned long nr,
+                            uint8_t *dirty_bitmap);
 
 /* enable log dirty */
 int paging_log_dirty_enable(struct domain *d);
@@ -154,9 +154,13 @@ void paging_log_dirty_init(struct domain *d,
                            int  (*disable_log_dirty)(struct domain *d),
                            void (*clean_dirty_bitmap)(struct domain *d));
 
-/* mark a page as dirty */
+/* mark a page as dirty, a wrapper around mark a page as dirty */
 void paging_mark_dirty(struct domain *d, unsigned long guest_mfn);
 
+/* mark a page as dirty */
+void paging_mark_dirty_gpfn(struct domain *d, unsigned long gpfn);
+
+
 /* is this guest page dirty? 
  * This is called from inside paging code, with the paging lock held. */
 int paging_mfn_is_dirty(struct domain *d, mfn_t gmfn);
@@ -183,15 +187,6 @@ int paging_mfn_is_dirty(struct domain *d, mfn_t gmfn);
 #define L4_LOGDIRTY_IDX(pfn) 0
 #endif
 
-/* VRAM dirty tracking support */
-struct sh_dirty_vram {
-    unsigned long begin_pfn;
-    unsigned long end_pfn;
-    paddr_t *sl1ma;
-    uint8_t *dirty_bitmap;
-    s_time_t last_dirty;
-};
-
 /*****************************************************************************
  * Entry points into the paging-assistance code */
 
diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
index 2eb6efc..940d7fd 100644
--- a/xen/include/asm-x86/shadow.h
+++ b/xen/include/asm-x86/shadow.h
@@ -62,12 +62,6 @@ void shadow_vcpu_init(struct vcpu *v);
 /* Enable an arbitrary shadow mode.  Call once at domain creation. */
 int shadow_enable(struct domain *d, u32 mode);
 
-/* Enable VRAM dirty bit tracking. */
-int shadow_track_dirty_vram(struct domain *d,
-                            unsigned long first_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
-
 /* Handler for shadow control ops: operations from user-space to enable
  * and disable ephemeral shadow modes (test mode and log-dirty mode) and
  * manipulate the log-dirty bitmap. */
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:53:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:53:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdNTd-0003mL-Rp; Tue, 27 Nov 2012 15:53:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <robert.phillips@citrix.com>) id 1TdNTc-0003mG-MS
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:53:37 +0000
Received: from [85.158.143.35:19053] by server-2.bemta-4.messagelabs.com id
	DA/33-28922-002E4B05; Tue, 27 Nov 2012 15:53:36 +0000
X-Env-Sender: robert.phillips@citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1354031601!13860350!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ3Mzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28174 invoked from network); 27 Nov 2012 15:53:26 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 15:53:26 -0000
X-SBRS: None
X-MesageID: 45758669
X-Ironport-Server: ftlpip01.citrite.net
X-Remote-IP: 75.150.106.249
X-Policy: $Relay
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="45758669"
Received: from 75-150-106-249-newengland.hfc.comcastbusiness.net (HELO
	paine.oldroadcomputing.net) ([75.150.106.249])
	by SMTP.CITRIX.COM with ESMTP; 27 Nov 2012 15:53:19 +0000
From: Robert Phillips <robert.phillips@citrix.com>
To: xen-devel@lists.xen.org
Date: Tue, 27 Nov 2012 10:52:55 -0500
Message-Id: <1354031575-11897-1-git-send-email-robert.phillips@citrix.com>
X-Mailer: git-send-email 1.7.9.5
Cc: Robert Phillips <robert.phillips@citrix.com>
Subject: [Xen-devel] [PATCH] Provide support for multiple frame buffers in
	Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Support is provided for both shadow and hardware assisted paging (HAP) modes.
This code bookkeeps the set of video frame buffers (vram),
detects when the guest has modified any of those buffers and, upon request,
returns a bitmap of the modified pages.
This lets other software components re-paint the portions of the monitor (or monitors) that have changed.
Each monitor has a frame buffer of some size at some position in guest physical memory.
The set of frame buffers being tracked can change over time as monitors are plugged and unplugged.
(Version 4 of this patch.)

Signed-Off-By: Robert Phillips <robert.phillips@citrix.com>
---
 tools/libxc/xenctrl.h            |   17 +-
 xen/arch/x86/hvm/hvm.c           |    9 +-
 xen/arch/x86/mm/Makefile         |    1 +
 xen/arch/x86/mm/dirty_vram.c     | 1000 ++++++++++++++++++++++++++++++++++++++
 xen/arch/x86/mm/hap/hap.c        |  140 +-----
 xen/arch/x86/mm/paging.c         |  222 +++------
 xen/arch/x86/mm/shadow/common.c  |  334 +++++++------
 xen/arch/x86/mm/shadow/multi.c   |  174 +++----
 xen/arch/x86/mm/shadow/multi.h   |    7 +-
 xen/arch/x86/mm/shadow/types.h   |    1 +
 xen/include/asm-x86/dirty_vram.h |  202 ++++++++
 xen/include/asm-x86/hap.h        |    4 -
 xen/include/asm-x86/hvm/domain.h |    2 +-
 xen/include/asm-x86/paging.h     |   23 +-
 xen/include/asm-x86/shadow.h     |    6 -
 15 files changed, 1574 insertions(+), 568 deletions(-)
 create mode 100644 xen/arch/x86/mm/dirty_vram.c
 create mode 100644 xen/include/asm-x86/dirty_vram.h

diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..693d7fe 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -1552,15 +1552,20 @@ int xc_hvm_inject_msi(
     xc_interface *xch, domid_t dom, uint64_t addr, uint32_t data);
 
 /*
- * Track dirty bit changes in the VRAM area
+ * Track dirty bit changes in a VRAM region defined by
+ * [ first_pfn : first_pfn + nr - 1 ]
  *
  * All of this is done atomically:
- * - get the dirty bitmap since the last call
- * - set up dirty tracking area for period up to the next call
- * - clear the dirty tracking area.
+ * - gets the dirty bitmap since the last call, all zeroes for
+ *   the first call with some new region
+ * - sets up a dirty tracking region for period up to the next call
+ * - clears the specified dirty tracking region.
  *
- * Returns -ENODATA and does not fill bitmap if the area has changed since the
- * last call.
+ * Creating a new region causes any existing regions that it overlaps
+ * to be discarded.
+ *
+ * Specifying nr == 0 causes all regions to be discarded and
+ * disables dirty bit tracking.
  */
 int xc_hvm_track_dirty_vram(
     xc_interface *xch, domid_t dom,
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 34da2f5..4c4d438 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -57,6 +57,7 @@
 #include <asm/hvm/cacheattr.h>
 #include <asm/hvm/trace.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/dirty_vram.h>
 #include <asm/mtrr.h>
 #include <asm/apic.h>
 #include <public/sched.h>
@@ -66,6 +67,7 @@
 #include <asm/mem_event.h>
 #include <asm/mem_access.h>
 #include <public/mem_event.h>
+#include "../mm/mm-locks.h"
 
 bool_t __read_mostly hvm_enabled;
 
@@ -1433,8 +1435,11 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
          */
         if ( access_w )
         {
-            paging_mark_dirty(v->domain, mfn_x(mfn));
-            p2m_change_type(v->domain, gfn, p2m_ram_logdirty, p2m_ram_rw);
+            if ( p2m_change_type(v->domain, gfn, p2m_ram_logdirty,
+                                 p2m_ram_rw) == p2m_ram_logdirty )
+            {
+                paging_mark_dirty_gpfn(v->domain, gfn);
+            }
         }
         rc = 1;
         goto out_put_gfn;
diff --git a/xen/arch/x86/mm/Makefile b/xen/arch/x86/mm/Makefile
index 73dcdf4..becd0c9 100644
--- a/xen/arch/x86/mm/Makefile
+++ b/xen/arch/x86/mm/Makefile
@@ -5,6 +5,7 @@ obj-y += paging.o
 obj-y += p2m.o p2m-pt.o p2m-ept.o p2m-pod.o
 obj-y += guest_walk_2.o
 obj-y += guest_walk_3.o
+obj-y += dirty_vram.o
 obj-$(x86_64) += guest_walk_4.o
 obj-$(x86_64) += mem_event.o
 obj-$(x86_64) += mem_paging.o
diff --git a/xen/arch/x86/mm/dirty_vram.c b/xen/arch/x86/mm/dirty_vram.c
new file mode 100644
index 0000000..32fcc13
--- /dev/null
+++ b/xen/arch/x86/mm/dirty_vram.c
@@ -0,0 +1,1000 @@
+/*
+ * arch/x86/mm/dirty_vram.c: Bookkeep/query dirty VRAM pages
+ * with support for multiple frame buffers.
+ *
+ * Copyright (c) 2012, Citrix Systems, Inc. (Robert Phillips)
+ * Parts of this code are Copyright (c) 2007 Advanced Micro Devices (Wei Huang)
+ * Parts of this code are Copyright (c) 2007 XenSource Inc.
+ * Parts of this code are Copyright (c) 2006 by Michael A Fetterman
+ * Parts based on earlier work by Michael A Fetterman, Ian Pratt et al.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+
+#include <xen/types.h>
+#include <xen/sched.h>
+#include <xen/guest_access.h>
+#include <asm/shadow.h>
+#include <asm/dirty_vram.h>
+#include "mm-locks.h"
+
+#define DEBUG_stop_tracking_all_vram          0
+#define DEBUG_allocating_dirty_vram_range     0
+#define DEBUG_high_water_mark_for_vram_ranges 0
+#define DEBUG_freeing_dirty_vram_range        0
+#define DEBUG_allocate_paddr_links_page       0
+#define DEBUG_update_vram_mapping             0
+#define DEBUG_alloc_paddr_inject_fault        0
+
+/* Allocates domain's dirty_vram structure */
+dv_dirty_vram_t *
+dirty_vram_alloc(struct domain *d)
+{
+    dv_dirty_vram_t *dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    dirty_vram = d->arch.hvm_domain.dirty_vram = xzalloc(dv_dirty_vram_t);
+    if ( dirty_vram )
+    {
+        INIT_LIST_HEAD(&dirty_vram->range_head);
+        INIT_LIST_HEAD(&dirty_vram->ext_head);
+    }
+    return dirty_vram;
+}
+
+/*
+ * Returns domain's dirty_vram structure,
+ * allocating it if necessary
+ */
+dv_dirty_vram_t *
+dirty_vram_find_or_alloc(struct domain *d)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( !dirty_vram )
+        dirty_vram = dirty_vram_alloc(d);
+    return dirty_vram;
+}
+
+
+/* Free domain's dirty_vram structure */
+void dirty_vram_free(struct domain *d)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        struct list_head *curr, *next;
+        /* Free all the ranges */
+        list_for_each_safe(curr, next, &dirty_vram->range_head)
+        {
+            dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+#if DEBUG_stop_tracking_all_vram
+            gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] stop tracking all vram\n",
+                     range->begin_pfn, range->end_pfn);
+#endif
+            xfree(range->pl_tab);
+            xfree(range);
+        }
+        /* Free all the extension pages */
+        list_for_each_safe(curr, next, &dirty_vram->ext_head)
+        {
+            struct dv_paddr_link_ext *ext =
+                container_of(
+                    curr, struct dv_paddr_link_ext, ext_link);
+            struct page_info *pg = __virt_to_page(ext);
+            d->arch.paging.free_page(d, pg);
+        }
+
+        xfree(dirty_vram);
+        d->arch.hvm_domain.dirty_vram = NULL;
+    }
+}
+
+/* Returns dirty vram range containing gfn, NULL if none */
+struct dv_range *
+dirty_vram_range_find_gfn(struct domain *d,
+                          unsigned long gfn)
+{
+    struct dv_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        struct list_head *curr;
+        list_for_each(curr, &dirty_vram->range_head)
+        {
+            dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+            if ( gfn >= range->begin_pfn &&
+                 gfn <  range->end_pfn )
+                return range;
+        }
+    }
+    return NULL;
+}
+
+/*
+ * Returns pointer to dirty vram range matching [begin_pfn .. end_pfn ),
+ * NULL if none.
+ */
+dv_range_t *
+dirty_vram_range_find(struct domain *d,
+                      unsigned long begin_pfn,
+                      unsigned long nr)
+{
+    unsigned long end_pfn = begin_pfn + nr;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        struct list_head *curr;
+        list_for_each(curr, &dirty_vram->range_head)
+        {
+            dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+            if ( begin_pfn == range->begin_pfn &&
+                 end_pfn   == range->end_pfn )
+                return range;
+        }
+    }
+    return NULL;
+}
+
+/* Allocate specified dirty_vram range */
+static dv_range_t *
+_dirty_vram_range_alloc(struct domain *d,
+                        unsigned long begin_pfn,
+                        unsigned long nr)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_range_t *range = NULL;
+    unsigned long end_pfn = begin_pfn + nr;
+    dv_pl_entry_t *pl_tab = NULL;
+    int i;
+
+    ASSERT( paging_locked_by_me(d) );
+    ASSERT( dirty_vram != NULL );
+
+#if DEBUG_allocating_dirty_vram_range
+    gdprintk(XENLOG_DEBUG,
+             "[%05lx:%05lx] Allocating dirty vram range hap:%d\n",
+             begin_pfn, end_pfn,
+             d->arch.hvm_domain.hap_enabled);
+#endif
+
+    range = xzalloc(dv_range_t);
+    if ( range == NULL )
+        goto err_out;
+
+    INIT_LIST_HEAD(&range->range_link);
+
+    range->begin_pfn = begin_pfn;
+    range->end_pfn = end_pfn;
+
+    if ( !hap_enabled(d) )
+    {
+        if ( (pl_tab = xzalloc_array(dv_pl_entry_t, nr)) == NULL )
+            goto err_out;
+
+        for ( i = 0; i != nr; i++ )
+        {
+            pl_tab[i].mapping.sl1ma = INVALID_PADDR;
+        }
+    }
+
+    range->pl_tab = pl_tab;
+    range->mappings_hwm = 1;
+
+    list_add(&range->range_link, &dirty_vram->range_head);
+    if ( ++dirty_vram->nr_ranges > dirty_vram->ranges_hwm )
+    {
+        dirty_vram->ranges_hwm = dirty_vram->nr_ranges;
+#if DEBUG_high_water_mark_for_vram_ranges
+        gdprintk(XENLOG_DEBUG,
+                 "High water mark for number of vram ranges is now:%d\n",
+                 dirty_vram->ranges_hwm);
+#endif
+    }
+    return range;
+
+ err_out:
+    xfree(pl_tab);
+    xfree(range);
+    return NULL;
+}
+
+
+/* Frees specified dirty_vram range */
+void dirty_vram_range_free(struct domain *d,
+                           dv_range_t *range)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    ASSERT( paging_locked_by_me(d) );
+    if ( dirty_vram )
+    {
+        int i, nr = range->end_pfn - range->begin_pfn;
+
+#if DEBUG_freeing_dirty_vram_range
+        gdprintk(XENLOG_DEBUG,
+                 "[%05lx:%05lx] Freeing dirty vram range\n",
+                 range->begin_pfn, range->end_pfn);
+#endif
+
+        if ( range->pl_tab )
+        {
+            for ( i = 0; i != nr; i++ )
+            {
+                dv_paddr_link_t *plx;
+                plx = range->pl_tab[i].mapping.pl_next;
+                /* Does current FB page have multiple mappings? */
+                if ( plx ) /* yes */
+                {
+                    /* Find the last element in singly-linked list */
+                    while ( plx->pl_next != NULL )
+                        plx = plx->pl_next;
+                    
+                    /* Prepend whole list to the free list */
+                    plx->pl_next = dirty_vram->pl_free;
+                    dirty_vram->pl_free = range->pl_tab[i].mapping.pl_next;
+                }
+            }
+            xfree(range->pl_tab);
+            range->pl_tab = NULL;
+        }
+
+        /* Remove range from the linked list, free it, and adjust count*/
+        list_del(&range->range_link);
+        xfree(range);
+        dirty_vram->nr_ranges--;
+    }
+}
+
+/*
+ * dirty_vram_range_alloc()
+ * This function ensures that the new range does not overlap any existing
+ * ranges -- deleting them if necessary -- and then calls
+ * _dirty_vram_range_alloc to actually allocate the new range.
+ */
+dv_range_t *
+dirty_vram_range_alloc(struct domain *d,
+                        unsigned long begin_pfn,
+                        unsigned long nr)
+{
+    unsigned long end_pfn = begin_pfn + nr;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_range_t *range;
+    struct list_head *curr, *next;
+
+    ASSERT( paging_locked_by_me(d) );
+    ASSERT( dirty_vram != NULL );
+
+    /*
+     * Ranges cannot overlap so
+     * free any range that overlaps [ begin_pfn .. end_pfn )
+     */
+    list_for_each_safe(curr, next, &dirty_vram->range_head)
+    {
+        dv_range_t *rng = list_entry(curr, dv_range_t, range_link);
+        if ( ( ( rng->begin_pfn <= begin_pfn ) &&
+               ( begin_pfn <  rng->end_pfn   )
+                 ) ||
+             ( ( begin_pfn <= rng->begin_pfn ) &&
+               ( rng->begin_pfn < end_pfn    )
+                 ) )
+        {
+            /* Different tracking, tear the previous down. */
+            dirty_vram_range_free(d, rng);
+        }
+    }
+
+    range = _dirty_vram_range_alloc(d, begin_pfn, nr);
+    if ( !range )
+        goto out;
+
+ out:
+    return range;
+}
+
+/*
+ * dirty_vram_range_find_or_alloc()
+ * Find the range for [begin_pfn:begin_pfn+nr).
+ * If it doesn't exists, create it.
+ */
+dv_range_t *
+dirty_vram_range_find_or_alloc(struct domain *d,
+                                unsigned long begin_pfn,
+                                unsigned long nr)
+{
+    dv_range_t *range;
+    ASSERT( paging_locked_by_me(d) );
+    range = dirty_vram_range_find(d, begin_pfn, nr);
+    if ( !range )
+        range = dirty_vram_range_alloc(d, begin_pfn, nr);
+    
+    return range;
+}
+
+
+
+/* Allocate a dv_paddr_link struct */
+static dv_paddr_link_t *
+alloc_paddr_link(struct domain *d)
+{
+    dv_paddr_link_t * pl = NULL;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+
+    ASSERT( paging_locked_by_me(d) );
+    BUILD_BUG_ON(sizeof(dv_paddr_link_ext_t) > PAGE_SIZE);
+    /* Is the list of free pl's empty? */
+    if ( dirty_vram->pl_free == NULL ) /* yes */
+    {
+        /*
+         * Allocate another page of pl's.
+         * Link them all together and point the free list head at them
+         */
+        int i;
+        struct page_info *pg = d->arch.paging.alloc_page(d);
+        dv_paddr_link_ext_t *ext = __page_to_virt(pg);
+        if ( ext == NULL )
+            goto out;
+
+#if DEBUG_allocate_paddr_links_page
+        gdprintk(XENLOG_DEBUG, "Allocated another page of paddr_links\n");
+#endif
+        list_add(&ext->ext_link, &dirty_vram->ext_head);
+
+        /* initialize and link together the new pl entries */
+        for ( i = 0; i != ARRAY_SIZE(ext->entries); i++ )
+        {
+            ext->entries[i].sl1ma = INVALID_PADDR;
+            ext->entries[i].pl_next = &ext->entries[i+1];
+        }
+        ext->entries[ARRAY_SIZE(ext->entries) - 1].pl_next = NULL;
+        dirty_vram->pl_free = &ext->entries[0];
+    }
+    pl = dirty_vram->pl_free;
+    dirty_vram->pl_free = pl->pl_next;
+
+    pl->sl1ma = INVALID_PADDR;
+    pl->pl_next = NULL;
+ out:
+    return pl;
+}
+
+
+/*
+ * Free a paddr_link struct.
+ *
+ * The caller has walked the singly-linked list of elements
+ * that have, as their head, an element in a pl_tab cell.
+ * The list walks has reached the element to be freed.
+ * (Each element is a dv_paddr_link_t struct.)
+ *
+ * @pl points to the element to be freed.
+ * @ppl points to its predecessor element's next member.
+ *
+ * After linking the precessor to the element's successor,
+ * we can free @pl by prepending it to the list of free
+ * elements.
+ *
+ * As a boundary case (which happens to be the common case),
+ * @pl points to a cell in the pl_tab rather than to some
+ * extension element danging from that cell.
+ * We recognize this case because @ppl is NULL.
+ * In that case we promote the first extension element by
+ * copying it into the pl_tab cell and free it.
+ */
+
+dv_paddr_link_t *
+free_paddr_link(struct domain *d,
+                dv_paddr_link_t **ppl,
+                dv_paddr_link_t *pl)
+{
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_paddr_link_t *npl; /* next pl */
+
+    ASSERT( paging_locked_by_me(d) );
+    /* extension mapping? */
+    if ( ppl ) /* yes. free it */
+    {
+        ASSERT(pl == (*ppl));
+        (*ppl) = npl = pl->pl_next;
+    }
+    else  /* main table */
+    {
+        /*
+         * move 2nd mapping to main table.
+         * and free 2nd mapping
+         */
+        dv_paddr_link_t * spl;
+        spl = pl->pl_next;
+        if ( spl == NULL )
+        {
+            pl->sl1ma = INVALID_PADDR;
+            return pl;
+        }
+        pl->sl1ma = spl->sl1ma;
+        pl->pl_next = spl->pl_next;
+        npl = pl; /* reprocess main table entry again */
+        pl = spl;
+    }
+    pl->sl1ma = INVALID_PADDR;
+    pl->pl_next = dirty_vram->pl_free;
+    dirty_vram->pl_free = pl;
+    return npl;
+}
+
+
+/*
+ * dirty_vram_range_update()
+ *
+ * This is called whenever a level 1 page table entry is modified.
+ * If the L1PTE is being cleared, the function removes any paddr_links
+ * that refer to it.
+ * If the L1PTE is being set to a frame buffer page, a paddr_link is
+ * created for that page's entry in pl_tab.
+ * Returns 1 iff entry found and set or cleared.
+ */
+int dirty_vram_range_update(struct domain *d,
+                            unsigned long gfn,
+                            paddr_t sl1ma,
+                            int set)
+{
+    int effective = 0;
+    dv_range_t *range;
+    unsigned long i;
+    dv_paddr_link_t *pl;
+    dv_paddr_link_t **ppl;
+    int len = 0;
+
+    ASSERT(paging_locked_by_me(d));
+    range = dirty_vram_range_find_gfn(d, gfn);
+    if ( !range )
+        return effective;
+
+    
+    i = gfn - range->begin_pfn;
+    pl = &range->pl_tab[ i ].mapping;
+    ppl = NULL;
+
+    /*
+     * find matching entry (pl), if any, and its predecessor
+     * in linked list (ppl)
+     */
+    while ( pl != NULL )
+    {
+        if ( pl->sl1ma == sl1ma || pl->sl1ma == INVALID_PADDR )
+            break;
+            
+        ppl = &pl->pl_next;
+        pl = *ppl;
+        len++;
+    }
+
+    if ( set )
+    {
+        /* Did we find sl1ma in either the main table or the linked list? */
+        if ( pl == NULL ) /* no, so we'll need to alloc a link */
+        {
+            ASSERT(ppl != NULL);
+            
+#if DEBUG_alloc_paddr_inject_fault
+            {
+                static int counter;
+                
+                /* Test stuck_dirty logic for some cases */
+                if ( (++counter) % 4 == 0 )
+                {
+                    /* Simply mark the frame buffer page as always dirty */
+                    range->pl_tab[ i ].stuck_dirty = 1;
+                    gdprintk(XENLOG_DEBUG,
+                             "[%lx] inject stuck dirty fault\n",
+                             gfn );
+                    goto out;
+                }
+            }
+#endif
+            /*
+             * Have we reached the limit of mappings we're willing
+             * to bookkeep?
+             */
+            if (len > DV_ADDR_LINK_LIST_LIMIT) /* yes */
+            {
+                /* Simply mark the frame buffer page as always dirty */
+                range->pl_tab[ i ].stuck_dirty = 1;
+                
+                gdprintk(XENLOG_DEBUG,
+                         "[%lx] link limit exceeded\n",
+                         gfn );
+                
+                goto out;
+            }
+
+            /* alloc link and append it to list */
+            (*ppl) = pl = alloc_paddr_link(d);
+            /* Were we able to allocate a link? */
+            if ( pl == NULL ) /* no */
+            {
+                /* Simply mark the frame buffer page as always dirty */
+                range->pl_tab[ i ].stuck_dirty = 1;
+                
+                gdprintk(XENLOG_DEBUG,
+                         "[%lx] alloc failure\n",
+                         gfn );
+                
+                goto out;
+            }
+        }
+        if ( pl->sl1ma != sl1ma )
+        {
+            ASSERT(pl->sl1ma == INVALID_PADDR);
+            pl->sl1ma = sl1ma;
+            range->nr_mappings++;
+        }
+        effective = 1;
+        if ( len > range->mappings_hwm )
+        {
+            range->mappings_hwm = len;
+#if DEBUG_update_vram_mapping
+            gdprintk(XENLOG_DEBUG,
+                     "[%lx] set      sl1ma:%lx hwm:%d mappings:%d "
+                     "freepages:%d\n",
+                     gfn, sl1ma,
+                     range->mappings_hwm,
+                     range->nr_mappings,
+                     d->arch.paging.shadow.free_pages);
+#endif
+        }
+    }
+    else /* clear */
+    {
+        if ( pl && pl->sl1ma == sl1ma )
+        {
+#if DEBUG_update_vram_mapping
+            gdprintk(XENLOG_DEBUG,
+                     "[%lx] clear    sl1ma:%lx mappings:%d\n",
+                     gfn, sl1ma,
+                     range->nr_mappings - 1);
+#endif
+            free_paddr_link(d, ppl, pl);
+            --range->nr_mappings;
+            effective = 1;
+        }
+    }
+ out:
+    return effective;
+}
+
+
+/*
+ * shadow_scan_dirty_flags()
+ * This produces a dirty bitmap for the range by examining every
+ * L1PTE referenced by some dv_paddr_link in the range's pl_tab table.
+ * It tests and clears each such L1PTE's dirty flag.
+ */
+static int shadow_scan_dirty_flags(struct domain *d,
+                                   dv_range_t *range,
+                                   uint8_t *dirty_bitmap)
+{
+    int flush_tlb = 0;
+    unsigned long i;
+    unsigned long nr = range->end_pfn - range->begin_pfn;
+
+    ASSERT( paging_locked_by_me(d) );
+    /* Iterate over VRAM to track dirty bits. */
+    for ( i = 0; i < nr; i++ )
+    {
+        int dirty = 0, len = 1;
+        dv_paddr_link_t *pl;
+        /* Does the frame buffer have an incomplete set of mappings? */
+        if ( unlikely(range->pl_tab[i].stuck_dirty) ) /* yes */
+            dirty = 1;
+        else /* The frame buffer's set of mappings is complete.  Scan it. */
+            for ( pl = &range->pl_tab[i].mapping;
+                  pl;
+                  pl = pl->pl_next, len++ )
+            {
+                l1_pgentry_t *sl1e;
+                paddr_t sl1ma = pl->sl1ma;
+                if (sl1ma == INVALID_PADDR) /* FB page is unmapped */
+                    continue;
+                sl1e = maddr_to_virt(sl1ma);
+                if ( l1e_get_flags(*sl1e) & _PAGE_DIRTY )
+                {
+                    dirty = 1;
+                    /* Clear dirty so we can detect if page gets re-dirtied.
+                     * Note: this is atomic, so we may clear a
+                     * _PAGE_ACCESSED set by another processor.
+                     */
+                    l1e_remove_flags(*sl1e, _PAGE_DIRTY);
+                    flush_tlb = 1;
+                }
+            } /* for */
+        
+        if ( dirty )
+            dirty_bitmap[i >> 3] |= (1 << (i & 7));
+
+    }
+
+    return flush_tlb;
+}
+
+
+/*
+ * shadow_track_dirty_vram()
+ * This is the API called by the guest to determine which pages in the range
+ * from [begin_pfn:begin_pfn+nr) have been dirtied since the last call.
+ * It creates the domain's dv_dirty_vram on demand.
+ * It creates ranges on demand when some [begin_pfn:nr) is first encountered.
+ * To collect the dirty bitmask it calls shadow_scan_dirty_flags().
+ * It copies the dirty bitmask into guest storage.
+ */
+int shadow_track_dirty_vram(struct domain *d,
+                            unsigned long begin_pfn,
+                            unsigned long nr,
+                            XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
+{
+    int rc = 0;
+    unsigned long end_pfn = begin_pfn + nr;
+    int flush_tlb = 0;
+    dv_range_t *range;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+
+    /*
+     * This range test is tricky.
+     *
+     * The range [begin_pfn..end_pfn) is an open interval, so end_pfn
+     * is a pfn beyond the end of the range.
+     *
+     * p2m->max_mapped_pfn is a valid PFN so p2m->max_mapped_pfn + 1 is an
+     * invalid PFN.
+     *
+     * If end_pfn is beyond *that* then the range is invalid.
+     */
+    if ( end_pfn < begin_pfn
+         || begin_pfn > p2m->max_mapped_pfn
+         || end_pfn > p2m->max_mapped_pfn + 1 )
+        return -EINVAL;
+
+    paging_lock(d);
+
+    if (!nr)
+    {
+        dirty_vram_free(d);
+        goto out;
+    }
+
+    if ( guest_handle_is_null(guest_dirty_bitmap) )
+        goto out;
+
+    if ( !dirty_vram_find_or_alloc(d) )
+    {
+        rc = -ENOMEM;
+        goto out;
+    }
+
+    range = dirty_vram_range_find(d, begin_pfn, nr);
+    if ( !range )
+    {
+        range = dirty_vram_range_alloc(d, begin_pfn, nr);
+        if ( range )
+            sh_find_all_vram_mappings(d->vcpu[0], range);
+    }
+    if ( range )
+    {
+        int size = (nr + BITS_PER_LONG - 1) / BITS_PER_LONG;
+        unsigned long dirty_bitmap[size];
+
+        memset(dirty_bitmap, 0x00, size * BYTES_PER_LONG);
+
+	flush_tlb |= shadow_scan_dirty_flags(d, range, (uint8_t*)dirty_bitmap);
+
+        rc = -EFAULT;
+        if ( copy_to_guest(guest_dirty_bitmap,
+                           (uint8_t*)dirty_bitmap,
+                           size * BYTES_PER_LONG) == 0 )
+            rc = 0;
+    }
+    
+    if ( flush_tlb )
+        flush_tlb_mask(d->domain_dirty_cpumask);
+
+out:
+    paging_unlock(d);
+    return rc;
+}
+
+
+/************************************************/
+/*          HAP VRAM TRACKING SUPPORT           */
+/************************************************/
+
+/*
+ * hap_enable_vram_tracking()
+ * For all ranges, mark all vram pages in range as logdirty read-only.
+ */
+static int hap_enable_vram_tracking(struct domain *d)
+{
+    int rc = 0;
+    dv_dirty_vram_t *dirty_vram;
+    struct list_head *curr;
+
+    /* turn on PG_log_dirty bit in paging mode */
+    paging_lock(d);
+    d->arch.paging.mode |= PG_log_dirty;
+    paging_unlock(d);
+
+    p2m_lock(p2m_get_hostp2m(d));
+    paging_lock(d);
+
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+
+    /*
+     * dirty_vram != NULL iff we're tracking dirty vram.
+     * If we start tracking dirty pages for all memory then
+     * the dirty_vram structure is freed.
+     */
+    if ( !dirty_vram )
+    {
+        rc = -EINVAL;
+        goto out;
+    }
+
+    /* set l1e entries of P2M table to be read-only. */
+    list_for_each(curr, &dirty_vram->range_head)
+    {
+	dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+	gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] enable  vram tracking\n",
+		 range->begin_pfn, range->end_pfn);
+	p2m_change_type_range(d, range->begin_pfn, range->end_pfn,
+			      p2m_ram_rw, p2m_ram_logdirty);
+    }
+
+    flush_tlb_mask(d->domain_dirty_cpumask);
+ out:
+    paging_unlock(d);
+    p2m_unlock(p2m_get_hostp2m(d));
+    if ( rc )
+    {
+        paging_lock(d);
+        d->arch.paging.mode &= ~PG_log_dirty;
+        paging_unlock(d);
+    }
+    return rc;
+}
+
+/*
+ * hap_disable_vram_tracking()
+ * For all ranges, mark all vram pages in range as logdirty read-write.
+ */
+static int hap_disable_vram_tracking(struct domain *d)
+{
+    int rc = 0;
+    dv_dirty_vram_t *dirty_vram;
+    struct list_head *curr;
+
+    paging_lock(d);
+    d->arch.paging.mode &= ~PG_log_dirty;
+    paging_unlock(d);
+
+    p2m_lock(p2m_get_hostp2m(d));
+    paging_lock(d);
+
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+    if ( !dirty_vram )
+    {
+        rc = -EINVAL;
+        goto out;
+    }
+
+    /* set l1e entries of P2M table with normal mode */
+    list_for_each(curr, &dirty_vram->range_head)
+    {
+	dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+	gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] disable vram tracking\n",
+		 range->begin_pfn, range->end_pfn);
+	p2m_change_type_range(d, range->begin_pfn, range->end_pfn,
+			      p2m_ram_logdirty, p2m_ram_rw);
+    }
+    flush_tlb_mask(d->domain_dirty_cpumask);
+ out:
+    paging_unlock(d);
+    p2m_unlock(p2m_get_hostp2m(d));
+    if ( rc )
+    {
+        paging_lock(d);
+        d->arch.paging.mode |= PG_log_dirty;
+        paging_unlock(d);
+    }
+    return rc;
+}
+
+/*
+ * hap_clean_vram_tracking_range()
+ * For all the pages in the range specified by [begin_pfn,nr),
+ * note in the dirty bitmap any page that has been marked as read-write,
+ * which signifies that the page has been dirtied, and reset the page
+ * to ram_logdirty.
+ */
+void hap_clean_vram_tracking_range(struct domain *d,
+                                   unsigned long begin_pfn,
+                                   unsigned long nr,
+                                   uint8_t *dirty_bitmap)
+{
+    int i;
+    unsigned long pfn;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    dv_range_t *range;
+
+    ASSERT(p2m_locked_by_me(p2m_get_hostp2m(d)));
+    ASSERT(paging_locked_by_me(d));
+
+    if ( !dirty_vram )
+    {
+        gdprintk(XENLOG_DEBUG,
+                 "Should only be called while tracking dirty vram.\n");
+        return;
+    }
+
+    range = dirty_vram_range_find(d, begin_pfn, nr);
+    if ( !range )
+        return;
+
+    /* set l1e entries of P2M table to be read-only. */
+    /*
+     * On first write, it page faults, its entry is changed to read-write,
+     * its bit in the dirty bitmap is set, and on retry the write succeeds.
+     */
+    for ( i = 0, pfn = range->begin_pfn; pfn < range->end_pfn; i++, pfn++ )
+    {
+        p2m_type_t pt;
+        pt = p2m_change_type(d, pfn, p2m_ram_rw, p2m_ram_logdirty);
+        if ( pt == p2m_ram_rw )
+            dirty_bitmap[i >> 3] |= (1 << (i & 7));
+    }
+    flush_tlb_mask(d->domain_dirty_cpumask);
+}
+
+static void hap_vram_tracking_init(struct domain *d)
+{
+    paging_log_dirty_init(d, hap_enable_vram_tracking,
+                          hap_disable_vram_tracking,
+                          NULL);
+}
+
+/*
+ * hap_track_dirty_vram()
+ * Create the domain's dv_dirty_vram struct on demand.
+ * Create a dirty vram range on demand when some [begin_pfn:begin_pfn+nr] is
+ * first encountered.
+ * Collect the guest_dirty bitmask, a bit mask of the dirty vram pages, by
+ * calling paging_log_dirty_range().
+ */
+int hap_track_dirty_vram(struct domain *d,
+                         unsigned long begin_pfn,
+                         unsigned long nr,
+                         XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
+{
+    long rc = 0;
+    dv_dirty_vram_t *dirty_vram;
+
+    paging_lock(d);
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+    if ( nr )
+    {
+        dv_range_t *range = NULL;
+        int size = ( nr + BITS_PER_LONG - 1 ) & ~( BITS_PER_LONG - 1 );
+        uint8_t dirty_bitmap[size];
+        bool_t new_range = 0;
+
+        /* Already tracking dirty vram? */
+        if ( paging_mode_log_dirty(d) && dirty_vram ) /* yes */
+        {
+            /* Handle the addition of another range */
+            range = dirty_vram_range_find(d, begin_pfn, nr);
+            if ( !range )
+            {
+                rc = -ENOMEM;
+                if ( !(range = dirty_vram_range_alloc(d, begin_pfn, nr)) )
+                    goto param_fail;
+                new_range = 1;
+            }
+        }
+        /* Just starting to track dirty vram? */
+        else if ( !paging_mode_log_dirty(d) && !dirty_vram ) /* yes */
+        {
+            rc = -ENOMEM;
+            if ( !(dirty_vram = dirty_vram_alloc(d)) )
+                goto param_fail;
+
+            if ( !(range = dirty_vram_range_find_or_alloc(d, begin_pfn,
+                                                          nr)) )
+                goto param_fail;
+
+            new_range = 1;
+            
+            /* Initialize callbacks for vram tracking */
+            hap_vram_tracking_init(d);
+
+            /* Enable HAP vram tracking */
+            paging_unlock(d);
+            rc = paging_log_dirty_enable(d);
+            paging_lock(d);
+            
+            if ( rc != 0 )
+                goto param_fail;
+        }
+        else
+        {
+            /* Test for invalid combination */
+            if ( !paging_mode_log_dirty(d) && dirty_vram )
+                rc = -EINVAL;
+            else /* logging dirty of all memory, not tracking dirty vram */
+                rc = -ENODATA;
+            goto param_fail;
+        }
+
+        paging_unlock(d);
+        /* Is this query the very first for this range? */
+        if ( new_range ) /* yes */
+            memset(dirty_bitmap, 0xff, size); /* consider all pages dirty */
+        else
+        {
+            memset(dirty_bitmap, 0x00, size);
+            paging_log_dirty_range(d, begin_pfn, nr, dirty_bitmap);
+        }
+        rc = -EFAULT;
+        if ( copy_to_guest(guest_dirty_bitmap,
+                           dirty_bitmap,
+                           size) == 0 )
+        {
+            rc = 0;
+        }
+    }
+    else
+    {
+        /*
+         * If zero pages specified while already tracking dirty vram
+         * then stop tracking
+         */
+        if ( paging_mode_log_dirty(d) && dirty_vram )
+        {
+            /* Disable HAP vram tracking */
+            paging_unlock(d);
+            rc = paging_log_dirty_disable(d);
+            paging_lock(d);
+            
+            dirty_vram_free(d);
+        }
+        else /* benign no-op */
+        {
+            rc = 0;
+        }
+        paging_unlock(d);
+    }
+
+    return rc;
+
+param_fail:
+    dirty_vram_free(d);
+    paging_unlock(d);
+    return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index fd99cde..09cdba2 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -41,6 +41,7 @@
 #include <asm/domain.h>
 #include <xen/numa.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/dirty_vram.h>
 
 #include "private.h"
 
@@ -53,139 +54,6 @@
 #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
 
 /************************************************/
-/*          HAP VRAM TRACKING SUPPORT           */
-/************************************************/
-
-static int hap_enable_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return -EINVAL;
-
-    /* turn on PG_log_dirty bit in paging mode */
-    paging_lock(d);
-    d->arch.paging.mode |= PG_log_dirty;
-    paging_unlock(d);
-
-    /* set l1e entries of P2M table to be read-only. */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_rw, p2m_ram_logdirty);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-    return 0;
-}
-
-static int hap_disable_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return -EINVAL;
-
-    paging_lock(d);
-    d->arch.paging.mode &= ~PG_log_dirty;
-    paging_unlock(d);
-
-    /* set l1e entries of P2M table with normal mode */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_logdirty, p2m_ram_rw);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-    return 0;
-}
-
-static void hap_clean_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return;
-
-    /* set l1e entries of P2M table to be read-only. */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_rw, p2m_ram_logdirty);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-}
-
-static void hap_vram_tracking_init(struct domain *d)
-{
-    paging_log_dirty_init(d, hap_enable_vram_tracking,
-                          hap_disable_vram_tracking,
-                          hap_clean_vram_tracking);
-}
-
-int hap_track_dirty_vram(struct domain *d,
-                         unsigned long begin_pfn,
-                         unsigned long nr,
-                         XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
-{
-    long rc = 0;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( nr )
-    {
-        if ( paging_mode_log_dirty(d) && dirty_vram )
-        {
-            if ( begin_pfn != dirty_vram->begin_pfn ||
-                 begin_pfn + nr != dirty_vram->end_pfn )
-            {
-                paging_log_dirty_disable(d);
-                dirty_vram->begin_pfn = begin_pfn;
-                dirty_vram->end_pfn = begin_pfn + nr;
-                rc = paging_log_dirty_enable(d);
-                if (rc != 0)
-                    goto param_fail;
-            }
-        }
-        else if ( !paging_mode_log_dirty(d) && !dirty_vram )
-        {
-            rc = -ENOMEM;
-            if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL )
-                goto param_fail;
-
-            dirty_vram->begin_pfn = begin_pfn;
-            dirty_vram->end_pfn = begin_pfn + nr;
-            d->arch.hvm_domain.dirty_vram = dirty_vram;
-            hap_vram_tracking_init(d);
-            rc = paging_log_dirty_enable(d);
-            if (rc != 0)
-                goto param_fail;
-        }
-        else
-        {
-            if ( !paging_mode_log_dirty(d) && dirty_vram )
-                rc = -EINVAL;
-            else
-                rc = -ENODATA;
-            goto param_fail;
-        }
-        /* get the bitmap */
-        rc = paging_log_dirty_range(d, begin_pfn, nr, dirty_bitmap);
-    }
-    else
-    {
-        if ( paging_mode_log_dirty(d) && dirty_vram ) {
-            rc = paging_log_dirty_disable(d);
-            xfree(dirty_vram);
-            dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-        } else
-            rc = 0;
-    }
-
-    return rc;
-
-param_fail:
-    if ( dirty_vram )
-    {
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-    }
-    return rc;
-}
-
-/************************************************/
 /*            HAP LOG DIRTY SUPPORT             */
 /************************************************/
 
@@ -223,14 +91,12 @@ static void hap_clean_dirty_bitmap(struct domain *d)
 
 void hap_logdirty_init(struct domain *d)
 {
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    struct dv_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
     if ( paging_mode_log_dirty(d) && dirty_vram )
     {
         paging_log_dirty_disable(d);
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
+        dirty_vram_free(d);
     }
-
     /* Reinitialize logdirty mechanism */
     paging_log_dirty_init(d, hap_enable_log_dirty,
                           hap_disable_log_dirty,
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index ea44e39..f0ac512 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -27,6 +27,7 @@
 #include <asm/p2m.h>
 #include <asm/hap.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/dirty_vram.h>
 #include <xen/numa.h>
 #include <xsm/xsm.h>
 
@@ -192,15 +193,11 @@ int paging_log_dirty_disable(struct domain *d)
     return ret;
 }
 
-/* Mark a page as dirty */
+/* Given a guest mfn, mark a page as dirty */
 void paging_mark_dirty(struct domain *d, unsigned long guest_mfn)
 {
     unsigned long pfn;
     mfn_t gmfn;
-    int changed;
-    mfn_t mfn, *l4, *l3, *l2;
-    unsigned long *l1;
-    int i1, i2, i3, i4;
 
     gmfn = _mfn(guest_mfn);
 
@@ -210,6 +207,19 @@ void paging_mark_dirty(struct domain *d, unsigned long guest_mfn)
 
     /* We /really/ mean PFN here, even for non-translated guests. */
     pfn = get_gpfn_from_mfn(mfn_x(gmfn));
+    paging_mark_dirty_gpfn(d, pfn);
+}
+
+
+/* Given a guest pfn, mark a page as dirty */
+void paging_mark_dirty_gpfn(struct domain *d, unsigned long pfn)
+{
+    int changed;
+    mfn_t mfn, *l4, *l3, *l2;
+    unsigned long *l1;
+    int i1, i2, i3, i4;
+    dv_range_t *range;
+    
     /* Shared MFNs should NEVER be marked dirty */
     BUG_ON(SHARED_M2P(pfn));
 
@@ -229,6 +239,11 @@ void paging_mark_dirty(struct domain *d, unsigned long guest_mfn)
     /* Recursive: this is called from inside the shadow code */
     paging_lock_recursive(d);
 
+    d->arch.paging.log_dirty.dirty_count++;
+    range = dirty_vram_range_find_gfn(d, pfn);
+    if ( range )
+        range->dirty_count++;
+
     if ( unlikely(!mfn_valid(d->arch.paging.log_dirty.top)) ) 
     {
          d->arch.paging.log_dirty.top = paging_new_log_dirty_node(d);
@@ -333,8 +348,11 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
     mfn_t *l4, *l3, *l2;
     unsigned long *l1;
     int i4, i3, i2;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
 
     domain_pause(d);
+    /* Locking hierarchy requires p2m lock to be taken first */
+    p2m_lock(p2m);
     paging_lock(d);
 
     clean = (sc->op == XEN_DOMCTL_SHADOW_OP_CLEAN);
@@ -345,6 +363,16 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
                  d->arch.paging.log_dirty.fault_count,
                  d->arch.paging.log_dirty.dirty_count);
 
+    if ( hap_enabled(d) && d->arch.hvm_domain.dirty_vram )
+    {
+        /*
+         * If we're cleaning/peeking all guest memory, we should not
+         * be tracking dirty vram.
+         */
+        rv = -EINVAL;
+        goto out;
+    }
+
     sc->stats.fault_count = d->arch.paging.log_dirty.fault_count;
     sc->stats.dirty_count = d->arch.paging.log_dirty.dirty_count;
 
@@ -424,170 +452,64 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
 
     if ( clean )
     {
-        /* We need to further call clean_dirty_bitmap() functions of specific
-         * paging modes (shadow or hap).  Safe because the domain is paused. */
-        d->arch.paging.log_dirty.clean_dirty_bitmap(d);
+        /* Is null if tracking dirty vram */
+        if ( d->arch.paging.log_dirty.clean_dirty_bitmap )
+        {
+            /*
+             * We need to call clean_dirty_bitmap() functions of specific
+             * paging modes (shadow or hap).
+             * Safe because the domain is paused.
+             */
+            d->arch.paging.log_dirty.clean_dirty_bitmap(d);
+        }
     }
     domain_unpause(d);
     return rv;
 
  out:
     paging_unlock(d);
+    p2m_unlock(p2m);
     domain_unpause(d);
     return rv;
 }
 
-int paging_log_dirty_range(struct domain *d,
-                            unsigned long begin_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
+void paging_log_dirty_range(struct domain *d,
+                           unsigned long begin_pfn,
+                           unsigned long nr,
+                           uint8_t *dirty_bitmap)
 {
-    int rv = 0;
-    unsigned long pages = 0;
-    mfn_t *l4, *l3, *l2;
-    unsigned long *l1;
-    int b1, b2, b3, b4;
-    int i2, i3, i4;
-
-    d->arch.paging.log_dirty.clean_dirty_bitmap(d);
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    dv_range_t *range;
+    unsigned int range_dirty_count = 0;
+    
+    p2m_lock(p2m);
     paging_lock(d);
 
-    PAGING_DEBUG(LOGDIRTY, "log-dirty-range: dom %u faults=%u dirty=%u\n",
-                 d->domain_id,
-                 d->arch.paging.log_dirty.fault_count,
-                 d->arch.paging.log_dirty.dirty_count);
-
-    if ( unlikely(d->arch.paging.log_dirty.failed_allocs) ) {
-        printk("%s: %d failed page allocs while logging dirty pages\n",
-               __FUNCTION__, d->arch.paging.log_dirty.failed_allocs);
-        rv = -ENOMEM;
-        goto out;
-    }
-
-    if ( !d->arch.paging.log_dirty.fault_count &&
-         !d->arch.paging.log_dirty.dirty_count ) {
-        unsigned int size = BITS_TO_LONGS(nr);
-
-        if ( clear_guest(dirty_bitmap, size * BYTES_PER_LONG) != 0 )
-            rv = -EFAULT;
-        goto out;
-    }
-    d->arch.paging.log_dirty.fault_count = 0;
-    d->arch.paging.log_dirty.dirty_count = 0;
-
-    b1 = L1_LOGDIRTY_IDX(begin_pfn);
-    b2 = L2_LOGDIRTY_IDX(begin_pfn);
-    b3 = L3_LOGDIRTY_IDX(begin_pfn);
-    b4 = L4_LOGDIRTY_IDX(begin_pfn);
-    l4 = paging_map_log_dirty_bitmap(d);
-
-    for ( i4 = b4;
-          (pages < nr) && (i4 < LOGDIRTY_NODE_ENTRIES);
-          i4++ )
+    /* Only called when tracking dirty vram in HAP mode */
+    ASSERT(hap_enabled(d) && d->arch.hvm_domain.dirty_vram);
+    
+    range = dirty_vram_range_find_gfn(d, begin_pfn);
+    if ( range )
     {
-        l3 = (l4 && mfn_valid(l4[i4])) ? map_domain_page(mfn_x(l4[i4])) : NULL;
-        for ( i3 = b3;
-              (pages < nr) && (i3 < LOGDIRTY_NODE_ENTRIES);
-              i3++ )
-        {
-            l2 = ((l3 && mfn_valid(l3[i3])) ?
-                  map_domain_page(mfn_x(l3[i3])) : NULL);
-            for ( i2 = b2;
-                  (pages < nr) && (i2 < LOGDIRTY_NODE_ENTRIES);
-                  i2++ )
-            {
-                unsigned int bytes = PAGE_SIZE;
-                uint8_t *s;
-                l1 = ((l2 && mfn_valid(l2[i2])) ?
-                      map_domain_page(mfn_x(l2[i2])) : NULL);
-
-                s = ((uint8_t*)l1) + (b1 >> 3);
-                bytes -= b1 >> 3;
-
-                if ( likely(((nr - pages + 7) >> 3) < bytes) )
-                    bytes = (unsigned int)((nr - pages + 7) >> 3);
-
-                if ( !l1 )
-                {
-                    if ( clear_guest_offset(dirty_bitmap, pages >> 3,
-                                            bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-                /* begin_pfn is not 32K aligned, hence we have to bit
-                 * shift the bitmap */
-                else if ( b1 & 0x7 )
-                {
-                    int i, j;
-                    uint32_t *l = (uint32_t*) s;
-                    int bits = b1 & 0x7;
-                    int bitmask = (1 << bits) - 1;
-                    int size = (bytes + BYTES_PER_LONG - 1) / BYTES_PER_LONG;
-                    unsigned long bitmap[size];
-                    static unsigned long printed = 0;
-
-                    if ( printed != begin_pfn )
-                    {
-                        dprintk(XENLOG_DEBUG, "%s: begin_pfn %lx is not 32K aligned!\n",
-                                __FUNCTION__, begin_pfn);
-                        printed = begin_pfn;
-                    }
-
-                    for ( i = 0; i < size - 1; i++, l++ ) {
-                        bitmap[i] = ((*l) >> bits) |
-                            (((*((uint8_t*)(l + 1))) & bitmask) << (sizeof(*l) * 8 - bits));
-                    }
-                    s = (uint8_t*) l;
-                    size = BYTES_PER_LONG - ((b1 >> 3) & 0x3);
-                    bitmap[i] = 0;
-                    for ( j = 0; j < size; j++, s++ )
-                        bitmap[i] |= (*s) << (j * 8);
-                    bitmap[i] = (bitmap[i] >> bits) | (bitmask << (size * 8 - bits));
-                    if ( copy_to_guest_offset(dirty_bitmap, (pages >> 3),
-                                (uint8_t*) bitmap, bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-                else
-                {
-                    if ( copy_to_guest_offset(dirty_bitmap, pages >> 3,
-                                              s, bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-
-                pages += bytes << 3;
-                if ( l1 )
-                {
-                    clear_page(l1);
-                    unmap_domain_page(l1);
-                }
-                b1 = b1 & 0x7;
-            }
-            b2 = 0;
-            if ( l2 )
-                unmap_domain_page(l2);
-        }
-        b3 = 0;
-        if ( l3 )
-            unmap_domain_page(l3);
+        range_dirty_count = range->dirty_count;
+        range->dirty_count = 0;
     }
-    if ( l4 )
-        unmap_domain_page(l4);
-
-    paging_unlock(d);
+    
+    if ( !range_dirty_count)
+        goto out;
 
-    return rv;
+    PAGING_DEBUG(LOGDIRTY,
+                 "log-dirty-range: dom %u [%05lx:%05lx] range_dirty=%u\n",
+                 d->domain_id,
+                 begin_pfn,
+                 range->end_pfn,
+                 range_dirty_count);
 
+    hap_clean_vram_tracking_range(d, begin_pfn, nr, dirty_bitmap);
  out:
     paging_unlock(d);
-    return rv;
+    p2m_unlock(p2m);
+    return;
 }
 
 /* Note that this function takes three function pointers. Callers must supply
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index ce79131..30829b6 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -36,6 +36,7 @@
 #include <asm/current.h>
 #include <asm/flushtlb.h>
 #include <asm/shadow.h>
+#include <asm/dirty_vram.h>
 #include <xen/numa.h>
 #include "private.h"
 
@@ -3121,12 +3122,7 @@ void shadow_teardown(struct domain *d)
      * calls now that we've torn down the bitmap */
     d->arch.paging.mode &= ~PG_log_dirty;
 
-    if (d->arch.hvm_domain.dirty_vram) {
-        xfree(d->arch.hvm_domain.dirty_vram->sl1ma);
-        xfree(d->arch.hvm_domain.dirty_vram->dirty_bitmap);
-        xfree(d->arch.hvm_domain.dirty_vram);
-        d->arch.hvm_domain.dirty_vram = NULL;
-    }
+    dirty_vram_free(d);
 
     paging_unlock(d);
 
@@ -3463,177 +3459,209 @@ void shadow_clean_dirty_bitmap(struct domain *d)
 
 
 /**************************************************************************/
-/* VRAM dirty tracking support */
-int shadow_track_dirty_vram(struct domain *d,
-                            unsigned long begin_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
-{
-    int rc;
-    unsigned long end_pfn = begin_pfn + nr;
-    unsigned long dirty_size = (nr + 7) / 8;
-    int flush_tlb = 0;
-    unsigned long i;
-    p2m_type_t t;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-    struct p2m_domain *p2m = p2m_get_hostp2m(d);
-
-    if (end_pfn < begin_pfn
-            || begin_pfn > p2m->max_mapped_pfn
-            || end_pfn >= p2m->max_mapped_pfn)
-        return -EINVAL;
-
-    /* We perform p2m lookups, so lock the p2m upfront to avoid deadlock */
-    p2m_lock(p2m_get_hostp2m(d));
-    paging_lock(d);
+/* Support functions for shadow-based dirty VRAM code */
 
-    if ( dirty_vram && (!nr ||
-             ( begin_pfn != dirty_vram->begin_pfn
-            || end_pfn   != dirty_vram->end_pfn )) )
-    {
-        /* Different tracking, tear the previous down. */
-        gdprintk(XENLOG_INFO, "stopping tracking VRAM %lx - %lx\n", dirty_vram->begin_pfn, dirty_vram->end_pfn);
-        xfree(dirty_vram->sl1ma);
-        xfree(dirty_vram->dirty_bitmap);
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-    }
+#define DEBUG_unshadow_sl1ma                  0          
+#define DEBUG_unshadow_sl1ma_detail           0
+#define DEBUG_count_initial_mappings          1
 
-    if ( !nr )
+/* smfn is no longer a shadow page.  Remove it from any
+ * dirty vram range mapping. */
+void
+dirty_vram_delete_shadow(struct vcpu *v,
+                         unsigned long gfn,
+                         unsigned int shadow_type, 
+                         mfn_t smfn)
+{
+    static unsigned int l1_shadow_mask = 
+          1 << SH_type_l1_32_shadow
+        | 1 << SH_type_fl1_32_shadow
+        | 1 << SH_type_l1_pae_shadow
+        | 1 << SH_type_fl1_pae_shadow
+        | 1 << SH_type_l1_64_shadow
+        | 1 << SH_type_fl1_64_shadow
+        ;
+    struct domain *d = v->domain;
+    dv_dirty_vram_t *dirty_vram;
+    struct list_head *curr, *next;
+    
+    ASSERT(paging_locked_by_me(d));
+    /* Ignore all but level 1 shadows */
+    
+    if ((l1_shadow_mask & (1 << shadow_type)) == 0)
     {
-        rc = 0;
         goto out;
     }
 
-    /* This should happen seldomly (Video mode change),
-     * no need to be careful. */
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
     if ( !dirty_vram )
     {
-        /* Throw away all the shadows rather than walking through them 
-         * up to nr times getting rid of mappings of each pfn */
-        shadow_blow_tables(d);
-
-        gdprintk(XENLOG_INFO, "tracking VRAM %lx - %lx\n", begin_pfn, end_pfn);
-
-        rc = -ENOMEM;
-        if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL )
-            goto out;
-        dirty_vram->begin_pfn = begin_pfn;
-        dirty_vram->end_pfn = end_pfn;
-        d->arch.hvm_domain.dirty_vram = dirty_vram;
-
-        if ( (dirty_vram->sl1ma = xmalloc_array(paddr_t, nr)) == NULL )
-            goto out_dirty_vram;
-        memset(dirty_vram->sl1ma, ~0, sizeof(paddr_t) * nr);
-
-        if ( (dirty_vram->dirty_bitmap = xzalloc_array(uint8_t, dirty_size)) == NULL )
-            goto out_sl1ma;
-
-        dirty_vram->last_dirty = NOW();
-
-        /* Tell the caller that this time we could not track dirty bits. */
-        rc = -ENODATA;
-    }
-    else if (dirty_vram->last_dirty == -1)
-    {
-        /* still completely clean, just copy our empty bitmap */
-        rc = -EFAULT;
-        if ( copy_to_guest(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size) == 0 )
-            rc = 0;
+        goto out;
     }
-    else
+        
+    list_for_each_safe(curr, next, &dirty_vram->range_head)
     {
-        /* Iterate over VRAM to track dirty bits. */
-        for ( i = 0; i < nr; i++ ) {
-            mfn_t mfn = get_gfn_query_unlocked(d, begin_pfn + i, &t);
-            struct page_info *page;
-            int dirty = 0;
-            paddr_t sl1ma = dirty_vram->sl1ma[i];
-
-            if (mfn_x(mfn) == INVALID_MFN)
-            {
-                dirty = 1;
-            }
-            else
+        dv_range_t *range = list_entry(curr, dv_range_t, range_link);
+        unsigned long i;
+        int max_mappings = 1, mappings = 0;
+        int unshadowed = 0;
+        for (i = 0; i != range->end_pfn - range->begin_pfn; i++)
+        {
+            dv_paddr_link_t *pl = &range->pl_tab[ i ].mapping;
+            dv_paddr_link_t **ppl = NULL;
+            mappings = 0;
+            
+            while (pl != NULL)
             {
-                page = mfn_to_page(mfn);
-                switch (page->u.inuse.type_info & PGT_count_mask)
-                {
-                case 0:
-                    /* No guest reference, nothing to track. */
-                    break;
-                case 1:
-                    /* One guest reference. */
-                    if ( sl1ma == INVALID_PADDR )
-                    {
-                        /* We don't know which sl1e points to this, too bad. */
-                        dirty = 1;
-                        /* TODO: Heuristics for finding the single mapping of
-                         * this gmfn */
-                        flush_tlb |= sh_remove_all_mappings(d->vcpu[0], mfn);
-                    }
-                    else
-                    {
-                        /* Hopefully the most common case: only one mapping,
-                         * whose dirty bit we can use. */
-                        l1_pgentry_t *sl1e = maddr_to_virt(sl1ma);
-
-                        if ( l1e_get_flags(*sl1e) & _PAGE_DIRTY )
-                        {
-                            dirty = 1;
-                            /* Note: this is atomic, so we may clear a
-                             * _PAGE_ACCESSED set by another processor. */
-                            l1e_remove_flags(*sl1e, _PAGE_DIRTY);
-                            flush_tlb = 1;
-                        }
-                    }
-                    break;
-                default:
-                    /* More than one guest reference,
-                     * we don't afford tracking that. */
-                    dirty = 1;
+                paddr_t sl1ma = pl->sl1ma;
+                unsigned long sl1mn;
+                
+                if (sl1ma == INVALID_PADDR )
                     break;
+                
+                sl1mn = sl1ma >> PAGE_SHIFT;
+                if (sl1mn == mfn_x(smfn)) {
+#if DEBUG_unshadow_sl1ma_detail
+                    gdprintk(XENLOG_DEBUG,
+                             "[%lx] gfn[%lx] unshadow sl1ma:%lx\n",
+                             mfn_x(smfn),
+                             range->begin_pfn + i,
+                             sl1ma);
+#endif
+                    unshadowed++;
+                    pl = free_paddr_link(d, ppl, pl);
+                    --range->nr_mappings;
+                }
+                else
+                {
+                    ppl = &pl->pl_next;
+                    pl = *ppl;
+                    mappings++;
                 }
             }
-
-            if ( dirty )
+        }
+        if (mappings > max_mappings)
+            max_mappings = mappings;
+        
+        if (unshadowed) {
+#if DEBUG_unshadow_sl1ma
+            gdprintk(XENLOG_DEBUG,
+                     "[%lx] gfn[%05lx:%05lx] unshadowed:%d mappings:0x%x max_mappings:%d\n",
+                     mfn_x(smfn),
+                     range->begin_pfn, range->end_pfn,
+                     unshadowed, range->nr_mappings, max_mappings);
+#endif
+            if ( range->nr_mappings == 0 )
             {
-                dirty_vram->dirty_bitmap[i / 8] |= 1 << (i % 8);
-                dirty_vram->last_dirty = NOW();
+                dirty_vram_range_free(d, range);                    
             }
         }
+    }
+ out:
+    return;
+}
+
+
+typedef int (*hash_pfn_callback_t)(struct vcpu *v,
+                                   mfn_t smfn,
+                                   unsigned long begin_pfn,
+                                   unsigned long end_pfn,
+                                   int *removed);
 
-        rc = -EFAULT;
-        if ( copy_to_guest(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size) == 0 ) {
-            memset(dirty_vram->dirty_bitmap, 0, dirty_size);
-            if (dirty_vram->last_dirty + SECONDS(2) < NOW())
+static int hash_pfn_foreach(struct vcpu *v, 
+                            unsigned int callback_mask, 
+                            hash_pfn_callback_t callbacks[], 
+                            unsigned long begin_pfn,
+                            unsigned long end_pfn)
+/* Walk the hash table looking at the types of the entries and 
+ * calling the appropriate callback function for each entry. 
+ * The mask determines which shadow types we call back for, and the array
+ * of callbacks tells us which function to call.
+ * Any callback may return non-zero to let us skip the rest of the scan. 
+ *
+ * WARNING: Callbacks MUST NOT add or remove hash entries unless they 
+ * then return non-zero to terminate the scan. */
+{
+    int i, done = 0, removed = 0;
+    struct domain *d = v->domain;
+    struct page_info *x;
+
+    /* Say we're here, to stop hash-lookups reordering the chains */
+    ASSERT(paging_locked_by_me(d));
+    ASSERT(d->arch.paging.shadow.hash_walking == 0);
+    d->arch.paging.shadow.hash_walking = 1;
+
+    for ( i = 0; i < SHADOW_HASH_BUCKETS; i++ ) 
+    {
+        /* WARNING: This is not safe against changes to the hash table.
+         * The callback *must* return non-zero if it has inserted or
+         * deleted anything from the hash (lookups are OK, though). */
+        for ( x = d->arch.paging.shadow.hash_table[i]; x; x = next_shadow(x) )
+        {
+            if ( callback_mask & (1 << x->u.sh.type) )
             {
-                /* was clean for more than two seconds, try to disable guest
-                 * write access */
-                for ( i = begin_pfn; i < end_pfn; i++ ) {
-                    mfn_t mfn = get_gfn_query_unlocked(d, i, &t);
-                    if (mfn_x(mfn) != INVALID_MFN)
-                        flush_tlb |= sh_remove_write_access(d->vcpu[0], mfn, 1, 0);
-                }
-                dirty_vram->last_dirty = -1;
+                ASSERT(x->u.sh.type <= 15);
+                ASSERT(callbacks[x->u.sh.type] != NULL);
+                done = callbacks[x->u.sh.type](v, page_to_mfn(x), 
+                                               begin_pfn, end_pfn,
+                                               &removed);
+                if ( done ) break;
             }
-            rc = 0;
         }
+        if ( done ) break; 
     }
-    if ( flush_tlb )
-        flush_tlb_mask(d->domain_dirty_cpumask);
-    goto out;
+    d->arch.paging.shadow.hash_walking = 0;
+    return removed;
+}
+
+void sh_find_all_vram_mappings(struct vcpu *v,
+                               dv_range_t *range)
+{
+    /* Dispatch table for getting per-type functions */
+    static hash_pfn_callback_t callbacks[SH_type_unused] = {
+        NULL, /* none    */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 2), /* l1_32   */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 2), /* fl1_32  */
+        NULL, /* l2_32   */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 3), /* l1_pae  */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 3), /* fl1_pae */
+        NULL, /* l2_pae  */
+        NULL, /* l2h_pae */
+#if CONFIG_PAGING_LEVELS >= 4
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 4), /* l1_64   */
+        SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, 4), /* fl1_64  */
+#else
+        NULL, /* l1_64   */
+        NULL, /* fl1_64  */
+#endif
+        NULL, /* l2_64   */
+        NULL, /* l2h_64  */
+        NULL, /* l3_64   */
+        NULL, /* l4_64   */
+        NULL, /* p2m     */
+        NULL  /* unused  */
+    };
 
-out_sl1ma:
-    xfree(dirty_vram->sl1ma);
-out_dirty_vram:
-    xfree(dirty_vram);
-    dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
+    static unsigned int callback_mask = 
+          1 << SH_type_l1_32_shadow
+        | 1 << SH_type_fl1_32_shadow
+        | 1 << SH_type_l1_pae_shadow
+        | 1 << SH_type_fl1_pae_shadow
+        | 1 << SH_type_l1_64_shadow
+        | 1 << SH_type_fl1_64_shadow
+        ;
 
-out:
-    paging_unlock(d);
-    p2m_unlock(p2m_get_hostp2m(d));
-    return rc;
+    perfc_incr(shadow_mappings);
+
+    hash_pfn_foreach(v, callback_mask, callbacks,
+                     range->begin_pfn,
+                     range->end_pfn);
+
+#if DEBUG_count_initial_mappings
+    gdprintk(XENLOG_DEBUG, "[%05lx:%05lx] count of initial mappings:%d\n",
+             range->begin_pfn, range->end_pfn,
+             range->nr_mappings);
+#endif
 }
 
 /**************************************************************************/
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 4967da1..bb983bc 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -35,6 +35,7 @@
 #include <asm/flushtlb.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/cacheattr.h>
+#include <asm/dirty_vram.h>
 #include <asm/mtrr.h>
 #include <asm/guest_pt.h>
 #include <public/sched.h>
@@ -149,6 +150,10 @@ delete_fl1_shadow_status(struct vcpu *v, gfn_t gfn, mfn_t smfn)
     SHADOW_PRINTK("gfn=%"SH_PRI_gfn", type=%08x, smfn=%05lx\n",
                    gfn_x(gfn), SH_type_fl1_shadow, mfn_x(smfn));
     ASSERT(mfn_to_page(smfn)->u.sh.head);
+
+    /* Removing any dv_paddr_links to the erstwhile shadow page */
+    dirty_vram_delete_shadow(v, gfn_x(gfn), SH_type_fl1_shadow, smfn);
+    
     shadow_hash_delete(v, gfn_x(gfn), SH_type_fl1_shadow, smfn);
 }
 
@@ -160,6 +165,10 @@ delete_shadow_status(struct vcpu *v, mfn_t gmfn, u32 shadow_type, mfn_t smfn)
                    v->domain->domain_id, v->vcpu_id,
                    mfn_x(gmfn), shadow_type, mfn_x(smfn));
     ASSERT(mfn_to_page(smfn)->u.sh.head);
+    
+    /* Removing any dv_paddr_links to the erstwhile shadow page */
+    dirty_vram_delete_shadow(v, mfn_x(gmfn), shadow_type, smfn);
+    
     shadow_hash_delete(v, mfn_x(gmfn), shadow_type, smfn);
     /* 32-on-64 PV guests don't own their l4 pages; see set_shadow_status */
     if ( !is_pv_32on64_vcpu(v) || shadow_type != SH_type_l4_64_shadow )
@@ -516,7 +525,6 @@ _sh_propagate(struct vcpu *v,
     guest_l1e_t guest_entry = { guest_intpte };
     shadow_l1e_t *sp = shadow_entry_ptr;
     struct domain *d = v->domain;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
     gfn_t target_gfn = guest_l1e_get_gfn(guest_entry);
     u32 pass_thru_flags;
     u32 gflags, sflags;
@@ -663,17 +671,6 @@ _sh_propagate(struct vcpu *v,
         }
     }
 
-    if ( unlikely((level == 1) && dirty_vram
-            && dirty_vram->last_dirty == -1
-            && gfn_x(target_gfn) >= dirty_vram->begin_pfn
-            && gfn_x(target_gfn) < dirty_vram->end_pfn) )
-    {
-        if ( ft & FETCH_TYPE_WRITE )
-            dirty_vram->last_dirty = NOW();
-        else
-            sflags &= ~_PAGE_RW;
-    }
-
     /* Read-only memory */
     if ( p2m_is_readonly(p2mt) ||
          (p2mt == p2m_mmio_direct &&
@@ -1072,101 +1069,60 @@ static int shadow_set_l2e(struct vcpu *v,
     return flags;
 }
 
-static inline void shadow_vram_get_l1e(shadow_l1e_t new_sl1e,
+/* shadow_vram_fix_l1e()
+ *
+ * Tests L1PTEs as they are modified, looking for when they start to (or
+ * cease to) point to frame buffer pages.  If the old and new gfns differ,
+ * calls dirty_vram_range_update() to updates the dirty_vram structures.
+ */
+static inline void shadow_vram_fix_l1e(shadow_l1e_t old_sl1e,
+                                       shadow_l1e_t new_sl1e,
                                        shadow_l1e_t *sl1e,
                                        mfn_t sl1mfn,
                                        struct domain *d)
 { 
-    mfn_t mfn = shadow_l1e_get_mfn(new_sl1e);
-    int flags = shadow_l1e_get_flags(new_sl1e);
-    unsigned long gfn;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    mfn_t new_mfn, old_mfn;
+    unsigned long new_gfn = INVALID_M2P_ENTRY, old_gfn = INVALID_M2P_ENTRY;
+    paddr_t sl1ma;
+    dv_dirty_vram_t *dirty_vram = d->arch.hvm_domain.dirty_vram;
 
-    if ( !dirty_vram         /* tracking disabled? */
-         || !(flags & _PAGE_RW) /* read-only mapping? */
-         || !mfn_valid(mfn) )   /* mfn can be invalid in mmio_direct */
+    if ( !dirty_vram )
         return;
 
-    gfn = mfn_to_gfn(d, mfn);
-    /* Page sharing not supported on shadow PTs */
-    BUG_ON(SHARED_M2P(gfn));
+    sl1ma = pfn_to_paddr(mfn_x(sl1mfn)) | ((unsigned long)sl1e & ~PAGE_MASK);
 
-    if ( (gfn >= dirty_vram->begin_pfn) && (gfn < dirty_vram->end_pfn) )
+    old_mfn = shadow_l1e_get_mfn(old_sl1e);
+
+    if ( !sh_l1e_is_magic(old_sl1e) &&
+         (l1e_get_flags(old_sl1e) & _PAGE_PRESENT) &&
+         mfn_valid(old_mfn))
     {
-        unsigned long i = gfn - dirty_vram->begin_pfn;
-        struct page_info *page = mfn_to_page(mfn);
-        
-        if ( (page->u.inuse.type_info & PGT_count_mask) == 1 )
-            /* Initial guest reference, record it */
-            dirty_vram->sl1ma[i] = pfn_to_paddr(mfn_x(sl1mfn))
-                | ((unsigned long)sl1e & ~PAGE_MASK);
+        old_gfn = mfn_to_gfn(d, old_mfn);
     }
-}
-
-static inline void shadow_vram_put_l1e(shadow_l1e_t old_sl1e,
-                                       shadow_l1e_t *sl1e,
-                                       mfn_t sl1mfn,
-                                       struct domain *d)
-{
-    mfn_t mfn = shadow_l1e_get_mfn(old_sl1e);
-    int flags = shadow_l1e_get_flags(old_sl1e);
-    unsigned long gfn;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram         /* tracking disabled? */
-         || !(flags & _PAGE_RW) /* read-only mapping? */
-         || !mfn_valid(mfn) )   /* mfn can be invalid in mmio_direct */
-        return;
-
-    gfn = mfn_to_gfn(d, mfn);
-    /* Page sharing not supported on shadow PTs */
-    BUG_ON(SHARED_M2P(gfn));
-
-    if ( (gfn >= dirty_vram->begin_pfn) && (gfn < dirty_vram->end_pfn) )
+    
+    new_mfn = shadow_l1e_get_mfn(new_sl1e);
+    if ( !sh_l1e_is_magic(new_sl1e) &&
+         (l1e_get_flags(new_sl1e) & _PAGE_PRESENT) &&
+         mfn_valid(new_mfn))
     {
-        unsigned long i = gfn - dirty_vram->begin_pfn;
-        struct page_info *page = mfn_to_page(mfn);
-        int dirty = 0;
-        paddr_t sl1ma = pfn_to_paddr(mfn_x(sl1mfn))
-            | ((unsigned long)sl1e & ~PAGE_MASK);
+        new_gfn = mfn_to_gfn(d, new_mfn);
+    }
 
-        if ( (page->u.inuse.type_info & PGT_count_mask) == 1 )
-        {
-            /* Last reference */
-            if ( dirty_vram->sl1ma[i] == INVALID_PADDR ) {
-                /* We didn't know it was that one, let's say it is dirty */
-                dirty = 1;
-            }
-            else
-            {
-                ASSERT(dirty_vram->sl1ma[i] == sl1ma);
-                dirty_vram->sl1ma[i] = INVALID_PADDR;
-                if ( flags & _PAGE_DIRTY )
-                    dirty = 1;
-            }
-        }
-        else
+    if ( old_gfn == new_gfn ) return;
+
+    if ( VALID_M2P(old_gfn) )
+        if ( dirty_vram_range_update(d, old_gfn, sl1ma, 0/*clear*/) )
         {
-            /* We had more than one reference, just consider the page dirty. */
-            dirty = 1;
-            /* Check that it's not the one we recorded. */
-            if ( dirty_vram->sl1ma[i] == sl1ma )
-            {
-                /* Too bad, we remembered the wrong one... */
-                dirty_vram->sl1ma[i] = INVALID_PADDR;
-            }
-            else
-            {
-                /* Ok, our recorded sl1e is still pointing to this page, let's
-                 * just hope it will remain. */
-            }
+            SHADOW_PRINTK("gfn %lx (mfn %lx) cleared vram pte\n",
+                          old_gfn, mfn_x(old_mfn));
         }
-        if ( dirty )
+
+    if ( VALID_M2P(new_gfn) )
+        if ( dirty_vram_range_update(d, new_gfn, sl1ma, 1/*set*/) )
         {
-            dirty_vram->dirty_bitmap[i / 8] |= 1 << (i % 8);
-            dirty_vram->last_dirty = NOW();
+            SHADOW_PRINTK("gfn %lx (mfn %lx) set vram pte\n",
+                          new_gfn, mfn_x(new_mfn));
         }
-    }
 }
 
 static int shadow_set_l1e(struct vcpu *v, 
@@ -1211,12 +1167,13 @@ static int shadow_set_l1e(struct vcpu *v,
                 shadow_l1e_remove_flags(new_sl1e, _PAGE_RW);
                 /* fall through */
             case 0:
-                shadow_vram_get_l1e(new_sl1e, sl1e, sl1mfn, d);
                 break;
             }
         }
     } 
 
+    shadow_vram_fix_l1e(old_sl1e, new_sl1e, sl1e, sl1mfn, d);
+
     /* Write the new entry */
     shadow_write_entries(sl1e, &new_sl1e, 1, sl1mfn);
     flags |= SHADOW_SET_CHANGED;
@@ -1231,7 +1188,6 @@ static int shadow_set_l1e(struct vcpu *v,
          * trigger a flush later. */
         if ( shadow_mode_refcounts(d) ) 
         {
-            shadow_vram_put_l1e(old_sl1e, sl1e, sl1mfn, d);
             shadow_put_page_from_l1e(old_sl1e, d);
             TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_SHADOW_L1_PUT_REF);
         } 
@@ -2018,7 +1974,6 @@ void sh_destroy_l1_shadow(struct vcpu *v, mfn_t smfn)
         SHADOW_FOREACH_L1E(sl1mfn, sl1e, 0, 0, {
             if ( (shadow_l1e_get_flags(*sl1e) & _PAGE_PRESENT)
                  && !sh_l1e_is_magic(*sl1e) ) {
-                shadow_vram_put_l1e(*sl1e, sl1e, sl1mfn, d);
                 shadow_put_page_from_l1e(*sl1e, d);
             }
         });
@@ -4336,6 +4291,37 @@ int sh_rm_mappings_from_l1(struct vcpu *v, mfn_t sl1mfn, mfn_t target_mfn)
     return done;
 }
 
+
+int sh_find_vram_mappings_in_l1(struct vcpu *v,
+                                mfn_t sl1mfn,
+                                unsigned long begin_pfn,
+                                unsigned long end_pfn,
+                                int *removed)
+/* Find all VRAM mappings in this shadow l1 table */
+{
+    struct domain *d = v->domain;
+    shadow_l1e_t *sl1e;
+    int done = 0;
+
+    /* only returns _PAGE_PRESENT entries */
+    SHADOW_FOREACH_L1E(sl1mfn, sl1e, 0, done, 
+    {
+        unsigned long gfn;
+        mfn_t gmfn = shadow_l1e_get_mfn(*sl1e);
+        if ( !mfn_valid(gmfn) )
+            continue;
+        gfn = mfn_to_gfn(d, gmfn);
+        if ( VALID_M2P(gfn) && (begin_pfn <= gfn) && (gfn < end_pfn) ) 
+        {
+            paddr_t sl1ma =
+                pfn_to_paddr(mfn_x(sl1mfn)) |
+                ( (unsigned long)sl1e & ~PAGE_MASK );
+            dirty_vram_range_update(v->domain, gfn, sl1ma, 1/*set*/);
+        }
+    });
+    return 0;
+}
+
 /**************************************************************************/
 /* Functions to excise all pointers to shadows from higher-level shadows. */
 
diff --git a/xen/arch/x86/mm/shadow/multi.h b/xen/arch/x86/mm/shadow/multi.h
index 835121e..436a4ac 100644
--- a/xen/arch/x86/mm/shadow/multi.h
+++ b/xen/arch/x86/mm/shadow/multi.h
@@ -66,7 +66,12 @@ SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, GUEST_LEVELS)
 extern int
 SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, GUEST_LEVELS)
     (struct vcpu *v, mfn_t sl1mfn, mfn_t target_mfn);
-
+extern int
+SHADOW_INTERNAL_NAME(sh_find_vram_mappings_in_l1, GUEST_LEVELS)
+     (struct vcpu *v, mfn_t sl1mfn, 
+      unsigned long begin_pfn,
+      unsigned long end_pfn,
+      int *removed);
 extern void
 SHADOW_INTERNAL_NAME(sh_clear_shadow_entry, GUEST_LEVELS)
     (struct vcpu *v, void *ep, mfn_t smfn);
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index 43ce1db..5b0f9f7 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -229,6 +229,7 @@ static inline shadow_l4e_t shadow_l4e_from_mfn(mfn_t mfn, u32 flags)
 #define sh_update_cr3              INTERNAL_NAME(sh_update_cr3)
 #define sh_rm_write_access_from_l1 INTERNAL_NAME(sh_rm_write_access_from_l1)
 #define sh_rm_mappings_from_l1     INTERNAL_NAME(sh_rm_mappings_from_l1)
+#define sh_find_vram_mappings_in_l1 INTERNAL_NAME(sh_find_vram_mappings_in_l1)
 #define sh_remove_l1_shadow        INTERNAL_NAME(sh_remove_l1_shadow)
 #define sh_remove_l2_shadow        INTERNAL_NAME(sh_remove_l2_shadow)
 #define sh_remove_l3_shadow        INTERNAL_NAME(sh_remove_l3_shadow)
diff --git a/xen/include/asm-x86/dirty_vram.h b/xen/include/asm-x86/dirty_vram.h
new file mode 100644
index 0000000..b107d0e
--- /dev/null
+++ b/xen/include/asm-x86/dirty_vram.h
@@ -0,0 +1,202 @@
+/****************************************************************************
+ * include/asm-x86/dirty_vram.h
+ *
+ * Interface for tracking dirty VRAM pages
+ *
+ * Copyright (c) 2012 Citrix Systems, Inc. (Robert Phillips)
+ * Parts of this code are Copyright (c) 2007 Advanced Micro Devices (Wei Huang)
+ * Parts of this code are Copyright (c) 2006 by XenSource Inc.
+ * Parts of this code are Copyright (c) 2006 by Michael A Fetterman
+ * Parts based on earlier work by Michael A Fetterman, Ian Pratt et al.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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
+ */
+
+#ifndef _DIRTY_VRAM_H
+#define _DIRTY_VRAM_H
+
+/*
+ * In shadow mode we need to bookkeep all the L1 page table entries that
+ * map a frame buffer page.  Struct dv_paddr_link does this by
+ * recording the address of a L1 page table entry for some frame buffer page.
+ * Also has a link to additional pl entries if the frame buffer page
+ * has multiple mappings.
+ * In practice very few pages have multiple mappings.
+ * But to rule out some pathological situation, we limit the number of
+ * mappings we're willing to bookkeep.
+ */
+
+#define DV_ADDR_LINK_LIST_LIMIT 20
+
+typedef struct dv_paddr_link {
+    paddr_t sl1ma;
+    struct dv_paddr_link *pl_next;
+} dv_paddr_link_t;
+
+typedef struct dv_pl_entry {
+    dv_paddr_link_t mapping;
+    bool_t stuck_dirty;
+} dv_pl_entry_t;
+
+/*
+ * This defines an extension page of pl entries for FB pages with multiple
+ * mappings. All such pages (of a domain) are linked together.
+ */
+typedef struct dv_paddr_link_ext {
+    struct list_head ext_link;
+    dv_paddr_link_t entries[ ( PAGE_SIZE - sizeof( struct list_head ) ) /
+                             sizeof( dv_paddr_link_t ) ];
+} dv_paddr_link_ext_t;
+
+/*
+ * This defines a single frame buffer range.  It bookkeeps all the
+ * level 1 PTEs that map guest pages within that range.
+ * All such ranges (of a domain) are linked together.
+ */
+typedef struct dv_range {
+    struct list_head range_link; /* the several ranges form a linked list */
+    unsigned long begin_pfn;
+    unsigned long end_pfn;
+    dv_pl_entry_t *pl_tab; /* table has 1 pl entry per pfn in range */
+    int nr_mappings;  /* total number of mappings in this range */
+    int mappings_hwm; /* high water mark of max mapping count */
+    unsigned int dirty_count;
+} dv_range_t;
+
+/*
+ * This contains all the data structures required by a domain to
+ * bookkeep the dirty pages within its frame buffers.
+ */
+typedef struct dv_dirty_vram {
+    struct list_head range_head; /* head of the linked list of ranges */
+    struct list_head ext_head; /* head of list of extension pages */
+    dv_paddr_link_t *pl_free; /* free list of pl's within extension pages */
+    int nr_ranges; /* bookkeeps number of ranges */
+    int ranges_hwm; /* high water mark of max number of ranges */
+} dv_dirty_vram_t;
+
+/* Allocates domain's dirty_vram structure */
+dv_dirty_vram_t *
+dirty_vram_alloc(struct domain *d);
+
+/*
+ * Returns domain's dirty_vram structure,
+ * allocating it if necessary
+ */
+dv_dirty_vram_t *
+dirty_vram_find_or_alloc(struct domain *d);
+
+/* Frees domain's dirty_vram structure */
+void dirty_vram_free(struct domain *d);
+
+/* Returns dirty vram range containing gfn, NULL if none */
+struct dv_range *
+dirty_vram_range_find_gfn(struct domain *d,
+                          unsigned long gfn);
+
+/*
+ * Returns dirty vram range matching [ begin_pfn .. begin_pfn+nr ),
+ * NULL if none
+ */
+dv_range_t *
+dirty_vram_range_find(struct domain *d,
+                      unsigned long begin_pfn,
+                      unsigned long nr);
+
+/*
+ * Allocate dirty vram range containing [ begin_pfn .. begin_pfn+nr ),
+ * freeing any existing range that overlaps the new range.
+ */
+dv_range_t *
+dirty_vram_range_alloc(struct domain *d,
+                       unsigned long begin_pfn,
+                       unsigned long nr);
+
+/*
+ * Returns dirty vram range matching [ begin_pfn .. begin_pfn+nr ),
+ * creating a range if none already exists and
+ * freeing any existing range that overlaps the new range.
+ */
+dv_range_t *
+dirty_vram_range_find_or_alloc(struct domain *d,
+                               unsigned long begin_pfn,
+                               unsigned long nr);
+
+void dirty_vram_range_free(struct domain *d,
+                           dv_range_t *range);
+
+/* Bookkeep PTE address of a frame buffer page */
+int dirty_vram_range_update(struct domain *d,
+                            unsigned long gfn,
+                            paddr_t sl1ma,
+                            int set);
+
+/*
+ * smfn is no longer a shadow page.  Remove it from any
+ * dirty vram range mapping.
+ */
+void
+dirty_vram_delete_shadow(struct vcpu *v,
+                         unsigned long gfn,
+                         unsigned int shadow_type,
+                         mfn_t smfn);
+
+
+/*
+ * Scan all the L1 tables looking for VRAM mappings.
+ * Record them in the domain's dv_dirty_vram structure
+ */
+void sh_find_all_vram_mappings(struct vcpu *v,
+                               dv_range_t *range);
+
+/*
+ * Free a paddr_link struct, given address of its
+ * predecessor in singly-linked list
+ */
+dv_paddr_link_t *
+free_paddr_link(struct domain *d,
+                dv_paddr_link_t **ppl,
+                dv_paddr_link_t *pl);
+
+
+/* Enable VRAM dirty tracking. */
+int
+shadow_track_dirty_vram(struct domain *d,
+			unsigned long first_pfn,
+			unsigned long nr,
+			XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+
+int
+hap_track_dirty_vram(struct domain *d,
+		     unsigned long begin_pfn,
+		     unsigned long nr,
+		     XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+
+void
+hap_clean_vram_tracking_range(struct domain *d,
+			      unsigned long begin_pfn,
+			      unsigned long nr,
+			      uint8_t *dirty_bitmap);
+
+#endif /* _DIRTY_VRAM_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-x86/hap.h b/xen/include/asm-x86/hap.h
index 916a35b..3e3a1f5 100644
--- a/xen/include/asm-x86/hap.h
+++ b/xen/include/asm-x86/hap.h
@@ -57,10 +57,6 @@ void  hap_final_teardown(struct domain *d);
 void  hap_teardown(struct domain *d);
 void  hap_vcpu_init(struct vcpu *v);
 void  hap_logdirty_init(struct domain *d);
-int   hap_track_dirty_vram(struct domain *d,
-                           unsigned long begin_pfn,
-                           unsigned long nr,
-                           XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
 
 extern const struct paging_mode *hap_paging_get_mode(struct vcpu *);
 
diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h
index 27b3de5..6146542 100644
--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -74,7 +74,7 @@ struct hvm_domain {
     struct list_head       pinned_cacheattr_ranges;
 
     /* VRAM dirty support. */
-    struct sh_dirty_vram *dirty_vram;
+    struct dv_dirty_vram * dirty_vram;
 
     /* If one of vcpus of this domain is in no_fill_mode or
      * mtrr/pat between vcpus is not the same, set is_in_uc_mode
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 9a40f2c..e7d4cb3 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -137,10 +137,10 @@ struct paging_mode {
 void paging_free_log_dirty_bitmap(struct domain *d);
 
 /* get the dirty bitmap for a specific range of pfns */
-int paging_log_dirty_range(struct domain *d,
-                           unsigned long begin_pfn,
-                           unsigned long nr,
-                           XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+void paging_log_dirty_range(struct domain *d,
+                            unsigned long begin_pfn,
+                            unsigned long nr,
+                            uint8_t *dirty_bitmap);
 
 /* enable log dirty */
 int paging_log_dirty_enable(struct domain *d);
@@ -154,9 +154,13 @@ void paging_log_dirty_init(struct domain *d,
                            int  (*disable_log_dirty)(struct domain *d),
                            void (*clean_dirty_bitmap)(struct domain *d));
 
-/* mark a page as dirty */
+/* mark a page as dirty, a wrapper around mark a page as dirty */
 void paging_mark_dirty(struct domain *d, unsigned long guest_mfn);
 
+/* mark a page as dirty */
+void paging_mark_dirty_gpfn(struct domain *d, unsigned long gpfn);
+
+
 /* is this guest page dirty? 
  * This is called from inside paging code, with the paging lock held. */
 int paging_mfn_is_dirty(struct domain *d, mfn_t gmfn);
@@ -183,15 +187,6 @@ int paging_mfn_is_dirty(struct domain *d, mfn_t gmfn);
 #define L4_LOGDIRTY_IDX(pfn) 0
 #endif
 
-/* VRAM dirty tracking support */
-struct sh_dirty_vram {
-    unsigned long begin_pfn;
-    unsigned long end_pfn;
-    paddr_t *sl1ma;
-    uint8_t *dirty_bitmap;
-    s_time_t last_dirty;
-};
-
 /*****************************************************************************
  * Entry points into the paging-assistance code */
 
diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
index 2eb6efc..940d7fd 100644
--- a/xen/include/asm-x86/shadow.h
+++ b/xen/include/asm-x86/shadow.h
@@ -62,12 +62,6 @@ void shadow_vcpu_init(struct vcpu *v);
 /* Enable an arbitrary shadow mode.  Call once at domain creation. */
 int shadow_enable(struct domain *d, u32 mode);
 
-/* Enable VRAM dirty bit tracking. */
-int shadow_track_dirty_vram(struct domain *d,
-                            unsigned long first_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
-
 /* Handler for shadow control ops: operations from user-space to enable
  * and disable ephemeral shadow modes (test mode and log-dirty mode) and
  * manipulate the log-dirty bitmap. */
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:54:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:54:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdNUj-0003qr-JK; Tue, 27 Nov 2012 15:54:45 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdNUi-0003qd-6T
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:54:44 +0000
Received: from [85.158.137.99:50933] by server-10.bemta-3.messagelabs.com id
	B2/0D-19806-342E4B05; Tue, 27 Nov 2012 15:54:43 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1354031681!14002736!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ3Mzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28074 invoked from network); 27 Nov 2012 15:54:42 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 15:54:42 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="45758857"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 15:54:40 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:54:40 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TdNUe-00008E-6K;
	Tue, 27 Nov 2012 15:54:40 +0000
MIME-Version: 1.0
X-Mercurial-Node: 1c8fa0e2583b409ca7d45cefa9eaff0127c28ee9
Message-ID: <1c8fa0e2583b409ca7d4.1354031680@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 27 Nov 2012 15:54:40 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Lars Kurth <lars.kurth.xen@gmail.com>, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: [Xen-devel] [PATCH] MAINTAINERS: Reference stable maintenance policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1354031669 0
# Node ID 1c8fa0e2583b409ca7d45cefa9eaff0127c28ee9
# Parent  ae6fb202b233af815466055d9f1a635802a50855
MAINTAINERS: Reference stable maintenance policy

I also couldn't resist fixing a typo and adding a reference to
http://wiki.xen.org/wiki/Submitting_Xen_Patches for the normal case as
well.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r ae6fb202b233 -r 1c8fa0e2583b MAINTAINERS
--- a/MAINTAINERS	Tue Nov 20 08:58:31 2012 +0100
+++ b/MAINTAINERS	Tue Nov 27 15:54:29 2012 +0000
@@ -1,5 +1,6 @@
 
 	List of maintainers and how to submit changes
+	=============================================
 
 Please try to follow the guidelines below.  This will make things
 easier on the maintainers.  Not all of these guidelines matter for every
@@ -15,7 +16,11 @@ 3.	Make a patch available to the relevan
 	'diff -u' to make the patch easy to merge. Be prepared to get your
 	changes sent back with seemingly silly requests about formatting
 	and variable names.  These aren't as silly as they seem. One
-	job the maintainersdo is to keep things looking the same.
+	job the maintainers do is to keep things looking the same.
+
+	PLEASE see http://wiki.xen.org/wiki/Submitting_Xen_Patches for
+	hints on how to submit a patch to xen-unstable in a suitable
+	form.
 
 	PLEASE try to include any credit lines you want added with the
 	patch. It avoids people being missed off by mistake and makes
@@ -34,6 +39,23 @@ 4.	Make sure you have the right to send 
 
 5.	Happy hacking.
 
+
+	Stable Release Maintenance
+	==========================
+
+The policy for inclusion in a Xen stable release is different to that
+for inclusion in xen-unstable.
+
+Please see http://wiki.xen.org/wiki/Xen_Maintenance_Releases for more
+information.
+
+Remember to copy the appropriate stable branch maintainer who will be
+listed in this section of the MAINTAINERS file in the appropriate
+branch.
+
+	Unstable Subsystem Maintainers
+	==============================
+
 Descriptions of section entries:
 
 	M: Mail patches to: FullName <address@domain>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:54:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:54:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdNUj-0003qr-JK; Tue, 27 Nov 2012 15:54:45 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdNUi-0003qd-6T
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:54:44 +0000
Received: from [85.158.137.99:50933] by server-10.bemta-3.messagelabs.com id
	B2/0D-19806-342E4B05; Tue, 27 Nov 2012 15:54:43 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1354031681!14002736!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ3Mzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28074 invoked from network); 27 Nov 2012 15:54:42 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 15:54:42 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="45758857"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 15:54:40 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 10:54:40 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TdNUe-00008E-6K;
	Tue, 27 Nov 2012 15:54:40 +0000
MIME-Version: 1.0
X-Mercurial-Node: 1c8fa0e2583b409ca7d45cefa9eaff0127c28ee9
Message-ID: <1c8fa0e2583b409ca7d4.1354031680@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 27 Nov 2012 15:54:40 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Lars Kurth <lars.kurth.xen@gmail.com>, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: [Xen-devel] [PATCH] MAINTAINERS: Reference stable maintenance policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1354031669 0
# Node ID 1c8fa0e2583b409ca7d45cefa9eaff0127c28ee9
# Parent  ae6fb202b233af815466055d9f1a635802a50855
MAINTAINERS: Reference stable maintenance policy

I also couldn't resist fixing a typo and adding a reference to
http://wiki.xen.org/wiki/Submitting_Xen_Patches for the normal case as
well.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r ae6fb202b233 -r 1c8fa0e2583b MAINTAINERS
--- a/MAINTAINERS	Tue Nov 20 08:58:31 2012 +0100
+++ b/MAINTAINERS	Tue Nov 27 15:54:29 2012 +0000
@@ -1,5 +1,6 @@
 
 	List of maintainers and how to submit changes
+	=============================================
 
 Please try to follow the guidelines below.  This will make things
 easier on the maintainers.  Not all of these guidelines matter for every
@@ -15,7 +16,11 @@ 3.	Make a patch available to the relevan
 	'diff -u' to make the patch easy to merge. Be prepared to get your
 	changes sent back with seemingly silly requests about formatting
 	and variable names.  These aren't as silly as they seem. One
-	job the maintainersdo is to keep things looking the same.
+	job the maintainers do is to keep things looking the same.
+
+	PLEASE see http://wiki.xen.org/wiki/Submitting_Xen_Patches for
+	hints on how to submit a patch to xen-unstable in a suitable
+	form.
 
 	PLEASE try to include any credit lines you want added with the
 	patch. It avoids people being missed off by mistake and makes
@@ -34,6 +39,23 @@ 4.	Make sure you have the right to send 
 
 5.	Happy hacking.
 
+
+	Stable Release Maintenance
+	==========================
+
+The policy for inclusion in a Xen stable release is different to that
+for inclusion in xen-unstable.
+
+Please see http://wiki.xen.org/wiki/Xen_Maintenance_Releases for more
+information.
+
+Remember to copy the appropriate stable branch maintainer who will be
+listed in this section of the MAINTAINERS file in the appropriate
+branch.
+
+	Unstable Subsystem Maintainers
+	==============================
+
 Descriptions of section entries:
 
 	M: Mail patches to: FullName <address@domain>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:59:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:59:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdNZL-00047O-GJ; Tue, 27 Nov 2012 15:59:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <robert.phillips@citrix.com>) id 1TdNZJ-00047H-W4
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:59:30 +0000
Received: from [193.109.254.147:27629] by server-1.bemta-14.messagelabs.com id
	4A/05-25314-163E4B05; Tue, 27 Nov 2012 15:59:29 +0000
X-Env-Sender: robert.phillips@citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1354031963!2863353!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31327 invoked from network); 27 Nov 2012 15:59:25 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 15:59:25 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215614010"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 15:59:23 +0000
Received: from FTLPMAILBOX02.citrite.net ([10.13.98.209]) by
	FTLPMAILMX02.citrite.net ([10.13.107.66]) with mapi; Tue, 27 Nov 2012
	10:59:23 -0500
From: Robert Phillips <robert.phillips@citrix.com>
To: "Tim (Xen.org)" <tim@xen.org>
Date: Tue, 27 Nov 2012 10:58:59 -0500
Thread-Topic: [Xen-devel] [PATCH] Provide support for multiple frame buffers
	in Xen
Thread-Index: Ac3DNFX5J8zQU2vnSVqGZuymYwiQ+AJgyYQg
Message-ID: <048EAD622912254A9DEA24C1734613C18C87A63104@FTLPMAILBOX02.citrite.net>
References: <1352755913-4229-1-git-send-email-robert.phillips@citrix.com>
	<20121115132249.GC75988@ocelot.phlegethon.org>
In-Reply-To: <20121115132249.GC75988@ocelot.phlegethon.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
 in Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

The updated patch was sent out just a few minutes ago.


> -----Original Message-----
> From: Tim Deegan [mailto:tim@xen.org]
> Sent: Thursday, November 15, 2012 8:23 AM
> To: Robert Phillips
> Cc: xen-devel@lists.xen.org
> Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
> in Xen
> 
> Hi,
> 
> We're very nearly there now.  I think I agree on almost all the technical
> decisions but there are still a few things to tidy up (some of which I
> mentioned before).
> 
> At 16:31 -0500 on 12 Nov (1352737913), Robert Phillips wrote:
> > Support is provided for both shadow and hardware assisted paging (HAP)
> modes.
> > This code bookkeeps the set of video frame buffers (vram), detects
> > when the guest has modified any of those buffers and, upon request,
> > returns a bitmap of the modified pages.
> > This lets other software components re-paint the portions of the monitor
> (or monitors) that have changed.
> > Each monitor has a frame buffer of some size at some position in guest
> physical memory.
> > The set of frame buffers being tracked can change over time as monitors
> are plugged and unplugged.
> > (Version 3 of this patch.)
> 
> Please linewrap at something less than 80 characters.

Done

> 
> > diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile
> > index eea5555..e374aac 100644
> > --- a/xen/arch/x86/hvm/Makefile
> > +++ b/xen/arch/x86/hvm/Makefile
> > @@ -22,4 +22,4 @@ obj-y += vlapic.o
> >  obj-y += vmsi.o
> >  obj-y += vpic.o
> >  obj-y += vpt.o
> > -obj-y += vpmu.o
> > \ No newline at end of file
> > +obj-y += vpmu.o
> 
> This is an unrelated fix, so doesn't belong in this changeset.

Removed

> 
> > diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index
> > 34da2f5..3a3e5e4 100644
> > --- a/xen/arch/x86/hvm/hvm.c
> > +++ b/xen/arch/x86/hvm/hvm.c
> > @@ -57,6 +57,7 @@
> >  #include <asm/hvm/cacheattr.h>
> >  #include <asm/hvm/trace.h>
> >  #include <asm/hvm/nestedhvm.h>
> > +#include <asm/dirty_vram.h>
> >  #include <asm/mtrr.h>
> >  #include <asm/apic.h>
> >  #include <public/sched.h>
> > @@ -66,6 +67,7 @@
> >  #include <asm/mem_event.h>
> >  #include <asm/mem_access.h>
> >  #include <public/mem_event.h>
> > +#include "../mm/mm-locks.h"
> >
> >  bool_t __read_mostly hvm_enabled;
> >
> > @@ -1433,8 +1435,20 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
> >           */
> >          if ( access_w )
> >          {
> > +            p2m_type_t pt;
> > +            pt = p2m_change_type(v->domain, gfn, p2m_ram_logdirty,
> > + p2m_ram_rw);
> > +
> > +            paging_lock(v->domain);
> > +            if ( pt == p2m_ram_logdirty )
> > +            {
> > +                dv_range_t *range;
> > +                v->domain->arch.paging.log_dirty.dirty_count++;
> > +                range = dirty_vram_range_find_gfn(v->domain, gfn);
> > +                if ( range )
> > +                    range->dirty_count++;
> > +            }
> >              paging_mark_dirty(v->domain, mfn_x(mfn));
> > -            p2m_change_type(v->domain, gfn, p2m_ram_logdirty,
> p2m_ram_rw);
> > +            paging_unlock(v->domain);
> 
> This is much nicer than the previous version, but I think it would be even
> better if this bookkeeping went into paging_mark_dirty() so that the other
> callers of paging_mark_dirty() also DTRT with the vram map.
> That would avoid leaking mm-locks.h into this non-mm code, too.
> 
> Then this change becomes just swapping the order of the two lines (and
> perhaps a comment to say why).

Done.  I had to split paging_mark_dirty() into two functions -- the old function does the gfn-to-mfn translation and then calls the new function paging_mark_dirty_gpfn() which does the heavy lifiting.  
The code above now calls the new function thereby bypassing the gfn-to-mfn translation.

> 
> > diff --git a/xen/arch/x86/mm/dirty_vram.c
> > b/xen/arch/x86/mm/dirty_vram.c new file mode 100644 index
> > 0000000..e3c7c1f
> > --- /dev/null
> > +++ b/xen/arch/x86/mm/dirty_vram.c
> > @@ -0,0 +1,992 @@
> > +/*
> > + * arch/x86/mm/dirty_vram.c: Bookkeep/query dirty VRAM pages
> > + * with support for multiple frame buffers.
> > + *
> > + * Copyright (c) 2012, Citrix Systems, Inc. (Robert Phillips)
> 
> Please bring in the copyright and authorship notices for the files you copied
> code from.  That's at least mm/shadow/common.c and mm/hap/hap.c.

Done

> 
> Apart from that this is looking good.
> 
> Are you willing to take on maintainership of this feature (that is, to respond
> to questions and fix bugs)? 

Yes

 >If so, we should make an update to the
> MAINTAINERS file for xen/arch/x86/mm/dirty_vram.c and xen/include/asm-
> x86/dirty_vram.h.  That can happen separately, as it'll need an ack from the
> other maintainers.
> 
> Cheers,
> 
> Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 15:59:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 15:59:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdNZL-00047O-GJ; Tue, 27 Nov 2012 15:59:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <robert.phillips@citrix.com>) id 1TdNZJ-00047H-W4
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 15:59:30 +0000
Received: from [193.109.254.147:27629] by server-1.bemta-14.messagelabs.com id
	4A/05-25314-163E4B05; Tue, 27 Nov 2012 15:59:29 +0000
X-Env-Sender: robert.phillips@citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1354031963!2863353!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31327 invoked from network); 27 Nov 2012 15:59:25 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 15:59:25 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215614010"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 15:59:23 +0000
Received: from FTLPMAILBOX02.citrite.net ([10.13.98.209]) by
	FTLPMAILMX02.citrite.net ([10.13.107.66]) with mapi; Tue, 27 Nov 2012
	10:59:23 -0500
From: Robert Phillips <robert.phillips@citrix.com>
To: "Tim (Xen.org)" <tim@xen.org>
Date: Tue, 27 Nov 2012 10:58:59 -0500
Thread-Topic: [Xen-devel] [PATCH] Provide support for multiple frame buffers
	in Xen
Thread-Index: Ac3DNFX5J8zQU2vnSVqGZuymYwiQ+AJgyYQg
Message-ID: <048EAD622912254A9DEA24C1734613C18C87A63104@FTLPMAILBOX02.citrite.net>
References: <1352755913-4229-1-git-send-email-robert.phillips@citrix.com>
	<20121115132249.GC75988@ocelot.phlegethon.org>
In-Reply-To: <20121115132249.GC75988@ocelot.phlegethon.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
 in Xen
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

The updated patch was sent out just a few minutes ago.


> -----Original Message-----
> From: Tim Deegan [mailto:tim@xen.org]
> Sent: Thursday, November 15, 2012 8:23 AM
> To: Robert Phillips
> Cc: xen-devel@lists.xen.org
> Subject: Re: [Xen-devel] [PATCH] Provide support for multiple frame buffers
> in Xen
> 
> Hi,
> 
> We're very nearly there now.  I think I agree on almost all the technical
> decisions but there are still a few things to tidy up (some of which I
> mentioned before).
> 
> At 16:31 -0500 on 12 Nov (1352737913), Robert Phillips wrote:
> > Support is provided for both shadow and hardware assisted paging (HAP)
> modes.
> > This code bookkeeps the set of video frame buffers (vram), detects
> > when the guest has modified any of those buffers and, upon request,
> > returns a bitmap of the modified pages.
> > This lets other software components re-paint the portions of the monitor
> (or monitors) that have changed.
> > Each monitor has a frame buffer of some size at some position in guest
> physical memory.
> > The set of frame buffers being tracked can change over time as monitors
> are plugged and unplugged.
> > (Version 3 of this patch.)
> 
> Please linewrap at something less than 80 characters.

Done

> 
> > diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile
> > index eea5555..e374aac 100644
> > --- a/xen/arch/x86/hvm/Makefile
> > +++ b/xen/arch/x86/hvm/Makefile
> > @@ -22,4 +22,4 @@ obj-y += vlapic.o
> >  obj-y += vmsi.o
> >  obj-y += vpic.o
> >  obj-y += vpt.o
> > -obj-y += vpmu.o
> > \ No newline at end of file
> > +obj-y += vpmu.o
> 
> This is an unrelated fix, so doesn't belong in this changeset.

Removed

> 
> > diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index
> > 34da2f5..3a3e5e4 100644
> > --- a/xen/arch/x86/hvm/hvm.c
> > +++ b/xen/arch/x86/hvm/hvm.c
> > @@ -57,6 +57,7 @@
> >  #include <asm/hvm/cacheattr.h>
> >  #include <asm/hvm/trace.h>
> >  #include <asm/hvm/nestedhvm.h>
> > +#include <asm/dirty_vram.h>
> >  #include <asm/mtrr.h>
> >  #include <asm/apic.h>
> >  #include <public/sched.h>
> > @@ -66,6 +67,7 @@
> >  #include <asm/mem_event.h>
> >  #include <asm/mem_access.h>
> >  #include <public/mem_event.h>
> > +#include "../mm/mm-locks.h"
> >
> >  bool_t __read_mostly hvm_enabled;
> >
> > @@ -1433,8 +1435,20 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
> >           */
> >          if ( access_w )
> >          {
> > +            p2m_type_t pt;
> > +            pt = p2m_change_type(v->domain, gfn, p2m_ram_logdirty,
> > + p2m_ram_rw);
> > +
> > +            paging_lock(v->domain);
> > +            if ( pt == p2m_ram_logdirty )
> > +            {
> > +                dv_range_t *range;
> > +                v->domain->arch.paging.log_dirty.dirty_count++;
> > +                range = dirty_vram_range_find_gfn(v->domain, gfn);
> > +                if ( range )
> > +                    range->dirty_count++;
> > +            }
> >              paging_mark_dirty(v->domain, mfn_x(mfn));
> > -            p2m_change_type(v->domain, gfn, p2m_ram_logdirty,
> p2m_ram_rw);
> > +            paging_unlock(v->domain);
> 
> This is much nicer than the previous version, but I think it would be even
> better if this bookkeeping went into paging_mark_dirty() so that the other
> callers of paging_mark_dirty() also DTRT with the vram map.
> That would avoid leaking mm-locks.h into this non-mm code, too.
> 
> Then this change becomes just swapping the order of the two lines (and
> perhaps a comment to say why).

Done.  I had to split paging_mark_dirty() into two functions -- the old function does the gfn-to-mfn translation and then calls the new function paging_mark_dirty_gpfn() which does the heavy lifiting.  
The code above now calls the new function thereby bypassing the gfn-to-mfn translation.

> 
> > diff --git a/xen/arch/x86/mm/dirty_vram.c
> > b/xen/arch/x86/mm/dirty_vram.c new file mode 100644 index
> > 0000000..e3c7c1f
> > --- /dev/null
> > +++ b/xen/arch/x86/mm/dirty_vram.c
> > @@ -0,0 +1,992 @@
> > +/*
> > + * arch/x86/mm/dirty_vram.c: Bookkeep/query dirty VRAM pages
> > + * with support for multiple frame buffers.
> > + *
> > + * Copyright (c) 2012, Citrix Systems, Inc. (Robert Phillips)
> 
> Please bring in the copyright and authorship notices for the files you copied
> code from.  That's at least mm/shadow/common.c and mm/hap/hap.c.

Done

> 
> Apart from that this is looking good.
> 
> Are you willing to take on maintainership of this feature (that is, to respond
> to questions and fix bugs)? 

Yes

 >If so, we should make an update to the
> MAINTAINERS file for xen/arch/x86/mm/dirty_vram.c and xen/include/asm-
> x86/dirty_vram.h.  That can happen separately, as it'll need an ack from the
> other maintainers.
> 
> Cheers,
> 
> Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:02:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:02:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdNcC-0004h6-3w; Tue, 27 Nov 2012 16:02:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdNcA-0004h0-TI
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:02:27 +0000
Received: from [85.158.138.51:31118] by server-6.bemta-3.messagelabs.com id
	A3/FC-28265-114E4B05; Tue, 27 Nov 2012 16:02:25 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1354032143!23619031!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ3Mzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1217 invoked from network); 27 Nov 2012 16:02:24 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-3.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 16:02:24 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="45760024"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 16:01:42 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 11:01:41 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TdNbR-0000EJ-DM;
	Tue, 27 Nov 2012 16:01:41 +0000
MIME-Version: 1.0
X-Mercurial-Node: 5f1ad53a35724ee4b7d8500447f07c466987c56d
Message-ID: <5f1ad53a35724ee4b7d8.1354032101@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 27 Nov 2012 16:01:41 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Lars Kurth <lars.kurth.xen@gmail.com>, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: [Xen-devel] [PATCH STABLE] MAINTAINERS: Reference stable
	maintenance policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1354032095 0
# Node ID 5f1ad53a35724ee4b7d8500447f07c466987c56d
# Parent  5c5c695863f73bd6a9eccaaa96cf28800e50e840
MAINTAINERS: Reference stable maintenance policy

I also couldn't resist fixing a typo and adding a reference to
http://wiki.xen.org/wiki/Submitting_Xen_Patches for the normal case as
well.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
This version is for 4.2 and 4.1 and is modified from the unstable
version to mention Jan as maintainer of both branches.

diff -r 5c5c695863f7 -r 5f1ad53a3572 MAINTAINERS
--- a/MAINTAINERS	Tue Nov 27 13:25:17 2012 +0100
+++ b/MAINTAINERS	Tue Nov 27 16:01:35 2012 +0000
@@ -1,5 +1,6 @@
 
 	List of maintainers and how to submit changes
+	=============================================
 
 Please try to follow the guidelines below.  This will make things
 easier on the maintainers.  Not all of these guidelines matter for every
@@ -15,7 +16,11 @@ 3.	Make a patch available to the relevan
 	'diff -u' to make the patch easy to merge. Be prepared to get your
 	changes sent back with seemingly silly requests about formatting
 	and variable names.  These aren't as silly as they seem. One
-	job the maintainersdo is to keep things looking the same.
+	job the maintainers do is to keep things looking the same.
+
+	PLEASE see http://wiki.xen.org/wiki/Submitting_Xen_Patches for
+	hints on how to submit a patch to xen-unstable in a suitable
+	form.
 
 	PLEASE try to include any credit lines you want added with the
 	patch. It avoids people being missed off by mistake and makes
@@ -34,6 +39,28 @@ 4.	Make sure you have the right to send 
 
 5.	Happy hacking.
 
+
+	Stable Release Maintenance
+	==========================
+
+The policy for inclusion in a Xen stable release is different to that
+for inclusion in xen-unstable.
+
+Please see http://wiki.xen.org/wiki/Xen_Maintenance_Releases for more
+information.
+
+Remember to copy the stable branch maintainer. The maintainer for this
+branch is:
+
+	Jan Beulich <JBeulich@suse.com>
+
+Tools backport requests should also be copied to:
+
+	Ian Jackson <Ian.Jackson@eu.citrix.com>
+
+	Unstable Subsystem Maintainers
+	==============================
+
 Descriptions of section entries:
 
 	M: Mail patches to: FullName <address@domain>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:02:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:02:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdNcC-0004h6-3w; Tue, 27 Nov 2012 16:02:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdNcA-0004h0-TI
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:02:27 +0000
Received: from [85.158.138.51:31118] by server-6.bemta-3.messagelabs.com id
	A3/FC-28265-114E4B05; Tue, 27 Nov 2012 16:02:25 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1354032143!23619031!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODQ3Mzc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1217 invoked from network); 27 Nov 2012 16:02:24 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-3.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 16:02:24 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="45760024"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 16:01:42 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 11:01:41 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TdNbR-0000EJ-DM;
	Tue, 27 Nov 2012 16:01:41 +0000
MIME-Version: 1.0
X-Mercurial-Node: 5f1ad53a35724ee4b7d8500447f07c466987c56d
Message-ID: <5f1ad53a35724ee4b7d8.1354032101@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Tue, 27 Nov 2012 16:01:41 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: <xen-devel@lists.xen.org>
Cc: Lars Kurth <lars.kurth.xen@gmail.com>, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: [Xen-devel] [PATCH STABLE] MAINTAINERS: Reference stable
	maintenance policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1354032095 0
# Node ID 5f1ad53a35724ee4b7d8500447f07c466987c56d
# Parent  5c5c695863f73bd6a9eccaaa96cf28800e50e840
MAINTAINERS: Reference stable maintenance policy

I also couldn't resist fixing a typo and adding a reference to
http://wiki.xen.org/wiki/Submitting_Xen_Patches for the normal case as
well.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
This version is for 4.2 and 4.1 and is modified from the unstable
version to mention Jan as maintainer of both branches.

diff -r 5c5c695863f7 -r 5f1ad53a3572 MAINTAINERS
--- a/MAINTAINERS	Tue Nov 27 13:25:17 2012 +0100
+++ b/MAINTAINERS	Tue Nov 27 16:01:35 2012 +0000
@@ -1,5 +1,6 @@
 
 	List of maintainers and how to submit changes
+	=============================================
 
 Please try to follow the guidelines below.  This will make things
 easier on the maintainers.  Not all of these guidelines matter for every
@@ -15,7 +16,11 @@ 3.	Make a patch available to the relevan
 	'diff -u' to make the patch easy to merge. Be prepared to get your
 	changes sent back with seemingly silly requests about formatting
 	and variable names.  These aren't as silly as they seem. One
-	job the maintainersdo is to keep things looking the same.
+	job the maintainers do is to keep things looking the same.
+
+	PLEASE see http://wiki.xen.org/wiki/Submitting_Xen_Patches for
+	hints on how to submit a patch to xen-unstable in a suitable
+	form.
 
 	PLEASE try to include any credit lines you want added with the
 	patch. It avoids people being missed off by mistake and makes
@@ -34,6 +39,28 @@ 4.	Make sure you have the right to send 
 
 5.	Happy hacking.
 
+
+	Stable Release Maintenance
+	==========================
+
+The policy for inclusion in a Xen stable release is different to that
+for inclusion in xen-unstable.
+
+Please see http://wiki.xen.org/wiki/Xen_Maintenance_Releases for more
+information.
+
+Remember to copy the stable branch maintainer. The maintainer for this
+branch is:
+
+	Jan Beulich <JBeulich@suse.com>
+
+Tools backport requests should also be copied to:
+
+	Ian Jackson <Ian.Jackson@eu.citrix.com>
+
+	Unstable Subsystem Maintainers
+	==============================
+
 Descriptions of section entries:
 
 	M: Mail patches to: FullName <address@domain>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:27:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:27:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdO0K-00057k-UC; Tue, 27 Nov 2012 16:27:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdO0K-00057f-2d
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:27:24 +0000
Received: from [85.158.143.35:31328] by server-3.bemta-4.messagelabs.com id
	68/01-06841-BE9E4B05; Tue, 27 Nov 2012 16:27:23 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1354033642!10143237!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15355 invoked from network); 27 Nov 2012 16:27:22 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 16:27:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16029406"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 16:27:21 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 16:27:21 +0000
Message-ID: <1354033640.17985.67.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Lars Kurth <lars.kurth.xen@gmail.com>
Date: Tue, 27 Nov 2012 16:27:20 +0000
In-Reply-To: <1354030812.17985.65.camel@zakaz.uk.xensource.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<CAOqnZH4qVRoDCpaCGT3zuJu85t17XkuUJSoxBoMhXd95p9b5tg@mail.gmail.com>
	<1354030812.17985.65.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 15:40 +0000, Ian Campbell wrote:

> Lets do it in the stable branch version for now with a reference. I'll
> send out some patches.
[...]
> Final draft is below, incorporating your suggestions (which has meant
> substantial changes to a few paragraphs). I'm shortly going to be adding
> it to http://wiki.xen.org/wiki/Xen_Maintenance_Releases and fix up the
> formatting / links etc.

Both of these are now done.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:27:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:27:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdO0K-00057k-UC; Tue, 27 Nov 2012 16:27:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdO0K-00057f-2d
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:27:24 +0000
Received: from [85.158.143.35:31328] by server-3.bemta-4.messagelabs.com id
	68/01-06841-BE9E4B05; Tue, 27 Nov 2012 16:27:23 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1354033642!10143237!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15355 invoked from network); 27 Nov 2012 16:27:22 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 16:27:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16029406"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 16:27:21 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 16:27:21 +0000
Message-ID: <1354033640.17985.67.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Lars Kurth <lars.kurth.xen@gmail.com>
Date: Tue, 27 Nov 2012 16:27:20 +0000
In-Reply-To: <1354030812.17985.65.camel@zakaz.uk.xensource.com>
References: <1353945514.5830.89.camel@zakaz.uk.xensource.com>
	<CAOqnZH4qVRoDCpaCGT3zuJu85t17XkuUJSoxBoMhXd95p9b5tg@mail.gmail.com>
	<1354030812.17985.65.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [DOCDAY] Maintenance Release Policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 15:40 +0000, Ian Campbell wrote:

> Lets do it in the stable branch version for now with a reference. I'll
> send out some patches.
[...]
> Final draft is below, incorporating your suggestions (which has meant
> substantial changes to a few paragraphs). I'm shortly going to be adding
> it to http://wiki.xen.org/wiki/Xen_Maintenance_Releases and fix up the
> formatting / links etc.

Both of these are now done.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:33:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:33:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdO6A-0005Gh-OM; Tue, 27 Nov 2012 16:33:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TdO69-0005Gb-FZ
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:33:25 +0000
Received: from [85.158.139.211:45276] by server-14.bemta-5.messagelabs.com id
	3F/B9-21768-45BE4B05; Tue, 27 Nov 2012 16:33:24 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354034003!18094760!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11563 invoked from network); 27 Nov 2012 16:33:23 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 16:33:23 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TdO66-000Egs-AZ; Tue, 27 Nov 2012 16:33:22 +0000
Date: Tue, 27 Nov 2012 16:33:22 +0000
From: Tim Deegan <tim@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121127163322.GF51942@ocelot.phlegethon.org>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<1728fb78994054ad3695.1353948092@andrewcoop.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1728fb78994054ad3695.1353948092@andrewcoop.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Keir Fraser <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 1 of 5] rombios/keyboard: Don't needlessly
	poll the status register
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:41 +0000 on 26 Nov (1353948092), Andrew Cooper wrote:
> Repeated polling of the status register is not going to change its value, so
> don't needlessly take 8192 traps to Qemu when 1 will do.

AFAICS the purpose of this loop is to handle the case where someone's
actually typing at the time.  The 0x2000 is intended to make us wait
long enough for the next keypress or autorepeat.

Reducing the loop to _2_ outb(0x80)s seems strange -- is there some case
in qemu where another character will be presented after 2 delays but not
immediately?

If not, can we dispense with 'max' altogether and just have 
    while ( (inb(0x64) & 0x01) ) { inb(0x60); outb(0x80, 0x00); }
or even
    while ( (inb(0x64) & 0x01) ) inb(0x60);
?

Tim.

> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> diff -r 0049de3827bc -r 1728fb789940 tools/firmware/rombios/rombios.c
> --- a/tools/firmware/rombios/rombios.c
> +++ b/tools/firmware/rombios/rombios.c
> @@ -1805,12 +1805,12 @@ keyboard_init()
>      while ( (inb(0x64) & 0x02) && (--max>0)) outb(0x80, 0x00);
>  
>      /* flush incoming keys */
> -    max=0x2000;
> +    max=2;
>      while (--max > 0) {
>          outb(0x80, 0x00);
>          if (inb(0x64) & 0x01) {
>              inb(0x60);
> -            max = 0x2000;
> +            max = 2;
>              }
>          }
>  
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:33:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:33:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdO6A-0005Gh-OM; Tue, 27 Nov 2012 16:33:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TdO69-0005Gb-FZ
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:33:25 +0000
Received: from [85.158.139.211:45276] by server-14.bemta-5.messagelabs.com id
	3F/B9-21768-45BE4B05; Tue, 27 Nov 2012 16:33:24 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354034003!18094760!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11563 invoked from network); 27 Nov 2012 16:33:23 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 16:33:23 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TdO66-000Egs-AZ; Tue, 27 Nov 2012 16:33:22 +0000
Date: Tue, 27 Nov 2012 16:33:22 +0000
From: Tim Deegan <tim@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121127163322.GF51942@ocelot.phlegethon.org>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<1728fb78994054ad3695.1353948092@andrewcoop.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1728fb78994054ad3695.1353948092@andrewcoop.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Keir Fraser <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 1 of 5] rombios/keyboard: Don't needlessly
	poll the status register
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:41 +0000 on 26 Nov (1353948092), Andrew Cooper wrote:
> Repeated polling of the status register is not going to change its value, so
> don't needlessly take 8192 traps to Qemu when 1 will do.

AFAICS the purpose of this loop is to handle the case where someone's
actually typing at the time.  The 0x2000 is intended to make us wait
long enough for the next keypress or autorepeat.

Reducing the loop to _2_ outb(0x80)s seems strange -- is there some case
in qemu where another character will be presented after 2 delays but not
immediately?

If not, can we dispense with 'max' altogether and just have 
    while ( (inb(0x64) & 0x01) ) { inb(0x60); outb(0x80, 0x00); }
or even
    while ( (inb(0x64) & 0x01) ) inb(0x60);
?

Tim.

> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> diff -r 0049de3827bc -r 1728fb789940 tools/firmware/rombios/rombios.c
> --- a/tools/firmware/rombios/rombios.c
> +++ b/tools/firmware/rombios/rombios.c
> @@ -1805,12 +1805,12 @@ keyboard_init()
>      while ( (inb(0x64) & 0x02) && (--max>0)) outb(0x80, 0x00);
>  
>      /* flush incoming keys */
> -    max=0x2000;
> +    max=2;
>      while (--max > 0) {
>          outb(0x80, 0x00);
>          if (inb(0x64) & 0x01) {
>              inb(0x60);
> -            max = 0x2000;
> +            max = 2;
>              }
>          }
>  
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:41:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:41:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdODx-0005Sh-RW; Tue, 27 Nov 2012 16:41:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdODw-0005Sc-NH
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:41:28 +0000
Received: from [85.158.139.83:7511] by server-10.bemta-5.messagelabs.com id
	EE/A9-09257-73DE4B05; Tue, 27 Nov 2012 16:41:27 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1354034481!27055055!1
X-Originating-IP: [192.134.164.82]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5085 invoked from network); 27 Nov 2012 16:41:22 -0000
Received: from mail1-relais-roc.national.inria.fr (HELO
	mail1-relais-roc.national.inria.fr) (192.134.164.82)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 16:41:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352070000"; d="scan'208";a="183485704"
Received: from nat-inria-bordeaux-53.bordeaux.inria.fr (HELO type.ipv6)
	([194.199.1.53])
	by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	27 Nov 2012 17:41:21 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdODp-0008Bo-4B; Tue, 27 Nov 2012 17:41:21 +0100
Date: Tue, 27 Nov 2012 17:41:21 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Message-ID: <20121127164121.GA29415@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-4-git-send-email-dgdegra@tycho.nsa.gov>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354029286-17652-4-git-send-email-dgdegra@tycho.nsa.gov>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 3/4] stubdom/grub: send kernel measurements
 to vTPM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Daniel De Graaf, le Tue 27 Nov 2012 10:14:45 -0500, a =E9crit :
> +static inline uint16_t be16(uint16_t v)
> +{
> +	return (v >> 8) | (v << 8);
> +}
> +
> +static inline uint32_t be32(uint32_t v)
> +{
> +	return (be16(v) << 16) | be16(v >> 16);
> +}

Better use the existing bswap_16 and bswap_32.

> +void sha_compute(uint32_t *buf, void *src, uint32_t len);
> +++ b/stubdom/grub/sha1.c

I guess it could find its way in mini-os/lib?

BTW, what is the licence and copyright of this implementation?  We need
to be sure about that.

> @@ -0,0 +1,260 @@
> +/*
> + * SHA1 routine optimized to do word accesses rather than byte accesses,
> + * and to avoid unnecessary copies into the context array.
> + *
> + * This was based on the git SHA1 implementation.
> + */
> +
> +#include <stdint.h>
> +#include <string.h>
> +
> +static inline uint16_t be16(uint16_t v)
> +{
> +	return (v >> 8) | (v << 8);
> +}
> +
> +static inline uint32_t be32(uint32_t v)
> +{
> +	return (be16(v) << 16) | be16(v >> 16);
> +}

Ditto bswap_16/32

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:41:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:41:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdODx-0005Sh-RW; Tue, 27 Nov 2012 16:41:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdODw-0005Sc-NH
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:41:28 +0000
Received: from [85.158.139.83:7511] by server-10.bemta-5.messagelabs.com id
	EE/A9-09257-73DE4B05; Tue, 27 Nov 2012 16:41:27 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1354034481!27055055!1
X-Originating-IP: [192.134.164.82]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5085 invoked from network); 27 Nov 2012 16:41:22 -0000
Received: from mail1-relais-roc.national.inria.fr (HELO
	mail1-relais-roc.national.inria.fr) (192.134.164.82)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 16:41:22 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352070000"; d="scan'208";a="183485704"
Received: from nat-inria-bordeaux-53.bordeaux.inria.fr (HELO type.ipv6)
	([194.199.1.53])
	by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	27 Nov 2012 17:41:21 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdODp-0008Bo-4B; Tue, 27 Nov 2012 17:41:21 +0100
Date: Tue, 27 Nov 2012 17:41:21 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Message-ID: <20121127164121.GA29415@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-4-git-send-email-dgdegra@tycho.nsa.gov>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354029286-17652-4-git-send-email-dgdegra@tycho.nsa.gov>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 3/4] stubdom/grub: send kernel measurements
 to vTPM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Daniel De Graaf, le Tue 27 Nov 2012 10:14:45 -0500, a =E9crit :
> +static inline uint16_t be16(uint16_t v)
> +{
> +	return (v >> 8) | (v << 8);
> +}
> +
> +static inline uint32_t be32(uint32_t v)
> +{
> +	return (be16(v) << 16) | be16(v >> 16);
> +}

Better use the existing bswap_16 and bswap_32.

> +void sha_compute(uint32_t *buf, void *src, uint32_t len);
> +++ b/stubdom/grub/sha1.c

I guess it could find its way in mini-os/lib?

BTW, what is the licence and copyright of this implementation?  We need
to be sure about that.

> @@ -0,0 +1,260 @@
> +/*
> + * SHA1 routine optimized to do word accesses rather than byte accesses,
> + * and to avoid unnecessary copies into the context array.
> + *
> + * This was based on the git SHA1 implementation.
> + */
> +
> +#include <stdint.h>
> +#include <string.h>
> +
> +static inline uint16_t be16(uint16_t v)
> +{
> +	return (v >> 8) | (v << 8);
> +}
> +
> +static inline uint32_t be32(uint32_t v)
> +{
> +	return (be16(v) << 16) | be16(v >> 16);
> +}

Ditto bswap_16/32

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:42:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:42:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOEe-0005VH-9V; Tue, 27 Nov 2012 16:42:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdOEc-0005V3-98
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:42:10 +0000
Received: from [85.158.143.99:13787] by server-1.bemta-4.messagelabs.com id
	E4/77-27934-16DE4B05; Tue, 27 Nov 2012 16:42:09 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1354034528!26312801!1
X-Originating-IP: [192.134.164.82]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1268 invoked from network); 27 Nov 2012 16:42:08 -0000
Received: from mail1-relais-roc.national.inria.fr (HELO
	mail1-relais-roc.national.inria.fr) (192.134.164.82)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 16:42:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352070000"; d="scan'208";a="183485806"
Received: from nat-inria-bordeaux-53.bordeaux.inria.fr (HELO type.ipv6)
	([194.199.1.53])
	by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	27 Nov 2012 17:42:08 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdOEa-0008C8-6Z; Tue, 27 Nov 2012 17:42:08 +0100
Date: Tue, 27 Nov 2012 17:42:08 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Message-ID: <20121127164208.GB29415@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354029286-17652-2-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
 and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I let Matthew comment on patches 1 and 4.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:42:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:42:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOEe-0005VH-9V; Tue, 27 Nov 2012 16:42:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdOEc-0005V3-98
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:42:10 +0000
Received: from [85.158.143.99:13787] by server-1.bemta-4.messagelabs.com id
	E4/77-27934-16DE4B05; Tue, 27 Nov 2012 16:42:09 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1354034528!26312801!1
X-Originating-IP: [192.134.164.82]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1268 invoked from network); 27 Nov 2012 16:42:08 -0000
Received: from mail1-relais-roc.national.inria.fr (HELO
	mail1-relais-roc.national.inria.fr) (192.134.164.82)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 16:42:08 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352070000"; d="scan'208";a="183485806"
Received: from nat-inria-bordeaux-53.bordeaux.inria.fr (HELO type.ipv6)
	([194.199.1.53])
	by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	27 Nov 2012 17:42:08 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdOEa-0008C8-6Z; Tue, 27 Nov 2012 17:42:08 +0100
Date: Tue, 27 Nov 2012 17:42:08 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Message-ID: <20121127164208.GB29415@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354029286-17652-2-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
 and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I let Matthew comment on patches 1 and 4.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:44:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:44:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOGx-0005gX-0w; Tue, 27 Nov 2012 16:44:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdOGv-0005gL-Ca
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:44:33 +0000
Received: from [85.158.137.99:55778] by server-8.bemta-3.messagelabs.com id
	FB/42-07786-CEDE4B05; Tue, 27 Nov 2012 16:44:28 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-15.tower-217.messagelabs.com!1354034667!18500214!1
X-Originating-IP: [192.134.164.105]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16045 invoked from network); 27 Nov 2012 16:44:27 -0000
Received: from mail4-relais-sop.national.inria.fr (HELO
	mail4-relais-sop.national.inria.fr) (192.134.164.105)
	by server-15.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 16:44:27 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352070000"; d="scan'208";a="163989629"
Received: from nat-inria-bordeaux-53.bordeaux.inria.fr (HELO type.ipv6)
	([194.199.1.53])
	by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	27 Nov 2012 17:44:26 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdOGm-0008LL-UQ; Tue, 27 Nov 2012 17:44:24 +0100
Date: Tue, 27 Nov 2012 17:44:24 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Message-ID: <20121127164424.GC29415@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-3-git-send-email-dgdegra@tycho.nsa.gov>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354029286-17652-3-git-send-email-dgdegra@tycho.nsa.gov>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 2/4] stubdom/vtpm: Add reconfiguration
	support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Daniel De Graaf, le Tue 27 Nov 2012 10:14:44 -0500, a =E9crit :
> -void shutdown_tpmfront(struct tpmfront_dev* dev)
> +void shutdown_tpmfront(struct tpmfront_dev* dev, int for_reconfig)

Do we really need to explicit "for_reconfig"?  We didn't need it for
fbfront/blkfront/etc. (we just needed to fix some bugs), is tpm anything
particular here?

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:44:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:44:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOGx-0005gX-0w; Tue, 27 Nov 2012 16:44:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdOGv-0005gL-Ca
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:44:33 +0000
Received: from [85.158.137.99:55778] by server-8.bemta-3.messagelabs.com id
	FB/42-07786-CEDE4B05; Tue, 27 Nov 2012 16:44:28 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-15.tower-217.messagelabs.com!1354034667!18500214!1
X-Originating-IP: [192.134.164.105]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16045 invoked from network); 27 Nov 2012 16:44:27 -0000
Received: from mail4-relais-sop.national.inria.fr (HELO
	mail4-relais-sop.national.inria.fr) (192.134.164.105)
	by server-15.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 16:44:27 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352070000"; d="scan'208";a="163989629"
Received: from nat-inria-bordeaux-53.bordeaux.inria.fr (HELO type.ipv6)
	([194.199.1.53])
	by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	27 Nov 2012 17:44:26 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdOGm-0008LL-UQ; Tue, 27 Nov 2012 17:44:24 +0100
Date: Tue, 27 Nov 2012 17:44:24 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Message-ID: <20121127164424.GC29415@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-3-git-send-email-dgdegra@tycho.nsa.gov>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354029286-17652-3-git-send-email-dgdegra@tycho.nsa.gov>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 2/4] stubdom/vtpm: Add reconfiguration
	support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Daniel De Graaf, le Tue 27 Nov 2012 10:14:44 -0500, a =E9crit :
> -void shutdown_tpmfront(struct tpmfront_dev* dev)
> +void shutdown_tpmfront(struct tpmfront_dev* dev, int for_reconfig)

Do we really need to explicit "for_reconfig"?  We didn't need it for
fbfront/blkfront/etc. (we just needed to fix some bugs), is tpm anything
particular here?

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:46:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:46:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOIU-0005nH-Gt; Tue, 27 Nov 2012 16:46:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdOIS-0005mz-Th
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:46:09 +0000
Received: from [85.158.137.99:9227] by server-12.bemta-3.messagelabs.com id
	69/AB-22757-05EE4B05; Tue, 27 Nov 2012 16:46:08 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-15.tower-217.messagelabs.com!1354034767!18500476!1
X-Originating-IP: [192.134.164.105]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21339 invoked from network); 27 Nov 2012 16:46:07 -0000
Received: from mail4-relais-sop.national.inria.fr (HELO
	mail4-relais-sop.national.inria.fr) (192.134.164.105)
	by server-15.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 16:46:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352070000"; d="scan'208";a="163989809"
Received: from nat-inria-bordeaux-53.bordeaux.inria.fr (HELO type.ipv6)
	([194.199.1.53])
	by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	27 Nov 2012 17:46:06 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdOIP-0008Ml-WB; Tue, 27 Nov 2012 17:46:05 +0100
Date: Tue, 27 Nov 2012 17:46:05 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Message-ID: <20121127164605.GD29415@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 0/4] stubdom/vtpm improvements
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Daniel De Graaf, le Tue 27 Nov 2012 10:14:42 -0500, a =E9crit :
> Since pv-grub is already GPL, there should be no licensing issues
> created by adding the vTPM code and the Linux SHA1 implementation.

Ah, I should have read this before :)

Yes, the GPL licence shouldn't pose problem (and thus the sha1
implementation should stay in grub/, and not go to mini-os/lib as I
suggested.

We still need to know the copyright for the file.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:46:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:46:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOIU-0005nH-Gt; Tue, 27 Nov 2012 16:46:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdOIS-0005mz-Th
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:46:09 +0000
Received: from [85.158.137.99:9227] by server-12.bemta-3.messagelabs.com id
	69/AB-22757-05EE4B05; Tue, 27 Nov 2012 16:46:08 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-15.tower-217.messagelabs.com!1354034767!18500476!1
X-Originating-IP: [192.134.164.105]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21339 invoked from network); 27 Nov 2012 16:46:07 -0000
Received: from mail4-relais-sop.national.inria.fr (HELO
	mail4-relais-sop.national.inria.fr) (192.134.164.105)
	by server-15.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 16:46:07 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352070000"; d="scan'208";a="163989809"
Received: from nat-inria-bordeaux-53.bordeaux.inria.fr (HELO type.ipv6)
	([194.199.1.53])
	by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	27 Nov 2012 17:46:06 +0100
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdOIP-0008Ml-WB; Tue, 27 Nov 2012 17:46:05 +0100
Date: Tue, 27 Nov 2012 17:46:05 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Message-ID: <20121127164605.GD29415@type.bordeaux.inria.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 0/4] stubdom/vtpm improvements
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Daniel De Graaf, le Tue 27 Nov 2012 10:14:42 -0500, a =E9crit :
> Since pv-grub is already GPL, there should be no licensing issues
> created by adding the vTPM code and the Linux SHA1 implementation.

Ah, I should have read this before :)

Yes, the GPL licence shouldn't pose problem (and thus the sha1
implementation should stay in grub/, and not go to mini-os/lib as I
suggested.

We still need to know the copyright for the file.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:46:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:46:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOJ0-0005r6-V7; Tue, 27 Nov 2012 16:46:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TdOIy-0005qg-Qf
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:46:41 +0000
Received: from [85.158.139.211:44216] by server-8.bemta-5.messagelabs.com id
	7F/76-06050-07EE4B05; Tue, 27 Nov 2012 16:46:40 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1354034799!18132190!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25030 invoked from network); 27 Nov 2012 16:46:39 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 16:46:39 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TdOIv-000Ekm-Qr; Tue, 27 Nov 2012 16:46:37 +0000
Date: Tue, 27 Nov 2012 16:46:37 +0000
From: Tim Deegan <tim@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121127164637.GG51942@ocelot.phlegethon.org>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<c223c044afbf9505c138.1353948093@andrewcoop.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <c223c044afbf9505c138.1353948093@andrewcoop.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Keir Fraser <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 2 of 5] rombios/ata: Do not wait for BSY to
	be set
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:41 +0000 on 26 Nov (1353948093), Andrew Cooper wrote:
> I can't find any guarantee in the ATA specification that this will happen, and it
> certainly does not with Qemu.  SeaBIOS has replaced it with a call to udelay(5)
> instead.
> 
> As rombios does not have an equivalent udelay(), replace the wait with a write
> to port 0x80 which is whitelisted by Xen for 'a small delay'.

Does this actually do anything useful?  I'd guess that on qemu the extra
outb has no effect and on real hardware that needed a delay here, one
I/O cycle would not be enough.

Tim.

> This causes roughly 42k fewer traps to Qemu, which is very roughly 10% of the
> number of traps during boot of a Win7 guest.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> diff -r 1728fb789940 -r c223c044afbf tools/firmware/rombios/rombios.c
> --- a/tools/firmware/rombios/rombios.c
> +++ b/tools/firmware/rombios/rombios.c
> @@ -2914,8 +2914,8 @@ Bit16u device;
>  // 8.2.1 (a) -- set SRST in DC
>    outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN | ATA_CB_DC_SRST);
>  
> -// 8.2.1 (b) -- wait for BSY
> -  await_ide(BSY, iobase1, 20);
> +// 8.2.1 (b) -- wait
> +  outb(0x80, 0x00);
>  
>  // 8.2.1 (f) -- clear SRST
>    outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN);
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:46:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:46:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOJ0-0005r6-V7; Tue, 27 Nov 2012 16:46:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TdOIy-0005qg-Qf
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:46:41 +0000
Received: from [85.158.139.211:44216] by server-8.bemta-5.messagelabs.com id
	7F/76-06050-07EE4B05; Tue, 27 Nov 2012 16:46:40 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1354034799!18132190!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25030 invoked from network); 27 Nov 2012 16:46:39 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 16:46:39 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TdOIv-000Ekm-Qr; Tue, 27 Nov 2012 16:46:37 +0000
Date: Tue, 27 Nov 2012 16:46:37 +0000
From: Tim Deegan <tim@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121127164637.GG51942@ocelot.phlegethon.org>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<c223c044afbf9505c138.1353948093@andrewcoop.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <c223c044afbf9505c138.1353948093@andrewcoop.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Keir Fraser <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 2 of 5] rombios/ata: Do not wait for BSY to
	be set
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:41 +0000 on 26 Nov (1353948093), Andrew Cooper wrote:
> I can't find any guarantee in the ATA specification that this will happen, and it
> certainly does not with Qemu.  SeaBIOS has replaced it with a call to udelay(5)
> instead.
> 
> As rombios does not have an equivalent udelay(), replace the wait with a write
> to port 0x80 which is whitelisted by Xen for 'a small delay'.

Does this actually do anything useful?  I'd guess that on qemu the extra
outb has no effect and on real hardware that needed a delay here, one
I/O cycle would not be enough.

Tim.

> This causes roughly 42k fewer traps to Qemu, which is very roughly 10% of the
> number of traps during boot of a Win7 guest.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> diff -r 1728fb789940 -r c223c044afbf tools/firmware/rombios/rombios.c
> --- a/tools/firmware/rombios/rombios.c
> +++ b/tools/firmware/rombios/rombios.c
> @@ -2914,8 +2914,8 @@ Bit16u device;
>  // 8.2.1 (a) -- set SRST in DC
>    outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN | ATA_CB_DC_SRST);
>  
> -// 8.2.1 (b) -- wait for BSY
> -  await_ide(BSY, iobase1, 20);
> +// 8.2.1 (b) -- wait
> +  outb(0x80, 0x00);
>  
>  // 8.2.1 (f) -- clear SRST
>    outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN);
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:48:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:48:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOKH-00061Q-TZ; Tue, 27 Nov 2012 16:48:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TdOKF-00061E-U3
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:48:00 +0000
Received: from [85.158.143.35:12233] by server-1.bemta-4.messagelabs.com id
	CB/5F-27934-FBEE4B05; Tue, 27 Nov 2012 16:47:59 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1354034875!11288593!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzgyNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23374 invoked from network); 27 Nov 2012 16:47:57 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-11.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 16:47:57 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qARGlsIP002592
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 27 Nov 2012 16:47:55 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qARGls9r014016
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 27 Nov 2012 16:47:54 GMT
Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qARGls5b026729; Tue, 27 Nov 2012 10:47:54 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 27 Nov 2012 08:47:54 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 43632E07933; Tue, 27 Nov 2012 11:47:50 -0500 (EST)
Date: Tue, 27 Nov 2012 11:47:50 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121127164750.GA27586@phenom.dumpdata.com>
References: <50AE18CA02000078000AA90F@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50AE18CA02000078000AA90F@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Keir Fraser <keir@xen.org>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] freezing of kernel threads
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 22, 2012 at 11:21:30AM +0000, Jan Beulich wrote:
> Keir,
> 
> in linux-2.6.18-xen.hg c/s 74:cb50d25a9468 you made blktap
> match blkback in calling try_to_freeze() from the main thread loop.
> Threads in other drivers didn't get changed, though. Is there a
> particular reason why only block, and only backend, threads are in
> need of this (the only other one using it is xenfb_thread())?
> 
> Konrad, as of 2.6.23 kernel threads are non-freezable by default,
> i.e. xen-blkback calling try_to_freeze() is completely pointless
> without a prior call to set_freezable(). Also, in case the latter is to
> be added, switching to wait_event_freezable() instead of the
> direct use of try_to_freeze() might be the right way to go.

OK, any idea why the need to be come freezable was added in? Just
for power suspend/resume?

> 
> Jan
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:48:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:48:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOKH-00061Q-TZ; Tue, 27 Nov 2012 16:48:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TdOKF-00061E-U3
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:48:00 +0000
Received: from [85.158.143.35:12233] by server-1.bemta-4.messagelabs.com id
	CB/5F-27934-FBEE4B05; Tue, 27 Nov 2012 16:47:59 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1354034875!11288593!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzgyNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23374 invoked from network); 27 Nov 2012 16:47:57 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-11.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 16:47:57 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qARGlsIP002592
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 27 Nov 2012 16:47:55 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qARGls9r014016
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 27 Nov 2012 16:47:54 GMT
Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qARGls5b026729; Tue, 27 Nov 2012 10:47:54 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 27 Nov 2012 08:47:54 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 43632E07933; Tue, 27 Nov 2012 11:47:50 -0500 (EST)
Date: Tue, 27 Nov 2012 11:47:50 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121127164750.GA27586@phenom.dumpdata.com>
References: <50AE18CA02000078000AA90F@nat28.tlf.novell.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50AE18CA02000078000AA90F@nat28.tlf.novell.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Keir Fraser <keir@xen.org>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] freezing of kernel threads
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 22, 2012 at 11:21:30AM +0000, Jan Beulich wrote:
> Keir,
> 
> in linux-2.6.18-xen.hg c/s 74:cb50d25a9468 you made blktap
> match blkback in calling try_to_freeze() from the main thread loop.
> Threads in other drivers didn't get changed, though. Is there a
> particular reason why only block, and only backend, threads are in
> need of this (the only other one using it is xenfb_thread())?
> 
> Konrad, as of 2.6.23 kernel threads are non-freezable by default,
> i.e. xen-blkback calling try_to_freeze() is completely pointless
> without a prior call to set_freezable(). Also, in case the latter is to
> be added, switching to wait_event_freezable() instead of the
> direct use of try_to_freeze() might be the right way to go.

OK, any idea why the need to be come freezable was added in? Just
for power suspend/resume?

> 
> Jan
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:51:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:51:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdONr-0006JJ-HT; Tue, 27 Nov 2012 16:51:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdONr-0006JA-0Y
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:51:43 +0000
Received: from [85.158.137.99:64790] by server-13.bemta-3.messagelabs.com id
	1C/A6-24887-E9FE4B05; Tue, 27 Nov 2012 16:51:42 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1354035101!17699338!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7002 invoked from network); 27 Nov 2012 16:51:41 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 16:51:41 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 16:51:50 +0000
Message-Id: <50B4FDE302000078000ABD0D@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 16:52:35 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
References: <50AE18CA02000078000AA90F@nat28.tlf.novell.com>
	<20121127164750.GA27586@phenom.dumpdata.com>
In-Reply-To: <20121127164750.GA27586@phenom.dumpdata.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] freezing of kernel threads
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 27.11.12 at 17:47, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> On Thu, Nov 22, 2012 at 11:21:30AM +0000, Jan Beulich wrote:
>> Keir,
>> 
>> in linux-2.6.18-xen.hg c/s 74:cb50d25a9468 you made blktap
>> match blkback in calling try_to_freeze() from the main thread loop.
>> Threads in other drivers didn't get changed, though. Is there a
>> particular reason why only block, and only backend, threads are in
>> need of this (the only other one using it is xenfb_thread())?
>> 
>> Konrad, as of 2.6.23 kernel threads are non-freezable by default,
>> i.e. xen-blkback calling try_to_freeze() is completely pointless
>> without a prior call to set_freezable(). Also, in case the latter is to
>> be added, switching to wait_event_freezable() instead of the
>> direct use of try_to_freeze() might be the right way to go.
> 
> OK, any idea why the need to be come freezable was added in? Just
> for power suspend/resume?

No, which is why I had asked Keir (who unfortunately didn't recall
either).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 16:51:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 16:51:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdONr-0006JJ-HT; Tue, 27 Nov 2012 16:51:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdONr-0006JA-0Y
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 16:51:43 +0000
Received: from [85.158.137.99:64790] by server-13.bemta-3.messagelabs.com id
	1C/A6-24887-E9FE4B05; Tue, 27 Nov 2012 16:51:42 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1354035101!17699338!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7002 invoked from network); 27 Nov 2012 16:51:41 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 16:51:41 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Tue, 27 Nov 2012 16:51:50 +0000
Message-Id: <50B4FDE302000078000ABD0D@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Tue, 27 Nov 2012 16:52:35 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
References: <50AE18CA02000078000AA90F@nat28.tlf.novell.com>
	<20121127164750.GA27586@phenom.dumpdata.com>
In-Reply-To: <20121127164750.GA27586@phenom.dumpdata.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] freezing of kernel threads
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 27.11.12 at 17:47, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> On Thu, Nov 22, 2012 at 11:21:30AM +0000, Jan Beulich wrote:
>> Keir,
>> 
>> in linux-2.6.18-xen.hg c/s 74:cb50d25a9468 you made blktap
>> match blkback in calling try_to_freeze() from the main thread loop.
>> Threads in other drivers didn't get changed, though. Is there a
>> particular reason why only block, and only backend, threads are in
>> need of this (the only other one using it is xenfb_thread())?
>> 
>> Konrad, as of 2.6.23 kernel threads are non-freezable by default,
>> i.e. xen-blkback calling try_to_freeze() is completely pointless
>> without a prior call to set_freezable(). Also, in case the latter is to
>> be added, switching to wait_event_freezable() instead of the
>> direct use of try_to_freeze() might be the right way to go.
> 
> OK, any idea why the need to be come freezable was added in? Just
> for power suspend/resume?

No, which is why I had asked Keir (who unfortunately didn't recall
either).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 17:03:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 17:03:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOYs-0006aK-PH; Tue, 27 Nov 2012 17:03:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TdOYr-0006aF-9R
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 17:03:05 +0000
Received: from [85.158.139.211:7748] by server-2.bemta-5.messagelabs.com id
	20/A5-04892-842F4B05; Tue, 27 Nov 2012 17:03:04 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354035782!17643089!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17710 invoked from network); 27 Nov 2012 17:03:03 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 17:03:03 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215625226"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	27 Nov 2012 17:02:59 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL03.citrite.net
	(10.13.107.80) with Microsoft SMTP Server id 14.2.318.1;
	Tue, 27 Nov 2012 12:02:59 -0500
Message-ID: <50B4F242.8080103@citrix.com>
Date: Tue, 27 Nov 2012 17:02:58 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<c223c044afbf9505c138.1353948093@andrewcoop.uk.xensource.com>
	<20121127164637.GG51942@ocelot.phlegethon.org>
In-Reply-To: <20121127164637.GG51942@ocelot.phlegethon.org>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] [PATCH 2 of 5] rombios/ata: Do not wait for BSY to
 be set
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 27/11/12 16:46, Tim Deegan wrote:
> At 16:41 +0000 on 26 Nov (1353948093), Andrew Cooper wrote:
>> I can't find any guarantee in the ATA specification that this will happen, and it
>> certainly does not with Qemu.  SeaBIOS has replaced it with a call to udelay(5)
>> instead.
>>
>> As rombios does not have an equivalent udelay(), replace the wait with a write
>> to port 0x80 which is whitelisted by Xen for 'a small delay'.
> Does this actually do anything useful?  I'd guess that on qemu the extra
> outb has no effect and on real hardware that needed a delay here, one
> I/O cycle would not be enough.

I believe it's quite a significant delay also on real hardware - but 
real hardware isn't booting 100s of OSes in short succession [typically, 
at least], as it has to trickle through all the buses and stuff down to 
the southbridge. Which is quite a large number of cycles even in a 
modern system.

It is typically used to ensure that "some other bus cycle" goes in 
between two IO operations that affect each other, where the hardware is 
run by a significantly slower processor than the CPU - a 16MHz 16-bit 
processor or some such. It allows the hardware to "react" to the IO 
instructions, and change state. Yes, it's daft, and we can't fix that.

In QEMU, it's not going to matter, as the "hardware" is idealised and 
don't have the same timing restrictions of REAL hardware.

--
mats
>
> Tim.
>
>> This causes roughly 42k fewer traps to Qemu, which is very roughly 10% of the
>> number of traps during boot of a Win7 guest.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>
>> diff -r 1728fb789940 -r c223c044afbf tools/firmware/rombios/rombios.c
>> --- a/tools/firmware/rombios/rombios.c
>> +++ b/tools/firmware/rombios/rombios.c
>> @@ -2914,8 +2914,8 @@ Bit16u device;
>>   // 8.2.1 (a) -- set SRST in DC
>>     outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN | ATA_CB_DC_SRST);
>>   
>> -// 8.2.1 (b) -- wait for BSY
>> -  await_ide(BSY, iobase1, 20);
>> +// 8.2.1 (b) -- wait
>> +  outb(0x80, 0x00);
>>   
>>   // 8.2.1 (f) -- clear SRST
>>     outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN);
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 17:03:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 17:03:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOYs-0006aK-PH; Tue, 27 Nov 2012 17:03:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TdOYr-0006aF-9R
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 17:03:05 +0000
Received: from [85.158.139.211:7748] by server-2.bemta-5.messagelabs.com id
	20/A5-04892-842F4B05; Tue, 27 Nov 2012 17:03:04 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354035782!17643089!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17710 invoked from network); 27 Nov 2012 17:03:03 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 17:03:03 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215625226"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	27 Nov 2012 17:02:59 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL03.citrite.net
	(10.13.107.80) with Microsoft SMTP Server id 14.2.318.1;
	Tue, 27 Nov 2012 12:02:59 -0500
Message-ID: <50B4F242.8080103@citrix.com>
Date: Tue, 27 Nov 2012 17:02:58 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<c223c044afbf9505c138.1353948093@andrewcoop.uk.xensource.com>
	<20121127164637.GG51942@ocelot.phlegethon.org>
In-Reply-To: <20121127164637.GG51942@ocelot.phlegethon.org>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] [PATCH 2 of 5] rombios/ata: Do not wait for BSY to
 be set
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 27/11/12 16:46, Tim Deegan wrote:
> At 16:41 +0000 on 26 Nov (1353948093), Andrew Cooper wrote:
>> I can't find any guarantee in the ATA specification that this will happen, and it
>> certainly does not with Qemu.  SeaBIOS has replaced it with a call to udelay(5)
>> instead.
>>
>> As rombios does not have an equivalent udelay(), replace the wait with a write
>> to port 0x80 which is whitelisted by Xen for 'a small delay'.
> Does this actually do anything useful?  I'd guess that on qemu the extra
> outb has no effect and on real hardware that needed a delay here, one
> I/O cycle would not be enough.

I believe it's quite a significant delay also on real hardware - but 
real hardware isn't booting 100s of OSes in short succession [typically, 
at least], as it has to trickle through all the buses and stuff down to 
the southbridge. Which is quite a large number of cycles even in a 
modern system.

It is typically used to ensure that "some other bus cycle" goes in 
between two IO operations that affect each other, where the hardware is 
run by a significantly slower processor than the CPU - a 16MHz 16-bit 
processor or some such. It allows the hardware to "react" to the IO 
instructions, and change state. Yes, it's daft, and we can't fix that.

In QEMU, it's not going to matter, as the "hardware" is idealised and 
don't have the same timing restrictions of REAL hardware.

--
mats
>
> Tim.
>
>> This causes roughly 42k fewer traps to Qemu, which is very roughly 10% of the
>> number of traps during boot of a Win7 guest.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>
>> diff -r 1728fb789940 -r c223c044afbf tools/firmware/rombios/rombios.c
>> --- a/tools/firmware/rombios/rombios.c
>> +++ b/tools/firmware/rombios/rombios.c
>> @@ -2914,8 +2914,8 @@ Bit16u device;
>>   // 8.2.1 (a) -- set SRST in DC
>>     outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN | ATA_CB_DC_SRST);
>>   
>> -// 8.2.1 (b) -- wait for BSY
>> -  await_ide(BSY, iobase1, 20);
>> +// 8.2.1 (b) -- wait
>> +  outb(0x80, 0x00);
>>   
>>   // 8.2.1 (f) -- clear SRST
>>     outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN);
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 17:04:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 17:04:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOZw-0006e0-7Z; Tue, 27 Nov 2012 17:04:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>) id 1TdOZv-0006dv-7r
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 17:04:11 +0000
Received: from [85.158.137.99:8566] by server-10.bemta-3.messagelabs.com id
	56/72-19806-A82F4B05; Tue, 27 Nov 2012 17:04:10 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354035849!16963434!1
X-Originating-IP: [209.85.214.45]
X-SpamReason: No, hits=0.5 required=7.0 tests=RCVD_BY_IP,RCVD_ILLEGAL_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11571 invoked from network); 27 Nov 2012 17:04:09 -0000
Received: from mail-bk0-f45.google.com (HELO mail-bk0-f45.google.com)
	(209.85.214.45)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 17:04:09 -0000
Received: by mail-bk0-f45.google.com with SMTP id jk13so4756403bkc.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 09:04:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:date:from:reply-to:user-agent:mime-version:to
	:subject:content-type:content-transfer-encoding;
	bh=g2gqf+8RYKxQN5EgS4j8oA01buCDqBgcPHqd+EaOvcI=;
	b=c/yRco3+VSaAMQdpZZLznHsGsMVgoQdwgXVVzwjSAZH44inlCYs77VcXAGTVuUiFNw
	3H9J2N5S76VB+GOHpb7LJn5QLs6oq+0dnt7nmdivzLyKHh3KYkeJ0FqSyktX8R+2UPzJ
	p/UpGPFLEjdg8O75etiPDditgvV5pkQTVdZovBGSrojz33fTfjaZO2m42aPzyOIDzmjV
	CEcJdWLh0qG+PRS925JZiU99viTxkkrulLAnBO9CvGIfYvsQJ2qiPufSFsDSw02jIaef
	R0BkzRw6L4FVf+C1Ta4R0Ks2ZNK2+8aKGXOh6oGm6SjA/OSALj4RWy51lLrRZhhTjhfM
	2Tsg==
Received: by 10.204.147.132 with SMTP id l4mr4887652bkv.20.1354035849006;
	Tue, 27 Nov 2012 09:04:09 -0800 (PST)
Received: from [172.16.26.11] (027fe853.bb.sky.com. [2.127.232.83])
	by mx.google.com with ESMTPS id t11sm10837499bkv.11.2012.11.27.09.04.07
	(version=SSLv3 cipher=OTHER); Tue, 27 Nov 2012 09:04:08 -0800 (PST)
Message-ID: <50B4F286.90908@xen.org>
Date: Tue, 27 Nov 2012 17:04:06 +0000
From: Lars Kurth <lars.kurth@xen.org>
User-Agent: Mozilla/5.0 (Windows NT 6.1;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: [Xen-devel] Published Xen Maintainer,
 Committer and Developer Meeting Minutes for November 2012
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: lars.kurth@xen.org
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

See 
http://wiki.xen.org/wiki/Xen_Maintainer,_Committer_and_Developer_Meeting/November_2012_Minutes 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 17:04:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 17:04:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOZw-0006e0-7Z; Tue, 27 Nov 2012 17:04:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <lars.kurth.xen@gmail.com>) id 1TdOZv-0006dv-7r
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 17:04:11 +0000
Received: from [85.158.137.99:8566] by server-10.bemta-3.messagelabs.com id
	56/72-19806-A82F4B05; Tue, 27 Nov 2012 17:04:10 +0000
X-Env-Sender: lars.kurth.xen@gmail.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354035849!16963434!1
X-Originating-IP: [209.85.214.45]
X-SpamReason: No, hits=0.5 required=7.0 tests=RCVD_BY_IP,RCVD_ILLEGAL_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11571 invoked from network); 27 Nov 2012 17:04:09 -0000
Received: from mail-bk0-f45.google.com (HELO mail-bk0-f45.google.com)
	(209.85.214.45)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 17:04:09 -0000
Received: by mail-bk0-f45.google.com with SMTP id jk13so4756403bkc.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 09:04:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:message-id:date:from:reply-to:user-agent:mime-version:to
	:subject:content-type:content-transfer-encoding;
	bh=g2gqf+8RYKxQN5EgS4j8oA01buCDqBgcPHqd+EaOvcI=;
	b=c/yRco3+VSaAMQdpZZLznHsGsMVgoQdwgXVVzwjSAZH44inlCYs77VcXAGTVuUiFNw
	3H9J2N5S76VB+GOHpb7LJn5QLs6oq+0dnt7nmdivzLyKHh3KYkeJ0FqSyktX8R+2UPzJ
	p/UpGPFLEjdg8O75etiPDditgvV5pkQTVdZovBGSrojz33fTfjaZO2m42aPzyOIDzmjV
	CEcJdWLh0qG+PRS925JZiU99viTxkkrulLAnBO9CvGIfYvsQJ2qiPufSFsDSw02jIaef
	R0BkzRw6L4FVf+C1Ta4R0Ks2ZNK2+8aKGXOh6oGm6SjA/OSALj4RWy51lLrRZhhTjhfM
	2Tsg==
Received: by 10.204.147.132 with SMTP id l4mr4887652bkv.20.1354035849006;
	Tue, 27 Nov 2012 09:04:09 -0800 (PST)
Received: from [172.16.26.11] (027fe853.bb.sky.com. [2.127.232.83])
	by mx.google.com with ESMTPS id t11sm10837499bkv.11.2012.11.27.09.04.07
	(version=SSLv3 cipher=OTHER); Tue, 27 Nov 2012 09:04:08 -0800 (PST)
Message-ID: <50B4F286.90908@xen.org>
Date: Tue, 27 Nov 2012 17:04:06 +0000
From: Lars Kurth <lars.kurth@xen.org>
User-Agent: Mozilla/5.0 (Windows NT 6.1;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: [Xen-devel] Published Xen Maintainer,
 Committer and Developer Meeting Minutes for November 2012
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: lars.kurth@xen.org
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

See 
http://wiki.xen.org/wiki/Xen_Maintainer,_Committer_and_Developer_Meeting/November_2012_Minutes 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 17:04:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 17:04:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOaE-0006gH-LS; Tue, 27 Nov 2012 17:04:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <alan@lxorguk.ukuu.org.uk>) id 1TdOaC-0006fq-SY
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 17:04:29 +0000
Received: from [85.158.138.51:19598] by server-10.bemta-3.messagelabs.com id
	35/F2-19806-C92F4B05; Tue, 27 Nov 2012 17:04:28 +0000
X-Env-Sender: alan@lxorguk.ukuu.org.uk
X-Msg-Ref: server-15.tower-174.messagelabs.com!1354035864!29795034!1
X-Originating-IP: [81.2.110.251]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11387 invoked from network); 27 Nov 2012 17:04:25 -0000
Received: from lxorguk.ukuu.org.uk (HELO lxorguk.ukuu.org.uk) (81.2.110.251)
	by server-15.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 17:04:25 -0000
Received: from pyramind.ukuu.org.uk (earthlight.etchedpixels.co.uk
	[81.2.110.250])
	by lxorguk.ukuu.org.uk (8.14.5/8.14.1) with ESMTP id qARHYsEU004762;
	Tue, 27 Nov 2012 17:34:59 GMT
Received: from pyramind.ukuu.org.uk (localhost [127.0.0.1])
	by pyramind.ukuu.org.uk (8.14.5/8.14.5) with ESMTP id qARH8i9l019376;
	Tue, 27 Nov 2012 17:08:45 GMT
Date: Tue, 27 Nov 2012 17:08:44 +0000
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Tim Deegan <tim@xen.org>
Message-ID: <20121127170844.536be218@pyramind.ukuu.org.uk>
In-Reply-To: <20121127164637.GG51942@ocelot.phlegethon.org>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<c223c044afbf9505c138.1353948093@andrewcoop.uk.xensource.com>
	<20121127164637.GG51942@ocelot.phlegethon.org>
X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.8; x86_64-redhat-linux-gnu)
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEWysKsSBQMIAwIZCwj///8wIhxoRDXH9QHCAAABeUlEQVQ4jaXTvW7DIBAAYCQTzz2hdq+rdg494ZmBeE5KYHZjm/d/hJ6NfzBJpp5kRb5PHJwvMPMk2L9As5Y9AmYRBL+HAyJKeOU5aHRhsAAvORQ+UEgAvgddj/lwAXndw2laEDqA4x6KEBhjYRCg9tBFCOuJFxg2OKegbWjbsRTk8PPhKPD7HcRxB7cqhgBRp9Dcqs+B8v4CQvFdqeot3Kov6hBUn0AJitrzY+sgUuiA8i0r7+B3AfqKcN6t8M6HtqQ+AOoELCikgQSbgabKaJW3kn5lBs47JSGDhhLKDUh1UMipwwinMYPTBuIBjEclSaGZUk9hDlTb5sUTYN2SFFQuPe4Gox1X0FZOufjgBiV1Vls7b+GvK3SU4wfmcGo9rPPQzgIabfj4TYQo15k3bTHX9RIw/kniir5YbtJF4jkFG+dsDK1IgE413zAthU/vR2HVMmFUPIHTvF6jWCpFaGw/A3qWgnbxpSm9MSmY5b3pM1gvNc/gQfwBsGwF0VCtxZgAAAAASUVORK5CYII=
Mime-Version: 1.0
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Keir Fraser <keir@xen.org>,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 2 of 5] rombios/ata: Do not wait for BSY to
 be set
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> Does this actually do anything useful?  I'd guess that on qemu the extra
> outb has no effect and on real hardware that needed a delay here, one
> I/O cycle would not be enough.

It ought to be plenty - the time before the response is valid from an ATA
command is very short but in the real hardware world most definitely
present and important.

However you also need to think about the state of the device registers
after the second outb. If you don't wait for BSY and for some reason it's
delayed in the emulation or on a multiprocessor what occurs.

Might be safer to do

	outb(0x80,0x00)
	await_ide(...)

at which point the await_ide would run once in the usual case.

Alan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 17:04:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 17:04:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOaE-0006gH-LS; Tue, 27 Nov 2012 17:04:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <alan@lxorguk.ukuu.org.uk>) id 1TdOaC-0006fq-SY
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 17:04:29 +0000
Received: from [85.158.138.51:19598] by server-10.bemta-3.messagelabs.com id
	35/F2-19806-C92F4B05; Tue, 27 Nov 2012 17:04:28 +0000
X-Env-Sender: alan@lxorguk.ukuu.org.uk
X-Msg-Ref: server-15.tower-174.messagelabs.com!1354035864!29795034!1
X-Originating-IP: [81.2.110.251]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11387 invoked from network); 27 Nov 2012 17:04:25 -0000
Received: from lxorguk.ukuu.org.uk (HELO lxorguk.ukuu.org.uk) (81.2.110.251)
	by server-15.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 17:04:25 -0000
Received: from pyramind.ukuu.org.uk (earthlight.etchedpixels.co.uk
	[81.2.110.250])
	by lxorguk.ukuu.org.uk (8.14.5/8.14.1) with ESMTP id qARHYsEU004762;
	Tue, 27 Nov 2012 17:34:59 GMT
Received: from pyramind.ukuu.org.uk (localhost [127.0.0.1])
	by pyramind.ukuu.org.uk (8.14.5/8.14.5) with ESMTP id qARH8i9l019376;
	Tue, 27 Nov 2012 17:08:45 GMT
Date: Tue, 27 Nov 2012 17:08:44 +0000
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Tim Deegan <tim@xen.org>
Message-ID: <20121127170844.536be218@pyramind.ukuu.org.uk>
In-Reply-To: <20121127164637.GG51942@ocelot.phlegethon.org>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<c223c044afbf9505c138.1353948093@andrewcoop.uk.xensource.com>
	<20121127164637.GG51942@ocelot.phlegethon.org>
X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.8; x86_64-redhat-linux-gnu)
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEWysKsSBQMIAwIZCwj///8wIhxoRDXH9QHCAAABeUlEQVQ4jaXTvW7DIBAAYCQTzz2hdq+rdg494ZmBeE5KYHZjm/d/hJ6NfzBJpp5kRb5PHJwvMPMk2L9As5Y9AmYRBL+HAyJKeOU5aHRhsAAvORQ+UEgAvgddj/lwAXndw2laEDqA4x6KEBhjYRCg9tBFCOuJFxg2OKegbWjbsRTk8PPhKPD7HcRxB7cqhgBRp9Dcqs+B8v4CQvFdqeot3Kov6hBUn0AJitrzY+sgUuiA8i0r7+B3AfqKcN6t8M6HtqQ+AOoELCikgQSbgabKaJW3kn5lBs47JSGDhhLKDUh1UMipwwinMYPTBuIBjEclSaGZUk9hDlTb5sUTYN2SFFQuPe4Gox1X0FZOufjgBiV1Vls7b+GvK3SU4wfmcGo9rPPQzgIabfj4TYQo15k3bTHX9RIw/kniir5YbtJF4jkFG+dsDK1IgE413zAthU/vR2HVMmFUPIHTvF6jWCpFaGw/A3qWgnbxpSm9MSmY5b3pM1gvNc/gQfwBsGwF0VCtxZgAAAAASUVORK5CYII=
Mime-Version: 1.0
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Keir Fraser <keir@xen.org>,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 2 of 5] rombios/ata: Do not wait for BSY to
 be set
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> Does this actually do anything useful?  I'd guess that on qemu the extra
> outb has no effect and on real hardware that needed a delay here, one
> I/O cycle would not be enough.

It ought to be plenty - the time before the response is valid from an ATA
command is very short but in the real hardware world most definitely
present and important.

However you also need to think about the state of the device registers
after the second outb. If you don't wait for BSY and for some reason it's
delayed in the emulation or on a multiprocessor what occurs.

Might be safer to do

	outb(0x80,0x00)
	await_ide(...)

at which point the await_ide would run once in the usual case.

Alan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 17:07:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 17:07:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOdM-0006v2-9k; Tue, 27 Nov 2012 17:07:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TdOdL-0006uu-JX
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 17:07:43 +0000
Received: from [85.158.139.211:44864] by server-11.bemta-5.messagelabs.com id
	B4/5A-03409-E53F4B05; Tue, 27 Nov 2012 17:07:42 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354036062!14103548!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5285 invoked from network); 27 Nov 2012 17:07:42 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-13.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 17:07:42 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TdOdI-000Eox-Lb; Tue, 27 Nov 2012 17:07:40 +0000
Date: Tue, 27 Nov 2012 17:07:40 +0000
From: Tim Deegan <tim@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121127170740.GH51942@ocelot.phlegethon.org>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<f997ed9b64abe1cefde1.1353948096@andrewcoop.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <f997ed9b64abe1cefde1.1353948096@andrewcoop.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Keir Fraser <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 5 of 5] rombios/debug: Reduce verbosity of
	rombios
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:41 +0000 on 26 Nov (1353948096), Andrew Cooper wrote:
> Default builds of Qemu appear not to log the Bochs debug port, so having rombios
> write to the port causes pointless traps.

This BIOS_PRINTF_INFO output is also sent to the Xen debug port (0xE9)
by send() in rombios.c.  I think the right change if the Bochs ports
aren't useful is to set BX_VIRTUAL_PORTS to 0 in rombios.c.

Tim.

> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> diff -r 8dbcbde13914 -r f997ed9b64ab tools/firmware/rombios/rombios.h
> --- a/tools/firmware/rombios/rombios.h
> +++ b/tools/firmware/rombios/rombios.h
> @@ -48,10 +48,11 @@
>  // per-device basis. Debug info are sent only in debug mode
>  #if DEBUG_ROMBIOS
>  #  define BX_DEBUG(format, p...)  bios_printf(BIOS_PRINTF_INFO, format, ##p)
> +#  define BX_INFO(format, p...)   bios_printf(BIOS_PRINTF_INFO, format, ##p)
>  #else
>  #  define BX_DEBUG(format, p...)
> +#  define BX_INFO(format, p...)
>  #endif
> -#define BX_INFO(format, p...)   bios_printf(BIOS_PRINTF_INFO, format, ##p)
>  #define BX_PANIC(format, p...)  bios_printf(BIOS_PRINTF_DEBHALT, format, ##p)
>  
>  #define ACPI_DATA_SIZE    0x00010000L
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 17:07:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 17:07:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOdM-0006v2-9k; Tue, 27 Nov 2012 17:07:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TdOdL-0006uu-JX
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 17:07:43 +0000
Received: from [85.158.139.211:44864] by server-11.bemta-5.messagelabs.com id
	B4/5A-03409-E53F4B05; Tue, 27 Nov 2012 17:07:42 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354036062!14103548!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5285 invoked from network); 27 Nov 2012 17:07:42 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-13.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 17:07:42 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TdOdI-000Eox-Lb; Tue, 27 Nov 2012 17:07:40 +0000
Date: Tue, 27 Nov 2012 17:07:40 +0000
From: Tim Deegan <tim@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121127170740.GH51942@ocelot.phlegethon.org>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<f997ed9b64abe1cefde1.1353948096@andrewcoop.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <f997ed9b64abe1cefde1.1353948096@andrewcoop.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Keir Fraser <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 5 of 5] rombios/debug: Reduce verbosity of
	rombios
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:41 +0000 on 26 Nov (1353948096), Andrew Cooper wrote:
> Default builds of Qemu appear not to log the Bochs debug port, so having rombios
> write to the port causes pointless traps.

This BIOS_PRINTF_INFO output is also sent to the Xen debug port (0xE9)
by send() in rombios.c.  I think the right change if the Bochs ports
aren't useful is to set BX_VIRTUAL_PORTS to 0 in rombios.c.

Tim.

> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> diff -r 8dbcbde13914 -r f997ed9b64ab tools/firmware/rombios/rombios.h
> --- a/tools/firmware/rombios/rombios.h
> +++ b/tools/firmware/rombios/rombios.h
> @@ -48,10 +48,11 @@
>  // per-device basis. Debug info are sent only in debug mode
>  #if DEBUG_ROMBIOS
>  #  define BX_DEBUG(format, p...)  bios_printf(BIOS_PRINTF_INFO, format, ##p)
> +#  define BX_INFO(format, p...)   bios_printf(BIOS_PRINTF_INFO, format, ##p)
>  #else
>  #  define BX_DEBUG(format, p...)
> +#  define BX_INFO(format, p...)
>  #endif
> -#define BX_INFO(format, p...)   bios_printf(BIOS_PRINTF_INFO, format, ##p)
>  #define BX_PANIC(format, p...)  bios_printf(BIOS_PRINTF_DEBHALT, format, ##p)
>  
>  #define ACPI_DATA_SIZE    0x00010000L
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 17:09:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 17:09:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOef-00073k-1z; Tue, 27 Nov 2012 17:09:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TdOed-00073Y-Mt
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 17:09:03 +0000
Received: from [85.158.139.211:60712] by server-16.bemta-5.messagelabs.com id
	AB/5B-04786-EA3F4B05; Tue, 27 Nov 2012 17:09:02 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1354036137!18071396!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32310 invoked from network); 27 Nov 2012 17:08:58 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 17:08:58 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215626227"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 17:08:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 12:08:56 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TdOeW-0001Bh-6o;
	Tue, 27 Nov 2012 17:08:56 +0000
Message-ID: <50B4F3A8.2000908@citrix.com>
Date: Tue, 27 Nov 2012 17:08:56 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<1728fb78994054ad3695.1353948092@andrewcoop.uk.xensource.com>
	<20121127163322.GF51942@ocelot.phlegethon.org>
In-Reply-To: <20121127163322.GF51942@ocelot.phlegethon.org>
X-Enigmail-Version: 1.4.6
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1 of 5] rombios/keyboard: Don't needlessly
 poll the status register
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 27/11/12 16:33, Tim Deegan wrote:
> At 16:41 +0000 on 26 Nov (1353948092), Andrew Cooper wrote:
>> Repeated polling of the status register is not going to change its value, so
>> don't needlessly take 8192 traps to Qemu when 1 will do.
> AFAICS the purpose of this loop is to handle the case where someone's
> actually typing at the time.  The 0x2000 is intended to make us wait
> long enough for the next keypress or autorepeat.
>
> Reducing the loop to _2_ outb(0x80)s seems strange -- is there some case
> in qemu where another character will be presented after 2 delays but not
> immediately?

The reduction to 2 instead of 1 is because the while loop uses a
pre-decrement on max.

The patch was chosen at the time to have minimal change to the code.

~Andrew

>
> If not, can we dispense with 'max' altogether and just have 
>     while ( (inb(0x64) & 0x01) ) { inb(0x60); outb(0x80, 0x00); }
> or even
>     while ( (inb(0x64) & 0x01) ) inb(0x60);
> ?
>
> Tim.
>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>
>> diff -r 0049de3827bc -r 1728fb789940 tools/firmware/rombios/rombios.c
>> --- a/tools/firmware/rombios/rombios.c
>> +++ b/tools/firmware/rombios/rombios.c
>> @@ -1805,12 +1805,12 @@ keyboard_init()
>>      while ( (inb(0x64) & 0x02) && (--max>0)) outb(0x80, 0x00);
>>  
>>      /* flush incoming keys */
>> -    max=0x2000;
>> +    max=2;
>>      while (--max > 0) {
>>          outb(0x80, 0x00);
>>          if (inb(0x64) & 0x01) {
>>              inb(0x60);
>> -            max = 0x2000;
>> +            max = 2;
>>              }
>>          }
>>  
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 17:09:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 17:09:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOef-00073k-1z; Tue, 27 Nov 2012 17:09:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TdOed-00073Y-Mt
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 17:09:03 +0000
Received: from [85.158.139.211:60712] by server-16.bemta-5.messagelabs.com id
	AB/5B-04786-EA3F4B05; Tue, 27 Nov 2012 17:09:02 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1354036137!18071396!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32310 invoked from network); 27 Nov 2012 17:08:58 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 17:08:58 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215626227"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 17:08:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 12:08:56 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TdOeW-0001Bh-6o;
	Tue, 27 Nov 2012 17:08:56 +0000
Message-ID: <50B4F3A8.2000908@citrix.com>
Date: Tue, 27 Nov 2012 17:08:56 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<1728fb78994054ad3695.1353948092@andrewcoop.uk.xensource.com>
	<20121127163322.GF51942@ocelot.phlegethon.org>
In-Reply-To: <20121127163322.GF51942@ocelot.phlegethon.org>
X-Enigmail-Version: 1.4.6
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1 of 5] rombios/keyboard: Don't needlessly
 poll the status register
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 27/11/12 16:33, Tim Deegan wrote:
> At 16:41 +0000 on 26 Nov (1353948092), Andrew Cooper wrote:
>> Repeated polling of the status register is not going to change its value, so
>> don't needlessly take 8192 traps to Qemu when 1 will do.
> AFAICS the purpose of this loop is to handle the case where someone's
> actually typing at the time.  The 0x2000 is intended to make us wait
> long enough for the next keypress or autorepeat.
>
> Reducing the loop to _2_ outb(0x80)s seems strange -- is there some case
> in qemu where another character will be presented after 2 delays but not
> immediately?

The reduction to 2 instead of 1 is because the while loop uses a
pre-decrement on max.

The patch was chosen at the time to have minimal change to the code.

~Andrew

>
> If not, can we dispense with 'max' altogether and just have 
>     while ( (inb(0x64) & 0x01) ) { inb(0x60); outb(0x80, 0x00); }
> or even
>     while ( (inb(0x64) & 0x01) ) inb(0x60);
> ?
>
> Tim.
>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>
>> diff -r 0049de3827bc -r 1728fb789940 tools/firmware/rombios/rombios.c
>> --- a/tools/firmware/rombios/rombios.c
>> +++ b/tools/firmware/rombios/rombios.c
>> @@ -1805,12 +1805,12 @@ keyboard_init()
>>      while ( (inb(0x64) & 0x02) && (--max>0)) outb(0x80, 0x00);
>>  
>>      /* flush incoming keys */
>> -    max=0x2000;
>> +    max=2;
>>      while (--max > 0) {
>>          outb(0x80, 0x00);
>>          if (inb(0x64) & 0x01) {
>>              inb(0x60);
>> -            max = 0x2000;
>> +            max = 2;
>>              }
>>          }
>>  
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 17:23:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 17:23:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOsc-0007Ob-GG; Tue, 27 Nov 2012 17:23:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TdOsb-0007OW-1r
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 17:23:29 +0000
Received: from [85.158.138.51:65037] by server-14.bemta-3.messagelabs.com id
	7E/64-31424-017F4B05; Tue, 27 Nov 2012 17:23:28 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1354037006!31694516!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5391 invoked from network); 27 Nov 2012 17:23:27 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 17:23:27 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215628577"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 17:22:53 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 12:22:53 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TdOs1-0001NZ-0z;
	Tue, 27 Nov 2012 17:22:53 +0000
Message-ID: <50B4F6EC.3050300@citrix.com>
Date: Tue, 27 Nov 2012 17:22:52 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<c223c044afbf9505c138.1353948093@andrewcoop.uk.xensource.com>
	<20121127164637.GG51942@ocelot.phlegethon.org>
	<20121127170844.536be218@pyramind.ukuu.org.uk>
In-Reply-To: <20121127170844.536be218@pyramind.ukuu.org.uk>
X-Enigmail-Version: 1.4.6
Cc: "Keir \(Xen.org\)" <keir@xen.org>, "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 5] rombios/ata: Do not wait for BSY to
 be set
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 27/11/12 17:08, Alan Cox wrote:
>> Does this actually do anything useful?  I'd guess that on qemu the extra
>> outb has no effect and on real hardware that needed a delay here, one
>> I/O cycle would not be enough.
> It ought to be plenty - the time before the response is valid from an ATA
> command is very short but in the real hardware world most definitely
> present and important.
>
> However you also need to think about the state of the device registers
> after the second outb. If you don't wait for BSY and for some reason it's
> delayed in the emulation or on a multiprocessor what occurs.
>
> Might be safer to do
>
> 	outb(0x80,0x00)
> 	await_ide(...)
>
> at which point the await_ide would run once in the usual case.
>
> Alan

No - this is what we are trying to avoid.

SEABios has explicitly removed the wait for the BSY bit to be set.  We
want to remove it because Qemu will not set the BSY bit, resulting in
42k needless polled IO traps while we wait for the timeout (which is, if
I remember correctly, based on a loop counter rather than any notion of
actual time)

We can certainly argue about the outb(0x80,0x00).  When I was comparing
ROMBios with SEABios, this outb was the closest I could easily get to a
udelay(5) without implement udelay() in ROMBios.  Xen will execute an
outb(0x80, 0x00) on the real hardware if a guest executes it; It will
never result in a trap to qemu.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 17:23:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 17:23:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdOsc-0007Ob-GG; Tue, 27 Nov 2012 17:23:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TdOsb-0007OW-1r
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 17:23:29 +0000
Received: from [85.158.138.51:65037] by server-14.bemta-3.messagelabs.com id
	7E/64-31424-017F4B05; Tue, 27 Nov 2012 17:23:28 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1354037006!31694516!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5391 invoked from network); 27 Nov 2012 17:23:27 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 17:23:27 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215628577"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 17:22:53 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 12:22:53 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TdOs1-0001NZ-0z;
	Tue, 27 Nov 2012 17:22:53 +0000
Message-ID: <50B4F6EC.3050300@citrix.com>
Date: Tue, 27 Nov 2012 17:22:52 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<c223c044afbf9505c138.1353948093@andrewcoop.uk.xensource.com>
	<20121127164637.GG51942@ocelot.phlegethon.org>
	<20121127170844.536be218@pyramind.ukuu.org.uk>
In-Reply-To: <20121127170844.536be218@pyramind.ukuu.org.uk>
X-Enigmail-Version: 1.4.6
Cc: "Keir \(Xen.org\)" <keir@xen.org>, "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 5] rombios/ata: Do not wait for BSY to
 be set
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 27/11/12 17:08, Alan Cox wrote:
>> Does this actually do anything useful?  I'd guess that on qemu the extra
>> outb has no effect and on real hardware that needed a delay here, one
>> I/O cycle would not be enough.
> It ought to be plenty - the time before the response is valid from an ATA
> command is very short but in the real hardware world most definitely
> present and important.
>
> However you also need to think about the state of the device registers
> after the second outb. If you don't wait for BSY and for some reason it's
> delayed in the emulation or on a multiprocessor what occurs.
>
> Might be safer to do
>
> 	outb(0x80,0x00)
> 	await_ide(...)
>
> at which point the await_ide would run once in the usual case.
>
> Alan

No - this is what we are trying to avoid.

SEABios has explicitly removed the wait for the BSY bit to be set.  We
want to remove it because Qemu will not set the BSY bit, resulting in
42k needless polled IO traps while we wait for the timeout (which is, if
I remember correctly, based on a loop counter rather than any notion of
actual time)

We can certainly argue about the outb(0x80,0x00).  When I was comparing
ROMBios with SEABios, this outb was the closest I could easily get to a
udelay(5) without implement udelay() in ROMBios.  Xen will execute an
outb(0x80, 0x00) on the real hardware if a guest executes it; It will
never result in a trap to qemu.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 17:40:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 17:40:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdP8W-0007bB-87; Tue, 27 Nov 2012 17:39:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kogee.leung@gmail.com>) id 1TdP1H-0007ZP-AJ
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 17:32:27 +0000
Received: from [85.158.139.83:36407] by server-16.bemta-5.messagelabs.com id
	64/53-04786-A29F4B05; Tue, 27 Nov 2012 17:32:26 +0000
X-Env-Sender: kogee.leung@gmail.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1354037544!32175663!1
X-Originating-IP: [216.139.236.26]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10045 invoked from network); 27 Nov 2012 17:32:25 -0000
Received: from sam.nabble.com (HELO sam.nabble.com) (216.139.236.26)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Nov 2012 17:32:25 -0000
Received: from [192.168.236.26] (helo=sam.nabble.com)
	by sam.nabble.com with esmtp (Exim 4.72)
	(envelope-from <kogee.leung@gmail.com>) id 1TdP1E-0007Ho-0S
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 09:32:24 -0800
Date: Tue, 27 Nov 2012 09:32:24 -0800 (PST)
From: eieiguy <kogee.leung@gmail.com>
To: xen-devel@lists.xensource.com
Message-ID: <1354037543967-5712577.post@n5.nabble.com>
In-Reply-To: <1342830368860-5710273.post@n5.nabble.com>
References: <1342830368860-5710273.post@n5.nabble.com>
MIME-Version: 1.0
X-Mailman-Approved-At: Tue, 27 Nov 2012 17:39:54 +0000
Subject: Re: [Xen-devel] Xen PCI/VGA passthrough failing on Ubuntu 12.04
	(64-bit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I believe your biggest problem is that the A75 chipset does not support
IOMMU.  Based on what I've read, it would be impossible to do vga
passthrough without it.  You best bet is a 990FX or 970 motherboard with any
AM3 or AM3+ cpu.




CalcProgrammer1 wrote
> I've been trying to set up a VGA-passthrough on my Ubuntu 12.04 box to run
> Windows (for gaming) while leaving my RAID-5 array available (managed by
> Linux).  First, here are the machine specs:
> 
> CPU:  AMD A8-3870K 3.4GHz Quad-Core APU
> GPU:  APU-integrated AMD Radeon 6550 (shared memory)
> Mobo:  ASUS F1A75-V EVO with AMD-virtualization enabled in UEFI-BIOS
> RAM:  8GB DDR3 1866 G-Skill Sniper (2x4GB)






--
View this message in context: http://xen.1045712.n5.nabble.com/Xen-PCI-VGA-passthrough-failing-on-Ubuntu-12-04-64-bit-tp5710273p5712577.html
Sent from the Xen - Dev mailing list archive at Nabble.com.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 17:40:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 17:40:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdP8W-0007bB-87; Tue, 27 Nov 2012 17:39:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kogee.leung@gmail.com>) id 1TdP1H-0007ZP-AJ
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 17:32:27 +0000
Received: from [85.158.139.83:36407] by server-16.bemta-5.messagelabs.com id
	64/53-04786-A29F4B05; Tue, 27 Nov 2012 17:32:26 +0000
X-Env-Sender: kogee.leung@gmail.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1354037544!32175663!1
X-Originating-IP: [216.139.236.26]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10045 invoked from network); 27 Nov 2012 17:32:25 -0000
Received: from sam.nabble.com (HELO sam.nabble.com) (216.139.236.26)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Nov 2012 17:32:25 -0000
Received: from [192.168.236.26] (helo=sam.nabble.com)
	by sam.nabble.com with esmtp (Exim 4.72)
	(envelope-from <kogee.leung@gmail.com>) id 1TdP1E-0007Ho-0S
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 09:32:24 -0800
Date: Tue, 27 Nov 2012 09:32:24 -0800 (PST)
From: eieiguy <kogee.leung@gmail.com>
To: xen-devel@lists.xensource.com
Message-ID: <1354037543967-5712577.post@n5.nabble.com>
In-Reply-To: <1342830368860-5710273.post@n5.nabble.com>
References: <1342830368860-5710273.post@n5.nabble.com>
MIME-Version: 1.0
X-Mailman-Approved-At: Tue, 27 Nov 2012 17:39:54 +0000
Subject: Re: [Xen-devel] Xen PCI/VGA passthrough failing on Ubuntu 12.04
	(64-bit)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

I believe your biggest problem is that the A75 chipset does not support
IOMMU.  Based on what I've read, it would be impossible to do vga
passthrough without it.  You best bet is a 990FX or 970 motherboard with any
AM3 or AM3+ cpu.




CalcProgrammer1 wrote
> I've been trying to set up a VGA-passthrough on my Ubuntu 12.04 box to run
> Windows (for gaming) while leaving my RAID-5 array available (managed by
> Linux).  First, here are the machine specs:
> 
> CPU:  AMD A8-3870K 3.4GHz Quad-Core APU
> GPU:  APU-integrated AMD Radeon 6550 (shared memory)
> Mobo:  ASUS F1A75-V EVO with AMD-virtualization enabled in UEFI-BIOS
> RAM:  8GB DDR3 1866 G-Skill Sniper (2x4GB)






--
View this message in context: http://xen.1045712.n5.nabble.com/Xen-PCI-VGA-passthrough-failing-on-Ubuntu-12-04-64-bit-tp5710273p5712577.html
Sent from the Xen - Dev mailing list archive at Nabble.com.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 17:44:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 17:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdPCB-0007jz-0s; Tue, 27 Nov 2012 17:43:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <alan@lxorguk.ukuu.org.uk>) id 1TdPC9-0007jr-PL
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 17:43:41 +0000
Received: from [85.158.138.51:45820] by server-9.bemta-3.messagelabs.com id
	4F/CB-02388-CCBF4B05; Tue, 27 Nov 2012 17:43:40 +0000
X-Env-Sender: alan@lxorguk.ukuu.org.uk
X-Msg-Ref: server-13.tower-174.messagelabs.com!1354038219!11996848!1
X-Originating-IP: [81.2.110.251]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21172 invoked from network); 27 Nov 2012 17:43:40 -0000
Received: from lxorguk.ukuu.org.uk (HELO lxorguk.ukuu.org.uk) (81.2.110.251)
	by server-13.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 17:43:40 -0000
Received: from pyramind.ukuu.org.uk (earthlight.etchedpixels.co.uk
	[81.2.110.250])
	by lxorguk.ukuu.org.uk (8.14.5/8.14.1) with ESMTP id qARIF9OL005451;
	Tue, 27 Nov 2012 18:15:14 GMT
Received: from pyramind.ukuu.org.uk (localhost [127.0.0.1])
	by pyramind.ukuu.org.uk (8.14.5/8.14.5) with ESMTP id qARHn0gc027194;
	Tue, 27 Nov 2012 17:49:01 GMT
Date: Tue, 27 Nov 2012 17:49:00 +0000
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121127174900.68a51564@pyramind.ukuu.org.uk>
In-Reply-To: <50B4F6EC.3050300@citrix.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<c223c044afbf9505c138.1353948093@andrewcoop.uk.xensource.com>
	<20121127164637.GG51942@ocelot.phlegethon.org>
	<20121127170844.536be218@pyramind.ukuu.org.uk>
	<50B4F6EC.3050300@citrix.com>
X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.8; x86_64-redhat-linux-gnu)
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEWysKsSBQMIAwIZCwj///8wIhxoRDXH9QHCAAABeUlEQVQ4jaXTvW7DIBAAYCQTzz2hdq+rdg494ZmBeE5KYHZjm/d/hJ6NfzBJpp5kRb5PHJwvMPMk2L9As5Y9AmYRBL+HAyJKeOU5aHRhsAAvORQ+UEgAvgddj/lwAXndw2laEDqA4x6KEBhjYRCg9tBFCOuJFxg2OKegbWjbsRTk8PPhKPD7HcRxB7cqhgBRp9Dcqs+B8v4CQvFdqeot3Kov6hBUn0AJitrzY+sgUuiA8i0r7+B3AfqKcN6t8M6HtqQ+AOoELCikgQSbgabKaJW3kn5lBs47JSGDhhLKDUh1UMipwwinMYPTBuIBjEclSaGZUk9hDlTb5sUTYN2SFFQuPe4Gox1X0FZOufjgBiV1Vls7b+GvK3SU4wfmcGo9rPPQzgIabfj4TYQo15k3bTHX9RIw/kniir5YbtJF4jkFG+dsDK1IgE413zAthU/vR2HVMmFUPIHTvF6jWCpFaGw/A3qWgnbxpSm9MSmY5b3pM1gvNc/gQfwBsGwF0VCtxZgAAAAASUVORK5CYII=
Mime-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>, "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 5] rombios/ata: Do not wait for BSY to
 be set
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

O> SEABios has explicitly removed the wait for the BSY bit to be set.  We
> want to remove it because Qemu will not set the BSY bit, resulting in

So why not fix the qemu emulation bug ?

> 42k needless polled IO traps while we wait for the timeout (which is, if
> I remember correctly, based on a loop counter rather than any notion of
> actual time)

Not good, although half caused by the fact that years on qemu still
hasn't implemented predictors to avoid trapping further than the kernel
layer 8)

> We can certainly argue about the outb(0x80,0x00).  When I was comparing
> ROMBios with SEABios, this outb was the closest I could easily get to a
> udelay(5) without implement udelay() in ROMBios.  Xen will execute an
> outb(0x80, 0x00) on the real hardware if a guest executes it; 

Don't do that then. 0x80 is not safe on a modern PC system (you'll note
the Linux kernel changed behaviour here). It may be a debug port but we've
seen some hardware do worse things if you touch it. It's also completely
out on a limb with EFI based systems which don't necessarily have the
legacy stuff present.

Alan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 17:44:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 17:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdPCB-0007jz-0s; Tue, 27 Nov 2012 17:43:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <alan@lxorguk.ukuu.org.uk>) id 1TdPC9-0007jr-PL
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 17:43:41 +0000
Received: from [85.158.138.51:45820] by server-9.bemta-3.messagelabs.com id
	4F/CB-02388-CCBF4B05; Tue, 27 Nov 2012 17:43:40 +0000
X-Env-Sender: alan@lxorguk.ukuu.org.uk
X-Msg-Ref: server-13.tower-174.messagelabs.com!1354038219!11996848!1
X-Originating-IP: [81.2.110.251]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21172 invoked from network); 27 Nov 2012 17:43:40 -0000
Received: from lxorguk.ukuu.org.uk (HELO lxorguk.ukuu.org.uk) (81.2.110.251)
	by server-13.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 17:43:40 -0000
Received: from pyramind.ukuu.org.uk (earthlight.etchedpixels.co.uk
	[81.2.110.250])
	by lxorguk.ukuu.org.uk (8.14.5/8.14.1) with ESMTP id qARIF9OL005451;
	Tue, 27 Nov 2012 18:15:14 GMT
Received: from pyramind.ukuu.org.uk (localhost [127.0.0.1])
	by pyramind.ukuu.org.uk (8.14.5/8.14.5) with ESMTP id qARHn0gc027194;
	Tue, 27 Nov 2012 17:49:01 GMT
Date: Tue, 27 Nov 2012 17:49:00 +0000
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121127174900.68a51564@pyramind.ukuu.org.uk>
In-Reply-To: <50B4F6EC.3050300@citrix.com>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<c223c044afbf9505c138.1353948093@andrewcoop.uk.xensource.com>
	<20121127164637.GG51942@ocelot.phlegethon.org>
	<20121127170844.536be218@pyramind.ukuu.org.uk>
	<50B4F6EC.3050300@citrix.com>
X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.8; x86_64-redhat-linux-gnu)
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEWysKsSBQMIAwIZCwj///8wIhxoRDXH9QHCAAABeUlEQVQ4jaXTvW7DIBAAYCQTzz2hdq+rdg494ZmBeE5KYHZjm/d/hJ6NfzBJpp5kRb5PHJwvMPMk2L9As5Y9AmYRBL+HAyJKeOU5aHRhsAAvORQ+UEgAvgddj/lwAXndw2laEDqA4x6KEBhjYRCg9tBFCOuJFxg2OKegbWjbsRTk8PPhKPD7HcRxB7cqhgBRp9Dcqs+B8v4CQvFdqeot3Kov6hBUn0AJitrzY+sgUuiA8i0r7+B3AfqKcN6t8M6HtqQ+AOoELCikgQSbgabKaJW3kn5lBs47JSGDhhLKDUh1UMipwwinMYPTBuIBjEclSaGZUk9hDlTb5sUTYN2SFFQuPe4Gox1X0FZOufjgBiV1Vls7b+GvK3SU4wfmcGo9rPPQzgIabfj4TYQo15k3bTHX9RIw/kniir5YbtJF4jkFG+dsDK1IgE413zAthU/vR2HVMmFUPIHTvF6jWCpFaGw/A3qWgnbxpSm9MSmY5b3pM1gvNc/gQfwBsGwF0VCtxZgAAAAASUVORK5CYII=
Mime-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>, "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 5] rombios/ata: Do not wait for BSY to
 be set
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

O> SEABios has explicitly removed the wait for the BSY bit to be set.  We
> want to remove it because Qemu will not set the BSY bit, resulting in

So why not fix the qemu emulation bug ?

> 42k needless polled IO traps while we wait for the timeout (which is, if
> I remember correctly, based on a loop counter rather than any notion of
> actual time)

Not good, although half caused by the fact that years on qemu still
hasn't implemented predictors to avoid trapping further than the kernel
layer 8)

> We can certainly argue about the outb(0x80,0x00).  When I was comparing
> ROMBios with SEABios, this outb was the closest I could easily get to a
> udelay(5) without implement udelay() in ROMBios.  Xen will execute an
> outb(0x80, 0x00) on the real hardware if a guest executes it; 

Don't do that then. 0x80 is not safe on a modern PC system (you'll note
the Linux kernel changed behaviour here). It may be a debug port but we've
seen some hardware do worse things if you touch it. It's also completely
out on a limb with EFI based systems which don't necessarily have the
legacy stuff present.

Alan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 18:09:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 18:09:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdPai-00084B-7I; Tue, 27 Nov 2012 18:09:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TdPag-000846-32
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 18:09:02 +0000
Received: from [85.158.143.35:36608] by server-1.bemta-4.messagelabs.com id
	3F/E2-27934-DB105B05; Tue, 27 Nov 2012 18:09:01 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-16.tower-21.messagelabs.com!1354039710!13154518!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32055 invoked from network); 27 Nov 2012 18:08:31 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 18:08:31 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158194705;
	Tue, 27 Nov 2012 13:08:24 -0500
Message-ID: <50B50193.3070303@jhuapl.edu>
Date: Tue, 27 Nov 2012 13:08:19 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-4-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1354029286-17652-4-git-send-email-dgdegra@tycho.nsa.gov>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 3/4] stubdom/grub: send kernel measurements
	to vTPM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4236764503469239884=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============4236764503469239884==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms090505050406040104080802"

This is a cryptographically signed message in MIME format.

--------------ms090505050406040104080802
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
> This allows a domU with an arbitrary kernel and initrd to take advantag=
e
> of the static root of trust provided by a vTPM.
Do you have any documentation updates for how to use it? They could be=20
added to the vtpm documentation if thats the most appropriate location.

How exactly does this work? Is it intended for HVM domains whos stubdom=20
is connected to a vtpm? I've never tried to use vtpm with HVMs yet, so=20
I'd be very surprised if it just works. Does it work for PVM domains?

I'm not terribly familiar with how grub in stubdom works.
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>   stubdom/grub/Makefile   |   2 +-
>   stubdom/grub/kexec.c    |  62 ++++++++++++
>   stubdom/grub/minios.cfg |   1 +
>   stubdom/grub/sha1.c     | 260 +++++++++++++++++++++++++++++++++++++++=
+++++++++
>   4 files changed, 324 insertions(+), 1 deletion(-)
>   create mode 100644 stubdom/grub/sha1.c
>
> diff --git a/stubdom/grub/Makefile b/stubdom/grub/Makefile
> index d6e3a1e..f1b5c3e 100644
> --- a/stubdom/grub/Makefile
> +++ b/stubdom/grub/Makefile
> @@ -59,7 +59,7 @@ NETBOOT_SOURCES:=3D$(addprefix netboot/,$(NETBOOT_SOU=
RCES))
>
>   $(BOOT): DEF_CPPFLAGS+=3D-D__ASSEMBLY__
>
> -PV_GRUB_SOURCES =3D kexec.c mini-os.c
> +PV_GRUB_SOURCES =3D sha1.c kexec.c mini-os.c
>
>   SOURCES =3D $(NETBOOT_SOURCES) $(STAGE2_SOURCES) $(PV_GRUB_SOURCES)
>
> diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
> index b21c91a..ba48cb7 100644
> --- a/stubdom/grub/kexec.c
> +++ b/stubdom/grub/kexec.c
> @@ -117,6 +117,66 @@ int kexec_allocate(struct xc_dom_image *dom, xen_v=
addr_t up_to)
>       return 0;
>   }
>
> +static inline uint16_t be16(uint16_t v)
> +{
> +       return (v >> 8) | (v << 8);
> +}
> +
> +static inline uint32_t be32(uint32_t v)
> +{
> +       return (be16(v) << 16) | be16(v >> 16);
> +}
> +
> +void sha_compute(uint32_t *buf, void *src, uint32_t len);
> +
> +#include <tpmfront.h>
> +
> +#define TPM_TAG_RQU_COMMAND 0xC1
> +#define TPM_ORD_Extend 20
> +
> +struct pcr_extend_cmd {
> +       uint16_t tag;
> +       uint32_t size;
> +       uint32_t ord;
> +
> +       uint32_t pcr;
> +       uint32_t hash[5];
> +} __attribute__((packed));
> +
> +static void tpm_hash2pcr(struct xc_dom_image *dom, char *cmdline)
> +{
> +       struct tpmfront_dev* tpm =3D init_tpmfront(NULL);
> +       uint8_t *resp;
> +       size_t resplen =3D 0;
> +       struct pcr_extend_cmd cmd;
> +
> +       /* If all guests have access to a vTPM, it may be useful to rep=
lace this
> +        * with ASSERT(tpm) to prevent configuration errors from allowi=
ng a guest
> +        * to boot without a TPM (or with a TPM that has not been sent =
any
> +        * measurements, which could allow forging the measurements).
> +        */
> +       if (!tpm)
> +               return;
> +
> +       cmd.tag =3D be16(TPM_TAG_RQU_COMMAND);
> +       cmd.size =3D be32(sizeof(cmd));
> +       cmd.ord =3D be32(TPM_ORD_Extend);
> +       cmd.pcr =3D be32(4); // PCR #4 for kernel
> +       sha_compute(cmd.hash, dom->kernel_blob, dom->kernel_size);
> +
> +       tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
> +
> +       cmd.pcr =3D be32(5); // PCR #5 for cmdline
> +       sha_compute(cmd.hash, cmdline, strlen(cmdline));
> +       tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
> +
> +       cmd.pcr =3D be32(5); // PCR #5 for initrd
> +       sha_compute(cmd.hash, dom->ramdisk_blob, dom->ramdisk_size);
> +       tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
> +
> +       shutdown_tpmfront(tpm, 1);
> +}
Does this actually work? vtpm-stubdom will shut itself down when the=20
frontend tpm disconnects. Is it really ok to connect and disconnect=20
these devices at will?
> +
>   void kexec(void *kernel, long kernel_size, void *module, long module_=
size, char *cmdline, unsigned long flags)
>   {
>       struct xc_dom_image *dom;
> @@ -151,6 +211,8 @@ void kexec(void *kernel, long kernel_size, void *mo=
dule, long module_size, char
>       dom->console_evtchn =3D start_info.console.domU.evtchn;
>       dom->xenstore_evtchn =3D start_info.store_evtchn;
>
> +    tpm_hash2pcr(dom, cmdline);
> +
>       if ( (rc =3D xc_dom_boot_xen_init(dom, xc_handle, domid)) !=3D 0 =
) {
>           grub_printf("xc_dom_boot_xen_init returned %d\n", rc);
>           errnum =3D ERR_BOOT_FAILURE;
> diff --git a/stubdom/grub/minios.cfg b/stubdom/grub/minios.cfg
> index 40cfa68..8df4909 100644
> --- a/stubdom/grub/minios.cfg
> +++ b/stubdom/grub/minios.cfg
> @@ -1,2 +1,3 @@
>   CONFIG_START_NETWORK=3Dn
>   CONFIG_SPARSE_BSS=3Dn
> +CONFIG_TPMFRONT=3Dy
> diff --git a/stubdom/grub/sha1.c b/stubdom/grub/sha1.c
> new file mode 100644
> index 0000000..2ad2e07
> --- /dev/null
> +++ b/stubdom/grub/sha1.c
> @@ -0,0 +1,260 @@
> +/*
> + * SHA1 routine optimized to do word accesses rather than byte accesse=
s,
> + * and to avoid unnecessary copies into the context array.
> + *
> + * This was based on the git SHA1 implementation.
> + */
> +
> +#include <stdint.h>
> +#include <string.h>
> +
> +static inline uint16_t be16(uint16_t v)
> +{
> +       return (v >> 8) | (v << 8);
> +}
> +
> +static inline uint32_t be32(uint32_t v)
> +{
> +       return (be16(v) << 16) | be16(v >> 16);
> +}
> +
> +static inline uint32_t get_unaligned_be32(uint32_t *v)
> +{
> +       return be32(*v);
> +}
These exist in mini-os byteorder.h now.
> +
> +/*
> + * rol32 - rotate a 32-bit value left
> + *
> + * @word: value to rotate
> + * @shift: bits to roll
> + */
> +static inline uint32_t rol32(uint32_t word, unsigned int shift)
> +{
> +    return (word << shift) | (word >> (32 - shift));
> +}
> +
> +/*
> + * ror32 - rotate a 32-bit value right
> + *
> + * @word: value to rotate
> + * @shift: bits to roll
> + */
> +static inline uint32_t ror32(uint32_t word, unsigned int shift)
> +{
> +    return (word >> shift) | (word << (32 - shift));
> +}
> +
> +
> +/*
> + * If you have 32 registers or more, the compiler can (and should)
> + * try to change the array[] accesses into registers. However, on
> + * machines with less than ~25 registers, that won't really work,
> + * and at least gcc will make an unholy mess of it.
> + *
> + * So to avoid that mess which just slows things down, we force
> + * the stores to memory to actually happen (we might be better off
> + * with a 'W(t)=3D(val);asm("":"+m" (W(t))' there instead, as
> + * suggested by Artur Skawina - that will also make gcc unable to
> + * try to do the silly "optimize away loads" part because it won't
> + * see what the value will be).
> + *
> + * Ben Herrenschmidt reports that on PPC, the C version comes close
> + * to the optimized asm with this (ie on PPC you don't want that
> + * 'volatile', since there are lots of registers).
> + *
> + * On ARM we get the best code generation by forcing a full memory bar=
rier
> + * between each SHA_ROUND, otherwise gcc happily get wild with spillin=
g and
> + * the stack frame size simply explode and performance goes down the d=
rain.
> + */
> +
> +#if 1
> +  #define setW(x, val) (*(volatile uint32_t *)&W(x) =3D (val))
> +#else
> +  #define setW(x, val) (W(x) =3D (val))
> +#endif
> +
> +/* This "rolls" over the 512-bit array */
> +#define W(x) (array[(x)&15])
> +
> +/*
> + * Where do we get the source from? The first 16 iterations get it fro=
m
> + * the input data, the next mix it from the 512-bit array.
> + */
> +#define SHA_SRC(t) get_unaligned_be32((uint32_t *)data + t)
> +#define SHA_MIX(t) rol32(W(t+13) ^ W(t+8) ^ W(t+2) ^ W(t), 1)
> +
> +#define SHA_ROUND(t, input, fn, constant, A, B, C, D, E) do { \
> +       uint32_t TEMP =3D input(t); setW(t, TEMP); \
> +       E +=3D TEMP + rol32(A,5) + (fn) + (constant); \
> +       B =3D ror32(B, 2); } while (0)
> +
> +#define T_0_15(t, A, B, C, D, E)  SHA_ROUND(t, SHA_SRC, (((C^D)&B)^D) =
, 0x5a827999, A, B, C, D, E )
> +#define T_16_19(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (((C^D)&B)^D) =
, 0x5a827999, A, B, C, D, E )
> +#define T_20_39(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (B^C^D) , 0x6e=
d9eba1, A, B, C, D, E )
> +#define T_40_59(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, ((B&C)+(D&(B^C=
))) , 0x8f1bbcdc, A, B, C, D, E )
> +#define T_60_79(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (B^C^D) ,  0xc=
a62c1d6, A, B, C, D, E )
> +
> +/**
> + * sha_transform - single block SHA1 transform
> + *
> + * @digest: 160 bit digest to update
> + * @data:   512 bits of data to hash
> + * @array:  16 words of workspace (see note)
> + *
> + * This function generates a SHA1 digest for a single 512-bit block.
> + * Be warned, it does not handle padding and message digest, do not
> + * confuse it with the full FIPS 180-1 digest algorithm for variable
> + * length messages.
> + *
> + * Note: If the hash is security sensitive, the caller should be sure
> + * to clear the workspace. This is left to the caller to avoid
> + * unnecessary clears between chained hashing operations.
> + */
> +void sha_transform(uint32_t *digest, const char *data, uint32_t *array=
)
> +{
> +       uint32_t A, B, C, D, E;
> +
> +       A =3D digest[0];
> +       B =3D digest[1];
> +       C =3D digest[2];
> +       D =3D digest[3];
> +       E =3D digest[4];
> +
> +       /* Round 1 - iterations 0-16 take their input from 'data' */
> +       T_0_15( 0, A, B, C, D, E);
> +       T_0_15( 1, E, A, B, C, D);
> +       T_0_15( 2, D, E, A, B, C);
> +       T_0_15( 3, C, D, E, A, B);
> +       T_0_15( 4, B, C, D, E, A);
> +       T_0_15( 5, A, B, C, D, E);
> +       T_0_15( 6, E, A, B, C, D);
> +       T_0_15( 7, D, E, A, B, C);
> +       T_0_15( 8, C, D, E, A, B);
> +       T_0_15( 9, B, C, D, E, A);
> +       T_0_15(10, A, B, C, D, E);
> +       T_0_15(11, E, A, B, C, D);
> +       T_0_15(12, D, E, A, B, C);
> +       T_0_15(13, C, D, E, A, B);
> +       T_0_15(14, B, C, D, E, A);
> +       T_0_15(15, A, B, C, D, E);
> +
> +       /* Round 1 - tail. Input from 512-bit mixing array */
> +       T_16_19(16, E, A, B, C, D);
> +       T_16_19(17, D, E, A, B, C);
> +       T_16_19(18, C, D, E, A, B);
> +       T_16_19(19, B, C, D, E, A);
> +
> +       /* Round 2 */
> +       T_20_39(20, A, B, C, D, E);
> +       T_20_39(21, E, A, B, C, D);
> +       T_20_39(22, D, E, A, B, C);
> +       T_20_39(23, C, D, E, A, B);
> +       T_20_39(24, B, C, D, E, A);
> +       T_20_39(25, A, B, C, D, E);
> +       T_20_39(26, E, A, B, C, D);
> +       T_20_39(27, D, E, A, B, C);
> +       T_20_39(28, C, D, E, A, B);
> +       T_20_39(29, B, C, D, E, A);
> +       T_20_39(30, A, B, C, D, E);
> +       T_20_39(31, E, A, B, C, D);
> +       T_20_39(32, D, E, A, B, C);
> +       T_20_39(33, C, D, E, A, B);
> +       T_20_39(34, B, C, D, E, A);
> +       T_20_39(35, A, B, C, D, E);
> +       T_20_39(36, E, A, B, C, D);
> +       T_20_39(37, D, E, A, B, C);
> +       T_20_39(38, C, D, E, A, B);
> +       T_20_39(39, B, C, D, E, A);
> +
> +       /* Round 3 */
> +       T_40_59(40, A, B, C, D, E);
> +       T_40_59(41, E, A, B, C, D);
> +       T_40_59(42, D, E, A, B, C);
> +       T_40_59(43, C, D, E, A, B);
> +       T_40_59(44, B, C, D, E, A);
> +       T_40_59(45, A, B, C, D, E);
> +       T_40_59(46, E, A, B, C, D);
> +       T_40_59(47, D, E, A, B, C);
> +       T_40_59(48, C, D, E, A, B);
> +       T_40_59(49, B, C, D, E, A);
> +       T_40_59(50, A, B, C, D, E);
> +       T_40_59(51, E, A, B, C, D);
> +       T_40_59(52, D, E, A, B, C);
> +       T_40_59(53, C, D, E, A, B);
> +       T_40_59(54, B, C, D, E, A);
> +       T_40_59(55, A, B, C, D, E);
> +       T_40_59(56, E, A, B, C, D);
> +       T_40_59(57, D, E, A, B, C);
> +       T_40_59(58, C, D, E, A, B);
> +       T_40_59(59, B, C, D, E, A);
> +
> +       /* Round 4 */
> +       T_60_79(60, A, B, C, D, E);
> +       T_60_79(61, E, A, B, C, D);
> +       T_60_79(62, D, E, A, B, C);
> +       T_60_79(63, C, D, E, A, B);
> +       T_60_79(64, B, C, D, E, A);
> +       T_60_79(65, A, B, C, D, E);
> +       T_60_79(66, E, A, B, C, D);
> +       T_60_79(67, D, E, A, B, C);
> +       T_60_79(68, C, D, E, A, B);
> +       T_60_79(69, B, C, D, E, A);
> +       T_60_79(70, A, B, C, D, E);
> +       T_60_79(71, E, A, B, C, D);
> +       T_60_79(72, D, E, A, B, C);
> +       T_60_79(73, C, D, E, A, B);
> +       T_60_79(74, B, C, D, E, A);
> +       T_60_79(75, A, B, C, D, E);
> +       T_60_79(76, E, A, B, C, D);
> +       T_60_79(77, D, E, A, B, C);
> +       T_60_79(78, C, D, E, A, B);
> +       T_60_79(79, B, C, D, E, A);
> +
> +       digest[0] +=3D A;
> +       digest[1] +=3D B;
> +       digest[2] +=3D C;
> +       digest[3] +=3D D;
> +       digest[4] +=3D E;
> +}
> +
> +/**
> + * sha_init - initialize the vectors for a SHA1 digest
> + * @buf: vector to initialize
> + */
> +void sha_init(uint32_t *buf)
> +{
> +       buf[0] =3D 0x67452301;
> +       buf[1] =3D 0xefcdab89;
> +       buf[2] =3D 0x98badcfe;
> +       buf[3] =3D 0x10325476;
> +       buf[4] =3D 0xc3d2e1f0;
> +}
> +
> +void sha_compute(uint32_t *buf, void *src, uint32_t len)
> +{
> +       uint32_t pos =3D 0;
> +       uint8_t final[64];
> +       uint32_t work[16];
> +       sha_init(buf);
> +       while (len >=3D pos + 64) {
> +               sha_transform(buf, src + pos, work);
> +               pos +=3D 64;
> +       }
> +       memcpy(final, src + pos, len - pos);
> +       // done with src; pos is now relative to final
> +       pos =3D len - pos;
> +       final[pos++] =3D 0x80;
> +       memset(final + pos, 0, sizeof(final) - pos);
> +       if (pos > 56) {
> +               sha_transform(buf, (void*)final, work);
> +               memset(final, 0, sizeof(final));
> +       }
> +       *(uint32_t*)(final + 60) =3D be32(len << 3);
> +       sha_transform(buf, (void*)final, work);
> +       buf[0] =3D be32(buf[0]);
> +       buf[1] =3D be32(buf[1]);
> +       buf[2] =3D be32(buf[2]);
> +       buf[3] =3D be32(buf[3]);
> +       buf[4] =3D be32(buf[4]);
> +}
There also exists a sha1 routine in polarssl. You can just link in the=20
polarssl sha1 object file without the entire library. This is what=20
vtpm-stubdom and vtpmmgrdom do to get the crypto pieces they need.=20
Checkout their makefiles for details.
Is there any reason using polarssl would be sub-optimal?
> --
> 1.7.11.7
>



--------------ms090505050406040104080802
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV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ATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEyNzE4MDgxOVowIwYJKoZIhvcNAQkEMRYEFH5eDknBdJ9B7TE1
/QEIblrWh/HOMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAtYectpJV8Sqn/WP7hb3AsCwRqETaaXbPy
m3Ig4jcE/MIzt4C0Neqz67/aZytcV/K7K5mvn60sfviVj8rf5IxYl7Z1ZsYupYhVWLMeYYD6
dShe1S35yyZPlUIs8oxEdjuMJkzFDENLkR6oX0kujeNHzpl7HRphMT0jaQrdxwKp4QAAAAAA
AA==
--------------ms090505050406040104080802--


--===============4236764503469239884==
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.xen.org
http://lists.xen.org/xen-devel

--===============4236764503469239884==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 18:09:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 18:09:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdPai-00084B-7I; Tue, 27 Nov 2012 18:09:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TdPag-000846-32
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 18:09:02 +0000
Received: from [85.158.143.35:36608] by server-1.bemta-4.messagelabs.com id
	3F/E2-27934-DB105B05; Tue, 27 Nov 2012 18:09:01 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-16.tower-21.messagelabs.com!1354039710!13154518!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32055 invoked from network); 27 Nov 2012 18:08:31 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 18:08:31 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158194705;
	Tue, 27 Nov 2012 13:08:24 -0500
Message-ID: <50B50193.3070303@jhuapl.edu>
Date: Tue, 27 Nov 2012 13:08:19 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-4-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1354029286-17652-4-git-send-email-dgdegra@tycho.nsa.gov>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 3/4] stubdom/grub: send kernel measurements
	to vTPM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4236764503469239884=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============4236764503469239884==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms090505050406040104080802"

This is a cryptographically signed message in MIME format.

--------------ms090505050406040104080802
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
> This allows a domU with an arbitrary kernel and initrd to take advantag=
e
> of the static root of trust provided by a vTPM.
Do you have any documentation updates for how to use it? They could be=20
added to the vtpm documentation if thats the most appropriate location.

How exactly does this work? Is it intended for HVM domains whos stubdom=20
is connected to a vtpm? I've never tried to use vtpm with HVMs yet, so=20
I'd be very surprised if it just works. Does it work for PVM domains?

I'm not terribly familiar with how grub in stubdom works.
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>   stubdom/grub/Makefile   |   2 +-
>   stubdom/grub/kexec.c    |  62 ++++++++++++
>   stubdom/grub/minios.cfg |   1 +
>   stubdom/grub/sha1.c     | 260 +++++++++++++++++++++++++++++++++++++++=
+++++++++
>   4 files changed, 324 insertions(+), 1 deletion(-)
>   create mode 100644 stubdom/grub/sha1.c
>
> diff --git a/stubdom/grub/Makefile b/stubdom/grub/Makefile
> index d6e3a1e..f1b5c3e 100644
> --- a/stubdom/grub/Makefile
> +++ b/stubdom/grub/Makefile
> @@ -59,7 +59,7 @@ NETBOOT_SOURCES:=3D$(addprefix netboot/,$(NETBOOT_SOU=
RCES))
>
>   $(BOOT): DEF_CPPFLAGS+=3D-D__ASSEMBLY__
>
> -PV_GRUB_SOURCES =3D kexec.c mini-os.c
> +PV_GRUB_SOURCES =3D sha1.c kexec.c mini-os.c
>
>   SOURCES =3D $(NETBOOT_SOURCES) $(STAGE2_SOURCES) $(PV_GRUB_SOURCES)
>
> diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
> index b21c91a..ba48cb7 100644
> --- a/stubdom/grub/kexec.c
> +++ b/stubdom/grub/kexec.c
> @@ -117,6 +117,66 @@ int kexec_allocate(struct xc_dom_image *dom, xen_v=
addr_t up_to)
>       return 0;
>   }
>
> +static inline uint16_t be16(uint16_t v)
> +{
> +       return (v >> 8) | (v << 8);
> +}
> +
> +static inline uint32_t be32(uint32_t v)
> +{
> +       return (be16(v) << 16) | be16(v >> 16);
> +}
> +
> +void sha_compute(uint32_t *buf, void *src, uint32_t len);
> +
> +#include <tpmfront.h>
> +
> +#define TPM_TAG_RQU_COMMAND 0xC1
> +#define TPM_ORD_Extend 20
> +
> +struct pcr_extend_cmd {
> +       uint16_t tag;
> +       uint32_t size;
> +       uint32_t ord;
> +
> +       uint32_t pcr;
> +       uint32_t hash[5];
> +} __attribute__((packed));
> +
> +static void tpm_hash2pcr(struct xc_dom_image *dom, char *cmdline)
> +{
> +       struct tpmfront_dev* tpm =3D init_tpmfront(NULL);
> +       uint8_t *resp;
> +       size_t resplen =3D 0;
> +       struct pcr_extend_cmd cmd;
> +
> +       /* If all guests have access to a vTPM, it may be useful to rep=
lace this
> +        * with ASSERT(tpm) to prevent configuration errors from allowi=
ng a guest
> +        * to boot without a TPM (or with a TPM that has not been sent =
any
> +        * measurements, which could allow forging the measurements).
> +        */
> +       if (!tpm)
> +               return;
> +
> +       cmd.tag =3D be16(TPM_TAG_RQU_COMMAND);
> +       cmd.size =3D be32(sizeof(cmd));
> +       cmd.ord =3D be32(TPM_ORD_Extend);
> +       cmd.pcr =3D be32(4); // PCR #4 for kernel
> +       sha_compute(cmd.hash, dom->kernel_blob, dom->kernel_size);
> +
> +       tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
> +
> +       cmd.pcr =3D be32(5); // PCR #5 for cmdline
> +       sha_compute(cmd.hash, cmdline, strlen(cmdline));
> +       tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
> +
> +       cmd.pcr =3D be32(5); // PCR #5 for initrd
> +       sha_compute(cmd.hash, dom->ramdisk_blob, dom->ramdisk_size);
> +       tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
> +
> +       shutdown_tpmfront(tpm, 1);
> +}
Does this actually work? vtpm-stubdom will shut itself down when the=20
frontend tpm disconnects. Is it really ok to connect and disconnect=20
these devices at will?
> +
>   void kexec(void *kernel, long kernel_size, void *module, long module_=
size, char *cmdline, unsigned long flags)
>   {
>       struct xc_dom_image *dom;
> @@ -151,6 +211,8 @@ void kexec(void *kernel, long kernel_size, void *mo=
dule, long module_size, char
>       dom->console_evtchn =3D start_info.console.domU.evtchn;
>       dom->xenstore_evtchn =3D start_info.store_evtchn;
>
> +    tpm_hash2pcr(dom, cmdline);
> +
>       if ( (rc =3D xc_dom_boot_xen_init(dom, xc_handle, domid)) !=3D 0 =
) {
>           grub_printf("xc_dom_boot_xen_init returned %d\n", rc);
>           errnum =3D ERR_BOOT_FAILURE;
> diff --git a/stubdom/grub/minios.cfg b/stubdom/grub/minios.cfg
> index 40cfa68..8df4909 100644
> --- a/stubdom/grub/minios.cfg
> +++ b/stubdom/grub/minios.cfg
> @@ -1,2 +1,3 @@
>   CONFIG_START_NETWORK=3Dn
>   CONFIG_SPARSE_BSS=3Dn
> +CONFIG_TPMFRONT=3Dy
> diff --git a/stubdom/grub/sha1.c b/stubdom/grub/sha1.c
> new file mode 100644
> index 0000000..2ad2e07
> --- /dev/null
> +++ b/stubdom/grub/sha1.c
> @@ -0,0 +1,260 @@
> +/*
> + * SHA1 routine optimized to do word accesses rather than byte accesse=
s,
> + * and to avoid unnecessary copies into the context array.
> + *
> + * This was based on the git SHA1 implementation.
> + */
> +
> +#include <stdint.h>
> +#include <string.h>
> +
> +static inline uint16_t be16(uint16_t v)
> +{
> +       return (v >> 8) | (v << 8);
> +}
> +
> +static inline uint32_t be32(uint32_t v)
> +{
> +       return (be16(v) << 16) | be16(v >> 16);
> +}
> +
> +static inline uint32_t get_unaligned_be32(uint32_t *v)
> +{
> +       return be32(*v);
> +}
These exist in mini-os byteorder.h now.
> +
> +/*
> + * rol32 - rotate a 32-bit value left
> + *
> + * @word: value to rotate
> + * @shift: bits to roll
> + */
> +static inline uint32_t rol32(uint32_t word, unsigned int shift)
> +{
> +    return (word << shift) | (word >> (32 - shift));
> +}
> +
> +/*
> + * ror32 - rotate a 32-bit value right
> + *
> + * @word: value to rotate
> + * @shift: bits to roll
> + */
> +static inline uint32_t ror32(uint32_t word, unsigned int shift)
> +{
> +    return (word >> shift) | (word << (32 - shift));
> +}
> +
> +
> +/*
> + * If you have 32 registers or more, the compiler can (and should)
> + * try to change the array[] accesses into registers. However, on
> + * machines with less than ~25 registers, that won't really work,
> + * and at least gcc will make an unholy mess of it.
> + *
> + * So to avoid that mess which just slows things down, we force
> + * the stores to memory to actually happen (we might be better off
> + * with a 'W(t)=3D(val);asm("":"+m" (W(t))' there instead, as
> + * suggested by Artur Skawina - that will also make gcc unable to
> + * try to do the silly "optimize away loads" part because it won't
> + * see what the value will be).
> + *
> + * Ben Herrenschmidt reports that on PPC, the C version comes close
> + * to the optimized asm with this (ie on PPC you don't want that
> + * 'volatile', since there are lots of registers).
> + *
> + * On ARM we get the best code generation by forcing a full memory bar=
rier
> + * between each SHA_ROUND, otherwise gcc happily get wild with spillin=
g and
> + * the stack frame size simply explode and performance goes down the d=
rain.
> + */
> +
> +#if 1
> +  #define setW(x, val) (*(volatile uint32_t *)&W(x) =3D (val))
> +#else
> +  #define setW(x, val) (W(x) =3D (val))
> +#endif
> +
> +/* This "rolls" over the 512-bit array */
> +#define W(x) (array[(x)&15])
> +
> +/*
> + * Where do we get the source from? The first 16 iterations get it fro=
m
> + * the input data, the next mix it from the 512-bit array.
> + */
> +#define SHA_SRC(t) get_unaligned_be32((uint32_t *)data + t)
> +#define SHA_MIX(t) rol32(W(t+13) ^ W(t+8) ^ W(t+2) ^ W(t), 1)
> +
> +#define SHA_ROUND(t, input, fn, constant, A, B, C, D, E) do { \
> +       uint32_t TEMP =3D input(t); setW(t, TEMP); \
> +       E +=3D TEMP + rol32(A,5) + (fn) + (constant); \
> +       B =3D ror32(B, 2); } while (0)
> +
> +#define T_0_15(t, A, B, C, D, E)  SHA_ROUND(t, SHA_SRC, (((C^D)&B)^D) =
, 0x5a827999, A, B, C, D, E )
> +#define T_16_19(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (((C^D)&B)^D) =
, 0x5a827999, A, B, C, D, E )
> +#define T_20_39(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (B^C^D) , 0x6e=
d9eba1, A, B, C, D, E )
> +#define T_40_59(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, ((B&C)+(D&(B^C=
))) , 0x8f1bbcdc, A, B, C, D, E )
> +#define T_60_79(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (B^C^D) ,  0xc=
a62c1d6, A, B, C, D, E )
> +
> +/**
> + * sha_transform - single block SHA1 transform
> + *
> + * @digest: 160 bit digest to update
> + * @data:   512 bits of data to hash
> + * @array:  16 words of workspace (see note)
> + *
> + * This function generates a SHA1 digest for a single 512-bit block.
> + * Be warned, it does not handle padding and message digest, do not
> + * confuse it with the full FIPS 180-1 digest algorithm for variable
> + * length messages.
> + *
> + * Note: If the hash is security sensitive, the caller should be sure
> + * to clear the workspace. This is left to the caller to avoid
> + * unnecessary clears between chained hashing operations.
> + */
> +void sha_transform(uint32_t *digest, const char *data, uint32_t *array=
)
> +{
> +       uint32_t A, B, C, D, E;
> +
> +       A =3D digest[0];
> +       B =3D digest[1];
> +       C =3D digest[2];
> +       D =3D digest[3];
> +       E =3D digest[4];
> +
> +       /* Round 1 - iterations 0-16 take their input from 'data' */
> +       T_0_15( 0, A, B, C, D, E);
> +       T_0_15( 1, E, A, B, C, D);
> +       T_0_15( 2, D, E, A, B, C);
> +       T_0_15( 3, C, D, E, A, B);
> +       T_0_15( 4, B, C, D, E, A);
> +       T_0_15( 5, A, B, C, D, E);
> +       T_0_15( 6, E, A, B, C, D);
> +       T_0_15( 7, D, E, A, B, C);
> +       T_0_15( 8, C, D, E, A, B);
> +       T_0_15( 9, B, C, D, E, A);
> +       T_0_15(10, A, B, C, D, E);
> +       T_0_15(11, E, A, B, C, D);
> +       T_0_15(12, D, E, A, B, C);
> +       T_0_15(13, C, D, E, A, B);
> +       T_0_15(14, B, C, D, E, A);
> +       T_0_15(15, A, B, C, D, E);
> +
> +       /* Round 1 - tail. Input from 512-bit mixing array */
> +       T_16_19(16, E, A, B, C, D);
> +       T_16_19(17, D, E, A, B, C);
> +       T_16_19(18, C, D, E, A, B);
> +       T_16_19(19, B, C, D, E, A);
> +
> +       /* Round 2 */
> +       T_20_39(20, A, B, C, D, E);
> +       T_20_39(21, E, A, B, C, D);
> +       T_20_39(22, D, E, A, B, C);
> +       T_20_39(23, C, D, E, A, B);
> +       T_20_39(24, B, C, D, E, A);
> +       T_20_39(25, A, B, C, D, E);
> +       T_20_39(26, E, A, B, C, D);
> +       T_20_39(27, D, E, A, B, C);
> +       T_20_39(28, C, D, E, A, B);
> +       T_20_39(29, B, C, D, E, A);
> +       T_20_39(30, A, B, C, D, E);
> +       T_20_39(31, E, A, B, C, D);
> +       T_20_39(32, D, E, A, B, C);
> +       T_20_39(33, C, D, E, A, B);
> +       T_20_39(34, B, C, D, E, A);
> +       T_20_39(35, A, B, C, D, E);
> +       T_20_39(36, E, A, B, C, D);
> +       T_20_39(37, D, E, A, B, C);
> +       T_20_39(38, C, D, E, A, B);
> +       T_20_39(39, B, C, D, E, A);
> +
> +       /* Round 3 */
> +       T_40_59(40, A, B, C, D, E);
> +       T_40_59(41, E, A, B, C, D);
> +       T_40_59(42, D, E, A, B, C);
> +       T_40_59(43, C, D, E, A, B);
> +       T_40_59(44, B, C, D, E, A);
> +       T_40_59(45, A, B, C, D, E);
> +       T_40_59(46, E, A, B, C, D);
> +       T_40_59(47, D, E, A, B, C);
> +       T_40_59(48, C, D, E, A, B);
> +       T_40_59(49, B, C, D, E, A);
> +       T_40_59(50, A, B, C, D, E);
> +       T_40_59(51, E, A, B, C, D);
> +       T_40_59(52, D, E, A, B, C);
> +       T_40_59(53, C, D, E, A, B);
> +       T_40_59(54, B, C, D, E, A);
> +       T_40_59(55, A, B, C, D, E);
> +       T_40_59(56, E, A, B, C, D);
> +       T_40_59(57, D, E, A, B, C);
> +       T_40_59(58, C, D, E, A, B);
> +       T_40_59(59, B, C, D, E, A);
> +
> +       /* Round 4 */
> +       T_60_79(60, A, B, C, D, E);
> +       T_60_79(61, E, A, B, C, D);
> +       T_60_79(62, D, E, A, B, C);
> +       T_60_79(63, C, D, E, A, B);
> +       T_60_79(64, B, C, D, E, A);
> +       T_60_79(65, A, B, C, D, E);
> +       T_60_79(66, E, A, B, C, D);
> +       T_60_79(67, D, E, A, B, C);
> +       T_60_79(68, C, D, E, A, B);
> +       T_60_79(69, B, C, D, E, A);
> +       T_60_79(70, A, B, C, D, E);
> +       T_60_79(71, E, A, B, C, D);
> +       T_60_79(72, D, E, A, B, C);
> +       T_60_79(73, C, D, E, A, B);
> +       T_60_79(74, B, C, D, E, A);
> +       T_60_79(75, A, B, C, D, E);
> +       T_60_79(76, E, A, B, C, D);
> +       T_60_79(77, D, E, A, B, C);
> +       T_60_79(78, C, D, E, A, B);
> +       T_60_79(79, B, C, D, E, A);
> +
> +       digest[0] +=3D A;
> +       digest[1] +=3D B;
> +       digest[2] +=3D C;
> +       digest[3] +=3D D;
> +       digest[4] +=3D E;
> +}
> +
> +/**
> + * sha_init - initialize the vectors for a SHA1 digest
> + * @buf: vector to initialize
> + */
> +void sha_init(uint32_t *buf)
> +{
> +       buf[0] =3D 0x67452301;
> +       buf[1] =3D 0xefcdab89;
> +       buf[2] =3D 0x98badcfe;
> +       buf[3] =3D 0x10325476;
> +       buf[4] =3D 0xc3d2e1f0;
> +}
> +
> +void sha_compute(uint32_t *buf, void *src, uint32_t len)
> +{
> +       uint32_t pos =3D 0;
> +       uint8_t final[64];
> +       uint32_t work[16];
> +       sha_init(buf);
> +       while (len >=3D pos + 64) {
> +               sha_transform(buf, src + pos, work);
> +               pos +=3D 64;
> +       }
> +       memcpy(final, src + pos, len - pos);
> +       // done with src; pos is now relative to final
> +       pos =3D len - pos;
> +       final[pos++] =3D 0x80;
> +       memset(final + pos, 0, sizeof(final) - pos);
> +       if (pos > 56) {
> +               sha_transform(buf, (void*)final, work);
> +               memset(final, 0, sizeof(final));
> +       }
> +       *(uint32_t*)(final + 60) =3D be32(len << 3);
> +       sha_transform(buf, (void*)final, work);
> +       buf[0] =3D be32(buf[0]);
> +       buf[1] =3D be32(buf[1]);
> +       buf[2] =3D be32(buf[2]);
> +       buf[3] =3D be32(buf[3]);
> +       buf[4] =3D be32(buf[4]);
> +}
There also exists a sha1 routine in polarssl. You can just link in the=20
polarssl sha1 object file without the entire library. This is what=20
vtpm-stubdom and vtpmmgrdom do to get the crypto pieces they need.=20
Checkout their makefiles for details.
Is there any reason using polarssl would be sub-optimal?
> --
> 1.7.11.7
>



--------------ms090505050406040104080802
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIV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EAJO9HQh4YNChVLzuZqK5ARJARD8JoujGZ
fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEyNzE4MDgxOVowIwYJKoZIhvcNAQkEMRYEFH5eDknBdJ9B7TE1
/QEIblrWh/HOMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAtYectpJV8Sqn/WP7hb3AsCwRqETaaXbPy
m3Ig4jcE/MIzt4C0Neqz67/aZytcV/K7K5mvn60sfviVj8rf5IxYl7Z1ZsYupYhVWLMeYYD6
dShe1S35yyZPlUIs8oxEdjuMJkzFDENLkR6oX0kujeNHzpl7HRphMT0jaQrdxwKp4QAAAAAA
AA==
--------------ms090505050406040104080802--


--===============4236764503469239884==
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.xen.org
http://lists.xen.org/xen-devel

--===============4236764503469239884==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 18:13:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 18:13:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdPek-0008Eh-35; Tue, 27 Nov 2012 18:13:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TdPeh-0008Eb-Rc
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 18:13:12 +0000
Received: from [193.109.254.147:49123] by server-14.bemta-14.messagelabs.com
	id 41/65-14517-7B205B05; Tue, 27 Nov 2012 18:13:11 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1354039986!8510269!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10863 invoked from network); 27 Nov 2012 18:13:06 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 18:13:06 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16031310"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 18:12:44 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 27 Nov 2012 18:12:44 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TdPeF-0007gj-Rx;
	Tue, 27 Nov 2012 18:12:43 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TdPeF-0004LP-8B;
	Tue, 27 Nov 2012 18:12:43 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14481-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 27 Nov 2012 18:12:43 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [linux-3.0 test] 14481: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14481 linux-3.0 real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14481/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14415
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14415

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass

version targeted for testing:
 linux                2fc3fd44850e68f21ce1746c2e94470cab44ffab
baseline version:
 linux                89d2d133c6947c04a8ab539b997f266535beaafe

------------------------------------------------------------
People who touched revisions under test:
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=linux-3.0
+ revision=2fc3fd44850e68f21ce1746c2e94470cab44ffab
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push linux-3.0 2fc3fd44850e68f21ce1746c2e94470cab44ffab
+ branch=linux-3.0
+ revision=2fc3fd44850e68f21ce1746c2e94470cab44ffab
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=linux
+ xenbranch=xen-unstable
+ '[' xlinux = xlinux ']'
+ linuxbranch=linux-3.0
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.linux-3.0
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.linux-3.0
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree linux-3.0
+ case $1 in
+ : git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
+ : linux-3.0.y
+ : linux-3.0.y
+ : git
+ : git
+ : git://xenbits.xen.org/linux-pvops.git
+ : xen@xenbits.xensource.com:git/linux-pvops.git
+ : tested/linux-3.0
+ : tested/linux-3.0
+ return 0
+ cd /export/home/osstest/repos/linux
+ git push xen@xenbits.xensource.com:git/linux-pvops.git 2fc3fd44850e68f21ce1746c2e94470cab44ffab:tested/linux-3.0
Counting objects: 1   
Counting objects: 311, done.
Compressing objects:   2% (1/39)   
Compressing objects:   5% (2/39)   
Compressing objects:   7% (3/39)   
Compressing objects:  10% (4/39)   
Compressing objects:  12% (5/39)   
Compressing objects:  15% (6/39)   
Compressing objects:  17% (7/39)   
Compressing objects:  20% (8/39)   
Compressing objects:  23% (9/39)   
Compressing objects:  25% (10/39)   
Compressing objects:  28% (11/39)   
Compressing objects:  30% (12/39)   
Compressing objects:  33% (13/39)   
Compressing objects:  35% (14/39)   
Compressing objects:  38% (15/39)   
Compressing objects:  41% (16/39)   
Compressing objects:  43% (17/39)   
Compressing objects:  46% (18/39)   
Compressing objects:  48% (19/39)   
Compressing objects:  51% (20/39)   
Compressing objects:  53% (21/39)   
Compressing objects:  56% (22/39)   
Compressing objects:  58% (23/39)   
Compressing objects:  61% (24/39)   
Compressing objects:  64% (25/39)   
Compressing objects:  66% (26/39)   
Compressing objects:  69% (27/39)   
Compressing objects:  71% (28/39)   
Compressing objects:  74% (29/39)   
Compressing objects:  76% (30/39)   
Compressing objects:  79% (31/39)   
Compressing objects:  82% (32/39)   
Compressing objects:  84% (33/39)   
Compressing objects:  87% (34/39)   
Compressing objects:  89% (35/39)   
Compressing objects:  92% (36/39)   
Compressing objects:  94% (37/39)   
Compressing objects:  97% (38/39)   
Compressing objects: 100% (39/39)   
Compressing objects: 100% (39/39), done.
Writing objects:   0% (1/220)   
Writing objects:   1% (3/220)   
Writing objects:   2% (5/220)   
Writing objects:   3% (7/220)   
Writing objects:   4% (9/220)   
Writing objects:   5% (11/220)   
Writing objects:   6% (14/220)   
Writing objects:   7% (16/220)   
Writing objects:   8% (18/220)   
Writing objects:   9% (20/220)   
Writing objects:  10% (22/220)   
Writing objects:  11% (25/220)   
Writing objects:  12% (27/220)   
Writing objects:  13% (29/220)   
Writing objects:  14% (31/220)   
Writing objects:  15% (33/220)   
Writing objects:  16% (36/220)   
Writing objects:  17% (38/220)   
Writing objects:  18% (40/220)   
Writing objects:  19% (42/220)   
Writing objects:  20% (44/220)   
Writing objects:  21% (47/220)   
Writing objects:  22% (49/220)   
Writing objects:  23% (51/220)   
Writing objects:  24% (53/220)   
Writing objects:  25% (55/220)   
Writing objects:  26% (58/220)   
Writing objects:  27% (60/220)   
Writing objects:  28% (62/220)   
Writing objects:  29% (64/220)   
Writing objects:  30% (66/220)   
Writing objects:  31% (69/220)   
Writing objects:  32% (71/220)   
Writing objects:  33% (73/220)   
Writing objects:  34% (75/220)   
Writing objects:  35% (77/220)   
Writing objects:  36% (80/220)   
Writing objects:  37% (82/220)   
Writing objects:  38% (84/220)   
Writing objects:  39% (86/220)   
Writing objects:  40% (88/220)   
Writing objects:  41% (91/220)   
Writing objects:  42% (93/220)   
Writing objects:  43% (95/220)   
Writing objects:  44% (97/220)   
Writing objects:  45% (99/220)   
Writing objects:  46% (102/220)   
Writing objects:  47% (105/220)   
Writing objects:  48% (106/220)   
Writing objects:  49% (108/220)   
Writing objects:  50% (110/220)   
Writing objects:  51% (113/220)   
Writing objects:  52% (115/220)   
Writing objects:  53% (117/220)   
Writing objects:  54% (119/220)   
Writing objects:  55% (121/220)   
Writing objects:  56% (124/220)   
Writing objects:  57% (126/220)   
Writing objects:  58% (128/220)   
Writing objects:  59% (130/220)   
Writing objects:  60% (132/220)   
Writing objects:  61% (135/220)   
Writing objects:  62% (137/220)   
Writing objects:  63% (139/220)   
Writing objects:  64% (141/220)   
Writing objects:  65% (143/220)   
Writing objects:  66% (146/220)   
Writing objects:  67% (148/220)   
Writing objects:  68% (150/220)   
Writing objects:  69% (152/220)   
Writing objects:  70% (154/220)   
Writing objects:  71% (157/220)   
Writing objects:  72% (159/220)   
Writing objects:  73% (161/220)   
Writing objects:  74% (163/220)   
Writing objects:  75% (165/220)   
Writing objects:  76% (168/220)   
Writing objects:  77% (170/220)   
Writing objects:  78% (172/220)   
Writing objects:  79% (174/220)   
Writing objects:  80% (176/220)   
Writing objects:  81% (179/220)   
Writing objects:  82% (181/220)   
Writing objects:  83% (183/220)   
Writing objects:  84% (185/220)   
Writing objects:  85% (187/220)   
Writing objects:  86% (190/220)   
Writing objects:  87% (192/220)   
Writing objects:  88% (194/220)   
Writing objects:  89% (196/220)   
Writing objects:  90% (198/220)   
Writing objects:  91% (201/220)   
Writing objects:  92% (203/220)   
Writing objects:  93% (205/220)   
Writing objects:  94% (207/220)   
Writing objects:  95% (209/220)   
Writing objects:  96% (212/220)   
Writing objects:  97% (214/220)   
Writing objects:  98% (216/220)   
Writing objects:  99% (218/220)   
Writing objects: 100% (220/220)   
Writing objects: 100% (220/220), 36.56 KiB, done.
Total 220 (delta 180), reused 220 (delta 180)
To xen@xenbits.xensource.com:git/linux-pvops.git
   89d2d13..2fc3fd4  2fc3fd44850e68f21ce1746c2e94470cab44ffab -> tested/linux-3.0
+ exit 0

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 18:13:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 18:13:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdPek-0008Eh-35; Tue, 27 Nov 2012 18:13:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TdPeh-0008Eb-Rc
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 18:13:12 +0000
Received: from [193.109.254.147:49123] by server-14.bemta-14.messagelabs.com
	id 41/65-14517-7B205B05; Tue, 27 Nov 2012 18:13:11 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1354039986!8510269!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10863 invoked from network); 27 Nov 2012 18:13:06 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 18:13:06 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16031310"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 18:12:44 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 27 Nov 2012 18:12:44 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TdPeF-0007gj-Rx;
	Tue, 27 Nov 2012 18:12:43 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TdPeF-0004LP-8B;
	Tue, 27 Nov 2012 18:12:43 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14481-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 27 Nov 2012 18:12:43 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [linux-3.0 test] 14481: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14481 linux-3.0 real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14481/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14415
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14415

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass

version targeted for testing:
 linux                2fc3fd44850e68f21ce1746c2e94470cab44ffab
baseline version:
 linux                89d2d133c6947c04a8ab539b997f266535beaafe

------------------------------------------------------------
People who touched revisions under test:
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=linux-3.0
+ revision=2fc3fd44850e68f21ce1746c2e94470cab44ffab
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push linux-3.0 2fc3fd44850e68f21ce1746c2e94470cab44ffab
+ branch=linux-3.0
+ revision=2fc3fd44850e68f21ce1746c2e94470cab44ffab
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=linux
+ xenbranch=xen-unstable
+ '[' xlinux = xlinux ']'
+ linuxbranch=linux-3.0
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.linux-3.0
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.linux-3.0
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree linux-3.0
+ case $1 in
+ : git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
+ : linux-3.0.y
+ : linux-3.0.y
+ : git
+ : git
+ : git://xenbits.xen.org/linux-pvops.git
+ : xen@xenbits.xensource.com:git/linux-pvops.git
+ : tested/linux-3.0
+ : tested/linux-3.0
+ return 0
+ cd /export/home/osstest/repos/linux
+ git push xen@xenbits.xensource.com:git/linux-pvops.git 2fc3fd44850e68f21ce1746c2e94470cab44ffab:tested/linux-3.0
Counting objects: 1   
Counting objects: 311, done.
Compressing objects:   2% (1/39)   
Compressing objects:   5% (2/39)   
Compressing objects:   7% (3/39)   
Compressing objects:  10% (4/39)   
Compressing objects:  12% (5/39)   
Compressing objects:  15% (6/39)   
Compressing objects:  17% (7/39)   
Compressing objects:  20% (8/39)   
Compressing objects:  23% (9/39)   
Compressing objects:  25% (10/39)   
Compressing objects:  28% (11/39)   
Compressing objects:  30% (12/39)   
Compressing objects:  33% (13/39)   
Compressing objects:  35% (14/39)   
Compressing objects:  38% (15/39)   
Compressing objects:  41% (16/39)   
Compressing objects:  43% (17/39)   
Compressing objects:  46% (18/39)   
Compressing objects:  48% (19/39)   
Compressing objects:  51% (20/39)   
Compressing objects:  53% (21/39)   
Compressing objects:  56% (22/39)   
Compressing objects:  58% (23/39)   
Compressing objects:  61% (24/39)   
Compressing objects:  64% (25/39)   
Compressing objects:  66% (26/39)   
Compressing objects:  69% (27/39)   
Compressing objects:  71% (28/39)   
Compressing objects:  74% (29/39)   
Compressing objects:  76% (30/39)   
Compressing objects:  79% (31/39)   
Compressing objects:  82% (32/39)   
Compressing objects:  84% (33/39)   
Compressing objects:  87% (34/39)   
Compressing objects:  89% (35/39)   
Compressing objects:  92% (36/39)   
Compressing objects:  94% (37/39)   
Compressing objects:  97% (38/39)   
Compressing objects: 100% (39/39)   
Compressing objects: 100% (39/39), done.
Writing objects:   0% (1/220)   
Writing objects:   1% (3/220)   
Writing objects:   2% (5/220)   
Writing objects:   3% (7/220)   
Writing objects:   4% (9/220)   
Writing objects:   5% (11/220)   
Writing objects:   6% (14/220)   
Writing objects:   7% (16/220)   
Writing objects:   8% (18/220)   
Writing objects:   9% (20/220)   
Writing objects:  10% (22/220)   
Writing objects:  11% (25/220)   
Writing objects:  12% (27/220)   
Writing objects:  13% (29/220)   
Writing objects:  14% (31/220)   
Writing objects:  15% (33/220)   
Writing objects:  16% (36/220)   
Writing objects:  17% (38/220)   
Writing objects:  18% (40/220)   
Writing objects:  19% (42/220)   
Writing objects:  20% (44/220)   
Writing objects:  21% (47/220)   
Writing objects:  22% (49/220)   
Writing objects:  23% (51/220)   
Writing objects:  24% (53/220)   
Writing objects:  25% (55/220)   
Writing objects:  26% (58/220)   
Writing objects:  27% (60/220)   
Writing objects:  28% (62/220)   
Writing objects:  29% (64/220)   
Writing objects:  30% (66/220)   
Writing objects:  31% (69/220)   
Writing objects:  32% (71/220)   
Writing objects:  33% (73/220)   
Writing objects:  34% (75/220)   
Writing objects:  35% (77/220)   
Writing objects:  36% (80/220)   
Writing objects:  37% (82/220)   
Writing objects:  38% (84/220)   
Writing objects:  39% (86/220)   
Writing objects:  40% (88/220)   
Writing objects:  41% (91/220)   
Writing objects:  42% (93/220)   
Writing objects:  43% (95/220)   
Writing objects:  44% (97/220)   
Writing objects:  45% (99/220)   
Writing objects:  46% (102/220)   
Writing objects:  47% (105/220)   
Writing objects:  48% (106/220)   
Writing objects:  49% (108/220)   
Writing objects:  50% (110/220)   
Writing objects:  51% (113/220)   
Writing objects:  52% (115/220)   
Writing objects:  53% (117/220)   
Writing objects:  54% (119/220)   
Writing objects:  55% (121/220)   
Writing objects:  56% (124/220)   
Writing objects:  57% (126/220)   
Writing objects:  58% (128/220)   
Writing objects:  59% (130/220)   
Writing objects:  60% (132/220)   
Writing objects:  61% (135/220)   
Writing objects:  62% (137/220)   
Writing objects:  63% (139/220)   
Writing objects:  64% (141/220)   
Writing objects:  65% (143/220)   
Writing objects:  66% (146/220)   
Writing objects:  67% (148/220)   
Writing objects:  68% (150/220)   
Writing objects:  69% (152/220)   
Writing objects:  70% (154/220)   
Writing objects:  71% (157/220)   
Writing objects:  72% (159/220)   
Writing objects:  73% (161/220)   
Writing objects:  74% (163/220)   
Writing objects:  75% (165/220)   
Writing objects:  76% (168/220)   
Writing objects:  77% (170/220)   
Writing objects:  78% (172/220)   
Writing objects:  79% (174/220)   
Writing objects:  80% (176/220)   
Writing objects:  81% (179/220)   
Writing objects:  82% (181/220)   
Writing objects:  83% (183/220)   
Writing objects:  84% (185/220)   
Writing objects:  85% (187/220)   
Writing objects:  86% (190/220)   
Writing objects:  87% (192/220)   
Writing objects:  88% (194/220)   
Writing objects:  89% (196/220)   
Writing objects:  90% (198/220)   
Writing objects:  91% (201/220)   
Writing objects:  92% (203/220)   
Writing objects:  93% (205/220)   
Writing objects:  94% (207/220)   
Writing objects:  95% (209/220)   
Writing objects:  96% (212/220)   
Writing objects:  97% (214/220)   
Writing objects:  98% (216/220)   
Writing objects:  99% (218/220)   
Writing objects: 100% (220/220)   
Writing objects: 100% (220/220), 36.56 KiB, done.
Total 220 (delta 180), reused 220 (delta 180)
To xen@xenbits.xensource.com:git/linux-pvops.git
   89d2d13..2fc3fd4  2fc3fd44850e68f21ce1746c2e94470cab44ffab -> tested/linux-3.0
+ exit 0

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 18:20:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 18:20:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdPl6-0008Pg-Uz; Tue, 27 Nov 2012 18:19:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TdPl5-0008Pb-Sn
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 18:19:48 +0000
Received: from [85.158.143.35:12498] by server-1.bemta-4.messagelabs.com id
	77/DA-27934-34405B05; Tue, 27 Nov 2012 18:19:47 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-7.tower-21.messagelabs.com!1354040373!11676960!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25684 invoked from network); 27 Nov 2012 18:19:35 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-7.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 18:19:35 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158196022;
	Tue, 27 Nov 2012 13:19:28 -0500
Message-ID: <50B5042B.7000602@jhuapl.edu>
Date: Tue, 27 Nov 2012 13:19:23 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1294018793793967486=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============1294018793793967486==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms060704020405040909050701"

This is a cryptographically signed message in MIME format.

--------------ms060704020405040909050701
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
> The vTPM protocol now contains a field allowing the locality of a
> command to be specified; pass this to the TPM when processing a packet.=

> This also enables a single vTPM to provide multiple tpmback interfaces
> so that several closely related domains can share a vTPM (for example, =
a
> qemu device stubdom and its target domain).
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>   stubdom/tpmemu-0.7.4.patch | 61 +++++++++++++++++++++++++++++++++++++=
+++++----
>   stubdom/vtpm/vtpm.c        | 16 +++---------
>   2 files changed, 59 insertions(+), 18 deletions(-)
>
> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
> index b84eff1..31ace1a 100644
> --- a/stubdom/tpmemu-0.7.4.patch
> +++ b/stubdom/tpmemu-0.7.4.patch
> @@ -1,9 +1,60 @@
> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emul=
ator-x86_64/tpm/tpm_emulator_extern.c
> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c	2012-04-27 10:5=
5:46.581963398 -0400
> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c	2012-04-27 10:56:02.=
193034152 -0400
> -@@ -249,7 +249,7 @@
> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
> +index 60bbb90..f8f7f0f 100644
> +--- a/tpm/tpm_capability.c
> ++++ b/tpm/tpm_capability.c
> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *=
setValue,
> +                              UINT32 setValueSize, BOOL ownerAuth,
> +                              BOOL deactivated, BOOL disabled)
> + {
> ++  if (tpmData.stany.flags.localityModifier !=3D 8)
> ++    return TPM_BAD_PARAMETER;
> +   /* set the capability area with the specified data, on failure
> +      deactivate the TPM */
> +   switch (subCap) {
> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
> +index 288d1ce..9e1cfb4 100644
> +--- a/tpm/tpm_cmd_handler.c
> ++++ b/tpm/tpm_cmd_handler.c
> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
> +   tpm_extern_release();
> + }
> +
> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t *=
*out, uint32_t *out_size)
> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t *=
*out, uint32_t *out_size, int locality)
> + {
> +   TPM_REQUEST req;
> +   TPM_RESPONSE rsp;
> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32=
_t in_size, uint8_t **out, uint3
> +   UINT32 len;
> +   BOOL free_out;
> +
> +-  debug("tpm_handle_command()");
> ++  debug("tpm_handle_command(%d)", locality);
> ++  if (locality !=3D -1)
> ++    tpmData.stany.flags.localityModifier =3D locality;
> +
> +   /* we need the whole packet at once, otherwise unmarshalling will f=
ail */
> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) !=3D =
0) {
> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
> +index eed749e..4c228bd 100644
> +--- a/tpm/tpm_emulator.h
> ++++ b/tpm/tpm_emulator.h
> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
> +  * its usage. In case of an error, all internally allocated memory
> +  * is released and the the state of out and out_size is unspecified.
> +  */
> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t *=
*out, uint32_t *out_size);
> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t *=
*out, uint32_t *out_size, int locality);
> +
> + #endif /* _TPM_EMULATOR_H_ */
> +
> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c
> +index aabe6c3..440a01b 100644
> +--- a/tpm/tpm_emulator_extern.c
> ++++ b/tpm/tpm_emulator_extern.c
> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, size_=
t *data_length) =3D _tpm_read_fr
>    #else /* TPM_NO_EXTERN */
> -
> +
>    int (*tpm_extern_init)(void)                                      =3D=
 NULL;
>   -int (*tpm_extern_release)(void)                                   =3D=
 NULL;
>   +void (*tpm_extern_release)(void)                                   =3D=
 NULL;
> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
> index c33e078..dcfc3b9 100644
> --- a/stubdom/vtpm/vtpm.c
> +++ b/stubdom/vtpm/vtpm.c
> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>  =20
>   static void main_loop(void) {
>      tpmcmd_t* tpmcmd =3D NULL;
> -   domid_t domid;		/* Domid of frontend */
> -   unsigned int handle;	/* handle of frontend */
>      int res =3D -1;
>  =20
>      info("VTPM Initializing\n");
> @@ -162,15 +160,7 @@ static void main_loop(void) {
>         goto abort_postpcrs;
>      }
>  =20
> -   /* Wait for the frontend domain to connect */
> -   info("Waiting for frontend domain to connect..");
> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) =3D=3D 0) {
> -      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, ha=
ndle);
> -   } else {
> -      error("Unable to attach to a frontend");
> -   }
> -
> -   tpmcmd =3D tpmback_req(domid, handle);
> +   tpmcmd =3D tpmback_req_any();
>      while(tpmcmd) {
>         /* Handle the request */
>         if(tpmcmd->req_len) {
> @@ -183,7 +173,7 @@ static void main_loop(void) {
>            }
>            /* If not disabled, do the command */
>            else {
> -            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->req_le=
n, &tpmcmd->resp, &tpmcmd->resp_len)) !=3D 0) {
> +            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->req_le=
n, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) !=3D 0) {
>                  error("tpm_handle_command() failed");
>                  create_error_response(tpmcmd, TPM_FAIL);
>               }
> @@ -194,7 +184,7 @@ static void main_loop(void) {
>         tpmback_resp(tpmcmd);
>  =20
>         /* Wait for the next request */
> -      tpmcmd =3D tpmback_req(domid, handle);
> +      tpmcmd =3D tpmback_req_any();
>  =20
>      }
Before the vtpm would shut down on its own when the host domain=20
disconnects. This occurs because tpmback_req() returns NULL if the=20
frontend disconnected. Using tpmback_req_any(), this is no longer the=20
case which now means the user has to shut down the vtpm manually. How=20
are you handling vtpm shutdown on your end?
>  =20



--------------ms060704020405040909050701
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp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8XDTEyMTEyNzE4MTkyM1owIwYJKoZIhvcNAQkEMRYEFMu8b7bOX/InjPT7
kSwDpoEoT39bMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAhLcQEuRNDLk2G8AtYTjhMi8GGHzOvubDD
HgZEdv7NUv9iXAuq/jlhgyas4sZERDkCa1CuQ19t/rlzAD3AjHmpGZ3YkT7R95TqJ8t180S0
ZGUQbOX4iKkSPomLN6+QNjGcUVUmZmVmoocXomIKYVienEwtrd4yZxeJG5q2pryh8wAAAAAA
AA==
--------------ms060704020405040909050701--


--===============1294018793793967486==
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.xen.org
http://lists.xen.org/xen-devel

--===============1294018793793967486==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 18:20:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 18:20:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdPl6-0008Pg-Uz; Tue, 27 Nov 2012 18:19:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TdPl5-0008Pb-Sn
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 18:19:48 +0000
Received: from [85.158.143.35:12498] by server-1.bemta-4.messagelabs.com id
	77/DA-27934-34405B05; Tue, 27 Nov 2012 18:19:47 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-7.tower-21.messagelabs.com!1354040373!11676960!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25684 invoked from network); 27 Nov 2012 18:19:35 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-7.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 18:19:35 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158196022;
	Tue, 27 Nov 2012 13:19:28 -0500
Message-ID: <50B5042B.7000602@jhuapl.edu>
Date: Tue, 27 Nov 2012 13:19:23 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1294018793793967486=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============1294018793793967486==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms060704020405040909050701"

This is a cryptographically signed message in MIME format.

--------------ms060704020405040909050701
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
> The vTPM protocol now contains a field allowing the locality of a
> command to be specified; pass this to the TPM when processing a packet.=

> This also enables a single vTPM to provide multiple tpmback interfaces
> so that several closely related domains can share a vTPM (for example, =
a
> qemu device stubdom and its target domain).
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>   stubdom/tpmemu-0.7.4.patch | 61 +++++++++++++++++++++++++++++++++++++=
+++++----
>   stubdom/vtpm/vtpm.c        | 16 +++---------
>   2 files changed, 59 insertions(+), 18 deletions(-)
>
> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
> index b84eff1..31ace1a 100644
> --- a/stubdom/tpmemu-0.7.4.patch
> +++ b/stubdom/tpmemu-0.7.4.patch
> @@ -1,9 +1,60 @@
> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emul=
ator-x86_64/tpm/tpm_emulator_extern.c
> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c	2012-04-27 10:5=
5:46.581963398 -0400
> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c	2012-04-27 10:56:02.=
193034152 -0400
> -@@ -249,7 +249,7 @@
> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
> +index 60bbb90..f8f7f0f 100644
> +--- a/tpm/tpm_capability.c
> ++++ b/tpm/tpm_capability.c
> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *=
setValue,
> +                              UINT32 setValueSize, BOOL ownerAuth,
> +                              BOOL deactivated, BOOL disabled)
> + {
> ++  if (tpmData.stany.flags.localityModifier !=3D 8)
> ++    return TPM_BAD_PARAMETER;
> +   /* set the capability area with the specified data, on failure
> +      deactivate the TPM */
> +   switch (subCap) {
> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
> +index 288d1ce..9e1cfb4 100644
> +--- a/tpm/tpm_cmd_handler.c
> ++++ b/tpm/tpm_cmd_handler.c
> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
> +   tpm_extern_release();
> + }
> +
> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t *=
*out, uint32_t *out_size)
> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t *=
*out, uint32_t *out_size, int locality)
> + {
> +   TPM_REQUEST req;
> +   TPM_RESPONSE rsp;
> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32=
_t in_size, uint8_t **out, uint3
> +   UINT32 len;
> +   BOOL free_out;
> +
> +-  debug("tpm_handle_command()");
> ++  debug("tpm_handle_command(%d)", locality);
> ++  if (locality !=3D -1)
> ++    tpmData.stany.flags.localityModifier =3D locality;
> +
> +   /* we need the whole packet at once, otherwise unmarshalling will f=
ail */
> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) !=3D =
0) {
> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
> +index eed749e..4c228bd 100644
> +--- a/tpm/tpm_emulator.h
> ++++ b/tpm/tpm_emulator.h
> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
> +  * its usage. In case of an error, all internally allocated memory
> +  * is released and the the state of out and out_size is unspecified.
> +  */
> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t *=
*out, uint32_t *out_size);
> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t *=
*out, uint32_t *out_size, int locality);
> +
> + #endif /* _TPM_EMULATOR_H_ */
> +
> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c
> +index aabe6c3..440a01b 100644
> +--- a/tpm/tpm_emulator_extern.c
> ++++ b/tpm/tpm_emulator_extern.c
> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, size_=
t *data_length) =3D _tpm_read_fr
>    #else /* TPM_NO_EXTERN */
> -
> +
>    int (*tpm_extern_init)(void)                                      =3D=
 NULL;
>   -int (*tpm_extern_release)(void)                                   =3D=
 NULL;
>   +void (*tpm_extern_release)(void)                                   =3D=
 NULL;
> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
> index c33e078..dcfc3b9 100644
> --- a/stubdom/vtpm/vtpm.c
> +++ b/stubdom/vtpm/vtpm.c
> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>  =20
>   static void main_loop(void) {
>      tpmcmd_t* tpmcmd =3D NULL;
> -   domid_t domid;		/* Domid of frontend */
> -   unsigned int handle;	/* handle of frontend */
>      int res =3D -1;
>  =20
>      info("VTPM Initializing\n");
> @@ -162,15 +160,7 @@ static void main_loop(void) {
>         goto abort_postpcrs;
>      }
>  =20
> -   /* Wait for the frontend domain to connect */
> -   info("Waiting for frontend domain to connect..");
> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) =3D=3D 0) {
> -      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, ha=
ndle);
> -   } else {
> -      error("Unable to attach to a frontend");
> -   }
> -
> -   tpmcmd =3D tpmback_req(domid, handle);
> +   tpmcmd =3D tpmback_req_any();
>      while(tpmcmd) {
>         /* Handle the request */
>         if(tpmcmd->req_len) {
> @@ -183,7 +173,7 @@ static void main_loop(void) {
>            }
>            /* If not disabled, do the command */
>            else {
> -            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->req_le=
n, &tpmcmd->resp, &tpmcmd->resp_len)) !=3D 0) {
> +            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->req_le=
n, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) !=3D 0) {
>                  error("tpm_handle_command() failed");
>                  create_error_response(tpmcmd, TPM_FAIL);
>               }
> @@ -194,7 +184,7 @@ static void main_loop(void) {
>         tpmback_resp(tpmcmd);
>  =20
>         /* Wait for the next request */
> -      tpmcmd =3D tpmback_req(domid, handle);
> +      tpmcmd =3D tpmback_req_any();
>  =20
>      }
Before the vtpm would shut down on its own when the host domain=20
disconnects. This occurs because tpmback_req() returns NULL if the=20
frontend disconnected. Using tpmback_req_any(), this is no longer the=20
case which now means the user has to shut down the vtpm manually. How=20
are you handling vtpm shutdown on your end?
>  =20



--------------ms060704020405040909050701
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1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AQkFMQ8XDTEyMTEyNzE4MTkyM1owIwYJKoZIhvcNAQkEMRYEFMu8b7bOX/InjPT7
kSwDpoEoT39bMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAhLcQEuRNDLk2G8AtYTjhMi8GGHzOvubDD
HgZEdv7NUv9iXAuq/jlhgyas4sZERDkCa1CuQ19t/rlzAD3AjHmpGZ3YkT7R95TqJ8t180S0
ZGUQbOX4iKkSPomLN6+QNjGcUVUmZmVmoocXomIKYVienEwtrd4yZxeJG5q2pryh8wAAAAAA
AA==
--------------ms060704020405040909050701--


--===============1294018793793967486==
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.xen.org
http://lists.xen.org/xen-devel

--===============1294018793793967486==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 18:25:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 18:25:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdPqC-00007T-Nm; Tue, 27 Nov 2012 18:25:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TdPqB-00007O-Ft
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 18:25:03 +0000
Received: from [85.158.139.211:35629] by server-16.bemta-5.messagelabs.com id
	AE/19-04786-E7505B05; Tue, 27 Nov 2012 18:25:02 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354040700!17652195!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10549 invoked from network); 27 Nov 2012 18:25:01 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 18:25:01 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215637840"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 18:24:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 13:24:56 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TdPq3-0002GV-IZ;
	Tue, 27 Nov 2012 18:24:55 +0000
Message-ID: <50B50577.8040704@citrix.com>
Date: Tue, 27 Nov 2012 18:24:55 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<c223c044afbf9505c138.1353948093@andrewcoop.uk.xensource.com>
	<20121127164637.GG51942@ocelot.phlegethon.org>
	<20121127170844.536be218@pyramind.ukuu.org.uk>	<50B4F6EC.3050300@citrix.com>
	<20121127174900.68a51564@pyramind.ukuu.org.uk>
In-Reply-To: <20121127174900.68a51564@pyramind.ukuu.org.uk>
X-Enigmail-Version: 1.4.6
Cc: "Keir \(Xen.org\)" <keir@xen.org>, "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 5] rombios/ata: Do not wait for BSY to
 be set
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 27/11/12 17:49, Alan Cox wrote:
> O> SEABios has explicitly removed the wait for the BSY bit to be set.  We
>> want to remove it because Qemu will not set the BSY bit, resulting in
> So why not fix the qemu emulation bug ?

I do not have a copy of the ATA specification, and
http://code.coreboot.org/p/seabios/source/commit/580e33293244fee4556e56ecc67b8bd877f3c496/
certainly implies that waiting for BSY is not required

>
>> 42k needless polled IO traps while we wait for the timeout (which is, if
>> I remember correctly, based on a loop counter rather than any notion of
>> actual time)
> Not good, although half caused by the fact that years on qemu still
> hasn't implemented predictors to avoid trapping further than the kernel
> layer 8)
>
>> We can certainly argue about the outb(0x80,0x00).  When I was comparing
>> ROMBios with SEABios, this outb was the closest I could easily get to a
>> udelay(5) without implement udelay() in ROMBios.  Xen will execute an
>> outb(0x80, 0x00) on the real hardware if a guest executes it; 
> Don't do that then. 0x80 is not safe on a modern PC system (you'll note
> the Linux kernel changed behaviour here). It may be a debug port but we've
> seen some hardware do worse things if you touch it. It's also completely
> out on a limb with EFI based systems which don't necessarily have the
> legacy stuff present.
>
> Alan

If port 0x80 is problematic, then this is a Xen problem, but a legacy
guest should have no adverse effects.  Perhaps we should "emulate" port
0x80 by deliberately re-scheduling another VCPU ?

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 18:25:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 18:25:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdPqC-00007T-Nm; Tue, 27 Nov 2012 18:25:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TdPqB-00007O-Ft
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 18:25:03 +0000
Received: from [85.158.139.211:35629] by server-16.bemta-5.messagelabs.com id
	AE/19-04786-E7505B05; Tue, 27 Nov 2012 18:25:02 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354040700!17652195!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10549 invoked from network); 27 Nov 2012 18:25:01 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 18:25:01 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215637840"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 18:24:56 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 13:24:56 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TdPq3-0002GV-IZ;
	Tue, 27 Nov 2012 18:24:55 +0000
Message-ID: <50B50577.8040704@citrix.com>
Date: Tue, 27 Nov 2012 18:24:55 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
References: <patchbomb.1353948091@andrewcoop.uk.xensource.com>
	<c223c044afbf9505c138.1353948093@andrewcoop.uk.xensource.com>
	<20121127164637.GG51942@ocelot.phlegethon.org>
	<20121127170844.536be218@pyramind.ukuu.org.uk>	<50B4F6EC.3050300@citrix.com>
	<20121127174900.68a51564@pyramind.ukuu.org.uk>
In-Reply-To: <20121127174900.68a51564@pyramind.ukuu.org.uk>
X-Enigmail-Version: 1.4.6
Cc: "Keir \(Xen.org\)" <keir@xen.org>, "Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2 of 5] rombios/ata: Do not wait for BSY to
 be set
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


On 27/11/12 17:49, Alan Cox wrote:
> O> SEABios has explicitly removed the wait for the BSY bit to be set.  We
>> want to remove it because Qemu will not set the BSY bit, resulting in
> So why not fix the qemu emulation bug ?

I do not have a copy of the ATA specification, and
http://code.coreboot.org/p/seabios/source/commit/580e33293244fee4556e56ecc67b8bd877f3c496/
certainly implies that waiting for BSY is not required

>
>> 42k needless polled IO traps while we wait for the timeout (which is, if
>> I remember correctly, based on a loop counter rather than any notion of
>> actual time)
> Not good, although half caused by the fact that years on qemu still
> hasn't implemented predictors to avoid trapping further than the kernel
> layer 8)
>
>> We can certainly argue about the outb(0x80,0x00).  When I was comparing
>> ROMBios with SEABios, this outb was the closest I could easily get to a
>> udelay(5) without implement udelay() in ROMBios.  Xen will execute an
>> outb(0x80, 0x00) on the real hardware if a guest executes it; 
> Don't do that then. 0x80 is not safe on a modern PC system (you'll note
> the Linux kernel changed behaviour here). It may be a debug port but we've
> seen some hardware do worse things if you touch it. It's also completely
> out on a limb with EFI based systems which don't necessarily have the
> legacy stuff present.
>
> Alan

If port 0x80 is problematic, then this is a Xen problem, but a legacy
guest should have no adverse effects.  Perhaps we should "emulate" port
0x80 by deliberately re-scheduling another VCPU ?

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 18:36:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 18:36:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdQ1L-0000MO-2f; Tue, 27 Nov 2012 18:36:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdQ1J-0000MJ-J5
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 18:36:33 +0000
Received: from [193.109.254.147:12344] by server-6.bemta-14.messagelabs.com id
	46/EF-02788-03805B05; Tue, 27 Nov 2012 18:36:32 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1354041391!8561243!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24308 invoked from network); 27 Nov 2012 18:36:32 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-12.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 18:36:32 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 9DA5A8406F;
	Tue, 27 Nov 2012 19:36:30 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id ttHoXH2SzprH; Tue, 27 Nov 2012 19:36:30 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id 32C5E84063;
	Tue, 27 Nov 2012 19:36:30 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdQ19-0001ve-M3; Tue, 27 Nov 2012 19:36:23 +0100
Date: Tue, 27 Nov 2012 19:36:23 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121127183623.GB5646@type.youpi.perso.aquilenet.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-4-git-send-email-dgdegra@tycho.nsa.gov>
	<50B50193.3070303@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B50193.3070303@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 3/4] stubdom/grub: send kernel measurements
 to vTPM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Tue 27 Nov 2012 13:08:19 -0500, a =E9crit :
> How exactly does this work? Is it intended for HVM domains whos stubdom is
> connected to a vtpm? I've never tried to use vtpm with HVMs yet, so I'd be
> very surprised if it just works. Does it work for PVM domains?
> =

> I'm not terribly familiar with how grub in stubdom works.

Grub in stubdom is for bootloading PV guests only, not HVM. It's simply
the PV version of grub.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 18:36:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 18:36:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdQ1L-0000MO-2f; Tue, 27 Nov 2012 18:36:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdQ1J-0000MJ-J5
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 18:36:33 +0000
Received: from [193.109.254.147:12344] by server-6.bemta-14.messagelabs.com id
	46/EF-02788-03805B05; Tue, 27 Nov 2012 18:36:32 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1354041391!8561243!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24308 invoked from network); 27 Nov 2012 18:36:32 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-12.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 18:36:32 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 9DA5A8406F;
	Tue, 27 Nov 2012 19:36:30 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id ttHoXH2SzprH; Tue, 27 Nov 2012 19:36:30 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id 32C5E84063;
	Tue, 27 Nov 2012 19:36:30 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdQ19-0001ve-M3; Tue, 27 Nov 2012 19:36:23 +0100
Date: Tue, 27 Nov 2012 19:36:23 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121127183623.GB5646@type.youpi.perso.aquilenet.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-4-git-send-email-dgdegra@tycho.nsa.gov>
	<50B50193.3070303@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B50193.3070303@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 3/4] stubdom/grub: send kernel measurements
 to vTPM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Tue 27 Nov 2012 13:08:19 -0500, a =E9crit :
> How exactly does this work? Is it intended for HVM domains whos stubdom is
> connected to a vtpm? I've never tried to use vtpm with HVMs yet, so I'd be
> very surprised if it just works. Does it work for PVM domains?
> =

> I'm not terribly familiar with how grub in stubdom works.

Grub in stubdom is for bootloading PV guests only, not HVM. It's simply
the PV version of grub.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 18:37:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 18:37:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdQ1e-0000Nw-Fh; Tue, 27 Nov 2012 18:36:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TdQ1c-0000Nf-R3
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 18:36:53 +0000
Received: from [85.158.137.99:44368] by server-7.bemta-3.messagelabs.com id
	84/84-01713-F3805B05; Tue, 27 Nov 2012 18:36:47 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1354041405!17710642!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29359 invoked from network); 27 Nov 2012 18:36:46 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 18:36:46 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215639609"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 18:36:45 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 13:36:44 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TdQ1U-0002SB-Et;
	Tue, 27 Nov 2012 18:36:44 +0000
Date: Tue, 27 Nov 2012 18:36:41 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: xen-devel@lists.xensource.com
Message-ID: <alpine.DEB.2.02.1211271831560.5310@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH] xen/arm: do not map vGIC twice for dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

We don't need to manually set the P2M for the vGIC in construct_dom0,
because we have already done it generally for every guest in gicv_setup.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index a9e7f43..432fdc0 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -282,8 +282,6 @@ int construct_dom0(struct domain *d)
     map_mmio_regions(d, 0x18000000, 0x1BFFFFFF, 0x18000000);
     printk("Map CS3 MMIO regions 1:1 in the P2M %#llx->%#llx\n", 0x1C000000ULL, 0x1FFFFFFFULL);
     map_mmio_regions(d, 0x1C000000, 0x1FFFFFFF, 0x1C000000);
-    printk("Map VGIC MMIO regions 1:1 in the P2M %#llx->%#llx\n", 0x2C008000ULL, 0x2DFFFFFFULL);
-    map_mmio_regions(d, 0x2C008000, 0x2DFFFFFF, 0x2C008000);
 
     printk("Routing peripheral interrupts to guest\n");
     /* TODO Get from device tree */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 18:37:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 18:37:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdQ1e-0000Nw-Fh; Tue, 27 Nov 2012 18:36:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TdQ1c-0000Nf-R3
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 18:36:53 +0000
Received: from [85.158.137.99:44368] by server-7.bemta-3.messagelabs.com id
	84/84-01713-F3805B05; Tue, 27 Nov 2012 18:36:47 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1354041405!17710642!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODcxNDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29359 invoked from network); 27 Nov 2012 18:36:46 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 18:36:46 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="215639609"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 18:36:45 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Tue, 27 Nov 2012 13:36:44 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TdQ1U-0002SB-Et;
	Tue, 27 Nov 2012 18:36:44 +0000
Date: Tue, 27 Nov 2012 18:36:41 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: xen-devel@lists.xensource.com
Message-ID: <alpine.DEB.2.02.1211271831560.5310@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH] xen/arm: do not map vGIC twice for dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

We don't need to manually set the P2M for the vGIC in construct_dom0,
because we have already done it generally for every guest in gicv_setup.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index a9e7f43..432fdc0 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -282,8 +282,6 @@ int construct_dom0(struct domain *d)
     map_mmio_regions(d, 0x18000000, 0x1BFFFFFF, 0x18000000);
     printk("Map CS3 MMIO regions 1:1 in the P2M %#llx->%#llx\n", 0x1C000000ULL, 0x1FFFFFFFULL);
     map_mmio_regions(d, 0x1C000000, 0x1FFFFFFF, 0x1C000000);
-    printk("Map VGIC MMIO regions 1:1 in the P2M %#llx->%#llx\n", 0x2C008000ULL, 0x2DFFFFFFULL);
-    map_mmio_regions(d, 0x2C008000, 0x2DFFFFFF, 0x2C008000);
 
     printk("Routing peripheral interrupts to guest\n");
     /* TODO Get from device tree */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 18:54:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 18:54:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdQIo-0000j2-78; Tue, 27 Nov 2012 18:54:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdQIm-0000ix-Uo
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 18:54:37 +0000
Received: from [85.158.143.35:58848] by server-2.bemta-4.messagelabs.com id
	9D/02-28922-C6C05B05; Tue, 27 Nov 2012 18:54:36 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-7.tower-21.messagelabs.com!1354042433!11680154!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20094 invoked from network); 27 Nov 2012 18:53:54 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-7.tower-21.messagelabs.com with SMTP;
	27 Nov 2012 18:53:54 -0000
X-TM-IMSS-Message-ID: <c1e1730c00033895@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id c1e1730c00033895 ;
	Tue, 27 Nov 2012 13:52:49 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARIrbVF022419; 
	Tue, 27 Nov 2012 13:53:37 -0500
Message-ID: <50B50C31.6090708@tycho.nsa.gov>
Date: Tue, 27 Nov 2012 13:53:37 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-4-git-send-email-dgdegra@tycho.nsa.gov>
	<50B50193.3070303@jhuapl.edu>
In-Reply-To: <50B50193.3070303@jhuapl.edu>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 3/4] stubdom/grub: send kernel measurements
	to vTPM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/27/2012 01:08 PM, Matthew Fioravante wrote:
> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>> This allows a domU with an arbitrary kernel and initrd to take advantage
>> of the static root of trust provided by a vTPM.
> Do you have any documentation updates for how to use it? They could be added to the vtpm documentation if thats the most appropriate location.

Not much documentation is really needed - you just launch a domain with the
pv-grub kernel and a vTPM, and this patch will write the measurements of the
kernel, initrd, and command line to PCRs 4/5, similar to trusted grub on real
hardware.
 
> How exactly does this work? Is it intended for HVM domains whos stubdom is connected to a vtpm? I've never tried to use vtpm with HVMs yet, so I'd be very surprised if it just works. Does it work for PVM domains?
> 
> I'm not terribly familiar with how grub in stubdom works.

This is PV only. The pv-grub stubdom is constructed similar to any other PV domain,
but the pv-grub kernel is specified instead of a normal Linux kernel. The pv-grub
kernel then loads a grub.conf from the guest's disk image and loads the Linux
kernel and initrd specified by the guest; this is more secure than pygrub which
does the loading in dom0, and more flexible than requiring the user to pick from
a list of pre-approved non-malicious kernels. If the pv-grub domain is created on
command by a measured domain builder/initrd combination, you can produce a static
chain of trust extending down to the hardware TPM without involving every UID 0
process in dom0.

[...]
>> +       cmd.pcr = be32(4); // PCR #4 for kernel
>> +       sha_compute(cmd.hash, dom->kernel_blob, dom->kernel_size);
>> +
>> +       tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
>> +
>> +       cmd.pcr = be32(5); // PCR #5 for cmdline
>> +       sha_compute(cmd.hash, cmdline, strlen(cmdline));
>> +       tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
>> +
>> +       cmd.pcr = be32(5); // PCR #5 for initrd
>> +       sha_compute(cmd.hash, dom->ramdisk_blob, dom->ramdisk_size);
>> +       tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
>> +
>> +       shutdown_tpmfront(tpm, 1);
>> +}
> Does this actually work? vtpm-stubdom will shut itself down when the frontend tpm disconnects. Is it really ok to connect and disconnect these devices at will?

Hmm, apparently this part may depend on the change from tpmback_req to
tpmback_req_any to avoid the shutdown on disconnect. That might not be
required (shutdown for reconfigure shouldn't start returning NULL for
requests) but I also haven't tested that it works without #4.

[...]
>> +++ b/stubdom/grub/sha1.c
[...]
> There also exists a sha1 routine in polarssl. You can just link in the polarssl sha1 object file without the entire library. This is what vtpm-stubdom and vtpmmgrdom do to get the crypto pieces they need. Checkout their makefiles for details.
> Is there any reason using polarssl would be sub-optimal?

No, I think rewriting this to use the polarssl functions would be useful; I
didn't notice the polarssl function was available when this patch was created.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 18:54:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 18:54:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdQIo-0000j2-78; Tue, 27 Nov 2012 18:54:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdQIm-0000ix-Uo
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 18:54:37 +0000
Received: from [85.158.143.35:58848] by server-2.bemta-4.messagelabs.com id
	9D/02-28922-C6C05B05; Tue, 27 Nov 2012 18:54:36 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-7.tower-21.messagelabs.com!1354042433!11680154!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20094 invoked from network); 27 Nov 2012 18:53:54 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-7.tower-21.messagelabs.com with SMTP;
	27 Nov 2012 18:53:54 -0000
X-TM-IMSS-Message-ID: <c1e1730c00033895@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id c1e1730c00033895 ;
	Tue, 27 Nov 2012 13:52:49 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARIrbVF022419; 
	Tue, 27 Nov 2012 13:53:37 -0500
Message-ID: <50B50C31.6090708@tycho.nsa.gov>
Date: Tue, 27 Nov 2012 13:53:37 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-4-git-send-email-dgdegra@tycho.nsa.gov>
	<50B50193.3070303@jhuapl.edu>
In-Reply-To: <50B50193.3070303@jhuapl.edu>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 3/4] stubdom/grub: send kernel measurements
	to vTPM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/27/2012 01:08 PM, Matthew Fioravante wrote:
> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>> This allows a domU with an arbitrary kernel and initrd to take advantage
>> of the static root of trust provided by a vTPM.
> Do you have any documentation updates for how to use it? They could be added to the vtpm documentation if thats the most appropriate location.

Not much documentation is really needed - you just launch a domain with the
pv-grub kernel and a vTPM, and this patch will write the measurements of the
kernel, initrd, and command line to PCRs 4/5, similar to trusted grub on real
hardware.
 
> How exactly does this work? Is it intended for HVM domains whos stubdom is connected to a vtpm? I've never tried to use vtpm with HVMs yet, so I'd be very surprised if it just works. Does it work for PVM domains?
> 
> I'm not terribly familiar with how grub in stubdom works.

This is PV only. The pv-grub stubdom is constructed similar to any other PV domain,
but the pv-grub kernel is specified instead of a normal Linux kernel. The pv-grub
kernel then loads a grub.conf from the guest's disk image and loads the Linux
kernel and initrd specified by the guest; this is more secure than pygrub which
does the loading in dom0, and more flexible than requiring the user to pick from
a list of pre-approved non-malicious kernels. If the pv-grub domain is created on
command by a measured domain builder/initrd combination, you can produce a static
chain of trust extending down to the hardware TPM without involving every UID 0
process in dom0.

[...]
>> +       cmd.pcr = be32(4); // PCR #4 for kernel
>> +       sha_compute(cmd.hash, dom->kernel_blob, dom->kernel_size);
>> +
>> +       tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
>> +
>> +       cmd.pcr = be32(5); // PCR #5 for cmdline
>> +       sha_compute(cmd.hash, cmdline, strlen(cmdline));
>> +       tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
>> +
>> +       cmd.pcr = be32(5); // PCR #5 for initrd
>> +       sha_compute(cmd.hash, dom->ramdisk_blob, dom->ramdisk_size);
>> +       tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
>> +
>> +       shutdown_tpmfront(tpm, 1);
>> +}
> Does this actually work? vtpm-stubdom will shut itself down when the frontend tpm disconnects. Is it really ok to connect and disconnect these devices at will?

Hmm, apparently this part may depend on the change from tpmback_req to
tpmback_req_any to avoid the shutdown on disconnect. That might not be
required (shutdown for reconfigure shouldn't start returning NULL for
requests) but I also haven't tested that it works without #4.

[...]
>> +++ b/stubdom/grub/sha1.c
[...]
> There also exists a sha1 routine in polarssl. You can just link in the polarssl sha1 object file without the entire library. This is what vtpm-stubdom and vtpmmgrdom do to get the crypto pieces they need. Checkout their makefiles for details.
> Is there any reason using polarssl would be sub-optimal?

No, I think rewriting this to use the polarssl functions would be useful; I
didn't notice the polarssl function was available when this patch was created.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 19:02:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 19:02:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdQQP-0000vv-6z; Tue, 27 Nov 2012 19:02:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdQQM-0000vq-UK
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 19:02:27 +0000
Received: from [85.158.143.35:23400] by server-1.bemta-4.messagelabs.com id
	48/96-27934-24E05B05; Tue, 27 Nov 2012 19:02:26 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354042944!4655022!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19679 invoked from network); 27 Nov 2012 19:02:25 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-9.tower-21.messagelabs.com with SMTP;
	27 Nov 2012 19:02:25 -0000
X-TM-IMSS-Message-ID: <c1e9748300033a7d@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id c1e9748300033a7d ;
	Tue, 27 Nov 2012 14:01:33 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARJ2MXs023349; 
	Tue, 27 Nov 2012 14:02:22 -0500
Message-ID: <50B50E3E.6050807@tycho.nsa.gov>
Date: Tue, 27 Nov 2012 14:02:22 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B5042B.7000602@jhuapl.edu>
In-Reply-To: <50B5042B.7000602@jhuapl.edu>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/27/2012 01:19 PM, Matthew Fioravante wrote:
> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>> The vTPM protocol now contains a field allowing the locality of a
>> command to be specified; pass this to the TPM when processing a packet.
>> This also enables a single vTPM to provide multiple tpmback interfaces
>> so that several closely related domains can share a vTPM (for example, a
>> qemu device stubdom and its target domain).
>>
>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> ---
>>   stubdom/tpmemu-0.7.4.patch | 61 ++++++++++++++++++++++++++++++++++++++++++----
>>   stubdom/vtpm/vtpm.c        | 16 +++---------
>>   2 files changed, 59 insertions(+), 18 deletions(-)
>>
>> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
>> index b84eff1..31ace1a 100644
>> --- a/stubdom/tpmemu-0.7.4.patch
>> +++ b/stubdom/tpmemu-0.7.4.patch
>> @@ -1,9 +1,60 @@
>> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
>> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c    2012-04-27 10:55:46.581963398 -0400
>> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c    2012-04-27 10:56:02.193034152 -0400
>> -@@ -249,7 +249,7 @@
>> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
>> +index 60bbb90..f8f7f0f 100644
>> +--- a/tpm/tpm_capability.c
>> ++++ b/tpm/tpm_capability.c
>> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *setValue,
>> +                              UINT32 setValueSize, BOOL ownerAuth,
>> +                              BOOL deactivated, BOOL disabled)
>> + {
>> ++  if (tpmData.stany.flags.localityModifier != 8)
>> ++    return TPM_BAD_PARAMETER;
>> +   /* set the capability area with the specified data, on failure
>> +      deactivate the TPM */
>> +   switch (subCap) {
>> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
>> +index 288d1ce..9e1cfb4 100644
>> +--- a/tpm/tpm_cmd_handler.c
>> ++++ b/tpm/tpm_cmd_handler.c
>> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
>> +   tpm_extern_release();
>> + }
>> +
>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size)
>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality)
>> + {
>> +   TPM_REQUEST req;
>> +   TPM_RESPONSE rsp;
>> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint3
>> +   UINT32 len;
>> +   BOOL free_out;
>> +
>> +-  debug("tpm_handle_command()");
>> ++  debug("tpm_handle_command(%d)", locality);
>> ++  if (locality != -1)
>> ++    tpmData.stany.flags.localityModifier = locality;
>> +
>> +   /* we need the whole packet at once, otherwise unmarshalling will fail */
>> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) != 0) {
>> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
>> +index eed749e..4c228bd 100644
>> +--- a/tpm/tpm_emulator.h
>> ++++ b/tpm/tpm_emulator.h
>> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
>> +  * its usage. In case of an error, all internally allocated memory
>> +  * is released and the the state of out and out_size is unspecified.
>> +  */
>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size);
>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality);
>> +
>> + #endif /* _TPM_EMULATOR_H_ */
>> +
>> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c
>> +index aabe6c3..440a01b 100644
>> +--- a/tpm/tpm_emulator_extern.c
>> ++++ b/tpm/tpm_emulator_extern.c
>> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length) = _tpm_read_fr
>>    #else /* TPM_NO_EXTERN */
>> -
>> +
>>    int (*tpm_extern_init)(void)                                      = NULL;
>>   -int (*tpm_extern_release)(void)                                   = NULL;
>>   +void (*tpm_extern_release)(void)                                   = NULL;
>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>> index c33e078..dcfc3b9 100644
>> --- a/stubdom/vtpm/vtpm.c
>> +++ b/stubdom/vtpm/vtpm.c
>> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>>     static void main_loop(void) {
>>      tpmcmd_t* tpmcmd = NULL;
>> -   domid_t domid;        /* Domid of frontend */
>> -   unsigned int handle;    /* handle of frontend */
>>      int res = -1;
>>        info("VTPM Initializing\n");
>> @@ -162,15 +160,7 @@ static void main_loop(void) {
>>         goto abort_postpcrs;
>>      }
>>   -   /* Wait for the frontend domain to connect */
>> -   info("Waiting for frontend domain to connect..");
>> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
>> -      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
>> -   } else {
>> -      error("Unable to attach to a frontend");
>> -   }
>> -
>> -   tpmcmd = tpmback_req(domid, handle);
>> +   tpmcmd = tpmback_req_any();
>>      while(tpmcmd) {
>>         /* Handle the request */
>>         if(tpmcmd->req_len) {
>> @@ -183,7 +173,7 @@ static void main_loop(void) {
>>            }
>>            /* If not disabled, do the command */
>>            else {
>> -            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
>> +            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) != 0) {
>>                  error("tpm_handle_command() failed");
>>                  create_error_response(tpmcmd, TPM_FAIL);
>>               }
>> @@ -194,7 +184,7 @@ static void main_loop(void) {
>>         tpmback_resp(tpmcmd);
>>           /* Wait for the next request */
>> -      tpmcmd = tpmback_req(domid, handle);
>> +      tpmcmd = tpmback_req_any();
>>        }
> Before the vtpm would shut down on its own when the host domain disconnects. This occurs because tpmback_req() returns NULL if the frontend disconnected. Using tpmback_req_any(), this is no longer the case which now means the user has to shut down the vtpm manually. How are you handling vtpm shutdown on your end?

When a domain shuts down, "xl destroy" is called on its paired vTPM (by some
scripting that may need to be incorporated into libxl). A graceful shutdown
is not really needed at this point, although it might be needed in the short
term if the save-state operation is not atomic - but a method of recovering
from this type of failure is needed for vTPMs anyway.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 19:02:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 19:02:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdQQP-0000vv-6z; Tue, 27 Nov 2012 19:02:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdQQM-0000vq-UK
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 19:02:27 +0000
Received: from [85.158.143.35:23400] by server-1.bemta-4.messagelabs.com id
	48/96-27934-24E05B05; Tue, 27 Nov 2012 19:02:26 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354042944!4655022!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19679 invoked from network); 27 Nov 2012 19:02:25 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-9.tower-21.messagelabs.com with SMTP;
	27 Nov 2012 19:02:25 -0000
X-TM-IMSS-Message-ID: <c1e9748300033a7d@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id c1e9748300033a7d ;
	Tue, 27 Nov 2012 14:01:33 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARJ2MXs023349; 
	Tue, 27 Nov 2012 14:02:22 -0500
Message-ID: <50B50E3E.6050807@tycho.nsa.gov>
Date: Tue, 27 Nov 2012 14:02:22 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B5042B.7000602@jhuapl.edu>
In-Reply-To: <50B5042B.7000602@jhuapl.edu>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/27/2012 01:19 PM, Matthew Fioravante wrote:
> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>> The vTPM protocol now contains a field allowing the locality of a
>> command to be specified; pass this to the TPM when processing a packet.
>> This also enables a single vTPM to provide multiple tpmback interfaces
>> so that several closely related domains can share a vTPM (for example, a
>> qemu device stubdom and its target domain).
>>
>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> ---
>>   stubdom/tpmemu-0.7.4.patch | 61 ++++++++++++++++++++++++++++++++++++++++++----
>>   stubdom/vtpm/vtpm.c        | 16 +++---------
>>   2 files changed, 59 insertions(+), 18 deletions(-)
>>
>> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
>> index b84eff1..31ace1a 100644
>> --- a/stubdom/tpmemu-0.7.4.patch
>> +++ b/stubdom/tpmemu-0.7.4.patch
>> @@ -1,9 +1,60 @@
>> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
>> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c    2012-04-27 10:55:46.581963398 -0400
>> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c    2012-04-27 10:56:02.193034152 -0400
>> -@@ -249,7 +249,7 @@
>> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
>> +index 60bbb90..f8f7f0f 100644
>> +--- a/tpm/tpm_capability.c
>> ++++ b/tpm/tpm_capability.c
>> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *setValue,
>> +                              UINT32 setValueSize, BOOL ownerAuth,
>> +                              BOOL deactivated, BOOL disabled)
>> + {
>> ++  if (tpmData.stany.flags.localityModifier != 8)
>> ++    return TPM_BAD_PARAMETER;
>> +   /* set the capability area with the specified data, on failure
>> +      deactivate the TPM */
>> +   switch (subCap) {
>> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
>> +index 288d1ce..9e1cfb4 100644
>> +--- a/tpm/tpm_cmd_handler.c
>> ++++ b/tpm/tpm_cmd_handler.c
>> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
>> +   tpm_extern_release();
>> + }
>> +
>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size)
>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality)
>> + {
>> +   TPM_REQUEST req;
>> +   TPM_RESPONSE rsp;
>> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint3
>> +   UINT32 len;
>> +   BOOL free_out;
>> +
>> +-  debug("tpm_handle_command()");
>> ++  debug("tpm_handle_command(%d)", locality);
>> ++  if (locality != -1)
>> ++    tpmData.stany.flags.localityModifier = locality;
>> +
>> +   /* we need the whole packet at once, otherwise unmarshalling will fail */
>> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) != 0) {
>> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
>> +index eed749e..4c228bd 100644
>> +--- a/tpm/tpm_emulator.h
>> ++++ b/tpm/tpm_emulator.h
>> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
>> +  * its usage. In case of an error, all internally allocated memory
>> +  * is released and the the state of out and out_size is unspecified.
>> +  */
>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size);
>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality);
>> +
>> + #endif /* _TPM_EMULATOR_H_ */
>> +
>> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c
>> +index aabe6c3..440a01b 100644
>> +--- a/tpm/tpm_emulator_extern.c
>> ++++ b/tpm/tpm_emulator_extern.c
>> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length) = _tpm_read_fr
>>    #else /* TPM_NO_EXTERN */
>> -
>> +
>>    int (*tpm_extern_init)(void)                                      = NULL;
>>   -int (*tpm_extern_release)(void)                                   = NULL;
>>   +void (*tpm_extern_release)(void)                                   = NULL;
>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>> index c33e078..dcfc3b9 100644
>> --- a/stubdom/vtpm/vtpm.c
>> +++ b/stubdom/vtpm/vtpm.c
>> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>>     static void main_loop(void) {
>>      tpmcmd_t* tpmcmd = NULL;
>> -   domid_t domid;        /* Domid of frontend */
>> -   unsigned int handle;    /* handle of frontend */
>>      int res = -1;
>>        info("VTPM Initializing\n");
>> @@ -162,15 +160,7 @@ static void main_loop(void) {
>>         goto abort_postpcrs;
>>      }
>>   -   /* Wait for the frontend domain to connect */
>> -   info("Waiting for frontend domain to connect..");
>> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
>> -      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
>> -   } else {
>> -      error("Unable to attach to a frontend");
>> -   }
>> -
>> -   tpmcmd = tpmback_req(domid, handle);
>> +   tpmcmd = tpmback_req_any();
>>      while(tpmcmd) {
>>         /* Handle the request */
>>         if(tpmcmd->req_len) {
>> @@ -183,7 +173,7 @@ static void main_loop(void) {
>>            }
>>            /* If not disabled, do the command */
>>            else {
>> -            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
>> +            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) != 0) {
>>                  error("tpm_handle_command() failed");
>>                  create_error_response(tpmcmd, TPM_FAIL);
>>               }
>> @@ -194,7 +184,7 @@ static void main_loop(void) {
>>         tpmback_resp(tpmcmd);
>>           /* Wait for the next request */
>> -      tpmcmd = tpmback_req(domid, handle);
>> +      tpmcmd = tpmback_req_any();
>>        }
> Before the vtpm would shut down on its own when the host domain disconnects. This occurs because tpmback_req() returns NULL if the frontend disconnected. Using tpmback_req_any(), this is no longer the case which now means the user has to shut down the vtpm manually. How are you handling vtpm shutdown on your end?

When a domain shuts down, "xl destroy" is called on its paired vTPM (by some
scripting that may need to be incorporated into libxl). A graceful shutdown
is not really needed at this point, although it might be needed in the short
term if the save-state operation is not atomic - but a method of recovering
from this type of failure is needed for vTPMs anyway.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 19:08:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 19:08:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdQVy-00013z-0Z; Tue, 27 Nov 2012 19:08:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TdQVw-00013t-Sm
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 19:08:13 +0000
Received: from [85.158.138.51:59053] by server-12.bemta-3.messagelabs.com id
	05/3A-22757-79F05B05; Tue, 27 Nov 2012 19:08:07 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354043286!25366855!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30288 invoked from network); 27 Nov 2012 19:08:06 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 19:08:06 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16032047"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 19:08:06 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 27 Nov 2012 19:08:05 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TdQVp-00082G-Iw; Tue, 27 Nov 2012 19:08:05 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TdQVp-0005mT-Cs;
	Tue, 27 Nov 2012 19:08:05 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20661.3989.258191.396175@mariner.uk.xensource.com>
Date: Tue, 27 Nov 2012 19:08:05 +0000
To: Bamvor Jian Zhang <bjzhang@suse.com>
In-Reply-To: <0451e6041bdd88c90eee.1353395794@linux-bjrd.bjz>
References: <0451e6041bdd88c90eee.1353395794@linux-bjrd.bjz>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: "jfehlig@suse.com" <jfehlig@suse.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] fix race condition between libvirtd event
 handling and libxl fd deregister
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Bamvor Jian Zhang writes ("[PATCH] fix race condition between libvirtd event handling and libxl fd deregister"):
> the race condition may be encounted at the following senaro:

Thanks for this report.  You are correct that there is a race here.
Unfortunately it's more complicated than your analysis reveals and I
think your proposed fix is not sufficient.

I have worked up a patch - see below - which I think fixes most of the
problem.  Please see the commit message and the big new comment just
after the definition of OSEVENT_HOOK_VOID for details.

But I think there may be one serious problem remaining.  It seems to
me that entry to libxl__osevent_occurred_timeout can race with the
hook timeout_deregister.  Specifically, the API presented by libxl
does not allow libxl to tell whether a call to
libxl__osevent_occurred_timeout is one which was entered before a call
to libxl__ev_time_deregister and thence timeout_deregister.

Let us suppose that the previous timeout registration is similar to
the new one, but has a different for_app_reg value.

If the call to libxl__osevent_occurred_timeout was entered a long time
ago then it refers to the old timeout registration and the current
timeout registration is not affected, and must still be deregistered if
necessary.  Not deregistering it would leak memory.

If the call was entered "recently" it refers to the current timeout
registration.  That means that the current timeout for_app_reg value
(the libvirt event request) has been freed and deregistering it would
be a memory management error.

Bamvor, do you agree with this analysis ?  If so, what change to the
libxl API syntax or semantics would fix the problem ?

I see that the notion that a timeout event registration by libxl with
the application is automatic deregistered is not expressed clearly in
libxl.h.  So perhaps one fix would be to decree that libxl is supposed
to call timeout_deregister from within
libxl__osevent_occurred_timeout if it wasn't called before.

Thanks,
Ian.


From: Ian Jackson <ian.jackson@eu.citrix.com>
Subject: [PATCH] RFC: libxl: fix stale fd/timeout event callback race

DO NOT APPLY

Because there is not necessarily any lock held at the point the
application (eg, libvirt) calls libxl_osevent_occurred_timeout and
..._fd, in a multithreaded program those calls may be arbitrarily
delayed in relation to other activities within the program.

libxl therefore needs to be prepared to receive very old event
callbacks.  Arrange for this to be the case.

Document the problem and the solution in a comment in libxl_event.c
just before the definition of struct libxl__osevent_hook_nexus.

Reported-by: Bamvor Jian Zhang <bjzhang@suse.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

---
 tools/libxl/libxl_event.c    |  188 +++++++++++++++++++++++++++++++++++------
 tools/libxl/libxl_internal.h |    8 ++-
 2 files changed, 166 insertions(+), 30 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index 72cb723..7c8719d 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -38,23 +38,123 @@
  * The application's registration hooks should be called ONLY via
  * these macros, with the ctx locked.  Likewise all the "occurred"
  * entrypoints from the application should assert(!in_hook);
+ *
+ * During the hook call - including while the arguments are being
+ * evaluated - ev->nexus is guaranteed to be valid and refer to the
+ * nexus which is being used for this event registration.  The
+ * arguments should specify ev->nexus for the for_libxl argument and
+ * ev->nexus->for_app_reg (or a pointer to it) for for_app_reg.
  */
-#define OSEVENT_HOOK_INTERN(retval, hookname, ...) do {                      \
-    if (CTX->osevent_hooks) {                                                \
-        CTX->osevent_in_hook++;                                              \
-        retval CTX->osevent_hooks->hookname(CTX->osevent_user, __VA_ARGS__); \
-        CTX->osevent_in_hook--;                                              \
-    }                                                                        \
+#define OSEVENT_HOOK_INTERN(retval, failedp, evkind, hookop, ...) do {  \
+    if (CTX->osevent_hooks) {                                           \
+        CTX->osevent_in_hook++;                                         \
+        libxl__osevent_hook_nexi *nexi = &CTX->hook_##evkind##_nexi_idle; \
+        osevent_hook_pre_##hookop(gc, ev, nexi, &ev->nexus);            \
+        retval CTX->osevent_hooks->evkind##_##hookop                    \
+            (CTX->osevent_user, __VA_ARGS__);                           \
+        if ((failedp))                                                  \
+            osevent_hook_failed_##hookop(gc, ev, nexi, &ev->nexus);     \
+        CTX->osevent_in_hook--;                                         \
+    }                                                                   \
 } while (0)
 
-#define OSEVENT_HOOK(hookname, ...) ({                                       \
-    int osevent_hook_rc = 0;                                                 \
-    OSEVENT_HOOK_INTERN(osevent_hook_rc = , hookname, __VA_ARGS__);          \
-    osevent_hook_rc;                                                         \
+#define OSEVENT_HOOK(evkind, hookop, ...) ({                   \
+    int osevent_hook_rc = 0;                                    \
+    OSEVENT_HOOK_INTERN(osevent_hook_rc =, !!osevent_hook_rc,   \
+                        evkind, hookop, __VA_ARGS__);          \
+    osevent_hook_rc;                                            \
 })
 
-#define OSEVENT_HOOK_VOID(hookname, ...) \
-    OSEVENT_HOOK_INTERN(/* void */, hookname, __VA_ARGS__)
+#define OSEVENT_HOOK_VOID(evkind, hookop, ...) \
+    OSEVENT_HOOK_INTERN(/* void */, 0, evkind, hookop, __VA_ARGS__)
+
+/*
+ * The application's calls to libxl_osevent_occurred_... may be
+ * indefinitely delayed with respect to the rest of the program (since
+ * they are not necessarily called with any lock held).  So the
+ * for_libxl value we receive may be (almost) arbitrarily old.  All we
+ * know is that it came from this ctx.
+ *
+ * Therefore we may not free the object referred to by any for_libxl
+ * value until we free the whole libxl_ctx.  And if we reuse it we
+ * must be able to tell when an old use turns up, and discard the
+ * stale event.
+ *
+ * Thus we cannot use the ev directly as the for_libxl value - we need
+ * a layer of indirection.
+ *
+ * We do this by keeping a pool of libxl__osevent_hook_nexus structs,
+ * and use pointers to them as for_libxl values.  In fact, there are
+ * two pools: one for fds and one for timeouts.  This ensures that we
+ * don't risk a type error when we upcast nexus->ev.  In each nexus
+ * the ev is either null or points to a valid libxl__ev_time or
+ * libxl__ev_fd, as applicable.
+ *
+ * We /do/ allow ourselves to reassociate an old nexus with a new ev
+ * as otherwise we would have to leak nexi.  (This reassociation
+ * might, of course, be an old ev being reused for a new purpose so
+ * simply comparing the ev pointer is not sufficient.)  Thus the
+ * libxl_osevent_occurred functions need to check that the condition
+ * allegedly signalled by this event actually exists.
+ *
+ * The nexi and the lists are all protected by the ctx lock.
+ */
+ 
+struct libxl__osevent_hook_nexus {
+    void *ev;
+    void *for_app_reg;
+    LIBXL_SLIST_ENTRY(libxl__osevent_hook_nexus) next;
+};
+
+static void osevent_hook_pre_register(libxl__gc *gc, void *ev,
+                                      libxl__osevent_hook_nexi *nexi_idle,
+                                      libxl__osevent_hook_nexus **nexus_r)
+{
+    libxl__osevent_hook_nexus *nexus = LIBXL_SLIST_FIRST(nexi_idle);
+    if (nexus) {
+        LIBXL_SLIST_REMOVE_HEAD(nexi_idle, next);
+    } else {
+        nexus = libxl__zalloc(NOGC, sizeof(*nexus));
+    }
+    nexus->ev = ev;
+    *nexus_r = nexus;
+}
+static void osevent_hook_pre_deregister(libxl__gc *gc, void *ev,
+                                        libxl__osevent_hook_nexi *nexi_idle,
+                                        libxl__osevent_hook_nexus **nexus)
+{
+    (*nexus)->ev = 0;
+    LIBXL_SLIST_INSERT_HEAD(nexi_idle, *nexus, next);
+}
+static void osevent_hook_pre_modify(libxl__gc *gc, void *ev,
+                                    libxl__osevent_hook_nexi *nexi_idle,
+                                    libxl__osevent_hook_nexus **nexus)
+{
+}
+
+static void osevent_hook_failed_register(libxl__gc *gc, void *ev,
+                                         libxl__osevent_hook_nexi *nexi_idle,
+                                         libxl__osevent_hook_nexus **nexus)
+{
+    osevent_hook_pre_deregister(gc, ev, nexi_idle, nexus);
+}
+static void osevent_hook_failed_deregister(libxl__gc *gc, void *ev,
+                                           libxl__osevent_hook_nexi *nexi_idle,
+                                           libxl__osevent_hook_nexus **nexus)
+{
+    abort();
+}
+static void osevent_hook_failed_modify(libxl__gc *gc, void *ev,
+                                       libxl__osevent_hook_nexi *nexi_idle,
+                                       libxl__osevent_hook_nexus **nexus)
+{
+}
+
+static void *osevent_ev_from_hook_nexus(libxl_ctx *ctx, void *for_libxl)
+{
+    libxl__osevent_hook_nexus *nexus = for_libxl;
+    return nexus->ev;
+}
 
 /*
  * fd events
@@ -72,7 +172,8 @@ int libxl__ev_fd_register(libxl__gc *gc, libxl__ev_fd *ev,
 
     DBG("ev_fd=%p register fd=%d events=%x", ev, fd, events);
 
-    rc = OSEVENT_HOOK(fd_register, fd, &ev->for_app_reg, events, ev);
+    rc = OSEVENT_HOOK(fd, register, fd, &ev->nexus->for_app_reg,
+                      events, ev->nexus);
     if (rc) goto out;
 
     ev->fd = fd;
@@ -97,7 +198,7 @@ int libxl__ev_fd_modify(libxl__gc *gc, libxl__ev_fd *ev, short events)
 
     DBG("ev_fd=%p modify fd=%d events=%x", ev, ev->fd, events);
 
-    rc = OSEVENT_HOOK(fd_modify, ev->fd, &ev->for_app_reg, events);
+    rc = OSEVENT_HOOK(fd, modify, ev->fd, &ev->nexus->for_app_reg, events);
     if (rc) goto out;
 
     ev->events = events;
@@ -119,7 +220,7 @@ void libxl__ev_fd_deregister(libxl__gc *gc, libxl__ev_fd *ev)
 
     DBG("ev_fd=%p deregister fd=%d", ev, ev->fd);
 
-    OSEVENT_HOOK_VOID(fd_deregister, ev->fd, ev->for_app_reg);
+    OSEVENT_HOOK_VOID(fd, deregister, ev->fd, ev->nexus->for_app_reg);
     LIBXL_LIST_REMOVE(ev, entry);
     ev->fd = -1;
 
@@ -171,7 +272,8 @@ static int time_register_finite(libxl__gc *gc, libxl__ev_time *ev,
 {
     int rc;
 
-    rc = OSEVENT_HOOK(timeout_register, &ev->for_app_reg, absolute, ev);
+    rc = OSEVENT_HOOK(timeout, register, &ev->nexus->for_app_reg,
+                      absolute, ev->nexus);
     if (rc) return rc;
 
     ev->infinite = 0;
@@ -184,7 +286,7 @@ static int time_register_finite(libxl__gc *gc, libxl__ev_time *ev,
 static void time_deregister(libxl__gc *gc, libxl__ev_time *ev)
 {
     if (!ev->infinite) {
-        OSEVENT_HOOK_VOID(timeout_deregister, ev->for_app_reg);
+        OSEVENT_HOOK_VOID(timeout, deregister, ev->nexus->for_app_reg);
         LIBXL_TAILQ_REMOVE(&CTX->etimes, ev, entry);
     }
 }
@@ -270,7 +372,7 @@ int libxl__ev_time_modify_abs(libxl__gc *gc, libxl__ev_time *ev,
         rc = time_register_finite(gc, ev, absolute);
         if (rc) goto out;
     } else {
-        rc = OSEVENT_HOOK(timeout_modify, &ev->for_app_reg, absolute);
+        rc = OSEVENT_HOOK(timeout, modify, &ev->nexus->for_app_reg, absolute);
         if (rc) goto out;
 
         LIBXL_TAILQ_REMOVE(&CTX->etimes, ev, entry);
@@ -1010,35 +1112,65 @@ void libxl_osevent_register_hooks(libxl_ctx *ctx,
 
 
 void libxl_osevent_occurred_fd(libxl_ctx *ctx, void *for_libxl,
-                               int fd, short events, short revents)
+                               int fd, short events_ign, short revents_ign)
 {
-    libxl__ev_fd *ev = for_libxl;
-
     EGC_INIT(ctx);
     CTX_LOCK;
     assert(!CTX->osevent_in_hook);
 
-    assert(fd == ev->fd);
-    revents &= ev->events;
-    if (revents)
-        ev->func(egc, ev, fd, ev->events, revents);
+    libxl__ev_fd *ev = osevent_ev_from_hook_nexus(ctx, for_libxl);
+    if (!ev) goto out;
+    if (ev->fd != fd) goto out;
+
+    struct pollfd check;
+    for (;;) {
+        check.fd = fd;
+        check.events = ev->events;
+        int r = poll(&check, 1, 0);
+        if (!r)
+            goto out;
+        if (r==1)
+            break;
+        assert(r<0);
+        if (errno != EINTR) {
+            LIBXL__EVENT_DISASTER(egc, "failed poll to check for fd", errno, 0);
+            goto out;
+        }
+    }
 
+    if (check.revents)
+        ev->func(egc, ev, fd, ev->events, check.revents);
+
+ out:
     CTX_UNLOCK;
     EGC_FREE;
 }
 
 void libxl_osevent_occurred_timeout(libxl_ctx *ctx, void *for_libxl)
 {
-    libxl__ev_time *ev = for_libxl;
-
     EGC_INIT(ctx);
     CTX_LOCK;
     assert(!CTX->osevent_in_hook);
 
-    assert(!ev->infinite);
+    libxl__ev_time *ev = osevent_ev_from_hook_nexus(ctx, for_libxl);
+    if (!ev) goto out;
+    if (ev->infinite) goto out;
+
+    struct timeval now;
+    int r = libxl__gettimeofday(gc, &now);
+    if (r)
+        /* probably(?) safer to risk a race causing a time event to
+         * happen early than to ignore the event and call DISASTER */
+        goto out;
+
+    if (timercmp(&ev->abs, &now, >))
+        /* lost the race - this is a stale timer event callback */
+        goto out;
+
     LIBXL_TAILQ_REMOVE(&CTX->etimes, ev, entry);
     ev->func(egc, ev, &ev->abs);
 
+ out:
     CTX_UNLOCK;
     EGC_FREE;
 }
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index cba3616..6484bcb 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -136,6 +136,8 @@ typedef struct libxl__gc libxl__gc;
 typedef struct libxl__egc libxl__egc;
 typedef struct libxl__ao libxl__ao;
 typedef struct libxl__aop_occurred libxl__aop_occurred;
+typedef struct libxl__osevent_hook_nexus libxl__osevent_hook_nexus;
+typedef struct libxl__osevent_hook_nexi libxl__osevent_hook_nexi;
 
 _hidden void libxl__alloc_failed(libxl_ctx *, const char *func,
                          size_t nmemb, size_t size) __attribute__((noreturn));
@@ -163,7 +165,7 @@ struct libxl__ev_fd {
     libxl__ev_fd_callback *func;
     /* remainder is private for libxl__ev_fd... */
     LIBXL_LIST_ENTRY(libxl__ev_fd) entry;
-    void *for_app_reg;
+    libxl__osevent_hook_nexus *nexus;
 };
 
 
@@ -178,7 +180,7 @@ struct libxl__ev_time {
     int infinite; /* not registered in list or with app if infinite */
     LIBXL_TAILQ_ENTRY(libxl__ev_time) entry;
     struct timeval abs;
-    void *for_app_reg;
+    libxl__osevent_hook_nexus *nexus;
 };
 
 typedef struct libxl__ev_xswatch libxl__ev_xswatch;
@@ -329,6 +331,8 @@ struct libxl__ctx {
     libxl__poller poller_app; /* libxl_osevent_beforepoll and _afterpoll */
     LIBXL_LIST_HEAD(, libxl__poller) pollers_event, pollers_idle;
 
+    LIBXL_SLIST_HEAD(libxl__osevent_hook_nexi, libxl__osevent_hook_nexus)
+        hook_fd_nexi_idle, hook_timeout_nexi_idle;
     LIBXL_LIST_HEAD(, libxl__ev_fd) efds;
     LIBXL_TAILQ_HEAD(, libxl__ev_time) etimes;
 
-- 
tg: (bfe7025..) t/xen/xl.eventfix2.fdreg.indirect (depends on: base)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 19:08:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 19:08:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdQVy-00013z-0Z; Tue, 27 Nov 2012 19:08:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TdQVw-00013t-Sm
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 19:08:13 +0000
Received: from [85.158.138.51:59053] by server-12.bemta-3.messagelabs.com id
	05/3A-22757-79F05B05; Tue, 27 Nov 2012 19:08:07 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354043286!25366855!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30288 invoked from network); 27 Nov 2012 19:08:06 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 19:08:06 -0000
X-IronPort-AV: E=Sophos;i="4.83,328,1352073600"; d="scan'208";a="16032047"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 19:08:06 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 27 Nov 2012 19:08:05 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1TdQVp-00082G-Iw; Tue, 27 Nov 2012 19:08:05 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1TdQVp-0005mT-Cs;
	Tue, 27 Nov 2012 19:08:05 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20661.3989.258191.396175@mariner.uk.xensource.com>
Date: Tue, 27 Nov 2012 19:08:05 +0000
To: Bamvor Jian Zhang <bjzhang@suse.com>
In-Reply-To: <0451e6041bdd88c90eee.1353395794@linux-bjrd.bjz>
References: <0451e6041bdd88c90eee.1353395794@linux-bjrd.bjz>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: "jfehlig@suse.com" <jfehlig@suse.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] fix race condition between libvirtd event
 handling and libxl fd deregister
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Bamvor Jian Zhang writes ("[PATCH] fix race condition between libvirtd event handling and libxl fd deregister"):
> the race condition may be encounted at the following senaro:

Thanks for this report.  You are correct that there is a race here.
Unfortunately it's more complicated than your analysis reveals and I
think your proposed fix is not sufficient.

I have worked up a patch - see below - which I think fixes most of the
problem.  Please see the commit message and the big new comment just
after the definition of OSEVENT_HOOK_VOID for details.

But I think there may be one serious problem remaining.  It seems to
me that entry to libxl__osevent_occurred_timeout can race with the
hook timeout_deregister.  Specifically, the API presented by libxl
does not allow libxl to tell whether a call to
libxl__osevent_occurred_timeout is one which was entered before a call
to libxl__ev_time_deregister and thence timeout_deregister.

Let us suppose that the previous timeout registration is similar to
the new one, but has a different for_app_reg value.

If the call to libxl__osevent_occurred_timeout was entered a long time
ago then it refers to the old timeout registration and the current
timeout registration is not affected, and must still be deregistered if
necessary.  Not deregistering it would leak memory.

If the call was entered "recently" it refers to the current timeout
registration.  That means that the current timeout for_app_reg value
(the libvirt event request) has been freed and deregistering it would
be a memory management error.

Bamvor, do you agree with this analysis ?  If so, what change to the
libxl API syntax or semantics would fix the problem ?

I see that the notion that a timeout event registration by libxl with
the application is automatic deregistered is not expressed clearly in
libxl.h.  So perhaps one fix would be to decree that libxl is supposed
to call timeout_deregister from within
libxl__osevent_occurred_timeout if it wasn't called before.

Thanks,
Ian.


From: Ian Jackson <ian.jackson@eu.citrix.com>
Subject: [PATCH] RFC: libxl: fix stale fd/timeout event callback race

DO NOT APPLY

Because there is not necessarily any lock held at the point the
application (eg, libvirt) calls libxl_osevent_occurred_timeout and
..._fd, in a multithreaded program those calls may be arbitrarily
delayed in relation to other activities within the program.

libxl therefore needs to be prepared to receive very old event
callbacks.  Arrange for this to be the case.

Document the problem and the solution in a comment in libxl_event.c
just before the definition of struct libxl__osevent_hook_nexus.

Reported-by: Bamvor Jian Zhang <bjzhang@suse.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

---
 tools/libxl/libxl_event.c    |  188 +++++++++++++++++++++++++++++++++++------
 tools/libxl/libxl_internal.h |    8 ++-
 2 files changed, 166 insertions(+), 30 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index 72cb723..7c8719d 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -38,23 +38,123 @@
  * The application's registration hooks should be called ONLY via
  * these macros, with the ctx locked.  Likewise all the "occurred"
  * entrypoints from the application should assert(!in_hook);
+ *
+ * During the hook call - including while the arguments are being
+ * evaluated - ev->nexus is guaranteed to be valid and refer to the
+ * nexus which is being used for this event registration.  The
+ * arguments should specify ev->nexus for the for_libxl argument and
+ * ev->nexus->for_app_reg (or a pointer to it) for for_app_reg.
  */
-#define OSEVENT_HOOK_INTERN(retval, hookname, ...) do {                      \
-    if (CTX->osevent_hooks) {                                                \
-        CTX->osevent_in_hook++;                                              \
-        retval CTX->osevent_hooks->hookname(CTX->osevent_user, __VA_ARGS__); \
-        CTX->osevent_in_hook--;                                              \
-    }                                                                        \
+#define OSEVENT_HOOK_INTERN(retval, failedp, evkind, hookop, ...) do {  \
+    if (CTX->osevent_hooks) {                                           \
+        CTX->osevent_in_hook++;                                         \
+        libxl__osevent_hook_nexi *nexi = &CTX->hook_##evkind##_nexi_idle; \
+        osevent_hook_pre_##hookop(gc, ev, nexi, &ev->nexus);            \
+        retval CTX->osevent_hooks->evkind##_##hookop                    \
+            (CTX->osevent_user, __VA_ARGS__);                           \
+        if ((failedp))                                                  \
+            osevent_hook_failed_##hookop(gc, ev, nexi, &ev->nexus);     \
+        CTX->osevent_in_hook--;                                         \
+    }                                                                   \
 } while (0)
 
-#define OSEVENT_HOOK(hookname, ...) ({                                       \
-    int osevent_hook_rc = 0;                                                 \
-    OSEVENT_HOOK_INTERN(osevent_hook_rc = , hookname, __VA_ARGS__);          \
-    osevent_hook_rc;                                                         \
+#define OSEVENT_HOOK(evkind, hookop, ...) ({                   \
+    int osevent_hook_rc = 0;                                    \
+    OSEVENT_HOOK_INTERN(osevent_hook_rc =, !!osevent_hook_rc,   \
+                        evkind, hookop, __VA_ARGS__);          \
+    osevent_hook_rc;                                            \
 })
 
-#define OSEVENT_HOOK_VOID(hookname, ...) \
-    OSEVENT_HOOK_INTERN(/* void */, hookname, __VA_ARGS__)
+#define OSEVENT_HOOK_VOID(evkind, hookop, ...) \
+    OSEVENT_HOOK_INTERN(/* void */, 0, evkind, hookop, __VA_ARGS__)
+
+/*
+ * The application's calls to libxl_osevent_occurred_... may be
+ * indefinitely delayed with respect to the rest of the program (since
+ * they are not necessarily called with any lock held).  So the
+ * for_libxl value we receive may be (almost) arbitrarily old.  All we
+ * know is that it came from this ctx.
+ *
+ * Therefore we may not free the object referred to by any for_libxl
+ * value until we free the whole libxl_ctx.  And if we reuse it we
+ * must be able to tell when an old use turns up, and discard the
+ * stale event.
+ *
+ * Thus we cannot use the ev directly as the for_libxl value - we need
+ * a layer of indirection.
+ *
+ * We do this by keeping a pool of libxl__osevent_hook_nexus structs,
+ * and use pointers to them as for_libxl values.  In fact, there are
+ * two pools: one for fds and one for timeouts.  This ensures that we
+ * don't risk a type error when we upcast nexus->ev.  In each nexus
+ * the ev is either null or points to a valid libxl__ev_time or
+ * libxl__ev_fd, as applicable.
+ *
+ * We /do/ allow ourselves to reassociate an old nexus with a new ev
+ * as otherwise we would have to leak nexi.  (This reassociation
+ * might, of course, be an old ev being reused for a new purpose so
+ * simply comparing the ev pointer is not sufficient.)  Thus the
+ * libxl_osevent_occurred functions need to check that the condition
+ * allegedly signalled by this event actually exists.
+ *
+ * The nexi and the lists are all protected by the ctx lock.
+ */
+ 
+struct libxl__osevent_hook_nexus {
+    void *ev;
+    void *for_app_reg;
+    LIBXL_SLIST_ENTRY(libxl__osevent_hook_nexus) next;
+};
+
+static void osevent_hook_pre_register(libxl__gc *gc, void *ev,
+                                      libxl__osevent_hook_nexi *nexi_idle,
+                                      libxl__osevent_hook_nexus **nexus_r)
+{
+    libxl__osevent_hook_nexus *nexus = LIBXL_SLIST_FIRST(nexi_idle);
+    if (nexus) {
+        LIBXL_SLIST_REMOVE_HEAD(nexi_idle, next);
+    } else {
+        nexus = libxl__zalloc(NOGC, sizeof(*nexus));
+    }
+    nexus->ev = ev;
+    *nexus_r = nexus;
+}
+static void osevent_hook_pre_deregister(libxl__gc *gc, void *ev,
+                                        libxl__osevent_hook_nexi *nexi_idle,
+                                        libxl__osevent_hook_nexus **nexus)
+{
+    (*nexus)->ev = 0;
+    LIBXL_SLIST_INSERT_HEAD(nexi_idle, *nexus, next);
+}
+static void osevent_hook_pre_modify(libxl__gc *gc, void *ev,
+                                    libxl__osevent_hook_nexi *nexi_idle,
+                                    libxl__osevent_hook_nexus **nexus)
+{
+}
+
+static void osevent_hook_failed_register(libxl__gc *gc, void *ev,
+                                         libxl__osevent_hook_nexi *nexi_idle,
+                                         libxl__osevent_hook_nexus **nexus)
+{
+    osevent_hook_pre_deregister(gc, ev, nexi_idle, nexus);
+}
+static void osevent_hook_failed_deregister(libxl__gc *gc, void *ev,
+                                           libxl__osevent_hook_nexi *nexi_idle,
+                                           libxl__osevent_hook_nexus **nexus)
+{
+    abort();
+}
+static void osevent_hook_failed_modify(libxl__gc *gc, void *ev,
+                                       libxl__osevent_hook_nexi *nexi_idle,
+                                       libxl__osevent_hook_nexus **nexus)
+{
+}
+
+static void *osevent_ev_from_hook_nexus(libxl_ctx *ctx, void *for_libxl)
+{
+    libxl__osevent_hook_nexus *nexus = for_libxl;
+    return nexus->ev;
+}
 
 /*
  * fd events
@@ -72,7 +172,8 @@ int libxl__ev_fd_register(libxl__gc *gc, libxl__ev_fd *ev,
 
     DBG("ev_fd=%p register fd=%d events=%x", ev, fd, events);
 
-    rc = OSEVENT_HOOK(fd_register, fd, &ev->for_app_reg, events, ev);
+    rc = OSEVENT_HOOK(fd, register, fd, &ev->nexus->for_app_reg,
+                      events, ev->nexus);
     if (rc) goto out;
 
     ev->fd = fd;
@@ -97,7 +198,7 @@ int libxl__ev_fd_modify(libxl__gc *gc, libxl__ev_fd *ev, short events)
 
     DBG("ev_fd=%p modify fd=%d events=%x", ev, ev->fd, events);
 
-    rc = OSEVENT_HOOK(fd_modify, ev->fd, &ev->for_app_reg, events);
+    rc = OSEVENT_HOOK(fd, modify, ev->fd, &ev->nexus->for_app_reg, events);
     if (rc) goto out;
 
     ev->events = events;
@@ -119,7 +220,7 @@ void libxl__ev_fd_deregister(libxl__gc *gc, libxl__ev_fd *ev)
 
     DBG("ev_fd=%p deregister fd=%d", ev, ev->fd);
 
-    OSEVENT_HOOK_VOID(fd_deregister, ev->fd, ev->for_app_reg);
+    OSEVENT_HOOK_VOID(fd, deregister, ev->fd, ev->nexus->for_app_reg);
     LIBXL_LIST_REMOVE(ev, entry);
     ev->fd = -1;
 
@@ -171,7 +272,8 @@ static int time_register_finite(libxl__gc *gc, libxl__ev_time *ev,
 {
     int rc;
 
-    rc = OSEVENT_HOOK(timeout_register, &ev->for_app_reg, absolute, ev);
+    rc = OSEVENT_HOOK(timeout, register, &ev->nexus->for_app_reg,
+                      absolute, ev->nexus);
     if (rc) return rc;
 
     ev->infinite = 0;
@@ -184,7 +286,7 @@ static int time_register_finite(libxl__gc *gc, libxl__ev_time *ev,
 static void time_deregister(libxl__gc *gc, libxl__ev_time *ev)
 {
     if (!ev->infinite) {
-        OSEVENT_HOOK_VOID(timeout_deregister, ev->for_app_reg);
+        OSEVENT_HOOK_VOID(timeout, deregister, ev->nexus->for_app_reg);
         LIBXL_TAILQ_REMOVE(&CTX->etimes, ev, entry);
     }
 }
@@ -270,7 +372,7 @@ int libxl__ev_time_modify_abs(libxl__gc *gc, libxl__ev_time *ev,
         rc = time_register_finite(gc, ev, absolute);
         if (rc) goto out;
     } else {
-        rc = OSEVENT_HOOK(timeout_modify, &ev->for_app_reg, absolute);
+        rc = OSEVENT_HOOK(timeout, modify, &ev->nexus->for_app_reg, absolute);
         if (rc) goto out;
 
         LIBXL_TAILQ_REMOVE(&CTX->etimes, ev, entry);
@@ -1010,35 +1112,65 @@ void libxl_osevent_register_hooks(libxl_ctx *ctx,
 
 
 void libxl_osevent_occurred_fd(libxl_ctx *ctx, void *for_libxl,
-                               int fd, short events, short revents)
+                               int fd, short events_ign, short revents_ign)
 {
-    libxl__ev_fd *ev = for_libxl;
-
     EGC_INIT(ctx);
     CTX_LOCK;
     assert(!CTX->osevent_in_hook);
 
-    assert(fd == ev->fd);
-    revents &= ev->events;
-    if (revents)
-        ev->func(egc, ev, fd, ev->events, revents);
+    libxl__ev_fd *ev = osevent_ev_from_hook_nexus(ctx, for_libxl);
+    if (!ev) goto out;
+    if (ev->fd != fd) goto out;
+
+    struct pollfd check;
+    for (;;) {
+        check.fd = fd;
+        check.events = ev->events;
+        int r = poll(&check, 1, 0);
+        if (!r)
+            goto out;
+        if (r==1)
+            break;
+        assert(r<0);
+        if (errno != EINTR) {
+            LIBXL__EVENT_DISASTER(egc, "failed poll to check for fd", errno, 0);
+            goto out;
+        }
+    }
 
+    if (check.revents)
+        ev->func(egc, ev, fd, ev->events, check.revents);
+
+ out:
     CTX_UNLOCK;
     EGC_FREE;
 }
 
 void libxl_osevent_occurred_timeout(libxl_ctx *ctx, void *for_libxl)
 {
-    libxl__ev_time *ev = for_libxl;
-
     EGC_INIT(ctx);
     CTX_LOCK;
     assert(!CTX->osevent_in_hook);
 
-    assert(!ev->infinite);
+    libxl__ev_time *ev = osevent_ev_from_hook_nexus(ctx, for_libxl);
+    if (!ev) goto out;
+    if (ev->infinite) goto out;
+
+    struct timeval now;
+    int r = libxl__gettimeofday(gc, &now);
+    if (r)
+        /* probably(?) safer to risk a race causing a time event to
+         * happen early than to ignore the event and call DISASTER */
+        goto out;
+
+    if (timercmp(&ev->abs, &now, >))
+        /* lost the race - this is a stale timer event callback */
+        goto out;
+
     LIBXL_TAILQ_REMOVE(&CTX->etimes, ev, entry);
     ev->func(egc, ev, &ev->abs);
 
+ out:
     CTX_UNLOCK;
     EGC_FREE;
 }
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index cba3616..6484bcb 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -136,6 +136,8 @@ typedef struct libxl__gc libxl__gc;
 typedef struct libxl__egc libxl__egc;
 typedef struct libxl__ao libxl__ao;
 typedef struct libxl__aop_occurred libxl__aop_occurred;
+typedef struct libxl__osevent_hook_nexus libxl__osevent_hook_nexus;
+typedef struct libxl__osevent_hook_nexi libxl__osevent_hook_nexi;
 
 _hidden void libxl__alloc_failed(libxl_ctx *, const char *func,
                          size_t nmemb, size_t size) __attribute__((noreturn));
@@ -163,7 +165,7 @@ struct libxl__ev_fd {
     libxl__ev_fd_callback *func;
     /* remainder is private for libxl__ev_fd... */
     LIBXL_LIST_ENTRY(libxl__ev_fd) entry;
-    void *for_app_reg;
+    libxl__osevent_hook_nexus *nexus;
 };
 
 
@@ -178,7 +180,7 @@ struct libxl__ev_time {
     int infinite; /* not registered in list or with app if infinite */
     LIBXL_TAILQ_ENTRY(libxl__ev_time) entry;
     struct timeval abs;
-    void *for_app_reg;
+    libxl__osevent_hook_nexus *nexus;
 };
 
 typedef struct libxl__ev_xswatch libxl__ev_xswatch;
@@ -329,6 +331,8 @@ struct libxl__ctx {
     libxl__poller poller_app; /* libxl_osevent_beforepoll and _afterpoll */
     LIBXL_LIST_HEAD(, libxl__poller) pollers_event, pollers_idle;
 
+    LIBXL_SLIST_HEAD(libxl__osevent_hook_nexi, libxl__osevent_hook_nexus)
+        hook_fd_nexi_idle, hook_timeout_nexi_idle;
     LIBXL_LIST_HEAD(, libxl__ev_fd) efds;
     LIBXL_TAILQ_HEAD(, libxl__ev_time) etimes;
 
-- 
tg: (bfe7025..) t/xen/xl.eventfix2.fdreg.indirect (depends on: base)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 19:51:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 19:51:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdRB8-0001aX-1X; Tue, 27 Nov 2012 19:50:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TdRB5-0001aS-PJ
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 19:50:44 +0000
Received: from [85.158.138.51:39955] by server-4.bemta-3.messagelabs.com id
	15/23-30023-29915B05; Tue, 27 Nov 2012 19:50:42 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-6.tower-174.messagelabs.com!1354045833!23695692!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7974 invoked from network); 27 Nov 2012 19:50:34 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-6.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 19:50:34 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158205880;
	Tue, 27 Nov 2012 14:48:35 -0500
Message-ID: <50B5190D.20604@jhuapl.edu>
Date: Tue, 27 Nov 2012 14:48:29 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>, 
	Samuel Thibault <samuel.thibault@ens-lyon.org>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B5042B.7000602@jhuapl.edu> <50B50E3E.6050807@tycho.nsa.gov>
In-Reply-To: <50B50E3E.6050807@tycho.nsa.gov>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4424959312589603556=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============4424959312589603556==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms040806030204010809090008"

This is a cryptographically signed message in MIME format.

--------------ms040806030204010809090008
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/27/2012 02:02 PM, Daniel De Graaf wrote:
> On 11/27/2012 01:19 PM, Matthew Fioravante wrote:
>> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>>> The vTPM protocol now contains a field allowing the locality of a
>>> command to be specified; pass this to the TPM when processing a packe=
t.
>>> This also enables a single vTPM to provide multiple tpmback interface=
s
>>> so that several closely related domains can share a vTPM (for example=
, a
>>> qemu device stubdom and its target domain).
>>>
>>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>> ---
>>>    stubdom/tpmemu-0.7.4.patch | 61 ++++++++++++++++++++++++++++++++++=
++++++++----
>>>    stubdom/vtpm/vtpm.c        | 16 +++---------
>>>    2 files changed, 59 insertions(+), 18 deletions(-)
>>>
>>> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
>>> index b84eff1..31ace1a 100644
>>> --- a/stubdom/tpmemu-0.7.4.patch
>>> +++ b/stubdom/tpmemu-0.7.4.patch
>>> @@ -1,9 +1,60 @@
>>> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_em=
ulator-x86_64/tpm/tpm_emulator_extern.c
>>> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c    2012-04-27=
 10:55:46.581963398 -0400
>>> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c    2012-04-27 10:5=
6:02.193034152 -0400
>>> -@@ -249,7 +249,7 @@
>>> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
>>> +index 60bbb90..f8f7f0f 100644
>>> +--- a/tpm/tpm_capability.c
>>> ++++ b/tpm/tpm_capability.c
>>> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE=
 *setValue,
>>> +                              UINT32 setValueSize, BOOL ownerAuth,
>>> +                              BOOL deactivated, BOOL disabled)
>>> + {
>>> ++  if (tpmData.stany.flags.localityModifier !=3D 8)
>>> ++    return TPM_BAD_PARAMETER;
>>> +   /* set the capability area with the specified data, on failure
>>> +      deactivate the TPM */
>>> +   switch (subCap) {
>>> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
>>> +index 288d1ce..9e1cfb4 100644
>>> +--- a/tpm/tpm_cmd_handler.c
>>> ++++ b/tpm/tpm_cmd_handler.c
>>> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
>>> +   tpm_extern_release();
>>> + }
>>> +
>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t=
 **out, uint32_t *out_size)
>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t=
 **out, uint32_t *out_size, int locality)
>>> + {
>>> +   TPM_REQUEST req;
>>> +   TPM_RESPONSE rsp;
>>> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint=
32_t in_size, uint8_t **out, uint3
>>> +   UINT32 len;
>>> +   BOOL free_out;
>>> +
>>> +-  debug("tpm_handle_command()");
>>> ++  debug("tpm_handle_command(%d)", locality);
>>> ++  if (locality !=3D -1)
>>> ++    tpmData.stany.flags.localityModifier =3D locality;
>>> +
>>> +   /* we need the whole packet at once, otherwise unmarshalling will=
 fail */
>>> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) !=3D=
 0) {
>>> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
>>> +index eed749e..4c228bd 100644
>>> +--- a/tpm/tpm_emulator.h
>>> ++++ b/tpm/tpm_emulator.h
>>> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
>>> +  * its usage. In case of an error, all internally allocated memory
>>> +  * is released and the the state of out and out_size is unspecified=
=2E
>>> +  */
>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t=
 **out, uint32_t *out_size);
>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t=
 **out, uint32_t *out_size, int locality);
>>> +
>>> + #endif /* _TPM_EMULATOR_H_ */
>>> +
>>> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c
>>> +index aabe6c3..440a01b 100644
>>> +--- a/tpm/tpm_emulator_extern.c
>>> ++++ b/tpm/tpm_emulator_extern.c
>>> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, siz=
e_t *data_length) =3D _tpm_read_fr
>>>     #else /* TPM_NO_EXTERN */
>>> -
>>> +
>>>     int (*tpm_extern_init)(void)                                     =
 =3D NULL;
>>>    -int (*tpm_extern_release)(void)                                  =
 =3D NULL;
>>>    +void (*tpm_extern_release)(void)                                 =
  =3D NULL;
>>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>>> index c33e078..dcfc3b9 100644
>>> --- a/stubdom/vtpm/vtpm.c
>>> +++ b/stubdom/vtpm/vtpm.c
>>> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>>>      static void main_loop(void) {
>>>       tpmcmd_t* tpmcmd =3D NULL;
>>> -   domid_t domid;        /* Domid of frontend */
>>> -   unsigned int handle;    /* handle of frontend */
>>>       int res =3D -1;
>>>         info("VTPM Initializing\n");
>>> @@ -162,15 +160,7 @@ static void main_loop(void) {
>>>          goto abort_postpcrs;
>>>       }
>>>    -   /* Wait for the frontend domain to connect */
>>> -   info("Waiting for frontend domain to connect..");
>>> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) =3D=3D 0) {=

>>> -      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, =
handle);
>>> -   } else {
>>> -      error("Unable to attach to a frontend");
>>> -   }
>>> -
>>> -   tpmcmd =3D tpmback_req(domid, handle);
>>> +   tpmcmd =3D tpmback_req_any();
>>>       while(tpmcmd) {
>>>          /* Handle the request */
>>>          if(tpmcmd->req_len) {
>>> @@ -183,7 +173,7 @@ static void main_loop(void) {
>>>             }
>>>             /* If not disabled, do the command */
>>>             else {
>>> -            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->req_=
len, &tpmcmd->resp, &tpmcmd->resp_len)) !=3D 0) {
>>> +            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->req_=
len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) !=3D 0) {
>>>                   error("tpm_handle_command() failed");
>>>                   create_error_response(tpmcmd, TPM_FAIL);
>>>                }
>>> @@ -194,7 +184,7 @@ static void main_loop(void) {
>>>          tpmback_resp(tpmcmd);
>>>            /* Wait for the next request */
>>> -      tpmcmd =3D tpmback_req(domid, handle);
>>> +      tpmcmd =3D tpmback_req_any();
>>>         }
>> Before the vtpm would shut down on its own when the host domain discon=
nects. This occurs because tpmback_req() returns NULL if the frontend dis=
connected. Using tpmback_req_any(), this is no longer the case which now =
means the user has to shut down the vtpm manually. How are you handling v=
tpm shutdown on your end?
> When a domain shuts down, "xl destroy" is called on its paired vTPM (by=
 some
> scripting that may need to be incorporated into libxl). A graceful shut=
down
> is not really needed at this point, although it might be needed in the =
short
> term if the save-state operation is not atomic - but a method of recove=
ring
> from this type of failure is needed for vTPMs anyway.
This is kind of a difficult problem. The save state operation is not by=20
any means atomic and it is very possible that the guest shuts down and=20
xl destroy is called before the save operation completes. This is=20
especially true if the guest is an embedded or even a mini-os domain=20
using tpmfront that shuts down very quickly. Its the reason why now the=20
vtpm shuts itself down after the guest disconnects.

What is really needed is a way to do an xl shutdown on mini-os domains=20
to let vtpm-stubdom shutdown correctly. From what I understand there is=20
not yet any support for this in mini-os. How tricky would it be to add=20
that? Samuel any ideas?

If thats not possible, another potential hack could be writing a key in=20
xenstore to trigger the shutdown or setting up some other kind of event=20
channel mechanism between the vtpm domain and libxl.



--------------ms040806030204010809090008
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBg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7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEyNzE5NDgyOVowIwYJKoZIhvcNAQkEMRYEFG+HwdmIbURGVgv2
9Ms5oN6VcZhXMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYCZE/SlDBq5qQFwzrYD2t6BKn0tnsUJ4yvA
EGklNZJqUnEnEJ/IpRJQARf1BHUchI++5sy9rRj0G9cBab+kqG9ejkQZnJ15NAAe6PiNO75L
LYTV4zEwdtLcqpzawAoj2bpV8hpaOfvwT7pzQRbX8yepksnIBASgXysbvVdj5NYAGgAAAAAA
AA==
--------------ms040806030204010809090008--


--===============4424959312589603556==
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.xen.org
http://lists.xen.org/xen-devel

--===============4424959312589603556==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 19:51:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 19:51:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdRB8-0001aX-1X; Tue, 27 Nov 2012 19:50:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TdRB5-0001aS-PJ
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 19:50:44 +0000
Received: from [85.158.138.51:39955] by server-4.bemta-3.messagelabs.com id
	15/23-30023-29915B05; Tue, 27 Nov 2012 19:50:42 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-6.tower-174.messagelabs.com!1354045833!23695692!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7974 invoked from network); 27 Nov 2012 19:50:34 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-6.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 19:50:34 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158205880;
	Tue, 27 Nov 2012 14:48:35 -0500
Message-ID: <50B5190D.20604@jhuapl.edu>
Date: Tue, 27 Nov 2012 14:48:29 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>, 
	Samuel Thibault <samuel.thibault@ens-lyon.org>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B5042B.7000602@jhuapl.edu> <50B50E3E.6050807@tycho.nsa.gov>
In-Reply-To: <50B50E3E.6050807@tycho.nsa.gov>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4424959312589603556=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============4424959312589603556==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms040806030204010809090008"

This is a cryptographically signed message in MIME format.

--------------ms040806030204010809090008
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/27/2012 02:02 PM, Daniel De Graaf wrote:
> On 11/27/2012 01:19 PM, Matthew Fioravante wrote:
>> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>>> The vTPM protocol now contains a field allowing the locality of a
>>> command to be specified; pass this to the TPM when processing a packe=
t.
>>> This also enables a single vTPM to provide multiple tpmback interface=
s
>>> so that several closely related domains can share a vTPM (for example=
, a
>>> qemu device stubdom and its target domain).
>>>
>>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>> ---
>>>    stubdom/tpmemu-0.7.4.patch | 61 ++++++++++++++++++++++++++++++++++=
++++++++----
>>>    stubdom/vtpm/vtpm.c        | 16 +++---------
>>>    2 files changed, 59 insertions(+), 18 deletions(-)
>>>
>>> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
>>> index b84eff1..31ace1a 100644
>>> --- a/stubdom/tpmemu-0.7.4.patch
>>> +++ b/stubdom/tpmemu-0.7.4.patch
>>> @@ -1,9 +1,60 @@
>>> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_em=
ulator-x86_64/tpm/tpm_emulator_extern.c
>>> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c    2012-04-27=
 10:55:46.581963398 -0400
>>> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c    2012-04-27 10:5=
6:02.193034152 -0400
>>> -@@ -249,7 +249,7 @@
>>> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
>>> +index 60bbb90..f8f7f0f 100644
>>> +--- a/tpm/tpm_capability.c
>>> ++++ b/tpm/tpm_capability.c
>>> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE=
 *setValue,
>>> +                              UINT32 setValueSize, BOOL ownerAuth,
>>> +                              BOOL deactivated, BOOL disabled)
>>> + {
>>> ++  if (tpmData.stany.flags.localityModifier !=3D 8)
>>> ++    return TPM_BAD_PARAMETER;
>>> +   /* set the capability area with the specified data, on failure
>>> +      deactivate the TPM */
>>> +   switch (subCap) {
>>> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
>>> +index 288d1ce..9e1cfb4 100644
>>> +--- a/tpm/tpm_cmd_handler.c
>>> ++++ b/tpm/tpm_cmd_handler.c
>>> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
>>> +   tpm_extern_release();
>>> + }
>>> +
>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t=
 **out, uint32_t *out_size)
>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t=
 **out, uint32_t *out_size, int locality)
>>> + {
>>> +   TPM_REQUEST req;
>>> +   TPM_RESPONSE rsp;
>>> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint=
32_t in_size, uint8_t **out, uint3
>>> +   UINT32 len;
>>> +   BOOL free_out;
>>> +
>>> +-  debug("tpm_handle_command()");
>>> ++  debug("tpm_handle_command(%d)", locality);
>>> ++  if (locality !=3D -1)
>>> ++    tpmData.stany.flags.localityModifier =3D locality;
>>> +
>>> +   /* we need the whole packet at once, otherwise unmarshalling will=
 fail */
>>> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) !=3D=
 0) {
>>> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
>>> +index eed749e..4c228bd 100644
>>> +--- a/tpm/tpm_emulator.h
>>> ++++ b/tpm/tpm_emulator.h
>>> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
>>> +  * its usage. In case of an error, all internally allocated memory
>>> +  * is released and the the state of out and out_size is unspecified=
=2E
>>> +  */
>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t=
 **out, uint32_t *out_size);
>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t=
 **out, uint32_t *out_size, int locality);
>>> +
>>> + #endif /* _TPM_EMULATOR_H_ */
>>> +
>>> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c
>>> +index aabe6c3..440a01b 100644
>>> +--- a/tpm/tpm_emulator_extern.c
>>> ++++ b/tpm/tpm_emulator_extern.c
>>> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, siz=
e_t *data_length) =3D _tpm_read_fr
>>>     #else /* TPM_NO_EXTERN */
>>> -
>>> +
>>>     int (*tpm_extern_init)(void)                                     =
 =3D NULL;
>>>    -int (*tpm_extern_release)(void)                                  =
 =3D NULL;
>>>    +void (*tpm_extern_release)(void)                                 =
  =3D NULL;
>>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>>> index c33e078..dcfc3b9 100644
>>> --- a/stubdom/vtpm/vtpm.c
>>> +++ b/stubdom/vtpm/vtpm.c
>>> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>>>      static void main_loop(void) {
>>>       tpmcmd_t* tpmcmd =3D NULL;
>>> -   domid_t domid;        /* Domid of frontend */
>>> -   unsigned int handle;    /* handle of frontend */
>>>       int res =3D -1;
>>>         info("VTPM Initializing\n");
>>> @@ -162,15 +160,7 @@ static void main_loop(void) {
>>>          goto abort_postpcrs;
>>>       }
>>>    -   /* Wait for the frontend domain to connect */
>>> -   info("Waiting for frontend domain to connect..");
>>> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) =3D=3D 0) {=

>>> -      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, =
handle);
>>> -   } else {
>>> -      error("Unable to attach to a frontend");
>>> -   }
>>> -
>>> -   tpmcmd =3D tpmback_req(domid, handle);
>>> +   tpmcmd =3D tpmback_req_any();
>>>       while(tpmcmd) {
>>>          /* Handle the request */
>>>          if(tpmcmd->req_len) {
>>> @@ -183,7 +173,7 @@ static void main_loop(void) {
>>>             }
>>>             /* If not disabled, do the command */
>>>             else {
>>> -            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->req_=
len, &tpmcmd->resp, &tpmcmd->resp_len)) !=3D 0) {
>>> +            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->req_=
len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) !=3D 0) {
>>>                   error("tpm_handle_command() failed");
>>>                   create_error_response(tpmcmd, TPM_FAIL);
>>>                }
>>> @@ -194,7 +184,7 @@ static void main_loop(void) {
>>>          tpmback_resp(tpmcmd);
>>>            /* Wait for the next request */
>>> -      tpmcmd =3D tpmback_req(domid, handle);
>>> +      tpmcmd =3D tpmback_req_any();
>>>         }
>> Before the vtpm would shut down on its own when the host domain discon=
nects. This occurs because tpmback_req() returns NULL if the frontend dis=
connected. Using tpmback_req_any(), this is no longer the case which now =
means the user has to shut down the vtpm manually. How are you handling v=
tpm shutdown on your end?
> When a domain shuts down, "xl destroy" is called on its paired vTPM (by=
 some
> scripting that may need to be incorporated into libxl). A graceful shut=
down
> is not really needed at this point, although it might be needed in the =
short
> term if the save-state operation is not atomic - but a method of recove=
ring
> from this type of failure is needed for vTPMs anyway.
This is kind of a difficult problem. The save state operation is not by=20
any means atomic and it is very possible that the guest shuts down and=20
xl destroy is called before the save operation completes. This is=20
especially true if the guest is an embedded or even a mini-os domain=20
using tpmfront that shuts down very quickly. Its the reason why now the=20
vtpm shuts itself down after the guest disconnects.

What is really needed is a way to do an xl shutdown on mini-os domains=20
to let vtpm-stubdom shutdown correctly. From what I understand there is=20
not yet any support for this in mini-os. How tricky would it be to add=20
that? Samuel any ideas?

If thats not possible, another potential hack could be writing a key in=20
xenstore to trigger the shutdown or setting up some other kind of event=20
channel mechanism between the vtpm domain and libxl.



--------------ms040806030204010809090008
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1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AQkFMQ8XDTEyMTEyNzE5NDgyOVowIwYJKoZIhvcNAQkEMRYEFG+HwdmIbURGVgv2
9Ms5oN6VcZhXMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYCZE/SlDBq5qQFwzrYD2t6BKn0tnsUJ4yvA
EGklNZJqUnEnEJ/IpRJQARf1BHUchI++5sy9rRj0G9cBab+kqG9ejkQZnJ15NAAe6PiNO75L
LYTV4zEwdtLcqpzawAoj2bpV8hpaOfvwT7pzQRbX8yepksnIBASgXysbvVdj5NYAGgAAAAAA
AA==
--------------ms040806030204010809090008--


--===============4424959312589603556==
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.xen.org
http://lists.xen.org/xen-devel

--===============4424959312589603556==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 20:04:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 20:04:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdROT-0001sJ-JH; Tue, 27 Nov 2012 20:04:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdROS-0001sE-4u
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 20:04:32 +0000
Received: from [85.158.139.83:37133] by server-10.bemta-5.messagelabs.com id
	FF/58-09257-FCC15B05; Tue, 27 Nov 2012 20:04:31 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1354046670!27591679!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 750 invoked from network); 27 Nov 2012 20:04:30 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-6.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 20:04:30 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 1FF6384076;
	Tue, 27 Nov 2012 21:04:30 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id PFkM-CrUogof; Tue, 27 Nov 2012 21:04:29 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id E708C8407F;
	Tue, 27 Nov 2012 21:04:27 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdROM-0002cV-4m; Tue, 27 Nov 2012 21:04:26 +0100
Date: Tue, 27 Nov 2012 21:04:26 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121127200426.GG5646@type.youpi.perso.aquilenet.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B5042B.7000602@jhuapl.edu> <50B50E3E.6050807@tycho.nsa.gov>
	<50B5190D.20604@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B5190D.20604@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Tue 27 Nov 2012 14:48:29 -0500, a =E9crit :
> What is really needed is a way to do an xl shutdown on mini-os domains to
> let vtpm-stubdom shutdown correctly. From what I understand there is not =
yet
> any support for this in mini-os. How tricky would it be to add that? Samu=
el
> any ideas?

You mean add support to mini-os for clean shutdown?  That's quite
trivial, IIRC it's a matter of reacting to a xenstore write.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 20:04:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 20:04:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdROT-0001sJ-JH; Tue, 27 Nov 2012 20:04:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdROS-0001sE-4u
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 20:04:32 +0000
Received: from [85.158.139.83:37133] by server-10.bemta-5.messagelabs.com id
	FF/58-09257-FCC15B05; Tue, 27 Nov 2012 20:04:31 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1354046670!27591679!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 750 invoked from network); 27 Nov 2012 20:04:30 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-6.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 20:04:30 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 1FF6384076;
	Tue, 27 Nov 2012 21:04:30 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id PFkM-CrUogof; Tue, 27 Nov 2012 21:04:29 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id E708C8407F;
	Tue, 27 Nov 2012 21:04:27 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdROM-0002cV-4m; Tue, 27 Nov 2012 21:04:26 +0100
Date: Tue, 27 Nov 2012 21:04:26 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121127200426.GG5646@type.youpi.perso.aquilenet.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B5042B.7000602@jhuapl.edu> <50B50E3E.6050807@tycho.nsa.gov>
	<50B5190D.20604@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B5190D.20604@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Tue 27 Nov 2012 14:48:29 -0500, a =E9crit :
> What is really needed is a way to do an xl shutdown on mini-os domains to
> let vtpm-stubdom shutdown correctly. From what I understand there is not =
yet
> any support for this in mini-os. How tricky would it be to add that? Samu=
el
> any ideas?

You mean add support to mini-os for clean shutdown?  That's quite
trivial, IIRC it's a matter of reacting to a xenstore write.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 20:12:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 20:12:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdRVb-00022p-Gu; Tue, 27 Nov 2012 20:11:55 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdRVa-00022j-9H
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 20:11:54 +0000
Received: from [193.109.254.147:35481] by server-11.bemta-14.messagelabs.com
	id DD/47-29027-98E15B05; Tue, 27 Nov 2012 20:11:53 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-13.tower-27.messagelabs.com!1354047111!8514730!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16668 invoked from network); 27 Nov 2012 20:11:52 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-13.tower-27.messagelabs.com with SMTP;
	27 Nov 2012 20:11:52 -0000
X-TM-IMSS-Message-ID: <c228de6d00034990@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id c228de6d00034990 ;
	Tue, 27 Nov 2012 15:10:49 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARKBbCT027659; 
	Tue, 27 Nov 2012 15:11:37 -0500
Message-ID: <50B51E79.2090308@tycho.nsa.gov>
Date: Tue, 27 Nov 2012 15:11:37 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B5042B.7000602@jhuapl.edu> <50B50E3E.6050807@tycho.nsa.gov>
	<50B5190D.20604@jhuapl.edu>
In-Reply-To: <50B5190D.20604@jhuapl.edu>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/27/2012 02:48 PM, Matthew Fioravante wrote:
> On 11/27/2012 02:02 PM, Daniel De Graaf wrote:
>> On 11/27/2012 01:19 PM, Matthew Fioravante wrote:
>>> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>>>> The vTPM protocol now contains a field allowing the locality of a
>>>> command to be specified; pass this to the TPM when processing a packet.
>>>> This also enables a single vTPM to provide multiple tpmback interfaces
>>>> so that several closely related domains can share a vTPM (for example, a
>>>> qemu device stubdom and its target domain).
>>>>
>>>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>>> ---
>>>>    stubdom/tpmemu-0.7.4.patch | 61 ++++++++++++++++++++++++++++++++++++++++++----
>>>>    stubdom/vtpm/vtpm.c        | 16 +++---------
>>>>    2 files changed, 59 insertions(+), 18 deletions(-)
>>>>
>>>> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
>>>> index b84eff1..31ace1a 100644
>>>> --- a/stubdom/tpmemu-0.7.4.patch
>>>> +++ b/stubdom/tpmemu-0.7.4.patch
>>>> @@ -1,9 +1,60 @@
>>>> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
>>>> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c    2012-04-27 10:55:46.581963398 -0400
>>>> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c    2012-04-27 10:56:02.193034152 -0400
>>>> -@@ -249,7 +249,7 @@
>>>> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
>>>> +index 60bbb90..f8f7f0f 100644
>>>> +--- a/tpm/tpm_capability.c
>>>> ++++ b/tpm/tpm_capability.c
>>>> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *setValue,
>>>> +                              UINT32 setValueSize, BOOL ownerAuth,
>>>> +                              BOOL deactivated, BOOL disabled)
>>>> + {
>>>> ++  if (tpmData.stany.flags.localityModifier != 8)
>>>> ++    return TPM_BAD_PARAMETER;
>>>> +   /* set the capability area with the specified data, on failure
>>>> +      deactivate the TPM */
>>>> +   switch (subCap) {
>>>> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
>>>> +index 288d1ce..9e1cfb4 100644
>>>> +--- a/tpm/tpm_cmd_handler.c
>>>> ++++ b/tpm/tpm_cmd_handler.c
>>>> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
>>>> +   tpm_extern_release();
>>>> + }
>>>> +
>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size)
>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality)
>>>> + {
>>>> +   TPM_REQUEST req;
>>>> +   TPM_RESPONSE rsp;
>>>> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint3
>>>> +   UINT32 len;
>>>> +   BOOL free_out;
>>>> +
>>>> +-  debug("tpm_handle_command()");
>>>> ++  debug("tpm_handle_command(%d)", locality);
>>>> ++  if (locality != -1)
>>>> ++    tpmData.stany.flags.localityModifier = locality;
>>>> +
>>>> +   /* we need the whole packet at once, otherwise unmarshalling will fail */
>>>> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) != 0) {
>>>> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
>>>> +index eed749e..4c228bd 100644
>>>> +--- a/tpm/tpm_emulator.h
>>>> ++++ b/tpm/tpm_emulator.h
>>>> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
>>>> +  * its usage. In case of an error, all internally allocated memory
>>>> +  * is released and the the state of out and out_size is unspecified.
>>>> +  */
>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size);
>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality);
>>>> +
>>>> + #endif /* _TPM_EMULATOR_H_ */
>>>> +
>>>> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c
>>>> +index aabe6c3..440a01b 100644
>>>> +--- a/tpm/tpm_emulator_extern.c
>>>> ++++ b/tpm/tpm_emulator_extern.c
>>>> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length) = _tpm_read_fr
>>>>     #else /* TPM_NO_EXTERN */
>>>> -
>>>> +
>>>>     int (*tpm_extern_init)(void)                                      = NULL;
>>>>    -int (*tpm_extern_release)(void)                                   = NULL;
>>>>    +void (*tpm_extern_release)(void)                                   = NULL;
>>>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>>>> index c33e078..dcfc3b9 100644
>>>> --- a/stubdom/vtpm/vtpm.c
>>>> +++ b/stubdom/vtpm/vtpm.c
>>>> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>>>>      static void main_loop(void) {
>>>>       tpmcmd_t* tpmcmd = NULL;
>>>> -   domid_t domid;        /* Domid of frontend */
>>>> -   unsigned int handle;    /* handle of frontend */
>>>>       int res = -1;
>>>>         info("VTPM Initializing\n");
>>>> @@ -162,15 +160,7 @@ static void main_loop(void) {
>>>>          goto abort_postpcrs;
>>>>       }
>>>>    -   /* Wait for the frontend domain to connect */
>>>> -   info("Waiting for frontend domain to connect..");
>>>> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
>>>> -      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
>>>> -   } else {
>>>> -      error("Unable to attach to a frontend");
>>>> -   }
>>>> -
>>>> -   tpmcmd = tpmback_req(domid, handle);
>>>> +   tpmcmd = tpmback_req_any();
>>>>       while(tpmcmd) {
>>>>          /* Handle the request */
>>>>          if(tpmcmd->req_len) {
>>>> @@ -183,7 +173,7 @@ static void main_loop(void) {
>>>>             }
>>>>             /* If not disabled, do the command */
>>>>             else {
>>>> -            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
>>>> +            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) != 0) {
>>>>                   error("tpm_handle_command() failed");
>>>>                   create_error_response(tpmcmd, TPM_FAIL);
>>>>                }
>>>> @@ -194,7 +184,7 @@ static void main_loop(void) {
>>>>          tpmback_resp(tpmcmd);
>>>>            /* Wait for the next request */
>>>> -      tpmcmd = tpmback_req(domid, handle);
>>>> +      tpmcmd = tpmback_req_any();
>>>>         }
>>> Before the vtpm would shut down on its own when the host domain disconnects. This occurs because tpmback_req() returns NULL if the frontend disconnected. Using tpmback_req_any(), this is no longer the case which now means the user has to shut down the vtpm manually. How are you handling vtpm shutdown on your end?
>> When a domain shuts down, "xl destroy" is called on its paired vTPM (by some
>> scripting that may need to be incorporated into libxl). A graceful shutdown
>> is not really needed at this point, although it might be needed in the short
>> term if the save-state operation is not atomic - but a method of recovering
>> from this type of failure is needed for vTPMs anyway.
> This is kind of a difficult problem. The save state operation is not by any means atomic and it is very possible that the guest shuts down and xl destroy is called before the save operation completes. This is especially true if the guest is an embedded or even a mini-os domain using tpmfront that shuts down very quickly. Its the reason why now the vtpm shuts itself down after the guest disconnects.
> 
> What is really needed is a way to do an xl shutdown on mini-os domains to let vtpm-stubdom shutdown correctly. From what I understand there is not yet any support for this in mini-os. How tricky would it be to add that? Samuel any ideas?
> 
> If thats not possible, another potential hack could be writing a key in xenstore to trigger the shutdown or setting up some other kind of event channel mechanism between the vtpm domain and libxl.
> 

I have approached this problem from the opposite direction, while looking at
adding protection from vTPM state rollback. The method that I am currently
considering is to have two "slots" in the vTPM disk image - one active and
and one inactive. The save process would then consist of writing a new save
state to the inactive slot, ensuring it has been committed to disk, and then
requesting the TPM Manager atomically update the state encryption key to the
new value. When loading, the key obtained from the TPM manager will only be
able to decrypt one of the two state images; the successful one is the active
image. Since the vTPM's saved state is not expected to be very large, this 
doesn't waste a significant amount of disk space.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 20:12:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 20:12:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdRVb-00022p-Gu; Tue, 27 Nov 2012 20:11:55 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdRVa-00022j-9H
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 20:11:54 +0000
Received: from [193.109.254.147:35481] by server-11.bemta-14.messagelabs.com
	id DD/47-29027-98E15B05; Tue, 27 Nov 2012 20:11:53 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-13.tower-27.messagelabs.com!1354047111!8514730!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16668 invoked from network); 27 Nov 2012 20:11:52 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-13.tower-27.messagelabs.com with SMTP;
	27 Nov 2012 20:11:52 -0000
X-TM-IMSS-Message-ID: <c228de6d00034990@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id c228de6d00034990 ;
	Tue, 27 Nov 2012 15:10:49 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARKBbCT027659; 
	Tue, 27 Nov 2012 15:11:37 -0500
Message-ID: <50B51E79.2090308@tycho.nsa.gov>
Date: Tue, 27 Nov 2012 15:11:37 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B5042B.7000602@jhuapl.edu> <50B50E3E.6050807@tycho.nsa.gov>
	<50B5190D.20604@jhuapl.edu>
In-Reply-To: <50B5190D.20604@jhuapl.edu>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/27/2012 02:48 PM, Matthew Fioravante wrote:
> On 11/27/2012 02:02 PM, Daniel De Graaf wrote:
>> On 11/27/2012 01:19 PM, Matthew Fioravante wrote:
>>> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>>>> The vTPM protocol now contains a field allowing the locality of a
>>>> command to be specified; pass this to the TPM when processing a packet.
>>>> This also enables a single vTPM to provide multiple tpmback interfaces
>>>> so that several closely related domains can share a vTPM (for example, a
>>>> qemu device stubdom and its target domain).
>>>>
>>>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>>> ---
>>>>    stubdom/tpmemu-0.7.4.patch | 61 ++++++++++++++++++++++++++++++++++++++++++----
>>>>    stubdom/vtpm/vtpm.c        | 16 +++---------
>>>>    2 files changed, 59 insertions(+), 18 deletions(-)
>>>>
>>>> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
>>>> index b84eff1..31ace1a 100644
>>>> --- a/stubdom/tpmemu-0.7.4.patch
>>>> +++ b/stubdom/tpmemu-0.7.4.patch
>>>> @@ -1,9 +1,60 @@
>>>> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
>>>> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c    2012-04-27 10:55:46.581963398 -0400
>>>> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c    2012-04-27 10:56:02.193034152 -0400
>>>> -@@ -249,7 +249,7 @@
>>>> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
>>>> +index 60bbb90..f8f7f0f 100644
>>>> +--- a/tpm/tpm_capability.c
>>>> ++++ b/tpm/tpm_capability.c
>>>> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *setValue,
>>>> +                              UINT32 setValueSize, BOOL ownerAuth,
>>>> +                              BOOL deactivated, BOOL disabled)
>>>> + {
>>>> ++  if (tpmData.stany.flags.localityModifier != 8)
>>>> ++    return TPM_BAD_PARAMETER;
>>>> +   /* set the capability area with the specified data, on failure
>>>> +      deactivate the TPM */
>>>> +   switch (subCap) {
>>>> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
>>>> +index 288d1ce..9e1cfb4 100644
>>>> +--- a/tpm/tpm_cmd_handler.c
>>>> ++++ b/tpm/tpm_cmd_handler.c
>>>> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
>>>> +   tpm_extern_release();
>>>> + }
>>>> +
>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size)
>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality)
>>>> + {
>>>> +   TPM_REQUEST req;
>>>> +   TPM_RESPONSE rsp;
>>>> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint3
>>>> +   UINT32 len;
>>>> +   BOOL free_out;
>>>> +
>>>> +-  debug("tpm_handle_command()");
>>>> ++  debug("tpm_handle_command(%d)", locality);
>>>> ++  if (locality != -1)
>>>> ++    tpmData.stany.flags.localityModifier = locality;
>>>> +
>>>> +   /* we need the whole packet at once, otherwise unmarshalling will fail */
>>>> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) != 0) {
>>>> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
>>>> +index eed749e..4c228bd 100644
>>>> +--- a/tpm/tpm_emulator.h
>>>> ++++ b/tpm/tpm_emulator.h
>>>> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
>>>> +  * its usage. In case of an error, all internally allocated memory
>>>> +  * is released and the the state of out and out_size is unspecified.
>>>> +  */
>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size);
>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality);
>>>> +
>>>> + #endif /* _TPM_EMULATOR_H_ */
>>>> +
>>>> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c
>>>> +index aabe6c3..440a01b 100644
>>>> +--- a/tpm/tpm_emulator_extern.c
>>>> ++++ b/tpm/tpm_emulator_extern.c
>>>> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length) = _tpm_read_fr
>>>>     #else /* TPM_NO_EXTERN */
>>>> -
>>>> +
>>>>     int (*tpm_extern_init)(void)                                      = NULL;
>>>>    -int (*tpm_extern_release)(void)                                   = NULL;
>>>>    +void (*tpm_extern_release)(void)                                   = NULL;
>>>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>>>> index c33e078..dcfc3b9 100644
>>>> --- a/stubdom/vtpm/vtpm.c
>>>> +++ b/stubdom/vtpm/vtpm.c
>>>> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>>>>      static void main_loop(void) {
>>>>       tpmcmd_t* tpmcmd = NULL;
>>>> -   domid_t domid;        /* Domid of frontend */
>>>> -   unsigned int handle;    /* handle of frontend */
>>>>       int res = -1;
>>>>         info("VTPM Initializing\n");
>>>> @@ -162,15 +160,7 @@ static void main_loop(void) {
>>>>          goto abort_postpcrs;
>>>>       }
>>>>    -   /* Wait for the frontend domain to connect */
>>>> -   info("Waiting for frontend domain to connect..");
>>>> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
>>>> -      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
>>>> -   } else {
>>>> -      error("Unable to attach to a frontend");
>>>> -   }
>>>> -
>>>> -   tpmcmd = tpmback_req(domid, handle);
>>>> +   tpmcmd = tpmback_req_any();
>>>>       while(tpmcmd) {
>>>>          /* Handle the request */
>>>>          if(tpmcmd->req_len) {
>>>> @@ -183,7 +173,7 @@ static void main_loop(void) {
>>>>             }
>>>>             /* If not disabled, do the command */
>>>>             else {
>>>> -            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
>>>> +            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) != 0) {
>>>>                   error("tpm_handle_command() failed");
>>>>                   create_error_response(tpmcmd, TPM_FAIL);
>>>>                }
>>>> @@ -194,7 +184,7 @@ static void main_loop(void) {
>>>>          tpmback_resp(tpmcmd);
>>>>            /* Wait for the next request */
>>>> -      tpmcmd = tpmback_req(domid, handle);
>>>> +      tpmcmd = tpmback_req_any();
>>>>         }
>>> Before the vtpm would shut down on its own when the host domain disconnects. This occurs because tpmback_req() returns NULL if the frontend disconnected. Using tpmback_req_any(), this is no longer the case which now means the user has to shut down the vtpm manually. How are you handling vtpm shutdown on your end?
>> When a domain shuts down, "xl destroy" is called on its paired vTPM (by some
>> scripting that may need to be incorporated into libxl). A graceful shutdown
>> is not really needed at this point, although it might be needed in the short
>> term if the save-state operation is not atomic - but a method of recovering
>> from this type of failure is needed for vTPMs anyway.
> This is kind of a difficult problem. The save state operation is not by any means atomic and it is very possible that the guest shuts down and xl destroy is called before the save operation completes. This is especially true if the guest is an embedded or even a mini-os domain using tpmfront that shuts down very quickly. Its the reason why now the vtpm shuts itself down after the guest disconnects.
> 
> What is really needed is a way to do an xl shutdown on mini-os domains to let vtpm-stubdom shutdown correctly. From what I understand there is not yet any support for this in mini-os. How tricky would it be to add that? Samuel any ideas?
> 
> If thats not possible, another potential hack could be writing a key in xenstore to trigger the shutdown or setting up some other kind of event channel mechanism between the vtpm domain and libxl.
> 

I have approached this problem from the opposite direction, while looking at
adding protection from vTPM state rollback. The method that I am currently
considering is to have two "slots" in the vTPM disk image - one active and
and one inactive. The save process would then consist of writing a new save
state to the inactive slot, ensuring it has been committed to disk, and then
requesting the TPM Manager atomically update the state encryption key to the
new value. When loading, the key obtained from the TPM manager will only be
able to decrypt one of the two state images; the successful one is the active
image. Since the vTPM's saved state is not expected to be very large, this 
doesn't waste a significant amount of disk space.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 20:22:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 20:22:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdRfZ-0002F1-Nx; Tue, 27 Nov 2012 20:22:13 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TdRfX-0002Ew-Lk
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 20:22:11 +0000
Received: from [193.109.254.147:37404] by server-15.bemta-14.messagelabs.com
	id 03/59-12105-2F025B05; Tue, 27 Nov 2012 20:22:10 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-10.tower-27.messagelabs.com!1354047724!3395259!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19567 invoked from network); 27 Nov 2012 20:22:05 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-10.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 20:22:05 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158209282;
	Tue, 27 Nov 2012 15:21:47 -0500
Message-ID: <50B520D6.2090602@jhuapl.edu>
Date: Tue, 27 Nov 2012 15:21:42 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B5042B.7000602@jhuapl.edu> <50B50E3E.6050807@tycho.nsa.gov>
	<50B5190D.20604@jhuapl.edu> <50B51E79.2090308@tycho.nsa.gov>
In-Reply-To: <50B51E79.2090308@tycho.nsa.gov>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8361670052656458462=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============8361670052656458462==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms050802060706080007020706"

This is a cryptographically signed message in MIME format.

--------------ms050802060706080007020706
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/27/2012 03:11 PM, Daniel De Graaf wrote:
> On 11/27/2012 02:48 PM, Matthew Fioravante wrote:
>> On 11/27/2012 02:02 PM, Daniel De Graaf wrote:
>>> On 11/27/2012 01:19 PM, Matthew Fioravante wrote:
>>>> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>>>>> The vTPM protocol now contains a field allowing the locality of a
>>>>> command to be specified; pass this to the TPM when processing a pac=
ket.
>>>>> This also enables a single vTPM to provide multiple tpmback interfa=
ces
>>>>> so that several closely related domains can share a vTPM (for examp=
le, a
>>>>> qemu device stubdom and its target domain).
>>>>>
>>>>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>>>> ---
>>>>>     stubdom/tpmemu-0.7.4.patch | 61 +++++++++++++++++++++++++++++++=
+++++++++++----
>>>>>     stubdom/vtpm/vtpm.c        | 16 +++---------
>>>>>     2 files changed, 59 insertions(+), 18 deletions(-)
>>>>>
>>>>> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patc=
h
>>>>> index b84eff1..31ace1a 100644
>>>>> --- a/stubdom/tpmemu-0.7.4.patch
>>>>> +++ b/stubdom/tpmemu-0.7.4.patch
>>>>> @@ -1,9 +1,60 @@
>>>>> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_=
emulator-x86_64/tpm/tpm_emulator_extern.c
>>>>> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c    2012-04-=
27 10:55:46.581963398 -0400
>>>>> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c    2012-04-27 10=
:56:02.193034152 -0400
>>>>> -@@ -249,7 +249,7 @@
>>>>> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
>>>>> +index 60bbb90..f8f7f0f 100644
>>>>> +--- a/tpm/tpm_capability.c
>>>>> ++++ b/tpm/tpm_capability.c
>>>>> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BY=
TE *setValue,
>>>>> +                              UINT32 setValueSize, BOOL ownerAuth,=

>>>>> +                              BOOL deactivated, BOOL disabled)
>>>>> + {
>>>>> ++  if (tpmData.stany.flags.localityModifier !=3D 8)
>>>>> ++    return TPM_BAD_PARAMETER;
>>>>> +   /* set the capability area with the specified data, on failure
>>>>> +      deactivate the TPM */
>>>>> +   switch (subCap) {
>>>>> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
>>>>> +index 288d1ce..9e1cfb4 100644
>>>>> +--- a/tpm/tpm_cmd_handler.c
>>>>> ++++ b/tpm/tpm_cmd_handler.c
>>>>> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
>>>>> +   tpm_extern_release();
>>>>> + }
>>>>> +
>>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8=
_t **out, uint32_t *out_size)
>>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8=
_t **out, uint32_t *out_size, int locality)
>>>>> + {
>>>>> +   TPM_REQUEST req;
>>>>> +   TPM_RESPONSE rsp;
>>>>> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, ui=
nt32_t in_size, uint8_t **out, uint3
>>>>> +   UINT32 len;
>>>>> +   BOOL free_out;
>>>>> +
>>>>> +-  debug("tpm_handle_command()");
>>>>> ++  debug("tpm_handle_command(%d)", locality);
>>>>> ++  if (locality !=3D -1)
>>>>> ++    tpmData.stany.flags.localityModifier =3D locality;
>>>>> +
>>>>> +   /* we need the whole packet at once, otherwise unmarshalling wi=
ll fail */
>>>>> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) !=
=3D 0) {
>>>>> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
>>>>> +index eed749e..4c228bd 100644
>>>>> +--- a/tpm/tpm_emulator.h
>>>>> ++++ b/tpm/tpm_emulator.h
>>>>> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
>>>>> +  * its usage. In case of an error, all internally allocated memor=
y
>>>>> +  * is released and the the state of out and out_size is unspecifi=
ed.
>>>>> +  */
>>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8=
_t **out, uint32_t *out_size);
>>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8=
_t **out, uint32_t *out_size, int locality);
>>>>> +
>>>>> + #endif /* _TPM_EMULATOR_H_ */
>>>>> +
>>>>> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c=

>>>>> +index aabe6c3..440a01b 100644
>>>>> +--- a/tpm/tpm_emulator_extern.c
>>>>> ++++ b/tpm/tpm_emulator_extern.c
>>>>> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, s=
ize_t *data_length) =3D _tpm_read_fr
>>>>>      #else /* TPM_NO_EXTERN */
>>>>> -
>>>>> +
>>>>>      int (*tpm_extern_init)(void)                                  =
    =3D NULL;
>>>>>     -int (*tpm_extern_release)(void)                               =
    =3D NULL;
>>>>>     +void (*tpm_extern_release)(void)                              =
     =3D NULL;
>>>>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>>>>> index c33e078..dcfc3b9 100644
>>>>> --- a/stubdom/vtpm/vtpm.c
>>>>> +++ b/stubdom/vtpm/vtpm.c
>>>>> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>>>>>       static void main_loop(void) {
>>>>>        tpmcmd_t* tpmcmd =3D NULL;
>>>>> -   domid_t domid;        /* Domid of frontend */
>>>>> -   unsigned int handle;    /* handle of frontend */
>>>>>        int res =3D -1;
>>>>>          info("VTPM Initializing\n");
>>>>> @@ -162,15 +160,7 @@ static void main_loop(void) {
>>>>>           goto abort_postpcrs;
>>>>>        }
>>>>>     -   /* Wait for the frontend domain to connect */
>>>>> -   info("Waiting for frontend domain to connect..");
>>>>> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) =3D=3D 0)=
 {
>>>>> -      info("VTPM attached to Frontend %u/%u", (unsigned int) domid=
, handle);
>>>>> -   } else {
>>>>> -      error("Unable to attach to a frontend");
>>>>> -   }
>>>>> -
>>>>> -   tpmcmd =3D tpmback_req(domid, handle);
>>>>> +   tpmcmd =3D tpmback_req_any();
>>>>>        while(tpmcmd) {
>>>>>           /* Handle the request */
>>>>>           if(tpmcmd->req_len) {
>>>>> @@ -183,7 +173,7 @@ static void main_loop(void) {
>>>>>              }
>>>>>              /* If not disabled, do the command */
>>>>>              else {
>>>>> -            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->re=
q_len, &tpmcmd->resp, &tpmcmd->resp_len)) !=3D 0) {
>>>>> +            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->re=
q_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) !=3D 0) {
>>>>>                    error("tpm_handle_command() failed");
>>>>>                    create_error_response(tpmcmd, TPM_FAIL);
>>>>>                 }
>>>>> @@ -194,7 +184,7 @@ static void main_loop(void) {
>>>>>           tpmback_resp(tpmcmd);
>>>>>             /* Wait for the next request */
>>>>> -      tpmcmd =3D tpmback_req(domid, handle);
>>>>> +      tpmcmd =3D tpmback_req_any();
>>>>>          }
>>>> Before the vtpm would shut down on its own when the host domain disc=
onnects. This occurs because tpmback_req() returns NULL if the frontend d=
isconnected. Using tpmback_req_any(), this is no longer the case which no=
w means the user has to shut down the vtpm manually. How are you handling=
 vtpm shutdown on your end?
>>> When a domain shuts down, "xl destroy" is called on its paired vTPM (=
by some
>>> scripting that may need to be incorporated into libxl). A graceful sh=
utdown
>>> is not really needed at this point, although it might be needed in th=
e short
>>> term if the save-state operation is not atomic - but a method of reco=
vering
>>> from this type of failure is needed for vTPMs anyway.
>> This is kind of a difficult problem. The save state operation is not b=
y any means atomic and it is very possible that the guest shuts down and =
xl destroy is called before the save operation completes. This is especia=
lly true if the guest is an embedded or even a mini-os domain using tpmfr=
ont that shuts down very quickly. Its the reason why now the vtpm shuts i=
tself down after the guest disconnects.
>>
>> What is really needed is a way to do an xl shutdown on mini-os domains=
 to let vtpm-stubdom shutdown correctly. From what I understand there is =
not yet any support for this in mini-os. How tricky would it be to add th=
at? Samuel any ideas?
>>
>> If thats not possible, another potential hack could be writing a key i=
n xenstore to trigger the shutdown or setting up some other kind of event=
 channel mechanism between the vtpm domain and libxl.
>>
> I have approached this problem from the opposite direction, while looki=
ng at
> adding protection from vTPM state rollback. The method that I am curren=
tly
> considering is to have two "slots" in the vTPM disk image - one active =
and
> and one inactive. The save process would then consist of writing a new =
save
> state to the inactive slot, ensuring it has been committed to disk, and=
 then
> requesting the TPM Manager atomically update the state encryption key t=
o the
> new value. When loading, the key obtained from the TPM manager will onl=
y be
> able to decrypt one of the two state images; the successful one is the =
active
> image. Since the vTPM's saved state is not expected to be very large, t=
his
> doesn't waste a significant amount of disk space.
>
I like that idea in general, but it still doesn't solve the shutdown=20
race condition. You might not get a corrupted disk but you can still get =

inadvertently rolled back. Adding a xenstore watch as samuel suggested=20
and doing a clean shutdown would be ideal.



--------------ms050802060706080007020706
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s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EAxMFQ1JMNTYwHwYDVR0jBBgwFoAUCDUpmxH52EU2CyWmF2EJMB1yqeswHQYD
VR0OBBYEFO6LYxg6r9wHZ+zdQtBHn1dZ/YTNMAkGA1UdEwQCMAAwGQYJKoZIhvZ9B0EABAww
ChsEVjcuMQMCBLAwDQYJKoZIhvcNAQEFBQADgYEAJO9HQh4YNChVLzuZqK5ARJARD8JoujGZ
fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEyNzIwMjE0MlowIwYJKoZIhvcNAQkEMRYEFJP8IWA4KTWNLFGj
Ef9IEKATswVrMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAv/W0XNxNx4/F08YA0ABoXjF3NwjoCWt0y
SsxndnGdCulhiFVnj8AVqNAg2RvvjDtcjc3Plk7fDukih6fpOjZE6aa8NbcEYb8N5nP1Zqux
Xebd7GQpk55dCIE7FuHU8oHV0jyxz4pWNkye2B8PY6Oq/23lNznKUXPcX3kkVgB/1wAAAAAA
AA==
--------------ms050802060706080007020706--


--===============8361670052656458462==
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.xen.org
http://lists.xen.org/xen-devel

--===============8361670052656458462==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 20:22:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 20:22:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdRfZ-0002F1-Nx; Tue, 27 Nov 2012 20:22:13 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TdRfX-0002Ew-Lk
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 20:22:11 +0000
Received: from [193.109.254.147:37404] by server-15.bemta-14.messagelabs.com
	id 03/59-12105-2F025B05; Tue, 27 Nov 2012 20:22:10 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-10.tower-27.messagelabs.com!1354047724!3395259!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19567 invoked from network); 27 Nov 2012 20:22:05 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-10.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 20:22:05 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158209282;
	Tue, 27 Nov 2012 15:21:47 -0500
Message-ID: <50B520D6.2090602@jhuapl.edu>
Date: Tue, 27 Nov 2012 15:21:42 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B5042B.7000602@jhuapl.edu> <50B50E3E.6050807@tycho.nsa.gov>
	<50B5190D.20604@jhuapl.edu> <50B51E79.2090308@tycho.nsa.gov>
In-Reply-To: <50B51E79.2090308@tycho.nsa.gov>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8361670052656458462=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============8361670052656458462==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms050802060706080007020706"

This is a cryptographically signed message in MIME format.

--------------ms050802060706080007020706
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/27/2012 03:11 PM, Daniel De Graaf wrote:
> On 11/27/2012 02:48 PM, Matthew Fioravante wrote:
>> On 11/27/2012 02:02 PM, Daniel De Graaf wrote:
>>> On 11/27/2012 01:19 PM, Matthew Fioravante wrote:
>>>> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>>>>> The vTPM protocol now contains a field allowing the locality of a
>>>>> command to be specified; pass this to the TPM when processing a pac=
ket.
>>>>> This also enables a single vTPM to provide multiple tpmback interfa=
ces
>>>>> so that several closely related domains can share a vTPM (for examp=
le, a
>>>>> qemu device stubdom and its target domain).
>>>>>
>>>>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>>>> ---
>>>>>     stubdom/tpmemu-0.7.4.patch | 61 +++++++++++++++++++++++++++++++=
+++++++++++----
>>>>>     stubdom/vtpm/vtpm.c        | 16 +++---------
>>>>>     2 files changed, 59 insertions(+), 18 deletions(-)
>>>>>
>>>>> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patc=
h
>>>>> index b84eff1..31ace1a 100644
>>>>> --- a/stubdom/tpmemu-0.7.4.patch
>>>>> +++ b/stubdom/tpmemu-0.7.4.patch
>>>>> @@ -1,9 +1,60 @@
>>>>> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_=
emulator-x86_64/tpm/tpm_emulator_extern.c
>>>>> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c    2012-04-=
27 10:55:46.581963398 -0400
>>>>> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c    2012-04-27 10=
:56:02.193034152 -0400
>>>>> -@@ -249,7 +249,7 @@
>>>>> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
>>>>> +index 60bbb90..f8f7f0f 100644
>>>>> +--- a/tpm/tpm_capability.c
>>>>> ++++ b/tpm/tpm_capability.c
>>>>> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BY=
TE *setValue,
>>>>> +                              UINT32 setValueSize, BOOL ownerAuth,=

>>>>> +                              BOOL deactivated, BOOL disabled)
>>>>> + {
>>>>> ++  if (tpmData.stany.flags.localityModifier !=3D 8)
>>>>> ++    return TPM_BAD_PARAMETER;
>>>>> +   /* set the capability area with the specified data, on failure
>>>>> +      deactivate the TPM */
>>>>> +   switch (subCap) {
>>>>> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
>>>>> +index 288d1ce..9e1cfb4 100644
>>>>> +--- a/tpm/tpm_cmd_handler.c
>>>>> ++++ b/tpm/tpm_cmd_handler.c
>>>>> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
>>>>> +   tpm_extern_release();
>>>>> + }
>>>>> +
>>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8=
_t **out, uint32_t *out_size)
>>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8=
_t **out, uint32_t *out_size, int locality)
>>>>> + {
>>>>> +   TPM_REQUEST req;
>>>>> +   TPM_RESPONSE rsp;
>>>>> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, ui=
nt32_t in_size, uint8_t **out, uint3
>>>>> +   UINT32 len;
>>>>> +   BOOL free_out;
>>>>> +
>>>>> +-  debug("tpm_handle_command()");
>>>>> ++  debug("tpm_handle_command(%d)", locality);
>>>>> ++  if (locality !=3D -1)
>>>>> ++    tpmData.stany.flags.localityModifier =3D locality;
>>>>> +
>>>>> +   /* we need the whole packet at once, otherwise unmarshalling wi=
ll fail */
>>>>> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) !=
=3D 0) {
>>>>> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
>>>>> +index eed749e..4c228bd 100644
>>>>> +--- a/tpm/tpm_emulator.h
>>>>> ++++ b/tpm/tpm_emulator.h
>>>>> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
>>>>> +  * its usage. In case of an error, all internally allocated memor=
y
>>>>> +  * is released and the the state of out and out_size is unspecifi=
ed.
>>>>> +  */
>>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8=
_t **out, uint32_t *out_size);
>>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8=
_t **out, uint32_t *out_size, int locality);
>>>>> +
>>>>> + #endif /* _TPM_EMULATOR_H_ */
>>>>> +
>>>>> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c=

>>>>> +index aabe6c3..440a01b 100644
>>>>> +--- a/tpm/tpm_emulator_extern.c
>>>>> ++++ b/tpm/tpm_emulator_extern.c
>>>>> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, s=
ize_t *data_length) =3D _tpm_read_fr
>>>>>      #else /* TPM_NO_EXTERN */
>>>>> -
>>>>> +
>>>>>      int (*tpm_extern_init)(void)                                  =
    =3D NULL;
>>>>>     -int (*tpm_extern_release)(void)                               =
    =3D NULL;
>>>>>     +void (*tpm_extern_release)(void)                              =
     =3D NULL;
>>>>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>>>>> index c33e078..dcfc3b9 100644
>>>>> --- a/stubdom/vtpm/vtpm.c
>>>>> +++ b/stubdom/vtpm/vtpm.c
>>>>> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>>>>>       static void main_loop(void) {
>>>>>        tpmcmd_t* tpmcmd =3D NULL;
>>>>> -   domid_t domid;        /* Domid of frontend */
>>>>> -   unsigned int handle;    /* handle of frontend */
>>>>>        int res =3D -1;
>>>>>          info("VTPM Initializing\n");
>>>>> @@ -162,15 +160,7 @@ static void main_loop(void) {
>>>>>           goto abort_postpcrs;
>>>>>        }
>>>>>     -   /* Wait for the frontend domain to connect */
>>>>> -   info("Waiting for frontend domain to connect..");
>>>>> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) =3D=3D 0)=
 {
>>>>> -      info("VTPM attached to Frontend %u/%u", (unsigned int) domid=
, handle);
>>>>> -   } else {
>>>>> -      error("Unable to attach to a frontend");
>>>>> -   }
>>>>> -
>>>>> -   tpmcmd =3D tpmback_req(domid, handle);
>>>>> +   tpmcmd =3D tpmback_req_any();
>>>>>        while(tpmcmd) {
>>>>>           /* Handle the request */
>>>>>           if(tpmcmd->req_len) {
>>>>> @@ -183,7 +173,7 @@ static void main_loop(void) {
>>>>>              }
>>>>>              /* If not disabled, do the command */
>>>>>              else {
>>>>> -            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->re=
q_len, &tpmcmd->resp, &tpmcmd->resp_len)) !=3D 0) {
>>>>> +            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->re=
q_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) !=3D 0) {
>>>>>                    error("tpm_handle_command() failed");
>>>>>                    create_error_response(tpmcmd, TPM_FAIL);
>>>>>                 }
>>>>> @@ -194,7 +184,7 @@ static void main_loop(void) {
>>>>>           tpmback_resp(tpmcmd);
>>>>>             /* Wait for the next request */
>>>>> -      tpmcmd =3D tpmback_req(domid, handle);
>>>>> +      tpmcmd =3D tpmback_req_any();
>>>>>          }
>>>> Before the vtpm would shut down on its own when the host domain disc=
onnects. This occurs because tpmback_req() returns NULL if the frontend d=
isconnected. Using tpmback_req_any(), this is no longer the case which no=
w means the user has to shut down the vtpm manually. How are you handling=
 vtpm shutdown on your end?
>>> When a domain shuts down, "xl destroy" is called on its paired vTPM (=
by some
>>> scripting that may need to be incorporated into libxl). A graceful sh=
utdown
>>> is not really needed at this point, although it might be needed in th=
e short
>>> term if the save-state operation is not atomic - but a method of reco=
vering
>>> from this type of failure is needed for vTPMs anyway.
>> This is kind of a difficult problem. The save state operation is not b=
y any means atomic and it is very possible that the guest shuts down and =
xl destroy is called before the save operation completes. This is especia=
lly true if the guest is an embedded or even a mini-os domain using tpmfr=
ont that shuts down very quickly. Its the reason why now the vtpm shuts i=
tself down after the guest disconnects.
>>
>> What is really needed is a way to do an xl shutdown on mini-os domains=
 to let vtpm-stubdom shutdown correctly. From what I understand there is =
not yet any support for this in mini-os. How tricky would it be to add th=
at? Samuel any ideas?
>>
>> If thats not possible, another potential hack could be writing a key i=
n xenstore to trigger the shutdown or setting up some other kind of event=
 channel mechanism between the vtpm domain and libxl.
>>
> I have approached this problem from the opposite direction, while looki=
ng at
> adding protection from vTPM state rollback. The method that I am curren=
tly
> considering is to have two "slots" in the vTPM disk image - one active =
and
> and one inactive. The save process would then consist of writing a new =
save
> state to the inactive slot, ensuring it has been committed to disk, and=
 then
> requesting the TPM Manager atomically update the state encryption key t=
o the
> new value. When loading, the key obtained from the TPM manager will onl=
y be
> able to decrypt one of the two state images; the successful one is the =
active
> image. Since the vTPM's saved state is not expected to be very large, t=
his
> doesn't waste a significant amount of disk space.
>
I like that idea in general, but it still doesn't solve the shutdown=20
race condition. You might not get a corrupted disk but you can still get =

inadvertently rolled back. Adding a xenstore watch as samuel suggested=20
and doing a clean shutdown would be ideal.



--------------ms050802060706080007020706
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1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AQkFMQ8XDTEyMTEyNzIwMjE0MlowIwYJKoZIhvcNAQkEMRYEFJP8IWA4KTWNLFGj
Ef9IEKATswVrMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAv/W0XNxNx4/F08YA0ABoXjF3NwjoCWt0y
SsxndnGdCulhiFVnj8AVqNAg2RvvjDtcjc3Plk7fDukih6fpOjZE6aa8NbcEYb8N5nP1Zqux
Xebd7GQpk55dCIE7FuHU8oHV0jyxz4pWNkye2B8PY6Oq/23lNznKUXPcX3kkVgB/1wAAAAAA
AA==
--------------ms050802060706080007020706--


--===============8361670052656458462==
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.xen.org
http://lists.xen.org/xen-devel

--===============8361670052656458462==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 20:31:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 20:31:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdRnw-0002Rn-UZ; Tue, 27 Nov 2012 20:30:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdRnv-0002R3-EQ
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 20:30:51 +0000
Received: from [85.158.137.99:59161] by server-2.bemta-3.messagelabs.com id
	C4/B8-04744-9F225B05; Tue, 27 Nov 2012 20:30:49 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-16.tower-217.messagelabs.com!1354048238!20850007!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20796 invoked from network); 27 Nov 2012 20:30:39 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-16.tower-217.messagelabs.com with SMTP;
	27 Nov 2012 20:30:39 -0000
X-TM-IMSS-Message-ID: <c23a0d1b00034e95@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id c23a0d1b00034e95 ;
	Tue, 27 Nov 2012 15:29:35 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARKUO38028951; 
	Tue, 27 Nov 2012 15:30:24 -0500
Message-ID: <50B522E0.6090903@tycho.nsa.gov>
Date: Tue, 27 Nov 2012 15:30:24 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B5042B.7000602@jhuapl.edu> <50B50E3E.6050807@tycho.nsa.gov>
	<50B5190D.20604@jhuapl.edu> <50B51E79.2090308@tycho.nsa.gov>
	<50B520D6.2090602@jhuapl.edu>
In-Reply-To: <50B520D6.2090602@jhuapl.edu>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/27/2012 03:21 PM, Matthew Fioravante wrote:
> On 11/27/2012 03:11 PM, Daniel De Graaf wrote:
>> On 11/27/2012 02:48 PM, Matthew Fioravante wrote:
>>> On 11/27/2012 02:02 PM, Daniel De Graaf wrote:
>>>> On 11/27/2012 01:19 PM, Matthew Fioravante wrote:
>>>>> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>>>>>> The vTPM protocol now contains a field allowing the locality of a
>>>>>> command to be specified; pass this to the TPM when processing a packet.
>>>>>> This also enables a single vTPM to provide multiple tpmback interfaces
>>>>>> so that several closely related domains can share a vTPM (for example, a
>>>>>> qemu device stubdom and its target domain).
>>>>>>
>>>>>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>>>>> ---
>>>>>>     stubdom/tpmemu-0.7.4.patch | 61 ++++++++++++++++++++++++++++++++++++++++++----
>>>>>>     stubdom/vtpm/vtpm.c        | 16 +++---------
>>>>>>     2 files changed, 59 insertions(+), 18 deletions(-)
>>>>>>
>>>>>> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
>>>>>> index b84eff1..31ace1a 100644
>>>>>> --- a/stubdom/tpmemu-0.7.4.patch
>>>>>> +++ b/stubdom/tpmemu-0.7.4.patch
>>>>>> @@ -1,9 +1,60 @@
>>>>>> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
>>>>>> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c    2012-04-27 10:55:46.581963398 -0400
>>>>>> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c    2012-04-27 10:56:02.193034152 -0400
>>>>>> -@@ -249,7 +249,7 @@
>>>>>> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
>>>>>> +index 60bbb90..f8f7f0f 100644
>>>>>> +--- a/tpm/tpm_capability.c
>>>>>> ++++ b/tpm/tpm_capability.c
>>>>>> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *setValue,
>>>>>> +                              UINT32 setValueSize, BOOL ownerAuth,
>>>>>> +                              BOOL deactivated, BOOL disabled)
>>>>>> + {
>>>>>> ++  if (tpmData.stany.flags.localityModifier != 8)
>>>>>> ++    return TPM_BAD_PARAMETER;
>>>>>> +   /* set the capability area with the specified data, on failure
>>>>>> +      deactivate the TPM */
>>>>>> +   switch (subCap) {
>>>>>> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
>>>>>> +index 288d1ce..9e1cfb4 100644
>>>>>> +--- a/tpm/tpm_cmd_handler.c
>>>>>> ++++ b/tpm/tpm_cmd_handler.c
>>>>>> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
>>>>>> +   tpm_extern_release();
>>>>>> + }
>>>>>> +
>>>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size)
>>>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality)
>>>>>> + {
>>>>>> +   TPM_REQUEST req;
>>>>>> +   TPM_RESPONSE rsp;
>>>>>> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint3
>>>>>> +   UINT32 len;
>>>>>> +   BOOL free_out;
>>>>>> +
>>>>>> +-  debug("tpm_handle_command()");
>>>>>> ++  debug("tpm_handle_command(%d)", locality);
>>>>>> ++  if (locality != -1)
>>>>>> ++    tpmData.stany.flags.localityModifier = locality;
>>>>>> +
>>>>>> +   /* we need the whole packet at once, otherwise unmarshalling will fail */
>>>>>> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) != 0) {
>>>>>> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
>>>>>> +index eed749e..4c228bd 100644
>>>>>> +--- a/tpm/tpm_emulator.h
>>>>>> ++++ b/tpm/tpm_emulator.h
>>>>>> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
>>>>>> +  * its usage. In case of an error, all internally allocated memory
>>>>>> +  * is released and the the state of out and out_size is unspecified.
>>>>>> +  */
>>>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size);
>>>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality);
>>>>>> +
>>>>>> + #endif /* _TPM_EMULATOR_H_ */
>>>>>> +
>>>>>> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c
>>>>>> +index aabe6c3..440a01b 100644
>>>>>> +--- a/tpm/tpm_emulator_extern.c
>>>>>> ++++ b/tpm/tpm_emulator_extern.c
>>>>>> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length) = _tpm_read_fr
>>>>>>      #else /* TPM_NO_EXTERN */
>>>>>> -
>>>>>> +
>>>>>>      int (*tpm_extern_init)(void)                                      = NULL;
>>>>>>     -int (*tpm_extern_release)(void)                                   = NULL;
>>>>>>     +void (*tpm_extern_release)(void)                                   = NULL;
>>>>>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>>>>>> index c33e078..dcfc3b9 100644
>>>>>> --- a/stubdom/vtpm/vtpm.c
>>>>>> +++ b/stubdom/vtpm/vtpm.c
>>>>>> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>>>>>>       static void main_loop(void) {
>>>>>>        tpmcmd_t* tpmcmd = NULL;
>>>>>> -   domid_t domid;        /* Domid of frontend */
>>>>>> -   unsigned int handle;    /* handle of frontend */
>>>>>>        int res = -1;
>>>>>>          info("VTPM Initializing\n");
>>>>>> @@ -162,15 +160,7 @@ static void main_loop(void) {
>>>>>>           goto abort_postpcrs;
>>>>>>        }
>>>>>>     -   /* Wait for the frontend domain to connect */
>>>>>> -   info("Waiting for frontend domain to connect..");
>>>>>> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
>>>>>> -      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
>>>>>> -   } else {
>>>>>> -      error("Unable to attach to a frontend");
>>>>>> -   }
>>>>>> -
>>>>>> -   tpmcmd = tpmback_req(domid, handle);
>>>>>> +   tpmcmd = tpmback_req_any();
>>>>>>        while(tpmcmd) {
>>>>>>           /* Handle the request */
>>>>>>           if(tpmcmd->req_len) {
>>>>>> @@ -183,7 +173,7 @@ static void main_loop(void) {
>>>>>>              }
>>>>>>              /* If not disabled, do the command */
>>>>>>              else {
>>>>>> -            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
>>>>>> +            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) != 0) {
>>>>>>                    error("tpm_handle_command() failed");
>>>>>>                    create_error_response(tpmcmd, TPM_FAIL);
>>>>>>                 }
>>>>>> @@ -194,7 +184,7 @@ static void main_loop(void) {
>>>>>>           tpmback_resp(tpmcmd);
>>>>>>             /* Wait for the next request */
>>>>>> -      tpmcmd = tpmback_req(domid, handle);
>>>>>> +      tpmcmd = tpmback_req_any();
>>>>>>          }
>>>>> Before the vtpm would shut down on its own when the host domain disconnects. This occurs because tpmback_req() returns NULL if the frontend disconnected. Using tpmback_req_any(), this is no longer the case which now means the user has to shut down the vtpm manually. How are you handling vtpm shutdown on your end?
>>>> When a domain shuts down, "xl destroy" is called on its paired vTPM (by some
>>>> scripting that may need to be incorporated into libxl). A graceful shutdown
>>>> is not really needed at this point, although it might be needed in the short
>>>> term if the save-state operation is not atomic - but a method of recovering
>>>> from this type of failure is needed for vTPMs anyway.
>>> This is kind of a difficult problem. The save state operation is not by any means atomic and it is very possible that the guest shuts down and xl destroy is called before the save operation completes. This is especially true if the guest is an embedded or even a mini-os domain using tpmfront that shuts down very quickly. Its the reason why now the vtpm shuts itself down after the guest disconnects.
>>>
>>> What is really needed is a way to do an xl shutdown on mini-os domains to let vtpm-stubdom shutdown correctly. From what I understand there is not yet any support for this in mini-os. How tricky would it be to add that? Samuel any ideas?
>>>
>>> If thats not possible, another potential hack could be writing a key in xenstore to trigger the shutdown or setting up some other kind of event channel mechanism between the vtpm domain and libxl.
>>>
>> I have approached this problem from the opposite direction, while looking at
>> adding protection from vTPM state rollback. The method that I am currently
>> considering is to have two "slots" in the vTPM disk image - one active and
>> and one inactive. The save process would then consist of writing a new save
>> state to the inactive slot, ensuring it has been committed to disk, and then
>> requesting the TPM Manager atomically update the state encryption key to the
>> new value. When loading, the key obtained from the TPM manager will only be
>> able to decrypt one of the two state images; the successful one is the active
>> image. Since the vTPM's saved state is not expected to be very large, this
>> doesn't waste a significant amount of disk space.
>>
> I like that idea in general, but it still doesn't solve the shutdown race condition. You might not get a corrupted disk but you can still get inadvertently rolled back. Adding a xenstore watch as samuel suggested and doing a clean shutdown would be ideal.
 
If you run the save before you send back the TPM response, you won't have any
races - if a domain dies without getting a TPM response, the it's valid for
the command to not have completed. The TPM emulator does execute the save
prior to returning the result packet, so this race is already avoided.

That's not to say that handling shutdowns properly is useless, of course; other
minios domains may need it, and a graceful shutdown is easier to clean up after
if not all peers of the vTPM are shutting down at the same time.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 20:31:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 20:31:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdRnw-0002Rn-UZ; Tue, 27 Nov 2012 20:30:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdRnv-0002R3-EQ
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 20:30:51 +0000
Received: from [85.158.137.99:59161] by server-2.bemta-3.messagelabs.com id
	C4/B8-04744-9F225B05; Tue, 27 Nov 2012 20:30:49 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-16.tower-217.messagelabs.com!1354048238!20850007!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20796 invoked from network); 27 Nov 2012 20:30:39 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-16.tower-217.messagelabs.com with SMTP;
	27 Nov 2012 20:30:39 -0000
X-TM-IMSS-Message-ID: <c23a0d1b00034e95@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id c23a0d1b00034e95 ;
	Tue, 27 Nov 2012 15:29:35 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARKUO38028951; 
	Tue, 27 Nov 2012 15:30:24 -0500
Message-ID: <50B522E0.6090903@tycho.nsa.gov>
Date: Tue, 27 Nov 2012 15:30:24 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B5042B.7000602@jhuapl.edu> <50B50E3E.6050807@tycho.nsa.gov>
	<50B5190D.20604@jhuapl.edu> <50B51E79.2090308@tycho.nsa.gov>
	<50B520D6.2090602@jhuapl.edu>
In-Reply-To: <50B520D6.2090602@jhuapl.edu>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/27/2012 03:21 PM, Matthew Fioravante wrote:
> On 11/27/2012 03:11 PM, Daniel De Graaf wrote:
>> On 11/27/2012 02:48 PM, Matthew Fioravante wrote:
>>> On 11/27/2012 02:02 PM, Daniel De Graaf wrote:
>>>> On 11/27/2012 01:19 PM, Matthew Fioravante wrote:
>>>>> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>>>>>> The vTPM protocol now contains a field allowing the locality of a
>>>>>> command to be specified; pass this to the TPM when processing a packet.
>>>>>> This also enables a single vTPM to provide multiple tpmback interfaces
>>>>>> so that several closely related domains can share a vTPM (for example, a
>>>>>> qemu device stubdom and its target domain).
>>>>>>
>>>>>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>>>>> ---
>>>>>>     stubdom/tpmemu-0.7.4.patch | 61 ++++++++++++++++++++++++++++++++++++++++++----
>>>>>>     stubdom/vtpm/vtpm.c        | 16 +++---------
>>>>>>     2 files changed, 59 insertions(+), 18 deletions(-)
>>>>>>
>>>>>> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
>>>>>> index b84eff1..31ace1a 100644
>>>>>> --- a/stubdom/tpmemu-0.7.4.patch
>>>>>> +++ b/stubdom/tpmemu-0.7.4.patch
>>>>>> @@ -1,9 +1,60 @@
>>>>>> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
>>>>>> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c    2012-04-27 10:55:46.581963398 -0400
>>>>>> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c    2012-04-27 10:56:02.193034152 -0400
>>>>>> -@@ -249,7 +249,7 @@
>>>>>> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
>>>>>> +index 60bbb90..f8f7f0f 100644
>>>>>> +--- a/tpm/tpm_capability.c
>>>>>> ++++ b/tpm/tpm_capability.c
>>>>>> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *setValue,
>>>>>> +                              UINT32 setValueSize, BOOL ownerAuth,
>>>>>> +                              BOOL deactivated, BOOL disabled)
>>>>>> + {
>>>>>> ++  if (tpmData.stany.flags.localityModifier != 8)
>>>>>> ++    return TPM_BAD_PARAMETER;
>>>>>> +   /* set the capability area with the specified data, on failure
>>>>>> +      deactivate the TPM */
>>>>>> +   switch (subCap) {
>>>>>> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
>>>>>> +index 288d1ce..9e1cfb4 100644
>>>>>> +--- a/tpm/tpm_cmd_handler.c
>>>>>> ++++ b/tpm/tpm_cmd_handler.c
>>>>>> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
>>>>>> +   tpm_extern_release();
>>>>>> + }
>>>>>> +
>>>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size)
>>>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality)
>>>>>> + {
>>>>>> +   TPM_REQUEST req;
>>>>>> +   TPM_RESPONSE rsp;
>>>>>> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint3
>>>>>> +   UINT32 len;
>>>>>> +   BOOL free_out;
>>>>>> +
>>>>>> +-  debug("tpm_handle_command()");
>>>>>> ++  debug("tpm_handle_command(%d)", locality);
>>>>>> ++  if (locality != -1)
>>>>>> ++    tpmData.stany.flags.localityModifier = locality;
>>>>>> +
>>>>>> +   /* we need the whole packet at once, otherwise unmarshalling will fail */
>>>>>> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) != 0) {
>>>>>> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
>>>>>> +index eed749e..4c228bd 100644
>>>>>> +--- a/tpm/tpm_emulator.h
>>>>>> ++++ b/tpm/tpm_emulator.h
>>>>>> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
>>>>>> +  * its usage. In case of an error, all internally allocated memory
>>>>>> +  * is released and the the state of out and out_size is unspecified.
>>>>>> +  */
>>>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size);
>>>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality);
>>>>>> +
>>>>>> + #endif /* _TPM_EMULATOR_H_ */
>>>>>> +
>>>>>> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c
>>>>>> +index aabe6c3..440a01b 100644
>>>>>> +--- a/tpm/tpm_emulator_extern.c
>>>>>> ++++ b/tpm/tpm_emulator_extern.c
>>>>>> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length) = _tpm_read_fr
>>>>>>      #else /* TPM_NO_EXTERN */
>>>>>> -
>>>>>> +
>>>>>>      int (*tpm_extern_init)(void)                                      = NULL;
>>>>>>     -int (*tpm_extern_release)(void)                                   = NULL;
>>>>>>     +void (*tpm_extern_release)(void)                                   = NULL;
>>>>>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>>>>>> index c33e078..dcfc3b9 100644
>>>>>> --- a/stubdom/vtpm/vtpm.c
>>>>>> +++ b/stubdom/vtpm/vtpm.c
>>>>>> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>>>>>>       static void main_loop(void) {
>>>>>>        tpmcmd_t* tpmcmd = NULL;
>>>>>> -   domid_t domid;        /* Domid of frontend */
>>>>>> -   unsigned int handle;    /* handle of frontend */
>>>>>>        int res = -1;
>>>>>>          info("VTPM Initializing\n");
>>>>>> @@ -162,15 +160,7 @@ static void main_loop(void) {
>>>>>>           goto abort_postpcrs;
>>>>>>        }
>>>>>>     -   /* Wait for the frontend domain to connect */
>>>>>> -   info("Waiting for frontend domain to connect..");
>>>>>> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
>>>>>> -      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
>>>>>> -   } else {
>>>>>> -      error("Unable to attach to a frontend");
>>>>>> -   }
>>>>>> -
>>>>>> -   tpmcmd = tpmback_req(domid, handle);
>>>>>> +   tpmcmd = tpmback_req_any();
>>>>>>        while(tpmcmd) {
>>>>>>           /* Handle the request */
>>>>>>           if(tpmcmd->req_len) {
>>>>>> @@ -183,7 +173,7 @@ static void main_loop(void) {
>>>>>>              }
>>>>>>              /* If not disabled, do the command */
>>>>>>              else {
>>>>>> -            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
>>>>>> +            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) != 0) {
>>>>>>                    error("tpm_handle_command() failed");
>>>>>>                    create_error_response(tpmcmd, TPM_FAIL);
>>>>>>                 }
>>>>>> @@ -194,7 +184,7 @@ static void main_loop(void) {
>>>>>>           tpmback_resp(tpmcmd);
>>>>>>             /* Wait for the next request */
>>>>>> -      tpmcmd = tpmback_req(domid, handle);
>>>>>> +      tpmcmd = tpmback_req_any();
>>>>>>          }
>>>>> Before the vtpm would shut down on its own when the host domain disconnects. This occurs because tpmback_req() returns NULL if the frontend disconnected. Using tpmback_req_any(), this is no longer the case which now means the user has to shut down the vtpm manually. How are you handling vtpm shutdown on your end?
>>>> When a domain shuts down, "xl destroy" is called on its paired vTPM (by some
>>>> scripting that may need to be incorporated into libxl). A graceful shutdown
>>>> is not really needed at this point, although it might be needed in the short
>>>> term if the save-state operation is not atomic - but a method of recovering
>>>> from this type of failure is needed for vTPMs anyway.
>>> This is kind of a difficult problem. The save state operation is not by any means atomic and it is very possible that the guest shuts down and xl destroy is called before the save operation completes. This is especially true if the guest is an embedded or even a mini-os domain using tpmfront that shuts down very quickly. Its the reason why now the vtpm shuts itself down after the guest disconnects.
>>>
>>> What is really needed is a way to do an xl shutdown on mini-os domains to let vtpm-stubdom shutdown correctly. From what I understand there is not yet any support for this in mini-os. How tricky would it be to add that? Samuel any ideas?
>>>
>>> If thats not possible, another potential hack could be writing a key in xenstore to trigger the shutdown or setting up some other kind of event channel mechanism between the vtpm domain and libxl.
>>>
>> I have approached this problem from the opposite direction, while looking at
>> adding protection from vTPM state rollback. The method that I am currently
>> considering is to have two "slots" in the vTPM disk image - one active and
>> and one inactive. The save process would then consist of writing a new save
>> state to the inactive slot, ensuring it has been committed to disk, and then
>> requesting the TPM Manager atomically update the state encryption key to the
>> new value. When loading, the key obtained from the TPM manager will only be
>> able to decrypt one of the two state images; the successful one is the active
>> image. Since the vTPM's saved state is not expected to be very large, this
>> doesn't waste a significant amount of disk space.
>>
> I like that idea in general, but it still doesn't solve the shutdown race condition. You might not get a corrupted disk but you can still get inadvertently rolled back. Adding a xenstore watch as samuel suggested and doing a clean shutdown would be ideal.
 
If you run the save before you send back the TPM response, you won't have any
races - if a domain dies without getting a TPM response, the it's valid for
the command to not have completed. The TPM emulator does execute the save
prior to returning the result packet, so this race is already avoided.

That's not to say that handling shutdowns properly is useless, of course; other
minios domains may need it, and a graceful shutdown is easier to clean up after
if not all peers of the vTPM are shutting down at the same time.

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 20:35:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 20:35:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdRsF-0002jC-9A; Tue, 27 Nov 2012 20:35:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TdRsD-0002j4-20
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 20:35:17 +0000
Received: from [85.158.143.99:32470] by server-2.bemta-4.messagelabs.com id
	2E/D8-28922-40425B05; Tue, 27 Nov 2012 20:35:16 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-4.tower-216.messagelabs.com!1354048513!26336613!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18767 invoked from network); 27 Nov 2012 20:35:14 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-4.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 20:35:14 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158210561;
	Tue, 27 Nov 2012 15:34:57 -0500
Message-ID: <50B523EC.6070300@jhuapl.edu>
Date: Tue, 27 Nov 2012 15:34:52 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B5042B.7000602@jhuapl.edu> <50B50E3E.6050807@tycho.nsa.gov>
	<50B5190D.20604@jhuapl.edu> <50B51E79.2090308@tycho.nsa.gov>
	<50B520D6.2090602@jhuapl.edu> <50B522E0.6090903@tycho.nsa.gov>
In-Reply-To: <50B522E0.6090903@tycho.nsa.gov>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6834972248030662317=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============6834972248030662317==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms090802040808040703000601"

This is a cryptographically signed message in MIME format.

--------------ms090802040808040703000601
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/27/2012 03:30 PM, Daniel De Graaf wrote:
> On 11/27/2012 03:21 PM, Matthew Fioravante wrote:
>> On 11/27/2012 03:11 PM, Daniel De Graaf wrote:
>>> On 11/27/2012 02:48 PM, Matthew Fioravante wrote:
>>>> On 11/27/2012 02:02 PM, Daniel De Graaf wrote:
>>>>> On 11/27/2012 01:19 PM, Matthew Fioravante wrote:
>>>>>> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>>>>>>> The vTPM protocol now contains a field allowing the locality of a=

>>>>>>> command to be specified; pass this to the TPM when processing a p=
acket.
>>>>>>> This also enables a single vTPM to provide multiple tpmback inter=
faces
>>>>>>> so that several closely related domains can share a vTPM (for exa=
mple, a
>>>>>>> qemu device stubdom and its target domain).
>>>>>>>
>>>>>>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>>>>>> ---
>>>>>>>      stubdom/tpmemu-0.7.4.patch | 61 ++++++++++++++++++++++++++++=
++++++++++++++----
>>>>>>>      stubdom/vtpm/vtpm.c        | 16 +++---------
>>>>>>>      2 files changed, 59 insertions(+), 18 deletions(-)
>>>>>>>
>>>>>>> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.pa=
tch
>>>>>>> index b84eff1..31ace1a 100644
>>>>>>> --- a/stubdom/tpmemu-0.7.4.patch
>>>>>>> +++ b/stubdom/tpmemu-0.7.4.patch
>>>>>>> @@ -1,9 +1,60 @@
>>>>>>> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tp=
m_emulator-x86_64/tpm/tpm_emulator_extern.c
>>>>>>> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c    2012-0=
4-27 10:55:46.581963398 -0400
>>>>>>> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c    2012-04-27 =
10:56:02.193034152 -0400
>>>>>>> -@@ -249,7 +249,7 @@
>>>>>>> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
>>>>>>> +index 60bbb90..f8f7f0f 100644
>>>>>>> +--- a/tpm/tpm_capability.c
>>>>>>> ++++ b/tpm/tpm_capability.c
>>>>>>> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, =
BYTE *setValue,
>>>>>>> +                              UINT32 setValueSize, BOOL ownerAut=
h,
>>>>>>> +                              BOOL deactivated, BOOL disabled)
>>>>>>> + {
>>>>>>> ++  if (tpmData.stany.flags.localityModifier !=3D 8)
>>>>>>> ++    return TPM_BAD_PARAMETER;
>>>>>>> +   /* set the capability area with the specified data, on failur=
e
>>>>>>> +      deactivate the TPM */
>>>>>>> +   switch (subCap) {
>>>>>>> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
>>>>>>> +index 288d1ce..9e1cfb4 100644
>>>>>>> +--- a/tpm/tpm_cmd_handler.c
>>>>>>> ++++ b/tpm/tpm_cmd_handler.c
>>>>>>> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
>>>>>>> +   tpm_extern_release();
>>>>>>> + }
>>>>>>> +
>>>>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uin=
t8_t **out, uint32_t *out_size)
>>>>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uin=
t8_t **out, uint32_t *out_size, int locality)
>>>>>>> + {
>>>>>>> +   TPM_REQUEST req;
>>>>>>> +   TPM_RESPONSE rsp;
>>>>>>> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, =
uint32_t in_size, uint8_t **out, uint3
>>>>>>> +   UINT32 len;
>>>>>>> +   BOOL free_out;
>>>>>>> +
>>>>>>> +-  debug("tpm_handle_command()");
>>>>>>> ++  debug("tpm_handle_command(%d)", locality);
>>>>>>> ++  if (locality !=3D -1)
>>>>>>> ++    tpmData.stany.flags.localityModifier =3D locality;
>>>>>>> +
>>>>>>> +   /* we need the whole packet at once, otherwise unmarshalling =
will fail */
>>>>>>> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req)=
 !=3D 0) {
>>>>>>> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
>>>>>>> +index eed749e..4c228bd 100644
>>>>>>> +--- a/tpm/tpm_emulator.h
>>>>>>> ++++ b/tpm/tpm_emulator.h
>>>>>>> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
>>>>>>> +  * its usage. In case of an error, all internally allocated mem=
ory
>>>>>>> +  * is released and the the state of out and out_size is unspeci=
fied.
>>>>>>> +  */
>>>>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uin=
t8_t **out, uint32_t *out_size);
>>>>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uin=
t8_t **out, uint32_t *out_size, int locality);
>>>>>>> +
>>>>>>> + #endif /* _TPM_EMULATOR_H_ */
>>>>>>> +
>>>>>>> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern=
=2Ec
>>>>>>> +index aabe6c3..440a01b 100644
>>>>>>> +--- a/tpm/tpm_emulator_extern.c
>>>>>>> ++++ b/tpm/tpm_emulator_extern.c
>>>>>>> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data,=
 size_t *data_length) =3D _tpm_read_fr
>>>>>>>       #else /* TPM_NO_EXTERN */
>>>>>>> -
>>>>>>> +
>>>>>>>       int (*tpm_extern_init)(void)                               =
       =3D NULL;
>>>>>>>      -int (*tpm_extern_release)(void)                            =
       =3D NULL;
>>>>>>>      +void (*tpm_extern_release)(void)                           =
        =3D NULL;
>>>>>>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>>>>>>> index c33e078..dcfc3b9 100644
>>>>>>> --- a/stubdom/vtpm/vtpm.c
>>>>>>> +++ b/stubdom/vtpm/vtpm.c
>>>>>>> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>>>>>>>        static void main_loop(void) {
>>>>>>>         tpmcmd_t* tpmcmd =3D NULL;
>>>>>>> -   domid_t domid;        /* Domid of frontend */
>>>>>>> -   unsigned int handle;    /* handle of frontend */
>>>>>>>         int res =3D -1;
>>>>>>>           info("VTPM Initializing\n");
>>>>>>> @@ -162,15 +160,7 @@ static void main_loop(void) {
>>>>>>>            goto abort_postpcrs;
>>>>>>>         }
>>>>>>>      -   /* Wait for the frontend domain to connect */
>>>>>>> -   info("Waiting for frontend domain to connect..");
>>>>>>> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) =3D=3D =
0) {
>>>>>>> -      info("VTPM attached to Frontend %u/%u", (unsigned int) dom=
id, handle);
>>>>>>> -   } else {
>>>>>>> -      error("Unable to attach to a frontend");
>>>>>>> -   }
>>>>>>> -
>>>>>>> -   tpmcmd =3D tpmback_req(domid, handle);
>>>>>>> +   tpmcmd =3D tpmback_req_any();
>>>>>>>         while(tpmcmd) {
>>>>>>>            /* Handle the request */
>>>>>>>            if(tpmcmd->req_len) {
>>>>>>> @@ -183,7 +173,7 @@ static void main_loop(void) {
>>>>>>>               }
>>>>>>>               /* If not disabled, do the command */
>>>>>>>               else {
>>>>>>> -            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->=
req_len, &tpmcmd->resp, &tpmcmd->resp_len)) !=3D 0) {
>>>>>>> +            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->=
req_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) !=3D 0) {
>>>>>>>                     error("tpm_handle_command() failed");
>>>>>>>                     create_error_response(tpmcmd, TPM_FAIL);
>>>>>>>                  }
>>>>>>> @@ -194,7 +184,7 @@ static void main_loop(void) {
>>>>>>>            tpmback_resp(tpmcmd);
>>>>>>>              /* Wait for the next request */
>>>>>>> -      tpmcmd =3D tpmback_req(domid, handle);
>>>>>>> +      tpmcmd =3D tpmback_req_any();
>>>>>>>           }
>>>>>> Before the vtpm would shut down on its own when the host domain di=
sconnects. This occurs because tpmback_req() returns NULL if the frontend=
 disconnected. Using tpmback_req_any(), this is no longer the case which =
now means the user has to shut down the vtpm manually. How are you handli=
ng vtpm shutdown on your end?
>>>>> When a domain shuts down, "xl destroy" is called on its paired vTPM=
 (by some
>>>>> scripting that may need to be incorporated into libxl). A graceful =
shutdown
>>>>> is not really needed at this point, although it might be needed in =
the short
>>>>> term if the save-state operation is not atomic - but a method of re=
covering
>>>>> from this type of failure is needed for vTPMs anyway.
>>>> This is kind of a difficult problem. The save state operation is not=
 by any means atomic and it is very possible that the guest shuts down an=
d xl destroy is called before the save operation completes. This is espec=
ially true if the guest is an embedded or even a mini-os domain using tpm=
front that shuts down very quickly. Its the reason why now the vtpm shuts=
 itself down after the guest disconnects.
>>>>
>>>> What is really needed is a way to do an xl shutdown on mini-os domai=
ns to let vtpm-stubdom shutdown correctly. From what I understand there i=
s not yet any support for this in mini-os. How tricky would it be to add =
that? Samuel any ideas?
>>>>
>>>> If thats not possible, another potential hack could be writing a key=
 in xenstore to trigger the shutdown or setting up some other kind of eve=
nt channel mechanism between the vtpm domain and libxl.
>>>>
>>> I have approached this problem from the opposite direction, while loo=
king at
>>> adding protection from vTPM state rollback. The method that I am curr=
ently
>>> considering is to have two "slots" in the vTPM disk image - one activ=
e and
>>> and one inactive. The save process would then consist of writing a ne=
w save
>>> state to the inactive slot, ensuring it has been committed to disk, a=
nd then
>>> requesting the TPM Manager atomically update the state encryption key=
 to the
>>> new value. When loading, the key obtained from the TPM manager will o=
nly be
>>> able to decrypt one of the two state images; the successful one is th=
e active
>>> image. Since the vTPM's saved state is not expected to be very large,=
 this
>>> doesn't waste a significant amount of disk space.
>>>
>> I like that idea in general, but it still doesn't solve the shutdown r=
ace condition. You might not get a corrupted disk but you can still get i=
nadvertently rolled back. Adding a xenstore watch as samuel suggested and=
 doing a clean shutdown would be ideal.
>  =20
> If you run the save before you send back the TPM response, you won't ha=
ve any
> races - if a domain dies without getting a TPM response, the it's valid=
 for
> the command to not have completed. The TPM emulator does execute the sa=
ve
> prior to returning the result packet, so this race is already avoided.
>
> That's not to say that handling shutdowns properly is useless, of cours=
e; other
> minios domains may need it, and a graceful shutdown is easier to clean =
up after
> if not all peers of the vTPM are shutting down at the same time.
Ok I follow you now. Do you already have patches to do the disk=20
mirroring and destroy the vtpm from libxl? I think we will want to=20
include this so these new features don't break the automatic vtpm=20
shutdown model already in place.



--------------ms090802040808040703000601
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attach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QTEOMAwGA1UEAxMFQ1JMNTYwHwYDVR0jBBgwFoAUCDUpmxH52EU2CyWmF2EJMB1yqeswHQYD
VR0OBBYEFO6LYxg6r9wHZ+zdQtBHn1dZ/YTNMAkGA1UdEwQCMAAwGQYJKoZIhvZ9B0EABAww
ChsEVjcuMQMCBLAwDQYJKoZIhvcNAQEFBQADgYEAJO9HQh4YNChVLzuZqK5ARJARD8JoujGZ
fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEyNzIwMzQ1MlowIwYJKoZIhvcNAQkEMRYEFNaWb30lM7NQQKsk
wk5MTESTXNSpMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYBEw2vS0h6fai//eXJXXZmqghooVuXb5nct
S0X9gHRvJckLgb7ovss0PdpBFhNeOlvXOWmApxBAg3CYF0aK4HcHRpRxv3t8TeZjXayQCyoj
ML/S2H/xiBScCEQxp6aCcETb3br5FWlGb6TFM8bZNj8ZoqltweWvj51AiObGefkuBgAAAAAA
AA==
--------------ms090802040808040703000601--


--===============6834972248030662317==
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.xen.org
http://lists.xen.org/xen-devel

--===============6834972248030662317==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 20:35:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 20:35:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdRsF-0002jC-9A; Tue, 27 Nov 2012 20:35:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TdRsD-0002j4-20
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 20:35:17 +0000
Received: from [85.158.143.99:32470] by server-2.bemta-4.messagelabs.com id
	2E/D8-28922-40425B05; Tue, 27 Nov 2012 20:35:16 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-4.tower-216.messagelabs.com!1354048513!26336613!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18767 invoked from network); 27 Nov 2012 20:35:14 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-4.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 20:35:14 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158210561;
	Tue, 27 Nov 2012 15:34:57 -0500
Message-ID: <50B523EC.6070300@jhuapl.edu>
Date: Tue, 27 Nov 2012 15:34:52 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B5042B.7000602@jhuapl.edu> <50B50E3E.6050807@tycho.nsa.gov>
	<50B5190D.20604@jhuapl.edu> <50B51E79.2090308@tycho.nsa.gov>
	<50B520D6.2090602@jhuapl.edu> <50B522E0.6090903@tycho.nsa.gov>
In-Reply-To: <50B522E0.6090903@tycho.nsa.gov>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6834972248030662317=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============6834972248030662317==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms090802040808040703000601"

This is a cryptographically signed message in MIME format.

--------------ms090802040808040703000601
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/27/2012 03:30 PM, Daniel De Graaf wrote:
> On 11/27/2012 03:21 PM, Matthew Fioravante wrote:
>> On 11/27/2012 03:11 PM, Daniel De Graaf wrote:
>>> On 11/27/2012 02:48 PM, Matthew Fioravante wrote:
>>>> On 11/27/2012 02:02 PM, Daniel De Graaf wrote:
>>>>> On 11/27/2012 01:19 PM, Matthew Fioravante wrote:
>>>>>> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>>>>>>> The vTPM protocol now contains a field allowing the locality of a=

>>>>>>> command to be specified; pass this to the TPM when processing a p=
acket.
>>>>>>> This also enables a single vTPM to provide multiple tpmback inter=
faces
>>>>>>> so that several closely related domains can share a vTPM (for exa=
mple, a
>>>>>>> qemu device stubdom and its target domain).
>>>>>>>
>>>>>>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>>>>>> ---
>>>>>>>      stubdom/tpmemu-0.7.4.patch | 61 ++++++++++++++++++++++++++++=
++++++++++++++----
>>>>>>>      stubdom/vtpm/vtpm.c        | 16 +++---------
>>>>>>>      2 files changed, 59 insertions(+), 18 deletions(-)
>>>>>>>
>>>>>>> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.pa=
tch
>>>>>>> index b84eff1..31ace1a 100644
>>>>>>> --- a/stubdom/tpmemu-0.7.4.patch
>>>>>>> +++ b/stubdom/tpmemu-0.7.4.patch
>>>>>>> @@ -1,9 +1,60 @@
>>>>>>> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tp=
m_emulator-x86_64/tpm/tpm_emulator_extern.c
>>>>>>> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c    2012-0=
4-27 10:55:46.581963398 -0400
>>>>>>> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c    2012-04-27 =
10:56:02.193034152 -0400
>>>>>>> -@@ -249,7 +249,7 @@
>>>>>>> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
>>>>>>> +index 60bbb90..f8f7f0f 100644
>>>>>>> +--- a/tpm/tpm_capability.c
>>>>>>> ++++ b/tpm/tpm_capability.c
>>>>>>> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, =
BYTE *setValue,
>>>>>>> +                              UINT32 setValueSize, BOOL ownerAut=
h,
>>>>>>> +                              BOOL deactivated, BOOL disabled)
>>>>>>> + {
>>>>>>> ++  if (tpmData.stany.flags.localityModifier !=3D 8)
>>>>>>> ++    return TPM_BAD_PARAMETER;
>>>>>>> +   /* set the capability area with the specified data, on failur=
e
>>>>>>> +      deactivate the TPM */
>>>>>>> +   switch (subCap) {
>>>>>>> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
>>>>>>> +index 288d1ce..9e1cfb4 100644
>>>>>>> +--- a/tpm/tpm_cmd_handler.c
>>>>>>> ++++ b/tpm/tpm_cmd_handler.c
>>>>>>> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
>>>>>>> +   tpm_extern_release();
>>>>>>> + }
>>>>>>> +
>>>>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uin=
t8_t **out, uint32_t *out_size)
>>>>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uin=
t8_t **out, uint32_t *out_size, int locality)
>>>>>>> + {
>>>>>>> +   TPM_REQUEST req;
>>>>>>> +   TPM_RESPONSE rsp;
>>>>>>> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, =
uint32_t in_size, uint8_t **out, uint3
>>>>>>> +   UINT32 len;
>>>>>>> +   BOOL free_out;
>>>>>>> +
>>>>>>> +-  debug("tpm_handle_command()");
>>>>>>> ++  debug("tpm_handle_command(%d)", locality);
>>>>>>> ++  if (locality !=3D -1)
>>>>>>> ++    tpmData.stany.flags.localityModifier =3D locality;
>>>>>>> +
>>>>>>> +   /* we need the whole packet at once, otherwise unmarshalling =
will fail */
>>>>>>> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req)=
 !=3D 0) {
>>>>>>> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
>>>>>>> +index eed749e..4c228bd 100644
>>>>>>> +--- a/tpm/tpm_emulator.h
>>>>>>> ++++ b/tpm/tpm_emulator.h
>>>>>>> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
>>>>>>> +  * its usage. In case of an error, all internally allocated mem=
ory
>>>>>>> +  * is released and the the state of out and out_size is unspeci=
fied.
>>>>>>> +  */
>>>>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uin=
t8_t **out, uint32_t *out_size);
>>>>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uin=
t8_t **out, uint32_t *out_size, int locality);
>>>>>>> +
>>>>>>> + #endif /* _TPM_EMULATOR_H_ */
>>>>>>> +
>>>>>>> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern=
=2Ec
>>>>>>> +index aabe6c3..440a01b 100644
>>>>>>> +--- a/tpm/tpm_emulator_extern.c
>>>>>>> ++++ b/tpm/tpm_emulator_extern.c
>>>>>>> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data,=
 size_t *data_length) =3D _tpm_read_fr
>>>>>>>       #else /* TPM_NO_EXTERN */
>>>>>>> -
>>>>>>> +
>>>>>>>       int (*tpm_extern_init)(void)                               =
       =3D NULL;
>>>>>>>      -int (*tpm_extern_release)(void)                            =
       =3D NULL;
>>>>>>>      +void (*tpm_extern_release)(void)                           =
        =3D NULL;
>>>>>>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>>>>>>> index c33e078..dcfc3b9 100644
>>>>>>> --- a/stubdom/vtpm/vtpm.c
>>>>>>> +++ b/stubdom/vtpm/vtpm.c
>>>>>>> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>>>>>>>        static void main_loop(void) {
>>>>>>>         tpmcmd_t* tpmcmd =3D NULL;
>>>>>>> -   domid_t domid;        /* Domid of frontend */
>>>>>>> -   unsigned int handle;    /* handle of frontend */
>>>>>>>         int res =3D -1;
>>>>>>>           info("VTPM Initializing\n");
>>>>>>> @@ -162,15 +160,7 @@ static void main_loop(void) {
>>>>>>>            goto abort_postpcrs;
>>>>>>>         }
>>>>>>>      -   /* Wait for the frontend domain to connect */
>>>>>>> -   info("Waiting for frontend domain to connect..");
>>>>>>> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) =3D=3D =
0) {
>>>>>>> -      info("VTPM attached to Frontend %u/%u", (unsigned int) dom=
id, handle);
>>>>>>> -   } else {
>>>>>>> -      error("Unable to attach to a frontend");
>>>>>>> -   }
>>>>>>> -
>>>>>>> -   tpmcmd =3D tpmback_req(domid, handle);
>>>>>>> +   tpmcmd =3D tpmback_req_any();
>>>>>>>         while(tpmcmd) {
>>>>>>>            /* Handle the request */
>>>>>>>            if(tpmcmd->req_len) {
>>>>>>> @@ -183,7 +173,7 @@ static void main_loop(void) {
>>>>>>>               }
>>>>>>>               /* If not disabled, do the command */
>>>>>>>               else {
>>>>>>> -            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->=
req_len, &tpmcmd->resp, &tpmcmd->resp_len)) !=3D 0) {
>>>>>>> +            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->=
req_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) !=3D 0) {
>>>>>>>                     error("tpm_handle_command() failed");
>>>>>>>                     create_error_response(tpmcmd, TPM_FAIL);
>>>>>>>                  }
>>>>>>> @@ -194,7 +184,7 @@ static void main_loop(void) {
>>>>>>>            tpmback_resp(tpmcmd);
>>>>>>>              /* Wait for the next request */
>>>>>>> -      tpmcmd =3D tpmback_req(domid, handle);
>>>>>>> +      tpmcmd =3D tpmback_req_any();
>>>>>>>           }
>>>>>> Before the vtpm would shut down on its own when the host domain di=
sconnects. This occurs because tpmback_req() returns NULL if the frontend=
 disconnected. Using tpmback_req_any(), this is no longer the case which =
now means the user has to shut down the vtpm manually. How are you handli=
ng vtpm shutdown on your end?
>>>>> When a domain shuts down, "xl destroy" is called on its paired vTPM=
 (by some
>>>>> scripting that may need to be incorporated into libxl). A graceful =
shutdown
>>>>> is not really needed at this point, although it might be needed in =
the short
>>>>> term if the save-state operation is not atomic - but a method of re=
covering
>>>>> from this type of failure is needed for vTPMs anyway.
>>>> This is kind of a difficult problem. The save state operation is not=
 by any means atomic and it is very possible that the guest shuts down an=
d xl destroy is called before the save operation completes. This is espec=
ially true if the guest is an embedded or even a mini-os domain using tpm=
front that shuts down very quickly. Its the reason why now the vtpm shuts=
 itself down after the guest disconnects.
>>>>
>>>> What is really needed is a way to do an xl shutdown on mini-os domai=
ns to let vtpm-stubdom shutdown correctly. From what I understand there i=
s not yet any support for this in mini-os. How tricky would it be to add =
that? Samuel any ideas?
>>>>
>>>> If thats not possible, another potential hack could be writing a key=
 in xenstore to trigger the shutdown or setting up some other kind of eve=
nt channel mechanism between the vtpm domain and libxl.
>>>>
>>> I have approached this problem from the opposite direction, while loo=
king at
>>> adding protection from vTPM state rollback. The method that I am curr=
ently
>>> considering is to have two "slots" in the vTPM disk image - one activ=
e and
>>> and one inactive. The save process would then consist of writing a ne=
w save
>>> state to the inactive slot, ensuring it has been committed to disk, a=
nd then
>>> requesting the TPM Manager atomically update the state encryption key=
 to the
>>> new value. When loading, the key obtained from the TPM manager will o=
nly be
>>> able to decrypt one of the two state images; the successful one is th=
e active
>>> image. Since the vTPM's saved state is not expected to be very large,=
 this
>>> doesn't waste a significant amount of disk space.
>>>
>> I like that idea in general, but it still doesn't solve the shutdown r=
ace condition. You might not get a corrupted disk but you can still get i=
nadvertently rolled back. Adding a xenstore watch as samuel suggested and=
 doing a clean shutdown would be ideal.
>  =20
> If you run the save before you send back the TPM response, you won't ha=
ve any
> races - if a domain dies without getting a TPM response, the it's valid=
 for
> the command to not have completed. The TPM emulator does execute the sa=
ve
> prior to returning the result packet, so this race is already avoided.
>
> That's not to say that handling shutdowns properly is useless, of cours=
e; other
> minios domains may need it, and a graceful shutdown is easier to clean =
up after
> if not all peers of the vTPM are shutting down at the same time.
Ok I follow you now. Do you already have patches to do the disk=20
mirroring and destroy the vtpm from libxl? I think we will want to=20
include this so these new features don't break the automatic vtpm=20
shutdown model already in place.



--------------ms090802040808040703000601
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlCwMBAQEBBAoWCGZpb3JhbWUxMBsGDSsGAQQBsyUL
AwEBAQIEChIIMDAxMDQyNjEwWAYJYIZIAYb6ax4BBEsMSVRoZSBwcml2YXRlIGtleSBjb3Jy
ZXNwb25kaW5nIHRvIHRoaXMgY2VydGlmaWNhdG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jXayQCyoj
ML/S2H/xiBScCEQxp6aCcETb3br5FWlGb6TFM8bZNj8ZoqltweWvj51AiObGefkuBgAAAAAA
AA==
--------------ms090802040808040703000601--


--===============6834972248030662317==
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.xen.org
http://lists.xen.org/xen-devel

--===============6834972248030662317==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 20:40:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 20:40:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdRxC-0002ws-1K; Tue, 27 Nov 2012 20:40:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdRxA-0002wm-Q5
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 20:40:25 +0000
Received: from [85.158.137.99:60819] by server-14.bemta-3.messagelabs.com id
	EE/4C-31424-33525B05; Tue, 27 Nov 2012 20:40:19 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-13.tower-217.messagelabs.com!1354048817!20872255!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13936 invoked from network); 27 Nov 2012 20:40:18 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-13.tower-217.messagelabs.com with SMTP;
	27 Nov 2012 20:40:18 -0000
X-TM-IMSS-Message-ID: <c242e5be000350d3@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id c242e5be000350d3 ;
	Tue, 27 Nov 2012 15:39:15 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARKe4I9029608; 
	Tue, 27 Nov 2012 15:40:04 -0500
Message-ID: <50B52524.6030707@tycho.nsa.gov>
Date: Tue, 27 Nov 2012 15:40:04 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B5042B.7000602@jhuapl.edu> <50B50E3E.6050807@tycho.nsa.gov>
	<50B5190D.20604@jhuapl.edu> <50B51E79.2090308@tycho.nsa.gov>
	<50B520D6.2090602@jhuapl.edu> <50B522E0.6090903@tycho.nsa.gov>
	<50B523EC.6070300@jhuapl.edu>
In-Reply-To: <50B523EC.6070300@jhuapl.edu>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/27/2012 03:34 PM, Matthew Fioravante wrote:
> On 11/27/2012 03:30 PM, Daniel De Graaf wrote:
>> On 11/27/2012 03:21 PM, Matthew Fioravante wrote:
>>> On 11/27/2012 03:11 PM, Daniel De Graaf wrote:
>>>> On 11/27/2012 02:48 PM, Matthew Fioravante wrote:
>>>>> On 11/27/2012 02:02 PM, Daniel De Graaf wrote:
>>>>>> On 11/27/2012 01:19 PM, Matthew Fioravante wrote:
>>>>>>> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>>>>>>>> The vTPM protocol now contains a field allowing the locality of a
>>>>>>>> command to be specified; pass this to the TPM when processing a packet.
>>>>>>>> This also enables a single vTPM to provide multiple tpmback interfaces
>>>>>>>> so that several closely related domains can share a vTPM (for example, a
>>>>>>>> qemu device stubdom and its target domain).
>>>>>>>>
>>>>>>>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>>>>>>> ---
>>>>>>>>      stubdom/tpmemu-0.7.4.patch | 61 ++++++++++++++++++++++++++++++++++++++++++----
>>>>>>>>      stubdom/vtpm/vtpm.c        | 16 +++---------
>>>>>>>>      2 files changed, 59 insertions(+), 18 deletions(-)
>>>>>>>>
>>>>>>>> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
>>>>>>>> index b84eff1..31ace1a 100644
>>>>>>>> --- a/stubdom/tpmemu-0.7.4.patch
>>>>>>>> +++ b/stubdom/tpmemu-0.7.4.patch
>>>>>>>> @@ -1,9 +1,60 @@
>>>>>>>> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
>>>>>>>> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c    2012-04-27 10:55:46.581963398 -0400
>>>>>>>> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c    2012-04-27 10:56:02.193034152 -0400
>>>>>>>> -@@ -249,7 +249,7 @@
>>>>>>>> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
>>>>>>>> +index 60bbb90..f8f7f0f 100644
>>>>>>>> +--- a/tpm/tpm_capability.c
>>>>>>>> ++++ b/tpm/tpm_capability.c
>>>>>>>> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *setValue,
>>>>>>>> +                              UINT32 setValueSize, BOOL ownerAuth,
>>>>>>>> +                              BOOL deactivated, BOOL disabled)
>>>>>>>> + {
>>>>>>>> ++  if (tpmData.stany.flags.localityModifier != 8)
>>>>>>>> ++    return TPM_BAD_PARAMETER;
>>>>>>>> +   /* set the capability area with the specified data, on failure
>>>>>>>> +      deactivate the TPM */
>>>>>>>> +   switch (subCap) {
>>>>>>>> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
>>>>>>>> +index 288d1ce..9e1cfb4 100644
>>>>>>>> +--- a/tpm/tpm_cmd_handler.c
>>>>>>>> ++++ b/tpm/tpm_cmd_handler.c
>>>>>>>> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
>>>>>>>> +   tpm_extern_release();
>>>>>>>> + }
>>>>>>>> +
>>>>>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size)
>>>>>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality)
>>>>>>>> + {
>>>>>>>> +   TPM_REQUEST req;
>>>>>>>> +   TPM_RESPONSE rsp;
>>>>>>>> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint3
>>>>>>>> +   UINT32 len;
>>>>>>>> +   BOOL free_out;
>>>>>>>> +
>>>>>>>> +-  debug("tpm_handle_command()");
>>>>>>>> ++  debug("tpm_handle_command(%d)", locality);
>>>>>>>> ++  if (locality != -1)
>>>>>>>> ++    tpmData.stany.flags.localityModifier = locality;
>>>>>>>> +
>>>>>>>> +   /* we need the whole packet at once, otherwise unmarshalling will fail */
>>>>>>>> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) != 0) {
>>>>>>>> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
>>>>>>>> +index eed749e..4c228bd 100644
>>>>>>>> +--- a/tpm/tpm_emulator.h
>>>>>>>> ++++ b/tpm/tpm_emulator.h
>>>>>>>> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
>>>>>>>> +  * its usage. In case of an error, all internally allocated memory
>>>>>>>> +  * is released and the the state of out and out_size is unspecified.
>>>>>>>> +  */
>>>>>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size);
>>>>>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality);
>>>>>>>> +
>>>>>>>> + #endif /* _TPM_EMULATOR_H_ */
>>>>>>>> +
>>>>>>>> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c
>>>>>>>> +index aabe6c3..440a01b 100644
>>>>>>>> +--- a/tpm/tpm_emulator_extern.c
>>>>>>>> ++++ b/tpm/tpm_emulator_extern.c
>>>>>>>> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length) = _tpm_read_fr
>>>>>>>>       #else /* TPM_NO_EXTERN */
>>>>>>>> -
>>>>>>>> +
>>>>>>>>       int (*tpm_extern_init)(void)                                      = NULL;
>>>>>>>>      -int (*tpm_extern_release)(void)                                   = NULL;
>>>>>>>>      +void (*tpm_extern_release)(void)                                   = NULL;
>>>>>>>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>>>>>>>> index c33e078..dcfc3b9 100644
>>>>>>>> --- a/stubdom/vtpm/vtpm.c
>>>>>>>> +++ b/stubdom/vtpm/vtpm.c
>>>>>>>> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>>>>>>>>        static void main_loop(void) {
>>>>>>>>         tpmcmd_t* tpmcmd = NULL;
>>>>>>>> -   domid_t domid;        /* Domid of frontend */
>>>>>>>> -   unsigned int handle;    /* handle of frontend */
>>>>>>>>         int res = -1;
>>>>>>>>           info("VTPM Initializing\n");
>>>>>>>> @@ -162,15 +160,7 @@ static void main_loop(void) {
>>>>>>>>            goto abort_postpcrs;
>>>>>>>>         }
>>>>>>>>      -   /* Wait for the frontend domain to connect */
>>>>>>>> -   info("Waiting for frontend domain to connect..");
>>>>>>>> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
>>>>>>>> -      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
>>>>>>>> -   } else {
>>>>>>>> -      error("Unable to attach to a frontend");
>>>>>>>> -   }
>>>>>>>> -
>>>>>>>> -   tpmcmd = tpmback_req(domid, handle);
>>>>>>>> +   tpmcmd = tpmback_req_any();
>>>>>>>>         while(tpmcmd) {
>>>>>>>>            /* Handle the request */
>>>>>>>>            if(tpmcmd->req_len) {
>>>>>>>> @@ -183,7 +173,7 @@ static void main_loop(void) {
>>>>>>>>               }
>>>>>>>>               /* If not disabled, do the command */
>>>>>>>>               else {
>>>>>>>> -            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
>>>>>>>> +            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) != 0) {
>>>>>>>>                     error("tpm_handle_command() failed");
>>>>>>>>                     create_error_response(tpmcmd, TPM_FAIL);
>>>>>>>>                  }
>>>>>>>> @@ -194,7 +184,7 @@ static void main_loop(void) {
>>>>>>>>            tpmback_resp(tpmcmd);
>>>>>>>>              /* Wait for the next request */
>>>>>>>> -      tpmcmd = tpmback_req(domid, handle);
>>>>>>>> +      tpmcmd = tpmback_req_any();
>>>>>>>>           }
>>>>>>> Before the vtpm would shut down on its own when the host domain disconnects. This occurs because tpmback_req() returns NULL if the frontend disconnected. Using tpmback_req_any(), this is no longer the case which now means the user has to shut down the vtpm manually. How are you handling vtpm shutdown on your end?
>>>>>> When a domain shuts down, "xl destroy" is called on its paired vTPM (by some
>>>>>> scripting that may need to be incorporated into libxl). A graceful shutdown
>>>>>> is not really needed at this point, although it might be needed in the short
>>>>>> term if the save-state operation is not atomic - but a method of recovering
>>>>>> from this type of failure is needed for vTPMs anyway.
>>>>> This is kind of a difficult problem. The save state operation is not by any means atomic and it is very possible that the guest shuts down and xl destroy is called before the save operation completes. This is especially true if the guest is an embedded or even a mini-os domain using tpmfront that shuts down very quickly. Its the reason why now the vtpm shuts itself down after the guest disconnects.
>>>>>
>>>>> What is really needed is a way to do an xl shutdown on mini-os domains to let vtpm-stubdom shutdown correctly. From what I understand there is not yet any support for this in mini-os. How tricky would it be to add that? Samuel any ideas?
>>>>>
>>>>> If thats not possible, another potential hack could be writing a key in xenstore to trigger the shutdown or setting up some other kind of event channel mechanism between the vtpm domain and libxl.
>>>>>
>>>> I have approached this problem from the opposite direction, while looking at
>>>> adding protection from vTPM state rollback. The method that I am currently
>>>> considering is to have two "slots" in the vTPM disk image - one active and
>>>> and one inactive. The save process would then consist of writing a new save
>>>> state to the inactive slot, ensuring it has been committed to disk, and then
>>>> requesting the TPM Manager atomically update the state encryption key to the
>>>> new value. When loading, the key obtained from the TPM manager will only be
>>>> able to decrypt one of the two state images; the successful one is the active
>>>> image. Since the vTPM's saved state is not expected to be very large, this
>>>> doesn't waste a significant amount of disk space.
>>>>
>>> I like that idea in general, but it still doesn't solve the shutdown race condition. You might not get a corrupted disk but you can still get inadvertently rolled back. Adding a xenstore watch as samuel suggested and doing a clean shutdown would be ideal.
>>   If you run the save before you send back the TPM response, you won't have any
>> races - if a domain dies without getting a TPM response, the it's valid for
>> the command to not have completed. The TPM emulator does execute the save
>> prior to returning the result packet, so this race is already avoided.
>>
>> That's not to say that handling shutdowns properly is useless, of course; other
>> minios domains may need it, and a graceful shutdown is easier to clean up after
>> if not all peers of the vTPM are shutting down at the same time.
> Ok I follow you now. Do you already have patches to do the disk mirroring and destroy the vtpm from libxl? I think we will want to include this so these new features don't break the automatic vtpm shutdown model already in place.
> 

No, I haven't implemented either of those yet. The destroy that I'm using is not
based on libxl (it assumes both the vtpm and client domain are being created by a
dedicated domain-builder domain, and so don't have a libxl watcher process).

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 20:40:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 20:40:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdRxC-0002ws-1K; Tue, 27 Nov 2012 20:40:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdRxA-0002wm-Q5
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 20:40:25 +0000
Received: from [85.158.137.99:60819] by server-14.bemta-3.messagelabs.com id
	EE/4C-31424-33525B05; Tue, 27 Nov 2012 20:40:19 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-13.tower-217.messagelabs.com!1354048817!20872255!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13936 invoked from network); 27 Nov 2012 20:40:18 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-13.tower-217.messagelabs.com with SMTP;
	27 Nov 2012 20:40:18 -0000
X-TM-IMSS-Message-ID: <c242e5be000350d3@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id c242e5be000350d3 ;
	Tue, 27 Nov 2012 15:39:15 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARKe4I9029608; 
	Tue, 27 Nov 2012 15:40:04 -0500
Message-ID: <50B52524.6030707@tycho.nsa.gov>
Date: Tue, 27 Nov 2012 15:40:04 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B5042B.7000602@jhuapl.edu> <50B50E3E.6050807@tycho.nsa.gov>
	<50B5190D.20604@jhuapl.edu> <50B51E79.2090308@tycho.nsa.gov>
	<50B520D6.2090602@jhuapl.edu> <50B522E0.6090903@tycho.nsa.gov>
	<50B523EC.6070300@jhuapl.edu>
In-Reply-To: <50B523EC.6070300@jhuapl.edu>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/27/2012 03:34 PM, Matthew Fioravante wrote:
> On 11/27/2012 03:30 PM, Daniel De Graaf wrote:
>> On 11/27/2012 03:21 PM, Matthew Fioravante wrote:
>>> On 11/27/2012 03:11 PM, Daniel De Graaf wrote:
>>>> On 11/27/2012 02:48 PM, Matthew Fioravante wrote:
>>>>> On 11/27/2012 02:02 PM, Daniel De Graaf wrote:
>>>>>> On 11/27/2012 01:19 PM, Matthew Fioravante wrote:
>>>>>>> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>>>>>>>> The vTPM protocol now contains a field allowing the locality of a
>>>>>>>> command to be specified; pass this to the TPM when processing a packet.
>>>>>>>> This also enables a single vTPM to provide multiple tpmback interfaces
>>>>>>>> so that several closely related domains can share a vTPM (for example, a
>>>>>>>> qemu device stubdom and its target domain).
>>>>>>>>
>>>>>>>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>>>>>>> ---
>>>>>>>>      stubdom/tpmemu-0.7.4.patch | 61 ++++++++++++++++++++++++++++++++++++++++++----
>>>>>>>>      stubdom/vtpm/vtpm.c        | 16 +++---------
>>>>>>>>      2 files changed, 59 insertions(+), 18 deletions(-)
>>>>>>>>
>>>>>>>> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
>>>>>>>> index b84eff1..31ace1a 100644
>>>>>>>> --- a/stubdom/tpmemu-0.7.4.patch
>>>>>>>> +++ b/stubdom/tpmemu-0.7.4.patch
>>>>>>>> @@ -1,9 +1,60 @@
>>>>>>>> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
>>>>>>>> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c    2012-04-27 10:55:46.581963398 -0400
>>>>>>>> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c    2012-04-27 10:56:02.193034152 -0400
>>>>>>>> -@@ -249,7 +249,7 @@
>>>>>>>> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
>>>>>>>> +index 60bbb90..f8f7f0f 100644
>>>>>>>> +--- a/tpm/tpm_capability.c
>>>>>>>> ++++ b/tpm/tpm_capability.c
>>>>>>>> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *setValue,
>>>>>>>> +                              UINT32 setValueSize, BOOL ownerAuth,
>>>>>>>> +                              BOOL deactivated, BOOL disabled)
>>>>>>>> + {
>>>>>>>> ++  if (tpmData.stany.flags.localityModifier != 8)
>>>>>>>> ++    return TPM_BAD_PARAMETER;
>>>>>>>> +   /* set the capability area with the specified data, on failure
>>>>>>>> +      deactivate the TPM */
>>>>>>>> +   switch (subCap) {
>>>>>>>> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
>>>>>>>> +index 288d1ce..9e1cfb4 100644
>>>>>>>> +--- a/tpm/tpm_cmd_handler.c
>>>>>>>> ++++ b/tpm/tpm_cmd_handler.c
>>>>>>>> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
>>>>>>>> +   tpm_extern_release();
>>>>>>>> + }
>>>>>>>> +
>>>>>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size)
>>>>>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality)
>>>>>>>> + {
>>>>>>>> +   TPM_REQUEST req;
>>>>>>>> +   TPM_RESPONSE rsp;
>>>>>>>> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint3
>>>>>>>> +   UINT32 len;
>>>>>>>> +   BOOL free_out;
>>>>>>>> +
>>>>>>>> +-  debug("tpm_handle_command()");
>>>>>>>> ++  debug("tpm_handle_command(%d)", locality);
>>>>>>>> ++  if (locality != -1)
>>>>>>>> ++    tpmData.stany.flags.localityModifier = locality;
>>>>>>>> +
>>>>>>>> +   /* we need the whole packet at once, otherwise unmarshalling will fail */
>>>>>>>> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) != 0) {
>>>>>>>> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
>>>>>>>> +index eed749e..4c228bd 100644
>>>>>>>> +--- a/tpm/tpm_emulator.h
>>>>>>>> ++++ b/tpm/tpm_emulator.h
>>>>>>>> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
>>>>>>>> +  * its usage. In case of an error, all internally allocated memory
>>>>>>>> +  * is released and the the state of out and out_size is unspecified.
>>>>>>>> +  */
>>>>>>>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size);
>>>>>>>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality);
>>>>>>>> +
>>>>>>>> + #endif /* _TPM_EMULATOR_H_ */
>>>>>>>> +
>>>>>>>> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c
>>>>>>>> +index aabe6c3..440a01b 100644
>>>>>>>> +--- a/tpm/tpm_emulator_extern.c
>>>>>>>> ++++ b/tpm/tpm_emulator_extern.c
>>>>>>>> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length) = _tpm_read_fr
>>>>>>>>       #else /* TPM_NO_EXTERN */
>>>>>>>> -
>>>>>>>> +
>>>>>>>>       int (*tpm_extern_init)(void)                                      = NULL;
>>>>>>>>      -int (*tpm_extern_release)(void)                                   = NULL;
>>>>>>>>      +void (*tpm_extern_release)(void)                                   = NULL;
>>>>>>>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>>>>>>>> index c33e078..dcfc3b9 100644
>>>>>>>> --- a/stubdom/vtpm/vtpm.c
>>>>>>>> +++ b/stubdom/vtpm/vtpm.c
>>>>>>>> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>>>>>>>>        static void main_loop(void) {
>>>>>>>>         tpmcmd_t* tpmcmd = NULL;
>>>>>>>> -   domid_t domid;        /* Domid of frontend */
>>>>>>>> -   unsigned int handle;    /* handle of frontend */
>>>>>>>>         int res = -1;
>>>>>>>>           info("VTPM Initializing\n");
>>>>>>>> @@ -162,15 +160,7 @@ static void main_loop(void) {
>>>>>>>>            goto abort_postpcrs;
>>>>>>>>         }
>>>>>>>>      -   /* Wait for the frontend domain to connect */
>>>>>>>> -   info("Waiting for frontend domain to connect..");
>>>>>>>> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
>>>>>>>> -      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
>>>>>>>> -   } else {
>>>>>>>> -      error("Unable to attach to a frontend");
>>>>>>>> -   }
>>>>>>>> -
>>>>>>>> -   tpmcmd = tpmback_req(domid, handle);
>>>>>>>> +   tpmcmd = tpmback_req_any();
>>>>>>>>         while(tpmcmd) {
>>>>>>>>            /* Handle the request */
>>>>>>>>            if(tpmcmd->req_len) {
>>>>>>>> @@ -183,7 +173,7 @@ static void main_loop(void) {
>>>>>>>>               }
>>>>>>>>               /* If not disabled, do the command */
>>>>>>>>               else {
>>>>>>>> -            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
>>>>>>>> +            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) != 0) {
>>>>>>>>                     error("tpm_handle_command() failed");
>>>>>>>>                     create_error_response(tpmcmd, TPM_FAIL);
>>>>>>>>                  }
>>>>>>>> @@ -194,7 +184,7 @@ static void main_loop(void) {
>>>>>>>>            tpmback_resp(tpmcmd);
>>>>>>>>              /* Wait for the next request */
>>>>>>>> -      tpmcmd = tpmback_req(domid, handle);
>>>>>>>> +      tpmcmd = tpmback_req_any();
>>>>>>>>           }
>>>>>>> Before the vtpm would shut down on its own when the host domain disconnects. This occurs because tpmback_req() returns NULL if the frontend disconnected. Using tpmback_req_any(), this is no longer the case which now means the user has to shut down the vtpm manually. How are you handling vtpm shutdown on your end?
>>>>>> When a domain shuts down, "xl destroy" is called on its paired vTPM (by some
>>>>>> scripting that may need to be incorporated into libxl). A graceful shutdown
>>>>>> is not really needed at this point, although it might be needed in the short
>>>>>> term if the save-state operation is not atomic - but a method of recovering
>>>>>> from this type of failure is needed for vTPMs anyway.
>>>>> This is kind of a difficult problem. The save state operation is not by any means atomic and it is very possible that the guest shuts down and xl destroy is called before the save operation completes. This is especially true if the guest is an embedded or even a mini-os domain using tpmfront that shuts down very quickly. Its the reason why now the vtpm shuts itself down after the guest disconnects.
>>>>>
>>>>> What is really needed is a way to do an xl shutdown on mini-os domains to let vtpm-stubdom shutdown correctly. From what I understand there is not yet any support for this in mini-os. How tricky would it be to add that? Samuel any ideas?
>>>>>
>>>>> If thats not possible, another potential hack could be writing a key in xenstore to trigger the shutdown or setting up some other kind of event channel mechanism between the vtpm domain and libxl.
>>>>>
>>>> I have approached this problem from the opposite direction, while looking at
>>>> adding protection from vTPM state rollback. The method that I am currently
>>>> considering is to have two "slots" in the vTPM disk image - one active and
>>>> and one inactive. The save process would then consist of writing a new save
>>>> state to the inactive slot, ensuring it has been committed to disk, and then
>>>> requesting the TPM Manager atomically update the state encryption key to the
>>>> new value. When loading, the key obtained from the TPM manager will only be
>>>> able to decrypt one of the two state images; the successful one is the active
>>>> image. Since the vTPM's saved state is not expected to be very large, this
>>>> doesn't waste a significant amount of disk space.
>>>>
>>> I like that idea in general, but it still doesn't solve the shutdown race condition. You might not get a corrupted disk but you can still get inadvertently rolled back. Adding a xenstore watch as samuel suggested and doing a clean shutdown would be ideal.
>>   If you run the save before you send back the TPM response, you won't have any
>> races - if a domain dies without getting a TPM response, the it's valid for
>> the command to not have completed. The TPM emulator does execute the save
>> prior to returning the result packet, so this race is already avoided.
>>
>> That's not to say that handling shutdowns properly is useless, of course; other
>> minios domains may need it, and a graceful shutdown is easier to clean up after
>> if not all peers of the vTPM are shutting down at the same time.
> Ok I follow you now. Do you already have patches to do the disk mirroring and destroy the vtpm from libxl? I think we will want to include this so these new features don't break the automatic vtpm shutdown model already in place.
> 

No, I haven't implemented either of those yet. The destroy that I'm using is not
based on libxl (it assumes both the vtpm and client domain are being created by a
dedicated domain-builder domain, and so don't have a libxl watcher process).

-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 21:25:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 21:25:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdSe1-0003x4-4Q; Tue, 27 Nov 2012 21:24:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TdSe0-0003wz-1X
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 21:24:40 +0000
Received: from [85.158.137.99:39490] by server-5.bemta-3.messagelabs.com id
	F0/2A-26311-79F25B05; Tue, 27 Nov 2012 21:24:39 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1354051477!16077662!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NzUxMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13431 invoked from network); 27 Nov 2012 21:24:38 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 21:24:38 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qARLOZ7R000843
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 21:24:36 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qARLOYcB004463
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 21:24:35 GMT
Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qARLOYrT004947
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 15:24:34 -0600
MIME-Version: 1.0
Message-ID: <990a88d4-f0f8-427a-bb66-3beda4641186@default>
Date: Tue, 27 Nov 2012 13:24:33 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: xen-devel@lists.xen.org
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Kurt Hackel <kurt.hackel@oracle.com>, Konrad Wilk <konrad.wilk@oracle.com>
Subject: [Xen-devel] ANNOUNCE: Xen Transcendent Memory support now in stock
 Ubuntu and Fedora guest kernels
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

FYI, it has come to my attention that both the kernel in the
recently-released Ubuntu 12.10 (aka Quantal Quetzal) and the
kernel in Fedora 17 (after yum-update to a 3.5-or-later kernel)
are fully configured to support Transcendent Memory ("tmem").
Oracle's "UEK2" kernel has also had tmem support since its release
in early 2012.

To enable tmem support in Xen, it is necessary to specify
a Xen boot parameter ("tmem").  Specifying "dom0_mem="
and disabling dom0 autoballooning in the toolstack is also
highly recommended.  Then tmem must be explicitly enabled in
any tmem-capable guest kernel by specifying a boot parameter
(also "tmem") in each guest grub.conf.  Note that use of
tmem in dom0 is not recommended, so "tmem" should not be
provided as a dom0 boot parameter.

I'll try to write up a more complete current HOW-TO soon
since much of the Xen tmem documentation floating around
the web is a bit outdated.

Note that some security issues were reported in the
Xen hypervisor tmem implementation last summer.  Please
ensure your hypervisor is updated to patch XSA-15 before
enabling tmem on a Xen machine exposed to the internet!

Thanks,
Dan

P.S. If you build your own Linux guest kernels, a 3.5-or-later
kernel is required built with the following config variables:

CONFIG_FRONTSWAP=y
CONFIG_CLEANCACHE=y
CONFIG_XEN_TMEM=y
CONFIG_XEN_SELFBALLOONING=y


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 21:25:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 21:25:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdSe1-0003x4-4Q; Tue, 27 Nov 2012 21:24:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TdSe0-0003wz-1X
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 21:24:40 +0000
Received: from [85.158.137.99:39490] by server-5.bemta-3.messagelabs.com id
	F0/2A-26311-79F25B05; Tue, 27 Nov 2012 21:24:39 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1354051477!16077662!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NzUxMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13431 invoked from network); 27 Nov 2012 21:24:38 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 21:24:38 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qARLOZ7R000843
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 21:24:36 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qARLOYcB004463
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 21:24:35 GMT
Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qARLOYrT004947
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 15:24:34 -0600
MIME-Version: 1.0
Message-ID: <990a88d4-f0f8-427a-bb66-3beda4641186@default>
Date: Tue, 27 Nov 2012 13:24:33 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: xen-devel@lists.xen.org
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Kurt Hackel <kurt.hackel@oracle.com>, Konrad Wilk <konrad.wilk@oracle.com>
Subject: [Xen-devel] ANNOUNCE: Xen Transcendent Memory support now in stock
 Ubuntu and Fedora guest kernels
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

FYI, it has come to my attention that both the kernel in the
recently-released Ubuntu 12.10 (aka Quantal Quetzal) and the
kernel in Fedora 17 (after yum-update to a 3.5-or-later kernel)
are fully configured to support Transcendent Memory ("tmem").
Oracle's "UEK2" kernel has also had tmem support since its release
in early 2012.

To enable tmem support in Xen, it is necessary to specify
a Xen boot parameter ("tmem").  Specifying "dom0_mem="
and disabling dom0 autoballooning in the toolstack is also
highly recommended.  Then tmem must be explicitly enabled in
any tmem-capable guest kernel by specifying a boot parameter
(also "tmem") in each guest grub.conf.  Note that use of
tmem in dom0 is not recommended, so "tmem" should not be
provided as a dom0 boot parameter.

I'll try to write up a more complete current HOW-TO soon
since much of the Xen tmem documentation floating around
the web is a bit outdated.

Note that some security issues were reported in the
Xen hypervisor tmem implementation last summer.  Please
ensure your hypervisor is updated to patch XSA-15 before
enabling tmem on a Xen machine exposed to the internet!

Thanks,
Dan

P.S. If you build your own Linux guest kernels, a 3.5-or-later
kernel is required built with the following config variables:

CONFIG_FRONTSWAP=y
CONFIG_CLEANCACHE=y
CONFIG_XEN_TMEM=y
CONFIG_XEN_SELFBALLOONING=y


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 21:30:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 21:30:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdSjN-00044h-UO; Tue, 27 Nov 2012 21:30:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TdSjL-00044b-Dv
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 21:30:11 +0000
Received: from [85.158.137.99:62750] by server-5.bemta-3.messagelabs.com id
	6B/6D-26311-2E035B05; Tue, 27 Nov 2012 21:30:10 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354051807!16988035!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21147 invoked from network); 27 Nov 2012 21:30:08 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-4.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 21:30:08 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158216954;
	Tue, 27 Nov 2012 16:30:00 -0500
Message-ID: <50B530D2.1060303@jhuapl.edu>
Date: Tue, 27 Nov 2012 16:29:54 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-2-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1354029286-17652-2-git-send-email-dgdegra@tycho.nsa.gov>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/4] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5802916327764324978=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============5802916327764324978==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms000804060409010209010201"

This is a cryptographically signed message in MIME format.

--------------ms000804060409010209010201
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

I can't get this patch to apply. It looks like your editor or something=20
else is converting tabs to whitespace. For instance the line in tpmback.h=


     domid_t domid;              /* Domid of the frontend */

has tabs between domid; and /*. It looks like this also happened to your =

linux patch.


On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
> This changes the vTPM shared page ABI from a copy of the Xen network
> interface to a single-page interface that better reflects the expected
> behavior of a TPM: only a single request packet can be sent at any give=
n
> time, and every packet sent generates a single response packet. This
> protocol change should also increase efficiency as it avoids mapping an=
d
> unmapping grants when possible.
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>   extras/mini-os/include/tpmback.h  |   1 +
>   extras/mini-os/include/tpmfront.h |   7 +-
>   extras/mini-os/tpmback.c          | 159 +++++++++++++++++++----------=
--------
>   extras/mini-os/tpmfront.c         | 162 ++++++++++++++++++++++-------=
---------
>   xen/include/public/io/tpmif.h     |  45 +++--------
>   5 files changed, 191 insertions(+), 183 deletions(-)
>
> diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/=
tpmback.h
> index ff86732..ec9eda4 100644
> --- a/extras/mini-os/include/tpmback.h
> +++ b/extras/mini-os/include/tpmback.h
> @@ -43,6 +43,7 @@
>
>   struct tpmcmd {
>      domid_t domid;              /* Domid of the frontend */
> +   uint8_t locality;    /* Locality requested by the frontend */
>      unsigned int handle;        /* Handle of the frontend */
>      unsigned char uuid[16];                     /* uuid of the tpm int=
erface */
>
> diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include=
/tpmfront.h
> index fd2cb17..a0c7c4d 100644
> --- a/extras/mini-os/include/tpmfront.h
> +++ b/extras/mini-os/include/tpmfront.h
> @@ -37,9 +37,7 @@ struct tpmfront_dev {
>      grant_ref_t ring_ref;
>      evtchn_port_t evtchn;
>
> -   tpmif_tx_interface_t* tx;
> -
> -   void** pages;
> +   vtpm_shared_page_t *page;
>
>      domid_t bedomid;
>      char* nodename;
> @@ -77,6 +75,9 @@ void shutdown_tpmfront(struct tpmfront_dev* dev);
>    * */
>   int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqle=
n, uint8_t** resp, size_t* resplen);
>
> +/* Set the locality used for communicating with a vTPM */
> +int tpmfront_set_locality(struct tpmfront_dev* dev, int locality);
> +
>   #ifdef HAVE_LIBC
>   #include <sys/stat.h>
>   /* POSIX IO functions:
> diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
> index 658fed1..2d31061 100644
> --- a/extras/mini-os/tpmback.c
> +++ b/extras/mini-os/tpmback.c
> @@ -86,10 +86,7 @@ struct tpmif {
>      evtchn_port_t evtchn;
>
>      /* Shared page */
> -   tpmif_tx_interface_t* tx;
> -
> -   /* pointer to TPMIF_RX_RING_SIZE pages */
> -   void** pages;
> +   vtpm_shared_page_t *page;
>
>      enum xenbus_state state;
>      enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
> @@ -266,6 +263,7 @@ int insert_tpmif(tpmif_t* tpmif)
>      unsigned int i, j;
>      tpmif_t* tmp;
>      char* err;
> +   char path[512];
>
>      local_irq_save(flags);
>
> @@ -303,6 +301,16 @@ int insert_tpmif(tpmif_t* tpmif)
>
>      local_irq_restore(flags);
>
> +   snprintf(path, 512, "backend/vtpm/%u/%u/feature-protocol-v2", (unsi=
gned int) tpmif->domid, tpmif->handle);
> +   if ((err =3D xenbus_write(XBT_NIL, path, "1")))
> +   {
> +      /* if we got an error here we should carefully remove the interf=
ace and then return */
> +      TPMBACK_ERR("Unable to write feature-protocol-v2 node: %s\n", er=
r);
> +      free(err);
> +      remove_tpmif(tpmif);
> +      goto error_post_irq;
> +   }
> +
>      /*Listen for state changes on the new interface */
>      if((err =3D xenbus_watch_path_token(XBT_NIL, tpmif->fe_state_path,=
 tpmif->fe_state_path, &gtpmdev.events)))
>      {
> @@ -312,7 +320,6 @@ int insert_tpmif(tpmif_t* tpmif)
>         remove_tpmif(tpmif);
>         goto error_post_irq;
>      }
> -
>      return 0;
>   error:
>      local_irq_restore(flags);
> @@ -386,8 +393,7 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigne=
d int handle)
>      tpmif->fe_state_path =3D NULL;
>      tpmif->state =3D XenbusStateInitialising;
>      tpmif->status =3D DISCONNECTED;
> -   tpmif->tx =3D NULL;
> -   tpmif->pages =3D NULL;
> +   tpmif->page =3D NULL;
>      tpmif->flags =3D 0;
>      memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
>      return tpmif;
> @@ -395,9 +401,6 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigne=
d int handle)
>
>   void __free_tpmif(tpmif_t* tpmif)
>   {
> -   if(tpmif->pages) {
> -      free(tpmif->pages);
> -   }
>      if(tpmif->fe_path) {
>         free(tpmif->fe_path);
>      }
> @@ -430,12 +433,6 @@ tpmif_t* new_tpmif(domid_t domid, unsigned int han=
dle)
>         goto error;
>      }
>
> -   /* allocate pages to be used for shared mapping */
> -   if((tpmif->pages =3D malloc(sizeof(void*) * TPMIF_TX_RING_SIZE)) =3D=
=3D NULL) {
> -      goto error;
> -   }
> -   memset(tpmif->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
> -
>      if(tpmif_change_state(tpmif, XenbusStateInitWait)) {
>         goto error;
>      }
> @@ -486,7 +483,7 @@ void free_tpmif(tpmif_t* tpmif)
>         tpmif->status =3D DISCONNECTING;
>         mask_evtchn(tpmif->evtchn);
>
> -      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1)) {
> +      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {=

>           TPMBACK_ERR("%u/%u Error occured while trying to unmap shared=
 page\n", (unsigned int) tpmif->domid, tpmif->handle);
>         }
>
> @@ -529,9 +526,10 @@ void free_tpmif(tpmif_t* tpmif)
>   void tpmback_handler(evtchn_port_t port, struct pt_regs *regs, void *=
data)
>   {
>      tpmif_t* tpmif =3D (tpmif_t*) data;
> -   tpmif_tx_request_t* tx =3D &tpmif->tx->ring[0].req;
> -   /* Throw away 0 size events, these can trigger from event channel u=
nmasking */
> -   if(tx->size =3D=3D 0)
> +   vtpm_shared_page_t* pg =3D tpmif->page;
> +
> +   /* Only pay attention if the request is ready */
> +   if (pg->state =3D=3D 0)
>         return;
>
>      TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->=
domid, tpmif->handle);
> @@ -584,12 +582,26 @@ int connect_fe(tpmif_t* tpmif)
>      }
>      free(value);
>
> +   /* Check that protocol v2 is being used */
> +   snprintf(path, 512, "%s/feature-protocol-v2", tpmif->fe_path);
> +   if((err =3D xenbus_read(XBT_NIL, path, &value))) {
> +      TPMBACK_ERR("Unable to read %s during tpmback initialization! er=
ror =3D %s\n", path, err);
> +      free(err);
> +      return -1;
> +   }
> +   if(strcmp(value, "1")) {
> +      TPMBACK_ERR("%s has an invalid value (%s)\n", path, value);
> +      free(value);
> +      return -1;
> +   }
> +   free(value);
> +
> +
>      domid =3D tpmif->domid;
> -   if((tpmif->tx =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0,=
 &ringref, PROT_READ | PROT_WRITE)) =3D=3D NULL) {
> +   if((tpmif->page =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, =
0, &ringref, PROT_READ | PROT_WRITE)) =3D=3D NULL) {
>         TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned =
int) tpmif->domid, tpmif->handle);
>         return -1;
>      }
> -   memset(tpmif->tx, 0, PAGE_SIZE);
>
>      /*Bind the event channel */
>      if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler,=
 tpmif, &tpmif->evtchn)))
> @@ -618,10 +630,28 @@ error_post_evtchn:
>      mask_evtchn(tpmif->evtchn);
>      unbind_evtchn(tpmif->evtchn);
>   error_post_map:
> -   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1);
> +   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1);
>      return -1;
>   }
>
> +static void disconnect_fe(tpmif_t* tpmif)
> +{
> +   if (tpmif->status =3D=3D CONNECTED) {
> +      tpmif->status =3D DISCONNECTING;
> +      mask_evtchn(tpmif->evtchn);
> +
> +      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {=

> +        TPMBACK_ERR("%u/%u Error occured while trying to unmap shared =
page\n", (unsigned int) tpmif->domid, tpmif->handle);
> +      }
> +
> +      unbind_evtchn(tpmif->evtchn);
> +   }
> +   tpmif->status =3D DISCONNECTED;
> +   tpmif_change_state(tpmif, XenbusStateReconfigured);
> +
> +   TPMBACK_LOG("Frontend %u/%u disconnected\n", (unsigned int) tpmif->=
domid, tpmif->handle);
> +}
> +
>   static int frontend_changed(tpmif_t* tpmif)
>   {
>      int state =3D xenbus_read_integer(tpmif->fe_state_path);
> @@ -874,6 +904,7 @@ void shutdown_tpmback(void)
>   inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int=
 handle, unsigned char uuid[16])
>   {
>      tpmcmd->domid =3D domid;
> +   tpmcmd->locality =3D -1;
>      tpmcmd->handle =3D handle;
>      memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
>      tpmcmd->req =3D NULL;
> @@ -884,12 +915,12 @@ inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t=
 domid, unsigned int handle, un
>
>   tpmcmd_t* get_request(tpmif_t* tpmif) {
>      tpmcmd_t* cmd;
> -   tpmif_tx_request_t* tx;
> -   int offset;
> -   int tocopy;
> -   int i;
> -   uint32_t domid;
> +   vtpm_shared_page_t* shr;
> +   unsigned int offset;
>      int flags;
> +#ifdef TPMBACK_PRINT_DEBUG
> +   int i;
> +#endif
>
>      local_irq_save(flags);
>
> @@ -899,35 +930,22 @@ tpmcmd_t* get_request(tpmif_t* tpmif) {
>      }
>      init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);
>
> -   tx =3D &tpmif->tx->ring[0].req;
> -   cmd->req_len =3D tx->size;
> +   shr =3D tpmif->page;
> +   cmd->req_len =3D shr->length;
> +   cmd->locality =3D shr->locality;
> +   offset =3D sizeof(*shr) + 4*shr->nr_extra_pages;
> +   if (offset > PAGE_SIZE || offset + cmd->req_len > PAGE_SIZE) {
> +      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (u=
nsigned int) tpmif->domid, tpmif->handle);
> +      goto error;
> +   }
>      /* Allocate the buffer */
>      if(cmd->req_len) {
>         if((cmd->req =3D malloc(cmd->req_len)) =3D=3D NULL) {
>           goto error;
>         }
>      }
> -   /* Copy the bits from the shared pages */
> -   offset =3D 0;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && offset < cmd->req_len; ++i) =
{
> -      tx =3D &tpmif->tx->ring[i].req;
> -
> -      /* Map the page with the data */
> -      domid =3D (uint32_t)tpmif->domid;
> -      if((tpmif->pages[i] =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &=
domid, 0, &tx->ref, PROT_READ)) =3D=3D NULL) {
> -        TPMBACK_ERR("%u/%u Unable to map shared page during read!\n", =
(unsigned int) tpmif->domid, tpmif->handle);
> -        goto error;
> -      }
> -
> -      /* do the copy now */
> -      tocopy =3D min(cmd->req_len - offset, PAGE_SIZE);
> -      memcpy(&cmd->req[offset], tpmif->pages[i], tocopy);
> -      offset +=3D tocopy;
> -
> -      /* release the page */
> -      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
> -
> -   }
> +   /* Copy the bits from the shared page(s) */
> +   memcpy(cmd->req, offset + (uint8_t*)shr, cmd->req_len);
>
>   #ifdef TPMBACK_PRINT_DEBUG
>      TPMBACK_DEBUG("Received Tpm Command from %u/%u of size %u", (unsig=
ned int) tpmif->domid, tpmif->handle, cmd->req_len);
> @@ -958,38 +976,24 @@ error:
>
>   void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
>   {
> -   tpmif_tx_request_t* tx;
> -   int offset;
> -   int i;
> -   uint32_t domid;
> -   int tocopy;
> +   vtpm_shared_page_t* shr;
> +   unsigned int offset;
>      int flags;
> +#ifdef TPMBACK_PRINT_DEBUG
> +int i;
> +#endif
>
>      local_irq_save(flags);
>
> -   tx =3D &tpmif->tx->ring[0].req;
> -   tx->size =3D cmd->resp_len;
> -
> -   offset =3D 0;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && offset < cmd->resp_len; ++i)=
 {
> -      tx =3D &tpmif->tx->ring[i].req;
> -
> -      /* Map the page with the data */
> -      domid =3D (uint32_t)tpmif->domid;
> -      if((tpmif->pages[i] =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &=
domid, 0, &tx->ref, PROT_WRITE)) =3D=3D NULL) {
> -        TPMBACK_ERR("%u/%u Unable to map shared page during write!\n",=
 (unsigned int) tpmif->domid, tpmif->handle);
> -        goto error;
> -      }
> -
> -      /* do the copy now */
> -      tocopy =3D min(cmd->resp_len - offset, PAGE_SIZE);
> -      memcpy(tpmif->pages[i], &cmd->resp[offset], tocopy);
> -      offset +=3D tocopy;
> -
> -      /* release the page */
> -      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
> +   shr =3D tpmif->page;
> +   shr->length =3D cmd->resp_len;
>
> +   offset =3D sizeof(*shr) + 4*shr->nr_extra_pages;
> +   if (offset > PAGE_SIZE || offset + cmd->resp_len > PAGE_SIZE) {
> +      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (u=
nsigned int) tpmif->domid, tpmif->handle);
> +      goto error;
>      }
> +   memcpy(offset + (uint8_t*)shr, cmd->resp, cmd->resp_len);
>
>   #ifdef TPMBACK_PRINT_DEBUG
>      TPMBACK_DEBUG("Sent response to %u/%u of size %u", (unsigned int) =
tpmif->domid, tpmif->handle, cmd->resp_len);
> @@ -1003,6 +1007,7 @@ void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)=

>   #endif
>      /* clear the ready flag and send the event channel notice to the f=
rontend */
>      tpmif_req_finished(tpmif);
> +   shr->state =3D 0;
>      notify_remote_via_evtchn(tpmif->evtchn);
>   error:
>      local_irq_restore(flags);
> diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
> index 0218d7f..c1cbab3 100644
> --- a/extras/mini-os/tpmfront.c
> +++ b/extras/mini-os/tpmfront.c
> @@ -153,6 +153,32 @@ static int wait_for_backend_closed(xenbus_event_qu=
eue* events, char* path)
>
>   }
>
> +static int wait_for_backend_reconfig(xenbus_event_queue* events, char*=
 path)
> +{
> +   int state;
> +
> +   TPMFRONT_LOG("Waiting for backend to reconfigure...\n");
> +   while(1) {
> +      state =3D xenbus_read_integer(path);
> +      if ( state < 0)
> +        state =3D XenbusStateUnknown;
> +      switch(state) {
> +        case XenbusStateUnknown:
> +           TPMFRONT_ERR("Backend Unknown state, forcing shutdown\n");
> +           return -1;
> +        case XenbusStateClosed:
> +           TPMFRONT_LOG("Backend Closed\n");
> +           return 0;
> +        case XenbusStateReconfigured:
> +           TPMFRONT_LOG("Backend Reconfigured\n");
> +           return 0;
> +        default:
> +           xenbus_wait_for_watch(events);
> +      }
> +   }
> +
> +}
> +
>   static int wait_for_backend_state_changed(struct tpmfront_dev* dev, X=
enbusState state) {
>      char* err;
>      int ret =3D 0;
> @@ -175,8 +201,11 @@ static int wait_for_backend_state_changed(struct t=
pmfront_dev* dev, XenbusState
>         case XenbusStateClosed:
>           ret =3D wait_for_backend_closed(&events, path);
>           break;
> -      default:
> +      case XenbusStateReconfigured:
> +        ret =3D wait_for_backend_reconfig(&events, path);
>           break;
> +      default:
> +         TPMFRONT_ERR("Bad wait state %d, ignoring\n", state);
>      }
>
>      if((err =3D xenbus_unwatch_path_token(XBT_NIL, path, path))) {
> @@ -190,13 +219,13 @@ static int tpmfront_connect(struct tpmfront_dev* =
dev)
>   {
>      char* err;
>      /* Create shared page */
> -   dev->tx =3D (tpmif_tx_interface_t*) alloc_page();
> -   if(dev->tx =3D=3D NULL) {
> +   dev->page =3D (vtpm_shared_page_t*) alloc_page();
> +   if(dev->page =3D=3D NULL) {
>         TPMFRONT_ERR("Unable to allocate page for shared memory\n");
>         goto error;
>      }
> -   memset(dev->tx, 0, PAGE_SIZE);
> -   dev->ring_ref =3D gnttab_grant_access(dev->bedomid, virt_to_mfn(dev=
->tx), 0);
> +   memset(dev->page, 0, PAGE_SIZE);
> +   dev->ring_ref =3D gnttab_grant_access(dev->bedomid, virt_to_mfn(dev=
->page), 0);
>      TPMFRONT_DEBUG("grant ref is %lu\n", (unsigned long) dev->ring_ref=
);
>
>      /*Create event channel */
> @@ -228,7 +257,7 @@ error_postevtchn:
>         unbind_evtchn(dev->evtchn);
>   error_postmap:
>         gnttab_end_access(dev->ring_ref);
> -      free_page(dev->tx);
> +      free_page(dev->page);
>   error:
>      return -1;
>   }
> @@ -240,7 +269,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nod=
ename)
>      char path[512];
>      char* value, *err;
>      unsigned long long ival;
> -   int i;
>
>      printk("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Init TPM Front =3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n");
>
> @@ -279,6 +307,15 @@ struct tpmfront_dev* init_tpmfront(const char* _no=
dename)
>         goto error;
>      }
>
> +   /* Publish protocol v2 feature */
> +   snprintf(path, 512, "%s/feature-protocol-v2", dev->nodename);
> +   if ((err =3D xenbus_write(XBT_NIL, path, "1")))
> +   {
> +      TPMFRONT_ERR("Unable to write feature-protocol-v2 node: %s\n", e=
rr);
> +         free(err);
> +      goto error;
> +   }
> +
>      /* Create and publish grant reference and event channel */
>      if (tpmfront_connect(dev)) {
>         goto error;
> @@ -289,18 +326,18 @@ struct tpmfront_dev* init_tpmfront(const char* _n=
odename)
>         goto error;
>      }
>
> -   /* Allocate pages that will contain the messages */
> -   dev->pages =3D malloc(sizeof(void*) * TPMIF_TX_RING_SIZE);
> -   if(dev->pages =3D=3D NULL) {
> +   snprintf(path, 512, "%s/feature-protocol-v2", dev->bepath);
> +   if((err =3D xenbus_read(XBT_NIL, path, &value))) {
> +      TPMFRONT_ERR("Unable to read %s during tpmfront initialization! =
error =3D %s\n", path, err);
> +      free(err);
>         goto error;
>      }
> -   memset(dev->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE; ++i) {
> -      dev->pages[i] =3D (void*)alloc_page();
> -      if(dev->pages[i] =3D=3D NULL) {
> -        goto error;
> -      }
> +   if(strcmp(value, "1")) {
> +      TPMFRONT_ERR("%s has an invalid value (%s)\n", path, value);
> +      free(value);
> +      goto error;
>      }
> +   free(value);
>
>      TPMFRONT_LOG("Initialization Completed successfully\n");
>
> @@ -314,12 +351,10 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>   {
>      char* err;
>      char path[512];
> -   int i;
> -   tpmif_tx_request_t* tx;
>      if(dev =3D=3D NULL) {
>         return;
>      }
> -   TPMFRONT_LOG("Shutting down tpmfront\n");
> +   TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for rec=
onfigure" : "");
>      /* disconnect */
>      if(dev->state =3D=3D XenbusStateConnected) {
>         dev->state =3D XenbusStateClosing;
> @@ -349,27 +384,12 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>         /* Wait for the backend to close and unmap shared pages, ignore=
 any errors */
>         wait_for_backend_state_changed(dev, XenbusStateClosed);
>
> -      /* Cleanup any shared pages */
> -      if(dev->pages) {
> -        for(i =3D 0; i < TPMIF_TX_RING_SIZE; ++i) {
> -           if(dev->pages[i]) {
> -              tx =3D &dev->tx->ring[i].req;
> -              if(tx->ref !=3D 0) {
> -                 gnttab_end_access(tx->ref);
> -              }
> -              free_page(dev->pages[i]);
> -           }
> -        }
> -        free(dev->pages);
> -      }
> -
>         /* Close event channel and unmap shared page */
>         mask_evtchn(dev->evtchn);
>         unbind_evtchn(dev->evtchn);
>         gnttab_end_access(dev->ring_ref);
>
> -      free_page(dev->tx);
> -
> +      free_page(dev->page);
>      }
>
>      /* Cleanup memory usage */
> @@ -387,13 +407,17 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>
>   int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_=
t length)
>   {
> +   unsigned int offset;
> +   vtpm_shared_page_t* shr =3D NULL;
> +#ifdef TPMFRONT_PRINT_DEBUG
>      int i;
> -   tpmif_tx_request_t* tx =3D NULL;
> +#endif
>      /* Error Checking */
>      if(dev =3D=3D NULL || dev->state !=3D XenbusStateConnected) {
>         TPMFRONT_ERR("Tried to send message through disconnected fronte=
nd\n");
>         return -1;
>      }
> +   shr =3D dev->page;
>
>   #ifdef TPMFRONT_PRINT_DEBUG
>      TPMFRONT_DEBUG("Sending Msg to backend size=3D%u", (unsigned int) =
length);
> @@ -407,19 +431,16 @@ int tpmfront_send(struct tpmfront_dev* dev, const=
 uint8_t* msg, size_t length)
>   #endif
>
>      /* Copy to shared pages now */
> -   for(i =3D 0; length > 0 && i < TPMIF_TX_RING_SIZE; ++i) {
> -      /* Share the page */
> -      tx =3D &dev->tx->ring[i].req;
> -      tx->unused =3D 0;
> -      tx->addr =3D virt_to_mach(dev->pages[i]);
> -      tx->ref =3D gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->p=
ages[i]), 0);
> -      /* Copy the bits to the page */
> -      tx->size =3D length > PAGE_SIZE ? PAGE_SIZE : length;
> -      memcpy(dev->pages[i], &msg[i * PAGE_SIZE], tx->size);
> -
> -      /* Update counters */
> -      length -=3D tx->size;
> +   offset =3D sizeof(*shr);
> +   if (length + offset > PAGE_SIZE) {
> +      TPMFRONT_ERR("Message too long for shared page\n");
> +      return -1;
>      }
> +   memcpy(offset + (uint8_t*)shr, msg, length);
> +   shr->length =3D length;
> +   barrier();
> +   shr->state =3D 1;
> +
>      dev->waiting =3D 1;
>      dev->resplen =3D 0;
>   #ifdef HAVE_LIBC
> @@ -434,44 +455,41 @@ int tpmfront_send(struct tpmfront_dev* dev, const=
 uint8_t* msg, size_t length)
>   }
>   int tpmfront_recv(struct tpmfront_dev* dev, uint8_t** msg, size_t *le=
ngth)
>   {
> -   tpmif_tx_request_t* tx;
> -   int i;
> +   unsigned int offset;
> +   vtpm_shared_page_t* shr =3D NULL;
> +#ifdef TPMFRONT_PRINT_DEBUG
> +int i;
> +#endif
>      if(dev =3D=3D NULL || dev->state !=3D XenbusStateConnected) {
>         TPMFRONT_ERR("Tried to receive message from disconnected fronte=
nd\n");
>         return -1;
>      }
>      /*Wait for the response */
>      wait_event(dev->waitq, (!dev->waiting));
> +   shr =3D dev->page;
> +   if (shr->state !=3D 0)
> +      goto quit;
>
>      /* Initialize */
>      *msg =3D NULL;
> -   *length =3D 0;
> +   *length =3D shr->length;
> +   offset =3D sizeof(*shr);
>
> -   /* special case, just quit */
> -   tx =3D &dev->tx->ring[0].req;
> -   if(tx->size =3D=3D 0 ) {
> -       goto quit;
> -   }
> -   /* Get the total size */
> -   tx =3D &dev->tx->ring[0].req;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
> -      tx =3D &dev->tx->ring[i].req;
> -      *length +=3D tx->size;
> +   if (*length + offset > PAGE_SIZE) {
> +      TPMFRONT_ERR("Reply too long for shared page\n");
> +      return -1;
>      }
> +
>      /* Alloc the buffer */
>      if(dev->respbuf) {
>         free(dev->respbuf);
>      }
>      *msg =3D dev->respbuf =3D malloc(*length);
>      dev->resplen =3D *length;
> +
>      /* Copy the bits */
> -   tx =3D &dev->tx->ring[0].req;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
> -      tx =3D &dev->tx->ring[i].req;
> -      memcpy(&(*msg)[i * PAGE_SIZE], dev->pages[i], tx->size);
> -      gnttab_end_access(tx->ref);
> -      tx->ref =3D 0;
> -   }
> +   memcpy(*msg, offset + (uint8_t*)shr, *length);
> +
>   #ifdef TPMFRONT_PRINT_DEBUG
>      TPMFRONT_DEBUG("Received response from backend size=3D%u", (unsign=
ed int) *length);
>      for(i =3D 0; i < *length; ++i) {
> @@ -504,6 +522,14 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t=
* req, size_t reqlen, uint8_t*
>      return 0;
>   }
>
> +int tpmfront_set_locality(struct tpmfront_dev* dev, int locality)
> +{
> +   if (!dev || !dev->page)
> +      return -1;
> +   dev->page->locality =3D locality;
> +   return 0;
> +}
> +
>   #ifdef HAVE_LIBC
>   #include <errno.h>
>   int tpmfront_open(struct tpmfront_dev* dev)
> diff --git a/xen/include/public/io/tpmif.h b/xen/include/public/io/tpmi=
f.h
> index 02ccdab..afc9181 100644
> --- a/xen/include/public/io/tpmif.h
> +++ b/xen/include/public/io/tpmif.h
> @@ -1,7 +1,7 @@
>   /********************************************************************=
**********
>    * tpmif.h
>    *
> - * TPM I/O interface for Xen guest OSes.
> + * TPM I/O interface for Xen guest OSes, v2
>    *
>    * Permission is hereby granted, free of charge, to any person obtain=
ing a copy
>    * of this software and associated documentation files (the "Software=
"), to
> @@ -21,48 +21,23 @@
>    * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHE=
R
>    * DEALINGS IN THE SOFTWARE.
>    *
> - * Copyright (c) 2005, IBM Corporation
> - *
> - * Author: Stefan Berger, stefanb@us.ibm.com
> - * Grant table support: Mahadevan Gomathisankaran
> - *
> - * This code has been derived from tools/libxc/xen/io/netif.h
> - *
> - * Copyright (c) 2003-2004, Keir Fraser
>    */
>
>   #ifndef __XEN_PUBLIC_IO_TPMIF_H__
>   #define __XEN_PUBLIC_IO_TPMIF_H__
>
> -#include "../grant_table.h"
> +struct vtpm_shared_page {
> +    uint16_t length;         /* request/response length in bytes */
>
> -struct tpmif_tx_request {
> -    unsigned long addr;   /* Machine address of packet.   */
> -    grant_ref_t ref;      /* grant table access reference */
> -    uint16_t unused;
> -    uint16_t size;        /* Packet size in bytes.        */
> -};
> -typedef struct tpmif_tx_request tpmif_tx_request_t;
> -
> -/*
> - * The TPMIF_TX_RING_SIZE defines the number of pages the
> - * front-end and backend can exchange (=3D size of array).
> - */
> -typedef uint32_t TPMIF_RING_IDX;
> -
> -#define TPMIF_TX_RING_SIZE 1
> -
> -/* This structure must fit in a memory page. */
> -
> -struct tpmif_ring {
> -    struct tpmif_tx_request req;
> -};
> -typedef struct tpmif_ring tpmif_ring_t;
> +    uint8_t state;           /* 0 - response ready / idle
> +                              * 1 - request ready / working */
> +    uint8_t locality;        /* for the current request */
> +    uint8_t padding[3];
>
> -struct tpmif_tx_interface {
> -    struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
> +    uint8_t nr_extra_pages;  /* extra pages for long packets; may be z=
ero */
> +    uint32_t extra_pages[0]; /* grant IDs; length is actually nr_extra=
_pages */
>   };
> -typedef struct tpmif_tx_interface tpmif_tx_interface_t;
> +typedef struct vtpm_shared_page vtpm_shared_page_t;
>
>   #endif
>
> --
> 1.7.11.7
>



--------------ms000804060409010209010201
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlCwMBAQEBBAoWCGZpb3JhbWUxMBsGDSsGAQQBsyUL
AwEBAQIEChIIMDAxMDQyNjEwWAYJYIZIAYb6ax4BBEsMSVRoZSBwcml2YXRlIGtleSBjb3Jy
ZXNwb25kaW5nIHRvIHRoaXMgY2VydGlmaWNhdGUgbWF5IGhhdmUgYmVlbiBleHBvcnRlZC4w
KAYDVR0RBCEwH4Ed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tlwYQwUWNn5PHjuSEyDwAAAAAA
AA==
--------------ms000804060409010209010201--


--===============5802916327764324978==
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.xen.org
http://lists.xen.org/xen-devel

--===============5802916327764324978==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 21:30:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 21:30:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdSjN-00044h-UO; Tue, 27 Nov 2012 21:30:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TdSjL-00044b-Dv
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 21:30:11 +0000
Received: from [85.158.137.99:62750] by server-5.bemta-3.messagelabs.com id
	6B/6D-26311-2E035B05; Tue, 27 Nov 2012 21:30:10 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354051807!16988035!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21147 invoked from network); 27 Nov 2012 21:30:08 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-4.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 21:30:08 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158216954;
	Tue, 27 Nov 2012 16:30:00 -0500
Message-ID: <50B530D2.1060303@jhuapl.edu>
Date: Tue, 27 Nov 2012 16:29:54 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-2-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1354029286-17652-2-git-send-email-dgdegra@tycho.nsa.gov>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/4] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5802916327764324978=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============5802916327764324978==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms000804060409010209010201"

This is a cryptographically signed message in MIME format.

--------------ms000804060409010209010201
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

I can't get this patch to apply. It looks like your editor or something=20
else is converting tabs to whitespace. For instance the line in tpmback.h=


     domid_t domid;              /* Domid of the frontend */

has tabs between domid; and /*. It looks like this also happened to your =

linux patch.


On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
> This changes the vTPM shared page ABI from a copy of the Xen network
> interface to a single-page interface that better reflects the expected
> behavior of a TPM: only a single request packet can be sent at any give=
n
> time, and every packet sent generates a single response packet. This
> protocol change should also increase efficiency as it avoids mapping an=
d
> unmapping grants when possible.
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>   extras/mini-os/include/tpmback.h  |   1 +
>   extras/mini-os/include/tpmfront.h |   7 +-
>   extras/mini-os/tpmback.c          | 159 +++++++++++++++++++----------=
--------
>   extras/mini-os/tpmfront.c         | 162 ++++++++++++++++++++++-------=
---------
>   xen/include/public/io/tpmif.h     |  45 +++--------
>   5 files changed, 191 insertions(+), 183 deletions(-)
>
> diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/=
tpmback.h
> index ff86732..ec9eda4 100644
> --- a/extras/mini-os/include/tpmback.h
> +++ b/extras/mini-os/include/tpmback.h
> @@ -43,6 +43,7 @@
>
>   struct tpmcmd {
>      domid_t domid;              /* Domid of the frontend */
> +   uint8_t locality;    /* Locality requested by the frontend */
>      unsigned int handle;        /* Handle of the frontend */
>      unsigned char uuid[16];                     /* uuid of the tpm int=
erface */
>
> diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include=
/tpmfront.h
> index fd2cb17..a0c7c4d 100644
> --- a/extras/mini-os/include/tpmfront.h
> +++ b/extras/mini-os/include/tpmfront.h
> @@ -37,9 +37,7 @@ struct tpmfront_dev {
>      grant_ref_t ring_ref;
>      evtchn_port_t evtchn;
>
> -   tpmif_tx_interface_t* tx;
> -
> -   void** pages;
> +   vtpm_shared_page_t *page;
>
>      domid_t bedomid;
>      char* nodename;
> @@ -77,6 +75,9 @@ void shutdown_tpmfront(struct tpmfront_dev* dev);
>    * */
>   int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqle=
n, uint8_t** resp, size_t* resplen);
>
> +/* Set the locality used for communicating with a vTPM */
> +int tpmfront_set_locality(struct tpmfront_dev* dev, int locality);
> +
>   #ifdef HAVE_LIBC
>   #include <sys/stat.h>
>   /* POSIX IO functions:
> diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
> index 658fed1..2d31061 100644
> --- a/extras/mini-os/tpmback.c
> +++ b/extras/mini-os/tpmback.c
> @@ -86,10 +86,7 @@ struct tpmif {
>      evtchn_port_t evtchn;
>
>      /* Shared page */
> -   tpmif_tx_interface_t* tx;
> -
> -   /* pointer to TPMIF_RX_RING_SIZE pages */
> -   void** pages;
> +   vtpm_shared_page_t *page;
>
>      enum xenbus_state state;
>      enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
> @@ -266,6 +263,7 @@ int insert_tpmif(tpmif_t* tpmif)
>      unsigned int i, j;
>      tpmif_t* tmp;
>      char* err;
> +   char path[512];
>
>      local_irq_save(flags);
>
> @@ -303,6 +301,16 @@ int insert_tpmif(tpmif_t* tpmif)
>
>      local_irq_restore(flags);
>
> +   snprintf(path, 512, "backend/vtpm/%u/%u/feature-protocol-v2", (unsi=
gned int) tpmif->domid, tpmif->handle);
> +   if ((err =3D xenbus_write(XBT_NIL, path, "1")))
> +   {
> +      /* if we got an error here we should carefully remove the interf=
ace and then return */
> +      TPMBACK_ERR("Unable to write feature-protocol-v2 node: %s\n", er=
r);
> +      free(err);
> +      remove_tpmif(tpmif);
> +      goto error_post_irq;
> +   }
> +
>      /*Listen for state changes on the new interface */
>      if((err =3D xenbus_watch_path_token(XBT_NIL, tpmif->fe_state_path,=
 tpmif->fe_state_path, &gtpmdev.events)))
>      {
> @@ -312,7 +320,6 @@ int insert_tpmif(tpmif_t* tpmif)
>         remove_tpmif(tpmif);
>         goto error_post_irq;
>      }
> -
>      return 0;
>   error:
>      local_irq_restore(flags);
> @@ -386,8 +393,7 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigne=
d int handle)
>      tpmif->fe_state_path =3D NULL;
>      tpmif->state =3D XenbusStateInitialising;
>      tpmif->status =3D DISCONNECTED;
> -   tpmif->tx =3D NULL;
> -   tpmif->pages =3D NULL;
> +   tpmif->page =3D NULL;
>      tpmif->flags =3D 0;
>      memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
>      return tpmif;
> @@ -395,9 +401,6 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigne=
d int handle)
>
>   void __free_tpmif(tpmif_t* tpmif)
>   {
> -   if(tpmif->pages) {
> -      free(tpmif->pages);
> -   }
>      if(tpmif->fe_path) {
>         free(tpmif->fe_path);
>      }
> @@ -430,12 +433,6 @@ tpmif_t* new_tpmif(domid_t domid, unsigned int han=
dle)
>         goto error;
>      }
>
> -   /* allocate pages to be used for shared mapping */
> -   if((tpmif->pages =3D malloc(sizeof(void*) * TPMIF_TX_RING_SIZE)) =3D=
=3D NULL) {
> -      goto error;
> -   }
> -   memset(tpmif->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
> -
>      if(tpmif_change_state(tpmif, XenbusStateInitWait)) {
>         goto error;
>      }
> @@ -486,7 +483,7 @@ void free_tpmif(tpmif_t* tpmif)
>         tpmif->status =3D DISCONNECTING;
>         mask_evtchn(tpmif->evtchn);
>
> -      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1)) {
> +      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {=

>           TPMBACK_ERR("%u/%u Error occured while trying to unmap shared=
 page\n", (unsigned int) tpmif->domid, tpmif->handle);
>         }
>
> @@ -529,9 +526,10 @@ void free_tpmif(tpmif_t* tpmif)
>   void tpmback_handler(evtchn_port_t port, struct pt_regs *regs, void *=
data)
>   {
>      tpmif_t* tpmif =3D (tpmif_t*) data;
> -   tpmif_tx_request_t* tx =3D &tpmif->tx->ring[0].req;
> -   /* Throw away 0 size events, these can trigger from event channel u=
nmasking */
> -   if(tx->size =3D=3D 0)
> +   vtpm_shared_page_t* pg =3D tpmif->page;
> +
> +   /* Only pay attention if the request is ready */
> +   if (pg->state =3D=3D 0)
>         return;
>
>      TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->=
domid, tpmif->handle);
> @@ -584,12 +582,26 @@ int connect_fe(tpmif_t* tpmif)
>      }
>      free(value);
>
> +   /* Check that protocol v2 is being used */
> +   snprintf(path, 512, "%s/feature-protocol-v2", tpmif->fe_path);
> +   if((err =3D xenbus_read(XBT_NIL, path, &value))) {
> +      TPMBACK_ERR("Unable to read %s during tpmback initialization! er=
ror =3D %s\n", path, err);
> +      free(err);
> +      return -1;
> +   }
> +   if(strcmp(value, "1")) {
> +      TPMBACK_ERR("%s has an invalid value (%s)\n", path, value);
> +      free(value);
> +      return -1;
> +   }
> +   free(value);
> +
> +
>      domid =3D tpmif->domid;
> -   if((tpmif->tx =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0,=
 &ringref, PROT_READ | PROT_WRITE)) =3D=3D NULL) {
> +   if((tpmif->page =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, =
0, &ringref, PROT_READ | PROT_WRITE)) =3D=3D NULL) {
>         TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned =
int) tpmif->domid, tpmif->handle);
>         return -1;
>      }
> -   memset(tpmif->tx, 0, PAGE_SIZE);
>
>      /*Bind the event channel */
>      if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler,=
 tpmif, &tpmif->evtchn)))
> @@ -618,10 +630,28 @@ error_post_evtchn:
>      mask_evtchn(tpmif->evtchn);
>      unbind_evtchn(tpmif->evtchn);
>   error_post_map:
> -   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1);
> +   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1);
>      return -1;
>   }
>
> +static void disconnect_fe(tpmif_t* tpmif)
> +{
> +   if (tpmif->status =3D=3D CONNECTED) {
> +      tpmif->status =3D DISCONNECTING;
> +      mask_evtchn(tpmif->evtchn);
> +
> +      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {=

> +        TPMBACK_ERR("%u/%u Error occured while trying to unmap shared =
page\n", (unsigned int) tpmif->domid, tpmif->handle);
> +      }
> +
> +      unbind_evtchn(tpmif->evtchn);
> +   }
> +   tpmif->status =3D DISCONNECTED;
> +   tpmif_change_state(tpmif, XenbusStateReconfigured);
> +
> +   TPMBACK_LOG("Frontend %u/%u disconnected\n", (unsigned int) tpmif->=
domid, tpmif->handle);
> +}
> +
>   static int frontend_changed(tpmif_t* tpmif)
>   {
>      int state =3D xenbus_read_integer(tpmif->fe_state_path);
> @@ -874,6 +904,7 @@ void shutdown_tpmback(void)
>   inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int=
 handle, unsigned char uuid[16])
>   {
>      tpmcmd->domid =3D domid;
> +   tpmcmd->locality =3D -1;
>      tpmcmd->handle =3D handle;
>      memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
>      tpmcmd->req =3D NULL;
> @@ -884,12 +915,12 @@ inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t=
 domid, unsigned int handle, un
>
>   tpmcmd_t* get_request(tpmif_t* tpmif) {
>      tpmcmd_t* cmd;
> -   tpmif_tx_request_t* tx;
> -   int offset;
> -   int tocopy;
> -   int i;
> -   uint32_t domid;
> +   vtpm_shared_page_t* shr;
> +   unsigned int offset;
>      int flags;
> +#ifdef TPMBACK_PRINT_DEBUG
> +   int i;
> +#endif
>
>      local_irq_save(flags);
>
> @@ -899,35 +930,22 @@ tpmcmd_t* get_request(tpmif_t* tpmif) {
>      }
>      init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);
>
> -   tx =3D &tpmif->tx->ring[0].req;
> -   cmd->req_len =3D tx->size;
> +   shr =3D tpmif->page;
> +   cmd->req_len =3D shr->length;
> +   cmd->locality =3D shr->locality;
> +   offset =3D sizeof(*shr) + 4*shr->nr_extra_pages;
> +   if (offset > PAGE_SIZE || offset + cmd->req_len > PAGE_SIZE) {
> +      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (u=
nsigned int) tpmif->domid, tpmif->handle);
> +      goto error;
> +   }
>      /* Allocate the buffer */
>      if(cmd->req_len) {
>         if((cmd->req =3D malloc(cmd->req_len)) =3D=3D NULL) {
>           goto error;
>         }
>      }
> -   /* Copy the bits from the shared pages */
> -   offset =3D 0;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && offset < cmd->req_len; ++i) =
{
> -      tx =3D &tpmif->tx->ring[i].req;
> -
> -      /* Map the page with the data */
> -      domid =3D (uint32_t)tpmif->domid;
> -      if((tpmif->pages[i] =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &=
domid, 0, &tx->ref, PROT_READ)) =3D=3D NULL) {
> -        TPMBACK_ERR("%u/%u Unable to map shared page during read!\n", =
(unsigned int) tpmif->domid, tpmif->handle);
> -        goto error;
> -      }
> -
> -      /* do the copy now */
> -      tocopy =3D min(cmd->req_len - offset, PAGE_SIZE);
> -      memcpy(&cmd->req[offset], tpmif->pages[i], tocopy);
> -      offset +=3D tocopy;
> -
> -      /* release the page */
> -      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
> -
> -   }
> +   /* Copy the bits from the shared page(s) */
> +   memcpy(cmd->req, offset + (uint8_t*)shr, cmd->req_len);
>
>   #ifdef TPMBACK_PRINT_DEBUG
>      TPMBACK_DEBUG("Received Tpm Command from %u/%u of size %u", (unsig=
ned int) tpmif->domid, tpmif->handle, cmd->req_len);
> @@ -958,38 +976,24 @@ error:
>
>   void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
>   {
> -   tpmif_tx_request_t* tx;
> -   int offset;
> -   int i;
> -   uint32_t domid;
> -   int tocopy;
> +   vtpm_shared_page_t* shr;
> +   unsigned int offset;
>      int flags;
> +#ifdef TPMBACK_PRINT_DEBUG
> +int i;
> +#endif
>
>      local_irq_save(flags);
>
> -   tx =3D &tpmif->tx->ring[0].req;
> -   tx->size =3D cmd->resp_len;
> -
> -   offset =3D 0;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && offset < cmd->resp_len; ++i)=
 {
> -      tx =3D &tpmif->tx->ring[i].req;
> -
> -      /* Map the page with the data */
> -      domid =3D (uint32_t)tpmif->domid;
> -      if((tpmif->pages[i] =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &=
domid, 0, &tx->ref, PROT_WRITE)) =3D=3D NULL) {
> -        TPMBACK_ERR("%u/%u Unable to map shared page during write!\n",=
 (unsigned int) tpmif->domid, tpmif->handle);
> -        goto error;
> -      }
> -
> -      /* do the copy now */
> -      tocopy =3D min(cmd->resp_len - offset, PAGE_SIZE);
> -      memcpy(tpmif->pages[i], &cmd->resp[offset], tocopy);
> -      offset +=3D tocopy;
> -
> -      /* release the page */
> -      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
> +   shr =3D tpmif->page;
> +   shr->length =3D cmd->resp_len;
>
> +   offset =3D sizeof(*shr) + 4*shr->nr_extra_pages;
> +   if (offset > PAGE_SIZE || offset + cmd->resp_len > PAGE_SIZE) {
> +      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (u=
nsigned int) tpmif->domid, tpmif->handle);
> +      goto error;
>      }
> +   memcpy(offset + (uint8_t*)shr, cmd->resp, cmd->resp_len);
>
>   #ifdef TPMBACK_PRINT_DEBUG
>      TPMBACK_DEBUG("Sent response to %u/%u of size %u", (unsigned int) =
tpmif->domid, tpmif->handle, cmd->resp_len);
> @@ -1003,6 +1007,7 @@ void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)=

>   #endif
>      /* clear the ready flag and send the event channel notice to the f=
rontend */
>      tpmif_req_finished(tpmif);
> +   shr->state =3D 0;
>      notify_remote_via_evtchn(tpmif->evtchn);
>   error:
>      local_irq_restore(flags);
> diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
> index 0218d7f..c1cbab3 100644
> --- a/extras/mini-os/tpmfront.c
> +++ b/extras/mini-os/tpmfront.c
> @@ -153,6 +153,32 @@ static int wait_for_backend_closed(xenbus_event_qu=
eue* events, char* path)
>
>   }
>
> +static int wait_for_backend_reconfig(xenbus_event_queue* events, char*=
 path)
> +{
> +   int state;
> +
> +   TPMFRONT_LOG("Waiting for backend to reconfigure...\n");
> +   while(1) {
> +      state =3D xenbus_read_integer(path);
> +      if ( state < 0)
> +        state =3D XenbusStateUnknown;
> +      switch(state) {
> +        case XenbusStateUnknown:
> +           TPMFRONT_ERR("Backend Unknown state, forcing shutdown\n");
> +           return -1;
> +        case XenbusStateClosed:
> +           TPMFRONT_LOG("Backend Closed\n");
> +           return 0;
> +        case XenbusStateReconfigured:
> +           TPMFRONT_LOG("Backend Reconfigured\n");
> +           return 0;
> +        default:
> +           xenbus_wait_for_watch(events);
> +      }
> +   }
> +
> +}
> +
>   static int wait_for_backend_state_changed(struct tpmfront_dev* dev, X=
enbusState state) {
>      char* err;
>      int ret =3D 0;
> @@ -175,8 +201,11 @@ static int wait_for_backend_state_changed(struct t=
pmfront_dev* dev, XenbusState
>         case XenbusStateClosed:
>           ret =3D wait_for_backend_closed(&events, path);
>           break;
> -      default:
> +      case XenbusStateReconfigured:
> +        ret =3D wait_for_backend_reconfig(&events, path);
>           break;
> +      default:
> +         TPMFRONT_ERR("Bad wait state %d, ignoring\n", state);
>      }
>
>      if((err =3D xenbus_unwatch_path_token(XBT_NIL, path, path))) {
> @@ -190,13 +219,13 @@ static int tpmfront_connect(struct tpmfront_dev* =
dev)
>   {
>      char* err;
>      /* Create shared page */
> -   dev->tx =3D (tpmif_tx_interface_t*) alloc_page();
> -   if(dev->tx =3D=3D NULL) {
> +   dev->page =3D (vtpm_shared_page_t*) alloc_page();
> +   if(dev->page =3D=3D NULL) {
>         TPMFRONT_ERR("Unable to allocate page for shared memory\n");
>         goto error;
>      }
> -   memset(dev->tx, 0, PAGE_SIZE);
> -   dev->ring_ref =3D gnttab_grant_access(dev->bedomid, virt_to_mfn(dev=
->tx), 0);
> +   memset(dev->page, 0, PAGE_SIZE);
> +   dev->ring_ref =3D gnttab_grant_access(dev->bedomid, virt_to_mfn(dev=
->page), 0);
>      TPMFRONT_DEBUG("grant ref is %lu\n", (unsigned long) dev->ring_ref=
);
>
>      /*Create event channel */
> @@ -228,7 +257,7 @@ error_postevtchn:
>         unbind_evtchn(dev->evtchn);
>   error_postmap:
>         gnttab_end_access(dev->ring_ref);
> -      free_page(dev->tx);
> +      free_page(dev->page);
>   error:
>      return -1;
>   }
> @@ -240,7 +269,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nod=
ename)
>      char path[512];
>      char* value, *err;
>      unsigned long long ival;
> -   int i;
>
>      printk("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Init TPM Front =3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n");
>
> @@ -279,6 +307,15 @@ struct tpmfront_dev* init_tpmfront(const char* _no=
dename)
>         goto error;
>      }
>
> +   /* Publish protocol v2 feature */
> +   snprintf(path, 512, "%s/feature-protocol-v2", dev->nodename);
> +   if ((err =3D xenbus_write(XBT_NIL, path, "1")))
> +   {
> +      TPMFRONT_ERR("Unable to write feature-protocol-v2 node: %s\n", e=
rr);
> +         free(err);
> +      goto error;
> +   }
> +
>      /* Create and publish grant reference and event channel */
>      if (tpmfront_connect(dev)) {
>         goto error;
> @@ -289,18 +326,18 @@ struct tpmfront_dev* init_tpmfront(const char* _n=
odename)
>         goto error;
>      }
>
> -   /* Allocate pages that will contain the messages */
> -   dev->pages =3D malloc(sizeof(void*) * TPMIF_TX_RING_SIZE);
> -   if(dev->pages =3D=3D NULL) {
> +   snprintf(path, 512, "%s/feature-protocol-v2", dev->bepath);
> +   if((err =3D xenbus_read(XBT_NIL, path, &value))) {
> +      TPMFRONT_ERR("Unable to read %s during tpmfront initialization! =
error =3D %s\n", path, err);
> +      free(err);
>         goto error;
>      }
> -   memset(dev->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE; ++i) {
> -      dev->pages[i] =3D (void*)alloc_page();
> -      if(dev->pages[i] =3D=3D NULL) {
> -        goto error;
> -      }
> +   if(strcmp(value, "1")) {
> +      TPMFRONT_ERR("%s has an invalid value (%s)\n", path, value);
> +      free(value);
> +      goto error;
>      }
> +   free(value);
>
>      TPMFRONT_LOG("Initialization Completed successfully\n");
>
> @@ -314,12 +351,10 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>   {
>      char* err;
>      char path[512];
> -   int i;
> -   tpmif_tx_request_t* tx;
>      if(dev =3D=3D NULL) {
>         return;
>      }
> -   TPMFRONT_LOG("Shutting down tpmfront\n");
> +   TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for rec=
onfigure" : "");
>      /* disconnect */
>      if(dev->state =3D=3D XenbusStateConnected) {
>         dev->state =3D XenbusStateClosing;
> @@ -349,27 +384,12 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>         /* Wait for the backend to close and unmap shared pages, ignore=
 any errors */
>         wait_for_backend_state_changed(dev, XenbusStateClosed);
>
> -      /* Cleanup any shared pages */
> -      if(dev->pages) {
> -        for(i =3D 0; i < TPMIF_TX_RING_SIZE; ++i) {
> -           if(dev->pages[i]) {
> -              tx =3D &dev->tx->ring[i].req;
> -              if(tx->ref !=3D 0) {
> -                 gnttab_end_access(tx->ref);
> -              }
> -              free_page(dev->pages[i]);
> -           }
> -        }
> -        free(dev->pages);
> -      }
> -
>         /* Close event channel and unmap shared page */
>         mask_evtchn(dev->evtchn);
>         unbind_evtchn(dev->evtchn);
>         gnttab_end_access(dev->ring_ref);
>
> -      free_page(dev->tx);
> -
> +      free_page(dev->page);
>      }
>
>      /* Cleanup memory usage */
> @@ -387,13 +407,17 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>
>   int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_=
t length)
>   {
> +   unsigned int offset;
> +   vtpm_shared_page_t* shr =3D NULL;
> +#ifdef TPMFRONT_PRINT_DEBUG
>      int i;
> -   tpmif_tx_request_t* tx =3D NULL;
> +#endif
>      /* Error Checking */
>      if(dev =3D=3D NULL || dev->state !=3D XenbusStateConnected) {
>         TPMFRONT_ERR("Tried to send message through disconnected fronte=
nd\n");
>         return -1;
>      }
> +   shr =3D dev->page;
>
>   #ifdef TPMFRONT_PRINT_DEBUG
>      TPMFRONT_DEBUG("Sending Msg to backend size=3D%u", (unsigned int) =
length);
> @@ -407,19 +431,16 @@ int tpmfront_send(struct tpmfront_dev* dev, const=
 uint8_t* msg, size_t length)
>   #endif
>
>      /* Copy to shared pages now */
> -   for(i =3D 0; length > 0 && i < TPMIF_TX_RING_SIZE; ++i) {
> -      /* Share the page */
> -      tx =3D &dev->tx->ring[i].req;
> -      tx->unused =3D 0;
> -      tx->addr =3D virt_to_mach(dev->pages[i]);
> -      tx->ref =3D gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->p=
ages[i]), 0);
> -      /* Copy the bits to the page */
> -      tx->size =3D length > PAGE_SIZE ? PAGE_SIZE : length;
> -      memcpy(dev->pages[i], &msg[i * PAGE_SIZE], tx->size);
> -
> -      /* Update counters */
> -      length -=3D tx->size;
> +   offset =3D sizeof(*shr);
> +   if (length + offset > PAGE_SIZE) {
> +      TPMFRONT_ERR("Message too long for shared page\n");
> +      return -1;
>      }
> +   memcpy(offset + (uint8_t*)shr, msg, length);
> +   shr->length =3D length;
> +   barrier();
> +   shr->state =3D 1;
> +
>      dev->waiting =3D 1;
>      dev->resplen =3D 0;
>   #ifdef HAVE_LIBC
> @@ -434,44 +455,41 @@ int tpmfront_send(struct tpmfront_dev* dev, const=
 uint8_t* msg, size_t length)
>   }
>   int tpmfront_recv(struct tpmfront_dev* dev, uint8_t** msg, size_t *le=
ngth)
>   {
> -   tpmif_tx_request_t* tx;
> -   int i;
> +   unsigned int offset;
> +   vtpm_shared_page_t* shr =3D NULL;
> +#ifdef TPMFRONT_PRINT_DEBUG
> +int i;
> +#endif
>      if(dev =3D=3D NULL || dev->state !=3D XenbusStateConnected) {
>         TPMFRONT_ERR("Tried to receive message from disconnected fronte=
nd\n");
>         return -1;
>      }
>      /*Wait for the response */
>      wait_event(dev->waitq, (!dev->waiting));
> +   shr =3D dev->page;
> +   if (shr->state !=3D 0)
> +      goto quit;
>
>      /* Initialize */
>      *msg =3D NULL;
> -   *length =3D 0;
> +   *length =3D shr->length;
> +   offset =3D sizeof(*shr);
>
> -   /* special case, just quit */
> -   tx =3D &dev->tx->ring[0].req;
> -   if(tx->size =3D=3D 0 ) {
> -       goto quit;
> -   }
> -   /* Get the total size */
> -   tx =3D &dev->tx->ring[0].req;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
> -      tx =3D &dev->tx->ring[i].req;
> -      *length +=3D tx->size;
> +   if (*length + offset > PAGE_SIZE) {
> +      TPMFRONT_ERR("Reply too long for shared page\n");
> +      return -1;
>      }
> +
>      /* Alloc the buffer */
>      if(dev->respbuf) {
>         free(dev->respbuf);
>      }
>      *msg =3D dev->respbuf =3D malloc(*length);
>      dev->resplen =3D *length;
> +
>      /* Copy the bits */
> -   tx =3D &dev->tx->ring[0].req;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
> -      tx =3D &dev->tx->ring[i].req;
> -      memcpy(&(*msg)[i * PAGE_SIZE], dev->pages[i], tx->size);
> -      gnttab_end_access(tx->ref);
> -      tx->ref =3D 0;
> -   }
> +   memcpy(*msg, offset + (uint8_t*)shr, *length);
> +
>   #ifdef TPMFRONT_PRINT_DEBUG
>      TPMFRONT_DEBUG("Received response from backend size=3D%u", (unsign=
ed int) *length);
>      for(i =3D 0; i < *length; ++i) {
> @@ -504,6 +522,14 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t=
* req, size_t reqlen, uint8_t*
>      return 0;
>   }
>
> +int tpmfront_set_locality(struct tpmfront_dev* dev, int locality)
> +{
> +   if (!dev || !dev->page)
> +      return -1;
> +   dev->page->locality =3D locality;
> +   return 0;
> +}
> +
>   #ifdef HAVE_LIBC
>   #include <errno.h>
>   int tpmfront_open(struct tpmfront_dev* dev)
> diff --git a/xen/include/public/io/tpmif.h b/xen/include/public/io/tpmi=
f.h
> index 02ccdab..afc9181 100644
> --- a/xen/include/public/io/tpmif.h
> +++ b/xen/include/public/io/tpmif.h
> @@ -1,7 +1,7 @@
>   /********************************************************************=
**********
>    * tpmif.h
>    *
> - * TPM I/O interface for Xen guest OSes.
> + * TPM I/O interface for Xen guest OSes, v2
>    *
>    * Permission is hereby granted, free of charge, to any person obtain=
ing a copy
>    * of this software and associated documentation files (the "Software=
"), to
> @@ -21,48 +21,23 @@
>    * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHE=
R
>    * DEALINGS IN THE SOFTWARE.
>    *
> - * Copyright (c) 2005, IBM Corporation
> - *
> - * Author: Stefan Berger, stefanb@us.ibm.com
> - * Grant table support: Mahadevan Gomathisankaran
> - *
> - * This code has been derived from tools/libxc/xen/io/netif.h
> - *
> - * Copyright (c) 2003-2004, Keir Fraser
>    */
>
>   #ifndef __XEN_PUBLIC_IO_TPMIF_H__
>   #define __XEN_PUBLIC_IO_TPMIF_H__
>
> -#include "../grant_table.h"
> +struct vtpm_shared_page {
> +    uint16_t length;         /* request/response length in bytes */
>
> -struct tpmif_tx_request {
> -    unsigned long addr;   /* Machine address of packet.   */
> -    grant_ref_t ref;      /* grant table access reference */
> -    uint16_t unused;
> -    uint16_t size;        /* Packet size in bytes.        */
> -};
> -typedef struct tpmif_tx_request tpmif_tx_request_t;
> -
> -/*
> - * The TPMIF_TX_RING_SIZE defines the number of pages the
> - * front-end and backend can exchange (=3D size of array).
> - */
> -typedef uint32_t TPMIF_RING_IDX;
> -
> -#define TPMIF_TX_RING_SIZE 1
> -
> -/* This structure must fit in a memory page. */
> -
> -struct tpmif_ring {
> -    struct tpmif_tx_request req;
> -};
> -typedef struct tpmif_ring tpmif_ring_t;
> +    uint8_t state;           /* 0 - response ready / idle
> +                              * 1 - request ready / working */
> +    uint8_t locality;        /* for the current request */
> +    uint8_t padding[3];
>
> -struct tpmif_tx_interface {
> -    struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
> +    uint8_t nr_extra_pages;  /* extra pages for long packets; may be z=
ero */
> +    uint32_t extra_pages[0]; /* grant IDs; length is actually nr_extra=
_pages */
>   };
> -typedef struct tpmif_tx_interface tpmif_tx_interface_t;
> +typedef struct vtpm_shared_page vtpm_shared_page_t;
>
>   #endif
>
> --
> 1.7.11.7
>



--------------ms000804060409010209010201
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8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wQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAeZNBqsOAJOQqQ7fcf61wbZVer7QG/mfDN
Q47dixoXeqopTic9S/EhszuNKAR+IPzBTvvOV/V4zVeuhxmpMtWDNv+dDEJwA1n9S/1kSJGB
ztMwxqgnyiAw6QszXVxNC67+OvUx9fSa17UIskUHC5APo7tlwYQwUWNn5PHjuSEyDwAAAAAA
AA==
--------------ms000804060409010209010201--


--===============5802916327764324978==
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.xen.org
http://lists.xen.org/xen-devel

--===============5802916327764324978==--


From xen-devel-bounces@lists.xen.org Tue Nov 27 21:32:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 21:32:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdSl0-0004DJ-KY; Tue, 27 Nov 2012 21:31:54 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TdSkz-0004D7-8m
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 21:31:53 +0000
Received: from [193.109.254.147:62934] by server-10.bemta-14.messagelabs.com
	id F2/EA-31741-84135B05; Tue, 27 Nov 2012 21:31:52 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1354051909!8527572!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NzUxMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29335 invoked from network); 27 Nov 2012 21:31:51 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-2.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 21:31:51 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qARLVmSl008965
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <xen-devel@lists.xensource.com>; Tue, 27 Nov 2012 21:31:49 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qARLVlJV017258
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xen-devel@lists.xensource.com>; Tue, 27 Nov 2012 21:31:48 GMT
Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qARLVl8n019721
	for <xen-devel@lists.xensource.com>; Tue, 27 Nov 2012 15:31:47 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 27 Nov 2012 13:31:47 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 9441EE00962; Tue, 27 Nov 2012 16:31:43 -0500 (EST)
Date: Tue, 27 Nov 2012 16:31:43 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: xen-devel@lists.xensource.com
Message-ID: <20121127213143.GB13890@phenom.dumpdata.com>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Subject: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Heya,

So v3.8 merge window is going to open in two weeks (or perhaps sooner).

I am still fixing some build issues so that they won't surface on linux-next, but
so far this is what I was thinking to push (some to Linus, and some to Jens):

Anything I am missing?

 arch/arm/include/asm/xen/interface.h |    1 +
 arch/arm/xen/enlighten.c             |  124 ++++++++++++---
 arch/x86/include/asm/xen/interface.h |   12 ++-
 arch/x86/include/asm/xen/page.h      |    3 +
 arch/x86/xen/Kconfig                 |   11 ++
 arch/x86/xen/enlighten.c             |  174 +++++++++++++++-----
 arch/x86/xen/irq.c                   |    5 +-
 arch/x86/xen/mmu.c                   |  187 +++++++++++++++++++--
 arch/x86/xen/mmu.h                   |    2 +
 arch/x86/xen/p2m.c                   |    2 +-
 arch/x86/xen/setup.c                 |   64 ++++++--
 arch/x86/xen/smp.c                   |   75 ++++++---
 arch/x86/xen/suspend.c               |    2 +-
 arch/x86/xen/xen-head.S              |   11 +-
 arch/x86/xen/xen-ops.h               |    2 +-
 drivers/block/xen-blkback/blkback.c  |  301 +++++++++++++++++++++++++++++++---
 drivers/block/xen-blkback/common.h   |   16 ++
 drivers/block/xen-blkback/xenbus.c   |   23 +++-
 drivers/block/xen-blkfront.c         |  199 +++++++++++++++++++---
 drivers/xen/Kconfig                  |    3 +
 drivers/xen/Makefile                 |    7 +-
 drivers/xen/balloon.c                |   19 ++-
 drivers/xen/cpu_hotplug.c            |    4 +-
 drivers/xen/events.c                 |    9 +-
 drivers/xen/gntdev.c                 |    3 +-
 drivers/xen/grant-table.c            |   25 +++-
 drivers/xen/privcmd.c                |   72 ++++++++-
 drivers/xen/xen-acpi-pad.c           |  182 ++++++++++++++++++++
 drivers/xen/xen-pciback/pci_stub.c   |  118 +++++++------
 drivers/xen/xenbus/xenbus_client.c   |    3 +-
 drivers/xen/xenbus/xenbus_xs.c       |    1 -
 include/xen/interface/memory.h       |   44 +++++-
 include/xen/interface/physdev.h      |   10 +
 include/xen/interface/platform.h     |   17 ++
 include/xen/xen-ops.h                |    9 +-
 35 files changed, 1484 insertions(+), 256 deletions(-)

Alexander Duyck (1):
      x86/xen: Use __pa_symbol instead of __pa on C visible symbols

Dan Carpenter (1):
      xen/privcmd: fix condition in privcmd_close()

Ian Campbell (6):
      xen: balloon: allow PVMMU interfaces to be compiled out
      xen: arm: enable balloon driver
      xen: correctly use xen_pfn_t in remap_domain_mfn_range.
      xen: arm: implement remap interfaces needed for privcmd mappings.
      xen: x86 pvh: use XENMEM_add_to_physmap_range for foreign gmfn mappings
      xen: include correct header for xen_pfn_t definition.

Jan Beulich (2):
      xen-pciback: simplify and tighten parsing of device IDs
      xen-pciback: reject out of range inputs

Konrad Rzeszutek Wilk (8):
      xen/smp: Move the common CPU init code a bit to prep for PVH patch.
      xen/e820: Coalesce the PVH release/populate logic in the generic case.
      Revert "xen/e820: Coalesce the PVH release/populate logic in the generic case."
      xen/acpi: Fix compile error by missing decleration for xen_domain.
      Merge branch 'stable/pvh.v6.1' into stable/for-linus-3.8
      xen/acpi: Move the xen_running_on_version_or_later function.
      Merge branch 'stable/for-linus-3.8' into HEAD
      Merge branch 'stable/for-jens-3.8' into HEAD

Liu, Jinsong (2):
      xen/acpi: ACPI PAD driver
      xen/acpi: revert pad config check in xen_check_mwait

Mukesh Rathor (6):
      xen/pvh: Support ParaVirtualized Hardware extensions.
      xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
      xen/pvh: Implement MMU changes for PVH.
      xen/pvh: bootup and setup (E820) related changes.
      xen/pvh: balloon and grant changes.
      xen/pvh: /dev/xen/privcmd changes.

Olaf Hering (1):
      xen PVonHVM: use E820_Reserved area for shared_info

Roger Pau Monne (4):
      xen/blkback: Persistent grant maps for xen blk drivers
      xen/blkback: persistent-grants fixes
      xen-blkback: move free persistent grants code
      xen-blkfront: free allocated page

Sachin Kamat (1):
      xen/xenbus: Remove duplicate inclusion of asm/xen/hypervisor.h

Wei Yongjun (1):
      xen/x86: remove duplicated include from enlighten.c


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 21:32:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 21:32:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdSl0-0004DJ-KY; Tue, 27 Nov 2012 21:31:54 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TdSkz-0004D7-8m
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 21:31:53 +0000
Received: from [193.109.254.147:62934] by server-10.bemta-14.messagelabs.com
	id F2/EA-31741-84135B05; Tue, 27 Nov 2012 21:31:52 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1354051909!8527572!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NzUxMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29335 invoked from network); 27 Nov 2012 21:31:51 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-2.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 21:31:51 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qARLVmSl008965
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <xen-devel@lists.xensource.com>; Tue, 27 Nov 2012 21:31:49 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qARLVlJV017258
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xen-devel@lists.xensource.com>; Tue, 27 Nov 2012 21:31:48 GMT
Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qARLVl8n019721
	for <xen-devel@lists.xensource.com>; Tue, 27 Nov 2012 15:31:47 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 27 Nov 2012 13:31:47 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 9441EE00962; Tue, 27 Nov 2012 16:31:43 -0500 (EST)
Date: Tue, 27 Nov 2012 16:31:43 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: xen-devel@lists.xensource.com
Message-ID: <20121127213143.GB13890@phenom.dumpdata.com>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Subject: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Heya,

So v3.8 merge window is going to open in two weeks (or perhaps sooner).

I am still fixing some build issues so that they won't surface on linux-next, but
so far this is what I was thinking to push (some to Linus, and some to Jens):

Anything I am missing?

 arch/arm/include/asm/xen/interface.h |    1 +
 arch/arm/xen/enlighten.c             |  124 ++++++++++++---
 arch/x86/include/asm/xen/interface.h |   12 ++-
 arch/x86/include/asm/xen/page.h      |    3 +
 arch/x86/xen/Kconfig                 |   11 ++
 arch/x86/xen/enlighten.c             |  174 +++++++++++++++-----
 arch/x86/xen/irq.c                   |    5 +-
 arch/x86/xen/mmu.c                   |  187 +++++++++++++++++++--
 arch/x86/xen/mmu.h                   |    2 +
 arch/x86/xen/p2m.c                   |    2 +-
 arch/x86/xen/setup.c                 |   64 ++++++--
 arch/x86/xen/smp.c                   |   75 ++++++---
 arch/x86/xen/suspend.c               |    2 +-
 arch/x86/xen/xen-head.S              |   11 +-
 arch/x86/xen/xen-ops.h               |    2 +-
 drivers/block/xen-blkback/blkback.c  |  301 +++++++++++++++++++++++++++++++---
 drivers/block/xen-blkback/common.h   |   16 ++
 drivers/block/xen-blkback/xenbus.c   |   23 +++-
 drivers/block/xen-blkfront.c         |  199 +++++++++++++++++++---
 drivers/xen/Kconfig                  |    3 +
 drivers/xen/Makefile                 |    7 +-
 drivers/xen/balloon.c                |   19 ++-
 drivers/xen/cpu_hotplug.c            |    4 +-
 drivers/xen/events.c                 |    9 +-
 drivers/xen/gntdev.c                 |    3 +-
 drivers/xen/grant-table.c            |   25 +++-
 drivers/xen/privcmd.c                |   72 ++++++++-
 drivers/xen/xen-acpi-pad.c           |  182 ++++++++++++++++++++
 drivers/xen/xen-pciback/pci_stub.c   |  118 +++++++------
 drivers/xen/xenbus/xenbus_client.c   |    3 +-
 drivers/xen/xenbus/xenbus_xs.c       |    1 -
 include/xen/interface/memory.h       |   44 +++++-
 include/xen/interface/physdev.h      |   10 +
 include/xen/interface/platform.h     |   17 ++
 include/xen/xen-ops.h                |    9 +-
 35 files changed, 1484 insertions(+), 256 deletions(-)

Alexander Duyck (1):
      x86/xen: Use __pa_symbol instead of __pa on C visible symbols

Dan Carpenter (1):
      xen/privcmd: fix condition in privcmd_close()

Ian Campbell (6):
      xen: balloon: allow PVMMU interfaces to be compiled out
      xen: arm: enable balloon driver
      xen: correctly use xen_pfn_t in remap_domain_mfn_range.
      xen: arm: implement remap interfaces needed for privcmd mappings.
      xen: x86 pvh: use XENMEM_add_to_physmap_range for foreign gmfn mappings
      xen: include correct header for xen_pfn_t definition.

Jan Beulich (2):
      xen-pciback: simplify and tighten parsing of device IDs
      xen-pciback: reject out of range inputs

Konrad Rzeszutek Wilk (8):
      xen/smp: Move the common CPU init code a bit to prep for PVH patch.
      xen/e820: Coalesce the PVH release/populate logic in the generic case.
      Revert "xen/e820: Coalesce the PVH release/populate logic in the generic case."
      xen/acpi: Fix compile error by missing decleration for xen_domain.
      Merge branch 'stable/pvh.v6.1' into stable/for-linus-3.8
      xen/acpi: Move the xen_running_on_version_or_later function.
      Merge branch 'stable/for-linus-3.8' into HEAD
      Merge branch 'stable/for-jens-3.8' into HEAD

Liu, Jinsong (2):
      xen/acpi: ACPI PAD driver
      xen/acpi: revert pad config check in xen_check_mwait

Mukesh Rathor (6):
      xen/pvh: Support ParaVirtualized Hardware extensions.
      xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
      xen/pvh: Implement MMU changes for PVH.
      xen/pvh: bootup and setup (E820) related changes.
      xen/pvh: balloon and grant changes.
      xen/pvh: /dev/xen/privcmd changes.

Olaf Hering (1):
      xen PVonHVM: use E820_Reserved area for shared_info

Roger Pau Monne (4):
      xen/blkback: Persistent grant maps for xen blk drivers
      xen/blkback: persistent-grants fixes
      xen-blkback: move free persistent grants code
      xen-blkfront: free allocated page

Sachin Kamat (1):
      xen/xenbus: Remove duplicate inclusion of asm/xen/hypervisor.h

Wei Yongjun (1):
      xen/x86: remove duplicated include from enlighten.c


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 21:47:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 21:47:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdSzt-0004VD-8x; Tue, 27 Nov 2012 21:47:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TdSzr-0004V8-Le
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 21:47:15 +0000
Received: from [85.158.138.51:63592] by server-4.bemta-3.messagelabs.com id
	FA/6A-30023-2E435B05; Tue, 27 Nov 2012 21:47:14 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1354052833!28201734!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29034 invoked from network); 27 Nov 2012 21:47:13 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 21:47:13 -0000
X-IronPort-AV: E=Sophos;i="4.84,174,1355097600"; d="scan'208";a="16033430"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 21:47:13 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 27 Nov 2012 21:47:12 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TdSzo-0000UW-OF;
	Tue, 27 Nov 2012 21:47:12 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TdSzo-00034O-9n;
	Tue, 27 Nov 2012 21:47:12 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14482-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 27 Nov 2012 21:47:12 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14482: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14482 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14482/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14480
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14480

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass

version targeted for testing:
 xen                  1c69c938f641
baseline version:
 xen                  16bf7f3069a7

------------------------------------------------------------
People who touched revisions under test:
  Chunyan Liu <cyliu@suse.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Ronny Hegewald <Ronny.Hegewald@online.de>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=1c69c938f641
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 1c69c938f641
+ branch=xen-unstable
+ revision=1c69c938f641
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 1c69c938f641 ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 5 changesets with 6 changes to 5 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 21:47:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 21:47:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdSzt-0004VD-8x; Tue, 27 Nov 2012 21:47:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TdSzr-0004V8-Le
	for xen-devel@lists.xensource.com; Tue, 27 Nov 2012 21:47:15 +0000
Received: from [85.158.138.51:63592] by server-4.bemta-3.messagelabs.com id
	FA/6A-30023-2E435B05; Tue, 27 Nov 2012 21:47:14 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1354052833!28201734!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDM4NzY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29034 invoked from network); 27 Nov 2012 21:47:13 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	27 Nov 2012 21:47:13 -0000
X-IronPort-AV: E=Sophos;i="4.84,174,1355097600"; d="scan'208";a="16033430"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	27 Nov 2012 21:47:13 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Tue, 27 Nov 2012 21:47:12 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TdSzo-0000UW-OF;
	Tue, 27 Nov 2012 21:47:12 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TdSzo-00034O-9n;
	Tue, 27 Nov 2012 21:47:12 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14482-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Tue, 27 Nov 2012 21:47:12 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14482: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14482 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14482/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14480
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14480

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass

version targeted for testing:
 xen                  1c69c938f641
baseline version:
 xen                  16bf7f3069a7

------------------------------------------------------------
People who touched revisions under test:
  Chunyan Liu <cyliu@suse.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Ronny Hegewald <Ronny.Hegewald@online.de>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-unstable
+ revision=1c69c938f641
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-unstable 1c69c938f641
+ branch=xen-unstable
+ revision=1c69c938f641
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-unstable.hg
++ : git://xenbits.xen.org/staging/qemu-xen-unstable.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-unstable
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-unstable.git
++ : daily-cron.xen-unstable
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-unstable.git
+ info_linux_tree xen-unstable
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-unstable.hg
+ hg push -r 1c69c938f641 ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-unstable.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 5 changesets with 6 changes to 5 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 22:09:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 22:09:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdTLA-0004w1-3n; Tue, 27 Nov 2012 22:09:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdTL9-0004vw-0T
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 22:09:15 +0000
Received: from [85.158.143.35:31707] by server-2.bemta-4.messagelabs.com id
	1B/63-28922-A0A35B05; Tue, 27 Nov 2012 22:09:14 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-21.messagelabs.com!1354054112!13899224!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18884 invoked from network); 27 Nov 2012 22:08:33 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-15.tower-21.messagelabs.com with SMTP;
	27 Nov 2012 22:08:33 -0000
X-TM-IMSS-Message-ID: <25850b6a00007ad0@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 25850b6a00007ad0 ;
	Tue, 27 Nov 2012 17:07:29 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARM8T1c002162; 
	Tue, 27 Nov 2012 17:08:29 -0500
Message-ID: <50B539DD.7050206@tycho.nsa.gov>
Date: Tue, 27 Nov 2012 17:08:29 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-2-git-send-email-dgdegra@tycho.nsa.gov>
	<50B530D2.1060303@jhuapl.edu>
In-Reply-To: <50B530D2.1060303@jhuapl.edu>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/4] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/27/2012 04:29 PM, Matthew Fioravante wrote:
> I can't get this patch to apply. It looks like your editor or something else is converting tabs to whitespace. For instance the line in tpmback.h
> 
>     domid_t domid;              /* Domid of the frontend */
> 
> has tabs between domid; and /*. It looks like this also happened to your linux patch.

The problem looks like it's on your end; my patch has a tab character there,
and it shows up with a tab character in my copy of the xen-devel list.

As a quick workaround, I have pushed these patches to my github repository:
https://github.com/danieldg/xen-unstable/commits/vtpm

> 
> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>> This changes the vTPM shared page ABI from a copy of the Xen network
>> interface to a single-page interface that better reflects the expected
>> behavior of a TPM: only a single request packet can be sent at any given
>> time, and every packet sent generates a single response packet. This
>> protocol change should also increase efficiency as it avoids mapping and
>> unmapping grants when possible.
>>
>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> ---
>>   extras/mini-os/include/tpmback.h  |   1 +
>>   extras/mini-os/include/tpmfront.h |   7 +-
>>   extras/mini-os/tpmback.c          | 159 +++++++++++++++++++------------------
>>   extras/mini-os/tpmfront.c         | 162 ++++++++++++++++++++++----------------
>>   xen/include/public/io/tpmif.h     |  45 +++--------
>>   5 files changed, 191 insertions(+), 183 deletions(-)
>>
>> diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
>> index ff86732..ec9eda4 100644
>> --- a/extras/mini-os/include/tpmback.h
>> +++ b/extras/mini-os/include/tpmback.h
>> @@ -43,6 +43,7 @@
>>
>>   struct tpmcmd {
>>      domid_t domid;              /* Domid of the frontend */
>> +   uint8_t locality;    /* Locality requested by the frontend */
>>      unsigned int handle;        /* Handle of the frontend */
>>      unsigned char uuid[16];                     /* uuid of the tpm interface */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 22:09:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 22:09:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdTLA-0004w1-3n; Tue, 27 Nov 2012 22:09:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdTL9-0004vw-0T
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 22:09:15 +0000
Received: from [85.158.143.35:31707] by server-2.bemta-4.messagelabs.com id
	1B/63-28922-A0A35B05; Tue, 27 Nov 2012 22:09:14 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-21.messagelabs.com!1354054112!13899224!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18884 invoked from network); 27 Nov 2012 22:08:33 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-15.tower-21.messagelabs.com with SMTP;
	27 Nov 2012 22:08:33 -0000
X-TM-IMSS-Message-ID: <25850b6a00007ad0@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 25850b6a00007ad0 ;
	Tue, 27 Nov 2012 17:07:29 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARM8T1c002162; 
	Tue, 27 Nov 2012 17:08:29 -0500
Message-ID: <50B539DD.7050206@tycho.nsa.gov>
Date: Tue, 27 Nov 2012 17:08:29 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-2-git-send-email-dgdegra@tycho.nsa.gov>
	<50B530D2.1060303@jhuapl.edu>
In-Reply-To: <50B530D2.1060303@jhuapl.edu>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/4] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/27/2012 04:29 PM, Matthew Fioravante wrote:
> I can't get this patch to apply. It looks like your editor or something else is converting tabs to whitespace. For instance the line in tpmback.h
> 
>     domid_t domid;              /* Domid of the frontend */
> 
> has tabs between domid; and /*. It looks like this also happened to your linux patch.

The problem looks like it's on your end; my patch has a tab character there,
and it shows up with a tab character in my copy of the xen-devel list.

As a quick workaround, I have pushed these patches to my github repository:
https://github.com/danieldg/xen-unstable/commits/vtpm

> 
> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>> This changes the vTPM shared page ABI from a copy of the Xen network
>> interface to a single-page interface that better reflects the expected
>> behavior of a TPM: only a single request packet can be sent at any given
>> time, and every packet sent generates a single response packet. This
>> protocol change should also increase efficiency as it avoids mapping and
>> unmapping grants when possible.
>>
>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> ---
>>   extras/mini-os/include/tpmback.h  |   1 +
>>   extras/mini-os/include/tpmfront.h |   7 +-
>>   extras/mini-os/tpmback.c          | 159 +++++++++++++++++++------------------
>>   extras/mini-os/tpmfront.c         | 162 ++++++++++++++++++++++----------------
>>   xen/include/public/io/tpmif.h     |  45 +++--------
>>   5 files changed, 191 insertions(+), 183 deletions(-)
>>
>> diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
>> index ff86732..ec9eda4 100644
>> --- a/extras/mini-os/include/tpmback.h
>> +++ b/extras/mini-os/include/tpmback.h
>> @@ -43,6 +43,7 @@
>>
>>   struct tpmcmd {
>>      domid_t domid;              /* Domid of the frontend */
>> +   uint8_t locality;    /* Locality requested by the frontend */
>>      unsigned int handle;        /* Handle of the frontend */
>>      unsigned char uuid[16];                     /* uuid of the tpm interface */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 22:17:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 22:17:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdTSu-00057Y-2f; Tue, 27 Nov 2012 22:17:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdTSs-00057T-GI
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 22:17:14 +0000
Received: from [85.158.143.35:31852] by server-3.bemta-4.messagelabs.com id
	EC/68-06841-9EB35B05; Tue, 27 Nov 2012 22:17:13 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-2.tower-21.messagelabs.com!1354054626!4761296!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15557 invoked from network); 27 Nov 2012 22:17:07 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-2.tower-21.messagelabs.com with SMTP;
	27 Nov 2012 22:17:07 -0000
X-TM-IMSS-Message-ID: <258cbabb00007bc4@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 258cbabb00007bc4 ;
	Tue, 27 Nov 2012 17:15:53 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARMGrMF002744; 
	Tue, 27 Nov 2012 17:16:53 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu
Date: Tue, 27 Nov 2012 17:16:50 -0500
Message-Id: <1354054610-10720-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <50B52524.6030707@tycho.nsa.gov>
References: <50B52524.6030707@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] stubdom/vtpm: make state save operation atomic
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This changes the save format of the vtpm stubdom to include two copies
of the saved data: one active, and one inactive. When saving the state,
data is written to the inactive slot before updating the key and hash
saved with the TPM Manager, which determines the active slot when the
vTPM starts up.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpm/vtpmblk.c | 66 +++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 54 insertions(+), 12 deletions(-)

diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
index b343bd8..f988606 100644
--- a/stubdom/vtpm/vtpmblk.c
+++ b/stubdom/vtpm/vtpmblk.c
@@ -23,6 +23,8 @@
 
 /*Encryption key and block sizes */
 #define BLKSZ 16
+/* Maximum size of one saved-state slot */
+#define SLOT_SIZE 32768
 
 static struct blkfront_dev* blkdev = NULL;
 static int blkfront_fd = -1;
@@ -59,15 +61,20 @@ void shutdown_vtpmblk(void)
    blkdev = NULL;
 }
 
-int write_vtpmblk_raw(uint8_t *data, size_t data_length)
+static int write_vtpmblk_raw(uint8_t *data, size_t data_length, int slot)
 {
    int rc;
    uint32_t lenbuf;
    debug("Begin Write data=%p len=%u", data, data_length);
 
+   if (data_length > SLOT_SIZE - 4) {
+      error("write(data) cannot fit in data slot (%d). Increase SLOT_SIZE.", data_length);
+      return -1;
+   }
+
    lenbuf = cpu_to_be32((uint32_t)data_length);
 
-   lseek(blkfront_fd, 0, SEEK_SET);
+   lseek(blkfront_fd, slot * SLOT_SIZE, SEEK_SET);
    if((rc = write(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
       error("write(length) failed! error was %s", strerror(errno));
       return -1;
@@ -82,12 +89,12 @@ int write_vtpmblk_raw(uint8_t *data, size_t data_length)
    return 0;
 }
 
-int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
+static int read_vtpmblk_raw(uint8_t **data, size_t *data_length, int slot)
 {
    int rc;
    uint32_t lenbuf;
 
-   lseek(blkfront_fd, 0, SEEK_SET);
+   lseek(blkfront_fd, slot * SLOT_SIZE, SEEK_SET);
    if(( rc = read(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
       error("read(length) failed! error was %s", strerror(errno));
       return -1;
@@ -97,6 +104,10 @@ int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
       error("read 0 data_length for NVM");
       return -1;
    }
+   if(*data_length > SLOT_SIZE - 4) {
+      error("read invalid data_length for NVM");
+      return -1;
+   }
 
    *data = tpm_malloc(*data_length);
    if((rc = read(blkfront_fd, *data, *data_length)) != *data_length) {
@@ -221,6 +232,8 @@ egress:
    return rc;
 }
 
+static int active_slot = -1;
+
 int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length) {
    int rc;
    uint8_t* cipher = NULL;
@@ -228,12 +241,15 @@ int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_
    uint8_t hashkey[HASHKEYSZ];
    uint8_t* symkey = hashkey + HASHSZ;
 
+   /* Switch to the other slot */
+   active_slot = !active_slot;
+
    /* Encrypt the data */
    if((rc = encrypt_vtpmblk(data, data_length, &cipher, &cipher_len, symkey))) {
       goto abort_egress;
    }
    /* Write to disk */
-   if((rc = write_vtpmblk_raw(cipher, cipher_len))) {
+   if((rc = write_vtpmblk_raw(cipher, cipher_len, active_slot))) {
       goto abort_egress;
    }
    /* Get sha1 hash of data */
@@ -256,7 +272,8 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
    size_t cipher_len = 0;
    size_t keysize;
    uint8_t* hashkey = NULL;
-   uint8_t hash[HASHSZ];
+   uint8_t hash0[HASHSZ];
+   uint8_t hash1[HASHSZ];
    uint8_t* symkey;
 
    /* Retreive the hash and the key from the manager */
@@ -270,14 +287,32 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
    }
    symkey = hashkey + HASHSZ;
 
-   /* Read from disk now */
-   if((rc = read_vtpmblk_raw(&cipher, &cipher_len))) {
+   active_slot = 0;
+   /* Read slot 0 from disk now */
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len, 0))) {
+      goto abort_egress;
+   }
+
+   /* Compute the hash of the cipher text and compare */
+   sha1(cipher, cipher_len, hash0);
+   if(!memcmp(hash0, hashkey, HASHSZ))
+      goto valid;
+
+   free(cipher);
+   cipher = NULL;
+
+   active_slot = 1;
+   /* Read slot 1 from disk now */
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len, 1))) {
       goto abort_egress;
    }
 
    /* Compute the hash of the cipher text and compare */
-   sha1(cipher, cipher_len, hash);
-   if(memcmp(hash, hashkey, HASHSZ)) {
+   sha1(cipher, cipher_len, hash1);
+   if(!memcmp(hash1, hashkey, HASHSZ))
+      goto valid;
+
+   {
       int i;
       error("NVM Storage Checksum failed!");
       printf("Expected: ");
@@ -285,14 +320,20 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
 	 printf("%02hhX ", hashkey[i]);
       }
       printf("\n");
-      printf("Actual:   ");
+      printf("Slot 0:   ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hash0[i]);
+      }
+      printf("\n");
+      printf("Slot 1:   ");
       for(i = 0; i < HASHSZ; ++i) {
-	 printf("%02hhX ", hash[i]);
+	 printf("%02hhX ", hash1[i]);
       }
       printf("\n");
       rc = -1;
       goto abort_egress;
    }
+valid:
 
    /* Decrypt the blob */
    if((rc = decrypt_vtpmblk(cipher, cipher_len, data, data_length, symkey))) {
@@ -300,6 +341,7 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
    }
    goto egress;
 abort_egress:
+   active_slot = -1;
 egress:
    free(cipher);
    free(hashkey);
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 22:17:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 22:17:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdTSu-00057Y-2f; Tue, 27 Nov 2012 22:17:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TdTSs-00057T-GI
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 22:17:14 +0000
Received: from [85.158.143.35:31852] by server-3.bemta-4.messagelabs.com id
	EC/68-06841-9EB35B05; Tue, 27 Nov 2012 22:17:13 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-2.tower-21.messagelabs.com!1354054626!4761296!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15557 invoked from network); 27 Nov 2012 22:17:07 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-2.tower-21.messagelabs.com with SMTP;
	27 Nov 2012 22:17:07 -0000
X-TM-IMSS-Message-ID: <258cbabb00007bc4@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 258cbabb00007bc4 ;
	Tue, 27 Nov 2012 17:15:53 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qARMGrMF002744; 
	Tue, 27 Nov 2012 17:16:53 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu
Date: Tue, 27 Nov 2012 17:16:50 -0500
Message-Id: <1354054610-10720-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <50B52524.6030707@tycho.nsa.gov>
References: <50B52524.6030707@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian.Campbell@citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] stubdom/vtpm: make state save operation atomic
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This changes the save format of the vtpm stubdom to include two copies
of the saved data: one active, and one inactive. When saving the state,
data is written to the inactive slot before updating the key and hash
saved with the TPM Manager, which determines the active slot when the
vTPM starts up.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpm/vtpmblk.c | 66 +++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 54 insertions(+), 12 deletions(-)

diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
index b343bd8..f988606 100644
--- a/stubdom/vtpm/vtpmblk.c
+++ b/stubdom/vtpm/vtpmblk.c
@@ -23,6 +23,8 @@
 
 /*Encryption key and block sizes */
 #define BLKSZ 16
+/* Maximum size of one saved-state slot */
+#define SLOT_SIZE 32768
 
 static struct blkfront_dev* blkdev = NULL;
 static int blkfront_fd = -1;
@@ -59,15 +61,20 @@ void shutdown_vtpmblk(void)
    blkdev = NULL;
 }
 
-int write_vtpmblk_raw(uint8_t *data, size_t data_length)
+static int write_vtpmblk_raw(uint8_t *data, size_t data_length, int slot)
 {
    int rc;
    uint32_t lenbuf;
    debug("Begin Write data=%p len=%u", data, data_length);
 
+   if (data_length > SLOT_SIZE - 4) {
+      error("write(data) cannot fit in data slot (%d). Increase SLOT_SIZE.", data_length);
+      return -1;
+   }
+
    lenbuf = cpu_to_be32((uint32_t)data_length);
 
-   lseek(blkfront_fd, 0, SEEK_SET);
+   lseek(blkfront_fd, slot * SLOT_SIZE, SEEK_SET);
    if((rc = write(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
       error("write(length) failed! error was %s", strerror(errno));
       return -1;
@@ -82,12 +89,12 @@ int write_vtpmblk_raw(uint8_t *data, size_t data_length)
    return 0;
 }
 
-int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
+static int read_vtpmblk_raw(uint8_t **data, size_t *data_length, int slot)
 {
    int rc;
    uint32_t lenbuf;
 
-   lseek(blkfront_fd, 0, SEEK_SET);
+   lseek(blkfront_fd, slot * SLOT_SIZE, SEEK_SET);
    if(( rc = read(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
       error("read(length) failed! error was %s", strerror(errno));
       return -1;
@@ -97,6 +104,10 @@ int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
       error("read 0 data_length for NVM");
       return -1;
    }
+   if(*data_length > SLOT_SIZE - 4) {
+      error("read invalid data_length for NVM");
+      return -1;
+   }
 
    *data = tpm_malloc(*data_length);
    if((rc = read(blkfront_fd, *data, *data_length)) != *data_length) {
@@ -221,6 +232,8 @@ egress:
    return rc;
 }
 
+static int active_slot = -1;
+
 int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length) {
    int rc;
    uint8_t* cipher = NULL;
@@ -228,12 +241,15 @@ int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_
    uint8_t hashkey[HASHKEYSZ];
    uint8_t* symkey = hashkey + HASHSZ;
 
+   /* Switch to the other slot */
+   active_slot = !active_slot;
+
    /* Encrypt the data */
    if((rc = encrypt_vtpmblk(data, data_length, &cipher, &cipher_len, symkey))) {
       goto abort_egress;
    }
    /* Write to disk */
-   if((rc = write_vtpmblk_raw(cipher, cipher_len))) {
+   if((rc = write_vtpmblk_raw(cipher, cipher_len, active_slot))) {
       goto abort_egress;
    }
    /* Get sha1 hash of data */
@@ -256,7 +272,8 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
    size_t cipher_len = 0;
    size_t keysize;
    uint8_t* hashkey = NULL;
-   uint8_t hash[HASHSZ];
+   uint8_t hash0[HASHSZ];
+   uint8_t hash1[HASHSZ];
    uint8_t* symkey;
 
    /* Retreive the hash and the key from the manager */
@@ -270,14 +287,32 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
    }
    symkey = hashkey + HASHSZ;
 
-   /* Read from disk now */
-   if((rc = read_vtpmblk_raw(&cipher, &cipher_len))) {
+   active_slot = 0;
+   /* Read slot 0 from disk now */
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len, 0))) {
+      goto abort_egress;
+   }
+
+   /* Compute the hash of the cipher text and compare */
+   sha1(cipher, cipher_len, hash0);
+   if(!memcmp(hash0, hashkey, HASHSZ))
+      goto valid;
+
+   free(cipher);
+   cipher = NULL;
+
+   active_slot = 1;
+   /* Read slot 1 from disk now */
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len, 1))) {
       goto abort_egress;
    }
 
    /* Compute the hash of the cipher text and compare */
-   sha1(cipher, cipher_len, hash);
-   if(memcmp(hash, hashkey, HASHSZ)) {
+   sha1(cipher, cipher_len, hash1);
+   if(!memcmp(hash1, hashkey, HASHSZ))
+      goto valid;
+
+   {
       int i;
       error("NVM Storage Checksum failed!");
       printf("Expected: ");
@@ -285,14 +320,20 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
 	 printf("%02hhX ", hashkey[i]);
       }
       printf("\n");
-      printf("Actual:   ");
+      printf("Slot 0:   ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hash0[i]);
+      }
+      printf("\n");
+      printf("Slot 1:   ");
       for(i = 0; i < HASHSZ; ++i) {
-	 printf("%02hhX ", hash[i]);
+	 printf("%02hhX ", hash1[i]);
       }
       printf("\n");
       rc = -1;
       goto abort_egress;
    }
+valid:
 
    /* Decrypt the blob */
    if((rc = decrypt_vtpmblk(cipher, cipher_len, data, data_length, symkey))) {
@@ -300,6 +341,7 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
    }
    goto egress;
 abort_egress:
+   active_slot = -1;
 egress:
    free(cipher);
    free(hashkey);
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 23:13:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 23:13:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdUL0-0005Xa-N4; Tue, 27 Nov 2012 23:13:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TdUKz-0005XS-Nl
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 23:13:09 +0000
Received: from [85.158.143.35:60096] by server-3.bemta-4.messagelabs.com id
	9D/3D-06841-40945B05; Tue, 27 Nov 2012 23:13:08 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1354057987!13177848!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzk3NDU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32680 invoked from network); 27 Nov 2012 23:13:08 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 23:13:08 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qARND1eH031689
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 27 Nov 2012 23:13:02 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qARND1PT025981
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 27 Nov 2012 23:13:01 GMT
Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qARND07s026363; Tue, 27 Nov 2012 17:13:00 -0600
MIME-Version: 1.0
Message-ID: <1eddc947-d21e-4e2e-892f-c5d8dfd57e8b@default>
Date: Tue, 27 Nov 2012 15:12:59 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <07fd91ec-8b57-47d8-a44d-3b593de6bb9f@default>
	<50B48A2302000078000AB837@nat28.tlf.novell.com>
In-Reply-To: <50B48A2302000078000AB837@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	AndresLagar-Cavilla <andreslc@gridcentric.ca>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [PATCH v7 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Subject: Re: [PATCH v7 1/2] hypervisor: XENMEM_claim_pages (subop of existing) hypercall
> 
> >>> On 26.11.12 at 19:11, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> > +unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pages)
> > +{
> > +    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
> > +
> > +    ASSERT(spin_is_locked(&d->page_alloc_lock));
> > +    if ( !d->unclaimed_pages )
> > +        return d->tot_pages += pages;
> 
> So after the conditional adjustment above, I fail to see where
> d->tot_pages would get adjusted in the code below. Which gets
> me to ask ...

Yep.  Looks like I accidentally lost a line of code somewhere.
 
> > +    spin_lock(&heap_lock);
> > +    dom_before = d->unclaimed_pages;
> > +    dom_after = dom_before - pages;
> > +    if ( (dom_before > 0) && (dom_after < 0) )
> > +        dom_claimed = 0;
> > +    else
> > +        dom_claimed = dom_after;
> > +    sys_before = total_unclaimed_pages;
> > +    sys_after = sys_before - (dom_before - dom_claimed);
> > +    BUG_ON( (sys_before > 0) && (sys_after < 0) );
> > +    total_unclaimed_pages = sys_after;
> > +    d->unclaimed_pages = dom_claimed;
> > +    spin_unlock(&heap_lock);
> > +    return d->tot_pages;
> > +}
> 
> ...: Is there actually a strong reason why there needs to be an
> "increase" and a "decrease" version of this, rather than just
> having an "adjust" operation with a signed page count
> parameter?

Good point.  A good part of the logic seems different for the
two cases but the special cases in the increase case can
never occur in the decrease case and the additional checks
are harmless, so increase and decrease can be combined.

Spinning v8....

Thanks,
Dan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 23:13:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 23:13:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdUL0-0005Xa-N4; Tue, 27 Nov 2012 23:13:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TdUKz-0005XS-Nl
	for xen-devel@lists.xen.org; Tue, 27 Nov 2012 23:13:09 +0000
Received: from [85.158.143.35:60096] by server-3.bemta-4.messagelabs.com id
	9D/3D-06841-40945B05; Tue, 27 Nov 2012 23:13:08 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1354057987!13177848!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gNzk3NDU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32680 invoked from network); 27 Nov 2012 23:13:08 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 27 Nov 2012 23:13:08 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qARND1eH031689
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 27 Nov 2012 23:13:02 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qARND1PT025981
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 27 Nov 2012 23:13:01 GMT
Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qARND07s026363; Tue, 27 Nov 2012 17:13:00 -0600
MIME-Version: 1.0
Message-ID: <1eddc947-d21e-4e2e-892f-c5d8dfd57e8b@default>
Date: Tue, 27 Nov 2012 15:12:59 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <07fd91ec-8b57-47d8-a44d-3b593de6bb9f@default>
	<50B48A2302000078000AB837@nat28.tlf.novell.com>
In-Reply-To: <50B48A2302000078000AB837@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	AndresLagar-Cavilla <andreslc@gridcentric.ca>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [PATCH v7 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Subject: Re: [PATCH v7 1/2] hypervisor: XENMEM_claim_pages (subop of existing) hypercall
> 
> >>> On 26.11.12 at 19:11, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> > +unsigned long domain_increase_tot_pages(struct domain *d, unsigned long pages)
> > +{
> > +    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
> > +
> > +    ASSERT(spin_is_locked(&d->page_alloc_lock));
> > +    if ( !d->unclaimed_pages )
> > +        return d->tot_pages += pages;
> 
> So after the conditional adjustment above, I fail to see where
> d->tot_pages would get adjusted in the code below. Which gets
> me to ask ...

Yep.  Looks like I accidentally lost a line of code somewhere.
 
> > +    spin_lock(&heap_lock);
> > +    dom_before = d->unclaimed_pages;
> > +    dom_after = dom_before - pages;
> > +    if ( (dom_before > 0) && (dom_after < 0) )
> > +        dom_claimed = 0;
> > +    else
> > +        dom_claimed = dom_after;
> > +    sys_before = total_unclaimed_pages;
> > +    sys_after = sys_before - (dom_before - dom_claimed);
> > +    BUG_ON( (sys_before > 0) && (sys_after < 0) );
> > +    total_unclaimed_pages = sys_after;
> > +    d->unclaimed_pages = dom_claimed;
> > +    spin_unlock(&heap_lock);
> > +    return d->tot_pages;
> > +}
> 
> ...: Is there actually a strong reason why there needs to be an
> "increase" and a "decrease" version of this, rather than just
> having an "adjust" operation with a signed page count
> parameter?

Good point.  A good part of the logic seems different for the
two cases but the special cases in the increase case can
never occur in the decrease case and the additional checks
are harmless, so increase and decrease can be combined.

Spinning v8....

Thanks,
Dan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 23:31:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 23:31:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdUbv-0005i5-BJ; Tue, 27 Nov 2012 23:30:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TdUbt-0005i0-Up
	for Xen-devel@lists.xensource.com; Tue, 27 Nov 2012 23:30:38 +0000
Received: from [85.158.139.83:36691] by server-4.bemta-5.messagelabs.com id
	B1/2B-15011-C1D45B05; Tue, 27 Nov 2012 23:30:36 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1354059034!31664764!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NzUxMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25970 invoked from network); 27 Nov 2012 23:30:36 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-13.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 23:30:36 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qARNUXHo026571
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 27 Nov 2012 23:30:34 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qARNUVDY007820
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 27 Nov 2012 23:30:33 GMT
Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qARNUVSC027738; Tue, 27 Nov 2012 17:30:31 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 27 Nov 2012 15:30:31 -0800
Date: Tue, 27 Nov 2012 15:30:29 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Message-ID: <20121127153029.7296ea69@mantra.us.oracle.com>
In-Reply-To: <20121126195400.GA8025@phenom.dumpdata.com>
References: <20121114181933.1ffb5f09@mantra.us.oracle.com>
	<20121126195400.GA8025@phenom.dumpdata.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH]:  PVH: remove FEATURES_PVH macro
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 26 Nov 2012 14:54:00 -0500
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:

> On Wed, Nov 14, 2012 at 06:19:33PM -0800, Mukesh Rathor wrote:
> > PVH: remove macro FEATURES_PVH and put PVH strings in the ELFNOTE
> > line, because there's a null char before FEATURES_PVH and in the
> > FEATURES_PVH strings since this is not C file
> 
> ping? Jan had a comment about it to keep the #ifdef at the top
> and combine ascii and asiz?

Ok, if you'd like that too, I'll look into it. I need to RTFM.

thanks
Mukesh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Tue Nov 27 23:31:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Nov 2012 23:31:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdUbv-0005i5-BJ; Tue, 27 Nov 2012 23:30:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TdUbt-0005i0-Up
	for Xen-devel@lists.xensource.com; Tue, 27 Nov 2012 23:30:38 +0000
Received: from [85.158.139.83:36691] by server-4.bemta-5.messagelabs.com id
	B1/2B-15011-C1D45B05; Tue, 27 Nov 2012 23:30:36 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1354059034!31664764!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA4NzUxMg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25970 invoked from network); 27 Nov 2012 23:30:36 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-13.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 27 Nov 2012 23:30:36 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qARNUXHo026571
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 27 Nov 2012 23:30:34 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qARNUVDY007820
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 27 Nov 2012 23:30:33 GMT
Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qARNUVSC027738; Tue, 27 Nov 2012 17:30:31 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 27 Nov 2012 15:30:31 -0800
Date: Tue, 27 Nov 2012 15:30:29 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Message-ID: <20121127153029.7296ea69@mantra.us.oracle.com>
In-Reply-To: <20121126195400.GA8025@phenom.dumpdata.com>
References: <20121114181933.1ffb5f09@mantra.us.oracle.com>
	<20121126195400.GA8025@phenom.dumpdata.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH]:  PVH: remove FEATURES_PVH macro
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 26 Nov 2012 14:54:00 -0500
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:

> On Wed, Nov 14, 2012 at 06:19:33PM -0800, Mukesh Rathor wrote:
> > PVH: remove macro FEATURES_PVH and put PVH strings in the ELFNOTE
> > line, because there's a null char before FEATURES_PVH and in the
> > FEATURES_PVH strings since this is not C file
> 
> ping? Jan had a comment about it to keep the #ifdef at the top
> and combine ascii and asiz?

Ok, if you'd like that too, I'll look into it. I need to RTFM.

thanks
Mukesh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 04:20:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 04:20:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdZ7c-0002mK-Mk; Wed, 28 Nov 2012 04:19:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TdZ7a-0002mF-IG
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 04:19:38 +0000
Received: from [85.158.139.211:48542] by server-9.bemta-5.messagelabs.com id
	D1/57-29295-9D095B05; Wed, 28 Nov 2012 04:19:37 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1354076376!16631984!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQzNTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18793 invoked from network); 28 Nov 2012 04:19:37 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 04:19:37 -0000
X-IronPort-AV: E=Sophos;i="4.84,175,1355097600"; d="scan'208";a="16036384"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 04:19:36 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 28 Nov 2012 04:19:36 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TdZ7Y-0002c2-Cp;
	Wed, 28 Nov 2012 04:19:36 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TdZ7Y-0005EY-0K;
	Wed, 28 Nov 2012 04:19:36 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14484-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 28 Nov 2012 04:19:36 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.1-testing test] 14484: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14484 xen-4.1-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14484/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail like 14419
 test-amd64-amd64-xl-sedf     14 guest-localmigrate/x10       fail   like 14419

Tests which did not succeed, but are not blocking:
 test-amd64-i386-qemut-rhel6hvm-amd 11 leak-check/check         fail never pass
 test-amd64-i386-qemut-rhel6hvm-intel 11 leak-check/check       fail never pass
 test-amd64-i386-qemuu-rhel6hvm-intel 11 leak-check/check       fail never pass
 test-amd64-i386-qemuu-rhel6hvm-amd 11 leak-check/check         fail never pass
 test-amd64-i386-rhel6hvm-intel 11 leak-check/check             fail never pass
 test-amd64-i386-rhel6hvm-amd 11 leak-check/check             fail   never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-i386-i386-qemut-win     16 leak-check/check             fail   never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-i386-i386-xl-qemut-win  13 guest-stop                   fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-i386-i386-xl-qemut-winxpsp3 13 guest-stop                 fail never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-i386-i386-xl-qemuu-winxpsp3 13 guest-stop                 fail never pass

version targeted for testing:
 xen                  d89986111f0c
baseline version:
 xen                  5639047d6c9f

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 fail    
 test-amd64-i386-qemut-rhel6hvm-amd                           fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               fail    
 test-amd64-i386-qemut-rhel6hvm-intel                         fail    
 test-amd64-i386-qemuu-rhel6hvm-intel                         fail    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 pass    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-i386-i386-qemut-win                                     fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-i386-i386-xl-qemut-win                                  fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-i386-i386-xl-qemut-winxpsp3                             fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.1-testing
+ revision=d89986111f0c
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.1-testing d89986111f0c
+ branch=xen-4.1-testing
+ revision=d89986111f0c
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.1-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.1-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.1-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.1-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.1-testing.git
++ : daily-cron.xen-4.1-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.1-testing.git
+ info_linux_tree xen-4.1-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.1-testing.hg
+ hg push -r d89986111f0c ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 04:20:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 04:20:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdZ7c-0002mK-Mk; Wed, 28 Nov 2012 04:19:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TdZ7a-0002mF-IG
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 04:19:38 +0000
Received: from [85.158.139.211:48542] by server-9.bemta-5.messagelabs.com id
	D1/57-29295-9D095B05; Wed, 28 Nov 2012 04:19:37 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1354076376!16631984!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQzNTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18793 invoked from network); 28 Nov 2012 04:19:37 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 04:19:37 -0000
X-IronPort-AV: E=Sophos;i="4.84,175,1355097600"; d="scan'208";a="16036384"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 04:19:36 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 28 Nov 2012 04:19:36 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TdZ7Y-0002c2-Cp;
	Wed, 28 Nov 2012 04:19:36 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TdZ7Y-0005EY-0K;
	Wed, 28 Nov 2012 04:19:36 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14484-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 28 Nov 2012 04:19:36 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.1-testing test] 14484: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14484 xen-4.1-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14484/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-pcipt-intel  8 debian-fixup                fail like 14419
 test-amd64-amd64-xl-sedf     14 guest-localmigrate/x10       fail   like 14419

Tests which did not succeed, but are not blocking:
 test-amd64-i386-qemut-rhel6hvm-amd 11 leak-check/check         fail never pass
 test-amd64-i386-qemut-rhel6hvm-intel 11 leak-check/check       fail never pass
 test-amd64-i386-qemuu-rhel6hvm-intel 11 leak-check/check       fail never pass
 test-amd64-i386-qemuu-rhel6hvm-amd 11 leak-check/check         fail never pass
 test-amd64-i386-rhel6hvm-intel 11 leak-check/check             fail never pass
 test-amd64-i386-rhel6hvm-amd 11 leak-check/check             fail   never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-i386-i386-qemut-win     16 leak-check/check             fail   never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-i386-i386-xl-qemut-win  13 guest-stop                   fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 13 guest-stop             fail never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-i386-i386-xl-qemut-winxpsp3 13 guest-stop                 fail never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-i386-i386-xl-qemuu-winxpsp3 13 guest-stop                 fail never pass

version targeted for testing:
 xen                  d89986111f0c
baseline version:
 xen                  5639047d6c9f

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 fail    
 test-amd64-i386-qemut-rhel6hvm-amd                           fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               fail    
 test-amd64-i386-qemut-rhel6hvm-intel                         fail    
 test-amd64-i386-qemuu-rhel6hvm-intel                         fail    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 pass    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-i386-i386-qemut-win                                     fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-i386-i386-xl-qemut-win                                  fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-i386-i386-xl-qemut-winxpsp3                             fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.1-testing
+ revision=d89986111f0c
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.1-testing d89986111f0c
+ branch=xen-4.1-testing
+ revision=d89986111f0c
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.1-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.1-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.1-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.1-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.1-testing.git
++ : daily-cron.xen-4.1-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.1-testing.git
+ info_linux_tree xen-4.1-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.1-testing.hg
+ hg push -r d89986111f0c ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.1-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 04:42:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 04:42:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdZTe-0002z6-Rj; Wed, 28 Nov 2012 04:42:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <davidxu06@gmail.com>) id 1TdZTd-0002z1-Oh
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 04:42:26 +0000
Received: from [85.158.139.211:28840] by server-5.bemta-5.messagelabs.com id
	EE/68-11353-03695B05; Wed, 28 Nov 2012 04:42:24 +0000
X-Env-Sender: davidxu06@gmail.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1354077732!18151731!1
X-Originating-IP: [209.85.216.173]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_50_60,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31802 invoked from network); 28 Nov 2012 04:42:18 -0000
Received: from mail-qc0-f173.google.com (HELO mail-qc0-f173.google.com)
	(209.85.216.173)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 04:42:18 -0000
Received: by mail-qc0-f173.google.com with SMTP id b12so11086703qca.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 20:42:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=3ulgRaakVK2ntUClVbPO4kT/kmoBVWreHI9WmvCP3g8=;
	b=wbvoEg61CO6M9Fe80Njt+zKD5ieq4pD71N2mJ6282TOn8NhUzji6sTSff8sVi9Fzm8
	xGBeE8U8p7avFEepkHuOzZvrQAT0+pmbjNViIlm8a/XXmNn49CxJ5P8wJUOng5BljaTi
	2yj0jGiIPEG+X5BfDI+Ge87+x+ojcAMTY2i+nWFGbdT0JrqrddSXQH3GiJYA/odjkwRL
	MyNrMfGOXVDnjHV13S+wuo9LIwBwHL4qy6XrMGGR0noMZCNS7uKH365YssawRkZvD+KW
	QPfLjgJBgaPEpkW3MlExhkMpJIlIpte5svRmgGuVH1GCKsh9+N+LktyOaT329gaSAaL4
	z7oA==
MIME-Version: 1.0
Received: by 10.224.31.204 with SMTP id z12mr18798574qac.32.1354077731630;
	Tue, 27 Nov 2012 20:42:11 -0800 (PST)
Received: by 10.49.1.116 with HTTP; Tue, 27 Nov 2012 20:42:11 -0800 (PST)
Date: Tue, 27 Nov 2012 23:42:11 -0500
Message-ID: <CAGjowiTthyZp735bRbm6i5V2gZWD+LPe0sjbTeKeb+tBwkkWEA@mail.gmail.com>
From: David Xu <davidxu06@gmail.com>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] why we need call xennet_alloc_rx_buffers() in
 xennet_poll() in Netfront module?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6558328419457028082=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6558328419457028082==
Content-Type: multipart/alternative; boundary=20cf3074b0a431303c04cf86ca16

--20cf3074b0a431303c04cf86ca16
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: quoted-printable

Hi all,

Why we call xennet_alloc_rx_buffers function in xennet_poll of netfront?

When I run the iperf benchmark to measure the TCP throughput between a
physical machine and a VM, the TCP server which is a Xen VM crashed.

I traced the source code and found that the error is from  xennet_poll
=3D>  xennet_alloc_rx_buffers =3D> __skb_dequeue =3D> __skb_unlink

1187 static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list)
1188 {
1189         struct sk_buff *skb =3D skb_peek(list);
1190         if (skb)
1191                 __skb_unlink(skb, list);
1192         return skb;
1193 }

error is from __skb_unlink=A3=BA

1166 static inline void __skb_unlink(struct sk_buff *skb, struct
sk_buff_head *list)
1167 {
1168         struct sk_buff *next, *prev;
1169
1170         list->qlen--;
1171         next       =3D skb->next;
1172         prev       =3D skb->prev;
1173         skb->next  =3D skb->prev =3D NULL;
1174         next->prev =3D prev;
1175         prev->next =3D next;
1176 }

in this line: next->prev =3D prev; I found the pointer "next" is NULL

Do you know why? Thanks.

[  100.973027] BUG: unable to handle kernel NULL pointer dereference at
0000000000000008
[  100.973040] IP: [<ffffffff81455f16>] xennet_alloc_rx_buffers+0x166/0x350
[  100.973050] PGD 1cc98067 PUD 1d74c067 PMD 0
[  100.973051] Oops: 0002 [#1] SMP
[  100.973051] CPU 1
[  100.973051] Modules linked in:
[  100.973051]
[  100.973051] Pid: 9, comm: ksoftirqd/1 Not tainted 3.2.23 #131
[  100.973051] RIP: e030:[<ffffffff81455f16>]  [<ffffffff81455f16>]
xennet_alloc_rx_buffers+0x166/0x350
[  100.973051] RSP: e02b:ffff88001e8f1c10  EFLAGS: 00010206
[  100.973051] RAX: 0000000000000000 RBX: ffff88001da98000 RCX:
00000000000012b0
[  100.973051] RDX: 0000000000000000 RSI: 0000000000000000 RDI:
0000000000000256
[  100.973051] RBP: ffff88001e8f1c60 R08: ffffc90000000000 R09:
0000000000017a41
[  100.973051] R10: 0000000000000002 R11: 0000000000017298 R12:
ffff880019a7b700
[  100.973051] R13: 0000000000000256 R14: 0000000000012092 R15:
0000000000000092
[  100.973051] FS:  00007f7ace91f700(0000) GS:ffff88001fd00000(0000)
knlGS:0000000000000000
[  100.973051] CS:  e033 DS: 0000 ES: 0000 CR0: 000000008005003b
[  100.973051] CR2: 0000000000000008 CR3: 000000001da64000 CR4:
0000000000002660
[  100.973051] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
[  100.973051] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
0000000000000400
[  100.973051] Process ksoftirqd/1 (pid: 9, threadinfo ffff88001e8f0000,
task ffff88001e8d7000)
[  100.973051] Stack:
[  100.973051]  0000000000000091 ffff88001da99c80 ffff88001da99400
0000000100012091
[  100.973051]  ffff88001e8f1c60 000000000000002d ffff880019a8ac4e
ffff88001fd1a590
[  100.973051]  0000160000000000 ffff880000000000 ffff88001e8f1db0
ffffffff8145699a
[  100.973051] Call Trace:
[  100.973051]  [<ffffffff8145699a>] xennet_poll+0x7ca/0xe80
[  100.973051]  [<ffffffff814e3e51>] net_rx_action+0x151/0x2b0
[  100.973051]  [<ffffffff8106090d>] __do_softirq+0xbd/0x250
[  100.973051]  [<ffffffff81060b67>] run_ksoftirqd+0xc7/0x170
[  100.973051]  [<ffffffff81060aa0>] ? __do_softirq+0x250/0x250
[  100.973051]  [<ffffffff8107b0ac>] kthread+0x8c/0xa0
[  100.973051]  [<ffffffff8167ca04>] kernel_thread_helper+0x4/0x10
[  100.973051]  [<ffffffff81672d21>] ? retint_restore_args+0x13/0x13
[  100.973051]  [<ffffffff8167ca00>] ? gs_change+0x13/0x13
[  100.973051] Code: 0f 84 19 01 00 00 83 ab 10 14 00 00 01 45 0f b6 fe 49
8b 14 24 49 8b 44 24 08 49 c7 04 24 00 00 00 00 49 c7 44 24 08 00 00 00 00
<48> 89 42 08 48 89 10 41 0f b6 d7 49 89 5c 24 20 48 8d 82 b8 01
[  100.973051] RIP  [<ffffffff81455f16>] xennet_alloc_rx_buffers+0x166/0x35=
0
[  100.973051]  RSP <ffff88001e8f1c10>
[  100.973051] CR2: 0000000000000008
[  100.973259] ---[ end trace b0530821c3527d70 ]---
[  100.973263] Kernel panic - not syncing: Fatal exception in interrupt
[  100.973267] Pid: 9, comm: ksoftirqd/1 Tainted: G      D      3.2.23 #131
[  100.973270] Call Trace:
[  100.973273]  [<ffffffff816674ae>] panic+0x91/0x1a2
[  100.973278]  [<ffffffff8100adb2>] ? check_events+0x12/0x20
[  100.973282]  [<ffffffff81673b0a>] oops_end+0xea/0xf0
[  100.973286]  [<ffffffff81666e6b>] no_context+0x214/0x223
[  100.973291]  [<ffffffff8113cf94>] ? kmem_cache_free+0x104/0x110
[  100.973295]  [<ffffffff8166704b>] __bad_area_nosemaphore+0x1d1/0x1f0
[  100.973299]  [<ffffffff8166707d>] bad_area_nosemaphore+0x13/0x15
[  100.973304]  [<ffffffff816763fb>] do_page_fault+0x35b/0x4f0
[  100.973308]  [<ffffffff814d6044>] ? __netdev_alloc_skb+0x24/0x50
[  100.973313]  [<ffffffff8129f75a>] ? trace_hardirqs_off_thunk+0x3a/0x6c
[  100.973318]  [<ffffffff81672fa5>] page_fault+0x25/0x30
[  100.973322]  [<ffffffff81455f16>] ? xennet_alloc_rx_buffers+0x166/0x350
[  100.973326]  [<ffffffff8145699a>] xennet_poll+0x7ca/0xe80
[  100.973330]  [<ffffffff814e3e51>] net_rx_action+0x151/0x2b0
[  100.973334]  [<ffffffff8106090d>] __do_softirq+0xbd/0x250
[  100.973338]  [<ffffffff81060b67>] run_ksoftirqd+0xc7/0x170
[  100.973342]  [<ffffffff81060aa0>] ? __do_softirq+0x250/0x250
[  100.973346]  [<ffffffff8107b0ac>] kthread+0x8c/0xa0
[  100.973350]  [<ffffffff8167ca04>] kernel_thread_helper+0x4/0x10
[  100.973354]  [<ffffffff81672d21>] ? retint_restore_args+0x13/0x13
[  100.973358]  [<ffffffff8167ca00>] ? gs_change+0x13/0x13

Regards,
Cong

--20cf3074b0a431303c04cf86ca16
Content-Type: text/html; charset=GB2312
Content-Transfer-Encoding: quoted-printable

Hi all,<div><br></div><div>Why we call xennet_alloc_rx_buffers function in =
xennet_poll of netfront?&nbsp;</div><div><br></div><div><span style=3D"back=
ground-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-se=
rif;font-size:14px">When I run the iperf benchmark to measure the TCP throu=
ghput between a physical machine and a VM, the TCP server which is a Xen VM=
 crashed.&nbsp;</span></div>
<div><span style=3D"background-color:rgb(255,255,255);color:rgb(34,34,34);f=
ont-family:arial,sans-serif;font-size:14px"><br></span></div><div><span sty=
le=3D"background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:ari=
al,sans-serif;font-size:14px">I traced the source code and found that the e=
rror is from&nbsp;</span>&nbsp;xennet_poll =3D&gt;&nbsp;&nbsp;xennet_alloc_=
rx_buffers =3D&gt;&nbsp;<span style=3D"background-color:rgb(255,255,255);fo=
nt-family:monospace;font-size:medium">__skb_dequeue =3D&gt;&nbsp;</span><sp=
an style=3D"background-color:rgb(255,255,255);font-family:monospace;font-si=
ze:medium">__skb_unlink</span></div>
<div><span style=3D"background-color:rgb(255,255,255);color:rgb(34,34,34);f=
ont-family:arial,sans-serif;font-size:14px"><br></span></div><div><span sty=
le=3D"font-family:monospace;background-color:rgb(255,255,255);font-size:med=
ium">1187 static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *=
list)</span><br style=3D"font-family:monospace;font-size:medium">
<span style=3D"font-family:monospace;background-color:rgb(255,255,255);font=
-size:medium">1188 {</span><br style=3D"font-family:monospace;font-size:med=
ium"><span style=3D"font-family:monospace;background-color:rgb(255,255,255)=
;font-size:medium">1189 &nbsp; &nbsp; &nbsp; &nbsp; struct sk_buff *skb =3D=
 skb_peek(list);</span><br style=3D"font-family:monospace;font-size:medium"=
>
<span style=3D"font-family:monospace;background-color:rgb(255,255,255);font=
-size:medium">1190 &nbsp; &nbsp; &nbsp; &nbsp; if (skb)</span><br style=3D"=
font-family:monospace;font-size:medium"><span style=3D"font-family:monospac=
e;background-color:rgb(255,255,255);font-size:medium">1191 &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; __skb_unlink(skb, list);</span><br =
style=3D"font-family:monospace;font-size:medium">
<span style=3D"font-family:monospace;background-color:rgb(255,255,255);font=
-size:medium">1192 &nbsp; &nbsp; &nbsp; &nbsp; return skb;</span><br style=
=3D"font-family:monospace;font-size:medium"><span style=3D"font-family:mono=
space;background-color:rgb(255,255,255);font-size:medium">1193 }</span><br =
style=3D"font-family:monospace;font-size:medium">
<br style=3D"font-family:monospace;font-size:medium"><span style=3D"font-fa=
mily:monospace;background-color:rgb(255,255,255);font-size:medium">error is=
 from __skb_unlink=A3=BA</span><br style=3D"font-family:monospace;font-size=
:medium">
<br style=3D"font-family:monospace;font-size:medium"><span style=3D"font-fa=
mily:monospace;background-color:rgb(255,255,255);font-size:medium">1166 sta=
tic inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list=
)</span><br style=3D"font-family:monospace;font-size:medium">
<span style=3D"font-family:monospace;background-color:rgb(255,255,255);font=
-size:medium">1167 {</span><br style=3D"font-family:monospace;font-size:med=
ium"><span style=3D"font-family:monospace;background-color:rgb(255,255,255)=
;font-size:medium">1168 &nbsp; &nbsp; &nbsp; &nbsp; struct sk_buff *next, *=
prev;</span><br style=3D"font-family:monospace;font-size:medium">
<span style=3D"font-family:monospace;background-color:rgb(255,255,255);font=
-size:medium">1169</span><span style=3D"font-family:monospace;background-co=
lor:rgb(255,255,255);font-size:medium">&nbsp;</span><br style=3D"font-famil=
y:monospace;font-size:medium">
<span style=3D"font-family:monospace;background-color:rgb(255,255,255);font=
-size:medium">1170 &nbsp; &nbsp; &nbsp; &nbsp; list-&gt;qlen--;</span><br s=
tyle=3D"font-family:monospace;font-size:medium"><span style=3D"font-family:=
monospace;background-color:rgb(255,255,255);font-size:medium">1171 &nbsp; &=
nbsp; &nbsp; &nbsp; next &nbsp; &nbsp; &nbsp; =3D skb-&gt;next;</span><br s=
tyle=3D"font-family:monospace;font-size:medium">
<span style=3D"font-family:monospace;background-color:rgb(255,255,255);font=
-size:medium">1172 &nbsp; &nbsp; &nbsp; &nbsp; prev &nbsp; &nbsp; &nbsp; =
=3D skb-&gt;prev;</span><br style=3D"font-family:monospace;font-size:medium=
"><span style=3D"font-family:monospace;background-color:rgb(255,255,255);fo=
nt-size:medium">1173 &nbsp; &nbsp; &nbsp; &nbsp; skb-&gt;next &nbsp;=3D skb=
-&gt;prev =3D NULL;</span><br style=3D"font-family:monospace;font-size:medi=
um">
<span style=3D"font-family:monospace;background-color:rgb(255,255,255);font=
-size:medium">1174 &nbsp; &nbsp; &nbsp; &nbsp; next-&gt;prev =3D prev;</spa=
n><br style=3D"font-family:monospace;font-size:medium"><span style=3D"font-=
family:monospace;background-color:rgb(255,255,255);font-size:medium">1175 &=
nbsp; &nbsp; &nbsp; &nbsp; prev-&gt;next =3D next;</span><br style=3D"font-=
family:monospace;font-size:medium">
<span style=3D"font-family:monospace;background-color:rgb(255,255,255);font=
-size:medium">1176 }</span><br style=3D"font-family:monospace;font-size:med=
ium"><br style=3D"font-family:monospace;font-size:medium"><span style=3D"fo=
nt-family:monospace;background-color:rgb(255,255,255);font-size:medium">in =
this line: next-&gt;prev =3D prev; I found the pointer &quot;next&quot; is =
NULL</span>
</div><div><span style=3D"font-family:monospace;background-color:rgb(255,25=
5,255);font-size:medium"><br></span></div><div><span style=3D"font-family:m=
onospace;background-color:rgb(255,255,255);font-size:medium">Do you know wh=
y? Thanks.</span></div>
<div style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14=
px;background-color:rgb(255,255,255)"><br></div><div style=3D"color:rgb(34,=
34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255=
,255,255)">
<div>[ &nbsp;100.973027] BUG: unable to handle kernel NULL pointer derefere=
nce at 0000000000000008</div><div>[ &nbsp;100.973040] IP: [&lt;ffffffff8145=
5f16&gt;] xennet_alloc_rx_buffers+0x166/0x350</div><div>[ &nbsp;100.973050]=
 PGD 1cc98067 PUD 1d74c067 PMD 0&nbsp;</div>
<div>[ &nbsp;100.973051] Oops: 0002 [#1] SMP&nbsp;</div><div>[ &nbsp;100.97=
3051] CPU 1&nbsp;</div><div>[ &nbsp;100.973051] Modules linked in:</div><di=
v>[ &nbsp;100.973051]&nbsp;</div><div>[ &nbsp;100.973051] Pid: 9, comm: kso=
ftirqd/1 Not tainted 3.2.23 #131 &nbsp;</div>
<div>[ &nbsp;100.973051] RIP: e030:[&lt;ffffffff81455f16&gt;] &nbsp;[&lt;ff=
ffffff81455f16&gt;] xennet_alloc_rx_buffers+0x166/0x350</div><div>[ &nbsp;1=
00.973051] RSP: e02b:ffff88001e8f1c10 &nbsp;EFLAGS: 00010206</div><div>[ &n=
bsp;100.973051] RAX: 0000000000000000 RBX: ffff88001da98000 RCX: 0000000000=
0012b0</div>
<div>[ &nbsp;100.973051] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0=
000000000000256</div><div>[ &nbsp;100.973051] RBP: ffff88001e8f1c60 R08: ff=
ffc90000000000 R09: 0000000000017a41</div><div>[ &nbsp;100.973051] R10: 000=
0000000000002 R11: 0000000000017298 R12: ffff880019a7b700</div>
<div>[ &nbsp;100.973051] R13: 0000000000000256 R14: 0000000000012092 R15: 0=
000000000000092</div><div>[ &nbsp;100.973051] FS: &nbsp;00007f7ace91f700(00=
00) GS:ffff88001fd00000(0000) knlGS:0000000000000000</div><div>[ &nbsp;100.=
973051] CS: &nbsp;e033 DS: 0000 ES: 0000 CR0: 000000008005003b</div>
<div>[ &nbsp;100.973051] CR2: 0000000000000008 CR3: 000000001da64000 CR4: 0=
000000000002660</div><div>[ &nbsp;100.973051] DR0: 0000000000000000 DR1: 00=
00000000000000 DR2: 0000000000000000</div><div>[ &nbsp;100.973051] DR3: 000=
0000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400</div>
<div>[ &nbsp;100.973051] Process ksoftirqd/1 (pid: 9, threadinfo ffff88001e=
8f0000, task ffff88001e8d7000)</div><div>[ &nbsp;100.973051] Stack:</div><d=
iv>[ &nbsp;100.973051] &nbsp;0000000000000091 ffff88001da99c80 ffff88001da9=
9400 0000000100012091</div>
<div>[ &nbsp;100.973051] &nbsp;ffff88001e8f1c60 000000000000002d ffff880019=
a8ac4e ffff88001fd1a590</div><div>[ &nbsp;100.973051] &nbsp;000016000000000=
0 ffff880000000000 ffff88001e8f1db0 ffffffff8145699a</div><div>[ &nbsp;100.=
973051] Call Trace:</div>
<div>[ &nbsp;100.973051] &nbsp;[&lt;ffffffff8145699a&gt;] xennet_poll+0x7ca=
/0xe80</div><div>[ &nbsp;100.973051] &nbsp;[&lt;ffffffff814e3e51&gt;] net_r=
x_action+0x151/0x2b0</div><div>[ &nbsp;100.973051] &nbsp;[&lt;ffffffff81060=
90d&gt;] __do_softirq+0xbd/0x250</div>
<div>[ &nbsp;100.973051] &nbsp;[&lt;ffffffff81060b67&gt;] run_ksoftirqd+0xc=
7/0x170</div><div>[ &nbsp;100.973051] &nbsp;[&lt;ffffffff81060aa0&gt;] ? __=
do_softirq+0x250/0x250</div><div>[ &nbsp;100.973051] &nbsp;[&lt;ffffffff810=
7b0ac&gt;] kthread+0x8c/0xa0</div>
<div>[ &nbsp;100.973051] &nbsp;[&lt;ffffffff8167ca04&gt;] kernel_thread_hel=
per+0x4/0x10</div><div>[ &nbsp;100.973051] &nbsp;[&lt;ffffffff81672d21&gt;]=
 ? retint_restore_args+0x13/0x13</div><div>[ &nbsp;100.973051] &nbsp;[&lt;f=
fffffff8167ca00&gt;] ? gs_change+0x13/0x13</div>
<div>[ &nbsp;100.973051] Code: 0f 84 19 01 00 00 83 ab 10 14 00 00 01 45 0f=
 b6 fe 49 8b 14 24 49 8b 44 24 08 49 c7 04 24 00 00 00 00 49 c7 44 24 08 00=
 00 00 00 &lt;48&gt; 89 42 08 48 89 10 41 0f b6 d7 49 89 5c 24 20 48 8d 82 =
b8 01&nbsp;</div>
<div>[ &nbsp;100.973051] RIP &nbsp;[&lt;ffffffff81455f16&gt;] xennet_alloc_=
rx_buffers+0x166/0x350</div><div>[ &nbsp;100.973051] &nbsp;RSP &lt;ffff8800=
1e8f1c10&gt;</div><div>[ &nbsp;100.973051] CR2: 0000000000000008</div><div>=
[ &nbsp;100.973259] ---[ end trace b0530821c3527d70 ]---</div>
<div>[ &nbsp;100.973263] Kernel panic - not syncing: Fatal exception in int=
errupt</div><div>[ &nbsp;100.973267] Pid: 9, comm: ksoftirqd/1 Tainted: G &=
nbsp; &nbsp; &nbsp;D &nbsp; &nbsp; &nbsp;3.2.23 #131</div><div>[ &nbsp;100.=
973270] Call Trace:</div><div>[ &nbsp;100.973273] &nbsp;[&lt;ffffffff816674=
ae&gt;] panic+0x91/0x1a2</div>
<div>[ &nbsp;100.973278] &nbsp;[&lt;ffffffff8100adb2&gt;] ? check_events+0x=
12/0x20</div><div>[ &nbsp;100.973282] &nbsp;[&lt;ffffffff81673b0a&gt;] oops=
_end+0xea/0xf0</div><div>[ &nbsp;100.973286] &nbsp;[&lt;ffffffff81666e6b&gt=
;] no_context+0x214/0x223</div>
<div>[ &nbsp;100.973291] &nbsp;[&lt;ffffffff8113cf94&gt;] ? kmem_cache_free=
+0x104/0x110</div><div>[ &nbsp;100.973295] &nbsp;[&lt;ffffffff8166704b&gt;]=
 __bad_area_nosemaphore+0x1d1/0x1f0</div><div>[ &nbsp;100.973299] &nbsp;[&l=
t;ffffffff8166707d&gt;] bad_area_nosemaphore+0x13/0x15</div>
<div>[ &nbsp;100.973304] &nbsp;[&lt;ffffffff816763fb&gt;] do_page_fault+0x3=
5b/0x4f0</div><div>[ &nbsp;100.973308] &nbsp;[&lt;ffffffff814d6044&gt;] ? _=
_netdev_alloc_skb+0x24/0x50</div><div>[ &nbsp;100.973313] &nbsp;[&lt;ffffff=
ff8129f75a&gt;] ? trace_hardirqs_off_thunk+0x3a/0x6c</div>
<div>[ &nbsp;100.973318] &nbsp;[&lt;ffffffff81672fa5&gt;] page_fault+0x25/0=
x30</div><div>[ &nbsp;100.973322] &nbsp;[&lt;ffffffff81455f16&gt;] ? xennet=
_alloc_rx_buffers+0x166/0x350</div><div>[ &nbsp;100.973326] &nbsp;[&lt;ffff=
ffff8145699a&gt;] xennet_poll+0x7ca/0xe80</div>
<div>[ &nbsp;100.973330] &nbsp;[&lt;ffffffff814e3e51&gt;] net_rx_action+0x1=
51/0x2b0</div><div>[ &nbsp;100.973334] &nbsp;[&lt;ffffffff8106090d&gt;] __d=
o_softirq+0xbd/0x250</div><div>[ &nbsp;100.973338] &nbsp;[&lt;ffffffff81060=
b67&gt;] run_ksoftirqd+0xc7/0x170</div>
<div>[ &nbsp;100.973342] &nbsp;[&lt;ffffffff81060aa0&gt;] ? __do_softirq+0x=
250/0x250</div><div>[ &nbsp;100.973346] &nbsp;[&lt;ffffffff8107b0ac&gt;] kt=
hread+0x8c/0xa0</div><div>[ &nbsp;100.973350] &nbsp;[&lt;ffffffff8167ca04&g=
t;] kernel_thread_helper+0x4/0x10</div>
<div>[ &nbsp;100.973354] &nbsp;[&lt;ffffffff81672d21&gt;] ? retint_restore_=
args+0x13/0x13</div><div>[ &nbsp;100.973358] &nbsp;[&lt;ffffffff8167ca00&gt=
;] ? gs_change+0x13/0x13</div><div><br></div><div>Regards,</div><div>Cong</=
div></div>

--20cf3074b0a431303c04cf86ca16--


--===============6558328419457028082==
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.xen.org
http://lists.xen.org/xen-devel

--===============6558328419457028082==--


From xen-devel-bounces@lists.xen.org Wed Nov 28 04:42:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 04:42:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdZTe-0002z6-Rj; Wed, 28 Nov 2012 04:42:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <davidxu06@gmail.com>) id 1TdZTd-0002z1-Oh
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 04:42:26 +0000
Received: from [85.158.139.211:28840] by server-5.bemta-5.messagelabs.com id
	EE/68-11353-03695B05; Wed, 28 Nov 2012 04:42:24 +0000
X-Env-Sender: davidxu06@gmail.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1354077732!18151731!1
X-Originating-IP: [209.85.216.173]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_50_60,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31802 invoked from network); 28 Nov 2012 04:42:18 -0000
Received: from mail-qc0-f173.google.com (HELO mail-qc0-f173.google.com)
	(209.85.216.173)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 04:42:18 -0000
Received: by mail-qc0-f173.google.com with SMTP id b12so11086703qca.32
	for <xen-devel@lists.xen.org>; Tue, 27 Nov 2012 20:42:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=3ulgRaakVK2ntUClVbPO4kT/kmoBVWreHI9WmvCP3g8=;
	b=wbvoEg61CO6M9Fe80Njt+zKD5ieq4pD71N2mJ6282TOn8NhUzji6sTSff8sVi9Fzm8
	xGBeE8U8p7avFEepkHuOzZvrQAT0+pmbjNViIlm8a/XXmNn49CxJ5P8wJUOng5BljaTi
	2yj0jGiIPEG+X5BfDI+Ge87+x+ojcAMTY2i+nWFGbdT0JrqrddSXQH3GiJYA/odjkwRL
	MyNrMfGOXVDnjHV13S+wuo9LIwBwHL4qy6XrMGGR0noMZCNS7uKH365YssawRkZvD+KW
	QPfLjgJBgaPEpkW3MlExhkMpJIlIpte5svRmgGuVH1GCKsh9+N+LktyOaT329gaSAaL4
	z7oA==
MIME-Version: 1.0
Received: by 10.224.31.204 with SMTP id z12mr18798574qac.32.1354077731630;
	Tue, 27 Nov 2012 20:42:11 -0800 (PST)
Received: by 10.49.1.116 with HTTP; Tue, 27 Nov 2012 20:42:11 -0800 (PST)
Date: Tue, 27 Nov 2012 23:42:11 -0500
Message-ID: <CAGjowiTthyZp735bRbm6i5V2gZWD+LPe0sjbTeKeb+tBwkkWEA@mail.gmail.com>
From: David Xu <davidxu06@gmail.com>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] why we need call xennet_alloc_rx_buffers() in
 xennet_poll() in Netfront module?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6558328419457028082=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6558328419457028082==
Content-Type: multipart/alternative; boundary=20cf3074b0a431303c04cf86ca16

--20cf3074b0a431303c04cf86ca16
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: quoted-printable

Hi all,

Why we call xennet_alloc_rx_buffers function in xennet_poll of netfront?

When I run the iperf benchmark to measure the TCP throughput between a
physical machine and a VM, the TCP server which is a Xen VM crashed.

I traced the source code and found that the error is from  xennet_poll
=3D>  xennet_alloc_rx_buffers =3D> __skb_dequeue =3D> __skb_unlink

1187 static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list)
1188 {
1189         struct sk_buff *skb =3D skb_peek(list);
1190         if (skb)
1191                 __skb_unlink(skb, list);
1192         return skb;
1193 }

error is from __skb_unlink=A3=BA

1166 static inline void __skb_unlink(struct sk_buff *skb, struct
sk_buff_head *list)
1167 {
1168         struct sk_buff *next, *prev;
1169
1170         list->qlen--;
1171         next       =3D skb->next;
1172         prev       =3D skb->prev;
1173         skb->next  =3D skb->prev =3D NULL;
1174         next->prev =3D prev;
1175         prev->next =3D next;
1176 }

in this line: next->prev =3D prev; I found the pointer "next" is NULL

Do you know why? Thanks.

[  100.973027] BUG: unable to handle kernel NULL pointer dereference at
0000000000000008
[  100.973040] IP: [<ffffffff81455f16>] xennet_alloc_rx_buffers+0x166/0x350
[  100.973050] PGD 1cc98067 PUD 1d74c067 PMD 0
[  100.973051] Oops: 0002 [#1] SMP
[  100.973051] CPU 1
[  100.973051] Modules linked in:
[  100.973051]
[  100.973051] Pid: 9, comm: ksoftirqd/1 Not tainted 3.2.23 #131
[  100.973051] RIP: e030:[<ffffffff81455f16>]  [<ffffffff81455f16>]
xennet_alloc_rx_buffers+0x166/0x350
[  100.973051] RSP: e02b:ffff88001e8f1c10  EFLAGS: 00010206
[  100.973051] RAX: 0000000000000000 RBX: ffff88001da98000 RCX:
00000000000012b0
[  100.973051] RDX: 0000000000000000 RSI: 0000000000000000 RDI:
0000000000000256
[  100.973051] RBP: ffff88001e8f1c60 R08: ffffc90000000000 R09:
0000000000017a41
[  100.973051] R10: 0000000000000002 R11: 0000000000017298 R12:
ffff880019a7b700
[  100.973051] R13: 0000000000000256 R14: 0000000000012092 R15:
0000000000000092
[  100.973051] FS:  00007f7ace91f700(0000) GS:ffff88001fd00000(0000)
knlGS:0000000000000000
[  100.973051] CS:  e033 DS: 0000 ES: 0000 CR0: 000000008005003b
[  100.973051] CR2: 0000000000000008 CR3: 000000001da64000 CR4:
0000000000002660
[  100.973051] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
[  100.973051] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
0000000000000400
[  100.973051] Process ksoftirqd/1 (pid: 9, threadinfo ffff88001e8f0000,
task ffff88001e8d7000)
[  100.973051] Stack:
[  100.973051]  0000000000000091 ffff88001da99c80 ffff88001da99400
0000000100012091
[  100.973051]  ffff88001e8f1c60 000000000000002d ffff880019a8ac4e
ffff88001fd1a590
[  100.973051]  0000160000000000 ffff880000000000 ffff88001e8f1db0
ffffffff8145699a
[  100.973051] Call Trace:
[  100.973051]  [<ffffffff8145699a>] xennet_poll+0x7ca/0xe80
[  100.973051]  [<ffffffff814e3e51>] net_rx_action+0x151/0x2b0
[  100.973051]  [<ffffffff8106090d>] __do_softirq+0xbd/0x250
[  100.973051]  [<ffffffff81060b67>] run_ksoftirqd+0xc7/0x170
[  100.973051]  [<ffffffff81060aa0>] ? __do_softirq+0x250/0x250
[  100.973051]  [<ffffffff8107b0ac>] kthread+0x8c/0xa0
[  100.973051]  [<ffffffff8167ca04>] kernel_thread_helper+0x4/0x10
[  100.973051]  [<ffffffff81672d21>] ? retint_restore_args+0x13/0x13
[  100.973051]  [<ffffffff8167ca00>] ? gs_change+0x13/0x13
[  100.973051] Code: 0f 84 19 01 00 00 83 ab 10 14 00 00 01 45 0f b6 fe 49
8b 14 24 49 8b 44 24 08 49 c7 04 24 00 00 00 00 49 c7 44 24 08 00 00 00 00
<48> 89 42 08 48 89 10 41 0f b6 d7 49 89 5c 24 20 48 8d 82 b8 01
[  100.973051] RIP  [<ffffffff81455f16>] xennet_alloc_rx_buffers+0x166/0x35=
0
[  100.973051]  RSP <ffff88001e8f1c10>
[  100.973051] CR2: 0000000000000008
[  100.973259] ---[ end trace b0530821c3527d70 ]---
[  100.973263] Kernel panic - not syncing: Fatal exception in interrupt
[  100.973267] Pid: 9, comm: ksoftirqd/1 Tainted: G      D      3.2.23 #131
[  100.973270] Call Trace:
[  100.973273]  [<ffffffff816674ae>] panic+0x91/0x1a2
[  100.973278]  [<ffffffff8100adb2>] ? check_events+0x12/0x20
[  100.973282]  [<ffffffff81673b0a>] oops_end+0xea/0xf0
[  100.973286]  [<ffffffff81666e6b>] no_context+0x214/0x223
[  100.973291]  [<ffffffff8113cf94>] ? kmem_cache_free+0x104/0x110
[  100.973295]  [<ffffffff8166704b>] __bad_area_nosemaphore+0x1d1/0x1f0
[  100.973299]  [<ffffffff8166707d>] bad_area_nosemaphore+0x13/0x15
[  100.973304]  [<ffffffff816763fb>] do_page_fault+0x35b/0x4f0
[  100.973308]  [<ffffffff814d6044>] ? __netdev_alloc_skb+0x24/0x50
[  100.973313]  [<ffffffff8129f75a>] ? trace_hardirqs_off_thunk+0x3a/0x6c
[  100.973318]  [<ffffffff81672fa5>] page_fault+0x25/0x30
[  100.973322]  [<ffffffff81455f16>] ? xennet_alloc_rx_buffers+0x166/0x350
[  100.973326]  [<ffffffff8145699a>] xennet_poll+0x7ca/0xe80
[  100.973330]  [<ffffffff814e3e51>] net_rx_action+0x151/0x2b0
[  100.973334]  [<ffffffff8106090d>] __do_softirq+0xbd/0x250
[  100.973338]  [<ffffffff81060b67>] run_ksoftirqd+0xc7/0x170
[  100.973342]  [<ffffffff81060aa0>] ? __do_softirq+0x250/0x250
[  100.973346]  [<ffffffff8107b0ac>] kthread+0x8c/0xa0
[  100.973350]  [<ffffffff8167ca04>] kernel_thread_helper+0x4/0x10
[  100.973354]  [<ffffffff81672d21>] ? retint_restore_args+0x13/0x13
[  100.973358]  [<ffffffff8167ca00>] ? gs_change+0x13/0x13

Regards,
Cong

--20cf3074b0a431303c04cf86ca16
Content-Type: text/html; charset=GB2312
Content-Transfer-Encoding: quoted-printable

Hi all,<div><br></div><div>Why we call xennet_alloc_rx_buffers function in =
xennet_poll of netfront?&nbsp;</div><div><br></div><div><span style=3D"back=
ground-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-se=
rif;font-size:14px">When I run the iperf benchmark to measure the TCP throu=
ghput between a physical machine and a VM, the TCP server which is a Xen VM=
 crashed.&nbsp;</span></div>
<div><span style=3D"background-color:rgb(255,255,255);color:rgb(34,34,34);f=
ont-family:arial,sans-serif;font-size:14px"><br></span></div><div><span sty=
le=3D"background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:ari=
al,sans-serif;font-size:14px">I traced the source code and found that the e=
rror is from&nbsp;</span>&nbsp;xennet_poll =3D&gt;&nbsp;&nbsp;xennet_alloc_=
rx_buffers =3D&gt;&nbsp;<span style=3D"background-color:rgb(255,255,255);fo=
nt-family:monospace;font-size:medium">__skb_dequeue =3D&gt;&nbsp;</span><sp=
an style=3D"background-color:rgb(255,255,255);font-family:monospace;font-si=
ze:medium">__skb_unlink</span></div>
<div><span style=3D"background-color:rgb(255,255,255);color:rgb(34,34,34);f=
ont-family:arial,sans-serif;font-size:14px"><br></span></div><div><span sty=
le=3D"font-family:monospace;background-color:rgb(255,255,255);font-size:med=
ium">1187 static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *=
list)</span><br style=3D"font-family:monospace;font-size:medium">
<span style=3D"font-family:monospace;background-color:rgb(255,255,255);font=
-size:medium">1188 {</span><br style=3D"font-family:monospace;font-size:med=
ium"><span style=3D"font-family:monospace;background-color:rgb(255,255,255)=
;font-size:medium">1189 &nbsp; &nbsp; &nbsp; &nbsp; struct sk_buff *skb =3D=
 skb_peek(list);</span><br style=3D"font-family:monospace;font-size:medium"=
>
<span style=3D"font-family:monospace;background-color:rgb(255,255,255);font=
-size:medium">1190 &nbsp; &nbsp; &nbsp; &nbsp; if (skb)</span><br style=3D"=
font-family:monospace;font-size:medium"><span style=3D"font-family:monospac=
e;background-color:rgb(255,255,255);font-size:medium">1191 &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; __skb_unlink(skb, list);</span><br =
style=3D"font-family:monospace;font-size:medium">
<span style=3D"font-family:monospace;background-color:rgb(255,255,255);font=
-size:medium">1192 &nbsp; &nbsp; &nbsp; &nbsp; return skb;</span><br style=
=3D"font-family:monospace;font-size:medium"><span style=3D"font-family:mono=
space;background-color:rgb(255,255,255);font-size:medium">1193 }</span><br =
style=3D"font-family:monospace;font-size:medium">
<br style=3D"font-family:monospace;font-size:medium"><span style=3D"font-fa=
mily:monospace;background-color:rgb(255,255,255);font-size:medium">error is=
 from __skb_unlink=A3=BA</span><br style=3D"font-family:monospace;font-size=
:medium">
<br style=3D"font-family:monospace;font-size:medium"><span style=3D"font-fa=
mily:monospace;background-color:rgb(255,255,255);font-size:medium">1166 sta=
tic inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list=
)</span><br style=3D"font-family:monospace;font-size:medium">
<span style=3D"font-family:monospace;background-color:rgb(255,255,255);font=
-size:medium">1167 {</span><br style=3D"font-family:monospace;font-size:med=
ium"><span style=3D"font-family:monospace;background-color:rgb(255,255,255)=
;font-size:medium">1168 &nbsp; &nbsp; &nbsp; &nbsp; struct sk_buff *next, *=
prev;</span><br style=3D"font-family:monospace;font-size:medium">
<span style=3D"font-family:monospace;background-color:rgb(255,255,255);font=
-size:medium">1169</span><span style=3D"font-family:monospace;background-co=
lor:rgb(255,255,255);font-size:medium">&nbsp;</span><br style=3D"font-famil=
y:monospace;font-size:medium">
<span style=3D"font-family:monospace;background-color:rgb(255,255,255);font=
-size:medium">1170 &nbsp; &nbsp; &nbsp; &nbsp; list-&gt;qlen--;</span><br s=
tyle=3D"font-family:monospace;font-size:medium"><span style=3D"font-family:=
monospace;background-color:rgb(255,255,255);font-size:medium">1171 &nbsp; &=
nbsp; &nbsp; &nbsp; next &nbsp; &nbsp; &nbsp; =3D skb-&gt;next;</span><br s=
tyle=3D"font-family:monospace;font-size:medium">
<span style=3D"font-family:monospace;background-color:rgb(255,255,255);font=
-size:medium">1172 &nbsp; &nbsp; &nbsp; &nbsp; prev &nbsp; &nbsp; &nbsp; =
=3D skb-&gt;prev;</span><br style=3D"font-family:monospace;font-size:medium=
"><span style=3D"font-family:monospace;background-color:rgb(255,255,255);fo=
nt-size:medium">1173 &nbsp; &nbsp; &nbsp; &nbsp; skb-&gt;next &nbsp;=3D skb=
-&gt;prev =3D NULL;</span><br style=3D"font-family:monospace;font-size:medi=
um">
<span style=3D"font-family:monospace;background-color:rgb(255,255,255);font=
-size:medium">1174 &nbsp; &nbsp; &nbsp; &nbsp; next-&gt;prev =3D prev;</spa=
n><br style=3D"font-family:monospace;font-size:medium"><span style=3D"font-=
family:monospace;background-color:rgb(255,255,255);font-size:medium">1175 &=
nbsp; &nbsp; &nbsp; &nbsp; prev-&gt;next =3D next;</span><br style=3D"font-=
family:monospace;font-size:medium">
<span style=3D"font-family:monospace;background-color:rgb(255,255,255);font=
-size:medium">1176 }</span><br style=3D"font-family:monospace;font-size:med=
ium"><br style=3D"font-family:monospace;font-size:medium"><span style=3D"fo=
nt-family:monospace;background-color:rgb(255,255,255);font-size:medium">in =
this line: next-&gt;prev =3D prev; I found the pointer &quot;next&quot; is =
NULL</span>
</div><div><span style=3D"font-family:monospace;background-color:rgb(255,25=
5,255);font-size:medium"><br></span></div><div><span style=3D"font-family:m=
onospace;background-color:rgb(255,255,255);font-size:medium">Do you know wh=
y? Thanks.</span></div>
<div style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14=
px;background-color:rgb(255,255,255)"><br></div><div style=3D"color:rgb(34,=
34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255=
,255,255)">
<div>[ &nbsp;100.973027] BUG: unable to handle kernel NULL pointer derefere=
nce at 0000000000000008</div><div>[ &nbsp;100.973040] IP: [&lt;ffffffff8145=
5f16&gt;] xennet_alloc_rx_buffers+0x166/0x350</div><div>[ &nbsp;100.973050]=
 PGD 1cc98067 PUD 1d74c067 PMD 0&nbsp;</div>
<div>[ &nbsp;100.973051] Oops: 0002 [#1] SMP&nbsp;</div><div>[ &nbsp;100.97=
3051] CPU 1&nbsp;</div><div>[ &nbsp;100.973051] Modules linked in:</div><di=
v>[ &nbsp;100.973051]&nbsp;</div><div>[ &nbsp;100.973051] Pid: 9, comm: kso=
ftirqd/1 Not tainted 3.2.23 #131 &nbsp;</div>
<div>[ &nbsp;100.973051] RIP: e030:[&lt;ffffffff81455f16&gt;] &nbsp;[&lt;ff=
ffffff81455f16&gt;] xennet_alloc_rx_buffers+0x166/0x350</div><div>[ &nbsp;1=
00.973051] RSP: e02b:ffff88001e8f1c10 &nbsp;EFLAGS: 00010206</div><div>[ &n=
bsp;100.973051] RAX: 0000000000000000 RBX: ffff88001da98000 RCX: 0000000000=
0012b0</div>
<div>[ &nbsp;100.973051] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0=
000000000000256</div><div>[ &nbsp;100.973051] RBP: ffff88001e8f1c60 R08: ff=
ffc90000000000 R09: 0000000000017a41</div><div>[ &nbsp;100.973051] R10: 000=
0000000000002 R11: 0000000000017298 R12: ffff880019a7b700</div>
<div>[ &nbsp;100.973051] R13: 0000000000000256 R14: 0000000000012092 R15: 0=
000000000000092</div><div>[ &nbsp;100.973051] FS: &nbsp;00007f7ace91f700(00=
00) GS:ffff88001fd00000(0000) knlGS:0000000000000000</div><div>[ &nbsp;100.=
973051] CS: &nbsp;e033 DS: 0000 ES: 0000 CR0: 000000008005003b</div>
<div>[ &nbsp;100.973051] CR2: 0000000000000008 CR3: 000000001da64000 CR4: 0=
000000000002660</div><div>[ &nbsp;100.973051] DR0: 0000000000000000 DR1: 00=
00000000000000 DR2: 0000000000000000</div><div>[ &nbsp;100.973051] DR3: 000=
0000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400</div>
<div>[ &nbsp;100.973051] Process ksoftirqd/1 (pid: 9, threadinfo ffff88001e=
8f0000, task ffff88001e8d7000)</div><div>[ &nbsp;100.973051] Stack:</div><d=
iv>[ &nbsp;100.973051] &nbsp;0000000000000091 ffff88001da99c80 ffff88001da9=
9400 0000000100012091</div>
<div>[ &nbsp;100.973051] &nbsp;ffff88001e8f1c60 000000000000002d ffff880019=
a8ac4e ffff88001fd1a590</div><div>[ &nbsp;100.973051] &nbsp;000016000000000=
0 ffff880000000000 ffff88001e8f1db0 ffffffff8145699a</div><div>[ &nbsp;100.=
973051] Call Trace:</div>
<div>[ &nbsp;100.973051] &nbsp;[&lt;ffffffff8145699a&gt;] xennet_poll+0x7ca=
/0xe80</div><div>[ &nbsp;100.973051] &nbsp;[&lt;ffffffff814e3e51&gt;] net_r=
x_action+0x151/0x2b0</div><div>[ &nbsp;100.973051] &nbsp;[&lt;ffffffff81060=
90d&gt;] __do_softirq+0xbd/0x250</div>
<div>[ &nbsp;100.973051] &nbsp;[&lt;ffffffff81060b67&gt;] run_ksoftirqd+0xc=
7/0x170</div><div>[ &nbsp;100.973051] &nbsp;[&lt;ffffffff81060aa0&gt;] ? __=
do_softirq+0x250/0x250</div><div>[ &nbsp;100.973051] &nbsp;[&lt;ffffffff810=
7b0ac&gt;] kthread+0x8c/0xa0</div>
<div>[ &nbsp;100.973051] &nbsp;[&lt;ffffffff8167ca04&gt;] kernel_thread_hel=
per+0x4/0x10</div><div>[ &nbsp;100.973051] &nbsp;[&lt;ffffffff81672d21&gt;]=
 ? retint_restore_args+0x13/0x13</div><div>[ &nbsp;100.973051] &nbsp;[&lt;f=
fffffff8167ca00&gt;] ? gs_change+0x13/0x13</div>
<div>[ &nbsp;100.973051] Code: 0f 84 19 01 00 00 83 ab 10 14 00 00 01 45 0f=
 b6 fe 49 8b 14 24 49 8b 44 24 08 49 c7 04 24 00 00 00 00 49 c7 44 24 08 00=
 00 00 00 &lt;48&gt; 89 42 08 48 89 10 41 0f b6 d7 49 89 5c 24 20 48 8d 82 =
b8 01&nbsp;</div>
<div>[ &nbsp;100.973051] RIP &nbsp;[&lt;ffffffff81455f16&gt;] xennet_alloc_=
rx_buffers+0x166/0x350</div><div>[ &nbsp;100.973051] &nbsp;RSP &lt;ffff8800=
1e8f1c10&gt;</div><div>[ &nbsp;100.973051] CR2: 0000000000000008</div><div>=
[ &nbsp;100.973259] ---[ end trace b0530821c3527d70 ]---</div>
<div>[ &nbsp;100.973263] Kernel panic - not syncing: Fatal exception in int=
errupt</div><div>[ &nbsp;100.973267] Pid: 9, comm: ksoftirqd/1 Tainted: G &=
nbsp; &nbsp; &nbsp;D &nbsp; &nbsp; &nbsp;3.2.23 #131</div><div>[ &nbsp;100.=
973270] Call Trace:</div><div>[ &nbsp;100.973273] &nbsp;[&lt;ffffffff816674=
ae&gt;] panic+0x91/0x1a2</div>
<div>[ &nbsp;100.973278] &nbsp;[&lt;ffffffff8100adb2&gt;] ? check_events+0x=
12/0x20</div><div>[ &nbsp;100.973282] &nbsp;[&lt;ffffffff81673b0a&gt;] oops=
_end+0xea/0xf0</div><div>[ &nbsp;100.973286] &nbsp;[&lt;ffffffff81666e6b&gt=
;] no_context+0x214/0x223</div>
<div>[ &nbsp;100.973291] &nbsp;[&lt;ffffffff8113cf94&gt;] ? kmem_cache_free=
+0x104/0x110</div><div>[ &nbsp;100.973295] &nbsp;[&lt;ffffffff8166704b&gt;]=
 __bad_area_nosemaphore+0x1d1/0x1f0</div><div>[ &nbsp;100.973299] &nbsp;[&l=
t;ffffffff8166707d&gt;] bad_area_nosemaphore+0x13/0x15</div>
<div>[ &nbsp;100.973304] &nbsp;[&lt;ffffffff816763fb&gt;] do_page_fault+0x3=
5b/0x4f0</div><div>[ &nbsp;100.973308] &nbsp;[&lt;ffffffff814d6044&gt;] ? _=
_netdev_alloc_skb+0x24/0x50</div><div>[ &nbsp;100.973313] &nbsp;[&lt;ffffff=
ff8129f75a&gt;] ? trace_hardirqs_off_thunk+0x3a/0x6c</div>
<div>[ &nbsp;100.973318] &nbsp;[&lt;ffffffff81672fa5&gt;] page_fault+0x25/0=
x30</div><div>[ &nbsp;100.973322] &nbsp;[&lt;ffffffff81455f16&gt;] ? xennet=
_alloc_rx_buffers+0x166/0x350</div><div>[ &nbsp;100.973326] &nbsp;[&lt;ffff=
ffff8145699a&gt;] xennet_poll+0x7ca/0xe80</div>
<div>[ &nbsp;100.973330] &nbsp;[&lt;ffffffff814e3e51&gt;] net_rx_action+0x1=
51/0x2b0</div><div>[ &nbsp;100.973334] &nbsp;[&lt;ffffffff8106090d&gt;] __d=
o_softirq+0xbd/0x250</div><div>[ &nbsp;100.973338] &nbsp;[&lt;ffffffff81060=
b67&gt;] run_ksoftirqd+0xc7/0x170</div>
<div>[ &nbsp;100.973342] &nbsp;[&lt;ffffffff81060aa0&gt;] ? __do_softirq+0x=
250/0x250</div><div>[ &nbsp;100.973346] &nbsp;[&lt;ffffffff8107b0ac&gt;] kt=
hread+0x8c/0xa0</div><div>[ &nbsp;100.973350] &nbsp;[&lt;ffffffff8167ca04&g=
t;] kernel_thread_helper+0x4/0x10</div>
<div>[ &nbsp;100.973354] &nbsp;[&lt;ffffffff81672d21&gt;] ? retint_restore_=
args+0x13/0x13</div><div>[ &nbsp;100.973358] &nbsp;[&lt;ffffffff8167ca00&gt=
;] ? gs_change+0x13/0x13</div><div><br></div><div>Regards,</div><div>Cong</=
div></div>

--20cf3074b0a431303c04cf86ca16--


--===============6558328419457028082==
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.xen.org
http://lists.xen.org/xen-devel

--===============6558328419457028082==--


From xen-devel-bounces@lists.xen.org Wed Nov 28 05:04:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 05:04:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdZoi-0003Nn-VT; Wed, 28 Nov 2012 05:04:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TdZoh-0003Ni-8x
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 05:04:11 +0000
Received: from [85.158.139.211:51529] by server-13.bemta-5.messagelabs.com id
	A8/80-27809-A4B95B05; Wed, 28 Nov 2012 05:04:10 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1354079049!18156691!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQzNTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12074 invoked from network); 28 Nov 2012 05:04:09 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 05:04:09 -0000
X-IronPort-AV: E=Sophos;i="4.84,175,1355097600"; d="scan'208";a="16036568"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 05:04:09 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 28 Nov 2012 05:04:09 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TdZof-0002pr-50;
	Wed, 28 Nov 2012 05:04:09 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TdZof-0005DY-2c;
	Wed, 28 Nov 2012 05:04:09 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14483-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 28 Nov 2012 05:04:09 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14483: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14483 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14483/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14412
 test-amd64-amd64-xl-sedf     11 guest-localmigrate           fail   like 14412

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  9 guest-localmigrate         fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-i386-i386-qemut-win     16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-i386-i386-xl-qemut-win  13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-i386-i386-xl-qemut-winxpsp3 13 guest-stop                 fail never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  5c5c695863f7
baseline version:
 xen                  7c4d806b3753

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jim Fehlig <jfehlig@suse.com>
  Keir Fraser <keir@xen.org>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-i386-i386-qemut-win                                     fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-i386-i386-xl-qemut-win                                  fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-i386-i386-xl-qemut-winxpsp3                             fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.2-testing
+ revision=5c5c695863f7
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.2-testing 5c5c695863f7
+ branch=xen-4.2-testing
+ revision=5c5c695863f7
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.2-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.2-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
++ : daily-cron.xen-4.2-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.2-testing.git
+ info_linux_tree xen-4.2-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.2-testing.hg
+ hg push -r 5c5c695863f7 ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 2 changes to 2 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 05:04:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 05:04:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdZoi-0003Nn-VT; Wed, 28 Nov 2012 05:04:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TdZoh-0003Ni-8x
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 05:04:11 +0000
Received: from [85.158.139.211:51529] by server-13.bemta-5.messagelabs.com id
	A8/80-27809-A4B95B05; Wed, 28 Nov 2012 05:04:10 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1354079049!18156691!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQzNTE=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12074 invoked from network); 28 Nov 2012 05:04:09 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 05:04:09 -0000
X-IronPort-AV: E=Sophos;i="4.84,175,1355097600"; d="scan'208";a="16036568"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 05:04:09 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Wed, 28 Nov 2012 05:04:09 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TdZof-0002pr-50;
	Wed, 28 Nov 2012 05:04:09 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TdZof-0005DY-2c;
	Wed, 28 Nov 2012 05:04:09 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14483-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Wed, 28 Nov 2012 05:04:09 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14483: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14483 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14483/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14412
 test-amd64-amd64-xl-sedf     11 guest-localmigrate           fail   like 14412

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  9 guest-localmigrate         fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-i386-i386-qemut-win     16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-i386-i386-xl-qemut-win  13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-i386-i386-xl-qemut-winxpsp3 13 guest-stop                 fail never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  5c5c695863f7
baseline version:
 xen                  7c4d806b3753

------------------------------------------------------------
People who touched revisions under test:
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jim Fehlig <jfehlig@suse.com>
  Keir Fraser <keir@xen.org>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-i386-i386-qemut-win                                     fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-i386-i386-xl-qemut-win                                  fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-i386-i386-xl-qemut-winxpsp3                             fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.2-testing
+ revision=5c5c695863f7
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.2-testing 5c5c695863f7
+ branch=xen-4.2-testing
+ revision=5c5c695863f7
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.2-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.2-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
++ : daily-cron.xen-4.2-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.2-testing.git
+ info_linux_tree xen-4.2-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.2-testing.hg
+ hg push -r 5c5c695863f7 ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 2 changes to 2 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 06:52:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 06:52:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdbV8-0003rT-0B; Wed, 28 Nov 2012 06:52:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kouya@jp.fujitsu.com>) id 1TdbV7-0003rO-Cn
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 06:52:05 +0000
Received: from [85.158.137.99:59049] by server-8.bemta-3.messagelabs.com id
	4D/C5-07786-494B5B05; Wed, 28 Nov 2012 06:52:04 +0000
X-Env-Sender: kouya@jp.fujitsu.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1354085520!13816530!1
X-Originating-IP: [192.51.44.35]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjUxLjQ0LjM1ID0+IDM0OTc0\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12440 invoked from network); 28 Nov 2012 06:52:03 -0000
Received: from fgwmail5.fujitsu.co.jp (HELO fgwmail5.fujitsu.co.jp)
	(192.51.44.35)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 06:52:03 -0000
Received: from m4.gw.fujitsu.co.jp (unknown [10.0.50.74])
	by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id 0F7003EE081
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 15:51:58 +0900 (JST)
Received: from smail (m4 [127.0.0.1])
	by outgoing.m4.gw.fujitsu.co.jp (Postfix) with ESMTP id E698145DE51
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 15:51:57 +0900 (JST)
Received: from s4.gw.fujitsu.co.jp (s4.gw.fujitsu.co.jp [10.0.50.94])
	by m4.gw.fujitsu.co.jp (Postfix) with ESMTP id CEBF745DE4F
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 15:51:57 +0900 (JST)
Received: from s4.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1])
	by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id C1FBF1DB803E
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 15:51:57 +0900 (JST)
Received: from g01jpexchyt02.g01.fujitsu.local
	(g01jpexchyt02.g01.fujitsu.local [10.128.194.41])
	by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 72DCA1DB802F
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 15:51:57 +0900 (JST)
Received: from [10.33.110.111] (10.33.110.111) by
	g01jpexchyt02.g01.fujitsu.local (10.128.194.41) with Microsoft SMTP
	Server (TLS) id 14.2.309.2; Wed, 28 Nov 2012 15:51:57 +0900
Message-ID: <50B5B48C.7040804@jp.fujitsu.com>
Date: Wed, 28 Nov 2012 15:51:56 +0900
From: Kouya Shimura <kouya@jp.fujitsu.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
Content-Type: multipart/mixed; boundary="------------050408040104060701000308"
X-Originating-IP: [10.33.110.111]
Subject: [Xen-devel] [PATCH] x86/hap: Fix memory leak of
	domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--------------050408040104060701000308
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
Content-Transfer-Encoding: 7bit

This patch fixes the memory leak of domain->arch.hvm_domain.dirty_vram.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>

--------------050408040104060701000308
Content-Type: text/x-patch; name="fix_hap_leak.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="fix_hap_leak.patch"

diff -r 0049de3827bc xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Fri Nov 23 11:06:15 2012 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Wed Nov 28 15:21:32 2012 +0900
@@ -567,6 +567,12 @@ void hap_teardown(struct domain *d)
 
     d->arch.paging.mode &= ~PG_log_dirty;
 
+    if ( d->arch.hvm_domain.dirty_vram )
+    {
+        xfree(d->arch.hvm_domain.dirty_vram);
+        d->arch.hvm_domain.dirty_vram = NULL;
+    }
+
     paging_unlock(d);
 }
 

--------------050408040104060701000308
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.xen.org
http://lists.xen.org/xen-devel

--------------050408040104060701000308--


From xen-devel-bounces@lists.xen.org Wed Nov 28 06:52:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 06:52:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdbV8-0003rT-0B; Wed, 28 Nov 2012 06:52:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kouya@jp.fujitsu.com>) id 1TdbV7-0003rO-Cn
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 06:52:05 +0000
Received: from [85.158.137.99:59049] by server-8.bemta-3.messagelabs.com id
	4D/C5-07786-494B5B05; Wed, 28 Nov 2012 06:52:04 +0000
X-Env-Sender: kouya@jp.fujitsu.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1354085520!13816530!1
X-Originating-IP: [192.51.44.35]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjUxLjQ0LjM1ID0+IDM0OTc0\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12440 invoked from network); 28 Nov 2012 06:52:03 -0000
Received: from fgwmail5.fujitsu.co.jp (HELO fgwmail5.fujitsu.co.jp)
	(192.51.44.35)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 06:52:03 -0000
Received: from m4.gw.fujitsu.co.jp (unknown [10.0.50.74])
	by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id 0F7003EE081
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 15:51:58 +0900 (JST)
Received: from smail (m4 [127.0.0.1])
	by outgoing.m4.gw.fujitsu.co.jp (Postfix) with ESMTP id E698145DE51
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 15:51:57 +0900 (JST)
Received: from s4.gw.fujitsu.co.jp (s4.gw.fujitsu.co.jp [10.0.50.94])
	by m4.gw.fujitsu.co.jp (Postfix) with ESMTP id CEBF745DE4F
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 15:51:57 +0900 (JST)
Received: from s4.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1])
	by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id C1FBF1DB803E
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 15:51:57 +0900 (JST)
Received: from g01jpexchyt02.g01.fujitsu.local
	(g01jpexchyt02.g01.fujitsu.local [10.128.194.41])
	by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 72DCA1DB802F
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 15:51:57 +0900 (JST)
Received: from [10.33.110.111] (10.33.110.111) by
	g01jpexchyt02.g01.fujitsu.local (10.128.194.41) with Microsoft SMTP
	Server (TLS) id 14.2.309.2; Wed, 28 Nov 2012 15:51:57 +0900
Message-ID: <50B5B48C.7040804@jp.fujitsu.com>
Date: Wed, 28 Nov 2012 15:51:56 +0900
From: Kouya Shimura <kouya@jp.fujitsu.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
Content-Type: multipart/mixed; boundary="------------050408040104060701000308"
X-Originating-IP: [10.33.110.111]
Subject: [Xen-devel] [PATCH] x86/hap: Fix memory leak of
	domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--------------050408040104060701000308
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
Content-Transfer-Encoding: 7bit

This patch fixes the memory leak of domain->arch.hvm_domain.dirty_vram.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>

--------------050408040104060701000308
Content-Type: text/x-patch; name="fix_hap_leak.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="fix_hap_leak.patch"

diff -r 0049de3827bc xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Fri Nov 23 11:06:15 2012 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Wed Nov 28 15:21:32 2012 +0900
@@ -567,6 +567,12 @@ void hap_teardown(struct domain *d)
 
     d->arch.paging.mode &= ~PG_log_dirty;
 
+    if ( d->arch.hvm_domain.dirty_vram )
+    {
+        xfree(d->arch.hvm_domain.dirty_vram);
+        d->arch.hvm_domain.dirty_vram = NULL;
+    }
+
     paging_unlock(d);
 }
 

--------------050408040104060701000308
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.xen.org
http://lists.xen.org/xen-devel

--------------050408040104060701000308--


From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdbxY-0004EW-7q; Wed, 28 Nov 2012 07:21:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1TdbxV-0004EQ-VP
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:26 +0000
Received: from [85.158.143.35:28574] by server-2.bemta-4.messagelabs.com id
	72/CB-28922-47BB5B05; Wed, 28 Nov 2012 07:21:24 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354087283!12444501!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0ODI4MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15809 invoked from network); 28 Nov 2012 07:21:24 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-12.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 07:21:24 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga101.fm.intel.com with ESMTP; 27 Nov 2012 23:21:22 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="254022831"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by fmsmga001.fm.intel.com with ESMTP; 27 Nov 2012 23:21:21 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:11:55 +0800
Message-Id: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
Subject: [Xen-devel] [PATCH 0/9] nested vmx: expose some vmx features to L1
	VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch series expose some vmx features to L1 VMM, including MTF, NMI-window exiting, etc.
Please help to review and pull.

Thanks,
Dongxiao

Dongxiao Xu (9):
  nested vmx: enable Monitor Trap Flag for L1 VMM
  nested vmx: enable NMI-window exiting for L1 VMM
  nested vmx: enable secondary processor-based VM-Execution controls
  nested vmx: enable Descriptor-table exiting for L1 VMM
  nested vmx: enable VMX-preemption timer for L1 VMM
  nested vmx: enable save VMX-preemption timer feature for L1 VMM
  nested vmx: enable load and save IA32_PAT feature for L1 VMM
  nested vmx: enable load and save IA32_EFER feature for L1 VMM
  nested vmx: enable load IA32_PERF_GLOBAL_CTRL feature for L1 VMM

 xen/arch/x86/hvm/vmx/vmx.c         |    2 +-
 xen/arch/x86/hvm/vmx/vvmx.c        |  108 +++++++++++++++++++++++++++++++-----
 xen/include/asm-x86/hvm/vmx/vmcs.h |   12 ++++
 xen/include/asm-x86/hvm/vmx/vmx.h  |    1 +
 4 files changed, 108 insertions(+), 15 deletions(-)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdbxY-0004EW-7q; Wed, 28 Nov 2012 07:21:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1TdbxV-0004EQ-VP
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:26 +0000
Received: from [85.158.143.35:28574] by server-2.bemta-4.messagelabs.com id
	72/CB-28922-47BB5B05; Wed, 28 Nov 2012 07:21:24 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354087283!12444501!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0ODI4MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15809 invoked from network); 28 Nov 2012 07:21:24 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-12.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 07:21:24 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga101.fm.intel.com with ESMTP; 27 Nov 2012 23:21:22 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="254022831"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by fmsmga001.fm.intel.com with ESMTP; 27 Nov 2012 23:21:21 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:11:55 +0800
Message-Id: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
Subject: [Xen-devel] [PATCH 0/9] nested vmx: expose some vmx features to L1
	VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch series expose some vmx features to L1 VMM, including MTF, NMI-window exiting, etc.
Please help to review and pull.

Thanks,
Dongxiao

Dongxiao Xu (9):
  nested vmx: enable Monitor Trap Flag for L1 VMM
  nested vmx: enable NMI-window exiting for L1 VMM
  nested vmx: enable secondary processor-based VM-Execution controls
  nested vmx: enable Descriptor-table exiting for L1 VMM
  nested vmx: enable VMX-preemption timer for L1 VMM
  nested vmx: enable save VMX-preemption timer feature for L1 VMM
  nested vmx: enable load and save IA32_PAT feature for L1 VMM
  nested vmx: enable load and save IA32_EFER feature for L1 VMM
  nested vmx: enable load IA32_PERF_GLOBAL_CTRL feature for L1 VMM

 xen/arch/x86/hvm/vmx/vmx.c         |    2 +-
 xen/arch/x86/hvm/vmx/vvmx.c        |  108 +++++++++++++++++++++++++++++++-----
 xen/include/asm-x86/hvm/vmx/vmcs.h |   12 ++++
 xen/include/asm-x86/hvm/vmx/vmx.h  |    1 +
 4 files changed, 108 insertions(+), 15 deletions(-)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdbxb-0004FN-IY; Wed, 28 Nov 2012 07:21:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1TdbxZ-0004El-J5
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:29 +0000
Received: from [85.158.143.35:4555] by server-3.bemta-4.messagelabs.com id
	BE/FE-06841-87BB5B05; Wed, 28 Nov 2012 07:21:28 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354087286!15711651!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY4MDA3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16466 invoked from network); 28 Nov 2012 07:21:27 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-6.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 07:21:27 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 27 Nov 2012 23:20:42 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="225588496"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by orsmga001.jf.intel.com with ESMTP; 27 Nov 2012 23:21:24 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:11:57 +0800
Message-Id: <1354086724-1959-3-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Subject: [Xen-devel] [PATCH 2/9] nested vmx: enable NMI-window exiting for
	L1 VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index c953278..8f75bf4 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1273,7 +1273,8 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
                CPU_BASED_USE_TSC_OFFSETING |
                CPU_BASED_UNCOND_IO_EXITING |
                CPU_BASED_RDTSC_EXITING |
-               CPU_BASED_MONITOR_TRAP_FLAG;
+               CPU_BASED_MONITOR_TRAP_FLAG |
+               CPU_BASED_VIRTUAL_NMI_PENDING;
         /* bit 1, 4-6,8,13-16,26 must be 1 (refer G4 of SDM) */
         tmp = ( (1<<26) | (0xf << 13) | 0x100 | (0x7 << 4) | 0x2);
         /* 0-settings */
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdbxb-0004FN-IY; Wed, 28 Nov 2012 07:21:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1TdbxZ-0004El-J5
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:29 +0000
Received: from [85.158.143.35:4555] by server-3.bemta-4.messagelabs.com id
	BE/FE-06841-87BB5B05; Wed, 28 Nov 2012 07:21:28 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354087286!15711651!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY4MDA3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16466 invoked from network); 28 Nov 2012 07:21:27 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-6.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 07:21:27 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 27 Nov 2012 23:20:42 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="225588496"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by orsmga001.jf.intel.com with ESMTP; 27 Nov 2012 23:21:24 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:11:57 +0800
Message-Id: <1354086724-1959-3-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Subject: [Xen-devel] [PATCH 2/9] nested vmx: enable NMI-window exiting for
	L1 VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index c953278..8f75bf4 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1273,7 +1273,8 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
                CPU_BASED_USE_TSC_OFFSETING |
                CPU_BASED_UNCOND_IO_EXITING |
                CPU_BASED_RDTSC_EXITING |
-               CPU_BASED_MONITOR_TRAP_FLAG;
+               CPU_BASED_MONITOR_TRAP_FLAG |
+               CPU_BASED_VIRTUAL_NMI_PENDING;
         /* bit 1, 4-6,8,13-16,26 must be 1 (refer G4 of SDM) */
         tmp = ( (1<<26) | (0xf << 13) | 0x100 | (0x7 << 4) | 0x2);
         /* 0-settings */
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdbxd-0004GP-O3; Wed, 28 Nov 2012 07:21:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1Tdbxc-0004EQ-BC
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:32 +0000
Received: from [85.158.143.35:28832] by server-2.bemta-4.messagelabs.com id
	BB/DB-28922-C7BB5B05; Wed, 28 Nov 2012 07:21:32 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354087286!15711651!3
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY4MDA3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16547 invoked from network); 28 Nov 2012 07:21:30 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-6.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 07:21:30 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 27 Nov 2012 23:20:47 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="225588560"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by orsmga001.jf.intel.com with ESMTP; 27 Nov 2012 23:21:29 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:12:01 +0800
Message-Id: <1354086724-1959-7-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Subject: [Xen-devel] [PATCH 6/9] nested vmx: enable save VMX-preemption
	timer feature for L1 VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index e5d812a..9839642 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -530,8 +530,7 @@ static void nvmx_update_exit_control(struct vcpu *v, unsigned long host_cntrl)
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS);
     shadow_cntrl &= ~(VM_EXIT_SAVE_DEBUG_CNTRLS 
                       | VM_EXIT_SAVE_GUEST_PAT
-                      | VM_EXIT_SAVE_GUEST_EFER
-                      | VM_EXIT_SAVE_PREEMPT_TIMER);
+                      | VM_EXIT_SAVE_GUEST_EFER);
     shadow_cntrl |= host_cntrl;
     __vmwrite(VM_EXIT_CONTROLS, shadow_cntrl);
 }
@@ -1318,8 +1317,9 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         /* 1-seetings */
         /* bit 0-8, 10,11,13,14,16,17 must be 1 (refer G4 of SDM) */
         tmp = 0x36dff;
-        data = VM_EXIT_ACK_INTR_ON_EXIT;
-        data |= VM_EXIT_IA32E_MODE;
+        data = VM_EXIT_ACK_INTR_ON_EXIT |
+               VM_EXIT_IA32E_MODE |
+               VM_EXIT_SAVE_PREEMPT_TIMER;
 	/* 0-settings */
         data = ((data | tmp) << 32) | tmp;
         break;
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdbxd-0004GP-O3; Wed, 28 Nov 2012 07:21:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1Tdbxc-0004EQ-BC
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:32 +0000
Received: from [85.158.143.35:28832] by server-2.bemta-4.messagelabs.com id
	BB/DB-28922-C7BB5B05; Wed, 28 Nov 2012 07:21:32 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354087286!15711651!3
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY4MDA3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16547 invoked from network); 28 Nov 2012 07:21:30 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-6.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 07:21:30 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 27 Nov 2012 23:20:47 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="225588560"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by orsmga001.jf.intel.com with ESMTP; 27 Nov 2012 23:21:29 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:12:01 +0800
Message-Id: <1354086724-1959-7-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Subject: [Xen-devel] [PATCH 6/9] nested vmx: enable save VMX-preemption
	timer feature for L1 VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index e5d812a..9839642 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -530,8 +530,7 @@ static void nvmx_update_exit_control(struct vcpu *v, unsigned long host_cntrl)
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS);
     shadow_cntrl &= ~(VM_EXIT_SAVE_DEBUG_CNTRLS 
                       | VM_EXIT_SAVE_GUEST_PAT
-                      | VM_EXIT_SAVE_GUEST_EFER
-                      | VM_EXIT_SAVE_PREEMPT_TIMER);
+                      | VM_EXIT_SAVE_GUEST_EFER);
     shadow_cntrl |= host_cntrl;
     __vmwrite(VM_EXIT_CONTROLS, shadow_cntrl);
 }
@@ -1318,8 +1317,9 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         /* 1-seetings */
         /* bit 0-8, 10,11,13,14,16,17 must be 1 (refer G4 of SDM) */
         tmp = 0x36dff;
-        data = VM_EXIT_ACK_INTR_ON_EXIT;
-        data |= VM_EXIT_IA32E_MODE;
+        data = VM_EXIT_ACK_INTR_ON_EXIT |
+               VM_EXIT_IA32E_MODE |
+               VM_EXIT_SAVE_PREEMPT_TIMER;
 	/* 0-settings */
         data = ((data | tmp) << 32) | tmp;
         break;
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdbxd-0004GE-BF; Wed, 28 Nov 2012 07:21:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1Tdbxb-0004FG-GB
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:31 +0000
Received: from [85.158.143.35:28766] by server-1.bemta-4.messagelabs.com id
	50/7A-27934-A7BB5B05; Wed, 28 Nov 2012 07:21:30 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1354087288!4023936!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4NzgyNQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3905 invoked from network); 28 Nov 2012 07:21:29 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-5.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 07:21:29 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 27 Nov 2012 23:21:28 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="254022864"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by fmsmga001.fm.intel.com with ESMTP; 27 Nov 2012 23:21:27 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:11:59 +0800
Message-Id: <1354086724-1959-5-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Subject: [Xen-devel] [PATCH 4/9] nested vmx: enable Descriptor-table exiting
	for L1 VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c        |    8 +++++++-
 xen/include/asm-x86/hvm/vmx/vmcs.h |    1 +
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 14a3d62..23c949b 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1300,7 +1300,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         break;
     case MSR_IA32_VMX_PROCBASED_CTLS2:
         /* 1-seetings */
-        data = 0;
+        data = SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING;
         /* 0-settings */
         tmp = 0;
         data = (data << 32) | tmp;
@@ -1507,6 +1507,12 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
         if ( ctrl & CPU_BASED_MONITOR_TRAP_FLAG)
             nvcpu->nv_vmexit_pending = 1;
         break;
+    case EXIT_REASON_ACCESS_GDTR_OR_IDTR:
+    case EXIT_REASON_ACCESS_LDTR_OR_TR:
+        ctrl = __n2_secondary_exec_control(v);
+        if ( ctrl & SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING )
+            nvcpu->nv_vmexit_pending = 1;
+        break;
     /* L1 has priority handling several other types of exits */
     case EXIT_REASON_HLT:
         ctrl = __n2_exec_control(v);
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 4f58991..053de17 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -179,6 +179,7 @@ extern u32 vmx_vmentry_control;
 
 #define SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES 0x00000001
 #define SECONDARY_EXEC_ENABLE_EPT               0x00000002
+#define SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING 0x00000004
 #define SECONDARY_EXEC_ENABLE_RDTSCP            0x00000008
 #define SECONDARY_EXEC_ENABLE_VPID              0x00000020
 #define SECONDARY_EXEC_WBINVD_EXITING           0x00000040
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdbxd-0004GE-BF; Wed, 28 Nov 2012 07:21:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1Tdbxb-0004FG-GB
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:31 +0000
Received: from [85.158.143.35:28766] by server-1.bemta-4.messagelabs.com id
	50/7A-27934-A7BB5B05; Wed, 28 Nov 2012 07:21:30 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1354087288!4023936!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4NzgyNQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3905 invoked from network); 28 Nov 2012 07:21:29 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-5.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 07:21:29 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 27 Nov 2012 23:21:28 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="254022864"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by fmsmga001.fm.intel.com with ESMTP; 27 Nov 2012 23:21:27 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:11:59 +0800
Message-Id: <1354086724-1959-5-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Subject: [Xen-devel] [PATCH 4/9] nested vmx: enable Descriptor-table exiting
	for L1 VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c        |    8 +++++++-
 xen/include/asm-x86/hvm/vmx/vmcs.h |    1 +
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 14a3d62..23c949b 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1300,7 +1300,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         break;
     case MSR_IA32_VMX_PROCBASED_CTLS2:
         /* 1-seetings */
-        data = 0;
+        data = SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING;
         /* 0-settings */
         tmp = 0;
         data = (data << 32) | tmp;
@@ -1507,6 +1507,12 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
         if ( ctrl & CPU_BASED_MONITOR_TRAP_FLAG)
             nvcpu->nv_vmexit_pending = 1;
         break;
+    case EXIT_REASON_ACCESS_GDTR_OR_IDTR:
+    case EXIT_REASON_ACCESS_LDTR_OR_TR:
+        ctrl = __n2_secondary_exec_control(v);
+        if ( ctrl & SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING )
+            nvcpu->nv_vmexit_pending = 1;
+        break;
     /* L1 has priority handling several other types of exits */
     case EXIT_REASON_HLT:
         ctrl = __n2_exec_control(v);
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 4f58991..053de17 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -179,6 +179,7 @@ extern u32 vmx_vmentry_control;
 
 #define SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES 0x00000001
 #define SECONDARY_EXEC_ENABLE_EPT               0x00000002
+#define SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING 0x00000004
 #define SECONDARY_EXEC_ENABLE_RDTSCP            0x00000008
 #define SECONDARY_EXEC_ENABLE_VPID              0x00000020
 #define SECONDARY_EXEC_WBINVD_EXITING           0x00000040
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdbxa-0004Ex-0R; Wed, 28 Nov 2012 07:21:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1TdbxY-0004EV-Me
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:28 +0000
Received: from [85.158.139.83:9121] by server-16.bemta-5.messagelabs.com id
	3A/5A-04786-77BB5B05; Wed, 28 Nov 2012 07:21:27 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1354087284!26713658!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjMzNTE3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11945 invoked from network); 28 Nov 2012 07:21:25 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-9.tower-182.messagelabs.com with SMTP;
	28 Nov 2012 07:21:25 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga101.ch.intel.com with ESMTP; 27 Nov 2012 23:21:23 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="173437968"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by AZSMGA002.ch.intel.com with ESMTP; 27 Nov 2012 23:21:23 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:11:56 +0800
Message-Id: <1354086724-1959-2-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Subject: [Xen-devel] [PATCH 1/9] nested vmx: enable Monitor Trap Flag for L1
	VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 4f6c712..c953278 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1259,7 +1259,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         break;
     case MSR_IA32_VMX_PROCBASED_CTLS:
         /* 1-seetings */
-        data = (CPU_BASED_HLT_EXITING |
+        data = CPU_BASED_HLT_EXITING |
                CPU_BASED_VIRTUAL_INTR_PENDING |
                CPU_BASED_CR8_LOAD_EXITING |
                CPU_BASED_CR8_STORE_EXITING |
@@ -1272,7 +1272,8 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
                CPU_BASED_ACTIVATE_IO_BITMAP |
                CPU_BASED_USE_TSC_OFFSETING |
                CPU_BASED_UNCOND_IO_EXITING |
-               CPU_BASED_RDTSC_EXITING);
+               CPU_BASED_RDTSC_EXITING |
+               CPU_BASED_MONITOR_TRAP_FLAG;
         /* bit 1, 4-6,8,13-16,26 must be 1 (refer G4 of SDM) */
         tmp = ( (1<<26) | (0xf << 13) | 0x100 | (0x7 << 4) | 0x2);
         /* 0-settings */
@@ -1475,6 +1476,11 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
         if ( ctrl & CPU_BASED_VIRTUAL_NMI_PENDING )
             nvcpu->nv_vmexit_pending = 1;
         break;
+    case EXIT_REASON_MONITOR_TRAP_FLAG:
+        ctrl = __n2_exec_control(v);
+        if ( ctrl & CPU_BASED_MONITOR_TRAP_FLAG)
+            nvcpu->nv_vmexit_pending = 1;
+        break;
     /* L1 has priority handling several other types of exits */
     case EXIT_REASON_HLT:
         ctrl = __n2_exec_control(v);
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdbxf-0004H6-5Y; Wed, 28 Nov 2012 07:21:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1Tdbxd-0004El-UM
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:34 +0000
Received: from [85.158.143.35:28899] by server-3.bemta-4.messagelabs.com id
	6F/0F-06841-D7BB5B05; Wed, 28 Nov 2012 07:21:33 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354087286!15711651!4
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY4MDA3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16602 invoked from network); 28 Nov 2012 07:21:32 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-6.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 07:21:32 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 27 Nov 2012 23:20:48 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="225588580"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by orsmga001.jf.intel.com with ESMTP; 27 Nov 2012 23:21:31 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:12:02 +0800
Message-Id: <1354086724-1959-8-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Subject: [Xen-devel] [PATCH 7/9] nested vmx: enable load and save IA32_PAT
	feature for L1 VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 9839642..685fa59 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -529,7 +529,7 @@ static void nvmx_update_exit_control(struct vcpu *v, unsigned long host_cntrl)
 
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS);
     shadow_cntrl &= ~(VM_EXIT_SAVE_DEBUG_CNTRLS 
-                      | VM_EXIT_SAVE_GUEST_PAT
+                      | VM_EXIT_LOAD_HOST_PAT
                       | VM_EXIT_SAVE_GUEST_EFER);
     shadow_cntrl |= host_cntrl;
     __vmwrite(VM_EXIT_CONTROLS, shadow_cntrl);
@@ -624,6 +624,7 @@ static const u16 vmcs_gstate_field[] = {
     /* 64 BITS */
     VMCS_LINK_POINTER,
     GUEST_IA32_DEBUGCTL,
+    GUEST_PAT,
     /* 32 BITS */
     GUEST_ES_LIMIT,
     GUEST_CS_LIMIT,
@@ -746,6 +747,7 @@ static void load_shadow_guest_state(struct vcpu *v)
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     void *vvmcs = nvcpu->nv_vvmcx;
     int i;
+    u32 control;
 
     /* vvmcs.gstate to shadow vmcs.gstate */
     for ( i = 0; i < ARRAY_SIZE(vmcs_gstate_field); i++ )
@@ -755,6 +757,10 @@ static void load_shadow_guest_state(struct vcpu *v)
     hvm_set_cr4(__get_vvmcs(vvmcs, GUEST_CR4));
     hvm_set_cr3(__get_vvmcs(vvmcs, GUEST_CR3));
 
+    control = __get_vvmcs(vvmcs, VM_ENTRY_CONTROLS);
+    if ( control & VM_ENTRY_LOAD_GUEST_PAT )
+        hvm_set_guest_pat(v, __get_vvmcs(vvmcs, GUEST_PAT));
+
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
     vvmcs_to_shadow(vvmcs, VM_ENTRY_INTR_INFO);
@@ -868,6 +874,7 @@ static void load_vvmcs_host_state(struct vcpu *v)
     int i;
     u64 r;
     void *vvmcs = vcpu_nestedhvm(v).nv_vvmcx;
+    u32 control;
 
     for ( i = 0; i < ARRAY_SIZE(vmcs_h2g_field); i++ )
     {
@@ -879,6 +886,10 @@ static void load_vvmcs_host_state(struct vcpu *v)
     hvm_set_cr4(__get_vvmcs(vvmcs, HOST_CR4));
     hvm_set_cr3(__get_vvmcs(vvmcs, HOST_CR3));
 
+    control = __get_vvmcs(vvmcs, VM_EXIT_CONTROLS);
+    if ( control & VM_EXIT_LOAD_HOST_PAT )
+        hvm_set_guest_pat(v, __get_vvmcs(vvmcs, HOST_PAT));
+
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
     __set_vvmcs(vvmcs, VM_ENTRY_INTR_INFO, 0);
@@ -1319,14 +1330,17 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         tmp = 0x36dff;
         data = VM_EXIT_ACK_INTR_ON_EXIT |
                VM_EXIT_IA32E_MODE |
-               VM_EXIT_SAVE_PREEMPT_TIMER;
+               VM_EXIT_SAVE_PREEMPT_TIMER |
+               VM_EXIT_SAVE_GUEST_PAT |
+               VM_EXIT_LOAD_HOST_PAT;
 	/* 0-settings */
         data = ((data | tmp) << 32) | tmp;
         break;
     case MSR_IA32_VMX_ENTRY_CTLS:
         /* bit 0-8, and 12 must be 1 (refer G5 of SDM) */
-        data = 0x11ff;
-        data = (data << 32) | data;
+        tmp = 0x11ff;
+        data = VM_ENTRY_LOAD_GUEST_PAT;
+        data = ((data | tmp) << 32) | tmp;
         break;
 
     case IA32_FEATURE_CONTROL_MSR:
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdbxh-0004IL-JX; Wed, 28 Nov 2012 07:21:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1Tdbxf-0004EQ-VD
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:36 +0000
Received: from [85.158.143.35:28968] by server-2.bemta-4.messagelabs.com id
	A9/EB-28922-F7BB5B05; Wed, 28 Nov 2012 07:21:35 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1354087293!12552932!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0ODI4MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26853 invoked from network); 28 Nov 2012 07:21:34 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-8.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 07:21:34 -0000
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
	by fmsmga101.fm.intel.com with ESMTP; 27 Nov 2012 23:21:33 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="255664084"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by fmsmga002.fm.intel.com with ESMTP; 27 Nov 2012 23:21:32 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:12:03 +0800
Message-Id: <1354086724-1959-9-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Subject: [Xen-devel] [PATCH 8/9] nested vmx: enable load and save IA32_EFER
	feature for L1 VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c        |   10 +++++++---
 xen/include/asm-x86/hvm/vmx/vmcs.h |    4 ++++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 685fa59..fad961d 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -530,7 +530,7 @@ static void nvmx_update_exit_control(struct vcpu *v, unsigned long host_cntrl)
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS);
     shadow_cntrl &= ~(VM_EXIT_SAVE_DEBUG_CNTRLS 
                       | VM_EXIT_LOAD_HOST_PAT
-                      | VM_EXIT_SAVE_GUEST_EFER);
+                      | VM_EXIT_LOAD_HOST_EFER);
     shadow_cntrl |= host_cntrl;
     __vmwrite(VM_EXIT_CONTROLS, shadow_cntrl);
 }
@@ -625,6 +625,7 @@ static const u16 vmcs_gstate_field[] = {
     VMCS_LINK_POINTER,
     GUEST_IA32_DEBUGCTL,
     GUEST_PAT,
+    GUEST_EFER,
     /* 32 BITS */
     GUEST_ES_LIMIT,
     GUEST_CS_LIMIT,
@@ -1332,14 +1333,17 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
                VM_EXIT_IA32E_MODE |
                VM_EXIT_SAVE_PREEMPT_TIMER |
                VM_EXIT_SAVE_GUEST_PAT |
-               VM_EXIT_LOAD_HOST_PAT;
+               VM_EXIT_LOAD_HOST_PAT |
+               VM_EXIT_SAVE_GUEST_EFER |
+               VM_EXIT_LOAD_HOST_EFER;
 	/* 0-settings */
         data = ((data | tmp) << 32) | tmp;
         break;
     case MSR_IA32_VMX_ENTRY_CTLS:
         /* bit 0-8, and 12 must be 1 (refer G5 of SDM) */
         tmp = 0x11ff;
-        data = VM_ENTRY_LOAD_GUEST_PAT;
+        data = VM_ENTRY_LOAD_GUEST_PAT |
+               VM_ENTRY_LOAD_GUEST_EFER;
         data = ((data | tmp) << 32) | tmp;
         break;
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index fbe9a52..9665d3a 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -300,6 +300,8 @@ enum vmcs_field {
     GUEST_IA32_DEBUGCTL_HIGH        = 0x00002803,
     GUEST_PAT                       = 0x00002804,
     GUEST_PAT_HIGH                  = 0x00002805,
+    GUEST_EFER                      = 0x00002806,
+    GUEST_EFER_HIGH                 = 0x00002807,
     GUEST_PDPTR0                    = 0x0000280a,
     GUEST_PDPTR0_HIGH               = 0x0000280b,
     GUEST_PDPTR1                    = 0x0000280c,
@@ -310,6 +312,8 @@ enum vmcs_field {
     GUEST_PDPTR3_HIGH               = 0x00002811,
     HOST_PAT                        = 0x00002c00,
     HOST_PAT_HIGH                   = 0x00002c01,
+    HOST_EFER                       = 0x00002c02,
+    HOST_EFER_HIGH                  = 0x00002c03,
     PIN_BASED_VM_EXEC_CONTROL       = 0x00004000,
     CPU_BASED_VM_EXEC_CONTROL       = 0x00004002,
     EXCEPTION_BITMAP                = 0x00004004,
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdbxa-0004Ex-0R; Wed, 28 Nov 2012 07:21:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1TdbxY-0004EV-Me
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:28 +0000
Received: from [85.158.139.83:9121] by server-16.bemta-5.messagelabs.com id
	3A/5A-04786-77BB5B05; Wed, 28 Nov 2012 07:21:27 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1354087284!26713658!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjMzNTE3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11945 invoked from network); 28 Nov 2012 07:21:25 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-9.tower-182.messagelabs.com with SMTP;
	28 Nov 2012 07:21:25 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga101.ch.intel.com with ESMTP; 27 Nov 2012 23:21:23 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="173437968"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by AZSMGA002.ch.intel.com with ESMTP; 27 Nov 2012 23:21:23 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:11:56 +0800
Message-Id: <1354086724-1959-2-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Subject: [Xen-devel] [PATCH 1/9] nested vmx: enable Monitor Trap Flag for L1
	VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 4f6c712..c953278 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1259,7 +1259,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         break;
     case MSR_IA32_VMX_PROCBASED_CTLS:
         /* 1-seetings */
-        data = (CPU_BASED_HLT_EXITING |
+        data = CPU_BASED_HLT_EXITING |
                CPU_BASED_VIRTUAL_INTR_PENDING |
                CPU_BASED_CR8_LOAD_EXITING |
                CPU_BASED_CR8_STORE_EXITING |
@@ -1272,7 +1272,8 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
                CPU_BASED_ACTIVATE_IO_BITMAP |
                CPU_BASED_USE_TSC_OFFSETING |
                CPU_BASED_UNCOND_IO_EXITING |
-               CPU_BASED_RDTSC_EXITING);
+               CPU_BASED_RDTSC_EXITING |
+               CPU_BASED_MONITOR_TRAP_FLAG;
         /* bit 1, 4-6,8,13-16,26 must be 1 (refer G4 of SDM) */
         tmp = ( (1<<26) | (0xf << 13) | 0x100 | (0x7 << 4) | 0x2);
         /* 0-settings */
@@ -1475,6 +1476,11 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
         if ( ctrl & CPU_BASED_VIRTUAL_NMI_PENDING )
             nvcpu->nv_vmexit_pending = 1;
         break;
+    case EXIT_REASON_MONITOR_TRAP_FLAG:
+        ctrl = __n2_exec_control(v);
+        if ( ctrl & CPU_BASED_MONITOR_TRAP_FLAG)
+            nvcpu->nv_vmexit_pending = 1;
+        break;
     /* L1 has priority handling several other types of exits */
     case EXIT_REASON_HLT:
         ctrl = __n2_exec_control(v);
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdbxc-0004Fw-V9; Wed, 28 Nov 2012 07:21:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1Tdbxb-0004EQ-D6
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:31 +0000
Received: from [85.158.143.35:4673] by server-2.bemta-4.messagelabs.com id
	D6/DB-28922-B7BB5B05; Wed, 28 Nov 2012 07:21:31 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1354087288!4023936!2
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4NzgyNQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3922 invoked from network); 28 Nov 2012 07:21:30 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-5.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 07:21:30 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 27 Nov 2012 23:21:29 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="254022876"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by fmsmga001.fm.intel.com with ESMTP; 27 Nov 2012 23:21:28 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:12:00 +0800
Message-Id: <1354086724-1959-6-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Subject: [Xen-devel] [PATCH 5/9] nested vmx: enable VMX-preemption timer for
	L1 VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c        |   18 ++++++++++++++++--
 xen/include/asm-x86/hvm/vmx/vmcs.h |    1 +
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 23c949b..e5d812a 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -237,6 +237,13 @@ static void reg_write(struct cpu_user_regs *regs,
     *pval = value;
 }
 
+static inline u32 __n2_pin_exec_control(struct vcpu *v)
+{
+    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+
+    return __get_vvmcs(nvcpu->nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
+}
+
 static inline u32 __n2_exec_control(struct vcpu *v)
 {
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
@@ -511,7 +518,6 @@ static void nvmx_update_pin_control(struct vcpu *v, unsigned long host_cntrl)
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
 
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
-    shadow_cntrl &= ~PIN_BASED_PREEMPT_TIMER;
     shadow_cntrl |= host_cntrl;
     __vmwrite(PIN_BASED_VM_EXEC_CONTROL, shadow_cntrl);
 }
@@ -641,6 +647,7 @@ static const u16 vmcs_gstate_field[] = {
     GUEST_INTERRUPTIBILITY_INFO,
     GUEST_ACTIVITY_STATE,
     GUEST_SYSENTER_CS,
+    GUEST_PREEMPTION_TIMER,
     /* natural */
     GUEST_ES_BASE,
     GUEST_CS_BASE,
@@ -1269,7 +1276,9 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         break;
     case MSR_IA32_VMX_PINBASED_CTLS:
         /* 1-seetings */
-        data = PIN_BASED_EXT_INTR_MASK | PIN_BASED_NMI_EXITING;
+        data = PIN_BASED_EXT_INTR_MASK |
+               PIN_BASED_NMI_EXITING |
+               PIN_BASED_PREEMPT_TIMER;
         data <<= 32;
 	/* 0-settings */
         data |= 0;
@@ -1513,6 +1522,11 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
         if ( ctrl & SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING )
             nvcpu->nv_vmexit_pending = 1;
         break;
+    case EXIT_REASON_VMX_PREEMPTION_TIMER_EXPIRED:
+        ctrl = __n2_pin_exec_control(v);
+        if ( ctrl & PIN_BASED_PREEMPT_TIMER )
+            nvcpu->nv_vmexit_pending = 1;
+        break;
     /* L1 has priority handling several other types of exits */
     case EXIT_REASON_HLT:
         ctrl = __n2_exec_control(v);
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 053de17..fbe9a52 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -357,6 +357,7 @@ enum vmcs_field {
     GUEST_INTERRUPTIBILITY_INFO     = 0x00004824,
     GUEST_ACTIVITY_STATE            = 0x00004826,
     GUEST_SYSENTER_CS               = 0x0000482A,
+    GUEST_PREEMPTION_TIMER          = 0x0000482e,
     HOST_SYSENTER_CS                = 0x00004c00,
     CR0_GUEST_HOST_MASK             = 0x00006000,
     CR4_GUEST_HOST_MASK             = 0x00006002,
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdbxZ-0004Em-KY; Wed, 28 Nov 2012 07:21:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1TdbxY-0004EQ-Mu
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:28 +0000
Received: from [85.158.143.35:4566] by server-2.bemta-4.messagelabs.com id
	7E/CB-28922-87BB5B05; Wed, 28 Nov 2012 07:21:28 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354087286!15711651!2
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY4MDA3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16490 invoked from network); 28 Nov 2012 07:21:27 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-6.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 07:21:27 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga102.jf.intel.com with ESMTP; 27 Nov 2012 23:20:43 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="248349658"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by orsmga002.jf.intel.com with ESMTP; 27 Nov 2012 23:21:25 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:11:58 +0800
Message-Id: <1354086724-1959-4-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Subject: [Xen-devel] [PATCH 3/9] nested vmx: enable secondary
	processor-based VM-Execution controls
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Enable secondary processor-based control in VMCS

Besides that, add a helper function to get the certain control bit
in secondary processor-based control MSR.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
---
 xen/arch/x86/hvm/vmx/vmx.c        |    2 +-
 xen/arch/x86/hvm/vmx/vvmx.c       |   31 ++++++++++++++++++++++++++++---
 xen/include/asm-x86/hvm/vmx/vmx.h |    1 +
 3 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 00ca124..3bb0d99 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -344,7 +344,7 @@ void vmx_update_cpu_exec_control(struct vcpu *v)
         __vmwrite(CPU_BASED_VM_EXEC_CONTROL, v->arch.hvm_vmx.exec_control);
 }
 
-static void vmx_update_secondary_exec_control(struct vcpu *v)
+void vmx_update_secondary_exec_control(struct vcpu *v)
 {
     if ( nestedhvm_vcpu_in_guestmode(v) )
         nvmx_update_secondary_exec_control(v,
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 8f75bf4..14a3d62 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -244,6 +244,17 @@ static inline u32 __n2_exec_control(struct vcpu *v)
     return __get_vvmcs(nvcpu->nv_vvmcx, CPU_BASED_VM_EXEC_CONTROL);
 }
 
+static inline u32 __n2_secondary_exec_control(struct vcpu *v)
+{
+    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+    u64 second_ctrl = 0;
+
+    if ( __n2_exec_control(v) & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS )
+        second_ctrl = __get_vvmcs(nvcpu->nv_vvmcx, SECONDARY_VM_EXEC_CONTROL);
+
+    return second_ctrl;
+}
+
 static int vmx_inst_check_privilege(struct cpu_user_regs *regs, int vmxop_check)
 {
     struct vcpu *v = current;
@@ -454,7 +465,6 @@ void nvmx_update_exec_control(struct vcpu *v, u32 host_cntrl)
     /* Enforce the removed features */
     shadow_cntrl &= ~(CPU_BASED_TPR_SHADOW
                       | CPU_BASED_ACTIVATE_MSR_BITMAP
-                      | CPU_BASED_ACTIVATE_SECONDARY_CONTROLS
                       | CPU_BASED_ACTIVATE_IO_BITMAP
                       | CPU_BASED_UNCOND_IO_EXITING);
     shadow_cntrl |= host_cntrl;
@@ -487,7 +497,12 @@ void nvmx_update_exec_control(struct vcpu *v, u32 host_cntrl)
 void nvmx_update_secondary_exec_control(struct vcpu *v,
                                             unsigned long value)
 {
-    set_shadow_control(v, SECONDARY_VM_EXEC_CONTROL, value);
+    u32 shadow_cntrl;
+    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+
+    shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, SECONDARY_VM_EXEC_CONTROL);
+    shadow_cntrl |= value;
+    set_shadow_control(v, SECONDARY_VM_EXEC_CONTROL, shadow_cntrl);
 }
 
 static void nvmx_update_pin_control(struct vcpu *v, unsigned long host_cntrl)
@@ -714,6 +729,7 @@ static void load_shadow_control(struct vcpu *v)
      */
     nvmx_update_pin_control(v, vmx_pin_based_exec_control);
     vmx_update_cpu_exec_control(v);
+    vmx_update_secondary_exec_control(v);
     nvmx_update_exit_control(v, vmx_vmexit_control);
     nvmx_update_entry_control(v);
     vmx_update_exception_bitmap(v);
@@ -923,6 +939,7 @@ static void virtual_vmexit(struct cpu_user_regs *regs)
         v->arch.hvm_vcpu.guest_efer &= ~(EFER_LMA | EFER_LME);
 
     vmx_update_cpu_exec_control(v);
+    vmx_update_secondary_exec_control(v);
     vmx_update_exception_bitmap(v);
 
     load_vvmcs_host_state(v);
@@ -1274,12 +1291,20 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
                CPU_BASED_UNCOND_IO_EXITING |
                CPU_BASED_RDTSC_EXITING |
                CPU_BASED_MONITOR_TRAP_FLAG |
-               CPU_BASED_VIRTUAL_NMI_PENDING;
+               CPU_BASED_VIRTUAL_NMI_PENDING |
+               CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
         /* bit 1, 4-6,8,13-16,26 must be 1 (refer G4 of SDM) */
         tmp = ( (1<<26) | (0xf << 13) | 0x100 | (0x7 << 4) | 0x2);
         /* 0-settings */
         data = ((data | tmp) << 32) | (tmp);
         break;
+    case MSR_IA32_VMX_PROCBASED_CTLS2:
+        /* 1-seetings */
+        data = 0;
+        /* 0-settings */
+        tmp = 0;
+        data = (data << 32) | tmp;
+        break;
     case MSR_IA32_VMX_EXIT_CTLS:
         /* 1-seetings */
         /* bit 0-8, 10,11,13,14,16,17 must be 1 (refer G4 of SDM) */
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index edde077..c4c2fe8 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -70,6 +70,7 @@ void vmx_realmode(struct cpu_user_regs *regs);
 void vmx_update_debug_state(struct vcpu *v);
 void vmx_update_exception_bitmap(struct vcpu *v);
 void vmx_update_cpu_exec_control(struct vcpu *v);
+void vmx_update_secondary_exec_control(struct vcpu *v);
 
 
 /*
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdbxf-0004H6-5Y; Wed, 28 Nov 2012 07:21:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1Tdbxd-0004El-UM
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:34 +0000
Received: from [85.158.143.35:28899] by server-3.bemta-4.messagelabs.com id
	6F/0F-06841-D7BB5B05; Wed, 28 Nov 2012 07:21:33 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354087286!15711651!4
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY4MDA3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16602 invoked from network); 28 Nov 2012 07:21:32 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-6.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 07:21:32 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 27 Nov 2012 23:20:48 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="225588580"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by orsmga001.jf.intel.com with ESMTP; 27 Nov 2012 23:21:31 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:12:02 +0800
Message-Id: <1354086724-1959-8-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Subject: [Xen-devel] [PATCH 7/9] nested vmx: enable load and save IA32_PAT
	feature for L1 VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 9839642..685fa59 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -529,7 +529,7 @@ static void nvmx_update_exit_control(struct vcpu *v, unsigned long host_cntrl)
 
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS);
     shadow_cntrl &= ~(VM_EXIT_SAVE_DEBUG_CNTRLS 
-                      | VM_EXIT_SAVE_GUEST_PAT
+                      | VM_EXIT_LOAD_HOST_PAT
                       | VM_EXIT_SAVE_GUEST_EFER);
     shadow_cntrl |= host_cntrl;
     __vmwrite(VM_EXIT_CONTROLS, shadow_cntrl);
@@ -624,6 +624,7 @@ static const u16 vmcs_gstate_field[] = {
     /* 64 BITS */
     VMCS_LINK_POINTER,
     GUEST_IA32_DEBUGCTL,
+    GUEST_PAT,
     /* 32 BITS */
     GUEST_ES_LIMIT,
     GUEST_CS_LIMIT,
@@ -746,6 +747,7 @@ static void load_shadow_guest_state(struct vcpu *v)
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     void *vvmcs = nvcpu->nv_vvmcx;
     int i;
+    u32 control;
 
     /* vvmcs.gstate to shadow vmcs.gstate */
     for ( i = 0; i < ARRAY_SIZE(vmcs_gstate_field); i++ )
@@ -755,6 +757,10 @@ static void load_shadow_guest_state(struct vcpu *v)
     hvm_set_cr4(__get_vvmcs(vvmcs, GUEST_CR4));
     hvm_set_cr3(__get_vvmcs(vvmcs, GUEST_CR3));
 
+    control = __get_vvmcs(vvmcs, VM_ENTRY_CONTROLS);
+    if ( control & VM_ENTRY_LOAD_GUEST_PAT )
+        hvm_set_guest_pat(v, __get_vvmcs(vvmcs, GUEST_PAT));
+
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
     vvmcs_to_shadow(vvmcs, VM_ENTRY_INTR_INFO);
@@ -868,6 +874,7 @@ static void load_vvmcs_host_state(struct vcpu *v)
     int i;
     u64 r;
     void *vvmcs = vcpu_nestedhvm(v).nv_vvmcx;
+    u32 control;
 
     for ( i = 0; i < ARRAY_SIZE(vmcs_h2g_field); i++ )
     {
@@ -879,6 +886,10 @@ static void load_vvmcs_host_state(struct vcpu *v)
     hvm_set_cr4(__get_vvmcs(vvmcs, HOST_CR4));
     hvm_set_cr3(__get_vvmcs(vvmcs, HOST_CR3));
 
+    control = __get_vvmcs(vvmcs, VM_EXIT_CONTROLS);
+    if ( control & VM_EXIT_LOAD_HOST_PAT )
+        hvm_set_guest_pat(v, __get_vvmcs(vvmcs, HOST_PAT));
+
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
     __set_vvmcs(vvmcs, VM_ENTRY_INTR_INFO, 0);
@@ -1319,14 +1330,17 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         tmp = 0x36dff;
         data = VM_EXIT_ACK_INTR_ON_EXIT |
                VM_EXIT_IA32E_MODE |
-               VM_EXIT_SAVE_PREEMPT_TIMER;
+               VM_EXIT_SAVE_PREEMPT_TIMER |
+               VM_EXIT_SAVE_GUEST_PAT |
+               VM_EXIT_LOAD_HOST_PAT;
 	/* 0-settings */
         data = ((data | tmp) << 32) | tmp;
         break;
     case MSR_IA32_VMX_ENTRY_CTLS:
         /* bit 0-8, and 12 must be 1 (refer G5 of SDM) */
-        data = 0x11ff;
-        data = (data << 32) | data;
+        tmp = 0x11ff;
+        data = VM_ENTRY_LOAD_GUEST_PAT;
+        data = ((data | tmp) << 32) | tmp;
         break;
 
     case IA32_FEATURE_CONTROL_MSR:
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdbxh-0004IL-JX; Wed, 28 Nov 2012 07:21:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1Tdbxf-0004EQ-VD
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:36 +0000
Received: from [85.158.143.35:28968] by server-2.bemta-4.messagelabs.com id
	A9/EB-28922-F7BB5B05; Wed, 28 Nov 2012 07:21:35 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1354087293!12552932!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0ODI4MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26853 invoked from network); 28 Nov 2012 07:21:34 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-8.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 07:21:34 -0000
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
	by fmsmga101.fm.intel.com with ESMTP; 27 Nov 2012 23:21:33 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="255664084"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by fmsmga002.fm.intel.com with ESMTP; 27 Nov 2012 23:21:32 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:12:03 +0800
Message-Id: <1354086724-1959-9-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Subject: [Xen-devel] [PATCH 8/9] nested vmx: enable load and save IA32_EFER
	feature for L1 VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c        |   10 +++++++---
 xen/include/asm-x86/hvm/vmx/vmcs.h |    4 ++++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 685fa59..fad961d 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -530,7 +530,7 @@ static void nvmx_update_exit_control(struct vcpu *v, unsigned long host_cntrl)
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS);
     shadow_cntrl &= ~(VM_EXIT_SAVE_DEBUG_CNTRLS 
                       | VM_EXIT_LOAD_HOST_PAT
-                      | VM_EXIT_SAVE_GUEST_EFER);
+                      | VM_EXIT_LOAD_HOST_EFER);
     shadow_cntrl |= host_cntrl;
     __vmwrite(VM_EXIT_CONTROLS, shadow_cntrl);
 }
@@ -625,6 +625,7 @@ static const u16 vmcs_gstate_field[] = {
     VMCS_LINK_POINTER,
     GUEST_IA32_DEBUGCTL,
     GUEST_PAT,
+    GUEST_EFER,
     /* 32 BITS */
     GUEST_ES_LIMIT,
     GUEST_CS_LIMIT,
@@ -1332,14 +1333,17 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
                VM_EXIT_IA32E_MODE |
                VM_EXIT_SAVE_PREEMPT_TIMER |
                VM_EXIT_SAVE_GUEST_PAT |
-               VM_EXIT_LOAD_HOST_PAT;
+               VM_EXIT_LOAD_HOST_PAT |
+               VM_EXIT_SAVE_GUEST_EFER |
+               VM_EXIT_LOAD_HOST_EFER;
 	/* 0-settings */
         data = ((data | tmp) << 32) | tmp;
         break;
     case MSR_IA32_VMX_ENTRY_CTLS:
         /* bit 0-8, and 12 must be 1 (refer G5 of SDM) */
         tmp = 0x11ff;
-        data = VM_ENTRY_LOAD_GUEST_PAT;
+        data = VM_ENTRY_LOAD_GUEST_PAT |
+               VM_ENTRY_LOAD_GUEST_EFER;
         data = ((data | tmp) << 32) | tmp;
         break;
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index fbe9a52..9665d3a 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -300,6 +300,8 @@ enum vmcs_field {
     GUEST_IA32_DEBUGCTL_HIGH        = 0x00002803,
     GUEST_PAT                       = 0x00002804,
     GUEST_PAT_HIGH                  = 0x00002805,
+    GUEST_EFER                      = 0x00002806,
+    GUEST_EFER_HIGH                 = 0x00002807,
     GUEST_PDPTR0                    = 0x0000280a,
     GUEST_PDPTR0_HIGH               = 0x0000280b,
     GUEST_PDPTR1                    = 0x0000280c,
@@ -310,6 +312,8 @@ enum vmcs_field {
     GUEST_PDPTR3_HIGH               = 0x00002811,
     HOST_PAT                        = 0x00002c00,
     HOST_PAT_HIGH                   = 0x00002c01,
+    HOST_EFER                       = 0x00002c02,
+    HOST_EFER_HIGH                  = 0x00002c03,
     PIN_BASED_VM_EXEC_CONTROL       = 0x00004000,
     CPU_BASED_VM_EXEC_CONTROL       = 0x00004002,
     EXCEPTION_BITMAP                = 0x00004004,
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdbxZ-0004Em-KY; Wed, 28 Nov 2012 07:21:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1TdbxY-0004EQ-Mu
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:28 +0000
Received: from [85.158.143.35:4566] by server-2.bemta-4.messagelabs.com id
	7E/CB-28922-87BB5B05; Wed, 28 Nov 2012 07:21:28 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354087286!15711651!2
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY4MDA3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16490 invoked from network); 28 Nov 2012 07:21:27 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-6.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 07:21:27 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga102.jf.intel.com with ESMTP; 27 Nov 2012 23:20:43 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="248349658"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by orsmga002.jf.intel.com with ESMTP; 27 Nov 2012 23:21:25 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:11:58 +0800
Message-Id: <1354086724-1959-4-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Subject: [Xen-devel] [PATCH 3/9] nested vmx: enable secondary
	processor-based VM-Execution controls
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Enable secondary processor-based control in VMCS

Besides that, add a helper function to get the certain control bit
in secondary processor-based control MSR.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
---
 xen/arch/x86/hvm/vmx/vmx.c        |    2 +-
 xen/arch/x86/hvm/vmx/vvmx.c       |   31 ++++++++++++++++++++++++++++---
 xen/include/asm-x86/hvm/vmx/vmx.h |    1 +
 3 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 00ca124..3bb0d99 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -344,7 +344,7 @@ void vmx_update_cpu_exec_control(struct vcpu *v)
         __vmwrite(CPU_BASED_VM_EXEC_CONTROL, v->arch.hvm_vmx.exec_control);
 }
 
-static void vmx_update_secondary_exec_control(struct vcpu *v)
+void vmx_update_secondary_exec_control(struct vcpu *v)
 {
     if ( nestedhvm_vcpu_in_guestmode(v) )
         nvmx_update_secondary_exec_control(v,
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 8f75bf4..14a3d62 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -244,6 +244,17 @@ static inline u32 __n2_exec_control(struct vcpu *v)
     return __get_vvmcs(nvcpu->nv_vvmcx, CPU_BASED_VM_EXEC_CONTROL);
 }
 
+static inline u32 __n2_secondary_exec_control(struct vcpu *v)
+{
+    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+    u64 second_ctrl = 0;
+
+    if ( __n2_exec_control(v) & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS )
+        second_ctrl = __get_vvmcs(nvcpu->nv_vvmcx, SECONDARY_VM_EXEC_CONTROL);
+
+    return second_ctrl;
+}
+
 static int vmx_inst_check_privilege(struct cpu_user_regs *regs, int vmxop_check)
 {
     struct vcpu *v = current;
@@ -454,7 +465,6 @@ void nvmx_update_exec_control(struct vcpu *v, u32 host_cntrl)
     /* Enforce the removed features */
     shadow_cntrl &= ~(CPU_BASED_TPR_SHADOW
                       | CPU_BASED_ACTIVATE_MSR_BITMAP
-                      | CPU_BASED_ACTIVATE_SECONDARY_CONTROLS
                       | CPU_BASED_ACTIVATE_IO_BITMAP
                       | CPU_BASED_UNCOND_IO_EXITING);
     shadow_cntrl |= host_cntrl;
@@ -487,7 +497,12 @@ void nvmx_update_exec_control(struct vcpu *v, u32 host_cntrl)
 void nvmx_update_secondary_exec_control(struct vcpu *v,
                                             unsigned long value)
 {
-    set_shadow_control(v, SECONDARY_VM_EXEC_CONTROL, value);
+    u32 shadow_cntrl;
+    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+
+    shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, SECONDARY_VM_EXEC_CONTROL);
+    shadow_cntrl |= value;
+    set_shadow_control(v, SECONDARY_VM_EXEC_CONTROL, shadow_cntrl);
 }
 
 static void nvmx_update_pin_control(struct vcpu *v, unsigned long host_cntrl)
@@ -714,6 +729,7 @@ static void load_shadow_control(struct vcpu *v)
      */
     nvmx_update_pin_control(v, vmx_pin_based_exec_control);
     vmx_update_cpu_exec_control(v);
+    vmx_update_secondary_exec_control(v);
     nvmx_update_exit_control(v, vmx_vmexit_control);
     nvmx_update_entry_control(v);
     vmx_update_exception_bitmap(v);
@@ -923,6 +939,7 @@ static void virtual_vmexit(struct cpu_user_regs *regs)
         v->arch.hvm_vcpu.guest_efer &= ~(EFER_LMA | EFER_LME);
 
     vmx_update_cpu_exec_control(v);
+    vmx_update_secondary_exec_control(v);
     vmx_update_exception_bitmap(v);
 
     load_vvmcs_host_state(v);
@@ -1274,12 +1291,20 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
                CPU_BASED_UNCOND_IO_EXITING |
                CPU_BASED_RDTSC_EXITING |
                CPU_BASED_MONITOR_TRAP_FLAG |
-               CPU_BASED_VIRTUAL_NMI_PENDING;
+               CPU_BASED_VIRTUAL_NMI_PENDING |
+               CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
         /* bit 1, 4-6,8,13-16,26 must be 1 (refer G4 of SDM) */
         tmp = ( (1<<26) | (0xf << 13) | 0x100 | (0x7 << 4) | 0x2);
         /* 0-settings */
         data = ((data | tmp) << 32) | (tmp);
         break;
+    case MSR_IA32_VMX_PROCBASED_CTLS2:
+        /* 1-seetings */
+        data = 0;
+        /* 0-settings */
+        tmp = 0;
+        data = (data << 32) | tmp;
+        break;
     case MSR_IA32_VMX_EXIT_CTLS:
         /* 1-seetings */
         /* bit 0-8, 10,11,13,14,16,17 must be 1 (refer G4 of SDM) */
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index edde077..c4c2fe8 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -70,6 +70,7 @@ void vmx_realmode(struct cpu_user_regs *regs);
 void vmx_update_debug_state(struct vcpu *v);
 void vmx_update_exception_bitmap(struct vcpu *v);
 void vmx_update_cpu_exec_control(struct vcpu *v);
+void vmx_update_secondary_exec_control(struct vcpu *v);
 
 
 /*
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdbxc-0004Fw-V9; Wed, 28 Nov 2012 07:21:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1Tdbxb-0004EQ-D6
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:31 +0000
Received: from [85.158.143.35:4673] by server-2.bemta-4.messagelabs.com id
	D6/DB-28922-B7BB5B05; Wed, 28 Nov 2012 07:21:31 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1354087288!4023936!2
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4NzgyNQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3922 invoked from network); 28 Nov 2012 07:21:30 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-5.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 07:21:30 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 27 Nov 2012 23:21:29 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="254022876"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by fmsmga001.fm.intel.com with ESMTP; 27 Nov 2012 23:21:28 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:12:00 +0800
Message-Id: <1354086724-1959-6-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Subject: [Xen-devel] [PATCH 5/9] nested vmx: enable VMX-preemption timer for
	L1 VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c        |   18 ++++++++++++++++--
 xen/include/asm-x86/hvm/vmx/vmcs.h |    1 +
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 23c949b..e5d812a 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -237,6 +237,13 @@ static void reg_write(struct cpu_user_regs *regs,
     *pval = value;
 }
 
+static inline u32 __n2_pin_exec_control(struct vcpu *v)
+{
+    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+
+    return __get_vvmcs(nvcpu->nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
+}
+
 static inline u32 __n2_exec_control(struct vcpu *v)
 {
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
@@ -511,7 +518,6 @@ static void nvmx_update_pin_control(struct vcpu *v, unsigned long host_cntrl)
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
 
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
-    shadow_cntrl &= ~PIN_BASED_PREEMPT_TIMER;
     shadow_cntrl |= host_cntrl;
     __vmwrite(PIN_BASED_VM_EXEC_CONTROL, shadow_cntrl);
 }
@@ -641,6 +647,7 @@ static const u16 vmcs_gstate_field[] = {
     GUEST_INTERRUPTIBILITY_INFO,
     GUEST_ACTIVITY_STATE,
     GUEST_SYSENTER_CS,
+    GUEST_PREEMPTION_TIMER,
     /* natural */
     GUEST_ES_BASE,
     GUEST_CS_BASE,
@@ -1269,7 +1276,9 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         break;
     case MSR_IA32_VMX_PINBASED_CTLS:
         /* 1-seetings */
-        data = PIN_BASED_EXT_INTR_MASK | PIN_BASED_NMI_EXITING;
+        data = PIN_BASED_EXT_INTR_MASK |
+               PIN_BASED_NMI_EXITING |
+               PIN_BASED_PREEMPT_TIMER;
         data <<= 32;
 	/* 0-settings */
         data |= 0;
@@ -1513,6 +1522,11 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
         if ( ctrl & SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING )
             nvcpu->nv_vmexit_pending = 1;
         break;
+    case EXIT_REASON_VMX_PREEMPTION_TIMER_EXPIRED:
+        ctrl = __n2_pin_exec_control(v);
+        if ( ctrl & PIN_BASED_PREEMPT_TIMER )
+            nvcpu->nv_vmexit_pending = 1;
+        break;
     /* L1 has priority handling several other types of exits */
     case EXIT_REASON_HLT:
         ctrl = __n2_exec_control(v);
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 053de17..fbe9a52 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -357,6 +357,7 @@ enum vmcs_field {
     GUEST_INTERRUPTIBILITY_INFO     = 0x00004824,
     GUEST_ACTIVITY_STATE            = 0x00004826,
     GUEST_SYSENTER_CS               = 0x0000482A,
+    GUEST_PREEMPTION_TIMER          = 0x0000482e,
     HOST_SYSENTER_CS                = 0x00004c00,
     CR0_GUEST_HOST_MASK             = 0x00006000,
     CR4_GUEST_HOST_MASK             = 0x00006002,
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdbxi-0004If-0O; Wed, 28 Nov 2012 07:21:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1Tdbxg-0004FG-5b
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:36 +0000
Received: from [85.158.143.35:28975] by server-1.bemta-4.messagelabs.com id
	09/8A-27934-F7BB5B05; Wed, 28 Nov 2012 07:21:35 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354087286!15711651!5
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY4MDA3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16687 invoked from network); 28 Nov 2012 07:21:34 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-6.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 07:21:34 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga102.jf.intel.com with ESMTP; 27 Nov 2012 23:20:51 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="248349703"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by orsmga002.jf.intel.com with ESMTP; 27 Nov 2012 23:21:33 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:12:04 +0800
Message-Id: <1354086724-1959-10-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Subject: [Xen-devel] [PATCH 9/9] nested vmx: enable load
	IA32_PERF_GLOBAL_CTRL feature for L1 VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c        |   18 ++++++++++++++----
 xen/include/asm-x86/hvm/vmx/vmcs.h |    6 ++++++
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index fad961d..ed47780 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -530,7 +530,8 @@ static void nvmx_update_exit_control(struct vcpu *v, unsigned long host_cntrl)
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS);
     shadow_cntrl &= ~(VM_EXIT_SAVE_DEBUG_CNTRLS 
                       | VM_EXIT_LOAD_HOST_PAT
-                      | VM_EXIT_LOAD_HOST_EFER);
+                      | VM_EXIT_LOAD_HOST_EFER
+                      | VM_EXIT_LOAD_PERF_GLOBAL_CTRL);
     shadow_cntrl |= host_cntrl;
     __vmwrite(VM_EXIT_CONTROLS, shadow_cntrl);
 }
@@ -541,7 +542,9 @@ static void nvmx_update_entry_control(struct vcpu *v)
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
 
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_ENTRY_CONTROLS);
-    shadow_cntrl &= ~(VM_ENTRY_LOAD_GUEST_PAT | VM_ENTRY_LOAD_GUEST_EFER);
+    shadow_cntrl &= ~(VM_ENTRY_LOAD_GUEST_PAT
+                      | VM_ENTRY_LOAD_GUEST_EFER
+                      | VM_ENTRY_LOAD_PERF_GLOBAL_CTRL);
     __vmwrite(VM_ENTRY_CONTROLS, shadow_cntrl);
 }
 
@@ -626,6 +629,7 @@ static const u16 vmcs_gstate_field[] = {
     GUEST_IA32_DEBUGCTL,
     GUEST_PAT,
     GUEST_EFER,
+    GUEST_PERF_GLOBAL_CTRL,
     /* 32 BITS */
     GUEST_ES_LIMIT,
     GUEST_CS_LIMIT,
@@ -761,6 +765,8 @@ static void load_shadow_guest_state(struct vcpu *v)
     control = __get_vvmcs(vvmcs, VM_ENTRY_CONTROLS);
     if ( control & VM_ENTRY_LOAD_GUEST_PAT )
         hvm_set_guest_pat(v, __get_vvmcs(vvmcs, GUEST_PAT));
+    if ( control & VM_ENTRY_LOAD_PERF_GLOBAL_CTRL )
+        hvm_msr_write_intercept(MSR_CORE_PERF_GLOBAL_CTRL, __get_vvmcs(vvmcs, GUEST_PERF_GLOBAL_CTRL));
 
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
@@ -890,6 +896,8 @@ static void load_vvmcs_host_state(struct vcpu *v)
     control = __get_vvmcs(vvmcs, VM_EXIT_CONTROLS);
     if ( control & VM_EXIT_LOAD_HOST_PAT )
         hvm_set_guest_pat(v, __get_vvmcs(vvmcs, HOST_PAT));
+    if ( control & VM_EXIT_LOAD_PERF_GLOBAL_CTRL )
+        hvm_msr_write_intercept(MSR_CORE_PERF_GLOBAL_CTRL, __get_vvmcs(vvmcs, HOST_PERF_GLOBAL_CTRL));
 
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
@@ -1335,7 +1343,8 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
                VM_EXIT_SAVE_GUEST_PAT |
                VM_EXIT_LOAD_HOST_PAT |
                VM_EXIT_SAVE_GUEST_EFER |
-               VM_EXIT_LOAD_HOST_EFER;
+               VM_EXIT_LOAD_HOST_EFER |
+               VM_EXIT_LOAD_PERF_GLOBAL_CTRL;
 	/* 0-settings */
         data = ((data | tmp) << 32) | tmp;
         break;
@@ -1343,7 +1352,8 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         /* bit 0-8, and 12 must be 1 (refer G5 of SDM) */
         tmp = 0x11ff;
         data = VM_ENTRY_LOAD_GUEST_PAT |
-               VM_ENTRY_LOAD_GUEST_EFER;
+               VM_ENTRY_LOAD_GUEST_EFER |
+               VM_ENTRY_LOAD_PERF_GLOBAL_CTRL;
         data = ((data | tmp) << 32) | tmp;
         break;
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 9665d3a..cc92f69 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -162,6 +162,7 @@ extern u32 vmx_pin_based_exec_control;
 
 #define VM_EXIT_SAVE_DEBUG_CNTRLS       0x00000004
 #define VM_EXIT_IA32E_MODE              0x00000200
+#define VM_EXIT_LOAD_PERF_GLOBAL_CTRL   0x00001000
 #define VM_EXIT_ACK_INTR_ON_EXIT        0x00008000
 #define VM_EXIT_SAVE_GUEST_PAT          0x00040000
 #define VM_EXIT_LOAD_HOST_PAT           0x00080000
@@ -173,6 +174,7 @@ extern u32 vmx_vmexit_control;
 #define VM_ENTRY_IA32E_MODE             0x00000200
 #define VM_ENTRY_SMM                    0x00000400
 #define VM_ENTRY_DEACT_DUAL_MONITOR     0x00000800
+#define VM_ENTRY_LOAD_PERF_GLOBAL_CTRL  0x00002000
 #define VM_ENTRY_LOAD_GUEST_PAT         0x00004000
 #define VM_ENTRY_LOAD_GUEST_EFER        0x00008000
 extern u32 vmx_vmentry_control;
@@ -302,6 +304,8 @@ enum vmcs_field {
     GUEST_PAT_HIGH                  = 0x00002805,
     GUEST_EFER                      = 0x00002806,
     GUEST_EFER_HIGH                 = 0x00002807,
+    GUEST_PERF_GLOBAL_CTRL          = 0x00002808,
+    GUEST_PERF_GLOBAL_CTRL_HIGH     = 0x00002809,
     GUEST_PDPTR0                    = 0x0000280a,
     GUEST_PDPTR0_HIGH               = 0x0000280b,
     GUEST_PDPTR1                    = 0x0000280c,
@@ -314,6 +318,8 @@ enum vmcs_field {
     HOST_PAT_HIGH                   = 0x00002c01,
     HOST_EFER                       = 0x00002c02,
     HOST_EFER_HIGH                  = 0x00002c03,
+    HOST_PERF_GLOBAL_CTRL           = 0x00002c04,
+    HOST_PERF_GLOBAL_CTRL_HIGH      = 0x00002c05,
     PIN_BASED_VM_EXEC_CONTROL       = 0x00004000,
     CPU_BASED_VM_EXEC_CONTROL       = 0x00004002,
     EXCEPTION_BITMAP                = 0x00004004,
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:21:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdbxi-0004If-0O; Wed, 28 Nov 2012 07:21:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1Tdbxg-0004FG-5b
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 07:21:36 +0000
Received: from [85.158.143.35:28975] by server-1.bemta-4.messagelabs.com id
	09/8A-27934-F7BB5B05; Wed, 28 Nov 2012 07:21:35 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354087286!15711651!5
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY4MDA3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16687 invoked from network); 28 Nov 2012 07:21:34 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-6.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 07:21:34 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga102.jf.intel.com with ESMTP; 27 Nov 2012 23:20:51 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,177,1355126400"; d="scan'208";a="248349703"
Received: from dongxiao-vt.sh.intel.com (HELO localhost) ([10.239.36.11])
	by orsmga002.jf.intel.com with ESMTP; 27 Nov 2012 23:21:33 -0800
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xensource.com
Date: Wed, 28 Nov 2012 15:12:04 +0800
Message-Id: <1354086724-1959-10-git-send-email-dongxiao.xu@intel.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Subject: [Xen-devel] [PATCH 9/9] nested vmx: enable load
	IA32_PERF_GLOBAL_CTRL feature for L1 VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c        |   18 ++++++++++++++----
 xen/include/asm-x86/hvm/vmx/vmcs.h |    6 ++++++
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index fad961d..ed47780 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -530,7 +530,8 @@ static void nvmx_update_exit_control(struct vcpu *v, unsigned long host_cntrl)
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS);
     shadow_cntrl &= ~(VM_EXIT_SAVE_DEBUG_CNTRLS 
                       | VM_EXIT_LOAD_HOST_PAT
-                      | VM_EXIT_LOAD_HOST_EFER);
+                      | VM_EXIT_LOAD_HOST_EFER
+                      | VM_EXIT_LOAD_PERF_GLOBAL_CTRL);
     shadow_cntrl |= host_cntrl;
     __vmwrite(VM_EXIT_CONTROLS, shadow_cntrl);
 }
@@ -541,7 +542,9 @@ static void nvmx_update_entry_control(struct vcpu *v)
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
 
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_ENTRY_CONTROLS);
-    shadow_cntrl &= ~(VM_ENTRY_LOAD_GUEST_PAT | VM_ENTRY_LOAD_GUEST_EFER);
+    shadow_cntrl &= ~(VM_ENTRY_LOAD_GUEST_PAT
+                      | VM_ENTRY_LOAD_GUEST_EFER
+                      | VM_ENTRY_LOAD_PERF_GLOBAL_CTRL);
     __vmwrite(VM_ENTRY_CONTROLS, shadow_cntrl);
 }
 
@@ -626,6 +629,7 @@ static const u16 vmcs_gstate_field[] = {
     GUEST_IA32_DEBUGCTL,
     GUEST_PAT,
     GUEST_EFER,
+    GUEST_PERF_GLOBAL_CTRL,
     /* 32 BITS */
     GUEST_ES_LIMIT,
     GUEST_CS_LIMIT,
@@ -761,6 +765,8 @@ static void load_shadow_guest_state(struct vcpu *v)
     control = __get_vvmcs(vvmcs, VM_ENTRY_CONTROLS);
     if ( control & VM_ENTRY_LOAD_GUEST_PAT )
         hvm_set_guest_pat(v, __get_vvmcs(vvmcs, GUEST_PAT));
+    if ( control & VM_ENTRY_LOAD_PERF_GLOBAL_CTRL )
+        hvm_msr_write_intercept(MSR_CORE_PERF_GLOBAL_CTRL, __get_vvmcs(vvmcs, GUEST_PERF_GLOBAL_CTRL));
 
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
@@ -890,6 +896,8 @@ static void load_vvmcs_host_state(struct vcpu *v)
     control = __get_vvmcs(vvmcs, VM_EXIT_CONTROLS);
     if ( control & VM_EXIT_LOAD_HOST_PAT )
         hvm_set_guest_pat(v, __get_vvmcs(vvmcs, HOST_PAT));
+    if ( control & VM_EXIT_LOAD_PERF_GLOBAL_CTRL )
+        hvm_msr_write_intercept(MSR_CORE_PERF_GLOBAL_CTRL, __get_vvmcs(vvmcs, HOST_PERF_GLOBAL_CTRL));
 
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
@@ -1335,7 +1343,8 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
                VM_EXIT_SAVE_GUEST_PAT |
                VM_EXIT_LOAD_HOST_PAT |
                VM_EXIT_SAVE_GUEST_EFER |
-               VM_EXIT_LOAD_HOST_EFER;
+               VM_EXIT_LOAD_HOST_EFER |
+               VM_EXIT_LOAD_PERF_GLOBAL_CTRL;
 	/* 0-settings */
         data = ((data | tmp) << 32) | tmp;
         break;
@@ -1343,7 +1352,8 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         /* bit 0-8, and 12 must be 1 (refer G5 of SDM) */
         tmp = 0x11ff;
         data = VM_ENTRY_LOAD_GUEST_PAT |
-               VM_ENTRY_LOAD_GUEST_EFER;
+               VM_ENTRY_LOAD_GUEST_EFER |
+               VM_ENTRY_LOAD_PERF_GLOBAL_CTRL;
         data = ((data | tmp) << 32) | tmp;
         break;
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 9665d3a..cc92f69 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -162,6 +162,7 @@ extern u32 vmx_pin_based_exec_control;
 
 #define VM_EXIT_SAVE_DEBUG_CNTRLS       0x00000004
 #define VM_EXIT_IA32E_MODE              0x00000200
+#define VM_EXIT_LOAD_PERF_GLOBAL_CTRL   0x00001000
 #define VM_EXIT_ACK_INTR_ON_EXIT        0x00008000
 #define VM_EXIT_SAVE_GUEST_PAT          0x00040000
 #define VM_EXIT_LOAD_HOST_PAT           0x00080000
@@ -173,6 +174,7 @@ extern u32 vmx_vmexit_control;
 #define VM_ENTRY_IA32E_MODE             0x00000200
 #define VM_ENTRY_SMM                    0x00000400
 #define VM_ENTRY_DEACT_DUAL_MONITOR     0x00000800
+#define VM_ENTRY_LOAD_PERF_GLOBAL_CTRL  0x00002000
 #define VM_ENTRY_LOAD_GUEST_PAT         0x00004000
 #define VM_ENTRY_LOAD_GUEST_EFER        0x00008000
 extern u32 vmx_vmentry_control;
@@ -302,6 +304,8 @@ enum vmcs_field {
     GUEST_PAT_HIGH                  = 0x00002805,
     GUEST_EFER                      = 0x00002806,
     GUEST_EFER_HIGH                 = 0x00002807,
+    GUEST_PERF_GLOBAL_CTRL          = 0x00002808,
+    GUEST_PERF_GLOBAL_CTRL_HIGH     = 0x00002809,
     GUEST_PDPTR0                    = 0x0000280a,
     GUEST_PDPTR0_HIGH               = 0x0000280b,
     GUEST_PDPTR1                    = 0x0000280c,
@@ -314,6 +318,8 @@ enum vmcs_field {
     HOST_PAT_HIGH                   = 0x00002c01,
     HOST_EFER                       = 0x00002c02,
     HOST_EFER_HIGH                  = 0x00002c03,
+    HOST_PERF_GLOBAL_CTRL           = 0x00002c04,
+    HOST_PERF_GLOBAL_CTRL_HIGH      = 0x00002c05,
     PIN_BASED_VM_EXEC_CONTROL       = 0x00004000,
     CPU_BASED_VM_EXEC_CONTROL       = 0x00004002,
     EXCEPTION_BITMAP                = 0x00004004,
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 07:43:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:43:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdcIV-0005mZ-7i; Wed, 28 Nov 2012 07:43:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdcIS-0005mU-Ue
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 07:43:05 +0000
Received: from [85.158.138.51:60125] by server-10.bemta-3.messagelabs.com id
	94/FA-19806-880C5B05; Wed, 28 Nov 2012 07:43:04 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1354088583!31779197!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16283 invoked from network); 28 Nov 2012 07:43:03 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 07:43:03 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 07:43:01 +0000
Message-Id: <50B5CECD02000078000ABF99@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 07:43:57 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartE0D108AD.0__="
Subject: [Xen-devel] [PATCH] x86: fix hypercall continuation cancellation in
 XENMAPSPACE_gmfn_range compat wrapper
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartE0D108AD.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

When no continuation was established, there must also not be an attempt
to cancel it - hypercall_cancel_continuation(), in the non-HVM, non-
multicall case, adjusts the guest mode return address in a way assuming
that an earlier call hypercall_create_continuation() took place.

Once touching this code, also restructure it slightly to improve
readability and switch to using the more relaxed copy function (copying
from the same guest memory already validated the virtual address
range).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -66,21 +66,20 @@ int compat_arch_memory_op(int op, XEN_GU
         XLAT_add_to_physmap(nat, &cmp);
         rc =3D arch_memory_op(op, guest_handle_from_ptr(nat, void));
=20
-        if ( cmp.space =3D=3D XENMAPSPACE_gmfn_range )
+        if ( !rc || cmp.space !=3D XENMAPSPACE_gmfn_range )
+            break;
+
+        XLAT_add_to_physmap(&cmp, nat);
+        if ( __copy_to_guest(arg, &cmp, 1) )
         {
-            if ( rc )
-            {
-                XLAT_add_to_physmap(&cmp, nat);
-                if ( copy_to_guest(arg, &cmp, 1) )
-                {
-                    hypercall_cancel_continuation();
-                    return -EFAULT;
-                }
-            }
             if ( rc =3D=3D __HYPERVISOR_memory_op )
-                hypercall_xlat_continuation(NULL, 0x2, nat, arg);
+                hypercall_cancel_continuation();
+            return -EFAULT;
         }
=20
+        if ( rc =3D=3D __HYPERVISOR_memory_op )
+            hypercall_xlat_continuation(NULL, 0x2, nat, arg);
+
         break;
     }
=20




--=__PartE0D108AD.0__=
Content-Type: text/plain; name="x86-compat-atp-gmfn-range-cont.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="x86-compat-atp-gmfn-range-cont.patch"

x86: fix hypercall continuation cancellation in XENMAPSPACE_gmfn_range =
compat wrapper=0A=0AWhen no continuation was established, there must also =
not be an attempt=0Ato cancel it - hypercall_cancel_continuation(), in the =
non-HVM, non-=0Amulticall case, adjusts the guest mode return address in a =
way assuming=0Athat an earlier call hypercall_create_continuation() took =
place.=0A=0AOnce touching this code, also restructure it slightly to =
improve=0Areadability and switch to using the more relaxed copy function =
(copying=0Afrom the same guest memory already validated the virtual =
address=0Arange).=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A=
--- a/xen/arch/x86/x86_64/compat/mm.c=0A+++ b/xen/arch/x86/x86_64/compat/mm=
.c=0A@@ -66,21 +66,20 @@ int compat_arch_memory_op(int op, XEN_GU=0A       =
  XLAT_add_to_physmap(nat, &cmp);=0A         rc =3D arch_memory_op(op, =
guest_handle_from_ptr(nat, void));=0A =0A-        if ( cmp.space =3D=3D =
XENMAPSPACE_gmfn_range )=0A+        if ( !rc || cmp.space !=3D XENMAPSPACE_=
gmfn_range )=0A+            break;=0A+=0A+        XLAT_add_to_physmap(&cmp,=
 nat);=0A+        if ( __copy_to_guest(arg, &cmp, 1) )=0A         {=0A-    =
        if ( rc )=0A-            {=0A-                XLAT_add_to_physmap(&=
cmp, nat);=0A-                if ( copy_to_guest(arg, &cmp, 1) )=0A-       =
         {=0A-                    hypercall_cancel_continuation();=0A-     =
               return -EFAULT;=0A-                }=0A-            }=0A    =
         if ( rc =3D=3D __HYPERVISOR_memory_op )=0A-                =
hypercall_xlat_continuation(NULL, 0x2, nat, arg);=0A+                =
hypercall_cancel_continuation();=0A+            return -EFAULT;=0A         =
}=0A =0A+        if ( rc =3D=3D __HYPERVISOR_memory_op )=0A+            =
hypercall_xlat_continuation(NULL, 0x2, nat, arg);=0A+=0A         break;=0A =
    }=0A =0A
--=__PartE0D108AD.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.xen.org
http://lists.xen.org/xen-devel

--=__PartE0D108AD.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 07:43:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:43:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdcIV-0005mZ-7i; Wed, 28 Nov 2012 07:43:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdcIS-0005mU-Ue
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 07:43:05 +0000
Received: from [85.158.138.51:60125] by server-10.bemta-3.messagelabs.com id
	94/FA-19806-880C5B05; Wed, 28 Nov 2012 07:43:04 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1354088583!31779197!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16283 invoked from network); 28 Nov 2012 07:43:03 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 07:43:03 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 07:43:01 +0000
Message-Id: <50B5CECD02000078000ABF99@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 07:43:57 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartE0D108AD.0__="
Subject: [Xen-devel] [PATCH] x86: fix hypercall continuation cancellation in
 XENMAPSPACE_gmfn_range compat wrapper
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartE0D108AD.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

When no continuation was established, there must also not be an attempt
to cancel it - hypercall_cancel_continuation(), in the non-HVM, non-
multicall case, adjusts the guest mode return address in a way assuming
that an earlier call hypercall_create_continuation() took place.

Once touching this code, also restructure it slightly to improve
readability and switch to using the more relaxed copy function (copying
from the same guest memory already validated the virtual address
range).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -66,21 +66,20 @@ int compat_arch_memory_op(int op, XEN_GU
         XLAT_add_to_physmap(nat, &cmp);
         rc =3D arch_memory_op(op, guest_handle_from_ptr(nat, void));
=20
-        if ( cmp.space =3D=3D XENMAPSPACE_gmfn_range )
+        if ( !rc || cmp.space !=3D XENMAPSPACE_gmfn_range )
+            break;
+
+        XLAT_add_to_physmap(&cmp, nat);
+        if ( __copy_to_guest(arg, &cmp, 1) )
         {
-            if ( rc )
-            {
-                XLAT_add_to_physmap(&cmp, nat);
-                if ( copy_to_guest(arg, &cmp, 1) )
-                {
-                    hypercall_cancel_continuation();
-                    return -EFAULT;
-                }
-            }
             if ( rc =3D=3D __HYPERVISOR_memory_op )
-                hypercall_xlat_continuation(NULL, 0x2, nat, arg);
+                hypercall_cancel_continuation();
+            return -EFAULT;
         }
=20
+        if ( rc =3D=3D __HYPERVISOR_memory_op )
+            hypercall_xlat_continuation(NULL, 0x2, nat, arg);
+
         break;
     }
=20




--=__PartE0D108AD.0__=
Content-Type: text/plain; name="x86-compat-atp-gmfn-range-cont.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="x86-compat-atp-gmfn-range-cont.patch"

x86: fix hypercall continuation cancellation in XENMAPSPACE_gmfn_range =
compat wrapper=0A=0AWhen no continuation was established, there must also =
not be an attempt=0Ato cancel it - hypercall_cancel_continuation(), in the =
non-HVM, non-=0Amulticall case, adjusts the guest mode return address in a =
way assuming=0Athat an earlier call hypercall_create_continuation() took =
place.=0A=0AOnce touching this code, also restructure it slightly to =
improve=0Areadability and switch to using the more relaxed copy function =
(copying=0Afrom the same guest memory already validated the virtual =
address=0Arange).=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A=
--- a/xen/arch/x86/x86_64/compat/mm.c=0A+++ b/xen/arch/x86/x86_64/compat/mm=
.c=0A@@ -66,21 +66,20 @@ int compat_arch_memory_op(int op, XEN_GU=0A       =
  XLAT_add_to_physmap(nat, &cmp);=0A         rc =3D arch_memory_op(op, =
guest_handle_from_ptr(nat, void));=0A =0A-        if ( cmp.space =3D=3D =
XENMAPSPACE_gmfn_range )=0A+        if ( !rc || cmp.space !=3D XENMAPSPACE_=
gmfn_range )=0A+            break;=0A+=0A+        XLAT_add_to_physmap(&cmp,=
 nat);=0A+        if ( __copy_to_guest(arg, &cmp, 1) )=0A         {=0A-    =
        if ( rc )=0A-            {=0A-                XLAT_add_to_physmap(&=
cmp, nat);=0A-                if ( copy_to_guest(arg, &cmp, 1) )=0A-       =
         {=0A-                    hypercall_cancel_continuation();=0A-     =
               return -EFAULT;=0A-                }=0A-            }=0A    =
         if ( rc =3D=3D __HYPERVISOR_memory_op )=0A-                =
hypercall_xlat_continuation(NULL, 0x2, nat, arg);=0A+                =
hypercall_cancel_continuation();=0A+            return -EFAULT;=0A         =
}=0A =0A+        if ( rc =3D=3D __HYPERVISOR_memory_op )=0A+            =
hypercall_xlat_continuation(NULL, 0x2, nat, arg);=0A+=0A         break;=0A =
    }=0A =0A
--=__PartE0D108AD.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.xen.org
http://lists.xen.org/xen-devel

--=__PartE0D108AD.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 07:43:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:43:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdcIv-0005oc-LC; Wed, 28 Nov 2012 07:43:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdcIt-0005oO-VA
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 07:43:32 +0000
Received: from [85.158.138.51:49968] by server-15.bemta-3.messagelabs.com id
	60/B5-23779-3A0C5B05; Wed, 28 Nov 2012 07:43:31 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1354088610!31759091!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6747 invoked from network); 28 Nov 2012 07:43:30 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 07:43:30 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 07:43:30 +0000
Message-Id: <50B5CEE902000078000ABF9D@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 07:44:25 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part84B56CC9.0__="
Subject: [Xen-devel] [PATCH] ACPI: fix return value of XEN_PM_PDC platform op
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part84B56CC9.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Should return -EFAULT when copying to guest memory fails.

Once touching this code, also switch to using the more relaxed copy
function (copying from the same guest memory already validated the
virtual address range).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -521,8 +521,8 @@ int acpi_set_pdc_bits(u32 acpi_id, XEN_G
                     ACPI_PDC_SMP_C1PT) & ~mask;
         ret =3D arch_acpi_set_pdc_bits(acpi_id, bits, mask);
     }
-    if ( !ret )
-        ret =3D copy_to_guest_offset(pdc, 2, bits + 2, 1);
+    if ( !ret && __copy_to_guest_offset(pdc, 2, bits + 2, 1) )
+        ret =3D -EFAULT;
=20
     return ret;
 }




--=__Part84B56CC9.0__=
Content-Type: text/plain; name="ACPI-set-PDC-bits-rc.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="ACPI-set-PDC-bits-rc.patch"

ACPI: fix return value of XEN_PM_PDC platform op=0A=0AShould return =
-EFAULT when copying to guest memory fails.=0A=0AOnce touching this code, =
also switch to using the more relaxed copy=0Afunction (copying from the =
same guest memory already validated the=0Avirtual address range).=0A=0ASign=
ed-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- a/xen/drivers/acpi/pmst=
at.c=0A+++ b/xen/drivers/acpi/pmstat.c=0A@@ -521,8 +521,8 @@ int acpi_set_p=
dc_bits(u32 acpi_id, XEN_G=0A                     ACPI_PDC_SMP_C1PT) & =
~mask;=0A         ret =3D arch_acpi_set_pdc_bits(acpi_id, bits, mask);=0A  =
   }=0A-    if ( !ret )=0A-        ret =3D copy_to_guest_offset(pdc, 2, =
bits + 2, 1);=0A+    if ( !ret && __copy_to_guest_offset(pdc, 2, bits + 2, =
1) )=0A+        ret =3D -EFAULT;=0A =0A     return ret;=0A }=0A
--=__Part84B56CC9.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.xen.org
http://lists.xen.org/xen-devel

--=__Part84B56CC9.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 07:43:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:43:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdcIv-0005oc-LC; Wed, 28 Nov 2012 07:43:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdcIt-0005oO-VA
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 07:43:32 +0000
Received: from [85.158.138.51:49968] by server-15.bemta-3.messagelabs.com id
	60/B5-23779-3A0C5B05; Wed, 28 Nov 2012 07:43:31 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1354088610!31759091!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6747 invoked from network); 28 Nov 2012 07:43:30 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 07:43:30 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 07:43:30 +0000
Message-Id: <50B5CEE902000078000ABF9D@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 07:44:25 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part84B56CC9.0__="
Subject: [Xen-devel] [PATCH] ACPI: fix return value of XEN_PM_PDC platform op
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part84B56CC9.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Should return -EFAULT when copying to guest memory fails.

Once touching this code, also switch to using the more relaxed copy
function (copying from the same guest memory already validated the
virtual address range).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -521,8 +521,8 @@ int acpi_set_pdc_bits(u32 acpi_id, XEN_G
                     ACPI_PDC_SMP_C1PT) & ~mask;
         ret =3D arch_acpi_set_pdc_bits(acpi_id, bits, mask);
     }
-    if ( !ret )
-        ret =3D copy_to_guest_offset(pdc, 2, bits + 2, 1);
+    if ( !ret && __copy_to_guest_offset(pdc, 2, bits + 2, 1) )
+        ret =3D -EFAULT;
=20
     return ret;
 }




--=__Part84B56CC9.0__=
Content-Type: text/plain; name="ACPI-set-PDC-bits-rc.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="ACPI-set-PDC-bits-rc.patch"

ACPI: fix return value of XEN_PM_PDC platform op=0A=0AShould return =
-EFAULT when copying to guest memory fails.=0A=0AOnce touching this code, =
also switch to using the more relaxed copy=0Afunction (copying from the =
same guest memory already validated the=0Avirtual address range).=0A=0ASign=
ed-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- a/xen/drivers/acpi/pmst=
at.c=0A+++ b/xen/drivers/acpi/pmstat.c=0A@@ -521,8 +521,8 @@ int acpi_set_p=
dc_bits(u32 acpi_id, XEN_G=0A                     ACPI_PDC_SMP_C1PT) & =
~mask;=0A         ret =3D arch_acpi_set_pdc_bits(acpi_id, bits, mask);=0A  =
   }=0A-    if ( !ret )=0A-        ret =3D copy_to_guest_offset(pdc, 2, =
bits + 2, 1);=0A+    if ( !ret && __copy_to_guest_offset(pdc, 2, bits + 2, =
1) )=0A+        ret =3D -EFAULT;=0A =0A     return ret;=0A }=0A
--=__Part84B56CC9.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.xen.org
http://lists.xen.org/xen-devel

--=__Part84B56CC9.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 07:44:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdcJN-0005s0-3y; Wed, 28 Nov 2012 07:44:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdcJL-0005rg-Vi
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 07:44:00 +0000
Received: from [85.158.138.51:65150] by server-11.bemta-3.messagelabs.com id
	15/24-19361-FB0C5B05; Wed, 28 Nov 2012 07:43:59 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1354088638!31759139!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7693 invoked from network); 28 Nov 2012 07:43:58 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 07:43:58 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 07:43:58 +0000
Message-Id: <50B5CF0502000078000ABFA1@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 07:44:53 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartA89940E5.0__="
Subject: [Xen-devel] [PATCH] README: adjust gcc version requirement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartA89940E5.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/README
+++ b/README
@@ -38,7 +38,7 @@ First, there are a number of prerequisit
 release. Make sure you have all the following installed, either by
 visiting the project webpage or installing a pre-built package
 provided by your OS distributor:
-    * GCC v3.4 or later
+    * GCC v4.1 or later
     * GNU Make
     * GNU Binutils
     * Development install of zlib (e.g., zlib-dev)




--=__PartA89940E5.0__=
Content-Type: text/plain; name="gcc-4.1-needed.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="gcc-4.1-needed.patch"

README: adjust gcc version requirement=0A=0ASigned-off-by: Jan Beulich =
<jbeulich@suse.com>=0A=0A--- a/README=0A+++ b/README=0A@@ -38,7 +38,7 @@ =
First, there are a number of prerequisit=0A release. Make sure you have =
all the following installed, either by=0A visiting the project webpage or =
installing a pre-built package=0A provided by your OS distributor:=0A-    =
* GCC v3.4 or later=0A+    * GCC v4.1 or later=0A     * GNU Make=0A     * =
GNU Binutils=0A     * Development install of zlib (e.g., zlib-dev)=0A
--=__PartA89940E5.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.xen.org
http://lists.xen.org/xen-devel

--=__PartA89940E5.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 07:44:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 07:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdcJN-0005s0-3y; Wed, 28 Nov 2012 07:44:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdcJL-0005rg-Vi
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 07:44:00 +0000
Received: from [85.158.138.51:65150] by server-11.bemta-3.messagelabs.com id
	15/24-19361-FB0C5B05; Wed, 28 Nov 2012 07:43:59 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1354088638!31759139!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7693 invoked from network); 28 Nov 2012 07:43:58 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 07:43:58 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 07:43:58 +0000
Message-Id: <50B5CF0502000078000ABFA1@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 07:44:53 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartA89940E5.0__="
Subject: [Xen-devel] [PATCH] README: adjust gcc version requirement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartA89940E5.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/README
+++ b/README
@@ -38,7 +38,7 @@ First, there are a number of prerequisit
 release. Make sure you have all the following installed, either by
 visiting the project webpage or installing a pre-built package
 provided by your OS distributor:
-    * GCC v3.4 or later
+    * GCC v4.1 or later
     * GNU Make
     * GNU Binutils
     * Development install of zlib (e.g., zlib-dev)




--=__PartA89940E5.0__=
Content-Type: text/plain; name="gcc-4.1-needed.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="gcc-4.1-needed.patch"

README: adjust gcc version requirement=0A=0ASigned-off-by: Jan Beulich =
<jbeulich@suse.com>=0A=0A--- a/README=0A+++ b/README=0A@@ -38,7 +38,7 @@ =
First, there are a number of prerequisit=0A release. Make sure you have =
all the following installed, either by=0A visiting the project webpage or =
installing a pre-built package=0A provided by your OS distributor:=0A-    =
* GCC v3.4 or later=0A+    * GCC v4.1 or later=0A     * GNU Make=0A     * =
GNU Binutils=0A     * Development install of zlib (e.g., zlib-dev)=0A
--=__PartA89940E5.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.xen.org
http://lists.xen.org/xen-devel

--=__PartA89940E5.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 08:18:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 08:18:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdcq6-0006ve-Hv; Wed, 28 Nov 2012 08:17:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tdcq5-0006vX-2g
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 08:17:49 +0000
Received: from [85.158.143.35:58468] by server-2.bemta-4.messagelabs.com id
	DE/12-28922-CA8C5B05; Wed, 28 Nov 2012 08:17:48 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1354090643!11361820!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11886 invoked from network); 28 Nov 2012 08:17:24 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 08:17:24 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 08:17:22 +0000
Message-Id: <50B5D6D802000078000ABFE3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 08:18:16 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <ian.campbell@citrix.com>
References: <5f1ad53a35724ee4b7d8.1354032101@cosworth.uk.xensource.com>
In-Reply-To: <5f1ad53a35724ee4b7d8.1354032101@cosworth.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Lars Kurth <lars.kurth.xen@gmail.com>, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH STABLE] MAINTAINERS: Reference stable
 maintenance policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 27.11.12 at 17:01, Ian Campbell <ian.campbell@citrix.com> wrote:
> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk>
> # Date 1354032095 0
> # Node ID 5f1ad53a35724ee4b7d8500447f07c466987c56d
> # Parent  5c5c695863f73bd6a9eccaaa96cf28800e50e840
> MAINTAINERS: Reference stable maintenance policy
> 
> I also couldn't resist fixing a typo and adding a reference to
> http://wiki.xen.org/wiki/Submitting_Xen_Patches for the normal case as
> well.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
> This version is for 4.2 and 4.1 and is modified from the unstable
> version to mention Jan as maintainer of both branches.

Thanks Ian, I'll apply this as soon as I see the respective variant
show up in -unstable.

Jan

> diff -r 5c5c695863f7 -r 5f1ad53a3572 MAINTAINERS
> --- a/MAINTAINERS	Tue Nov 27 13:25:17 2012 +0100
> +++ b/MAINTAINERS	Tue Nov 27 16:01:35 2012 +0000
> @@ -1,5 +1,6 @@
>  
>  	List of maintainers and how to submit changes
> +	=============================================
>  
>  Please try to follow the guidelines below.  This will make things
>  easier on the maintainers.  Not all of these guidelines matter for every
> @@ -15,7 +16,11 @@ 3.	Make a patch available to the relevan
>  	'diff -u' to make the patch easy to merge. Be prepared to get your
>  	changes sent back with seemingly silly requests about formatting
>  	and variable names.  These aren't as silly as they seem. One
> -	job the maintainersdo is to keep things looking the same.
> +	job the maintainers do is to keep things looking the same.
> +
> +	PLEASE see http://wiki.xen.org/wiki/Submitting_Xen_Patches for
> +	hints on how to submit a patch to xen-unstable in a suitable
> +	form.
>  
>  	PLEASE try to include any credit lines you want added with the
>  	patch. It avoids people being missed off by mistake and makes
> @@ -34,6 +39,28 @@ 4.	Make sure you have the right to send 
>  
>  5.	Happy hacking.
>  
> +
> +	Stable Release Maintenance
> +	==========================
> +
> +The policy for inclusion in a Xen stable release is different to that
> +for inclusion in xen-unstable.
> +
> +Please see http://wiki.xen.org/wiki/Xen_Maintenance_Releases for more
> +information.
> +
> +Remember to copy the stable branch maintainer. The maintainer for this
> +branch is:
> +
> +	Jan Beulich <JBeulich@suse.com>
> +
> +Tools backport requests should also be copied to:
> +
> +	Ian Jackson <Ian.Jackson@eu.citrix.com>
> +
> +	Unstable Subsystem Maintainers
> +	==============================
> +
>  Descriptions of section entries:
>  
>  	M: Mail patches to: FullName <address@domain>




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 08:18:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 08:18:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdcq6-0006ve-Hv; Wed, 28 Nov 2012 08:17:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tdcq5-0006vX-2g
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 08:17:49 +0000
Received: from [85.158.143.35:58468] by server-2.bemta-4.messagelabs.com id
	DE/12-28922-CA8C5B05; Wed, 28 Nov 2012 08:17:48 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1354090643!11361820!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11886 invoked from network); 28 Nov 2012 08:17:24 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 08:17:24 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 08:17:22 +0000
Message-Id: <50B5D6D802000078000ABFE3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 08:18:16 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <ian.campbell@citrix.com>
References: <5f1ad53a35724ee4b7d8.1354032101@cosworth.uk.xensource.com>
In-Reply-To: <5f1ad53a35724ee4b7d8.1354032101@cosworth.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Lars Kurth <lars.kurth.xen@gmail.com>, "Keir \(Xen.org\)" <keir@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH STABLE] MAINTAINERS: Reference stable
 maintenance policy
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 27.11.12 at 17:01, Ian Campbell <ian.campbell@citrix.com> wrote:
> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk>
> # Date 1354032095 0
> # Node ID 5f1ad53a35724ee4b7d8500447f07c466987c56d
> # Parent  5c5c695863f73bd6a9eccaaa96cf28800e50e840
> MAINTAINERS: Reference stable maintenance policy
> 
> I also couldn't resist fixing a typo and adding a reference to
> http://wiki.xen.org/wiki/Submitting_Xen_Patches for the normal case as
> well.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
> This version is for 4.2 and 4.1 and is modified from the unstable
> version to mention Jan as maintainer of both branches.

Thanks Ian, I'll apply this as soon as I see the respective variant
show up in -unstable.

Jan

> diff -r 5c5c695863f7 -r 5f1ad53a3572 MAINTAINERS
> --- a/MAINTAINERS	Tue Nov 27 13:25:17 2012 +0100
> +++ b/MAINTAINERS	Tue Nov 27 16:01:35 2012 +0000
> @@ -1,5 +1,6 @@
>  
>  	List of maintainers and how to submit changes
> +	=============================================
>  
>  Please try to follow the guidelines below.  This will make things
>  easier on the maintainers.  Not all of these guidelines matter for every
> @@ -15,7 +16,11 @@ 3.	Make a patch available to the relevan
>  	'diff -u' to make the patch easy to merge. Be prepared to get your
>  	changes sent back with seemingly silly requests about formatting
>  	and variable names.  These aren't as silly as they seem. One
> -	job the maintainersdo is to keep things looking the same.
> +	job the maintainers do is to keep things looking the same.
> +
> +	PLEASE see http://wiki.xen.org/wiki/Submitting_Xen_Patches for
> +	hints on how to submit a patch to xen-unstable in a suitable
> +	form.
>  
>  	PLEASE try to include any credit lines you want added with the
>  	patch. It avoids people being missed off by mistake and makes
> @@ -34,6 +39,28 @@ 4.	Make sure you have the right to send 
>  
>  5.	Happy hacking.
>  
> +
> +	Stable Release Maintenance
> +	==========================
> +
> +The policy for inclusion in a Xen stable release is different to that
> +for inclusion in xen-unstable.
> +
> +Please see http://wiki.xen.org/wiki/Xen_Maintenance_Releases for more
> +information.
> +
> +Remember to copy the stable branch maintainer. The maintainer for this
> +branch is:
> +
> +	Jan Beulich <JBeulich@suse.com>
> +
> +Tools backport requests should also be copied to:
> +
> +	Ian Jackson <Ian.Jackson@eu.citrix.com>
> +
> +	Unstable Subsystem Maintainers
> +	==============================
> +
>  Descriptions of section entries:
>  
>  	M: Mail patches to: FullName <address@domain>




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 08:24:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 08:24:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdcwE-000741-SG; Wed, 28 Nov 2012 08:24:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdcwD-00073p-7W
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 08:24:09 +0000
Received: from [85.158.143.35:24563] by server-3.bemta-4.messagelabs.com id
	D3/AE-06841-82AC5B05; Wed, 28 Nov 2012 08:24:08 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354090990!4715416!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16817 invoked from network); 28 Nov 2012 08:23:11 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 08:23:10 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 08:23:10 +0000
Message-Id: <50B5D83402000078000ABFF1@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 08:24:04 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
In-Reply-To: <20121127213143.GB13890@phenom.dumpdata.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 27.11.12 at 22:31, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> Mukesh Rathor (6):
>       xen/pvh: Support ParaVirtualized Hardware extensions.
>       xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
>       xen/pvh: Implement MMU changes for PVH.
>       xen/pvh: bootup and setup (E820) related changes.
>       xen/pvh: balloon and grant changes.
>       xen/pvh: /dev/xen/privcmd changes.

As said before - I don't think it is a good idea to push the kernel side
changes into an official release when the hypervisor side ones didn't
even get an initial review yet.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 08:24:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 08:24:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdcwE-000741-SG; Wed, 28 Nov 2012 08:24:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdcwD-00073p-7W
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 08:24:09 +0000
Received: from [85.158.143.35:24563] by server-3.bemta-4.messagelabs.com id
	D3/AE-06841-82AC5B05; Wed, 28 Nov 2012 08:24:08 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354090990!4715416!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16817 invoked from network); 28 Nov 2012 08:23:11 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 08:23:10 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 08:23:10 +0000
Message-Id: <50B5D83402000078000ABFF1@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 08:24:04 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
In-Reply-To: <20121127213143.GB13890@phenom.dumpdata.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 27.11.12 at 22:31, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> Mukesh Rathor (6):
>       xen/pvh: Support ParaVirtualized Hardware extensions.
>       xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
>       xen/pvh: Implement MMU changes for PVH.
>       xen/pvh: bootup and setup (E820) related changes.
>       xen/pvh: balloon and grant changes.
>       xen/pvh: /dev/xen/privcmd changes.

As said before - I don't think it is a good idea to push the kernel side
changes into an official release when the hypervisor side ones didn't
even get an initial review yet.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 08:28:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 08:28:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdd0B-0007CO-6J; Wed, 28 Nov 2012 08:28:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Tdd0A-0007CJ-52
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 08:28:14 +0000
Received: from [85.158.137.99:27281] by server-16.bemta-3.messagelabs.com id
	7A/3B-07461-D1BC5B05; Wed, 28 Nov 2012 08:28:13 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354091292!16962764!1
X-Originating-IP: [209.85.212.179]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21277 invoked from network); 28 Nov 2012 08:28:12 -0000
Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com)
	(209.85.212.179)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 08:28:12 -0000
Received: by mail-wi0-f179.google.com with SMTP id hj6so4388415wib.14
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 00:28:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=FUnlKW+0N2z6NfXWBlDUFl2O5wubz8omYLHV09SFc2Y=;
	b=pMbeKfHvNhcdMsdXuFb47PyBFaHVjwObdXtdbxmW3iZjR3rZABAq1EbXXwO2x2M+0y
	Aui8hPeCxgAn2IrwJj/OWaE4IJNUaLVxavB45Q5xjZ32sUT2VUPFpNO9jW2esGQabYjA
	PBq+MmfU4SulzC22rVcqHyP8gwko8V/fKZc/G048xK6C6tonOh1IcPt4D99tMEQfpZfz
	pucXBPhU/PhgGRD3Vyz8XciBMEXYBMXNgfJIkWVZQtBAtoTR3R0JoJQNZIQdZDXkppUz
	/sBPXWS4ocXLvu3GVOc8RzI6h6HOzglxNVvZNYY67VBVEO7vKQ6ILn3+qzGFq+SCPQZ9
	DgUQ==
Received: by 10.180.78.161 with SMTP id c1mr27834096wix.4.1354091292124;
	Wed, 28 Nov 2012 00:28:12 -0800 (PST)
Received: from [192.168.1.88]
	(host86-183-153-239.range86-183.btcentralplus.com. [86.183.153.239])
	by mx.google.com with ESMTPS id bz12sm6778055wib.5.2012.11.28.00.28.07
	(version=SSLv3 cipher=OTHER); Wed, 28 Nov 2012 00:28:11 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 28 Nov 2012 08:28:06 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCDB7B96.4627A%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [PATCH] README: adjust gcc version requirement
Thread-Index: Ac3NQkoyHs+GXgHkYEOB4AT2/1wwVQ==
In-Reply-To: <50B5CF0502000078000ABFA1@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] README: adjust gcc version requirement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/2012 07:44, "Jan Beulich" <JBeulich@suse.com> wrote:

> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/README
> +++ b/README
> @@ -38,7 +38,7 @@ First, there are a number of prerequisit
>  release. Make sure you have all the following installed, either by
>  visiting the project webpage or installing a pre-built package
>  provided by your OS distributor:
> -    * GCC v3.4 or later
> +    * GCC v4.1 or later
>      * GNU Make
>      * GNU Binutils
>      * Development install of zlib (e.g., zlib-dev)
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 08:28:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 08:28:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdd0B-0007CO-6J; Wed, 28 Nov 2012 08:28:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Tdd0A-0007CJ-52
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 08:28:14 +0000
Received: from [85.158.137.99:27281] by server-16.bemta-3.messagelabs.com id
	7A/3B-07461-D1BC5B05; Wed, 28 Nov 2012 08:28:13 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354091292!16962764!1
X-Originating-IP: [209.85.212.179]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21277 invoked from network); 28 Nov 2012 08:28:12 -0000
Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com)
	(209.85.212.179)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 08:28:12 -0000
Received: by mail-wi0-f179.google.com with SMTP id hj6so4388415wib.14
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 00:28:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=FUnlKW+0N2z6NfXWBlDUFl2O5wubz8omYLHV09SFc2Y=;
	b=pMbeKfHvNhcdMsdXuFb47PyBFaHVjwObdXtdbxmW3iZjR3rZABAq1EbXXwO2x2M+0y
	Aui8hPeCxgAn2IrwJj/OWaE4IJNUaLVxavB45Q5xjZ32sUT2VUPFpNO9jW2esGQabYjA
	PBq+MmfU4SulzC22rVcqHyP8gwko8V/fKZc/G048xK6C6tonOh1IcPt4D99tMEQfpZfz
	pucXBPhU/PhgGRD3Vyz8XciBMEXYBMXNgfJIkWVZQtBAtoTR3R0JoJQNZIQdZDXkppUz
	/sBPXWS4ocXLvu3GVOc8RzI6h6HOzglxNVvZNYY67VBVEO7vKQ6ILn3+qzGFq+SCPQZ9
	DgUQ==
Received: by 10.180.78.161 with SMTP id c1mr27834096wix.4.1354091292124;
	Wed, 28 Nov 2012 00:28:12 -0800 (PST)
Received: from [192.168.1.88]
	(host86-183-153-239.range86-183.btcentralplus.com. [86.183.153.239])
	by mx.google.com with ESMTPS id bz12sm6778055wib.5.2012.11.28.00.28.07
	(version=SSLv3 cipher=OTHER); Wed, 28 Nov 2012 00:28:11 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 28 Nov 2012 08:28:06 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCDB7B96.4627A%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [PATCH] README: adjust gcc version requirement
Thread-Index: Ac3NQkoyHs+GXgHkYEOB4AT2/1wwVQ==
In-Reply-To: <50B5CF0502000078000ABFA1@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] README: adjust gcc version requirement
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/2012 07:44, "Jan Beulich" <JBeulich@suse.com> wrote:

> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/README
> +++ b/README
> @@ -38,7 +38,7 @@ First, there are a number of prerequisit
>  release. Make sure you have all the following installed, either by
>  visiting the project webpage or installing a pre-built package
>  provided by your OS distributor:
> -    * GCC v3.4 or later
> +    * GCC v4.1 or later
>      * GNU Make
>      * GNU Binutils
>      * Development install of zlib (e.g., zlib-dev)
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 08:28:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 08:28:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdd0T-0007Dh-JY; Wed, 28 Nov 2012 08:28:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Tdd0S-0007DS-3w
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 08:28:32 +0000
Received: from [85.158.137.99:34081] by server-6.bemta-3.messagelabs.com id
	8E/23-28265-F2BC5B05; Wed, 28 Nov 2012 08:28:31 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354091310!16962810!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22717 invoked from network); 28 Nov 2012 08:28:30 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 08:28:30 -0000
Received: by mail-ee0-f45.google.com with SMTP id d49so8720437eek.32
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 00:28:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=2kHXTAlN+e8y6WtPnzs0hrMv3v3YYZ0yF5yN/bvGG2U=;
	b=VVHY822xONVKnYjDXxSVUBP0mrNtHRrEuGF0Pi2igWuhRDZY12QyvYUcOzoD/FIFxX
	VO4qmq5FKw2EOArqFcuLy/8ogcZ9AAvyI5LA1PGCiQjt1Gv1/x3Md8dx6wyrKkG/+tlK
	x7J6IapKpDZ0AkOnnRMV0M6lF8/tcwShc7sdReWkUUT5TkkLxjKcKwEgA4arH/GAhDBK
	oWbaVTCJT2KgFu0uhCsFobiwkMZWKn70yWOWqhkW0VjS33UMuBqtsjnvdtcHy8OqI7Gm
	eZFiEqof6qnupAmoEBs5K4exAVmyEKk96m8jW8w0Ra7toKpRWxl5N3XKGr/wdUJj2sJp
	sqhg==
Received: by 10.14.193.136 with SMTP id k8mr67307980een.30.1354091309862;
	Wed, 28 Nov 2012 00:28:29 -0800 (PST)
Received: from [192.168.1.88]
	(host86-183-153-239.range86-183.btcentralplus.com. [86.183.153.239])
	by mx.google.com with ESMTPS id a45sm45158824eep.16.2012.11.28.00.28.26
	(version=SSLv3 cipher=OTHER); Wed, 28 Nov 2012 00:28:29 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 28 Nov 2012 08:28:25 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCDB7BA9.4627B%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [PATCH] x86: fix hypercall continuation cancellation
	in XENMAPSPACE_gmfn_range compat wrapper
Thread-Index: Ac3NQlWGakr5zk83XEGEcvfPoJYf8w==
In-Reply-To: <50B5CECD02000078000ABF99@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] x86: fix hypercall continuation
 cancellation in XENMAPSPACE_gmfn_range compat wrapper
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/2012 07:43, "Jan Beulich" <JBeulich@suse.com> wrote:

> When no continuation was established, there must also not be an attempt
> to cancel it - hypercall_cancel_continuation(), in the non-HVM, non-
> multicall case, adjusts the guest mode return address in a way assuming
> that an earlier call hypercall_create_continuation() took place.
> 
> Once touching this code, also restructure it slightly to improve
> readability and switch to using the more relaxed copy function (copying
> from the same guest memory already validated the virtual address
> range).
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/arch/x86/x86_64/compat/mm.c
> +++ b/xen/arch/x86/x86_64/compat/mm.c
> @@ -66,21 +66,20 @@ int compat_arch_memory_op(int op, XEN_GU
>          XLAT_add_to_physmap(nat, &cmp);
>          rc = arch_memory_op(op, guest_handle_from_ptr(nat, void));
>  
> -        if ( cmp.space == XENMAPSPACE_gmfn_range )
> +        if ( !rc || cmp.space != XENMAPSPACE_gmfn_range )
> +            break;
> +
> +        XLAT_add_to_physmap(&cmp, nat);
> +        if ( __copy_to_guest(arg, &cmp, 1) )
>          {
> -            if ( rc )
> -            {
> -                XLAT_add_to_physmap(&cmp, nat);
> -                if ( copy_to_guest(arg, &cmp, 1) )
> -                {
> -                    hypercall_cancel_continuation();
> -                    return -EFAULT;
> -                }
> -            }
>              if ( rc == __HYPERVISOR_memory_op )
> -                hypercall_xlat_continuation(NULL, 0x2, nat, arg);
> +                hypercall_cancel_continuation();
> +            return -EFAULT;
>          }
>  
> +        if ( rc == __HYPERVISOR_memory_op )
> +            hypercall_xlat_continuation(NULL, 0x2, nat, arg);
> +
>          break;
>      }
>  
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 08:28:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 08:28:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdd0T-0007Dh-JY; Wed, 28 Nov 2012 08:28:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Tdd0S-0007DS-3w
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 08:28:32 +0000
Received: from [85.158.137.99:34081] by server-6.bemta-3.messagelabs.com id
	8E/23-28265-F2BC5B05; Wed, 28 Nov 2012 08:28:31 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354091310!16962810!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22717 invoked from network); 28 Nov 2012 08:28:30 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 08:28:30 -0000
Received: by mail-ee0-f45.google.com with SMTP id d49so8720437eek.32
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 00:28:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=2kHXTAlN+e8y6WtPnzs0hrMv3v3YYZ0yF5yN/bvGG2U=;
	b=VVHY822xONVKnYjDXxSVUBP0mrNtHRrEuGF0Pi2igWuhRDZY12QyvYUcOzoD/FIFxX
	VO4qmq5FKw2EOArqFcuLy/8ogcZ9AAvyI5LA1PGCiQjt1Gv1/x3Md8dx6wyrKkG/+tlK
	x7J6IapKpDZ0AkOnnRMV0M6lF8/tcwShc7sdReWkUUT5TkkLxjKcKwEgA4arH/GAhDBK
	oWbaVTCJT2KgFu0uhCsFobiwkMZWKn70yWOWqhkW0VjS33UMuBqtsjnvdtcHy8OqI7Gm
	eZFiEqof6qnupAmoEBs5K4exAVmyEKk96m8jW8w0Ra7toKpRWxl5N3XKGr/wdUJj2sJp
	sqhg==
Received: by 10.14.193.136 with SMTP id k8mr67307980een.30.1354091309862;
	Wed, 28 Nov 2012 00:28:29 -0800 (PST)
Received: from [192.168.1.88]
	(host86-183-153-239.range86-183.btcentralplus.com. [86.183.153.239])
	by mx.google.com with ESMTPS id a45sm45158824eep.16.2012.11.28.00.28.26
	(version=SSLv3 cipher=OTHER); Wed, 28 Nov 2012 00:28:29 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 28 Nov 2012 08:28:25 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCDB7BA9.4627B%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [PATCH] x86: fix hypercall continuation cancellation
	in XENMAPSPACE_gmfn_range compat wrapper
Thread-Index: Ac3NQlWGakr5zk83XEGEcvfPoJYf8w==
In-Reply-To: <50B5CECD02000078000ABF99@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] x86: fix hypercall continuation
 cancellation in XENMAPSPACE_gmfn_range compat wrapper
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/2012 07:43, "Jan Beulich" <JBeulich@suse.com> wrote:

> When no continuation was established, there must also not be an attempt
> to cancel it - hypercall_cancel_continuation(), in the non-HVM, non-
> multicall case, adjusts the guest mode return address in a way assuming
> that an earlier call hypercall_create_continuation() took place.
> 
> Once touching this code, also restructure it slightly to improve
> readability and switch to using the more relaxed copy function (copying
> from the same guest memory already validated the virtual address
> range).
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/arch/x86/x86_64/compat/mm.c
> +++ b/xen/arch/x86/x86_64/compat/mm.c
> @@ -66,21 +66,20 @@ int compat_arch_memory_op(int op, XEN_GU
>          XLAT_add_to_physmap(nat, &cmp);
>          rc = arch_memory_op(op, guest_handle_from_ptr(nat, void));
>  
> -        if ( cmp.space == XENMAPSPACE_gmfn_range )
> +        if ( !rc || cmp.space != XENMAPSPACE_gmfn_range )
> +            break;
> +
> +        XLAT_add_to_physmap(&cmp, nat);
> +        if ( __copy_to_guest(arg, &cmp, 1) )
>          {
> -            if ( rc )
> -            {
> -                XLAT_add_to_physmap(&cmp, nat);
> -                if ( copy_to_guest(arg, &cmp, 1) )
> -                {
> -                    hypercall_cancel_continuation();
> -                    return -EFAULT;
> -                }
> -            }
>              if ( rc == __HYPERVISOR_memory_op )
> -                hypercall_xlat_continuation(NULL, 0x2, nat, arg);
> +                hypercall_cancel_continuation();
> +            return -EFAULT;
>          }
>  
> +        if ( rc == __HYPERVISOR_memory_op )
> +            hypercall_xlat_continuation(NULL, 0x2, nat, arg);
> +
>          break;
>      }
>  
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 08:30:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 08:30:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdd1s-0007NE-4P; Wed, 28 Nov 2012 08:30:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Tdd1q-0007N4-Qb
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 08:29:59 +0000
Received: from [85.158.143.35:53015] by server-1.bemta-4.messagelabs.com id
	FE/5F-27934-68BC5B05; Wed, 28 Nov 2012 08:29:58 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1354091327!13945670!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15604 invoked from network); 28 Nov 2012 08:28:52 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 08:28:52 -0000
Received: by mail-ea0-f173.google.com with SMTP id i13so6107042eaa.32
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 00:28:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=eAORzwHcukvnx7bU3y2DljFYmOcBkA1q509b+DN/uD0=;
	b=flmYm5x3igyRWQXTcbYHyXQzZwCttKXZDSYDNeoguBlVg5eLNnt12atwstBNeH1f2D
	nv3+n9RnKAeElE9x/s22mtlBqJor44rCSuc1cEXxdZgXwsn0Lpcw+LF8keGa52aTsTGs
	7h5lLYUodoH3WyyViQ82j0A9OykW4BfqisIDDKKnhAJcjwVX9Hx9CrE7Bpx4So/kiRLe
	y0mxldp3R3PQAtxo5yfaAGUJ0G2isOrT0uoz5ddfva84NAEVoZNQ7G8WxqMO0WfAlQIG
	wyHh9VsMQ+x65KGoOtzfz3qwQG9rwZ+4iJGiRUHeyFqFRojJ22KOaI07MIDPEgdh8klJ
	dHsA==
Received: by 10.14.221.5 with SMTP id q5mr67219841eep.33.1354091327213;
	Wed, 28 Nov 2012 00:28:47 -0800 (PST)
Received: from [192.168.1.88]
	(host86-183-153-239.range86-183.btcentralplus.com. [86.183.153.239])
	by mx.google.com with ESMTPS id d44sm45702519eeo.10.2012.11.28.00.28.45
	(version=SSLv3 cipher=OTHER); Wed, 28 Nov 2012 00:28:46 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 28 Nov 2012 08:28:44 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCDB7BBC.4627C%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [PATCH] ACPI: fix return value of XEN_PM_PDC
	platform op
Thread-Index: Ac3NQmDZbQj9QKJ4KEeBhCsdOZo1EQ==
In-Reply-To: <50B5CEE902000078000ABF9D@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] ACPI: fix return value of XEN_PM_PDC
 platform op
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/2012 07:44, "Jan Beulich" <JBeulich@suse.com> wrote:

> Should return -EFAULT when copying to guest memory fails.
> 
> Once touching this code, also switch to using the more relaxed copy
> function (copying from the same guest memory already validated the
> virtual address range).
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/drivers/acpi/pmstat.c
> +++ b/xen/drivers/acpi/pmstat.c
> @@ -521,8 +521,8 @@ int acpi_set_pdc_bits(u32 acpi_id, XEN_G
>                      ACPI_PDC_SMP_C1PT) & ~mask;
>          ret = arch_acpi_set_pdc_bits(acpi_id, bits, mask);
>      }
> -    if ( !ret )
> -        ret = copy_to_guest_offset(pdc, 2, bits + 2, 1);
> +    if ( !ret && __copy_to_guest_offset(pdc, 2, bits + 2, 1) )
> +        ret = -EFAULT;
>  
>      return ret;
>  }
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 08:30:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 08:30:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdd1s-0007NE-4P; Wed, 28 Nov 2012 08:30:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Tdd1q-0007N4-Qb
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 08:29:59 +0000
Received: from [85.158.143.35:53015] by server-1.bemta-4.messagelabs.com id
	FE/5F-27934-68BC5B05; Wed, 28 Nov 2012 08:29:58 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1354091327!13945670!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15604 invoked from network); 28 Nov 2012 08:28:52 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 08:28:52 -0000
Received: by mail-ea0-f173.google.com with SMTP id i13so6107042eaa.32
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 00:28:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=eAORzwHcukvnx7bU3y2DljFYmOcBkA1q509b+DN/uD0=;
	b=flmYm5x3igyRWQXTcbYHyXQzZwCttKXZDSYDNeoguBlVg5eLNnt12atwstBNeH1f2D
	nv3+n9RnKAeElE9x/s22mtlBqJor44rCSuc1cEXxdZgXwsn0Lpcw+LF8keGa52aTsTGs
	7h5lLYUodoH3WyyViQ82j0A9OykW4BfqisIDDKKnhAJcjwVX9Hx9CrE7Bpx4So/kiRLe
	y0mxldp3R3PQAtxo5yfaAGUJ0G2isOrT0uoz5ddfva84NAEVoZNQ7G8WxqMO0WfAlQIG
	wyHh9VsMQ+x65KGoOtzfz3qwQG9rwZ+4iJGiRUHeyFqFRojJ22KOaI07MIDPEgdh8klJ
	dHsA==
Received: by 10.14.221.5 with SMTP id q5mr67219841eep.33.1354091327213;
	Wed, 28 Nov 2012 00:28:47 -0800 (PST)
Received: from [192.168.1.88]
	(host86-183-153-239.range86-183.btcentralplus.com. [86.183.153.239])
	by mx.google.com with ESMTPS id d44sm45702519eeo.10.2012.11.28.00.28.45
	(version=SSLv3 cipher=OTHER); Wed, 28 Nov 2012 00:28:46 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 28 Nov 2012 08:28:44 +0000
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCDB7BBC.4627C%keir.xen@gmail.com>
Thread-Topic: [Xen-devel] [PATCH] ACPI: fix return value of XEN_PM_PDC
	platform op
Thread-Index: Ac3NQmDZbQj9QKJ4KEeBhCsdOZo1EQ==
In-Reply-To: <50B5CEE902000078000ABF9D@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] ACPI: fix return value of XEN_PM_PDC
 platform op
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/2012 07:44, "Jan Beulich" <JBeulich@suse.com> wrote:

> Should return -EFAULT when copying to guest memory fails.
> 
> Once touching this code, also switch to using the more relaxed copy
> function (copying from the same guest memory already validated the
> virtual address range).
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/drivers/acpi/pmstat.c
> +++ b/xen/drivers/acpi/pmstat.c
> @@ -521,8 +521,8 @@ int acpi_set_pdc_bits(u32 acpi_id, XEN_G
>                      ACPI_PDC_SMP_C1PT) & ~mask;
>          ret = arch_acpi_set_pdc_bits(acpi_id, bits, mask);
>      }
> -    if ( !ret )
> -        ret = copy_to_guest_offset(pdc, 2, bits + 2, 1);
> +    if ( !ret && __copy_to_guest_offset(pdc, 2, bits + 2, 1) )
> +        ret = -EFAULT;
>  
>      return ret;
>  }
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 08:39:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 08:39:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TddAL-0007hW-FP; Wed, 28 Nov 2012 08:38:45 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TddAK-0007hR-0B
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 08:38:44 +0000
Received: from [85.158.137.99:65502] by server-5.bemta-3.messagelabs.com id
	E8/E5-26311-39DC5B05; Wed, 28 Nov 2012 08:38:43 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1354091921!16982636!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11069 invoked from network); 28 Nov 2012 08:38:41 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 08:38:41 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 08:38:40 +0000
Message-Id: <50B5DBD702000078000AC021@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 08:39:35 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Kouya Shimura" <kouya@jp.fujitsu.com>
References: <50B5B48C.7040804@jp.fujitsu.com>
In-Reply-To: <50B5B48C.7040804@jp.fujitsu.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] x86/hap: Fix memory leak of
 domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 28.11.12 at 07:51, Kouya Shimura <kouya@jp.fujitsu.com> wrote:
> This patch fixes the memory leak of domain->arch.hvm_domain.dirty_vram.
> 
> Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>

Wouldn't it be more consistent (and less redundant) to do this
through calling hap_track_dirty_vram(d, 0, 0, ...)? And even if
not, the conditional around the freeing/clearing is pointless.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 08:39:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 08:39:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TddAL-0007hW-FP; Wed, 28 Nov 2012 08:38:45 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TddAK-0007hR-0B
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 08:38:44 +0000
Received: from [85.158.137.99:65502] by server-5.bemta-3.messagelabs.com id
	E8/E5-26311-39DC5B05; Wed, 28 Nov 2012 08:38:43 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1354091921!16982636!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11069 invoked from network); 28 Nov 2012 08:38:41 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 08:38:41 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 08:38:40 +0000
Message-Id: <50B5DBD702000078000AC021@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 08:39:35 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Kouya Shimura" <kouya@jp.fujitsu.com>
References: <50B5B48C.7040804@jp.fujitsu.com>
In-Reply-To: <50B5B48C.7040804@jp.fujitsu.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] x86/hap: Fix memory leak of
 domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 28.11.12 at 07:51, Kouya Shimura <kouya@jp.fujitsu.com> wrote:
> This patch fixes the memory leak of domain->arch.hvm_domain.dirty_vram.
> 
> Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>

Wouldn't it be more consistent (and less redundant) to do this
through calling hap_track_dirty_vram(d, 0, 0, ...)? And even if
not, the conditional around the freeing/clearing is pointless.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 09:41:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 09:41:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tde8V-00083B-Qv; Wed, 28 Nov 2012 09:40:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tde8V-000836-3j
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 09:40:55 +0000
Received: from [85.158.139.211:36091] by server-10.bemta-5.messagelabs.com id
	E9/A8-09257-62CD5B05; Wed, 28 Nov 2012 09:40:54 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1354095648!18116566!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28115 invoked from network); 28 Nov 2012 09:40:48 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 09:40:48 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 09:40:46 +0000
Message-Id: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 09:41:41 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Subject: [Xen-devel] [PATCH, RFC 0/7] IOMMU: add phantom function support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

While I'm unaware of devices making use of this functionality in
proper ways, the goal of this patch set is to leverage the enabling
of the specified behavior as a workaround for devices that behave
as if they made use of this functionality _without_ advertising so
in the PCIe capability structure.

While it would have been possible to leave the generic IOMMU
code untouched, and deal with the creation of the necessary
device context entries in the individual IOMMUs' implementations,
I felt that it was cleaner to have as much of the necessary
abstraction in the generic layer.

The adjustments in particular imply that for the relevant
operations, (PCI-dev, devfn) tuples get passed, with the PCI
device referring to the real device and devfn representing
either the real device or the phantom function. Consequently,
for any operation intended to deal with the real device, the
devfn of the device itself must be used, whereas for anything
targeting the phantom function the passed in value is the
correct one to pass on.

1: IOMMU: adjust (re)assign operation parameters
2: IOMMU: adjust add/remove operation parameters
3: VT-d: adjust context map/unmap parameters
4: AMD IOMMU: adjust flush function parameters
5: IOMMU: consolidate pdev_type() and cache its result for a given device
6: IOMMU: add phantom function support
7: IOMMU: add option to specify devices behaving like ones using phantom functions

As the patch set wasn't tested on the affected systems yet, I'm
intentionally not adding S-o-b tags yet. I would appreciate review
nevertheless (and even more so, given that I won't be able to
test this code other than what I did in contrived scenarios).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 09:41:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 09:41:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tde8V-00083B-Qv; Wed, 28 Nov 2012 09:40:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tde8V-000836-3j
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 09:40:55 +0000
Received: from [85.158.139.211:36091] by server-10.bemta-5.messagelabs.com id
	E9/A8-09257-62CD5B05; Wed, 28 Nov 2012 09:40:54 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1354095648!18116566!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28115 invoked from network); 28 Nov 2012 09:40:48 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 09:40:48 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 09:40:46 +0000
Message-Id: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 09:41:41 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Subject: [Xen-devel] [PATCH, RFC 0/7] IOMMU: add phantom function support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

While I'm unaware of devices making use of this functionality in
proper ways, the goal of this patch set is to leverage the enabling
of the specified behavior as a workaround for devices that behave
as if they made use of this functionality _without_ advertising so
in the PCIe capability structure.

While it would have been possible to leave the generic IOMMU
code untouched, and deal with the creation of the necessary
device context entries in the individual IOMMUs' implementations,
I felt that it was cleaner to have as much of the necessary
abstraction in the generic layer.

The adjustments in particular imply that for the relevant
operations, (PCI-dev, devfn) tuples get passed, with the PCI
device referring to the real device and devfn representing
either the real device or the phantom function. Consequently,
for any operation intended to deal with the real device, the
devfn of the device itself must be used, whereas for anything
targeting the phantom function the passed in value is the
correct one to pass on.

1: IOMMU: adjust (re)assign operation parameters
2: IOMMU: adjust add/remove operation parameters
3: VT-d: adjust context map/unmap parameters
4: AMD IOMMU: adjust flush function parameters
5: IOMMU: consolidate pdev_type() and cache its result for a given device
6: IOMMU: add phantom function support
7: IOMMU: add option to specify devices behaving like ones using phantom functions

As the patch set wasn't tested on the affected systems yet, I'm
intentionally not adding S-o-b tags yet. I would appreciate review
nevertheless (and even more so, given that I won't be able to
test this code other than what I did in contrived scenarios).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 09:48:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 09:48:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdeEo-0008Co-PY; Wed, 28 Nov 2012 09:47:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdeEm-0008Ci-S2
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 09:47:25 +0000
Received: from [85.158.139.211:52307] by server-11.bemta-5.messagelabs.com id
	CC/76-03409-CADD5B05; Wed, 28 Nov 2012 09:47:24 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1354096041!18121632!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5392 invoked from network); 28 Nov 2012 09:47:22 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 09:47:22 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 09:47:20 +0000
Message-Id: <50B5EBEE02000078000AC104@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 09:48:14 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
In-Reply-To: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part9EAF76CE.0__="
Subject: [Xen-devel] [PATCH,
	RFC 1/7] IOMMU: adjust (re)assign operation parameters
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part9EAF76CE.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

... to use a (struct pci_dev *, devfn) pair.

--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -332,34 +332,31 @@ void amd_iommu_disable_domain_device(str
         disable_ats_device(iommu->seg, bus, devfn);
 }
=20
-static int reassign_device( struct domain *source, struct domain *target,
-                            u16 seg, u8 bus, u8 devfn)
+static int reassign_device(struct domain *source, struct domain *target,
+                           u8 devfn, struct pci_dev *pdev)
 {
-    struct pci_dev *pdev;
     struct amd_iommu *iommu;
     int bdf;
     struct hvm_iommu *t =3D domain_hvm_iommu(target);
=20
-    ASSERT(spin_is_locked(&pcidevs_lock));
-    pdev =3D pci_get_pdev_by_domain(source, seg, bus, devfn);
-    if ( !pdev )
-        return -ENODEV;
-
-    bdf =3D PCI_BDF2(bus, devfn);
-    iommu =3D find_iommu_for_device(seg, bdf);
+    bdf =3D PCI_BDF2(pdev->bus, pdev->devfn);
+    iommu =3D find_iommu_for_device(pdev->seg, bdf);
     if ( !iommu )
     {
         AMD_IOMMU_DEBUG("Fail to find iommu."
                         " %04x:%02x:%x02.%x cannot be assigned to =
dom%d\n",
-                        seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
+                        pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(de=
vfn),
                         target->domain_id);
         return -ENODEV;
     }
=20
     amd_iommu_disable_domain_device(source, iommu, bdf);
=20
-    list_move(&pdev->domain_list, &target->arch.pdev_list);
-    pdev->domain =3D target;
+    if ( devfn =3D=3D pdev->devfn )
+    {
+        list_move(&pdev->domain_list, &target->arch.pdev_list);
+        pdev->domain =3D target;
+    }
=20
     /* IO page tables might be destroyed after pci-detach the last device
      * In this case, we have to re-allocate root table for next pci-attach=
.*/
@@ -368,17 +365,18 @@ static int reassign_device( struct domai
=20
     amd_iommu_setup_domain_device(target, iommu, bdf);
     AMD_IOMMU_DEBUG("Re-assign %04x:%02x:%02x.%u from dom%d to dom%d\n",
-                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
+                    pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(devfn)=
,
                     source->domain_id, target->domain_id);
=20
     return 0;
 }
=20
-static int amd_iommu_assign_device(struct domain *d, u16 seg, u8 bus, u8 =
devfn)
+static int amd_iommu_assign_device(struct domain *d, u8 devfn,
+                                   struct pci_dev *pdev)
 {
-    struct ivrs_mappings *ivrs_mappings =3D get_ivrs_mappings(seg);
-    int bdf =3D PCI_BDF2(bus, devfn);
-    int req_id =3D get_dma_requestor_id(seg, bdf);
+    struct ivrs_mappings *ivrs_mappings =3D get_ivrs_mappings(pdev->seg);
+    int bdf =3D PCI_BDF2(pdev->bus, devfn);
+    int req_id =3D get_dma_requestor_id(pdev->seg, bdf);
=20
     if ( ivrs_mappings[req_id].unity_map_enable )
     {
@@ -390,7 +388,7 @@ static int amd_iommu_assign_device(struc
             ivrs_mappings[req_id].read_permission);
     }
=20
-    return reassign_device(dom0, d, seg, bus, devfn);
+    return reassign_device(dom0, d, devfn, pdev);
 }
=20
 static void deallocate_next_page_table(struct page_info* pg, int level)
@@ -451,12 +449,6 @@ static void amd_iommu_domain_destroy(str
     amd_iommu_flush_all_pages(d);
 }
=20
-static int amd_iommu_return_device(
-    struct domain *s, struct domain *t, u16 seg, u8 bus, u8 devfn)
-{
-    return reassign_device(s, t, seg, bus, devfn);
-}
-
 static int amd_iommu_add_device(struct pci_dev *pdev)
 {
     struct amd_iommu *iommu;
@@ -593,7 +585,7 @@ const struct iommu_ops amd_iommu_ops =3D {
     .teardown =3D amd_iommu_domain_destroy,
     .map_page =3D amd_iommu_map_page,
     .unmap_page =3D amd_iommu_unmap_page,
-    .reassign_device =3D amd_iommu_return_device,
+    .reassign_device =3D reassign_device,
     .get_device_group_id =3D amd_iommu_group_id,
     .update_ire_from_apic =3D amd_iommu_ioapic_update_ire,
     .update_ire_from_msi =3D amd_iommu_msi_msg_update_ire,
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -229,11 +229,16 @@ static int assign_device(struct domain *
         return -EXDEV;
=20
     spin_lock(&pcidevs_lock);
-    pdev =3D pci_get_pdev(seg, bus, devfn);
-    if ( pdev )
-        pdev->fault.count =3D 0;
+    pdev =3D pci_get_pdev_by_domain(dom0, seg, bus, devfn);
+    if ( !pdev )
+    {
+        rc =3D pci_get_pdev(seg, bus, devfn) ? -EBUSY : -ENODEV;
+        goto done;
+    }
+
+    pdev->fault.count =3D 0;
=20
-    if ( (rc =3D hd->platform_ops->assign_device(d, seg, bus, devfn)) )
+    if ( (rc =3D hd->platform_ops->assign_device(d, devfn, pdev)) )
         goto done;
=20
     if ( has_arch_pdevs(d) && !need_iommu(d) )
@@ -364,18 +369,11 @@ int deassign_device(struct domain *d, u1
         return -EINVAL;
=20
     ASSERT(spin_is_locked(&pcidevs_lock));
-    pdev =3D pci_get_pdev(seg, bus, devfn);
+    pdev =3D pci_get_pdev_by_domain(d, seg, bus, devfn);
     if ( !pdev )
         return -ENODEV;
=20
-    if ( pdev->domain !=3D d )
-    {
-        dprintk(XENLOG_G_ERR,
-                "d%d: deassign a device not owned\n", d->domain_id);
-        return -EINVAL;
-    }
-
-    ret =3D hd->platform_ops->reassign_device(d, dom0, seg, bus, devfn);
+    ret =3D hd->platform_ops->reassign_device(d, dom0, devfn, pdev);
     if ( ret )
     {
         dprintk(XENLOG_G_ERR,
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1658,17 +1658,10 @@ out:
 static int reassign_device_ownership(
     struct domain *source,
     struct domain *target,
-    u16 seg, u8 bus, u8 devfn)
+    u8 devfn, struct pci_dev *pdev)
 {
-    struct pci_dev *pdev;
     int ret;
=20
-    ASSERT(spin_is_locked(&pcidevs_lock));
-    pdev =3D pci_get_pdev_by_domain(source, seg, bus, devfn);
-
-    if (!pdev)
-        return -ENODEV;
-
     /*
      * Devices assigned to untrusted domains (here assumed to be any =
domU)
      * can attempt to send arbitrary LAPIC/MSI messages. We are unprotecte=
d
@@ -1677,16 +1670,19 @@ static int reassign_device_ownership(
     if ( (target !=3D dom0) && !iommu_intremap )
         untrusted_msi =3D 1;
=20
-    ret =3D domain_context_unmap(source, seg, bus, devfn);
+    ret =3D domain_context_unmap(source, pdev->seg, pdev->bus, devfn);
     if ( ret )
         return ret;
=20
-    ret =3D domain_context_mapping(target, seg, bus, devfn);
+    ret =3D domain_context_mapping(target, pdev->seg, pdev->bus, devfn);
     if ( ret )
         return ret;
=20
-    list_move(&pdev->domain_list, &target->arch.pdev_list);
-    pdev->domain =3D target;
+    if ( devfn =3D=3D pdev->devfn )
+    {
+        list_move(&pdev->domain_list, &target->arch.pdev_list);
+        pdev->domain =3D target;
+    }
=20
     return ret;
 }
@@ -2202,36 +2198,26 @@ int __init intel_vtd_setup(void)
 }
=20
 static int intel_iommu_assign_device(
-    struct domain *d, u16 seg, u8 bus, u8 devfn)
+    struct domain *d, u8 devfn, struct pci_dev *pdev)
 {
     struct acpi_rmrr_unit *rmrr;
     int ret =3D 0, i;
-    struct pci_dev *pdev;
-    u16 bdf;
+    u16 bdf, seg;
+    u8 bus;
=20
     if ( list_empty(&acpi_drhd_units) )
         return -ENODEV;
=20
-    ASSERT(spin_is_locked(&pcidevs_lock));
-    pdev =3D pci_get_pdev(seg, bus, devfn);
-    if (!pdev)
-        return -ENODEV;
-
-    if (pdev->domain !=3D dom0)
-    {
-        dprintk(XENLOG_ERR VTDPREFIX,
-                "IOMMU: assign a assigned device\n");
-       return -EBUSY;
-    }
-
-    ret =3D reassign_device_ownership(dom0, d, seg, bus, devfn);
+    ret =3D reassign_device_ownership(dom0, d, devfn, pdev);
     if ( ret )
         goto done;
=20
     /* FIXME: Because USB RMRR conflicts with guest bios region,
      * ignore USB RMRR temporarily.
      */
-    if ( is_usb_device(seg, bus, devfn) )
+    seg =3D pdev->seg;
+    bus =3D pdev->bus;
+    if ( is_usb_device(seg, bus, pdev->devfn) )
     {
         ret =3D 0;
         goto done;
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -97,13 +97,13 @@ struct iommu_ops {
     int (*add_device)(struct pci_dev *pdev);
     int (*enable_device)(struct pci_dev *pdev);
     int (*remove_device)(struct pci_dev *pdev);
-    int (*assign_device)(struct domain *d, u16 seg, u8 bus, u8 devfn);
+    int (*assign_device)(struct domain *, u8 devfn, struct pci_dev *);
     void (*teardown)(struct domain *d);
     int (*map_page)(struct domain *d, unsigned long gfn, unsigned long =
mfn,
                     unsigned int flags);
     int (*unmap_page)(struct domain *d, unsigned long gfn);
     int (*reassign_device)(struct domain *s, struct domain *t,
-			   u16 seg, u8 bus, u8 devfn);
+			   u8 devfn, struct pci_dev *);
     int (*get_device_group_id)(u16 seg, u8 bus, u8 devfn);
     void (*update_ire_from_apic)(unsigned int apic, unsigned int reg, =
unsigned int value);
     void (*update_ire_from_msi)(struct msi_desc *msi_desc, struct msi_msg =
*msg);


--=__Part9EAF76CE.0__=
Content-Type: text/plain; name="IOMMU-assign-params.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="IOMMU-assign-params.patch"

IOMMU: adjust (re)assign operation parameters=0A=0A... to use a (struct =
pci_dev *, devfn) pair.=0A=0A--- a/xen/drivers/passthrough/amd/pci_amd_iomm=
u.c=0A+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c=0A@@ -332,34 =
+332,31 @@ void amd_iommu_disable_domain_device(str=0A         disable_ats_=
device(iommu->seg, bus, devfn);=0A }=0A =0A-static int reassign_device( =
struct domain *source, struct domain *target,=0A-                          =
  u16 seg, u8 bus, u8 devfn)=0A+static int reassign_device(struct domain =
*source, struct domain *target,=0A+                           u8 devfn, =
struct pci_dev *pdev)=0A {=0A-    struct pci_dev *pdev;=0A     struct =
amd_iommu *iommu;=0A     int bdf;=0A     struct hvm_iommu *t =3D domain_hvm=
_iommu(target);=0A =0A-    ASSERT(spin_is_locked(&pcidevs_lock));=0A-    =
pdev =3D pci_get_pdev_by_domain(source, seg, bus, devfn);=0A-    if ( =
!pdev )=0A-        return -ENODEV;=0A-=0A-    bdf =3D PCI_BDF2(bus, =
devfn);=0A-    iommu =3D find_iommu_for_device(seg, bdf);=0A+    bdf =3D =
PCI_BDF2(pdev->bus, pdev->devfn);=0A+    iommu =3D find_iommu_for_device(pd=
ev->seg, bdf);=0A     if ( !iommu )=0A     {=0A         AMD_IOMMU_DEBUG("Fa=
il to find iommu."=0A                         " %04x:%02x:%x02.%x cannot =
be assigned to dom%d\n",=0A-                        seg, bus, PCI_SLOT(devf=
n), PCI_FUNC(devfn),=0A+                        pdev->seg, pdev->bus, =
PCI_SLOT(devfn), PCI_FUNC(devfn),=0A                         target->domain=
_id);=0A         return -ENODEV;=0A     }=0A =0A     amd_iommu_disable_doma=
in_device(source, iommu, bdf);=0A =0A-    list_move(&pdev->domain_list, =
&target->arch.pdev_list);=0A-    pdev->domain =3D target;=0A+    if ( =
devfn =3D=3D pdev->devfn )=0A+    {=0A+        list_move(&pdev->domain_list=
, &target->arch.pdev_list);=0A+        pdev->domain =3D target;=0A+    =
}=0A =0A     /* IO page tables might be destroyed after pci-detach the =
last device=0A      * In this case, we have to re-allocate root table for =
next pci-attach.*/=0A@@ -368,17 +365,18 @@ static int reassign_device( =
struct domai=0A =0A     amd_iommu_setup_domain_device(target, iommu, =
bdf);=0A     AMD_IOMMU_DEBUG("Re-assign %04x:%02x:%02x.%u from dom%d to =
dom%d\n",=0A-                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn)=
,=0A+                    pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(de=
vfn),=0A                     source->domain_id, target->domain_id);=0A =0A =
    return 0;=0A }=0A =0A-static int amd_iommu_assign_device(struct domain =
*d, u16 seg, u8 bus, u8 devfn)=0A+static int amd_iommu_assign_device(struct=
 domain *d, u8 devfn,=0A+                                   struct pci_dev =
*pdev)=0A {=0A-    struct ivrs_mappings *ivrs_mappings =3D get_ivrs_mapping=
s(seg);=0A-    int bdf =3D PCI_BDF2(bus, devfn);=0A-    int req_id =3D =
get_dma_requestor_id(seg, bdf);=0A+    struct ivrs_mappings *ivrs_mappings =
=3D get_ivrs_mappings(pdev->seg);=0A+    int bdf =3D PCI_BDF2(pdev->bus, =
devfn);=0A+    int req_id =3D get_dma_requestor_id(pdev->seg, bdf);=0A =0A =
    if ( ivrs_mappings[req_id].unity_map_enable )=0A     {=0A@@ -390,7 =
+388,7 @@ static int amd_iommu_assign_device(struc=0A             =
ivrs_mappings[req_id].read_permission);=0A     }=0A =0A-    return =
reassign_device(dom0, d, seg, bus, devfn);=0A+    return reassign_device(do=
m0, d, devfn, pdev);=0A }=0A =0A static void deallocate_next_page_table(str=
uct page_info* pg, int level)=0A@@ -451,12 +449,6 @@ static void amd_iommu_=
domain_destroy(str=0A     amd_iommu_flush_all_pages(d);=0A }=0A =0A-static =
int amd_iommu_return_device(=0A-    struct domain *s, struct domain *t, =
u16 seg, u8 bus, u8 devfn)=0A-{=0A-    return reassign_device(s, t, seg, =
bus, devfn);=0A-}=0A-=0A static int amd_iommu_add_device(struct pci_dev =
*pdev)=0A {=0A     struct amd_iommu *iommu;=0A@@ -593,7 +585,7 @@ const =
struct iommu_ops amd_iommu_ops =3D {=0A     .teardown =3D amd_iommu_domain_=
destroy,=0A     .map_page =3D amd_iommu_map_page,=0A     .unmap_page =3D =
amd_iommu_unmap_page,=0A-    .reassign_device =3D amd_iommu_return_device,=
=0A+    .reassign_device =3D reassign_device,=0A     .get_device_group_id =
=3D amd_iommu_group_id,=0A     .update_ire_from_apic =3D amd_iommu_ioapic_u=
pdate_ire,=0A     .update_ire_from_msi =3D amd_iommu_msi_msg_update_ire,=0A=
--- a/xen/drivers/passthrough/iommu.c=0A+++ b/xen/drivers/passthrough/iommu=
.c=0A@@ -229,11 +229,16 @@ static int assign_device(struct domain *=0A     =
    return -EXDEV;=0A =0A     spin_lock(&pcidevs_lock);=0A-    pdev =3D =
pci_get_pdev(seg, bus, devfn);=0A-    if ( pdev )=0A-        pdev->fault.co=
unt =3D 0;=0A+    pdev =3D pci_get_pdev_by_domain(dom0, seg, bus, =
devfn);=0A+    if ( !pdev )=0A+    {=0A+        rc =3D pci_get_pdev(seg, =
bus, devfn) ? -EBUSY : -ENODEV;=0A+        goto done;=0A+    }=0A+=0A+    =
pdev->fault.count =3D 0;=0A =0A-    if ( (rc =3D hd->platform_ops->assign_d=
evice(d, seg, bus, devfn)) )=0A+    if ( (rc =3D hd->platform_ops->assign_d=
evice(d, devfn, pdev)) )=0A         goto done;=0A =0A     if ( has_arch_pde=
vs(d) && !need_iommu(d) )=0A@@ -364,18 +369,11 @@ int deassign_device(struc=
t domain *d, u1=0A         return -EINVAL;=0A =0A     ASSERT(spin_is_locked=
(&pcidevs_lock));=0A-    pdev =3D pci_get_pdev(seg, bus, devfn);=0A+    =
pdev =3D pci_get_pdev_by_domain(d, seg, bus, devfn);=0A     if ( !pdev =
)=0A         return -ENODEV;=0A =0A-    if ( pdev->domain !=3D d )=0A-    =
{=0A-        dprintk(XENLOG_G_ERR,=0A-                "d%d: deassign a =
device not owned\n", d->domain_id);=0A-        return -EINVAL;=0A-    =
}=0A-=0A-    ret =3D hd->platform_ops->reassign_device(d, dom0, seg, bus, =
devfn);=0A+    ret =3D hd->platform_ops->reassign_device(d, dom0, devfn, =
pdev);=0A     if ( ret )=0A     {=0A         dprintk(XENLOG_G_ERR,=0A--- =
a/xen/drivers/passthrough/vtd/iommu.c=0A+++ b/xen/drivers/passthrough/vtd/i=
ommu.c=0A@@ -1658,17 +1658,10 @@ out:=0A static int reassign_device_ownersh=
ip(=0A     struct domain *source,=0A     struct domain *target,=0A-    u16 =
seg, u8 bus, u8 devfn)=0A+    u8 devfn, struct pci_dev *pdev)=0A {=0A-    =
struct pci_dev *pdev;=0A     int ret;=0A =0A-    ASSERT(spin_is_locked(&pci=
devs_lock));=0A-    pdev =3D pci_get_pdev_by_domain(source, seg, bus, =
devfn);=0A-=0A-    if (!pdev)=0A-        return -ENODEV;=0A-=0A     /*=0A  =
    * Devices assigned to untrusted domains (here assumed to be any =
domU)=0A      * can attempt to send arbitrary LAPIC/MSI messages. We are =
unprotected=0A@@ -1677,16 +1670,19 @@ static int reassign_device_ownership(=
=0A     if ( (target !=3D dom0) && !iommu_intremap )=0A         untrusted_m=
si =3D 1;=0A =0A-    ret =3D domain_context_unmap(source, seg, bus, =
devfn);=0A+    ret =3D domain_context_unmap(source, pdev->seg, pdev->bus, =
devfn);=0A     if ( ret )=0A         return ret;=0A =0A-    ret =3D =
domain_context_mapping(target, seg, bus, devfn);=0A+    ret =3D domain_cont=
ext_mapping(target, pdev->seg, pdev->bus, devfn);=0A     if ( ret )=0A     =
    return ret;=0A =0A-    list_move(&pdev->domain_list, &target->arch.pdev=
_list);=0A-    pdev->domain =3D target;=0A+    if ( devfn =3D=3D pdev->devf=
n )=0A+    {=0A+        list_move(&pdev->domain_list, &target->arch.pdev_li=
st);=0A+        pdev->domain =3D target;=0A+    }=0A =0A     return =
ret;=0A }=0A@@ -2202,36 +2198,26 @@ int __init intel_vtd_setup(void)=0A =
}=0A =0A static int intel_iommu_assign_device(=0A-    struct domain *d, =
u16 seg, u8 bus, u8 devfn)=0A+    struct domain *d, u8 devfn, struct =
pci_dev *pdev)=0A {=0A     struct acpi_rmrr_unit *rmrr;=0A     int ret =3D =
0, i;=0A-    struct pci_dev *pdev;=0A-    u16 bdf;=0A+    u16 bdf, =
seg;=0A+    u8 bus;=0A =0A     if ( list_empty(&acpi_drhd_units) )=0A      =
   return -ENODEV;=0A =0A-    ASSERT(spin_is_locked(&pcidevs_lock));=0A-   =
 pdev =3D pci_get_pdev(seg, bus, devfn);=0A-    if (!pdev)=0A-        =
return -ENODEV;=0A-=0A-    if (pdev->domain !=3D dom0)=0A-    {=0A-        =
dprintk(XENLOG_ERR VTDPREFIX,=0A-                "IOMMU: assign a assigned =
device\n");=0A-       return -EBUSY;=0A-    }=0A-=0A-    ret =3D reassign_d=
evice_ownership(dom0, d, seg, bus, devfn);=0A+    ret =3D reassign_device_o=
wnership(dom0, d, devfn, pdev);=0A     if ( ret )=0A         goto done;=0A =
=0A     /* FIXME: Because USB RMRR conflicts with guest bios region,=0A    =
  * ignore USB RMRR temporarily.=0A      */=0A-    if ( is_usb_device(seg, =
bus, devfn) )=0A+    seg =3D pdev->seg;=0A+    bus =3D pdev->bus;=0A+    =
if ( is_usb_device(seg, bus, pdev->devfn) )=0A     {=0A         ret =3D =
0;=0A         goto done;=0A--- a/xen/include/xen/iommu.h=0A+++ b/xen/includ=
e/xen/iommu.h=0A@@ -97,13 +97,13 @@ struct iommu_ops {=0A     int =
(*add_device)(struct pci_dev *pdev);=0A     int (*enable_device)(struct =
pci_dev *pdev);=0A     int (*remove_device)(struct pci_dev *pdev);=0A-    =
int (*assign_device)(struct domain *d, u16 seg, u8 bus, u8 devfn);=0A+    =
int (*assign_device)(struct domain *, u8 devfn, struct pci_dev *);=0A     =
void (*teardown)(struct domain *d);=0A     int (*map_page)(struct domain =
*d, unsigned long gfn, unsigned long mfn,=0A                     unsigned =
int flags);=0A     int (*unmap_page)(struct domain *d, unsigned long =
gfn);=0A     int (*reassign_device)(struct domain *s, struct domain =
*t,=0A-			   u16 seg, u8 bus, u8 devfn);=0A+			=
   u8 devfn, struct pci_dev *);=0A     int (*get_device_group_id)(u16 seg, =
u8 bus, u8 devfn);=0A     void (*update_ire_from_apic)(unsigned int apic, =
unsigned int reg, unsigned int value);=0A     void (*update_ire_from_msi)(s=
truct msi_desc *msi_desc, struct msi_msg *msg);=0A
--=__Part9EAF76CE.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.xen.org
http://lists.xen.org/xen-devel

--=__Part9EAF76CE.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 09:48:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 09:48:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdeEo-0008Co-PY; Wed, 28 Nov 2012 09:47:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdeEm-0008Ci-S2
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 09:47:25 +0000
Received: from [85.158.139.211:52307] by server-11.bemta-5.messagelabs.com id
	CC/76-03409-CADD5B05; Wed, 28 Nov 2012 09:47:24 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1354096041!18121632!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5392 invoked from network); 28 Nov 2012 09:47:22 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 09:47:22 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 09:47:20 +0000
Message-Id: <50B5EBEE02000078000AC104@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 09:48:14 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
In-Reply-To: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part9EAF76CE.0__="
Subject: [Xen-devel] [PATCH,
	RFC 1/7] IOMMU: adjust (re)assign operation parameters
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part9EAF76CE.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

... to use a (struct pci_dev *, devfn) pair.

--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -332,34 +332,31 @@ void amd_iommu_disable_domain_device(str
         disable_ats_device(iommu->seg, bus, devfn);
 }
=20
-static int reassign_device( struct domain *source, struct domain *target,
-                            u16 seg, u8 bus, u8 devfn)
+static int reassign_device(struct domain *source, struct domain *target,
+                           u8 devfn, struct pci_dev *pdev)
 {
-    struct pci_dev *pdev;
     struct amd_iommu *iommu;
     int bdf;
     struct hvm_iommu *t =3D domain_hvm_iommu(target);
=20
-    ASSERT(spin_is_locked(&pcidevs_lock));
-    pdev =3D pci_get_pdev_by_domain(source, seg, bus, devfn);
-    if ( !pdev )
-        return -ENODEV;
-
-    bdf =3D PCI_BDF2(bus, devfn);
-    iommu =3D find_iommu_for_device(seg, bdf);
+    bdf =3D PCI_BDF2(pdev->bus, pdev->devfn);
+    iommu =3D find_iommu_for_device(pdev->seg, bdf);
     if ( !iommu )
     {
         AMD_IOMMU_DEBUG("Fail to find iommu."
                         " %04x:%02x:%x02.%x cannot be assigned to =
dom%d\n",
-                        seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
+                        pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(de=
vfn),
                         target->domain_id);
         return -ENODEV;
     }
=20
     amd_iommu_disable_domain_device(source, iommu, bdf);
=20
-    list_move(&pdev->domain_list, &target->arch.pdev_list);
-    pdev->domain =3D target;
+    if ( devfn =3D=3D pdev->devfn )
+    {
+        list_move(&pdev->domain_list, &target->arch.pdev_list);
+        pdev->domain =3D target;
+    }
=20
     /* IO page tables might be destroyed after pci-detach the last device
      * In this case, we have to re-allocate root table for next pci-attach=
.*/
@@ -368,17 +365,18 @@ static int reassign_device( struct domai
=20
     amd_iommu_setup_domain_device(target, iommu, bdf);
     AMD_IOMMU_DEBUG("Re-assign %04x:%02x:%02x.%u from dom%d to dom%d\n",
-                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
+                    pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(devfn)=
,
                     source->domain_id, target->domain_id);
=20
     return 0;
 }
=20
-static int amd_iommu_assign_device(struct domain *d, u16 seg, u8 bus, u8 =
devfn)
+static int amd_iommu_assign_device(struct domain *d, u8 devfn,
+                                   struct pci_dev *pdev)
 {
-    struct ivrs_mappings *ivrs_mappings =3D get_ivrs_mappings(seg);
-    int bdf =3D PCI_BDF2(bus, devfn);
-    int req_id =3D get_dma_requestor_id(seg, bdf);
+    struct ivrs_mappings *ivrs_mappings =3D get_ivrs_mappings(pdev->seg);
+    int bdf =3D PCI_BDF2(pdev->bus, devfn);
+    int req_id =3D get_dma_requestor_id(pdev->seg, bdf);
=20
     if ( ivrs_mappings[req_id].unity_map_enable )
     {
@@ -390,7 +388,7 @@ static int amd_iommu_assign_device(struc
             ivrs_mappings[req_id].read_permission);
     }
=20
-    return reassign_device(dom0, d, seg, bus, devfn);
+    return reassign_device(dom0, d, devfn, pdev);
 }
=20
 static void deallocate_next_page_table(struct page_info* pg, int level)
@@ -451,12 +449,6 @@ static void amd_iommu_domain_destroy(str
     amd_iommu_flush_all_pages(d);
 }
=20
-static int amd_iommu_return_device(
-    struct domain *s, struct domain *t, u16 seg, u8 bus, u8 devfn)
-{
-    return reassign_device(s, t, seg, bus, devfn);
-}
-
 static int amd_iommu_add_device(struct pci_dev *pdev)
 {
     struct amd_iommu *iommu;
@@ -593,7 +585,7 @@ const struct iommu_ops amd_iommu_ops =3D {
     .teardown =3D amd_iommu_domain_destroy,
     .map_page =3D amd_iommu_map_page,
     .unmap_page =3D amd_iommu_unmap_page,
-    .reassign_device =3D amd_iommu_return_device,
+    .reassign_device =3D reassign_device,
     .get_device_group_id =3D amd_iommu_group_id,
     .update_ire_from_apic =3D amd_iommu_ioapic_update_ire,
     .update_ire_from_msi =3D amd_iommu_msi_msg_update_ire,
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -229,11 +229,16 @@ static int assign_device(struct domain *
         return -EXDEV;
=20
     spin_lock(&pcidevs_lock);
-    pdev =3D pci_get_pdev(seg, bus, devfn);
-    if ( pdev )
-        pdev->fault.count =3D 0;
+    pdev =3D pci_get_pdev_by_domain(dom0, seg, bus, devfn);
+    if ( !pdev )
+    {
+        rc =3D pci_get_pdev(seg, bus, devfn) ? -EBUSY : -ENODEV;
+        goto done;
+    }
+
+    pdev->fault.count =3D 0;
=20
-    if ( (rc =3D hd->platform_ops->assign_device(d, seg, bus, devfn)) )
+    if ( (rc =3D hd->platform_ops->assign_device(d, devfn, pdev)) )
         goto done;
=20
     if ( has_arch_pdevs(d) && !need_iommu(d) )
@@ -364,18 +369,11 @@ int deassign_device(struct domain *d, u1
         return -EINVAL;
=20
     ASSERT(spin_is_locked(&pcidevs_lock));
-    pdev =3D pci_get_pdev(seg, bus, devfn);
+    pdev =3D pci_get_pdev_by_domain(d, seg, bus, devfn);
     if ( !pdev )
         return -ENODEV;
=20
-    if ( pdev->domain !=3D d )
-    {
-        dprintk(XENLOG_G_ERR,
-                "d%d: deassign a device not owned\n", d->domain_id);
-        return -EINVAL;
-    }
-
-    ret =3D hd->platform_ops->reassign_device(d, dom0, seg, bus, devfn);
+    ret =3D hd->platform_ops->reassign_device(d, dom0, devfn, pdev);
     if ( ret )
     {
         dprintk(XENLOG_G_ERR,
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1658,17 +1658,10 @@ out:
 static int reassign_device_ownership(
     struct domain *source,
     struct domain *target,
-    u16 seg, u8 bus, u8 devfn)
+    u8 devfn, struct pci_dev *pdev)
 {
-    struct pci_dev *pdev;
     int ret;
=20
-    ASSERT(spin_is_locked(&pcidevs_lock));
-    pdev =3D pci_get_pdev_by_domain(source, seg, bus, devfn);
-
-    if (!pdev)
-        return -ENODEV;
-
     /*
      * Devices assigned to untrusted domains (here assumed to be any =
domU)
      * can attempt to send arbitrary LAPIC/MSI messages. We are unprotecte=
d
@@ -1677,16 +1670,19 @@ static int reassign_device_ownership(
     if ( (target !=3D dom0) && !iommu_intremap )
         untrusted_msi =3D 1;
=20
-    ret =3D domain_context_unmap(source, seg, bus, devfn);
+    ret =3D domain_context_unmap(source, pdev->seg, pdev->bus, devfn);
     if ( ret )
         return ret;
=20
-    ret =3D domain_context_mapping(target, seg, bus, devfn);
+    ret =3D domain_context_mapping(target, pdev->seg, pdev->bus, devfn);
     if ( ret )
         return ret;
=20
-    list_move(&pdev->domain_list, &target->arch.pdev_list);
-    pdev->domain =3D target;
+    if ( devfn =3D=3D pdev->devfn )
+    {
+        list_move(&pdev->domain_list, &target->arch.pdev_list);
+        pdev->domain =3D target;
+    }
=20
     return ret;
 }
@@ -2202,36 +2198,26 @@ int __init intel_vtd_setup(void)
 }
=20
 static int intel_iommu_assign_device(
-    struct domain *d, u16 seg, u8 bus, u8 devfn)
+    struct domain *d, u8 devfn, struct pci_dev *pdev)
 {
     struct acpi_rmrr_unit *rmrr;
     int ret =3D 0, i;
-    struct pci_dev *pdev;
-    u16 bdf;
+    u16 bdf, seg;
+    u8 bus;
=20
     if ( list_empty(&acpi_drhd_units) )
         return -ENODEV;
=20
-    ASSERT(spin_is_locked(&pcidevs_lock));
-    pdev =3D pci_get_pdev(seg, bus, devfn);
-    if (!pdev)
-        return -ENODEV;
-
-    if (pdev->domain !=3D dom0)
-    {
-        dprintk(XENLOG_ERR VTDPREFIX,
-                "IOMMU: assign a assigned device\n");
-       return -EBUSY;
-    }
-
-    ret =3D reassign_device_ownership(dom0, d, seg, bus, devfn);
+    ret =3D reassign_device_ownership(dom0, d, devfn, pdev);
     if ( ret )
         goto done;
=20
     /* FIXME: Because USB RMRR conflicts with guest bios region,
      * ignore USB RMRR temporarily.
      */
-    if ( is_usb_device(seg, bus, devfn) )
+    seg =3D pdev->seg;
+    bus =3D pdev->bus;
+    if ( is_usb_device(seg, bus, pdev->devfn) )
     {
         ret =3D 0;
         goto done;
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -97,13 +97,13 @@ struct iommu_ops {
     int (*add_device)(struct pci_dev *pdev);
     int (*enable_device)(struct pci_dev *pdev);
     int (*remove_device)(struct pci_dev *pdev);
-    int (*assign_device)(struct domain *d, u16 seg, u8 bus, u8 devfn);
+    int (*assign_device)(struct domain *, u8 devfn, struct pci_dev *);
     void (*teardown)(struct domain *d);
     int (*map_page)(struct domain *d, unsigned long gfn, unsigned long =
mfn,
                     unsigned int flags);
     int (*unmap_page)(struct domain *d, unsigned long gfn);
     int (*reassign_device)(struct domain *s, struct domain *t,
-			   u16 seg, u8 bus, u8 devfn);
+			   u8 devfn, struct pci_dev *);
     int (*get_device_group_id)(u16 seg, u8 bus, u8 devfn);
     void (*update_ire_from_apic)(unsigned int apic, unsigned int reg, =
unsigned int value);
     void (*update_ire_from_msi)(struct msi_desc *msi_desc, struct msi_msg =
*msg);


--=__Part9EAF76CE.0__=
Content-Type: text/plain; name="IOMMU-assign-params.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="IOMMU-assign-params.patch"

IOMMU: adjust (re)assign operation parameters=0A=0A... to use a (struct =
pci_dev *, devfn) pair.=0A=0A--- a/xen/drivers/passthrough/amd/pci_amd_iomm=
u.c=0A+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c=0A@@ -332,34 =
+332,31 @@ void amd_iommu_disable_domain_device(str=0A         disable_ats_=
device(iommu->seg, bus, devfn);=0A }=0A =0A-static int reassign_device( =
struct domain *source, struct domain *target,=0A-                          =
  u16 seg, u8 bus, u8 devfn)=0A+static int reassign_device(struct domain =
*source, struct domain *target,=0A+                           u8 devfn, =
struct pci_dev *pdev)=0A {=0A-    struct pci_dev *pdev;=0A     struct =
amd_iommu *iommu;=0A     int bdf;=0A     struct hvm_iommu *t =3D domain_hvm=
_iommu(target);=0A =0A-    ASSERT(spin_is_locked(&pcidevs_lock));=0A-    =
pdev =3D pci_get_pdev_by_domain(source, seg, bus, devfn);=0A-    if ( =
!pdev )=0A-        return -ENODEV;=0A-=0A-    bdf =3D PCI_BDF2(bus, =
devfn);=0A-    iommu =3D find_iommu_for_device(seg, bdf);=0A+    bdf =3D =
PCI_BDF2(pdev->bus, pdev->devfn);=0A+    iommu =3D find_iommu_for_device(pd=
ev->seg, bdf);=0A     if ( !iommu )=0A     {=0A         AMD_IOMMU_DEBUG("Fa=
il to find iommu."=0A                         " %04x:%02x:%x02.%x cannot =
be assigned to dom%d\n",=0A-                        seg, bus, PCI_SLOT(devf=
n), PCI_FUNC(devfn),=0A+                        pdev->seg, pdev->bus, =
PCI_SLOT(devfn), PCI_FUNC(devfn),=0A                         target->domain=
_id);=0A         return -ENODEV;=0A     }=0A =0A     amd_iommu_disable_doma=
in_device(source, iommu, bdf);=0A =0A-    list_move(&pdev->domain_list, =
&target->arch.pdev_list);=0A-    pdev->domain =3D target;=0A+    if ( =
devfn =3D=3D pdev->devfn )=0A+    {=0A+        list_move(&pdev->domain_list=
, &target->arch.pdev_list);=0A+        pdev->domain =3D target;=0A+    =
}=0A =0A     /* IO page tables might be destroyed after pci-detach the =
last device=0A      * In this case, we have to re-allocate root table for =
next pci-attach.*/=0A@@ -368,17 +365,18 @@ static int reassign_device( =
struct domai=0A =0A     amd_iommu_setup_domain_device(target, iommu, =
bdf);=0A     AMD_IOMMU_DEBUG("Re-assign %04x:%02x:%02x.%u from dom%d to =
dom%d\n",=0A-                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn)=
,=0A+                    pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(de=
vfn),=0A                     source->domain_id, target->domain_id);=0A =0A =
    return 0;=0A }=0A =0A-static int amd_iommu_assign_device(struct domain =
*d, u16 seg, u8 bus, u8 devfn)=0A+static int amd_iommu_assign_device(struct=
 domain *d, u8 devfn,=0A+                                   struct pci_dev =
*pdev)=0A {=0A-    struct ivrs_mappings *ivrs_mappings =3D get_ivrs_mapping=
s(seg);=0A-    int bdf =3D PCI_BDF2(bus, devfn);=0A-    int req_id =3D =
get_dma_requestor_id(seg, bdf);=0A+    struct ivrs_mappings *ivrs_mappings =
=3D get_ivrs_mappings(pdev->seg);=0A+    int bdf =3D PCI_BDF2(pdev->bus, =
devfn);=0A+    int req_id =3D get_dma_requestor_id(pdev->seg, bdf);=0A =0A =
    if ( ivrs_mappings[req_id].unity_map_enable )=0A     {=0A@@ -390,7 =
+388,7 @@ static int amd_iommu_assign_device(struc=0A             =
ivrs_mappings[req_id].read_permission);=0A     }=0A =0A-    return =
reassign_device(dom0, d, seg, bus, devfn);=0A+    return reassign_device(do=
m0, d, devfn, pdev);=0A }=0A =0A static void deallocate_next_page_table(str=
uct page_info* pg, int level)=0A@@ -451,12 +449,6 @@ static void amd_iommu_=
domain_destroy(str=0A     amd_iommu_flush_all_pages(d);=0A }=0A =0A-static =
int amd_iommu_return_device(=0A-    struct domain *s, struct domain *t, =
u16 seg, u8 bus, u8 devfn)=0A-{=0A-    return reassign_device(s, t, seg, =
bus, devfn);=0A-}=0A-=0A static int amd_iommu_add_device(struct pci_dev =
*pdev)=0A {=0A     struct amd_iommu *iommu;=0A@@ -593,7 +585,7 @@ const =
struct iommu_ops amd_iommu_ops =3D {=0A     .teardown =3D amd_iommu_domain_=
destroy,=0A     .map_page =3D amd_iommu_map_page,=0A     .unmap_page =3D =
amd_iommu_unmap_page,=0A-    .reassign_device =3D amd_iommu_return_device,=
=0A+    .reassign_device =3D reassign_device,=0A     .get_device_group_id =
=3D amd_iommu_group_id,=0A     .update_ire_from_apic =3D amd_iommu_ioapic_u=
pdate_ire,=0A     .update_ire_from_msi =3D amd_iommu_msi_msg_update_ire,=0A=
--- a/xen/drivers/passthrough/iommu.c=0A+++ b/xen/drivers/passthrough/iommu=
.c=0A@@ -229,11 +229,16 @@ static int assign_device(struct domain *=0A     =
    return -EXDEV;=0A =0A     spin_lock(&pcidevs_lock);=0A-    pdev =3D =
pci_get_pdev(seg, bus, devfn);=0A-    if ( pdev )=0A-        pdev->fault.co=
unt =3D 0;=0A+    pdev =3D pci_get_pdev_by_domain(dom0, seg, bus, =
devfn);=0A+    if ( !pdev )=0A+    {=0A+        rc =3D pci_get_pdev(seg, =
bus, devfn) ? -EBUSY : -ENODEV;=0A+        goto done;=0A+    }=0A+=0A+    =
pdev->fault.count =3D 0;=0A =0A-    if ( (rc =3D hd->platform_ops->assign_d=
evice(d, seg, bus, devfn)) )=0A+    if ( (rc =3D hd->platform_ops->assign_d=
evice(d, devfn, pdev)) )=0A         goto done;=0A =0A     if ( has_arch_pde=
vs(d) && !need_iommu(d) )=0A@@ -364,18 +369,11 @@ int deassign_device(struc=
t domain *d, u1=0A         return -EINVAL;=0A =0A     ASSERT(spin_is_locked=
(&pcidevs_lock));=0A-    pdev =3D pci_get_pdev(seg, bus, devfn);=0A+    =
pdev =3D pci_get_pdev_by_domain(d, seg, bus, devfn);=0A     if ( !pdev =
)=0A         return -ENODEV;=0A =0A-    if ( pdev->domain !=3D d )=0A-    =
{=0A-        dprintk(XENLOG_G_ERR,=0A-                "d%d: deassign a =
device not owned\n", d->domain_id);=0A-        return -EINVAL;=0A-    =
}=0A-=0A-    ret =3D hd->platform_ops->reassign_device(d, dom0, seg, bus, =
devfn);=0A+    ret =3D hd->platform_ops->reassign_device(d, dom0, devfn, =
pdev);=0A     if ( ret )=0A     {=0A         dprintk(XENLOG_G_ERR,=0A--- =
a/xen/drivers/passthrough/vtd/iommu.c=0A+++ b/xen/drivers/passthrough/vtd/i=
ommu.c=0A@@ -1658,17 +1658,10 @@ out:=0A static int reassign_device_ownersh=
ip(=0A     struct domain *source,=0A     struct domain *target,=0A-    u16 =
seg, u8 bus, u8 devfn)=0A+    u8 devfn, struct pci_dev *pdev)=0A {=0A-    =
struct pci_dev *pdev;=0A     int ret;=0A =0A-    ASSERT(spin_is_locked(&pci=
devs_lock));=0A-    pdev =3D pci_get_pdev_by_domain(source, seg, bus, =
devfn);=0A-=0A-    if (!pdev)=0A-        return -ENODEV;=0A-=0A     /*=0A  =
    * Devices assigned to untrusted domains (here assumed to be any =
domU)=0A      * can attempt to send arbitrary LAPIC/MSI messages. We are =
unprotected=0A@@ -1677,16 +1670,19 @@ static int reassign_device_ownership(=
=0A     if ( (target !=3D dom0) && !iommu_intremap )=0A         untrusted_m=
si =3D 1;=0A =0A-    ret =3D domain_context_unmap(source, seg, bus, =
devfn);=0A+    ret =3D domain_context_unmap(source, pdev->seg, pdev->bus, =
devfn);=0A     if ( ret )=0A         return ret;=0A =0A-    ret =3D =
domain_context_mapping(target, seg, bus, devfn);=0A+    ret =3D domain_cont=
ext_mapping(target, pdev->seg, pdev->bus, devfn);=0A     if ( ret )=0A     =
    return ret;=0A =0A-    list_move(&pdev->domain_list, &target->arch.pdev=
_list);=0A-    pdev->domain =3D target;=0A+    if ( devfn =3D=3D pdev->devf=
n )=0A+    {=0A+        list_move(&pdev->domain_list, &target->arch.pdev_li=
st);=0A+        pdev->domain =3D target;=0A+    }=0A =0A     return =
ret;=0A }=0A@@ -2202,36 +2198,26 @@ int __init intel_vtd_setup(void)=0A =
}=0A =0A static int intel_iommu_assign_device(=0A-    struct domain *d, =
u16 seg, u8 bus, u8 devfn)=0A+    struct domain *d, u8 devfn, struct =
pci_dev *pdev)=0A {=0A     struct acpi_rmrr_unit *rmrr;=0A     int ret =3D =
0, i;=0A-    struct pci_dev *pdev;=0A-    u16 bdf;=0A+    u16 bdf, =
seg;=0A+    u8 bus;=0A =0A     if ( list_empty(&acpi_drhd_units) )=0A      =
   return -ENODEV;=0A =0A-    ASSERT(spin_is_locked(&pcidevs_lock));=0A-   =
 pdev =3D pci_get_pdev(seg, bus, devfn);=0A-    if (!pdev)=0A-        =
return -ENODEV;=0A-=0A-    if (pdev->domain !=3D dom0)=0A-    {=0A-        =
dprintk(XENLOG_ERR VTDPREFIX,=0A-                "IOMMU: assign a assigned =
device\n");=0A-       return -EBUSY;=0A-    }=0A-=0A-    ret =3D reassign_d=
evice_ownership(dom0, d, seg, bus, devfn);=0A+    ret =3D reassign_device_o=
wnership(dom0, d, devfn, pdev);=0A     if ( ret )=0A         goto done;=0A =
=0A     /* FIXME: Because USB RMRR conflicts with guest bios region,=0A    =
  * ignore USB RMRR temporarily.=0A      */=0A-    if ( is_usb_device(seg, =
bus, devfn) )=0A+    seg =3D pdev->seg;=0A+    bus =3D pdev->bus;=0A+    =
if ( is_usb_device(seg, bus, pdev->devfn) )=0A     {=0A         ret =3D =
0;=0A         goto done;=0A--- a/xen/include/xen/iommu.h=0A+++ b/xen/includ=
e/xen/iommu.h=0A@@ -97,13 +97,13 @@ struct iommu_ops {=0A     int =
(*add_device)(struct pci_dev *pdev);=0A     int (*enable_device)(struct =
pci_dev *pdev);=0A     int (*remove_device)(struct pci_dev *pdev);=0A-    =
int (*assign_device)(struct domain *d, u16 seg, u8 bus, u8 devfn);=0A+    =
int (*assign_device)(struct domain *, u8 devfn, struct pci_dev *);=0A     =
void (*teardown)(struct domain *d);=0A     int (*map_page)(struct domain =
*d, unsigned long gfn, unsigned long mfn,=0A                     unsigned =
int flags);=0A     int (*unmap_page)(struct domain *d, unsigned long =
gfn);=0A     int (*reassign_device)(struct domain *s, struct domain =
*t,=0A-			   u16 seg, u8 bus, u8 devfn);=0A+			=
   u8 devfn, struct pci_dev *);=0A     int (*get_device_group_id)(u16 seg, =
u8 bus, u8 devfn);=0A     void (*update_ire_from_apic)(unsigned int apic, =
unsigned int reg, unsigned int value);=0A     void (*update_ire_from_msi)(s=
truct msi_desc *msi_desc, struct msi_msg *msg);=0A
--=__Part9EAF76CE.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.xen.org
http://lists.xen.org/xen-devel

--=__Part9EAF76CE.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 09:48:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 09:48:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdeFQ-0008Ew-7W; Wed, 28 Nov 2012 09:48:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdeFN-0008Eh-LM
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 09:48:02 +0000
Received: from [85.158.139.211:40894] by server-13.bemta-5.messagelabs.com id
	76/1D-27809-0DDD5B05; Wed, 28 Nov 2012 09:48:00 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1354096079!16667220!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9623 invoked from network); 28 Nov 2012 09:47:59 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 09:47:59 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 09:47:59 +0000
Message-Id: <50B5EC1502000078000AC108@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 09:48:53 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
In-Reply-To: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part4677AE15.0__="
Subject: [Xen-devel] [PATCH,
 RFC 2/7] IOMMU: IOMMU: adjust add/remove operation parameters
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part4677AE15.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

... to use a (struct pci_dev *, devfn) pair.

--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -83,14 +83,14 @@ static void disable_translation(u32 *dte
 }
=20
 static void amd_iommu_setup_domain_device(
-    struct domain *domain, struct amd_iommu *iommu, int bdf)
+    struct domain *domain, struct amd_iommu *iommu,
+    u8 devfn, struct pci_dev *pdev)
 {
     void *dte;
     unsigned long flags;
     int req_id, valid =3D 1;
     int dte_i =3D 0;
-    u8 bus =3D PCI_BUS(bdf);
-    u8 devfn =3D PCI_DEVFN2(bdf);
+    u8 bus =3D pdev->bus;
=20
     struct hvm_iommu *hd =3D domain_hvm_iommu(domain);
=20
@@ -103,7 +103,7 @@ static void amd_iommu_setup_domain_devic
         dte_i =3D 1;
=20
     /* get device-table entry */
-    req_id =3D get_dma_requestor_id(iommu->seg, bdf);
+    req_id =3D get_dma_requestor_id(iommu->seg, PCI_BDF2(bus, devfn));
     dte =3D iommu->dev_table.buffer + (req_id * IOMMU_DEV_TABLE_ENTRY_SIZE=
);
=20
     spin_lock_irqsave(&iommu->lock, flags);
@@ -115,7 +115,7 @@ static void amd_iommu_setup_domain_devic
             (u32 *)dte, page_to_maddr(hd->root_table), hd->domain_id,
             hd->paging_mode, valid);
=20
-        if ( pci_ats_device(iommu->seg, bus, devfn) &&
+        if ( pci_ats_device(iommu->seg, bus, pdev->devfn) &&
              iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) )
             iommu_dte_set_iotlb((u32 *)dte, dte_i);
=20
@@ -132,32 +132,31 @@ static void amd_iommu_setup_domain_devic
=20
     ASSERT(spin_is_locked(&pcidevs_lock));
=20
-    if ( pci_ats_device(iommu->seg, bus, devfn) &&
-         !pci_ats_enabled(iommu->seg, bus, devfn) )
+    if ( pci_ats_device(iommu->seg, bus, pdev->devfn) &&
+         !pci_ats_enabled(iommu->seg, bus, pdev->devfn) )
     {
-        struct pci_dev *pdev;
+        if ( devfn =3D=3D pdev->devfn )
+            enable_ats_device(iommu->seg, bus, devfn);
=20
-        enable_ats_device(iommu->seg, bus, devfn);
-
-        ASSERT(spin_is_locked(&pcidevs_lock));
-        pdev =3D pci_get_pdev(iommu->seg, bus, devfn);
-
-        ASSERT( pdev !=3D NULL );
         amd_iommu_flush_iotlb(pdev, INV_IOMMU_ALL_PAGES_ADDRESS, 0);
     }
 }
=20
-static void __init amd_iommu_setup_dom0_device(struct pci_dev *pdev)
+static int __init amd_iommu_setup_dom0_device(u8 devfn, struct pci_dev =
*pdev)
 {
     int bdf =3D PCI_BDF2(pdev->bus, pdev->devfn);
     struct amd_iommu *iommu =3D find_iommu_for_device(pdev->seg, bdf);
=20
-    if ( likely(iommu !=3D NULL) )
-        amd_iommu_setup_domain_device(pdev->domain, iommu, bdf);
-    else
+    if ( unlikely(!iommu) )
+    {
         AMD_IOMMU_DEBUG("No iommu for device %04x:%02x:%02x.%u\n",
                         pdev->seg, pdev->bus,
-                        PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
+                        PCI_SLOT(devfn), PCI_FUNC(devfn));
+        return -ENODEV;
+    }
+
+    amd_iommu_setup_domain_device(pdev->domain, iommu, devfn, pdev);
+    return 0;
 }
=20
 int __init amd_iov_detect(void)
@@ -295,16 +294,16 @@ static void __init amd_iommu_dom0_init(s
 }
=20
 void amd_iommu_disable_domain_device(struct domain *domain,
-                                     struct amd_iommu *iommu, int bdf)
+                                     struct amd_iommu *iommu,
+                                     u8 devfn, struct pci_dev *pdev)
 {
     void *dte;
     unsigned long flags;
     int req_id;
-    u8 bus =3D PCI_BUS(bdf);
-    u8 devfn =3D PCI_DEVFN2(bdf);
+    u8 bus =3D pdev->bus;
=20
     BUG_ON ( iommu->dev_table.buffer =3D=3D NULL );
-    req_id =3D get_dma_requestor_id(iommu->seg, bdf);
+    req_id =3D get_dma_requestor_id(iommu->seg, PCI_BDF2(bus, devfn));
     dte =3D iommu->dev_table.buffer + (req_id * IOMMU_DEV_TABLE_ENTRY_SIZE=
);
=20
     spin_lock_irqsave(&iommu->lock, flags);
@@ -312,7 +311,7 @@ void amd_iommu_disable_domain_device(str
     {
         disable_translation((u32 *)dte);
=20
-        if ( pci_ats_device(iommu->seg, bus, devfn) &&
+        if ( pci_ats_device(iommu->seg, bus, pdev->devfn) &&
              iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) )
             iommu_dte_set_iotlb((u32 *)dte, 0);
=20
@@ -327,7 +326,8 @@ void amd_iommu_disable_domain_device(str
=20
     ASSERT(spin_is_locked(&pcidevs_lock));
=20
-    if ( pci_ats_device(iommu->seg, bus, devfn) &&
+    if ( devfn =3D=3D pdev->devfn &&
+         pci_ats_device(iommu->seg, bus, devfn) &&
          pci_ats_enabled(iommu->seg, bus, devfn) )
         disable_ats_device(iommu->seg, bus, devfn);
 }
@@ -350,7 +350,7 @@ static int reassign_device(struct domain
         return -ENODEV;
     }
=20
-    amd_iommu_disable_domain_device(source, iommu, bdf);
+    amd_iommu_disable_domain_device(source, iommu, devfn, pdev);
=20
     if ( devfn =3D=3D pdev->devfn )
     {
@@ -363,7 +363,7 @@ static int reassign_device(struct domain
     if ( t->root_table =3D=3D NULL )
         allocate_domain_resources(t);
=20
-    amd_iommu_setup_domain_device(target, iommu, bdf);
+    amd_iommu_setup_domain_device(target, iommu, devfn, pdev);
     AMD_IOMMU_DEBUG("Re-assign %04x:%02x:%02x.%u from dom%d to dom%d\n",
                     pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(devfn)=
,
                     source->domain_id, target->domain_id);
@@ -449,7 +449,7 @@ static void amd_iommu_domain_destroy(str
     amd_iommu_flush_all_pages(d);
 }
=20
-static int amd_iommu_add_device(struct pci_dev *pdev)
+static int amd_iommu_add_device(u8 devfn, struct pci_dev *pdev)
 {
     struct amd_iommu *iommu;
     u16 bdf;
@@ -462,16 +462,16 @@ static int amd_iommu_add_device(struct p
     {
         AMD_IOMMU_DEBUG("Fail to find iommu."
                         " %04x:%02x:%02x.%u cannot be assigned to =
dom%d\n",
-                        pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
-                        PCI_FUNC(pdev->devfn), pdev->domain->domain_id);
+                        pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(de=
vfn),
+                        pdev->domain->domain_id);
         return -ENODEV;
     }
=20
-    amd_iommu_setup_domain_device(pdev->domain, iommu, bdf);
+    amd_iommu_setup_domain_device(pdev->domain, iommu, devfn, pdev);
     return 0;
 }
=20
-static int amd_iommu_remove_device(struct pci_dev *pdev)
+static int amd_iommu_remove_device(u8 devfn, struct pci_dev *pdev)
 {
     struct amd_iommu *iommu;
     u16 bdf;
@@ -484,12 +484,12 @@ static int amd_iommu_remove_device(struc
     {
         AMD_IOMMU_DEBUG("Fail to find iommu."
                         " %04x:%02x:%02x.%u cannot be removed from =
dom%d\n",
-                        pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
-                        PCI_FUNC(pdev->devfn), pdev->domain->domain_id);
+                        pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(de=
vfn),
+                        pdev->domain->domain_id);
         return -ENODEV;
     }
=20
-    amd_iommu_disable_domain_device(pdev->domain, iommu, bdf);
+    amd_iommu_disable_domain_device(pdev->domain, iommu, devfn, pdev);
     return 0;
 }
=20
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -164,7 +164,7 @@ int iommu_add_device(struct pci_dev *pde
     if ( !iommu_enabled || !hd->platform_ops )
         return 0;
=20
-    return hd->platform_ops->add_device(pdev);
+    return hd->platform_ops->add_device(pdev->devfn, pdev);
 }
=20
 int iommu_enable_device(struct pci_dev *pdev)
@@ -194,7 +194,7 @@ int iommu_remove_device(struct pci_dev *
     if ( !iommu_enabled || !hd->platform_ops )
         return 0;
=20
-    return hd->platform_ops->remove_device(pdev);
+    return hd->platform_ops->remove_device(pdev->devfn, pdev);
 }
=20
 /*
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -743,7 +743,7 @@ int __init scan_pci_devices(void)
=20
 struct setup_dom0 {
     struct domain *d;
-    void (*handler)(struct pci_dev *);
+    int (*handler)(u8 devfn, struct pci_dev *);
 };
=20
 static int __init _setup_dom0_pci_devices(struct pci_seg *pseg, void =
*arg)
@@ -764,12 +764,12 @@ static int __init _setup_dom0_pci_device
             {
                 pdev->domain =3D ctxt->d;
                 list_add(&pdev->domain_list, &ctxt->d->arch.pdev_list);
-                ctxt->handler(pdev);
+                ctxt->handler(devfn, pdev);
             }
             else if ( pdev->domain =3D=3D dom_xen )
             {
                 pdev->domain =3D ctxt->d;
-                ctxt->handler(pdev);
+                ctxt->handler(devfn, pdev);
                 pdev->domain =3D dom_xen;
             }
             else if ( pdev->domain !=3D ctxt->d )
@@ -783,7 +783,7 @@ static int __init _setup_dom0_pci_device
 }
=20
 void __init setup_dom0_pci_devices(
-    struct domain *d, void (*handler)(struct pci_dev *))
+    struct domain *d, int (*handler)(u8 devfn, struct pci_dev *))
 {
     struct setup_dom0 ctxt =3D { .d =3D d, .handler =3D handler };
=20
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -50,7 +50,7 @@ int nr_iommus;
=20
 static struct tasklet vtd_fault_tasklet;
=20
-static void setup_dom0_device(struct pci_dev *);
+static int setup_dom0_device(u8 devfn, struct pci_dev *);
 static void setup_dom0_rmrr(struct domain *d);
=20
 static int domain_iommu_domid(struct domain *d,
@@ -1873,7 +1873,7 @@ static int rmrr_identity_mapping(struct=20
     return 0;
 }
=20
-static int intel_iommu_add_device(struct pci_dev *pdev)
+static int intel_iommu_add_device(u8 devfn, struct pci_dev *pdev)
 {
     struct acpi_rmrr_unit *rmrr;
     u16 bdf;
@@ -1884,8 +1884,7 @@ static int intel_iommu_add_device(struct
     if ( !pdev->domain )
         return -EINVAL;
=20
-    ret =3D domain_context_mapping(pdev->domain, pdev->seg, pdev->bus,
-                                 pdev->devfn);
+    ret =3D domain_context_mapping(pdev->domain, pdev->seg, pdev->bus, =
devfn);
     if ( ret )
     {
         dprintk(XENLOG_ERR VTDPREFIX, "d%d: context mapping failed\n",
@@ -1897,7 +1896,7 @@ static int intel_iommu_add_device(struct
     {
         if ( rmrr->segment =3D=3D pdev->seg &&
              PCI_BUS(bdf) =3D=3D pdev->bus &&
-             PCI_DEVFN2(bdf) =3D=3D pdev->devfn )
+             PCI_DEVFN2(bdf) =3D=3D devfn )
         {
             ret =3D rmrr_identity_mapping(pdev->domain, rmrr);
             if ( ret )
@@ -1922,7 +1921,7 @@ static int intel_iommu_enable_device(str
     return ret >=3D 0 ? 0 : ret;
 }
=20
-static int intel_iommu_remove_device(struct pci_dev *pdev)
+static int intel_iommu_remove_device(u8 devfn, struct pci_dev *pdev)
 {
     struct acpi_rmrr_unit *rmrr;
     u16 bdf;
@@ -1940,19 +1939,22 @@ static int intel_iommu_remove_device(str
         {
             if ( rmrr->segment =3D=3D pdev->seg &&
                  PCI_BUS(bdf) =3D=3D pdev->bus &&
-                 PCI_DEVFN2(bdf) =3D=3D pdev->devfn )
+                 PCI_DEVFN2(bdf) =3D=3D devfn )
                 return 0;
         }
     }
=20
-    return domain_context_unmap(pdev->domain, pdev->seg, pdev->bus,
-                                pdev->devfn);
+    return domain_context_unmap(pdev->domain, pdev->seg, pdev->bus, =
devfn);
 }
=20
-static void __init setup_dom0_device(struct pci_dev *pdev)
+static int __init setup_dom0_device(u8 devfn, struct pci_dev *pdev)
 {
-    domain_context_mapping(pdev->domain, pdev->seg, pdev->bus, pdev->devfn=
);
-    pci_vtd_quirk(pdev);
+    int err;
+
+    err =3D domain_context_mapping(pdev->domain, pdev->seg, pdev->bus, =
devfn);
+    if ( !err && devfn =3D=3D pdev->devfn )
+        pci_vtd_quirk(pdev);
+    return err;
 }
=20
 void clear_fault_bits(struct iommu *iommu)
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -94,9 +94,9 @@ struct msi_msg;
 struct iommu_ops {
     int (*init)(struct domain *d);
     void (*dom0_init)(struct domain *d);
-    int (*add_device)(struct pci_dev *pdev);
+    int (*add_device)(u8 devfn, struct pci_dev *);
     int (*enable_device)(struct pci_dev *pdev);
-    int (*remove_device)(struct pci_dev *pdev);
+    int (*remove_device)(u8 devfn, struct pci_dev *);
     int (*assign_device)(struct domain *, u8 devfn, struct pci_dev *);
     void (*teardown)(struct domain *d);
     int (*map_page)(struct domain *d, unsigned long gfn, unsigned long =
mfn,
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -100,7 +100,8 @@ struct pci_dev *pci_lock_pdev(int seg, i
 struct pci_dev *pci_lock_domain_pdev(
     struct domain *, int seg, int bus, int devfn);
=20
-void setup_dom0_pci_devices(struct domain *, void (*)(struct pci_dev *));
+void setup_dom0_pci_devices(struct domain *,
+                            int (*)(u8 devfn, struct pci_dev *));
 void pci_release_devices(struct domain *d);
 int pci_add_segment(u16 seg);
 const unsigned long *pci_get_ro_map(u16 seg);


--=__Part4677AE15.0__=
Content-Type: text/plain; name="IOMMU-add-remove-params.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="IOMMU-add-remove-params.patch"

IOMMU: adjust add/remove operation parameters=0A=0A... to use a (struct =
pci_dev *, devfn) pair.=0A=0A--- a/xen/drivers/passthrough/amd/pci_amd_iomm=
u.c=0A+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c=0A@@ -83,14 +83,14 =
@@ static void disable_translation(u32 *dte=0A }=0A =0A static void =
amd_iommu_setup_domain_device(=0A-    struct domain *domain, struct =
amd_iommu *iommu, int bdf)=0A+    struct domain *domain, struct amd_iommu =
*iommu,=0A+    u8 devfn, struct pci_dev *pdev)=0A {=0A     void *dte;=0A   =
  unsigned long flags;=0A     int req_id, valid =3D 1;=0A     int dte_i =
=3D 0;=0A-    u8 bus =3D PCI_BUS(bdf);=0A-    u8 devfn =3D PCI_DEVFN2(bdf);=
=0A+    u8 bus =3D pdev->bus;=0A =0A     struct hvm_iommu *hd =3D =
domain_hvm_iommu(domain);=0A =0A@@ -103,7 +103,7 @@ static void amd_iommu_s=
etup_domain_devic=0A         dte_i =3D 1;=0A =0A     /* get device-table =
entry */=0A-    req_id =3D get_dma_requestor_id(iommu->seg, bdf);=0A+    =
req_id =3D get_dma_requestor_id(iommu->seg, PCI_BDF2(bus, devfn));=0A     =
dte =3D iommu->dev_table.buffer + (req_id * IOMMU_DEV_TABLE_ENTRY_SIZE);=0A=
 =0A     spin_lock_irqsave(&iommu->lock, flags);=0A@@ -115,7 +115,7 @@ =
static void amd_iommu_setup_domain_devic=0A             (u32 *)dte, =
page_to_maddr(hd->root_table), hd->domain_id,=0A             hd->paging_mod=
e, valid);=0A =0A-        if ( pci_ats_device(iommu->seg, bus, devfn) =
&&=0A+        if ( pci_ats_device(iommu->seg, bus, pdev->devfn) &&=0A      =
        iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) )=0A             =
iommu_dte_set_iotlb((u32 *)dte, dte_i);=0A =0A@@ -132,32 +132,31 @@ static =
void amd_iommu_setup_domain_devic=0A =0A     ASSERT(spin_is_locked(&pcidevs=
_lock));=0A =0A-    if ( pci_ats_device(iommu->seg, bus, devfn) &&=0A-     =
    !pci_ats_enabled(iommu->seg, bus, devfn) )=0A+    if ( pci_ats_device(i=
ommu->seg, bus, pdev->devfn) &&=0A+         !pci_ats_enabled(iommu->seg, =
bus, pdev->devfn) )=0A     {=0A-        struct pci_dev *pdev;=0A+        =
if ( devfn =3D=3D pdev->devfn )=0A+            enable_ats_device(iommu->seg=
, bus, devfn);=0A =0A-        enable_ats_device(iommu->seg, bus, devfn);=0A=
-=0A-        ASSERT(spin_is_locked(&pcidevs_lock));=0A-        pdev =3D =
pci_get_pdev(iommu->seg, bus, devfn);=0A-=0A-        ASSERT( pdev !=3D =
NULL );=0A         amd_iommu_flush_iotlb(pdev, INV_IOMMU_ALL_PAGES_ADDRESS,=
 0);=0A     }=0A }=0A =0A-static void __init amd_iommu_setup_dom0_device(st=
ruct pci_dev *pdev)=0A+static int __init amd_iommu_setup_dom0_device(u8 =
devfn, struct pci_dev *pdev)=0A {=0A     int bdf =3D PCI_BDF2(pdev->bus, =
pdev->devfn);=0A     struct amd_iommu *iommu =3D find_iommu_for_device(pdev=
->seg, bdf);=0A =0A-    if ( likely(iommu !=3D NULL) )=0A-        =
amd_iommu_setup_domain_device(pdev->domain, iommu, bdf);=0A-    else=0A+   =
 if ( unlikely(!iommu) )=0A+    {=0A         AMD_IOMMU_DEBUG("No iommu for =
device %04x:%02x:%02x.%u\n",=0A                         pdev->seg, =
pdev->bus,=0A-                        PCI_SLOT(pdev->devfn), PCI_FUNC(pdev-=
>devfn));=0A+                        PCI_SLOT(devfn), PCI_FUNC(devfn));=0A+=
        return -ENODEV;=0A+    }=0A+=0A+    amd_iommu_setup_domain_device(p=
dev->domain, iommu, devfn, pdev);=0A+    return 0;=0A }=0A =0A int __init =
amd_iov_detect(void)=0A@@ -295,16 +294,16 @@ static void __init amd_iommu_d=
om0_init(s=0A }=0A =0A void amd_iommu_disable_domain_device(struct domain =
*domain,=0A-                                     struct amd_iommu *iommu, =
int bdf)=0A+                                     struct amd_iommu =
*iommu,=0A+                                     u8 devfn, struct pci_dev =
*pdev)=0A {=0A     void *dte;=0A     unsigned long flags;=0A     int =
req_id;=0A-    u8 bus =3D PCI_BUS(bdf);=0A-    u8 devfn =3D PCI_DEVFN2(bdf)=
;=0A+    u8 bus =3D pdev->bus;=0A =0A     BUG_ON ( iommu->dev_table.buffer =
=3D=3D NULL );=0A-    req_id =3D get_dma_requestor_id(iommu->seg, =
bdf);=0A+    req_id =3D get_dma_requestor_id(iommu->seg, PCI_BDF2(bus, =
devfn));=0A     dte =3D iommu->dev_table.buffer + (req_id * IOMMU_DEV_TABLE=
_ENTRY_SIZE);=0A =0A     spin_lock_irqsave(&iommu->lock, flags);=0A@@ =
-312,7 +311,7 @@ void amd_iommu_disable_domain_device(str=0A     {=0A      =
   disable_translation((u32 *)dte);=0A =0A-        if ( pci_ats_device(iomm=
u->seg, bus, devfn) &&=0A+        if ( pci_ats_device(iommu->seg, bus, =
pdev->devfn) &&=0A              iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) =
)=0A             iommu_dte_set_iotlb((u32 *)dte, 0);=0A =0A@@ -327,7 =
+326,8 @@ void amd_iommu_disable_domain_device(str=0A =0A     ASSERT(spin_i=
s_locked(&pcidevs_lock));=0A =0A-    if ( pci_ats_device(iommu->seg, bus, =
devfn) &&=0A+    if ( devfn =3D=3D pdev->devfn &&=0A+         pci_ats_devic=
e(iommu->seg, bus, devfn) &&=0A          pci_ats_enabled(iommu->seg, bus, =
devfn) )=0A         disable_ats_device(iommu->seg, bus, devfn);=0A }=0A@@ =
-350,7 +350,7 @@ static int reassign_device(struct domain=0A         =
return -ENODEV;=0A     }=0A =0A-    amd_iommu_disable_domain_device(source,=
 iommu, bdf);=0A+    amd_iommu_disable_domain_device(source, iommu, devfn, =
pdev);=0A =0A     if ( devfn =3D=3D pdev->devfn )=0A     {=0A@@ -363,7 =
+363,7 @@ static int reassign_device(struct domain=0A     if ( t->root_tabl=
e =3D=3D NULL )=0A         allocate_domain_resources(t);=0A =0A-    =
amd_iommu_setup_domain_device(target, iommu, bdf);=0A+    amd_iommu_setup_d=
omain_device(target, iommu, devfn, pdev);=0A     AMD_IOMMU_DEBUG("Re-assign=
 %04x:%02x:%02x.%u from dom%d to dom%d\n",=0A                     =
pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(devfn),=0A                 =
    source->domain_id, target->domain_id);=0A@@ -449,7 +449,7 @@ static =
void amd_iommu_domain_destroy(str=0A     amd_iommu_flush_all_pages(d);=0A =
}=0A =0A-static int amd_iommu_add_device(struct pci_dev *pdev)=0A+static =
int amd_iommu_add_device(u8 devfn, struct pci_dev *pdev)=0A {=0A     =
struct amd_iommu *iommu;=0A     u16 bdf;=0A@@ -462,16 +462,16 @@ static =
int amd_iommu_add_device(struct p=0A     {=0A         AMD_IOMMU_DEBUG("Fail=
 to find iommu."=0A                         " %04x:%02x:%02x.%u cannot be =
assigned to dom%d\n",=0A-                        pdev->seg, pdev->bus, =
PCI_SLOT(pdev->devfn),=0A-                        PCI_FUNC(pdev->devfn), =
pdev->domain->domain_id);=0A+                        pdev->seg, pdev->bus, =
PCI_SLOT(devfn), PCI_FUNC(devfn),=0A+                        pdev->domain->=
domain_id);=0A         return -ENODEV;=0A     }=0A =0A-    amd_iommu_setup_=
domain_device(pdev->domain, iommu, bdf);=0A+    amd_iommu_setup_domain_devi=
ce(pdev->domain, iommu, devfn, pdev);=0A     return 0;=0A }=0A =0A-static =
int amd_iommu_remove_device(struct pci_dev *pdev)=0A+static int amd_iommu_r=
emove_device(u8 devfn, struct pci_dev *pdev)=0A {=0A     struct amd_iommu =
*iommu;=0A     u16 bdf;=0A@@ -484,12 +484,12 @@ static int amd_iommu_remove=
_device(struc=0A     {=0A         AMD_IOMMU_DEBUG("Fail to find iommu."=0A =
                        " %04x:%02x:%02x.%u cannot be removed from =
dom%d\n",=0A-                        pdev->seg, pdev->bus, PCI_SLOT(pdev->d=
evfn),=0A-                        PCI_FUNC(pdev->devfn), pdev->domain->doma=
in_id);=0A+                        pdev->seg, pdev->bus, PCI_SLOT(devfn), =
PCI_FUNC(devfn),=0A+                        pdev->domain->domain_id);=0A   =
      return -ENODEV;=0A     }=0A =0A-    amd_iommu_disable_domain_device(p=
dev->domain, iommu, bdf);=0A+    amd_iommu_disable_domain_device(pdev->doma=
in, iommu, devfn, pdev);=0A     return 0;=0A }=0A =0A--- a/xen/drivers/pass=
through/iommu.c=0A+++ b/xen/drivers/passthrough/iommu.c=0A@@ -164,7 +164,7 =
@@ int iommu_add_device(struct pci_dev *pde=0A     if ( !iommu_enabled || =
!hd->platform_ops )=0A         return 0;=0A =0A-    return hd->platform_ops=
->add_device(pdev);=0A+    return hd->platform_ops->add_device(pdev->devfn,=
 pdev);=0A }=0A =0A int iommu_enable_device(struct pci_dev *pdev)=0A@@ =
-194,7 +194,7 @@ int iommu_remove_device(struct pci_dev *=0A     if ( =
!iommu_enabled || !hd->platform_ops )=0A         return 0;=0A =0A-    =
return hd->platform_ops->remove_device(pdev);=0A+    return hd->platform_op=
s->remove_device(pdev->devfn, pdev);=0A }=0A =0A /*=0A--- a/xen/drivers/pas=
sthrough/pci.c=0A+++ b/xen/drivers/passthrough/pci.c=0A@@ -743,7 +743,7 @@ =
int __init scan_pci_devices(void)=0A =0A struct setup_dom0 {=0A     struct =
domain *d;=0A-    void (*handler)(struct pci_dev *);=0A+    int (*handler)(=
u8 devfn, struct pci_dev *);=0A };=0A =0A static int __init _setup_dom0_pci=
_devices(struct pci_seg *pseg, void *arg)=0A@@ -764,12 +764,12 @@ static =
int __init _setup_dom0_pci_device=0A             {=0A                 =
pdev->domain =3D ctxt->d;=0A                 list_add(&pdev->domain_list, =
&ctxt->d->arch.pdev_list);=0A-                ctxt->handler(pdev);=0A+     =
           ctxt->handler(devfn, pdev);=0A             }=0A             =
else if ( pdev->domain =3D=3D dom_xen )=0A             {=0A                =
 pdev->domain =3D ctxt->d;=0A-                ctxt->handler(pdev);=0A+     =
           ctxt->handler(devfn, pdev);=0A                 pdev->domain =3D =
dom_xen;=0A             }=0A             else if ( pdev->domain !=3D =
ctxt->d )=0A@@ -783,7 +783,7 @@ static int __init _setup_dom0_pci_device=0A=
 }=0A =0A void __init setup_dom0_pci_devices(=0A-    struct domain *d, =
void (*handler)(struct pci_dev *))=0A+    struct domain *d, int (*handler)(=
u8 devfn, struct pci_dev *))=0A {=0A     struct setup_dom0 ctxt =3D { .d =
=3D d, .handler =3D handler };=0A =0A--- a/xen/drivers/passthrough/vtd/iomm=
u.c=0A+++ b/xen/drivers/passthrough/vtd/iommu.c=0A@@ -50,7 +50,7 @@ int =
nr_iommus;=0A =0A static struct tasklet vtd_fault_tasklet;=0A =0A-static =
void setup_dom0_device(struct pci_dev *);=0A+static int setup_dom0_device(u=
8 devfn, struct pci_dev *);=0A static void setup_dom0_rmrr(struct domain =
*d);=0A =0A static int domain_iommu_domid(struct domain *d,=0A@@ -1873,7 =
+1873,7 @@ static int rmrr_identity_mapping(struct =0A     return 0;=0A =
}=0A =0A-static int intel_iommu_add_device(struct pci_dev *pdev)=0A+static =
int intel_iommu_add_device(u8 devfn, struct pci_dev *pdev)=0A {=0A     =
struct acpi_rmrr_unit *rmrr;=0A     u16 bdf;=0A@@ -1884,8 +1884,7 @@ =
static int intel_iommu_add_device(struct=0A     if ( !pdev->domain )=0A    =
     return -EINVAL;=0A =0A-    ret =3D domain_context_mapping(pdev->domain=
, pdev->seg, pdev->bus,=0A-                                 pdev->devfn);=
=0A+    ret =3D domain_context_mapping(pdev->domain, pdev->seg, pdev->bus, =
devfn);=0A     if ( ret )=0A     {=0A         dprintk(XENLOG_ERR VTDPREFIX,=
 "d%d: context mapping failed\n",=0A@@ -1897,7 +1896,7 @@ static int =
intel_iommu_add_device(struct=0A     {=0A         if ( rmrr->segment =
=3D=3D pdev->seg &&=0A              PCI_BUS(bdf) =3D=3D pdev->bus &&=0A-   =
          PCI_DEVFN2(bdf) =3D=3D pdev->devfn )=0A+             PCI_DEVFN2(b=
df) =3D=3D devfn )=0A         {=0A             ret =3D rmrr_identity_mappin=
g(pdev->domain, rmrr);=0A             if ( ret )=0A@@ -1922,7 +1921,7 @@ =
static int intel_iommu_enable_device(str=0A     return ret >=3D 0 ? 0 : =
ret;=0A }=0A =0A-static int intel_iommu_remove_device(struct pci_dev =
*pdev)=0A+static int intel_iommu_remove_device(u8 devfn, struct pci_dev =
*pdev)=0A {=0A     struct acpi_rmrr_unit *rmrr;=0A     u16 bdf;=0A@@ =
-1940,19 +1939,22 @@ static int intel_iommu_remove_device(str=0A         =
{=0A             if ( rmrr->segment =3D=3D pdev->seg &&=0A                 =
 PCI_BUS(bdf) =3D=3D pdev->bus &&=0A-                 PCI_DEVFN2(bdf) =
=3D=3D pdev->devfn )=0A+                 PCI_DEVFN2(bdf) =3D=3D devfn )=0A =
                return 0;=0A         }=0A     }=0A =0A-    return =
domain_context_unmap(pdev->domain, pdev->seg, pdev->bus,=0A-               =
                 pdev->devfn);=0A+    return domain_context_unmap(pdev->dom=
ain, pdev->seg, pdev->bus, devfn);=0A }=0A =0A-static void __init =
setup_dom0_device(struct pci_dev *pdev)=0A+static int __init setup_dom0_dev=
ice(u8 devfn, struct pci_dev *pdev)=0A {=0A-    domain_context_mapping(pdev=
->domain, pdev->seg, pdev->bus, pdev->devfn);=0A-    pci_vtd_quirk(pdev);=
=0A+    int err;=0A+=0A+    err =3D domain_context_mapping(pdev->domain, =
pdev->seg, pdev->bus, devfn);=0A+    if ( !err && devfn =3D=3D pdev->devfn =
)=0A+        pci_vtd_quirk(pdev);=0A+    return err;=0A }=0A =0A void =
clear_fault_bits(struct iommu *iommu)=0A--- a/xen/include/xen/iommu.h=0A+++=
 b/xen/include/xen/iommu.h=0A@@ -94,9 +94,9 @@ struct msi_msg;=0A struct =
iommu_ops {=0A     int (*init)(struct domain *d);=0A     void (*dom0_init)(=
struct domain *d);=0A-    int (*add_device)(struct pci_dev *pdev);=0A+    =
int (*add_device)(u8 devfn, struct pci_dev *);=0A     int (*enable_device)(=
struct pci_dev *pdev);=0A-    int (*remove_device)(struct pci_dev =
*pdev);=0A+    int (*remove_device)(u8 devfn, struct pci_dev *);=0A     =
int (*assign_device)(struct domain *, u8 devfn, struct pci_dev *);=0A     =
void (*teardown)(struct domain *d);=0A     int (*map_page)(struct domain =
*d, unsigned long gfn, unsigned long mfn,=0A--- a/xen/include/xen/pci.h=0A+=
++ b/xen/include/xen/pci.h=0A@@ -100,7 +100,8 @@ struct pci_dev *pci_lock_p=
dev(int seg, i=0A struct pci_dev *pci_lock_domain_pdev(=0A     struct =
domain *, int seg, int bus, int devfn);=0A =0A-void setup_dom0_pci_devices(=
struct domain *, void (*)(struct pci_dev *));=0A+void setup_dom0_pci_device=
s(struct domain *,=0A+                            int (*)(u8 devfn, struct =
pci_dev *));=0A void pci_release_devices(struct domain *d);=0A int =
pci_add_segment(u16 seg);=0A const unsigned long *pci_get_ro_map(u16 =
seg);=0A
--=__Part4677AE15.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.xen.org
http://lists.xen.org/xen-devel

--=__Part4677AE15.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 09:48:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 09:48:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdeFQ-0008Ew-7W; Wed, 28 Nov 2012 09:48:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdeFN-0008Eh-LM
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 09:48:02 +0000
Received: from [85.158.139.211:40894] by server-13.bemta-5.messagelabs.com id
	76/1D-27809-0DDD5B05; Wed, 28 Nov 2012 09:48:00 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1354096079!16667220!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9623 invoked from network); 28 Nov 2012 09:47:59 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 09:47:59 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 09:47:59 +0000
Message-Id: <50B5EC1502000078000AC108@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 09:48:53 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
In-Reply-To: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part4677AE15.0__="
Subject: [Xen-devel] [PATCH,
 RFC 2/7] IOMMU: IOMMU: adjust add/remove operation parameters
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part4677AE15.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

... to use a (struct pci_dev *, devfn) pair.

--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -83,14 +83,14 @@ static void disable_translation(u32 *dte
 }
=20
 static void amd_iommu_setup_domain_device(
-    struct domain *domain, struct amd_iommu *iommu, int bdf)
+    struct domain *domain, struct amd_iommu *iommu,
+    u8 devfn, struct pci_dev *pdev)
 {
     void *dte;
     unsigned long flags;
     int req_id, valid =3D 1;
     int dte_i =3D 0;
-    u8 bus =3D PCI_BUS(bdf);
-    u8 devfn =3D PCI_DEVFN2(bdf);
+    u8 bus =3D pdev->bus;
=20
     struct hvm_iommu *hd =3D domain_hvm_iommu(domain);
=20
@@ -103,7 +103,7 @@ static void amd_iommu_setup_domain_devic
         dte_i =3D 1;
=20
     /* get device-table entry */
-    req_id =3D get_dma_requestor_id(iommu->seg, bdf);
+    req_id =3D get_dma_requestor_id(iommu->seg, PCI_BDF2(bus, devfn));
     dte =3D iommu->dev_table.buffer + (req_id * IOMMU_DEV_TABLE_ENTRY_SIZE=
);
=20
     spin_lock_irqsave(&iommu->lock, flags);
@@ -115,7 +115,7 @@ static void amd_iommu_setup_domain_devic
             (u32 *)dte, page_to_maddr(hd->root_table), hd->domain_id,
             hd->paging_mode, valid);
=20
-        if ( pci_ats_device(iommu->seg, bus, devfn) &&
+        if ( pci_ats_device(iommu->seg, bus, pdev->devfn) &&
              iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) )
             iommu_dte_set_iotlb((u32 *)dte, dte_i);
=20
@@ -132,32 +132,31 @@ static void amd_iommu_setup_domain_devic
=20
     ASSERT(spin_is_locked(&pcidevs_lock));
=20
-    if ( pci_ats_device(iommu->seg, bus, devfn) &&
-         !pci_ats_enabled(iommu->seg, bus, devfn) )
+    if ( pci_ats_device(iommu->seg, bus, pdev->devfn) &&
+         !pci_ats_enabled(iommu->seg, bus, pdev->devfn) )
     {
-        struct pci_dev *pdev;
+        if ( devfn =3D=3D pdev->devfn )
+            enable_ats_device(iommu->seg, bus, devfn);
=20
-        enable_ats_device(iommu->seg, bus, devfn);
-
-        ASSERT(spin_is_locked(&pcidevs_lock));
-        pdev =3D pci_get_pdev(iommu->seg, bus, devfn);
-
-        ASSERT( pdev !=3D NULL );
         amd_iommu_flush_iotlb(pdev, INV_IOMMU_ALL_PAGES_ADDRESS, 0);
     }
 }
=20
-static void __init amd_iommu_setup_dom0_device(struct pci_dev *pdev)
+static int __init amd_iommu_setup_dom0_device(u8 devfn, struct pci_dev =
*pdev)
 {
     int bdf =3D PCI_BDF2(pdev->bus, pdev->devfn);
     struct amd_iommu *iommu =3D find_iommu_for_device(pdev->seg, bdf);
=20
-    if ( likely(iommu !=3D NULL) )
-        amd_iommu_setup_domain_device(pdev->domain, iommu, bdf);
-    else
+    if ( unlikely(!iommu) )
+    {
         AMD_IOMMU_DEBUG("No iommu for device %04x:%02x:%02x.%u\n",
                         pdev->seg, pdev->bus,
-                        PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
+                        PCI_SLOT(devfn), PCI_FUNC(devfn));
+        return -ENODEV;
+    }
+
+    amd_iommu_setup_domain_device(pdev->domain, iommu, devfn, pdev);
+    return 0;
 }
=20
 int __init amd_iov_detect(void)
@@ -295,16 +294,16 @@ static void __init amd_iommu_dom0_init(s
 }
=20
 void amd_iommu_disable_domain_device(struct domain *domain,
-                                     struct amd_iommu *iommu, int bdf)
+                                     struct amd_iommu *iommu,
+                                     u8 devfn, struct pci_dev *pdev)
 {
     void *dte;
     unsigned long flags;
     int req_id;
-    u8 bus =3D PCI_BUS(bdf);
-    u8 devfn =3D PCI_DEVFN2(bdf);
+    u8 bus =3D pdev->bus;
=20
     BUG_ON ( iommu->dev_table.buffer =3D=3D NULL );
-    req_id =3D get_dma_requestor_id(iommu->seg, bdf);
+    req_id =3D get_dma_requestor_id(iommu->seg, PCI_BDF2(bus, devfn));
     dte =3D iommu->dev_table.buffer + (req_id * IOMMU_DEV_TABLE_ENTRY_SIZE=
);
=20
     spin_lock_irqsave(&iommu->lock, flags);
@@ -312,7 +311,7 @@ void amd_iommu_disable_domain_device(str
     {
         disable_translation((u32 *)dte);
=20
-        if ( pci_ats_device(iommu->seg, bus, devfn) &&
+        if ( pci_ats_device(iommu->seg, bus, pdev->devfn) &&
              iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) )
             iommu_dte_set_iotlb((u32 *)dte, 0);
=20
@@ -327,7 +326,8 @@ void amd_iommu_disable_domain_device(str
=20
     ASSERT(spin_is_locked(&pcidevs_lock));
=20
-    if ( pci_ats_device(iommu->seg, bus, devfn) &&
+    if ( devfn =3D=3D pdev->devfn &&
+         pci_ats_device(iommu->seg, bus, devfn) &&
          pci_ats_enabled(iommu->seg, bus, devfn) )
         disable_ats_device(iommu->seg, bus, devfn);
 }
@@ -350,7 +350,7 @@ static int reassign_device(struct domain
         return -ENODEV;
     }
=20
-    amd_iommu_disable_domain_device(source, iommu, bdf);
+    amd_iommu_disable_domain_device(source, iommu, devfn, pdev);
=20
     if ( devfn =3D=3D pdev->devfn )
     {
@@ -363,7 +363,7 @@ static int reassign_device(struct domain
     if ( t->root_table =3D=3D NULL )
         allocate_domain_resources(t);
=20
-    amd_iommu_setup_domain_device(target, iommu, bdf);
+    amd_iommu_setup_domain_device(target, iommu, devfn, pdev);
     AMD_IOMMU_DEBUG("Re-assign %04x:%02x:%02x.%u from dom%d to dom%d\n",
                     pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(devfn)=
,
                     source->domain_id, target->domain_id);
@@ -449,7 +449,7 @@ static void amd_iommu_domain_destroy(str
     amd_iommu_flush_all_pages(d);
 }
=20
-static int amd_iommu_add_device(struct pci_dev *pdev)
+static int amd_iommu_add_device(u8 devfn, struct pci_dev *pdev)
 {
     struct amd_iommu *iommu;
     u16 bdf;
@@ -462,16 +462,16 @@ static int amd_iommu_add_device(struct p
     {
         AMD_IOMMU_DEBUG("Fail to find iommu."
                         " %04x:%02x:%02x.%u cannot be assigned to =
dom%d\n",
-                        pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
-                        PCI_FUNC(pdev->devfn), pdev->domain->domain_id);
+                        pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(de=
vfn),
+                        pdev->domain->domain_id);
         return -ENODEV;
     }
=20
-    amd_iommu_setup_domain_device(pdev->domain, iommu, bdf);
+    amd_iommu_setup_domain_device(pdev->domain, iommu, devfn, pdev);
     return 0;
 }
=20
-static int amd_iommu_remove_device(struct pci_dev *pdev)
+static int amd_iommu_remove_device(u8 devfn, struct pci_dev *pdev)
 {
     struct amd_iommu *iommu;
     u16 bdf;
@@ -484,12 +484,12 @@ static int amd_iommu_remove_device(struc
     {
         AMD_IOMMU_DEBUG("Fail to find iommu."
                         " %04x:%02x:%02x.%u cannot be removed from =
dom%d\n",
-                        pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
-                        PCI_FUNC(pdev->devfn), pdev->domain->domain_id);
+                        pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(de=
vfn),
+                        pdev->domain->domain_id);
         return -ENODEV;
     }
=20
-    amd_iommu_disable_domain_device(pdev->domain, iommu, bdf);
+    amd_iommu_disable_domain_device(pdev->domain, iommu, devfn, pdev);
     return 0;
 }
=20
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -164,7 +164,7 @@ int iommu_add_device(struct pci_dev *pde
     if ( !iommu_enabled || !hd->platform_ops )
         return 0;
=20
-    return hd->platform_ops->add_device(pdev);
+    return hd->platform_ops->add_device(pdev->devfn, pdev);
 }
=20
 int iommu_enable_device(struct pci_dev *pdev)
@@ -194,7 +194,7 @@ int iommu_remove_device(struct pci_dev *
     if ( !iommu_enabled || !hd->platform_ops )
         return 0;
=20
-    return hd->platform_ops->remove_device(pdev);
+    return hd->platform_ops->remove_device(pdev->devfn, pdev);
 }
=20
 /*
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -743,7 +743,7 @@ int __init scan_pci_devices(void)
=20
 struct setup_dom0 {
     struct domain *d;
-    void (*handler)(struct pci_dev *);
+    int (*handler)(u8 devfn, struct pci_dev *);
 };
=20
 static int __init _setup_dom0_pci_devices(struct pci_seg *pseg, void =
*arg)
@@ -764,12 +764,12 @@ static int __init _setup_dom0_pci_device
             {
                 pdev->domain =3D ctxt->d;
                 list_add(&pdev->domain_list, &ctxt->d->arch.pdev_list);
-                ctxt->handler(pdev);
+                ctxt->handler(devfn, pdev);
             }
             else if ( pdev->domain =3D=3D dom_xen )
             {
                 pdev->domain =3D ctxt->d;
-                ctxt->handler(pdev);
+                ctxt->handler(devfn, pdev);
                 pdev->domain =3D dom_xen;
             }
             else if ( pdev->domain !=3D ctxt->d )
@@ -783,7 +783,7 @@ static int __init _setup_dom0_pci_device
 }
=20
 void __init setup_dom0_pci_devices(
-    struct domain *d, void (*handler)(struct pci_dev *))
+    struct domain *d, int (*handler)(u8 devfn, struct pci_dev *))
 {
     struct setup_dom0 ctxt =3D { .d =3D d, .handler =3D handler };
=20
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -50,7 +50,7 @@ int nr_iommus;
=20
 static struct tasklet vtd_fault_tasklet;
=20
-static void setup_dom0_device(struct pci_dev *);
+static int setup_dom0_device(u8 devfn, struct pci_dev *);
 static void setup_dom0_rmrr(struct domain *d);
=20
 static int domain_iommu_domid(struct domain *d,
@@ -1873,7 +1873,7 @@ static int rmrr_identity_mapping(struct=20
     return 0;
 }
=20
-static int intel_iommu_add_device(struct pci_dev *pdev)
+static int intel_iommu_add_device(u8 devfn, struct pci_dev *pdev)
 {
     struct acpi_rmrr_unit *rmrr;
     u16 bdf;
@@ -1884,8 +1884,7 @@ static int intel_iommu_add_device(struct
     if ( !pdev->domain )
         return -EINVAL;
=20
-    ret =3D domain_context_mapping(pdev->domain, pdev->seg, pdev->bus,
-                                 pdev->devfn);
+    ret =3D domain_context_mapping(pdev->domain, pdev->seg, pdev->bus, =
devfn);
     if ( ret )
     {
         dprintk(XENLOG_ERR VTDPREFIX, "d%d: context mapping failed\n",
@@ -1897,7 +1896,7 @@ static int intel_iommu_add_device(struct
     {
         if ( rmrr->segment =3D=3D pdev->seg &&
              PCI_BUS(bdf) =3D=3D pdev->bus &&
-             PCI_DEVFN2(bdf) =3D=3D pdev->devfn )
+             PCI_DEVFN2(bdf) =3D=3D devfn )
         {
             ret =3D rmrr_identity_mapping(pdev->domain, rmrr);
             if ( ret )
@@ -1922,7 +1921,7 @@ static int intel_iommu_enable_device(str
     return ret >=3D 0 ? 0 : ret;
 }
=20
-static int intel_iommu_remove_device(struct pci_dev *pdev)
+static int intel_iommu_remove_device(u8 devfn, struct pci_dev *pdev)
 {
     struct acpi_rmrr_unit *rmrr;
     u16 bdf;
@@ -1940,19 +1939,22 @@ static int intel_iommu_remove_device(str
         {
             if ( rmrr->segment =3D=3D pdev->seg &&
                  PCI_BUS(bdf) =3D=3D pdev->bus &&
-                 PCI_DEVFN2(bdf) =3D=3D pdev->devfn )
+                 PCI_DEVFN2(bdf) =3D=3D devfn )
                 return 0;
         }
     }
=20
-    return domain_context_unmap(pdev->domain, pdev->seg, pdev->bus,
-                                pdev->devfn);
+    return domain_context_unmap(pdev->domain, pdev->seg, pdev->bus, =
devfn);
 }
=20
-static void __init setup_dom0_device(struct pci_dev *pdev)
+static int __init setup_dom0_device(u8 devfn, struct pci_dev *pdev)
 {
-    domain_context_mapping(pdev->domain, pdev->seg, pdev->bus, pdev->devfn=
);
-    pci_vtd_quirk(pdev);
+    int err;
+
+    err =3D domain_context_mapping(pdev->domain, pdev->seg, pdev->bus, =
devfn);
+    if ( !err && devfn =3D=3D pdev->devfn )
+        pci_vtd_quirk(pdev);
+    return err;
 }
=20
 void clear_fault_bits(struct iommu *iommu)
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -94,9 +94,9 @@ struct msi_msg;
 struct iommu_ops {
     int (*init)(struct domain *d);
     void (*dom0_init)(struct domain *d);
-    int (*add_device)(struct pci_dev *pdev);
+    int (*add_device)(u8 devfn, struct pci_dev *);
     int (*enable_device)(struct pci_dev *pdev);
-    int (*remove_device)(struct pci_dev *pdev);
+    int (*remove_device)(u8 devfn, struct pci_dev *);
     int (*assign_device)(struct domain *, u8 devfn, struct pci_dev *);
     void (*teardown)(struct domain *d);
     int (*map_page)(struct domain *d, unsigned long gfn, unsigned long =
mfn,
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -100,7 +100,8 @@ struct pci_dev *pci_lock_pdev(int seg, i
 struct pci_dev *pci_lock_domain_pdev(
     struct domain *, int seg, int bus, int devfn);
=20
-void setup_dom0_pci_devices(struct domain *, void (*)(struct pci_dev *));
+void setup_dom0_pci_devices(struct domain *,
+                            int (*)(u8 devfn, struct pci_dev *));
 void pci_release_devices(struct domain *d);
 int pci_add_segment(u16 seg);
 const unsigned long *pci_get_ro_map(u16 seg);


--=__Part4677AE15.0__=
Content-Type: text/plain; name="IOMMU-add-remove-params.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="IOMMU-add-remove-params.patch"

IOMMU: adjust add/remove operation parameters=0A=0A... to use a (struct =
pci_dev *, devfn) pair.=0A=0A--- a/xen/drivers/passthrough/amd/pci_amd_iomm=
u.c=0A+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c=0A@@ -83,14 +83,14 =
@@ static void disable_translation(u32 *dte=0A }=0A =0A static void =
amd_iommu_setup_domain_device(=0A-    struct domain *domain, struct =
amd_iommu *iommu, int bdf)=0A+    struct domain *domain, struct amd_iommu =
*iommu,=0A+    u8 devfn, struct pci_dev *pdev)=0A {=0A     void *dte;=0A   =
  unsigned long flags;=0A     int req_id, valid =3D 1;=0A     int dte_i =
=3D 0;=0A-    u8 bus =3D PCI_BUS(bdf);=0A-    u8 devfn =3D PCI_DEVFN2(bdf);=
=0A+    u8 bus =3D pdev->bus;=0A =0A     struct hvm_iommu *hd =3D =
domain_hvm_iommu(domain);=0A =0A@@ -103,7 +103,7 @@ static void amd_iommu_s=
etup_domain_devic=0A         dte_i =3D 1;=0A =0A     /* get device-table =
entry */=0A-    req_id =3D get_dma_requestor_id(iommu->seg, bdf);=0A+    =
req_id =3D get_dma_requestor_id(iommu->seg, PCI_BDF2(bus, devfn));=0A     =
dte =3D iommu->dev_table.buffer + (req_id * IOMMU_DEV_TABLE_ENTRY_SIZE);=0A=
 =0A     spin_lock_irqsave(&iommu->lock, flags);=0A@@ -115,7 +115,7 @@ =
static void amd_iommu_setup_domain_devic=0A             (u32 *)dte, =
page_to_maddr(hd->root_table), hd->domain_id,=0A             hd->paging_mod=
e, valid);=0A =0A-        if ( pci_ats_device(iommu->seg, bus, devfn) =
&&=0A+        if ( pci_ats_device(iommu->seg, bus, pdev->devfn) &&=0A      =
        iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) )=0A             =
iommu_dte_set_iotlb((u32 *)dte, dte_i);=0A =0A@@ -132,32 +132,31 @@ static =
void amd_iommu_setup_domain_devic=0A =0A     ASSERT(spin_is_locked(&pcidevs=
_lock));=0A =0A-    if ( pci_ats_device(iommu->seg, bus, devfn) &&=0A-     =
    !pci_ats_enabled(iommu->seg, bus, devfn) )=0A+    if ( pci_ats_device(i=
ommu->seg, bus, pdev->devfn) &&=0A+         !pci_ats_enabled(iommu->seg, =
bus, pdev->devfn) )=0A     {=0A-        struct pci_dev *pdev;=0A+        =
if ( devfn =3D=3D pdev->devfn )=0A+            enable_ats_device(iommu->seg=
, bus, devfn);=0A =0A-        enable_ats_device(iommu->seg, bus, devfn);=0A=
-=0A-        ASSERT(spin_is_locked(&pcidevs_lock));=0A-        pdev =3D =
pci_get_pdev(iommu->seg, bus, devfn);=0A-=0A-        ASSERT( pdev !=3D =
NULL );=0A         amd_iommu_flush_iotlb(pdev, INV_IOMMU_ALL_PAGES_ADDRESS,=
 0);=0A     }=0A }=0A =0A-static void __init amd_iommu_setup_dom0_device(st=
ruct pci_dev *pdev)=0A+static int __init amd_iommu_setup_dom0_device(u8 =
devfn, struct pci_dev *pdev)=0A {=0A     int bdf =3D PCI_BDF2(pdev->bus, =
pdev->devfn);=0A     struct amd_iommu *iommu =3D find_iommu_for_device(pdev=
->seg, bdf);=0A =0A-    if ( likely(iommu !=3D NULL) )=0A-        =
amd_iommu_setup_domain_device(pdev->domain, iommu, bdf);=0A-    else=0A+   =
 if ( unlikely(!iommu) )=0A+    {=0A         AMD_IOMMU_DEBUG("No iommu for =
device %04x:%02x:%02x.%u\n",=0A                         pdev->seg, =
pdev->bus,=0A-                        PCI_SLOT(pdev->devfn), PCI_FUNC(pdev-=
>devfn));=0A+                        PCI_SLOT(devfn), PCI_FUNC(devfn));=0A+=
        return -ENODEV;=0A+    }=0A+=0A+    amd_iommu_setup_domain_device(p=
dev->domain, iommu, devfn, pdev);=0A+    return 0;=0A }=0A =0A int __init =
amd_iov_detect(void)=0A@@ -295,16 +294,16 @@ static void __init amd_iommu_d=
om0_init(s=0A }=0A =0A void amd_iommu_disable_domain_device(struct domain =
*domain,=0A-                                     struct amd_iommu *iommu, =
int bdf)=0A+                                     struct amd_iommu =
*iommu,=0A+                                     u8 devfn, struct pci_dev =
*pdev)=0A {=0A     void *dte;=0A     unsigned long flags;=0A     int =
req_id;=0A-    u8 bus =3D PCI_BUS(bdf);=0A-    u8 devfn =3D PCI_DEVFN2(bdf)=
;=0A+    u8 bus =3D pdev->bus;=0A =0A     BUG_ON ( iommu->dev_table.buffer =
=3D=3D NULL );=0A-    req_id =3D get_dma_requestor_id(iommu->seg, =
bdf);=0A+    req_id =3D get_dma_requestor_id(iommu->seg, PCI_BDF2(bus, =
devfn));=0A     dte =3D iommu->dev_table.buffer + (req_id * IOMMU_DEV_TABLE=
_ENTRY_SIZE);=0A =0A     spin_lock_irqsave(&iommu->lock, flags);=0A@@ =
-312,7 +311,7 @@ void amd_iommu_disable_domain_device(str=0A     {=0A      =
   disable_translation((u32 *)dte);=0A =0A-        if ( pci_ats_device(iomm=
u->seg, bus, devfn) &&=0A+        if ( pci_ats_device(iommu->seg, bus, =
pdev->devfn) &&=0A              iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) =
)=0A             iommu_dte_set_iotlb((u32 *)dte, 0);=0A =0A@@ -327,7 =
+326,8 @@ void amd_iommu_disable_domain_device(str=0A =0A     ASSERT(spin_i=
s_locked(&pcidevs_lock));=0A =0A-    if ( pci_ats_device(iommu->seg, bus, =
devfn) &&=0A+    if ( devfn =3D=3D pdev->devfn &&=0A+         pci_ats_devic=
e(iommu->seg, bus, devfn) &&=0A          pci_ats_enabled(iommu->seg, bus, =
devfn) )=0A         disable_ats_device(iommu->seg, bus, devfn);=0A }=0A@@ =
-350,7 +350,7 @@ static int reassign_device(struct domain=0A         =
return -ENODEV;=0A     }=0A =0A-    amd_iommu_disable_domain_device(source,=
 iommu, bdf);=0A+    amd_iommu_disable_domain_device(source, iommu, devfn, =
pdev);=0A =0A     if ( devfn =3D=3D pdev->devfn )=0A     {=0A@@ -363,7 =
+363,7 @@ static int reassign_device(struct domain=0A     if ( t->root_tabl=
e =3D=3D NULL )=0A         allocate_domain_resources(t);=0A =0A-    =
amd_iommu_setup_domain_device(target, iommu, bdf);=0A+    amd_iommu_setup_d=
omain_device(target, iommu, devfn, pdev);=0A     AMD_IOMMU_DEBUG("Re-assign=
 %04x:%02x:%02x.%u from dom%d to dom%d\n",=0A                     =
pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(devfn),=0A                 =
    source->domain_id, target->domain_id);=0A@@ -449,7 +449,7 @@ static =
void amd_iommu_domain_destroy(str=0A     amd_iommu_flush_all_pages(d);=0A =
}=0A =0A-static int amd_iommu_add_device(struct pci_dev *pdev)=0A+static =
int amd_iommu_add_device(u8 devfn, struct pci_dev *pdev)=0A {=0A     =
struct amd_iommu *iommu;=0A     u16 bdf;=0A@@ -462,16 +462,16 @@ static =
int amd_iommu_add_device(struct p=0A     {=0A         AMD_IOMMU_DEBUG("Fail=
 to find iommu."=0A                         " %04x:%02x:%02x.%u cannot be =
assigned to dom%d\n",=0A-                        pdev->seg, pdev->bus, =
PCI_SLOT(pdev->devfn),=0A-                        PCI_FUNC(pdev->devfn), =
pdev->domain->domain_id);=0A+                        pdev->seg, pdev->bus, =
PCI_SLOT(devfn), PCI_FUNC(devfn),=0A+                        pdev->domain->=
domain_id);=0A         return -ENODEV;=0A     }=0A =0A-    amd_iommu_setup_=
domain_device(pdev->domain, iommu, bdf);=0A+    amd_iommu_setup_domain_devi=
ce(pdev->domain, iommu, devfn, pdev);=0A     return 0;=0A }=0A =0A-static =
int amd_iommu_remove_device(struct pci_dev *pdev)=0A+static int amd_iommu_r=
emove_device(u8 devfn, struct pci_dev *pdev)=0A {=0A     struct amd_iommu =
*iommu;=0A     u16 bdf;=0A@@ -484,12 +484,12 @@ static int amd_iommu_remove=
_device(struc=0A     {=0A         AMD_IOMMU_DEBUG("Fail to find iommu."=0A =
                        " %04x:%02x:%02x.%u cannot be removed from =
dom%d\n",=0A-                        pdev->seg, pdev->bus, PCI_SLOT(pdev->d=
evfn),=0A-                        PCI_FUNC(pdev->devfn), pdev->domain->doma=
in_id);=0A+                        pdev->seg, pdev->bus, PCI_SLOT(devfn), =
PCI_FUNC(devfn),=0A+                        pdev->domain->domain_id);=0A   =
      return -ENODEV;=0A     }=0A =0A-    amd_iommu_disable_domain_device(p=
dev->domain, iommu, bdf);=0A+    amd_iommu_disable_domain_device(pdev->doma=
in, iommu, devfn, pdev);=0A     return 0;=0A }=0A =0A--- a/xen/drivers/pass=
through/iommu.c=0A+++ b/xen/drivers/passthrough/iommu.c=0A@@ -164,7 +164,7 =
@@ int iommu_add_device(struct pci_dev *pde=0A     if ( !iommu_enabled || =
!hd->platform_ops )=0A         return 0;=0A =0A-    return hd->platform_ops=
->add_device(pdev);=0A+    return hd->platform_ops->add_device(pdev->devfn,=
 pdev);=0A }=0A =0A int iommu_enable_device(struct pci_dev *pdev)=0A@@ =
-194,7 +194,7 @@ int iommu_remove_device(struct pci_dev *=0A     if ( =
!iommu_enabled || !hd->platform_ops )=0A         return 0;=0A =0A-    =
return hd->platform_ops->remove_device(pdev);=0A+    return hd->platform_op=
s->remove_device(pdev->devfn, pdev);=0A }=0A =0A /*=0A--- a/xen/drivers/pas=
sthrough/pci.c=0A+++ b/xen/drivers/passthrough/pci.c=0A@@ -743,7 +743,7 @@ =
int __init scan_pci_devices(void)=0A =0A struct setup_dom0 {=0A     struct =
domain *d;=0A-    void (*handler)(struct pci_dev *);=0A+    int (*handler)(=
u8 devfn, struct pci_dev *);=0A };=0A =0A static int __init _setup_dom0_pci=
_devices(struct pci_seg *pseg, void *arg)=0A@@ -764,12 +764,12 @@ static =
int __init _setup_dom0_pci_device=0A             {=0A                 =
pdev->domain =3D ctxt->d;=0A                 list_add(&pdev->domain_list, =
&ctxt->d->arch.pdev_list);=0A-                ctxt->handler(pdev);=0A+     =
           ctxt->handler(devfn, pdev);=0A             }=0A             =
else if ( pdev->domain =3D=3D dom_xen )=0A             {=0A                =
 pdev->domain =3D ctxt->d;=0A-                ctxt->handler(pdev);=0A+     =
           ctxt->handler(devfn, pdev);=0A                 pdev->domain =3D =
dom_xen;=0A             }=0A             else if ( pdev->domain !=3D =
ctxt->d )=0A@@ -783,7 +783,7 @@ static int __init _setup_dom0_pci_device=0A=
 }=0A =0A void __init setup_dom0_pci_devices(=0A-    struct domain *d, =
void (*handler)(struct pci_dev *))=0A+    struct domain *d, int (*handler)(=
u8 devfn, struct pci_dev *))=0A {=0A     struct setup_dom0 ctxt =3D { .d =
=3D d, .handler =3D handler };=0A =0A--- a/xen/drivers/passthrough/vtd/iomm=
u.c=0A+++ b/xen/drivers/passthrough/vtd/iommu.c=0A@@ -50,7 +50,7 @@ int =
nr_iommus;=0A =0A static struct tasklet vtd_fault_tasklet;=0A =0A-static =
void setup_dom0_device(struct pci_dev *);=0A+static int setup_dom0_device(u=
8 devfn, struct pci_dev *);=0A static void setup_dom0_rmrr(struct domain =
*d);=0A =0A static int domain_iommu_domid(struct domain *d,=0A@@ -1873,7 =
+1873,7 @@ static int rmrr_identity_mapping(struct =0A     return 0;=0A =
}=0A =0A-static int intel_iommu_add_device(struct pci_dev *pdev)=0A+static =
int intel_iommu_add_device(u8 devfn, struct pci_dev *pdev)=0A {=0A     =
struct acpi_rmrr_unit *rmrr;=0A     u16 bdf;=0A@@ -1884,8 +1884,7 @@ =
static int intel_iommu_add_device(struct=0A     if ( !pdev->domain )=0A    =
     return -EINVAL;=0A =0A-    ret =3D domain_context_mapping(pdev->domain=
, pdev->seg, pdev->bus,=0A-                                 pdev->devfn);=
=0A+    ret =3D domain_context_mapping(pdev->domain, pdev->seg, pdev->bus, =
devfn);=0A     if ( ret )=0A     {=0A         dprintk(XENLOG_ERR VTDPREFIX,=
 "d%d: context mapping failed\n",=0A@@ -1897,7 +1896,7 @@ static int =
intel_iommu_add_device(struct=0A     {=0A         if ( rmrr->segment =
=3D=3D pdev->seg &&=0A              PCI_BUS(bdf) =3D=3D pdev->bus &&=0A-   =
          PCI_DEVFN2(bdf) =3D=3D pdev->devfn )=0A+             PCI_DEVFN2(b=
df) =3D=3D devfn )=0A         {=0A             ret =3D rmrr_identity_mappin=
g(pdev->domain, rmrr);=0A             if ( ret )=0A@@ -1922,7 +1921,7 @@ =
static int intel_iommu_enable_device(str=0A     return ret >=3D 0 ? 0 : =
ret;=0A }=0A =0A-static int intel_iommu_remove_device(struct pci_dev =
*pdev)=0A+static int intel_iommu_remove_device(u8 devfn, struct pci_dev =
*pdev)=0A {=0A     struct acpi_rmrr_unit *rmrr;=0A     u16 bdf;=0A@@ =
-1940,19 +1939,22 @@ static int intel_iommu_remove_device(str=0A         =
{=0A             if ( rmrr->segment =3D=3D pdev->seg &&=0A                 =
 PCI_BUS(bdf) =3D=3D pdev->bus &&=0A-                 PCI_DEVFN2(bdf) =
=3D=3D pdev->devfn )=0A+                 PCI_DEVFN2(bdf) =3D=3D devfn )=0A =
                return 0;=0A         }=0A     }=0A =0A-    return =
domain_context_unmap(pdev->domain, pdev->seg, pdev->bus,=0A-               =
                 pdev->devfn);=0A+    return domain_context_unmap(pdev->dom=
ain, pdev->seg, pdev->bus, devfn);=0A }=0A =0A-static void __init =
setup_dom0_device(struct pci_dev *pdev)=0A+static int __init setup_dom0_dev=
ice(u8 devfn, struct pci_dev *pdev)=0A {=0A-    domain_context_mapping(pdev=
->domain, pdev->seg, pdev->bus, pdev->devfn);=0A-    pci_vtd_quirk(pdev);=
=0A+    int err;=0A+=0A+    err =3D domain_context_mapping(pdev->domain, =
pdev->seg, pdev->bus, devfn);=0A+    if ( !err && devfn =3D=3D pdev->devfn =
)=0A+        pci_vtd_quirk(pdev);=0A+    return err;=0A }=0A =0A void =
clear_fault_bits(struct iommu *iommu)=0A--- a/xen/include/xen/iommu.h=0A+++=
 b/xen/include/xen/iommu.h=0A@@ -94,9 +94,9 @@ struct msi_msg;=0A struct =
iommu_ops {=0A     int (*init)(struct domain *d);=0A     void (*dom0_init)(=
struct domain *d);=0A-    int (*add_device)(struct pci_dev *pdev);=0A+    =
int (*add_device)(u8 devfn, struct pci_dev *);=0A     int (*enable_device)(=
struct pci_dev *pdev);=0A-    int (*remove_device)(struct pci_dev =
*pdev);=0A+    int (*remove_device)(u8 devfn, struct pci_dev *);=0A     =
int (*assign_device)(struct domain *, u8 devfn, struct pci_dev *);=0A     =
void (*teardown)(struct domain *d);=0A     int (*map_page)(struct domain =
*d, unsigned long gfn, unsigned long mfn,=0A--- a/xen/include/xen/pci.h=0A+=
++ b/xen/include/xen/pci.h=0A@@ -100,7 +100,8 @@ struct pci_dev *pci_lock_p=
dev(int seg, i=0A struct pci_dev *pci_lock_domain_pdev(=0A     struct =
domain *, int seg, int bus, int devfn);=0A =0A-void setup_dom0_pci_devices(=
struct domain *, void (*)(struct pci_dev *));=0A+void setup_dom0_pci_device=
s(struct domain *,=0A+                            int (*)(u8 devfn, struct =
pci_dev *));=0A void pci_release_devices(struct domain *d);=0A int =
pci_add_segment(u16 seg);=0A const unsigned long *pci_get_ro_map(u16 =
seg);=0A
--=__Part4677AE15.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.xen.org
http://lists.xen.org/xen-devel

--=__Part4677AE15.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 09:49:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 09:49:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdeGe-0008O1-2l; Wed, 28 Nov 2012 09:49:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdeGc-0008No-3H
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 09:49:18 +0000
Received: from [85.158.139.211:27785] by server-1.bemta-5.messagelabs.com id
	64/A0-09311-D1ED5B05; Wed, 28 Nov 2012 09:49:17 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1354096155!18117633!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22705 invoked from network); 28 Nov 2012 09:49:15 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 09:49:15 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 09:49:15 +0000
Message-Id: <50B5EC6202000078000AC112@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 09:50:10 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
In-Reply-To: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part1120F942.1__="
Cc: xiantao.zhang@intel.com
Subject: [Xen-devel] [PATCH,
	RFC 3/7] VT-d: adjust context map/unmap parameters
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part1120F942.1__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

... to use a (struct pci_dev *, devfn) pair.

--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -79,7 +79,7 @@ void free_pgtable_maddr(u64 maddr);
 void *map_vtd_domain_page(u64 maddr);
 void unmap_vtd_domain_page(void *va);
 int domain_context_mapping_one(struct domain *domain, struct iommu =
*iommu,
-                               u8 bus, u8 devfn);
+                               u8 bus, u8 devfn, const struct pci_dev *);
 int domain_context_unmap_one(struct domain *domain, struct iommu *iommu,
                              u8 bus, u8 devfn);
=20
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1275,7 +1275,7 @@ static void __init intel_iommu_dom0_init
 int domain_context_mapping_one(
     struct domain *domain,
     struct iommu *iommu,
-    u8 bus, u8 devfn)
+    u8 bus, u8 devfn, const struct pci_dev *pdev)
 {
     struct hvm_iommu *hd =3D domain_hvm_iommu(domain);
     struct context_entry *context, *context_entries;
@@ -1292,11 +1292,9 @@ int domain_context_mapping_one(
     if ( context_present(*context) )
     {
         int res =3D 0;
-        struct pci_dev *pdev =3D NULL;
=20
-        /* First try to get domain ownership from device structure.  If =
that's
+        /* Try to get domain ownership from device structure.  If that's
          * not available, try to read it from the context itself. */
-        pdev =3D pci_get_pdev(seg, bus, devfn);
         if ( pdev )
         {
             if ( pdev->domain !=3D domain )
@@ -1417,13 +1415,12 @@ int domain_context_mapping_one(
 }
=20
 static int domain_context_mapping(
-    struct domain *domain, u16 seg, u8 bus, u8 devfn)
+    struct domain *domain, u8 devfn, const struct pci_dev *pdev)
 {
     struct acpi_drhd_unit *drhd;
     int ret =3D 0;
     u32 type;
-    u8 secbus;
-    struct pci_dev *pdev =3D pci_get_pdev(seg, bus, devfn);
+    u8 seg =3D pdev->seg, bus =3D pdev->bus, secbus;
=20
     drhd =3D acpi_find_matched_drhd_unit(pdev);
     if ( !drhd )
@@ -1444,8 +1441,9 @@ static int domain_context_mapping(
             dprintk(VTDPREFIX, "d%d:PCIe: map %04x:%02x:%02x.%u\n",
                     domain->domain_id, seg, bus,
                     PCI_SLOT(devfn), PCI_FUNC(devfn));
-        ret =3D domain_context_mapping_one(domain, drhd->iommu, bus, =
devfn);
-        if ( !ret && ats_device(pdev, drhd) > 0 )
+        ret =3D domain_context_mapping_one(domain, drhd->iommu, bus, =
devfn,
+                                         pdev);
+        if ( !ret && devfn =3D=3D pdev->devfn && ats_device(pdev, drhd) > =
0 )
             enable_ats_device(seg, bus, devfn);
=20
         break;
@@ -1456,14 +1454,16 @@ static int domain_context_mapping(
                     domain->domain_id, seg, bus,
                     PCI_SLOT(devfn), PCI_FUNC(devfn));
=20
-        ret =3D domain_context_mapping_one(domain, drhd->iommu, bus, =
devfn);
+        ret =3D domain_context_mapping_one(domain, drhd->iommu, bus, =
devfn,
+                                         pdev);
         if ( ret )
             break;
=20
         if ( find_upstream_bridge(seg, &bus, &devfn, &secbus) < 1 )
             break;
=20
-        ret =3D domain_context_mapping_one(domain, drhd->iommu, bus, =
devfn);
+        ret =3D domain_context_mapping_one(domain, drhd->iommu, bus, =
devfn,
+                                         pci_get_pdev(seg, bus, devfn));
=20
         /*
          * Devices behind PCIe-to-PCI/PCIx bridge may generate different
@@ -1472,7 +1472,8 @@ static int domain_context_mapping(
          */
         if ( !ret && pdev_type(seg, bus, devfn) =3D=3D DEV_TYPE_PCIe2PCI_B=
RIDGE &&
              (secbus !=3D pdev->bus || pdev->devfn !=3D 0) )
-            ret =3D domain_context_mapping_one(domain, drhd->iommu, =
secbus, 0);
+            ret =3D domain_context_mapping_one(domain, drhd->iommu, =
secbus, 0,
+                                             pci_get_pdev(seg, secbus, =
0));
=20
         break;
=20
@@ -1545,18 +1546,15 @@ int domain_context_unmap_one(
 }
=20
 static int domain_context_unmap(
-    struct domain *domain, u16 seg, u8 bus, u8 devfn)
+    struct domain *domain, u8 devfn, const struct pci_dev *pdev)
 {
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
     int ret =3D 0;
     u32 type;
-    u8 tmp_bus, tmp_devfn, secbus;
-    struct pci_dev *pdev =3D pci_get_pdev(seg, bus, devfn);
+    u8 seg =3D pdev->seg, bus =3D pdev->bus, tmp_bus, tmp_devfn, secbus;
     int found =3D 0;
=20
-    BUG_ON(!pdev);
-
     drhd =3D acpi_find_matched_drhd_unit(pdev);
     if ( !drhd )
         return -ENODEV;
@@ -1576,7 +1574,7 @@ static int domain_context_unmap(
                     domain->domain_id, seg, bus,
                     PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret =3D domain_context_unmap_one(domain, iommu, bus, devfn);
-        if ( !ret && ats_device(pdev, drhd) > 0 )
+        if ( !ret && devfn =3D=3D pdev->devfn && ats_device(pdev, drhd) > =
0 )
             disable_ats_device(seg, bus, devfn);
=20
         break;
@@ -1670,11 +1668,11 @@ static int reassign_device_ownership(
     if ( (target !=3D dom0) && !iommu_intremap )
         untrusted_msi =3D 1;
=20
-    ret =3D domain_context_unmap(source, pdev->seg, pdev->bus, devfn);
+    ret =3D domain_context_unmap(source, devfn, pdev);
     if ( ret )
         return ret;
=20
-    ret =3D domain_context_mapping(target, pdev->seg, pdev->bus, devfn);
+    ret =3D domain_context_mapping(target, devfn, pdev);
     if ( ret )
         return ret;
=20
@@ -1884,7 +1882,7 @@ static int intel_iommu_add_device(u8 dev
     if ( !pdev->domain )
         return -EINVAL;
=20
-    ret =3D domain_context_mapping(pdev->domain, pdev->seg, pdev->bus, =
devfn);
+    ret =3D domain_context_mapping(pdev->domain, devfn, pdev);
     if ( ret )
     {
         dprintk(XENLOG_ERR VTDPREFIX, "d%d: context mapping failed\n",
@@ -1944,14 +1942,14 @@ static int intel_iommu_remove_device(u8=20
         }
     }
=20
-    return domain_context_unmap(pdev->domain, pdev->seg, pdev->bus, =
devfn);
+    return domain_context_unmap(pdev->domain, devfn, pdev);
 }
=20
 static int __init setup_dom0_device(u8 devfn, struct pci_dev *pdev)
 {
     int err;
=20
-    err =3D domain_context_mapping(pdev->domain, pdev->seg, pdev->bus, =
devfn);
+    err =3D domain_context_mapping(pdev->domain, devfn, pdev);
     if ( !err && devfn =3D=3D pdev->devfn )
         pci_vtd_quirk(pdev);
     return err;
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -288,7 +288,7 @@ static void map_me_phantom_function(stru
     /* map or unmap ME phantom function */
     if ( map )
         domain_context_mapping_one(domain, drhd->iommu, 0,
-                                   PCI_DEVFN(dev, 7));
+                                   PCI_DEVFN(dev, 7), NULL);
     else
         domain_context_unmap_one(domain, drhd->iommu, 0,
                                  PCI_DEVFN(dev, 7));


--=__Part1120F942.1__=
Content-Type: text/plain; name="VT-d-context-map-params.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="VT-d-context-map-params.patch"

VT-d: adjust context map/unmap parameters=0A=0A... to use a (struct =
pci_dev *, devfn) pair.=0A=0A--- a/xen/drivers/passthrough/vtd/extern.h=0A+=
++ b/xen/drivers/passthrough/vtd/extern.h=0A@@ -79,7 +79,7 @@ void =
free_pgtable_maddr(u64 maddr);=0A void *map_vtd_domain_page(u64 maddr);=0A =
void unmap_vtd_domain_page(void *va);=0A int domain_context_mapping_one(str=
uct domain *domain, struct iommu *iommu,=0A-                               =
u8 bus, u8 devfn);=0A+                               u8 bus, u8 devfn, =
const struct pci_dev *);=0A int domain_context_unmap_one(struct domain =
*domain, struct iommu *iommu,=0A                              u8 bus, u8 =
devfn);=0A =0A--- a/xen/drivers/passthrough/vtd/iommu.c=0A+++ b/xen/drivers=
/passthrough/vtd/iommu.c=0A@@ -1275,7 +1275,7 @@ static void __init =
intel_iommu_dom0_init=0A int domain_context_mapping_one(=0A     struct =
domain *domain,=0A     struct iommu *iommu,=0A-    u8 bus, u8 devfn)=0A+   =
 u8 bus, u8 devfn, const struct pci_dev *pdev)=0A {=0A     struct =
hvm_iommu *hd =3D domain_hvm_iommu(domain);=0A     struct context_entry =
*context, *context_entries;=0A@@ -1292,11 +1292,9 @@ int domain_context_map=
ping_one(=0A     if ( context_present(*context) )=0A     {=0A         int =
res =3D 0;=0A-        struct pci_dev *pdev =3D NULL;=0A =0A-        /* =
First try to get domain ownership from device structure.  If that's=0A+    =
    /* Try to get domain ownership from device structure.  If that's=0A    =
      * not available, try to read it from the context itself. */=0A-      =
  pdev =3D pci_get_pdev(seg, bus, devfn);=0A         if ( pdev )=0A        =
 {=0A             if ( pdev->domain !=3D domain )=0A@@ -1417,13 +1415,12 =
@@ int domain_context_mapping_one(=0A }=0A =0A static int domain_context_ma=
pping(=0A-    struct domain *domain, u16 seg, u8 bus, u8 devfn)=0A+    =
struct domain *domain, u8 devfn, const struct pci_dev *pdev)=0A {=0A     =
struct acpi_drhd_unit *drhd;=0A     int ret =3D 0;=0A     u32 type;=0A-    =
u8 secbus;=0A-    struct pci_dev *pdev =3D pci_get_pdev(seg, bus, =
devfn);=0A+    u8 seg =3D pdev->seg, bus =3D pdev->bus, secbus;=0A =0A     =
drhd =3D acpi_find_matched_drhd_unit(pdev);=0A     if ( !drhd )=0A@@ =
-1444,8 +1441,9 @@ static int domain_context_mapping(=0A             =
dprintk(VTDPREFIX, "d%d:PCIe: map %04x:%02x:%02x.%u\n",=0A                 =
    domain->domain_id, seg, bus,=0A                     PCI_SLOT(devfn), =
PCI_FUNC(devfn));=0A-        ret =3D domain_context_mapping_one(domain, =
drhd->iommu, bus, devfn);=0A-        if ( !ret && ats_device(pdev, drhd) > =
0 )=0A+        ret =3D domain_context_mapping_one(domain, drhd->iommu, =
bus, devfn,=0A+                                         pdev);=0A+        =
if ( !ret && devfn =3D=3D pdev->devfn && ats_device(pdev, drhd) > 0 )=0A   =
          enable_ats_device(seg, bus, devfn);=0A =0A         break;=0A@@ =
-1456,14 +1454,16 @@ static int domain_context_mapping(=0A                 =
    domain->domain_id, seg, bus,=0A                     PCI_SLOT(devfn), =
PCI_FUNC(devfn));=0A =0A-        ret =3D domain_context_mapping_one(domain,=
 drhd->iommu, bus, devfn);=0A+        ret =3D domain_context_mapping_one(do=
main, drhd->iommu, bus, devfn,=0A+                                         =
pdev);=0A         if ( ret )=0A             break;=0A =0A         if ( =
find_upstream_bridge(seg, &bus, &devfn, &secbus) < 1 )=0A             =
break;=0A =0A-        ret =3D domain_context_mapping_one(domain, drhd->iomm=
u, bus, devfn);=0A+        ret =3D domain_context_mapping_one(domain, =
drhd->iommu, bus, devfn,=0A+                                         =
pci_get_pdev(seg, bus, devfn));=0A =0A         /*=0A          * Devices =
behind PCIe-to-PCI/PCIx bridge may generate different=0A@@ -1472,7 +1472,8 =
@@ static int domain_context_mapping(=0A          */=0A         if ( !ret =
&& pdev_type(seg, bus, devfn) =3D=3D DEV_TYPE_PCIe2PCI_BRIDGE &&=0A        =
      (secbus !=3D pdev->bus || pdev->devfn !=3D 0) )=0A-            ret =
=3D domain_context_mapping_one(domain, drhd->iommu, secbus, 0);=0A+        =
    ret =3D domain_context_mapping_one(domain, drhd->iommu, secbus, 0,=0A+ =
                                            pci_get_pdev(seg, secbus, =
0));=0A =0A         break;=0A =0A@@ -1545,18 +1546,15 @@ int domain_context=
_unmap_one(=0A }=0A =0A static int domain_context_unmap(=0A-    struct =
domain *domain, u16 seg, u8 bus, u8 devfn)=0A+    struct domain *domain, =
u8 devfn, const struct pci_dev *pdev)=0A {=0A     struct acpi_drhd_unit =
*drhd;=0A     struct iommu *iommu;=0A     int ret =3D 0;=0A     u32 =
type;=0A-    u8 tmp_bus, tmp_devfn, secbus;=0A-    struct pci_dev *pdev =
=3D pci_get_pdev(seg, bus, devfn);=0A+    u8 seg =3D pdev->seg, bus =3D =
pdev->bus, tmp_bus, tmp_devfn, secbus;=0A     int found =3D 0;=0A =0A-    =
BUG_ON(!pdev);=0A-=0A     drhd =3D acpi_find_matched_drhd_unit(pdev);=0A   =
  if ( !drhd )=0A         return -ENODEV;=0A@@ -1576,7 +1574,7 @@ static =
int domain_context_unmap(=0A                     domain->domain_id, seg, =
bus,=0A                     PCI_SLOT(devfn), PCI_FUNC(devfn));=0A         =
ret =3D domain_context_unmap_one(domain, iommu, bus, devfn);=0A-        if =
( !ret && ats_device(pdev, drhd) > 0 )=0A+        if ( !ret && devfn =
=3D=3D pdev->devfn && ats_device(pdev, drhd) > 0 )=0A             =
disable_ats_device(seg, bus, devfn);=0A =0A         break;=0A@@ -1670,11 =
+1668,11 @@ static int reassign_device_ownership(=0A     if ( (target !=3D =
dom0) && !iommu_intremap )=0A         untrusted_msi =3D 1;=0A =0A-    ret =
=3D domain_context_unmap(source, pdev->seg, pdev->bus, devfn);=0A+    ret =
=3D domain_context_unmap(source, devfn, pdev);=0A     if ( ret )=0A        =
 return ret;=0A =0A-    ret =3D domain_context_mapping(target, pdev->seg, =
pdev->bus, devfn);=0A+    ret =3D domain_context_mapping(target, devfn, =
pdev);=0A     if ( ret )=0A         return ret;=0A =0A@@ -1884,7 +1882,7 =
@@ static int intel_iommu_add_device(u8 dev=0A     if ( !pdev->domain )=0A =
        return -EINVAL;=0A =0A-    ret =3D domain_context_mapping(pdev->dom=
ain, pdev->seg, pdev->bus, devfn);=0A+    ret =3D domain_context_mapping(pd=
ev->domain, devfn, pdev);=0A     if ( ret )=0A     {=0A         dprintk(XEN=
LOG_ERR VTDPREFIX, "d%d: context mapping failed\n",=0A@@ -1944,14 +1942,14 =
@@ static int intel_iommu_remove_device(u8 =0A         }=0A     }=0A =0A-  =
  return domain_context_unmap(pdev->domain, pdev->seg, pdev->bus, =
devfn);=0A+    return domain_context_unmap(pdev->domain, devfn, pdev);=0A =
}=0A =0A static int __init setup_dom0_device(u8 devfn, struct pci_dev =
*pdev)=0A {=0A     int err;=0A =0A-    err =3D domain_context_mapping(pdev-=
>domain, pdev->seg, pdev->bus, devfn);=0A+    err =3D domain_context_mappin=
g(pdev->domain, devfn, pdev);=0A     if ( !err && devfn =3D=3D pdev->devfn =
)=0A         pci_vtd_quirk(pdev);=0A     return err;=0A--- a/xen/drivers/pa=
ssthrough/vtd/quirks.c=0A+++ b/xen/drivers/passthrough/vtd/quirks.c=0A@@ =
-288,7 +288,7 @@ static void map_me_phantom_function(stru=0A     /* map or =
unmap ME phantom function */=0A     if ( map )=0A         domain_context_ma=
pping_one(domain, drhd->iommu, 0,=0A-                                   =
PCI_DEVFN(dev, 7));=0A+                                   PCI_DEVFN(dev, =
7), NULL);=0A     else=0A         domain_context_unmap_one(domain, =
drhd->iommu, 0,=0A                                  PCI_DEVFN(dev, 7));=0A
--=__Part1120F942.1__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part1120F942.1__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 09:49:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 09:49:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdeGe-0008O1-2l; Wed, 28 Nov 2012 09:49:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdeGc-0008No-3H
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 09:49:18 +0000
Received: from [85.158.139.211:27785] by server-1.bemta-5.messagelabs.com id
	64/A0-09311-D1ED5B05; Wed, 28 Nov 2012 09:49:17 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1354096155!18117633!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22705 invoked from network); 28 Nov 2012 09:49:15 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 09:49:15 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 09:49:15 +0000
Message-Id: <50B5EC6202000078000AC112@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 09:50:10 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
In-Reply-To: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part1120F942.1__="
Cc: xiantao.zhang@intel.com
Subject: [Xen-devel] [PATCH,
	RFC 3/7] VT-d: adjust context map/unmap parameters
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part1120F942.1__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

... to use a (struct pci_dev *, devfn) pair.

--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -79,7 +79,7 @@ void free_pgtable_maddr(u64 maddr);
 void *map_vtd_domain_page(u64 maddr);
 void unmap_vtd_domain_page(void *va);
 int domain_context_mapping_one(struct domain *domain, struct iommu =
*iommu,
-                               u8 bus, u8 devfn);
+                               u8 bus, u8 devfn, const struct pci_dev *);
 int domain_context_unmap_one(struct domain *domain, struct iommu *iommu,
                              u8 bus, u8 devfn);
=20
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1275,7 +1275,7 @@ static void __init intel_iommu_dom0_init
 int domain_context_mapping_one(
     struct domain *domain,
     struct iommu *iommu,
-    u8 bus, u8 devfn)
+    u8 bus, u8 devfn, const struct pci_dev *pdev)
 {
     struct hvm_iommu *hd =3D domain_hvm_iommu(domain);
     struct context_entry *context, *context_entries;
@@ -1292,11 +1292,9 @@ int domain_context_mapping_one(
     if ( context_present(*context) )
     {
         int res =3D 0;
-        struct pci_dev *pdev =3D NULL;
=20
-        /* First try to get domain ownership from device structure.  If =
that's
+        /* Try to get domain ownership from device structure.  If that's
          * not available, try to read it from the context itself. */
-        pdev =3D pci_get_pdev(seg, bus, devfn);
         if ( pdev )
         {
             if ( pdev->domain !=3D domain )
@@ -1417,13 +1415,12 @@ int domain_context_mapping_one(
 }
=20
 static int domain_context_mapping(
-    struct domain *domain, u16 seg, u8 bus, u8 devfn)
+    struct domain *domain, u8 devfn, const struct pci_dev *pdev)
 {
     struct acpi_drhd_unit *drhd;
     int ret =3D 0;
     u32 type;
-    u8 secbus;
-    struct pci_dev *pdev =3D pci_get_pdev(seg, bus, devfn);
+    u8 seg =3D pdev->seg, bus =3D pdev->bus, secbus;
=20
     drhd =3D acpi_find_matched_drhd_unit(pdev);
     if ( !drhd )
@@ -1444,8 +1441,9 @@ static int domain_context_mapping(
             dprintk(VTDPREFIX, "d%d:PCIe: map %04x:%02x:%02x.%u\n",
                     domain->domain_id, seg, bus,
                     PCI_SLOT(devfn), PCI_FUNC(devfn));
-        ret =3D domain_context_mapping_one(domain, drhd->iommu, bus, =
devfn);
-        if ( !ret && ats_device(pdev, drhd) > 0 )
+        ret =3D domain_context_mapping_one(domain, drhd->iommu, bus, =
devfn,
+                                         pdev);
+        if ( !ret && devfn =3D=3D pdev->devfn && ats_device(pdev, drhd) > =
0 )
             enable_ats_device(seg, bus, devfn);
=20
         break;
@@ -1456,14 +1454,16 @@ static int domain_context_mapping(
                     domain->domain_id, seg, bus,
                     PCI_SLOT(devfn), PCI_FUNC(devfn));
=20
-        ret =3D domain_context_mapping_one(domain, drhd->iommu, bus, =
devfn);
+        ret =3D domain_context_mapping_one(domain, drhd->iommu, bus, =
devfn,
+                                         pdev);
         if ( ret )
             break;
=20
         if ( find_upstream_bridge(seg, &bus, &devfn, &secbus) < 1 )
             break;
=20
-        ret =3D domain_context_mapping_one(domain, drhd->iommu, bus, =
devfn);
+        ret =3D domain_context_mapping_one(domain, drhd->iommu, bus, =
devfn,
+                                         pci_get_pdev(seg, bus, devfn));
=20
         /*
          * Devices behind PCIe-to-PCI/PCIx bridge may generate different
@@ -1472,7 +1472,8 @@ static int domain_context_mapping(
          */
         if ( !ret && pdev_type(seg, bus, devfn) =3D=3D DEV_TYPE_PCIe2PCI_B=
RIDGE &&
              (secbus !=3D pdev->bus || pdev->devfn !=3D 0) )
-            ret =3D domain_context_mapping_one(domain, drhd->iommu, =
secbus, 0);
+            ret =3D domain_context_mapping_one(domain, drhd->iommu, =
secbus, 0,
+                                             pci_get_pdev(seg, secbus, =
0));
=20
         break;
=20
@@ -1545,18 +1546,15 @@ int domain_context_unmap_one(
 }
=20
 static int domain_context_unmap(
-    struct domain *domain, u16 seg, u8 bus, u8 devfn)
+    struct domain *domain, u8 devfn, const struct pci_dev *pdev)
 {
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
     int ret =3D 0;
     u32 type;
-    u8 tmp_bus, tmp_devfn, secbus;
-    struct pci_dev *pdev =3D pci_get_pdev(seg, bus, devfn);
+    u8 seg =3D pdev->seg, bus =3D pdev->bus, tmp_bus, tmp_devfn, secbus;
     int found =3D 0;
=20
-    BUG_ON(!pdev);
-
     drhd =3D acpi_find_matched_drhd_unit(pdev);
     if ( !drhd )
         return -ENODEV;
@@ -1576,7 +1574,7 @@ static int domain_context_unmap(
                     domain->domain_id, seg, bus,
                     PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret =3D domain_context_unmap_one(domain, iommu, bus, devfn);
-        if ( !ret && ats_device(pdev, drhd) > 0 )
+        if ( !ret && devfn =3D=3D pdev->devfn && ats_device(pdev, drhd) > =
0 )
             disable_ats_device(seg, bus, devfn);
=20
         break;
@@ -1670,11 +1668,11 @@ static int reassign_device_ownership(
     if ( (target !=3D dom0) && !iommu_intremap )
         untrusted_msi =3D 1;
=20
-    ret =3D domain_context_unmap(source, pdev->seg, pdev->bus, devfn);
+    ret =3D domain_context_unmap(source, devfn, pdev);
     if ( ret )
         return ret;
=20
-    ret =3D domain_context_mapping(target, pdev->seg, pdev->bus, devfn);
+    ret =3D domain_context_mapping(target, devfn, pdev);
     if ( ret )
         return ret;
=20
@@ -1884,7 +1882,7 @@ static int intel_iommu_add_device(u8 dev
     if ( !pdev->domain )
         return -EINVAL;
=20
-    ret =3D domain_context_mapping(pdev->domain, pdev->seg, pdev->bus, =
devfn);
+    ret =3D domain_context_mapping(pdev->domain, devfn, pdev);
     if ( ret )
     {
         dprintk(XENLOG_ERR VTDPREFIX, "d%d: context mapping failed\n",
@@ -1944,14 +1942,14 @@ static int intel_iommu_remove_device(u8=20
         }
     }
=20
-    return domain_context_unmap(pdev->domain, pdev->seg, pdev->bus, =
devfn);
+    return domain_context_unmap(pdev->domain, devfn, pdev);
 }
=20
 static int __init setup_dom0_device(u8 devfn, struct pci_dev *pdev)
 {
     int err;
=20
-    err =3D domain_context_mapping(pdev->domain, pdev->seg, pdev->bus, =
devfn);
+    err =3D domain_context_mapping(pdev->domain, devfn, pdev);
     if ( !err && devfn =3D=3D pdev->devfn )
         pci_vtd_quirk(pdev);
     return err;
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -288,7 +288,7 @@ static void map_me_phantom_function(stru
     /* map or unmap ME phantom function */
     if ( map )
         domain_context_mapping_one(domain, drhd->iommu, 0,
-                                   PCI_DEVFN(dev, 7));
+                                   PCI_DEVFN(dev, 7), NULL);
     else
         domain_context_unmap_one(domain, drhd->iommu, 0,
                                  PCI_DEVFN(dev, 7));


--=__Part1120F942.1__=
Content-Type: text/plain; name="VT-d-context-map-params.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="VT-d-context-map-params.patch"

VT-d: adjust context map/unmap parameters=0A=0A... to use a (struct =
pci_dev *, devfn) pair.=0A=0A--- a/xen/drivers/passthrough/vtd/extern.h=0A+=
++ b/xen/drivers/passthrough/vtd/extern.h=0A@@ -79,7 +79,7 @@ void =
free_pgtable_maddr(u64 maddr);=0A void *map_vtd_domain_page(u64 maddr);=0A =
void unmap_vtd_domain_page(void *va);=0A int domain_context_mapping_one(str=
uct domain *domain, struct iommu *iommu,=0A-                               =
u8 bus, u8 devfn);=0A+                               u8 bus, u8 devfn, =
const struct pci_dev *);=0A int domain_context_unmap_one(struct domain =
*domain, struct iommu *iommu,=0A                              u8 bus, u8 =
devfn);=0A =0A--- a/xen/drivers/passthrough/vtd/iommu.c=0A+++ b/xen/drivers=
/passthrough/vtd/iommu.c=0A@@ -1275,7 +1275,7 @@ static void __init =
intel_iommu_dom0_init=0A int domain_context_mapping_one(=0A     struct =
domain *domain,=0A     struct iommu *iommu,=0A-    u8 bus, u8 devfn)=0A+   =
 u8 bus, u8 devfn, const struct pci_dev *pdev)=0A {=0A     struct =
hvm_iommu *hd =3D domain_hvm_iommu(domain);=0A     struct context_entry =
*context, *context_entries;=0A@@ -1292,11 +1292,9 @@ int domain_context_map=
ping_one(=0A     if ( context_present(*context) )=0A     {=0A         int =
res =3D 0;=0A-        struct pci_dev *pdev =3D NULL;=0A =0A-        /* =
First try to get domain ownership from device structure.  If that's=0A+    =
    /* Try to get domain ownership from device structure.  If that's=0A    =
      * not available, try to read it from the context itself. */=0A-      =
  pdev =3D pci_get_pdev(seg, bus, devfn);=0A         if ( pdev )=0A        =
 {=0A             if ( pdev->domain !=3D domain )=0A@@ -1417,13 +1415,12 =
@@ int domain_context_mapping_one(=0A }=0A =0A static int domain_context_ma=
pping(=0A-    struct domain *domain, u16 seg, u8 bus, u8 devfn)=0A+    =
struct domain *domain, u8 devfn, const struct pci_dev *pdev)=0A {=0A     =
struct acpi_drhd_unit *drhd;=0A     int ret =3D 0;=0A     u32 type;=0A-    =
u8 secbus;=0A-    struct pci_dev *pdev =3D pci_get_pdev(seg, bus, =
devfn);=0A+    u8 seg =3D pdev->seg, bus =3D pdev->bus, secbus;=0A =0A     =
drhd =3D acpi_find_matched_drhd_unit(pdev);=0A     if ( !drhd )=0A@@ =
-1444,8 +1441,9 @@ static int domain_context_mapping(=0A             =
dprintk(VTDPREFIX, "d%d:PCIe: map %04x:%02x:%02x.%u\n",=0A                 =
    domain->domain_id, seg, bus,=0A                     PCI_SLOT(devfn), =
PCI_FUNC(devfn));=0A-        ret =3D domain_context_mapping_one(domain, =
drhd->iommu, bus, devfn);=0A-        if ( !ret && ats_device(pdev, drhd) > =
0 )=0A+        ret =3D domain_context_mapping_one(domain, drhd->iommu, =
bus, devfn,=0A+                                         pdev);=0A+        =
if ( !ret && devfn =3D=3D pdev->devfn && ats_device(pdev, drhd) > 0 )=0A   =
          enable_ats_device(seg, bus, devfn);=0A =0A         break;=0A@@ =
-1456,14 +1454,16 @@ static int domain_context_mapping(=0A                 =
    domain->domain_id, seg, bus,=0A                     PCI_SLOT(devfn), =
PCI_FUNC(devfn));=0A =0A-        ret =3D domain_context_mapping_one(domain,=
 drhd->iommu, bus, devfn);=0A+        ret =3D domain_context_mapping_one(do=
main, drhd->iommu, bus, devfn,=0A+                                         =
pdev);=0A         if ( ret )=0A             break;=0A =0A         if ( =
find_upstream_bridge(seg, &bus, &devfn, &secbus) < 1 )=0A             =
break;=0A =0A-        ret =3D domain_context_mapping_one(domain, drhd->iomm=
u, bus, devfn);=0A+        ret =3D domain_context_mapping_one(domain, =
drhd->iommu, bus, devfn,=0A+                                         =
pci_get_pdev(seg, bus, devfn));=0A =0A         /*=0A          * Devices =
behind PCIe-to-PCI/PCIx bridge may generate different=0A@@ -1472,7 +1472,8 =
@@ static int domain_context_mapping(=0A          */=0A         if ( !ret =
&& pdev_type(seg, bus, devfn) =3D=3D DEV_TYPE_PCIe2PCI_BRIDGE &&=0A        =
      (secbus !=3D pdev->bus || pdev->devfn !=3D 0) )=0A-            ret =
=3D domain_context_mapping_one(domain, drhd->iommu, secbus, 0);=0A+        =
    ret =3D domain_context_mapping_one(domain, drhd->iommu, secbus, 0,=0A+ =
                                            pci_get_pdev(seg, secbus, =
0));=0A =0A         break;=0A =0A@@ -1545,18 +1546,15 @@ int domain_context=
_unmap_one(=0A }=0A =0A static int domain_context_unmap(=0A-    struct =
domain *domain, u16 seg, u8 bus, u8 devfn)=0A+    struct domain *domain, =
u8 devfn, const struct pci_dev *pdev)=0A {=0A     struct acpi_drhd_unit =
*drhd;=0A     struct iommu *iommu;=0A     int ret =3D 0;=0A     u32 =
type;=0A-    u8 tmp_bus, tmp_devfn, secbus;=0A-    struct pci_dev *pdev =
=3D pci_get_pdev(seg, bus, devfn);=0A+    u8 seg =3D pdev->seg, bus =3D =
pdev->bus, tmp_bus, tmp_devfn, secbus;=0A     int found =3D 0;=0A =0A-    =
BUG_ON(!pdev);=0A-=0A     drhd =3D acpi_find_matched_drhd_unit(pdev);=0A   =
  if ( !drhd )=0A         return -ENODEV;=0A@@ -1576,7 +1574,7 @@ static =
int domain_context_unmap(=0A                     domain->domain_id, seg, =
bus,=0A                     PCI_SLOT(devfn), PCI_FUNC(devfn));=0A         =
ret =3D domain_context_unmap_one(domain, iommu, bus, devfn);=0A-        if =
( !ret && ats_device(pdev, drhd) > 0 )=0A+        if ( !ret && devfn =
=3D=3D pdev->devfn && ats_device(pdev, drhd) > 0 )=0A             =
disable_ats_device(seg, bus, devfn);=0A =0A         break;=0A@@ -1670,11 =
+1668,11 @@ static int reassign_device_ownership(=0A     if ( (target !=3D =
dom0) && !iommu_intremap )=0A         untrusted_msi =3D 1;=0A =0A-    ret =
=3D domain_context_unmap(source, pdev->seg, pdev->bus, devfn);=0A+    ret =
=3D domain_context_unmap(source, devfn, pdev);=0A     if ( ret )=0A        =
 return ret;=0A =0A-    ret =3D domain_context_mapping(target, pdev->seg, =
pdev->bus, devfn);=0A+    ret =3D domain_context_mapping(target, devfn, =
pdev);=0A     if ( ret )=0A         return ret;=0A =0A@@ -1884,7 +1882,7 =
@@ static int intel_iommu_add_device(u8 dev=0A     if ( !pdev->domain )=0A =
        return -EINVAL;=0A =0A-    ret =3D domain_context_mapping(pdev->dom=
ain, pdev->seg, pdev->bus, devfn);=0A+    ret =3D domain_context_mapping(pd=
ev->domain, devfn, pdev);=0A     if ( ret )=0A     {=0A         dprintk(XEN=
LOG_ERR VTDPREFIX, "d%d: context mapping failed\n",=0A@@ -1944,14 +1942,14 =
@@ static int intel_iommu_remove_device(u8 =0A         }=0A     }=0A =0A-  =
  return domain_context_unmap(pdev->domain, pdev->seg, pdev->bus, =
devfn);=0A+    return domain_context_unmap(pdev->domain, devfn, pdev);=0A =
}=0A =0A static int __init setup_dom0_device(u8 devfn, struct pci_dev =
*pdev)=0A {=0A     int err;=0A =0A-    err =3D domain_context_mapping(pdev-=
>domain, pdev->seg, pdev->bus, devfn);=0A+    err =3D domain_context_mappin=
g(pdev->domain, devfn, pdev);=0A     if ( !err && devfn =3D=3D pdev->devfn =
)=0A         pci_vtd_quirk(pdev);=0A     return err;=0A--- a/xen/drivers/pa=
ssthrough/vtd/quirks.c=0A+++ b/xen/drivers/passthrough/vtd/quirks.c=0A@@ =
-288,7 +288,7 @@ static void map_me_phantom_function(stru=0A     /* map or =
unmap ME phantom function */=0A     if ( map )=0A         domain_context_ma=
pping_one(domain, drhd->iommu, 0,=0A-                                   =
PCI_DEVFN(dev, 7));=0A+                                   PCI_DEVFN(dev, =
7), NULL);=0A     else=0A         domain_context_unmap_one(domain, =
drhd->iommu, 0,=0A                                  PCI_DEVFN(dev, 7));=0A
--=__Part1120F942.1__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part1120F942.1__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 09:50:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 09:50:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdeHg-00005c-N7; Wed, 28 Nov 2012 09:50:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdeHf-00005M-1b
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 09:50:23 +0000
Received: from [85.158.139.211:63326] by server-8.bemta-5.messagelabs.com id
	D2/A9-06050-E5ED5B05; Wed, 28 Nov 2012 09:50:22 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1354096215!16667630!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19511 invoked from network); 28 Nov 2012 09:50:15 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 09:50:15 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 09:50:15 +0000
Message-Id: <50B5EC9E02000078000AC116@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 09:51:10 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
In-Reply-To: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartCDFC259E.2__="
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>
Subject: [Xen-devel] [PATCH,
	RFC 4/7] AMD IOMMU: adjust flush function parameters
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartCDFC259E.2__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

... to use a (struct pci_dev *, devfn) pair.

--- a/xen/drivers/passthrough/amd/iommu_cmd.c
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c
@@ -287,12 +287,12 @@ void invalidate_iommu_all(struct amd_iom
     send_iommu_command(iommu, cmd);
 }
=20
-void amd_iommu_flush_iotlb(struct pci_dev *pdev,
+void amd_iommu_flush_iotlb(u8 devfn, const struct pci_dev *pdev,
                            uint64_t gaddr, unsigned int order)
 {
     unsigned long flags;
     struct amd_iommu *iommu;
-    unsigned int bdf, req_id, queueid, maxpend;
+    unsigned int req_id, queueid, maxpend;
     struct pci_ats_dev *ats_pdev;
=20
     if ( !ats_enabled )
@@ -305,8 +305,8 @@ void amd_iommu_flush_iotlb(struct pci_de
     if ( !pci_ats_enabled(ats_pdev->seg, ats_pdev->bus, ats_pdev->devfn) =
)
         return;
=20
-    bdf =3D PCI_BDF2(ats_pdev->bus, ats_pdev->devfn);
-    iommu =3D find_iommu_for_device(ats_pdev->seg, bdf);
+    iommu =3D find_iommu_for_device(ats_pdev->seg,
+                                  PCI_BDF2(ats_pdev->bus, ats_pdev->devfn)=
);
=20
     if ( !iommu )
     {
@@ -319,7 +319,7 @@ void amd_iommu_flush_iotlb(struct pci_de
     if ( !iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) )
         return;
=20
-    req_id =3D get_dma_requestor_id(iommu->seg, bdf);
+    req_id =3D get_dma_requestor_id(iommu->seg, PCI_BDF2(ats_pdev->bus, =
devfn));
     queueid =3D req_id;
     maxpend =3D (ats_pdev->ats_queue_depth + 32) & 0xff;
=20
@@ -339,7 +339,7 @@ static void amd_iommu_flush_all_iotlbs(s
         return;
=20
     for_each_pdev( d, pdev )
-        amd_iommu_flush_iotlb(pdev, gaddr, order);
+        amd_iommu_flush_iotlb(pdev->devfn, pdev, gaddr, order);
 }
=20
 /* Flush iommu cache after p2m changes. */
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -138,7 +138,7 @@ static void amd_iommu_setup_domain_devic
         if ( devfn =3D=3D pdev->devfn )
             enable_ats_device(iommu->seg, bus, devfn);
=20
-        amd_iommu_flush_iotlb(pdev, INV_IOMMU_ALL_PAGES_ADDRESS, 0);
+        amd_iommu_flush_iotlb(devfn, pdev, INV_IOMMU_ALL_PAGES_ADDRESS, =
0);
     }
 }
=20
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
@@ -78,8 +78,8 @@ void iommu_dte_set_guest_cr3(u32 *dte, u
 void amd_iommu_flush_all_pages(struct domain *d);
 void amd_iommu_flush_pages(struct domain *d, unsigned long gfn,
                            unsigned int order);
-void amd_iommu_flush_iotlb(struct pci_dev *pdev, uint64_t gaddr,
-                           unsigned int order);
+void amd_iommu_flush_iotlb(u8 devfn, const struct pci_dev *pdev,
+                           uint64_t gaddr, unsigned int order);
 void amd_iommu_flush_device(struct amd_iommu *iommu, uint16_t bdf);
 void amd_iommu_flush_intremap(struct amd_iommu *iommu, uint16_t bdf);
 void amd_iommu_flush_all_caches(struct amd_iommu *iommu);



--=__PartCDFC259E.2__=
Content-Type: text/plain; name="AMD-IOMMU-flush-params.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="AMD-IOMMU-flush-params.patch"

AMD IOMMU: adjust flush function parameters=0A=0A... to use a (struct =
pci_dev *, devfn) pair.=0A=0A--- a/xen/drivers/passthrough/amd/iommu_cmd.c=
=0A+++ b/xen/drivers/passthrough/amd/iommu_cmd.c=0A@@ -287,12 +287,12 @@ =
void invalidate_iommu_all(struct amd_iom=0A     send_iommu_command(iommu, =
cmd);=0A }=0A =0A-void amd_iommu_flush_iotlb(struct pci_dev *pdev,=0A+void =
amd_iommu_flush_iotlb(u8 devfn, const struct pci_dev *pdev,=0A             =
               uint64_t gaddr, unsigned int order)=0A {=0A     unsigned =
long flags;=0A     struct amd_iommu *iommu;=0A-    unsigned int bdf, =
req_id, queueid, maxpend;=0A+    unsigned int req_id, queueid, maxpend;=0A =
    struct pci_ats_dev *ats_pdev;=0A =0A     if ( !ats_enabled )=0A@@ =
-305,8 +305,8 @@ void amd_iommu_flush_iotlb(struct pci_de=0A     if ( =
!pci_ats_enabled(ats_pdev->seg, ats_pdev->bus, ats_pdev->devfn) )=0A       =
  return;=0A =0A-    bdf =3D PCI_BDF2(ats_pdev->bus, ats_pdev->devfn);=0A- =
   iommu =3D find_iommu_for_device(ats_pdev->seg, bdf);=0A+    iommu =3D =
find_iommu_for_device(ats_pdev->seg,=0A+                                  =
PCI_BDF2(ats_pdev->bus, ats_pdev->devfn));=0A =0A     if ( !iommu )=0A     =
{=0A@@ -319,7 +319,7 @@ void amd_iommu_flush_iotlb(struct pci_de=0A     if =
( !iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) )=0A         return;=0A =0A-  =
  req_id =3D get_dma_requestor_id(iommu->seg, bdf);=0A+    req_id =3D =
get_dma_requestor_id(iommu->seg, PCI_BDF2(ats_pdev->bus, devfn));=0A     =
queueid =3D req_id;=0A     maxpend =3D (ats_pdev->ats_queue_depth + 32) & =
0xff;=0A =0A@@ -339,7 +339,7 @@ static void amd_iommu_flush_all_iotlbs(s=0A=
         return;=0A =0A     for_each_pdev( d, pdev )=0A-        amd_iommu_f=
lush_iotlb(pdev, gaddr, order);=0A+        amd_iommu_flush_iotlb(pdev->devf=
n, pdev, gaddr, order);=0A }=0A =0A /* Flush iommu cache after p2m =
changes. */=0A--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c=0A+++ =
b/xen/drivers/passthrough/amd/pci_amd_iommu.c=0A@@ -138,7 +138,7 @@ static =
void amd_iommu_setup_domain_devic=0A         if ( devfn =3D=3D pdev->devfn =
)=0A             enable_ats_device(iommu->seg, bus, devfn);=0A =0A-        =
amd_iommu_flush_iotlb(pdev, INV_IOMMU_ALL_PAGES_ADDRESS, 0);=0A+        =
amd_iommu_flush_iotlb(devfn, pdev, INV_IOMMU_ALL_PAGES_ADDRESS, 0);=0A     =
}=0A }=0A =0A--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h=0A+++ =
b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h=0A@@ -78,8 +78,8 @@ void =
iommu_dte_set_guest_cr3(u32 *dte, u=0A void amd_iommu_flush_all_pages(struc=
t domain *d);=0A void amd_iommu_flush_pages(struct domain *d, unsigned =
long gfn,=0A                            unsigned int order);=0A-void =
amd_iommu_flush_iotlb(struct pci_dev *pdev, uint64_t gaddr,=0A-            =
               unsigned int order);=0A+void amd_iommu_flush_iotlb(u8 =
devfn, const struct pci_dev *pdev,=0A+                           uint64_t =
gaddr, unsigned int order);=0A void amd_iommu_flush_device(struct =
amd_iommu *iommu, uint16_t bdf);=0A void amd_iommu_flush_intremap(struct =
amd_iommu *iommu, uint16_t bdf);=0A void amd_iommu_flush_all_caches(struct =
amd_iommu *iommu);=0A
--=__PartCDFC259E.2__=
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.xen.org
http://lists.xen.org/xen-devel

--=__PartCDFC259E.2__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 09:50:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 09:50:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdeHg-00005c-N7; Wed, 28 Nov 2012 09:50:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdeHf-00005M-1b
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 09:50:23 +0000
Received: from [85.158.139.211:63326] by server-8.bemta-5.messagelabs.com id
	D2/A9-06050-E5ED5B05; Wed, 28 Nov 2012 09:50:22 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1354096215!16667630!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19511 invoked from network); 28 Nov 2012 09:50:15 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 09:50:15 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 09:50:15 +0000
Message-Id: <50B5EC9E02000078000AC116@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 09:51:10 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
In-Reply-To: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartCDFC259E.2__="
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>
Subject: [Xen-devel] [PATCH,
	RFC 4/7] AMD IOMMU: adjust flush function parameters
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartCDFC259E.2__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

... to use a (struct pci_dev *, devfn) pair.

--- a/xen/drivers/passthrough/amd/iommu_cmd.c
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c
@@ -287,12 +287,12 @@ void invalidate_iommu_all(struct amd_iom
     send_iommu_command(iommu, cmd);
 }
=20
-void amd_iommu_flush_iotlb(struct pci_dev *pdev,
+void amd_iommu_flush_iotlb(u8 devfn, const struct pci_dev *pdev,
                            uint64_t gaddr, unsigned int order)
 {
     unsigned long flags;
     struct amd_iommu *iommu;
-    unsigned int bdf, req_id, queueid, maxpend;
+    unsigned int req_id, queueid, maxpend;
     struct pci_ats_dev *ats_pdev;
=20
     if ( !ats_enabled )
@@ -305,8 +305,8 @@ void amd_iommu_flush_iotlb(struct pci_de
     if ( !pci_ats_enabled(ats_pdev->seg, ats_pdev->bus, ats_pdev->devfn) =
)
         return;
=20
-    bdf =3D PCI_BDF2(ats_pdev->bus, ats_pdev->devfn);
-    iommu =3D find_iommu_for_device(ats_pdev->seg, bdf);
+    iommu =3D find_iommu_for_device(ats_pdev->seg,
+                                  PCI_BDF2(ats_pdev->bus, ats_pdev->devfn)=
);
=20
     if ( !iommu )
     {
@@ -319,7 +319,7 @@ void amd_iommu_flush_iotlb(struct pci_de
     if ( !iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) )
         return;
=20
-    req_id =3D get_dma_requestor_id(iommu->seg, bdf);
+    req_id =3D get_dma_requestor_id(iommu->seg, PCI_BDF2(ats_pdev->bus, =
devfn));
     queueid =3D req_id;
     maxpend =3D (ats_pdev->ats_queue_depth + 32) & 0xff;
=20
@@ -339,7 +339,7 @@ static void amd_iommu_flush_all_iotlbs(s
         return;
=20
     for_each_pdev( d, pdev )
-        amd_iommu_flush_iotlb(pdev, gaddr, order);
+        amd_iommu_flush_iotlb(pdev->devfn, pdev, gaddr, order);
 }
=20
 /* Flush iommu cache after p2m changes. */
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -138,7 +138,7 @@ static void amd_iommu_setup_domain_devic
         if ( devfn =3D=3D pdev->devfn )
             enable_ats_device(iommu->seg, bus, devfn);
=20
-        amd_iommu_flush_iotlb(pdev, INV_IOMMU_ALL_PAGES_ADDRESS, 0);
+        amd_iommu_flush_iotlb(devfn, pdev, INV_IOMMU_ALL_PAGES_ADDRESS, =
0);
     }
 }
=20
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
@@ -78,8 +78,8 @@ void iommu_dte_set_guest_cr3(u32 *dte, u
 void amd_iommu_flush_all_pages(struct domain *d);
 void amd_iommu_flush_pages(struct domain *d, unsigned long gfn,
                            unsigned int order);
-void amd_iommu_flush_iotlb(struct pci_dev *pdev, uint64_t gaddr,
-                           unsigned int order);
+void amd_iommu_flush_iotlb(u8 devfn, const struct pci_dev *pdev,
+                           uint64_t gaddr, unsigned int order);
 void amd_iommu_flush_device(struct amd_iommu *iommu, uint16_t bdf);
 void amd_iommu_flush_intremap(struct amd_iommu *iommu, uint16_t bdf);
 void amd_iommu_flush_all_caches(struct amd_iommu *iommu);



--=__PartCDFC259E.2__=
Content-Type: text/plain; name="AMD-IOMMU-flush-params.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="AMD-IOMMU-flush-params.patch"

AMD IOMMU: adjust flush function parameters=0A=0A... to use a (struct =
pci_dev *, devfn) pair.=0A=0A--- a/xen/drivers/passthrough/amd/iommu_cmd.c=
=0A+++ b/xen/drivers/passthrough/amd/iommu_cmd.c=0A@@ -287,12 +287,12 @@ =
void invalidate_iommu_all(struct amd_iom=0A     send_iommu_command(iommu, =
cmd);=0A }=0A =0A-void amd_iommu_flush_iotlb(struct pci_dev *pdev,=0A+void =
amd_iommu_flush_iotlb(u8 devfn, const struct pci_dev *pdev,=0A             =
               uint64_t gaddr, unsigned int order)=0A {=0A     unsigned =
long flags;=0A     struct amd_iommu *iommu;=0A-    unsigned int bdf, =
req_id, queueid, maxpend;=0A+    unsigned int req_id, queueid, maxpend;=0A =
    struct pci_ats_dev *ats_pdev;=0A =0A     if ( !ats_enabled )=0A@@ =
-305,8 +305,8 @@ void amd_iommu_flush_iotlb(struct pci_de=0A     if ( =
!pci_ats_enabled(ats_pdev->seg, ats_pdev->bus, ats_pdev->devfn) )=0A       =
  return;=0A =0A-    bdf =3D PCI_BDF2(ats_pdev->bus, ats_pdev->devfn);=0A- =
   iommu =3D find_iommu_for_device(ats_pdev->seg, bdf);=0A+    iommu =3D =
find_iommu_for_device(ats_pdev->seg,=0A+                                  =
PCI_BDF2(ats_pdev->bus, ats_pdev->devfn));=0A =0A     if ( !iommu )=0A     =
{=0A@@ -319,7 +319,7 @@ void amd_iommu_flush_iotlb(struct pci_de=0A     if =
( !iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) )=0A         return;=0A =0A-  =
  req_id =3D get_dma_requestor_id(iommu->seg, bdf);=0A+    req_id =3D =
get_dma_requestor_id(iommu->seg, PCI_BDF2(ats_pdev->bus, devfn));=0A     =
queueid =3D req_id;=0A     maxpend =3D (ats_pdev->ats_queue_depth + 32) & =
0xff;=0A =0A@@ -339,7 +339,7 @@ static void amd_iommu_flush_all_iotlbs(s=0A=
         return;=0A =0A     for_each_pdev( d, pdev )=0A-        amd_iommu_f=
lush_iotlb(pdev, gaddr, order);=0A+        amd_iommu_flush_iotlb(pdev->devf=
n, pdev, gaddr, order);=0A }=0A =0A /* Flush iommu cache after p2m =
changes. */=0A--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c=0A+++ =
b/xen/drivers/passthrough/amd/pci_amd_iommu.c=0A@@ -138,7 +138,7 @@ static =
void amd_iommu_setup_domain_devic=0A         if ( devfn =3D=3D pdev->devfn =
)=0A             enable_ats_device(iommu->seg, bus, devfn);=0A =0A-        =
amd_iommu_flush_iotlb(pdev, INV_IOMMU_ALL_PAGES_ADDRESS, 0);=0A+        =
amd_iommu_flush_iotlb(devfn, pdev, INV_IOMMU_ALL_PAGES_ADDRESS, 0);=0A     =
}=0A }=0A =0A--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h=0A+++ =
b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h=0A@@ -78,8 +78,8 @@ void =
iommu_dte_set_guest_cr3(u32 *dte, u=0A void amd_iommu_flush_all_pages(struc=
t domain *d);=0A void amd_iommu_flush_pages(struct domain *d, unsigned =
long gfn,=0A                            unsigned int order);=0A-void =
amd_iommu_flush_iotlb(struct pci_dev *pdev, uint64_t gaddr,=0A-            =
               unsigned int order);=0A+void amd_iommu_flush_iotlb(u8 =
devfn, const struct pci_dev *pdev,=0A+                           uint64_t =
gaddr, unsigned int order);=0A void amd_iommu_flush_device(struct =
amd_iommu *iommu, uint16_t bdf);=0A void amd_iommu_flush_intremap(struct =
amd_iommu *iommu, uint16_t bdf);=0A void amd_iommu_flush_all_caches(struct =
amd_iommu *iommu);=0A
--=__PartCDFC259E.2__=
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.xen.org
http://lists.xen.org/xen-devel

--=__PartCDFC259E.2__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 09:51:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 09:51:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdeIM-0000CY-4r; Wed, 28 Nov 2012 09:51:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdeIK-0000C9-2b
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 09:51:04 +0000
Received: from [85.158.139.83:19150] by server-13.bemta-5.messagelabs.com id
	44/E3-27809-78ED5B05; Wed, 28 Nov 2012 09:51:03 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1354096261!24706891!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23406 invoked from network); 28 Nov 2012 09:51:02 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 09:51:02 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 09:51:01 +0000
Message-Id: <50B5ECCB02000078000AC11A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 09:51:55 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
In-Reply-To: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartF8C910AB.0__="
Subject: [Xen-devel] [PATCH,
 RFC 5/7] IOMMU: consolidate pdev_type() and cache its result for a
 given device
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartF8C910AB.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Add an "unknown" device types as well as one for PCI-to-PCIe bridges
(the latter of which other IOMMU code with or without this patch
doesn't appear to handle properly).

Make sure we don't mistake a device for which we can't access its
config space as a legacy PCI device (after all we in fact don't know
how to deal with such a device, and hence shouldn't try to).

--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -142,7 +142,7 @@ static struct pci_dev *alloc_pdev(struct
     spin_lock_init(&pdev->msix_table_lock);
=20
     /* update bus2bridge */
-    switch ( pdev_type(pseg->nr, bus, devfn) )
+    switch ( pdev->type =3D pdev_type(pseg->nr, bus, devfn) )
     {
         u8 sec_bus, sub_bus;
=20
@@ -182,7 +182,7 @@ static struct pci_dev *alloc_pdev(struct
 static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
 {
     /* update bus2bridge */
-    switch ( pdev_type(pseg->nr, pdev->bus, pdev->devfn) )
+    switch ( pdev->type )
     {
         u8 dev, func, sec_bus, sub_bus;
=20
@@ -200,6 +200,9 @@ static void free_pdev(struct pci_seg *ps
                 pseg->bus2bridge[sec_bus] =3D pseg->bus2bridge[pdev->bus];=

             spin_unlock(&pseg->bus2bridge_lock);
             break;
+
+        default:
+            break;
     }
=20
     list_del(&pdev->alldevs_list);
@@ -587,20 +590,30 @@ void pci_release_devices(struct domain *
=20
 #define PCI_CLASS_BRIDGE_PCI     0x0604
=20
-int pdev_type(u16 seg, u8 bus, u8 devfn)
+enum pdev_type pdev_type(u16 seg, u8 bus, u8 devfn)
 {
     u16 class_device, creg;
     u8 d =3D PCI_SLOT(devfn), f =3D PCI_FUNC(devfn);
     int pos =3D pci_find_cap_offset(seg, bus, d, f, PCI_CAP_ID_EXP);
=20
     class_device =3D pci_conf_read16(seg, bus, d, f, PCI_CLASS_DEVICE);
-    if ( class_device =3D=3D PCI_CLASS_BRIDGE_PCI )
+    switch ( class_device )
     {
+    case PCI_CLASS_BRIDGE_PCI:
         if ( !pos )
             return DEV_TYPE_LEGACY_PCI_BRIDGE;
         creg =3D pci_conf_read16(seg, bus, d, f, pos + PCI_EXP_FLAGS);
-        return ((creg & PCI_EXP_FLAGS_TYPE) >> 4) =3D=3D PCI_EXP_TYPE_PCI_=
BRIDGE ?
-            DEV_TYPE_PCIe2PCI_BRIDGE : DEV_TYPE_PCIe_BRIDGE;
+        switch ( (creg & PCI_EXP_FLAGS_TYPE) >> 4 )
+        {
+        case PCI_EXP_TYPE_PCI_BRIDGE:
+            return DEV_TYPE_PCIe2PCI_BRIDGE;
+        case PCI_EXP_TYPE_PCIE_BRIDGE:
+            return DEV_TYPE_PCI2PCIe_BRIDGE;
+        }
+        return DEV_TYPE_PCIe_BRIDGE;
+
+    case 0x0000: case 0xffff:
+        return DEV_TYPE_PCI_UNKNOWN;
     }
=20
     return pos ? DEV_TYPE_PCIe_ENDPOINT : DEV_TYPE_PCI;
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -430,7 +430,6 @@ void io_apic_write_remap_rte(
=20
 static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry =
*ire)
 {
-    int type;
     u16 seg;
     u8 bus, devfn, secbus;
     int ret;
@@ -441,8 +440,7 @@ static void set_msi_source_id(struct pci
     seg =3D pdev->seg;
     bus =3D pdev->bus;
     devfn =3D pdev->devfn;
-    type =3D pdev_type(seg, bus, devfn);
-    switch ( type )
+    switch ( pdev->type )
     {
     case DEV_TYPE_PCIe_BRIDGE:
     case DEV_TYPE_PCIe2PCI_BRIDGE:
@@ -474,7 +472,7 @@ static void set_msi_source_id(struct pci
     default:
         dprintk(XENLOG_WARNING VTDPREFIX,
                 "d%d: unknown(%u): %04x:%02x:%02x.%u\n",
-                pdev->domain->domain_id, type,
+                pdev->domain->domain_id, pdev->type,
                 seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         break;
    }
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1419,7 +1419,6 @@ static int domain_context_mapping(
 {
     struct acpi_drhd_unit *drhd;
     int ret =3D 0;
-    u32 type;
     u8 seg =3D pdev->seg, bus =3D pdev->bus, secbus;
=20
     drhd =3D acpi_find_matched_drhd_unit(pdev);
@@ -1428,8 +1427,7 @@ static int domain_context_mapping(
=20
     ASSERT(spin_is_locked(&pcidevs_lock));
=20
-    type =3D pdev_type(seg, bus, devfn);
-    switch ( type )
+    switch ( pdev->type )
     {
     case DEV_TYPE_PCIe_BRIDGE:
     case DEV_TYPE_PCIe2PCI_BRIDGE:
@@ -1479,7 +1477,7 @@ static int domain_context_mapping(
=20
     default:
         dprintk(XENLOG_ERR VTDPREFIX, "d%d:unknown(%u): %04x:%02x:%02x.%u\=
n",
-                domain->domain_id, type,
+                domain->domain_id, pdev->type,
                 seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret =3D -EINVAL;
         break;
@@ -1551,7 +1549,6 @@ static int domain_context_unmap(
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
     int ret =3D 0;
-    u32 type;
     u8 seg =3D pdev->seg, bus =3D pdev->bus, tmp_bus, tmp_devfn, secbus;
     int found =3D 0;
=20
@@ -1560,8 +1557,7 @@ static int domain_context_unmap(
         return -ENODEV;
     iommu =3D drhd->iommu;
=20
-    type =3D pdev_type(seg, bus, devfn);
-    switch ( type )
+    switch ( pdev->type )
     {
     case DEV_TYPE_PCIe_BRIDGE:
     case DEV_TYPE_PCIe2PCI_BRIDGE:
@@ -1608,7 +1604,7 @@ static int domain_context_unmap(
=20
     default:
         dprintk(XENLOG_ERR VTDPREFIX, "d%d:unknown(%u): %04x:%02x:%02x.%u\=
n",
-                domain->domain_id, type,
+                domain->domain_id, pdev->type,
                 seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret =3D -EINVAL;
         goto out;
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -62,6 +62,17 @@ struct pci_dev {
     const u16 seg;
     const u8 bus;
     const u8 devfn;
+
+    enum pdev_type {
+        DEV_TYPE_PCI_UNKNOWN,
+        DEV_TYPE_PCIe_ENDPOINT,
+        DEV_TYPE_PCIe_BRIDGE,       // PCIe root port, switch
+        DEV_TYPE_PCIe2PCI_BRIDGE,   // PCIe-to-PCI/PCIx bridge
+        DEV_TYPE_PCI2PCIe_BRIDGE,   // PCI/PCIx-to-PCIe bridge
+        DEV_TYPE_LEGACY_PCI_BRIDGE, // Legacy PCI bridge
+        DEV_TYPE_PCI,
+    } type;
+
     struct pci_dev_info info;
     struct arch_pci_dev arch;
     struct {
@@ -83,18 +94,10 @@ struct pci_dev {
=20
 extern spinlock_t pcidevs_lock;
=20
-enum {
-    DEV_TYPE_PCIe_ENDPOINT,
-    DEV_TYPE_PCIe_BRIDGE,       // PCIe root port, switch
-    DEV_TYPE_PCIe2PCI_BRIDGE,   // PCIe-to-PCI/PCIx bridge
-    DEV_TYPE_LEGACY_PCI_BRIDGE, // Legacy PCI bridge
-    DEV_TYPE_PCI,
-};
-
 bool_t pci_known_segment(u16 seg);
 int pci_device_detect(u16 seg, u8 bus, u8 dev, u8 func);
 int scan_pci_devices(void);
-int pdev_type(u16 seg, u8 bus, u8 devfn);
+enum pdev_type pdev_type(u16 seg, u8 bus, u8 devfn);
 int find_upstream_bridge(u16 seg, u8 *bus, u8 *devfn, u8 *secbus);
 struct pci_dev *pci_lock_pdev(int seg, int bus, int devfn);
 struct pci_dev *pci_lock_domain_pdev(
--- a/xen/include/xen/pci_regs.h
+++ b/xen/include/xen/pci_regs.h
@@ -371,6 +371,9 @@
 #define  PCI_EXP_TYPE_UPSTREAM	0x5	/* Upstream Port */
 #define  PCI_EXP_TYPE_DOWNSTREAM 0x6	/* Downstream Port */
 #define  PCI_EXP_TYPE_PCI_BRIDGE 0x7	/* PCI/PCI-X Bridge */
+#define  PCI_EXP_TYPE_PCIE_BRIDGE 0x8	/* PCI/PCI-X to PCIE Bridge */
+#define  PCI_EXP_TYPE_RC_END	0x9	/* Root Complex Integrated =
Endpoint */
+#define  PCI_EXP_TYPE_RC_EC	0xa	/* Root Complex Event Collector */
 #define PCI_EXP_FLAGS_SLOT	0x0100	/* Slot implemented */
 #define PCI_EXP_FLAGS_IRQ	0x3e00	/* Interrupt message number */
 #define PCI_EXP_DEVCAP		4	/* Device capabilities */


--=__PartF8C910AB.0__=
Content-Type: text/plain; name="IOMMU-pdev-type.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="IOMMU-pdev-type.patch"

IOMMU: consolidate pdev_type() and cache its result for a given =
device=0A=0AAdd an "unknown" device types as well as one for PCI-to-PCIe =
bridges=0A(the latter of which other IOMMU code with or without this =
patch=0Adoesn't appear to handle properly).=0A=0AMake sure we don't =
mistake a device for which we can't access its=0Aconfig space as a legacy =
PCI device (after all we in fact don't know=0Ahow to deal with such a =
device, and hence shouldn't try to).=0A=0A--- a/xen/drivers/passthrough/pci=
.c=0A+++ b/xen/drivers/passthrough/pci.c=0A@@ -142,7 +142,7 @@ static =
struct pci_dev *alloc_pdev(struct=0A     spin_lock_init(&pdev->msix_table_l=
ock);=0A =0A     /* update bus2bridge */=0A-    switch ( pdev_type(pseg->nr=
, bus, devfn) )=0A+    switch ( pdev->type =3D pdev_type(pseg->nr, bus, =
devfn) )=0A     {=0A         u8 sec_bus, sub_bus;=0A =0A@@ -182,7 +182,7 =
@@ static struct pci_dev *alloc_pdev(struct=0A static void free_pdev(struct=
 pci_seg *pseg, struct pci_dev *pdev)=0A {=0A     /* update bus2bridge =
*/=0A-    switch ( pdev_type(pseg->nr, pdev->bus, pdev->devfn) )=0A+    =
switch ( pdev->type )=0A     {=0A         u8 dev, func, sec_bus, =
sub_bus;=0A =0A@@ -200,6 +200,9 @@ static void free_pdev(struct pci_seg =
*ps=0A                 pseg->bus2bridge[sec_bus] =3D pseg->bus2bridge[pdev-=
>bus];=0A             spin_unlock(&pseg->bus2bridge_lock);=0A             =
break;=0A+=0A+        default:=0A+            break;=0A     }=0A =0A     =
list_del(&pdev->alldevs_list);=0A@@ -587,20 +590,30 @@ void pci_release_dev=
ices(struct domain *=0A =0A #define PCI_CLASS_BRIDGE_PCI     0x0604=0A =
=0A-int pdev_type(u16 seg, u8 bus, u8 devfn)=0A+enum pdev_type pdev_type(u1=
6 seg, u8 bus, u8 devfn)=0A {=0A     u16 class_device, creg;=0A     u8 d =
=3D PCI_SLOT(devfn), f =3D PCI_FUNC(devfn);=0A     int pos =3D pci_find_cap=
_offset(seg, bus, d, f, PCI_CAP_ID_EXP);=0A =0A     class_device =3D =
pci_conf_read16(seg, bus, d, f, PCI_CLASS_DEVICE);=0A-    if ( class_device=
 =3D=3D PCI_CLASS_BRIDGE_PCI )=0A+    switch ( class_device )=0A     {=0A+ =
   case PCI_CLASS_BRIDGE_PCI:=0A         if ( !pos )=0A             return =
DEV_TYPE_LEGACY_PCI_BRIDGE;=0A         creg =3D pci_conf_read16(seg, bus, =
d, f, pos + PCI_EXP_FLAGS);=0A-        return ((creg & PCI_EXP_FLAGS_TYPE) =
>> 4) =3D=3D PCI_EXP_TYPE_PCI_BRIDGE ?=0A-            DEV_TYPE_PCIe2PCI_BRI=
DGE : DEV_TYPE_PCIe_BRIDGE;=0A+        switch ( (creg & PCI_EXP_FLAGS_TYPE)=
 >> 4 )=0A+        {=0A+        case PCI_EXP_TYPE_PCI_BRIDGE:=0A+          =
  return DEV_TYPE_PCIe2PCI_BRIDGE;=0A+        case PCI_EXP_TYPE_PCIE_BRIDGE=
:=0A+            return DEV_TYPE_PCI2PCIe_BRIDGE;=0A+        }=0A+        =
return DEV_TYPE_PCIe_BRIDGE;=0A+=0A+    case 0x0000: case 0xffff:=0A+      =
  return DEV_TYPE_PCI_UNKNOWN;=0A     }=0A =0A     return pos ? DEV_TYPE_PC=
Ie_ENDPOINT : DEV_TYPE_PCI;=0A--- a/xen/drivers/passthrough/vtd/intremap.c=
=0A+++ b/xen/drivers/passthrough/vtd/intremap.c=0A@@ -430,7 +430,6 @@ void =
io_apic_write_remap_rte(=0A =0A static void set_msi_source_id(struct =
pci_dev *pdev, struct iremap_entry *ire)=0A {=0A-    int type;=0A     u16 =
seg;=0A     u8 bus, devfn, secbus;=0A     int ret;=0A@@ -441,8 +440,7 @@ =
static void set_msi_source_id(struct pci=0A     seg =3D pdev->seg;=0A     =
bus =3D pdev->bus;=0A     devfn =3D pdev->devfn;=0A-    type =3D pdev_type(=
seg, bus, devfn);=0A-    switch ( type )=0A+    switch ( pdev->type )=0A   =
  {=0A     case DEV_TYPE_PCIe_BRIDGE:=0A     case DEV_TYPE_PCIe2PCI_BRIDGE:=
=0A@@ -474,7 +472,7 @@ static void set_msi_source_id(struct pci=0A     =
default:=0A         dprintk(XENLOG_WARNING VTDPREFIX,=0A                 =
"d%d: unknown(%u): %04x:%02x:%02x.%u\n",=0A-                pdev->domain->d=
omain_id, type,=0A+                pdev->domain->domain_id, pdev->type,=0A =
                seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));=0A         =
break;=0A    }=0A--- a/xen/drivers/passthrough/vtd/iommu.c=0A+++ b/xen/driv=
ers/passthrough/vtd/iommu.c=0A@@ -1419,7 +1419,6 @@ static int domain_conte=
xt_mapping(=0A {=0A     struct acpi_drhd_unit *drhd;=0A     int ret =3D =
0;=0A-    u32 type;=0A     u8 seg =3D pdev->seg, bus =3D pdev->bus, =
secbus;=0A =0A     drhd =3D acpi_find_matched_drhd_unit(pdev);=0A@@ =
-1428,8 +1427,7 @@ static int domain_context_mapping(=0A =0A     ASSERT(spi=
n_is_locked(&pcidevs_lock));=0A =0A-    type =3D pdev_type(seg, bus, =
devfn);=0A-    switch ( type )=0A+    switch ( pdev->type )=0A     {=0A    =
 case DEV_TYPE_PCIe_BRIDGE:=0A     case DEV_TYPE_PCIe2PCI_BRIDGE:=0A@@ =
-1479,7 +1477,7 @@ static int domain_context_mapping(=0A =0A     =
default:=0A         dprintk(XENLOG_ERR VTDPREFIX, "d%d:unknown(%u): =
%04x:%02x:%02x.%u\n",=0A-                domain->domain_id, type,=0A+      =
          domain->domain_id, pdev->type,=0A                 seg, bus, =
PCI_SLOT(devfn), PCI_FUNC(devfn));=0A         ret =3D -EINVAL;=0A         =
break;=0A@@ -1551,7 +1549,6 @@ static int domain_context_unmap(=0A     =
struct acpi_drhd_unit *drhd;=0A     struct iommu *iommu;=0A     int ret =
=3D 0;=0A-    u32 type;=0A     u8 seg =3D pdev->seg, bus =3D pdev->bus, =
tmp_bus, tmp_devfn, secbus;=0A     int found =3D 0;=0A =0A@@ -1560,8 =
+1557,7 @@ static int domain_context_unmap(=0A         return -ENODEV;=0A  =
   iommu =3D drhd->iommu;=0A =0A-    type =3D pdev_type(seg, bus, =
devfn);=0A-    switch ( type )=0A+    switch ( pdev->type )=0A     {=0A    =
 case DEV_TYPE_PCIe_BRIDGE:=0A     case DEV_TYPE_PCIe2PCI_BRIDGE:=0A@@ =
-1608,7 +1604,7 @@ static int domain_context_unmap(=0A =0A     default:=0A =
        dprintk(XENLOG_ERR VTDPREFIX, "d%d:unknown(%u): %04x:%02x:%02x.%u\n=
",=0A-                domain->domain_id, type,=0A+                =
domain->domain_id, pdev->type,=0A                 seg, bus, PCI_SLOT(devfn)=
, PCI_FUNC(devfn));=0A         ret =3D -EINVAL;=0A         goto out;=0A--- =
a/xen/include/xen/pci.h=0A+++ b/xen/include/xen/pci.h=0A@@ -62,6 +62,17 @@ =
struct pci_dev {=0A     const u16 seg;=0A     const u8 bus;=0A     const =
u8 devfn;=0A+=0A+    enum pdev_type {=0A+        DEV_TYPE_PCI_UNKNOWN,=0A+ =
       DEV_TYPE_PCIe_ENDPOINT,=0A+        DEV_TYPE_PCIe_BRIDGE,       // =
PCIe root port, switch=0A+        DEV_TYPE_PCIe2PCI_BRIDGE,   // PCIe-to-PC=
I/PCIx bridge=0A+        DEV_TYPE_PCI2PCIe_BRIDGE,   // PCI/PCIx-to-PCIe =
bridge=0A+        DEV_TYPE_LEGACY_PCI_BRIDGE, // Legacy PCI bridge=0A+     =
   DEV_TYPE_PCI,=0A+    } type;=0A+=0A     struct pci_dev_info info;=0A    =
 struct arch_pci_dev arch;=0A     struct {=0A@@ -83,18 +94,10 @@ struct =
pci_dev {=0A =0A extern spinlock_t pcidevs_lock;=0A =0A-enum {=0A-    =
DEV_TYPE_PCIe_ENDPOINT,=0A-    DEV_TYPE_PCIe_BRIDGE,       // PCIe root =
port, switch=0A-    DEV_TYPE_PCIe2PCI_BRIDGE,   // PCIe-to-PCI/PCIx =
bridge=0A-    DEV_TYPE_LEGACY_PCI_BRIDGE, // Legacy PCI bridge=0A-    =
DEV_TYPE_PCI,=0A-};=0A-=0A bool_t pci_known_segment(u16 seg);=0A int =
pci_device_detect(u16 seg, u8 bus, u8 dev, u8 func);=0A int scan_pci_device=
s(void);=0A-int pdev_type(u16 seg, u8 bus, u8 devfn);=0A+enum pdev_type =
pdev_type(u16 seg, u8 bus, u8 devfn);=0A int find_upstream_bridge(u16 seg, =
u8 *bus, u8 *devfn, u8 *secbus);=0A struct pci_dev *pci_lock_pdev(int seg, =
int bus, int devfn);=0A struct pci_dev *pci_lock_domain_pdev(=0A--- =
a/xen/include/xen/pci_regs.h=0A+++ b/xen/include/xen/pci_regs.h=0A@@ =
-371,6 +371,9 @@=0A #define  PCI_EXP_TYPE_UPSTREAM	0x5	/* =
Upstream Port */=0A #define  PCI_EXP_TYPE_DOWNSTREAM 0x6	/* =
Downstream Port */=0A #define  PCI_EXP_TYPE_PCI_BRIDGE 0x7	/* =
PCI/PCI-X Bridge */=0A+#define  PCI_EXP_TYPE_PCIE_BRIDGE 0x8	/* =
PCI/PCI-X to PCIE Bridge */=0A+#define  PCI_EXP_TYPE_RC_END	0x9	/* =
Root Complex Integrated Endpoint */=0A+#define  PCI_EXP_TYPE_RC_EC	=
0xa	/* Root Complex Event Collector */=0A #define PCI_EXP_FLAGS_SLOT	=
0x0100	/* Slot implemented */=0A #define PCI_EXP_FLAGS_IRQ	0x3e00	/* =
Interrupt message number */=0A #define PCI_EXP_DEVCAP		4	/* =
Device capabilities */=0A
--=__PartF8C910AB.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.xen.org
http://lists.xen.org/xen-devel

--=__PartF8C910AB.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 09:51:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 09:51:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdeIM-0000CY-4r; Wed, 28 Nov 2012 09:51:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdeIK-0000C9-2b
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 09:51:04 +0000
Received: from [85.158.139.83:19150] by server-13.bemta-5.messagelabs.com id
	44/E3-27809-78ED5B05; Wed, 28 Nov 2012 09:51:03 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1354096261!24706891!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23406 invoked from network); 28 Nov 2012 09:51:02 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 09:51:02 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 09:51:01 +0000
Message-Id: <50B5ECCB02000078000AC11A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 09:51:55 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
In-Reply-To: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartF8C910AB.0__="
Subject: [Xen-devel] [PATCH,
 RFC 5/7] IOMMU: consolidate pdev_type() and cache its result for a
 given device
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartF8C910AB.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Add an "unknown" device types as well as one for PCI-to-PCIe bridges
(the latter of which other IOMMU code with or without this patch
doesn't appear to handle properly).

Make sure we don't mistake a device for which we can't access its
config space as a legacy PCI device (after all we in fact don't know
how to deal with such a device, and hence shouldn't try to).

--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -142,7 +142,7 @@ static struct pci_dev *alloc_pdev(struct
     spin_lock_init(&pdev->msix_table_lock);
=20
     /* update bus2bridge */
-    switch ( pdev_type(pseg->nr, bus, devfn) )
+    switch ( pdev->type =3D pdev_type(pseg->nr, bus, devfn) )
     {
         u8 sec_bus, sub_bus;
=20
@@ -182,7 +182,7 @@ static struct pci_dev *alloc_pdev(struct
 static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
 {
     /* update bus2bridge */
-    switch ( pdev_type(pseg->nr, pdev->bus, pdev->devfn) )
+    switch ( pdev->type )
     {
         u8 dev, func, sec_bus, sub_bus;
=20
@@ -200,6 +200,9 @@ static void free_pdev(struct pci_seg *ps
                 pseg->bus2bridge[sec_bus] =3D pseg->bus2bridge[pdev->bus];=

             spin_unlock(&pseg->bus2bridge_lock);
             break;
+
+        default:
+            break;
     }
=20
     list_del(&pdev->alldevs_list);
@@ -587,20 +590,30 @@ void pci_release_devices(struct domain *
=20
 #define PCI_CLASS_BRIDGE_PCI     0x0604
=20
-int pdev_type(u16 seg, u8 bus, u8 devfn)
+enum pdev_type pdev_type(u16 seg, u8 bus, u8 devfn)
 {
     u16 class_device, creg;
     u8 d =3D PCI_SLOT(devfn), f =3D PCI_FUNC(devfn);
     int pos =3D pci_find_cap_offset(seg, bus, d, f, PCI_CAP_ID_EXP);
=20
     class_device =3D pci_conf_read16(seg, bus, d, f, PCI_CLASS_DEVICE);
-    if ( class_device =3D=3D PCI_CLASS_BRIDGE_PCI )
+    switch ( class_device )
     {
+    case PCI_CLASS_BRIDGE_PCI:
         if ( !pos )
             return DEV_TYPE_LEGACY_PCI_BRIDGE;
         creg =3D pci_conf_read16(seg, bus, d, f, pos + PCI_EXP_FLAGS);
-        return ((creg & PCI_EXP_FLAGS_TYPE) >> 4) =3D=3D PCI_EXP_TYPE_PCI_=
BRIDGE ?
-            DEV_TYPE_PCIe2PCI_BRIDGE : DEV_TYPE_PCIe_BRIDGE;
+        switch ( (creg & PCI_EXP_FLAGS_TYPE) >> 4 )
+        {
+        case PCI_EXP_TYPE_PCI_BRIDGE:
+            return DEV_TYPE_PCIe2PCI_BRIDGE;
+        case PCI_EXP_TYPE_PCIE_BRIDGE:
+            return DEV_TYPE_PCI2PCIe_BRIDGE;
+        }
+        return DEV_TYPE_PCIe_BRIDGE;
+
+    case 0x0000: case 0xffff:
+        return DEV_TYPE_PCI_UNKNOWN;
     }
=20
     return pos ? DEV_TYPE_PCIe_ENDPOINT : DEV_TYPE_PCI;
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -430,7 +430,6 @@ void io_apic_write_remap_rte(
=20
 static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry =
*ire)
 {
-    int type;
     u16 seg;
     u8 bus, devfn, secbus;
     int ret;
@@ -441,8 +440,7 @@ static void set_msi_source_id(struct pci
     seg =3D pdev->seg;
     bus =3D pdev->bus;
     devfn =3D pdev->devfn;
-    type =3D pdev_type(seg, bus, devfn);
-    switch ( type )
+    switch ( pdev->type )
     {
     case DEV_TYPE_PCIe_BRIDGE:
     case DEV_TYPE_PCIe2PCI_BRIDGE:
@@ -474,7 +472,7 @@ static void set_msi_source_id(struct pci
     default:
         dprintk(XENLOG_WARNING VTDPREFIX,
                 "d%d: unknown(%u): %04x:%02x:%02x.%u\n",
-                pdev->domain->domain_id, type,
+                pdev->domain->domain_id, pdev->type,
                 seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         break;
    }
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1419,7 +1419,6 @@ static int domain_context_mapping(
 {
     struct acpi_drhd_unit *drhd;
     int ret =3D 0;
-    u32 type;
     u8 seg =3D pdev->seg, bus =3D pdev->bus, secbus;
=20
     drhd =3D acpi_find_matched_drhd_unit(pdev);
@@ -1428,8 +1427,7 @@ static int domain_context_mapping(
=20
     ASSERT(spin_is_locked(&pcidevs_lock));
=20
-    type =3D pdev_type(seg, bus, devfn);
-    switch ( type )
+    switch ( pdev->type )
     {
     case DEV_TYPE_PCIe_BRIDGE:
     case DEV_TYPE_PCIe2PCI_BRIDGE:
@@ -1479,7 +1477,7 @@ static int domain_context_mapping(
=20
     default:
         dprintk(XENLOG_ERR VTDPREFIX, "d%d:unknown(%u): %04x:%02x:%02x.%u\=
n",
-                domain->domain_id, type,
+                domain->domain_id, pdev->type,
                 seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret =3D -EINVAL;
         break;
@@ -1551,7 +1549,6 @@ static int domain_context_unmap(
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
     int ret =3D 0;
-    u32 type;
     u8 seg =3D pdev->seg, bus =3D pdev->bus, tmp_bus, tmp_devfn, secbus;
     int found =3D 0;
=20
@@ -1560,8 +1557,7 @@ static int domain_context_unmap(
         return -ENODEV;
     iommu =3D drhd->iommu;
=20
-    type =3D pdev_type(seg, bus, devfn);
-    switch ( type )
+    switch ( pdev->type )
     {
     case DEV_TYPE_PCIe_BRIDGE:
     case DEV_TYPE_PCIe2PCI_BRIDGE:
@@ -1608,7 +1604,7 @@ static int domain_context_unmap(
=20
     default:
         dprintk(XENLOG_ERR VTDPREFIX, "d%d:unknown(%u): %04x:%02x:%02x.%u\=
n",
-                domain->domain_id, type,
+                domain->domain_id, pdev->type,
                 seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret =3D -EINVAL;
         goto out;
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -62,6 +62,17 @@ struct pci_dev {
     const u16 seg;
     const u8 bus;
     const u8 devfn;
+
+    enum pdev_type {
+        DEV_TYPE_PCI_UNKNOWN,
+        DEV_TYPE_PCIe_ENDPOINT,
+        DEV_TYPE_PCIe_BRIDGE,       // PCIe root port, switch
+        DEV_TYPE_PCIe2PCI_BRIDGE,   // PCIe-to-PCI/PCIx bridge
+        DEV_TYPE_PCI2PCIe_BRIDGE,   // PCI/PCIx-to-PCIe bridge
+        DEV_TYPE_LEGACY_PCI_BRIDGE, // Legacy PCI bridge
+        DEV_TYPE_PCI,
+    } type;
+
     struct pci_dev_info info;
     struct arch_pci_dev arch;
     struct {
@@ -83,18 +94,10 @@ struct pci_dev {
=20
 extern spinlock_t pcidevs_lock;
=20
-enum {
-    DEV_TYPE_PCIe_ENDPOINT,
-    DEV_TYPE_PCIe_BRIDGE,       // PCIe root port, switch
-    DEV_TYPE_PCIe2PCI_BRIDGE,   // PCIe-to-PCI/PCIx bridge
-    DEV_TYPE_LEGACY_PCI_BRIDGE, // Legacy PCI bridge
-    DEV_TYPE_PCI,
-};
-
 bool_t pci_known_segment(u16 seg);
 int pci_device_detect(u16 seg, u8 bus, u8 dev, u8 func);
 int scan_pci_devices(void);
-int pdev_type(u16 seg, u8 bus, u8 devfn);
+enum pdev_type pdev_type(u16 seg, u8 bus, u8 devfn);
 int find_upstream_bridge(u16 seg, u8 *bus, u8 *devfn, u8 *secbus);
 struct pci_dev *pci_lock_pdev(int seg, int bus, int devfn);
 struct pci_dev *pci_lock_domain_pdev(
--- a/xen/include/xen/pci_regs.h
+++ b/xen/include/xen/pci_regs.h
@@ -371,6 +371,9 @@
 #define  PCI_EXP_TYPE_UPSTREAM	0x5	/* Upstream Port */
 #define  PCI_EXP_TYPE_DOWNSTREAM 0x6	/* Downstream Port */
 #define  PCI_EXP_TYPE_PCI_BRIDGE 0x7	/* PCI/PCI-X Bridge */
+#define  PCI_EXP_TYPE_PCIE_BRIDGE 0x8	/* PCI/PCI-X to PCIE Bridge */
+#define  PCI_EXP_TYPE_RC_END	0x9	/* Root Complex Integrated =
Endpoint */
+#define  PCI_EXP_TYPE_RC_EC	0xa	/* Root Complex Event Collector */
 #define PCI_EXP_FLAGS_SLOT	0x0100	/* Slot implemented */
 #define PCI_EXP_FLAGS_IRQ	0x3e00	/* Interrupt message number */
 #define PCI_EXP_DEVCAP		4	/* Device capabilities */


--=__PartF8C910AB.0__=
Content-Type: text/plain; name="IOMMU-pdev-type.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="IOMMU-pdev-type.patch"

IOMMU: consolidate pdev_type() and cache its result for a given =
device=0A=0AAdd an "unknown" device types as well as one for PCI-to-PCIe =
bridges=0A(the latter of which other IOMMU code with or without this =
patch=0Adoesn't appear to handle properly).=0A=0AMake sure we don't =
mistake a device for which we can't access its=0Aconfig space as a legacy =
PCI device (after all we in fact don't know=0Ahow to deal with such a =
device, and hence shouldn't try to).=0A=0A--- a/xen/drivers/passthrough/pci=
.c=0A+++ b/xen/drivers/passthrough/pci.c=0A@@ -142,7 +142,7 @@ static =
struct pci_dev *alloc_pdev(struct=0A     spin_lock_init(&pdev->msix_table_l=
ock);=0A =0A     /* update bus2bridge */=0A-    switch ( pdev_type(pseg->nr=
, bus, devfn) )=0A+    switch ( pdev->type =3D pdev_type(pseg->nr, bus, =
devfn) )=0A     {=0A         u8 sec_bus, sub_bus;=0A =0A@@ -182,7 +182,7 =
@@ static struct pci_dev *alloc_pdev(struct=0A static void free_pdev(struct=
 pci_seg *pseg, struct pci_dev *pdev)=0A {=0A     /* update bus2bridge =
*/=0A-    switch ( pdev_type(pseg->nr, pdev->bus, pdev->devfn) )=0A+    =
switch ( pdev->type )=0A     {=0A         u8 dev, func, sec_bus, =
sub_bus;=0A =0A@@ -200,6 +200,9 @@ static void free_pdev(struct pci_seg =
*ps=0A                 pseg->bus2bridge[sec_bus] =3D pseg->bus2bridge[pdev-=
>bus];=0A             spin_unlock(&pseg->bus2bridge_lock);=0A             =
break;=0A+=0A+        default:=0A+            break;=0A     }=0A =0A     =
list_del(&pdev->alldevs_list);=0A@@ -587,20 +590,30 @@ void pci_release_dev=
ices(struct domain *=0A =0A #define PCI_CLASS_BRIDGE_PCI     0x0604=0A =
=0A-int pdev_type(u16 seg, u8 bus, u8 devfn)=0A+enum pdev_type pdev_type(u1=
6 seg, u8 bus, u8 devfn)=0A {=0A     u16 class_device, creg;=0A     u8 d =
=3D PCI_SLOT(devfn), f =3D PCI_FUNC(devfn);=0A     int pos =3D pci_find_cap=
_offset(seg, bus, d, f, PCI_CAP_ID_EXP);=0A =0A     class_device =3D =
pci_conf_read16(seg, bus, d, f, PCI_CLASS_DEVICE);=0A-    if ( class_device=
 =3D=3D PCI_CLASS_BRIDGE_PCI )=0A+    switch ( class_device )=0A     {=0A+ =
   case PCI_CLASS_BRIDGE_PCI:=0A         if ( !pos )=0A             return =
DEV_TYPE_LEGACY_PCI_BRIDGE;=0A         creg =3D pci_conf_read16(seg, bus, =
d, f, pos + PCI_EXP_FLAGS);=0A-        return ((creg & PCI_EXP_FLAGS_TYPE) =
>> 4) =3D=3D PCI_EXP_TYPE_PCI_BRIDGE ?=0A-            DEV_TYPE_PCIe2PCI_BRI=
DGE : DEV_TYPE_PCIe_BRIDGE;=0A+        switch ( (creg & PCI_EXP_FLAGS_TYPE)=
 >> 4 )=0A+        {=0A+        case PCI_EXP_TYPE_PCI_BRIDGE:=0A+          =
  return DEV_TYPE_PCIe2PCI_BRIDGE;=0A+        case PCI_EXP_TYPE_PCIE_BRIDGE=
:=0A+            return DEV_TYPE_PCI2PCIe_BRIDGE;=0A+        }=0A+        =
return DEV_TYPE_PCIe_BRIDGE;=0A+=0A+    case 0x0000: case 0xffff:=0A+      =
  return DEV_TYPE_PCI_UNKNOWN;=0A     }=0A =0A     return pos ? DEV_TYPE_PC=
Ie_ENDPOINT : DEV_TYPE_PCI;=0A--- a/xen/drivers/passthrough/vtd/intremap.c=
=0A+++ b/xen/drivers/passthrough/vtd/intremap.c=0A@@ -430,7 +430,6 @@ void =
io_apic_write_remap_rte(=0A =0A static void set_msi_source_id(struct =
pci_dev *pdev, struct iremap_entry *ire)=0A {=0A-    int type;=0A     u16 =
seg;=0A     u8 bus, devfn, secbus;=0A     int ret;=0A@@ -441,8 +440,7 @@ =
static void set_msi_source_id(struct pci=0A     seg =3D pdev->seg;=0A     =
bus =3D pdev->bus;=0A     devfn =3D pdev->devfn;=0A-    type =3D pdev_type(=
seg, bus, devfn);=0A-    switch ( type )=0A+    switch ( pdev->type )=0A   =
  {=0A     case DEV_TYPE_PCIe_BRIDGE:=0A     case DEV_TYPE_PCIe2PCI_BRIDGE:=
=0A@@ -474,7 +472,7 @@ static void set_msi_source_id(struct pci=0A     =
default:=0A         dprintk(XENLOG_WARNING VTDPREFIX,=0A                 =
"d%d: unknown(%u): %04x:%02x:%02x.%u\n",=0A-                pdev->domain->d=
omain_id, type,=0A+                pdev->domain->domain_id, pdev->type,=0A =
                seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));=0A         =
break;=0A    }=0A--- a/xen/drivers/passthrough/vtd/iommu.c=0A+++ b/xen/driv=
ers/passthrough/vtd/iommu.c=0A@@ -1419,7 +1419,6 @@ static int domain_conte=
xt_mapping(=0A {=0A     struct acpi_drhd_unit *drhd;=0A     int ret =3D =
0;=0A-    u32 type;=0A     u8 seg =3D pdev->seg, bus =3D pdev->bus, =
secbus;=0A =0A     drhd =3D acpi_find_matched_drhd_unit(pdev);=0A@@ =
-1428,8 +1427,7 @@ static int domain_context_mapping(=0A =0A     ASSERT(spi=
n_is_locked(&pcidevs_lock));=0A =0A-    type =3D pdev_type(seg, bus, =
devfn);=0A-    switch ( type )=0A+    switch ( pdev->type )=0A     {=0A    =
 case DEV_TYPE_PCIe_BRIDGE:=0A     case DEV_TYPE_PCIe2PCI_BRIDGE:=0A@@ =
-1479,7 +1477,7 @@ static int domain_context_mapping(=0A =0A     =
default:=0A         dprintk(XENLOG_ERR VTDPREFIX, "d%d:unknown(%u): =
%04x:%02x:%02x.%u\n",=0A-                domain->domain_id, type,=0A+      =
          domain->domain_id, pdev->type,=0A                 seg, bus, =
PCI_SLOT(devfn), PCI_FUNC(devfn));=0A         ret =3D -EINVAL;=0A         =
break;=0A@@ -1551,7 +1549,6 @@ static int domain_context_unmap(=0A     =
struct acpi_drhd_unit *drhd;=0A     struct iommu *iommu;=0A     int ret =
=3D 0;=0A-    u32 type;=0A     u8 seg =3D pdev->seg, bus =3D pdev->bus, =
tmp_bus, tmp_devfn, secbus;=0A     int found =3D 0;=0A =0A@@ -1560,8 =
+1557,7 @@ static int domain_context_unmap(=0A         return -ENODEV;=0A  =
   iommu =3D drhd->iommu;=0A =0A-    type =3D pdev_type(seg, bus, =
devfn);=0A-    switch ( type )=0A+    switch ( pdev->type )=0A     {=0A    =
 case DEV_TYPE_PCIe_BRIDGE:=0A     case DEV_TYPE_PCIe2PCI_BRIDGE:=0A@@ =
-1608,7 +1604,7 @@ static int domain_context_unmap(=0A =0A     default:=0A =
        dprintk(XENLOG_ERR VTDPREFIX, "d%d:unknown(%u): %04x:%02x:%02x.%u\n=
",=0A-                domain->domain_id, type,=0A+                =
domain->domain_id, pdev->type,=0A                 seg, bus, PCI_SLOT(devfn)=
, PCI_FUNC(devfn));=0A         ret =3D -EINVAL;=0A         goto out;=0A--- =
a/xen/include/xen/pci.h=0A+++ b/xen/include/xen/pci.h=0A@@ -62,6 +62,17 @@ =
struct pci_dev {=0A     const u16 seg;=0A     const u8 bus;=0A     const =
u8 devfn;=0A+=0A+    enum pdev_type {=0A+        DEV_TYPE_PCI_UNKNOWN,=0A+ =
       DEV_TYPE_PCIe_ENDPOINT,=0A+        DEV_TYPE_PCIe_BRIDGE,       // =
PCIe root port, switch=0A+        DEV_TYPE_PCIe2PCI_BRIDGE,   // PCIe-to-PC=
I/PCIx bridge=0A+        DEV_TYPE_PCI2PCIe_BRIDGE,   // PCI/PCIx-to-PCIe =
bridge=0A+        DEV_TYPE_LEGACY_PCI_BRIDGE, // Legacy PCI bridge=0A+     =
   DEV_TYPE_PCI,=0A+    } type;=0A+=0A     struct pci_dev_info info;=0A    =
 struct arch_pci_dev arch;=0A     struct {=0A@@ -83,18 +94,10 @@ struct =
pci_dev {=0A =0A extern spinlock_t pcidevs_lock;=0A =0A-enum {=0A-    =
DEV_TYPE_PCIe_ENDPOINT,=0A-    DEV_TYPE_PCIe_BRIDGE,       // PCIe root =
port, switch=0A-    DEV_TYPE_PCIe2PCI_BRIDGE,   // PCIe-to-PCI/PCIx =
bridge=0A-    DEV_TYPE_LEGACY_PCI_BRIDGE, // Legacy PCI bridge=0A-    =
DEV_TYPE_PCI,=0A-};=0A-=0A bool_t pci_known_segment(u16 seg);=0A int =
pci_device_detect(u16 seg, u8 bus, u8 dev, u8 func);=0A int scan_pci_device=
s(void);=0A-int pdev_type(u16 seg, u8 bus, u8 devfn);=0A+enum pdev_type =
pdev_type(u16 seg, u8 bus, u8 devfn);=0A int find_upstream_bridge(u16 seg, =
u8 *bus, u8 *devfn, u8 *secbus);=0A struct pci_dev *pci_lock_pdev(int seg, =
int bus, int devfn);=0A struct pci_dev *pci_lock_domain_pdev(=0A--- =
a/xen/include/xen/pci_regs.h=0A+++ b/xen/include/xen/pci_regs.h=0A@@ =
-371,6 +371,9 @@=0A #define  PCI_EXP_TYPE_UPSTREAM	0x5	/* =
Upstream Port */=0A #define  PCI_EXP_TYPE_DOWNSTREAM 0x6	/* =
Downstream Port */=0A #define  PCI_EXP_TYPE_PCI_BRIDGE 0x7	/* =
PCI/PCI-X Bridge */=0A+#define  PCI_EXP_TYPE_PCIE_BRIDGE 0x8	/* =
PCI/PCI-X to PCIE Bridge */=0A+#define  PCI_EXP_TYPE_RC_END	0x9	/* =
Root Complex Integrated Endpoint */=0A+#define  PCI_EXP_TYPE_RC_EC	=
0xa	/* Root Complex Event Collector */=0A #define PCI_EXP_FLAGS_SLOT	=
0x0100	/* Slot implemented */=0A #define PCI_EXP_FLAGS_IRQ	0x3e00	/* =
Interrupt message number */=0A #define PCI_EXP_DEVCAP		4	/* =
Device capabilities */=0A
--=__PartF8C910AB.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.xen.org
http://lists.xen.org/xen-devel

--=__PartF8C910AB.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 09:51:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 09:51:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdeIw-0000Ju-R5; Wed, 28 Nov 2012 09:51:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdeIv-0000JV-5x
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 09:51:41 +0000
Received: from [85.158.139.83:25115] by server-13.bemta-5.messagelabs.com id
	64/65-27809-CAED5B05; Wed, 28 Nov 2012 09:51:40 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1354096298!27382519!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19619 invoked from network); 28 Nov 2012 09:51:38 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 09:51:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 09:51:38 +0000
Message-Id: <50B5ECF002000078000AC11E@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 09:52:32 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
In-Reply-To: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartA3924BF0.0__="
Subject: [Xen-devel] [PATCH, RFC 6/7] IOMMU: add phantom function support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartA3924BF0.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Apart from generating device context entries for the base function,
all phantom functions also need context entries to be generated for
them.

In order to distinguish different use cases, a variant of
pci_get_pdev() is being introduced that, even when passed a phantom
function number, would return the underlying actual device.

--- a/xen/drivers/passthrough/amd/iommu_cmd.c
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c
@@ -339,7 +339,15 @@ static void amd_iommu_flush_all_iotlbs(s
         return;
=20
     for_each_pdev( d, pdev )
-        amd_iommu_flush_iotlb(pdev->devfn, pdev, gaddr, order);
+    {
+        u8 devfn =3D pdev->devfn;
+
+        do {
+            amd_iommu_flush_iotlb(devfn, pdev, gaddr, order);
+            devfn +=3D pdev->phantom_stride;
+        } while ( devfn !=3D pdev->devfn &&
+                  PCI_SLOT(devfn) =3D=3D PCI_SLOT(pdev->devfn) );
+    }
 }
=20
 /* Flush iommu cache after p2m changes. */
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -667,7 +667,7 @@ void parse_ppr_log_entry(struct amd_iomm
     devfn =3D PCI_DEVFN2(device_id);
=20
     spin_lock(&pcidevs_lock);
-    pdev =3D pci_get_pdev(iommu->seg, bus, devfn);
+    pdev =3D pci_get_real_pdev(iommu->seg, bus, devfn);
     spin_unlock(&pcidevs_lock);
=20
     if ( pdev )
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -598,7 +598,6 @@ static int update_paging_mode(struct dom
         for_each_pdev( d, pdev )
         {
             bdf =3D PCI_BDF2(pdev->bus, pdev->devfn);
-            req_id =3D get_dma_requestor_id(pdev->seg, bdf);
             iommu =3D find_iommu_for_device(pdev->seg, bdf);
             if ( !iommu )
             {
@@ -607,16 +606,21 @@ static int update_paging_mode(struct dom
             }
=20
             spin_lock_irqsave(&iommu->lock, flags);
-            device_entry =3D iommu->dev_table.buffer +
-                           (req_id * IOMMU_DEV_TABLE_ENTRY_SIZE);
-
-            /* valid =3D 0 only works for dom0 passthrough mode */
-            amd_iommu_set_root_page_table((u32 *)device_entry,
-                                          page_to_maddr(hd->root_table),
-                                          hd->domain_id,
-                                          hd->paging_mode, 1);
-
-            amd_iommu_flush_device(iommu, req_id);
+            do {
+                req_id =3D get_dma_requestor_id(pdev->seg, bdf);
+                device_entry =3D iommu->dev_table.buffer +
+                               (req_id * IOMMU_DEV_TABLE_ENTRY_SIZE);
+
+                /* valid =3D 0 only works for dom0 passthrough mode */
+                amd_iommu_set_root_page_table((u32 *)device_entry,
+                                              page_to_maddr(hd->root_table=
),
+                                              hd->domain_id,
+                                              hd->paging_mode, 1);
+
+                amd_iommu_flush_device(iommu, req_id);
+                bdf +=3D pdev->phantom_stride;
+            } while ( PCI_DEVFN2(bdf) !=3D pdev->devfn &&
+                      PCI_SLOT(bdf) =3D=3D PCI_SLOT(pdev->devfn) );
             spin_unlock_irqrestore(&iommu->lock, flags);
         }
=20
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -154,6 +154,8 @@ void __init iommu_dom0_init(struct domai
 int iommu_add_device(struct pci_dev *pdev)
 {
     struct hvm_iommu *hd;
+    int rc;
+    u8 devfn;
=20
     if ( !pdev->domain )
         return -EINVAL;
@@ -164,7 +166,20 @@ int iommu_add_device(struct pci_dev *pde
     if ( !iommu_enabled || !hd->platform_ops )
         return 0;
=20
-    return hd->platform_ops->add_device(pdev->devfn, pdev);
+    rc =3D hd->platform_ops->add_device(pdev->devfn, pdev);
+    if ( rc || !pdev->phantom_stride )
+        return rc;
+
+    for ( devfn =3D pdev->devfn ; ; )
+    {
+        devfn +=3D pdev->phantom_stride;
+        if ( PCI_SLOT(devfn) !=3D PCI_SLOT(pdev->devfn) )
+            return 0;
+        rc =3D hd->platform_ops->add_device(devfn, pdev);
+        if ( rc )
+            printk(XENLOG_WARNING "IOMMU: add %04x:%02x:%02x.%u failed =
(%d)\n",
+                   pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(devfn),=
 rc);
+    }
 }
=20
 int iommu_enable_device(struct pci_dev *pdev)
@@ -187,6 +202,8 @@ int iommu_enable_device(struct pci_dev *
 int iommu_remove_device(struct pci_dev *pdev)
 {
     struct hvm_iommu *hd;
+    u8 devfn;
+
     if ( !pdev->domain )
         return -EINVAL;
=20
@@ -194,6 +211,22 @@ int iommu_remove_device(struct pci_dev *
     if ( !iommu_enabled || !hd->platform_ops )
         return 0;
=20
+    for ( devfn =3D pdev->devfn ; pdev->phantom_stride; )
+    {
+        int rc;
+
+        devfn +=3D pdev->phantom_stride;
+        if ( PCI_SLOT(devfn) !=3D PCI_SLOT(pdev->devfn) )
+            break;
+        rc =3D hd->platform_ops->remove_device(devfn, pdev);
+        if ( !rc )
+            continue;
+
+        printk(XENLOG_ERR "IOMMU: remove %04x:%02x:%02x.%u failed =
(%d)\n",
+               pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(devfn), =
rc);
+        return rc;
+    }
+
     return hd->platform_ops->remove_device(pdev->devfn, pdev);
 }
=20
@@ -241,6 +274,18 @@ static int assign_device(struct domain *
     if ( (rc =3D hd->platform_ops->assign_device(d, devfn, pdev)) )
         goto done;
=20
+    for ( ; pdev->phantom_stride; rc =3D 0 )
+    {
+        devfn +=3D pdev->phantom_stride;
+        if ( PCI_SLOT(devfn) !=3D PCI_SLOT(pdev->devfn) )
+            break;
+        rc =3D hd->platform_ops->assign_device(d, devfn, pdev);
+        if ( rc )
+            printk(XENLOG_G_WARNING "d%d: assign %04x:%02x:%02x.%u failed =
(%d)\n",
+                   d->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn=
),
+                   rc);
+    }
+
     if ( has_arch_pdevs(d) && !need_iommu(d) )
     {
         d->need_iommu =3D 1;
@@ -373,6 +418,21 @@ int deassign_device(struct domain *d, u1
     if ( !pdev )
         return -ENODEV;
=20
+    while ( pdev->phantom_stride )
+    {
+        devfn +=3D pdev->phantom_stride;
+        if ( PCI_SLOT(devfn) !=3D PCI_SLOT(pdev->devfn) )
+            break;
+        ret =3D hd->platform_ops->reassign_device(d, dom0, devfn, pdev);
+        if ( !ret )
+            continue;
+
+        printk(XENLOG_G_ERR "d%d: deassign %04x:%02x:%02x.%u failed =
(%d)\n",
+               d->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), =
ret);
+        return ret;
+    }
+
+    devfn =3D pdev->devfn;
     ret =3D hd->platform_ops->reassign_device(d, dom0, devfn, pdev);
     if ( ret )
     {
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -144,6 +144,8 @@ static struct pci_dev *alloc_pdev(struct
     /* update bus2bridge */
     switch ( pdev->type =3D pdev_type(pseg->nr, bus, devfn) )
     {
+        int pos;
+        u16 cap;
         u8 sec_bus, sub_bus;
=20
         case DEV_TYPE_PCIe_BRIDGE:
@@ -167,6 +169,20 @@ static struct pci_dev *alloc_pdev(struct
             break;
=20
         case DEV_TYPE_PCIe_ENDPOINT:
+            pos =3D pci_find_cap_offset(pseg->nr, bus, PCI_SLOT(devfn),
+                                      PCI_FUNC(devfn), PCI_CAP_ID_EXP);
+            BUG_ON(!pos);
+            cap =3D pci_conf_read16(pseg->nr, bus, PCI_SLOT(devfn),
+                                  PCI_FUNC(devfn), pos + PCI_EXP_DEVCAP);
+            if ( cap & PCI_EXP_DEVCAP_PHANTOM )
+            {
+                pdev->phantom_stride =3D 8 >> MASK_EXTR(cap,
+                                                      PCI_EXP_DEVCAP_PHANT=
OM);
+                if ( PCI_FUNC(devfn) >=3D pdev->phantom_stride )
+                    pdev->phantom_stride =3D 0;
+            }
+            break;
+
         case DEV_TYPE_PCI:
             break;
=20
@@ -290,6 +306,27 @@ struct pci_dev *pci_get_pdev(int seg, in
     return NULL;
 }
=20
+struct pci_dev *pci_get_real_pdev(int seg, int bus, int devfn)
+{
+    struct pci_dev *pdev;
+    int stride;
+
+    if ( seg < 0 || bus < 0 || devfn < 0 )
+        return NULL;
+
+    for ( pdev =3D pci_get_pdev(seg, bus, devfn), stride =3D 4;
+          !pdev && stride; stride >>=3D 1 )
+    {
+        if ( !(devfn & (8 - stride)) )
+            continue;
+        pdev =3D pci_get_pdev(seg, bus, devfn & ~(8 - stride));
+        if ( pdev && stride !=3D pdev->phantom_stride )
+            pdev =3D NULL;
+    }
+
+    return pdev;
+}
+
 struct pci_dev *pci_get_pdev_by_domain(
     struct domain *d, int seg, int bus, int devfn)
 {
@@ -488,8 +525,19 @@ int pci_add_device(u16 seg, u8 bus, u8 d
=20
 out:
     spin_unlock(&pcidevs_lock);
-    printk(XENLOG_DEBUG "PCI add %s %04x:%02x:%02x.%u\n", pdev_type,
-           seg, bus, slot, func);
+    if ( !ret )
+    {
+        printk(XENLOG_DEBUG "PCI add %s %04x:%02x:%02x.%u\n", pdev_type,
+               seg, bus, slot, func);
+        while ( pdev->phantom_stride )
+        {
+            func +=3D pdev->phantom_stride;
+            if ( PCI_SLOT(func) )
+                break;
+            printk(XENLOG_DEBUG "PCI phantom %04x:%02x:%02x.%u\n",
+                   seg, bus, slot, func);
+        }
+    }
     return ret;
 }
=20
@@ -681,7 +729,7 @@ void pci_check_disable_device(u16 seg, u
     u16 cword;
=20
     spin_lock(&pcidevs_lock);
-    pdev =3D pci_get_pdev(seg, bus, devfn);
+    pdev =3D pci_get_real_pdev(seg, bus, devfn);
     if ( pdev )
     {
         if ( now < pdev->fault.time ||
@@ -698,6 +746,7 @@ void pci_check_disable_device(u16 seg, u
=20
     /* Tell the device to stop DMAing; we can't rely on the guest to
      * control it for us. */
+    devfn =3D pdev->devfn;
     cword =3D pci_conf_read16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
                             PCI_COMMAND);
     pci_conf_write16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
@@ -759,6 +808,27 @@ struct setup_dom0 {
     int (*handler)(u8 devfn, struct pci_dev *);
 };
=20
+static void setup_one_dom0_device(const struct setup_dom0 *ctxt,
+                                  struct pci_dev *pdev)
+{
+    u8 devfn =3D pdev->devfn;
+
+    do {
+        int err =3D ctxt->handler(devfn, pdev);
+
+        if ( err )
+        {
+            printk(XENLOG_ERR "setup %04x:%02x:%02x.%u for d%d failed =
(%d)\n",
+                   pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(devfn),=

+                   ctxt->d->domain_id, err);
+            if ( devfn =3D=3D pdev->devfn )
+                return;
+        }
+        devfn +=3D pdev->phantom_stride;
+    } while ( devfn !=3D pdev->devfn &&
+              PCI_SLOT(devfn) =3D=3D PCI_SLOT(pdev->devfn) );
+}
+
 static int __init _setup_dom0_pci_devices(struct pci_seg *pseg, void =
*arg)
 {
     struct setup_dom0 *ctxt =3D arg;
@@ -777,12 +847,12 @@ static int __init _setup_dom0_pci_device
             {
                 pdev->domain =3D ctxt->d;
                 list_add(&pdev->domain_list, &ctxt->d->arch.pdev_list);
-                ctxt->handler(devfn, pdev);
+                setup_one_dom0_device(ctxt, pdev);
             }
             else if ( pdev->domain =3D=3D dom_xen )
             {
                 pdev->domain =3D ctxt->d;
-                ctxt->handler(devfn, pdev);
+                setup_one_dom0_device(ctxt, pdev);
                 pdev->domain =3D dom_xen;
             }
             else if ( pdev->domain !=3D ctxt->d )
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -58,6 +58,9 @@ do {                                   =20
=20
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]) + __must_be_array(x))
=20
+#define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m)))
+#define MASK_INSR(v, m) (((v) * ((m) & -(m))) & (m))
+
 #define reserve_bootmem(_p,_l) ((void)0)
=20
 struct domain;
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -63,6 +63,8 @@ struct pci_dev {
     const u8 bus;
     const u8 devfn;
=20
+    u8 phantom_stride;
+
     enum pdev_type {
         DEV_TYPE_PCI_UNKNOWN,
         DEV_TYPE_PCIe_ENDPOINT,
@@ -114,6 +116,7 @@ int pci_ro_device(int seg, int bus, int=20
 void arch_pci_ro_device(int seg, int bdf);
 int pci_hide_device(int bus, int devfn);
 struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);
+struct pci_dev *pci_get_real_pdev(int seg, int bus, int devfn);
 struct pci_dev *pci_get_pdev_by_domain(
     struct domain *, int seg, int bus, int devfn);
 void pci_check_disable_device(u16 seg, u8 bus, u8 devfn);


--=__PartA3924BF0.0__=
Content-Type: text/plain; name="IOMMU-phantom-dev.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="IOMMU-phantom-dev.patch"

IOMMU: add phantom function support=0A=0AApart from generating device =
context entries for the base function,=0Aall phantom functions also need =
context entries to be generated for=0Athem.=0A=0AIn order to distinguish =
different use cases, a variant of=0Apci_get_pdev() is being introduced =
that, even when passed a phantom=0Afunction number, would return the =
underlying actual device.=0A=0A--- a/xen/drivers/passthrough/amd/iommu_cmd.=
c=0A+++ b/xen/drivers/passthrough/amd/iommu_cmd.c=0A@@ -339,7 +339,15 @@ =
static void amd_iommu_flush_all_iotlbs(s=0A         return;=0A =0A     =
for_each_pdev( d, pdev )=0A-        amd_iommu_flush_iotlb(pdev->devfn, =
pdev, gaddr, order);=0A+    {=0A+        u8 devfn =3D pdev->devfn;=0A+=0A+ =
       do {=0A+            amd_iommu_flush_iotlb(devfn, pdev, gaddr, =
order);=0A+            devfn +=3D pdev->phantom_stride;=0A+        } while =
( devfn !=3D pdev->devfn &&=0A+                  PCI_SLOT(devfn) =3D=3D =
PCI_SLOT(pdev->devfn) );=0A+    }=0A }=0A =0A /* Flush iommu cache after =
p2m changes. */=0A--- a/xen/drivers/passthrough/amd/iommu_init.c=0A+++ =
b/xen/drivers/passthrough/amd/iommu_init.c=0A@@ -667,7 +667,7 @@ void =
parse_ppr_log_entry(struct amd_iomm=0A     devfn =3D PCI_DEVFN2(device_id);=
=0A =0A     spin_lock(&pcidevs_lock);=0A-    pdev =3D pci_get_pdev(iommu->s=
eg, bus, devfn);=0A+    pdev =3D pci_get_real_pdev(iommu->seg, bus, =
devfn);=0A     spin_unlock(&pcidevs_lock);=0A =0A     if ( pdev )=0A--- =
a/xen/drivers/passthrough/amd/iommu_map.c=0A+++ b/xen/drivers/passthrough/a=
md/iommu_map.c=0A@@ -598,7 +598,6 @@ static int update_paging_mode(struct =
dom=0A         for_each_pdev( d, pdev )=0A         {=0A             bdf =
=3D PCI_BDF2(pdev->bus, pdev->devfn);=0A-            req_id =3D get_dma_req=
uestor_id(pdev->seg, bdf);=0A             iommu =3D find_iommu_for_device(p=
dev->seg, bdf);=0A             if ( !iommu )=0A             {=0A@@ -607,16 =
+606,21 @@ static int update_paging_mode(struct dom=0A             }=0A =
=0A             spin_lock_irqsave(&iommu->lock, flags);=0A-            =
device_entry =3D iommu->dev_table.buffer +=0A-                           =
(req_id * IOMMU_DEV_TABLE_ENTRY_SIZE);=0A-=0A-            /* valid =3D 0 =
only works for dom0 passthrough mode */=0A-            amd_iommu_set_root_p=
age_table((u32 *)device_entry,=0A-                                         =
 page_to_maddr(hd->root_table),=0A-                                        =
  hd->domain_id,=0A-                                          hd->paging_mo=
de, 1);=0A-=0A-            amd_iommu_flush_device(iommu, req_id);=0A+      =
      do {=0A+                req_id =3D get_dma_requestor_id(pdev->seg, =
bdf);=0A+                device_entry =3D iommu->dev_table.buffer +=0A+    =
                           (req_id * IOMMU_DEV_TABLE_ENTRY_SIZE);=0A+=0A+  =
              /* valid =3D 0 only works for dom0 passthrough mode */=0A+   =
             amd_iommu_set_root_page_table((u32 *)device_entry,=0A+        =
                                      page_to_maddr(hd->root_table),=0A+   =
                                           hd->domain_id,=0A+              =
                                hd->paging_mode, 1);=0A+=0A+               =
 amd_iommu_flush_device(iommu, req_id);=0A+                bdf +=3D =
pdev->phantom_stride;=0A+            } while ( PCI_DEVFN2(bdf) !=3D =
pdev->devfn &&=0A+                      PCI_SLOT(bdf) =3D=3D PCI_SLOT(pdev-=
>devfn) );=0A             spin_unlock_irqrestore(&iommu->lock, flags);=0A  =
       }=0A =0A--- a/xen/drivers/passthrough/iommu.c=0A+++ b/xen/drivers/pa=
ssthrough/iommu.c=0A@@ -154,6 +154,8 @@ void __init iommu_dom0_init(struct =
domai=0A int iommu_add_device(struct pci_dev *pdev)=0A {=0A     struct =
hvm_iommu *hd;=0A+    int rc;=0A+    u8 devfn;=0A =0A     if ( !pdev->domai=
n )=0A         return -EINVAL;=0A@@ -164,7 +166,20 @@ int iommu_add_device(=
struct pci_dev *pde=0A     if ( !iommu_enabled || !hd->platform_ops )=0A   =
      return 0;=0A =0A-    return hd->platform_ops->add_device(pdev->devfn,=
 pdev);=0A+    rc =3D hd->platform_ops->add_device(pdev->devfn, pdev);=0A+ =
   if ( rc || !pdev->phantom_stride )=0A+        return rc;=0A+=0A+    for =
( devfn =3D pdev->devfn ; ; )=0A+    {=0A+        devfn +=3D pdev->phantom_=
stride;=0A+        if ( PCI_SLOT(devfn) !=3D PCI_SLOT(pdev->devfn) )=0A+   =
         return 0;=0A+        rc =3D hd->platform_ops->add_device(devfn, =
pdev);=0A+        if ( rc )=0A+            printk(XENLOG_WARNING "IOMMU: =
add %04x:%02x:%02x.%u failed (%d)\n",=0A+                   pdev->seg, =
pdev->bus, PCI_SLOT(devfn), PCI_FUNC(devfn), rc);=0A+    }=0A }=0A =0A int =
iommu_enable_device(struct pci_dev *pdev)=0A@@ -187,6 +202,8 @@ int =
iommu_enable_device(struct pci_dev *=0A int iommu_remove_device(struct =
pci_dev *pdev)=0A {=0A     struct hvm_iommu *hd;=0A+    u8 devfn;=0A+=0A   =
  if ( !pdev->domain )=0A         return -EINVAL;=0A =0A@@ -194,6 +211,22 =
@@ int iommu_remove_device(struct pci_dev *=0A     if ( !iommu_enabled || =
!hd->platform_ops )=0A         return 0;=0A =0A+    for ( devfn =3D =
pdev->devfn ; pdev->phantom_stride; )=0A+    {=0A+        int rc;=0A+=0A+  =
      devfn +=3D pdev->phantom_stride;=0A+        if ( PCI_SLOT(devfn) =
!=3D PCI_SLOT(pdev->devfn) )=0A+            break;=0A+        rc =3D =
hd->platform_ops->remove_device(devfn, pdev);=0A+        if ( !rc )=0A+    =
        continue;=0A+=0A+        printk(XENLOG_ERR "IOMMU: remove =
%04x:%02x:%02x.%u failed (%d)\n",=0A+               pdev->seg, pdev->bus, =
PCI_SLOT(devfn), PCI_FUNC(devfn), rc);=0A+        return rc;=0A+    =
}=0A+=0A     return hd->platform_ops->remove_device(pdev->devfn, pdev);=0A =
}=0A =0A@@ -241,6 +274,18 @@ static int assign_device(struct domain *=0A   =
  if ( (rc =3D hd->platform_ops->assign_device(d, devfn, pdev)) )=0A       =
  goto done;=0A =0A+    for ( ; pdev->phantom_stride; rc =3D 0 )=0A+    =
{=0A+        devfn +=3D pdev->phantom_stride;=0A+        if ( PCI_SLOT(devf=
n) !=3D PCI_SLOT(pdev->devfn) )=0A+            break;=0A+        rc =3D =
hd->platform_ops->assign_device(d, devfn, pdev);=0A+        if ( rc )=0A+  =
          printk(XENLOG_G_WARNING "d%d: assign %04x:%02x:%02x.%u failed =
(%d)\n",=0A+                   d->domain_id, seg, bus, PCI_SLOT(devfn), =
PCI_FUNC(devfn),=0A+                   rc);=0A+    }=0A+=0A     if ( =
has_arch_pdevs(d) && !need_iommu(d) )=0A     {=0A         d->need_iommu =
=3D 1;=0A@@ -373,6 +418,21 @@ int deassign_device(struct domain *d, u1=0A  =
   if ( !pdev )=0A         return -ENODEV;=0A =0A+    while ( pdev->phantom=
_stride )=0A+    {=0A+        devfn +=3D pdev->phantom_stride;=0A+        =
if ( PCI_SLOT(devfn) !=3D PCI_SLOT(pdev->devfn) )=0A+            break;=0A+=
        ret =3D hd->platform_ops->reassign_device(d, dom0, devfn, =
pdev);=0A+        if ( !ret )=0A+            continue;=0A+=0A+        =
printk(XENLOG_G_ERR "d%d: deassign %04x:%02x:%02x.%u failed (%d)\n",=0A+   =
            d->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), =
ret);=0A+        return ret;=0A+    }=0A+=0A+    devfn =3D pdev->devfn;=0A =
    ret =3D hd->platform_ops->reassign_device(d, dom0, devfn, pdev);=0A    =
 if ( ret )=0A     {=0A--- a/xen/drivers/passthrough/pci.c=0A+++ b/xen/driv=
ers/passthrough/pci.c=0A@@ -144,6 +144,8 @@ static struct pci_dev =
*alloc_pdev(struct=0A     /* update bus2bridge */=0A     switch ( =
pdev->type =3D pdev_type(pseg->nr, bus, devfn) )=0A     {=0A+        int =
pos;=0A+        u16 cap;=0A         u8 sec_bus, sub_bus;=0A =0A         =
case DEV_TYPE_PCIe_BRIDGE:=0A@@ -167,6 +169,20 @@ static struct pci_dev =
*alloc_pdev(struct=0A             break;=0A =0A         case DEV_TYPE_PCIe_=
ENDPOINT:=0A+            pos =3D pci_find_cap_offset(pseg->nr, bus, =
PCI_SLOT(devfn),=0A+                                      PCI_FUNC(devfn), =
PCI_CAP_ID_EXP);=0A+            BUG_ON(!pos);=0A+            cap =3D =
pci_conf_read16(pseg->nr, bus, PCI_SLOT(devfn),=0A+                        =
          PCI_FUNC(devfn), pos + PCI_EXP_DEVCAP);=0A+            if ( cap =
& PCI_EXP_DEVCAP_PHANTOM )=0A+            {=0A+                pdev->phanto=
m_stride =3D 8 >> MASK_EXTR(cap,=0A+                                       =
               PCI_EXP_DEVCAP_PHANTOM);=0A+                if ( PCI_FUNC(de=
vfn) >=3D pdev->phantom_stride )=0A+                    pdev->phantom_strid=
e =3D 0;=0A+            }=0A+            break;=0A+=0A         case =
DEV_TYPE_PCI:=0A             break;=0A =0A@@ -290,6 +306,27 @@ struct =
pci_dev *pci_get_pdev(int seg, in=0A     return NULL;=0A }=0A =0A+struct =
pci_dev *pci_get_real_pdev(int seg, int bus, int devfn)=0A+{=0A+    struct =
pci_dev *pdev;=0A+    int stride;=0A+=0A+    if ( seg < 0 || bus < 0 || =
devfn < 0 )=0A+        return NULL;=0A+=0A+    for ( pdev =3D pci_get_pdev(=
seg, bus, devfn), stride =3D 4;=0A+          !pdev && stride; stride >>=3D =
1 )=0A+    {=0A+        if ( !(devfn & (8 - stride)) )=0A+            =
continue;=0A+        pdev =3D pci_get_pdev(seg, bus, devfn & ~(8 - =
stride));=0A+        if ( pdev && stride !=3D pdev->phantom_stride )=0A+   =
         pdev =3D NULL;=0A+    }=0A+=0A+    return pdev;=0A+}=0A+=0A =
struct pci_dev *pci_get_pdev_by_domain(=0A     struct domain *d, int seg, =
int bus, int devfn)=0A {=0A@@ -488,8 +525,19 @@ int pci_add_device(u16 =
seg, u8 bus, u8 d=0A =0A out:=0A     spin_unlock(&pcidevs_lock);=0A-    =
printk(XENLOG_DEBUG "PCI add %s %04x:%02x:%02x.%u\n", pdev_type,=0A-       =
    seg, bus, slot, func);=0A+    if ( !ret )=0A+    {=0A+        =
printk(XENLOG_DEBUG "PCI add %s %04x:%02x:%02x.%u\n", pdev_type,=0A+       =
        seg, bus, slot, func);=0A+        while ( pdev->phantom_stride =
)=0A+        {=0A+            func +=3D pdev->phantom_stride;=0A+          =
  if ( PCI_SLOT(func) )=0A+                break;=0A+            printk(XEN=
LOG_DEBUG "PCI phantom %04x:%02x:%02x.%u\n",=0A+                   seg, =
bus, slot, func);=0A+        }=0A+    }=0A     return ret;=0A }=0A =0A@@ =
-681,7 +729,7 @@ void pci_check_disable_device(u16 seg, u=0A     u16 =
cword;=0A =0A     spin_lock(&pcidevs_lock);=0A-    pdev =3D pci_get_pdev(se=
g, bus, devfn);=0A+    pdev =3D pci_get_real_pdev(seg, bus, devfn);=0A     =
if ( pdev )=0A     {=0A         if ( now < pdev->fault.time ||=0A@@ -698,6 =
+746,7 @@ void pci_check_disable_device(u16 seg, u=0A =0A     /* Tell the =
device to stop DMAing; we can't rely on the guest to=0A      * control it =
for us. */=0A+    devfn =3D pdev->devfn;=0A     cword =3D pci_conf_read16(s=
eg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),=0A                             =
PCI_COMMAND);=0A     pci_conf_write16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(d=
evfn),=0A@@ -759,6 +808,27 @@ struct setup_dom0 {=0A     int (*handler)(u8 =
devfn, struct pci_dev *);=0A };=0A =0A+static void setup_one_dom0_device(co=
nst struct setup_dom0 *ctxt,=0A+                                  struct =
pci_dev *pdev)=0A+{=0A+    u8 devfn =3D pdev->devfn;=0A+=0A+    do {=0A+   =
     int err =3D ctxt->handler(devfn, pdev);=0A+=0A+        if ( err )=0A+ =
       {=0A+            printk(XENLOG_ERR "setup %04x:%02x:%02x.%u for d%d =
failed (%d)\n",=0A+                   pdev->seg, pdev->bus, PCI_SLOT(devfn)=
, PCI_FUNC(devfn),=0A+                   ctxt->d->domain_id, err);=0A+     =
       if ( devfn =3D=3D pdev->devfn )=0A+                return;=0A+      =
  }=0A+        devfn +=3D pdev->phantom_stride;=0A+    } while ( devfn =
!=3D pdev->devfn &&=0A+              PCI_SLOT(devfn) =3D=3D PCI_SLOT(pdev->=
devfn) );=0A+}=0A+=0A static int __init _setup_dom0_pci_devices(struct =
pci_seg *pseg, void *arg)=0A {=0A     struct setup_dom0 *ctxt =3D =
arg;=0A@@ -777,12 +847,12 @@ static int __init _setup_dom0_pci_device=0A   =
          {=0A                 pdev->domain =3D ctxt->d;=0A                =
 list_add(&pdev->domain_list, &ctxt->d->arch.pdev_list);=0A-               =
 ctxt->handler(devfn, pdev);=0A+                setup_one_dom0_device(ctxt,=
 pdev);=0A             }=0A             else if ( pdev->domain =3D=3D =
dom_xen )=0A             {=0A                 pdev->domain =3D ctxt->d;=0A-=
                ctxt->handler(devfn, pdev);=0A+                setup_one_do=
m0_device(ctxt, pdev);=0A                 pdev->domain =3D dom_xen;=0A     =
        }=0A             else if ( pdev->domain !=3D ctxt->d )=0A--- =
a/xen/include/xen/lib.h=0A+++ b/xen/include/xen/lib.h=0A@@ -58,6 +58,9 @@ =
do {                                    =0A =0A #define ARRAY_SIZE(x) =
(sizeof(x) / sizeof((x)[0]) + __must_be_array(x))=0A =0A+#define MASK_EXTR(=
v, m) (((v) & (m)) / ((m) & -(m)))=0A+#define MASK_INSR(v, m) (((v) * ((m) =
& -(m))) & (m))=0A+=0A #define reserve_bootmem(_p,_l) ((void)0)=0A =0A =
struct domain;=0A--- a/xen/include/xen/pci.h=0A+++ b/xen/include/xen/pci.h=
=0A@@ -63,6 +63,8 @@ struct pci_dev {=0A     const u8 bus;=0A     const u8 =
devfn;=0A =0A+    u8 phantom_stride;=0A+=0A     enum pdev_type {=0A        =
 DEV_TYPE_PCI_UNKNOWN,=0A         DEV_TYPE_PCIe_ENDPOINT,=0A@@ -114,6 =
+116,7 @@ int pci_ro_device(int seg, int bus, int =0A void arch_pci_ro_devi=
ce(int seg, int bdf);=0A int pci_hide_device(int bus, int devfn);=0A =
struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);=0A+struct =
pci_dev *pci_get_real_pdev(int seg, int bus, int devfn);=0A struct pci_dev =
*pci_get_pdev_by_domain(=0A     struct domain *, int seg, int bus, int =
devfn);=0A void pci_check_disable_device(u16 seg, u8 bus, u8 devfn);=0A
--=__PartA3924BF0.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.xen.org
http://lists.xen.org/xen-devel

--=__PartA3924BF0.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 09:51:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 09:51:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdeIw-0000Ju-R5; Wed, 28 Nov 2012 09:51:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdeIv-0000JV-5x
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 09:51:41 +0000
Received: from [85.158.139.83:25115] by server-13.bemta-5.messagelabs.com id
	64/65-27809-CAED5B05; Wed, 28 Nov 2012 09:51:40 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1354096298!27382519!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19619 invoked from network); 28 Nov 2012 09:51:38 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 09:51:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 09:51:38 +0000
Message-Id: <50B5ECF002000078000AC11E@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 09:52:32 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
In-Reply-To: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartA3924BF0.0__="
Subject: [Xen-devel] [PATCH, RFC 6/7] IOMMU: add phantom function support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartA3924BF0.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Apart from generating device context entries for the base function,
all phantom functions also need context entries to be generated for
them.

In order to distinguish different use cases, a variant of
pci_get_pdev() is being introduced that, even when passed a phantom
function number, would return the underlying actual device.

--- a/xen/drivers/passthrough/amd/iommu_cmd.c
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c
@@ -339,7 +339,15 @@ static void amd_iommu_flush_all_iotlbs(s
         return;
=20
     for_each_pdev( d, pdev )
-        amd_iommu_flush_iotlb(pdev->devfn, pdev, gaddr, order);
+    {
+        u8 devfn =3D pdev->devfn;
+
+        do {
+            amd_iommu_flush_iotlb(devfn, pdev, gaddr, order);
+            devfn +=3D pdev->phantom_stride;
+        } while ( devfn !=3D pdev->devfn &&
+                  PCI_SLOT(devfn) =3D=3D PCI_SLOT(pdev->devfn) );
+    }
 }
=20
 /* Flush iommu cache after p2m changes. */
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -667,7 +667,7 @@ void parse_ppr_log_entry(struct amd_iomm
     devfn =3D PCI_DEVFN2(device_id);
=20
     spin_lock(&pcidevs_lock);
-    pdev =3D pci_get_pdev(iommu->seg, bus, devfn);
+    pdev =3D pci_get_real_pdev(iommu->seg, bus, devfn);
     spin_unlock(&pcidevs_lock);
=20
     if ( pdev )
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -598,7 +598,6 @@ static int update_paging_mode(struct dom
         for_each_pdev( d, pdev )
         {
             bdf =3D PCI_BDF2(pdev->bus, pdev->devfn);
-            req_id =3D get_dma_requestor_id(pdev->seg, bdf);
             iommu =3D find_iommu_for_device(pdev->seg, bdf);
             if ( !iommu )
             {
@@ -607,16 +606,21 @@ static int update_paging_mode(struct dom
             }
=20
             spin_lock_irqsave(&iommu->lock, flags);
-            device_entry =3D iommu->dev_table.buffer +
-                           (req_id * IOMMU_DEV_TABLE_ENTRY_SIZE);
-
-            /* valid =3D 0 only works for dom0 passthrough mode */
-            amd_iommu_set_root_page_table((u32 *)device_entry,
-                                          page_to_maddr(hd->root_table),
-                                          hd->domain_id,
-                                          hd->paging_mode, 1);
-
-            amd_iommu_flush_device(iommu, req_id);
+            do {
+                req_id =3D get_dma_requestor_id(pdev->seg, bdf);
+                device_entry =3D iommu->dev_table.buffer +
+                               (req_id * IOMMU_DEV_TABLE_ENTRY_SIZE);
+
+                /* valid =3D 0 only works for dom0 passthrough mode */
+                amd_iommu_set_root_page_table((u32 *)device_entry,
+                                              page_to_maddr(hd->root_table=
),
+                                              hd->domain_id,
+                                              hd->paging_mode, 1);
+
+                amd_iommu_flush_device(iommu, req_id);
+                bdf +=3D pdev->phantom_stride;
+            } while ( PCI_DEVFN2(bdf) !=3D pdev->devfn &&
+                      PCI_SLOT(bdf) =3D=3D PCI_SLOT(pdev->devfn) );
             spin_unlock_irqrestore(&iommu->lock, flags);
         }
=20
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -154,6 +154,8 @@ void __init iommu_dom0_init(struct domai
 int iommu_add_device(struct pci_dev *pdev)
 {
     struct hvm_iommu *hd;
+    int rc;
+    u8 devfn;
=20
     if ( !pdev->domain )
         return -EINVAL;
@@ -164,7 +166,20 @@ int iommu_add_device(struct pci_dev *pde
     if ( !iommu_enabled || !hd->platform_ops )
         return 0;
=20
-    return hd->platform_ops->add_device(pdev->devfn, pdev);
+    rc =3D hd->platform_ops->add_device(pdev->devfn, pdev);
+    if ( rc || !pdev->phantom_stride )
+        return rc;
+
+    for ( devfn =3D pdev->devfn ; ; )
+    {
+        devfn +=3D pdev->phantom_stride;
+        if ( PCI_SLOT(devfn) !=3D PCI_SLOT(pdev->devfn) )
+            return 0;
+        rc =3D hd->platform_ops->add_device(devfn, pdev);
+        if ( rc )
+            printk(XENLOG_WARNING "IOMMU: add %04x:%02x:%02x.%u failed =
(%d)\n",
+                   pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(devfn),=
 rc);
+    }
 }
=20
 int iommu_enable_device(struct pci_dev *pdev)
@@ -187,6 +202,8 @@ int iommu_enable_device(struct pci_dev *
 int iommu_remove_device(struct pci_dev *pdev)
 {
     struct hvm_iommu *hd;
+    u8 devfn;
+
     if ( !pdev->domain )
         return -EINVAL;
=20
@@ -194,6 +211,22 @@ int iommu_remove_device(struct pci_dev *
     if ( !iommu_enabled || !hd->platform_ops )
         return 0;
=20
+    for ( devfn =3D pdev->devfn ; pdev->phantom_stride; )
+    {
+        int rc;
+
+        devfn +=3D pdev->phantom_stride;
+        if ( PCI_SLOT(devfn) !=3D PCI_SLOT(pdev->devfn) )
+            break;
+        rc =3D hd->platform_ops->remove_device(devfn, pdev);
+        if ( !rc )
+            continue;
+
+        printk(XENLOG_ERR "IOMMU: remove %04x:%02x:%02x.%u failed =
(%d)\n",
+               pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(devfn), =
rc);
+        return rc;
+    }
+
     return hd->platform_ops->remove_device(pdev->devfn, pdev);
 }
=20
@@ -241,6 +274,18 @@ static int assign_device(struct domain *
     if ( (rc =3D hd->platform_ops->assign_device(d, devfn, pdev)) )
         goto done;
=20
+    for ( ; pdev->phantom_stride; rc =3D 0 )
+    {
+        devfn +=3D pdev->phantom_stride;
+        if ( PCI_SLOT(devfn) !=3D PCI_SLOT(pdev->devfn) )
+            break;
+        rc =3D hd->platform_ops->assign_device(d, devfn, pdev);
+        if ( rc )
+            printk(XENLOG_G_WARNING "d%d: assign %04x:%02x:%02x.%u failed =
(%d)\n",
+                   d->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn=
),
+                   rc);
+    }
+
     if ( has_arch_pdevs(d) && !need_iommu(d) )
     {
         d->need_iommu =3D 1;
@@ -373,6 +418,21 @@ int deassign_device(struct domain *d, u1
     if ( !pdev )
         return -ENODEV;
=20
+    while ( pdev->phantom_stride )
+    {
+        devfn +=3D pdev->phantom_stride;
+        if ( PCI_SLOT(devfn) !=3D PCI_SLOT(pdev->devfn) )
+            break;
+        ret =3D hd->platform_ops->reassign_device(d, dom0, devfn, pdev);
+        if ( !ret )
+            continue;
+
+        printk(XENLOG_G_ERR "d%d: deassign %04x:%02x:%02x.%u failed =
(%d)\n",
+               d->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), =
ret);
+        return ret;
+    }
+
+    devfn =3D pdev->devfn;
     ret =3D hd->platform_ops->reassign_device(d, dom0, devfn, pdev);
     if ( ret )
     {
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -144,6 +144,8 @@ static struct pci_dev *alloc_pdev(struct
     /* update bus2bridge */
     switch ( pdev->type =3D pdev_type(pseg->nr, bus, devfn) )
     {
+        int pos;
+        u16 cap;
         u8 sec_bus, sub_bus;
=20
         case DEV_TYPE_PCIe_BRIDGE:
@@ -167,6 +169,20 @@ static struct pci_dev *alloc_pdev(struct
             break;
=20
         case DEV_TYPE_PCIe_ENDPOINT:
+            pos =3D pci_find_cap_offset(pseg->nr, bus, PCI_SLOT(devfn),
+                                      PCI_FUNC(devfn), PCI_CAP_ID_EXP);
+            BUG_ON(!pos);
+            cap =3D pci_conf_read16(pseg->nr, bus, PCI_SLOT(devfn),
+                                  PCI_FUNC(devfn), pos + PCI_EXP_DEVCAP);
+            if ( cap & PCI_EXP_DEVCAP_PHANTOM )
+            {
+                pdev->phantom_stride =3D 8 >> MASK_EXTR(cap,
+                                                      PCI_EXP_DEVCAP_PHANT=
OM);
+                if ( PCI_FUNC(devfn) >=3D pdev->phantom_stride )
+                    pdev->phantom_stride =3D 0;
+            }
+            break;
+
         case DEV_TYPE_PCI:
             break;
=20
@@ -290,6 +306,27 @@ struct pci_dev *pci_get_pdev(int seg, in
     return NULL;
 }
=20
+struct pci_dev *pci_get_real_pdev(int seg, int bus, int devfn)
+{
+    struct pci_dev *pdev;
+    int stride;
+
+    if ( seg < 0 || bus < 0 || devfn < 0 )
+        return NULL;
+
+    for ( pdev =3D pci_get_pdev(seg, bus, devfn), stride =3D 4;
+          !pdev && stride; stride >>=3D 1 )
+    {
+        if ( !(devfn & (8 - stride)) )
+            continue;
+        pdev =3D pci_get_pdev(seg, bus, devfn & ~(8 - stride));
+        if ( pdev && stride !=3D pdev->phantom_stride )
+            pdev =3D NULL;
+    }
+
+    return pdev;
+}
+
 struct pci_dev *pci_get_pdev_by_domain(
     struct domain *d, int seg, int bus, int devfn)
 {
@@ -488,8 +525,19 @@ int pci_add_device(u16 seg, u8 bus, u8 d
=20
 out:
     spin_unlock(&pcidevs_lock);
-    printk(XENLOG_DEBUG "PCI add %s %04x:%02x:%02x.%u\n", pdev_type,
-           seg, bus, slot, func);
+    if ( !ret )
+    {
+        printk(XENLOG_DEBUG "PCI add %s %04x:%02x:%02x.%u\n", pdev_type,
+               seg, bus, slot, func);
+        while ( pdev->phantom_stride )
+        {
+            func +=3D pdev->phantom_stride;
+            if ( PCI_SLOT(func) )
+                break;
+            printk(XENLOG_DEBUG "PCI phantom %04x:%02x:%02x.%u\n",
+                   seg, bus, slot, func);
+        }
+    }
     return ret;
 }
=20
@@ -681,7 +729,7 @@ void pci_check_disable_device(u16 seg, u
     u16 cword;
=20
     spin_lock(&pcidevs_lock);
-    pdev =3D pci_get_pdev(seg, bus, devfn);
+    pdev =3D pci_get_real_pdev(seg, bus, devfn);
     if ( pdev )
     {
         if ( now < pdev->fault.time ||
@@ -698,6 +746,7 @@ void pci_check_disable_device(u16 seg, u
=20
     /* Tell the device to stop DMAing; we can't rely on the guest to
      * control it for us. */
+    devfn =3D pdev->devfn;
     cword =3D pci_conf_read16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
                             PCI_COMMAND);
     pci_conf_write16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
@@ -759,6 +808,27 @@ struct setup_dom0 {
     int (*handler)(u8 devfn, struct pci_dev *);
 };
=20
+static void setup_one_dom0_device(const struct setup_dom0 *ctxt,
+                                  struct pci_dev *pdev)
+{
+    u8 devfn =3D pdev->devfn;
+
+    do {
+        int err =3D ctxt->handler(devfn, pdev);
+
+        if ( err )
+        {
+            printk(XENLOG_ERR "setup %04x:%02x:%02x.%u for d%d failed =
(%d)\n",
+                   pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(devfn),=

+                   ctxt->d->domain_id, err);
+            if ( devfn =3D=3D pdev->devfn )
+                return;
+        }
+        devfn +=3D pdev->phantom_stride;
+    } while ( devfn !=3D pdev->devfn &&
+              PCI_SLOT(devfn) =3D=3D PCI_SLOT(pdev->devfn) );
+}
+
 static int __init _setup_dom0_pci_devices(struct pci_seg *pseg, void =
*arg)
 {
     struct setup_dom0 *ctxt =3D arg;
@@ -777,12 +847,12 @@ static int __init _setup_dom0_pci_device
             {
                 pdev->domain =3D ctxt->d;
                 list_add(&pdev->domain_list, &ctxt->d->arch.pdev_list);
-                ctxt->handler(devfn, pdev);
+                setup_one_dom0_device(ctxt, pdev);
             }
             else if ( pdev->domain =3D=3D dom_xen )
             {
                 pdev->domain =3D ctxt->d;
-                ctxt->handler(devfn, pdev);
+                setup_one_dom0_device(ctxt, pdev);
                 pdev->domain =3D dom_xen;
             }
             else if ( pdev->domain !=3D ctxt->d )
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -58,6 +58,9 @@ do {                                   =20
=20
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]) + __must_be_array(x))
=20
+#define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m)))
+#define MASK_INSR(v, m) (((v) * ((m) & -(m))) & (m))
+
 #define reserve_bootmem(_p,_l) ((void)0)
=20
 struct domain;
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -63,6 +63,8 @@ struct pci_dev {
     const u8 bus;
     const u8 devfn;
=20
+    u8 phantom_stride;
+
     enum pdev_type {
         DEV_TYPE_PCI_UNKNOWN,
         DEV_TYPE_PCIe_ENDPOINT,
@@ -114,6 +116,7 @@ int pci_ro_device(int seg, int bus, int=20
 void arch_pci_ro_device(int seg, int bdf);
 int pci_hide_device(int bus, int devfn);
 struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);
+struct pci_dev *pci_get_real_pdev(int seg, int bus, int devfn);
 struct pci_dev *pci_get_pdev_by_domain(
     struct domain *, int seg, int bus, int devfn);
 void pci_check_disable_device(u16 seg, u8 bus, u8 devfn);


--=__PartA3924BF0.0__=
Content-Type: text/plain; name="IOMMU-phantom-dev.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="IOMMU-phantom-dev.patch"

IOMMU: add phantom function support=0A=0AApart from generating device =
context entries for the base function,=0Aall phantom functions also need =
context entries to be generated for=0Athem.=0A=0AIn order to distinguish =
different use cases, a variant of=0Apci_get_pdev() is being introduced =
that, even when passed a phantom=0Afunction number, would return the =
underlying actual device.=0A=0A--- a/xen/drivers/passthrough/amd/iommu_cmd.=
c=0A+++ b/xen/drivers/passthrough/amd/iommu_cmd.c=0A@@ -339,7 +339,15 @@ =
static void amd_iommu_flush_all_iotlbs(s=0A         return;=0A =0A     =
for_each_pdev( d, pdev )=0A-        amd_iommu_flush_iotlb(pdev->devfn, =
pdev, gaddr, order);=0A+    {=0A+        u8 devfn =3D pdev->devfn;=0A+=0A+ =
       do {=0A+            amd_iommu_flush_iotlb(devfn, pdev, gaddr, =
order);=0A+            devfn +=3D pdev->phantom_stride;=0A+        } while =
( devfn !=3D pdev->devfn &&=0A+                  PCI_SLOT(devfn) =3D=3D =
PCI_SLOT(pdev->devfn) );=0A+    }=0A }=0A =0A /* Flush iommu cache after =
p2m changes. */=0A--- a/xen/drivers/passthrough/amd/iommu_init.c=0A+++ =
b/xen/drivers/passthrough/amd/iommu_init.c=0A@@ -667,7 +667,7 @@ void =
parse_ppr_log_entry(struct amd_iomm=0A     devfn =3D PCI_DEVFN2(device_id);=
=0A =0A     spin_lock(&pcidevs_lock);=0A-    pdev =3D pci_get_pdev(iommu->s=
eg, bus, devfn);=0A+    pdev =3D pci_get_real_pdev(iommu->seg, bus, =
devfn);=0A     spin_unlock(&pcidevs_lock);=0A =0A     if ( pdev )=0A--- =
a/xen/drivers/passthrough/amd/iommu_map.c=0A+++ b/xen/drivers/passthrough/a=
md/iommu_map.c=0A@@ -598,7 +598,6 @@ static int update_paging_mode(struct =
dom=0A         for_each_pdev( d, pdev )=0A         {=0A             bdf =
=3D PCI_BDF2(pdev->bus, pdev->devfn);=0A-            req_id =3D get_dma_req=
uestor_id(pdev->seg, bdf);=0A             iommu =3D find_iommu_for_device(p=
dev->seg, bdf);=0A             if ( !iommu )=0A             {=0A@@ -607,16 =
+606,21 @@ static int update_paging_mode(struct dom=0A             }=0A =
=0A             spin_lock_irqsave(&iommu->lock, flags);=0A-            =
device_entry =3D iommu->dev_table.buffer +=0A-                           =
(req_id * IOMMU_DEV_TABLE_ENTRY_SIZE);=0A-=0A-            /* valid =3D 0 =
only works for dom0 passthrough mode */=0A-            amd_iommu_set_root_p=
age_table((u32 *)device_entry,=0A-                                         =
 page_to_maddr(hd->root_table),=0A-                                        =
  hd->domain_id,=0A-                                          hd->paging_mo=
de, 1);=0A-=0A-            amd_iommu_flush_device(iommu, req_id);=0A+      =
      do {=0A+                req_id =3D get_dma_requestor_id(pdev->seg, =
bdf);=0A+                device_entry =3D iommu->dev_table.buffer +=0A+    =
                           (req_id * IOMMU_DEV_TABLE_ENTRY_SIZE);=0A+=0A+  =
              /* valid =3D 0 only works for dom0 passthrough mode */=0A+   =
             amd_iommu_set_root_page_table((u32 *)device_entry,=0A+        =
                                      page_to_maddr(hd->root_table),=0A+   =
                                           hd->domain_id,=0A+              =
                                hd->paging_mode, 1);=0A+=0A+               =
 amd_iommu_flush_device(iommu, req_id);=0A+                bdf +=3D =
pdev->phantom_stride;=0A+            } while ( PCI_DEVFN2(bdf) !=3D =
pdev->devfn &&=0A+                      PCI_SLOT(bdf) =3D=3D PCI_SLOT(pdev-=
>devfn) );=0A             spin_unlock_irqrestore(&iommu->lock, flags);=0A  =
       }=0A =0A--- a/xen/drivers/passthrough/iommu.c=0A+++ b/xen/drivers/pa=
ssthrough/iommu.c=0A@@ -154,6 +154,8 @@ void __init iommu_dom0_init(struct =
domai=0A int iommu_add_device(struct pci_dev *pdev)=0A {=0A     struct =
hvm_iommu *hd;=0A+    int rc;=0A+    u8 devfn;=0A =0A     if ( !pdev->domai=
n )=0A         return -EINVAL;=0A@@ -164,7 +166,20 @@ int iommu_add_device(=
struct pci_dev *pde=0A     if ( !iommu_enabled || !hd->platform_ops )=0A   =
      return 0;=0A =0A-    return hd->platform_ops->add_device(pdev->devfn,=
 pdev);=0A+    rc =3D hd->platform_ops->add_device(pdev->devfn, pdev);=0A+ =
   if ( rc || !pdev->phantom_stride )=0A+        return rc;=0A+=0A+    for =
( devfn =3D pdev->devfn ; ; )=0A+    {=0A+        devfn +=3D pdev->phantom_=
stride;=0A+        if ( PCI_SLOT(devfn) !=3D PCI_SLOT(pdev->devfn) )=0A+   =
         return 0;=0A+        rc =3D hd->platform_ops->add_device(devfn, =
pdev);=0A+        if ( rc )=0A+            printk(XENLOG_WARNING "IOMMU: =
add %04x:%02x:%02x.%u failed (%d)\n",=0A+                   pdev->seg, =
pdev->bus, PCI_SLOT(devfn), PCI_FUNC(devfn), rc);=0A+    }=0A }=0A =0A int =
iommu_enable_device(struct pci_dev *pdev)=0A@@ -187,6 +202,8 @@ int =
iommu_enable_device(struct pci_dev *=0A int iommu_remove_device(struct =
pci_dev *pdev)=0A {=0A     struct hvm_iommu *hd;=0A+    u8 devfn;=0A+=0A   =
  if ( !pdev->domain )=0A         return -EINVAL;=0A =0A@@ -194,6 +211,22 =
@@ int iommu_remove_device(struct pci_dev *=0A     if ( !iommu_enabled || =
!hd->platform_ops )=0A         return 0;=0A =0A+    for ( devfn =3D =
pdev->devfn ; pdev->phantom_stride; )=0A+    {=0A+        int rc;=0A+=0A+  =
      devfn +=3D pdev->phantom_stride;=0A+        if ( PCI_SLOT(devfn) =
!=3D PCI_SLOT(pdev->devfn) )=0A+            break;=0A+        rc =3D =
hd->platform_ops->remove_device(devfn, pdev);=0A+        if ( !rc )=0A+    =
        continue;=0A+=0A+        printk(XENLOG_ERR "IOMMU: remove =
%04x:%02x:%02x.%u failed (%d)\n",=0A+               pdev->seg, pdev->bus, =
PCI_SLOT(devfn), PCI_FUNC(devfn), rc);=0A+        return rc;=0A+    =
}=0A+=0A     return hd->platform_ops->remove_device(pdev->devfn, pdev);=0A =
}=0A =0A@@ -241,6 +274,18 @@ static int assign_device(struct domain *=0A   =
  if ( (rc =3D hd->platform_ops->assign_device(d, devfn, pdev)) )=0A       =
  goto done;=0A =0A+    for ( ; pdev->phantom_stride; rc =3D 0 )=0A+    =
{=0A+        devfn +=3D pdev->phantom_stride;=0A+        if ( PCI_SLOT(devf=
n) !=3D PCI_SLOT(pdev->devfn) )=0A+            break;=0A+        rc =3D =
hd->platform_ops->assign_device(d, devfn, pdev);=0A+        if ( rc )=0A+  =
          printk(XENLOG_G_WARNING "d%d: assign %04x:%02x:%02x.%u failed =
(%d)\n",=0A+                   d->domain_id, seg, bus, PCI_SLOT(devfn), =
PCI_FUNC(devfn),=0A+                   rc);=0A+    }=0A+=0A     if ( =
has_arch_pdevs(d) && !need_iommu(d) )=0A     {=0A         d->need_iommu =
=3D 1;=0A@@ -373,6 +418,21 @@ int deassign_device(struct domain *d, u1=0A  =
   if ( !pdev )=0A         return -ENODEV;=0A =0A+    while ( pdev->phantom=
_stride )=0A+    {=0A+        devfn +=3D pdev->phantom_stride;=0A+        =
if ( PCI_SLOT(devfn) !=3D PCI_SLOT(pdev->devfn) )=0A+            break;=0A+=
        ret =3D hd->platform_ops->reassign_device(d, dom0, devfn, =
pdev);=0A+        if ( !ret )=0A+            continue;=0A+=0A+        =
printk(XENLOG_G_ERR "d%d: deassign %04x:%02x:%02x.%u failed (%d)\n",=0A+   =
            d->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), =
ret);=0A+        return ret;=0A+    }=0A+=0A+    devfn =3D pdev->devfn;=0A =
    ret =3D hd->platform_ops->reassign_device(d, dom0, devfn, pdev);=0A    =
 if ( ret )=0A     {=0A--- a/xen/drivers/passthrough/pci.c=0A+++ b/xen/driv=
ers/passthrough/pci.c=0A@@ -144,6 +144,8 @@ static struct pci_dev =
*alloc_pdev(struct=0A     /* update bus2bridge */=0A     switch ( =
pdev->type =3D pdev_type(pseg->nr, bus, devfn) )=0A     {=0A+        int =
pos;=0A+        u16 cap;=0A         u8 sec_bus, sub_bus;=0A =0A         =
case DEV_TYPE_PCIe_BRIDGE:=0A@@ -167,6 +169,20 @@ static struct pci_dev =
*alloc_pdev(struct=0A             break;=0A =0A         case DEV_TYPE_PCIe_=
ENDPOINT:=0A+            pos =3D pci_find_cap_offset(pseg->nr, bus, =
PCI_SLOT(devfn),=0A+                                      PCI_FUNC(devfn), =
PCI_CAP_ID_EXP);=0A+            BUG_ON(!pos);=0A+            cap =3D =
pci_conf_read16(pseg->nr, bus, PCI_SLOT(devfn),=0A+                        =
          PCI_FUNC(devfn), pos + PCI_EXP_DEVCAP);=0A+            if ( cap =
& PCI_EXP_DEVCAP_PHANTOM )=0A+            {=0A+                pdev->phanto=
m_stride =3D 8 >> MASK_EXTR(cap,=0A+                                       =
               PCI_EXP_DEVCAP_PHANTOM);=0A+                if ( PCI_FUNC(de=
vfn) >=3D pdev->phantom_stride )=0A+                    pdev->phantom_strid=
e =3D 0;=0A+            }=0A+            break;=0A+=0A         case =
DEV_TYPE_PCI:=0A             break;=0A =0A@@ -290,6 +306,27 @@ struct =
pci_dev *pci_get_pdev(int seg, in=0A     return NULL;=0A }=0A =0A+struct =
pci_dev *pci_get_real_pdev(int seg, int bus, int devfn)=0A+{=0A+    struct =
pci_dev *pdev;=0A+    int stride;=0A+=0A+    if ( seg < 0 || bus < 0 || =
devfn < 0 )=0A+        return NULL;=0A+=0A+    for ( pdev =3D pci_get_pdev(=
seg, bus, devfn), stride =3D 4;=0A+          !pdev && stride; stride >>=3D =
1 )=0A+    {=0A+        if ( !(devfn & (8 - stride)) )=0A+            =
continue;=0A+        pdev =3D pci_get_pdev(seg, bus, devfn & ~(8 - =
stride));=0A+        if ( pdev && stride !=3D pdev->phantom_stride )=0A+   =
         pdev =3D NULL;=0A+    }=0A+=0A+    return pdev;=0A+}=0A+=0A =
struct pci_dev *pci_get_pdev_by_domain(=0A     struct domain *d, int seg, =
int bus, int devfn)=0A {=0A@@ -488,8 +525,19 @@ int pci_add_device(u16 =
seg, u8 bus, u8 d=0A =0A out:=0A     spin_unlock(&pcidevs_lock);=0A-    =
printk(XENLOG_DEBUG "PCI add %s %04x:%02x:%02x.%u\n", pdev_type,=0A-       =
    seg, bus, slot, func);=0A+    if ( !ret )=0A+    {=0A+        =
printk(XENLOG_DEBUG "PCI add %s %04x:%02x:%02x.%u\n", pdev_type,=0A+       =
        seg, bus, slot, func);=0A+        while ( pdev->phantom_stride =
)=0A+        {=0A+            func +=3D pdev->phantom_stride;=0A+          =
  if ( PCI_SLOT(func) )=0A+                break;=0A+            printk(XEN=
LOG_DEBUG "PCI phantom %04x:%02x:%02x.%u\n",=0A+                   seg, =
bus, slot, func);=0A+        }=0A+    }=0A     return ret;=0A }=0A =0A@@ =
-681,7 +729,7 @@ void pci_check_disable_device(u16 seg, u=0A     u16 =
cword;=0A =0A     spin_lock(&pcidevs_lock);=0A-    pdev =3D pci_get_pdev(se=
g, bus, devfn);=0A+    pdev =3D pci_get_real_pdev(seg, bus, devfn);=0A     =
if ( pdev )=0A     {=0A         if ( now < pdev->fault.time ||=0A@@ -698,6 =
+746,7 @@ void pci_check_disable_device(u16 seg, u=0A =0A     /* Tell the =
device to stop DMAing; we can't rely on the guest to=0A      * control it =
for us. */=0A+    devfn =3D pdev->devfn;=0A     cword =3D pci_conf_read16(s=
eg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),=0A                             =
PCI_COMMAND);=0A     pci_conf_write16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(d=
evfn),=0A@@ -759,6 +808,27 @@ struct setup_dom0 {=0A     int (*handler)(u8 =
devfn, struct pci_dev *);=0A };=0A =0A+static void setup_one_dom0_device(co=
nst struct setup_dom0 *ctxt,=0A+                                  struct =
pci_dev *pdev)=0A+{=0A+    u8 devfn =3D pdev->devfn;=0A+=0A+    do {=0A+   =
     int err =3D ctxt->handler(devfn, pdev);=0A+=0A+        if ( err )=0A+ =
       {=0A+            printk(XENLOG_ERR "setup %04x:%02x:%02x.%u for d%d =
failed (%d)\n",=0A+                   pdev->seg, pdev->bus, PCI_SLOT(devfn)=
, PCI_FUNC(devfn),=0A+                   ctxt->d->domain_id, err);=0A+     =
       if ( devfn =3D=3D pdev->devfn )=0A+                return;=0A+      =
  }=0A+        devfn +=3D pdev->phantom_stride;=0A+    } while ( devfn =
!=3D pdev->devfn &&=0A+              PCI_SLOT(devfn) =3D=3D PCI_SLOT(pdev->=
devfn) );=0A+}=0A+=0A static int __init _setup_dom0_pci_devices(struct =
pci_seg *pseg, void *arg)=0A {=0A     struct setup_dom0 *ctxt =3D =
arg;=0A@@ -777,12 +847,12 @@ static int __init _setup_dom0_pci_device=0A   =
          {=0A                 pdev->domain =3D ctxt->d;=0A                =
 list_add(&pdev->domain_list, &ctxt->d->arch.pdev_list);=0A-               =
 ctxt->handler(devfn, pdev);=0A+                setup_one_dom0_device(ctxt,=
 pdev);=0A             }=0A             else if ( pdev->domain =3D=3D =
dom_xen )=0A             {=0A                 pdev->domain =3D ctxt->d;=0A-=
                ctxt->handler(devfn, pdev);=0A+                setup_one_do=
m0_device(ctxt, pdev);=0A                 pdev->domain =3D dom_xen;=0A     =
        }=0A             else if ( pdev->domain !=3D ctxt->d )=0A--- =
a/xen/include/xen/lib.h=0A+++ b/xen/include/xen/lib.h=0A@@ -58,6 +58,9 @@ =
do {                                    =0A =0A #define ARRAY_SIZE(x) =
(sizeof(x) / sizeof((x)[0]) + __must_be_array(x))=0A =0A+#define MASK_EXTR(=
v, m) (((v) & (m)) / ((m) & -(m)))=0A+#define MASK_INSR(v, m) (((v) * ((m) =
& -(m))) & (m))=0A+=0A #define reserve_bootmem(_p,_l) ((void)0)=0A =0A =
struct domain;=0A--- a/xen/include/xen/pci.h=0A+++ b/xen/include/xen/pci.h=
=0A@@ -63,6 +63,8 @@ struct pci_dev {=0A     const u8 bus;=0A     const u8 =
devfn;=0A =0A+    u8 phantom_stride;=0A+=0A     enum pdev_type {=0A        =
 DEV_TYPE_PCI_UNKNOWN,=0A         DEV_TYPE_PCIe_ENDPOINT,=0A@@ -114,6 =
+116,7 @@ int pci_ro_device(int seg, int bus, int =0A void arch_pci_ro_devi=
ce(int seg, int bdf);=0A int pci_hide_device(int bus, int devfn);=0A =
struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);=0A+struct =
pci_dev *pci_get_real_pdev(int seg, int bus, int devfn);=0A struct pci_dev =
*pci_get_pdev_by_domain(=0A     struct domain *, int seg, int bus, int =
devfn);=0A void pci_check_disable_device(u16 seg, u8 bus, u8 devfn);=0A
--=__PartA3924BF0.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.xen.org
http://lists.xen.org/xen-devel

--=__PartA3924BF0.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 09:52:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 09:52:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdeJl-0000T0-A5; Wed, 28 Nov 2012 09:52:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdeJj-0000Sd-Dq
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 09:52:31 +0000
Received: from [85.158.139.83:56341] by server-10.bemta-5.messagelabs.com id
	81/33-09257-EDED5B05; Wed, 28 Nov 2012 09:52:30 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1354096349!24707223!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32238 invoked from network); 28 Nov 2012 09:52:29 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 09:52:29 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 09:52:29 +0000
Message-Id: <50B5ED2302000078000AC122@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 09:53:23 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
In-Reply-To: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part5160B903.0__="
Subject: [Xen-devel] [PATCH,
 RFC 7/7] IOMMU: add option to specify devices behaving like ones
 using phantom functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part5160B903.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

At least certain Marvell SATA controllers are known to issue bus master
requests with a non-zero function as origin, despite themselves being
single function devices.

--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -698,6 +698,16 @@ Defaults to booting secondary processors
=20
 Default: `on`
=20
+### pci-phantom
+> `=3D[<seg>:]<bus>:<device>,<stride>`
+
+Mark a group of PCI devices as using phantom functions without actually
+advertising so, so the IOMMU can create translation contexts for them.
+
+All numbers specified must be hexadecimal ones.
+
+This option can be specified more than once (up to 8 times at present).
+
 ### ple\_gap
 > `=3D <integer>`
=20
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -121,6 +121,49 @@ const unsigned long *pci_get_ro_map(u16=20
     return pseg ? pseg->ro_map : NULL;
 }
=20
+static struct phantom_dev {
+    u16 seg;
+    u8 bus, slot, stride;
+} phantom_devs[8];
+static unsigned int nr_phantom_devs;
+
+static void __init parse_phantom_dev(char *str) {
+    const char *s =3D str;
+    struct phantom_dev phantom;
+
+    if ( !s || !*s || nr_phantom_devs >=3D ARRAY_SIZE(phantom_devs) )
+        return;
+
+    phantom.seg =3D simple_strtol(s, &s, 16);
+    if ( *s !=3D ':' )
+        return;
+
+    phantom.bus =3D simple_strtol(s + 1, &s, 16);
+    if ( *s =3D=3D ',' )
+    {
+        phantom.slot =3D phantom.bus;
+        phantom.bus =3D phantom.seg;
+        phantom.seg =3D 0;
+    }
+    else if ( *s =3D=3D ':' )
+        phantom.slot =3D simple_strtol(s + 1, &s, 16);
+    else
+        return;
+
+    if ( *s !=3D ',' )
+        return;
+    switch ( phantom.stride =3D simple_strtol(s + 1, &s, 0) )
+    {
+    case 1: case 2: case 4:
+        if ( *s )
+    default:
+            return;
+    }
+
+    phantom_devs[nr_phantom_devs++] =3D phantom;
+}
+custom_param("pci-phantom", parse_phantom_dev);
+
 static struct pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)
 {
     struct pci_dev *pdev;
@@ -181,6 +224,20 @@ static struct pci_dev *alloc_pdev(struct
                 if ( PCI_FUNC(devfn) >=3D pdev->phantom_stride )
                     pdev->phantom_stride =3D 0;
             }
+            else
+            {
+                unsigned int i;
+
+                for ( i =3D 0; i < nr_phantom_devs; ++i )
+                    if ( phantom_devs[i].seg =3D=3D pseg->nr &&
+                         phantom_devs[i].bus =3D=3D bus &&
+                         phantom_devs[i].slot =3D=3D PCI_SLOT(devfn) &&
+                         phantom_devs[i].stride > PCI_FUNC(devfn) )
+                    {
+                        pdev->phantom_stride =3D phantom_devs[i].stride;
+                        break;
+                    }
+            }
             break;
=20
         case DEV_TYPE_PCI:



--=__Part5160B903.0__=
Content-Type: text/plain; name="IOMMU-phantom-dev-quirk.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="IOMMU-phantom-dev-quirk.patch"

IOMMU: add option to specify devices behaving like ones using phantom =
functions=0A=0AAt least certain Marvell SATA controllers are known to =
issue bus master=0Arequests with a non-zero function as origin, despite =
themselves being=0Asingle function devices.=0A=0A--- a/docs/misc/xen-comman=
d-line.markdown=0A+++ b/docs/misc/xen-command-line.markdown=0A@@ -698,6 =
+698,16 @@ Defaults to booting secondary processors=0A =0A Default: =
`on`=0A =0A+### pci-phantom=0A+> `=3D[<seg>:]<bus>:<device>,<stride>`=0A+=
=0A+Mark a group of PCI devices as using phantom functions without =
actually=0A+advertising so, so the IOMMU can create translation contexts =
for them.=0A+=0A+All numbers specified must be hexadecimal ones.=0A+=0A+Thi=
s option can be specified more than once (up to 8 times at present).=0A+=0A=
 ### ple\_gap=0A > `=3D <integer>`=0A =0A--- a/xen/drivers/passthrough/pci.=
c=0A+++ b/xen/drivers/passthrough/pci.c=0A@@ -121,6 +121,49 @@ const =
unsigned long *pci_get_ro_map(u16 =0A     return pseg ? pseg->ro_map : =
NULL;=0A }=0A =0A+static struct phantom_dev {=0A+    u16 seg;=0A+    u8 =
bus, slot, stride;=0A+} phantom_devs[8];=0A+static unsigned int nr_phantom_=
devs;=0A+=0A+static void __init parse_phantom_dev(char *str) {=0A+    =
const char *s =3D str;=0A+    struct phantom_dev phantom;=0A+=0A+    if ( =
!s || !*s || nr_phantom_devs >=3D ARRAY_SIZE(phantom_devs) )=0A+        =
return;=0A+=0A+    phantom.seg =3D simple_strtol(s, &s, 16);=0A+    if ( =
*s !=3D ':' )=0A+        return;=0A+=0A+    phantom.bus =3D simple_strtol(s=
 + 1, &s, 16);=0A+    if ( *s =3D=3D ',' )=0A+    {=0A+        phantom.slot=
 =3D phantom.bus;=0A+        phantom.bus =3D phantom.seg;=0A+        =
phantom.seg =3D 0;=0A+    }=0A+    else if ( *s =3D=3D ':' )=0A+        =
phantom.slot =3D simple_strtol(s + 1, &s, 16);=0A+    else=0A+        =
return;=0A+=0A+    if ( *s !=3D ',' )=0A+        return;=0A+    switch ( =
phantom.stride =3D simple_strtol(s + 1, &s, 0) )=0A+    {=0A+    case 1: =
case 2: case 4:=0A+        if ( *s )=0A+    default:=0A+            =
return;=0A+    }=0A+=0A+    phantom_devs[nr_phantom_devs++] =3D phantom;=0A=
+}=0A+custom_param("pci-phantom", parse_phantom_dev);=0A+=0A static struct =
pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)=0A {=0A     =
struct pci_dev *pdev;=0A@@ -181,6 +224,20 @@ static struct pci_dev =
*alloc_pdev(struct=0A                 if ( PCI_FUNC(devfn) >=3D pdev->phant=
om_stride )=0A                     pdev->phantom_stride =3D 0;=0A          =
   }=0A+            else=0A+            {=0A+                unsigned int =
i;=0A+=0A+                for ( i =3D 0; i < nr_phantom_devs; ++i )=0A+    =
                if ( phantom_devs[i].seg =3D=3D pseg->nr &&=0A+            =
             phantom_devs[i].bus =3D=3D bus &&=0A+                         =
phantom_devs[i].slot =3D=3D PCI_SLOT(devfn) &&=0A+                         =
phantom_devs[i].stride > PCI_FUNC(devfn) )=0A+                    {=0A+    =
                    pdev->phantom_stride =3D phantom_devs[i].stride;=0A+   =
                     break;=0A+                    }=0A+            }=0A   =
          break;=0A =0A         case DEV_TYPE_PCI:=0A
--=__Part5160B903.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.xen.org
http://lists.xen.org/xen-devel

--=__Part5160B903.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 09:52:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 09:52:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdeJl-0000T0-A5; Wed, 28 Nov 2012 09:52:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdeJj-0000Sd-Dq
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 09:52:31 +0000
Received: from [85.158.139.83:56341] by server-10.bemta-5.messagelabs.com id
	81/33-09257-EDED5B05; Wed, 28 Nov 2012 09:52:30 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1354096349!24707223!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32238 invoked from network); 28 Nov 2012 09:52:29 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 09:52:29 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 09:52:29 +0000
Message-Id: <50B5ED2302000078000AC122@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 09:53:23 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
In-Reply-To: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part5160B903.0__="
Subject: [Xen-devel] [PATCH,
 RFC 7/7] IOMMU: add option to specify devices behaving like ones
 using phantom functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part5160B903.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

At least certain Marvell SATA controllers are known to issue bus master
requests with a non-zero function as origin, despite themselves being
single function devices.

--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -698,6 +698,16 @@ Defaults to booting secondary processors
=20
 Default: `on`
=20
+### pci-phantom
+> `=3D[<seg>:]<bus>:<device>,<stride>`
+
+Mark a group of PCI devices as using phantom functions without actually
+advertising so, so the IOMMU can create translation contexts for them.
+
+All numbers specified must be hexadecimal ones.
+
+This option can be specified more than once (up to 8 times at present).
+
 ### ple\_gap
 > `=3D <integer>`
=20
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -121,6 +121,49 @@ const unsigned long *pci_get_ro_map(u16=20
     return pseg ? pseg->ro_map : NULL;
 }
=20
+static struct phantom_dev {
+    u16 seg;
+    u8 bus, slot, stride;
+} phantom_devs[8];
+static unsigned int nr_phantom_devs;
+
+static void __init parse_phantom_dev(char *str) {
+    const char *s =3D str;
+    struct phantom_dev phantom;
+
+    if ( !s || !*s || nr_phantom_devs >=3D ARRAY_SIZE(phantom_devs) )
+        return;
+
+    phantom.seg =3D simple_strtol(s, &s, 16);
+    if ( *s !=3D ':' )
+        return;
+
+    phantom.bus =3D simple_strtol(s + 1, &s, 16);
+    if ( *s =3D=3D ',' )
+    {
+        phantom.slot =3D phantom.bus;
+        phantom.bus =3D phantom.seg;
+        phantom.seg =3D 0;
+    }
+    else if ( *s =3D=3D ':' )
+        phantom.slot =3D simple_strtol(s + 1, &s, 16);
+    else
+        return;
+
+    if ( *s !=3D ',' )
+        return;
+    switch ( phantom.stride =3D simple_strtol(s + 1, &s, 0) )
+    {
+    case 1: case 2: case 4:
+        if ( *s )
+    default:
+            return;
+    }
+
+    phantom_devs[nr_phantom_devs++] =3D phantom;
+}
+custom_param("pci-phantom", parse_phantom_dev);
+
 static struct pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)
 {
     struct pci_dev *pdev;
@@ -181,6 +224,20 @@ static struct pci_dev *alloc_pdev(struct
                 if ( PCI_FUNC(devfn) >=3D pdev->phantom_stride )
                     pdev->phantom_stride =3D 0;
             }
+            else
+            {
+                unsigned int i;
+
+                for ( i =3D 0; i < nr_phantom_devs; ++i )
+                    if ( phantom_devs[i].seg =3D=3D pseg->nr &&
+                         phantom_devs[i].bus =3D=3D bus &&
+                         phantom_devs[i].slot =3D=3D PCI_SLOT(devfn) &&
+                         phantom_devs[i].stride > PCI_FUNC(devfn) )
+                    {
+                        pdev->phantom_stride =3D phantom_devs[i].stride;
+                        break;
+                    }
+            }
             break;
=20
         case DEV_TYPE_PCI:



--=__Part5160B903.0__=
Content-Type: text/plain; name="IOMMU-phantom-dev-quirk.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="IOMMU-phantom-dev-quirk.patch"

IOMMU: add option to specify devices behaving like ones using phantom =
functions=0A=0AAt least certain Marvell SATA controllers are known to =
issue bus master=0Arequests with a non-zero function as origin, despite =
themselves being=0Asingle function devices.=0A=0A--- a/docs/misc/xen-comman=
d-line.markdown=0A+++ b/docs/misc/xen-command-line.markdown=0A@@ -698,6 =
+698,16 @@ Defaults to booting secondary processors=0A =0A Default: =
`on`=0A =0A+### pci-phantom=0A+> `=3D[<seg>:]<bus>:<device>,<stride>`=0A+=
=0A+Mark a group of PCI devices as using phantom functions without =
actually=0A+advertising so, so the IOMMU can create translation contexts =
for them.=0A+=0A+All numbers specified must be hexadecimal ones.=0A+=0A+Thi=
s option can be specified more than once (up to 8 times at present).=0A+=0A=
 ### ple\_gap=0A > `=3D <integer>`=0A =0A--- a/xen/drivers/passthrough/pci.=
c=0A+++ b/xen/drivers/passthrough/pci.c=0A@@ -121,6 +121,49 @@ const =
unsigned long *pci_get_ro_map(u16 =0A     return pseg ? pseg->ro_map : =
NULL;=0A }=0A =0A+static struct phantom_dev {=0A+    u16 seg;=0A+    u8 =
bus, slot, stride;=0A+} phantom_devs[8];=0A+static unsigned int nr_phantom_=
devs;=0A+=0A+static void __init parse_phantom_dev(char *str) {=0A+    =
const char *s =3D str;=0A+    struct phantom_dev phantom;=0A+=0A+    if ( =
!s || !*s || nr_phantom_devs >=3D ARRAY_SIZE(phantom_devs) )=0A+        =
return;=0A+=0A+    phantom.seg =3D simple_strtol(s, &s, 16);=0A+    if ( =
*s !=3D ':' )=0A+        return;=0A+=0A+    phantom.bus =3D simple_strtol(s=
 + 1, &s, 16);=0A+    if ( *s =3D=3D ',' )=0A+    {=0A+        phantom.slot=
 =3D phantom.bus;=0A+        phantom.bus =3D phantom.seg;=0A+        =
phantom.seg =3D 0;=0A+    }=0A+    else if ( *s =3D=3D ':' )=0A+        =
phantom.slot =3D simple_strtol(s + 1, &s, 16);=0A+    else=0A+        =
return;=0A+=0A+    if ( *s !=3D ',' )=0A+        return;=0A+    switch ( =
phantom.stride =3D simple_strtol(s + 1, &s, 0) )=0A+    {=0A+    case 1: =
case 2: case 4:=0A+        if ( *s )=0A+    default:=0A+            =
return;=0A+    }=0A+=0A+    phantom_devs[nr_phantom_devs++] =3D phantom;=0A=
+}=0A+custom_param("pci-phantom", parse_phantom_dev);=0A+=0A static struct =
pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)=0A {=0A     =
struct pci_dev *pdev;=0A@@ -181,6 +224,20 @@ static struct pci_dev =
*alloc_pdev(struct=0A                 if ( PCI_FUNC(devfn) >=3D pdev->phant=
om_stride )=0A                     pdev->phantom_stride =3D 0;=0A          =
   }=0A+            else=0A+            {=0A+                unsigned int =
i;=0A+=0A+                for ( i =3D 0; i < nr_phantom_devs; ++i )=0A+    =
                if ( phantom_devs[i].seg =3D=3D pseg->nr &&=0A+            =
             phantom_devs[i].bus =3D=3D bus &&=0A+                         =
phantom_devs[i].slot =3D=3D PCI_SLOT(devfn) &&=0A+                         =
phantom_devs[i].stride > PCI_FUNC(devfn) )=0A+                    {=0A+    =
                    pdev->phantom_stride =3D phantom_devs[i].stride;=0A+   =
                     break;=0A+                    }=0A+            }=0A   =
          break;=0A =0A         case DEV_TYPE_PCI:=0A
--=__Part5160B903.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.xen.org
http://lists.xen.org/xen-devel

--=__Part5160B903.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 10:09:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 10:09:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdeZt-00012b-Ou; Wed, 28 Nov 2012 10:09:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdeZs-00012T-Tt
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 10:09:13 +0000
Received: from [85.158.139.83:9631] by server-8.bemta-5.messagelabs.com id
	10/1E-06050-6C2E5B05; Wed, 28 Nov 2012 10:09:10 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1354097318!23553056!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8733 invoked from network); 28 Nov 2012 10:08:38 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 10:08:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 10:07:39 +0000
Message-Id: <50B5F0B102000078000AC172@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 10:08:33 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dongxiao Xu" <dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Eddie Dong <eddie.dong@intel.com>, Jun Nakajima <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 0/9] nested vmx: expose some vmx features to
 L1 VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 28.11.12 at 08:11, Dongxiao Xu <dongxiao.xu@intel.com> wrote:
> This patch series expose some vmx features to L1 VMM, including MTF, 
> NMI-window exiting, etc.
> Please help to review and pull.

Looks reasonable to me, but clearly wants to be acked by at
least one of the formally listed VMX maintainers.

Jan

> Dongxiao Xu (9):
>   nested vmx: enable Monitor Trap Flag for L1 VMM
>   nested vmx: enable NMI-window exiting for L1 VMM
>   nested vmx: enable secondary processor-based VM-Execution controls
>   nested vmx: enable Descriptor-table exiting for L1 VMM
>   nested vmx: enable VMX-preemption timer for L1 VMM
>   nested vmx: enable save VMX-preemption timer feature for L1 VMM
>   nested vmx: enable load and save IA32_PAT feature for L1 VMM
>   nested vmx: enable load and save IA32_EFER feature for L1 VMM
>   nested vmx: enable load IA32_PERF_GLOBAL_CTRL feature for L1 VMM
> 
>  xen/arch/x86/hvm/vmx/vmx.c         |    2 +-
>  xen/arch/x86/hvm/vmx/vvmx.c        |  108 +++++++++++++++++++++++++++++++-----
>  xen/include/asm-x86/hvm/vmx/vmcs.h |   12 ++++
>  xen/include/asm-x86/hvm/vmx/vmx.h  |    1 +
>  4 files changed, 108 insertions(+), 15 deletions(-)
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 10:09:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 10:09:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdeZt-00012b-Ou; Wed, 28 Nov 2012 10:09:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdeZs-00012T-Tt
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 10:09:13 +0000
Received: from [85.158.139.83:9631] by server-8.bemta-5.messagelabs.com id
	10/1E-06050-6C2E5B05; Wed, 28 Nov 2012 10:09:10 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1354097318!23553056!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8733 invoked from network); 28 Nov 2012 10:08:38 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 10:08:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 10:07:39 +0000
Message-Id: <50B5F0B102000078000AC172@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 10:08:33 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dongxiao Xu" <dongxiao.xu@intel.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
In-Reply-To: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Eddie Dong <eddie.dong@intel.com>, Jun Nakajima <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 0/9] nested vmx: expose some vmx features to
 L1 VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 28.11.12 at 08:11, Dongxiao Xu <dongxiao.xu@intel.com> wrote:
> This patch series expose some vmx features to L1 VMM, including MTF, 
> NMI-window exiting, etc.
> Please help to review and pull.

Looks reasonable to me, but clearly wants to be acked by at
least one of the formally listed VMX maintainers.

Jan

> Dongxiao Xu (9):
>   nested vmx: enable Monitor Trap Flag for L1 VMM
>   nested vmx: enable NMI-window exiting for L1 VMM
>   nested vmx: enable secondary processor-based VM-Execution controls
>   nested vmx: enable Descriptor-table exiting for L1 VMM
>   nested vmx: enable VMX-preemption timer for L1 VMM
>   nested vmx: enable save VMX-preemption timer feature for L1 VMM
>   nested vmx: enable load and save IA32_PAT feature for L1 VMM
>   nested vmx: enable load and save IA32_EFER feature for L1 VMM
>   nested vmx: enable load IA32_PERF_GLOBAL_CTRL feature for L1 VMM
> 
>  xen/arch/x86/hvm/vmx/vmx.c         |    2 +-
>  xen/arch/x86/hvm/vmx/vvmx.c        |  108 +++++++++++++++++++++++++++++++-----
>  xen/include/asm-x86/hvm/vmx/vmcs.h |   12 ++++
>  xen/include/asm-x86/hvm/vmx/vmx.h  |    1 +
>  4 files changed, 108 insertions(+), 15 deletions(-)
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 11:26:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 11:26:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdflk-0001hy-BS; Wed, 28 Nov 2012 11:25:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tdfli-0001ht-QB
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 11:25:31 +0000
Received: from [85.158.137.99:56814] by server-9.bemta-3.messagelabs.com id
	4F/95-02388-7A4F5B05; Wed, 28 Nov 2012 11:25:27 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1354101924!13858445!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30590 invoked from network); 28 Nov 2012 11:25:25 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 11:25:25 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16044559"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 11:25:24 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 11:25:24 +0000
Message-ID: <1354101923.25834.16.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Date: Wed, 28 Nov 2012 11:25:23 +0000
In-Reply-To: <20661.3989.258191.396175@mariner.uk.xensource.com>
References: <0451e6041bdd88c90eee.1353395794@linux-bjrd.bjz>
	<20661.3989.258191.396175@mariner.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "jfehlig@suse.com" <jfehlig@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Bamvor Jian Zhang <bjzhang@suse.com>
Subject: Re: [Xen-devel] [PATCH] fix race condition between libvirtd event
 handling and libxl fd deregister
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 19:08 +0000, Ian Jackson wrote:
> what change to the libxl API syntax or semantics would fix the problem ?

Mostly just thinking out loud here...

Can we provide, or (more likely) require the application to provide, a
lock (perhaps per-event or, again more likely, per-event-loop) which
must be held while processing callbacks and also while events are being
registered/unregistered with the application's event handling subsystem?
With such a lock in place the application would be able to guarantee
that having returned from the deregister hook any further events would
be seen as spurious events by its own event processing loop.

The other scheme which springs to mind is to do reference counting, with
the application holding a reference whenever the event is present in its
event loop (such that there is any chance of the event being generated)
and libxl holding a reference while it considers the event to be active
(which roughly corresponds to the existing register/unregister hook
calls, I think). libxl would drop its reference as part of calling the
deregister hook while the application would hold its reference until it
was certain the event would no longer be generated e.g. in a pass at the
top of its event handling loop where it includes or excludes the
relevant fd from its select()/poll().

Last half brained idea would be to split the deregistration into two.
libxl calls up to the app saying "please deregister" and the app calls
back to libxl to say "I am no longer watching for this event and
guarantee that I won't deliver it any more". (Presumably this would be
implemented by the application via some combination of the above). This
could be done in a somewhat compatible way by allowing the deregister
hook to return "PENDING".

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 11:26:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 11:26:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdflk-0001hy-BS; Wed, 28 Nov 2012 11:25:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tdfli-0001ht-QB
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 11:25:31 +0000
Received: from [85.158.137.99:56814] by server-9.bemta-3.messagelabs.com id
	4F/95-02388-7A4F5B05; Wed, 28 Nov 2012 11:25:27 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1354101924!13858445!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30590 invoked from network); 28 Nov 2012 11:25:25 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 11:25:25 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16044559"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 11:25:24 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 11:25:24 +0000
Message-ID: <1354101923.25834.16.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Date: Wed, 28 Nov 2012 11:25:23 +0000
In-Reply-To: <20661.3989.258191.396175@mariner.uk.xensource.com>
References: <0451e6041bdd88c90eee.1353395794@linux-bjrd.bjz>
	<20661.3989.258191.396175@mariner.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "jfehlig@suse.com" <jfehlig@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Bamvor Jian Zhang <bjzhang@suse.com>
Subject: Re: [Xen-devel] [PATCH] fix race condition between libvirtd event
 handling and libxl fd deregister
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 19:08 +0000, Ian Jackson wrote:
> what change to the libxl API syntax or semantics would fix the problem ?

Mostly just thinking out loud here...

Can we provide, or (more likely) require the application to provide, a
lock (perhaps per-event or, again more likely, per-event-loop) which
must be held while processing callbacks and also while events are being
registered/unregistered with the application's event handling subsystem?
With such a lock in place the application would be able to guarantee
that having returned from the deregister hook any further events would
be seen as spurious events by its own event processing loop.

The other scheme which springs to mind is to do reference counting, with
the application holding a reference whenever the event is present in its
event loop (such that there is any chance of the event being generated)
and libxl holding a reference while it considers the event to be active
(which roughly corresponds to the existing register/unregister hook
calls, I think). libxl would drop its reference as part of calling the
deregister hook while the application would hold its reference until it
was certain the event would no longer be generated e.g. in a pass at the
top of its event handling loop where it includes or excludes the
relevant fd from its select()/poll().

Last half brained idea would be to split the deregistration into two.
libxl calls up to the app saying "please deregister" and the app calls
back to libxl to say "I am no longer watching for this event and
guarantee that I won't deliver it any more". (Presumably this would be
implemented by the application via some combination of the above). This
could be done in a somewhat compatible way by allowing the deregister
hook to return "PENDING".

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 11:32:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 11:32:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdfs7-0001ug-B5; Wed, 28 Nov 2012 11:32:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tdfs5-0001uZ-Uh
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 11:32:06 +0000
Received: from [85.158.138.51:51667] by server-11.bemta-3.messagelabs.com id
	FC/BE-19361-536F5B05; Wed, 28 Nov 2012 11:32:05 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1354102324!31795051!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21732 invoked from network); 28 Nov 2012 11:32:04 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 11:32:04 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 11:32:03 +0000
Message-Id: <50B6047902000078000AC1CD@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 11:32:56 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part0332EB78.3__="
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com
Subject: [Xen-devel] [PATCH] IOMMU/ATS: fix maximum queue depth calculation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part0332EB78.3__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

The capabilities register field is a 5-bit value, and the 5 bits all
being zero actually means 32 entries.

Under the assumption that amd_iommu_flush_iotlb() really just tried
to correct for the miscalculation above when adding 32 to the value,
that adjustment is also being removed.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/amd/iommu_cmd.c
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c
@@ -321,7 +321,7 @@ void amd_iommu_flush_iotlb(struct pci_de
=20
     req_id =3D get_dma_requestor_id(iommu->seg, bdf);
     queueid =3D req_id;
-    maxpend =3D (ats_pdev->ats_queue_depth + 32) & 0xff;
+    maxpend =3D ats_pdev->ats_queue_depth & 0xff;
=20
     /* send INVALIDATE_IOTLB_PAGES command */
     spin_lock_irqsave(&iommu->lock, flags);
--- a/xen/drivers/passthrough/ats.h
+++ b/xen/drivers/passthrough/ats.h
@@ -28,7 +28,7 @@ struct pci_ats_dev {
=20
 #define ATS_REG_CAP    4
 #define ATS_REG_CTL    6
-#define ATS_QUEUE_DEPTH_MASK     0xF
+#define ATS_QUEUE_DEPTH_MASK     0x1f
 #define ATS_ENABLE               (1<<15)
=20
 extern struct list_head ats_devices;
--- a/xen/drivers/passthrough/x86/ats.c
+++ b/xen/drivers/passthrough/x86/ats.c
@@ -94,6 +94,8 @@ int enable_ats_device(int seg, int bus,=20
         value =3D pci_conf_read16(seg, bus, PCI_SLOT(devfn),
                                 PCI_FUNC(devfn), pos + ATS_REG_CAP);
         pdev->ats_queue_depth =3D value & ATS_QUEUE_DEPTH_MASK;
+        if ( !pdev->ats_queue_depth )
+            pdev->ats_queue_depth =3D ATS_QUEUE_DEPTH_MASK + 1;
         list_add(&pdev->list, &ats_devices);
     }
=20




--=__Part0332EB78.3__=
Content-Type: text/plain; name="IOMMU-ATS-max-queue-depth.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="IOMMU-ATS-max-queue-depth.patch"

IOMMU/ATS: fix maximum queue depth calculation=0A=0AThe capabilities =
register field is a 5-bit value, and the 5 bits all=0Abeing zero actually =
means 32 entries.=0A=0AUnder the assumption that amd_iommu_flush_iotlb() =
really just tried=0Ato correct for the miscalculation above when adding 32 =
to the value,=0Athat adjustment is also being removed.=0A=0ASigned-off-by: =
Jan Beulich <jbeulich@suse.com>=0A=0A--- a/xen/drivers/passthrough/amd/iomm=
u_cmd.c=0A+++ b/xen/drivers/passthrough/amd/iommu_cmd.c=0A@@ -321,7 +321,7 =
@@ void amd_iommu_flush_iotlb(struct pci_de=0A =0A     req_id =3D =
get_dma_requestor_id(iommu->seg, bdf);=0A     queueid =3D req_id;=0A-    =
maxpend =3D (ats_pdev->ats_queue_depth + 32) & 0xff;=0A+    maxpend =3D =
ats_pdev->ats_queue_depth & 0xff;=0A =0A     /* send INVALIDATE_IOTLB_PAGES=
 command */=0A     spin_lock_irqsave(&iommu->lock, flags);=0A--- a/xen/driv=
ers/passthrough/ats.h=0A+++ b/xen/drivers/passthrough/ats.h=0A@@ -28,7 =
+28,7 @@ struct pci_ats_dev {=0A =0A #define ATS_REG_CAP    4=0A #define =
ATS_REG_CTL    6=0A-#define ATS_QUEUE_DEPTH_MASK     0xF=0A+#define =
ATS_QUEUE_DEPTH_MASK     0x1f=0A #define ATS_ENABLE               =
(1<<15)=0A =0A extern struct list_head ats_devices;=0A--- a/xen/drivers/pas=
sthrough/x86/ats.c=0A+++ b/xen/drivers/passthrough/x86/ats.c=0A@@ -94,6 =
+94,8 @@ int enable_ats_device(int seg, int bus, =0A         value =3D =
pci_conf_read16(seg, bus, PCI_SLOT(devfn),=0A                              =
   PCI_FUNC(devfn), pos + ATS_REG_CAP);=0A         pdev->ats_queue_depth =
=3D value & ATS_QUEUE_DEPTH_MASK;=0A+        if ( !pdev->ats_queue_depth =
)=0A+            pdev->ats_queue_depth =3D ATS_QUEUE_DEPTH_MASK + 1;=0A    =
     list_add(&pdev->list, &ats_devices);=0A     }=0A =0A
--=__Part0332EB78.3__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part0332EB78.3__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 11:32:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 11:32:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdfs7-0001ug-B5; Wed, 28 Nov 2012 11:32:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tdfs5-0001uZ-Uh
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 11:32:06 +0000
Received: from [85.158.138.51:51667] by server-11.bemta-3.messagelabs.com id
	FC/BE-19361-536F5B05; Wed, 28 Nov 2012 11:32:05 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1354102324!31795051!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21732 invoked from network); 28 Nov 2012 11:32:04 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 11:32:04 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 11:32:03 +0000
Message-Id: <50B6047902000078000AC1CD@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 11:32:56 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part0332EB78.3__="
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>,
	xiantao.zhang@intel.com
Subject: [Xen-devel] [PATCH] IOMMU/ATS: fix maximum queue depth calculation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part0332EB78.3__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

The capabilities register field is a 5-bit value, and the 5 bits all
being zero actually means 32 entries.

Under the assumption that amd_iommu_flush_iotlb() really just tried
to correct for the miscalculation above when adding 32 to the value,
that adjustment is also being removed.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/amd/iommu_cmd.c
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c
@@ -321,7 +321,7 @@ void amd_iommu_flush_iotlb(struct pci_de
=20
     req_id =3D get_dma_requestor_id(iommu->seg, bdf);
     queueid =3D req_id;
-    maxpend =3D (ats_pdev->ats_queue_depth + 32) & 0xff;
+    maxpend =3D ats_pdev->ats_queue_depth & 0xff;
=20
     /* send INVALIDATE_IOTLB_PAGES command */
     spin_lock_irqsave(&iommu->lock, flags);
--- a/xen/drivers/passthrough/ats.h
+++ b/xen/drivers/passthrough/ats.h
@@ -28,7 +28,7 @@ struct pci_ats_dev {
=20
 #define ATS_REG_CAP    4
 #define ATS_REG_CTL    6
-#define ATS_QUEUE_DEPTH_MASK     0xF
+#define ATS_QUEUE_DEPTH_MASK     0x1f
 #define ATS_ENABLE               (1<<15)
=20
 extern struct list_head ats_devices;
--- a/xen/drivers/passthrough/x86/ats.c
+++ b/xen/drivers/passthrough/x86/ats.c
@@ -94,6 +94,8 @@ int enable_ats_device(int seg, int bus,=20
         value =3D pci_conf_read16(seg, bus, PCI_SLOT(devfn),
                                 PCI_FUNC(devfn), pos + ATS_REG_CAP);
         pdev->ats_queue_depth =3D value & ATS_QUEUE_DEPTH_MASK;
+        if ( !pdev->ats_queue_depth )
+            pdev->ats_queue_depth =3D ATS_QUEUE_DEPTH_MASK + 1;
         list_add(&pdev->list, &ats_devices);
     }
=20




--=__Part0332EB78.3__=
Content-Type: text/plain; name="IOMMU-ATS-max-queue-depth.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="IOMMU-ATS-max-queue-depth.patch"

IOMMU/ATS: fix maximum queue depth calculation=0A=0AThe capabilities =
register field is a 5-bit value, and the 5 bits all=0Abeing zero actually =
means 32 entries.=0A=0AUnder the assumption that amd_iommu_flush_iotlb() =
really just tried=0Ato correct for the miscalculation above when adding 32 =
to the value,=0Athat adjustment is also being removed.=0A=0ASigned-off-by: =
Jan Beulich <jbeulich@suse.com>=0A=0A--- a/xen/drivers/passthrough/amd/iomm=
u_cmd.c=0A+++ b/xen/drivers/passthrough/amd/iommu_cmd.c=0A@@ -321,7 +321,7 =
@@ void amd_iommu_flush_iotlb(struct pci_de=0A =0A     req_id =3D =
get_dma_requestor_id(iommu->seg, bdf);=0A     queueid =3D req_id;=0A-    =
maxpend =3D (ats_pdev->ats_queue_depth + 32) & 0xff;=0A+    maxpend =3D =
ats_pdev->ats_queue_depth & 0xff;=0A =0A     /* send INVALIDATE_IOTLB_PAGES=
 command */=0A     spin_lock_irqsave(&iommu->lock, flags);=0A--- a/xen/driv=
ers/passthrough/ats.h=0A+++ b/xen/drivers/passthrough/ats.h=0A@@ -28,7 =
+28,7 @@ struct pci_ats_dev {=0A =0A #define ATS_REG_CAP    4=0A #define =
ATS_REG_CTL    6=0A-#define ATS_QUEUE_DEPTH_MASK     0xF=0A+#define =
ATS_QUEUE_DEPTH_MASK     0x1f=0A #define ATS_ENABLE               =
(1<<15)=0A =0A extern struct list_head ats_devices;=0A--- a/xen/drivers/pas=
sthrough/x86/ats.c=0A+++ b/xen/drivers/passthrough/x86/ats.c=0A@@ -94,6 =
+94,8 @@ int enable_ats_device(int seg, int bus, =0A         value =3D =
pci_conf_read16(seg, bus, PCI_SLOT(devfn),=0A                              =
   PCI_FUNC(devfn), pos + ATS_REG_CAP);=0A         pdev->ats_queue_depth =
=3D value & ATS_QUEUE_DEPTH_MASK;=0A+        if ( !pdev->ats_queue_depth =
)=0A+            pdev->ats_queue_depth =3D ATS_QUEUE_DEPTH_MASK + 1;=0A    =
     list_add(&pdev->list, &ats_devices);=0A     }=0A =0A
--=__Part0332EB78.3__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part0332EB78.3__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 11:51:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 11:51:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdgAR-00027H-5u; Wed, 28 Nov 2012 11:51:03 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TdgAP-00027C-KQ
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 11:51:02 +0000
Received: from [85.158.139.83:52084] by server-8.bemta-5.messagelabs.com id
	E3/5C-06050-4AAF5B05; Wed, 28 Nov 2012 11:51:00 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1354103458!24732435!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUxMDI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24423 invoked from network); 28 Nov 2012 11:51:00 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 11:51:00 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="45868094"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 11:50:58 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 06:50:58 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TdgAL-0001nJ-V2;
	Wed, 28 Nov 2012 11:50:58 +0000
Date: Wed, 28 Nov 2012 11:50:54 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Jan Beulich <JBeulich@suse.com>
In-Reply-To: <50B5D83402000078000ABFF1@nat28.tlf.novell.com>
Message-ID: <alpine.DEB.2.02.1211281150380.5310@kaball.uk.xensource.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 28 Nov 2012, Jan Beulich wrote:
> >>> On 27.11.12 at 22:31, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > Mukesh Rathor (6):
> >       xen/pvh: Support ParaVirtualized Hardware extensions.
> >       xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
> >       xen/pvh: Implement MMU changes for PVH.
> >       xen/pvh: bootup and setup (E820) related changes.
> >       xen/pvh: balloon and grant changes.
> >       xen/pvh: /dev/xen/privcmd changes.
> 
> As said before - I don't think it is a good idea to push the kernel side
> changes into an official release when the hypervisor side ones didn't
> even get an initial review yet.

I agree

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 11:51:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 11:51:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdgAR-00027H-5u; Wed, 28 Nov 2012 11:51:03 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TdgAP-00027C-KQ
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 11:51:02 +0000
Received: from [85.158.139.83:52084] by server-8.bemta-5.messagelabs.com id
	E3/5C-06050-4AAF5B05; Wed, 28 Nov 2012 11:51:00 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1354103458!24732435!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUxMDI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24423 invoked from network); 28 Nov 2012 11:51:00 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 11:51:00 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="45868094"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 11:50:58 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 06:50:58 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TdgAL-0001nJ-V2;
	Wed, 28 Nov 2012 11:50:58 +0000
Date: Wed, 28 Nov 2012 11:50:54 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Jan Beulich <JBeulich@suse.com>
In-Reply-To: <50B5D83402000078000ABFF1@nat28.tlf.novell.com>
Message-ID: <alpine.DEB.2.02.1211281150380.5310@kaball.uk.xensource.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 28 Nov 2012, Jan Beulich wrote:
> >>> On 27.11.12 at 22:31, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > Mukesh Rathor (6):
> >       xen/pvh: Support ParaVirtualized Hardware extensions.
> >       xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
> >       xen/pvh: Implement MMU changes for PVH.
> >       xen/pvh: bootup and setup (E820) related changes.
> >       xen/pvh: balloon and grant changes.
> >       xen/pvh: /dev/xen/privcmd changes.
> 
> As said before - I don't think it is a good idea to push the kernel side
> changes into an official release when the hypervisor side ones didn't
> even get an initial review yet.

I agree

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 12:22:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 12:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdgeM-0002PT-AW; Wed, 28 Nov 2012 12:21:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TdgeK-0002P1-JO
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 12:21:56 +0000
Received: from [85.158.143.35:5114] by server-2.bemta-4.messagelabs.com id
	64/18-28922-3E106B05; Wed, 28 Nov 2012 12:21:55 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354105312!12487416!3
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUxMDI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24334 invoked from network); 28 Nov 2012 12:21:55 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 12:21:55 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="45870047"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 12:21:52 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 07:21:51 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TdgeF-0002b1-GW;
	Wed, 28 Nov 2012 12:21:51 +0000
MIME-Version: 1.0
X-Mercurial-Node: e87d8fad28e00090591b65b2682dea9112f8830d
Message-ID: <e87d8fad28e00090591b.1354104966@elijah>
In-Reply-To: <patchbomb.1354104964@elijah>
References: <patchbomb.1354104964@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 28 Nov 2012 12:16:06 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH 2 of 2] xl: Accept a list for usbdevice in
	config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354104851 0
# Node ID e87d8fad28e00090591b65b2682dea9112f8830d
# Parent  538d9ffbd71b41e8cf6d7da0ded9e0a0b07f3c0d
xl: Accept a list for usbdevice in config file

Allow the "usbdevice" key to accept a list of USB devices, and pass
them in using the new usbdevice_list domain build element.

For backwards compatibility, still accept singleton values.

Also update the xl.cfg manpage, adding information about how to pass
through host devices.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1103,15 +1103,22 @@ device.
 
 Enables or disables a USB bus in the guest.
 
-=item B<usbdevice=DEVICE>
+=item B<usbdevice=[ "DEVICE", "DEVICE", ...]>
 
-Adds B<DEVICE> to the USB bus. The USB bus must also be enabled using
-B<usb=1>. The most common use for this option is B<usbdevice=tablet>
-which adds pointer device using absolute coordinates. Such devices
-function better than relative coordinate devices (such as a standard
-mouse) since many methods of exporting guest graphics (such as VNC)
-work better in this mode. Note that this is independent of the actual
-pointer device you are using on the host/client side.
+Adds B<DEVICE>s to the emulated USB bus. The USB bus must also be
+enabled using B<usb=1>. The most common use for this option is
+B<usbdevice=['tablet']> which adds pointer device using absolute
+coordinates. Such devices function better than relative coordinate
+devices (such as a standard mouse) since many methods of exporting
+guest graphics (such as VNC) work better in this mode. Note that this
+is independent of the actual pointer device you are using on the
+host/client side.
+
+Host devices can also be passed through in this way, by specifying
+host:USBID, where USBID is of the form xxxx:yyyy.  The USBID can 
+typically be found by using lsusb or usb-devices.
+
+The form usbdevice=DEVICE is also accepted for backwards compatibility.
 
 =back
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1485,8 +1485,23 @@ skip_vfb:
         xlu_cfg_replace_string (config, "serial", &b_info->u.hvm.serial, 0);
         xlu_cfg_replace_string (config, "boot", &b_info->u.hvm.boot, 0);
         xlu_cfg_get_defbool(config, "usb", &b_info->u.hvm.usb, 0);
-        xlu_cfg_replace_string (config, "usbdevice",
-                                &b_info->u.hvm.usbdevice, 0);
+        switch (xlu_cfg_get_list_as_string_list(config, "usbdevice",
+                                                &b_info->u.hvm.usbdevice_list,
+                                                1))
+        {
+
+        case 0: break; /* Success */
+        case ESRCH: break; /* Option not present */
+        case EINVAL:
+            /* If it's not a valid list, try reading it as an atom, falling through to
+             * an error if it fails */
+            if (!xlu_cfg_replace_string(config, "usbdevice", &b_info->u.hvm.usbdevice, 0)) 
+                break;
+            /* FALLTHRU */
+        default:
+            fprintf(stderr,"xl: Unable to parse usbdevice.\n");
+            exit(-ERROR_FAIL);
+        }
         xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
         xlu_cfg_get_defbool(config, "xen_platform_pci",
                             &b_info->u.hvm.xen_platform_pci, 0);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 12:22:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 12:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdgeM-0002PT-AW; Wed, 28 Nov 2012 12:21:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TdgeK-0002P1-JO
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 12:21:56 +0000
Received: from [85.158.143.35:5114] by server-2.bemta-4.messagelabs.com id
	64/18-28922-3E106B05; Wed, 28 Nov 2012 12:21:55 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354105312!12487416!3
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUxMDI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24334 invoked from network); 28 Nov 2012 12:21:55 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 12:21:55 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="45870047"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 12:21:52 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 07:21:51 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TdgeF-0002b1-GW;
	Wed, 28 Nov 2012 12:21:51 +0000
MIME-Version: 1.0
X-Mercurial-Node: e87d8fad28e00090591b65b2682dea9112f8830d
Message-ID: <e87d8fad28e00090591b.1354104966@elijah>
In-Reply-To: <patchbomb.1354104964@elijah>
References: <patchbomb.1354104964@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 28 Nov 2012 12:16:06 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH 2 of 2] xl: Accept a list for usbdevice in
	config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354104851 0
# Node ID e87d8fad28e00090591b65b2682dea9112f8830d
# Parent  538d9ffbd71b41e8cf6d7da0ded9e0a0b07f3c0d
xl: Accept a list for usbdevice in config file

Allow the "usbdevice" key to accept a list of USB devices, and pass
them in using the new usbdevice_list domain build element.

For backwards compatibility, still accept singleton values.

Also update the xl.cfg manpage, adding information about how to pass
through host devices.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1103,15 +1103,22 @@ device.
 
 Enables or disables a USB bus in the guest.
 
-=item B<usbdevice=DEVICE>
+=item B<usbdevice=[ "DEVICE", "DEVICE", ...]>
 
-Adds B<DEVICE> to the USB bus. The USB bus must also be enabled using
-B<usb=1>. The most common use for this option is B<usbdevice=tablet>
-which adds pointer device using absolute coordinates. Such devices
-function better than relative coordinate devices (such as a standard
-mouse) since many methods of exporting guest graphics (such as VNC)
-work better in this mode. Note that this is independent of the actual
-pointer device you are using on the host/client side.
+Adds B<DEVICE>s to the emulated USB bus. The USB bus must also be
+enabled using B<usb=1>. The most common use for this option is
+B<usbdevice=['tablet']> which adds pointer device using absolute
+coordinates. Such devices function better than relative coordinate
+devices (such as a standard mouse) since many methods of exporting
+guest graphics (such as VNC) work better in this mode. Note that this
+is independent of the actual pointer device you are using on the
+host/client side.
+
+Host devices can also be passed through in this way, by specifying
+host:USBID, where USBID is of the form xxxx:yyyy.  The USBID can 
+typically be found by using lsusb or usb-devices.
+
+The form usbdevice=DEVICE is also accepted for backwards compatibility.
 
 =back
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1485,8 +1485,23 @@ skip_vfb:
         xlu_cfg_replace_string (config, "serial", &b_info->u.hvm.serial, 0);
         xlu_cfg_replace_string (config, "boot", &b_info->u.hvm.boot, 0);
         xlu_cfg_get_defbool(config, "usb", &b_info->u.hvm.usb, 0);
-        xlu_cfg_replace_string (config, "usbdevice",
-                                &b_info->u.hvm.usbdevice, 0);
+        switch (xlu_cfg_get_list_as_string_list(config, "usbdevice",
+                                                &b_info->u.hvm.usbdevice_list,
+                                                1))
+        {
+
+        case 0: break; /* Success */
+        case ESRCH: break; /* Option not present */
+        case EINVAL:
+            /* If it's not a valid list, try reading it as an atom, falling through to
+             * an error if it fails */
+            if (!xlu_cfg_replace_string(config, "usbdevice", &b_info->u.hvm.usbdevice, 0)) 
+                break;
+            /* FALLTHRU */
+        default:
+            fprintf(stderr,"xl: Unable to parse usbdevice.\n");
+            exit(-ERROR_FAIL);
+        }
         xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
         xlu_cfg_get_defbool(config, "xen_platform_pci",
                             &b_info->u.hvm.xen_platform_pci, 0);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 12:22:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 12:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdgeL-0002PF-IR; Wed, 28 Nov 2012 12:21:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TdgeK-0002P1-4K
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 12:21:56 +0000
Received: from [85.158.143.35:53156] by server-2.bemta-4.messagelabs.com id
	A0/18-28922-3E106B05; Wed, 28 Nov 2012 12:21:55 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354105312!12487416!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUxMDI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24296 invoked from network); 28 Nov 2012 12:21:54 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 12:21:54 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="45870046"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 12:21:52 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 07:21:51 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TdgeF-0002b1-GA;
	Wed, 28 Nov 2012 12:21:51 +0000
MIME-Version: 1.0
X-Mercurial-Node: 538d9ffbd71b41e8cf6d7da0ded9e0a0b07f3c0d
Message-ID: <538d9ffbd71b41e8cf6d.1354104965@elijah>
In-Reply-To: <patchbomb.1354104964@elijah>
References: <patchbomb.1354104964@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 28 Nov 2012 12:16:05 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH 1 of 2] libxl: Allow multiple USB devices on HVM
 domain creation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354101445 0
# Node ID 538d9ffbd71b41e8cf6d7da0ded9e0a0b07f3c0d
# Parent  ae6fb202b233af815466055d9f1a635802a50855
libxl: Allow multiple USB devices on HVM domain creation

This patch allows an HVM domain to be created with multiple USB
devices.

Since the previous interface only allowed the passing of a single
device, this requires us to add a new element to the hvm struct of
libxl_domain_build_info -- usbdevice_list.  For API compatibility, the
old element, usbdevice, remains.

If b_info->hvm.usbdevice is non-NULL, then it will be used exclusively;
otherwise, libxl will check for b_info->hvm.usbdevice_list instead.
Each device listed will cause an extra "-usbdevice [foo]" to be appended
to the qemu command line.

In order to allow users of libxl to write software compatible with older
versions of libxl, also define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST.  If
this is present, the caller should use b_info->hvm.usbdevice_list; otherwise
they should use b_info->hvm.usbdevice.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -266,6 +266,23 @@
 #endif
 #endif
 
+/* 
+ * LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
+ * 
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain hvm.usbdevice_list, a libxl_string_list type that contains
+ * a list of USB devices to specify on the qemu command-line.
+ *
+ * If it is set, callers may use either hvm.usbdevice or
+ * hvm.usbdevice_list, but not both; if both are set, only
+ * hvm.usbdevice will be used.
+ *
+ * If this is not defined, callers should only use hvm.usbdevice.
+ * Note that this means only one device can be added at domain build
+ * time.
+ */
+#define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST 1
+
 /* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
  * called from within libxl itself. Callers outside libxl, who
  * do not #include libxl_internal.h, are fine. */
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -191,6 +191,15 @@ static char ** libxl__build_device_model
             if (b_info->u.hvm.usbdevice) {
                 flexarray_vappend(dm_args,
                                   "-usbdevice", b_info->u.hvm.usbdevice, NULL);
+            } else if (b_info->u.hvm.usbdevice_list) {
+                char **p;
+                for (p = b_info->u.hvm.usbdevice_list;
+                     *p;
+                     p++) {
+                    flexarray_vappend(dm_args,
+                                      "-usbdevice",
+                                      *p, NULL);
+                }
             }
         }
         if (b_info->u.hvm.soundhw) {
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -326,6 +326,7 @@ libxl_domain_build_info = Struct("domain
                                        ("usbdevice",        string),
                                        ("soundhw",          string),
                                        ("xen_platform_pci", libxl_defbool),
+                                       ("usbdevice_list",   libxl_string_list),
                                        ])),
                  ("pv", Struct(None, [("kernel", string),
                                       ("slack_memkb", MemKB),

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 12:22:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 12:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdgeL-0002PF-IR; Wed, 28 Nov 2012 12:21:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TdgeK-0002P1-4K
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 12:21:56 +0000
Received: from [85.158.143.35:53156] by server-2.bemta-4.messagelabs.com id
	A0/18-28922-3E106B05; Wed, 28 Nov 2012 12:21:55 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354105312!12487416!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUxMDI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24296 invoked from network); 28 Nov 2012 12:21:54 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 12:21:54 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="45870046"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 12:21:52 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 07:21:51 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TdgeF-0002b1-GA;
	Wed, 28 Nov 2012 12:21:51 +0000
MIME-Version: 1.0
X-Mercurial-Node: 538d9ffbd71b41e8cf6d7da0ded9e0a0b07f3c0d
Message-ID: <538d9ffbd71b41e8cf6d.1354104965@elijah>
In-Reply-To: <patchbomb.1354104964@elijah>
References: <patchbomb.1354104964@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 28 Nov 2012 12:16:05 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH 1 of 2] libxl: Allow multiple USB devices on HVM
 domain creation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354101445 0
# Node ID 538d9ffbd71b41e8cf6d7da0ded9e0a0b07f3c0d
# Parent  ae6fb202b233af815466055d9f1a635802a50855
libxl: Allow multiple USB devices on HVM domain creation

This patch allows an HVM domain to be created with multiple USB
devices.

Since the previous interface only allowed the passing of a single
device, this requires us to add a new element to the hvm struct of
libxl_domain_build_info -- usbdevice_list.  For API compatibility, the
old element, usbdevice, remains.

If b_info->hvm.usbdevice is non-NULL, then it will be used exclusively;
otherwise, libxl will check for b_info->hvm.usbdevice_list instead.
Each device listed will cause an extra "-usbdevice [foo]" to be appended
to the qemu command line.

In order to allow users of libxl to write software compatible with older
versions of libxl, also define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST.  If
this is present, the caller should use b_info->hvm.usbdevice_list; otherwise
they should use b_info->hvm.usbdevice.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -266,6 +266,23 @@
 #endif
 #endif
 
+/* 
+ * LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
+ * 
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain hvm.usbdevice_list, a libxl_string_list type that contains
+ * a list of USB devices to specify on the qemu command-line.
+ *
+ * If it is set, callers may use either hvm.usbdevice or
+ * hvm.usbdevice_list, but not both; if both are set, only
+ * hvm.usbdevice will be used.
+ *
+ * If this is not defined, callers should only use hvm.usbdevice.
+ * Note that this means only one device can be added at domain build
+ * time.
+ */
+#define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST 1
+
 /* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
  * called from within libxl itself. Callers outside libxl, who
  * do not #include libxl_internal.h, are fine. */
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -191,6 +191,15 @@ static char ** libxl__build_device_model
             if (b_info->u.hvm.usbdevice) {
                 flexarray_vappend(dm_args,
                                   "-usbdevice", b_info->u.hvm.usbdevice, NULL);
+            } else if (b_info->u.hvm.usbdevice_list) {
+                char **p;
+                for (p = b_info->u.hvm.usbdevice_list;
+                     *p;
+                     p++) {
+                    flexarray_vappend(dm_args,
+                                      "-usbdevice",
+                                      *p, NULL);
+                }
             }
         }
         if (b_info->u.hvm.soundhw) {
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -326,6 +326,7 @@ libxl_domain_build_info = Struct("domain
                                        ("usbdevice",        string),
                                        ("soundhw",          string),
                                        ("xen_platform_pci", libxl_defbool),
+                                       ("usbdevice_list",   libxl_string_list),
                                        ])),
                  ("pv", Struct(None, [("kernel", string),
                                       ("slack_memkb", MemKB),

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 12:22:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 12:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdgeL-0002PM-UB; Wed, 28 Nov 2012 12:21:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TdgeK-0002P2-Lr
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 12:21:56 +0000
Received: from [85.158.143.35:53086] by server-3.bemta-4.messagelabs.com id
	6B/1D-06841-3E106B05; Wed, 28 Nov 2012 12:21:55 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354105312!12487416!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUxMDI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24274 invoked from network); 28 Nov 2012 12:21:54 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 12:21:54 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="45870045"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 12:21:52 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 07:21:51 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TdgeF-0002b1-Fe;
	Wed, 28 Nov 2012 12:21:51 +0000
MIME-Version: 1.0
Message-ID: <patchbomb.1354104964@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 28 Nov 2012 12:16:04 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH 0 of 2] Allow xl to build a domain with multiple
	usb devices
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 12:22:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 12:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdgeL-0002PM-UB; Wed, 28 Nov 2012 12:21:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TdgeK-0002P2-Lr
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 12:21:56 +0000
Received: from [85.158.143.35:53086] by server-3.bemta-4.messagelabs.com id
	6B/1D-06841-3E106B05; Wed, 28 Nov 2012 12:21:55 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354105312!12487416!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUxMDI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24274 invoked from network); 28 Nov 2012 12:21:54 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 12:21:54 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="45870045"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 12:21:52 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 07:21:51 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TdgeF-0002b1-Fe;
	Wed, 28 Nov 2012 12:21:51 +0000
MIME-Version: 1.0
Message-ID: <patchbomb.1354104964@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 28 Nov 2012 12:16:04 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH 0 of 2] Allow xl to build a domain with multiple
	usb devices
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 13:20:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 13:20:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdhYV-00032D-6z; Wed, 28 Nov 2012 13:19:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TdhYT-000328-4E
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 13:19:57 +0000
Received: from [85.158.143.35:57099] by server-2.bemta-4.messagelabs.com id
	17/78-28922-C7F06B05; Wed, 28 Nov 2012 13:19:56 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1354108795!5218443!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12111 invoked from network); 28 Nov 2012 13:19:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 13:19:55 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16047139"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 13:19:55 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 13:19:55 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <port-xen@netbsd.org>
Date: Wed, 28 Nov 2012 14:19:48 +0100
Message-ID: <1354108788-2344-1-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
MIME-Version: 1.0
Cc: xen-devel@lists.xen.org, Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] =?utf-8?q?=5BPATCH=5D_xen=3A_add_gntdev?=
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

VGhpcyBpcyBhIGJhc2ljIChhbmQgZXhwZXJpbWVudGFsKSBnbnRkZXYgaW1wbGVtZW50YXRpb24g
Zm9yIE5ldEJTRC4KClRoZSBnbnQgZGV2aWNlIGFsbG93cyB1c2VybW9kZSBhcHBsaWNhdGlvbnMg
dG8gbWFwIGdyYW50IHJlZmVyZW5jZXMgaW4KdXNlcnNwYWNlLiBJdCBpcyBtYWlubHkgdXNlZCBi
eSBRZW11IHRvIGltcGxlbWVudCBhIFhlbiBiYWNrZW5kICh0aGF0CnJ1bnMgaW4gdXNlcnNwYWNl
KS4KCkR1ZSB0byB0aGUgZmFjdCB0aGF0IHFlbXUtdXBzdHJlYW0gaXMgbm90IHlldCBmdW5jdGlv
bmFsIGluIE5ldEJTRCwKdGhlIG9ubHkgd2F5IHRvIHRyeSB0aGlzIGdudGRldiBpcyB0byB1c2Ug
dGhlIG9sZCBxZW11CihxZW11LXRyYWRpdGlvbmFsKS4KClBlcmZvcm1hbmNlIGlzIG5vdCB0aGF0
IGJhZCAoZ2l2ZW4gdGhhdCB3ZSBhcmUgdXNpbmcgcWVtdS10cmFkaXRpb25hbAphbmQgcnVubmlu
ZyBhIGJhY2tlbmQgaW4gdXNlcnNwYWNlKSwgdGhlIHRocm91Z2hwdXQgb2Ygd3JpdGUKb3BlcmF0
aW9ucyBpcyA2NC43IE1CL3MsIHdoaWxlIGluIHRoZSBEb20wIGl0IGlzIDEwNC42IE1CL3MuIFJl
Z2FyZGluZwpyZWFkIG9wZXJhdGlvbnMsIHRoZSB0aHJvdWdocHV0IGluc2lkZSB0aGUgRG9tVSBp
cyA3Ni4wIE1CL3MsIHdoaWxlIG9uCnRoZSBEb20wIGl0IGlzIDEwOC44IE1CL3MuCgpQYXRjaGVz
IHRvIGxpYnhjIGFuZCBsaWJ4bCBhcmUgYWxzbyBjb21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ysgYi9zeXMvcnVtcC9saWJydW1w
L3J1bXBrZXJuL2RldnN3LmMKQEAgLTEzNCw2ICsxMzQsNyBAQCBzdHJ1Y3QgZGV2c3dfY29udiBk
ZXZzd19jb252MFtdID0gewogCXsgInJkIiwgMjIsIDEwNSwgREVWTk9ERV9ET05UQk9USEVSLCAw
LCB7IDAsIDAgfX0sCiAJeyAiY3QiLCAyMywgMTA2LCBERVZOT0RFX0RPTlRCT1RIRVIsIDAsIHsg
MCwgMCB9fSwKIAl7ICJtdCIsIDI0LCAxMDcsIERFVk5PREVfRE9OVEJPVEhFUiwgMCwgeyAwLCAw
IH19LAorCXsgImdudGRldiIsIC0xLCAxNDAsIERFVk5PREVfRE9OVEJPVEhFUiwgMCwgeyAwLCAw
IH19LAogCXsgInhlbmV2dCIsIC0xLCAxNDEsIERFVk5PREVfRE9OVEJPVEhFUiwgMCwgeyAwLCAw
IH19LAogCXsgInhiZCIsIDE0MiwgMTQyLCBERVZOT0RFX0RPTlRCT1RIRVIsIDAsIHsgMCwgMCB9
fSwKIAl7ICJ4ZW5jb25zIiwgLTEsIDE0MywgREVWTk9ERV9ET05UQk9USEVSLCAwLCB7IDAsIDAg
fX0sCi0tIAoxLjcuNy41IChBcHBsZSBHaXQtMjYpCgoKX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxA
bGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Wed Nov 28 13:20:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 13:20:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdhYV-00032D-6z; Wed, 28 Nov 2012 13:19:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TdhYT-000328-4E
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 13:19:57 +0000
Received: from [85.158.143.35:57099] by server-2.bemta-4.messagelabs.com id
	17/78-28922-C7F06B05; Wed, 28 Nov 2012 13:19:56 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1354108795!5218443!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12111 invoked from network); 28 Nov 2012 13:19:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 13:19:55 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16047139"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 13:19:55 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 13:19:55 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <port-xen@netbsd.org>
Date: Wed, 28 Nov 2012 14:19:48 +0100
Message-ID: <1354108788-2344-1-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
MIME-Version: 1.0
Cc: xen-devel@lists.xen.org, Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] =?utf-8?q?=5BPATCH=5D_xen=3A_add_gntdev?=
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

VGhpcyBpcyBhIGJhc2ljIChhbmQgZXhwZXJpbWVudGFsKSBnbnRkZXYgaW1wbGVtZW50YXRpb24g
Zm9yIE5ldEJTRC4KClRoZSBnbnQgZGV2aWNlIGFsbG93cyB1c2VybW9kZSBhcHBsaWNhdGlvbnMg
dG8gbWFwIGdyYW50IHJlZmVyZW5jZXMgaW4KdXNlcnNwYWNlLiBJdCBpcyBtYWlubHkgdXNlZCBi
eSBRZW11IHRvIGltcGxlbWVudCBhIFhlbiBiYWNrZW5kICh0aGF0CnJ1bnMgaW4gdXNlcnNwYWNl
KS4KCkR1ZSB0byB0aGUgZmFjdCB0aGF0IHFlbXUtdXBzdHJlYW0gaXMgbm90IHlldCBmdW5jdGlv
bmFsIGluIE5ldEJTRCwKdGhlIG9ubHkgd2F5IHRvIHRyeSB0aGlzIGdudGRldiBpcyB0byB1c2Ug
dGhlIG9sZCBxZW11CihxZW11LXRyYWRpdGlvbmFsKS4KClBlcmZvcm1hbmNlIGlzIG5vdCB0aGF0
IGJhZCAoZ2l2ZW4gdGhhdCB3ZSBhcmUgdXNpbmcgcWVtdS10cmFkaXRpb25hbAphbmQgcnVubmlu
ZyBhIGJhY2tlbmQgaW4gdXNlcnNwYWNlKSwgdGhlIHRocm91Z2hw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0dXJuIDA7CisKK2Vycm9yOgorCWZyZWVtKHJlZnMpOworCWZyZWVtKGhh
bmRsZXMpOworCWZyZWVtKGRvbWlkcyk7CisJZnJlZW0obWFwKTsKKwlkZWJ1ZygidW5hYmxlIHRv
IG1hcCBncmFudCByZWZzIik7CisJcmV0dXJuIHJjOworfQorCitzdGF0aWMgaW50Citpb2N0bF91
bm1hcF9ncmFudF9yZWYoc3RydWN0IGdudHByb2MgKnByb2MsCisJaW9jdGxfZ250ZGV2X3VubWFw
X2dyYW50X3JlZiAqdW5tYXBfZ3JhbnRzKQoreworCXN0cnVjdCBnbnRtYXAgKm1hcDsKKwl1aW50
NjRfdCBpbmRleCA9IHVubWFwX2dyYW50cy0+aW5kZXggPj4gUEFHRV9TSElGVDsKKwlpbnQgcmMg
PSAwOworCisJZGVidWcoInVubWFwcGluZyBpbmRleCAlIiBQUkl1NjQsIGluZGV4KTsKKworCW1h
cCA9IGZpbmRfbWFwKHByb2MsIGluZGV4LCB1bm1hcF9ncmFudHMtPmNvdW50KTsKKwlpZiAobWFw
ID09IE5VTEwpIHsKKwkJZGVidWcoInVuYWJsZSB0byBmaW5kIGluZGV4ICUiIFBSSXU2NCwgaW5k
ZXgpOworCQlyYyA9IEVJTlZBTDsKKwkJZ290byBvdXQ7CisJfQorCW11dGV4X2VudGVyKG1hcC0+
dW9iai52bW9iamxvY2spOworCWlmIChtYXAtPnVvYmoudW9fcmVmcykgeworCQlkZWJ1ZygidHJ5
aW5nIHRvIHJlbW92ZSBhIHJlZmVyZW5jZWQgbWFwIik7CisJCW11dGV4X2V4aXQobWFwLT51b2Jq
LnZtb2JqbG9jayk7CisJCXJldHVybiBFSU5WQUw7CisJfQorCW11dGV4X2V4aXQobWFwLT51b2Jq
LnZtb2JqbG9jayk7CisJcmVtb3ZlX21hcChwcm9jLCBtYXApOworb3V0OgorCXJldHVybiByYzsK
K30KKworc3RhdGljIGludAoraW9jdGxfZ2V0X29mZnNldF92YWRkcihzdHJ1Y3QgZ250c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tZGV2ZWxA
bGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Wed Nov 28 13:22:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 13:22:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdhaM-00037v-TE; Wed, 28 Nov 2012 13:21:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TdhaK-00037j-Sk
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 13:21:53 +0000
Received: from [85.158.139.211:3765] by server-13.bemta-5.messagelabs.com id
	AC/B7-27809-0FF06B05; Wed, 28 Nov 2012 13:21:52 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1354108908!18182723!2
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23241 invoked from network); 28 Nov 2012 13:21:51 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 13:21:51 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16047166"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 13:20:59 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 13:20:59 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>, <port-xen@netbsd.org>
Date: Wed, 28 Nov 2012 14:20:50 +0100
Message-ID: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH 1/2] libxc: add suport for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

QWRkIE9TIHNwZWNpZmljIGhhbmRsZXJzIGZvciBOZXRCU0QgZ250ZGV2LiBUaGUgbWFpbiBkaWZm
ZXJlbmNlIGlzCnRoYXQgTmV0QlNEIHBhc3NlcyB0aGUgVkEgd2hlcmUgdGhlIGdyYW50IHNob3Vs
ZCBiZSBzZXQgaW5zaWRlIHRoZQpJT0NUTF9HTlRERVZfTUFQX0dSQU5UX1JFRiBpb2N0bCwgaW5z
dGVhZCBvZiB1c2luZyBtbWFwICh0aGlzIGlzIGR1ZQp0byBPUyBjb25zdHJhaW50cykuCgpTaWdu
ZWQtb2ZmLWJ5OiBSb2dlciBQYXUgTW9ubsOpIDxyb2dlci5wYXVAY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X29zZGVwX2hhbmRsZSlmZDsKK30KKworc3RhdGljIGludCBu
ZXRic2RfZ250dGFiX2Nsb3NlKHhjX2dudHRhYiAqeGNnLCB4Y19vc2RlcF9oYW5kbGUgaCkKK3sK
KyAgICBpbnQgZmQgPSAoaW50KWg7CisgICAgcmV0dXJuIGNsb3NlKGZkKTsKK30KKworc3RhdGlj
IGludCBuZXRic2RfZ250dGFiX3NldF9tYXhfZ3JhbnRzKHhjX2dudHRhYiAqeGNoLCB4Y19vc2Rl
cF9oYW5kbGUgaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQz
Ml90IGNvdW50KQoreworICAgIC8qIE5ldEJTRCBkb2Vzbid0IGltcGxlbWVudCB0aGlzIGZlYXR1
cmUgKi8KKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIHZvaWQgKm5ldGJzZF9nbnR0YWJfZ3Jh
bnRfbWFwKHhjX2dudHRhYiAqeGNoLCB4Y19vc2RlcF9oYW5kbGUgaCwKKyAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNvdW50LCBpbnQgZmxhZ3MsIGludCBwcm90
LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKmRvbWlkcywg
dWludDMyX3QgKnJlZnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50
MzJfdCBub3RpZnlfb2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ZXZ0Y2huX3BvcnRfdCBub3RpZnlfcG9ydCkKK3sKKyAgICBpbnQgZmQgPSAoaW50KWg7CisgICAg
c3RydWN0IGlvY3RsX2dudGRldl9tYXBfZ3JhbnRfcmVmIG1hcDsKKyAgICBzdHJ1Y3QgaW9jdGxf
Z250ZGV2X2dyYW50X3JlZiAqbXJlZnM7CisgICAgdW5zaWduZWQgaW50IG1hcF9zaXplID0gUk9V
TkRVUChjb3VudCAqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2Yo
c3RydWN0IGlvY3RsX2dudGRldl9tYXBfZ3JhbnRfcmVmKSwKKyAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIFhDX1BBR0VfU0hJRlQpOworICAgIHZvaWQgKmFkZHIgPSBNQVBfRkFJ
TEVEOworICAgIGludCBkb21pZHNfc3RyaWRlID0gMTsKKyAgICBpbnQgcnYgPSAwOworICAgIHN0
cnVjdCBpb2N0bF9nbnRkZXZfdW5tYXBfbm90aWZ5IG5vdGlmeTsKKyAgICBpbnQgaTsKKworICAg
IGlmICggZmxhZ3MgJiBYQ19HUkFOVF9NQVBfU0lOR0xFX0RPTUFJTiApCisgICAgICAgIGRvbWlk
c19zdHJpZGUgPSAwOworCisgICAgaWYgKCBtYXBfc2l6ZSA8PSBYQ19QQUdFX1NJWkUgKQorICAg
ICAgICBtcmVmcyA9IGFsbG9jYShjb3VudCAqIHNpemVvZihzdHJ1Y3QgaW9jdGxfZ250ZGV2X21h
cF9ncmFudF9yZWYpKTsKKyAgICBlbHNlCisgICAgeworICAgICAgICBtcmVmcyA9IG1tYXAoTlVM
TCwgbWFwX3NpemUsIFBST1RfUkVBRCB8IFBST1RfV1JJVEUsCisgICAgICAgICAgICAgICAgICAg
TUFQX1BSSVZBVEUgfCBNQVBfQU5PTiwgLTEsIDApOworICAgICAgICBpZiAoIG1yZWZzID09IE1B
UF9GQUlMRUQgKQorICAgICAgICB7CisgICAgICAgICAgICBQRVJST1IoIm5ldGJzZF9nbnR0YWJf
Z3JhbnRfbWFwOiBtbWFwIG9mIHJlZnMgZmFpbGVkIik7CisgICAgICAgICAgICByZXR1cm4gTlVM
TDsKKyAgICAgICAgfQorICAgIH0KKworICAgIG1hcC5yZWZzID0gbXJlZnM7CisKKyAgICBmb3Ig
KCBpID0gMDsgaSA8IGNvdW50OyBpKysgKQorICAgIHsKKyAgICAgICAgbWFwLnJlZnNbaV0uZG9t
aWQgPSBkb21pZHNbaSAqIGRvbWlkc19zdHJpZGVdOworICAgICAgICBtYXAucmVmc1tpXS5yZWYg
PSByZWZzW2ldOworICAgIH0KKworICAgIG1hcC5jb3VudCA9IGNvdW50OworCisgICAgYWRkciA9
IG1tYXAoTlVMTCwgWENfUEFHRV9TSVpFICogY291bnQsIHByb3QsCisgICAgICAgICAgICAgICAg
TUFQX0FOT04gfCBNQVBfU0hBUkVELCAtMSwgMCk7CisgICAgaWYgKCBhZGRyID09IE1BUF9GQUlM
RUQgKQorICAgIHsKKyAgICAgICAgUEVSUk9SKCJuZXRic2RfZ250dGFiX2dyYW50X21hcDogbW1h
cCBvZiBncmFudHMgZmFpbGVkIik7CisgICAgICAgIGdvdG8gb3V0OworICAgIH0KKworICAgIG1h
cC52YWRkciA9ICh1aW50NjRfdCkgYWRkcjsKKworICAgIGlmICggaW9jdGwoZmQsIElPQ1RMX0dO
VERFVl9NQVBfR1JBTlRfUkVGLCAmbWFwKSApCisgICAgeworICAgICAgICBQRVJST1IoIm5ldGJz
ZF9nbnR0YWJfZ3JhbnRfbWFwOiBpb2N0bCBNQVBfR1JBTlRfUkVGIGZhaWxlZCIpOworICAgICAg
ICBtdW5tYXAoYWRkciwgWENfUEFHRV9TSVpFICogY291bnQpOworICAgICAgICBnb3RvIG91dDsK
KyAgICB9CisKKyAgICBub3RpZnkuaW5kZXggPSBtYXAuaW5kZXg7CisgICAgbm90aWZ5LmFjdGlv
biA9IDA7CisgICAgaWYgKCBub3RpZnlfb2Zmc2V0IDwgKFhDX1BBR0VfU0laRSAqIGNvdW50KSAp
CisgICAgeworICAgICAgICBub3RpZnkuaW5kZXggKz0gbm90aWZ5X29mZnNldDsKKyAgICAgICAg
bm90aWZ5LmFjdGlvbiB8PSBVTk1BUF9OT1RJRllfQ0xFQVJfQllURTsKKyAgICB9CisgICAgaWYg
KCBub3RpZnlfcG9ydCAhPSAtMSApCisgICAgeworICAgICAgICBub3RpZnkuZXZlbnRfY2hhbm5l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CisgICAgaWYgKCBtYXBfc2l6ZSA+IFhDX1BBR0VfU0la
RSApCisgICAgICAgIG11bm1hcChtcmVmcywgbWFwX3NpemUpOworCisgICAgcmV0dXJuIGFkZHI7
Cit9CisKKworCitzdGF0aWMgaW50IG5ldGJzZF9nbnR0YWJfbXVubWFwKHhjX2dudHRhYiAqeGNn
LCB4Y19vc2RlcF9oYW5kbGUgaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lk
ICpzdGFydF9hZGRyZXNzLCB1aW50MzJfdCBjb3VudCkKK3sKKyAgICBpbnQgZmQgPSAoaW50KWg7
CisgICAgc3RydWN0IGlvY3RsX2dudGRldl9nZXRfb2Zmc2V0X2Zvcl92YWRkciBnZXRfb2Zmc2V0
OworICAgIHN0cnVjdCBpb2N0bF9nbnRkZXZfdW5tYXBfZ3JhbnRfcmVmIHVubWFwX2dyYW50Owor
ICAgIGludCByYzsKKworICAgIGlmICggc3RhcnRfYWRkcmVzcyA9PSBOVUxMICkKKyAgICB7Cisg
ICAgICAgIGVycm5vID0gRUlOVkFMOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAg
LyogRmlyc3QsIGl0IGlzIG5lY2Vzc2FyeSB0byBnZXQgdGhlIG9mZnNldCB3aGljaCB3YXMgaW5p
dGlhbGx5IHVzZWQgdG8KKyAgICAgKiBtbWFwKCkgdGhlIHBhZ2VzLgorICAgICAqLworICAgIGdl
dF9vZmZzZXQudmFkZHIgPSAodW5zaWduZWQgbG9uZylzdGFydF9hZGRyZXNzOworICAgIGlmICgg
KHJjID0gaW9jdGwoZmQsIElPQ1RMX0dOVERFVl9HRVRfT0ZGU0VUX0ZPUl9WQUREUiwKKyAgICAg
ICAgICAgICAgICAgICAgICZnZXRfb2Zmc2V0KSkgKQorICAgICAgICByZXR1cm4gcmM7CisKKyAg
ICBpZiAoIGdldF9vZmZzZXQuY291bnQgIT0gY291bnQgKQorICAgIHsKKyAgICAgICAgZXJybm8g
PSBFSU5WQU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CB0eXBlICkKQEAgLTM5
OCw2ICs1ODQsOCBAQCBzdGF0aWMgc3RydWN0IHhjX29zZGVwX29wcyAqbmV0YnNkX29zZGVwX2lu
aXQoeGNfaW50ZXJmYWNlICp4Y2gsIGVudW0geGNfb3NkZXBfdAogICAgICAgICByZXR1cm4gJm5l
dGJzZF9wcml2Y21kX29wczsKICAgICBjYXNlIFhDX09TREVQX0VWVENITjoKICAgICAgICAgcmV0
dXJuICZuZXRic2RfZXZ0Y2huX29wczsKKyAgICBjYXNlIFhDX09TREVQX0dOVFRBQjoKKyAgICAg
ICAgcmV0dXJuICZuZXRic2RfZ250dGFiX29wczsKICAgICBkZWZhdWx0OgogICAgICAgICByZXR1
cm4gTlVMTDsKICAgICB9Ci0tIAoxLjcuNy41IChBcHBsZSBHaXQtMjYpCgoKX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlz
dApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Wed Nov 28 13:22:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 13:22:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdhaM-00037v-TE; Wed, 28 Nov 2012 13:21:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TdhaK-00037j-Sk
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 13:21:53 +0000
Received: from [85.158.139.211:3765] by server-13.bemta-5.messagelabs.com id
	AC/B7-27809-0FF06B05; Wed, 28 Nov 2012 13:21:52 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1354108908!18182723!2
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23241 invoked from network); 28 Nov 2012 13:21:51 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 13:21:51 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16047166"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 13:20:59 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 13:20:59 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>, <port-xen@netbsd.org>
Date: Wed, 28 Nov 2012 14:20:50 +0100
Message-ID: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH 1/2] libxc: add suport for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

QWRkIE9TIHNwZWNpZmljIGhhbmRsZXJzIGZvciBOZXRCU0QgZ250ZGV2LiBUaGUgbWFpbiBkaWZm
ZXJlbmNlIGlzCnRoYXQgTmV0QlNEIHBhc3NlcyB0aGUgVkEgd2hlcmUgdGhlIGdyYW50IHNob3Vs
ZCBiZSBzZXQgaW5zaWRlIHRoZQpJT0NUTF9HTlRERVZfTUFQX0dSQU5UX1JFRiBpb2N0bCwgaW5z
dGVhZCBvZiB1c2luZyBtbWFwICh0aGlzIGlzIGR1ZQp0byBPUyBjb25zdHJhaW50cykuCgpTaWdu
ZWQtb2ZmLWJ5OiBSb2dlciBQYXUgTW9ubsOpIDxyb2dlci5wYXVAY2l0cml4LmNvbT4KLS0tCiB0
b29scy9pbmNsdWRlL3hlbi1zeXMvTmV0QlNEL2dudGRldi5oIHwgIDE1MSArKysrKysrKysrKysr
KysrKysrKysrKysrKwogdG9vbHMvbGlieGMveGNfbmV0YnNkLmMgICAgICAgICAgICAgICB8ICAx
ODggKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrCiAyIGZpbGVzIGNoYW5nZWQsIDMz
OSBpbnNlcnRpb25zKCspLCAwIGRlbGV0aW9ucygtKQogY3JlYXRlIG1vZGUgMTAwNjQ0IHRvb2xz
L2luY2x1ZGUveGVuLXN5cy9OZXRCU0QvZ250ZGV2LmgKCmRpZmYgLS1naXQgYS90b29scy9pbmNs
dWRlL3hlbi1zeXMvTmV0QlNEL2dudGRldi5oIGIvdG9vbHMvaW5jbHVkZS94ZW4tc3lzL05ldEJT
RC9nbnRkZXYuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5hMjUxMzNhCi0t
LSAvZGV2L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KyAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNvdW50LCBpbnQgZmxhZ3MsIGludCBwcm90
LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKmRvbWlkcywg
dWludDMyX3QgKnJlZnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50
MzJfdCBub3RpZnlfb2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ZXZ0Y2huX3BvcnRfdCBub3RpZnlfcG9ydCkKK3sKKyAgICBpbnQgZmQgPSAoaW50KWg7CisgICAg
c3RydWN0IGlvY3RsX2dudGRldl9tYXBfZ3JhbnRfcmVmIG1hcDsKKyAgICBzdHJ1Y3QgaW9jdGxf
Z250ZGV2X2dyYW50X3JlZiAqbXJlZnM7CisgICAgdW5zaWduZWQgaW50IG1hcF9zaXplID0gUk9V
TkRVUChjb3VudCAqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2Yo
c3RydWN0IGlvY3RsX2dudGRldl9tYXBfZ3JhbnRfcmVmKSwKKyAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIFhDX1BBR0VfU0hJRlQpOworICAgIHZvaWQgKmFkZHIgPSBNQVBfRkFJ
TEVEOworICAgIGludCBkb21pZHNfc3RyaWRlID0gMTsKKyAgICBpbnQgcnYgPSAwOworICAgIHN0
cnVjdCBpb2N0bF9nbnRkZXZfdW5tYXBfbm90aWZ5IG5vdGlmeTsKKyAgICBpbnQgaTsKKworICAg
IGlmICggZmxhZ3MgJiBYQ19HUkFOVF9NQVBfU0lOR0xFX0RPTUFJTiApCisgICAgICAgIGRvbWlk
c19zdHJpZGUgPSAwOworCisgICAgaWYgKCBtYXBfc2l6ZSA8PSBYQ19QQUdFX1NJWkUgKQorICAg
ICAgICBtcmVmcyA9IGFsbG9jYShjb3VudCAqIHNpemVvZihzdHJ1Y3QgaW9jdGxfZ250ZGV2X21h
cF9ncmFudF9yZWYpKTsKKyAgICBlbHNlCisgICAgeworICAgICAgICBtcmVmcyA9IG1tYXAoTlVM
TCwgbWFwX3NpemUsIFBST1RfUkVBRCB8IFBST1RfV1JJVEUsCisgICAgICAgICAgICAgICAgICAg
TUFQX1BSSVZBVEUgfCBNQVBfQU5PTiwgLTEsIDApOworICAgICAgICBpZiAoIG1yZWZzID09IE1B
UF9GQUlMRUQgKQorICAgICAgICB7CisgICAgICAgICAgICBQRVJST1IoIm5ldGJzZF9nbnR0YWJf
Z3JhbnRfbWFwOiBtbWFwIG9mIHJlZnMgZmFpbGVkIik7CisgICAgICAgICAgICByZXR1cm4gTlVM
TDsKKyAgICAgICAgfQorICAgIH0KKworICAgIG1hcC5yZWZzID0gbXJlZnM7CisKKyAgICBmb3Ig
KCBpID0gMDsgaSA8IGNvdW50OyBpKysgKQorICAgIHsKKyAgICAgICAgbWFwLnJlZnNbaV0uZG9t
aWQgPSBkb21pZHNbaSAqIGRvbWlkc19zdHJpZGVdOworICAgICAgICBtYXAucmVmc1tpXS5yZWYg
PSByZWZzW2ldOworICAgIH0KKworICAgIG1hcC5jb3VudCA9IGNvdW50OworCisgICAgYWRkciA9
IG1tYXAoTlVMTCwgWENfUEFHRV9TSVpFICogY291bnQsIHByb3QsCisgICAgICAgICAgICAgICAg
TUFQX0FOT04gfCBNQVBfU0hBUkVELCAtMSwgMCk7CisgICAgaWYgKCBhZGRyID09IE1BUF9GQUlM
RUQgKQorICAgIHsKKyAgICAgICAgUEVSUk9SKCJuZXRic2RfZ250dGFiX2dyYW50X21hcDogbW1h
cCBvZiBncmFudHMgZmFpbGVkIik7CisgICAgICAgIGdvdG8gb3V0OworICAgIH0KKworICAgIG1h
cC52YWRkciA9ICh1aW50NjRfdCkgYWRkcjsKKworICAgIGlmICggaW9jdGwoZmQsIElPQ1RMX0dO
VERFVl9NQVBfR1JBTlRfUkVGLCAmbWFwKSApCisgICAgeworICAgICAgICBQ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Cisg
ICAgICAgIGVycm5vID0gRUlOVkFMOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAg
LyogRmlyc3QsIGl0IGlzIG5lY2Vzc2FyeSB0byBnZXQgdGhlIG9mZnNldCB3aGljaCB3YXMgaW5p
dGlhbGx5IHVzZWQgdG8KKyAgICAgKiBtbWFwKCkgdGhlIHBhZ2VzLgorICAgICAqLworICAgIGdl
dF9vZmZzZXQudmFkZHIgPSAodW5zaWduZWQgbG9uZylzdGFydF9hZGRyZXNzOworICAgIGlmICgg
KHJjID0gaW9jdGwoZmQsIElPQ1RMX0dOVERFVl9HRVRfT0ZGU0VUX0ZPUl9WQUREUiwKKyAgICAg
ICAgICAgICAgICAgICAgICZnZXRfb2Zmc2V0KSkgKQorICAgICAgICByZXR1cm4gcmM7CisKKyAg
ICBpZiAoIGdldF9vZmZzZXQuY291bnQgIT0gY291bnQgKQorICAgIHsKKyAgICAgICAgZXJybm8g
PSBFSU5WQUw7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICAvKiBOZXh0LCB1bm1h
cCB0aGUgbWVtb3J5LiAqLworICAgIGlmICggKHJjID0gbXVubWFwKHN0YXJ0X2FkZHJlc3MsIGNv
dW50ICogZ2V0cGFnZXNpemUoKSkpICkKKyAgICAgICAgcmV0dXJuIHJjOworCisgICAgLyogRmlu
YWxseSwgdW5tYXAgdGhlIGRyaXZlciBzbG90cyB1c2VkIHRvIHN0b3JlIHRoZSBncmFudCBpbmZv
cm1hdGlvbi4gKi8KKyAgICB1bm1hcF9ncmFudC5pbmRleCA9IGdldF9vZmZzZXQub2Zmc2V0Owor
ICAgIHVubWFwX2dyYW50LmNvdW50ID0gY291bnQ7CisgICAgaWYgKCAocmMgPSBpb2N0bChmZCwg
SU9DVExfR05UREVWX1VOTUFQX0dSQU5UX1JFRiwgJnVubWFwX2dyYW50KSkgKQorICAgICAgICBy
ZXR1cm4gcmM7CisKKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIHN0cnVjdCB4Y19vc2RlcF9v
cHMgbmV0YnNkX2dudHRhYl9vcHMgPSB7CisgICAgLm9wZW4gPSAmbmV0YnNkX2dudHRhYl9vcGVu
LAorICAgIC5jbG9zZSA9ICZuZXRic2RfZ250dGFiX2Nsb3NlLAorCisgICAgLnUuZ250dGFiID0g
eworICAgICAgICAuc2V0X21heF9ncmFudHMgPSAmbmV0YnNkX2dudHRhYl9zZXRfbWF4X2dyYW50
cywKKyAgICAgICAgLmdyYW50X21hcCA9ICZuZXRic2RfZ250dGFiX2dyYW50X21hcCwKKyAgICAg
ICAgLm11bm1hcCA9ICZuZXRic2RfZ250dGFiX211bm1hcCwKKyAgICB9LAorfTsKKwogc3RhdGlj
IHN0cnVjdCB4Y19vc2RlcF9vcHMgKm5ldGJzZF9vc2RlcF9pbml0KHhjX2ludGVyZmFjZSAqeGNo
LCBlbnVtIHhjX29zZGVwX3R5cGUgdHlwZSkKIHsKICAgICBzd2l0Y2ggKCB0eXBlICkKQEAgLTM5
OCw2ICs1ODQsOCBAQCBzdGF0aWMgc3RydWN0IHhjX29zZGVwX29wcyAqbmV0YnNkX29zZGVwX2lu
aXQoeGNfaW50ZXJmYWNlICp4Y2gsIGVudW0geGNfb3NkZXBfdAogICAgICAgICByZXR1cm4gJm5l
dGJzZF9wcml2Y21kX29wczsKICAgICBjYXNlIFhDX09TREVQX0VWVENITjoKICAgICAgICAgcmV0
dXJuICZuZXRic2RfZXZ0Y2huX29wczsKKyAgICBjYXNlIFhDX09TREVQX0dOVFRBQjoKKyAgICAg
ICAgcmV0dXJuICZuZXRic2RfZ250dGFiX29wczsKICAgICBkZWZhdWx0OgogICAgICAgICByZXR1
cm4gTlVMTDsKICAgICB9Ci0tIAoxLjcuNy41IChBcHBsZSBHaXQtMjYpCgoKX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlz
dApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Wed Nov 28 13:22:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 13:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdhaN-000384-8g; Wed, 28 Nov 2012 13:21:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TdhaL-00037m-QR
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 13:21:53 +0000
Received: from [85.158.139.211:6252] by server-9.bemta-5.messagelabs.com id
	57/7D-29295-1FF06B05; Wed, 28 Nov 2012 13:21:53 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1354108908!18182723!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23207 invoked from network); 28 Nov 2012 13:21:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 13:21:50 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16047167"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 13:21:00 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 13:20:59 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>, <port-xen@netbsd.org>
Date: Wed, 28 Nov 2012 14:20:51 +0100
Message-ID: <1354108851-2383-2-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
In-Reply-To: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file handling to
	Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

VGhpcyBmb3JjZXMgbGlieGwgdG8gdXNlIFFlbXUgd2hlbiBhIHJhdyBpbWFnZSBmaWxlIGlzIHVz
ZWQgYXMgYSBkaXNrCmJhY2tlbmQuIE5ldEJTRCBjdXJyZW50bHkgb25seSBzdXBwb3J0cyBxZW11
LXRyYWRpdGlvbmFsLCBzbwpkZXZpY2VfbW9kZWxfdmVyc2lvbj0icWVtdS14ZW4tdHJhZGl0aW9u
YWwiIGhhcyB0byBiZSBhZGRlZCB0byB0aGUKY29uZmlnIGZpbGUgd2hlbiB1c2luZyBpbWFnZSBm
aWxlcy4KClNpZ25lZC1vZmYtYnk6IFJvZ2VyIFBhdSBNb25uw6kgPHJvZ2VyLnBhdUBjaXRyaXgu
Y29tPgotLS0KIHRvb2xzL2xpYnhsL2xpYnhsX25ldGJzZC5jIHwgICAgNiArKystLS0KIDEgZmls
ZXMgY2hhbmdlZCwgMyBpbnNlcnRpb25zKCspLCAzIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBh
L3Rvb2xzL2xpYnhsL2xpYnhsX25ldGJzZC5jIGIvdG9vbHMvbGlieGwvbGlieGxfbmV0YnNkLmMK
aW5kZXggOTU4NzgzMy4uNzZlNWY0MCAxMDA2NDQKLS0tIGEvdG9vbHMvbGlieGwvbGlieGxfbmV0
YnNkLmMKKysrIGIvdG9vbHMvbGlieGwvbGlieGxfbmV0YnNkLmMKQEAgLTE5LDEwICsxOSwxMCBA
QAogCiBpbnQgbGlieGxfX3RyeV9waHlfYmFja2VuZChtb2RlX3Qgc3RfbW9kZSkKIHsKLSAgICBp
ZiAoU19JU1JFRyhzdF9tb2RlKSB8fCBTX0lTQkxLKHN0X21vZGUpKQotICAgICAgICByZXR1cm4g
MTsKKyAgICBpZiAoIVNfSVNCTEsoc3RfbW9kZSkpCisgICAgICAgIHJldHVybiAwOwogCi0gICAg
cmV0dXJuIDA7CisgICAgcmV0dXJuIDE7CiB9CiAKIGNoYXIgKmxpYnhsX19kZXZpZF90b19sb2Nh
bGRldihsaWJ4bF9fZ2MgKmdjLCBpbnQgZGV2aWQpCi0tIAoxLjcuNy41IChBcHBsZSBHaXQtMjYp
CgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRl
dmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVu
Lm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Wed Nov 28 13:22:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 13:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdhaN-000384-8g; Wed, 28 Nov 2012 13:21:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TdhaL-00037m-QR
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 13:21:53 +0000
Received: from [85.158.139.211:6252] by server-9.bemta-5.messagelabs.com id
	57/7D-29295-1FF06B05; Wed, 28 Nov 2012 13:21:53 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1354108908!18182723!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23207 invoked from network); 28 Nov 2012 13:21:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 13:21:50 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16047167"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 13:21:00 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 13:20:59 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>, <port-xen@netbsd.org>
Date: Wed, 28 Nov 2012 14:20:51 +0100
Message-ID: <1354108851-2383-2-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
In-Reply-To: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file handling to
	Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

VGhpcyBmb3JjZXMgbGlieGwgdG8gdXNlIFFlbXUgd2hlbiBhIHJhdyBpbWFnZSBmaWxlIGlzIHVz
ZWQgYXMgYSBkaXNrCmJhY2tlbmQuIE5ldEJTRCBjdXJyZW50bHkgb25seSBzdXBwb3J0cyBxZW11
LXRyYWRpdGlvbmFsLCBzbwpkZXZpY2VfbW9kZWxfdmVyc2lvbj0icWVtdS14ZW4tdHJhZGl0aW9u
YWwiIGhhcyB0byBiZSBhZGRlZCB0byB0aGUKY29uZmlnIGZpbGUgd2hlbiB1c2luZyBpbWFnZSBm
aWxlcy4KClNpZ25lZC1vZmYtYnk6IFJvZ2VyIFBhdSBNb25uw6kgPHJvZ2VyLnBhdUBjaXRyaXgu
Y29tPgotLS0KIHRvb2xzL2xpYnhsL2xpYnhsX25ldGJzZC5jIHwgICAgNiArKystLS0KIDEgZmls
ZXMgY2hhbmdlZCwgMyBpbnNlcnRpb25zKCspLCAzIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBh
L3Rvb2xzL2xpYnhsL2xpYnhsX25ldGJzZC5jIGIvdG9vbHMvbGlieGwvbGlieGxfbmV0YnNkLmMK
aW5kZXggOTU4NzgzMy4uNzZlNWY0MCAxMDA2NDQKLS0tIGEvdG9vbHMvbGlieGwvbGlieGxfbmV0
YnNkLmMKKysrIGIvdG9vbHMvbGlieGwvbGlieGxfbmV0YnNkLmMKQEAgLTE5LDEwICsxOSwxMCBA
QAogCiBpbnQgbGlieGxfX3RyeV9waHlfYmFja2VuZChtb2RlX3Qgc3RfbW9kZSkKIHsKLSAgICBp
ZiAoU19JU1JFRyhzdF9tb2RlKSB8fCBTX0lTQkxLKHN0X21vZGUpKQotICAgICAgICByZXR1cm4g
MTsKKyAgICBpZiAoIVNfSVNCTEsoc3RfbW9kZSkpCisgICAgICAgIHJldHVybiAwOwogCi0gICAg
cmV0dXJuIDA7CisgICAgcmV0dXJuIDE7CiB9CiAKIGNoYXIgKmxpYnhsX19kZXZpZF90b19sb2Nh
bGRldihsaWJ4bF9fZ2MgKmdjLCBpbnQgZGV2aWQpCi0tIAoxLjcuNy41IChBcHBsZSBHaXQtMjYp
CgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRl
dmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVu
Lm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Wed Nov 28 13:34:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 13:34:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdhlt-0003Vd-Ip; Wed, 28 Nov 2012 13:33:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <tls@panix.com>) id 1Tdheu-0003QI-Gg
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 13:26:36 +0000
Received: from [85.158.137.99:16707] by server-2.bemta-3.messagelabs.com id
	9A/AB-04744-B0116B05; Wed, 28 Nov 2012 13:26:35 +0000
X-Env-Sender: tls@panix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1354109195!11652392!1
X-Originating-IP: [166.84.1.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTY2Ljg0LjEuODkgPT4gMjgzOTI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27428 invoked from network); 28 Nov 2012 13:26:35 -0000
Received: from mailbackend.panix.com (HELO mailbackend.panix.com) (166.84.1.89)
	by server-8.tower-217.messagelabs.com with SMTP;
	28 Nov 2012 13:26:35 -0000
Received: from panix5.panix.com (panix5.panix.com [166.84.1.5])
	by mailbackend.panix.com (Postfix) with ESMTP id B0D022EE8C;
	Wed, 28 Nov 2012 08:26:34 -0500 (EST)
Received: by panix5.panix.com (Postfix, from userid 415)
	id 9863824241; Wed, 28 Nov 2012 08:26:34 -0500 (EST)
Date: Wed, 28 Nov 2012 08:26:34 -0500
From: Thor Lancelot Simon <tls@panix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Message-ID: <20121128132634.GA18277@panix.com>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354108851-2383-2-git-send-email-roger.pau@citrix.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
X-Mailman-Approved-At: Wed, 28 Nov 2012 13:33:48 +0000
Cc: port-xen@netbsd.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 02:20:51PM +0100, Roger Pau Monne wrote:
> This forces libxl to use Qemu when a raw image file is used as a disk
> backend. NetBSD currently only supports qemu-traditional, so

Wait -- do I grasp correctly that this patch _forces_ NetBSD as a dom0
to handle file-backed I/O requests in a way that includes additional
context switches to userspace, and which your previous email said
resulted in a 30% reduction in throughput compared to dom0 I/O?

I am assuming there's some reason we want this, rather than handling
such requests in-kernel.  But what is it?

Thor

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 13:34:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 13:34:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdhlt-0003Vd-Ip; Wed, 28 Nov 2012 13:33:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <tls@panix.com>) id 1Tdheu-0003QI-Gg
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 13:26:36 +0000
Received: from [85.158.137.99:16707] by server-2.bemta-3.messagelabs.com id
	9A/AB-04744-B0116B05; Wed, 28 Nov 2012 13:26:35 +0000
X-Env-Sender: tls@panix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1354109195!11652392!1
X-Originating-IP: [166.84.1.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTY2Ljg0LjEuODkgPT4gMjgzOTI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27428 invoked from network); 28 Nov 2012 13:26:35 -0000
Received: from mailbackend.panix.com (HELO mailbackend.panix.com) (166.84.1.89)
	by server-8.tower-217.messagelabs.com with SMTP;
	28 Nov 2012 13:26:35 -0000
Received: from panix5.panix.com (panix5.panix.com [166.84.1.5])
	by mailbackend.panix.com (Postfix) with ESMTP id B0D022EE8C;
	Wed, 28 Nov 2012 08:26:34 -0500 (EST)
Received: by panix5.panix.com (Postfix, from userid 415)
	id 9863824241; Wed, 28 Nov 2012 08:26:34 -0500 (EST)
Date: Wed, 28 Nov 2012 08:26:34 -0500
From: Thor Lancelot Simon <tls@panix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Message-ID: <20121128132634.GA18277@panix.com>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354108851-2383-2-git-send-email-roger.pau@citrix.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
X-Mailman-Approved-At: Wed, 28 Nov 2012 13:33:48 +0000
Cc: port-xen@netbsd.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 02:20:51PM +0100, Roger Pau Monne wrote:
> This forces libxl to use Qemu when a raw image file is used as a disk
> backend. NetBSD currently only supports qemu-traditional, so

Wait -- do I grasp correctly that this patch _forces_ NetBSD as a dom0
to handle file-backed I/O requests in a way that includes additional
context switches to userspace, and which your previous email said
resulted in a 30% reduction in throughput compared to dom0 I/O?

I am assuming there's some reason we want this, rather than handling
such requests in-kernel.  But what is it?

Thor

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:21:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:21:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdiW0-0003pa-AO; Wed, 28 Nov 2012 14:21:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TdiVx-0003oh-Rc
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 14:21:26 +0000
Received: from [85.158.143.99:33796] by server-1.bemta-4.messagelabs.com id
	3F/7A-27934-5ED16B05; Wed, 28 Nov 2012 14:21:25 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1354112484!31756506!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14997 invoked from network); 28 Nov 2012 14:21:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:21:24 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16048734"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 14:21:24 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 14:21:23 +0000
MIME-Version: 1.0
X-Mercurial-Node: 0f3b6811dad16cc9d93feea2a4731a47d88dfe59
Message-ID: <0f3b6811dad16cc9d93f.1354112414@makatos-desktop>
In-Reply-To: <patchbomb.1354112410@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 28 Nov 2012 14:20:14 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 4 of 5 RFC] blktap3: Introduce xenio daemon
	Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

diff -r 7126fda14249 -r 0f3b6811dad1 tools/blktap3/xenio/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/blktap3/xenio/Makefile	Wed Nov 28 14:18:46 2012 +0000
@@ -0,0 +1,47 @@
+XEN_ROOT := $(CURDIR)/../../../
+include $(XEN_ROOT)/tools/Rules.mk
+
+BLKTAP_ROOT := ..
+
+INST_DIR ?= /usr/bin
+
+IBIN = xenio
+
+override CFLAGS += \
+	-I$(BLKTAP_ROOT)/include \
+	-I$(BLKTAP_ROOT)/control \
+	-I$(XEN_ROOT)/tools/libxc \
+	-I$(XEN_ROOT)/tools/xenstore \
+	-D_GNU_SOURCE \
+	$(CFLAGS_xeninclude) \
+    -Wall \
+    -Wextra \
+    -Werror
+
+# FIXME cause trouble
+override CFLAGS += \
+    -Wno-old-style-declaration \
+    -Wno-sign-compare \
+    -Wno-type-limits
+
+override LDFLAGS = \
+    -L$(XEN_ROOT)/tools/xenstore -lxenstore
+
+XENIO-OBJS := log.o
+
+all: $(IBIN)
+
+$(BLKTAP_ROOT)/control/libblktapctl.a:
+	make -C $(BLKTAP_ROOT)/control libblktapctl.a
+
+$(IBIN): $(XENIO-OBJS) xenio.o $(BLKTAP_ROOT)/control/libblktapctl.a
+	$(CC) -o $@ $^ $(LDFLAGS)
+
+install: all
+	$(INSTALL_DIR) -p $(DESTDIR)$(INST_DIR)
+	$(INSTALL_PROG) $(IBIN) $(DESTDIR)$(INST_DIR)
+
+clean:
+	rm -f *.o *.o.d .*.o.d $(IBIN)
+
+.PHONY: clean install

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:21:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:21:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdiVz-0003p5-1x; Wed, 28 Nov 2012 14:21:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TdiVw-0003oV-QA
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 14:21:25 +0000
Received: from [85.158.137.99:36639] by server-10.bemta-3.messagelabs.com id
	0E/21-19806-4ED16B05; Wed, 28 Nov 2012 14:21:24 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354112483!16913086!2
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7714 invoked from network); 28 Nov 2012 14:21:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:21:23 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16048730"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 14:21:23 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 14:21:23 +0000
MIME-Version: 1.0
X-Mercurial-Node: d426fc26719748805aafd873f5616cd8601a0108
Message-ID: <d426fc26719748805aaf.1354112411@makatos-desktop>
In-Reply-To: <patchbomb.1354112410@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 28 Nov 2012 14:20:11 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 1 of 5 RFC] blktap3: Introduce fundamental xenio
	headers
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch introduces header files xenio-common.h, which contains common
definitions used by the xenio daemon, libxenio, and the users of libxenio, and
xenio-private.h, which contains private definitions used by the xenio daemon
and libxenio.

diff -r 84f51929a064 -r d426fc267197 tools/blktap3/xenio/xenio-common.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/blktap3/xenio/xenio-common.h	Wed Nov 28 14:11:43 2012 +0000
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ *
+ * Common definitions used by the xenio daemon, libxenio, and the users of
+ * libxenio.
+ */
+
+#ifndef __XENIO_COMMON_H__
+#define __XENIO_COMMON_H__
+
+#include <assert.h>
+
+/**
+ * Block I/O protocol
+ *
+ * TODO Why start from 1?
+ * TODO Define a macro that tells whether a protocol is supported.
+ */
+enum {
+    XENIO_BLKIF_PROTO_NATIVE = 1,
+    XENIO_BLKIF_PROTO_X86_32 = 2,
+    XENIO_BLKIF_PROTO_X86_64 = 3,
+};
+#endif /* __XENIO_COMMON_H__ */
diff -r 84f51929a064 -r d426fc267197 tools/blktap3/xenio/xenio-private.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/blktap3/xenio/xenio-private.h	Wed Nov 28 14:11:43 2012 +0000
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ *
+ * Private definitions used by the xenio daemon and libxenio.
+ */
+
+#ifndef __XENIO_PRIVATE_H__
+#define __XENIO_PRIVATE_H__
+
+#include "blktap3.h"
+#include <xenctrl.h>
+#include <stdlib.h>
+#include <syslog.h>
+
+void xenio_log(int prio, const char *fmt, ...);
+void (*xenio_vlog) (int prio, const char *fmt, va_list ap);
+
+#define DBG(_fmt, _args...)  xenio_log(LOG_DEBUG, "%s:%d "_fmt, __FILE__, \
+        __LINE__, ##_args)
+#define INFO(_fmt, _args...) xenio_log(LOG_INFO, _fmt, ##_args)
+#define WARN(_fmt, _args...) xenio_log(LOG_WARNING, "%s:%d "_fmt, __FILE__, \
+        __LINE__, ##_args)
+
+#endif /* __XENIO_PRIVATE_H__ */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:21:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:21:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdiW0-0003pa-AO; Wed, 28 Nov 2012 14:21:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TdiVx-0003oh-Rc
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 14:21:26 +0000
Received: from [85.158.143.99:33796] by server-1.bemta-4.messagelabs.com id
	3F/7A-27934-5ED16B05; Wed, 28 Nov 2012 14:21:25 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1354112484!31756506!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14997 invoked from network); 28 Nov 2012 14:21:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:21:24 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16048734"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 14:21:24 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 14:21:23 +0000
MIME-Version: 1.0
X-Mercurial-Node: 0f3b6811dad16cc9d93feea2a4731a47d88dfe59
Message-ID: <0f3b6811dad16cc9d93f.1354112414@makatos-desktop>
In-Reply-To: <patchbomb.1354112410@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 28 Nov 2012 14:20:14 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 4 of 5 RFC] blktap3: Introduce xenio daemon
	Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

diff -r 7126fda14249 -r 0f3b6811dad1 tools/blktap3/xenio/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/blktap3/xenio/Makefile	Wed Nov 28 14:18:46 2012 +0000
@@ -0,0 +1,47 @@
+XEN_ROOT := $(CURDIR)/../../../
+include $(XEN_ROOT)/tools/Rules.mk
+
+BLKTAP_ROOT := ..
+
+INST_DIR ?= /usr/bin
+
+IBIN = xenio
+
+override CFLAGS += \
+	-I$(BLKTAP_ROOT)/include \
+	-I$(BLKTAP_ROOT)/control \
+	-I$(XEN_ROOT)/tools/libxc \
+	-I$(XEN_ROOT)/tools/xenstore \
+	-D_GNU_SOURCE \
+	$(CFLAGS_xeninclude) \
+    -Wall \
+    -Wextra \
+    -Werror
+
+# FIXME cause trouble
+override CFLAGS += \
+    -Wno-old-style-declaration \
+    -Wno-sign-compare \
+    -Wno-type-limits
+
+override LDFLAGS = \
+    -L$(XEN_ROOT)/tools/xenstore -lxenstore
+
+XENIO-OBJS := log.o
+
+all: $(IBIN)
+
+$(BLKTAP_ROOT)/control/libblktapctl.a:
+	make -C $(BLKTAP_ROOT)/control libblktapctl.a
+
+$(IBIN): $(XENIO-OBJS) xenio.o $(BLKTAP_ROOT)/control/libblktapctl.a
+	$(CC) -o $@ $^ $(LDFLAGS)
+
+install: all
+	$(INSTALL_DIR) -p $(DESTDIR)$(INST_DIR)
+	$(INSTALL_PROG) $(IBIN) $(DESTDIR)$(INST_DIR)
+
+clean:
+	rm -f *.o *.o.d .*.o.d $(IBIN)
+
+.PHONY: clean install

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:21:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:21:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdiVz-0003p5-1x; Wed, 28 Nov 2012 14:21:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TdiVw-0003oV-QA
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 14:21:25 +0000
Received: from [85.158.137.99:36639] by server-10.bemta-3.messagelabs.com id
	0E/21-19806-4ED16B05; Wed, 28 Nov 2012 14:21:24 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354112483!16913086!2
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7714 invoked from network); 28 Nov 2012 14:21:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:21:23 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16048730"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 14:21:23 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 14:21:23 +0000
MIME-Version: 1.0
X-Mercurial-Node: d426fc26719748805aafd873f5616cd8601a0108
Message-ID: <d426fc26719748805aaf.1354112411@makatos-desktop>
In-Reply-To: <patchbomb.1354112410@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 28 Nov 2012 14:20:11 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 1 of 5 RFC] blktap3: Introduce fundamental xenio
	headers
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch introduces header files xenio-common.h, which contains common
definitions used by the xenio daemon, libxenio, and the users of libxenio, and
xenio-private.h, which contains private definitions used by the xenio daemon
and libxenio.

diff -r 84f51929a064 -r d426fc267197 tools/blktap3/xenio/xenio-common.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/blktap3/xenio/xenio-common.h	Wed Nov 28 14:11:43 2012 +0000
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ *
+ * Common definitions used by the xenio daemon, libxenio, and the users of
+ * libxenio.
+ */
+
+#ifndef __XENIO_COMMON_H__
+#define __XENIO_COMMON_H__
+
+#include <assert.h>
+
+/**
+ * Block I/O protocol
+ *
+ * TODO Why start from 1?
+ * TODO Define a macro that tells whether a protocol is supported.
+ */
+enum {
+    XENIO_BLKIF_PROTO_NATIVE = 1,
+    XENIO_BLKIF_PROTO_X86_32 = 2,
+    XENIO_BLKIF_PROTO_X86_64 = 3,
+};
+#endif /* __XENIO_COMMON_H__ */
diff -r 84f51929a064 -r d426fc267197 tools/blktap3/xenio/xenio-private.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/blktap3/xenio/xenio-private.h	Wed Nov 28 14:11:43 2012 +0000
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ *
+ * Private definitions used by the xenio daemon and libxenio.
+ */
+
+#ifndef __XENIO_PRIVATE_H__
+#define __XENIO_PRIVATE_H__
+
+#include "blktap3.h"
+#include <xenctrl.h>
+#include <stdlib.h>
+#include <syslog.h>
+
+void xenio_log(int prio, const char *fmt, ...);
+void (*xenio_vlog) (int prio, const char *fmt, va_list ap);
+
+#define DBG(_fmt, _args...)  xenio_log(LOG_DEBUG, "%s:%d "_fmt, __FILE__, \
+        __LINE__, ##_args)
+#define INFO(_fmt, _args...) xenio_log(LOG_INFO, _fmt, ##_args)
+#define WARN(_fmt, _args...) xenio_log(LOG_WARNING, "%s:%d "_fmt, __FILE__, \
+        __LINE__, ##_args)
+
+#endif /* __XENIO_PRIVATE_H__ */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:21:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:21:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdiVy-0003oy-Ml; Wed, 28 Nov 2012 14:21:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TdiVw-0003oU-Op
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 14:21:24 +0000
Received: from [85.158.137.99:40798] by server-13.bemta-3.messagelabs.com id
	00/B1-24887-3ED16B05; Wed, 28 Nov 2012 14:21:23 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354112483!16913086!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7693 invoked from network); 28 Nov 2012 14:21:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:21:23 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16048729"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 14:21:23 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 14:21:23 +0000
MIME-Version: 1.0
Message-ID: <patchbomb.1354112410@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 28 Nov 2012 14:20:10 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 0 of 5 RFC] blktap3: Introduce xenio daemon
 (coordinate blkfront with tapdisk).
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch series introduces the xenio daemon. This daemon is responsible for
coordinating blkfront and tapdisk, when blkfront changes state. It does so by
monitoring XenStore for blkfront state changes. The daemon creates/destroys the
shared ring, instructs the tapdisk to connect to/disconnect from it, and
manages the state of the back-end.

This series requires the RFC series described in
http://lists.xen.org/archives/html/xen-devel/2012-11/msg00875.html
in order to compile.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:21:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:21:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdiW0-0003ph-Mz; Wed, 28 Nov 2012 14:21:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TdiVx-0003ob-HS
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 14:21:26 +0000
Received: from [85.158.137.99:59425] by server-14.bemta-3.messagelabs.com id
	16/AE-31424-4ED16B05; Wed, 28 Nov 2012 14:21:24 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354112483!16913086!4
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7813 invoked from network); 28 Nov 2012 14:21:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:21:24 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16048733"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 14:21:23 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 14:21:23 +0000
MIME-Version: 1.0
X-Mercurial-Node: 7126fda1424905ed186f2df39ac7093bd8325030
Message-ID: <7126fda1424905ed186f.1354112413@makatos-desktop>
In-Reply-To: <patchbomb.1354112410@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 28 Nov 2012 14:20:13 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 3 of 5 RFC] blktap3: Introduce xenio.c,
 core xenio daemon functionality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Contains the core xenio daemon functionality, where it monitors XenStore for
blkfront state changes and acts in response to them. There is considerable
clean up left to do in this file (uninitialised struct members used,
misleading function names, obscure/cryptic functionality, some functions should
go in separate files etc.).

The xenio daemon monitors XenStore and when a Virtual Block Device must be
created, it creates the shared ring, instructs the tapdisk to connect to it, and
finally communicates any necessary information to blkfront via XenStore.

diff -r 6918a76c96d8 -r 7126fda14249 tools/blktap3/xenio/xenio.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/blktap3/xenio/xenio.c	Wed Nov 28 14:18:45 2012 +0000
@@ -0,0 +1,1947 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ *
+ * This file contains the xenio daemon. It is the user-space daemon responsible
+ * for instructing the tapdisk to connect to the shared ring when the block
+ * front-end becomes ready. It does so by monitoring XenStore for changes in
+ * blkfront state.
+ */
+
+/*
+ * TODO Some of these includes may be useless.
+ */
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <assert.h>
+#include <syslog.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <libgen.h>
+#include <getopt.h>
+#include <sys/ioctl.h>
+#include <sys/mount.h>
+#include <xenstore.h>
+#include <xen/xen.h>
+#include <xen/io/xenbus.h>
+#include <xen/grant_table.h>
+#include <xen/event_channel.h>
+
+#include "blktap3.h"
+#include "tap-ctl.h"
+#include "tap-ctl-xen.h"
+#include "tap-ctl-info.h"
+#include "xenio-common.h"
+#include "xenio-private.h"
+
+/**
+ * TODO Removes calls to this macro and replace with graceful error handling.
+ */
+#define BUG()			abort()
+
+#define BUG_ON(_cond)	if (unlikely(_cond)) BUG()
+
+#define ORDER_TO_PAGES(o)	(1 << (o))
+
+/*
+ * XenStore path components.
+ *
+ * TODO "xenio" is defined in the IDL, take it from there instead of
+ * hard-coding it here
+ */
+#define XENIO_BACKEND_NAME	"xenio"
+#define XENIO_BACKEND_PATH	"backend/"XENIO_BACKEND_NAME
+#define XENIO_BACKEND_TOKEN	"backend-"XENIO_BACKEND_NAME
+
+/*
+ * TODO The following structures are private to this file. Move them to a
+ * separate file for code simplification purposes?
+ */
+
+/**
+ * Additional state for the virtual block device (see struct xenio_device
+ * first).
+ *
+ * TODO Rename this struct, there's no blkback any more.
+ * 
+ * TODO Try to merge into xenio_device to simplify the code.
+ */
+typedef struct blkback_device {
+
+    /**
+     * FIXME This is used but isn't initialised anywhere!
+     */
+    dev_t dev;
+
+    /**
+     * TODO already in struct xenio_device
+     */
+    domid_t domid;
+
+    /**
+     * TODO The device ID. This is the same as xenio_device.devid, why do we
+     * keep two copies of it?
+     */
+    int devid;
+
+    /**
+     * The grant references as supplied from blkfront via XenStore. They are
+     * supplied to tapdisk.
+     *
+     * TODO Retrieving the grant references and supplying them to tapdisk is
+     * done in the same function, so we don't have to keep them around. The
+     * only _currently obvious_ reason for this member to exist is to detect
+     * whether the tapdisk is connected or not, and this can be achieved by
+     * using a dedicated member. Could there be another reason for which we
+     * need to keep them around?
+     */
+    grant_ref_t *gref;
+
+    /**
+     * TODO The only reason we're keeping this is for detecting whether
+     * tapdisk is connected.
+     */
+    evtchn_port_t port;
+
+    /**
+	 * Descriptor of the tapdisk process serving this virtual block device. We
+     * need this until the end of the VBD's lifetime in order to disconnect
+     * the tapdisk.
+	 */
+    tap_list_t tap;
+
+    /**
+	 * Sector size, supplied by the tapdisk, communicated to blkfront.
+	 */
+    unsigned int sector_size;
+
+    /**
+	 * Number of sectors, supplied by the tapdisk, communicated to blkfront.
+	 */
+    unsigned long long sectors;
+
+    /**
+     * FIXME This is used but isn't initialised anywhere! Maybe it's the
+     * useless "info" in blkback_probe_device?
+	 */
+    unsigned int info;
+} blkback_device_t;
+
+/**
+ * TODO A block device in the guest.
+ */
+typedef struct xenio_device {
+
+    /**
+	 * Device name, as retrieved from XenStore at probe-time.
+     *
+     * TODO What's the format of this string?
+     *
+     * TODO Duplicates blkback_device.devid.
+	 */
+    char *name;
+
+    /**
+	 * For linked lists.
+	 */
+     TAILQ_ENTRY(xenio_device) backend_entry;
+
+    /**
+	 * FIXME Supposed to solve some kind of race condition with libxl?
+	 */
+    long long serial;
+
+    /**
+	 * The domain ID this VBD belongs to.
+	 */
+    domid_t domid;
+
+    /**
+     * The root directory in XenStore for this VBD. This is where all
+     * directories and key/value pairs related to this VBD are stored.
+     */
+    char *frontend_path;
+
+    /**
+     * XenStore path to the VBD's state.
+     *
+     * TODO Do we really have to keep this around? This is just
+     * xenio_device.xenio_device + "/state".
+     */
+    char *frontend_state_path;
+
+    /**
+     * Additional state for the VBD.
+     */
+    blkback_device_t *bdev;
+
+} xenio_device_t;
+
+TAILQ_HEAD(tqh_xenio_device, xenio_device);
+
+/**
+ * TODO Organising these operation in such a way is not currently necessary
+ * since we only use one set of them (blkback_probe_device, blkback_remove, and
+ * blkback_frontend_changed). I guess it would make sense if we plan to have
+ * more of these, but I don't see a reason for this. Discuss whether we may
+ * need more of them or remove this struct.
+ */
+struct xenio_backend_ops {
+
+    /**
+     * Initialises the device handle.
+     *
+     * TODO misleading name
+     */
+    int (*probe) (xenio_device_t *, domid_t, const char *);
+
+    /**
+     * Frees the device handle.
+     *
+     * TODO misleading name
+     */
+    void (*remove) (xenio_device_t *);
+
+    /**
+     * To be executed in response to block front-end state changes.
+     */
+    int (*frontend_changed) (xenio_device_t *, XenbusState);
+};
+
+/**
+ * The collection of all necessary handles and descriptors.
+ */
+static struct xenio_backend {
+
+    /**
+	 * A handle to XenStore.
+	 */
+    struct xs_handle *xs;
+
+    /**
+     * For executing transacted operations on XenStore.
+     */
+    xs_transaction_t xst;
+
+    /**
+	 * The list of virtual block devices.
+	 */
+    struct tqh_xenio_device devices;
+
+    /**
+	 * For allocating serials.
+	 */
+    long long serial;
+
+    const struct xenio_backend_ops *ops;
+
+    /**
+     * TODO From xen/include/public/io/blkif.h: "The maximum supported size of
+     * the request ring buffer" 
+     */
+    int max_ring_page_order;
+} backend;
+
+#define xenio_backend_for_each_device(_device, _next)	\
+	TAILQ_FOREACH_SAFE(_device, &backend.devices, backend_entry, _next)
+
+/*
+ * TODO Here comes a set of functions used for accessing XenStore. It would
+ * be better to isolate them in a separate file since their functionality has
+ * nothing really to do with the daemon's logic.
+ */
+
+/**
+ * Prints the supplied arguments to a buffer and returns it. The buffer must
+ * be deallocated by the user.
+ */
+static char *
+vmprintf(const char * const fmt, va_list ap)
+{
+    char *s;
+    int n;
+
+    n = vasprintf(&s, fmt, ap);
+    if (n < 0)
+        s = NULL;
+
+    return s;
+}
+
+/**
+ * Prints the supplied arguments to a buffer and returns it. The buffer must
+ * be deallocated by the user.
+ */
+__printf(1, 2)
+static char *
+mprintf(const char * const fmt, ...)
+{
+    va_list ap;
+    char *s;
+
+    va_start(ap, fmt);
+    s = vmprintf(fmt, ap);
+    va_end(ap);
+
+    return s;
+}
+
+/**
+ * Reads the specified XenStore path. The caller must free the returned buffer.
+ *
+ * @param xs handle to XenStore
+ * @param xst XenStore transaction (TODO Maybe NULL?)
+ * @param fmt TODO
+ * @param ap TODO
+ * @returns TODO
+ *
+ * TODO Why don't we return the data pointer?
+ */
+static char *
+xenio_xs_vread(struct xs_handle * const xs, xs_transaction_t xst,
+        const char * const fmt, va_list ap)
+{
+    char *path, *data, *s = NULL;
+    unsigned int len;
+
+    assert(xs);
+
+    path = vmprintf(fmt, ap);
+    data = xs_read(xs, xst, path, &len);
+    DBG("XS read %s -> %s \n", path, data);
+    free(path);
+
+    if (data) {
+        s = strndup(data, len);
+        free(data);
+    }
+
+    return s;
+}
+
+/**
+ * Reads the specified XenStore path. The caller must free the returned buffer.
+ *
+ * @param xs handle to XenStore
+ * @param xst XenStore transaction (TODO Maybe NULL?)
+ * @param fmt TODO
+ * @returns TODO
+ */
+__printf(3, 4)
+static char *
+xenio_xs_read(struct xs_handle * const xs, xs_transaction_t xst,
+        const char * const fmt, ...)
+{
+    va_list ap;
+    char *s;
+
+    assert(xs);
+
+    va_start(ap, fmt);
+    s = xenio_xs_vread(xs, xst, fmt, ap);
+    va_end(ap);
+
+    return s;
+}
+
+/**
+ * Retrieves the value of the specified of the device from XenStore,
+ * i.e. backend/xenio/<domid>/<devname>/@path
+ *
+ * @param device the VBD 
+ * @param path the XenStore key
+ * @returns a buffer containing the value, the caller must free it
+ */
+static char *
+xenio_device_read(const xenio_device_t * const device, const char * const path)
+{
+    assert(device);
+    assert(path);
+
+    return xenio_xs_read(backend.xs, backend.xst, "%s/%d/%s/%s",
+            XENIO_BACKEND_PATH, device->domid, device->name, path);
+}
+
+/**
+ * TODO Only called by xenio_device_scanf, merge into it?
+ */
+static inline int
+xenio_device_vscanf(xenio_device_t * const device, const char * const path,
+        const char * const fmt, va_list ap)
+{
+    char *s;
+    int n;
+
+    assert(device);
+    assert(path);
+
+    s = xenio_device_read(device, path);
+    if (!s)
+        return -1;
+
+    DBG("%s <- %s\n", path, s);
+    n = vsscanf(s, fmt, ap);
+    free(s);
+
+    return n;
+}
+
+/**
+ * TODO Only called by xenio_device_check_serial, merge into it?
+ */
+__scanf(3, 4)
+static int
+xenio_device_scanf(xenio_device_t * const device, const char * const path,
+        const char * const fmt, ...)
+{
+    va_list ap;
+    int n;
+
+    assert(device);
+    assert(path);
+
+    va_start(ap, fmt);
+    n = xenio_device_vscanf(device, path, fmt, ap);
+    va_end(ap);
+
+    return n;
+}
+
+/**
+ * Retrieves the XenStore value of the specified key of the VBD's front-end.
+ *
+ * @param device the VBD
+ * @param path key under the front-end directory
+ * @returns a buffer containing the value, the caller must free it
+ */
+static char *
+xenio_device_read_otherend(xenio_device_t * const device,
+        const char * const path)
+{
+    assert(device);
+    assert(path);
+
+    return xenio_xs_read(backend.xs, backend.xst, "%s/%s",
+            device->frontend_path, path);
+}
+
+/**
+ * Reads the specified XenStore path under the front-end directory in a
+ * scanf-like manner.
+ *
+ * TODO Only called by xenio_device_scanf_otherend, merge into it?
+ */
+static inline int
+xenio_device_vscanf_otherend(xenio_device_t * const device,
+        const char * const path, const char * const fmt, va_list ap)
+{
+    char *s;
+    int n;
+
+    assert(device);
+    assert(path);
+
+    s = xenio_device_read_otherend(device, path);
+    if (!s)
+        return -1;
+
+    n = vsscanf(s, fmt, ap);
+    free(s);
+
+    return n;
+}
+
+/**
+ * Reads the specified XenStore path under the front-end directory in a
+ * scanf-like manner.
+ *
+ * @param device the VBD
+ * @param path TODO
+ * @param fmt TODO
+ */
+__scanf(3, 4)
+static int
+xenio_device_scanf_otherend(xenio_device_t * const device,
+        const char * const path, const char * const fmt, ...)
+{
+    va_list ap;
+    int n;
+
+    assert(device);
+    assert(path);
+
+    va_start(ap, fmt);
+    n = xenio_device_vscanf_otherend(device, path, fmt, ap);
+    va_end(ap);
+
+    return n;
+}
+
+/**
+ * TODO Only called by xenio_device_printf.
+ *
+ * @returns 0 on success, an error code otherwise
+ */
+static inline int
+xenio_device_vprintf(xenio_device_t * const device, const char * const key,
+        const int mkread, const char * const fmt, va_list ap)
+{
+    char *path = NULL, *val = NULL;
+    bool nerr;
+    int err;
+
+    assert(device);
+    assert(key);
+
+    path = mprintf("%s/%d/%s/%s", XENIO_BACKEND_PATH, device->domid,
+            device->name, key);
+    if (!path) {
+        err = -errno;
+        goto fail;
+    }
+
+    val = vmprintf(fmt, ap);
+    if (!val) {
+        err = -errno;
+        goto fail;
+    }
+
+    DBG("%s -> %s\n", path, val);
+    nerr = xs_write(backend.xs, backend.xst, path, val, strlen(val));
+    if (!nerr) {
+        err = -errno;
+        goto fail;
+    }
+
+    if (mkread) {
+        struct xs_permissions perms = {
+            device->domid,
+            XS_PERM_READ
+        };
+
+        nerr = xs_set_permissions(backend.xs, backend.xst, path, &perms, 1);
+        if (!nerr) {
+            err = -errno;
+            goto fail;
+        }
+    }
+
+    err = 0;
+
+fail:
+    if (path)
+        free(path);
+    if (val)
+        free(val);
+
+    return err;
+}
+
+/**
+ * Writes to XenStore backened/xenio/<domid>/<devname>/@key = @fmt. If @mkread
+ * is non-zero TODO the xenstore key/value pair is read-only?
+ *
+ * @param device the VBD
+ * @param key the key to write to
+ * @param mkread TODO
+ * @param fmt TODO
+ * @returns 0 on success, an error code otherwise
+ */
+__printf(4, 5)
+static int
+xenio_device_printf(xenio_device_t * const device, const char * const key,
+        const int mkread, const char * const fmt, ...)
+{
+    va_list ap;
+    int err;
+
+    assert(device);
+    assert(key);
+
+    va_start(ap, fmt);
+    err = xenio_device_vprintf(device, key, mkread, fmt, ap);
+    va_end(ap);
+
+    return err;
+}
+
+/**
+ * TODO Only called by xenio_backend_probe_device
+ *
+ * Returns 0 if the device's serial hasn't changed.
+ */
+static inline long long
+xenio_device_check_serial(xenio_device_t * const device)
+{
+    long long serial;
+    int n, err;
+
+    assert(device);
+
+    /* read backend/xenio/<domid>/<device name>/xenio-serial from xenstore */
+    n = xenio_device_scanf(device, "xenio-serial", "%lld", &serial);
+    if (n != 1) {
+        err = -EEXIST;
+        goto fail;
+    }
+
+    if (serial != device->serial) {
+        err = -EXDEV;
+        goto fail;
+    }
+
+    err = 0;
+fail:
+    return err;
+}
+
+/**
+ * Removes the XenStore watch from the front-end.
+ *
+ * @param device the VBD whose front-end XenStore path should stop being
+ * watched
+ */
+static void
+xenio_device_unwatch_frontend_state(xenio_device_t * const device)
+{
+    assert(device);
+
+    if (device->frontend_state_path)
+        xs_unwatch(backend.xs, device->frontend_state_path, "otherend-state");
+
+    if (device->frontend_state_path) {
+        free(device->frontend_state_path);
+        device->frontend_state_path = NULL;
+    }
+}
+
+/**
+ * Watches the frontend path, using otherend-state as the token. I.e.
+ * /local/domain/<domid>/device/vbd/<devname>/state
+ *
+ * TODO Only called by xenio_backend_create_device
+ */
+static inline int
+xenio_device_watch_frontend_state(xenio_device_t * const device)
+{
+    bool nerr;
+    int err;
+
+    assert(device);
+
+    device->frontend_state_path = mprintf("%s/state", device->frontend_path);
+    if (!device->frontend_state_path) {
+        err = -errno;
+        goto fail;
+    }
+
+    DBG("watching %s\n", device->frontend_state_path);
+
+    nerr = xs_watch(backend.xs, device->frontend_state_path, "otherend-state");
+    if (!nerr) {
+        err = -errno;
+        goto fail;
+    }
+
+    return 0;
+
+fail:
+    xenio_device_unwatch_frontend_state(device);
+    return err;
+}
+
+/**
+ *
+ * TODO Only called by xenio_backend_handle_otherend_watch, merge into it?
+ */
+static int
+xenio_device_check_frontend_state(xenio_device_t * const device)
+{
+    int state, err;
+    char *s, *end;
+
+    assert(device);
+
+    s = xenio_xs_read(backend.xs, backend.xst, "%s",
+            device->frontend_state_path);
+    if (!s) {
+        err = -errno;
+        goto fail;
+    }
+
+    state = strtol(s, &end, 0);
+    if (*end != 0 || end == s) {
+        err = -EINVAL;
+        goto fail;
+    }
+
+    err = backend.ops->frontend_changed(device, state);
+	DBG("change from state %d: %d\n", state, err);
+
+  fail:
+    free(s);
+    return err;
+}
+
+/**
+ * Switches the back-end state of the device by writing to XenStore.
+ *
+ * @param device the VBD
+ * @param state the state to switch to
+ * @returns 0 on success, an error code otherwise
+ */
+static int
+xenio_device_switch_state(xenio_device_t * const device,
+        const XenbusState state)
+{
+    assert(device);
+
+    /*
+     * TODO Ensure @state contains a legitimate XenbusState value.
+     * TODO Should we check for valid state transitions?
+     */
+
+    return xenio_device_printf(device, "state", 0, "%u", state);
+}
+
+/**
+ * Destroys and deallocates the back-end part of a VBD.
+ *
+ * @param device the VBD to destroy
+ */
+static void
+xenio_backend_destroy_device(xenio_device_t * const device)
+{
+    assert(device);
+
+    TAILQ_REMOVE(&backend.devices, device, backend_entry);
+
+    xenio_device_unwatch_frontend_state(device);
+
+    if (device->frontend_path) {
+        free(device->frontend_path);
+        device->frontend_path = NULL;
+    }
+
+    if (device->name) {
+        free(device->name);
+        device->name = NULL;
+    }
+
+    free(device);
+}
+
+/**
+ * TODO Only called by xenio_backend_probe_device, merge into it?
+ */
+static void
+xenio_backend_remove_device(xenio_device_t * const device)
+{
+    backend.ops->remove(device);
+    xenio_backend_destroy_device(device);
+}
+
+/**
+ * Creates a device and adds it to the list of devices.
+ * Initiates a XenStore watch to the blkfront state.
+ *
+ * Creating the device implies initializing the handle and retrieving all the
+ * information of the tapdisk serving this VBD.
+ *
+ * @param domid the ID of the domain where the VBD is created
+ * @param name TODO device name?
+ * @returns 0 on success, an error code otherwise
+ */
+static inline int
+xenio_backend_create_device(const int domid, const char * const name)
+{
+    xenio_device_t *device;
+    int err;
+
+    assert(name);
+
+    DBG("creating device %d/%s\n", domid, name);
+
+    device = calloc(1, sizeof(*device));
+    if (!device) {
+        WARN("error allocating memory\n");
+        err = -errno;
+        goto fail;
+    }
+
+	/*
+	 * TODO replace with alloc_serial() and check for overflow
+	 */
+    device->serial = backend.serial++;
+    device->domid = domid;
+
+    TAILQ_INSERT_TAIL(&backend.devices, device, backend_entry);
+
+    device->name = strdup(name);
+    if (!device->name) {
+        err = -errno;
+        goto fail;
+    }
+
+    /*
+     * Get the frontend path in XenStore. We need this to talk to blkfront.
+     */
+    device->frontend_path = xenio_device_read(device, "frontend");
+    DBG("frontend = '%s' (%d)\n", device->frontend_path, errno);
+    if (!device->frontend_path) {
+        err = -errno;
+        goto fail;
+    }
+
+    /*
+     * Write to xenstore xenio-serial and max-ring-page-order.
+     */
+    /* FIXME What's xenio-serial? */
+    err = xenio_device_printf(device, "xenio-serial", 0, "%lld",
+            device->serial);
+    if (err)
+        goto fail;
+
+    /*
+     * TODO Who uses this?
+     */
+    if (backend.max_ring_page_order)
+        err = xenio_device_printf(device, "max-ring-page-order", 0, "%d",
+                backend.max_ring_page_order);
+    if (err)
+        goto fail;
+
+    /*
+     * Get the tapdisk that is serving this virtual block device, along with
+     * it's parameters.
+     */
+    err = backend.ops->probe(device, device->domid, name);
+    if (err)
+        goto fail;
+
+	/*
+	 * Finally, watch the frontend path in XenStore for changes. Once the
+	 * frontend state has changed, we can continue. TODO
+	 */
+    err = xenio_device_watch_frontend_state(device);
+    if (err)
+        goto fail;
+
+    return 0;
+
+fail:
+    if (device) {
+        WARN("error creating device: domid=%d name=%s err=%d (%s)\n",
+             device->domid, device->name, err, strerror(-err));
+        xenio_backend_destroy_device(device);
+    }
+
+    return err;
+}
+
+/**
+ * TODO Only called by xenio_backend_device_exists, merge into it?
+ */
+__printf(3, 4)
+static inline bool
+xenio_xs_exists(struct xs_handle * const xs, xs_transaction_t xst,
+        const char * const fmt, ...)
+{
+    va_list ap;
+    char *s;
+
+    va_start(ap, fmt);
+    s = xenio_xs_vread(xs, xst, fmt, ap);
+    va_end(ap);
+    if (s)
+        free(s);
+
+    return s != NULL;
+}
+
+/**
+ * Tells whether the device exists on the domain by looking at xenstore.
+ *
+ * TODO Only called by xenio_backend_probe_device, merge into it?
+ */
+static inline bool
+xenio_backend_device_exists(const int domid, const char * const name)
+{
+    /* i.e. backend/xenio/<domid>/<device name> */
+    return xenio_xs_exists(backend.xs, backend.xst, "%s/%d/%s",
+            XENIO_BACKEND_PATH, domid, name);
+}
+
+/**
+ * Iterates over all devices and returns the one for which the condition is
+ * true.
+ */
+#define xenio_backend_find_device(_device, _cond)		\
+do {													\
+	xenio_device_t *__next;								\
+	int found = 0;										\
+	xenio_backend_for_each_device(_device, __next) {	\
+		if (_cond) {									\
+			found = 1;									\
+			break;										\
+		}												\
+	}													\
+	if (!found)											\
+		_device = NULL;									\
+} while (0)
+
+/**
+ * Creates (removes) a device depending on the existence (non-existence) of the
+ * "backend/xenio/@domid/@devname" XenStore path.
+ *
+ * @param domid the ID of the domain where the VBD is created
+ * @param devname device name
+ * @returns 0 on success, an error code otherwise
+ *
+ * TODO Find out what that xenio-serial thing does.
+ */
+static int
+xenio_backend_probe_device(const int domid, const char * const devname)
+{
+    bool exists, create, remove;
+    xenio_device_t *device;
+    int err;
+
+    assert(devname);
+
+    DBG("probe device domid=%d name=%s\n", domid, devname);
+
+    /*
+     * Ask XenStore if the device _should_ exist.
+     */
+    exists = xenio_backend_device_exists(domid, devname);
+
+    /*
+     * Search the device list for this specific device.
+     */
+    xenio_backend_find_device(device,
+            device->domid == domid && !strcmp(device->name, devname));
+
+    /*
+	 * If XenStore says that the device exists but it's not in our device list,
+     * we must create it. If it's the other way around, this is a removal. If
+     * XenStore says that the device exists and it's in our device list, TODO
+     * we must check serial.
+     */
+    remove = device && !exists;
+    create = exists && !device;
+
+    DBG("exists=%d device=%p remove=%d create=%d\n",
+        exists, device, remove, create);
+
+    if (device && exists) {
+        /*
+         * check the device serial, to sync with fast
+         * remove/re-create cycles.
+         */
+        remove = create = !!xenio_device_check_serial(device);
+
+        if (!create && !remove) {
+            DBG("neither create nor remove\n");
+        }
+    }
+
+	/*
+	 * TODO is this possible?
+	 */
+	assert(!(create && remove));
+
+    if (remove)
+        xenio_backend_remove_device(device);
+
+    if (create) {
+        err = xenio_backend_create_device(domid, devname);
+        if (err)
+            goto fail;
+    }
+
+    err = 0;
+fail:
+    return err;
+}
+
+/**
+ * TODO What does this function do? Seems like it scans for new devices.
+ *
+ * TODO Only called by xenio_backend_handle_backend_watch. Under which
+ * circumstances?
+ */
+static inline int
+xenio_backend_scan(void)
+{
+    xenio_device_t *device, *next;
+    unsigned int i, j, n, m;
+    char **dir;
+
+    /*
+     * scrap all non-existent devices
+     */
+
+    xenio_backend_for_each_device(device, next)
+        xenio_backend_probe_device(device->domid, device->name);
+
+    /*
+     * probe the new ones
+     */
+
+    dir = xs_directory(backend.xs, backend.xst, XENIO_BACKEND_PATH, &n);
+    if (!dir)
+        return 0;
+
+    /*
+     * TODO Looks like we're checking the XenStore paths of ALL domains, could
+     * there be a performance issue in the presence of many VMs?
+     */
+    for (i = 0; i < n; i++) {
+        char *path, **sub, *end;
+        int domid;
+
+        /*
+         * Get the domain ID.
+         */
+        domid = strtoul(dir[i], &end, 0);
+        if (*end != 0 || end == dir[i])
+            continue;
+
+        /*
+         * Read the devices of this domain.
+         */
+        path = mprintf("%s/%d", XENIO_BACKEND_PATH, domid);
+        assert(path != NULL);
+        sub = xs_directory(backend.xs, backend.xst, path, &m);
+        free(path);
+
+        /*
+         * Probe each device.
+         */
+        for (j = 0; j < m; j++)
+            xenio_backend_probe_device(domid, sub[j]);
+
+        free(sub);
+    }
+
+    free(dir);
+    return 0;
+}
+
+/**
+ * Act in response to a change in the front-end XenStore path.
+ *
+ * @param path the front-end's XenStore path that changed
+ * @returns 0 on success, an error code otherwise
+ *
+ * TODO Does blkfront write to this path?
+ *
+ * TODO Only called by xenio_backend_read_watch
+ */
+static inline int
+xenio_backend_handle_otherend_watch(const char * const path)
+{
+    xenio_device_t *device;
+    int err = 0;
+
+    assert(path);
+
+    /*
+     * Find the device that has the same frontend state path.
+     *
+     * TODO It seems that there should definitely be such a device in our list,
+     * otherwise this function would not have executed at all, since we would
+     * not be waiting on that xenstore path.  The xenstore patch we wait for
+     * is: /local/domain/<domid>/device/vbd/<devname>/state. In order to watch
+     * this path, it means that we have received a device create request, so
+     * the device will be there
+     */
+    xenio_backend_find_device(device,
+            !strcmp(device->frontend_state_path, path));
+    if (device) {
+        DBG("device: domid=%d name=%s\n", device->domid, device->name);
+        err = xenio_device_check_frontend_state(device);
+    } else {
+        WARN("XXX no device found!\n");
+        BUG();
+    }
+
+    return err;
+}
+
+/**
+ * Act in response to a change in the back-end XenStore path.
+ *
+ * If the path is "/backend" or "/backend/xenio", all devices are probed.
+ * Otherwise, the path should be "backend/xenio/<domid>/<device name>"
+ * (i.e. backend/xenio/1/51712), and in this case this specific device is
+ * probed.
+ *
+ * @param path the back-end's XenStore path that changed
+ * @returns 0 on success, an error code otherwise
+ *
+ * TODO Who modifies the back-end path in XenStore?
+ *
+ * TODO Only called by xenio_backend_read_watch.
+ */
+static inline int
+xenio_backend_handle_backend_watch(char * const path)
+{
+    char *s, *end, *name;
+    int domid;
+
+    assert(path);
+
+    /*
+	 * ignore the backend/xenio part
+	 */
+    s = strtok(path, "/");
+    assert(!strcmp(s, "backend"));
+    s = strtok(NULL, "/");
+    if (!s)
+        return xenio_backend_scan();
+
+    assert(!strcmp(s, XENIO_BACKEND_NAME));
+    s = strtok(NULL, "/");
+    if (!s)
+        return xenio_backend_scan();
+
+    /*
+	 * get the domain ID
+	 */
+    domid = strtoul(s, &end, 0);
+    if (*end != 0 || end == s)
+        return -EINVAL;
+
+    /*
+	 * get the device name
+	 */
+    name = strtok(NULL, "/");
+    if (!name)
+        return xenio_backend_scan();
+	else
+		/*
+		 * Create or remove the device, TODO or check it's serial.
+		 */
+		return xenio_backend_probe_device(domid, name);
+}
+
+/**
+ * Read changes that occurred on the "backend/xenio" XenStore path and act.
+ * Either the back-end path or the front-end path will have changed.
+ */
+static inline void
+xenio_backend_read_watch(void)
+{
+    char **watch, *path, *token;
+    unsigned int n;
+    int err, _abort;
+
+    /* read the change */
+    watch = xs_read_watch(backend.xs, &n);
+    path = watch[XS_WATCH_PATH];
+    token = watch[XS_WATCH_TOKEN];
+
+    DBG("--\n");
+    DBG("path=%s token=%s\n", path, token);
+
+    /*
+     * TODO Put the body of "again:" into a function instead of using goto.
+     */
+again:
+    backend.xst = xs_transaction_start(backend.xs);
+    if (!backend.xst) {
+        WARN("error starting transaction\n");
+        goto fail;
+    }
+
+    /*
+     * Token is either "otherend-state", indicating a change in the front-end,
+	 * or "backend-xenio", indicating a change in the back-end.
+     * TODO Who sets the token?
+     */
+    switch (token[0]) {
+
+    case 'o':
+        if (!strcmp(token, "otherend-state")) {
+            err = xenio_backend_handle_otherend_watch(path);
+            break;
+        }
+        /* TODO gracefully fail? */
+        BUG();
+
+    case 'b':
+        /*
+         * TODO verify the following:
+         *
+         * When blkfront (TODO or libxl?) requests a new VBD, the path
+         * '/<domid>/<devname>' is appended to 'backend/xenio'. In response,
+         * xenio creates the VBD handle and initializes it (i.e. it finds which
+         * tapdisk serves this VBD).)
+         *
+         * TODO The XenStore watch may trigger for a not yet discovered reason.
+         * The result is xenio_backend_handle_backend_watch not doing anything
+         * interesting, it only checks the 'xenio-serial'.
+         */
+        if (!strcmp(token, XENIO_BACKEND_TOKEN)) {
+            err = xenio_backend_handle_backend_watch(path);
+            break;
+        }
+        /* TODO gracefully fail? */
+        BUG();
+
+    default:
+        /* TODO gracefully fail? */
+        BUG();
+    }
+
+    _abort = !!err;
+    if (_abort)
+        DBG("aborting transaction: %s\n", strerror(-err));
+
+    err = xs_transaction_end(backend.xs, backend.xst, _abort);
+    backend.xst = 0;
+    if (!err) {
+        err = -errno;
+        /*
+         * This is OK according to xs_transaction_end's semantics.
+         */
+        if (errno == EAGAIN) {
+            goto again;
+        }
+        DBG("xs_transaction_end failed: %s\n", strerror(err));
+    }
+
+fail:
+    if (watch)
+        free(watch);
+    return;
+}
+
+static void
+xenio_backend_destroy(void)
+{
+    if (backend.xs) {
+        xs_daemon_close(backend.xs);
+        backend.xs = NULL;
+    }
+}
+
+/**
+ * Initializes the back-end descriptor. There is one back-end per xenio
+ * process. Also, it initiates a watch to XenStore on back-end/xenio.
+ *
+ * @param ops back-end operations, see struct xenio_backend_ops
+ * @param max_ring_page_order TODO
+ * @returns 0 on success, an error code otherwise
+ *
+ * TODO What's the use of the token? Aren't we the only ones to watch this
+ * path? It would only make sense if we want to run multiple xenio daemons.
+ */
+static inline int
+xenio_backend_create(const struct xenio_backend_ops * const ops,
+        const int max_ring_page_order)
+{
+    bool nerr;
+    int err = -EINVAL;
+
+    if (!ops) {
+        WARN("no backend operations\n");
+        goto fail;
+    }
+
+    backend.max_ring_page_order = max_ring_page_order;
+    TAILQ_INIT(&backend.devices);
+    backend.xst = XBT_NULL;
+
+    backend.xs = xs_daemon_open();
+    if (!backend.xs) {
+        err = -EINVAL;
+        goto fail;
+    }
+
+    /*
+     * Set a watch on the back-end path using a token.
+     *
+     * TODO Do we really need to supply a token, given that this is the _only_
+     * watch on this specific path by this process?
+     */
+    nerr = xs_watch(backend.xs, XENIO_BACKEND_PATH, XENIO_BACKEND_TOKEN);
+    if (!nerr) {
+        err = -errno;
+        goto fail;
+    }
+
+    backend.ops = ops;
+
+    return 0;
+
+fail:
+	xenio_backend_destroy();
+
+    return -err;
+}
+
+/**
+ * Retrieves the tapdisk designated to serve this device, storing this
+ * information in the supplied VBD handle.
+ *
+ * @param bdev the VBD handle for whose tapdisk handle should be retrieved
+ * @returns 0 on success, an error code otherwise
+ *
+ * FIXME How does this thing work since bdev->dev is never initialised?
+ *
+ * TODO Only called by blkback_probe, merge into it?
+ */
+static inline int
+blkback_find_tapdisk(blkback_device_t * const bdev)
+{
+    struct tqh_tap_list list;
+    tap_list_t *tap;
+    int err = 0;
+    int found = 0;
+
+    assert(bdev);
+
+    err = tap_ctl_list(&list);
+    if (err) {
+        WARN("error listing tapdisks: %s\n", strerror(err));
+        return err;
+    }
+
+    if (!TAILQ_EMPTY(&list)) {
+        tap_list_for_each_entry(tap, &list)
+            if (tap->minor == minor(bdev->dev)) {
+                found = 1;
+                break;
+            }
+    } else {
+        WARN("no tapdisks\n");
+    }
+
+    /*
+     * FIXME Shouldn't we free the list? Memory leak!?
+     */
+
+    if (!found)
+        return -ENOENT;
+
+    memcpy(&bdev->tap, tap, sizeof(bdev->tap));
+
+    return 0;
+}
+
+/**
+ * TODO Only called by blkback_connect_tap, merge into it?
+ */
+static inline int
+blkback_read_otherend_proto(xenio_device_t * const xbdev)
+{
+    char *s;
+
+    assert(xbdev);
+
+    s = xenio_device_read_otherend(xbdev, "protocol");
+    if (!s)
+        return XENIO_BLKIF_PROTO_NATIVE;
+
+    switch (s[0]) {
+    case 'x':
+        if (!strcmp(s, "x86_32-abi"))
+            return XENIO_BLKIF_PROTO_X86_32;
+
+        if (!strcmp(s, "x86_64-abi"))
+            return XENIO_BLKIF_PROTO_X86_64;
+    }
+
+    free(s);
+    return -EINVAL;
+}
+
+/**
+ * Core functions that instructs the tapdisk to connect to the shared ring and
+ * communicates essential information to blkfront.
+ * TODO Elaborate more.
+ * TODO Verify that the XenStore values written in the "write_info:" section
+ * are for blkfront. If this is true, rename the function as its name is
+ * misleading.
+ *
+ * @param xbdev the VBD to which the tapdisk should connect
+ * @returns 0 on success, an error code otherwise
+ *
+ * TODO Only called by blkback_frontend_changed.
+ */
+static inline int
+blkback_connect_tap(xenio_device_t * const xbdev)
+{
+    blkback_device_t *bdev;
+
+    /*
+     * The event channel port to receive/provide notifications, dictated by
+     * blkfront.
+     */
+    evtchn_port_t port;
+
+    grant_ref_t *gref = NULL;
+    int n, proto, err = 0;
+    int order;
+    char *pool;
+    char ring_ref[12]; /* TODO Why 12? */
+
+    assert(xbdev);
+
+    bdev = xbdev->bdev;
+
+    /*
+     * TODO Use a clearer way to indicate whether a tapdisk is already
+     * connected?
+     */
+    if (bdev->gref) {
+        /*
+         * TODO Why should this function be called on an already connected
+         * VBD? Why re-write the sector size etc. in XenStore for an already
+         * connected VBD?
+         */
+        DBG("blkback already connected to tapdisk.\n");
+        goto write_info;
+    }
+
+    n = xenio_device_scanf_otherend(xbdev, "ring-page-order", "%d", &order);
+    if (n != 1)
+        order = 0;
+
+    gref = calloc(ORDER_TO_PAGES(order), sizeof(grant_ref_t));
+    if (!gref) {
+        DBG("Failed to allocate memory for grant refs.\n");
+        err = ENOMEM;
+        goto fail;
+    }
+
+    /*
+     * FIXME Figure out what the body of this if-else does.
+     */
+    if (order) {
+        int i;
+        for (i = 0; i < (1 << order); i++) {
+            sprintf(ring_ref, "ring-ref%d", i);
+            n = xenio_device_scanf_otherend(xbdev, ring_ref, "%u", &gref[i]);
+            if (n != 1) {
+                DBG("Failed to read grant ref #%d.\n", i);
+                err = ENOENT;
+                goto fail;
+            }
+            DBG("%s = %d\n", ring_ref, gref[i]);
+        }
+    } else {
+        /*
+         * TODO Does this mean there's only one page in the ring?
+         */
+        n = xenio_device_scanf_otherend(xbdev, "ring-ref", "%u", &gref[0]);
+        if (n != 1) {
+            DBG("Failed to read grant ref.\n");
+            err = ENOENT;
+            goto fail;
+        }
+
+        DBG("ring-ref = %d\n", gref[0]);
+    }
+
+    /*
+     * Retrieve the event channel, dictated by blkfront.
+     */
+    n = xenio_device_scanf_otherend(xbdev, "event-channel", "%u", &port);
+    if (n != 1) {
+        DBG("Failed to read event channel.\n");
+        err = ENOENT;
+        goto fail;
+    }
+
+    /*
+     * Read the guest VM's ABI.
+     */
+    proto = blkback_read_otherend_proto(xbdev);
+    if (proto < 0) {
+        DBG("Failed to read protocol.\n");
+        err = ENOENT;
+        goto fail;
+    }
+
+    /*
+     * TODO What's this? Who writes this?
+     */
+    pool = xenio_device_read(xbdev, "sm-data/frame-pool");
+
+    DBG("connecting vbd-%d-%d (order %d, evt %d, proto %d, pool %s)"
+        " to tapdisk %d minor %d\n",
+        bdev->domid, bdev->devid, order, port, proto, pool, bdev->tap.pid,
+        bdev->tap.minor);
+
+    /*
+     * Instruct the tapdisk to connect to the shared ring.
+     */
+    err = tap_ctl_connect_xenblkif(bdev->tap.pid, bdev->tap.minor, bdev->domid,
+            bdev->devid, gref, order, port, proto, pool);
+    DBG("err=%d errno=%d\n", err, errno);
+    if (err)
+        goto fail;
+
+    bdev->gref = gref;
+    gref = NULL;
+    bdev->port = port;
+
+    /*
+     * TODO This part is not implied by the function's name. Even if we rename
+     * this function, we should put the following section in a separate
+     * (static) function for code clarity and maintainability purpose.
+     */
+write_info:
+
+    /*
+     * TODO Write the sector size to XenStore so that blkfront knows
+     * the sector size of the block device it will create?
+     */
+    err = xenio_device_printf(xbdev, "sector-size", 1, "%u",
+            bdev->sector_size);
+    if (err) {
+        DBG("Failed to write sector-size.\n");
+        goto fail;
+    }
+
+    /*
+     * Write the number of sectors, sector size, and info to the back-end path
+     * in XenStore so that blkfront creates a VBD with the appropriate
+     * characteristics.
+     */
+    err = xenio_device_printf(xbdev, "sectors", 1, "%llu", bdev->sectors);
+    if (err) {
+        DBG("Failed to write sectors.\n");
+        goto fail;
+    }
+
+    err = xenio_device_printf(xbdev, "info", 1, "%u", bdev->info);
+    if (err) {
+        DBG("Failed to write info.\n");
+        goto fail;
+    }
+
+    err = xenio_device_switch_state(xbdev, XenbusStateConnected);
+    if (err) {
+        DBG("Failed to switch state %d\n", err);
+    }
+
+fail:
+    if (err) {
+        if (bdev->gref) {
+            tap_ctl_disconnect_xenblkif(bdev->tap.pid, bdev->tap.minor,
+                    bdev->domid, bdev->devid, NULL);
+
+            gref = bdev->gref;
+            bdev->gref = NULL;
+        }
+    }
+
+    if (gref)
+        free(gref);
+
+    return err;
+}
+
+/**
+ * Instructs the tapdisk to disconnect itself from the shared ring.
+ * TODO It also switches state, which isn't implied by the function's name,
+ * rename function?
+ *
+ * @param xbdev the VBD whose tapdisk should be disconnected
+ * @returns 0 on success, an error code otherwise
+ *
+ * TODO Only called by blkback_frontend_changed.
+ */
+static inline int
+blkback_disconnect_tap(xenio_device_t * const xbdev)
+{
+    blkback_device_t *bdev;
+    int err = 0;
+
+    assert(xbdev);
+
+    bdev = xbdev->bdev;
+    assert(bdev);
+
+    if (bdev->gref == NULL || bdev->port < 0)
+        return err;
+
+    DBG("disconnecting vbd-%d-%d from tapdisk %d minor %d\n",
+        bdev->domid, bdev->devid, bdev->tap.pid, bdev->tap.minor);
+
+    err = tap_ctl_disconnect_xenblkif(bdev->tap.pid, bdev->tap.minor,
+            bdev->domid, bdev->devid, NULL);
+    if (err && errno != -ESRCH)
+        goto fail;
+
+    free(bdev->gref);
+    bdev->gref = NULL;
+    bdev->port = -1;
+
+    err = xenio_device_switch_state(xbdev, XenbusStateClosed);
+fail:
+    return err;
+}
+
+/**
+ * Retrieves the VBD parameters from the tapdisk and initialises the device
+ * handle with them.
+ *
+ * @param xbdev the VBD whose tapdisk parameters should be retrieved
+ * @returns 0 on success, an error code otherwise
+ *
+ * TODO aren't these supplied by blkback_find_tapdisk/tap_ctl_list?
+ * TODO only called by blkback_probe.
+ * TODO Very misleading function name
+ */
+static inline int
+blkback_probe_device(xenio_device_t * const xbdev)
+{
+    blkback_device_t *bdev;
+    int err;
+    unsigned int info;
+
+    assert(xbdev);
+
+    bdev = xbdev->bdev;
+    assert(bdev);
+
+    /*
+     * TODO info is unused, maybe it's the info that should be set in
+     * blkback_device?
+     */
+    err = tap_ctl_info(bdev->tap.pid, bdev->tap.minor, &bdev->sectors,
+            &bdev->sector_size, &info);
+    if (err)
+        WARN("tap_ctl_info failed %d\n", err);
+    else
+        DBG("sectors=%llu sector-size=%d\n", bdev->sectors,
+            bdev->sector_size);
+
+    return err;
+}
+
+/**
+ * Deallocates a struct blkback_device.
+ */
+static void
+blkback_device_destroy(blkback_device_t * const bdev)
+{
+	assert(bdev);
+
+    if (bdev->gref)
+        free(bdev->gref);
+    free(bdev);
+}
+
+/**
+ * Initialises the VBD with information regarding the tapdisk that is serving
+ * it.
+ *
+ * @param xbdev the device to initialise
+ * @param domid the ID of the domain where the VBD is created
+ * @param name TODO the device name (as retrieved from blkfront via XenStore)
+ * @returns 0 on success, an error code otherwise
+ *
+ * TODO The function name is very misleading.
+ */
+static int
+blkback_probe(xenio_device_t * const xbdev, const domid_t domid,
+        const char * const name)
+{
+    blkback_device_t *bdev;
+    int err;
+    char *end;
+
+    assert(xbdev);
+    assert(name);
+
+    DBG("probe blkback %s-%d-%s\n", XENIO_BACKEND_NAME, xbdev->domid,
+        xbdev->name);
+
+    bdev = calloc(1, sizeof(*bdev));
+    if (!bdev) {
+        WARN("error allocating memory\n");
+        err = -errno;
+        goto fail;
+    }
+    xbdev->bdev = bdev;
+
+    bdev->domid = domid;
+    bdev->devid = strtoul(name, &end, 0);
+    if (*end != 0 || end == name) {
+        err = -EINVAL;
+        goto fail;
+    }
+
+    DBG("devid=%d\n", bdev->devid);
+    err = blkback_find_tapdisk(bdev);
+    if (err) {
+        WARN("error looking for tapdisk: %s", strerror(err));
+        goto fail;
+    }
+
+    /*
+     * get the VBD parameters from the tapdisk
+     */
+    blkback_probe_device(xbdev);
+    DBG("got %s-%d-%d with tapdev %d/%d\n", XENIO_BACKEND_NAME,
+        xbdev->domid, bdev->devid, bdev->tap.pid, bdev->tap.minor);
+
+    return 0;
+
+fail:
+    if (bdev)
+        blkback_device_destroy(bdev);
+
+    return err;
+}
+
+/**
+ * Deallocates the VBD.
+ *
+ * TODO misleading function name
+ */
+static void
+blkback_remove(xenio_device_t * const xbdev)
+{
+    blkback_device_t *bdev;
+
+    assert(xbdev);
+    bdev = xbdev->bdev;
+
+    DBG("remove %s-%d-%s\n", XENIO_BACKEND_NAME, xbdev->domid, xbdev->name);
+
+    blkback_device_destroy(bdev);
+}
+
+/**
+ * Acts on changes in the front-end state.
+ *
+ * @param xbdev the VBD whose front-end state changed
+ * @param state the new state
+ * @returns 0 on success, an error code otherwise
+ *
+ * TODO Only called by xenio_device_check_front-end_state.
+ * TODO Ensure that @state is a valid XenbusState.
+ * TODO Replace the switch statement with a despatch table.
+ * TODO Functions called here in response to a state change do not have
+ * consistent names with each other (e.g. xenio_device_switch_state vs.
+ * blkback_connect_tap).
+ */
+static inline int
+blkback_frontend_changed(xenio_device_t * const xbdev, const XenbusState state)
+{
+    int err = 0;
+
+    assert(xbdev);
+
+    DBG("frontend_changed %s-%d-%s state=%d\n", XENIO_BACKEND_NAME,
+            xbdev->domid, xbdev->name, state);
+
+    /*
+     * TODO replace with a despatch table
+     */
+    switch (state) {
+    case XenbusStateUnknown:
+        /* TODO wtf */
+        break;
+
+        /* 
+         * Switch our state from Initialising (1) to InitWait (2). Absolutely
+         * nothing else to do.
+         */
+    case XenbusStateInitialising:
+        err = xenio_device_switch_state(xbdev, XenbusStateInitWait);
+        break;
+
+        /*
+         * XXX 
+         */
+    case XenbusStateInitialised:
+    case XenbusStateConnected:
+        err = blkback_connect_tap(xbdev);
+        break;
+
+    case XenbusStateClosing:
+        err = xenio_device_switch_state(xbdev, XenbusStateClosing);
+        break;
+
+    case XenbusStateClosed:
+        err = blkback_disconnect_tap(xbdev);
+        break;
+
+    case XenbusStateReconfiguring:
+    case XenbusStateReconfigured:
+        /* wtf */
+        break;
+
+    case XenbusStateInitWait:
+        /* fatal */
+        break;
+    }
+
+    return err;
+}
+
+/**
+ * FIXME are we using any other operations?
+ */
+static struct xenio_backend_ops blkback_ops = {
+    .probe = blkback_probe,
+    .remove = blkback_remove,
+    .frontend_changed = blkback_frontend_changed,
+};
+
+/**
+ * Runs the daemon.
+ *
+ * It watches XenStore (backend/xenio) for changes and when it detects one, it
+ * creates or removes a VBD.
+ */
+static inline int
+xenio_backend_run(void)
+{
+    const int fd = xs_fileno(backend.xs);
+	int err;
+
+    do {
+        fd_set rfds;
+        int nfds;
+
+        FD_ZERO(&rfds);
+        FD_SET(fd, &rfds);
+
+        /* poll the fd for changes in the XenStore path we're interested in */
+        nfds = select(fd + 1, &rfds, NULL, NULL, NULL);
+        if (nfds < 0) {
+            perror("select");
+            err = -errno;
+            break;
+        }
+
+        if (FD_ISSET(fd, &rfds))
+            xenio_backend_read_watch();
+    } while (1);
+
+    return err;
+}
+
+static char *blkback_ident;
+
+static void
+blkback_vlog_fprintf(const int prio, const char * const fmt, va_list ap)
+{
+    const char *strprio[] = {
+        [LOG_DEBUG] = "DBG",
+        [LOG_INFO] = "INF",
+        [LOG_WARNING] = "WRN"
+    };
+
+    BUG_ON(prio < 0);
+    BUG_ON(prio > sizeof(strprio) / sizeof(strprio[0]));
+    BUG_ON(!strprio[prio]);
+
+    fprintf(stderr, "%s[%s] ", blkback_ident, strprio[prio]);
+    vfprintf(stderr, fmt, ap);
+}
+
+/**
+ * Print xenio's usage instructions.
+ */
+static void
+usage(FILE * const stream, const char * const prog)
+{
+    fprintf(stream,
+            "usage: %s\n"
+            "\t[-m|--max-ring-order <max ring page order>]\n"
+            "\t[-D|--debug]\n"
+			"\t[-h|--help]\n", prog);
+}
+
+int main(int argc, char **argv)
+{
+    const char *prog;
+    int opt_debug, opt_max_ring_page_order;
+    int err;
+
+    prog = basename(argv[0]);
+
+    opt_debug = 0;
+    opt_max_ring_page_order = 0;
+
+    do {
+        const struct option longopts[] = {
+            {"help", 0, NULL, 'h'},
+            {"max-ring-order", 1, NULL, 'm'},
+            {"debug", 0, NULL, 'D'},
+        };
+        int c;
+
+        c = getopt_long(argc, argv, "hm:n:D", longopts, NULL);
+        if (c < 0)
+            break;
+
+        switch (c) {
+        case 'h':
+            usage(stdout, prog);
+            return 0;
+        case 'm':
+            opt_max_ring_page_order = atoi(optarg);
+            if (opt_max_ring_page_order < 0)
+                goto usage;
+            break;
+        case 'D':
+            opt_debug = 1;
+            break;
+        case '?':
+            goto usage;
+        }
+    } while (1);
+
+    blkback_ident = XENIO_BACKEND_TOKEN;
+    if (opt_debug)
+        xenio_vlog = blkback_vlog_fprintf;
+    else
+        openlog(blkback_ident, 0, LOG_DAEMON);
+
+    if (!opt_debug) {
+        err = daemon(0, 0);
+        if (err) {
+            err = -errno;
+            goto fail;
+        }
+    }
+
+	if ((err = xenio_backend_create(&blkback_ops, opt_max_ring_page_order))) {
+        WARN("error creating blkback: %s\n", strerror(err));
+        goto fail;
+    }
+
+    err = xenio_backend_run();
+
+    xenio_backend_destroy();
+
+fail:
+    return err ? -err : 0;
+
+usage:
+    usage(stderr, prog);
+    return 1;
+}

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:21:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:21:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdiVy-0003oy-Ml; Wed, 28 Nov 2012 14:21:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TdiVw-0003oU-Op
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 14:21:24 +0000
Received: from [85.158.137.99:40798] by server-13.bemta-3.messagelabs.com id
	00/B1-24887-3ED16B05; Wed, 28 Nov 2012 14:21:23 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354112483!16913086!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7693 invoked from network); 28 Nov 2012 14:21:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:21:23 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16048729"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 14:21:23 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 14:21:23 +0000
MIME-Version: 1.0
Message-ID: <patchbomb.1354112410@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 28 Nov 2012 14:20:10 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 0 of 5 RFC] blktap3: Introduce xenio daemon
 (coordinate blkfront with tapdisk).
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch series introduces the xenio daemon. This daemon is responsible for
coordinating blkfront and tapdisk, when blkfront changes state. It does so by
monitoring XenStore for blkfront state changes. The daemon creates/destroys the
shared ring, instructs the tapdisk to connect to/disconnect from it, and
manages the state of the back-end.

This series requires the RFC series described in
http://lists.xen.org/archives/html/xen-devel/2012-11/msg00875.html
in order to compile.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:21:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:21:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdiW0-0003ph-Mz; Wed, 28 Nov 2012 14:21:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TdiVx-0003ob-HS
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 14:21:26 +0000
Received: from [85.158.137.99:59425] by server-14.bemta-3.messagelabs.com id
	16/AE-31424-4ED16B05; Wed, 28 Nov 2012 14:21:24 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354112483!16913086!4
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7813 invoked from network); 28 Nov 2012 14:21:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:21:24 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16048733"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 14:21:23 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 14:21:23 +0000
MIME-Version: 1.0
X-Mercurial-Node: 7126fda1424905ed186f2df39ac7093bd8325030
Message-ID: <7126fda1424905ed186f.1354112413@makatos-desktop>
In-Reply-To: <patchbomb.1354112410@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 28 Nov 2012 14:20:13 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 3 of 5 RFC] blktap3: Introduce xenio.c,
 core xenio daemon functionality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Contains the core xenio daemon functionality, where it monitors XenStore for
blkfront state changes and acts in response to them. There is considerable
clean up left to do in this file (uninitialised struct members used,
misleading function names, obscure/cryptic functionality, some functions should
go in separate files etc.).

The xenio daemon monitors XenStore and when a Virtual Block Device must be
created, it creates the shared ring, instructs the tapdisk to connect to it, and
finally communicates any necessary information to blkfront via XenStore.

diff -r 6918a76c96d8 -r 7126fda14249 tools/blktap3/xenio/xenio.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/blktap3/xenio/xenio.c	Wed Nov 28 14:18:45 2012 +0000
@@ -0,0 +1,1947 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * 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 Lesser General Public License for more details.
+ *
+ * This file contains the xenio daemon. It is the user-space daemon responsible
+ * for instructing the tapdisk to connect to the shared ring when the block
+ * front-end becomes ready. It does so by monitoring XenStore for changes in
+ * blkfront state.
+ */
+
+/*
+ * TODO Some of these includes may be useless.
+ */
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <assert.h>
+#include <syslog.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <libgen.h>
+#include <getopt.h>
+#include <sys/ioctl.h>
+#include <sys/mount.h>
+#include <xenstore.h>
+#include <xen/xen.h>
+#include <xen/io/xenbus.h>
+#include <xen/grant_table.h>
+#include <xen/event_channel.h>
+
+#include "blktap3.h"
+#include "tap-ctl.h"
+#include "tap-ctl-xen.h"
+#include "tap-ctl-info.h"
+#include "xenio-common.h"
+#include "xenio-private.h"
+
+/**
+ * TODO Removes calls to this macro and replace with graceful error handling.
+ */
+#define BUG()			abort()
+
+#define BUG_ON(_cond)	if (unlikely(_cond)) BUG()
+
+#define ORDER_TO_PAGES(o)	(1 << (o))
+
+/*
+ * XenStore path components.
+ *
+ * TODO "xenio" is defined in the IDL, take it from there instead of
+ * hard-coding it here
+ */
+#define XENIO_BACKEND_NAME	"xenio"
+#define XENIO_BACKEND_PATH	"backend/"XENIO_BACKEND_NAME
+#define XENIO_BACKEND_TOKEN	"backend-"XENIO_BACKEND_NAME
+
+/*
+ * TODO The following structures are private to this file. Move them to a
+ * separate file for code simplification purposes?
+ */
+
+/**
+ * Additional state for the virtual block device (see struct xenio_device
+ * first).
+ *
+ * TODO Rename this struct, there's no blkback any more.
+ * 
+ * TODO Try to merge into xenio_device to simplify the code.
+ */
+typedef struct blkback_device {
+
+    /**
+     * FIXME This is used but isn't initialised anywhere!
+     */
+    dev_t dev;
+
+    /**
+     * TODO already in struct xenio_device
+     */
+    domid_t domid;
+
+    /**
+     * TODO The device ID. This is the same as xenio_device.devid, why do we
+     * keep two copies of it?
+     */
+    int devid;
+
+    /**
+     * The grant references as supplied from blkfront via XenStore. They are
+     * supplied to tapdisk.
+     *
+     * TODO Retrieving the grant references and supplying them to tapdisk is
+     * done in the same function, so we don't have to keep them around. The
+     * only _currently obvious_ reason for this member to exist is to detect
+     * whether the tapdisk is connected or not, and this can be achieved by
+     * using a dedicated member. Could there be another reason for which we
+     * need to keep them around?
+     */
+    grant_ref_t *gref;
+
+    /**
+     * TODO The only reason we're keeping this is for detecting whether
+     * tapdisk is connected.
+     */
+    evtchn_port_t port;
+
+    /**
+	 * Descriptor of the tapdisk process serving this virtual block device. We
+     * need this until the end of the VBD's lifetime in order to disconnect
+     * the tapdisk.
+	 */
+    tap_list_t tap;
+
+    /**
+	 * Sector size, supplied by the tapdisk, communicated to blkfront.
+	 */
+    unsigned int sector_size;
+
+    /**
+	 * Number of sectors, supplied by the tapdisk, communicated to blkfront.
+	 */
+    unsigned long long sectors;
+
+    /**
+     * FIXME This is used but isn't initialised anywhere! Maybe it's the
+     * useless "info" in blkback_probe_device?
+	 */
+    unsigned int info;
+} blkback_device_t;
+
+/**
+ * TODO A block device in the guest.
+ */
+typedef struct xenio_device {
+
+    /**
+	 * Device name, as retrieved from XenStore at probe-time.
+     *
+     * TODO What's the format of this string?
+     *
+     * TODO Duplicates blkback_device.devid.
+	 */
+    char *name;
+
+    /**
+	 * For linked lists.
+	 */
+     TAILQ_ENTRY(xenio_device) backend_entry;
+
+    /**
+	 * FIXME Supposed to solve some kind of race condition with libxl?
+	 */
+    long long serial;
+
+    /**
+	 * The domain ID this VBD belongs to.
+	 */
+    domid_t domid;
+
+    /**
+     * The root directory in XenStore for this VBD. This is where all
+     * directories and key/value pairs related to this VBD are stored.
+     */
+    char *frontend_path;
+
+    /**
+     * XenStore path to the VBD's state.
+     *
+     * TODO Do we really have to keep this around? This is just
+     * xenio_device.xenio_device + "/state".
+     */
+    char *frontend_state_path;
+
+    /**
+     * Additional state for the VBD.
+     */
+    blkback_device_t *bdev;
+
+} xenio_device_t;
+
+TAILQ_HEAD(tqh_xenio_device, xenio_device);
+
+/**
+ * TODO Organising these operation in such a way is not currently necessary
+ * since we only use one set of them (blkback_probe_device, blkback_remove, and
+ * blkback_frontend_changed). I guess it would make sense if we plan to have
+ * more of these, but I don't see a reason for this. Discuss whether we may
+ * need more of them or remove this struct.
+ */
+struct xenio_backend_ops {
+
+    /**
+     * Initialises the device handle.
+     *
+     * TODO misleading name
+     */
+    int (*probe) (xenio_device_t *, domid_t, const char *);
+
+    /**
+     * Frees the device handle.
+     *
+     * TODO misleading name
+     */
+    void (*remove) (xenio_device_t *);
+
+    /**
+     * To be executed in response to block front-end state changes.
+     */
+    int (*frontend_changed) (xenio_device_t *, XenbusState);
+};
+
+/**
+ * The collection of all necessary handles and descriptors.
+ */
+static struct xenio_backend {
+
+    /**
+	 * A handle to XenStore.
+	 */
+    struct xs_handle *xs;
+
+    /**
+     * For executing transacted operations on XenStore.
+     */
+    xs_transaction_t xst;
+
+    /**
+	 * The list of virtual block devices.
+	 */
+    struct tqh_xenio_device devices;
+
+    /**
+	 * For allocating serials.
+	 */
+    long long serial;
+
+    const struct xenio_backend_ops *ops;
+
+    /**
+     * TODO From xen/include/public/io/blkif.h: "The maximum supported size of
+     * the request ring buffer" 
+     */
+    int max_ring_page_order;
+} backend;
+
+#define xenio_backend_for_each_device(_device, _next)	\
+	TAILQ_FOREACH_SAFE(_device, &backend.devices, backend_entry, _next)
+
+/*
+ * TODO Here comes a set of functions used for accessing XenStore. It would
+ * be better to isolate them in a separate file since their functionality has
+ * nothing really to do with the daemon's logic.
+ */
+
+/**
+ * Prints the supplied arguments to a buffer and returns it. The buffer must
+ * be deallocated by the user.
+ */
+static char *
+vmprintf(const char * const fmt, va_list ap)
+{
+    char *s;
+    int n;
+
+    n = vasprintf(&s, fmt, ap);
+    if (n < 0)
+        s = NULL;
+
+    return s;
+}
+
+/**
+ * Prints the supplied arguments to a buffer and returns it. The buffer must
+ * be deallocated by the user.
+ */
+__printf(1, 2)
+static char *
+mprintf(const char * const fmt, ...)
+{
+    va_list ap;
+    char *s;
+
+    va_start(ap, fmt);
+    s = vmprintf(fmt, ap);
+    va_end(ap);
+
+    return s;
+}
+
+/**
+ * Reads the specified XenStore path. The caller must free the returned buffer.
+ *
+ * @param xs handle to XenStore
+ * @param xst XenStore transaction (TODO Maybe NULL?)
+ * @param fmt TODO
+ * @param ap TODO
+ * @returns TODO
+ *
+ * TODO Why don't we return the data pointer?
+ */
+static char *
+xenio_xs_vread(struct xs_handle * const xs, xs_transaction_t xst,
+        const char * const fmt, va_list ap)
+{
+    char *path, *data, *s = NULL;
+    unsigned int len;
+
+    assert(xs);
+
+    path = vmprintf(fmt, ap);
+    data = xs_read(xs, xst, path, &len);
+    DBG("XS read %s -> %s \n", path, data);
+    free(path);
+
+    if (data) {
+        s = strndup(data, len);
+        free(data);
+    }
+
+    return s;
+}
+
+/**
+ * Reads the specified XenStore path. The caller must free the returned buffer.
+ *
+ * @param xs handle to XenStore
+ * @param xst XenStore transaction (TODO Maybe NULL?)
+ * @param fmt TODO
+ * @returns TODO
+ */
+__printf(3, 4)
+static char *
+xenio_xs_read(struct xs_handle * const xs, xs_transaction_t xst,
+        const char * const fmt, ...)
+{
+    va_list ap;
+    char *s;
+
+    assert(xs);
+
+    va_start(ap, fmt);
+    s = xenio_xs_vread(xs, xst, fmt, ap);
+    va_end(ap);
+
+    return s;
+}
+
+/**
+ * Retrieves the value of the specified of the device from XenStore,
+ * i.e. backend/xenio/<domid>/<devname>/@path
+ *
+ * @param device the VBD 
+ * @param path the XenStore key
+ * @returns a buffer containing the value, the caller must free it
+ */
+static char *
+xenio_device_read(const xenio_device_t * const device, const char * const path)
+{
+    assert(device);
+    assert(path);
+
+    return xenio_xs_read(backend.xs, backend.xst, "%s/%d/%s/%s",
+            XENIO_BACKEND_PATH, device->domid, device->name, path);
+}
+
+/**
+ * TODO Only called by xenio_device_scanf, merge into it?
+ */
+static inline int
+xenio_device_vscanf(xenio_device_t * const device, const char * const path,
+        const char * const fmt, va_list ap)
+{
+    char *s;
+    int n;
+
+    assert(device);
+    assert(path);
+
+    s = xenio_device_read(device, path);
+    if (!s)
+        return -1;
+
+    DBG("%s <- %s\n", path, s);
+    n = vsscanf(s, fmt, ap);
+    free(s);
+
+    return n;
+}
+
+/**
+ * TODO Only called by xenio_device_check_serial, merge into it?
+ */
+__scanf(3, 4)
+static int
+xenio_device_scanf(xenio_device_t * const device, const char * const path,
+        const char * const fmt, ...)
+{
+    va_list ap;
+    int n;
+
+    assert(device);
+    assert(path);
+
+    va_start(ap, fmt);
+    n = xenio_device_vscanf(device, path, fmt, ap);
+    va_end(ap);
+
+    return n;
+}
+
+/**
+ * Retrieves the XenStore value of the specified key of the VBD's front-end.
+ *
+ * @param device the VBD
+ * @param path key under the front-end directory
+ * @returns a buffer containing the value, the caller must free it
+ */
+static char *
+xenio_device_read_otherend(xenio_device_t * const device,
+        const char * const path)
+{
+    assert(device);
+    assert(path);
+
+    return xenio_xs_read(backend.xs, backend.xst, "%s/%s",
+            device->frontend_path, path);
+}
+
+/**
+ * Reads the specified XenStore path under the front-end directory in a
+ * scanf-like manner.
+ *
+ * TODO Only called by xenio_device_scanf_otherend, merge into it?
+ */
+static inline int
+xenio_device_vscanf_otherend(xenio_device_t * const device,
+        const char * const path, const char * const fmt, va_list ap)
+{
+    char *s;
+    int n;
+
+    assert(device);
+    assert(path);
+
+    s = xenio_device_read_otherend(device, path);
+    if (!s)
+        return -1;
+
+    n = vsscanf(s, fmt, ap);
+    free(s);
+
+    return n;
+}
+
+/**
+ * Reads the specified XenStore path under the front-end directory in a
+ * scanf-like manner.
+ *
+ * @param device the VBD
+ * @param path TODO
+ * @param fmt TODO
+ */
+__scanf(3, 4)
+static int
+xenio_device_scanf_otherend(xenio_device_t * const device,
+        const char * const path, const char * const fmt, ...)
+{
+    va_list ap;
+    int n;
+
+    assert(device);
+    assert(path);
+
+    va_start(ap, fmt);
+    n = xenio_device_vscanf_otherend(device, path, fmt, ap);
+    va_end(ap);
+
+    return n;
+}
+
+/**
+ * TODO Only called by xenio_device_printf.
+ *
+ * @returns 0 on success, an error code otherwise
+ */
+static inline int
+xenio_device_vprintf(xenio_device_t * const device, const char * const key,
+        const int mkread, const char * const fmt, va_list ap)
+{
+    char *path = NULL, *val = NULL;
+    bool nerr;
+    int err;
+
+    assert(device);
+    assert(key);
+
+    path = mprintf("%s/%d/%s/%s", XENIO_BACKEND_PATH, device->domid,
+            device->name, key);
+    if (!path) {
+        err = -errno;
+        goto fail;
+    }
+
+    val = vmprintf(fmt, ap);
+    if (!val) {
+        err = -errno;
+        goto fail;
+    }
+
+    DBG("%s -> %s\n", path, val);
+    nerr = xs_write(backend.xs, backend.xst, path, val, strlen(val));
+    if (!nerr) {
+        err = -errno;
+        goto fail;
+    }
+
+    if (mkread) {
+        struct xs_permissions perms = {
+            device->domid,
+            XS_PERM_READ
+        };
+
+        nerr = xs_set_permissions(backend.xs, backend.xst, path, &perms, 1);
+        if (!nerr) {
+            err = -errno;
+            goto fail;
+        }
+    }
+
+    err = 0;
+
+fail:
+    if (path)
+        free(path);
+    if (val)
+        free(val);
+
+    return err;
+}
+
+/**
+ * Writes to XenStore backened/xenio/<domid>/<devname>/@key = @fmt. If @mkread
+ * is non-zero TODO the xenstore key/value pair is read-only?
+ *
+ * @param device the VBD
+ * @param key the key to write to
+ * @param mkread TODO
+ * @param fmt TODO
+ * @returns 0 on success, an error code otherwise
+ */
+__printf(4, 5)
+static int
+xenio_device_printf(xenio_device_t * const device, const char * const key,
+        const int mkread, const char * const fmt, ...)
+{
+    va_list ap;
+    int err;
+
+    assert(device);
+    assert(key);
+
+    va_start(ap, fmt);
+    err = xenio_device_vprintf(device, key, mkread, fmt, ap);
+    va_end(ap);
+
+    return err;
+}
+
+/**
+ * TODO Only called by xenio_backend_probe_device
+ *
+ * Returns 0 if the device's serial hasn't changed.
+ */
+static inline long long
+xenio_device_check_serial(xenio_device_t * const device)
+{
+    long long serial;
+    int n, err;
+
+    assert(device);
+
+    /* read backend/xenio/<domid>/<device name>/xenio-serial from xenstore */
+    n = xenio_device_scanf(device, "xenio-serial", "%lld", &serial);
+    if (n != 1) {
+        err = -EEXIST;
+        goto fail;
+    }
+
+    if (serial != device->serial) {
+        err = -EXDEV;
+        goto fail;
+    }
+
+    err = 0;
+fail:
+    return err;
+}
+
+/**
+ * Removes the XenStore watch from the front-end.
+ *
+ * @param device the VBD whose front-end XenStore path should stop being
+ * watched
+ */
+static void
+xenio_device_unwatch_frontend_state(xenio_device_t * const device)
+{
+    assert(device);
+
+    if (device->frontend_state_path)
+        xs_unwatch(backend.xs, device->frontend_state_path, "otherend-state");
+
+    if (device->frontend_state_path) {
+        free(device->frontend_state_path);
+        device->frontend_state_path = NULL;
+    }
+}
+
+/**
+ * Watches the frontend path, using otherend-state as the token. I.e.
+ * /local/domain/<domid>/device/vbd/<devname>/state
+ *
+ * TODO Only called by xenio_backend_create_device
+ */
+static inline int
+xenio_device_watch_frontend_state(xenio_device_t * const device)
+{
+    bool nerr;
+    int err;
+
+    assert(device);
+
+    device->frontend_state_path = mprintf("%s/state", device->frontend_path);
+    if (!device->frontend_state_path) {
+        err = -errno;
+        goto fail;
+    }
+
+    DBG("watching %s\n", device->frontend_state_path);
+
+    nerr = xs_watch(backend.xs, device->frontend_state_path, "otherend-state");
+    if (!nerr) {
+        err = -errno;
+        goto fail;
+    }
+
+    return 0;
+
+fail:
+    xenio_device_unwatch_frontend_state(device);
+    return err;
+}
+
+/**
+ *
+ * TODO Only called by xenio_backend_handle_otherend_watch, merge into it?
+ */
+static int
+xenio_device_check_frontend_state(xenio_device_t * const device)
+{
+    int state, err;
+    char *s, *end;
+
+    assert(device);
+
+    s = xenio_xs_read(backend.xs, backend.xst, "%s",
+            device->frontend_state_path);
+    if (!s) {
+        err = -errno;
+        goto fail;
+    }
+
+    state = strtol(s, &end, 0);
+    if (*end != 0 || end == s) {
+        err = -EINVAL;
+        goto fail;
+    }
+
+    err = backend.ops->frontend_changed(device, state);
+	DBG("change from state %d: %d\n", state, err);
+
+  fail:
+    free(s);
+    return err;
+}
+
+/**
+ * Switches the back-end state of the device by writing to XenStore.
+ *
+ * @param device the VBD
+ * @param state the state to switch to
+ * @returns 0 on success, an error code otherwise
+ */
+static int
+xenio_device_switch_state(xenio_device_t * const device,
+        const XenbusState state)
+{
+    assert(device);
+
+    /*
+     * TODO Ensure @state contains a legitimate XenbusState value.
+     * TODO Should we check for valid state transitions?
+     */
+
+    return xenio_device_printf(device, "state", 0, "%u", state);
+}
+
+/**
+ * Destroys and deallocates the back-end part of a VBD.
+ *
+ * @param device the VBD to destroy
+ */
+static void
+xenio_backend_destroy_device(xenio_device_t * const device)
+{
+    assert(device);
+
+    TAILQ_REMOVE(&backend.devices, device, backend_entry);
+
+    xenio_device_unwatch_frontend_state(device);
+
+    if (device->frontend_path) {
+        free(device->frontend_path);
+        device->frontend_path = NULL;
+    }
+
+    if (device->name) {
+        free(device->name);
+        device->name = NULL;
+    }
+
+    free(device);
+}
+
+/**
+ * TODO Only called by xenio_backend_probe_device, merge into it?
+ */
+static void
+xenio_backend_remove_device(xenio_device_t * const device)
+{
+    backend.ops->remove(device);
+    xenio_backend_destroy_device(device);
+}
+
+/**
+ * Creates a device and adds it to the list of devices.
+ * Initiates a XenStore watch to the blkfront state.
+ *
+ * Creating the device implies initializing the handle and retrieving all the
+ * information of the tapdisk serving this VBD.
+ *
+ * @param domid the ID of the domain where the VBD is created
+ * @param name TODO device name?
+ * @returns 0 on success, an error code otherwise
+ */
+static inline int
+xenio_backend_create_device(const int domid, const char * const name)
+{
+    xenio_device_t *device;
+    int err;
+
+    assert(name);
+
+    DBG("creating device %d/%s\n", domid, name);
+
+    device = calloc(1, sizeof(*device));
+    if (!device) {
+        WARN("error allocating memory\n");
+        err = -errno;
+        goto fail;
+    }
+
+	/*
+	 * TODO replace with alloc_serial() and check for overflow
+	 */
+    device->serial = backend.serial++;
+    device->domid = domid;
+
+    TAILQ_INSERT_TAIL(&backend.devices, device, backend_entry);
+
+    device->name = strdup(name);
+    if (!device->name) {
+        err = -errno;
+        goto fail;
+    }
+
+    /*
+     * Get the frontend path in XenStore. We need this to talk to blkfront.
+     */
+    device->frontend_path = xenio_device_read(device, "frontend");
+    DBG("frontend = '%s' (%d)\n", device->frontend_path, errno);
+    if (!device->frontend_path) {
+        err = -errno;
+        goto fail;
+    }
+
+    /*
+     * Write to xenstore xenio-serial and max-ring-page-order.
+     */
+    /* FIXME What's xenio-serial? */
+    err = xenio_device_printf(device, "xenio-serial", 0, "%lld",
+            device->serial);
+    if (err)
+        goto fail;
+
+    /*
+     * TODO Who uses this?
+     */
+    if (backend.max_ring_page_order)
+        err = xenio_device_printf(device, "max-ring-page-order", 0, "%d",
+                backend.max_ring_page_order);
+    if (err)
+        goto fail;
+
+    /*
+     * Get the tapdisk that is serving this virtual block device, along with
+     * it's parameters.
+     */
+    err = backend.ops->probe(device, device->domid, name);
+    if (err)
+        goto fail;
+
+	/*
+	 * Finally, watch the frontend path in XenStore for changes. Once the
+	 * frontend state has changed, we can continue. TODO
+	 */
+    err = xenio_device_watch_frontend_state(device);
+    if (err)
+        goto fail;
+
+    return 0;
+
+fail:
+    if (device) {
+        WARN("error creating device: domid=%d name=%s err=%d (%s)\n",
+             device->domid, device->name, err, strerror(-err));
+        xenio_backend_destroy_device(device);
+    }
+
+    return err;
+}
+
+/**
+ * TODO Only called by xenio_backend_device_exists, merge into it?
+ */
+__printf(3, 4)
+static inline bool
+xenio_xs_exists(struct xs_handle * const xs, xs_transaction_t xst,
+        const char * const fmt, ...)
+{
+    va_list ap;
+    char *s;
+
+    va_start(ap, fmt);
+    s = xenio_xs_vread(xs, xst, fmt, ap);
+    va_end(ap);
+    if (s)
+        free(s);
+
+    return s != NULL;
+}
+
+/**
+ * Tells whether the device exists on the domain by looking at xenstore.
+ *
+ * TODO Only called by xenio_backend_probe_device, merge into it?
+ */
+static inline bool
+xenio_backend_device_exists(const int domid, const char * const name)
+{
+    /* i.e. backend/xenio/<domid>/<device name> */
+    return xenio_xs_exists(backend.xs, backend.xst, "%s/%d/%s",
+            XENIO_BACKEND_PATH, domid, name);
+}
+
+/**
+ * Iterates over all devices and returns the one for which the condition is
+ * true.
+ */
+#define xenio_backend_find_device(_device, _cond)		\
+do {													\
+	xenio_device_t *__next;								\
+	int found = 0;										\
+	xenio_backend_for_each_device(_device, __next) {	\
+		if (_cond) {									\
+			found = 1;									\
+			break;										\
+		}												\
+	}													\
+	if (!found)											\
+		_device = NULL;									\
+} while (0)
+
+/**
+ * Creates (removes) a device depending on the existence (non-existence) of the
+ * "backend/xenio/@domid/@devname" XenStore path.
+ *
+ * @param domid the ID of the domain where the VBD is created
+ * @param devname device name
+ * @returns 0 on success, an error code otherwise
+ *
+ * TODO Find out what that xenio-serial thing does.
+ */
+static int
+xenio_backend_probe_device(const int domid, const char * const devname)
+{
+    bool exists, create, remove;
+    xenio_device_t *device;
+    int err;
+
+    assert(devname);
+
+    DBG("probe device domid=%d name=%s\n", domid, devname);
+
+    /*
+     * Ask XenStore if the device _should_ exist.
+     */
+    exists = xenio_backend_device_exists(domid, devname);
+
+    /*
+     * Search the device list for this specific device.
+     */
+    xenio_backend_find_device(device,
+            device->domid == domid && !strcmp(device->name, devname));
+
+    /*
+	 * If XenStore says that the device exists but it's not in our device list,
+     * we must create it. If it's the other way around, this is a removal. If
+     * XenStore says that the device exists and it's in our device list, TODO
+     * we must check serial.
+     */
+    remove = device && !exists;
+    create = exists && !device;
+
+    DBG("exists=%d device=%p remove=%d create=%d\n",
+        exists, device, remove, create);
+
+    if (device && exists) {
+        /*
+         * check the device serial, to sync with fast
+         * remove/re-create cycles.
+         */
+        remove = create = !!xenio_device_check_serial(device);
+
+        if (!create && !remove) {
+            DBG("neither create nor remove\n");
+        }
+    }
+
+	/*
+	 * TODO is this possible?
+	 */
+	assert(!(create && remove));
+
+    if (remove)
+        xenio_backend_remove_device(device);
+
+    if (create) {
+        err = xenio_backend_create_device(domid, devname);
+        if (err)
+            goto fail;
+    }
+
+    err = 0;
+fail:
+    return err;
+}
+
+/**
+ * TODO What does this function do? Seems like it scans for new devices.
+ *
+ * TODO Only called by xenio_backend_handle_backend_watch. Under which
+ * circumstances?
+ */
+static inline int
+xenio_backend_scan(void)
+{
+    xenio_device_t *device, *next;
+    unsigned int i, j, n, m;
+    char **dir;
+
+    /*
+     * scrap all non-existent devices
+     */
+
+    xenio_backend_for_each_device(device, next)
+        xenio_backend_probe_device(device->domid, device->name);
+
+    /*
+     * probe the new ones
+     */
+
+    dir = xs_directory(backend.xs, backend.xst, XENIO_BACKEND_PATH, &n);
+    if (!dir)
+        return 0;
+
+    /*
+     * TODO Looks like we're checking the XenStore paths of ALL domains, could
+     * there be a performance issue in the presence of many VMs?
+     */
+    for (i = 0; i < n; i++) {
+        char *path, **sub, *end;
+        int domid;
+
+        /*
+         * Get the domain ID.
+         */
+        domid = strtoul(dir[i], &end, 0);
+        if (*end != 0 || end == dir[i])
+            continue;
+
+        /*
+         * Read the devices of this domain.
+         */
+        path = mprintf("%s/%d", XENIO_BACKEND_PATH, domid);
+        assert(path != NULL);
+        sub = xs_directory(backend.xs, backend.xst, path, &m);
+        free(path);
+
+        /*
+         * Probe each device.
+         */
+        for (j = 0; j < m; j++)
+            xenio_backend_probe_device(domid, sub[j]);
+
+        free(sub);
+    }
+
+    free(dir);
+    return 0;
+}
+
+/**
+ * Act in response to a change in the front-end XenStore path.
+ *
+ * @param path the front-end's XenStore path that changed
+ * @returns 0 on success, an error code otherwise
+ *
+ * TODO Does blkfront write to this path?
+ *
+ * TODO Only called by xenio_backend_read_watch
+ */
+static inline int
+xenio_backend_handle_otherend_watch(const char * const path)
+{
+    xenio_device_t *device;
+    int err = 0;
+
+    assert(path);
+
+    /*
+     * Find the device that has the same frontend state path.
+     *
+     * TODO It seems that there should definitely be such a device in our list,
+     * otherwise this function would not have executed at all, since we would
+     * not be waiting on that xenstore path.  The xenstore patch we wait for
+     * is: /local/domain/<domid>/device/vbd/<devname>/state. In order to watch
+     * this path, it means that we have received a device create request, so
+     * the device will be there
+     */
+    xenio_backend_find_device(device,
+            !strcmp(device->frontend_state_path, path));
+    if (device) {
+        DBG("device: domid=%d name=%s\n", device->domid, device->name);
+        err = xenio_device_check_frontend_state(device);
+    } else {
+        WARN("XXX no device found!\n");
+        BUG();
+    }
+
+    return err;
+}
+
+/**
+ * Act in response to a change in the back-end XenStore path.
+ *
+ * If the path is "/backend" or "/backend/xenio", all devices are probed.
+ * Otherwise, the path should be "backend/xenio/<domid>/<device name>"
+ * (i.e. backend/xenio/1/51712), and in this case this specific device is
+ * probed.
+ *
+ * @param path the back-end's XenStore path that changed
+ * @returns 0 on success, an error code otherwise
+ *
+ * TODO Who modifies the back-end path in XenStore?
+ *
+ * TODO Only called by xenio_backend_read_watch.
+ */
+static inline int
+xenio_backend_handle_backend_watch(char * const path)
+{
+    char *s, *end, *name;
+    int domid;
+
+    assert(path);
+
+    /*
+	 * ignore the backend/xenio part
+	 */
+    s = strtok(path, "/");
+    assert(!strcmp(s, "backend"));
+    s = strtok(NULL, "/");
+    if (!s)
+        return xenio_backend_scan();
+
+    assert(!strcmp(s, XENIO_BACKEND_NAME));
+    s = strtok(NULL, "/");
+    if (!s)
+        return xenio_backend_scan();
+
+    /*
+	 * get the domain ID
+	 */
+    domid = strtoul(s, &end, 0);
+    if (*end != 0 || end == s)
+        return -EINVAL;
+
+    /*
+	 * get the device name
+	 */
+    name = strtok(NULL, "/");
+    if (!name)
+        return xenio_backend_scan();
+	else
+		/*
+		 * Create or remove the device, TODO or check it's serial.
+		 */
+		return xenio_backend_probe_device(domid, name);
+}
+
+/**
+ * Read changes that occurred on the "backend/xenio" XenStore path and act.
+ * Either the back-end path or the front-end path will have changed.
+ */
+static inline void
+xenio_backend_read_watch(void)
+{
+    char **watch, *path, *token;
+    unsigned int n;
+    int err, _abort;
+
+    /* read the change */
+    watch = xs_read_watch(backend.xs, &n);
+    path = watch[XS_WATCH_PATH];
+    token = watch[XS_WATCH_TOKEN];
+
+    DBG("--\n");
+    DBG("path=%s token=%s\n", path, token);
+
+    /*
+     * TODO Put the body of "again:" into a function instead of using goto.
+     */
+again:
+    backend.xst = xs_transaction_start(backend.xs);
+    if (!backend.xst) {
+        WARN("error starting transaction\n");
+        goto fail;
+    }
+
+    /*
+     * Token is either "otherend-state", indicating a change in the front-end,
+	 * or "backend-xenio", indicating a change in the back-end.
+     * TODO Who sets the token?
+     */
+    switch (token[0]) {
+
+    case 'o':
+        if (!strcmp(token, "otherend-state")) {
+            err = xenio_backend_handle_otherend_watch(path);
+            break;
+        }
+        /* TODO gracefully fail? */
+        BUG();
+
+    case 'b':
+        /*
+         * TODO verify the following:
+         *
+         * When blkfront (TODO or libxl?) requests a new VBD, the path
+         * '/<domid>/<devname>' is appended to 'backend/xenio'. In response,
+         * xenio creates the VBD handle and initializes it (i.e. it finds which
+         * tapdisk serves this VBD).)
+         *
+         * TODO The XenStore watch may trigger for a not yet discovered reason.
+         * The result is xenio_backend_handle_backend_watch not doing anything
+         * interesting, it only checks the 'xenio-serial'.
+         */
+        if (!strcmp(token, XENIO_BACKEND_TOKEN)) {
+            err = xenio_backend_handle_backend_watch(path);
+            break;
+        }
+        /* TODO gracefully fail? */
+        BUG();
+
+    default:
+        /* TODO gracefully fail? */
+        BUG();
+    }
+
+    _abort = !!err;
+    if (_abort)
+        DBG("aborting transaction: %s\n", strerror(-err));
+
+    err = xs_transaction_end(backend.xs, backend.xst, _abort);
+    backend.xst = 0;
+    if (!err) {
+        err = -errno;
+        /*
+         * This is OK according to xs_transaction_end's semantics.
+         */
+        if (errno == EAGAIN) {
+            goto again;
+        }
+        DBG("xs_transaction_end failed: %s\n", strerror(err));
+    }
+
+fail:
+    if (watch)
+        free(watch);
+    return;
+}
+
+static void
+xenio_backend_destroy(void)
+{
+    if (backend.xs) {
+        xs_daemon_close(backend.xs);
+        backend.xs = NULL;
+    }
+}
+
+/**
+ * Initializes the back-end descriptor. There is one back-end per xenio
+ * process. Also, it initiates a watch to XenStore on back-end/xenio.
+ *
+ * @param ops back-end operations, see struct xenio_backend_ops
+ * @param max_ring_page_order TODO
+ * @returns 0 on success, an error code otherwise
+ *
+ * TODO What's the use of the token? Aren't we the only ones to watch this
+ * path? It would only make sense if we want to run multiple xenio daemons.
+ */
+static inline int
+xenio_backend_create(const struct xenio_backend_ops * const ops,
+        const int max_ring_page_order)
+{
+    bool nerr;
+    int err = -EINVAL;
+
+    if (!ops) {
+        WARN("no backend operations\n");
+        goto fail;
+    }
+
+    backend.max_ring_page_order = max_ring_page_order;
+    TAILQ_INIT(&backend.devices);
+    backend.xst = XBT_NULL;
+
+    backend.xs = xs_daemon_open();
+    if (!backend.xs) {
+        err = -EINVAL;
+        goto fail;
+    }
+
+    /*
+     * Set a watch on the back-end path using a token.
+     *
+     * TODO Do we really need to supply a token, given that this is the _only_
+     * watch on this specific path by this process?
+     */
+    nerr = xs_watch(backend.xs, XENIO_BACKEND_PATH, XENIO_BACKEND_TOKEN);
+    if (!nerr) {
+        err = -errno;
+        goto fail;
+    }
+
+    backend.ops = ops;
+
+    return 0;
+
+fail:
+	xenio_backend_destroy();
+
+    return -err;
+}
+
+/**
+ * Retrieves the tapdisk designated to serve this device, storing this
+ * information in the supplied VBD handle.
+ *
+ * @param bdev the VBD handle for whose tapdisk handle should be retrieved
+ * @returns 0 on success, an error code otherwise
+ *
+ * FIXME How does this thing work since bdev->dev is never initialised?
+ *
+ * TODO Only called by blkback_probe, merge into it?
+ */
+static inline int
+blkback_find_tapdisk(blkback_device_t * const bdev)
+{
+    struct tqh_tap_list list;
+    tap_list_t *tap;
+    int err = 0;
+    int found = 0;
+
+    assert(bdev);
+
+    err = tap_ctl_list(&list);
+    if (err) {
+        WARN("error listing tapdisks: %s\n", strerror(err));
+        return err;
+    }
+
+    if (!TAILQ_EMPTY(&list)) {
+        tap_list_for_each_entry(tap, &list)
+            if (tap->minor == minor(bdev->dev)) {
+                found = 1;
+                break;
+            }
+    } else {
+        WARN("no tapdisks\n");
+    }
+
+    /*
+     * FIXME Shouldn't we free the list? Memory leak!?
+     */
+
+    if (!found)
+        return -ENOENT;
+
+    memcpy(&bdev->tap, tap, sizeof(bdev->tap));
+
+    return 0;
+}
+
+/**
+ * TODO Only called by blkback_connect_tap, merge into it?
+ */
+static inline int
+blkback_read_otherend_proto(xenio_device_t * const xbdev)
+{
+    char *s;
+
+    assert(xbdev);
+
+    s = xenio_device_read_otherend(xbdev, "protocol");
+    if (!s)
+        return XENIO_BLKIF_PROTO_NATIVE;
+
+    switch (s[0]) {
+    case 'x':
+        if (!strcmp(s, "x86_32-abi"))
+            return XENIO_BLKIF_PROTO_X86_32;
+
+        if (!strcmp(s, "x86_64-abi"))
+            return XENIO_BLKIF_PROTO_X86_64;
+    }
+
+    free(s);
+    return -EINVAL;
+}
+
+/**
+ * Core functions that instructs the tapdisk to connect to the shared ring and
+ * communicates essential information to blkfront.
+ * TODO Elaborate more.
+ * TODO Verify that the XenStore values written in the "write_info:" section
+ * are for blkfront. If this is true, rename the function as its name is
+ * misleading.
+ *
+ * @param xbdev the VBD to which the tapdisk should connect
+ * @returns 0 on success, an error code otherwise
+ *
+ * TODO Only called by blkback_frontend_changed.
+ */
+static inline int
+blkback_connect_tap(xenio_device_t * const xbdev)
+{
+    blkback_device_t *bdev;
+
+    /*
+     * The event channel port to receive/provide notifications, dictated by
+     * blkfront.
+     */
+    evtchn_port_t port;
+
+    grant_ref_t *gref = NULL;
+    int n, proto, err = 0;
+    int order;
+    char *pool;
+    char ring_ref[12]; /* TODO Why 12? */
+
+    assert(xbdev);
+
+    bdev = xbdev->bdev;
+
+    /*
+     * TODO Use a clearer way to indicate whether a tapdisk is already
+     * connected?
+     */
+    if (bdev->gref) {
+        /*
+         * TODO Why should this function be called on an already connected
+         * VBD? Why re-write the sector size etc. in XenStore for an already
+         * connected VBD?
+         */
+        DBG("blkback already connected to tapdisk.\n");
+        goto write_info;
+    }
+
+    n = xenio_device_scanf_otherend(xbdev, "ring-page-order", "%d", &order);
+    if (n != 1)
+        order = 0;
+
+    gref = calloc(ORDER_TO_PAGES(order), sizeof(grant_ref_t));
+    if (!gref) {
+        DBG("Failed to allocate memory for grant refs.\n");
+        err = ENOMEM;
+        goto fail;
+    }
+
+    /*
+     * FIXME Figure out what the body of this if-else does.
+     */
+    if (order) {
+        int i;
+        for (i = 0; i < (1 << order); i++) {
+            sprintf(ring_ref, "ring-ref%d", i);
+            n = xenio_device_scanf_otherend(xbdev, ring_ref, "%u", &gref[i]);
+            if (n != 1) {
+                DBG("Failed to read grant ref #%d.\n", i);
+                err = ENOENT;
+                goto fail;
+            }
+            DBG("%s = %d\n", ring_ref, gref[i]);
+        }
+    } else {
+        /*
+         * TODO Does this mean there's only one page in the ring?
+         */
+        n = xenio_device_scanf_otherend(xbdev, "ring-ref", "%u", &gref[0]);
+        if (n != 1) {
+            DBG("Failed to read grant ref.\n");
+            err = ENOENT;
+            goto fail;
+        }
+
+        DBG("ring-ref = %d\n", gref[0]);
+    }
+
+    /*
+     * Retrieve the event channel, dictated by blkfront.
+     */
+    n = xenio_device_scanf_otherend(xbdev, "event-channel", "%u", &port);
+    if (n != 1) {
+        DBG("Failed to read event channel.\n");
+        err = ENOENT;
+        goto fail;
+    }
+
+    /*
+     * Read the guest VM's ABI.
+     */
+    proto = blkback_read_otherend_proto(xbdev);
+    if (proto < 0) {
+        DBG("Failed to read protocol.\n");
+        err = ENOENT;
+        goto fail;
+    }
+
+    /*
+     * TODO What's this? Who writes this?
+     */
+    pool = xenio_device_read(xbdev, "sm-data/frame-pool");
+
+    DBG("connecting vbd-%d-%d (order %d, evt %d, proto %d, pool %s)"
+        " to tapdisk %d minor %d\n",
+        bdev->domid, bdev->devid, order, port, proto, pool, bdev->tap.pid,
+        bdev->tap.minor);
+
+    /*
+     * Instruct the tapdisk to connect to the shared ring.
+     */
+    err = tap_ctl_connect_xenblkif(bdev->tap.pid, bdev->tap.minor, bdev->domid,
+            bdev->devid, gref, order, port, proto, pool);
+    DBG("err=%d errno=%d\n", err, errno);
+    if (err)
+        goto fail;
+
+    bdev->gref = gref;
+    gref = NULL;
+    bdev->port = port;
+
+    /*
+     * TODO This part is not implied by the function's name. Even if we rename
+     * this function, we should put the following section in a separate
+     * (static) function for code clarity and maintainability purpose.
+     */
+write_info:
+
+    /*
+     * TODO Write the sector size to XenStore so that blkfront knows
+     * the sector size of the block device it will create?
+     */
+    err = xenio_device_printf(xbdev, "sector-size", 1, "%u",
+            bdev->sector_size);
+    if (err) {
+        DBG("Failed to write sector-size.\n");
+        goto fail;
+    }
+
+    /*
+     * Write the number of sectors, sector size, and info to the back-end path
+     * in XenStore so that blkfront creates a VBD with the appropriate
+     * characteristics.
+     */
+    err = xenio_device_printf(xbdev, "sectors", 1, "%llu", bdev->sectors);
+    if (err) {
+        DBG("Failed to write sectors.\n");
+        goto fail;
+    }
+
+    err = xenio_device_printf(xbdev, "info", 1, "%u", bdev->info);
+    if (err) {
+        DBG("Failed to write info.\n");
+        goto fail;
+    }
+
+    err = xenio_device_switch_state(xbdev, XenbusStateConnected);
+    if (err) {
+        DBG("Failed to switch state %d\n", err);
+    }
+
+fail:
+    if (err) {
+        if (bdev->gref) {
+            tap_ctl_disconnect_xenblkif(bdev->tap.pid, bdev->tap.minor,
+                    bdev->domid, bdev->devid, NULL);
+
+            gref = bdev->gref;
+            bdev->gref = NULL;
+        }
+    }
+
+    if (gref)
+        free(gref);
+
+    return err;
+}
+
+/**
+ * Instructs the tapdisk to disconnect itself from the shared ring.
+ * TODO It also switches state, which isn't implied by the function's name,
+ * rename function?
+ *
+ * @param xbdev the VBD whose tapdisk should be disconnected
+ * @returns 0 on success, an error code otherwise
+ *
+ * TODO Only called by blkback_frontend_changed.
+ */
+static inline int
+blkback_disconnect_tap(xenio_device_t * const xbdev)
+{
+    blkback_device_t *bdev;
+    int err = 0;
+
+    assert(xbdev);
+
+    bdev = xbdev->bdev;
+    assert(bdev);
+
+    if (bdev->gref == NULL || bdev->port < 0)
+        return err;
+
+    DBG("disconnecting vbd-%d-%d from tapdisk %d minor %d\n",
+        bdev->domid, bdev->devid, bdev->tap.pid, bdev->tap.minor);
+
+    err = tap_ctl_disconnect_xenblkif(bdev->tap.pid, bdev->tap.minor,
+            bdev->domid, bdev->devid, NULL);
+    if (err && errno != -ESRCH)
+        goto fail;
+
+    free(bdev->gref);
+    bdev->gref = NULL;
+    bdev->port = -1;
+
+    err = xenio_device_switch_state(xbdev, XenbusStateClosed);
+fail:
+    return err;
+}
+
+/**
+ * Retrieves the VBD parameters from the tapdisk and initialises the device
+ * handle with them.
+ *
+ * @param xbdev the VBD whose tapdisk parameters should be retrieved
+ * @returns 0 on success, an error code otherwise
+ *
+ * TODO aren't these supplied by blkback_find_tapdisk/tap_ctl_list?
+ * TODO only called by blkback_probe.
+ * TODO Very misleading function name
+ */
+static inline int
+blkback_probe_device(xenio_device_t * const xbdev)
+{
+    blkback_device_t *bdev;
+    int err;
+    unsigned int info;
+
+    assert(xbdev);
+
+    bdev = xbdev->bdev;
+    assert(bdev);
+
+    /*
+     * TODO info is unused, maybe it's the info that should be set in
+     * blkback_device?
+     */
+    err = tap_ctl_info(bdev->tap.pid, bdev->tap.minor, &bdev->sectors,
+            &bdev->sector_size, &info);
+    if (err)
+        WARN("tap_ctl_info failed %d\n", err);
+    else
+        DBG("sectors=%llu sector-size=%d\n", bdev->sectors,
+            bdev->sector_size);
+
+    return err;
+}
+
+/**
+ * Deallocates a struct blkback_device.
+ */
+static void
+blkback_device_destroy(blkback_device_t * const bdev)
+{
+	assert(bdev);
+
+    if (bdev->gref)
+        free(bdev->gref);
+    free(bdev);
+}
+
+/**
+ * Initialises the VBD with information regarding the tapdisk that is serving
+ * it.
+ *
+ * @param xbdev the device to initialise
+ * @param domid the ID of the domain where the VBD is created
+ * @param name TODO the device name (as retrieved from blkfront via XenStore)
+ * @returns 0 on success, an error code otherwise
+ *
+ * TODO The function name is very misleading.
+ */
+static int
+blkback_probe(xenio_device_t * const xbdev, const domid_t domid,
+        const char * const name)
+{
+    blkback_device_t *bdev;
+    int err;
+    char *end;
+
+    assert(xbdev);
+    assert(name);
+
+    DBG("probe blkback %s-%d-%s\n", XENIO_BACKEND_NAME, xbdev->domid,
+        xbdev->name);
+
+    bdev = calloc(1, sizeof(*bdev));
+    if (!bdev) {
+        WARN("error allocating memory\n");
+        err = -errno;
+        goto fail;
+    }
+    xbdev->bdev = bdev;
+
+    bdev->domid = domid;
+    bdev->devid = strtoul(name, &end, 0);
+    if (*end != 0 || end == name) {
+        err = -EINVAL;
+        goto fail;
+    }
+
+    DBG("devid=%d\n", bdev->devid);
+    err = blkback_find_tapdisk(bdev);
+    if (err) {
+        WARN("error looking for tapdisk: %s", strerror(err));
+        goto fail;
+    }
+
+    /*
+     * get the VBD parameters from the tapdisk
+     */
+    blkback_probe_device(xbdev);
+    DBG("got %s-%d-%d with tapdev %d/%d\n", XENIO_BACKEND_NAME,
+        xbdev->domid, bdev->devid, bdev->tap.pid, bdev->tap.minor);
+
+    return 0;
+
+fail:
+    if (bdev)
+        blkback_device_destroy(bdev);
+
+    return err;
+}
+
+/**
+ * Deallocates the VBD.
+ *
+ * TODO misleading function name
+ */
+static void
+blkback_remove(xenio_device_t * const xbdev)
+{
+    blkback_device_t *bdev;
+
+    assert(xbdev);
+    bdev = xbdev->bdev;
+
+    DBG("remove %s-%d-%s\n", XENIO_BACKEND_NAME, xbdev->domid, xbdev->name);
+
+    blkback_device_destroy(bdev);
+}
+
+/**
+ * Acts on changes in the front-end state.
+ *
+ * @param xbdev the VBD whose front-end state changed
+ * @param state the new state
+ * @returns 0 on success, an error code otherwise
+ *
+ * TODO Only called by xenio_device_check_front-end_state.
+ * TODO Ensure that @state is a valid XenbusState.
+ * TODO Replace the switch statement with a despatch table.
+ * TODO Functions called here in response to a state change do not have
+ * consistent names with each other (e.g. xenio_device_switch_state vs.
+ * blkback_connect_tap).
+ */
+static inline int
+blkback_frontend_changed(xenio_device_t * const xbdev, const XenbusState state)
+{
+    int err = 0;
+
+    assert(xbdev);
+
+    DBG("frontend_changed %s-%d-%s state=%d\n", XENIO_BACKEND_NAME,
+            xbdev->domid, xbdev->name, state);
+
+    /*
+     * TODO replace with a despatch table
+     */
+    switch (state) {
+    case XenbusStateUnknown:
+        /* TODO wtf */
+        break;
+
+        /* 
+         * Switch our state from Initialising (1) to InitWait (2). Absolutely
+         * nothing else to do.
+         */
+    case XenbusStateInitialising:
+        err = xenio_device_switch_state(xbdev, XenbusStateInitWait);
+        break;
+
+        /*
+         * XXX 
+         */
+    case XenbusStateInitialised:
+    case XenbusStateConnected:
+        err = blkback_connect_tap(xbdev);
+        break;
+
+    case XenbusStateClosing:
+        err = xenio_device_switch_state(xbdev, XenbusStateClosing);
+        break;
+
+    case XenbusStateClosed:
+        err = blkback_disconnect_tap(xbdev);
+        break;
+
+    case XenbusStateReconfiguring:
+    case XenbusStateReconfigured:
+        /* wtf */
+        break;
+
+    case XenbusStateInitWait:
+        /* fatal */
+        break;
+    }
+
+    return err;
+}
+
+/**
+ * FIXME are we using any other operations?
+ */
+static struct xenio_backend_ops blkback_ops = {
+    .probe = blkback_probe,
+    .remove = blkback_remove,
+    .frontend_changed = blkback_frontend_changed,
+};
+
+/**
+ * Runs the daemon.
+ *
+ * It watches XenStore (backend/xenio) for changes and when it detects one, it
+ * creates or removes a VBD.
+ */
+static inline int
+xenio_backend_run(void)
+{
+    const int fd = xs_fileno(backend.xs);
+	int err;
+
+    do {
+        fd_set rfds;
+        int nfds;
+
+        FD_ZERO(&rfds);
+        FD_SET(fd, &rfds);
+
+        /* poll the fd for changes in the XenStore path we're interested in */
+        nfds = select(fd + 1, &rfds, NULL, NULL, NULL);
+        if (nfds < 0) {
+            perror("select");
+            err = -errno;
+            break;
+        }
+
+        if (FD_ISSET(fd, &rfds))
+            xenio_backend_read_watch();
+    } while (1);
+
+    return err;
+}
+
+static char *blkback_ident;
+
+static void
+blkback_vlog_fprintf(const int prio, const char * const fmt, va_list ap)
+{
+    const char *strprio[] = {
+        [LOG_DEBUG] = "DBG",
+        [LOG_INFO] = "INF",
+        [LOG_WARNING] = "WRN"
+    };
+
+    BUG_ON(prio < 0);
+    BUG_ON(prio > sizeof(strprio) / sizeof(strprio[0]));
+    BUG_ON(!strprio[prio]);
+
+    fprintf(stderr, "%s[%s] ", blkback_ident, strprio[prio]);
+    vfprintf(stderr, fmt, ap);
+}
+
+/**
+ * Print xenio's usage instructions.
+ */
+static void
+usage(FILE * const stream, const char * const prog)
+{
+    fprintf(stream,
+            "usage: %s\n"
+            "\t[-m|--max-ring-order <max ring page order>]\n"
+            "\t[-D|--debug]\n"
+			"\t[-h|--help]\n", prog);
+}
+
+int main(int argc, char **argv)
+{
+    const char *prog;
+    int opt_debug, opt_max_ring_page_order;
+    int err;
+
+    prog = basename(argv[0]);
+
+    opt_debug = 0;
+    opt_max_ring_page_order = 0;
+
+    do {
+        const struct option longopts[] = {
+            {"help", 0, NULL, 'h'},
+            {"max-ring-order", 1, NULL, 'm'},
+            {"debug", 0, NULL, 'D'},
+        };
+        int c;
+
+        c = getopt_long(argc, argv, "hm:n:D", longopts, NULL);
+        if (c < 0)
+            break;
+
+        switch (c) {
+        case 'h':
+            usage(stdout, prog);
+            return 0;
+        case 'm':
+            opt_max_ring_page_order = atoi(optarg);
+            if (opt_max_ring_page_order < 0)
+                goto usage;
+            break;
+        case 'D':
+            opt_debug = 1;
+            break;
+        case '?':
+            goto usage;
+        }
+    } while (1);
+
+    blkback_ident = XENIO_BACKEND_TOKEN;
+    if (opt_debug)
+        xenio_vlog = blkback_vlog_fprintf;
+    else
+        openlog(blkback_ident, 0, LOG_DAEMON);
+
+    if (!opt_debug) {
+        err = daemon(0, 0);
+        if (err) {
+            err = -errno;
+            goto fail;
+        }
+    }
+
+	if ((err = xenio_backend_create(&blkback_ops, opt_max_ring_page_order))) {
+        WARN("error creating blkback: %s\n", strerror(err));
+        goto fail;
+    }
+
+    err = xenio_backend_run();
+
+    xenio_backend_destroy();
+
+fail:
+    return err ? -err : 0;
+
+usage:
+    usage(stderr, prog);
+    return 1;
+}

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:21:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:21:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdiVz-0003pR-Ua; Wed, 28 Nov 2012 14:21:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TdiVx-0003og-N3
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 14:21:25 +0000
Received: from [85.158.137.99:36680] by server-12.bemta-3.messagelabs.com id
	7B/C6-22757-4ED16B05; Wed, 28 Nov 2012 14:21:24 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354112483!16913086!5
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7877 invoked from network); 28 Nov 2012 14:21:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:21:24 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16048735"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 14:21:24 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 14:21:24 +0000
MIME-Version: 1.0
X-Mercurial-Node: 5b3dce3e5aab4ddb968d68816d1bbd872c8ef871
Message-ID: <5b3dce3e5aab4ddb968d.1354112415@makatos-desktop>
In-Reply-To: <patchbomb.1354112410@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 28 Nov 2012 14:20:15 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 5 of 5 RFC] blktap3: Add the xenio binaries to
 the Mercurial ignore list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

diff -r 0f3b6811dad1 -r 5b3dce3e5aab .hgignore
--- a/.hgignore	Wed Nov 28 14:18:46 2012 +0000
+++ b/.hgignore	Wed Nov 28 14:18:46 2012 +0000
@@ -347,3 +347,6 @@
 ^unmodified_drivers/linux-2.6/.*\.ko$
 ^unmodified_drivers/linux-2.6/.*\.mod\.c$
 ^LibVNCServer.*
+
+# blktap3
+^tools/blktap3/xenio/xenio$

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:21:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:21:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdiVz-0003pR-Ua; Wed, 28 Nov 2012 14:21:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TdiVx-0003og-N3
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 14:21:25 +0000
Received: from [85.158.137.99:36680] by server-12.bemta-3.messagelabs.com id
	7B/C6-22757-4ED16B05; Wed, 28 Nov 2012 14:21:24 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354112483!16913086!5
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7877 invoked from network); 28 Nov 2012 14:21:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:21:24 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16048735"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 14:21:24 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 14:21:24 +0000
MIME-Version: 1.0
X-Mercurial-Node: 5b3dce3e5aab4ddb968d68816d1bbd872c8ef871
Message-ID: <5b3dce3e5aab4ddb968d.1354112415@makatos-desktop>
In-Reply-To: <patchbomb.1354112410@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 28 Nov 2012 14:20:15 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 5 of 5 RFC] blktap3: Add the xenio binaries to
 the Mercurial ignore list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

diff -r 0f3b6811dad1 -r 5b3dce3e5aab .hgignore
--- a/.hgignore	Wed Nov 28 14:18:46 2012 +0000
+++ b/.hgignore	Wed Nov 28 14:18:46 2012 +0000
@@ -347,3 +347,6 @@
 ^unmodified_drivers/linux-2.6/.*\.ko$
 ^unmodified_drivers/linux-2.6/.*\.mod\.c$
 ^LibVNCServer.*
+
+# blktap3
+^tools/blktap3/xenio/xenio$

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:21:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:21:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdiVz-0003pC-E9; Wed, 28 Nov 2012 14:21:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TdiVx-0003oa-GN
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 14:21:25 +0000
Received: from [85.158.137.99:59409] by server-1.bemta-3.messagelabs.com id
	70/5E-12169-4ED16B05; Wed, 28 Nov 2012 14:21:24 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354112483!16913086!3
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7762 invoked from network); 28 Nov 2012 14:21:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:21:23 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16048732"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 14:21:23 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 14:21:23 +0000
MIME-Version: 1.0
X-Mercurial-Node: 6918a76c96d89bc821a4e4aa2e1d4e423e41c4da
Message-ID: <6918a76c96d89bc821a4.1354112412@makatos-desktop>
In-Reply-To: <patchbomb.1354112410@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 28 Nov 2012 14:20:12 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 2 of 5 RFC] blktap3: Logging for the xenio
	daemon and libxenio
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch introduces xenio and libxenio logging functionality. At the moment
logging is passed to vsyslog() via a wrapper.

diff -r d426fc267197 -r 6918a76c96d8 tools/blktap3/xenio/log.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/blktap3/xenio/log.c	Wed Nov 28 14:13:29 2012 +0000
@@ -0,0 +1,15 @@
+#include "compiler.h"
+#include <stdarg.h>
+#include <syslog.h>
+
+void (*xenio_vlog) (int prio, const char *fmt, va_list ap) = vsyslog;
+
+__printf(2, 3) void
+xenio_log(int prio, const char *fmt, ...)
+{
+    va_list ap;
+    va_start(ap, fmt);
+    xenio_vlog(prio, fmt, ap);
+    va_end(ap);
+}
+

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:21:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:21:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdiVz-0003pC-E9; Wed, 28 Nov 2012 14:21:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <thanos.makatos@citrix.com>) id 1TdiVx-0003oa-GN
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 14:21:25 +0000
Received: from [85.158.137.99:59409] by server-1.bemta-3.messagelabs.com id
	70/5E-12169-4ED16B05; Wed, 28 Nov 2012 14:21:24 +0000
X-Env-Sender: thanos.makatos@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354112483!16913086!3
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7762 invoked from network); 28 Nov 2012 14:21:23 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:21:23 -0000
X-IronPort-AV: E=Sophos;i="4.84,177,1355097600"; d="scan'208";a="16048732"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 14:21:23 +0000
Received: from [127.0.1.1] (10.80.3.216) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 14:21:23 +0000
MIME-Version: 1.0
X-Mercurial-Node: 6918a76c96d89bc821a4e4aa2e1d4e423e41c4da
Message-ID: <6918a76c96d89bc821a4.1354112412@makatos-desktop>
In-Reply-To: <patchbomb.1354112410@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Wed, 28 Nov 2012 14:20:12 +0000
From: Thanos Makatos <thanos.makatos@citrix.com>
To: xen-devel@lists.xensource.com
Cc: thanos.makatos@citrix.com
Subject: [Xen-devel] [PATCH 2 of 5 RFC] blktap3: Logging for the xenio
	daemon and libxenio
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch introduces xenio and libxenio logging functionality. At the moment
logging is passed to vsyslog() via a wrapper.

diff -r d426fc267197 -r 6918a76c96d8 tools/blktap3/xenio/log.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/blktap3/xenio/log.c	Wed Nov 28 14:13:29 2012 +0000
@@ -0,0 +1,15 @@
+#include "compiler.h"
+#include <stdarg.h>
+#include <syslog.h>
+
+void (*xenio_vlog) (int prio, const char *fmt, va_list ap) = vsyslog;
+
+__printf(2, 3) void
+xenio_log(int prio, const char *fmt, ...)
+{
+    va_list ap;
+    va_start(ap, fmt);
+    xenio_vlog(prio, fmt, ap);
+    va_end(ap);
+}
+

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:26:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:26:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdiaO-0004Xn-M8; Wed, 28 Nov 2012 14:26:00 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TdiaM-0004Xe-Px
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 14:25:58 +0000
Received: from [193.109.254.147:58321] by server-7.bemta-14.messagelabs.com id
	BC/8B-02272-6FE16B05; Wed, 28 Nov 2012 14:25:58 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1354112730!8627110!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODE1MjA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29598 invoked from network); 28 Nov 2012 14:25:32 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-2.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 14:25:32 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASEPQ7m007164
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 14:25:27 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASEPPsx012426
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 14:25:26 GMT
Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASEPPdh017528; Wed, 28 Nov 2012 08:25:25 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 28 Nov 2012 06:25:25 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 6DA8AE00966; Wed, 28 Nov 2012 09:25:21 -0500 (EST)
Date: Wed, 28 Nov 2012 09:25:21 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121128142521.GB21266@phenom.dumpdata.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211281150380.5310@kaball.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1211281150380.5310@kaball.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 11:50:54AM +0000, Stefano Stabellini wrote:
> On Wed, 28 Nov 2012, Jan Beulich wrote:
> > >>> On 27.11.12 at 22:31, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > > Mukesh Rathor (6):
> > >       xen/pvh: Support ParaVirtualized Hardware extensions.
> > >       xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
> > >       xen/pvh: Implement MMU changes for PVH.
> > >       xen/pvh: bootup and setup (E820) related changes.
> > >       xen/pvh: balloon and grant changes.
> > >       xen/pvh: /dev/xen/privcmd changes.
> > 
> > As said before - I don't think it is a good idea to push the kernel side
> > changes into an official release when the hypervisor side ones didn't
> > even get an initial review yet.
> 
> I agree

That would delay the ARM patches that Ian posted as they are dependent on this.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:26:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:26:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdiaO-0004Xn-M8; Wed, 28 Nov 2012 14:26:00 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TdiaM-0004Xe-Px
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 14:25:58 +0000
Received: from [193.109.254.147:58321] by server-7.bemta-14.messagelabs.com id
	BC/8B-02272-6FE16B05; Wed, 28 Nov 2012 14:25:58 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1354112730!8627110!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODE1MjA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29598 invoked from network); 28 Nov 2012 14:25:32 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-2.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 14:25:32 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASEPQ7m007164
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 14:25:27 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASEPPsx012426
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 14:25:26 GMT
Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASEPPdh017528; Wed, 28 Nov 2012 08:25:25 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 28 Nov 2012 06:25:25 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 6DA8AE00966; Wed, 28 Nov 2012 09:25:21 -0500 (EST)
Date: Wed, 28 Nov 2012 09:25:21 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121128142521.GB21266@phenom.dumpdata.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211281150380.5310@kaball.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1211281150380.5310@kaball.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 11:50:54AM +0000, Stefano Stabellini wrote:
> On Wed, 28 Nov 2012, Jan Beulich wrote:
> > >>> On 27.11.12 at 22:31, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > > Mukesh Rathor (6):
> > >       xen/pvh: Support ParaVirtualized Hardware extensions.
> > >       xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
> > >       xen/pvh: Implement MMU changes for PVH.
> > >       xen/pvh: bootup and setup (E820) related changes.
> > >       xen/pvh: balloon and grant changes.
> > >       xen/pvh: /dev/xen/privcmd changes.
> > 
> > As said before - I don't think it is a good idea to push the kernel side
> > changes into an official release when the hypervisor side ones didn't
> > even get an initial review yet.
> 
> I agree

That would delay the ARM patches that Ian posted as they are dependent on this.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:32:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:32:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdig6-0004sD-GD; Wed, 28 Nov 2012 14:31:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tdig4-0004s7-QQ
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 14:31:53 +0000
Received: from [85.158.137.99:45663] by server-6.bemta-3.messagelabs.com id
	E1/D7-28265-35026B05; Wed, 28 Nov 2012 14:31:47 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1354113105!12275906!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28019 invoked from network); 28 Nov 2012 14:31:46 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 14:31:46 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 14:32:29 +0000
Message-Id: <50B62E9802000078000AC2B3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 14:32:40 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part3607DD98.1__="
Cc: xiantao.zhang@intel.com
Subject: [Xen-devel] [PATCH] VT-d: make scope parsing code type safe
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part3607DD98.1__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Rather than requiring the scopes to be the first members of their
respective structures (so that casts can be used to switch between the
different views), properly use types and container_of().

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -304,13 +304,15 @@ static int __init scope_device_count(con
=20
=20
 static int __init acpi_parse_dev_scope(
-    const void *start, const void *end, void *acpi_entry, int type, u16 =
seg)
+    const void *start, const void *end, struct dmar_scope *scope,
+    int type, u16 seg)
 {
-    struct dmar_scope *scope =3D acpi_entry;
     struct acpi_ioapic_unit *acpi_ioapic_unit;
     const struct acpi_dmar_device_scope *acpi_scope;
     u16 bus, sub_bus, sec_bus;
     const struct acpi_dmar_pci_path *path;
+    struct acpi_drhd_unit *drhd =3D type =3D=3D DMAR_TYPE ?
+        container_of(scope, struct acpi_drhd_unit, scope) : NULL;
     int depth, cnt, didx =3D 0;
=20
     if ( (cnt =3D scope_device_count(start, end)) < 0 )
@@ -359,9 +361,8 @@ static int __init acpi_parse_dev_scope(
                 dprintk(VTDPREFIX, " MSI HPET: %04x:%02x:%02x.%u\n",
                         seg, bus, path->dev, path->fn);
=20
-            if ( type =3D=3D DMAR_TYPE )
+            if ( drhd )
             {
-                struct acpi_drhd_unit *drhd =3D acpi_entry;
                 struct acpi_hpet_unit *acpi_hpet_unit;
=20
                 acpi_hpet_unit =3D xmalloc(struct acpi_hpet_unit);
@@ -381,10 +382,8 @@ static int __init acpi_parse_dev_scope(
                 dprintk(VTDPREFIX, " endpoint: %04x:%02x:%02x.%u\n",
                         seg, bus, path->dev, path->fn);
=20
-            if ( type =3D=3D DMAR_TYPE )
+            if ( drhd )
             {
-                struct acpi_drhd_unit *drhd =3D acpi_entry;
-
                 if ( (seg =3D=3D 0) && (bus =3D=3D 0) && (path->dev =
=3D=3D 2) &&
                      (path->fn =3D=3D 0) )
                     igd_drhd_address =3D drhd->address;
@@ -397,9 +396,8 @@ static int __init acpi_parse_dev_scope(
                 dprintk(VTDPREFIX, " IOAPIC: %04x:%02x:%02x.%u\n",
                         seg, bus, path->dev, path->fn);
=20
-            if ( type =3D=3D DMAR_TYPE )
+            if ( drhd )
             {
-                struct acpi_drhd_unit *drhd =3D acpi_entry;
                 acpi_ioapic_unit =3D xmalloc(struct acpi_ioapic_unit);
                 if ( !acpi_ioapic_unit )
                     return -ENOMEM;
@@ -463,7 +461,7 @@ acpi_parse_one_drhd(struct acpi_dmar_hea
     dev_scope_start =3D (void *)(drhd + 1);
     dev_scope_end =3D ((void *)drhd) + header->length;
     ret =3D acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
-                               dmaru, DMAR_TYPE, drhd->segment);
+                               &dmaru->scope, DMAR_TYPE, drhd->segment);
=20
     if ( dmaru->include_all )
     {
@@ -590,7 +588,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_hea
     dev_scope_start =3D (void *)(rmrr + 1);
     dev_scope_end   =3D ((void *)rmrr) + header->length;
     ret =3D acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
-                               rmrru, RMRR_TYPE, rmrr->segment);
+                               &rmrru->scope, RMRR_TYPE, rmrr->segment);
=20
     if ( ret || (rmrru->scope.devices_cnt =3D=3D 0) )
         xfree(rmrru);
@@ -683,7 +681,7 @@ acpi_parse_one_atsr(struct acpi_dmar_hea
         dev_scope_start =3D (void *)(atsr + 1);
         dev_scope_end   =3D ((void *)atsr) + header->length;
         ret =3D acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
-                                   atsru, ATSR_TYPE, atsr->segment);
+                                   &atsru->scope, ATSR_TYPE, atsr->segment=
);
     }
     else
     {
--- a/xen/drivers/passthrough/vtd/dmar.h
+++ b/xen/drivers/passthrough/vtd/dmar.h
@@ -59,7 +59,7 @@ struct dmar_scope {
 };
=20
 struct acpi_drhd_unit {
-    struct dmar_scope scope;            /* must be first member of struct =
*/
+    struct dmar_scope scope;
     struct list_head list;
     u64    address;                     /* register base address of the =
unit */
     u16    segment;
@@ -70,7 +70,7 @@ struct acpi_drhd_unit {
 };
=20
 struct acpi_rmrr_unit {
-    struct dmar_scope scope;            /* must be first member of struct =
*/
+    struct dmar_scope scope;
     struct list_head list;
     u64    base_address;
     u64    end_address;
@@ -79,7 +79,7 @@ struct acpi_rmrr_unit {
 };
=20
 struct acpi_atsr_unit {
-    struct dmar_scope scope;            /* must be first member of struct =
*/
+    struct dmar_scope scope;
     struct list_head list;
     u16    segment;
     u8     all_ports:1;



--=__Part3607DD98.1__=
Content-Type: text/plain; name="VT-d-scope-types.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="VT-d-scope-types.patch"

VT-d: make scope parsing code type safe=0A=0ARather than requiring the =
scopes to be the first members of their=0Arespective structures (so that =
casts can be used to switch between the=0Adifferent views), properly use =
types and container_of().=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.co=
m>=0A=0A--- a/xen/drivers/passthrough/vtd/dmar.c=0A+++ b/xen/drivers/passth=
rough/vtd/dmar.c=0A@@ -304,13 +304,15 @@ static int __init scope_device_cou=
nt(con=0A =0A =0A static int __init acpi_parse_dev_scope(=0A-    const =
void *start, const void *end, void *acpi_entry, int type, u16 seg)=0A+    =
const void *start, const void *end, struct dmar_scope *scope,=0A+    int =
type, u16 seg)=0A {=0A-    struct dmar_scope *scope =3D acpi_entry;=0A     =
struct acpi_ioapic_unit *acpi_ioapic_unit;=0A     const struct acpi_dmar_de=
vice_scope *acpi_scope;=0A     u16 bus, sub_bus, sec_bus;=0A     const =
struct acpi_dmar_pci_path *path;=0A+    struct acpi_drhd_unit *drhd =3D =
type =3D=3D DMAR_TYPE ?=0A+        container_of(scope, struct acpi_drhd_uni=
t, scope) : NULL;=0A     int depth, cnt, didx =3D 0;=0A =0A     if ( (cnt =
=3D scope_device_count(start, end)) < 0 )=0A@@ -359,9 +361,8 @@ static int =
__init acpi_parse_dev_scope(=0A                 dprintk(VTDPREFIX, " MSI =
HPET: %04x:%02x:%02x.%u\n",=0A                         seg, bus, path->dev,=
 path->fn);=0A =0A-            if ( type =3D=3D DMAR_TYPE )=0A+            =
if ( drhd )=0A             {=0A-                struct acpi_drhd_unit =
*drhd =3D acpi_entry;=0A                 struct acpi_hpet_unit *acpi_hpet_u=
nit;=0A =0A                 acpi_hpet_unit =3D xmalloc(struct acpi_hpet_uni=
t);=0A@@ -381,10 +382,8 @@ static int __init acpi_parse_dev_scope(=0A      =
           dprintk(VTDPREFIX, " endpoint: %04x:%02x:%02x.%u\n",=0A         =
                seg, bus, path->dev, path->fn);=0A =0A-            if ( =
type =3D=3D DMAR_TYPE )=0A+            if ( drhd )=0A             {=0A-    =
            struct acpi_drhd_unit *drhd =3D acpi_entry;=0A-=0A             =
    if ( (seg =3D=3D 0) && (bus =3D=3D 0) && (path->dev =3D=3D 2) &&=0A    =
                  (path->fn =3D=3D 0) )=0A                     igd_drhd_add=
ress =3D drhd->address;=0A@@ -397,9 +396,8 @@ static int __init acpi_parse_=
dev_scope(=0A                 dprintk(VTDPREFIX, " IOAPIC: %04x:%02x:%02x.%=
u\n",=0A                         seg, bus, path->dev, path->fn);=0A =0A-   =
         if ( type =3D=3D DMAR_TYPE )=0A+            if ( drhd )=0A        =
     {=0A-                struct acpi_drhd_unit *drhd =3D acpi_entry;=0A   =
              acpi_ioapic_unit =3D xmalloc(struct acpi_ioapic_unit);=0A    =
             if ( !acpi_ioapic_unit )=0A                     return =
-ENOMEM;=0A@@ -463,7 +461,7 @@ acpi_parse_one_drhd(struct acpi_dmar_hea=0A =
    dev_scope_start =3D (void *)(drhd + 1);=0A     dev_scope_end =3D =
((void *)drhd) + header->length;=0A     ret =3D acpi_parse_dev_scope(dev_sc=
ope_start, dev_scope_end,=0A-                               dmaru, =
DMAR_TYPE, drhd->segment);=0A+                               &dmaru->scope,=
 DMAR_TYPE, drhd->segment);=0A =0A     if ( dmaru->include_all )=0A     =
{=0A@@ -590,7 +588,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_hea=0A     =
dev_scope_start =3D (void *)(rmrr + 1);=0A     dev_scope_end   =3D ((void =
*)rmrr) + header->length;=0A     ret =3D acpi_parse_dev_scope(dev_scope_sta=
rt, dev_scope_end,=0A-                               rmrru, RMRR_TYPE, =
rmrr->segment);=0A+                               &rmrru->scope, RMRR_TYPE,=
 rmrr->segment);=0A =0A     if ( ret || (rmrru->scope.devices_cnt =3D=3D =
0) )=0A         xfree(rmrru);=0A@@ -683,7 +681,7 @@ acpi_parse_one_atsr(str=
uct acpi_dmar_hea=0A         dev_scope_start =3D (void *)(atsr + 1);=0A    =
     dev_scope_end   =3D ((void *)atsr) + header->length;=0A         ret =
=3D acpi_parse_dev_scope(dev_scope_start, dev_scope_end,=0A-               =
                    atsru, ATSR_TYPE, atsr->segment);=0A+                  =
                 &atsru->scope, ATSR_TYPE, atsr->segment);=0A     }=0A     =
else=0A     {=0A--- a/xen/drivers/passthrough/vtd/dmar.h=0A+++ b/xen/driver=
s/passthrough/vtd/dmar.h=0A@@ -59,7 +59,7 @@ struct dmar_scope {=0A };=0A =
=0A struct acpi_drhd_unit {=0A-    struct dmar_scope scope;            /* =
must be first member of struct */=0A+    struct dmar_scope scope;=0A     =
struct list_head list;=0A     u64    address;                     /* =
register base address of the unit */=0A     u16    segment;=0A@@ -70,7 =
+70,7 @@ struct acpi_drhd_unit {=0A };=0A =0A struct acpi_rmrr_unit {=0A-  =
  struct dmar_scope scope;            /* must be first member of struct =
*/=0A+    struct dmar_scope scope;=0A     struct list_head list;=0A     =
u64    base_address;=0A     u64    end_address;=0A@@ -79,7 +79,7 @@ struct =
acpi_rmrr_unit {=0A };=0A =0A struct acpi_atsr_unit {=0A-    struct =
dmar_scope scope;            /* must be first member of struct */=0A+    =
struct dmar_scope scope;=0A     struct list_head list;=0A     u16    =
segment;=0A     u8     all_ports:1;=0A
--=__Part3607DD98.1__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part3607DD98.1__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 14:32:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:32:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdig6-0004sD-GD; Wed, 28 Nov 2012 14:31:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tdig4-0004s7-QQ
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 14:31:53 +0000
Received: from [85.158.137.99:45663] by server-6.bemta-3.messagelabs.com id
	E1/D7-28265-35026B05; Wed, 28 Nov 2012 14:31:47 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1354113105!12275906!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28019 invoked from network); 28 Nov 2012 14:31:46 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 14:31:46 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 14:32:29 +0000
Message-Id: <50B62E9802000078000AC2B3@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 14:32:40 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part3607DD98.1__="
Cc: xiantao.zhang@intel.com
Subject: [Xen-devel] [PATCH] VT-d: make scope parsing code type safe
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part3607DD98.1__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Rather than requiring the scopes to be the first members of their
respective structures (so that casts can be used to switch between the
different views), properly use types and container_of().

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -304,13 +304,15 @@ static int __init scope_device_count(con
=20
=20
 static int __init acpi_parse_dev_scope(
-    const void *start, const void *end, void *acpi_entry, int type, u16 =
seg)
+    const void *start, const void *end, struct dmar_scope *scope,
+    int type, u16 seg)
 {
-    struct dmar_scope *scope =3D acpi_entry;
     struct acpi_ioapic_unit *acpi_ioapic_unit;
     const struct acpi_dmar_device_scope *acpi_scope;
     u16 bus, sub_bus, sec_bus;
     const struct acpi_dmar_pci_path *path;
+    struct acpi_drhd_unit *drhd =3D type =3D=3D DMAR_TYPE ?
+        container_of(scope, struct acpi_drhd_unit, scope) : NULL;
     int depth, cnt, didx =3D 0;
=20
     if ( (cnt =3D scope_device_count(start, end)) < 0 )
@@ -359,9 +361,8 @@ static int __init acpi_parse_dev_scope(
                 dprintk(VTDPREFIX, " MSI HPET: %04x:%02x:%02x.%u\n",
                         seg, bus, path->dev, path->fn);
=20
-            if ( type =3D=3D DMAR_TYPE )
+            if ( drhd )
             {
-                struct acpi_drhd_unit *drhd =3D acpi_entry;
                 struct acpi_hpet_unit *acpi_hpet_unit;
=20
                 acpi_hpet_unit =3D xmalloc(struct acpi_hpet_unit);
@@ -381,10 +382,8 @@ static int __init acpi_parse_dev_scope(
                 dprintk(VTDPREFIX, " endpoint: %04x:%02x:%02x.%u\n",
                         seg, bus, path->dev, path->fn);
=20
-            if ( type =3D=3D DMAR_TYPE )
+            if ( drhd )
             {
-                struct acpi_drhd_unit *drhd =3D acpi_entry;
-
                 if ( (seg =3D=3D 0) && (bus =3D=3D 0) && (path->dev =
=3D=3D 2) &&
                      (path->fn =3D=3D 0) )
                     igd_drhd_address =3D drhd->address;
@@ -397,9 +396,8 @@ static int __init acpi_parse_dev_scope(
                 dprintk(VTDPREFIX, " IOAPIC: %04x:%02x:%02x.%u\n",
                         seg, bus, path->dev, path->fn);
=20
-            if ( type =3D=3D DMAR_TYPE )
+            if ( drhd )
             {
-                struct acpi_drhd_unit *drhd =3D acpi_entry;
                 acpi_ioapic_unit =3D xmalloc(struct acpi_ioapic_unit);
                 if ( !acpi_ioapic_unit )
                     return -ENOMEM;
@@ -463,7 +461,7 @@ acpi_parse_one_drhd(struct acpi_dmar_hea
     dev_scope_start =3D (void *)(drhd + 1);
     dev_scope_end =3D ((void *)drhd) + header->length;
     ret =3D acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
-                               dmaru, DMAR_TYPE, drhd->segment);
+                               &dmaru->scope, DMAR_TYPE, drhd->segment);
=20
     if ( dmaru->include_all )
     {
@@ -590,7 +588,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_hea
     dev_scope_start =3D (void *)(rmrr + 1);
     dev_scope_end   =3D ((void *)rmrr) + header->length;
     ret =3D acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
-                               rmrru, RMRR_TYPE, rmrr->segment);
+                               &rmrru->scope, RMRR_TYPE, rmrr->segment);
=20
     if ( ret || (rmrru->scope.devices_cnt =3D=3D 0) )
         xfree(rmrru);
@@ -683,7 +681,7 @@ acpi_parse_one_atsr(struct acpi_dmar_hea
         dev_scope_start =3D (void *)(atsr + 1);
         dev_scope_end   =3D ((void *)atsr) + header->length;
         ret =3D acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
-                                   atsru, ATSR_TYPE, atsr->segment);
+                                   &atsru->scope, ATSR_TYPE, atsr->segment=
);
     }
     else
     {
--- a/xen/drivers/passthrough/vtd/dmar.h
+++ b/xen/drivers/passthrough/vtd/dmar.h
@@ -59,7 +59,7 @@ struct dmar_scope {
 };
=20
 struct acpi_drhd_unit {
-    struct dmar_scope scope;            /* must be first member of struct =
*/
+    struct dmar_scope scope;
     struct list_head list;
     u64    address;                     /* register base address of the =
unit */
     u16    segment;
@@ -70,7 +70,7 @@ struct acpi_drhd_unit {
 };
=20
 struct acpi_rmrr_unit {
-    struct dmar_scope scope;            /* must be first member of struct =
*/
+    struct dmar_scope scope;
     struct list_head list;
     u64    base_address;
     u64    end_address;
@@ -79,7 +79,7 @@ struct acpi_rmrr_unit {
 };
=20
 struct acpi_atsr_unit {
-    struct dmar_scope scope;            /* must be first member of struct =
*/
+    struct dmar_scope scope;
     struct list_head list;
     u16    segment;
     u8     all_ports:1;



--=__Part3607DD98.1__=
Content-Type: text/plain; name="VT-d-scope-types.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="VT-d-scope-types.patch"

VT-d: make scope parsing code type safe=0A=0ARather than requiring the =
scopes to be the first members of their=0Arespective structures (so that =
casts can be used to switch between the=0Adifferent views), properly use =
types and container_of().=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.co=
m>=0A=0A--- a/xen/drivers/passthrough/vtd/dmar.c=0A+++ b/xen/drivers/passth=
rough/vtd/dmar.c=0A@@ -304,13 +304,15 @@ static int __init scope_device_cou=
nt(con=0A =0A =0A static int __init acpi_parse_dev_scope(=0A-    const =
void *start, const void *end, void *acpi_entry, int type, u16 seg)=0A+    =
const void *start, const void *end, struct dmar_scope *scope,=0A+    int =
type, u16 seg)=0A {=0A-    struct dmar_scope *scope =3D acpi_entry;=0A     =
struct acpi_ioapic_unit *acpi_ioapic_unit;=0A     const struct acpi_dmar_de=
vice_scope *acpi_scope;=0A     u16 bus, sub_bus, sec_bus;=0A     const =
struct acpi_dmar_pci_path *path;=0A+    struct acpi_drhd_unit *drhd =3D =
type =3D=3D DMAR_TYPE ?=0A+        container_of(scope, struct acpi_drhd_uni=
t, scope) : NULL;=0A     int depth, cnt, didx =3D 0;=0A =0A     if ( (cnt =
=3D scope_device_count(start, end)) < 0 )=0A@@ -359,9 +361,8 @@ static int =
__init acpi_parse_dev_scope(=0A                 dprintk(VTDPREFIX, " MSI =
HPET: %04x:%02x:%02x.%u\n",=0A                         seg, bus, path->dev,=
 path->fn);=0A =0A-            if ( type =3D=3D DMAR_TYPE )=0A+            =
if ( drhd )=0A             {=0A-                struct acpi_drhd_unit =
*drhd =3D acpi_entry;=0A                 struct acpi_hpet_unit *acpi_hpet_u=
nit;=0A =0A                 acpi_hpet_unit =3D xmalloc(struct acpi_hpet_uni=
t);=0A@@ -381,10 +382,8 @@ static int __init acpi_parse_dev_scope(=0A      =
           dprintk(VTDPREFIX, " endpoint: %04x:%02x:%02x.%u\n",=0A         =
                seg, bus, path->dev, path->fn);=0A =0A-            if ( =
type =3D=3D DMAR_TYPE )=0A+            if ( drhd )=0A             {=0A-    =
            struct acpi_drhd_unit *drhd =3D acpi_entry;=0A-=0A             =
    if ( (seg =3D=3D 0) && (bus =3D=3D 0) && (path->dev =3D=3D 2) &&=0A    =
                  (path->fn =3D=3D 0) )=0A                     igd_drhd_add=
ress =3D drhd->address;=0A@@ -397,9 +396,8 @@ static int __init acpi_parse_=
dev_scope(=0A                 dprintk(VTDPREFIX, " IOAPIC: %04x:%02x:%02x.%=
u\n",=0A                         seg, bus, path->dev, path->fn);=0A =0A-   =
         if ( type =3D=3D DMAR_TYPE )=0A+            if ( drhd )=0A        =
     {=0A-                struct acpi_drhd_unit *drhd =3D acpi_entry;=0A   =
              acpi_ioapic_unit =3D xmalloc(struct acpi_ioapic_unit);=0A    =
             if ( !acpi_ioapic_unit )=0A                     return =
-ENOMEM;=0A@@ -463,7 +461,7 @@ acpi_parse_one_drhd(struct acpi_dmar_hea=0A =
    dev_scope_start =3D (void *)(drhd + 1);=0A     dev_scope_end =3D =
((void *)drhd) + header->length;=0A     ret =3D acpi_parse_dev_scope(dev_sc=
ope_start, dev_scope_end,=0A-                               dmaru, =
DMAR_TYPE, drhd->segment);=0A+                               &dmaru->scope,=
 DMAR_TYPE, drhd->segment);=0A =0A     if ( dmaru->include_all )=0A     =
{=0A@@ -590,7 +588,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_hea=0A     =
dev_scope_start =3D (void *)(rmrr + 1);=0A     dev_scope_end   =3D ((void =
*)rmrr) + header->length;=0A     ret =3D acpi_parse_dev_scope(dev_scope_sta=
rt, dev_scope_end,=0A-                               rmrru, RMRR_TYPE, =
rmrr->segment);=0A+                               &rmrru->scope, RMRR_TYPE,=
 rmrr->segment);=0A =0A     if ( ret || (rmrru->scope.devices_cnt =3D=3D =
0) )=0A         xfree(rmrru);=0A@@ -683,7 +681,7 @@ acpi_parse_one_atsr(str=
uct acpi_dmar_hea=0A         dev_scope_start =3D (void *)(atsr + 1);=0A    =
     dev_scope_end   =3D ((void *)atsr) + header->length;=0A         ret =
=3D acpi_parse_dev_scope(dev_scope_start, dev_scope_end,=0A-               =
                    atsru, ATSR_TYPE, atsr->segment);=0A+                  =
                 &atsru->scope, ATSR_TYPE, atsr->segment);=0A     }=0A     =
else=0A     {=0A--- a/xen/drivers/passthrough/vtd/dmar.h=0A+++ b/xen/driver=
s/passthrough/vtd/dmar.h=0A@@ -59,7 +59,7 @@ struct dmar_scope {=0A };=0A =
=0A struct acpi_drhd_unit {=0A-    struct dmar_scope scope;            /* =
must be first member of struct */=0A+    struct dmar_scope scope;=0A     =
struct list_head list;=0A     u64    address;                     /* =
register base address of the unit */=0A     u16    segment;=0A@@ -70,7 =
+70,7 @@ struct acpi_drhd_unit {=0A };=0A =0A struct acpi_rmrr_unit {=0A-  =
  struct dmar_scope scope;            /* must be first member of struct =
*/=0A+    struct dmar_scope scope;=0A     struct list_head list;=0A     =
u64    base_address;=0A     u64    end_address;=0A@@ -79,7 +79,7 @@ struct =
acpi_rmrr_unit {=0A };=0A =0A struct acpi_atsr_unit {=0A-    struct =
dmar_scope scope;            /* must be first member of struct */=0A+    =
struct dmar_scope scope;=0A     struct list_head list;=0A     u16    =
segment;=0A     u8     all_ports:1;=0A
--=__Part3607DD98.1__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part3607DD98.1__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 14:32:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:32:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdigQ-0004u2-Tn; Wed, 28 Nov 2012 14:32:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdigP-0004tp-Mr
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 14:32:13 +0000
Received: from [85.158.137.99:2209] by server-14.bemta-3.messagelabs.com id
	CE/E5-31424-86026B05; Wed, 28 Nov 2012 14:32:08 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354113126!16915405!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6987 invoked from network); 28 Nov 2012 14:32:07 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 14:32:07 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 14:32:51 +0000
Message-Id: <50B62EAE02000078000AC2B7@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 14:33:02 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part2011CB8E.0__="
Subject: [Xen-devel] [PATCH] IOMMU: imply "verbose" from "debug"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part2011CB8E.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I think that generally enabling debugging code without also enabling
verbose output is rather pointless; if someone really wants this, they
can always pass e.g. "iommu=3Ddebug,no-verbose".

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -92,7 +92,11 @@ static void __init parse_iommu_param(cha
         else if ( !strcmp(s, "intremap") )
             iommu_intremap =3D val;
         else if ( !strcmp(s, "debug") )
+        {
             iommu_debug =3D val;
+            if ( val )
+                iommu_verbose =3D 1;
+        }
         else if ( !strcmp(s, "amd-iommu-perdev-intremap") )
             amd_iommu_perdev_intremap =3D val;
         else if ( !strcmp(s, "dom0-passthrough") )




--=__Part2011CB8E.0__=
Content-Type: text/plain; name="IOMMU-debug-verbose.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="IOMMU-debug-verbose.patch"

IOMMU: imply "verbose" from "debug"=0A=0AI think that generally enabling =
debugging code without also enabling=0Averbose output is rather pointless; =
if someone really wants this, they=0Acan always pass e.g. "iommu=3Ddebug,no=
-verbose".=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- =
a/xen/drivers/passthrough/iommu.c=0A+++ b/xen/drivers/passthrough/iommu.c=
=0A@@ -92,7 +92,11 @@ static void __init parse_iommu_param(cha=0A         =
else if ( !strcmp(s, "intremap") )=0A             iommu_intremap =3D =
val;=0A         else if ( !strcmp(s, "debug") )=0A+        {=0A            =
 iommu_debug =3D val;=0A+            if ( val )=0A+                =
iommu_verbose =3D 1;=0A+        }=0A         else if ( !strcmp(s, =
"amd-iommu-perdev-intremap") )=0A             amd_iommu_perdev_intremap =
=3D val;=0A         else if ( !strcmp(s, "dom0-passthrough") )=0A
--=__Part2011CB8E.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.xen.org
http://lists.xen.org/xen-devel

--=__Part2011CB8E.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 14:32:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:32:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdigQ-0004u2-Tn; Wed, 28 Nov 2012 14:32:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdigP-0004tp-Mr
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 14:32:13 +0000
Received: from [85.158.137.99:2209] by server-14.bemta-3.messagelabs.com id
	CE/E5-31424-86026B05; Wed, 28 Nov 2012 14:32:08 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354113126!16915405!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6987 invoked from network); 28 Nov 2012 14:32:07 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-2.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 14:32:07 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 14:32:51 +0000
Message-Id: <50B62EAE02000078000AC2B7@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 14:33:02 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part2011CB8E.0__="
Subject: [Xen-devel] [PATCH] IOMMU: imply "verbose" from "debug"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part2011CB8E.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I think that generally enabling debugging code without also enabling
verbose output is rather pointless; if someone really wants this, they
can always pass e.g. "iommu=3Ddebug,no-verbose".

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -92,7 +92,11 @@ static void __init parse_iommu_param(cha
         else if ( !strcmp(s, "intremap") )
             iommu_intremap =3D val;
         else if ( !strcmp(s, "debug") )
+        {
             iommu_debug =3D val;
+            if ( val )
+                iommu_verbose =3D 1;
+        }
         else if ( !strcmp(s, "amd-iommu-perdev-intremap") )
             amd_iommu_perdev_intremap =3D val;
         else if ( !strcmp(s, "dom0-passthrough") )




--=__Part2011CB8E.0__=
Content-Type: text/plain; name="IOMMU-debug-verbose.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="IOMMU-debug-verbose.patch"

IOMMU: imply "verbose" from "debug"=0A=0AI think that generally enabling =
debugging code without also enabling=0Averbose output is rather pointless; =
if someone really wants this, they=0Acan always pass e.g. "iommu=3Ddebug,no=
-verbose".=0A=0ASigned-off-by: Jan Beulich <jbeulich@suse.com>=0A=0A--- =
a/xen/drivers/passthrough/iommu.c=0A+++ b/xen/drivers/passthrough/iommu.c=
=0A@@ -92,7 +92,11 @@ static void __init parse_iommu_param(cha=0A         =
else if ( !strcmp(s, "intremap") )=0A             iommu_intremap =3D =
val;=0A         else if ( !strcmp(s, "debug") )=0A+        {=0A            =
 iommu_debug =3D val;=0A+            if ( val )=0A+                =
iommu_verbose =3D 1;=0A+        }=0A         else if ( !strcmp(s, =
"amd-iommu-perdev-intremap") )=0A             amd_iommu_perdev_intremap =
=3D val;=0A         else if ( !strcmp(s, "dom0-passthrough") )=0A
--=__Part2011CB8E.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.xen.org
http://lists.xen.org/xen-devel

--=__Part2011CB8E.0__=--


From xen-devel-bounces@lists.xen.org Wed Nov 28 14:32:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:32:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdigd-0004vn-BT; Wed, 28 Nov 2012 14:32:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tdigb-0004vL-Gw
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 14:32:25 +0000
Received: from [85.158.138.51:43140] by server-15.bemta-3.messagelabs.com id
	3A/E2-23779-87026B05; Wed, 28 Nov 2012 14:32:24 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354113143!25489662!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15761 invoked from network); 28 Nov 2012 14:32:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:32:24 -0000
X-IronPort-AV: E=Sophos;i="4.84,179,1355097600"; d="scan'208";a="16049060"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 14:32:23 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 14:32:23 +0000
Message-ID: <1354113142.25834.34.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Wed, 28 Nov 2012 14:32:22 +0000
In-Reply-To: <20121128142521.GB21266@phenom.dumpdata.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211281150380.5310@kaball.uk.xensource.com>
	<20121128142521.GB21266@phenom.dumpdata.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>, Jan Beulich <JBeulich@suse.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 14:25 +0000, Konrad Rzeszutek Wilk wrote:
> On Wed, Nov 28, 2012 at 11:50:54AM +0000, Stefano Stabellini wrote:
> > On Wed, 28 Nov 2012, Jan Beulich wrote:
> > > >>> On 27.11.12 at 22:31, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > > > Mukesh Rathor (6):
> > > >       xen/pvh: Support ParaVirtualized Hardware extensions.
> > > >       xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
> > > >       xen/pvh: Implement MMU changes for PVH.
> > > >       xen/pvh: bootup and setup (E820) related changes.
> > > >       xen/pvh: balloon and grant changes.
> > > >       xen/pvh: /dev/xen/privcmd changes.
> > > 
> > > As said before - I don't think it is a good idea to push the kernel side
> > > changes into an official release when the hypervisor side ones didn't
> > > even get an initial review yet.
> > 
> > I agree
> 
> That would delay the ARM patches that Ian posted as they are dependent on this.

I'd be happy to produce a series with the generic bits from the pvh
series which are required by the ARM stuff (the privcmd and balloon bits
mainly) and base the arm stuff on that. I think I offered to do this
before.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:32:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:32:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdigd-0004vn-BT; Wed, 28 Nov 2012 14:32:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tdigb-0004vL-Gw
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 14:32:25 +0000
Received: from [85.158.138.51:43140] by server-15.bemta-3.messagelabs.com id
	3A/E2-23779-87026B05; Wed, 28 Nov 2012 14:32:24 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354113143!25489662!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15761 invoked from network); 28 Nov 2012 14:32:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:32:24 -0000
X-IronPort-AV: E=Sophos;i="4.84,179,1355097600"; d="scan'208";a="16049060"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 14:32:23 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 14:32:23 +0000
Message-ID: <1354113142.25834.34.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Wed, 28 Nov 2012 14:32:22 +0000
In-Reply-To: <20121128142521.GB21266@phenom.dumpdata.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211281150380.5310@kaball.uk.xensource.com>
	<20121128142521.GB21266@phenom.dumpdata.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>, Jan Beulich <JBeulich@suse.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 14:25 +0000, Konrad Rzeszutek Wilk wrote:
> On Wed, Nov 28, 2012 at 11:50:54AM +0000, Stefano Stabellini wrote:
> > On Wed, 28 Nov 2012, Jan Beulich wrote:
> > > >>> On 27.11.12 at 22:31, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > > > Mukesh Rathor (6):
> > > >       xen/pvh: Support ParaVirtualized Hardware extensions.
> > > >       xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
> > > >       xen/pvh: Implement MMU changes for PVH.
> > > >       xen/pvh: bootup and setup (E820) related changes.
> > > >       xen/pvh: balloon and grant changes.
> > > >       xen/pvh: /dev/xen/privcmd changes.
> > > 
> > > As said before - I don't think it is a good idea to push the kernel side
> > > changes into an official release when the hypervisor side ones didn't
> > > even get an initial review yet.
> > 
> > I agree
> 
> That would delay the ARM patches that Ian posted as they are dependent on this.

I'd be happy to produce a series with the generic bits from the pvh
series which are required by the ARM stuff (the privcmd and balloon bits
mainly) and base the arm stuff on that. I think I offered to do this
before.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:37:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:37:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdilS-0005Fm-3U; Wed, 28 Nov 2012 14:37:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TdilQ-0005Fg-Hf
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 14:37:24 +0000
Received: from [85.158.143.35:14778] by server-2.bemta-4.messagelabs.com id
	80/56-28922-3A126B05; Wed, 28 Nov 2012 14:37:23 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354113442!15780471!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0ODA0OA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12481 invoked from network); 28 Nov 2012 14:37:22 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-6.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 14:37:22 -0000
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
	by fmsmga101.fm.intel.com with ESMTP; 28 Nov 2012 06:37:21 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,179,1355126400"; 
	d="scan'208,217";a="255928695"
Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37])
	by fmsmga002.fm.intel.com with ESMTP; 28 Nov 2012 06:37:21 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 28 Nov 2012 06:37:21 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Wed, 28 Nov 2012 22:37:19 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Campbell <ian.campbell@citrix.com>
Thread-Topic: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNyZdIH+TZqbearkyCq5DrDs2IGJf/WEBQ
Date: Wed, 28 Nov 2012 14:37:18 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353996FF@SHSMSX101.ccr.corp.intel.com>
References: <d3378692eece3e552ba2.1353630328@ljsromley.bj.intel.com>
	<CAFLBxZZ_W5PMLYiqEwdrpqkjgiMN9NoN2f33ErLriOwNOD9GgA@mail.gmail.com>
In-Reply-To: <CAFLBxZZ_W5PMLYiqEwdrpqkjgiMN9NoN2f33ErLriOwNOD9GgA@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5150255543628298859=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5150255543628298859==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_DE8DF0795D48FD4CA783C40EC82923353996FFSHSMSX101ccrcorpi_"

--_000_DE8DF0795D48FD4CA783C40EC82923353996FFSHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Ping?

Thanks,
Jinsong

________________________________
From: dunlapg@gmail.com [mailto:dunlapg@gmail.com] On Behalf Of George Dunl=
ap
Sent: Saturday, November 24, 2012 12:26 AM
To: Liu, Jinsong
Cc: Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regar=
d to migration

On Fri, Nov 23, 2012 at 12:25 AM, Liu Jinsong <jinsong.liu@intel.com<mailto=
:jinsong.liu@intel.com>> wrote:
This patch handles broken page wrt migration. Generally there are below cas=
es:
1. broken page occurs before migration
2. broken page occurs during migration
  2.1 broken page occurs during migration but not at the last iteration
  2.2 broken page occurs at the last iteration of migration

For case 1, at the sender the broken page will be mapped but not copied
  to target (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number will be transferred to target so that
  target take appropriate action.

For case 2.1, at the sender mce handler marks the broken page to dirty
  bitmap, so that at next iteration, its pfn_type and pfn number will be
  transferred to the target and then take appropriate action.

For case 2.2, at the sender it adds a check to see if vMCE occurs at the
  last iteration. If yes, it will do more iteration(s) so that the broken
  page's pfn_type and pfn number will be transferred to target.
  Another point is, if guest save to disk and during which vMCE occurs,
  it also need do more iteration(s).

For all cases at the target (if migration not aborted by vMCE):
  Target will populates pages for guest. As for the case of broken page,
  we prefer to keep the type of the page for the sake of seamless migration=
.
  Target will set p2m as p2m_ram_broken for broken page. If guest access
  the broken page again it will kill itself as expected.

All above description is based on the assumption that migration will succes=
s.
However, for case 2 there are scenario that may result in guest or hypervis=
or
crash. When pfn_type detecting fail to get p2m_ram_broken (vMCE occur after=
 the
detecting) and read the broken page, guest/hypervisor may survive or crash,
depending on error nature and how guest/hypervisor handle it. If guest/hype=
rvisor
survive, migration is OK since it will transfer pfn_type to the target at n=
ext
iter and then prevent further harm at target. If guest/hypervisor crash it
definitely needn't care migration any more. Unfortunately we have no way to
predict it, so what we can do is to do the best to handle it, after all we
cannot forbid migration for fear that it may crash guest/hypervisor.

Patch version history:
V4:
  - adjust variables and patch description based on feedback
V3:
  - handle pages broken at the last iteration
V2:
  - migrate continue when broken page occur during migration,
    via marking broken page to dirty bitmap
V1:
  - migration abort when broken page occur during migration
  - transfer pfn_type to target for broken page occur before migration

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunl=
ap@eu.citrix.com>>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com<mailto:jinsong.liu@intel.=
com>>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunlap@e=
u.citrix.com>>

Technically, since you changed part of the code I acked, you should have re=
moved this ack.  But now I've read the patch:

Acked-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunlap@e=
u.citrix.com>>

Thanks Jinsong!



--_000_DE8DF0795D48FD4CA783C40EC82923353996FFSHSMSX101ccrcorpi_
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=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"GENERATOR" content=3D"MSHTML 8.00.6001.19328">
</head>
<body>
<div dir=3D"ltr" align=3D"left"><span class=3D"176143614-28112012"><font co=
lor=3D"#0000ff" size=3D"2" face=3D"Arial">Ping?</font></span></div>
<div dir=3D"ltr" align=3D"left"><span class=3D"176143614-28112012"><font co=
lor=3D"#0000ff" size=3D"2" face=3D"Arial"></font></span>&nbsp;</div>
<div dir=3D"ltr" align=3D"left"><span class=3D"176143614-28112012"><font co=
lor=3D"#0000ff" size=3D"2" face=3D"Arial">Thanks,</font></span></div>
<div dir=3D"ltr" align=3D"left"><span class=3D"176143614-28112012"><font co=
lor=3D"#0000ff" size=3D"2" face=3D"Arial">Jinsong</font></span></div>
<br>
<div dir=3D"ltr" lang=3D"en-us" class=3D"OutlookMessageHeader" align=3D"lef=
t">
<hr tabindex=3D"-1">
<font size=3D"2" face=3D"Tahoma"><b>From:</b> dunlapg@gmail.com [mailto:dun=
lapg@gmail.com]
<b>On Behalf Of </b>George Dunlap<br>
<b>Sent:</b> Saturday, November 24, 2012 12:26 AM<br>
<b>To:</b> Liu, Jinsong<br>
<b>Cc:</b> Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensourc=
e.com<br>
<b>Subject:</b> Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page wit=
h regard to migration<br>
</font><br>
</div>
<div></div>
On Fri, Nov 23, 2012 at 12:25 AM, Liu Jinsong <span dir=3D"ltr">&lt;<a href=
=3D"mailto:jinsong.liu@intel.com" target=3D"_blank">jinsong.liu@intel.com</=
a>&gt;</span> wrote:<br>
<div class=3D"gmail_extra">
<div class=3D"gmail_quote">
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
This patch handles broken page wrt migration. Generally there are below cas=
es:<br>
<div class=3D"im">1. broken page occurs before migration<br>
2. broken page occurs during migration<br>
</div>
&nbsp; 2.1 broken page occurs during migration but not at the last iteratio=
n<br>
&nbsp; 2.2 broken page occurs at the last iteration of migration<br>
<br>
For case 1, at the sender the broken page will be mapped but not copied<br>
<div class=3D"im">&nbsp; to target (otherwise it may trigger more serious e=
rror, say, SRAR error).<br>
&nbsp; While its pfn_type and pfn number will be transferred to target so t=
hat<br>
&nbsp; target take appropriate action.<br>
<br>
</div>
For case 2.1, at the sender mce handler marks the broken page to dirty<br>
&nbsp; bitmap, so that at next iteration, its pfn_type and pfn number will =
be<br>
&nbsp; transferred to the target and then take appropriate action.<br>
<br>
For case 2.2, at the sender it adds a check to see if vMCE occurs at the<br=
>
&nbsp; last iteration. If yes, it will do more iteration(s) so that the bro=
ken<br>
&nbsp; page's pfn_type and pfn number will be transferred to target.<br>
&nbsp; Another point is, if guest save to disk and during which vMCE occurs=
,<br>
&nbsp; it also need do more iteration(s).<br>
<br>
For all cases at the target (if migration not aborted by vMCE):<br>
&nbsp; Target will populates pages for guest. As for the case of broken pag=
e,<br>
&nbsp; we prefer to keep the type of the page for the sake of seamless migr=
ation.<br>
&nbsp; Target will set p2m as p2m_ram_broken for broken page. If guest acce=
ss<br>
<div class=3D"im">&nbsp; the broken page again it will kill itself as expec=
ted.<br>
<br>
</div>
All above description is based on the assumption that migration will succes=
s.<br>
However, for case 2 there are scenario that may result in guest or hypervis=
or<br>
crash. When pfn_type detecting fail to get p2m_ram_broken (vMCE occur after=
 the<br>
detecting) and read the broken page, guest/hypervisor may survive or crash,=
<br>
depending on error nature and how guest/hypervisor handle it. If guest/hype=
rvisor<br>
survive, migration is OK since it will transfer pfn_type to the target at n=
ext<br>
iter and then prevent further harm at target. If guest/hypervisor crash it<=
br>
definitely needn't care migration any more. Unfortunately we have no way to=
<br>
predict it, so what we can do is to do the best to handle it, after all we<=
br>
cannot forbid migration for fear that it may crash guest/hypervisor.<br>
<br>
Patch version history:<br>
V4:<br>
&nbsp; - adjust variables and patch description based on feedback<br>
V3:<br>
&nbsp; - handle pages broken at the last iteration<br>
V2:<br>
&nbsp; - migrate continue when broken page occur during migration,<br>
&nbsp; &nbsp; via marking broken page to dirty bitmap<br>
V1:<br>
&nbsp; - migration abort when broken page occur during migration<br>
&nbsp; - transfer pfn_type to target for broken page occur before migration=
<br>
<div class=3D"im"><br>
Suggested-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.c=
om">george.dunlap@eu.citrix.com</a>&gt;<br>
Signed-off-by: Liu Jinsong &lt;<a href=3D"mailto:jinsong.liu@intel.com">jin=
song.liu@intel.com</a>&gt;<br>
Acked-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">=
george.dunlap@eu.citrix.com</a>&gt;<br>
</div>
</blockquote>
<div><br>
Technically, since you changed part of the code I acked, you should have re=
moved this ack.&nbsp; But now I've read the patch:<br>
<br>
Acked-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">=
george.dunlap@eu.citrix.com</a>&gt;<br>
<br>
Thanks Jinsong! <br>
</div>
<br>
</div>
<br>
</div>
</body>
</html>

--_000_DE8DF0795D48FD4CA783C40EC82923353996FFSHSMSX101ccrcorpi_--


--===============5150255543628298859==
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.xen.org
http://lists.xen.org/xen-devel

--===============5150255543628298859==--


From xen-devel-bounces@lists.xen.org Wed Nov 28 14:37:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:37:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdilS-0005Fm-3U; Wed, 28 Nov 2012 14:37:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TdilQ-0005Fg-Hf
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 14:37:24 +0000
Received: from [85.158.143.35:14778] by server-2.bemta-4.messagelabs.com id
	80/56-28922-3A126B05; Wed, 28 Nov 2012 14:37:23 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354113442!15780471!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0ODA0OA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12481 invoked from network); 28 Nov 2012 14:37:22 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-6.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 14:37:22 -0000
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
	by fmsmga101.fm.intel.com with ESMTP; 28 Nov 2012 06:37:21 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,179,1355126400"; 
	d="scan'208,217";a="255928695"
Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37])
	by fmsmga002.fm.intel.com with ESMTP; 28 Nov 2012 06:37:21 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 28 Nov 2012 06:37:21 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Wed, 28 Nov 2012 22:37:19 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Campbell <ian.campbell@citrix.com>
Thread-Topic: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNyZdIH+TZqbearkyCq5DrDs2IGJf/WEBQ
Date: Wed, 28 Nov 2012 14:37:18 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353996FF@SHSMSX101.ccr.corp.intel.com>
References: <d3378692eece3e552ba2.1353630328@ljsromley.bj.intel.com>
	<CAFLBxZZ_W5PMLYiqEwdrpqkjgiMN9NoN2f33ErLriOwNOD9GgA@mail.gmail.com>
In-Reply-To: <CAFLBxZZ_W5PMLYiqEwdrpqkjgiMN9NoN2f33ErLriOwNOD9GgA@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5150255543628298859=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5150255543628298859==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_DE8DF0795D48FD4CA783C40EC82923353996FFSHSMSX101ccrcorpi_"

--_000_DE8DF0795D48FD4CA783C40EC82923353996FFSHSMSX101ccrcorpi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Ping?

Thanks,
Jinsong

________________________________
From: dunlapg@gmail.com [mailto:dunlapg@gmail.com] On Behalf Of George Dunl=
ap
Sent: Saturday, November 24, 2012 12:26 AM
To: Liu, Jinsong
Cc: Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regar=
d to migration

On Fri, Nov 23, 2012 at 12:25 AM, Liu Jinsong <jinsong.liu@intel.com<mailto=
:jinsong.liu@intel.com>> wrote:
This patch handles broken page wrt migration. Generally there are below cas=
es:
1. broken page occurs before migration
2. broken page occurs during migration
  2.1 broken page occurs during migration but not at the last iteration
  2.2 broken page occurs at the last iteration of migration

For case 1, at the sender the broken page will be mapped but not copied
  to target (otherwise it may trigger more serious error, say, SRAR error).
  While its pfn_type and pfn number will be transferred to target so that
  target take appropriate action.

For case 2.1, at the sender mce handler marks the broken page to dirty
  bitmap, so that at next iteration, its pfn_type and pfn number will be
  transferred to the target and then take appropriate action.

For case 2.2, at the sender it adds a check to see if vMCE occurs at the
  last iteration. If yes, it will do more iteration(s) so that the broken
  page's pfn_type and pfn number will be transferred to target.
  Another point is, if guest save to disk and during which vMCE occurs,
  it also need do more iteration(s).

For all cases at the target (if migration not aborted by vMCE):
  Target will populates pages for guest. As for the case of broken page,
  we prefer to keep the type of the page for the sake of seamless migration=
.
  Target will set p2m as p2m_ram_broken for broken page. If guest access
  the broken page again it will kill itself as expected.

All above description is based on the assumption that migration will succes=
s.
However, for case 2 there are scenario that may result in guest or hypervis=
or
crash. When pfn_type detecting fail to get p2m_ram_broken (vMCE occur after=
 the
detecting) and read the broken page, guest/hypervisor may survive or crash,
depending on error nature and how guest/hypervisor handle it. If guest/hype=
rvisor
survive, migration is OK since it will transfer pfn_type to the target at n=
ext
iter and then prevent further harm at target. If guest/hypervisor crash it
definitely needn't care migration any more. Unfortunately we have no way to
predict it, so what we can do is to do the best to handle it, after all we
cannot forbid migration for fear that it may crash guest/hypervisor.

Patch version history:
V4:
  - adjust variables and patch description based on feedback
V3:
  - handle pages broken at the last iteration
V2:
  - migrate continue when broken page occur during migration,
    via marking broken page to dirty bitmap
V1:
  - migration abort when broken page occur during migration
  - transfer pfn_type to target for broken page occur before migration

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunl=
ap@eu.citrix.com>>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com<mailto:jinsong.liu@intel.=
com>>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunlap@e=
u.citrix.com>>

Technically, since you changed part of the code I acked, you should have re=
moved this ack.  But now I've read the patch:

Acked-by: George Dunlap <george.dunlap@eu.citrix.com<mailto:george.dunlap@e=
u.citrix.com>>

Thanks Jinsong!



--_000_DE8DF0795D48FD4CA783C40EC82923353996FFSHSMSX101ccrcorpi_
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=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"GENERATOR" content=3D"MSHTML 8.00.6001.19328">
</head>
<body>
<div dir=3D"ltr" align=3D"left"><span class=3D"176143614-28112012"><font co=
lor=3D"#0000ff" size=3D"2" face=3D"Arial">Ping?</font></span></div>
<div dir=3D"ltr" align=3D"left"><span class=3D"176143614-28112012"><font co=
lor=3D"#0000ff" size=3D"2" face=3D"Arial"></font></span>&nbsp;</div>
<div dir=3D"ltr" align=3D"left"><span class=3D"176143614-28112012"><font co=
lor=3D"#0000ff" size=3D"2" face=3D"Arial">Thanks,</font></span></div>
<div dir=3D"ltr" align=3D"left"><span class=3D"176143614-28112012"><font co=
lor=3D"#0000ff" size=3D"2" face=3D"Arial">Jinsong</font></span></div>
<br>
<div dir=3D"ltr" lang=3D"en-us" class=3D"OutlookMessageHeader" align=3D"lef=
t">
<hr tabindex=3D"-1">
<font size=3D"2" face=3D"Tahoma"><b>From:</b> dunlapg@gmail.com [mailto:dun=
lapg@gmail.com]
<b>On Behalf Of </b>George Dunlap<br>
<b>Sent:</b> Saturday, November 24, 2012 12:26 AM<br>
<b>To:</b> Liu, Jinsong<br>
<b>Cc:</b> Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@lists.xensourc=
e.com<br>
<b>Subject:</b> Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page wit=
h regard to migration<br>
</font><br>
</div>
<div></div>
On Fri, Nov 23, 2012 at 12:25 AM, Liu Jinsong <span dir=3D"ltr">&lt;<a href=
=3D"mailto:jinsong.liu@intel.com" target=3D"_blank">jinsong.liu@intel.com</=
a>&gt;</span> wrote:<br>
<div class=3D"gmail_extra">
<div class=3D"gmail_quote">
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
This patch handles broken page wrt migration. Generally there are below cas=
es:<br>
<div class=3D"im">1. broken page occurs before migration<br>
2. broken page occurs during migration<br>
</div>
&nbsp; 2.1 broken page occurs during migration but not at the last iteratio=
n<br>
&nbsp; 2.2 broken page occurs at the last iteration of migration<br>
<br>
For case 1, at the sender the broken page will be mapped but not copied<br>
<div class=3D"im">&nbsp; to target (otherwise it may trigger more serious e=
rror, say, SRAR error).<br>
&nbsp; While its pfn_type and pfn number will be transferred to target so t=
hat<br>
&nbsp; target take appropriate action.<br>
<br>
</div>
For case 2.1, at the sender mce handler marks the broken page to dirty<br>
&nbsp; bitmap, so that at next iteration, its pfn_type and pfn number will =
be<br>
&nbsp; transferred to the target and then take appropriate action.<br>
<br>
For case 2.2, at the sender it adds a check to see if vMCE occurs at the<br=
>
&nbsp; last iteration. If yes, it will do more iteration(s) so that the bro=
ken<br>
&nbsp; page's pfn_type and pfn number will be transferred to target.<br>
&nbsp; Another point is, if guest save to disk and during which vMCE occurs=
,<br>
&nbsp; it also need do more iteration(s).<br>
<br>
For all cases at the target (if migration not aborted by vMCE):<br>
&nbsp; Target will populates pages for guest. As for the case of broken pag=
e,<br>
&nbsp; we prefer to keep the type of the page for the sake of seamless migr=
ation.<br>
&nbsp; Target will set p2m as p2m_ram_broken for broken page. If guest acce=
ss<br>
<div class=3D"im">&nbsp; the broken page again it will kill itself as expec=
ted.<br>
<br>
</div>
All above description is based on the assumption that migration will succes=
s.<br>
However, for case 2 there are scenario that may result in guest or hypervis=
or<br>
crash. When pfn_type detecting fail to get p2m_ram_broken (vMCE occur after=
 the<br>
detecting) and read the broken page, guest/hypervisor may survive or crash,=
<br>
depending on error nature and how guest/hypervisor handle it. If guest/hype=
rvisor<br>
survive, migration is OK since it will transfer pfn_type to the target at n=
ext<br>
iter and then prevent further harm at target. If guest/hypervisor crash it<=
br>
definitely needn't care migration any more. Unfortunately we have no way to=
<br>
predict it, so what we can do is to do the best to handle it, after all we<=
br>
cannot forbid migration for fear that it may crash guest/hypervisor.<br>
<br>
Patch version history:<br>
V4:<br>
&nbsp; - adjust variables and patch description based on feedback<br>
V3:<br>
&nbsp; - handle pages broken at the last iteration<br>
V2:<br>
&nbsp; - migrate continue when broken page occur during migration,<br>
&nbsp; &nbsp; via marking broken page to dirty bitmap<br>
V1:<br>
&nbsp; - migration abort when broken page occur during migration<br>
&nbsp; - transfer pfn_type to target for broken page occur before migration=
<br>
<div class=3D"im"><br>
Suggested-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.c=
om">george.dunlap@eu.citrix.com</a>&gt;<br>
Signed-off-by: Liu Jinsong &lt;<a href=3D"mailto:jinsong.liu@intel.com">jin=
song.liu@intel.com</a>&gt;<br>
Acked-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">=
george.dunlap@eu.citrix.com</a>&gt;<br>
</div>
</blockquote>
<div><br>
Technically, since you changed part of the code I acked, you should have re=
moved this ack.&nbsp; But now I've read the patch:<br>
<br>
Acked-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">=
george.dunlap@eu.citrix.com</a>&gt;<br>
<br>
Thanks Jinsong! <br>
</div>
<br>
</div>
<br>
</div>
</body>
</html>

--_000_DE8DF0795D48FD4CA783C40EC82923353996FFSHSMSX101ccrcorpi_--


--===============5150255543628298859==
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.xen.org
http://lists.xen.org/xen-devel

--===============5150255543628298859==--


From xen-devel-bounces@lists.xen.org Wed Nov 28 14:42:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:42:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdiq7-0005SX-17; Wed, 28 Nov 2012 14:42:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Tdiq5-0005SR-Pq
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 14:42:14 +0000
Received: from [85.158.138.51:6675] by server-1.bemta-3.messagelabs.com id
	A4/DF-12169-4C226B05; Wed, 28 Nov 2012 14:42:12 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1354113719!27812601!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20346 invoked from network); 28 Nov 2012 14:42:00 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:42:00 -0000
X-IronPort-AV: E=Sophos;i="4.84,179,1355097600"; d="scan'208";a="16049351"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 14:41:59 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 14:41:57 +0000
Message-ID: <50B622B4.6010103@citrix.com>
Date: Wed, 28 Nov 2012 15:41:56 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Thor Lancelot Simon <tls@panix.com>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com>
In-Reply-To: <20121128132634.GA18277@panix.com>
Cc: "port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/12 14:26, Thor Lancelot Simon wrote:
> On Wed, Nov 28, 2012 at 02:20:51PM +0100, Roger Pau Monne wrote:
>> This forces libxl to use Qemu when a raw image file is used as a disk
>> backend. NetBSD currently only supports qemu-traditional, so
> 
> Wait -- do I grasp correctly that this patch _forces_ NetBSD as a dom0
> to handle file-backed I/O requests in a way that includes additional
> context switches to userspace, and which your previous email said
> resulted in a 30% reduction in throughput compared to dom0 I/O?
> 
> I am assuming there's some reason we want this, rather than handling
> such requests in-kernel.  But what is it?

I should have marked this as "experimental", or something like this. I'm
not sure if switching to Qdisk for all image file backends is needed.
>From the Xen wiki (http://wiki.xen.org/wiki/Blktap) I've found that:

"loop device had problems with flushing dirty pages (specifically, doing
a large number of writes to an NFS-backed image don't result in the OOM
killer going berserk)."

I'm not sure if NetBSD is in the same situation, but if I remember
correctly (haven't tried that in a long time), trying to use a disk file
on a NFS share caused the NetBSD Dom0 kernel to crash. The PR for this
issue is: http://gnats.netbsd.org/40726.

If this is solved, and the vnd device is solid in NetBSD we could only
use Qdisk when the image format is different than raw (qcow, qcow2,
vmdk, vdi...).

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:42:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:42:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdiq7-0005SX-17; Wed, 28 Nov 2012 14:42:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Tdiq5-0005SR-Pq
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 14:42:14 +0000
Received: from [85.158.138.51:6675] by server-1.bemta-3.messagelabs.com id
	A4/DF-12169-4C226B05; Wed, 28 Nov 2012 14:42:12 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1354113719!27812601!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20346 invoked from network); 28 Nov 2012 14:42:00 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:42:00 -0000
X-IronPort-AV: E=Sophos;i="4.84,179,1355097600"; d="scan'208";a="16049351"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 14:41:59 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 14:41:57 +0000
Message-ID: <50B622B4.6010103@citrix.com>
Date: Wed, 28 Nov 2012 15:41:56 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Thor Lancelot Simon <tls@panix.com>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com>
In-Reply-To: <20121128132634.GA18277@panix.com>
Cc: "port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/12 14:26, Thor Lancelot Simon wrote:
> On Wed, Nov 28, 2012 at 02:20:51PM +0100, Roger Pau Monne wrote:
>> This forces libxl to use Qemu when a raw image file is used as a disk
>> backend. NetBSD currently only supports qemu-traditional, so
> 
> Wait -- do I grasp correctly that this patch _forces_ NetBSD as a dom0
> to handle file-backed I/O requests in a way that includes additional
> context switches to userspace, and which your previous email said
> resulted in a 30% reduction in throughput compared to dom0 I/O?
> 
> I am assuming there's some reason we want this, rather than handling
> such requests in-kernel.  But what is it?

I should have marked this as "experimental", or something like this. I'm
not sure if switching to Qdisk for all image file backends is needed.
>From the Xen wiki (http://wiki.xen.org/wiki/Blktap) I've found that:

"loop device had problems with flushing dirty pages (specifically, doing
a large number of writes to an NFS-backed image don't result in the OOM
killer going berserk)."

I'm not sure if NetBSD is in the same situation, but if I remember
correctly (haven't tried that in a long time), trying to use a disk file
on a NFS share caused the NetBSD Dom0 kernel to crash. The PR for this
issue is: http://gnats.netbsd.org/40726.

If this is solved, and the vnd device is solid in NetBSD we could only
use Qdisk when the image format is different than raw (qcow, qcow2,
vmdk, vdi...).

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:44:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:44:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdisI-0005ZZ-IH; Wed, 28 Nov 2012 14:44:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TdisG-0005ZS-UL
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 14:44:29 +0000
Received: from [85.158.143.99:27522] by server-2.bemta-4.messagelabs.com id
	D5/30-28922-C4326B05; Wed, 28 Nov 2012 14:44:28 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1354113866!31760825!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODE1MjA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6241 invoked from network); 28 Nov 2012 14:44:27 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 14:44:27 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASEiLlk030023
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 14:44:22 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASEiLxF011621
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 14:44:21 GMT
Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASEiK88011049; Wed, 28 Nov 2012 08:44:20 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 28 Nov 2012 06:44:20 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id A03EFE00966; Wed, 28 Nov 2012 09:44:16 -0500 (EST)
Date: Wed, 28 Nov 2012 09:44:16 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121128144416.GD21266@phenom.dumpdata.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211281150380.5310@kaball.uk.xensource.com>
	<20121128142521.GB21266@phenom.dumpdata.com>
	<1354113142.25834.34.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354113142.25834.34.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: xen-devel <xen-devel@lists.xen.org>, Jan Beulich <JBeulich@suse.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 02:32:22PM +0000, Ian Campbell wrote:
> On Wed, 2012-11-28 at 14:25 +0000, Konrad Rzeszutek Wilk wrote:
> > On Wed, Nov 28, 2012 at 11:50:54AM +0000, Stefano Stabellini wrote:
> > > On Wed, 28 Nov 2012, Jan Beulich wrote:
> > > > >>> On 27.11.12 at 22:31, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > > > > Mukesh Rathor (6):
> > > > >       xen/pvh: Support ParaVirtualized Hardware extensions.
> > > > >       xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
> > > > >       xen/pvh: Implement MMU changes for PVH.
> > > > >       xen/pvh: bootup and setup (E820) related changes.
> > > > >       xen/pvh: balloon and grant changes.
> > > > >       xen/pvh: /dev/xen/privcmd changes.
> > > > 
> > > > As said before - I don't think it is a good idea to push the kernel side
> > > > changes into an official release when the hypervisor side ones didn't
> > > > even get an initial review yet.
> > > 
> > > I agree
> > 
> > That would delay the ARM patches that Ian posted as they are dependent on this.
> 
> I'd be happy to produce a series with the generic bits from the pvh
> series which are required by the ARM stuff (the privcmd and balloon bits
> mainly) and base the arm stuff on that. I think I offered to do this
> before.

OK. The stable/pvh.v6 has yours and Mukesh's patches. If you want to
rebase them on stable/for-linus-3.8 (and if you need to pull in
v3.7-rc4,5,6,7 in it) I am game.

> 
> Ian.
> 
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:44:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:44:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdisI-0005ZZ-IH; Wed, 28 Nov 2012 14:44:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TdisG-0005ZS-UL
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 14:44:29 +0000
Received: from [85.158.143.99:27522] by server-2.bemta-4.messagelabs.com id
	D5/30-28922-C4326B05; Wed, 28 Nov 2012 14:44:28 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1354113866!31760825!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODE1MjA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6241 invoked from network); 28 Nov 2012 14:44:27 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 14:44:27 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASEiLlk030023
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 14:44:22 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASEiLxF011621
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 14:44:21 GMT
Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASEiK88011049; Wed, 28 Nov 2012 08:44:20 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 28 Nov 2012 06:44:20 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id A03EFE00966; Wed, 28 Nov 2012 09:44:16 -0500 (EST)
Date: Wed, 28 Nov 2012 09:44:16 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121128144416.GD21266@phenom.dumpdata.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211281150380.5310@kaball.uk.xensource.com>
	<20121128142521.GB21266@phenom.dumpdata.com>
	<1354113142.25834.34.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354113142.25834.34.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: xen-devel <xen-devel@lists.xen.org>, Jan Beulich <JBeulich@suse.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 02:32:22PM +0000, Ian Campbell wrote:
> On Wed, 2012-11-28 at 14:25 +0000, Konrad Rzeszutek Wilk wrote:
> > On Wed, Nov 28, 2012 at 11:50:54AM +0000, Stefano Stabellini wrote:
> > > On Wed, 28 Nov 2012, Jan Beulich wrote:
> > > > >>> On 27.11.12 at 22:31, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > > > > Mukesh Rathor (6):
> > > > >       xen/pvh: Support ParaVirtualized Hardware extensions.
> > > > >       xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
> > > > >       xen/pvh: Implement MMU changes for PVH.
> > > > >       xen/pvh: bootup and setup (E820) related changes.
> > > > >       xen/pvh: balloon and grant changes.
> > > > >       xen/pvh: /dev/xen/privcmd changes.
> > > > 
> > > > As said before - I don't think it is a good idea to push the kernel side
> > > > changes into an official release when the hypervisor side ones didn't
> > > > even get an initial review yet.
> > > 
> > > I agree
> > 
> > That would delay the ARM patches that Ian posted as they are dependent on this.
> 
> I'd be happy to produce a series with the generic bits from the pvh
> series which are required by the ARM stuff (the privcmd and balloon bits
> mainly) and base the arm stuff on that. I think I offered to do this
> before.

OK. The stable/pvh.v6 has yours and Mukesh's patches. If you want to
rebase them on stable/for-linus-3.8 (and if you need to pull in
v3.7-rc4,5,6,7 in it) I am game.

> 
> Ian.
> 
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:49:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:49:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdiwa-0005jb-8u; Wed, 28 Nov 2012 14:48:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <emdel@playhack.net>) id 1TdiwY-0005jV-Ps
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 14:48:55 +0000
Received: from [85.158.139.83:29243] by server-11.bemta-5.messagelabs.com id
	47/24-03409-65426B05; Wed, 28 Nov 2012 14:48:54 +0000
X-Env-Sender: emdel@playhack.net
X-Msg-Ref: server-14.tower-182.messagelabs.com!1354114132!23208796!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_10_20,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5946 invoked from network); 28 Nov 2012 14:48:53 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:48:53 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl17so7001967vcb.32
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 06:48:51 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:x-originating-ip:date:message-id:subject:from:to
	:content-type:x-gm-message-state;
	bh=WtetCWHFf+yG+t+2FOgZJ1KHSRXBcSCqDpQwlaOfAic=;
	b=IN+IQtkoDZYnsPra/csEqqIMfK2QzA752Mo/gHjJ9VptdzOBz0slGReajOpZ30PV2n
	9fYNuTLhun13XdBrh43zy5ISlfxWNnw7abFOlJhygLQ1rzGTKvIi17+lPosPfQXpu/gX
	P2f2mzP9hzvcn4kBiPF4h47b+Rn/H11TpXF+x0/K+YTLTQKtKBWd29OUtAC11h/gWKsF
	saV/w9V+kZYFC1g1OscdvXTlmQ0TcX3+nM6a1md6tjl7fQQzPz9xA3H9k6ibp9hhXLQr
	eDzSC452rzSFyScR+vyH9Ugld2SS+f/OdN//Lza8SFmM/x5mhNu/FOkdoFSx42S/295G
	Bt4A==
MIME-Version: 1.0
Received: by 10.52.91.73 with SMTP id cc9mr16286026vdb.48.1354114131790; Wed,
	28 Nov 2012 06:48:51 -0800 (PST)
Received: by 10.220.27.70 with HTTP; Wed, 28 Nov 2012 06:48:51 -0800 (PST)
X-Originating-IP: [80.13.75.21]
Date: Wed, 28 Nov 2012 15:48:51 +0100
Message-ID: <CALKiAsHQaAC0JcP1zqkhENicCf2o-jsBUiBopyhuhvBUv__D+w@mail.gmail.com>
From: emdel <emdel@playhack.net>
To: xen-devel@lists.xen.org
X-Gm-Message-State: ALoCoQm7t0uoVqbSlrY60ttSAh+/XYQAW/QaA5pqaId1lMCXQKuuCz8P8DyTeNDTbZdSHB2pmYQJ
Subject: [Xen-devel] CR3 Virtual Address
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0492361303964332243=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0492361303964332243==
Content-Type: multipart/alternative; boundary=20cf307f3338cf8a8604cf8f43d4

--20cf307f3338cf8a8604cf8f43d4
Content-Type: text/plain; charset=ISO-8859-1

Hello everybody,

I have to work with the Xen 4.2 memory management code for a research
project and I have some questions.

1) Since I have to change and/or remove some entries in the hypervisor
   page table, I would like to know the "virtual address" of the CR3
   register.

2) I would also like to know if the VMCS virtual address is mapped inside
the
   page table pointed by the HOST_CR3.

3) Are there functions to perform the page walking on the hypervisor
   page tables?


Thank you for the attention,


Best Regards.

--20cf307f3338cf8a8604cf8f43d4
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello everybody,<br><br>I have to work with the Xen 4.2 memory management c=
ode for a research<br>project and I have some questions.<br><br>1) Since I =
have to change and/or remove some entries in the hypervisor<br>=A0=A0 page =
table, I would like to know the &quot;virtual address&quot; of the CR3 <br>
=A0=A0 register.<br><br>2) I would also like to know if the VMCS virtual ad=
dress is mapped inside the <br>=A0=A0 page table pointed by the HOST_CR3.<b=
r><br>3) Are there functions to perform the page walking on the hypervisor =
<br>
=A0=A0 page tables?<br><br><br>Thank you for the attention,<br><br><br>Best=
 Regards.<br>

--20cf307f3338cf8a8604cf8f43d4--


--===============0492361303964332243==
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.xen.org
http://lists.xen.org/xen-devel

--===============0492361303964332243==--


From xen-devel-bounces@lists.xen.org Wed Nov 28 14:49:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:49:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdiwa-0005jb-8u; Wed, 28 Nov 2012 14:48:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <emdel@playhack.net>) id 1TdiwY-0005jV-Ps
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 14:48:55 +0000
Received: from [85.158.139.83:29243] by server-11.bemta-5.messagelabs.com id
	47/24-03409-65426B05; Wed, 28 Nov 2012 14:48:54 +0000
X-Env-Sender: emdel@playhack.net
X-Msg-Ref: server-14.tower-182.messagelabs.com!1354114132!23208796!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_10_20,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5946 invoked from network); 28 Nov 2012 14:48:53 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:48:53 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl17so7001967vcb.32
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 06:48:51 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:x-originating-ip:date:message-id:subject:from:to
	:content-type:x-gm-message-state;
	bh=WtetCWHFf+yG+t+2FOgZJ1KHSRXBcSCqDpQwlaOfAic=;
	b=IN+IQtkoDZYnsPra/csEqqIMfK2QzA752Mo/gHjJ9VptdzOBz0slGReajOpZ30PV2n
	9fYNuTLhun13XdBrh43zy5ISlfxWNnw7abFOlJhygLQ1rzGTKvIi17+lPosPfQXpu/gX
	P2f2mzP9hzvcn4kBiPF4h47b+Rn/H11TpXF+x0/K+YTLTQKtKBWd29OUtAC11h/gWKsF
	saV/w9V+kZYFC1g1OscdvXTlmQ0TcX3+nM6a1md6tjl7fQQzPz9xA3H9k6ibp9hhXLQr
	eDzSC452rzSFyScR+vyH9Ugld2SS+f/OdN//Lza8SFmM/x5mhNu/FOkdoFSx42S/295G
	Bt4A==
MIME-Version: 1.0
Received: by 10.52.91.73 with SMTP id cc9mr16286026vdb.48.1354114131790; Wed,
	28 Nov 2012 06:48:51 -0800 (PST)
Received: by 10.220.27.70 with HTTP; Wed, 28 Nov 2012 06:48:51 -0800 (PST)
X-Originating-IP: [80.13.75.21]
Date: Wed, 28 Nov 2012 15:48:51 +0100
Message-ID: <CALKiAsHQaAC0JcP1zqkhENicCf2o-jsBUiBopyhuhvBUv__D+w@mail.gmail.com>
From: emdel <emdel@playhack.net>
To: xen-devel@lists.xen.org
X-Gm-Message-State: ALoCoQm7t0uoVqbSlrY60ttSAh+/XYQAW/QaA5pqaId1lMCXQKuuCz8P8DyTeNDTbZdSHB2pmYQJ
Subject: [Xen-devel] CR3 Virtual Address
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0492361303964332243=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0492361303964332243==
Content-Type: multipart/alternative; boundary=20cf307f3338cf8a8604cf8f43d4

--20cf307f3338cf8a8604cf8f43d4
Content-Type: text/plain; charset=ISO-8859-1

Hello everybody,

I have to work with the Xen 4.2 memory management code for a research
project and I have some questions.

1) Since I have to change and/or remove some entries in the hypervisor
   page table, I would like to know the "virtual address" of the CR3
   register.

2) I would also like to know if the VMCS virtual address is mapped inside
the
   page table pointed by the HOST_CR3.

3) Are there functions to perform the page walking on the hypervisor
   page tables?


Thank you for the attention,


Best Regards.

--20cf307f3338cf8a8604cf8f43d4
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello everybody,<br><br>I have to work with the Xen 4.2 memory management c=
ode for a research<br>project and I have some questions.<br><br>1) Since I =
have to change and/or remove some entries in the hypervisor<br>=A0=A0 page =
table, I would like to know the &quot;virtual address&quot; of the CR3 <br>
=A0=A0 register.<br><br>2) I would also like to know if the VMCS virtual ad=
dress is mapped inside the <br>=A0=A0 page table pointed by the HOST_CR3.<b=
r><br>3) Are there functions to perform the page walking on the hypervisor =
<br>
=A0=A0 page tables?<br><br><br>Thank you for the attention,<br><br><br>Best=
 Regards.<br>

--20cf307f3338cf8a8604cf8f43d4--


--===============0492361303964332243==
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.xen.org
http://lists.xen.org/xen-devel

--===============0492361303964332243==--


From xen-devel-bounces@lists.xen.org Wed Nov 28 14:56:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:56:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdj3u-0005xA-A9; Wed, 28 Nov 2012 14:56:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Tdj3s-0005x4-Ls
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 14:56:28 +0000
Received: from [85.158.137.99:50241] by server-9.bemta-3.messagelabs.com id
	11/D9-02388-B1626B05; Wed, 28 Nov 2012 14:56:27 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1354114585!12232421!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUxMDI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32624 invoked from network); 28 Nov 2012 14:56:26 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:56:26 -0000
X-IronPort-AV: E=Sophos;i="4.84,179,1355097600"; d="scan'208";a="45889657"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 14:56:21 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 09:56:21 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Tdj3k-0004lp-L4;
	Wed, 28 Nov 2012 14:56:20 +0000
Message-ID: <50B62614.1060801@citrix.com>
Date: Wed, 28 Nov 2012 14:56:20 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: xen-devel@lists.xen.org, emdel@playhack.net
References: <CALKiAsHQaAC0JcP1zqkhENicCf2o-jsBUiBopyhuhvBUv__D+w@mail.gmail.com>
In-Reply-To: <CALKiAsHQaAC0JcP1zqkhENicCf2o-jsBUiBopyhuhvBUv__D+w@mail.gmail.com>
X-Enigmail-Version: 1.4.6
Subject: Re: [Xen-devel] CR3 Virtual Address
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/12 14:48, emdel wrote:
> Hello everybody,
>
> I have to work with the Xen 4.2 memory management code for a research
> project and I have some questions.
>
> 1) Since I have to change and/or remove some entries in the hypervisor
>    page table, I would like to know the "virtual address" of the CR3
>    register.

CR3 is a register, not memory mapped.  Do you mean the virtual address
of the top level pagetable?  That will depend on which mode you are
running in, and which CR3 you are actually looking for.

>
> 2) I would also like to know if the VMCS virtual address is mapped
> inside the
>    page table pointed by the HOST_CR3.

The host cr3 is the set of pagetables to use when a VMEXIT happens.  The
VCMS of the HVM guest in question will be mapped into this address space.

>
> 3) Are there functions to perform the page walking on the hypervisor
>    page tables?

There are generic page walk functions, which can be used to walk the
hypervisor tables.  Why do you want to do this?

~Andrew

>
>
> Thank you for the attention,
>
>
> Best Regards.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 14:56:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 14:56:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdj3u-0005xA-A9; Wed, 28 Nov 2012 14:56:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1Tdj3s-0005x4-Ls
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 14:56:28 +0000
Received: from [85.158.137.99:50241] by server-9.bemta-3.messagelabs.com id
	11/D9-02388-B1626B05; Wed, 28 Nov 2012 14:56:27 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1354114585!12232421!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODUxMDI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32624 invoked from network); 28 Nov 2012 14:56:26 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 14:56:26 -0000
X-IronPort-AV: E=Sophos;i="4.84,179,1355097600"; d="scan'208";a="45889657"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 14:56:21 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 09:56:21 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1Tdj3k-0004lp-L4;
	Wed, 28 Nov 2012 14:56:20 +0000
Message-ID: <50B62614.1060801@citrix.com>
Date: Wed, 28 Nov 2012 14:56:20 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: xen-devel@lists.xen.org, emdel@playhack.net
References: <CALKiAsHQaAC0JcP1zqkhENicCf2o-jsBUiBopyhuhvBUv__D+w@mail.gmail.com>
In-Reply-To: <CALKiAsHQaAC0JcP1zqkhENicCf2o-jsBUiBopyhuhvBUv__D+w@mail.gmail.com>
X-Enigmail-Version: 1.4.6
Subject: Re: [Xen-devel] CR3 Virtual Address
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/12 14:48, emdel wrote:
> Hello everybody,
>
> I have to work with the Xen 4.2 memory management code for a research
> project and I have some questions.
>
> 1) Since I have to change and/or remove some entries in the hypervisor
>    page table, I would like to know the "virtual address" of the CR3
>    register.

CR3 is a register, not memory mapped.  Do you mean the virtual address
of the top level pagetable?  That will depend on which mode you are
running in, and which CR3 you are actually looking for.

>
> 2) I would also like to know if the VMCS virtual address is mapped
> inside the
>    page table pointed by the HOST_CR3.

The host cr3 is the set of pagetables to use when a VMEXIT happens.  The
VCMS of the HVM guest in question will be mapped into this address space.

>
> 3) Are there functions to perform the page walking on the hypervisor
>    page tables?

There are generic page walk functions, which can be used to walk the
hypervisor tables.  Why do you want to do this?

~Andrew

>
>
> Thank you for the attention,
>
>
> Best Regards.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 15:06:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:06:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdjDI-0006AG-D7; Wed, 28 Nov 2012 15:06:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TdjDG-0006AB-SS
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:06:11 +0000
Received: from [85.158.139.211:24242] by server-5.bemta-5.messagelabs.com id
	5C/D8-11353-26826B05; Wed, 28 Nov 2012 15:06:10 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354115168!17783234!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2989 invoked from network); 28 Nov 2012 15:06:09 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 15:06:09 -0000
X-IronPort-AV: E=Sophos;i="4.84,179,1355097600"; d="scan'208";a="215743777"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	28 Nov 2012 15:06:01 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Wed, 28 Nov 2012 10:06:00 -0500
Message-ID: <50B62858.8040302@citrix.com>
Date: Wed, 28 Nov 2012 15:06:00 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <CALKiAsHQaAC0JcP1zqkhENicCf2o-jsBUiBopyhuhvBUv__D+w@mail.gmail.com>
In-Reply-To: <CALKiAsHQaAC0JcP1zqkhENicCf2o-jsBUiBopyhuhvBUv__D+w@mail.gmail.com>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] CR3 Virtual Address
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/12 14:48, emdel wrote:
> Hello everybody,
>
> I have to work with the Xen 4.2 memory management code for a research
> project and I have some questions.
>
> 1) Since I have to change and/or remove some entries in the hypervisor
>    page table, I would like to know the "virtual address" of the CR3
>    register.
As per Andy Cooper's answer, but further:
Exactly (or at least roughly) what are you trying to achieve?
You want to "remove" some memory from the hypervisor itself? Who/what 
will use this memory?
It is MUCH easier to advice on HOW to do something if we understand what 
you are actually trying to do.
>
> 2) I would also like to know if the VMCS virtual address is mapped 
> inside the
>    page table pointed by the HOST_CR3.
The "HOST_CR3" is the Xen (VCPU's) true CR3 (for the "host" or "root" 
mode, as Intel calls it - this is the hypervisor itself). it is set from 
vcpu.arch.cr3. So the VMCS is available here, or the system would crash 
when it returns from guest operation.
>
> 3) Are there functions to perform the page walking on the hypervisor
>    page tables?
Yes. As per Andy Cooper's answer.

--
Mats
>
>
> Thank you for the attention,
>
>
> Best Regards.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 15:06:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:06:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdjDI-0006AG-D7; Wed, 28 Nov 2012 15:06:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TdjDG-0006AB-SS
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:06:11 +0000
Received: from [85.158.139.211:24242] by server-5.bemta-5.messagelabs.com id
	5C/D8-11353-26826B05; Wed, 28 Nov 2012 15:06:10 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354115168!17783234!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc1MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2989 invoked from network); 28 Nov 2012 15:06:09 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 15:06:09 -0000
X-IronPort-AV: E=Sophos;i="4.84,179,1355097600"; d="scan'208";a="215743777"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	28 Nov 2012 15:06:01 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Wed, 28 Nov 2012 10:06:00 -0500
Message-ID: <50B62858.8040302@citrix.com>
Date: Wed, 28 Nov 2012 15:06:00 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <CALKiAsHQaAC0JcP1zqkhENicCf2o-jsBUiBopyhuhvBUv__D+w@mail.gmail.com>
In-Reply-To: <CALKiAsHQaAC0JcP1zqkhENicCf2o-jsBUiBopyhuhvBUv__D+w@mail.gmail.com>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] CR3 Virtual Address
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/12 14:48, emdel wrote:
> Hello everybody,
>
> I have to work with the Xen 4.2 memory management code for a research
> project and I have some questions.
>
> 1) Since I have to change and/or remove some entries in the hypervisor
>    page table, I would like to know the "virtual address" of the CR3
>    register.
As per Andy Cooper's answer, but further:
Exactly (or at least roughly) what are you trying to achieve?
You want to "remove" some memory from the hypervisor itself? Who/what 
will use this memory?
It is MUCH easier to advice on HOW to do something if we understand what 
you are actually trying to do.
>
> 2) I would also like to know if the VMCS virtual address is mapped 
> inside the
>    page table pointed by the HOST_CR3.
The "HOST_CR3" is the Xen (VCPU's) true CR3 (for the "host" or "root" 
mode, as Intel calls it - this is the hypervisor itself). it is set from 
vcpu.arch.cr3. So the VMCS is available here, or the system would crash 
when it returns from guest operation.
>
> 3) Are there functions to perform the page walking on the hypervisor
>    page tables?
Yes. As per Andy Cooper's answer.

--
Mats
>
>
> Thank you for the attention,
>
>
> Best Regards.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 15:11:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:11:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdjIM-0006JT-6B; Wed, 28 Nov 2012 15:11:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TdjIJ-0006JM-Qi
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 15:11:24 +0000
Received: from [85.158.143.99:50571] by server-1.bemta-4.messagelabs.com id
	DB/35-27934-B9926B05; Wed, 28 Nov 2012 15:11:23 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-4.tower-216.messagelabs.com!1354115481!26458431!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDYzMDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12972 invoked from network); 28 Nov 2012 15:11:22 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-4.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 15:11:22 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id BFBE51445;
	Wed, 28 Nov 2012 17:11:19 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 7F70CEC027; Wed, 28 Nov 2012 17:11:19 +0200 (EET)
Date: Wed, 28 Nov 2012 17:11:19 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: George Dunlap <george.dunlap@eu.citrix.com>
Message-ID: <20121128151119.GC8912@reaktio.net>
References: <patchbomb.1354104964@elijah>
	<e87d8fad28e00090591b.1354104966@elijah>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <e87d8fad28e00090591b.1354104966@elijah>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH 2 of 2] xl: Accept a list for usbdevice in
 config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 12:16:06PM +0000, George Dunlap wrote:
> # HG changeset patch
> # User George Dunlap <george.dunlap@eu.citrix.com>
> # Date 1354104851 0
> # Node ID e87d8fad28e00090591b65b2682dea9112f8830d
> # Parent  538d9ffbd71b41e8cf6d7da0ded9e0a0b07f3c0d
> xl: Accept a list for usbdevice in config file
> 
> Allow the "usbdevice" key to accept a list of USB devices, and pass
> them in using the new usbdevice_list domain build element.
> 
> For backwards compatibility, still accept singleton values.
> 
> Also update the xl.cfg manpage, adding information about how to pass
> through host devices.
> 
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
> 
> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
> --- a/docs/man/xl.cfg.pod.5
> +++ b/docs/man/xl.cfg.pod.5
> @@ -1103,15 +1103,22 @@ device.
>  
>  Enables or disables a USB bus in the guest.
>

Should we add "HVM" there ?

  
> -=item B<usbdevice=DEVICE>
> +=item B<usbdevice=[ "DEVICE", "DEVICE", ...]>
>  
> -Adds B<DEVICE> to the USB bus. The USB bus must also be enabled using
> -B<usb=1>. The most common use for this option is B<usbdevice=tablet>
> -which adds pointer device using absolute coordinates. Such devices
> -function better than relative coordinate devices (such as a standard
> -mouse) since many methods of exporting guest graphics (such as VNC)
> -work better in this mode. Note that this is independent of the actual
> -pointer device you are using on the host/client side.
> +Adds B<DEVICE>s to the emulated USB bus. The USB bus must also be
> +enabled using B<usb=1>. The most common use for this option is
> +B<usbdevice=['tablet']> which adds pointer device using absolute
> +coordinates. Such devices function better than relative coordinate
> +devices (such as a standard mouse) since many methods of exporting
> +guest graphics (such as VNC) work better in this mode. Note that this
> +is independent of the actual pointer device you are using on the
> +host/client side.
> +
> +Host devices can also be passed through in this way, by specifying
> +host:USBID, where USBID is of the form xxxx:yyyy.  The USBID can 
> +typically be found by using lsusb or usb-devices.
> +
> +The form usbdevice=DEVICE is also accepted for backwards compatibility.
>  

Should we mention the difference between qemu-traditional and qemu-upstream here?

qemu-traditional only supports USB 1.1 devices, while qemu-upstream offers USB 2.0 (and 3.0) emulation.
Is there currently a way to control to which virtual usb controller the host device gets added to?

See here for help how to configure that with qemu/kvm:
http://www.linux-kvm.com/content/qemu-kvm-11-adds-experimental-support-usb-30

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 15:11:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:11:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdjIM-0006JT-6B; Wed, 28 Nov 2012 15:11:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TdjIJ-0006JM-Qi
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 15:11:24 +0000
Received: from [85.158.143.99:50571] by server-1.bemta-4.messagelabs.com id
	DB/35-27934-B9926B05; Wed, 28 Nov 2012 15:11:23 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-4.tower-216.messagelabs.com!1354115481!26458431!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDYzMDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12972 invoked from network); 28 Nov 2012 15:11:22 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-4.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 15:11:22 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id BFBE51445;
	Wed, 28 Nov 2012 17:11:19 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 7F70CEC027; Wed, 28 Nov 2012 17:11:19 +0200 (EET)
Date: Wed, 28 Nov 2012 17:11:19 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: George Dunlap <george.dunlap@eu.citrix.com>
Message-ID: <20121128151119.GC8912@reaktio.net>
References: <patchbomb.1354104964@elijah>
	<e87d8fad28e00090591b.1354104966@elijah>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <e87d8fad28e00090591b.1354104966@elijah>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH 2 of 2] xl: Accept a list for usbdevice in
 config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 12:16:06PM +0000, George Dunlap wrote:
> # HG changeset patch
> # User George Dunlap <george.dunlap@eu.citrix.com>
> # Date 1354104851 0
> # Node ID e87d8fad28e00090591b65b2682dea9112f8830d
> # Parent  538d9ffbd71b41e8cf6d7da0ded9e0a0b07f3c0d
> xl: Accept a list for usbdevice in config file
> 
> Allow the "usbdevice" key to accept a list of USB devices, and pass
> them in using the new usbdevice_list domain build element.
> 
> For backwards compatibility, still accept singleton values.
> 
> Also update the xl.cfg manpage, adding information about how to pass
> through host devices.
> 
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
> 
> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
> --- a/docs/man/xl.cfg.pod.5
> +++ b/docs/man/xl.cfg.pod.5
> @@ -1103,15 +1103,22 @@ device.
>  
>  Enables or disables a USB bus in the guest.
>

Should we add "HVM" there ?

  
> -=item B<usbdevice=DEVICE>
> +=item B<usbdevice=[ "DEVICE", "DEVICE", ...]>
>  
> -Adds B<DEVICE> to the USB bus. The USB bus must also be enabled using
> -B<usb=1>. The most common use for this option is B<usbdevice=tablet>
> -which adds pointer device using absolute coordinates. Such devices
> -function better than relative coordinate devices (such as a standard
> -mouse) since many methods of exporting guest graphics (such as VNC)
> -work better in this mode. Note that this is independent of the actual
> -pointer device you are using on the host/client side.
> +Adds B<DEVICE>s to the emulated USB bus. The USB bus must also be
> +enabled using B<usb=1>. The most common use for this option is
> +B<usbdevice=['tablet']> which adds pointer device using absolute
> +coordinates. Such devices function better than relative coordinate
> +devices (such as a standard mouse) since many methods of exporting
> +guest graphics (such as VNC) work better in this mode. Note that this
> +is independent of the actual pointer device you are using on the
> +host/client side.
> +
> +Host devices can also be passed through in this way, by specifying
> +host:USBID, where USBID is of the form xxxx:yyyy.  The USBID can 
> +typically be found by using lsusb or usb-devices.
> +
> +The form usbdevice=DEVICE is also accepted for backwards compatibility.
>  

Should we mention the difference between qemu-traditional and qemu-upstream here?

qemu-traditional only supports USB 1.1 devices, while qemu-upstream offers USB 2.0 (and 3.0) emulation.
Is there currently a way to control to which virtual usb controller the host device gets added to?

See here for help how to configure that with qemu/kvm:
http://www.linux-kvm.com/content/qemu-kvm-11-adds-experimental-support-usb-30

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 15:29:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:29:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdjZj-0006X5-Bp; Wed, 28 Nov 2012 15:29:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <tls@panix.com>) id 1TdjZh-0006X0-Pu
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:29:22 +0000
Received: from [85.158.139.83:65002] by server-5.bemta-5.messagelabs.com id
	EB/23-11353-0DD26B05; Wed, 28 Nov 2012 15:29:20 +0000
X-Env-Sender: tls@panix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1354116560!27750571!1
X-Originating-IP: [166.84.1.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTY2Ljg0LjEuODkgPT4gMjgzOTI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20256 invoked from network); 28 Nov 2012 15:29:20 -0000
Received: from mailbackend.panix.com (HELO mailbackend.panix.com) (166.84.1.89)
	by server-10.tower-182.messagelabs.com with SMTP;
	28 Nov 2012 15:29:20 -0000
Received: from panix5.panix.com (panix5.panix.com [166.84.1.5])
	by mailbackend.panix.com (Postfix) with ESMTP id 731252E649;
	Wed, 28 Nov 2012 10:29:19 -0500 (EST)
Received: by panix5.panix.com (Postfix, from userid 415)
	id 50E8E24241; Wed, 28 Nov 2012 10:29:19 -0500 (EST)
Date: Wed, 28 Nov 2012 10:29:19 -0500
From: Thor Lancelot Simon <tls@panix.com>
To: Roger Pau Monn? <roger.pau@citrix.com>
Message-ID: <20121128152919.GA11947@panix.com>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com> <50B622B4.6010103@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B622B4.6010103@citrix.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: "port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 03:41:56PM +0100, Roger Pau Monn? wrote:
> On 28/11/12 14:26, Thor Lancelot Simon wrote:
> > 
> > I am assuming there's some reason we want this, rather than handling
> > such requests in-kernel.  But what is it?
> 
> I should have marked this as "experimental", or something like this. I'm
> not sure if switching to Qdisk for all image file backends is needed.
> >From the Xen wiki (http://wiki.xen.org/wiki/Blktap) I've found that:
> 
> "loop device had problems with flushing dirty pages (specifically, doing
> a large number of writes to an NFS-backed image don't result in the OOM
> killer going berserk)."
> 
> I'm not sure if NetBSD is in the same situation, but if I remember
> correctly (haven't tried that in a long time), trying to use a disk file
> on a NFS share caused the NetBSD Dom0 kernel to crash. The PR for this
> issue is: http://gnats.netbsd.org/40726.

It seems highly unlikely to me that a problem with the loop device driver
on Linux is tremendously relevant to NetBSD.

But, even if there is some problem with vnd backed by NFS, that hardly
seems like it would be a good reason to make a change that reduces I/O
throughput for the *non* NFS-backed case by at least 20%.  Why would one
keep disk images for guests, as a general rule, on NFS, rather than simply
doing the NFS mounts on the guests themselves, or using a more sensible
protocol like iSCSI?  I have to assume most folks using files as disks are
storing them on local filesystems on the dom0, and wrecking performance
for that case to solve a problem with NFS that may or may not be hypothetical
seems like a very, very bad trade-off.

Thor

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 15:29:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:29:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdjZj-0006X5-Bp; Wed, 28 Nov 2012 15:29:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <tls@panix.com>) id 1TdjZh-0006X0-Pu
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:29:22 +0000
Received: from [85.158.139.83:65002] by server-5.bemta-5.messagelabs.com id
	EB/23-11353-0DD26B05; Wed, 28 Nov 2012 15:29:20 +0000
X-Env-Sender: tls@panix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1354116560!27750571!1
X-Originating-IP: [166.84.1.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTY2Ljg0LjEuODkgPT4gMjgzOTI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20256 invoked from network); 28 Nov 2012 15:29:20 -0000
Received: from mailbackend.panix.com (HELO mailbackend.panix.com) (166.84.1.89)
	by server-10.tower-182.messagelabs.com with SMTP;
	28 Nov 2012 15:29:20 -0000
Received: from panix5.panix.com (panix5.panix.com [166.84.1.5])
	by mailbackend.panix.com (Postfix) with ESMTP id 731252E649;
	Wed, 28 Nov 2012 10:29:19 -0500 (EST)
Received: by panix5.panix.com (Postfix, from userid 415)
	id 50E8E24241; Wed, 28 Nov 2012 10:29:19 -0500 (EST)
Date: Wed, 28 Nov 2012 10:29:19 -0500
From: Thor Lancelot Simon <tls@panix.com>
To: Roger Pau Monn? <roger.pau@citrix.com>
Message-ID: <20121128152919.GA11947@panix.com>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com> <50B622B4.6010103@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B622B4.6010103@citrix.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: "port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 03:41:56PM +0100, Roger Pau Monn? wrote:
> On 28/11/12 14:26, Thor Lancelot Simon wrote:
> > 
> > I am assuming there's some reason we want this, rather than handling
> > such requests in-kernel.  But what is it?
> 
> I should have marked this as "experimental", or something like this. I'm
> not sure if switching to Qdisk for all image file backends is needed.
> >From the Xen wiki (http://wiki.xen.org/wiki/Blktap) I've found that:
> 
> "loop device had problems with flushing dirty pages (specifically, doing
> a large number of writes to an NFS-backed image don't result in the OOM
> killer going berserk)."
> 
> I'm not sure if NetBSD is in the same situation, but if I remember
> correctly (haven't tried that in a long time), trying to use a disk file
> on a NFS share caused the NetBSD Dom0 kernel to crash. The PR for this
> issue is: http://gnats.netbsd.org/40726.

It seems highly unlikely to me that a problem with the loop device driver
on Linux is tremendously relevant to NetBSD.

But, even if there is some problem with vnd backed by NFS, that hardly
seems like it would be a good reason to make a change that reduces I/O
throughput for the *non* NFS-backed case by at least 20%.  Why would one
keep disk images for guests, as a general rule, on NFS, rather than simply
doing the NFS mounts on the guests themselves, or using a more sensible
protocol like iSCSI?  I have to assume most folks using files as disks are
storing them on local filesystems on the dom0, and wrecking performance
for that case to solve a problem with NFS that may or may not be hypothetical
seems like a very, very bad trade-off.

Thor

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 15:32:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:32:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdjcf-0006dj-VV; Wed, 28 Nov 2012 15:32:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tdjce-0006dc-SC
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:32:25 +0000
Received: from [85.158.139.211:45866] by server-8.bemta-5.messagelabs.com id
	B1/4E-06050-78E26B05; Wed, 28 Nov 2012 15:32:23 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354116742!18245138!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6901 invoked from network); 28 Nov 2012 15:32:22 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 15:32:22 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 15:32:21 +0000
Message-Id: <50B63CCC02000078000AC34E@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 15:33:16 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "George Dunlap" <dunlapg@umich.edu>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
In-Reply-To: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 18:57, George Dunlap <dunlapg@umich.edu> wrote:
> So while doing a bit of investigation into a request that we have
> instructions for how to sign a Xen binary, I came across a related pair of
> questions.  If we boot from a signed Xen binary, then:
> 1. Will Xen then successfully boot a signed dom0 kernel / initrd?
> 2. Will Xen fail to boot an unsigned dom0 kernel / initrd?
> 
> I think if Xen is signed, then ideally we want both 1 and 2 to be true,
> right?

Not necessarily: With the shim approach that most people now
seem to agree to, it would depend on whether xen.efi actually
got loaded directly or through the shim. When loaded through
the shim, both ought to be true. If loaded without the shim,
whether Xen is signed doesn't matter, and hence whether the
Dom0 kernel image is signed shouldn't matter either.

The grub2 code I just looked at doesn't verify the initrd btw,
that's apparently left to the kernel.

> Does UEFI provide a way to check the signature of files? Does
> it happen automatically, or would we need to add extra support?
> Or would we need to embed a public key within the Xen binary
> and have Xen check the signatures of files that it reads?

No, that's what the shim is actually for - it publishes a suitable,
trivial protocol.

Adding the verification step has turned out to require 19 added
lines, so pretty trivial. I didn't look into what additional data Dom0
may need access to, yet.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 15:32:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:32:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdjcf-0006dj-VV; Wed, 28 Nov 2012 15:32:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tdjce-0006dc-SC
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:32:25 +0000
Received: from [85.158.139.211:45866] by server-8.bemta-5.messagelabs.com id
	B1/4E-06050-78E26B05; Wed, 28 Nov 2012 15:32:23 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354116742!18245138!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6901 invoked from network); 28 Nov 2012 15:32:22 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 15:32:22 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 15:32:21 +0000
Message-Id: <50B63CCC02000078000AC34E@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 15:33:16 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "George Dunlap" <dunlapg@umich.edu>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
In-Reply-To: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 26.11.12 at 18:57, George Dunlap <dunlapg@umich.edu> wrote:
> So while doing a bit of investigation into a request that we have
> instructions for how to sign a Xen binary, I came across a related pair of
> questions.  If we boot from a signed Xen binary, then:
> 1. Will Xen then successfully boot a signed dom0 kernel / initrd?
> 2. Will Xen fail to boot an unsigned dom0 kernel / initrd?
> 
> I think if Xen is signed, then ideally we want both 1 and 2 to be true,
> right?

Not necessarily: With the shim approach that most people now
seem to agree to, it would depend on whether xen.efi actually
got loaded directly or through the shim. When loaded through
the shim, both ought to be true. If loaded without the shim,
whether Xen is signed doesn't matter, and hence whether the
Dom0 kernel image is signed shouldn't matter either.

The grub2 code I just looked at doesn't verify the initrd btw,
that's apparently left to the kernel.

> Does UEFI provide a way to check the signature of files? Does
> it happen automatically, or would we need to add extra support?
> Or would we need to embed a public key within the Xen binary
> and have Xen check the signatures of files that it reads?

No, that's what the shim is actually for - it publishes a suitable,
trivial protocol.

Adding the verification step has turned out to require 19 added
lines, so pretty trivial. I didn't look into what additional data Dom0
may need access to, yet.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 15:35:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:35:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdjfY-0006oC-O4; Wed, 28 Nov 2012 15:35:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TdjfX-0006o4-Gm
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:35:23 +0000
Received: from [85.158.138.51:56575] by server-7.bemta-3.messagelabs.com id
	40/2F-01713-A3F26B05; Wed, 28 Nov 2012 15:35:22 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1354116921!28321309!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30463 invoked from network); 28 Nov 2012 15:35:21 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 15:35:21 -0000
X-IronPort-AV: E=Sophos;i="4.84,179,1355097600"; d="scan'208";a="16050874"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 15:35:21 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 15:35:20 +0000
Message-ID: <50B62F38.7090906@citrix.com>
Date: Wed, 28 Nov 2012 16:35:20 +0100
From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
	<1354015744.5830.199.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354015744.5830.199.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] docs: fix persistent grants doc typo
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gMjcvMTEvMTIgMTI6MjksIElhbiBDYW1wYmVsbCB3cm90ZToKPiBPbiBUdWUsIDIwMTItMTEt
MjcgYXQgMTA6MDMgKzAwMDAsIFJvZ2VyIFBhdSBNb25uZSB3cm90ZToKPj4gU2lnbmVkLW9mZi1i
eTogUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+Cj4+IC0tLQo+PiAgeGVu
L2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmggfCAgICAyICstCj4+ICAxIGZpbGVzIGNoYW5nZWQs
IDEgaW5zZXJ0aW9ucygrKSwgMSBkZWxldGlvbnMoLSkKPj4KPj4gZGlmZiAtLWdpdCBhL3hlbi9p
bmNsdWRlL3B1YmxpYy9pby9ibGtpZi5oIGIveGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmgK
Pj4gaW5kZXggYWNjZGRhNC4uZGI5YzM3OSAxMDA2NDQKPj4gLS0tIGEveGVuL2luY2x1ZGUvcHVi
bGljL2lvL2Jsa2lmLmgKPj4gKysrIGIveGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmgKPj4g
QEAgLTMwNyw3ICszMDcsNyBAQAo+PiAgICogICAgIHRoZSBncmFudHMuCj4+ICAgKiAoOCkgVGhl
IGZyb250ZW5kIGRyaXZlciBoYXMgdG8gYWxsb3cgdGhlIGJhY2tlbmQgZHJpdmVyIHRvIG1hcCBh
bGwgZ3JhbnRzCj4+ICAgKiAgICAgd2l0aCB3cml0ZSBhY2Nlc3MsIGV2ZW4gd2hlbiB0aGV5IHNo
b3VsZCBiZSBtYXBwZWQgcmVhZC1vbmx5LCBzaW5jZQo+PiAtICogICAgIGZ1cnRoZXIgcmVxdWVz
dHMgbWF5IHJldXNlIHRoaXMgZ3JhbnRzIGFuZCByZXF1aXJlIHdyaXRlIHBlcm1pc2lvbnMuCj4+
ICsgKiAgICAgZnVydGhlciByZXF1ZXN0cyBtYXkgcmV1c2UgdGhpcyBncmFudHMgYW5kIHJlcXVp
cmUgd3JpdGUgcGVybWlzc2lvbnMuCj4gCj4gInRoZXNlIGdyYW50cyIgcHJvYmFibHk/IChhbHRl
cm5hdGl2ZWx5ICJ0aGlzIGdyYW50IiBidXQgSSBkb24ndCAgdGhpbmsKPiB0aGF0IGlzIHdoYXQg
aXMgbWVhbnQpLgoKWWVzLCAidGhlc2UgZ3JhbnRzIiBpcyBjb3JyZWN0LiBEbyBJIG5lZWQgdG8g
cmVzZW5kIHRoaXMsIG9yIGNhbiB0aGUKY29tbWl0dGVyIGNoYW5nZSBpdD8KCj4gCj4+ICAgKi8K
Pj4gIAo+PiAgLyoKPiAKPiAKCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fXwpYZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3Jn
Cmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Wed Nov 28 15:35:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:35:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdjfY-0006oC-O4; Wed, 28 Nov 2012 15:35:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TdjfX-0006o4-Gm
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:35:23 +0000
Received: from [85.158.138.51:56575] by server-7.bemta-3.messagelabs.com id
	40/2F-01713-A3F26B05; Wed, 28 Nov 2012 15:35:22 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1354116921!28321309!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30463 invoked from network); 28 Nov 2012 15:35:21 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 15:35:21 -0000
X-IronPort-AV: E=Sophos;i="4.84,179,1355097600"; d="scan'208";a="16050874"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 15:35:21 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 15:35:20 +0000
Message-ID: <50B62F38.7090906@citrix.com>
Date: Wed, 28 Nov 2012 16:35:20 +0100
From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
	<1354015744.5830.199.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354015744.5830.199.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] docs: fix persistent grants doc typo
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gMjcvMTEvMTIgMTI6MjksIElhbiBDYW1wYmVsbCB3cm90ZToKPiBPbiBUdWUsIDIwMTItMTEt
MjcgYXQgMTA6MDMgKzAwMDAsIFJvZ2VyIFBhdSBNb25uZSB3cm90ZToKPj4gU2lnbmVkLW9mZi1i
eTogUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+Cj4+IC0tLQo+PiAgeGVu
L2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmggfCAgICAyICstCj4+ICAxIGZpbGVzIGNoYW5nZWQs
IDEgaW5zZXJ0aW9ucygrKSwgMSBkZWxldGlvbnMoLSkKPj4KPj4gZGlmZiAtLWdpdCBhL3hlbi9p
bmNsdWRlL3B1YmxpYy9pby9ibGtpZi5oIGIveGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmgK
Pj4gaW5kZXggYWNjZGRhNC4uZGI5YzM3OSAxMDA2NDQKPj4gLS0tIGEveGVuL2luY2x1ZGUvcHVi
bGljL2lvL2Jsa2lmLmgKPj4gKysrIGIveGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmgKPj4g
QEAgLTMwNyw3ICszMDcsNyBAQAo+PiAgICogICAgIHRoZSBncmFudHMuCj4+ICAgKiAoOCkgVGhl
IGZyb250ZW5kIGRyaXZlciBoYXMgdG8gYWxsb3cgdGhlIGJhY2tlbmQgZHJpdmVyIHRvIG1hcCBh
bGwgZ3JhbnRzCj4+ICAgKiAgICAgd2l0aCB3cml0ZSBhY2Nlc3MsIGV2ZW4gd2hlbiB0aGV5IHNo
b3VsZCBiZSBtYXBwZWQgcmVhZC1vbmx5LCBzaW5jZQo+PiAtICogICAgIGZ1cnRoZXIgcmVxdWVz
dHMgbWF5IHJldXNlIHRoaXMgZ3JhbnRzIGFuZCByZXF1aXJlIHdyaXRlIHBlcm1pc2lvbnMuCj4+
ICsgKiAgICAgZnVydGhlciByZXF1ZXN0cyBtYXkgcmV1c2UgdGhpcyBncmFudHMgYW5kIHJlcXVp
cmUgd3JpdGUgcGVybWlzc2lvbnMuCj4gCj4gInRoZXNlIGdyYW50cyIgcHJvYmFibHk/IChhbHRl
cm5hdGl2ZWx5ICJ0aGlzIGdyYW50IiBidXQgSSBkb24ndCAgdGhpbmsKPiB0aGF0IGlzIHdoYXQg
aXMgbWVhbnQpLgoKWWVzLCAidGhlc2UgZ3JhbnRzIiBpcyBjb3JyZWN0LiBEbyBJIG5lZWQgdG8g
cmVzZW5kIHRoaXMsIG9yIGNhbiB0aGUKY29tbWl0dGVyIGNoYW5nZSBpdD8KCj4gCj4+ICAgKi8K
Pj4gIAo+PiAgLyoKPiAKPiAKCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fXwpYZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3Jn
Cmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Wed Nov 28 15:49:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:49:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdjsc-00072q-90; Wed, 28 Nov 2012 15:48:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Tdjsb-00072l-AH
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:48:53 +0000
Received: from [85.158.137.99:50669] by server-2.bemta-3.messagelabs.com id
	2A/7E-04744-46236B05; Wed, 28 Nov 2012 15:48:52 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354117731!16929872!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30793 invoked from network); 28 Nov 2012 15:48:51 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 15:48:51 -0000
X-IronPort-AV: E=Sophos;i="4.84,179,1355097600"; d="scan'208";a="16051186"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 15:48:51 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 15:48:51 +0000
Message-ID: <50B63262.3030407@citrix.com>
Date: Wed, 28 Nov 2012 16:48:50 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Thor Lancelot Simon <tls@panix.com>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com> <50B622B4.6010103@citrix.com>
	<20121128152919.GA11947@panix.com>
In-Reply-To: <20121128152919.GA11947@panix.com>
Cc: "port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/12 16:29, Thor Lancelot Simon wrote:
> On Wed, Nov 28, 2012 at 03:41:56PM +0100, Roger Pau Monn? wrote:
>> On 28/11/12 14:26, Thor Lancelot Simon wrote:
>>>
>>> I am assuming there's some reason we want this, rather than handling
>>> such requests in-kernel.  But what is it?
>>
>> I should have marked this as "experimental", or something like this. I'm
>> not sure if switching to Qdisk for all image file backends is needed.
>> >From the Xen wiki (http://wiki.xen.org/wiki/Blktap) I've found that:
>>
>> "loop device had problems with flushing dirty pages (specifically, doing
>> a large number of writes to an NFS-backed image don't result in the OOM
>> killer going berserk)."
>>
>> I'm not sure if NetBSD is in the same situation, but if I remember
>> correctly (haven't tried that in a long time), trying to use a disk file
>> on a NFS share caused the NetBSD Dom0 kernel to crash. The PR for this
>> issue is: http://gnats.netbsd.org/40726.
> 
> It seems highly unlikely to me that a problem with the loop device driver
> on Linux is tremendously relevant to NetBSD.
> 
> But, even if there is some problem with vnd backed by NFS, that hardly
> seems like it would be a good reason to make a change that reduces I/O
> throughput for the *non* NFS-backed case by at least 20%.  Why would one
> keep disk images for guests, as a general rule, on NFS, rather than simply
> doing the NFS mounts on the guests themselves, or using a more sensible
> protocol like iSCSI?  I have to assume most folks using files as disks are
> storing them on local filesystems on the dom0, and wrecking performance
> for that case to solve a problem with NFS that may or may not be hypothetical
> seems like a very, very bad trade-off.

Quite a lot of people use disk images on NFS, because it's probably the
easiest shared storage that allows migration of guests.

Even if disks on NFS was a remote possibility not used by much people I
don't think it's acceptable to have a Dom0 crash when you try to create
a guest with a disk on NFS, that is by far much more worse than
performance degradation in my opinion.

If this is not accepted, I will have to detect image format somewhere
and use qemu when the format is different than raw.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 15:49:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:49:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdjsc-00072q-90; Wed, 28 Nov 2012 15:48:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Tdjsb-00072l-AH
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:48:53 +0000
Received: from [85.158.137.99:50669] by server-2.bemta-3.messagelabs.com id
	2A/7E-04744-46236B05; Wed, 28 Nov 2012 15:48:52 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354117731!16929872!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30793 invoked from network); 28 Nov 2012 15:48:51 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 15:48:51 -0000
X-IronPort-AV: E=Sophos;i="4.84,179,1355097600"; d="scan'208";a="16051186"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 15:48:51 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 15:48:51 +0000
Message-ID: <50B63262.3030407@citrix.com>
Date: Wed, 28 Nov 2012 16:48:50 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Thor Lancelot Simon <tls@panix.com>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com> <50B622B4.6010103@citrix.com>
	<20121128152919.GA11947@panix.com>
In-Reply-To: <20121128152919.GA11947@panix.com>
Cc: "port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/12 16:29, Thor Lancelot Simon wrote:
> On Wed, Nov 28, 2012 at 03:41:56PM +0100, Roger Pau Monn? wrote:
>> On 28/11/12 14:26, Thor Lancelot Simon wrote:
>>>
>>> I am assuming there's some reason we want this, rather than handling
>>> such requests in-kernel.  But what is it?
>>
>> I should have marked this as "experimental", or something like this. I'm
>> not sure if switching to Qdisk for all image file backends is needed.
>> >From the Xen wiki (http://wiki.xen.org/wiki/Blktap) I've found that:
>>
>> "loop device had problems with flushing dirty pages (specifically, doing
>> a large number of writes to an NFS-backed image don't result in the OOM
>> killer going berserk)."
>>
>> I'm not sure if NetBSD is in the same situation, but if I remember
>> correctly (haven't tried that in a long time), trying to use a disk file
>> on a NFS share caused the NetBSD Dom0 kernel to crash. The PR for this
>> issue is: http://gnats.netbsd.org/40726.
> 
> It seems highly unlikely to me that a problem with the loop device driver
> on Linux is tremendously relevant to NetBSD.
> 
> But, even if there is some problem with vnd backed by NFS, that hardly
> seems like it would be a good reason to make a change that reduces I/O
> throughput for the *non* NFS-backed case by at least 20%.  Why would one
> keep disk images for guests, as a general rule, on NFS, rather than simply
> doing the NFS mounts on the guests themselves, or using a more sensible
> protocol like iSCSI?  I have to assume most folks using files as disks are
> storing them on local filesystems on the dom0, and wrecking performance
> for that case to solve a problem with NFS that may or may not be hypothetical
> seems like a very, very bad trade-off.

Quite a lot of people use disk images on NFS, because it's probably the
easiest shared storage that allows migration of guests.

Even if disks on NFS was a remote possibility not used by much people I
don't think it's acceptable to have a Dom0 crash when you try to create
a guest with a disk on NFS, that is by far much more worse than
performance degradation in my opinion.

If this is not accepted, I will have to detect image format somewhere
and use qemu when the format is different than raw.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 15:50:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:50:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdjuG-00077U-P5; Wed, 28 Nov 2012 15:50:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TdjuF-00077N-Bi
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:50:35 +0000
Received: from [85.158.139.211:30107] by server-9.bemta-5.messagelabs.com id
	27/AE-29295-AC236B05; Wed, 28 Nov 2012 15:50:34 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354117831!18247887!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODE1MjA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32335 invoked from network); 28 Nov 2012 15:50:33 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 15:50:33 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASFoRYF016324
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 15:50:27 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASFoQeP019418
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 15:50:26 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASFoQfs021092; Wed, 28 Nov 2012 09:50:26 -0600
MIME-Version: 1.0
Message-ID: <cd59ddd0-be45-47e3-b762-a5d630c2df43@default>
Date: Wed, 28 Nov 2012 07:50:22 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__1354117825940119786abhmt101.oracle.com"
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Andres Lagar-Cavilla <andreslc@gridcentric.ca>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, Matthew Daley <mattjd@gmail.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH v8 1/2] hypervisor: XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__1354117825940119786abhmt101.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This is patch 1of2 of an eighth cut of the patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account review
feedback from Jan and Keir and IanC and Matthew Daley, plus some
fixes found via runtime debugging (using printk and privcmd only).

v7->v8:
- Replace missing tot_pages adjustment [JBeulich]
- Combine domain_inc/dec_tot_pages into one function [JBeulich]
- Added a few more clarifying comments [djm]

v6->v7:
- Need co-existence with low_mem_virq [JBeulich]

v5->v6:
- Fix post-inc problem [mattjd]

v4->v5:
- Split tools part into separate patch [JBeulich]
- Minor coding style fixups [JBeulich]
- Use rcu_lock_domain_by_id, not _target version [JBeulich]

v3->v4: (please ignore v3)
- Process error, sent stale patch, sorry [djm]

v2->v3:
- Add per-domain and global "get" for unclaimed info [JBeulich]
- New hypercall(s) should fail for unpriv callers [IanC]
- Non-zero extent_order disallowed [JBeulich]
- Remove bonehead ASSERTs [JBeulich]
- Need not hold heaplock for decrease case too [JBeulich]
- More descriptive failure return values [JBeulich]
- Don't allow a claim to exceed max_pages [IanC]
- Subops must be in correct ifdef block in memory.c [keir]

v1->v2:
- Add reset-to-zero page claim in domain_kill [JBeulich]
- Proper handling of struct passed to hypercall [JBeulich]
- Fix alloc_heap_pages when a domain has a claim [JBeulich]
- Need not hold heap_lock if !d->unclaimed_pages [keir]
- Fix missed tot_pages call in donate_page [djm]
- Remove domain_reset_unclaimed_pages; use set with zero [djm]
- Bugfixes found through testing in set_unclaimed [djm]
- More comments in code [djm]
- Code formatting fixes [djm]

=3D=3D=3D

Motivation:

The goal of this hypercall is to attempt to atomically and very
quickly determine if there are sufficient pages available in the
system and, if so, "set aside" that quantity of pages for future
allocations by that domain.  Unlike an existing hypercall such as
increase_reservation or populate_physmap, specific physical
pageframes are not assigned to the domain because this
cannot be done sufficiently quickly (especially for very large
allocations in an arbitrarily fragmented system) and so the
existing mechanisms result in classic time-of-check-time-of-use
(TOCTOU) races.  One can think of claiming as similar to a
"lazy" allocation, but subsequent hypercalls are required
to do the actual physical pageframe allocation.

In order for a toolstack to "get" information about whether
a domain has a claim and, if so, how large, and also for
the toolstack to measure the total system-wide claim, a
second subop has been added and exposed through domctl
and libxl (see PATCH 2/2).

Note that this patchset does not include a full toolstack
implementation, in part because Oracle uses xm/xend and a
proprietary toolstack.  The following pseudo-code describes
the proposed claim-based use model, which could easily be
implemented as an xl option such as "xl create --claim".

Current:
- call populate_physmap repeatedly to achieve mem=3DN memory
- if any populate_physmap call fails, report -ENOMEM up the stack
- memory is held until domain dies or the toolstack decreases it

Proposed:
- call claim for mem=3DN amount of memory
- if claim succeeds:
    call populate_physmap repeatedly to achieve mem=3DN memory (failsafe)
  else
    report -ENOMEM up the stack
- claim is held until mem=3DN is achieved or the domain dies or
   the toolstack changes it to 0
- memory is held until domain dies or the toolstack decreases it

It has been noted that this claim mechanism solves the
underlying problem (slow failure of domain creation) for
a large class of domains but not all, specifically not
handling (but also not making the problem worse for) PV
domains that specify the "superpages" flag, and 32-bit PV
domains on large RAM systems.  These may be addressed at a
later time.

Code overview:

Though the hypercall simply does arithmetic within locks,
some of the semantics in the code may be a bit subtle
so let me explain a bit.

The key variables (d->unclaimed_pages and total_unclaimed_pages)
start at zero if no claim has yet been staked for any domain.
(Perhaps a better name is "claimed_but_not_yet_possessed" but that's
a bit unwieldy.)  If no claim hypercalls are executed, there
should be no impact on existing usage.

When a claim is successfully staked by a domain, it is like a
watermark but there is no record kept of the size of the claim.
Instead, d->unclaimed_pages is set to the difference between
d->tot_pages and the claim.  When d->tot_pages increases or decreases,
d->unclaimed_pages atomically decreases or increases.  Once
d->unclaimed_pages reaches zero, the claim is satisfied and
d->unclaimed pages stays at zero -- unless a new claim is
subsequently staked.

The systemwide variable total_unclaimed_pages is always the sum
of d->unclaimed_pages, across all domains.  A non-domain-
specific heap allocation will fail if total_unclaimed_pages
exceeds free (plus, on tmem enabled systems, freeable) pages.

Claim semantics may be modified by flags.  The initial
implementation has one flag, which discerns whether the
caller would like tmem freeable pages to be considered
in determining whether or not the claim can be successfully
staked. Future flags may, for example, specify that the
caller would like the claim to be successful only if there
are sufficient pages available on a single node (per Dario's
suggestion).

A claim can be cancelled by requesting a claim of zero pages.

A second subop returns the total outstanding claimed pages
systemwide.

Note: Save/restore/migrate may need to be modified,
else it can be documented that all claims are cancelled.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 arch/x86/mm.c             |    2=20
 arch/x86/mm/mem_sharing.c |    4 -
 common/domain.c           |    1=20
 common/domctl.c           |    1=20
 common/grant_table.c      |    2=20
 common/memory.c           |   33 ++++++++++++-
 common/page_alloc.c       |  114 +++++++++++++++++++++++++++++++++++++++++=
+++--
 include/public/domctl.h   |    3 -
 include/public/memory.h   |   39 +++++++++++++++
 include/xen/mm.h          |    6 ++
 include/xen/sched.h       |    1=20
 11 files changed, 197 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fad3d33..480edf7 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3841,7 +3841,7 @@ int donate_page(
     {
         if ( d->tot_pages >=3D d->max_pages )
             goto fail;
-        d->tot_pages++;
+        domain_adjust_tot_pages(d, 1);
     }
=20
     page->count_info =3D PGC_allocated | 1;
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..e91aac5 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d,
     }
=20
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_adjust_tot_pages(d, -1);
     drop_dom_ref =3D (d->tot_pages =3D=3D 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct p=
age_info *page)
     ASSERT(page_get_owner(page) =3D=3D dom_cow);
     page_set_owner(page, d);
=20
-    if ( d->tot_pages++ =3D=3D 0 )
+    if ( domain_adjust_tot_pages(d, 1) =3D=3D 1 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 12c8e24..f2cc4f5 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -492,6 +492,7 @@ int domain_kill(struct domain *d)
         evtchn_destroy(d);
         gnttab_release_mappings(d);
         tmem_destroy(d->tmem);
+        domain_set_unclaimed_pages(d, 0, 0);
         d->tmem =3D NULL;
         /* fallthrough */
     case DOMDYING_dying:
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index a7a6b9f..e47a991 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -154,6 +154,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_=
getdomaininfo *info)
=20
     info->tot_pages         =3D d->tot_pages;
     info->max_pages         =3D d->max_pages;
+    info->unclaimed_pages   =3D d->unclaimed_pages;
     info->shr_pages         =3D atomic_read(&d->shr_pages);
     info->paged_pages       =3D atomic_read(&d->paged_pages);
     info->shared_info_frame =3D mfn_to_gmfn(d, __pa(d->shared_info)>>PAGE_=
SHIFT);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..ca8d861 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1656,7 +1656,7 @@ gnttab_transfer(
         }
=20
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ =3D=3D 0) )
+        if ( unlikely(domain_adjust_tot_pages(e, 1) =3D=3D 1) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..8efa6a3 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_=
memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
=20
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -=3D dec_count;
+                domain_adjust_tot_pages(d, -dec_count);
                 drop_dom_ref =3D (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
=20
@@ -685,6 +685,37 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_=
PARAM(void) arg)
         break;
     }
=20
+    case XENMEM_claim_pages:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+
+        if ( copy_from_guest(&reservation, arg, 1) )
+            return -EFAULT;
+
+        if ( !guest_handle_is_null(reservation.extent_start) )
+            return -EINVAL;
+
+        if ( reservation.extent_order !=3D 0 )
+            return -EINVAL;
+
+        d =3D rcu_lock_domain_by_id(reservation.domid);
+        if ( d =3D=3D NULL )
+            return -EINVAL;
+
+        rc =3D domain_set_unclaimed_pages(d, reservation.nr_extents,
+                                        reservation.mem_flags);
+
+        rcu_unlock_domain(d);
+
+        break;
+
+    case XENMEM_get_unclaimed_pages:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+
+        rc =3D get_total_unclaimed_pages();
+        break;
+
     default:
         rc =3D arch_memory_op(op, arg);
         break;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 15ebc66..bb3e346 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -238,6 +238,105 @@ static long midsize_alloc_zone_pages;
 #define MIDSIZE_ALLOC_FRAC 128
=20
 static DEFINE_SPINLOCK(heap_lock);
+static long total_unclaimed_pages; /* total outstanding claims by all doma=
ins */
+
+unsigned long domain_adjust_tot_pages(struct domain *d, long pages)
+{
+    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
+
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    /*
+     * can test d->claimed_pages race-free because it can only change
+     * if d->page_alloc_lock and heap_lock are both held, see also
+     * domain_set_unclaimed_pages below
+     */
+    if ( !d->unclaimed_pages )
+        return d->tot_pages +=3D pages;
+    spin_lock(&heap_lock);
+    d->tot_pages +=3D pages;
+    /* adjust domain unclaimed_pages; may not go negative */
+    dom_before =3D d->unclaimed_pages;
+    dom_after =3D dom_before - pages;
+    if ( (dom_before > 0) && (dom_after < 0) )
+        dom_claimed =3D 0;
+    else
+        dom_claimed =3D dom_after;
+    d->unclaimed_pages =3D dom_claimed;
+    /* flag accounting bug if system unclaimed_pages would go negative */
+    sys_before =3D total_unclaimed_pages;
+    sys_after =3D sys_before - (dom_before - dom_claimed);
+    BUG_ON((sys_before > 0) && (sys_after < 0));
+    total_unclaimed_pages =3D sys_after;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
+                                unsigned long flags)
+{
+    int ret =3D -ENOMEM;
+    unsigned long claim, avail_pages;
+
+    /*
+     * take the domain's page_alloc_lock, else all d->tot_page adjustments
+     * must always take the global heap_lock rather than only in the much
+     * rarer case that d->unclaimed_pages is non-zero
+     */
+    spin_lock(&d->page_alloc_lock);
+    spin_lock(&heap_lock);
+
+    /* pages=3D=3D0 means "unset" the claim (and flags is ignored) */
+    if ( pages =3D=3D 0 )
+    {
+        total_unclaimed_pages -=3D d->unclaimed_pages;
+        d->unclaimed_pages =3D 0;
+        ret =3D 0;
+        goto out;
+    }
+
+    /* only one active claim per domain please */
+    if ( d->unclaimed_pages )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* disallow a claim not exceeding current tot_pages or above max_pages=
 */
+    if ( (pages <=3D d->tot_pages) || (pages > d->max_pages) )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* how much memory is available? */
+    avail_pages =3D total_avail_pages;
+    if ( !(flags & XENMEM_CLAIMF_free_only) )
+        avail_pages +=3D tmem_freeable_pages();
+    avail_pages -=3D total_unclaimed_pages;
+
+    /*
+     * note, if domain has already allocated memory before making a claim=
=20
+     * then the claim must take tot_pages into account
+     */
+    claim =3D pages - d->tot_pages;
+    if ( claim > avail_pages )
+        goto out;
+
+    /* yay, claim fits in available memory, stake the claim, success! */
+    d->unclaimed_pages =3D claim;
+    total_unclaimed_pages +=3D d->unclaimed_pages;
+    ret =3D 0;
+
+out:
+    spin_unlock(&heap_lock);
+    spin_unlock(&d->page_alloc_lock);
+    return ret;
+}
+
+long get_total_unclaimed_pages(void)
+{
+    return total_unclaimed_pages;
+}
=20
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
@@ -374,7 +473,7 @@ static void __init setup_low_mem_virq(void)
 static void check_low_mem_virq(void)
 {
     unsigned long avail_pages =3D total_avail_pages +
-        (opt_tmem ? tmem_freeable_pages() : 0);
+        (opt_tmem ? tmem_freeable_pages() : 0) - total_unclaimed_pages;
=20
     if ( unlikely(avail_pages <=3D low_mem_virq_th) )
     {
@@ -443,6 +542,15 @@ static struct page_info *alloc_heap_pages(
     spin_lock(&heap_lock);
=20
     /*
+     * Claimed memory is considered unavailable unless the request
+     * is made by a domain with sufficient unclaimed pages.
+     */
+    if ( (total_unclaimed_pages + request >
+          total_avail_pages + tmem_freeable_pages()) &&
+          (d =3D=3D NULL || d->unclaimed_pages < request) )
+        goto not_found;
+
+    /*
      * TMEM: When available memory is scarce due to tmem absorbing it, all=
ow
      * only mid-size allocations to avoid worst of fragmentation issues.
      * Others try tmem pools then fail.  This is a workaround until all
@@ -1291,7 +1399,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages =3D=3D 0) )
             get_knownalive_domain(d);
=20
-        d->tot_pages +=3D 1 << order;
+        domain_adjust_tot_pages(d, 1 << order);
     }
=20
     for ( i =3D 0; i < (1 << order); i++ )
@@ -1375,7 +1483,7 @@ void free_domheap_pages(struct page_info *pg, unsigne=
d int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
=20
-        d->tot_pages -=3D 1 << order;
+        domain_adjust_tot_pages(d, -(1 << order));
         drop_dom_ref =3D (d->tot_pages =3D=3D 0);
=20
         spin_unlock_recursive(&d->page_alloc_lock);
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 7c0f23d..5735c28 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -36,7 +36,7 @@
 #include "grant_table.h"
 #include "hvm/save.h"
=20
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000009
=20
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -95,6 +95,7 @@ struct xen_domctl_getdomaininfo {
     uint32_t flags;              /* XEN_DOMINF_* */
     uint64_aligned_t tot_pages;
     uint64_aligned_t max_pages;
+    uint64_aligned_t unclaimed_pages;
     uint64_aligned_t shr_pages;
     uint64_aligned_t paged_pages;
     uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index f1ddbc0..15d6c72 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -68,6 +68,8 @@ struct xen_memory_reservation {
      *   IN:  GPFN bases of extents to populate with memory
      *   OUT: GMFN bases of extents that were allocated
      *   (NB. This command also updates the mach_to_phys translation table=
)
+     * XENMEM_claim_pages:
+     *   IN: must be zero
      */
     XEN_GUEST_HANDLE(xen_pfn_t) extent_start;
=20
@@ -421,6 +423,43 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
=20
+/*
+ * Attempt to stake a claim for a domain on a quantity of pages
+ * of system RAM, but _not_ assign specific pageframes.  Only
+ * arithmetic is performed so the hypercall is very fast and need
+ * not be preemptible, thus sidestepping time-of-check-time-of-use
+ * races for memory allocation.  Returns 0 if the hypervisor page
+ * allocator has atomically and successfully claimed the requested
+ * number of pages, else non-zero.
+ *
+ * Any domain may have only one active claim.  When sufficient memory
+ * has been allocated to resolve the claim, the claim silently expires.
+ * Claiming zero pages effectively resets any outstanding claim and
+ * is always successful.
+ *
+ * Note that a valid claim may be staked even after memory has been
+ * allocated for a domain.  In this case, the claim is not incremental,
+ * i.e. if the domain's tot_pages is 3, and a claim is staked for 10,
+ * only 7 additional pages are claimed.
+ *
+ * Caller must be privileged or the hypercall fails.
+ */
+#define XENMEM_claim_pages                  24
+/*
+ * XENMEM_claim_pages flags:
+ *  free_only: claim is successful only if sufficient free pages
+ *    are available.  If not set and tmem is enabled, hypervisor
+ *    may also consider tmem "freeable" pages to satisfy the claim.
+ */
+#define _XENMEM_CLAIMF_free_only            0
+#define XENMEM_CLAIMF_free_only             (1U<<_XENMEM_CLAIMF_free_only)
+/*
+ * Get the number of pages currently claimed (but not yet "possessed")
+ * across all domains.  The caller must be privileged but otherwise
+ * the call never fails.=20
+ */
+#define XENMEM_get_unclaimed_pages            25
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
=20
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 64a0cc1..86351d0 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,12 @@ void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
=20
+/* Claim handling */
+unsigned long domain_adjust_tot_pages(struct domain *d, long pages);
+int domain_set_unclaimed_pages(
+    struct domain *d, unsigned long pages, unsigned long flags);
+long get_total_unclaimed_pages(void);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..480ef39 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -242,6 +242,7 @@ struct domain
     struct page_list_head page_list;  /* linked list */
     struct page_list_head xenpage_list; /* linked list (size xenheap_pages=
) */
     unsigned int     tot_pages;       /* number of pages currently possese=
d */
+    unsigned int     unclaimed_pages; /* pages claimed but not possessed  =
  */
     unsigned int     max_pages;       /* maximum value for tot_pages      =
  */
     atomic_t         shr_pages;       /* number of shared pages           =
  */
     atomic_t         paged_pages;     /* number of paged-out pages        =
  */

--__1354117825940119786abhmt101.oracle.com
Content-Type: application/octet-stream; name="claim-121128-hyp.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-121128-hyp.patch"

ZGlmZiAtLWdpdCBhL3hlbi9hcmNoL3g4Ni9tbS5jIGIveGVuL2FyY2gveDg2L21tLmMKaW5kZXgg
ZmFkM2QzMy4uNDgwZWRmNyAxMDA2NDQKLS0tIGEveGVuL2FyY2gveDg2L21tLmMKKysrIGIveGVu
L2FyY2gveDg2L21tLmMKQEAgLTM4NDEsNyArMzg0MSw3IEBAIGludCBkb25hdGVfcGFnZSgKICAg
ICB7CiAgICAgICAgIGlmICggZC0+dG90X3BhZ2VzID49IGQtPm1heF9wYWdlcyApCiAgICAgICAg
ICAgICBnb3RvIGZhaWw7Ci0gICAgICAgIGQtPnRvdF9wYWdlcysrOworICAgICAgICBkb21haW5f
YWRqdXN0X3RvdF9wYWdlcyhkLCAxKTsKICAgICB9CiAKICAgICBwYWdlLT5jb3VudF9pbmZvID0g
UEdDX2FsbG9jYXRlZCB8IDE7CmRpZmYgLS1naXQg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AIC00NTQsNyArNDU0LDcgQEAgc3RhdGljIGxvbmcgbWVtb3J5X2V4Y2hhbmdlKFhFTl9HVUVT
VF9IQU5ETEVfUEFSQU0oeGVuX21lbW9yeV9leGNoYW5nZV90KSBhcmcpCiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIChqICogKDFVTCA8PCBleGNoLm91dC5leHRlbnRfb3JkZXIpKSk7CiAK
ICAgICAgICAgICAgICAgICBzcGluX2xvY2soJmQtPnBhZ2VfYWxsb2NfbG9jayk7Ci0gICAgICAg
ICAgICAgICAgZC0+dG90X3BhZ2VzIC09IGRlY19jb3VudDsKKyAgICAgICAgICAgICAgICBkb21h
aW5fYWRqdXN0X3RvdF9wYWdlcyhkLCAtZGVjX2NvdW50KTsKICAgICAgICAgICAgICAgICBkcm9w
X2RvbV9yZWYgPSAoZGVjX2NvdW50ICYmICFkLT50b3RfcGFnZXMpOwogICAgICAgICAgICAgICAg
IHNwaW5fdW5sb2NrKCZkLT5wYWdlX2FsbG9jX2xvY2spOwogCkBAIC02ODUsNiArNjg1LDM3IEBA
IGxvbmcgZG9fbWVtb3J5X29wKHVuc2lnbmVkIGxvbmcgY21kLCBYRU5fR1VFU1RfSEFORExFX1BB
UkFNKHZvaWQpIGFyZykKICAgICAgICAgYnJlYWs7CiAgICAgfQogCisgICAgY2FzZSBYRU5NRU1f
Y2xhaW1fcGFnZXM6CisgICAgICAgIGlmICggIUlTX1BSSVYoY3VycmVudC0+ZG9tYWluKSApCisg
ICAgICAgICAgICByZXR1cm4gLUVQRVJNOworCisgICAgICAgIGlmICggY29weV9mcm9tX2d1ZXN0
KCZyZXNlcnZhdGlvbiwgYXJnLCAxKSApCisgICAgICAgICAgICByZXR1cm4gLUVGQVVMVDsKKwor
ICAgICAgICBpZiAoICFndWVzdF9oYW5kbGVfaXNfbnVsbChyZXNlcnZhdGlvbi5leHRlbnRfc3Rh
cnQpICkKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworCisgICAgICAgIGl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3NjaGVkLmggYi94ZW4vaW5jbHVkZS94ZW4vc2NoZWQu
aAppbmRleCA2YzU1MDM5Li40ODBlZjM5IDEwMDY0NAotLS0gYS94ZW4vaW5jbHVkZS94ZW4vc2No
ZWQuaAorKysgYi94ZW4vaW5jbHVkZS94ZW4vc2NoZWQuaApAQCAtMjQyLDYgKzI0Miw3IEBAIHN0
cnVjdCBkb21haW4KICAgICBzdHJ1Y3QgcGFnZV9saXN0X2hlYWQgcGFnZV9saXN0OyAgLyogbGlu
a2VkIGxpc3QgKi8KICAgICBzdHJ1Y3QgcGFnZV9saXN0X2hlYWQgeGVucGFnZV9saXN0OyAvKiBs
aW5rZWQgbGlzdCAoc2l6ZSB4ZW5oZWFwX3BhZ2VzKSAqLwogICAgIHVuc2lnbmVkIGludCAgICAg
dG90X3BhZ2VzOyAgICAgICAvKiBudW1iZXIgb2YgcGFnZXMgY3VycmVudGx5IHBvc3Nlc2VkICov
CisgICAgdW5zaWduZWQgaW50ICAgICB1bmNsYWltZWRfcGFnZXM7IC8qIHBhZ2VzIGNsYWltZWQg
YnV0IG5vdCBwb3NzZXNzZWQgICAgKi8KICAgICB1bnNpZ25lZCBpbnQgICAgIG1heF9wYWdlczsg
ICAgICAgLyogbWF4aW11bSB2YWx1ZSBmb3IgdG90X3BhZ2VzICAgICAgICAqLwogICAgIGF0b21p
Y190ICAgICAgICAgc2hyX3BhZ2VzOyAgICAgICAvKiBudW1iZXIgb2Ygc2hhcmVkIHBhZ2VzICAg
ICAgICAgICAgICovCiAgICAgYXRvbWljX3QgICAgICAgICBwYWdlZF9wYWdlczsgICAgIC8qIG51
bWJlciBvZiBwYWdlZC1vdXQgcGFnZXMgICAgICAgICAgKi8K
--__1354117825940119786abhmt101.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__1354117825940119786abhmt101.oracle.com--


From xen-devel-bounces@lists.xen.org Wed Nov 28 15:50:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:50:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdjuG-00077U-P5; Wed, 28 Nov 2012 15:50:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TdjuF-00077N-Bi
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:50:35 +0000
Received: from [85.158.139.211:30107] by server-9.bemta-5.messagelabs.com id
	27/AE-29295-AC236B05; Wed, 28 Nov 2012 15:50:34 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354117831!18247887!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODE1MjA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32335 invoked from network); 28 Nov 2012 15:50:33 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 15:50:33 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASFoRYF016324
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 15:50:27 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASFoQeP019418
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 15:50:26 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASFoQfs021092; Wed, 28 Nov 2012 09:50:26 -0600
MIME-Version: 1.0
Message-ID: <cd59ddd0-be45-47e3-b762-a5d630c2df43@default>
Date: Wed, 28 Nov 2012 07:50:22 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__1354117825940119786abhmt101.oracle.com"
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: Andres Lagar-Cavilla <andreslc@gridcentric.ca>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, Matthew Daley <mattjd@gmail.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH v8 1/2] hypervisor: XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__1354117825940119786abhmt101.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This is patch 1of2 of an eighth cut of the patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account review
feedback from Jan and Keir and IanC and Matthew Daley, plus some
fixes found via runtime debugging (using printk and privcmd only).

v7->v8:
- Replace missing tot_pages adjustment [JBeulich]
- Combine domain_inc/dec_tot_pages into one function [JBeulich]
- Added a few more clarifying comments [djm]

v6->v7:
- Need co-existence with low_mem_virq [JBeulich]

v5->v6:
- Fix post-inc problem [mattjd]

v4->v5:
- Split tools part into separate patch [JBeulich]
- Minor coding style fixups [JBeulich]
- Use rcu_lock_domain_by_id, not _target version [JBeulich]

v3->v4: (please ignore v3)
- Process error, sent stale patch, sorry [djm]

v2->v3:
- Add per-domain and global "get" for unclaimed info [JBeulich]
- New hypercall(s) should fail for unpriv callers [IanC]
- Non-zero extent_order disallowed [JBeulich]
- Remove bonehead ASSERTs [JBeulich]
- Need not hold heaplock for decrease case too [JBeulich]
- More descriptive failure return values [JBeulich]
- Don't allow a claim to exceed max_pages [IanC]
- Subops must be in correct ifdef block in memory.c [keir]

v1->v2:
- Add reset-to-zero page claim in domain_kill [JBeulich]
- Proper handling of struct passed to hypercall [JBeulich]
- Fix alloc_heap_pages when a domain has a claim [JBeulich]
- Need not hold heap_lock if !d->unclaimed_pages [keir]
- Fix missed tot_pages call in donate_page [djm]
- Remove domain_reset_unclaimed_pages; use set with zero [djm]
- Bugfixes found through testing in set_unclaimed [djm]
- More comments in code [djm]
- Code formatting fixes [djm]

=3D=3D=3D

Motivation:

The goal of this hypercall is to attempt to atomically and very
quickly determine if there are sufficient pages available in the
system and, if so, "set aside" that quantity of pages for future
allocations by that domain.  Unlike an existing hypercall such as
increase_reservation or populate_physmap, specific physical
pageframes are not assigned to the domain because this
cannot be done sufficiently quickly (especially for very large
allocations in an arbitrarily fragmented system) and so the
existing mechanisms result in classic time-of-check-time-of-use
(TOCTOU) races.  One can think of claiming as similar to a
"lazy" allocation, but subsequent hypercalls are required
to do the actual physical pageframe allocation.

In order for a toolstack to "get" information about whether
a domain has a claim and, if so, how large, and also for
the toolstack to measure the total system-wide claim, a
second subop has been added and exposed through domctl
and libxl (see PATCH 2/2).

Note that this patchset does not include a full toolstack
implementation, in part because Oracle uses xm/xend and a
proprietary toolstack.  The following pseudo-code describes
the proposed claim-based use model, which could easily be
implemented as an xl option such as "xl create --claim".

Current:
- call populate_physmap repeatedly to achieve mem=3DN memory
- if any populate_physmap call fails, report -ENOMEM up the stack
- memory is held until domain dies or the toolstack decreases it

Proposed:
- call claim for mem=3DN amount of memory
- if claim succeeds:
    call populate_physmap repeatedly to achieve mem=3DN memory (failsafe)
  else
    report -ENOMEM up the stack
- claim is held until mem=3DN is achieved or the domain dies or
   the toolstack changes it to 0
- memory is held until domain dies or the toolstack decreases it

It has been noted that this claim mechanism solves the
underlying problem (slow failure of domain creation) for
a large class of domains but not all, specifically not
handling (but also not making the problem worse for) PV
domains that specify the "superpages" flag, and 32-bit PV
domains on large RAM systems.  These may be addressed at a
later time.

Code overview:

Though the hypercall simply does arithmetic within locks,
some of the semantics in the code may be a bit subtle
so let me explain a bit.

The key variables (d->unclaimed_pages and total_unclaimed_pages)
start at zero if no claim has yet been staked for any domain.
(Perhaps a better name is "claimed_but_not_yet_possessed" but that's
a bit unwieldy.)  If no claim hypercalls are executed, there
should be no impact on existing usage.

When a claim is successfully staked by a domain, it is like a
watermark but there is no record kept of the size of the claim.
Instead, d->unclaimed_pages is set to the difference between
d->tot_pages and the claim.  When d->tot_pages increases or decreases,
d->unclaimed_pages atomically decreases or increases.  Once
d->unclaimed_pages reaches zero, the claim is satisfied and
d->unclaimed pages stays at zero -- unless a new claim is
subsequently staked.

The systemwide variable total_unclaimed_pages is always the sum
of d->unclaimed_pages, across all domains.  A non-domain-
specific heap allocation will fail if total_unclaimed_pages
exceeds free (plus, on tmem enabled systems, freeable) pages.

Claim semantics may be modified by flags.  The initial
implementation has one flag, which discerns whether the
caller would like tmem freeable pages to be considered
in determining whether or not the claim can be successfully
staked. Future flags may, for example, specify that the
caller would like the claim to be successful only if there
are sufficient pages available on a single node (per Dario's
suggestion).

A claim can be cancelled by requesting a claim of zero pages.

A second subop returns the total outstanding claimed pages
systemwide.

Note: Save/restore/migrate may need to be modified,
else it can be documented that all claims are cancelled.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 arch/x86/mm.c             |    2=20
 arch/x86/mm/mem_sharing.c |    4 -
 common/domain.c           |    1=20
 common/domctl.c           |    1=20
 common/grant_table.c      |    2=20
 common/memory.c           |   33 ++++++++++++-
 common/page_alloc.c       |  114 +++++++++++++++++++++++++++++++++++++++++=
+++--
 include/public/domctl.h   |    3 -
 include/public/memory.h   |   39 +++++++++++++++
 include/xen/mm.h          |    6 ++
 include/xen/sched.h       |    1=20
 11 files changed, 197 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fad3d33..480edf7 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3841,7 +3841,7 @@ int donate_page(
     {
         if ( d->tot_pages >=3D d->max_pages )
             goto fail;
-        d->tot_pages++;
+        domain_adjust_tot_pages(d, 1);
     }
=20
     page->count_info =3D PGC_allocated | 1;
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..e91aac5 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d,
     }
=20
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_adjust_tot_pages(d, -1);
     drop_dom_ref =3D (d->tot_pages =3D=3D 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct p=
age_info *page)
     ASSERT(page_get_owner(page) =3D=3D dom_cow);
     page_set_owner(page, d);
=20
-    if ( d->tot_pages++ =3D=3D 0 )
+    if ( domain_adjust_tot_pages(d, 1) =3D=3D 1 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 12c8e24..f2cc4f5 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -492,6 +492,7 @@ int domain_kill(struct domain *d)
         evtchn_destroy(d);
         gnttab_release_mappings(d);
         tmem_destroy(d->tmem);
+        domain_set_unclaimed_pages(d, 0, 0);
         d->tmem =3D NULL;
         /* fallthrough */
     case DOMDYING_dying:
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index a7a6b9f..e47a991 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -154,6 +154,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_=
getdomaininfo *info)
=20
     info->tot_pages         =3D d->tot_pages;
     info->max_pages         =3D d->max_pages;
+    info->unclaimed_pages   =3D d->unclaimed_pages;
     info->shr_pages         =3D atomic_read(&d->shr_pages);
     info->paged_pages       =3D atomic_read(&d->paged_pages);
     info->shared_info_frame =3D mfn_to_gmfn(d, __pa(d->shared_info)>>PAGE_=
SHIFT);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..ca8d861 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1656,7 +1656,7 @@ gnttab_transfer(
         }
=20
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ =3D=3D 0) )
+        if ( unlikely(domain_adjust_tot_pages(e, 1) =3D=3D 1) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..8efa6a3 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_=
memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
=20
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -=3D dec_count;
+                domain_adjust_tot_pages(d, -dec_count);
                 drop_dom_ref =3D (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
=20
@@ -685,6 +685,37 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_=
PARAM(void) arg)
         break;
     }
=20
+    case XENMEM_claim_pages:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+
+        if ( copy_from_guest(&reservation, arg, 1) )
+            return -EFAULT;
+
+        if ( !guest_handle_is_null(reservation.extent_start) )
+            return -EINVAL;
+
+        if ( reservation.extent_order !=3D 0 )
+            return -EINVAL;
+
+        d =3D rcu_lock_domain_by_id(reservation.domid);
+        if ( d =3D=3D NULL )
+            return -EINVAL;
+
+        rc =3D domain_set_unclaimed_pages(d, reservation.nr_extents,
+                                        reservation.mem_flags);
+
+        rcu_unlock_domain(d);
+
+        break;
+
+    case XENMEM_get_unclaimed_pages:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+
+        rc =3D get_total_unclaimed_pages();
+        break;
+
     default:
         rc =3D arch_memory_op(op, arg);
         break;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 15ebc66..bb3e346 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -238,6 +238,105 @@ static long midsize_alloc_zone_pages;
 #define MIDSIZE_ALLOC_FRAC 128
=20
 static DEFINE_SPINLOCK(heap_lock);
+static long total_unclaimed_pages; /* total outstanding claims by all doma=
ins */
+
+unsigned long domain_adjust_tot_pages(struct domain *d, long pages)
+{
+    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
+
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    /*
+     * can test d->claimed_pages race-free because it can only change
+     * if d->page_alloc_lock and heap_lock are both held, see also
+     * domain_set_unclaimed_pages below
+     */
+    if ( !d->unclaimed_pages )
+        return d->tot_pages +=3D pages;
+    spin_lock(&heap_lock);
+    d->tot_pages +=3D pages;
+    /* adjust domain unclaimed_pages; may not go negative */
+    dom_before =3D d->unclaimed_pages;
+    dom_after =3D dom_before - pages;
+    if ( (dom_before > 0) && (dom_after < 0) )
+        dom_claimed =3D 0;
+    else
+        dom_claimed =3D dom_after;
+    d->unclaimed_pages =3D dom_claimed;
+    /* flag accounting bug if system unclaimed_pages would go negative */
+    sys_before =3D total_unclaimed_pages;
+    sys_after =3D sys_before - (dom_before - dom_claimed);
+    BUG_ON((sys_before > 0) && (sys_after < 0));
+    total_unclaimed_pages =3D sys_after;
+    spin_unlock(&heap_lock);
+    return d->tot_pages;
+}
+
+int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
+                                unsigned long flags)
+{
+    int ret =3D -ENOMEM;
+    unsigned long claim, avail_pages;
+
+    /*
+     * take the domain's page_alloc_lock, else all d->tot_page adjustments
+     * must always take the global heap_lock rather than only in the much
+     * rarer case that d->unclaimed_pages is non-zero
+     */
+    spin_lock(&d->page_alloc_lock);
+    spin_lock(&heap_lock);
+
+    /* pages=3D=3D0 means "unset" the claim (and flags is ignored) */
+    if ( pages =3D=3D 0 )
+    {
+        total_unclaimed_pages -=3D d->unclaimed_pages;
+        d->unclaimed_pages =3D 0;
+        ret =3D 0;
+        goto out;
+    }
+
+    /* only one active claim per domain please */
+    if ( d->unclaimed_pages )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* disallow a claim not exceeding current tot_pages or above max_pages=
 */
+    if ( (pages <=3D d->tot_pages) || (pages > d->max_pages) )
+    {
+        ret =3D -EINVAL;
+        goto out;
+    }
+
+    /* how much memory is available? */
+    avail_pages =3D total_avail_pages;
+    if ( !(flags & XENMEM_CLAIMF_free_only) )
+        avail_pages +=3D tmem_freeable_pages();
+    avail_pages -=3D total_unclaimed_pages;
+
+    /*
+     * note, if domain has already allocated memory before making a claim=
=20
+     * then the claim must take tot_pages into account
+     */
+    claim =3D pages - d->tot_pages;
+    if ( claim > avail_pages )
+        goto out;
+
+    /* yay, claim fits in available memory, stake the claim, success! */
+    d->unclaimed_pages =3D claim;
+    total_unclaimed_pages +=3D d->unclaimed_pages;
+    ret =3D 0;
+
+out:
+    spin_unlock(&heap_lock);
+    spin_unlock(&d->page_alloc_lock);
+    return ret;
+}
+
+long get_total_unclaimed_pages(void)
+{
+    return total_unclaimed_pages;
+}
=20
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
@@ -374,7 +473,7 @@ static void __init setup_low_mem_virq(void)
 static void check_low_mem_virq(void)
 {
     unsigned long avail_pages =3D total_avail_pages +
-        (opt_tmem ? tmem_freeable_pages() : 0);
+        (opt_tmem ? tmem_freeable_pages() : 0) - total_unclaimed_pages;
=20
     if ( unlikely(avail_pages <=3D low_mem_virq_th) )
     {
@@ -443,6 +542,15 @@ static struct page_info *alloc_heap_pages(
     spin_lock(&heap_lock);
=20
     /*
+     * Claimed memory is considered unavailable unless the request
+     * is made by a domain with sufficient unclaimed pages.
+     */
+    if ( (total_unclaimed_pages + request >
+          total_avail_pages + tmem_freeable_pages()) &&
+          (d =3D=3D NULL || d->unclaimed_pages < request) )
+        goto not_found;
+
+    /*
      * TMEM: When available memory is scarce due to tmem absorbing it, all=
ow
      * only mid-size allocations to avoid worst of fragmentation issues.
      * Others try tmem pools then fail.  This is a workaround until all
@@ -1291,7 +1399,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages =3D=3D 0) )
             get_knownalive_domain(d);
=20
-        d->tot_pages +=3D 1 << order;
+        domain_adjust_tot_pages(d, 1 << order);
     }
=20
     for ( i =3D 0; i < (1 << order); i++ )
@@ -1375,7 +1483,7 @@ void free_domheap_pages(struct page_info *pg, unsigne=
d int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
=20
-        d->tot_pages -=3D 1 << order;
+        domain_adjust_tot_pages(d, -(1 << order));
         drop_dom_ref =3D (d->tot_pages =3D=3D 0);
=20
         spin_unlock_recursive(&d->page_alloc_lock);
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 7c0f23d..5735c28 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -36,7 +36,7 @@
 #include "grant_table.h"
 #include "hvm/save.h"
=20
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000009
=20
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -95,6 +95,7 @@ struct xen_domctl_getdomaininfo {
     uint32_t flags;              /* XEN_DOMINF_* */
     uint64_aligned_t tot_pages;
     uint64_aligned_t max_pages;
+    uint64_aligned_t unclaimed_pages;
     uint64_aligned_t shr_pages;
     uint64_aligned_t paged_pages;
     uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index f1ddbc0..15d6c72 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -68,6 +68,8 @@ struct xen_memory_reservation {
      *   IN:  GPFN bases of extents to populate with memory
      *   OUT: GMFN bases of extents that were allocated
      *   (NB. This command also updates the mach_to_phys translation table=
)
+     * XENMEM_claim_pages:
+     *   IN: must be zero
      */
     XEN_GUEST_HANDLE(xen_pfn_t) extent_start;
=20
@@ -421,6 +423,43 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
=20
+/*
+ * Attempt to stake a claim for a domain on a quantity of pages
+ * of system RAM, but _not_ assign specific pageframes.  Only
+ * arithmetic is performed so the hypercall is very fast and need
+ * not be preemptible, thus sidestepping time-of-check-time-of-use
+ * races for memory allocation.  Returns 0 if the hypervisor page
+ * allocator has atomically and successfully claimed the requested
+ * number of pages, else non-zero.
+ *
+ * Any domain may have only one active claim.  When sufficient memory
+ * has been allocated to resolve the claim, the claim silently expires.
+ * Claiming zero pages effectively resets any outstanding claim and
+ * is always successful.
+ *
+ * Note that a valid claim may be staked even after memory has been
+ * allocated for a domain.  In this case, the claim is not incremental,
+ * i.e. if the domain's tot_pages is 3, and a claim is staked for 10,
+ * only 7 additional pages are claimed.
+ *
+ * Caller must be privileged or the hypercall fails.
+ */
+#define XENMEM_claim_pages                  24
+/*
+ * XENMEM_claim_pages flags:
+ *  free_only: claim is successful only if sufficient free pages
+ *    are available.  If not set and tmem is enabled, hypervisor
+ *    may also consider tmem "freeable" pages to satisfy the claim.
+ */
+#define _XENMEM_CLAIMF_free_only            0
+#define XENMEM_CLAIMF_free_only             (1U<<_XENMEM_CLAIMF_free_only)
+/*
+ * Get the number of pages currently claimed (but not yet "possessed")
+ * across all domains.  The caller must be privileged but otherwise
+ * the call never fails.=20
+ */
+#define XENMEM_get_unclaimed_pages            25
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
=20
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 64a0cc1..86351d0 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,12 @@ void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
=20
+/* Claim handling */
+unsigned long domain_adjust_tot_pages(struct domain *d, long pages);
+int domain_set_unclaimed_pages(
+    struct domain *d, unsigned long pages, unsigned long flags);
+long get_total_unclaimed_pages(void);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..480ef39 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -242,6 +242,7 @@ struct domain
     struct page_list_head page_list;  /* linked list */
     struct page_list_head xenpage_list; /* linked list (size xenheap_pages=
) */
     unsigned int     tot_pages;       /* number of pages currently possese=
d */
+    unsigned int     unclaimed_pages; /* pages claimed but not possessed  =
  */
     unsigned int     max_pages;       /* maximum value for tot_pages      =
  */
     atomic_t         shr_pages;       /* number of shared pages           =
  */
     atomic_t         paged_pages;     /* number of paged-out pages        =
  */

--__1354117825940119786abhmt101.oracle.com
Content-Type: application/octet-stream; name="claim-121128-hyp.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-121128-hyp.patch"

ZGlmZiAtLWdpdCBhL3hlbi9hcmNoL3g4Ni9tbS5jIGIveGVuL2FyY2gveDg2L21tLmMKaW5kZXgg
ZmFkM2QzMy4uNDgwZWRmNyAxMDA2NDQKLS0tIGEveGVuL2FyY2gveDg2L21tLmMKKysrIGIveGVu
L2FyY2gveDg2L21tLmMKQEAgLTM4NDEsNyArMzg0MSw3IEBAIGludCBkb25hdGVfcGFnZSgKICAg
ICB7CiAgICAgICAgIGlmICggZC0+dG90X3BhZ2VzID49IGQtPm1heF9wYWdlcyApCiAgICAgICAg
ICAgICBnb3RvIGZhaWw7Ci0gICAgICAgIGQtPnRvdF9wYWdlcysrOworICAgICAgICBkb21haW5f
YWRqdXN0X3RvdF9wYWdlcyhkLCAxKTsKICAgICB9CiAKICAgICBwYWdlLT5jb3VudF9pbmZvID0g
UEdDX2FsbG9jYXRlZCB8IDE7CmRpZmYgLS1naXQgYS94ZW4vYXJjaC94ODYvbW0vbWVtX3NoYXJp
bmcuYyBiL3hlbi9hcmNoL3g4Ni9tbS9tZW1fc2hhcmluZy5jCmluZGV4IDUxMDMyODUuLmU5MWFh
YzUgMTAwNjQ0Ci0tLSBhL3hlbi9hcmNoL3g4Ni9tbS9tZW1fc2hhcmluZy5jCisrKyBiL3hlbi9h
cmNoL3g4Ni9tbS9tZW1fc2hhcmluZy5jCkBAIC02MzksNyArNjM5LDcgQEAgc3RhdGljIGludCBw
YWdlX21ha2Vfc2h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Ag
ICAgICAgICAgZC0+dG90X3BhZ2VzIC09IGRlY19jb3VudDsKKyAgICAgICAgICAgICAgICBkb21h
aW5fYWRqdXN0X3RvdF9wYWdlcyhkLCAtZGVjX2NvdW50KTsKICAgICAgICAgICAgICAgICBkcm9w
X2RvbV9yZWYgPSAoZGVjX2NvdW50ICYmICFkLT50b3RfcGFnZXMpOwogICAgICAgICAgICAgICAg
IHNwaW5fdW5sb2NrKCZkLT5wYWdlX2FsbG9jX2xvY2spOwogCkBAIC02ODUsNiArNjg1LDM3IEBA
IGxvbmcgZG9fbWVtb3J5X29wKHVuc2lnbmVkIGxvbmcgY21kLCBYRU5fR1VFU1RfSEFORExFX1BB
UkFNKHZvaWQpIGFyZykKICAgICAgICAgYnJlYWs7CiAgICAgfQogCisgICAgY2FzZSBYRU5NRU1f
Y2xhaW1fcGFnZXM6CisgICAgICAgIGlmICggIUlTX1BSSVYoY3VycmVudC0+ZG9tYWluKSApCisg
ICAgICAgICAgICByZXR1cm4gLUVQRVJNOworCisgICAgICAgIGlmICggY29weV9mcm9tX2d1ZXN0
KCZyZXNlcnZhdGlvbiwgYXJnLCAxKSApCisgICAgICAgICAgICByZXR1cm4gLUVGQVVMVDsKKwor
ICAgICAgICBpZiAoICFndWVzdF9oYW5kbGVfaXNfbnVsbChyZXNlcnZhdGlvbi5leHRlbnRfc3Rh
cnQpICkKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworCisgICAgICAgIGlmICggcmVzZXJ2
YXRpb24uZXh0ZW50X29yZGVyICE9IDAgKQorICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisK
KyAgICAgICAgZCA9IHJjdV9sb2NrX2RvbWFpbl9ieV9pZChyZXNlcnZhdGlvbi5kb21pZCk7Cisg
ICAgICAgIGlmICggZCA9PSBOVUxMICkKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworCisg
ICAgICAgIHJjID0gZG9tYWluX3NldF91bmNsYWltZWRfcGFnZXMoZCwgcmVzZX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i8KICAgICBzdHJ1Y3QgcGFnZV9saXN0X2hlYWQgeGVucGFnZV9saXN0OyAvKiBs
aW5rZWQgbGlzdCAoc2l6ZSB4ZW5oZWFwX3BhZ2VzKSAqLwogICAgIHVuc2lnbmVkIGludCAgICAg
dG90X3BhZ2VzOyAgICAgICAvKiBudW1iZXIgb2YgcGFnZXMgY3VycmVudGx5IHBvc3Nlc2VkICov
CisgICAgdW5zaWduZWQgaW50ICAgICB1bmNsYWltZWRfcGFnZXM7IC8qIHBhZ2VzIGNsYWltZWQg
YnV0IG5vdCBwb3NzZXNzZWQgICAgKi8KICAgICB1bnNpZ25lZCBpbnQgICAgIG1heF9wYWdlczsg
ICAgICAgLyogbWF4aW11bSB2YWx1ZSBmb3IgdG90X3BhZ2VzICAgICAgICAqLwogICAgIGF0b21p
Y190ICAgICAgICAgc2hyX3BhZ2VzOyAgICAgICAvKiBudW1iZXIgb2Ygc2hhcmVkIHBhZ2VzICAg
ICAgICAgICAgICovCiAgICAgYXRvbWljX3QgICAgICAgICBwYWdlZF9wYWdlczsgICAgIC8qIG51
bWJlciBvZiBwYWdlZC1vdXQgcGFnZXMgICAgICAgICAgKi8K
--__1354117825940119786abhmt101.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__1354117825940119786abhmt101.oracle.com--


From xen-devel-bounces@lists.xen.org Wed Nov 28 15:50:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:50:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdjuO-00078J-BR; Wed, 28 Nov 2012 15:50:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TdjuM-000787-Gx
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:50:42 +0000
Received: from [85.158.143.35:32748] by server-1.bemta-4.messagelabs.com id
	66/EC-27934-1D236B05; Wed, 28 Nov 2012 15:50:41 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1354117837!14013476!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA5MDgxNQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21145 invoked from network); 28 Nov 2012 15:50:39 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-15.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 15:50:39 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASFoWqf023795
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 15:50:33 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASFoVve000533
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 15:50:32 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASFoV0w021808; Wed, 28 Nov 2012 09:50:31 -0600
MIME-Version: 1.0
Message-ID: <db0ca196-c76e-400d-b593-e5d166f55b15@default>
Date: Wed, 28 Nov 2012 07:50:29 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__1354117831360119794abhmt101.oracle.com"
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Andres Lagar-Cavilla <andreslc@gridcentric.ca>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, Matthew Daley <mattjd@gmail.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH v8 2/2] tools: XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__1354117831360119794abhmt101.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This is patch 2of2 of an eighth cut of the patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account
feedback from Jan and Keir and IanC and Matthew Daley.

As requested by Jan, this is a separate post of the tools
part of the patch.  NOTE: This patch must be applied after
the hypervisor part of the patchset or otherwise may break
the build!

v5->v8:
- no change in this patch (only in patch 1of2)

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 xc_domain.c |    1 +
 xenctrl.h   |    1 +
 2 files changed, 2 insertions(+)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index d98e68b..6d06f7c 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -234,6 +234,7 @@ int xc_domain_getinfo(xc_interface *xch,
=20
         info->ssidref  =3D domctl.u.getdomaininfo.ssidref;
         info->nr_pages =3D domctl.u.getdomaininfo.tot_pages;
+        info->nr_unclaimed_pages =3D domctl.u.getdomaininfo.unclaimed_page=
s;
         info->nr_shared_pages =3D domctl.u.getdomaininfo.shr_pages;
         info->nr_paged_pages =3D domctl.u.getdomaininfo.paged_pages;
         info->max_memkb =3D domctl.u.getdomaininfo.max_pages << (PAGE_SHIF=
T-10);
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..325f4a3 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -364,6 +364,7 @@ typedef struct xc_dominfo {
                   hvm:1, debugged:1;
     unsigned int  shutdown_reason; /* only meaningful if shutdown=3D=3D1 *=
/
     unsigned long nr_pages; /* current number, not maximum */
+    unsigned long nr_unclaimed_pages;
     unsigned long nr_shared_pages;
     unsigned long nr_paged_pages;
     unsigned long shared_info_frame;

--__1354117831360119794abhmt101.oracle.com
Content-Type: application/octet-stream; name="claim-121128-tools.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-121128-tools.patch"

ZGlmZiAtLWdpdCBhL3Rvb2xzL2xpYnhjL3hjX2RvbWFpbi5jIGIvdG9vbHMvbGlieGMveGNfZG9t
YWluLmMKaW5kZXggZDk4ZTY4Yi4uNmQwNmY3YyAxMDA2NDQKLS0tIGEvdG9vbHMvbGlieGMveGNf
ZG9tYWluLmMKKysrIGIvdG9vbHMvbGlieGMveGNfZG9tYWluLmMKQEAgLTIzNCw2ICsyMzQsNyBA
QCBpbnQgeGNfZG9tYWluX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lnbmVkIGxvbmcgbnJfdW5jbGFpbWVkX3Bh
Z2VzOwogICAgIHVuc2lnbmVkIGxvbmcgbnJfc2hhcmVkX3BhZ2VzOwogICAgIHVuc2lnbmVkIGxv
bmcgbnJfcGFnZWRfcGFnZXM7CiAgICAgdW5zaWduZWQgbG9uZyBzaGFyZWRfaW5mb19mcmFtZTsK
--__1354117831360119794abhmt101.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__1354117831360119794abhmt101.oracle.com--


From xen-devel-bounces@lists.xen.org Wed Nov 28 15:50:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:50:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdjuO-00078J-BR; Wed, 28 Nov 2012 15:50:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TdjuM-000787-Gx
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:50:42 +0000
Received: from [85.158.143.35:32748] by server-1.bemta-4.messagelabs.com id
	66/EC-27934-1D236B05; Wed, 28 Nov 2012 15:50:41 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1354117837!14013476!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA5MDgxNQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21145 invoked from network); 28 Nov 2012 15:50:39 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-15.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 15:50:39 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASFoWqf023795
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 15:50:33 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASFoVve000533
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 15:50:32 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASFoV0w021808; Wed, 28 Nov 2012 09:50:31 -0600
MIME-Version: 1.0
Message-ID: <db0ca196-c76e-400d-b593-e5d166f55b15@default>
Date: Wed, 28 Nov 2012 07:50:29 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>, TimDeegan
	<tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__1354117831360119794abhmt101.oracle.com"
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Andres Lagar-Cavilla <andreslc@gridcentric.ca>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, Matthew Daley <mattjd@gmail.com>,
	Konrad Wilk <konrad.wilk@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH v8 2/2] tools: XENMEM_claim_pages (subop of
 existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__1354117831360119794abhmt101.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This is patch 2of2 of an eighth cut of the patch of the proposed
XENMEM_claim_pages hypercall/subop, taking into account
feedback from Jan and Keir and IanC and Matthew Daley.

As requested by Jan, this is a separate post of the tools
part of the patch.  NOTE: This patch must be applied after
the hypervisor part of the patchset or otherwise may break
the build!

v5->v8:
- no change in this patch (only in patch 1of2)

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 xc_domain.c |    1 +
 xenctrl.h   |    1 +
 2 files changed, 2 insertions(+)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index d98e68b..6d06f7c 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -234,6 +234,7 @@ int xc_domain_getinfo(xc_interface *xch,
=20
         info->ssidref  =3D domctl.u.getdomaininfo.ssidref;
         info->nr_pages =3D domctl.u.getdomaininfo.tot_pages;
+        info->nr_unclaimed_pages =3D domctl.u.getdomaininfo.unclaimed_page=
s;
         info->nr_shared_pages =3D domctl.u.getdomaininfo.shr_pages;
         info->nr_paged_pages =3D domctl.u.getdomaininfo.paged_pages;
         info->max_memkb =3D domctl.u.getdomaininfo.max_pages << (PAGE_SHIF=
T-10);
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..325f4a3 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -364,6 +364,7 @@ typedef struct xc_dominfo {
                   hvm:1, debugged:1;
     unsigned int  shutdown_reason; /* only meaningful if shutdown=3D=3D1 *=
/
     unsigned long nr_pages; /* current number, not maximum */
+    unsigned long nr_unclaimed_pages;
     unsigned long nr_shared_pages;
     unsigned long nr_paged_pages;
     unsigned long shared_info_frame;

--__1354117831360119794abhmt101.oracle.com
Content-Type: application/octet-stream; name="claim-121128-tools.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="claim-121128-tools.patch"

ZGlmZiAtLWdpdCBhL3Rvb2xzL2xpYnhjL3hjX2RvbWFpbi5jIGIvdG9vbHMvbGlieGMveGNfZG9t
YWluLmMKaW5kZXggZDk4ZTY4Yi4uNmQwNmY3YyAxMDA2NDQKLS0tIGEvdG9vbHMvbGlieGMveGNf
ZG9tYWluLmMKKysrIGIvdG9vbHMvbGlieGMveGNfZG9tYWluLmMKQEAgLTIzNCw2ICsyMzQsNyBA
QCBpbnQgeGNfZG9tYWluX2dldGluZm8oeGNfaW50ZXJmYWNlICp4Y2gsCiAKICAgICAgICAgaW5m
by0+c3NpZHJlZiAgPSBkb21jdGwudS5nZXRkb21haW5pbmZvLnNzaWRyZWY7CiAgICAgICAgIGlu
Zm8tPm5yX3BhZ2VzID0gZG9tY3RsLnUuZ2V0ZG9tYWluaW5mby50b3RfcGFnZXM7CisgICAgICAg
IGluZm8tPm5yX3VuY2xhaW1lZF9wYWdlcyA9IGRvbWN0bC51LmdldGRvbWFpbmluZm8udW5jbGFp
bWVkX3BhZ2VzOwogICAgICAgICBpbmZvLT5ucl9zaGFyZWRfcGFnZXMgPSBkb21jdGwudS5nZXRk
b21haW5pbmZvLnNocl9wYWdlczsKICAgICAgICAgaW5mby0+bnJfcGFnZWRfcGFnZXMgPSBkb21j
dGwudS5nZXRkb21haW5pbmZvLnBhZ2VkX3BhZ2VzOwogICAgICAgICBpbmZvLT5tYXhfbWVta2Ig
PSBkb21jdGwudS5nZXRkb21haW5pbmZvLm1heF9wYWdlcyA8PCAoUEFHRV9TSElGVC0xMCk7CmRp
ZmYgLS1naXQgYS90b29scy9saWJ4Yy94ZW5jdHJsLmggYi90b29scy9saWJ4Yy94ZW5jdHJsLmgK
aW5kZXggN2ViNTc0My4uMzI1ZjRhMyAxMDA2NDQKLS0tIGEvdG9vbHMvbGlieGMveGVuY3RybC5o
CisrKyBiL3Rvb2xzL2xpYnhjL3hlbmN0cmwuaApAQCAtMzY0LDYgKzM2NCw3IEBAIHR5cGVkZWYg
c3RydWN0IHhjX2RvbWluZm8gewogICAgICAgICAgICAgICAgICAgaHZtOjEsIGRlYnVnZ2VkOjE7
CiAgICAgdW5zaWduZWQgaW50ICBzaHV0ZG93bl9yZWFzb247IC8qIG9ubHkgbWVhbmluZ2Z1bCBp
ZiBzaHV0ZG93bj09MSAqLwogICAgIHVuc2lnbmVkIGxvbmcgbnJfcGFnZXM7IC8qIGN1cnJlbnQg
bnVtYmVyLCBub3QgbWF4aW11bSAqLworICAgIHVuc2lnbmVkIGxvbmcgbnJfdW5jbGFpbWVkX3Bh
Z2VzOwogICAgIHVuc2lnbmVkIGxvbmcgbnJfc2hhcmVkX3BhZ2VzOwogICAgIHVuc2lnbmVkIGxv
bmcgbnJfcGFnZWRfcGFnZXM7CiAgICAgdW5zaWduZWQgbG9uZyBzaGFyZWRfaW5mb19mcmFtZTsK
--__1354117831360119794abhmt101.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__1354117831360119794abhmt101.oracle.com--


From xen-devel-bounces@lists.xen.org Wed Nov 28 15:51:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:51:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdjv9-0007Fk-Pj; Wed, 28 Nov 2012 15:51:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Tdjv7-0007Er-Ug
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:51:30 +0000
Received: from [193.109.254.147:20516] by server-6.bemta-14.messagelabs.com id
	D5/80-02788-FF236B05; Wed, 28 Nov 2012 15:51:27 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1354117860!8742812!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9953 invoked from network); 28 Nov 2012 15:51:00 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 15:51:00 -0000
Received: by mail-we0-f173.google.com with SMTP id z2so4029436wey.32
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 07:51:00 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=pDniJq72mc0Rm+CEOOnGa3sP3rAVHbWq8SdvPZO65uk=;
	b=bYRfHCacovGMvTMiqxxM4WK4cAwiU3ykAjeJo7TuZ9gpxEs7RXpp+/NHzAH0ImG6Jx
	zrQoSSD17B/l0iPRlopzYC+FKeCBx26wYEO3ThJ+JHRMIoUVE1UPQJ84mpdkzg4s87uo
	CtCL8reKsGZPdTN5dMf7Zi04Ghi8AnXNC4IXNeq1fxndJ9gBD/ar957arBLF3ClcyJ4i
	5Wcs/6TjSM8giUVTnjdnxbpS8Lqfp5zn/FA2k7QG3kftla6eC1VHKZ7FW0dHWfqjuzLC
	13zir0xXyJx12bhi3x8je2kkGjD1n4wxGAnHaiy9SY+Wta1NAYpTOHGqIu4l7Apc5ys/
	/01A==
Received: by 10.180.73.80 with SMTP id j16mr30232443wiv.5.1354117860048;
	Wed, 28 Nov 2012 07:51:00 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id bd7sm8472246wib.8.2012.11.28.07.50.58
	(version=SSLv3 cipher=OTHER); Wed, 28 Nov 2012 07:50:59 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 28 Nov 2012 15:50:51 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCDBE35B.53A8D%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] IOMMU: imply "verbose" from "debug"
Thread-Index: Ac3NgCQsSfF2iayCJUqKPf74kW6VoQ==
In-Reply-To: <50B62EAE02000078000AC2B7@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] IOMMU: imply "verbose" from "debug"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/2012 14:33, "Jan Beulich" <JBeulich@suse.com> wrote:

> I think that generally enabling debugging code without also enabling
> verbose output is rather pointless; if someone really wants this, they
> can always pass e.g. "iommu=debug,no-verbose".
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/drivers/passthrough/iommu.c
> +++ b/xen/drivers/passthrough/iommu.c
> @@ -92,7 +92,11 @@ static void __init parse_iommu_param(cha
>          else if ( !strcmp(s, "intremap") )
>              iommu_intremap = val;
>          else if ( !strcmp(s, "debug") )
> +        {
>              iommu_debug = val;
> +            if ( val )
> +                iommu_verbose = 1;
> +        }
>          else if ( !strcmp(s, "amd-iommu-perdev-intremap") )
>              amd_iommu_perdev_intremap = val;
>          else if ( !strcmp(s, "dom0-passthrough") )
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 15:51:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:51:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdjv9-0007Fk-Pj; Wed, 28 Nov 2012 15:51:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Tdjv7-0007Er-Ug
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:51:30 +0000
Received: from [193.109.254.147:20516] by server-6.bemta-14.messagelabs.com id
	D5/80-02788-FF236B05; Wed, 28 Nov 2012 15:51:27 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1354117860!8742812!1
X-Originating-IP: [74.125.82.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9953 invoked from network); 28 Nov 2012 15:51:00 -0000
Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com)
	(74.125.82.173)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 15:51:00 -0000
Received: by mail-we0-f173.google.com with SMTP id z2so4029436wey.32
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 07:51:00 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=pDniJq72mc0Rm+CEOOnGa3sP3rAVHbWq8SdvPZO65uk=;
	b=bYRfHCacovGMvTMiqxxM4WK4cAwiU3ykAjeJo7TuZ9gpxEs7RXpp+/NHzAH0ImG6Jx
	zrQoSSD17B/l0iPRlopzYC+FKeCBx26wYEO3ThJ+JHRMIoUVE1UPQJ84mpdkzg4s87uo
	CtCL8reKsGZPdTN5dMf7Zi04Ghi8AnXNC4IXNeq1fxndJ9gBD/ar957arBLF3ClcyJ4i
	5Wcs/6TjSM8giUVTnjdnxbpS8Lqfp5zn/FA2k7QG3kftla6eC1VHKZ7FW0dHWfqjuzLC
	13zir0xXyJx12bhi3x8je2kkGjD1n4wxGAnHaiy9SY+Wta1NAYpTOHGqIu4l7Apc5ys/
	/01A==
Received: by 10.180.73.80 with SMTP id j16mr30232443wiv.5.1354117860048;
	Wed, 28 Nov 2012 07:51:00 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id bd7sm8472246wib.8.2012.11.28.07.50.58
	(version=SSLv3 cipher=OTHER); Wed, 28 Nov 2012 07:50:59 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 28 Nov 2012 15:50:51 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCDBE35B.53A8D%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] IOMMU: imply "verbose" from "debug"
Thread-Index: Ac3NgCQsSfF2iayCJUqKPf74kW6VoQ==
In-Reply-To: <50B62EAE02000078000AC2B7@nat28.tlf.novell.com>
Mime-version: 1.0
Subject: Re: [Xen-devel] [PATCH] IOMMU: imply "verbose" from "debug"
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/2012 14:33, "Jan Beulich" <JBeulich@suse.com> wrote:

> I think that generally enabling debugging code without also enabling
> verbose output is rather pointless; if someone really wants this, they
> can always pass e.g. "iommu=debug,no-verbose".
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/drivers/passthrough/iommu.c
> +++ b/xen/drivers/passthrough/iommu.c
> @@ -92,7 +92,11 @@ static void __init parse_iommu_param(cha
>          else if ( !strcmp(s, "intremap") )
>              iommu_intremap = val;
>          else if ( !strcmp(s, "debug") )
> +        {
>              iommu_debug = val;
> +            if ( val )
> +                iommu_verbose = 1;
> +        }
>          else if ( !strcmp(s, "amd-iommu-perdev-intremap") )
>              amd_iommu_perdev_intremap = val;
>          else if ( !strcmp(s, "dom0-passthrough") )
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 15:51:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:51:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdjvB-0007GE-6G; Wed, 28 Nov 2012 15:51:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Tdjv9-0007FR-CL
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:51:31 +0000
Received: from [85.158.139.83:60362] by server-5.bemta-5.messagelabs.com id
	66/2C-11353-20336B05; Wed, 28 Nov 2012 15:51:30 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1354117889!27530225!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18824 invoked from network); 28 Nov 2012 15:51:29 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-5.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 15:51:29 -0000
Received: by mail-wg0-f51.google.com with SMTP id ei8so4600480wgb.32
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 07:51:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=ewTDi4EiN1x5hbuxeQj88Ht8FRE84BoFWFM1ummbCF8=;
	b=kzn7eEcqf3tMTjxbYY6TEXv50/zB7tmXDQUQ1zQMP2UoP6bY3iaF7fv/hHbMeD838D
	nUv7Ziw+QAiQ2K4+qzfXCn1FFJZJUaQskgWqnezgj1y/0Q8KH8zbw5wokyjNbaQe0i8q
	G5/jsr8fyXX6Yx3h5JBIvBXXvjN5wxKJDroWzoA4xYrQvyyW4Vn9/3B8nMIG4t/80Dc0
	ZH3IijZ663egB6J0wJwgX/PDhZyk7cKpJdrzoEqTKykr5Ye+ATvcZDehJ3iwkgG0Uzl2
	rxf2QJT3tOiEjXOB6bjar1CBcWony4ybkGV1thNWQMX7VoBiEtMNWfl1iqhPCVeSwm1/
	Jsuw==
Received: by 10.216.141.141 with SMTP id g13mr7054457wej.95.1354117889496;
	Wed, 28 Nov 2012 07:51:29 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id b1sm8476254wix.11.2012.11.28.07.51.27
	(version=SSLv3 cipher=OTHER); Wed, 28 Nov 2012 07:51:28 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 28 Nov 2012 15:51:24 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCDBE37C.53A8E%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] VT-d: make scope parsing code type safe
Thread-Index: Ac3NgDfXsWQTndbAnEe9jg4u4qAA3A==
In-Reply-To: <50B62E9802000078000AC2B3@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] VT-d: make scope parsing code type safe
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/2012 14:32, "Jan Beulich" <JBeulich@suse.com> wrote:

> Rather than requiring the scopes to be the first members of their
> respective structures (so that casts can be used to switch between the
> different views), properly use types and container_of().
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Definitely an improvement.

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/drivers/passthrough/vtd/dmar.c
> +++ b/xen/drivers/passthrough/vtd/dmar.c
> @@ -304,13 +304,15 @@ static int __init scope_device_count(con
>  
>  
>  static int __init acpi_parse_dev_scope(
> -    const void *start, const void *end, void *acpi_entry, int type, u16 seg)
> +    const void *start, const void *end, struct dmar_scope *scope,
> +    int type, u16 seg)
>  {
> -    struct dmar_scope *scope = acpi_entry;
>      struct acpi_ioapic_unit *acpi_ioapic_unit;
>      const struct acpi_dmar_device_scope *acpi_scope;
>      u16 bus, sub_bus, sec_bus;
>      const struct acpi_dmar_pci_path *path;
> +    struct acpi_drhd_unit *drhd = type == DMAR_TYPE ?
> +        container_of(scope, struct acpi_drhd_unit, scope) : NULL;
>      int depth, cnt, didx = 0;
>  
>      if ( (cnt = scope_device_count(start, end)) < 0 )
> @@ -359,9 +361,8 @@ static int __init acpi_parse_dev_scope(
>                  dprintk(VTDPREFIX, " MSI HPET: %04x:%02x:%02x.%u\n",
>                          seg, bus, path->dev, path->fn);
>  
> -            if ( type == DMAR_TYPE )
> +            if ( drhd )
>              {
> -                struct acpi_drhd_unit *drhd = acpi_entry;
>                  struct acpi_hpet_unit *acpi_hpet_unit;
>  
>                  acpi_hpet_unit = xmalloc(struct acpi_hpet_unit);
> @@ -381,10 +382,8 @@ static int __init acpi_parse_dev_scope(
>                  dprintk(VTDPREFIX, " endpoint: %04x:%02x:%02x.%u\n",
>                          seg, bus, path->dev, path->fn);
>  
> -            if ( type == DMAR_TYPE )
> +            if ( drhd )
>              {
> -                struct acpi_drhd_unit *drhd = acpi_entry;
> -
>                  if ( (seg == 0) && (bus == 0) && (path->dev == 2) &&
>                       (path->fn == 0) )
>                      igd_drhd_address = drhd->address;
> @@ -397,9 +396,8 @@ static int __init acpi_parse_dev_scope(
>                  dprintk(VTDPREFIX, " IOAPIC: %04x:%02x:%02x.%u\n",
>                          seg, bus, path->dev, path->fn);
>  
> -            if ( type == DMAR_TYPE )
> +            if ( drhd )
>              {
> -                struct acpi_drhd_unit *drhd = acpi_entry;
>                  acpi_ioapic_unit = xmalloc(struct acpi_ioapic_unit);
>                  if ( !acpi_ioapic_unit )
>                      return -ENOMEM;
> @@ -463,7 +461,7 @@ acpi_parse_one_drhd(struct acpi_dmar_hea
>      dev_scope_start = (void *)(drhd + 1);
>      dev_scope_end = ((void *)drhd) + header->length;
>      ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
> -                               dmaru, DMAR_TYPE, drhd->segment);
> +                               &dmaru->scope, DMAR_TYPE, drhd->segment);
>  
>      if ( dmaru->include_all )
>      {
> @@ -590,7 +588,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_hea
>      dev_scope_start = (void *)(rmrr + 1);
>      dev_scope_end   = ((void *)rmrr) + header->length;
>      ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
> -                               rmrru, RMRR_TYPE, rmrr->segment);
> +                               &rmrru->scope, RMRR_TYPE, rmrr->segment);
>  
>      if ( ret || (rmrru->scope.devices_cnt == 0) )
>          xfree(rmrru);
> @@ -683,7 +681,7 @@ acpi_parse_one_atsr(struct acpi_dmar_hea
>          dev_scope_start = (void *)(atsr + 1);
>          dev_scope_end   = ((void *)atsr) + header->length;
>          ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
> -                                   atsru, ATSR_TYPE, atsr->segment);
> +                                   &atsru->scope, ATSR_TYPE, atsr->segment);
>      }
>      else
>      {
> --- a/xen/drivers/passthrough/vtd/dmar.h
> +++ b/xen/drivers/passthrough/vtd/dmar.h
> @@ -59,7 +59,7 @@ struct dmar_scope {
>  };
>  
>  struct acpi_drhd_unit {
> -    struct dmar_scope scope;            /* must be first member of struct */
> +    struct dmar_scope scope;
>      struct list_head list;
>      u64    address;                     /* register base address of the unit
> */
>      u16    segment;
> @@ -70,7 +70,7 @@ struct acpi_drhd_unit {
>  };
>  
>  struct acpi_rmrr_unit {
> -    struct dmar_scope scope;            /* must be first member of struct */
> +    struct dmar_scope scope;
>      struct list_head list;
>      u64    base_address;
>      u64    end_address;
> @@ -79,7 +79,7 @@ struct acpi_rmrr_unit {
>  };
>  
>  struct acpi_atsr_unit {
> -    struct dmar_scope scope;            /* must be first member of struct */
> +    struct dmar_scope scope;
>      struct list_head list;
>      u16    segment;
>      u8     all_ports:1;
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 15:51:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:51:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdjvB-0007GE-6G; Wed, 28 Nov 2012 15:51:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Tdjv9-0007FR-CL
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:51:31 +0000
Received: from [85.158.139.83:60362] by server-5.bemta-5.messagelabs.com id
	66/2C-11353-20336B05; Wed, 28 Nov 2012 15:51:30 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1354117889!27530225!1
X-Originating-IP: [74.125.82.51]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18824 invoked from network); 28 Nov 2012 15:51:29 -0000
Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com)
	(74.125.82.51)
	by server-5.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 15:51:29 -0000
Received: by mail-wg0-f51.google.com with SMTP id ei8so4600480wgb.32
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 07:51:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=ewTDi4EiN1x5hbuxeQj88Ht8FRE84BoFWFM1ummbCF8=;
	b=kzn7eEcqf3tMTjxbYY6TEXv50/zB7tmXDQUQ1zQMP2UoP6bY3iaF7fv/hHbMeD838D
	nUv7Ziw+QAiQ2K4+qzfXCn1FFJZJUaQskgWqnezgj1y/0Q8KH8zbw5wokyjNbaQe0i8q
	G5/jsr8fyXX6Yx3h5JBIvBXXvjN5wxKJDroWzoA4xYrQvyyW4Vn9/3B8nMIG4t/80Dc0
	ZH3IijZ663egB6J0wJwgX/PDhZyk7cKpJdrzoEqTKykr5Ye+ATvcZDehJ3iwkgG0Uzl2
	rxf2QJT3tOiEjXOB6bjar1CBcWony4ybkGV1thNWQMX7VoBiEtMNWfl1iqhPCVeSwm1/
	Jsuw==
Received: by 10.216.141.141 with SMTP id g13mr7054457wej.95.1354117889496;
	Wed, 28 Nov 2012 07:51:29 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id b1sm8476254wix.11.2012.11.28.07.51.27
	(version=SSLv3 cipher=OTHER); Wed, 28 Nov 2012 07:51:28 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Wed, 28 Nov 2012 15:51:24 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCDBE37C.53A8E%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] VT-d: make scope parsing code type safe
Thread-Index: Ac3NgDfXsWQTndbAnEe9jg4u4qAA3A==
In-Reply-To: <50B62E9802000078000AC2B3@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: xiantao.zhang@intel.com
Subject: Re: [Xen-devel] [PATCH] VT-d: make scope parsing code type safe
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/2012 14:32, "Jan Beulich" <JBeulich@suse.com> wrote:

> Rather than requiring the scopes to be the first members of their
> respective structures (so that casts can be used to switch between the
> different views), properly use types and container_of().
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Definitely an improvement.

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/drivers/passthrough/vtd/dmar.c
> +++ b/xen/drivers/passthrough/vtd/dmar.c
> @@ -304,13 +304,15 @@ static int __init scope_device_count(con
>  
>  
>  static int __init acpi_parse_dev_scope(
> -    const void *start, const void *end, void *acpi_entry, int type, u16 seg)
> +    const void *start, const void *end, struct dmar_scope *scope,
> +    int type, u16 seg)
>  {
> -    struct dmar_scope *scope = acpi_entry;
>      struct acpi_ioapic_unit *acpi_ioapic_unit;
>      const struct acpi_dmar_device_scope *acpi_scope;
>      u16 bus, sub_bus, sec_bus;
>      const struct acpi_dmar_pci_path *path;
> +    struct acpi_drhd_unit *drhd = type == DMAR_TYPE ?
> +        container_of(scope, struct acpi_drhd_unit, scope) : NULL;
>      int depth, cnt, didx = 0;
>  
>      if ( (cnt = scope_device_count(start, end)) < 0 )
> @@ -359,9 +361,8 @@ static int __init acpi_parse_dev_scope(
>                  dprintk(VTDPREFIX, " MSI HPET: %04x:%02x:%02x.%u\n",
>                          seg, bus, path->dev, path->fn);
>  
> -            if ( type == DMAR_TYPE )
> +            if ( drhd )
>              {
> -                struct acpi_drhd_unit *drhd = acpi_entry;
>                  struct acpi_hpet_unit *acpi_hpet_unit;
>  
>                  acpi_hpet_unit = xmalloc(struct acpi_hpet_unit);
> @@ -381,10 +382,8 @@ static int __init acpi_parse_dev_scope(
>                  dprintk(VTDPREFIX, " endpoint: %04x:%02x:%02x.%u\n",
>                          seg, bus, path->dev, path->fn);
>  
> -            if ( type == DMAR_TYPE )
> +            if ( drhd )
>              {
> -                struct acpi_drhd_unit *drhd = acpi_entry;
> -
>                  if ( (seg == 0) && (bus == 0) && (path->dev == 2) &&
>                       (path->fn == 0) )
>                      igd_drhd_address = drhd->address;
> @@ -397,9 +396,8 @@ static int __init acpi_parse_dev_scope(
>                  dprintk(VTDPREFIX, " IOAPIC: %04x:%02x:%02x.%u\n",
>                          seg, bus, path->dev, path->fn);
>  
> -            if ( type == DMAR_TYPE )
> +            if ( drhd )
>              {
> -                struct acpi_drhd_unit *drhd = acpi_entry;
>                  acpi_ioapic_unit = xmalloc(struct acpi_ioapic_unit);
>                  if ( !acpi_ioapic_unit )
>                      return -ENOMEM;
> @@ -463,7 +461,7 @@ acpi_parse_one_drhd(struct acpi_dmar_hea
>      dev_scope_start = (void *)(drhd + 1);
>      dev_scope_end = ((void *)drhd) + header->length;
>      ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
> -                               dmaru, DMAR_TYPE, drhd->segment);
> +                               &dmaru->scope, DMAR_TYPE, drhd->segment);
>  
>      if ( dmaru->include_all )
>      {
> @@ -590,7 +588,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_hea
>      dev_scope_start = (void *)(rmrr + 1);
>      dev_scope_end   = ((void *)rmrr) + header->length;
>      ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
> -                               rmrru, RMRR_TYPE, rmrr->segment);
> +                               &rmrru->scope, RMRR_TYPE, rmrr->segment);
>  
>      if ( ret || (rmrru->scope.devices_cnt == 0) )
>          xfree(rmrru);
> @@ -683,7 +681,7 @@ acpi_parse_one_atsr(struct acpi_dmar_hea
>          dev_scope_start = (void *)(atsr + 1);
>          dev_scope_end   = ((void *)atsr) + header->length;
>          ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
> -                                   atsru, ATSR_TYPE, atsr->segment);
> +                                   &atsru->scope, ATSR_TYPE, atsr->segment);
>      }
>      else
>      {
> --- a/xen/drivers/passthrough/vtd/dmar.h
> +++ b/xen/drivers/passthrough/vtd/dmar.h
> @@ -59,7 +59,7 @@ struct dmar_scope {
>  };
>  
>  struct acpi_drhd_unit {
> -    struct dmar_scope scope;            /* must be first member of struct */
> +    struct dmar_scope scope;
>      struct list_head list;
>      u64    address;                     /* register base address of the unit
> */
>      u16    segment;
> @@ -70,7 +70,7 @@ struct acpi_drhd_unit {
>  };
>  
>  struct acpi_rmrr_unit {
> -    struct dmar_scope scope;            /* must be first member of struct */
> +    struct dmar_scope scope;
>      struct list_head list;
>      u64    base_address;
>      u64    end_address;
> @@ -79,7 +79,7 @@ struct acpi_rmrr_unit {
>  };
>  
>  struct acpi_atsr_unit {
> -    struct dmar_scope scope;            /* must be first member of struct */
> +    struct dmar_scope scope;
>      struct list_head list;
>      u16    segment;
>      u8     all_ports:1;
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 15:59:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:59:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdk39-0007qT-SQ; Wed, 28 Nov 2012 15:59:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tdk38-0007q8-HG
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:59:46 +0000
Received: from [85.158.143.35:27638] by server-1.bemta-4.messagelabs.com id
	94/99-27934-1F436B05; Wed, 28 Nov 2012 15:59:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1354118384!11803359!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4936 invoked from network); 28 Nov 2012 15:59:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 15:59:44 -0000
X-IronPort-AV: E=Sophos;i="4.84,179,1355097600"; d="scan'208";a="16051444"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 15:59:44 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 15:59:44 +0000
Message-ID: <1354118383.25834.39.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Date: Wed, 28 Nov 2012 15:59:43 +0000
In-Reply-To: <50B62F38.7090906@citrix.com>
References: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
	<1354015744.5830.199.camel@zakaz.uk.xensource.com>
	<50B62F38.7090906@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] docs: fix persistent grants doc typo
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gV2VkLCAyMDEyLTExLTI4IGF0IDE1OjM1ICswMDAwLCBSb2dlciBQYXUgTW9ubmUgd3JvdGU6
Cj4gT24gMjcvMTEvMTIgMTI6MjksIElhbiBDYW1wYmVsbCB3cm90ZToKPiA+IE9uIFR1ZSwgMjAx
Mi0xMS0yNyBhdCAxMDowMyArMDAwMCwgUm9nZXIgUGF1IE1vbm5lIHdyb3RlOgo+ID4+IFNpZ25l
ZC1vZmYtYnk6IFJvZ2VyIFBhdSBNb25uw6kgPHJvZ2VyLnBhdUBjaXRyaXguY29tPgo+ID4+IC0t
LQo+ID4+ICB4ZW4vaW5jbHVkZS9wdWJsaWMvaW8vYmxraWYuaCB8ICAgIDIgKy0KPiA+PiAgMSBm
aWxlcyBjaGFuZ2VkLCAxIGluc2VydGlvbnMoKyksIDEgZGVsZXRpb25zKC0pCj4gPj4KPiA+PiBk
aWZmIC0tZ2l0IGEveGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmggYi94ZW4vaW5jbHVkZS9w
dWJsaWMvaW8vYmxraWYuaAo+ID4+IGluZGV4IGFjY2RkYTQuLmRiOWMzNzkgMTAwNjQ0Cj4gPj4g
LS0tIGEveGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmgKPiA+PiArKysgYi94ZW4vaW5jbHVk
ZS9wdWJsaWMvaW8vYmxraWYuaAo+ID4+IEBAIC0zMDcsNyArMzA3LDcgQEAKPiA+PiAgICogICAg
IHRoZSBncmFudHMuCj4gPj4gICAqICg4KSBUaGUgZnJvbnRlbmQgZHJpdmVyIGhhcyB0byBhbGxv
dyB0aGUgYmFja2VuZCBkcml2ZXIgdG8gbWFwIGFsbCBncmFudHMKPiA+PiAgICogICAgIHdpdGgg
d3JpdGUgYWNjZXNzLCBldmVuIHdoZW4gdGhleSBzaG91bGQgYmUgbWFwcGVkIHJlYWQtb25seSwg
c2luY2UKPiA+PiAtICogICAgIGZ1cnRoZXIgcmVxdWVzdHMgbWF5IHJldXNlIHRoaXMgZ3JhbnRz
IGFuZCByZXF1aXJlIHdyaXRlIHBlcm1pc2lvbnMuCj4gPj4gKyAqICAgICBmdXJ0aGVyIHJlcXVl
c3RzIG1heSByZXVzZSB0aGlzIGdyYW50cyBhbmQgcmVxdWlyZSB3cml0ZSBwZXJtaXNzaW9ucy4K
PiA+IAo+ID4gInRoZXNlIGdyYW50cyIgcHJvYmFibHk/IChhbHRlcm5hdGl2ZWx5ICJ0aGlzIGdy
YW50IiBidXQgSSBkb24ndCAgdGhpbmsKPiA+IHRoYXQgaXMgd2hhdCBpcyBtZWFudCkuCj4gCj4g
WWVzLCAidGhlc2UgZ3JhbnRzIiBpcyBjb3JyZWN0LiBEbyBJIG5lZWQgdG8gcmVzZW5kIHRoaXMs
IG9yIGNhbiB0aGUKPiBjb21taXR0ZXIgY2hhbmdlIGl0PwoKSSdsbCBkbyBpdCB3aGVuIEkgY29t
bWl0LgoKPiAKPiA+IAo+ID4+ICAgKi8KPiA+PiAgCj4gPj4gIC8qCj4gPiAKPiA+IAo+IAoKCgpf
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwg
bWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3Jn
L3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Wed Nov 28 15:59:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 15:59:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdk39-0007qT-SQ; Wed, 28 Nov 2012 15:59:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tdk38-0007q8-HG
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 15:59:46 +0000
Received: from [85.158.143.35:27638] by server-1.bemta-4.messagelabs.com id
	94/99-27934-1F436B05; Wed, 28 Nov 2012 15:59:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1354118384!11803359!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4936 invoked from network); 28 Nov 2012 15:59:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 15:59:44 -0000
X-IronPort-AV: E=Sophos;i="4.84,179,1355097600"; d="scan'208";a="16051444"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 15:59:44 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 15:59:44 +0000
Message-ID: <1354118383.25834.39.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Date: Wed, 28 Nov 2012 15:59:43 +0000
In-Reply-To: <50B62F38.7090906@citrix.com>
References: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
	<1354015744.5830.199.camel@zakaz.uk.xensource.com>
	<50B62F38.7090906@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] docs: fix persistent grants doc typo
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gV2VkLCAyMDEyLTExLTI4IGF0IDE1OjM1ICswMDAwLCBSb2dlciBQYXUgTW9ubmUgd3JvdGU6
Cj4gT24gMjcvMTEvMTIgMTI6MjksIElhbiBDYW1wYmVsbCB3cm90ZToKPiA+IE9uIFR1ZSwgMjAx
Mi0xMS0yNyBhdCAxMDowMyArMDAwMCwgUm9nZXIgUGF1IE1vbm5lIHdyb3RlOgo+ID4+IFNpZ25l
ZC1vZmYtYnk6IFJvZ2VyIFBhdSBNb25uw6kgPHJvZ2VyLnBhdUBjaXRyaXguY29tPgo+ID4+IC0t
LQo+ID4+ICB4ZW4vaW5jbHVkZS9wdWJsaWMvaW8vYmxraWYuaCB8ICAgIDIgKy0KPiA+PiAgMSBm
aWxlcyBjaGFuZ2VkLCAxIGluc2VydGl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jb21taXR0ZXIgY2hhbmdlIGl0PwoKSSdsbCBkbyBpdCB3aGVuIEkgY29t
bWl0LgoKPiAKPiA+IAo+ID4+ICAgKi8KPiA+PiAgCj4gPj4gIC8qCj4gPiAKPiA+IAo+IAoKCgpf
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwg
bWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3Jn
L3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Wed Nov 28 16:00:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 16:00:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdk42-0008M5-BA; Wed, 28 Nov 2012 16:00:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tdk41-0008Ly-Dp
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 16:00:41 +0000
Received: from [193.109.254.147:31088] by server-8.bemta-14.messagelabs.com id
	0B/07-05026-82536B05; Wed, 28 Nov 2012 16:00:40 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1354118439!8743610!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2842 invoked from network); 28 Nov 2012 16:00:39 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 16:00:39 -0000
X-IronPort-AV: E=Sophos;i="4.84,179,1355097600"; d="scan'208";a="16051469"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 16:00:39 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 16:00:39 +0000
Message-ID: <1354118438.25834.40.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Wed, 28 Nov 2012 16:00:38 +0000
In-Reply-To: <20121128144416.GD21266@phenom.dumpdata.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211281150380.5310@kaball.uk.xensource.com>
	<20121128142521.GB21266@phenom.dumpdata.com>
	<1354113142.25834.34.camel@zakaz.uk.xensource.com>
	<20121128144416.GD21266@phenom.dumpdata.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>, Jan Beulich <JBeulich@suse.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 14:44 +0000, Konrad Rzeszutek Wilk wrote:
> On Wed, Nov 28, 2012 at 02:32:22PM +0000, Ian Campbell wrote:
> > On Wed, 2012-11-28 at 14:25 +0000, Konrad Rzeszutek Wilk wrote:
> > > On Wed, Nov 28, 2012 at 11:50:54AM +0000, Stefano Stabellini wrote:
> > > > On Wed, 28 Nov 2012, Jan Beulich wrote:
> > > > > >>> On 27.11.12 at 22:31, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > > > > > Mukesh Rathor (6):
> > > > > >       xen/pvh: Support ParaVirtualized Hardware extensions.
> > > > > >       xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
> > > > > >       xen/pvh: Implement MMU changes for PVH.
> > > > > >       xen/pvh: bootup and setup (E820) related changes.
> > > > > >       xen/pvh: balloon and grant changes.
> > > > > >       xen/pvh: /dev/xen/privcmd changes.
> > > > > 
> > > > > As said before - I don't think it is a good idea to push the kernel side
> > > > > changes into an official release when the hypervisor side ones didn't
> > > > > even get an initial review yet.
> > > > 
> > > > I agree
> > > 
> > > That would delay the ARM patches that Ian posted as they are dependent on this.
> > 
> > I'd be happy to produce a series with the generic bits from the pvh
> > series which are required by the ARM stuff (the privcmd and balloon bits
> > mainly) and base the arm stuff on that. I think I offered to do this
> > before.
> 
> OK. The stable/pvh.v6 has yours and Mukesh's patches. If you want to
> rebase them on stable/for-linus-3.8 (and if you need to pull in
> v3.7-rc4,5,6,7 in it) I am game.

I'll take a look over the next couple of days.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 16:00:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 16:00:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdk42-0008M5-BA; Wed, 28 Nov 2012 16:00:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Tdk41-0008Ly-Dp
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 16:00:41 +0000
Received: from [193.109.254.147:31088] by server-8.bemta-14.messagelabs.com id
	0B/07-05026-82536B05; Wed, 28 Nov 2012 16:00:40 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1354118439!8743610!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2842 invoked from network); 28 Nov 2012 16:00:39 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 16:00:39 -0000
X-IronPort-AV: E=Sophos;i="4.84,179,1355097600"; d="scan'208";a="16051469"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 16:00:39 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 16:00:39 +0000
Message-ID: <1354118438.25834.40.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Wed, 28 Nov 2012 16:00:38 +0000
In-Reply-To: <20121128144416.GD21266@phenom.dumpdata.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211281150380.5310@kaball.uk.xensource.com>
	<20121128142521.GB21266@phenom.dumpdata.com>
	<1354113142.25834.34.camel@zakaz.uk.xensource.com>
	<20121128144416.GD21266@phenom.dumpdata.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>, Jan Beulich <JBeulich@suse.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 14:44 +0000, Konrad Rzeszutek Wilk wrote:
> On Wed, Nov 28, 2012 at 02:32:22PM +0000, Ian Campbell wrote:
> > On Wed, 2012-11-28 at 14:25 +0000, Konrad Rzeszutek Wilk wrote:
> > > On Wed, Nov 28, 2012 at 11:50:54AM +0000, Stefano Stabellini wrote:
> > > > On Wed, 28 Nov 2012, Jan Beulich wrote:
> > > > > >>> On 27.11.12 at 22:31, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > > > > > Mukesh Rathor (6):
> > > > > >       xen/pvh: Support ParaVirtualized Hardware extensions.
> > > > > >       xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
> > > > > >       xen/pvh: Implement MMU changes for PVH.
> > > > > >       xen/pvh: bootup and setup (E820) related changes.
> > > > > >       xen/pvh: balloon and grant changes.
> > > > > >       xen/pvh: /dev/xen/privcmd changes.
> > > > > 
> > > > > As said before - I don't think it is a good idea to push the kernel side
> > > > > changes into an official release when the hypervisor side ones didn't
> > > > > even get an initial review yet.
> > > > 
> > > > I agree
> > > 
> > > That would delay the ARM patches that Ian posted as they are dependent on this.
> > 
> > I'd be happy to produce a series with the generic bits from the pvh
> > series which are required by the ARM stuff (the privcmd and balloon bits
> > mainly) and base the arm stuff on that. I think I offered to do this
> > before.
> 
> OK. The stable/pvh.v6 has yours and Mukesh's patches. If you want to
> rebase them on stable/for-linus-3.8 (and if you need to pull in
> v3.7-rc4,5,6,7 in it) I am game.

I'll take a look over the next couple of days.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 16:18:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 16:18:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdkLE-0000ir-Qv; Wed, 28 Nov 2012 16:18:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdkLD-0000ik-S4
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 16:18:28 +0000
Received: from [85.158.139.211:28443] by server-13.bemta-5.messagelabs.com id
	31/02-27809-35936B05; Wed, 28 Nov 2012 16:18:27 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1354119506!16739081!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30175 invoked from network); 28 Nov 2012 16:18:26 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 16:18:26 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 16:18:25 +0000
Message-Id: <50B6479902000078000AC3EB@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 16:19:21 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <cd59ddd0-be45-47e3-b762-a5d630c2df43@default>
In-Reply-To: <cd59ddd0-be45-47e3-b762-a5d630c2df43@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	KonradWilk <konrad.wilk@oracle.com>,
	AndresLagar-Cavilla <andreslc@gridcentric.ca>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [PATCH v8 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 28.11.12 at 16:50, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -3841,7 +3841,7 @@ int donate_page(
>      {
>          if ( d->tot_pages >= d->max_pages )
>              goto fail;
> -        d->tot_pages++;
> +        domain_adjust_tot_pages(d, 1);

I would generally expect there to always be paired increments
and decrements, yet I fail to spot this one's counterpart. There
is one a few lines down in steal_page().

> --- a/xen/common/grant_table.c
> +++ b/xen/common/grant_table.c
> @@ -1656,7 +1656,7 @@ gnttab_transfer(
>          }
>  
>          /* Okay, add the page to 'e'. */
> -        if ( unlikely(e->tot_pages++ == 0) )
> +        if ( unlikely(domain_adjust_tot_pages(e, 1) == 1) )

This one's counterpart ought to also be the one in steal_page(),
but did you really check? As that isn't the first one you missed,
what did you do to find them all (apparently you didn't simply
grep for "tot_pages")?

> +unsigned long domain_adjust_tot_pages(struct domain *d, long pages)
> +{
> +    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
> +
> +    ASSERT(spin_is_locked(&d->page_alloc_lock));
> +    /*
> +     * can test d->claimed_pages race-free because it can only change
> +     * if d->page_alloc_lock and heap_lock are both held, see also
> +     * domain_set_unclaimed_pages below
> +     */
> +    if ( !d->unclaimed_pages )
> +        return d->tot_pages += pages;
> +    spin_lock(&heap_lock);
> +    d->tot_pages += pages;

Why don't you do this first thing, right after the comment above?
Would remove redundancy. Perhaps then even invert the if()
condition and have just a single return point.

Plus, if you went the route Keir suggested and split out the
conversion to domain_adjust_tot_pages() without anything
else, that would be what could probably go in
uncontroversially, making the remaining amount of changes
quite a bit smaller (and touching a more limited set of files).

Jan

> +    /* adjust domain unclaimed_pages; may not go negative */
> +    dom_before = d->unclaimed_pages;
> +    dom_after = dom_before - pages;
> +    if ( (dom_before > 0) && (dom_after < 0) )
> +        dom_claimed = 0;
> +    else
> +        dom_claimed = dom_after;
> +    d->unclaimed_pages = dom_claimed;
> +    /* flag accounting bug if system unclaimed_pages would go negative */
> +    sys_before = total_unclaimed_pages;
> +    sys_after = sys_before - (dom_before - dom_claimed);
> +    BUG_ON((sys_before > 0) && (sys_after < 0));
> +    total_unclaimed_pages = sys_after;
> +    spin_unlock(&heap_lock);
> +    return d->tot_pages;
> +}



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 16:18:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 16:18:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdkLE-0000ir-Qv; Wed, 28 Nov 2012 16:18:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdkLD-0000ik-S4
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 16:18:28 +0000
Received: from [85.158.139.211:28443] by server-13.bemta-5.messagelabs.com id
	31/02-27809-35936B05; Wed, 28 Nov 2012 16:18:27 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1354119506!16739081!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30175 invoked from network); 28 Nov 2012 16:18:26 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-9.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 16:18:26 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Wed, 28 Nov 2012 16:18:25 +0000
Message-Id: <50B6479902000078000AC3EB@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Wed, 28 Nov 2012 16:19:21 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <cd59ddd0-be45-47e3-b762-a5d630c2df43@default>
In-Reply-To: <cd59ddd0-be45-47e3-b762-a5d630c2df43@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	KonradWilk <konrad.wilk@oracle.com>,
	AndresLagar-Cavilla <andreslc@gridcentric.ca>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [PATCH v8 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 28.11.12 at 16:50, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -3841,7 +3841,7 @@ int donate_page(
>      {
>          if ( d->tot_pages >= d->max_pages )
>              goto fail;
> -        d->tot_pages++;
> +        domain_adjust_tot_pages(d, 1);

I would generally expect there to always be paired increments
and decrements, yet I fail to spot this one's counterpart. There
is one a few lines down in steal_page().

> --- a/xen/common/grant_table.c
> +++ b/xen/common/grant_table.c
> @@ -1656,7 +1656,7 @@ gnttab_transfer(
>          }
>  
>          /* Okay, add the page to 'e'. */
> -        if ( unlikely(e->tot_pages++ == 0) )
> +        if ( unlikely(domain_adjust_tot_pages(e, 1) == 1) )

This one's counterpart ought to also be the one in steal_page(),
but did you really check? As that isn't the first one you missed,
what did you do to find them all (apparently you didn't simply
grep for "tot_pages")?

> +unsigned long domain_adjust_tot_pages(struct domain *d, long pages)
> +{
> +    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
> +
> +    ASSERT(spin_is_locked(&d->page_alloc_lock));
> +    /*
> +     * can test d->claimed_pages race-free because it can only change
> +     * if d->page_alloc_lock and heap_lock are both held, see also
> +     * domain_set_unclaimed_pages below
> +     */
> +    if ( !d->unclaimed_pages )
> +        return d->tot_pages += pages;
> +    spin_lock(&heap_lock);
> +    d->tot_pages += pages;

Why don't you do this first thing, right after the comment above?
Would remove redundancy. Perhaps then even invert the if()
condition and have just a single return point.

Plus, if you went the route Keir suggested and split out the
conversion to domain_adjust_tot_pages() without anything
else, that would be what could probably go in
uncontroversially, making the remaining amount of changes
quite a bit smaller (and touching a more limited set of files).

Jan

> +    /* adjust domain unclaimed_pages; may not go negative */
> +    dom_before = d->unclaimed_pages;
> +    dom_after = dom_before - pages;
> +    if ( (dom_before > 0) && (dom_after < 0) )
> +        dom_claimed = 0;
> +    else
> +        dom_claimed = dom_after;
> +    d->unclaimed_pages = dom_claimed;
> +    /* flag accounting bug if system unclaimed_pages would go negative */
> +    sys_before = total_unclaimed_pages;
> +    sys_after = sys_before - (dom_before - dom_claimed);
> +    BUG_ON((sys_before > 0) && (sys_after < 0));
> +    total_unclaimed_pages = sys_after;
> +    spin_unlock(&heap_lock);
> +    return d->tot_pages;
> +}



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 16:53:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 16:53:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdkse-0001Cx-9F; Wed, 28 Nov 2012 16:53:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1Tdksc-0001Cs-Es
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 16:52:58 +0000
Received: from [85.158.137.99:14656] by server-14.bemta-3.messagelabs.com id
	86/EE-31424-36146B05; Wed, 28 Nov 2012 16:52:51 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1354121569!17075241!1
X-Originating-IP: [209.85.160.171]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_20_30,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31516 invoked from network); 28 Nov 2012 16:52:50 -0000
Received: from mail-gh0-f171.google.com (HELO mail-gh0-f171.google.com)
	(209.85.160.171)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 16:52:50 -0000
Received: by mail-gh0-f171.google.com with SMTP id r17so2765308ghr.30
	for <xen-devel@lists.xensource.com>;
	Wed, 28 Nov 2012 08:52:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=8iQi2xVV/wP0akK1CT7ZnJyX8lr1PuzKbfSlknrjdNw=;
	b=dFL/2kxE2XXo9nmWb5FppbJwqk05/hEjnUq4JyOCAkwmDTwGp1zLMKybpBQMIm+OPs
	28TPGU9VCOwAtHXoa4TNo4412LkEZX44cJwPwGK2Y97poJFVunw8jh7om4AzAucy3Og/
	cDIFBpsra4IIySAK8JbSeyqOnZi4wlqUSn5aRlzKIE7Re05V+myjHigGdDu4YO5oGgPC
	PVI7KF0ErYCFrPJKobedQZKF+H9CUxibakax57Vg+mah45F0vT0j8w/cgf82F1RkhU5X
	UUxrUx9z84R6KsJ3hXhE1ncvPZMoa4VZSTtIY9DNoEZ43l4OCjeqG0lTZKPi4YKtTemx
	F3bQ==
MIME-Version: 1.0
Received: by 10.58.162.130 with SMTP id ya2mr30038730veb.2.1354121568804; Wed,
	28 Nov 2012 08:52:48 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Wed, 28 Nov 2012 08:52:48 -0800 (PST)
In-Reply-To: <20121128151119.GC8912@reaktio.net>
References: <patchbomb.1354104964@elijah>
	<e87d8fad28e00090591b.1354104966@elijah>
	<20121128151119.GC8912@reaktio.net>
Date: Wed, 28 Nov 2012 16:52:48 +0000
X-Google-Sender-Auth: 2da0bnC5Sx8xr_JuZz99Sb-PSMY
Message-ID: <CAFLBxZb_YwCaDAUU4pqkzbdNF0D1rFDoELVZadunt3cr3v5Tig@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: =?ISO-8859-1?Q?Pasi_K=E4rkk=E4inen?= <pasik@iki.fi>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 2 of 2] xl: Accept a list for usbdevice in
 config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6746596958738946944=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6746596958738946944==
Content-Type: multipart/alternative; boundary=047d7b6766dc175e7804cf90ff63

--047d7b6766dc175e7804cf90ff63
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Wed, Nov 28, 2012 at 3:11 PM, Pasi K=E4rkk=E4inen <pasik@iki.fi> wrote:

> On Wed, Nov 28, 2012 at 12:16:06PM +0000, George Dunlap wrote:
> > # HG changeset patch
> > # User George Dunlap <george.dunlap@eu.citrix.com>
> > # Date 1354104851 0
> > # Node ID e87d8fad28e00090591b65b2682dea9112f8830d
> > # Parent  538d9ffbd71b41e8cf6d7da0ded9e0a0b07f3c0d
> > xl: Accept a list for usbdevice in config file
> >
> > Allow the "usbdevice" key to accept a list of USB devices, and pass
> > them in using the new usbdevice_list domain build element.
> >
> > For backwards compatibility, still accept singleton values.
> >
> > Also update the xl.cfg manpage, adding information about how to pass
> > through host devices.
> >
> > Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
> >
> > diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
> > --- a/docs/man/xl.cfg.pod.5
> > +++ b/docs/man/xl.cfg.pod.5
> > @@ -1103,15 +1103,22 @@ device.
> >
> >  Enables or disables a USB bus in the guest.
> >
>
> Should we add "HVM" there ?
>

I could make this say, "...in an HVM guest".  (I'll wait to see if I get
other comments before re-sending the patch.)


>
>
> > -=3Ditem B<usbdevice=3DDEVICE>
> > +=3Ditem B<usbdevice=3D[ "DEVICE", "DEVICE", ...]>
> >
> > -Adds B<DEVICE> to the USB bus. The USB bus must also be enabled using
> > -B<usb=3D1>. The most common use for this option is B<usbdevice=3Dtable=
t>
> > -which adds pointer device using absolute coordinates. Such devices
> > -function better than relative coordinate devices (such as a standard
> > -mouse) since many methods of exporting guest graphics (such as VNC)
> > -work better in this mode. Note that this is independent of the actual
> > -pointer device you are using on the host/client side.
> > +Adds B<DEVICE>s to the emulated USB bus. The USB bus must also be
> > +enabled using B<usb=3D1>. The most common use for this option is
> > +B<usbdevice=3D['tablet']> which adds pointer device using absolute
> > +coordinates. Such devices function better than relative coordinate
> > +devices (such as a standard mouse) since many methods of exporting
> > +guest graphics (such as VNC) work better in this mode. Note that this
> > +is independent of the actual pointer device you are using on the
> > +host/client side.
> > +
> > +Host devices can also be passed through in this way, by specifying
> > +host:USBID, where USBID is of the form xxxx:yyyy.  The USBID can
> > +typically be found by using lsusb or usb-devices.
> > +
> > +The form usbdevice=3DDEVICE is also accepted for backwards compatibili=
ty.
> >
>
> Should we mention the difference between qemu-traditional and
> qemu-upstream here?
>
> qemu-traditional only supports USB 1.1 devices, while qemu-upstream offer=
s
> USB 2.0 (and 3.0) emulation.
> Is there currently a way to control to which virtual usb controller the
> host device gets added to?
>
> See here for help how to configure that with qemu/kvm:
>
> http://www.linux-kvm.com/content/qemu-kvm-11-adds-experimental-support-us=
b-30
>

I think this level of detail is probably too high for a man page -- this
kind of thing should be on a wiki somewhere I think.

In general though, I think xl's approach to USB stuff is really
simplistic.  It would be nice to have it be more fully-featured, but I'm
not sure that's on anyone's priority list.

 -George

--047d7b6766dc175e7804cf90ff63
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Wed, Nov 28, 2012 at 3:11 PM, Pasi K=E4rkk=E4inen <span dir=3D"ltr">&lt;=
<a href=3D"mailto:pasik@iki.fi" target=3D"_blank">pasik@iki.fi</a>&gt;</spa=
n> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_quote"><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc s=
olid;padding-left:1ex">
<div class=3D"im">On Wed, Nov 28, 2012 at 12:16:06PM +0000, George Dunlap w=
rote:<br>
&gt; # HG changeset patch<br>
&gt; # User George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com=
">george.dunlap@eu.citrix.com</a>&gt;<br>
&gt; # Date 1354104851 0<br>
&gt; # Node ID e87d8fad28e00090591b65b2682dea9112f8830d<br>
&gt; # Parent =A0538d9ffbd71b41e8cf6d7da0ded9e0a0b07f3c0d<br>
&gt; xl: Accept a list for usbdevice in config file<br>
&gt;<br>
&gt; Allow the &quot;usbdevice&quot; key to accept a list of USB devices, a=
nd pass<br>
&gt; them in using the new usbdevice_list domain build element.<br>
&gt;<br>
&gt; For backwards compatibility, still accept singleton values.<br>
&gt;<br>
&gt; Also update the xl.cfg manpage, adding information about how to pass<b=
r>
&gt; through host devices.<br>
&gt;<br>
&gt; Signed-off-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.ci=
trix.com">george.dunlap@eu.citrix.com</a>&gt;<br>
&gt;<br>
&gt; diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5<br>
&gt; --- a/docs/man/xl.cfg.pod.5<br>
&gt; +++ b/docs/man/xl.cfg.pod.5<br>
&gt; @@ -1103,15 +1103,22 @@ device.<br>
&gt;<br>
&gt; =A0Enables or disables a USB bus in the guest.<br>
&gt;<br>
<br>
</div>Should we add &quot;HVM&quot; there ?<br></blockquote><div><br>I coul=
d make this say, &quot;...in an HVM guest&quot;.=A0 (I&#39;ll wait to see i=
f I get other comments before re-sending the patch.)<br>=A0</div><blockquot=
e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
id;padding-left:1ex">

<div class=3D"im"><br>
<br>
&gt; -=3Ditem B&lt;usbdevice=3DDEVICE&gt;<br>
&gt; +=3Ditem B&lt;usbdevice=3D[ &quot;DEVICE&quot;, &quot;DEVICE&quot;, ..=
.]&gt;<br>
&gt;<br>
&gt; -Adds B&lt;DEVICE&gt; to the USB bus. The USB bus must also be enabled=
 using<br>
&gt; -B&lt;usb=3D1&gt;. The most common use for this option is B&lt;usbdevi=
ce=3Dtablet&gt;<br>
&gt; -which adds pointer device using absolute coordinates. Such devices<br=
>
&gt; -function better than relative coordinate devices (such as a standard<=
br>
&gt; -mouse) since many methods of exporting guest graphics (such as VNC)<b=
r>
&gt; -work better in this mode. Note that this is independent of the actual=
<br>
&gt; -pointer device you are using on the host/client side.<br>
&gt; +Adds B&lt;DEVICE&gt;s to the emulated USB bus. The USB bus must also =
be<br>
&gt; +enabled using B&lt;usb=3D1&gt;. The most common use for this option i=
s<br>
&gt; +B&lt;usbdevice=3D[&#39;tablet&#39;]&gt; which adds pointer device usi=
ng absolute<br>
&gt; +coordinates. Such devices function better than relative coordinate<br=
>
&gt; +devices (such as a standard mouse) since many methods of exporting<br=
>
&gt; +guest graphics (such as VNC) work better in this mode. Note that this=
<br>
&gt; +is independent of the actual pointer device you are using on the<br>
&gt; +host/client side.<br>
&gt; +<br>
&gt; +Host devices can also be passed through in this way, by specifying<br=
>
&gt; +host:USBID, where USBID is of the form xxxx:yyyy. =A0The USBID can<br=
>
&gt; +typically be found by using lsusb or usb-devices.<br>
&gt; +<br>
&gt; +The form usbdevice=3DDEVICE is also accepted for backwards compatibil=
ity.<br>
&gt;<br>
<br>
</div>Should we mention the difference between qemu-traditional and qemu-up=
stream here?<br>
<br>
qemu-traditional only supports USB 1.1 devices, while qemu-upstream offers =
USB 2.0 (and 3.0) emulation.<br>
Is there currently a way to control to which virtual usb controller the hos=
t device gets added to?<br>
<br>
See here for help how to configure that with qemu/kvm:<br>
<a href=3D"http://www.linux-kvm.com/content/qemu-kvm-11-adds-experimental-s=
upport-usb-30" target=3D"_blank">http://www.linux-kvm.com/content/qemu-kvm-=
11-adds-experimental-support-usb-30</a><br></blockquote><div><br>I think th=
is level of detail is probably too high for a man page -- this kind of thin=
g should be on a wiki somewhere I think.<br>
<br>In general though, I think xl&#39;s approach to USB stuff is really sim=
plistic.=A0 It would be nice to have it be more fully-featured, but I&#39;m=
 not sure that&#39;s on anyone&#39;s priority list.<br><br>=A0-George<br></=
div>
</div></div>

--047d7b6766dc175e7804cf90ff63--


--===============6746596958738946944==
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.xen.org
http://lists.xen.org/xen-devel

--===============6746596958738946944==--


From xen-devel-bounces@lists.xen.org Wed Nov 28 16:53:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 16:53:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdkse-0001Cx-9F; Wed, 28 Nov 2012 16:53:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1Tdksc-0001Cs-Es
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 16:52:58 +0000
Received: from [85.158.137.99:14656] by server-14.bemta-3.messagelabs.com id
	86/EE-31424-36146B05; Wed, 28 Nov 2012 16:52:51 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1354121569!17075241!1
X-Originating-IP: [209.85.160.171]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_20_30,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31516 invoked from network); 28 Nov 2012 16:52:50 -0000
Received: from mail-gh0-f171.google.com (HELO mail-gh0-f171.google.com)
	(209.85.160.171)
	by server-13.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 16:52:50 -0000
Received: by mail-gh0-f171.google.com with SMTP id r17so2765308ghr.30
	for <xen-devel@lists.xensource.com>;
	Wed, 28 Nov 2012 08:52:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=8iQi2xVV/wP0akK1CT7ZnJyX8lr1PuzKbfSlknrjdNw=;
	b=dFL/2kxE2XXo9nmWb5FppbJwqk05/hEjnUq4JyOCAkwmDTwGp1zLMKybpBQMIm+OPs
	28TPGU9VCOwAtHXoa4TNo4412LkEZX44cJwPwGK2Y97poJFVunw8jh7om4AzAucy3Og/
	cDIFBpsra4IIySAK8JbSeyqOnZi4wlqUSn5aRlzKIE7Re05V+myjHigGdDu4YO5oGgPC
	PVI7KF0ErYCFrPJKobedQZKF+H9CUxibakax57Vg+mah45F0vT0j8w/cgf82F1RkhU5X
	UUxrUx9z84R6KsJ3hXhE1ncvPZMoa4VZSTtIY9DNoEZ43l4OCjeqG0lTZKPi4YKtTemx
	F3bQ==
MIME-Version: 1.0
Received: by 10.58.162.130 with SMTP id ya2mr30038730veb.2.1354121568804; Wed,
	28 Nov 2012 08:52:48 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Wed, 28 Nov 2012 08:52:48 -0800 (PST)
In-Reply-To: <20121128151119.GC8912@reaktio.net>
References: <patchbomb.1354104964@elijah>
	<e87d8fad28e00090591b.1354104966@elijah>
	<20121128151119.GC8912@reaktio.net>
Date: Wed, 28 Nov 2012 16:52:48 +0000
X-Google-Sender-Auth: 2da0bnC5Sx8xr_JuZz99Sb-PSMY
Message-ID: <CAFLBxZb_YwCaDAUU4pqkzbdNF0D1rFDoELVZadunt3cr3v5Tig@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: =?ISO-8859-1?Q?Pasi_K=E4rkk=E4inen?= <pasik@iki.fi>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 2 of 2] xl: Accept a list for usbdevice in
 config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6746596958738946944=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============6746596958738946944==
Content-Type: multipart/alternative; boundary=047d7b6766dc175e7804cf90ff63

--047d7b6766dc175e7804cf90ff63
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Wed, Nov 28, 2012 at 3:11 PM, Pasi K=E4rkk=E4inen <pasik@iki.fi> wrote:

> On Wed, Nov 28, 2012 at 12:16:06PM +0000, George Dunlap wrote:
> > # HG changeset patch
> > # User George Dunlap <george.dunlap@eu.citrix.com>
> > # Date 1354104851 0
> > # Node ID e87d8fad28e00090591b65b2682dea9112f8830d
> > # Parent  538d9ffbd71b41e8cf6d7da0ded9e0a0b07f3c0d
> > xl: Accept a list for usbdevice in config file
> >
> > Allow the "usbdevice" key to accept a list of USB devices, and pass
> > them in using the new usbdevice_list domain build element.
> >
> > For backwards compatibility, still accept singleton values.
> >
> > Also update the xl.cfg manpage, adding information about how to pass
> > through host devices.
> >
> > Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
> >
> > diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
> > --- a/docs/man/xl.cfg.pod.5
> > +++ b/docs/man/xl.cfg.pod.5
> > @@ -1103,15 +1103,22 @@ device.
> >
> >  Enables or disables a USB bus in the guest.
> >
>
> Should we add "HVM" there ?
>

I could make this say, "...in an HVM guest".  (I'll wait to see if I get
other comments before re-sending the patch.)


>
>
> > -=3Ditem B<usbdevice=3DDEVICE>
> > +=3Ditem B<usbdevice=3D[ "DEVICE", "DEVICE", ...]>
> >
> > -Adds B<DEVICE> to the USB bus. The USB bus must also be enabled using
> > -B<usb=3D1>. The most common use for this option is B<usbdevice=3Dtable=
t>
> > -which adds pointer device using absolute coordinates. Such devices
> > -function better than relative coordinate devices (such as a standard
> > -mouse) since many methods of exporting guest graphics (such as VNC)
> > -work better in this mode. Note that this is independent of the actual
> > -pointer device you are using on the host/client side.
> > +Adds B<DEVICE>s to the emulated USB bus. The USB bus must also be
> > +enabled using B<usb=3D1>. The most common use for this option is
> > +B<usbdevice=3D['tablet']> which adds pointer device using absolute
> > +coordinates. Such devices function better than relative coordinate
> > +devices (such as a standard mouse) since many methods of exporting
> > +guest graphics (such as VNC) work better in this mode. Note that this
> > +is independent of the actual pointer device you are using on the
> > +host/client side.
> > +
> > +Host devices can also be passed through in this way, by specifying
> > +host:USBID, where USBID is of the form xxxx:yyyy.  The USBID can
> > +typically be found by using lsusb or usb-devices.
> > +
> > +The form usbdevice=3DDEVICE is also accepted for backwards compatibili=
ty.
> >
>
> Should we mention the difference between qemu-traditional and
> qemu-upstream here?
>
> qemu-traditional only supports USB 1.1 devices, while qemu-upstream offer=
s
> USB 2.0 (and 3.0) emulation.
> Is there currently a way to control to which virtual usb controller the
> host device gets added to?
>
> See here for help how to configure that with qemu/kvm:
>
> http://www.linux-kvm.com/content/qemu-kvm-11-adds-experimental-support-us=
b-30
>

I think this level of detail is probably too high for a man page -- this
kind of thing should be on a wiki somewhere I think.

In general though, I think xl's approach to USB stuff is really
simplistic.  It would be nice to have it be more fully-featured, but I'm
not sure that's on anyone's priority list.

 -George

--047d7b6766dc175e7804cf90ff63
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Wed, Nov 28, 2012 at 3:11 PM, Pasi K=E4rkk=E4inen <span dir=3D"ltr">&lt;=
<a href=3D"mailto:pasik@iki.fi" target=3D"_blank">pasik@iki.fi</a>&gt;</spa=
n> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_quote"><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc s=
olid;padding-left:1ex">
<div class=3D"im">On Wed, Nov 28, 2012 at 12:16:06PM +0000, George Dunlap w=
rote:<br>
&gt; # HG changeset patch<br>
&gt; # User George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com=
">george.dunlap@eu.citrix.com</a>&gt;<br>
&gt; # Date 1354104851 0<br>
&gt; # Node ID e87d8fad28e00090591b65b2682dea9112f8830d<br>
&gt; # Parent =A0538d9ffbd71b41e8cf6d7da0ded9e0a0b07f3c0d<br>
&gt; xl: Accept a list for usbdevice in config file<br>
&gt;<br>
&gt; Allow the &quot;usbdevice&quot; key to accept a list of USB devices, a=
nd pass<br>
&gt; them in using the new usbdevice_list domain build element.<br>
&gt;<br>
&gt; For backwards compatibility, still accept singleton values.<br>
&gt;<br>
&gt; Also update the xl.cfg manpage, adding information about how to pass<b=
r>
&gt; through host devices.<br>
&gt;<br>
&gt; Signed-off-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.ci=
trix.com">george.dunlap@eu.citrix.com</a>&gt;<br>
&gt;<br>
&gt; diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5<br>
&gt; --- a/docs/man/xl.cfg.pod.5<br>
&gt; +++ b/docs/man/xl.cfg.pod.5<br>
&gt; @@ -1103,15 +1103,22 @@ device.<br>
&gt;<br>
&gt; =A0Enables or disables a USB bus in the guest.<br>
&gt;<br>
<br>
</div>Should we add &quot;HVM&quot; there ?<br></blockquote><div><br>I coul=
d make this say, &quot;...in an HVM guest&quot;.=A0 (I&#39;ll wait to see i=
f I get other comments before re-sending the patch.)<br>=A0</div><blockquot=
e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
id;padding-left:1ex">

<div class=3D"im"><br>
<br>
&gt; -=3Ditem B&lt;usbdevice=3DDEVICE&gt;<br>
&gt; +=3Ditem B&lt;usbdevice=3D[ &quot;DEVICE&quot;, &quot;DEVICE&quot;, ..=
.]&gt;<br>
&gt;<br>
&gt; -Adds B&lt;DEVICE&gt; to the USB bus. The USB bus must also be enabled=
 using<br>
&gt; -B&lt;usb=3D1&gt;. The most common use for this option is B&lt;usbdevi=
ce=3Dtablet&gt;<br>
&gt; -which adds pointer device using absolute coordinates. Such devices<br=
>
&gt; -function better than relative coordinate devices (such as a standard<=
br>
&gt; -mouse) since many methods of exporting guest graphics (such as VNC)<b=
r>
&gt; -work better in this mode. Note that this is independent of the actual=
<br>
&gt; -pointer device you are using on the host/client side.<br>
&gt; +Adds B&lt;DEVICE&gt;s to the emulated USB bus. The USB bus must also =
be<br>
&gt; +enabled using B&lt;usb=3D1&gt;. The most common use for this option i=
s<br>
&gt; +B&lt;usbdevice=3D[&#39;tablet&#39;]&gt; which adds pointer device usi=
ng absolute<br>
&gt; +coordinates. Such devices function better than relative coordinate<br=
>
&gt; +devices (such as a standard mouse) since many methods of exporting<br=
>
&gt; +guest graphics (such as VNC) work better in this mode. Note that this=
<br>
&gt; +is independent of the actual pointer device you are using on the<br>
&gt; +host/client side.<br>
&gt; +<br>
&gt; +Host devices can also be passed through in this way, by specifying<br=
>
&gt; +host:USBID, where USBID is of the form xxxx:yyyy. =A0The USBID can<br=
>
&gt; +typically be found by using lsusb or usb-devices.<br>
&gt; +<br>
&gt; +The form usbdevice=3DDEVICE is also accepted for backwards compatibil=
ity.<br>
&gt;<br>
<br>
</div>Should we mention the difference between qemu-traditional and qemu-up=
stream here?<br>
<br>
qemu-traditional only supports USB 1.1 devices, while qemu-upstream offers =
USB 2.0 (and 3.0) emulation.<br>
Is there currently a way to control to which virtual usb controller the hos=
t device gets added to?<br>
<br>
See here for help how to configure that with qemu/kvm:<br>
<a href=3D"http://www.linux-kvm.com/content/qemu-kvm-11-adds-experimental-s=
upport-usb-30" target=3D"_blank">http://www.linux-kvm.com/content/qemu-kvm-=
11-adds-experimental-support-usb-30</a><br></blockquote><div><br>I think th=
is level of detail is probably too high for a man page -- this kind of thin=
g should be on a wiki somewhere I think.<br>
<br>In general though, I think xl&#39;s approach to USB stuff is really sim=
plistic.=A0 It would be nice to have it be more fully-featured, but I&#39;m=
 not sure that&#39;s on anyone&#39;s priority list.<br><br>=A0-George<br></=
div>
</div></div>

--047d7b6766dc175e7804cf90ff63--


--===============6746596958738946944==
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.xen.org
http://lists.xen.org/xen-devel

--===============6746596958738946944==--


From xen-devel-bounces@lists.xen.org Wed Nov 28 18:06:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 18:06:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdm1I-0002Mi-Nn; Wed, 28 Nov 2012 18:06:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Tdm1H-0002Md-Dc
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 18:05:59 +0000
Received: from [85.158.137.99:17042] by server-10.bemta-3.messagelabs.com id
	E2/D9-19806-68256B05; Wed, 28 Nov 2012 18:05:58 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1354125956!12262890!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODE1MjA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22388 invoked from network); 28 Nov 2012 18:05:57 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-7.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 18:05:57 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASI5qGb027661
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 18:05:52 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASI5pME025725
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 18:05:51 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASI5pY5016084; Wed, 28 Nov 2012 12:05:51 -0600
MIME-Version: 1.0
Message-ID: <f931a25e-21d0-491f-9a7d-3f8d300386fa@default>
Date: Wed, 28 Nov 2012 10:05:49 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <cd59ddd0-be45-47e3-b762-a5d630c2df43@default>
	<50B6479902000078000AC3EB@nat28.tlf.novell.com>
In-Reply-To: <50B6479902000078000AC3EB@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	AndresLagar-Cavilla <andreslc@gridcentric.ca>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [PATCH v8 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Subject: Re: [PATCH v8 1/2] hypervisor: XENMEM_claim_pages (subop of existing) hypercall
> 
> >>> On 28.11.12 at 16:50, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> > --- a/xen/arch/x86/mm.c
> > +++ b/xen/arch/x86/mm.c
> > @@ -3841,7 +3841,7 @@ int donate_page(
> >      {
> >          if ( d->tot_pages >= d->max_pages )
> >              goto fail;
> > -        d->tot_pages++;
> > +        domain_adjust_tot_pages(d, 1);
> 
> I would generally expect there to always be paired increments
> and decrements, yet I fail to spot this one's counterpart. There
> is one a few lines down in steal_page().
> 
> > --- a/xen/common/grant_table.c
> > +++ b/xen/common/grant_table.c
> > @@ -1656,7 +1656,7 @@ gnttab_transfer(
> >          }
> >
> >          /* Okay, add the page to 'e'. */
> > -        if ( unlikely(e->tot_pages++ == 0) )
> > +        if ( unlikely(domain_adjust_tot_pages(e, 1) == 1) )
> 
> This one's counterpart ought to also be the one in steal_page(),
> but did you really check? As that isn't the first one you missed,
> what did you do to find them all (apparently you didn't simply
> grep for "tot_pages")?

Urk.  I did grep (-r) many times.  I'm embarrassed that this one
slipped past me among the dozens of unchanged read-not-modify
uses of d->tot_pages.  I'm glad for your additional set of eyes.
I have now carefully audited to ensure the steal_page one is
the last one.  Sorry!
 
> > +unsigned long domain_adjust_tot_pages(struct domain *d, long pages)
> > +{
> > +    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
> > +
> > +    ASSERT(spin_is_locked(&d->page_alloc_lock));
> > +    /*
> > +     * can test d->claimed_pages race-free because it can only change
> > +     * if d->page_alloc_lock and heap_lock are both held, see also
> > +     * domain_set_unclaimed_pages below
> > +     */
> > +    if ( !d->unclaimed_pages )
> > +        return d->tot_pages += pages;
> > +    spin_lock(&heap_lock);
> > +    d->tot_pages += pages;
> 
> Why don't you do this first thing, right after the comment above?
> Would remove redundancy. 

Hmmm... doesn't that create a window where d->tot_pages
and d->unclaimed_pages are inconsistent?  Hmmm... yes,
but this matters only if code where their consistency
is required is not also protected by both locks.  AFAICT
such code doesn't exist so... will do.

> Perhaps then even invert the if()
> condition and have just a single return point.

Rather than invert the if(), unless you prefer the extra
level of indentation, I'd prefer:

+    d->tot_pages += pages;
+    if ( !d->unclaimed_pages )
+        goto out;
   <snip>
+out:
+    return d->tot_pages;

Would that be acceptable?

> Plus, if you went the route Keir suggested and split out the
> conversion to domain_adjust_tot_pages() without anything
> else, that would be what could probably go in
> uncontroversially, making the remaining amount of changes
> quite a bit smaller (and touching a more limited set of files).

OK, will do.

Thanks again!
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 18:06:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 18:06:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdm1I-0002Mi-Nn; Wed, 28 Nov 2012 18:06:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Tdm1H-0002Md-Dc
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 18:05:59 +0000
Received: from [85.158.137.99:17042] by server-10.bemta-3.messagelabs.com id
	E2/D9-19806-68256B05; Wed, 28 Nov 2012 18:05:58 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1354125956!12262890!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODE1MjA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22388 invoked from network); 28 Nov 2012 18:05:57 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-7.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 18:05:57 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASI5qGb027661
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 18:05:52 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASI5pME025725
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 18:05:51 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASI5pY5016084; Wed, 28 Nov 2012 12:05:51 -0600
MIME-Version: 1.0
Message-ID: <f931a25e-21d0-491f-9a7d-3f8d300386fa@default>
Date: Wed, 28 Nov 2012 10:05:49 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
References: <cd59ddd0-be45-47e3-b762-a5d630c2df43@default>
	<50B6479902000078000AC3EB@nat28.tlf.novell.com>
In-Reply-To: <50B6479902000078000AC3EB@nat28.tlf.novell.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	AndresLagar-Cavilla <andreslc@gridcentric.ca>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [PATCH v8 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> From: Jan Beulich [mailto:JBeulich@suse.com]
> Subject: Re: [PATCH v8 1/2] hypervisor: XENMEM_claim_pages (subop of existing) hypercall
> 
> >>> On 28.11.12 at 16:50, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> > --- a/xen/arch/x86/mm.c
> > +++ b/xen/arch/x86/mm.c
> > @@ -3841,7 +3841,7 @@ int donate_page(
> >      {
> >          if ( d->tot_pages >= d->max_pages )
> >              goto fail;
> > -        d->tot_pages++;
> > +        domain_adjust_tot_pages(d, 1);
> 
> I would generally expect there to always be paired increments
> and decrements, yet I fail to spot this one's counterpart. There
> is one a few lines down in steal_page().
> 
> > --- a/xen/common/grant_table.c
> > +++ b/xen/common/grant_table.c
> > @@ -1656,7 +1656,7 @@ gnttab_transfer(
> >          }
> >
> >          /* Okay, add the page to 'e'. */
> > -        if ( unlikely(e->tot_pages++ == 0) )
> > +        if ( unlikely(domain_adjust_tot_pages(e, 1) == 1) )
> 
> This one's counterpart ought to also be the one in steal_page(),
> but did you really check? As that isn't the first one you missed,
> what did you do to find them all (apparently you didn't simply
> grep for "tot_pages")?

Urk.  I did grep (-r) many times.  I'm embarrassed that this one
slipped past me among the dozens of unchanged read-not-modify
uses of d->tot_pages.  I'm glad for your additional set of eyes.
I have now carefully audited to ensure the steal_page one is
the last one.  Sorry!
 
> > +unsigned long domain_adjust_tot_pages(struct domain *d, long pages)
> > +{
> > +    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
> > +
> > +    ASSERT(spin_is_locked(&d->page_alloc_lock));
> > +    /*
> > +     * can test d->claimed_pages race-free because it can only change
> > +     * if d->page_alloc_lock and heap_lock are both held, see also
> > +     * domain_set_unclaimed_pages below
> > +     */
> > +    if ( !d->unclaimed_pages )
> > +        return d->tot_pages += pages;
> > +    spin_lock(&heap_lock);
> > +    d->tot_pages += pages;
> 
> Why don't you do this first thing, right after the comment above?
> Would remove redundancy. 

Hmmm... doesn't that create a window where d->tot_pages
and d->unclaimed_pages are inconsistent?  Hmmm... yes,
but this matters only if code where their consistency
is required is not also protected by both locks.  AFAICT
such code doesn't exist so... will do.

> Perhaps then even invert the if()
> condition and have just a single return point.

Rather than invert the if(), unless you prefer the extra
level of indentation, I'd prefer:

+    d->tot_pages += pages;
+    if ( !d->unclaimed_pages )
+        goto out;
   <snip>
+out:
+    return d->tot_pages;

Would that be acceptable?

> Plus, if you went the route Keir suggested and split out the
> conversion to domain_adjust_tot_pages() without anything
> else, that would be what could probably go in
> uncontroversially, making the remaining amount of changes
> quite a bit smaller (and touching a more limited set of files).

OK, will do.

Thanks again!
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 18:06:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 18:06:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdm1d-0002NW-51; Wed, 28 Nov 2012 18:06:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <riz@boogers.sf.ca.us>) id 1Tdler-0002AB-4a
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 17:42:49 +0000
Received: from [85.158.138.51:33127] by server-15.bemta-3.messagelabs.com id
	98/49-23779-81D46B05; Wed, 28 Nov 2012 17:42:48 +0000
X-Env-Sender: riz@boogers.sf.ca.us
X-Msg-Ref: server-4.tower-174.messagelabs.com!1354124567!31859937!1
X-Originating-IP: [199.233.217.34]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2215 invoked from network); 28 Nov 2012 17:42:47 -0000
Received: from coconut.tastylime.net (HELO coconut.tastylime.net)
	(199.233.217.34) by server-4.tower-174.messagelabs.com with SMTP;
	28 Nov 2012 17:42:47 -0000
Received: from slash.local (199-83-220-231.PUBLIC.monkeybrains.net
	[199.83.220.231])
	by coconut.tastylime.net (Postfix) with ESMTP id EC21265D14;
	Wed, 28 Nov 2012 09:42:45 -0800 (PST)
Message-ID: <50B64D15.2060004@boogers.sf.ca.us>
Date: Wed, 28 Nov 2012 09:42:45 -0800
From: Jeff Rizzo <riz@boogers.sf.ca.us>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com> <50B622B4.6010103@citrix.com>
	<20121128152919.GA11947@panix.com> <50B63262.3030407@citrix.com>
In-Reply-To: <50B63262.3030407@citrix.com>
X-Mailman-Approved-At: Wed, 28 Nov 2012 18:06:20 +0000
Cc: Thor Lancelot Simon <tls@panix.com>,
	"port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/28/12 7:48 AM, Roger Pau Monn=E9 wrote:
> On 28/11/12 16:29, Thor Lancelot Simon wrote:
>
>> It seems highly unlikely to me that a problem with the loop device driver
>> on Linux is tremendously relevant to NetBSD.
>>
>> But, even if there is some problem with vnd backed by NFS, that hardly
>> seems like it would be a good reason to make a change that reduces I/O
>> throughput for the *non* NFS-backed case by at least 20%.  Why would one
>> keep disk images for guests, as a general rule, on NFS, rather than simp=
ly
>> doing the NFS mounts on the guests themselves, or using a more sensible
>> protocol like iSCSI?  I have to assume most folks using files as disks a=
re
>> storing them on local filesystems on the dom0, and wrecking performance
>> for that case to solve a problem with NFS that may or may not be hypothe=
tical
>> seems like a very, very bad trade-off.
> Quite a lot of people use disk images on NFS, because it's probably the
> easiest shared storage that allows migration of guests.

I agree that this is a case we should be supporting well.  We don't =

support migration yet, but I'd like to see this change in the nearish =

future.

>
> Even if disks on NFS was a remote possibility not used by much people I
> don't think it's acceptable to have a Dom0 crash when you try to create
> a guest with a disk on NFS, that is by far much more worse than
> performance degradation in my opinion.

And, of course, a crash is suboptimal.  :)

>
> If this is not accepted, I will have to detect image format somewhere
> and use qemu when the format is different than raw.

I would definitely like to see some middle-ground compromise that allows =

us to keep decent performance for local files while still allowing them =

for NFS.

+j


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 18:06:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 18:06:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdm1d-0002NW-51; Wed, 28 Nov 2012 18:06:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <riz@boogers.sf.ca.us>) id 1Tdler-0002AB-4a
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 17:42:49 +0000
Received: from [85.158.138.51:33127] by server-15.bemta-3.messagelabs.com id
	98/49-23779-81D46B05; Wed, 28 Nov 2012 17:42:48 +0000
X-Env-Sender: riz@boogers.sf.ca.us
X-Msg-Ref: server-4.tower-174.messagelabs.com!1354124567!31859937!1
X-Originating-IP: [199.233.217.34]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2215 invoked from network); 28 Nov 2012 17:42:47 -0000
Received: from coconut.tastylime.net (HELO coconut.tastylime.net)
	(199.233.217.34) by server-4.tower-174.messagelabs.com with SMTP;
	28 Nov 2012 17:42:47 -0000
Received: from slash.local (199-83-220-231.PUBLIC.monkeybrains.net
	[199.83.220.231])
	by coconut.tastylime.net (Postfix) with ESMTP id EC21265D14;
	Wed, 28 Nov 2012 09:42:45 -0800 (PST)
Message-ID: <50B64D15.2060004@boogers.sf.ca.us>
Date: Wed, 28 Nov 2012 09:42:45 -0800
From: Jeff Rizzo <riz@boogers.sf.ca.us>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com> <50B622B4.6010103@citrix.com>
	<20121128152919.GA11947@panix.com> <50B63262.3030407@citrix.com>
In-Reply-To: <50B63262.3030407@citrix.com>
X-Mailman-Approved-At: Wed, 28 Nov 2012 18:06:20 +0000
Cc: Thor Lancelot Simon <tls@panix.com>,
	"port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/28/12 7:48 AM, Roger Pau Monn=E9 wrote:
> On 28/11/12 16:29, Thor Lancelot Simon wrote:
>
>> It seems highly unlikely to me that a problem with the loop device driver
>> on Linux is tremendously relevant to NetBSD.
>>
>> But, even if there is some problem with vnd backed by NFS, that hardly
>> seems like it would be a good reason to make a change that reduces I/O
>> throughput for the *non* NFS-backed case by at least 20%.  Why would one
>> keep disk images for guests, as a general rule, on NFS, rather than simp=
ly
>> doing the NFS mounts on the guests themselves, or using a more sensible
>> protocol like iSCSI?  I have to assume most folks using files as disks a=
re
>> storing them on local filesystems on the dom0, and wrecking performance
>> for that case to solve a problem with NFS that may or may not be hypothe=
tical
>> seems like a very, very bad trade-off.
> Quite a lot of people use disk images on NFS, because it's probably the
> easiest shared storage that allows migration of guests.

I agree that this is a case we should be supporting well.  We don't =

support migration yet, but I'd like to see this change in the nearish =

future.

>
> Even if disks on NFS was a remote possibility not used by much people I
> don't think it's acceptable to have a Dom0 crash when you try to create
> a guest with a disk on NFS, that is by far much more worse than
> performance degradation in my opinion.

And, of course, a crash is suboptimal.  :)

>
> If this is not accepted, I will have to detect image format somewhere
> and use qemu when the format is different than raw.

I would definitely like to see some middle-ground compromise that allows =

us to keep decent performance for local files while still allowing them =

for NFS.

+j


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 18:20:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 18:20:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdmEn-0002jX-7z; Wed, 28 Nov 2012 18:19:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bouyer@antioche.eu.org>) id 1TdmEl-0002jJ-P6
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 18:19:55 +0000
Received: from [85.158.143.35:18097] by server-2.bemta-4.messagelabs.com id
	66/5D-28922-BC556B05; Wed, 28 Nov 2012 18:19:55 +0000
X-Env-Sender: bouyer@antioche.eu.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1354126793!13310730!1
X-Originating-IP: [62.212.96.44]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31729 invoked from network); 28 Nov 2012 18:19:54 -0000
Received: from bouyer.net1.nerim.net (HELO chassiron.antioche.eu.org)
	(62.212.96.44) by server-16.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 18:19:54 -0000
Received: from rochebonne.antioche.eu.org (rochebonne
	[IPv6:2001:7a8:242c:0:213:72ff:fe8e:9910])
	by chassiron.antioche.eu.org (8.14.4/8.12.11) with ESMTP id
	qASIJZjf025226; Wed, 28 Nov 2012 19:19:35 +0100 (MET)
Received: by rochebonne.antioche.eu.org (Postfix, from userid 1210)
	id 2873B2A39; Wed, 28 Nov 2012 19:19:35 +0100 (CET)
Date: Wed, 28 Nov 2012 19:19:35 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Roger Pau Monne <roger.pau@citrix.com>
Message-ID: <20121128181934.GA906@asim.lip6.fr>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354108851-2383-2-git-send-email-roger.pau@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6
	(chassiron.antioche.eu.org [IPv6:2001:7a8:242c:1::1]);
	Wed, 28 Nov 2012 19:19:35 +0100 (MET)
Cc: port-xen@NetBSD.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 02:20:51PM +0100, Roger Pau Monne wrote:
> This forces libxl to use Qemu when a raw image file is used as a disk
> backend. NetBSD currently only supports qemu-traditional, so
> device_model_version="qemu-xen-traditional" has to be added to the
> config file when using image files.

Why ? This impose a trip to userland, which is expensive.
xenbackendd should still call the backend script, right ?
Why not let it do its job and map the file to a vnd(4) ?

I don't support this change.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 18:20:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 18:20:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdmEn-0002jX-7z; Wed, 28 Nov 2012 18:19:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bouyer@antioche.eu.org>) id 1TdmEl-0002jJ-P6
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 18:19:55 +0000
Received: from [85.158.143.35:18097] by server-2.bemta-4.messagelabs.com id
	66/5D-28922-BC556B05; Wed, 28 Nov 2012 18:19:55 +0000
X-Env-Sender: bouyer@antioche.eu.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1354126793!13310730!1
X-Originating-IP: [62.212.96.44]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31729 invoked from network); 28 Nov 2012 18:19:54 -0000
Received: from bouyer.net1.nerim.net (HELO chassiron.antioche.eu.org)
	(62.212.96.44) by server-16.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 18:19:54 -0000
Received: from rochebonne.antioche.eu.org (rochebonne
	[IPv6:2001:7a8:242c:0:213:72ff:fe8e:9910])
	by chassiron.antioche.eu.org (8.14.4/8.12.11) with ESMTP id
	qASIJZjf025226; Wed, 28 Nov 2012 19:19:35 +0100 (MET)
Received: by rochebonne.antioche.eu.org (Postfix, from userid 1210)
	id 2873B2A39; Wed, 28 Nov 2012 19:19:35 +0100 (CET)
Date: Wed, 28 Nov 2012 19:19:35 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Roger Pau Monne <roger.pau@citrix.com>
Message-ID: <20121128181934.GA906@asim.lip6.fr>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354108851-2383-2-git-send-email-roger.pau@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6
	(chassiron.antioche.eu.org [IPv6:2001:7a8:242c:1::1]);
	Wed, 28 Nov 2012 19:19:35 +0100 (MET)
Cc: port-xen@NetBSD.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 02:20:51PM +0100, Roger Pau Monne wrote:
> This forces libxl to use Qemu when a raw image file is used as a disk
> backend. NetBSD currently only supports qemu-traditional, so
> device_model_version="qemu-xen-traditional" has to be added to the
> config file when using image files.

Why ? This impose a trip to userland, which is expensive.
xenbackendd should still call the backend script, right ?
Why not let it do its job and map the file to a vnd(4) ?

I don't support this change.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 18:20:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 18:20:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdmFK-0002n6-Ll; Wed, 28 Nov 2012 18:20:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TdmFJ-0002mr-M1
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 18:20:29 +0000
Received: from [85.158.143.35:33164] by server-2.bemta-4.messagelabs.com id
	88/DD-28922-CE556B05; Wed, 28 Nov 2012 18:20:28 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354126818!15805838!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16270 invoked from network); 28 Nov 2012 18:20:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 18:20:28 -0000
X-IronPort-AV: E=Sophos;i="4.84,180,1355097600"; d="scan'208";a="16054334"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 18:18:59 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 18:18:59 +0000
Message-ID: <50B65592.2000000@citrix.com>
Date: Wed, 28 Nov 2012 19:18:58 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Jeff Rizzo <riz@boogers.sf.ca.us>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com> <50B622B4.6010103@citrix.com>
	<20121128152919.GA11947@panix.com> <50B63262.3030407@citrix.com>
	<50B64D15.2060004@boogers.sf.ca.us>
In-Reply-To: <50B64D15.2060004@boogers.sf.ca.us>
Cc: Thor Lancelot Simon <tls@panix.com>,
	"port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/12 18:42, Jeff Rizzo wrote:
> On 11/28/12 7:48 AM, Roger Pau Monn=E9 wrote:
>> On 28/11/12 16:29, Thor Lancelot Simon wrote:
>>
>>> It seems highly unlikely to me that a problem with the loop device driv=
er
>>> on Linux is tremendously relevant to NetBSD.
>>>
>>> But, even if there is some problem with vnd backed by NFS, that hardly
>>> seems like it would be a good reason to make a change that reduces I/O
>>> throughput for the *non* NFS-backed case by at least 20%.  Why would one
>>> keep disk images for guests, as a general rule, on NFS, rather than sim=
ply
>>> doing the NFS mounts on the guests themselves, or using a more sensible
>>> protocol like iSCSI?  I have to assume most folks using files as disks =
are
>>> storing them on local filesystems on the dom0, and wrecking performance
>>> for that case to solve a problem with NFS that may or may not be hypoth=
etical
>>> seems like a very, very bad trade-off.
>> Quite a lot of people use disk images on NFS, because it's probably the
>> easiest shared storage that allows migration of guests.
> =

> I agree that this is a case we should be supporting well.  We don't =

> support migration yet, but I'd like to see this change in the nearish =

> future.
> =

>>
>> Even if disks on NFS was a remote possibility not used by much people I
>> don't think it's acceptable to have a Dom0 crash when you try to create
>> a guest with a disk on NFS, that is by far much more worse than
>> performance degradation in my opinion.
> =

> And, of course, a crash is suboptimal.  :)
> =

>>
>> If this is not accepted, I will have to detect image format somewhere
>> and use qemu when the format is different than raw.
> =

> I would definitely like to see some middle-ground compromise that allows =

> us to keep decent performance for local files while still allowing them =

> for NFS.

Well, I think the performance is not that bad, given that we are using
qemu-traditional and the Dom0 is not MP. We can archive better
performance by fixing qemu-upstream to work with NetBSD and of course
getting a MP Dom0.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 18:20:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 18:20:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdmFK-0002n6-Ll; Wed, 28 Nov 2012 18:20:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TdmFJ-0002mr-M1
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 18:20:29 +0000
Received: from [85.158.143.35:33164] by server-2.bemta-4.messagelabs.com id
	88/DD-28922-CE556B05; Wed, 28 Nov 2012 18:20:28 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354126818!15805838!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDQ2MTc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16270 invoked from network); 28 Nov 2012 18:20:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 18:20:28 -0000
X-IronPort-AV: E=Sophos;i="4.84,180,1355097600"; d="scan'208";a="16054334"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	28 Nov 2012 18:18:59 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Wed, 28 Nov 2012 18:18:59 +0000
Message-ID: <50B65592.2000000@citrix.com>
Date: Wed, 28 Nov 2012 19:18:58 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Jeff Rizzo <riz@boogers.sf.ca.us>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com> <50B622B4.6010103@citrix.com>
	<20121128152919.GA11947@panix.com> <50B63262.3030407@citrix.com>
	<50B64D15.2060004@boogers.sf.ca.us>
In-Reply-To: <50B64D15.2060004@boogers.sf.ca.us>
Cc: Thor Lancelot Simon <tls@panix.com>,
	"port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/12 18:42, Jeff Rizzo wrote:
> On 11/28/12 7:48 AM, Roger Pau Monn=E9 wrote:
>> On 28/11/12 16:29, Thor Lancelot Simon wrote:
>>
>>> It seems highly unlikely to me that a problem with the loop device driv=
er
>>> on Linux is tremendously relevant to NetBSD.
>>>
>>> But, even if there is some problem with vnd backed by NFS, that hardly
>>> seems like it would be a good reason to make a change that reduces I/O
>>> throughput for the *non* NFS-backed case by at least 20%.  Why would one
>>> keep disk images for guests, as a general rule, on NFS, rather than sim=
ply
>>> doing the NFS mounts on the guests themselves, or using a more sensible
>>> protocol like iSCSI?  I have to assume most folks using files as disks =
are
>>> storing them on local filesystems on the dom0, and wrecking performance
>>> for that case to solve a problem with NFS that may or may not be hypoth=
etical
>>> seems like a very, very bad trade-off.
>> Quite a lot of people use disk images on NFS, because it's probably the
>> easiest shared storage that allows migration of guests.
> =

> I agree that this is a case we should be supporting well.  We don't =

> support migration yet, but I'd like to see this change in the nearish =

> future.
> =

>>
>> Even if disks on NFS was a remote possibility not used by much people I
>> don't think it's acceptable to have a Dom0 crash when you try to create
>> a guest with a disk on NFS, that is by far much more worse than
>> performance degradation in my opinion.
> =

> And, of course, a crash is suboptimal.  :)
> =

>>
>> If this is not accepted, I will have to detect image format somewhere
>> and use qemu when the format is different than raw.
> =

> I would definitely like to see some middle-ground compromise that allows =

> us to keep decent performance for local files while still allowing them =

> for NFS.

Well, I think the performance is not that bad, given that we are using
qemu-traditional and the Dom0 is not MP. We can archive better
performance by fixing qemu-upstream to work with NetBSD and of course
getting a MP Dom0.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 18:20:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 18:20:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdmFV-0002oa-5x; Wed, 28 Nov 2012 18:20:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <emdel@playhack.net>) id 1TdmFT-0002oJ-Py
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 18:20:40 +0000
Received: from [193.109.254.147:31843] by server-2.bemta-14.messagelabs.com id
	7B/E0-20829-7F556B05; Wed, 28 Nov 2012 18:20:39 +0000
X-Env-Sender: emdel@playhack.net
X-Msg-Ref: server-16.tower-27.messagelabs.com!1354126835!8535810!1
X-Originating-IP: [209.85.214.173]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21592 invoked from network); 28 Nov 2012 18:20:36 -0000
Received: from mail-ob0-f173.google.com (HELO mail-ob0-f173.google.com)
	(209.85.214.173)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 18:20:36 -0000
Received: by mail-ob0-f173.google.com with SMTP id xn12so1920321obc.32
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 10:20:35 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:x-originating-ip:in-reply-to:references:date
	:message-id:subject:from:to:cc:content-type:x-gm-message-state;
	bh=dWEZJc2Ond4VlC7l5HJS5TGikZD1vI7RwR8LR+Pc7n0=;
	b=QRgtBkrU7pv4qkvSANJpmNg52Oo5FP2asS4iBAiiC1BvP8k8FfryZcLlUNPy9umPdb
	HtYKRsSkSc5mluoYz6c3Kko6vQmjYUvPNYwWDFgvkLY15ddLXAvXe9HarTqjcvG+Lovv
	AYsJtztoOvjYxlFmXx2HPSIRny6m4mrw4o04RtZ7ZTjDLrqxnzm24WRmTLF+eEXyW7NN
	Sd6xXr3aINfIYUnz09koLLCWzUIh4AuvNfLsqCT+BSn6PqYx780NIZF05lselLlGNPuY
	3McJ1msxS+Dx/66hNUUyVZ9xd7z4dCLIJ6Sr+n+CGvwVSvhbLHJy9el/pTe5DGoFn6+E
	T1qw==
MIME-Version: 1.0
Received: by 10.182.69.50 with SMTP id b18mr4885854obu.75.1354126834888; Wed,
	28 Nov 2012 10:20:34 -0800 (PST)
Received: by 10.182.89.228 with HTTP; Wed, 28 Nov 2012 10:20:34 -0800 (PST)
X-Originating-IP: [80.13.75.21]
In-Reply-To: <50B62858.8040302@citrix.com>
References: <CALKiAsHQaAC0JcP1zqkhENicCf2o-jsBUiBopyhuhvBUv__D+w@mail.gmail.com>
	<50B62858.8040302@citrix.com>
Date: Wed, 28 Nov 2012 19:20:34 +0100
Message-ID: <CALKiAsE-oODbjKGbMc3XYwVY-nJ2tnFVkKRbp52QuZ3XUV2kEA@mail.gmail.com>
From: emdel <emdel@playhack.net>
To: Mats Petersson <mats.petersson@citrix.com>
X-Gm-Message-State: ALoCoQk+fhxEhZWhUWZ0yH4HVaw2lHIgWbnngKvY/QkD5CVJF9Rr05fevcdyaHdiuYNSQye5445V
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] CR3 Virtual Address
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4606380841661152911=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4606380841661152911==
Content-Type: multipart/alternative; boundary=14dae93b5780f96e7204cf923883

--14dae93b5780f96e7204cf923883
Content-Type: text/plain; charset=ISO-8859-1

On Wed, Nov 28, 2012 at 4:06 PM, Mats Petersson
<mats.petersson@citrix.com>wrote:

> As per Andy Cooper's answer, but further:
> Exactly (or at least roughly) what are you trying to achieve?
> You want to "remove" some memory from the hypervisor itself? Who/what will
> use this memory?
> It is MUCH easier to advice on HOW to do something if we understand what
> you are actually trying to do.



For my project I'm trying to dump all physical memory of the machine from
hypervisor layer so I can get access to all physical memory. Then when I
obtained the dump of the physical pages I want to find out the VMCS
structures
of the running guests. In order to do that I was thinking that I can insert
an entry
into a HV page table that maps an arbitrary virtual address into a determine
physical address. By using this trick I should be able to map all the
physical
memory address and read/dump it by reading the virtual address.

So following this solution my problem now is to find out the virtual
address of
the page directory pointer table (pae address mode 32 bits).



> The "HOST_CR3" is the Xen (VCPU's) true CR3 (for the "host" or "root"
> mode, as Intel calls it - this is the hypervisor itself). it is set from
> vcpu.arch.cr3. So the VMCS is available here, or the system would crash
> when it returns from guest operation.



Ok, perfect.



>
> 3) Are there functions to perform the page walking on the hypervisor
>>    page tables?
>>
> Yes. As per Andy Cooper's answer.
>


Actually we would like to know if there are any functions for mapping a
physical page into a virtual page. Could you please point me out in more
precisely way to the name of those functions?  I'm working with pae address
mode 32 bits.


Thanks

--14dae93b5780f96e7204cf923883
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Wed, Nov 28, 2012 at 4:06 PM, Mats Petersson <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:mats.petersson@citrix.com" target=3D"_blank">mats.petersson@ci=
trix.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"=
gmail_quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex">As per Andy Cooper&#39;s =
answer, but further:<br>
Exactly (or at least roughly) what are you trying to achieve?<br>
You want to &quot;remove&quot; some memory from the hypervisor itself? Who/=
what will use this memory?<br>
It is MUCH easier to advice on HOW to do something if we understand what yo=
u are actually trying to do.</blockquote><div><br><br>For my project I&#39;=
m trying to dump all physical memory of the machine from<br>
hypervisor layer so I can get access to all physical memory. Then when I<br=
>
obtained the dump of the physical pages I want to find out the VMCS structu=
res<br>
of the running guests. In order to do that I was thinking that I can insert=
 an entry<br>
into a HV page table that maps an arbitrary virtual address into a determin=
e<br>
physical address. By using this trick I should be able to map all the physi=
cal<br>
memory address and read/dump it by reading the virtual address.<br>
<br>
So following this solution my problem now is to find out the virtual addres=
s of<br>
the page directory pointer table (pae address mode 32 bits).</div><div><br>=
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e=
x;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=3D"im=
"></div>

The &quot;HOST_CR3&quot; is the Xen (VCPU&#39;s) true CR3 (for the &quot;ho=
st&quot; or &quot;root&quot; mode, as Intel calls it - this is the hypervis=
or itself). it is set from vcpu.arch.cr3. So the VMCS is available here, or=
 the system would crash when it returns from guest operation.</blockquote>
<div><br><br>
Ok, perfect.<br><br>=A0</div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1=
ex"><div class=3D"im"><br><blockquote class=3D"gmail_quote" style=3D"margin=
:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"=
>

3) Are there functions to perform the page walking on the hypervisor<br>
=A0 =A0page tables?<br>
</blockquote></div>
Yes. As per Andy Cooper&#39;s answer.<br></blockquote><div><br><br>
Actually we would like to know if there are any functions for mapping a<br>
physical page into a virtual page. Could you please point me out in more<br=
>
precisely way to the name of those functions? =A0I&#39;m working with pae a=
ddress<br>
mode 32 bits.<br><br><br>Thanks<br>=A0</div></div></div>

--14dae93b5780f96e7204cf923883--


--===============4606380841661152911==
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.xen.org
http://lists.xen.org/xen-devel

--===============4606380841661152911==--


From xen-devel-bounces@lists.xen.org Wed Nov 28 18:20:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 18:20:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdmFV-0002oa-5x; Wed, 28 Nov 2012 18:20:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <emdel@playhack.net>) id 1TdmFT-0002oJ-Py
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 18:20:40 +0000
Received: from [193.109.254.147:31843] by server-2.bemta-14.messagelabs.com id
	7B/E0-20829-7F556B05; Wed, 28 Nov 2012 18:20:39 +0000
X-Env-Sender: emdel@playhack.net
X-Msg-Ref: server-16.tower-27.messagelabs.com!1354126835!8535810!1
X-Originating-IP: [209.85.214.173]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21592 invoked from network); 28 Nov 2012 18:20:36 -0000
Received: from mail-ob0-f173.google.com (HELO mail-ob0-f173.google.com)
	(209.85.214.173)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 18:20:36 -0000
Received: by mail-ob0-f173.google.com with SMTP id xn12so1920321obc.32
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 10:20:35 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:x-originating-ip:in-reply-to:references:date
	:message-id:subject:from:to:cc:content-type:x-gm-message-state;
	bh=dWEZJc2Ond4VlC7l5HJS5TGikZD1vI7RwR8LR+Pc7n0=;
	b=QRgtBkrU7pv4qkvSANJpmNg52Oo5FP2asS4iBAiiC1BvP8k8FfryZcLlUNPy9umPdb
	HtYKRsSkSc5mluoYz6c3Kko6vQmjYUvPNYwWDFgvkLY15ddLXAvXe9HarTqjcvG+Lovv
	AYsJtztoOvjYxlFmXx2HPSIRny6m4mrw4o04RtZ7ZTjDLrqxnzm24WRmTLF+eEXyW7NN
	Sd6xXr3aINfIYUnz09koLLCWzUIh4AuvNfLsqCT+BSn6PqYx780NIZF05lselLlGNPuY
	3McJ1msxS+Dx/66hNUUyVZ9xd7z4dCLIJ6Sr+n+CGvwVSvhbLHJy9el/pTe5DGoFn6+E
	T1qw==
MIME-Version: 1.0
Received: by 10.182.69.50 with SMTP id b18mr4885854obu.75.1354126834888; Wed,
	28 Nov 2012 10:20:34 -0800 (PST)
Received: by 10.182.89.228 with HTTP; Wed, 28 Nov 2012 10:20:34 -0800 (PST)
X-Originating-IP: [80.13.75.21]
In-Reply-To: <50B62858.8040302@citrix.com>
References: <CALKiAsHQaAC0JcP1zqkhENicCf2o-jsBUiBopyhuhvBUv__D+w@mail.gmail.com>
	<50B62858.8040302@citrix.com>
Date: Wed, 28 Nov 2012 19:20:34 +0100
Message-ID: <CALKiAsE-oODbjKGbMc3XYwVY-nJ2tnFVkKRbp52QuZ3XUV2kEA@mail.gmail.com>
From: emdel <emdel@playhack.net>
To: Mats Petersson <mats.petersson@citrix.com>
X-Gm-Message-State: ALoCoQk+fhxEhZWhUWZ0yH4HVaw2lHIgWbnngKvY/QkD5CVJF9Rr05fevcdyaHdiuYNSQye5445V
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] CR3 Virtual Address
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4606380841661152911=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4606380841661152911==
Content-Type: multipart/alternative; boundary=14dae93b5780f96e7204cf923883

--14dae93b5780f96e7204cf923883
Content-Type: text/plain; charset=ISO-8859-1

On Wed, Nov 28, 2012 at 4:06 PM, Mats Petersson
<mats.petersson@citrix.com>wrote:

> As per Andy Cooper's answer, but further:
> Exactly (or at least roughly) what are you trying to achieve?
> You want to "remove" some memory from the hypervisor itself? Who/what will
> use this memory?
> It is MUCH easier to advice on HOW to do something if we understand what
> you are actually trying to do.



For my project I'm trying to dump all physical memory of the machine from
hypervisor layer so I can get access to all physical memory. Then when I
obtained the dump of the physical pages I want to find out the VMCS
structures
of the running guests. In order to do that I was thinking that I can insert
an entry
into a HV page table that maps an arbitrary virtual address into a determine
physical address. By using this trick I should be able to map all the
physical
memory address and read/dump it by reading the virtual address.

So following this solution my problem now is to find out the virtual
address of
the page directory pointer table (pae address mode 32 bits).



> The "HOST_CR3" is the Xen (VCPU's) true CR3 (for the "host" or "root"
> mode, as Intel calls it - this is the hypervisor itself). it is set from
> vcpu.arch.cr3. So the VMCS is available here, or the system would crash
> when it returns from guest operation.



Ok, perfect.



>
> 3) Are there functions to perform the page walking on the hypervisor
>>    page tables?
>>
> Yes. As per Andy Cooper's answer.
>


Actually we would like to know if there are any functions for mapping a
physical page into a virtual page. Could you please point me out in more
precisely way to the name of those functions?  I'm working with pae address
mode 32 bits.


Thanks

--14dae93b5780f96e7204cf923883
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Wed, Nov 28, 2012 at 4:06 PM, Mats Petersson <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:mats.petersson@citrix.com" target=3D"_blank">mats.petersson@ci=
trix.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"=
gmail_quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex">As per Andy Cooper&#39;s =
answer, but further:<br>
Exactly (or at least roughly) what are you trying to achieve?<br>
You want to &quot;remove&quot; some memory from the hypervisor itself? Who/=
what will use this memory?<br>
It is MUCH easier to advice on HOW to do something if we understand what yo=
u are actually trying to do.</blockquote><div><br><br>For my project I&#39;=
m trying to dump all physical memory of the machine from<br>
hypervisor layer so I can get access to all physical memory. Then when I<br=
>
obtained the dump of the physical pages I want to find out the VMCS structu=
res<br>
of the running guests. In order to do that I was thinking that I can insert=
 an entry<br>
into a HV page table that maps an arbitrary virtual address into a determin=
e<br>
physical address. By using this trick I should be able to map all the physi=
cal<br>
memory address and read/dump it by reading the virtual address.<br>
<br>
So following this solution my problem now is to find out the virtual addres=
s of<br>
the page directory pointer table (pae address mode 32 bits).</div><div><br>=
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e=
x;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=3D"im=
"></div>

The &quot;HOST_CR3&quot; is the Xen (VCPU&#39;s) true CR3 (for the &quot;ho=
st&quot; or &quot;root&quot; mode, as Intel calls it - this is the hypervis=
or itself). it is set from vcpu.arch.cr3. So the VMCS is available here, or=
 the system would crash when it returns from guest operation.</blockquote>
<div><br><br>
Ok, perfect.<br><br>=A0</div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1=
ex"><div class=3D"im"><br><blockquote class=3D"gmail_quote" style=3D"margin=
:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"=
>

3) Are there functions to perform the page walking on the hypervisor<br>
=A0 =A0page tables?<br>
</blockquote></div>
Yes. As per Andy Cooper&#39;s answer.<br></blockquote><div><br><br>
Actually we would like to know if there are any functions for mapping a<br>
physical page into a virtual page. Could you please point me out in more<br=
>
precisely way to the name of those functions? =A0I&#39;m working with pae a=
ddress<br>
mode 32 bits.<br><br><br>Thanks<br>=A0</div></div></div>

--14dae93b5780f96e7204cf923883--


--===============4606380841661152911==
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.xen.org
http://lists.xen.org/xen-devel

--===============4606380841661152911==--


From xen-devel-bounces@lists.xen.org Wed Nov 28 18:22:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 18:22:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdmH5-000382-TG; Wed, 28 Nov 2012 18:22:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bouyer@antioche.eu.org>) id 1TdmH5-00037t-Bn
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 18:22:19 +0000
Received: from [85.158.138.51:47556] by server-6.bemta-3.messagelabs.com id
	32/61-28265-A5656B05; Wed, 28 Nov 2012 18:22:18 +0000
X-Env-Sender: bouyer@antioche.eu.org
X-Msg-Ref: server-11.tower-174.messagelabs.com!1354126937!31885855!1
X-Originating-IP: [62.212.96.44]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4868 invoked from network); 28 Nov 2012 18:22:17 -0000
Received: from bouyer.net1.nerim.net (HELO chassiron.antioche.eu.org)
	(62.212.96.44) by server-11.tower-174.messagelabs.com with SMTP;
	28 Nov 2012 18:22:17 -0000
Received: from rochebonne.antioche.eu.org (rochebonne
	[IPv6:2001:7a8:242c:0:213:72ff:fe8e:9910])
	by chassiron.antioche.eu.org (8.14.4/8.12.11) with ESMTP id
	qASIMBHF023446; Wed, 28 Nov 2012 19:22:11 +0100 (MET)
Received: by rochebonne.antioche.eu.org (Postfix, from userid 1210)
	id 506BF2A39; Wed, 28 Nov 2012 19:22:11 +0100 (CET)
Date: Wed, 28 Nov 2012 19:22:11 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Jeff Rizzo <riz@boogers.sf.ca.us>
Message-ID: <20121128182211.GB906@asim.lip6.fr>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com> <50B622B4.6010103@citrix.com>
	<20121128152919.GA11947@panix.com> <50B63262.3030407@citrix.com>
	<50B64D15.2060004@boogers.sf.ca.us>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B64D15.2060004@boogers.sf.ca.us>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6
	(chassiron.antioche.eu.org [IPv6:2001:7a8:242c:1::1]);
	Wed, 28 Nov 2012 19:22:11 +0100 (MET)
Cc: Thor Lancelot Simon <tls@panix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"port-xen@netbsd.org" <port-xen@NetBSD.org>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 09:42:45AM -0800, Jeff Rizzo wrote:
> [...]
> >
> >If this is not accepted, I will have to detect image format somewhere
> >and use qemu when the format is different than raw.
> 
> I would definitely like to see some middle-ground compromise that
> allows us to keep decent performance for local files while still
> allowing them for NFS.

using the in-kernel or qemu backend should be configurable.
We have a domU configuration file, lets just use it !

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 18:22:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 18:22:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdmH5-000382-TG; Wed, 28 Nov 2012 18:22:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bouyer@antioche.eu.org>) id 1TdmH5-00037t-Bn
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 18:22:19 +0000
Received: from [85.158.138.51:47556] by server-6.bemta-3.messagelabs.com id
	32/61-28265-A5656B05; Wed, 28 Nov 2012 18:22:18 +0000
X-Env-Sender: bouyer@antioche.eu.org
X-Msg-Ref: server-11.tower-174.messagelabs.com!1354126937!31885855!1
X-Originating-IP: [62.212.96.44]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4868 invoked from network); 28 Nov 2012 18:22:17 -0000
Received: from bouyer.net1.nerim.net (HELO chassiron.antioche.eu.org)
	(62.212.96.44) by server-11.tower-174.messagelabs.com with SMTP;
	28 Nov 2012 18:22:17 -0000
Received: from rochebonne.antioche.eu.org (rochebonne
	[IPv6:2001:7a8:242c:0:213:72ff:fe8e:9910])
	by chassiron.antioche.eu.org (8.14.4/8.12.11) with ESMTP id
	qASIMBHF023446; Wed, 28 Nov 2012 19:22:11 +0100 (MET)
Received: by rochebonne.antioche.eu.org (Postfix, from userid 1210)
	id 506BF2A39; Wed, 28 Nov 2012 19:22:11 +0100 (CET)
Date: Wed, 28 Nov 2012 19:22:11 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Jeff Rizzo <riz@boogers.sf.ca.us>
Message-ID: <20121128182211.GB906@asim.lip6.fr>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com> <50B622B4.6010103@citrix.com>
	<20121128152919.GA11947@panix.com> <50B63262.3030407@citrix.com>
	<50B64D15.2060004@boogers.sf.ca.us>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B64D15.2060004@boogers.sf.ca.us>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6
	(chassiron.antioche.eu.org [IPv6:2001:7a8:242c:1::1]);
	Wed, 28 Nov 2012 19:22:11 +0100 (MET)
Cc: Thor Lancelot Simon <tls@panix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"port-xen@netbsd.org" <port-xen@NetBSD.org>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 09:42:45AM -0800, Jeff Rizzo wrote:
> [...]
> >
> >If this is not accepted, I will have to detect image format somewhere
> >and use qemu when the format is different than raw.
> 
> I would definitely like to see some middle-ground compromise that
> allows us to keep decent performance for local files while still
> allowing them for NFS.

using the in-kernel or qemu backend should be configurable.
We have a domU configuration file, lets just use it !

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 18:23:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 18:23:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdmIB-0003Hn-CB; Wed, 28 Nov 2012 18:23:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bouyer@antioche.eu.org>) id 1TdmI9-0003HS-Oe
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 18:23:25 +0000
Received: from [85.158.143.99:12142] by server-3.bemta-4.messagelabs.com id
	70/46-06841-D9656B05; Wed, 28 Nov 2012 18:23:25 +0000
X-Env-Sender: bouyer@antioche.eu.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1354127004!26486869!1
X-Originating-IP: [62.212.96.44]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32159 invoked from network); 28 Nov 2012 18:23:24 -0000
Received: from bouyer.net1.nerim.net (HELO chassiron.antioche.eu.org)
	(62.212.96.44) by server-4.tower-216.messagelabs.com with SMTP;
	28 Nov 2012 18:23:24 -0000
Received: from rochebonne.antioche.eu.org (rochebonne
	[IPv6:2001:7a8:242c:0:213:72ff:fe8e:9910])
	by chassiron.antioche.eu.org (8.14.4/8.12.11) with ESMTP id
	qASINJNo026548; Wed, 28 Nov 2012 19:23:19 +0100 (MET)
Received: by rochebonne.antioche.eu.org (Postfix, from userid 1210)
	id 64E892A39; Wed, 28 Nov 2012 19:23:19 +0100 (CET)
Date: Wed, 28 Nov 2012 19:23:19 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Message-ID: <20121128182319.GC906@asim.lip6.fr>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com> <50B622B4.6010103@citrix.com>
	<20121128152919.GA11947@panix.com> <50B63262.3030407@citrix.com>
	<50B64D15.2060004@boogers.sf.ca.us> <50B65592.2000000@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B65592.2000000@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6
	(chassiron.antioche.eu.org [IPv6:2001:7a8:242c:1::1]);
	Wed, 28 Nov 2012 19:23:19 +0100 (MET)
Cc: Thor Lancelot Simon <tls@panix.com>, Jeff Rizzo <riz@boogers.sf.ca.us>,
	"port-xen@netbsd.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 07:18:58PM +0100, Roger Pau Monn=E9 wrote:
> Well, I think the performance is not that bad, given that we are using
> qemu-traditional and the Dom0 is not MP. We can archive better
> performance by fixing qemu-upstream to work with NetBSD and of course
> getting a MP Dom0.

But it'll still be slower than a in-kernel backend driver.


-- =

Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 18:23:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 18:23:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdmIB-0003Hn-CB; Wed, 28 Nov 2012 18:23:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bouyer@antioche.eu.org>) id 1TdmI9-0003HS-Oe
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 18:23:25 +0000
Received: from [85.158.143.99:12142] by server-3.bemta-4.messagelabs.com id
	70/46-06841-D9656B05; Wed, 28 Nov 2012 18:23:25 +0000
X-Env-Sender: bouyer@antioche.eu.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1354127004!26486869!1
X-Originating-IP: [62.212.96.44]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32159 invoked from network); 28 Nov 2012 18:23:24 -0000
Received: from bouyer.net1.nerim.net (HELO chassiron.antioche.eu.org)
	(62.212.96.44) by server-4.tower-216.messagelabs.com with SMTP;
	28 Nov 2012 18:23:24 -0000
Received: from rochebonne.antioche.eu.org (rochebonne
	[IPv6:2001:7a8:242c:0:213:72ff:fe8e:9910])
	by chassiron.antioche.eu.org (8.14.4/8.12.11) with ESMTP id
	qASINJNo026548; Wed, 28 Nov 2012 19:23:19 +0100 (MET)
Received: by rochebonne.antioche.eu.org (Postfix, from userid 1210)
	id 64E892A39; Wed, 28 Nov 2012 19:23:19 +0100 (CET)
Date: Wed, 28 Nov 2012 19:23:19 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Message-ID: <20121128182319.GC906@asim.lip6.fr>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com> <50B622B4.6010103@citrix.com>
	<20121128152919.GA11947@panix.com> <50B63262.3030407@citrix.com>
	<50B64D15.2060004@boogers.sf.ca.us> <50B65592.2000000@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B65592.2000000@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6
	(chassiron.antioche.eu.org [IPv6:2001:7a8:242c:1::1]);
	Wed, 28 Nov 2012 19:23:19 +0100 (MET)
Cc: Thor Lancelot Simon <tls@panix.com>, Jeff Rizzo <riz@boogers.sf.ca.us>,
	"port-xen@netbsd.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 07:18:58PM +0100, Roger Pau Monn=E9 wrote:
> Well, I think the performance is not that bad, given that we are using
> qemu-traditional and the Dom0 is not MP. We can archive better
> performance by fixing qemu-upstream to work with NetBSD and of course
> getting a MP Dom0.

But it'll still be slower than a in-kernel backend driver.


-- =

Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 18:47:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 18:47:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdmel-00041F-4l; Wed, 28 Nov 2012 18:46:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <tls@panix.com>) id 1Tdmek-000415-C1
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 18:46:46 +0000
Received: from [85.158.137.99:53019] by server-9.bemta-3.messagelabs.com id
	25/D7-02388-41C56B05; Wed, 28 Nov 2012 18:46:44 +0000
X-Env-Sender: tls@panix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1354128400!16182332!1
X-Originating-IP: [166.84.1.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTY2Ljg0LjEuODkgPT4gMjgzOTI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10029 invoked from network); 28 Nov 2012 18:46:40 -0000
Received: from mailbackend.panix.com (HELO mailbackend.panix.com) (166.84.1.89)
	by server-11.tower-217.messagelabs.com with SMTP;
	28 Nov 2012 18:46:40 -0000
Received: from panix5.panix.com (panix5.panix.com [166.84.1.5])
	by mailbackend.panix.com (Postfix) with ESMTP id 337A62E612;
	Wed, 28 Nov 2012 13:46:40 -0500 (EST)
Received: by panix5.panix.com (Postfix, from userid 415)
	id 216FE2429B; Wed, 28 Nov 2012 13:46:40 -0500 (EST)
Date: Wed, 28 Nov 2012 13:46:40 -0500
From: Thor Lancelot Simon <tls@panix.com>
To: Roger Pau Monn? <roger.pau@citrix.com>
Message-ID: <20121128184639.GB11388@panix.com>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com> <50B622B4.6010103@citrix.com>
	<20121128152919.GA11947@panix.com> <50B63262.3030407@citrix.com>
	<50B64D15.2060004@boogers.sf.ca.us> <50B65592.2000000@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B65592.2000000@citrix.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: Jeff Rizzo <riz@boogers.sf.ca.us>,
	"port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 07:18:58PM +0100, Roger Pau Monn? wrote:
> 
> Well, I think the performance is not that bad, given that we are using
> qemu-traditional and the Dom0 is not MP. We can archive better
> performance by fixing qemu-upstream to work with NetBSD and of course
> getting a MP Dom0.

Why is it a reasonable assumption that adding more CPU resource will
make a significant difference to I/O throughput?

-- 
 Thor Lancelot Simon	                                      tls@panix.com
   But as he knew no bad language, he had called him all the names of common
 objects that he could think of, and had screamed: "You lamp!  You towel!  You
 plate!" and so on.              --Sigmund Freud

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 18:47:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 18:47:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdmel-00041F-4l; Wed, 28 Nov 2012 18:46:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <tls@panix.com>) id 1Tdmek-000415-C1
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 18:46:46 +0000
Received: from [85.158.137.99:53019] by server-9.bemta-3.messagelabs.com id
	25/D7-02388-41C56B05; Wed, 28 Nov 2012 18:46:44 +0000
X-Env-Sender: tls@panix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1354128400!16182332!1
X-Originating-IP: [166.84.1.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTY2Ljg0LjEuODkgPT4gMjgzOTI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10029 invoked from network); 28 Nov 2012 18:46:40 -0000
Received: from mailbackend.panix.com (HELO mailbackend.panix.com) (166.84.1.89)
	by server-11.tower-217.messagelabs.com with SMTP;
	28 Nov 2012 18:46:40 -0000
Received: from panix5.panix.com (panix5.panix.com [166.84.1.5])
	by mailbackend.panix.com (Postfix) with ESMTP id 337A62E612;
	Wed, 28 Nov 2012 13:46:40 -0500 (EST)
Received: by panix5.panix.com (Postfix, from userid 415)
	id 216FE2429B; Wed, 28 Nov 2012 13:46:40 -0500 (EST)
Date: Wed, 28 Nov 2012 13:46:40 -0500
From: Thor Lancelot Simon <tls@panix.com>
To: Roger Pau Monn? <roger.pau@citrix.com>
Message-ID: <20121128184639.GB11388@panix.com>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com> <50B622B4.6010103@citrix.com>
	<20121128152919.GA11947@panix.com> <50B63262.3030407@citrix.com>
	<50B64D15.2060004@boogers.sf.ca.us> <50B65592.2000000@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B65592.2000000@citrix.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: Jeff Rizzo <riz@boogers.sf.ca.us>,
	"port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 07:18:58PM +0100, Roger Pau Monn? wrote:
> 
> Well, I think the performance is not that bad, given that we are using
> qemu-traditional and the Dom0 is not MP. We can archive better
> performance by fixing qemu-upstream to work with NetBSD and of course
> getting a MP Dom0.

Why is it a reasonable assumption that adding more CPU resource will
make a significant difference to I/O throughput?

-- 
 Thor Lancelot Simon	                                      tls@panix.com
   But as he knew no bad language, he had called him all the names of common
 objects that he could think of, and had screamed: "You lamp!  You towel!  You
 plate!" and so on.              --Sigmund Freud

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 19:26:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 19:26:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdnHH-00053q-Uv; Wed, 28 Nov 2012 19:26:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TdnHG-00053l-NN
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 19:26:35 +0000
Received: from [85.158.138.51:44935] by server-16.bemta-3.messagelabs.com id
	7B/CE-07461-06566B05; Wed, 28 Nov 2012 19:26:24 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1354130772!23857376!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODE1MjA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19384 invoked from network); 28 Nov 2012 19:26:16 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 19:26:16 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASJQ6pj019766
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 19:26:07 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASJQ6bQ001866
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 19:26:06 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASJQ52Q001626; Wed, 28 Nov 2012 13:26:05 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 28 Nov 2012 11:26:05 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 74ED7E00967; Wed, 28 Nov 2012 14:26:01 -0500 (EST)
Date: Wed, 28 Nov 2012 14:26:01 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Message-ID: <20121128192601.GA15871@phenom.dumpdata.com>
References: <DE8DF0795D48FD4CA783C40EC82923353942F9@SHSMSX101.ccr.corp.intel.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923353942F9@SHSMSX101.ccr.corp.intel.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"lenb@kernel.org" <lenb@kernel.org>
Subject: Re: [Xen-devel] [PATCH V1 1/2] Xen acpi memory hotplug driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 21, 2012 at 11:45:04AM +0000, Liu, Jinsong wrote:
> >From 630c65690c878255ce71e7c1172338ed08709273 Mon Sep 17 00:00:00 2001
> From: Liu Jinsong <jinsong.liu@intel.com>
> Date: Tue, 20 Nov 2012 21:14:37 +0800
> Subject: [PATCH 1/2] Xen acpi memory hotplug driver
> 
> Xen acpi memory hotplug consists of 2 logic components:
> Xen acpi memory hotplug driver and Xen hypercall.
> 
> This patch implement Xen acpi memory hotplug driver. When running
> under xen platform, Xen driver will early occupy (so native driver

How will it 'early occupy'? Can you spell it out here please?

> will be blocked). When acpi memory notify OSPM, xen driver will take
> effect, adding related memory device and parsing memory information.
> 
> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
> ---
>  drivers/xen/Kconfig               |   11 +
>  drivers/xen/Makefile              |    1 +
>  drivers/xen/xen-acpi-memhotplug.c |  383 +++++++++++++++++++++++++++++++++++++
>  3 files changed, 395 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/xen/xen-acpi-memhotplug.c
> 
> diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
> index 126d8ce..abd0396 100644
> --- a/drivers/xen/Kconfig
> +++ b/drivers/xen/Kconfig
> @@ -206,4 +206,15 @@ config XEN_MCE_LOG
>  	  Allow kernel fetching MCE error from Xen platform and
>  	  converting it into Linux mcelog format for mcelog tools
>  
> +config XEN_ACPI_MEMORY_HOTPLUG
> +	bool "Xen ACPI memory hotplug"

There should be a way to make this a module.


> +	depends on XEN_DOM0 && X86_64 && ACPI
> +	default n
> +	help
> +	  This is Xen acpi memory hotplug.
                      ^^^^ -> ACPI

> +
> +	  Currently Xen only support acpi memory hot-add. If you want
                                     ^^^^-> ACPI

> +	  to hot-add memory at runtime (the hot-added memory cannot be
> +	  removed until machine stop), select Y here, otherwise select N.
> +
>  endmenu
> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> index 7435470..c339eb4 100644
> --- a/drivers/xen/Makefile
> +++ b/drivers/xen/Makefile
> @@ -30,6 +30,7 @@ obj-$(CONFIG_XEN_MCE_LOG)		+= mcelog.o
>  obj-$(CONFIG_XEN_PCIDEV_BACKEND)	+= xen-pciback/
>  obj-$(CONFIG_XEN_PRIVCMD)		+= xen-privcmd.o
>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)	+= xen-acpi-processor.o
> +obj-$(CONFIG_XEN_ACPI_MEMORY_HOTPLUG)	+= xen-acpi-memhotplug.o
>  xen-evtchn-y				:= evtchn.o
>  xen-gntdev-y				:= gntdev.o
>  xen-gntalloc-y				:= gntalloc.o
> diff --git a/drivers/xen/xen-acpi-memhotplug.c b/drivers/xen/xen-acpi-memhotplug.c
> new file mode 100644
> index 0000000..f0c7990
> --- /dev/null
> +++ b/drivers/xen/xen-acpi-memhotplug.c
> @@ -0,0 +1,383 @@
> +/*
> + * Copyright (C) 2012 Intel Corporation
> + *    Author: Liu Jinsong <jinsong.liu@intel.com>
> + *    Author: Jiang Yunhong <yunhong.jiang@intel.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or (at
> + * your option) any later version.
> + *
> + * 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, GOOD TITLE or
> + * NON INFRINGEMENT.  See the GNU General Public License for more
> + * details.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/types.h>
> +#include <acpi/acpi_drivers.h>
> +
> +#define ACPI_MEMORY_DEVICE_CLASS		"memory"
> +#define ACPI_MEMORY_DEVICE_HID			"PNP0C80"
> +#define ACPI_MEMORY_DEVICE_NAME			"Hotplug Mem Device"

Weird tabs?

> +
> +#undef PREFIX

Why the #undef ?
> +#define PREFIX "ACPI:memory_hp:"


Not "ACPI:memory_xen:" ?


> +
> +static int acpi_memory_device_add(struct acpi_device *device);
> +static int acpi_memory_device_remove(struct acpi_device *device, int type);
> +
> +static const struct acpi_device_id memory_device_ids[] = {
> +	{ACPI_MEMORY_DEVICE_HID, 0},
> +	{"", 0},
> +};
> +
> +static struct acpi_driver acpi_memory_device_driver = {
> +	.name = "acpi_memhotplug",

Not 'xen_acpi_memhotplug' ?

> +	.class = ACPI_MEMORY_DEVICE_CLASS,
> +	.ids = memory_device_ids,
> +	.ops = {
> +		.add = acpi_memory_device_add,
> +		.remove = acpi_memory_device_remove,

Just for sake of clarity I would prefix those with 'xen_'.

> +		},
> +};
> +
> +struct acpi_memory_info {
> +	struct list_head list;
> +	u64 start_addr;		/* Memory Range start physical addr */
> +	u64 length;		/* Memory Range length */
> +	unsigned short caching;	/* memory cache attribute */
> +	unsigned short write_protect;	/* memory read/write attribute */

Can't the write_protect by a bit field like the 'enabled'? So
	unsigned int write_protect:1;
?
> +	unsigned int enabled:1;
> +};
> +
> +struct acpi_memory_device {
> +	struct acpi_device *device;
> +	struct list_head res_list;
> +};
> +
> +static int acpi_hotmem_initialized;

Just make it a bool and also use __read_mostly please.

> +
> +
> +int xen_acpi_memory_enable_device(struct acpi_memory_device *mem_device)
> +{
> +	return 0;
> +}

Why even have this function if it does not do anything?

> +
> +static acpi_status
> +acpi_memory_get_resource(struct acpi_resource *resource, void *context)
> +{
> +	struct acpi_memory_device *mem_device = context;
> +	struct acpi_resource_address64 address64;
> +	struct acpi_memory_info *info, *new;
> +	acpi_status status;
> +
> +	status = acpi_resource_to_address64(resource, &address64);
> +	if (ACPI_FAILURE(status) ||
> +	    (address64.resource_type != ACPI_MEMORY_RANGE))
> +		return AE_OK;
> +
> +	list_for_each_entry(info, &mem_device->res_list, list) {
> +		/* Can we combine the resource range information? */

I don't know? Is this is a future TODO?

> +		if ((info->caching == address64.info.mem.caching) &&
> +		    (info->write_protect == address64.info.mem.write_protect) &&
> +		    (info->start_addr + info->length == address64.minimum)) {
> +			info->length += address64.address_length;
> +			return AE_OK;
> +		}
> +	}
> +
> +	new = kzalloc(sizeof(struct acpi_memory_info), GFP_KERNEL);
> +	if (!new)
> +		return AE_ERROR;
> +
> +	INIT_LIST_HEAD(&new->list);
> +	new->caching = address64.info.mem.caching;
> +	new->write_protect = address64.info.mem.write_protect;
> +	new->start_addr = address64.minimum;
> +	new->length = address64.address_length;
> +	list_add_tail(&new->list, &mem_device->res_list);
> +
> +	return AE_OK;
> +}
> +
> +static int
> +acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
> +{
> +	acpi_status status;
> +	struct acpi_memory_info *info, *n;
> +
> +	if (!list_empty(&mem_device->res_list))
> +		return 0;
> +
> +	status = acpi_walk_resources(mem_device->device->handle,
> +		METHOD_NAME__CRS, acpi_memory_get_resource, mem_device);
> +
> +	if (ACPI_FAILURE(status)) {
> +		list_for_each_entry_safe(info, n, &mem_device->res_list, list)
> +			kfree(info);
> +		INIT_LIST_HEAD(&mem_device->res_list);
> +		return -EINVAL;
> +	}
> +
> +	return 0;
> +}
> +
> +static int
> +acpi_memory_get_device(acpi_handle handle,
> +		       struct acpi_memory_device **mem_device)
> +{
> +	acpi_status status;
> +	acpi_handle phandle;
> +	struct acpi_device *device = NULL;
> +	struct acpi_device *pdevice = NULL;
> +	int result;
> +
> +	if (!acpi_bus_get_device(handle, &device) && device)
> +		goto end;
> +
> +	status = acpi_get_parent(handle, &phandle);
> +	if (ACPI_FAILURE(status)) {
> +		pr_warn(PREFIX "Cannot find acpi parent\n");
> +		return -EINVAL;
> +	}
> +
> +	/* Get the parent device */
> +	result = acpi_bus_get_device(phandle, &pdevice);
> +	if (result) {
> +		pr_warn(PREFIX "Cannot get acpi bus device\n");
> +		return -EINVAL;
> +	}
> +
> +	/*
> +	 * Now add the notified device.  This creates the acpi_device
> +	 * and invokes .add function
> +	 */
> +	result = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
> +	if (result) {
> +		pr_warn(PREFIX "Cannot add acpi bus\n");
> +		return -EINVAL;
> +	}
> +
> +end:
> +	*mem_device = acpi_driver_data(device);
> +	if (!(*mem_device)) {
> +		pr_err(PREFIX "Driver data not found\n");
> +		return -ENODEV;
> +	}
> +
> +	return 0;
> +}
> +
> +static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
> +{
> +	unsigned long long current_status;
> +
> +	/* Get device present/absent information from the _STA */
> +	if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle,
> +				"_STA", NULL, &current_status)))
> +		return -ENODEV;
> +	/*
> +	 * Check for device status. Device should be
> +	 * present/enabled/functioning.
> +	 */
> +	if (!((current_status & ACPI_STA_DEVICE_PRESENT)
> +	      && (current_status & ACPI_STA_DEVICE_ENABLED)
> +	      && (current_status & ACPI_STA_DEVICE_FUNCTIONING)))
> +		return -ENODEV;
> +
> +	return 0;
> +}
> +
> +static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
> +{
> +	pr_warn(PREFIX "Xen does not support memory hotremove\n");
> +
> +	return -ENOSYS;
> +}
> +
> +static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
> +{
> +	struct acpi_memory_device *mem_device;
> +	struct acpi_device *device;
> +	u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */
> +
> +	switch (event) {
> +	case ACPI_NOTIFY_BUS_CHECK:
> +		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
> +			"\nReceived BUS CHECK notification for device\n"));
> +		/* Fall Through */
> +	case ACPI_NOTIFY_DEVICE_CHECK:
> +		if (event == ACPI_NOTIFY_DEVICE_CHECK)
> +			ACPI_DEBUG_PRINT((ACPI_DB_INFO,
> +			"\nReceived DEVICE CHECK notification for device\n"));
> +
> +		if (acpi_memory_get_device(handle, &mem_device)) {
> +			pr_err(PREFIX "Cannot find driver data\n");
> +			break;
> +		}
> +
> +		ost_code = ACPI_OST_SC_SUCCESS;
> +		break;
> +
> +	case ACPI_NOTIFY_EJECT_REQUEST:
> +		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
> +			"\nReceived EJECT REQUEST notification for device\n"));
> +
> +		if (acpi_bus_get_device(handle, &device)) {
> +			pr_err(PREFIX "Device doesn't exist\n");
> +			break;
> +		}
> +		mem_device = acpi_driver_data(device);
> +		if (!mem_device) {
> +			pr_err(PREFIX "Driver Data is NULL\n");
> +			break;
> +		}
> +
> +		/*
> +		 * TBD: implement acpi_memory_disable_device and invoke
> +		 * acpi_bus_remove if Xen support hotremove in the future
> +		 */
> +		acpi_memory_disable_device(mem_device);
> +		break;
> +
> +	default:
> +		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
> +				  "Unsupported event [0x%x]\n", event));
> +		/* non-hotplug event; possibly handled by other handler */
> +		return;
> +	}
> +
> +	/* Inform firmware that the hotplug operation has completed */
> +	(void) acpi_evaluate_hotplug_ost(handle, event, ost_code, NULL);


Hm, even if we failed? Say for the ACPI_NOTIFY_EJECT_REQUEST ?

> +	return;
> +}
> +
> +static int acpi_memory_device_add(struct acpi_device *device)
> +{
> +	int result;
> +	struct acpi_memory_device *mem_device = NULL;
> +
> +
> +	if (!device)
> +		return -EINVAL;
> +
> +	mem_device = kzalloc(sizeof(struct acpi_memory_device), GFP_KERNEL);
> +	if (!mem_device)
> +		return -ENOMEM;
> +
> +	INIT_LIST_HEAD(&mem_device->res_list);
> +	mem_device->device = device;
> +	sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME);
> +	sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS);
> +	device->driver_data = mem_device;
> +
> +	/* Get the range from the _CRS */
> +	result = acpi_memory_get_device_resources(mem_device);
> +	if (result) {
> +		kfree(mem_device);
> +		return result;
> +	}
> +
> +	/*
> +	 * Early boot code has recognized memory area by EFI/E820.
> +	 * If DSDT shows these memory devices on boot, hotplug is not necessary
> +	 * for them. So, it just returns until completion of this driver's
> +	 * start up.
> +	 */
> +	if (!acpi_hotmem_initialized)
> +		return 0;
> +
> +	if (!acpi_memory_check_device(mem_device))
> +		result = xen_acpi_memory_enable_device(mem_device);

This is a nop. Could you just do:
		result = 0;
?

> +
> +	return result;
> +}
> +
> +static int acpi_memory_device_remove(struct acpi_device *device, int type)
> +{
> +	struct acpi_memory_device *mem_device = NULL;
> +
> +	if (!device || !acpi_driver_data(device))
> +		return -EINVAL;
> +
> +	mem_device = acpi_driver_data(device);
> +	kfree(mem_device);
> +
> +	return 0;
> +}
> +
> +/*
> + * Helper function to check for memory device
> + */
> +static acpi_status is_memory_device(acpi_handle handle)
> +{
> +	char *hardware_id;
> +	acpi_status status;
> +	struct acpi_device_info *info;
> +
> +	status = acpi_get_object_info(handle, &info);
> +	if (ACPI_FAILURE(status))
> +		return status;
> +
> +	if (!(info->valid & ACPI_VALID_HID)) {
> +		kfree(info);
> +		return AE_ERROR;
> +	}
> +
> +	hardware_id = info->hardware_id.string;
> +	if ((hardware_id == NULL) ||
> +	    (strcmp(hardware_id, ACPI_MEMORY_DEVICE_HID)))
> +		status = AE_ERROR;
> +
> +	kfree(info);
> +	return status;
> +}
> +
> +static acpi_status
> +acpi_memory_register_notify_handler(acpi_handle handle,
> +				    u32 level, void *ctxt, void **retv)
> +{
> +	acpi_status status;
> +
> +	status = is_memory_device(handle);
> +	if (ACPI_FAILURE(status))
> +		return AE_OK;	/* continue */
> +
> +	status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
> +					     acpi_memory_device_notify, NULL);
> +	/* continue */
> +	return AE_OK;
> +}
> +
> +static int __init xen_acpi_memory_device_init(void)
> +{
> +	int result;
> +	acpi_status status;
> +
> +	/* only dom0 is responsible for xen acpi memory hotplug */
> +	if (!xen_initial_domain())
> +		return -ENODEV;
> +
> +	result = acpi_bus_register_driver(&acpi_memory_device_driver);
> +	if (result < 0)
> +		return -ENODEV;
> +
> +	status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
> +				     ACPI_UINT32_MAX,
> +				     acpi_memory_register_notify_handler, NULL,
> +				     NULL, NULL);
> +
> +	if (ACPI_FAILURE(status)) {
> +		pr_warn(PREFIX "walk_namespace failed\n");
> +		acpi_bus_unregister_driver(&acpi_memory_device_driver);
> +		return -ENODEV;
> +	}
> +
> +	acpi_hotmem_initialized = 1;
> +	return 0;
> +}
> +subsys_initcall(xen_acpi_memory_device_init);
> -- 
> 1.7.1



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 19:26:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 19:26:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdnHH-00053q-Uv; Wed, 28 Nov 2012 19:26:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TdnHG-00053l-NN
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 19:26:35 +0000
Received: from [85.158.138.51:44935] by server-16.bemta-3.messagelabs.com id
	7B/CE-07461-06566B05; Wed, 28 Nov 2012 19:26:24 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1354130772!23857376!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODE1MjA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19384 invoked from network); 28 Nov 2012 19:26:16 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 19:26:16 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASJQ6pj019766
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 19:26:07 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASJQ6bQ001866
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 19:26:06 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASJQ52Q001626; Wed, 28 Nov 2012 13:26:05 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 28 Nov 2012 11:26:05 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 74ED7E00967; Wed, 28 Nov 2012 14:26:01 -0500 (EST)
Date: Wed, 28 Nov 2012 14:26:01 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Message-ID: <20121128192601.GA15871@phenom.dumpdata.com>
References: <DE8DF0795D48FD4CA783C40EC82923353942F9@SHSMSX101.ccr.corp.intel.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923353942F9@SHSMSX101.ccr.corp.intel.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"lenb@kernel.org" <lenb@kernel.org>
Subject: Re: [Xen-devel] [PATCH V1 1/2] Xen acpi memory hotplug driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 21, 2012 at 11:45:04AM +0000, Liu, Jinsong wrote:
> >From 630c65690c878255ce71e7c1172338ed08709273 Mon Sep 17 00:00:00 2001
> From: Liu Jinsong <jinsong.liu@intel.com>
> Date: Tue, 20 Nov 2012 21:14:37 +0800
> Subject: [PATCH 1/2] Xen acpi memory hotplug driver
> 
> Xen acpi memory hotplug consists of 2 logic components:
> Xen acpi memory hotplug driver and Xen hypercall.
> 
> This patch implement Xen acpi memory hotplug driver. When running
> under xen platform, Xen driver will early occupy (so native driver

How will it 'early occupy'? Can you spell it out here please?

> will be blocked). When acpi memory notify OSPM, xen driver will take
> effect, adding related memory device and parsing memory information.
> 
> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
> ---
>  drivers/xen/Kconfig               |   11 +
>  drivers/xen/Makefile              |    1 +
>  drivers/xen/xen-acpi-memhotplug.c |  383 +++++++++++++++++++++++++++++++++++++
>  3 files changed, 395 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/xen/xen-acpi-memhotplug.c
> 
> diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
> index 126d8ce..abd0396 100644
> --- a/drivers/xen/Kconfig
> +++ b/drivers/xen/Kconfig
> @@ -206,4 +206,15 @@ config XEN_MCE_LOG
>  	  Allow kernel fetching MCE error from Xen platform and
>  	  converting it into Linux mcelog format for mcelog tools
>  
> +config XEN_ACPI_MEMORY_HOTPLUG
> +	bool "Xen ACPI memory hotplug"

There should be a way to make this a module.


> +	depends on XEN_DOM0 && X86_64 && ACPI
> +	default n
> +	help
> +	  This is Xen acpi memory hotplug.
                      ^^^^ -> ACPI

> +
> +	  Currently Xen only support acpi memory hot-add. If you want
                                     ^^^^-> ACPI

> +	  to hot-add memory at runtime (the hot-added memory cannot be
> +	  removed until machine stop), select Y here, otherwise select N.
> +
>  endmenu
> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> index 7435470..c339eb4 100644
> --- a/drivers/xen/Makefile
> +++ b/drivers/xen/Makefile
> @@ -30,6 +30,7 @@ obj-$(CONFIG_XEN_MCE_LOG)		+= mcelog.o
>  obj-$(CONFIG_XEN_PCIDEV_BACKEND)	+= xen-pciback/
>  obj-$(CONFIG_XEN_PRIVCMD)		+= xen-privcmd.o
>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)	+= xen-acpi-processor.o
> +obj-$(CONFIG_XEN_ACPI_MEMORY_HOTPLUG)	+= xen-acpi-memhotplug.o
>  xen-evtchn-y				:= evtchn.o
>  xen-gntdev-y				:= gntdev.o
>  xen-gntalloc-y				:= gntalloc.o
> diff --git a/drivers/xen/xen-acpi-memhotplug.c b/drivers/xen/xen-acpi-memhotplug.c
> new file mode 100644
> index 0000000..f0c7990
> --- /dev/null
> +++ b/drivers/xen/xen-acpi-memhotplug.c
> @@ -0,0 +1,383 @@
> +/*
> + * Copyright (C) 2012 Intel Corporation
> + *    Author: Liu Jinsong <jinsong.liu@intel.com>
> + *    Author: Jiang Yunhong <yunhong.jiang@intel.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or (at
> + * your option) any later version.
> + *
> + * 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, GOOD TITLE or
> + * NON INFRINGEMENT.  See the GNU General Public License for more
> + * details.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/types.h>
> +#include <acpi/acpi_drivers.h>
> +
> +#define ACPI_MEMORY_DEVICE_CLASS		"memory"
> +#define ACPI_MEMORY_DEVICE_HID			"PNP0C80"
> +#define ACPI_MEMORY_DEVICE_NAME			"Hotplug Mem Device"

Weird tabs?

> +
> +#undef PREFIX

Why the #undef ?
> +#define PREFIX "ACPI:memory_hp:"


Not "ACPI:memory_xen:" ?


> +
> +static int acpi_memory_device_add(struct acpi_device *device);
> +static int acpi_memory_device_remove(struct acpi_device *device, int type);
> +
> +static const struct acpi_device_id memory_device_ids[] = {
> +	{ACPI_MEMORY_DEVICE_HID, 0},
> +	{"", 0},
> +};
> +
> +static struct acpi_driver acpi_memory_device_driver = {
> +	.name = "acpi_memhotplug",

Not 'xen_acpi_memhotplug' ?

> +	.class = ACPI_MEMORY_DEVICE_CLASS,
> +	.ids = memory_device_ids,
> +	.ops = {
> +		.add = acpi_memory_device_add,
> +		.remove = acpi_memory_device_remove,

Just for sake of clarity I would prefix those with 'xen_'.

> +		},
> +};
> +
> +struct acpi_memory_info {
> +	struct list_head list;
> +	u64 start_addr;		/* Memory Range start physical addr */
> +	u64 length;		/* Memory Range length */
> +	unsigned short caching;	/* memory cache attribute */
> +	unsigned short write_protect;	/* memory read/write attribute */

Can't the write_protect by a bit field like the 'enabled'? So
	unsigned int write_protect:1;
?
> +	unsigned int enabled:1;
> +};
> +
> +struct acpi_memory_device {
> +	struct acpi_device *device;
> +	struct list_head res_list;
> +};
> +
> +static int acpi_hotmem_initialized;

Just make it a bool and also use __read_mostly please.

> +
> +
> +int xen_acpi_memory_enable_device(struct acpi_memory_device *mem_device)
> +{
> +	return 0;
> +}

Why even have this function if it does not do anything?

> +
> +static acpi_status
> +acpi_memory_get_resource(struct acpi_resource *resource, void *context)
> +{
> +	struct acpi_memory_device *mem_device = context;
> +	struct acpi_resource_address64 address64;
> +	struct acpi_memory_info *info, *new;
> +	acpi_status status;
> +
> +	status = acpi_resource_to_address64(resource, &address64);
> +	if (ACPI_FAILURE(status) ||
> +	    (address64.resource_type != ACPI_MEMORY_RANGE))
> +		return AE_OK;
> +
> +	list_for_each_entry(info, &mem_device->res_list, list) {
> +		/* Can we combine the resource range information? */

I don't know? Is this is a future TODO?

> +		if ((info->caching == address64.info.mem.caching) &&
> +		    (info->write_protect == address64.info.mem.write_protect) &&
> +		    (info->start_addr + info->length == address64.minimum)) {
> +			info->length += address64.address_length;
> +			return AE_OK;
> +		}
> +	}
> +
> +	new = kzalloc(sizeof(struct acpi_memory_info), GFP_KERNEL);
> +	if (!new)
> +		return AE_ERROR;
> +
> +	INIT_LIST_HEAD(&new->list);
> +	new->caching = address64.info.mem.caching;
> +	new->write_protect = address64.info.mem.write_protect;
> +	new->start_addr = address64.minimum;
> +	new->length = address64.address_length;
> +	list_add_tail(&new->list, &mem_device->res_list);
> +
> +	return AE_OK;
> +}
> +
> +static int
> +acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
> +{
> +	acpi_status status;
> +	struct acpi_memory_info *info, *n;
> +
> +	if (!list_empty(&mem_device->res_list))
> +		return 0;
> +
> +	status = acpi_walk_resources(mem_device->device->handle,
> +		METHOD_NAME__CRS, acpi_memory_get_resource, mem_device);
> +
> +	if (ACPI_FAILURE(status)) {
> +		list_for_each_entry_safe(info, n, &mem_device->res_list, list)
> +			kfree(info);
> +		INIT_LIST_HEAD(&mem_device->res_list);
> +		return -EINVAL;
> +	}
> +
> +	return 0;
> +}
> +
> +static int
> +acpi_memory_get_device(acpi_handle handle,
> +		       struct acpi_memory_device **mem_device)
> +{
> +	acpi_status status;
> +	acpi_handle phandle;
> +	struct acpi_device *device = NULL;
> +	struct acpi_device *pdevice = NULL;
> +	int result;
> +
> +	if (!acpi_bus_get_device(handle, &device) && device)
> +		goto end;
> +
> +	status = acpi_get_parent(handle, &phandle);
> +	if (ACPI_FAILURE(status)) {
> +		pr_warn(PREFIX "Cannot find acpi parent\n");
> +		return -EINVAL;
> +	}
> +
> +	/* Get the parent device */
> +	result = acpi_bus_get_device(phandle, &pdevice);
> +	if (result) {
> +		pr_warn(PREFIX "Cannot get acpi bus device\n");
> +		return -EINVAL;
> +	}
> +
> +	/*
> +	 * Now add the notified device.  This creates the acpi_device
> +	 * and invokes .add function
> +	 */
> +	result = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
> +	if (result) {
> +		pr_warn(PREFIX "Cannot add acpi bus\n");
> +		return -EINVAL;
> +	}
> +
> +end:
> +	*mem_device = acpi_driver_data(device);
> +	if (!(*mem_device)) {
> +		pr_err(PREFIX "Driver data not found\n");
> +		return -ENODEV;
> +	}
> +
> +	return 0;
> +}
> +
> +static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
> +{
> +	unsigned long long current_status;
> +
> +	/* Get device present/absent information from the _STA */
> +	if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle,
> +				"_STA", NULL, &current_status)))
> +		return -ENODEV;
> +	/*
> +	 * Check for device status. Device should be
> +	 * present/enabled/functioning.
> +	 */
> +	if (!((current_status & ACPI_STA_DEVICE_PRESENT)
> +	      && (current_status & ACPI_STA_DEVICE_ENABLED)
> +	      && (current_status & ACPI_STA_DEVICE_FUNCTIONING)))
> +		return -ENODEV;
> +
> +	return 0;
> +}
> +
> +static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
> +{
> +	pr_warn(PREFIX "Xen does not support memory hotremove\n");
> +
> +	return -ENOSYS;
> +}
> +
> +static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
> +{
> +	struct acpi_memory_device *mem_device;
> +	struct acpi_device *device;
> +	u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */
> +
> +	switch (event) {
> +	case ACPI_NOTIFY_BUS_CHECK:
> +		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
> +			"\nReceived BUS CHECK notification for device\n"));
> +		/* Fall Through */
> +	case ACPI_NOTIFY_DEVICE_CHECK:
> +		if (event == ACPI_NOTIFY_DEVICE_CHECK)
> +			ACPI_DEBUG_PRINT((ACPI_DB_INFO,
> +			"\nReceived DEVICE CHECK notification for device\n"));
> +
> +		if (acpi_memory_get_device(handle, &mem_device)) {
> +			pr_err(PREFIX "Cannot find driver data\n");
> +			break;
> +		}
> +
> +		ost_code = ACPI_OST_SC_SUCCESS;
> +		break;
> +
> +	case ACPI_NOTIFY_EJECT_REQUEST:
> +		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
> +			"\nReceived EJECT REQUEST notification for device\n"));
> +
> +		if (acpi_bus_get_device(handle, &device)) {
> +			pr_err(PREFIX "Device doesn't exist\n");
> +			break;
> +		}
> +		mem_device = acpi_driver_data(device);
> +		if (!mem_device) {
> +			pr_err(PREFIX "Driver Data is NULL\n");
> +			break;
> +		}
> +
> +		/*
> +		 * TBD: implement acpi_memory_disable_device and invoke
> +		 * acpi_bus_remove if Xen support hotremove in the future
> +		 */
> +		acpi_memory_disable_device(mem_device);
> +		break;
> +
> +	default:
> +		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
> +				  "Unsupported event [0x%x]\n", event));
> +		/* non-hotplug event; possibly handled by other handler */
> +		return;
> +	}
> +
> +	/* Inform firmware that the hotplug operation has completed */
> +	(void) acpi_evaluate_hotplug_ost(handle, event, ost_code, NULL);


Hm, even if we failed? Say for the ACPI_NOTIFY_EJECT_REQUEST ?

> +	return;
> +}
> +
> +static int acpi_memory_device_add(struct acpi_device *device)
> +{
> +	int result;
> +	struct acpi_memory_device *mem_device = NULL;
> +
> +
> +	if (!device)
> +		return -EINVAL;
> +
> +	mem_device = kzalloc(sizeof(struct acpi_memory_device), GFP_KERNEL);
> +	if (!mem_device)
> +		return -ENOMEM;
> +
> +	INIT_LIST_HEAD(&mem_device->res_list);
> +	mem_device->device = device;
> +	sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME);
> +	sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS);
> +	device->driver_data = mem_device;
> +
> +	/* Get the range from the _CRS */
> +	result = acpi_memory_get_device_resources(mem_device);
> +	if (result) {
> +		kfree(mem_device);
> +		return result;
> +	}
> +
> +	/*
> +	 * Early boot code has recognized memory area by EFI/E820.
> +	 * If DSDT shows these memory devices on boot, hotplug is not necessary
> +	 * for them. So, it just returns until completion of this driver's
> +	 * start up.
> +	 */
> +	if (!acpi_hotmem_initialized)
> +		return 0;
> +
> +	if (!acpi_memory_check_device(mem_device))
> +		result = xen_acpi_memory_enable_device(mem_device);

This is a nop. Could you just do:
		result = 0;
?

> +
> +	return result;
> +}
> +
> +static int acpi_memory_device_remove(struct acpi_device *device, int type)
> +{
> +	struct acpi_memory_device *mem_device = NULL;
> +
> +	if (!device || !acpi_driver_data(device))
> +		return -EINVAL;
> +
> +	mem_device = acpi_driver_data(device);
> +	kfree(mem_device);
> +
> +	return 0;
> +}
> +
> +/*
> + * Helper function to check for memory device
> + */
> +static acpi_status is_memory_device(acpi_handle handle)
> +{
> +	char *hardware_id;
> +	acpi_status status;
> +	struct acpi_device_info *info;
> +
> +	status = acpi_get_object_info(handle, &info);
> +	if (ACPI_FAILURE(status))
> +		return status;
> +
> +	if (!(info->valid & ACPI_VALID_HID)) {
> +		kfree(info);
> +		return AE_ERROR;
> +	}
> +
> +	hardware_id = info->hardware_id.string;
> +	if ((hardware_id == NULL) ||
> +	    (strcmp(hardware_id, ACPI_MEMORY_DEVICE_HID)))
> +		status = AE_ERROR;
> +
> +	kfree(info);
> +	return status;
> +}
> +
> +static acpi_status
> +acpi_memory_register_notify_handler(acpi_handle handle,
> +				    u32 level, void *ctxt, void **retv)
> +{
> +	acpi_status status;
> +
> +	status = is_memory_device(handle);
> +	if (ACPI_FAILURE(status))
> +		return AE_OK;	/* continue */
> +
> +	status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
> +					     acpi_memory_device_notify, NULL);
> +	/* continue */
> +	return AE_OK;
> +}
> +
> +static int __init xen_acpi_memory_device_init(void)
> +{
> +	int result;
> +	acpi_status status;
> +
> +	/* only dom0 is responsible for xen acpi memory hotplug */
> +	if (!xen_initial_domain())
> +		return -ENODEV;
> +
> +	result = acpi_bus_register_driver(&acpi_memory_device_driver);
> +	if (result < 0)
> +		return -ENODEV;
> +
> +	status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
> +				     ACPI_UINT32_MAX,
> +				     acpi_memory_register_notify_handler, NULL,
> +				     NULL, NULL);
> +
> +	if (ACPI_FAILURE(status)) {
> +		pr_warn(PREFIX "walk_namespace failed\n");
> +		acpi_bus_unregister_driver(&acpi_memory_device_driver);
> +		return -ENODEV;
> +	}
> +
> +	acpi_hotmem_initialized = 1;
> +	return 0;
> +}
> +subsys_initcall(xen_acpi_memory_device_init);
> -- 
> 1.7.1



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 20:15:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 20:15:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdo22-0005Tv-3e; Wed, 28 Nov 2012 20:14:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1Tdo20-0005Tq-Ba
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 20:14:52 +0000
Received: from [85.158.143.35:25713] by server-1.bemta-4.messagelabs.com id
	17/57-27934-BB076B05; Wed, 28 Nov 2012 20:14:51 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354133689!4810376!1
X-Originating-IP: [209.85.214.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8249 invoked from network); 28 Nov 2012 20:14:50 -0000
Received: from mail-ob0-f173.google.com (HELO mail-ob0-f173.google.com)
	(209.85.214.173)
	by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 20:14:50 -0000
Received: by mail-ob0-f173.google.com with SMTP id xn12so2041630obc.32
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 12:14:48 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=iODDKqa0Vqd0dTWKVFW5H9bC8Eb7pIpKTDGBsd67v/g=;
	b=SkBCPfpXO0FjXYpTuT5pQcs+y2nzdLKYvveN7gIzHn9+OtJtAPYf2tkgjnzb36AD79
	2oJzDBp3rkncetT+LJiqMsurRslUPUo/zqSVc/zbLuvfO1tAY/8uCltXDjhQt/lNOdM5
	eV+WTw3ptXQEVB9cCwaJtoeiDevw7GkaEqi/fKfTgu4TScGFSrO/JfvGeeLiH9ZmsJqq
	hgNzkvUnQzvbi5/rW1BODGz9LLCthc+eANUxfx3omSnaUEo5ugnQ9+S3DrXvEC7Yx3qm
	qmQldMNN77AforQhIDwgISUzeP2YPATXa3c6hNWZKwJKIapBt0X/rVJzClXr1w8oSKM7
	xB3w==
Received: by 10.182.146.46 with SMTP id sz14mr5497459obb.76.1354133688729;
	Wed, 28 Nov 2012 12:14:48 -0800 (PST)
Received: from phenom.dumpdata.com
	(50-195-21-189-static.hfc.comcastbusiness.net. [50.195.21.189])
	by mx.google.com with ESMTPS id s5sm19431624obo.10.2012.11.28.12.14.47
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 28 Nov 2012 12:14:48 -0800 (PST)
Date: Wed, 28 Nov 2012 15:14:41 -0500
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <20121128201439.GA3479@phenom.dumpdata.com>
References: <990a88d4-f0f8-427a-bb66-3beda4641186@default>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <990a88d4-f0f8-427a-bb66-3beda4641186@default>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: Kurt Hackel <kurt.hackel@oracle.com>, Konrad Wilk <konrad.wilk@oracle.com>,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] ANNOUNCE: Xen Transcendent Memory support now in
 stock Ubuntu and Fedora guest kernels
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 27, 2012 at 01:24:33PM -0800, Dan Magenheimer wrote:
> FYI, it has come to my attention that both the kernel in the
> recently-released Ubuntu 12.10 (aka Quantal Quetzal) and the
> kernel in Fedora 17 (after yum-update to a 3.5-or-later kernel)
> are fully configured to support Transcendent Memory ("tmem").

Woohoo!
> Oracle's "UEK2" kernel has also had tmem support since its release
> in early 2012.
> 
> To enable tmem support in Xen, it is necessary to specify
> a Xen boot parameter ("tmem").  Specifying "dom0_mem="

There are some extra ones too - tmem_compress tmem_dedup right?

> and disabling dom0 autoballooning in the toolstack is also
> highly recommended.  Then tmem must be explicitly enabled in
> any tmem-capable guest kernel by specifying a boot parameter
> (also "tmem") in each guest grub.conf.  Note that use of
> tmem in dom0 is not recommended, so "tmem" should not be
> provided as a dom0 boot parameter.
> 
> I'll try to write up a more complete current HOW-TO soon
> since much of the Xen tmem documentation floating around
> the web is a bit outdated.
> 
> Note that some security issues were reported in the
> Xen hypervisor tmem implementation last summer.  Please
> ensure your hypervisor is updated to patch XSA-15 before
> enabling tmem on a Xen machine exposed to the internet!
> 
> Thanks,
> Dan
> 
> P.S. If you build your own Linux guest kernels, a 3.5-or-later
> kernel is required built with the following config variables:
> 
> CONFIG_FRONTSWAP=y
> CONFIG_CLEANCACHE=y
> CONFIG_XEN_TMEM=y
> CONFIG_XEN_SELFBALLOONING=y
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 20:15:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 20:15:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdo22-0005Tv-3e; Wed, 28 Nov 2012 20:14:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1Tdo20-0005Tq-Ba
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 20:14:52 +0000
Received: from [85.158.143.35:25713] by server-1.bemta-4.messagelabs.com id
	17/57-27934-BB076B05; Wed, 28 Nov 2012 20:14:51 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354133689!4810376!1
X-Originating-IP: [209.85.214.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8249 invoked from network); 28 Nov 2012 20:14:50 -0000
Received: from mail-ob0-f173.google.com (HELO mail-ob0-f173.google.com)
	(209.85.214.173)
	by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 20:14:50 -0000
Received: by mail-ob0-f173.google.com with SMTP id xn12so2041630obc.32
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 12:14:48 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=iODDKqa0Vqd0dTWKVFW5H9bC8Eb7pIpKTDGBsd67v/g=;
	b=SkBCPfpXO0FjXYpTuT5pQcs+y2nzdLKYvveN7gIzHn9+OtJtAPYf2tkgjnzb36AD79
	2oJzDBp3rkncetT+LJiqMsurRslUPUo/zqSVc/zbLuvfO1tAY/8uCltXDjhQt/lNOdM5
	eV+WTw3ptXQEVB9cCwaJtoeiDevw7GkaEqi/fKfTgu4TScGFSrO/JfvGeeLiH9ZmsJqq
	hgNzkvUnQzvbi5/rW1BODGz9LLCthc+eANUxfx3omSnaUEo5ugnQ9+S3DrXvEC7Yx3qm
	qmQldMNN77AforQhIDwgISUzeP2YPATXa3c6hNWZKwJKIapBt0X/rVJzClXr1w8oSKM7
	xB3w==
Received: by 10.182.146.46 with SMTP id sz14mr5497459obb.76.1354133688729;
	Wed, 28 Nov 2012 12:14:48 -0800 (PST)
Received: from phenom.dumpdata.com
	(50-195-21-189-static.hfc.comcastbusiness.net. [50.195.21.189])
	by mx.google.com with ESMTPS id s5sm19431624obo.10.2012.11.28.12.14.47
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 28 Nov 2012 12:14:48 -0800 (PST)
Date: Wed, 28 Nov 2012 15:14:41 -0500
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <20121128201439.GA3479@phenom.dumpdata.com>
References: <990a88d4-f0f8-427a-bb66-3beda4641186@default>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <990a88d4-f0f8-427a-bb66-3beda4641186@default>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: Kurt Hackel <kurt.hackel@oracle.com>, Konrad Wilk <konrad.wilk@oracle.com>,
	xen-devel@lists.xen.org
Subject: Re: [Xen-devel] ANNOUNCE: Xen Transcendent Memory support now in
 stock Ubuntu and Fedora guest kernels
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 27, 2012 at 01:24:33PM -0800, Dan Magenheimer wrote:
> FYI, it has come to my attention that both the kernel in the
> recently-released Ubuntu 12.10 (aka Quantal Quetzal) and the
> kernel in Fedora 17 (after yum-update to a 3.5-or-later kernel)
> are fully configured to support Transcendent Memory ("tmem").

Woohoo!
> Oracle's "UEK2" kernel has also had tmem support since its release
> in early 2012.
> 
> To enable tmem support in Xen, it is necessary to specify
> a Xen boot parameter ("tmem").  Specifying "dom0_mem="

There are some extra ones too - tmem_compress tmem_dedup right?

> and disabling dom0 autoballooning in the toolstack is also
> highly recommended.  Then tmem must be explicitly enabled in
> any tmem-capable guest kernel by specifying a boot parameter
> (also "tmem") in each guest grub.conf.  Note that use of
> tmem in dom0 is not recommended, so "tmem" should not be
> provided as a dom0 boot parameter.
> 
> I'll try to write up a more complete current HOW-TO soon
> since much of the Xen tmem documentation floating around
> the web is a bit outdated.
> 
> Note that some security issues were reported in the
> Xen hypervisor tmem implementation last summer.  Please
> ensure your hypervisor is updated to patch XSA-15 before
> enabling tmem on a Xen machine exposed to the internet!
> 
> Thanks,
> Dan
> 
> P.S. If you build your own Linux guest kernels, a 3.5-or-later
> kernel is required built with the following config variables:
> 
> CONFIG_FRONTSWAP=y
> CONFIG_CLEANCACHE=y
> CONFIG_XEN_TMEM=y
> CONFIG_XEN_SELFBALLOONING=y
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 20:47:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 20:47:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdoWp-0006YY-Rw; Wed, 28 Nov 2012 20:46:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TdoWo-0006YT-LX
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 20:46:42 +0000
Received: from [85.158.137.99:39758] by server-10.bemta-3.messagelabs.com id
	F2/3F-19806-13876B05; Wed, 28 Nov 2012 20:46:41 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1354135599!17051516!1
X-Originating-IP: [209.85.161.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8624 invoked from network); 28 Nov 2012 20:46:40 -0000
Received: from mail-gg0-f173.google.com (HELO mail-gg0-f173.google.com)
	(209.85.161.173)
	by server-14.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 20:46:40 -0000
Received: by mail-gg0-f173.google.com with SMTP id f2so1137516ggn.32
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 12:46:38 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=suBo73uMlQc6q9dr1ZmISEAleYjGyjGKsDgVTcGlahg=;
	b=xMFPauc7+lIjq1/qBwz40VDW9FLt6+6PytLkQ5eXdemHBm2dYOV5fb/0ZAs1Nn0vwg
	/6jCj1kVQDcH/T6orWC6sIZHNQCeY6392V7Uhau7XAmEisFSO1GD/8DeRXHbhGSztPf9
	eND9appDpZ6gtu/B+9vJF1fGbCimGK1nDGhlhCS8B2aQTOxFLzOUkczuijVrgY6oJJr5
	UMhY6iThsqiI7mPgZiZYT244AEWLJ890ABw4ogbYWgTooOicOHPPk7bow104YbQ4TQs6
	oA5WFJXRnaLG8Y4SpcwyWthlOuz+mmPH7ybAbK369NWjZzeWNGVmnkQcyCD+0YTqT8r+
	Wf2A==
Received: by 10.236.119.146 with SMTP id n18mr20664368yhh.18.1354135598861;
	Wed, 28 Nov 2012 12:46:38 -0800 (PST)
Received: from phenom.dumpdata.com
	(50-195-21-189-static.hfc.comcastbusiness.net. [50.195.21.189])
	by mx.google.com with ESMTPS id y18sm20388931anh.15.2012.11.28.12.46.37
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 28 Nov 2012 12:46:37 -0800 (PST)
Date: Wed, 28 Nov 2012 15:46:32 -0500
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121128204630.GB3479@phenom.dumpdata.com>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
	<1353668646.13542.228.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353668646.13542.228.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, 2012 at 11:04:06AM +0000, Ian Campbell wrote:
> On Tue, 2012-11-20 at 16:16 +0000, Fioravante, Matthew E. wrote:
> > This was something I've been wanting to do for a while so I'm very
> > happy you went ahead and fixed it yourself. Once you submit the linux
> > version I'll test it on my system.
> > 
> > Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> 
> Do we need to synchronise with anything else (Linux drivers?) or I can I
> just throw this into the tree once it is done?
> 
> Are we hanging any existing users of the tpm stuff out to dry? Could we
> get a feature-protocol-v2 flag in xenstore so users at least get an
> error message from either the front or backend to give a hint why it
> isn't working?

We could cop out and just name this new driver differently. Then
we would not have to deal with the older ones.

> 
> >  void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)  {
> > -   tpmif_tx_request_t* tx;
> > -   int offset;
> > -   int i;
> > -   uint32_t domid;
> > -   int tocopy;
> > +   vtpm_shared_page_t* shr;
> > +   unsigned int offset;
> >     int flags;
> > +#ifdef TPMBACK_PRINT_DEBUG
> > +int i;
> > +#endif
> 
> Dodgy indentation? (I saw a bunch of these)
> 
> > - * Copyright (c) 2005, IBM Corporation
> > - *
> > - * Author: Stefan Berger, stefanb@us.ibm.com
> > - * Grant table support: Mahadevan Gomathisankaran
> 
> Did you really remove everything these guys wrote?
> 
> > - * This code has been derived from tools/libxc/xen/io/netif.h
> > - *
> > - * Copyright (c) 2003-2004, Keir Fraser
> 
> I guess I can buy this bit no longer being true given that you reworked
> the whole protocol.
> 
> Ian
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 20:47:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 20:47:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdoWp-0006YY-Rw; Wed, 28 Nov 2012 20:46:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TdoWo-0006YT-LX
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 20:46:42 +0000
Received: from [85.158.137.99:39758] by server-10.bemta-3.messagelabs.com id
	F2/3F-19806-13876B05; Wed, 28 Nov 2012 20:46:41 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1354135599!17051516!1
X-Originating-IP: [209.85.161.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8624 invoked from network); 28 Nov 2012 20:46:40 -0000
Received: from mail-gg0-f173.google.com (HELO mail-gg0-f173.google.com)
	(209.85.161.173)
	by server-14.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	28 Nov 2012 20:46:40 -0000
Received: by mail-gg0-f173.google.com with SMTP id f2so1137516ggn.32
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 12:46:38 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=suBo73uMlQc6q9dr1ZmISEAleYjGyjGKsDgVTcGlahg=;
	b=xMFPauc7+lIjq1/qBwz40VDW9FLt6+6PytLkQ5eXdemHBm2dYOV5fb/0ZAs1Nn0vwg
	/6jCj1kVQDcH/T6orWC6sIZHNQCeY6392V7Uhau7XAmEisFSO1GD/8DeRXHbhGSztPf9
	eND9appDpZ6gtu/B+9vJF1fGbCimGK1nDGhlhCS8B2aQTOxFLzOUkczuijVrgY6oJJr5
	UMhY6iThsqiI7mPgZiZYT244AEWLJ890ABw4ogbYWgTooOicOHPPk7bow104YbQ4TQs6
	oA5WFJXRnaLG8Y4SpcwyWthlOuz+mmPH7ybAbK369NWjZzeWNGVmnkQcyCD+0YTqT8r+
	Wf2A==
Received: by 10.236.119.146 with SMTP id n18mr20664368yhh.18.1354135598861;
	Wed, 28 Nov 2012 12:46:38 -0800 (PST)
Received: from phenom.dumpdata.com
	(50-195-21-189-static.hfc.comcastbusiness.net. [50.195.21.189])
	by mx.google.com with ESMTPS id y18sm20388931anh.15.2012.11.28.12.46.37
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 28 Nov 2012 12:46:37 -0800 (PST)
Date: Wed, 28 Nov 2012 15:46:32 -0500
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121128204630.GB3479@phenom.dumpdata.com>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
	<1353668646.13542.228.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1353668646.13542.228.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "Fioravante, Matthew E." <Matthew.Fioravante@jhuapl.edu>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 23, 2012 at 11:04:06AM +0000, Ian Campbell wrote:
> On Tue, 2012-11-20 at 16:16 +0000, Fioravante, Matthew E. wrote:
> > This was something I've been wanting to do for a while so I'm very
> > happy you went ahead and fixed it yourself. Once you submit the linux
> > version I'll test it on my system.
> > 
> > Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> 
> Do we need to synchronise with anything else (Linux drivers?) or I can I
> just throw this into the tree once it is done?
> 
> Are we hanging any existing users of the tpm stuff out to dry? Could we
> get a feature-protocol-v2 flag in xenstore so users at least get an
> error message from either the front or backend to give a hint why it
> isn't working?

We could cop out and just name this new driver differently. Then
we would not have to deal with the older ones.

> 
> >  void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)  {
> > -   tpmif_tx_request_t* tx;
> > -   int offset;
> > -   int i;
> > -   uint32_t domid;
> > -   int tocopy;
> > +   vtpm_shared_page_t* shr;
> > +   unsigned int offset;
> >     int flags;
> > +#ifdef TPMBACK_PRINT_DEBUG
> > +int i;
> > +#endif
> 
> Dodgy indentation? (I saw a bunch of these)
> 
> > - * Copyright (c) 2005, IBM Corporation
> > - *
> > - * Author: Stefan Berger, stefanb@us.ibm.com
> > - * Grant table support: Mahadevan Gomathisankaran
> 
> Did you really remove everything these guys wrote?
> 
> > - * This code has been derived from tools/libxc/xen/io/netif.h
> > - *
> > - * Copyright (c) 2003-2004, Keir Fraser
> 
> I guess I can buy this bit no longer being true given that you reworked
> the whole protocol.
> 
> Ian
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 21:04:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 21:04:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdony-0006zn-5N; Wed, 28 Nov 2012 21:04:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1Tdonx-0006zg-0W
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 21:04:25 +0000
Received: from [85.158.139.83:20287] by server-2.bemta-5.messagelabs.com id
	C8/9A-04892-85C76B05; Wed, 28 Nov 2012 21:04:24 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1354136662!26848813!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA5MjMwNQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18029 invoked from network); 28 Nov 2012 21:04:23 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 21:04:23 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASL47jn012411
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 21:04:08 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASL468p019896
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 21:04:07 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASL46Wb009437; Wed, 28 Nov 2012 15:04:06 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 28 Nov 2012 13:04:06 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id D5351E00968; Wed, 28 Nov 2012 16:04:01 -0500 (EST)
Date: Wed, 28 Nov 2012 16:04:01 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: greg@enjellic.com
Message-ID: <20121128210401.GB13915@phenom.dumpdata.com>
References: <greg@wind.enjellic.com>
	<201211171517.qAHFHaCC011443@wind.enjellic.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <201211171517.qAHFHaCC011443@wind.enjellic.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>, Qian Hu <qianhu2011@gmail.com>
Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the
 virtual machine created by xl command?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, Nov 17, 2012 at 09:17:36AM -0600, Dr. Greg Wettstein wrote:
> On Nov 14,  3:40pm, "Dr. Greg Wettstein" wrote:
> } Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the v
> 
> Good morning, hope the day is going well for everyone.

Heya!
> 
> > On Nov 13, 10:02am, Ian Campbell wrote:
> > } Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the v
> > 
> > Good afternoon, hope the week is going well for everyone.
> > 
> > > On Tue, 2012-11-13 at 06:30 +0000, Qian Hu wrote:
> > > 
> > > > With spice tool, I have to create a VM by xl command, and now I am
> > > > wondering if it supports VGA passghrouth?
> > 
> > > This list is for the development of Xen. You';d probably have more
> > > luck with these sorts of support requests on the xen-users list.
> > 
> > That would normally be the case but I'm suspicious there are issues
> > with VGA passthrough in 4.2.0.
> 
> I just wanted to follow up to the list on the status of passthrough
> issues.
> 
> We reverted our test machine back to the 2.6.32.45 kernel which we had
> been using in production.  That kernel was based on Jeremy's GIT
> tree.  Using xm and the updated ATI patches which I referenced in my
> original mail passthrough works as it should.
> 
> Passthrough does not work with xl.  Windows started but fell into its
> text mode rescue screen and registered a crash dump.  It flashed the
> screen back and forth between a stipled blue/grey and totally black
> screen a few times and then locked the physical machine up solidly.
> 
> On the next boot I thought about it but declined to register the crash
> dump with Microsoft.... :-)

Ha!
> 
> We then went back and tested the 3.4.18 kernel and with both xm and xl
> the guest faults on the first attempt to do an I/O port access.  All
> factors (windows image, hardware, xen guest config) are held identical
> so the difference would seem to be linked to the PCI passthrough
> implementation between the two kernels.  I've copied Konrad on the
> note since he would seem to be the person most familiar with this
> area.
> 
> I'm including below a diff between a successful qemu-dm passthrough
> session (2.6.32.45) and an unsuccessful session (3.4.18).  It would
> appear 3.4.18 is getting the both the I/O port and memory ranges
> wrong.

Hm, can you also provide the 'lspci -vvv' with the 2.6.32.45 and 3.4.18 kernel?

I am specifically looking to see if there are any:

[from git commit c341ca45ce56143804ef5a8f4db753e554e640b4]
Author: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date:   Tue Sep 25 16:48:24 2012 -0400

   
	.. snip.. 
    -       Region 0: [virtual] Memory at fe8c0000 (32-bit, non-prefetchable) [size=128K]
    -       Region 1: [virtual] Memory at fe800000 (32-bit, non-prefetchable) [size=512K]
    +       Region 0: Memory at fe8c0000 (32-bit, non-prefetchable) [size=128K]
    +       Region 1: Memory at fe800000 (32-bit, non-prefetchable) [size=512K]
            Region 2: I/O ports at c000 [size=32]
    -       Region 3: [virtual] Memory at fe8e0000 (32-bit, non-prefetchable) [size=16K]
    +       Region 3: Memory at fe8e0000 (32-bit, non-prefetchable) [size=16K]
    
    The [virtual] means that lspci read those entries from SysFS but when
    it read them from the device it got a different value (0xfffffff).
   

Any of those '[virtual]' ones? And how are you reserving the PCI devices?
Are you using xen-pciback.hide on the Linux command line?

Does 'xm dmesg' give you an logs? Do the logs have any warnings?
 
> 
> Let me know if I can forward any additional information or run any
> additional tests.
> 
> Have a good weekend.
> 
> Greg
> 
> qemu-dm log diff: ---------------------------------------------------------
> 1c1
> < domid: 3
> ---
> > domid: 1
> 3,5c3,5
> < Watching /local/domain/0/device-model/3/logdirty/cmd
> < Watching /local/domain/0/device-model/3/command
> < Watching /local/domain/3/cpu
> ---
> > Watching /local/domain/0/device-model/1/logdirty/cmd
> > Watching /local/domain/0/device-model/1/command
> > Watching /local/domain/1/cpu
> 9c9
> < Guest uuid = 7fcefb13-d1ef-105b-e38c-1e1454411e80
> ---
> > Guest uuid = eab6bbbb-4819-b970-a83c-03288a1541ad
> 14c14
> < xs_read(/local/domain/0/device-model/3/xen_extended_power_mgmt): read error
> ---
> > xs_read(/local/domain/0/device-model/1/xen_extended_power_mgmt): read error
> 18,20c18,20
> < xs_read(/local/domain/3/log-throttling): read error
> < qemu: ignoring not-understood drive `/local/domain/3/log-throttling'
> < medium change watch on `/local/domain/3/log-throttling' - unknown device, ignored
> ---
> > xs_read(/local/domain/1/log-throttling): read error
> > qemu: ignoring not-understood drive `/local/domain/1/log-throttling'
> > medium change watch on `/local/domain/1/log-throttling' - unknown device, ignored
> 69,106c69,77
> < pt_iomem_map: e_phys=f1020000 maddr=c1a00000 type=0 len=131072 index=2 first_map=1
> < pt_iomem_map: e_phys=f1060000 maddr=c1b22000 type=0 len=4096 index=0 first_map=1
> < pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=1
> < pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=0
> < ati_gfx_init: guest_pio_bar = 0xc600, host_pio_bar = 0x3000, pio_size=0x100 guest_mmio_bar1=0xe0000000, guest_mmio_bar2=0x0
> < platform_fixed_ioport: changed ro/rw state of ROM memory area. now is rw state.
> < platform_fixed_ioport: changed ro/rw state of ROM memory area. now is ro state.
> < pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
> < pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
> < pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
> < pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
> < pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
> < pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
> < pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
> < pt_iomem_map: e_phys=ffffffff maddr=b0000000 type=8 len=268435456 index=0 first_map=0
> < pt_iomem_map: e_phys=ffffffff maddr=c1a00000 type=0 len=131072 index=2 first_map=0
> < pt_iomem_map: e_phys=e0000000 maddr=b0000000 type=8 len=268435456 index=0 first_map=0
> < pt_iomem_map: e_phys=f1020000 maddr=c1a00000 type=0 len=131072 index=2 first_map=0
> < pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=0
> < pt_iomem_map: e_phys=ffffffff maddr=c1b22000 type=0 len=4096 index=0 first_map=0
> < pt_iomem_map: e_phys=f1060000 maddr=c1b22000 type=0 len=4096 index=0 first_map=0
> < pt_iomem_map: e_phys=ffffffff maddr=b0000000 type=8 len=268435456 index=0 first_map=0
> < pt_iomem_map: e_phys=ffffffff maddr=c1a00000 type=0 len=131072 index=2 first_map=0
> < pt_iomem_map: e_phys=e0000000 maddr=b0000000 type=8 len=268435456 index=0 first_map=0
> < pt_iomem_map: e_phys=f1020000 maddr=c1a00000 type=0 len=131072 index=2 first_map=0
> < pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=0
> < pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=0
> < pt_msgctrl_reg_write: guest enabling MSI, disable MSI-INTx translation
> < pci_intx: intx=1
> < pt_msi_disable: Unmap msi with pirq 37
> < pt_msgctrl_reg_write: setup msi for dev 30
> < pt_msi_setup: msi mapped with pirq 37
> < pt_msi_update: Update msi with pirq 37 gvec b0 gflags 0
> < pt_iomem_map: e_phys=ffffffff maddr=c1b22000 type=0 len=4096 index=0 first_map=0
> < pt_iomem_map: e_phys=f1060000 maddr=c1b22000 type=0 len=4096 index=0 first_map=0
> < pt_iomem_map: e_phys=ffffffff maddr=c1b22000 type=0 len=4096 index=0 first_map=0
> < shutdown requested in cpu_handle_ioreq
> < Issued domain 3 poweroff
> ---
> > pt_iomem_map: e_phys=f1000000 maddr=c1a00000 type=0 len=131072 index=2 first_map=1
> > pt_iomem_map: e_phys=f1040000 maddr=c1b22000 type=0 len=4096 index=0 first_map=1
> > pt_ioport_map: e_phys=c700 pio_base=3000 len=256 index=4 first_map=1
> > pt_ioport_map: e_phys=c700 pio_base=3000 len=256 index=4 first_map=0
> > ati_gfx_init: guest_pio_bar = 0xc700, host_pio_bar = 0x3000, pio_size=0x100 guest_mmio_bar1=0xe0000000, guest_mmio_bar2=0x0
> > ati_io_regs_read: Requested read of c74c/51020, mapped: 304c/12364
> > ati_hw_in: port I/O: 304c, base: 3000, size: 100
> > ati_hw_in: ioperm successful
> > ati_hw_in: Read: 0
> ---------------------------------------------------------------------------
> 
> }-- End of excerpt from "Dr. Greg Wettstein"
> 
> As always,
> Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
> 4206 N. 19th Ave.           Specializing in information infra-structure
> Fargo, ND  58102            development.
> PH: 701-281-1686
> FAX: 701-281-3949           EMAIL: greg@enjellic.com
> ------------------------------------------------------------------------------
> "Boy, it must not take much to make a phone work.  Looking at
>  everthing else here it must be the same way with the INTERNET."
>                                 -- Francis 'Fritz' Wettstein

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 21:04:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 21:04:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdony-0006zn-5N; Wed, 28 Nov 2012 21:04:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1Tdonx-0006zg-0W
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 21:04:25 +0000
Received: from [85.158.139.83:20287] by server-2.bemta-5.messagelabs.com id
	C8/9A-04892-85C76B05; Wed, 28 Nov 2012 21:04:24 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1354136662!26848813!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA5MjMwNQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18029 invoked from network); 28 Nov 2012 21:04:23 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-9.tower-182.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 21:04:23 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASL47jn012411
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 21:04:08 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASL468p019896
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 21:04:07 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASL46Wb009437; Wed, 28 Nov 2012 15:04:06 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 28 Nov 2012 13:04:06 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id D5351E00968; Wed, 28 Nov 2012 16:04:01 -0500 (EST)
Date: Wed, 28 Nov 2012 16:04:01 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: greg@enjellic.com
Message-ID: <20121128210401.GB13915@phenom.dumpdata.com>
References: <greg@wind.enjellic.com>
	<201211171517.qAHFHaCC011443@wind.enjellic.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <201211171517.qAHFHaCC011443@wind.enjellic.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>, Qian Hu <qianhu2011@gmail.com>
Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the
 virtual machine created by xl command?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Sat, Nov 17, 2012 at 09:17:36AM -0600, Dr. Greg Wettstein wrote:
> On Nov 14,  3:40pm, "Dr. Greg Wettstein" wrote:
> } Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the v
> 
> Good morning, hope the day is going well for everyone.

Heya!
> 
> > On Nov 13, 10:02am, Ian Campbell wrote:
> > } Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the v
> > 
> > Good afternoon, hope the week is going well for everyone.
> > 
> > > On Tue, 2012-11-13 at 06:30 +0000, Qian Hu wrote:
> > > 
> > > > With spice tool, I have to create a VM by xl command, and now I am
> > > > wondering if it supports VGA passghrouth?
> > 
> > > This list is for the development of Xen. You';d probably have more
> > > luck with these sorts of support requests on the xen-users list.
> > 
> > That would normally be the case but I'm suspicious there are issues
> > with VGA passthrough in 4.2.0.
> 
> I just wanted to follow up to the list on the status of passthrough
> issues.
> 
> We reverted our test machine back to the 2.6.32.45 kernel which we had
> been using in production.  That kernel was based on Jeremy's GIT
> tree.  Using xm and the updated ATI patches which I referenced in my
> original mail passthrough works as it should.
> 
> Passthrough does not work with xl.  Windows started but fell into its
> text mode rescue screen and registered a crash dump.  It flashed the
> screen back and forth between a stipled blue/grey and totally black
> screen a few times and then locked the physical machine up solidly.
> 
> On the next boot I thought about it but declined to register the crash
> dump with Microsoft.... :-)

Ha!
> 
> We then went back and tested the 3.4.18 kernel and with both xm and xl
> the guest faults on the first attempt to do an I/O port access.  All
> factors (windows image, hardware, xen guest config) are held identical
> so the difference would seem to be linked to the PCI passthrough
> implementation between the two kernels.  I've copied Konrad on the
> note since he would seem to be the person most familiar with this
> area.
> 
> I'm including below a diff between a successful qemu-dm passthrough
> session (2.6.32.45) and an unsuccessful session (3.4.18).  It would
> appear 3.4.18 is getting the both the I/O port and memory ranges
> wrong.

Hm, can you also provide the 'lspci -vvv' with the 2.6.32.45 and 3.4.18 kernel?

I am specifically looking to see if there are any:

[from git commit c341ca45ce56143804ef5a8f4db753e554e640b4]
Author: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date:   Tue Sep 25 16:48:24 2012 -0400

   
	.. snip.. 
    -       Region 0: [virtual] Memory at fe8c0000 (32-bit, non-prefetchable) [size=128K]
    -       Region 1: [virtual] Memory at fe800000 (32-bit, non-prefetchable) [size=512K]
    +       Region 0: Memory at fe8c0000 (32-bit, non-prefetchable) [size=128K]
    +       Region 1: Memory at fe800000 (32-bit, non-prefetchable) [size=512K]
            Region 2: I/O ports at c000 [size=32]
    -       Region 3: [virtual] Memory at fe8e0000 (32-bit, non-prefetchable) [size=16K]
    +       Region 3: Memory at fe8e0000 (32-bit, non-prefetchable) [size=16K]
    
    The [virtual] means that lspci read those entries from SysFS but when
    it read them from the device it got a different value (0xfffffff).
   

Any of those '[virtual]' ones? And how are you reserving the PCI devices?
Are you using xen-pciback.hide on the Linux command line?

Does 'xm dmesg' give you an logs? Do the logs have any warnings?
 
> 
> Let me know if I can forward any additional information or run any
> additional tests.
> 
> Have a good weekend.
> 
> Greg
> 
> qemu-dm log diff: ---------------------------------------------------------
> 1c1
> < domid: 3
> ---
> > domid: 1
> 3,5c3,5
> < Watching /local/domain/0/device-model/3/logdirty/cmd
> < Watching /local/domain/0/device-model/3/command
> < Watching /local/domain/3/cpu
> ---
> > Watching /local/domain/0/device-model/1/logdirty/cmd
> > Watching /local/domain/0/device-model/1/command
> > Watching /local/domain/1/cpu
> 9c9
> < Guest uuid = 7fcefb13-d1ef-105b-e38c-1e1454411e80
> ---
> > Guest uuid = eab6bbbb-4819-b970-a83c-03288a1541ad
> 14c14
> < xs_read(/local/domain/0/device-model/3/xen_extended_power_mgmt): read error
> ---
> > xs_read(/local/domain/0/device-model/1/xen_extended_power_mgmt): read error
> 18,20c18,20
> < xs_read(/local/domain/3/log-throttling): read error
> < qemu: ignoring not-understood drive `/local/domain/3/log-throttling'
> < medium change watch on `/local/domain/3/log-throttling' - unknown device, ignored
> ---
> > xs_read(/local/domain/1/log-throttling): read error
> > qemu: ignoring not-understood drive `/local/domain/1/log-throttling'
> > medium change watch on `/local/domain/1/log-throttling' - unknown device, ignored
> 69,106c69,77
> < pt_iomem_map: e_phys=f1020000 maddr=c1a00000 type=0 len=131072 index=2 first_map=1
> < pt_iomem_map: e_phys=f1060000 maddr=c1b22000 type=0 len=4096 index=0 first_map=1
> < pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=1
> < pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=0
> < ati_gfx_init: guest_pio_bar = 0xc600, host_pio_bar = 0x3000, pio_size=0x100 guest_mmio_bar1=0xe0000000, guest_mmio_bar2=0x0
> < platform_fixed_ioport: changed ro/rw state of ROM memory area. now is rw state.
> < platform_fixed_ioport: changed ro/rw state of ROM memory area. now is ro state.
> < pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
> < pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
> < pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
> < pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
> < pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
> < pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
> < pt_pci_read_config: [00:06:0] Error: Failed to read register with invalid access size alignment. [Offset:0eh][Length:4]
> < pt_iomem_map: e_phys=ffffffff maddr=b0000000 type=8 len=268435456 index=0 first_map=0
> < pt_iomem_map: e_phys=ffffffff maddr=c1a00000 type=0 len=131072 index=2 first_map=0
> < pt_iomem_map: e_phys=e0000000 maddr=b0000000 type=8 len=268435456 index=0 first_map=0
> < pt_iomem_map: e_phys=f1020000 maddr=c1a00000 type=0 len=131072 index=2 first_map=0
> < pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=0
> < pt_iomem_map: e_phys=ffffffff maddr=c1b22000 type=0 len=4096 index=0 first_map=0
> < pt_iomem_map: e_phys=f1060000 maddr=c1b22000 type=0 len=4096 index=0 first_map=0
> < pt_iomem_map: e_phys=ffffffff maddr=b0000000 type=8 len=268435456 index=0 first_map=0
> < pt_iomem_map: e_phys=ffffffff maddr=c1a00000 type=0 len=131072 index=2 first_map=0
> < pt_iomem_map: e_phys=e0000000 maddr=b0000000 type=8 len=268435456 index=0 first_map=0
> < pt_iomem_map: e_phys=f1020000 maddr=c1a00000 type=0 len=131072 index=2 first_map=0
> < pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=0
> < pt_ioport_map: e_phys=c600 pio_base=3000 len=256 index=4 first_map=0
> < pt_msgctrl_reg_write: guest enabling MSI, disable MSI-INTx translation
> < pci_intx: intx=1
> < pt_msi_disable: Unmap msi with pirq 37
> < pt_msgctrl_reg_write: setup msi for dev 30
> < pt_msi_setup: msi mapped with pirq 37
> < pt_msi_update: Update msi with pirq 37 gvec b0 gflags 0
> < pt_iomem_map: e_phys=ffffffff maddr=c1b22000 type=0 len=4096 index=0 first_map=0
> < pt_iomem_map: e_phys=f1060000 maddr=c1b22000 type=0 len=4096 index=0 first_map=0
> < pt_iomem_map: e_phys=ffffffff maddr=c1b22000 type=0 len=4096 index=0 first_map=0
> < shutdown requested in cpu_handle_ioreq
> < Issued domain 3 poweroff
> ---
> > pt_iomem_map: e_phys=f1000000 maddr=c1a00000 type=0 len=131072 index=2 first_map=1
> > pt_iomem_map: e_phys=f1040000 maddr=c1b22000 type=0 len=4096 index=0 first_map=1
> > pt_ioport_map: e_phys=c700 pio_base=3000 len=256 index=4 first_map=1
> > pt_ioport_map: e_phys=c700 pio_base=3000 len=256 index=4 first_map=0
> > ati_gfx_init: guest_pio_bar = 0xc700, host_pio_bar = 0x3000, pio_size=0x100 guest_mmio_bar1=0xe0000000, guest_mmio_bar2=0x0
> > ati_io_regs_read: Requested read of c74c/51020, mapped: 304c/12364
> > ati_hw_in: port I/O: 304c, base: 3000, size: 100
> > ati_hw_in: ioperm successful
> > ati_hw_in: Read: 0
> ---------------------------------------------------------------------------
> 
> }-- End of excerpt from "Dr. Greg Wettstein"
> 
> As always,
> Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
> 4206 N. 19th Ave.           Specializing in information infra-structure
> Fargo, ND  58102            development.
> PH: 701-281-1686
> FAX: 701-281-3949           EMAIL: greg@enjellic.com
> ------------------------------------------------------------------------------
> "Boy, it must not take much to make a phone work.  Looking at
>  everthing else here it must be the same way with the INTERNET."
>                                 -- Francis 'Fritz' Wettstein

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 21:35:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 21:35:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdpHZ-0008T4-Tz; Wed, 28 Nov 2012 21:35:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <toby.karyadi@gmail.com>) id 1TdnVG-0005EX-Mt
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 19:41:02 +0000
Received: from [85.158.143.35:16936] by server-2.bemta-4.messagelabs.com id
	24/B9-28922-DC866B05; Wed, 28 Nov 2012 19:41:01 +0000
X-Env-Sender: toby.karyadi@gmail.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1354131658!4889623!1
X-Originating-IP: [76.96.59.228]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNzYuOTYuNTkuMjI4ID0+IDE0OTI4NQ==\n,
	ML_RADAR_SPEW_LINKS_14,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26888 invoked from network); 28 Nov 2012 19:40:59 -0000
Received: from qmta15.westchester.pa.mail.comcast.net (HELO
	qmta15.westchester.pa.mail.comcast.net) (76.96.59.228)
	by server-2.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 19:40:59 -0000
Received: from omta14.westchester.pa.mail.comcast.net ([76.96.62.60])
	by qmta15.westchester.pa.mail.comcast.net with comcast
	id UzoF1k0061HzFnQ5F7gyJ1; Wed, 28 Nov 2012 19:40:58 +0000
Received: from koalatu.simplecubes.com ([98.204.234.19])
	by omta14.westchester.pa.mail.comcast.net with comcast
	id V7gy1k00L0Rn0nW3a7gysz; Wed, 28 Nov 2012 19:40:58 +0000
Received: from quoll.simplecubes.com (quoll.simplecubes.com [192.168.33.37])
	by koalatu.simplecubes.com (Postfix) with ESMTP id 9257F8AD;
	Wed, 28 Nov 2012 14:41:49 -0500 (EST)
Message-ID: <50B668C5.50702@gmail.com>
Date: Wed, 28 Nov 2012 14:40:53 -0500
From: Toby Karyadi <toby.karyadi@gmail.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6;
	rv:14.0) Gecko/20120713 Thunderbird/14.0
MIME-Version: 1.0
To: Roger Pau Monn? <roger.pau@citrix.com>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com> <50B622B4.6010103@citrix.com>
	<20121128152919.GA11947@panix.com>
In-Reply-To: <20121128152919.GA11947@panix.com>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;
	s=q20121106; t=1354131658;
	bh=ZxAp76NvDah7xrYbeeGbAfW6bHRZDP8AwGpfm7dHddQ=;
	h=Received:Received:Received:Message-ID:Date:From:MIME-Version:To:
	Subject:Content-Type;
	b=BCdK78x8Zw6YRZDO6y8d/sbSv+fvNIdEeKi3TZE0VSs+ENI137oSZri34KyPgaoLt
	KnU6pJZYqto2A5UjXtg/G+4tn4imJz6RUP6wt2+mh1GWw+dkAzIARn7rgHTl1k2QbY
	CIv4PfTqXxnRCNZ5L2pPIkvvqGJgP29QkWGvpynUyS42kO77nYmEC0QZAO+SPmLAUh
	Y5zqA4NUJHeTTZ3PYPOGCUaYZBix2N17+EIUvbREpJTQ7DGfwm4BVJIGDhV3KZnBek
	5URdGRH8m48KGOXi59i5bYvRcjB1wu26esT9o0dpgQ1GtItJD3+HIrEn83cWSyXQJi
	XR/10ZZHuMciw==
X-Mailman-Approved-At: Wed, 28 Nov 2012 21:35:00 +0000
Cc: "port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/28/12 10:29 AM, Thor Lancelot Simon wrote:
> On Wed, Nov 28, 2012 at 03:41:56PM +0100, Roger Pau Monn? wrote:
>> On 28/11/12 14:26, Thor Lancelot Simon wrote:
>>> I am assuming there's some reason we want this, rather than handling
>>> such requests in-kernel.  But what is it?
>> I should have marked this as "experimental", or something like this. I'm
>> not sure if switching to Qdisk for all image file backends is needed.
>> >From the Xen wiki (http://wiki.xen.org/wiki/Blktap) I've found that:
>>
>> "loop device had problems with flushing dirty pages (specifically, doing
>> a large number of writes to an NFS-backed image don't result in the OOM
>> killer going berserk)."
>>
>> I'm not sure if NetBSD is in the same situation, but if I remember
>> correctly (haven't tried that in a long time), trying to use a disk file
>> on a NFS share caused the NetBSD Dom0 kernel to crash. The PR for this
>> issue is: http://gnats.netbsd.org/40726.
> It seems highly unlikely to me that a problem with the loop device driver
> on Linux is tremendously relevant to NetBSD.
>
> But, even if there is some problem with vnd backed by NFS, that hardly
> seems like it would be a good reason to make a change that reduces I/O
> throughput for the *non* NFS-backed case by at least 20%.  Why would one
> keep disk images for guests, as a general rule, on NFS, rather than simply
> doing the NFS mounts on the guests themselves, or using a more sensible
> protocol like iSCSI?  I have to assume most folks using files as disks are
> storing them on local filesystems on the dom0, and wrecking performance
> for that case to solve a problem with NFS that may or may not be hypothetical
> seems like a very, very bad trade-off.
>
> Thor
Yeah, I usually don't pipe up, but I strongly dislike being forced to 
use qemu to read raw disk file instead of being able to use vnd on 
netbsd dom0.

There was/is? a bug in xentools 4.1 in libxl that prevents using vnd for 
raw disk file. The problem boils down to libxl not notifying xenbackendd 
(via xenstored) to call /usr/pkg/etc/xen/scripts/block at the right time 
such that vnconfig doesn't get called when it's time to shutdown the 
domU, and hence you end up with a bunch of vnd devices even after the 
corresponding domU's have been shutdown. I created a patch to fix that: 
http://mail-index.netbsd.org/port-xen/2012/05/29/msg007252.html 
Additionally I put in an experimental feature that allows specifying 
other types of backend aside from phy: or file:, and as long as the 
/usr/pkg/etc/xen/scripts/block sh script is modified accordingly, the 
domU will just get the appropriate device in dom0. Then we can use, for 
example, vnd:, or iscsi: and from the POV of the domU, it's just another 
'physical' device that the dom0 manages. I think the way xenbackendd 
works, in conjunction with xenstored, is pretty flexible and decoupled, 
at least with xen 3.3 and 4.1; I don't know what the story is for xen 
4.2. Was there a rumor of retiring xenbackendd?

I'm also concerned about the trend, which to me is more of putting more 
and more policy in libxl, as opposed to functionality. I saw this back 
when I was trying to fix the bug above, hopefully this trend is no 
longer true. For example, I had the impression (I don't remember the 
details) that the code that parses the disk configuration to a certain 
degree decides whether the disk is a block device or a regular file 
based on the prefix (phy: vs file:), which is not true in netbsd dom0, 
because the file path is then used to setup a vnd device, which is from 
libxl's POV is just a block device. Most probably it's born out of the 
fact that libxl is developed in a mostly linux environment. I do 
appreciate Roger's effort in improving xen support in netbsd, but 
hopefully some BSDism would travel back to xen as well.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 21:35:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 21:35:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdpHZ-0008T4-Tz; Wed, 28 Nov 2012 21:35:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <toby.karyadi@gmail.com>) id 1TdnVG-0005EX-Mt
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 19:41:02 +0000
Received: from [85.158.143.35:16936] by server-2.bemta-4.messagelabs.com id
	24/B9-28922-DC866B05; Wed, 28 Nov 2012 19:41:01 +0000
X-Env-Sender: toby.karyadi@gmail.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1354131658!4889623!1
X-Originating-IP: [76.96.59.228]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNzYuOTYuNTkuMjI4ID0+IDE0OTI4NQ==\n,
	ML_RADAR_SPEW_LINKS_14,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26888 invoked from network); 28 Nov 2012 19:40:59 -0000
Received: from qmta15.westchester.pa.mail.comcast.net (HELO
	qmta15.westchester.pa.mail.comcast.net) (76.96.59.228)
	by server-2.tower-21.messagelabs.com with SMTP;
	28 Nov 2012 19:40:59 -0000
Received: from omta14.westchester.pa.mail.comcast.net ([76.96.62.60])
	by qmta15.westchester.pa.mail.comcast.net with comcast
	id UzoF1k0061HzFnQ5F7gyJ1; Wed, 28 Nov 2012 19:40:58 +0000
Received: from koalatu.simplecubes.com ([98.204.234.19])
	by omta14.westchester.pa.mail.comcast.net with comcast
	id V7gy1k00L0Rn0nW3a7gysz; Wed, 28 Nov 2012 19:40:58 +0000
Received: from quoll.simplecubes.com (quoll.simplecubes.com [192.168.33.37])
	by koalatu.simplecubes.com (Postfix) with ESMTP id 9257F8AD;
	Wed, 28 Nov 2012 14:41:49 -0500 (EST)
Message-ID: <50B668C5.50702@gmail.com>
Date: Wed, 28 Nov 2012 14:40:53 -0500
From: Toby Karyadi <toby.karyadi@gmail.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6;
	rv:14.0) Gecko/20120713 Thunderbird/14.0
MIME-Version: 1.0
To: Roger Pau Monn? <roger.pau@citrix.com>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com> <50B622B4.6010103@citrix.com>
	<20121128152919.GA11947@panix.com>
In-Reply-To: <20121128152919.GA11947@panix.com>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;
	s=q20121106; t=1354131658;
	bh=ZxAp76NvDah7xrYbeeGbAfW6bHRZDP8AwGpfm7dHddQ=;
	h=Received:Received:Received:Message-ID:Date:From:MIME-Version:To:
	Subject:Content-Type;
	b=BCdK78x8Zw6YRZDO6y8d/sbSv+fvNIdEeKi3TZE0VSs+ENI137oSZri34KyPgaoLt
	KnU6pJZYqto2A5UjXtg/G+4tn4imJz6RUP6wt2+mh1GWw+dkAzIARn7rgHTl1k2QbY
	CIv4PfTqXxnRCNZ5L2pPIkvvqGJgP29QkWGvpynUyS42kO77nYmEC0QZAO+SPmLAUh
	Y5zqA4NUJHeTTZ3PYPOGCUaYZBix2N17+EIUvbREpJTQ7DGfwm4BVJIGDhV3KZnBek
	5URdGRH8m48KGOXi59i5bYvRcjB1wu26esT9o0dpgQ1GtItJD3+HIrEn83cWSyXQJi
	XR/10ZZHuMciw==
X-Mailman-Approved-At: Wed, 28 Nov 2012 21:35:00 +0000
Cc: "port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/28/12 10:29 AM, Thor Lancelot Simon wrote:
> On Wed, Nov 28, 2012 at 03:41:56PM +0100, Roger Pau Monn? wrote:
>> On 28/11/12 14:26, Thor Lancelot Simon wrote:
>>> I am assuming there's some reason we want this, rather than handling
>>> such requests in-kernel.  But what is it?
>> I should have marked this as "experimental", or something like this. I'm
>> not sure if switching to Qdisk for all image file backends is needed.
>> >From the Xen wiki (http://wiki.xen.org/wiki/Blktap) I've found that:
>>
>> "loop device had problems with flushing dirty pages (specifically, doing
>> a large number of writes to an NFS-backed image don't result in the OOM
>> killer going berserk)."
>>
>> I'm not sure if NetBSD is in the same situation, but if I remember
>> correctly (haven't tried that in a long time), trying to use a disk file
>> on a NFS share caused the NetBSD Dom0 kernel to crash. The PR for this
>> issue is: http://gnats.netbsd.org/40726.
> It seems highly unlikely to me that a problem with the loop device driver
> on Linux is tremendously relevant to NetBSD.
>
> But, even if there is some problem with vnd backed by NFS, that hardly
> seems like it would be a good reason to make a change that reduces I/O
> throughput for the *non* NFS-backed case by at least 20%.  Why would one
> keep disk images for guests, as a general rule, on NFS, rather than simply
> doing the NFS mounts on the guests themselves, or using a more sensible
> protocol like iSCSI?  I have to assume most folks using files as disks are
> storing them on local filesystems on the dom0, and wrecking performance
> for that case to solve a problem with NFS that may or may not be hypothetical
> seems like a very, very bad trade-off.
>
> Thor
Yeah, I usually don't pipe up, but I strongly dislike being forced to 
use qemu to read raw disk file instead of being able to use vnd on 
netbsd dom0.

There was/is? a bug in xentools 4.1 in libxl that prevents using vnd for 
raw disk file. The problem boils down to libxl not notifying xenbackendd 
(via xenstored) to call /usr/pkg/etc/xen/scripts/block at the right time 
such that vnconfig doesn't get called when it's time to shutdown the 
domU, and hence you end up with a bunch of vnd devices even after the 
corresponding domU's have been shutdown. I created a patch to fix that: 
http://mail-index.netbsd.org/port-xen/2012/05/29/msg007252.html 
Additionally I put in an experimental feature that allows specifying 
other types of backend aside from phy: or file:, and as long as the 
/usr/pkg/etc/xen/scripts/block sh script is modified accordingly, the 
domU will just get the appropriate device in dom0. Then we can use, for 
example, vnd:, or iscsi: and from the POV of the domU, it's just another 
'physical' device that the dom0 manages. I think the way xenbackendd 
works, in conjunction with xenstored, is pretty flexible and decoupled, 
at least with xen 3.3 and 4.1; I don't know what the story is for xen 
4.2. Was there a rumor of retiring xenbackendd?

I'm also concerned about the trend, which to me is more of putting more 
and more policy in libxl, as opposed to functionality. I saw this back 
when I was trying to fix the bug above, hopefully this trend is no 
longer true. For example, I had the impression (I don't remember the 
details) that the code that parses the disk configuration to a certain 
degree decides whether the disk is a block device or a regular file 
based on the prefix (phy: vs file:), which is not true in netbsd dom0, 
because the file path is then used to setup a vnd device, which is from 
libxl's POV is just a block device. Most probably it's born out of the 
fact that libxl is developed in a mostly linux environment. I do 
appreciate Roger's effort in improving xen support in netbsd, but 
hopefully some BSDism would travel back to xen as well.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 21:39:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 21:39:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdpLi-0000At-KJ; Wed, 28 Nov 2012 21:39:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fengguang.wu@intel.com>) id 1TdpLh-0000Al-2l
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 21:39:17 +0000
Received: from [85.158.139.211:55150] by server-14.bemta-5.messagelabs.com id
	D8/63-21768-48486B05; Wed, 28 Nov 2012 21:39:16 +0000
X-Env-Sender: fengguang.wu@intel.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354138747!14034160!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjM0MjI3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8646 invoked from network); 28 Nov 2012 21:39:13 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-13.tower-206.messagelabs.com with SMTP;
	28 Nov 2012 21:39:13 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga102.ch.intel.com with ESMTP; 28 Nov 2012 13:39:01 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,180,1355126400"; d="scan'208";a="223907812"
Received: from bee.sh.intel.com (HELO localhost) ([10.239.97.14])
	by azsmga001.ch.intel.com with ESMTP; 28 Nov 2012 13:38:58 -0800
Received: from [192.168.1.1] (helo=bee) by localhost with smtp (Exim 4.80)
	(envelope-from <fengguang.wu@intel.com>)
	id 1TdpKs-000EBL-DX; Thu, 29 Nov 2012 05:38:26 +0800
Date: Thu, 29 Nov 2012 05:38:26 +0800
From: kbuild test robot <fengguang.wu@intel.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Message-ID: <50b68452.Gqr1L/cRkHFh1xmK%fengguang.wu@intel.com>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="=_50b68452.A6KZaSQDGJ7X3bTwVTt7Bk6j0xJkxL9Q6i7ArV1x5gdxZGwi"
X-SA-Exim-Connect-IP: 192.168.1.1
X-SA-Exim-Mail-From: fengguang.wu@intel.com
X-SA-Exim-Scanned: No (on localhost); SAEximRunCond expanded to false
Cc: xen-devel@lists.xensource.com, Jan Beulich <JBeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [Xen-devel] [xen:stable/for-linus-3.8 4/8]
 include/xen/interface/version.h:72:2: error: implicit declaration of
 function 'xen_domain'
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.

--=_50b68452.A6KZaSQDGJ7X3bTwVTt7Bk6j0xJkxL9Q6i7ArV1x5gdxZGwi
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-linus-3.8
head:   394b40f62d7ae18a1c48c13fc483b8193f8c3a98
commit: 92e3229dcdc80ff0b6304f14c578d76e7e10e226 [4/8] xen/acpi: ACPI PAD driver
config: x86_64-randconfig-x701 (attached as .config)

Note: the xen/stable/for-linus-3.8 HEAD 394b40f builds fine.
      It only hurts bisectibility.

All error/warnings:

In file included from drivers/xen/features.c:15:0:
include/xen/interface/version.h: In function 'xen_running_on_version_or_later':
include/xen/interface/version.h:72:2: error: implicit declaration of function 'xen_domain' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

vim +72 +/xen_domain include/xen/interface/version.h

92e3229d Liu, Jinsong 2012-11-08  66  /* Check if running on Xen version (major, minor) or later */
92e3229d Liu, Jinsong 2012-11-08  67  static inline bool
92e3229d Liu, Jinsong 2012-11-08  68  xen_running_on_version_or_later(unsigned int major, unsigned int minor)
92e3229d Liu, Jinsong 2012-11-08  69  {
92e3229d Liu, Jinsong 2012-11-08  70  	unsigned int version;
92e3229d Liu, Jinsong 2012-11-08  71  
92e3229d Liu, Jinsong 2012-11-08 @72  	if (!xen_domain())
92e3229d Liu, Jinsong 2012-11-08  73  		return false;
92e3229d Liu, Jinsong 2012-11-08  74  
92e3229d Liu, Jinsong 2012-11-08  75  	version = HYPERVISOR_xen_version(XENVER_version, NULL);

---
0-DAY kernel build testing backend         Open Source Technology Center
Fengguang Wu, Yuanhan Liu                              Intel Corporation

--=_50b68452.A6KZaSQDGJ7X3bTwVTt7Bk6j0xJkxL9Q6i7ArV1x5gdxZGwi
Content-Type: text/plain;
 charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename=".config"

#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 3.7.0-rc3 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_DEFAULT_IDLE=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_ARCH_HAS_CPU_AUTOPROBE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ZONE_DMA32=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11"
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_HAVE_IRQ_WORK=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_EXTABLE_SORT=y

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
# CONFIG_KERNEL_GZIP is not set
CONFIG_KERNEL_BZIP2=y
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
CONFIG_DEFAULT_HOSTNAME="(none)"
# CONFIG_SWAP is not set
# CONFIG_SYSVIPC is not set
# CONFIG_POSIX_MQUEUE is not set
# CONFIG_FHANDLE is not set
CONFIG_AUDIT=y
CONFIG_AUDITSYSCALL=y
CONFIG_AUDIT_WATCH=y
CONFIG_AUDIT_TREE=y
CONFIG_AUDIT_LOGINUID_IMMUTABLE=y
CONFIG_HAVE_GENERIC_HARDIRQS=y

#
# IRQ subsystem
#
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_IRQ_DOMAIN=y
# CONFIG_IRQ_DOMAIN_DEBUG is not set
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_ARCH_CLOCKSOURCE_DATA=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_GENERIC_CMOS_UPDATE=y

#
# Timers subsystem
#
# CONFIG_NO_HZ is not set
# CONFIG_HIGH_RES_TIMERS is not set

#
# CPU/Task time and stats accounting
#
# CONFIG_TICK_CPU_ACCOUNTING is not set
CONFIG_IRQ_TIME_ACCOUNTING=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_TASKSTATS=y
# CONFIG_TASK_DELAY_ACCT is not set
# CONFIG_TASK_XACCT is not set

#
# RCU Subsystem
#
CONFIG_TINY_RCU=y
# CONFIG_PREEMPT_RCU is not set
# CONFIG_TREE_RCU_TRACE is not set
CONFIG_IKCONFIG=y
# CONFIG_IKCONFIG_PROC is not set
CONFIG_LOG_BUF_SHIFT=17
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
CONFIG_CGROUPS=y
CONFIG_CGROUP_DEBUG=y
# CONFIG_CGROUP_FREEZER is not set
CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
# CONFIG_CGROUP_CPUACCT is not set
CONFIG_RESOURCE_COUNTERS=y
CONFIG_MEMCG=y
# CONFIG_MEMCG_KMEM is not set
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
# CONFIG_CFS_BANDWIDTH is not set
# CONFIG_RT_GROUP_SCHED is not set
# CONFIG_BLK_CGROUP is not set
# CONFIG_CHECKPOINT_RESTORE is not set
CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_SCHED_AUTOGROUP=y
CONFIG_MM_OWNER=y
# CONFIG_SYSFS_DEPRECATED is not set
# CONFIG_RELAY is not set
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
CONFIG_ANON_INODES=y
# CONFIG_EXPERT is not set
# CONFIG_SYSCTL_SYSCALL is not set
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_PCSPKR_PLATFORM=y
CONFIG_HAVE_PCSPKR_PLATFORM=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
# CONFIG_EMBEDDED is not set
CONFIG_HAVE_PERF_EVENTS=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_PCI_QUIRKS=y
CONFIG_SLUB_DEBUG=y
# CONFIG_COMPAT_BRK is not set
# CONFIG_SLAB is not set
CONFIG_SLUB=y
CONFIG_PROFILING=y
# CONFIG_OPROFILE is not set
CONFIG_HAVE_OPROFILE=y
CONFIG_OPROFILE_NMI_TIMER=y
CONFIG_KPROBES=y
CONFIG_JUMP_LABEL=y
CONFIG_OPTPROBES=y
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_KRETPROBES=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_OPTPROBES=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
CONFIG_HAVE_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_PERF_EVENTS_NMI=y
CONFIG_HAVE_PERF_REGS=y
CONFIG_HAVE_PERF_USER_STACK_DUMP=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
CONFIG_HAVE_CMPXCHG_LOCAL=y
CONFIG_HAVE_CMPXCHG_DOUBLE=y
CONFIG_GENERIC_KERNEL_THREAD=y
CONFIG_GENERIC_KERNEL_EXECVE=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_HAVE_RCU_USER_QS=y
CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_MODULES_USE_ELF_RELA=y

#
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
# CONFIG_MODULE_FORCE_LOAD is not set
# CONFIG_MODULE_UNLOAD is not set
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
CONFIG_MODULE_SIG=y
# CONFIG_MODULE_SIG_FORCE is not set
# CONFIG_MODULE_SIG_SHA1 is not set
CONFIG_MODULE_SIG_SHA224=y
# CONFIG_MODULE_SIG_SHA256 is not set
# CONFIG_MODULE_SIG_SHA384 is not set
# CONFIG_MODULE_SIG_SHA512 is not set
CONFIG_BLOCK=y
CONFIG_BLK_DEV_BSG=y
CONFIG_BLK_DEV_BSGLIB=y
CONFIG_BLK_DEV_INTEGRITY=y

#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
CONFIG_ACORN_PARTITION=y
# CONFIG_ACORN_PARTITION_CUMANA is not set
CONFIG_ACORN_PARTITION_EESOX=y
# CONFIG_ACORN_PARTITION_ICS is not set
CONFIG_ACORN_PARTITION_ADFS=y
# CONFIG_ACORN_PARTITION_POWERTEC is not set
CONFIG_ACORN_PARTITION_RISCIX=y
# CONFIG_OSF_PARTITION is not set
# CONFIG_AMIGA_PARTITION is not set
# CONFIG_ATARI_PARTITION is not set
# CONFIG_MAC_PARTITION is not set
CONFIG_MSDOS_PARTITION=y
# CONFIG_BSD_DISKLABEL is not set
# CONFIG_MINIX_SUBPARTITION is not set
CONFIG_SOLARIS_X86_PARTITION=y
# CONFIG_UNIXWARE_DISKLABEL is not set
# CONFIG_LDM_PARTITION is not set
CONFIG_SGI_PARTITION=y
CONFIG_ULTRIX_PARTITION=y
CONFIG_SUN_PARTITION=y
# CONFIG_KARMA_PARTITION is not set
# CONFIG_EFI_PARTITION is not set
# CONFIG_SYSV68_PARTITION is not set

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_DEADLINE=m
CONFIG_IOSCHED_CFQ=m
CONFIG_DEFAULT_NOOP=y
CONFIG_DEFAULT_IOSCHED="noop"
CONFIG_ASN1=y
CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
CONFIG_INLINE_READ_UNLOCK=y
CONFIG_INLINE_READ_UNLOCK_IRQ=y
CONFIG_INLINE_WRITE_UNLOCK=y
CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
CONFIG_FREEZER=y

#
# Processor type and features
#
CONFIG_ZONE_DMA=y
# CONFIG_SMP is not set
CONFIG_X86_MPPARSE=y
CONFIG_X86_EXTENDED_PLATFORM=y
CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
# CONFIG_SCHED_OMIT_FRAME_POINTER is not set
CONFIG_PARAVIRT_GUEST=y
CONFIG_PARAVIRT_TIME_ACCOUNTING=y
CONFIG_XEN=y
CONFIG_XEN_DOM0=y
CONFIG_XEN_PRIVILEGED_GUEST=y
CONFIG_XEN_PVHVM=y
CONFIG_XEN_MAX_DOMAIN_MEMORY=500
CONFIG_XEN_SAVE_RESTORE=y
CONFIG_XEN_DEBUG_FS=y
CONFIG_KVM_GUEST=y
CONFIG_PARAVIRT=y
CONFIG_PARAVIRT_CLOCK=y
# CONFIG_PARAVIRT_DEBUG is not set
CONFIG_NO_BOOTMEM=y
CONFIG_MEMTEST=y
# CONFIG_MK8 is not set
# CONFIG_MPSC is not set
# CONFIG_MCORE2 is not set
# CONFIG_MATOM is not set
CONFIG_GENERIC_CPU=y
CONFIG_X86_INTERNODE_CACHE_SHIFT=6
CONFIG_X86_CMPXCHG=y
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_XADD=y
CONFIG_X86_WP_WORKS_OK=y
CONFIG_X86_TSC=y
CONFIG_X86_CMPXCHG64=y
CONFIG_X86_CMOV=y
CONFIG_X86_MINIMUM_CPU_FAMILY=64
CONFIG_X86_DEBUGCTLMSR=y
CONFIG_CPU_SUP_INTEL=y
CONFIG_CPU_SUP_AMD=y
CONFIG_CPU_SUP_CENTAUR=y
CONFIG_HPET_TIMER=y
CONFIG_HPET_EMULATE_RTC=y
CONFIG_DMI=y
CONFIG_GART_IOMMU=y
CONFIG_CALGARY_IOMMU=y
# CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT is not set
CONFIG_SWIOTLB=y
CONFIG_IOMMU_HELPER=y
CONFIG_NR_CPUS=1
CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT is not set
CONFIG_PREEMPT_COUNT=y
CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
CONFIG_X86_MCE=y
CONFIG_X86_MCE_INTEL=y
CONFIG_X86_MCE_AMD=y
CONFIG_X86_MCE_THRESHOLD=y
# CONFIG_X86_MCE_INJECT is not set
CONFIG_X86_THERMAL_VECTOR=y
# CONFIG_I8K is not set
CONFIG_MICROCODE=m
# CONFIG_MICROCODE_INTEL is not set
# CONFIG_MICROCODE_AMD is not set
CONFIG_MICROCODE_OLD_INTERFACE=y
CONFIG_X86_MSR=m
# CONFIG_X86_CPUID is not set
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_DIRECT_GBPAGES=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ARCH_PROC_KCORE_TEXT=y
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_SPARSEMEM_MANUAL=y
CONFIG_SPARSEMEM=y
CONFIG_HAVE_MEMORY_PRESENT=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=y
CONFIG_SPARSEMEM_VMEMMAP=y
CONFIG_HAVE_MEMBLOCK=y
CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
CONFIG_ARCH_DISCARD_MEMBLOCK=y
CONFIG_MEMORY_ISOLATION=y
# CONFIG_MEMORY_HOTPLUG is not set
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=4
# CONFIG_COMPACTION is not set
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
CONFIG_VIRT_TO_BUS=y
CONFIG_MMU_NOTIFIER=y
CONFIG_KSM=y
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
CONFIG_MEMORY_FAILURE=y
# CONFIG_HWPOISON_INJECT is not set
# CONFIG_TRANSPARENT_HUGEPAGE is not set
# CONFIG_CROSS_MEMORY_ATTACH is not set
CONFIG_NEED_PER_CPU_KM=y
CONFIG_CLEANCACHE=y
# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
CONFIG_X86_RESERVE_LOW=64
CONFIG_MTRR=y
CONFIG_MTRR_SANITIZER=y
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
CONFIG_X86_PAT=y
CONFIG_ARCH_USES_PG_UNCACHED=y
CONFIG_ARCH_RANDOM=y
CONFIG_X86_SMAP=y
# CONFIG_EFI is not set
# CONFIG_SECCOMP is not set
CONFIG_CC_STACKPROTECTOR=y
# CONFIG_HZ_100 is not set
CONFIG_HZ_250=y
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=250
# CONFIG_SCHED_HRTICK is not set
CONFIG_KEXEC=y
# CONFIG_CRASH_DUMP is not set
CONFIG_PHYSICAL_START=0x1000000
# CONFIG_RELOCATABLE is not set
CONFIG_PHYSICAL_ALIGN=0x1000000
# CONFIG_CMDLINE_BOOL is not set
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y

#
# Power management and ACPI options
#
# CONFIG_SUSPEND is not set
CONFIG_HIBERNATE_CALLBACKS=y
CONFIG_PM_SLEEP=y
# CONFIG_PM_AUTOSLEEP is not set
CONFIG_PM_WAKELOCKS=y
CONFIG_PM_WAKELOCKS_LIMIT=100
CONFIG_PM_WAKELOCKS_GC=y
# CONFIG_PM_RUNTIME is not set
CONFIG_PM=y
# CONFIG_PM_DEBUG is not set
CONFIG_ACPI=y
# CONFIG_ACPI_PROCFS is not set
# CONFIG_ACPI_PROCFS_POWER is not set
# CONFIG_ACPI_EC_DEBUGFS is not set
CONFIG_ACPI_PROC_EVENT=y
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=y
CONFIG_ACPI_VIDEO=m
CONFIG_ACPI_FAN=y
# CONFIG_ACPI_DOCK is not set
CONFIG_ACPI_PROCESSOR=y
# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set
CONFIG_ACPI_THERMAL=y
# CONFIG_ACPI_CUSTOM_DSDT is not set
CONFIG_ACPI_BLACKLIST_YEAR=0
# CONFIG_ACPI_DEBUG is not set
# CONFIG_ACPI_PCI_SLOT is not set
CONFIG_X86_PM_TIMER=y
# CONFIG_ACPI_CONTAINER is not set
# CONFIG_ACPI_SBS is not set
# CONFIG_ACPI_HED is not set
# CONFIG_ACPI_CUSTOM_METHOD is not set
# CONFIG_ACPI_APEI is not set
CONFIG_SFI=y

#
# CPU Frequency scaling
#
# CONFIG_CPU_FREQ is not set
CONFIG_CPU_IDLE=y
CONFIG_CPU_IDLE_GOV_LADDER=y
# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
CONFIG_INTEL_IDLE=y

#
# Memory power savings
#
# CONFIG_I7300_IDLE is not set

#
# Bus options (PCI etc.)
#
CONFIG_PCI=y
CONFIG_PCI_DIRECT=y
# CONFIG_PCI_MMCONFIG is not set
CONFIG_PCI_XEN=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI_PCIE=m
CONFIG_PCIEAER=y
CONFIG_PCIE_ECRC=y
CONFIG_PCIEAER_INJECT=m
CONFIG_PCIEASPM=y
CONFIG_PCIEASPM_DEBUG=y
# CONFIG_PCIEASPM_DEFAULT is not set
CONFIG_PCIEASPM_POWERSAVE=y
# CONFIG_PCIEASPM_PERFORMANCE is not set
CONFIG_ARCH_SUPPORTS_MSI=y
# CONFIG_PCI_MSI is not set
# CONFIG_PCI_DEBUG is not set
CONFIG_PCI_REALLOC_ENABLE_AUTO=y
# CONFIG_PCI_STUB is not set
CONFIG_XEN_PCIDEV_FRONTEND=m
# CONFIG_HT_IRQ is not set
CONFIG_PCI_ATS=y
# CONFIG_PCI_IOV is not set
CONFIG_PCI_PRI=y
CONFIG_PCI_PASID=y
# CONFIG_PCI_IOAPIC is not set
CONFIG_PCI_LABEL=y
CONFIG_ISA_DMA_API=y
CONFIG_AMD_NB=y
CONFIG_PCCARD=m
CONFIG_PCMCIA=m
CONFIG_PCMCIA_LOAD_CIS=y
# CONFIG_CARDBUS is not set

#
# PC-card bridges
#
# CONFIG_YENTA is not set
# CONFIG_PD6729 is not set
CONFIG_I82092=m
CONFIG_PCCARD_NONSTATIC=y
CONFIG_HOTPLUG_PCI=m
# CONFIG_HOTPLUG_PCI_ACPI is not set
CONFIG_HOTPLUG_PCI_CPCI=y
# CONFIG_HOTPLUG_PCI_CPCI_ZT5550 is not set
CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m
# CONFIG_HOTPLUG_PCI_SHPC is not set
# CONFIG_RAPIDIO is not set

#
# Executable file formats / Emulations
#
CONFIG_BINFMT_ELF=y
CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
# CONFIG_HAVE_AOUT is not set
CONFIG_BINFMT_MISC=m
CONFIG_COREDUMP=y
# CONFIG_IA32_EMULATION is not set
CONFIG_HAVE_TEXT_POKE_SMP=y
CONFIG_X86_DEV_DMA_OPS=y
CONFIG_NET=y

#
# Networking options
#
# CONFIG_PACKET is not set
CONFIG_UNIX=y
# CONFIG_UNIX_DIAG is not set
CONFIG_XFRM=y
CONFIG_XFRM_ALGO=m
# CONFIG_XFRM_SUB_POLICY is not set
CONFIG_XFRM_MIGRATE=y
CONFIG_NET_KEY=m
CONFIG_NET_KEY_MIGRATE=y
# CONFIG_INET is not set
CONFIG_NETWORK_SECMARK=y
CONFIG_NETWORK_PHY_TIMESTAMPING=y
# CONFIG_NETFILTER is not set
# CONFIG_ATM is not set
CONFIG_STP=m
CONFIG_GARP=m
# CONFIG_BRIDGE is not set
CONFIG_VLAN_8021Q=m
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_DECNET=m
CONFIG_DECNET_ROUTER=y
CONFIG_LLC=m
CONFIG_LLC2=m
# CONFIG_IPX is not set
CONFIG_ATALK=m
# CONFIG_DEV_APPLETALK is not set
CONFIG_X25=m
CONFIG_LAPB=m
CONFIG_WAN_ROUTER=m
CONFIG_PHONET=m
# CONFIG_IEEE802154 is not set
# CONFIG_NET_SCHED is not set
CONFIG_DCB=y
CONFIG_DNS_RESOLVER=m
# CONFIG_BATMAN_ADV is not set
# CONFIG_OPENVSWITCH is not set
# CONFIG_NETPRIO_CGROUP is not set
CONFIG_BQL=y
# CONFIG_BPF_JIT is not set

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_HAMRADIO is not set
# CONFIG_CAN is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
CONFIG_FIB_RULES=y
CONFIG_WIRELESS=y
# CONFIG_CFG80211 is not set
# CONFIG_LIB80211 is not set

#
# CFG80211 needs to be enabled for MAC80211
#
CONFIG_WIMAX=m
CONFIG_WIMAX_DEBUG_LEVEL=8
# CONFIG_RFKILL is not set
# CONFIG_NET_9P is not set
# CONFIG_CAIF is not set
# CONFIG_NFC is not set
CONFIG_HAVE_BPF_JIT=y

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH=""
CONFIG_DEVTMPFS=y
# CONFIG_DEVTMPFS_MOUNT is not set
CONFIG_STANDALONE=y
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
CONFIG_FW_LOADER=y
# CONFIG_FIRMWARE_IN_KERNEL is not set
CONFIG_EXTRA_FIRMWARE=""
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_SYS_HYPERVISOR is not set
# CONFIG_GENERIC_CPU_DEVICES is not set
CONFIG_REGMAP=y
CONFIG_REGMAP_I2C=m
CONFIG_REGMAP_SPI=y
CONFIG_REGMAP_IRQ=y
# CONFIG_DMA_SHARED_BUFFER is not set

#
# Bus devices
#
# CONFIG_OMAP_OCP2SCP is not set
# CONFIG_CONNECTOR is not set
# CONFIG_MTD is not set
CONFIG_PARPORT=m
# CONFIG_PARPORT_PC is not set
# CONFIG_PARPORT_GSC is not set
# CONFIG_PARPORT_AX88796 is not set
CONFIG_PARPORT_1284=y
CONFIG_PNP=y
CONFIG_PNP_DEBUG_MESSAGES=y

#
# Protocols
#
CONFIG_PNPACPI=y
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
# CONFIG_BLK_DEV_LOOP is not set

#
# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
#
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_NVME is not set
# CONFIG_BLK_DEV_SX8 is not set
# CONFIG_BLK_DEV_RAM is not set
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
CONFIG_XEN_BLKDEV_FRONTEND=y
# CONFIG_XEN_BLKDEV_BACKEND is not set
# CONFIG_VIRTIO_BLK is not set
# CONFIG_BLK_DEV_HD is not set

#
# Misc devices
#
# CONFIG_SENSORS_LIS3LV02D is not set
# CONFIG_AD525X_DPOT is not set
CONFIG_IBM_ASM=m
CONFIG_PHANTOM=m
# CONFIG_INTEL_MID_PTI is not set
CONFIG_SGI_IOC4=m
CONFIG_TIFM_CORE=m
CONFIG_TIFM_7XX1=m
CONFIG_ICS932S401=m
CONFIG_ENCLOSURE_SERVICES=m
CONFIG_HP_ILO=m
# CONFIG_APDS9802ALS is not set
# CONFIG_ISL29003 is not set
# CONFIG_ISL29020 is not set
CONFIG_SENSORS_TSL2550=m
CONFIG_SENSORS_BH1780=m
# CONFIG_SENSORS_BH1770 is not set
CONFIG_SENSORS_APDS990X=m
CONFIG_HMC6352=m
CONFIG_DS1682=m
# CONFIG_TI_DAC7512 is not set
# CONFIG_VMWARE_BALLOON is not set
CONFIG_BMP085=y
# CONFIG_BMP085_I2C is not set
CONFIG_BMP085_SPI=m
CONFIG_PCH_PHUB=m
CONFIG_USB_SWITCH_FSA9480=m
# CONFIG_C2PORT is not set

#
# EEPROM support
#
CONFIG_EEPROM_AT24=m
# CONFIG_EEPROM_AT25 is not set
CONFIG_EEPROM_LEGACY=m
CONFIG_EEPROM_MAX6875=m
# CONFIG_EEPROM_93CX6 is not set
# CONFIG_EEPROM_93XX46 is not set
CONFIG_CB710_CORE=m
CONFIG_CB710_DEBUG=y
CONFIG_CB710_DEBUG_ASSUMPTIONS=y

#
# Texas Instruments shared transport line discipline
#
# CONFIG_SENSORS_LIS3_I2C is not set

#
# Altera FPGA firmware download module
#
CONFIG_ALTERA_STAPL=m
CONFIG_HAVE_IDE=y
# CONFIG_IDE is not set

#
# SCSI device support
#
CONFIG_SCSI_MOD=m
CONFIG_RAID_ATTRS=m
CONFIG_SCSI=m
CONFIG_SCSI_DMA=y
# CONFIG_SCSI_TGT is not set
CONFIG_SCSI_NETLINK=y
CONFIG_SCSI_PROC_FS=y

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=m
# CONFIG_CHR_DEV_ST is not set
# CONFIG_CHR_DEV_OSST is not set
# CONFIG_BLK_DEV_SR is not set
# CONFIG_CHR_DEV_SG is not set
CONFIG_CHR_DEV_SCH=m
CONFIG_SCSI_ENCLOSURE=m
CONFIG_SCSI_MULTI_LUN=y
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y
# CONFIG_SCSI_SCAN_ASYNC is not set

#
# SCSI Transports
#
CONFIG_SCSI_SPI_ATTRS=m
CONFIG_SCSI_FC_ATTRS=m
CONFIG_SCSI_ISCSI_ATTRS=m
CONFIG_SCSI_SAS_ATTRS=m
CONFIG_SCSI_SAS_LIBSAS=m
CONFIG_SCSI_SAS_HOST_SMP=y
# CONFIG_SCSI_SRP_ATTRS is not set
CONFIG_SCSI_LOWLEVEL=y
CONFIG_ISCSI_BOOT_SYSFS=m
# CONFIG_SCSI_BNX2_ISCSI is not set
# CONFIG_SCSI_BNX2X_FCOE is not set
# CONFIG_BE2ISCSI is not set
CONFIG_BLK_DEV_3W_XXXX_RAID=m
# CONFIG_SCSI_HPSA is not set
CONFIG_SCSI_3W_9XXX=m
CONFIG_SCSI_3W_SAS=m
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AACRAID is not set
CONFIG_SCSI_AIC7XXX=m
CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
CONFIG_AIC7XXX_RESET_DELAY_MS=5000
# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
CONFIG_AIC7XXX_DEBUG_ENABLE=y
CONFIG_AIC7XXX_DEBUG_MASK=0
# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
CONFIG_SCSI_AIC7XXX_OLD=m
# CONFIG_SCSI_AIC79XX is not set
CONFIG_SCSI_AIC94XX=m
CONFIG_AIC94XX_DEBUG=y
CONFIG_SCSI_MVSAS=m
CONFIG_SCSI_MVSAS_DEBUG=y
# CONFIG_SCSI_MVSAS_TASKLET is not set
CONFIG_SCSI_MVUMI=m
CONFIG_SCSI_DPT_I2O=m
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_ARCMSR is not set
# CONFIG_MEGARAID_NEWGEN is not set
# CONFIG_MEGARAID_LEGACY is not set
# CONFIG_MEGARAID_SAS is not set
# CONFIG_SCSI_MPT2SAS is not set
# CONFIG_SCSI_UFSHCD is not set
CONFIG_SCSI_HPTIOP=m
# CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_VMWARE_PVSCSI is not set
CONFIG_LIBFC=m
CONFIG_LIBFCOE=m
CONFIG_FCOE=m
CONFIG_FCOE_FNIC=m
CONFIG_SCSI_DMX3191D=m
# CONFIG_SCSI_EATA is not set
CONFIG_SCSI_FUTURE_DOMAIN=m
CONFIG_SCSI_GDTH=m
# CONFIG_SCSI_ISCI is not set
CONFIG_SCSI_IPS=m
# CONFIG_SCSI_INITIO is not set
CONFIG_SCSI_INIA100=m
CONFIG_SCSI_STEX=m
CONFIG_SCSI_SYM53C8XX_2=m
CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
# CONFIG_SCSI_SYM53C8XX_MMIO is not set
CONFIG_SCSI_QLOGIC_1280=m
# CONFIG_SCSI_QLA_FC is not set
CONFIG_SCSI_QLA_ISCSI=m
# CONFIG_SCSI_LPFC is not set
# CONFIG_SCSI_DC395x is not set
CONFIG_SCSI_DC390T=m
# CONFIG_SCSI_DEBUG is not set
CONFIG_SCSI_PMCRAID=m
CONFIG_SCSI_PM8001=m
# CONFIG_SCSI_SRP is not set
CONFIG_SCSI_BFA_FC=m
# CONFIG_SCSI_VIRTIO is not set
CONFIG_SCSI_LOWLEVEL_PCMCIA=y
# CONFIG_PCMCIA_AHA152X is not set
# CONFIG_PCMCIA_FDOMAIN is not set
CONFIG_PCMCIA_QLOGIC=m
# CONFIG_PCMCIA_SYM53C500 is not set
# CONFIG_SCSI_DH is not set
CONFIG_SCSI_OSD_INITIATOR=m
# CONFIG_SCSI_OSD_ULD is not set
CONFIG_SCSI_OSD_DPRINT_SENSE=1
CONFIG_SCSI_OSD_DEBUG=y
# CONFIG_ATA is not set
# CONFIG_MD is not set
CONFIG_TARGET_CORE=m
CONFIG_TCM_IBLOCK=m
# CONFIG_TCM_FILEIO is not set
CONFIG_TCM_PSCSI=m
# CONFIG_LOOPBACK_TARGET is not set
# CONFIG_TCM_FC is not set
# CONFIG_ISCSI_TARGET is not set
# CONFIG_SBP_TARGET is not set
# CONFIG_FUSION is not set

#
# IEEE 1394 (FireWire) support
#
CONFIG_FIREWIRE=m
# CONFIG_FIREWIRE_OHCI is not set
CONFIG_FIREWIRE_SBP2=m
# CONFIG_FIREWIRE_NOSY is not set
CONFIG_I2O=m
# CONFIG_I2O_LCT_NOTIFY_ON_CHANGES is not set
CONFIG_I2O_EXT_ADAPTEC=y
CONFIG_I2O_EXT_ADAPTEC_DMA64=y
# CONFIG_I2O_CONFIG is not set
# CONFIG_I2O_BUS is not set
CONFIG_I2O_BLOCK=m
CONFIG_I2O_SCSI=m
# CONFIG_I2O_PROC is not set
# CONFIG_MACINTOSH_DRIVERS is not set
# CONFIG_NETDEVICES is not set
# CONFIG_ISDN is not set

#
# Input device support
#
CONFIG_INPUT=y
CONFIG_INPUT_FF_MEMLESS=m
# CONFIG_INPUT_POLLDEV is not set
CONFIG_INPUT_SPARSEKMAP=m
# CONFIG_INPUT_MATRIXKMAP is not set

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
CONFIG_INPUT_JOYDEV=m
CONFIG_INPUT_EVDEV=m
CONFIG_INPUT_EVBUG=m

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
CONFIG_KEYBOARD_ADP5588=m
# CONFIG_KEYBOARD_ADP5589 is not set
CONFIG_KEYBOARD_ATKBD=y
CONFIG_KEYBOARD_QT1070=m
# CONFIG_KEYBOARD_QT2160 is not set
CONFIG_KEYBOARD_LKKBD=m
# CONFIG_KEYBOARD_TCA6416 is not set
# CONFIG_KEYBOARD_TCA8418 is not set
# CONFIG_KEYBOARD_LM8323 is not set
# CONFIG_KEYBOARD_LM8333 is not set
CONFIG_KEYBOARD_MAX7359=m
# CONFIG_KEYBOARD_MCS is not set
CONFIG_KEYBOARD_MPR121=m
CONFIG_KEYBOARD_NEWTON=m
CONFIG_KEYBOARD_OPENCORES=m
# CONFIG_KEYBOARD_STOWAWAY is not set
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_OMAP4 is not set
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TABLET is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_INPUT_MISC is not set

#
# Hardware I/O ports
#
CONFIG_SERIO=y
CONFIG_SERIO_I8042=y
CONFIG_SERIO_SERPORT=m
# CONFIG_SERIO_CT82C710 is not set
CONFIG_SERIO_PARKBD=m
CONFIG_SERIO_PCIPS2=m
CONFIG_SERIO_LIBPS2=y
CONFIG_SERIO_RAW=m
# CONFIG_SERIO_ALTERA_PS2 is not set
# CONFIG_SERIO_PS2MULT is not set
CONFIG_GAMEPORT=m
CONFIG_GAMEPORT_NS558=m
# CONFIG_GAMEPORT_L4 is not set
# CONFIG_GAMEPORT_EMU10K1 is not set
# CONFIG_GAMEPORT_FM801 is not set

#
# Character devices
#
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_VT_CONSOLE_SLEEP=y
CONFIG_HW_CONSOLE=y
# CONFIG_VT_HW_CONSOLE_BINDING is not set
CONFIG_UNIX98_PTYS=y
# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_NONSTANDARD=y
# CONFIG_ROCKETPORT is not set
# CONFIG_CYCLADES is not set
CONFIG_MOXA_INTELLIO=m
CONFIG_MOXA_SMARTIO=m
# CONFIG_SYNCLINK is not set
# CONFIG_SYNCLINKMP is not set
# CONFIG_SYNCLINK_GT is not set
CONFIG_NOZOMI=m
CONFIG_ISI=m
CONFIG_N_HDLC=m
# CONFIG_N_GSM is not set
CONFIG_TRACE_ROUTER=m
CONFIG_TRACE_SINK=m
CONFIG_DEVKMEM=y
# CONFIG_STALDRV is not set

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_PNP=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_SERIAL_8250_PCI=y
CONFIG_SERIAL_8250_CS=m
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
# CONFIG_SERIAL_8250_EXTENDED is not set

#
# Non-8250 serial port support
#
CONFIG_SERIAL_MAX3100=m
# CONFIG_SERIAL_MAX310X is not set
# CONFIG_SERIAL_MFD_HSU is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_JSM is not set
CONFIG_SERIAL_SCCNXP=m
# CONFIG_SERIAL_TIMBERDALE is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_PCH_UART is not set
CONFIG_SERIAL_XILINX_PS_UART=m
CONFIG_PRINTER=m
CONFIG_LP_CONSOLE=y
CONFIG_PPDEV=m
# CONFIG_HVC_XEN is not set
# CONFIG_VIRTIO_CONSOLE is not set
# CONFIG_IPMI_HANDLER is not set
CONFIG_HW_RANDOM=m
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
# CONFIG_HW_RANDOM_INTEL is not set
# CONFIG_HW_RANDOM_AMD is not set
CONFIG_HW_RANDOM_VIA=m
# CONFIG_HW_RANDOM_VIRTIO is not set
CONFIG_HW_RANDOM_TPM=m
CONFIG_NVRAM=m
CONFIG_RTC=m
# CONFIG_GEN_RTC is not set
CONFIG_R3964=m
CONFIG_APPLICOM=m

#
# PCMCIA character devices
#
CONFIG_SYNCLINK_CS=m
# CONFIG_CARDMAN_4000 is not set
CONFIG_CARDMAN_4040=m
# CONFIG_MWAVE is not set
CONFIG_RAW_DRIVER=m
CONFIG_MAX_RAW_DEVS=256
# CONFIG_HPET is not set
CONFIG_HANGCHECK_TIMER=m
CONFIG_TCG_TPM=y
CONFIG_TCG_TIS=y
CONFIG_TCG_TIS_I2C_INFINEON=m
# CONFIG_TCG_NSC is not set
# CONFIG_TCG_ATMEL is not set
# CONFIG_TCG_INFINEON is not set
CONFIG_TELCLOCK=m
CONFIG_DEVPORT=y
CONFIG_I2C=m
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
# CONFIG_I2C_CHARDEV is not set
CONFIG_I2C_MUX=m

#
# Multiplexer I2C Chip support
#
CONFIG_I2C_MUX_PCA9541=m
# CONFIG_I2C_MUX_PCA954x is not set
# CONFIG_I2C_HELPER_AUTO is not set
CONFIG_I2C_SMBUS=m

#
# I2C Algorithms
#
CONFIG_I2C_ALGOBIT=m
# CONFIG_I2C_ALGOPCF is not set
CONFIG_I2C_ALGOPCA=m

#
# I2C Hardware Bus support
#

#
# PC SMBus host controller drivers
#
# CONFIG_I2C_ALI1535 is not set
CONFIG_I2C_ALI1563=m
# CONFIG_I2C_ALI15X3 is not set
# CONFIG_I2C_AMD756 is not set
# CONFIG_I2C_AMD8111 is not set
# CONFIG_I2C_I801 is not set
# CONFIG_I2C_ISCH is not set
CONFIG_I2C_PIIX4=m
# CONFIG_I2C_NFORCE2 is not set
CONFIG_I2C_SIS5595=m
# CONFIG_I2C_SIS630 is not set
# CONFIG_I2C_SIS96X is not set
CONFIG_I2C_VIA=m
CONFIG_I2C_VIAPRO=m

#
# ACPI drivers
#
# CONFIG_I2C_SCMI is not set

#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
CONFIG_I2C_DESIGNWARE_CORE=m
CONFIG_I2C_DESIGNWARE_PCI=m
CONFIG_I2C_EG20T=m
# CONFIG_I2C_INTEL_MID is not set
CONFIG_I2C_OCORES=m
# CONFIG_I2C_PCA_PLATFORM is not set
# CONFIG_I2C_PXA_PCI is not set
# CONFIG_I2C_SIMTEC is not set
CONFIG_I2C_XILINX=m

#
# External I2C/SMBus adapter drivers
#
# CONFIG_I2C_PARPORT is not set
# CONFIG_I2C_PARPORT_LIGHT is not set
CONFIG_I2C_TAOS_EVM=m

#
# Other I2C/SMBus bus drivers
#
# CONFIG_I2C_STUB is not set
CONFIG_I2C_DEBUG_CORE=y
CONFIG_I2C_DEBUG_ALGO=y
# CONFIG_I2C_DEBUG_BUS is not set
CONFIG_SPI=y
# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y

#
# SPI Master Controller Drivers
#
CONFIG_SPI_ALTERA=m
CONFIG_SPI_BITBANG=m
# CONFIG_SPI_BUTTERFLY is not set
CONFIG_SPI_LM70_LLP=m
# CONFIG_SPI_PXA2XX_PCI is not set
CONFIG_SPI_SC18IS602=m
# CONFIG_SPI_TOPCLIFF_PCH is not set
CONFIG_SPI_XCOMM=m
# CONFIG_SPI_XILINX is not set
# CONFIG_SPI_DESIGNWARE is not set

#
# SPI Protocol Masters
#
CONFIG_SPI_SPIDEV=m
# CONFIG_SPI_TLE62X0 is not set
# CONFIG_HSI is not set

#
# PPS support
#
CONFIG_PPS=m
CONFIG_PPS_DEBUG=y
CONFIG_NTP_PPS=y

#
# PPS clients support
#
# CONFIG_PPS_CLIENT_KTIMER is not set
# CONFIG_PPS_CLIENT_LDISC is not set
CONFIG_PPS_CLIENT_PARPORT=m
# CONFIG_PPS_CLIENT_GPIO is not set

#
# PPS generators support
#

#
# PTP clock support
#
CONFIG_PTP_1588_CLOCK=m

#
# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
#
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
# CONFIG_GPIOLIB is not set
CONFIG_W1=m

#
# 1-wire Bus Masters
#
# CONFIG_W1_MASTER_MATROX is not set
# CONFIG_W1_MASTER_DS2482 is not set
# CONFIG_W1_MASTER_DS1WM is not set
CONFIG_HDQ_MASTER_OMAP=m

#
# 1-wire Slaves
#
# CONFIG_W1_SLAVE_THERM is not set
# CONFIG_W1_SLAVE_SMEM is not set
CONFIG_W1_SLAVE_DS2408=m
CONFIG_W1_SLAVE_DS2423=m
# CONFIG_W1_SLAVE_DS2431 is not set
CONFIG_W1_SLAVE_DS2433=m
# CONFIG_W1_SLAVE_DS2433_CRC is not set
# CONFIG_W1_SLAVE_DS2760 is not set
CONFIG_W1_SLAVE_DS2780=m
CONFIG_W1_SLAVE_DS2781=m
CONFIG_W1_SLAVE_DS28E04=m
# CONFIG_W1_SLAVE_BQ27000 is not set
CONFIG_POWER_SUPPLY=y
# CONFIG_POWER_SUPPLY_DEBUG is not set
CONFIG_PDA_POWER=m
# CONFIG_GENERIC_ADC_BATTERY is not set
# CONFIG_WM831X_BACKUP is not set
# CONFIG_WM831X_POWER is not set
# CONFIG_TEST_POWER is not set
CONFIG_BATTERY_DS2780=m
# CONFIG_BATTERY_DS2781 is not set
CONFIG_BATTERY_DS2782=m
CONFIG_BATTERY_SBS=m
CONFIG_BATTERY_BQ27x00=m
CONFIG_BATTERY_BQ27X00_I2C=y
# CONFIG_BATTERY_BQ27X00_PLATFORM is not set
# CONFIG_BATTERY_MAX17040 is not set
# CONFIG_BATTERY_MAX17042 is not set
CONFIG_CHARGER_MAX8903=m
# CONFIG_CHARGER_LP8727 is not set
CONFIG_CHARGER_SMB347=m
# CONFIG_POWER_AVS is not set
CONFIG_HWMON=m
CONFIG_HWMON_VID=m
# CONFIG_HWMON_DEBUG_CHIP is not set

#
# Native drivers
#
CONFIG_SENSORS_ABITUGURU=m
CONFIG_SENSORS_ABITUGURU3=m
# CONFIG_SENSORS_AD7314 is not set
# CONFIG_SENSORS_AD7414 is not set
CONFIG_SENSORS_AD7418=m
CONFIG_SENSORS_ADCXX=m
CONFIG_SENSORS_ADM1021=m
# CONFIG_SENSORS_ADM1025 is not set
# CONFIG_SENSORS_ADM1026 is not set
CONFIG_SENSORS_ADM1029=m
CONFIG_SENSORS_ADM1031=m
# CONFIG_SENSORS_ADM9240 is not set
# CONFIG_SENSORS_ADT7410 is not set
# CONFIG_SENSORS_ADT7411 is not set
CONFIG_SENSORS_ADT7462=m
# CONFIG_SENSORS_ADT7470 is not set
CONFIG_SENSORS_ADT7475=m
# CONFIG_SENSORS_ASC7621 is not set
# CONFIG_SENSORS_K8TEMP is not set
CONFIG_SENSORS_K10TEMP=m
# CONFIG_SENSORS_FAM15H_POWER is not set
# CONFIG_SENSORS_ASB100 is not set
# CONFIG_SENSORS_ATXP1 is not set
CONFIG_SENSORS_DS620=m
# CONFIG_SENSORS_DS1621 is not set
CONFIG_SENSORS_I5K_AMB=m
CONFIG_SENSORS_F71805F=m
CONFIG_SENSORS_F71882FG=m
CONFIG_SENSORS_F75375S=m
CONFIG_SENSORS_FSCHMD=m
# CONFIG_SENSORS_G760A is not set
CONFIG_SENSORS_GL518SM=m
# CONFIG_SENSORS_GL520SM is not set
CONFIG_SENSORS_HIH6130=m
# CONFIG_SENSORS_CORETEMP is not set
CONFIG_SENSORS_IT87=m
# CONFIG_SENSORS_JC42 is not set
# CONFIG_SENSORS_LINEAGE is not set
# CONFIG_SENSORS_LM63 is not set
CONFIG_SENSORS_LM70=m
# CONFIG_SENSORS_LM73 is not set
# CONFIG_SENSORS_LM75 is not set
# CONFIG_SENSORS_LM77 is not set
CONFIG_SENSORS_LM78=m
# CONFIG_SENSORS_LM80 is not set
# CONFIG_SENSORS_LM83 is not set
CONFIG_SENSORS_LM85=m
CONFIG_SENSORS_LM87=m
CONFIG_SENSORS_LM90=m
# CONFIG_SENSORS_LM92 is not set
# CONFIG_SENSORS_LM93 is not set
CONFIG_SENSORS_LTC4151=m
CONFIG_SENSORS_LTC4215=m
CONFIG_SENSORS_LTC4245=m
CONFIG_SENSORS_LTC4261=m
CONFIG_SENSORS_LM95241=m
# CONFIG_SENSORS_LM95245 is not set
CONFIG_SENSORS_MAX1111=m
CONFIG_SENSORS_MAX16065=m
# CONFIG_SENSORS_MAX1619 is not set
CONFIG_SENSORS_MAX1668=m
CONFIG_SENSORS_MAX197=m
# CONFIG_SENSORS_MAX6639 is not set
# CONFIG_SENSORS_MAX6642 is not set
# CONFIG_SENSORS_MAX6650 is not set
# CONFIG_SENSORS_MCP3021 is not set
CONFIG_SENSORS_NTC_THERMISTOR=m
# CONFIG_SENSORS_PC87360 is not set
# CONFIG_SENSORS_PC87427 is not set
# CONFIG_SENSORS_PCF8591 is not set
CONFIG_PMBUS=m
CONFIG_SENSORS_PMBUS=m
# CONFIG_SENSORS_ADM1275 is not set
# CONFIG_SENSORS_LM25066 is not set
# CONFIG_SENSORS_LTC2978 is not set
CONFIG_SENSORS_MAX16064=m
# CONFIG_SENSORS_MAX34440 is not set
CONFIG_SENSORS_MAX8688=m
CONFIG_SENSORS_UCD9000=m
CONFIG_SENSORS_UCD9200=m
# CONFIG_SENSORS_ZL6100 is not set
# CONFIG_SENSORS_SHT21 is not set
# CONFIG_SENSORS_SIS5595 is not set
CONFIG_SENSORS_SMM665=m
CONFIG_SENSORS_DME1737=m
# CONFIG_SENSORS_EMC1403 is not set
# CONFIG_SENSORS_EMC2103 is not set
# CONFIG_SENSORS_EMC6W201 is not set
CONFIG_SENSORS_SMSC47M1=m
CONFIG_SENSORS_SMSC47M192=m
CONFIG_SENSORS_SMSC47B397=m
# CONFIG_SENSORS_SCH56XX_COMMON is not set
# CONFIG_SENSORS_ADS1015 is not set
# CONFIG_SENSORS_ADS7828 is not set
# CONFIG_SENSORS_ADS7871 is not set
# CONFIG_SENSORS_AMC6821 is not set
CONFIG_SENSORS_INA2XX=m
# CONFIG_SENSORS_THMC50 is not set
# CONFIG_SENSORS_TMP102 is not set
CONFIG_SENSORS_TMP401=m
# CONFIG_SENSORS_TMP421 is not set
# CONFIG_SENSORS_VIA_CPUTEMP is not set
# CONFIG_SENSORS_VIA686A is not set
CONFIG_SENSORS_VT1211=m
CONFIG_SENSORS_VT8231=m
# CONFIG_SENSORS_W83781D is not set
# CONFIG_SENSORS_W83791D is not set
# CONFIG_SENSORS_W83792D is not set
CONFIG_SENSORS_W83793=m
CONFIG_SENSORS_W83795=m
CONFIG_SENSORS_W83795_FANCTRL=y
# CONFIG_SENSORS_W83L785TS is not set
# CONFIG_SENSORS_W83L786NG is not set
# CONFIG_SENSORS_W83627HF is not set
CONFIG_SENSORS_W83627EHF=m
CONFIG_SENSORS_WM831X=m
# CONFIG_SENSORS_APPLESMC is not set

#
# ACPI drivers
#
# CONFIG_SENSORS_ACPI_POWER is not set
# CONFIG_SENSORS_ATK0110 is not set
CONFIG_THERMAL=y
# CONFIG_WATCHDOG is not set
CONFIG_SSB_POSSIBLE=y

#
# Sonics Silicon Backplane
#
# CONFIG_SSB is not set
CONFIG_BCMA_POSSIBLE=y

#
# Broadcom specific AMBA
#
CONFIG_BCMA=m
CONFIG_BCMA_HOST_PCI_POSSIBLE=y
CONFIG_BCMA_HOST_PCI=y
# CONFIG_BCMA_DRIVER_GMAC_CMN is not set
# CONFIG_BCMA_DEBUG is not set

#
# Multifunction device drivers
#
CONFIG_MFD_CORE=y
# CONFIG_MFD_SM501 is not set
CONFIG_HTC_PASIC3=m
CONFIG_MFD_LM3533=m
# CONFIG_TPS6105X is not set
# CONFIG_TPS6507X is not set
CONFIG_MFD_TPS65217=m
# CONFIG_MFD_STMPE is not set
# CONFIG_MFD_TMIO is not set
# CONFIG_MFD_DA9052_SPI is not set
CONFIG_MFD_ARIZONA=y
CONFIG_MFD_ARIZONA_I2C=m
# CONFIG_MFD_ARIZONA_SPI is not set
CONFIG_MFD_WM5102=y
# CONFIG_MFD_WM5110 is not set
CONFIG_MFD_WM831X=y
CONFIG_MFD_WM831X_SPI=y
# CONFIG_MFD_PCF50633 is not set
# CONFIG_MFD_MC13XXX_SPI is not set
# CONFIG_MFD_MC13XXX_I2C is not set
# CONFIG_ABX500_CORE is not set
# CONFIG_EZX_PCAP is not set
# CONFIG_MFD_CS5535 is not set
# CONFIG_LPC_SCH is not set
# CONFIG_LPC_ICH is not set
# CONFIG_MFD_RDC321X is not set
CONFIG_MFD_JANZ_CMODIO=m
CONFIG_MFD_VX855=m
# CONFIG_MFD_WL1273_CORE is not set
# CONFIG_REGULATOR is not set
# CONFIG_MEDIA_SUPPORT is not set

#
# Graphics support
#
# CONFIG_AGP is not set
CONFIG_VGA_ARB=y
CONFIG_VGA_ARB_MAX_GPUS=16
# CONFIG_VGA_SWITCHEROO is not set
# CONFIG_DRM is not set
CONFIG_STUB_POULSBO=m
CONFIG_VGASTATE=m
CONFIG_VIDEO_OUTPUT_CONTROL=m
CONFIG_FB=m
# CONFIG_FIRMWARE_EDID is not set
CONFIG_FB_DDC=m
# CONFIG_FB_BOOT_VESA_SUPPORT is not set
CONFIG_FB_CFB_FILLRECT=m
CONFIG_FB_CFB_COPYAREA=m
CONFIG_FB_CFB_IMAGEBLIT=m
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
CONFIG_FB_SYS_FILLRECT=m
CONFIG_FB_SYS_COPYAREA=m
CONFIG_FB_SYS_IMAGEBLIT=m
# CONFIG_FB_FOREIGN_ENDIAN is not set
CONFIG_FB_SYS_FOPS=m
# CONFIG_FB_WMT_GE_ROPS is not set
CONFIG_FB_DEFERRED_IO=y
CONFIG_FB_SVGALIB=m
# CONFIG_FB_MACMODES is not set
CONFIG_FB_BACKLIGHT=y
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_TILEBLITTING=y

#
# Frame buffer hardware drivers
#
# CONFIG_FB_CIRRUS is not set
# CONFIG_FB_PM2 is not set
# CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_ARC is not set
# CONFIG_FB_VGA16 is not set
# CONFIG_FB_N411 is not set
# CONFIG_FB_HGA is not set
CONFIG_FB_S1D13XXX=m
# CONFIG_FB_NVIDIA is not set
CONFIG_FB_RIVA=m
# CONFIG_FB_RIVA_I2C is not set
CONFIG_FB_RIVA_DEBUG=y
CONFIG_FB_RIVA_BACKLIGHT=y
CONFIG_FB_I740=m
CONFIG_FB_LE80578=m
# CONFIG_FB_CARILLO_RANCH is not set
CONFIG_FB_MATROX=m
# CONFIG_FB_MATROX_MILLENIUM is not set
CONFIG_FB_MATROX_MYSTIQUE=y
# CONFIG_FB_MATROX_G is not set
# CONFIG_FB_MATROX_I2C is not set
CONFIG_FB_RADEON=m
# CONFIG_FB_RADEON_I2C is not set
CONFIG_FB_RADEON_BACKLIGHT=y
CONFIG_FB_RADEON_DEBUG=y
# CONFIG_FB_ATY128 is not set
CONFIG_FB_ATY=m
# CONFIG_FB_ATY_CT is not set
# CONFIG_FB_ATY_GX is not set
CONFIG_FB_ATY_BACKLIGHT=y
CONFIG_FB_S3=m
CONFIG_FB_S3_DDC=y
# CONFIG_FB_SAVAGE is not set
CONFIG_FB_SIS=m
# CONFIG_FB_SIS_300 is not set
CONFIG_FB_SIS_315=y
# CONFIG_FB_VIA is not set
CONFIG_FB_NEOMAGIC=m
CONFIG_FB_KYRO=m
CONFIG_FB_3DFX=m
# CONFIG_FB_3DFX_ACCEL is not set
# CONFIG_FB_3DFX_I2C is not set
CONFIG_FB_VOODOO1=m
# CONFIG_FB_VT8623 is not set
# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_ARK is not set
CONFIG_FB_PM3=m
# CONFIG_FB_CARMINE is not set
CONFIG_FB_GEODE=y
CONFIG_FB_GEODE_LX=m
# CONFIG_FB_GEODE_GX is not set
CONFIG_FB_GEODE_GX1=m
CONFIG_FB_TMIO=m
CONFIG_FB_TMIO_ACCELL=y
# CONFIG_FB_VIRTUAL is not set
# CONFIG_XEN_FBDEV_FRONTEND is not set
CONFIG_FB_METRONOME=m
CONFIG_FB_MB862XX=m
CONFIG_FB_MB862XX_PCI_GDC=y
# CONFIG_FB_MB862XX_I2C is not set
# CONFIG_FB_BROADSHEET is not set
CONFIG_FB_AUO_K190X=m
CONFIG_FB_AUO_K1900=m
CONFIG_FB_AUO_K1901=m
# CONFIG_EXYNOS_VIDEO is not set
CONFIG_BACKLIGHT_LCD_SUPPORT=y
# CONFIG_LCD_CLASS_DEVICE is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=m
CONFIG_BACKLIGHT_GENERIC=m
# CONFIG_BACKLIGHT_LM3533 is not set
CONFIG_BACKLIGHT_PWM=m
# CONFIG_BACKLIGHT_APPLE is not set
CONFIG_BACKLIGHT_SAHARA=m
# CONFIG_BACKLIGHT_WM831X is not set
# CONFIG_BACKLIGHT_ADP8860 is not set
CONFIG_BACKLIGHT_ADP8870=m
# CONFIG_BACKLIGHT_LM3630 is not set
CONFIG_BACKLIGHT_LM3639=m
CONFIG_BACKLIGHT_LP855X=m
# CONFIG_BACKLIGHT_TPS65217 is not set

#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
# CONFIG_VGACON_SOFT_SCROLLBACK is not set
CONFIG_DUMMY_CONSOLE=y
# CONFIG_FRAMEBUFFER_CONSOLE is not set
# CONFIG_LOGO is not set
CONFIG_SOUND=m
CONFIG_SOUND_OSS_CORE=y
# CONFIG_SOUND_OSS_CORE_PRECLAIM is not set
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m
CONFIG_SND_SEQUENCER=m
# CONFIG_SND_SEQ_DUMMY is not set
CONFIG_SND_OSSEMUL=y
# CONFIG_SND_MIXER_OSS is not set
CONFIG_SND_PCM_OSS=m
CONFIG_SND_PCM_OSS_PLUGINS=y
# CONFIG_SND_SEQUENCER_OSS is not set
CONFIG_SND_RTCTIMER=m
CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y
CONFIG_SND_DYNAMIC_MINORS=y
# CONFIG_SND_SUPPORT_OLD_API is not set
CONFIG_SND_VERBOSE_PROCFS=y
CONFIG_SND_VERBOSE_PRINTK=y
# CONFIG_SND_DEBUG is not set
CONFIG_SND_DMA_SGBUF=y
# CONFIG_SND_RAWMIDI_SEQ is not set
# CONFIG_SND_OPL3_LIB_SEQ is not set
# CONFIG_SND_OPL4_LIB_SEQ is not set
# CONFIG_SND_SBAWE_SEQ is not set
# CONFIG_SND_EMU10K1_SEQ is not set
# CONFIG_SND_DRIVERS is not set
# CONFIG_SND_PCI is not set
# CONFIG_SND_SPI is not set
CONFIG_SND_FIREWIRE=y
CONFIG_SND_FIREWIRE_LIB=m
# CONFIG_SND_FIREWIRE_SPEAKERS is not set
CONFIG_SND_ISIGHT=m
# CONFIG_SND_PCMCIA is not set
# CONFIG_SND_SOC is not set
CONFIG_SOUND_PRIME=m
CONFIG_SOUND_OSS=m
CONFIG_SOUND_TRACEINIT=y
CONFIG_SOUND_DMAP=y
# CONFIG_SOUND_VMIDI is not set
CONFIG_SOUND_TRIX=m
# CONFIG_SOUND_MSS is not set
# CONFIG_SOUND_MPU401 is not set
# CONFIG_SOUND_PAS is not set
# CONFIG_SOUND_PSS is not set
CONFIG_SOUND_SB=m
CONFIG_SOUND_YM3812=m
# CONFIG_SOUND_UART6850 is not set
# CONFIG_SOUND_AEDSP16 is not set
CONFIG_SOUND_KAHLUA=m

#
# HID support
#
CONFIG_HID=m
CONFIG_HIDRAW=y
CONFIG_UHID=m
CONFIG_HID_GENERIC=m

#
# Special HID drivers
#
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB_ARCH_HAS_XHCI=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_ARCH_HAS_HCD=y
# CONFIG_USB is not set
# CONFIG_USB_HCD_BCMA is not set

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
#
# CONFIG_USB_EZUSB_FX2 is not set
# CONFIG_OMAP_USB2 is not set
# CONFIG_USB_GADGET is not set

#
# OTG and related infrastructure
#
CONFIG_UWB=m
# CONFIG_UWB_WHCI is not set
CONFIG_MMC=m
# CONFIG_MMC_DEBUG is not set
CONFIG_MMC_UNSAFE_RESUME=y
CONFIG_MMC_CLKGATE=y

#
# MMC/SD/SDIO Card Drivers
#
# CONFIG_MMC_BLOCK is not set
# CONFIG_SDIO_UART is not set
CONFIG_MMC_TEST=m

#
# MMC/SD/SDIO Host Controller Drivers
#
# CONFIG_MMC_SDHCI is not set
# CONFIG_MMC_WBSD is not set
CONFIG_MMC_TIFM_SD=m
CONFIG_MMC_SPI=m
CONFIG_MMC_SDRICOH_CS=m
# CONFIG_MMC_CB710 is not set
# CONFIG_MMC_VIA_SDMMC is not set
CONFIG_MEMSTICK=m
CONFIG_MEMSTICK_DEBUG=y

#
# MemoryStick drivers
#
# CONFIG_MEMSTICK_UNSAFE_RESUME is not set
# CONFIG_MSPRO_BLOCK is not set

#
# MemoryStick Host Controller Drivers
#
CONFIG_MEMSTICK_TIFM_MS=m
CONFIG_MEMSTICK_JMICRON_38X=m
CONFIG_MEMSTICK_R592=m
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=m

#
# LED drivers
#
CONFIG_LEDS_LM3530=m
CONFIG_LEDS_LM3533=m
CONFIG_LEDS_LM3642=m
# CONFIG_LEDS_PCA9532 is not set
# CONFIG_LEDS_LP3944 is not set
CONFIG_LEDS_LP5521=m
# CONFIG_LEDS_LP5523 is not set
CONFIG_LEDS_CLEVO_MAIL=m
# CONFIG_LEDS_PCA955X is not set
# CONFIG_LEDS_PCA9633 is not set
CONFIG_LEDS_WM831X_STATUS=m
# CONFIG_LEDS_DAC124S085 is not set
# CONFIG_LEDS_BD2802 is not set
# CONFIG_LEDS_INTEL_SS4200 is not set
CONFIG_LEDS_TCA6507=m
# CONFIG_LEDS_LM355x is not set
CONFIG_LEDS_OT200=m
CONFIG_LEDS_BLINKM=m
# CONFIG_LEDS_TRIGGERS is not set

#
# LED Triggers
#
CONFIG_ACCESSIBILITY=y
# CONFIG_A11Y_BRAILLE_CONSOLE is not set
CONFIG_INFINIBAND=m
CONFIG_INFINIBAND_USER_MAD=m
CONFIG_INFINIBAND_USER_ACCESS=m
CONFIG_INFINIBAND_USER_MEM=y
# CONFIG_INFINIBAND_MTHCA is not set
# CONFIG_INFINIBAND_QIB is not set
# CONFIG_INFINIBAND_SRP is not set
# CONFIG_INFINIBAND_SRPT is not set
# CONFIG_EDAC is not set
# CONFIG_RTC_CLASS is not set
# CONFIG_DMADEVICES is not set
CONFIG_AUXDISPLAY=y
CONFIG_UIO=m
CONFIG_UIO_CIF=m
# CONFIG_UIO_PDRV is not set
CONFIG_UIO_PDRV_GENIRQ=m
CONFIG_UIO_AEC=m
# CONFIG_UIO_SERCOS3 is not set
# CONFIG_UIO_PCI_GENERIC is not set
# CONFIG_UIO_NETX is not set
CONFIG_VIRTIO=m

#
# Virtio drivers
#
CONFIG_VIRTIO_PCI=m
CONFIG_VIRTIO_BALLOON=m
CONFIG_VIRTIO_MMIO=m
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y

#
# Microsoft Hyper-V guest support
#
# CONFIG_HYPERV is not set

#
# Xen driver support
#
# CONFIG_XEN_BALLOON is not set
CONFIG_XEN_DEV_EVTCHN=m
CONFIG_XEN_BACKEND=y
CONFIG_XENFS=m
# CONFIG_XEN_COMPAT_XENFS is not set
# CONFIG_XEN_SYS_HYPERVISOR is not set
CONFIG_XEN_XENBUS_FRONTEND=y
CONFIG_XEN_GNTDEV=m
CONFIG_XEN_GRANT_DEV_ALLOC=m
CONFIG_SWIOTLB_XEN=y
CONFIG_XEN_TMEM=y
CONFIG_XEN_PCIDEV_BACKEND=m
CONFIG_XEN_PRIVCMD=m
# CONFIG_XEN_MCE_LOG is not set
CONFIG_STAGING=y
# CONFIG_SLICOSS is not set
CONFIG_ECHO=m
# CONFIG_COMEDI is not set
# CONFIG_PANEL is not set
# CONFIG_RTS_PSTOR is not set
CONFIG_DX_SEP=m

#
# IIO staging drivers
#
CONFIG_IIO_ST_HWMON=m
CONFIG_IIO_SW_RING=m

#
# Accelerometers
#
# CONFIG_ADIS16201 is not set
CONFIG_ADIS16203=m
CONFIG_ADIS16204=m
CONFIG_ADIS16209=m
CONFIG_ADIS16220=m
# CONFIG_ADIS16240 is not set
CONFIG_KXSD9=m
CONFIG_SCA3000=m

#
# Analog to digital converters
#
# CONFIG_AD7291 is not set
# CONFIG_AD7298 is not set
# CONFIG_AD799X is not set
# CONFIG_AD7887 is not set
# CONFIG_AD7793 is not set
CONFIG_AD7192=m
CONFIG_ADT7310=m
CONFIG_ADT7410=m
# CONFIG_AD7280 is not set
CONFIG_MAX1363=m
CONFIG_MAX1363_RING_BUFFER=y

#
# Analog digital bi-direction converters
#

#
# Capacitance to digital converters
#
# CONFIG_AD7150 is not set
# CONFIG_AD7152 is not set
# CONFIG_AD7746 is not set

#
# Direct Digital Synthesis
#
CONFIG_AD5930=m
CONFIG_AD9832=m
CONFIG_AD9834=m
# CONFIG_AD9850 is not set
CONFIG_AD9852=m
CONFIG_AD9910=m
# CONFIG_AD9951 is not set

#
# Digital gyroscope sensors
#
CONFIG_ADIS16060=m
CONFIG_ADIS16080=m
CONFIG_ADIS16130=m
# CONFIG_ADIS16260 is not set
# CONFIG_ADXRS450 is not set

#
# Network Analyzer, Impedance Converters
#
# CONFIG_AD5933 is not set

#
# Inertial measurement units
#
# CONFIG_ADIS16400 is not set

#
# Light sensors
#
# CONFIG_SENSORS_ISL29018 is not set
CONFIG_SENSORS_ISL29028=m
# CONFIG_SENSORS_TSL2563 is not set
# CONFIG_TSL2583 is not set
CONFIG_TSL2x7x=m

#
# Magnetometer sensors
#
CONFIG_SENSORS_HMC5843=m

#
# Active energy metering IC
#
# CONFIG_ADE7753 is not set
CONFIG_ADE7754=m
# CONFIG_ADE7758 is not set
CONFIG_ADE7759=m
CONFIG_ADE7854=m
CONFIG_ADE7854_I2C=m
# CONFIG_ADE7854_SPI is not set

#
# Resolver to digital converters
#
CONFIG_AD2S90=m

#
# Triggers - standalone
#
CONFIG_IIO_SYSFS_TRIGGER=m
# CONFIG_IIO_SIMPLE_DUMMY is not set
# CONFIG_ZSMALLOC is not set
# CONFIG_FB_SM7XX is not set
# CONFIG_CRYSTALHD is not set
# CONFIG_FB_XGI is not set
# CONFIG_ACPI_QUICKSTART is not set
# CONFIG_FT1000 is not set

#
# Speakup console speech
#
CONFIG_SPEAKUP=m
CONFIG_SPEAKUP_SYNTH_ACNTSA=m
CONFIG_SPEAKUP_SYNTH_ACNTPC=m
# CONFIG_SPEAKUP_SYNTH_APOLLO is not set
# CONFIG_SPEAKUP_SYNTH_AUDPTR is not set
CONFIG_SPEAKUP_SYNTH_BNS=m
CONFIG_SPEAKUP_SYNTH_DECTLK=m
# CONFIG_SPEAKUP_SYNTH_DECEXT is not set
# CONFIG_SPEAKUP_SYNTH_DECPC is not set
# CONFIG_SPEAKUP_SYNTH_DTLK is not set
# CONFIG_SPEAKUP_SYNTH_KEYPC is not set
# CONFIG_SPEAKUP_SYNTH_LTLK is not set
CONFIG_SPEAKUP_SYNTH_SOFT=m
CONFIG_SPEAKUP_SYNTH_SPKOUT=m
# CONFIG_SPEAKUP_SYNTH_TXPRT is not set
CONFIG_SPEAKUP_SYNTH_DUMMY=m
CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4=m
CONFIG_STAGING_MEDIA=y

#
# Android
#
# CONFIG_ANDROID is not set
# CONFIG_PHONE is not set
CONFIG_IPACK_BUS=m
CONFIG_BOARD_TPCI200=m
CONFIG_SERIAL_IPOCTAL=m
# CONFIG_WIMAX_GDM72XX is not set
# CONFIG_NET_VENDOR_SILICOM is not set
CONFIG_DGRP=m
# CONFIG_X86_PLATFORM_DEVICES is not set

#
# Hardware Spinlock drivers
#
CONFIG_CLKEVT_I8253=y
CONFIG_I8253_LOCK=y
CONFIG_CLKBLD_I8253=y
# CONFIG_IOMMU_SUPPORT is not set

#
# Remoteproc drivers (EXPERIMENTAL)
#
CONFIG_REMOTEPROC=m
CONFIG_STE_MODEM_RPROC=m

#
# Rpmsg drivers (EXPERIMENTAL)
#
CONFIG_VIRT_DRIVERS=y
CONFIG_PM_DEVFREQ=y

#
# DEVFREQ Governors
#
# CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND is not set
# CONFIG_DEVFREQ_GOV_PERFORMANCE is not set
CONFIG_DEVFREQ_GOV_POWERSAVE=y
# CONFIG_DEVFREQ_GOV_USERSPACE is not set

#
# DEVFREQ Drivers
#
# CONFIG_EXTCON is not set
# CONFIG_MEMORY is not set
CONFIG_IIO=m
CONFIG_IIO_BUFFER=y
CONFIG_IIO_KFIFO_BUF=m
CONFIG_IIO_TRIGGERED_BUFFER=m
CONFIG_IIO_TRIGGER=y
CONFIG_IIO_CONSUMERS_PER_TRIGGER=2

#
# Accelerometers
#

#
# Analog to digital converters
#
CONFIG_AD_SIGMA_DELTA=m
# CONFIG_AD7266 is not set
CONFIG_AD7791=m
# CONFIG_AD7476 is not set

#
# Amplifiers
#
# CONFIG_AD8366 is not set

#
# Light sensors
#
CONFIG_ADJD_S311=m
CONFIG_SENSORS_LM3533=m
CONFIG_VCNL4000=m

#
# Frequency Synthesizers DDS/PLL
#

#
# Clock Generator/Distribution
#
# CONFIG_AD9523 is not set

#
# Phase-Locked Loop (PLL) frequency synthesizers
#
# CONFIG_ADF4350 is not set

#
# Digital to analog converters
#
# CONFIG_AD5064 is not set
CONFIG_AD5360=m
CONFIG_AD5380=m
# CONFIG_AD5421 is not set
# CONFIG_AD5624R_SPI is not set
# CONFIG_AD5446 is not set
# CONFIG_AD5504 is not set
# CONFIG_AD5755 is not set
# CONFIG_AD5764 is not set
# CONFIG_AD5791 is not set
CONFIG_AD5686=m
# CONFIG_MAX517 is not set
CONFIG_MCP4725=m

#
# Hid Sensor IIO Common
#

#
# Digital gyroscope sensors
#

#
# Magnetometer sensors
#
# CONFIG_VME_BUS is not set
CONFIG_PWM=y

#
# Firmware Drivers
#
CONFIG_EDD=m
# CONFIG_EDD_OFF is not set
CONFIG_FIRMWARE_MEMMAP=y
CONFIG_DELL_RBU=m
# CONFIG_DCDBAS is not set
# CONFIG_DMIID is not set
CONFIG_DMI_SYSFS=m
# CONFIG_ISCSI_IBFT_FIND is not set
# CONFIG_GOOGLE_FIRMWARE is not set

#
# File systems
#
CONFIG_DCACHE_WORD_ACCESS=y
# CONFIG_EXT2_FS is not set
CONFIG_EXT3_FS=m
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
# CONFIG_EXT3_FS_SECURITY is not set
# CONFIG_EXT4_FS is not set
CONFIG_JBD=m
CONFIG_JBD_DEBUG=y
CONFIG_FS_MBCACHE=m
CONFIG_REISERFS_FS=m
CONFIG_REISERFS_CHECK=y
# CONFIG_REISERFS_PROC_INFO is not set
CONFIG_REISERFS_FS_XATTR=y
CONFIG_REISERFS_FS_POSIX_ACL=y
# CONFIG_REISERFS_FS_SECURITY is not set
# CONFIG_JFS_FS is not set
CONFIG_XFS_FS=m
CONFIG_XFS_QUOTA=y
CONFIG_XFS_POSIX_ACL=y
# CONFIG_XFS_RT is not set
# CONFIG_XFS_DEBUG is not set
# CONFIG_GFS2_FS is not set
# CONFIG_OCFS2_FS is not set
# CONFIG_BTRFS_FS is not set
# CONFIG_NILFS2_FS is not set
CONFIG_FS_POSIX_ACL=y
CONFIG_EXPORTFS=m
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY_USER=y
# CONFIG_FANOTIFY is not set
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
CONFIG_PRINT_QUOTA_WARNING=y
# CONFIG_QUOTA_DEBUG is not set
# CONFIG_QFMT_V1 is not set
# CONFIG_QFMT_V2 is not set
CONFIG_QUOTACTL=y
CONFIG_AUTOFS4_FS=m
# CONFIG_FUSE_FS is not set
CONFIG_GENERIC_ACL=y

#
# Caches
#
# CONFIG_FSCACHE is not set

#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
CONFIG_UDF_FS=m
CONFIG_UDF_NLS=y

#
# DOS/FAT/NT Filesystems
#
# CONFIG_MSDOS_FS is not set
# CONFIG_VFAT_FS is not set
CONFIG_NTFS_FS=m
CONFIG_NTFS_DEBUG=y
# CONFIG_NTFS_RW is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_TMPFS_XATTR=y
# CONFIG_HUGETLBFS is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_CONFIGFS_FS=m
# CONFIG_MISC_FILESYSTEMS is not set
# CONFIG_NETWORK_FILESYSTEMS is not set
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set
CONFIG_NLS_CODEPAGE_737=m
# CONFIG_NLS_CODEPAGE_775 is not set
CONFIG_NLS_CODEPAGE_850=m
CONFIG_NLS_CODEPAGE_852=m
CONFIG_NLS_CODEPAGE_855=m
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
CONFIG_NLS_CODEPAGE_862=m
CONFIG_NLS_CODEPAGE_863=m
CONFIG_NLS_CODEPAGE_864=m
# CONFIG_NLS_CODEPAGE_865 is not set
CONFIG_NLS_CODEPAGE_866=m
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
CONFIG_NLS_CODEPAGE_950=m
# CONFIG_NLS_CODEPAGE_932 is not set
CONFIG_NLS_CODEPAGE_949=m
CONFIG_NLS_CODEPAGE_874=m
CONFIG_NLS_ISO8859_8=m
CONFIG_NLS_CODEPAGE_1250=m
CONFIG_NLS_CODEPAGE_1251=m
# CONFIG_NLS_ASCII is not set
CONFIG_NLS_ISO8859_1=m
CONFIG_NLS_ISO8859_2=m
# CONFIG_NLS_ISO8859_3 is not set
CONFIG_NLS_ISO8859_4=m
# CONFIG_NLS_ISO8859_5 is not set
CONFIG_NLS_ISO8859_6=m
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_9 is not set
CONFIG_NLS_ISO8859_13=m
CONFIG_NLS_ISO8859_14=m
CONFIG_NLS_ISO8859_15=m
CONFIG_NLS_KOI8_R=m
CONFIG_NLS_KOI8_U=m
# CONFIG_NLS_MAC_ROMAN is not set
# CONFIG_NLS_MAC_CELTIC is not set
# CONFIG_NLS_MAC_CENTEURO is not set
CONFIG_NLS_MAC_CROATIAN=m
CONFIG_NLS_MAC_CYRILLIC=m
CONFIG_NLS_MAC_GAELIC=m
CONFIG_NLS_MAC_GREEK=m
CONFIG_NLS_MAC_ICELAND=m
# CONFIG_NLS_MAC_INUIT is not set
CONFIG_NLS_MAC_ROMANIAN=m
CONFIG_NLS_MAC_TURKISH=m
CONFIG_NLS_UTF8=m

#
# Kernel hacking
#
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_PRINTK_TIME=y
CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
CONFIG_ENABLE_WARN_DEPRECATED=y
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_FRAME_WARN=2048
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_READABLE_ASM is not set
# CONFIG_UNUSED_SYMBOLS is not set
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
CONFIG_DEBUG_SECTION_MISMATCH=y
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_SHIRQ is not set
# CONFIG_LOCKUP_DETECTOR is not set
# CONFIG_PANIC_ON_OOPS is not set
CONFIG_PANIC_ON_OOPS_VALUE=0
# CONFIG_DETECT_HUNG_TASK is not set
CONFIG_SCHED_DEBUG=y
# CONFIG_SCHEDSTATS is not set
# CONFIG_TIMER_STATS is not set
# CONFIG_DEBUG_OBJECTS is not set
CONFIG_SLUB_DEBUG_ON=y
CONFIG_SLUB_STATS=y
CONFIG_HAVE_DEBUG_KMEMLEAK=y
# CONFIG_DEBUG_KMEMLEAK is not set
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_RT_MUTEX_TESTER is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_MUTEXES is not set
# CONFIG_DEBUG_LOCK_ALLOC is not set
# CONFIG_PROVE_LOCKING is not set
CONFIG_SPARSE_RCU_POINTER=y
# CONFIG_LOCK_STAT is not set
CONFIG_DEBUG_ATOMIC_SLEEP=y
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
# CONFIG_DEBUG_STACK_USAGE is not set
# CONFIG_DEBUG_KOBJECT is not set
CONFIG_DEBUG_BUGVERBOSE=y
# CONFIG_DEBUG_INFO is not set
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_VIRTUAL is not set
# CONFIG_DEBUG_WRITECOUNT is not set
CONFIG_DEBUG_MEMORY_INIT=y
# CONFIG_DEBUG_LIST is not set
# CONFIG_TEST_LIST_SORT is not set
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
# CONFIG_DEBUG_CREDENTIALS is not set
CONFIG_ARCH_WANT_FRAME_POINTERS=y
CONFIG_FRAME_POINTER=y
# CONFIG_BOOT_PRINTK_DELAY is not set
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_RCU_TRACE is not set
# CONFIG_KPROBES_SANITY_TEST is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
# CONFIG_LKDTM is not set
# CONFIG_NOTIFIER_ERROR_INJECTION is not set
# CONFIG_FAULT_INJECTION is not set
# CONFIG_LATENCYTOP is not set
# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_FENTRY=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_TRACING_SUPPORT=y
# CONFIG_FTRACE is not set
# CONFIG_RBTREE_TEST is not set
# CONFIG_INTERVAL_TREE_TEST is not set
CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DMA_API_DEBUG=y
# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
CONFIG_HAVE_ARCH_KMEMCHECK=y
CONFIG_TEST_KSTRTOX=m
# CONFIG_STRICT_DEVMEM is not set
CONFIG_X86_VERBOSE_BOOTUP=y
CONFIG_EARLY_PRINTK=y
CONFIG_EARLY_PRINTK_DBGP=y
# CONFIG_DEBUG_STACKOVERFLOW is not set
# CONFIG_X86_PTDUMP is not set
CONFIG_DEBUG_RODATA=y
CONFIG_DEBUG_RODATA_TEST=y
# CONFIG_DEBUG_SET_MODULE_RONX is not set
# CONFIG_DEBUG_NX_TEST is not set
# CONFIG_DEBUG_TLBFLUSH is not set
# CONFIG_IOMMU_DEBUG is not set
# CONFIG_IOMMU_STRESS is not set
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
# CONFIG_X86_DECODER_SELFTEST is not set
CONFIG_IO_DELAY_TYPE_0X80=0
CONFIG_IO_DELAY_TYPE_0XED=1
CONFIG_IO_DELAY_TYPE_UDELAY=2
CONFIG_IO_DELAY_TYPE_NONE=3
# CONFIG_IO_DELAY_0X80 is not set
# CONFIG_IO_DELAY_0XED is not set
CONFIG_IO_DELAY_UDELAY=y
# CONFIG_IO_DELAY_NONE is not set
CONFIG_DEFAULT_IO_DELAY_TYPE=2
# CONFIG_DEBUG_BOOT_PARAMS is not set
# CONFIG_CPA_DEBUG is not set
# CONFIG_OPTIMIZE_INLINING is not set
# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
# CONFIG_DEBUG_NMI_SELFTEST is not set

#
# Security options
#
CONFIG_KEYS=y
CONFIG_TRUSTED_KEYS=m
# CONFIG_ENCRYPTED_KEYS is not set
# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
CONFIG_SECURITY_DMESG_RESTRICT=y
CONFIG_SECURITY=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
# CONFIG_SECURITY_NETWORK_XFRM is not set
CONFIG_SECURITY_PATH=y
# CONFIG_SECURITY_TOMOYO is not set
CONFIG_SECURITY_APPARMOR=y
CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1
# CONFIG_SECURITY_YAMA is not set
CONFIG_INTEGRITY=y
CONFIG_INTEGRITY_SIGNATURE=y
CONFIG_IMA=y
CONFIG_IMA_MEASURE_PCR_IDX=10
# CONFIG_IMA_AUDIT is not set
CONFIG_IMA_APPRAISE=y
CONFIG_DEFAULT_SECURITY_APPARMOR=y
# CONFIG_DEFAULT_SECURITY_DAC is not set
CONFIG_DEFAULT_SECURITY="apparmor"
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=m
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER=m
CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=m
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_PCOMP=m
CONFIG_CRYPTO_PCOMP2=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
CONFIG_CRYPTO_USER=m
CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
CONFIG_CRYPTO_GF128MUL=m
CONFIG_CRYPTO_NULL=m
CONFIG_CRYPTO_WORKQUEUE=y
CONFIG_CRYPTO_CRYPTD=m
# CONFIG_CRYPTO_AUTHENC is not set
# CONFIG_CRYPTO_TEST is not set
CONFIG_CRYPTO_ABLK_HELPER_X86=m
CONFIG_CRYPTO_GLUE_HELPER_X86=m

#
# Authenticated Encryption with Associated Data
#
CONFIG_CRYPTO_CCM=m
CONFIG_CRYPTO_GCM=m
CONFIG_CRYPTO_SEQIV=m

#
# Block modes
#
# CONFIG_CRYPTO_CBC is not set
CONFIG_CRYPTO_CTR=m
CONFIG_CRYPTO_CTS=m
CONFIG_CRYPTO_ECB=m
CONFIG_CRYPTO_LRW=m
# CONFIG_CRYPTO_PCBC is not set
CONFIG_CRYPTO_XTS=m

#
# Hash modes
#
CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_XCBC=m
# CONFIG_CRYPTO_VMAC is not set

#
# Digest
#
# CONFIG_CRYPTO_CRC32C is not set
CONFIG_CRYPTO_CRC32C_INTEL=m
CONFIG_CRYPTO_GHASH=m
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MICHAEL_MIC=m
# CONFIG_CRYPTO_RMD128 is not set
# CONFIG_CRYPTO_RMD160 is not set
# CONFIG_CRYPTO_RMD256 is not set
CONFIG_CRYPTO_RMD320=m
CONFIG_CRYPTO_SHA1=y
CONFIG_CRYPTO_SHA1_SSSE3=m
CONFIG_CRYPTO_SHA256=y
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_WP512 is not set
# CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL is not set

#
# Ciphers
#
CONFIG_CRYPTO_AES=m
CONFIG_CRYPTO_AES_X86_64=m
CONFIG_CRYPTO_AES_NI_INTEL=m
CONFIG_CRYPTO_ANUBIS=m
CONFIG_CRYPTO_ARC4=m
CONFIG_CRYPTO_BLOWFISH=m
CONFIG_CRYPTO_BLOWFISH_COMMON=m
# CONFIG_CRYPTO_BLOWFISH_X86_64 is not set
CONFIG_CRYPTO_CAMELLIA=m
CONFIG_CRYPTO_CAMELLIA_X86_64=m
CONFIG_CRYPTO_CAST5=m
# CONFIG_CRYPTO_CAST5_AVX_X86_64 is not set
CONFIG_CRYPTO_CAST6=m
# CONFIG_CRYPTO_CAST6_AVX_X86_64 is not set
CONFIG_CRYPTO_DES=m
# CONFIG_CRYPTO_FCRYPT is not set
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_SALSA20 is not set
CONFIG_CRYPTO_SALSA20_X86_64=m
# CONFIG_CRYPTO_SEED is not set
CONFIG_CRYPTO_SERPENT=m
CONFIG_CRYPTO_SERPENT_SSE2_X86_64=m
# CONFIG_CRYPTO_SERPENT_AVX_X86_64 is not set
# CONFIG_CRYPTO_TEA is not set
CONFIG_CRYPTO_TWOFISH=m
CONFIG_CRYPTO_TWOFISH_COMMON=m
CONFIG_CRYPTO_TWOFISH_X86_64=m
CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=m
CONFIG_CRYPTO_TWOFISH_AVX_X86_64=m

#
# Compression
#
CONFIG_CRYPTO_DEFLATE=m
CONFIG_CRYPTO_ZLIB=m
# CONFIG_CRYPTO_LZO is not set

#
# Random Number Generation
#
CONFIG_CRYPTO_ANSI_CPRNG=m
CONFIG_CRYPTO_USER_API=m
CONFIG_CRYPTO_USER_API_HASH=m
# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
CONFIG_CRYPTO_HW=y
# CONFIG_CRYPTO_DEV_PADLOCK is not set
CONFIG_ASYMMETRIC_KEY_TYPE=y
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
CONFIG_PUBLIC_KEY_ALGO_RSA=y
CONFIG_X509_CERTIFICATE_PARSER=y
CONFIG_HAVE_KVM=y
# CONFIG_VIRTUALIZATION is not set
# CONFIG_BINARY_PRINTF is not set

#
# Library routines
#
CONFIG_BITREVERSE=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GENERIC_FIND_FIRST_BIT=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_IO=y
CONFIG_CRC_CCITT=m
CONFIG_CRC16=m
CONFIG_CRC_T10DIF=m
CONFIG_CRC_ITU_T=m
CONFIG_CRC32=y
# CONFIG_CRC32_SELFTEST is not set
CONFIG_CRC32_SLICEBY8=y
# CONFIG_CRC32_SLICEBY4 is not set
# CONFIG_CRC32_SARWATE is not set
# CONFIG_CRC32_BIT is not set
CONFIG_CRC7=m
# CONFIG_LIBCRC32C is not set
CONFIG_CRC8=m
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=m
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_XZ_DEC=y
CONFIG_XZ_DEC_X86=y
CONFIG_XZ_DEC_POWERPC=y
CONFIG_XZ_DEC_IA64=y
CONFIG_XZ_DEC_ARM=y
CONFIG_XZ_DEC_ARMTHUMB=y
CONFIG_XZ_DEC_SPARC=y
CONFIG_XZ_DEC_BCJ=y
CONFIG_XZ_DEC_TEST=m
CONFIG_DECOMPRESS_GZIP=y
CONFIG_DECOMPRESS_BZIP2=y
CONFIG_DECOMPRESS_LZMA=y
CONFIG_DECOMPRESS_XZ=y
CONFIG_DECOMPRESS_LZO=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_CHECK_SIGNATURE=y
CONFIG_DQL=y
CONFIG_NLATTR=y
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
CONFIG_AVERAGE=y
CONFIG_CLZ_TAB=y
# CONFIG_CORDIC is not set
# CONFIG_DDR is not set
CONFIG_MPILIB=y
CONFIG_SIGNATURE=y
CONFIG_OID_REGISTRY=y

--=_50b68452.A6KZaSQDGJ7X3bTwVTt7Bk6j0xJkxL9Q6i7ArV1x5gdxZGwi
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.xen.org
http://lists.xen.org/xen-devel

--=_50b68452.A6KZaSQDGJ7X3bTwVTt7Bk6j0xJkxL9Q6i7ArV1x5gdxZGwi--


From xen-devel-bounces@lists.xen.org Wed Nov 28 21:39:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 21:39:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdpLi-0000At-KJ; Wed, 28 Nov 2012 21:39:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fengguang.wu@intel.com>) id 1TdpLh-0000Al-2l
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 21:39:17 +0000
Received: from [85.158.139.211:55150] by server-14.bemta-5.messagelabs.com id
	D8/63-21768-48486B05; Wed, 28 Nov 2012 21:39:16 +0000
X-Env-Sender: fengguang.wu@intel.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354138747!14034160!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjM0MjI3\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8646 invoked from network); 28 Nov 2012 21:39:13 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-13.tower-206.messagelabs.com with SMTP;
	28 Nov 2012 21:39:13 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga102.ch.intel.com with ESMTP; 28 Nov 2012 13:39:01 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,180,1355126400"; d="scan'208";a="223907812"
Received: from bee.sh.intel.com (HELO localhost) ([10.239.97.14])
	by azsmga001.ch.intel.com with ESMTP; 28 Nov 2012 13:38:58 -0800
Received: from [192.168.1.1] (helo=bee) by localhost with smtp (Exim 4.80)
	(envelope-from <fengguang.wu@intel.com>)
	id 1TdpKs-000EBL-DX; Thu, 29 Nov 2012 05:38:26 +0800
Date: Thu, 29 Nov 2012 05:38:26 +0800
From: kbuild test robot <fengguang.wu@intel.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Message-ID: <50b68452.Gqr1L/cRkHFh1xmK%fengguang.wu@intel.com>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="=_50b68452.A6KZaSQDGJ7X3bTwVTt7Bk6j0xJkxL9Q6i7ArV1x5gdxZGwi"
X-SA-Exim-Connect-IP: 192.168.1.1
X-SA-Exim-Mail-From: fengguang.wu@intel.com
X-SA-Exim-Scanned: No (on localhost); SAEximRunCond expanded to false
Cc: xen-devel@lists.xensource.com, Jan Beulich <JBeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [Xen-devel] [xen:stable/for-linus-3.8 4/8]
 include/xen/interface/version.h:72:2: error: implicit declaration of
 function 'xen_domain'
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a multi-part message in MIME format.

--=_50b68452.A6KZaSQDGJ7X3bTwVTt7Bk6j0xJkxL9Q6i7ArV1x5gdxZGwi
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-linus-3.8
head:   394b40f62d7ae18a1c48c13fc483b8193f8c3a98
commit: 92e3229dcdc80ff0b6304f14c578d76e7e10e226 [4/8] xen/acpi: ACPI PAD driver
config: x86_64-randconfig-x701 (attached as .config)

Note: the xen/stable/for-linus-3.8 HEAD 394b40f builds fine.
      It only hurts bisectibility.

All error/warnings:

In file included from drivers/xen/features.c:15:0:
include/xen/interface/version.h: In function 'xen_running_on_version_or_later':
include/xen/interface/version.h:72:2: error: implicit declaration of function 'xen_domain' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

vim +72 +/xen_domain include/xen/interface/version.h

92e3229d Liu, Jinsong 2012-11-08  66  /* Check if running on Xen version (major, minor) or later */
92e3229d Liu, Jinsong 2012-11-08  67  static inline bool
92e3229d Liu, Jinsong 2012-11-08  68  xen_running_on_version_or_later(unsigned int major, unsigned int minor)
92e3229d Liu, Jinsong 2012-11-08  69  {
92e3229d Liu, Jinsong 2012-11-08  70  	unsigned int version;
92e3229d Liu, Jinsong 2012-11-08  71  
92e3229d Liu, Jinsong 2012-11-08 @72  	if (!xen_domain())
92e3229d Liu, Jinsong 2012-11-08  73  		return false;
92e3229d Liu, Jinsong 2012-11-08  74  
92e3229d Liu, Jinsong 2012-11-08  75  	version = HYPERVISOR_xen_version(XENVER_version, NULL);

---
0-DAY kernel build testing backend         Open Source Technology Center
Fengguang Wu, Yuanhan Liu                              Intel Corporation

--=_50b68452.A6KZaSQDGJ7X3bTwVTt7Bk6j0xJkxL9Q6i7ArV1x5gdxZGwi
Content-Type: text/plain;
 charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename=".config"

#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 3.7.0-rc3 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_DEFAULT_IDLE=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_ARCH_HAS_CPU_AUTOPROBE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ZONE_DMA32=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11"
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_HAVE_IRQ_WORK=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_EXTABLE_SORT=y

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
# CONFIG_KERNEL_GZIP is not set
CONFIG_KERNEL_BZIP2=y
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
CONFIG_DEFAULT_HOSTNAME="(none)"
# CONFIG_SWAP is not set
# CONFIG_SYSVIPC is not set
# CONFIG_POSIX_MQUEUE is not set
# CONFIG_FHANDLE is not set
CONFIG_AUDIT=y
CONFIG_AUDITSYSCALL=y
CONFIG_AUDIT_WATCH=y
CONFIG_AUDIT_TREE=y
CONFIG_AUDIT_LOGINUID_IMMUTABLE=y
CONFIG_HAVE_GENERIC_HARDIRQS=y

#
# IRQ subsystem
#
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_IRQ_DOMAIN=y
# CONFIG_IRQ_DOMAIN_DEBUG is not set
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_ARCH_CLOCKSOURCE_DATA=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_GENERIC_CMOS_UPDATE=y

#
# Timers subsystem
#
# CONFIG_NO_HZ is not set
# CONFIG_HIGH_RES_TIMERS is not set

#
# CPU/Task time and stats accounting
#
# CONFIG_TICK_CPU_ACCOUNTING is not set
CONFIG_IRQ_TIME_ACCOUNTING=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_TASKSTATS=y
# CONFIG_TASK_DELAY_ACCT is not set
# CONFIG_TASK_XACCT is not set

#
# RCU Subsystem
#
CONFIG_TINY_RCU=y
# CONFIG_PREEMPT_RCU is not set
# CONFIG_TREE_RCU_TRACE is not set
CONFIG_IKCONFIG=y
# CONFIG_IKCONFIG_PROC is not set
CONFIG_LOG_BUF_SHIFT=17
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
CONFIG_CGROUPS=y
CONFIG_CGROUP_DEBUG=y
# CONFIG_CGROUP_FREEZER is not set
CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
# CONFIG_CGROUP_CPUACCT is not set
CONFIG_RESOURCE_COUNTERS=y
CONFIG_MEMCG=y
# CONFIG_MEMCG_KMEM is not set
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
# CONFIG_CFS_BANDWIDTH is not set
# CONFIG_RT_GROUP_SCHED is not set
# CONFIG_BLK_CGROUP is not set
# CONFIG_CHECKPOINT_RESTORE is not set
CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_SCHED_AUTOGROUP=y
CONFIG_MM_OWNER=y
# CONFIG_SYSFS_DEPRECATED is not set
# CONFIG_RELAY is not set
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
CONFIG_ANON_INODES=y
# CONFIG_EXPERT is not set
# CONFIG_SYSCTL_SYSCALL is not set
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_PCSPKR_PLATFORM=y
CONFIG_HAVE_PCSPKR_PLATFORM=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
# CONFIG_EMBEDDED is not set
CONFIG_HAVE_PERF_EVENTS=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_PCI_QUIRKS=y
CONFIG_SLUB_DEBUG=y
# CONFIG_COMPAT_BRK is not set
# CONFIG_SLAB is not set
CONFIG_SLUB=y
CONFIG_PROFILING=y
# CONFIG_OPROFILE is not set
CONFIG_HAVE_OPROFILE=y
CONFIG_OPROFILE_NMI_TIMER=y
CONFIG_KPROBES=y
CONFIG_JUMP_LABEL=y
CONFIG_OPTPROBES=y
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_KRETPROBES=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_OPTPROBES=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
CONFIG_HAVE_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_PERF_EVENTS_NMI=y
CONFIG_HAVE_PERF_REGS=y
CONFIG_HAVE_PERF_USER_STACK_DUMP=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
CONFIG_HAVE_CMPXCHG_LOCAL=y
CONFIG_HAVE_CMPXCHG_DOUBLE=y
CONFIG_GENERIC_KERNEL_THREAD=y
CONFIG_GENERIC_KERNEL_EXECVE=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_HAVE_RCU_USER_QS=y
CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_MODULES_USE_ELF_RELA=y

#
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
# CONFIG_MODULE_FORCE_LOAD is not set
# CONFIG_MODULE_UNLOAD is not set
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
CONFIG_MODULE_SIG=y
# CONFIG_MODULE_SIG_FORCE is not set
# CONFIG_MODULE_SIG_SHA1 is not set
CONFIG_MODULE_SIG_SHA224=y
# CONFIG_MODULE_SIG_SHA256 is not set
# CONFIG_MODULE_SIG_SHA384 is not set
# CONFIG_MODULE_SIG_SHA512 is not set
CONFIG_BLOCK=y
CONFIG_BLK_DEV_BSG=y
CONFIG_BLK_DEV_BSGLIB=y
CONFIG_BLK_DEV_INTEGRITY=y

#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
CONFIG_ACORN_PARTITION=y
# CONFIG_ACORN_PARTITION_CUMANA is not set
CONFIG_ACORN_PARTITION_EESOX=y
# CONFIG_ACORN_PARTITION_ICS is not set
CONFIG_ACORN_PARTITION_ADFS=y
# CONFIG_ACORN_PARTITION_POWERTEC is not set
CONFIG_ACORN_PARTITION_RISCIX=y
# CONFIG_OSF_PARTITION is not set
# CONFIG_AMIGA_PARTITION is not set
# CONFIG_ATARI_PARTITION is not set
# CONFIG_MAC_PARTITION is not set
CONFIG_MSDOS_PARTITION=y
# CONFIG_BSD_DISKLABEL is not set
# CONFIG_MINIX_SUBPARTITION is not set
CONFIG_SOLARIS_X86_PARTITION=y
# CONFIG_UNIXWARE_DISKLABEL is not set
# CONFIG_LDM_PARTITION is not set
CONFIG_SGI_PARTITION=y
CONFIG_ULTRIX_PARTITION=y
CONFIG_SUN_PARTITION=y
# CONFIG_KARMA_PARTITION is not set
# CONFIG_EFI_PARTITION is not set
# CONFIG_SYSV68_PARTITION is not set

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_DEADLINE=m
CONFIG_IOSCHED_CFQ=m
CONFIG_DEFAULT_NOOP=y
CONFIG_DEFAULT_IOSCHED="noop"
CONFIG_ASN1=y
CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
CONFIG_INLINE_READ_UNLOCK=y
CONFIG_INLINE_READ_UNLOCK_IRQ=y
CONFIG_INLINE_WRITE_UNLOCK=y
CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
CONFIG_FREEZER=y

#
# Processor type and features
#
CONFIG_ZONE_DMA=y
# CONFIG_SMP is not set
CONFIG_X86_MPPARSE=y
CONFIG_X86_EXTENDED_PLATFORM=y
CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
# CONFIG_SCHED_OMIT_FRAME_POINTER is not set
CONFIG_PARAVIRT_GUEST=y
CONFIG_PARAVIRT_TIME_ACCOUNTING=y
CONFIG_XEN=y
CONFIG_XEN_DOM0=y
CONFIG_XEN_PRIVILEGED_GUEST=y
CONFIG_XEN_PVHVM=y
CONFIG_XEN_MAX_DOMAIN_MEMORY=500
CONFIG_XEN_SAVE_RESTORE=y
CONFIG_XEN_DEBUG_FS=y
CONFIG_KVM_GUEST=y
CONFIG_PARAVIRT=y
CONFIG_PARAVIRT_CLOCK=y
# CONFIG_PARAVIRT_DEBUG is not set
CONFIG_NO_BOOTMEM=y
CONFIG_MEMTEST=y
# CONFIG_MK8 is not set
# CONFIG_MPSC is not set
# CONFIG_MCORE2 is not set
# CONFIG_MATOM is not set
CONFIG_GENERIC_CPU=y
CONFIG_X86_INTERNODE_CACHE_SHIFT=6
CONFIG_X86_CMPXCHG=y
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_XADD=y
CONFIG_X86_WP_WORKS_OK=y
CONFIG_X86_TSC=y
CONFIG_X86_CMPXCHG64=y
CONFIG_X86_CMOV=y
CONFIG_X86_MINIMUM_CPU_FAMILY=64
CONFIG_X86_DEBUGCTLMSR=y
CONFIG_CPU_SUP_INTEL=y
CONFIG_CPU_SUP_AMD=y
CONFIG_CPU_SUP_CENTAUR=y
CONFIG_HPET_TIMER=y
CONFIG_HPET_EMULATE_RTC=y
CONFIG_DMI=y
CONFIG_GART_IOMMU=y
CONFIG_CALGARY_IOMMU=y
# CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT is not set
CONFIG_SWIOTLB=y
CONFIG_IOMMU_HELPER=y
CONFIG_NR_CPUS=1
CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT is not set
CONFIG_PREEMPT_COUNT=y
CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
CONFIG_X86_MCE=y
CONFIG_X86_MCE_INTEL=y
CONFIG_X86_MCE_AMD=y
CONFIG_X86_MCE_THRESHOLD=y
# CONFIG_X86_MCE_INJECT is not set
CONFIG_X86_THERMAL_VECTOR=y
# CONFIG_I8K is not set
CONFIG_MICROCODE=m
# CONFIG_MICROCODE_INTEL is not set
# CONFIG_MICROCODE_AMD is not set
CONFIG_MICROCODE_OLD_INTERFACE=y
CONFIG_X86_MSR=m
# CONFIG_X86_CPUID is not set
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_DIRECT_GBPAGES=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ARCH_PROC_KCORE_TEXT=y
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_SPARSEMEM_MANUAL=y
CONFIG_SPARSEMEM=y
CONFIG_HAVE_MEMORY_PRESENT=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=y
CONFIG_SPARSEMEM_VMEMMAP=y
CONFIG_HAVE_MEMBLOCK=y
CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
CONFIG_ARCH_DISCARD_MEMBLOCK=y
CONFIG_MEMORY_ISOLATION=y
# CONFIG_MEMORY_HOTPLUG is not set
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=4
# CONFIG_COMPACTION is not set
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
CONFIG_VIRT_TO_BUS=y
CONFIG_MMU_NOTIFIER=y
CONFIG_KSM=y
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
CONFIG_MEMORY_FAILURE=y
# CONFIG_HWPOISON_INJECT is not set
# CONFIG_TRANSPARENT_HUGEPAGE is not set
# CONFIG_CROSS_MEMORY_ATTACH is not set
CONFIG_NEED_PER_CPU_KM=y
CONFIG_CLEANCACHE=y
# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
CONFIG_X86_RESERVE_LOW=64
CONFIG_MTRR=y
CONFIG_MTRR_SANITIZER=y
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
CONFIG_X86_PAT=y
CONFIG_ARCH_USES_PG_UNCACHED=y
CONFIG_ARCH_RANDOM=y
CONFIG_X86_SMAP=y
# CONFIG_EFI is not set
# CONFIG_SECCOMP is not set
CONFIG_CC_STACKPROTECTOR=y
# CONFIG_HZ_100 is not set
CONFIG_HZ_250=y
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=250
# CONFIG_SCHED_HRTICK is not set
CONFIG_KEXEC=y
# CONFIG_CRASH_DUMP is not set
CONFIG_PHYSICAL_START=0x1000000
# CONFIG_RELOCATABLE is not set
CONFIG_PHYSICAL_ALIGN=0x1000000
# CONFIG_CMDLINE_BOOL is not set
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y

#
# Power management and ACPI options
#
# CONFIG_SUSPEND is not set
CONFIG_HIBERNATE_CALLBACKS=y
CONFIG_PM_SLEEP=y
# CONFIG_PM_AUTOSLEEP is not set
CONFIG_PM_WAKELOCKS=y
CONFIG_PM_WAKELOCKS_LIMIT=100
CONFIG_PM_WAKELOCKS_GC=y
# CONFIG_PM_RUNTIME is not set
CONFIG_PM=y
# CONFIG_PM_DEBUG is not set
CONFIG_ACPI=y
# CONFIG_ACPI_PROCFS is not set
# CONFIG_ACPI_PROCFS_POWER is not set
# CONFIG_ACPI_EC_DEBUGFS is not set
CONFIG_ACPI_PROC_EVENT=y
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=y
CONFIG_ACPI_VIDEO=m
CONFIG_ACPI_FAN=y
# CONFIG_ACPI_DOCK is not set
CONFIG_ACPI_PROCESSOR=y
# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set
CONFIG_ACPI_THERMAL=y
# CONFIG_ACPI_CUSTOM_DSDT is not set
CONFIG_ACPI_BLACKLIST_YEAR=0
# CONFIG_ACPI_DEBUG is not set
# CONFIG_ACPI_PCI_SLOT is not set
CONFIG_X86_PM_TIMER=y
# CONFIG_ACPI_CONTAINER is not set
# CONFIG_ACPI_SBS is not set
# CONFIG_ACPI_HED is not set
# CONFIG_ACPI_CUSTOM_METHOD is not set
# CONFIG_ACPI_APEI is not set
CONFIG_SFI=y

#
# CPU Frequency scaling
#
# CONFIG_CPU_FREQ is not set
CONFIG_CPU_IDLE=y
CONFIG_CPU_IDLE_GOV_LADDER=y
# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
CONFIG_INTEL_IDLE=y

#
# Memory power savings
#
# CONFIG_I7300_IDLE is not set

#
# Bus options (PCI etc.)
#
CONFIG_PCI=y
CONFIG_PCI_DIRECT=y
# CONFIG_PCI_MMCONFIG is not set
CONFIG_PCI_XEN=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI_PCIE=m
CONFIG_PCIEAER=y
CONFIG_PCIE_ECRC=y
CONFIG_PCIEAER_INJECT=m
CONFIG_PCIEASPM=y
CONFIG_PCIEASPM_DEBUG=y
# CONFIG_PCIEASPM_DEFAULT is not set
CONFIG_PCIEASPM_POWERSAVE=y
# CONFIG_PCIEASPM_PERFORMANCE is not set
CONFIG_ARCH_SUPPORTS_MSI=y
# CONFIG_PCI_MSI is not set
# CONFIG_PCI_DEBUG is not set
CONFIG_PCI_REALLOC_ENABLE_AUTO=y
# CONFIG_PCI_STUB is not set
CONFIG_XEN_PCIDEV_FRONTEND=m
# CONFIG_HT_IRQ is not set
CONFIG_PCI_ATS=y
# CONFIG_PCI_IOV is not set
CONFIG_PCI_PRI=y
CONFIG_PCI_PASID=y
# CONFIG_PCI_IOAPIC is not set
CONFIG_PCI_LABEL=y
CONFIG_ISA_DMA_API=y
CONFIG_AMD_NB=y
CONFIG_PCCARD=m
CONFIG_PCMCIA=m
CONFIG_PCMCIA_LOAD_CIS=y
# CONFIG_CARDBUS is not set

#
# PC-card bridges
#
# CONFIG_YENTA is not set
# CONFIG_PD6729 is not set
CONFIG_I82092=m
CONFIG_PCCARD_NONSTATIC=y
CONFIG_HOTPLUG_PCI=m
# CONFIG_HOTPLUG_PCI_ACPI is not set
CONFIG_HOTPLUG_PCI_CPCI=y
# CONFIG_HOTPLUG_PCI_CPCI_ZT5550 is not set
CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m
# CONFIG_HOTPLUG_PCI_SHPC is not set
# CONFIG_RAPIDIO is not set

#
# Executable file formats / Emulations
#
CONFIG_BINFMT_ELF=y
CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
# CONFIG_HAVE_AOUT is not set
CONFIG_BINFMT_MISC=m
CONFIG_COREDUMP=y
# CONFIG_IA32_EMULATION is not set
CONFIG_HAVE_TEXT_POKE_SMP=y
CONFIG_X86_DEV_DMA_OPS=y
CONFIG_NET=y

#
# Networking options
#
# CONFIG_PACKET is not set
CONFIG_UNIX=y
# CONFIG_UNIX_DIAG is not set
CONFIG_XFRM=y
CONFIG_XFRM_ALGO=m
# CONFIG_XFRM_SUB_POLICY is not set
CONFIG_XFRM_MIGRATE=y
CONFIG_NET_KEY=m
CONFIG_NET_KEY_MIGRATE=y
# CONFIG_INET is not set
CONFIG_NETWORK_SECMARK=y
CONFIG_NETWORK_PHY_TIMESTAMPING=y
# CONFIG_NETFILTER is not set
# CONFIG_ATM is not set
CONFIG_STP=m
CONFIG_GARP=m
# CONFIG_BRIDGE is not set
CONFIG_VLAN_8021Q=m
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_DECNET=m
CONFIG_DECNET_ROUTER=y
CONFIG_LLC=m
CONFIG_LLC2=m
# CONFIG_IPX is not set
CONFIG_ATALK=m
# CONFIG_DEV_APPLETALK is not set
CONFIG_X25=m
CONFIG_LAPB=m
CONFIG_WAN_ROUTER=m
CONFIG_PHONET=m
# CONFIG_IEEE802154 is not set
# CONFIG_NET_SCHED is not set
CONFIG_DCB=y
CONFIG_DNS_RESOLVER=m
# CONFIG_BATMAN_ADV is not set
# CONFIG_OPENVSWITCH is not set
# CONFIG_NETPRIO_CGROUP is not set
CONFIG_BQL=y
# CONFIG_BPF_JIT is not set

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_HAMRADIO is not set
# CONFIG_CAN is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
CONFIG_FIB_RULES=y
CONFIG_WIRELESS=y
# CONFIG_CFG80211 is not set
# CONFIG_LIB80211 is not set

#
# CFG80211 needs to be enabled for MAC80211
#
CONFIG_WIMAX=m
CONFIG_WIMAX_DEBUG_LEVEL=8
# CONFIG_RFKILL is not set
# CONFIG_NET_9P is not set
# CONFIG_CAIF is not set
# CONFIG_NFC is not set
CONFIG_HAVE_BPF_JIT=y

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH=""
CONFIG_DEVTMPFS=y
# CONFIG_DEVTMPFS_MOUNT is not set
CONFIG_STANDALONE=y
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
CONFIG_FW_LOADER=y
# CONFIG_FIRMWARE_IN_KERNEL is not set
CONFIG_EXTRA_FIRMWARE=""
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_SYS_HYPERVISOR is not set
# CONFIG_GENERIC_CPU_DEVICES is not set
CONFIG_REGMAP=y
CONFIG_REGMAP_I2C=m
CONFIG_REGMAP_SPI=y
CONFIG_REGMAP_IRQ=y
# CONFIG_DMA_SHARED_BUFFER is not set

#
# Bus devices
#
# CONFIG_OMAP_OCP2SCP is not set
# CONFIG_CONNECTOR is not set
# CONFIG_MTD is not set
CONFIG_PARPORT=m
# CONFIG_PARPORT_PC is not set
# CONFIG_PARPORT_GSC is not set
# CONFIG_PARPORT_AX88796 is not set
CONFIG_PARPORT_1284=y
CONFIG_PNP=y
CONFIG_PNP_DEBUG_MESSAGES=y

#
# Protocols
#
CONFIG_PNPACPI=y
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
# CONFIG_BLK_DEV_LOOP is not set

#
# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
#
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_NVME is not set
# CONFIG_BLK_DEV_SX8 is not set
# CONFIG_BLK_DEV_RAM is not set
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
CONFIG_XEN_BLKDEV_FRONTEND=y
# CONFIG_XEN_BLKDEV_BACKEND is not set
# CONFIG_VIRTIO_BLK is not set
# CONFIG_BLK_DEV_HD is not set

#
# Misc devices
#
# CONFIG_SENSORS_LIS3LV02D is not set
# CONFIG_AD525X_DPOT is not set
CONFIG_IBM_ASM=m
CONFIG_PHANTOM=m
# CONFIG_INTEL_MID_PTI is not set
CONFIG_SGI_IOC4=m
CONFIG_TIFM_CORE=m
CONFIG_TIFM_7XX1=m
CONFIG_ICS932S401=m
CONFIG_ENCLOSURE_SERVICES=m
CONFIG_HP_ILO=m
# CONFIG_APDS9802ALS is not set
# CONFIG_ISL29003 is not set
# CONFIG_ISL29020 is not set
CONFIG_SENSORS_TSL2550=m
CONFIG_SENSORS_BH1780=m
# CONFIG_SENSORS_BH1770 is not set
CONFIG_SENSORS_APDS990X=m
CONFIG_HMC6352=m
CONFIG_DS1682=m
# CONFIG_TI_DAC7512 is not set
# CONFIG_VMWARE_BALLOON is not set
CONFIG_BMP085=y
# CONFIG_BMP085_I2C is not set
CONFIG_BMP085_SPI=m
CONFIG_PCH_PHUB=m
CONFIG_USB_SWITCH_FSA9480=m
# CONFIG_C2PORT is not set

#
# EEPROM support
#
CONFIG_EEPROM_AT24=m
# CONFIG_EEPROM_AT25 is not set
CONFIG_EEPROM_LEGACY=m
CONFIG_EEPROM_MAX6875=m
# CONFIG_EEPROM_93CX6 is not set
# CONFIG_EEPROM_93XX46 is not set
CONFIG_CB710_CORE=m
CONFIG_CB710_DEBUG=y
CONFIG_CB710_DEBUG_ASSUMPTIONS=y

#
# Texas Instruments shared transport line discipline
#
# CONFIG_SENSORS_LIS3_I2C is not set

#
# Altera FPGA firmware download module
#
CONFIG_ALTERA_STAPL=m
CONFIG_HAVE_IDE=y
# CONFIG_IDE is not set

#
# SCSI device support
#
CONFIG_SCSI_MOD=m
CONFIG_RAID_ATTRS=m
CONFIG_SCSI=m
CONFIG_SCSI_DMA=y
# CONFIG_SCSI_TGT is not set
CONFIG_SCSI_NETLINK=y
CONFIG_SCSI_PROC_FS=y

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=m
# CONFIG_CHR_DEV_ST is not set
# CONFIG_CHR_DEV_OSST is not set
# CONFIG_BLK_DEV_SR is not set
# CONFIG_CHR_DEV_SG is not set
CONFIG_CHR_DEV_SCH=m
CONFIG_SCSI_ENCLOSURE=m
CONFIG_SCSI_MULTI_LUN=y
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y
# CONFIG_SCSI_SCAN_ASYNC is not set

#
# SCSI Transports
#
CONFIG_SCSI_SPI_ATTRS=m
CONFIG_SCSI_FC_ATTRS=m
CONFIG_SCSI_ISCSI_ATTRS=m
CONFIG_SCSI_SAS_ATTRS=m
CONFIG_SCSI_SAS_LIBSAS=m
CONFIG_SCSI_SAS_HOST_SMP=y
# CONFIG_SCSI_SRP_ATTRS is not set
CONFIG_SCSI_LOWLEVEL=y
CONFIG_ISCSI_BOOT_SYSFS=m
# CONFIG_SCSI_BNX2_ISCSI is not set
# CONFIG_SCSI_BNX2X_FCOE is not set
# CONFIG_BE2ISCSI is not set
CONFIG_BLK_DEV_3W_XXXX_RAID=m
# CONFIG_SCSI_HPSA is not set
CONFIG_SCSI_3W_9XXX=m
CONFIG_SCSI_3W_SAS=m
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AACRAID is not set
CONFIG_SCSI_AIC7XXX=m
CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
CONFIG_AIC7XXX_RESET_DELAY_MS=5000
# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
CONFIG_AIC7XXX_DEBUG_ENABLE=y
CONFIG_AIC7XXX_DEBUG_MASK=0
# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
CONFIG_SCSI_AIC7XXX_OLD=m
# CONFIG_SCSI_AIC79XX is not set
CONFIG_SCSI_AIC94XX=m
CONFIG_AIC94XX_DEBUG=y
CONFIG_SCSI_MVSAS=m
CONFIG_SCSI_MVSAS_DEBUG=y
# CONFIG_SCSI_MVSAS_TASKLET is not set
CONFIG_SCSI_MVUMI=m
CONFIG_SCSI_DPT_I2O=m
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_ARCMSR is not set
# CONFIG_MEGARAID_NEWGEN is not set
# CONFIG_MEGARAID_LEGACY is not set
# CONFIG_MEGARAID_SAS is not set
# CONFIG_SCSI_MPT2SAS is not set
# CONFIG_SCSI_UFSHCD is not set
CONFIG_SCSI_HPTIOP=m
# CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_VMWARE_PVSCSI is not set
CONFIG_LIBFC=m
CONFIG_LIBFCOE=m
CONFIG_FCOE=m
CONFIG_FCOE_FNIC=m
CONFIG_SCSI_DMX3191D=m
# CONFIG_SCSI_EATA is not set
CONFIG_SCSI_FUTURE_DOMAIN=m
CONFIG_SCSI_GDTH=m
# CONFIG_SCSI_ISCI is not set
CONFIG_SCSI_IPS=m
# CONFIG_SCSI_INITIO is not set
CONFIG_SCSI_INIA100=m
CONFIG_SCSI_STEX=m
CONFIG_SCSI_SYM53C8XX_2=m
CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
# CONFIG_SCSI_SYM53C8XX_MMIO is not set
CONFIG_SCSI_QLOGIC_1280=m
# CONFIG_SCSI_QLA_FC is not set
CONFIG_SCSI_QLA_ISCSI=m
# CONFIG_SCSI_LPFC is not set
# CONFIG_SCSI_DC395x is not set
CONFIG_SCSI_DC390T=m
# CONFIG_SCSI_DEBUG is not set
CONFIG_SCSI_PMCRAID=m
CONFIG_SCSI_PM8001=m
# CONFIG_SCSI_SRP is not set
CONFIG_SCSI_BFA_FC=m
# CONFIG_SCSI_VIRTIO is not set
CONFIG_SCSI_LOWLEVEL_PCMCIA=y
# CONFIG_PCMCIA_AHA152X is not set
# CONFIG_PCMCIA_FDOMAIN is not set
CONFIG_PCMCIA_QLOGIC=m
# CONFIG_PCMCIA_SYM53C500 is not set
# CONFIG_SCSI_DH is not set
CONFIG_SCSI_OSD_INITIATOR=m
# CONFIG_SCSI_OSD_ULD is not set
CONFIG_SCSI_OSD_DPRINT_SENSE=1
CONFIG_SCSI_OSD_DEBUG=y
# CONFIG_ATA is not set
# CONFIG_MD is not set
CONFIG_TARGET_CORE=m
CONFIG_TCM_IBLOCK=m
# CONFIG_TCM_FILEIO is not set
CONFIG_TCM_PSCSI=m
# CONFIG_LOOPBACK_TARGET is not set
# CONFIG_TCM_FC is not set
# CONFIG_ISCSI_TARGET is not set
# CONFIG_SBP_TARGET is not set
# CONFIG_FUSION is not set

#
# IEEE 1394 (FireWire) support
#
CONFIG_FIREWIRE=m
# CONFIG_FIREWIRE_OHCI is not set
CONFIG_FIREWIRE_SBP2=m
# CONFIG_FIREWIRE_NOSY is not set
CONFIG_I2O=m
# CONFIG_I2O_LCT_NOTIFY_ON_CHANGES is not set
CONFIG_I2O_EXT_ADAPTEC=y
CONFIG_I2O_EXT_ADAPTEC_DMA64=y
# CONFIG_I2O_CONFIG is not set
# CONFIG_I2O_BUS is not set
CONFIG_I2O_BLOCK=m
CONFIG_I2O_SCSI=m
# CONFIG_I2O_PROC is not set
# CONFIG_MACINTOSH_DRIVERS is not set
# CONFIG_NETDEVICES is not set
# CONFIG_ISDN is not set

#
# Input device support
#
CONFIG_INPUT=y
CONFIG_INPUT_FF_MEMLESS=m
# CONFIG_INPUT_POLLDEV is not set
CONFIG_INPUT_SPARSEKMAP=m
# CONFIG_INPUT_MATRIXKMAP is not set

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
CONFIG_INPUT_JOYDEV=m
CONFIG_INPUT_EVDEV=m
CONFIG_INPUT_EVBUG=m

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
CONFIG_KEYBOARD_ADP5588=m
# CONFIG_KEYBOARD_ADP5589 is not set
CONFIG_KEYBOARD_ATKBD=y
CONFIG_KEYBOARD_QT1070=m
# CONFIG_KEYBOARD_QT2160 is not set
CONFIG_KEYBOARD_LKKBD=m
# CONFIG_KEYBOARD_TCA6416 is not set
# CONFIG_KEYBOARD_TCA8418 is not set
# CONFIG_KEYBOARD_LM8323 is not set
# CONFIG_KEYBOARD_LM8333 is not set
CONFIG_KEYBOARD_MAX7359=m
# CONFIG_KEYBOARD_MCS is not set
CONFIG_KEYBOARD_MPR121=m
CONFIG_KEYBOARD_NEWTON=m
CONFIG_KEYBOARD_OPENCORES=m
# CONFIG_KEYBOARD_STOWAWAY is not set
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_OMAP4 is not set
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TABLET is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_INPUT_MISC is not set

#
# Hardware I/O ports
#
CONFIG_SERIO=y
CONFIG_SERIO_I8042=y
CONFIG_SERIO_SERPORT=m
# CONFIG_SERIO_CT82C710 is not set
CONFIG_SERIO_PARKBD=m
CONFIG_SERIO_PCIPS2=m
CONFIG_SERIO_LIBPS2=y
CONFIG_SERIO_RAW=m
# CONFIG_SERIO_ALTERA_PS2 is not set
# CONFIG_SERIO_PS2MULT is not set
CONFIG_GAMEPORT=m
CONFIG_GAMEPORT_NS558=m
# CONFIG_GAMEPORT_L4 is not set
# CONFIG_GAMEPORT_EMU10K1 is not set
# CONFIG_GAMEPORT_FM801 is not set

#
# Character devices
#
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_VT_CONSOLE_SLEEP=y
CONFIG_HW_CONSOLE=y
# CONFIG_VT_HW_CONSOLE_BINDING is not set
CONFIG_UNIX98_PTYS=y
# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_NONSTANDARD=y
# CONFIG_ROCKETPORT is not set
# CONFIG_CYCLADES is not set
CONFIG_MOXA_INTELLIO=m
CONFIG_MOXA_SMARTIO=m
# CONFIG_SYNCLINK is not set
# CONFIG_SYNCLINKMP is not set
# CONFIG_SYNCLINK_GT is not set
CONFIG_NOZOMI=m
CONFIG_ISI=m
CONFIG_N_HDLC=m
# CONFIG_N_GSM is not set
CONFIG_TRACE_ROUTER=m
CONFIG_TRACE_SINK=m
CONFIG_DEVKMEM=y
# CONFIG_STALDRV is not set

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_PNP=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_SERIAL_8250_PCI=y
CONFIG_SERIAL_8250_CS=m
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
# CONFIG_SERIAL_8250_EXTENDED is not set

#
# Non-8250 serial port support
#
CONFIG_SERIAL_MAX3100=m
# CONFIG_SERIAL_MAX310X is not set
# CONFIG_SERIAL_MFD_HSU is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_JSM is not set
CONFIG_SERIAL_SCCNXP=m
# CONFIG_SERIAL_TIMBERDALE is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_PCH_UART is not set
CONFIG_SERIAL_XILINX_PS_UART=m
CONFIG_PRINTER=m
CONFIG_LP_CONSOLE=y
CONFIG_PPDEV=m
# CONFIG_HVC_XEN is not set
# CONFIG_VIRTIO_CONSOLE is not set
# CONFIG_IPMI_HANDLER is not set
CONFIG_HW_RANDOM=m
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
# CONFIG_HW_RANDOM_INTEL is not set
# CONFIG_HW_RANDOM_AMD is not set
CONFIG_HW_RANDOM_VIA=m
# CONFIG_HW_RANDOM_VIRTIO is not set
CONFIG_HW_RANDOM_TPM=m
CONFIG_NVRAM=m
CONFIG_RTC=m
# CONFIG_GEN_RTC is not set
CONFIG_R3964=m
CONFIG_APPLICOM=m

#
# PCMCIA character devices
#
CONFIG_SYNCLINK_CS=m
# CONFIG_CARDMAN_4000 is not set
CONFIG_CARDMAN_4040=m
# CONFIG_MWAVE is not set
CONFIG_RAW_DRIVER=m
CONFIG_MAX_RAW_DEVS=256
# CONFIG_HPET is not set
CONFIG_HANGCHECK_TIMER=m
CONFIG_TCG_TPM=y
CONFIG_TCG_TIS=y
CONFIG_TCG_TIS_I2C_INFINEON=m
# CONFIG_TCG_NSC is not set
# CONFIG_TCG_ATMEL is not set
# CONFIG_TCG_INFINEON is not set
CONFIG_TELCLOCK=m
CONFIG_DEVPORT=y
CONFIG_I2C=m
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
# CONFIG_I2C_CHARDEV is not set
CONFIG_I2C_MUX=m

#
# Multiplexer I2C Chip support
#
CONFIG_I2C_MUX_PCA9541=m
# CONFIG_I2C_MUX_PCA954x is not set
# CONFIG_I2C_HELPER_AUTO is not set
CONFIG_I2C_SMBUS=m

#
# I2C Algorithms
#
CONFIG_I2C_ALGOBIT=m
# CONFIG_I2C_ALGOPCF is not set
CONFIG_I2C_ALGOPCA=m

#
# I2C Hardware Bus support
#

#
# PC SMBus host controller drivers
#
# CONFIG_I2C_ALI1535 is not set
CONFIG_I2C_ALI1563=m
# CONFIG_I2C_ALI15X3 is not set
# CONFIG_I2C_AMD756 is not set
# CONFIG_I2C_AMD8111 is not set
# CONFIG_I2C_I801 is not set
# CONFIG_I2C_ISCH is not set
CONFIG_I2C_PIIX4=m
# CONFIG_I2C_NFORCE2 is not set
CONFIG_I2C_SIS5595=m
# CONFIG_I2C_SIS630 is not set
# CONFIG_I2C_SIS96X is not set
CONFIG_I2C_VIA=m
CONFIG_I2C_VIAPRO=m

#
# ACPI drivers
#
# CONFIG_I2C_SCMI is not set

#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
CONFIG_I2C_DESIGNWARE_CORE=m
CONFIG_I2C_DESIGNWARE_PCI=m
CONFIG_I2C_EG20T=m
# CONFIG_I2C_INTEL_MID is not set
CONFIG_I2C_OCORES=m
# CONFIG_I2C_PCA_PLATFORM is not set
# CONFIG_I2C_PXA_PCI is not set
# CONFIG_I2C_SIMTEC is not set
CONFIG_I2C_XILINX=m

#
# External I2C/SMBus adapter drivers
#
# CONFIG_I2C_PARPORT is not set
# CONFIG_I2C_PARPORT_LIGHT is not set
CONFIG_I2C_TAOS_EVM=m

#
# Other I2C/SMBus bus drivers
#
# CONFIG_I2C_STUB is not set
CONFIG_I2C_DEBUG_CORE=y
CONFIG_I2C_DEBUG_ALGO=y
# CONFIG_I2C_DEBUG_BUS is not set
CONFIG_SPI=y
# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y

#
# SPI Master Controller Drivers
#
CONFIG_SPI_ALTERA=m
CONFIG_SPI_BITBANG=m
# CONFIG_SPI_BUTTERFLY is not set
CONFIG_SPI_LM70_LLP=m
# CONFIG_SPI_PXA2XX_PCI is not set
CONFIG_SPI_SC18IS602=m
# CONFIG_SPI_TOPCLIFF_PCH is not set
CONFIG_SPI_XCOMM=m
# CONFIG_SPI_XILINX is not set
# CONFIG_SPI_DESIGNWARE is not set

#
# SPI Protocol Masters
#
CONFIG_SPI_SPIDEV=m
# CONFIG_SPI_TLE62X0 is not set
# CONFIG_HSI is not set

#
# PPS support
#
CONFIG_PPS=m
CONFIG_PPS_DEBUG=y
CONFIG_NTP_PPS=y

#
# PPS clients support
#
# CONFIG_PPS_CLIENT_KTIMER is not set
# CONFIG_PPS_CLIENT_LDISC is not set
CONFIG_PPS_CLIENT_PARPORT=m
# CONFIG_PPS_CLIENT_GPIO is not set

#
# PPS generators support
#

#
# PTP clock support
#
CONFIG_PTP_1588_CLOCK=m

#
# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
#
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
# CONFIG_GPIOLIB is not set
CONFIG_W1=m

#
# 1-wire Bus Masters
#
# CONFIG_W1_MASTER_MATROX is not set
# CONFIG_W1_MASTER_DS2482 is not set
# CONFIG_W1_MASTER_DS1WM is not set
CONFIG_HDQ_MASTER_OMAP=m

#
# 1-wire Slaves
#
# CONFIG_W1_SLAVE_THERM is not set
# CONFIG_W1_SLAVE_SMEM is not set
CONFIG_W1_SLAVE_DS2408=m
CONFIG_W1_SLAVE_DS2423=m
# CONFIG_W1_SLAVE_DS2431 is not set
CONFIG_W1_SLAVE_DS2433=m
# CONFIG_W1_SLAVE_DS2433_CRC is not set
# CONFIG_W1_SLAVE_DS2760 is not set
CONFIG_W1_SLAVE_DS2780=m
CONFIG_W1_SLAVE_DS2781=m
CONFIG_W1_SLAVE_DS28E04=m
# CONFIG_W1_SLAVE_BQ27000 is not set
CONFIG_POWER_SUPPLY=y
# CONFIG_POWER_SUPPLY_DEBUG is not set
CONFIG_PDA_POWER=m
# CONFIG_GENERIC_ADC_BATTERY is not set
# CONFIG_WM831X_BACKUP is not set
# CONFIG_WM831X_POWER is not set
# CONFIG_TEST_POWER is not set
CONFIG_BATTERY_DS2780=m
# CONFIG_BATTERY_DS2781 is not set
CONFIG_BATTERY_DS2782=m
CONFIG_BATTERY_SBS=m
CONFIG_BATTERY_BQ27x00=m
CONFIG_BATTERY_BQ27X00_I2C=y
# CONFIG_BATTERY_BQ27X00_PLATFORM is not set
# CONFIG_BATTERY_MAX17040 is not set
# CONFIG_BATTERY_MAX17042 is not set
CONFIG_CHARGER_MAX8903=m
# CONFIG_CHARGER_LP8727 is not set
CONFIG_CHARGER_SMB347=m
# CONFIG_POWER_AVS is not set
CONFIG_HWMON=m
CONFIG_HWMON_VID=m
# CONFIG_HWMON_DEBUG_CHIP is not set

#
# Native drivers
#
CONFIG_SENSORS_ABITUGURU=m
CONFIG_SENSORS_ABITUGURU3=m
# CONFIG_SENSORS_AD7314 is not set
# CONFIG_SENSORS_AD7414 is not set
CONFIG_SENSORS_AD7418=m
CONFIG_SENSORS_ADCXX=m
CONFIG_SENSORS_ADM1021=m
# CONFIG_SENSORS_ADM1025 is not set
# CONFIG_SENSORS_ADM1026 is not set
CONFIG_SENSORS_ADM1029=m
CONFIG_SENSORS_ADM1031=m
# CONFIG_SENSORS_ADM9240 is not set
# CONFIG_SENSORS_ADT7410 is not set
# CONFIG_SENSORS_ADT7411 is not set
CONFIG_SENSORS_ADT7462=m
# CONFIG_SENSORS_ADT7470 is not set
CONFIG_SENSORS_ADT7475=m
# CONFIG_SENSORS_ASC7621 is not set
# CONFIG_SENSORS_K8TEMP is not set
CONFIG_SENSORS_K10TEMP=m
# CONFIG_SENSORS_FAM15H_POWER is not set
# CONFIG_SENSORS_ASB100 is not set
# CONFIG_SENSORS_ATXP1 is not set
CONFIG_SENSORS_DS620=m
# CONFIG_SENSORS_DS1621 is not set
CONFIG_SENSORS_I5K_AMB=m
CONFIG_SENSORS_F71805F=m
CONFIG_SENSORS_F71882FG=m
CONFIG_SENSORS_F75375S=m
CONFIG_SENSORS_FSCHMD=m
# CONFIG_SENSORS_G760A is not set
CONFIG_SENSORS_GL518SM=m
# CONFIG_SENSORS_GL520SM is not set
CONFIG_SENSORS_HIH6130=m
# CONFIG_SENSORS_CORETEMP is not set
CONFIG_SENSORS_IT87=m
# CONFIG_SENSORS_JC42 is not set
# CONFIG_SENSORS_LINEAGE is not set
# CONFIG_SENSORS_LM63 is not set
CONFIG_SENSORS_LM70=m
# CONFIG_SENSORS_LM73 is not set
# CONFIG_SENSORS_LM75 is not set
# CONFIG_SENSORS_LM77 is not set
CONFIG_SENSORS_LM78=m
# CONFIG_SENSORS_LM80 is not set
# CONFIG_SENSORS_LM83 is not set
CONFIG_SENSORS_LM85=m
CONFIG_SENSORS_LM87=m
CONFIG_SENSORS_LM90=m
# CONFIG_SENSORS_LM92 is not set
# CONFIG_SENSORS_LM93 is not set
CONFIG_SENSORS_LTC4151=m
CONFIG_SENSORS_LTC4215=m
CONFIG_SENSORS_LTC4245=m
CONFIG_SENSORS_LTC4261=m
CONFIG_SENSORS_LM95241=m
# CONFIG_SENSORS_LM95245 is not set
CONFIG_SENSORS_MAX1111=m
CONFIG_SENSORS_MAX16065=m
# CONFIG_SENSORS_MAX1619 is not set
CONFIG_SENSORS_MAX1668=m
CONFIG_SENSORS_MAX197=m
# CONFIG_SENSORS_MAX6639 is not set
# CONFIG_SENSORS_MAX6642 is not set
# CONFIG_SENSORS_MAX6650 is not set
# CONFIG_SENSORS_MCP3021 is not set
CONFIG_SENSORS_NTC_THERMISTOR=m
# CONFIG_SENSORS_PC87360 is not set
# CONFIG_SENSORS_PC87427 is not set
# CONFIG_SENSORS_PCF8591 is not set
CONFIG_PMBUS=m
CONFIG_SENSORS_PMBUS=m
# CONFIG_SENSORS_ADM1275 is not set
# CONFIG_SENSORS_LM25066 is not set
# CONFIG_SENSORS_LTC2978 is not set
CONFIG_SENSORS_MAX16064=m
# CONFIG_SENSORS_MAX34440 is not set
CONFIG_SENSORS_MAX8688=m
CONFIG_SENSORS_UCD9000=m
CONFIG_SENSORS_UCD9200=m
# CONFIG_SENSORS_ZL6100 is not set
# CONFIG_SENSORS_SHT21 is not set
# CONFIG_SENSORS_SIS5595 is not set
CONFIG_SENSORS_SMM665=m
CONFIG_SENSORS_DME1737=m
# CONFIG_SENSORS_EMC1403 is not set
# CONFIG_SENSORS_EMC2103 is not set
# CONFIG_SENSORS_EMC6W201 is not set
CONFIG_SENSORS_SMSC47M1=m
CONFIG_SENSORS_SMSC47M192=m
CONFIG_SENSORS_SMSC47B397=m
# CONFIG_SENSORS_SCH56XX_COMMON is not set
# CONFIG_SENSORS_ADS1015 is not set
# CONFIG_SENSORS_ADS7828 is not set
# CONFIG_SENSORS_ADS7871 is not set
# CONFIG_SENSORS_AMC6821 is not set
CONFIG_SENSORS_INA2XX=m
# CONFIG_SENSORS_THMC50 is not set
# CONFIG_SENSORS_TMP102 is not set
CONFIG_SENSORS_TMP401=m
# CONFIG_SENSORS_TMP421 is not set
# CONFIG_SENSORS_VIA_CPUTEMP is not set
# CONFIG_SENSORS_VIA686A is not set
CONFIG_SENSORS_VT1211=m
CONFIG_SENSORS_VT8231=m
# CONFIG_SENSORS_W83781D is not set
# CONFIG_SENSORS_W83791D is not set
# CONFIG_SENSORS_W83792D is not set
CONFIG_SENSORS_W83793=m
CONFIG_SENSORS_W83795=m
CONFIG_SENSORS_W83795_FANCTRL=y
# CONFIG_SENSORS_W83L785TS is not set
# CONFIG_SENSORS_W83L786NG is not set
# CONFIG_SENSORS_W83627HF is not set
CONFIG_SENSORS_W83627EHF=m
CONFIG_SENSORS_WM831X=m
# CONFIG_SENSORS_APPLESMC is not set

#
# ACPI drivers
#
# CONFIG_SENSORS_ACPI_POWER is not set
# CONFIG_SENSORS_ATK0110 is not set
CONFIG_THERMAL=y
# CONFIG_WATCHDOG is not set
CONFIG_SSB_POSSIBLE=y

#
# Sonics Silicon Backplane
#
# CONFIG_SSB is not set
CONFIG_BCMA_POSSIBLE=y

#
# Broadcom specific AMBA
#
CONFIG_BCMA=m
CONFIG_BCMA_HOST_PCI_POSSIBLE=y
CONFIG_BCMA_HOST_PCI=y
# CONFIG_BCMA_DRIVER_GMAC_CMN is not set
# CONFIG_BCMA_DEBUG is not set

#
# Multifunction device drivers
#
CONFIG_MFD_CORE=y
# CONFIG_MFD_SM501 is not set
CONFIG_HTC_PASIC3=m
CONFIG_MFD_LM3533=m
# CONFIG_TPS6105X is not set
# CONFIG_TPS6507X is not set
CONFIG_MFD_TPS65217=m
# CONFIG_MFD_STMPE is not set
# CONFIG_MFD_TMIO is not set
# CONFIG_MFD_DA9052_SPI is not set
CONFIG_MFD_ARIZONA=y
CONFIG_MFD_ARIZONA_I2C=m
# CONFIG_MFD_ARIZONA_SPI is not set
CONFIG_MFD_WM5102=y
# CONFIG_MFD_WM5110 is not set
CONFIG_MFD_WM831X=y
CONFIG_MFD_WM831X_SPI=y
# CONFIG_MFD_PCF50633 is not set
# CONFIG_MFD_MC13XXX_SPI is not set
# CONFIG_MFD_MC13XXX_I2C is not set
# CONFIG_ABX500_CORE is not set
# CONFIG_EZX_PCAP is not set
# CONFIG_MFD_CS5535 is not set
# CONFIG_LPC_SCH is not set
# CONFIG_LPC_ICH is not set
# CONFIG_MFD_RDC321X is not set
CONFIG_MFD_JANZ_CMODIO=m
CONFIG_MFD_VX855=m
# CONFIG_MFD_WL1273_CORE is not set
# CONFIG_REGULATOR is not set
# CONFIG_MEDIA_SUPPORT is not set

#
# Graphics support
#
# CONFIG_AGP is not set
CONFIG_VGA_ARB=y
CONFIG_VGA_ARB_MAX_GPUS=16
# CONFIG_VGA_SWITCHEROO is not set
# CONFIG_DRM is not set
CONFIG_STUB_POULSBO=m
CONFIG_VGASTATE=m
CONFIG_VIDEO_OUTPUT_CONTROL=m
CONFIG_FB=m
# CONFIG_FIRMWARE_EDID is not set
CONFIG_FB_DDC=m
# CONFIG_FB_BOOT_VESA_SUPPORT is not set
CONFIG_FB_CFB_FILLRECT=m
CONFIG_FB_CFB_COPYAREA=m
CONFIG_FB_CFB_IMAGEBLIT=m
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
CONFIG_FB_SYS_FILLRECT=m
CONFIG_FB_SYS_COPYAREA=m
CONFIG_FB_SYS_IMAGEBLIT=m
# CONFIG_FB_FOREIGN_ENDIAN is not set
CONFIG_FB_SYS_FOPS=m
# CONFIG_FB_WMT_GE_ROPS is not set
CONFIG_FB_DEFERRED_IO=y
CONFIG_FB_SVGALIB=m
# CONFIG_FB_MACMODES is not set
CONFIG_FB_BACKLIGHT=y
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_TILEBLITTING=y

#
# Frame buffer hardware drivers
#
# CONFIG_FB_CIRRUS is not set
# CONFIG_FB_PM2 is not set
# CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_ARC is not set
# CONFIG_FB_VGA16 is not set
# CONFIG_FB_N411 is not set
# CONFIG_FB_HGA is not set
CONFIG_FB_S1D13XXX=m
# CONFIG_FB_NVIDIA is not set
CONFIG_FB_RIVA=m
# CONFIG_FB_RIVA_I2C is not set
CONFIG_FB_RIVA_DEBUG=y
CONFIG_FB_RIVA_BACKLIGHT=y
CONFIG_FB_I740=m
CONFIG_FB_LE80578=m
# CONFIG_FB_CARILLO_RANCH is not set
CONFIG_FB_MATROX=m
# CONFIG_FB_MATROX_MILLENIUM is not set
CONFIG_FB_MATROX_MYSTIQUE=y
# CONFIG_FB_MATROX_G is not set
# CONFIG_FB_MATROX_I2C is not set
CONFIG_FB_RADEON=m
# CONFIG_FB_RADEON_I2C is not set
CONFIG_FB_RADEON_BACKLIGHT=y
CONFIG_FB_RADEON_DEBUG=y
# CONFIG_FB_ATY128 is not set
CONFIG_FB_ATY=m
# CONFIG_FB_ATY_CT is not set
# CONFIG_FB_ATY_GX is not set
CONFIG_FB_ATY_BACKLIGHT=y
CONFIG_FB_S3=m
CONFIG_FB_S3_DDC=y
# CONFIG_FB_SAVAGE is not set
CONFIG_FB_SIS=m
# CONFIG_FB_SIS_300 is not set
CONFIG_FB_SIS_315=y
# CONFIG_FB_VIA is not set
CONFIG_FB_NEOMAGIC=m
CONFIG_FB_KYRO=m
CONFIG_FB_3DFX=m
# CONFIG_FB_3DFX_ACCEL is not set
# CONFIG_FB_3DFX_I2C is not set
CONFIG_FB_VOODOO1=m
# CONFIG_FB_VT8623 is not set
# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_ARK is not set
CONFIG_FB_PM3=m
# CONFIG_FB_CARMINE is not set
CONFIG_FB_GEODE=y
CONFIG_FB_GEODE_LX=m
# CONFIG_FB_GEODE_GX is not set
CONFIG_FB_GEODE_GX1=m
CONFIG_FB_TMIO=m
CONFIG_FB_TMIO_ACCELL=y
# CONFIG_FB_VIRTUAL is not set
# CONFIG_XEN_FBDEV_FRONTEND is not set
CONFIG_FB_METRONOME=m
CONFIG_FB_MB862XX=m
CONFIG_FB_MB862XX_PCI_GDC=y
# CONFIG_FB_MB862XX_I2C is not set
# CONFIG_FB_BROADSHEET is not set
CONFIG_FB_AUO_K190X=m
CONFIG_FB_AUO_K1900=m
CONFIG_FB_AUO_K1901=m
# CONFIG_EXYNOS_VIDEO is not set
CONFIG_BACKLIGHT_LCD_SUPPORT=y
# CONFIG_LCD_CLASS_DEVICE is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=m
CONFIG_BACKLIGHT_GENERIC=m
# CONFIG_BACKLIGHT_LM3533 is not set
CONFIG_BACKLIGHT_PWM=m
# CONFIG_BACKLIGHT_APPLE is not set
CONFIG_BACKLIGHT_SAHARA=m
# CONFIG_BACKLIGHT_WM831X is not set
# CONFIG_BACKLIGHT_ADP8860 is not set
CONFIG_BACKLIGHT_ADP8870=m
# CONFIG_BACKLIGHT_LM3630 is not set
CONFIG_BACKLIGHT_LM3639=m
CONFIG_BACKLIGHT_LP855X=m
# CONFIG_BACKLIGHT_TPS65217 is not set

#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
# CONFIG_VGACON_SOFT_SCROLLBACK is not set
CONFIG_DUMMY_CONSOLE=y
# CONFIG_FRAMEBUFFER_CONSOLE is not set
# CONFIG_LOGO is not set
CONFIG_SOUND=m
CONFIG_SOUND_OSS_CORE=y
# CONFIG_SOUND_OSS_CORE_PRECLAIM is not set
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m
CONFIG_SND_SEQUENCER=m
# CONFIG_SND_SEQ_DUMMY is not set
CONFIG_SND_OSSEMUL=y
# CONFIG_SND_MIXER_OSS is not set
CONFIG_SND_PCM_OSS=m
CONFIG_SND_PCM_OSS_PLUGINS=y
# CONFIG_SND_SEQUENCER_OSS is not set
CONFIG_SND_RTCTIMER=m
CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y
CONFIG_SND_DYNAMIC_MINORS=y
# CONFIG_SND_SUPPORT_OLD_API is not set
CONFIG_SND_VERBOSE_PROCFS=y
CONFIG_SND_VERBOSE_PRINTK=y
# CONFIG_SND_DEBUG is not set
CONFIG_SND_DMA_SGBUF=y
# CONFIG_SND_RAWMIDI_SEQ is not set
# CONFIG_SND_OPL3_LIB_SEQ is not set
# CONFIG_SND_OPL4_LIB_SEQ is not set
# CONFIG_SND_SBAWE_SEQ is not set
# CONFIG_SND_EMU10K1_SEQ is not set
# CONFIG_SND_DRIVERS is not set
# CONFIG_SND_PCI is not set
# CONFIG_SND_SPI is not set
CONFIG_SND_FIREWIRE=y
CONFIG_SND_FIREWIRE_LIB=m
# CONFIG_SND_FIREWIRE_SPEAKERS is not set
CONFIG_SND_ISIGHT=m
# CONFIG_SND_PCMCIA is not set
# CONFIG_SND_SOC is not set
CONFIG_SOUND_PRIME=m
CONFIG_SOUND_OSS=m
CONFIG_SOUND_TRACEINIT=y
CONFIG_SOUND_DMAP=y
# CONFIG_SOUND_VMIDI is not set
CONFIG_SOUND_TRIX=m
# CONFIG_SOUND_MSS is not set
# CONFIG_SOUND_MPU401 is not set
# CONFIG_SOUND_PAS is not set
# CONFIG_SOUND_PSS is not set
CONFIG_SOUND_SB=m
CONFIG_SOUND_YM3812=m
# CONFIG_SOUND_UART6850 is not set
# CONFIG_SOUND_AEDSP16 is not set
CONFIG_SOUND_KAHLUA=m

#
# HID support
#
CONFIG_HID=m
CONFIG_HIDRAW=y
CONFIG_UHID=m
CONFIG_HID_GENERIC=m

#
# Special HID drivers
#
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB_ARCH_HAS_XHCI=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_ARCH_HAS_HCD=y
# CONFIG_USB is not set
# CONFIG_USB_HCD_BCMA is not set

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
#
# CONFIG_USB_EZUSB_FX2 is not set
# CONFIG_OMAP_USB2 is not set
# CONFIG_USB_GADGET is not set

#
# OTG and related infrastructure
#
CONFIG_UWB=m
# CONFIG_UWB_WHCI is not set
CONFIG_MMC=m
# CONFIG_MMC_DEBUG is not set
CONFIG_MMC_UNSAFE_RESUME=y
CONFIG_MMC_CLKGATE=y

#
# MMC/SD/SDIO Card Drivers
#
# CONFIG_MMC_BLOCK is not set
# CONFIG_SDIO_UART is not set
CONFIG_MMC_TEST=m

#
# MMC/SD/SDIO Host Controller Drivers
#
# CONFIG_MMC_SDHCI is not set
# CONFIG_MMC_WBSD is not set
CONFIG_MMC_TIFM_SD=m
CONFIG_MMC_SPI=m
CONFIG_MMC_SDRICOH_CS=m
# CONFIG_MMC_CB710 is not set
# CONFIG_MMC_VIA_SDMMC is not set
CONFIG_MEMSTICK=m
CONFIG_MEMSTICK_DEBUG=y

#
# MemoryStick drivers
#
# CONFIG_MEMSTICK_UNSAFE_RESUME is not set
# CONFIG_MSPRO_BLOCK is not set

#
# MemoryStick Host Controller Drivers
#
CONFIG_MEMSTICK_TIFM_MS=m
CONFIG_MEMSTICK_JMICRON_38X=m
CONFIG_MEMSTICK_R592=m
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=m

#
# LED drivers
#
CONFIG_LEDS_LM3530=m
CONFIG_LEDS_LM3533=m
CONFIG_LEDS_LM3642=m
# CONFIG_LEDS_PCA9532 is not set
# CONFIG_LEDS_LP3944 is not set
CONFIG_LEDS_LP5521=m
# CONFIG_LEDS_LP5523 is not set
CONFIG_LEDS_CLEVO_MAIL=m
# CONFIG_LEDS_PCA955X is not set
# CONFIG_LEDS_PCA9633 is not set
CONFIG_LEDS_WM831X_STATUS=m
# CONFIG_LEDS_DAC124S085 is not set
# CONFIG_LEDS_BD2802 is not set
# CONFIG_LEDS_INTEL_SS4200 is not set
CONFIG_LEDS_TCA6507=m
# CONFIG_LEDS_LM355x is not set
CONFIG_LEDS_OT200=m
CONFIG_LEDS_BLINKM=m
# CONFIG_LEDS_TRIGGERS is not set

#
# LED Triggers
#
CONFIG_ACCESSIBILITY=y
# CONFIG_A11Y_BRAILLE_CONSOLE is not set
CONFIG_INFINIBAND=m
CONFIG_INFINIBAND_USER_MAD=m
CONFIG_INFINIBAND_USER_ACCESS=m
CONFIG_INFINIBAND_USER_MEM=y
# CONFIG_INFINIBAND_MTHCA is not set
# CONFIG_INFINIBAND_QIB is not set
# CONFIG_INFINIBAND_SRP is not set
# CONFIG_INFINIBAND_SRPT is not set
# CONFIG_EDAC is not set
# CONFIG_RTC_CLASS is not set
# CONFIG_DMADEVICES is not set
CONFIG_AUXDISPLAY=y
CONFIG_UIO=m
CONFIG_UIO_CIF=m
# CONFIG_UIO_PDRV is not set
CONFIG_UIO_PDRV_GENIRQ=m
CONFIG_UIO_AEC=m
# CONFIG_UIO_SERCOS3 is not set
# CONFIG_UIO_PCI_GENERIC is not set
# CONFIG_UIO_NETX is not set
CONFIG_VIRTIO=m

#
# Virtio drivers
#
CONFIG_VIRTIO_PCI=m
CONFIG_VIRTIO_BALLOON=m
CONFIG_VIRTIO_MMIO=m
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y

#
# Microsoft Hyper-V guest support
#
# CONFIG_HYPERV is not set

#
# Xen driver support
#
# CONFIG_XEN_BALLOON is not set
CONFIG_XEN_DEV_EVTCHN=m
CONFIG_XEN_BACKEND=y
CONFIG_XENFS=m
# CONFIG_XEN_COMPAT_XENFS is not set
# CONFIG_XEN_SYS_HYPERVISOR is not set
CONFIG_XEN_XENBUS_FRONTEND=y
CONFIG_XEN_GNTDEV=m
CONFIG_XEN_GRANT_DEV_ALLOC=m
CONFIG_SWIOTLB_XEN=y
CONFIG_XEN_TMEM=y
CONFIG_XEN_PCIDEV_BACKEND=m
CONFIG_XEN_PRIVCMD=m
# CONFIG_XEN_MCE_LOG is not set
CONFIG_STAGING=y
# CONFIG_SLICOSS is not set
CONFIG_ECHO=m
# CONFIG_COMEDI is not set
# CONFIG_PANEL is not set
# CONFIG_RTS_PSTOR is not set
CONFIG_DX_SEP=m

#
# IIO staging drivers
#
CONFIG_IIO_ST_HWMON=m
CONFIG_IIO_SW_RING=m

#
# Accelerometers
#
# CONFIG_ADIS16201 is not set
CONFIG_ADIS16203=m
CONFIG_ADIS16204=m
CONFIG_ADIS16209=m
CONFIG_ADIS16220=m
# CONFIG_ADIS16240 is not set
CONFIG_KXSD9=m
CONFIG_SCA3000=m

#
# Analog to digital converters
#
# CONFIG_AD7291 is not set
# CONFIG_AD7298 is not set
# CONFIG_AD799X is not set
# CONFIG_AD7887 is not set
# CONFIG_AD7793 is not set
CONFIG_AD7192=m
CONFIG_ADT7310=m
CONFIG_ADT7410=m
# CONFIG_AD7280 is not set
CONFIG_MAX1363=m
CONFIG_MAX1363_RING_BUFFER=y

#
# Analog digital bi-direction converters
#

#
# Capacitance to digital converters
#
# CONFIG_AD7150 is not set
# CONFIG_AD7152 is not set
# CONFIG_AD7746 is not set

#
# Direct Digital Synthesis
#
CONFIG_AD5930=m
CONFIG_AD9832=m
CONFIG_AD9834=m
# CONFIG_AD9850 is not set
CONFIG_AD9852=m
CONFIG_AD9910=m
# CONFIG_AD9951 is not set

#
# Digital gyroscope sensors
#
CONFIG_ADIS16060=m
CONFIG_ADIS16080=m
CONFIG_ADIS16130=m
# CONFIG_ADIS16260 is not set
# CONFIG_ADXRS450 is not set

#
# Network Analyzer, Impedance Converters
#
# CONFIG_AD5933 is not set

#
# Inertial measurement units
#
# CONFIG_ADIS16400 is not set

#
# Light sensors
#
# CONFIG_SENSORS_ISL29018 is not set
CONFIG_SENSORS_ISL29028=m
# CONFIG_SENSORS_TSL2563 is not set
# CONFIG_TSL2583 is not set
CONFIG_TSL2x7x=m

#
# Magnetometer sensors
#
CONFIG_SENSORS_HMC5843=m

#
# Active energy metering IC
#
# CONFIG_ADE7753 is not set
CONFIG_ADE7754=m
# CONFIG_ADE7758 is not set
CONFIG_ADE7759=m
CONFIG_ADE7854=m
CONFIG_ADE7854_I2C=m
# CONFIG_ADE7854_SPI is not set

#
# Resolver to digital converters
#
CONFIG_AD2S90=m

#
# Triggers - standalone
#
CONFIG_IIO_SYSFS_TRIGGER=m
# CONFIG_IIO_SIMPLE_DUMMY is not set
# CONFIG_ZSMALLOC is not set
# CONFIG_FB_SM7XX is not set
# CONFIG_CRYSTALHD is not set
# CONFIG_FB_XGI is not set
# CONFIG_ACPI_QUICKSTART is not set
# CONFIG_FT1000 is not set

#
# Speakup console speech
#
CONFIG_SPEAKUP=m
CONFIG_SPEAKUP_SYNTH_ACNTSA=m
CONFIG_SPEAKUP_SYNTH_ACNTPC=m
# CONFIG_SPEAKUP_SYNTH_APOLLO is not set
# CONFIG_SPEAKUP_SYNTH_AUDPTR is not set
CONFIG_SPEAKUP_SYNTH_BNS=m
CONFIG_SPEAKUP_SYNTH_DECTLK=m
# CONFIG_SPEAKUP_SYNTH_DECEXT is not set
# CONFIG_SPEAKUP_SYNTH_DECPC is not set
# CONFIG_SPEAKUP_SYNTH_DTLK is not set
# CONFIG_SPEAKUP_SYNTH_KEYPC is not set
# CONFIG_SPEAKUP_SYNTH_LTLK is not set
CONFIG_SPEAKUP_SYNTH_SOFT=m
CONFIG_SPEAKUP_SYNTH_SPKOUT=m
# CONFIG_SPEAKUP_SYNTH_TXPRT is not set
CONFIG_SPEAKUP_SYNTH_DUMMY=m
CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4=m
CONFIG_STAGING_MEDIA=y

#
# Android
#
# CONFIG_ANDROID is not set
# CONFIG_PHONE is not set
CONFIG_IPACK_BUS=m
CONFIG_BOARD_TPCI200=m
CONFIG_SERIAL_IPOCTAL=m
# CONFIG_WIMAX_GDM72XX is not set
# CONFIG_NET_VENDOR_SILICOM is not set
CONFIG_DGRP=m
# CONFIG_X86_PLATFORM_DEVICES is not set

#
# Hardware Spinlock drivers
#
CONFIG_CLKEVT_I8253=y
CONFIG_I8253_LOCK=y
CONFIG_CLKBLD_I8253=y
# CONFIG_IOMMU_SUPPORT is not set

#
# Remoteproc drivers (EXPERIMENTAL)
#
CONFIG_REMOTEPROC=m
CONFIG_STE_MODEM_RPROC=m

#
# Rpmsg drivers (EXPERIMENTAL)
#
CONFIG_VIRT_DRIVERS=y
CONFIG_PM_DEVFREQ=y

#
# DEVFREQ Governors
#
# CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND is not set
# CONFIG_DEVFREQ_GOV_PERFORMANCE is not set
CONFIG_DEVFREQ_GOV_POWERSAVE=y
# CONFIG_DEVFREQ_GOV_USERSPACE is not set

#
# DEVFREQ Drivers
#
# CONFIG_EXTCON is not set
# CONFIG_MEMORY is not set
CONFIG_IIO=m
CONFIG_IIO_BUFFER=y
CONFIG_IIO_KFIFO_BUF=m
CONFIG_IIO_TRIGGERED_BUFFER=m
CONFIG_IIO_TRIGGER=y
CONFIG_IIO_CONSUMERS_PER_TRIGGER=2

#
# Accelerometers
#

#
# Analog to digital converters
#
CONFIG_AD_SIGMA_DELTA=m
# CONFIG_AD7266 is not set
CONFIG_AD7791=m
# CONFIG_AD7476 is not set

#
# Amplifiers
#
# CONFIG_AD8366 is not set

#
# Light sensors
#
CONFIG_ADJD_S311=m
CONFIG_SENSORS_LM3533=m
CONFIG_VCNL4000=m

#
# Frequency Synthesizers DDS/PLL
#

#
# Clock Generator/Distribution
#
# CONFIG_AD9523 is not set

#
# Phase-Locked Loop (PLL) frequency synthesizers
#
# CONFIG_ADF4350 is not set

#
# Digital to analog converters
#
# CONFIG_AD5064 is not set
CONFIG_AD5360=m
CONFIG_AD5380=m
# CONFIG_AD5421 is not set
# CONFIG_AD5624R_SPI is not set
# CONFIG_AD5446 is not set
# CONFIG_AD5504 is not set
# CONFIG_AD5755 is not set
# CONFIG_AD5764 is not set
# CONFIG_AD5791 is not set
CONFIG_AD5686=m
# CONFIG_MAX517 is not set
CONFIG_MCP4725=m

#
# Hid Sensor IIO Common
#

#
# Digital gyroscope sensors
#

#
# Magnetometer sensors
#
# CONFIG_VME_BUS is not set
CONFIG_PWM=y

#
# Firmware Drivers
#
CONFIG_EDD=m
# CONFIG_EDD_OFF is not set
CONFIG_FIRMWARE_MEMMAP=y
CONFIG_DELL_RBU=m
# CONFIG_DCDBAS is not set
# CONFIG_DMIID is not set
CONFIG_DMI_SYSFS=m
# CONFIG_ISCSI_IBFT_FIND is not set
# CONFIG_GOOGLE_FIRMWARE is not set

#
# File systems
#
CONFIG_DCACHE_WORD_ACCESS=y
# CONFIG_EXT2_FS is not set
CONFIG_EXT3_FS=m
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
# CONFIG_EXT3_FS_SECURITY is not set
# CONFIG_EXT4_FS is not set
CONFIG_JBD=m
CONFIG_JBD_DEBUG=y
CONFIG_FS_MBCACHE=m
CONFIG_REISERFS_FS=m
CONFIG_REISERFS_CHECK=y
# CONFIG_REISERFS_PROC_INFO is not set
CONFIG_REISERFS_FS_XATTR=y
CONFIG_REISERFS_FS_POSIX_ACL=y
# CONFIG_REISERFS_FS_SECURITY is not set
# CONFIG_JFS_FS is not set
CONFIG_XFS_FS=m
CONFIG_XFS_QUOTA=y
CONFIG_XFS_POSIX_ACL=y
# CONFIG_XFS_RT is not set
# CONFIG_XFS_DEBUG is not set
# CONFIG_GFS2_FS is not set
# CONFIG_OCFS2_FS is not set
# CONFIG_BTRFS_FS is not set
# CONFIG_NILFS2_FS is not set
CONFIG_FS_POSIX_ACL=y
CONFIG_EXPORTFS=m
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY_USER=y
# CONFIG_FANOTIFY is not set
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
CONFIG_PRINT_QUOTA_WARNING=y
# CONFIG_QUOTA_DEBUG is not set
# CONFIG_QFMT_V1 is not set
# CONFIG_QFMT_V2 is not set
CONFIG_QUOTACTL=y
CONFIG_AUTOFS4_FS=m
# CONFIG_FUSE_FS is not set
CONFIG_GENERIC_ACL=y

#
# Caches
#
# CONFIG_FSCACHE is not set

#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
CONFIG_UDF_FS=m
CONFIG_UDF_NLS=y

#
# DOS/FAT/NT Filesystems
#
# CONFIG_MSDOS_FS is not set
# CONFIG_VFAT_FS is not set
CONFIG_NTFS_FS=m
CONFIG_NTFS_DEBUG=y
# CONFIG_NTFS_RW is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_TMPFS_XATTR=y
# CONFIG_HUGETLBFS is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_CONFIGFS_FS=m
# CONFIG_MISC_FILESYSTEMS is not set
# CONFIG_NETWORK_FILESYSTEMS is not set
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set
CONFIG_NLS_CODEPAGE_737=m
# CONFIG_NLS_CODEPAGE_775 is not set
CONFIG_NLS_CODEPAGE_850=m
CONFIG_NLS_CODEPAGE_852=m
CONFIG_NLS_CODEPAGE_855=m
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
CONFIG_NLS_CODEPAGE_862=m
CONFIG_NLS_CODEPAGE_863=m
CONFIG_NLS_CODEPAGE_864=m
# CONFIG_NLS_CODEPAGE_865 is not set
CONFIG_NLS_CODEPAGE_866=m
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
CONFIG_NLS_CODEPAGE_950=m
# CONFIG_NLS_CODEPAGE_932 is not set
CONFIG_NLS_CODEPAGE_949=m
CONFIG_NLS_CODEPAGE_874=m
CONFIG_NLS_ISO8859_8=m
CONFIG_NLS_CODEPAGE_1250=m
CONFIG_NLS_CODEPAGE_1251=m
# CONFIG_NLS_ASCII is not set
CONFIG_NLS_ISO8859_1=m
CONFIG_NLS_ISO8859_2=m
# CONFIG_NLS_ISO8859_3 is not set
CONFIG_NLS_ISO8859_4=m
# CONFIG_NLS_ISO8859_5 is not set
CONFIG_NLS_ISO8859_6=m
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_9 is not set
CONFIG_NLS_ISO8859_13=m
CONFIG_NLS_ISO8859_14=m
CONFIG_NLS_ISO8859_15=m
CONFIG_NLS_KOI8_R=m
CONFIG_NLS_KOI8_U=m
# CONFIG_NLS_MAC_ROMAN is not set
# CONFIG_NLS_MAC_CELTIC is not set
# CONFIG_NLS_MAC_CENTEURO is not set
CONFIG_NLS_MAC_CROATIAN=m
CONFIG_NLS_MAC_CYRILLIC=m
CONFIG_NLS_MAC_GAELIC=m
CONFIG_NLS_MAC_GREEK=m
CONFIG_NLS_MAC_ICELAND=m
# CONFIG_NLS_MAC_INUIT is not set
CONFIG_NLS_MAC_ROMANIAN=m
CONFIG_NLS_MAC_TURKISH=m
CONFIG_NLS_UTF8=m

#
# Kernel hacking
#
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_PRINTK_TIME=y
CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
CONFIG_ENABLE_WARN_DEPRECATED=y
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_FRAME_WARN=2048
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_READABLE_ASM is not set
# CONFIG_UNUSED_SYMBOLS is not set
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
CONFIG_DEBUG_SECTION_MISMATCH=y
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_SHIRQ is not set
# CONFIG_LOCKUP_DETECTOR is not set
# CONFIG_PANIC_ON_OOPS is not set
CONFIG_PANIC_ON_OOPS_VALUE=0
# CONFIG_DETECT_HUNG_TASK is not set
CONFIG_SCHED_DEBUG=y
# CONFIG_SCHEDSTATS is not set
# CONFIG_TIMER_STATS is not set
# CONFIG_DEBUG_OBJECTS is not set
CONFIG_SLUB_DEBUG_ON=y
CONFIG_SLUB_STATS=y
CONFIG_HAVE_DEBUG_KMEMLEAK=y
# CONFIG_DEBUG_KMEMLEAK is not set
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_RT_MUTEX_TESTER is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_MUTEXES is not set
# CONFIG_DEBUG_LOCK_ALLOC is not set
# CONFIG_PROVE_LOCKING is not set
CONFIG_SPARSE_RCU_POINTER=y
# CONFIG_LOCK_STAT is not set
CONFIG_DEBUG_ATOMIC_SLEEP=y
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
# CONFIG_DEBUG_STACK_USAGE is not set
# CONFIG_DEBUG_KOBJECT is not set
CONFIG_DEBUG_BUGVERBOSE=y
# CONFIG_DEBUG_INFO is not set
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_VIRTUAL is not set
# CONFIG_DEBUG_WRITECOUNT is not set
CONFIG_DEBUG_MEMORY_INIT=y
# CONFIG_DEBUG_LIST is not set
# CONFIG_TEST_LIST_SORT is not set
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
# CONFIG_DEBUG_CREDENTIALS is not set
CONFIG_ARCH_WANT_FRAME_POINTERS=y
CONFIG_FRAME_POINTER=y
# CONFIG_BOOT_PRINTK_DELAY is not set
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_RCU_TRACE is not set
# CONFIG_KPROBES_SANITY_TEST is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
# CONFIG_LKDTM is not set
# CONFIG_NOTIFIER_ERROR_INJECTION is not set
# CONFIG_FAULT_INJECTION is not set
# CONFIG_LATENCYTOP is not set
# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_FENTRY=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_TRACING_SUPPORT=y
# CONFIG_FTRACE is not set
# CONFIG_RBTREE_TEST is not set
# CONFIG_INTERVAL_TREE_TEST is not set
CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DMA_API_DEBUG=y
# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
CONFIG_HAVE_ARCH_KMEMCHECK=y
CONFIG_TEST_KSTRTOX=m
# CONFIG_STRICT_DEVMEM is not set
CONFIG_X86_VERBOSE_BOOTUP=y
CONFIG_EARLY_PRINTK=y
CONFIG_EARLY_PRINTK_DBGP=y
# CONFIG_DEBUG_STACKOVERFLOW is not set
# CONFIG_X86_PTDUMP is not set
CONFIG_DEBUG_RODATA=y
CONFIG_DEBUG_RODATA_TEST=y
# CONFIG_DEBUG_SET_MODULE_RONX is not set
# CONFIG_DEBUG_NX_TEST is not set
# CONFIG_DEBUG_TLBFLUSH is not set
# CONFIG_IOMMU_DEBUG is not set
# CONFIG_IOMMU_STRESS is not set
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
# CONFIG_X86_DECODER_SELFTEST is not set
CONFIG_IO_DELAY_TYPE_0X80=0
CONFIG_IO_DELAY_TYPE_0XED=1
CONFIG_IO_DELAY_TYPE_UDELAY=2
CONFIG_IO_DELAY_TYPE_NONE=3
# CONFIG_IO_DELAY_0X80 is not set
# CONFIG_IO_DELAY_0XED is not set
CONFIG_IO_DELAY_UDELAY=y
# CONFIG_IO_DELAY_NONE is not set
CONFIG_DEFAULT_IO_DELAY_TYPE=2
# CONFIG_DEBUG_BOOT_PARAMS is not set
# CONFIG_CPA_DEBUG is not set
# CONFIG_OPTIMIZE_INLINING is not set
# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
# CONFIG_DEBUG_NMI_SELFTEST is not set

#
# Security options
#
CONFIG_KEYS=y
CONFIG_TRUSTED_KEYS=m
# CONFIG_ENCRYPTED_KEYS is not set
# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
CONFIG_SECURITY_DMESG_RESTRICT=y
CONFIG_SECURITY=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
# CONFIG_SECURITY_NETWORK_XFRM is not set
CONFIG_SECURITY_PATH=y
# CONFIG_SECURITY_TOMOYO is not set
CONFIG_SECURITY_APPARMOR=y
CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1
# CONFIG_SECURITY_YAMA is not set
CONFIG_INTEGRITY=y
CONFIG_INTEGRITY_SIGNATURE=y
CONFIG_IMA=y
CONFIG_IMA_MEASURE_PCR_IDX=10
# CONFIG_IMA_AUDIT is not set
CONFIG_IMA_APPRAISE=y
CONFIG_DEFAULT_SECURITY_APPARMOR=y
# CONFIG_DEFAULT_SECURITY_DAC is not set
CONFIG_DEFAULT_SECURITY="apparmor"
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=m
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER=m
CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=m
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_PCOMP=m
CONFIG_CRYPTO_PCOMP2=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
CONFIG_CRYPTO_USER=m
CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
CONFIG_CRYPTO_GF128MUL=m
CONFIG_CRYPTO_NULL=m
CONFIG_CRYPTO_WORKQUEUE=y
CONFIG_CRYPTO_CRYPTD=m
# CONFIG_CRYPTO_AUTHENC is not set
# CONFIG_CRYPTO_TEST is not set
CONFIG_CRYPTO_ABLK_HELPER_X86=m
CONFIG_CRYPTO_GLUE_HELPER_X86=m

#
# Authenticated Encryption with Associated Data
#
CONFIG_CRYPTO_CCM=m
CONFIG_CRYPTO_GCM=m
CONFIG_CRYPTO_SEQIV=m

#
# Block modes
#
# CONFIG_CRYPTO_CBC is not set
CONFIG_CRYPTO_CTR=m
CONFIG_CRYPTO_CTS=m
CONFIG_CRYPTO_ECB=m
CONFIG_CRYPTO_LRW=m
# CONFIG_CRYPTO_PCBC is not set
CONFIG_CRYPTO_XTS=m

#
# Hash modes
#
CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_XCBC=m
# CONFIG_CRYPTO_VMAC is not set

#
# Digest
#
# CONFIG_CRYPTO_CRC32C is not set
CONFIG_CRYPTO_CRC32C_INTEL=m
CONFIG_CRYPTO_GHASH=m
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MICHAEL_MIC=m
# CONFIG_CRYPTO_RMD128 is not set
# CONFIG_CRYPTO_RMD160 is not set
# CONFIG_CRYPTO_RMD256 is not set
CONFIG_CRYPTO_RMD320=m
CONFIG_CRYPTO_SHA1=y
CONFIG_CRYPTO_SHA1_SSSE3=m
CONFIG_CRYPTO_SHA256=y
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_WP512 is not set
# CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL is not set

#
# Ciphers
#
CONFIG_CRYPTO_AES=m
CONFIG_CRYPTO_AES_X86_64=m
CONFIG_CRYPTO_AES_NI_INTEL=m
CONFIG_CRYPTO_ANUBIS=m
CONFIG_CRYPTO_ARC4=m
CONFIG_CRYPTO_BLOWFISH=m
CONFIG_CRYPTO_BLOWFISH_COMMON=m
# CONFIG_CRYPTO_BLOWFISH_X86_64 is not set
CONFIG_CRYPTO_CAMELLIA=m
CONFIG_CRYPTO_CAMELLIA_X86_64=m
CONFIG_CRYPTO_CAST5=m
# CONFIG_CRYPTO_CAST5_AVX_X86_64 is not set
CONFIG_CRYPTO_CAST6=m
# CONFIG_CRYPTO_CAST6_AVX_X86_64 is not set
CONFIG_CRYPTO_DES=m
# CONFIG_CRYPTO_FCRYPT is not set
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_SALSA20 is not set
CONFIG_CRYPTO_SALSA20_X86_64=m
# CONFIG_CRYPTO_SEED is not set
CONFIG_CRYPTO_SERPENT=m
CONFIG_CRYPTO_SERPENT_SSE2_X86_64=m
# CONFIG_CRYPTO_SERPENT_AVX_X86_64 is not set
# CONFIG_CRYPTO_TEA is not set
CONFIG_CRYPTO_TWOFISH=m
CONFIG_CRYPTO_TWOFISH_COMMON=m
CONFIG_CRYPTO_TWOFISH_X86_64=m
CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=m
CONFIG_CRYPTO_TWOFISH_AVX_X86_64=m

#
# Compression
#
CONFIG_CRYPTO_DEFLATE=m
CONFIG_CRYPTO_ZLIB=m
# CONFIG_CRYPTO_LZO is not set

#
# Random Number Generation
#
CONFIG_CRYPTO_ANSI_CPRNG=m
CONFIG_CRYPTO_USER_API=m
CONFIG_CRYPTO_USER_API_HASH=m
# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
CONFIG_CRYPTO_HW=y
# CONFIG_CRYPTO_DEV_PADLOCK is not set
CONFIG_ASYMMETRIC_KEY_TYPE=y
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
CONFIG_PUBLIC_KEY_ALGO_RSA=y
CONFIG_X509_CERTIFICATE_PARSER=y
CONFIG_HAVE_KVM=y
# CONFIG_VIRTUALIZATION is not set
# CONFIG_BINARY_PRINTF is not set

#
# Library routines
#
CONFIG_BITREVERSE=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GENERIC_FIND_FIRST_BIT=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_IO=y
CONFIG_CRC_CCITT=m
CONFIG_CRC16=m
CONFIG_CRC_T10DIF=m
CONFIG_CRC_ITU_T=m
CONFIG_CRC32=y
# CONFIG_CRC32_SELFTEST is not set
CONFIG_CRC32_SLICEBY8=y
# CONFIG_CRC32_SLICEBY4 is not set
# CONFIG_CRC32_SARWATE is not set
# CONFIG_CRC32_BIT is not set
CONFIG_CRC7=m
# CONFIG_LIBCRC32C is not set
CONFIG_CRC8=m
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=m
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_XZ_DEC=y
CONFIG_XZ_DEC_X86=y
CONFIG_XZ_DEC_POWERPC=y
CONFIG_XZ_DEC_IA64=y
CONFIG_XZ_DEC_ARM=y
CONFIG_XZ_DEC_ARMTHUMB=y
CONFIG_XZ_DEC_SPARC=y
CONFIG_XZ_DEC_BCJ=y
CONFIG_XZ_DEC_TEST=m
CONFIG_DECOMPRESS_GZIP=y
CONFIG_DECOMPRESS_BZIP2=y
CONFIG_DECOMPRESS_LZMA=y
CONFIG_DECOMPRESS_XZ=y
CONFIG_DECOMPRESS_LZO=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_CHECK_SIGNATURE=y
CONFIG_DQL=y
CONFIG_NLATTR=y
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
CONFIG_AVERAGE=y
CONFIG_CLZ_TAB=y
# CONFIG_CORDIC is not set
# CONFIG_DDR is not set
CONFIG_MPILIB=y
CONFIG_SIGNATURE=y
CONFIG_OID_REGISTRY=y

--=_50b68452.A6KZaSQDGJ7X3bTwVTt7Bk6j0xJkxL9Q6i7ArV1x5gdxZGwi
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.xen.org
http://lists.xen.org/xen-devel

--=_50b68452.A6KZaSQDGJ7X3bTwVTt7Bk6j0xJkxL9Q6i7ArV1x5gdxZGwi--


From xen-devel-bounces@lists.xen.org Wed Nov 28 21:51:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 21:51:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdpWh-0000fc-T3; Wed, 28 Nov 2012 21:50:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TdpWg-0000fU-AM
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 21:50:38 +0000
Received: from [85.158.138.51:53477] by server-7.bemta-3.messagelabs.com id
	93/FD-01713-D2786B05; Wed, 28 Nov 2012 21:50:37 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1354139431!23017983!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA5MjMwNQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1630 invoked from network); 28 Nov 2012 21:50:33 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 21:50:33 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASLoT7E027764
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 21:50:30 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASLoSAl011027
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 21:50:29 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASLoRjX020595; Wed, 28 Nov 2012 15:50:28 -0600
MIME-Version: 1.0
Message-ID: <8be77fb4-3393-4f49-99f6-2b6c9f89bc18@default>
Date: Wed, 28 Nov 2012 13:50:25 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__1354139427627133936abhmt101.oracle.com"
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Konrad Wilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] xen: centralize accounting for domain tot_pages
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__1354139427627133936abhmt101.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

xen: centralize accounting for domain tot_pages

Provide and use a common function for all adjustments to a
domain's tot_pages counter in anticipation of future and/or
out-of-tree patches that must adjust related counters
atomically.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 arch/x86/mm.c             |    4 ++--
 arch/x86/mm/mem_sharing.c |    4 ++--
 common/grant_table.c      |    2 +-
 common/memory.c           |    2 +-
 common/page_alloc.c       |   10 ++++++++--
 include/xen/mm.h          |    2 ++
 6 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index ab94b02..3887ca6 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3842,7 +3842,7 @@ int donate_page(
     {
         if ( d->tot_pages >=3D d->max_pages )
             goto fail;
-        d->tot_pages++;
+        domain_adjust_tot_pages(d, 1);
     }
=20
     page->count_info =3D PGC_allocated | 1;
@@ -3892,7 +3892,7 @@ int steal_page(
     } while ( (y =3D cmpxchg(&page->count_info, x, x | 1)) !=3D x );
=20
     /* Unlink from original owner. */
-    if ( !(memflags & MEMF_no_refcount) && !--d->tot_pages )
+    if ( !(memflags & MEMF_no_refcount) && !domain_adjust_tot_pages(d, -1)=
 )
         drop_dom_ref =3D 1;
     page_list_del(page, &d->page_list);
=20
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..e91aac5 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d,
     }
=20
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_adjust_tot_pages(d, -1);
     drop_dom_ref =3D (d->tot_pages =3D=3D 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct p=
age_info *page)
     ASSERT(page_get_owner(page) =3D=3D dom_cow);
     page_set_owner(page, d);
=20
-    if ( d->tot_pages++ =3D=3D 0 )
+    if ( domain_adjust_tot_pages(d, 1) =3D=3D 1 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..ca8d861 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1656,7 +1656,7 @@ gnttab_transfer(
         }
=20
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ =3D=3D 0) )
+        if ( unlikely(domain_adjust_tot_pages(e, 1) =3D=3D 1) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..9842ea9 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_=
memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
=20
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -=3D dec_count;
+                domain_adjust_tot_pages(d, -dec_count);
                 drop_dom_ref =3D (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
=20
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 15ebc66..e273bb7 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -239,6 +239,12 @@ static long midsize_alloc_zone_pages;
=20
 static DEFINE_SPINLOCK(heap_lock);
=20
+unsigned long domain_adjust_tot_pages(struct domain *d, long pages)
+{
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    return d->tot_pages +=3D pages;
+}
+
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
 {
@@ -1291,7 +1297,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages =3D=3D 0) )
             get_knownalive_domain(d);
=20
-        d->tot_pages +=3D 1 << order;
+        domain_adjust_tot_pages(d, 1 << order);
     }
=20
     for ( i =3D 0; i < (1 << order); i++ )
@@ -1375,7 +1381,7 @@ void free_domheap_pages(struct page_info *pg, unsigne=
d int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
=20
-        d->tot_pages -=3D 1 << order;
+        domain_adjust_tot_pages(d, -(1 << order));
         drop_dom_ref =3D (d->tot_pages =3D=3D 0);
=20
         spin_unlock_recursive(&d->page_alloc_lock);
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 64a0cc1..00b1915 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,8 @@ void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
=20
+unsigned long domain_adjust_tot_pages(struct domain *d, long pages);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(

--__1354139427627133936abhmt101.oracle.com
Content-Type: application/octet-stream; name="adjusttot-121128.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="adjusttot-121128.patch"

ZGlmZiAtLWdpdCBhL3hlbi9hcmNoL3g4Ni9tbS5jIGIveGVuL2FyY2gveDg2L21tLmMKaW5kZXgg
YWI5NGIwMi4uMzg4N2NhNiAxMDA2NDQKLS0tIGEveGVuL2FyY2gveDg2L21tLmMKKysrIGIveGVu
L2FyY2gveDg2L21tLmMKQEAgLTM4NDIsNyArMzg0Miw3IEBAIGludCBkb25hdGVfcGFnZSgKICAg
ICB7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zZSBmdW5jdGlvbnMg
YXJlICpub3QqIGludGVycnVwdC1zYWZlLiovCiB2b2lkIGluaXRfZG9taGVhcF9wYWdlcyhwYWRk
cl90IHBzLCBwYWRkcl90IHBlKTsKIHN0cnVjdCBwYWdlX2luZm8gKmFsbG9jX2RvbWhlYXBfcGFn
ZXMoCg==
--__1354139427627133936abhmt101.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__1354139427627133936abhmt101.oracle.com--


From xen-devel-bounces@lists.xen.org Wed Nov 28 21:51:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 21:51:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdpWh-0000fc-T3; Wed, 28 Nov 2012 21:50:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1TdpWg-0000fU-AM
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 21:50:38 +0000
Received: from [85.158.138.51:53477] by server-7.bemta-3.messagelabs.com id
	93/FD-01713-D2786B05; Wed, 28 Nov 2012 21:50:37 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1354139431!23017983!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA5MjMwNQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1630 invoked from network); 28 Nov 2012 21:50:33 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-7.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 21:50:33 -0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASLoT7E027764
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 21:50:30 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASLoSAl011027
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 21:50:29 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASLoRjX020595; Wed, 28 Nov 2012 15:50:28 -0600
MIME-Version: 1.0
Message-ID: <8be77fb4-3393-4f49-99f6-2b6c9f89bc18@default>
Date: Wed, 28 Nov 2012 13:50:25 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
Content-Type: multipart/mixed;
	boundary="__1354139427627133936abhmt101.oracle.com"
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Cc: Konrad Wilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] xen: centralize accounting for domain tot_pages
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--__1354139427627133936abhmt101.oracle.com
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

xen: centralize accounting for domain tot_pages

Provide and use a common function for all adjustments to a
domain's tot_pages counter in anticipation of future and/or
out-of-tree patches that must adjust related counters
atomically.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

 arch/x86/mm.c             |    4 ++--
 arch/x86/mm/mem_sharing.c |    4 ++--
 common/grant_table.c      |    2 +-
 common/memory.c           |    2 +-
 common/page_alloc.c       |   10 ++++++++--
 include/xen/mm.h          |    2 ++
 6 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index ab94b02..3887ca6 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3842,7 +3842,7 @@ int donate_page(
     {
         if ( d->tot_pages >=3D d->max_pages )
             goto fail;
-        d->tot_pages++;
+        domain_adjust_tot_pages(d, 1);
     }
=20
     page->count_info =3D PGC_allocated | 1;
@@ -3892,7 +3892,7 @@ int steal_page(
     } while ( (y =3D cmpxchg(&page->count_info, x, x | 1)) !=3D x );
=20
     /* Unlink from original owner. */
-    if ( !(memflags & MEMF_no_refcount) && !--d->tot_pages )
+    if ( !(memflags & MEMF_no_refcount) && !domain_adjust_tot_pages(d, -1)=
 )
         drop_dom_ref =3D 1;
     page_list_del(page, &d->page_list);
=20
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..e91aac5 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d,
     }
=20
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_adjust_tot_pages(d, -1);
     drop_dom_ref =3D (d->tot_pages =3D=3D 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct p=
age_info *page)
     ASSERT(page_get_owner(page) =3D=3D dom_cow);
     page_set_owner(page, d);
=20
-    if ( d->tot_pages++ =3D=3D 0 )
+    if ( domain_adjust_tot_pages(d, 1) =3D=3D 1 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..ca8d861 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1656,7 +1656,7 @@ gnttab_transfer(
         }
=20
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ =3D=3D 0) )
+        if ( unlikely(domain_adjust_tot_pages(e, 1) =3D=3D 1) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..9842ea9 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -454,7 +454,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_=
memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
=20
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -=3D dec_count;
+                domain_adjust_tot_pages(d, -dec_count);
                 drop_dom_ref =3D (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
=20
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 15ebc66..e273bb7 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -239,6 +239,12 @@ static long midsize_alloc_zone_pages;
=20
 static DEFINE_SPINLOCK(heap_lock);
=20
+unsigned long domain_adjust_tot_pages(struct domain *d, long pages)
+{
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    return d->tot_pages +=3D pages;
+}
+
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
 {
@@ -1291,7 +1297,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages =3D=3D 0) )
             get_knownalive_domain(d);
=20
-        d->tot_pages +=3D 1 << order;
+        domain_adjust_tot_pages(d, 1 << order);
     }
=20
     for ( i =3D 0; i < (1 << order); i++ )
@@ -1375,7 +1381,7 @@ void free_domheap_pages(struct page_info *pg, unsigne=
d int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
=20
-        d->tot_pages -=3D 1 << order;
+        domain_adjust_tot_pages(d, -(1 << order));
         drop_dom_ref =3D (d->tot_pages =3D=3D 0);
=20
         spin_unlock_recursive(&d->page_alloc_lock);
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 64a0cc1..00b1915 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,8 @@ void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
=20
+unsigned long domain_adjust_tot_pages(struct domain *d, long pages);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(

--__1354139427627133936abhmt101.oracle.com
Content-Type: application/octet-stream; name="adjusttot-121128.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="adjusttot-121128.patch"

ZGlmZiAtLWdpdCBhL3hlbi9hcmNoL3g4Ni9tbS5jIGIveGVuL2FyY2gveDg2L21tLmMKaW5kZXgg
YWI5NGIwMi4uMzg4N2N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it1bnNpZ25lZCBsb25nIGRvbWFpbl9hZGp1c3RfdG90X3BhZ2VzKHN0cnVjdCBkb21haW4gKmQs
IGxvbmcgcGFnZXMpOworCiAvKiBEb21haW4gc3ViYWxsb2NhdG9yLiBUaGVzZSBmdW5jdGlvbnMg
YXJlICpub3QqIGludGVycnVwdC1zYWZlLiovCiB2b2lkIGluaXRfZG9taGVhcF9wYWdlcyhwYWRk
cl90IHBzLCBwYWRkcl90IHBlKTsKIHN0cnVjdCBwYWdlX2luZm8gKmFsbG9jX2RvbWhlYXBfcGFn
ZXMoCg==
--__1354139427627133936abhmt101.oracle.com
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.xen.org
http://lists.xen.org/xen-devel

--__1354139427627133936abhmt101.oracle.com--


From xen-devel-bounces@lists.xen.org Wed Nov 28 22:03:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 22:03:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdpj1-00013c-6p; Wed, 28 Nov 2012 22:03:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Tdpj0-00013X-2e
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 22:03:22 +0000
Received: from [85.158.143.99:17357] by server-3.bemta-4.messagelabs.com id
	0F/3F-06841-92A86B05; Wed, 28 Nov 2012 22:03:21 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1354140199!31739980!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODE1MjA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16286 invoked from network); 28 Nov 2012 22:03:20 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-15.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 22:03:20 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASM3Icg023956
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 22:03:19 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASM3HiK028305
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 22:03:18 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASM3HlA029310; Wed, 28 Nov 2012 16:03:17 -0600
MIME-Version: 1.0
Message-ID: <36f4ae2f-4fbc-4b14-a084-7b336a052a7a@default>
Date: Wed, 28 Nov 2012 14:03:15 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Konrad Wilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] xen: reserve next two XENMEM_ op numbers for
 future/out-of-tree use
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

xen: reserve next two XENMEM_ op numbers for future/out-of-tree use

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index f1ddbc0..3ee2902 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -421,6 +421,12 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
 
+/*
+ * Reserve ops for future/out-of-tree "claim" patches (Oracle)
+ */
+#define XENMEM_claim_pages                  24
+#define XENMEM_get_unclaimed_pages          25
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
 
 #endif /* __XEN_PUBLIC_MEMORY_H__ */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 22:03:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 22:03:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdpj1-00013c-6p; Wed, 28 Nov 2012 22:03:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dan.magenheimer@oracle.com>) id 1Tdpj0-00013X-2e
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 22:03:22 +0000
Received: from [85.158.143.99:17357] by server-3.bemta-4.messagelabs.com id
	0F/3F-06841-92A86B05; Wed, 28 Nov 2012 22:03:21 +0000
X-Env-Sender: dan.magenheimer@oracle.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1354140199!31739980!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODE1MjA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16286 invoked from network); 28 Nov 2012 22:03:20 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-15.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 22:03:20 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASM3Icg023956
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 22:03:19 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASM3HiK028305
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 22:03:18 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASM3HlA029310; Wed, 28 Nov 2012 16:03:17 -0600
MIME-Version: 1.0
Message-ID: <36f4ae2f-4fbc-4b14-a084-7b336a052a7a@default>
Date: Wed, 28 Nov 2012 14:03:15 -0800 (PST)
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
	12.0.6665.5003 (x86)]
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: Konrad Wilk <konrad.wilk@oracle.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] xen: reserve next two XENMEM_ op numbers for
 future/out-of-tree use
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

xen: reserve next two XENMEM_ op numbers for future/out-of-tree use

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>

diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index f1ddbc0..3ee2902 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -421,6 +421,12 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
 
+/*
+ * Reserve ops for future/out-of-tree "claim" patches (Oracle)
+ */
+#define XENMEM_claim_pages                  24
+#define XENMEM_get_unclaimed_pages          25
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
 
 #endif /* __XEN_PUBLIC_MEMORY_H__ */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 22:15:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 22:15:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdpul-0001Ey-Hu; Wed, 28 Nov 2012 22:15:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1Tdpuk-0001Et-16
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 22:15:30 +0000
Received: from [85.158.137.99:38374] by server-5.bemta-3.messagelabs.com id
	2E/C1-26311-10D86B05; Wed, 28 Nov 2012 22:15:29 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354140925!13917265!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODE1MjA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11097 invoked from network); 28 Nov 2012 22:15:27 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 22:15:27 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASMFK7g002804
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 22:15:21 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASMFIDC006558
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 22:15:19 GMT
Received: from abhmt115.oracle.com (abhmt115.oracle.com [141.146.116.67])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASMFFtw024811; Wed, 28 Nov 2012 16:15:15 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 28 Nov 2012 14:15:15 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id DD0DFE00B49; Wed, 28 Nov 2012 17:15:10 -0500 (EST)
Date: Wed, 28 Nov 2012 17:15:10 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: kbuild test robot <fengguang.wu@intel.com>
Message-ID: <20121128221510.GA29950@phenom.dumpdata.com>
References: <50b68452.Gqr1L/cRkHFh1xmK%fengguang.wu@intel.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50b68452.Gqr1L/cRkHFh1xmK%fengguang.wu@intel.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>, xen-devel@lists.xensource.com,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [xen:stable/for-linus-3.8 4/8]
 include/xen/interface/version.h:72:2: error: implicit declaration of
 function 'xen_domain'
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 05:38:26AM +0800, kbuild test robot wrote:
> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-linus-3.8
> head:   394b40f62d7ae18a1c48c13fc483b8193f8c3a98
> commit: 92e3229dcdc80ff0b6304f14c578d76e7e10e226 [4/8] xen/acpi: ACPI PAD driver
> config: x86_64-randconfig-x701 (attached as .config)
> 
> Note: the xen/stable/for-linus-3.8 HEAD 394b40f builds fine.
>       It only hurts bisectibility.
> 
> All error/warnings:
> 
> In file included from drivers/xen/features.c:15:0:
> include/xen/interface/version.h: In function 'xen_running_on_version_or_later':
> include/xen/interface/version.h:72:2: error: implicit declaration of function 'xen_domain' [-Werror=implicit-function-declaration]
> cc1: some warnings being treated as errors

Which are fixed a bit later by me.

> 
> vim +72 +/xen_domain include/xen/interface/version.h
> 
> 92e3229d Liu, Jinsong 2012-11-08  66  /* Check if running on Xen version (major, minor) or later */
> 92e3229d Liu, Jinsong 2012-11-08  67  static inline bool
> 92e3229d Liu, Jinsong 2012-11-08  68  xen_running_on_version_or_later(unsigned int major, unsigned int minor)
> 92e3229d Liu, Jinsong 2012-11-08  69  {
> 92e3229d Liu, Jinsong 2012-11-08  70  	unsigned int version;
> 92e3229d Liu, Jinsong 2012-11-08  71  
> 92e3229d Liu, Jinsong 2012-11-08 @72  	if (!xen_domain())
> 92e3229d Liu, Jinsong 2012-11-08  73  		return false;
> 92e3229d Liu, Jinsong 2012-11-08  74  
> 92e3229d Liu, Jinsong 2012-11-08  75  	version = HYPERVISOR_xen_version(XENVER_version, NULL);
> 
> ---
> 0-DAY kernel build testing backend         Open Source Technology Center
> Fengguang Wu, Yuanhan Liu                              Intel Corporation

> #
> # Automatically generated file; DO NOT EDIT.
> # Linux/x86_64 3.7.0-rc3 Kernel Configuration
> #
> CONFIG_64BIT=y
> CONFIG_X86_64=y
> CONFIG_X86=y
> CONFIG_INSTRUCTION_DECODER=y
> CONFIG_OUTPUT_FORMAT="elf64-x86-64"
> CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
> CONFIG_LOCKDEP_SUPPORT=y
> CONFIG_STACKTRACE_SUPPORT=y
> CONFIG_HAVE_LATENCYTOP_SUPPORT=y
> CONFIG_MMU=y
> CONFIG_NEED_DMA_MAP_STATE=y
> CONFIG_NEED_SG_DMA_LENGTH=y
> CONFIG_GENERIC_ISA_DMA=y
> CONFIG_GENERIC_BUG=y
> CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
> CONFIG_GENERIC_HWEIGHT=y
> CONFIG_ARCH_MAY_HAVE_PC_FDC=y
> CONFIG_RWSEM_XCHGADD_ALGORITHM=y
> CONFIG_GENERIC_CALIBRATE_DELAY=y
> CONFIG_ARCH_HAS_CPU_RELAX=y
> CONFIG_ARCH_HAS_DEFAULT_IDLE=y
> CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
> CONFIG_ARCH_HAS_CPU_AUTOPROBE=y
> CONFIG_HAVE_SETUP_PER_CPU_AREA=y
> CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
> CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
> CONFIG_ARCH_HIBERNATION_POSSIBLE=y
> CONFIG_ARCH_SUSPEND_POSSIBLE=y
> CONFIG_ZONE_DMA32=y
> CONFIG_AUDIT_ARCH=y
> CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
> CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
> CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11"
> CONFIG_ARCH_SUPPORTS_UPROBES=y
> CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
> CONFIG_HAVE_IRQ_WORK=y
> CONFIG_IRQ_WORK=y
> CONFIG_BUILDTIME_EXTABLE_SORT=y
> 
> #
> # General setup
> #
> CONFIG_EXPERIMENTAL=y
> CONFIG_BROKEN_ON_SMP=y
> CONFIG_INIT_ENV_ARG_LIMIT=32
> CONFIG_CROSS_COMPILE=""
> CONFIG_LOCALVERSION=""
> CONFIG_LOCALVERSION_AUTO=y
> CONFIG_HAVE_KERNEL_GZIP=y
> CONFIG_HAVE_KERNEL_BZIP2=y
> CONFIG_HAVE_KERNEL_LZMA=y
> CONFIG_HAVE_KERNEL_XZ=y
> CONFIG_HAVE_KERNEL_LZO=y
> # CONFIG_KERNEL_GZIP is not set
> CONFIG_KERNEL_BZIP2=y
> # CONFIG_KERNEL_LZMA is not set
> # CONFIG_KERNEL_XZ is not set
> # CONFIG_KERNEL_LZO is not set
> CONFIG_DEFAULT_HOSTNAME="(none)"
> # CONFIG_SWAP is not set
> # CONFIG_SYSVIPC is not set
> # CONFIG_POSIX_MQUEUE is not set
> # CONFIG_FHANDLE is not set
> CONFIG_AUDIT=y
> CONFIG_AUDITSYSCALL=y
> CONFIG_AUDIT_WATCH=y
> CONFIG_AUDIT_TREE=y
> CONFIG_AUDIT_LOGINUID_IMMUTABLE=y
> CONFIG_HAVE_GENERIC_HARDIRQS=y
> 
> #
> # IRQ subsystem
> #
> CONFIG_GENERIC_HARDIRQS=y
> CONFIG_GENERIC_IRQ_PROBE=y
> CONFIG_GENERIC_IRQ_SHOW=y
> CONFIG_IRQ_DOMAIN=y
> # CONFIG_IRQ_DOMAIN_DEBUG is not set
> CONFIG_IRQ_FORCED_THREADING=y
> CONFIG_SPARSE_IRQ=y
> CONFIG_CLOCKSOURCE_WATCHDOG=y
> CONFIG_ARCH_CLOCKSOURCE_DATA=y
> CONFIG_GENERIC_TIME_VSYSCALL=y
> CONFIG_GENERIC_CLOCKEVENTS=y
> CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
> CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
> CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
> CONFIG_GENERIC_CMOS_UPDATE=y
> 
> #
> # Timers subsystem
> #
> # CONFIG_NO_HZ is not set
> # CONFIG_HIGH_RES_TIMERS is not set
> 
> #
> # CPU/Task time and stats accounting
> #
> # CONFIG_TICK_CPU_ACCOUNTING is not set
> CONFIG_IRQ_TIME_ACCOUNTING=y
> # CONFIG_BSD_PROCESS_ACCT is not set
> CONFIG_TASKSTATS=y
> # CONFIG_TASK_DELAY_ACCT is not set
> # CONFIG_TASK_XACCT is not set
> 
> #
> # RCU Subsystem
> #
> CONFIG_TINY_RCU=y
> # CONFIG_PREEMPT_RCU is not set
> # CONFIG_TREE_RCU_TRACE is not set
> CONFIG_IKCONFIG=y
> # CONFIG_IKCONFIG_PROC is not set
> CONFIG_LOG_BUF_SHIFT=17
> CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
> CONFIG_CGROUPS=y
> CONFIG_CGROUP_DEBUG=y
> # CONFIG_CGROUP_FREEZER is not set
> CONFIG_CGROUP_DEVICE=y
> CONFIG_CPUSETS=y
> CONFIG_PROC_PID_CPUSET=y
> # CONFIG_CGROUP_CPUACCT is not set
> CONFIG_RESOURCE_COUNTERS=y
> CONFIG_MEMCG=y
> # CONFIG_MEMCG_KMEM is not set
> CONFIG_CGROUP_PERF=y
> CONFIG_CGROUP_SCHED=y
> CONFIG_FAIR_GROUP_SCHED=y
> # CONFIG_CFS_BANDWIDTH is not set
> # CONFIG_RT_GROUP_SCHED is not set
> # CONFIG_BLK_CGROUP is not set
> # CONFIG_CHECKPOINT_RESTORE is not set
> CONFIG_NAMESPACES=y
> # CONFIG_UTS_NS is not set
> CONFIG_PID_NS=y
> CONFIG_NET_NS=y
> CONFIG_SCHED_AUTOGROUP=y
> CONFIG_MM_OWNER=y
> # CONFIG_SYSFS_DEPRECATED is not set
> # CONFIG_RELAY is not set
> CONFIG_BLK_DEV_INITRD=y
> CONFIG_INITRAMFS_SOURCE=""
> CONFIG_RD_GZIP=y
> CONFIG_RD_BZIP2=y
> CONFIG_RD_LZMA=y
> CONFIG_RD_XZ=y
> CONFIG_RD_LZO=y
> CONFIG_CC_OPTIMIZE_FOR_SIZE=y
> CONFIG_SYSCTL=y
> CONFIG_ANON_INODES=y
> # CONFIG_EXPERT is not set
> # CONFIG_SYSCTL_SYSCALL is not set
> CONFIG_SYSCTL_EXCEPTION_TRACE=y
> CONFIG_KALLSYMS=y
> # CONFIG_KALLSYMS_ALL is not set
> CONFIG_HOTPLUG=y
> CONFIG_PRINTK=y
> CONFIG_BUG=y
> CONFIG_ELF_CORE=y
> CONFIG_PCSPKR_PLATFORM=y
> CONFIG_HAVE_PCSPKR_PLATFORM=y
> CONFIG_BASE_FULL=y
> CONFIG_FUTEX=y
> CONFIG_EPOLL=y
> CONFIG_SIGNALFD=y
> CONFIG_TIMERFD=y
> CONFIG_EVENTFD=y
> CONFIG_SHMEM=y
> CONFIG_AIO=y
> # CONFIG_EMBEDDED is not set
> CONFIG_HAVE_PERF_EVENTS=y
> 
> #
> # Kernel Performance Events And Counters
> #
> CONFIG_PERF_EVENTS=y
> # CONFIG_DEBUG_PERF_USE_VMALLOC is not set
> CONFIG_VM_EVENT_COUNTERS=y
> CONFIG_PCI_QUIRKS=y
> CONFIG_SLUB_DEBUG=y
> # CONFIG_COMPAT_BRK is not set
> # CONFIG_SLAB is not set
> CONFIG_SLUB=y
> CONFIG_PROFILING=y
> # CONFIG_OPROFILE is not set
> CONFIG_HAVE_OPROFILE=y
> CONFIG_OPROFILE_NMI_TIMER=y
> CONFIG_KPROBES=y
> CONFIG_JUMP_LABEL=y
> CONFIG_OPTPROBES=y
> CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
> CONFIG_KRETPROBES=y
> CONFIG_HAVE_IOREMAP_PROT=y
> CONFIG_HAVE_KPROBES=y
> CONFIG_HAVE_KRETPROBES=y
> CONFIG_HAVE_OPTPROBES=y
> CONFIG_HAVE_ARCH_TRACEHOOK=y
> CONFIG_HAVE_DMA_ATTRS=y
> CONFIG_GENERIC_SMP_IDLE_THREAD=y
> CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
> CONFIG_HAVE_DMA_API_DEBUG=y
> CONFIG_HAVE_HW_BREAKPOINT=y
> CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
> CONFIG_HAVE_USER_RETURN_NOTIFIER=y
> CONFIG_HAVE_PERF_EVENTS_NMI=y
> CONFIG_HAVE_PERF_REGS=y
> CONFIG_HAVE_PERF_USER_STACK_DUMP=y
> CONFIG_HAVE_ARCH_JUMP_LABEL=y
> CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
> CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
> CONFIG_HAVE_CMPXCHG_LOCAL=y
> CONFIG_HAVE_CMPXCHG_DOUBLE=y
> CONFIG_GENERIC_KERNEL_THREAD=y
> CONFIG_GENERIC_KERNEL_EXECVE=y
> CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
> CONFIG_HAVE_RCU_USER_QS=y
> CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
> CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
> CONFIG_MODULES_USE_ELF_RELA=y
> 
> #
> # GCOV-based kernel profiling
> #
> # CONFIG_GCOV_KERNEL is not set
> # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
> CONFIG_SLABINFO=y
> CONFIG_RT_MUTEXES=y
> CONFIG_BASE_SMALL=0
> CONFIG_MODULES=y
> # CONFIG_MODULE_FORCE_LOAD is not set
> # CONFIG_MODULE_UNLOAD is not set
> # CONFIG_MODVERSIONS is not set
> # CONFIG_MODULE_SRCVERSION_ALL is not set
> CONFIG_MODULE_SIG=y
> # CONFIG_MODULE_SIG_FORCE is not set
> # CONFIG_MODULE_SIG_SHA1 is not set
> CONFIG_MODULE_SIG_SHA224=y
> # CONFIG_MODULE_SIG_SHA256 is not set
> # CONFIG_MODULE_SIG_SHA384 is not set
> # CONFIG_MODULE_SIG_SHA512 is not set
> CONFIG_BLOCK=y
> CONFIG_BLK_DEV_BSG=y
> CONFIG_BLK_DEV_BSGLIB=y
> CONFIG_BLK_DEV_INTEGRITY=y
> 
> #
> # Partition Types
> #
> CONFIG_PARTITION_ADVANCED=y
> CONFIG_ACORN_PARTITION=y
> # CONFIG_ACORN_PARTITION_CUMANA is not set
> CONFIG_ACORN_PARTITION_EESOX=y
> # CONFIG_ACORN_PARTITION_ICS is not set
> CONFIG_ACORN_PARTITION_ADFS=y
> # CONFIG_ACORN_PARTITION_POWERTEC is not set
> CONFIG_ACORN_PARTITION_RISCIX=y
> # CONFIG_OSF_PARTITION is not set
> # CONFIG_AMIGA_PARTITION is not set
> # CONFIG_ATARI_PARTITION is not set
> # CONFIG_MAC_PARTITION is not set
> CONFIG_MSDOS_PARTITION=y
> # CONFIG_BSD_DISKLABEL is not set
> # CONFIG_MINIX_SUBPARTITION is not set
> CONFIG_SOLARIS_X86_PARTITION=y
> # CONFIG_UNIXWARE_DISKLABEL is not set
> # CONFIG_LDM_PARTITION is not set
> CONFIG_SGI_PARTITION=y
> CONFIG_ULTRIX_PARTITION=y
> CONFIG_SUN_PARTITION=y
> # CONFIG_KARMA_PARTITION is not set
> # CONFIG_EFI_PARTITION is not set
> # CONFIG_SYSV68_PARTITION is not set
> 
> #
> # IO Schedulers
> #
> CONFIG_IOSCHED_NOOP=y
> CONFIG_IOSCHED_DEADLINE=m
> CONFIG_IOSCHED_CFQ=m
> CONFIG_DEFAULT_NOOP=y
> CONFIG_DEFAULT_IOSCHED="noop"
> CONFIG_ASN1=y
> CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
> CONFIG_INLINE_READ_UNLOCK=y
> CONFIG_INLINE_READ_UNLOCK_IRQ=y
> CONFIG_INLINE_WRITE_UNLOCK=y
> CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
> CONFIG_FREEZER=y
> 
> #
> # Processor type and features
> #
> CONFIG_ZONE_DMA=y
> # CONFIG_SMP is not set
> CONFIG_X86_MPPARSE=y
> CONFIG_X86_EXTENDED_PLATFORM=y
> CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
> # CONFIG_SCHED_OMIT_FRAME_POINTER is not set
> CONFIG_PARAVIRT_GUEST=y
> CONFIG_PARAVIRT_TIME_ACCOUNTING=y
> CONFIG_XEN=y
> CONFIG_XEN_DOM0=y
> CONFIG_XEN_PRIVILEGED_GUEST=y
> CONFIG_XEN_PVHVM=y
> CONFIG_XEN_MAX_DOMAIN_MEMORY=500
> CONFIG_XEN_SAVE_RESTORE=y
> CONFIG_XEN_DEBUG_FS=y
> CONFIG_KVM_GUEST=y
> CONFIG_PARAVIRT=y
> CONFIG_PARAVIRT_CLOCK=y
> # CONFIG_PARAVIRT_DEBUG is not set
> CONFIG_NO_BOOTMEM=y
> CONFIG_MEMTEST=y
> # CONFIG_MK8 is not set
> # CONFIG_MPSC is not set
> # CONFIG_MCORE2 is not set
> # CONFIG_MATOM is not set
> CONFIG_GENERIC_CPU=y
> CONFIG_X86_INTERNODE_CACHE_SHIFT=6
> CONFIG_X86_CMPXCHG=y
> CONFIG_X86_L1_CACHE_SHIFT=6
> CONFIG_X86_XADD=y
> CONFIG_X86_WP_WORKS_OK=y
> CONFIG_X86_TSC=y
> CONFIG_X86_CMPXCHG64=y
> CONFIG_X86_CMOV=y
> CONFIG_X86_MINIMUM_CPU_FAMILY=64
> CONFIG_X86_DEBUGCTLMSR=y
> CONFIG_CPU_SUP_INTEL=y
> CONFIG_CPU_SUP_AMD=y
> CONFIG_CPU_SUP_CENTAUR=y
> CONFIG_HPET_TIMER=y
> CONFIG_HPET_EMULATE_RTC=y
> CONFIG_DMI=y
> CONFIG_GART_IOMMU=y
> CONFIG_CALGARY_IOMMU=y
> # CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT is not set
> CONFIG_SWIOTLB=y
> CONFIG_IOMMU_HELPER=y
> CONFIG_NR_CPUS=1
> CONFIG_PREEMPT_NONE=y
> # CONFIG_PREEMPT_VOLUNTARY is not set
> # CONFIG_PREEMPT is not set
> CONFIG_PREEMPT_COUNT=y
> CONFIG_X86_LOCAL_APIC=y
> CONFIG_X86_IO_APIC=y
> CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
> CONFIG_X86_MCE=y
> CONFIG_X86_MCE_INTEL=y
> CONFIG_X86_MCE_AMD=y
> CONFIG_X86_MCE_THRESHOLD=y
> # CONFIG_X86_MCE_INJECT is not set
> CONFIG_X86_THERMAL_VECTOR=y
> # CONFIG_I8K is not set
> CONFIG_MICROCODE=m
> # CONFIG_MICROCODE_INTEL is not set
> # CONFIG_MICROCODE_AMD is not set
> CONFIG_MICROCODE_OLD_INTERFACE=y
> CONFIG_X86_MSR=m
> # CONFIG_X86_CPUID is not set
> CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
> CONFIG_ARCH_DMA_ADDR_T_64BIT=y
> CONFIG_DIRECT_GBPAGES=y
> CONFIG_ARCH_SPARSEMEM_ENABLE=y
> CONFIG_ARCH_SPARSEMEM_DEFAULT=y
> CONFIG_ARCH_SELECT_MEMORY_MODEL=y
> CONFIG_ARCH_PROC_KCORE_TEXT=y
> CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
> CONFIG_SELECT_MEMORY_MODEL=y
> CONFIG_SPARSEMEM_MANUAL=y
> CONFIG_SPARSEMEM=y
> CONFIG_HAVE_MEMORY_PRESENT=y
> CONFIG_SPARSEMEM_EXTREME=y
> CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
> CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=y
> CONFIG_SPARSEMEM_VMEMMAP=y
> CONFIG_HAVE_MEMBLOCK=y
> CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
> CONFIG_ARCH_DISCARD_MEMBLOCK=y
> CONFIG_MEMORY_ISOLATION=y
> # CONFIG_MEMORY_HOTPLUG is not set
> CONFIG_PAGEFLAGS_EXTENDED=y
> CONFIG_SPLIT_PTLOCK_CPUS=4
> # CONFIG_COMPACTION is not set
> CONFIG_PHYS_ADDR_T_64BIT=y
> CONFIG_ZONE_DMA_FLAG=1
> CONFIG_BOUNCE=y
> CONFIG_VIRT_TO_BUS=y
> CONFIG_MMU_NOTIFIER=y
> CONFIG_KSM=y
> CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
> CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
> CONFIG_MEMORY_FAILURE=y
> # CONFIG_HWPOISON_INJECT is not set
> # CONFIG_TRANSPARENT_HUGEPAGE is not set
> # CONFIG_CROSS_MEMORY_ATTACH is not set
> CONFIG_NEED_PER_CPU_KM=y
> CONFIG_CLEANCACHE=y
> # CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
> CONFIG_X86_RESERVE_LOW=64
> CONFIG_MTRR=y
> CONFIG_MTRR_SANITIZER=y
> CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
> CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
> CONFIG_X86_PAT=y
> CONFIG_ARCH_USES_PG_UNCACHED=y
> CONFIG_ARCH_RANDOM=y
> CONFIG_X86_SMAP=y
> # CONFIG_EFI is not set
> # CONFIG_SECCOMP is not set
> CONFIG_CC_STACKPROTECTOR=y
> # CONFIG_HZ_100 is not set
> CONFIG_HZ_250=y
> # CONFIG_HZ_300 is not set
> # CONFIG_HZ_1000 is not set
> CONFIG_HZ=250
> # CONFIG_SCHED_HRTICK is not set
> CONFIG_KEXEC=y
> # CONFIG_CRASH_DUMP is not set
> CONFIG_PHYSICAL_START=0x1000000
> # CONFIG_RELOCATABLE is not set
> CONFIG_PHYSICAL_ALIGN=0x1000000
> # CONFIG_CMDLINE_BOOL is not set
> CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
> 
> #
> # Power management and ACPI options
> #
> # CONFIG_SUSPEND is not set
> CONFIG_HIBERNATE_CALLBACKS=y
> CONFIG_PM_SLEEP=y
> # CONFIG_PM_AUTOSLEEP is not set
> CONFIG_PM_WAKELOCKS=y
> CONFIG_PM_WAKELOCKS_LIMIT=100
> CONFIG_PM_WAKELOCKS_GC=y
> # CONFIG_PM_RUNTIME is not set
> CONFIG_PM=y
> # CONFIG_PM_DEBUG is not set
> CONFIG_ACPI=y
> # CONFIG_ACPI_PROCFS is not set
> # CONFIG_ACPI_PROCFS_POWER is not set
> # CONFIG_ACPI_EC_DEBUGFS is not set
> CONFIG_ACPI_PROC_EVENT=y
> CONFIG_ACPI_AC=y
> CONFIG_ACPI_BATTERY=y
> CONFIG_ACPI_BUTTON=y
> CONFIG_ACPI_VIDEO=m
> CONFIG_ACPI_FAN=y
> # CONFIG_ACPI_DOCK is not set
> CONFIG_ACPI_PROCESSOR=y
> # CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set
> CONFIG_ACPI_THERMAL=y
> # CONFIG_ACPI_CUSTOM_DSDT is not set
> CONFIG_ACPI_BLACKLIST_YEAR=0
> # CONFIG_ACPI_DEBUG is not set
> # CONFIG_ACPI_PCI_SLOT is not set
> CONFIG_X86_PM_TIMER=y
> # CONFIG_ACPI_CONTAINER is not set
> # CONFIG_ACPI_SBS is not set
> # CONFIG_ACPI_HED is not set
> # CONFIG_ACPI_CUSTOM_METHOD is not set
> # CONFIG_ACPI_APEI is not set
> CONFIG_SFI=y
> 
> #
> # CPU Frequency scaling
> #
> # CONFIG_CPU_FREQ is not set
> CONFIG_CPU_IDLE=y
> CONFIG_CPU_IDLE_GOV_LADDER=y
> # CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
> CONFIG_INTEL_IDLE=y
> 
> #
> # Memory power savings
> #
> # CONFIG_I7300_IDLE is not set
> 
> #
> # Bus options (PCI etc.)
> #
> CONFIG_PCI=y
> CONFIG_PCI_DIRECT=y
> # CONFIG_PCI_MMCONFIG is not set
> CONFIG_PCI_XEN=y
> CONFIG_PCI_DOMAINS=y
> CONFIG_PCIEPORTBUS=y
> CONFIG_HOTPLUG_PCI_PCIE=m
> CONFIG_PCIEAER=y
> CONFIG_PCIE_ECRC=y
> CONFIG_PCIEAER_INJECT=m
> CONFIG_PCIEASPM=y
> CONFIG_PCIEASPM_DEBUG=y
> # CONFIG_PCIEASPM_DEFAULT is not set
> CONFIG_PCIEASPM_POWERSAVE=y
> # CONFIG_PCIEASPM_PERFORMANCE is not set
> CONFIG_ARCH_SUPPORTS_MSI=y
> # CONFIG_PCI_MSI is not set
> # CONFIG_PCI_DEBUG is not set
> CONFIG_PCI_REALLOC_ENABLE_AUTO=y
> # CONFIG_PCI_STUB is not set
> CONFIG_XEN_PCIDEV_FRONTEND=m
> # CONFIG_HT_IRQ is not set
> CONFIG_PCI_ATS=y
> # CONFIG_PCI_IOV is not set
> CONFIG_PCI_PRI=y
> CONFIG_PCI_PASID=y
> # CONFIG_PCI_IOAPIC is not set
> CONFIG_PCI_LABEL=y
> CONFIG_ISA_DMA_API=y
> CONFIG_AMD_NB=y
> CONFIG_PCCARD=m
> CONFIG_PCMCIA=m
> CONFIG_PCMCIA_LOAD_CIS=y
> # CONFIG_CARDBUS is not set
> 
> #
> # PC-card bridges
> #
> # CONFIG_YENTA is not set
> # CONFIG_PD6729 is not set
> CONFIG_I82092=m
> CONFIG_PCCARD_NONSTATIC=y
> CONFIG_HOTPLUG_PCI=m
> # CONFIG_HOTPLUG_PCI_ACPI is not set
> CONFIG_HOTPLUG_PCI_CPCI=y
> # CONFIG_HOTPLUG_PCI_CPCI_ZT5550 is not set
> CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m
> # CONFIG_HOTPLUG_PCI_SHPC is not set
> # CONFIG_RAPIDIO is not set
> 
> #
> # Executable file formats / Emulations
> #
> CONFIG_BINFMT_ELF=y
> CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
> CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
> # CONFIG_HAVE_AOUT is not set
> CONFIG_BINFMT_MISC=m
> CONFIG_COREDUMP=y
> # CONFIG_IA32_EMULATION is not set
> CONFIG_HAVE_TEXT_POKE_SMP=y
> CONFIG_X86_DEV_DMA_OPS=y
> CONFIG_NET=y
> 
> #
> # Networking options
> #
> # CONFIG_PACKET is not set
> CONFIG_UNIX=y
> # CONFIG_UNIX_DIAG is not set
> CONFIG_XFRM=y
> CONFIG_XFRM_ALGO=m
> # CONFIG_XFRM_SUB_POLICY is not set
> CONFIG_XFRM_MIGRATE=y
> CONFIG_NET_KEY=m
> CONFIG_NET_KEY_MIGRATE=y
> # CONFIG_INET is not set
> CONFIG_NETWORK_SECMARK=y
> CONFIG_NETWORK_PHY_TIMESTAMPING=y
> # CONFIG_NETFILTER is not set
> # CONFIG_ATM is not set
> CONFIG_STP=m
> CONFIG_GARP=m
> # CONFIG_BRIDGE is not set
> CONFIG_VLAN_8021Q=m
> CONFIG_VLAN_8021Q_GVRP=y
> CONFIG_DECNET=m
> CONFIG_DECNET_ROUTER=y
> CONFIG_LLC=m
> CONFIG_LLC2=m
> # CONFIG_IPX is not set
> CONFIG_ATALK=m
> # CONFIG_DEV_APPLETALK is not set
> CONFIG_X25=m
> CONFIG_LAPB=m
> CONFIG_WAN_ROUTER=m
> CONFIG_PHONET=m
> # CONFIG_IEEE802154 is not set
> # CONFIG_NET_SCHED is not set
> CONFIG_DCB=y
> CONFIG_DNS_RESOLVER=m
> # CONFIG_BATMAN_ADV is not set
> # CONFIG_OPENVSWITCH is not set
> # CONFIG_NETPRIO_CGROUP is not set
> CONFIG_BQL=y
> # CONFIG_BPF_JIT is not set
> 
> #
> # Network testing
> #
> # CONFIG_NET_PKTGEN is not set
> # CONFIG_HAMRADIO is not set
> # CONFIG_CAN is not set
> # CONFIG_IRDA is not set
> # CONFIG_BT is not set
> CONFIG_FIB_RULES=y
> CONFIG_WIRELESS=y
> # CONFIG_CFG80211 is not set
> # CONFIG_LIB80211 is not set
> 
> #
> # CFG80211 needs to be enabled for MAC80211
> #
> CONFIG_WIMAX=m
> CONFIG_WIMAX_DEBUG_LEVEL=8
> # CONFIG_RFKILL is not set
> # CONFIG_NET_9P is not set
> # CONFIG_CAIF is not set
> # CONFIG_NFC is not set
> CONFIG_HAVE_BPF_JIT=y
> 
> #
> # Device Drivers
> #
> 
> #
> # Generic Driver Options
> #
> CONFIG_UEVENT_HELPER_PATH=""
> CONFIG_DEVTMPFS=y
> # CONFIG_DEVTMPFS_MOUNT is not set
> CONFIG_STANDALONE=y
> # CONFIG_PREVENT_FIRMWARE_BUILD is not set
> CONFIG_FW_LOADER=y
> # CONFIG_FIRMWARE_IN_KERNEL is not set
> CONFIG_EXTRA_FIRMWARE=""
> # CONFIG_DEBUG_DRIVER is not set
> # CONFIG_DEBUG_DEVRES is not set
> # CONFIG_SYS_HYPERVISOR is not set
> # CONFIG_GENERIC_CPU_DEVICES is not set
> CONFIG_REGMAP=y
> CONFIG_REGMAP_I2C=m
> CONFIG_REGMAP_SPI=y
> CONFIG_REGMAP_IRQ=y
> # CONFIG_DMA_SHARED_BUFFER is not set
> 
> #
> # Bus devices
> #
> # CONFIG_OMAP_OCP2SCP is not set
> # CONFIG_CONNECTOR is not set
> # CONFIG_MTD is not set
> CONFIG_PARPORT=m
> # CONFIG_PARPORT_PC is not set
> # CONFIG_PARPORT_GSC is not set
> # CONFIG_PARPORT_AX88796 is not set
> CONFIG_PARPORT_1284=y
> CONFIG_PNP=y
> CONFIG_PNP_DEBUG_MESSAGES=y
> 
> #
> # Protocols
> #
> CONFIG_PNPACPI=y
> CONFIG_BLK_DEV=y
> # CONFIG_BLK_DEV_FD is not set
> # CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
> # CONFIG_BLK_CPQ_DA is not set
> # CONFIG_BLK_CPQ_CISS_DA is not set
> # CONFIG_BLK_DEV_DAC960 is not set
> # CONFIG_BLK_DEV_UMEM is not set
> # CONFIG_BLK_DEV_COW_COMMON is not set
> # CONFIG_BLK_DEV_LOOP is not set
> 
> #
> # DRBD disabled because PROC_FS, INET or CONNECTOR not selected
> #
> # CONFIG_BLK_DEV_NBD is not set
> # CONFIG_BLK_DEV_NVME is not set
> # CONFIG_BLK_DEV_SX8 is not set
> # CONFIG_BLK_DEV_RAM is not set
> # CONFIG_CDROM_PKTCDVD is not set
> # CONFIG_ATA_OVER_ETH is not set
> CONFIG_XEN_BLKDEV_FRONTEND=y
> # CONFIG_XEN_BLKDEV_BACKEND is not set
> # CONFIG_VIRTIO_BLK is not set
> # CONFIG_BLK_DEV_HD is not set
> 
> #
> # Misc devices
> #
> # CONFIG_SENSORS_LIS3LV02D is not set
> # CONFIG_AD525X_DPOT is not set
> CONFIG_IBM_ASM=m
> CONFIG_PHANTOM=m
> # CONFIG_INTEL_MID_PTI is not set
> CONFIG_SGI_IOC4=m
> CONFIG_TIFM_CORE=m
> CONFIG_TIFM_7XX1=m
> CONFIG_ICS932S401=m
> CONFIG_ENCLOSURE_SERVICES=m
> CONFIG_HP_ILO=m
> # CONFIG_APDS9802ALS is not set
> # CONFIG_ISL29003 is not set
> # CONFIG_ISL29020 is not set
> CONFIG_SENSORS_TSL2550=m
> CONFIG_SENSORS_BH1780=m
> # CONFIG_SENSORS_BH1770 is not set
> CONFIG_SENSORS_APDS990X=m
> CONFIG_HMC6352=m
> CONFIG_DS1682=m
> # CONFIG_TI_DAC7512 is not set
> # CONFIG_VMWARE_BALLOON is not set
> CONFIG_BMP085=y
> # CONFIG_BMP085_I2C is not set
> CONFIG_BMP085_SPI=m
> CONFIG_PCH_PHUB=m
> CONFIG_USB_SWITCH_FSA9480=m
> # CONFIG_C2PORT is not set
> 
> #
> # EEPROM support
> #
> CONFIG_EEPROM_AT24=m
> # CONFIG_EEPROM_AT25 is not set
> CONFIG_EEPROM_LEGACY=m
> CONFIG_EEPROM_MAX6875=m
> # CONFIG_EEPROM_93CX6 is not set
> # CONFIG_EEPROM_93XX46 is not set
> CONFIG_CB710_CORE=m
> CONFIG_CB710_DEBUG=y
> CONFIG_CB710_DEBUG_ASSUMPTIONS=y
> 
> #
> # Texas Instruments shared transport line discipline
> #
> # CONFIG_SENSORS_LIS3_I2C is not set
> 
> #
> # Altera FPGA firmware download module
> #
> CONFIG_ALTERA_STAPL=m
> CONFIG_HAVE_IDE=y
> # CONFIG_IDE is not set
> 
> #
> # SCSI device support
> #
> CONFIG_SCSI_MOD=m
> CONFIG_RAID_ATTRS=m
> CONFIG_SCSI=m
> CONFIG_SCSI_DMA=y
> # CONFIG_SCSI_TGT is not set
> CONFIG_SCSI_NETLINK=y
> CONFIG_SCSI_PROC_FS=y
> 
> #
> # SCSI support type (disk, tape, CD-ROM)
> #
> CONFIG_BLK_DEV_SD=m
> # CONFIG_CHR_DEV_ST is not set
> # CONFIG_CHR_DEV_OSST is not set
> # CONFIG_BLK_DEV_SR is not set
> # CONFIG_CHR_DEV_SG is not set
> CONFIG_CHR_DEV_SCH=m
> CONFIG_SCSI_ENCLOSURE=m
> CONFIG_SCSI_MULTI_LUN=y
> CONFIG_SCSI_CONSTANTS=y
> CONFIG_SCSI_LOGGING=y
> # CONFIG_SCSI_SCAN_ASYNC is not set
> 
> #
> # SCSI Transports
> #
> CONFIG_SCSI_SPI_ATTRS=m
> CONFIG_SCSI_FC_ATTRS=m
> CONFIG_SCSI_ISCSI_ATTRS=m
> CONFIG_SCSI_SAS_ATTRS=m
> CONFIG_SCSI_SAS_LIBSAS=m
> CONFIG_SCSI_SAS_HOST_SMP=y
> # CONFIG_SCSI_SRP_ATTRS is not set
> CONFIG_SCSI_LOWLEVEL=y
> CONFIG_ISCSI_BOOT_SYSFS=m
> # CONFIG_SCSI_BNX2_ISCSI is not set
> # CONFIG_SCSI_BNX2X_FCOE is not set
> # CONFIG_BE2ISCSI is not set
> CONFIG_BLK_DEV_3W_XXXX_RAID=m
> # CONFIG_SCSI_HPSA is not set
> CONFIG_SCSI_3W_9XXX=m
> CONFIG_SCSI_3W_SAS=m
> # CONFIG_SCSI_ACARD is not set
> # CONFIG_SCSI_AACRAID is not set
> CONFIG_SCSI_AIC7XXX=m
> CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
> CONFIG_AIC7XXX_RESET_DELAY_MS=5000
> # CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
> CONFIG_AIC7XXX_DEBUG_ENABLE=y
> CONFIG_AIC7XXX_DEBUG_MASK=0
> # CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
> CONFIG_SCSI_AIC7XXX_OLD=m
> # CONFIG_SCSI_AIC79XX is not set
> CONFIG_SCSI_AIC94XX=m
> CONFIG_AIC94XX_DEBUG=y
> CONFIG_SCSI_MVSAS=m
> CONFIG_SCSI_MVSAS_DEBUG=y
> # CONFIG_SCSI_MVSAS_TASKLET is not set
> CONFIG_SCSI_MVUMI=m
> CONFIG_SCSI_DPT_I2O=m
> # CONFIG_SCSI_ADVANSYS is not set
> # CONFIG_SCSI_ARCMSR is not set
> # CONFIG_MEGARAID_NEWGEN is not set
> # CONFIG_MEGARAID_LEGACY is not set
> # CONFIG_MEGARAID_SAS is not set
> # CONFIG_SCSI_MPT2SAS is not set
> # CONFIG_SCSI_UFSHCD is not set
> CONFIG_SCSI_HPTIOP=m
> # CONFIG_SCSI_BUSLOGIC is not set
> # CONFIG_VMWARE_PVSCSI is not set
> CONFIG_LIBFC=m
> CONFIG_LIBFCOE=m
> CONFIG_FCOE=m
> CONFIG_FCOE_FNIC=m
> CONFIG_SCSI_DMX3191D=m
> # CONFIG_SCSI_EATA is not set
> CONFIG_SCSI_FUTURE_DOMAIN=m
> CONFIG_SCSI_GDTH=m
> # CONFIG_SCSI_ISCI is not set
> CONFIG_SCSI_IPS=m
> # CONFIG_SCSI_INITIO is not set
> CONFIG_SCSI_INIA100=m
> CONFIG_SCSI_STEX=m
> CONFIG_SCSI_SYM53C8XX_2=m
> CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
> CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
> CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
> # CONFIG_SCSI_SYM53C8XX_MMIO is not set
> CONFIG_SCSI_QLOGIC_1280=m
> # CONFIG_SCSI_QLA_FC is not set
> CONFIG_SCSI_QLA_ISCSI=m
> # CONFIG_SCSI_LPFC is not set
> # CONFIG_SCSI_DC395x is not set
> CONFIG_SCSI_DC390T=m
> # CONFIG_SCSI_DEBUG is not set
> CONFIG_SCSI_PMCRAID=m
> CONFIG_SCSI_PM8001=m
> # CONFIG_SCSI_SRP is not set
> CONFIG_SCSI_BFA_FC=m
> # CONFIG_SCSI_VIRTIO is not set
> CONFIG_SCSI_LOWLEVEL_PCMCIA=y
> # CONFIG_PCMCIA_AHA152X is not set
> # CONFIG_PCMCIA_FDOMAIN is not set
> CONFIG_PCMCIA_QLOGIC=m
> # CONFIG_PCMCIA_SYM53C500 is not set
> # CONFIG_SCSI_DH is not set
> CONFIG_SCSI_OSD_INITIATOR=m
> # CONFIG_SCSI_OSD_ULD is not set
> CONFIG_SCSI_OSD_DPRINT_SENSE=1
> CONFIG_SCSI_OSD_DEBUG=y
> # CONFIG_ATA is not set
> # CONFIG_MD is not set
> CONFIG_TARGET_CORE=m
> CONFIG_TCM_IBLOCK=m
> # CONFIG_TCM_FILEIO is not set
> CONFIG_TCM_PSCSI=m
> # CONFIG_LOOPBACK_TARGET is not set
> # CONFIG_TCM_FC is not set
> # CONFIG_ISCSI_TARGET is not set
> # CONFIG_SBP_TARGET is not set
> # CONFIG_FUSION is not set
> 
> #
> # IEEE 1394 (FireWire) support
> #
> CONFIG_FIREWIRE=m
> # CONFIG_FIREWIRE_OHCI is not set
> CONFIG_FIREWIRE_SBP2=m
> # CONFIG_FIREWIRE_NOSY is not set
> CONFIG_I2O=m
> # CONFIG_I2O_LCT_NOTIFY_ON_CHANGES is not set
> CONFIG_I2O_EXT_ADAPTEC=y
> CONFIG_I2O_EXT_ADAPTEC_DMA64=y
> # CONFIG_I2O_CONFIG is not set
> # CONFIG_I2O_BUS is not set
> CONFIG_I2O_BLOCK=m
> CONFIG_I2O_SCSI=m
> # CONFIG_I2O_PROC is not set
> # CONFIG_MACINTOSH_DRIVERS is not set
> # CONFIG_NETDEVICES is not set
> # CONFIG_ISDN is not set
> 
> #
> # Input device support
> #
> CONFIG_INPUT=y
> CONFIG_INPUT_FF_MEMLESS=m
> # CONFIG_INPUT_POLLDEV is not set
> CONFIG_INPUT_SPARSEKMAP=m
> # CONFIG_INPUT_MATRIXKMAP is not set
> 
> #
> # Userland interfaces
> #
> CONFIG_INPUT_MOUSEDEV=y
> CONFIG_INPUT_MOUSEDEV_PSAUX=y
> CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
> CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
> CONFIG_INPUT_JOYDEV=m
> CONFIG_INPUT_EVDEV=m
> CONFIG_INPUT_EVBUG=m
> 
> #
> # Input Device Drivers
> #
> CONFIG_INPUT_KEYBOARD=y
> CONFIG_KEYBOARD_ADP5588=m
> # CONFIG_KEYBOARD_ADP5589 is not set
> CONFIG_KEYBOARD_ATKBD=y
> CONFIG_KEYBOARD_QT1070=m
> # CONFIG_KEYBOARD_QT2160 is not set
> CONFIG_KEYBOARD_LKKBD=m
> # CONFIG_KEYBOARD_TCA6416 is not set
> # CONFIG_KEYBOARD_TCA8418 is not set
> # CONFIG_KEYBOARD_LM8323 is not set
> # CONFIG_KEYBOARD_LM8333 is not set
> CONFIG_KEYBOARD_MAX7359=m
> # CONFIG_KEYBOARD_MCS is not set
> CONFIG_KEYBOARD_MPR121=m
> CONFIG_KEYBOARD_NEWTON=m
> CONFIG_KEYBOARD_OPENCORES=m
> # CONFIG_KEYBOARD_STOWAWAY is not set
> # CONFIG_KEYBOARD_SUNKBD is not set
> # CONFIG_KEYBOARD_OMAP4 is not set
> # CONFIG_KEYBOARD_XTKBD is not set
> # CONFIG_INPUT_MOUSE is not set
> # CONFIG_INPUT_JOYSTICK is not set
> # CONFIG_INPUT_TABLET is not set
> # CONFIG_INPUT_TOUCHSCREEN is not set
> # CONFIG_INPUT_MISC is not set
> 
> #
> # Hardware I/O ports
> #
> CONFIG_SERIO=y
> CONFIG_SERIO_I8042=y
> CONFIG_SERIO_SERPORT=m
> # CONFIG_SERIO_CT82C710 is not set
> CONFIG_SERIO_PARKBD=m
> CONFIG_SERIO_PCIPS2=m
> CONFIG_SERIO_LIBPS2=y
> CONFIG_SERIO_RAW=m
> # CONFIG_SERIO_ALTERA_PS2 is not set
> # CONFIG_SERIO_PS2MULT is not set
> CONFIG_GAMEPORT=m
> CONFIG_GAMEPORT_NS558=m
> # CONFIG_GAMEPORT_L4 is not set
> # CONFIG_GAMEPORT_EMU10K1 is not set
> # CONFIG_GAMEPORT_FM801 is not set
> 
> #
> # Character devices
> #
> CONFIG_VT=y
> CONFIG_CONSOLE_TRANSLATIONS=y
> CONFIG_VT_CONSOLE=y
> CONFIG_VT_CONSOLE_SLEEP=y
> CONFIG_HW_CONSOLE=y
> # CONFIG_VT_HW_CONSOLE_BINDING is not set
> CONFIG_UNIX98_PTYS=y
> # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
> # CONFIG_LEGACY_PTYS is not set
> CONFIG_SERIAL_NONSTANDARD=y
> # CONFIG_ROCKETPORT is not set
> # CONFIG_CYCLADES is not set
> CONFIG_MOXA_INTELLIO=m
> CONFIG_MOXA_SMARTIO=m
> # CONFIG_SYNCLINK is not set
> # CONFIG_SYNCLINKMP is not set
> # CONFIG_SYNCLINK_GT is not set
> CONFIG_NOZOMI=m
> CONFIG_ISI=m
> CONFIG_N_HDLC=m
> # CONFIG_N_GSM is not set
> CONFIG_TRACE_ROUTER=m
> CONFIG_TRACE_SINK=m
> CONFIG_DEVKMEM=y
> # CONFIG_STALDRV is not set
> 
> #
> # Serial drivers
> #
> CONFIG_SERIAL_8250=y
> CONFIG_SERIAL_8250_PNP=y
> CONFIG_SERIAL_8250_CONSOLE=y
> CONFIG_FIX_EARLYCON_MEM=y
> CONFIG_SERIAL_8250_PCI=y
> CONFIG_SERIAL_8250_CS=m
> CONFIG_SERIAL_8250_NR_UARTS=4
> CONFIG_SERIAL_8250_RUNTIME_UARTS=4
> # CONFIG_SERIAL_8250_EXTENDED is not set
> 
> #
> # Non-8250 serial port support
> #
> CONFIG_SERIAL_MAX3100=m
> # CONFIG_SERIAL_MAX310X is not set
> # CONFIG_SERIAL_MFD_HSU is not set
> CONFIG_SERIAL_CORE=y
> CONFIG_SERIAL_CORE_CONSOLE=y
> # CONFIG_SERIAL_JSM is not set
> CONFIG_SERIAL_SCCNXP=m
> # CONFIG_SERIAL_TIMBERDALE is not set
> # CONFIG_SERIAL_ALTERA_JTAGUART is not set
> # CONFIG_SERIAL_ALTERA_UART is not set
> # CONFIG_SERIAL_PCH_UART is not set
> CONFIG_SERIAL_XILINX_PS_UART=m
> CONFIG_PRINTER=m
> CONFIG_LP_CONSOLE=y
> CONFIG_PPDEV=m
> # CONFIG_HVC_XEN is not set
> # CONFIG_VIRTIO_CONSOLE is not set
> # CONFIG_IPMI_HANDLER is not set
> CONFIG_HW_RANDOM=m
> # CONFIG_HW_RANDOM_TIMERIOMEM is not set
> # CONFIG_HW_RANDOM_INTEL is not set
> # CONFIG_HW_RANDOM_AMD is not set
> CONFIG_HW_RANDOM_VIA=m
> # CONFIG_HW_RANDOM_VIRTIO is not set
> CONFIG_HW_RANDOM_TPM=m
> CONFIG_NVRAM=m
> CONFIG_RTC=m
> # CONFIG_GEN_RTC is not set
> CONFIG_R3964=m
> CONFIG_APPLICOM=m
> 
> #
> # PCMCIA character devices
> #
> CONFIG_SYNCLINK_CS=m
> # CONFIG_CARDMAN_4000 is not set
> CONFIG_CARDMAN_4040=m
> # CONFIG_MWAVE is not set
> CONFIG_RAW_DRIVER=m
> CONFIG_MAX_RAW_DEVS=256
> # CONFIG_HPET is not set
> CONFIG_HANGCHECK_TIMER=m
> CONFIG_TCG_TPM=y
> CONFIG_TCG_TIS=y
> CONFIG_TCG_TIS_I2C_INFINEON=m
> # CONFIG_TCG_NSC is not set
> # CONFIG_TCG_ATMEL is not set
> # CONFIG_TCG_INFINEON is not set
> CONFIG_TELCLOCK=m
> CONFIG_DEVPORT=y
> CONFIG_I2C=m
> CONFIG_I2C_BOARDINFO=y
> CONFIG_I2C_COMPAT=y
> # CONFIG_I2C_CHARDEV is not set
> CONFIG_I2C_MUX=m
> 
> #
> # Multiplexer I2C Chip support
> #
> CONFIG_I2C_MUX_PCA9541=m
> # CONFIG_I2C_MUX_PCA954x is not set
> # CONFIG_I2C_HELPER_AUTO is not set
> CONFIG_I2C_SMBUS=m
> 
> #
> # I2C Algorithms
> #
> CONFIG_I2C_ALGOBIT=m
> # CONFIG_I2C_ALGOPCF is not set
> CONFIG_I2C_ALGOPCA=m
> 
> #
> # I2C Hardware Bus support
> #
> 
> #
> # PC SMBus host controller drivers
> #
> # CONFIG_I2C_ALI1535 is not set
> CONFIG_I2C_ALI1563=m
> # CONFIG_I2C_ALI15X3 is not set
> # CONFIG_I2C_AMD756 is not set
> # CONFIG_I2C_AMD8111 is not set
> # CONFIG_I2C_I801 is not set
> # CONFIG_I2C_ISCH is not set
> CONFIG_I2C_PIIX4=m
> # CONFIG_I2C_NFORCE2 is not set
> CONFIG_I2C_SIS5595=m
> # CONFIG_I2C_SIS630 is not set
> # CONFIG_I2C_SIS96X is not set
> CONFIG_I2C_VIA=m
> CONFIG_I2C_VIAPRO=m
> 
> #
> # ACPI drivers
> #
> # CONFIG_I2C_SCMI is not set
> 
> #
> # I2C system bus drivers (mostly embedded / system-on-chip)
> #
> CONFIG_I2C_DESIGNWARE_CORE=m
> CONFIG_I2C_DESIGNWARE_PCI=m
> CONFIG_I2C_EG20T=m
> # CONFIG_I2C_INTEL_MID is not set
> CONFIG_I2C_OCORES=m
> # CONFIG_I2C_PCA_PLATFORM is not set
> # CONFIG_I2C_PXA_PCI is not set
> # CONFIG_I2C_SIMTEC is not set
> CONFIG_I2C_XILINX=m
> 
> #
> # External I2C/SMBus adapter drivers
> #
> # CONFIG_I2C_PARPORT is not set
> # CONFIG_I2C_PARPORT_LIGHT is not set
> CONFIG_I2C_TAOS_EVM=m
> 
> #
> # Other I2C/SMBus bus drivers
> #
> # CONFIG_I2C_STUB is not set
> CONFIG_I2C_DEBUG_CORE=y
> CONFIG_I2C_DEBUG_ALGO=y
> # CONFIG_I2C_DEBUG_BUS is not set
> CONFIG_SPI=y
> # CONFIG_SPI_DEBUG is not set
> CONFIG_SPI_MASTER=y
> 
> #
> # SPI Master Controller Drivers
> #
> CONFIG_SPI_ALTERA=m
> CONFIG_SPI_BITBANG=m
> # CONFIG_SPI_BUTTERFLY is not set
> CONFIG_SPI_LM70_LLP=m
> # CONFIG_SPI_PXA2XX_PCI is not set
> CONFIG_SPI_SC18IS602=m
> # CONFIG_SPI_TOPCLIFF_PCH is not set
> CONFIG_SPI_XCOMM=m
> # CONFIG_SPI_XILINX is not set
> # CONFIG_SPI_DESIGNWARE is not set
> 
> #
> # SPI Protocol Masters
> #
> CONFIG_SPI_SPIDEV=m
> # CONFIG_SPI_TLE62X0 is not set
> # CONFIG_HSI is not set
> 
> #
> # PPS support
> #
> CONFIG_PPS=m
> CONFIG_PPS_DEBUG=y
> CONFIG_NTP_PPS=y
> 
> #
> # PPS clients support
> #
> # CONFIG_PPS_CLIENT_KTIMER is not set
> # CONFIG_PPS_CLIENT_LDISC is not set
> CONFIG_PPS_CLIENT_PARPORT=m
> # CONFIG_PPS_CLIENT_GPIO is not set
> 
> #
> # PPS generators support
> #
> 
> #
> # PTP clock support
> #
> CONFIG_PTP_1588_CLOCK=m
> 
> #
> # Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
> #
> CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
> # CONFIG_GPIOLIB is not set
> CONFIG_W1=m
> 
> #
> # 1-wire Bus Masters
> #
> # CONFIG_W1_MASTER_MATROX is not set
> # CONFIG_W1_MASTER_DS2482 is not set
> # CONFIG_W1_MASTER_DS1WM is not set
> CONFIG_HDQ_MASTER_OMAP=m
> 
> #
> # 1-wire Slaves
> #
> # CONFIG_W1_SLAVE_THERM is not set
> # CONFIG_W1_SLAVE_SMEM is not set
> CONFIG_W1_SLAVE_DS2408=m
> CONFIG_W1_SLAVE_DS2423=m
> # CONFIG_W1_SLAVE_DS2431 is not set
> CONFIG_W1_SLAVE_DS2433=m
> # CONFIG_W1_SLAVE_DS2433_CRC is not set
> # CONFIG_W1_SLAVE_DS2760 is not set
> CONFIG_W1_SLAVE_DS2780=m
> CONFIG_W1_SLAVE_DS2781=m
> CONFIG_W1_SLAVE_DS28E04=m
> # CONFIG_W1_SLAVE_BQ27000 is not set
> CONFIG_POWER_SUPPLY=y
> # CONFIG_POWER_SUPPLY_DEBUG is not set
> CONFIG_PDA_POWER=m
> # CONFIG_GENERIC_ADC_BATTERY is not set
> # CONFIG_WM831X_BACKUP is not set
> # CONFIG_WM831X_POWER is not set
> # CONFIG_TEST_POWER is not set
> CONFIG_BATTERY_DS2780=m
> # CONFIG_BATTERY_DS2781 is not set
> CONFIG_BATTERY_DS2782=m
> CONFIG_BATTERY_SBS=m
> CONFIG_BATTERY_BQ27x00=m
> CONFIG_BATTERY_BQ27X00_I2C=y
> # CONFIG_BATTERY_BQ27X00_PLATFORM is not set
> # CONFIG_BATTERY_MAX17040 is not set
> # CONFIG_BATTERY_MAX17042 is not set
> CONFIG_CHARGER_MAX8903=m
> # CONFIG_CHARGER_LP8727 is not set
> CONFIG_CHARGER_SMB347=m
> # CONFIG_POWER_AVS is not set
> CONFIG_HWMON=m
> CONFIG_HWMON_VID=m
> # CONFIG_HWMON_DEBUG_CHIP is not set
> 
> #
> # Native drivers
> #
> CONFIG_SENSORS_ABITUGURU=m
> CONFIG_SENSORS_ABITUGURU3=m
> # CONFIG_SENSORS_AD7314 is not set
> # CONFIG_SENSORS_AD7414 is not set
> CONFIG_SENSORS_AD7418=m
> CONFIG_SENSORS_ADCXX=m
> CONFIG_SENSORS_ADM1021=m
> # CONFIG_SENSORS_ADM1025 is not set
> # CONFIG_SENSORS_ADM1026 is not set
> CONFIG_SENSORS_ADM1029=m
> CONFIG_SENSORS_ADM1031=m
> # CONFIG_SENSORS_ADM9240 is not set
> # CONFIG_SENSORS_ADT7410 is not set
> # CONFIG_SENSORS_ADT7411 is not set
> CONFIG_SENSORS_ADT7462=m
> # CONFIG_SENSORS_ADT7470 is not set
> CONFIG_SENSORS_ADT7475=m
> # CONFIG_SENSORS_ASC7621 is not set
> # CONFIG_SENSORS_K8TEMP is not set
> CONFIG_SENSORS_K10TEMP=m
> # CONFIG_SENSORS_FAM15H_POWER is not set
> # CONFIG_SENSORS_ASB100 is not set
> # CONFIG_SENSORS_ATXP1 is not set
> CONFIG_SENSORS_DS620=m
> # CONFIG_SENSORS_DS1621 is not set
> CONFIG_SENSORS_I5K_AMB=m
> CONFIG_SENSORS_F71805F=m
> CONFIG_SENSORS_F71882FG=m
> CONFIG_SENSORS_F75375S=m
> CONFIG_SENSORS_FSCHMD=m
> # CONFIG_SENSORS_G760A is not set
> CONFIG_SENSORS_GL518SM=m
> # CONFIG_SENSORS_GL520SM is not set
> CONFIG_SENSORS_HIH6130=m
> # CONFIG_SENSORS_CORETEMP is not set
> CONFIG_SENSORS_IT87=m
> # CONFIG_SENSORS_JC42 is not set
> # CONFIG_SENSORS_LINEAGE is not set
> # CONFIG_SENSORS_LM63 is not set
> CONFIG_SENSORS_LM70=m
> # CONFIG_SENSORS_LM73 is not set
> # CONFIG_SENSORS_LM75 is not set
> # CONFIG_SENSORS_LM77 is not set
> CONFIG_SENSORS_LM78=m
> # CONFIG_SENSORS_LM80 is not set
> # CONFIG_SENSORS_LM83 is not set
> CONFIG_SENSORS_LM85=m
> CONFIG_SENSORS_LM87=m
> CONFIG_SENSORS_LM90=m
> # CONFIG_SENSORS_LM92 is not set
> # CONFIG_SENSORS_LM93 is not set
> CONFIG_SENSORS_LTC4151=m
> CONFIG_SENSORS_LTC4215=m
> CONFIG_SENSORS_LTC4245=m
> CONFIG_SENSORS_LTC4261=m
> CONFIG_SENSORS_LM95241=m
> # CONFIG_SENSORS_LM95245 is not set
> CONFIG_SENSORS_MAX1111=m
> CONFIG_SENSORS_MAX16065=m
> # CONFIG_SENSORS_MAX1619 is not set
> CONFIG_SENSORS_MAX1668=m
> CONFIG_SENSORS_MAX197=m
> # CONFIG_SENSORS_MAX6639 is not set
> # CONFIG_SENSORS_MAX6642 is not set
> # CONFIG_SENSORS_MAX6650 is not set
> # CONFIG_SENSORS_MCP3021 is not set
> CONFIG_SENSORS_NTC_THERMISTOR=m
> # CONFIG_SENSORS_PC87360 is not set
> # CONFIG_SENSORS_PC87427 is not set
> # CONFIG_SENSORS_PCF8591 is not set
> CONFIG_PMBUS=m
> CONFIG_SENSORS_PMBUS=m
> # CONFIG_SENSORS_ADM1275 is not set
> # CONFIG_SENSORS_LM25066 is not set
> # CONFIG_SENSORS_LTC2978 is not set
> CONFIG_SENSORS_MAX16064=m
> # CONFIG_SENSORS_MAX34440 is not set
> CONFIG_SENSORS_MAX8688=m
> CONFIG_SENSORS_UCD9000=m
> CONFIG_SENSORS_UCD9200=m
> # CONFIG_SENSORS_ZL6100 is not set
> # CONFIG_SENSORS_SHT21 is not set
> # CONFIG_SENSORS_SIS5595 is not set
> CONFIG_SENSORS_SMM665=m
> CONFIG_SENSORS_DME1737=m
> # CONFIG_SENSORS_EMC1403 is not set
> # CONFIG_SENSORS_EMC2103 is not set
> # CONFIG_SENSORS_EMC6W201 is not set
> CONFIG_SENSORS_SMSC47M1=m
> CONFIG_SENSORS_SMSC47M192=m
> CONFIG_SENSORS_SMSC47B397=m
> # CONFIG_SENSORS_SCH56XX_COMMON is not set
> # CONFIG_SENSORS_ADS1015 is not set
> # CONFIG_SENSORS_ADS7828 is not set
> # CONFIG_SENSORS_ADS7871 is not set
> # CONFIG_SENSORS_AMC6821 is not set
> CONFIG_SENSORS_INA2XX=m
> # CONFIG_SENSORS_THMC50 is not set
> # CONFIG_SENSORS_TMP102 is not set
> CONFIG_SENSORS_TMP401=m
> # CONFIG_SENSORS_TMP421 is not set
> # CONFIG_SENSORS_VIA_CPUTEMP is not set
> # CONFIG_SENSORS_VIA686A is not set
> CONFIG_SENSORS_VT1211=m
> CONFIG_SENSORS_VT8231=m
> # CONFIG_SENSORS_W83781D is not set
> # CONFIG_SENSORS_W83791D is not set
> # CONFIG_SENSORS_W83792D is not set
> CONFIG_SENSORS_W83793=m
> CONFIG_SENSORS_W83795=m
> CONFIG_SENSORS_W83795_FANCTRL=y
> # CONFIG_SENSORS_W83L785TS is not set
> # CONFIG_SENSORS_W83L786NG is not set
> # CONFIG_SENSORS_W83627HF is not set
> CONFIG_SENSORS_W83627EHF=m
> CONFIG_SENSORS_WM831X=m
> # CONFIG_SENSORS_APPLESMC is not set
> 
> #
> # ACPI drivers
> #
> # CONFIG_SENSORS_ACPI_POWER is not set
> # CONFIG_SENSORS_ATK0110 is not set
> CONFIG_THERMAL=y
> # CONFIG_WATCHDOG is not set
> CONFIG_SSB_POSSIBLE=y
> 
> #
> # Sonics Silicon Backplane
> #
> # CONFIG_SSB is not set
> CONFIG_BCMA_POSSIBLE=y
> 
> #
> # Broadcom specific AMBA
> #
> CONFIG_BCMA=m
> CONFIG_BCMA_HOST_PCI_POSSIBLE=y
> CONFIG_BCMA_HOST_PCI=y
> # CONFIG_BCMA_DRIVER_GMAC_CMN is not set
> # CONFIG_BCMA_DEBUG is not set
> 
> #
> # Multifunction device drivers
> #
> CONFIG_MFD_CORE=y
> # CONFIG_MFD_SM501 is not set
> CONFIG_HTC_PASIC3=m
> CONFIG_MFD_LM3533=m
> # CONFIG_TPS6105X is not set
> # CONFIG_TPS6507X is not set
> CONFIG_MFD_TPS65217=m
> # CONFIG_MFD_STMPE is not set
> # CONFIG_MFD_TMIO is not set
> # CONFIG_MFD_DA9052_SPI is not set
> CONFIG_MFD_ARIZONA=y
> CONFIG_MFD_ARIZONA_I2C=m
> # CONFIG_MFD_ARIZONA_SPI is not set
> CONFIG_MFD_WM5102=y
> # CONFIG_MFD_WM5110 is not set
> CONFIG_MFD_WM831X=y
> CONFIG_MFD_WM831X_SPI=y
> # CONFIG_MFD_PCF50633 is not set
> # CONFIG_MFD_MC13XXX_SPI is not set
> # CONFIG_MFD_MC13XXX_I2C is not set
> # CONFIG_ABX500_CORE is not set
> # CONFIG_EZX_PCAP is not set
> # CONFIG_MFD_CS5535 is not set
> # CONFIG_LPC_SCH is not set
> # CONFIG_LPC_ICH is not set
> # CONFIG_MFD_RDC321X is not set
> CONFIG_MFD_JANZ_CMODIO=m
> CONFIG_MFD_VX855=m
> # CONFIG_MFD_WL1273_CORE is not set
> # CONFIG_REGULATOR is not set
> # CONFIG_MEDIA_SUPPORT is not set
> 
> #
> # Graphics support
> #
> # CONFIG_AGP is not set
> CONFIG_VGA_ARB=y
> CONFIG_VGA_ARB_MAX_GPUS=16
> # CONFIG_VGA_SWITCHEROO is not set
> # CONFIG_DRM is not set
> CONFIG_STUB_POULSBO=m
> CONFIG_VGASTATE=m
> CONFIG_VIDEO_OUTPUT_CONTROL=m
> CONFIG_FB=m
> # CONFIG_FIRMWARE_EDID is not set
> CONFIG_FB_DDC=m
> # CONFIG_FB_BOOT_VESA_SUPPORT is not set
> CONFIG_FB_CFB_FILLRECT=m
> CONFIG_FB_CFB_COPYAREA=m
> CONFIG_FB_CFB_IMAGEBLIT=m
> # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
> CONFIG_FB_SYS_FILLRECT=m
> CONFIG_FB_SYS_COPYAREA=m
> CONFIG_FB_SYS_IMAGEBLIT=m
> # CONFIG_FB_FOREIGN_ENDIAN is not set
> CONFIG_FB_SYS_FOPS=m
> # CONFIG_FB_WMT_GE_ROPS is not set
> CONFIG_FB_DEFERRED_IO=y
> CONFIG_FB_SVGALIB=m
> # CONFIG_FB_MACMODES is not set
> CONFIG_FB_BACKLIGHT=y
> CONFIG_FB_MODE_HELPERS=y
> CONFIG_FB_TILEBLITTING=y
> 
> #
> # Frame buffer hardware drivers
> #
> # CONFIG_FB_CIRRUS is not set
> # CONFIG_FB_PM2 is not set
> # CONFIG_FB_CYBER2000 is not set
> # CONFIG_FB_ARC is not set
> # CONFIG_FB_VGA16 is not set
> # CONFIG_FB_N411 is not set
> # CONFIG_FB_HGA is not set
> CONFIG_FB_S1D13XXX=m
> # CONFIG_FB_NVIDIA is not set
> CONFIG_FB_RIVA=m
> # CONFIG_FB_RIVA_I2C is not set
> CONFIG_FB_RIVA_DEBUG=y
> CONFIG_FB_RIVA_BACKLIGHT=y
> CONFIG_FB_I740=m
> CONFIG_FB_LE80578=m
> # CONFIG_FB_CARILLO_RANCH is not set
> CONFIG_FB_MATROX=m
> # CONFIG_FB_MATROX_MILLENIUM is not set
> CONFIG_FB_MATROX_MYSTIQUE=y
> # CONFIG_FB_MATROX_G is not set
> # CONFIG_FB_MATROX_I2C is not set
> CONFIG_FB_RADEON=m
> # CONFIG_FB_RADEON_I2C is not set
> CONFIG_FB_RADEON_BACKLIGHT=y
> CONFIG_FB_RADEON_DEBUG=y
> # CONFIG_FB_ATY128 is not set
> CONFIG_FB_ATY=m
> # CONFIG_FB_ATY_CT is not set
> # CONFIG_FB_ATY_GX is not set
> CONFIG_FB_ATY_BACKLIGHT=y
> CONFIG_FB_S3=m
> CONFIG_FB_S3_DDC=y
> # CONFIG_FB_SAVAGE is not set
> CONFIG_FB_SIS=m
> # CONFIG_FB_SIS_300 is not set
> CONFIG_FB_SIS_315=y
> # CONFIG_FB_VIA is not set
> CONFIG_FB_NEOMAGIC=m
> CONFIG_FB_KYRO=m
> CONFIG_FB_3DFX=m
> # CONFIG_FB_3DFX_ACCEL is not set
> # CONFIG_FB_3DFX_I2C is not set
> CONFIG_FB_VOODOO1=m
> # CONFIG_FB_VT8623 is not set
> # CONFIG_FB_TRIDENT is not set
> # CONFIG_FB_ARK is not set
> CONFIG_FB_PM3=m
> # CONFIG_FB_CARMINE is not set
> CONFIG_FB_GEODE=y
> CONFIG_FB_GEODE_LX=m
> # CONFIG_FB_GEODE_GX is not set
> CONFIG_FB_GEODE_GX1=m
> CONFIG_FB_TMIO=m
> CONFIG_FB_TMIO_ACCELL=y
> # CONFIG_FB_VIRTUAL is not set
> # CONFIG_XEN_FBDEV_FRONTEND is not set
> CONFIG_FB_METRONOME=m
> CONFIG_FB_MB862XX=m
> CONFIG_FB_MB862XX_PCI_GDC=y
> # CONFIG_FB_MB862XX_I2C is not set
> # CONFIG_FB_BROADSHEET is not set
> CONFIG_FB_AUO_K190X=m
> CONFIG_FB_AUO_K1900=m
> CONFIG_FB_AUO_K1901=m
> # CONFIG_EXYNOS_VIDEO is not set
> CONFIG_BACKLIGHT_LCD_SUPPORT=y
> # CONFIG_LCD_CLASS_DEVICE is not set
> CONFIG_BACKLIGHT_CLASS_DEVICE=m
> CONFIG_BACKLIGHT_GENERIC=m
> # CONFIG_BACKLIGHT_LM3533 is not set
> CONFIG_BACKLIGHT_PWM=m
> # CONFIG_BACKLIGHT_APPLE is not set
> CONFIG_BACKLIGHT_SAHARA=m
> # CONFIG_BACKLIGHT_WM831X is not set
> # CONFIG_BACKLIGHT_ADP8860 is not set
> CONFIG_BACKLIGHT_ADP8870=m
> # CONFIG_BACKLIGHT_LM3630 is not set
> CONFIG_BACKLIGHT_LM3639=m
> CONFIG_BACKLIGHT_LP855X=m
> # CONFIG_BACKLIGHT_TPS65217 is not set
> 
> #
> # Console display driver support
> #
> CONFIG_VGA_CONSOLE=y
> # CONFIG_VGACON_SOFT_SCROLLBACK is not set
> CONFIG_DUMMY_CONSOLE=y
> # CONFIG_FRAMEBUFFER_CONSOLE is not set
> # CONFIG_LOGO is not set
> CONFIG_SOUND=m
> CONFIG_SOUND_OSS_CORE=y
> # CONFIG_SOUND_OSS_CORE_PRECLAIM is not set
> CONFIG_SND=m
> CONFIG_SND_TIMER=m
> CONFIG_SND_PCM=m
> CONFIG_SND_SEQUENCER=m
> # CONFIG_SND_SEQ_DUMMY is not set
> CONFIG_SND_OSSEMUL=y
> # CONFIG_SND_MIXER_OSS is not set
> CONFIG_SND_PCM_OSS=m
> CONFIG_SND_PCM_OSS_PLUGINS=y
> # CONFIG_SND_SEQUENCER_OSS is not set
> CONFIG_SND_RTCTIMER=m
> CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y
> CONFIG_SND_DYNAMIC_MINORS=y
> # CONFIG_SND_SUPPORT_OLD_API is not set
> CONFIG_SND_VERBOSE_PROCFS=y
> CONFIG_SND_VERBOSE_PRINTK=y
> # CONFIG_SND_DEBUG is not set
> CONFIG_SND_DMA_SGBUF=y
> # CONFIG_SND_RAWMIDI_SEQ is not set
> # CONFIG_SND_OPL3_LIB_SEQ is not set
> # CONFIG_SND_OPL4_LIB_SEQ is not set
> # CONFIG_SND_SBAWE_SEQ is not set
> # CONFIG_SND_EMU10K1_SEQ is not set
> # CONFIG_SND_DRIVERS is not set
> # CONFIG_SND_PCI is not set
> # CONFIG_SND_SPI is not set
> CONFIG_SND_FIREWIRE=y
> CONFIG_SND_FIREWIRE_LIB=m
> # CONFIG_SND_FIREWIRE_SPEAKERS is not set
> CONFIG_SND_ISIGHT=m
> # CONFIG_SND_PCMCIA is not set
> # CONFIG_SND_SOC is not set
> CONFIG_SOUND_PRIME=m
> CONFIG_SOUND_OSS=m
> CONFIG_SOUND_TRACEINIT=y
> CONFIG_SOUND_DMAP=y
> # CONFIG_SOUND_VMIDI is not set
> CONFIG_SOUND_TRIX=m
> # CONFIG_SOUND_MSS is not set
> # CONFIG_SOUND_MPU401 is not set
> # CONFIG_SOUND_PAS is not set
> # CONFIG_SOUND_PSS is not set
> CONFIG_SOUND_SB=m
> CONFIG_SOUND_YM3812=m
> # CONFIG_SOUND_UART6850 is not set
> # CONFIG_SOUND_AEDSP16 is not set
> CONFIG_SOUND_KAHLUA=m
> 
> #
> # HID support
> #
> CONFIG_HID=m
> CONFIG_HIDRAW=y
> CONFIG_UHID=m
> CONFIG_HID_GENERIC=m
> 
> #
> # Special HID drivers
> #
> CONFIG_USB_ARCH_HAS_OHCI=y
> CONFIG_USB_ARCH_HAS_EHCI=y
> CONFIG_USB_ARCH_HAS_XHCI=y
> CONFIG_USB_SUPPORT=y
> CONFIG_USB_ARCH_HAS_HCD=y
> # CONFIG_USB is not set
> # CONFIG_USB_HCD_BCMA is not set
> 
> #
> # NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
> #
> # CONFIG_USB_EZUSB_FX2 is not set
> # CONFIG_OMAP_USB2 is not set
> # CONFIG_USB_GADGET is not set
> 
> #
> # OTG and related infrastructure
> #
> CONFIG_UWB=m
> # CONFIG_UWB_WHCI is not set
> CONFIG_MMC=m
> # CONFIG_MMC_DEBUG is not set
> CONFIG_MMC_UNSAFE_RESUME=y
> CONFIG_MMC_CLKGATE=y
> 
> #
> # MMC/SD/SDIO Card Drivers
> #
> # CONFIG_MMC_BLOCK is not set
> # CONFIG_SDIO_UART is not set
> CONFIG_MMC_TEST=m
> 
> #
> # MMC/SD/SDIO Host Controller Drivers
> #
> # CONFIG_MMC_SDHCI is not set
> # CONFIG_MMC_WBSD is not set
> CONFIG_MMC_TIFM_SD=m
> CONFIG_MMC_SPI=m
> CONFIG_MMC_SDRICOH_CS=m
> # CONFIG_MMC_CB710 is not set
> # CONFIG_MMC_VIA_SDMMC is not set
> CONFIG_MEMSTICK=m
> CONFIG_MEMSTICK_DEBUG=y
> 
> #
> # MemoryStick drivers
> #
> # CONFIG_MEMSTICK_UNSAFE_RESUME is not set
> # CONFIG_MSPRO_BLOCK is not set
> 
> #
> # MemoryStick Host Controller Drivers
> #
> CONFIG_MEMSTICK_TIFM_MS=m
> CONFIG_MEMSTICK_JMICRON_38X=m
> CONFIG_MEMSTICK_R592=m
> CONFIG_NEW_LEDS=y
> CONFIG_LEDS_CLASS=m
> 
> #
> # LED drivers
> #
> CONFIG_LEDS_LM3530=m
> CONFIG_LEDS_LM3533=m
> CONFIG_LEDS_LM3642=m
> # CONFIG_LEDS_PCA9532 is not set
> # CONFIG_LEDS_LP3944 is not set
> CONFIG_LEDS_LP5521=m
> # CONFIG_LEDS_LP5523 is not set
> CONFIG_LEDS_CLEVO_MAIL=m
> # CONFIG_LEDS_PCA955X is not set
> # CONFIG_LEDS_PCA9633 is not set
> CONFIG_LEDS_WM831X_STATUS=m
> # CONFIG_LEDS_DAC124S085 is not set
> # CONFIG_LEDS_BD2802 is not set
> # CONFIG_LEDS_INTEL_SS4200 is not set
> CONFIG_LEDS_TCA6507=m
> # CONFIG_LEDS_LM355x is not set
> CONFIG_LEDS_OT200=m
> CONFIG_LEDS_BLINKM=m
> # CONFIG_LEDS_TRIGGERS is not set
> 
> #
> # LED Triggers
> #
> CONFIG_ACCESSIBILITY=y
> # CONFIG_A11Y_BRAILLE_CONSOLE is not set
> CONFIG_INFINIBAND=m
> CONFIG_INFINIBAND_USER_MAD=m
> CONFIG_INFINIBAND_USER_ACCESS=m
> CONFIG_INFINIBAND_USER_MEM=y
> # CONFIG_INFINIBAND_MTHCA is not set
> # CONFIG_INFINIBAND_QIB is not set
> # CONFIG_INFINIBAND_SRP is not set
> # CONFIG_INFINIBAND_SRPT is not set
> # CONFIG_EDAC is not set
> # CONFIG_RTC_CLASS is not set
> # CONFIG_DMADEVICES is not set
> CONFIG_AUXDISPLAY=y
> CONFIG_UIO=m
> CONFIG_UIO_CIF=m
> # CONFIG_UIO_PDRV is not set
> CONFIG_UIO_PDRV_GENIRQ=m
> CONFIG_UIO_AEC=m
> # CONFIG_UIO_SERCOS3 is not set
> # CONFIG_UIO_PCI_GENERIC is not set
> # CONFIG_UIO_NETX is not set
> CONFIG_VIRTIO=m
> 
> #
> # Virtio drivers
> #
> CONFIG_VIRTIO_PCI=m
> CONFIG_VIRTIO_BALLOON=m
> CONFIG_VIRTIO_MMIO=m
> CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
> 
> #
> # Microsoft Hyper-V guest support
> #
> # CONFIG_HYPERV is not set
> 
> #
> # Xen driver support
> #
> # CONFIG_XEN_BALLOON is not set
> CONFIG_XEN_DEV_EVTCHN=m
> CONFIG_XEN_BACKEND=y
> CONFIG_XENFS=m
> # CONFIG_XEN_COMPAT_XENFS is not set
> # CONFIG_XEN_SYS_HYPERVISOR is not set
> CONFIG_XEN_XENBUS_FRONTEND=y
> CONFIG_XEN_GNTDEV=m
> CONFIG_XEN_GRANT_DEV_ALLOC=m
> CONFIG_SWIOTLB_XEN=y
> CONFIG_XEN_TMEM=y
> CONFIG_XEN_PCIDEV_BACKEND=m
> CONFIG_XEN_PRIVCMD=m
> # CONFIG_XEN_MCE_LOG is not set
> CONFIG_STAGING=y
> # CONFIG_SLICOSS is not set
> CONFIG_ECHO=m
> # CONFIG_COMEDI is not set
> # CONFIG_PANEL is not set
> # CONFIG_RTS_PSTOR is not set
> CONFIG_DX_SEP=m
> 
> #
> # IIO staging drivers
> #
> CONFIG_IIO_ST_HWMON=m
> CONFIG_IIO_SW_RING=m
> 
> #
> # Accelerometers
> #
> # CONFIG_ADIS16201 is not set
> CONFIG_ADIS16203=m
> CONFIG_ADIS16204=m
> CONFIG_ADIS16209=m
> CONFIG_ADIS16220=m
> # CONFIG_ADIS16240 is not set
> CONFIG_KXSD9=m
> CONFIG_SCA3000=m
> 
> #
> # Analog to digital converters
> #
> # CONFIG_AD7291 is not set
> # CONFIG_AD7298 is not set
> # CONFIG_AD799X is not set
> # CONFIG_AD7887 is not set
> # CONFIG_AD7793 is not set
> CONFIG_AD7192=m
> CONFIG_ADT7310=m
> CONFIG_ADT7410=m
> # CONFIG_AD7280 is not set
> CONFIG_MAX1363=m
> CONFIG_MAX1363_RING_BUFFER=y
> 
> #
> # Analog digital bi-direction converters
> #
> 
> #
> # Capacitance to digital converters
> #
> # CONFIG_AD7150 is not set
> # CONFIG_AD7152 is not set
> # CONFIG_AD7746 is not set
> 
> #
> # Direct Digital Synthesis
> #
> CONFIG_AD5930=m
> CONFIG_AD9832=m
> CONFIG_AD9834=m
> # CONFIG_AD9850 is not set
> CONFIG_AD9852=m
> CONFIG_AD9910=m
> # CONFIG_AD9951 is not set
> 
> #
> # Digital gyroscope sensors
> #
> CONFIG_ADIS16060=m
> CONFIG_ADIS16080=m
> CONFIG_ADIS16130=m
> # CONFIG_ADIS16260 is not set
> # CONFIG_ADXRS450 is not set
> 
> #
> # Network Analyzer, Impedance Converters
> #
> # CONFIG_AD5933 is not set
> 
> #
> # Inertial measurement units
> #
> # CONFIG_ADIS16400 is not set
> 
> #
> # Light sensors
> #
> # CONFIG_SENSORS_ISL29018 is not set
> CONFIG_SENSORS_ISL29028=m
> # CONFIG_SENSORS_TSL2563 is not set
> # CONFIG_TSL2583 is not set
> CONFIG_TSL2x7x=m
> 
> #
> # Magnetometer sensors
> #
> CONFIG_SENSORS_HMC5843=m
> 
> #
> # Active energy metering IC
> #
> # CONFIG_ADE7753 is not set
> CONFIG_ADE7754=m
> # CONFIG_ADE7758 is not set
> CONFIG_ADE7759=m
> CONFIG_ADE7854=m
> CONFIG_ADE7854_I2C=m
> # CONFIG_ADE7854_SPI is not set
> 
> #
> # Resolver to digital converters
> #
> CONFIG_AD2S90=m
> 
> #
> # Triggers - standalone
> #
> CONFIG_IIO_SYSFS_TRIGGER=m
> # CONFIG_IIO_SIMPLE_DUMMY is not set
> # CONFIG_ZSMALLOC is not set
> # CONFIG_FB_SM7XX is not set
> # CONFIG_CRYSTALHD is not set
> # CONFIG_FB_XGI is not set
> # CONFIG_ACPI_QUICKSTART is not set
> # CONFIG_FT1000 is not set
> 
> #
> # Speakup console speech
> #
> CONFIG_SPEAKUP=m
> CONFIG_SPEAKUP_SYNTH_ACNTSA=m
> CONFIG_SPEAKUP_SYNTH_ACNTPC=m
> # CONFIG_SPEAKUP_SYNTH_APOLLO is not set
> # CONFIG_SPEAKUP_SYNTH_AUDPTR is not set
> CONFIG_SPEAKUP_SYNTH_BNS=m
> CONFIG_SPEAKUP_SYNTH_DECTLK=m
> # CONFIG_SPEAKUP_SYNTH_DECEXT is not set
> # CONFIG_SPEAKUP_SYNTH_DECPC is not set
> # CONFIG_SPEAKUP_SYNTH_DTLK is not set
> # CONFIG_SPEAKUP_SYNTH_KEYPC is not set
> # CONFIG_SPEAKUP_SYNTH_LTLK is not set
> CONFIG_SPEAKUP_SYNTH_SOFT=m
> CONFIG_SPEAKUP_SYNTH_SPKOUT=m
> # CONFIG_SPEAKUP_SYNTH_TXPRT is not set
> CONFIG_SPEAKUP_SYNTH_DUMMY=m
> CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4=m
> CONFIG_STAGING_MEDIA=y
> 
> #
> # Android
> #
> # CONFIG_ANDROID is not set
> # CONFIG_PHONE is not set
> CONFIG_IPACK_BUS=m
> CONFIG_BOARD_TPCI200=m
> CONFIG_SERIAL_IPOCTAL=m
> # CONFIG_WIMAX_GDM72XX is not set
> # CONFIG_NET_VENDOR_SILICOM is not set
> CONFIG_DGRP=m
> # CONFIG_X86_PLATFORM_DEVICES is not set
> 
> #
> # Hardware Spinlock drivers
> #
> CONFIG_CLKEVT_I8253=y
> CONFIG_I8253_LOCK=y
> CONFIG_CLKBLD_I8253=y
> # CONFIG_IOMMU_SUPPORT is not set
> 
> #
> # Remoteproc drivers (EXPERIMENTAL)
> #
> CONFIG_REMOTEPROC=m
> CONFIG_STE_MODEM_RPROC=m
> 
> #
> # Rpmsg drivers (EXPERIMENTAL)
> #
> CONFIG_VIRT_DRIVERS=y
> CONFIG_PM_DEVFREQ=y
> 
> #
> # DEVFREQ Governors
> #
> # CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND is not set
> # CONFIG_DEVFREQ_GOV_PERFORMANCE is not set
> CONFIG_DEVFREQ_GOV_POWERSAVE=y
> # CONFIG_DEVFREQ_GOV_USERSPACE is not set
> 
> #
> # DEVFREQ Drivers
> #
> # CONFIG_EXTCON is not set
> # CONFIG_MEMORY is not set
> CONFIG_IIO=m
> CONFIG_IIO_BUFFER=y
> CONFIG_IIO_KFIFO_BUF=m
> CONFIG_IIO_TRIGGERED_BUFFER=m
> CONFIG_IIO_TRIGGER=y
> CONFIG_IIO_CONSUMERS_PER_TRIGGER=2
> 
> #
> # Accelerometers
> #
> 
> #
> # Analog to digital converters
> #
> CONFIG_AD_SIGMA_DELTA=m
> # CONFIG_AD7266 is not set
> CONFIG_AD7791=m
> # CONFIG_AD7476 is not set
> 
> #
> # Amplifiers
> #
> # CONFIG_AD8366 is not set
> 
> #
> # Light sensors
> #
> CONFIG_ADJD_S311=m
> CONFIG_SENSORS_LM3533=m
> CONFIG_VCNL4000=m
> 
> #
> # Frequency Synthesizers DDS/PLL
> #
> 
> #
> # Clock Generator/Distribution
> #
> # CONFIG_AD9523 is not set
> 
> #
> # Phase-Locked Loop (PLL) frequency synthesizers
> #
> # CONFIG_ADF4350 is not set
> 
> #
> # Digital to analog converters
> #
> # CONFIG_AD5064 is not set
> CONFIG_AD5360=m
> CONFIG_AD5380=m
> # CONFIG_AD5421 is not set
> # CONFIG_AD5624R_SPI is not set
> # CONFIG_AD5446 is not set
> # CONFIG_AD5504 is not set
> # CONFIG_AD5755 is not set
> # CONFIG_AD5764 is not set
> # CONFIG_AD5791 is not set
> CONFIG_AD5686=m
> # CONFIG_MAX517 is not set
> CONFIG_MCP4725=m
> 
> #
> # Hid Sensor IIO Common
> #
> 
> #
> # Digital gyroscope sensors
> #
> 
> #
> # Magnetometer sensors
> #
> # CONFIG_VME_BUS is not set
> CONFIG_PWM=y
> 
> #
> # Firmware Drivers
> #
> CONFIG_EDD=m
> # CONFIG_EDD_OFF is not set
> CONFIG_FIRMWARE_MEMMAP=y
> CONFIG_DELL_RBU=m
> # CONFIG_DCDBAS is not set
> # CONFIG_DMIID is not set
> CONFIG_DMI_SYSFS=m
> # CONFIG_ISCSI_IBFT_FIND is not set
> # CONFIG_GOOGLE_FIRMWARE is not set
> 
> #
> # File systems
> #
> CONFIG_DCACHE_WORD_ACCESS=y
> # CONFIG_EXT2_FS is not set
> CONFIG_EXT3_FS=m
> # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
> CONFIG_EXT3_FS_XATTR=y
> CONFIG_EXT3_FS_POSIX_ACL=y
> # CONFIG_EXT3_FS_SECURITY is not set
> # CONFIG_EXT4_FS is not set
> CONFIG_JBD=m
> CONFIG_JBD_DEBUG=y
> CONFIG_FS_MBCACHE=m
> CONFIG_REISERFS_FS=m
> CONFIG_REISERFS_CHECK=y
> # CONFIG_REISERFS_PROC_INFO is not set
> CONFIG_REISERFS_FS_XATTR=y
> CONFIG_REISERFS_FS_POSIX_ACL=y
> # CONFIG_REISERFS_FS_SECURITY is not set
> # CONFIG_JFS_FS is not set
> CONFIG_XFS_FS=m
> CONFIG_XFS_QUOTA=y
> CONFIG_XFS_POSIX_ACL=y
> # CONFIG_XFS_RT is not set
> # CONFIG_XFS_DEBUG is not set
> # CONFIG_GFS2_FS is not set
> # CONFIG_OCFS2_FS is not set
> # CONFIG_BTRFS_FS is not set
> # CONFIG_NILFS2_FS is not set
> CONFIG_FS_POSIX_ACL=y
> CONFIG_EXPORTFS=m
> CONFIG_FILE_LOCKING=y
> CONFIG_FSNOTIFY=y
> CONFIG_DNOTIFY=y
> CONFIG_INOTIFY_USER=y
> # CONFIG_FANOTIFY is not set
> CONFIG_QUOTA=y
> CONFIG_QUOTA_NETLINK_INTERFACE=y
> CONFIG_PRINT_QUOTA_WARNING=y
> # CONFIG_QUOTA_DEBUG is not set
> # CONFIG_QFMT_V1 is not set
> # CONFIG_QFMT_V2 is not set
> CONFIG_QUOTACTL=y
> CONFIG_AUTOFS4_FS=m
> # CONFIG_FUSE_FS is not set
> CONFIG_GENERIC_ACL=y
> 
> #
> # Caches
> #
> # CONFIG_FSCACHE is not set
> 
> #
> # CD-ROM/DVD Filesystems
> #
> # CONFIG_ISO9660_FS is not set
> CONFIG_UDF_FS=m
> CONFIG_UDF_NLS=y
> 
> #
> # DOS/FAT/NT Filesystems
> #
> # CONFIG_MSDOS_FS is not set
> # CONFIG_VFAT_FS is not set
> CONFIG_NTFS_FS=m
> CONFIG_NTFS_DEBUG=y
> # CONFIG_NTFS_RW is not set
> 
> #
> # Pseudo filesystems
> #
> CONFIG_PROC_FS=y
> CONFIG_PROC_KCORE=y
> CONFIG_PROC_SYSCTL=y
> CONFIG_PROC_PAGE_MONITOR=y
> CONFIG_SYSFS=y
> CONFIG_TMPFS=y
> CONFIG_TMPFS_POSIX_ACL=y
> CONFIG_TMPFS_XATTR=y
> # CONFIG_HUGETLBFS is not set
> # CONFIG_HUGETLB_PAGE is not set
> CONFIG_CONFIGFS_FS=m
> # CONFIG_MISC_FILESYSTEMS is not set
> # CONFIG_NETWORK_FILESYSTEMS is not set
> CONFIG_NLS=y
> CONFIG_NLS_DEFAULT="iso8859-1"
> # CONFIG_NLS_CODEPAGE_437 is not set
> CONFIG_NLS_CODEPAGE_737=m
> # CONFIG_NLS_CODEPAGE_775 is not set
> CONFIG_NLS_CODEPAGE_850=m
> CONFIG_NLS_CODEPAGE_852=m
> CONFIG_NLS_CODEPAGE_855=m
> # CONFIG_NLS_CODEPAGE_857 is not set
> # CONFIG_NLS_CODEPAGE_860 is not set
> # CONFIG_NLS_CODEPAGE_861 is not set
> CONFIG_NLS_CODEPAGE_862=m
> CONFIG_NLS_CODEPAGE_863=m
> CONFIG_NLS_CODEPAGE_864=m
> # CONFIG_NLS_CODEPAGE_865 is not set
> CONFIG_NLS_CODEPAGE_866=m
> # CONFIG_NLS_CODEPAGE_869 is not set
> # CONFIG_NLS_CODEPAGE_936 is not set
> CONFIG_NLS_CODEPAGE_950=m
> # CONFIG_NLS_CODEPAGE_932 is not set
> CONFIG_NLS_CODEPAGE_949=m
> CONFIG_NLS_CODEPAGE_874=m
> CONFIG_NLS_ISO8859_8=m
> CONFIG_NLS_CODEPAGE_1250=m
> CONFIG_NLS_CODEPAGE_1251=m
> # CONFIG_NLS_ASCII is not set
> CONFIG_NLS_ISO8859_1=m
> CONFIG_NLS_ISO8859_2=m
> # CONFIG_NLS_ISO8859_3 is not set
> CONFIG_NLS_ISO8859_4=m
> # CONFIG_NLS_ISO8859_5 is not set
> CONFIG_NLS_ISO8859_6=m
> # CONFIG_NLS_ISO8859_7 is not set
> # CONFIG_NLS_ISO8859_9 is not set
> CONFIG_NLS_ISO8859_13=m
> CONFIG_NLS_ISO8859_14=m
> CONFIG_NLS_ISO8859_15=m
> CONFIG_NLS_KOI8_R=m
> CONFIG_NLS_KOI8_U=m
> # CONFIG_NLS_MAC_ROMAN is not set
> # CONFIG_NLS_MAC_CELTIC is not set
> # CONFIG_NLS_MAC_CENTEURO is not set
> CONFIG_NLS_MAC_CROATIAN=m
> CONFIG_NLS_MAC_CYRILLIC=m
> CONFIG_NLS_MAC_GAELIC=m
> CONFIG_NLS_MAC_GREEK=m
> CONFIG_NLS_MAC_ICELAND=m
> # CONFIG_NLS_MAC_INUIT is not set
> CONFIG_NLS_MAC_ROMANIAN=m
> CONFIG_NLS_MAC_TURKISH=m
> CONFIG_NLS_UTF8=m
> 
> #
> # Kernel hacking
> #
> CONFIG_TRACE_IRQFLAGS_SUPPORT=y
> CONFIG_PRINTK_TIME=y
> CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
> CONFIG_ENABLE_WARN_DEPRECATED=y
> # CONFIG_ENABLE_MUST_CHECK is not set
> CONFIG_FRAME_WARN=2048
> # CONFIG_MAGIC_SYSRQ is not set
> # CONFIG_STRIP_ASM_SYMS is not set
> # CONFIG_READABLE_ASM is not set
> # CONFIG_UNUSED_SYMBOLS is not set
> CONFIG_DEBUG_FS=y
> # CONFIG_HEADERS_CHECK is not set
> CONFIG_DEBUG_SECTION_MISMATCH=y
> CONFIG_DEBUG_KERNEL=y
> # CONFIG_DEBUG_SHIRQ is not set
> # CONFIG_LOCKUP_DETECTOR is not set
> # CONFIG_PANIC_ON_OOPS is not set
> CONFIG_PANIC_ON_OOPS_VALUE=0
> # CONFIG_DETECT_HUNG_TASK is not set
> CONFIG_SCHED_DEBUG=y
> # CONFIG_SCHEDSTATS is not set
> # CONFIG_TIMER_STATS is not set
> # CONFIG_DEBUG_OBJECTS is not set
> CONFIG_SLUB_DEBUG_ON=y
> CONFIG_SLUB_STATS=y
> CONFIG_HAVE_DEBUG_KMEMLEAK=y
> # CONFIG_DEBUG_KMEMLEAK is not set
> # CONFIG_DEBUG_RT_MUTEXES is not set
> # CONFIG_RT_MUTEX_TESTER is not set
> # CONFIG_DEBUG_SPINLOCK is not set
> # CONFIG_DEBUG_MUTEXES is not set
> # CONFIG_DEBUG_LOCK_ALLOC is not set
> # CONFIG_PROVE_LOCKING is not set
> CONFIG_SPARSE_RCU_POINTER=y
> # CONFIG_LOCK_STAT is not set
> CONFIG_DEBUG_ATOMIC_SLEEP=y
> # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
> # CONFIG_DEBUG_STACK_USAGE is not set
> # CONFIG_DEBUG_KOBJECT is not set
> CONFIG_DEBUG_BUGVERBOSE=y
> # CONFIG_DEBUG_INFO is not set
> # CONFIG_DEBUG_VM is not set
> # CONFIG_DEBUG_VIRTUAL is not set
> # CONFIG_DEBUG_WRITECOUNT is not set
> CONFIG_DEBUG_MEMORY_INIT=y
> # CONFIG_DEBUG_LIST is not set
> # CONFIG_TEST_LIST_SORT is not set
> # CONFIG_DEBUG_SG is not set
> # CONFIG_DEBUG_NOTIFIERS is not set
> # CONFIG_DEBUG_CREDENTIALS is not set
> CONFIG_ARCH_WANT_FRAME_POINTERS=y
> CONFIG_FRAME_POINTER=y
> # CONFIG_BOOT_PRINTK_DELAY is not set
> # CONFIG_RCU_TORTURE_TEST is not set
> # CONFIG_RCU_TRACE is not set
> # CONFIG_KPROBES_SANITY_TEST is not set
> # CONFIG_BACKTRACE_SELF_TEST is not set
> # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
> # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
> # CONFIG_LKDTM is not set
> # CONFIG_NOTIFIER_ERROR_INJECTION is not set
> # CONFIG_FAULT_INJECTION is not set
> # CONFIG_LATENCYTOP is not set
> # CONFIG_DEBUG_PAGEALLOC is not set
> CONFIG_USER_STACKTRACE_SUPPORT=y
> CONFIG_HAVE_FUNCTION_TRACER=y
> CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
> CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
> CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
> CONFIG_HAVE_DYNAMIC_FTRACE=y
> CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
> CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
> CONFIG_HAVE_FENTRY=y
> CONFIG_HAVE_C_RECORDMCOUNT=y
> CONFIG_TRACING_SUPPORT=y
> # CONFIG_FTRACE is not set
> # CONFIG_RBTREE_TEST is not set
> # CONFIG_INTERVAL_TREE_TEST is not set
> CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
> CONFIG_DYNAMIC_DEBUG=y
> CONFIG_DMA_API_DEBUG=y
> # CONFIG_ATOMIC64_SELFTEST is not set
> # CONFIG_SAMPLES is not set
> CONFIG_HAVE_ARCH_KGDB=y
> # CONFIG_KGDB is not set
> CONFIG_HAVE_ARCH_KMEMCHECK=y
> CONFIG_TEST_KSTRTOX=m
> # CONFIG_STRICT_DEVMEM is not set
> CONFIG_X86_VERBOSE_BOOTUP=y
> CONFIG_EARLY_PRINTK=y
> CONFIG_EARLY_PRINTK_DBGP=y
> # CONFIG_DEBUG_STACKOVERFLOW is not set
> # CONFIG_X86_PTDUMP is not set
> CONFIG_DEBUG_RODATA=y
> CONFIG_DEBUG_RODATA_TEST=y
> # CONFIG_DEBUG_SET_MODULE_RONX is not set
> # CONFIG_DEBUG_NX_TEST is not set
> # CONFIG_DEBUG_TLBFLUSH is not set
> # CONFIG_IOMMU_DEBUG is not set
> # CONFIG_IOMMU_STRESS is not set
> CONFIG_HAVE_MMIOTRACE_SUPPORT=y
> # CONFIG_X86_DECODER_SELFTEST is not set
> CONFIG_IO_DELAY_TYPE_0X80=0
> CONFIG_IO_DELAY_TYPE_0XED=1
> CONFIG_IO_DELAY_TYPE_UDELAY=2
> CONFIG_IO_DELAY_TYPE_NONE=3
> # CONFIG_IO_DELAY_0X80 is not set
> # CONFIG_IO_DELAY_0XED is not set
> CONFIG_IO_DELAY_UDELAY=y
> # CONFIG_IO_DELAY_NONE is not set
> CONFIG_DEFAULT_IO_DELAY_TYPE=2
> # CONFIG_DEBUG_BOOT_PARAMS is not set
> # CONFIG_CPA_DEBUG is not set
> # CONFIG_OPTIMIZE_INLINING is not set
> # CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
> # CONFIG_DEBUG_NMI_SELFTEST is not set
> 
> #
> # Security options
> #
> CONFIG_KEYS=y
> CONFIG_TRUSTED_KEYS=m
> # CONFIG_ENCRYPTED_KEYS is not set
> # CONFIG_KEYS_DEBUG_PROC_KEYS is not set
> CONFIG_SECURITY_DMESG_RESTRICT=y
> CONFIG_SECURITY=y
> CONFIG_SECURITYFS=y
> CONFIG_SECURITY_NETWORK=y
> # CONFIG_SECURITY_NETWORK_XFRM is not set
> CONFIG_SECURITY_PATH=y
> # CONFIG_SECURITY_TOMOYO is not set
> CONFIG_SECURITY_APPARMOR=y
> CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1
> # CONFIG_SECURITY_YAMA is not set
> CONFIG_INTEGRITY=y
> CONFIG_INTEGRITY_SIGNATURE=y
> CONFIG_IMA=y
> CONFIG_IMA_MEASURE_PCR_IDX=10
> # CONFIG_IMA_AUDIT is not set
> CONFIG_IMA_APPRAISE=y
> CONFIG_DEFAULT_SECURITY_APPARMOR=y
> # CONFIG_DEFAULT_SECURITY_DAC is not set
> CONFIG_DEFAULT_SECURITY="apparmor"
> CONFIG_CRYPTO=y
> 
> #
> # Crypto core or helper
> #
> CONFIG_CRYPTO_ALGAPI=y
> CONFIG_CRYPTO_ALGAPI2=y
> CONFIG_CRYPTO_AEAD=m
> CONFIG_CRYPTO_AEAD2=y
> CONFIG_CRYPTO_BLKCIPHER=m
> CONFIG_CRYPTO_BLKCIPHER2=y
> CONFIG_CRYPTO_HASH=y
> CONFIG_CRYPTO_HASH2=y
> CONFIG_CRYPTO_RNG=m
> CONFIG_CRYPTO_RNG2=y
> CONFIG_CRYPTO_PCOMP=m
> CONFIG_CRYPTO_PCOMP2=y
> CONFIG_CRYPTO_MANAGER=y
> CONFIG_CRYPTO_MANAGER2=y
> CONFIG_CRYPTO_USER=m
> CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
> CONFIG_CRYPTO_GF128MUL=m
> CONFIG_CRYPTO_NULL=m
> CONFIG_CRYPTO_WORKQUEUE=y
> CONFIG_CRYPTO_CRYPTD=m
> # CONFIG_CRYPTO_AUTHENC is not set
> # CONFIG_CRYPTO_TEST is not set
> CONFIG_CRYPTO_ABLK_HELPER_X86=m
> CONFIG_CRYPTO_GLUE_HELPER_X86=m
> 
> #
> # Authenticated Encryption with Associated Data
> #
> CONFIG_CRYPTO_CCM=m
> CONFIG_CRYPTO_GCM=m
> CONFIG_CRYPTO_SEQIV=m
> 
> #
> # Block modes
> #
> # CONFIG_CRYPTO_CBC is not set
> CONFIG_CRYPTO_CTR=m
> CONFIG_CRYPTO_CTS=m
> CONFIG_CRYPTO_ECB=m
> CONFIG_CRYPTO_LRW=m
> # CONFIG_CRYPTO_PCBC is not set
> CONFIG_CRYPTO_XTS=m
> 
> #
> # Hash modes
> #
> CONFIG_CRYPTO_HMAC=y
> CONFIG_CRYPTO_XCBC=m
> # CONFIG_CRYPTO_VMAC is not set
> 
> #
> # Digest
> #
> # CONFIG_CRYPTO_CRC32C is not set
> CONFIG_CRYPTO_CRC32C_INTEL=m
> CONFIG_CRYPTO_GHASH=m
> # CONFIG_CRYPTO_MD4 is not set
> CONFIG_CRYPTO_MD5=y
> CONFIG_CRYPTO_MICHAEL_MIC=m
> # CONFIG_CRYPTO_RMD128 is not set
> # CONFIG_CRYPTO_RMD160 is not set
> # CONFIG_CRYPTO_RMD256 is not set
> CONFIG_CRYPTO_RMD320=m
> CONFIG_CRYPTO_SHA1=y
> CONFIG_CRYPTO_SHA1_SSSE3=m
> CONFIG_CRYPTO_SHA256=y
> # CONFIG_CRYPTO_SHA512 is not set
> # CONFIG_CRYPTO_TGR192 is not set
> # CONFIG_CRYPTO_WP512 is not set
> # CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL is not set
> 
> #
> # Ciphers
> #
> CONFIG_CRYPTO_AES=m
> CONFIG_CRYPTO_AES_X86_64=m
> CONFIG_CRYPTO_AES_NI_INTEL=m
> CONFIG_CRYPTO_ANUBIS=m
> CONFIG_CRYPTO_ARC4=m
> CONFIG_CRYPTO_BLOWFISH=m
> CONFIG_CRYPTO_BLOWFISH_COMMON=m
> # CONFIG_CRYPTO_BLOWFISH_X86_64 is not set
> CONFIG_CRYPTO_CAMELLIA=m
> CONFIG_CRYPTO_CAMELLIA_X86_64=m
> CONFIG_CRYPTO_CAST5=m
> # CONFIG_CRYPTO_CAST5_AVX_X86_64 is not set
> CONFIG_CRYPTO_CAST6=m
> # CONFIG_CRYPTO_CAST6_AVX_X86_64 is not set
> CONFIG_CRYPTO_DES=m
> # CONFIG_CRYPTO_FCRYPT is not set
> # CONFIG_CRYPTO_KHAZAD is not set
> # CONFIG_CRYPTO_SALSA20 is not set
> CONFIG_CRYPTO_SALSA20_X86_64=m
> # CONFIG_CRYPTO_SEED is not set
> CONFIG_CRYPTO_SERPENT=m
> CONFIG_CRYPTO_SERPENT_SSE2_X86_64=m
> # CONFIG_CRYPTO_SERPENT_AVX_X86_64 is not set
> # CONFIG_CRYPTO_TEA is not set
> CONFIG_CRYPTO_TWOFISH=m
> CONFIG_CRYPTO_TWOFISH_COMMON=m
> CONFIG_CRYPTO_TWOFISH_X86_64=m
> CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=m
> CONFIG_CRYPTO_TWOFISH_AVX_X86_64=m
> 
> #
> # Compression
> #
> CONFIG_CRYPTO_DEFLATE=m
> CONFIG_CRYPTO_ZLIB=m
> # CONFIG_CRYPTO_LZO is not set
> 
> #
> # Random Number Generation
> #
> CONFIG_CRYPTO_ANSI_CPRNG=m
> CONFIG_CRYPTO_USER_API=m
> CONFIG_CRYPTO_USER_API_HASH=m
> # CONFIG_CRYPTO_USER_API_SKCIPHER is not set
> CONFIG_CRYPTO_HW=y
> # CONFIG_CRYPTO_DEV_PADLOCK is not set
> CONFIG_ASYMMETRIC_KEY_TYPE=y
> CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
> CONFIG_PUBLIC_KEY_ALGO_RSA=y
> CONFIG_X509_CERTIFICATE_PARSER=y
> CONFIG_HAVE_KVM=y
> # CONFIG_VIRTUALIZATION is not set
> # CONFIG_BINARY_PRINTF is not set
> 
> #
> # Library routines
> #
> CONFIG_BITREVERSE=y
> CONFIG_GENERIC_STRNCPY_FROM_USER=y
> CONFIG_GENERIC_STRNLEN_USER=y
> CONFIG_GENERIC_FIND_FIRST_BIT=y
> CONFIG_GENERIC_PCI_IOMAP=y
> CONFIG_GENERIC_IOMAP=y
> CONFIG_GENERIC_IO=y
> CONFIG_CRC_CCITT=m
> CONFIG_CRC16=m
> CONFIG_CRC_T10DIF=m
> CONFIG_CRC_ITU_T=m
> CONFIG_CRC32=y
> # CONFIG_CRC32_SELFTEST is not set
> CONFIG_CRC32_SLICEBY8=y
> # CONFIG_CRC32_SLICEBY4 is not set
> # CONFIG_CRC32_SARWATE is not set
> # CONFIG_CRC32_BIT is not set
> CONFIG_CRC7=m
> # CONFIG_LIBCRC32C is not set
> CONFIG_CRC8=m
> CONFIG_ZLIB_INFLATE=y
> CONFIG_ZLIB_DEFLATE=m
> CONFIG_LZO_COMPRESS=y
> CONFIG_LZO_DECOMPRESS=y
> CONFIG_XZ_DEC=y
> CONFIG_XZ_DEC_X86=y
> CONFIG_XZ_DEC_POWERPC=y
> CONFIG_XZ_DEC_IA64=y
> CONFIG_XZ_DEC_ARM=y
> CONFIG_XZ_DEC_ARMTHUMB=y
> CONFIG_XZ_DEC_SPARC=y
> CONFIG_XZ_DEC_BCJ=y
> CONFIG_XZ_DEC_TEST=m
> CONFIG_DECOMPRESS_GZIP=y
> CONFIG_DECOMPRESS_BZIP2=y
> CONFIG_DECOMPRESS_LZMA=y
> CONFIG_DECOMPRESS_XZ=y
> CONFIG_DECOMPRESS_LZO=y
> CONFIG_HAS_IOMEM=y
> CONFIG_HAS_IOPORT=y
> CONFIG_HAS_DMA=y
> CONFIG_CHECK_SIGNATURE=y
> CONFIG_DQL=y
> CONFIG_NLATTR=y
> CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
> CONFIG_AVERAGE=y
> CONFIG_CLZ_TAB=y
> # CONFIG_CORDIC is not set
> # CONFIG_DDR is not set
> CONFIG_MPILIB=y
> CONFIG_SIGNATURE=y
> CONFIG_OID_REGISTRY=y


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 22:15:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 22:15:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdpul-0001Ey-Hu; Wed, 28 Nov 2012 22:15:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1Tdpuk-0001Et-16
	for xen-devel@lists.xensource.com; Wed, 28 Nov 2012 22:15:30 +0000
Received: from [85.158.137.99:38374] by server-5.bemta-3.messagelabs.com id
	2E/C1-26311-10D86B05; Wed, 28 Nov 2012 22:15:29 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354140925!13917265!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODE1MjA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11097 invoked from network); 28 Nov 2012 22:15:27 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-9.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 28 Nov 2012 22:15:27 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qASMFK7g002804
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 28 Nov 2012 22:15:21 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qASMFIDC006558
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 28 Nov 2012 22:15:19 GMT
Received: from abhmt115.oracle.com (abhmt115.oracle.com [141.146.116.67])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qASMFFtw024811; Wed, 28 Nov 2012 16:15:15 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 28 Nov 2012 14:15:15 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id DD0DFE00B49; Wed, 28 Nov 2012 17:15:10 -0500 (EST)
Date: Wed, 28 Nov 2012 17:15:10 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: kbuild test robot <fengguang.wu@intel.com>
Message-ID: <20121128221510.GA29950@phenom.dumpdata.com>
References: <50b68452.Gqr1L/cRkHFh1xmK%fengguang.wu@intel.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50b68452.Gqr1L/cRkHFh1xmK%fengguang.wu@intel.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>, xen-devel@lists.xensource.com,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [xen:stable/for-linus-3.8 4/8]
 include/xen/interface/version.h:72:2: error: implicit declaration of
 function 'xen_domain'
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 05:38:26AM +0800, kbuild test robot wrote:
> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-linus-3.8
> head:   394b40f62d7ae18a1c48c13fc483b8193f8c3a98
> commit: 92e3229dcdc80ff0b6304f14c578d76e7e10e226 [4/8] xen/acpi: ACPI PAD driver
> config: x86_64-randconfig-x701 (attached as .config)
> 
> Note: the xen/stable/for-linus-3.8 HEAD 394b40f builds fine.
>       It only hurts bisectibility.
> 
> All error/warnings:
> 
> In file included from drivers/xen/features.c:15:0:
> include/xen/interface/version.h: In function 'xen_running_on_version_or_later':
> include/xen/interface/version.h:72:2: error: implicit declaration of function 'xen_domain' [-Werror=implicit-function-declaration]
> cc1: some warnings being treated as errors

Which are fixed a bit later by me.

> 
> vim +72 +/xen_domain include/xen/interface/version.h
> 
> 92e3229d Liu, Jinsong 2012-11-08  66  /* Check if running on Xen version (major, minor) or later */
> 92e3229d Liu, Jinsong 2012-11-08  67  static inline bool
> 92e3229d Liu, Jinsong 2012-11-08  68  xen_running_on_version_or_later(unsigned int major, unsigned int minor)
> 92e3229d Liu, Jinsong 2012-11-08  69  {
> 92e3229d Liu, Jinsong 2012-11-08  70  	unsigned int version;
> 92e3229d Liu, Jinsong 2012-11-08  71  
> 92e3229d Liu, Jinsong 2012-11-08 @72  	if (!xen_domain())
> 92e3229d Liu, Jinsong 2012-11-08  73  		return false;
> 92e3229d Liu, Jinsong 2012-11-08  74  
> 92e3229d Liu, Jinsong 2012-11-08  75  	version = HYPERVISOR_xen_version(XENVER_version, NULL);
> 
> ---
> 0-DAY kernel build testing backend         Open Source Technology Center
> Fengguang Wu, Yuanhan Liu                              Intel Corporation

> #
> # Automatically generated file; DO NOT EDIT.
> # Linux/x86_64 3.7.0-rc3 Kernel Configuration
> #
> CONFIG_64BIT=y
> CONFIG_X86_64=y
> CONFIG_X86=y
> CONFIG_INSTRUCTION_DECODER=y
> CONFIG_OUTPUT_FORMAT="elf64-x86-64"
> CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
> CONFIG_LOCKDEP_SUPPORT=y
> CONFIG_STACKTRACE_SUPPORT=y
> CONFIG_HAVE_LATENCYTOP_SUPPORT=y
> CONFIG_MMU=y
> CONFIG_NEED_DMA_MAP_STATE=y
> CONFIG_NEED_SG_DMA_LENGTH=y
> CONFIG_GENERIC_ISA_DMA=y
> CONFIG_GENERIC_BUG=y
> CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
> CONFIG_GENERIC_HWEIGHT=y
> CONFIG_ARCH_MAY_HAVE_PC_FDC=y
> CONFIG_RWSEM_XCHGADD_ALGORITHM=y
> CONFIG_GENERIC_CALIBRATE_DELAY=y
> CONFIG_ARCH_HAS_CPU_RELAX=y
> CONFIG_ARCH_HAS_DEFAULT_IDLE=y
> CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
> CONFIG_ARCH_HAS_CPU_AUTOPROBE=y
> CONFIG_HAVE_SETUP_PER_CPU_AREA=y
> CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
> CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
> CONFIG_ARCH_HIBERNATION_POSSIBLE=y
> CONFIG_ARCH_SUSPEND_POSSIBLE=y
> CONFIG_ZONE_DMA32=y
> CONFIG_AUDIT_ARCH=y
> CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
> CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
> CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11"
> CONFIG_ARCH_SUPPORTS_UPROBES=y
> CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
> CONFIG_HAVE_IRQ_WORK=y
> CONFIG_IRQ_WORK=y
> CONFIG_BUILDTIME_EXTABLE_SORT=y
> 
> #
> # General setup
> #
> CONFIG_EXPERIMENTAL=y
> CONFIG_BROKEN_ON_SMP=y
> CONFIG_INIT_ENV_ARG_LIMIT=32
> CONFIG_CROSS_COMPILE=""
> CONFIG_LOCALVERSION=""
> CONFIG_LOCALVERSION_AUTO=y
> CONFIG_HAVE_KERNEL_GZIP=y
> CONFIG_HAVE_KERNEL_BZIP2=y
> CONFIG_HAVE_KERNEL_LZMA=y
> CONFIG_HAVE_KERNEL_XZ=y
> CONFIG_HAVE_KERNEL_LZO=y
> # CONFIG_KERNEL_GZIP is not set
> CONFIG_KERNEL_BZIP2=y
> # CONFIG_KERNEL_LZMA is not set
> # CONFIG_KERNEL_XZ is not set
> # CONFIG_KERNEL_LZO is not set
> CONFIG_DEFAULT_HOSTNAME="(none)"
> # CONFIG_SWAP is not set
> # CONFIG_SYSVIPC is not set
> # CONFIG_POSIX_MQUEUE is not set
> # CONFIG_FHANDLE is not set
> CONFIG_AUDIT=y
> CONFIG_AUDITSYSCALL=y
> CONFIG_AUDIT_WATCH=y
> CONFIG_AUDIT_TREE=y
> CONFIG_AUDIT_LOGINUID_IMMUTABLE=y
> CONFIG_HAVE_GENERIC_HARDIRQS=y
> 
> #
> # IRQ subsystem
> #
> CONFIG_GENERIC_HARDIRQS=y
> CONFIG_GENERIC_IRQ_PROBE=y
> CONFIG_GENERIC_IRQ_SHOW=y
> CONFIG_IRQ_DOMAIN=y
> # CONFIG_IRQ_DOMAIN_DEBUG is not set
> CONFIG_IRQ_FORCED_THREADING=y
> CONFIG_SPARSE_IRQ=y
> CONFIG_CLOCKSOURCE_WATCHDOG=y
> CONFIG_ARCH_CLOCKSOURCE_DATA=y
> CONFIG_GENERIC_TIME_VSYSCALL=y
> CONFIG_GENERIC_CLOCKEVENTS=y
> CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
> CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
> CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
> CONFIG_GENERIC_CMOS_UPDATE=y
> 
> #
> # Timers subsystem
> #
> # CONFIG_NO_HZ is not set
> # CONFIG_HIGH_RES_TIMERS is not set
> 
> #
> # CPU/Task time and stats accounting
> #
> # CONFIG_TICK_CPU_ACCOUNTING is not set
> CONFIG_IRQ_TIME_ACCOUNTING=y
> # CONFIG_BSD_PROCESS_ACCT is not set
> CONFIG_TASKSTATS=y
> # CONFIG_TASK_DELAY_ACCT is not set
> # CONFIG_TASK_XACCT is not set
> 
> #
> # RCU Subsystem
> #
> CONFIG_TINY_RCU=y
> # CONFIG_PREEMPT_RCU is not set
> # CONFIG_TREE_RCU_TRACE is not set
> CONFIG_IKCONFIG=y
> # CONFIG_IKCONFIG_PROC is not set
> CONFIG_LOG_BUF_SHIFT=17
> CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
> CONFIG_CGROUPS=y
> CONFIG_CGROUP_DEBUG=y
> # CONFIG_CGROUP_FREEZER is not set
> CONFIG_CGROUP_DEVICE=y
> CONFIG_CPUSETS=y
> CONFIG_PROC_PID_CPUSET=y
> # CONFIG_CGROUP_CPUACCT is not set
> CONFIG_RESOURCE_COUNTERS=y
> CONFIG_MEMCG=y
> # CONFIG_MEMCG_KMEM is not set
> CONFIG_CGROUP_PERF=y
> CONFIG_CGROUP_SCHED=y
> CONFIG_FAIR_GROUP_SCHED=y
> # CONFIG_CFS_BANDWIDTH is not set
> # CONFIG_RT_GROUP_SCHED is not set
> # CONFIG_BLK_CGROUP is not set
> # CONFIG_CHECKPOINT_RESTORE is not set
> CONFIG_NAMESPACES=y
> # CONFIG_UTS_NS is not set
> CONFIG_PID_NS=y
> CONFIG_NET_NS=y
> CONFIG_SCHED_AUTOGROUP=y
> CONFIG_MM_OWNER=y
> # CONFIG_SYSFS_DEPRECATED is not set
> # CONFIG_RELAY is not set
> CONFIG_BLK_DEV_INITRD=y
> CONFIG_INITRAMFS_SOURCE=""
> CONFIG_RD_GZIP=y
> CONFIG_RD_BZIP2=y
> CONFIG_RD_LZMA=y
> CONFIG_RD_XZ=y
> CONFIG_RD_LZO=y
> CONFIG_CC_OPTIMIZE_FOR_SIZE=y
> CONFIG_SYSCTL=y
> CONFIG_ANON_INODES=y
> # CONFIG_EXPERT is not set
> # CONFIG_SYSCTL_SYSCALL is not set
> CONFIG_SYSCTL_EXCEPTION_TRACE=y
> CONFIG_KALLSYMS=y
> # CONFIG_KALLSYMS_ALL is not set
> CONFIG_HOTPLUG=y
> CONFIG_PRINTK=y
> CONFIG_BUG=y
> CONFIG_ELF_CORE=y
> CONFIG_PCSPKR_PLATFORM=y
> CONFIG_HAVE_PCSPKR_PLATFORM=y
> CONFIG_BASE_FULL=y
> CONFIG_FUTEX=y
> CONFIG_EPOLL=y
> CONFIG_SIGNALFD=y
> CONFIG_TIMERFD=y
> CONFIG_EVENTFD=y
> CONFIG_SHMEM=y
> CONFIG_AIO=y
> # CONFIG_EMBEDDED is not set
> CONFIG_HAVE_PERF_EVENTS=y
> 
> #
> # Kernel Performance Events And Counters
> #
> CONFIG_PERF_EVENTS=y
> # CONFIG_DEBUG_PERF_USE_VMALLOC is not set
> CONFIG_VM_EVENT_COUNTERS=y
> CONFIG_PCI_QUIRKS=y
> CONFIG_SLUB_DEBUG=y
> # CONFIG_COMPAT_BRK is not set
> # CONFIG_SLAB is not set
> CONFIG_SLUB=y
> CONFIG_PROFILING=y
> # CONFIG_OPROFILE is not set
> CONFIG_HAVE_OPROFILE=y
> CONFIG_OPROFILE_NMI_TIMER=y
> CONFIG_KPROBES=y
> CONFIG_JUMP_LABEL=y
> CONFIG_OPTPROBES=y
> CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
> CONFIG_KRETPROBES=y
> CONFIG_HAVE_IOREMAP_PROT=y
> CONFIG_HAVE_KPROBES=y
> CONFIG_HAVE_KRETPROBES=y
> CONFIG_HAVE_OPTPROBES=y
> CONFIG_HAVE_ARCH_TRACEHOOK=y
> CONFIG_HAVE_DMA_ATTRS=y
> CONFIG_GENERIC_SMP_IDLE_THREAD=y
> CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
> CONFIG_HAVE_DMA_API_DEBUG=y
> CONFIG_HAVE_HW_BREAKPOINT=y
> CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
> CONFIG_HAVE_USER_RETURN_NOTIFIER=y
> CONFIG_HAVE_PERF_EVENTS_NMI=y
> CONFIG_HAVE_PERF_REGS=y
> CONFIG_HAVE_PERF_USER_STACK_DUMP=y
> CONFIG_HAVE_ARCH_JUMP_LABEL=y
> CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
> CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
> CONFIG_HAVE_CMPXCHG_LOCAL=y
> CONFIG_HAVE_CMPXCHG_DOUBLE=y
> CONFIG_GENERIC_KERNEL_THREAD=y
> CONFIG_GENERIC_KERNEL_EXECVE=y
> CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
> CONFIG_HAVE_RCU_USER_QS=y
> CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
> CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
> CONFIG_MODULES_USE_ELF_RELA=y
> 
> #
> # GCOV-based kernel profiling
> #
> # CONFIG_GCOV_KERNEL is not set
> # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
> CONFIG_SLABINFO=y
> CONFIG_RT_MUTEXES=y
> CONFIG_BASE_SMALL=0
> CONFIG_MODULES=y
> # CONFIG_MODULE_FORCE_LOAD is not set
> # CONFIG_MODULE_UNLOAD is not set
> # CONFIG_MODVERSIONS is not set
> # CONFIG_MODULE_SRCVERSION_ALL is not set
> CONFIG_MODULE_SIG=y
> # CONFIG_MODULE_SIG_FORCE is not set
> # CONFIG_MODULE_SIG_SHA1 is not set
> CONFIG_MODULE_SIG_SHA224=y
> # CONFIG_MODULE_SIG_SHA256 is not set
> # CONFIG_MODULE_SIG_SHA384 is not set
> # CONFIG_MODULE_SIG_SHA512 is not set
> CONFIG_BLOCK=y
> CONFIG_BLK_DEV_BSG=y
> CONFIG_BLK_DEV_BSGLIB=y
> CONFIG_BLK_DEV_INTEGRITY=y
> 
> #
> # Partition Types
> #
> CONFIG_PARTITION_ADVANCED=y
> CONFIG_ACORN_PARTITION=y
> # CONFIG_ACORN_PARTITION_CUMANA is not set
> CONFIG_ACORN_PARTITION_EESOX=y
> # CONFIG_ACORN_PARTITION_ICS is not set
> CONFIG_ACORN_PARTITION_ADFS=y
> # CONFIG_ACORN_PARTITION_POWERTEC is not set
> CONFIG_ACORN_PARTITION_RISCIX=y
> # CONFIG_OSF_PARTITION is not set
> # CONFIG_AMIGA_PARTITION is not set
> # CONFIG_ATARI_PARTITION is not set
> # CONFIG_MAC_PARTITION is not set
> CONFIG_MSDOS_PARTITION=y
> # CONFIG_BSD_DISKLABEL is not set
> # CONFIG_MINIX_SUBPARTITION is not set
> CONFIG_SOLARIS_X86_PARTITION=y
> # CONFIG_UNIXWARE_DISKLABEL is not set
> # CONFIG_LDM_PARTITION is not set
> CONFIG_SGI_PARTITION=y
> CONFIG_ULTRIX_PARTITION=y
> CONFIG_SUN_PARTITION=y
> # CONFIG_KARMA_PARTITION is not set
> # CONFIG_EFI_PARTITION is not set
> # CONFIG_SYSV68_PARTITION is not set
> 
> #
> # IO Schedulers
> #
> CONFIG_IOSCHED_NOOP=y
> CONFIG_IOSCHED_DEADLINE=m
> CONFIG_IOSCHED_CFQ=m
> CONFIG_DEFAULT_NOOP=y
> CONFIG_DEFAULT_IOSCHED="noop"
> CONFIG_ASN1=y
> CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
> CONFIG_INLINE_READ_UNLOCK=y
> CONFIG_INLINE_READ_UNLOCK_IRQ=y
> CONFIG_INLINE_WRITE_UNLOCK=y
> CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
> CONFIG_FREEZER=y
> 
> #
> # Processor type and features
> #
> CONFIG_ZONE_DMA=y
> # CONFIG_SMP is not set
> CONFIG_X86_MPPARSE=y
> CONFIG_X86_EXTENDED_PLATFORM=y
> CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
> # CONFIG_SCHED_OMIT_FRAME_POINTER is not set
> CONFIG_PARAVIRT_GUEST=y
> CONFIG_PARAVIRT_TIME_ACCOUNTING=y
> CONFIG_XEN=y
> CONFIG_XEN_DOM0=y
> CONFIG_XEN_PRIVILEGED_GUEST=y
> CONFIG_XEN_PVHVM=y
> CONFIG_XEN_MAX_DOMAIN_MEMORY=500
> CONFIG_XEN_SAVE_RESTORE=y
> CONFIG_XEN_DEBUG_FS=y
> CONFIG_KVM_GUEST=y
> CONFIG_PARAVIRT=y
> CONFIG_PARAVIRT_CLOCK=y
> # CONFIG_PARAVIRT_DEBUG is not set
> CONFIG_NO_BOOTMEM=y
> CONFIG_MEMTEST=y
> # CONFIG_MK8 is not set
> # CONFIG_MPSC is not set
> # CONFIG_MCORE2 is not set
> # CONFIG_MATOM is not set
> CONFIG_GENERIC_CPU=y
> CONFIG_X86_INTERNODE_CACHE_SHIFT=6
> CONFIG_X86_CMPXCHG=y
> CONFIG_X86_L1_CACHE_SHIFT=6
> CONFIG_X86_XADD=y
> CONFIG_X86_WP_WORKS_OK=y
> CONFIG_X86_TSC=y
> CONFIG_X86_CMPXCHG64=y
> CONFIG_X86_CMOV=y
> CONFIG_X86_MINIMUM_CPU_FAMILY=64
> CONFIG_X86_DEBUGCTLMSR=y
> CONFIG_CPU_SUP_INTEL=y
> CONFIG_CPU_SUP_AMD=y
> CONFIG_CPU_SUP_CENTAUR=y
> CONFIG_HPET_TIMER=y
> CONFIG_HPET_EMULATE_RTC=y
> CONFIG_DMI=y
> CONFIG_GART_IOMMU=y
> CONFIG_CALGARY_IOMMU=y
> # CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT is not set
> CONFIG_SWIOTLB=y
> CONFIG_IOMMU_HELPER=y
> CONFIG_NR_CPUS=1
> CONFIG_PREEMPT_NONE=y
> # CONFIG_PREEMPT_VOLUNTARY is not set
> # CONFIG_PREEMPT is not set
> CONFIG_PREEMPT_COUNT=y
> CONFIG_X86_LOCAL_APIC=y
> CONFIG_X86_IO_APIC=y
> CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
> CONFIG_X86_MCE=y
> CONFIG_X86_MCE_INTEL=y
> CONFIG_X86_MCE_AMD=y
> CONFIG_X86_MCE_THRESHOLD=y
> # CONFIG_X86_MCE_INJECT is not set
> CONFIG_X86_THERMAL_VECTOR=y
> # CONFIG_I8K is not set
> CONFIG_MICROCODE=m
> # CONFIG_MICROCODE_INTEL is not set
> # CONFIG_MICROCODE_AMD is not set
> CONFIG_MICROCODE_OLD_INTERFACE=y
> CONFIG_X86_MSR=m
> # CONFIG_X86_CPUID is not set
> CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
> CONFIG_ARCH_DMA_ADDR_T_64BIT=y
> CONFIG_DIRECT_GBPAGES=y
> CONFIG_ARCH_SPARSEMEM_ENABLE=y
> CONFIG_ARCH_SPARSEMEM_DEFAULT=y
> CONFIG_ARCH_SELECT_MEMORY_MODEL=y
> CONFIG_ARCH_PROC_KCORE_TEXT=y
> CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
> CONFIG_SELECT_MEMORY_MODEL=y
> CONFIG_SPARSEMEM_MANUAL=y
> CONFIG_SPARSEMEM=y
> CONFIG_HAVE_MEMORY_PRESENT=y
> CONFIG_SPARSEMEM_EXTREME=y
> CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
> CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=y
> CONFIG_SPARSEMEM_VMEMMAP=y
> CONFIG_HAVE_MEMBLOCK=y
> CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
> CONFIG_ARCH_DISCARD_MEMBLOCK=y
> CONFIG_MEMORY_ISOLATION=y
> # CONFIG_MEMORY_HOTPLUG is not set
> CONFIG_PAGEFLAGS_EXTENDED=y
> CONFIG_SPLIT_PTLOCK_CPUS=4
> # CONFIG_COMPACTION is not set
> CONFIG_PHYS_ADDR_T_64BIT=y
> CONFIG_ZONE_DMA_FLAG=1
> CONFIG_BOUNCE=y
> CONFIG_VIRT_TO_BUS=y
> CONFIG_MMU_NOTIFIER=y
> CONFIG_KSM=y
> CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
> CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
> CONFIG_MEMORY_FAILURE=y
> # CONFIG_HWPOISON_INJECT is not set
> # CONFIG_TRANSPARENT_HUGEPAGE is not set
> # CONFIG_CROSS_MEMORY_ATTACH is not set
> CONFIG_NEED_PER_CPU_KM=y
> CONFIG_CLEANCACHE=y
> # CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
> CONFIG_X86_RESERVE_LOW=64
> CONFIG_MTRR=y
> CONFIG_MTRR_SANITIZER=y
> CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
> CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
> CONFIG_X86_PAT=y
> CONFIG_ARCH_USES_PG_UNCACHED=y
> CONFIG_ARCH_RANDOM=y
> CONFIG_X86_SMAP=y
> # CONFIG_EFI is not set
> # CONFIG_SECCOMP is not set
> CONFIG_CC_STACKPROTECTOR=y
> # CONFIG_HZ_100 is not set
> CONFIG_HZ_250=y
> # CONFIG_HZ_300 is not set
> # CONFIG_HZ_1000 is not set
> CONFIG_HZ=250
> # CONFIG_SCHED_HRTICK is not set
> CONFIG_KEXEC=y
> # CONFIG_CRASH_DUMP is not set
> CONFIG_PHYSICAL_START=0x1000000
> # CONFIG_RELOCATABLE is not set
> CONFIG_PHYSICAL_ALIGN=0x1000000
> # CONFIG_CMDLINE_BOOL is not set
> CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
> 
> #
> # Power management and ACPI options
> #
> # CONFIG_SUSPEND is not set
> CONFIG_HIBERNATE_CALLBACKS=y
> CONFIG_PM_SLEEP=y
> # CONFIG_PM_AUTOSLEEP is not set
> CONFIG_PM_WAKELOCKS=y
> CONFIG_PM_WAKELOCKS_LIMIT=100
> CONFIG_PM_WAKELOCKS_GC=y
> # CONFIG_PM_RUNTIME is not set
> CONFIG_PM=y
> # CONFIG_PM_DEBUG is not set
> CONFIG_ACPI=y
> # CONFIG_ACPI_PROCFS is not set
> # CONFIG_ACPI_PROCFS_POWER is not set
> # CONFIG_ACPI_EC_DEBUGFS is not set
> CONFIG_ACPI_PROC_EVENT=y
> CONFIG_ACPI_AC=y
> CONFIG_ACPI_BATTERY=y
> CONFIG_ACPI_BUTTON=y
> CONFIG_ACPI_VIDEO=m
> CONFIG_ACPI_FAN=y
> # CONFIG_ACPI_DOCK is not set
> CONFIG_ACPI_PROCESSOR=y
> # CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set
> CONFIG_ACPI_THERMAL=y
> # CONFIG_ACPI_CUSTOM_DSDT is not set
> CONFIG_ACPI_BLACKLIST_YEAR=0
> # CONFIG_ACPI_DEBUG is not set
> # CONFIG_ACPI_PCI_SLOT is not set
> CONFIG_X86_PM_TIMER=y
> # CONFIG_ACPI_CONTAINER is not set
> # CONFIG_ACPI_SBS is not set
> # CONFIG_ACPI_HED is not set
> # CONFIG_ACPI_CUSTOM_METHOD is not set
> # CONFIG_ACPI_APEI is not set
> CONFIG_SFI=y
> 
> #
> # CPU Frequency scaling
> #
> # CONFIG_CPU_FREQ is not set
> CONFIG_CPU_IDLE=y
> CONFIG_CPU_IDLE_GOV_LADDER=y
> # CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
> CONFIG_INTEL_IDLE=y
> 
> #
> # Memory power savings
> #
> # CONFIG_I7300_IDLE is not set
> 
> #
> # Bus options (PCI etc.)
> #
> CONFIG_PCI=y
> CONFIG_PCI_DIRECT=y
> # CONFIG_PCI_MMCONFIG is not set
> CONFIG_PCI_XEN=y
> CONFIG_PCI_DOMAINS=y
> CONFIG_PCIEPORTBUS=y
> CONFIG_HOTPLUG_PCI_PCIE=m
> CONFIG_PCIEAER=y
> CONFIG_PCIE_ECRC=y
> CONFIG_PCIEAER_INJECT=m
> CONFIG_PCIEASPM=y
> CONFIG_PCIEASPM_DEBUG=y
> # CONFIG_PCIEASPM_DEFAULT is not set
> CONFIG_PCIEASPM_POWERSAVE=y
> # CONFIG_PCIEASPM_PERFORMANCE is not set
> CONFIG_ARCH_SUPPORTS_MSI=y
> # CONFIG_PCI_MSI is not set
> # CONFIG_PCI_DEBUG is not set
> CONFIG_PCI_REALLOC_ENABLE_AUTO=y
> # CONFIG_PCI_STUB is not set
> CONFIG_XEN_PCIDEV_FRONTEND=m
> # CONFIG_HT_IRQ is not set
> CONFIG_PCI_ATS=y
> # CONFIG_PCI_IOV is not set
> CONFIG_PCI_PRI=y
> CONFIG_PCI_PASID=y
> # CONFIG_PCI_IOAPIC is not set
> CONFIG_PCI_LABEL=y
> CONFIG_ISA_DMA_API=y
> CONFIG_AMD_NB=y
> CONFIG_PCCARD=m
> CONFIG_PCMCIA=m
> CONFIG_PCMCIA_LOAD_CIS=y
> # CONFIG_CARDBUS is not set
> 
> #
> # PC-card bridges
> #
> # CONFIG_YENTA is not set
> # CONFIG_PD6729 is not set
> CONFIG_I82092=m
> CONFIG_PCCARD_NONSTATIC=y
> CONFIG_HOTPLUG_PCI=m
> # CONFIG_HOTPLUG_PCI_ACPI is not set
> CONFIG_HOTPLUG_PCI_CPCI=y
> # CONFIG_HOTPLUG_PCI_CPCI_ZT5550 is not set
> CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m
> # CONFIG_HOTPLUG_PCI_SHPC is not set
> # CONFIG_RAPIDIO is not set
> 
> #
> # Executable file formats / Emulations
> #
> CONFIG_BINFMT_ELF=y
> CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
> CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
> # CONFIG_HAVE_AOUT is not set
> CONFIG_BINFMT_MISC=m
> CONFIG_COREDUMP=y
> # CONFIG_IA32_EMULATION is not set
> CONFIG_HAVE_TEXT_POKE_SMP=y
> CONFIG_X86_DEV_DMA_OPS=y
> CONFIG_NET=y
> 
> #
> # Networking options
> #
> # CONFIG_PACKET is not set
> CONFIG_UNIX=y
> # CONFIG_UNIX_DIAG is not set
> CONFIG_XFRM=y
> CONFIG_XFRM_ALGO=m
> # CONFIG_XFRM_SUB_POLICY is not set
> CONFIG_XFRM_MIGRATE=y
> CONFIG_NET_KEY=m
> CONFIG_NET_KEY_MIGRATE=y
> # CONFIG_INET is not set
> CONFIG_NETWORK_SECMARK=y
> CONFIG_NETWORK_PHY_TIMESTAMPING=y
> # CONFIG_NETFILTER is not set
> # CONFIG_ATM is not set
> CONFIG_STP=m
> CONFIG_GARP=m
> # CONFIG_BRIDGE is not set
> CONFIG_VLAN_8021Q=m
> CONFIG_VLAN_8021Q_GVRP=y
> CONFIG_DECNET=m
> CONFIG_DECNET_ROUTER=y
> CONFIG_LLC=m
> CONFIG_LLC2=m
> # CONFIG_IPX is not set
> CONFIG_ATALK=m
> # CONFIG_DEV_APPLETALK is not set
> CONFIG_X25=m
> CONFIG_LAPB=m
> CONFIG_WAN_ROUTER=m
> CONFIG_PHONET=m
> # CONFIG_IEEE802154 is not set
> # CONFIG_NET_SCHED is not set
> CONFIG_DCB=y
> CONFIG_DNS_RESOLVER=m
> # CONFIG_BATMAN_ADV is not set
> # CONFIG_OPENVSWITCH is not set
> # CONFIG_NETPRIO_CGROUP is not set
> CONFIG_BQL=y
> # CONFIG_BPF_JIT is not set
> 
> #
> # Network testing
> #
> # CONFIG_NET_PKTGEN is not set
> # CONFIG_HAMRADIO is not set
> # CONFIG_CAN is not set
> # CONFIG_IRDA is not set
> # CONFIG_BT is not set
> CONFIG_FIB_RULES=y
> CONFIG_WIRELESS=y
> # CONFIG_CFG80211 is not set
> # CONFIG_LIB80211 is not set
> 
> #
> # CFG80211 needs to be enabled for MAC80211
> #
> CONFIG_WIMAX=m
> CONFIG_WIMAX_DEBUG_LEVEL=8
> # CONFIG_RFKILL is not set
> # CONFIG_NET_9P is not set
> # CONFIG_CAIF is not set
> # CONFIG_NFC is not set
> CONFIG_HAVE_BPF_JIT=y
> 
> #
> # Device Drivers
> #
> 
> #
> # Generic Driver Options
> #
> CONFIG_UEVENT_HELPER_PATH=""
> CONFIG_DEVTMPFS=y
> # CONFIG_DEVTMPFS_MOUNT is not set
> CONFIG_STANDALONE=y
> # CONFIG_PREVENT_FIRMWARE_BUILD is not set
> CONFIG_FW_LOADER=y
> # CONFIG_FIRMWARE_IN_KERNEL is not set
> CONFIG_EXTRA_FIRMWARE=""
> # CONFIG_DEBUG_DRIVER is not set
> # CONFIG_DEBUG_DEVRES is not set
> # CONFIG_SYS_HYPERVISOR is not set
> # CONFIG_GENERIC_CPU_DEVICES is not set
> CONFIG_REGMAP=y
> CONFIG_REGMAP_I2C=m
> CONFIG_REGMAP_SPI=y
> CONFIG_REGMAP_IRQ=y
> # CONFIG_DMA_SHARED_BUFFER is not set
> 
> #
> # Bus devices
> #
> # CONFIG_OMAP_OCP2SCP is not set
> # CONFIG_CONNECTOR is not set
> # CONFIG_MTD is not set
> CONFIG_PARPORT=m
> # CONFIG_PARPORT_PC is not set
> # CONFIG_PARPORT_GSC is not set
> # CONFIG_PARPORT_AX88796 is not set
> CONFIG_PARPORT_1284=y
> CONFIG_PNP=y
> CONFIG_PNP_DEBUG_MESSAGES=y
> 
> #
> # Protocols
> #
> CONFIG_PNPACPI=y
> CONFIG_BLK_DEV=y
> # CONFIG_BLK_DEV_FD is not set
> # CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
> # CONFIG_BLK_CPQ_DA is not set
> # CONFIG_BLK_CPQ_CISS_DA is not set
> # CONFIG_BLK_DEV_DAC960 is not set
> # CONFIG_BLK_DEV_UMEM is not set
> # CONFIG_BLK_DEV_COW_COMMON is not set
> # CONFIG_BLK_DEV_LOOP is not set
> 
> #
> # DRBD disabled because PROC_FS, INET or CONNECTOR not selected
> #
> # CONFIG_BLK_DEV_NBD is not set
> # CONFIG_BLK_DEV_NVME is not set
> # CONFIG_BLK_DEV_SX8 is not set
> # CONFIG_BLK_DEV_RAM is not set
> # CONFIG_CDROM_PKTCDVD is not set
> # CONFIG_ATA_OVER_ETH is not set
> CONFIG_XEN_BLKDEV_FRONTEND=y
> # CONFIG_XEN_BLKDEV_BACKEND is not set
> # CONFIG_VIRTIO_BLK is not set
> # CONFIG_BLK_DEV_HD is not set
> 
> #
> # Misc devices
> #
> # CONFIG_SENSORS_LIS3LV02D is not set
> # CONFIG_AD525X_DPOT is not set
> CONFIG_IBM_ASM=m
> CONFIG_PHANTOM=m
> # CONFIG_INTEL_MID_PTI is not set
> CONFIG_SGI_IOC4=m
> CONFIG_TIFM_CORE=m
> CONFIG_TIFM_7XX1=m
> CONFIG_ICS932S401=m
> CONFIG_ENCLOSURE_SERVICES=m
> CONFIG_HP_ILO=m
> # CONFIG_APDS9802ALS is not set
> # CONFIG_ISL29003 is not set
> # CONFIG_ISL29020 is not set
> CONFIG_SENSORS_TSL2550=m
> CONFIG_SENSORS_BH1780=m
> # CONFIG_SENSORS_BH1770 is not set
> CONFIG_SENSORS_APDS990X=m
> CONFIG_HMC6352=m
> CONFIG_DS1682=m
> # CONFIG_TI_DAC7512 is not set
> # CONFIG_VMWARE_BALLOON is not set
> CONFIG_BMP085=y
> # CONFIG_BMP085_I2C is not set
> CONFIG_BMP085_SPI=m
> CONFIG_PCH_PHUB=m
> CONFIG_USB_SWITCH_FSA9480=m
> # CONFIG_C2PORT is not set
> 
> #
> # EEPROM support
> #
> CONFIG_EEPROM_AT24=m
> # CONFIG_EEPROM_AT25 is not set
> CONFIG_EEPROM_LEGACY=m
> CONFIG_EEPROM_MAX6875=m
> # CONFIG_EEPROM_93CX6 is not set
> # CONFIG_EEPROM_93XX46 is not set
> CONFIG_CB710_CORE=m
> CONFIG_CB710_DEBUG=y
> CONFIG_CB710_DEBUG_ASSUMPTIONS=y
> 
> #
> # Texas Instruments shared transport line discipline
> #
> # CONFIG_SENSORS_LIS3_I2C is not set
> 
> #
> # Altera FPGA firmware download module
> #
> CONFIG_ALTERA_STAPL=m
> CONFIG_HAVE_IDE=y
> # CONFIG_IDE is not set
> 
> #
> # SCSI device support
> #
> CONFIG_SCSI_MOD=m
> CONFIG_RAID_ATTRS=m
> CONFIG_SCSI=m
> CONFIG_SCSI_DMA=y
> # CONFIG_SCSI_TGT is not set
> CONFIG_SCSI_NETLINK=y
> CONFIG_SCSI_PROC_FS=y
> 
> #
> # SCSI support type (disk, tape, CD-ROM)
> #
> CONFIG_BLK_DEV_SD=m
> # CONFIG_CHR_DEV_ST is not set
> # CONFIG_CHR_DEV_OSST is not set
> # CONFIG_BLK_DEV_SR is not set
> # CONFIG_CHR_DEV_SG is not set
> CONFIG_CHR_DEV_SCH=m
> CONFIG_SCSI_ENCLOSURE=m
> CONFIG_SCSI_MULTI_LUN=y
> CONFIG_SCSI_CONSTANTS=y
> CONFIG_SCSI_LOGGING=y
> # CONFIG_SCSI_SCAN_ASYNC is not set
> 
> #
> # SCSI Transports
> #
> CONFIG_SCSI_SPI_ATTRS=m
> CONFIG_SCSI_FC_ATTRS=m
> CONFIG_SCSI_ISCSI_ATTRS=m
> CONFIG_SCSI_SAS_ATTRS=m
> CONFIG_SCSI_SAS_LIBSAS=m
> CONFIG_SCSI_SAS_HOST_SMP=y
> # CONFIG_SCSI_SRP_ATTRS is not set
> CONFIG_SCSI_LOWLEVEL=y
> CONFIG_ISCSI_BOOT_SYSFS=m
> # CONFIG_SCSI_BNX2_ISCSI is not set
> # CONFIG_SCSI_BNX2X_FCOE is not set
> # CONFIG_BE2ISCSI is not set
> CONFIG_BLK_DEV_3W_XXXX_RAID=m
> # CONFIG_SCSI_HPSA is not set
> CONFIG_SCSI_3W_9XXX=m
> CONFIG_SCSI_3W_SAS=m
> # CONFIG_SCSI_ACARD is not set
> # CONFIG_SCSI_AACRAID is not set
> CONFIG_SCSI_AIC7XXX=m
> CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
> CONFIG_AIC7XXX_RESET_DELAY_MS=5000
> # CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
> CONFIG_AIC7XXX_DEBUG_ENABLE=y
> CONFIG_AIC7XXX_DEBUG_MASK=0
> # CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
> CONFIG_SCSI_AIC7XXX_OLD=m
> # CONFIG_SCSI_AIC79XX is not set
> CONFIG_SCSI_AIC94XX=m
> CONFIG_AIC94XX_DEBUG=y
> CONFIG_SCSI_MVSAS=m
> CONFIG_SCSI_MVSAS_DEBUG=y
> # CONFIG_SCSI_MVSAS_TASKLET is not set
> CONFIG_SCSI_MVUMI=m
> CONFIG_SCSI_DPT_I2O=m
> # CONFIG_SCSI_ADVANSYS is not set
> # CONFIG_SCSI_ARCMSR is not set
> # CONFIG_MEGARAID_NEWGEN is not set
> # CONFIG_MEGARAID_LEGACY is not set
> # CONFIG_MEGARAID_SAS is not set
> # CONFIG_SCSI_MPT2SAS is not set
> # CONFIG_SCSI_UFSHCD is not set
> CONFIG_SCSI_HPTIOP=m
> # CONFIG_SCSI_BUSLOGIC is not set
> # CONFIG_VMWARE_PVSCSI is not set
> CONFIG_LIBFC=m
> CONFIG_LIBFCOE=m
> CONFIG_FCOE=m
> CONFIG_FCOE_FNIC=m
> CONFIG_SCSI_DMX3191D=m
> # CONFIG_SCSI_EATA is not set
> CONFIG_SCSI_FUTURE_DOMAIN=m
> CONFIG_SCSI_GDTH=m
> # CONFIG_SCSI_ISCI is not set
> CONFIG_SCSI_IPS=m
> # CONFIG_SCSI_INITIO is not set
> CONFIG_SCSI_INIA100=m
> CONFIG_SCSI_STEX=m
> CONFIG_SCSI_SYM53C8XX_2=m
> CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
> CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
> CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
> # CONFIG_SCSI_SYM53C8XX_MMIO is not set
> CONFIG_SCSI_QLOGIC_1280=m
> # CONFIG_SCSI_QLA_FC is not set
> CONFIG_SCSI_QLA_ISCSI=m
> # CONFIG_SCSI_LPFC is not set
> # CONFIG_SCSI_DC395x is not set
> CONFIG_SCSI_DC390T=m
> # CONFIG_SCSI_DEBUG is not set
> CONFIG_SCSI_PMCRAID=m
> CONFIG_SCSI_PM8001=m
> # CONFIG_SCSI_SRP is not set
> CONFIG_SCSI_BFA_FC=m
> # CONFIG_SCSI_VIRTIO is not set
> CONFIG_SCSI_LOWLEVEL_PCMCIA=y
> # CONFIG_PCMCIA_AHA152X is not set
> # CONFIG_PCMCIA_FDOMAIN is not set
> CONFIG_PCMCIA_QLOGIC=m
> # CONFIG_PCMCIA_SYM53C500 is not set
> # CONFIG_SCSI_DH is not set
> CONFIG_SCSI_OSD_INITIATOR=m
> # CONFIG_SCSI_OSD_ULD is not set
> CONFIG_SCSI_OSD_DPRINT_SENSE=1
> CONFIG_SCSI_OSD_DEBUG=y
> # CONFIG_ATA is not set
> # CONFIG_MD is not set
> CONFIG_TARGET_CORE=m
> CONFIG_TCM_IBLOCK=m
> # CONFIG_TCM_FILEIO is not set
> CONFIG_TCM_PSCSI=m
> # CONFIG_LOOPBACK_TARGET is not set
> # CONFIG_TCM_FC is not set
> # CONFIG_ISCSI_TARGET is not set
> # CONFIG_SBP_TARGET is not set
> # CONFIG_FUSION is not set
> 
> #
> # IEEE 1394 (FireWire) support
> #
> CONFIG_FIREWIRE=m
> # CONFIG_FIREWIRE_OHCI is not set
> CONFIG_FIREWIRE_SBP2=m
> # CONFIG_FIREWIRE_NOSY is not set
> CONFIG_I2O=m
> # CONFIG_I2O_LCT_NOTIFY_ON_CHANGES is not set
> CONFIG_I2O_EXT_ADAPTEC=y
> CONFIG_I2O_EXT_ADAPTEC_DMA64=y
> # CONFIG_I2O_CONFIG is not set
> # CONFIG_I2O_BUS is not set
> CONFIG_I2O_BLOCK=m
> CONFIG_I2O_SCSI=m
> # CONFIG_I2O_PROC is not set
> # CONFIG_MACINTOSH_DRIVERS is not set
> # CONFIG_NETDEVICES is not set
> # CONFIG_ISDN is not set
> 
> #
> # Input device support
> #
> CONFIG_INPUT=y
> CONFIG_INPUT_FF_MEMLESS=m
> # CONFIG_INPUT_POLLDEV is not set
> CONFIG_INPUT_SPARSEKMAP=m
> # CONFIG_INPUT_MATRIXKMAP is not set
> 
> #
> # Userland interfaces
> #
> CONFIG_INPUT_MOUSEDEV=y
> CONFIG_INPUT_MOUSEDEV_PSAUX=y
> CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
> CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
> CONFIG_INPUT_JOYDEV=m
> CONFIG_INPUT_EVDEV=m
> CONFIG_INPUT_EVBUG=m
> 
> #
> # Input Device Drivers
> #
> CONFIG_INPUT_KEYBOARD=y
> CONFIG_KEYBOARD_ADP5588=m
> # CONFIG_KEYBOARD_ADP5589 is not set
> CONFIG_KEYBOARD_ATKBD=y
> CONFIG_KEYBOARD_QT1070=m
> # CONFIG_KEYBOARD_QT2160 is not set
> CONFIG_KEYBOARD_LKKBD=m
> # CONFIG_KEYBOARD_TCA6416 is not set
> # CONFIG_KEYBOARD_TCA8418 is not set
> # CONFIG_KEYBOARD_LM8323 is not set
> # CONFIG_KEYBOARD_LM8333 is not set
> CONFIG_KEYBOARD_MAX7359=m
> # CONFIG_KEYBOARD_MCS is not set
> CONFIG_KEYBOARD_MPR121=m
> CONFIG_KEYBOARD_NEWTON=m
> CONFIG_KEYBOARD_OPENCORES=m
> # CONFIG_KEYBOARD_STOWAWAY is not set
> # CONFIG_KEYBOARD_SUNKBD is not set
> # CONFIG_KEYBOARD_OMAP4 is not set
> # CONFIG_KEYBOARD_XTKBD is not set
> # CONFIG_INPUT_MOUSE is not set
> # CONFIG_INPUT_JOYSTICK is not set
> # CONFIG_INPUT_TABLET is not set
> # CONFIG_INPUT_TOUCHSCREEN is not set
> # CONFIG_INPUT_MISC is not set
> 
> #
> # Hardware I/O ports
> #
> CONFIG_SERIO=y
> CONFIG_SERIO_I8042=y
> CONFIG_SERIO_SERPORT=m
> # CONFIG_SERIO_CT82C710 is not set
> CONFIG_SERIO_PARKBD=m
> CONFIG_SERIO_PCIPS2=m
> CONFIG_SERIO_LIBPS2=y
> CONFIG_SERIO_RAW=m
> # CONFIG_SERIO_ALTERA_PS2 is not set
> # CONFIG_SERIO_PS2MULT is not set
> CONFIG_GAMEPORT=m
> CONFIG_GAMEPORT_NS558=m
> # CONFIG_GAMEPORT_L4 is not set
> # CONFIG_GAMEPORT_EMU10K1 is not set
> # CONFIG_GAMEPORT_FM801 is not set
> 
> #
> # Character devices
> #
> CONFIG_VT=y
> CONFIG_CONSOLE_TRANSLATIONS=y
> CONFIG_VT_CONSOLE=y
> CONFIG_VT_CONSOLE_SLEEP=y
> CONFIG_HW_CONSOLE=y
> # CONFIG_VT_HW_CONSOLE_BINDING is not set
> CONFIG_UNIX98_PTYS=y
> # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
> # CONFIG_LEGACY_PTYS is not set
> CONFIG_SERIAL_NONSTANDARD=y
> # CONFIG_ROCKETPORT is not set
> # CONFIG_CYCLADES is not set
> CONFIG_MOXA_INTELLIO=m
> CONFIG_MOXA_SMARTIO=m
> # CONFIG_SYNCLINK is not set
> # CONFIG_SYNCLINKMP is not set
> # CONFIG_SYNCLINK_GT is not set
> CONFIG_NOZOMI=m
> CONFIG_ISI=m
> CONFIG_N_HDLC=m
> # CONFIG_N_GSM is not set
> CONFIG_TRACE_ROUTER=m
> CONFIG_TRACE_SINK=m
> CONFIG_DEVKMEM=y
> # CONFIG_STALDRV is not set
> 
> #
> # Serial drivers
> #
> CONFIG_SERIAL_8250=y
> CONFIG_SERIAL_8250_PNP=y
> CONFIG_SERIAL_8250_CONSOLE=y
> CONFIG_FIX_EARLYCON_MEM=y
> CONFIG_SERIAL_8250_PCI=y
> CONFIG_SERIAL_8250_CS=m
> CONFIG_SERIAL_8250_NR_UARTS=4
> CONFIG_SERIAL_8250_RUNTIME_UARTS=4
> # CONFIG_SERIAL_8250_EXTENDED is not set
> 
> #
> # Non-8250 serial port support
> #
> CONFIG_SERIAL_MAX3100=m
> # CONFIG_SERIAL_MAX310X is not set
> # CONFIG_SERIAL_MFD_HSU is not set
> CONFIG_SERIAL_CORE=y
> CONFIG_SERIAL_CORE_CONSOLE=y
> # CONFIG_SERIAL_JSM is not set
> CONFIG_SERIAL_SCCNXP=m
> # CONFIG_SERIAL_TIMBERDALE is not set
> # CONFIG_SERIAL_ALTERA_JTAGUART is not set
> # CONFIG_SERIAL_ALTERA_UART is not set
> # CONFIG_SERIAL_PCH_UART is not set
> CONFIG_SERIAL_XILINX_PS_UART=m
> CONFIG_PRINTER=m
> CONFIG_LP_CONSOLE=y
> CONFIG_PPDEV=m
> # CONFIG_HVC_XEN is not set
> # CONFIG_VIRTIO_CONSOLE is not set
> # CONFIG_IPMI_HANDLER is not set
> CONFIG_HW_RANDOM=m
> # CONFIG_HW_RANDOM_TIMERIOMEM is not set
> # CONFIG_HW_RANDOM_INTEL is not set
> # CONFIG_HW_RANDOM_AMD is not set
> CONFIG_HW_RANDOM_VIA=m
> # CONFIG_HW_RANDOM_VIRTIO is not set
> CONFIG_HW_RANDOM_TPM=m
> CONFIG_NVRAM=m
> CONFIG_RTC=m
> # CONFIG_GEN_RTC is not set
> CONFIG_R3964=m
> CONFIG_APPLICOM=m
> 
> #
> # PCMCIA character devices
> #
> CONFIG_SYNCLINK_CS=m
> # CONFIG_CARDMAN_4000 is not set
> CONFIG_CARDMAN_4040=m
> # CONFIG_MWAVE is not set
> CONFIG_RAW_DRIVER=m
> CONFIG_MAX_RAW_DEVS=256
> # CONFIG_HPET is not set
> CONFIG_HANGCHECK_TIMER=m
> CONFIG_TCG_TPM=y
> CONFIG_TCG_TIS=y
> CONFIG_TCG_TIS_I2C_INFINEON=m
> # CONFIG_TCG_NSC is not set
> # CONFIG_TCG_ATMEL is not set
> # CONFIG_TCG_INFINEON is not set
> CONFIG_TELCLOCK=m
> CONFIG_DEVPORT=y
> CONFIG_I2C=m
> CONFIG_I2C_BOARDINFO=y
> CONFIG_I2C_COMPAT=y
> # CONFIG_I2C_CHARDEV is not set
> CONFIG_I2C_MUX=m
> 
> #
> # Multiplexer I2C Chip support
> #
> CONFIG_I2C_MUX_PCA9541=m
> # CONFIG_I2C_MUX_PCA954x is not set
> # CONFIG_I2C_HELPER_AUTO is not set
> CONFIG_I2C_SMBUS=m
> 
> #
> # I2C Algorithms
> #
> CONFIG_I2C_ALGOBIT=m
> # CONFIG_I2C_ALGOPCF is not set
> CONFIG_I2C_ALGOPCA=m
> 
> #
> # I2C Hardware Bus support
> #
> 
> #
> # PC SMBus host controller drivers
> #
> # CONFIG_I2C_ALI1535 is not set
> CONFIG_I2C_ALI1563=m
> # CONFIG_I2C_ALI15X3 is not set
> # CONFIG_I2C_AMD756 is not set
> # CONFIG_I2C_AMD8111 is not set
> # CONFIG_I2C_I801 is not set
> # CONFIG_I2C_ISCH is not set
> CONFIG_I2C_PIIX4=m
> # CONFIG_I2C_NFORCE2 is not set
> CONFIG_I2C_SIS5595=m
> # CONFIG_I2C_SIS630 is not set
> # CONFIG_I2C_SIS96X is not set
> CONFIG_I2C_VIA=m
> CONFIG_I2C_VIAPRO=m
> 
> #
> # ACPI drivers
> #
> # CONFIG_I2C_SCMI is not set
> 
> #
> # I2C system bus drivers (mostly embedded / system-on-chip)
> #
> CONFIG_I2C_DESIGNWARE_CORE=m
> CONFIG_I2C_DESIGNWARE_PCI=m
> CONFIG_I2C_EG20T=m
> # CONFIG_I2C_INTEL_MID is not set
> CONFIG_I2C_OCORES=m
> # CONFIG_I2C_PCA_PLATFORM is not set
> # CONFIG_I2C_PXA_PCI is not set
> # CONFIG_I2C_SIMTEC is not set
> CONFIG_I2C_XILINX=m
> 
> #
> # External I2C/SMBus adapter drivers
> #
> # CONFIG_I2C_PARPORT is not set
> # CONFIG_I2C_PARPORT_LIGHT is not set
> CONFIG_I2C_TAOS_EVM=m
> 
> #
> # Other I2C/SMBus bus drivers
> #
> # CONFIG_I2C_STUB is not set
> CONFIG_I2C_DEBUG_CORE=y
> CONFIG_I2C_DEBUG_ALGO=y
> # CONFIG_I2C_DEBUG_BUS is not set
> CONFIG_SPI=y
> # CONFIG_SPI_DEBUG is not set
> CONFIG_SPI_MASTER=y
> 
> #
> # SPI Master Controller Drivers
> #
> CONFIG_SPI_ALTERA=m
> CONFIG_SPI_BITBANG=m
> # CONFIG_SPI_BUTTERFLY is not set
> CONFIG_SPI_LM70_LLP=m
> # CONFIG_SPI_PXA2XX_PCI is not set
> CONFIG_SPI_SC18IS602=m
> # CONFIG_SPI_TOPCLIFF_PCH is not set
> CONFIG_SPI_XCOMM=m
> # CONFIG_SPI_XILINX is not set
> # CONFIG_SPI_DESIGNWARE is not set
> 
> #
> # SPI Protocol Masters
> #
> CONFIG_SPI_SPIDEV=m
> # CONFIG_SPI_TLE62X0 is not set
> # CONFIG_HSI is not set
> 
> #
> # PPS support
> #
> CONFIG_PPS=m
> CONFIG_PPS_DEBUG=y
> CONFIG_NTP_PPS=y
> 
> #
> # PPS clients support
> #
> # CONFIG_PPS_CLIENT_KTIMER is not set
> # CONFIG_PPS_CLIENT_LDISC is not set
> CONFIG_PPS_CLIENT_PARPORT=m
> # CONFIG_PPS_CLIENT_GPIO is not set
> 
> #
> # PPS generators support
> #
> 
> #
> # PTP clock support
> #
> CONFIG_PTP_1588_CLOCK=m
> 
> #
> # Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
> #
> CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
> # CONFIG_GPIOLIB is not set
> CONFIG_W1=m
> 
> #
> # 1-wire Bus Masters
> #
> # CONFIG_W1_MASTER_MATROX is not set
> # CONFIG_W1_MASTER_DS2482 is not set
> # CONFIG_W1_MASTER_DS1WM is not set
> CONFIG_HDQ_MASTER_OMAP=m
> 
> #
> # 1-wire Slaves
> #
> # CONFIG_W1_SLAVE_THERM is not set
> # CONFIG_W1_SLAVE_SMEM is not set
> CONFIG_W1_SLAVE_DS2408=m
> CONFIG_W1_SLAVE_DS2423=m
> # CONFIG_W1_SLAVE_DS2431 is not set
> CONFIG_W1_SLAVE_DS2433=m
> # CONFIG_W1_SLAVE_DS2433_CRC is not set
> # CONFIG_W1_SLAVE_DS2760 is not set
> CONFIG_W1_SLAVE_DS2780=m
> CONFIG_W1_SLAVE_DS2781=m
> CONFIG_W1_SLAVE_DS28E04=m
> # CONFIG_W1_SLAVE_BQ27000 is not set
> CONFIG_POWER_SUPPLY=y
> # CONFIG_POWER_SUPPLY_DEBUG is not set
> CONFIG_PDA_POWER=m
> # CONFIG_GENERIC_ADC_BATTERY is not set
> # CONFIG_WM831X_BACKUP is not set
> # CONFIG_WM831X_POWER is not set
> # CONFIG_TEST_POWER is not set
> CONFIG_BATTERY_DS2780=m
> # CONFIG_BATTERY_DS2781 is not set
> CONFIG_BATTERY_DS2782=m
> CONFIG_BATTERY_SBS=m
> CONFIG_BATTERY_BQ27x00=m
> CONFIG_BATTERY_BQ27X00_I2C=y
> # CONFIG_BATTERY_BQ27X00_PLATFORM is not set
> # CONFIG_BATTERY_MAX17040 is not set
> # CONFIG_BATTERY_MAX17042 is not set
> CONFIG_CHARGER_MAX8903=m
> # CONFIG_CHARGER_LP8727 is not set
> CONFIG_CHARGER_SMB347=m
> # CONFIG_POWER_AVS is not set
> CONFIG_HWMON=m
> CONFIG_HWMON_VID=m
> # CONFIG_HWMON_DEBUG_CHIP is not set
> 
> #
> # Native drivers
> #
> CONFIG_SENSORS_ABITUGURU=m
> CONFIG_SENSORS_ABITUGURU3=m
> # CONFIG_SENSORS_AD7314 is not set
> # CONFIG_SENSORS_AD7414 is not set
> CONFIG_SENSORS_AD7418=m
> CONFIG_SENSORS_ADCXX=m
> CONFIG_SENSORS_ADM1021=m
> # CONFIG_SENSORS_ADM1025 is not set
> # CONFIG_SENSORS_ADM1026 is not set
> CONFIG_SENSORS_ADM1029=m
> CONFIG_SENSORS_ADM1031=m
> # CONFIG_SENSORS_ADM9240 is not set
> # CONFIG_SENSORS_ADT7410 is not set
> # CONFIG_SENSORS_ADT7411 is not set
> CONFIG_SENSORS_ADT7462=m
> # CONFIG_SENSORS_ADT7470 is not set
> CONFIG_SENSORS_ADT7475=m
> # CONFIG_SENSORS_ASC7621 is not set
> # CONFIG_SENSORS_K8TEMP is not set
> CONFIG_SENSORS_K10TEMP=m
> # CONFIG_SENSORS_FAM15H_POWER is not set
> # CONFIG_SENSORS_ASB100 is not set
> # CONFIG_SENSORS_ATXP1 is not set
> CONFIG_SENSORS_DS620=m
> # CONFIG_SENSORS_DS1621 is not set
> CONFIG_SENSORS_I5K_AMB=m
> CONFIG_SENSORS_F71805F=m
> CONFIG_SENSORS_F71882FG=m
> CONFIG_SENSORS_F75375S=m
> CONFIG_SENSORS_FSCHMD=m
> # CONFIG_SENSORS_G760A is not set
> CONFIG_SENSORS_GL518SM=m
> # CONFIG_SENSORS_GL520SM is not set
> CONFIG_SENSORS_HIH6130=m
> # CONFIG_SENSORS_CORETEMP is not set
> CONFIG_SENSORS_IT87=m
> # CONFIG_SENSORS_JC42 is not set
> # CONFIG_SENSORS_LINEAGE is not set
> # CONFIG_SENSORS_LM63 is not set
> CONFIG_SENSORS_LM70=m
> # CONFIG_SENSORS_LM73 is not set
> # CONFIG_SENSORS_LM75 is not set
> # CONFIG_SENSORS_LM77 is not set
> CONFIG_SENSORS_LM78=m
> # CONFIG_SENSORS_LM80 is not set
> # CONFIG_SENSORS_LM83 is not set
> CONFIG_SENSORS_LM85=m
> CONFIG_SENSORS_LM87=m
> CONFIG_SENSORS_LM90=m
> # CONFIG_SENSORS_LM92 is not set
> # CONFIG_SENSORS_LM93 is not set
> CONFIG_SENSORS_LTC4151=m
> CONFIG_SENSORS_LTC4215=m
> CONFIG_SENSORS_LTC4245=m
> CONFIG_SENSORS_LTC4261=m
> CONFIG_SENSORS_LM95241=m
> # CONFIG_SENSORS_LM95245 is not set
> CONFIG_SENSORS_MAX1111=m
> CONFIG_SENSORS_MAX16065=m
> # CONFIG_SENSORS_MAX1619 is not set
> CONFIG_SENSORS_MAX1668=m
> CONFIG_SENSORS_MAX197=m
> # CONFIG_SENSORS_MAX6639 is not set
> # CONFIG_SENSORS_MAX6642 is not set
> # CONFIG_SENSORS_MAX6650 is not set
> # CONFIG_SENSORS_MCP3021 is not set
> CONFIG_SENSORS_NTC_THERMISTOR=m
> # CONFIG_SENSORS_PC87360 is not set
> # CONFIG_SENSORS_PC87427 is not set
> # CONFIG_SENSORS_PCF8591 is not set
> CONFIG_PMBUS=m
> CONFIG_SENSORS_PMBUS=m
> # CONFIG_SENSORS_ADM1275 is not set
> # CONFIG_SENSORS_LM25066 is not set
> # CONFIG_SENSORS_LTC2978 is not set
> CONFIG_SENSORS_MAX16064=m
> # CONFIG_SENSORS_MAX34440 is not set
> CONFIG_SENSORS_MAX8688=m
> CONFIG_SENSORS_UCD9000=m
> CONFIG_SENSORS_UCD9200=m
> # CONFIG_SENSORS_ZL6100 is not set
> # CONFIG_SENSORS_SHT21 is not set
> # CONFIG_SENSORS_SIS5595 is not set
> CONFIG_SENSORS_SMM665=m
> CONFIG_SENSORS_DME1737=m
> # CONFIG_SENSORS_EMC1403 is not set
> # CONFIG_SENSORS_EMC2103 is not set
> # CONFIG_SENSORS_EMC6W201 is not set
> CONFIG_SENSORS_SMSC47M1=m
> CONFIG_SENSORS_SMSC47M192=m
> CONFIG_SENSORS_SMSC47B397=m
> # CONFIG_SENSORS_SCH56XX_COMMON is not set
> # CONFIG_SENSORS_ADS1015 is not set
> # CONFIG_SENSORS_ADS7828 is not set
> # CONFIG_SENSORS_ADS7871 is not set
> # CONFIG_SENSORS_AMC6821 is not set
> CONFIG_SENSORS_INA2XX=m
> # CONFIG_SENSORS_THMC50 is not set
> # CONFIG_SENSORS_TMP102 is not set
> CONFIG_SENSORS_TMP401=m
> # CONFIG_SENSORS_TMP421 is not set
> # CONFIG_SENSORS_VIA_CPUTEMP is not set
> # CONFIG_SENSORS_VIA686A is not set
> CONFIG_SENSORS_VT1211=m
> CONFIG_SENSORS_VT8231=m
> # CONFIG_SENSORS_W83781D is not set
> # CONFIG_SENSORS_W83791D is not set
> # CONFIG_SENSORS_W83792D is not set
> CONFIG_SENSORS_W83793=m
> CONFIG_SENSORS_W83795=m
> CONFIG_SENSORS_W83795_FANCTRL=y
> # CONFIG_SENSORS_W83L785TS is not set
> # CONFIG_SENSORS_W83L786NG is not set
> # CONFIG_SENSORS_W83627HF is not set
> CONFIG_SENSORS_W83627EHF=m
> CONFIG_SENSORS_WM831X=m
> # CONFIG_SENSORS_APPLESMC is not set
> 
> #
> # ACPI drivers
> #
> # CONFIG_SENSORS_ACPI_POWER is not set
> # CONFIG_SENSORS_ATK0110 is not set
> CONFIG_THERMAL=y
> # CONFIG_WATCHDOG is not set
> CONFIG_SSB_POSSIBLE=y
> 
> #
> # Sonics Silicon Backplane
> #
> # CONFIG_SSB is not set
> CONFIG_BCMA_POSSIBLE=y
> 
> #
> # Broadcom specific AMBA
> #
> CONFIG_BCMA=m
> CONFIG_BCMA_HOST_PCI_POSSIBLE=y
> CONFIG_BCMA_HOST_PCI=y
> # CONFIG_BCMA_DRIVER_GMAC_CMN is not set
> # CONFIG_BCMA_DEBUG is not set
> 
> #
> # Multifunction device drivers
> #
> CONFIG_MFD_CORE=y
> # CONFIG_MFD_SM501 is not set
> CONFIG_HTC_PASIC3=m
> CONFIG_MFD_LM3533=m
> # CONFIG_TPS6105X is not set
> # CONFIG_TPS6507X is not set
> CONFIG_MFD_TPS65217=m
> # CONFIG_MFD_STMPE is not set
> # CONFIG_MFD_TMIO is not set
> # CONFIG_MFD_DA9052_SPI is not set
> CONFIG_MFD_ARIZONA=y
> CONFIG_MFD_ARIZONA_I2C=m
> # CONFIG_MFD_ARIZONA_SPI is not set
> CONFIG_MFD_WM5102=y
> # CONFIG_MFD_WM5110 is not set
> CONFIG_MFD_WM831X=y
> CONFIG_MFD_WM831X_SPI=y
> # CONFIG_MFD_PCF50633 is not set
> # CONFIG_MFD_MC13XXX_SPI is not set
> # CONFIG_MFD_MC13XXX_I2C is not set
> # CONFIG_ABX500_CORE is not set
> # CONFIG_EZX_PCAP is not set
> # CONFIG_MFD_CS5535 is not set
> # CONFIG_LPC_SCH is not set
> # CONFIG_LPC_ICH is not set
> # CONFIG_MFD_RDC321X is not set
> CONFIG_MFD_JANZ_CMODIO=m
> CONFIG_MFD_VX855=m
> # CONFIG_MFD_WL1273_CORE is not set
> # CONFIG_REGULATOR is not set
> # CONFIG_MEDIA_SUPPORT is not set
> 
> #
> # Graphics support
> #
> # CONFIG_AGP is not set
> CONFIG_VGA_ARB=y
> CONFIG_VGA_ARB_MAX_GPUS=16
> # CONFIG_VGA_SWITCHEROO is not set
> # CONFIG_DRM is not set
> CONFIG_STUB_POULSBO=m
> CONFIG_VGASTATE=m
> CONFIG_VIDEO_OUTPUT_CONTROL=m
> CONFIG_FB=m
> # CONFIG_FIRMWARE_EDID is not set
> CONFIG_FB_DDC=m
> # CONFIG_FB_BOOT_VESA_SUPPORT is not set
> CONFIG_FB_CFB_FILLRECT=m
> CONFIG_FB_CFB_COPYAREA=m
> CONFIG_FB_CFB_IMAGEBLIT=m
> # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
> CONFIG_FB_SYS_FILLRECT=m
> CONFIG_FB_SYS_COPYAREA=m
> CONFIG_FB_SYS_IMAGEBLIT=m
> # CONFIG_FB_FOREIGN_ENDIAN is not set
> CONFIG_FB_SYS_FOPS=m
> # CONFIG_FB_WMT_GE_ROPS is not set
> CONFIG_FB_DEFERRED_IO=y
> CONFIG_FB_SVGALIB=m
> # CONFIG_FB_MACMODES is not set
> CONFIG_FB_BACKLIGHT=y
> CONFIG_FB_MODE_HELPERS=y
> CONFIG_FB_TILEBLITTING=y
> 
> #
> # Frame buffer hardware drivers
> #
> # CONFIG_FB_CIRRUS is not set
> # CONFIG_FB_PM2 is not set
> # CONFIG_FB_CYBER2000 is not set
> # CONFIG_FB_ARC is not set
> # CONFIG_FB_VGA16 is not set
> # CONFIG_FB_N411 is not set
> # CONFIG_FB_HGA is not set
> CONFIG_FB_S1D13XXX=m
> # CONFIG_FB_NVIDIA is not set
> CONFIG_FB_RIVA=m
> # CONFIG_FB_RIVA_I2C is not set
> CONFIG_FB_RIVA_DEBUG=y
> CONFIG_FB_RIVA_BACKLIGHT=y
> CONFIG_FB_I740=m
> CONFIG_FB_LE80578=m
> # CONFIG_FB_CARILLO_RANCH is not set
> CONFIG_FB_MATROX=m
> # CONFIG_FB_MATROX_MILLENIUM is not set
> CONFIG_FB_MATROX_MYSTIQUE=y
> # CONFIG_FB_MATROX_G is not set
> # CONFIG_FB_MATROX_I2C is not set
> CONFIG_FB_RADEON=m
> # CONFIG_FB_RADEON_I2C is not set
> CONFIG_FB_RADEON_BACKLIGHT=y
> CONFIG_FB_RADEON_DEBUG=y
> # CONFIG_FB_ATY128 is not set
> CONFIG_FB_ATY=m
> # CONFIG_FB_ATY_CT is not set
> # CONFIG_FB_ATY_GX is not set
> CONFIG_FB_ATY_BACKLIGHT=y
> CONFIG_FB_S3=m
> CONFIG_FB_S3_DDC=y
> # CONFIG_FB_SAVAGE is not set
> CONFIG_FB_SIS=m
> # CONFIG_FB_SIS_300 is not set
> CONFIG_FB_SIS_315=y
> # CONFIG_FB_VIA is not set
> CONFIG_FB_NEOMAGIC=m
> CONFIG_FB_KYRO=m
> CONFIG_FB_3DFX=m
> # CONFIG_FB_3DFX_ACCEL is not set
> # CONFIG_FB_3DFX_I2C is not set
> CONFIG_FB_VOODOO1=m
> # CONFIG_FB_VT8623 is not set
> # CONFIG_FB_TRIDENT is not set
> # CONFIG_FB_ARK is not set
> CONFIG_FB_PM3=m
> # CONFIG_FB_CARMINE is not set
> CONFIG_FB_GEODE=y
> CONFIG_FB_GEODE_LX=m
> # CONFIG_FB_GEODE_GX is not set
> CONFIG_FB_GEODE_GX1=m
> CONFIG_FB_TMIO=m
> CONFIG_FB_TMIO_ACCELL=y
> # CONFIG_FB_VIRTUAL is not set
> # CONFIG_XEN_FBDEV_FRONTEND is not set
> CONFIG_FB_METRONOME=m
> CONFIG_FB_MB862XX=m
> CONFIG_FB_MB862XX_PCI_GDC=y
> # CONFIG_FB_MB862XX_I2C is not set
> # CONFIG_FB_BROADSHEET is not set
> CONFIG_FB_AUO_K190X=m
> CONFIG_FB_AUO_K1900=m
> CONFIG_FB_AUO_K1901=m
> # CONFIG_EXYNOS_VIDEO is not set
> CONFIG_BACKLIGHT_LCD_SUPPORT=y
> # CONFIG_LCD_CLASS_DEVICE is not set
> CONFIG_BACKLIGHT_CLASS_DEVICE=m
> CONFIG_BACKLIGHT_GENERIC=m
> # CONFIG_BACKLIGHT_LM3533 is not set
> CONFIG_BACKLIGHT_PWM=m
> # CONFIG_BACKLIGHT_APPLE is not set
> CONFIG_BACKLIGHT_SAHARA=m
> # CONFIG_BACKLIGHT_WM831X is not set
> # CONFIG_BACKLIGHT_ADP8860 is not set
> CONFIG_BACKLIGHT_ADP8870=m
> # CONFIG_BACKLIGHT_LM3630 is not set
> CONFIG_BACKLIGHT_LM3639=m
> CONFIG_BACKLIGHT_LP855X=m
> # CONFIG_BACKLIGHT_TPS65217 is not set
> 
> #
> # Console display driver support
> #
> CONFIG_VGA_CONSOLE=y
> # CONFIG_VGACON_SOFT_SCROLLBACK is not set
> CONFIG_DUMMY_CONSOLE=y
> # CONFIG_FRAMEBUFFER_CONSOLE is not set
> # CONFIG_LOGO is not set
> CONFIG_SOUND=m
> CONFIG_SOUND_OSS_CORE=y
> # CONFIG_SOUND_OSS_CORE_PRECLAIM is not set
> CONFIG_SND=m
> CONFIG_SND_TIMER=m
> CONFIG_SND_PCM=m
> CONFIG_SND_SEQUENCER=m
> # CONFIG_SND_SEQ_DUMMY is not set
> CONFIG_SND_OSSEMUL=y
> # CONFIG_SND_MIXER_OSS is not set
> CONFIG_SND_PCM_OSS=m
> CONFIG_SND_PCM_OSS_PLUGINS=y
> # CONFIG_SND_SEQUENCER_OSS is not set
> CONFIG_SND_RTCTIMER=m
> CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y
> CONFIG_SND_DYNAMIC_MINORS=y
> # CONFIG_SND_SUPPORT_OLD_API is not set
> CONFIG_SND_VERBOSE_PROCFS=y
> CONFIG_SND_VERBOSE_PRINTK=y
> # CONFIG_SND_DEBUG is not set
> CONFIG_SND_DMA_SGBUF=y
> # CONFIG_SND_RAWMIDI_SEQ is not set
> # CONFIG_SND_OPL3_LIB_SEQ is not set
> # CONFIG_SND_OPL4_LIB_SEQ is not set
> # CONFIG_SND_SBAWE_SEQ is not set
> # CONFIG_SND_EMU10K1_SEQ is not set
> # CONFIG_SND_DRIVERS is not set
> # CONFIG_SND_PCI is not set
> # CONFIG_SND_SPI is not set
> CONFIG_SND_FIREWIRE=y
> CONFIG_SND_FIREWIRE_LIB=m
> # CONFIG_SND_FIREWIRE_SPEAKERS is not set
> CONFIG_SND_ISIGHT=m
> # CONFIG_SND_PCMCIA is not set
> # CONFIG_SND_SOC is not set
> CONFIG_SOUND_PRIME=m
> CONFIG_SOUND_OSS=m
> CONFIG_SOUND_TRACEINIT=y
> CONFIG_SOUND_DMAP=y
> # CONFIG_SOUND_VMIDI is not set
> CONFIG_SOUND_TRIX=m
> # CONFIG_SOUND_MSS is not set
> # CONFIG_SOUND_MPU401 is not set
> # CONFIG_SOUND_PAS is not set
> # CONFIG_SOUND_PSS is not set
> CONFIG_SOUND_SB=m
> CONFIG_SOUND_YM3812=m
> # CONFIG_SOUND_UART6850 is not set
> # CONFIG_SOUND_AEDSP16 is not set
> CONFIG_SOUND_KAHLUA=m
> 
> #
> # HID support
> #
> CONFIG_HID=m
> CONFIG_HIDRAW=y
> CONFIG_UHID=m
> CONFIG_HID_GENERIC=m
> 
> #
> # Special HID drivers
> #
> CONFIG_USB_ARCH_HAS_OHCI=y
> CONFIG_USB_ARCH_HAS_EHCI=y
> CONFIG_USB_ARCH_HAS_XHCI=y
> CONFIG_USB_SUPPORT=y
> CONFIG_USB_ARCH_HAS_HCD=y
> # CONFIG_USB is not set
> # CONFIG_USB_HCD_BCMA is not set
> 
> #
> # NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
> #
> # CONFIG_USB_EZUSB_FX2 is not set
> # CONFIG_OMAP_USB2 is not set
> # CONFIG_USB_GADGET is not set
> 
> #
> # OTG and related infrastructure
> #
> CONFIG_UWB=m
> # CONFIG_UWB_WHCI is not set
> CONFIG_MMC=m
> # CONFIG_MMC_DEBUG is not set
> CONFIG_MMC_UNSAFE_RESUME=y
> CONFIG_MMC_CLKGATE=y
> 
> #
> # MMC/SD/SDIO Card Drivers
> #
> # CONFIG_MMC_BLOCK is not set
> # CONFIG_SDIO_UART is not set
> CONFIG_MMC_TEST=m
> 
> #
> # MMC/SD/SDIO Host Controller Drivers
> #
> # CONFIG_MMC_SDHCI is not set
> # CONFIG_MMC_WBSD is not set
> CONFIG_MMC_TIFM_SD=m
> CONFIG_MMC_SPI=m
> CONFIG_MMC_SDRICOH_CS=m
> # CONFIG_MMC_CB710 is not set
> # CONFIG_MMC_VIA_SDMMC is not set
> CONFIG_MEMSTICK=m
> CONFIG_MEMSTICK_DEBUG=y
> 
> #
> # MemoryStick drivers
> #
> # CONFIG_MEMSTICK_UNSAFE_RESUME is not set
> # CONFIG_MSPRO_BLOCK is not set
> 
> #
> # MemoryStick Host Controller Drivers
> #
> CONFIG_MEMSTICK_TIFM_MS=m
> CONFIG_MEMSTICK_JMICRON_38X=m
> CONFIG_MEMSTICK_R592=m
> CONFIG_NEW_LEDS=y
> CONFIG_LEDS_CLASS=m
> 
> #
> # LED drivers
> #
> CONFIG_LEDS_LM3530=m
> CONFIG_LEDS_LM3533=m
> CONFIG_LEDS_LM3642=m
> # CONFIG_LEDS_PCA9532 is not set
> # CONFIG_LEDS_LP3944 is not set
> CONFIG_LEDS_LP5521=m
> # CONFIG_LEDS_LP5523 is not set
> CONFIG_LEDS_CLEVO_MAIL=m
> # CONFIG_LEDS_PCA955X is not set
> # CONFIG_LEDS_PCA9633 is not set
> CONFIG_LEDS_WM831X_STATUS=m
> # CONFIG_LEDS_DAC124S085 is not set
> # CONFIG_LEDS_BD2802 is not set
> # CONFIG_LEDS_INTEL_SS4200 is not set
> CONFIG_LEDS_TCA6507=m
> # CONFIG_LEDS_LM355x is not set
> CONFIG_LEDS_OT200=m
> CONFIG_LEDS_BLINKM=m
> # CONFIG_LEDS_TRIGGERS is not set
> 
> #
> # LED Triggers
> #
> CONFIG_ACCESSIBILITY=y
> # CONFIG_A11Y_BRAILLE_CONSOLE is not set
> CONFIG_INFINIBAND=m
> CONFIG_INFINIBAND_USER_MAD=m
> CONFIG_INFINIBAND_USER_ACCESS=m
> CONFIG_INFINIBAND_USER_MEM=y
> # CONFIG_INFINIBAND_MTHCA is not set
> # CONFIG_INFINIBAND_QIB is not set
> # CONFIG_INFINIBAND_SRP is not set
> # CONFIG_INFINIBAND_SRPT is not set
> # CONFIG_EDAC is not set
> # CONFIG_RTC_CLASS is not set
> # CONFIG_DMADEVICES is not set
> CONFIG_AUXDISPLAY=y
> CONFIG_UIO=m
> CONFIG_UIO_CIF=m
> # CONFIG_UIO_PDRV is not set
> CONFIG_UIO_PDRV_GENIRQ=m
> CONFIG_UIO_AEC=m
> # CONFIG_UIO_SERCOS3 is not set
> # CONFIG_UIO_PCI_GENERIC is not set
> # CONFIG_UIO_NETX is not set
> CONFIG_VIRTIO=m
> 
> #
> # Virtio drivers
> #
> CONFIG_VIRTIO_PCI=m
> CONFIG_VIRTIO_BALLOON=m
> CONFIG_VIRTIO_MMIO=m
> CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
> 
> #
> # Microsoft Hyper-V guest support
> #
> # CONFIG_HYPERV is not set
> 
> #
> # Xen driver support
> #
> # CONFIG_XEN_BALLOON is not set
> CONFIG_XEN_DEV_EVTCHN=m
> CONFIG_XEN_BACKEND=y
> CONFIG_XENFS=m
> # CONFIG_XEN_COMPAT_XENFS is not set
> # CONFIG_XEN_SYS_HYPERVISOR is not set
> CONFIG_XEN_XENBUS_FRONTEND=y
> CONFIG_XEN_GNTDEV=m
> CONFIG_XEN_GRANT_DEV_ALLOC=m
> CONFIG_SWIOTLB_XEN=y
> CONFIG_XEN_TMEM=y
> CONFIG_XEN_PCIDEV_BACKEND=m
> CONFIG_XEN_PRIVCMD=m
> # CONFIG_XEN_MCE_LOG is not set
> CONFIG_STAGING=y
> # CONFIG_SLICOSS is not set
> CONFIG_ECHO=m
> # CONFIG_COMEDI is not set
> # CONFIG_PANEL is not set
> # CONFIG_RTS_PSTOR is not set
> CONFIG_DX_SEP=m
> 
> #
> # IIO staging drivers
> #
> CONFIG_IIO_ST_HWMON=m
> CONFIG_IIO_SW_RING=m
> 
> #
> # Accelerometers
> #
> # CONFIG_ADIS16201 is not set
> CONFIG_ADIS16203=m
> CONFIG_ADIS16204=m
> CONFIG_ADIS16209=m
> CONFIG_ADIS16220=m
> # CONFIG_ADIS16240 is not set
> CONFIG_KXSD9=m
> CONFIG_SCA3000=m
> 
> #
> # Analog to digital converters
> #
> # CONFIG_AD7291 is not set
> # CONFIG_AD7298 is not set
> # CONFIG_AD799X is not set
> # CONFIG_AD7887 is not set
> # CONFIG_AD7793 is not set
> CONFIG_AD7192=m
> CONFIG_ADT7310=m
> CONFIG_ADT7410=m
> # CONFIG_AD7280 is not set
> CONFIG_MAX1363=m
> CONFIG_MAX1363_RING_BUFFER=y
> 
> #
> # Analog digital bi-direction converters
> #
> 
> #
> # Capacitance to digital converters
> #
> # CONFIG_AD7150 is not set
> # CONFIG_AD7152 is not set
> # CONFIG_AD7746 is not set
> 
> #
> # Direct Digital Synthesis
> #
> CONFIG_AD5930=m
> CONFIG_AD9832=m
> CONFIG_AD9834=m
> # CONFIG_AD9850 is not set
> CONFIG_AD9852=m
> CONFIG_AD9910=m
> # CONFIG_AD9951 is not set
> 
> #
> # Digital gyroscope sensors
> #
> CONFIG_ADIS16060=m
> CONFIG_ADIS16080=m
> CONFIG_ADIS16130=m
> # CONFIG_ADIS16260 is not set
> # CONFIG_ADXRS450 is not set
> 
> #
> # Network Analyzer, Impedance Converters
> #
> # CONFIG_AD5933 is not set
> 
> #
> # Inertial measurement units
> #
> # CONFIG_ADIS16400 is not set
> 
> #
> # Light sensors
> #
> # CONFIG_SENSORS_ISL29018 is not set
> CONFIG_SENSORS_ISL29028=m
> # CONFIG_SENSORS_TSL2563 is not set
> # CONFIG_TSL2583 is not set
> CONFIG_TSL2x7x=m
> 
> #
> # Magnetometer sensors
> #
> CONFIG_SENSORS_HMC5843=m
> 
> #
> # Active energy metering IC
> #
> # CONFIG_ADE7753 is not set
> CONFIG_ADE7754=m
> # CONFIG_ADE7758 is not set
> CONFIG_ADE7759=m
> CONFIG_ADE7854=m
> CONFIG_ADE7854_I2C=m
> # CONFIG_ADE7854_SPI is not set
> 
> #
> # Resolver to digital converters
> #
> CONFIG_AD2S90=m
> 
> #
> # Triggers - standalone
> #
> CONFIG_IIO_SYSFS_TRIGGER=m
> # CONFIG_IIO_SIMPLE_DUMMY is not set
> # CONFIG_ZSMALLOC is not set
> # CONFIG_FB_SM7XX is not set
> # CONFIG_CRYSTALHD is not set
> # CONFIG_FB_XGI is not set
> # CONFIG_ACPI_QUICKSTART is not set
> # CONFIG_FT1000 is not set
> 
> #
> # Speakup console speech
> #
> CONFIG_SPEAKUP=m
> CONFIG_SPEAKUP_SYNTH_ACNTSA=m
> CONFIG_SPEAKUP_SYNTH_ACNTPC=m
> # CONFIG_SPEAKUP_SYNTH_APOLLO is not set
> # CONFIG_SPEAKUP_SYNTH_AUDPTR is not set
> CONFIG_SPEAKUP_SYNTH_BNS=m
> CONFIG_SPEAKUP_SYNTH_DECTLK=m
> # CONFIG_SPEAKUP_SYNTH_DECEXT is not set
> # CONFIG_SPEAKUP_SYNTH_DECPC is not set
> # CONFIG_SPEAKUP_SYNTH_DTLK is not set
> # CONFIG_SPEAKUP_SYNTH_KEYPC is not set
> # CONFIG_SPEAKUP_SYNTH_LTLK is not set
> CONFIG_SPEAKUP_SYNTH_SOFT=m
> CONFIG_SPEAKUP_SYNTH_SPKOUT=m
> # CONFIG_SPEAKUP_SYNTH_TXPRT is not set
> CONFIG_SPEAKUP_SYNTH_DUMMY=m
> CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4=m
> CONFIG_STAGING_MEDIA=y
> 
> #
> # Android
> #
> # CONFIG_ANDROID is not set
> # CONFIG_PHONE is not set
> CONFIG_IPACK_BUS=m
> CONFIG_BOARD_TPCI200=m
> CONFIG_SERIAL_IPOCTAL=m
> # CONFIG_WIMAX_GDM72XX is not set
> # CONFIG_NET_VENDOR_SILICOM is not set
> CONFIG_DGRP=m
> # CONFIG_X86_PLATFORM_DEVICES is not set
> 
> #
> # Hardware Spinlock drivers
> #
> CONFIG_CLKEVT_I8253=y
> CONFIG_I8253_LOCK=y
> CONFIG_CLKBLD_I8253=y
> # CONFIG_IOMMU_SUPPORT is not set
> 
> #
> # Remoteproc drivers (EXPERIMENTAL)
> #
> CONFIG_REMOTEPROC=m
> CONFIG_STE_MODEM_RPROC=m
> 
> #
> # Rpmsg drivers (EXPERIMENTAL)
> #
> CONFIG_VIRT_DRIVERS=y
> CONFIG_PM_DEVFREQ=y
> 
> #
> # DEVFREQ Governors
> #
> # CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND is not set
> # CONFIG_DEVFREQ_GOV_PERFORMANCE is not set
> CONFIG_DEVFREQ_GOV_POWERSAVE=y
> # CONFIG_DEVFREQ_GOV_USERSPACE is not set
> 
> #
> # DEVFREQ Drivers
> #
> # CONFIG_EXTCON is not set
> # CONFIG_MEMORY is not set
> CONFIG_IIO=m
> CONFIG_IIO_BUFFER=y
> CONFIG_IIO_KFIFO_BUF=m
> CONFIG_IIO_TRIGGERED_BUFFER=m
> CONFIG_IIO_TRIGGER=y
> CONFIG_IIO_CONSUMERS_PER_TRIGGER=2
> 
> #
> # Accelerometers
> #
> 
> #
> # Analog to digital converters
> #
> CONFIG_AD_SIGMA_DELTA=m
> # CONFIG_AD7266 is not set
> CONFIG_AD7791=m
> # CONFIG_AD7476 is not set
> 
> #
> # Amplifiers
> #
> # CONFIG_AD8366 is not set
> 
> #
> # Light sensors
> #
> CONFIG_ADJD_S311=m
> CONFIG_SENSORS_LM3533=m
> CONFIG_VCNL4000=m
> 
> #
> # Frequency Synthesizers DDS/PLL
> #
> 
> #
> # Clock Generator/Distribution
> #
> # CONFIG_AD9523 is not set
> 
> #
> # Phase-Locked Loop (PLL) frequency synthesizers
> #
> # CONFIG_ADF4350 is not set
> 
> #
> # Digital to analog converters
> #
> # CONFIG_AD5064 is not set
> CONFIG_AD5360=m
> CONFIG_AD5380=m
> # CONFIG_AD5421 is not set
> # CONFIG_AD5624R_SPI is not set
> # CONFIG_AD5446 is not set
> # CONFIG_AD5504 is not set
> # CONFIG_AD5755 is not set
> # CONFIG_AD5764 is not set
> # CONFIG_AD5791 is not set
> CONFIG_AD5686=m
> # CONFIG_MAX517 is not set
> CONFIG_MCP4725=m
> 
> #
> # Hid Sensor IIO Common
> #
> 
> #
> # Digital gyroscope sensors
> #
> 
> #
> # Magnetometer sensors
> #
> # CONFIG_VME_BUS is not set
> CONFIG_PWM=y
> 
> #
> # Firmware Drivers
> #
> CONFIG_EDD=m
> # CONFIG_EDD_OFF is not set
> CONFIG_FIRMWARE_MEMMAP=y
> CONFIG_DELL_RBU=m
> # CONFIG_DCDBAS is not set
> # CONFIG_DMIID is not set
> CONFIG_DMI_SYSFS=m
> # CONFIG_ISCSI_IBFT_FIND is not set
> # CONFIG_GOOGLE_FIRMWARE is not set
> 
> #
> # File systems
> #
> CONFIG_DCACHE_WORD_ACCESS=y
> # CONFIG_EXT2_FS is not set
> CONFIG_EXT3_FS=m
> # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
> CONFIG_EXT3_FS_XATTR=y
> CONFIG_EXT3_FS_POSIX_ACL=y
> # CONFIG_EXT3_FS_SECURITY is not set
> # CONFIG_EXT4_FS is not set
> CONFIG_JBD=m
> CONFIG_JBD_DEBUG=y
> CONFIG_FS_MBCACHE=m
> CONFIG_REISERFS_FS=m
> CONFIG_REISERFS_CHECK=y
> # CONFIG_REISERFS_PROC_INFO is not set
> CONFIG_REISERFS_FS_XATTR=y
> CONFIG_REISERFS_FS_POSIX_ACL=y
> # CONFIG_REISERFS_FS_SECURITY is not set
> # CONFIG_JFS_FS is not set
> CONFIG_XFS_FS=m
> CONFIG_XFS_QUOTA=y
> CONFIG_XFS_POSIX_ACL=y
> # CONFIG_XFS_RT is not set
> # CONFIG_XFS_DEBUG is not set
> # CONFIG_GFS2_FS is not set
> # CONFIG_OCFS2_FS is not set
> # CONFIG_BTRFS_FS is not set
> # CONFIG_NILFS2_FS is not set
> CONFIG_FS_POSIX_ACL=y
> CONFIG_EXPORTFS=m
> CONFIG_FILE_LOCKING=y
> CONFIG_FSNOTIFY=y
> CONFIG_DNOTIFY=y
> CONFIG_INOTIFY_USER=y
> # CONFIG_FANOTIFY is not set
> CONFIG_QUOTA=y
> CONFIG_QUOTA_NETLINK_INTERFACE=y
> CONFIG_PRINT_QUOTA_WARNING=y
> # CONFIG_QUOTA_DEBUG is not set
> # CONFIG_QFMT_V1 is not set
> # CONFIG_QFMT_V2 is not set
> CONFIG_QUOTACTL=y
> CONFIG_AUTOFS4_FS=m
> # CONFIG_FUSE_FS is not set
> CONFIG_GENERIC_ACL=y
> 
> #
> # Caches
> #
> # CONFIG_FSCACHE is not set
> 
> #
> # CD-ROM/DVD Filesystems
> #
> # CONFIG_ISO9660_FS is not set
> CONFIG_UDF_FS=m
> CONFIG_UDF_NLS=y
> 
> #
> # DOS/FAT/NT Filesystems
> #
> # CONFIG_MSDOS_FS is not set
> # CONFIG_VFAT_FS is not set
> CONFIG_NTFS_FS=m
> CONFIG_NTFS_DEBUG=y
> # CONFIG_NTFS_RW is not set
> 
> #
> # Pseudo filesystems
> #
> CONFIG_PROC_FS=y
> CONFIG_PROC_KCORE=y
> CONFIG_PROC_SYSCTL=y
> CONFIG_PROC_PAGE_MONITOR=y
> CONFIG_SYSFS=y
> CONFIG_TMPFS=y
> CONFIG_TMPFS_POSIX_ACL=y
> CONFIG_TMPFS_XATTR=y
> # CONFIG_HUGETLBFS is not set
> # CONFIG_HUGETLB_PAGE is not set
> CONFIG_CONFIGFS_FS=m
> # CONFIG_MISC_FILESYSTEMS is not set
> # CONFIG_NETWORK_FILESYSTEMS is not set
> CONFIG_NLS=y
> CONFIG_NLS_DEFAULT="iso8859-1"
> # CONFIG_NLS_CODEPAGE_437 is not set
> CONFIG_NLS_CODEPAGE_737=m
> # CONFIG_NLS_CODEPAGE_775 is not set
> CONFIG_NLS_CODEPAGE_850=m
> CONFIG_NLS_CODEPAGE_852=m
> CONFIG_NLS_CODEPAGE_855=m
> # CONFIG_NLS_CODEPAGE_857 is not set
> # CONFIG_NLS_CODEPAGE_860 is not set
> # CONFIG_NLS_CODEPAGE_861 is not set
> CONFIG_NLS_CODEPAGE_862=m
> CONFIG_NLS_CODEPAGE_863=m
> CONFIG_NLS_CODEPAGE_864=m
> # CONFIG_NLS_CODEPAGE_865 is not set
> CONFIG_NLS_CODEPAGE_866=m
> # CONFIG_NLS_CODEPAGE_869 is not set
> # CONFIG_NLS_CODEPAGE_936 is not set
> CONFIG_NLS_CODEPAGE_950=m
> # CONFIG_NLS_CODEPAGE_932 is not set
> CONFIG_NLS_CODEPAGE_949=m
> CONFIG_NLS_CODEPAGE_874=m
> CONFIG_NLS_ISO8859_8=m
> CONFIG_NLS_CODEPAGE_1250=m
> CONFIG_NLS_CODEPAGE_1251=m
> # CONFIG_NLS_ASCII is not set
> CONFIG_NLS_ISO8859_1=m
> CONFIG_NLS_ISO8859_2=m
> # CONFIG_NLS_ISO8859_3 is not set
> CONFIG_NLS_ISO8859_4=m
> # CONFIG_NLS_ISO8859_5 is not set
> CONFIG_NLS_ISO8859_6=m
> # CONFIG_NLS_ISO8859_7 is not set
> # CONFIG_NLS_ISO8859_9 is not set
> CONFIG_NLS_ISO8859_13=m
> CONFIG_NLS_ISO8859_14=m
> CONFIG_NLS_ISO8859_15=m
> CONFIG_NLS_KOI8_R=m
> CONFIG_NLS_KOI8_U=m
> # CONFIG_NLS_MAC_ROMAN is not set
> # CONFIG_NLS_MAC_CELTIC is not set
> # CONFIG_NLS_MAC_CENTEURO is not set
> CONFIG_NLS_MAC_CROATIAN=m
> CONFIG_NLS_MAC_CYRILLIC=m
> CONFIG_NLS_MAC_GAELIC=m
> CONFIG_NLS_MAC_GREEK=m
> CONFIG_NLS_MAC_ICELAND=m
> # CONFIG_NLS_MAC_INUIT is not set
> CONFIG_NLS_MAC_ROMANIAN=m
> CONFIG_NLS_MAC_TURKISH=m
> CONFIG_NLS_UTF8=m
> 
> #
> # Kernel hacking
> #
> CONFIG_TRACE_IRQFLAGS_SUPPORT=y
> CONFIG_PRINTK_TIME=y
> CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
> CONFIG_ENABLE_WARN_DEPRECATED=y
> # CONFIG_ENABLE_MUST_CHECK is not set
> CONFIG_FRAME_WARN=2048
> # CONFIG_MAGIC_SYSRQ is not set
> # CONFIG_STRIP_ASM_SYMS is not set
> # CONFIG_READABLE_ASM is not set
> # CONFIG_UNUSED_SYMBOLS is not set
> CONFIG_DEBUG_FS=y
> # CONFIG_HEADERS_CHECK is not set
> CONFIG_DEBUG_SECTION_MISMATCH=y
> CONFIG_DEBUG_KERNEL=y
> # CONFIG_DEBUG_SHIRQ is not set
> # CONFIG_LOCKUP_DETECTOR is not set
> # CONFIG_PANIC_ON_OOPS is not set
> CONFIG_PANIC_ON_OOPS_VALUE=0
> # CONFIG_DETECT_HUNG_TASK is not set
> CONFIG_SCHED_DEBUG=y
> # CONFIG_SCHEDSTATS is not set
> # CONFIG_TIMER_STATS is not set
> # CONFIG_DEBUG_OBJECTS is not set
> CONFIG_SLUB_DEBUG_ON=y
> CONFIG_SLUB_STATS=y
> CONFIG_HAVE_DEBUG_KMEMLEAK=y
> # CONFIG_DEBUG_KMEMLEAK is not set
> # CONFIG_DEBUG_RT_MUTEXES is not set
> # CONFIG_RT_MUTEX_TESTER is not set
> # CONFIG_DEBUG_SPINLOCK is not set
> # CONFIG_DEBUG_MUTEXES is not set
> # CONFIG_DEBUG_LOCK_ALLOC is not set
> # CONFIG_PROVE_LOCKING is not set
> CONFIG_SPARSE_RCU_POINTER=y
> # CONFIG_LOCK_STAT is not set
> CONFIG_DEBUG_ATOMIC_SLEEP=y
> # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
> # CONFIG_DEBUG_STACK_USAGE is not set
> # CONFIG_DEBUG_KOBJECT is not set
> CONFIG_DEBUG_BUGVERBOSE=y
> # CONFIG_DEBUG_INFO is not set
> # CONFIG_DEBUG_VM is not set
> # CONFIG_DEBUG_VIRTUAL is not set
> # CONFIG_DEBUG_WRITECOUNT is not set
> CONFIG_DEBUG_MEMORY_INIT=y
> # CONFIG_DEBUG_LIST is not set
> # CONFIG_TEST_LIST_SORT is not set
> # CONFIG_DEBUG_SG is not set
> # CONFIG_DEBUG_NOTIFIERS is not set
> # CONFIG_DEBUG_CREDENTIALS is not set
> CONFIG_ARCH_WANT_FRAME_POINTERS=y
> CONFIG_FRAME_POINTER=y
> # CONFIG_BOOT_PRINTK_DELAY is not set
> # CONFIG_RCU_TORTURE_TEST is not set
> # CONFIG_RCU_TRACE is not set
> # CONFIG_KPROBES_SANITY_TEST is not set
> # CONFIG_BACKTRACE_SELF_TEST is not set
> # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
> # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
> # CONFIG_LKDTM is not set
> # CONFIG_NOTIFIER_ERROR_INJECTION is not set
> # CONFIG_FAULT_INJECTION is not set
> # CONFIG_LATENCYTOP is not set
> # CONFIG_DEBUG_PAGEALLOC is not set
> CONFIG_USER_STACKTRACE_SUPPORT=y
> CONFIG_HAVE_FUNCTION_TRACER=y
> CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
> CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
> CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
> CONFIG_HAVE_DYNAMIC_FTRACE=y
> CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
> CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
> CONFIG_HAVE_FENTRY=y
> CONFIG_HAVE_C_RECORDMCOUNT=y
> CONFIG_TRACING_SUPPORT=y
> # CONFIG_FTRACE is not set
> # CONFIG_RBTREE_TEST is not set
> # CONFIG_INTERVAL_TREE_TEST is not set
> CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
> CONFIG_DYNAMIC_DEBUG=y
> CONFIG_DMA_API_DEBUG=y
> # CONFIG_ATOMIC64_SELFTEST is not set
> # CONFIG_SAMPLES is not set
> CONFIG_HAVE_ARCH_KGDB=y
> # CONFIG_KGDB is not set
> CONFIG_HAVE_ARCH_KMEMCHECK=y
> CONFIG_TEST_KSTRTOX=m
> # CONFIG_STRICT_DEVMEM is not set
> CONFIG_X86_VERBOSE_BOOTUP=y
> CONFIG_EARLY_PRINTK=y
> CONFIG_EARLY_PRINTK_DBGP=y
> # CONFIG_DEBUG_STACKOVERFLOW is not set
> # CONFIG_X86_PTDUMP is not set
> CONFIG_DEBUG_RODATA=y
> CONFIG_DEBUG_RODATA_TEST=y
> # CONFIG_DEBUG_SET_MODULE_RONX is not set
> # CONFIG_DEBUG_NX_TEST is not set
> # CONFIG_DEBUG_TLBFLUSH is not set
> # CONFIG_IOMMU_DEBUG is not set
> # CONFIG_IOMMU_STRESS is not set
> CONFIG_HAVE_MMIOTRACE_SUPPORT=y
> # CONFIG_X86_DECODER_SELFTEST is not set
> CONFIG_IO_DELAY_TYPE_0X80=0
> CONFIG_IO_DELAY_TYPE_0XED=1
> CONFIG_IO_DELAY_TYPE_UDELAY=2
> CONFIG_IO_DELAY_TYPE_NONE=3
> # CONFIG_IO_DELAY_0X80 is not set
> # CONFIG_IO_DELAY_0XED is not set
> CONFIG_IO_DELAY_UDELAY=y
> # CONFIG_IO_DELAY_NONE is not set
> CONFIG_DEFAULT_IO_DELAY_TYPE=2
> # CONFIG_DEBUG_BOOT_PARAMS is not set
> # CONFIG_CPA_DEBUG is not set
> # CONFIG_OPTIMIZE_INLINING is not set
> # CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
> # CONFIG_DEBUG_NMI_SELFTEST is not set
> 
> #
> # Security options
> #
> CONFIG_KEYS=y
> CONFIG_TRUSTED_KEYS=m
> # CONFIG_ENCRYPTED_KEYS is not set
> # CONFIG_KEYS_DEBUG_PROC_KEYS is not set
> CONFIG_SECURITY_DMESG_RESTRICT=y
> CONFIG_SECURITY=y
> CONFIG_SECURITYFS=y
> CONFIG_SECURITY_NETWORK=y
> # CONFIG_SECURITY_NETWORK_XFRM is not set
> CONFIG_SECURITY_PATH=y
> # CONFIG_SECURITY_TOMOYO is not set
> CONFIG_SECURITY_APPARMOR=y
> CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1
> # CONFIG_SECURITY_YAMA is not set
> CONFIG_INTEGRITY=y
> CONFIG_INTEGRITY_SIGNATURE=y
> CONFIG_IMA=y
> CONFIG_IMA_MEASURE_PCR_IDX=10
> # CONFIG_IMA_AUDIT is not set
> CONFIG_IMA_APPRAISE=y
> CONFIG_DEFAULT_SECURITY_APPARMOR=y
> # CONFIG_DEFAULT_SECURITY_DAC is not set
> CONFIG_DEFAULT_SECURITY="apparmor"
> CONFIG_CRYPTO=y
> 
> #
> # Crypto core or helper
> #
> CONFIG_CRYPTO_ALGAPI=y
> CONFIG_CRYPTO_ALGAPI2=y
> CONFIG_CRYPTO_AEAD=m
> CONFIG_CRYPTO_AEAD2=y
> CONFIG_CRYPTO_BLKCIPHER=m
> CONFIG_CRYPTO_BLKCIPHER2=y
> CONFIG_CRYPTO_HASH=y
> CONFIG_CRYPTO_HASH2=y
> CONFIG_CRYPTO_RNG=m
> CONFIG_CRYPTO_RNG2=y
> CONFIG_CRYPTO_PCOMP=m
> CONFIG_CRYPTO_PCOMP2=y
> CONFIG_CRYPTO_MANAGER=y
> CONFIG_CRYPTO_MANAGER2=y
> CONFIG_CRYPTO_USER=m
> CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
> CONFIG_CRYPTO_GF128MUL=m
> CONFIG_CRYPTO_NULL=m
> CONFIG_CRYPTO_WORKQUEUE=y
> CONFIG_CRYPTO_CRYPTD=m
> # CONFIG_CRYPTO_AUTHENC is not set
> # CONFIG_CRYPTO_TEST is not set
> CONFIG_CRYPTO_ABLK_HELPER_X86=m
> CONFIG_CRYPTO_GLUE_HELPER_X86=m
> 
> #
> # Authenticated Encryption with Associated Data
> #
> CONFIG_CRYPTO_CCM=m
> CONFIG_CRYPTO_GCM=m
> CONFIG_CRYPTO_SEQIV=m
> 
> #
> # Block modes
> #
> # CONFIG_CRYPTO_CBC is not set
> CONFIG_CRYPTO_CTR=m
> CONFIG_CRYPTO_CTS=m
> CONFIG_CRYPTO_ECB=m
> CONFIG_CRYPTO_LRW=m
> # CONFIG_CRYPTO_PCBC is not set
> CONFIG_CRYPTO_XTS=m
> 
> #
> # Hash modes
> #
> CONFIG_CRYPTO_HMAC=y
> CONFIG_CRYPTO_XCBC=m
> # CONFIG_CRYPTO_VMAC is not set
> 
> #
> # Digest
> #
> # CONFIG_CRYPTO_CRC32C is not set
> CONFIG_CRYPTO_CRC32C_INTEL=m
> CONFIG_CRYPTO_GHASH=m
> # CONFIG_CRYPTO_MD4 is not set
> CONFIG_CRYPTO_MD5=y
> CONFIG_CRYPTO_MICHAEL_MIC=m
> # CONFIG_CRYPTO_RMD128 is not set
> # CONFIG_CRYPTO_RMD160 is not set
> # CONFIG_CRYPTO_RMD256 is not set
> CONFIG_CRYPTO_RMD320=m
> CONFIG_CRYPTO_SHA1=y
> CONFIG_CRYPTO_SHA1_SSSE3=m
> CONFIG_CRYPTO_SHA256=y
> # CONFIG_CRYPTO_SHA512 is not set
> # CONFIG_CRYPTO_TGR192 is not set
> # CONFIG_CRYPTO_WP512 is not set
> # CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL is not set
> 
> #
> # Ciphers
> #
> CONFIG_CRYPTO_AES=m
> CONFIG_CRYPTO_AES_X86_64=m
> CONFIG_CRYPTO_AES_NI_INTEL=m
> CONFIG_CRYPTO_ANUBIS=m
> CONFIG_CRYPTO_ARC4=m
> CONFIG_CRYPTO_BLOWFISH=m
> CONFIG_CRYPTO_BLOWFISH_COMMON=m
> # CONFIG_CRYPTO_BLOWFISH_X86_64 is not set
> CONFIG_CRYPTO_CAMELLIA=m
> CONFIG_CRYPTO_CAMELLIA_X86_64=m
> CONFIG_CRYPTO_CAST5=m
> # CONFIG_CRYPTO_CAST5_AVX_X86_64 is not set
> CONFIG_CRYPTO_CAST6=m
> # CONFIG_CRYPTO_CAST6_AVX_X86_64 is not set
> CONFIG_CRYPTO_DES=m
> # CONFIG_CRYPTO_FCRYPT is not set
> # CONFIG_CRYPTO_KHAZAD is not set
> # CONFIG_CRYPTO_SALSA20 is not set
> CONFIG_CRYPTO_SALSA20_X86_64=m
> # CONFIG_CRYPTO_SEED is not set
> CONFIG_CRYPTO_SERPENT=m
> CONFIG_CRYPTO_SERPENT_SSE2_X86_64=m
> # CONFIG_CRYPTO_SERPENT_AVX_X86_64 is not set
> # CONFIG_CRYPTO_TEA is not set
> CONFIG_CRYPTO_TWOFISH=m
> CONFIG_CRYPTO_TWOFISH_COMMON=m
> CONFIG_CRYPTO_TWOFISH_X86_64=m
> CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=m
> CONFIG_CRYPTO_TWOFISH_AVX_X86_64=m
> 
> #
> # Compression
> #
> CONFIG_CRYPTO_DEFLATE=m
> CONFIG_CRYPTO_ZLIB=m
> # CONFIG_CRYPTO_LZO is not set
> 
> #
> # Random Number Generation
> #
> CONFIG_CRYPTO_ANSI_CPRNG=m
> CONFIG_CRYPTO_USER_API=m
> CONFIG_CRYPTO_USER_API_HASH=m
> # CONFIG_CRYPTO_USER_API_SKCIPHER is not set
> CONFIG_CRYPTO_HW=y
> # CONFIG_CRYPTO_DEV_PADLOCK is not set
> CONFIG_ASYMMETRIC_KEY_TYPE=y
> CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
> CONFIG_PUBLIC_KEY_ALGO_RSA=y
> CONFIG_X509_CERTIFICATE_PARSER=y
> CONFIG_HAVE_KVM=y
> # CONFIG_VIRTUALIZATION is not set
> # CONFIG_BINARY_PRINTF is not set
> 
> #
> # Library routines
> #
> CONFIG_BITREVERSE=y
> CONFIG_GENERIC_STRNCPY_FROM_USER=y
> CONFIG_GENERIC_STRNLEN_USER=y
> CONFIG_GENERIC_FIND_FIRST_BIT=y
> CONFIG_GENERIC_PCI_IOMAP=y
> CONFIG_GENERIC_IOMAP=y
> CONFIG_GENERIC_IO=y
> CONFIG_CRC_CCITT=m
> CONFIG_CRC16=m
> CONFIG_CRC_T10DIF=m
> CONFIG_CRC_ITU_T=m
> CONFIG_CRC32=y
> # CONFIG_CRC32_SELFTEST is not set
> CONFIG_CRC32_SLICEBY8=y
> # CONFIG_CRC32_SLICEBY4 is not set
> # CONFIG_CRC32_SARWATE is not set
> # CONFIG_CRC32_BIT is not set
> CONFIG_CRC7=m
> # CONFIG_LIBCRC32C is not set
> CONFIG_CRC8=m
> CONFIG_ZLIB_INFLATE=y
> CONFIG_ZLIB_DEFLATE=m
> CONFIG_LZO_COMPRESS=y
> CONFIG_LZO_DECOMPRESS=y
> CONFIG_XZ_DEC=y
> CONFIG_XZ_DEC_X86=y
> CONFIG_XZ_DEC_POWERPC=y
> CONFIG_XZ_DEC_IA64=y
> CONFIG_XZ_DEC_ARM=y
> CONFIG_XZ_DEC_ARMTHUMB=y
> CONFIG_XZ_DEC_SPARC=y
> CONFIG_XZ_DEC_BCJ=y
> CONFIG_XZ_DEC_TEST=m
> CONFIG_DECOMPRESS_GZIP=y
> CONFIG_DECOMPRESS_BZIP2=y
> CONFIG_DECOMPRESS_LZMA=y
> CONFIG_DECOMPRESS_XZ=y
> CONFIG_DECOMPRESS_LZO=y
> CONFIG_HAS_IOMEM=y
> CONFIG_HAS_IOPORT=y
> CONFIG_HAS_DMA=y
> CONFIG_CHECK_SIGNATURE=y
> CONFIG_DQL=y
> CONFIG_NLATTR=y
> CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
> CONFIG_AVERAGE=y
> CONFIG_CLZ_TAB=y
> # CONFIG_CORDIC is not set
> # CONFIG_DDR is not set
> CONFIG_MPILIB=y
> CONFIG_SIGNATURE=y
> CONFIG_OID_REGISTRY=y


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 22:23:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 22:23:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdq2G-0001Pg-NK; Wed, 28 Nov 2012 22:23:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Tdq2F-0001PZ-0W
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 22:23:15 +0000
Received: from [85.158.138.51:43728] by server-11.bemta-3.messagelabs.com id
	84/C7-19361-2DE86B05; Wed, 28 Nov 2012 22:23:14 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-15.tower-174.messagelabs.com!1354141392!29985719!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20510 invoked from network); 28 Nov 2012 22:23:13 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-15.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 22:23:13 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158321685;
	Wed, 28 Nov 2012 17:23:04 -0500
Message-ID: <50B68EC3.1070803@jhuapl.edu>
Date: Wed, 28 Nov 2012 17:22:59 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Konrad Rzeszutek Wilk <konrad@kernel.org>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
	<1353668646.13542.228.camel@zakaz.uk.xensource.com>
	<20121128204630.GB3479@phenom.dumpdata.com>
In-Reply-To: <20121128204630.GB3479@phenom.dumpdata.com>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3337478303845528342=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============3337478303845528342==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms060103010701090800050206"

This is a cryptographically signed message in MIME format.

--------------ms060103010701090800050206
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/28/2012 03:46 PM, Konrad Rzeszutek Wilk wrote:
> On Fri, Nov 23, 2012 at 11:04:06AM +0000, Ian Campbell wrote:
>> On Tue, 2012-11-20 at 16:16 +0000, Fioravante, Matthew E. wrote:
>>> This was something I've been wanting to do for a while so I'm very
>>> happy you went ahead and fixed it yourself. Once you submit the linux=

>>> version I'll test it on my system.
>>>
>>> Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>> Do we need to synchronise with anything else (Linux drivers?) or I can=
 I
>> just throw this into the tree once it is done?
>>
>> Are we hanging any existing users of the tpm stuff out to dry? Could w=
e
>> get a feature-protocol-v2 flag in xenstore so users at least get an
>> error message from either the front or backend to give a hint why it
>> isn't working?
> We could cop out and just name this new driver differently. Then
> we would not have to deal with the older ones.
I've already done that with my patch on the linux mailing list. The old=20
frontend driver name was tpm_xenu.ko, the new one is xen-tpmfront.ko.
>
>>>   void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)  {
>>> -   tpmif_tx_request_t* tx;
>>> -   int offset;
>>> -   int i;
>>> -   uint32_t domid;
>>> -   int tocopy;
>>> +   vtpm_shared_page_t* shr;
>>> +   unsigned int offset;
>>>      int flags;
>>> +#ifdef TPMBACK_PRINT_DEBUG
>>> +int i;
>>> +#endif
>> Dodgy indentation? (I saw a bunch of these)
>>
>>> - * Copyright (c) 2005, IBM Corporation
>>> - *
>>> - * Author: Stefan Berger, stefanb@us.ibm.com
>>> - * Grant table support: Mahadevan Gomathisankaran
>> Did you really remove everything these guys wrote?
>>
>>> - * This code has been derived from tools/libxc/xen/io/netif.h
>>> - *
>>> - * Copyright (c) 2003-2004, Keir Fraser
>> I guess I can buy this bit no longer being true given that you reworke=
d
>> the whole protocol.
>>
>> Ian
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>>



--------------ms060103010701090800050206
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTI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dZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEyODIyMjI1OVowIwYJKoZIhvcNAQkEMRYEFOBMqigAeBTA6AC/
E9MZxrW+fOanMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAnByT+3j7nIXCkxm0F87XvbStVGcRWMHAi
boWOvguPLj1XAR/4hFbDDtivqQNm260vULbk6eHWAUFdb8vsapbXc2WSo3e+j6LOtNX6Gnef
JUGHxDNNsartLylvpjTh38TDzxKFSBefmBvCPlXUPfckw+Nrsyz2T2DMgjtV5svWMQAAAAAA
AA==
--------------ms060103010701090800050206--


--===============3337478303845528342==
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.xen.org
http://lists.xen.org/xen-devel

--===============3337478303845528342==--


From xen-devel-bounces@lists.xen.org Wed Nov 28 22:23:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 22:23:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdq2G-0001Pg-NK; Wed, 28 Nov 2012 22:23:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Tdq2F-0001PZ-0W
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 22:23:15 +0000
Received: from [85.158.138.51:43728] by server-11.bemta-3.messagelabs.com id
	84/C7-19361-2DE86B05; Wed, 28 Nov 2012 22:23:14 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-15.tower-174.messagelabs.com!1354141392!29985719!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20510 invoked from network); 28 Nov 2012 22:23:13 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-15.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 22:23:13 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158321685;
	Wed, 28 Nov 2012 17:23:04 -0500
Message-ID: <50B68EC3.1070803@jhuapl.edu>
Date: Wed, 28 Nov 2012 17:22:59 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Konrad Rzeszutek Wilk <konrad@kernel.org>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
	<1353668646.13542.228.camel@zakaz.uk.xensource.com>
	<20121128204630.GB3479@phenom.dumpdata.com>
In-Reply-To: <20121128204630.GB3479@phenom.dumpdata.com>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3337478303845528342=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============3337478303845528342==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms060103010701090800050206"

This is a cryptographically signed message in MIME format.

--------------ms060103010701090800050206
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/28/2012 03:46 PM, Konrad Rzeszutek Wilk wrote:
> On Fri, Nov 23, 2012 at 11:04:06AM +0000, Ian Campbell wrote:
>> On Tue, 2012-11-20 at 16:16 +0000, Fioravante, Matthew E. wrote:
>>> This was something I've been wanting to do for a while so I'm very
>>> happy you went ahead and fixed it yourself. Once you submit the linux=

>>> version I'll test it on my system.
>>>
>>> Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
>> Do we need to synchronise with anything else (Linux drivers?) or I can=
 I
>> just throw this into the tree once it is done?
>>
>> Are we hanging any existing users of the tpm stuff out to dry? Could w=
e
>> get a feature-protocol-v2 flag in xenstore so users at least get an
>> error message from either the front or backend to give a hint why it
>> isn't working?
> We could cop out and just name this new driver differently. Then
> we would not have to deal with the older ones.
I've already done that with my patch on the linux mailing list. The old=20
frontend driver name was tpm_xenu.ko, the new one is xen-tpmfront.ko.
>
>>>   void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)  {
>>> -   tpmif_tx_request_t* tx;
>>> -   int offset;
>>> -   int i;
>>> -   uint32_t domid;
>>> -   int tocopy;
>>> +   vtpm_shared_page_t* shr;
>>> +   unsigned int offset;
>>>      int flags;
>>> +#ifdef TPMBACK_PRINT_DEBUG
>>> +int i;
>>> +#endif
>> Dodgy indentation? (I saw a bunch of these)
>>
>>> - * Copyright (c) 2005, IBM Corporation
>>> - *
>>> - * Author: Stefan Berger, stefanb@us.ibm.com
>>> - * Grant table support: Mahadevan Gomathisankaran
>> Did you really remove everything these guys wrote?
>>
>>> - * This code has been derived from tools/libxc/xen/io/netif.h
>>> - *
>>> - * Copyright (c) 2003-2004, Keir Fraser
>> I guess I can buy this bit no longer being true given that you reworke=
d
>> the whole protocol.
>>
>> Ian
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>>



--------------ms060103010701090800050206
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2Y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VBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEyODIyMjI1OVowIwYJKoZIhvcNAQkEMRYEFOBMqigAeBTA6AC/
E9MZxrW+fOanMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAnByT+3j7nIXCkxm0F87XvbStVGcRWMHAi
boWOvguPLj1XAR/4hFbDDtivqQNm260vULbk6eHWAUFdb8vsapbXc2WSo3e+j6LOtNX6Gnef
JUGHxDNNsartLylvpjTh38TDzxKFSBefmBvCPlXUPfckw+Nrsyz2T2DMgjtV5svWMQAAAAAA
AA==
--------------ms060103010701090800050206--


--===============3337478303845528342==
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.xen.org
http://lists.xen.org/xen-devel

--===============3337478303845528342==--


From xen-devel-bounces@lists.xen.org Wed Nov 28 22:58:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 22:58:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdqaG-0002In-27; Wed, 28 Nov 2012 22:58:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdqaF-0002Ii-1f
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 22:58:23 +0000
Received: from [85.158.138.51:13286] by server-12.bemta-3.messagelabs.com id
	65/CC-22757-E0796B05; Wed, 28 Nov 2012 22:58:22 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1354143500!31810602!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26859 invoked from network); 28 Nov 2012 22:58:21 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-16.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 22:58:21 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 98D4784074;
	Wed, 28 Nov 2012 23:58:19 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id Xj7TowFR23q8; Wed, 28 Nov 2012 23:58:19 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id A22C284072;
	Wed, 28 Nov 2012 23:58:17 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1Tdpe9-0001bI-AJ; Wed, 28 Nov 2012 22:58:21 +0100
Date: Wed, 28 Nov 2012 22:58:21 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121128215821.GB6109@type>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B5042B.7000602@jhuapl.edu> <50B50E3E.6050807@tycho.nsa.gov>
	<50B5190D.20604@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B5190D.20604@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Tue 27 Nov 2012 14:48:29 -0500, a =E9crit :
> What is really needed is a way to do an xl shutdown on mini-os domains to
> let vtpm-stubdom shutdown correctly. From what I understand there is not =
yet
> any support for this in mini-os. How tricky would it be to add that? Samu=
el
> any ideas?

I have just posted a patch for this.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 22:58:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 22:58:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdqaG-0002In-27; Wed, 28 Nov 2012 22:58:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdqaF-0002Ii-1f
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 22:58:23 +0000
Received: from [85.158.138.51:13286] by server-12.bemta-3.messagelabs.com id
	65/CC-22757-E0796B05; Wed, 28 Nov 2012 22:58:22 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1354143500!31810602!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26859 invoked from network); 28 Nov 2012 22:58:21 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-16.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 22:58:21 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 98D4784074;
	Wed, 28 Nov 2012 23:58:19 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id Xj7TowFR23q8; Wed, 28 Nov 2012 23:58:19 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id A22C284072;
	Wed, 28 Nov 2012 23:58:17 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1Tdpe9-0001bI-AJ; Wed, 28 Nov 2012 22:58:21 +0100
Date: Wed, 28 Nov 2012 22:58:21 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121128215821.GB6109@type>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B5042B.7000602@jhuapl.edu> <50B50E3E.6050807@tycho.nsa.gov>
	<50B5190D.20604@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B5190D.20604@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Tue 27 Nov 2012 14:48:29 -0500, a =E9crit :
> What is really needed is a way to do an xl shutdown on mini-os domains to
> let vtpm-stubdom shutdown correctly. From what I understand there is not =
yet
> any support for this in mini-os. How tricky would it be to add that? Samu=
el
> any ideas?

I have just posted a patch for this.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 22:58:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 22:58:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdqaR-0002JM-El; Wed, 28 Nov 2012 22:58:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdqaQ-0002JF-7C
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 22:58:34 +0000
Received: from [85.158.143.35:30075] by server-1.bemta-4.messagelabs.com id
	F3/D6-27934-91796B05; Wed, 28 Nov 2012 22:58:33 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354143510!4820622!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24517 invoked from network); 28 Nov 2012 22:58:30 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 22:58:30 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 1F64B84074;
	Wed, 28 Nov 2012 23:58:30 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id 6pF3qoKnR3Zj; Wed, 28 Nov 2012 23:58:30 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id AD64484072;
	Wed, 28 Nov 2012 23:58:27 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdoFc-0002fi-GP; Wed, 28 Nov 2012 21:28:56 +0100
Date: Wed, 28 Nov 2012 21:28:56 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: xen-devel@lists.xen.org, Keir Fraser <keir@xen.org>
Message-ID: <20121128202856.GA10257@type>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	xen-devel@lists.xen.org, Keir Fraser <keir@xen.org>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Subject: [Xen-devel] [minios] Fix test application link when pcifront is not
	enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

When pcifront is not enabled, the test application needs to disable the
PCI test.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

diff -r 321f8487379b extras/mini-os/test.c
--- a/extras/mini-os/test.c	Thu Nov 15 10:25:29 2012 +0000
+++ b/extras/mini-os/test.c	Wed Nov 28 21:27:22 2012 +0100
@@ -413,6 +413,7 @@
     }
 }
 
+#ifdef CONFIG_PCIFRONT
 static struct pcifront_dev *pci_dev;
 
 static void print_pcidev(unsigned int domain, unsigned int bus, unsigned int slot, unsigned int fun)
@@ -436,6 +437,7 @@
     printk("PCI devices:\n");
     pcifront_scan(pci_dev, print_pcidev);
 }
+#endif
 
 int app_main(start_info_t *si)
 {
@@ -446,7 +448,9 @@
     create_thread("blkfront", blkfront_thread, si);
     create_thread("fbfront", fbfront_thread, si);
     create_thread("kbdfront", kbdfront_thread, si);
+#ifdef CONFIG_PCIFRONT
     create_thread("pcifront", pcifront_thread, si);
+#endif
     return 0;
 }
 
@@ -464,6 +468,8 @@
     if (kbd_dev)
         shutdown_kbdfront(kbd_dev);
 
+#ifdef CONFIG_PCIFRONT
     if (pci_dev)
         shutdown_pcifront(pci_dev);
+#endif
 }

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 22:58:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 22:58:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdqaR-0002JM-El; Wed, 28 Nov 2012 22:58:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TdqaQ-0002JF-7C
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 22:58:34 +0000
Received: from [85.158.143.35:30075] by server-1.bemta-4.messagelabs.com id
	F3/D6-27934-91796B05; Wed, 28 Nov 2012 22:58:33 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354143510!4820622!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24517 invoked from network); 28 Nov 2012 22:58:30 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 22:58:30 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 1F64B84074;
	Wed, 28 Nov 2012 23:58:30 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id 6pF3qoKnR3Zj; Wed, 28 Nov 2012 23:58:30 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id AD64484072;
	Wed, 28 Nov 2012 23:58:27 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdoFc-0002fi-GP; Wed, 28 Nov 2012 21:28:56 +0100
Date: Wed, 28 Nov 2012 21:28:56 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: xen-devel@lists.xen.org, Keir Fraser <keir@xen.org>
Message-ID: <20121128202856.GA10257@type>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	xen-devel@lists.xen.org, Keir Fraser <keir@xen.org>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Subject: [Xen-devel] [minios] Fix test application link when pcifront is not
	enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

When pcifront is not enabled, the test application needs to disable the
PCI test.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

diff -r 321f8487379b extras/mini-os/test.c
--- a/extras/mini-os/test.c	Thu Nov 15 10:25:29 2012 +0000
+++ b/extras/mini-os/test.c	Wed Nov 28 21:27:22 2012 +0100
@@ -413,6 +413,7 @@
     }
 }
 
+#ifdef CONFIG_PCIFRONT
 static struct pcifront_dev *pci_dev;
 
 static void print_pcidev(unsigned int domain, unsigned int bus, unsigned int slot, unsigned int fun)
@@ -436,6 +437,7 @@
     printk("PCI devices:\n");
     pcifront_scan(pci_dev, print_pcidev);
 }
+#endif
 
 int app_main(start_info_t *si)
 {
@@ -446,7 +448,9 @@
     create_thread("blkfront", blkfront_thread, si);
     create_thread("fbfront", fbfront_thread, si);
     create_thread("kbdfront", kbdfront_thread, si);
+#ifdef CONFIG_PCIFRONT
     create_thread("pcifront", pcifront_thread, si);
+#endif
     return 0;
 }
 
@@ -464,6 +468,8 @@
     if (kbd_dev)
         shutdown_kbdfront(kbd_dev);
 
+#ifdef CONFIG_PCIFRONT
     if (pci_dev)
         shutdown_pcifront(pci_dev);
+#endif
 }

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 22:59:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 22:59:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdqah-0002Lj-SP; Wed, 28 Nov 2012 22:58:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1Tdqaf-0002LF-Uf
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 22:58:50 +0000
Received: from [85.158.143.99:9328] by server-2.bemta-4.messagelabs.com id
	67/99-28922-92796B05; Wed, 28 Nov 2012 22:58:49 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1354143527!29112670!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27042 invoked from network); 28 Nov 2012 22:58:48 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-5.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 22:58:48 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id B2CA484074;
	Wed, 28 Nov 2012 23:58:47 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id vrrEdE1nimQq; Wed, 28 Nov 2012 23:58:47 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id BEE9584072;
	Wed, 28 Nov 2012 23:58:37 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdpdD-0001b6-Kh; Wed, 28 Nov 2012 22:57:23 +0100
Date: Wed, 28 Nov 2012 22:57:23 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: xen-devel@lists.xen.org, Keir Fraser <keir@xen.org>
Message-ID: <20121128215723.GA6109@type>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	xen-devel@lists.xen.org, Keir Fraser <keir@xen.org>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Subject: [Xen-devel] [minios] Add xenbus shutdown control support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add a thread watching the xenbus shutdown control path and notifies a
wait queue.

Add HYPERVISOR_shutdown convenient inline for minios shutdown.

Add proper shutdown to the minios test application.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

diff -r fdf241ea6ff4 extras/mini-os/include/kernel.h
--- a/extras/mini-os/include/kernel.h	Wed Nov 28 21:29:18 2012 +0100
+++ b/extras/mini-os/include/kernel.h	Wed Nov 28 22:53:42 2012 +0100
@@ -1,6 +1,9 @@
 #ifndef _KERNEL_H_
 #define _KERNEL_H_
 
+extern unsigned int do_shutdown;
+extern unsigned int shutdown_reason;
+extern struct wait_queue_head shutdown_queue;
 extern void do_exit(void) __attribute__((noreturn));
 extern void stop_kernel(void);
 
diff -r fdf241ea6ff4 extras/mini-os/include/x86/x86_32/hypercall-x86_32.h
--- a/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h	Wed Nov 28 21:29:18 2012 +0100
+++ b/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h	Wed Nov 28 22:53:42 2012 +0100
@@ -172,6 +172,14 @@
 	return _hypercall2(int, sched_op, cmd, arg);
 }
 
+static inline int
+HYPERVISOR_shutdown(
+	unsigned int reason)
+{
+	struct sched_shutdown shutdown = { .reason = reason };
+	return _hypercall2(int, sched_op, SCHEDOP_shutdown, &shutdown);
+}
+
 static inline long
 HYPERVISOR_set_timer_op(
 	uint64_t timeout)
diff -r fdf241ea6ff4 extras/mini-os/include/x86/x86_64/hypercall-x86_64.h
--- a/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h	Wed Nov 28 21:29:18 2012 +0100
+++ b/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h	Wed Nov 28 22:53:42 2012 +0100
@@ -176,6 +176,14 @@
 	return _hypercall2(int, sched_op, cmd, arg);
 }
 
+static inline int
+HYPERVISOR_shutdown(
+	unsigned int reason)
+{
+	struct sched_shutdown shutdown = { .reason = reason };
+	return _hypercall2(int, sched_op, SCHEDOP_shutdown, &shutdown);
+}
+
 static inline long
 HYPERVISOR_set_timer_op(
 	uint64_t timeout)
diff -r fdf241ea6ff4 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c	Wed Nov 28 21:29:18 2012 +0100
+++ b/extras/mini-os/kernel.c	Wed Nov 28 22:53:42 2012 +0100
@@ -48,6 +48,10 @@
 
 uint8_t xen_features[XENFEAT_NR_SUBMAPS * 32];
 
+unsigned int do_shutdown = 0;
+unsigned int shutdown_reason;
+DECLARE_WAIT_QUEUE_HEAD(shutdown_queue);
+
 void setup_xen_features(void)
 {
     xen_feature_info_t fi;
@@ -64,6 +68,36 @@
     }
 }
 
+static void shutdown_thread(void *p)
+{
+    const char *path = "control/shutdown";
+    const char *token = path;
+    xenbus_event_queue events = NULL;
+    char *shutdown, *err;
+    xenbus_watch_path_token(XBT_NIL, path, token, &events);
+    while ((err = xenbus_read(XBT_NIL, path, &shutdown)) != NULL)
+    {
+        free(err);
+        xenbus_wait_for_watch(&events);
+    }
+    xenbus_unwatch_path_token(XBT_NIL, path, token);
+    xenbus_write(XBT_NIL, path, "");
+    printk("Shutting down (%s)\n", shutdown);
+
+    if (!strcmp(shutdown, "poweroff"))
+        shutdown_reason = SHUTDOWN_poweroff;
+    else if (!strcmp(shutdown, "reboot"))
+        shutdown_reason = SHUTDOWN_reboot;
+    else
+        /* Unknown */
+        shutdown_reason = SHUTDOWN_crash;
+    wmb();
+    do_shutdown = 1;
+    wmb();
+    wake_up(&shutdown_queue);
+}
+
+
 /* This should be overridden by the application we are linked against. */
 __attribute__((weak)) int app_main(start_info_t *si)
 {
@@ -126,6 +160,8 @@
     /* Init XenBus */
     init_xenbus();
 
+    create_thread("shutdown", shutdown_thread, NULL);
+
     /* Call (possibly overridden) app_main() */
     app_main(&start_info);
 
diff -r fdf241ea6ff4 extras/mini-os/test.c
--- a/extras/mini-os/test.c	Wed Nov 28 21:29:18 2012 +0100
+++ b/extras/mini-os/test.c	Wed Nov 28 22:53:42 2012 +0100
@@ -46,6 +46,7 @@
 #include <xen/version.h>
 
 static struct netfront_dev *net_dev;
+static struct semaphore net_sem = __SEMAPHORE_INITIALIZER(net_sem, 0);
 
 void test_xenbus(void);
 
@@ -70,12 +71,14 @@
 static void netfront_thread(void *p)
 {
     net_dev = init_netfront(NULL, NULL, NULL, NULL);
+    up(&net_sem);
 }
 
 static struct blkfront_dev *blk_dev;
 static struct blkfront_info blk_info;
 static uint64_t blk_size_read;
 static uint64_t blk_size_write;
+static struct semaphore blk_sem = __SEMAPHORE_INITIALIZER(blk_sem, 0);;
 
 struct blk_req {
     struct blkfront_aiocb aiocb;
@@ -189,8 +192,10 @@
     time_t lasttime = 0;
 
     blk_dev = init_blkfront(NULL, &blk_info);
-    if (!blk_dev)
+    if (!blk_dev) {
+        up(&blk_sem);
         return;
+    }
 
     if (blk_info.info & VDISK_CDROM)
         printk("Block device is a CDROM\n");
@@ -210,7 +215,7 @@
         blk_read_sector(blk_info.sectors-1);
     }
 
-    while (1) {
+    while (!do_shutdown) {
         uint64_t sector = rand() % blk_info.sectors;
         struct timeval tv;
 #ifdef BLKTEST_WRITE
@@ -235,6 +240,7 @@
         }
 #endif
     }
+    up(&blk_sem);
 }
 
 #define WIDTH 800
@@ -293,7 +299,6 @@
     xfree(mfns);
     if (!fb_dev) {
         xfree(fb);
-        return;
     }
     up(&fbfront_sem);
 }
@@ -330,17 +335,21 @@
 }
 
 static struct kbdfront_dev *kbd_dev;
+static struct semaphore kbd_sem = __SEMAPHORE_INITIALIZER(kbd_sem, 0);
 static void kbdfront_thread(void *p)
 {
     DEFINE_WAIT(w);
     DEFINE_WAIT(w2);
+    DEFINE_WAIT(w3);
     int x = WIDTH / 2, y = HEIGHT / 2, z = 0;
 
     kbd_dev = init_kbdfront(NULL, 1);
-    if (!kbd_dev)
+    down(&fbfront_sem);
+    if (!kbd_dev) {
+        up(&kbd_sem);
         return;
+    }
 
-    down(&fbfront_sem);
     refresh_cursor(x, y);
     while (1) {
         union xenkbd_in_event kbdevent;
@@ -349,6 +358,11 @@
 
         add_waiter(w, kbdfront_queue);
         add_waiter(w2, fbfront_queue);
+        add_waiter(w3, shutdown_queue);
+
+        rmb();
+        if (do_shutdown)
+            break;
 
         while (kbdfront_receive(kbd_dev, &kbdevent, 1) != 0) {
             sleep = 0;
@@ -391,9 +405,11 @@
                         fbfront_update(fb_dev, x - 16, y - 16, 33, 33);
                     }
                 } else if (kbdevent.key.keycode == KEY_Q) {
-                    struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_poweroff };
-                    HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
-                    do_exit();
+                    shutdown_reason = SHUTDOWN_poweroff;
+                    wmb();
+                    do_shutdown = 1;
+                    wmb();
+                    wake_up(&shutdown_queue);
                 }
                 break;
             }
@@ -410,11 +426,16 @@
         }
         if (sleep)
             schedule();
+        remove_waiter(w3, shutdown_queue);
+        remove_waiter(w2, fbfront_queue);
+        remove_waiter(w, kbdfront_queue);
     }
+    up(&kbd_sem);
 }
 
 #ifdef CONFIG_PCIFRONT
 static struct pcifront_dev *pci_dev;
+static struct semaphore pci_sem = __SEMAPHORE_INITIALIZER(pci_sem, 0);
 
 static void print_pcidev(unsigned int domain, unsigned int bus, unsigned int slot, unsigned int fun)
 {
@@ -432,13 +453,60 @@
 {
     pcifront_watches(NULL);
     pci_dev = init_pcifront(NULL);
-    if (!pci_dev)
+    if (!pci_dev) {
+        up(&pci_sem);
         return;
+    }
     printk("PCI devices:\n");
     pcifront_scan(pci_dev, print_pcidev);
+    up(&pci_sem);
 }
 #endif
 
+void shutdown_frontends(void)
+{
+    down(&net_sem);
+    if (net_dev)
+        shutdown_netfront(net_dev);
+
+    down(&blk_sem);
+    if (blk_dev)
+        shutdown_blkfront(blk_dev);
+
+    if (fb_dev)
+        shutdown_fbfront(fb_dev);
+
+    down(&kbd_sem);
+    if (kbd_dev)
+        shutdown_kbdfront(kbd_dev);
+
+#ifdef CONFIG_PCIFRONT
+    down(&pci_sem);
+    if (pci_dev)
+        shutdown_pcifront(pci_dev);
+#endif
+}
+
+static void shutdown_thread(void *p)
+{
+    DEFINE_WAIT(w);
+
+    while (1) {
+        add_waiter(w, shutdown_queue);
+        rmb();
+        if (do_shutdown) {
+            rmb();
+            break;
+        }
+        schedule();
+        remove_waiter(w, shutdown_queue);
+    }
+
+    shutdown_frontends();
+
+    HYPERVISOR_shutdown(shutdown_reason);
+}
+
 int app_main(start_info_t *si)
 {
     printk("Test main: start_info=%p\n", si);
@@ -451,25 +519,6 @@
 #ifdef CONFIG_PCIFRONT
     create_thread("pcifront", pcifront_thread, si);
 #endif
+    create_thread("shutdown", shutdown_thread, si);
     return 0;
 }
-
-void shutdown_frontends(void)
-{
-    if (net_dev)
-        shutdown_netfront(net_dev);
-
-    if (blk_dev)
-        shutdown_blkfront(blk_dev);
-
-    if (fb_dev)
-        shutdown_fbfront(fb_dev);
-
-    if (kbd_dev)
-        shutdown_kbdfront(kbd_dev);
-
-#ifdef CONFIG_PCIFRONT
-    if (pci_dev)
-        shutdown_pcifront(pci_dev);
-#endif
-}

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Wed Nov 28 22:59:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Nov 2012 22:59:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdqah-0002Lj-SP; Wed, 28 Nov 2012 22:58:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1Tdqaf-0002LF-Uf
	for xen-devel@lists.xen.org; Wed, 28 Nov 2012 22:58:50 +0000
Received: from [85.158.143.99:9328] by server-2.bemta-4.messagelabs.com id
	67/99-28922-92796B05; Wed, 28 Nov 2012 22:58:49 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1354143527!29112670!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27042 invoked from network); 28 Nov 2012 22:58:48 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-5.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 28 Nov 2012 22:58:48 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id B2CA484074;
	Wed, 28 Nov 2012 23:58:47 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id vrrEdE1nimQq; Wed, 28 Nov 2012 23:58:47 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id BEE9584072;
	Wed, 28 Nov 2012 23:58:37 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TdpdD-0001b6-Kh; Wed, 28 Nov 2012 22:57:23 +0100
Date: Wed, 28 Nov 2012 22:57:23 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: xen-devel@lists.xen.org, Keir Fraser <keir@xen.org>
Message-ID: <20121128215723.GA6109@type>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	xen-devel@lists.xen.org, Keir Fraser <keir@xen.org>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Subject: [Xen-devel] [minios] Add xenbus shutdown control support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add a thread watching the xenbus shutdown control path and notifies a
wait queue.

Add HYPERVISOR_shutdown convenient inline for minios shutdown.

Add proper shutdown to the minios test application.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

diff -r fdf241ea6ff4 extras/mini-os/include/kernel.h
--- a/extras/mini-os/include/kernel.h	Wed Nov 28 21:29:18 2012 +0100
+++ b/extras/mini-os/include/kernel.h	Wed Nov 28 22:53:42 2012 +0100
@@ -1,6 +1,9 @@
 #ifndef _KERNEL_H_
 #define _KERNEL_H_
 
+extern unsigned int do_shutdown;
+extern unsigned int shutdown_reason;
+extern struct wait_queue_head shutdown_queue;
 extern void do_exit(void) __attribute__((noreturn));
 extern void stop_kernel(void);
 
diff -r fdf241ea6ff4 extras/mini-os/include/x86/x86_32/hypercall-x86_32.h
--- a/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h	Wed Nov 28 21:29:18 2012 +0100
+++ b/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h	Wed Nov 28 22:53:42 2012 +0100
@@ -172,6 +172,14 @@
 	return _hypercall2(int, sched_op, cmd, arg);
 }
 
+static inline int
+HYPERVISOR_shutdown(
+	unsigned int reason)
+{
+	struct sched_shutdown shutdown = { .reason = reason };
+	return _hypercall2(int, sched_op, SCHEDOP_shutdown, &shutdown);
+}
+
 static inline long
 HYPERVISOR_set_timer_op(
 	uint64_t timeout)
diff -r fdf241ea6ff4 extras/mini-os/include/x86/x86_64/hypercall-x86_64.h
--- a/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h	Wed Nov 28 21:29:18 2012 +0100
+++ b/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h	Wed Nov 28 22:53:42 2012 +0100
@@ -176,6 +176,14 @@
 	return _hypercall2(int, sched_op, cmd, arg);
 }
 
+static inline int
+HYPERVISOR_shutdown(
+	unsigned int reason)
+{
+	struct sched_shutdown shutdown = { .reason = reason };
+	return _hypercall2(int, sched_op, SCHEDOP_shutdown, &shutdown);
+}
+
 static inline long
 HYPERVISOR_set_timer_op(
 	uint64_t timeout)
diff -r fdf241ea6ff4 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c	Wed Nov 28 21:29:18 2012 +0100
+++ b/extras/mini-os/kernel.c	Wed Nov 28 22:53:42 2012 +0100
@@ -48,6 +48,10 @@
 
 uint8_t xen_features[XENFEAT_NR_SUBMAPS * 32];
 
+unsigned int do_shutdown = 0;
+unsigned int shutdown_reason;
+DECLARE_WAIT_QUEUE_HEAD(shutdown_queue);
+
 void setup_xen_features(void)
 {
     xen_feature_info_t fi;
@@ -64,6 +68,36 @@
     }
 }
 
+static void shutdown_thread(void *p)
+{
+    const char *path = "control/shutdown";
+    const char *token = path;
+    xenbus_event_queue events = NULL;
+    char *shutdown, *err;
+    xenbus_watch_path_token(XBT_NIL, path, token, &events);
+    while ((err = xenbus_read(XBT_NIL, path, &shutdown)) != NULL)
+    {
+        free(err);
+        xenbus_wait_for_watch(&events);
+    }
+    xenbus_unwatch_path_token(XBT_NIL, path, token);
+    xenbus_write(XBT_NIL, path, "");
+    printk("Shutting down (%s)\n", shutdown);
+
+    if (!strcmp(shutdown, "poweroff"))
+        shutdown_reason = SHUTDOWN_poweroff;
+    else if (!strcmp(shutdown, "reboot"))
+        shutdown_reason = SHUTDOWN_reboot;
+    else
+        /* Unknown */
+        shutdown_reason = SHUTDOWN_crash;
+    wmb();
+    do_shutdown = 1;
+    wmb();
+    wake_up(&shutdown_queue);
+}
+
+
 /* This should be overridden by the application we are linked against. */
 __attribute__((weak)) int app_main(start_info_t *si)
 {
@@ -126,6 +160,8 @@
     /* Init XenBus */
     init_xenbus();
 
+    create_thread("shutdown", shutdown_thread, NULL);
+
     /* Call (possibly overridden) app_main() */
     app_main(&start_info);
 
diff -r fdf241ea6ff4 extras/mini-os/test.c
--- a/extras/mini-os/test.c	Wed Nov 28 21:29:18 2012 +0100
+++ b/extras/mini-os/test.c	Wed Nov 28 22:53:42 2012 +0100
@@ -46,6 +46,7 @@
 #include <xen/version.h>
 
 static struct netfront_dev *net_dev;
+static struct semaphore net_sem = __SEMAPHORE_INITIALIZER(net_sem, 0);
 
 void test_xenbus(void);
 
@@ -70,12 +71,14 @@
 static void netfront_thread(void *p)
 {
     net_dev = init_netfront(NULL, NULL, NULL, NULL);
+    up(&net_sem);
 }
 
 static struct blkfront_dev *blk_dev;
 static struct blkfront_info blk_info;
 static uint64_t blk_size_read;
 static uint64_t blk_size_write;
+static struct semaphore blk_sem = __SEMAPHORE_INITIALIZER(blk_sem, 0);;
 
 struct blk_req {
     struct blkfront_aiocb aiocb;
@@ -189,8 +192,10 @@
     time_t lasttime = 0;
 
     blk_dev = init_blkfront(NULL, &blk_info);
-    if (!blk_dev)
+    if (!blk_dev) {
+        up(&blk_sem);
         return;
+    }
 
     if (blk_info.info & VDISK_CDROM)
         printk("Block device is a CDROM\n");
@@ -210,7 +215,7 @@
         blk_read_sector(blk_info.sectors-1);
     }
 
-    while (1) {
+    while (!do_shutdown) {
         uint64_t sector = rand() % blk_info.sectors;
         struct timeval tv;
 #ifdef BLKTEST_WRITE
@@ -235,6 +240,7 @@
         }
 #endif
     }
+    up(&blk_sem);
 }
 
 #define WIDTH 800
@@ -293,7 +299,6 @@
     xfree(mfns);
     if (!fb_dev) {
         xfree(fb);
-        return;
     }
     up(&fbfront_sem);
 }
@@ -330,17 +335,21 @@
 }
 
 static struct kbdfront_dev *kbd_dev;
+static struct semaphore kbd_sem = __SEMAPHORE_INITIALIZER(kbd_sem, 0);
 static void kbdfront_thread(void *p)
 {
     DEFINE_WAIT(w);
     DEFINE_WAIT(w2);
+    DEFINE_WAIT(w3);
     int x = WIDTH / 2, y = HEIGHT / 2, z = 0;
 
     kbd_dev = init_kbdfront(NULL, 1);
-    if (!kbd_dev)
+    down(&fbfront_sem);
+    if (!kbd_dev) {
+        up(&kbd_sem);
         return;
+    }
 
-    down(&fbfront_sem);
     refresh_cursor(x, y);
     while (1) {
         union xenkbd_in_event kbdevent;
@@ -349,6 +358,11 @@
 
         add_waiter(w, kbdfront_queue);
         add_waiter(w2, fbfront_queue);
+        add_waiter(w3, shutdown_queue);
+
+        rmb();
+        if (do_shutdown)
+            break;
 
         while (kbdfront_receive(kbd_dev, &kbdevent, 1) != 0) {
             sleep = 0;
@@ -391,9 +405,11 @@
                         fbfront_update(fb_dev, x - 16, y - 16, 33, 33);
                     }
                 } else if (kbdevent.key.keycode == KEY_Q) {
-                    struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_poweroff };
-                    HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
-                    do_exit();
+                    shutdown_reason = SHUTDOWN_poweroff;
+                    wmb();
+                    do_shutdown = 1;
+                    wmb();
+                    wake_up(&shutdown_queue);
                 }
                 break;
             }
@@ -410,11 +426,16 @@
         }
         if (sleep)
             schedule();
+        remove_waiter(w3, shutdown_queue);
+        remove_waiter(w2, fbfront_queue);
+        remove_waiter(w, kbdfront_queue);
     }
+    up(&kbd_sem);
 }
 
 #ifdef CONFIG_PCIFRONT
 static struct pcifront_dev *pci_dev;
+static struct semaphore pci_sem = __SEMAPHORE_INITIALIZER(pci_sem, 0);
 
 static void print_pcidev(unsigned int domain, unsigned int bus, unsigned int slot, unsigned int fun)
 {
@@ -432,13 +453,60 @@
 {
     pcifront_watches(NULL);
     pci_dev = init_pcifront(NULL);
-    if (!pci_dev)
+    if (!pci_dev) {
+        up(&pci_sem);
         return;
+    }
     printk("PCI devices:\n");
     pcifront_scan(pci_dev, print_pcidev);
+    up(&pci_sem);
 }
 #endif
 
+void shutdown_frontends(void)
+{
+    down(&net_sem);
+    if (net_dev)
+        shutdown_netfront(net_dev);
+
+    down(&blk_sem);
+    if (blk_dev)
+        shutdown_blkfront(blk_dev);
+
+    if (fb_dev)
+        shutdown_fbfront(fb_dev);
+
+    down(&kbd_sem);
+    if (kbd_dev)
+        shutdown_kbdfront(kbd_dev);
+
+#ifdef CONFIG_PCIFRONT
+    down(&pci_sem);
+    if (pci_dev)
+        shutdown_pcifront(pci_dev);
+#endif
+}
+
+static void shutdown_thread(void *p)
+{
+    DEFINE_WAIT(w);
+
+    while (1) {
+        add_waiter(w, shutdown_queue);
+        rmb();
+        if (do_shutdown) {
+            rmb();
+            break;
+        }
+        schedule();
+        remove_waiter(w, shutdown_queue);
+    }
+
+    shutdown_frontends();
+
+    HYPERVISOR_shutdown(shutdown_reason);
+}
+
 int app_main(start_info_t *si)
 {
     printk("Test main: start_info=%p\n", si);
@@ -451,25 +519,6 @@
 #ifdef CONFIG_PCIFRONT
     create_thread("pcifront", pcifront_thread, si);
 #endif
+    create_thread("shutdown", shutdown_thread, si);
     return 0;
 }
-
-void shutdown_frontends(void)
-{
-    if (net_dev)
-        shutdown_netfront(net_dev);
-
-    if (blk_dev)
-        shutdown_blkfront(blk_dev);
-
-    if (fb_dev)
-        shutdown_fbfront(fb_dev);
-
-    if (kbd_dev)
-        shutdown_kbdfront(kbd_dev);
-
-#ifdef CONFIG_PCIFRONT
-    if (pci_dev)
-        shutdown_pcifront(pci_dev);
-#endif
-}

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 00:55:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 00:55:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdsOq-0003kq-0r; Thu, 29 Nov 2012 00:54:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TdsOo-0003kl-Dd
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 00:54:42 +0000
Received: from [85.158.137.99:29924] by server-8.bemta-3.messagelabs.com id
	9D/18-07786-152B6B05; Thu, 29 Nov 2012 00:54:41 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1354150479!17117782!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4ODY5Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3790 invoked from network); 29 Nov 2012 00:54:40 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-13.tower-217.messagelabs.com with SMTP;
	29 Nov 2012 00:54:40 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 28 Nov 2012 16:54:38 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,180,1355126400"; d="scan'208";a="254695508"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by fmsmga001.fm.intel.com with ESMTP; 28 Nov 2012 16:54:38 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 28 Nov 2012 16:54:37 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Thu, 29 Nov 2012 08:53:44 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Thread-Topic: [PATCH] VT-d: make scope parsing code type safe
Thread-Index: AQHNzXUasTXRBexxskGUb2GgABIocZf//O5A
Date: Thu, 29 Nov 2012 00:53:43 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A4834564403398EF0@SHSMSX101.ccr.corp.intel.com>
References: <50B62E9802000078000AC2B3@nat28.tlf.novell.com>
In-Reply-To: <50B62E9802000078000AC2B3@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Zhang, Xiantao" <xiantao.zhang@intel.com>
Subject: Re: [Xen-devel] [PATCH] VT-d: make scope parsing code type safe
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Thanks!
Acked-by Xiantao Zhang <xiantao.zhang@intel.com>

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Wednesday, November 28, 2012 10:33 PM
> To: xen-devel
> Cc: Zhang, Xiantao
> Subject: [PATCH] VT-d: make scope parsing code type safe
> 
> Rather than requiring the scopes to be the first members of their respective
> structures (so that casts can be used to switch between the different views),
> properly use types and container_of().
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/drivers/passthrough/vtd/dmar.c
> +++ b/xen/drivers/passthrough/vtd/dmar.c
> @@ -304,13 +304,15 @@ static int __init scope_device_count(con
> 
> 
>  static int __init acpi_parse_dev_scope(
> -    const void *start, const void *end, void *acpi_entry, int type, u16 seg)
> +    const void *start, const void *end, struct dmar_scope *scope,
> +    int type, u16 seg)
>  {
> -    struct dmar_scope *scope = acpi_entry;
>      struct acpi_ioapic_unit *acpi_ioapic_unit;
>      const struct acpi_dmar_device_scope *acpi_scope;
>      u16 bus, sub_bus, sec_bus;
>      const struct acpi_dmar_pci_path *path;
> +    struct acpi_drhd_unit *drhd = type == DMAR_TYPE ?
> +        container_of(scope, struct acpi_drhd_unit, scope) : NULL;
>      int depth, cnt, didx = 0;
> 
>      if ( (cnt = scope_device_count(start, end)) < 0 ) @@ -359,9 +361,8 @@
> static int __init acpi_parse_dev_scope(
>                  dprintk(VTDPREFIX, " MSI HPET: %04x:%02x:%02x.%u\n",
>                          seg, bus, path->dev, path->fn);
> 
> -            if ( type == DMAR_TYPE )
> +            if ( drhd )
>              {
> -                struct acpi_drhd_unit *drhd = acpi_entry;
>                  struct acpi_hpet_unit *acpi_hpet_unit;
> 
>                  acpi_hpet_unit = xmalloc(struct acpi_hpet_unit); @@ -381,10 +382,8
> @@ static int __init acpi_parse_dev_scope(
>                  dprintk(VTDPREFIX, " endpoint: %04x:%02x:%02x.%u\n",
>                          seg, bus, path->dev, path->fn);
> 
> -            if ( type == DMAR_TYPE )
> +            if ( drhd )
>              {
> -                struct acpi_drhd_unit *drhd = acpi_entry;
> -
>                  if ( (seg == 0) && (bus == 0) && (path->dev == 2) &&
>                       (path->fn == 0) )
>                      igd_drhd_address = drhd->address; @@ -397,9 +396,8 @@ static
> int __init acpi_parse_dev_scope(
>                  dprintk(VTDPREFIX, " IOAPIC: %04x:%02x:%02x.%u\n",
>                          seg, bus, path->dev, path->fn);
> 
> -            if ( type == DMAR_TYPE )
> +            if ( drhd )
>              {
> -                struct acpi_drhd_unit *drhd = acpi_entry;
>                  acpi_ioapic_unit = xmalloc(struct acpi_ioapic_unit);
>                  if ( !acpi_ioapic_unit )
>                      return -ENOMEM;
> @@ -463,7 +461,7 @@ acpi_parse_one_drhd(struct acpi_dmar_hea
>      dev_scope_start = (void *)(drhd + 1);
>      dev_scope_end = ((void *)drhd) + header->length;
>      ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
> -                               dmaru, DMAR_TYPE, drhd->segment);
> +                               &dmaru->scope, DMAR_TYPE,
> + drhd->segment);
> 
>      if ( dmaru->include_all )
>      {
> @@ -590,7 +588,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_hea
>      dev_scope_start = (void *)(rmrr + 1);
>      dev_scope_end   = ((void *)rmrr) + header->length;
>      ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
> -                               rmrru, RMRR_TYPE, rmrr->segment);
> +                               &rmrru->scope, RMRR_TYPE,
> + rmrr->segment);
> 
>      if ( ret || (rmrru->scope.devices_cnt == 0) )
>          xfree(rmrru);
> @@ -683,7 +681,7 @@ acpi_parse_one_atsr(struct acpi_dmar_hea
>          dev_scope_start = (void *)(atsr + 1);
>          dev_scope_end   = ((void *)atsr) + header->length;
>          ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
> -                                   atsru, ATSR_TYPE, atsr->segment);
> +                                   &atsru->scope, ATSR_TYPE,
> + atsr->segment);
>      }
>      else
>      {
> --- a/xen/drivers/passthrough/vtd/dmar.h
> +++ b/xen/drivers/passthrough/vtd/dmar.h
> @@ -59,7 +59,7 @@ struct dmar_scope {
>  };
> 
>  struct acpi_drhd_unit {
> -    struct dmar_scope scope;            /* must be first member of struct */
> +    struct dmar_scope scope;
>      struct list_head list;
>      u64    address;                     /* register base address of the unit */
>      u16    segment;
> @@ -70,7 +70,7 @@ struct acpi_drhd_unit {  };
> 
>  struct acpi_rmrr_unit {
> -    struct dmar_scope scope;            /* must be first member of struct */
> +    struct dmar_scope scope;
>      struct list_head list;
>      u64    base_address;
>      u64    end_address;
> @@ -79,7 +79,7 @@ struct acpi_rmrr_unit {  };
> 
>  struct acpi_atsr_unit {
> -    struct dmar_scope scope;            /* must be first member of struct */
> +    struct dmar_scope scope;
>      struct list_head list;
>      u16    segment;
>      u8     all_ports:1;
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 00:55:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 00:55:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdsOq-0003kq-0r; Thu, 29 Nov 2012 00:54:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TdsOo-0003kl-Dd
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 00:54:42 +0000
Received: from [85.158.137.99:29924] by server-8.bemta-3.messagelabs.com id
	9D/18-07786-152B6B05; Thu, 29 Nov 2012 00:54:41 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1354150479!17117782!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4ODY5Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3790 invoked from network); 29 Nov 2012 00:54:40 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-13.tower-217.messagelabs.com with SMTP;
	29 Nov 2012 00:54:40 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 28 Nov 2012 16:54:38 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,180,1355126400"; d="scan'208";a="254695508"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by fmsmga001.fm.intel.com with ESMTP; 28 Nov 2012 16:54:38 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 28 Nov 2012 16:54:37 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Thu, 29 Nov 2012 08:53:44 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Thread-Topic: [PATCH] VT-d: make scope parsing code type safe
Thread-Index: AQHNzXUasTXRBexxskGUb2GgABIocZf//O5A
Date: Thu, 29 Nov 2012 00:53:43 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A4834564403398EF0@SHSMSX101.ccr.corp.intel.com>
References: <50B62E9802000078000AC2B3@nat28.tlf.novell.com>
In-Reply-To: <50B62E9802000078000AC2B3@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Zhang, Xiantao" <xiantao.zhang@intel.com>
Subject: Re: [Xen-devel] [PATCH] VT-d: make scope parsing code type safe
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Thanks!
Acked-by Xiantao Zhang <xiantao.zhang@intel.com>

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Wednesday, November 28, 2012 10:33 PM
> To: xen-devel
> Cc: Zhang, Xiantao
> Subject: [PATCH] VT-d: make scope parsing code type safe
> 
> Rather than requiring the scopes to be the first members of their respective
> structures (so that casts can be used to switch between the different views),
> properly use types and container_of().
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/drivers/passthrough/vtd/dmar.c
> +++ b/xen/drivers/passthrough/vtd/dmar.c
> @@ -304,13 +304,15 @@ static int __init scope_device_count(con
> 
> 
>  static int __init acpi_parse_dev_scope(
> -    const void *start, const void *end, void *acpi_entry, int type, u16 seg)
> +    const void *start, const void *end, struct dmar_scope *scope,
> +    int type, u16 seg)
>  {
> -    struct dmar_scope *scope = acpi_entry;
>      struct acpi_ioapic_unit *acpi_ioapic_unit;
>      const struct acpi_dmar_device_scope *acpi_scope;
>      u16 bus, sub_bus, sec_bus;
>      const struct acpi_dmar_pci_path *path;
> +    struct acpi_drhd_unit *drhd = type == DMAR_TYPE ?
> +        container_of(scope, struct acpi_drhd_unit, scope) : NULL;
>      int depth, cnt, didx = 0;
> 
>      if ( (cnt = scope_device_count(start, end)) < 0 ) @@ -359,9 +361,8 @@
> static int __init acpi_parse_dev_scope(
>                  dprintk(VTDPREFIX, " MSI HPET: %04x:%02x:%02x.%u\n",
>                          seg, bus, path->dev, path->fn);
> 
> -            if ( type == DMAR_TYPE )
> +            if ( drhd )
>              {
> -                struct acpi_drhd_unit *drhd = acpi_entry;
>                  struct acpi_hpet_unit *acpi_hpet_unit;
> 
>                  acpi_hpet_unit = xmalloc(struct acpi_hpet_unit); @@ -381,10 +382,8
> @@ static int __init acpi_parse_dev_scope(
>                  dprintk(VTDPREFIX, " endpoint: %04x:%02x:%02x.%u\n",
>                          seg, bus, path->dev, path->fn);
> 
> -            if ( type == DMAR_TYPE )
> +            if ( drhd )
>              {
> -                struct acpi_drhd_unit *drhd = acpi_entry;
> -
>                  if ( (seg == 0) && (bus == 0) && (path->dev == 2) &&
>                       (path->fn == 0) )
>                      igd_drhd_address = drhd->address; @@ -397,9 +396,8 @@ static
> int __init acpi_parse_dev_scope(
>                  dprintk(VTDPREFIX, " IOAPIC: %04x:%02x:%02x.%u\n",
>                          seg, bus, path->dev, path->fn);
> 
> -            if ( type == DMAR_TYPE )
> +            if ( drhd )
>              {
> -                struct acpi_drhd_unit *drhd = acpi_entry;
>                  acpi_ioapic_unit = xmalloc(struct acpi_ioapic_unit);
>                  if ( !acpi_ioapic_unit )
>                      return -ENOMEM;
> @@ -463,7 +461,7 @@ acpi_parse_one_drhd(struct acpi_dmar_hea
>      dev_scope_start = (void *)(drhd + 1);
>      dev_scope_end = ((void *)drhd) + header->length;
>      ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
> -                               dmaru, DMAR_TYPE, drhd->segment);
> +                               &dmaru->scope, DMAR_TYPE,
> + drhd->segment);
> 
>      if ( dmaru->include_all )
>      {
> @@ -590,7 +588,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_hea
>      dev_scope_start = (void *)(rmrr + 1);
>      dev_scope_end   = ((void *)rmrr) + header->length;
>      ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
> -                               rmrru, RMRR_TYPE, rmrr->segment);
> +                               &rmrru->scope, RMRR_TYPE,
> + rmrr->segment);
> 
>      if ( ret || (rmrru->scope.devices_cnt == 0) )
>          xfree(rmrru);
> @@ -683,7 +681,7 @@ acpi_parse_one_atsr(struct acpi_dmar_hea
>          dev_scope_start = (void *)(atsr + 1);
>          dev_scope_end   = ((void *)atsr) + header->length;
>          ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
> -                                   atsru, ATSR_TYPE, atsr->segment);
> +                                   &atsru->scope, ATSR_TYPE,
> + atsr->segment);
>      }
>      else
>      {
> --- a/xen/drivers/passthrough/vtd/dmar.h
> +++ b/xen/drivers/passthrough/vtd/dmar.h
> @@ -59,7 +59,7 @@ struct dmar_scope {
>  };
> 
>  struct acpi_drhd_unit {
> -    struct dmar_scope scope;            /* must be first member of struct */
> +    struct dmar_scope scope;
>      struct list_head list;
>      u64    address;                     /* register base address of the unit */
>      u16    segment;
> @@ -70,7 +70,7 @@ struct acpi_drhd_unit {  };
> 
>  struct acpi_rmrr_unit {
> -    struct dmar_scope scope;            /* must be first member of struct */
> +    struct dmar_scope scope;
>      struct list_head list;
>      u64    base_address;
>      u64    end_address;
> @@ -79,7 +79,7 @@ struct acpi_rmrr_unit {  };
> 
>  struct acpi_atsr_unit {
> -    struct dmar_scope scope;            /* must be first member of struct */
> +    struct dmar_scope scope;
>      struct list_head list;
>      u16    segment;
>      u8     all_ports:1;
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 01:01:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 01:01:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdsUV-0000BA-00; Thu, 29 Nov 2012 01:00:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kouya@jp.fujitsu.com>) id 1TdsUS-0008A9-U2
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 01:00:33 +0000
Received: from [85.158.137.99:41026] by server-10.bemta-3.messagelabs.com id
	8C/9E-19806-FA3B6B05; Thu, 29 Nov 2012 01:00:31 +0000
X-Env-Sender: kouya@jp.fujitsu.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354150829!13929526!1
X-Originating-IP: [192.51.44.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjUxLjQ0LjM2ID0+IDM4ODA2\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9343 invoked from network); 29 Nov 2012 01:00:31 -0000
Received: from fgwmail6.fujitsu.co.jp (HELO fgwmail6.fujitsu.co.jp)
	(192.51.44.36)
	by server-9.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 01:00:31 -0000
Received: from m1.gw.fujitsu.co.jp (unknown [10.0.50.71])
	by fgwmail6.fujitsu.co.jp (Postfix) with ESMTP id 3F4FA3EE0AE
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 10:00:27 +0900 (JST)
Received: from smail (m1 [127.0.0.1])
	by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 285BE45DE58
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 10:00:27 +0900 (JST)
Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91])
	by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 0CEC645DE55
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 10:00:27 +0900 (JST)
Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1])
	by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 013401DB8048
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 10:00:27 +0900 (JST)
Received: from g01jpexchkw03.g01.fujitsu.local
	(g01jpexchkw03.g01.fujitsu.local [10.0.194.42])
	by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id B59301DB8042
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 10:00:26 +0900 (JST)
Received: from [10.33.110.144] (10.33.110.144) by
	g01jpexchkw03.g01.fujitsu.local (10.0.194.42) with Microsoft SMTP
	Server (TLS) id 14.2.309.2; Thu, 29 Nov 2012 10:00:26 +0900
Message-ID: <50B6B3AA.2080505@jp.fujitsu.com>
Date: Thu, 29 Nov 2012 10:00:26 +0900
From: Kouya Shimura <kouya@jp.fujitsu.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <50B5B48C.7040804@jp.fujitsu.com>
	<50B5DBD702000078000AC021@nat28.tlf.novell.com>
In-Reply-To: <50B5DBD702000078000AC021@nat28.tlf.novell.com>
X-Originating-IP: [10.33.110.144]
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] x86/hap: Fix memory leak of
	domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/28/2012 05:39 PM, Jan Beulich wrote:
>>>> On 28.11.12 at 07:51, Kouya Shimura <kouya@jp.fujitsu.com> wrote:
>> This patch fixes the memory leak of domain->arch.hvm_domain.dirty_vram.
>>
>> Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
>
> Wouldn't it be more consistent (and less redundant) to do this
> through calling hap_track_dirty_vram(d, 0, 0, ...)? And even if
> not, the conditional around the freeing/clearing is pointless.
>
> Jan
>

 From another point of view, it's consistent since it almost
copied from shadow_teardown()@xen/arch/x86/mm/shadow/common.c.
That is a sibling function of hap_teardown().
If it's not preferable, another cleanup patch should be made.

IMHO, I feel no good to remain a pointer to the freed memory
even though it never be dereferenced any more.
So it makes sense to check the pointer and set it NULL.

Thanks,
Kouya


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 01:01:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 01:01:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdsUV-0000BA-00; Thu, 29 Nov 2012 01:00:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kouya@jp.fujitsu.com>) id 1TdsUS-0008A9-U2
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 01:00:33 +0000
Received: from [85.158.137.99:41026] by server-10.bemta-3.messagelabs.com id
	8C/9E-19806-FA3B6B05; Thu, 29 Nov 2012 01:00:31 +0000
X-Env-Sender: kouya@jp.fujitsu.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354150829!13929526!1
X-Originating-IP: [192.51.44.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjUxLjQ0LjM2ID0+IDM4ODA2\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9343 invoked from network); 29 Nov 2012 01:00:31 -0000
Received: from fgwmail6.fujitsu.co.jp (HELO fgwmail6.fujitsu.co.jp)
	(192.51.44.36)
	by server-9.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 01:00:31 -0000
Received: from m1.gw.fujitsu.co.jp (unknown [10.0.50.71])
	by fgwmail6.fujitsu.co.jp (Postfix) with ESMTP id 3F4FA3EE0AE
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 10:00:27 +0900 (JST)
Received: from smail (m1 [127.0.0.1])
	by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 285BE45DE58
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 10:00:27 +0900 (JST)
Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91])
	by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 0CEC645DE55
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 10:00:27 +0900 (JST)
Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1])
	by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 013401DB8048
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 10:00:27 +0900 (JST)
Received: from g01jpexchkw03.g01.fujitsu.local
	(g01jpexchkw03.g01.fujitsu.local [10.0.194.42])
	by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id B59301DB8042
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 10:00:26 +0900 (JST)
Received: from [10.33.110.144] (10.33.110.144) by
	g01jpexchkw03.g01.fujitsu.local (10.0.194.42) with Microsoft SMTP
	Server (TLS) id 14.2.309.2; Thu, 29 Nov 2012 10:00:26 +0900
Message-ID: <50B6B3AA.2080505@jp.fujitsu.com>
Date: Thu, 29 Nov 2012 10:00:26 +0900
From: Kouya Shimura <kouya@jp.fujitsu.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <50B5B48C.7040804@jp.fujitsu.com>
	<50B5DBD702000078000AC021@nat28.tlf.novell.com>
In-Reply-To: <50B5DBD702000078000AC021@nat28.tlf.novell.com>
X-Originating-IP: [10.33.110.144]
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] x86/hap: Fix memory leak of
	domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/28/2012 05:39 PM, Jan Beulich wrote:
>>>> On 28.11.12 at 07:51, Kouya Shimura <kouya@jp.fujitsu.com> wrote:
>> This patch fixes the memory leak of domain->arch.hvm_domain.dirty_vram.
>>
>> Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
>
> Wouldn't it be more consistent (and less redundant) to do this
> through calling hap_track_dirty_vram(d, 0, 0, ...)? And even if
> not, the conditional around the freeing/clearing is pointless.
>
> Jan
>

 From another point of view, it's consistent since it almost
copied from shadow_teardown()@xen/arch/x86/mm/shadow/common.c.
That is a sibling function of hap_teardown().
If it's not preferable, another cleanup patch should be made.

IMHO, I feel no good to remain a pointer to the freed memory
even though it never be dereferenced any more.
So it makes sense to check the pointer and set it NULL.

Thanks,
Kouya


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 01:08:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 01:08:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdsc6-0007w3-Us; Thu, 29 Nov 2012 01:08:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1Tdsc5-0007vx-RK
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 01:08:26 +0000
Received: from [85.158.137.99:64754] by server-7.bemta-3.messagelabs.com id
	B1/DF-01713-485B6B05; Thu, 29 Nov 2012 01:08:20 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1354151299!14736489!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4ODY5Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30365 invoked from network); 29 Nov 2012 01:08:19 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-15.tower-217.messagelabs.com with SMTP;
	29 Nov 2012 01:08:19 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 28 Nov 2012 17:07:19 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,180,1355126400"; d="scan'208";a="254699224"
Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35])
	by fmsmga001.fm.intel.com with ESMTP; 28 Nov 2012 17:07:19 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 28 Nov 2012 17:07:19 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Thu, 29 Nov 2012 09:07:17 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Thread-Topic: ATS and dependent features
Thread-Index: AQHNzINiSOuk8WhZTUOv61PMlYmAhZgAAhig
Date: Thu, 29 Nov 2012 01:07:16 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A4834564403398F24@SHSMSX101.ccr.corp.intel.com>
References: <50B498E502000078000AB8B3@nat28.tlf.novell.com>
In-Reply-To: <50B498E502000078000AB8B3@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Zhang, Xiantao" <xiantao.zhang@intel.com>
Subject: Re: [Xen-devel] ATS and dependent features
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

ATS should be a host feature controlled by iommu, and I don't think dom0 can control  it from Xen's architecture.   Perhaps we need to forbid dom0 controlling these features. 
Xiantao

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Tuesday, November 27, 2012 5:42 PM
> To: Zhang, Xiantao; xen-devel
> Subject: ATS and dependent features
> 
> All,
> 
> while investigating an issue with some device not working under Xen without
> "ats=off", I started wondering whether it is correct to allow the Dom0 kernel
> concurrent control over ATS, PRI, and PASID - it would seem to me that with
> Xen controlling the IOMMU, it should also have exclusive control over the
> enabling of those features.
> 
> Thanks for any comments in this regard,
> Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 01:08:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 01:08:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdsc6-0007w3-Us; Thu, 29 Nov 2012 01:08:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1Tdsc5-0007vx-RK
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 01:08:26 +0000
Received: from [85.158.137.99:64754] by server-7.bemta-3.messagelabs.com id
	B1/DF-01713-485B6B05; Thu, 29 Nov 2012 01:08:20 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1354151299!14736489!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4ODY5Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30365 invoked from network); 29 Nov 2012 01:08:19 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-15.tower-217.messagelabs.com with SMTP;
	29 Nov 2012 01:08:19 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 28 Nov 2012 17:07:19 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,180,1355126400"; d="scan'208";a="254699224"
Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35])
	by fmsmga001.fm.intel.com with ESMTP; 28 Nov 2012 17:07:19 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 28 Nov 2012 17:07:19 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Thu, 29 Nov 2012 09:07:17 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Thread-Topic: ATS and dependent features
Thread-Index: AQHNzINiSOuk8WhZTUOv61PMlYmAhZgAAhig
Date: Thu, 29 Nov 2012 01:07:16 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A4834564403398F24@SHSMSX101.ccr.corp.intel.com>
References: <50B498E502000078000AB8B3@nat28.tlf.novell.com>
In-Reply-To: <50B498E502000078000AB8B3@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Zhang, Xiantao" <xiantao.zhang@intel.com>
Subject: Re: [Xen-devel] ATS and dependent features
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

ATS should be a host feature controlled by iommu, and I don't think dom0 can control  it from Xen's architecture.   Perhaps we need to forbid dom0 controlling these features. 
Xiantao

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Tuesday, November 27, 2012 5:42 PM
> To: Zhang, Xiantao; xen-devel
> Subject: ATS and dependent features
> 
> All,
> 
> while investigating an issue with some device not working under Xen without
> "ats=off", I started wondering whether it is correct to allow the Dom0 kernel
> concurrent control over ATS, PRI, and PASID - it would seem to me that with
> Xen controlling the IOMMU, it should also have exclusive control over the
> enabling of those features.
> 
> Thanks for any comments in this regard,
> Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 01:51:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 01:51:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdtHB-0008Kv-RM; Thu, 29 Nov 2012 01:50:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TdtHA-0008Kq-7u
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 01:50:52 +0000
Received: from [85.158.143.35:17668] by server-1.bemta-4.messagelabs.com id
	01/3D-27934-B7FB6B05; Thu, 29 Nov 2012 01:50:51 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1354153844!10327443!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODMwNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14261 invoked from network); 29 Nov 2012 01:50:45 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-10.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 01:50:45 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAT1og9m008707
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 29 Nov 2012 01:50:43 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAT1ofaa026768
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 29 Nov 2012 01:50:42 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAT1ofqZ017069; Wed, 28 Nov 2012 19:50:41 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 28 Nov 2012 17:50:41 -0800
Date: Wed, 28 Nov 2012 17:50:39 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: "Jan Beulich" <JBeulich@suse.com>
Message-ID: <20121128175039.62112c96@mantra.us.oracle.com>
In-Reply-To: <50B5D83402000078000ABFF1@nat28.tlf.novell.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: xen-devel <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 28 Nov 2012 08:24:04 +0000
"Jan Beulich" <JBeulich@suse.com> wrote:

> >>> On 27.11.12 at 22:31, Konrad Rzeszutek Wilk
> >>> <konrad.wilk@oracle.com> wrote:
> > Mukesh Rathor (6):
> >       xen/pvh: Support ParaVirtualized Hardware extensions.
> >       xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
> >       xen/pvh: Implement MMU changes for PVH.
> >       xen/pvh: bootup and setup (E820) related changes.
> >       xen/pvh: balloon and grant changes.
> >       xen/pvh: /dev/xen/privcmd changes.
> 
> As said before - I don't think it is a good idea to push the kernel
> side changes into an official release when the hypervisor side ones
> didn't even get an initial review yet.

On the xen patch side, I've refrshed my tree. I realized I had undone
the union of pv_domain and hvm_domain since I used fields from both.
I'm now redoing that to make that a union and add a struct in
hvm_domain for fields from pv_domain that are used by PVH. 

Thanks,
Mukesh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 01:51:19 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 01:51:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdtHB-0008Kv-RM; Thu, 29 Nov 2012 01:50:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TdtHA-0008Kq-7u
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 01:50:52 +0000
Received: from [85.158.143.35:17668] by server-1.bemta-4.messagelabs.com id
	01/3D-27934-B7FB6B05; Thu, 29 Nov 2012 01:50:51 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1354153844!10327443!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODMwNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14261 invoked from network); 29 Nov 2012 01:50:45 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-10.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 01:50:45 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAT1og9m008707
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 29 Nov 2012 01:50:43 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAT1ofaa026768
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 29 Nov 2012 01:50:42 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAT1ofqZ017069; Wed, 28 Nov 2012 19:50:41 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 28 Nov 2012 17:50:41 -0800
Date: Wed, 28 Nov 2012 17:50:39 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: "Jan Beulich" <JBeulich@suse.com>
Message-ID: <20121128175039.62112c96@mantra.us.oracle.com>
In-Reply-To: <50B5D83402000078000ABFF1@nat28.tlf.novell.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: xen-devel <xen-devel@lists.xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 28 Nov 2012 08:24:04 +0000
"Jan Beulich" <JBeulich@suse.com> wrote:

> >>> On 27.11.12 at 22:31, Konrad Rzeszutek Wilk
> >>> <konrad.wilk@oracle.com> wrote:
> > Mukesh Rathor (6):
> >       xen/pvh: Support ParaVirtualized Hardware extensions.
> >       xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
> >       xen/pvh: Implement MMU changes for PVH.
> >       xen/pvh: bootup and setup (E820) related changes.
> >       xen/pvh: balloon and grant changes.
> >       xen/pvh: /dev/xen/privcmd changes.
> 
> As said before - I don't think it is a good idea to push the kernel
> side changes into an official release when the hypervisor side ones
> didn't even get an initial review yet.

On the xen patch side, I've refrshed my tree. I realized I had undone
the union of pv_domain and hvm_domain since I used fields from both.
I'm now redoing that to make that a union and add a struct in
hvm_domain for fields from pv_domain that are used by PVH. 

Thanks,
Mukesh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 02:22:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 02:22:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdtkx-0000V0-HL; Thu, 29 Nov 2012 02:21:39 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fengguang.wu@intel.com>) id 1Tdtkv-0000Uv-7A
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 02:21:37 +0000
Received: from [85.158.143.99:12465] by server-2.bemta-4.messagelabs.com id
	B9/C8-28922-0B6C6B05; Thu, 29 Nov 2012 02:21:36 +0000
X-Env-Sender: fengguang.wu@intel.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1354155695!29126244!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0ODMwNQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3855 invoked from network); 29 Nov 2012 02:21:36 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-5.tower-216.messagelabs.com with SMTP;
	29 Nov 2012 02:21:36 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga101.fm.intel.com with ESMTP; 28 Nov 2012 18:21:34 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,180,1355126400"; d="scan'208";a="254723760"
Received: from unknown (HELO wfg-t420.sh.intel.com) ([10.255.21.144])
	by fmsmga001.fm.intel.com with ESMTP; 28 Nov 2012 18:21:33 -0800
Received: from wfg by wfg-t420.sh.intel.com with local (Exim 4.77)
	(envelope-from <fengguang.wu@intel.com>)
	id 1Tdtkj-0002Fg-6N; Thu, 29 Nov 2012 10:21:25 +0800
Date: Thu, 29 Nov 2012 10:21:25 +0800
From: Fengguang Wu <fengguang.wu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Message-ID: <20121129022125.GG5785@localhost>
References: <50b68452.Gqr1L/cRkHFh1xmK%fengguang.wu@intel.com>
	<20121128221510.GA29950@phenom.dumpdata.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121128221510.GA29950@phenom.dumpdata.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>, xen-devel@lists.xensource.com,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [xen:stable/for-linus-3.8 4/8]
 include/xen/interface/version.h:72:2: error: implicit declaration of
 function 'xen_domain'
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 05:15:10PM -0500, Konrad Rzeszutek Wilk wrote:
> On Thu, Nov 29, 2012 at 05:38:26AM +0800, kbuild test robot wrote:
> > tree:   git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-linus-3.8
> > head:   394b40f62d7ae18a1c48c13fc483b8193f8c3a98
> > commit: 92e3229dcdc80ff0b6304f14c578d76e7e10e226 [4/8] xen/acpi: ACPI PAD driver
> > config: x86_64-randconfig-x701 (attached as .config)
> > 
> > Note: the xen/stable/for-linus-3.8 HEAD 394b40f builds fine.
> >       It only hurts bisectibility.
> > 
> > All error/warnings:
> > 
> > In file included from drivers/xen/features.c:15:0:
> > include/xen/interface/version.h: In function 'xen_running_on_version_or_later':
> > include/xen/interface/version.h:72:2: error: implicit declaration of function 'xen_domain' [-Werror=implicit-function-declaration]
> > cc1: some warnings being treated as errors
> 
> Which are fixed a bit later by me.

Yes, see the above note: "HEAD 394b40f builds fine. It only hurts bisectibility."

It still creates a range of not-bisectable commits due to the build
error. So the report was sent out, hoping that the branch can be
rebased to remove the error completely.

However if you've decided that this tree won't do rebase at all,
please let me know and I'll ignore such interim errors on it in
future.

Thanks,
Fengguang

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 02:22:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 02:22:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdtkx-0000V0-HL; Thu, 29 Nov 2012 02:21:39 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fengguang.wu@intel.com>) id 1Tdtkv-0000Uv-7A
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 02:21:37 +0000
Received: from [85.158.143.99:12465] by server-2.bemta-4.messagelabs.com id
	B9/C8-28922-0B6C6B05; Thu, 29 Nov 2012 02:21:36 +0000
X-Env-Sender: fengguang.wu@intel.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1354155695!29126244!1
X-Originating-IP: [192.55.52.88]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM0ODMwNQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3855 invoked from network); 29 Nov 2012 02:21:36 -0000
Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88)
	by server-5.tower-216.messagelabs.com with SMTP;
	29 Nov 2012 02:21:36 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga101.fm.intel.com with ESMTP; 28 Nov 2012 18:21:34 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,180,1355126400"; d="scan'208";a="254723760"
Received: from unknown (HELO wfg-t420.sh.intel.com) ([10.255.21.144])
	by fmsmga001.fm.intel.com with ESMTP; 28 Nov 2012 18:21:33 -0800
Received: from wfg by wfg-t420.sh.intel.com with local (Exim 4.77)
	(envelope-from <fengguang.wu@intel.com>)
	id 1Tdtkj-0002Fg-6N; Thu, 29 Nov 2012 10:21:25 +0800
Date: Thu, 29 Nov 2012 10:21:25 +0800
From: Fengguang Wu <fengguang.wu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Message-ID: <20121129022125.GG5785@localhost>
References: <50b68452.Gqr1L/cRkHFh1xmK%fengguang.wu@intel.com>
	<20121128221510.GA29950@phenom.dumpdata.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121128221510.GA29950@phenom.dumpdata.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>, xen-devel@lists.xensource.com,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [xen:stable/for-linus-3.8 4/8]
 include/xen/interface/version.h:72:2: error: implicit declaration of
 function 'xen_domain'
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 05:15:10PM -0500, Konrad Rzeszutek Wilk wrote:
> On Thu, Nov 29, 2012 at 05:38:26AM +0800, kbuild test robot wrote:
> > tree:   git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-linus-3.8
> > head:   394b40f62d7ae18a1c48c13fc483b8193f8c3a98
> > commit: 92e3229dcdc80ff0b6304f14c578d76e7e10e226 [4/8] xen/acpi: ACPI PAD driver
> > config: x86_64-randconfig-x701 (attached as .config)
> > 
> > Note: the xen/stable/for-linus-3.8 HEAD 394b40f builds fine.
> >       It only hurts bisectibility.
> > 
> > All error/warnings:
> > 
> > In file included from drivers/xen/features.c:15:0:
> > include/xen/interface/version.h: In function 'xen_running_on_version_or_later':
> > include/xen/interface/version.h:72:2: error: implicit declaration of function 'xen_domain' [-Werror=implicit-function-declaration]
> > cc1: some warnings being treated as errors
> 
> Which are fixed a bit later by me.

Yes, see the above note: "HEAD 394b40f builds fine. It only hurts bisectibility."

It still creates a range of not-bisectable commits due to the build
error. So the report was sent out, hoping that the branch can be
rebased to remove the error completely.

However if you've decided that this tree won't do rebase at all,
please let me know and I'll ignore such interim errors on it in
future.

Thanks,
Fengguang

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 03:09:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 03:09:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TduUh-0000s1-IX; Thu, 29 Nov 2012 03:08:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TduUf-0000rw-Uk
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 03:08:54 +0000
Received: from [85.158.138.51:5867] by server-6.bemta-3.messagelabs.com id
	D1/65-28265-0C1D6B05; Thu, 29 Nov 2012 03:08:48 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1354158526!23890525!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODMwNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3870 invoked from network); 29 Nov 2012 03:08:48 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 03:08:48 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAT38idj029552
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 29 Nov 2012 03:08:44 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAT38hau024308
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 29 Nov 2012 03:08:43 GMT
Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAT38hSH023467; Wed, 28 Nov 2012 21:08:43 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 28 Nov 2012 19:08:42 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 9E072E00B4F; Wed, 28 Nov 2012 22:08:38 -0500 (EST)
Date: Wed, 28 Nov 2012 22:08:38 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Fengguang Wu <fengguang.wu@intel.com>
Message-ID: <20121129030838.GA22724@phenom.dumpdata.com>
References: <50b68452.Gqr1L/cRkHFh1xmK%fengguang.wu@intel.com>
	<20121128221510.GA29950@phenom.dumpdata.com>
	<20121129022125.GG5785@localhost>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121129022125.GG5785@localhost>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>, xen-devel@lists.xensource.com,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [xen:stable/for-linus-3.8 4/8]
 include/xen/interface/version.h:72:2: error: implicit declaration of
 function 'xen_domain'
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 10:21:25AM +0800, Fengguang Wu wrote:
> On Wed, Nov 28, 2012 at 05:15:10PM -0500, Konrad Rzeszutek Wilk wrote:
> > On Thu, Nov 29, 2012 at 05:38:26AM +0800, kbuild test robot wrote:
> > > tree:   git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-linus-3.8
> > > head:   394b40f62d7ae18a1c48c13fc483b8193f8c3a98
> > > commit: 92e3229dcdc80ff0b6304f14c578d76e7e10e226 [4/8] xen/acpi: ACPI PAD driver
> > > config: x86_64-randconfig-x701 (attached as .config)
> > > 
> > > Note: the xen/stable/for-linus-3.8 HEAD 394b40f builds fine.
> > >       It only hurts bisectibility.
> > > 
> > > All error/warnings:
> > > 
> > > In file included from drivers/xen/features.c:15:0:
> > > include/xen/interface/version.h: In function 'xen_running_on_version_or_later':
> > > include/xen/interface/version.h:72:2: error: implicit declaration of function 'xen_domain' [-Werror=implicit-function-declaration]
> > > cc1: some warnings being treated as errors
> > 
> > Which are fixed a bit later by me.
> 
> Yes, see the above note: "HEAD 394b40f builds fine. It only hurts bisectibility."
> 
> It still creates a range of not-bisectable commits due to the build
> error. So the report was sent out, hoping that the branch can be
> rebased to remove the error completely.
> 
> However if you've decided that this tree won't do rebase at all,

Not that one. The 'devel' ones are OK, but the 'stable' are .. well
stable - with warts and all :-)


> please let me know and I'll ignore such interim errors on it in
> future.

I think this is OK. I don't mind seeing such errors.

> 
> Thanks,
> Fengguang

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 03:09:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 03:09:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TduUh-0000s1-IX; Thu, 29 Nov 2012 03:08:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TduUf-0000rw-Uk
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 03:08:54 +0000
Received: from [85.158.138.51:5867] by server-6.bemta-3.messagelabs.com id
	D1/65-28265-0C1D6B05; Thu, 29 Nov 2012 03:08:48 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1354158526!23890525!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODMwNDA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3870 invoked from network); 29 Nov 2012 03:08:48 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-6.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 03:08:48 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAT38idj029552
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 29 Nov 2012 03:08:44 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAT38hau024308
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 29 Nov 2012 03:08:43 GMT
Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAT38hSH023467; Wed, 28 Nov 2012 21:08:43 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 28 Nov 2012 19:08:42 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 9E072E00B4F; Wed, 28 Nov 2012 22:08:38 -0500 (EST)
Date: Wed, 28 Nov 2012 22:08:38 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Fengguang Wu <fengguang.wu@intel.com>
Message-ID: <20121129030838.GA22724@phenom.dumpdata.com>
References: <50b68452.Gqr1L/cRkHFh1xmK%fengguang.wu@intel.com>
	<20121128221510.GA29950@phenom.dumpdata.com>
	<20121129022125.GG5785@localhost>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121129022125.GG5785@localhost>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>, xen-devel@lists.xensource.com,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [xen:stable/for-linus-3.8 4/8]
 include/xen/interface/version.h:72:2: error: implicit declaration of
 function 'xen_domain'
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 10:21:25AM +0800, Fengguang Wu wrote:
> On Wed, Nov 28, 2012 at 05:15:10PM -0500, Konrad Rzeszutek Wilk wrote:
> > On Thu, Nov 29, 2012 at 05:38:26AM +0800, kbuild test robot wrote:
> > > tree:   git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-linus-3.8
> > > head:   394b40f62d7ae18a1c48c13fc483b8193f8c3a98
> > > commit: 92e3229dcdc80ff0b6304f14c578d76e7e10e226 [4/8] xen/acpi: ACPI PAD driver
> > > config: x86_64-randconfig-x701 (attached as .config)
> > > 
> > > Note: the xen/stable/for-linus-3.8 HEAD 394b40f builds fine.
> > >       It only hurts bisectibility.
> > > 
> > > All error/warnings:
> > > 
> > > In file included from drivers/xen/features.c:15:0:
> > > include/xen/interface/version.h: In function 'xen_running_on_version_or_later':
> > > include/xen/interface/version.h:72:2: error: implicit declaration of function 'xen_domain' [-Werror=implicit-function-declaration]
> > > cc1: some warnings being treated as errors
> > 
> > Which are fixed a bit later by me.
> 
> Yes, see the above note: "HEAD 394b40f builds fine. It only hurts bisectibility."
> 
> It still creates a range of not-bisectable commits due to the build
> error. So the report was sent out, hoping that the branch can be
> rebased to remove the error completely.
> 
> However if you've decided that this tree won't do rebase at all,

Not that one. The 'devel' ones are OK, but the 'stable' are .. well
stable - with warts and all :-)


> please let me know and I'll ignore such interim errors on it in
> future.

I think this is OK. I don't mind seeing such errors.

> 
> Thanks,
> Fengguang

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 03:15:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 03:15:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tduai-00010f-DM; Thu, 29 Nov 2012 03:15:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fengguang.wu@intel.com>) id 1Tduag-00010X-Sw
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 03:15:07 +0000
Received: from [85.158.139.211:2173] by server-2.bemta-5.messagelabs.com id
	5A/35-04892-A33D6B05; Thu, 29 Nov 2012 03:15:06 +0000
X-Env-Sender: fengguang.wu@intel.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354158904!17852571!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4ODY5Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27231 invoked from network); 29 Nov 2012 03:15:05 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-7.tower-206.messagelabs.com with SMTP;
	29 Nov 2012 03:15:05 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 28 Nov 2012 19:15:03 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,180,1355126400"; d="scan'208";a="254740256"
Received: from unknown (HELO wfg-t420.sh.intel.com) ([10.255.21.144])
	by fmsmga001.fm.intel.com with ESMTP; 28 Nov 2012 19:15:01 -0800
Received: from wfg by wfg-t420.sh.intel.com with local (Exim 4.77)
	(envelope-from <fengguang.wu@intel.com>)
	id 1TduaZ-0002SH-6R; Thu, 29 Nov 2012 11:14:59 +0800
Date: Thu, 29 Nov 2012 11:14:59 +0800
From: Fengguang Wu <fengguang.wu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Message-ID: <20121129031459.GA9355@localhost>
References: <50b68452.Gqr1L/cRkHFh1xmK%fengguang.wu@intel.com>
	<20121128221510.GA29950@phenom.dumpdata.com>
	<20121129022125.GG5785@localhost>
	<20121129030838.GA22724@phenom.dumpdata.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121129030838.GA22724@phenom.dumpdata.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>, xen-devel@lists.xensource.com,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [xen:stable/for-linus-3.8 4/8]
 include/xen/interface/version.h:72:2: error: implicit declaration of
 function 'xen_domain'
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 10:08:38PM -0500, Konrad Rzeszutek Wilk wrote:
> On Thu, Nov 29, 2012 at 10:21:25AM +0800, Fengguang Wu wrote:
> > On Wed, Nov 28, 2012 at 05:15:10PM -0500, Konrad Rzeszutek Wilk wrote:
> > > On Thu, Nov 29, 2012 at 05:38:26AM +0800, kbuild test robot wrote:
> > > > tree:   git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-linus-3.8
> > > > head:   394b40f62d7ae18a1c48c13fc483b8193f8c3a98
> > > > commit: 92e3229dcdc80ff0b6304f14c578d76e7e10e226 [4/8] xen/acpi: ACPI PAD driver
> > > > config: x86_64-randconfig-x701 (attached as .config)
> > > > 
> > > > Note: the xen/stable/for-linus-3.8 HEAD 394b40f builds fine.
> > > >       It only hurts bisectibility.
> > > > 
> > > > All error/warnings:
> > > > 
> > > > In file included from drivers/xen/features.c:15:0:
> > > > include/xen/interface/version.h: In function 'xen_running_on_version_or_later':
> > > > include/xen/interface/version.h:72:2: error: implicit declaration of function 'xen_domain' [-Werror=implicit-function-declaration]
> > > > cc1: some warnings being treated as errors
> > > 
> > > Which are fixed a bit later by me.
> > 
> > Yes, see the above note: "HEAD 394b40f builds fine. It only hurts bisectibility."
> > 
> > It still creates a range of not-bisectable commits due to the build
> > error. So the report was sent out, hoping that the branch can be
> > rebased to remove the error completely.
> > 
> > However if you've decided that this tree won't do rebase at all,
> 
> Not that one. The 'devel' ones are OK, but the 'stable' are .. well
> stable - with warts and all :-)

Got it. I'll record "xen/stable/.*" as non-rebaseable branches.

> > please let me know and I'll ignore such interim errors on it in
> > future.
> 
> I think this is OK. I don't mind seeing such errors.

Thanks!

Cheers,
Fengguang

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 03:15:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 03:15:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tduai-00010f-DM; Thu, 29 Nov 2012 03:15:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <fengguang.wu@intel.com>) id 1Tduag-00010X-Sw
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 03:15:07 +0000
Received: from [85.158.139.211:2173] by server-2.bemta-5.messagelabs.com id
	5A/35-04892-A33D6B05; Thu, 29 Nov 2012 03:15:06 +0000
X-Env-Sender: fengguang.wu@intel.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354158904!17852571!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4ODY5Ng==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27231 invoked from network); 29 Nov 2012 03:15:05 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-7.tower-206.messagelabs.com with SMTP;
	29 Nov 2012 03:15:05 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 28 Nov 2012 19:15:03 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,180,1355126400"; d="scan'208";a="254740256"
Received: from unknown (HELO wfg-t420.sh.intel.com) ([10.255.21.144])
	by fmsmga001.fm.intel.com with ESMTP; 28 Nov 2012 19:15:01 -0800
Received: from wfg by wfg-t420.sh.intel.com with local (Exim 4.77)
	(envelope-from <fengguang.wu@intel.com>)
	id 1TduaZ-0002SH-6R; Thu, 29 Nov 2012 11:14:59 +0800
Date: Thu, 29 Nov 2012 11:14:59 +0800
From: Fengguang Wu <fengguang.wu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Message-ID: <20121129031459.GA9355@localhost>
References: <50b68452.Gqr1L/cRkHFh1xmK%fengguang.wu@intel.com>
	<20121128221510.GA29950@phenom.dumpdata.com>
	<20121129022125.GG5785@localhost>
	<20121129030838.GA22724@phenom.dumpdata.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121129030838.GA22724@phenom.dumpdata.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>, xen-devel@lists.xensource.com,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [xen:stable/for-linus-3.8 4/8]
 include/xen/interface/version.h:72:2: error: implicit declaration of
 function 'xen_domain'
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 10:08:38PM -0500, Konrad Rzeszutek Wilk wrote:
> On Thu, Nov 29, 2012 at 10:21:25AM +0800, Fengguang Wu wrote:
> > On Wed, Nov 28, 2012 at 05:15:10PM -0500, Konrad Rzeszutek Wilk wrote:
> > > On Thu, Nov 29, 2012 at 05:38:26AM +0800, kbuild test robot wrote:
> > > > tree:   git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-linus-3.8
> > > > head:   394b40f62d7ae18a1c48c13fc483b8193f8c3a98
> > > > commit: 92e3229dcdc80ff0b6304f14c578d76e7e10e226 [4/8] xen/acpi: ACPI PAD driver
> > > > config: x86_64-randconfig-x701 (attached as .config)
> > > > 
> > > > Note: the xen/stable/for-linus-3.8 HEAD 394b40f builds fine.
> > > >       It only hurts bisectibility.
> > > > 
> > > > All error/warnings:
> > > > 
> > > > In file included from drivers/xen/features.c:15:0:
> > > > include/xen/interface/version.h: In function 'xen_running_on_version_or_later':
> > > > include/xen/interface/version.h:72:2: error: implicit declaration of function 'xen_domain' [-Werror=implicit-function-declaration]
> > > > cc1: some warnings being treated as errors
> > > 
> > > Which are fixed a bit later by me.
> > 
> > Yes, see the above note: "HEAD 394b40f builds fine. It only hurts bisectibility."
> > 
> > It still creates a range of not-bisectable commits due to the build
> > error. So the report was sent out, hoping that the branch can be
> > rebased to remove the error completely.
> > 
> > However if you've decided that this tree won't do rebase at all,
> 
> Not that one. The 'devel' ones are OK, but the 'stable' are .. well
> stable - with warts and all :-)

Got it. I'll record "xen/stable/.*" as non-rebaseable branches.

> > please let me know and I'll ignore such interim errors on it in
> > future.
> 
> I think this is OK. I don't mind seeing such errors.

Thanks!

Cheers,
Fengguang

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 03:22:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 03:22:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tduhq-0001EN-At; Thu, 29 Nov 2012 03:22:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1Tduho-0001EI-Jt
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 03:22:28 +0000
Received: from [85.158.138.51:24219] by server-9.bemta-3.messagelabs.com id
	07/D9-02388-3F4D6B05; Thu, 29 Nov 2012 03:22:27 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1354159345!24002242!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY4NDYx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5025 invoked from network); 29 Nov 2012 03:22:26 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-12.tower-174.messagelabs.com with SMTP;
	29 Nov 2012 03:22:26 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga102.jf.intel.com with ESMTP; 28 Nov 2012 19:21:41 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,182,1355126400"; d="scan'208";a="248912132"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by orsmga002.jf.intel.com with ESMTP; 28 Nov 2012 19:22:24 -0800
Received: from fmsmsx151.amr.corp.intel.com (10.19.17.220) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 28 Nov 2012 19:22:24 -0800
Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by
	FMSMSX151.amr.corp.intel.com (10.19.17.220) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 28 Nov 2012 19:22:23 -0800
Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.85]) by
	SHSMSX101.ccr.corp.intel.com ([169.254.1.88]) with mapi id
	14.01.0355.002; Thu, 29 Nov 2012 11:22:22 +0800
From: "Xu, Dongxiao" <dongxiao.xu@intel.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Thread-Topic: [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and cpu_ioreq_move
Thread-Index: AQHNlYfw7H3UHXeENUmeaZTLDKQjt5gAlZlw
Date: Thu, 29 Nov 2012 03:22:21 +0000
Message-ID: <40776A41FC278F40B59438AD47D147A90FEAE3A2@SHSMSX102.ccr.corp.intel.com>
References: <alpine.DEB.2.02.1209101842150.15568@kaball.uk.xensource.com>
	<40776A41FC278F40B59438AD47D147A90FE40092@SHSMSX102.ccr.corp.intel.com>
	<alpine.DEB.2.02.1209181123280.29232@kaball.uk.xensource.com>
In-Reply-To: <alpine.DEB.2.02.1209181123280.29232@kaball.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Xen-devel] [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and
	cpu_ioreq_move
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> -----Original Message-----
> From: Stefano Stabellini [mailto:stefano.stabellini@eu.citrix.com]
> Sent: Tuesday, September 18, 2012 6:24 PM
> To: Xu, Dongxiao
> Cc: Stefano Stabellini; xen-devel@lists.xensource.com; Ian Jackson;
> qemu-devel@nongnu.org; Keir (Xen.org)
> Subject: RE: [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and
> cpu_ioreq_move
> 
> On Tue, 18 Sep 2012, Xu, Dongxiao wrote:
> > Hi Stefano,
> >
> > Is these patches merged with Xen 4.2? I didn't see them in the upstream.
> > The uint/int fix is critical to fix the nested guest boot issue.
> 
> They are not. Ian decided that he wanted to merge a different version of them.

Hi Stefano and Ian,

What's the status of the two patches? I still didn't see them merged...
Also I think 4.2.1 need these patches to enable the basic Xen on Xen nested virtualization usage scenario.

Thanks,
Dongxiao

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 03:22:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 03:22:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tduhq-0001EN-At; Thu, 29 Nov 2012 03:22:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dongxiao.xu@intel.com>) id 1Tduho-0001EI-Jt
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 03:22:28 +0000
Received: from [85.158.138.51:24219] by server-9.bemta-3.messagelabs.com id
	07/D9-02388-3F4D6B05; Thu, 29 Nov 2012 03:22:27 +0000
X-Env-Sender: dongxiao.xu@intel.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1354159345!24002242!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY4NDYx\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5025 invoked from network); 29 Nov 2012 03:22:26 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-12.tower-174.messagelabs.com with SMTP;
	29 Nov 2012 03:22:26 -0000
Received: from orsmga002.jf.intel.com ([10.7.209.21])
	by orsmga102.jf.intel.com with ESMTP; 28 Nov 2012 19:21:41 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,182,1355126400"; d="scan'208";a="248912132"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by orsmga002.jf.intel.com with ESMTP; 28 Nov 2012 19:22:24 -0800
Received: from fmsmsx151.amr.corp.intel.com (10.19.17.220) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 28 Nov 2012 19:22:24 -0800
Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by
	FMSMSX151.amr.corp.intel.com (10.19.17.220) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Wed, 28 Nov 2012 19:22:23 -0800
Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.85]) by
	SHSMSX101.ccr.corp.intel.com ([169.254.1.88]) with mapi id
	14.01.0355.002; Thu, 29 Nov 2012 11:22:22 +0800
From: "Xu, Dongxiao" <dongxiao.xu@intel.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Thread-Topic: [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and cpu_ioreq_move
Thread-Index: AQHNlYfw7H3UHXeENUmeaZTLDKQjt5gAlZlw
Date: Thu, 29 Nov 2012 03:22:21 +0000
Message-ID: <40776A41FC278F40B59438AD47D147A90FEAE3A2@SHSMSX102.ccr.corp.intel.com>
References: <alpine.DEB.2.02.1209101842150.15568@kaball.uk.xensource.com>
	<40776A41FC278F40B59438AD47D147A90FE40092@SHSMSX102.ccr.corp.intel.com>
	<alpine.DEB.2.02.1209181123280.29232@kaball.uk.xensource.com>
In-Reply-To: <alpine.DEB.2.02.1209181123280.29232@kaball.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Xen-devel] [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and
	cpu_ioreq_move
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> -----Original Message-----
> From: Stefano Stabellini [mailto:stefano.stabellini@eu.citrix.com]
> Sent: Tuesday, September 18, 2012 6:24 PM
> To: Xu, Dongxiao
> Cc: Stefano Stabellini; xen-devel@lists.xensource.com; Ian Jackson;
> qemu-devel@nongnu.org; Keir (Xen.org)
> Subject: RE: [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and
> cpu_ioreq_move
> 
> On Tue, 18 Sep 2012, Xu, Dongxiao wrote:
> > Hi Stefano,
> >
> > Is these patches merged with Xen 4.2? I didn't see them in the upstream.
> > The uint/int fix is critical to fix the nested guest boot issue.
> 
> They are not. Ian decided that he wanted to merge a different version of them.

Hi Stefano and Ian,

What's the status of the two patches? I still didn't see them merged...
Also I think 4.2.1 need these patches to enable the basic Xen on Xen nested virtualization usage scenario.

Thanks,
Dongxiao

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 07:03:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 07:03:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdy8l-00039J-1A; Thu, 29 Nov 2012 07:02:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kouya@jp.fujitsu.com>) id 1Tdy8i-00039E-SG
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 07:02:29 +0000
Received: from [85.158.138.51:30871] by server-13.bemta-3.messagelabs.com id
	98/93-24887-48807B05; Thu, 29 Nov 2012 07:02:28 +0000
X-Env-Sender: kouya@jp.fujitsu.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354172544!25581881!1
X-Originating-IP: [192.51.44.35]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjUxLjQ0LjM1ID0+IDM1MTA4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4167 invoked from network); 29 Nov 2012 07:02:26 -0000
Received: from fgwmail5.fujitsu.co.jp (HELO fgwmail5.fujitsu.co.jp)
	(192.51.44.35)
	by server-14.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 07:02:26 -0000
Received: from m4.gw.fujitsu.co.jp (unknown [10.0.50.74])
	by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id C8FB33EE081
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 16:02:22 +0900 (JST)
Received: from smail (m4 [127.0.0.1])
	by outgoing.m4.gw.fujitsu.co.jp (Postfix) with ESMTP id AF91E45DE4E
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 16:02:22 +0900 (JST)
Received: from s4.gw.fujitsu.co.jp (s4.gw.fujitsu.co.jp [10.0.50.94])
	by m4.gw.fujitsu.co.jp (Postfix) with ESMTP id 9A45345DE4D
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 16:02:22 +0900 (JST)
Received: from s4.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1])
	by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 8CEEC1DB8040
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 16:02:22 +0900 (JST)
Received: from g01jpexchkw02.g01.fujitsu.local
	(g01jpexchkw02.g01.fujitsu.local [10.0.194.41])
	by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 4A2571DB802F
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 16:02:22 +0900 (JST)
Received: from [10.33.110.144] (10.33.110.144) by
	g01jpexchkw02.g01.fujitsu.local (10.0.194.41) with Microsoft SMTP
	Server (TLS) id 14.2.309.2; Thu, 29 Nov 2012 16:02:21 +0900
Message-ID: <50B7087D.20407@jp.fujitsu.com>
Date: Thu, 29 Nov 2012 16:02:21 +0900
From: Kouya Shimura <kouya@jp.fujitsu.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
Content-Type: multipart/mixed; boundary="------------010100060105050609020200"
X-Originating-IP: [10.33.110.144]
Subject: [Xen-devel] [PATCH] x86/hap: fix race condition between
 ENABLE_LOGDIRTY and track_dirty_vram hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--------------010100060105050609020200
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
Content-Transfer-Encoding: 7bit

There is a race condition between XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY
and HVMOP_track_dirty_vram hypercall.

Although HVMOP_track_dirty_vram is called many times from qemu-dm
which is connected via VNC, XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY is
called only once from a migration process (e.g. xc_save, libxl-save-helper).
So the race seldom happens, but the following cases are possible.

========================================================================
[case-1]
XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY hypercall
-> paging_enable_logdirty()
   -> hap_logdirty_init()
     -> paging_log_dirty_disable()
        dirty_vram = NULL
     -> paging_log_dirty_init(d, hap_enable_log_dirty, ...) ---> (A)
   -> paging_log_dirty_enable()
**************************************************************************
     /* <--- (B) */
     -> hap_enable_vram_tracking() // should be hap_enable_log_dirty() !!!
        return -EINVAL
<- return -EINVAL // live-migration failure!!!
**************************************************************************

HVMOP_track_dirty_vram
-> hap_track_dirty_vram()
   /* (!paging_mode_log_dirty(d) && !dirty_vram) */
   -> hap_vram_tracking_init()
     /* <--- (A) */
     -> paging_log_dirty_init(d, hap_enable_vram_tracking, ...) ---> (B)
   -> paging_log_dirty_enable()
========================================================================
[case-2]
XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY hypercall
-> paging_enable_logdirty()
   -> hap_logdirty_init()
     -> paging_log_dirty_disable()
        /* d->arch.hvm_domain.dirty_vram != NULL */
        d->arch.paging.mode &= ~PG_log_dirty; ---> (C)
        /* d->arch.hvm_domain.dirty_vram is freed */
        dereference dirty_vram // access to freed memory !!! <--- (D)

HVMOP_track_dirty_vram
-> hap_track_dirty_vram()
   /* (!paging_mode_log_dirty(d) && dirty_vram) */ <---(C)
     rc = -EINVAL
     xfree(dirty_vram); ---> (D)
     dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
     return rc;
========================================================================

Actually I encountered the xen crash by null pointer exception in xen-3.4.
FYI, in xen-4.x, c/s 19738:8dd5c3cae086 mitigated it.

I'm not sure why paging_lock() is used partially in hap_XXX_vram_tracking
functions. Thus, this patch introduces a new lock.
It would be better to use paging_lock() instead of the new lock
since shadow paging mode (not HAP mode) uses paging_lock to avoid
this race condition.

Thanks,
Kouya

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>

--------------010100060105050609020200
Content-Type: text/x-patch; name="hap_dirty_vram.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="hap_dirty_vram.patch"

diff -r d1d05cb59a76 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Wed Nov 14 16:27:58 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Wed Nov 28 16:04:19 2012 +0900
@@ -513,6 +513,7 @@ int hvm_domain_initialise(struct domain 
     spin_lock_init(&d->arch.hvm_domain.pbuf_lock);
     spin_lock_init(&d->arch.hvm_domain.irq_lock);
     spin_lock_init(&d->arch.hvm_domain.uc_lock);
+    spin_lock_init(&d->arch.hvm_domain.dirty_vram_lock);
 
     INIT_LIST_HEAD(&d->arch.hvm_domain.msixtbl_list);
     spin_lock_init(&d->arch.hvm_domain.msixtbl_list_lock);
diff -r d1d05cb59a76 xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Wed Nov 14 16:27:58 2012 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Wed Nov 28 16:04:19 2012 +0900
@@ -122,7 +122,12 @@ int hap_track_dirty_vram(struct domain *
                          XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
 {
     long rc = 0;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    struct sh_dirty_vram *dirty_vram;
+
+    if ( !spin_trylock(&d->arch.hvm_domain.dirty_vram_lock) )
+        return -ENODATA;
+
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
 
     if ( nr )
     {
@@ -174,6 +179,7 @@ int hap_track_dirty_vram(struct domain *
             rc = 0;
     }
 
+    spin_unlock(&d->arch.hvm_domain.dirty_vram_lock);
     return rc;
 
 param_fail:
@@ -182,6 +188,8 @@ param_fail:
         xfree(dirty_vram);
         dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
     }
+
+    spin_unlock(&d->arch.hvm_domain.dirty_vram_lock);
     return rc;
 }
 
diff -r d1d05cb59a76 xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c	Wed Nov 14 16:27:58 2012 +0000
+++ b/xen/arch/x86/mm/paging.c	Wed Nov 28 16:04:19 2012 +0900
@@ -697,14 +697,21 @@ int paging_domctl(struct domain *d, xen_
             break;
         /* Else fall through... */
     case XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY:
+        spin_lock(&d->arch.hvm_domain.dirty_vram_lock);
         if ( hap_enabled(d) )
             hap_logdirty_init(d);
-        return paging_log_dirty_enable(d);
+        rc = paging_log_dirty_enable(d);
+        spin_unlock(&d->arch.hvm_domain.dirty_vram_lock);
+        return rc;
 
     case XEN_DOMCTL_SHADOW_OP_OFF:
+        spin_lock(&d->arch.hvm_domain.dirty_vram_lock);
+        rc = 0;
         if ( paging_mode_log_dirty(d) )
-            if ( (rc = paging_log_dirty_disable(d)) != 0 )
-                return rc;
+            rc = paging_log_dirty_disable(d);
+        spin_unlock(&d->arch.hvm_domain.dirty_vram_lock);
+        if ( rc != 0 )
+            return rc;
         break;
 
     case XEN_DOMCTL_SHADOW_OP_CLEAN:
diff -r d1d05cb59a76 xen/include/asm-x86/hvm/domain.h
--- a/xen/include/asm-x86/hvm/domain.h	Wed Nov 14 16:27:58 2012 +0000
+++ b/xen/include/asm-x86/hvm/domain.h	Wed Nov 28 16:04:19 2012 +0900
@@ -75,6 +75,7 @@ struct hvm_domain {
 
     /* VRAM dirty support. */
     struct sh_dirty_vram *dirty_vram;
+    spinlock_t dirty_vram_lock;
 
     /* If one of vcpus of this domain is in no_fill_mode or
      * mtrr/pat between vcpus is not the same, set is_in_uc_mode

--------------010100060105050609020200
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.xen.org
http://lists.xen.org/xen-devel

--------------010100060105050609020200--


From xen-devel-bounces@lists.xen.org Thu Nov 29 07:03:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 07:03:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdy8l-00039J-1A; Thu, 29 Nov 2012 07:02:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <kouya@jp.fujitsu.com>) id 1Tdy8i-00039E-SG
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 07:02:29 +0000
Received: from [85.158.138.51:30871] by server-13.bemta-3.messagelabs.com id
	98/93-24887-48807B05; Thu, 29 Nov 2012 07:02:28 +0000
X-Env-Sender: kouya@jp.fujitsu.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354172544!25581881!1
X-Originating-IP: [192.51.44.35]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjUxLjQ0LjM1ID0+IDM1MTA4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4167 invoked from network); 29 Nov 2012 07:02:26 -0000
Received: from fgwmail5.fujitsu.co.jp (HELO fgwmail5.fujitsu.co.jp)
	(192.51.44.35)
	by server-14.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 07:02:26 -0000
Received: from m4.gw.fujitsu.co.jp (unknown [10.0.50.74])
	by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id C8FB33EE081
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 16:02:22 +0900 (JST)
Received: from smail (m4 [127.0.0.1])
	by outgoing.m4.gw.fujitsu.co.jp (Postfix) with ESMTP id AF91E45DE4E
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 16:02:22 +0900 (JST)
Received: from s4.gw.fujitsu.co.jp (s4.gw.fujitsu.co.jp [10.0.50.94])
	by m4.gw.fujitsu.co.jp (Postfix) with ESMTP id 9A45345DE4D
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 16:02:22 +0900 (JST)
Received: from s4.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1])
	by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 8CEEC1DB8040
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 16:02:22 +0900 (JST)
Received: from g01jpexchkw02.g01.fujitsu.local
	(g01jpexchkw02.g01.fujitsu.local [10.0.194.41])
	by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 4A2571DB802F
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 16:02:22 +0900 (JST)
Received: from [10.33.110.144] (10.33.110.144) by
	g01jpexchkw02.g01.fujitsu.local (10.0.194.41) with Microsoft SMTP
	Server (TLS) id 14.2.309.2; Thu, 29 Nov 2012 16:02:21 +0900
Message-ID: <50B7087D.20407@jp.fujitsu.com>
Date: Thu, 29 Nov 2012 16:02:21 +0900
From: Kouya Shimura <kouya@jp.fujitsu.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
Content-Type: multipart/mixed; boundary="------------010100060105050609020200"
X-Originating-IP: [10.33.110.144]
Subject: [Xen-devel] [PATCH] x86/hap: fix race condition between
 ENABLE_LOGDIRTY and track_dirty_vram hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--------------010100060105050609020200
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
Content-Transfer-Encoding: 7bit

There is a race condition between XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY
and HVMOP_track_dirty_vram hypercall.

Although HVMOP_track_dirty_vram is called many times from qemu-dm
which is connected via VNC, XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY is
called only once from a migration process (e.g. xc_save, libxl-save-helper).
So the race seldom happens, but the following cases are possible.

========================================================================
[case-1]
XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY hypercall
-> paging_enable_logdirty()
   -> hap_logdirty_init()
     -> paging_log_dirty_disable()
        dirty_vram = NULL
     -> paging_log_dirty_init(d, hap_enable_log_dirty, ...) ---> (A)
   -> paging_log_dirty_enable()
**************************************************************************
     /* <--- (B) */
     -> hap_enable_vram_tracking() // should be hap_enable_log_dirty() !!!
        return -EINVAL
<- return -EINVAL // live-migration failure!!!
**************************************************************************

HVMOP_track_dirty_vram
-> hap_track_dirty_vram()
   /* (!paging_mode_log_dirty(d) && !dirty_vram) */
   -> hap_vram_tracking_init()
     /* <--- (A) */
     -> paging_log_dirty_init(d, hap_enable_vram_tracking, ...) ---> (B)
   -> paging_log_dirty_enable()
========================================================================
[case-2]
XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY hypercall
-> paging_enable_logdirty()
   -> hap_logdirty_init()
     -> paging_log_dirty_disable()
        /* d->arch.hvm_domain.dirty_vram != NULL */
        d->arch.paging.mode &= ~PG_log_dirty; ---> (C)
        /* d->arch.hvm_domain.dirty_vram is freed */
        dereference dirty_vram // access to freed memory !!! <--- (D)

HVMOP_track_dirty_vram
-> hap_track_dirty_vram()
   /* (!paging_mode_log_dirty(d) && dirty_vram) */ <---(C)
     rc = -EINVAL
     xfree(dirty_vram); ---> (D)
     dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
     return rc;
========================================================================

Actually I encountered the xen crash by null pointer exception in xen-3.4.
FYI, in xen-4.x, c/s 19738:8dd5c3cae086 mitigated it.

I'm not sure why paging_lock() is used partially in hap_XXX_vram_tracking
functions. Thus, this patch introduces a new lock.
It would be better to use paging_lock() instead of the new lock
since shadow paging mode (not HAP mode) uses paging_lock to avoid
this race condition.

Thanks,
Kouya

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>

--------------010100060105050609020200
Content-Type: text/x-patch; name="hap_dirty_vram.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="hap_dirty_vram.patch"

diff -r d1d05cb59a76 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Wed Nov 14 16:27:58 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Wed Nov 28 16:04:19 2012 +0900
@@ -513,6 +513,7 @@ int hvm_domain_initialise(struct domain 
     spin_lock_init(&d->arch.hvm_domain.pbuf_lock);
     spin_lock_init(&d->arch.hvm_domain.irq_lock);
     spin_lock_init(&d->arch.hvm_domain.uc_lock);
+    spin_lock_init(&d->arch.hvm_domain.dirty_vram_lock);
 
     INIT_LIST_HEAD(&d->arch.hvm_domain.msixtbl_list);
     spin_lock_init(&d->arch.hvm_domain.msixtbl_list_lock);
diff -r d1d05cb59a76 xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Wed Nov 14 16:27:58 2012 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Wed Nov 28 16:04:19 2012 +0900
@@ -122,7 +122,12 @@ int hap_track_dirty_vram(struct domain *
                          XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
 {
     long rc = 0;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    struct sh_dirty_vram *dirty_vram;
+
+    if ( !spin_trylock(&d->arch.hvm_domain.dirty_vram_lock) )
+        return -ENODATA;
+
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
 
     if ( nr )
     {
@@ -174,6 +179,7 @@ int hap_track_dirty_vram(struct domain *
             rc = 0;
     }
 
+    spin_unlock(&d->arch.hvm_domain.dirty_vram_lock);
     return rc;
 
 param_fail:
@@ -182,6 +188,8 @@ param_fail:
         xfree(dirty_vram);
         dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
     }
+
+    spin_unlock(&d->arch.hvm_domain.dirty_vram_lock);
     return rc;
 }
 
diff -r d1d05cb59a76 xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c	Wed Nov 14 16:27:58 2012 +0000
+++ b/xen/arch/x86/mm/paging.c	Wed Nov 28 16:04:19 2012 +0900
@@ -697,14 +697,21 @@ int paging_domctl(struct domain *d, xen_
             break;
         /* Else fall through... */
     case XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY:
+        spin_lock(&d->arch.hvm_domain.dirty_vram_lock);
         if ( hap_enabled(d) )
             hap_logdirty_init(d);
-        return paging_log_dirty_enable(d);
+        rc = paging_log_dirty_enable(d);
+        spin_unlock(&d->arch.hvm_domain.dirty_vram_lock);
+        return rc;
 
     case XEN_DOMCTL_SHADOW_OP_OFF:
+        spin_lock(&d->arch.hvm_domain.dirty_vram_lock);
+        rc = 0;
         if ( paging_mode_log_dirty(d) )
-            if ( (rc = paging_log_dirty_disable(d)) != 0 )
-                return rc;
+            rc = paging_log_dirty_disable(d);
+        spin_unlock(&d->arch.hvm_domain.dirty_vram_lock);
+        if ( rc != 0 )
+            return rc;
         break;
 
     case XEN_DOMCTL_SHADOW_OP_CLEAN:
diff -r d1d05cb59a76 xen/include/asm-x86/hvm/domain.h
--- a/xen/include/asm-x86/hvm/domain.h	Wed Nov 14 16:27:58 2012 +0000
+++ b/xen/include/asm-x86/hvm/domain.h	Wed Nov 28 16:04:19 2012 +0900
@@ -75,6 +75,7 @@ struct hvm_domain {
 
     /* VRAM dirty support. */
     struct sh_dirty_vram *dirty_vram;
+    spinlock_t dirty_vram_lock;
 
     /* If one of vcpus of this domain is in no_fill_mode or
      * mtrr/pat between vcpus is not the same, set is_in_uc_mode

--------------010100060105050609020200
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.xen.org
http://lists.xen.org/xen-devel

--------------010100060105050609020200--


From xen-devel-bounces@lists.xen.org Thu Nov 29 07:26:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 07:26:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdyVb-0003PX-J7; Thu, 29 Nov 2012 07:26:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdyVa-0003PS-0E
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 07:26:06 +0000
Received: from [193.109.254.147:23696] by server-5.bemta-14.messagelabs.com id
	AF/F9-10257-D0E07B05; Thu, 29 Nov 2012 07:26:05 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1354173964!1911980!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10907 invoked from network); 29 Nov 2012 07:26:04 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 07:26:04 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 29 Nov 2012 07:26:03 +0000
Message-Id: <50B71C5302000078000AC5CE@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 29 Nov 2012 07:26:59 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Kouya Shimura" <kouya@jp.fujitsu.com>
References: <50B5B48C.7040804@jp.fujitsu.com>
	<50B5DBD702000078000AC021@nat28.tlf.novell.com>
	<50B6B3AA.2080505@jp.fujitsu.com>
In-Reply-To: <50B6B3AA.2080505@jp.fujitsu.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] x86/hap: Fix memory leak of
 domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 29.11.12 at 02:00, Kouya Shimura <kouya@jp.fujitsu.com> wrote:
> On 11/28/2012 05:39 PM, Jan Beulich wrote:
>>>>> On 28.11.12 at 07:51, Kouya Shimura <kouya@jp.fujitsu.com> wrote:
>>> This patch fixes the memory leak of domain->arch.hvm_domain.dirty_vram.
>>>
>>> Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
>>
>> Wouldn't it be more consistent (and less redundant) to do this
>> through calling hap_track_dirty_vram(d, 0, 0, ...)? And even if
>> not, the conditional around the freeing/clearing is pointless.
> 
>  From another point of view, it's consistent since it almost
> copied from shadow_teardown()@xen/arch/x86/mm/shadow/common.c.
> That is a sibling function of hap_teardown().
> If it's not preferable, another cleanup patch should be made.

Tim will have the final say here anyway. But my general opinion
is that copying existing code is not an excuse to also copy its
eventual deficiencies.

> IMHO, I feel no good to remain a pointer to the freed memory
> even though it never be dereferenced any more.
> So it makes sense to check the pointer and set it NULL.

I didn't say you shouldn't clear the pointer field. All I said is
that the conditional around the freeing and clearing is pointless.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 07:26:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 07:26:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdyVb-0003PX-J7; Thu, 29 Nov 2012 07:26:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdyVa-0003PS-0E
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 07:26:06 +0000
Received: from [193.109.254.147:23696] by server-5.bemta-14.messagelabs.com id
	AF/F9-10257-D0E07B05; Thu, 29 Nov 2012 07:26:05 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1354173964!1911980!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10907 invoked from network); 29 Nov 2012 07:26:04 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 07:26:04 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 29 Nov 2012 07:26:03 +0000
Message-Id: <50B71C5302000078000AC5CE@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 29 Nov 2012 07:26:59 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Kouya Shimura" <kouya@jp.fujitsu.com>
References: <50B5B48C.7040804@jp.fujitsu.com>
	<50B5DBD702000078000AC021@nat28.tlf.novell.com>
	<50B6B3AA.2080505@jp.fujitsu.com>
In-Reply-To: <50B6B3AA.2080505@jp.fujitsu.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] x86/hap: Fix memory leak of
 domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 29.11.12 at 02:00, Kouya Shimura <kouya@jp.fujitsu.com> wrote:
> On 11/28/2012 05:39 PM, Jan Beulich wrote:
>>>>> On 28.11.12 at 07:51, Kouya Shimura <kouya@jp.fujitsu.com> wrote:
>>> This patch fixes the memory leak of domain->arch.hvm_domain.dirty_vram.
>>>
>>> Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
>>
>> Wouldn't it be more consistent (and less redundant) to do this
>> through calling hap_track_dirty_vram(d, 0, 0, ...)? And even if
>> not, the conditional around the freeing/clearing is pointless.
> 
>  From another point of view, it's consistent since it almost
> copied from shadow_teardown()@xen/arch/x86/mm/shadow/common.c.
> That is a sibling function of hap_teardown().
> If it's not preferable, another cleanup patch should be made.

Tim will have the final say here anyway. But my general opinion
is that copying existing code is not an excuse to also copy its
eventual deficiencies.

> IMHO, I feel no good to remain a pointer to the freed memory
> even though it never be dereferenced any more.
> So it makes sense to check the pointer and set it NULL.

I didn't say you shouldn't clear the pointer field. All I said is
that the conditional around the freeing and clearing is pointless.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 07:29:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 07:29:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdyY6-0003Uu-4K; Thu, 29 Nov 2012 07:28:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdyY4-0003Un-Jl
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 07:28:40 +0000
Received: from [193.109.254.147:34553] by server-5.bemta-14.messagelabs.com id
	6C/1C-10257-7AE07B05; Thu, 29 Nov 2012 07:28:39 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1354174119!8808801!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22046 invoked from network); 29 Nov 2012 07:28:39 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 07:28:39 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 29 Nov 2012 07:27:40 +0000
Message-Id: <50B71CB202000078000AC5D1@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 29 Nov 2012 07:28:34 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mukesh Rathor" <mukesh.rathor@oracle.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
	<20121128175039.62112c96@mantra.us.oracle.com>
In-Reply-To: <20121128175039.62112c96@mantra.us.oracle.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 29.11.12 at 02:50, Mukesh Rathor <mukesh.rathor@oracle.com> wrote:
> On Wed, 28 Nov 2012 08:24:04 +0000
> "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>> >>> On 27.11.12 at 22:31, Konrad Rzeszutek Wilk
>> >>> <konrad.wilk@oracle.com> wrote:
>> > Mukesh Rathor (6):
>> >       xen/pvh: Support ParaVirtualized Hardware extensions.
>> >       xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
>> >       xen/pvh: Implement MMU changes for PVH.
>> >       xen/pvh: bootup and setup (E820) related changes.
>> >       xen/pvh: balloon and grant changes.
>> >       xen/pvh: /dev/xen/privcmd changes.
>> 
>> As said before - I don't think it is a good idea to push the kernel
>> side changes into an official release when the hypervisor side ones
>> didn't even get an initial review yet.
> 
> On the xen patch side, I've refrshed my tree. I realized I had undone
> the union of pv_domain and hvm_domain since I used fields from both.
> I'm now redoing that to make that a union and add a struct in
> hvm_domain for fields from pv_domain that are used by PVH. 

Perhaps better to move out of the union just the shared fields?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 07:29:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 07:29:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdyY6-0003Uu-4K; Thu, 29 Nov 2012 07:28:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TdyY4-0003Un-Jl
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 07:28:40 +0000
Received: from [193.109.254.147:34553] by server-5.bemta-14.messagelabs.com id
	6C/1C-10257-7AE07B05; Thu, 29 Nov 2012 07:28:39 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1354174119!8808801!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22046 invoked from network); 29 Nov 2012 07:28:39 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 07:28:39 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 29 Nov 2012 07:27:40 +0000
Message-Id: <50B71CB202000078000AC5D1@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 29 Nov 2012 07:28:34 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Mukesh Rathor" <mukesh.rathor@oracle.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
	<20121128175039.62112c96@mantra.us.oracle.com>
In-Reply-To: <20121128175039.62112c96@mantra.us.oracle.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 29.11.12 at 02:50, Mukesh Rathor <mukesh.rathor@oracle.com> wrote:
> On Wed, 28 Nov 2012 08:24:04 +0000
> "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>> >>> On 27.11.12 at 22:31, Konrad Rzeszutek Wilk
>> >>> <konrad.wilk@oracle.com> wrote:
>> > Mukesh Rathor (6):
>> >       xen/pvh: Support ParaVirtualized Hardware extensions.
>> >       xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
>> >       xen/pvh: Implement MMU changes for PVH.
>> >       xen/pvh: bootup and setup (E820) related changes.
>> >       xen/pvh: balloon and grant changes.
>> >       xen/pvh: /dev/xen/privcmd changes.
>> 
>> As said before - I don't think it is a good idea to push the kernel
>> side changes into an official release when the hypervisor side ones
>> didn't even get an initial review yet.
> 
> On the xen patch side, I've refrshed my tree. I realized I had undone
> the union of pv_domain and hvm_domain since I used fields from both.
> I'm now redoing that to make that a union and add a struct in
> hvm_domain for fields from pv_domain that are used by PVH. 

Perhaps better to move out of the union just the shared fields?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 07:52:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 07:52:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdyum-0003oB-87; Thu, 29 Nov 2012 07:52:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tdyuk-0003o6-2w
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 07:52:06 +0000
Received: from [193.109.254.147:45866] by server-11.bemta-14.messagelabs.com
	id 4A/B1-29027-52417B05; Thu, 29 Nov 2012 07:52:05 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1354175524!8810985!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16714 invoked from network); 29 Nov 2012 07:52:04 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 07:52:04 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 29 Nov 2012 07:52:04 +0000
Message-Id: <50B7226B02000078000AC608@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 29 Nov 2012 07:52:59 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <xiantao.zhang@intel.com>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
In-Reply-To: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH, RFC 0/7] IOMMU: add phantom function support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 28.11.12 at 10:41, "Jan Beulich" <JBeulich@suse.com> wrote:
> While I'm unaware of devices making use of this functionality in
> proper ways, the goal of this patch set is to leverage the enabling
> of the specified behavior as a workaround for devices that behave
> as if they made use of this functionality _without_ advertising so
> in the PCIe capability structure.
> 
> While it would have been possible to leave the generic IOMMU
> code untouched, and deal with the creation of the necessary
> device context entries in the individual IOMMUs' implementations,
> I felt that it was cleaner to have as much of the necessary
> abstraction in the generic layer.
> 
> The adjustments in particular imply that for the relevant
> operations, (PCI-dev, devfn) tuples get passed, with the PCI
> device referring to the real device and devfn representing
> either the real device or the phantom function. Consequently,
> for any operation intended to deal with the real device, the
> devfn of the device itself must be used, whereas for anything
> targeting the phantom function the passed in value is the
> correct one to pass on.
> 
> 1: IOMMU: adjust (re)assign operation parameters
> 2: IOMMU: adjust add/remove operation parameters
> 3: VT-d: adjust context map/unmap parameters
> 4: AMD IOMMU: adjust flush function parameters
> 5: IOMMU: consolidate pdev_type() and cache its result for a given device
> 6: IOMMU: add phantom function support
> 7: IOMMU: add option to specify devices behaving like ones using phantom 
> functions
> 
> As the patch set wasn't tested on the affected systems yet, I'm
> intentionally not adding S-o-b tags yet. I would appreciate review
> nevertheless (and even more so, given that I won't be able to
> test this code other than what I did in contrived scenarios).

One open question (that I realized only after sending the batch)
is whether for such devices the source ID verification should be
set up using one of the SQ_13_IGNORE_* (fitting the stride).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 07:52:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 07:52:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdyum-0003oB-87; Thu, 29 Nov 2012 07:52:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tdyuk-0003o6-2w
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 07:52:06 +0000
Received: from [193.109.254.147:45866] by server-11.bemta-14.messagelabs.com
	id 4A/B1-29027-52417B05; Thu, 29 Nov 2012 07:52:05 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1354175524!8810985!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16714 invoked from network); 29 Nov 2012 07:52:04 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 07:52:04 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 29 Nov 2012 07:52:04 +0000
Message-Id: <50B7226B02000078000AC608@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 29 Nov 2012 07:52:59 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <xiantao.zhang@intel.com>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
In-Reply-To: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH, RFC 0/7] IOMMU: add phantom function support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 28.11.12 at 10:41, "Jan Beulich" <JBeulich@suse.com> wrote:
> While I'm unaware of devices making use of this functionality in
> proper ways, the goal of this patch set is to leverage the enabling
> of the specified behavior as a workaround for devices that behave
> as if they made use of this functionality _without_ advertising so
> in the PCIe capability structure.
> 
> While it would have been possible to leave the generic IOMMU
> code untouched, and deal with the creation of the necessary
> device context entries in the individual IOMMUs' implementations,
> I felt that it was cleaner to have as much of the necessary
> abstraction in the generic layer.
> 
> The adjustments in particular imply that for the relevant
> operations, (PCI-dev, devfn) tuples get passed, with the PCI
> device referring to the real device and devfn representing
> either the real device or the phantom function. Consequently,
> for any operation intended to deal with the real device, the
> devfn of the device itself must be used, whereas for anything
> targeting the phantom function the passed in value is the
> correct one to pass on.
> 
> 1: IOMMU: adjust (re)assign operation parameters
> 2: IOMMU: adjust add/remove operation parameters
> 3: VT-d: adjust context map/unmap parameters
> 4: AMD IOMMU: adjust flush function parameters
> 5: IOMMU: consolidate pdev_type() and cache its result for a given device
> 6: IOMMU: add phantom function support
> 7: IOMMU: add option to specify devices behaving like ones using phantom 
> functions
> 
> As the patch set wasn't tested on the affected systems yet, I'm
> intentionally not adding S-o-b tags yet. I would appreciate review
> nevertheless (and even more so, given that I won't be able to
> test this code other than what I did in contrived scenarios).

One open question (that I realized only after sending the batch)
is whether for such devices the source ID verification should be
set up using one of the SQ_13_IGNORE_* (fitting the stride).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 07:53:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 07:53:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdywC-0003sM-NM; Thu, 29 Nov 2012 07:53:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdywB-0003sB-6r
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 07:53:35 +0000
Received: from [85.158.139.211:64303] by server-1.bemta-5.messagelabs.com id
	2F/EE-09311-E7417B05; Thu, 29 Nov 2012 07:53:34 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1354175613!18329141!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUwNDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19365 invoked from network); 29 Nov 2012 07:53:33 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 07:53:33 -0000
X-IronPort-AV: E=Sophos;i="4.84,182,1355097600"; d="scan'208";a="16061241"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 07:53:32 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 07:53:32 +0000
Message-ID: <1354175611.6039.22.camel@dagon.hellion.org.uk>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Thu, 29 Nov 2012 07:53:31 +0000
In-Reply-To: <50B68EC3.1070803@jhuapl.edu>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
	<1353668646.13542.228.camel@zakaz.uk.xensource.com>
	<20121128204630.GB3479@phenom.dumpdata.com>
	<50B68EC3.1070803@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 22:22 +0000, Matthew Fioravante wrote:
> On 11/28/2012 03:46 PM, Konrad Rzeszutek Wilk wrote:

> > We could cop out and just name this new driver differently. Then
> > we would not have to deal with the older ones.
> I've already done that with my patch on the linux mailing list. The old 
> frontend driver name was tpm_xenu.ko, the new one is xen-tpmfront.ko.

The name of the driver module isn't really relevant here, what matters
is the name component of the xenstore paths used to trigger the creation
the front and back devices, if they end up loading mutually
incomprehensible versions of front and back then I expect that the
failure case will be pretty hard to diagnose.

The code I'm talking about is a handful of lines in both front and back,
with $OTHEREND substituted as appropriate:

	err = xenbus_printf(xbt, dev->nodename, "feature-protocol-v2", "1");
        if (err) {
                message = "writing feature-protocol-v2";
                goto abort_transaction;
        }
	...
        if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-protocol-v2", "%d", &val) < 0) {
		printk(KERN_WARN "Warning: $OTHEREND does not appear to support feature-protocol-v2\n");
		printk(KERN_WARN "Perhaps it is running the obsolete out of tree vtpm driver?\n");
		return -EFOOBAR;
	}

Tweak the actual wording to taste.

If there is a better/more descriptive name for the new protocol than
"protocol-v2" that would be better, or you could put the 2 into the
value (e.g. protocol = 2) and check via that instead (a bit more future
proof perhaps?).

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 07:53:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 07:53:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TdywC-0003sM-NM; Thu, 29 Nov 2012 07:53:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TdywB-0003sB-6r
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 07:53:35 +0000
Received: from [85.158.139.211:64303] by server-1.bemta-5.messagelabs.com id
	2F/EE-09311-E7417B05; Thu, 29 Nov 2012 07:53:34 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1354175613!18329141!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUwNDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19365 invoked from network); 29 Nov 2012 07:53:33 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 07:53:33 -0000
X-IronPort-AV: E=Sophos;i="4.84,182,1355097600"; d="scan'208";a="16061241"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 07:53:32 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 07:53:32 +0000
Message-ID: <1354175611.6039.22.camel@dagon.hellion.org.uk>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Thu, 29 Nov 2012 07:53:31 +0000
In-Reply-To: <50B68EC3.1070803@jhuapl.edu>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
	<1353668646.13542.228.camel@zakaz.uk.xensource.com>
	<20121128204630.GB3479@phenom.dumpdata.com>
	<50B68EC3.1070803@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 22:22 +0000, Matthew Fioravante wrote:
> On 11/28/2012 03:46 PM, Konrad Rzeszutek Wilk wrote:

> > We could cop out and just name this new driver differently. Then
> > we would not have to deal with the older ones.
> I've already done that with my patch on the linux mailing list. The old 
> frontend driver name was tpm_xenu.ko, the new one is xen-tpmfront.ko.

The name of the driver module isn't really relevant here, what matters
is the name component of the xenstore paths used to trigger the creation
the front and back devices, if they end up loading mutually
incomprehensible versions of front and back then I expect that the
failure case will be pretty hard to diagnose.

The code I'm talking about is a handful of lines in both front and back,
with $OTHEREND substituted as appropriate:

	err = xenbus_printf(xbt, dev->nodename, "feature-protocol-v2", "1");
        if (err) {
                message = "writing feature-protocol-v2";
                goto abort_transaction;
        }
	...
        if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-protocol-v2", "%d", &val) < 0) {
		printk(KERN_WARN "Warning: $OTHEREND does not appear to support feature-protocol-v2\n");
		printk(KERN_WARN "Perhaps it is running the obsolete out of tree vtpm driver?\n");
		return -EFOOBAR;
	}

Tweak the actual wording to taste.

If there is a better/more descriptive name for the new protocol than
"protocol-v2" that would be better, or you could put the 2 into the
value (e.g. protocol = 2) and check via that instead (a bit more future
proof perhaps?).

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 08:00:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 08:00:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdz2L-0004AP-6E; Thu, 29 Nov 2012 07:59:57 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tdz2K-0004AE-EM
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 07:59:56 +0000
Received: from [193.109.254.147:36848] by server-4.bemta-14.messagelabs.com id
	D8/FF-18856-BF517B05; Thu, 29 Nov 2012 07:59:55 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1354175983!8732197!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30963 invoked from network); 29 Nov 2012 07:59:43 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 07:59:43 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 29 Nov 2012 07:59:43 +0000
Message-Id: <50B7243602000078000AC61A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 29 Nov 2012 08:00:38 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>
References: <50B498E502000078000AB8B3@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403398F24@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A4834564403398F24@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] ATS and dependent features
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 29.11.12 at 02:07, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
> ATS should be a host feature controlled by iommu, and I don't think dom0 can 
> control  it from Xen's architecture.

"Can" or "should"? Because from all I can tell it currently clearly
does.

>   Perhaps we need to forbid dom0 controlling these features. 

That's what I was trying to find out. How to properly do that
with pv-ops I don't know; in our forward ported kernels I can
simply make the respective config options conditional upon !XEN.

Jan

>> From: Jan Beulich [mailto:JBeulich@suse.com]
>> while investigating an issue with some device not working under Xen without
>> "ats=off", I started wondering whether it is correct to allow the Dom0 
> kernel
>> concurrent control over ATS, PRI, and PASID - it would seem to me that with
>> Xen controlling the IOMMU, it should also have exclusive control over the
>> enabling of those features.
>> 
>> Thanks for any comments in this regard,
>> Jan




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 08:00:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 08:00:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdz2L-0004AP-6E; Thu, 29 Nov 2012 07:59:57 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tdz2K-0004AE-EM
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 07:59:56 +0000
Received: from [193.109.254.147:36848] by server-4.bemta-14.messagelabs.com id
	D8/FF-18856-BF517B05; Thu, 29 Nov 2012 07:59:55 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1354175983!8732197!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30963 invoked from network); 29 Nov 2012 07:59:43 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 07:59:43 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 29 Nov 2012 07:59:43 +0000
Message-Id: <50B7243602000078000AC61A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 29 Nov 2012 08:00:38 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>
References: <50B498E502000078000AB8B3@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403398F24@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A4834564403398F24@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] ATS and dependent features
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 29.11.12 at 02:07, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
> ATS should be a host feature controlled by iommu, and I don't think dom0 can 
> control  it from Xen's architecture.

"Can" or "should"? Because from all I can tell it currently clearly
does.

>   Perhaps we need to forbid dom0 controlling these features. 

That's what I was trying to find out. How to properly do that
with pv-ops I don't know; in our forward ported kernels I can
simply make the respective config options conditional upon !XEN.

Jan

>> From: Jan Beulich [mailto:JBeulich@suse.com]
>> while investigating an issue with some device not working under Xen without
>> "ats=off", I started wondering whether it is correct to allow the Dom0 
> kernel
>> concurrent control over ATS, PRI, and PASID - it would seem to me that with
>> Xen controlling the IOMMU, it should also have exclusive control over the
>> enabling of those features.
>> 
>> Thanks for any comments in this regard,
>> Jan




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 08:07:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 08:07:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdz9I-00054p-3Y; Thu, 29 Nov 2012 08:07:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tdz9G-00054f-Sk
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 08:07:07 +0000
Received: from [85.158.139.211:31894] by server-10.bemta-5.messagelabs.com id
	C8/7D-09257-9A717B05; Thu, 29 Nov 2012 08:07:05 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1354176424!18294100!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5660 invoked from network); 29 Nov 2012 08:07:05 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 08:07:05 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 29 Nov 2012 08:07:04 +0000
Message-Id: <50B725ED02000078000AC624@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 29 Nov 2012 08:07:56 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <cd59ddd0-be45-47e3-b762-a5d630c2df43@default>
	<50B6479902000078000AC3EB@nat28.tlf.novell.com>
	<f931a25e-21d0-491f-9a7d-3f8d300386fa@default>
In-Reply-To: <f931a25e-21d0-491f-9a7d-3f8d300386fa@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	AndresLagar-Cavilla <andreslc@gridcentric.ca>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [PATCH v8 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 28.11.12 at 19:05, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  From: Jan Beulich [mailto:JBeulich@suse.com]
>> Perhaps then even invert the if()
>> condition and have just a single return point.
> 
> Rather than invert the if(), unless you prefer the extra
> level of indentation, I'd prefer:
> 
> +    d->tot_pages += pages;
> +    if ( !d->unclaimed_pages )
> +        goto out;
>    <snip>
> +out:
> +    return d->tot_pages;
> 
> Would that be acceptable?

Acceptable as per the coding guidelines - yes. But I personally
dislike goto-s (and would hence prefer the extra level of
indentation, considering that this is a strait code block with no
deep nesting of inner scopes).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 08:07:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 08:07:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Tdz9I-00054p-3Y; Thu, 29 Nov 2012 08:07:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Tdz9G-00054f-Sk
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 08:07:07 +0000
Received: from [85.158.139.211:31894] by server-10.bemta-5.messagelabs.com id
	C8/7D-09257-9A717B05; Thu, 29 Nov 2012 08:07:05 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1354176424!18294100!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5660 invoked from network); 29 Nov 2012 08:07:05 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 08:07:05 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 29 Nov 2012 08:07:04 +0000
Message-Id: <50B725ED02000078000AC624@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 29 Nov 2012 08:07:56 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dan Magenheimer" <dan.magenheimer@oracle.com>
References: <cd59ddd0-be45-47e3-b762-a5d630c2df43@default>
	<50B6479902000078000AC3EB@nat28.tlf.novell.com>
	<f931a25e-21d0-491f-9a7d-3f8d300386fa@default>
In-Reply-To: <f931a25e-21d0-491f-9a7d-3f8d300386fa@default>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	AndresLagar-Cavilla <andreslc@gridcentric.ca>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [PATCH v8 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 28.11.12 at 19:05, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>  From: Jan Beulich [mailto:JBeulich@suse.com]
>> Perhaps then even invert the if()
>> condition and have just a single return point.
> 
> Rather than invert the if(), unless you prefer the extra
> level of indentation, I'd prefer:
> 
> +    d->tot_pages += pages;
> +    if ( !d->unclaimed_pages )
> +        goto out;
>    <snip>
> +out:
> +    return d->tot_pages;
> 
> Would that be acceptable?

Acceptable as per the coding guidelines - yes. But I personally
dislike goto-s (and would hence prefer the extra level of
indentation, considering that this is a strait code block with no
deep nesting of inner scopes).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 09:07:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 09:07:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te05C-0005oq-27; Thu, 29 Nov 2012 09:06:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Aurelien.MILLIAT@clarte.asso.fr>) id 1Te05A-0005ol-SN
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 09:06:57 +0000
Received: from [85.158.137.99:32894] by server-1.bemta-3.messagelabs.com id
	C6/76-12169-FA527B05; Thu, 29 Nov 2012 09:06:55 +0000
X-Env-Sender: Aurelien.MILLIAT@clarte.asso.fr
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354180013!13973140!1
X-Originating-IP: [194.3.193.29]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16992 invoked from network); 29 Nov 2012 09:06:54 -0000
Received: from ns3.ingenierium.com (HELO Dulac.clarte.asso.fr) (194.3.193.29)
	by server-9.tower-217.messagelabs.com with AES128-SHA encrypted SMTP;
	29 Nov 2012 09:06:54 -0000
Received: from dulac.ingenierium.com ([192.168.59.1]) by dulac
	([192.168.59.1]) with mapi id 14.01.0289.001;
	Thu, 29 Nov 2012 10:06:52 +0100
From: =?iso-8859-1?Q?Aur=E9lien_MILLIAT?= <Aurelien.MILLIAT@clarte.asso.fr>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Thread-Topic: [Xen-devel] ATI VGA passthrough and S400 Synchronization module 
Thread-Index: Ac3ODWWnaiHGMWvYQzSXYoKHCnaVCQ==
Date: Thu, 29 Nov 2012 09:06:51 +0000
Message-ID: <36774CA35642C143BCDE93BA0C68DC5702C299D2@dulac>
Accept-Language: fr-FR, en-US
Content-Language: fr-FR
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [192.168.54.111]
x-avast-antispam: clean, score=0
x-original-content-type: application/ms-tnef
MIME-Version: 1.0
Subject: Re: [Xen-devel] ATI VGA passthrough and S400 Synchronization module
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>On Wed, Aug 22, 2012 at 04:23:02PM +0000, Aur=E9lien MILLIAT wrote:
>>> On Tue, Jul 24, 2012 at 04:05:20PM +0000, Aur=E9lien MILLIAT wrote:
>>> > Hi,
>>> > =

>>> > I'm currently trying to use XEN on graphical cluster.
>>> > VGA passtrough works fine and I'm able to use quad-buffer for active =
stereo.
>>> > The last thing to do is to synchronize all GPU from the cluster. =

>>> > For this purpose I use ATI FirePro S400 and it didn't works.
>>> > =

>>> > I've seen two behaviors:
>>> > -When I run lspci command on Dom0 I've got:
>>> > 0f:00.0 VGA compatible controller: ATI Technologies Inc Device 6888
>>> > 0f:00.1 Audio device: ATI Technologies Inc Cypress HDMI Audio =

>>> > [Radeon HD 5800 Series] And sometimes just
>>> > 0f:00.0 VGA compatible controller: ATI Technologies Inc Device 6888 =

>>> > -When a DomU(Windows 7) is running, it's very slow (I can't do anythi=
ng) and crash after several minutes.
>>> > I've tried with the unstable version and I've seen the same 'lspci' b=
ehavior.
>>> > =

>>> > I've a couple of questions:
>>> > Is it possible to passthrough a VGA with this extension?
>>> =

>>> I never tried. I just pass in the VGA card and don't try to pass in the=
 HDMI driver.
>>> =

>>> > As it's a particular use of VGA passtrough is it planned to able to u=
se synchronization module?
>>> =

>>> So what is synchronization module for you? That is the HDMI part?
>>> =

>>> > Is it easy to add this feature (time cost)?
>>> > =

>>> > Computers : HP Z800 workstation
>>> > GPU: ATI FirePro V8800
>>> > CPU: Intel Xeon E5640
>>> > MB: Intel 5520 chipset
>>> > =

>>> > XEN :
>>> > Version  4.1.2
>>> > With ATI patch from
>>> > http://old-list-archives.xen.org/archives/html/xen-users/2011-05/msg
>>> > 00048.html
>>> > Thanks,
>>> > Aur=E9lien Milliat
>> >> =

>>> Hi,
>>> =

>>> I've been able to use ATI FirePro S400 with the unstable version. I've =
updated my Dom0 and pass the graphic card as secondary adaptor.
>>>
>>>
>>>Please do not top post.
>>Sorry !
>>>
>>> What did you upgrade dom0 to?
>>>
>>
>>I've update Debian 6.0.4 to 6.0.5, update all packages and remove everyth=
ing I've made from my previous test. =

>>
>>I've continue my tests and I've got an issue with active stereo. Previous=
ly, I've got tested active stereo with the stable release.  =

>>
>>On unstable version, only the right eye is render (OGLplane and Virtools =
demos).
>>Quad buffer is on, everything seems to be setup as usual for active stere=
o. =

>>I've tried with and without the S400 card.
>>
>>I will try to gather more informations about this.
>>
>>>
>>> I've made a quick test for Xen 4.1.2 with these updates but it's still =
crash (no matter I will use the unstable version).
>>>
>>> Aur=E9lien
>>> =

>Hi,
>
>I've got the time to run some test to find what's going on with the active=
 stereo with the following configuration:
>
>release                : 2.6.32-5-xen-amd64
>version                : #1 SMP Sun May 6 08:57:29 UTC 2012
>machine                : x86_64
>nr_cpus                : 8
>nr_nodes               : 1
>cores_per_socket       : 4
>threads_per_core       : 2
>cpu_mhz                : 2660
>hw_caps                : bfebfbff:2c100800:00000000:00003f40:029ee3ff:0000=
0000:00000001:00000000
>virt_caps              : hvm hvm_directio
>total_memory           : 4079
>free_cpus              : 0
>xen_major              : 4
>xen_minor              : 2
>xen_extra              : -unstable
>xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm=
-3.0-x86_32p hvm-3.0-x86_64 =

>xen_scheduler          : credit
>xen_pagesize           : 4096
>platform_params        : virt_start=3D0xffff800000000000
>xen_changeset          : Sun Jul 22 16:37:25 2012 +0100 25622:3c426da4788e
>xen_commandline        : placeholder
>cc_compiler            : gcc version 4.4.5 (Debian 4.4.5-8) =

>xend_config_format     : 4

>I've tested with:
>-XP SP2 and SP3 32bits (Pro): =

>	+ Driver (version: 2012.07.11): active stereo (quadbuffer) enable, S400 f=
ound.
>	+ OGLplane: Impossible to run active stereo mode: "OpenGL stereo not supp=
orted".
>
>-Windows 7 32 bits (Pro):
>	+ Driver (version: 2012.07.11): active stereo enable, S400 found.
>	+ OGLplane: run without sync signal and render only one eye.
>
>-Windows 8 64bits (debug checked build):
>	+ Driver (version: 2012.07.11): active stereo enable, S400 found.
>	+ OGLplane: active stereo seems to be ok.
>
>I will run some tests with the same configuration:
>-Windows 7 64 bits (Pro)
>-Windows 8 64bits (Final)
>-Windows 8 32bits (Final)

Finally it's done!
I'm able to run VMs with all functionality needed for VR context:
-Quadbuffer
-Genlock
-Swaplock

I've tried in a CAVE system (http://en.wikipedia.org/wiki/Cave_automatic_vi=
rtual_environment) and it's perfect!
- Windows 7 is ok.
- Windows 8 seems to be driver issue.

I've started to compare some behaviors with native installation, at this po=
int all those behaviors comes from drivers.
I will try to make it work with XP.

I think we will see XEN be used in lot of Virtual Reality / Augmented Reali=
ty labs!

>I've made a quick test on Xen 4.2.0-rc2 with a compiled kernel from:
>http://wiki.xen.org/wiki/Mainline_Linux_Kernel_Configs
>Windows 7 has the same behavior and I haven't tried other OS.
>
>Does anyone have run tests for active stereo with VGA passthrough?
>
>Thanks,
>Aur=E9lien
>>> > _______________________________________________
>> > Xen-devel mailing list
>> > Xen-devel@lists.xen.org
>> > http://lists.xen.org/xen-devel
>> =

>> =

>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 09:07:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 09:07:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te05C-0005oq-27; Thu, 29 Nov 2012 09:06:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Aurelien.MILLIAT@clarte.asso.fr>) id 1Te05A-0005ol-SN
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 09:06:57 +0000
Received: from [85.158.137.99:32894] by server-1.bemta-3.messagelabs.com id
	C6/76-12169-FA527B05; Thu, 29 Nov 2012 09:06:55 +0000
X-Env-Sender: Aurelien.MILLIAT@clarte.asso.fr
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354180013!13973140!1
X-Originating-IP: [194.3.193.29]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16992 invoked from network); 29 Nov 2012 09:06:54 -0000
Received: from ns3.ingenierium.com (HELO Dulac.clarte.asso.fr) (194.3.193.29)
	by server-9.tower-217.messagelabs.com with AES128-SHA encrypted SMTP;
	29 Nov 2012 09:06:54 -0000
Received: from dulac.ingenierium.com ([192.168.59.1]) by dulac
	([192.168.59.1]) with mapi id 14.01.0289.001;
	Thu, 29 Nov 2012 10:06:52 +0100
From: =?iso-8859-1?Q?Aur=E9lien_MILLIAT?= <Aurelien.MILLIAT@clarte.asso.fr>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Thread-Topic: [Xen-devel] ATI VGA passthrough and S400 Synchronization module 
Thread-Index: Ac3ODWWnaiHGMWvYQzSXYoKHCnaVCQ==
Date: Thu, 29 Nov 2012 09:06:51 +0000
Message-ID: <36774CA35642C143BCDE93BA0C68DC5702C299D2@dulac>
Accept-Language: fr-FR, en-US
Content-Language: fr-FR
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [192.168.54.111]
x-avast-antispam: clean, score=0
x-original-content-type: application/ms-tnef
MIME-Version: 1.0
Subject: Re: [Xen-devel] ATI VGA passthrough and S400 Synchronization module
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>On Wed, Aug 22, 2012 at 04:23:02PM +0000, Aur=E9lien MILLIAT wrote:
>>> On Tue, Jul 24, 2012 at 04:05:20PM +0000, Aur=E9lien MILLIAT wrote:
>>> > Hi,
>>> > =

>>> > I'm currently trying to use XEN on graphical cluster.
>>> > VGA passtrough works fine and I'm able to use quad-buffer for active =
stereo.
>>> > The last thing to do is to synchronize all GPU from the cluster. =

>>> > For this purpose I use ATI FirePro S400 and it didn't works.
>>> > =

>>> > I've seen two behaviors:
>>> > -When I run lspci command on Dom0 I've got:
>>> > 0f:00.0 VGA compatible controller: ATI Technologies Inc Device 6888
>>> > 0f:00.1 Audio device: ATI Technologies Inc Cypress HDMI Audio =

>>> > [Radeon HD 5800 Series] And sometimes just
>>> > 0f:00.0 VGA compatible controller: ATI Technologies Inc Device 6888 =

>>> > -When a DomU(Windows 7) is running, it's very slow (I can't do anythi=
ng) and crash after several minutes.
>>> > I've tried with the unstable version and I've seen the same 'lspci' b=
ehavior.
>>> > =

>>> > I've a couple of questions:
>>> > Is it possible to passthrough a VGA with this extension?
>>> =

>>> I never tried. I just pass in the VGA card and don't try to pass in the=
 HDMI driver.
>>> =

>>> > As it's a particular use of VGA passtrough is it planned to able to u=
se synchronization module?
>>> =

>>> So what is synchronization module for you? That is the HDMI part?
>>> =

>>> > Is it easy to add this feature (time cost)?
>>> > =

>>> > Computers : HP Z800 workstation
>>> > GPU: ATI FirePro V8800
>>> > CPU: Intel Xeon E5640
>>> > MB: Intel 5520 chipset
>>> > =

>>> > XEN :
>>> > Version  4.1.2
>>> > With ATI patch from
>>> > http://old-list-archives.xen.org/archives/html/xen-users/2011-05/msg
>>> > 00048.html
>>> > Thanks,
>>> > Aur=E9lien Milliat
>> >> =

>>> Hi,
>>> =

>>> I've been able to use ATI FirePro S400 with the unstable version. I've =
updated my Dom0 and pass the graphic card as secondary adaptor.
>>>
>>>
>>>Please do not top post.
>>Sorry !
>>>
>>> What did you upgrade dom0 to?
>>>
>>
>>I've update Debian 6.0.4 to 6.0.5, update all packages and remove everyth=
ing I've made from my previous test. =

>>
>>I've continue my tests and I've got an issue with active stereo. Previous=
ly, I've got tested active stereo with the stable release.  =

>>
>>On unstable version, only the right eye is render (OGLplane and Virtools =
demos).
>>Quad buffer is on, everything seems to be setup as usual for active stere=
o. =

>>I've tried with and without the S400 card.
>>
>>I will try to gather more informations about this.
>>
>>>
>>> I've made a quick test for Xen 4.1.2 with these updates but it's still =
crash (no matter I will use the unstable version).
>>>
>>> Aur=E9lien
>>> =

>Hi,
>
>I've got the time to run some test to find what's going on with the active=
 stereo with the following configuration:
>
>release                : 2.6.32-5-xen-amd64
>version                : #1 SMP Sun May 6 08:57:29 UTC 2012
>machine                : x86_64
>nr_cpus                : 8
>nr_nodes               : 1
>cores_per_socket       : 4
>threads_per_core       : 2
>cpu_mhz                : 2660
>hw_caps                : bfebfbff:2c100800:00000000:00003f40:029ee3ff:0000=
0000:00000001:00000000
>virt_caps              : hvm hvm_directio
>total_memory           : 4079
>free_cpus              : 0
>xen_major              : 4
>xen_minor              : 2
>xen_extra              : -unstable
>xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm=
-3.0-x86_32p hvm-3.0-x86_64 =

>xen_scheduler          : credit
>xen_pagesize           : 4096
>platform_params        : virt_start=3D0xffff800000000000
>xen_changeset          : Sun Jul 22 16:37:25 2012 +0100 25622:3c426da4788e
>xen_commandline        : placeholder
>cc_compiler            : gcc version 4.4.5 (Debian 4.4.5-8) =

>xend_config_format     : 4

>I've tested with:
>-XP SP2 and SP3 32bits (Pro): =

>	+ Driver (version: 2012.07.11): active stereo (quadbuffer) enable, S400 f=
ound.
>	+ OGLplane: Impossible to run active stereo mode: "OpenGL stereo not supp=
orted".
>
>-Windows 7 32 bits (Pro):
>	+ Driver (version: 2012.07.11): active stereo enable, S400 found.
>	+ OGLplane: run without sync signal and render only one eye.
>
>-Windows 8 64bits (debug checked build):
>	+ Driver (version: 2012.07.11): active stereo enable, S400 found.
>	+ OGLplane: active stereo seems to be ok.
>
>I will run some tests with the same configuration:
>-Windows 7 64 bits (Pro)
>-Windows 8 64bits (Final)
>-Windows 8 32bits (Final)

Finally it's done!
I'm able to run VMs with all functionality needed for VR context:
-Quadbuffer
-Genlock
-Swaplock

I've tried in a CAVE system (http://en.wikipedia.org/wiki/Cave_automatic_vi=
rtual_environment) and it's perfect!
- Windows 7 is ok.
- Windows 8 seems to be driver issue.

I've started to compare some behaviors with native installation, at this po=
int all those behaviors comes from drivers.
I will try to make it work with XP.

I think we will see XEN be used in lot of Virtual Reality / Augmented Reali=
ty labs!

>I've made a quick test on Xen 4.2.0-rc2 with a compiled kernel from:
>http://wiki.xen.org/wiki/Mainline_Linux_Kernel_Configs
>Windows 7 has the same behavior and I haven't tried other OS.
>
>Does anyone have run tests for active stereo with VGA passthrough?
>
>Thanks,
>Aur=E9lien
>>> > _______________________________________________
>> > Xen-devel mailing list
>> > Xen-devel@lists.xen.org
>> > http://lists.xen.org/xen-devel
>> =

>> =

>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 09:20:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 09:20:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te0He-00060k-KZ; Thu, 29 Nov 2012 09:19:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1Te0Hd-00060f-Bf
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 09:19:49 +0000
Received: from [85.158.138.51:60366] by server-13.bemta-3.messagelabs.com id
	6E/10-24887-4B827B05; Thu, 29 Nov 2012 09:19:48 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1354180787!12238340!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjM0NDc0\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1406 invoked from network); 29 Nov 2012 09:19:47 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-13.tower-174.messagelabs.com with SMTP;
	29 Nov 2012 09:19:47 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga101.ch.intel.com with ESMTP; 29 Nov 2012 01:19:45 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,182,1355126400"; d="scan'208";a="173895962"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by AZSMGA002.ch.intel.com with ESMTP; 29 Nov 2012 01:19:45 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 29 Nov 2012 01:19:44 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Thu, 29 Nov 2012 17:19:43 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>
Thread-Topic: ATS and dependent features
Thread-Index: AQHNzINiSOuk8WhZTUOv61PMlYmAhZgAAhig///uAQCAAJGFcA==
Date: Thu, 29 Nov 2012 09:19:43 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A48345644033994C8@SHSMSX101.ccr.corp.intel.com>
References: <50B498E502000078000AB8B3@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403398F24@SHSMSX101.ccr.corp.intel.com>
	<50B7243602000078000AC61A@nat28.tlf.novell.com>
In-Reply-To: <50B7243602000078000AC61A@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Zhang, Xiantao" <xiantao.zhang@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] ATS and dependent features
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Thursday, November 29, 2012 4:01 PM
> To: Zhang, Xiantao
> Cc: xen-devel
> Subject: RE: ATS and dependent features
> 
> >>> On 29.11.12 at 02:07, "Zhang, Xiantao" <xiantao.zhang@intel.com>
> wrote:
> > ATS should be a host feature controlled by iommu, and I don't think
> > dom0 can control  it from Xen's architecture.
> 
> "Can" or "should"? Because from all I can tell it currently clearly does.

I mean Xen shouldn't  allow these capabilities can be detected by dom0.  If it does, we need to fix it. 

> >   Perhaps we need to forbid dom0 controlling these features.
> 
> That's what I was trying to find out. How to properly do that with pv-ops I
> don't know; in our forward ported kernels I can simply make the respective
> config options conditional upon !XEN. 

As to the clean solution, Xen should intercept all the accesses to the device's PCI config space from dom0, and emulates the related registers.  In your simple solution, it maybe break the kernel running with these features on native hardware.  If adopts pv_ops method to solve such corner issues, it may be not acceptable by upstream kernel.   
Xiantao  

> >> From: Jan Beulich [mailto:JBeulich@suse.com] while investigating an
> >> issue with some device not working under Xen without "ats=off", I
> >> started wondering whether it is correct to allow the Dom0
> > kernel
> >> concurrent control over ATS, PRI, and PASID - it would seem to me
> >> that with Xen controlling the IOMMU, it should also have exclusive
> >> control over the enabling of those features.
> >>
> >> Thanks for any comments in this regard, Jan
> 
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 09:20:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 09:20:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te0He-00060k-KZ; Thu, 29 Nov 2012 09:19:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1Te0Hd-00060f-Bf
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 09:19:49 +0000
Received: from [85.158.138.51:60366] by server-13.bemta-3.messagelabs.com id
	6E/10-24887-4B827B05; Thu, 29 Nov 2012 09:19:48 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1354180787!12238340!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjM0NDc0\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1406 invoked from network); 29 Nov 2012 09:19:47 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-13.tower-174.messagelabs.com with SMTP;
	29 Nov 2012 09:19:47 -0000
Received: from azsmga002.ch.intel.com ([10.2.17.35])
	by azsmga101.ch.intel.com with ESMTP; 29 Nov 2012 01:19:45 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,182,1355126400"; d="scan'208";a="173895962"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by AZSMGA002.ch.intel.com with ESMTP; 29 Nov 2012 01:19:45 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 29 Nov 2012 01:19:44 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Thu, 29 Nov 2012 17:19:43 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>
Thread-Topic: ATS and dependent features
Thread-Index: AQHNzINiSOuk8WhZTUOv61PMlYmAhZgAAhig///uAQCAAJGFcA==
Date: Thu, 29 Nov 2012 09:19:43 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A48345644033994C8@SHSMSX101.ccr.corp.intel.com>
References: <50B498E502000078000AB8B3@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403398F24@SHSMSX101.ccr.corp.intel.com>
	<50B7243602000078000AC61A@nat28.tlf.novell.com>
In-Reply-To: <50B7243602000078000AC61A@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Zhang, Xiantao" <xiantao.zhang@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] ATS and dependent features
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Thursday, November 29, 2012 4:01 PM
> To: Zhang, Xiantao
> Cc: xen-devel
> Subject: RE: ATS and dependent features
> 
> >>> On 29.11.12 at 02:07, "Zhang, Xiantao" <xiantao.zhang@intel.com>
> wrote:
> > ATS should be a host feature controlled by iommu, and I don't think
> > dom0 can control  it from Xen's architecture.
> 
> "Can" or "should"? Because from all I can tell it currently clearly does.

I mean Xen shouldn't  allow these capabilities can be detected by dom0.  If it does, we need to fix it. 

> >   Perhaps we need to forbid dom0 controlling these features.
> 
> That's what I was trying to find out. How to properly do that with pv-ops I
> don't know; in our forward ported kernels I can simply make the respective
> config options conditional upon !XEN. 

As to the clean solution, Xen should intercept all the accesses to the device's PCI config space from dom0, and emulates the related registers.  In your simple solution, it maybe break the kernel running with these features on native hardware.  If adopts pv_ops method to solve such corner issues, it may be not acceptable by upstream kernel.   
Xiantao  

> >> From: Jan Beulich [mailto:JBeulich@suse.com] while investigating an
> >> issue with some device not working under Xen without "ats=off", I
> >> started wondering whether it is correct to allow the Dom0
> > kernel
> >> concurrent control over ATS, PRI, and PASID - it would seem to me
> >> that with Xen controlling the IOMMU, it should also have exclusive
> >> control over the enabling of those features.
> >>
> >> Thanks for any comments in this regard, Jan
> 
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 09:24:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 09:24:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te0LT-0006Ak-E5; Thu, 29 Nov 2012 09:23:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg.zapp@gmail.com>) id 1Te0LR-0006Ad-4N
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 09:23:45 +0000
Received: from [85.158.139.83:36554] by server-1.bemta-5.messagelabs.com id
	C2/34-09311-0A927B05; Thu, 29 Nov 2012 09:23:44 +0000
X-Env-Sender: greg.zapp@gmail.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1354181021!23320786!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=1.5 required=7.0 tests=HTML_00_10,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9711 invoked from network); 29 Nov 2012 09:23:42 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 09:23:42 -0000
Received: by mail-ie0-f173.google.com with SMTP id e13so13717044iej.32
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 01:23:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=wq9uxZEs58obfzY+y2qLt/a+N2p509tDFexXag7cEWQ=;
	b=n5rhLkybXBVxc2o5n+k3BKo2tCTnZLgueWBpnhzceNK1BGTfBSNgyjfYNJM1oPMB/I
	fYV8cJRTCx+Htl8oqwRv4gKWj7wu9HRDIfYToImlxorLMpB3Fn+DVtZ7w9SmCQcFZXnz
	/sKjOBYcgBoMmypYRXF42Vi5U6cJ+sLLhAeXzKqVuXc/IOoatb3ai8h9Xcuj+Lt0IRWd
	sQYpGGY9iQirO0shjHrK5ggBmaYrlQH2aO1zVHnPW+yQHIcQ4x82H7dfWUeecqj8KoC7
	O5x6XtzOqHsU7VxDb4aEj9qqG+rB5T095Zd5hW+d/OjP3v6wuIyEuST6gy6AdsBtse8v
	+U6w==
MIME-Version: 1.0
Received: by 10.50.34.200 with SMTP id b8mr21907308igj.52.1354181020735; Thu,
	29 Nov 2012 01:23:40 -0800 (PST)
Received: by 10.64.23.232 with HTTP; Thu, 29 Nov 2012 01:23:40 -0800 (PST)
Date: Thu, 29 Nov 2012 22:23:40 +1300
Message-ID: <CAEHxbC20kNytnq3sTM0gmhoJ7xBGFD1AK4dywY_6cGrwO144JA@mail.gmail.com>
From: Greg Zapp <greg.zapp@gmail.com>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] Windows NLB crashing VM's
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4675918309930620394=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4675918309930620394==
Content-Type: multipart/alternative; boundary=14dae93409a3b3d8a604cf9ed67e

--14dae93409a3b3d8a604cf9ed67e
Content-Type: text/plain; charset=ISO-8859-1

Hi All,

We have a somewhat serious issue around NLB on Windows 2012 and Xen.
First, let me describe our environment and then I'll let you know what's
wrong.

2 X Debian-squeeze boxes running the latest provided AMD64 Xen kernel and
about 100GB of RAM.
These boxes are connected via infiniband and DRBD is running over
this(IPoIB).
Each VPS runs on a mirrored DRBD devices.
Each DRBD device sits on 2 logical volumes.  One for data and one for
metadata.
The hypervisors exclusively run Windows VM's(Server 2008 R2 and 2012).
The VM's are utilizing the GPLPV drivers(PCI,VBD,Net,etc).
We are using network-bridge.

So here is the trouble.  We had somebody trying to setup Windows NLB.  When
adding a host it would cause the VM to freeze but also disconnect the DRBD
devices.  Everything recovers but the DRBD devices resync and a bunch of
VM's on the one side(the side with the VM that hangs up) get rebooted by
Xen.  Here is what we are seeing in messages:

eth0: port 3(nlb2.e0) entering disabled state
eth0: port 3(nlb2.e0) entering disabled state
frontend_changed: backend/vif/65/0: prepare for reconnect
device nlb.e0 entered promiscuous mode
block drbd29: sock was shut down by peer
block drbd29: peer( Secondary -> Unknown ) conn( Connected -> BrokenPipe )
pdsk( UpToDate -> DUnknown )
block drbd24: sock was shut down by peer
block drbd24: peer( Primary -> Unknown ) conn( Connected -> BrokenPipe )
pdsk( UpToDate -> DUnknown )
block drbd29: Creating new current UUID
block drbd30: sock was shut down by peer
block drbd30: peer( Primary -> Unknown ) conn( Connected -> BrokenPipe )
pdsk( UpToDate -> DUnknown )
.... and on and on and on with the DRBD disconnecting
block drbd29: md_sync_timer expired! Worker calls drbd_md_sync().
block drbd21: md_sync_timer expired! Worker calls drbd_md_sync().
.... lots of that
block drbd24: Terminating drbd24_asender
block drbd21: asender terminated
block drbd21: Terminating drbd21_asender
....
eth0: port 3(nlb2.e0) entering forwarding state
....
block drbd1: Handshake successful: Agreed network protocol version 91
block drbd1: conn( WFConnection -> WFReportParams )
block drbd38: Handshake successful: Agreed network protocol version 91
block drbd38: conn( WFConnection -> WFReportParams )
block drbd38: Starting asender thread (from drbd38_receiver [16250])
block drbd1: Starting asender thread (from drbd1_receiver [18278])
... Then lots of stuff for the DRBD devices reconnecting and syncing.


This happened three times, each time the user was attempting to add the
second node into NLB.  I can reproduce the network adapter dying(Becomes
disabled and is unusable until reboot) in the lab on Server 2012 unless I
follow specific steps, but not the DRBD dying.  I can get NLB working but
I'm mostly concerned about one persons ability to effectively crash 8 other
VM's.  It looks like whatever is going on is somehow effecting my DRBD
connection.  Has anyone seen anything like this before?


Thanks,
   Greg

--14dae93409a3b3d8a604cf9ed67e
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi All,<br><br>We have a somewhat serious issue around NLB on Windows=20
2012 and Xen.=A0 First, let me describe our environment and then I&#39;ll l=
et=20
you know what&#39;s wrong.<br><br>2 X Debian-squeeze boxes running the late=
st provided AMD64 Xen kernel and about 100GB of RAM.<br>
These boxes are connected via infiniband and DRBD is running over this(IPoI=
B).<br>Each VPS runs on a mirrored DRBD devices.<br>Each DRBD device sits o=
n 2 logical volumes.=A0 One for data and one for metadata.<br>The hyperviso=
rs exclusively run Windows VM&#39;s(Server 2008 R2 and 2012).<br>

The VM&#39;s are utilizing the GPLPV drivers(PCI,VBD,Net,etc).<br>We are us=
ing network-bridge.<br><br>So
 here is the trouble.=A0 We had somebody trying to setup Windows NLB.=A0=20
When adding a host it would cause the VM to freeze but also disconnect=20
the DRBD devices.=A0 Everything recovers but the DRBD devices resync and a
 bunch of VM&#39;s on the one side(the side with the VM that hangs up) get=
=20
rebooted by Xen.=A0 Here is what we are seeing in messages:<br>
<br>eth0: port 3(nlb2.e0) entering disabled state<br>eth0: port 3(nlb2.e0) =
entering disabled state<br>frontend_changed: backend/vif/65/0: prepare for =
reconnect<br>device nlb.e0 entered promiscuous mode<br>block drbd29: sock w=
as shut down by peer<br>

block drbd29: peer( Secondary -&gt; Unknown ) conn( Connected -&gt; BrokenP=
ipe ) pdsk( UpToDate -&gt; DUnknown ) <br>block drbd24: sock was shut down =
by peer<br>block drbd24: peer( Primary -&gt; Unknown ) conn( Connected -&gt=
; BrokenPipe ) pdsk( UpToDate -&gt; DUnknown ) <br>

block drbd29: Creating new current UUID<br>block drbd30: sock was shut down=
 by peer<br>block drbd30: peer( Primary -&gt; Unknown ) conn( Connected -&g=
t; BrokenPipe ) pdsk( UpToDate -&gt; DUnknown )<br>.... and on and on and o=
n with the DRBD disconnecting<br>

block drbd29: md_sync_timer expired! Worker calls drbd_md_sync().<br>block =
drbd21: md_sync_timer expired! Worker calls drbd_md_sync().<br>.... lots of=
 that<br>block drbd24: Terminating drbd24_asender<br>block drbd21: asender =
terminated<br>

block drbd21: Terminating drbd21_asender<br>....<br>eth0: port 3(nlb2.e0) e=
ntering forwarding state<br>....<br>block drbd1: Handshake successful: Agre=
ed network protocol version 91<br>block drbd1: conn( WFConnection -&gt; WFR=
eportParams ) <br>

block drbd38: Handshake successful: Agreed network protocol version 91<br>b=
lock drbd38: conn( WFConnection -&gt; WFReportParams ) <br>block drbd38: St=
arting asender thread (from drbd38_receiver [16250])<br>block drbd1: Starti=
ng asender thread (from drbd1_receiver [18278])<br>

... Then lots of stuff for the DRBD devices reconnecting and syncing.<br><b=
r><br>This
 happened three times, each time the user was attempting to add the=20
second node into NLB.=A0 I can reproduce the network adapter dying(Becomes
 disabled and is unusable until reboot) in the lab on Server 2012 unless
 I follow specific steps, but not the DRBD dying.=A0 I can get NLB working
 but I&#39;m mostly concerned about one persons ability to effectively cras=
h
 8 other VM&#39;s.=A0 It looks like whatever is going on is somehow effecti=
ng=20
my DRBD connection.=A0 Has anyone seen anything like this before?<br>
<br><br>Thanks,<br>=A0=A0 Greg

--14dae93409a3b3d8a604cf9ed67e--


--===============4675918309930620394==
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.xen.org
http://lists.xen.org/xen-devel

--===============4675918309930620394==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 09:24:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 09:24:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te0LT-0006Ak-E5; Thu, 29 Nov 2012 09:23:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg.zapp@gmail.com>) id 1Te0LR-0006Ad-4N
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 09:23:45 +0000
Received: from [85.158.139.83:36554] by server-1.bemta-5.messagelabs.com id
	C2/34-09311-0A927B05; Thu, 29 Nov 2012 09:23:44 +0000
X-Env-Sender: greg.zapp@gmail.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1354181021!23320786!1
X-Originating-IP: [209.85.223.173]
X-SpamReason: No, hits=1.5 required=7.0 tests=HTML_00_10,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9711 invoked from network); 29 Nov 2012 09:23:42 -0000
Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com)
	(209.85.223.173)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 09:23:42 -0000
Received: by mail-ie0-f173.google.com with SMTP id e13so13717044iej.32
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 01:23:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=wq9uxZEs58obfzY+y2qLt/a+N2p509tDFexXag7cEWQ=;
	b=n5rhLkybXBVxc2o5n+k3BKo2tCTnZLgueWBpnhzceNK1BGTfBSNgyjfYNJM1oPMB/I
	fYV8cJRTCx+Htl8oqwRv4gKWj7wu9HRDIfYToImlxorLMpB3Fn+DVtZ7w9SmCQcFZXnz
	/sKjOBYcgBoMmypYRXF42Vi5U6cJ+sLLhAeXzKqVuXc/IOoatb3ai8h9Xcuj+Lt0IRWd
	sQYpGGY9iQirO0shjHrK5ggBmaYrlQH2aO1zVHnPW+yQHIcQ4x82H7dfWUeecqj8KoC7
	O5x6XtzOqHsU7VxDb4aEj9qqG+rB5T095Zd5hW+d/OjP3v6wuIyEuST6gy6AdsBtse8v
	+U6w==
MIME-Version: 1.0
Received: by 10.50.34.200 with SMTP id b8mr21907308igj.52.1354181020735; Thu,
	29 Nov 2012 01:23:40 -0800 (PST)
Received: by 10.64.23.232 with HTTP; Thu, 29 Nov 2012 01:23:40 -0800 (PST)
Date: Thu, 29 Nov 2012 22:23:40 +1300
Message-ID: <CAEHxbC20kNytnq3sTM0gmhoJ7xBGFD1AK4dywY_6cGrwO144JA@mail.gmail.com>
From: Greg Zapp <greg.zapp@gmail.com>
To: xen-devel@lists.xen.org
Subject: [Xen-devel] Windows NLB crashing VM's
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4675918309930620394=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4675918309930620394==
Content-Type: multipart/alternative; boundary=14dae93409a3b3d8a604cf9ed67e

--14dae93409a3b3d8a604cf9ed67e
Content-Type: text/plain; charset=ISO-8859-1

Hi All,

We have a somewhat serious issue around NLB on Windows 2012 and Xen.
First, let me describe our environment and then I'll let you know what's
wrong.

2 X Debian-squeeze boxes running the latest provided AMD64 Xen kernel and
about 100GB of RAM.
These boxes are connected via infiniband and DRBD is running over
this(IPoIB).
Each VPS runs on a mirrored DRBD devices.
Each DRBD device sits on 2 logical volumes.  One for data and one for
metadata.
The hypervisors exclusively run Windows VM's(Server 2008 R2 and 2012).
The VM's are utilizing the GPLPV drivers(PCI,VBD,Net,etc).
We are using network-bridge.

So here is the trouble.  We had somebody trying to setup Windows NLB.  When
adding a host it would cause the VM to freeze but also disconnect the DRBD
devices.  Everything recovers but the DRBD devices resync and a bunch of
VM's on the one side(the side with the VM that hangs up) get rebooted by
Xen.  Here is what we are seeing in messages:

eth0: port 3(nlb2.e0) entering disabled state
eth0: port 3(nlb2.e0) entering disabled state
frontend_changed: backend/vif/65/0: prepare for reconnect
device nlb.e0 entered promiscuous mode
block drbd29: sock was shut down by peer
block drbd29: peer( Secondary -> Unknown ) conn( Connected -> BrokenPipe )
pdsk( UpToDate -> DUnknown )
block drbd24: sock was shut down by peer
block drbd24: peer( Primary -> Unknown ) conn( Connected -> BrokenPipe )
pdsk( UpToDate -> DUnknown )
block drbd29: Creating new current UUID
block drbd30: sock was shut down by peer
block drbd30: peer( Primary -> Unknown ) conn( Connected -> BrokenPipe )
pdsk( UpToDate -> DUnknown )
.... and on and on and on with the DRBD disconnecting
block drbd29: md_sync_timer expired! Worker calls drbd_md_sync().
block drbd21: md_sync_timer expired! Worker calls drbd_md_sync().
.... lots of that
block drbd24: Terminating drbd24_asender
block drbd21: asender terminated
block drbd21: Terminating drbd21_asender
....
eth0: port 3(nlb2.e0) entering forwarding state
....
block drbd1: Handshake successful: Agreed network protocol version 91
block drbd1: conn( WFConnection -> WFReportParams )
block drbd38: Handshake successful: Agreed network protocol version 91
block drbd38: conn( WFConnection -> WFReportParams )
block drbd38: Starting asender thread (from drbd38_receiver [16250])
block drbd1: Starting asender thread (from drbd1_receiver [18278])
... Then lots of stuff for the DRBD devices reconnecting and syncing.


This happened three times, each time the user was attempting to add the
second node into NLB.  I can reproduce the network adapter dying(Becomes
disabled and is unusable until reboot) in the lab on Server 2012 unless I
follow specific steps, but not the DRBD dying.  I can get NLB working but
I'm mostly concerned about one persons ability to effectively crash 8 other
VM's.  It looks like whatever is going on is somehow effecting my DRBD
connection.  Has anyone seen anything like this before?


Thanks,
   Greg

--14dae93409a3b3d8a604cf9ed67e
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi All,<br><br>We have a somewhat serious issue around NLB on Windows=20
2012 and Xen.=A0 First, let me describe our environment and then I&#39;ll l=
et=20
you know what&#39;s wrong.<br><br>2 X Debian-squeeze boxes running the late=
st provided AMD64 Xen kernel and about 100GB of RAM.<br>
These boxes are connected via infiniband and DRBD is running over this(IPoI=
B).<br>Each VPS runs on a mirrored DRBD devices.<br>Each DRBD device sits o=
n 2 logical volumes.=A0 One for data and one for metadata.<br>The hyperviso=
rs exclusively run Windows VM&#39;s(Server 2008 R2 and 2012).<br>

The VM&#39;s are utilizing the GPLPV drivers(PCI,VBD,Net,etc).<br>We are us=
ing network-bridge.<br><br>So
 here is the trouble.=A0 We had somebody trying to setup Windows NLB.=A0=20
When adding a host it would cause the VM to freeze but also disconnect=20
the DRBD devices.=A0 Everything recovers but the DRBD devices resync and a
 bunch of VM&#39;s on the one side(the side with the VM that hangs up) get=
=20
rebooted by Xen.=A0 Here is what we are seeing in messages:<br>
<br>eth0: port 3(nlb2.e0) entering disabled state<br>eth0: port 3(nlb2.e0) =
entering disabled state<br>frontend_changed: backend/vif/65/0: prepare for =
reconnect<br>device nlb.e0 entered promiscuous mode<br>block drbd29: sock w=
as shut down by peer<br>

block drbd29: peer( Secondary -&gt; Unknown ) conn( Connected -&gt; BrokenP=
ipe ) pdsk( UpToDate -&gt; DUnknown ) <br>block drbd24: sock was shut down =
by peer<br>block drbd24: peer( Primary -&gt; Unknown ) conn( Connected -&gt=
; BrokenPipe ) pdsk( UpToDate -&gt; DUnknown ) <br>

block drbd29: Creating new current UUID<br>block drbd30: sock was shut down=
 by peer<br>block drbd30: peer( Primary -&gt; Unknown ) conn( Connected -&g=
t; BrokenPipe ) pdsk( UpToDate -&gt; DUnknown )<br>.... and on and on and o=
n with the DRBD disconnecting<br>

block drbd29: md_sync_timer expired! Worker calls drbd_md_sync().<br>block =
drbd21: md_sync_timer expired! Worker calls drbd_md_sync().<br>.... lots of=
 that<br>block drbd24: Terminating drbd24_asender<br>block drbd21: asender =
terminated<br>

block drbd21: Terminating drbd21_asender<br>....<br>eth0: port 3(nlb2.e0) e=
ntering forwarding state<br>....<br>block drbd1: Handshake successful: Agre=
ed network protocol version 91<br>block drbd1: conn( WFConnection -&gt; WFR=
eportParams ) <br>

block drbd38: Handshake successful: Agreed network protocol version 91<br>b=
lock drbd38: conn( WFConnection -&gt; WFReportParams ) <br>block drbd38: St=
arting asender thread (from drbd38_receiver [16250])<br>block drbd1: Starti=
ng asender thread (from drbd1_receiver [18278])<br>

... Then lots of stuff for the DRBD devices reconnecting and syncing.<br><b=
r><br>This
 happened three times, each time the user was attempting to add the=20
second node into NLB.=A0 I can reproduce the network adapter dying(Becomes
 disabled and is unusable until reboot) in the lab on Server 2012 unless
 I follow specific steps, but not the DRBD dying.=A0 I can get NLB working
 but I&#39;m mostly concerned about one persons ability to effectively cras=
h
 8 other VM&#39;s.=A0 It looks like whatever is going on is somehow effecti=
ng=20
my DRBD connection.=A0 Has anyone seen anything like this before?<br>
<br><br>Thanks,<br>=A0=A0 Greg

--14dae93409a3b3d8a604cf9ed67e--


--===============4675918309930620394==
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.xen.org
http://lists.xen.org/xen-devel

--===============4675918309930620394==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 09:27:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 09:27:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te0OH-0006NR-Ju; Thu, 29 Nov 2012 09:26:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Te0OF-0006NA-Ui
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 09:26:40 +0000
Received: from [85.158.137.99:22299] by server-11.bemta-3.messagelabs.com id
	A2/D6-19361-F4A27B05; Thu, 29 Nov 2012 09:26:39 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1354181196!17150923!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28446 invoked from network); 29 Nov 2012 09:26:36 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 09:26:36 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 29 Nov 2012 09:26:35 +0000
Message-Id: <50B7389202000078000AC669@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 29 Nov 2012 09:27:30 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>
References: <50B498E502000078000AB8B3@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403398F24@SHSMSX101.ccr.corp.intel.com>
	<50B7243602000078000AC61A@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033994C8@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A48345644033994C8@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] ATS and dependent features
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 29.11.12 at 10:19, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:

> 
>> -----Original Message-----
>> From: Jan Beulich [mailto:JBeulich@suse.com]
>> Sent: Thursday, November 29, 2012 4:01 PM
>> To: Zhang, Xiantao
>> Cc: xen-devel
>> Subject: RE: ATS and dependent features
>> 
>> >>> On 29.11.12 at 02:07, "Zhang, Xiantao" <xiantao.zhang@intel.com>
>> wrote:
>> > ATS should be a host feature controlled by iommu, and I don't think
>> > dom0 can control  it from Xen's architecture.
>> 
>> "Can" or "should"? Because from all I can tell it currently clearly does.
> 
> I mean Xen shouldn't  allow these capabilities can be detected by dom0.  If 
> it does, we need to fix it. 

It sort of hides it - all callers sit in the kernel's IOMMU code, and
IOMMU detection is being prevented. So it looks like the code is
simply dead when running on top of Xen.

>> >   Perhaps we need to forbid dom0 controlling these features.
>> 
>> That's what I was trying to find out. How to properly do that with pv-ops I
>> don't know; in our forward ported kernels I can simply make the respective
>> config options conditional upon !XEN. 
> 
> As to the clean solution, Xen should intercept all the accesses to the 
> device's PCI config space from dom0, and emulates the related registers.

Why? That would e.g. make lspci completely unreliable.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 09:27:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 09:27:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te0OH-0006NR-Ju; Thu, 29 Nov 2012 09:26:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Te0OF-0006NA-Ui
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 09:26:40 +0000
Received: from [85.158.137.99:22299] by server-11.bemta-3.messagelabs.com id
	A2/D6-19361-F4A27B05; Thu, 29 Nov 2012 09:26:39 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1354181196!17150923!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28446 invoked from network); 29 Nov 2012 09:26:36 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 09:26:36 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 29 Nov 2012 09:26:35 +0000
Message-Id: <50B7389202000078000AC669@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 29 Nov 2012 09:27:30 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xiantao Zhang" <xiantao.zhang@intel.com>
References: <50B498E502000078000AB8B3@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403398F24@SHSMSX101.ccr.corp.intel.com>
	<50B7243602000078000AC61A@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033994C8@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A48345644033994C8@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] ATS and dependent features
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 29.11.12 at 10:19, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:

> 
>> -----Original Message-----
>> From: Jan Beulich [mailto:JBeulich@suse.com]
>> Sent: Thursday, November 29, 2012 4:01 PM
>> To: Zhang, Xiantao
>> Cc: xen-devel
>> Subject: RE: ATS and dependent features
>> 
>> >>> On 29.11.12 at 02:07, "Zhang, Xiantao" <xiantao.zhang@intel.com>
>> wrote:
>> > ATS should be a host feature controlled by iommu, and I don't think
>> > dom0 can control  it from Xen's architecture.
>> 
>> "Can" or "should"? Because from all I can tell it currently clearly does.
> 
> I mean Xen shouldn't  allow these capabilities can be detected by dom0.  If 
> it does, we need to fix it. 

It sort of hides it - all callers sit in the kernel's IOMMU code, and
IOMMU detection is being prevented. So it looks like the code is
simply dead when running on top of Xen.

>> >   Perhaps we need to forbid dom0 controlling these features.
>> 
>> That's what I was trying to find out. How to properly do that with pv-ops I
>> don't know; in our forward ported kernels I can simply make the respective
>> config options conditional upon !XEN. 
> 
> As to the clean solution, Xen should intercept all the accesses to the 
> device's PCI config space from dom0, and emulates the related registers.

Why? That would e.g. make lspci completely unreliable.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 09:30:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 09:30:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te0RW-0006dF-7l; Thu, 29 Nov 2012 09:30:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Te0RU-0006cz-EC
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 09:30:00 +0000
Received: from [85.158.139.211:50281] by server-7.bemta-5.messagelabs.com id
	5A/D5-23096-71B27B05; Thu, 29 Nov 2012 09:29:59 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1354181398!18344711!1
X-Originating-IP: [209.85.212.169]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21904 invoked from network); 29 Nov 2012 09:29:58 -0000
Received: from mail-wi0-f169.google.com (HELO mail-wi0-f169.google.com)
	(209.85.212.169)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 09:29:58 -0000
Received: by mail-wi0-f169.google.com with SMTP id hq12so5613256wib.2
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 01:29:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=0VBwew5tc7fdUFlCU1hbW0YPx8YE4NgUD6EHs+t2vlY=;
	b=encCn4pYtSy0Llw4BM6ac2hKm8VxPk7/HN5o88nlZhymRZ2khh81Ih2kJUvpVzBurE
	4/mqIAqSFFUD51kx9S7xM3tr+pL+i6RoJAssx3rhwvLY8x0tv3nYXRgSsH4iYmJWuk6c
	5aUf/9Qy3oN7AfM1YtOQiAy8G2DDrkqgEEOua0gYG0fzovKZtfM8yA7tRyxfek6bVH2+
	LxbFLqfKo2t+CEe5cR7m1CWHtckHsuWvi5qG2HJ4SifFLMQbgxCDyNB8mH7cj4bHehAj
	3R9+rp2fMjbaUCdgoAUp5SunC0fSwIzQ+jKzuM/ZVah7VMjE9MXj8mlEpJU8RSYvhL9D
	HLPg==
Received: by 10.180.88.42 with SMTP id bd10mr29326579wib.8.1354181398628;
	Thu, 29 Nov 2012 01:29:58 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id hv4sm10435688wib.0.2012.11.29.01.29.55
	(version=SSLv3 cipher=OTHER); Thu, 29 Nov 2012 01:29:57 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 29 Nov 2012 09:29:48 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <CCDCDB8C.540E1%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH v8 1/2] hypervisor: XENMEM_claim_pages (subop
	of existing) hypercall
Thread-Index: Ac3OFBMt4nceKrE+ck+HEnUi6GKyPQ==
In-Reply-To: <50B725ED02000078000AC624@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	AndresLagar-Cavilla <andreslc@gridcentric.ca>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [PATCH v8 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 29/11/2012 08:07, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 28.11.12 at 19:05, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>>  From: Jan Beulich [mailto:JBeulich@suse.com]
>>> Perhaps then even invert the if()
>>> condition and have just a single return point.
>> 
>> Rather than invert the if(), unless you prefer the extra
>> level of indentation, I'd prefer:
>> 
>> +    d->tot_pages += pages;
>> +    if ( !d->unclaimed_pages )
>> +        goto out;
>>    <snip>
>> +out:
>> +    return d->tot_pages;
>> 
>> Would that be acceptable?
> 
> Acceptable as per the coding guidelines - yes. But I personally
> dislike goto-s (and would hence prefer the extra level of
> indentation, considering that this is a strait code block with no
> deep nesting of inner scopes).

Personally I think I prefer the bailing goto, as I like straightline code
with no indentation where possible. But it is personal preference for a
function this short. Either is perfectly acceptable.

 -- Keir

> Jan
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 09:30:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 09:30:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te0RW-0006dF-7l; Thu, 29 Nov 2012 09:30:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1Te0RU-0006cz-EC
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 09:30:00 +0000
Received: from [85.158.139.211:50281] by server-7.bemta-5.messagelabs.com id
	5A/D5-23096-71B27B05; Thu, 29 Nov 2012 09:29:59 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1354181398!18344711!1
X-Originating-IP: [209.85.212.169]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21904 invoked from network); 29 Nov 2012 09:29:58 -0000
Received: from mail-wi0-f169.google.com (HELO mail-wi0-f169.google.com)
	(209.85.212.169)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 09:29:58 -0000
Received: by mail-wi0-f169.google.com with SMTP id hq12so5613256wib.2
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 01:29:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=0VBwew5tc7fdUFlCU1hbW0YPx8YE4NgUD6EHs+t2vlY=;
	b=encCn4pYtSy0Llw4BM6ac2hKm8VxPk7/HN5o88nlZhymRZ2khh81Ih2kJUvpVzBurE
	4/mqIAqSFFUD51kx9S7xM3tr+pL+i6RoJAssx3rhwvLY8x0tv3nYXRgSsH4iYmJWuk6c
	5aUf/9Qy3oN7AfM1YtOQiAy8G2DDrkqgEEOua0gYG0fzovKZtfM8yA7tRyxfek6bVH2+
	LxbFLqfKo2t+CEe5cR7m1CWHtckHsuWvi5qG2HJ4SifFLMQbgxCDyNB8mH7cj4bHehAj
	3R9+rp2fMjbaUCdgoAUp5SunC0fSwIzQ+jKzuM/ZVah7VMjE9MXj8mlEpJU8RSYvhL9D
	HLPg==
Received: by 10.180.88.42 with SMTP id bd10mr29326579wib.8.1354181398628;
	Thu, 29 Nov 2012 01:29:58 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id hv4sm10435688wib.0.2012.11.29.01.29.55
	(version=SSLv3 cipher=OTHER); Thu, 29 Nov 2012 01:29:57 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Thu, 29 Nov 2012 09:29:48 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>
Message-ID: <CCDCDB8C.540E1%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH v8 1/2] hypervisor: XENMEM_claim_pages (subop
	of existing) hypercall
Thread-Index: Ac3OFBMt4nceKrE+ck+HEnUi6GKyPQ==
In-Reply-To: <50B725ED02000078000AC624@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	AndresLagar-Cavilla <andreslc@gridcentric.ca>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [PATCH v8 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 29/11/2012 08:07, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 28.11.12 at 19:05, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
>>>  From: Jan Beulich [mailto:JBeulich@suse.com]
>>> Perhaps then even invert the if()
>>> condition and have just a single return point.
>> 
>> Rather than invert the if(), unless you prefer the extra
>> level of indentation, I'd prefer:
>> 
>> +    d->tot_pages += pages;
>> +    if ( !d->unclaimed_pages )
>> +        goto out;
>>    <snip>
>> +out:
>> +    return d->tot_pages;
>> 
>> Would that be acceptable?
> 
> Acceptable as per the coding guidelines - yes. But I personally
> dislike goto-s (and would hence prefer the extra level of
> indentation, considering that this is a strait code block with no
> deep nesting of inner scopes).

Personally I think I prefer the bailing goto, as I like straightline code
with no indentation where possible. But it is personal preference for a
function this short. Either is perfectly acceptable.

 -- Keir

> Jan
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 10:03:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 10:03:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te0xN-0007Cy-2d; Thu, 29 Nov 2012 10:02:57 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te0xM-0007Ct-1l
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 10:02:56 +0000
Received: from [85.158.139.83:32929] by server-9.bemta-5.messagelabs.com id
	D1/E1-29295-FC237B05; Thu, 29 Nov 2012 10:02:55 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1354183358!20253705!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31417 invoked from network); 29 Nov 2012 10:02:40 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 10:02:40 -0000
X-IronPort-AV: E=Sophos;i="4.84,182,1355097600"; d="scan'208";a="16064275"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 10:02:38 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 10:02:37 +0000
Message-ID: <1354183356.25834.108.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Date: Thu, 29 Nov 2012 10:02:36 +0000
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923353996FF@SHSMSX101.ccr.corp.intel.com>
References: <d3378692eece3e552ba2.1353630328@ljsromley.bj.intel.com>
	<CAFLBxZZ_W5PMLYiqEwdrpqkjgiMN9NoN2f33ErLriOwNOD9GgA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353996FF@SHSMSX101.ccr.corp.intel.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 14:37 +0000, Liu, Jinsong wrote:
> Ping?

Sorry I've been meaning to reply but didn't manage to yet. Also you
replied to V4 saying to ignore it, so I was half waiting for V5 but I
see this should actually be labelled V5 anyway.

I'm afraid I still don't fully grok the reason for the loop that goes
with:
+            /*
+             * At the last iter, count the number of broken pages after sending,
+             * and if there are more than before sending, do one or more iter
+             * to make sure the pages are marked broken on the receiving side.
+             */

Can we go through it one more time? Sorry.

Let me outline the sequence of events and you can point out where I'm
going wrong. I'm afraid this has turned out to be rather long, again I'm
sorry for that.

First we do some number of iterations with the guest live. If an MCE
occurs during this phase then the page will be marked dirty and we will
pick this up on the next iteration and resend the page with the dirty
type etc and all is fine. This all looks good to me, so we don't need to
worry about anything at this stage.

Eventually we get to the last iteration, at which point we pause the
guest. From here on in the guest itself is not going to cause an MCE
(e.g. by touching its RAM) because it is not running but we must still
account for the possibility of an asynchronous MCE of some sort e.g.
triggered by the error detection mechanisms in the hardware, cosmic rays
and such like.

The final iteration proceeds roughly as follows.

     1. The domain is paused
     2. We scan the dirty bitmap and add dirty pages to the batch of
        pages to process (there may be several batches in the last
        iteration, we only need to concern ourselves with any one batch
        here).
     3. We map all of the pages in the resulting batch with
        xc_map_foreign_bulk
     4. We query the types of all the pages in the batch with
        xc_get_pfn_type_batch
     5. We iterate over the batch, checking the type of each page, in
        some cases we do some incidental processing.
     6. We send the types of the pages in the batch over the wire.
     7. We iterate over the batch again, and send any normal page (not
        broken, xtab etc) over the wire. Actually we do this as runs of
        normal pages, but the key point is we avoid touching any special
        page (including ones marked as broken by #4)

Is this sequence of events accurate?

Now lets consider the consequences of an MCE occurring at various stages
here.

Any MCE which happens before #4 is fine, we will pick that up in #4 and
the following steps will do the right thing.

Note that I am assuming that the mapping step in #3 is safe even for a
broken page, so long as we don't actually try and use the mapping (more
on that later), is this true?

If an MCE occurs after #4 then the page will be marked as dirty in the
bitmap and Xen will internally mark it as broken, but we won't see
either of those with the current algorithm. There are two cases to think
about here AFAICT,
     A. The page was not already dirty at #2. In this case we know that
        the guest hasn't dirtied the page since the previous iteration
        and therefore the target has a good copy of this page from that
        time. The page isn't even in the batch we are processing So we
        don't particularly care about the MCE here and can, from the PoV
        of migrating this guest, ignore it.
     B. The page was already dirty (but not broken, we handled that case
        above in "Any MCE which happens before #4...") at #2 which means
        we have do not have an up to date copy on the target. This has
        two subcases:
             I. The MCE occurs before (or during) #6 (sending the page)
                and therefore we do not have a good up to date copy of
                that data at either end.
            II. The MCE occurs after #6, in which case we already have a
                good copy at the target end.

To fix B you have added an 8th step to the above:

        8. Query the types of the pages again, using
        xc_get_pfn_type_batch, and if there are more pages dirty now
        than we say at #4 (actually #5 when we scanned the array, but
        that distinction doesn't matter) then a new MCE must have
        occurred. Go back to #2 and try again.

This won't do anything for A since the page wasn't in the batch to start
with and so neither #4 or #8 will look at its type, this is good and
proper.

So now we consider the two subcases of B. Lets consider B.II first since
it seems to be the more obvious case.

In case B.II the target end already has a good copy of the data page,
there is no need to mark the page as broken on the far end, nor to
arrange for a vMCE to be injected. I don't know if/how we arrange for
vMCEs to be injected under these circumstances, however even if a vMCE
does get injected into the guest when it eventually gets unpaused on the
target then all that will happen is that it will needlessly throw away a
good page. However this is a rare corner case which is not worth
concerning ourselves with (it's largely indistinguishable from case A).
If the MCE had happened even a single cycle earlier then this would have
been a B.I event instead of a B.II one. In any case there is no need to
return to #2 and try again, everything will be just fine if we complete
the migration at this point.

In case B.I the MCE occurs before (or while) we send the page onto the
wire. We will therefore try to read from this page because we haven't
looked at the type since #4 and have no idea that it is now broken.
Reading from the broken page will cause a fault, perhaps causing a vMCE
to be delivered to dom0, which causes the kernel to kill the process
doing the migration. Or maybe it kills dom0 or the host entirely. Either
way the idea of looping again is rather moot.

Have I missed a case which needs thinking about?

I suspect B.I is the case where you are most likely to find a flaw in my
argument. Is there something else which is done in this case which would
allow us to continue?

Ian.





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 10:03:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 10:03:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te0xN-0007Cy-2d; Thu, 29 Nov 2012 10:02:57 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te0xM-0007Ct-1l
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 10:02:56 +0000
Received: from [85.158.139.83:32929] by server-9.bemta-5.messagelabs.com id
	D1/E1-29295-FC237B05; Thu, 29 Nov 2012 10:02:55 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1354183358!20253705!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31417 invoked from network); 29 Nov 2012 10:02:40 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 10:02:40 -0000
X-IronPort-AV: E=Sophos;i="4.84,182,1355097600"; d="scan'208";a="16064275"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 10:02:38 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 10:02:37 +0000
Message-ID: <1354183356.25834.108.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Date: Thu, 29 Nov 2012 10:02:36 +0000
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923353996FF@SHSMSX101.ccr.corp.intel.com>
References: <d3378692eece3e552ba2.1353630328@ljsromley.bj.intel.com>
	<CAFLBxZZ_W5PMLYiqEwdrpqkjgiMN9NoN2f33ErLriOwNOD9GgA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353996FF@SHSMSX101.ccr.corp.intel.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 14:37 +0000, Liu, Jinsong wrote:
> Ping?

Sorry I've been meaning to reply but didn't manage to yet. Also you
replied to V4 saying to ignore it, so I was half waiting for V5 but I
see this should actually be labelled V5 anyway.

I'm afraid I still don't fully grok the reason for the loop that goes
with:
+            /*
+             * At the last iter, count the number of broken pages after sending,
+             * and if there are more than before sending, do one or more iter
+             * to make sure the pages are marked broken on the receiving side.
+             */

Can we go through it one more time? Sorry.

Let me outline the sequence of events and you can point out where I'm
going wrong. I'm afraid this has turned out to be rather long, again I'm
sorry for that.

First we do some number of iterations with the guest live. If an MCE
occurs during this phase then the page will be marked dirty and we will
pick this up on the next iteration and resend the page with the dirty
type etc and all is fine. This all looks good to me, so we don't need to
worry about anything at this stage.

Eventually we get to the last iteration, at which point we pause the
guest. From here on in the guest itself is not going to cause an MCE
(e.g. by touching its RAM) because it is not running but we must still
account for the possibility of an asynchronous MCE of some sort e.g.
triggered by the error detection mechanisms in the hardware, cosmic rays
and such like.

The final iteration proceeds roughly as follows.

     1. The domain is paused
     2. We scan the dirty bitmap and add dirty pages to the batch of
        pages to process (there may be several batches in the last
        iteration, we only need to concern ourselves with any one batch
        here).
     3. We map all of the pages in the resulting batch with
        xc_map_foreign_bulk
     4. We query the types of all the pages in the batch with
        xc_get_pfn_type_batch
     5. We iterate over the batch, checking the type of each page, in
        some cases we do some incidental processing.
     6. We send the types of the pages in the batch over the wire.
     7. We iterate over the batch again, and send any normal page (not
        broken, xtab etc) over the wire. Actually we do this as runs of
        normal pages, but the key point is we avoid touching any special
        page (including ones marked as broken by #4)

Is this sequence of events accurate?

Now lets consider the consequences of an MCE occurring at various stages
here.

Any MCE which happens before #4 is fine, we will pick that up in #4 and
the following steps will do the right thing.

Note that I am assuming that the mapping step in #3 is safe even for a
broken page, so long as we don't actually try and use the mapping (more
on that later), is this true?

If an MCE occurs after #4 then the page will be marked as dirty in the
bitmap and Xen will internally mark it as broken, but we won't see
either of those with the current algorithm. There are two cases to think
about here AFAICT,
     A. The page was not already dirty at #2. In this case we know that
        the guest hasn't dirtied the page since the previous iteration
        and therefore the target has a good copy of this page from that
        time. The page isn't even in the batch we are processing So we
        don't particularly care about the MCE here and can, from the PoV
        of migrating this guest, ignore it.
     B. The page was already dirty (but not broken, we handled that case
        above in "Any MCE which happens before #4...") at #2 which means
        we have do not have an up to date copy on the target. This has
        two subcases:
             I. The MCE occurs before (or during) #6 (sending the page)
                and therefore we do not have a good up to date copy of
                that data at either end.
            II. The MCE occurs after #6, in which case we already have a
                good copy at the target end.

To fix B you have added an 8th step to the above:

        8. Query the types of the pages again, using
        xc_get_pfn_type_batch, and if there are more pages dirty now
        than we say at #4 (actually #5 when we scanned the array, but
        that distinction doesn't matter) then a new MCE must have
        occurred. Go back to #2 and try again.

This won't do anything for A since the page wasn't in the batch to start
with and so neither #4 or #8 will look at its type, this is good and
proper.

So now we consider the two subcases of B. Lets consider B.II first since
it seems to be the more obvious case.

In case B.II the target end already has a good copy of the data page,
there is no need to mark the page as broken on the far end, nor to
arrange for a vMCE to be injected. I don't know if/how we arrange for
vMCEs to be injected under these circumstances, however even if a vMCE
does get injected into the guest when it eventually gets unpaused on the
target then all that will happen is that it will needlessly throw away a
good page. However this is a rare corner case which is not worth
concerning ourselves with (it's largely indistinguishable from case A).
If the MCE had happened even a single cycle earlier then this would have
been a B.I event instead of a B.II one. In any case there is no need to
return to #2 and try again, everything will be just fine if we complete
the migration at this point.

In case B.I the MCE occurs before (or while) we send the page onto the
wire. We will therefore try to read from this page because we haven't
looked at the type since #4 and have no idea that it is now broken.
Reading from the broken page will cause a fault, perhaps causing a vMCE
to be delivered to dom0, which causes the kernel to kill the process
doing the migration. Or maybe it kills dom0 or the host entirely. Either
way the idea of looping again is rather moot.

Have I missed a case which needs thinking about?

I suspect B.I is the case where you are most likely to find a flaw in my
argument. Is there something else which is done in this case which would
allow us to continue?

Ian.





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 10:07:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 10:07:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te11E-0007KG-No; Thu, 29 Nov 2012 10:06:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Te11D-0007KA-Md
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 10:06:55 +0000
Received: from [85.158.143.99:26337] by server-1.bemta-4.messagelabs.com id
	2D/BA-27934-EB337B05; Thu, 29 Nov 2012 10:06:54 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1354183578!16118128!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13818 invoked from network); 29 Nov 2012 10:06:21 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 10:06:21 -0000
X-IronPort-AV: E=Sophos;i="4.84,182,1355097600"; d="scan'208";a="16064374"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 10:05:55 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 10:05:55 +0000
Message-ID: <50B73382.8070300@citrix.com>
Date: Thu, 29 Nov 2012 11:05:54 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Toby Karyadi <toby.karyadi@gmail.com>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com> <50B622B4.6010103@citrix.com>
	<20121128152919.GA11947@panix.com> <50B668C5.50702@gmail.com>
In-Reply-To: <50B668C5.50702@gmail.com>
Cc: "port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/12 20:40, Toby Karyadi wrote:
> On 11/28/12 10:29 AM, Thor Lancelot Simon wrote:
>> On Wed, Nov 28, 2012 at 03:41:56PM +0100, Roger Pau Monn? wrote:
>>> On 28/11/12 14:26, Thor Lancelot Simon wrote:
>>>> I am assuming there's some reason we want this, rather than handling
>>>> such requests in-kernel.  But what is it?
>>> I should have marked this as "experimental", or something like this. I'm
>>> not sure if switching to Qdisk for all image file backends is needed.
>>> >From the Xen wiki (http://wiki.xen.org/wiki/Blktap) I've found that:
>>>
>>> "loop device had problems with flushing dirty pages (specifically, doing
>>> a large number of writes to an NFS-backed image don't result in the OOM
>>> killer going berserk)."
>>>
>>> I'm not sure if NetBSD is in the same situation, but if I remember
>>> correctly (haven't tried that in a long time), trying to use a disk file
>>> on a NFS share caused the NetBSD Dom0 kernel to crash. The PR for this
>>> issue is: http://gnats.netbsd.org/40726.
>> It seems highly unlikely to me that a problem with the loop device driver
>> on Linux is tremendously relevant to NetBSD.
>>
>> But, even if there is some problem with vnd backed by NFS, that hardly
>> seems like it would be a good reason to make a change that reduces I/O
>> throughput for the *non* NFS-backed case by at least 20%.  Why would one
>> keep disk images for guests, as a general rule, on NFS, rather than simply
>> doing the NFS mounts on the guests themselves, or using a more sensible
>> protocol like iSCSI?  I have to assume most folks using files as disks are
>> storing them on local filesystems on the dom0, and wrecking performance
>> for that case to solve a problem with NFS that may or may not be hypothetical
>> seems like a very, very bad trade-off.
>>
>> Thor
> Yeah, I usually don't pipe up, but I strongly dislike being forced to 
> use qemu to read raw disk file instead of being able to use vnd on 
> netbsd dom0.

I'm not a fan of Qemu either, but I don't know an easy way to detect if
an image is in a NFS share, or if an image is in qcow, qcow2 or raw. I'm
open to a solution that only launches Qemu if image format is different
than raw or if the image file is in a NFS share.

> There was/is? a bug in xentools 4.1 in libxl that prevents using vnd for 
> raw disk file. The problem boils down to libxl not notifying xenbackendd 
> (via xenstored) to call /usr/pkg/etc/xen/scripts/block at the right time 
> such that vnconfig doesn't get called when it's time to shutdown the 
> domU, and hence you end up with a bunch of vnd devices even after the 
> corresponding domU's have been shutdown. I created a patch to fix that: 
> http://mail-index.netbsd.org/port-xen/2012/05/29/msg007252.html 
> Additionally I put in an experimental feature that allows specifying 
> other types of backend aside from phy: or file:, and as long as the 
> /usr/pkg/etc/xen/scripts/block sh script is modified accordingly, the 
> domU will just get the appropriate device in dom0. Then we can use, for 
> example, vnd:, or iscsi: and from the POV of the domU, it's just another 
> 'physical' device that the dom0 manages. I think the way xenbackendd 
> works, in conjunction with xenstored, is pretty flexible and decoupled, 
> at least with xen 3.3 and 4.1; I don't know what the story is for xen 
> 4.2. Was there a rumor of retiring xenbackendd?

Yes, xenbackendd is deprecated and hotplug scripts are called from libxl
directly (that's true for both NetBSD and Linux).

> I'm also concerned about the trend, which to me is more of putting more 
> and more policy in libxl, as opposed to functionality. I saw this back 
> when I was trying to fix the bug above, hopefully this trend is no 
> longer true. For example, I had the impression (I don't remember the 
> details) that the code that parses the disk configuration to a certain 
> degree decides whether the disk is a block device or a regular file 
> based on the prefix (phy: vs file:), which is not true in netbsd dom0, 
> because the file path is then used to setup a vnd device, which is from 
> libxl's POV is just a block device. Most probably it's born out of the 
> fact that libxl is developed in a mostly linux environment. I do 
> appreciate Roger's effort in improving xen support in netbsd, but 
> hopefully some BSDism would travel back to xen as well.

Yes, most libxl developers are Linux users, so most of the functionality
in libxl is designed with Linux in mind. The only way to change that is
to get BSD developers to contribute to libxl and the Xen project in
general, if we are not active players in this game, we should not expect
that BSD will be taken into account.

As an example, libxl is now working in NetBSD without any external
patches, and AFAIK all functionality is working, and Linux developers
are very careful to try not to break this compatibility.

>From my POV, I think your patches to add new functionality to disk
backends should be rebased against xen-unstable and posted to xen-devel,
so that they are added to upstream Xen.

Having a bunch of out-of-tree patches in pkgsrc is not the way to move
forward, because we are not able to test NetBSD with latest Xen. Being
able to test xen-unstable easily will allow us to find bugs and develop
patches before Xen is released, thus keeping this pkgsrc patch queue
minimal.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 10:07:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 10:07:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te11E-0007KG-No; Thu, 29 Nov 2012 10:06:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Te11D-0007KA-Md
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 10:06:55 +0000
Received: from [85.158.143.99:26337] by server-1.bemta-4.messagelabs.com id
	2D/BA-27934-EB337B05; Thu, 29 Nov 2012 10:06:54 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1354183578!16118128!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13818 invoked from network); 29 Nov 2012 10:06:21 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 10:06:21 -0000
X-IronPort-AV: E=Sophos;i="4.84,182,1355097600"; d="scan'208";a="16064374"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 10:05:55 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 10:05:55 +0000
Message-ID: <50B73382.8070300@citrix.com>
Date: Thu, 29 Nov 2012 11:05:54 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Toby Karyadi <toby.karyadi@gmail.com>
References: <1354108851-2383-1-git-send-email-roger.pau@citrix.com>
	<1354108851-2383-2-git-send-email-roger.pau@citrix.com>
	<20121128132634.GA18277@panix.com> <50B622B4.6010103@citrix.com>
	<20121128152919.GA11947@panix.com> <50B668C5.50702@gmail.com>
In-Reply-To: <50B668C5.50702@gmail.com>
Cc: "port-xen@netbsd.org" <port-xen@netbsd.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/12 20:40, Toby Karyadi wrote:
> On 11/28/12 10:29 AM, Thor Lancelot Simon wrote:
>> On Wed, Nov 28, 2012 at 03:41:56PM +0100, Roger Pau Monn? wrote:
>>> On 28/11/12 14:26, Thor Lancelot Simon wrote:
>>>> I am assuming there's some reason we want this, rather than handling
>>>> such requests in-kernel.  But what is it?
>>> I should have marked this as "experimental", or something like this. I'm
>>> not sure if switching to Qdisk for all image file backends is needed.
>>> >From the Xen wiki (http://wiki.xen.org/wiki/Blktap) I've found that:
>>>
>>> "loop device had problems with flushing dirty pages (specifically, doing
>>> a large number of writes to an NFS-backed image don't result in the OOM
>>> killer going berserk)."
>>>
>>> I'm not sure if NetBSD is in the same situation, but if I remember
>>> correctly (haven't tried that in a long time), trying to use a disk file
>>> on a NFS share caused the NetBSD Dom0 kernel to crash. The PR for this
>>> issue is: http://gnats.netbsd.org/40726.
>> It seems highly unlikely to me that a problem with the loop device driver
>> on Linux is tremendously relevant to NetBSD.
>>
>> But, even if there is some problem with vnd backed by NFS, that hardly
>> seems like it would be a good reason to make a change that reduces I/O
>> throughput for the *non* NFS-backed case by at least 20%.  Why would one
>> keep disk images for guests, as a general rule, on NFS, rather than simply
>> doing the NFS mounts on the guests themselves, or using a more sensible
>> protocol like iSCSI?  I have to assume most folks using files as disks are
>> storing them on local filesystems on the dom0, and wrecking performance
>> for that case to solve a problem with NFS that may or may not be hypothetical
>> seems like a very, very bad trade-off.
>>
>> Thor
> Yeah, I usually don't pipe up, but I strongly dislike being forced to 
> use qemu to read raw disk file instead of being able to use vnd on 
> netbsd dom0.

I'm not a fan of Qemu either, but I don't know an easy way to detect if
an image is in a NFS share, or if an image is in qcow, qcow2 or raw. I'm
open to a solution that only launches Qemu if image format is different
than raw or if the image file is in a NFS share.

> There was/is? a bug in xentools 4.1 in libxl that prevents using vnd for 
> raw disk file. The problem boils down to libxl not notifying xenbackendd 
> (via xenstored) to call /usr/pkg/etc/xen/scripts/block at the right time 
> such that vnconfig doesn't get called when it's time to shutdown the 
> domU, and hence you end up with a bunch of vnd devices even after the 
> corresponding domU's have been shutdown. I created a patch to fix that: 
> http://mail-index.netbsd.org/port-xen/2012/05/29/msg007252.html 
> Additionally I put in an experimental feature that allows specifying 
> other types of backend aside from phy: or file:, and as long as the 
> /usr/pkg/etc/xen/scripts/block sh script is modified accordingly, the 
> domU will just get the appropriate device in dom0. Then we can use, for 
> example, vnd:, or iscsi: and from the POV of the domU, it's just another 
> 'physical' device that the dom0 manages. I think the way xenbackendd 
> works, in conjunction with xenstored, is pretty flexible and decoupled, 
> at least with xen 3.3 and 4.1; I don't know what the story is for xen 
> 4.2. Was there a rumor of retiring xenbackendd?

Yes, xenbackendd is deprecated and hotplug scripts are called from libxl
directly (that's true for both NetBSD and Linux).

> I'm also concerned about the trend, which to me is more of putting more 
> and more policy in libxl, as opposed to functionality. I saw this back 
> when I was trying to fix the bug above, hopefully this trend is no 
> longer true. For example, I had the impression (I don't remember the 
> details) that the code that parses the disk configuration to a certain 
> degree decides whether the disk is a block device or a regular file 
> based on the prefix (phy: vs file:), which is not true in netbsd dom0, 
> because the file path is then used to setup a vnd device, which is from 
> libxl's POV is just a block device. Most probably it's born out of the 
> fact that libxl is developed in a mostly linux environment. I do 
> appreciate Roger's effort in improving xen support in netbsd, but 
> hopefully some BSDism would travel back to xen as well.

Yes, most libxl developers are Linux users, so most of the functionality
in libxl is designed with Linux in mind. The only way to change that is
to get BSD developers to contribute to libxl and the Xen project in
general, if we are not active players in this game, we should not expect
that BSD will be taken into account.

As an example, libxl is now working in NetBSD without any external
patches, and AFAIK all functionality is working, and Linux developers
are very careful to try not to break this compatibility.

>From my POV, I think your patches to add new functionality to disk
backends should be rebased against xen-unstable and posted to xen-devel,
so that they are added to upstream Xen.

Having a bunch of out-of-tree patches in pkgsrc is not the way to move
forward, because we are not able to test NetBSD with latest Xen. Being
able to test xen-unstable easily will allow us to find bugs and develop
patches before Xen is released, thus keeping this pkgsrc patch queue
minimal.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 10:37:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 10:37:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te1Ug-0007lG-QE; Thu, 29 Nov 2012 10:37:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1Te1Uf-0007lB-Qo
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 10:37:22 +0000
Received: from [85.158.143.35:23348] by server-1.bemta-4.messagelabs.com id
	7F/8B-27934-1EA37B05; Thu, 29 Nov 2012 10:37:21 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354185438!12607379!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjM0NDc0\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20816 invoked from network); 29 Nov 2012 10:37:19 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-12.tower-21.messagelabs.com with SMTP;
	29 Nov 2012 10:37:19 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga101.ch.intel.com with ESMTP; 29 Nov 2012 02:37:16 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,184,1355126400"; d="scan'208";a="224181082"
Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37])
	by azsmga001.ch.intel.com with ESMTP; 29 Nov 2012 02:37:13 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 29 Nov 2012 02:37:13 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Thu, 29 Nov 2012 18:37:12 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: "Wu, Fengguang" <fengguang.wu@intel.com>, Konrad Rzeszutek Wilk
	<konrad.wilk@oracle.com>
Thread-Topic: [xen:stable/for-linus-3.8 4/8]
	include/xen/interface/version.h:72:2: error: implicit declaration of
	function 'xen_domain'
Thread-Index: AQHNzd+/UzB8MkZYS0GLvYEMNz1RAJgAnxnQ
Date: Thu, 29 Nov 2012 10:37:11 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233539A030@SHSMSX101.ccr.corp.intel.com>
References: <50b68452.Gqr1L/cRkHFh1xmK%fengguang.wu@intel.com>
	<20121128221510.GA29950@phenom.dumpdata.com>
	<20121129022125.GG5785@localhost>
	<20121129030838.GA22724@phenom.dumpdata.com>
	<20121129031459.GA9355@localhost>
In-Reply-To: <20121129031459.GA9355@localhost>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [xen:stable/for-linus-3.8 4/8]
 include/xen/interface/version.h:72:2: error: implicit declaration of
 function 'xen_domain'
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Wu, Fengguang wrote:
> On Wed, Nov 28, 2012 at 10:08:38PM -0500, Konrad Rzeszutek Wilk wrote:
>> On Thu, Nov 29, 2012 at 10:21:25AM +0800, Fengguang Wu wrote:
>>> On Wed, Nov 28, 2012 at 05:15:10PM -0500, Konrad Rzeszutek Wilk
>>> wrote: 
>>>> On Thu, Nov 29, 2012 at 05:38:26AM +0800, kbuild test robot wrote:
>>>>> tree:  
>>>>> git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
>>>>> stable/for-linus-3.8  
>>>>> head:   394b40f62d7ae18a1c48c13fc483b8193f8c3a98
>>>>> commit: 92e3229dcdc80ff0b6304f14c578d76e7e10e226 [4/8] xen/acpi:
>>>>> ACPI PAD driver 
>>>>> config: x86_64-randconfig-x701 (attached as .config)
>>>>> 
>>>>> Note: the xen/stable/for-linus-3.8 HEAD 394b40f builds fine.
>>>>>       It only hurts bisectibility.
>>>>> 
>>>>> All error/warnings:
>>>>> 
>>>>> In file included from drivers/xen/features.c:15:0:
>>>>> include/xen/interface/version.h: In function
>>>>> 'xen_running_on_version_or_later': 
>>>>> include/xen/interface/version.h:72:2: error: implicit declaration
>>>>> of function 'xen_domain' [-Werror=implicit-function-declaration]
>>>>> cc1: some warnings being treated as errors 
>>>> 
>>>> Which are fixed a bit later by me.
>>> 
>>> Yes, see the above note: "HEAD 394b40f builds fine. It only hurts
>>> bisectibility." 
>>> 
>>> It still creates a range of not-bisectable commits due to the build
>>> error. So the report was sent out, hoping that the branch can be
>>> rebased to remove the error completely.
>>> 
>>> However if you've decided that this tree won't do rebase at all,
>> 
>> Not that one. The 'devel' ones are OK, but the 'stable' are .. well
>> stable - with warts and all :-)
> 
> Got it. I'll record "xen/stable/.*" as non-rebaseable branches.
> 
>>> please let me know and I'll ignore such interim errors on it in
>>> future.
>> 
>> I think this is OK. I don't mind seeing such errors.
> 
> Thanks!
> 
> Cheers,
> Fengguang

Thanks Konrad and Fengguang!

Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 10:37:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 10:37:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te1Ug-0007lG-QE; Thu, 29 Nov 2012 10:37:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1Te1Uf-0007lB-Qo
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 10:37:22 +0000
Received: from [85.158.143.35:23348] by server-1.bemta-4.messagelabs.com id
	7F/8B-27934-1EA37B05; Thu, 29 Nov 2012 10:37:21 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354185438!12607379!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjM0NDc0\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20816 invoked from network); 29 Nov 2012 10:37:19 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-12.tower-21.messagelabs.com with SMTP;
	29 Nov 2012 10:37:19 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga101.ch.intel.com with ESMTP; 29 Nov 2012 02:37:16 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,184,1355126400"; d="scan'208";a="224181082"
Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37])
	by azsmga001.ch.intel.com with ESMTP; 29 Nov 2012 02:37:13 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 29 Nov 2012 02:37:13 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Thu, 29 Nov 2012 18:37:12 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: "Wu, Fengguang" <fengguang.wu@intel.com>, Konrad Rzeszutek Wilk
	<konrad.wilk@oracle.com>
Thread-Topic: [xen:stable/for-linus-3.8 4/8]
	include/xen/interface/version.h:72:2: error: implicit declaration of
	function 'xen_domain'
Thread-Index: AQHNzd+/UzB8MkZYS0GLvYEMNz1RAJgAnxnQ
Date: Thu, 29 Nov 2012 10:37:11 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233539A030@SHSMSX101.ccr.corp.intel.com>
References: <50b68452.Gqr1L/cRkHFh1xmK%fengguang.wu@intel.com>
	<20121128221510.GA29950@phenom.dumpdata.com>
	<20121129022125.GG5785@localhost>
	<20121129030838.GA22724@phenom.dumpdata.com>
	<20121129031459.GA9355@localhost>
In-Reply-To: <20121129031459.GA9355@localhost>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [xen:stable/for-linus-3.8 4/8]
 include/xen/interface/version.h:72:2: error: implicit declaration of
 function 'xen_domain'
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Wu, Fengguang wrote:
> On Wed, Nov 28, 2012 at 10:08:38PM -0500, Konrad Rzeszutek Wilk wrote:
>> On Thu, Nov 29, 2012 at 10:21:25AM +0800, Fengguang Wu wrote:
>>> On Wed, Nov 28, 2012 at 05:15:10PM -0500, Konrad Rzeszutek Wilk
>>> wrote: 
>>>> On Thu, Nov 29, 2012 at 05:38:26AM +0800, kbuild test robot wrote:
>>>>> tree:  
>>>>> git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
>>>>> stable/for-linus-3.8  
>>>>> head:   394b40f62d7ae18a1c48c13fc483b8193f8c3a98
>>>>> commit: 92e3229dcdc80ff0b6304f14c578d76e7e10e226 [4/8] xen/acpi:
>>>>> ACPI PAD driver 
>>>>> config: x86_64-randconfig-x701 (attached as .config)
>>>>> 
>>>>> Note: the xen/stable/for-linus-3.8 HEAD 394b40f builds fine.
>>>>>       It only hurts bisectibility.
>>>>> 
>>>>> All error/warnings:
>>>>> 
>>>>> In file included from drivers/xen/features.c:15:0:
>>>>> include/xen/interface/version.h: In function
>>>>> 'xen_running_on_version_or_later': 
>>>>> include/xen/interface/version.h:72:2: error: implicit declaration
>>>>> of function 'xen_domain' [-Werror=implicit-function-declaration]
>>>>> cc1: some warnings being treated as errors 
>>>> 
>>>> Which are fixed a bit later by me.
>>> 
>>> Yes, see the above note: "HEAD 394b40f builds fine. It only hurts
>>> bisectibility." 
>>> 
>>> It still creates a range of not-bisectable commits due to the build
>>> error. So the report was sent out, hoping that the branch can be
>>> rebased to remove the error completely.
>>> 
>>> However if you've decided that this tree won't do rebase at all,
>> 
>> Not that one. The 'devel' ones are OK, but the 'stable' are .. well
>> stable - with warts and all :-)
> 
> Got it. I'll record "xen/stable/.*" as non-rebaseable branches.
> 
>>> please let me know and I'll ignore such interim errors on it in
>>> future.
>> 
>> I think this is OK. I don't mind seeing such errors.
> 
> Thanks!
> 
> Cheers,
> Fengguang

Thanks Konrad and Fengguang!

Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 10:41:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 10:41:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te1Xz-0007s9-3w; Thu, 29 Nov 2012 10:40:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te1Xx-0007rv-QC
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 10:40:46 +0000
Received: from [85.158.139.211:7479] by server-2.bemta-5.messagelabs.com id
	68/B7-04892-CAB37B05; Thu, 29 Nov 2012 10:40:44 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354185643!18361800!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5094 invoked from network); 29 Nov 2012 10:40:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 10:40:44 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16065363"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 10:40:43 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 10:40:42 +0000
Message-ID: <1354185641.25834.126.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 29 Nov 2012 10:40:41 +0000
In-Reply-To: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 15:21 +0000, Stefano Stabellini wrote:
> Get the address of the GIC distributor, cpu, virtual and virtual cpu
> interfaces registers from device tree.
> 
> 
> Note: I couldn't completely get rid of GIC_BASE_ADDRESS, GIC_DR_OFFSET
> and friends because we are using them from mode_switch.S, that is
> executed before device tree has been parsed. But at least mode_switch.S
> is known to contain vexpress specific code anyway.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

I've a few comments on mostly pre-existing things which I happened to
notice while reviewing this:

> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> index 0c6fab9..8efbeb3 100644
> --- a/xen/arch/arm/gic.c
> +++ b/xen/arch/arm/gic.c
> @@ -34,9 +35,9 @@
>  /* Access to the GIC Distributor registers through the fixmap */
>  #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))

There's an implicit assumption here that the GICD is correctly aligned
-- I suspect it really ought to be handled like the others... but...

>  #define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
> -                                     + (GIC_CR_OFFSET & 0xfff)))
> +                                     + ((uint32_t) gic.cbase & 0xfff)))
>  #define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
> -                                     + (GIC_HR_OFFSET & 0xfff)))
> +                                     + ((uint32_t) gic.hbase & 0xfff)))

... is there actually any chance of these being non-page aligned?

Also now that these are dynamic perhaps an actual variable initialised
at start of day would be better than a #define?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 10:41:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 10:41:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te1Xz-0007s9-3w; Thu, 29 Nov 2012 10:40:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te1Xx-0007rv-QC
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 10:40:46 +0000
Received: from [85.158.139.211:7479] by server-2.bemta-5.messagelabs.com id
	68/B7-04892-CAB37B05; Thu, 29 Nov 2012 10:40:44 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354185643!18361800!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5094 invoked from network); 29 Nov 2012 10:40:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 10:40:44 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16065363"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 10:40:43 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 10:40:42 +0000
Message-ID: <1354185641.25834.126.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 29 Nov 2012 10:40:41 +0000
In-Reply-To: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-23 at 15:21 +0000, Stefano Stabellini wrote:
> Get the address of the GIC distributor, cpu, virtual and virtual cpu
> interfaces registers from device tree.
> 
> 
> Note: I couldn't completely get rid of GIC_BASE_ADDRESS, GIC_DR_OFFSET
> and friends because we are using them from mode_switch.S, that is
> executed before device tree has been parsed. But at least mode_switch.S
> is known to contain vexpress specific code anyway.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

I've a few comments on mostly pre-existing things which I happened to
notice while reviewing this:

> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> index 0c6fab9..8efbeb3 100644
> --- a/xen/arch/arm/gic.c
> +++ b/xen/arch/arm/gic.c
> @@ -34,9 +35,9 @@
>  /* Access to the GIC Distributor registers through the fixmap */
>  #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))

There's an implicit assumption here that the GICD is correctly aligned
-- I suspect it really ought to be handled like the others... but...

>  #define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
> -                                     + (GIC_CR_OFFSET & 0xfff)))
> +                                     + ((uint32_t) gic.cbase & 0xfff)))
>  #define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
> -                                     + (GIC_HR_OFFSET & 0xfff)))
> +                                     + ((uint32_t) gic.hbase & 0xfff)))

... is there actually any chance of these being non-page aligned?

Also now that these are dynamic perhaps an actual variable initialised
at start of day would be better than a #define?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 10:50:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 10:50:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te1gh-0008LC-4l; Thu, 29 Nov 2012 10:49:47 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te1gf-0008L4-QN
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 10:49:46 +0000
Received: from [193.109.254.147:45307] by server-6.bemta-14.messagelabs.com id
	37/09-02788-9CD37B05; Thu, 29 Nov 2012 10:49:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1354186184!1938347!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19775 invoked from network); 29 Nov 2012 10:49:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 10:49:44 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16065589"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 10:49:44 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 10:49:44 +0000
Message-ID: <1354186182.25834.131.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Date: Thu, 29 Nov 2012 10:49:42 +0000
In-Reply-To: <1354010620-31788-2-git-send-email-roger.pau@citrix.com>
References: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
	<1354010620-31788-2-git-send-email-roger.pau@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] docs: expand persistent grants protocol
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVHVlLCAyMDEyLTExLTI3IGF0IDEwOjAzICswMDAwLCBSb2dlciBQYXUgTW9ubmUgd3JvdGU6
Cj4gU2lnbmVkLW9mZi1ieTogUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+
Cj4gLS0tCj4gIHhlbi9pbmNsdWRlL3B1YmxpYy9pby9ibGtpZi5oIHwgICAyNCArKysrKysrKysr
KysrKysrKysrKystLS0KPiAgMSBmaWxlcyBjaGFuZ2VkLCAyMSBpbnNlcnRpb25zKCspLCAzIGRl
bGV0aW9ucygtKQo+IAo+IGRpZmYgLS1naXQgYS94ZW4vaW5jbHVkZS9wdWJsaWMvaW8vYmxraWYu
aCBiL3hlbi9pbmNsdWRlL3B1YmxpYy9pby9ibGtpZi5oC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19fX19fX19fX19fX19fX19f
X19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpo
dHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Thu Nov 29 10:50:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 10:50:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te1gh-0008LC-4l; Thu, 29 Nov 2012 10:49:47 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te1gf-0008L4-QN
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 10:49:46 +0000
Received: from [193.109.254.147:45307] by server-6.bemta-14.messagelabs.com id
	37/09-02788-9CD37B05; Thu, 29 Nov 2012 10:49:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1354186184!1938347!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19775 invoked from network); 29 Nov 2012 10:49:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 10:49:44 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16065589"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 10:49:44 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 10:49:44 +0000
Message-ID: <1354186182.25834.131.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Date: Thu, 29 Nov 2012 10:49:42 +0000
In-Reply-To: <1354010620-31788-2-git-send-email-roger.pau@citrix.com>
References: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
	<1354010620-31788-2-git-send-email-roger.pau@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] docs: expand persistent grants protocol
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVHVlLCAyMDEyLTExLTI3IGF0IDEwOjAzICswMDAwLCBSb2dlciBQYXUgTW9ubmUgd3JvdGU6
Cj4gU2lnbmVkLW9mZi1ieTogUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+
Cj4gLS0tCj4gIHhlbi9pbmNsdWRlL3B1Ym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gKiAgICAgZHVlIHRvIHRoZSBmcm9u
dGVudCBkcml2ZXIgaW1wbGVtZW50YXRpb24gaXQgc2hvdWxkIG5ldmVyIGJlIGJpZ2dlcgo+ICsg
KiAgICAgdGhhbiBSSU5HX1NJWkUgKiBCTEtJRl9NQVhfU0VHTUVOVFNfUEVSX1JFUVVFU1QuCj4g
ICAqLwo+ICAKPiAgLyoKCgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpo
dHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Thu Nov 29 10:57:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 10:57:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te1nq-0000XX-HL; Thu, 29 Nov 2012 10:57:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1Te1np-0000XK-Cu
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 10:57:09 +0000
Received: from [85.158.137.99:6108] by server-1.bemta-3.messagelabs.com id
	FF/B5-12169-48F37B05; Thu, 29 Nov 2012 10:57:08 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354186594!17161076!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc4MDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7219 invoked from network); 29 Nov 2012 10:56:35 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 10:56:35 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="215850599"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 10:56:33 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 05:56:33 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1Te1nE-0004ap-Pb;
	Thu, 29 Nov 2012 10:56:32 +0000
Message-ID: <50B73E0A.1080600@eu.citrix.com>
Date: Thu, 29 Nov 2012 10:50:50 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <d3378692eece3e552ba2.1353630328@ljsromley.bj.intel.com>
	<CAFLBxZZ_W5PMLYiqEwdrpqkjgiMN9NoN2f33ErLriOwNOD9GgA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353996FF@SHSMSX101.ccr.corp.intel.com>
	<1354183356.25834.108.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354183356.25834.108.camel@zakaz.uk.xensource.com>
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 29/11/12 10:02, Ian Campbell wrote:
> On Wed, 2012-11-28 at 14:37 +0000, Liu, Jinsong wrote:
>> Ping?
> Sorry I've been meaning to reply but didn't manage to yet. Also you
> replied to V4 saying to ignore it, so I was half waiting for V5 but I
> see this should actually be labelled V5 anyway.
>
> I'm afraid I still don't fully grok the reason for the loop that goes
> with:
> +            /*
> +             * At the last iter, count the number of broken pages after sending,
> +             * and if there are more than before sending, do one or more iter
> +             * to make sure the pages are marked broken on the receiving side.
> +             */
>
> Can we go through it one more time? Sorry.
>
> Let me outline the sequence of events and you can point out where I'm
> going wrong. I'm afraid this has turned out to be rather long, again I'm
> sorry for that.
>
> First we do some number of iterations with the guest live. If an MCE
> occurs during this phase then the page will be marked dirty and we will
> pick this up on the next iteration and resend the page with the dirty
> type etc and all is fine. This all looks good to me, so we don't need to
> worry about anything at this stage.
>
> Eventually we get to the last iteration, at which point we pause the
> guest. From here on in the guest itself is not going to cause an MCE
> (e.g. by touching its RAM) because it is not running but we must still
> account for the possibility of an asynchronous MCE of some sort e.g.
> triggered by the error detection mechanisms in the hardware, cosmic rays
> and such like.
>
> The final iteration proceeds roughly as follows.
>
>       1. The domain is paused
>       2. We scan the dirty bitmap and add dirty pages to the batch of
>          pages to process (there may be several batches in the last
>          iteration, we only need to concern ourselves with any one batch
>          here).
>       3. We map all of the pages in the resulting batch with
>          xc_map_foreign_bulk
>       4. We query the types of all the pages in the batch with
>          xc_get_pfn_type_batch
>       5. We iterate over the batch, checking the type of each page, in
>          some cases we do some incidental processing.
>       6. We send the types of the pages in the batch over the wire.
>       7. We iterate over the batch again, and send any normal page (not
>          broken, xtab etc) over the wire. Actually we do this as runs of
>          normal pages, but the key point is we avoid touching any special
>          page (including ones marked as broken by #4)
>
> Is this sequence of events accurate?
>
> Now lets consider the consequences of an MCE occurring at various stages
> here.
>
> Any MCE which happens before #4 is fine, we will pick that up in #4 and
> the following steps will do the right thing.
>
> Note that I am assuming that the mapping step in #3 is safe even for a
> broken page, so long as we don't actually try and use the mapping (more
> on that later), is this true?
>
> If an MCE occurs after #4 then the page will be marked as dirty in the
> bitmap and Xen will internally mark it as broken, but we won't see
> either of those with the current algorithm. There are two cases to think
> about here AFAICT,
>       A. The page was not already dirty at #2. In this case we know that
>          the guest hasn't dirtied the page since the previous iteration
>          and therefore the target has a good copy of this page from that
>          time. The page isn't even in the batch we are processing So we
>          don't particularly care about the MCE here and can, from the PoV
>          of migrating this guest, ignore it.
>       B. The page was already dirty (but not broken, we handled that case
>          above in "Any MCE which happens before #4...") at #2 which means
>          we have do not have an up to date copy on the target. This has
>          two subcases:
>               I. The MCE occurs before (or during) #6 (sending the page)
>                  and therefore we do not have a good up to date copy of
>                  that data at either end.
>              II. The MCE occurs after #6, in which case we already have a
>                  good copy at the target end.
>
> To fix B you have added an 8th step to the above:
>
>          8. Query the types of the pages again, using
>          xc_get_pfn_type_batch, and if there are more pages dirty now
>          than we say at #4 (actually #5 when we scanned the array, but
>          that distinction doesn't matter) then a new MCE must have
>          occurred. Go back to #2 and try again.
>
> This won't do anything for A since the page wasn't in the batch to start
> with and so neither #4 or #8 will look at its type, this is good and
> proper.
>
> So now we consider the two subcases of B. Lets consider B.II first since
> it seems to be the more obvious case.
>
> In case B.II the target end already has a good copy of the data page,
> there is no need to mark the page as broken on the far end, nor to
> arrange for a vMCE to be injected. I don't know if/how we arrange for
> vMCEs to be injected under these circumstances, however even if a vMCE
> does get injected into the guest when it eventually gets unpaused on the
> target then all that will happen is that it will needlessly throw away a
> good page. However this is a rare corner case which is not worth
> concerning ourselves with (it's largely indistinguishable from case A).
> If the MCE had happened even a single cycle earlier then this would have
> been a B.I event instead of a B.II one. In any case there is no need to
> return to #2 and try again, everything will be just fine if we complete
> the migration at this point.
>
> In case B.I the MCE occurs before (or while) we send the page onto the
> wire. We will therefore try to read from this page because we haven't
> looked at the type since #4 and have no idea that it is now broken.
> Reading from the broken page will cause a fault, perhaps causing a vMCE
> to be delivered to dom0, which causes the kernel to kill the process
> doing the migration. Or maybe it kills dom0 or the host entirely. Either
> way the idea of looping again is rather moot.
>
> Have I missed a case which needs thinking about?
>
> I suspect B.I is the case where you are most likely to find a flaw in my
> argument. Is there something else which is done in this case which would
> allow us to continue?

I think your analysis is correct -- the only question is whether B.I 
will 100% cause the migration to crash, or whether there's a chance of 
not crashing on the read.  I had tried to ask that question before, and 
understood Jinsong's response to be that it's not 100% sure that the 
read would cause an error.  However, looking back at the thread, I think 
I may have understood something that was not there. :-)

So I guess the question for Jinsong is this:

The only time this extra loop could help is if there is a page broken 
after being paused but before being sent the last time (B.I in Ian's 
analysis) -- in which case, the migration code is 100% guaranteed to 
read a now-broken page.  What are the chances that this read of a broken 
page will *not* cause a fault which will kill at least the migration 
process, if not dom0?  If the chances are "slim-to-none", then there is 
no point for the extra check.

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 10:57:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 10:57:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te1nq-0000XX-HL; Thu, 29 Nov 2012 10:57:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1Te1np-0000XK-Cu
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 10:57:09 +0000
Received: from [85.158.137.99:6108] by server-1.bemta-3.messagelabs.com id
	FF/B5-12169-48F37B05; Thu, 29 Nov 2012 10:57:08 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354186594!17161076!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc4MDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7219 invoked from network); 29 Nov 2012 10:56:35 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 10:56:35 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="215850599"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 10:56:33 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 05:56:33 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1Te1nE-0004ap-Pb;
	Thu, 29 Nov 2012 10:56:32 +0000
Message-ID: <50B73E0A.1080600@eu.citrix.com>
Date: Thu, 29 Nov 2012 10:50:50 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <d3378692eece3e552ba2.1353630328@ljsromley.bj.intel.com>
	<CAFLBxZZ_W5PMLYiqEwdrpqkjgiMN9NoN2f33ErLriOwNOD9GgA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353996FF@SHSMSX101.ccr.corp.intel.com>
	<1354183356.25834.108.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354183356.25834.108.camel@zakaz.uk.xensource.com>
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 29/11/12 10:02, Ian Campbell wrote:
> On Wed, 2012-11-28 at 14:37 +0000, Liu, Jinsong wrote:
>> Ping?
> Sorry I've been meaning to reply but didn't manage to yet. Also you
> replied to V4 saying to ignore it, so I was half waiting for V5 but I
> see this should actually be labelled V5 anyway.
>
> I'm afraid I still don't fully grok the reason for the loop that goes
> with:
> +            /*
> +             * At the last iter, count the number of broken pages after sending,
> +             * and if there are more than before sending, do one or more iter
> +             * to make sure the pages are marked broken on the receiving side.
> +             */
>
> Can we go through it one more time? Sorry.
>
> Let me outline the sequence of events and you can point out where I'm
> going wrong. I'm afraid this has turned out to be rather long, again I'm
> sorry for that.
>
> First we do some number of iterations with the guest live. If an MCE
> occurs during this phase then the page will be marked dirty and we will
> pick this up on the next iteration and resend the page with the dirty
> type etc and all is fine. This all looks good to me, so we don't need to
> worry about anything at this stage.
>
> Eventually we get to the last iteration, at which point we pause the
> guest. From here on in the guest itself is not going to cause an MCE
> (e.g. by touching its RAM) because it is not running but we must still
> account for the possibility of an asynchronous MCE of some sort e.g.
> triggered by the error detection mechanisms in the hardware, cosmic rays
> and such like.
>
> The final iteration proceeds roughly as follows.
>
>       1. The domain is paused
>       2. We scan the dirty bitmap and add dirty pages to the batch of
>          pages to process (there may be several batches in the last
>          iteration, we only need to concern ourselves with any one batch
>          here).
>       3. We map all of the pages in the resulting batch with
>          xc_map_foreign_bulk
>       4. We query the types of all the pages in the batch with
>          xc_get_pfn_type_batch
>       5. We iterate over the batch, checking the type of each page, in
>          some cases we do some incidental processing.
>       6. We send the types of the pages in the batch over the wire.
>       7. We iterate over the batch again, and send any normal page (not
>          broken, xtab etc) over the wire. Actually we do this as runs of
>          normal pages, but the key point is we avoid touching any special
>          page (including ones marked as broken by #4)
>
> Is this sequence of events accurate?
>
> Now lets consider the consequences of an MCE occurring at various stages
> here.
>
> Any MCE which happens before #4 is fine, we will pick that up in #4 and
> the following steps will do the right thing.
>
> Note that I am assuming that the mapping step in #3 is safe even for a
> broken page, so long as we don't actually try and use the mapping (more
> on that later), is this true?
>
> If an MCE occurs after #4 then the page will be marked as dirty in the
> bitmap and Xen will internally mark it as broken, but we won't see
> either of those with the current algorithm. There are two cases to think
> about here AFAICT,
>       A. The page was not already dirty at #2. In this case we know that
>          the guest hasn't dirtied the page since the previous iteration
>          and therefore the target has a good copy of this page from that
>          time. The page isn't even in the batch we are processing So we
>          don't particularly care about the MCE here and can, from the PoV
>          of migrating this guest, ignore it.
>       B. The page was already dirty (but not broken, we handled that case
>          above in "Any MCE which happens before #4...") at #2 which means
>          we have do not have an up to date copy on the target. This has
>          two subcases:
>               I. The MCE occurs before (or during) #6 (sending the page)
>                  and therefore we do not have a good up to date copy of
>                  that data at either end.
>              II. The MCE occurs after #6, in which case we already have a
>                  good copy at the target end.
>
> To fix B you have added an 8th step to the above:
>
>          8. Query the types of the pages again, using
>          xc_get_pfn_type_batch, and if there are more pages dirty now
>          than we say at #4 (actually #5 when we scanned the array, but
>          that distinction doesn't matter) then a new MCE must have
>          occurred. Go back to #2 and try again.
>
> This won't do anything for A since the page wasn't in the batch to start
> with and so neither #4 or #8 will look at its type, this is good and
> proper.
>
> So now we consider the two subcases of B. Lets consider B.II first since
> it seems to be the more obvious case.
>
> In case B.II the target end already has a good copy of the data page,
> there is no need to mark the page as broken on the far end, nor to
> arrange for a vMCE to be injected. I don't know if/how we arrange for
> vMCEs to be injected under these circumstances, however even if a vMCE
> does get injected into the guest when it eventually gets unpaused on the
> target then all that will happen is that it will needlessly throw away a
> good page. However this is a rare corner case which is not worth
> concerning ourselves with (it's largely indistinguishable from case A).
> If the MCE had happened even a single cycle earlier then this would have
> been a B.I event instead of a B.II one. In any case there is no need to
> return to #2 and try again, everything will be just fine if we complete
> the migration at this point.
>
> In case B.I the MCE occurs before (or while) we send the page onto the
> wire. We will therefore try to read from this page because we haven't
> looked at the type since #4 and have no idea that it is now broken.
> Reading from the broken page will cause a fault, perhaps causing a vMCE
> to be delivered to dom0, which causes the kernel to kill the process
> doing the migration. Or maybe it kills dom0 or the host entirely. Either
> way the idea of looping again is rather moot.
>
> Have I missed a case which needs thinking about?
>
> I suspect B.I is the case where you are most likely to find a flaw in my
> argument. Is there something else which is done in this case which would
> allow us to continue?

I think your analysis is correct -- the only question is whether B.I 
will 100% cause the migration to crash, or whether there's a chance of 
not crashing on the read.  I had tried to ask that question before, and 
understood Jinsong's response to be that it's not 100% sure that the 
read would cause an error.  However, looking back at the thread, I think 
I may have understood something that was not there. :-)

So I guess the question for Jinsong is this:

The only time this extra loop could help is if there is a page broken 
after being paused but before being sent the last time (B.I in Ian's 
analysis) -- in which case, the migration code is 100% guaranteed to 
read a now-broken page.  What are the chances that this read of a broken 
page will *not* cause a fault which will kill at least the migration 
process, if not dom0?  If the chances are "slim-to-none", then there is 
no point for the extra check.

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:07:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:07:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te1x8-0000xH-Js; Thu, 29 Nov 2012 11:06:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te1x6-0000x5-Nk
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 11:06:44 +0000
Received: from [85.158.137.99:24342] by server-12.bemta-3.messagelabs.com id
	EA/21-22757-3C147B05; Thu, 29 Nov 2012 11:06:43 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1354187203!16278548!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4680 invoked from network); 29 Nov 2012 11:06:43 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:06:43 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16066067"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:06:41 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 11:06:41 +0000
Message-ID: <1354187200.25834.143.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Date: Thu, 29 Nov 2012 11:06:40 +0000
In-Reply-To: <CAFLBxZb_YwCaDAUU4pqkzbdNF0D1rFDoELVZadunt3cr3v5Tig@mail.gmail.com>
References: <patchbomb.1354104964@elijah>
	<e87d8fad28e00090591b.1354104966@elijah>
	<20121128151119.GC8912@reaktio.net>
	<CAFLBxZb_YwCaDAUU4pqkzbdNF0D1rFDoELVZadunt3cr3v5Tig@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 2 of 2] xl: Accept a list for usbdevice in
 config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gV2VkLCAyMDEyLTExLTI4IGF0IDE2OjUyICswMDAwLCBHZW9yZ2UgRHVubGFwIHdyb3RlOgo+
IE9uIFdlZCwgTm92IDI4LCAyMDEyIGF0IDM6MTEgUE0sIFBhc2kgS8Okcmtrw6RpbmVuIDxwYXNp
a0Bpa2kuZmk+IHdyb3RlOgo+ICAgICAgICAgT24gV2VkLCBOb3YgMjgsIDIwMTIgYXQgMTI6MTY6
MDZQTSArMDAwMCwgR2VvcmdlIER1bmxhcCB3cm90ZToKPiAgICAgICAgID4gIyBIRyBjaGFuZ2Vz
ZXQgcGF0Y2gKPiAgICAgICAgID4gIyBVc2VyIEdlb3JnZSBEdW5sYXAgPGdlb3JnZS5kdW5sYXBA
ZXUuY2l0cml4LmNvbT4KPiAgICAgICAgID4gIyBEYXRlIDEzNTQxMDQ4NTEgMAo+ICAgICAgICAg
PiAjIE5vZGUgSUQgZTg3ZDhmYWQyOGUwMDA5MDU5MWI2NWIyNjgyZGVhOTExMmY4ODMwZAo+ICAg
ICAgICAgPiAjIFBhcmVudCAgNTM4ZDlmZmJkNzFiNDFlOGNmNmQ3ZGEwZGVkOWUwYTBiMDdmM2Mw
ZAo+ICAgICAgICAgPiB4bDogQWNjZXB0IGEgbGlzdCBmb3IgdXNiZGV2aWNlIGluIGNvbmZpZyBm
aWxlCj4gICAgICAgICA+Cj4gICAgICAgICA+IEFsbG93IHRoZSAidXNiZGV2aWNlIiBrZXkgdG8g
YWNjZXB0IGEgbGlzdCBvZiBVU0IgZGV2aWNlcywKPiAgICAgICAgIGFuZCBwYXNzCj4gICAgICAg
ICA+IHRoZW0gaW4gdXNpbmcgdGhlIG5ldyB1c2JkZXZpY2VfbGlzdCBkb21haW4gYnVpbGQgZ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GljaCBtaWdodCBz
dWZmaWNlIGhlcmU/CgpJYW4uCgoKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxpc3RzLnhlbi5v
cmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:07:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:07:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te1x8-0000xH-Js; Thu, 29 Nov 2012 11:06:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te1x6-0000x5-Nk
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 11:06:44 +0000
Received: from [85.158.137.99:24342] by server-12.bemta-3.messagelabs.com id
	EA/21-22757-3C147B05; Thu, 29 Nov 2012 11:06:43 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1354187203!16278548!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4680 invoked from network); 29 Nov 2012 11:06:43 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:06:43 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16066067"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:06:41 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 11:06:41 +0000
Message-ID: <1354187200.25834.143.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Date: Thu, 29 Nov 2012 11:06:40 +0000
In-Reply-To: <CAFLBxZb_YwCaDAUU4pqkzbdNF0D1rFDoELVZadunt3cr3v5Tig@mail.gmail.com>
References: <patchbomb.1354104964@elijah>
	<e87d8fad28e00090591b.1354104966@elijah>
	<20121128151119.GC8912@reaktio.net>
	<CAFLBxZb_YwCaDAUU4pqkzbdNF0D1rFDoELVZadunt3cr3v5Tig@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 2 of 2] xl: Accept a list for usbdevice in
 config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gV2VkLC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hlbi5v
cmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:07:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:07:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te1xM-0000ym-61; Thu, 29 Nov 2012 11:07:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te1xL-0000yZ-7L
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:06:59 +0000
Received: from [85.158.138.51:9927] by server-5.bemta-3.messagelabs.com id
	7A/DC-26311-2D147B05; Thu, 29 Nov 2012 11:06:58 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1354187112!28437872!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20341 invoked from network); 29 Nov 2012 11:05:12 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-2.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 11:05:12 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te1vV-000L6e-Dy; Thu, 29 Nov 2012 11:05:05 +0000
Date: Thu, 29 Nov 2012 11:05:05 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121129110505.GA80627@ocelot.phlegethon.org>
References: <50B5B48C.7040804@jp.fujitsu.com>
	<50B5DBD702000078000AC021@nat28.tlf.novell.com>
	<50B6B3AA.2080505@jp.fujitsu.com>
	<50B71C5302000078000AC5CE@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B71C5302000078000AC5CE@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Kouya Shimura <kouya@jp.fujitsu.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] x86/hap: Fix memory leak of
	domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 07:26 +0000 on 29 Nov (1354174019), Jan Beulich wrote:
> >>> On 29.11.12 at 02:00, Kouya Shimura <kouya@jp.fujitsu.com> wrote:
> > On 11/28/2012 05:39 PM, Jan Beulich wrote:
> >>>>> On 28.11.12 at 07:51, Kouya Shimura <kouya@jp.fujitsu.com> wrote:
> >>> This patch fixes the memory leak of domain->arch.hvm_domain.dirty_vram.
> >>>
> >>> Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
> >>
> >> Wouldn't it be more consistent (and less redundant) to do this
> >> through calling hap_track_dirty_vram(d, 0, 0, ...)? And even if
> >> not, the conditional around the freeing/clearing is pointless.
> > 
> >  From another point of view, it's consistent since it almost
> > copied from shadow_teardown()@xen/arch/x86/mm/shadow/common.c.
> > That is a sibling function of hap_teardown().
> > If it's not preferable, another cleanup patch should be made.
> 
> Tim will have the final say here anyway.

I have taken the conditional out but left it as an explicit free(). 
It might not always be safe to call hap_track_dirty_vram(), even for
disabling, this late in the teardown.

Thanks for the fix!

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:07:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:07:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te1xM-0000ym-61; Thu, 29 Nov 2012 11:07:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te1xL-0000yZ-7L
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:06:59 +0000
Received: from [85.158.138.51:9927] by server-5.bemta-3.messagelabs.com id
	7A/DC-26311-2D147B05; Thu, 29 Nov 2012 11:06:58 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1354187112!28437872!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20341 invoked from network); 29 Nov 2012 11:05:12 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-2.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 11:05:12 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te1vV-000L6e-Dy; Thu, 29 Nov 2012 11:05:05 +0000
Date: Thu, 29 Nov 2012 11:05:05 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121129110505.GA80627@ocelot.phlegethon.org>
References: <50B5B48C.7040804@jp.fujitsu.com>
	<50B5DBD702000078000AC021@nat28.tlf.novell.com>
	<50B6B3AA.2080505@jp.fujitsu.com>
	<50B71C5302000078000AC5CE@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B71C5302000078000AC5CE@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Kouya Shimura <kouya@jp.fujitsu.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] x86/hap: Fix memory leak of
	domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 07:26 +0000 on 29 Nov (1354174019), Jan Beulich wrote:
> >>> On 29.11.12 at 02:00, Kouya Shimura <kouya@jp.fujitsu.com> wrote:
> > On 11/28/2012 05:39 PM, Jan Beulich wrote:
> >>>>> On 28.11.12 at 07:51, Kouya Shimura <kouya@jp.fujitsu.com> wrote:
> >>> This patch fixes the memory leak of domain->arch.hvm_domain.dirty_vram.
> >>>
> >>> Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
> >>
> >> Wouldn't it be more consistent (and less redundant) to do this
> >> through calling hap_track_dirty_vram(d, 0, 0, ...)? And even if
> >> not, the conditional around the freeing/clearing is pointless.
> > 
> >  From another point of view, it's consistent since it almost
> > copied from shadow_teardown()@xen/arch/x86/mm/shadow/common.c.
> > That is a sibling function of hap_teardown().
> > If it's not preferable, another cleanup patch should be made.
> 
> Tim will have the final say here anyway.

I have taken the conditional out but left it as an explicit free(). 
It might not always be safe to call hap_track_dirty_vram(), even for
disabling, this late in the teardown.

Thanks for the fix!

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:08:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:08:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te1ye-0001A4-M1; Thu, 29 Nov 2012 11:08:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te1yd-00019r-GQ
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:08:19 +0000
Received: from [85.158.143.35:2763] by server-1.bemta-4.messagelabs.com id
	AF/2C-27934-22247B05; Thu, 29 Nov 2012 11:08:18 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1354187294!10374695!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22816 invoked from network); 29 Nov 2012 11:08:14 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:08:14 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16066124"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:08:05 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 11:08:05 +0000
Message-ID: <1354187284.25834.144.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Thu, 29 Nov 2012 11:08:04 +0000
In-Reply-To: <20121128202856.GA10257@type>
References: <20121128202856.GA10257@type>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [minios] Fix test application link when pcifront is
 not enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 20:28 +0000, Samuel Thibault wrote:
> When pcifront is not enabled, the test application needs to disable the
> PCI test.
> 
> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

I take it this is not built by default. Should it be?

Does something similar apply to the other *front ?

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:08:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:08:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te1ye-0001A4-M1; Thu, 29 Nov 2012 11:08:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te1yd-00019r-GQ
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:08:19 +0000
Received: from [85.158.143.35:2763] by server-1.bemta-4.messagelabs.com id
	AF/2C-27934-22247B05; Thu, 29 Nov 2012 11:08:18 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1354187294!10374695!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22816 invoked from network); 29 Nov 2012 11:08:14 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:08:14 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16066124"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:08:05 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 11:08:05 +0000
Message-ID: <1354187284.25834.144.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Thu, 29 Nov 2012 11:08:04 +0000
In-Reply-To: <20121128202856.GA10257@type>
References: <20121128202856.GA10257@type>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [minios] Fix test application link when pcifront is
 not enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 20:28 +0000, Samuel Thibault wrote:
> When pcifront is not enabled, the test application needs to disable the
> PCI test.
> 
> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

I take it this is not built by default. Should it be?

Does something similar apply to the other *front ?

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:14:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:14:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te247-0001Uh-HL; Thu, 29 Nov 2012 11:13:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1Te245-0001Uc-HT
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:13:57 +0000
Received: from [85.158.143.35:61000] by server-1.bemta-4.messagelabs.com id
	B0/35-27934-47347B05; Thu, 29 Nov 2012 11:13:56 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354187595!4879133!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8333 invoked from network); 29 Nov 2012 11:13:16 -0000
Received: from toccata.ens-lyon.org (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 11:13:16 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 77FCC8407F;
	Thu, 29 Nov 2012 12:13:15 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id 9v3LWfD-KrLR; Thu, 29 Nov 2012 12:13:15 +0100 (CET)
Received: from type.ipv6 (unknown [195.37.186.62])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id 17CDD8407D;
	Thu, 29 Nov 2012 12:13:15 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1Te23L-0004f9-JC; Thu, 29 Nov 2012 12:13:11 +0100
Date: Thu, 29 Nov 2012 12:13:11 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121129111311.GM5863@type.scc.kit.edu>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Keir (Xen.org)" <keir@xen.org>
References: <20121128202856.GA10257@type>
	<1354187284.25834.144.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354187284.25834.144.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [minios] Fix test application link when pcifront is
 not enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell, le Thu 29 Nov 2012 11:08:04 +0000, a =E9crit :
> On Wed, 2012-11-28 at 20:28 +0000, Samuel Thibault wrote:
> > When pcifront is not enabled, the test application needs to disable the
> > PCI test.
> > =

> > Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> =

> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> =

> I take it this is not built by default. Should it be?
> =

> Does something similar apply to the other *front ?

Ah, there are indeed *front macros which need handling indeed. I don't
know any reason for not enabling pcifront by default.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:14:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:14:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te247-0001Uh-HL; Thu, 29 Nov 2012 11:13:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1Te245-0001Uc-HT
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:13:57 +0000
Received: from [85.158.143.35:61000] by server-1.bemta-4.messagelabs.com id
	B0/35-27934-47347B05; Thu, 29 Nov 2012 11:13:56 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354187595!4879133!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8333 invoked from network); 29 Nov 2012 11:13:16 -0000
Received: from toccata.ens-lyon.org (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 11:13:16 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 77FCC8407F;
	Thu, 29 Nov 2012 12:13:15 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id 9v3LWfD-KrLR; Thu, 29 Nov 2012 12:13:15 +0100 (CET)
Received: from type.ipv6 (unknown [195.37.186.62])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id 17CDD8407D;
	Thu, 29 Nov 2012 12:13:15 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1Te23L-0004f9-JC; Thu, 29 Nov 2012 12:13:11 +0100
Date: Thu, 29 Nov 2012 12:13:11 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121129111311.GM5863@type.scc.kit.edu>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Keir (Xen.org)" <keir@xen.org>
References: <20121128202856.GA10257@type>
	<1354187284.25834.144.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354187284.25834.144.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [minios] Fix test application link when pcifront is
 not enabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell, le Thu 29 Nov 2012 11:08:04 +0000, a =E9crit :
> On Wed, 2012-11-28 at 20:28 +0000, Samuel Thibault wrote:
> > When pcifront is not enabled, the test application needs to disable the
> > PCI test.
> > =

> > Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> =

> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> =

> I take it this is not built by default. Should it be?
> =

> Does something similar apply to the other *front ?

Ah, there are indeed *front macros which need handling indeed. I don't
know any reason for not enabling pcifront by default.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:14:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:14:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te24W-0001Wm-31; Thu, 29 Nov 2012 11:14:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te24U-0001WW-S0
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:14:23 +0000
Received: from [85.158.139.83:53182] by server-3.bemta-5.messagelabs.com id
	6A/9B-18736-E8347B05; Thu, 29 Nov 2012 11:14:22 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1354187661!23649534!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22201 invoked from network); 29 Nov 2012 11:14:21 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:14:21 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16066318"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:14:21 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 11:14:21 +0000
Message-ID: <1354187659.25834.147.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Thu, 29 Nov 2012 11:14:19 +0000
In-Reply-To: <20121128215723.GA6109@type>
References: <20121128215723.GA6109@type>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [minios] Add xenbus shutdown control support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 21:57 +0000, Samuel Thibault wrote:
> Add a thread watching the xenbus shutdown control path and notifies a
> wait queue.

Why a wait queue rather than a weak function call?

> Add HYPERVISOR_shutdown convenient inline for minios shutdown.
> 
> Add proper shutdown to the minios test application.

The use of locks in here is pretty exciting, with the up/downs being
spread over various places, but I think I've worked it out and it's only
a test app ;-)

> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> 
> diff -r fdf241ea6ff4 extras/mini-os/include/kernel.h
> --- a/extras/mini-os/include/kernel.h	Wed Nov 28 21:29:18 2012 +0100
> +++ b/extras/mini-os/include/kernel.h	Wed Nov 28 22:53:42 2012 +0100
> @@ -1,6 +1,9 @@
>  #ifndef _KERNEL_H_
>  #define _KERNEL_H_
>  
> +extern unsigned int do_shutdown;
> +extern unsigned int shutdown_reason;
> +extern struct wait_queue_head shutdown_queue;
>  extern void do_exit(void) __attribute__((noreturn));
>  extern void stop_kernel(void);
>  
> diff -r fdf241ea6ff4 extras/mini-os/include/x86/x86_32/hypercall-x86_32.h
> --- a/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h	Wed Nov 28 21:29:18 2012 +0100
> +++ b/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h	Wed Nov 28 22:53:42 2012 +0100
> @@ -172,6 +172,14 @@
>  	return _hypercall2(int, sched_op, cmd, arg);
>  }
>  
> +static inline int
> +HYPERVISOR_shutdown(
> +	unsigned int reason)
> +{
> +	struct sched_shutdown shutdown = { .reason = reason };
> +	return _hypercall2(int, sched_op, SCHEDOP_shutdown, &shutdown);
> +}
> +
>  static inline long
>  HYPERVISOR_set_timer_op(
>  	uint64_t timeout)
> diff -r fdf241ea6ff4 extras/mini-os/include/x86/x86_64/hypercall-x86_64.h
> --- a/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h	Wed Nov 28 21:29:18 2012 +0100
> +++ b/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h	Wed Nov 28 22:53:42 2012 +0100
> @@ -176,6 +176,14 @@
>  	return _hypercall2(int, sched_op, cmd, arg);
>  }
>  
> +static inline int
> +HYPERVISOR_shutdown(
> +	unsigned int reason)
> +{
> +	struct sched_shutdown shutdown = { .reason = reason };
> +	return _hypercall2(int, sched_op, SCHEDOP_shutdown, &shutdown);
> +}
> +
>  static inline long
>  HYPERVISOR_set_timer_op(
>  	uint64_t timeout)
> diff -r fdf241ea6ff4 extras/mini-os/kernel.c
> --- a/extras/mini-os/kernel.c	Wed Nov 28 21:29:18 2012 +0100
> +++ b/extras/mini-os/kernel.c	Wed Nov 28 22:53:42 2012 +0100
> @@ -48,6 +48,10 @@
>  
>  uint8_t xen_features[XENFEAT_NR_SUBMAPS * 32];
>  
> +unsigned int do_shutdown = 0;
> +unsigned int shutdown_reason;
> +DECLARE_WAIT_QUEUE_HEAD(shutdown_queue);
> +
>  void setup_xen_features(void)
>  {
>      xen_feature_info_t fi;
> @@ -64,6 +68,36 @@
>      }
>  }
>  
> +static void shutdown_thread(void *p)
> +{
> +    const char *path = "control/shutdown";
> +    const char *token = path;
> +    xenbus_event_queue events = NULL;
> +    char *shutdown, *err;
> +    xenbus_watch_path_token(XBT_NIL, path, token, &events);
> +    while ((err = xenbus_read(XBT_NIL, path, &shutdown)) != NULL)
> +    {
> +        free(err);
> +        xenbus_wait_for_watch(&events);
> +    }
> +    xenbus_unwatch_path_token(XBT_NIL, path, token);
> +    xenbus_write(XBT_NIL, path, "");
> +    printk("Shutting down (%s)\n", shutdown);
> +
> +    if (!strcmp(shutdown, "poweroff"))
> +        shutdown_reason = SHUTDOWN_poweroff;
> +    else if (!strcmp(shutdown, "reboot"))
> +        shutdown_reason = SHUTDOWN_reboot;
> +    else
> +        /* Unknown */
> +        shutdown_reason = SHUTDOWN_crash;
> +    wmb();
> +    do_shutdown = 1;
> +    wmb();
> +    wake_up(&shutdown_queue);
> +}
> +
> +
>  /* This should be overridden by the application we are linked against. */
>  __attribute__((weak)) int app_main(start_info_t *si)
>  {
> @@ -126,6 +160,8 @@
>      /* Init XenBus */
>      init_xenbus();
>  
> +    create_thread("shutdown", shutdown_thread, NULL);
> +
>      /* Call (possibly overridden) app_main() */
>      app_main(&start_info);
>  
> diff -r fdf241ea6ff4 extras/mini-os/test.c
> --- a/extras/mini-os/test.c	Wed Nov 28 21:29:18 2012 +0100
> +++ b/extras/mini-os/test.c	Wed Nov 28 22:53:42 2012 +0100
> @@ -46,6 +46,7 @@
>  #include <xen/version.h>
>  
>  static struct netfront_dev *net_dev;
> +static struct semaphore net_sem = __SEMAPHORE_INITIALIZER(net_sem, 0);
>  
>  void test_xenbus(void);
>  
> @@ -70,12 +71,14 @@
>  static void netfront_thread(void *p)
>  {
>      net_dev = init_netfront(NULL, NULL, NULL, NULL);
> +    up(&net_sem);
>  }
>  
>  static struct blkfront_dev *blk_dev;
>  static struct blkfront_info blk_info;
>  static uint64_t blk_size_read;
>  static uint64_t blk_size_write;
> +static struct semaphore blk_sem = __SEMAPHORE_INITIALIZER(blk_sem, 0);;
>  
>  struct blk_req {
>      struct blkfront_aiocb aiocb;
> @@ -189,8 +192,10 @@
>      time_t lasttime = 0;
>  
>      blk_dev = init_blkfront(NULL, &blk_info);
> -    if (!blk_dev)
> +    if (!blk_dev) {
> +        up(&blk_sem);
>          return;
> +    }
>  
>      if (blk_info.info & VDISK_CDROM)
>          printk("Block device is a CDROM\n");
> @@ -210,7 +215,7 @@
>          blk_read_sector(blk_info.sectors-1);
>      }
>  
> -    while (1) {
> +    while (!do_shutdown) {
>          uint64_t sector = rand() % blk_info.sectors;
>          struct timeval tv;
>  #ifdef BLKTEST_WRITE
> @@ -235,6 +240,7 @@
>          }
>  #endif
>      }
> +    up(&blk_sem);
>  }
>  
>  #define WIDTH 800
> @@ -293,7 +299,6 @@
>      xfree(mfns);
>      if (!fb_dev) {
>          xfree(fb);
> -        return;
>      }
>      up(&fbfront_sem);
>  }
> @@ -330,17 +335,21 @@
>  }
>  
>  static struct kbdfront_dev *kbd_dev;
> +static struct semaphore kbd_sem = __SEMAPHORE_INITIALIZER(kbd_sem, 0);
>  static void kbdfront_thread(void *p)
>  {
>      DEFINE_WAIT(w);
>      DEFINE_WAIT(w2);
> +    DEFINE_WAIT(w3);
>      int x = WIDTH / 2, y = HEIGHT / 2, z = 0;
>  
>      kbd_dev = init_kbdfront(NULL, 1);
> -    if (!kbd_dev)
> +    down(&fbfront_sem);
> +    if (!kbd_dev) {
> +        up(&kbd_sem);
>          return;
> +    }
>  
> -    down(&fbfront_sem);
>      refresh_cursor(x, y);
>      while (1) {
>          union xenkbd_in_event kbdevent;
> @@ -349,6 +358,11 @@
>  
>          add_waiter(w, kbdfront_queue);
>          add_waiter(w2, fbfront_queue);
> +        add_waiter(w3, shutdown_queue);
> +
> +        rmb();
> +        if (do_shutdown)
> +            break;
>  
>          while (kbdfront_receive(kbd_dev, &kbdevent, 1) != 0) {
>              sleep = 0;
> @@ -391,9 +405,11 @@
>                          fbfront_update(fb_dev, x - 16, y - 16, 33, 33);
>                      }
>                  } else if (kbdevent.key.keycode == KEY_Q) {
> -                    struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_poweroff };
> -                    HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
> -                    do_exit();
> +                    shutdown_reason = SHUTDOWN_poweroff;
> +                    wmb();
> +                    do_shutdown = 1;
> +                    wmb();
> +                    wake_up(&shutdown_queue);
>                  }
>                  break;
>              }
> @@ -410,11 +426,16 @@
>          }
>          if (sleep)
>              schedule();
> +        remove_waiter(w3, shutdown_queue);
> +        remove_waiter(w2, fbfront_queue);
> +        remove_waiter(w, kbdfront_queue);
>      }
> +    up(&kbd_sem);
>  }
>  
>  #ifdef CONFIG_PCIFRONT
>  static struct pcifront_dev *pci_dev;
> +static struct semaphore pci_sem = __SEMAPHORE_INITIALIZER(pci_sem, 0);
>  
>  static void print_pcidev(unsigned int domain, unsigned int bus, unsigned int slot, unsigned int fun)
>  {
> @@ -432,13 +453,60 @@
>  {
>      pcifront_watches(NULL);
>      pci_dev = init_pcifront(NULL);
> -    if (!pci_dev)
> +    if (!pci_dev) {
> +        up(&pci_sem);
>          return;
> +    }
>      printk("PCI devices:\n");
>      pcifront_scan(pci_dev, print_pcidev);
> +    up(&pci_sem);
>  }
>  #endif
>  
> +void shutdown_frontends(void)
> +{
> +    down(&net_sem);
> +    if (net_dev)
> +        shutdown_netfront(net_dev);
> +
> +    down(&blk_sem);
> +    if (blk_dev)
> +        shutdown_blkfront(blk_dev);
> +
> +    if (fb_dev)
> +        shutdown_fbfront(fb_dev);
> +
> +    down(&kbd_sem);
> +    if (kbd_dev)
> +        shutdown_kbdfront(kbd_dev);
> +
> +#ifdef CONFIG_PCIFRONT
> +    down(&pci_sem);
> +    if (pci_dev)
> +        shutdown_pcifront(pci_dev);
> +#endif
> +}
> +
> +static void shutdown_thread(void *p)
> +{
> +    DEFINE_WAIT(w);
> +
> +    while (1) {
> +        add_waiter(w, shutdown_queue);
> +        rmb();
> +        if (do_shutdown) {
> +            rmb();
> +            break;
> +        }
> +        schedule();
> +        remove_waiter(w, shutdown_queue);
> +    }
> +
> +    shutdown_frontends();
> +
> +    HYPERVISOR_shutdown(shutdown_reason);
> +}
> +
>  int app_main(start_info_t *si)
>  {
>      printk("Test main: start_info=%p\n", si);
> @@ -451,25 +519,6 @@
>  #ifdef CONFIG_PCIFRONT
>      create_thread("pcifront", pcifront_thread, si);
>  #endif
> +    create_thread("shutdown", shutdown_thread, si);
>      return 0;
>  }
> -
> -void shutdown_frontends(void)
> -{
> -    if (net_dev)
> -        shutdown_netfront(net_dev);
> -
> -    if (blk_dev)
> -        shutdown_blkfront(blk_dev);
> -
> -    if (fb_dev)
> -        shutdown_fbfront(fb_dev);
> -
> -    if (kbd_dev)
> -        shutdown_kbdfront(kbd_dev);
> -
> -#ifdef CONFIG_PCIFRONT
> -    if (pci_dev)
> -        shutdown_pcifront(pci_dev);
> -#endif
> -}
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:14:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:14:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te24W-0001Wm-31; Thu, 29 Nov 2012 11:14:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te24U-0001WW-S0
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:14:23 +0000
Received: from [85.158.139.83:53182] by server-3.bemta-5.messagelabs.com id
	6A/9B-18736-E8347B05; Thu, 29 Nov 2012 11:14:22 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1354187661!23649534!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22201 invoked from network); 29 Nov 2012 11:14:21 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:14:21 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16066318"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:14:21 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 11:14:21 +0000
Message-ID: <1354187659.25834.147.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Thu, 29 Nov 2012 11:14:19 +0000
In-Reply-To: <20121128215723.GA6109@type>
References: <20121128215723.GA6109@type>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [minios] Add xenbus shutdown control support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 21:57 +0000, Samuel Thibault wrote:
> Add a thread watching the xenbus shutdown control path and notifies a
> wait queue.

Why a wait queue rather than a weak function call?

> Add HYPERVISOR_shutdown convenient inline for minios shutdown.
> 
> Add proper shutdown to the minios test application.

The use of locks in here is pretty exciting, with the up/downs being
spread over various places, but I think I've worked it out and it's only
a test app ;-)

> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> 
> diff -r fdf241ea6ff4 extras/mini-os/include/kernel.h
> --- a/extras/mini-os/include/kernel.h	Wed Nov 28 21:29:18 2012 +0100
> +++ b/extras/mini-os/include/kernel.h	Wed Nov 28 22:53:42 2012 +0100
> @@ -1,6 +1,9 @@
>  #ifndef _KERNEL_H_
>  #define _KERNEL_H_
>  
> +extern unsigned int do_shutdown;
> +extern unsigned int shutdown_reason;
> +extern struct wait_queue_head shutdown_queue;
>  extern void do_exit(void) __attribute__((noreturn));
>  extern void stop_kernel(void);
>  
> diff -r fdf241ea6ff4 extras/mini-os/include/x86/x86_32/hypercall-x86_32.h
> --- a/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h	Wed Nov 28 21:29:18 2012 +0100
> +++ b/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h	Wed Nov 28 22:53:42 2012 +0100
> @@ -172,6 +172,14 @@
>  	return _hypercall2(int, sched_op, cmd, arg);
>  }
>  
> +static inline int
> +HYPERVISOR_shutdown(
> +	unsigned int reason)
> +{
> +	struct sched_shutdown shutdown = { .reason = reason };
> +	return _hypercall2(int, sched_op, SCHEDOP_shutdown, &shutdown);
> +}
> +
>  static inline long
>  HYPERVISOR_set_timer_op(
>  	uint64_t timeout)
> diff -r fdf241ea6ff4 extras/mini-os/include/x86/x86_64/hypercall-x86_64.h
> --- a/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h	Wed Nov 28 21:29:18 2012 +0100
> +++ b/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h	Wed Nov 28 22:53:42 2012 +0100
> @@ -176,6 +176,14 @@
>  	return _hypercall2(int, sched_op, cmd, arg);
>  }
>  
> +static inline int
> +HYPERVISOR_shutdown(
> +	unsigned int reason)
> +{
> +	struct sched_shutdown shutdown = { .reason = reason };
> +	return _hypercall2(int, sched_op, SCHEDOP_shutdown, &shutdown);
> +}
> +
>  static inline long
>  HYPERVISOR_set_timer_op(
>  	uint64_t timeout)
> diff -r fdf241ea6ff4 extras/mini-os/kernel.c
> --- a/extras/mini-os/kernel.c	Wed Nov 28 21:29:18 2012 +0100
> +++ b/extras/mini-os/kernel.c	Wed Nov 28 22:53:42 2012 +0100
> @@ -48,6 +48,10 @@
>  
>  uint8_t xen_features[XENFEAT_NR_SUBMAPS * 32];
>  
> +unsigned int do_shutdown = 0;
> +unsigned int shutdown_reason;
> +DECLARE_WAIT_QUEUE_HEAD(shutdown_queue);
> +
>  void setup_xen_features(void)
>  {
>      xen_feature_info_t fi;
> @@ -64,6 +68,36 @@
>      }
>  }
>  
> +static void shutdown_thread(void *p)
> +{
> +    const char *path = "control/shutdown";
> +    const char *token = path;
> +    xenbus_event_queue events = NULL;
> +    char *shutdown, *err;
> +    xenbus_watch_path_token(XBT_NIL, path, token, &events);
> +    while ((err = xenbus_read(XBT_NIL, path, &shutdown)) != NULL)
> +    {
> +        free(err);
> +        xenbus_wait_for_watch(&events);
> +    }
> +    xenbus_unwatch_path_token(XBT_NIL, path, token);
> +    xenbus_write(XBT_NIL, path, "");
> +    printk("Shutting down (%s)\n", shutdown);
> +
> +    if (!strcmp(shutdown, "poweroff"))
> +        shutdown_reason = SHUTDOWN_poweroff;
> +    else if (!strcmp(shutdown, "reboot"))
> +        shutdown_reason = SHUTDOWN_reboot;
> +    else
> +        /* Unknown */
> +        shutdown_reason = SHUTDOWN_crash;
> +    wmb();
> +    do_shutdown = 1;
> +    wmb();
> +    wake_up(&shutdown_queue);
> +}
> +
> +
>  /* This should be overridden by the application we are linked against. */
>  __attribute__((weak)) int app_main(start_info_t *si)
>  {
> @@ -126,6 +160,8 @@
>      /* Init XenBus */
>      init_xenbus();
>  
> +    create_thread("shutdown", shutdown_thread, NULL);
> +
>      /* Call (possibly overridden) app_main() */
>      app_main(&start_info);
>  
> diff -r fdf241ea6ff4 extras/mini-os/test.c
> --- a/extras/mini-os/test.c	Wed Nov 28 21:29:18 2012 +0100
> +++ b/extras/mini-os/test.c	Wed Nov 28 22:53:42 2012 +0100
> @@ -46,6 +46,7 @@
>  #include <xen/version.h>
>  
>  static struct netfront_dev *net_dev;
> +static struct semaphore net_sem = __SEMAPHORE_INITIALIZER(net_sem, 0);
>  
>  void test_xenbus(void);
>  
> @@ -70,12 +71,14 @@
>  static void netfront_thread(void *p)
>  {
>      net_dev = init_netfront(NULL, NULL, NULL, NULL);
> +    up(&net_sem);
>  }
>  
>  static struct blkfront_dev *blk_dev;
>  static struct blkfront_info blk_info;
>  static uint64_t blk_size_read;
>  static uint64_t blk_size_write;
> +static struct semaphore blk_sem = __SEMAPHORE_INITIALIZER(blk_sem, 0);;
>  
>  struct blk_req {
>      struct blkfront_aiocb aiocb;
> @@ -189,8 +192,10 @@
>      time_t lasttime = 0;
>  
>      blk_dev = init_blkfront(NULL, &blk_info);
> -    if (!blk_dev)
> +    if (!blk_dev) {
> +        up(&blk_sem);
>          return;
> +    }
>  
>      if (blk_info.info & VDISK_CDROM)
>          printk("Block device is a CDROM\n");
> @@ -210,7 +215,7 @@
>          blk_read_sector(blk_info.sectors-1);
>      }
>  
> -    while (1) {
> +    while (!do_shutdown) {
>          uint64_t sector = rand() % blk_info.sectors;
>          struct timeval tv;
>  #ifdef BLKTEST_WRITE
> @@ -235,6 +240,7 @@
>          }
>  #endif
>      }
> +    up(&blk_sem);
>  }
>  
>  #define WIDTH 800
> @@ -293,7 +299,6 @@
>      xfree(mfns);
>      if (!fb_dev) {
>          xfree(fb);
> -        return;
>      }
>      up(&fbfront_sem);
>  }
> @@ -330,17 +335,21 @@
>  }
>  
>  static struct kbdfront_dev *kbd_dev;
> +static struct semaphore kbd_sem = __SEMAPHORE_INITIALIZER(kbd_sem, 0);
>  static void kbdfront_thread(void *p)
>  {
>      DEFINE_WAIT(w);
>      DEFINE_WAIT(w2);
> +    DEFINE_WAIT(w3);
>      int x = WIDTH / 2, y = HEIGHT / 2, z = 0;
>  
>      kbd_dev = init_kbdfront(NULL, 1);
> -    if (!kbd_dev)
> +    down(&fbfront_sem);
> +    if (!kbd_dev) {
> +        up(&kbd_sem);
>          return;
> +    }
>  
> -    down(&fbfront_sem);
>      refresh_cursor(x, y);
>      while (1) {
>          union xenkbd_in_event kbdevent;
> @@ -349,6 +358,11 @@
>  
>          add_waiter(w, kbdfront_queue);
>          add_waiter(w2, fbfront_queue);
> +        add_waiter(w3, shutdown_queue);
> +
> +        rmb();
> +        if (do_shutdown)
> +            break;
>  
>          while (kbdfront_receive(kbd_dev, &kbdevent, 1) != 0) {
>              sleep = 0;
> @@ -391,9 +405,11 @@
>                          fbfront_update(fb_dev, x - 16, y - 16, 33, 33);
>                      }
>                  } else if (kbdevent.key.keycode == KEY_Q) {
> -                    struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_poweroff };
> -                    HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
> -                    do_exit();
> +                    shutdown_reason = SHUTDOWN_poweroff;
> +                    wmb();
> +                    do_shutdown = 1;
> +                    wmb();
> +                    wake_up(&shutdown_queue);
>                  }
>                  break;
>              }
> @@ -410,11 +426,16 @@
>          }
>          if (sleep)
>              schedule();
> +        remove_waiter(w3, shutdown_queue);
> +        remove_waiter(w2, fbfront_queue);
> +        remove_waiter(w, kbdfront_queue);
>      }
> +    up(&kbd_sem);
>  }
>  
>  #ifdef CONFIG_PCIFRONT
>  static struct pcifront_dev *pci_dev;
> +static struct semaphore pci_sem = __SEMAPHORE_INITIALIZER(pci_sem, 0);
>  
>  static void print_pcidev(unsigned int domain, unsigned int bus, unsigned int slot, unsigned int fun)
>  {
> @@ -432,13 +453,60 @@
>  {
>      pcifront_watches(NULL);
>      pci_dev = init_pcifront(NULL);
> -    if (!pci_dev)
> +    if (!pci_dev) {
> +        up(&pci_sem);
>          return;
> +    }
>      printk("PCI devices:\n");
>      pcifront_scan(pci_dev, print_pcidev);
> +    up(&pci_sem);
>  }
>  #endif
>  
> +void shutdown_frontends(void)
> +{
> +    down(&net_sem);
> +    if (net_dev)
> +        shutdown_netfront(net_dev);
> +
> +    down(&blk_sem);
> +    if (blk_dev)
> +        shutdown_blkfront(blk_dev);
> +
> +    if (fb_dev)
> +        shutdown_fbfront(fb_dev);
> +
> +    down(&kbd_sem);
> +    if (kbd_dev)
> +        shutdown_kbdfront(kbd_dev);
> +
> +#ifdef CONFIG_PCIFRONT
> +    down(&pci_sem);
> +    if (pci_dev)
> +        shutdown_pcifront(pci_dev);
> +#endif
> +}
> +
> +static void shutdown_thread(void *p)
> +{
> +    DEFINE_WAIT(w);
> +
> +    while (1) {
> +        add_waiter(w, shutdown_queue);
> +        rmb();
> +        if (do_shutdown) {
> +            rmb();
> +            break;
> +        }
> +        schedule();
> +        remove_waiter(w, shutdown_queue);
> +    }
> +
> +    shutdown_frontends();
> +
> +    HYPERVISOR_shutdown(shutdown_reason);
> +}
> +
>  int app_main(start_info_t *si)
>  {
>      printk("Test main: start_info=%p\n", si);
> @@ -451,25 +519,6 @@
>  #ifdef CONFIG_PCIFRONT
>      create_thread("pcifront", pcifront_thread, si);
>  #endif
> +    create_thread("shutdown", shutdown_thread, si);
>      return 0;
>  }
> -
> -void shutdown_frontends(void)
> -{
> -    if (net_dev)
> -        shutdown_netfront(net_dev);
> -
> -    if (blk_dev)
> -        shutdown_blkfront(blk_dev);
> -
> -    if (fb_dev)
> -        shutdown_fbfront(fb_dev);
> -
> -    if (kbd_dev)
> -        shutdown_kbdfront(kbd_dev);
> -
> -#ifdef CONFIG_PCIFRONT
> -    if (pci_dev)
> -        shutdown_pcifront(pci_dev);
> -#endif
> -}
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:16:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:16:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te26k-0001gx-M5; Thu, 29 Nov 2012 11:16:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te26i-0001gn-TC
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 11:16:41 +0000
Received: from [85.158.137.99:14796] by server-1.bemta-3.messagelabs.com id
	53/E7-12169-81447B05; Thu, 29 Nov 2012 11:16:40 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354187799!17164927!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22139 invoked from network); 29 Nov 2012 11:16:39 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:16:39 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16066387"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:16:39 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 11:16:39 +0000
Message-ID: <1354187797.25834.148.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Thu, 29 Nov 2012 11:16:37 +0000
In-Reply-To: <538d9ffbd71b41e8cf6d.1354104965@elijah>
References: <patchbomb.1354104964@elijah>
	<538d9ffbd71b41e8cf6d.1354104965@elijah>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 1 of 2] libxl: Allow multiple USB devices on
 HVM domain creation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 12:16 +0000, George Dunlap wrote:
> # HG changeset patch
> # User George Dunlap <george.dunlap@eu.citrix.com>
> # Date 1354101445 0
> # Node ID 538d9ffbd71b41e8cf6d7da0ded9e0a0b07f3c0d
> # Parent  ae6fb202b233af815466055d9f1a635802a50855
> libxl: Allow multiple USB devices on HVM domain creation
> 
> This patch allows an HVM domain to be created with multiple USB
> devices.
> 
> Since the previous interface only allowed the passing of a single
> device, this requires us to add a new element to the hvm struct of
> libxl_domain_build_info -- usbdevice_list.  For API compatibility, the
> old element, usbdevice, remains.
> 
> If b_info->hvm.usbdevice is non-NULL, then it will be used exclusively;
> otherwise, libxl will check for b_info->hvm.usbdevice_list instead.

Is this the right way round? If the caller knows about usbdevice_list
enough to have set it to something then surely that's the one it wanted?

> Each device listed will cause an extra "-usbdevice [foo]" to be appended
> to the qemu command line.
> 
> In order to allow users of libxl to write software compatible with older
> versions of libxl, also define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST.  If
> this is present, the caller should use b_info->hvm.usbdevice_list; otherwise
> they should use b_info->hvm.usbdevice.

Actually it's a both stricter and looser than that, if
LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST is defined then the caller can
choose to use usbdevice_list but can also use usbdevice if they wish
(but not both). If it is not present then they must not use
usbdevice_list at all.

I wonder if this LIBXL_HAVE should also be contained in a #ifdef
LIBXL_API_VERSION >= 0x040300?

> 
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

> 
> diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
> --- a/tools/libxl/libxl.h
> +++ b/tools/libxl/libxl.h
> @@ -266,6 +266,23 @@
>  #endif
>  #endif
>  
> +/* 
> + * LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
> + * 
> + * If this is defined, then the libxl_domain_build_info structure will
> + * contain hvm.usbdevice_list, a libxl_string_list type that contains
> + * a list of USB devices to specify on the qemu command-line.
> + *
> + * If it is set, callers may use either hvm.usbdevice or
> + * hvm.usbdevice_list, but not both; if both are set, only
> + * hvm.usbdevice will be used.
> + *
> + * If this is not defined, callers should only use hvm.usbdevice.
> + * Note that this means only one device can be added at domain build
> + * time.
> + */
> +#define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST 1
> +
>  /* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
>   * called from within libxl itself. Callers outside libxl, who
>   * do not #include libxl_internal.h, are fine. */
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -191,6 +191,15 @@ static char ** libxl__build_device_model
>              if (b_info->u.hvm.usbdevice) {
>                  flexarray_vappend(dm_args,
>                                    "-usbdevice", b_info->u.hvm.usbdevice, NULL);
> +            } else if (b_info->u.hvm.usbdevice_list) {
> +                char **p;
> +                for (p = b_info->u.hvm.usbdevice_list;
> +                     *p;
> +                     p++) {
> +                    flexarray_vappend(dm_args,
> +                                      "-usbdevice",
> +                                      *p, NULL);
> +                }
>              }
>          }
>          if (b_info->u.hvm.soundhw) {
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -326,6 +326,7 @@ libxl_domain_build_info = Struct("domain
>                                         ("usbdevice",        string),
>                                         ("soundhw",          string),
>                                         ("xen_platform_pci", libxl_defbool),
> +                                       ("usbdevice_list",   libxl_string_list),
>                                         ])),
>                   ("pv", Struct(None, [("kernel", string),
>                                        ("slack_memkb", MemKB),
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:16:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:16:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te26k-0001gx-M5; Thu, 29 Nov 2012 11:16:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te26i-0001gn-TC
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 11:16:41 +0000
Received: from [85.158.137.99:14796] by server-1.bemta-3.messagelabs.com id
	53/E7-12169-81447B05; Thu, 29 Nov 2012 11:16:40 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354187799!17164927!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22139 invoked from network); 29 Nov 2012 11:16:39 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:16:39 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16066387"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:16:39 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 11:16:39 +0000
Message-ID: <1354187797.25834.148.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Thu, 29 Nov 2012 11:16:37 +0000
In-Reply-To: <538d9ffbd71b41e8cf6d.1354104965@elijah>
References: <patchbomb.1354104964@elijah>
	<538d9ffbd71b41e8cf6d.1354104965@elijah>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 1 of 2] libxl: Allow multiple USB devices on
 HVM domain creation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 12:16 +0000, George Dunlap wrote:
> # HG changeset patch
> # User George Dunlap <george.dunlap@eu.citrix.com>
> # Date 1354101445 0
> # Node ID 538d9ffbd71b41e8cf6d7da0ded9e0a0b07f3c0d
> # Parent  ae6fb202b233af815466055d9f1a635802a50855
> libxl: Allow multiple USB devices on HVM domain creation
> 
> This patch allows an HVM domain to be created with multiple USB
> devices.
> 
> Since the previous interface only allowed the passing of a single
> device, this requires us to add a new element to the hvm struct of
> libxl_domain_build_info -- usbdevice_list.  For API compatibility, the
> old element, usbdevice, remains.
> 
> If b_info->hvm.usbdevice is non-NULL, then it will be used exclusively;
> otherwise, libxl will check for b_info->hvm.usbdevice_list instead.

Is this the right way round? If the caller knows about usbdevice_list
enough to have set it to something then surely that's the one it wanted?

> Each device listed will cause an extra "-usbdevice [foo]" to be appended
> to the qemu command line.
> 
> In order to allow users of libxl to write software compatible with older
> versions of libxl, also define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST.  If
> this is present, the caller should use b_info->hvm.usbdevice_list; otherwise
> they should use b_info->hvm.usbdevice.

Actually it's a both stricter and looser than that, if
LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST is defined then the caller can
choose to use usbdevice_list but can also use usbdevice if they wish
(but not both). If it is not present then they must not use
usbdevice_list at all.

I wonder if this LIBXL_HAVE should also be contained in a #ifdef
LIBXL_API_VERSION >= 0x040300?

> 
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

> 
> diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
> --- a/tools/libxl/libxl.h
> +++ b/tools/libxl/libxl.h
> @@ -266,6 +266,23 @@
>  #endif
>  #endif
>  
> +/* 
> + * LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
> + * 
> + * If this is defined, then the libxl_domain_build_info structure will
> + * contain hvm.usbdevice_list, a libxl_string_list type that contains
> + * a list of USB devices to specify on the qemu command-line.
> + *
> + * If it is set, callers may use either hvm.usbdevice or
> + * hvm.usbdevice_list, but not both; if both are set, only
> + * hvm.usbdevice will be used.
> + *
> + * If this is not defined, callers should only use hvm.usbdevice.
> + * Note that this means only one device can be added at domain build
> + * time.
> + */
> +#define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST 1
> +
>  /* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
>   * called from within libxl itself. Callers outside libxl, who
>   * do not #include libxl_internal.h, are fine. */
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -191,6 +191,15 @@ static char ** libxl__build_device_model
>              if (b_info->u.hvm.usbdevice) {
>                  flexarray_vappend(dm_args,
>                                    "-usbdevice", b_info->u.hvm.usbdevice, NULL);
> +            } else if (b_info->u.hvm.usbdevice_list) {
> +                char **p;
> +                for (p = b_info->u.hvm.usbdevice_list;
> +                     *p;
> +                     p++) {
> +                    flexarray_vappend(dm_args,
> +                                      "-usbdevice",
> +                                      *p, NULL);
> +                }
>              }
>          }
>          if (b_info->u.hvm.soundhw) {
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -326,6 +326,7 @@ libxl_domain_build_info = Struct("domain
>                                         ("usbdevice",        string),
>                                         ("soundhw",          string),
>                                         ("xen_platform_pci", libxl_defbool),
> +                                       ("usbdevice_list",   libxl_string_list),
>                                         ])),
>                   ("pv", Struct(None, [("kernel", string),
>                                        ("slack_memkb", MemKB),
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:26:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:26:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2Fc-00023v-7J; Thu, 29 Nov 2012 11:25:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1Te2Fa-00023q-Tp
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:25:51 +0000
Received: from [85.158.139.83:8447] by server-1.bemta-5.messagelabs.com id
	E9/F1-09311-E3647B05; Thu, 29 Nov 2012 11:25:50 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1354188347!23344177!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU0MDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20549 invoked from network); 29 Nov 2012 11:25:49 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:25:49 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="46010361"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	29 Nov 2012 11:25:45 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Thu, 29 Nov 2012 06:25:44 -0500
Message-ID: <50B74637.9030309@citrix.com>
Date: Thu, 29 Nov 2012 11:25:43 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Dan Magenheimer <dan.magenheimer@oracle.com>
References: <cd59ddd0-be45-47e3-b762-a5d630c2df43@default>
In-Reply-To: <cd59ddd0-be45-47e3-b762-a5d630c2df43@default>
X-Originating-IP: [10.80.2.76]
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Andres Lagar-Cavilla <andreslc@gridcentric.ca>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Jan Beulich <JBeulich@suse.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [PATCH v8 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/12 15:50, Dan Magenheimer wrote:
> This is patch 1of2 of an eighth cut of the patch of the proposed
> XENMEM_claim_pages hypercall/subop, taking into account review
> feedback from Jan and Keir and IanC and Matthew Daley, plus some
> fixes found via runtime debugging (using printk and privcmd only).
> 
[...]
>
> Proposed:
> - call claim for mem=N amount of memory
> - if claim succeeds:
>     call populate_physmap repeatedly to achieve mem=N memory (failsafe)
>   else
>     report -ENOMEM up the stack
> - claim is held until mem=N is achieved or the domain dies or
>    the toolstack changes it to 0
> - memory is held until domain dies or the toolstack decreases it

There is no mechanism for per-NUMA node claim.  Isn't this needed?

More fundamentally, doesn't this approach result in a worse user
experience?  It's guaranteeing that a new VM can be started but at the
expense of existing VMs on that node.

When making a VM placement decision, the toolstack needs to consider the
future memory requirements of the new and existing VMs on the host and
not just the current (or more correctly, the recently) memory.

It seems more useful to me to have the toolstack (for example) to track
historical memory usage of a VM to allow it to make better predictions
about memory usage.  With a better prediction, the number of failed VM
creates due to memory shortage will be minimized.  Then, combined with
reducing the cost of a VM create by optimizing the allocator, the cost
of occasionally failing a create will be minimal.

For example, Sally starts her CAD application at 9am, tripling her
desktop VM instances memory usage.  If at 0858, the toolstack claimed a
most of the remaining memory for a new VM, then Sally's VM is going to
grind to a halt as it swaps to death.

If the toolstack could predict that that desktop instances memory usage
was about to spike (because it had historical data showing his), it
could have selected a different host and Sally's VM would perform as
expected.

David

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:26:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:26:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2Fc-00023v-7J; Thu, 29 Nov 2012 11:25:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1Te2Fa-00023q-Tp
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:25:51 +0000
Received: from [85.158.139.83:8447] by server-1.bemta-5.messagelabs.com id
	E9/F1-09311-E3647B05; Thu, 29 Nov 2012 11:25:50 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1354188347!23344177!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU0MDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20549 invoked from network); 29 Nov 2012 11:25:49 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:25:49 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="46010361"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	29 Nov 2012 11:25:45 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Thu, 29 Nov 2012 06:25:44 -0500
Message-ID: <50B74637.9030309@citrix.com>
Date: Thu, 29 Nov 2012 11:25:43 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Dan Magenheimer <dan.magenheimer@oracle.com>
References: <cd59ddd0-be45-47e3-b762-a5d630c2df43@default>
In-Reply-To: <cd59ddd0-be45-47e3-b762-a5d630c2df43@default>
X-Originating-IP: [10.80.2.76]
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Andres Lagar-Cavilla <andreslc@gridcentric.ca>,
	Matthew Daley <mattjd@gmail.com>, TimDeegan <tim@xen.org>,
	xen-devel@lists.xen.org, Jan Beulich <JBeulich@suse.com>,
	Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] [PATCH v8 1/2] hypervisor: XENMEM_claim_pages
 (subop of existing) hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 28/11/12 15:50, Dan Magenheimer wrote:
> This is patch 1of2 of an eighth cut of the patch of the proposed
> XENMEM_claim_pages hypercall/subop, taking into account review
> feedback from Jan and Keir and IanC and Matthew Daley, plus some
> fixes found via runtime debugging (using printk and privcmd only).
> 
[...]
>
> Proposed:
> - call claim for mem=N amount of memory
> - if claim succeeds:
>     call populate_physmap repeatedly to achieve mem=N memory (failsafe)
>   else
>     report -ENOMEM up the stack
> - claim is held until mem=N is achieved or the domain dies or
>    the toolstack changes it to 0
> - memory is held until domain dies or the toolstack decreases it

There is no mechanism for per-NUMA node claim.  Isn't this needed?

More fundamentally, doesn't this approach result in a worse user
experience?  It's guaranteeing that a new VM can be started but at the
expense of existing VMs on that node.

When making a VM placement decision, the toolstack needs to consider the
future memory requirements of the new and existing VMs on the host and
not just the current (or more correctly, the recently) memory.

It seems more useful to me to have the toolstack (for example) to track
historical memory usage of a VM to allow it to make better predictions
about memory usage.  With a better prediction, the number of failed VM
creates due to memory shortage will be minimized.  Then, combined with
reducing the cost of a VM create by optimizing the allocator, the cost
of occasionally failing a create will be minimal.

For example, Sally starts her CAD application at 9am, tripling her
desktop VM instances memory usage.  If at 0858, the toolstack claimed a
most of the remaining memory for a new VM, then Sally's VM is going to
grind to a halt as it swaps to death.

If the toolstack could predict that that desktop instances memory usage
was about to spike (because it had historical data showing his), it
could have selected a different host and Sally's VM would perform as
expected.

David

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:29:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:29:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2Ij-0002CO-3n; Thu, 29 Nov 2012 11:29:05 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te2Ih-0002CD-78
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 11:29:03 +0000
Received: from [193.109.254.147:38046] by server-11.bemta-14.messagelabs.com
	id 34/57-29027-EF647B05; Thu, 29 Nov 2012 11:29:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1354188541!8617016!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22673 invoked from network); 29 Nov 2012 11:29:02 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:29:02 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16066721"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:29:01 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 11:29:01 +0000
Message-ID: <1354188540.25834.151.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Thu, 29 Nov 2012 11:29:00 +0000
In-Reply-To: <20121127143121.GC51942@ocelot.phlegethon.org>
References: <alpine.DEB.2.02.1211271212010.5310@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1211271240250.5310@kaball.uk.xensource.com>
	<20121127143121.GC51942@ocelot.phlegethon.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH v3] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 14:31 +0000, Tim Deegan wrote:

> > +	/* zImage magic header, see:
> > +	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
> > +	 */
> > +	.rept 7
> > +	mov   r0, r0
> > +	.endr
> > +	mov   r0, r0
> 
> OK, with this changed to a .rept 8 and the singleton removed,
> Acked-by: Tim Deegan <tim@xen.org>

And me, I've applied with this trivial modification.

Ian.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:29:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:29:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2Ij-0002CO-3n; Thu, 29 Nov 2012 11:29:05 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te2Ih-0002CD-78
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 11:29:03 +0000
Received: from [193.109.254.147:38046] by server-11.bemta-14.messagelabs.com
	id 34/57-29027-EF647B05; Thu, 29 Nov 2012 11:29:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1354188541!8617016!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22673 invoked from network); 29 Nov 2012 11:29:02 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:29:02 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16066721"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:29:01 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 11:29:01 +0000
Message-ID: <1354188540.25834.151.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Thu, 29 Nov 2012 11:29:00 +0000
In-Reply-To: <20121127143121.GC51942@ocelot.phlegethon.org>
References: <alpine.DEB.2.02.1211271212010.5310@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1211271240250.5310@kaball.uk.xensource.com>
	<20121127143121.GC51942@ocelot.phlegethon.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH v3] xen/arm: build as zImage
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 2012-11-27 at 14:31 +0000, Tim Deegan wrote:

> > +	/* zImage magic header, see:
> > +	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
> > +	 */
> > +	.rept 7
> > +	mov   r0, r0
> > +	.endr
> > +	mov   r0, r0
> 
> OK, with this changed to a .rept 8 and the singleton removed,
> Acked-by: Tim Deegan <tim@xen.org>

And me, I've applied with this trivial modification.

Ian.




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:29:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:29:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2JB-0002HP-Iy; Thu, 29 Nov 2012 11:29:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te2J9-0002Gw-UY
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:29:32 +0000
Received: from [85.158.143.35:20725] by server-1.bemta-4.messagelabs.com id
	4A/6C-27934-B1747B05; Thu, 29 Nov 2012 11:29:31 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1354188533!4190293!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13124 invoked from network); 29 Nov 2012 11:28:54 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:28:54 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16066714"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:28:53 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 11:28:53 +0000
Message-ID: <1354188532.25834.150.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Date: Thu, 29 Nov 2012 11:28:52 +0000
In-Reply-To: <1354118383.25834.39.camel@zakaz.uk.xensource.com>
References: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
	<1354015744.5830.199.camel@zakaz.uk.xensource.com>
	<50B62F38.7090906@citrix.com>
	<1354118383.25834.39.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] docs: fix persistent grants doc typo
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gV2VkLCAyMDEyLTExLTI4IGF0IDE1OjU5ICswMDAwLCBJYW4gQ2FtcGJlbGwgd3JvdGU6Cj4g
T24gV2VkLCAyMDEyLTExLTI4IGF0IDE1OjM1ICswMDAwLCBSb2dlciBQYXUgTW9ubmUgd3JvdGU6
Cj4gPiBPbiAyNy8xMS8xMiAxMjoyOSwgSWFuIENhbXBiZWxsIHdyb3RlOgo+ID4gPiBPbiBUdWUs
IDIwMTItMTEtMjcgYXQgMTA6MDMgKzAwMDAsIFJvZ2VyIFBhdSBNb25uZSB3cm90ZToKPiA+ID4+
IFNpZ25lZC1vZmYtYnk6IFJvZ2VyIFBhdSBNb25uw6kgPHJvZ2VyLnBhdUBjaXRyaXguY29tPgo+
ID4gPj4gLS0tCj4gPiA+PiAgeGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmggfCAgICAyICst
Cj4gPiA+PiAgMSBmaWxlcyBjaGFuZ2VkLCAxIGluc2VydGlvbnMoKyksIDEgZGVsZXRpb25zKC0p
Cj4gPiA+Pgo+ID4gPj4gZGlmZiAtLWdpdCBhL3hlbi9pbmNsdWRlL3B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JJ2xsIGRvIGl0IHdoZW4gSSBjb21taXQuCgpX
aGljaCBJJ3ZlIG5vdyBkb25lLgoKPiAKPiA+IAo+ID4gPiAKPiA+ID4+ICAgKi8KPiA+ID4+ICAK
PiA+ID4+ICAvKgo+ID4gPiAKPiA+ID4gCj4gPiAKPiAKPiAKPiAKPiBfX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwo+IFhlbi1kZXZlbCBtYWlsaW5nIGxpc3QK
PiBYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwo+IGh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZl
bAoKCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4t
ZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54
ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:29:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:29:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2JB-0002HP-Iy; Thu, 29 Nov 2012 11:29:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te2J9-0002Gw-UY
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:29:32 +0000
Received: from [85.158.143.35:20725] by server-1.bemta-4.messagelabs.com id
	4A/6C-27934-B1747B05; Thu, 29 Nov 2012 11:29:31 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1354188533!4190293!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13124 invoked from network); 29 Nov 2012 11:28:54 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:28:54 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16066714"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:28:53 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 11:28:53 +0000
Message-ID: <1354188532.25834.150.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Date: Thu, 29 Nov 2012 11:28:52 +0000
In-Reply-To: <1354118383.25834.39.camel@zakaz.uk.xensource.com>
References: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
	<1354015744.5830.199.camel@zakaz.uk.xensource.com>
	<50B62F38.7090906@citrix.com>
	<1354118383.25834.39.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/2] docs: fix persistent grants doc typo
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gV2VkLCAyMDEyLTExLTI4IGF0IDE1OjU5ICswMDAwLCBJYW4gQ2FtcGJlbGwgd3JvdGU6Cj4g
T24gV2VkLCAyMDEyLTExLTI4IGF0IDE1OjM1ICswMDAwLCBSb2dlciBQYXUgTW9ubmUgd3JvdGU6
Cj4gPiBPbiAyNy8xMS8xMiAxMjoyOSwgSWFuIENhbXBiZWxsIHdyb3RlOgo+ID4gPiBPbiBUdWUs
IDIwMTItMTEtMjcgYXQgMTA6MDMgKzAwMDAsIFJvZ2VyIFBhdSBNb25uZSB3cm90ZToKPiA+ID4+
IFNpZ25lZC1vZmYtYnk6IFJvZ2VyIFBhdSBNb25uw6kgPHJvZ2VyLnBhdUBjaXRyaXguY29tPgo+
ID4gPj4gLS0tCj4gPiA+PiAgeGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmggfCAgICAyICst
Cj4gPiA+PiAgMSBmaWxlcyBjaGFuZ2VkLCAxIGluc2VydGlvbnMoKyksIDEgZGVsZXRpb25zKC0p
Cj4gPiA+Pgo+ID4gPj4gZGlmZiAtLWdpdCBhL3hlbi9pbmNsdWRlL3B1YmxpYy9pby9ibGtpZi5o
IGIveGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmgKPiA+ID4+IGluZGV4IGFjY2RkYTQuLmRi
OWMzNzkgMTAwNjQ0Cj4gPiA+PiAtLS0gYS94ZW4vaW5jbHVkZS9wdWJsaWMvaW8vYmxraWYuaAo+
ID4gPj4gKysrIGIveGVuL2luY2x1ZGUvcHVibGlj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fX19fX19fXwo+IFhlbi1kZXZlbCBtYWlsaW5nIGxpc3QK
PiBYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwo+IGh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZl
bAoKCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4t
ZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54
ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:30:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:30:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2Ju-0002My-3l; Thu, 29 Nov 2012 11:30:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Te2Js-0002Mk-H6
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:30:16 +0000
Received: from [85.158.143.35:26411] by server-2.bemta-4.messagelabs.com id
	A5/12-28922-74747B05; Thu, 29 Nov 2012 11:30:15 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1354188614!4190488!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18597 invoked from network); 29 Nov 2012 11:30:14 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:30:14 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16066758"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:30:14 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 11:30:14 +0000
Message-ID: <50B74745.5030706@citrix.com>
Date: Thu, 29 Nov 2012 12:30:13 +0100
From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
	<1354010620-31788-2-git-send-email-roger.pau@citrix.com>
	<1354186182.25834.131.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354186182.25834.131.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] docs: expand persistent grants protocol
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen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Pj4gICAqICAgICBmdXJ0aGVyIHJlcXVlc3RzIG1heSByZXVzZSB0aGlz
IGdyYW50cyBhbmQgcmVxdWlyZSB3cml0ZSBwZXJtaXNzaW9ucy4KPj4gKyAqICg5KSBMaW51eCBp
bXBsZW1lbnRhdGlvbiBkb2Vzbid0IGhhdmUgYSBsaW1pdCBvbiB0aGUgbWF4aW11bSBudW1iZXIg
b2YKPj4gKyAqICAgICBncmFudHMgdGhhdCBjYW4gYmUgcGVyc2lzbnRseSBtYXBwZWQgaW4gdGhl
IGZyb250ZW5kIGRyaXZlciwgYnV0Cj4gCj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBl
cnNpc3RlbnRseQo+IAo+PiArICogICAgIGR1ZSB0byB0aGUgZnJvbnRlbnQgZHJpdmVyIGltcGxl
bWVudGF0aW9uIGl0IHNob3VsZCBuZXZlciBiZSBiaWdnZXIKPj4gKyAqICAgICB0aGFuIFJJTkdf
U0laRSAqIEJMS0lGX01BWF9TRUdNRU5UU19QRVJfUkVRVUVTVC4KPj4gICAqLwo+PiAgCj4+ICAv
Kgo+IAo+IAoKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
Clhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxpc3RzLnhlbi5vcmcKaHR0cDovL2xp
c3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:30:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:30:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2Ju-0002My-3l; Thu, 29 Nov 2012 11:30:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Te2Js-0002Mk-H6
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:30:16 +0000
Received: from [85.158.143.35:26411] by server-2.bemta-4.messagelabs.com id
	A5/12-28922-74747B05; Thu, 29 Nov 2012 11:30:15 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1354188614!4190488!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18597 invoked from network); 29 Nov 2012 11:30:14 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:30:14 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16066758"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:30:14 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 11:30:14 +0000
Message-ID: <50B74745.5030706@citrix.com>
Date: Thu, 29 Nov 2012 12:30:13 +0100
From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
	<1354010620-31788-2-git-send-email-roger.pau@citrix.com>
	<1354186182.25834.131.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354186182.25834.131.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] docs: expand persistent grants protocol
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gMjkvMTEvMTIgMTE6NDksIElhbiBDYW1wYmVsbCB3cm90ZToKPiBPbiBUdWUsIDIwMTItMTEt
MjcgYXQgMTA6MDMgKzAwMDAsIFJvZ2VyIFBhdSBNb25uZSB3cm90ZToKPj4gU2lnbmVkLW9mZi1i
eTogUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+Cj4+IC0tLQo+PiAgeGVu
L2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmggfCAgIDI0ICsrKysrKysrKysrKysrKysrKysrKy0t
LQo+PiAgMSBmaWxlcyBjaGFuZ2VkLCAyMSBpbnNlcnRpb25zKCspLCAzIGRlbGV0aW9ucygtKQo+
Pgo+PiBkaWZmIC0tZ2l0IGEveGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmggYi94ZW4vaW5j
bHVkZS9wdWJsaWMvaW8vYmxraWYuaAo+PiBpbmRleCBkYjljMzc5Li41YTRiOWFlIDEwMDY0NAo+
PiAtLS0gYS94ZW4vaW5jbHVkZS9wd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fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
Clhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxpc3RzLnhlbi5vcmcKaHR0cDovL2xp
c3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:34:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:34:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2O5-0002jD-3P; Thu, 29 Nov 2012 11:34:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te2O3-0002j6-Jz
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:34:35 +0000
Received: from [85.158.143.35:57452] by server-2.bemta-4.messagelabs.com id
	46/09-28922-A4847B05; Thu, 29 Nov 2012 11:34:34 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354188874!4882442!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25830 invoked from network); 29 Nov 2012 11:34:34 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:34:34 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16066879"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:34:34 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 11:34:34 +0000
Message-ID: <1354188873.25834.155.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Date: Thu, 29 Nov 2012 11:34:33 +0000
In-Reply-To: <50B74745.5030706@citrix.com>
References: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
	<1354010620-31788-2-git-send-email-roger.pau@citrix.com>
	<1354186182.25834.131.camel@zakaz.uk.xensource.com>
	<50B74745.5030706@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] docs: expand persistent grants protocol
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVGh1LCAyMDEyLTExLTI5IGF0IDExOjMwICswMDAwLCBSb2dlciBQYXUgTW9ubmUgd3JvdGU6
Cj4gT24gMjkvMTEvMTIgMTE6NDksIElhbiBDYW1wYmVsbCB3cm90ZToKPiA+IE9uIFR1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4KCkl0IG1heSBldmVuIGJlIHdvcnRoIGRvY3VtZW50aW5nIHRoYXQgdGhl
IGIuZS4gc2hvdWxkIHVzZSBhbiBMUlUgc2NoZW1lLgoKSWFuLAoKCl9fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVu
LWRldmVsQGxpc3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:34:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:34:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2O5-0002jD-3P; Thu, 29 Nov 2012 11:34:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te2O3-0002j6-Jz
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:34:35 +0000
Received: from [85.158.143.35:57452] by server-2.bemta-4.messagelabs.com id
	46/09-28922-A4847B05; Thu, 29 Nov 2012 11:34:34 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354188874!4882442!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25830 invoked from network); 29 Nov 2012 11:34:34 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:34:34 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16066879"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:34:34 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 11:34:34 +0000
Message-ID: <1354188873.25834.155.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Date: Thu, 29 Nov 2012 11:34:33 +0000
In-Reply-To: <50B74745.5030706@citrix.com>
References: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
	<1354010620-31788-2-git-send-email-roger.pau@citrix.com>
	<1354186182.25834.131.camel@zakaz.uk.xensource.com>
	<50B74745.5030706@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] docs: expand persistent grants protocol
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVGh1LCAyMDEy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BoYXBwZW5lZCB0bwppbXBsZW1lbnQg
YSBGSUZPIGluc3RlYWQgdGhlbiB0aGV5IHdvdWxkIGdldCBzb21lIHNvcnQgb2YgcGF0aG9sb2dp
Y2FsCmJlaGF2aW91ci4KCkl0IG1heSBldmVuIGJlIHdvcnRoIGRvY3VtZW50aW5nIHRoYXQgdGhl
IGIuZS4gc2hvdWxkIHVzZSBhbiBMUlUgc2NoZW1lLgoKSWFuLAoKCl9fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVu
LWRldmVsQGxpc3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:39:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:39:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2Sq-0002v3-2o; Thu, 29 Nov 2012 11:39:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Te2Sp-0002ux-9r
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:39:31 +0000
Received: from [193.109.254.147:25771] by server-8.bemta-14.messagelabs.com id
	BF/49-05026-27947B05; Thu, 29 Nov 2012 11:39:30 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1354189151!8618607!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27682 invoked from network); 29 Nov 2012 11:39:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:39:12 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16067003"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:39:11 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 29 Nov 2012 11:39:11 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Te2SV-0004kp-8P; Thu, 29 Nov 2012 11:39:11 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Te2SV-0007im-1N;
	Thu, 29 Nov 2012 11:39:11 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20663.18782.886504.606333@mariner.uk.xensource.com>
Date: Thu, 29 Nov 2012 11:39:10 +0000
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1353664797.13542.190.camel@zakaz.uk.xensource.com>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353664797.13542.190.camel@zakaz.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs
 to stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("Re: [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs to stubdom/Makefile"):
> On Tue, 2012-11-20 at 14:21 +0000, Matthew Fioravante wrote:
> > +tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
> > +       tar xzf $<
> > +       mv tpm_emulator-$(TPMEMU_VERSION) $@
> > +       patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
> > +       mkdir $@/build
> > +       cd $@/build; cmake .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
> > +       touch $@ 
> 
> Ian -- is the test system ready to copy with this cmake requirement?
> 
> Or do we need to make this dependency conditional?

I think it would be better to make the dependency conditional.
Ideally this would be done via configure but (having discussed this
with Ian Campbell) we think converting stubdom to use autoconf is too
much yak-shaving to ask of you.

I guess it would be possible to have an ad-hoc switch in Config.mk
(say) but I'm not sure this is better than just adding cmake as a hard
dependency.

So I have pushed a change to the pre-test tree for the automatic
testing system to add cmake to the set of packages installed for
builds.  Barring unrelated trouble, this should pass the self-tests
and be live by tomorrow morning.

> I think at the very least it should be $(CMAKE), at which point we may
> as well go the whole hog and make configure.ac do the right thing.

I think it's fine to say CMAKE:=cmake somewhere.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:39:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:39:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2Sq-0002v3-2o; Thu, 29 Nov 2012 11:39:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Te2Sp-0002ux-9r
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:39:31 +0000
Received: from [193.109.254.147:25771] by server-8.bemta-14.messagelabs.com id
	BF/49-05026-27947B05; Thu, 29 Nov 2012 11:39:30 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1354189151!8618607!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27682 invoked from network); 29 Nov 2012 11:39:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:39:12 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16067003"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:39:11 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 29 Nov 2012 11:39:11 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Te2SV-0004kp-8P; Thu, 29 Nov 2012 11:39:11 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Te2SV-0007im-1N;
	Thu, 29 Nov 2012 11:39:11 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20663.18782.886504.606333@mariner.uk.xensource.com>
Date: Thu, 29 Nov 2012 11:39:10 +0000
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1353664797.13542.190.camel@zakaz.uk.xensource.com>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353664797.13542.190.camel@zakaz.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs
 to stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("Re: [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs to stubdom/Makefile"):
> On Tue, 2012-11-20 at 14:21 +0000, Matthew Fioravante wrote:
> > +tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
> > +       tar xzf $<
> > +       mv tpm_emulator-$(TPMEMU_VERSION) $@
> > +       patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
> > +       mkdir $@/build
> > +       cd $@/build; cmake .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
> > +       touch $@ 
> 
> Ian -- is the test system ready to copy with this cmake requirement?
> 
> Or do we need to make this dependency conditional?

I think it would be better to make the dependency conditional.
Ideally this would be done via configure but (having discussed this
with Ian Campbell) we think converting stubdom to use autoconf is too
much yak-shaving to ask of you.

I guess it would be possible to have an ad-hoc switch in Config.mk
(say) but I'm not sure this is better than just adding cmake as a hard
dependency.

So I have pushed a change to the pre-test tree for the automatic
testing system to add cmake to the set of packages installed for
builds.  Barring unrelated trouble, this should pass the self-tests
and be live by tomorrow morning.

> I think at the very least it should be $(CMAKE), at which point we may
> as well go the whole hog and make configure.ac do the right thing.

I think it's fine to say CMAKE:=cmake somewhere.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:41:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:41:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2Um-000325-L7; Thu, 29 Nov 2012 11:41:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Te2Ul-00031y-MI
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:41:31 +0000
Received: from [85.158.143.35:39167] by server-2.bemta-4.messagelabs.com id
	6A/43-28922-BE947B05; Thu, 29 Nov 2012 11:41:31 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1354189285!5338980!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25852 invoked from network); 29 Nov 2012 11:41:27 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:41:27 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16067055"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:41:25 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 29 Nov 2012 11:41:25 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Te2Uf-0004lU-DX; Thu, 29 Nov 2012 11:41:25 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Te2Uf-0007j1-8G;
	Thu, 29 Nov 2012 11:41:25 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20663.18917.138256.303363@mariner.uk.xensource.com>
Date: Thu, 29 Nov 2012 11:41:25 +0000
To: Ian Campbell <Ian.Campbell@citrix.com>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
In-Reply-To: <20663.18782.886504.606333@mariner.uk.xensource.com>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353664797.13542.190.camel@zakaz.uk.xensource.com>
	<20663.18782.886504.606333@mariner.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Subject: Re: [Xen-devel] [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs
 to stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Jackson writes ("Re: [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs to stubdom/Makefile"):
> I guess it would be possible to have an ad-hoc switch in Config.mk
> (say) but I'm not sure this is better than just adding cmake as a hard
> dependency.

Although, can we have a manual y/n switch in Config.mk so that if
someone has trouble with this feature they can turn off the build ?

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:41:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:41:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2Um-000325-L7; Thu, 29 Nov 2012 11:41:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Te2Ul-00031y-MI
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:41:31 +0000
Received: from [85.158.143.35:39167] by server-2.bemta-4.messagelabs.com id
	6A/43-28922-BE947B05; Thu, 29 Nov 2012 11:41:31 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1354189285!5338980!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25852 invoked from network); 29 Nov 2012 11:41:27 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:41:27 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16067055"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:41:25 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 29 Nov 2012 11:41:25 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Te2Uf-0004lU-DX; Thu, 29 Nov 2012 11:41:25 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Te2Uf-0007j1-8G;
	Thu, 29 Nov 2012 11:41:25 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20663.18917.138256.303363@mariner.uk.xensource.com>
Date: Thu, 29 Nov 2012 11:41:25 +0000
To: Ian Campbell <Ian.Campbell@citrix.com>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
In-Reply-To: <20663.18782.886504.606333@mariner.uk.xensource.com>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353664797.13542.190.camel@zakaz.uk.xensource.com>
	<20663.18782.886504.606333@mariner.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Subject: Re: [Xen-devel] [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs
 to stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Jackson writes ("Re: [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs to stubdom/Makefile"):
> I guess it would be possible to have an ad-hoc switch in Config.mk
> (say) but I'm not sure this is better than just adding cmake as a hard
> dependency.

Although, can we have a manual y/n switch in Config.mk so that if
someone has trouble with this feature they can turn off the build ?

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:51:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:51:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2eI-0003Kg-TJ; Thu, 29 Nov 2012 11:51:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1Te2eH-0003Kb-K4
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 11:51:21 +0000
Received: from [85.158.139.211:50337] by server-3.bemta-5.messagelabs.com id
	27/00-18736-83C47B05; Thu, 29 Nov 2012 11:51:20 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1354189851!18353209!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc4MDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13368 invoked from network); 29 Nov 2012 11:50:52 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:50:52 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="215854992"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:50:23 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 06:50:23 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1Te2dK-0005Lb-Vb;
	Thu, 29 Nov 2012 11:50:22 +0000
Message-ID: <50B74AA8.3090504@eu.citrix.com>
Date: Thu, 29 Nov 2012 11:44:40 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <patchbomb.1354104964@elijah>
	<e87d8fad28e00090591b.1354104966@elijah>
	<20121128151119.GC8912@reaktio.net>
	<CAFLBxZb_YwCaDAUU4pqkzbdNF0D1rFDoELVZadunt3cr3v5Tig@mail.gmail.com>
	<1354187200.25834.143.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354187200.25834.143.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 2 of 2] xl: Accept a list for usbdevice in
 config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gMjkvMTEvMTIgMTE6MDYsIElhbiBDYW1wYmVsbCB3cm90ZToKPiBPbiBXZWQsIDIwMTItMTEt
MjggYXQgMTY6NTIgKzAwMDAsIEdlb3JnZSBEdW5sYXAgd3JvdGU6Cj4+IE9uIFdlZCwgTm92IDI4
LCAyMDEyIGF0IDM6MTEgUE0sIFBhc2kgS8Okcmtrw6RpbmVuIDxwYXNpa0Bpa2kuZmk+IHdyb3Rl
Ogo+PiAgICAgICAgICBPbiBXZWQsIE5vdiAyOCwgMjAxMiBhdCAxMjoxNjowNlBNICswMDAwLCBH
ZW9yZ2UgRHVubGFwIHdyb3RlOgo+PiAgICAgICAgICA+ICMgSEcgY2hhbmdlc2V0IHBhdGNoCj4+
ICAgICAgICAgID4gIyBVc2VyIEdlb3JnZSBEdW5sYXAgPGdlb3JnZS5kdW5sYXBAZXUuY2l0cml4
LmNvbT4KPj4gICAgICAgICAgPiAjIERhdGUgMTM1NDEwNDg1MSAwCj4+ICAgICAgICAgID4gIyB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vbiAKdXNpbmcgIi11c2IiIGFuZCAiLXVzYmRldmljZSIgYXQgYWxsIC0tIHRo
ZXkgc2VlbSB0byBwcmVmZXIgdXNpbmcgCiItZGV2aWNlIiB0byBzcGVjaWZ5IGh1YnMgJmMuCgpC
dXQgc3RpbGwsIGl0IG1pZ2h0IGJlIHVzZWZ1bCB0byBzYXkgdGhhdCB0aGVzZSBhcmUgcGFzc2Vk
IHZpYSAKInVzYmRldmljZSIgdG8gdGhlIHFlbXUgY29tbWFuZCBsaW5lLCBhbmQgc28geW91IGNh
biBmaW5kIG1vcmUgCmluZm9ybWF0aW9uIG9uIHRoZSBxZW11IG1hbiBwYWdlLgoKICAtR2Vvcmdl
CgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2
ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4u
b3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:51:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:51:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2eI-0003Kg-TJ; Thu, 29 Nov 2012 11:51:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1Te2eH-0003Kb-K4
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 11:51:21 +0000
Received: from [85.158.139.211:50337] by server-3.bemta-5.messagelabs.com id
	27/00-18736-83C47B05; Thu, 29 Nov 2012 11:51:20 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1354189851!18353209!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc4MDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13368 invoked from network); 29 Nov 2012 11:50:52 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:50:52 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="215854992"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:50:23 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 06:50:23 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1Te2dK-0005Lb-Vb;
	Thu, 29 Nov 2012 11:50:22 +0000
Message-ID: <50B74AA8.3090504@eu.citrix.com>
Date: Thu, 29 Nov 2012 11:44:40 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <patchbomb.1354104964@elijah>
	<e87d8fad28e00090591b.1354104966@elijah>
	<20121128151119.GC8912@reaktio.net>
	<CAFLBxZb_YwCaDAUU4pqkzbdNF0D1rFDoELVZadunt3cr3v5Tig@mail.gmail.com>
	<1354187200.25834.143.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354187200.25834.143.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 2 of 2] xl: Accept a list for usbdevice in
 config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gMjkvMTEvMTIgMTE6MDYsIElhbiBDYW1wYmVsbCB3cm90ZToKPiBPbiBXZWQsIDIwMTItMTEt
MjggYXQgMTY6NTIgKzAwMDAsIEdlb3JnZSBEdW5sYXAgd3JvdGU6Cj4+IE9uIFdlZCwgTm92IDI4
LCAyMDEyIGF0IDM6MTEgUE0sIFBhc2kgS8Okcmtrw6RpbmVuIDxwYXNpa0Bpa2kuZmk+IHdyb3Rl
Ogo+PiAgICAgICAgICBPbiBXZWQsIE5vdiAyOCwgMjAxMiBhdCAxMjoxNjowNlBNICswMDAwLCBH
ZW9yZ2UgRHVubGFwIHdyb3RlOgo+PiAgICAgICAgICA+ICMgSEcgY2hhbmdlc2V0IHBhdGNoCj4+
ICAgICAgICAgID4gIyBVc2VyIEdlb3JnZSBEdW5sYXAgPGdlb3JnZS5kdW5sYXBAZXUuY2l0cml4
LmNvbT4KPj4gICAgICAgICAgPiAjIERhdGUgMTM1NDEwNDg1MSAwCj4+ICAgICAgICAgID4gIyBO
b2RlIElEIGU4N2Q4ZmFkMjhlMDAwOTA1OTFiN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IgYXQgYWxsIC0tIHRo
ZXkgc2VlbSB0byBwcmVmZXIgdXNpbmcgCiItZGV2aWNlIiB0byBzcGVjaWZ5IGh1YnMgJmMuCgpC
dXQgc3RpbGwsIGl0IG1pZ2h0IGJlIHVzZWZ1bCB0byBzYXkgdGhhdCB0aGVzZSBhcmUgcGFzc2Vk
IHZpYSAKInVzYmRldmljZSIgdG8gdGhlIHFlbXUgY29tbWFuZCBsaW5lLCBhbmQgc28geW91IGNh
biBmaW5kIG1vcmUgCmluZm9ybWF0aW9uIG9uIHRoZSBxZW11IG1hbiBwYWdlLgoKICAtR2Vvcmdl
CgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2
ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4u
b3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:51:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:51:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2eU-0003Lq-Jh; Thu, 29 Nov 2012 11:51:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te2eT-0003Le-M3
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:51:33 +0000
Received: from [85.158.139.83:23730] by server-16.bemta-5.messagelabs.com id
	7E/F3-04786-44C47B05; Thu, 29 Nov 2012 11:51:32 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1354189889!23657700!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13008 invoked from network); 29 Nov 2012 11:51:31 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:51:31 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16067298"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:51:29 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 11:51:28 +0000
Message-ID: <1354189887.25834.158.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Thu, 29 Nov 2012 11:51:27 +0000
In-Reply-To: <1354118438.25834.40.camel@zakaz.uk.xensource.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211281150380.5310@kaball.uk.xensource.com>
	<20121128142521.GB21266@phenom.dumpdata.com>
	<1354113142.25834.34.camel@zakaz.uk.xensource.com>
	<20121128144416.GD21266@phenom.dumpdata.com>
	<1354118438.25834.40.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 16:00 +0000, Ian Campbell wrote:
> I'll take a look over the next couple of days.

Just looking into this now and in
konrad/stable/pvh.v6:arch/x86/xen/mmu.c in xen_remap_domain_mfn_range we
have:


	if (xen_feature(XENFEAT_auto_translated_physmap))
		return -EINVAL;

...

	if (xen_feature(XENFEAT_auto_translated_physmap)) {
		/* We need to update the local page tables and the xen HAP */
		return pvh_remap_gmfn_range(vma, addr, mfn, nr, prot, domid, pages);
	}

So it seems like the second one will never be reached...

AFAICT this was already the case when support was added in
de81067d4ef5b434b47f63e11448b3b09cfc0b5e.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 11:51:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 11:51:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2eU-0003Lq-Jh; Thu, 29 Nov 2012 11:51:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te2eT-0003Le-M3
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 11:51:33 +0000
Received: from [85.158.139.83:23730] by server-16.bemta-5.messagelabs.com id
	7E/F3-04786-44C47B05; Thu, 29 Nov 2012 11:51:32 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1354189889!23657700!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13008 invoked from network); 29 Nov 2012 11:51:31 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 11:51:31 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16067298"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 11:51:29 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 11:51:28 +0000
Message-ID: <1354189887.25834.158.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Thu, 29 Nov 2012 11:51:27 +0000
In-Reply-To: <1354118438.25834.40.camel@zakaz.uk.xensource.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211281150380.5310@kaball.uk.xensource.com>
	<20121128142521.GB21266@phenom.dumpdata.com>
	<1354113142.25834.34.camel@zakaz.uk.xensource.com>
	<20121128144416.GD21266@phenom.dumpdata.com>
	<1354118438.25834.40.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 16:00 +0000, Ian Campbell wrote:
> I'll take a look over the next couple of days.

Just looking into this now and in
konrad/stable/pvh.v6:arch/x86/xen/mmu.c in xen_remap_domain_mfn_range we
have:


	if (xen_feature(XENFEAT_auto_translated_physmap))
		return -EINVAL;

...

	if (xen_feature(XENFEAT_auto_translated_physmap)) {
		/* We need to update the local page tables and the xen HAP */
		return pvh_remap_gmfn_range(vma, addr, mfn, nr, prot, domid, pages);
	}

So it seems like the second one will never be reached...

AFAICT this was already the case when support was added in
de81067d4ef5b434b47f63e11448b3b09cfc0b5e.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 12:07:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 12:07:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2ti-0003u5-Ps; Thu, 29 Nov 2012 12:07:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1Te2ti-0003u0-7Q
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 12:07:18 +0000
Received: from [193.109.254.147:50413] by server-1.bemta-14.messagelabs.com id
	01/71-25314-5FF47B05; Thu, 29 Nov 2012 12:07:17 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1354190835!3117740!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc4MDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23509 invoked from network); 29 Nov 2012 12:07:16 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 12:07:16 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="215856132"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 12:07:15 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 07:07:15 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1Te2te-0005bV-Rk;
	Thu, 29 Nov 2012 12:07:14 +0000
Message-ID: <50B74E9C.3050805@eu.citrix.com>
Date: Thu, 29 Nov 2012 12:01:32 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <patchbomb.1354104964@elijah>
	<538d9ffbd71b41e8cf6d.1354104965@elijah>
	<1354187797.25834.148.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354187797.25834.148.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 1 of 2] libxl: Allow multiple USB devices on
 HVM domain creation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 29/11/12 11:16, Ian Campbell wrote:
> On Wed, 2012-11-28 at 12:16 +0000, George Dunlap wrote:
>> # HG changeset patch
>> # User George Dunlap <george.dunlap@eu.citrix.com>
>> # Date 1354101445 0
>> # Node ID 538d9ffbd71b41e8cf6d7da0ded9e0a0b07f3c0d
>> # Parent  ae6fb202b233af815466055d9f1a635802a50855
>> libxl: Allow multiple USB devices on HVM domain creation
>>
>> This patch allows an HVM domain to be created with multiple USB
>> devices.
>>
>> Since the previous interface only allowed the passing of a single
>> device, this requires us to add a new element to the hvm struct of
>> libxl_domain_build_info -- usbdevice_list.  For API compatibility, the
>> old element, usbdevice, remains.
>>
>> If b_info->hvm.usbdevice is non-NULL, then it will be used exclusively;
>> otherwise, libxl will check for b_info->hvm.usbdevice_list instead.
> Is this the right way round? If the caller knows about usbdevice_list
> enough to have set it to something then surely that's the one it wanted?

  Well, I had considered returning an error if both were set. :-)  I 
suppose actually that's probably the way that is likely to flag up bugs 
in the toolstack the best -- only doing one or the other will cause 
weird buggy behavior that will be hard to track down.  Does that sound 
good to you?

>> Each device listed will cause an extra "-usbdevice [foo]" to be appended
>> to the qemu command line.
>>
>> In order to allow users of libxl to write software compatible with older
>> versions of libxl, also define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST.  If
>> this is present, the caller should use b_info->hvm.usbdevice_list; otherwise
>> they should use b_info->hvm.usbdevice.
> Actually it's a both stricter and looser than that, if
> LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST is defined then the caller can
> choose to use usbdevice_list but can also use usbdevice if they wish
> (but not both). If it is not present then they must not use
> usbdevice_list at all.

Hmm, I think I wrote this first and then changed it and forgot to update 
it.  :-)  I also forgot that in this kind of "API spec" document, 
"should" and "must" are technical terms with very specific definitions.  
I'll revise it when I re-spin.

>
> I wonder if this LIBXL_HAVE should also be contained in a #ifdef
> LIBXL_API_VERSION >= 0x040300?

What would be the purpose of that?

  -George


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 12:07:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 12:07:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2ti-0003u5-Ps; Thu, 29 Nov 2012 12:07:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1Te2ti-0003u0-7Q
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 12:07:18 +0000
Received: from [193.109.254.147:50413] by server-1.bemta-14.messagelabs.com id
	01/71-25314-5FF47B05; Thu, 29 Nov 2012 12:07:17 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1354190835!3117740!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODc4MDg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23509 invoked from network); 29 Nov 2012 12:07:16 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 12:07:16 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="215856132"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 12:07:15 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 07:07:15 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1Te2te-0005bV-Rk;
	Thu, 29 Nov 2012 12:07:14 +0000
Message-ID: <50B74E9C.3050805@eu.citrix.com>
Date: Thu, 29 Nov 2012 12:01:32 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <patchbomb.1354104964@elijah>
	<538d9ffbd71b41e8cf6d.1354104965@elijah>
	<1354187797.25834.148.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354187797.25834.148.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 1 of 2] libxl: Allow multiple USB devices on
 HVM domain creation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 29/11/12 11:16, Ian Campbell wrote:
> On Wed, 2012-11-28 at 12:16 +0000, George Dunlap wrote:
>> # HG changeset patch
>> # User George Dunlap <george.dunlap@eu.citrix.com>
>> # Date 1354101445 0
>> # Node ID 538d9ffbd71b41e8cf6d7da0ded9e0a0b07f3c0d
>> # Parent  ae6fb202b233af815466055d9f1a635802a50855
>> libxl: Allow multiple USB devices on HVM domain creation
>>
>> This patch allows an HVM domain to be created with multiple USB
>> devices.
>>
>> Since the previous interface only allowed the passing of a single
>> device, this requires us to add a new element to the hvm struct of
>> libxl_domain_build_info -- usbdevice_list.  For API compatibility, the
>> old element, usbdevice, remains.
>>
>> If b_info->hvm.usbdevice is non-NULL, then it will be used exclusively;
>> otherwise, libxl will check for b_info->hvm.usbdevice_list instead.
> Is this the right way round? If the caller knows about usbdevice_list
> enough to have set it to something then surely that's the one it wanted?

  Well, I had considered returning an error if both were set. :-)  I 
suppose actually that's probably the way that is likely to flag up bugs 
in the toolstack the best -- only doing one or the other will cause 
weird buggy behavior that will be hard to track down.  Does that sound 
good to you?

>> Each device listed will cause an extra "-usbdevice [foo]" to be appended
>> to the qemu command line.
>>
>> In order to allow users of libxl to write software compatible with older
>> versions of libxl, also define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST.  If
>> this is present, the caller should use b_info->hvm.usbdevice_list; otherwise
>> they should use b_info->hvm.usbdevice.
> Actually it's a both stricter and looser than that, if
> LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST is defined then the caller can
> choose to use usbdevice_list but can also use usbdevice if they wish
> (but not both). If it is not present then they must not use
> usbdevice_list at all.

Hmm, I think I wrote this first and then changed it and forgot to update 
it.  :-)  I also forgot that in this kind of "API spec" document, 
"should" and "must" are technical terms with very specific definitions.  
I'll revise it when I re-spin.

>
> I wonder if this LIBXL_HAVE should also be contained in a #ifdef
> LIBXL_API_VERSION >= 0x040300?

What would be the purpose of that?

  -George


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 12:13:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 12:13:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2yw-00045V-Ib; Thu, 29 Nov 2012 12:12:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te2yv-00045P-ON
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 12:12:41 +0000
Received: from [85.158.139.211:59612] by server-9.bemta-5.messagelabs.com id
	4F/2C-29295-83157B05; Thu, 29 Nov 2012 12:12:40 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1354191151!18375349!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26211 invoked from network); 29 Nov 2012 12:12:33 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 12:12:33 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16067814"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 12:12:13 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 12:12:13 +0000
Message-ID: <1354191132.25834.164.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Thu, 29 Nov 2012 12:12:12 +0000
In-Reply-To: <50B74E9C.3050805@eu.citrix.com>
References: <patchbomb.1354104964@elijah>
	<538d9ffbd71b41e8cf6d.1354104965@elijah>
	<1354187797.25834.148.camel@zakaz.uk.xensource.com>
	<50B74E9C.3050805@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 1 of 2] libxl: Allow multiple USB devices on
 HVM domain creation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 12:01 +0000, George Dunlap wrote:
> On 29/11/12 11:16, Ian Campbell wrote:
> > On Wed, 2012-11-28 at 12:16 +0000, George Dunlap wrote:
> >> # HG changeset patch
> >> # User George Dunlap <george.dunlap@eu.citrix.com>
> >> # Date 1354101445 0
> >> # Node ID 538d9ffbd71b41e8cf6d7da0ded9e0a0b07f3c0d
> >> # Parent  ae6fb202b233af815466055d9f1a635802a50855
> >> libxl: Allow multiple USB devices on HVM domain creation
> >>
> >> This patch allows an HVM domain to be created with multiple USB
> >> devices.
> >>
> >> Since the previous interface only allowed the passing of a single
> >> device, this requires us to add a new element to the hvm struct of
> >> libxl_domain_build_info -- usbdevice_list.  For API compatibility, the
> >> old element, usbdevice, remains.
> >>
> >> If b_info->hvm.usbdevice is non-NULL, then it will be used exclusively;
> >> otherwise, libxl will check for b_info->hvm.usbdevice_list instead.
> > Is this the right way round? If the caller knows about usbdevice_list
> > enough to have set it to something then surely that's the one it wanted?
> 
>   Well, I had considered returning an error if both were set. :-)  I 
> suppose actually that's probably the way that is likely to flag up bugs 
> in the toolstack the best -- only doing one or the other will cause 
> weird buggy behavior that will be hard to track down.  Does that sound 
> good to you?
> 
> >> Each device listed will cause an extra "-usbdevice [foo]" to be appended
> >> to the qemu command line.
> >>
> >> In order to allow users of libxl to write software compatible with older
> >> versions of libxl, also define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST.  If
> >> this is present, the caller should use b_info->hvm.usbdevice_list; otherwise
> >> they should use b_info->hvm.usbdevice.
> > Actually it's a both stricter and looser than that, if
> > LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST is defined then the caller can
> > choose to use usbdevice_list but can also use usbdevice if they wish
> > (but not both). If it is not present then they must not use
> > usbdevice_list at all.
> 
> Hmm, I think I wrote this first and then changed it and forgot to update 
> it.  :-)  I also forgot that in this kind of "API spec" document, 
> "should" and "must" are technical terms with very specific definitions.  
> I'll revise it when I re-spin.

I don't think we actually use the RFC-whichever definitions of should
and must in general (and they would be SHOULD and MUST anyhow), it's
probably me being picky.

> > I wonder if this LIBXL_HAVE should also be contained in a #ifdef
> > LIBXL_API_VERSION >= 0x040300?
> 
> What would be the purpose of that?

LIBXL_API_VERSION and LIBXL_HAVE_* are two different mechanisms for
helping us to do API compatibility, I hadn't properly thought about the
interaction between them until now.

Adding the ifdef would expose the new feature only to those claiming
compatibility with the newer API.

More generally the purpose if LIBXL_API_VERSION generally is to allow us
to deprecate interfaces over time, which isn't quite the case here I
suppose.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 12:13:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 12:13:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te2yw-00045V-Ib; Thu, 29 Nov 2012 12:12:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te2yv-00045P-ON
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 12:12:41 +0000
Received: from [85.158.139.211:59612] by server-9.bemta-5.messagelabs.com id
	4F/2C-29295-83157B05; Thu, 29 Nov 2012 12:12:40 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1354191151!18375349!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26211 invoked from network); 29 Nov 2012 12:12:33 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 12:12:33 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16067814"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 12:12:13 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 12:12:13 +0000
Message-ID: <1354191132.25834.164.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Date: Thu, 29 Nov 2012 12:12:12 +0000
In-Reply-To: <50B74E9C.3050805@eu.citrix.com>
References: <patchbomb.1354104964@elijah>
	<538d9ffbd71b41e8cf6d.1354104965@elijah>
	<1354187797.25834.148.camel@zakaz.uk.xensource.com>
	<50B74E9C.3050805@eu.citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 1 of 2] libxl: Allow multiple USB devices on
 HVM domain creation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 12:01 +0000, George Dunlap wrote:
> On 29/11/12 11:16, Ian Campbell wrote:
> > On Wed, 2012-11-28 at 12:16 +0000, George Dunlap wrote:
> >> # HG changeset patch
> >> # User George Dunlap <george.dunlap@eu.citrix.com>
> >> # Date 1354101445 0
> >> # Node ID 538d9ffbd71b41e8cf6d7da0ded9e0a0b07f3c0d
> >> # Parent  ae6fb202b233af815466055d9f1a635802a50855
> >> libxl: Allow multiple USB devices on HVM domain creation
> >>
> >> This patch allows an HVM domain to be created with multiple USB
> >> devices.
> >>
> >> Since the previous interface only allowed the passing of a single
> >> device, this requires us to add a new element to the hvm struct of
> >> libxl_domain_build_info -- usbdevice_list.  For API compatibility, the
> >> old element, usbdevice, remains.
> >>
> >> If b_info->hvm.usbdevice is non-NULL, then it will be used exclusively;
> >> otherwise, libxl will check for b_info->hvm.usbdevice_list instead.
> > Is this the right way round? If the caller knows about usbdevice_list
> > enough to have set it to something then surely that's the one it wanted?
> 
>   Well, I had considered returning an error if both were set. :-)  I 
> suppose actually that's probably the way that is likely to flag up bugs 
> in the toolstack the best -- only doing one or the other will cause 
> weird buggy behavior that will be hard to track down.  Does that sound 
> good to you?
> 
> >> Each device listed will cause an extra "-usbdevice [foo]" to be appended
> >> to the qemu command line.
> >>
> >> In order to allow users of libxl to write software compatible with older
> >> versions of libxl, also define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST.  If
> >> this is present, the caller should use b_info->hvm.usbdevice_list; otherwise
> >> they should use b_info->hvm.usbdevice.
> > Actually it's a both stricter and looser than that, if
> > LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST is defined then the caller can
> > choose to use usbdevice_list but can also use usbdevice if they wish
> > (but not both). If it is not present then they must not use
> > usbdevice_list at all.
> 
> Hmm, I think I wrote this first and then changed it and forgot to update 
> it.  :-)  I also forgot that in this kind of "API spec" document, 
> "should" and "must" are technical terms with very specific definitions.  
> I'll revise it when I re-spin.

I don't think we actually use the RFC-whichever definitions of should
and must in general (and they would be SHOULD and MUST anyhow), it's
probably me being picky.

> > I wonder if this LIBXL_HAVE should also be contained in a #ifdef
> > LIBXL_API_VERSION >= 0x040300?
> 
> What would be the purpose of that?

LIBXL_API_VERSION and LIBXL_HAVE_* are two different mechanisms for
helping us to do API compatibility, I hadn't properly thought about the
interaction between them until now.

Adding the ifdef would expose the new feature only to those claiming
compatibility with the newer API.

More generally the purpose if LIBXL_API_VERSION generally is to allow us
to deprecate interfaces over time, which isn't quite the case here I
suppose.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 12:22:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 12:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te37q-0004JU-LL; Thu, 29 Nov 2012 12:21:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1Te37p-0004JP-8h
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 12:21:53 +0000
Received: from [85.158.143.35:48741] by server-2.bemta-4.messagelabs.com id
	F1/5E-28922-06357B05; Thu, 29 Nov 2012 12:21:52 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1354191647!12735512!1
X-Originating-IP: [209.85.220.171]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_20_30,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24043 invoked from network); 29 Nov 2012 12:20:50 -0000
Received: from mail-vc0-f171.google.com (HELO mail-vc0-f171.google.com)
	(209.85.220.171)
	by server-8.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 12:20:50 -0000
Received: by mail-vc0-f171.google.com with SMTP id fo14so15094450vcb.30
	for <xen-devel@lists.xensource.com>;
	Thu, 29 Nov 2012 04:20:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=oVhyV8QcB82VEaIlSUBgjaq5xLLbMEoAZH7Ifdl9s1Y=;
	b=Gk/uWYn979y83hIAgmiesCzZwm9ny3oyC4V8dZOBsuwzSFg/YG7yXlC10a3NI+LlK1
	PsWCGergO+xTDIJjeYii9NVMXfVl8iKS2zA8EtgozPr8wHqdAS9V4oOGgwh+C4TQZEz7
	Ix0sYkLgBiw6vIVjEJddeOpQK2H2qWOX6GdJZahD3u6leRuRF7awgdBHw+cb9hDYeZXL
	Sqhiq7x9GkeTDwbtti1Yg2Do5aN048COi/1iMoou00rO0PuFpEqaiaxuUlrwtUqh0do2
	NO6XELOpF78QUwkAjss1XT4w+AEWoY1ybQj6wdAoL0unCHLmVvAJqUykplUI/UcgduCd
	BE/w==
MIME-Version: 1.0
Received: by 10.52.68.242 with SMTP id z18mr5040640vdt.0.1354191646728; Thu,
	29 Nov 2012 04:20:46 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Thu, 29 Nov 2012 04:20:46 -0800 (PST)
In-Reply-To: <50B74AA8.3090504@eu.citrix.com>
References: <patchbomb.1354104964@elijah>
	<e87d8fad28e00090591b.1354104966@elijah>
	<20121128151119.GC8912@reaktio.net>
	<CAFLBxZb_YwCaDAUU4pqkzbdNF0D1rFDoELVZadunt3cr3v5Tig@mail.gmail.com>
	<1354187200.25834.143.camel@zakaz.uk.xensource.com>
	<50B74AA8.3090504@eu.citrix.com>
Date: Thu, 29 Nov 2012 12:20:46 +0000
X-Google-Sender-Auth: YnoIiTw3kmcdE3EIu0fDliAftRo
Message-ID: <CAFLBxZZqz0gJbPwfhEMxYFBTn7F_XpnevaFgB-_-OpSMrhaywA@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 2 of 2] xl: Accept a list for usbdevice in
 config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3459176989325243118=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============3459176989325243118==
Content-Type: multipart/alternative; boundary=20cf3079bb9c0fa0a704cfa150d9

--20cf3079bb9c0fa0a704cfa150d9
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Nov 29, 2012 at 11:44 AM, George Dunlap <george.dunlap@eu.citrix.com
> wrote:

> qemu.git/vl.c suggests other options might include, "disk:", "serial:",
> "net:" and "bt:"; other non-colon-including options include "keyboard",
> "mouse", "wacom-tablet", and "braile".
>
> On the other hand, a number of these seem to require supplementary options
> to work well; e.g., network and bt (bluetooth) require one argument to hook
> up a USB device, and another option to say how it's connected to what.
>
> It's also interesting to note that the KVM documentation doesnt' mention
> using "-usb" and "-usbdevice" at all -- they seem to prefer using "-device"
> to specify hubs &c.
>

Speaking of which, the KVM docs refer to "-usb" and "-usbdevice" as "legacy
interfaces", which will only get you piix3.  It seems like exposing the
full capabilities of qemu would mean either 1) coming up with a full
specifciation which we can then translate into qemu directives, as libvirt
seems to do, or 2) just recommend people construct their own qemu
command-line options to pass through.

It's not 100% clear to me that 1 is actually less complicated from a user
perspective in the long run than 2, and it's certainly a lot more work...

 -George

--20cf3079bb9c0fa0a704cfa150d9
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Thu, Nov 29, 2012 at 11:44 AM, George Dunlap <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:george.dunlap@eu.citrix.com" target=3D"_blank">george.dunlap@e=
u.citrix.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=
=3D"gmail_quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">qemu.git/vl.c suggests other options might i=
nclude, &quot;disk:&quot;, &quot;serial:&quot;, &quot;net:&quot; and &quot;=
bt:&quot;; other non-colon-including options include &quot;keyboard&quot;, =
&quot;mouse&quot;, &quot;wacom-tablet&quot;, and &quot;braile&quot;.<br>

<br>
On the other hand, a number of these seem to require supplementary options =
to work well; e.g., network and bt (bluetooth) require one argument to hook=
 up a USB device, and another option to say how it&#39;s connected to what.=
<br>

<br>
It&#39;s also interesting to note that the KVM documentation doesnt&#39; me=
ntion using &quot;-usb&quot; and &quot;-usbdevice&quot; at all -- they seem=
 to prefer using &quot;-device&quot; to specify hubs &amp;c.<br></blockquot=
e>
<div><br>Speaking of which, the KVM docs refer to &quot;-usb&quot; and &quo=
t;-usbdevice&quot; as &quot;legacy interfaces&quot;, which will only get yo=
u piix3.=A0 It seems like exposing the full capabilities of qemu would mean=
 either 1) coming up with a full specifciation which we can then translate =
into qemu directives, as libvirt seems to do, or 2) just recommend people c=
onstruct their own qemu command-line options to pass through.<br>
<br></div></div>It&#39;s not 100% clear to me that 1 is actually less compl=
icated from a user perspective in the long run than 2, and it&#39;s certain=
ly a lot more work...<br><br>=A0-George<br></div>

--20cf3079bb9c0fa0a704cfa150d9--


--===============3459176989325243118==
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.xen.org
http://lists.xen.org/xen-devel

--===============3459176989325243118==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 12:22:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 12:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te37q-0004JU-LL; Thu, 29 Nov 2012 12:21:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1Te37p-0004JP-8h
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 12:21:53 +0000
Received: from [85.158.143.35:48741] by server-2.bemta-4.messagelabs.com id
	F1/5E-28922-06357B05; Thu, 29 Nov 2012 12:21:52 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1354191647!12735512!1
X-Originating-IP: [209.85.220.171]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_20_30,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24043 invoked from network); 29 Nov 2012 12:20:50 -0000
Received: from mail-vc0-f171.google.com (HELO mail-vc0-f171.google.com)
	(209.85.220.171)
	by server-8.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 12:20:50 -0000
Received: by mail-vc0-f171.google.com with SMTP id fo14so15094450vcb.30
	for <xen-devel@lists.xensource.com>;
	Thu, 29 Nov 2012 04:20:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=oVhyV8QcB82VEaIlSUBgjaq5xLLbMEoAZH7Ifdl9s1Y=;
	b=Gk/uWYn979y83hIAgmiesCzZwm9ny3oyC4V8dZOBsuwzSFg/YG7yXlC10a3NI+LlK1
	PsWCGergO+xTDIJjeYii9NVMXfVl8iKS2zA8EtgozPr8wHqdAS9V4oOGgwh+C4TQZEz7
	Ix0sYkLgBiw6vIVjEJddeOpQK2H2qWOX6GdJZahD3u6leRuRF7awgdBHw+cb9hDYeZXL
	Sqhiq7x9GkeTDwbtti1Yg2Do5aN048COi/1iMoou00rO0PuFpEqaiaxuUlrwtUqh0do2
	NO6XELOpF78QUwkAjss1XT4w+AEWoY1ybQj6wdAoL0unCHLmVvAJqUykplUI/UcgduCd
	BE/w==
MIME-Version: 1.0
Received: by 10.52.68.242 with SMTP id z18mr5040640vdt.0.1354191646728; Thu,
	29 Nov 2012 04:20:46 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Thu, 29 Nov 2012 04:20:46 -0800 (PST)
In-Reply-To: <50B74AA8.3090504@eu.citrix.com>
References: <patchbomb.1354104964@elijah>
	<e87d8fad28e00090591b.1354104966@elijah>
	<20121128151119.GC8912@reaktio.net>
	<CAFLBxZb_YwCaDAUU4pqkzbdNF0D1rFDoELVZadunt3cr3v5Tig@mail.gmail.com>
	<1354187200.25834.143.camel@zakaz.uk.xensource.com>
	<50B74AA8.3090504@eu.citrix.com>
Date: Thu, 29 Nov 2012 12:20:46 +0000
X-Google-Sender-Auth: YnoIiTw3kmcdE3EIu0fDliAftRo
Message-ID: <CAFLBxZZqz0gJbPwfhEMxYFBTn7F_XpnevaFgB-_-OpSMrhaywA@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 2 of 2] xl: Accept a list for usbdevice in
 config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3459176989325243118=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============3459176989325243118==
Content-Type: multipart/alternative; boundary=20cf3079bb9c0fa0a704cfa150d9

--20cf3079bb9c0fa0a704cfa150d9
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Nov 29, 2012 at 11:44 AM, George Dunlap <george.dunlap@eu.citrix.com
> wrote:

> qemu.git/vl.c suggests other options might include, "disk:", "serial:",
> "net:" and "bt:"; other non-colon-including options include "keyboard",
> "mouse", "wacom-tablet", and "braile".
>
> On the other hand, a number of these seem to require supplementary options
> to work well; e.g., network and bt (bluetooth) require one argument to hook
> up a USB device, and another option to say how it's connected to what.
>
> It's also interesting to note that the KVM documentation doesnt' mention
> using "-usb" and "-usbdevice" at all -- they seem to prefer using "-device"
> to specify hubs &c.
>

Speaking of which, the KVM docs refer to "-usb" and "-usbdevice" as "legacy
interfaces", which will only get you piix3.  It seems like exposing the
full capabilities of qemu would mean either 1) coming up with a full
specifciation which we can then translate into qemu directives, as libvirt
seems to do, or 2) just recommend people construct their own qemu
command-line options to pass through.

It's not 100% clear to me that 1 is actually less complicated from a user
perspective in the long run than 2, and it's certainly a lot more work...

 -George

--20cf3079bb9c0fa0a704cfa150d9
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Thu, Nov 29, 2012 at 11:44 AM, George Dunlap <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:george.dunlap@eu.citrix.com" target=3D"_blank">george.dunlap@e=
u.citrix.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=
=3D"gmail_quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">qemu.git/vl.c suggests other options might i=
nclude, &quot;disk:&quot;, &quot;serial:&quot;, &quot;net:&quot; and &quot;=
bt:&quot;; other non-colon-including options include &quot;keyboard&quot;, =
&quot;mouse&quot;, &quot;wacom-tablet&quot;, and &quot;braile&quot;.<br>

<br>
On the other hand, a number of these seem to require supplementary options =
to work well; e.g., network and bt (bluetooth) require one argument to hook=
 up a USB device, and another option to say how it&#39;s connected to what.=
<br>

<br>
It&#39;s also interesting to note that the KVM documentation doesnt&#39; me=
ntion using &quot;-usb&quot; and &quot;-usbdevice&quot; at all -- they seem=
 to prefer using &quot;-device&quot; to specify hubs &amp;c.<br></blockquot=
e>
<div><br>Speaking of which, the KVM docs refer to &quot;-usb&quot; and &quo=
t;-usbdevice&quot; as &quot;legacy interfaces&quot;, which will only get yo=
u piix3.=A0 It seems like exposing the full capabilities of qemu would mean=
 either 1) coming up with a full specifciation which we can then translate =
into qemu directives, as libvirt seems to do, or 2) just recommend people c=
onstruct their own qemu command-line options to pass through.<br>
<br></div></div>It&#39;s not 100% clear to me that 1 is actually less compl=
icated from a user perspective in the long run than 2, and it&#39;s certain=
ly a lot more work...<br><br>=A0-George<br></div>

--20cf3079bb9c0fa0a704cfa150d9--


--===============3459176989325243118==
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.xen.org
http://lists.xen.org/xen-devel

--===============3459176989325243118==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 12:28:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 12:28:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te3De-0004Rr-IJ; Thu, 29 Nov 2012 12:27:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te3Dc-0004Ri-9o
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 12:27:52 +0000
Received: from [85.158.143.99:5712] by server-2.bemta-4.messagelabs.com id
	11/E6-28922-7C457B05; Thu, 29 Nov 2012 12:27:51 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1354191957!19812994!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2053 invoked from network); 29 Nov 2012 12:25:58 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 12:25:58 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16068138"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 12:25:57 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 12:25:57 +0000
Message-ID: <1354191956.25834.169.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Date: Thu, 29 Nov 2012 12:25:56 +0000
In-Reply-To: <CAFLBxZZqz0gJbPwfhEMxYFBTn7F_XpnevaFgB-_-OpSMrhaywA@mail.gmail.com>
References: <patchbomb.1354104964@elijah>
	<e87d8fad28e00090591b.1354104966@elijah>
	<20121128151119.GC8912@reaktio.net>
	<CAFLBxZb_YwCaDAUU4pqkzbdNF0D1rFDoELVZadunt3cr3v5Tig@mail.gmail.com>
	<1354187200.25834.143.camel@zakaz.uk.xensource.com>
	<50B74AA8.3090504@eu.citrix.com>
	<CAFLBxZZqz0gJbPwfhEMxYFBTn7F_XpnevaFgB-_-OpSMrhaywA@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 2 of 2] xl: Accept a list for usbdevice in
 config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 12:20 +0000, George Dunlap wrote:
> On Thu, Nov 29, 2012 at 11:44 AM, George Dunlap
> <george.dunlap@eu.citrix.com> wrote:
>         qemu.git/vl.c suggests other options might include, "disk:",
>         "serial:", "net:" and "bt:"; other non-colon-including options
>         include "keyboard", "mouse", "wacom-tablet", and "braile".
>         
>         On the other hand, a number of these seem to require
>         supplementary options to work well; e.g., network and bt
>         (bluetooth) require one argument to hook up a USB device, and
>         another option to say how it's connected to what.
>         
>         It's also interesting to note that the KVM documentation
>         doesnt' mention using "-usb" and "-usbdevice" at all -- they
>         seem to prefer using "-device" to specify hubs &c.
> 
> Speaking of which, the KVM docs refer to "-usb" and "-usbdevice" as
> "legacy interfaces", which will only get you piix3.

This is a concern for other types of device too. We seem to invoke new
qemu with a mixture of legacy and new-style interfaces.

>   It seems like exposing the full capabilities of qemu would mean
> either 1) coming up with a full specifciation which we can then
> translate into qemu directives, as libvirt seems to do, or 2) just
> recommend people construct their own qemu command-line options to pass
> through.

Does libvirt let you care about topologies or just it just automatically
create a new USB controller for every N devices you add and hook things
up in some order?

> It's not 100% clear to me that 1 is actually less complicated from a
> user perspective in the long run than 2, and it's certainly a lot more
> work...
> 
>  -George
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 12:28:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 12:28:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te3De-0004Rr-IJ; Thu, 29 Nov 2012 12:27:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te3Dc-0004Ri-9o
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 12:27:52 +0000
Received: from [85.158.143.99:5712] by server-2.bemta-4.messagelabs.com id
	11/E6-28922-7C457B05; Thu, 29 Nov 2012 12:27:51 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1354191957!19812994!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2053 invoked from network); 29 Nov 2012 12:25:58 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 12:25:58 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16068138"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 12:25:57 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 12:25:57 +0000
Message-ID: <1354191956.25834.169.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Date: Thu, 29 Nov 2012 12:25:56 +0000
In-Reply-To: <CAFLBxZZqz0gJbPwfhEMxYFBTn7F_XpnevaFgB-_-OpSMrhaywA@mail.gmail.com>
References: <patchbomb.1354104964@elijah>
	<e87d8fad28e00090591b.1354104966@elijah>
	<20121128151119.GC8912@reaktio.net>
	<CAFLBxZb_YwCaDAUU4pqkzbdNF0D1rFDoELVZadunt3cr3v5Tig@mail.gmail.com>
	<1354187200.25834.143.camel@zakaz.uk.xensource.com>
	<50B74AA8.3090504@eu.citrix.com>
	<CAFLBxZZqz0gJbPwfhEMxYFBTn7F_XpnevaFgB-_-OpSMrhaywA@mail.gmail.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 2 of 2] xl: Accept a list for usbdevice in
 config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 12:20 +0000, George Dunlap wrote:
> On Thu, Nov 29, 2012 at 11:44 AM, George Dunlap
> <george.dunlap@eu.citrix.com> wrote:
>         qemu.git/vl.c suggests other options might include, "disk:",
>         "serial:", "net:" and "bt:"; other non-colon-including options
>         include "keyboard", "mouse", "wacom-tablet", and "braile".
>         
>         On the other hand, a number of these seem to require
>         supplementary options to work well; e.g., network and bt
>         (bluetooth) require one argument to hook up a USB device, and
>         another option to say how it's connected to what.
>         
>         It's also interesting to note that the KVM documentation
>         doesnt' mention using "-usb" and "-usbdevice" at all -- they
>         seem to prefer using "-device" to specify hubs &c.
> 
> Speaking of which, the KVM docs refer to "-usb" and "-usbdevice" as
> "legacy interfaces", which will only get you piix3.

This is a concern for other types of device too. We seem to invoke new
qemu with a mixture of legacy and new-style interfaces.

>   It seems like exposing the full capabilities of qemu would mean
> either 1) coming up with a full specifciation which we can then
> translate into qemu directives, as libvirt seems to do, or 2) just
> recommend people construct their own qemu command-line options to pass
> through.

Does libvirt let you care about topologies or just it just automatically
create a new USB controller for every N devices you add and hook things
up in some order?

> It's not 100% clear to me that 1 is actually less complicated from a
> user perspective in the long run than 2, and it's certainly a lot more
> work...
> 
>  -George
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 12:33:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 12:33:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te3JC-0004dq-Dj; Thu, 29 Nov 2012 12:33:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1Te3JA-0004dl-Sw
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 12:33:37 +0000
Received: from [85.158.139.211:52780] by server-14.bemta-5.messagelabs.com id
	42/A5-21768-02657B05; Thu, 29 Nov 2012 12:33:36 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1354192414!18385919!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU0MDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10695 invoked from network); 29 Nov 2012 12:33:35 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 12:33:35 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="46015443"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 12:33:19 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 07:33:19 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1Te3It-0005yz-5f;
	Thu, 29 Nov 2012 12:33:19 +0000
Message-ID: <50B754B8.40900@eu.citrix.com>
Date: Thu, 29 Nov 2012 12:27:36 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <patchbomb.1354104964@elijah>
	<e87d8fad28e00090591b.1354104966@elijah>
	<20121128151119.GC8912@reaktio.net>
	<CAFLBxZb_YwCaDAUU4pqkzbdNF0D1rFDoELVZadunt3cr3v5Tig@mail.gmail.com>
	<1354187200.25834.143.camel@zakaz.uk.xensource.com>
	<50B74AA8.3090504@eu.citrix.com>
	<CAFLBxZZqz0gJbPwfhEMxYFBTn7F_XpnevaFgB-_-OpSMrhaywA@mail.gmail.com>
	<1354191956.25834.169.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354191956.25834.169.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 2 of 2] xl: Accept a list for usbdevice in
 config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 29/11/12 12:25, Ian Campbell wrote:
> On Thu, 2012-11-29 at 12:20 +0000, George Dunlap wrote:
>> On Thu, Nov 29, 2012 at 11:44 AM, George Dunlap
>> <george.dunlap@eu.citrix.com> wrote:
>>          qemu.git/vl.c suggests other options might include, "disk:",
>>          "serial:", "net:" and "bt:"; other non-colon-including options
>>          include "keyboard", "mouse", "wacom-tablet", and "braile".
>>          
>>          On the other hand, a number of these seem to require
>>          supplementary options to work well; e.g., network and bt
>>          (bluetooth) require one argument to hook up a USB device, and
>>          another option to say how it's connected to what.
>>          
>>          It's also interesting to note that the KVM documentation
>>          doesnt' mention using "-usb" and "-usbdevice" at all -- they
>>          seem to prefer using "-device" to specify hubs &c.
>>
>> Speaking of which, the KVM docs refer to "-usb" and "-usbdevice" as
>> "legacy interfaces", which will only get you piix3.
> This is a concern for other types of device too. We seem to invoke new
> qemu with a mixture of legacy and new-style interfaces.
>
>>    It seems like exposing the full capabilities of qemu would mean
>> either 1) coming up with a full specifciation which we can then
>> translate into qemu directives, as libvirt seems to do, or 2) just
>> recommend people construct their own qemu command-line options to pass
>> through.
> Does libvirt let you care about topologies or just it just automatically
> create a new USB controller for every N devices you add and hook things
> up in some order?

No idea -- I took a quick glance through the libvirt docs and I didn't 
see anything particular about a topology.  I don't have a system set up 
with libvirt, so I can't try it and see what the resulting qemu command 
line looks like :-)

http://libvirt.org/formatdomain.html#elementsUSB

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 12:33:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 12:33:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te3JC-0004dq-Dj; Thu, 29 Nov 2012 12:33:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1Te3JA-0004dl-Sw
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 12:33:37 +0000
Received: from [85.158.139.211:52780] by server-14.bemta-5.messagelabs.com id
	42/A5-21768-02657B05; Thu, 29 Nov 2012 12:33:36 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1354192414!18385919!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU0MDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10695 invoked from network); 29 Nov 2012 12:33:35 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 12:33:35 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="46015443"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 12:33:19 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 07:33:19 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1Te3It-0005yz-5f;
	Thu, 29 Nov 2012 12:33:19 +0000
Message-ID: <50B754B8.40900@eu.citrix.com>
Date: Thu, 29 Nov 2012 12:27:36 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <patchbomb.1354104964@elijah>
	<e87d8fad28e00090591b.1354104966@elijah>
	<20121128151119.GC8912@reaktio.net>
	<CAFLBxZb_YwCaDAUU4pqkzbdNF0D1rFDoELVZadunt3cr3v5Tig@mail.gmail.com>
	<1354187200.25834.143.camel@zakaz.uk.xensource.com>
	<50B74AA8.3090504@eu.citrix.com>
	<CAFLBxZZqz0gJbPwfhEMxYFBTn7F_XpnevaFgB-_-OpSMrhaywA@mail.gmail.com>
	<1354191956.25834.169.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354191956.25834.169.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 2 of 2] xl: Accept a list for usbdevice in
 config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 29/11/12 12:25, Ian Campbell wrote:
> On Thu, 2012-11-29 at 12:20 +0000, George Dunlap wrote:
>> On Thu, Nov 29, 2012 at 11:44 AM, George Dunlap
>> <george.dunlap@eu.citrix.com> wrote:
>>          qemu.git/vl.c suggests other options might include, "disk:",
>>          "serial:", "net:" and "bt:"; other non-colon-including options
>>          include "keyboard", "mouse", "wacom-tablet", and "braile".
>>          
>>          On the other hand, a number of these seem to require
>>          supplementary options to work well; e.g., network and bt
>>          (bluetooth) require one argument to hook up a USB device, and
>>          another option to say how it's connected to what.
>>          
>>          It's also interesting to note that the KVM documentation
>>          doesnt' mention using "-usb" and "-usbdevice" at all -- they
>>          seem to prefer using "-device" to specify hubs &c.
>>
>> Speaking of which, the KVM docs refer to "-usb" and "-usbdevice" as
>> "legacy interfaces", which will only get you piix3.
> This is a concern for other types of device too. We seem to invoke new
> qemu with a mixture of legacy and new-style interfaces.
>
>>    It seems like exposing the full capabilities of qemu would mean
>> either 1) coming up with a full specifciation which we can then
>> translate into qemu directives, as libvirt seems to do, or 2) just
>> recommend people construct their own qemu command-line options to pass
>> through.
> Does libvirt let you care about topologies or just it just automatically
> create a new USB controller for every N devices you add and hook things
> up in some order?

No idea -- I took a quick glance through the libvirt docs and I didn't 
see anything particular about a topology.  I don't have a system set up 
with libvirt, so I can't try it and see what the resulting qemu command 
line looks like :-)

http://libvirt.org/formatdomain.html#elementsUSB

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 12:43:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 12:43:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te3Sr-0004t6-Hv; Thu, 29 Nov 2012 12:43:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Te3Sp-0004t1-Ip
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 12:43:35 +0000
Received: from [85.158.143.99:32332] by server-3.bemta-4.messagelabs.com id
	5E/C2-06841-67857B05; Thu, 29 Nov 2012 12:43:34 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354193004!22096004!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1388 invoked from network); 29 Nov 2012 12:43:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 12:43:24 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16068545"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 12:43:24 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 12:43:23 +0000
Message-ID: <50B7586B.1060700@citrix.com>
Date: Thu, 29 Nov 2012 13:43:23 +0100
From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
	<1354010620-31788-2-git-send-email-roger.pau@citrix.com>
	<1354186182.25834.131.camel@zakaz.uk.xensource.com>
	<50B74745.5030706@citrix.com>
	<1354188873.25834.155.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354188873.25834.155.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] docs: expand persistent grants protocol
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors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cKaHR0
cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Thu Nov 29 12:43:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 12:43:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te3Sr-0004t6-Hv; Thu, 29 Nov 2012 12:43:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Te3Sp-0004t1-Ip
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 12:43:35 +0000
Received: from [85.158.143.99:32332] by server-3.bemta-4.messagelabs.com id
	5E/C2-06841-67857B05; Thu, 29 Nov 2012 12:43:34 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354193004!22096004!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1388 invoked from network); 29 Nov 2012 12:43:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 12:43:24 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16068545"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 12:43:24 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 12:43:23 +0000
Message-ID: <50B7586B.1060700@citrix.com>
Date: Thu, 29 Nov 2012 13:43:23 +0100
From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1354010620-31788-1-git-send-email-roger.pau@citrix.com>
	<1354010620-31788-2-git-send-email-roger.pau@citrix.com>
	<1354186182.25834.131.camel@zakaz.uk.xensource.com>
	<50B74745.5030706@citrix.com>
	<1354188873.25834.155.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354188873.25834.155.camel@zakaz.uk.xensource.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] docs: expand persistent grants protocol
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gMjkvMTEvMTIgMTI6MzQsIElhbiBDYW1wYmVsbCB3cm90ZToKPiBPbiBUaHUsIDIwMTItMTEt
MjkgYXQgMTE6MzAgKzAwMDAsIFJvZ2VyIFBhdSBNb25uZSB3cm90ZToKPj4gT24gMjkvMTEvMTIg
M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zdG9yZSBwZXJzaXN0ZW50bHkKPj4gbWFwcGVkIGdyYW50cywgc28gd2Ug
YXJlIHRyeWluZyB0byBhbHdheXMgcmV1c2UgdGhlIHNhbWUgc3Vic2V0IG9mCj4+IHBlcnNpc3Rl
bnRseSBtYXBwZWQgZ3JhbnRzIHdoZW4gYmxrZnJvbnQgaXMgbm90IHVuZGVyIGhlYXZ5IEkvTyBs
b2FkLgo+IAo+IEkgdGhpbmsgdGhpcyBpcyB3b3J0aCBkb2N1bWVudGluZyBhcyBhbiBhY3R1YWwg
aW1wbGVtZW50YXRpb24KPiByZWNvbW1lbmRhdGlvbiwgdG8gaW1wcm92ZSBpbnRlcm9wZXJhYmls
aXR5LiBJZiBzb21lb25lIGhhcHBlbmVkIHRvCj4gaW1wbGVtZW50IGEgRklGTyBpbnN0ZWFkIHRo
ZW4gdGhleSB3b3VsZCBnZXQgc29tZSBzb3J0IG9mIHBhdGhvbG9naWNhbAo+IGJlaGF2aW91ci4K
PiAKPiBJdCBtYXkgZXZlbiBiZSB3b3J0aCBkb2N1bWVudGluZyB0aGF0IHRoZSBiLmUuIHNob3Vs
ZCB1c2UgYW4gTFJVIHNjaGVtZS4KClRoYW5rcyBmb3IgdGhlIHJldmlldywgSSdtIGdvaW5nIHRv
IGFkZCB0aGUgcmVjb21tZW5kYXRpb25zIHdlIHRhbGtlZAphYm91dCB0byB0aGUgcHJvdG9jb2wg
YW5kIHJlc3VibWl0LgoKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRldmVsQGxpc3RzLnhlbi5vcmcKaHR0
cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Thu Nov 29 13:16:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 13:16:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te3xr-0005H8-FP; Thu, 29 Nov 2012 13:15:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Te3xq-0005H3-De
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 13:15:38 +0000
Received: from [85.158.138.51:41091] by server-6.bemta-3.messagelabs.com id
	B1/2A-28265-9FF57B05; Thu, 29 Nov 2012 13:15:37 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1354194936!24082479!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27525 invoked from network); 29 Nov 2012 13:15:36 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 13:15:36 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 29 Nov 2012 13:17:56 +0000
Message-Id: <50B76E3F02000078000AC7D8@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 29 Nov 2012 13:16:31 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <50B5B48C.7040804@jp.fujitsu.com>
	<50B5DBD702000078000AC021@nat28.tlf.novell.com>
	<50B6B3AA.2080505@jp.fujitsu.com>
	<50B71C5302000078000AC5CE@nat28.tlf.novell.com>
	<20121129110505.GA80627@ocelot.phlegethon.org>
In-Reply-To: <20121129110505.GA80627@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Kouya Shimura <kouya@jp.fujitsu.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] x86/hap: Fix memory leak of
 domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 29.11.12 at 12:05, Tim Deegan <tim@xen.org> wrote:
> At 07:26 +0000 on 29 Nov (1354174019), Jan Beulich wrote:
>> >>> On 29.11.12 at 02:00, Kouya Shimura <kouya@jp.fujitsu.com> wrote:
>> > On 11/28/2012 05:39 PM, Jan Beulich wrote:
>> >>>>> On 28.11.12 at 07:51, Kouya Shimura <kouya@jp.fujitsu.com> wrote:
>> >>> This patch fixes the memory leak of domain->arch.hvm_domain.dirty_vram.
>> >>>
>> >>> Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
>> >>
>> >> Wouldn't it be more consistent (and less redundant) to do this
>> >> through calling hap_track_dirty_vram(d, 0, 0, ...)? And even if
>> >> not, the conditional around the freeing/clearing is pointless.
>> > 
>> >  From another point of view, it's consistent since it almost
>> > copied from shadow_teardown()@xen/arch/x86/mm/shadow/common.c.
>> > That is a sibling function of hap_teardown().
>> > If it's not preferable, another cleanup patch should be made.
>> 
>> Tim will have the final say here anyway.
> 
> I have taken the conditional out but left it as an explicit free(). 
> It might not always be safe to call hap_track_dirty_vram(), even for
> disabling, this late in the teardown.

So is this something we also want to have on 4.2 and 4.1?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 13:16:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 13:16:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te3xr-0005H8-FP; Thu, 29 Nov 2012 13:15:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1Te3xq-0005H3-De
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 13:15:38 +0000
Received: from [85.158.138.51:41091] by server-6.bemta-3.messagelabs.com id
	B1/2A-28265-9FF57B05; Thu, 29 Nov 2012 13:15:37 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1354194936!24082479!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27525 invoked from network); 29 Nov 2012 13:15:36 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-12.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 13:15:36 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Thu, 29 Nov 2012 13:17:56 +0000
Message-Id: <50B76E3F02000078000AC7D8@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Thu, 29 Nov 2012 13:16:31 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Tim Deegan" <tim@xen.org>
References: <50B5B48C.7040804@jp.fujitsu.com>
	<50B5DBD702000078000AC021@nat28.tlf.novell.com>
	<50B6B3AA.2080505@jp.fujitsu.com>
	<50B71C5302000078000AC5CE@nat28.tlf.novell.com>
	<20121129110505.GA80627@ocelot.phlegethon.org>
In-Reply-To: <20121129110505.GA80627@ocelot.phlegethon.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Kouya Shimura <kouya@jp.fujitsu.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] x86/hap: Fix memory leak of
 domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 29.11.12 at 12:05, Tim Deegan <tim@xen.org> wrote:
> At 07:26 +0000 on 29 Nov (1354174019), Jan Beulich wrote:
>> >>> On 29.11.12 at 02:00, Kouya Shimura <kouya@jp.fujitsu.com> wrote:
>> > On 11/28/2012 05:39 PM, Jan Beulich wrote:
>> >>>>> On 28.11.12 at 07:51, Kouya Shimura <kouya@jp.fujitsu.com> wrote:
>> >>> This patch fixes the memory leak of domain->arch.hvm_domain.dirty_vram.
>> >>>
>> >>> Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
>> >>
>> >> Wouldn't it be more consistent (and less redundant) to do this
>> >> through calling hap_track_dirty_vram(d, 0, 0, ...)? And even if
>> >> not, the conditional around the freeing/clearing is pointless.
>> > 
>> >  From another point of view, it's consistent since it almost
>> > copied from shadow_teardown()@xen/arch/x86/mm/shadow/common.c.
>> > That is a sibling function of hap_teardown().
>> > If it's not preferable, another cleanup patch should be made.
>> 
>> Tim will have the final say here anyway.
> 
> I have taken the conditional out but left it as an explicit free(). 
> It might not always be safe to call hap_track_dirty_vram(), even for
> disabling, this late in the teardown.

So is this something we also want to have on 4.2 and 4.1?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 13:22:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 13:22:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te44B-0005Uu-C7; Thu, 29 Nov 2012 13:22:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1Te44A-0005Um-E7
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 13:22:10 +0000
Received: from [85.158.143.35:19690] by server-3.bemta-4.messagelabs.com id
	B5/59-06841-18167B05; Thu, 29 Nov 2012 13:22:09 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1354195281!16010724!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU0MDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5869 invoked from network); 29 Nov 2012 13:21:23 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 13:21:23 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="46019639"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 13:21:21 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 08:21:21 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1Te43M-0006hC-MA;
	Thu, 29 Nov 2012 13:21:20 +0000
Date: Thu, 29 Nov 2012 13:21:16 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: "Xu, Dongxiao" <dongxiao.xu@intel.com>
In-Reply-To: <40776A41FC278F40B59438AD47D147A90FEAE3A2@SHSMSX102.ccr.corp.intel.com>
Message-ID: <alpine.DEB.2.02.1211291320500.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1209101842150.15568@kaball.uk.xensource.com>
	<40776A41FC278F40B59438AD47D147A90FE40092@SHSMSX102.ccr.corp.intel.com>
	<alpine.DEB.2.02.1209181123280.29232@kaball.uk.xensource.com>
	<40776A41FC278F40B59438AD47D147A90FEAE3A2@SHSMSX102.ccr.corp.intel.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and
 cpu_ioreq_move
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 29 Nov 2012, Xu, Dongxiao wrote:
> > -----Original Message-----
> > From: Stefano Stabellini [mailto:stefano.stabellini@eu.citrix.com]
> > Sent: Tuesday, September 18, 2012 6:24 PM
> > To: Xu, Dongxiao
> > Cc: Stefano Stabellini; xen-devel@lists.xensource.com; Ian Jackson;
> > qemu-devel@nongnu.org; Keir (Xen.org)
> > Subject: RE: [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and
> > cpu_ioreq_move
> > 
> > On Tue, 18 Sep 2012, Xu, Dongxiao wrote:
> > > Hi Stefano,
> > >
> > > Is these patches merged with Xen 4.2? I didn't see them in the upstream.
> > > The uint/int fix is critical to fix the nested guest boot issue.
> > 
> > They are not. Ian decided that he wanted to merge a different version of them.
> 
> Hi Stefano and Ian,
> 
> What's the status of the two patches? I still didn't see them merged...

Ian, do you have any updates?


> Also I think 4.2.1 need these patches to enable the basic Xen on Xen nested virtualization usage scenario.

I agree.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 13:22:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 13:22:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te44B-0005Uu-C7; Thu, 29 Nov 2012 13:22:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1Te44A-0005Um-E7
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 13:22:10 +0000
Received: from [85.158.143.35:19690] by server-3.bemta-4.messagelabs.com id
	B5/59-06841-18167B05; Thu, 29 Nov 2012 13:22:09 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1354195281!16010724!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU0MDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5869 invoked from network); 29 Nov 2012 13:21:23 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 13:21:23 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="46019639"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 13:21:21 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 08:21:21 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1Te43M-0006hC-MA;
	Thu, 29 Nov 2012 13:21:20 +0000
Date: Thu, 29 Nov 2012 13:21:16 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: "Xu, Dongxiao" <dongxiao.xu@intel.com>
In-Reply-To: <40776A41FC278F40B59438AD47D147A90FEAE3A2@SHSMSX102.ccr.corp.intel.com>
Message-ID: <alpine.DEB.2.02.1211291320500.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1209101842150.15568@kaball.uk.xensource.com>
	<40776A41FC278F40B59438AD47D147A90FE40092@SHSMSX102.ccr.corp.intel.com>
	<alpine.DEB.2.02.1209181123280.29232@kaball.uk.xensource.com>
	<40776A41FC278F40B59438AD47D147A90FEAE3A2@SHSMSX102.ccr.corp.intel.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "Keir \(Xen.org\)" <keir@xen.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and
 cpu_ioreq_move
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 29 Nov 2012, Xu, Dongxiao wrote:
> > -----Original Message-----
> > From: Stefano Stabellini [mailto:stefano.stabellini@eu.citrix.com]
> > Sent: Tuesday, September 18, 2012 6:24 PM
> > To: Xu, Dongxiao
> > Cc: Stefano Stabellini; xen-devel@lists.xensource.com; Ian Jackson;
> > qemu-devel@nongnu.org; Keir (Xen.org)
> > Subject: RE: [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and
> > cpu_ioreq_move
> > 
> > On Tue, 18 Sep 2012, Xu, Dongxiao wrote:
> > > Hi Stefano,
> > >
> > > Is these patches merged with Xen 4.2? I didn't see them in the upstream.
> > > The uint/int fix is critical to fix the nested guest boot issue.
> > 
> > They are not. Ian decided that he wanted to merge a different version of them.
> 
> Hi Stefano and Ian,
> 
> What's the status of the two patches? I still didn't see them merged...

Ian, do you have any updates?


> Also I think 4.2.1 need these patches to enable the basic Xen on Xen nested virtualization usage scenario.

I agree.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 13:54:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 13:54:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te4ZT-0005rc-5N; Thu, 29 Nov 2012 13:54:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te4ZR-0005rX-8w
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 13:54:29 +0000
Received: from [85.158.138.51:53588] by server-14.bemta-3.messagelabs.com id
	BE/E3-31424-41967B05; Thu, 29 Nov 2012 13:54:28 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-5.tower-174.messagelabs.com!1354197266!32086079!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14143 invoked from network); 29 Nov 2012 13:54:27 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-5.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 13:54:27 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158358539;
	Thu, 29 Nov 2012 08:54:19 -0500
Message-ID: <50B76905.90503@jhuapl.edu>
Date: Thu, 29 Nov 2012 08:54:13 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353664797.13542.190.camel@zakaz.uk.xensource.com>
	<20663.18782.886504.606333@mariner.uk.xensource.com>
	<20663.18917.138256.303363@mariner.uk.xensource.com>
In-Reply-To: <20663.18917.138256.303363@mariner.uk.xensource.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs
	to stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7157780685854680839=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============7157780685854680839==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms060708060305080101060604"

This is a cryptographically signed message in MIME format.

--------------ms060708060305080101060604
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

As annoying as it may be, I think having a configure script or something =

similar is the only right answer. More hidden makefile variables and=20
hacks makes everything more complicated. Before the existence of the=20
configure script Xen's build system was a huge pain to work with. Its=20
still not perfect.

So here are 2 proposals:

Add a configure.ac to stubdom. I can whip up a simple one where you can=20
enable/disable specific stub domains. Other options could be setting the =

fetch urls for the libraries. People can add more options later. Now if=20
people disable vtpm, the check for cmake goes away.

Move /tools/configure.ac to /configure.ac. Use this configure script to=20
configure the entire build. /Makefile still exists and works with or=20
without configuring, to enable building of the hypervisor.

If we don't want to do this now, then I vote to just make cmake a=20
dependency for Xen without adding messy conditional hacks.

On 11/29/2012 06:41 AM, Ian Jackson wrote:
> Ian Jackson writes ("Re: [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required =
libs to stubdom/Makefile"):
>> I guess it would be possible to have an ad-hoc switch in Config.mk
>> (say) but I'm not sure this is better than just adding cmake as a hard=

>> dependency.
> Although, can we have a manual y/n switch in Config.mk so that if
> someone has trouble with this feature they can turn off the build ?
>
> Thanks,
> Ian.



--------------ms060708060305080101060604
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"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AxMFQ1JMNTYwHwYDVR0jBBgwFoAUCDUpmxH52EU2CyWmF2EJMB1yqeswHQYD
VR0OBBYEFO6LYxg6r9wHZ+zdQtBHn1dZ/YTNMAkGA1UdEwQCMAAwGQYJKoZIhvZ9B0EABAww
ChsEVjcuMQMCBLAwDQYJKoZIhvcNAQEFBQADgYEAJO9HQh4YNChVLzuZqK5ARJARD8JoujGZ
fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEyOTEzNTQxM1owIwYJKoZIhvcNAQkEMRYEFDRJOIwA9xnPWJJv
BBzT97OiwECkMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYA9b+FtsmMcPvQOqkyc8QWpXpcsBq4VvUJS
S3usqxLaWHUd7j06ofrdoiFOx83qXFuxnBBIH31pkttlvDnKGfXhmW4Eni+gtbely4KY39Os
1RB1tECDSDJwd5KJVBueQQ2K+Pd3iaVKF8OOvGS+EmmO2Dv7Ui57qeA+Oc3ao1HBrQAAAAAA
AA==
--------------ms060708060305080101060604--


--===============7157780685854680839==
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.xen.org
http://lists.xen.org/xen-devel

--===============7157780685854680839==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 13:54:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 13:54:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te4ZT-0005rc-5N; Thu, 29 Nov 2012 13:54:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te4ZR-0005rX-8w
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 13:54:29 +0000
Received: from [85.158.138.51:53588] by server-14.bemta-3.messagelabs.com id
	BE/E3-31424-41967B05; Thu, 29 Nov 2012 13:54:28 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-5.tower-174.messagelabs.com!1354197266!32086079!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14143 invoked from network); 29 Nov 2012 13:54:27 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-5.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 13:54:27 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158358539;
	Thu, 29 Nov 2012 08:54:19 -0500
Message-ID: <50B76905.90503@jhuapl.edu>
Date: Thu, 29 Nov 2012 08:54:13 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353664797.13542.190.camel@zakaz.uk.xensource.com>
	<20663.18782.886504.606333@mariner.uk.xensource.com>
	<20663.18917.138256.303363@mariner.uk.xensource.com>
In-Reply-To: <20663.18917.138256.303363@mariner.uk.xensource.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs
	to stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7157780685854680839=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============7157780685854680839==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms060708060305080101060604"

This is a cryptographically signed message in MIME format.

--------------ms060708060305080101060604
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

As annoying as it may be, I think having a configure script or something =

similar is the only right answer. More hidden makefile variables and=20
hacks makes everything more complicated. Before the existence of the=20
configure script Xen's build system was a huge pain to work with. Its=20
still not perfect.

So here are 2 proposals:

Add a configure.ac to stubdom. I can whip up a simple one where you can=20
enable/disable specific stub domains. Other options could be setting the =

fetch urls for the libraries. People can add more options later. Now if=20
people disable vtpm, the check for cmake goes away.

Move /tools/configure.ac to /configure.ac. Use this configure script to=20
configure the entire build. /Makefile still exists and works with or=20
without configuring, to enable building of the hypervisor.

If we don't want to do this now, then I vote to just make cmake a=20
dependency for Xen without adding messy conditional hacks.

On 11/29/2012 06:41 AM, Ian Jackson wrote:
> Ian Jackson writes ("Re: [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required =
libs to stubdom/Makefile"):
>> I guess it would be possible to have an ad-hoc switch in Config.mk
>> (say) but I'm not sure this is better than just adding cmake as a hard=

>> dependency.
> Although, can we have a manual y/n switch in Config.mk so that if
> someone has trouble with this feature they can turn off the build ?
>
> Thanks,
> Ian.



--------------ms060708060305080101060604
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+g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FDRJOIwA9xnPWJJv
BBzT97OiwECkMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYA9b+FtsmMcPvQOqkyc8QWpXpcsBq4VvUJS
S3usqxLaWHUd7j06ofrdoiFOx83qXFuxnBBIH31pkttlvDnKGfXhmW4Eni+gtbely4KY39Os
1RB1tECDSDJwd5KJVBueQQ2K+Pd3iaVKF8OOvGS+EmmO2Dv7Ui57qeA+Oc3ao1HBrQAAAAAA
AA==
--------------ms060708060305080101060604--


--===============7157780685854680839==
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.xen.org
http://lists.xen.org/xen-devel

--===============7157780685854680839==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 13:58:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 13:58:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te4ch-0005xm-PJ; Thu, 29 Nov 2012 13:57:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te4cg-0005xg-VH
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 13:57:51 +0000
Received: from [85.158.138.51:18683] by server-8.bemta-3.messagelabs.com id
	62/01-07786-9D967B05; Thu, 29 Nov 2012 13:57:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1354197433!31988166!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 629 invoked from network); 29 Nov 2012 13:57:13 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 13:57:13 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16070510"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 13:57:13 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 13:57:13 +0000
Message-ID: <1354197431.25834.183.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 29 Nov 2012 13:57:11 +0000
In-Reply-To: <alpine.DEB.2.02.1211291320500.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1209101842150.15568@kaball.uk.xensource.com>
	<40776A41FC278F40B59438AD47D147A90FE40092@SHSMSX102.ccr.corp.intel.com>
	<alpine.DEB.2.02.1209181123280.29232@kaball.uk.xensource.com>
	<40776A41FC278F40B59438AD47D147A90FEAE3A2@SHSMSX102.ccr.corp.intel.com>
	<alpine.DEB.2.02.1211291320500.5310@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>, "Xu,
	Dongxiao" <dongxiao.xu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Xen-devel] [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and
 cpu_ioreq_move
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 13:21 +0000, Stefano Stabellini wrote:
> > Also I think 4.2.1 need these patches to enable the basic Xen on Xen
> > nested virtualization usage scenario.
> 
> I agree.

Nested virt was a tech preview in 4.2.0, is it really worth
backporting ?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 13:58:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 13:58:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te4ch-0005xm-PJ; Thu, 29 Nov 2012 13:57:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te4cg-0005xg-VH
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 13:57:51 +0000
Received: from [85.158.138.51:18683] by server-8.bemta-3.messagelabs.com id
	62/01-07786-9D967B05; Thu, 29 Nov 2012 13:57:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1354197433!31988166!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 629 invoked from network); 29 Nov 2012 13:57:13 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 13:57:13 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16070510"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 13:57:13 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 13:57:13 +0000
Message-ID: <1354197431.25834.183.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Thu, 29 Nov 2012 13:57:11 +0000
In-Reply-To: <alpine.DEB.2.02.1211291320500.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1209101842150.15568@kaball.uk.xensource.com>
	<40776A41FC278F40B59438AD47D147A90FE40092@SHSMSX102.ccr.corp.intel.com>
	<alpine.DEB.2.02.1209181123280.29232@kaball.uk.xensource.com>
	<40776A41FC278F40B59438AD47D147A90FEAE3A2@SHSMSX102.ccr.corp.intel.com>
	<alpine.DEB.2.02.1211291320500.5310@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>, "Xu,
	Dongxiao" <dongxiao.xu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Xen-devel] [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and
 cpu_ioreq_move
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 13:21 +0000, Stefano Stabellini wrote:
> > Also I think 4.2.1 need these patches to enable the basic Xen on Xen
> > nested virtualization usage scenario.
> 
> I agree.

Nested virt was a tech preview in 4.2.0, is it really worth
backporting ?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 14:10:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 14:10:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te4oN-0006Hl-3p; Thu, 29 Nov 2012 14:09:55 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1Te4oM-0006Hg-04
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 14:09:54 +0000
Received: from [193.109.254.147:27685] by server-5.bemta-14.messagelabs.com id
	19/95-10257-1BC67B05; Thu, 29 Nov 2012 14:09:53 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1354198160!8640140!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA5Mzk5Mg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4708 invoked from network); 29 Nov 2012 14:09:22 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-16.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 14:09:22 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qATE9FHl014915
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 29 Nov 2012 14:09:15 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qATE9EUM027489
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 29 Nov 2012 14:09:14 GMT
Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qATE9Dj0030394; Thu, 29 Nov 2012 08:09:13 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 29 Nov 2012 06:09:13 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 2F437E00B4F; Thu, 29 Nov 2012 09:09:09 -0500 (EST)
Date: Thu, 29 Nov 2012 09:09:09 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>,
	Mukesh Rathor <mukesh.rathor@oracle.com>
Message-ID: <20121129140909.GC21184@phenom.dumpdata.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211281150380.5310@kaball.uk.xensource.com>
	<20121128142521.GB21266@phenom.dumpdata.com>
	<1354113142.25834.34.camel@zakaz.uk.xensource.com>
	<20121128144416.GD21266@phenom.dumpdata.com>
	<1354118438.25834.40.camel@zakaz.uk.xensource.com>
	<1354189887.25834.158.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354189887.25834.158.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 11:51:27AM +0000, Ian Campbell wrote:
> On Wed, 2012-11-28 at 16:00 +0000, Ian Campbell wrote:
> > I'll take a look over the next couple of days.
> 
> Just looking into this now and in
> konrad/stable/pvh.v6:arch/x86/xen/mmu.c in xen_remap_domain_mfn_range we
> have:
> 
> 
> 	if (xen_feature(XENFEAT_auto_translated_physmap))
> 		return -EINVAL;
> 
> ...
> 
> 	if (xen_feature(XENFEAT_auto_translated_physmap)) {
> 		/* We need to update the local page tables and the xen HAP */
> 		return pvh_remap_gmfn_range(vma, addr, mfn, nr, prot, domid, pages);
> 	}
> 
> So it seems like the second one will never be reached...

Yikes! I wonder if I did a mismerge/rebase incorrectly? Mukesh, do you
recall if the original patchset had the first check removed?

> 
> AFAICT this was already the case when support was added in
> de81067d4ef5b434b47f63e11448b3b09cfc0b5e.
> 
> Ian.
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 14:10:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 14:10:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te4oN-0006Hl-3p; Thu, 29 Nov 2012 14:09:55 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1Te4oM-0006Hg-04
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 14:09:54 +0000
Received: from [193.109.254.147:27685] by server-5.bemta-14.messagelabs.com id
	19/95-10257-1BC67B05; Thu, 29 Nov 2012 14:09:53 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1354198160!8640140!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA5Mzk5Mg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4708 invoked from network); 29 Nov 2012 14:09:22 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-16.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 14:09:22 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qATE9FHl014915
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 29 Nov 2012 14:09:15 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qATE9EUM027489
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 29 Nov 2012 14:09:14 GMT
Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qATE9Dj0030394; Thu, 29 Nov 2012 08:09:13 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 29 Nov 2012 06:09:13 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 2F437E00B4F; Thu, 29 Nov 2012 09:09:09 -0500 (EST)
Date: Thu, 29 Nov 2012 09:09:09 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>,
	Mukesh Rathor <mukesh.rathor@oracle.com>
Message-ID: <20121129140909.GC21184@phenom.dumpdata.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211281150380.5310@kaball.uk.xensource.com>
	<20121128142521.GB21266@phenom.dumpdata.com>
	<1354113142.25834.34.camel@zakaz.uk.xensource.com>
	<20121128144416.GD21266@phenom.dumpdata.com>
	<1354118438.25834.40.camel@zakaz.uk.xensource.com>
	<1354189887.25834.158.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354189887.25834.158.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 11:51:27AM +0000, Ian Campbell wrote:
> On Wed, 2012-11-28 at 16:00 +0000, Ian Campbell wrote:
> > I'll take a look over the next couple of days.
> 
> Just looking into this now and in
> konrad/stable/pvh.v6:arch/x86/xen/mmu.c in xen_remap_domain_mfn_range we
> have:
> 
> 
> 	if (xen_feature(XENFEAT_auto_translated_physmap))
> 		return -EINVAL;
> 
> ...
> 
> 	if (xen_feature(XENFEAT_auto_translated_physmap)) {
> 		/* We need to update the local page tables and the xen HAP */
> 		return pvh_remap_gmfn_range(vma, addr, mfn, nr, prot, domid, pages);
> 	}
> 
> So it seems like the second one will never be reached...

Yikes! I wonder if I did a mismerge/rebase incorrectly? Mukesh, do you
recall if the original patchset had the first check removed?

> 
> AFAICT this was already the case when support was added in
> de81067d4ef5b434b47f63e11448b3b09cfc0b5e.
> 
> Ian.
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 14:15:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 14:15:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te4t6-0006PT-SC; Thu, 29 Nov 2012 14:14:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te4t4-0006PM-OS
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 14:14:47 +0000
Received: from [85.158.143.99:45677] by server-1.bemta-4.messagelabs.com id
	13/09-27934-6DD67B05; Thu, 29 Nov 2012 14:14:46 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-11.tower-216.messagelabs.com!1354198481!19831328!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10535 invoked from network); 29 Nov 2012 14:14:42 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-11.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 14:14:42 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158361107;
	Thu, 29 Nov 2012 09:14:25 -0500
Message-ID: <50B76DBB.90504@jhuapl.edu>
Date: Thu, 29 Nov 2012 09:14:19 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-2-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1354029286-17652-2-git-send-email-dgdegra@tycho.nsa.gov>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/4] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0683494152375153930=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============0683494152375153930==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms010309060108090903080800"

This is a cryptographically signed message in MIME format.

--------------ms010309060108090903080800
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Ok I've taken time to look at your patch. I had to make some minor=20
changes to make it work but other than that I was able to test it and it =

worked.
Comments inlined.

On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
> This changes the vTPM shared page ABI from a copy of the Xen network
> interface to a single-page interface that better reflects the expected
> behavior of a TPM: only a single request packet can be sent at any give=
n
> time, and every packet sent generates a single response packet. This
> protocol change should also increase efficiency as it avoids mapping an=
d
> unmapping grants when possible.
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>   extras/mini-os/include/tpmback.h  |   1 +
>   extras/mini-os/include/tpmfront.h |   7 +-
>   extras/mini-os/tpmback.c          | 159 +++++++++++++++++++----------=
--------
>   extras/mini-os/tpmfront.c         | 162 ++++++++++++++++++++++-------=
---------
>   xen/include/public/io/tpmif.h     |  45 +++--------
>   5 files changed, 191 insertions(+), 183 deletions(-)
>
> diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/=
tpmback.h
> index ff86732..ec9eda4 100644
> --- a/extras/mini-os/include/tpmback.h
> +++ b/extras/mini-os/include/tpmback.h
> @@ -43,6 +43,7 @@
>
>   struct tpmcmd {
>      domid_t domid;              /* Domid of the frontend */
> +   uint8_t locality;    /* Locality requested by the frontend */
>      unsigned int handle;        /* Handle of the frontend */
>      unsigned char uuid[16];                     /* uuid of the tpm int=
erface */
>
> diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include=
/tpmfront.h
> index fd2cb17..a0c7c4d 100644
> --- a/extras/mini-os/include/tpmfront.h
> +++ b/extras/mini-os/include/tpmfront.h
> @@ -37,9 +37,7 @@ struct tpmfront_dev {
>      grant_ref_t ring_ref;
>      evtchn_port_t evtchn;
>
> -   tpmif_tx_interface_t* tx;
> -
> -   void** pages;
> +   vtpm_shared_page_t *page;
>
>      domid_t bedomid;
>      char* nodename;
> @@ -77,6 +75,9 @@ void shutdown_tpmfront(struct tpmfront_dev* dev);
>    * */f
>   int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqle=
n, uint8_t** resp, size_t* resplen);
>
> +/* Set the locality used for communicating with a vTPM */
> +int tpmfront_set_locality(struct tpmfront_dev* dev, int locality);
> +
>   #ifdef HAVE_LIBC
>   #include <sys/stat.h>
>   /* POSIX IO functions:
> diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
> index 658fed1..2d31061 100644
> --- a/extras/mini-os/tpmback.c
> +++ b/extras/mini-os/tpmback.c
> @@ -86,10 +86,7 @@ struct tpmif {
>      evtchn_port_t evtchn;
>
>      /* Shared page */
> -   tpmif_tx_interface_t* tx;
> -
> -   /* pointer to TPMIF_RX_RING_SIZE pages */
> -   void** pages;
> +   vtpm_shared_page_t *page;
>
>      enum xenbus_state state;
>      enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
> @@ -266,6 +263,7 @@ int insert_tpmif(tpmif_t* tpmif)
>      unsigned int i, j;
>      tpmif_t* tmp;
>      char* err;
> +   char path[512];
>
>      local_irq_save(flags);
>
> @@ -303,6 +301,16 @@ int insert_tpmif(tpmif_t* tpmif)
>
>      local_irq_restore(flags);
>
> +   snprintf(path, 512, "backend/vtpm/%u/%u/feature-protocol-v2", (unsi=
gned int) tpmif->domid, tpmif->handle);
> +   if ((err =3D xenbus_write(XBT_NIL, path, "1")))
> +   {
> +      /* if we got an error here we should carefully remove the interf=
ace and then return */
> +      TPMBACK_ERR("Unable to write feature-protocol-v2 node: %s\n", er=
r);
> +      free(err);
> +      remove_tpmif(tpmif);
> +      goto error_post_irq;
> +   }
> +
My preference is still to do away with the versioning stuff since tpm is =

just getting released. Its not even in linux yet so there is no=20
confusion. We can even merge the linux patches together and resubmit as=20
one if thats preferrable. Konrad, Ian, your final votes on that?

If we do go the versioning route, I'd rather a feature-protocol key with =

value=3D2 or something like that to make it upgradable. Also don't forget=
=20
to add this to the linux side, its not in the patch you sent me yet.
>      /*Listen for state changes on the new interface */
>      if((err =3D xenbus_watch_path_token(XBT_NIL, tpmif->fe_state_path,=
 tpmif->fe_state_path, &gtpmdev.events)))
>      {
> @@ -312,7 +320,6 @@ int insert_tpmif(tpmif_t* tpmif)
>         remove_tpmif(tpmif);
>         goto error_post_irq;
>      }
> -
>      return 0;
>   error:
>      local_irq_restore(flags);
> @@ -386,8 +393,7 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigne=
d int handle)
>      tpmif->fe_state_path =3D NULL;
>      tpmif->state =3D XenbusStateInitialising;
>      tpmif->status =3D DISCONNECTED;
> -   tpmif->tx =3D NULL;
> -   tpmif->pages =3D NULL;
> +   tpmif->page =3D NULL;
>      tpmif->flags =3D 0;
>      memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
>      return tpmif;
> @@ -395,9 +401,6 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigne=
d int handle)
>
>   void __free_tpmif(tpmif_t* tpmif)
>   {
> -   if(tpmif->pages) {
> -      free(tpmif->pages);
> -   }
>      if(tpmif->fe_path) {
>         free(tpmif->fe_path);
>      }
> @@ -430,12 +433,6 @@ tpmif_t* new_tpmif(domid_t domid, unsigned int han=
dle)
>         goto error;
>      }
>
> -   /* allocate pages to be used for shared mapping */
> -   if((tpmif->pages =3D malloc(sizeof(void*) * TPMIF_TX_RING_SIZE)) =3D=
=3D NULL) {
> -      goto error;
> -   }
> -   memset(tpmif->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
> -
>      if(tpmif_change_state(tpmif, XenbusStateInitWait)) {
>         goto error;
>      }
> @@ -486,7 +483,7 @@ void free_tpmif(tpmif_t* tpmif)
>         tpmif->status =3D DISCONNECTING;
>         mask_evtchn(tpmif->evtchn);
>
> -      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1)) {
> +      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {=

>           TPMBACK_ERR("%u/%u Error occured while trying to unmap shared=
 page\n", (unsigned int) tpmif->domid, tpmif->handle);
>         }
>
> @@ -529,9 +526,10 @@ void free_tpmif(tpmif_t* tpmif)
>   void tpmback_handler(evtchn_port_t port, struct pt_regs *regs, void *=
data)
>   {
>      tpmif_t* tpmif =3D (tpmif_t*) data;
> -   tpmif_tx_request_t* tx =3D &tpmif->tx->ring[0].req;
> -   /* Throw away 0 size events, these can trigger from event channel u=
nmasking */
> -   if(tx->size =3D=3D 0)
> +   vtpm_shared_page_t* pg =3D tpmif->page;
> +
> +   /* Only pay attention if the request is ready */
> +   if (pg->state =3D=3D 0)
>         return;
>
>      TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->=
domid, tpmif->handle);
> @@ -584,12 +582,26 @@ int connect_fe(tpmif_t* tpmif)
>      }
>      free(value);
>
> +   /* Check that protocol v2 is being used */
> +   snprintf(path, 512, "%s/feature-protocol-v2", tpmif->fe_path);
> +   if((err =3D xenbus_read(XBT_NIL, path, &value))) {
> +      TPMBACK_ERR("Unable to read %s during tpmback initialization! er=
ror =3D %s\n", path, err);
> +      free(err);
> +      return -1;
> +   }
> +   if(strcmp(value, "1")) {
> +      TPMBACK_ERR("%s has an invalid value (%s)\n", path, value);
> +      free(value);
> +      return -1;
> +   }
> +   free(value);
> +
> +
>      domid =3D tpmif->domid;
> -   if((tpmif->tx =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0,=
 &ringref, PROT_READ | PROT_WRITE)) =3D=3D NULL) {
> +   if((tpmif->page =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, =
0, &ringref, PROT_READ | PROT_WRITE)) =3D=3D NULL) {
>         TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned =
int) tpmif->domid, tpmif->handle);
>         return -1;
>      }
> -   memset(tpmif->tx, 0, PAGE_SIZE);
>
>      /*Bind the event channel */
>      if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler,=
 tpmif, &tpmif->evtchn)))
> @@ -618,10 +630,28 @@ error_post_evtchn:
>      mask_evtchn(tpmif->evtchn);
>      unbind_evtchn(tpmif->evtchn);
>   error_post_map:
> -   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1);
> +   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1);
>      return -1;
>   }
>
> +static void disconnect_fe(tpmif_t* tpmif)
> +{
> +   if (tpmif->status =3D=3D CONNECTED) {
> +      tpmif->status =3D DISCONNECTING;
> +      mask_evtchn(tpmif->evtchn);
> +
> +      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {=

> +        TPMBACK_ERR("%u/%u Error occured while trying to unmap shared =
page\n", (unsigned int) tpmif->domid, tpmif->handle);
> +      }
> +
> +      unbind_evtchn(tpmif->evtchn);
> +   }
> +   tpmif->status =3D DISCONNECTED;
> +   tpmif_change_state(tpmif, XenbusStateReconfigured);
> +
> +   TPMBACK_LOG("Frontend %u/%u disconnected\n", (unsigned int) tpmif->=
domid, tpmif->handle);
> +}
> +
This function is flagged by -Wunused-function. I think you meant to=20
include this in your second patch that does the reconfig stuff.
>   static int frontend_changed(tpmif_t* tpmif)
>   {
>      int state =3D xenbus_read_integer(tpmif->fe_state_path);
> @@ -874,6 +904,7 @@ void shutdown_tpmback(void)
>   inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int=
 handle, unsigned char uuid[16])
>   {
>      tpmcmd->domid =3D domid;
> +   tpmcmd->locality =3D -1;
>      tpmcmd->handle =3D handle;
>      memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
>      tpmcmd->req =3D NULL;
> @@ -884,12 +915,12 @@ inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t=
 domid, unsigned int handle, un
>
>   tpmcmd_t* get_request(tpmif_t* tpmif) {
>      tpmcmd_t* cmd;
> -   tpmif_tx_request_t* tx;
> -   int offset;
> -   int tocopy;
> -   int i;
> -   uint32_t domid;
> +   vtpm_shared_page_t* shr;
> +   unsigned int offset;
>      int flags;
> +#ifdef TPMBACK_PRINT_DEBUG
> +   int i;
> +#endif
>
>      local_irq_save(flags);
>
> @@ -899,35 +930,22 @@ tpmcmd_t* get_request(tpmif_t* tpmif) {
>      }
>      init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);
>
> -   tx =3D &tpmif->tx->ring[0].req;
> -   cmd->req_len =3D tx->size;
> +   shr =3D tpmif->page;
> +   cmd->req_len =3D shr->length;
> +   cmd->locality =3D shr->locality;
> +   offset =3D sizeof(*shr) + 4*shr->nr_extra_pages;
> +   if (offset > PAGE_SIZE || offset + cmd->req_len > PAGE_SIZE) {
> +      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (u=
nsigned int) tpmif->domid, tpmif->handle);
> +      goto error;
> +   }
>      /* Allocate the buffer */
>      if(cmd->req_len) {
>         if((cmd->req =3D malloc(cmd->req_len)) =3D=3D NULL) {
>           goto error;
>         }
>      }
> -   /* Copy the bits from the shared pages */
> -   offset =3D 0;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && offset < cmd->req_len; ++i) =
{
> -      tx =3D &tpmif->tx->ring[i].req;
> -
> -      /* Map the page with the data */
> -      domid =3D (uint32_t)tpmif->domid;
> -      if((tpmif->pages[i] =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &=
domid, 0, &tx->ref, PROT_READ)) =3D=3D NULL) {
> -        TPMBACK_ERR("%u/%u Unable to map shared page during read!\n", =
(unsigned int) tpmif->domid, tpmif->handle);
> -        goto error;
> -      }
> -
> -      /* do the copy now */
> -      tocopy =3D min(cmd->req_len - offset, PAGE_SIZE);
> -      memcpy(&cmd->req[offset], tpmif->pages[i], tocopy);
> -      offset +=3D tocopy;
> -
> -      /* release the page */
> -      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
> -
> -   }
> +   /* Copy the bits from the shared page(s) */
> +   memcpy(cmd->req, offset + (uint8_t*)shr, cmd->req_len);
>
>   #ifdef TPMBACK_PRINT_DEBUG
>      TPMBACK_DEBUG("Received Tpm Command from %u/%u of size %u", (unsig=
ned int) tpmif->domid, tpmif->handle, cmd->req_len);
> @@ -958,38 +976,24 @@ error:
>
>   void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
>   {
> -   tpmif_tx_request_t* tx;
> -   int offset;
> -   int i;
> -   uint32_t domid;
> -   int tocopy;
> +   vtpm_shared_page_t* shr;
> +   unsigned int offset;
>      int flags;
> +#ifdef TPMBACK_PRINT_DEBUG
> +int i;
> +#endif
>
>      local_irq_save(flags);
>
> -   tx =3D &tpmif->tx->ring[0].req;
> -   tx->size =3D cmd->resp_len;
> -
> -   offset =3D 0;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && offset < cmd->resp_len; ++i)=
 {
> -      tx =3D &tpmif->tx->ring[i].req;
> -
> -      /* Map the page with the data */
> -      domid =3D (uint32_t)tpmif->domid;
> -      if((tpmif->pages[i] =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &=
domid, 0, &tx->ref, PROT_WRITE)) =3D=3D NULL) {
> -        TPMBACK_ERR("%u/%u Unable to map shared page during write!\n",=
 (unsigned int) tpmif->domid, tpmif->handle);
> -        goto error;
> -      }
> -
> -      /* do the copy now */
> -      tocopy =3D min(cmd->resp_len - offset, PAGE_SIZE);
> -      memcpy(tpmif->pages[i], &cmd->resp[offset], tocopy);
> -      offset +=3D tocopy;
> -
> -      /* release the page */
> -      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
> +   shr =3D tpmif->page;
> +   shr->length =3D cmd->resp_len;
>
> +   offset =3D sizeof(*shr) + 4*shr->nr_extra_pages;
> +   if (offset > PAGE_SIZE || offset + cmd->resp_len > PAGE_SIZE) {
> +      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (u=
nsigned int) tpmif->domid, tpmif->handle);
> +      goto error;
>      }
> +   memcpy(offset + (uint8_t*)shr, cmd->resp, cmd->resp_len);
>
>   #ifdef TPMBACK_PRINT_DEBUG
>      TPMBACK_DEBUG("Sent response to %u/%u of size %u", (unsigned int) =
tpmif->domid, tpmif->handle, cmd->resp_len);
> @@ -1003,6 +1007,7 @@ void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)=

>   #endif
>      /* clear the ready flag and send the event channel notice to the f=
rontend */
>      tpmif_req_finished(tpmif);
> +   shr->state =3D 0;
>      notify_remote_via_evtchn(tpmif->evtchn);
>   error:
>      local_irq_restore(flags);
> diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
> index 0218d7f..c1cbab3 100644
> --- a/extras/mini-os/tpmfront.c
> +++ b/extras/mini-os/tpmfront.c
> @@ -153,6 +153,32 @@ static int wait_for_backend_closed(xenbus_event_qu=
eue* events, char* path)
>
>   }
>
> +static int wait_for_backend_reconfig(xenbus_event_queue* events, char*=
 path)
> +{
> +   int state;
> +
> +   TPMFRONT_LOG("Waiting for backend to reconfigure...\n");
> +   while(1) {
> +      state =3D xenbus_read_integer(path);
> +      if ( state < 0)
> +        state =3D XenbusStateUnknown;
> +      switch(state) {
> +        case XenbusStateUnknown:
> +           TPMFRONT_ERR("Backend Unknown state, forcing shutdown\n");
> +           return -1;
> +        case XenbusStateClosed:
> +           TPMFRONT_LOG("Backend Closed\n");
> +           return 0;
> +        case XenbusStateReconfigured:
> +           TPMFRONT_LOG("Backend Reconfigured\n");
> +           return 0;
> +        default:
> +           xenbus_wait_for_watch(events);
> +      }
> +   }
> +
> +}
> +
Does this reconfigure stuff make sense without patch 2?
>   static int wait_for_backend_state_changed(struct tpmfront_dev* dev, X=
enbusState state) {
>      char* err;
>      int ret =3D 0;
> @@ -175,8 +201,11 @@ static int wait_for_backend_state_changed(struct t=
pmfront_dev* dev, XenbusState
>         case XenbusStateClosed:
>           ret =3D wait_for_backend_closed(&events, path);
>           break;
> -      default:
> +      case XenbusStateReconfigured:
> +        ret =3D wait_for_backend_reconfig(&events, path);
>           break;
> +      default:
> +         TPMFRONT_ERR("Bad wait state %d, ignoring\n", state);
>      }
See above comment
>
>      if((err =3D xenbus_unwatch_path_token(XBT_NIL, path, path))) {
> @@ -190,13 +219,13 @@ static int tpmfront_connect(struct tpmfront_dev* =
dev)
>   {
>      char* err;
>      /* Create shared page */
> -   dev->tx =3D (tpmif_tx_interface_t*) alloc_page();
> -   if(dev->tx =3D=3D NULL) {
> +   dev->page =3D (vtpm_shared_page_t*) alloc_page();
> +   if(dev->page =3D=3D NULL) {
>         TPMFRONT_ERR("Unable to allocate page for shared memory\n");
>         goto error;
>      }
> -   memset(dev->tx, 0, PAGE_SIZE);
> -   dev->ring_ref =3D gnttab_grant_access(dev->bedomid, virt_to_mfn(dev=
->tx), 0);
> +   memset(dev->page, 0, PAGE_SIZE);
> +   dev->ring_ref =3D gnttab_grant_access(dev->bedomid, virt_to_mfn(dev=
->page), 0);
>      TPMFRONT_DEBUG("grant ref is %lu\n", (unsigned long) dev->ring_ref=
);
>
>      /*Create event channel */
> @@ -228,7 +257,7 @@ error_postevtchn:
>         unbind_evtchn(dev->evtchn);
>   error_postmap:
>         gnttab_end_access(dev->ring_ref);
> -      free_page(dev->tx);
> +      free_page(dev->page);
>   error:
>      return -1;
>   }
> @@ -240,7 +269,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nod=
ename)
>      char path[512];
>      char* value, *err;
>      unsigned long long ival;
> -   int i;
>
>      printk("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Init TPM Front =3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n");
>
> @@ -279,6 +307,15 @@ struct tpmfront_dev* init_tpmfront(const char* _no=
dename)
>         goto error;
>      }
>
> +   /* Publish protocol v2 feature */
> +   snprintf(path, 512, "%s/feature-protocol-v2", dev->nodename);
> +   if ((err =3D xenbus_write(XBT_NIL, path, "1")))
> +   {
> +      TPMFRONT_ERR("Unable to write feature-protocol-v2 node: %s\n", e=
rr);
> +         free(err);
> +      goto error;
> +   }
> +
>      /* Create and publish grant reference and event channel */
>      if (tpmfront_connect(dev)) {
>         goto error;
> @@ -289,18 +326,18 @@ struct tpmfront_dev* init_tpmfront(const char* _n=
odename)
>         goto error;
>      }
>
> -   /* Allocate pages that will contain the messages */
> -   dev->pages =3D malloc(sizeof(void*) * TPMIF_TX_RING_SIZE);
> -   if(dev->pages =3D=3D NULL) {
> +   snprintf(path, 512, "%s/feature-protocol-v2", dev->bepath);
> +   if((err =3D xenbus_read(XBT_NIL, path, &value))) {
> +      TPMFRONT_ERR("Unable to read %s during tpmfront initialization! =
error =3D %s\n", path, err);
> +      free(err);
>         goto error;
>      }
> -   memset(dev->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE; ++i) {
> -      dev->pages[i] =3D (void*)alloc_page();
> -      if(dev->pages[i] =3D=3D NULL) {
> -        goto error;
> -      }
> +   if(strcmp(value, "1")) {
> +      TPMFRONT_ERR("%s has an invalid value (%s)\n", path, value);
> +      free(value);
> +      goto error;
>      }
> +   free(value);
>
>      TPMFRONT_LOG("Initialization Completed successfully\n");
>
> @@ -314,12 +351,10 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>   {
>      char* err;
>      char path[512];
> -   int i;
> -   tpmif_tx_request_t* tx;
>      if(dev =3D=3D NULL) {
>         return;
>      }
> -   TPMFRONT_LOG("Shutting down tpmfront\n");
> +   TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for rec=
onfigure" : "");
I think the above line belongs in your second patch. for_reconfig is=20
undefined, causing compilation to fail.
>      /* disconnect */
>      if(dev->state =3D=3D XenbusStateConnected) {
>         dev->state =3D XenbusStateClosing;
> @@ -349,27 +384,12 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>         /* Wait for the backend to close and unmap shared pages, ignore=
 any errors */
>         wait_for_backend_state_changed(dev, XenbusStateClosed);
>
> -      /* Cleanup any shared pages */
> -      if(dev->pages) {
> -        for(i =3D 0; i < TPMIF_TX_RING_SIZE; ++i) {
> -           if(dev->pages[i]) {
> -              tx =3D &dev->tx->ring[i].req;
> -              if(tx->ref !=3D 0) {
> -                 gnttab_end_access(tx->ref);
> -              }
> -              free_page(dev->pages[i]);
> -           }
> -        }
> -        free(dev->pages);
> -      }
> -
>         /* Close event channel and unmap shared page */
>         mask_evtchn(dev->evtchn);
>         unbind_evtchn(dev->evtchn);
>         gnttab_end_access(dev->ring_ref);
>
> -      free_page(dev->tx);
> -
> +      free_page(dev->page);
>      }
>
>      /* Cleanup memory usage */
> @@ -387,13 +407,17 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>
>   int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_=
t length)
>   {
> +   unsigned int offset;
> +   vtpm_shared_page_t* shr =3D NULL;
> +#ifdef TPMFRONT_PRINT_DEBUG
>      int i;
> -   tpmif_tx_request_t* tx =3D NULL;
> +#endif
>      /* Error Checking */
>      if(dev =3D=3D NULL || dev->state !=3D XenbusStateConnected) {
>         TPMFRONT_ERR("Tried to send message through disconnected fronte=
nd\n");
>         return -1;
>      }
> +   shr =3D dev->page;
>
>   #ifdef TPMFRONT_PRINT_DEBUG
>      TPMFRONT_DEBUG("Sending Msg to backend size=3D%u", (unsigned int) =
length);
> @@ -407,19 +431,16 @@ int tpmfront_send(struct tpmfront_dev* dev, const=
 uint8_t* msg, size_t length)
>   #endif
>
>      /* Copy to shared pages now */
> -   for(i =3D 0; length > 0 && i < TPMIF_TX_RING_SIZE; ++i) {
> -      /* Share the page */
> -      tx =3D &dev->tx->ring[i].req;
> -      tx->unused =3D 0;
> -      tx->addr =3D virt_to_mach(dev->pages[i]);
> -      tx->ref =3D gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->p=
ages[i]), 0);
> -      /* Copy the bits to the page */
> -      tx->size =3D length > PAGE_SIZE ? PAGE_SIZE : length;
> -      memcpy(dev->pages[i], &msg[i * PAGE_SIZE], tx->size);
> -
> -      /* Update counters */
> -      length -=3D tx->size;
> +   offset =3D sizeof(*shr);
> +   if (length + offset > PAGE_SIZE) {
> +      TPMFRONT_ERR("Message too long for shared page\n");
> +      return -1;
>      }
I think it might be useful to #define a TPMIF_CAP_PROP_BUFFER_SIZE in=20
tpmif.h so people know ahead of time the largest command they can send.=20
Then they can create arrays on the stack with the correct length etc..

This brings up another issue. According to the TPM PC Client spec=20
section 11.3.8, there is a capability TPM_CAP_PROP_BUFFER_SIZE. We=20
should probably patch the emulator in vtpm-stubdom to make it return=20
TPMIF_CAP_PROP_BUFFER_SIZE for this capability. You don't have to worry=20
about this now if you don't want to. I can do it later once this stuff=20
is in. If you do decide to tackle it, make it a separate patch.

> +   memcpy(offset + (uint8_t*)shr, msg, length);
> +   shr->length =3D length;
> +   barrier();
> +   shr->state =3D 1;
> +
>      dev->waiting =3D 1;
>      dev->resplen =3D 0;
>   #ifdef HAVE_LIBC
> @@ -434,44 +455,41 @@ int tpmfront_send(struct tpmfront_dev* dev, const=
 uint8_t* msg, size_t length)
>   }
>   int tpmfront_recv(struct tpmfront_dev* dev, uint8_t** msg, size_t *le=
ngth)
>   {
> -   tpmif_tx_request_t* tx;
> -   int i;
> +   unsigned int offset;
> +   vtpm_shared_page_t* shr =3D NULL;
> +#ifdef TPMFRONT_PRINT_DEBUG
> +int i;
> +#endif
>      if(dev =3D=3D NULL || dev->state !=3D XenbusStateConnected) {
>         TPMFRONT_ERR("Tried to receive message from disconnected fronte=
nd\n");
>         return -1;
>      }
>      /*Wait for the response */
>      wait_event(dev->waitq, (!dev->waiting));
> +   shr =3D dev->page;
> +   if (shr->state !=3D 0)
> +      goto quit;
>
>      /* Initialize */
>      *msg =3D NULL;
> -   *length =3D 0;
> +   *length =3D shr->length;
> +   offset =3D sizeof(*shr);
>
> -   /* special case, just quit */
> -   tx =3D &dev->tx->ring[0].req;
> -   if(tx->size =3D=3D 0 ) {
> -       goto quit;
> -   }
> -   /* Get the total size */
> -   tx =3D &dev->tx->ring[0].req;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
> -      tx =3D &dev->tx->ring[i].req;
> -      *length +=3D tx->size;
> +   if (*length + offset > PAGE_SIZE) {
> +      TPMFRONT_ERR("Reply too long for shared page\n");
> +      return -1;
>      }
> +
>      /* Alloc the buffer */
>      if(dev->respbuf) {
>         free(dev->respbuf);
>      }
>      *msg =3D dev->respbuf =3D malloc(*length);
>      dev->resplen =3D *length;
> +
>      /* Copy the bits */
> -   tx =3D &dev->tx->ring[0].req;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
> -      tx =3D &dev->tx->ring[i].req;
> -      memcpy(&(*msg)[i * PAGE_SIZE], dev->pages[i], tx->size);
> -      gnttab_end_access(tx->ref);
> -      tx->ref =3D 0;
> -   }
> +   memcpy(*msg, offset + (uint8_t*)shr, *length);
> +
>   #ifdef TPMFRONT_PRINT_DEBUG
>      TPMFRONT_DEBUG("Received response from backend size=3D%u", (unsign=
ed int) *length);
>      for(i =3D 0; i < *length; ++i) {
> @@ -504,6 +522,14 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t=
* req, size_t reqlen, uint8_t*
>      return 0;
>   }
>
> +int tpmfront_set_locality(struct tpmfront_dev* dev, int locality)
> +{
> +   if (!dev || !dev->page)
> +      return -1;
> +   dev->page->locality =3D locality;
> +   return 0;
> +}
> +
>   #ifdef HAVE_LIBC
>   #include <errno.h>
>   int tpmfront_open(struct tpmfront_dev* dev)
> diff --git a/xen/include/public/io/tpmif.h b/xen/include/public/io/tpmi=
f.h
> index 02ccdab..afc9181 100644
> --- a/xen/include/public/io/tpmif.h
> +++ b/xen/include/public/io/tpmif.h
> @@ -1,7 +1,7 @@
>   /********************************************************************=
**********
>    * tpmif.h
>    *
> - * TPM I/O interface for Xen guest OSes.
> + * TPM I/O interface for Xen guest OSes, v2
>    *
>    * Permission is hereby granted, free of charge, to any person obtain=
ing a copy
>    * of this software and associated documentation files (the "Software=
"), to
> @@ -21,48 +21,23 @@
>    * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHE=
R
>    * DEALINGS IN THE SOFTWARE.
>    *
> - * Copyright (c) 2005, IBM Corporation
> - *
> - * Author: Stefan Berger, stefanb@us.ibm.com
> - * Grant table support: Mahadevan Gomathisankaran
> - *
> - * This code has been derived from tools/libxc/xen/io/netif.h
> - *
> - * Copyright (c) 2003-2004, Keir Fraser
>    */
>
>   #ifndef __XEN_PUBLIC_IO_TPMIF_H__
>   #define __XEN_PUBLIC_IO_TPMIF_H__
>
> -#include "../grant_table.h"
> +struct vtpm_shared_page {
> +    uint16_t length;         /* request/response length in bytes */
>
> -struct tpmif_tx_request {
> -    unsigned long addr;   /* Machine address of packet.   */
> -    grant_ref_t ref;      /* grant table access reference */
> -    uint16_t unused;
> -    uint16_t size;        /* Packet size in bytes.        */
> -};
> -typedef struct tpmif_tx_request tpmif_tx_request_t;
> -
> -/*
> - * The TPMIF_TX_RING_SIZE defines the number of pages the
> - * front-end and backend can exchange (=3D size of array).
> - */
> -typedef uint32_t TPMIF_RING_IDX;
> -
> -#define TPMIF_TX_RING_SIZE 1
> -
> -/* This structure must fit in a memory page. */
> -
> -struct tpmif_ring {
> -    struct tpmif_tx_request req;
> -};
> -typedef struct tpmif_ring tpmif_ring_t;
> +    uint8_t state;           /* 0 - response ready / idle
> +                              * 1 - request ready / working */
> +    uint8_t locality;        /* for the current request */
> +    uint8_t padding[3];
>
> -struct tpmif_tx_interface {
> -    struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
> +    uint8_t nr_extra_pages;  /* extra pages for long packets; may be z=
ero */
> +    uint32_t extra_pages[0]; /* grant IDs; length is actually nr_extra=
_pages */
>   };
> -typedef struct tpmif_tx_interface tpmif_tx_interface_t;
> +typedef struct vtpm_shared_page vtpm_shared_page_t;
>
>   #endif
>
> --
> 1.7.11.7
>



--------------ms010309060108090903080800
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlCwMBAQEBBAoWCGZpb3JhbWUxMBsGDSsGAQQBsyUL
AwEBAQIEChIIMDAxMDQyNjEwWAYJYIZIAYb6ax4BBEsMSVRoZSBwcml2YXRlIGtleSBjb3Jy
ZXNwb25kaW5nIHRvIHRoaXMgY2VydGlmaWNhdGUgbWF5IGhhdmUgYmVlbiBleHBvcnRlZC4w
KAYDVR0RBCEwH4EdTWF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Zth24lBYpb9meXYX8YEcergAAAAAA
AA==
--------------ms010309060108090903080800--


--===============0683494152375153930==
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.xen.org
http://lists.xen.org/xen-devel

--===============0683494152375153930==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 14:15:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 14:15:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te4t6-0006PT-SC; Thu, 29 Nov 2012 14:14:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te4t4-0006PM-OS
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 14:14:47 +0000
Received: from [85.158.143.99:45677] by server-1.bemta-4.messagelabs.com id
	13/09-27934-6DD67B05; Thu, 29 Nov 2012 14:14:46 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-11.tower-216.messagelabs.com!1354198481!19831328!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10535 invoked from network); 29 Nov 2012 14:14:42 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-11.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 14:14:42 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158361107;
	Thu, 29 Nov 2012 09:14:25 -0500
Message-ID: <50B76DBB.90504@jhuapl.edu>
Date: Thu, 29 Nov 2012 09:14:19 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-2-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1354029286-17652-2-git-send-email-dgdegra@tycho.nsa.gov>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 1/4] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0683494152375153930=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============0683494152375153930==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms010309060108090903080800"

This is a cryptographically signed message in MIME format.

--------------ms010309060108090903080800
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Ok I've taken time to look at your patch. I had to make some minor=20
changes to make it work but other than that I was able to test it and it =

worked.
Comments inlined.

On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
> This changes the vTPM shared page ABI from a copy of the Xen network
> interface to a single-page interface that better reflects the expected
> behavior of a TPM: only a single request packet can be sent at any give=
n
> time, and every packet sent generates a single response packet. This
> protocol change should also increase efficiency as it avoids mapping an=
d
> unmapping grants when possible.
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>   extras/mini-os/include/tpmback.h  |   1 +
>   extras/mini-os/include/tpmfront.h |   7 +-
>   extras/mini-os/tpmback.c          | 159 +++++++++++++++++++----------=
--------
>   extras/mini-os/tpmfront.c         | 162 ++++++++++++++++++++++-------=
---------
>   xen/include/public/io/tpmif.h     |  45 +++--------
>   5 files changed, 191 insertions(+), 183 deletions(-)
>
> diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/=
tpmback.h
> index ff86732..ec9eda4 100644
> --- a/extras/mini-os/include/tpmback.h
> +++ b/extras/mini-os/include/tpmback.h
> @@ -43,6 +43,7 @@
>
>   struct tpmcmd {
>      domid_t domid;              /* Domid of the frontend */
> +   uint8_t locality;    /* Locality requested by the frontend */
>      unsigned int handle;        /* Handle of the frontend */
>      unsigned char uuid[16];                     /* uuid of the tpm int=
erface */
>
> diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include=
/tpmfront.h
> index fd2cb17..a0c7c4d 100644
> --- a/extras/mini-os/include/tpmfront.h
> +++ b/extras/mini-os/include/tpmfront.h
> @@ -37,9 +37,7 @@ struct tpmfront_dev {
>      grant_ref_t ring_ref;
>      evtchn_port_t evtchn;
>
> -   tpmif_tx_interface_t* tx;
> -
> -   void** pages;
> +   vtpm_shared_page_t *page;
>
>      domid_t bedomid;
>      char* nodename;
> @@ -77,6 +75,9 @@ void shutdown_tpmfront(struct tpmfront_dev* dev);
>    * */f
>   int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqle=
n, uint8_t** resp, size_t* resplen);
>
> +/* Set the locality used for communicating with a vTPM */
> +int tpmfront_set_locality(struct tpmfront_dev* dev, int locality);
> +
>   #ifdef HAVE_LIBC
>   #include <sys/stat.h>
>   /* POSIX IO functions:
> diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
> index 658fed1..2d31061 100644
> --- a/extras/mini-os/tpmback.c
> +++ b/extras/mini-os/tpmback.c
> @@ -86,10 +86,7 @@ struct tpmif {
>      evtchn_port_t evtchn;
>
>      /* Shared page */
> -   tpmif_tx_interface_t* tx;
> -
> -   /* pointer to TPMIF_RX_RING_SIZE pages */
> -   void** pages;
> +   vtpm_shared_page_t *page;
>
>      enum xenbus_state state;
>      enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
> @@ -266,6 +263,7 @@ int insert_tpmif(tpmif_t* tpmif)
>      unsigned int i, j;
>      tpmif_t* tmp;
>      char* err;
> +   char path[512];
>
>      local_irq_save(flags);
>
> @@ -303,6 +301,16 @@ int insert_tpmif(tpmif_t* tpmif)
>
>      local_irq_restore(flags);
>
> +   snprintf(path, 512, "backend/vtpm/%u/%u/feature-protocol-v2", (unsi=
gned int) tpmif->domid, tpmif->handle);
> +   if ((err =3D xenbus_write(XBT_NIL, path, "1")))
> +   {
> +      /* if we got an error here we should carefully remove the interf=
ace and then return */
> +      TPMBACK_ERR("Unable to write feature-protocol-v2 node: %s\n", er=
r);
> +      free(err);
> +      remove_tpmif(tpmif);
> +      goto error_post_irq;
> +   }
> +
My preference is still to do away with the versioning stuff since tpm is =

just getting released. Its not even in linux yet so there is no=20
confusion. We can even merge the linux patches together and resubmit as=20
one if thats preferrable. Konrad, Ian, your final votes on that?

If we do go the versioning route, I'd rather a feature-protocol key with =

value=3D2 or something like that to make it upgradable. Also don't forget=
=20
to add this to the linux side, its not in the patch you sent me yet.
>      /*Listen for state changes on the new interface */
>      if((err =3D xenbus_watch_path_token(XBT_NIL, tpmif->fe_state_path,=
 tpmif->fe_state_path, &gtpmdev.events)))
>      {
> @@ -312,7 +320,6 @@ int insert_tpmif(tpmif_t* tpmif)
>         remove_tpmif(tpmif);
>         goto error_post_irq;
>      }
> -
>      return 0;
>   error:
>      local_irq_restore(flags);
> @@ -386,8 +393,7 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigne=
d int handle)
>      tpmif->fe_state_path =3D NULL;
>      tpmif->state =3D XenbusStateInitialising;
>      tpmif->status =3D DISCONNECTED;
> -   tpmif->tx =3D NULL;
> -   tpmif->pages =3D NULL;
> +   tpmif->page =3D NULL;
>      tpmif->flags =3D 0;
>      memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
>      return tpmif;
> @@ -395,9 +401,6 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigne=
d int handle)
>
>   void __free_tpmif(tpmif_t* tpmif)
>   {
> -   if(tpmif->pages) {
> -      free(tpmif->pages);
> -   }
>      if(tpmif->fe_path) {
>         free(tpmif->fe_path);
>      }
> @@ -430,12 +433,6 @@ tpmif_t* new_tpmif(domid_t domid, unsigned int han=
dle)
>         goto error;
>      }
>
> -   /* allocate pages to be used for shared mapping */
> -   if((tpmif->pages =3D malloc(sizeof(void*) * TPMIF_TX_RING_SIZE)) =3D=
=3D NULL) {
> -      goto error;
> -   }
> -   memset(tpmif->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
> -
>      if(tpmif_change_state(tpmif, XenbusStateInitWait)) {
>         goto error;
>      }
> @@ -486,7 +483,7 @@ void free_tpmif(tpmif_t* tpmif)
>         tpmif->status =3D DISCONNECTING;
>         mask_evtchn(tpmif->evtchn);
>
> -      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1)) {
> +      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {=

>           TPMBACK_ERR("%u/%u Error occured while trying to unmap shared=
 page\n", (unsigned int) tpmif->domid, tpmif->handle);
>         }
>
> @@ -529,9 +526,10 @@ void free_tpmif(tpmif_t* tpmif)
>   void tpmback_handler(evtchn_port_t port, struct pt_regs *regs, void *=
data)
>   {
>      tpmif_t* tpmif =3D (tpmif_t*) data;
> -   tpmif_tx_request_t* tx =3D &tpmif->tx->ring[0].req;
> -   /* Throw away 0 size events, these can trigger from event channel u=
nmasking */
> -   if(tx->size =3D=3D 0)
> +   vtpm_shared_page_t* pg =3D tpmif->page;
> +
> +   /* Only pay attention if the request is ready */
> +   if (pg->state =3D=3D 0)
>         return;
>
>      TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->=
domid, tpmif->handle);
> @@ -584,12 +582,26 @@ int connect_fe(tpmif_t* tpmif)
>      }
>      free(value);
>
> +   /* Check that protocol v2 is being used */
> +   snprintf(path, 512, "%s/feature-protocol-v2", tpmif->fe_path);
> +   if((err =3D xenbus_read(XBT_NIL, path, &value))) {
> +      TPMBACK_ERR("Unable to read %s during tpmback initialization! er=
ror =3D %s\n", path, err);
> +      free(err);
> +      return -1;
> +   }
> +   if(strcmp(value, "1")) {
> +      TPMBACK_ERR("%s has an invalid value (%s)\n", path, value);
> +      free(value);
> +      return -1;
> +   }
> +   free(value);
> +
> +
>      domid =3D tpmif->domid;
> -   if((tpmif->tx =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0,=
 &ringref, PROT_READ | PROT_WRITE)) =3D=3D NULL) {
> +   if((tpmif->page =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, =
0, &ringref, PROT_READ | PROT_WRITE)) =3D=3D NULL) {
>         TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned =
int) tpmif->domid, tpmif->handle);
>         return -1;
>      }
> -   memset(tpmif->tx, 0, PAGE_SIZE);
>
>      /*Bind the event channel */
>      if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler,=
 tpmif, &tpmif->evtchn)))
> @@ -618,10 +630,28 @@ error_post_evtchn:
>      mask_evtchn(tpmif->evtchn);
>      unbind_evtchn(tpmif->evtchn);
>   error_post_map:
> -   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1);
> +   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1);
>      return -1;
>   }
>
> +static void disconnect_fe(tpmif_t* tpmif)
> +{
> +   if (tpmif->status =3D=3D CONNECTED) {
> +      tpmif->status =3D DISCONNECTING;
> +      mask_evtchn(tpmif->evtchn);
> +
> +      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {=

> +        TPMBACK_ERR("%u/%u Error occured while trying to unmap shared =
page\n", (unsigned int) tpmif->domid, tpmif->handle);
> +      }
> +
> +      unbind_evtchn(tpmif->evtchn);
> +   }
> +   tpmif->status =3D DISCONNECTED;
> +   tpmif_change_state(tpmif, XenbusStateReconfigured);
> +
> +   TPMBACK_LOG("Frontend %u/%u disconnected\n", (unsigned int) tpmif->=
domid, tpmif->handle);
> +}
> +
This function is flagged by -Wunused-function. I think you meant to=20
include this in your second patch that does the reconfig stuff.
>   static int frontend_changed(tpmif_t* tpmif)
>   {
>      int state =3D xenbus_read_integer(tpmif->fe_state_path);
> @@ -874,6 +904,7 @@ void shutdown_tpmback(void)
>   inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int=
 handle, unsigned char uuid[16])
>   {
>      tpmcmd->domid =3D domid;
> +   tpmcmd->locality =3D -1;
>      tpmcmd->handle =3D handle;
>      memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
>      tpmcmd->req =3D NULL;
> @@ -884,12 +915,12 @@ inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t=
 domid, unsigned int handle, un
>
>   tpmcmd_t* get_request(tpmif_t* tpmif) {
>      tpmcmd_t* cmd;
> -   tpmif_tx_request_t* tx;
> -   int offset;
> -   int tocopy;
> -   int i;
> -   uint32_t domid;
> +   vtpm_shared_page_t* shr;
> +   unsigned int offset;
>      int flags;
> +#ifdef TPMBACK_PRINT_DEBUG
> +   int i;
> +#endif
>
>      local_irq_save(flags);
>
> @@ -899,35 +930,22 @@ tpmcmd_t* get_request(tpmif_t* tpmif) {
>      }
>      init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);
>
> -   tx =3D &tpmif->tx->ring[0].req;
> -   cmd->req_len =3D tx->size;
> +   shr =3D tpmif->page;
> +   cmd->req_len =3D shr->length;
> +   cmd->locality =3D shr->locality;
> +   offset =3D sizeof(*shr) + 4*shr->nr_extra_pages;
> +   if (offset > PAGE_SIZE || offset + cmd->req_len > PAGE_SIZE) {
> +      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (u=
nsigned int) tpmif->domid, tpmif->handle);
> +      goto error;
> +   }
>      /* Allocate the buffer */
>      if(cmd->req_len) {
>         if((cmd->req =3D malloc(cmd->req_len)) =3D=3D NULL) {
>           goto error;
>         }
>      }
> -   /* Copy the bits from the shared pages */
> -   offset =3D 0;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && offset < cmd->req_len; ++i) =
{
> -      tx =3D &tpmif->tx->ring[i].req;
> -
> -      /* Map the page with the data */
> -      domid =3D (uint32_t)tpmif->domid;
> -      if((tpmif->pages[i] =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &=
domid, 0, &tx->ref, PROT_READ)) =3D=3D NULL) {
> -        TPMBACK_ERR("%u/%u Unable to map shared page during read!\n", =
(unsigned int) tpmif->domid, tpmif->handle);
> -        goto error;
> -      }
> -
> -      /* do the copy now */
> -      tocopy =3D min(cmd->req_len - offset, PAGE_SIZE);
> -      memcpy(&cmd->req[offset], tpmif->pages[i], tocopy);
> -      offset +=3D tocopy;
> -
> -      /* release the page */
> -      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
> -
> -   }
> +   /* Copy the bits from the shared page(s) */
> +   memcpy(cmd->req, offset + (uint8_t*)shr, cmd->req_len);
>
>   #ifdef TPMBACK_PRINT_DEBUG
>      TPMBACK_DEBUG("Received Tpm Command from %u/%u of size %u", (unsig=
ned int) tpmif->domid, tpmif->handle, cmd->req_len);
> @@ -958,38 +976,24 @@ error:
>
>   void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
>   {
> -   tpmif_tx_request_t* tx;
> -   int offset;
> -   int i;
> -   uint32_t domid;
> -   int tocopy;
> +   vtpm_shared_page_t* shr;
> +   unsigned int offset;
>      int flags;
> +#ifdef TPMBACK_PRINT_DEBUG
> +int i;
> +#endif
>
>      local_irq_save(flags);
>
> -   tx =3D &tpmif->tx->ring[0].req;
> -   tx->size =3D cmd->resp_len;
> -
> -   offset =3D 0;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && offset < cmd->resp_len; ++i)=
 {
> -      tx =3D &tpmif->tx->ring[i].req;
> -
> -      /* Map the page with the data */
> -      domid =3D (uint32_t)tpmif->domid;
> -      if((tpmif->pages[i] =3D gntmap_map_grant_refs(&gtpmdev.map, 1, &=
domid, 0, &tx->ref, PROT_WRITE)) =3D=3D NULL) {
> -        TPMBACK_ERR("%u/%u Unable to map shared page during write!\n",=
 (unsigned int) tpmif->domid, tpmif->handle);
> -        goto error;
> -      }
> -
> -      /* do the copy now */
> -      tocopy =3D min(cmd->resp_len - offset, PAGE_SIZE);
> -      memcpy(tpmif->pages[i], &cmd->resp[offset], tocopy);
> -      offset +=3D tocopy;
> -
> -      /* release the page */
> -      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
> +   shr =3D tpmif->page;
> +   shr->length =3D cmd->resp_len;
>
> +   offset =3D sizeof(*shr) + 4*shr->nr_extra_pages;
> +   if (offset > PAGE_SIZE || offset + cmd->resp_len > PAGE_SIZE) {
> +      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (u=
nsigned int) tpmif->domid, tpmif->handle);
> +      goto error;
>      }
> +   memcpy(offset + (uint8_t*)shr, cmd->resp, cmd->resp_len);
>
>   #ifdef TPMBACK_PRINT_DEBUG
>      TPMBACK_DEBUG("Sent response to %u/%u of size %u", (unsigned int) =
tpmif->domid, tpmif->handle, cmd->resp_len);
> @@ -1003,6 +1007,7 @@ void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)=

>   #endif
>      /* clear the ready flag and send the event channel notice to the f=
rontend */
>      tpmif_req_finished(tpmif);
> +   shr->state =3D 0;
>      notify_remote_via_evtchn(tpmif->evtchn);
>   error:
>      local_irq_restore(flags);
> diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
> index 0218d7f..c1cbab3 100644
> --- a/extras/mini-os/tpmfront.c
> +++ b/extras/mini-os/tpmfront.c
> @@ -153,6 +153,32 @@ static int wait_for_backend_closed(xenbus_event_qu=
eue* events, char* path)
>
>   }
>
> +static int wait_for_backend_reconfig(xenbus_event_queue* events, char*=
 path)
> +{
> +   int state;
> +
> +   TPMFRONT_LOG("Waiting for backend to reconfigure...\n");
> +   while(1) {
> +      state =3D xenbus_read_integer(path);
> +      if ( state < 0)
> +        state =3D XenbusStateUnknown;
> +      switch(state) {
> +        case XenbusStateUnknown:
> +           TPMFRONT_ERR("Backend Unknown state, forcing shutdown\n");
> +           return -1;
> +        case XenbusStateClosed:
> +           TPMFRONT_LOG("Backend Closed\n");
> +           return 0;
> +        case XenbusStateReconfigured:
> +           TPMFRONT_LOG("Backend Reconfigured\n");
> +           return 0;
> +        default:
> +           xenbus_wait_for_watch(events);
> +      }
> +   }
> +
> +}
> +
Does this reconfigure stuff make sense without patch 2?
>   static int wait_for_backend_state_changed(struct tpmfront_dev* dev, X=
enbusState state) {
>      char* err;
>      int ret =3D 0;
> @@ -175,8 +201,11 @@ static int wait_for_backend_state_changed(struct t=
pmfront_dev* dev, XenbusState
>         case XenbusStateClosed:
>           ret =3D wait_for_backend_closed(&events, path);
>           break;
> -      default:
> +      case XenbusStateReconfigured:
> +        ret =3D wait_for_backend_reconfig(&events, path);
>           break;
> +      default:
> +         TPMFRONT_ERR("Bad wait state %d, ignoring\n", state);
>      }
See above comment
>
>      if((err =3D xenbus_unwatch_path_token(XBT_NIL, path, path))) {
> @@ -190,13 +219,13 @@ static int tpmfront_connect(struct tpmfront_dev* =
dev)
>   {
>      char* err;
>      /* Create shared page */
> -   dev->tx =3D (tpmif_tx_interface_t*) alloc_page();
> -   if(dev->tx =3D=3D NULL) {
> +   dev->page =3D (vtpm_shared_page_t*) alloc_page();
> +   if(dev->page =3D=3D NULL) {
>         TPMFRONT_ERR("Unable to allocate page for shared memory\n");
>         goto error;
>      }
> -   memset(dev->tx, 0, PAGE_SIZE);
> -   dev->ring_ref =3D gnttab_grant_access(dev->bedomid, virt_to_mfn(dev=
->tx), 0);
> +   memset(dev->page, 0, PAGE_SIZE);
> +   dev->ring_ref =3D gnttab_grant_access(dev->bedomid, virt_to_mfn(dev=
->page), 0);
>      TPMFRONT_DEBUG("grant ref is %lu\n", (unsigned long) dev->ring_ref=
);
>
>      /*Create event channel */
> @@ -228,7 +257,7 @@ error_postevtchn:
>         unbind_evtchn(dev->evtchn);
>   error_postmap:
>         gnttab_end_access(dev->ring_ref);
> -      free_page(dev->tx);
> +      free_page(dev->page);
>   error:
>      return -1;
>   }
> @@ -240,7 +269,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nod=
ename)
>      char path[512];
>      char* value, *err;
>      unsigned long long ival;
> -   int i;
>
>      printk("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Init TPM Front =3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n");
>
> @@ -279,6 +307,15 @@ struct tpmfront_dev* init_tpmfront(const char* _no=
dename)
>         goto error;
>      }
>
> +   /* Publish protocol v2 feature */
> +   snprintf(path, 512, "%s/feature-protocol-v2", dev->nodename);
> +   if ((err =3D xenbus_write(XBT_NIL, path, "1")))
> +   {
> +      TPMFRONT_ERR("Unable to write feature-protocol-v2 node: %s\n", e=
rr);
> +         free(err);
> +      goto error;
> +   }
> +
>      /* Create and publish grant reference and event channel */
>      if (tpmfront_connect(dev)) {
>         goto error;
> @@ -289,18 +326,18 @@ struct tpmfront_dev* init_tpmfront(const char* _n=
odename)
>         goto error;
>      }
>
> -   /* Allocate pages that will contain the messages */
> -   dev->pages =3D malloc(sizeof(void*) * TPMIF_TX_RING_SIZE);
> -   if(dev->pages =3D=3D NULL) {
> +   snprintf(path, 512, "%s/feature-protocol-v2", dev->bepath);
> +   if((err =3D xenbus_read(XBT_NIL, path, &value))) {
> +      TPMFRONT_ERR("Unable to read %s during tpmfront initialization! =
error =3D %s\n", path, err);
> +      free(err);
>         goto error;
>      }
> -   memset(dev->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE; ++i) {
> -      dev->pages[i] =3D (void*)alloc_page();
> -      if(dev->pages[i] =3D=3D NULL) {
> -        goto error;
> -      }
> +   if(strcmp(value, "1")) {
> +      TPMFRONT_ERR("%s has an invalid value (%s)\n", path, value);
> +      free(value);
> +      goto error;
>      }
> +   free(value);
>
>      TPMFRONT_LOG("Initialization Completed successfully\n");
>
> @@ -314,12 +351,10 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>   {
>      char* err;
>      char path[512];
> -   int i;
> -   tpmif_tx_request_t* tx;
>      if(dev =3D=3D NULL) {
>         return;
>      }
> -   TPMFRONT_LOG("Shutting down tpmfront\n");
> +   TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for rec=
onfigure" : "");
I think the above line belongs in your second patch. for_reconfig is=20
undefined, causing compilation to fail.
>      /* disconnect */
>      if(dev->state =3D=3D XenbusStateConnected) {
>         dev->state =3D XenbusStateClosing;
> @@ -349,27 +384,12 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>         /* Wait for the backend to close and unmap shared pages, ignore=
 any errors */
>         wait_for_backend_state_changed(dev, XenbusStateClosed);
>
> -      /* Cleanup any shared pages */
> -      if(dev->pages) {
> -        for(i =3D 0; i < TPMIF_TX_RING_SIZE; ++i) {
> -           if(dev->pages[i]) {
> -              tx =3D &dev->tx->ring[i].req;
> -              if(tx->ref !=3D 0) {
> -                 gnttab_end_access(tx->ref);
> -              }
> -              free_page(dev->pages[i]);
> -           }
> -        }
> -        free(dev->pages);
> -      }
> -
>         /* Close event channel and unmap shared page */
>         mask_evtchn(dev->evtchn);
>         unbind_evtchn(dev->evtchn);
>         gnttab_end_access(dev->ring_ref);
>
> -      free_page(dev->tx);
> -
> +      free_page(dev->page);
>      }
>
>      /* Cleanup memory usage */
> @@ -387,13 +407,17 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>
>   int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_=
t length)
>   {
> +   unsigned int offset;
> +   vtpm_shared_page_t* shr =3D NULL;
> +#ifdef TPMFRONT_PRINT_DEBUG
>      int i;
> -   tpmif_tx_request_t* tx =3D NULL;
> +#endif
>      /* Error Checking */
>      if(dev =3D=3D NULL || dev->state !=3D XenbusStateConnected) {
>         TPMFRONT_ERR("Tried to send message through disconnected fronte=
nd\n");
>         return -1;
>      }
> +   shr =3D dev->page;
>
>   #ifdef TPMFRONT_PRINT_DEBUG
>      TPMFRONT_DEBUG("Sending Msg to backend size=3D%u", (unsigned int) =
length);
> @@ -407,19 +431,16 @@ int tpmfront_send(struct tpmfront_dev* dev, const=
 uint8_t* msg, size_t length)
>   #endif
>
>      /* Copy to shared pages now */
> -   for(i =3D 0; length > 0 && i < TPMIF_TX_RING_SIZE; ++i) {
> -      /* Share the page */
> -      tx =3D &dev->tx->ring[i].req;
> -      tx->unused =3D 0;
> -      tx->addr =3D virt_to_mach(dev->pages[i]);
> -      tx->ref =3D gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->p=
ages[i]), 0);
> -      /* Copy the bits to the page */
> -      tx->size =3D length > PAGE_SIZE ? PAGE_SIZE : length;
> -      memcpy(dev->pages[i], &msg[i * PAGE_SIZE], tx->size);
> -
> -      /* Update counters */
> -      length -=3D tx->size;
> +   offset =3D sizeof(*shr);
> +   if (length + offset > PAGE_SIZE) {
> +      TPMFRONT_ERR("Message too long for shared page\n");
> +      return -1;
>      }
I think it might be useful to #define a TPMIF_CAP_PROP_BUFFER_SIZE in=20
tpmif.h so people know ahead of time the largest command they can send.=20
Then they can create arrays on the stack with the correct length etc..

This brings up another issue. According to the TPM PC Client spec=20
section 11.3.8, there is a capability TPM_CAP_PROP_BUFFER_SIZE. We=20
should probably patch the emulator in vtpm-stubdom to make it return=20
TPMIF_CAP_PROP_BUFFER_SIZE for this capability. You don't have to worry=20
about this now if you don't want to. I can do it later once this stuff=20
is in. If you do decide to tackle it, make it a separate patch.

> +   memcpy(offset + (uint8_t*)shr, msg, length);
> +   shr->length =3D length;
> +   barrier();
> +   shr->state =3D 1;
> +
>      dev->waiting =3D 1;
>      dev->resplen =3D 0;
>   #ifdef HAVE_LIBC
> @@ -434,44 +455,41 @@ int tpmfront_send(struct tpmfront_dev* dev, const=
 uint8_t* msg, size_t length)
>   }
>   int tpmfront_recv(struct tpmfront_dev* dev, uint8_t** msg, size_t *le=
ngth)
>   {
> -   tpmif_tx_request_t* tx;
> -   int i;
> +   unsigned int offset;
> +   vtpm_shared_page_t* shr =3D NULL;
> +#ifdef TPMFRONT_PRINT_DEBUG
> +int i;
> +#endif
>      if(dev =3D=3D NULL || dev->state !=3D XenbusStateConnected) {
>         TPMFRONT_ERR("Tried to receive message from disconnected fronte=
nd\n");
>         return -1;
>      }
>      /*Wait for the response */
>      wait_event(dev->waitq, (!dev->waiting));
> +   shr =3D dev->page;
> +   if (shr->state !=3D 0)
> +      goto quit;
>
>      /* Initialize */
>      *msg =3D NULL;
> -   *length =3D 0;
> +   *length =3D shr->length;
> +   offset =3D sizeof(*shr);
>
> -   /* special case, just quit */
> -   tx =3D &dev->tx->ring[0].req;
> -   if(tx->size =3D=3D 0 ) {
> -       goto quit;
> -   }
> -   /* Get the total size */
> -   tx =3D &dev->tx->ring[0].req;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
> -      tx =3D &dev->tx->ring[i].req;
> -      *length +=3D tx->size;
> +   if (*length + offset > PAGE_SIZE) {
> +      TPMFRONT_ERR("Reply too long for shared page\n");
> +      return -1;
>      }
> +
>      /* Alloc the buffer */
>      if(dev->respbuf) {
>         free(dev->respbuf);
>      }
>      *msg =3D dev->respbuf =3D malloc(*length);
>      dev->resplen =3D *length;
> +
>      /* Copy the bits */
> -   tx =3D &dev->tx->ring[0].req;
> -   for(i =3D 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
> -      tx =3D &dev->tx->ring[i].req;
> -      memcpy(&(*msg)[i * PAGE_SIZE], dev->pages[i], tx->size);
> -      gnttab_end_access(tx->ref);
> -      tx->ref =3D 0;
> -   }
> +   memcpy(*msg, offset + (uint8_t*)shr, *length);
> +
>   #ifdef TPMFRONT_PRINT_DEBUG
>      TPMFRONT_DEBUG("Received response from backend size=3D%u", (unsign=
ed int) *length);
>      for(i =3D 0; i < *length; ++i) {
> @@ -504,6 +522,14 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t=
* req, size_t reqlen, uint8_t*
>      return 0;
>   }
>
> +int tpmfront_set_locality(struct tpmfront_dev* dev, int locality)
> +{
> +   if (!dev || !dev->page)
> +      return -1;
> +   dev->page->locality =3D locality;
> +   return 0;
> +}
> +
>   #ifdef HAVE_LIBC
>   #include <errno.h>
>   int tpmfront_open(struct tpmfront_dev* dev)
> diff --git a/xen/include/public/io/tpmif.h b/xen/include/public/io/tpmi=
f.h
> index 02ccdab..afc9181 100644
> --- a/xen/include/public/io/tpmif.h
> +++ b/xen/include/public/io/tpmif.h
> @@ -1,7 +1,7 @@
>   /********************************************************************=
**********
>    * tpmif.h
>    *
> - * TPM I/O interface for Xen guest OSes.
> + * TPM I/O interface for Xen guest OSes, v2
>    *
>    * Permission is hereby granted, free of charge, to any person obtain=
ing a copy
>    * of this software and associated documentation files (the "Software=
"), to
> @@ -21,48 +21,23 @@
>    * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHE=
R
>    * DEALINGS IN THE SOFTWARE.
>    *
> - * Copyright (c) 2005, IBM Corporation
> - *
> - * Author: Stefan Berger, stefanb@us.ibm.com
> - * Grant table support: Mahadevan Gomathisankaran
> - *
> - * This code has been derived from tools/libxc/xen/io/netif.h
> - *
> - * Copyright (c) 2003-2004, Keir Fraser
>    */
>
>   #ifndef __XEN_PUBLIC_IO_TPMIF_H__
>   #define __XEN_PUBLIC_IO_TPMIF_H__
>
> -#include "../grant_table.h"
> +struct vtpm_shared_page {
> +    uint16_t length;         /* request/response length in bytes */
>
> -struct tpmif_tx_request {
> -    unsigned long addr;   /* Machine address of packet.   */
> -    grant_ref_t ref;      /* grant table access reference */
> -    uint16_t unused;
> -    uint16_t size;        /* Packet size in bytes.        */
> -};
> -typedef struct tpmif_tx_request tpmif_tx_request_t;
> -
> -/*
> - * The TPMIF_TX_RING_SIZE defines the number of pages the
> - * front-end and backend can exchange (=3D size of array).
> - */
> -typedef uint32_t TPMIF_RING_IDX;
> -
> -#define TPMIF_TX_RING_SIZE 1
> -
> -/* This structure must fit in a memory page. */
> -
> -struct tpmif_ring {
> -    struct tpmif_tx_request req;
> -};
> -typedef struct tpmif_ring tpmif_ring_t;
> +    uint8_t state;           /* 0 - response ready / idle
> +                              * 1 - request ready / working */
> +    uint8_t locality;        /* for the current request */
> +    uint8_t padding[3];
>
> -struct tpmif_tx_interface {
> -    struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
> +    uint8_t nr_extra_pages;  /* extra pages for long packets; may be z=
ero */
> +    uint32_t extra_pages[0]; /* grant IDs; length is actually nr_extra=
_pages */
>   };
> -typedef struct tpmif_tx_interface tpmif_tx_interface_t;
> +typedef struct vtpm_shared_page vtpm_shared_page_t;
>
>   #endif
>
> --
> 1.7.11.7
>



--------------ms010309060108090903080800
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQA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ChsEVjcuMQMCBLAwDQYJKoZIhvcNAQEFBQADgYEAJO9HQh4YNChVLzuZqK5ARJARD8JoujGZ
fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEyOTE0MTQxOVowIwYJKoZIhvcNAQkEMRYEFIPZ42cOz5PyC/ei
vNzDMFG2hgqNMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYBv/+AXiEh6ONEgrxrkrqZWCmqBlPZbxAPP
GVjmi/qhgtMf1lPaX52H27FEn6we1NWeWqpfmYZPiW2jItITB9OK4H+LhQjQC0OQh+xhPk3Y
cZ5ERd3sxitXf05JpCNaEhji4wzTUO48luUmpKnanFdZth24lBYpb9meXYX8YEcergAAAAAA
AA==
--------------ms010309060108090903080800--


--===============0683494152375153930==
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.xen.org
http://lists.xen.org/xen-devel

--===============0683494152375153930==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 14:39:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 14:39:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5G7-0006o2-6f; Thu, 29 Nov 2012 14:38:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1Te5G5-0006nx-IB
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 14:38:33 +0000
Received: from [193.109.254.147:41142] by server-1.bemta-14.messagelabs.com id
	78/ED-25314-86377B05; Thu, 29 Nov 2012 14:38:32 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1354199894!1954899!1
X-Originating-IP: [91.199.104.2]
X-SpamReason: No, hits=1.8 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RATWARE_GECKO_BUILD,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16562 invoked from network); 29 Nov 2012 14:38:15 -0000
Received: from mail.bitdefender.com (HELO mail.bitdefender.com) (91.199.104.2)
	by server-15.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 14:38:15 -0000
Received: (qmail 29020 invoked from network); 29 Nov 2012 16:38:13 +0200
Received: from rcojocaru.dsd.ro (HELO ?10.10.14.59?)
	(rcojocaru@bitdefender.com@10.10.14.59)
	by mail.bitdefender.com with AES256-SHA encrypted SMTP;
	29 Nov 2012 16:38:13 +0200
Message-ID: <50B77375.9070904@gmail.com>
Date: Thu, 29 Nov 2012 16:38:45 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
X-BitDefender-Spam: No (0)
X-BitDefender-SpamStamp: Build: [Engines: 2.13.3.14894, Dats: 229708,
	Stamp: 3], Multi: [Enabled], BW: [Enabled], RBL DNSBL: [Disabled],
	APM: [Disabled, Score: 500], SGN: [Enabled], URL: [Enabled], URI
	DNSBL: [Disabled], SQMD: [Enabled, Hits: none, MD5:
	39fe7f56e9f9d0354be25429dc001e5e.fuzzy.fzrbl.org], RTDA: [Disabled,
	Hit: No], total: 0(775)
X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.0 on
	elfie.dsd.hq, sigver: 7.44184
Subject: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

I'm interested in using the mem_event API (or it's LibVMI wrapper), but 
I'm interested in capturing write events anywhere in a domU guest's 
memory, _and_ not just once for each page write, but every time a page 
is being written to.

To this end, I've looked at the xen-access.c example, where at first all 
the pages are being monitored:

xc_hvm_set_mem_access(xch, domain_id, HVMMEM_access_rx, ~0ull, 0);
xc_hvm_set_mem_access(xch, domain_id, HVMMEM_access_rx, 0, 
xenaccess->domain_info->max_pages);

Then, after an event is received:

xc_hvm_set_mem_access(xch, domain_id, HVMMEM_access_rwx, req.gfn, 1);

thus allowing 'rwx' access to 1 page starting at req.gfn.

This strategy indeed allows me to inspect writes to any page of the 
guest OS, however I can only do this once per page. Once the page is 
allowed HVMMEM_access_rwx access, any subsequent writes to it become 
unavailable to my dom0 userspace tool (I'm "unregistering" for that 
page-specific event).

The author of LibVMI's events code has suggested that I might enable 
writes to that page, single step past the write instruction, and then 
disable writes again.

Two questions:

1. I haven't been able to find an example of how single-stepping via the 
mem_event API might work. Can you point me to some code that does this 
(or a paper, etc.)?

2. Is there any other way to achieve what I'm after?

Thanks,
Razvan Cojocaru

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 14:39:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 14:39:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5G7-0006o2-6f; Thu, 29 Nov 2012 14:38:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1Te5G5-0006nx-IB
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 14:38:33 +0000
Received: from [193.109.254.147:41142] by server-1.bemta-14.messagelabs.com id
	78/ED-25314-86377B05; Thu, 29 Nov 2012 14:38:32 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1354199894!1954899!1
X-Originating-IP: [91.199.104.2]
X-SpamReason: No, hits=1.8 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RATWARE_GECKO_BUILD,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16562 invoked from network); 29 Nov 2012 14:38:15 -0000
Received: from mail.bitdefender.com (HELO mail.bitdefender.com) (91.199.104.2)
	by server-15.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 14:38:15 -0000
Received: (qmail 29020 invoked from network); 29 Nov 2012 16:38:13 +0200
Received: from rcojocaru.dsd.ro (HELO ?10.10.14.59?)
	(rcojocaru@bitdefender.com@10.10.14.59)
	by mail.bitdefender.com with AES256-SHA encrypted SMTP;
	29 Nov 2012 16:38:13 +0200
Message-ID: <50B77375.9070904@gmail.com>
Date: Thu, 29 Nov 2012 16:38:45 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
X-BitDefender-Spam: No (0)
X-BitDefender-SpamStamp: Build: [Engines: 2.13.3.14894, Dats: 229708,
	Stamp: 3], Multi: [Enabled], BW: [Enabled], RBL DNSBL: [Disabled],
	APM: [Disabled, Score: 500], SGN: [Enabled], URL: [Enabled], URI
	DNSBL: [Disabled], SQMD: [Enabled, Hits: none, MD5:
	39fe7f56e9f9d0354be25429dc001e5e.fuzzy.fzrbl.org], RTDA: [Disabled,
	Hit: No], total: 0(775)
X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.0 on
	elfie.dsd.hq, sigver: 7.44184
Subject: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

I'm interested in using the mem_event API (or it's LibVMI wrapper), but 
I'm interested in capturing write events anywhere in a domU guest's 
memory, _and_ not just once for each page write, but every time a page 
is being written to.

To this end, I've looked at the xen-access.c example, where at first all 
the pages are being monitored:

xc_hvm_set_mem_access(xch, domain_id, HVMMEM_access_rx, ~0ull, 0);
xc_hvm_set_mem_access(xch, domain_id, HVMMEM_access_rx, 0, 
xenaccess->domain_info->max_pages);

Then, after an event is received:

xc_hvm_set_mem_access(xch, domain_id, HVMMEM_access_rwx, req.gfn, 1);

thus allowing 'rwx' access to 1 page starting at req.gfn.

This strategy indeed allows me to inspect writes to any page of the 
guest OS, however I can only do this once per page. Once the page is 
allowed HVMMEM_access_rwx access, any subsequent writes to it become 
unavailable to my dom0 userspace tool (I'm "unregistering" for that 
page-specific event).

The author of LibVMI's events code has suggested that I might enable 
writes to that page, single step past the write instruction, and then 
disable writes again.

Two questions:

1. I haven't been able to find an example of how single-stepping via the 
mem_event API might work. Can you point me to some code that does this 
(or a paper, etc.)?

2. Is there any other way to achieve what I'm after?

Thanks,
Razvan Cojocaru

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 14:44:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 14:44:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5Ly-0006wP-3a; Thu, 29 Nov 2012 14:44:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te5Lw-0006wK-P0
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 14:44:36 +0000
Received: from [85.158.143.35:9301] by server-1.bemta-4.messagelabs.com id
	A8/46-27934-4D477B05; Thu, 29 Nov 2012 14:44:36 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1354200251!5364590!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3257 invoked from network); 29 Nov 2012 14:44:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 14:44:12 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16071937"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 14:44:03 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 14:44:03 +0000
Message-ID: <1354200241.25834.188.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Thu, 29 Nov 2012 14:44:01 +0000
In-Reply-To: <1354118438.25834.40.camel@zakaz.uk.xensource.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211281150380.5310@kaball.uk.xensource.com>
	<20121128142521.GB21266@phenom.dumpdata.com>
	<1354113142.25834.34.camel@zakaz.uk.xensource.com>
	<20121128144416.GD21266@phenom.dumpdata.com>
	<1354118438.25834.40.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 16:00 +0000, Ian Campbell wrote:
> I'll take a look over the next couple of days.

Here we are. I've basically turned your stable/pvh.v6 branch over so
that the ARM stuff comes first (along with required bits of pvh).

I have pushed two branches to my tree at
git://xenbits.xen.org/people/ianc/linux.git.

The first is arm-privcmd-for-3.8 and contains the ARM stuff destined for
3.8.

The second is pvh.v7 which is based on arm-privcmd-for-3.8 and adds the
pvh stuff.

Pull requests for both are below.

The diff between the pvh branch and stable/pvh.v6 corresponds exactly to
rebasing on top of "xen PVonHVM: use E820_Reserved area for shared_info"
and the pcifront changes.

I didn't try and fix up the two checks of xenfeat thinggummy in
xen_remap_domain_mfn_range that I pointed to earlier.

Since I was rebasing things anyway I did feel free clean up a few
snaggles in the history:

I skipped "xen/e820: Coalesce the PVH release/populate logic in the
generic case." and its immediate revert.

I folded "xen: include correct header for xen_pfn_t definition." into
"xen: correctly use xen_pfn_t in remap_domain_mfn_range."

Ian.


The following changes since commit b3e40b72bb24237b0aee9f6ba2e9f88dd4ff3c0a:

  xen-pciback: reject out of range inputs (2012-11-02 11:04:03 -0400)

are available in the git repository at:
  git://xenbits.xen.org/people/ianc/linux.git arm-privcmd-for-3.8

Ian Campbell (5):
      xen: add pages parameter to xen_remap_domain_mfn_range
      xen: balloon: allow PVMMU interfaces to be compiled out
      xen: arm: enable balloon driver
      xen: correctly use xen_pfn_t in remap_domain_mfn_range.
      xen: arm: implement remap interfaces needed for privcmd mappings.

Mukesh Rathor (1):
      xen: privcmd: support autotranslated physmap guests.

 arch/arm/include/asm/xen/interface.h |    1 +
 arch/arm/xen/enlighten.c             |  123 ++++++++++++++++++++++++++++------
 arch/x86/include/asm/xen/interface.h |    1 +
 arch/x86/xen/Kconfig                 |    1 +
 arch/x86/xen/mmu.c                   |   17 ++++-
 drivers/xen/Kconfig                  |    3 +
 drivers/xen/Makefile                 |    4 +-
 drivers/xen/balloon.c                |    5 +-
 drivers/xen/privcmd.c                |   72 +++++++++++++++++++-
 include/xen/interface/memory.h       |   44 ++++++++++++-
 include/xen/xen-ops.h                |    8 ++-
 11 files changed, 246 insertions(+), 33 deletions(-)

-------------------------------------------------------------------------------------


The following changes since commit f832da068b0aadb15f747f6427b6bf945f525ba4:

  xen: arm: implement remap interfaces needed for privcmd mappings. (2012-11-29 14:00:19 +0000)

are available in the git repository at:
  git://xenbits.xen.org/people/ianc/linux.git pvh.v7

Ian Campbell (1):
      xen: x86 pvh: use XENMEM_add_to_physmap_range for foreign gmfn mappings

Konrad Rzeszutek Wilk (2):
      xen/smp: Move the common CPU init code a bit to prep for PVH patch.
      xen/pvh: balloon and grant changes.

Mukesh Rathor (4):
      xen/pvh: Support ParaVirtualized Hardware extensions.
      xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
      xen/pvh: Implement MMU changes for PVH.
      xen/pvh: bootup and setup (E820) related changes.

Wei Yongjun (1):
      xen/x86: remove duplicated include from enlighten.c

 arch/x86/include/asm/xen/interface.h |   11 ++-
 arch/x86/include/asm/xen/page.h      |    3 +
 arch/x86/xen/Kconfig                 |   10 ++
 arch/x86/xen/enlighten.c             |   76 +++++++++++++----
 arch/x86/xen/irq.c                   |    5 +-
 arch/x86/xen/mmu.c                   |  155 ++++++++++++++++++++++++++++++++--
 arch/x86/xen/mmu.h                   |    2 +
 arch/x86/xen/p2m.c                   |    2 +-
 arch/x86/xen/setup.c                 |   64 +++++++++++---
 arch/x86/xen/smp.c                   |   75 +++++++++++------
 arch/x86/xen/xen-head.S              |   11 ++-
 drivers/xen/balloon.c                |   14 ++-
 drivers/xen/cpu_hotplug.c            |    4 +-
 drivers/xen/events.c                 |    9 ++-
 drivers/xen/gntdev.c                 |    3 +-
 drivers/xen/grant-table.c            |   25 +++++-
 drivers/xen/xenbus/xenbus_client.c   |    3 +-
 include/xen/interface/physdev.h      |   10 ++
 18 files changed, 403 insertions(+), 79 deletions(-)





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 14:44:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 14:44:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5Ly-0006wP-3a; Thu, 29 Nov 2012 14:44:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te5Lw-0006wK-P0
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 14:44:36 +0000
Received: from [85.158.143.35:9301] by server-1.bemta-4.messagelabs.com id
	A8/46-27934-4D477B05; Thu, 29 Nov 2012 14:44:36 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1354200251!5364590!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3257 invoked from network); 29 Nov 2012 14:44:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 14:44:12 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16071937"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 14:44:03 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 14:44:03 +0000
Message-ID: <1354200241.25834.188.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Thu, 29 Nov 2012 14:44:01 +0000
In-Reply-To: <1354118438.25834.40.camel@zakaz.uk.xensource.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
	<alpine.DEB.2.02.1211281150380.5310@kaball.uk.xensource.com>
	<20121128142521.GB21266@phenom.dumpdata.com>
	<1354113142.25834.34.camel@zakaz.uk.xensource.com>
	<20121128144416.GD21266@phenom.dumpdata.com>
	<1354118438.25834.40.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 16:00 +0000, Ian Campbell wrote:
> I'll take a look over the next couple of days.

Here we are. I've basically turned your stable/pvh.v6 branch over so
that the ARM stuff comes first (along with required bits of pvh).

I have pushed two branches to my tree at
git://xenbits.xen.org/people/ianc/linux.git.

The first is arm-privcmd-for-3.8 and contains the ARM stuff destined for
3.8.

The second is pvh.v7 which is based on arm-privcmd-for-3.8 and adds the
pvh stuff.

Pull requests for both are below.

The diff between the pvh branch and stable/pvh.v6 corresponds exactly to
rebasing on top of "xen PVonHVM: use E820_Reserved area for shared_info"
and the pcifront changes.

I didn't try and fix up the two checks of xenfeat thinggummy in
xen_remap_domain_mfn_range that I pointed to earlier.

Since I was rebasing things anyway I did feel free clean up a few
snaggles in the history:

I skipped "xen/e820: Coalesce the PVH release/populate logic in the
generic case." and its immediate revert.

I folded "xen: include correct header for xen_pfn_t definition." into
"xen: correctly use xen_pfn_t in remap_domain_mfn_range."

Ian.


The following changes since commit b3e40b72bb24237b0aee9f6ba2e9f88dd4ff3c0a:

  xen-pciback: reject out of range inputs (2012-11-02 11:04:03 -0400)

are available in the git repository at:
  git://xenbits.xen.org/people/ianc/linux.git arm-privcmd-for-3.8

Ian Campbell (5):
      xen: add pages parameter to xen_remap_domain_mfn_range
      xen: balloon: allow PVMMU interfaces to be compiled out
      xen: arm: enable balloon driver
      xen: correctly use xen_pfn_t in remap_domain_mfn_range.
      xen: arm: implement remap interfaces needed for privcmd mappings.

Mukesh Rathor (1):
      xen: privcmd: support autotranslated physmap guests.

 arch/arm/include/asm/xen/interface.h |    1 +
 arch/arm/xen/enlighten.c             |  123 ++++++++++++++++++++++++++++------
 arch/x86/include/asm/xen/interface.h |    1 +
 arch/x86/xen/Kconfig                 |    1 +
 arch/x86/xen/mmu.c                   |   17 ++++-
 drivers/xen/Kconfig                  |    3 +
 drivers/xen/Makefile                 |    4 +-
 drivers/xen/balloon.c                |    5 +-
 drivers/xen/privcmd.c                |   72 +++++++++++++++++++-
 include/xen/interface/memory.h       |   44 ++++++++++++-
 include/xen/xen-ops.h                |    8 ++-
 11 files changed, 246 insertions(+), 33 deletions(-)

-------------------------------------------------------------------------------------


The following changes since commit f832da068b0aadb15f747f6427b6bf945f525ba4:

  xen: arm: implement remap interfaces needed for privcmd mappings. (2012-11-29 14:00:19 +0000)

are available in the git repository at:
  git://xenbits.xen.org/people/ianc/linux.git pvh.v7

Ian Campbell (1):
      xen: x86 pvh: use XENMEM_add_to_physmap_range for foreign gmfn mappings

Konrad Rzeszutek Wilk (2):
      xen/smp: Move the common CPU init code a bit to prep for PVH patch.
      xen/pvh: balloon and grant changes.

Mukesh Rathor (4):
      xen/pvh: Support ParaVirtualized Hardware extensions.
      xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
      xen/pvh: Implement MMU changes for PVH.
      xen/pvh: bootup and setup (E820) related changes.

Wei Yongjun (1):
      xen/x86: remove duplicated include from enlighten.c

 arch/x86/include/asm/xen/interface.h |   11 ++-
 arch/x86/include/asm/xen/page.h      |    3 +
 arch/x86/xen/Kconfig                 |   10 ++
 arch/x86/xen/enlighten.c             |   76 +++++++++++++----
 arch/x86/xen/irq.c                   |    5 +-
 arch/x86/xen/mmu.c                   |  155 ++++++++++++++++++++++++++++++++--
 arch/x86/xen/mmu.h                   |    2 +
 arch/x86/xen/p2m.c                   |    2 +-
 arch/x86/xen/setup.c                 |   64 +++++++++++---
 arch/x86/xen/smp.c                   |   75 +++++++++++------
 arch/x86/xen/xen-head.S              |   11 ++-
 drivers/xen/balloon.c                |   14 ++-
 drivers/xen/cpu_hotplug.c            |    4 +-
 drivers/xen/events.c                 |    9 ++-
 drivers/xen/gntdev.c                 |    3 +-
 drivers/xen/grant-table.c            |   25 +++++-
 drivers/xen/xenbus/xenbus_client.c   |    3 +-
 include/xen/interface/physdev.h      |   10 ++
 18 files changed, 403 insertions(+), 79 deletions(-)





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 14:45:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 14:45:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5Mj-0006zH-HV; Thu, 29 Nov 2012 14:45:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg.zapp@gmail.com>) id 1TdrkQ-0003Xn-Fd
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 00:12:58 +0000
Received: from [85.158.137.99:5900] by server-12.bemta-3.messagelabs.com id
	E8/B2-22757-988A6B05; Thu, 29 Nov 2012 00:12:57 +0000
X-Env-Sender: greg.zapp@gmail.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1354147971!11728904!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=1.5 required=7.0 tests=HTML_00_10,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20539 invoked from network); 29 Nov 2012 00:12:55 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 00:12:55 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl17so7678553vcb.32
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 16:12:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=eItt+s2iVX+ry7n/DNrGWtL69mOwQdqBuWC+vnB+s2s=;
	b=mkTIB7FQ4HMDLHXgXttjPQxmLJ1Xp+Clt6uon8FmSfbt9QFvHgzyb1Ew7CwAtsKtp9
	E/uL3HDV2byYIj1ERH4kdt3Qj6IRJtQhk6kpgs+f3mOYHBW5tZf5vonb/tK4KkGWpPR2
	kVbZBXN4NPjmOhzc0h9OWPP0Pwx8a4F9kJMvQmlEBt2Bq6NlIuQ24vABeEitbO/a1uSF
	LkZHpicvH9OlodgFi9FHI0Hlqb7cXjwBG6FuD4b2qgGleh6pr0ivXfm51cptsTkwcTyK
	IKjOjTRUUeqI4oEXJJ2O8wJtsZTEO0scT/71wgJPjP/vw5Po3WsBqHQweOny6y3lJKLN
	+fzg==
MIME-Version: 1.0
Received: by 10.52.72.132 with SMTP id d4mr25841143vdv.43.1354147970971; Wed,
	28 Nov 2012 16:12:50 -0800 (PST)
Received: by 10.58.128.37 with HTTP; Wed, 28 Nov 2012 16:12:50 -0800 (PST)
Date: Thu, 29 Nov 2012 13:12:50 +1300
Message-ID: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
From: Greg Zapp <greg.zapp@gmail.com>
To: xen-devel@lists.xen.org
X-Mailman-Approved-At: Thu, 29 Nov 2012 14:45:24 +0000
Subject: [Xen-devel] Enabling NLB is crashing VM's/DRBD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0399822534450201402=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0399822534450201402==
Content-Type: multipart/alternative; boundary=bcaec5016557c879e804cf97247f

--bcaec5016557c879e804cf97247f
Content-Type: text/plain; charset=ISO-8859-1

Hi All,

We have a somewhat serious issue around NLB on Windows 2012 and Xen.
First, let me describe our environment and then I'll let you know what's
wrong.

2 X Debian-squeeze boxes running the latest provided AMD64 Xen kernel and
about 100GB of RAM.
These boxes are connected via infiniband and DRBD is running over
this(IPoIB).
Each VPS runs on a mirrored DRBD devices.
Each DRBD device sits on 2 logical volumes.  One for data and one for
metadata.
The hypervisors exclusively run Windows VM's(Server 2008 R2 and 2012).
The VM's are utilizing the GPLPV drivers(PCI,VBD,Net,etc).
We are using network-bridge.

So here is the trouble.  We had somebody trying to setup Windows NLB.  When
adding a host it would cause the VM to freeze but also disconnect the DRBD
devices.  Everything recovers but the DRBD devices resync and a bunch of
VM's on the one side(the side with the VM that hangs up) get rebooted by
Xen.  Here is what we are seeing in messages:

eth0: port 3(nlb2.e0) entering disabled state
eth0: port 3(nlb2.e0) entering disabled state
frontend_changed: backend/vif/65/0: prepare for reconnect
device nlb.e0 entered promiscuous mode
block drbd29: sock was shut down by peer
block drbd29: peer( Secondary -> Unknown ) conn( Connected -> BrokenPipe )
pdsk( UpToDate -> DUnknown )
block drbd24: sock was shut down by peer
block drbd24: peer( Primary -> Unknown ) conn( Connected -> BrokenPipe )
pdsk( UpToDate -> DUnknown )
block drbd29: Creating new current UUID
block drbd30: sock was shut down by peer
block drbd30: peer( Primary -> Unknown ) conn( Connected -> BrokenPipe )
pdsk( UpToDate -> DUnknown )
.... and on and on and on with the DRBD disconnecting
block drbd29: md_sync_timer expired! Worker calls drbd_md_sync().
block drbd21: md_sync_timer expired! Worker calls drbd_md_sync().
.... lots of that
block drbd24: Terminating drbd24_asender
block drbd21: asender terminated
block drbd21: Terminating drbd21_asender
....
eth0: port 3(nlb2.e0) entering forwarding state
....
block drbd1: Handshake successful: Agreed network protocol version 91
block drbd1: conn( WFConnection -> WFReportParams )
block drbd38: Handshake successful: Agreed network protocol version 91
block drbd38: conn( WFConnection -> WFReportParams )
block drbd38: Starting asender thread (from drbd38_receiver [16250])
block drbd1: Starting asender thread (from drbd1_receiver [18278])
... Then lots of stuff for the DRBD devices reconnecting and syncing.


This happened three times, each time the user was attempting to add the
second node into NLB.  I can reproduce the network adapter dying(Becomes
disabled and is unusable until reboot) in the lab on Server 2012 unless I
follow specific steps, but not the DRBD dying.  I can get NLB working but
I'm mostly concerned about one persons ability to effectively crash 8 other
VM's.  It looks like whatever is going on is somehow effecting my DRBD
connection.  Has anyone seen anything like this before?


Thanks,
   Greg

--bcaec5016557c879e804cf97247f
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi All,<br><br>We have a somewhat serious issue around NLB on Windows 2012 =
and Xen.=A0 First, let me describe our environment and then I&#39;ll let yo=
u know what&#39;s wrong.<br><br>2 X Debian-squeeze boxes running the latest=
 provided AMD64 Xen kernel and about 100GB of RAM.<br>
These boxes are connected via infiniband and DRBD is running over this(IPoI=
B).<br>Each VPS runs on a mirrored DRBD devices.<br>Each DRBD device sits o=
n 2 logical volumes.=A0 One for data and one for metadata.<br>The hyperviso=
rs exclusively run Windows VM&#39;s(Server 2008 R2 and 2012).<br>
The VM&#39;s are utilizing the GPLPV drivers(PCI,VBD,Net,etc).<br>We are us=
ing network-bridge.<br><br>So here is the trouble.=A0 We had somebody tryin=
g to setup Windows NLB.=A0 When adding a host it would cause the VM to free=
ze but also disconnect the DRBD devices.=A0 Everything recovers but the DRB=
D devices resync and a bunch of VM&#39;s on the one side(the side with the =
VM that hangs up) get rebooted by Xen.=A0 Here is what we are seeing in mes=
sages:<br>
<br>eth0: port 3(nlb2.e0) entering disabled state<br>eth0: port 3(nlb2.e0) =
entering disabled state<br>frontend_changed: backend/vif/65/0: prepare for =
reconnect<br>device nlb.e0 entered promiscuous mode<br>block drbd29: sock w=
as shut down by peer<br>
block drbd29: peer( Secondary -&gt; Unknown ) conn( Connected -&gt; BrokenP=
ipe ) pdsk( UpToDate -&gt; DUnknown ) <br>block drbd24: sock was shut down =
by peer<br>block drbd24: peer( Primary -&gt; Unknown ) conn( Connected -&gt=
; BrokenPipe ) pdsk( UpToDate -&gt; DUnknown ) <br>
block drbd29: Creating new current UUID<br>block drbd30: sock was shut down=
 by peer<br>block drbd30: peer( Primary -&gt; Unknown ) conn( Connected -&g=
t; BrokenPipe ) pdsk( UpToDate -&gt; DUnknown )<br>.... and on and on and o=
n with the DRBD disconnecting<br>
block drbd29: md_sync_timer expired! Worker calls drbd_md_sync().<br>block =
drbd21: md_sync_timer expired! Worker calls drbd_md_sync().<br>.... lots of=
 that<br>block drbd24: Terminating drbd24_asender<br>block drbd21: asender =
terminated<br>
block drbd21: Terminating drbd21_asender<br>....<br>eth0: port 3(nlb2.e0) e=
ntering forwarding state<br>....<br>block drbd1: Handshake successful: Agre=
ed network protocol version 91<br>block drbd1: conn( WFConnection -&gt; WFR=
eportParams ) <br>
block drbd38: Handshake successful: Agreed network protocol version 91<br>b=
lock drbd38: conn( WFConnection -&gt; WFReportParams ) <br>block drbd38: St=
arting asender thread (from drbd38_receiver [16250])<br>block drbd1: Starti=
ng asender thread (from drbd1_receiver [18278])<br>
... Then lots of stuff for the DRBD devices reconnecting and syncing.<br><b=
r><br>This happened three times, each time the user was attempting to add t=
he second node into NLB.=A0 I can reproduce the network adapter dying(Becom=
es disabled and is unusable until reboot) in the lab on Server 2012 unless =
I follow specific steps, but not the DRBD dying.=A0 I can get NLB working b=
ut I&#39;m mostly concerned about one persons ability to effectively crash =
8 other VM&#39;s.=A0 It looks like whatever is going on is somehow effectin=
g my DRBD connection.=A0 Has anyone seen anything like this before?<br>
<br><br>Thanks,<br>=A0=A0 Greg<br>

--bcaec5016557c879e804cf97247f--


--===============0399822534450201402==
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.xen.org
http://lists.xen.org/xen-devel

--===============0399822534450201402==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 14:45:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 14:45:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5Mj-0006zH-HV; Thu, 29 Nov 2012 14:45:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg.zapp@gmail.com>) id 1TdrkQ-0003Xn-Fd
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 00:12:58 +0000
Received: from [85.158.137.99:5900] by server-12.bemta-3.messagelabs.com id
	E8/B2-22757-988A6B05; Thu, 29 Nov 2012 00:12:57 +0000
X-Env-Sender: greg.zapp@gmail.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1354147971!11728904!1
X-Originating-IP: [209.85.220.173]
X-SpamReason: No, hits=1.5 required=7.0 tests=HTML_00_10,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20539 invoked from network); 29 Nov 2012 00:12:55 -0000
Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com)
	(209.85.220.173)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 00:12:55 -0000
Received: by mail-vc0-f173.google.com with SMTP id fl17so7678553vcb.32
	for <xen-devel@lists.xen.org>; Wed, 28 Nov 2012 16:12:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=eItt+s2iVX+ry7n/DNrGWtL69mOwQdqBuWC+vnB+s2s=;
	b=mkTIB7FQ4HMDLHXgXttjPQxmLJ1Xp+Clt6uon8FmSfbt9QFvHgzyb1Ew7CwAtsKtp9
	E/uL3HDV2byYIj1ERH4kdt3Qj6IRJtQhk6kpgs+f3mOYHBW5tZf5vonb/tK4KkGWpPR2
	kVbZBXN4NPjmOhzc0h9OWPP0Pwx8a4F9kJMvQmlEBt2Bq6NlIuQ24vABeEitbO/a1uSF
	LkZHpicvH9OlodgFi9FHI0Hlqb7cXjwBG6FuD4b2qgGleh6pr0ivXfm51cptsTkwcTyK
	IKjOjTRUUeqI4oEXJJ2O8wJtsZTEO0scT/71wgJPjP/vw5Po3WsBqHQweOny6y3lJKLN
	+fzg==
MIME-Version: 1.0
Received: by 10.52.72.132 with SMTP id d4mr25841143vdv.43.1354147970971; Wed,
	28 Nov 2012 16:12:50 -0800 (PST)
Received: by 10.58.128.37 with HTTP; Wed, 28 Nov 2012 16:12:50 -0800 (PST)
Date: Thu, 29 Nov 2012 13:12:50 +1300
Message-ID: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
From: Greg Zapp <greg.zapp@gmail.com>
To: xen-devel@lists.xen.org
X-Mailman-Approved-At: Thu, 29 Nov 2012 14:45:24 +0000
Subject: [Xen-devel] Enabling NLB is crashing VM's/DRBD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0399822534450201402=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0399822534450201402==
Content-Type: multipart/alternative; boundary=bcaec5016557c879e804cf97247f

--bcaec5016557c879e804cf97247f
Content-Type: text/plain; charset=ISO-8859-1

Hi All,

We have a somewhat serious issue around NLB on Windows 2012 and Xen.
First, let me describe our environment and then I'll let you know what's
wrong.

2 X Debian-squeeze boxes running the latest provided AMD64 Xen kernel and
about 100GB of RAM.
These boxes are connected via infiniband and DRBD is running over
this(IPoIB).
Each VPS runs on a mirrored DRBD devices.
Each DRBD device sits on 2 logical volumes.  One for data and one for
metadata.
The hypervisors exclusively run Windows VM's(Server 2008 R2 and 2012).
The VM's are utilizing the GPLPV drivers(PCI,VBD,Net,etc).
We are using network-bridge.

So here is the trouble.  We had somebody trying to setup Windows NLB.  When
adding a host it would cause the VM to freeze but also disconnect the DRBD
devices.  Everything recovers but the DRBD devices resync and a bunch of
VM's on the one side(the side with the VM that hangs up) get rebooted by
Xen.  Here is what we are seeing in messages:

eth0: port 3(nlb2.e0) entering disabled state
eth0: port 3(nlb2.e0) entering disabled state
frontend_changed: backend/vif/65/0: prepare for reconnect
device nlb.e0 entered promiscuous mode
block drbd29: sock was shut down by peer
block drbd29: peer( Secondary -> Unknown ) conn( Connected -> BrokenPipe )
pdsk( UpToDate -> DUnknown )
block drbd24: sock was shut down by peer
block drbd24: peer( Primary -> Unknown ) conn( Connected -> BrokenPipe )
pdsk( UpToDate -> DUnknown )
block drbd29: Creating new current UUID
block drbd30: sock was shut down by peer
block drbd30: peer( Primary -> Unknown ) conn( Connected -> BrokenPipe )
pdsk( UpToDate -> DUnknown )
.... and on and on and on with the DRBD disconnecting
block drbd29: md_sync_timer expired! Worker calls drbd_md_sync().
block drbd21: md_sync_timer expired! Worker calls drbd_md_sync().
.... lots of that
block drbd24: Terminating drbd24_asender
block drbd21: asender terminated
block drbd21: Terminating drbd21_asender
....
eth0: port 3(nlb2.e0) entering forwarding state
....
block drbd1: Handshake successful: Agreed network protocol version 91
block drbd1: conn( WFConnection -> WFReportParams )
block drbd38: Handshake successful: Agreed network protocol version 91
block drbd38: conn( WFConnection -> WFReportParams )
block drbd38: Starting asender thread (from drbd38_receiver [16250])
block drbd1: Starting asender thread (from drbd1_receiver [18278])
... Then lots of stuff for the DRBD devices reconnecting and syncing.


This happened three times, each time the user was attempting to add the
second node into NLB.  I can reproduce the network adapter dying(Becomes
disabled and is unusable until reboot) in the lab on Server 2012 unless I
follow specific steps, but not the DRBD dying.  I can get NLB working but
I'm mostly concerned about one persons ability to effectively crash 8 other
VM's.  It looks like whatever is going on is somehow effecting my DRBD
connection.  Has anyone seen anything like this before?


Thanks,
   Greg

--bcaec5016557c879e804cf97247f
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi All,<br><br>We have a somewhat serious issue around NLB on Windows 2012 =
and Xen.=A0 First, let me describe our environment and then I&#39;ll let yo=
u know what&#39;s wrong.<br><br>2 X Debian-squeeze boxes running the latest=
 provided AMD64 Xen kernel and about 100GB of RAM.<br>
These boxes are connected via infiniband and DRBD is running over this(IPoI=
B).<br>Each VPS runs on a mirrored DRBD devices.<br>Each DRBD device sits o=
n 2 logical volumes.=A0 One for data and one for metadata.<br>The hyperviso=
rs exclusively run Windows VM&#39;s(Server 2008 R2 and 2012).<br>
The VM&#39;s are utilizing the GPLPV drivers(PCI,VBD,Net,etc).<br>We are us=
ing network-bridge.<br><br>So here is the trouble.=A0 We had somebody tryin=
g to setup Windows NLB.=A0 When adding a host it would cause the VM to free=
ze but also disconnect the DRBD devices.=A0 Everything recovers but the DRB=
D devices resync and a bunch of VM&#39;s on the one side(the side with the =
VM that hangs up) get rebooted by Xen.=A0 Here is what we are seeing in mes=
sages:<br>
<br>eth0: port 3(nlb2.e0) entering disabled state<br>eth0: port 3(nlb2.e0) =
entering disabled state<br>frontend_changed: backend/vif/65/0: prepare for =
reconnect<br>device nlb.e0 entered promiscuous mode<br>block drbd29: sock w=
as shut down by peer<br>
block drbd29: peer( Secondary -&gt; Unknown ) conn( Connected -&gt; BrokenP=
ipe ) pdsk( UpToDate -&gt; DUnknown ) <br>block drbd24: sock was shut down =
by peer<br>block drbd24: peer( Primary -&gt; Unknown ) conn( Connected -&gt=
; BrokenPipe ) pdsk( UpToDate -&gt; DUnknown ) <br>
block drbd29: Creating new current UUID<br>block drbd30: sock was shut down=
 by peer<br>block drbd30: peer( Primary -&gt; Unknown ) conn( Connected -&g=
t; BrokenPipe ) pdsk( UpToDate -&gt; DUnknown )<br>.... and on and on and o=
n with the DRBD disconnecting<br>
block drbd29: md_sync_timer expired! Worker calls drbd_md_sync().<br>block =
drbd21: md_sync_timer expired! Worker calls drbd_md_sync().<br>.... lots of=
 that<br>block drbd24: Terminating drbd24_asender<br>block drbd21: asender =
terminated<br>
block drbd21: Terminating drbd21_asender<br>....<br>eth0: port 3(nlb2.e0) e=
ntering forwarding state<br>....<br>block drbd1: Handshake successful: Agre=
ed network protocol version 91<br>block drbd1: conn( WFConnection -&gt; WFR=
eportParams ) <br>
block drbd38: Handshake successful: Agreed network protocol version 91<br>b=
lock drbd38: conn( WFConnection -&gt; WFReportParams ) <br>block drbd38: St=
arting asender thread (from drbd38_receiver [16250])<br>block drbd1: Starti=
ng asender thread (from drbd1_receiver [18278])<br>
... Then lots of stuff for the DRBD devices reconnecting and syncing.<br><b=
r><br>This happened three times, each time the user was attempting to add t=
he second node into NLB.=A0 I can reproduce the network adapter dying(Becom=
es disabled and is unusable until reboot) in the lab on Server 2012 unless =
I follow specific steps, but not the DRBD dying.=A0 I can get NLB working b=
ut I&#39;m mostly concerned about one persons ability to effectively crash =
8 other VM&#39;s.=A0 It looks like whatever is going on is somehow effectin=
g my DRBD connection.=A0 Has anyone seen anything like this before?<br>
<br><br>Thanks,<br>=A0=A0 Greg<br>

--bcaec5016557c879e804cf97247f--


--===============0399822534450201402==
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.xen.org
http://lists.xen.org/xen-devel

--===============0399822534450201402==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 14:59:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 14:59:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5aN-0007Nc-0o; Thu, 29 Nov 2012 14:59:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Te5aL-0007NX-Ji
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 14:59:29 +0000
Received: from [85.158.143.99:56441] by server-3.bemta-4.messagelabs.com id
	19/0A-06841-05877B05; Thu, 29 Nov 2012 14:59:28 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1354201168!22083699!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5938 invoked from network); 29 Nov 2012 14:59:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 14:59:28 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16072346"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 14:59:03 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 29 Nov 2012 14:59:03 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Te5Zu-0005oE-Vx; Thu, 29 Nov 2012 14:59:03 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Te5Zu-0007x2-S7;
	Thu, 29 Nov 2012 14:59:02 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20663.30774.768088.753@mariner.uk.xensource.com>
Date: Thu, 29 Nov 2012 14:59:02 +0000
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1353668987.13542.231.camel@zakaz.uk.xensource.com>
References: <ab313e9521f44bdd91a2.1353427784@elijah>
	<1353668987.13542.231.camel@zakaz.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] xl: Suppress spurious warning message for
 cpupool-list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("Re: [Xen-devel] [PATCH] xl: Suppress spurious warning message for cpupool-list"):
> > xl: Suppress spurious warning message for cpupool-list
...
> Acked-by: Ian Campbell <ian.campbell@citrix.com> + applied, thanks.
> 
> Ian J -- a 4.2 backport candidate.

Done, thanks.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 14:59:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 14:59:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5aN-0007Nc-0o; Thu, 29 Nov 2012 14:59:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Te5aL-0007NX-Ji
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 14:59:29 +0000
Received: from [85.158.143.99:56441] by server-3.bemta-4.messagelabs.com id
	19/0A-06841-05877B05; Thu, 29 Nov 2012 14:59:28 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1354201168!22083699!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5938 invoked from network); 29 Nov 2012 14:59:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 14:59:28 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16072346"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 14:59:03 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 29 Nov 2012 14:59:03 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Te5Zu-0005oE-Vx; Thu, 29 Nov 2012 14:59:03 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Te5Zu-0007x2-S7;
	Thu, 29 Nov 2012 14:59:02 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20663.30774.768088.753@mariner.uk.xensource.com>
Date: Thu, 29 Nov 2012 14:59:02 +0000
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1353668987.13542.231.camel@zakaz.uk.xensource.com>
References: <ab313e9521f44bdd91a2.1353427784@elijah>
	<1353668987.13542.231.camel@zakaz.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] xl: Suppress spurious warning message for
 cpupool-list
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("Re: [Xen-devel] [PATCH] xl: Suppress spurious warning message for cpupool-list"):
> > xl: Suppress spurious warning message for cpupool-list
...
> Acked-by: Ian Campbell <ian.campbell@citrix.com> + applied, thanks.
> 
> Ian J -- a 4.2 backport candidate.

Done, thanks.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:04:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:04:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5eU-0007X7-NL; Thu, 29 Nov 2012 15:03:46 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1Te5eU-0007X2-3N
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:03:46 +0000
Received: from [193.109.254.147:45376] by server-15.bemta-14.messagelabs.com
	id 1E/48-12105-15977B05; Thu, 29 Nov 2012 15:03:45 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-16.tower-27.messagelabs.com!1354201393!8648019!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDc4OTY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31335 invoked from network); 29 Nov 2012 15:03:14 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-16.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 15:03:14 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 559B813E3;
	Thu, 29 Nov 2012 17:03:12 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 08825104001; Thu, 29 Nov 2012 17:03:12 +0200 (EET)
Date: Thu, 29 Nov 2012 17:03:11 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121129150311.GG8912@reaktio.net>
References: <patchbomb.1354104964@elijah>
	<e87d8fad28e00090591b.1354104966@elijah>
	<20121128151119.GC8912@reaktio.net>
	<CAFLBxZb_YwCaDAUU4pqkzbdNF0D1rFDoELVZadunt3cr3v5Tig@mail.gmail.com>
	<1354187200.25834.143.camel@zakaz.uk.xensource.com>
	<50B74AA8.3090504@eu.citrix.com>
	<CAFLBxZZqz0gJbPwfhEMxYFBTn7F_XpnevaFgB-_-OpSMrhaywA@mail.gmail.com>
	<1354191956.25834.169.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354191956.25834.169.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 2 of 2] xl: Accept a list for usbdevice in
 config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 12:25:56PM +0000, Ian Campbell wrote:
> On Thu, 2012-11-29 at 12:20 +0000, George Dunlap wrote:
> > On Thu, Nov 29, 2012 at 11:44 AM, George Dunlap
> > <george.dunlap@eu.citrix.com> wrote:
> >         qemu.git/vl.c suggests other options might include, "disk:",
> >         "serial:", "net:" and "bt:"; other non-colon-including options
> >         include "keyboard", "mouse", "wacom-tablet", and "braile".
> >         
> >         On the other hand, a number of these seem to require
> >         supplementary options to work well; e.g., network and bt
> >         (bluetooth) require one argument to hook up a USB device, and
> >         another option to say how it's connected to what.
> >         
> >         It's also interesting to note that the KVM documentation
> >         doesnt' mention using "-usb" and "-usbdevice" at all -- they
> >         seem to prefer using "-device" to specify hubs &c.
> > 
> > Speaking of which, the KVM docs refer to "-usb" and "-usbdevice" as
> > "legacy interfaces", which will only get you piix3.
> 
> This is a concern for other types of device too. We seem to invoke new
> qemu with a mixture of legacy and new-style interfaces.
> 
> >   It seems like exposing the full capabilities of qemu would mean
> > either 1) coming up with a full specifciation which we can then
> > translate into qemu directives, as libvirt seems to do, or 2) just
> > recommend people construct their own qemu command-line options to pass
> > through.
> 
> Does libvirt let you care about topologies or just it just automatically
> create a new USB controller for every N devices you add and hook things
> up in some order?
> 

Not sure about libvirt.. quick googling suggests that libvirt doesn't allow specifying the usb controller.

with qemu-kvm you can assign host usb devices to specific usb controllers
using the "bus=" option:
http://www.linux-kvm.com/content/qemu-kvm-11-adds-experimental-support-usb-30

qemu-kvm -device nec-usb-xhci,id=xhci -device usb-storage,bus=xhci.0,drive=usbstick


-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:04:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:04:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5eU-0007X7-NL; Thu, 29 Nov 2012 15:03:46 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1Te5eU-0007X2-3N
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:03:46 +0000
Received: from [193.109.254.147:45376] by server-15.bemta-14.messagelabs.com
	id 1E/48-12105-15977B05; Thu, 29 Nov 2012 15:03:45 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-16.tower-27.messagelabs.com!1354201393!8648019!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDc4OTY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31335 invoked from network); 29 Nov 2012 15:03:14 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-16.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 15:03:14 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 559B813E3;
	Thu, 29 Nov 2012 17:03:12 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 08825104001; Thu, 29 Nov 2012 17:03:12 +0200 (EET)
Date: Thu, 29 Nov 2012 17:03:11 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121129150311.GG8912@reaktio.net>
References: <patchbomb.1354104964@elijah>
	<e87d8fad28e00090591b.1354104966@elijah>
	<20121128151119.GC8912@reaktio.net>
	<CAFLBxZb_YwCaDAUU4pqkzbdNF0D1rFDoELVZadunt3cr3v5Tig@mail.gmail.com>
	<1354187200.25834.143.camel@zakaz.uk.xensource.com>
	<50B74AA8.3090504@eu.citrix.com>
	<CAFLBxZZqz0gJbPwfhEMxYFBTn7F_XpnevaFgB-_-OpSMrhaywA@mail.gmail.com>
	<1354191956.25834.169.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354191956.25834.169.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 2 of 2] xl: Accept a list for usbdevice in
 config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 12:25:56PM +0000, Ian Campbell wrote:
> On Thu, 2012-11-29 at 12:20 +0000, George Dunlap wrote:
> > On Thu, Nov 29, 2012 at 11:44 AM, George Dunlap
> > <george.dunlap@eu.citrix.com> wrote:
> >         qemu.git/vl.c suggests other options might include, "disk:",
> >         "serial:", "net:" and "bt:"; other non-colon-including options
> >         include "keyboard", "mouse", "wacom-tablet", and "braile".
> >         
> >         On the other hand, a number of these seem to require
> >         supplementary options to work well; e.g., network and bt
> >         (bluetooth) require one argument to hook up a USB device, and
> >         another option to say how it's connected to what.
> >         
> >         It's also interesting to note that the KVM documentation
> >         doesnt' mention using "-usb" and "-usbdevice" at all -- they
> >         seem to prefer using "-device" to specify hubs &c.
> > 
> > Speaking of which, the KVM docs refer to "-usb" and "-usbdevice" as
> > "legacy interfaces", which will only get you piix3.
> 
> This is a concern for other types of device too. We seem to invoke new
> qemu with a mixture of legacy and new-style interfaces.
> 
> >   It seems like exposing the full capabilities of qemu would mean
> > either 1) coming up with a full specifciation which we can then
> > translate into qemu directives, as libvirt seems to do, or 2) just
> > recommend people construct their own qemu command-line options to pass
> > through.
> 
> Does libvirt let you care about topologies or just it just automatically
> create a new USB controller for every N devices you add and hook things
> up in some order?
> 

Not sure about libvirt.. quick googling suggests that libvirt doesn't allow specifying the usb controller.

with qemu-kvm you can assign host usb devices to specific usb controllers
using the "bus=" option:
http://www.linux-kvm.com/content/qemu-kvm-11-adds-experimental-support-usb-30

qemu-kvm -device nec-usb-xhci,id=xhci -device usb-storage,bus=xhci.0,drive=usbstick


-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:06:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:06:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5gj-0007do-8t; Thu, 29 Nov 2012 15:06:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te5gh-0007dh-Qm
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:06:04 +0000
Received: from [85.158.137.99:45019] by server-8.bemta-3.messagelabs.com id
	3E/74-07786-BD977B05; Thu, 29 Nov 2012 15:06:03 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1354201562!12301651!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21339 invoked from network); 29 Nov 2012 15:06:02 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:06:02 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16072566"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:06:02 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 15:06:01 +0000
Message-ID: <1354201560.6269.6.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Thanos Makatos <thanos.makatos@citrix.com>
Date: Thu, 29 Nov 2012 15:06:00 +0000
In-Reply-To: <99866fac1445feaf3c39.1353090349@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
	<99866fac1445feaf3c39.1353090349@makatos-desktop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 9 of 9 RFC] blktap3: Introduce makefile that
 builds xenio-required tap-ctl functionality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 18:25 +0000, Thanos Makatos wrote:
> This patch imports control/Makefile from the existing blktap2 implementation,
> building only the binaries required by the xenio daemon. The rest of the
> binaries will be re-introduced by a later patch.
> 
> Defines TAPDISK_EXEC, TAPDISK_EXECDIR, and TAPDISK_BUILDDIR are used by
> tap-ctl-spawn, as it needs to know where the tapdisk binary is located in order
> to spawn a tapdisk process
> 
> diff --git a/tools/blktap2/control/Makefile b/tools/blktap3/control/Makefile
> copy from tools/blktap2/control/Makefile
> copy to tools/blktap3/control/Makefile
> --- a/tools/blktap2/control/Makefile
> +++ b/tools/blktap3/control/Makefile
> @@ -6,40 +6,36 @@ MINOR              = 0
>  LIBNAME            = libblktapctl
>  LIBSONAME          = $(LIBNAME).so.$(MAJOR)
>  
> -IBIN               = tap-ctl
> +override CFLAGS += \
> +	-I../include \
> +	-DTAPDISK_EXEC='"tapdisk"' \
> +	-DTAPDISK_EXECDIR='"/usr/local/libexec"' \

This should come from tools/configure and config/Tools.mk etc rather
than being hard coded here.

By default it should likely be under /usr/lib/xen (aka LIBEXEC_DIR).
Check out buildmakevars2file in tools/Rules.mk and the use of it in
tools/libxl/Makefile -- you probably want to do something similar.

> +	-DTAPDISK_BUILDDIR='"../drivers"' \
> +	$(CFLAGS_xeninclude) \
> +	$(CFLAGS_libxenctrl) \
> +	-D_GNU_SOURCE \
> +	-DTAPCTL \
> +    -Wall \
> +    -Wextra \
> +    -Werror
> +# FIXME cause trouble
> +override CFLAGS += \
> +    -Wno-type-limits \
> +    -Wno-missing-field-initializers \
> +    -Wno-sign-compare
>  
> -CFLAGS            += -Werror
> -CFLAGS            += -Wno-unused
> -CFLAGS            += -I../include -I../drivers
> -CFLAGS            += $(CFLAGS_xeninclude)
> -CFLAGS            += $(CFLAGS_libxenctrl)
> -CFLAGS            += -D_GNU_SOURCE
> -CFLAGS            += -DTAPCTL
> -
> -CTL_OBJS  := tap-ctl-ipc.o
>  CTL_OBJS  += tap-ctl-list.o
> -CTL_OBJS  += tap-ctl-allocate.o
> -CTL_OBJS  += tap-ctl-free.o
> -CTL_OBJS  += tap-ctl-create.o
> -CTL_OBJS  += tap-ctl-destroy.o
> +CTL_OBJS  += tap-ctl-info.o
> +CTL_OBJS  += tap-ctl-xen.o
> +CTL_OBJS  += tap-ctl-ipc.o
>  CTL_OBJS  += tap-ctl-spawn.o
> -CTL_OBJS  += tap-ctl-attach.o
> -CTL_OBJS  += tap-ctl-detach.o
> -CTL_OBJS  += tap-ctl-open.o
> -CTL_OBJS  += tap-ctl-close.o
> -CTL_OBJS  += tap-ctl-pause.o
> -CTL_OBJS  += tap-ctl-unpause.o
> -CTL_OBJS  += tap-ctl-major.o
> -CTL_OBJS  += tap-ctl-check.o
>  
>  CTL_PICS  = $(patsubst %.o,%.opic,$(CTL_OBJS))
>  
> -OBJS = $(CTL_OBJS) tap-ctl.o
>  PICS = $(CTL_PICS)
>  
>  LIB_STATIC = $(LIBNAME).a
>  LIB_SHARED = $(LIBSONAME).$(MINOR)
> -IBIN = tap-ctl
>  
>  all: build
>  
> @@ -51,25 +47,21 @@ build: $(IBIN) $(LIB_STATIC) $(LIB_SHARE
>  $(LIBSONAME): $(LIB_SHARED)
>  	ln -sf $< $@
>  
> -tap-ctl: tap-ctl.o $(LIBNAME).so
> -	$(CC) $(LDFLAGS) -o $@ $^
> -
>  $(LIB_STATIC): $(CTL_OBJS)
>  	$(AR) r $@ $^
>  
>  $(LIB_SHARED): $(CTL_PICS)
>  	$(CC) $(LDFLAGS) -fPIC  -Wl,$(SONAME_LDFLAG) -Wl,$(LIBSONAME) $(SHLIB_LDFLAGS) -rdynamic $^ -o $@
>  
> -install: $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
> +install: $(LIB_STATIC) $(LIB_SHARED)
>  	$(INSTALL_DIR) -p $(DESTDIR)$(SBINDIR)
> -	$(INSTALL_PROG) $(IBIN) $(DESTDIR)$(SBINDIR)
>  	$(INSTALL_DATA) $(LIB_STATIC) $(DESTDIR)$(LIBDIR)
>  	$(INSTALL_PROG) $(LIB_SHARED) $(DESTDIR)$(LIBDIR)
>  	ln -sf $(LIBSONAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME).so
>  	ln -sf $(LIB_SHARED) $(DESTDIR)$(LIBDIR)/$(LIBSONAME)
>  
>  clean:
> -	rm -f $(OBJS) $(PICS) $(DEPS) $(IBIN) $(LIB_STATIC) $(LIB_SHARED)

Don't you want CTL_OBJS here instead?

> +	rm -f $(PICS) $(DEPS) $(LIB_STATIC) $(LIB_SHARED)
>  	rm -f $(LIBNAME).so $(LIBSONAME)
>  	rm -f *~
>  
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:06:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:06:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5gj-0007do-8t; Thu, 29 Nov 2012 15:06:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te5gh-0007dh-Qm
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:06:04 +0000
Received: from [85.158.137.99:45019] by server-8.bemta-3.messagelabs.com id
	3E/74-07786-BD977B05; Thu, 29 Nov 2012 15:06:03 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1354201562!12301651!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21339 invoked from network); 29 Nov 2012 15:06:02 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:06:02 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16072566"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:06:02 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 15:06:01 +0000
Message-ID: <1354201560.6269.6.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Thanos Makatos <thanos.makatos@citrix.com>
Date: Thu, 29 Nov 2012 15:06:00 +0000
In-Reply-To: <99866fac1445feaf3c39.1353090349@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
	<99866fac1445feaf3c39.1353090349@makatos-desktop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 9 of 9 RFC] blktap3: Introduce makefile that
 builds xenio-required tap-ctl functionality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 18:25 +0000, Thanos Makatos wrote:
> This patch imports control/Makefile from the existing blktap2 implementation,
> building only the binaries required by the xenio daemon. The rest of the
> binaries will be re-introduced by a later patch.
> 
> Defines TAPDISK_EXEC, TAPDISK_EXECDIR, and TAPDISK_BUILDDIR are used by
> tap-ctl-spawn, as it needs to know where the tapdisk binary is located in order
> to spawn a tapdisk process
> 
> diff --git a/tools/blktap2/control/Makefile b/tools/blktap3/control/Makefile
> copy from tools/blktap2/control/Makefile
> copy to tools/blktap3/control/Makefile
> --- a/tools/blktap2/control/Makefile
> +++ b/tools/blktap3/control/Makefile
> @@ -6,40 +6,36 @@ MINOR              = 0
>  LIBNAME            = libblktapctl
>  LIBSONAME          = $(LIBNAME).so.$(MAJOR)
>  
> -IBIN               = tap-ctl
> +override CFLAGS += \
> +	-I../include \
> +	-DTAPDISK_EXEC='"tapdisk"' \
> +	-DTAPDISK_EXECDIR='"/usr/local/libexec"' \

This should come from tools/configure and config/Tools.mk etc rather
than being hard coded here.

By default it should likely be under /usr/lib/xen (aka LIBEXEC_DIR).
Check out buildmakevars2file in tools/Rules.mk and the use of it in
tools/libxl/Makefile -- you probably want to do something similar.

> +	-DTAPDISK_BUILDDIR='"../drivers"' \
> +	$(CFLAGS_xeninclude) \
> +	$(CFLAGS_libxenctrl) \
> +	-D_GNU_SOURCE \
> +	-DTAPCTL \
> +    -Wall \
> +    -Wextra \
> +    -Werror
> +# FIXME cause trouble
> +override CFLAGS += \
> +    -Wno-type-limits \
> +    -Wno-missing-field-initializers \
> +    -Wno-sign-compare
>  
> -CFLAGS            += -Werror
> -CFLAGS            += -Wno-unused
> -CFLAGS            += -I../include -I../drivers
> -CFLAGS            += $(CFLAGS_xeninclude)
> -CFLAGS            += $(CFLAGS_libxenctrl)
> -CFLAGS            += -D_GNU_SOURCE
> -CFLAGS            += -DTAPCTL
> -
> -CTL_OBJS  := tap-ctl-ipc.o
>  CTL_OBJS  += tap-ctl-list.o
> -CTL_OBJS  += tap-ctl-allocate.o
> -CTL_OBJS  += tap-ctl-free.o
> -CTL_OBJS  += tap-ctl-create.o
> -CTL_OBJS  += tap-ctl-destroy.o
> +CTL_OBJS  += tap-ctl-info.o
> +CTL_OBJS  += tap-ctl-xen.o
> +CTL_OBJS  += tap-ctl-ipc.o
>  CTL_OBJS  += tap-ctl-spawn.o
> -CTL_OBJS  += tap-ctl-attach.o
> -CTL_OBJS  += tap-ctl-detach.o
> -CTL_OBJS  += tap-ctl-open.o
> -CTL_OBJS  += tap-ctl-close.o
> -CTL_OBJS  += tap-ctl-pause.o
> -CTL_OBJS  += tap-ctl-unpause.o
> -CTL_OBJS  += tap-ctl-major.o
> -CTL_OBJS  += tap-ctl-check.o
>  
>  CTL_PICS  = $(patsubst %.o,%.opic,$(CTL_OBJS))
>  
> -OBJS = $(CTL_OBJS) tap-ctl.o
>  PICS = $(CTL_PICS)
>  
>  LIB_STATIC = $(LIBNAME).a
>  LIB_SHARED = $(LIBSONAME).$(MINOR)
> -IBIN = tap-ctl
>  
>  all: build
>  
> @@ -51,25 +47,21 @@ build: $(IBIN) $(LIB_STATIC) $(LIB_SHARE
>  $(LIBSONAME): $(LIB_SHARED)
>  	ln -sf $< $@
>  
> -tap-ctl: tap-ctl.o $(LIBNAME).so
> -	$(CC) $(LDFLAGS) -o $@ $^
> -
>  $(LIB_STATIC): $(CTL_OBJS)
>  	$(AR) r $@ $^
>  
>  $(LIB_SHARED): $(CTL_PICS)
>  	$(CC) $(LDFLAGS) -fPIC  -Wl,$(SONAME_LDFLAG) -Wl,$(LIBSONAME) $(SHLIB_LDFLAGS) -rdynamic $^ -o $@
>  
> -install: $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
> +install: $(LIB_STATIC) $(LIB_SHARED)
>  	$(INSTALL_DIR) -p $(DESTDIR)$(SBINDIR)
> -	$(INSTALL_PROG) $(IBIN) $(DESTDIR)$(SBINDIR)
>  	$(INSTALL_DATA) $(LIB_STATIC) $(DESTDIR)$(LIBDIR)
>  	$(INSTALL_PROG) $(LIB_SHARED) $(DESTDIR)$(LIBDIR)
>  	ln -sf $(LIBSONAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME).so
>  	ln -sf $(LIB_SHARED) $(DESTDIR)$(LIBDIR)/$(LIBSONAME)
>  
>  clean:
> -	rm -f $(OBJS) $(PICS) $(DEPS) $(IBIN) $(LIB_STATIC) $(LIB_SHARED)

Don't you want CTL_OBJS here instead?

> +	rm -f $(PICS) $(DEPS) $(LIB_STATIC) $(LIB_SHARED)
>  	rm -f $(LIBNAME).so $(LIBSONAME)
>  	rm -f *~
>  
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:06:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:06:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5gv-0007fU-RS; Thu, 29 Nov 2012 15:06:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te5gu-0007ew-4F
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:06:16 +0000
Received: from [85.158.138.51:13833] by server-10.bemta-3.messagelabs.com id
	B7/BD-19806-7E977B05; Thu, 29 Nov 2012 15:06:15 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1354201574!23938971!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29185 invoked from network); 29 Nov 2012 15:06:14 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:06:14 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16072568"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:06:09 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 15:06:09 +0000
Message-ID: <1354201567.6269.7.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Thanos Makatos <thanos.makatos@citrix.com>
Date: Thu, 29 Nov 2012 15:06:07 +0000
In-Reply-To: <28d57229042b9fe04a6d.1353090341@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
	<28d57229042b9fe04a6d.1353090341@makatos-desktop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 1 of 9 RFC] blktap3: Introduce blktap3
 headers
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 18:25 +0000, Thanos Makatos wrote:
> This patch introduces basic blktap3 header files. It also provides an plain
> Makefile so that the build system doesn't complain.

You don't want to start listing the headers etc in this Makefile as you
introduce them?

Which build system complains? We don't yet recurse into here do we?

> 
> diff --git a/tools/blktap3/include/Makefile b/tools/blktap3/include/Makefile
> new file mode 100644
> --- /dev/null
> +++ b/tools/blktap3/include/Makefile
> @@ -0,0 +1,14 @@
> +XEN_ROOT := $(CURDIR)/../../..
> +include $(XEN_ROOT)/tools/Rules.mk
> +
> +.PHONY: all
> +all:
> +
> +.PHONY: install
> +install:
> +	$(INSTALL_DIR) -p $(DESTDIR)$(INCLUDEDIR)
> +
> +
> +.PHONY: clean
> +clean:
> +	@:
> diff --git a/tools/blktap3/include/blktap3.h b/tools/blktap3/include/blktap3.h
> new file mode 100644
> --- /dev/null
> +++ b/tools/blktap3/include/blktap3.h
> @@ -0,0 +1,42 @@
> +/*
> + * Copyright (C) 2012      Citrix Ltd.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License as published
> + * by the Free Software Foundation; version 2.1 only. with the special
> + * exception on linking described in file LICENSE.
> + *
> + * 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 Lesser General Public License for more details.
> + *
> + * Commonly used headers and definitions.
> + */
> +
> +#ifndef __BLKTAP_3_H__
> +#define __BLKTAP_3_H__
> +
> +#include "compiler.h"
> +
> +/* TODO remove from other files */
> +#include <xen-external/bsd-sys-queue.h>
> +
> +#define BLKTAP3_CONTROL_NAME        "blktap-control"
> +#define BLKTAP3_CONTROL_DIR         "/var/run/"BLKTAP3_CONTROL_NAME
> +#define BLKTAP3_CONTROL_SOCKET      "ctl"
> +
> +#define BLKTAP3_ENOSPC_SIGNAL_FILE  "/var/run/tapdisk3-enospc"
> +
> +/*
> + * TODO They may have to change due to macro namespacing.
> + */
> +#define TAILQ_MOVE_HEAD(node, src, dst, entry)	\
> +	TAILQ_REMOVE(src, node, entry);				\
> +	TAILQ_INSERT_HEAD(dst, node, entry);
> +
> +#define TAILQ_MOVE_TAIL(node, src, dst, entry)	\
> +	TAILQ_REMOVE(src, node, entry);				\
> +	TAILQ_INSERT_TAIL(dst, node, entry);
> +
> +#endif /* __BLKTAP_3_H__ */
> diff --git a/tools/blktap3/include/compiler.h b/tools/blktap3/include/compiler.h
> new file mode 100644
> --- /dev/null
> +++ b/tools/blktap3/include/compiler.h
> @@ -0,0 +1,26 @@
> +/*
> + * TODO Do we need a license for this file?
> + */
> +#ifndef __COMPILER_H__
> +#define __COMPILER_H__
> +
> +#define likely(_cond)	__builtin_expect(!!(_cond), 1)
> +#define unlikely(_cond)	__builtin_expect(!!(_cond), 0)
> +
> +/*
> + * FIXME taken from list.h, do we need to mention anything about the license?
> + */
> +#define containerof(_ptr, _type, _memb) \
> +	((_type*)((void*)(_ptr) - offsetof(_type, _memb)))
> +
> +#define __printf(a, b)	__attribute__((format(printf, a, b)))
> +#define __scanf(_f, _a) __attribute__((format (scanf, _f, _a)))
> +
> +#ifndef ARRAY_SIZE
> +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
> +#endif /* ARRAY_SIZE */
> +
> +#define UNUSED_PARAMETER(x) \
> +    (void)(x);
> +
> +#endif /* __COMPILER_H__ */
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:06:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:06:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5gv-0007fU-RS; Thu, 29 Nov 2012 15:06:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te5gu-0007ew-4F
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:06:16 +0000
Received: from [85.158.138.51:13833] by server-10.bemta-3.messagelabs.com id
	B7/BD-19806-7E977B05; Thu, 29 Nov 2012 15:06:15 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1354201574!23938971!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29185 invoked from network); 29 Nov 2012 15:06:14 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:06:14 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16072568"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:06:09 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 15:06:09 +0000
Message-ID: <1354201567.6269.7.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Thanos Makatos <thanos.makatos@citrix.com>
Date: Thu, 29 Nov 2012 15:06:07 +0000
In-Reply-To: <28d57229042b9fe04a6d.1353090341@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
	<28d57229042b9fe04a6d.1353090341@makatos-desktop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 1 of 9 RFC] blktap3: Introduce blktap3
 headers
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 18:25 +0000, Thanos Makatos wrote:
> This patch introduces basic blktap3 header files. It also provides an plain
> Makefile so that the build system doesn't complain.

You don't want to start listing the headers etc in this Makefile as you
introduce them?

Which build system complains? We don't yet recurse into here do we?

> 
> diff --git a/tools/blktap3/include/Makefile b/tools/blktap3/include/Makefile
> new file mode 100644
> --- /dev/null
> +++ b/tools/blktap3/include/Makefile
> @@ -0,0 +1,14 @@
> +XEN_ROOT := $(CURDIR)/../../..
> +include $(XEN_ROOT)/tools/Rules.mk
> +
> +.PHONY: all
> +all:
> +
> +.PHONY: install
> +install:
> +	$(INSTALL_DIR) -p $(DESTDIR)$(INCLUDEDIR)
> +
> +
> +.PHONY: clean
> +clean:
> +	@:
> diff --git a/tools/blktap3/include/blktap3.h b/tools/blktap3/include/blktap3.h
> new file mode 100644
> --- /dev/null
> +++ b/tools/blktap3/include/blktap3.h
> @@ -0,0 +1,42 @@
> +/*
> + * Copyright (C) 2012      Citrix Ltd.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License as published
> + * by the Free Software Foundation; version 2.1 only. with the special
> + * exception on linking described in file LICENSE.
> + *
> + * 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 Lesser General Public License for more details.
> + *
> + * Commonly used headers and definitions.
> + */
> +
> +#ifndef __BLKTAP_3_H__
> +#define __BLKTAP_3_H__
> +
> +#include "compiler.h"
> +
> +/* TODO remove from other files */
> +#include <xen-external/bsd-sys-queue.h>
> +
> +#define BLKTAP3_CONTROL_NAME        "blktap-control"
> +#define BLKTAP3_CONTROL_DIR         "/var/run/"BLKTAP3_CONTROL_NAME
> +#define BLKTAP3_CONTROL_SOCKET      "ctl"
> +
> +#define BLKTAP3_ENOSPC_SIGNAL_FILE  "/var/run/tapdisk3-enospc"
> +
> +/*
> + * TODO They may have to change due to macro namespacing.
> + */
> +#define TAILQ_MOVE_HEAD(node, src, dst, entry)	\
> +	TAILQ_REMOVE(src, node, entry);				\
> +	TAILQ_INSERT_HEAD(dst, node, entry);
> +
> +#define TAILQ_MOVE_TAIL(node, src, dst, entry)	\
> +	TAILQ_REMOVE(src, node, entry);				\
> +	TAILQ_INSERT_TAIL(dst, node, entry);
> +
> +#endif /* __BLKTAP_3_H__ */
> diff --git a/tools/blktap3/include/compiler.h b/tools/blktap3/include/compiler.h
> new file mode 100644
> --- /dev/null
> +++ b/tools/blktap3/include/compiler.h
> @@ -0,0 +1,26 @@
> +/*
> + * TODO Do we need a license for this file?
> + */
> +#ifndef __COMPILER_H__
> +#define __COMPILER_H__
> +
> +#define likely(_cond)	__builtin_expect(!!(_cond), 1)
> +#define unlikely(_cond)	__builtin_expect(!!(_cond), 0)
> +
> +/*
> + * FIXME taken from list.h, do we need to mention anything about the license?
> + */
> +#define containerof(_ptr, _type, _memb) \
> +	((_type*)((void*)(_ptr) - offsetof(_type, _memb)))
> +
> +#define __printf(a, b)	__attribute__((format(printf, a, b)))
> +#define __scanf(_f, _a) __attribute__((format (scanf, _f, _a)))
> +
> +#ifndef ARRAY_SIZE
> +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
> +#endif /* ARRAY_SIZE */
> +
> +#define UNUSED_PARAMETER(x) \
> +    (void)(x);
> +
> +#endif /* __COMPILER_H__ */
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:08:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:08:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5ih-0007sU-C1; Thu, 29 Nov 2012 15:08:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1Te5ig-0007sK-Ph
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 15:08:07 +0000
Received: from [85.158.137.99:54654] by server-7.bemta-3.messagelabs.com id
	72/D0-01713-55A77B05; Thu, 29 Nov 2012 15:08:05 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354201684!14041832!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDc4OTY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1450 invoked from network); 29 Nov 2012 15:08:05 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-9.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 15:08:05 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id A02A216D7;
	Thu, 29 Nov 2012 17:07:36 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 83E74104001; Thu, 29 Nov 2012 17:07:36 +0200 (EET)
Date: Thu, 29 Nov 2012 17:07:36 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Greg Zapp <greg.zapp@gmail.com>
Message-ID: <20121129150736.GH8912@reaktio.net>
References: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Enabling NLB is crashing VM's/DRBD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 01:12:50PM +1300, Greg Zapp wrote:
>    Hi All,
>

Hello,
 
>    We have a somewhat serious issue around NLB on Windows 2012 and Xen.
>    First, let me describe our environment and then I'll let you know what's
>    wrong.
> 
>    2 X Debian-squeeze boxes running the latest provided AMD64 Xen kernel and
>    about 100GB of RAM.

You haven't provided enough information..

- What Xen version are you running? 
- What dom0 kernel version are you running? 


>    These boxes are connected via infiniband and DRBD is running over
>    this(IPoIB).
>    Each VPS runs on a mirrored DRBD devices.
>    Each DRBD device sits on 2 logical volumes.  One for data and one for
>    metadata.
>    The hypervisors exclusively run Windows VM's(Server 2008 R2 and 2012).
>    The VM's are utilizing the GPLPV drivers(PCI,VBD,Net,etc).
>    We are using network-bridge.
> 
>    So here is the trouble.  We had somebody trying to setup Windows NLB.
>    When adding a host it would cause the VM to freeze but also disconnect the
>    DRBD devices.  Everything recovers but the DRBD devices resync and a bunch
>    of VM's on the one side(the side with the VM that hangs up) get rebooted
>    by Xen.  Here is what we are seeing in messages:
> 
>    eth0: port 3(nlb2.e0) entering disabled state
>    eth0: port 3(nlb2.e0) entering disabled state
>    frontend_changed: backend/vif/65/0: prepare for reconnect
>    device nlb.e0 entered promiscuous mode
>    block drbd29: sock was shut down by peer
>    block drbd29: peer( Secondary -> Unknown ) conn( Connected -> BrokenPipe )
>    pdsk( UpToDate -> DUnknown )
>    block drbd24: sock was shut down by peer
>    block drbd24: peer( Primary -> Unknown ) conn( Connected -> BrokenPipe )
>    pdsk( UpToDate -> DUnknown )
>    block drbd29: Creating new current UUID
>    block drbd30: sock was shut down by peer
>    block drbd30: peer( Primary -> Unknown ) conn( Connected -> BrokenPipe )
>    pdsk( UpToDate -> DUnknown )
>    .... and on and on and on with the DRBD disconnecting
>    block drbd29: md_sync_timer expired! Worker calls drbd_md_sync().
>    block drbd21: md_sync_timer expired! Worker calls drbd_md_sync().
>    .... lots of that
>    block drbd24: Terminating drbd24_asender
>    block drbd21: asender terminated
>    block drbd21: Terminating drbd21_asender
>    ....
>    eth0: port 3(nlb2.e0) entering forwarding state
>    ....
>    block drbd1: Handshake successful: Agreed network protocol version 91
>    block drbd1: conn( WFConnection -> WFReportParams )
>    block drbd38: Handshake successful: Agreed network protocol version 91
>    block drbd38: conn( WFConnection -> WFReportParams )
>    block drbd38: Starting asender thread (from drbd38_receiver [16250])
>    block drbd1: Starting asender thread (from drbd1_receiver [18278])
>    ... Then lots of stuff for the DRBD devices reconnecting and syncing.
> 
>    This happened three times, each time the user was attempting to add the
>    second node into NLB.  I can reproduce the network adapter dying(Becomes
>    disabled and is unusable until reboot) in the lab on Server 2012 unless I
>    follow specific steps, but not the DRBD dying.  I can get NLB working but
>    I'm mostly concerned about one persons ability to effectively crash 8
>    other VM's.  It looks like whatever is going on is somehow effecting my
>    DRBD connection.  Has anyone seen anything like this before?
> 

Does it happen without GPLPV drivers? Try using plain Intel e1000 emulated NICs in the Windows VMs.

Any errors in dom0 kernel dmesg? How about in Xen dmesg? 


-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:08:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:08:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5ih-0007sU-C1; Thu, 29 Nov 2012 15:08:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1Te5ig-0007sK-Ph
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 15:08:07 +0000
Received: from [85.158.137.99:54654] by server-7.bemta-3.messagelabs.com id
	72/D0-01713-55A77B05; Thu, 29 Nov 2012 15:08:05 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354201684!14041832!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDc4OTY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1450 invoked from network); 29 Nov 2012 15:08:05 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-9.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 15:08:05 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id A02A216D7;
	Thu, 29 Nov 2012 17:07:36 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 83E74104001; Thu, 29 Nov 2012 17:07:36 +0200 (EET)
Date: Thu, 29 Nov 2012 17:07:36 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Greg Zapp <greg.zapp@gmail.com>
Message-ID: <20121129150736.GH8912@reaktio.net>
References: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Enabling NLB is crashing VM's/DRBD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 01:12:50PM +1300, Greg Zapp wrote:
>    Hi All,
>

Hello,
 
>    We have a somewhat serious issue around NLB on Windows 2012 and Xen.
>    First, let me describe our environment and then I'll let you know what's
>    wrong.
> 
>    2 X Debian-squeeze boxes running the latest provided AMD64 Xen kernel and
>    about 100GB of RAM.

You haven't provided enough information..

- What Xen version are you running? 
- What dom0 kernel version are you running? 


>    These boxes are connected via infiniband and DRBD is running over
>    this(IPoIB).
>    Each VPS runs on a mirrored DRBD devices.
>    Each DRBD device sits on 2 logical volumes.  One for data and one for
>    metadata.
>    The hypervisors exclusively run Windows VM's(Server 2008 R2 and 2012).
>    The VM's are utilizing the GPLPV drivers(PCI,VBD,Net,etc).
>    We are using network-bridge.
> 
>    So here is the trouble.  We had somebody trying to setup Windows NLB.
>    When adding a host it would cause the VM to freeze but also disconnect the
>    DRBD devices.  Everything recovers but the DRBD devices resync and a bunch
>    of VM's on the one side(the side with the VM that hangs up) get rebooted
>    by Xen.  Here is what we are seeing in messages:
> 
>    eth0: port 3(nlb2.e0) entering disabled state
>    eth0: port 3(nlb2.e0) entering disabled state
>    frontend_changed: backend/vif/65/0: prepare for reconnect
>    device nlb.e0 entered promiscuous mode
>    block drbd29: sock was shut down by peer
>    block drbd29: peer( Secondary -> Unknown ) conn( Connected -> BrokenPipe )
>    pdsk( UpToDate -> DUnknown )
>    block drbd24: sock was shut down by peer
>    block drbd24: peer( Primary -> Unknown ) conn( Connected -> BrokenPipe )
>    pdsk( UpToDate -> DUnknown )
>    block drbd29: Creating new current UUID
>    block drbd30: sock was shut down by peer
>    block drbd30: peer( Primary -> Unknown ) conn( Connected -> BrokenPipe )
>    pdsk( UpToDate -> DUnknown )
>    .... and on and on and on with the DRBD disconnecting
>    block drbd29: md_sync_timer expired! Worker calls drbd_md_sync().
>    block drbd21: md_sync_timer expired! Worker calls drbd_md_sync().
>    .... lots of that
>    block drbd24: Terminating drbd24_asender
>    block drbd21: asender terminated
>    block drbd21: Terminating drbd21_asender
>    ....
>    eth0: port 3(nlb2.e0) entering forwarding state
>    ....
>    block drbd1: Handshake successful: Agreed network protocol version 91
>    block drbd1: conn( WFConnection -> WFReportParams )
>    block drbd38: Handshake successful: Agreed network protocol version 91
>    block drbd38: conn( WFConnection -> WFReportParams )
>    block drbd38: Starting asender thread (from drbd38_receiver [16250])
>    block drbd1: Starting asender thread (from drbd1_receiver [18278])
>    ... Then lots of stuff for the DRBD devices reconnecting and syncing.
> 
>    This happened three times, each time the user was attempting to add the
>    second node into NLB.  I can reproduce the network adapter dying(Becomes
>    disabled and is unusable until reboot) in the lab on Server 2012 unless I
>    follow specific steps, but not the DRBD dying.  I can get NLB working but
>    I'm mostly concerned about one persons ability to effectively crash 8
>    other VM's.  It looks like whatever is going on is somehow effecting my
>    DRBD connection.  Has anyone seen anything like this before?
> 

Does it happen without GPLPV drivers? Try using plain Intel e1000 emulated NICs in the Windows VMs.

Any errors in dom0 kernel dmesg? How about in Xen dmesg? 


-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:11:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:11:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5lJ-000866-Uc; Thu, 29 Nov 2012 15:10:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1Te5lI-00085r-Fp
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:10:48 +0000
Received: from [85.158.143.99:30035] by server-1.bemta-4.messagelabs.com id
	B4/2D-27934-7FA77B05; Thu, 29 Nov 2012 15:10:47 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-7.tower-216.messagelabs.com!1354201846!24002543!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDc4OTY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 682 invoked from network); 29 Nov 2012 15:10:46 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-7.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 15:10:46 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 82B8917BD;
	Thu, 29 Nov 2012 17:10:44 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 44A92104001; Thu, 29 Nov 2012 17:10:44 +0200 (EET)
Date: Thu, 29 Nov 2012 17:10:44 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121129151044.GI8912@reaktio.net>
References: <alpine.DEB.2.02.1209101842150.15568@kaball.uk.xensource.com>
	<40776A41FC278F40B59438AD47D147A90FE40092@SHSMSX102.ccr.corp.intel.com>
	<alpine.DEB.2.02.1209181123280.29232@kaball.uk.xensource.com>
	<40776A41FC278F40B59438AD47D147A90FEAE3A2@SHSMSX102.ccr.corp.intel.com>
	<alpine.DEB.2.02.1211291320500.5310@kaball.uk.xensource.com>
	<1354197431.25834.183.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354197431.25834.183.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>, "Xu,
	Dongxiao" <dongxiao.xu@intel.com>
Subject: Re: [Xen-devel] [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and
 cpu_ioreq_move
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 01:57:11PM +0000, Ian Campbell wrote:
> On Thu, 2012-11-29 at 13:21 +0000, Stefano Stabellini wrote:
> > > Also I think 4.2.1 need these patches to enable the basic Xen on Xen
> > > nested virtualization usage scenario.
> > 
> > I agree.
> 
> Nested virt was a tech preview in 4.2.0, is it really worth
> backporting ?
> 

IIRC AMD Nested Virt works on 4.2.0, so if this backport makes Intel Nested Virt
working aswell it'd be nice..

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:11:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:11:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5lJ-000866-Uc; Thu, 29 Nov 2012 15:10:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1Te5lI-00085r-Fp
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:10:48 +0000
Received: from [85.158.143.99:30035] by server-1.bemta-4.messagelabs.com id
	B4/2D-27934-7FA77B05; Thu, 29 Nov 2012 15:10:47 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-7.tower-216.messagelabs.com!1354201846!24002543!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDc4OTY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 682 invoked from network); 29 Nov 2012 15:10:46 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-7.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 15:10:46 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 82B8917BD;
	Thu, 29 Nov 2012 17:10:44 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 44A92104001; Thu, 29 Nov 2012 17:10:44 +0200 (EET)
Date: Thu, 29 Nov 2012 17:10:44 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121129151044.GI8912@reaktio.net>
References: <alpine.DEB.2.02.1209101842150.15568@kaball.uk.xensource.com>
	<40776A41FC278F40B59438AD47D147A90FE40092@SHSMSX102.ccr.corp.intel.com>
	<alpine.DEB.2.02.1209181123280.29232@kaball.uk.xensource.com>
	<40776A41FC278F40B59438AD47D147A90FEAE3A2@SHSMSX102.ccr.corp.intel.com>
	<alpine.DEB.2.02.1211291320500.5310@kaball.uk.xensource.com>
	<1354197431.25834.183.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354197431.25834.183.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"Keir \(Xen.org\)" <keir@xen.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>, "Xu,
	Dongxiao" <dongxiao.xu@intel.com>
Subject: Re: [Xen-devel] [PATCH 0/2] QEMU/xen: simplify cpu_ioreq_pio and
 cpu_ioreq_move
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 01:57:11PM +0000, Ian Campbell wrote:
> On Thu, 2012-11-29 at 13:21 +0000, Stefano Stabellini wrote:
> > > Also I think 4.2.1 need these patches to enable the basic Xen on Xen
> > > nested virtualization usage scenario.
> > 
> > I agree.
> 
> Nested virt was a tech preview in 4.2.0, is it really worth
> backporting ?
> 

IIRC AMD Nested Virt works on 4.2.0, so if this backport makes Intel Nested Virt
working aswell it'd be nice..

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:11:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:11:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5lO-00086x-Ao; Thu, 29 Nov 2012 15:10:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te5lM-00086a-Ju
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:10:52 +0000
Received: from [85.158.138.51:32162] by server-4.bemta-3.messagelabs.com id
	D3/57-30023-BFA77B05; Thu, 29 Nov 2012 15:10:51 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1354201850!31929941!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21876 invoked from network); 29 Nov 2012 15:10:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:10:50 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16072668"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:10:50 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 15:10:49 +0000
Message-ID: <1354201848.6269.12.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Thanos Makatos <thanos.makatos@citrix.com>
Date: Thu, 29 Nov 2012 15:10:48 +0000
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 0 of 9 RFC] blktap3: Introduce a small
 subset of blktap3 files
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 18:25 +0000, Thanos Makatos wrote:
> blktap3 is a disk backend driver. It is based on blktap2 but does not require
> the blktap/blkback kernel modules as it allows tapdisk to talk directly to
> blkfront. This primarily simplifies maintenance, and _may_ lead to performance
> improvements. This patch series introduces a small subset of files required by
> blktap3. blktap3 is based on a blktap2 fork maintained mostly by Citrix (it
> lives in github), so these changes are also imported, apart from the blktap3
> ones.

Sorry it took so long to look at this series, it generally looks good,
thanks. I made a couple of minor comments on some patches and I noticed
that I agreed with many of your TODOs.

Can you list explicitly what is in the patch, I think it's the central
dispatcher/ctl daemon, which spawns the tapdisk processes on demand, but
not the tapdisk process itself?

It might also be useful to give a high level overview of the
architecture. Could you enumerate what the moving parts are and how they
fit together?

For example, I think, but I'm guessing a bit, that there is a daemon
which watches xenstore and spawns processes on demand, is that right? Is
that daemon called "tap-ctl"

There is also an RPC mechanism for talking to either that daemon or the
individual tapdisk process and a library for clients to speak it? This
is unix domain socket based or something else?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:11:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:11:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5lO-00086x-Ao; Thu, 29 Nov 2012 15:10:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te5lM-00086a-Ju
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:10:52 +0000
Received: from [85.158.138.51:32162] by server-4.bemta-3.messagelabs.com id
	D3/57-30023-BFA77B05; Thu, 29 Nov 2012 15:10:51 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1354201850!31929941!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21876 invoked from network); 29 Nov 2012 15:10:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:10:50 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16072668"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:10:50 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 15:10:49 +0000
Message-ID: <1354201848.6269.12.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Thanos Makatos <thanos.makatos@citrix.com>
Date: Thu, 29 Nov 2012 15:10:48 +0000
In-Reply-To: <patchbomb.1353090340@makatos-desktop>
References: <patchbomb.1353090340@makatos-desktop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 0 of 9 RFC] blktap3: Introduce a small
 subset of blktap3 files
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-16 at 18:25 +0000, Thanos Makatos wrote:
> blktap3 is a disk backend driver. It is based on blktap2 but does not require
> the blktap/blkback kernel modules as it allows tapdisk to talk directly to
> blkfront. This primarily simplifies maintenance, and _may_ lead to performance
> improvements. This patch series introduces a small subset of files required by
> blktap3. blktap3 is based on a blktap2 fork maintained mostly by Citrix (it
> lives in github), so these changes are also imported, apart from the blktap3
> ones.

Sorry it took so long to look at this series, it generally looks good,
thanks. I made a couple of minor comments on some patches and I noticed
that I agreed with many of your TODOs.

Can you list explicitly what is in the patch, I think it's the central
dispatcher/ctl daemon, which spawns the tapdisk processes on demand, but
not the tapdisk process itself?

It might also be useful to give a high level overview of the
architecture. Could you enumerate what the moving parts are and how they
fit together?

For example, I think, but I'm guessing a bit, that there is a daemon
which watches xenstore and spawns processes on demand, is that right? Is
that daemon called "tap-ctl"

There is also an RPC mechanism for talking to either that daemon or the
individual tapdisk process and a library for clients to speak it? This
is unix domain socket based or something else?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:13:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:13:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5nU-0008Ll-UU; Thu, 29 Nov 2012 15:13:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te5nS-0008Lb-U2
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:13:03 +0000
Received: from [85.158.143.35:33441] by server-1.bemta-4.messagelabs.com id
	FC/50-27934-E7B77B05; Thu, 29 Nov 2012 15:13:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1354201970!13388768!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11352 invoked from network); 29 Nov 2012 15:12:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:12:50 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16072725"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:12:50 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 15:12:50 +0000
Message-ID: <1354201968.6269.14.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Thanos Makatos <thanos.makatos@citrix.com>
Date: Thu, 29 Nov 2012 15:12:48 +0000
In-Reply-To: <patchbomb.1354112410@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 0 of 5 RFC] blktap3: Introduce xenio daemon
 (coordinate blkfront with tapdisk).
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 14:20 +0000, Thanos Makatos wrote:
> This patch series introduces the xenio daemon.

Can we call it something less generic?

>  This daemon is responsible for
> coordinating blkfront and tapdisk, when blkfront changes state. It does so by
> monitoring XenStore for blkfront state changes. The daemon creates/destroys the
> shared ring, instructs the tapdisk to connect to/disconnect from it, and
> manages the state of the back-end.

So xenio creates the ring and manages xenstore? How does tapdisk get
access to the ring?

> 
> This series requires the RFC series described in
> http://lists.xen.org/archives/html/xen-devel/2012-11/msg00875.html
> in order to compile.
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:13:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:13:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5nU-0008Ll-UU; Thu, 29 Nov 2012 15:13:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te5nS-0008Lb-U2
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:13:03 +0000
Received: from [85.158.143.35:33441] by server-1.bemta-4.messagelabs.com id
	FC/50-27934-E7B77B05; Thu, 29 Nov 2012 15:13:02 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1354201970!13388768!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11352 invoked from network); 29 Nov 2012 15:12:50 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:12:50 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16072725"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:12:50 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 15:12:50 +0000
Message-ID: <1354201968.6269.14.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Thanos Makatos <thanos.makatos@citrix.com>
Date: Thu, 29 Nov 2012 15:12:48 +0000
In-Reply-To: <patchbomb.1354112410@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 0 of 5 RFC] blktap3: Introduce xenio daemon
 (coordinate blkfront with tapdisk).
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 14:20 +0000, Thanos Makatos wrote:
> This patch series introduces the xenio daemon.

Can we call it something less generic?

>  This daemon is responsible for
> coordinating blkfront and tapdisk, when blkfront changes state. It does so by
> monitoring XenStore for blkfront state changes. The daemon creates/destroys the
> shared ring, instructs the tapdisk to connect to/disconnect from it, and
> manages the state of the back-end.

So xenio creates the ring and manages xenstore? How does tapdisk get
access to the ring?

> 
> This series requires the RFC series described in
> http://lists.xen.org/archives/html/xen-devel/2012-11/msg00875.html
> in order to compile.
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:15:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:15:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5pA-00005B-Dp; Thu, 29 Nov 2012 15:14:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te5p9-000052-Hf
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:14:47 +0000
Received: from [193.109.254.147:24558] by server-2.bemta-14.messagelabs.com id
	9B/D7-20829-6EB77B05; Thu, 29 Nov 2012 15:14:46 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1354202085!8793163!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6963 invoked from network); 29 Nov 2012 15:14:45 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:14:45 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16072769"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:14:44 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 15:14:44 +0000
Message-ID: <1354202083.6269.15.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Thanos Makatos <thanos.makatos@citrix.com>
Date: Thu, 29 Nov 2012 15:14:43 +0000
In-Reply-To: <d426fc26719748805aaf.1354112411@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
	<d426fc26719748805aaf.1354112411@makatos-desktop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 1 of 5 RFC] blktap3: Introduce fundamental
 xenio headers
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 14:20 +0000, Thanos Makatos wrote:
> This patch introduces header files xenio-common.h, which contains common
> definitions used by the xenio daemon, libxenio, and the users of libxenio, and
> xenio-private.h, which contains private definitions used by the xenio daemon
> and libxenio.
> 
> diff -r 84f51929a064 -r d426fc267197 tools/blktap3/xenio/xenio-common.h
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/blktap3/xenio/xenio-common.h	Wed Nov 28 14:11:43 2012 +0000
> @@ -0,0 +1,34 @@
> +/*
> + * Copyright (C) 2012      Citrix Ltd.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License as published
> + * by the Free Software Foundation; version 2.1 only. with the special
> + * exception on linking described in file LICENSE.

I don't think I've seen a LICENSE file yet (thinking back I think this
was true of the previous series as well).

What is the special exception?

> + *
> + * 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 Lesser General Public License for more details.
> + *
> + * Common definitions used by the xenio daemon, libxenio, and the users of
> + * libxenio.
> + */
> +
> +#ifndef __XENIO_COMMON_H__
> +#define __XENIO_COMMON_H__
> +
> +#include <assert.h>
> +
> +/**
> + * Block I/O protocol
> + *
> + * TODO Why start from 1?
> + * TODO Define a macro that tells whether a protocol is supported.
> + */
> +enum {
> +    XENIO_BLKIF_PROTO_NATIVE = 1,
> +    XENIO_BLKIF_PROTO_X86_32 = 2,
> +    XENIO_BLKIF_PROTO_X86_64 = 3,
> +};
> +#endif /* __XENIO_COMMON_H__ */
> diff -r 84f51929a064 -r d426fc267197 tools/blktap3/xenio/xenio-private.h
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/blktap3/xenio/xenio-private.h	Wed Nov 28 14:11:43 2012 +0000
> @@ -0,0 +1,34 @@
> +/*
> + * Copyright (C) 2012      Citrix Ltd.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License as published
> + * by the Free Software Foundation; version 2.1 only. with the special
> + * exception on linking described in file LICENSE.
> + *
> + * 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 Lesser General Public License for more details.
> + *
> + * Private definitions used by the xenio daemon and libxenio.
> + */
> +
> +#ifndef __XENIO_PRIVATE_H__
> +#define __XENIO_PRIVATE_H__
> +
> +#include "blktap3.h"
> +#include <xenctrl.h>
> +#include <stdlib.h>
> +#include <syslog.h>
> +
> +void xenio_log(int prio, const char *fmt, ...);
> +void (*xenio_vlog) (int prio, const char *fmt, va_list ap);
> +
> +#define DBG(_fmt, _args...)  xenio_log(LOG_DEBUG, "%s:%d "_fmt, __FILE__, \
> +        __LINE__, ##_args)
> +#define INFO(_fmt, _args...) xenio_log(LOG_INFO, _fmt, ##_args)
> +#define WARN(_fmt, _args...) xenio_log(LOG_WARNING, "%s:%d "_fmt, __FILE__, \
> +        __LINE__, ##_args)
> +
> +#endif /* __XENIO_PRIVATE_H__ */
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:15:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:15:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5pA-00005B-Dp; Thu, 29 Nov 2012 15:14:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te5p9-000052-Hf
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:14:47 +0000
Received: from [193.109.254.147:24558] by server-2.bemta-14.messagelabs.com id
	9B/D7-20829-6EB77B05; Thu, 29 Nov 2012 15:14:46 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1354202085!8793163!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6963 invoked from network); 29 Nov 2012 15:14:45 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:14:45 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16072769"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:14:44 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 15:14:44 +0000
Message-ID: <1354202083.6269.15.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Thanos Makatos <thanos.makatos@citrix.com>
Date: Thu, 29 Nov 2012 15:14:43 +0000
In-Reply-To: <d426fc26719748805aaf.1354112411@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
	<d426fc26719748805aaf.1354112411@makatos-desktop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 1 of 5 RFC] blktap3: Introduce fundamental
 xenio headers
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 14:20 +0000, Thanos Makatos wrote:
> This patch introduces header files xenio-common.h, which contains common
> definitions used by the xenio daemon, libxenio, and the users of libxenio, and
> xenio-private.h, which contains private definitions used by the xenio daemon
> and libxenio.
> 
> diff -r 84f51929a064 -r d426fc267197 tools/blktap3/xenio/xenio-common.h
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/blktap3/xenio/xenio-common.h	Wed Nov 28 14:11:43 2012 +0000
> @@ -0,0 +1,34 @@
> +/*
> + * Copyright (C) 2012      Citrix Ltd.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License as published
> + * by the Free Software Foundation; version 2.1 only. with the special
> + * exception on linking described in file LICENSE.

I don't think I've seen a LICENSE file yet (thinking back I think this
was true of the previous series as well).

What is the special exception?

> + *
> + * 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 Lesser General Public License for more details.
> + *
> + * Common definitions used by the xenio daemon, libxenio, and the users of
> + * libxenio.
> + */
> +
> +#ifndef __XENIO_COMMON_H__
> +#define __XENIO_COMMON_H__
> +
> +#include <assert.h>
> +
> +/**
> + * Block I/O protocol
> + *
> + * TODO Why start from 1?
> + * TODO Define a macro that tells whether a protocol is supported.
> + */
> +enum {
> +    XENIO_BLKIF_PROTO_NATIVE = 1,
> +    XENIO_BLKIF_PROTO_X86_32 = 2,
> +    XENIO_BLKIF_PROTO_X86_64 = 3,
> +};
> +#endif /* __XENIO_COMMON_H__ */
> diff -r 84f51929a064 -r d426fc267197 tools/blktap3/xenio/xenio-private.h
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/blktap3/xenio/xenio-private.h	Wed Nov 28 14:11:43 2012 +0000
> @@ -0,0 +1,34 @@
> +/*
> + * Copyright (C) 2012      Citrix Ltd.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License as published
> + * by the Free Software Foundation; version 2.1 only. with the special
> + * exception on linking described in file LICENSE.
> + *
> + * 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 Lesser General Public License for more details.
> + *
> + * Private definitions used by the xenio daemon and libxenio.
> + */
> +
> +#ifndef __XENIO_PRIVATE_H__
> +#define __XENIO_PRIVATE_H__
> +
> +#include "blktap3.h"
> +#include <xenctrl.h>
> +#include <stdlib.h>
> +#include <syslog.h>
> +
> +void xenio_log(int prio, const char *fmt, ...);
> +void (*xenio_vlog) (int prio, const char *fmt, va_list ap);
> +
> +#define DBG(_fmt, _args...)  xenio_log(LOG_DEBUG, "%s:%d "_fmt, __FILE__, \
> +        __LINE__, ##_args)
> +#define INFO(_fmt, _args...) xenio_log(LOG_INFO, _fmt, ##_args)
> +#define WARN(_fmt, _args...) xenio_log(LOG_WARNING, "%s:%d "_fmt, __FILE__, \
> +        __LINE__, ##_args)
> +
> +#endif /* __XENIO_PRIVATE_H__ */
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:16:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:16:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5qH-0000GX-Sy; Thu, 29 Nov 2012 15:15:57 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Te5qG-0000GI-DQ
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 15:15:56 +0000
Received: from [85.158.139.211:51289] by server-15.bemta-5.messagelabs.com id
	23/0B-26920-B2C77B05; Thu, 29 Nov 2012 15:15:55 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1354202153!18429507!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3206 invoked from network); 29 Nov 2012 15:15:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:15:55 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16072804"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:15:52 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 15:15:52 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>
Date: Thu, 29 Nov 2012 16:15:42 +0100
Message-ID: <1354202142-22695-1-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH v2] docs: expand persistent grants protocol
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

U2lnbmVkLW9mZi1ieTogUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+Ci0t
LQogeGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmggfCAgIDM3ICsrKysrKysrKysrKysrKysr
KysrKysrKysrKysrKysrKystLS0KIDEgZmlsZXMgY2hhbmdlZCwgMzQgaW5zZXJ0aW9ucygrKSwg
MyBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS94ZW4vaW5jbHVkZS9wdWJsaWMvaW8vYmxraWYu
aCBiL3hlbi9pbmNsdWRlL3B1YmxpYy9pby9ibGtpZi5oCmluZGV4IDhkZjU4NjYuLjFmMGZiZDYg
MTAwNjQ0Ci0tLSBhL3hlbi9pbmNsdWRlL3B1YmxpYy9pby9ibGtpZi5oCisrKyBiL3hlbi9pbmNs
dWRlL3B1YmxpYy9pby9ibGtpZi5oCkBAIC0xMzcsNyArMTM3LDIyIEBACiAgKiAgICAgIGNhbiBt
YXAgcGVyc2lzdGVudGx5IGRlcGVuZHMgb24gdGhlIGltcGxlbWVudGF0aW9uLCBidXQgaWRlYWxs
eSBpdAogICogICAgICBzaG91bGQgYmUgUklOR19TSVpFICogQkxLSUZfTUFYX1NFR01FTlRTX1BF
Ul9SRVFVRVNULiBVc2luZyB0aGlzCiAgKiAgICAgIGZlYXR1cmUgdGh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lbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRl
dmVsQGxpc3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:16:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:16:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5qH-0000GX-Sy; Thu, 29 Nov 2012 15:15:57 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Te5qG-0000GI-DQ
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 15:15:56 +0000
Received: from [85.158.139.211:51289] by server-15.bemta-5.messagelabs.com id
	23/0B-26920-B2C77B05; Thu, 29 Nov 2012 15:15:55 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1354202153!18429507!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3206 invoked from network); 29 Nov 2012 15:15:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:15:55 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16072804"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:15:52 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 15:15:52 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>
Date: Thu, 29 Nov 2012 16:15:42 +0100
Message-ID: <1354202142-22695-1-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH v2] docs: expand persistent grants protocol
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

U2lnbmVkLW9mZi1ieTogUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+Ci0t
LQogeGVuL2luY2x1ZGUvcHVibGljL2lvL2Jsa2lmLmggfCAgIDM3ICsrKysrKysrKysrKysrKysr
KysrKysrKysrKysrKysrKystLS0KIDEgZmlsZXMgY2hhbmdlZCwgMzQgaW5zZXJ0aW9ucygrKSwg
MyBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS94ZW4vaW5jbHVkZS9wdWJsaWMvaW8vYmxraWYu
aCBiL3hlbi9pbmNsdWRlL3B1YmxpYy9pby9ibGtpZi5oCmluZGV4IDh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ICogICAgIGdyYW50cyB0aGF0IGNhbiBiZSBwZXJzaXN0ZW50bHkg
bWFwcGVkIGluIHRoZSBmcm9udGVuZCBkcml2ZXIsIGJ1dAorICogICAgIGR1ZSB0byB0aGUgZnJv
bnRlbnQgZHJpdmVyIGltcGxlbWVudGF0aW9uIGl0IHNob3VsZCBuZXZlciBiZSBiaWdnZXIKKyAq
ICAgICB0aGFuIFJJTkdfU0laRSAqIEJMS0lGX01BWF9TRUdNRU5UU19QRVJfUkVRVUVTVC4KICAq
LwogCiAvKgotLSAKMS43LjcuNSAoQXBwbGUgR2l0LTI2KQoKCl9fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVuLWRl
dmVsQGxpc3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcveGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:16:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:16:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5qQ-0000I7-Fs; Thu, 29 Nov 2012 15:16:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te5qP-0000Hb-04
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:16:05 +0000
Received: from [85.158.137.99:35445] by server-13.bemta-3.messagelabs.com id
	EF/2E-24887-43C77B05; Thu, 29 Nov 2012 15:16:04 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1354202152!14058919!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20921 invoked from network); 29 Nov 2012 15:15:53 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:15:53 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16072797"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:15:37 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 15:15:37 +0000
Message-ID: <1354202135.6269.16.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Thanos Makatos <thanos.makatos@citrix.com>
Date: Thu, 29 Nov 2012 15:15:35 +0000
In-Reply-To: <6918a76c96d89bc821a4.1354112412@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
	<6918a76c96d89bc821a4.1354112412@makatos-desktop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 2 of 5 RFC] blktap3: Logging for the xenio
 daemon and libxenio
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 14:20 +0000, Thanos Makatos wrote:
> This patch introduces xenio and libxenio logging functionality. At the moment
> logging is passed to vsyslog() via a wrapper.

This is a rather fine grained way to present these patches. A single
patch "add the xenio daemon" would have been ok I think.

> 
> diff -r d426fc267197 -r 6918a76c96d8 tools/blktap3/xenio/log.c
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/blktap3/xenio/log.c	Wed Nov 28 14:13:29 2012 +0000
> @@ -0,0 +1,15 @@
> +#include "compiler.h"
> +#include <stdarg.h>
> +#include <syslog.h>
> +
> +void (*xenio_vlog) (int prio, const char *fmt, va_list ap) = vsyslog;
> +
> +__printf(2, 3) void
> +xenio_log(int prio, const char *fmt, ...)
> +{
> +    va_list ap;
> +    va_start(ap, fmt);
> +    xenio_vlog(prio, fmt, ap);
> +    va_end(ap);
> +}
> +
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:16:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:16:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5qQ-0000I7-Fs; Thu, 29 Nov 2012 15:16:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te5qP-0000Hb-04
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:16:05 +0000
Received: from [85.158.137.99:35445] by server-13.bemta-3.messagelabs.com id
	EF/2E-24887-43C77B05; Thu, 29 Nov 2012 15:16:04 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1354202152!14058919!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20921 invoked from network); 29 Nov 2012 15:15:53 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:15:53 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16072797"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:15:37 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 15:15:37 +0000
Message-ID: <1354202135.6269.16.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Thanos Makatos <thanos.makatos@citrix.com>
Date: Thu, 29 Nov 2012 15:15:35 +0000
In-Reply-To: <6918a76c96d89bc821a4.1354112412@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
	<6918a76c96d89bc821a4.1354112412@makatos-desktop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 2 of 5 RFC] blktap3: Logging for the xenio
 daemon and libxenio
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 14:20 +0000, Thanos Makatos wrote:
> This patch introduces xenio and libxenio logging functionality. At the moment
> logging is passed to vsyslog() via a wrapper.

This is a rather fine grained way to present these patches. A single
patch "add the xenio daemon" would have been ok I think.

> 
> diff -r d426fc267197 -r 6918a76c96d8 tools/blktap3/xenio/log.c
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/blktap3/xenio/log.c	Wed Nov 28 14:13:29 2012 +0000
> @@ -0,0 +1,15 @@
> +#include "compiler.h"
> +#include <stdarg.h>
> +#include <syslog.h>
> +
> +void (*xenio_vlog) (int prio, const char *fmt, va_list ap) = vsyslog;
> +
> +__printf(2, 3) void
> +xenio_log(int prio, const char *fmt, ...)
> +{
> +    va_list ap;
> +    va_start(ap, fmt);
> +    xenio_vlog(prio, fmt, ap);
> +    va_end(ap);
> +}
> +
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:18:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:18:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5s5-0000Wg-0U; Thu, 29 Nov 2012 15:17:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1Te5s4-0000WR-8M
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 15:17:48 +0000
Received: from [85.158.137.99:10013] by server-7.bemta-3.messagelabs.com id
	BE/61-01713-B9C77B05; Thu, 29 Nov 2012 15:17:47 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354202266!16886291!1
X-Originating-IP: [91.199.104.2]
X-SpamReason: No, hits=1.8 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RATWARE_GECKO_BUILD,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 308 invoked from network); 29 Nov 2012 15:17:46 -0000
Received: from mail.bitdefender.com (HELO mail.bitdefender.com) (91.199.104.2)
	by server-2.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 15:17:46 -0000
Received: (qmail 25339 invoked from network); 29 Nov 2012 17:17:45 +0200
Received: from rcojocaru.dsd.ro (HELO ?10.10.14.59?)
	(rcojocaru@bitdefender.com@10.10.14.59)
	by mail.bitdefender.com with AES256-SHA encrypted SMTP;
	29 Nov 2012 17:17:44 +0200
Message-ID: <50B77CB8.1040606@gmail.com>
Date: Thu, 29 Nov 2012 17:18:16 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <50B77375.9070904@gmail.com>
In-Reply-To: <50B77375.9070904@gmail.com>
X-BitDefender-Spam: No (0)
X-BitDefender-SpamStamp: Build: [Engines: 2.13.3.14894, Dats: 229713,
	Stamp: 3], Multi: [Enabled], BW: [Enabled], RBL DNSBL: [Disabled],
	APM: [Disabled, Score: 500], SGN: [Enabled], URL: [Enabled], URI
	DNSBL: [Disabled], SQMD: [Enabled, Hits: none, MD5:
	c038e2c7dbffb4448f4bed443f9ff141.fuzzy.fzrbl.org], RTDA: [Disabled,
	Hit: No], total: 0(775)
X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.0 on
	elfie.dsd.hq, sigver: 7.44185
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> 1. I haven't been able to find an example of how single-stepping via the
> mem_event API might work. Can you point me to some code that does this
> (or a paper, etc.)?

This is what I got so far (assume the xen-access.c source code file):

int main(int argc, char *argv[])
{
[...]
     rc = xc_hvm_set_mem_access(xch, domain_id,
                                default_access, ~0ull, 0);
     rc = xc_hvm_set_mem_access(xch, domain_id,
                                default_access, 0,
                                xenaccess->domain_info->max_pages);
     xc_set_hvm_param(xch, domain_id,
                      HVM_PARAM_MEMORY_EVENT_SINGLE_STEP,
                      HVMPME_mode_sync);
[...]
             case MEM_EVENT_REASON_SINGLESTEP:
                 printf("SINGLESTEP: gla: %lx gfn %lx\n",
                        req.gla, req.gfn);
                 // If something to do with gfn/gfa,
                 // stop single-stepping this domain and
                 // start faulting again on page writes.
                 break;

             case MEM_EVENT_REASON_VIOLATION:
                 [...]
                 if ( default_access != after_first_access ) {
                     rc = xc_hvm_set_mem_access(xch, domain_id,
                                                after_first_access,
                                                req.gfn, 1);
                     xc_domain_debug_control(xch, domain_id,
                          XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON,
                          req.vcpu_id);
                 }
[...]
}

Not quite sure what to do with gla and gfn except print them out at this 
point, though. Again, the condition for stopping single-step mode is 
that a page write happened. Any help is appreciated.

Thanks,
Razvan Cojocaru


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:18:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:18:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te5s5-0000Wg-0U; Thu, 29 Nov 2012 15:17:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1Te5s4-0000WR-8M
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 15:17:48 +0000
Received: from [85.158.137.99:10013] by server-7.bemta-3.messagelabs.com id
	BE/61-01713-B9C77B05; Thu, 29 Nov 2012 15:17:47 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354202266!16886291!1
X-Originating-IP: [91.199.104.2]
X-SpamReason: No, hits=1.8 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RATWARE_GECKO_BUILD,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 308 invoked from network); 29 Nov 2012 15:17:46 -0000
Received: from mail.bitdefender.com (HELO mail.bitdefender.com) (91.199.104.2)
	by server-2.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 15:17:46 -0000
Received: (qmail 25339 invoked from network); 29 Nov 2012 17:17:45 +0200
Received: from rcojocaru.dsd.ro (HELO ?10.10.14.59?)
	(rcojocaru@bitdefender.com@10.10.14.59)
	by mail.bitdefender.com with AES256-SHA encrypted SMTP;
	29 Nov 2012 17:17:44 +0200
Message-ID: <50B77CB8.1040606@gmail.com>
Date: Thu, 29 Nov 2012 17:18:16 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <50B77375.9070904@gmail.com>
In-Reply-To: <50B77375.9070904@gmail.com>
X-BitDefender-Spam: No (0)
X-BitDefender-SpamStamp: Build: [Engines: 2.13.3.14894, Dats: 229713,
	Stamp: 3], Multi: [Enabled], BW: [Enabled], RBL DNSBL: [Disabled],
	APM: [Disabled, Score: 500], SGN: [Enabled], URL: [Enabled], URI
	DNSBL: [Disabled], SQMD: [Enabled, Hits: none, MD5:
	c038e2c7dbffb4448f4bed443f9ff141.fuzzy.fzrbl.org], RTDA: [Disabled,
	Hit: No], total: 0(775)
X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.0 on
	elfie.dsd.hq, sigver: 7.44185
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> 1. I haven't been able to find an example of how single-stepping via the
> mem_event API might work. Can you point me to some code that does this
> (or a paper, etc.)?

This is what I got so far (assume the xen-access.c source code file):

int main(int argc, char *argv[])
{
[...]
     rc = xc_hvm_set_mem_access(xch, domain_id,
                                default_access, ~0ull, 0);
     rc = xc_hvm_set_mem_access(xch, domain_id,
                                default_access, 0,
                                xenaccess->domain_info->max_pages);
     xc_set_hvm_param(xch, domain_id,
                      HVM_PARAM_MEMORY_EVENT_SINGLE_STEP,
                      HVMPME_mode_sync);
[...]
             case MEM_EVENT_REASON_SINGLESTEP:
                 printf("SINGLESTEP: gla: %lx gfn %lx\n",
                        req.gla, req.gfn);
                 // If something to do with gfn/gfa,
                 // stop single-stepping this domain and
                 // start faulting again on page writes.
                 break;

             case MEM_EVENT_REASON_VIOLATION:
                 [...]
                 if ( default_access != after_first_access ) {
                     rc = xc_hvm_set_mem_access(xch, domain_id,
                                                after_first_access,
                                                req.gfn, 1);
                     xc_domain_debug_control(xch, domain_id,
                          XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON,
                          req.vcpu_id);
                 }
[...]
}

Not quite sure what to do with gla and gfn except print them out at this 
point, though. Again, the condition for stopping single-step mode is 
that a page write happened. Any help is appreciated.

Thanks,
Razvan Cojocaru


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:26:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:26:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te60P-0000vN-20; Thu, 29 Nov 2012 15:26:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te60N-0000vI-7w
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 15:26:23 +0000
Received: from [85.158.143.35:29700] by server-2.bemta-4.messagelabs.com id
	94/A7-28922-E9E77B05; Thu, 29 Nov 2012 15:26:22 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1354202729!5370155!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22589 invoked from network); 29 Nov 2012 15:25:30 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-4.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 15:25:30 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te5zP-000LqX-KG; Thu, 29 Nov 2012 15:25:23 +0000
Date: Thu, 29 Nov 2012 15:25:23 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121129152523.GC80627@ocelot.phlegethon.org>
References: <50B5B48C.7040804@jp.fujitsu.com>
	<50B5DBD702000078000AC021@nat28.tlf.novell.com>
	<50B6B3AA.2080505@jp.fujitsu.com>
	<50B71C5302000078000AC5CE@nat28.tlf.novell.com>
	<20121129110505.GA80627@ocelot.phlegethon.org>
	<50B76E3F02000078000AC7D8@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="x+6KMIRAuhnl3hBn"
Content-Disposition: inline
In-Reply-To: <50B76E3F02000078000AC7D8@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Kouya Shimura <kouya@jp.fujitsu.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] x86/hap: Fix memory leak of
	domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--x+6KMIRAuhnl3hBn
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline

At 13:16 +0000 on 29 Nov (1354194991), Jan Beulich wrote:
> >>> On 29.11.12 at 12:05, Tim Deegan <tim@xen.org> wrote:
> > I have taken the conditional out but left it as an explicit free(). 
> > It might not always be safe to call hap_track_dirty_vram(), even for
> > disabling, this late in the teardown.
> 
> So is this something we also want to have on 4.2 and 4.1?

Yes, I think so (after the customary delay).  It applies OK to 4.2; 
a backport to 4.1 is attached.

Tim.

--x+6KMIRAuhnl3hBn
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: attachment; filename=y

x86/hap: Fix memory leak of domain->arch.hvm_domain.dirty_vram

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Tim Deegan <tim@xen.org>

diff -r d89986111f0c xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Tue Nov 27 13:28:36 2012 +0100
+++ b/xen/arch/x86/mm/hap/hap.c	Thu Nov 29 15:22:33 2012 +0000
@@ -686,6 +686,9 @@ void hap_teardown(struct domain *d)
 
     d->arch.paging.mode &= ~PG_log_dirty;
 
+    xfree(d->arch.hvm_domain.dirty_vram);
+    d->arch.hvm_domain.dirty_vram = NULL;
+
     hap_unlock(d);
 }
 

--x+6KMIRAuhnl3hBn
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.xen.org
http://lists.xen.org/xen-devel

--x+6KMIRAuhnl3hBn--


From xen-devel-bounces@lists.xen.org Thu Nov 29 15:26:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:26:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te60P-0000vN-20; Thu, 29 Nov 2012 15:26:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te60N-0000vI-7w
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 15:26:23 +0000
Received: from [85.158.143.35:29700] by server-2.bemta-4.messagelabs.com id
	94/A7-28922-E9E77B05; Thu, 29 Nov 2012 15:26:22 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1354202729!5370155!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22589 invoked from network); 29 Nov 2012 15:25:30 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-4.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 15:25:30 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te5zP-000LqX-KG; Thu, 29 Nov 2012 15:25:23 +0000
Date: Thu, 29 Nov 2012 15:25:23 +0000
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Message-ID: <20121129152523.GC80627@ocelot.phlegethon.org>
References: <50B5B48C.7040804@jp.fujitsu.com>
	<50B5DBD702000078000AC021@nat28.tlf.novell.com>
	<50B6B3AA.2080505@jp.fujitsu.com>
	<50B71C5302000078000AC5CE@nat28.tlf.novell.com>
	<20121129110505.GA80627@ocelot.phlegethon.org>
	<50B76E3F02000078000AC7D8@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="x+6KMIRAuhnl3hBn"
Content-Disposition: inline
In-Reply-To: <50B76E3F02000078000AC7D8@nat28.tlf.novell.com>
User-Agent: Mutt/1.4.2.1i
Cc: Kouya Shimura <kouya@jp.fujitsu.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] x86/hap: Fix memory leak of
	domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org


--x+6KMIRAuhnl3hBn
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline

At 13:16 +0000 on 29 Nov (1354194991), Jan Beulich wrote:
> >>> On 29.11.12 at 12:05, Tim Deegan <tim@xen.org> wrote:
> > I have taken the conditional out but left it as an explicit free(). 
> > It might not always be safe to call hap_track_dirty_vram(), even for
> > disabling, this late in the teardown.
> 
> So is this something we also want to have on 4.2 and 4.1?

Yes, I think so (after the customary delay).  It applies OK to 4.2; 
a backport to 4.1 is attached.

Tim.

--x+6KMIRAuhnl3hBn
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: attachment; filename=y

x86/hap: Fix memory leak of domain->arch.hvm_domain.dirty_vram

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Tim Deegan <tim@xen.org>

diff -r d89986111f0c xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Tue Nov 27 13:28:36 2012 +0100
+++ b/xen/arch/x86/mm/hap/hap.c	Thu Nov 29 15:22:33 2012 +0000
@@ -686,6 +686,9 @@ void hap_teardown(struct domain *d)
 
     d->arch.paging.mode &= ~PG_log_dirty;
 
+    xfree(d->arch.hvm_domain.dirty_vram);
+    d->arch.hvm_domain.dirty_vram = NULL;
+
     hap_unlock(d);
 }
 

--x+6KMIRAuhnl3hBn
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.xen.org
http://lists.xen.org/xen-devel

--x+6KMIRAuhnl3hBn--


From xen-devel-bounces@lists.xen.org Thu Nov 29 15:27:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:27:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te610-0000xh-Fk; Thu, 29 Nov 2012 15:27:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te60y-0000xV-De
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:27:00 +0000
Received: from [85.158.139.211:24903] by server-1.bemta-5.messagelabs.com id
	A1/A0-09311-3CE77B05; Thu, 29 Nov 2012 15:26:59 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1354202781!18416996!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16683 invoked from network); 29 Nov 2012 15:26:21 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:26:21 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16073094"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:26:21 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 15:26:21 +0000
Message-ID: <1354202779.6269.24.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Thanos Makatos <thanos.makatos@citrix.com>
Date: Thu, 29 Nov 2012 15:26:19 +0000
In-Reply-To: <7126fda1424905ed186f.1354112413@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
	<7126fda1424905ed186f.1354112413@makatos-desktop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 3 of 5 RFC] blktap3: Introduce xenio.c,
 core xenio daemon functionality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 14:20 +0000, Thanos Makatos wrote:

> +/*
> + * XenStore path components.
> + *
> + * TODO "xenio" is defined in the IDL, take it from there instead of
> + * hard-coding it here

Is there an IDL somewhere that I've failed to find?

> + */
> +#define XENIO_BACKEND_NAME     "xenio"
> +#define XENIO_BACKEND_PATH     "backend/"XENIO_BACKEND_NAME
> +#define XENIO_BACKEND_TOKEN    "backend-"XENIO_BACKEND_NAME
> +
[...]
> +/**
> + * Reads the specified XenStore path. The caller must free the returned buffer.
> + *
> + * @param xs handle to XenStore
> + * @param xst XenStore transaction (TODO Maybe NULL?)
> + * @param fmt TODO
> + * @param ap TODO
> + * @returns TODO
> + *
> + * TODO Why don't we return the data pointer?
> + */
> +static char *
> +xenio_xs_vread(struct xs_handle * const xs, xs_transaction_t xst,
> +        const char * const fmt, va_list ap)
> +{
> +    char *path, *data, *s = NULL;
> +    unsigned int len;
> +
> +    assert(xs);
> +
> +    path = vmprintf(fmt, ap);
> +    data = xs_read(xs, xst, path, &len);
> +    DBG("XS read %s -> %s \n", path, data);
> +    free(path);
> +
> +    if (data) {
> +        s = strndup(data, len);
> +        free(data);

Is this a rather complicated way of ensuring the string is NULL
terminated?

I suppose given the xs protocol and/or libxenstore doesn't necessarily
NULL terminate the data or leave enough room in the allocated buffer to
add a NULL this might actually be required, yuk!

> +    }
> +
> +    return s;
> +}
> +
[...]
> +    /*
> +     * Set a watch on the back-end path using a token.
> +     *
> +     * TODO Do we really need to supply a token, given that this is the _only_
> +     * watch on this specific path by this process?

xenio_backend_read_watch appears to use the token to distinguish the two
cases of watch which you have?

> +     */
> +    nerr = xs_watch(backend.xs, XENIO_BACKEND_PATH, XENIO_BACKEND_TOKEN);
> +    if (!nerr) {
> +        err = -errno;
> +        goto fail;
> +    }
> +
> +    backend.ops = ops;
> +
> +    return 0;
> +
> +fail:
> +       xenio_backend_destroy();
> +
> +    return -err;
> +}

There's obviously a lot of code here, I'm not going to pretend I read it
all, but I did have a skim and commented on what leapt out.

If there are any areas which you think could benefit from closer review,
e.g. bits which are security sensitive or where you are unsure about the
compatibility requirements for various guests or something like that
then please do highlight them and I can take a closer look.

Some of your TODOs ask more general questions about Xen PV protocols etc
which I suspect could be pretty quickly by someone on this list who is
already familiar with that niche if you posted them as questions rather
than part of the patch -- please don't feel you have to reverse engineer
the whole thing yourself ;-)

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:27:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:27:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te610-0000xh-Fk; Thu, 29 Nov 2012 15:27:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te60y-0000xV-De
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:27:00 +0000
Received: from [85.158.139.211:24903] by server-1.bemta-5.messagelabs.com id
	A1/A0-09311-3CE77B05; Thu, 29 Nov 2012 15:26:59 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1354202781!18416996!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16683 invoked from network); 29 Nov 2012 15:26:21 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:26:21 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16073094"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:26:21 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 15:26:21 +0000
Message-ID: <1354202779.6269.24.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Thanos Makatos <thanos.makatos@citrix.com>
Date: Thu, 29 Nov 2012 15:26:19 +0000
In-Reply-To: <7126fda1424905ed186f.1354112413@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
	<7126fda1424905ed186f.1354112413@makatos-desktop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 3 of 5 RFC] blktap3: Introduce xenio.c,
 core xenio daemon functionality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 14:20 +0000, Thanos Makatos wrote:

> +/*
> + * XenStore path components.
> + *
> + * TODO "xenio" is defined in the IDL, take it from there instead of
> + * hard-coding it here

Is there an IDL somewhere that I've failed to find?

> + */
> +#define XENIO_BACKEND_NAME     "xenio"
> +#define XENIO_BACKEND_PATH     "backend/"XENIO_BACKEND_NAME
> +#define XENIO_BACKEND_TOKEN    "backend-"XENIO_BACKEND_NAME
> +
[...]
> +/**
> + * Reads the specified XenStore path. The caller must free the returned buffer.
> + *
> + * @param xs handle to XenStore
> + * @param xst XenStore transaction (TODO Maybe NULL?)
> + * @param fmt TODO
> + * @param ap TODO
> + * @returns TODO
> + *
> + * TODO Why don't we return the data pointer?
> + */
> +static char *
> +xenio_xs_vread(struct xs_handle * const xs, xs_transaction_t xst,
> +        const char * const fmt, va_list ap)
> +{
> +    char *path, *data, *s = NULL;
> +    unsigned int len;
> +
> +    assert(xs);
> +
> +    path = vmprintf(fmt, ap);
> +    data = xs_read(xs, xst, path, &len);
> +    DBG("XS read %s -> %s \n", path, data);
> +    free(path);
> +
> +    if (data) {
> +        s = strndup(data, len);
> +        free(data);

Is this a rather complicated way of ensuring the string is NULL
terminated?

I suppose given the xs protocol and/or libxenstore doesn't necessarily
NULL terminate the data or leave enough room in the allocated buffer to
add a NULL this might actually be required, yuk!

> +    }
> +
> +    return s;
> +}
> +
[...]
> +    /*
> +     * Set a watch on the back-end path using a token.
> +     *
> +     * TODO Do we really need to supply a token, given that this is the _only_
> +     * watch on this specific path by this process?

xenio_backend_read_watch appears to use the token to distinguish the two
cases of watch which you have?

> +     */
> +    nerr = xs_watch(backend.xs, XENIO_BACKEND_PATH, XENIO_BACKEND_TOKEN);
> +    if (!nerr) {
> +        err = -errno;
> +        goto fail;
> +    }
> +
> +    backend.ops = ops;
> +
> +    return 0;
> +
> +fail:
> +       xenio_backend_destroy();
> +
> +    return -err;
> +}

There's obviously a lot of code here, I'm not going to pretend I read it
all, but I did have a skim and commented on what leapt out.

If there are any areas which you think could benefit from closer review,
e.g. bits which are security sensitive or where you are unsure about the
compatibility requirements for various guests or something like that
then please do highlight them and I can take a closer look.

Some of your TODOs ask more general questions about Xen PV protocols etc
which I suspect could be pretty quickly by someone on this list who is
already familiar with that niche if you posted them as questions rather
than part of the patch -- please don't feel you have to reverse engineer
the whole thing yourself ;-)

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:32:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:32:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te65w-0001C3-6Y; Thu, 29 Nov 2012 15:32:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te65v-0001Bu-1d
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:32:07 +0000
Received: from [85.158.143.99:2998] by server-1.bemta-4.messagelabs.com id
	D9/BA-27934-6FF77B05; Thu, 29 Nov 2012 15:32:06 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354203125!22126616!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1695 invoked from network); 29 Nov 2012 15:32:05 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:32:05 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16073226"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:32:05 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 15:32:05 +0000
Message-ID: <1354203123.6269.30.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Thanos Makatos <thanos.makatos@citrix.com>
Date: Thu, 29 Nov 2012 15:32:03 +0000
In-Reply-To: <0f3b6811dad16cc9d93f.1354112414@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
	<0f3b6811dad16cc9d93f.1354112414@makatos-desktop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 4 of 5 RFC] blktap3: Introduce xenio daemon
 Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 14:20 +0000, Thanos Makatos wrote:
> diff -r 7126fda14249 -r 0f3b6811dad1 tools/blktap3/xenio/Makefile
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/blktap3/xenio/Makefile	Wed Nov 28 14:18:46 2012 +0000
> @@ -0,0 +1,47 @@
> +XEN_ROOT := $(CURDIR)/../../../
> +include $(XEN_ROOT)/tools/Rules.mk
> +
> +BLKTAP_ROOT := ..
> +
> +INST_DIR ?= /usr/bin
> +
> +IBIN = xenio
> +
> +override CFLAGS += \
> +	-I$(BLKTAP_ROOT)/include \
> +	-I$(BLKTAP_ROOT)/control \
> +	-I$(XEN_ROOT)/tools/libxc \
> +	-I$(XEN_ROOT)/tools/xenstore \

$(CFLAGS_libxenstore) and $(CFLAGS_libxenctrl) please.

> +	-D_GNU_SOURCE \
> +	$(CFLAGS_xeninclude) \
> +    -Wall \
> +    -Wextra \
> +    -Werror
> +
> +# FIXME cause trouble
> +override CFLAGS += \
> +    -Wno-old-style-declaration \
> +    -Wno-sign-compare \
> +    -Wno-type-limits
> +
> +override LDFLAGS = \
> +    -L$(XEN_ROOT)/tools/xenstore -lxenstore

$(LDFLAGS_libxenstore)

You have xenctrl CFLAGS but not LDFLAGS, is that right?

> +
> +XENIO-OBJS := log.o
> +
> +all: $(IBIN)
> +
> +$(BLKTAP_ROOT)/control/libblktapctl.a:
> +	make -C $(BLKTAP_ROOT)/control libblktapctl.a

Can you use SUBDIRS in the normal way for this?

> +$(IBIN): $(XENIO-OBJS) xenio.o $(BLKTAP_ROOT)/control/libblktapctl.a

Static linking on purpose?

If this is a purely internal library then fine, but I have a feeling
that libblktapctl is intended as an interface library which others (e.g.
libxl) will want to use?

> +	$(CC) -o $@ $^ $(LDFLAGS)
> +
> +install: all
> +	$(INSTALL_DIR) -p $(DESTDIR)$(INST_DIR)
> +	$(INSTALL_PROG) $(IBIN) $(DESTDIR)$(INST_DIR)
> +
> +clean:
> +	rm -f *.o *.o.d .*.o.d $(IBIN)
> +
> +.PHONY: clean install
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:32:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:32:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te65w-0001C3-6Y; Thu, 29 Nov 2012 15:32:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te65v-0001Bu-1d
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 15:32:07 +0000
Received: from [85.158.143.99:2998] by server-1.bemta-4.messagelabs.com id
	D9/BA-27934-6FF77B05; Thu, 29 Nov 2012 15:32:06 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354203125!22126616!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1695 invoked from network); 29 Nov 2012 15:32:05 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:32:05 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16073226"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:32:05 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 15:32:05 +0000
Message-ID: <1354203123.6269.30.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Thanos Makatos <thanos.makatos@citrix.com>
Date: Thu, 29 Nov 2012 15:32:03 +0000
In-Reply-To: <0f3b6811dad16cc9d93f.1354112414@makatos-desktop>
References: <patchbomb.1354112410@makatos-desktop>
	<0f3b6811dad16cc9d93f.1354112414@makatos-desktop>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 4 of 5 RFC] blktap3: Introduce xenio daemon
 Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, 2012-11-28 at 14:20 +0000, Thanos Makatos wrote:
> diff -r 7126fda14249 -r 0f3b6811dad1 tools/blktap3/xenio/Makefile
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/blktap3/xenio/Makefile	Wed Nov 28 14:18:46 2012 +0000
> @@ -0,0 +1,47 @@
> +XEN_ROOT := $(CURDIR)/../../../
> +include $(XEN_ROOT)/tools/Rules.mk
> +
> +BLKTAP_ROOT := ..
> +
> +INST_DIR ?= /usr/bin
> +
> +IBIN = xenio
> +
> +override CFLAGS += \
> +	-I$(BLKTAP_ROOT)/include \
> +	-I$(BLKTAP_ROOT)/control \
> +	-I$(XEN_ROOT)/tools/libxc \
> +	-I$(XEN_ROOT)/tools/xenstore \

$(CFLAGS_libxenstore) and $(CFLAGS_libxenctrl) please.

> +	-D_GNU_SOURCE \
> +	$(CFLAGS_xeninclude) \
> +    -Wall \
> +    -Wextra \
> +    -Werror
> +
> +# FIXME cause trouble
> +override CFLAGS += \
> +    -Wno-old-style-declaration \
> +    -Wno-sign-compare \
> +    -Wno-type-limits
> +
> +override LDFLAGS = \
> +    -L$(XEN_ROOT)/tools/xenstore -lxenstore

$(LDFLAGS_libxenstore)

You have xenctrl CFLAGS but not LDFLAGS, is that right?

> +
> +XENIO-OBJS := log.o
> +
> +all: $(IBIN)
> +
> +$(BLKTAP_ROOT)/control/libblktapctl.a:
> +	make -C $(BLKTAP_ROOT)/control libblktapctl.a

Can you use SUBDIRS in the normal way for this?

> +$(IBIN): $(XENIO-OBJS) xenio.o $(BLKTAP_ROOT)/control/libblktapctl.a

Static linking on purpose?

If this is a purely internal library then fine, but I have a feeling
that libblktapctl is intended as an interface library which others (e.g.
libxl) will want to use?

> +	$(CC) -o $@ $^ $(LDFLAGS)
> +
> +install: all
> +	$(INSTALL_DIR) -p $(DESTDIR)$(INST_DIR)
> +	$(INSTALL_PROG) $(IBIN) $(DESTDIR)$(INST_DIR)
> +
> +clean:
> +	rm -f *.o *.o.d .*.o.d $(IBIN)
> +
> +.PHONY: clean install
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:33:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te66g-0001Fm-KS; Thu, 29 Nov 2012 15:32:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <wei.liu2@citrix.com>) id 1Te66f-0001FW-NW
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 15:32:53 +0000
Received: from [85.158.143.35:50166] by server-2.bemta-4.messagelabs.com id
	31/90-28922-32087B05; Thu, 29 Nov 2012 15:32:51 +0000
X-Env-Sender: wei.liu2@citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1354203169!12761366!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU0MDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8514 invoked from network); 29 Nov 2012 15:32:50 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:32:50 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="46039025"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:32:48 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 10:32:48 -0500
Received: from [10.80.3.166] (helo=iceland.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<wei.liu2@citrix.com>)	id 1Te66a-00006d-3O;
	Thu, 29 Nov 2012 15:32:48 +0000
From: Wei Liu <wei.liu2@citrix.com>
To: xen-devel@lists.xen.org
Date: Thu, 29 Nov 2012 15:32:05 +0000
Message-ID: <1354203125-29003-1-git-send-email-wei.liu2@citrix.com>
X-Mailer: git-send-email 1.7.10.4
MIME-Version: 1.0
Cc: Wei Liu <wei.liu2@citrix.com>
Subject: [Xen-devel] [PATCH] Add gtags and tags rune in gitignore.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 .gitignore |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/.gitignore b/.gitignore
index f6edc43..d849a4b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,6 +14,11 @@
 *.spot
 *.spit
 TAGS
+GTAGS
+GRTAGS
+GPATH
+GSYMS
+tags
 cscope.files
 cscope.in.out
 cscope.out
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:33:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te66g-0001Fm-KS; Thu, 29 Nov 2012 15:32:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <wei.liu2@citrix.com>) id 1Te66f-0001FW-NW
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 15:32:53 +0000
Received: from [85.158.143.35:50166] by server-2.bemta-4.messagelabs.com id
	31/90-28922-32087B05; Thu, 29 Nov 2012 15:32:51 +0000
X-Env-Sender: wei.liu2@citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1354203169!12761366!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU0MDM=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8514 invoked from network); 29 Nov 2012 15:32:50 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 15:32:50 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="46039025"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 15:32:48 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 10:32:48 -0500
Received: from [10.80.3.166] (helo=iceland.uk.xensource.com)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<wei.liu2@citrix.com>)	id 1Te66a-00006d-3O;
	Thu, 29 Nov 2012 15:32:48 +0000
From: Wei Liu <wei.liu2@citrix.com>
To: xen-devel@lists.xen.org
Date: Thu, 29 Nov 2012 15:32:05 +0000
Message-ID: <1354203125-29003-1-git-send-email-wei.liu2@citrix.com>
X-Mailer: git-send-email 1.7.10.4
MIME-Version: 1.0
Cc: Wei Liu <wei.liu2@citrix.com>
Subject: [Xen-devel] [PATCH] Add gtags and tags rune in gitignore.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 .gitignore |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/.gitignore b/.gitignore
index f6edc43..d849a4b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,6 +14,11 @@
 *.spot
 *.spit
 TAGS
+GTAGS
+GRTAGS
+GPATH
+GSYMS
+tags
 cscope.files
 cscope.in.out
 cscope.out
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:41:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:41:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te6EZ-0001cQ-LW; Thu, 29 Nov 2012 15:41:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te6EY-0001cL-On
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 15:41:02 +0000
Received: from [193.109.254.147:59763] by server-8.bemta-14.messagelabs.com id
	AF/BC-05026-D0287B05; Thu, 29 Nov 2012 15:41:01 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1354203645!1941629!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3626 invoked from network); 29 Nov 2012 15:40:47 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 15:40:47 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te6ED-000Lsw-3d; Thu, 29 Nov 2012 15:40:41 +0000
Date: Thu, 29 Nov 2012 15:40:41 +0000
From: Tim Deegan <tim@xen.org>
To: Kouya Shimura <kouya@jp.fujitsu.com>
Message-ID: <20121129154041.GD80627@ocelot.phlegethon.org>
References: <50B7087D.20407@jp.fujitsu.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B7087D.20407@jp.fujitsu.com>
User-Agent: Mutt/1.4.2.1i
Cc: Robert Phillips <robert.phillips@citrix.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] x86/hap: fix race condition between
	ENABLE_LOGDIRTY and track_dirty_vram hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:02 +0900 on 29 Nov (1354204941), Kouya Shimura wrote:
> I'm not sure why paging_lock() is used partially in hap_XXX_vram_tracking
> functions. Thus, this patch introduces a new lock.
> It would be better to use paging_lock() instead of the new lock
> since shadow paging mode (not HAP mode) uses paging_lock to avoid
> this race condition.

I think you're right - it would be better to use the paging_lock. 

Cc'ing Robert Phillips, who's got a big patch outstanding that touches
the locking in this code.  I think the right thing to do is make sure
his patch fixes the issue and the backport just the locking parts of it
to older trees.

Robert, in your patch you do wrap this all in the paging_lock, but then
unlock to call various enable and disable routines.  Is there a version
of this reace condition there, where some other CPU might call
LOG_DIRTY_ENABLE while you've temporarily dropped the lock?

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:41:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:41:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te6EZ-0001cQ-LW; Thu, 29 Nov 2012 15:41:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te6EY-0001cL-On
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 15:41:02 +0000
Received: from [193.109.254.147:59763] by server-8.bemta-14.messagelabs.com id
	AF/BC-05026-D0287B05; Thu, 29 Nov 2012 15:41:01 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1354203645!1941629!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3626 invoked from network); 29 Nov 2012 15:40:47 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 15:40:47 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te6ED-000Lsw-3d; Thu, 29 Nov 2012 15:40:41 +0000
Date: Thu, 29 Nov 2012 15:40:41 +0000
From: Tim Deegan <tim@xen.org>
To: Kouya Shimura <kouya@jp.fujitsu.com>
Message-ID: <20121129154041.GD80627@ocelot.phlegethon.org>
References: <50B7087D.20407@jp.fujitsu.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B7087D.20407@jp.fujitsu.com>
User-Agent: Mutt/1.4.2.1i
Cc: Robert Phillips <robert.phillips@citrix.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] x86/hap: fix race condition between
	ENABLE_LOGDIRTY and track_dirty_vram hypercall
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:02 +0900 on 29 Nov (1354204941), Kouya Shimura wrote:
> I'm not sure why paging_lock() is used partially in hap_XXX_vram_tracking
> functions. Thus, this patch introduces a new lock.
> It would be better to use paging_lock() instead of the new lock
> since shadow paging mode (not HAP mode) uses paging_lock to avoid
> this race condition.

I think you're right - it would be better to use the paging_lock. 

Cc'ing Robert Phillips, who's got a big patch outstanding that touches
the locking in this code.  I think the right thing to do is make sure
his patch fixes the issue and the backport just the locking parts of it
to older trees.

Robert, in your patch you do wrap this all in the paging_lock, but then
unlock to call various enable and disable routines.  Is there a version
of this reace condition there, where some other CPU might call
LOG_DIRTY_ENABLE while you've temporarily dropped the lock?

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:58:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:58:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te6VY-0001ur-FJ; Thu, 29 Nov 2012 15:58:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te6VW-0001um-JH
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 15:58:34 +0000
Received: from [85.158.138.51:13062] by server-16.bemta-3.messagelabs.com id
	6E/DB-07461-92687B05; Thu, 29 Nov 2012 15:58:33 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1354204712!27996890!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29559 invoked from network); 29 Nov 2012 15:58:33 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-10.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 15:58:33 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te6VT-000LvY-LP; Thu, 29 Nov 2012 15:58:31 +0000
Date: Thu, 29 Nov 2012 15:58:31 +0000
From: Tim Deegan <tim@xen.org>
To: Razvan Cojocaru <rzvncj@gmail.com>
Message-ID: <20121129155831.GE80627@ocelot.phlegethon.org>
References: <50B77375.9070904@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B77375.9070904@gmail.com>
User-Agent: Mutt/1.4.2.1i
Cc: Joe Epstein <jepstein98@gmail.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

At 16:38 +0200 on 29 Nov (1354207125), Razvan Cojocaru wrote:
> I'm interested in using the mem_event API (or it's LibVMI wrapper), but 
> I'm interested in capturing write events anywhere in a domU guest's 
> memory, _and_ not just once for each page write, but every time a page 
> is being written to.
> 
> To this end, I've looked at the xen-access.c example, where at first all 
> the pages are being monitored:
> 
> xc_hvm_set_mem_access(xch, domain_id, HVMMEM_access_rx, ~0ull, 0);
> xc_hvm_set_mem_access(xch, domain_id, HVMMEM_access_rx, 0, 
> xenaccess->domain_info->max_pages);
> 
> Then, after an event is received:
> 
> xc_hvm_set_mem_access(xch, domain_id, HVMMEM_access_rwx, req.gfn, 1);
> 
> thus allowing 'rwx' access to 1 page starting at req.gfn.
> 
> This strategy indeed allows me to inspect writes to any page of the 
> guest OS, however I can only do this once per page. Once the page is 
> allowed HVMMEM_access_rwx access, any subsequent writes to it become 
> unavailable to my dom0 userspace tool (I'm "unregistering" for that 
> page-specific event).

Yes, indeed.

> The author of LibVMI's events code has suggested that I might enable 
> writes to that page, single step past the write instruction, and then 
> disable writes again.

That might work for single-vcpu guests.  On multi-vcpu, you'd have to
pause the whole VM, unprotect the page, single-step the one vcpu that
trapped, re-protect the page, and unpause the VM.  That might be
unacceptably slow.

> 1. I haven't been able to find an example of how single-stepping via the 
> mem_event API might work. Can you point me to some code that does this 
> (or a paper, etc.)?

I think you have to do the single-stepping via the existing debugger
API, and the memory event API stuff is just to notify you that it's
happened. 

Cc'ing the author.  Joe, can you help out here?

> 2. Is there any other way to achieve what I'm after?

You could try:
 - pause the domain
 - copy out the contents of the page
 - use XENMEM_decrease_reservation to remove the page from the guest
 - unpause the domain

Then all accesses to that page will get emulated by Xen and forwarded to
qemu, just like happens for emulated MMIO devices.  In qemu, you can
emulate the read or write access, and do anything else you like at the
same time.

That won't work for memory that's accessed in non-trivial ways
(e.g. used for pagetables or descriptor tables) or using instructions
that are unsupported/buggy in Xen's instruction emulator.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 15:58:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 15:58:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te6VY-0001ur-FJ; Thu, 29 Nov 2012 15:58:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te6VW-0001um-JH
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 15:58:34 +0000
Received: from [85.158.138.51:13062] by server-16.bemta-3.messagelabs.com id
	6E/DB-07461-92687B05; Thu, 29 Nov 2012 15:58:33 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1354204712!27996890!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29559 invoked from network); 29 Nov 2012 15:58:33 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-10.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 15:58:33 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te6VT-000LvY-LP; Thu, 29 Nov 2012 15:58:31 +0000
Date: Thu, 29 Nov 2012 15:58:31 +0000
From: Tim Deegan <tim@xen.org>
To: Razvan Cojocaru <rzvncj@gmail.com>
Message-ID: <20121129155831.GE80627@ocelot.phlegethon.org>
References: <50B77375.9070904@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B77375.9070904@gmail.com>
User-Agent: Mutt/1.4.2.1i
Cc: Joe Epstein <jepstein98@gmail.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hi,

At 16:38 +0200 on 29 Nov (1354207125), Razvan Cojocaru wrote:
> I'm interested in using the mem_event API (or it's LibVMI wrapper), but 
> I'm interested in capturing write events anywhere in a domU guest's 
> memory, _and_ not just once for each page write, but every time a page 
> is being written to.
> 
> To this end, I've looked at the xen-access.c example, where at first all 
> the pages are being monitored:
> 
> xc_hvm_set_mem_access(xch, domain_id, HVMMEM_access_rx, ~0ull, 0);
> xc_hvm_set_mem_access(xch, domain_id, HVMMEM_access_rx, 0, 
> xenaccess->domain_info->max_pages);
> 
> Then, after an event is received:
> 
> xc_hvm_set_mem_access(xch, domain_id, HVMMEM_access_rwx, req.gfn, 1);
> 
> thus allowing 'rwx' access to 1 page starting at req.gfn.
> 
> This strategy indeed allows me to inspect writes to any page of the 
> guest OS, however I can only do this once per page. Once the page is 
> allowed HVMMEM_access_rwx access, any subsequent writes to it become 
> unavailable to my dom0 userspace tool (I'm "unregistering" for that 
> page-specific event).

Yes, indeed.

> The author of LibVMI's events code has suggested that I might enable 
> writes to that page, single step past the write instruction, and then 
> disable writes again.

That might work for single-vcpu guests.  On multi-vcpu, you'd have to
pause the whole VM, unprotect the page, single-step the one vcpu that
trapped, re-protect the page, and unpause the VM.  That might be
unacceptably slow.

> 1. I haven't been able to find an example of how single-stepping via the 
> mem_event API might work. Can you point me to some code that does this 
> (or a paper, etc.)?

I think you have to do the single-stepping via the existing debugger
API, and the memory event API stuff is just to notify you that it's
happened. 

Cc'ing the author.  Joe, can you help out here?

> 2. Is there any other way to achieve what I'm after?

You could try:
 - pause the domain
 - copy out the contents of the page
 - use XENMEM_decrease_reservation to remove the page from the guest
 - unpause the domain

Then all accesses to that page will get emulated by Xen and forwarded to
qemu, just like happens for emulated MMIO devices.  In qemu, you can
emulate the read or write access, and do anything else you like at the
same time.

That won't work for memory that's accessed in non-trivial ways
(e.g. used for pagetables or descriptor tables) or using instructions
that are unsupported/buggy in Xen's instruction emulator.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 16:00:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 16:00:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te6X8-0002If-3j; Thu, 29 Nov 2012 16:00:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Te6X7-0002IX-82
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 16:00:13 +0000
Received: from [85.158.143.35:47611] by server-1.bemta-4.messagelabs.com id
	76/00-27934-C8687B05; Thu, 29 Nov 2012 16:00:12 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1354204809!13394873!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5074 invoked from network); 29 Nov 2012 16:00:10 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 16:00:10 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16074073"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 16:00:09 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 29 Nov 2012 16:00:09 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Te6X2-0006d9-7S; Thu, 29 Nov 2012 16:00:08 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Te6X2-000830-1g;
	Thu, 29 Nov 2012 16:00:08 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20663.34439.774586.111797@mariner.uk.xensource.com>
Date: Thu, 29 Nov 2012 16:00:07 +0000
To: Dan Magenheimer <dan.magenheimer@oracle.com>
In-Reply-To: <4e524dad-b67a-4115-b0fd-72f9b372abf1@default>
References: <38a09df7-3d82-403f-9153-9a151b220a41@default>
	<50B48C8A02000078000AB851@nat28.tlf.novell.com>
	<1354012308.5830.175.camel@zakaz.uk.xensource.com>
	<4e524dad-b67a-4115-b0fd-72f9b372abf1@default>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Dan Magenheimer writes ("RE: Please ack XENMEM_claim_pages hypercall?"):
> From a single-system-xl-toolstack-centric perspective ("paradigm"),
> I can see your point.

I don't think this is the case.  What you are doing is putting this
node-specific claim functionality in the hypervisor.  I still think it
should be done outside the hypervisor.  This does not mean that there
has to be a single omniscient piece of software for an entire
cluster.

It just means that there has to be a single omniscient piece of
software _for a particular host_.  In your proposal that piece of
software is the hypervisor - specifically, the part of the hypervisor
that does the bookkeeping of these claims.  However I am still
unconvinced that this can't be implemented outside the hypervisor.


In general it is a key design principle of a system like Xen that the
hypervisor should provide only those facilities which are strictly
necessary.  Any functionality which can be reasonably provided outside
the hypervisor should be excluded from it.  It is this principle which
you are running up against.


It may be (and it seems likely from what you've said in private email)
that some of your existing guests make some assumptions about the
semantics of the Xen ballooning memory interface, which might be
violated by such a design.  Specifically it appears that your design
has guests deliberately balloon down further than requested by the
toolstack, in a kind of attempt to negotiate with other users of
memory on the system by actually releasing and claiming Xen memory.

But I don't think it's reasonable to demand that the shared codebase
reflect such undocumented prior assumptions.  Particularly when this
design seems poor.  I find it poor because (a) using actual memory
allocation and release provides only a very impoverished signalling
mechanism (b) it imposes on every part of the system the possibility
of unexpected memory allocation failure.  (Your claim hypercall is an
attempt to mitigate (b) for some but not all cases.)

It seems to me that the correct approach is to design and implement a
new interface which allows a guest (whether that be its kernel or an
agent) to conduct a richer negotiation with out-of-hypervisor
toolstack software.  But that toolstack software (which might take any
particular shape - certainly we don't want to make any assumptions
about its policies and nature) needs to be sufficiently aware of the
claims and arbitrate between them, in a way that arranges that guests
which obey the rules never see an "out of memory" from the hypervisor.

Of course if it really is desired to have each guest make its own
decisions and simply for them to somehow agree to divvy up the
available resources, then even so a new hypervisor mechanism is not
needed.  All that is needed is a way for those guests to synchronise
their accesses and updates to shared records of the available and
in-use memory.


> AFAIK, Citrix's Dynamic Memory Controller (DMC) in XenServer is
> the only shipping example (in the Xen universe) of that,

I have never worked on the XenServer codebase and I have no clear idea
what this "Dynamic Memory Controller" is.  No-one here has explained
it to me and I have no particular desire to know about it.  Its
design, and its requirements or lack of them, have not influenced my
opinion on your proposals.

As an example to demonstrate that the reaction you are seeing is
nothing to do with whether the originators of the proposal are inside
our outside Citrix, please refer to our cool reaction to the v4v
proposals which also involved new hypervisor functionality.  There
too, we require the case to be made: we need to be able to see that an
out-of-hypervisor approach is not sufficient.


>    Xen decisions made with this paradigm
> in mind heavily favor a single-system model,

Nothing in my end of this conversation is predicated on any particular
deployment paradigm.  It is clear that in both your proposal and my
counter-proposal[1] there is a single place in each host where memory
allocation decisions are made and in particular where the memory needs
of competing guests etc. are arbitrated.

In your proposal this place is in the hypervisor and the negotiation
between the competing resource users is "grab the memory if you want
to".  Naturally an in-hypervisor arbitration facility has to be very
simple and a sophisticated policy is difficult to apply.

In my counter-proposal this negotiation occurs between the guest and
an out-of-hypervisor per-host arbitrator of some kind.

I think you are going to say that in your system the guests decide for
themselves how much memory to claim based on their views of how much
is free, and whether their allocations fail.  However, there is no
particular reason why the information about how much memory is free,
and how much has been committed for each purpose, could not be
collected somewhere outside the hypervisor.

[1] I don't have a detailed counter-proposal design of course, but
that's mostly because the information and reasoning you have provided
about your objectives and constraints is rather vague.


I agree with George that you should consider allowing someone else to
have a go at explaining things to us.  If this new hypercall is indeed
needed then all that is required is a clear and logical explanation of
why this is so.  I'm sorry to say that your efforts in this direction
so far have not been sufficient, and I feel that our attempts to
elicit explanations from you have not been as successful as needed.

I would love to help Oracle out by solving this problem which is
evidently causing a lot of trouble.  But it's difficult, and in
particular we do seem to be having serious trouble communicating with
you.


Sorry,
Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 16:00:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 16:00:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te6X8-0002If-3j; Thu, 29 Nov 2012 16:00:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Te6X7-0002IX-82
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 16:00:13 +0000
Received: from [85.158.143.35:47611] by server-1.bemta-4.messagelabs.com id
	76/00-27934-C8687B05; Thu, 29 Nov 2012 16:00:12 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1354204809!13394873!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5074 invoked from network); 29 Nov 2012 16:00:10 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 16:00:10 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16074073"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 16:00:09 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 29 Nov 2012 16:00:09 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Te6X2-0006d9-7S; Thu, 29 Nov 2012 16:00:08 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Te6X2-000830-1g;
	Thu, 29 Nov 2012 16:00:08 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20663.34439.774586.111797@mariner.uk.xensource.com>
Date: Thu, 29 Nov 2012 16:00:07 +0000
To: Dan Magenheimer <dan.magenheimer@oracle.com>
In-Reply-To: <4e524dad-b67a-4115-b0fd-72f9b372abf1@default>
References: <38a09df7-3d82-403f-9153-9a151b220a41@default>
	<50B48C8A02000078000AB851@nat28.tlf.novell.com>
	<1354012308.5830.175.camel@zakaz.uk.xensource.com>
	<4e524dad-b67a-4115-b0fd-72f9b372abf1@default>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: [Xen-devel] Please ack XENMEM_claim_pages hypercall?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Dan Magenheimer writes ("RE: Please ack XENMEM_claim_pages hypercall?"):
> From a single-system-xl-toolstack-centric perspective ("paradigm"),
> I can see your point.

I don't think this is the case.  What you are doing is putting this
node-specific claim functionality in the hypervisor.  I still think it
should be done outside the hypervisor.  This does not mean that there
has to be a single omniscient piece of software for an entire
cluster.

It just means that there has to be a single omniscient piece of
software _for a particular host_.  In your proposal that piece of
software is the hypervisor - specifically, the part of the hypervisor
that does the bookkeeping of these claims.  However I am still
unconvinced that this can't be implemented outside the hypervisor.


In general it is a key design principle of a system like Xen that the
hypervisor should provide only those facilities which are strictly
necessary.  Any functionality which can be reasonably provided outside
the hypervisor should be excluded from it.  It is this principle which
you are running up against.


It may be (and it seems likely from what you've said in private email)
that some of your existing guests make some assumptions about the
semantics of the Xen ballooning memory interface, which might be
violated by such a design.  Specifically it appears that your design
has guests deliberately balloon down further than requested by the
toolstack, in a kind of attempt to negotiate with other users of
memory on the system by actually releasing and claiming Xen memory.

But I don't think it's reasonable to demand that the shared codebase
reflect such undocumented prior assumptions.  Particularly when this
design seems poor.  I find it poor because (a) using actual memory
allocation and release provides only a very impoverished signalling
mechanism (b) it imposes on every part of the system the possibility
of unexpected memory allocation failure.  (Your claim hypercall is an
attempt to mitigate (b) for some but not all cases.)

It seems to me that the correct approach is to design and implement a
new interface which allows a guest (whether that be its kernel or an
agent) to conduct a richer negotiation with out-of-hypervisor
toolstack software.  But that toolstack software (which might take any
particular shape - certainly we don't want to make any assumptions
about its policies and nature) needs to be sufficiently aware of the
claims and arbitrate between them, in a way that arranges that guests
which obey the rules never see an "out of memory" from the hypervisor.

Of course if it really is desired to have each guest make its own
decisions and simply for them to somehow agree to divvy up the
available resources, then even so a new hypervisor mechanism is not
needed.  All that is needed is a way for those guests to synchronise
their accesses and updates to shared records of the available and
in-use memory.


> AFAIK, Citrix's Dynamic Memory Controller (DMC) in XenServer is
> the only shipping example (in the Xen universe) of that,

I have never worked on the XenServer codebase and I have no clear idea
what this "Dynamic Memory Controller" is.  No-one here has explained
it to me and I have no particular desire to know about it.  Its
design, and its requirements or lack of them, have not influenced my
opinion on your proposals.

As an example to demonstrate that the reaction you are seeing is
nothing to do with whether the originators of the proposal are inside
our outside Citrix, please refer to our cool reaction to the v4v
proposals which also involved new hypervisor functionality.  There
too, we require the case to be made: we need to be able to see that an
out-of-hypervisor approach is not sufficient.


>    Xen decisions made with this paradigm
> in mind heavily favor a single-system model,

Nothing in my end of this conversation is predicated on any particular
deployment paradigm.  It is clear that in both your proposal and my
counter-proposal[1] there is a single place in each host where memory
allocation decisions are made and in particular where the memory needs
of competing guests etc. are arbitrated.

In your proposal this place is in the hypervisor and the negotiation
between the competing resource users is "grab the memory if you want
to".  Naturally an in-hypervisor arbitration facility has to be very
simple and a sophisticated policy is difficult to apply.

In my counter-proposal this negotiation occurs between the guest and
an out-of-hypervisor per-host arbitrator of some kind.

I think you are going to say that in your system the guests decide for
themselves how much memory to claim based on their views of how much
is free, and whether their allocations fail.  However, there is no
particular reason why the information about how much memory is free,
and how much has been committed for each purpose, could not be
collected somewhere outside the hypervisor.

[1] I don't have a detailed counter-proposal design of course, but
that's mostly because the information and reasoning you have provided
about your objectives and constraints is rather vague.


I agree with George that you should consider allowing someone else to
have a go at explaining things to us.  If this new hypercall is indeed
needed then all that is required is a clear and logical explanation of
why this is so.  I'm sorry to say that your efforts in this direction
so far have not been sufficient, and I feel that our attempts to
elicit explanations from you have not been as successful as needed.

I would love to help Oracle out by solving this problem which is
evidently causing a lot of trouble.  But it's difficult, and in
particular we do seem to be having serious trouble communicating with
you.


Sorry,
Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 16:03:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 16:03:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te6a9-0002dg-R4; Thu, 29 Nov 2012 16:03:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te6a8-0002db-4R
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 16:03:20 +0000
Received: from [85.158.138.51:51844] by server-3.bemta-3.messagelabs.com id
	EF/F1-31566-74787B05; Thu, 29 Nov 2012 16:03:19 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1354204992!24114072!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1460 invoked from network); 29 Nov 2012 16:03:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 16:03:12 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16074165"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 16:03:12 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 16:03:12 +0000
Message-ID: <1354204991.6269.36.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Thu, 29 Nov 2012 16:03:11 +0000
In-Reply-To: <50B76905.90503@jhuapl.edu>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353664797.13542.190.camel@zakaz.uk.xensource.com>
	<20663.18782.886504.606333@mariner.uk.xensource.com>
	<20663.18917.138256.303363@mariner.uk.xensource.com>
	<50B76905.90503@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs
 to stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 13:54 +0000, Matthew Fioravante wrote:
> As annoying as it may be, I think having a configure script or something 
> similar is the only right answer. More hidden makefile variables and 
> hacks makes everything more complicated. Before the existence of the 
> configure script Xen's build system was a huge pain to work with. Its 
> still not perfect.
> 
> So here are 2 proposals:
> 
> Add a configure.ac to stubdom. I can whip up a simple one where you can 
> enable/disable specific stub domains. Other options could be setting the 
> fetch urls for the libraries. People can add more options later. Now if 
> people disable vtpm, the check for cmake goes away.

I think I would like this best, with a simple configure.ac at the
top-level which has the absolute minimum boiler plate plus
"AC_CONFIG_SUBDIRS([tools stubdom])" (and eventually docs
too) to call down as appropriate and appropriate runes in autogen.sh to
regenerate everything in one go.

> Move /tools/configure.ac to /configure.ac. Use this configure script to 
> configure the entire build. /Makefile still exists and works with or 
> without configuring, to enable building of the hypervisor.

I think there was some sort of practical glitch which stopped us doing
this originally, but I can't remember what it was.

Or maybe it was just that it made it to easy to accidentally slip a
configure dependency into the hypervisor code.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 16:03:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 16:03:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te6a9-0002dg-R4; Thu, 29 Nov 2012 16:03:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te6a8-0002db-4R
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 16:03:20 +0000
Received: from [85.158.138.51:51844] by server-3.bemta-3.messagelabs.com id
	EF/F1-31566-74787B05; Thu, 29 Nov 2012 16:03:19 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1354204992!24114072!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1460 invoked from network); 29 Nov 2012 16:03:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 16:03:12 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16074165"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 16:03:12 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 16:03:12 +0000
Message-ID: <1354204991.6269.36.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Thu, 29 Nov 2012 16:03:11 +0000
In-Reply-To: <50B76905.90503@jhuapl.edu>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353664797.13542.190.camel@zakaz.uk.xensource.com>
	<20663.18782.886504.606333@mariner.uk.xensource.com>
	<20663.18917.138256.303363@mariner.uk.xensource.com>
	<50B76905.90503@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs
 to stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 13:54 +0000, Matthew Fioravante wrote:
> As annoying as it may be, I think having a configure script or something 
> similar is the only right answer. More hidden makefile variables and 
> hacks makes everything more complicated. Before the existence of the 
> configure script Xen's build system was a huge pain to work with. Its 
> still not perfect.
> 
> So here are 2 proposals:
> 
> Add a configure.ac to stubdom. I can whip up a simple one where you can 
> enable/disable specific stub domains. Other options could be setting the 
> fetch urls for the libraries. People can add more options later. Now if 
> people disable vtpm, the check for cmake goes away.

I think I would like this best, with a simple configure.ac at the
top-level which has the absolute minimum boiler plate plus
"AC_CONFIG_SUBDIRS([tools stubdom])" (and eventually docs
too) to call down as appropriate and appropriate runes in autogen.sh to
regenerate everything in one go.

> Move /tools/configure.ac to /configure.ac. Use this configure script to 
> configure the entire build. /Makefile still exists and works with or 
> without configuring, to enable building of the hypervisor.

I think there was some sort of practical glitch which stopped us doing
this originally, but I can't remember what it was.

Or maybe it was just that it made it to easy to accidentally slip a
configure dependency into the hypervisor code.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 16:08:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 16:08:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te6f6-0002qF-Iy; Thu, 29 Nov 2012 16:08:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Te6f4-0002q7-Ox
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 16:08:26 +0000
Received: from [85.158.143.99:32053] by server-1.bemta-4.messagelabs.com id
	FC/0C-27934-A7887B05; Thu, 29 Nov 2012 16:08:26 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1354205304!22096304!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3228 invoked from network); 29 Nov 2012 16:08:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 16:08:24 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16074315"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 16:08:24 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 29 Nov 2012 16:08:24 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Te6f1-0006fa-RT; Thu, 29 Nov 2012 16:08:23 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Te6f1-00084T-Np;
	Thu, 29 Nov 2012 16:08:23 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20663.34935.610745.896999@mariner.uk.xensource.com>
Date: Thu, 29 Nov 2012 16:08:23 +0000
To: Ian Campbell <ian.campbell@citrix.com>
In-Reply-To: <3174dc24e3efb0c5b964.1354011201@cosworth.uk.xensource.com>
References: <3174dc24e3efb0c5b964.1354011201@cosworth.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xl: xl.conf(5): correct advice re
 autoballooning vs. dom0_mem
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("[PATCH] xl: xl.conf(5): correct advice re autoballooning vs. dom0_mem"):
> xl: xl.conf(5): correct advice re autoballooning vs. dom0_mem.
> 
> The advice was backwards, you should really disable autoballoon if you
> use dom0_mem. Also add a reference to the command-line docs.

Thanks.  This seemed worth a backport so I've thrown it into 4.2.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 16:08:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 16:08:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te6f6-0002qF-Iy; Thu, 29 Nov 2012 16:08:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Te6f4-0002q7-Ox
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 16:08:26 +0000
Received: from [85.158.143.99:32053] by server-1.bemta-4.messagelabs.com id
	FC/0C-27934-A7887B05; Thu, 29 Nov 2012 16:08:26 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1354205304!22096304!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3228 invoked from network); 29 Nov 2012 16:08:24 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 16:08:24 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16074315"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 16:08:24 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 29 Nov 2012 16:08:24 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Te6f1-0006fa-RT; Thu, 29 Nov 2012 16:08:23 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Te6f1-00084T-Np;
	Thu, 29 Nov 2012 16:08:23 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20663.34935.610745.896999@mariner.uk.xensource.com>
Date: Thu, 29 Nov 2012 16:08:23 +0000
To: Ian Campbell <ian.campbell@citrix.com>
In-Reply-To: <3174dc24e3efb0c5b964.1354011201@cosworth.uk.xensource.com>
References: <3174dc24e3efb0c5b964.1354011201@cosworth.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] xl: xl.conf(5): correct advice re
 autoballooning vs. dom0_mem
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("[PATCH] xl: xl.conf(5): correct advice re autoballooning vs. dom0_mem"):
> xl: xl.conf(5): correct advice re autoballooning vs. dom0_mem.
> 
> The advice was backwards, you should really disable autoballoon if you
> use dom0_mem. Also add a reference to the command-line docs.

Thanks.  This seemed worth a backport so I've thrown it into 4.2.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 16:20:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 16:20:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te6qF-00035X-TD; Thu, 29 Nov 2012 16:19:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1Te6qF-00035S-0D
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 16:19:59 +0000
Received: from [85.158.139.83:52916] by server-14.bemta-5.messagelabs.com id
	54/D1-21768-E2B87B05; Thu, 29 Nov 2012 16:19:58 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1354205997!27681185!1
X-Originating-IP: [91.199.104.2]
X-SpamReason: No, hits=1.8 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RATWARE_GECKO_BUILD,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18098 invoked from network); 29 Nov 2012 16:19:57 -0000
Received: from mail.bitdefender.com (HELO mail.bitdefender.com) (91.199.104.2)
	by server-12.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 16:19:57 -0000
Received: (qmail 5572 invoked from network); 29 Nov 2012 18:19:56 +0200
Received: from rcojocaru.dsd.ro (HELO ?10.10.14.59?)
	(rcojocaru@bitdefender.com@10.10.14.59)
	by mail.bitdefender.com with AES256-SHA encrypted SMTP;
	29 Nov 2012 18:19:56 +0200
Message-ID: <50B78B4B.2050106@gmail.com>
Date: Thu, 29 Nov 2012 18:20:27 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: xen-devel@lists.xen.org
References: <50B77375.9070904@gmail.com>
	<20121129155831.GE80627@ocelot.phlegethon.org>
In-Reply-To: <20121129155831.GE80627@ocelot.phlegethon.org>
X-BitDefender-Spam: No (0)
X-BitDefender-SpamStamp: Build: [Engines: 2.13.3.14894, Dats: 229723,
	Stamp: 3], Multi: [Enabled], BW: [Enabled], RBL DNSBL: [Disabled],
	APM: [Disabled, Score: 500], SGN: [Enabled], URL: [Enabled], URI
	DNSBL: [Disabled], SQMD: [Enabled, Hits: none, MD5:
	342ee62dcf9c345743a49c30a247fd3a.fuzzy.fzrbl.org], RTDA: [Disabled,
	Hit: No], total: 0(775)
X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.0 on
	elfie.dsd.hq, sigver: 7.44185
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello, thank you for the quick reply!
> That might work for single-vcpu guests.  On multi-vcpu, you'd have to
> pause the whole VM, unprotect the page, single-step the one vcpu that
> trapped, re-protect the page, and unpause the VM.  That might be
> unacceptably slow.

Ah, the simple fact that the words "unacceptably slow" could be employed 
to describe the situation makes this approach very unlikely to fit my 
purposes.

I'm still interested in how the debugger API works, though. Maybe, just 
maybe, it'll just be acceptably slow. :)

> You could try:
>   - pause the domain
>   - copy out the contents of the page
>   - use XENMEM_decrease_reservation to remove the page from the guest
>   - unpause the domain
>
> Then all accesses to that page will get emulated by Xen and forwarded to
> qemu, just like happens for emulated MMIO devices.  In qemu, you can
> emulate the read or write access, and do anything else you like at the
> same time.
>
> That won't work for memory that's accessed in non-trivial ways
> (e.g. used for pagetables or descriptor tables) or using instructions
> that are unsupported/buggy in Xen's instruction emulator.

Well, I need it to be able to work on _all_ memory, however accessed. 
Also, with this approach I might have to copy out the contents of all of 
the domain's pages in the worst case scenario - isn't that something to 
avoid?

Thanks,
Razvan Cojocaru

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 16:20:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 16:20:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te6qF-00035X-TD; Thu, 29 Nov 2012 16:19:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1Te6qF-00035S-0D
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 16:19:59 +0000
Received: from [85.158.139.83:52916] by server-14.bemta-5.messagelabs.com id
	54/D1-21768-E2B87B05; Thu, 29 Nov 2012 16:19:58 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1354205997!27681185!1
X-Originating-IP: [91.199.104.2]
X-SpamReason: No, hits=1.8 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RATWARE_GECKO_BUILD,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18098 invoked from network); 29 Nov 2012 16:19:57 -0000
Received: from mail.bitdefender.com (HELO mail.bitdefender.com) (91.199.104.2)
	by server-12.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 16:19:57 -0000
Received: (qmail 5572 invoked from network); 29 Nov 2012 18:19:56 +0200
Received: from rcojocaru.dsd.ro (HELO ?10.10.14.59?)
	(rcojocaru@bitdefender.com@10.10.14.59)
	by mail.bitdefender.com with AES256-SHA encrypted SMTP;
	29 Nov 2012 18:19:56 +0200
Message-ID: <50B78B4B.2050106@gmail.com>
Date: Thu, 29 Nov 2012 18:20:27 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: xen-devel@lists.xen.org
References: <50B77375.9070904@gmail.com>
	<20121129155831.GE80627@ocelot.phlegethon.org>
In-Reply-To: <20121129155831.GE80627@ocelot.phlegethon.org>
X-BitDefender-Spam: No (0)
X-BitDefender-SpamStamp: Build: [Engines: 2.13.3.14894, Dats: 229723,
	Stamp: 3], Multi: [Enabled], BW: [Enabled], RBL DNSBL: [Disabled],
	APM: [Disabled, Score: 500], SGN: [Enabled], URL: [Enabled], URI
	DNSBL: [Disabled], SQMD: [Enabled, Hits: none, MD5:
	342ee62dcf9c345743a49c30a247fd3a.fuzzy.fzrbl.org], RTDA: [Disabled,
	Hit: No], total: 0(775)
X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.0 on
	elfie.dsd.hq, sigver: 7.44185
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello, thank you for the quick reply!
> That might work for single-vcpu guests.  On multi-vcpu, you'd have to
> pause the whole VM, unprotect the page, single-step the one vcpu that
> trapped, re-protect the page, and unpause the VM.  That might be
> unacceptably slow.

Ah, the simple fact that the words "unacceptably slow" could be employed 
to describe the situation makes this approach very unlikely to fit my 
purposes.

I'm still interested in how the debugger API works, though. Maybe, just 
maybe, it'll just be acceptably slow. :)

> You could try:
>   - pause the domain
>   - copy out the contents of the page
>   - use XENMEM_decrease_reservation to remove the page from the guest
>   - unpause the domain
>
> Then all accesses to that page will get emulated by Xen and forwarded to
> qemu, just like happens for emulated MMIO devices.  In qemu, you can
> emulate the read or write access, and do anything else you like at the
> same time.
>
> That won't work for memory that's accessed in non-trivial ways
> (e.g. used for pagetables or descriptor tables) or using instructions
> that are unsupported/buggy in Xen's instruction emulator.

Well, I need it to be able to work on _all_ memory, however accessed. 
Also, with this approach I might have to copy out the contents of all of 
the domain's pages in the worst case scenario - isn't that something to 
avoid?

Thanks,
Razvan Cojocaru

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 16:23:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 16:23:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te6to-0003H5-Mk; Thu, 29 Nov 2012 16:23:40 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1Te6tn-0003Go-7z; Thu, 29 Nov 2012 16:23:39 +0000
Received: from [85.158.138.51:29971] by server-5.bemta-3.messagelabs.com id
	90/46-26311-A0C87B05; Thu, 29 Nov 2012 16:23:38 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1354206217!31978909!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31541 invoked from network); 29 Nov 2012 16:23:37 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 16:23:37 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16074775"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 16:23:37 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Thu, 29 Nov 2012
	16:23:37 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Thu, 29 Nov 2012 16:23:37 +0000
Thread-Topic: [Xen-devel] [PATCH 02 of 15] libxl: Add
	LIBXL_SHUTDOWN_REASON_UNKNOWN
Thread-Index: Ac3HRADXKEszDP6cRruVJTUnVj0EZAHBvFsQ
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107AB@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<8195cb0ebac691ae94e9.1353432202@cosworth.uk.xensource.com>
In-Reply-To: <8195cb0ebac691ae94e9.1353432202@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 02 of 15] libxl:
	Add	LIBXL_SHUTDOWN_REASON_UNKNOWN
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> libxl: Add LIBXL_SHUTDOWN_REASON_UNKNOWN
> 
> libxl_dominfo.shutdown_reason is valid iff (shutdown||dying). This is a bit
> annoying when generating language bindings since it needs all sorts of
> special casing. Just introduce an explicit value instead.
> 
> Signed-off-by: Ian Campbell <ian.cambell@citrix.com>

This change is very useful from an ocaml-bindings point of view.

Acked-by: Rob Hoes <rob.hoes@citrix.com>
 
> diff -r 601dc257a740 -r 8195cb0ebac6 tools/libxl/libxl.c
> --- a/tools/libxl/libxl.c	Tue Nov 20 17:22:16 2012 +0000
> +++ b/tools/libxl/libxl.c	Tue Nov 20 17:22:21 2012 +0000
> @@ -526,7 +526,7 @@ static void xcinfo2xlinfo(const xc_domai
>      if (xlinfo->shutdown || xlinfo->dying)
>          xlinfo->shutdown_reason = (xcinfo-
> >flags>>XEN_DOMINF_shutdownshift) & XEN_DOMINF_shutdownmask;
>      else
> -        xlinfo->shutdown_reason  = ~0;
> +        xlinfo->shutdown_reason = LIBXL_SHUTDOWN_REASON_UNKNOWN;
> 
>      xlinfo->current_memkb = PAGE_TO_MEMKB(xcinfo->tot_pages);
>      xlinfo->shared_memkb = PAGE_TO_MEMKB(xcinfo->shr_pages); diff -r
> 601dc257a740 -r 8195cb0ebac6 tools/libxl/libxl_types.idl
> --- a/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:16 2012 +0000
> +++ b/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:21 2012 +0000
> @@ -118,14 +118,15 @@ libxl_scheduler = Enumeration("scheduler
>      (7, "arinc653"),
>      ])
> 
> -# Consistent with SHUTDOWN_* in sched.h
> +# Consistent with SHUTDOWN_* in sched.h (apart from UNKNOWN)
>  libxl_shutdown_reason = Enumeration("shutdown_reason", [
> +    (-1, "unknown"),
>      (0, "poweroff"),
>      (1, "reboot"),
>      (2, "suspend"),
>      (3, "crash"),
>      (4, "watchdog"),
> -    ])
> +    ], init_val = "LIBXL_SHUTDOWN_REASON_UNKNOWN")
> 
>  libxl_vga_interface_type = Enumeration("vga_interface_type", [
>      (1, "CIRRUS"),
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 16:23:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 16:23:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te6to-0003H5-Mk; Thu, 29 Nov 2012 16:23:40 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1Te6tn-0003Go-7z; Thu, 29 Nov 2012 16:23:39 +0000
Received: from [85.158.138.51:29971] by server-5.bemta-3.messagelabs.com id
	90/46-26311-A0C87B05; Thu, 29 Nov 2012 16:23:38 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1354206217!31978909!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31541 invoked from network); 29 Nov 2012 16:23:37 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 16:23:37 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16074775"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 16:23:37 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Thu, 29 Nov 2012
	16:23:37 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Thu, 29 Nov 2012 16:23:37 +0000
Thread-Topic: [Xen-devel] [PATCH 02 of 15] libxl: Add
	LIBXL_SHUTDOWN_REASON_UNKNOWN
Thread-Index: Ac3HRADXKEszDP6cRruVJTUnVj0EZAHBvFsQ
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107AB@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<8195cb0ebac691ae94e9.1353432202@cosworth.uk.xensource.com>
In-Reply-To: <8195cb0ebac691ae94e9.1353432202@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 02 of 15] libxl:
	Add	LIBXL_SHUTDOWN_REASON_UNKNOWN
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> libxl: Add LIBXL_SHUTDOWN_REASON_UNKNOWN
> 
> libxl_dominfo.shutdown_reason is valid iff (shutdown||dying). This is a bit
> annoying when generating language bindings since it needs all sorts of
> special casing. Just introduce an explicit value instead.
> 
> Signed-off-by: Ian Campbell <ian.cambell@citrix.com>

This change is very useful from an ocaml-bindings point of view.

Acked-by: Rob Hoes <rob.hoes@citrix.com>
 
> diff -r 601dc257a740 -r 8195cb0ebac6 tools/libxl/libxl.c
> --- a/tools/libxl/libxl.c	Tue Nov 20 17:22:16 2012 +0000
> +++ b/tools/libxl/libxl.c	Tue Nov 20 17:22:21 2012 +0000
> @@ -526,7 +526,7 @@ static void xcinfo2xlinfo(const xc_domai
>      if (xlinfo->shutdown || xlinfo->dying)
>          xlinfo->shutdown_reason = (xcinfo-
> >flags>>XEN_DOMINF_shutdownshift) & XEN_DOMINF_shutdownmask;
>      else
> -        xlinfo->shutdown_reason  = ~0;
> +        xlinfo->shutdown_reason = LIBXL_SHUTDOWN_REASON_UNKNOWN;
> 
>      xlinfo->current_memkb = PAGE_TO_MEMKB(xcinfo->tot_pages);
>      xlinfo->shared_memkb = PAGE_TO_MEMKB(xcinfo->shr_pages); diff -r
> 601dc257a740 -r 8195cb0ebac6 tools/libxl/libxl_types.idl
> --- a/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:16 2012 +0000
> +++ b/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:21 2012 +0000
> @@ -118,14 +118,15 @@ libxl_scheduler = Enumeration("scheduler
>      (7, "arinc653"),
>      ])
> 
> -# Consistent with SHUTDOWN_* in sched.h
> +# Consistent with SHUTDOWN_* in sched.h (apart from UNKNOWN)
>  libxl_shutdown_reason = Enumeration("shutdown_reason", [
> +    (-1, "unknown"),
>      (0, "poweroff"),
>      (1, "reboot"),
>      (2, "suspend"),
>      (3, "crash"),
>      (4, "watchdog"),
> -    ])
> +    ], init_val = "LIBXL_SHUTDOWN_REASON_UNKNOWN")
> 
>  libxl_vga_interface_type = Enumeration("vga_interface_type", [
>      (1, "CIRRUS"),
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 16:29:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 16:29:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te6zf-0003WD-OA; Thu, 29 Nov 2012 16:29:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1Te6zd-0003Vz-CA; Thu, 29 Nov 2012 16:29:41 +0000
Received: from [193.109.254.147:52556] by server-3.bemta-14.messagelabs.com id
	2A/7A-01317-47D87B05; Thu, 29 Nov 2012 16:29:40 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1354206473!6385397!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17268 invoked from network); 29 Nov 2012 16:27:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 16:27:55 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16074907"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 16:27:52 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Thu, 29 Nov 2012
	16:27:52 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Thu, 29 Nov 2012 16:27:52 +0000
Thread-Topic: [Xen-API] [PATCH 04 of 15] libxl: ocaml: fix code intended to
	output comments before definitions
Thread-Index: Ac3HRBraT2XqiSKvRxqlfAZP7CHPWwHClM7g
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107AC@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<be294b1cdd00dac5d3a1.1353432204@cosworth.uk.xensource.com>
In-Reply-To: <be294b1cdd00dac5d3a1.1353432204@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [Xen-API] [PATCH 04 of 15] libxl: ocaml: fix code
 intended to output comments before definitions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> be294b1cdd00dac5d3a1b42faf06656902b99e5b
> # Parent  739989dcd108c6dac61aa9c87be2a75feafb9871
> libxl: ocaml: fix code intended to output comments before definitions
> 
> I'm not sure how useful these comments actually are but erred on the side
> of fixing rather than removing.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Acked-by: Rob Hoes <rob.hoes@citrix.com>

> diff -r 739989dcd108 -r be294b1cdd00 tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -79,12 +79,14 @@ def gen_ocaml_ml(ty, interface, indent="
>          s = ("""(* %s interface *)\n""" % ty.typename)
>      else:
>          s = ("""(* %s implementation *)\n""" % ty.typename)
> +
>      if isinstance(ty, idl.Enumeration):
> -        s = "type %s = \n" % ty.rawname
> +        s += "type %s = \n" % ty.rawname
>          for v in ty.values:
>              s += "\t | %s\n" % v.rawname
>      elif isinstance(ty, idl.Aggregate):
> -        s = ""
> +        s += ""
> +
>          if ty.typename is None:
>              raise NotImplementedError("%s has no typename" % type(ty))
>          else:
> 
> _______________________________________________
> Xen-api mailing list
> Xen-api@lists.xen.org
> http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 16:29:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 16:29:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te6zf-0003WD-OA; Thu, 29 Nov 2012 16:29:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1Te6zd-0003Vz-CA; Thu, 29 Nov 2012 16:29:41 +0000
Received: from [193.109.254.147:52556] by server-3.bemta-14.messagelabs.com id
	2A/7A-01317-47D87B05; Thu, 29 Nov 2012 16:29:40 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1354206473!6385397!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17268 invoked from network); 29 Nov 2012 16:27:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 16:27:55 -0000
X-IronPort-AV: E=Sophos;i="4.84,184,1355097600"; d="scan'208";a="16074907"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 16:27:52 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Thu, 29 Nov 2012
	16:27:52 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Thu, 29 Nov 2012 16:27:52 +0000
Thread-Topic: [Xen-API] [PATCH 04 of 15] libxl: ocaml: fix code intended to
	output comments before definitions
Thread-Index: Ac3HRBraT2XqiSKvRxqlfAZP7CHPWwHClM7g
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107AC@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<be294b1cdd00dac5d3a1.1353432204@cosworth.uk.xensource.com>
In-Reply-To: <be294b1cdd00dac5d3a1.1353432204@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [Xen-API] [PATCH 04 of 15] libxl: ocaml: fix code
 intended to output comments before definitions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> be294b1cdd00dac5d3a1b42faf06656902b99e5b
> # Parent  739989dcd108c6dac61aa9c87be2a75feafb9871
> libxl: ocaml: fix code intended to output comments before definitions
> 
> I'm not sure how useful these comments actually are but erred on the side
> of fixing rather than removing.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Acked-by: Rob Hoes <rob.hoes@citrix.com>

> diff -r 739989dcd108 -r be294b1cdd00 tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -79,12 +79,14 @@ def gen_ocaml_ml(ty, interface, indent="
>          s = ("""(* %s interface *)\n""" % ty.typename)
>      else:
>          s = ("""(* %s implementation *)\n""" % ty.typename)
> +
>      if isinstance(ty, idl.Enumeration):
> -        s = "type %s = \n" % ty.rawname
> +        s += "type %s = \n" % ty.rawname
>          for v in ty.values:
>              s += "\t | %s\n" % v.rawname
>      elif isinstance(ty, idl.Aggregate):
> -        s = ""
> +        s += ""
> +
>          if ty.typename is None:
>              raise NotImplementedError("%s has no typename" % type(ty))
>          else:
> 
> _______________________________________________
> Xen-api mailing list
> Xen-api@lists.xen.org
> http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 16:52:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 16:52:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7LR-0003zk-WD; Thu, 29 Nov 2012 16:52:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1Te7LQ-0003zX-3Q; Thu, 29 Nov 2012 16:52:12 +0000
Received: from [85.158.143.99:46993] by server-1.bemta-4.messagelabs.com id
	73/92-27934-BB297B05; Thu, 29 Nov 2012 16:52:11 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1354207930!21001366!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20971 invoked from network); 29 Nov 2012 16:52:10 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 16:52:10 -0000
X-IronPort-AV: E=Sophos;i="4.84,185,1355097600"; d="scan'208";a="16075536"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 16:52:10 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Thu, 29 Nov 2012
	16:52:10 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Thu, 29 Nov 2012 16:52:10 +0000
Thread-Topic: [Xen-devel] [PATCH 05 of 15] libxl: ocaml: support for Arrays
	in bindings generator
Thread-Index: Ac3HRAAwbclUlMR9QNmQKZkgqiQsiAHDcMtQ
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107AD@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<b7e2cd4a03f278c9abfe.1353432205@cosworth.uk.xensource.com>
In-Reply-To: <b7e2cd4a03f278c9abfe.1353432205@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 05 of 15] libxl: ocaml: support for Arrays
 in bindings generator
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> b7e2cd4a03f278c9abfec0812c88234f7e493646
> # Parent  be294b1cdd00dac5d3a1b42faf06656902b99e5b
> libxl: ocaml: support for Arrays in bindings generator.
> 
> No change in generated code because no arrays are currently generated.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citria.xcom>

I tried this on an example, and it looks like it is doing the right thing.

Acked-by: Rob Hoes <rob.hoes@citrix.com>

> diff -r be294b1cdd00 -r b7e2cd4a03f2 tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -143,7 +143,13 @@ def c_val(ty, c, o, indent="", parent =
>              raise NotImplementedError("No c_val fn for Builtin %s (%s)" %
> (ty.typename, type(ty)))
>          s += "%s;" % (fn % { "o": o, "c": c })
>      elif isinstance (ty,idl.Array):
> -        raise("Cannot handle Array type\n")
> +        s += "{\n"
> +        s += "\tint i;\n"
> +        s += "\t%s = Wosize_val(%s);\n" % (parent + ty.lenvar.name, o)
> +        s += "\tfor(i=0; i<%s; i++) {\n" % (parent + ty.lenvar.name)
> +        s += c_val(ty.elem_type, c+"[i]", "Field(%s, i)" % o, indent="\t\t",
> parent=parent) + "\n"
> +        s += "\t}\n"
> +        s += "}\n"
>      elif isinstance(ty,idl.Enumeration) and (parent is None):
>          n = 0
>          s += "switch(Int_val(%s)) {\n" % o
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 16:52:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 16:52:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7LR-0003zk-WD; Thu, 29 Nov 2012 16:52:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1Te7LQ-0003zX-3Q; Thu, 29 Nov 2012 16:52:12 +0000
Received: from [85.158.143.99:46993] by server-1.bemta-4.messagelabs.com id
	73/92-27934-BB297B05; Thu, 29 Nov 2012 16:52:11 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1354207930!21001366!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20971 invoked from network); 29 Nov 2012 16:52:10 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 16:52:10 -0000
X-IronPort-AV: E=Sophos;i="4.84,185,1355097600"; d="scan'208";a="16075536"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 16:52:10 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Thu, 29 Nov 2012
	16:52:10 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Thu, 29 Nov 2012 16:52:10 +0000
Thread-Topic: [Xen-devel] [PATCH 05 of 15] libxl: ocaml: support for Arrays
	in bindings generator
Thread-Index: Ac3HRAAwbclUlMR9QNmQKZkgqiQsiAHDcMtQ
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107AD@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<b7e2cd4a03f278c9abfe.1353432205@cosworth.uk.xensource.com>
In-Reply-To: <b7e2cd4a03f278c9abfe.1353432205@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 05 of 15] libxl: ocaml: support for Arrays
 in bindings generator
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> b7e2cd4a03f278c9abfec0812c88234f7e493646
> # Parent  be294b1cdd00dac5d3a1b42faf06656902b99e5b
> libxl: ocaml: support for Arrays in bindings generator.
> 
> No change in generated code because no arrays are currently generated.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citria.xcom>

I tried this on an example, and it looks like it is doing the right thing.

Acked-by: Rob Hoes <rob.hoes@citrix.com>

> diff -r be294b1cdd00 -r b7e2cd4a03f2 tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -143,7 +143,13 @@ def c_val(ty, c, o, indent="", parent =
>              raise NotImplementedError("No c_val fn for Builtin %s (%s)" %
> (ty.typename, type(ty)))
>          s += "%s;" % (fn % { "o": o, "c": c })
>      elif isinstance (ty,idl.Array):
> -        raise("Cannot handle Array type\n")
> +        s += "{\n"
> +        s += "\tint i;\n"
> +        s += "\t%s = Wosize_val(%s);\n" % (parent + ty.lenvar.name, o)
> +        s += "\tfor(i=0; i<%s; i++) {\n" % (parent + ty.lenvar.name)
> +        s += c_val(ty.elem_type, c+"[i]", "Field(%s, i)" % o, indent="\t\t",
> parent=parent) + "\n"
> +        s += "\t}\n"
> +        s += "}\n"
>      elif isinstance(ty,idl.Enumeration) and (parent is None):
>          n = 0
>          s += "switch(Int_val(%s)) {\n" % o
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 16:53:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 16:53:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7M8-00043c-Pk; Thu, 29 Nov 2012 16:52:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1Te7M6-00043B-RB; Thu, 29 Nov 2012 16:52:55 +0000
Received: from [193.109.254.147:4100] by server-8.bemta-14.messagelabs.com id
	F9/D6-05026-5E297B05; Thu, 29 Nov 2012 16:52:53 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1354207971!1990967!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18585 invoked from network); 29 Nov 2012 16:52:52 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 16:52:52 -0000
X-IronPort-AV: E=Sophos;i="4.84,185,1355097600"; d="scan'208";a="16075567"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 16:52:51 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Thu, 29 Nov 2012
	16:52:51 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Thu, 29 Nov 2012 16:52:51 +0000
Thread-Topic: [Xen-devel] [PATCH 06 of 15] libxl/ocaml: avoid reserved words
	in type and field names
Thread-Index: Ac3HQ/vswinSoJbER/SHCJ+rY/XYAQHDfGgQ
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107AE@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<f618acdeea1bf60b3b68.1353432206@cosworth.uk.xensource.com>
In-Reply-To: <f618acdeea1bf60b3b68.1353432206@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 06 of 15] libxl/ocaml: avoid reserved words
 in type and field names
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> f618acdeea1bf60b3b68da4062de018d8162fe8c
> # Parent  b7e2cd4a03f278c9abfec0812c88234f7e493646
> libxl/ocaml: avoid reserved words in type and field names.
> 
> Current just s/type/ty/ and there are no such fields (yet) so no change to
> generated code.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Looks good to me.

Acked-by: Rob Hoes <rob.hoes@citrix.com>

> diff -r b7e2cd4a03f2 -r f618acdeea1b tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -70,8 +70,14 @@ def ocaml_type_of(ty):
>      else:
>          return ty.rawname
> 
> +def munge_name(name):
> +    if name == "type":
> +        return "ty"
> +    else:
> +        return name
> +
>  def ocaml_instance_of(type, name):
> -    return "%s : %s" % (name, ocaml_type_of(type))
> +    return "%s : %s" % (munge_name(name), ocaml_type_of(type))
> 
>  def gen_ocaml_ml(ty, interface, indent=""):
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 16:53:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 16:53:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7M8-00043c-Pk; Thu, 29 Nov 2012 16:52:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1Te7M6-00043B-RB; Thu, 29 Nov 2012 16:52:55 +0000
Received: from [193.109.254.147:4100] by server-8.bemta-14.messagelabs.com id
	F9/D6-05026-5E297B05; Thu, 29 Nov 2012 16:52:53 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1354207971!1990967!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18585 invoked from network); 29 Nov 2012 16:52:52 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 16:52:52 -0000
X-IronPort-AV: E=Sophos;i="4.84,185,1355097600"; d="scan'208";a="16075567"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 16:52:51 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Thu, 29 Nov 2012
	16:52:51 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Thu, 29 Nov 2012 16:52:51 +0000
Thread-Topic: [Xen-devel] [PATCH 06 of 15] libxl/ocaml: avoid reserved words
	in type and field names
Thread-Index: Ac3HQ/vswinSoJbER/SHCJ+rY/XYAQHDfGgQ
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107AE@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<f618acdeea1bf60b3b68.1353432206@cosworth.uk.xensource.com>
In-Reply-To: <f618acdeea1bf60b3b68.1353432206@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 06 of 15] libxl/ocaml: avoid reserved words
 in type and field names
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> f618acdeea1bf60b3b68da4062de018d8162fe8c
> # Parent  b7e2cd4a03f278c9abfec0812c88234f7e493646
> libxl/ocaml: avoid reserved words in type and field names.
> 
> Current just s/type/ty/ and there are no such fields (yet) so no change to
> generated code.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Looks good to me.

Acked-by: Rob Hoes <rob.hoes@citrix.com>

> diff -r b7e2cd4a03f2 -r f618acdeea1b tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -70,8 +70,14 @@ def ocaml_type_of(ty):
>      else:
>          return ty.rawname
> 
> +def munge_name(name):
> +    if name == "type":
> +        return "ty"
> +    else:
> +        return name
> +
>  def ocaml_instance_of(type, name):
> -    return "%s : %s" % (name, ocaml_type_of(type))
> +    return "%s : %s" % (munge_name(name), ocaml_type_of(type))
> 
>  def gen_ocaml_ml(ty, interface, indent=""):
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 16:55:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 16:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7OK-0004L3-GY; Thu, 29 Nov 2012 16:55:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1Te7OI-0004Kd-Jr; Thu, 29 Nov 2012 16:55:11 +0000
Received: from [85.158.139.83:21368] by server-8.bemta-5.messagelabs.com id
	41/F5-06050-D6397B05; Thu, 29 Nov 2012 16:55:09 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1354208107!27686377!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5261 invoked from network); 29 Nov 2012 16:55:08 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 16:55:08 -0000
X-IronPort-AV: E=Sophos;i="4.84,185,1355097600"; d="scan'208";a="16075601"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 16:54:23 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Thu, 29 Nov 2012
	16:54:23 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Thu, 29 Nov 2012 16:54:23 +0000
Thread-Topic: [Xen-devel] [PATCH 07 of 15] libxl: ocaml: support for
	KeyedUnion in the bindings generator
Thread-Index: Ac3HRAU3yXQQH3ijS+6fQHRhPaelgwHDhvJg
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107AF@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<0cf342afa9e6b506fad6.1353432207@cosworth.uk.xensource.com>
In-Reply-To: <0cf342afa9e6b506fad6.1353432207@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 07 of 15] libxl: ocaml: support for
 KeyedUnion in the bindings generator
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> 0cf342afa9e6b506fad68346cb3a1207030372eb
> # Parent  f618acdeea1bf60b3b68da4062de018d8162fe8c
> libxl: ocaml: support for KeyedUnion in the bindings generator.
> 
> A KeyedUnion consists of two fields in the containing struct. First an enum
> field ("e") used as a descriminator and second a union ("u") containing
> potentially anonymous structs associated with each enum value.
> 
> We map the anonymous structs to structs named after the descriminator
> field ("e") and the specific enum values. We then declare an ocaml variant
> type name e__union mapping each enum value to its associated struct.
> 
> So given IDL:
> 
>  foo = Enumeration("foo",
> 	(0, "BAR"),
> 	(1, "BAZ"),
>  s = Struct("s", [
>         ("u", KeyedUnion(none, foo, "blargle", [
> 		("bar", Struct(...xxx...)),
> 		("baz", Struct(...yyy...)),
> 	])),
>  ])
> 
> We generate C:
> 
>  enum { FOO, BAR } foo;
>  struct s {
>  	enum foo blargle;
>  	union {
>  		struct { ...xxx... } bar;
>  		struct { ...yyy... } baz;
>  	} u;
>  }
> 
> and map this to ocaml
> 
>  type foo = BAR | BAZ;
> 
>  module	s = Struct
> 
>  	type blargle_bar = ...xxx...;
> 
>  	type blargle_baz = ...yyy...;
> 
>  	type blargle__union = Bar of blargle_bar | Baz of blargle_baz;
> 
>  	type t =
>  	{
>  		blargle : blargle__union;
>  	}
> 
> These type names are OK because they are already within the namespace
> associated with the struct "s".
> 
> If the struct assiated with bar is empty then we don't bother iwht
> blargle_bar of "of blargle_bar".
> 
> No actually change in the gnerated code since we don't generated any
> KeyedUnions yet.
> 
> The actual implementation was inspired by http://www.linux-
> nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php#ref_constvrnt
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

This works for me.

Acked-by: Rob Hoes <rob.hoes@citrix.com>

> diff -r f618acdeea1b -r 0cf342afa9e6 tools/libxl/idl.py
> --- a/tools/libxl/idl.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/libxl/idl.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -216,6 +216,9 @@ class Struct(Aggregate):
>          kwargs.setdefault('passby', PASS_BY_REFERENCE)
>          Aggregate.__init__(self, "struct", name, fields, **kwargs)
> 
> +    def has_fields(self):
> +        return len(self.fields) != 0
> +
>  class Union(Aggregate):
>      def __init__(self, name, fields, **kwargs):
>          # Generally speaking some intelligence is required to free a diff -r
> f618acdeea1b -r 0cf342afa9e6 tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -65,6 +65,8 @@ def ocaml_type_of(ty):
>          if not typename:
>              raise NotImplementedError("No typename for Builtin %s (%s)" %
> (ty.typename, type(ty)))
>          return typename
> +    elif isinstance(ty,idl.KeyedUnion):
> +        return ty.union_name
>      elif isinstance(ty,idl.Aggregate):
>          return ty.rawname.capitalize() + ".t"
>      else:
> @@ -76,8 +78,67 @@ def munge_name(name):
>      else:
>          return name
> 
> -def ocaml_instance_of(type, name):
> -    return "%s : %s" % (munge_name(name), ocaml_type_of(type))
> +def ocaml_instance_of_field(f):
> +    if isinstance(f.type, idl.KeyedUnion):
> +        name = f.type.keyvar.name
> +    else:
> +        name = f.name
> +    return "%s : %s" % (munge_name(name), ocaml_type_of(f.type))
> +
> +def gen_struct(ty):
> +    s = ""
> +    for f in ty.fields:
> +        if f.type.private:
> +            continue
> +        x = ocaml_instance_of_field(f)
> +        x = x.replace("\n", "\n\t\t")
> +        s += "\t\t" + x + ";\n"
> +    return s
> +
> +def gen_ocaml_keyedunions(ty, interface, indent, parent = None):
> +    s = ""
> +
> +    if ty.rawname is not None:
> +        # Non-anonymous types need no special handling
> +        pass
> +    elif isinstance(ty, idl.KeyedUnion):
> +        if parent is None:
> +            nparent = ty.keyvar.name
> +        else:
> +            nparent = parent + "_" + ty.keyvar.name
> +
> +        for f in ty.fields:
> +            if f.type is None: continue
> +            if f.type.rawname is not None: continue
> +            if isinstance(f.type, idl.Struct) and not f.type.has_fields(): continue
> +            s += "\ntype %s_%s =\n" % (nparent,f.name)
> +            s += "{\n"
> +            s += gen_struct(f.type)
> +            s += "}\n"
> +
> +        name = "%s__union" % ty.keyvar.name
> +        s += "\n"
> +        s += "type %s = " % name
> +        u = []
> +        for f in ty.fields:
> +            if f.type is None:
> +                u.append("%s" % (f.name.capitalize()))
> +            elif isinstance(f.type, idl.Struct):
> +                if f.type.rawname is not None:
> +                    u.append("%s of %s" % (f.name.capitalize(),
> f.type.rawname.capitalize()))
> +                elif f.type.has_fields():
> +                    u.append("%s of %s_%s" % (f.name.capitalize(), nparent,
> f.name))
> +                else:
> +                    u.append("%s" % (f.name.capitalize()))
> +            else:
> +                raise NotImplementedError("Cannot handle KeyedUnion
> + fields which are not Structs")
> +
> +        s += " | ".join(u) + "\n"
> +        ty.union_name = name
> +
> +    if s == "":
> +        return None
> +    return s.replace("\n", "\n%s" % indent)
> 
>  def gen_ocaml_ml(ty, interface, indent=""):
> 
> @@ -103,16 +164,17 @@ def gen_ocaml_ml(ty, interface, indent="
>                  s += "module %s : sig\n" % module_name
>              else:
>                  s += "module %s = struct\n" % module_name
> -            s += "\ttype t =\n"
> -            s += "\t{\n"
> -
> +
> +        # Handle KeyedUnions...
>          for f in ty.fields:
> -            if f.type.private:
> -                continue
> -            x = ocaml_instance_of(f.type, f.name)
> -            x = x.replace("\n", "\n\t\t")
> -            s += "\t\t" + x + ";\n"
> +            ku = gen_ocaml_keyedunions(f.type, interface, "\t")
> +            if ku is not None:
> +                s += ku
> +                s += "\n"
> 
> +        s += "\ttype t =\n"
> +        s += "\t{\n"
> +        s += gen_struct(ty)
>          s += "\t}\n"
> 
>          if functions.has_key(ty.rawname):
> @@ -164,12 +226,43 @@ def c_val(ty, c, o, indent="", parent =
>              n += 1
>          s += "    default: failwith_xl(\"cannot convert value to %s\", lg);
> break;\n" % ty.typename
>          s += "}"
> -    elif isinstance(ty, idl.Aggregate) and (parent is None):
> +    elif isinstance(ty, idl.KeyedUnion):
> +        s += "{\n"
> +        s += "\tif(Is_long(%s)) {\n" % o
> +        n = 0
> +        s += "\t\tswitch(Int_val(%s)) {\n" % o
> +        for f in ty.fields:
> +            if f.type is None or not f.type.has_fields():
> +                s += "\t\t    case %d: %s = %s; break;\n" % (n,
> +                                                    parent + ty.keyvar.name,
> +                                                    f.enumname)
> +            n += 1
> +        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (long)\",
> lg); break;\n" % (parent, ty.keyvar.name)
> +        s += "\t\t}\n"
> +        s += "\t} else {\n"
> +        s += "\t\t/* Is block... */\n"
> +        s += "\t\tswitch(Tag_val(%s)) {\n" % o
> +        n = 0
> +        for f in ty.fields:
> +            if f.type is not None and f.type.has_fields():
> +                if f.type.private:
> +                    continue
> +                s += "\t\t    case %d:\n" % (n)
> +                s += "\t\t        %s = %s;\n" % (parent + ty.keyvar.name, f.enumname)
> +                (nparent,fexpr) = ty.member(c, f, False)
> +                s += "%s" % c_val(f.type, fexpr, o, indent=indent+"\t\t        ")
> +                s += "break;\n"
> +            n += 1
> +        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (block)\",
> lg); break;\n" % (parent, ty.keyvar.name)
> +        s += "\t\t}\n"
> +        s += "\t}\n"
> +        s += "}"
> +    elif isinstance(ty, idl.Aggregate) and (parent is None or ty.rawname is
> None):
>          n = 0
>          for f in ty.fields:
>              if f.type.private:
>                  continue
> -            (nparent,fexpr) = ty.member(c, f, parent is None)
> +            (nparent,fexpr) = ty.member(c, f, ty.rawname is not None)
>              s += "%s\n" % c_val(f.type, fexpr, "Field(%s, %d)" % (o,n),
> parent=nparent)
>              n = n + 1
>      else:
> @@ -191,8 +284,8 @@ def gen_c_val(ty, indent=""):
>      s += "}\n"
> 
>      return s.replace("\n", "\n%s" % indent)
> -
> -def ocaml_Val(ty, o, c, indent="", parent = None):
> +
> +def ocaml_Val(ty, o, c, indent="", parent = None, struct_tag = None):
>      s = indent
>      if isinstance(ty,idl.UInt):
>          if ty.width in [8, 16]:
> @@ -231,11 +324,39 @@ def ocaml_Val(ty, o, c, indent="", paren
>              n += 1
>          s += "    default: failwith_xl(\"cannot convert value from %s\", lg);
> break;\n" % ty.typename
>          s += "}"
> -    elif isinstance(ty,idl.Aggregate) and (parent is None):
> +    elif isinstance(ty, idl.KeyedUnion):
> +        n = 0
> +        s += "switch(%s) {\n" % (parent + ty.keyvar.name)
> +        for f in ty.fields:
> +            s += "\t    case %s:\n" % f.enumname
> +            if f.type is None:
> +                s += "\t        /* %d: None */\n" % n
> +                s += "\t        %s = Val_long(%d);\n" % (o,n)
> +            elif not f.type.has_fields():
> +                s += "\t        /* %d: Long */\n" % n
> +                s += "\t        %s = Val_long(%d);\n" % (o,n)
> +            else:
> +                s += "\t        /* %d: Block */\n" % n
> +                (nparent,fexpr) = ty.member(c, f, parent is None)
> +                s += ocaml_Val(f.type, o, fexpr, struct_tag = n, indent="\t        ",
> parent=nparent)
> +                s += "\n"
> +                #s += "\t        %s = caml_alloc(%d,%d);\n" % (o,len(f.type.fields),n)
> +            s += "\t        break;\n"
> +            n += 1
> +        s += "\t    default: failwith_xl(\"cannot convert value from %s\", lg);
> break;\n" % ty.typename
> +        s += "\t}"
> +    elif isinstance(ty,idl.Aggregate) and (parent is None or ty.rawname is
> None):
>          s += "{\n"
> -        s += "\tvalue %s_field;\n" % ty.rawname
> +        if ty.rawname is None:
> +            fn = "anon_field"
> +        else:
> +            fn = "%s_field" % ty.rawname
> +        s += "\tvalue %s;\n" % fn
>          s += "\n"
> -        s += "\t%s = caml_alloc_tuple(%d);\n" % (o, len(ty.fields))
> +        if struct_tag is not None:
> +            s += "\t%s = caml_alloc(%d,%d);\n" % (o, len(ty.fields), struct_tag)
> +        else:
> +            s += "\t%s = caml_alloc_tuple(%d);\n" % (o, len(ty.fields))
> 
>          n = 0
>          for f in ty.fields:
> @@ -245,8 +366,8 @@ def ocaml_Val(ty, o, c, indent="", paren
>              (nparent,fexpr) = ty.member(c, f, parent is None)
> 
>              s += "\n"
> -            s += "\t%s\n" % ocaml_Val(f.type, "%s_field" % ty.rawname,
> ty.pass_arg(fexpr, c), parent=nparent)
> -            s += "\tStore_field(%s, %d, %s);\n" % (o, n, "%s_field" % ty.rawname)
> +            s += "\t%s\n" % ocaml_Val(f.type, fn, ty.pass_arg(fexpr, c),
> parent=nparent)
> +            s += "\tStore_field(%s, %d, %s);\n" % (o, n, fn)
>              n = n + 1
>          s += "}"
>      else:
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 16:55:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 16:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7OK-0004L3-GY; Thu, 29 Nov 2012 16:55:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1Te7OI-0004Kd-Jr; Thu, 29 Nov 2012 16:55:11 +0000
Received: from [85.158.139.83:21368] by server-8.bemta-5.messagelabs.com id
	41/F5-06050-D6397B05; Thu, 29 Nov 2012 16:55:09 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1354208107!27686377!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5261 invoked from network); 29 Nov 2012 16:55:08 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 16:55:08 -0000
X-IronPort-AV: E=Sophos;i="4.84,185,1355097600"; d="scan'208";a="16075601"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 16:54:23 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Thu, 29 Nov 2012
	16:54:23 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Thu, 29 Nov 2012 16:54:23 +0000
Thread-Topic: [Xen-devel] [PATCH 07 of 15] libxl: ocaml: support for
	KeyedUnion in the bindings generator
Thread-Index: Ac3HRAU3yXQQH3ijS+6fQHRhPaelgwHDhvJg
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107AF@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<0cf342afa9e6b506fad6.1353432207@cosworth.uk.xensource.com>
In-Reply-To: <0cf342afa9e6b506fad6.1353432207@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 07 of 15] libxl: ocaml: support for
 KeyedUnion in the bindings generator
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> 0cf342afa9e6b506fad68346cb3a1207030372eb
> # Parent  f618acdeea1bf60b3b68da4062de018d8162fe8c
> libxl: ocaml: support for KeyedUnion in the bindings generator.
> 
> A KeyedUnion consists of two fields in the containing struct. First an enum
> field ("e") used as a descriminator and second a union ("u") containing
> potentially anonymous structs associated with each enum value.
> 
> We map the anonymous structs to structs named after the descriminator
> field ("e") and the specific enum values. We then declare an ocaml variant
> type name e__union mapping each enum value to its associated struct.
> 
> So given IDL:
> 
>  foo = Enumeration("foo",
> 	(0, "BAR"),
> 	(1, "BAZ"),
>  s = Struct("s", [
>         ("u", KeyedUnion(none, foo, "blargle", [
> 		("bar", Struct(...xxx...)),
> 		("baz", Struct(...yyy...)),
> 	])),
>  ])
> 
> We generate C:
> 
>  enum { FOO, BAR } foo;
>  struct s {
>  	enum foo blargle;
>  	union {
>  		struct { ...xxx... } bar;
>  		struct { ...yyy... } baz;
>  	} u;
>  }
> 
> and map this to ocaml
> 
>  type foo = BAR | BAZ;
> 
>  module	s = Struct
> 
>  	type blargle_bar = ...xxx...;
> 
>  	type blargle_baz = ...yyy...;
> 
>  	type blargle__union = Bar of blargle_bar | Baz of blargle_baz;
> 
>  	type t =
>  	{
>  		blargle : blargle__union;
>  	}
> 
> These type names are OK because they are already within the namespace
> associated with the struct "s".
> 
> If the struct assiated with bar is empty then we don't bother iwht
> blargle_bar of "of blargle_bar".
> 
> No actually change in the gnerated code since we don't generated any
> KeyedUnions yet.
> 
> The actual implementation was inspired by http://www.linux-
> nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php#ref_constvrnt
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

This works for me.

Acked-by: Rob Hoes <rob.hoes@citrix.com>

> diff -r f618acdeea1b -r 0cf342afa9e6 tools/libxl/idl.py
> --- a/tools/libxl/idl.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/libxl/idl.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -216,6 +216,9 @@ class Struct(Aggregate):
>          kwargs.setdefault('passby', PASS_BY_REFERENCE)
>          Aggregate.__init__(self, "struct", name, fields, **kwargs)
> 
> +    def has_fields(self):
> +        return len(self.fields) != 0
> +
>  class Union(Aggregate):
>      def __init__(self, name, fields, **kwargs):
>          # Generally speaking some intelligence is required to free a diff -r
> f618acdeea1b -r 0cf342afa9e6 tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -65,6 +65,8 @@ def ocaml_type_of(ty):
>          if not typename:
>              raise NotImplementedError("No typename for Builtin %s (%s)" %
> (ty.typename, type(ty)))
>          return typename
> +    elif isinstance(ty,idl.KeyedUnion):
> +        return ty.union_name
>      elif isinstance(ty,idl.Aggregate):
>          return ty.rawname.capitalize() + ".t"
>      else:
> @@ -76,8 +78,67 @@ def munge_name(name):
>      else:
>          return name
> 
> -def ocaml_instance_of(type, name):
> -    return "%s : %s" % (munge_name(name), ocaml_type_of(type))
> +def ocaml_instance_of_field(f):
> +    if isinstance(f.type, idl.KeyedUnion):
> +        name = f.type.keyvar.name
> +    else:
> +        name = f.name
> +    return "%s : %s" % (munge_name(name), ocaml_type_of(f.type))
> +
> +def gen_struct(ty):
> +    s = ""
> +    for f in ty.fields:
> +        if f.type.private:
> +            continue
> +        x = ocaml_instance_of_field(f)
> +        x = x.replace("\n", "\n\t\t")
> +        s += "\t\t" + x + ";\n"
> +    return s
> +
> +def gen_ocaml_keyedunions(ty, interface, indent, parent = None):
> +    s = ""
> +
> +    if ty.rawname is not None:
> +        # Non-anonymous types need no special handling
> +        pass
> +    elif isinstance(ty, idl.KeyedUnion):
> +        if parent is None:
> +            nparent = ty.keyvar.name
> +        else:
> +            nparent = parent + "_" + ty.keyvar.name
> +
> +        for f in ty.fields:
> +            if f.type is None: continue
> +            if f.type.rawname is not None: continue
> +            if isinstance(f.type, idl.Struct) and not f.type.has_fields(): continue
> +            s += "\ntype %s_%s =\n" % (nparent,f.name)
> +            s += "{\n"
> +            s += gen_struct(f.type)
> +            s += "}\n"
> +
> +        name = "%s__union" % ty.keyvar.name
> +        s += "\n"
> +        s += "type %s = " % name
> +        u = []
> +        for f in ty.fields:
> +            if f.type is None:
> +                u.append("%s" % (f.name.capitalize()))
> +            elif isinstance(f.type, idl.Struct):
> +                if f.type.rawname is not None:
> +                    u.append("%s of %s" % (f.name.capitalize(),
> f.type.rawname.capitalize()))
> +                elif f.type.has_fields():
> +                    u.append("%s of %s_%s" % (f.name.capitalize(), nparent,
> f.name))
> +                else:
> +                    u.append("%s" % (f.name.capitalize()))
> +            else:
> +                raise NotImplementedError("Cannot handle KeyedUnion
> + fields which are not Structs")
> +
> +        s += " | ".join(u) + "\n"
> +        ty.union_name = name
> +
> +    if s == "":
> +        return None
> +    return s.replace("\n", "\n%s" % indent)
> 
>  def gen_ocaml_ml(ty, interface, indent=""):
> 
> @@ -103,16 +164,17 @@ def gen_ocaml_ml(ty, interface, indent="
>                  s += "module %s : sig\n" % module_name
>              else:
>                  s += "module %s = struct\n" % module_name
> -            s += "\ttype t =\n"
> -            s += "\t{\n"
> -
> +
> +        # Handle KeyedUnions...
>          for f in ty.fields:
> -            if f.type.private:
> -                continue
> -            x = ocaml_instance_of(f.type, f.name)
> -            x = x.replace("\n", "\n\t\t")
> -            s += "\t\t" + x + ";\n"
> +            ku = gen_ocaml_keyedunions(f.type, interface, "\t")
> +            if ku is not None:
> +                s += ku
> +                s += "\n"
> 
> +        s += "\ttype t =\n"
> +        s += "\t{\n"
> +        s += gen_struct(ty)
>          s += "\t}\n"
> 
>          if functions.has_key(ty.rawname):
> @@ -164,12 +226,43 @@ def c_val(ty, c, o, indent="", parent =
>              n += 1
>          s += "    default: failwith_xl(\"cannot convert value to %s\", lg);
> break;\n" % ty.typename
>          s += "}"
> -    elif isinstance(ty, idl.Aggregate) and (parent is None):
> +    elif isinstance(ty, idl.KeyedUnion):
> +        s += "{\n"
> +        s += "\tif(Is_long(%s)) {\n" % o
> +        n = 0
> +        s += "\t\tswitch(Int_val(%s)) {\n" % o
> +        for f in ty.fields:
> +            if f.type is None or not f.type.has_fields():
> +                s += "\t\t    case %d: %s = %s; break;\n" % (n,
> +                                                    parent + ty.keyvar.name,
> +                                                    f.enumname)
> +            n += 1
> +        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (long)\",
> lg); break;\n" % (parent, ty.keyvar.name)
> +        s += "\t\t}\n"
> +        s += "\t} else {\n"
> +        s += "\t\t/* Is block... */\n"
> +        s += "\t\tswitch(Tag_val(%s)) {\n" % o
> +        n = 0
> +        for f in ty.fields:
> +            if f.type is not None and f.type.has_fields():
> +                if f.type.private:
> +                    continue
> +                s += "\t\t    case %d:\n" % (n)
> +                s += "\t\t        %s = %s;\n" % (parent + ty.keyvar.name, f.enumname)
> +                (nparent,fexpr) = ty.member(c, f, False)
> +                s += "%s" % c_val(f.type, fexpr, o, indent=indent+"\t\t        ")
> +                s += "break;\n"
> +            n += 1
> +        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (block)\",
> lg); break;\n" % (parent, ty.keyvar.name)
> +        s += "\t\t}\n"
> +        s += "\t}\n"
> +        s += "}"
> +    elif isinstance(ty, idl.Aggregate) and (parent is None or ty.rawname is
> None):
>          n = 0
>          for f in ty.fields:
>              if f.type.private:
>                  continue
> -            (nparent,fexpr) = ty.member(c, f, parent is None)
> +            (nparent,fexpr) = ty.member(c, f, ty.rawname is not None)
>              s += "%s\n" % c_val(f.type, fexpr, "Field(%s, %d)" % (o,n),
> parent=nparent)
>              n = n + 1
>      else:
> @@ -191,8 +284,8 @@ def gen_c_val(ty, indent=""):
>      s += "}\n"
> 
>      return s.replace("\n", "\n%s" % indent)
> -
> -def ocaml_Val(ty, o, c, indent="", parent = None):
> +
> +def ocaml_Val(ty, o, c, indent="", parent = None, struct_tag = None):
>      s = indent
>      if isinstance(ty,idl.UInt):
>          if ty.width in [8, 16]:
> @@ -231,11 +324,39 @@ def ocaml_Val(ty, o, c, indent="", paren
>              n += 1
>          s += "    default: failwith_xl(\"cannot convert value from %s\", lg);
> break;\n" % ty.typename
>          s += "}"
> -    elif isinstance(ty,idl.Aggregate) and (parent is None):
> +    elif isinstance(ty, idl.KeyedUnion):
> +        n = 0
> +        s += "switch(%s) {\n" % (parent + ty.keyvar.name)
> +        for f in ty.fields:
> +            s += "\t    case %s:\n" % f.enumname
> +            if f.type is None:
> +                s += "\t        /* %d: None */\n" % n
> +                s += "\t        %s = Val_long(%d);\n" % (o,n)
> +            elif not f.type.has_fields():
> +                s += "\t        /* %d: Long */\n" % n
> +                s += "\t        %s = Val_long(%d);\n" % (o,n)
> +            else:
> +                s += "\t        /* %d: Block */\n" % n
> +                (nparent,fexpr) = ty.member(c, f, parent is None)
> +                s += ocaml_Val(f.type, o, fexpr, struct_tag = n, indent="\t        ",
> parent=nparent)
> +                s += "\n"
> +                #s += "\t        %s = caml_alloc(%d,%d);\n" % (o,len(f.type.fields),n)
> +            s += "\t        break;\n"
> +            n += 1
> +        s += "\t    default: failwith_xl(\"cannot convert value from %s\", lg);
> break;\n" % ty.typename
> +        s += "\t}"
> +    elif isinstance(ty,idl.Aggregate) and (parent is None or ty.rawname is
> None):
>          s += "{\n"
> -        s += "\tvalue %s_field;\n" % ty.rawname
> +        if ty.rawname is None:
> +            fn = "anon_field"
> +        else:
> +            fn = "%s_field" % ty.rawname
> +        s += "\tvalue %s;\n" % fn
>          s += "\n"
> -        s += "\t%s = caml_alloc_tuple(%d);\n" % (o, len(ty.fields))
> +        if struct_tag is not None:
> +            s += "\t%s = caml_alloc(%d,%d);\n" % (o, len(ty.fields), struct_tag)
> +        else:
> +            s += "\t%s = caml_alloc_tuple(%d);\n" % (o, len(ty.fields))
> 
>          n = 0
>          for f in ty.fields:
> @@ -245,8 +366,8 @@ def ocaml_Val(ty, o, c, indent="", paren
>              (nparent,fexpr) = ty.member(c, f, parent is None)
> 
>              s += "\n"
> -            s += "\t%s\n" % ocaml_Val(f.type, "%s_field" % ty.rawname,
> ty.pass_arg(fexpr, c), parent=nparent)
> -            s += "\tStore_field(%s, %d, %s);\n" % (o, n, "%s_field" % ty.rawname)
> +            s += "\t%s\n" % ocaml_Val(f.type, fn, ty.pass_arg(fexpr, c),
> parent=nparent)
> +            s += "\tStore_field(%s, %d, %s);\n" % (o, n, fn)
>              n = n + 1
>          s += "}"
>      else:
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:00:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:00:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7TL-0004hm-E9; Thu, 29 Nov 2012 17:00:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Te7TJ-0004hf-Ml
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:00:21 +0000
Received: from [193.109.254.147:32986] by server-5.bemta-14.messagelabs.com id
	8E/12-10257-5A497B05; Thu, 29 Nov 2012 17:00:21 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1354208419!8784084!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26003 invoked from network); 29 Nov 2012 17:00:20 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:00:20 -0000
X-IronPort-AV: E=Sophos;i="4.84,185,1355097600"; d="scan'208";a="16075739"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:00:03 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 29 Nov 2012 17:00:03 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Te7T0-0007Sb-PE; Thu, 29 Nov 2012 17:00:02 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Te7T0-00087l-LF;
	Thu, 29 Nov 2012 17:00:02 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20663.38034.484314.515452@mariner.uk.xensource.com>
Date: Thu, 29 Nov 2012 17:00:02 +0000
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1354025687.17985.35.camel@zakaz.uk.xensource.com>
References: <201211262353.15915.ronny.hegewald@online.de>
	<1354025687.17985.35.camel@zakaz.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Ronny Hegewald <ronny.hegewald@online.de>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] libxl: fix a variable underflow in
 libxl_wait_for_free_memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("Re: [Xen-devel] [PATCH V2] libxl: fix a variable underflow in libxl_wait_for_free_memory"):
> On Mon, 2012-11-26 at 23:53 +0000, Ronny Hegewald wrote:
> > When xl is called to create a domU and there is not enough memory available, 
> > then the autoballooning is called to extract memory from dom0. During the 
> > ballooning a loop in libxl_wait_for_free_memory() waits unless enough memory 
...
> Ian J -- this is a stable branch candidate IMHO.

I agree, done.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:00:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:00:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7TL-0004hm-E9; Thu, 29 Nov 2012 17:00:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Te7TJ-0004hf-Ml
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:00:21 +0000
Received: from [193.109.254.147:32986] by server-5.bemta-14.messagelabs.com id
	8E/12-10257-5A497B05; Thu, 29 Nov 2012 17:00:21 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1354208419!8784084!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26003 invoked from network); 29 Nov 2012 17:00:20 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:00:20 -0000
X-IronPort-AV: E=Sophos;i="4.84,185,1355097600"; d="scan'208";a="16075739"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:00:03 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 29 Nov 2012 17:00:03 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Te7T0-0007Sb-PE; Thu, 29 Nov 2012 17:00:02 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Te7T0-00087l-LF;
	Thu, 29 Nov 2012 17:00:02 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20663.38034.484314.515452@mariner.uk.xensource.com>
Date: Thu, 29 Nov 2012 17:00:02 +0000
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1354025687.17985.35.camel@zakaz.uk.xensource.com>
References: <201211262353.15915.ronny.hegewald@online.de>
	<1354025687.17985.35.camel@zakaz.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Ronny Hegewald <ronny.hegewald@online.de>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2] libxl: fix a variable underflow in
 libxl_wait_for_free_memory
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("Re: [Xen-devel] [PATCH V2] libxl: fix a variable underflow in libxl_wait_for_free_memory"):
> On Mon, 2012-11-26 at 23:53 +0000, Ronny Hegewald wrote:
> > When xl is called to create a domU and there is not enough memory available, 
> > then the autoballooning is called to extract memory from dom0. During the 
> > ballooning a loop in libxl_wait_for_free_memory() waits unless enough memory 
...
> Ian J -- this is a stable branch candidate IMHO.

I agree, done.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:05:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:05:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7YW-0004wM-9a; Thu, 29 Nov 2012 17:05:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te7YU-0004wE-V2
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:05:43 +0000
Received: from [85.158.138.51:34662] by server-11.bemta-3.messagelabs.com id
	B5/7E-19361-5E597B05; Thu, 29 Nov 2012 17:05:41 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354208703!25681844!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30220 invoked from network); 29 Nov 2012 17:05:04 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:05:04 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te7Xp-000M7Y-Va; Thu, 29 Nov 2012 17:05:01 +0000
Date: Thu, 29 Nov 2012 17:05:01 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <ian.campbell@citrix.com>
Message-ID: <20121129170501.GF80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-4-git-send-email-ian.campbell@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352823804-28482-4-git-send-email-ian.campbell@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 04/12] arm: parse modules from DT during
	early boot.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:23 +0000 on 13 Nov (1352823796), Ian Campbell wrote:
> The bootloader should populate /chosen/module@<N>/ for each module it
> wishes to pass to the hypervisor. The content of these nodes is
> described in docs/misc/arm/device-tree/booting.txt
> 
> The hypervisor allows for 2 modules (@1==kernel and @2==initrd).
> Currently we don't do anything with them.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
> v2: Reserve the zeroeth module for Xen itself (not used yet)
>     Use a more idiomatic DT layout
>     Document said layout
> ---
>  docs/misc/arm/device-tree/booting.txt |   27 ++++++++++++
>  xen/common/device_tree.c              |   75 +++++++++++++++++++++++++++++++++
>  xen/include/xen/device_tree.h         |   14 ++++++
>  3 files changed, 116 insertions(+), 0 deletions(-)
>  create mode 100644 docs/misc/arm/device-tree/booting.txt
> 
> diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt
> new file mode 100644
> index 0000000..2609450
> --- /dev/null
> +++ b/docs/misc/arm/device-tree/booting.txt
> @@ -0,0 +1,27 @@
> +Xen is passed the dom0 kernel and initrd via a reference in the /chosen
> +node of the device tree.
> +
> +Each node has the form /chosen/module@<N> and contains the following
> +properties:
> +
> +- compatible
> +
> +	Must be "xen,multiboot-module"
> +
> +- start
> +
> +	Physical address of the start of this module
> +
> +- end
> +
> +	Physical address of the end of this module
> +
> +- bootargs (optional)
> +
> +	Command line associated with this module
> +
> +The following modules are understood
> +
> +- 1 -- the domain 0 kernel
> +- 2 -- the domain 0 ramdisk
> +
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 3d1f0f4..efd1663 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -229,6 +229,79 @@ static void __init process_memory_node(const void *fdt, int node,
>      }
>  }
>  
> +static void __init process_chosen_node(const void *fdt, int node,
> +                                       const char *name,
> +                                       u32 address_cells, u32 size_cells)
> +{
> +    const struct fdt_property *prop;
> +    const u32 *cell;
> +    paddr_t size;
> +    int nr, depth, nr_modules = 0;
> +    struct dt_mb_module *mod;
> +    int len;
> +
> +    for ( depth = 0;
> +          depth >= 0;
> +          node = fdt_next_node(fdt, node, &depth) )
> +    {
> +        name = fdt_get_name(fdt, node, NULL);
> +        if ( strncmp(name, "module@", strlen("module@")) == 0 ) {
> +
> +            if ( fdt_node_check_compatible(fdt, node,
> +                                           "xen,multiboot-module" ) != 0 )
> +                early_panic("%s not a compatible module node\n", name);
> +
> +            nr = simple_strtol(name + strlen("module@"), NULL, 10);
> +            if ( nr <= 0 )
> +                early_panic("Invalid module number %d\n", nr);
> +
> +            if ( nr > NR_MODULES )
> +                early_panic("too many modules %d > %d\n", nr, NR_MODULES);
> +            if ( nr > nr_modules )
> +                nr_modules = nr;
> +
> +            mod = &early_info.modules.module[nr];
> +
> +            prop = fdt_get_property(fdt, node, "start", NULL);
> +            if ( !prop )
> +                early_panic("no start for module %d\n", nr);
> +
> +            cell = (const u32 *)prop->data;
> +            device_tree_get_reg(&cell, address_cells, size_cells,
> +                                &mod->start, &size);

This get_reg returns a start + size -- can/should we encode the module
as one of these rather than encdong start + end separately and
discarding the 'size' fields?

> +
> +            prop = fdt_get_property(fdt, node, "end", NULL);
> +            if ( !prop )
> +                early_panic("no end for module %d\n", nr);
> +
> +            cell = (const u32 *)prop->data;
> +            device_tree_get_reg(&cell, address_cells, size_cells,
> +                                &mod->size, &size);
> +            mod->size -= mod->start;
> +
> +            prop = fdt_get_property(fdt, node, "bootargs", &len);
> +            if ( prop )
> +            {
> +                if ( len > sizeof(mod->cmdline) )
> +                    early_panic("module %d command line too long\n", nr);
> +
> +                safe_strcpy(mod->cmdline, prop->data);
> +            }
> +            else
> +                mod->cmdline[0] = 0;
> +        }
> +    }
> +
> +    for ( nr = 1 ; nr < nr_modules ; nr++ )
> +    {
> +        mod = &early_info.modules.module[nr];
> +        if ( !mod->start || !mod->size )
> +            early_panic("module %d  missing / invalid\n", nr);
> +    }
> +
> +    early_info.modules.nr_mods = nr_modules;
> +}
> +
>  static int __init early_scan_node(const void *fdt,
>                                    int node, const char *name, int depth,
>                                    u32 address_cells, u32 size_cells,
> @@ -236,6 +309,8 @@ static int __init early_scan_node(const void *fdt,
>  {
>      if ( device_tree_node_matches(fdt, node, "memory") )
>          process_memory_node(fdt, node, name, address_cells, size_cells);
> +    else if ( device_tree_node_matches(fdt, node, "chosen") )
> +        process_chosen_node(fdt, node, name, address_cells, size_cells);
>  
>      return 0;
>  }
> diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
> index 4d010c0..c383677 100644
> --- a/xen/include/xen/device_tree.h
> +++ b/xen/include/xen/device_tree.h
> @@ -15,6 +15,7 @@
>  #define DEVICE_TREE_MAX_DEPTH 16
>  
>  #define NR_MEM_BANKS 8
> +#define NR_MODULES 2
>  
>  struct membank {
>      paddr_t start;
> @@ -26,8 +27,21 @@ struct dt_mem_info {
>      struct membank bank[NR_MEM_BANKS];
>  };
>  
> +struct dt_mb_module {
> +    paddr_t start;
> +    paddr_t size;
> +    char cmdline[1024];
> +};
> +
> +struct dt_module_info {
> +    int nr_mods;
> +    /* Module 0 is Xen itself, followed by the provided modules-proper */
> +    struct dt_mb_module module[NR_MODULES + 1];
> +};
> +
>  struct dt_early_info {
>      struct dt_mem_info mem;
> +    struct dt_module_info modules;
>  };
>  
>  typedef int (*device_tree_node_func)(const void *fdt,
> -- 
> 1.7.9.1
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:05:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:05:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7YW-0004wM-9a; Thu, 29 Nov 2012 17:05:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te7YU-0004wE-V2
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:05:43 +0000
Received: from [85.158.138.51:34662] by server-11.bemta-3.messagelabs.com id
	B5/7E-19361-5E597B05; Thu, 29 Nov 2012 17:05:41 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354208703!25681844!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30220 invoked from network); 29 Nov 2012 17:05:04 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:05:04 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te7Xp-000M7Y-Va; Thu, 29 Nov 2012 17:05:01 +0000
Date: Thu, 29 Nov 2012 17:05:01 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <ian.campbell@citrix.com>
Message-ID: <20121129170501.GF80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-4-git-send-email-ian.campbell@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352823804-28482-4-git-send-email-ian.campbell@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 04/12] arm: parse modules from DT during
	early boot.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:23 +0000 on 13 Nov (1352823796), Ian Campbell wrote:
> The bootloader should populate /chosen/module@<N>/ for each module it
> wishes to pass to the hypervisor. The content of these nodes is
> described in docs/misc/arm/device-tree/booting.txt
> 
> The hypervisor allows for 2 modules (@1==kernel and @2==initrd).
> Currently we don't do anything with them.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
> v2: Reserve the zeroeth module for Xen itself (not used yet)
>     Use a more idiomatic DT layout
>     Document said layout
> ---
>  docs/misc/arm/device-tree/booting.txt |   27 ++++++++++++
>  xen/common/device_tree.c              |   75 +++++++++++++++++++++++++++++++++
>  xen/include/xen/device_tree.h         |   14 ++++++
>  3 files changed, 116 insertions(+), 0 deletions(-)
>  create mode 100644 docs/misc/arm/device-tree/booting.txt
> 
> diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt
> new file mode 100644
> index 0000000..2609450
> --- /dev/null
> +++ b/docs/misc/arm/device-tree/booting.txt
> @@ -0,0 +1,27 @@
> +Xen is passed the dom0 kernel and initrd via a reference in the /chosen
> +node of the device tree.
> +
> +Each node has the form /chosen/module@<N> and contains the following
> +properties:
> +
> +- compatible
> +
> +	Must be "xen,multiboot-module"
> +
> +- start
> +
> +	Physical address of the start of this module
> +
> +- end
> +
> +	Physical address of the end of this module
> +
> +- bootargs (optional)
> +
> +	Command line associated with this module
> +
> +The following modules are understood
> +
> +- 1 -- the domain 0 kernel
> +- 2 -- the domain 0 ramdisk
> +
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 3d1f0f4..efd1663 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -229,6 +229,79 @@ static void __init process_memory_node(const void *fdt, int node,
>      }
>  }
>  
> +static void __init process_chosen_node(const void *fdt, int node,
> +                                       const char *name,
> +                                       u32 address_cells, u32 size_cells)
> +{
> +    const struct fdt_property *prop;
> +    const u32 *cell;
> +    paddr_t size;
> +    int nr, depth, nr_modules = 0;
> +    struct dt_mb_module *mod;
> +    int len;
> +
> +    for ( depth = 0;
> +          depth >= 0;
> +          node = fdt_next_node(fdt, node, &depth) )
> +    {
> +        name = fdt_get_name(fdt, node, NULL);
> +        if ( strncmp(name, "module@", strlen("module@")) == 0 ) {
> +
> +            if ( fdt_node_check_compatible(fdt, node,
> +                                           "xen,multiboot-module" ) != 0 )
> +                early_panic("%s not a compatible module node\n", name);
> +
> +            nr = simple_strtol(name + strlen("module@"), NULL, 10);
> +            if ( nr <= 0 )
> +                early_panic("Invalid module number %d\n", nr);
> +
> +            if ( nr > NR_MODULES )
> +                early_panic("too many modules %d > %d\n", nr, NR_MODULES);
> +            if ( nr > nr_modules )
> +                nr_modules = nr;
> +
> +            mod = &early_info.modules.module[nr];
> +
> +            prop = fdt_get_property(fdt, node, "start", NULL);
> +            if ( !prop )
> +                early_panic("no start for module %d\n", nr);
> +
> +            cell = (const u32 *)prop->data;
> +            device_tree_get_reg(&cell, address_cells, size_cells,
> +                                &mod->start, &size);

This get_reg returns a start + size -- can/should we encode the module
as one of these rather than encdong start + end separately and
discarding the 'size' fields?

> +
> +            prop = fdt_get_property(fdt, node, "end", NULL);
> +            if ( !prop )
> +                early_panic("no end for module %d\n", nr);
> +
> +            cell = (const u32 *)prop->data;
> +            device_tree_get_reg(&cell, address_cells, size_cells,
> +                                &mod->size, &size);
> +            mod->size -= mod->start;
> +
> +            prop = fdt_get_property(fdt, node, "bootargs", &len);
> +            if ( prop )
> +            {
> +                if ( len > sizeof(mod->cmdline) )
> +                    early_panic("module %d command line too long\n", nr);
> +
> +                safe_strcpy(mod->cmdline, prop->data);
> +            }
> +            else
> +                mod->cmdline[0] = 0;
> +        }
> +    }
> +
> +    for ( nr = 1 ; nr < nr_modules ; nr++ )
> +    {
> +        mod = &early_info.modules.module[nr];
> +        if ( !mod->start || !mod->size )
> +            early_panic("module %d  missing / invalid\n", nr);
> +    }
> +
> +    early_info.modules.nr_mods = nr_modules;
> +}
> +
>  static int __init early_scan_node(const void *fdt,
>                                    int node, const char *name, int depth,
>                                    u32 address_cells, u32 size_cells,
> @@ -236,6 +309,8 @@ static int __init early_scan_node(const void *fdt,
>  {
>      if ( device_tree_node_matches(fdt, node, "memory") )
>          process_memory_node(fdt, node, name, address_cells, size_cells);
> +    else if ( device_tree_node_matches(fdt, node, "chosen") )
> +        process_chosen_node(fdt, node, name, address_cells, size_cells);
>  
>      return 0;
>  }
> diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
> index 4d010c0..c383677 100644
> --- a/xen/include/xen/device_tree.h
> +++ b/xen/include/xen/device_tree.h
> @@ -15,6 +15,7 @@
>  #define DEVICE_TREE_MAX_DEPTH 16
>  
>  #define NR_MEM_BANKS 8
> +#define NR_MODULES 2
>  
>  struct membank {
>      paddr_t start;
> @@ -26,8 +27,21 @@ struct dt_mem_info {
>      struct membank bank[NR_MEM_BANKS];
>  };
>  
> +struct dt_mb_module {
> +    paddr_t start;
> +    paddr_t size;
> +    char cmdline[1024];
> +};
> +
> +struct dt_module_info {
> +    int nr_mods;
> +    /* Module 0 is Xen itself, followed by the provided modules-proper */
> +    struct dt_mb_module module[NR_MODULES + 1];
> +};
> +
>  struct dt_early_info {
>      struct dt_mem_info mem;
> +    struct dt_module_info modules;
>  };
>  
>  typedef int (*device_tree_node_func)(const void *fdt,
> -- 
> 1.7.9.1
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:07:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:07:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7Zi-00052U-St; Thu, 29 Nov 2012 17:06:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te7Zh-00052I-LA
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:06:57 +0000
Received: from [85.158.139.83:33164] by server-11.bemta-5.messagelabs.com id
	22/9F-03409-03697B05; Thu, 29 Nov 2012 17:06:56 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1354208798!27721125!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9414 invoked from network); 29 Nov 2012 17:06:39 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-5.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:06:39 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te7ZO-000M7s-CN; Thu, 29 Nov 2012 17:06:38 +0000
Date: Thu, 29 Nov 2012 17:06:38 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <ian.campbell@citrix.com>
Message-ID: <20121129170638.GG80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-6-git-send-email-ian.campbell@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352823804-28482-6-git-send-email-ian.campbell@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 06/12] arm: avoid allocating the heaps over
	modules or xen itself.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:23 +0000 on 13 Nov (1352823798), Ian Campbell wrote:
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
>  xen/arch/arm/setup.c |   89 +++++++++++++++++++++++++++++++++++++++++++------
>  1 files changed, 78 insertions(+), 11 deletions(-)
> 
> @@ -215,8 +260,30 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
>      copy_from_paddr(device_tree_flattened, dtb_paddr, dtb_size, BUFFERABLE);
>  
>      /* Add non-xenheap memory */
> -    init_boot_pages(pfn_to_paddr(xenheap_mfn_start + xenheap_pages),
> -                    pfn_to_paddr(xenheap_mfn_start + xenheap_pages + domheap_pages));
> +    s = ram_start;
> +    while ( s < ram_end )
> +    {
> +        paddr_t n = ram_end;
> +
> +        e = next_module(s, &n);

Does this DTRT if there's a module starting at exactly ram_start?

> +        if ( e == ~(paddr_t)0 )
> +        {
> +            e = n = ram_end;
> +        }
> +
> +        /* Avoid the xenheap */
> +        if ( s < ((xenheap_mfn_start+xenheap_pages) << PAGE_SHIFT)
> +             && (xenheap_mfn_start << PAGE_SHIFT) < e )
> +        {
> +            e = pfn_to_paddr(xenheap_mfn_start);
> +            n = pfn_to_paddr(xenheap_mfn_start+xenheap_pages);
> +        }
> +
> +        init_boot_pages(s, e);
> +
> +        s = n;
> +    }

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:07:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:07:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7Zi-00052U-St; Thu, 29 Nov 2012 17:06:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te7Zh-00052I-LA
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:06:57 +0000
Received: from [85.158.139.83:33164] by server-11.bemta-5.messagelabs.com id
	22/9F-03409-03697B05; Thu, 29 Nov 2012 17:06:56 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1354208798!27721125!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9414 invoked from network); 29 Nov 2012 17:06:39 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-5.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:06:39 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te7ZO-000M7s-CN; Thu, 29 Nov 2012 17:06:38 +0000
Date: Thu, 29 Nov 2012 17:06:38 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <ian.campbell@citrix.com>
Message-ID: <20121129170638.GG80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-6-git-send-email-ian.campbell@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352823804-28482-6-git-send-email-ian.campbell@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 06/12] arm: avoid allocating the heaps over
	modules or xen itself.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:23 +0000 on 13 Nov (1352823798), Ian Campbell wrote:
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
>  xen/arch/arm/setup.c |   89 +++++++++++++++++++++++++++++++++++++++++++------
>  1 files changed, 78 insertions(+), 11 deletions(-)
> 
> @@ -215,8 +260,30 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
>      copy_from_paddr(device_tree_flattened, dtb_paddr, dtb_size, BUFFERABLE);
>  
>      /* Add non-xenheap memory */
> -    init_boot_pages(pfn_to_paddr(xenheap_mfn_start + xenheap_pages),
> -                    pfn_to_paddr(xenheap_mfn_start + xenheap_pages + domheap_pages));
> +    s = ram_start;
> +    while ( s < ram_end )
> +    {
> +        paddr_t n = ram_end;
> +
> +        e = next_module(s, &n);

Does this DTRT if there's a module starting at exactly ram_start?

> +        if ( e == ~(paddr_t)0 )
> +        {
> +            e = n = ram_end;
> +        }
> +
> +        /* Avoid the xenheap */
> +        if ( s < ((xenheap_mfn_start+xenheap_pages) << PAGE_SHIFT)
> +             && (xenheap_mfn_start << PAGE_SHIFT) < e )
> +        {
> +            e = pfn_to_paddr(xenheap_mfn_start);
> +            n = pfn_to_paddr(xenheap_mfn_start+xenheap_pages);
> +        }
> +
> +        init_boot_pages(s, e);
> +
> +        s = n;
> +    }

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:10:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:10:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7cU-0005C5-Gd; Thu, 29 Nov 2012 17:09:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te7cS-0005By-Rm
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:09:48 +0000
Received: from [85.158.139.211:18641] by server-2.bemta-5.messagelabs.com id
	F7/6F-04892-BD697B05; Thu, 29 Nov 2012 17:09:47 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-5.tower-206.messagelabs.com!1354208987!18356100!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18512 invoked from network); 29 Nov 2012 17:09:47 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-5.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:09:47 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te7cQ-000M8W-P6; Thu, 29 Nov 2012 17:09:46 +0000
Date: Thu, 29 Nov 2012 17:09:46 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <ian.campbell@citrix.com>
Message-ID: <20121129170946.GH80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-8-git-send-email-ian.campbell@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352823804-28482-8-git-send-email-ian.campbell@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 08/12] device-tree: get_val cannot cope with
	cells > 2, add a BUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:23 +0000 on 13 Nov (1352823800), Ian Campbell wrote:
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
> v2: drop unrelated white space fixup
> ---
>  xen/common/device_tree.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index efd1663..7d3fd9f 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -45,6 +45,8 @@ static void __init get_val(const u32 **cell, u32 cells, u64 *val)
>  {
>      *val = 0;
>  
> +    BUG_ON( cells > 2 );
> +

If this is caused by a malformed DTB (rather than a Xen bug), I think
this should be an early_panic() or similar.

>      while ( cells-- )
>      {
>          *val <<= 32;
> -- 
> 1.7.9.1
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:10:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:10:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7cU-0005C5-Gd; Thu, 29 Nov 2012 17:09:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te7cS-0005By-Rm
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:09:48 +0000
Received: from [85.158.139.211:18641] by server-2.bemta-5.messagelabs.com id
	F7/6F-04892-BD697B05; Thu, 29 Nov 2012 17:09:47 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-5.tower-206.messagelabs.com!1354208987!18356100!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18512 invoked from network); 29 Nov 2012 17:09:47 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-5.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:09:47 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te7cQ-000M8W-P6; Thu, 29 Nov 2012 17:09:46 +0000
Date: Thu, 29 Nov 2012 17:09:46 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <ian.campbell@citrix.com>
Message-ID: <20121129170946.GH80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-8-git-send-email-ian.campbell@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352823804-28482-8-git-send-email-ian.campbell@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 08/12] device-tree: get_val cannot cope with
	cells > 2, add a BUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:23 +0000 on 13 Nov (1352823800), Ian Campbell wrote:
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
> v2: drop unrelated white space fixup
> ---
>  xen/common/device_tree.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index efd1663..7d3fd9f 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -45,6 +45,8 @@ static void __init get_val(const u32 **cell, u32 cells, u64 *val)
>  {
>      *val = 0;
>  
> +    BUG_ON( cells > 2 );
> +

If this is caused by a malformed DTB (rather than a Xen bug), I think
this should be an early_panic() or similar.

>      while ( cells-- )
>      {
>          *val <<= 32;
> -- 
> 1.7.9.1
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:14:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:14:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7gU-0005U6-A3; Thu, 29 Nov 2012 17:13:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te7gS-0005U1-Vi
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:13:57 +0000
Received: from [85.158.139.211:52232] by server-9.bemta-5.messagelabs.com id
	87/D0-29295-4D797B05; Thu, 29 Nov 2012 17:13:56 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1354209235!18453402!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16708 invoked from network); 29 Nov 2012 17:13:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:13:55 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076035"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:13:55 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 17:13:55 +0000
Message-ID: <1354209234.6269.48.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Thu, 29 Nov 2012 17:13:54 +0000
In-Reply-To: <20121129170501.GF80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-4-git-send-email-ian.campbell@citrix.com>
	<20121129170501.GF80627@ocelot.phlegethon.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Stefano Stabellini <stefano.stabellini@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 04/12] arm: parse modules from DT during
 early boot.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 17:05 +0000, Tim Deegan wrote:
> > +            cell = (const u32 *)prop->data;
> > +            device_tree_get_reg(&cell, address_cells, size_cells,
> > +                                &mod->start, &size);
> 
> This get_reg returns a start + size -- can/should we encode the module
> as one of these rather than encdong start + end separately and
> discarding the 'size' fields?

Interesting thought, I'm not enough of a DTB guru to know what the right
way to express this is (CCing Stefano :-))

This is trying to parse
/ {
	chosen { 
		module@1 {
			start = 0x80000000;
			end = 0x2000;
		}
	}
which is roughtly equivalent to how Linux bootloaders pass in initrds
(although the name etc differ)

I suspect using device_tree_get_reg as things stands is just plain
wrong, since the above things are not actually regs.

However you might be right that this should be expressed as

/ {
	chosen { 
		module@1 {
			address = <0x80000000 0x2000>;
		}
	}

and then I think using device_tree_get_reg would be correct.

Stefano -- does that make sense? is "address = < ... >" allowed or does
the thing have to be called reg?

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:14:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:14:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7gU-0005U6-A3; Thu, 29 Nov 2012 17:13:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te7gS-0005U1-Vi
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:13:57 +0000
Received: from [85.158.139.211:52232] by server-9.bemta-5.messagelabs.com id
	87/D0-29295-4D797B05; Thu, 29 Nov 2012 17:13:56 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1354209235!18453402!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16708 invoked from network); 29 Nov 2012 17:13:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:13:55 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076035"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:13:55 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 17:13:55 +0000
Message-ID: <1354209234.6269.48.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Thu, 29 Nov 2012 17:13:54 +0000
In-Reply-To: <20121129170501.GF80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-4-git-send-email-ian.campbell@citrix.com>
	<20121129170501.GF80627@ocelot.phlegethon.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Stefano Stabellini <stefano.stabellini@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 04/12] arm: parse modules from DT during
 early boot.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 17:05 +0000, Tim Deegan wrote:
> > +            cell = (const u32 *)prop->data;
> > +            device_tree_get_reg(&cell, address_cells, size_cells,
> > +                                &mod->start, &size);
> 
> This get_reg returns a start + size -- can/should we encode the module
> as one of these rather than encdong start + end separately and
> discarding the 'size' fields?

Interesting thought, I'm not enough of a DTB guru to know what the right
way to express this is (CCing Stefano :-))

This is trying to parse
/ {
	chosen { 
		module@1 {
			start = 0x80000000;
			end = 0x2000;
		}
	}
which is roughtly equivalent to how Linux bootloaders pass in initrds
(although the name etc differ)

I suspect using device_tree_get_reg as things stands is just plain
wrong, since the above things are not actually regs.

However you might be right that this should be expressed as

/ {
	chosen { 
		module@1 {
			address = <0x80000000 0x2000>;
		}
	}

and then I think using device_tree_get_reg would be correct.

Stefano -- does that make sense? is "address = < ... >" allowed or does
the thing have to be called reg?

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:14:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:14:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7hH-0005Y9-Uu; Thu, 29 Nov 2012 17:14:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te7hG-0005Xs-0q
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:14:46 +0000
Received: from [85.158.139.83:56492] by server-13.bemta-5.messagelabs.com id
	10/26-27809-50897B05; Thu, 29 Nov 2012 17:14:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1354209281!24973210!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1896 invoked from network); 29 Nov 2012 17:14:41 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:14:41 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076045"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:14:41 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 17:14:40 +0000
Message-ID: <1354209279.6269.49.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Thu, 29 Nov 2012 17:14:39 +0000
In-Reply-To: <20121129170946.GH80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-8-git-send-email-ian.campbell@citrix.com>
	<20121129170946.GH80627@ocelot.phlegethon.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 08/12] device-tree: get_val cannot cope with
 cells > 2, add a BUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 17:09 +0000, Tim Deegan wrote:
> At 16:23 +0000 on 13 Nov (1352823800), Ian Campbell wrote:
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > ---
> > v2: drop unrelated white space fixup
> > ---
> >  xen/common/device_tree.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> > index efd1663..7d3fd9f 100644
> > --- a/xen/common/device_tree.c
> > +++ b/xen/common/device_tree.c
> > @@ -45,6 +45,8 @@ static void __init get_val(const u32 **cell, u32 cells, u64 *val)
> >  {
> >      *val = 0;
> >  
> > +    BUG_ON( cells > 2 );
> > +
> 
> If this is caused by a malformed DTB (rather than a Xen bug), I think
> this should be an early_panic() or similar.

I agree, will change.

> 
> >      while ( cells-- )
> >      {
> >          *val <<= 32;
> > -- 
> > 1.7.9.1
> > 
> > 
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:14:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:14:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7hH-0005Y9-Uu; Thu, 29 Nov 2012 17:14:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te7hG-0005Xs-0q
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:14:46 +0000
Received: from [85.158.139.83:56492] by server-13.bemta-5.messagelabs.com id
	10/26-27809-50897B05; Thu, 29 Nov 2012 17:14:45 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1354209281!24973210!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1896 invoked from network); 29 Nov 2012 17:14:41 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:14:41 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076045"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:14:41 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 17:14:40 +0000
Message-ID: <1354209279.6269.49.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Thu, 29 Nov 2012 17:14:39 +0000
In-Reply-To: <20121129170946.GH80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-8-git-send-email-ian.campbell@citrix.com>
	<20121129170946.GH80627@ocelot.phlegethon.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 08/12] device-tree: get_val cannot cope with
 cells > 2, add a BUG
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 17:09 +0000, Tim Deegan wrote:
> At 16:23 +0000 on 13 Nov (1352823800), Ian Campbell wrote:
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > ---
> > v2: drop unrelated white space fixup
> > ---
> >  xen/common/device_tree.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> > index efd1663..7d3fd9f 100644
> > --- a/xen/common/device_tree.c
> > +++ b/xen/common/device_tree.c
> > @@ -45,6 +45,8 @@ static void __init get_val(const u32 **cell, u32 cells, u64 *val)
> >  {
> >      *val = 0;
> >  
> > +    BUG_ON( cells > 2 );
> > +
> 
> If this is caused by a malformed DTB (rather than a Xen bug), I think
> this should be an early_panic() or similar.

I agree, will change.

> 
> >      while ( cells-- )
> >      {
> >          *val <<= 32;
> > -- 
> > 1.7.9.1
> > 
> > 
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:15:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:15:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7i2-0005do-DE; Thu, 29 Nov 2012 17:15:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te7i0-0005dV-R0
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:15:33 +0000
Received: from [85.158.139.211:32254] by server-9.bemta-5.messagelabs.com id
	E8/24-29295-43897B05; Thu, 29 Nov 2012 17:15:32 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354209330!18434105!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23848 invoked from network); 29 Nov 2012 17:15:31 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:15:31 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te7hx-000MA2-NQ; Thu, 29 Nov 2012 17:15:29 +0000
Date: Thu, 29 Nov 2012 17:15:29 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <ian.campbell@citrix.com>
Message-ID: <20121129171529.GI80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-9-git-send-email-ian.campbell@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352823804-28482-9-git-send-email-ian.campbell@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 09/12] arm: load dom0 kernel from first boot
	module
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:23 +0000 on 13 Nov (1352823801), Ian Campbell wrote:
> -static int kernel_try_zimage_prepare(struct kernel_info *info)
> +static int kernel_try_zimage_prepare(struct kernel_info *info,
> +                                     paddr_t addr, paddr_t size)
>  {
>      uint32_t *zimage = (void *)FIXMAP_ADDR(FIXMAP_MISC);
>      uint32_t start, end;
>      struct minimal_dtb_header dtb_hdr;
>  
> -    set_fixmap(FIXMAP_MISC, KERNEL_FLASH_ADDRESS >> PAGE_SHIFT, DEV_SHARED);
> +    set_fixmap(FIXMAP_MISC, addr >> PAGE_SHIFT, DEV_SHARED);
> +
> +    zimage += addr & ~PAGE_MASK;
>  
>      if (zimage[ZIMAGE_MAGIC_OFFSET/4] != ZIMAGE_MAGIC)
> +    {
> +        clear_fixmap(FIXMAP_MISC);
>          return -EINVAL;
> +    }
>  
>      start = zimage[ZIMAGE_START_OFFSET/4];
>      end = zimage[ZIMAGE_END_OFFSET/4];
>  
>      clear_fixmap(FIXMAP_MISC);
>  
> +    if ( end > addr + size )
> +        return -EINVAL;

Should this also check for start == 0 && end > size?

>  int kernel_prepare(struct kernel_info *info)
>  {
>      int rc;
>  
> -    rc = kernel_try_zimage_prepare(info);
> +    paddr_t start, size;
> +
> +    if ( early_info.modules.nr_mods > 1 )
> +        panic("Cannot handle dom0 initrd yet\n");
> +
> +    if ( early_info.modules.nr_mods < 1 )
> +    {
> +        printk("No boot modules found, trying flash\n");
> +        start = KERNEL_FLASH_ADDRESS;
> +        size = KERNEL_FLASH_SIZE;
> +    }
> +    else
> +    {
> +        printk("Loading kernel from boot module 1\n");
> +        start = early_info.modules.module[1].start;
> +        size = early_info.modules.module[1].size;

Do we want (here or elsewhere) to check that start is page-aligned?

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:15:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:15:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7i2-0005do-DE; Thu, 29 Nov 2012 17:15:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te7i0-0005dV-R0
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:15:33 +0000
Received: from [85.158.139.211:32254] by server-9.bemta-5.messagelabs.com id
	E8/24-29295-43897B05; Thu, 29 Nov 2012 17:15:32 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354209330!18434105!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23848 invoked from network); 29 Nov 2012 17:15:31 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:15:31 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te7hx-000MA2-NQ; Thu, 29 Nov 2012 17:15:29 +0000
Date: Thu, 29 Nov 2012 17:15:29 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <ian.campbell@citrix.com>
Message-ID: <20121129171529.GI80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-9-git-send-email-ian.campbell@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352823804-28482-9-git-send-email-ian.campbell@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 09/12] arm: load dom0 kernel from first boot
	module
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 16:23 +0000 on 13 Nov (1352823801), Ian Campbell wrote:
> -static int kernel_try_zimage_prepare(struct kernel_info *info)
> +static int kernel_try_zimage_prepare(struct kernel_info *info,
> +                                     paddr_t addr, paddr_t size)
>  {
>      uint32_t *zimage = (void *)FIXMAP_ADDR(FIXMAP_MISC);
>      uint32_t start, end;
>      struct minimal_dtb_header dtb_hdr;
>  
> -    set_fixmap(FIXMAP_MISC, KERNEL_FLASH_ADDRESS >> PAGE_SHIFT, DEV_SHARED);
> +    set_fixmap(FIXMAP_MISC, addr >> PAGE_SHIFT, DEV_SHARED);
> +
> +    zimage += addr & ~PAGE_MASK;
>  
>      if (zimage[ZIMAGE_MAGIC_OFFSET/4] != ZIMAGE_MAGIC)
> +    {
> +        clear_fixmap(FIXMAP_MISC);
>          return -EINVAL;
> +    }
>  
>      start = zimage[ZIMAGE_START_OFFSET/4];
>      end = zimage[ZIMAGE_END_OFFSET/4];
>  
>      clear_fixmap(FIXMAP_MISC);
>  
> +    if ( end > addr + size )
> +        return -EINVAL;

Should this also check for start == 0 && end > size?

>  int kernel_prepare(struct kernel_info *info)
>  {
>      int rc;
>  
> -    rc = kernel_try_zimage_prepare(info);
> +    paddr_t start, size;
> +
> +    if ( early_info.modules.nr_mods > 1 )
> +        panic("Cannot handle dom0 initrd yet\n");
> +
> +    if ( early_info.modules.nr_mods < 1 )
> +    {
> +        printk("No boot modules found, trying flash\n");
> +        start = KERNEL_FLASH_ADDRESS;
> +        size = KERNEL_FLASH_SIZE;
> +    }
> +    else
> +    {
> +        printk("Loading kernel from boot module 1\n");
> +        start = early_info.modules.module[1].start;
> +        size = early_info.modules.module[1].size;

Do we want (here or elsewhere) to check that start is page-aligned?

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:18:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:18:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7kE-0005pB-2s; Thu, 29 Nov 2012 17:17:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Te7kD-0005p1-8p
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 17:17:49 +0000
Received: from [85.158.137.99:33638] by server-15.bemta-3.messagelabs.com id
	6E/BE-23779-CB897B05; Thu, 29 Nov 2012 17:17:48 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354209467!17228929!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24420 invoked from network); 29 Nov 2012 17:17:48 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:17:48 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076096"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:17:11 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 29 Nov 2012 17:17:11 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Te7ja-0007Y6-L8; Thu, 29 Nov 2012 17:17:10 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Te7ja-00088c-GU;
	Thu, 29 Nov 2012 17:17:10 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20663.39062.414369.750882@mariner.uk.xensource.com>
Date: Thu, 29 Nov 2012 17:17:10 +0000
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1354029827.17985.56.camel@zakaz.uk.xensource.com>
References: <alpine.DEB.2.02.1211271511520.5310@kaball.uk.xensource.com>
	<1354029827.17985.56.camel@zakaz.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] libxl: use qemu-xen (upstream QEMU) as
 device model by default
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("Re: [Xen-devel] [PATCH] libxl: use qemu-xen (upstream QEMU) as device model by default"):
> Is the test system prepared for this change?
> 
> Unless someone tells me otherwise I'm going to leave this one to Ian J
> to apply when the ducks are all in the appropriate rows.

Something filled up a disk so I'm still waiting for the necessary push...

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:18:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:18:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7kE-0005pB-2s; Thu, 29 Nov 2012 17:17:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Te7kD-0005p1-8p
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 17:17:49 +0000
Received: from [85.158.137.99:33638] by server-15.bemta-3.messagelabs.com id
	6E/BE-23779-CB897B05; Thu, 29 Nov 2012 17:17:48 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354209467!17228929!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24420 invoked from network); 29 Nov 2012 17:17:48 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:17:48 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076096"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:17:11 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 29 Nov 2012 17:17:11 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Te7ja-0007Y6-L8; Thu, 29 Nov 2012 17:17:10 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Te7ja-00088c-GU;
	Thu, 29 Nov 2012 17:17:10 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20663.39062.414369.750882@mariner.uk.xensource.com>
Date: Thu, 29 Nov 2012 17:17:10 +0000
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1354029827.17985.56.camel@zakaz.uk.xensource.com>
References: <alpine.DEB.2.02.1211271511520.5310@kaball.uk.xensource.com>
	<1354029827.17985.56.camel@zakaz.uk.xensource.com>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] libxl: use qemu-xen (upstream QEMU) as
 device model by default
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell writes ("Re: [Xen-devel] [PATCH] libxl: use qemu-xen (upstream QEMU) as device model by default"):
> Is the test system prepared for this change?
> 
> Unless someone tells me otherwise I'm going to leave this one to Ian J
> to apply when the ducks are all in the appropriate rows.

Something filled up a disk so I'm still waiting for the necessary push...

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:19:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:19:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7ld-0005xD-Iw; Thu, 29 Nov 2012 17:19:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te7lc-0005x3-9U
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:19:16 +0000
Received: from [85.158.143.99:52847] by server-3.bemta-4.messagelabs.com id
	6F/B6-06841-31997B05; Thu, 29 Nov 2012 17:19:15 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1354209554!17761221!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24496 invoked from network); 29 Nov 2012 17:19:15 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:19:15 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076144"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:19:15 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 17:19:14 +0000
Message-ID: <1354209553.6269.51.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Thu, 29 Nov 2012 17:19:13 +0000
In-Reply-To: <20121129170638.GG80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-6-git-send-email-ian.campbell@citrix.com>
	<20121129170638.GG80627@ocelot.phlegethon.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 06/12] arm: avoid allocating the heaps over
 modules or xen itself.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 17:06 +0000, Tim Deegan wrote:
> At 16:23 +0000 on 13 Nov (1352823798), Ian Campbell wrote:
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > ---
> >  xen/arch/arm/setup.c |   89 +++++++++++++++++++++++++++++++++++++++++++------
> >  1 files changed, 78 insertions(+), 11 deletions(-)
> > 
> > @@ -215,8 +260,30 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
> >      copy_from_paddr(device_tree_flattened, dtb_paddr, dtb_size, BUFFERABLE);
> >  
> >      /* Add non-xenheap memory */
> > -    init_boot_pages(pfn_to_paddr(xenheap_mfn_start + xenheap_pages),
> > -                    pfn_to_paddr(xenheap_mfn_start + xenheap_pages + domheap_pages));
> > +    s = ram_start;
> > +    while ( s < ram_end )
> > +    {
> > +        paddr_t n = ram_end;
> > +
> > +        e = next_module(s, &n);
> 
> Does this DTRT if there's a module starting at exactly ram_start?

I should probably try it...

I think in this case next_module will return the start of that module,
so e = s, and it will also set n to the end of the module.

init_boot_pages does the right thing if e <= s (i.e. ignores it) and
then we do s = n (so s = module_end) and keep going.

So I think it works?

> 
> > +        if ( e == ~(paddr_t)0 )
> > +        {
> > +            e = n = ram_end;
> > +        }
> > +
> > +        /* Avoid the xenheap */
> > +        if ( s < ((xenheap_mfn_start+xenheap_pages) << PAGE_SHIFT)
> > +             && (xenheap_mfn_start << PAGE_SHIFT) < e )
> > +        {
> > +            e = pfn_to_paddr(xenheap_mfn_start);
> > +            n = pfn_to_paddr(xenheap_mfn_start+xenheap_pages);
> > +        }
> > +
> > +        init_boot_pages(s, e);
> > +
> > +        s = n;
> > +    }



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:19:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:19:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7ld-0005xD-Iw; Thu, 29 Nov 2012 17:19:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te7lc-0005x3-9U
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:19:16 +0000
Received: from [85.158.143.99:52847] by server-3.bemta-4.messagelabs.com id
	6F/B6-06841-31997B05; Thu, 29 Nov 2012 17:19:15 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1354209554!17761221!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24496 invoked from network); 29 Nov 2012 17:19:15 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:19:15 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076144"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:19:15 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 17:19:14 +0000
Message-ID: <1354209553.6269.51.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Thu, 29 Nov 2012 17:19:13 +0000
In-Reply-To: <20121129170638.GG80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-6-git-send-email-ian.campbell@citrix.com>
	<20121129170638.GG80627@ocelot.phlegethon.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 06/12] arm: avoid allocating the heaps over
 modules or xen itself.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 17:06 +0000, Tim Deegan wrote:
> At 16:23 +0000 on 13 Nov (1352823798), Ian Campbell wrote:
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > ---
> >  xen/arch/arm/setup.c |   89 +++++++++++++++++++++++++++++++++++++++++++------
> >  1 files changed, 78 insertions(+), 11 deletions(-)
> > 
> > @@ -215,8 +260,30 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
> >      copy_from_paddr(device_tree_flattened, dtb_paddr, dtb_size, BUFFERABLE);
> >  
> >      /* Add non-xenheap memory */
> > -    init_boot_pages(pfn_to_paddr(xenheap_mfn_start + xenheap_pages),
> > -                    pfn_to_paddr(xenheap_mfn_start + xenheap_pages + domheap_pages));
> > +    s = ram_start;
> > +    while ( s < ram_end )
> > +    {
> > +        paddr_t n = ram_end;
> > +
> > +        e = next_module(s, &n);
> 
> Does this DTRT if there's a module starting at exactly ram_start?

I should probably try it...

I think in this case next_module will return the start of that module,
so e = s, and it will also set n to the end of the module.

init_boot_pages does the right thing if e <= s (i.e. ignores it) and
then we do s = n (so s = module_end) and keep going.

So I think it works?

> 
> > +        if ( e == ~(paddr_t)0 )
> > +        {
> > +            e = n = ram_end;
> > +        }
> > +
> > +        /* Avoid the xenheap */
> > +        if ( s < ((xenheap_mfn_start+xenheap_pages) << PAGE_SHIFT)
> > +             && (xenheap_mfn_start << PAGE_SHIFT) < e )
> > +        {
> > +            e = pfn_to_paddr(xenheap_mfn_start);
> > +            n = pfn_to_paddr(xenheap_mfn_start+xenheap_pages);
> > +        }
> > +
> > +        init_boot_pages(s, e);
> > +
> > +        s = n;
> > +    }



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:19:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:19:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7lv-00060Q-5Q; Thu, 29 Nov 2012 17:19:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1Te7lt-0005zy-C7; Thu, 29 Nov 2012 17:19:33 +0000
Received: from [85.158.143.99:53568] by server-1.bemta-4.messagelabs.com id
	5A/41-27934-42997B05; Thu, 29 Nov 2012 17:19:32 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354209572!22143406!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29913 invoked from network); 29 Nov 2012 17:19:32 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:19:32 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076150"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:19:32 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Thu, 29 Nov 2012
	17:19:32 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Thu, 29 Nov 2012 17:19:32 +0000
Thread-Topic: [Xen-devel] [PATCH 08 of 15] libxl/ocaml: add some more
	builtin	types
Thread-Index: Ac3HRACIgurNi7QgRKuZOtCHTIk29gHDwOFA
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107B0@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<21c5e58956d09437903e.1353432208@cosworth.uk.xensource.com>
In-Reply-To: <21c5e58956d09437903e.1353432208@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 08 of 15] libxl/ocaml: add some more
	builtin	types
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> 21c5e58956d09437903e1ee1b0588d61a7c28145
> # Parent  0cf342afa9e6b506fad68346cb3a1207030372eb
> libxl/ocaml: add some more builtin types.
> 
>   * bitmaps
>   * string_list
>   * cpuid_policy_list (actually opaque)
>   * key_value_list
> 
> None of these are used yet, so no change to the generated code.
> 
> Bitmap_val requires a ctx, so leave it as an abort for now.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 
> diff -r 0cf342afa9e6 -r 21c5e58956d0 tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -13,9 +13,13 @@ builtins = {
>      "libxl_devid":          ("devid",                  "%(c)s = Int_val(%(o)s)",
> "Val_int(%(c)s)"  ),
>      "libxl_defbool":        ("bool option",            "%(c)s = Defbool_val(%(o)s)",
> "Val_defbool(%(c)s)" ),
>      "libxl_uuid":           ("int array",              "Uuid_val(gc, lg, &%(c)s, %(o)s)",
> "Val_uuid(&%(c)s)"),
> -    "libxl_key_value_list": ("(string * string) list", None,
> None),
> +    "libxl_bitmap":         ("bool array",             "Bitmap_val(gc, lg,
> &%(c)s, %(o)s)",   "Val_bitmap(&%(c)s)"),
> +    "libxl_key_value_list": ("(string * string) list",
> "libxl_key_value_list_val(gc, lg, &%(c)s, %(o)s)",                              None),
> +    "libxl_string_list":    ("string list",            "libxl_string_list_val(gc, lg,
> &%(c)s, %(o)s)",                                 "String_list_val(gc, lg, &%(c)s, %(o)s)"),
>      "libxl_mac":            ("int array",              "Mac_val(gc, lg, &%(c)s, %(o)s)",
> "Val_mac(&%(c)s)"),
>      "libxl_hwcap":          ("int32 array",            None,
> "Val_hwcap(&%(c)s)"),
> +    # This is an opaque type
> +    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(gc,
> lg, &%(c)s, %(o)s)",   "Val_cpuid_policy_list(&%(c)s)"),
>      }
> 
>  DEVICE_FUNCTIONS = [ ("add",            ["t", "domid", "unit"]),
> diff -r 0cf342afa9e6 -r 21c5e58956d0 tools/ocaml/libs/xl/xenlight.ml.in
> --- a/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012
> +0000
> @@ -18,6 +18,10 @@ exception Error of string  type domid = int  type devid
> = int
> 
> +module Cpuid_policy = struct
> +	type t
> +end
> +

Do you expect this type to become more complicated, or non-opaque, in future? Or would it have functions associated with it like for the devices? If not, perhaps we can use a simpler type definition:

type cpuid_policy_list

>  (* @@LIBXL_TYPES@@ *)
> 
>  external send_trigger : domid -> trigger -> int -> unit =
> "stub_xl_send_trigger"
> diff -r 0cf342afa9e6 -r 21c5e58956d0 tools/ocaml/libs/xl/xenlight_stubs.c
> --- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012
> +0000
> @@ -27,6 +27,7 @@
>  #include <string.h>
> 
>  #include <libxl.h>
> +#include <libxl_utils.h>
> 
>  struct caml_logger {
>  	struct xentoollog_logger logger;
> @@ -96,7 +97,6 @@ static void failwith_xl(char *fname, str
>  	caml_raise_with_string(*caml_named_value("xl.error"), s);  }
> 
> -#if 0 /* TODO: wrap libxl_domain_create(), these functions will be needed
> then */  static void * gc_calloc(caml_gc *gc, size_t nmemb, size_t size)  {
>  	void *ptr;
> @@ -107,28 +107,62 @@ static void * gc_calloc(caml_gc *gc, siz
>  	return ptr;
>  }
> 
> -static int string_string_tuple_array_val (caml_gc *gc, char ***c_val, value v)
> +static int list_len(value v)
> +{
> +	int len = 0;
> +	while ( v != Val_emptylist ) {
> +		len++;
> +		v = Field(v, 1);
> +	}
> +	return len;
> +}
> +

It is probably best to use CAMLparam1(v) and CAMLreturn(len) here, just in case.

> +static int libxl_key_value_list_val(caml_gc *gc, struct caml_logger *lg,
> +				    libxl_key_value_list *c_val,
> +				    value v)
>  {
>  	CAMLparam1(v);
> -	CAMLlocal1(a);
> -	int i;
> -	char **array;
> +	CAMLlocal1(elem);
> +	int nr, i;
> +	libxl_key_value_list array;
> 
> -	for (i = 0, a = Field(v, 5); a != Val_emptylist; a = Field(a, 1)) { i++; }
> +	nr = list_len(v);
> 
> -	array = gc_calloc(gc, (i + 1) * 2, sizeof(char *));
> +	array = gc_calloc(gc, (nr + 1) * 2, sizeof(char *));
>  	if (!array)
> -		return 1;
> -	for (i = 0, a = Field(v, 5); a != Val_emptylist; a = Field(a, 1), i++) {
> -		value b = Field(a, 0);
> -		array[i * 2] = dup_String_val(gc, Field(b, 0));
> -		array[i * 2 + 1] = dup_String_val(gc, Field(b, 1));
> +		caml_raise_out_of_memory();
> +
> +	for (i=0; v != Val_emptylist; i++, v = Field(v, 1) ) {
> +		elem = Field(v, 0);
> +
> +		array[i * 2] = dup_String_val(gc, Field(elem, 0));
> +		array[i * 2 + 1] = dup_String_val(gc, Field(elem, 1));
>  	}
> +
>  	*c_val = array;
>  	CAMLreturn(0);
>  }
> 
> -#endif
> +static int libxl_string_list_val(caml_gc *gc, struct caml_logger *lg,
> +				 libxl_string_list *c_val,
> +				 value v)
> +{
> +	CAMLparam1(v);
> +	int nr, i;
> +	libxl_key_value_list array;

This should probably be a libxl_string_list.

> +
> +	nr = list_len(v);
> +
> +	array = gc_calloc(gc, (nr + 1), sizeof(char *));
> +	if (!array)
> +		caml_raise_out_of_memory();
> +
> +	for (i=0; v != Val_emptylist; i++, v = Field(v, 1) )
> +		array[i] = dup_String_val(gc, Field(v, 0));
> +
> +	*c_val = array;
> +	CAMLreturn(0);
> +}
> 
>  /* Option type support as per http://www.linux-
> nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php */  #define Val_none
> Val_int(0) @@ -168,6 +202,45 @@ static int Mac_val(caml_gc *gc, struct c
>  	CAMLreturn(0);
>  }
> 
> +static value Val_bitmap (libxl_bitmap *c_val) {
> +	CAMLparam0();
> +	CAMLlocal1(v);
> +	int i;
> +
> +	v = caml_alloc(8 * (c_val->size), 0);
> +	libxl_for_each_bit(i, *c_val) {
> +		if (libxl_bitmap_test(c_val, i))
> +			Store_field(v, i, Val_true);
> +		else
> +			Store_field(v, i, Val_false);
> +	}
> +	CAMLreturn(v);
> +}
> +
> +static int Bitmap_val(caml_gc *gc, struct caml_logger *lg,
> +		      libxl_bitmap *c_val, value v)
> +{
> +	abort(); /* XXX */
> +}
> +
> +static value Val_cpuid_policy_list(libxl_cpuid_policy_list *c_val) {
> +	CAMLparam0();
> +	/* An opaque pointer */
> +	CAMLreturn((value)c_val);
> +}
> +
> +static int Cpuid_policy_list_val(caml_gc *gc, struct caml_logger *lg,
> +				 libxl_cpuid_policy_list **c_val, value v) {
> +	CAMLparam1(v);
> +
> +	/* An opaque pointer */
> +	*c_val = (libxl_cpuid_policy_list*)v;
> +	CAMLreturn(0);
> +}
> +
>  static value Val_uuid (libxl_uuid *c_val)  {
>  	CAMLparam0();

For the rest it looks good to me.

Cheers,
Rob


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:19:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:19:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7lv-00060Q-5Q; Thu, 29 Nov 2012 17:19:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1Te7lt-0005zy-C7; Thu, 29 Nov 2012 17:19:33 +0000
Received: from [85.158.143.99:53568] by server-1.bemta-4.messagelabs.com id
	5A/41-27934-42997B05; Thu, 29 Nov 2012 17:19:32 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354209572!22143406!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29913 invoked from network); 29 Nov 2012 17:19:32 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:19:32 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076150"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:19:32 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Thu, 29 Nov 2012
	17:19:32 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Thu, 29 Nov 2012 17:19:32 +0000
Thread-Topic: [Xen-devel] [PATCH 08 of 15] libxl/ocaml: add some more
	builtin	types
Thread-Index: Ac3HRACIgurNi7QgRKuZOtCHTIk29gHDwOFA
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107B0@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<21c5e58956d09437903e.1353432208@cosworth.uk.xensource.com>
In-Reply-To: <21c5e58956d09437903e.1353432208@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 08 of 15] libxl/ocaml: add some more
	builtin	types
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> 21c5e58956d09437903e1ee1b0588d61a7c28145
> # Parent  0cf342afa9e6b506fad68346cb3a1207030372eb
> libxl/ocaml: add some more builtin types.
> 
>   * bitmaps
>   * string_list
>   * cpuid_policy_list (actually opaque)
>   * key_value_list
> 
> None of these are used yet, so no change to the generated code.
> 
> Bitmap_val requires a ctx, so leave it as an abort for now.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 
> diff -r 0cf342afa9e6 -r 21c5e58956d0 tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -13,9 +13,13 @@ builtins = {
>      "libxl_devid":          ("devid",                  "%(c)s = Int_val(%(o)s)",
> "Val_int(%(c)s)"  ),
>      "libxl_defbool":        ("bool option",            "%(c)s = Defbool_val(%(o)s)",
> "Val_defbool(%(c)s)" ),
>      "libxl_uuid":           ("int array",              "Uuid_val(gc, lg, &%(c)s, %(o)s)",
> "Val_uuid(&%(c)s)"),
> -    "libxl_key_value_list": ("(string * string) list", None,
> None),
> +    "libxl_bitmap":         ("bool array",             "Bitmap_val(gc, lg,
> &%(c)s, %(o)s)",   "Val_bitmap(&%(c)s)"),
> +    "libxl_key_value_list": ("(string * string) list",
> "libxl_key_value_list_val(gc, lg, &%(c)s, %(o)s)",                              None),
> +    "libxl_string_list":    ("string list",            "libxl_string_list_val(gc, lg,
> &%(c)s, %(o)s)",                                 "String_list_val(gc, lg, &%(c)s, %(o)s)"),
>      "libxl_mac":            ("int array",              "Mac_val(gc, lg, &%(c)s, %(o)s)",
> "Val_mac(&%(c)s)"),
>      "libxl_hwcap":          ("int32 array",            None,
> "Val_hwcap(&%(c)s)"),
> +    # This is an opaque type
> +    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(gc,
> lg, &%(c)s, %(o)s)",   "Val_cpuid_policy_list(&%(c)s)"),
>      }
> 
>  DEVICE_FUNCTIONS = [ ("add",            ["t", "domid", "unit"]),
> diff -r 0cf342afa9e6 -r 21c5e58956d0 tools/ocaml/libs/xl/xenlight.ml.in
> --- a/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012
> +0000
> @@ -18,6 +18,10 @@ exception Error of string  type domid = int  type devid
> = int
> 
> +module Cpuid_policy = struct
> +	type t
> +end
> +

Do you expect this type to become more complicated, or non-opaque, in future? Or would it have functions associated with it like for the devices? If not, perhaps we can use a simpler type definition:

type cpuid_policy_list

>  (* @@LIBXL_TYPES@@ *)
> 
>  external send_trigger : domid -> trigger -> int -> unit =
> "stub_xl_send_trigger"
> diff -r 0cf342afa9e6 -r 21c5e58956d0 tools/ocaml/libs/xl/xenlight_stubs.c
> --- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012
> +0000
> @@ -27,6 +27,7 @@
>  #include <string.h>
> 
>  #include <libxl.h>
> +#include <libxl_utils.h>
> 
>  struct caml_logger {
>  	struct xentoollog_logger logger;
> @@ -96,7 +97,6 @@ static void failwith_xl(char *fname, str
>  	caml_raise_with_string(*caml_named_value("xl.error"), s);  }
> 
> -#if 0 /* TODO: wrap libxl_domain_create(), these functions will be needed
> then */  static void * gc_calloc(caml_gc *gc, size_t nmemb, size_t size)  {
>  	void *ptr;
> @@ -107,28 +107,62 @@ static void * gc_calloc(caml_gc *gc, siz
>  	return ptr;
>  }
> 
> -static int string_string_tuple_array_val (caml_gc *gc, char ***c_val, value v)
> +static int list_len(value v)
> +{
> +	int len = 0;
> +	while ( v != Val_emptylist ) {
> +		len++;
> +		v = Field(v, 1);
> +	}
> +	return len;
> +}
> +

It is probably best to use CAMLparam1(v) and CAMLreturn(len) here, just in case.

> +static int libxl_key_value_list_val(caml_gc *gc, struct caml_logger *lg,
> +				    libxl_key_value_list *c_val,
> +				    value v)
>  {
>  	CAMLparam1(v);
> -	CAMLlocal1(a);
> -	int i;
> -	char **array;
> +	CAMLlocal1(elem);
> +	int nr, i;
> +	libxl_key_value_list array;
> 
> -	for (i = 0, a = Field(v, 5); a != Val_emptylist; a = Field(a, 1)) { i++; }
> +	nr = list_len(v);
> 
> -	array = gc_calloc(gc, (i + 1) * 2, sizeof(char *));
> +	array = gc_calloc(gc, (nr + 1) * 2, sizeof(char *));
>  	if (!array)
> -		return 1;
> -	for (i = 0, a = Field(v, 5); a != Val_emptylist; a = Field(a, 1), i++) {
> -		value b = Field(a, 0);
> -		array[i * 2] = dup_String_val(gc, Field(b, 0));
> -		array[i * 2 + 1] = dup_String_val(gc, Field(b, 1));
> +		caml_raise_out_of_memory();
> +
> +	for (i=0; v != Val_emptylist; i++, v = Field(v, 1) ) {
> +		elem = Field(v, 0);
> +
> +		array[i * 2] = dup_String_val(gc, Field(elem, 0));
> +		array[i * 2 + 1] = dup_String_val(gc, Field(elem, 1));
>  	}
> +
>  	*c_val = array;
>  	CAMLreturn(0);
>  }
> 
> -#endif
> +static int libxl_string_list_val(caml_gc *gc, struct caml_logger *lg,
> +				 libxl_string_list *c_val,
> +				 value v)
> +{
> +	CAMLparam1(v);
> +	int nr, i;
> +	libxl_key_value_list array;

This should probably be a libxl_string_list.

> +
> +	nr = list_len(v);
> +
> +	array = gc_calloc(gc, (nr + 1), sizeof(char *));
> +	if (!array)
> +		caml_raise_out_of_memory();
> +
> +	for (i=0; v != Val_emptylist; i++, v = Field(v, 1) )
> +		array[i] = dup_String_val(gc, Field(v, 0));
> +
> +	*c_val = array;
> +	CAMLreturn(0);
> +}
> 
>  /* Option type support as per http://www.linux-
> nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php */  #define Val_none
> Val_int(0) @@ -168,6 +202,45 @@ static int Mac_val(caml_gc *gc, struct c
>  	CAMLreturn(0);
>  }
> 
> +static value Val_bitmap (libxl_bitmap *c_val) {
> +	CAMLparam0();
> +	CAMLlocal1(v);
> +	int i;
> +
> +	v = caml_alloc(8 * (c_val->size), 0);
> +	libxl_for_each_bit(i, *c_val) {
> +		if (libxl_bitmap_test(c_val, i))
> +			Store_field(v, i, Val_true);
> +		else
> +			Store_field(v, i, Val_false);
> +	}
> +	CAMLreturn(v);
> +}
> +
> +static int Bitmap_val(caml_gc *gc, struct caml_logger *lg,
> +		      libxl_bitmap *c_val, value v)
> +{
> +	abort(); /* XXX */
> +}
> +
> +static value Val_cpuid_policy_list(libxl_cpuid_policy_list *c_val) {
> +	CAMLparam0();
> +	/* An opaque pointer */
> +	CAMLreturn((value)c_val);
> +}
> +
> +static int Cpuid_policy_list_val(caml_gc *gc, struct caml_logger *lg,
> +				 libxl_cpuid_policy_list **c_val, value v) {
> +	CAMLparam1(v);
> +
> +	/* An opaque pointer */
> +	*c_val = (libxl_cpuid_policy_list*)v;
> +	CAMLreturn(0);
> +}
> +
>  static value Val_uuid (libxl_uuid *c_val)  {
>  	CAMLparam0();

For the rest it looks good to me.

Cheers,
Rob


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:20:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:20:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7mu-0006Cx-1B; Thu, 29 Nov 2012 17:20:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1Te7ms-0006CI-6a; Thu, 29 Nov 2012 17:20:34 +0000
Received: from [85.158.139.211:8262] by server-8.bemta-5.messagelabs.com id
	8D/F0-06050-16997B05; Thu, 29 Nov 2012 17:20:33 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1354209631!18364997!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7309 invoked from network); 29 Nov 2012 17:20:32 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:20:32 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076177"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:20:31 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Thu, 29 Nov 2012
	17:20:32 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Thu, 29 Nov 2012 17:20:31 +0000
Thread-Topic: [Xen-devel] [PATCH 09 of 15] libxl/ocaml: add
	domain_build/create_info and events to the bindings
Thread-Index: Ac3HRAL+QzYO6agDSU2yXftqv4L2mAHEcP8A
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107B1@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<5173d29f64fa541f6ec0.1353432209@cosworth.uk.xensource.com>
In-Reply-To: <5173d29f64fa541f6ec0.1353432209@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 09 of 15] libxl/ocaml: add
 domain_build/create_info and events to the bindings
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> 5173d29f64fa541f6ec0c48481c4957a03f0302c
> # Parent  21c5e58956d09437903e1ee1b0588d61a7c28145
> libxl/ocaml: add domain_build/create_info and events to the bindings.
> 
> We now have enoguh infrastructure in place to do this trivially.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Looks good.

Acked-by: Rob Hoes <rob.hoes@citrix.com>

> diff -r 21c5e58956d0 -r 5173d29f64fa tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -19,7 +19,7 @@ builtins = {
>      "libxl_mac":            ("int array",              "Mac_val(gc, lg, &%(c)s, %(o)s)",
> "Val_mac(&%(c)s)"),
>      "libxl_hwcap":          ("int32 array",            None,
> "Val_hwcap(&%(c)s)"),
>      # This is an opaque type
> -    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(gc,
> lg, &%(c)s, %(o)s)",   "Val_cpuid_policy_list(&%(c)s)"),
> +    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(gc,
> lg, &%(c)s, %(o)s)",   "Val_cpuid_policy_list(%(c)s)"),
>      }
> 
>  DEVICE_FUNCTIONS = [ ("add",            ["t", "domid", "unit"]),
> @@ -420,11 +420,8 @@ if __name__ == '__main__':
>      # Do not generate these yet.
>      blacklist = [
>          "cpupoolinfo",
> -        "domain_create_info",
> -        "domain_build_info",
>          "domain_config",
>          "vcpuinfo",
> -        "event",
>          ]
> 
>      for t in blacklist:
> diff -r 21c5e58956d0 -r 5173d29f64fa tools/ocaml/libs/xl/xenlight_stubs.c
> --- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012
> +0000
> @@ -224,7 +224,7 @@ static int Bitmap_val(caml_gc *gc, struc
>  	abort(); /* XXX */
>  }
> 
> -static value Val_cpuid_policy_list(libxl_cpuid_policy_list *c_val)
> +static value Val_cpuid_policy_list(libxl_cpuid_policy_list c_val)
>  {
>  	CAMLparam0();
>  	/* An opaque pointer */
> @@ -232,12 +232,13 @@ static value Val_cpuid_policy_list(libxl  }
> 
>  static int Cpuid_policy_list_val(caml_gc *gc, struct caml_logger *lg,
> -				 libxl_cpuid_policy_list **c_val, value v)
> +				 libxl_cpuid_policy_list *c_val, value v)
>  {
>  	CAMLparam1(v);
> 
>  	/* An opaque pointer */
> -	*c_val = (libxl_cpuid_policy_list*)v;
> +	*c_val = (libxl_cpuid_policy_list)v;
> +
>  	CAMLreturn(0);
>  }
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:20:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:20:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7mu-0006Cx-1B; Thu, 29 Nov 2012 17:20:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1Te7ms-0006CI-6a; Thu, 29 Nov 2012 17:20:34 +0000
Received: from [85.158.139.211:8262] by server-8.bemta-5.messagelabs.com id
	8D/F0-06050-16997B05; Thu, 29 Nov 2012 17:20:33 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1354209631!18364997!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7309 invoked from network); 29 Nov 2012 17:20:32 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:20:32 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076177"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:20:31 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Thu, 29 Nov 2012
	17:20:32 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Thu, 29 Nov 2012 17:20:31 +0000
Thread-Topic: [Xen-devel] [PATCH 09 of 15] libxl/ocaml: add
	domain_build/create_info and events to the bindings
Thread-Index: Ac3HRAL+QzYO6agDSU2yXftqv4L2mAHEcP8A
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107B1@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<5173d29f64fa541f6ec0.1353432209@cosworth.uk.xensource.com>
In-Reply-To: <5173d29f64fa541f6ec0.1353432209@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 09 of 15] libxl/ocaml: add
 domain_build/create_info and events to the bindings
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> 5173d29f64fa541f6ec0c48481c4957a03f0302c
> # Parent  21c5e58956d09437903e1ee1b0588d61a7c28145
> libxl/ocaml: add domain_build/create_info and events to the bindings.
> 
> We now have enoguh infrastructure in place to do this trivially.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Looks good.

Acked-by: Rob Hoes <rob.hoes@citrix.com>

> diff -r 21c5e58956d0 -r 5173d29f64fa tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -19,7 +19,7 @@ builtins = {
>      "libxl_mac":            ("int array",              "Mac_val(gc, lg, &%(c)s, %(o)s)",
> "Val_mac(&%(c)s)"),
>      "libxl_hwcap":          ("int32 array",            None,
> "Val_hwcap(&%(c)s)"),
>      # This is an opaque type
> -    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(gc,
> lg, &%(c)s, %(o)s)",   "Val_cpuid_policy_list(&%(c)s)"),
> +    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(gc,
> lg, &%(c)s, %(o)s)",   "Val_cpuid_policy_list(%(c)s)"),
>      }
> 
>  DEVICE_FUNCTIONS = [ ("add",            ["t", "domid", "unit"]),
> @@ -420,11 +420,8 @@ if __name__ == '__main__':
>      # Do not generate these yet.
>      blacklist = [
>          "cpupoolinfo",
> -        "domain_create_info",
> -        "domain_build_info",
>          "domain_config",
>          "vcpuinfo",
> -        "event",
>          ]
> 
>      for t in blacklist:
> diff -r 21c5e58956d0 -r 5173d29f64fa tools/ocaml/libs/xl/xenlight_stubs.c
> --- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012
> +0000
> @@ -224,7 +224,7 @@ static int Bitmap_val(caml_gc *gc, struc
>  	abort(); /* XXX */
>  }
> 
> -static value Val_cpuid_policy_list(libxl_cpuid_policy_list *c_val)
> +static value Val_cpuid_policy_list(libxl_cpuid_policy_list c_val)
>  {
>  	CAMLparam0();
>  	/* An opaque pointer */
> @@ -232,12 +232,13 @@ static value Val_cpuid_policy_list(libxl  }
> 
>  static int Cpuid_policy_list_val(caml_gc *gc, struct caml_logger *lg,
> -				 libxl_cpuid_policy_list **c_val, value v)
> +				 libxl_cpuid_policy_list *c_val, value v)
>  {
>  	CAMLparam1(v);
> 
>  	/* An opaque pointer */
> -	*c_val = (libxl_cpuid_policy_list*)v;
> +	*c_val = (libxl_cpuid_policy_list)v;
> +
>  	CAMLreturn(0);
>  }
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:25:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:25:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7r0-0006eq-Fn; Thu, 29 Nov 2012 17:24:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te7qz-0006eZ-Hu
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:24:49 +0000
Received: from [85.158.143.99:33077] by server-1.bemta-4.messagelabs.com id
	75/06-27934-06A97B05; Thu, 29 Nov 2012 17:24:48 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354209888!22143623!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12175 invoked from network); 29 Nov 2012 17:24:48 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:24:48 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076335"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:24:44 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 17:24:44 +0000
Message-ID: <1354209882.6269.55.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Thu, 29 Nov 2012 17:24:42 +0000
In-Reply-To: <20121129171529.GI80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-9-git-send-email-ian.campbell@citrix.com>
	<20121129171529.GI80627@ocelot.phlegethon.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 09/12] arm: load dom0 kernel from first boot
 module
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 17:15 +0000, Tim Deegan wrote:
> At 16:23 +0000 on 13 Nov (1352823801), Ian Campbell wrote:
> > -static int kernel_try_zimage_prepare(struct kernel_info *info)
> > +static int kernel_try_zimage_prepare(struct kernel_info *info,
> > +                                     paddr_t addr, paddr_t size)
> >  {
> >      uint32_t *zimage = (void *)FIXMAP_ADDR(FIXMAP_MISC);
> >      uint32_t start, end;
> >      struct minimal_dtb_header dtb_hdr;
> >  
> > -    set_fixmap(FIXMAP_MISC, KERNEL_FLASH_ADDRESS >> PAGE_SHIFT, DEV_SHARED);
> > +    set_fixmap(FIXMAP_MISC, addr >> PAGE_SHIFT, DEV_SHARED);
> > +
> > +    zimage += addr & ~PAGE_MASK;
> >  
> >      if (zimage[ZIMAGE_MAGIC_OFFSET/4] != ZIMAGE_MAGIC)
> > +    {
> > +        clear_fixmap(FIXMAP_MISC);
> >          return -EINVAL;
> > +    }
> >  
> >      start = zimage[ZIMAGE_START_OFFSET/4];
> >      end = zimage[ZIMAGE_END_OFFSET/4];
> >  
> >      clear_fixmap(FIXMAP_MISC);
> >  
> > +    if ( end > addr + size )
> > +        return -EINVAL;
> 
> Should this also check for start == 0 && end > size?

Possibly ought to be checking for (end - start) > size which covers
both?

Looking at it now comparing addr + size with end seems a bit nonsensical
since addr is where it is now and end is the end of where it would like
to be loaded (or the size if start == 0, which is what has saved us so
far).

> 
> >  int kernel_prepare(struct kernel_info *info)
> >  {
> >      int rc;
> >  
> > -    rc = kernel_try_zimage_prepare(info);
> > +    paddr_t start, size;
> > +
> > +    if ( early_info.modules.nr_mods > 1 )
> > +        panic("Cannot handle dom0 initrd yet\n");
> > +
> > +    if ( early_info.modules.nr_mods < 1 )
> > +    {
> > +        printk("No boot modules found, trying flash\n");
> > +        start = KERNEL_FLASH_ADDRESS;
> > +        size = KERNEL_FLASH_SIZE;
> > +    }
> > +    else
> > +    {
> > +        printk("Loading kernel from boot module 1\n");
> > +        start = early_info.modules.module[1].start;
> > +        size = early_info.modules.module[1].size;
> 
> Do we want (here or elsewhere) to check that start is page-aligned?

I think kernel_try_zimage_prepare tries to do the right thing

Although you've made me look and I suspect it is buggy if start is <
sizeof(zimage header) from the end of a page. It should probably just
use copy_from_paddr into a local buffer.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:25:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:25:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7r0-0006eq-Fn; Thu, 29 Nov 2012 17:24:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te7qz-0006eZ-Hu
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:24:49 +0000
Received: from [85.158.143.99:33077] by server-1.bemta-4.messagelabs.com id
	75/06-27934-06A97B05; Thu, 29 Nov 2012 17:24:48 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354209888!22143623!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12175 invoked from network); 29 Nov 2012 17:24:48 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:24:48 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076335"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:24:44 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 17:24:44 +0000
Message-ID: <1354209882.6269.55.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Thu, 29 Nov 2012 17:24:42 +0000
In-Reply-To: <20121129171529.GI80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-9-git-send-email-ian.campbell@citrix.com>
	<20121129171529.GI80627@ocelot.phlegethon.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 09/12] arm: load dom0 kernel from first boot
 module
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 17:15 +0000, Tim Deegan wrote:
> At 16:23 +0000 on 13 Nov (1352823801), Ian Campbell wrote:
> > -static int kernel_try_zimage_prepare(struct kernel_info *info)
> > +static int kernel_try_zimage_prepare(struct kernel_info *info,
> > +                                     paddr_t addr, paddr_t size)
> >  {
> >      uint32_t *zimage = (void *)FIXMAP_ADDR(FIXMAP_MISC);
> >      uint32_t start, end;
> >      struct minimal_dtb_header dtb_hdr;
> >  
> > -    set_fixmap(FIXMAP_MISC, KERNEL_FLASH_ADDRESS >> PAGE_SHIFT, DEV_SHARED);
> > +    set_fixmap(FIXMAP_MISC, addr >> PAGE_SHIFT, DEV_SHARED);
> > +
> > +    zimage += addr & ~PAGE_MASK;
> >  
> >      if (zimage[ZIMAGE_MAGIC_OFFSET/4] != ZIMAGE_MAGIC)
> > +    {
> > +        clear_fixmap(FIXMAP_MISC);
> >          return -EINVAL;
> > +    }
> >  
> >      start = zimage[ZIMAGE_START_OFFSET/4];
> >      end = zimage[ZIMAGE_END_OFFSET/4];
> >  
> >      clear_fixmap(FIXMAP_MISC);
> >  
> > +    if ( end > addr + size )
> > +        return -EINVAL;
> 
> Should this also check for start == 0 && end > size?

Possibly ought to be checking for (end - start) > size which covers
both?

Looking at it now comparing addr + size with end seems a bit nonsensical
since addr is where it is now and end is the end of where it would like
to be loaded (or the size if start == 0, which is what has saved us so
far).

> 
> >  int kernel_prepare(struct kernel_info *info)
> >  {
> >      int rc;
> >  
> > -    rc = kernel_try_zimage_prepare(info);
> > +    paddr_t start, size;
> > +
> > +    if ( early_info.modules.nr_mods > 1 )
> > +        panic("Cannot handle dom0 initrd yet\n");
> > +
> > +    if ( early_info.modules.nr_mods < 1 )
> > +    {
> > +        printk("No boot modules found, trying flash\n");
> > +        start = KERNEL_FLASH_ADDRESS;
> > +        size = KERNEL_FLASH_SIZE;
> > +    }
> > +    else
> > +    {
> > +        printk("Loading kernel from boot module 1\n");
> > +        start = early_info.modules.module[1].start;
> > +        size = early_info.modules.module[1].size;
> 
> Do we want (here or elsewhere) to check that start is page-aligned?

I think kernel_try_zimage_prepare tries to do the right thing

Although you've made me look and I suspect it is buggy if start is <
sizeof(zimage header) from the end of a page. It should probably just
use copy_from_paddr into a local buffer.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:32:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:32:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7xu-0007GG-Gx; Thu, 29 Nov 2012 17:31:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Te7xt-0007G0-0F
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:31:57 +0000
Received: from [85.158.138.51:16360] by server-5.bemta-3.messagelabs.com id
	D4/38-26311-C0C97B05; Thu, 29 Nov 2012 17:31:56 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1354210315!23162809!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22180 invoked from network); 29 Nov 2012 17:31:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:31:55 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076484"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:31:55 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 17:31:55 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>, <port-xen@netbsd.org>
Date: Thu, 29 Nov 2012 18:31:45 +0100
Message-ID: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
MIME-Version: 1.0
Subject: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The following series adds support for NetBSD gntdev to libxc, and 
makes libxl use Qemu as a disk backend if an image file stored on a 
remote filesystem is used.

Patch 2/3 is just a fix for the comment in function 
libxl__try_phy_backend.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:32:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:32:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7xu-0007GG-Gx; Thu, 29 Nov 2012 17:31:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Te7xt-0007G0-0F
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:31:57 +0000
Received: from [85.158.138.51:16360] by server-5.bemta-3.messagelabs.com id
	D4/38-26311-C0C97B05; Thu, 29 Nov 2012 17:31:56 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1354210315!23162809!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22180 invoked from network); 29 Nov 2012 17:31:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:31:55 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076484"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:31:55 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 17:31:55 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>, <port-xen@netbsd.org>
Date: Thu, 29 Nov 2012 18:31:45 +0100
Message-ID: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
MIME-Version: 1.0
Subject: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The following series adds support for NetBSD gntdev to libxc, and 
makes libxl use Qemu as a disk backend if an image file stored on a 
remote filesystem is used.

Patch 2/3 is just a fix for the comment in function 
libxl__try_phy_backend.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:32:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:32:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7xv-0007GY-8u; Thu, 29 Nov 2012 17:31:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Te7xt-0007G2-Dk
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:31:57 +0000
Received: from [85.158.138.51:38887] by server-4.bemta-3.messagelabs.com id
	8B/49-30023-C0C97B05; Thu, 29 Nov 2012 17:31:56 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1354210315!23162809!2
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22190 invoked from network); 29 Nov 2012 17:31:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:31:55 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076485"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:31:55 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 17:31:55 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>, <port-xen@netbsd.org>
Date: Thu, 29 Nov 2012 18:31:46 +0100
Message-ID: <1354210308-23251-2-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
In-Reply-To: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH v2 1/3] libxc: add suport for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

QWRkIE9TIHNwZWNpZmljIGhhbmRsZXJzIGZvciBOZXRCU0QgZ250ZGV2LiBUaGUgbWFpbiBkaWZm
ZXJlbmNlIGlzCnRoYXQgTmV0QlNEIHBhc3NlcyB0aGUgVkEgd2hlcmUgdGhlIGdyYW50IHNob3Vs
ZCBiZSBzZXQgaW5zaWRlIHRoZQpJT0NUTF9HTlRERVZfTUFQX0dSQU5UX1JFRiBpb2N0bCwgaW5z
dGVhZCBvZiB1c2luZyBtbWFwICh0aGlzIGlzIGR1ZQp0byBPUyBjb25zdHJhaW50cykuCgpTaWdu
ZWQtb2ZmLWJ5OiBSb2dlciBQYXUgTW9ubsOpIDxyb2dl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cm4gKHhjX29zZGVwX2hhbmRsZSlmZDsKK30KKworc3RhdGljIGludCBu
ZXRic2RfZ250dGFiX2Nsb3NlKHhjX2dudHRhYiAqeGNnLCB4Y19vc2RlcF9oYW5kbGUgaCkKK3sK
KyAgICBpbnQgZmQgPSAoaW50KWg7CisgICAgcmV0dXJuIGNsb3NlKGZkKTsKK30KKworc3RhdGlj
IGludCBuZXRic2RfZ250dGFiX3NldF9tYXhfZ3JhbnRzKHhjX2dudHRhYiAqeGNoLCB4Y19vc2Rl
cF9oYW5kbGUgaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQz
Ml90IGNvdW50KQoreworICAgIC8qIE5ldEJTRCBkb2Vzbid0IGltcGxlbWVudCB0aGlzIGZlYXR1
cmUgKi8KKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIHZvaWQgKm5ldGJzZF9nbnR0YWJfZ3Jh
bnRfbWFwKHhjX2dudHRhYiAqeGNoLCB4Y19vc2RlcF9oYW5kbGUgaCwKKyAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNvdW50LCBpbnQgZmxhZ3MsIGludCBwcm90
LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKmRvbWlkcywg
dWludDMyX3QgKnJlZnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50
MzJfdCBub3RpZnlfb2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ZXZ0Y2huX3BvcnRfdCBub3RpZnlfcG9ydCkKK3sKKyAgICBpbnQgZmQgPSAoaW50KWg7CisgICAg
c3RydWN0IGlvY3RsX2dudGRldl9tYXBfZ3JhbnRfcmVmIG1hcDsKKyAgICBzdHJ1Y3QgaW9jdGxf
Z250ZGV2X2dyYW50X3JlZiAqbXJlZnM7CisgICAgdW5zaWduZWQgaW50IG1hcF9zaXplID0gUk9V
TkRVUChjb3VudCAqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2Yo
c3RydWN0IGlvY3RsX2dudGRldl9tYXBfZ3JhbnRfcmVmKSwKKyAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIFhDX1BBR0VfU0hJRlQpOworICAgIHZvaWQgKmFkZHIgPSBNQVBfRkFJ
TEVEOworICAgIGludCBkb21pZHNfc3RyaWRlID0gMTsKKyAgICBpbnQgcnYgPSAwOworICAgIHN0
cnVjdCBpb2N0bF9nbnRkZXZfdW5tYXBfbm90aWZ5IG5vdGlmeTsKKyAgICBpbnQgaTsKKworICAg
IGlmICggZmxhZ3MgJiBYQ19HUkFOVF9NQVBfU0lOR0xFX0RPTUFJTiApCisgICAgICAgIGRvbWlk
c19zdHJpZGUgPSAwOworCisgICAgaWYgKCBtYXBfc2l6ZSA8PSBYQ19QQUdFX1NJWkUgKQorICAg
ICAgICBtcmVmcyA9IGFsbG9jYShjb3VudCAqIHNpemVvZihzdHJ1Y3QgaW9jdGxfZ250ZGV2X21h
cF9ncmFudF9yZWYpKTsKKyAgICBlbHNlCisgICAgeworICAgICAgICBtcmVmcyA9IG1tYXAoTlVM
TCwgbWFwX3NpemUsIFBST1RfUkVBRCB8IFBST1RfV1JJVEUsCisgICAgICAgICAgICAgICAgICAg
TUFQX1BSSVZBVEUgfCBNQVBfQU5PTiwgLTEsIDApOworICAgICAgICBpZiAoIG1yZWZzID09IE1B
UF9GQUlMRUQgKQorICAgICAgICB7CisgICAgICAgICAgICBQRVJST1IoIm5ldGJzZF9nbnR0YWJf
Z3JhbnRfbWFwOiBtbWFwIG9mIHJlZnMgZmFpbGVkIik7CisgICAgICAgICAgICByZXR1cm4gTlVM
TDsKKyAgICAgICAgfQorICAgIH0KKworICAgIG1hcC5yZWZzID0gbXJlZnM7CisKKyAgICBmb3Ig
KCBpID0gMDsgaSA8IGNvdW50OyBpKysgKQorICAgIHsKKyAgICAgICAgbWFwLnJlZnNbaV0uZG9t
aWQgPSBkb21pZHNbaSAqIGRvbWlkc19zdHJpZGVdOworICAgICAgICBtYXAucmVmc1tpXS5yZWYg
PSByZWZzW2ldOworICAgIH0KKworICAgIG1hcC5jb3VudCA9IGNvdW50OworCisgICAgYWRkciA9
IG1tYXAoTlVMTCwgWENfUEFHRV9TSVpFICogY291bnQsIHByb3QsCisgICAgICAgICAgICAgICAg
TUFQX0FOT04gfCBNQVBfU0hBUkVELCAtMSwgMCk7CisgICAgaWYgKCBhZGRyID09IE1BUF9GQUlM
RUQgKQorICAgIHsKKyAgICAgICAgUEVSUk9SKCJuZXRic2RfZ250dGFiX2dyYW50X21hcDogbW1h
cCBvZiBncmFudHMgZmFpbGVkIik7CisgICAgICAgIGdvdG8gb3V0OworICAgIH0KKworICAgIG1h
cC52YWRkciA9ICh1aW50NjRfdCkgYWRkcjsKKworICAgIGlmICggaW9jdGwoZmQsIElPQ1RMX0dO
VERFVl9NQVBfR1JBTlRfUkVGLCAmbWFwKSApCisgICAgeworICAgICAgICBQRVJST1IoIm5ldGJz
ZF9nbnR0YWJfZ3JhbnRfbWFwOiBpb2N0bCBNQVBfR1JBTlRfUkVGIGZhaWxlZCIpOworICAgICAg
ICBtdW5tYXAoYWRkciwgWENfUEFHRV9TSVpFICogY291bnQpOworICAgICAgICBnb3RvIG91dDsK
KyAgICB9CisKKyAgICBub3RpZnkuaW5kZXggPSBtYXAuaW5kZXg7CisgICAgbm90aWZ5LmFjdGlv
biA9IDA7CisgICAgaWYgKCBub3RpZnlfb2Zmc2V0IDwgKFhDX1BBR0VfU0laRSAqIGNvdW50KSAp
CisgICAgeworICAgICAgICBub3RpZnkuaW5kZXggKz0gbm90aWZ5X29mZnNldDsKKyAgICAgICAg
bm90aWZ5LmFjdGlvbiB8PSBVTk1BUF9OT1RJRllfQ0xFQVJfQllURTsKKyAgICB9CisgICAgaWYg
KCBub3RpZnlfcG9ydCAhPSAtMSApCisgICAgeworICAgICAgICBub3RpZnkuZXZlbnRf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yBvdXQ6CisgICAgaWYgKCBtYXBfc2l6ZSA+IFhDX1BBR0VfU0la
RSApCisgICAgICAgIG11bm1hcChtcmVmcywgbWFwX3NpemUpOworCisgICAgcmV0dXJuIGFkZHI7
Cit9CisKKworCitzdGF0aWMgaW50IG5ldGJzZF9nbnR0YWJfbXVubWFwKHhjX2dudHRhYiAqeGNn
LCB4Y19vc2RlcF9oYW5kbGUgaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lk
ICpzdGFydF9hZGRyZXNzLCB1aW50MzJfdCBjb3VudCkKK3sKKyAgICBpbnQgZmQgPSAoaW50KWg7
CisgICAgc3RydWN0IGlvY3RsX2dudGRldl9nZXRfb2Zmc2V0X2Zvcl92YWRkciBnZXRfb2Zmc2V0
OworICAgIHN0cnVjdCBpb2N0bF9nbnRkZXZfdW5tYXBfZ3JhbnRfcmVmIHVubWFwX2dyYW50Owor
ICAgIGludCByYzsKKworICAgIGlmICggc3RhcnRfYWRkcmVzcyA9PSBOVUxMICkKKyAgICB7Cisg
ICAgICAgIGVycm5vID0gRUlOVkFMOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAg
LyogRmlyc3QsIGl0IGlzIG5lY2Vzc2FyeSB0byBnZXQgdGhlIG9mZnNldCB3aGljaCB3YXMgaW5p
dGlhbGx5IHVzZWQgdG8KKyAgICAgKiBtbWFwKCkgdGhlIHBhZ2VzLgorICAgICAqLworICAgIGdl
dF9vZmZzZXQudmFkZHIgPSAodW5zaWduZWQgbG9uZylzdGFydF9hZGRyZXNzOworICAgIGlmICgg
KHJjID0gaW9jdGwoZmQsIElPQ1RMX0dOVERFVl9HRVRfT0ZGU0VUX0ZPUl9WQUREUiwKKyAgICAg
ICAgICAgICAgICAgICAgICZnZXRfb2Zmc2V0KSkgKQorICAgICAgICByZXR1cm4gcmM7CisKKyAg
ICBpZiAoIGdldF9vZmZzZXQuY291bnQgIT0gY291bnQgKQorICAgIHsKKyAgICAgICAgZXJybm8g
PS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l0Y2ggKCB0eXBlICkKQEAgLTM5
OCw2ICs1ODQsOCBAQCBzdGF0aWMgc3RydWN0IHhjX29zZGVwX29wcyAqbmV0YnNkX29zZGVwX2lu
aXQoeGNfaW50ZXJmYWNlICp4Y2gsIGVudW0geGNfb3NkZXBfdAogICAgICAgICByZXR1cm4gJm5l
dGJzZF9wcml2Y21kX29wczsKICAgICBjYXNlIFhDX09TREVQX0VWVENITjoKICAgICAgICAgcmV0
dXJuICZuZXRic2RfZXZ0Y2huX29wczsKKyAgICBjYXNlIFhDX09TREVQX0dOVFRBQjoKKyAgICAg
ICAgcmV0dXJuICZuZXRic2RfZ250dGFiX29wczsKICAgICBkZWZhdWx0OgogICAgICAgICByZXR1
cm4gTlVMTDsKICAgICB9Ci0tIAoxLjcuNy41IChBcHBsZSBHaXQtMjYpCgoKX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlz
dApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:32:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:32:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7xv-0007GY-8u; Thu, 29 Nov 2012 17:31:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Te7xt-0007G2-Dk
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:31:57 +0000
Received: from [85.158.138.51:38887] by server-4.bemta-3.messagelabs.com id
	8B/49-30023-C0C97B05; Thu, 29 Nov 2012 17:31:56 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1354210315!23162809!2
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22190 invoked from network); 29 Nov 2012 17:31:55 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:31:55 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076485"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:31:55 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 17:31:55 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>, <port-xen@netbsd.org>
Date: Thu, 29 Nov 2012 18:31:46 +0100
Message-ID: <1354210308-23251-2-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
In-Reply-To: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH v2 1/3] libxc: add suport for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

QWRkIE9TIHNwZWNpZmljIGhhbmRsZXJzIGZvciBOZXRCU0QgZ250ZGV2LiBUaGUgbWFpbiBkaWZm
ZXJlbmNlIGlzCnRoYXQgTmV0QlNEIHBhc3NlcyB0aGUgVkEgd2hlcmUgdGhlIGdyYW50IHNob3Vs
ZCBiZSBzZXQgaW5zaWRlIHRoZQpJT0NUTF9HTlRERVZfTUFQX0dSQU5UX1JFRiBpb2N0bCwgaW5z
dGVhZCBvZiB1c2luZyBtbWFwICh0aGlzIGlzIGR1ZQp0byBPUyBjb25zdHJhaW50cykuCgpTaWdu
ZWQtb2ZmLWJ5OiBSb2dlciBQYXUgTW9ubsOpIDxyb2dlci5wYXVAY2l0cml4LmNvbT4KLS0tCiB0
b29scy9pbmNsdWRlL3hlbi1zeXMvTmV0QlNEL2dudGRldi5oIHwgIDE1MSArKysrKysrKysrKysr
KysrKysrKysrKysrKwogdG9vbHMvbGlieGMveGNfbmV0YnNkLmMgICAgICAgICAgICAgICB8ICAx
ODggKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrCiAyIGZpbGVzIGNoYW5nZWQsIDMz
OSBpbnNlcnRpb25zKCspLCAwIGRlbGV0aW9ucygtKQogY3JlYXRlIG1vZGUgMTAwNjQ0IHRvb2xz
L2luY2x1ZGUveGVuLXN5cy9OZXRCU0QvZ250ZGV2LmgKCmRpZmYgLS1naXQgYS90b29scy9pbmNs
dWRlL3hlbi1zeXMvTmV0QlNEL2dudGRldi5oIGIvdG9vbHMvaW5jbHVkZS94ZW4tc3lzL05ldEJT
RC9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pKygxVUw8PChfdykpLTEpICYgfigoMVVMPDwoX3cpKS0xKSkKKwogc3RhdGljIHhjX29zZGVw
X2hhbmRsZSBuZXRic2RfcHJpdmNtZF9vcGVuKHhjX2ludGVyZmFjZSAqeGNoKQogewogICAgIGlu
dCBmbGFncywgc2F2ZWRfZXJybm87CkBAIC0zOTAsNiArMzk0LDE4OCBAQCB2b2lkICp4Y19tZW1h
bGlnbih4Y19pbnRlcmZhY2UgKnhjaCwgc2l6ZV90IGFsaWdubWVudCwgc2l6ZV90IHNpemUpCiAg
ICAgcmV0dXJuIHZhbGxvYyhzaXplKTsKIH0KIAorI2RlZmluZSBHTlRfREVWX05BTUUgICIvZGV2
L2dudGRldiIKKworc3RhdGljIHhjX29zZGVwX2hhbmRsZSBuZXRic2RfZ250dGFiX29wZW4oeGNf
Z250dGFiICp4Y2cpCit7CisgICAgaW50IGZkID0gb3BlbihHTlRfREVWX05BTUUsIE9fUkRXUik7
CisKKyAgICBpZiAoIGZkID09IC0xICkKKyAgICAgICAgcmV0dXJuIFhDX09TREVQX09QRU5fRVJS
T1I7CisKKyAgICByZXR1cm4gKHhjX29zZGVwX2hhbmRsZSlmZDsKK30KKworc3RhdGljIGludCBu
ZXRic2RfZ250dGFiX2Nsb3NlKHhjX2dudHRhYiAqeGNnLCB4Y19vc2RlcF9oYW5kbGUgaCkKK3sK
KyAgICBpbnQgZmQgPSAoaW50KWg7CisgICAgcmV0dXJuIGNsb3NlKGZkKTsKK30KKworc3RhdGlj
IGludCBuZXRic2RfZ250dGFiX3NldF9tYXhfZ3JhbnRzKHhjX2dudHRhYiAqeGNoLCB4Y19vc2Rl
cF9oYW5kbGUgaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQz
Ml90IGNvdW50KQoreworICAgIC8qIE5ldEJTRCBkb2Vzbid0IGltcGxlbWVudCB0aGlzIGZlYXR1
cmUgKi8KKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIHZvaWQgKm5ldGJzZF9nbnR0YWJfZ3Jh
bnRfbWFwKHhjX2dudHRhYiAqeGNoLCB4Y19vc2RlcF9oYW5kbGUgaCwKKyAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNvdW50LCBpbnQgZmxhZ3MsIGludCBwcm90
LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKmRvbWlkcywg
dWludDMyX3QgKnJlZnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50
MzJfdCBub3RpZnlfb2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ZXZ0Y2huX3BvcnRfdCBub3RpZnlfcG9ydCkKK3sKKyAgICBpbnQgZmQgPSAoaW50KWg7CisgICAg
c3RydWN0IGlvY3RsX2dudGRldl9tYXBfZ3JhbnRfcmVmIG1hcDsKKyAgICBzdHJ1Y3QgaW9jdGxf
Z250ZGV2X2dyYW50X3JlZiAqbXJlZnM7CisgICAgdW5zaWduZWQgaW50IG1hcF9zaXplID0gUk9V
TkRVUChjb3VudCAqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2Yo
c3RydWN0IGlvY3RsX2dudGRldl9tYXBfZ3JhbnRfcmVmKSwKKyAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIFhDX1BBR0VfU0hJRlQpOworICAgIHZvaWQgKmFkZHIgPSBNQVBfRkFJ
TEVEOworICAgIGludCBkb21pZHNfc3RyaWRlID0gMTsKKyAgICBpbnQgcnYgPSAwOworICAgIHN0
cnVjdCBpb2N0bF9nbnRkZXZfdW5tYXBfbm90aWZ5IG5vdGlmeTsKKyAgICBpbnQgaTsKKworICAg
IGlmICggZmxhZ3MgJiBYQ19HUkFOVF9NQVBfU0lOR0xFX0RPTUFJTiApCisgICAgICAgIGRvbWlk
c19zdHJpZGUgPSAwOworCisgICAgaWYgKCBtYXBfc2l6ZSA8PSBYQ19QQUdFX1NJWkUgKQorICAg
ICAgICBtcmVmcyA9IGFsbG9jYShjb3VudCAqIHNpemVvZihzdHJ1Y3QgaW9jdGxfZ250ZGV2X21h
cF9ncmFudF9yZWYpKTsKKyAgICBlbHNlCisgICAgeworICAgICAgICBtcmVmcyA9IG1tYXAoTlVM
TCwgbWFwX3NpemUsIFBST1RfUkVBRCB8IFBST1RfV1JJVEUsCisgICAgICAgICAgICAgICAgICAg
TUFQX1BSSVZBVEUgfCBNQVBfQU5PTiwgLTEsIDApOworICAgICAgICBpZiAoIG1yZWZzID09IE1B
UF9GQUlMRUQgKQorICAgICAgICB7CisgICAgICAgICAgICBQRVJST1IoIm5ldGJzZF9nbnR0YWJf
Z3JhbnRfbWFwOiBtbWFwIG9mIHJlZnMgZmFpbGVkIik7CisgICAgICAgICAgICByZXR1cm4gTlVM
TDsKKyAgICAgICAgfQorICAgIH0KKworICAgIG1hcC5yZWZzID0gbXJlZnM7CisKKyAgICBmb3Ig
KCBpID0gMDsgaSA8IGNvdW50OyBpKysgKQorICAgIHsKKyAgICAgICAgbWFwLnJlZnNbaV0uZG9t
aWQgPSBkb21pZHNbaSAqIGRvbWlkc19zdHJpZGVdOworICAgICAgICBtYXAucmVmc1tpXS5yZWYg
PSByZWZzW2ldOworICAgIH0KKworICAgIG1hcC5jb3VudCA9IGNvdW50OworCisgICAgYWRkciA9
IG1tYXAoTlVMTCwgWENfUEFHRV9TSVpFICogY291bnQsIHByb3QsCisgICAgICAgICAgICAgICAg
TUFQX0FOT04gfCBNQVBfU0hBUkVELCAtMSwgMCk7CisgICAgaWYgKCBhZGRyID09IE1BUF9GQUlM
RUQgKQorICAgIHsKKyAgICAgICAgUEVSUk9SKCJuZXRic2RfZ250dGFiX2dyYW50X21hcDogbW1h
cCBvZiBncmFudHMgZmFpbGVkIik7CisgICAgICAgIGdvdG8gb3V0OworICAgIH0KKworICAgIG1h
cC52YWRkciA9ICh1aW50NjRfdCkgYWRkcjsKKworICAgIG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IHVubWFwX2dyYW50Owor
ICAgIGludCByYzsKKworICAgIGlmICggc3RhcnRfYWRkcmVzcyA9PSBOVUxMICkKKyAgICB7Cisg
ICAgICAgIGVycm5vID0gRUlOVkFMOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAg
LyogRmlyc3QsIGl0IGlzIG5lY2Vzc2FyeSB0byBnZXQgdGhlIG9mZnNldCB3aGljaCB3YXMgaW5p
dGlhbGx5IHVzZWQgdG8KKyAgICAgKiBtbWFwKCkgdGhlIHBhZ2VzLgorICAgICAqLworICAgIGdl
dF9vZmZzZXQudmFkZHIgPSAodW5zaWduZWQgbG9uZylzdGFydF9hZGRyZXNzOworICAgIGlmICgg
KHJjID0gaW9jdGwoZmQsIElPQ1RMX0dOVERFVl9HRVRfT0ZGU0VUX0ZPUl9WQUREUiwKKyAgICAg
ICAgICAgICAgICAgICAgICZnZXRfb2Zmc2V0KSkgKQorICAgICAgICByZXR1cm4gcmM7CisKKyAg
ICBpZiAoIGdldF9vZmZzZXQuY291bnQgIT0gY291bnQgKQorICAgIHsKKyAgICAgICAgZXJybm8g
PSBFSU5WQUw7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICAvKiBOZXh0LCB1bm1h
cCB0aGUgbWVtb3J5LiAqLworICAgIGlmICggKHJjID0gbXVubWFwKHN0YXJ0X2FkZHJlc3MsIGNv
dW50ICogZ2V0cGFnZXNpemUoKSkpICkKKyAgICAgICAgcmV0dXJuIHJjOworCisgICAgLyogRmlu
YWxseSwgdW5tYXAgdGhlIGRyaXZlciBzbG90cyB1c2VkIHRvIHN0b3JlIHRoZSBncmFudCBpbmZv
cm1hdGlvbi4gKi8KKyAgICB1bm1hcF9ncmFudC5pbmRleCA9IGdldF9vZmZzZXQub2Zmc2V0Owor
ICAgIHVubWFwX2dyYW50LmNvdW50ID0gY291bnQ7CisgICAgaWYgKCAocmMgPSBpb2N0bChmZCwg
SU9DVExfR05UREVWX1VOTUFQX0dSQU5UX1JFRiwgJnVubWFwX2dyYW50KSkgKQorICAgICAgICBy
ZXR1cm4gcmM7CisKKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIHN0cnVjdCB4Y19vc2RlcF9v
cHMgbmV0YnNkX2dudHRhYl9vcHMgPSB7CisgICAgLm9wZW4gPSAmbmV0YnNkX2dudHRhYl9vcGVu
LAorICAgIC5jbG9zZSA9ICZuZXRic2RfZ250dGFiX2Nsb3NlLAorCisgICAgLnUuZ250dGFiID0g
eworICAgICAgICAuc2V0X21heF9ncmFudHMgPSAmbmV0YnNkX2dudHRhYl9zZXRfbWF4X2dyYW50
cywKKyAgICAgICAgLmdyYW50X21hcCA9ICZuZXRic2RfZ250dGFiX2dyYW50X21hcCwKKyAgICAg
ICAgLm11bm1hcCA9ICZuZXRic2RfZ250dGFiX211bm1hcCwKKyAgICB9LAorfTsKKwogc3RhdGlj
IHN0cnVjdCB4Y19vc2RlcF9vcHMgKm5ldGJzZF9vc2RlcF9pbml0KHhjX2ludGVyZmFjZSAqeGNo
LCBlbnVtIHhjX29zZGVwX3R5cGUgdHlwZSkKIHsKICAgICBzd2l0Y2ggKCB0eXBlICkKQEAgLTM5
OCw2ICs1ODQsOCBAQCBzdGF0aWMgc3RydWN0IHhjX29zZGVwX29wcyAqbmV0YnNkX29zZGVwX2lu
aXQoeGNfaW50ZXJmYWNlICp4Y2gsIGVudW0geGNfb3NkZXBfdAogICAgICAgICByZXR1cm4gJm5l
dGJzZF9wcml2Y21kX29wczsKICAgICBjYXNlIFhDX09TREVQX0VWVENITjoKICAgICAgICAgcmV0
dXJuICZuZXRic2RfZXZ0Y2huX29wczsKKyAgICBjYXNlIFhDX09TREVQX0dOVFRBQjoKKyAgICAg
ICAgcmV0dXJuICZuZXRic2RfZ250dGFiX29wczsKICAgICBkZWZhdWx0OgogICAgICAgICByZXR1
cm4gTlVMTDsKICAgICB9Ci0tIAoxLjcuNy41IChBcHBsZSBHaXQtMjYpCgoKX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlz
dApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:32:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:32:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7xv-0007Gn-Qp; Thu, 29 Nov 2012 17:31:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Te7xu-0007GB-C7
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:31:58 +0000
Received: from [85.158.138.51:38919] by server-16.bemta-3.messagelabs.com id
	AF/05-07461-D0C97B05; Thu, 29 Nov 2012 17:31:57 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1354210315!23162809!4
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22230 invoked from network); 29 Nov 2012 17:31:56 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:31:56 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076487"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:31:56 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 17:31:56 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>, <port-xen@netbsd.org>
Date: Thu, 29 Nov 2012 18:31:48 +0100
Message-ID: <1354210308-23251-4-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
In-Reply-To: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH v2 3/3] libxl: switch NetBSD file backend to
	Qemu if filesystem is not local
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

VGhpcyBmb3JjZXMgbGlieGwgdG8gdXNlIFFlbXUgd2hlbiBhIHJhdyBpbWFnZSBmaWxlIGhvc3Rl
ZCBvbiBhCnJlbW90ZSBmaWxlc3lzdGVtIGlzIHVzZWQgYXMgYSBkaXNrIGJhY2tlbmQuIE5ldEJT
RCBjdXJyZW50bHkgb25seQpzdXBwb3J0cyBxZW11LXRyYWRpdGlvbmFsLCBzbwp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dHJ5
X2JhY2tlbmRfYXJnczsKIAogc3RhdGljIGludCBkaXNrX3RyeV9iYWNrZW5kKGRpc2tfdHJ5X2Jh
Y2tlbmRfYXJncyAqYSwKQEAgLTE2Nyw3ICsxNjgsNyBAQCBzdGF0aWMgaW50IGRpc2tfdHJ5X2Jh
Y2tlbmQoZGlza190cnlfYmFja2VuZF9hcmdzICphLAogICAgICAgICAgICAgcmV0dXJuIGJhY2tl
bmQ7CiAgICAgICAgIH0KIAotICAgICAgICBpZiAobGlieGxfX3RyeV9waHlfYmFja2VuZChhLT5z
dGFiLnN0X21vZGUpKQorICAgICAgICBpZiAobGlieGxfX3RyeV9waHlfYmFja2VuZChhLT5zdGFi
LnN0X21vZGUsIGEtPnN0dmZzLmZfZmxhZykpCiAgICAgICAgICAgICByZXR1cm4gYmFja2VuZDsK
IAogICAgICAgICBMSUJYTF9fTE9HKGN0eCwgTElCWExfX0xPR19ERUJVRywgIkRpc2sgdmRldj0l
cywgYmFja2VuZCBwaHkiCkBAIC0yNTAsNiArMjUxLDExIEBAIGludCBsaWJ4bF9fZGV2aWNlX2Rp
c2tfc2V0X2JhY2tlbmQobGlieGxfX2djICpnYywgbGlieGxfZGV2aWNlX2Rpc2sgKmRpc2spIHsK
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzay0+dmRldiwgZGlzay0+cGRldl9wYXRo
KTsKICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTlZBTDsKICAgICAgICAgfQorICAgICAgICBp
ZiAoc3RhdHZmcyhkaXNrLT5wZGV2X3BhdGgsICZhLnN0dmZzKSkgeworICAgICAgICAgICAgTE9H
RShFUlJPUiwgIkRpc2sgdmRldj0lcyBmYWlsZWQgdG8gc3RhdDogJXMiLAorICAgICAgICAgICAg
ICAgICBkaXNrLT52ZGV2LCBkaXNrLT5wZGV2X3BhdGgpOworICAgICAgICAgICAgcmV0dXJuIEVS
Uk9SX0lOVkFMOworICAgICAgICB9CiAgICAgfQogCiAgICAgaWYg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X3Qgc3RfbW9kZSkKK2ludCBsaWJ4bF9f
dHJ5X3BoeV9iYWNrZW5kKG1vZGVfdCBzdF9tb2RlLCB1bnNpZ25lZCBsb25nIGZfZmxhZykKIHsK
LSAgICBpZiAoU19JU1JFRyhzdF9tb2RlKSB8fCBTX0lTQkxLKHN0X21vZGUpKQorICAgIGlmIChT
X0lTQkxLKHN0X21vZGUpKQorICAgICAgICAvKiBGaWxlIGlzIGEgYmxvY2sgZGV2aWNlLCBhbHdh
eXMgaGFuZGxlZCBieSB4YmRiYWNrICovCisgICAgICAgIHJldHVybiAxOworCisgICAgaWYgKFNf
SVNSRUcoc3RfbW9kZSkgJiYgKFNUX0xPQ0FMICYgZl9mbGFnKSkKKyAgICAgICAgLyoKKyAgICAg
ICAgICogRmlsZSBpcyBhIHJlZ3VsYXIgZmlsZSwgYW5kIHRoZSBmaWxlc3lzdGVtIGlzIGxvY2Fs
LAorICAgICAgICAgKiBhdHRhY2ggdXNpbmcgdm5kKDQpLgorICAgICAgICAgKi8KICAgICAgICAg
cmV0dXJuIDE7CiAKICAgICByZXR1cm4gMDsKLS0gCjEuNy43LjUgKEFwcGxlIEdpdC0yNikKCgpf
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwg
bWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3Jn
L3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:32:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:32:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7xv-0007Gn-Qp; Thu, 29 Nov 2012 17:31:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Te7xu-0007GB-C7
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:31:58 +0000
Received: from [85.158.138.51:38919] by server-16.bemta-3.messagelabs.com id
	AF/05-07461-D0C97B05; Thu, 29 Nov 2012 17:31:57 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1354210315!23162809!4
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22230 invoked from network); 29 Nov 2012 17:31:56 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:31:56 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076487"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:31:56 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 17:31:56 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>, <port-xen@netbsd.org>
Date: Thu, 29 Nov 2012 18:31:48 +0100
Message-ID: <1354210308-23251-4-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
In-Reply-To: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH v2 3/3] libxl: switch NetBSD file backend to
	Qemu if filesystem is not local
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

VGhpcyBmb3JjZXMgbGlieGwgdG8gdXNlIFFlbXUgd2hlbiBhIHJhdyBpbWFnZSBmaWxlIGhvc3Rl
ZCBvbiBhCnJlbW90ZSBmaWxlc3lzdGVtIGlzIHVzZWQgYXMgYSBkaXNrIGJhY2tlbmQuIE5ldEJT
RCBjdXJyZW50bHkgb25seQpzdXBwb3J0cyBxZW11LXRyYWRpdGlvbmFsLCBzbwpkZXZpY2VfbW9k
ZWxfdmVyc2lvbj0icWVtdS14ZW4tdHJhZGl0aW9uYWwiIGhhcyB0byBiZSBhZGRlZCB0byB0aGUK
Y29uZmlnIGZpbGUgd2hlbiB1c2luZyBpbWFnZSBmaWxlcy4KClRvIGRldGVjdCBpZiB0aGUgZmls
ZXN5c3RlbSBpcyBsb2NhbCB0aGUgc3RhdHZmcygyKSBmdW5jdGlvbiBpcyB1c2VkLAphcyByZWNv
bW1lbmRlZCBieSBHcmVnIFRyb3hlbC4KClNpZ25lZC1vZmYtYnk6IFJvZ2VyIFBhdSBNb25uw6kg
PHJvZ2VyLnBhdUBjaXRyaXguY29tPgotLS0KIHRvb2xzL2xpYnhsL2xpYnhsX2RldmljZS5jICAg
fC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AgICAg
ICAgICogRmlsZSBpcyBhIHJlZ3VsYXIgZmlsZSwgYW5kIHRoZSBmaWxlc3lzdGVtIGlzIGxvY2Fs
LAorICAgICAgICAgKiBhdHRhY2ggdXNpbmcgdm5kKDQpLgorICAgICAgICAgKi8KICAgICAgICAg
cmV0dXJuIDE7CiAKICAgICByZXR1cm4gMDsKLS0gCjEuNy43LjUgKEFwcGxlIEdpdC0yNikKCgpf
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwg
bWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3Jn
L3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:32:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:32:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7xu-0007GR-SX; Thu, 29 Nov 2012 17:31:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Te7xt-0007G1-BX
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:31:57 +0000
Received: from [85.158.138.51:38879] by server-2.bemta-3.messagelabs.com id
	64/85-04744-C0C97B05; Thu, 29 Nov 2012 17:31:56 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1354210315!23162809!3
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22207 invoked from network); 29 Nov 2012 17:31:56 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:31:56 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076486"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:31:55 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 17:31:55 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>, <port-xen@netbsd.org>
Date: Thu, 29 Nov 2012 18:31:47 +0100
Message-ID: <1354210308-23251-3-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
In-Reply-To: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH v2 2/3] libxl: fix wrong comment
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: x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gbGlieGxfX3RyeV9waHlf
YmFja2VuZChtb2RlX3Qgc3RfbW9kZSk7CiAKLS0gCjEuNy43LjUgKEFwcGxlIEdpdC0yNikKCgpf
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwg
bWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3Jn
L3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:32:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:32:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te7xu-0007GR-SX; Thu, 29 Nov 2012 17:31:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1Te7xt-0007G1-BX
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:31:57 +0000
Received: from [85.158.138.51:38879] by server-2.bemta-3.messagelabs.com id
	64/85-04744-C0C97B05; Thu, 29 Nov 2012 17:31:56 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1354210315!23162809!3
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22207 invoked from network); 29 Nov 2012 17:31:56 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:31:56 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076486"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:31:55 +0000
Received: from mac.citrite.net (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 17:31:55 +0000
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xen.org>, <port-xen@netbsd.org>
Date: Thu, 29 Nov 2012 18:31:47 +0100
Message-ID: <1354210308-23251-3-git-send-email-roger.pau@citrix.com>
X-Mailer: git-send-email 1.7.7.5 (Apple Git-26)
In-Reply-To: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH v2 2/3] libxl: fix wrong comment
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

VGhlIGNvbW1lbnQgaW4gZnVuY3Rpb24gbGlieGxfX3RyeV9waHlfYmFja2VuZCBpcyB3cm9uZywg
MSBpcyByZXR1cm5lZAppZiB0aGUgYmFja2VuZCBz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X19fX19fX19fX19fXwpYZW4tZGV2ZWwg
bWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3Jn
L3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:34:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:34:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te80M-0007ek-E8; Thu, 29 Nov 2012 17:34:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pbonzini@redhat.com>) id 1Te80L-0007eW-7C
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:34:29 +0000
Received: from [85.158.137.99:8894] by server-7.bemta-3.messagelabs.com id
	35/92-01713-4AC97B05; Thu, 29 Nov 2012 17:34:28 +0000
X-Env-Sender: pbonzini@redhat.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354210466!14066536!1
X-Originating-IP: [209.132.183.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTYxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24294 invoked from network); 29 Nov 2012 17:34:27 -0000
Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28)
	by server-9.tower-217.messagelabs.com with SMTP;
	29 Nov 2012 17:34:27 -0000
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qATHYPc7010359
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 12:34:25 -0500
Received: from yakj.usersys.redhat.com (ovpn-112-33.ams2.redhat.com
	[10.36.112.33])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id qATHYNdM023063
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 12:34:23 -0500
From: Paolo Bonzini <pbonzini@redhat.com>
To: xen-devel@lists.xen.org
Date: Thu, 29 Nov 2012 18:34:21 +0100
Message-Id: <1354210461-9739-1-git-send-email-pbonzini@redhat.com>
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
Subject: [Xen-devel] [PATCH] xen: find a better location for the real-mode
	trampoline
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On some machines, the location at 0x40e does not point to the beginning
of the EBDA.  Rather, it points to the beginning of the BIOS-reserved
area of the EBDA, while the option ROMs place their data below that
segment.

For this reason, 0x413 is actually a better source than 0x40e to get
the location of the real-mode trampoline.  But it is even better to
fetch the information from the multiboot structure, where the boot
loader has placed the data for us already.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 xen/arch/x86/boot/head.S | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 7efa155..1790462 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -78,16 +78,19 @@ __start:
         cmp     $0x2BADB002,%eax
         jne     not_multiboot
 
-        /* Set up trampoline segment 64k below EBDA */
-        movzwl  0x40e,%eax          /* EBDA segment */
-        cmp     $0xa000,%eax        /* sanity check (high) */
-        jae     0f
-        cmp     $0x4000,%eax        /* sanity check (low) */
-        jae     1f
-0:
-        movzwl  0x413,%eax          /* use base memory size on failure */
-        shl     $10-4,%eax
+        /* Set up trampoline segment just below end of base memory.
+         * Prefer to get this information from the multiboot
+         * structure, if available.
+         */
+        mov     4(%ebx),%eax        /* kb of low memory */
+        testb   $1,(%ebx)           /* test MBI_MEMLIMITS */
+        jnz     1f
+
+        movzwl  0x413,%eax          /* base memory size in kb */
 1:
+        shl     $10-4,%eax          /* convert to a segment number */
+
+        /* Reserve 64kb for the trampoline */
         sub     $0x1000,%eax
 
         /* From arch/x86/smpboot.c: start_eip had better be page-aligned! */
-- 
1.8.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:34:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:34:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te80M-0007ek-E8; Thu, 29 Nov 2012 17:34:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pbonzini@redhat.com>) id 1Te80L-0007eW-7C
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:34:29 +0000
Received: from [85.158.137.99:8894] by server-7.bemta-3.messagelabs.com id
	35/92-01713-4AC97B05; Thu, 29 Nov 2012 17:34:28 +0000
X-Env-Sender: pbonzini@redhat.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354210466!14066536!1
X-Originating-IP: [209.132.183.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTYxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24294 invoked from network); 29 Nov 2012 17:34:27 -0000
Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28)
	by server-9.tower-217.messagelabs.com with SMTP;
	29 Nov 2012 17:34:27 -0000
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qATHYPc7010359
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 12:34:25 -0500
Received: from yakj.usersys.redhat.com (ovpn-112-33.ams2.redhat.com
	[10.36.112.33])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id qATHYNdM023063
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 12:34:23 -0500
From: Paolo Bonzini <pbonzini@redhat.com>
To: xen-devel@lists.xen.org
Date: Thu, 29 Nov 2012 18:34:21 +0100
Message-Id: <1354210461-9739-1-git-send-email-pbonzini@redhat.com>
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
Subject: [Xen-devel] [PATCH] xen: find a better location for the real-mode
	trampoline
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On some machines, the location at 0x40e does not point to the beginning
of the EBDA.  Rather, it points to the beginning of the BIOS-reserved
area of the EBDA, while the option ROMs place their data below that
segment.

For this reason, 0x413 is actually a better source than 0x40e to get
the location of the real-mode trampoline.  But it is even better to
fetch the information from the multiboot structure, where the boot
loader has placed the data for us already.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 xen/arch/x86/boot/head.S | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 7efa155..1790462 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -78,16 +78,19 @@ __start:
         cmp     $0x2BADB002,%eax
         jne     not_multiboot
 
-        /* Set up trampoline segment 64k below EBDA */
-        movzwl  0x40e,%eax          /* EBDA segment */
-        cmp     $0xa000,%eax        /* sanity check (high) */
-        jae     0f
-        cmp     $0x4000,%eax        /* sanity check (low) */
-        jae     1f
-0:
-        movzwl  0x413,%eax          /* use base memory size on failure */
-        shl     $10-4,%eax
+        /* Set up trampoline segment just below end of base memory.
+         * Prefer to get this information from the multiboot
+         * structure, if available.
+         */
+        mov     4(%ebx),%eax        /* kb of low memory */
+        testb   $1,(%ebx)           /* test MBI_MEMLIMITS */
+        jnz     1f
+
+        movzwl  0x413,%eax          /* base memory size in kb */
 1:
+        shl     $10-4,%eax          /* convert to a segment number */
+
+        /* Reserve 64kb for the trampoline */
         sub     $0x1000,%eax
 
         /* From arch/x86/smpboot.c: start_eip had better be page-aligned! */
-- 
1.8.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:36:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:36:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te81n-0007qJ-UB; Thu, 29 Nov 2012 17:35:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te81n-0007qC-5V
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:35:59 +0000
Received: from [193.109.254.147:64022] by server-10.bemta-14.messagelabs.com
	id 90/12-31741-EFC97B05; Thu, 29 Nov 2012 17:35:58 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-8.tower-27.messagelabs.com!1354210556!8812396!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31735 invoked from network); 29 Nov 2012 17:35:57 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-8.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 17:35:57 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158386748;
	Thu, 29 Nov 2012 12:35:48 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com
Date: Thu, 29 Nov 2012 12:35:32 -0500
Message-Id: <1354210534-31052-6-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [VTPM v5 5/7] Add cmake dependency to README
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 README |    1 +
 1 file changed, 1 insertion(+)

diff --git a/README b/README
index 88300df..2f7e04c 100644
--- a/README
+++ b/README
@@ -61,6 +61,7 @@ provided by your OS distributor:
     * 16-bit x86 assembler, loader and compiler (dev86 rpm or bin86 & bcc debs)
     * ACPI ASL compiler (iasl)
     * markdown
+    * cmake (if building vtpm stub domains)
 
 In addition to the above there are a number of optional build
 prerequisites. Omitting these will cause the related features to be
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:36:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:36:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te81n-0007qJ-UB; Thu, 29 Nov 2012 17:35:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te81n-0007qC-5V
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:35:59 +0000
Received: from [193.109.254.147:64022] by server-10.bemta-14.messagelabs.com
	id 90/12-31741-EFC97B05; Thu, 29 Nov 2012 17:35:58 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-8.tower-27.messagelabs.com!1354210556!8812396!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31735 invoked from network); 29 Nov 2012 17:35:57 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-8.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 17:35:57 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158386748;
	Thu, 29 Nov 2012 12:35:48 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com
Date: Thu, 29 Nov 2012 12:35:32 -0500
Message-Id: <1354210534-31052-6-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [VTPM v5 5/7] Add cmake dependency to README
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 README |    1 +
 1 file changed, 1 insertion(+)

diff --git a/README b/README
index 88300df..2f7e04c 100644
--- a/README
+++ b/README
@@ -61,6 +61,7 @@ provided by your OS distributor:
     * 16-bit x86 assembler, loader and compiler (dev86 rpm or bin86 & bcc debs)
     * ACPI ASL compiler (iasl)
     * markdown
+    * cmake (if building vtpm stub domains)
 
 In addition to the above there are a number of optional build
 prerequisites. Omitting these will cause the related features to be
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:36:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:36:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te81r-0007qw-Aq; Thu, 29 Nov 2012 17:36:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te81p-0007qT-B1
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:36:02 +0000
Received: from [85.158.137.99:29800] by server-5.bemta-3.messagelabs.com id
	A0/6C-26311-00D97B05; Thu, 29 Nov 2012 17:36:00 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-13.tower-217.messagelabs.com!1354210557!17248006!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2866 invoked from network); 29 Nov 2012 17:35:58 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-13.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:35:58 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158386744;
	Thu, 29 Nov 2012 12:35:48 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com
Date: Thu, 29 Nov 2012 12:35:30 -0500
Message-Id: <1354210534-31052-4-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [VTPM v5 3/7] vtpm/vtpmmgr and required libs to
	stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add 3 new libraries to stubdom:
libgmp
polarssl
Berlios TPM Emulator 0.7.4

Also adds makefile structure for vtpm-stubdom and vtpmmgrdom

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/Makefile           |  138 +++++++++++++++++++++++++++++++++++++++++++-
 stubdom/polarssl.patch     |   64 ++++++++++++++++++++
 stubdom/tpmemu-0.7.4.patch |   12 ++++
 3 files changed, 211 insertions(+), 3 deletions(-)
 create mode 100644 stubdom/polarssl.patch
 create mode 100644 stubdom/tpmemu-0.7.4.patch

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 50ba360..fc70d88 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -31,6 +31,18 @@ GRUB_VERSION=0.97
 OCAML_URL?=http://caml.inria.fr/pub/distrib/ocaml-3.11
 OCAML_VERSION=3.11.0
 
+GMP_VERSION=4.3.2
+GMP_URL?=$(XEN_EXTFILES_URL)
+#GMP_URL?=ftp://ftp.gmplib.org/pub/gmp-$(GMP_VERSION)
+
+POLARSSL_VERSION=1.1.4
+POLARSSL_URL?=$(XEN_EXTFILES_URL)
+#POLARSSL_URL?=http://polarssl.org/code/releases
+
+TPMEMU_VERSION=0.7.4
+TPMEMU_URL?=$(XEN_EXTFILES_URL)
+#TPMEMU_URL?=http://download.berlios.de/tpm-emulator
+
 WGET=wget -c
 
 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
@@ -74,12 +86,12 @@ TARGET_CPPFLAGS += -I$(XEN_ROOT)/xen/include
 
 TARGET_LDFLAGS += -nostdlib -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
 
-TARGETS=ioemu c caml grub xenstore
+TARGETS=ioemu c caml grub xenstore vtpm vtpmmgr
 
 .PHONY: all
 all: build
 ifeq ($(STUBDOM_SUPPORTED),1)
-build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom
+build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom vtpm-stubdom vtpmmgrdom
 else
 build: genpath
 endif
@@ -176,6 +188,76 @@ lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
 	touch $@
 
 #############
+# cross-gmp
+#############
+gmp-$(GMP_VERSION).tar.bz2:
+	$(WGET) $(GMP_URL)/$@
+
+.PHONY: cross-gmp
+ifeq ($(XEN_TARGET_ARCH), x86_32)
+   GMPEXT=ABI=32
+endif
+gmp-$(XEN_TARGET_ARCH): gmp-$(GMP_VERSION).tar.bz2 $(NEWLIB_STAMPFILE)
+	tar xjf $<
+	mv gmp-$(GMP_VERSION) $@
+	#patch -d $@ -p0 < gmp.patch
+	cd $@; CPPFLAGS="-isystem $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include $(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" CC=$(CC) $(GMPEXT) ./configure --disable-shared --enable-static --disable-fft --without-readline --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf
+	sed -i 's/#define HAVE_OBSTACK_VPRINTF 1/\/\/#define HAVE_OBSTACK_VPRINTF 1/' $@/config.h
+	touch $@
+
+GMP_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libgmp.a
+cross-gmp: $(GMP_STAMPFILE)
+$(GMP_STAMPFILE): gmp-$(XEN_TARGET_ARCH)
+	( cd $< && \
+	  $(MAKE) && \
+	  $(MAKE) install )
+
+#############
+# cross-polarssl
+#############
+polarssl-$(POLARSSL_VERSION)-gpl.tgz:
+	$(WGET) $(POLARSSL_URL)/$@
+
+polarssl-$(XEN_TARGET_ARCH): polarssl-$(POLARSSL_VERSION)-gpl.tgz
+	tar xzf $<
+	mv polarssl-$(POLARSSL_VERSION) $@
+	patch -d $@ -p1 < polarssl.patch
+	touch $@
+
+POLARSSL_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libpolarssl.a
+cross-polarssl: $(POLARSSL_STAMPFILE)
+$(POLARSSL_STAMPFILE): polarssl-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) lwip-$(XEN_TARGET_ARCH)
+	 ( cd $</library && \
+	   make CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I $(realpath $(MINI_OS)/include)" && \
+	   mkdir -p $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include && \
+	   cp -r ../include/* $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include && \
+	   mkdir -p $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib && \
+	   $(INSTALL_DATA) libpolarssl.a $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ )
+
+#############
+# cross-tpmemu
+#############
+tpm_emulator-$(TPMEMU_VERSION).tar.gz:
+	$(WGET) $(TPMEMU_URL)/$@
+
+tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
+	tar xzf $<
+	mv tpm_emulator-$(TPMEMU_VERSION) $@
+	patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
+	mkdir $@/build
+	cd $@/build; cmake .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
+	touch $@
+
+TPMEMU_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm.a
+$(TPMEMU_STAMPFILE): tpm_emulator-$(XEN_TARGET_ARCH) $(GMP_STAMPFILE)
+	( cd $</build && make VERBOSE=1 tpm_crypto tpm  )
+	cp $</build/crypto/libtpm_crypto.a $(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm_crypto.a
+	cp $</build/tpm/libtpm.a $(TPMEMU_STAMPFILE)
+
+.PHONY: cross-tpmemu
+cross-tpmemu: $(TPMEMU_STAMPFILE)
+
+#############
 # Cross-ocaml
 #############
 
@@ -319,6 +401,24 @@ c: $(CROSS_ROOT)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
 
 ######
+# VTPM
+######
+
+.PHONY: vtpm
+vtpm: cross-polarssl cross-tpmemu
+	make -C $(MINI_OS) links
+	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+
+######
+# VTPMMGR
+######
+
+.PHONY: vtpmmgr
+vtpmmgr: cross-polarssl
+	make -C $(MINI_OS) links
+	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+
+######
 # Grub
 ######
 
@@ -362,6 +462,14 @@ caml-stubdom: mini-os-$(XEN_TARGET_ARCH)-caml lwip-$(XEN_TARGET_ARCH) libxc cros
 c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxc c
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/c/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS=$(CURDIR)/c/main.a
 
+.PHONY: vtpm-stubdom
+vtpm-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpm vtpm
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpm/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpm/vtpm.a" APP_LDLIBS="-ltpm -ltpm_crypto -lgmp"
+
+.PHONY: vtpmmgrdom
+vtpmmgrdom: mini-os-$(XEN_TARGET_ARCH)-vtpmmgr vtpmmgr
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpmmgr/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpmmgr/vtpmmgr.a" APP_LDLIBS="-lm"
+
 .PHONY: pv-grub
 pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxc grub
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/grub/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a
@@ -375,7 +483,7 @@ xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxc xenstore
 #########
 
 ifeq ($(STUBDOM_SUPPORTED),1)
-install: genpath install-readme install-ioemu install-grub install-xenstore
+install: genpath install-readme install-ioemu install-grub install-xenstore install-vtpm install-vtpmmgr
 else
 install: genpath
 endif
@@ -399,6 +507,14 @@ install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/boot"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/xenstore-stubdom.gz"
 
+install-vtpm: vtpm-stubdom
+	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-vtpm/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpm-stubdom.gz"
+
+install-vtpmmgr: vtpm-stubdom
+	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-vtpmmgr/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpmmgrdom.gz"
+
 #######
 # clean
 #######
@@ -411,8 +527,12 @@ clean:
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-caml
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
+	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
+	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
 	$(MAKE) DESTDIR= -C caml clean
 	$(MAKE) DESTDIR= -C c clean
+	$(MAKE) -C vtpm clean
+	$(MAKE) -C vtpmmgr clean
 	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f $(STUBDOMPATH)
 	[ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
@@ -426,6 +546,10 @@ crossclean: clean
 	rm -fr newlib-$(XEN_TARGET_ARCH)
 	rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH)
 	rm -fr libxc-$(XEN_TARGET_ARCH) ioemu
+	rm -fr gmp-$(XEN_TARGET_ARCH)
+	rm -fr polarssl-$(XEN_TARGET_ARCH)
+	rm -fr openssl-$(XEN_TARGET_ARCH)
+	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -f mk-headers-$(XEN_TARGET_ARCH)
 	rm -fr ocaml-$(XEN_TARGET_ARCH)
 	rm -fr include
@@ -434,6 +558,10 @@ crossclean: clean
 .PHONY: patchclean
 patchclean: crossclean
 	rm -fr newlib-$(NEWLIB_VERSION)
+	rm -fr gmp-$(XEN_TARGET_ARCH)
+	rm -fr polarssl-$(XEN_TARGET_ARCH)
+	rm -fr openssl-$(XEN_TARGET_ARCH)
+	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -fr lwip-$(XEN_TARGET_ARCH)
 	rm -fr grub-upstream
 
@@ -442,10 +570,14 @@ patchclean: crossclean
 downloadclean: patchclean
 	rm -f newlib-$(NEWLIB_VERSION).tar.gz
 	rm -f zlib-$(ZLIB_VERSION).tar.gz
+	rm -f gmp-$(GMP_VERSION).tar.gz
+	rm -f tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	rm -f pciutils-$(LIBPCI_VERSION).tar.bz2
 	rm -f grub-$(GRUB_VERSION).tar.gz
 	rm -f lwip-$(LWIP_VERSION).tar.gz
 	rm -f ocaml-$(OCAML_VERSION).tar.gz
+	rm -f polarssl-$(POLARSSL_VERSION)-gpl.tgz
+	rm -f openssl-$(POLARSSL_VERSION)-gpl.tgz
 
 .PHONY: distclean
 distclean: downloadclean
diff --git a/stubdom/polarssl.patch b/stubdom/polarssl.patch
new file mode 100644
index 0000000..d387d4e
--- /dev/null
+++ b/stubdom/polarssl.patch
@@ -0,0 +1,64 @@
+diff -Naur polarssl-1.1.4/include/polarssl/config.h polarssl-x86_64/include/polarssl/config.h
+--- polarssl-1.1.4/include/polarssl/config.h	2011-12-22 05:06:27.000000000 -0500
++++ polarssl-x86_64/include/polarssl/config.h	2012-10-30 17:18:07.567001000 -0400
+@@ -164,8 +164,8 @@
+  * application.
+  *
+  * Uncomment this macro to prevent loading of default entropy functions.
+-#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
+  */
++#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
+
+ /**
+  * \def POLARSSL_NO_PLATFORM_ENTROPY
+@@ -175,8 +175,8 @@
+  * standards like the /dev/urandom or Windows CryptoAPI.
+  *
+  * Uncomment this macro to disable the built-in platform entropy functions.
+-#define POLARSSL_NO_PLATFORM_ENTROPY
+  */
++#define POLARSSL_NO_PLATFORM_ENTROPY
+
+ /**
+  * \def POLARSSL_PKCS1_V21
+@@ -426,8 +426,8 @@
+  * Requires: POLARSSL_TIMING_C
+  *
+  * This module enables the HAVEGE random number generator.
+- */
+ #define POLARSSL_HAVEGE_C
++ */
+
+ /**
+  * \def POLARSSL_MD_C
+@@ -490,7 +490,7 @@
+  *
+  * This module provides TCP/IP networking routines.
+  */
+-#define POLARSSL_NET_C
++//#define POLARSSL_NET_C
+
+ /**
+  * \def POLARSSL_PADLOCK_C
+@@ -644,8 +644,8 @@
+  * Caller:  library/havege.c
+  *
+  * This module is used by the HAVEGE random number generator.
+- */
+ #define POLARSSL_TIMING_C
++ */
+
+ /**
+  * \def POLARSSL_VERSION_C
+diff -Naur polarssl-1.1.4/library/bignum.c polarssl-x86_64/library/bignum.c
+--- polarssl-1.1.4/library/bignum.c	2012-04-29 16:15:55.000000000 -0400
++++ polarssl-x86_64/library/bignum.c	2012-10-30 17:21:52.135000999 -0400
+@@ -1101,7 +1101,7 @@
+             Z.p[i - t - 1] = ~0;
+         else
+         {
+-#if defined(POLARSSL_HAVE_LONGLONG)
++#if 0 //defined(POLARSSL_HAVE_LONGLONG)
+             t_udbl r;
+
+             r  = (t_udbl) X.p[i] << biL;
diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
new file mode 100644
index 0000000..b84eff1
--- /dev/null
+++ b/stubdom/tpmemu-0.7.4.patch
@@ -0,0 +1,12 @@
+diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
+--- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c	2012-04-27 10:55:46.581963398 -0400
++++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c	2012-04-27 10:56:02.193034152 -0400
+@@ -249,7 +249,7 @@
+ #else /* TPM_NO_EXTERN */
+
+ int (*tpm_extern_init)(void)                                      = NULL;
+-int (*tpm_extern_release)(void)                                   = NULL;
++void (*tpm_extern_release)(void)                                   = NULL;
+ void* (*tpm_malloc)(size_t size)                                  = NULL;
+ void (*tpm_free)(/*const*/ void *ptr)                             = NULL;
+ void (*tpm_log)(int priority, const char *fmt, ...)               = NULL;
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:36:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:36:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te81r-0007qw-Aq; Thu, 29 Nov 2012 17:36:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te81p-0007qT-B1
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:36:02 +0000
Received: from [85.158.137.99:29800] by server-5.bemta-3.messagelabs.com id
	A0/6C-26311-00D97B05; Thu, 29 Nov 2012 17:36:00 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-13.tower-217.messagelabs.com!1354210557!17248006!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2866 invoked from network); 29 Nov 2012 17:35:58 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-13.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:35:58 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158386744;
	Thu, 29 Nov 2012 12:35:48 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com
Date: Thu, 29 Nov 2012 12:35:30 -0500
Message-Id: <1354210534-31052-4-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [VTPM v5 3/7] vtpm/vtpmmgr and required libs to
	stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add 3 new libraries to stubdom:
libgmp
polarssl
Berlios TPM Emulator 0.7.4

Also adds makefile structure for vtpm-stubdom and vtpmmgrdom

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/Makefile           |  138 +++++++++++++++++++++++++++++++++++++++++++-
 stubdom/polarssl.patch     |   64 ++++++++++++++++++++
 stubdom/tpmemu-0.7.4.patch |   12 ++++
 3 files changed, 211 insertions(+), 3 deletions(-)
 create mode 100644 stubdom/polarssl.patch
 create mode 100644 stubdom/tpmemu-0.7.4.patch

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 50ba360..fc70d88 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -31,6 +31,18 @@ GRUB_VERSION=0.97
 OCAML_URL?=http://caml.inria.fr/pub/distrib/ocaml-3.11
 OCAML_VERSION=3.11.0
 
+GMP_VERSION=4.3.2
+GMP_URL?=$(XEN_EXTFILES_URL)
+#GMP_URL?=ftp://ftp.gmplib.org/pub/gmp-$(GMP_VERSION)
+
+POLARSSL_VERSION=1.1.4
+POLARSSL_URL?=$(XEN_EXTFILES_URL)
+#POLARSSL_URL?=http://polarssl.org/code/releases
+
+TPMEMU_VERSION=0.7.4
+TPMEMU_URL?=$(XEN_EXTFILES_URL)
+#TPMEMU_URL?=http://download.berlios.de/tpm-emulator
+
 WGET=wget -c
 
 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
@@ -74,12 +86,12 @@ TARGET_CPPFLAGS += -I$(XEN_ROOT)/xen/include
 
 TARGET_LDFLAGS += -nostdlib -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
 
-TARGETS=ioemu c caml grub xenstore
+TARGETS=ioemu c caml grub xenstore vtpm vtpmmgr
 
 .PHONY: all
 all: build
 ifeq ($(STUBDOM_SUPPORTED),1)
-build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom
+build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom vtpm-stubdom vtpmmgrdom
 else
 build: genpath
 endif
@@ -176,6 +188,76 @@ lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
 	touch $@
 
 #############
+# cross-gmp
+#############
+gmp-$(GMP_VERSION).tar.bz2:
+	$(WGET) $(GMP_URL)/$@
+
+.PHONY: cross-gmp
+ifeq ($(XEN_TARGET_ARCH), x86_32)
+   GMPEXT=ABI=32
+endif
+gmp-$(XEN_TARGET_ARCH): gmp-$(GMP_VERSION).tar.bz2 $(NEWLIB_STAMPFILE)
+	tar xjf $<
+	mv gmp-$(GMP_VERSION) $@
+	#patch -d $@ -p0 < gmp.patch
+	cd $@; CPPFLAGS="-isystem $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include $(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" CC=$(CC) $(GMPEXT) ./configure --disable-shared --enable-static --disable-fft --without-readline --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf
+	sed -i 's/#define HAVE_OBSTACK_VPRINTF 1/\/\/#define HAVE_OBSTACK_VPRINTF 1/' $@/config.h
+	touch $@
+
+GMP_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libgmp.a
+cross-gmp: $(GMP_STAMPFILE)
+$(GMP_STAMPFILE): gmp-$(XEN_TARGET_ARCH)
+	( cd $< && \
+	  $(MAKE) && \
+	  $(MAKE) install )
+
+#############
+# cross-polarssl
+#############
+polarssl-$(POLARSSL_VERSION)-gpl.tgz:
+	$(WGET) $(POLARSSL_URL)/$@
+
+polarssl-$(XEN_TARGET_ARCH): polarssl-$(POLARSSL_VERSION)-gpl.tgz
+	tar xzf $<
+	mv polarssl-$(POLARSSL_VERSION) $@
+	patch -d $@ -p1 < polarssl.patch
+	touch $@
+
+POLARSSL_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libpolarssl.a
+cross-polarssl: $(POLARSSL_STAMPFILE)
+$(POLARSSL_STAMPFILE): polarssl-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) lwip-$(XEN_TARGET_ARCH)
+	 ( cd $</library && \
+	   make CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I $(realpath $(MINI_OS)/include)" && \
+	   mkdir -p $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include && \
+	   cp -r ../include/* $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include && \
+	   mkdir -p $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib && \
+	   $(INSTALL_DATA) libpolarssl.a $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ )
+
+#############
+# cross-tpmemu
+#############
+tpm_emulator-$(TPMEMU_VERSION).tar.gz:
+	$(WGET) $(TPMEMU_URL)/$@
+
+tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
+	tar xzf $<
+	mv tpm_emulator-$(TPMEMU_VERSION) $@
+	patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
+	mkdir $@/build
+	cd $@/build; cmake .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
+	touch $@
+
+TPMEMU_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm.a
+$(TPMEMU_STAMPFILE): tpm_emulator-$(XEN_TARGET_ARCH) $(GMP_STAMPFILE)
+	( cd $</build && make VERBOSE=1 tpm_crypto tpm  )
+	cp $</build/crypto/libtpm_crypto.a $(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm_crypto.a
+	cp $</build/tpm/libtpm.a $(TPMEMU_STAMPFILE)
+
+.PHONY: cross-tpmemu
+cross-tpmemu: $(TPMEMU_STAMPFILE)
+
+#############
 # Cross-ocaml
 #############
 
@@ -319,6 +401,24 @@ c: $(CROSS_ROOT)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
 
 ######
+# VTPM
+######
+
+.PHONY: vtpm
+vtpm: cross-polarssl cross-tpmemu
+	make -C $(MINI_OS) links
+	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+
+######
+# VTPMMGR
+######
+
+.PHONY: vtpmmgr
+vtpmmgr: cross-polarssl
+	make -C $(MINI_OS) links
+	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+
+######
 # Grub
 ######
 
@@ -362,6 +462,14 @@ caml-stubdom: mini-os-$(XEN_TARGET_ARCH)-caml lwip-$(XEN_TARGET_ARCH) libxc cros
 c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxc c
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/c/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS=$(CURDIR)/c/main.a
 
+.PHONY: vtpm-stubdom
+vtpm-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpm vtpm
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpm/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpm/vtpm.a" APP_LDLIBS="-ltpm -ltpm_crypto -lgmp"
+
+.PHONY: vtpmmgrdom
+vtpmmgrdom: mini-os-$(XEN_TARGET_ARCH)-vtpmmgr vtpmmgr
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpmmgr/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpmmgr/vtpmmgr.a" APP_LDLIBS="-lm"
+
 .PHONY: pv-grub
 pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxc grub
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/grub/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a
@@ -375,7 +483,7 @@ xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxc xenstore
 #########
 
 ifeq ($(STUBDOM_SUPPORTED),1)
-install: genpath install-readme install-ioemu install-grub install-xenstore
+install: genpath install-readme install-ioemu install-grub install-xenstore install-vtpm install-vtpmmgr
 else
 install: genpath
 endif
@@ -399,6 +507,14 @@ install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/boot"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/xenstore-stubdom.gz"
 
+install-vtpm: vtpm-stubdom
+	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-vtpm/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpm-stubdom.gz"
+
+install-vtpmmgr: vtpm-stubdom
+	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-vtpmmgr/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpmmgrdom.gz"
+
 #######
 # clean
 #######
@@ -411,8 +527,12 @@ clean:
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-caml
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
+	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
+	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
 	$(MAKE) DESTDIR= -C caml clean
 	$(MAKE) DESTDIR= -C c clean
+	$(MAKE) -C vtpm clean
+	$(MAKE) -C vtpmmgr clean
 	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f $(STUBDOMPATH)
 	[ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
@@ -426,6 +546,10 @@ crossclean: clean
 	rm -fr newlib-$(XEN_TARGET_ARCH)
 	rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH)
 	rm -fr libxc-$(XEN_TARGET_ARCH) ioemu
+	rm -fr gmp-$(XEN_TARGET_ARCH)
+	rm -fr polarssl-$(XEN_TARGET_ARCH)
+	rm -fr openssl-$(XEN_TARGET_ARCH)
+	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -f mk-headers-$(XEN_TARGET_ARCH)
 	rm -fr ocaml-$(XEN_TARGET_ARCH)
 	rm -fr include
@@ -434,6 +558,10 @@ crossclean: clean
 .PHONY: patchclean
 patchclean: crossclean
 	rm -fr newlib-$(NEWLIB_VERSION)
+	rm -fr gmp-$(XEN_TARGET_ARCH)
+	rm -fr polarssl-$(XEN_TARGET_ARCH)
+	rm -fr openssl-$(XEN_TARGET_ARCH)
+	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -fr lwip-$(XEN_TARGET_ARCH)
 	rm -fr grub-upstream
 
@@ -442,10 +570,14 @@ patchclean: crossclean
 downloadclean: patchclean
 	rm -f newlib-$(NEWLIB_VERSION).tar.gz
 	rm -f zlib-$(ZLIB_VERSION).tar.gz
+	rm -f gmp-$(GMP_VERSION).tar.gz
+	rm -f tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	rm -f pciutils-$(LIBPCI_VERSION).tar.bz2
 	rm -f grub-$(GRUB_VERSION).tar.gz
 	rm -f lwip-$(LWIP_VERSION).tar.gz
 	rm -f ocaml-$(OCAML_VERSION).tar.gz
+	rm -f polarssl-$(POLARSSL_VERSION)-gpl.tgz
+	rm -f openssl-$(POLARSSL_VERSION)-gpl.tgz
 
 .PHONY: distclean
 distclean: downloadclean
diff --git a/stubdom/polarssl.patch b/stubdom/polarssl.patch
new file mode 100644
index 0000000..d387d4e
--- /dev/null
+++ b/stubdom/polarssl.patch
@@ -0,0 +1,64 @@
+diff -Naur polarssl-1.1.4/include/polarssl/config.h polarssl-x86_64/include/polarssl/config.h
+--- polarssl-1.1.4/include/polarssl/config.h	2011-12-22 05:06:27.000000000 -0500
++++ polarssl-x86_64/include/polarssl/config.h	2012-10-30 17:18:07.567001000 -0400
+@@ -164,8 +164,8 @@
+  * application.
+  *
+  * Uncomment this macro to prevent loading of default entropy functions.
+-#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
+  */
++#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
+
+ /**
+  * \def POLARSSL_NO_PLATFORM_ENTROPY
+@@ -175,8 +175,8 @@
+  * standards like the /dev/urandom or Windows CryptoAPI.
+  *
+  * Uncomment this macro to disable the built-in platform entropy functions.
+-#define POLARSSL_NO_PLATFORM_ENTROPY
+  */
++#define POLARSSL_NO_PLATFORM_ENTROPY
+
+ /**
+  * \def POLARSSL_PKCS1_V21
+@@ -426,8 +426,8 @@
+  * Requires: POLARSSL_TIMING_C
+  *
+  * This module enables the HAVEGE random number generator.
+- */
+ #define POLARSSL_HAVEGE_C
++ */
+
+ /**
+  * \def POLARSSL_MD_C
+@@ -490,7 +490,7 @@
+  *
+  * This module provides TCP/IP networking routines.
+  */
+-#define POLARSSL_NET_C
++//#define POLARSSL_NET_C
+
+ /**
+  * \def POLARSSL_PADLOCK_C
+@@ -644,8 +644,8 @@
+  * Caller:  library/havege.c
+  *
+  * This module is used by the HAVEGE random number generator.
+- */
+ #define POLARSSL_TIMING_C
++ */
+
+ /**
+  * \def POLARSSL_VERSION_C
+diff -Naur polarssl-1.1.4/library/bignum.c polarssl-x86_64/library/bignum.c
+--- polarssl-1.1.4/library/bignum.c	2012-04-29 16:15:55.000000000 -0400
++++ polarssl-x86_64/library/bignum.c	2012-10-30 17:21:52.135000999 -0400
+@@ -1101,7 +1101,7 @@
+             Z.p[i - t - 1] = ~0;
+         else
+         {
+-#if defined(POLARSSL_HAVE_LONGLONG)
++#if 0 //defined(POLARSSL_HAVE_LONGLONG)
+             t_udbl r;
+
+             r  = (t_udbl) X.p[i] << biL;
diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
new file mode 100644
index 0000000..b84eff1
--- /dev/null
+++ b/stubdom/tpmemu-0.7.4.patch
@@ -0,0 +1,12 @@
+diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
+--- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c	2012-04-27 10:55:46.581963398 -0400
++++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c	2012-04-27 10:56:02.193034152 -0400
+@@ -249,7 +249,7 @@
+ #else /* TPM_NO_EXTERN */
+
+ int (*tpm_extern_init)(void)                                      = NULL;
+-int (*tpm_extern_release)(void)                                   = NULL;
++void (*tpm_extern_release)(void)                                   = NULL;
+ void* (*tpm_malloc)(size_t size)                                  = NULL;
+ void (*tpm_free)(/*const*/ void *ptr)                             = NULL;
+ void (*tpm_log)(int priority, const char *fmt, ...)               = NULL;
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:36:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:36:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te81u-0007sI-DC; Thu, 29 Nov 2012 17:36:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te81t-0007rI-45
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:36:05 +0000
Received: from [85.158.139.83:8056] by server-12.bemta-5.messagelabs.com id
	37/EF-02886-40D97B05; Thu, 29 Nov 2012 17:36:04 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-13.tower-182.messagelabs.com!1354210558!27148841!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18876 invoked from network); 29 Nov 2012 17:36:00 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-13.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:36:00 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158386738;
	Thu, 29 Nov 2012 12:35:48 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com
Date: Thu, 29 Nov 2012 12:35:27 -0500
Message-Id: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [VTPM v5 0/7] Vtpm resubmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The following contains my vtpm patches and new configure scripts
for stubdom and the root directory.

Matthew Fioravante (7):
  add vtpm-stubdom code
  add stubdom/vtpmmgr code
  vtpm/vtpmmgr and required libs to stubdom/Makefile
  Add vtpm documentation
  Add cmake dependency to README
  Add autoconf to stubdom
  Add a real top level configure script that calls the others

 README                             |    1 +
 autogen.sh                         |    3 +
 config/Stubdom.mk.in               |   44 +
 configure                          | 3013 ++++++++++++++++++++++++-
 configure.ac                       |   14 +
 docs/misc/vtpm.txt                 |  357 ++-
 m4/curses.m4                       |   20 +
 m4/extfs.m4                        |   20 +
 m4/features.m4                     |   21 +
 m4/fetcher.m4                      |   14 +
 m4/ocaml.m4                        |  241 ++
 m4/path_or_fail.m4                 |   13 +
 m4/pkg.m4                          |  157 ++
 m4/pthread.m4                      |   41 +
 m4/ptyfuncs.m4                     |   35 +
 m4/python_devel.m4                 |   36 +
 m4/python_version.m4               |   12 +
 m4/savevar.m4                      |    6 +
 m4/set_cflags_ldflags.m4           |   19 +
 m4/stubdom.m4                      |   63 +
 m4/uuid.m4                         |    9 +
 stubdom/Makefile                   |  154 +-
 stubdom/configure                  | 4370 ++++++++++++++++++++++++++++++++++++
 stubdom/configure.ac               |   54 +
 stubdom/install.sh                 |    1 +
 stubdom/polarssl.patch             |   64 +
 stubdom/tpmemu-0.7.4.patch         |   12 +
 stubdom/vtpm/Makefile              |   37 +
 stubdom/vtpm/README                |   75 +
 stubdom/vtpm/minios.cfg            |   14 +
 stubdom/vtpm/vtpm.c                |  404 ++++
 stubdom/vtpm/vtpm.h                |   36 +
 stubdom/vtpm/vtpm_cmd.c            |  256 +++
 stubdom/vtpm/vtpm_cmd.h            |   31 +
 stubdom/vtpm/vtpm_pcrs.c           |   43 +
 stubdom/vtpm/vtpm_pcrs.h           |   53 +
 stubdom/vtpm/vtpmblk.c             |  307 +++
 stubdom/vtpm/vtpmblk.h             |   31 +
 stubdom/vtpmmgr/Makefile           |   32 +
 stubdom/vtpmmgr/README             |   75 +
 stubdom/vtpmmgr/init.c             |  553 +++++
 stubdom/vtpmmgr/log.c              |  151 ++
 stubdom/vtpmmgr/log.h              |   85 +
 stubdom/vtpmmgr/marshal.h          |  528 +++++
 stubdom/vtpmmgr/minios.cfg         |   14 +
 stubdom/vtpmmgr/tcg.h              |  707 ++++++
 stubdom/vtpmmgr/tpm.c              |  938 ++++++++
 stubdom/vtpmmgr/tpm.h              |  218 ++
 stubdom/vtpmmgr/tpmrsa.c           |  175 ++
 stubdom/vtpmmgr/tpmrsa.h           |   67 +
 stubdom/vtpmmgr/uuid.h             |   50 +
 stubdom/vtpmmgr/vtpm_cmd_handler.c |  152 ++
 stubdom/vtpmmgr/vtpm_manager.h     |   64 +
 stubdom/vtpmmgr/vtpm_storage.c     |  794 +++++++
 stubdom/vtpmmgr/vtpm_storage.h     |   68 +
 stubdom/vtpmmgr/vtpmmgr.c          |   93 +
 stubdom/vtpmmgr/vtpmmgr.h          |   77 +
 tools/configure                    |  601 ++---
 tools/configure.ac                 |   30 +-
 tools/m4/curses.m4                 |   20 -
 tools/m4/extfs.m4                  |   20 -
 tools/m4/features.m4               |   21 -
 tools/m4/fetcher.m4                |   14 -
 tools/m4/ocaml.m4                  |  241 --
 tools/m4/path_or_fail.m4           |    6 -
 tools/m4/pkg.m4                    |  157 --
 tools/m4/pthread.m4                |   41 -
 tools/m4/ptyfuncs.m4               |   35 -
 tools/m4/python_devel.m4           |   36 -
 tools/m4/python_version.m4         |   12 -
 tools/m4/savevar.m4                |    6 -
 tools/m4/set_cflags_ldflags.m4     |   20 -
 tools/m4/uuid.m4                   |    9 -
 73 files changed, 15115 insertions(+), 1076 deletions(-)
 create mode 100644 config/Stubdom.mk.in
 create mode 100644 configure.ac
 create mode 100644 m4/curses.m4
 create mode 100644 m4/extfs.m4
 create mode 100644 m4/features.m4
 create mode 100644 m4/fetcher.m4
 create mode 100644 m4/ocaml.m4
 create mode 100644 m4/path_or_fail.m4
 create mode 100644 m4/pkg.m4
 create mode 100644 m4/pthread.m4
 create mode 100644 m4/ptyfuncs.m4
 create mode 100644 m4/python_devel.m4
 create mode 100644 m4/python_version.m4
 create mode 100644 m4/savevar.m4
 create mode 100644 m4/set_cflags_ldflags.m4
 create mode 100644 m4/stubdom.m4
 create mode 100644 m4/uuid.m4
 create mode 100755 stubdom/configure
 create mode 100644 stubdom/configure.ac
 create mode 100644 stubdom/install.sh
 create mode 100644 stubdom/polarssl.patch
 create mode 100644 stubdom/tpmemu-0.7.4.patch
 create mode 100644 stubdom/vtpm/Makefile
 create mode 100644 stubdom/vtpm/README
 create mode 100644 stubdom/vtpm/minios.cfg
 create mode 100644 stubdom/vtpm/vtpm.c
 create mode 100644 stubdom/vtpm/vtpm.h
 create mode 100644 stubdom/vtpm/vtpm_cmd.c
 create mode 100644 stubdom/vtpm/vtpm_cmd.h
 create mode 100644 stubdom/vtpm/vtpm_pcrs.c
 create mode 100644 stubdom/vtpm/vtpm_pcrs.h
 create mode 100644 stubdom/vtpm/vtpmblk.c
 create mode 100644 stubdom/vtpm/vtpmblk.h
 create mode 100644 stubdom/vtpmmgr/Makefile
 create mode 100644 stubdom/vtpmmgr/README
 create mode 100644 stubdom/vtpmmgr/init.c
 create mode 100644 stubdom/vtpmmgr/log.c
 create mode 100644 stubdom/vtpmmgr/log.h
 create mode 100644 stubdom/vtpmmgr/marshal.h
 create mode 100644 stubdom/vtpmmgr/minios.cfg
 create mode 100644 stubdom/vtpmmgr/tcg.h
 create mode 100644 stubdom/vtpmmgr/tpm.c
 create mode 100644 stubdom/vtpmmgr/tpm.h
 create mode 100644 stubdom/vtpmmgr/tpmrsa.c
 create mode 100644 stubdom/vtpmmgr/tpmrsa.h
 create mode 100644 stubdom/vtpmmgr/uuid.h
 create mode 100644 stubdom/vtpmmgr/vtpm_cmd_handler.c
 create mode 100644 stubdom/vtpmmgr/vtpm_manager.h
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.c
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.h
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.c
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.h
 delete mode 100644 tools/m4/curses.m4
 delete mode 100644 tools/m4/extfs.m4
 delete mode 100644 tools/m4/features.m4
 delete mode 100644 tools/m4/fetcher.m4
 delete mode 100644 tools/m4/ocaml.m4
 delete mode 100644 tools/m4/path_or_fail.m4
 delete mode 100644 tools/m4/pkg.m4
 delete mode 100644 tools/m4/pthread.m4
 delete mode 100644 tools/m4/ptyfuncs.m4
 delete mode 100644 tools/m4/python_devel.m4
 delete mode 100644 tools/m4/python_version.m4
 delete mode 100644 tools/m4/savevar.m4
 delete mode 100644 tools/m4/set_cflags_ldflags.m4
 delete mode 100644 tools/m4/uuid.m4

-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:36:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:36:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te81u-0007sI-DC; Thu, 29 Nov 2012 17:36:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te81t-0007rI-45
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:36:05 +0000
Received: from [85.158.139.83:8056] by server-12.bemta-5.messagelabs.com id
	37/EF-02886-40D97B05; Thu, 29 Nov 2012 17:36:04 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-13.tower-182.messagelabs.com!1354210558!27148841!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18876 invoked from network); 29 Nov 2012 17:36:00 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-13.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:36:00 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158386738;
	Thu, 29 Nov 2012 12:35:48 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com
Date: Thu, 29 Nov 2012 12:35:27 -0500
Message-Id: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [VTPM v5 0/7] Vtpm resubmit
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The following contains my vtpm patches and new configure scripts
for stubdom and the root directory.

Matthew Fioravante (7):
  add vtpm-stubdom code
  add stubdom/vtpmmgr code
  vtpm/vtpmmgr and required libs to stubdom/Makefile
  Add vtpm documentation
  Add cmake dependency to README
  Add autoconf to stubdom
  Add a real top level configure script that calls the others

 README                             |    1 +
 autogen.sh                         |    3 +
 config/Stubdom.mk.in               |   44 +
 configure                          | 3013 ++++++++++++++++++++++++-
 configure.ac                       |   14 +
 docs/misc/vtpm.txt                 |  357 ++-
 m4/curses.m4                       |   20 +
 m4/extfs.m4                        |   20 +
 m4/features.m4                     |   21 +
 m4/fetcher.m4                      |   14 +
 m4/ocaml.m4                        |  241 ++
 m4/path_or_fail.m4                 |   13 +
 m4/pkg.m4                          |  157 ++
 m4/pthread.m4                      |   41 +
 m4/ptyfuncs.m4                     |   35 +
 m4/python_devel.m4                 |   36 +
 m4/python_version.m4               |   12 +
 m4/savevar.m4                      |    6 +
 m4/set_cflags_ldflags.m4           |   19 +
 m4/stubdom.m4                      |   63 +
 m4/uuid.m4                         |    9 +
 stubdom/Makefile                   |  154 +-
 stubdom/configure                  | 4370 ++++++++++++++++++++++++++++++++++++
 stubdom/configure.ac               |   54 +
 stubdom/install.sh                 |    1 +
 stubdom/polarssl.patch             |   64 +
 stubdom/tpmemu-0.7.4.patch         |   12 +
 stubdom/vtpm/Makefile              |   37 +
 stubdom/vtpm/README                |   75 +
 stubdom/vtpm/minios.cfg            |   14 +
 stubdom/vtpm/vtpm.c                |  404 ++++
 stubdom/vtpm/vtpm.h                |   36 +
 stubdom/vtpm/vtpm_cmd.c            |  256 +++
 stubdom/vtpm/vtpm_cmd.h            |   31 +
 stubdom/vtpm/vtpm_pcrs.c           |   43 +
 stubdom/vtpm/vtpm_pcrs.h           |   53 +
 stubdom/vtpm/vtpmblk.c             |  307 +++
 stubdom/vtpm/vtpmblk.h             |   31 +
 stubdom/vtpmmgr/Makefile           |   32 +
 stubdom/vtpmmgr/README             |   75 +
 stubdom/vtpmmgr/init.c             |  553 +++++
 stubdom/vtpmmgr/log.c              |  151 ++
 stubdom/vtpmmgr/log.h              |   85 +
 stubdom/vtpmmgr/marshal.h          |  528 +++++
 stubdom/vtpmmgr/minios.cfg         |   14 +
 stubdom/vtpmmgr/tcg.h              |  707 ++++++
 stubdom/vtpmmgr/tpm.c              |  938 ++++++++
 stubdom/vtpmmgr/tpm.h              |  218 ++
 stubdom/vtpmmgr/tpmrsa.c           |  175 ++
 stubdom/vtpmmgr/tpmrsa.h           |   67 +
 stubdom/vtpmmgr/uuid.h             |   50 +
 stubdom/vtpmmgr/vtpm_cmd_handler.c |  152 ++
 stubdom/vtpmmgr/vtpm_manager.h     |   64 +
 stubdom/vtpmmgr/vtpm_storage.c     |  794 +++++++
 stubdom/vtpmmgr/vtpm_storage.h     |   68 +
 stubdom/vtpmmgr/vtpmmgr.c          |   93 +
 stubdom/vtpmmgr/vtpmmgr.h          |   77 +
 tools/configure                    |  601 ++---
 tools/configure.ac                 |   30 +-
 tools/m4/curses.m4                 |   20 -
 tools/m4/extfs.m4                  |   20 -
 tools/m4/features.m4               |   21 -
 tools/m4/fetcher.m4                |   14 -
 tools/m4/ocaml.m4                  |  241 --
 tools/m4/path_or_fail.m4           |    6 -
 tools/m4/pkg.m4                    |  157 --
 tools/m4/pthread.m4                |   41 -
 tools/m4/ptyfuncs.m4               |   35 -
 tools/m4/python_devel.m4           |   36 -
 tools/m4/python_version.m4         |   12 -
 tools/m4/savevar.m4                |    6 -
 tools/m4/set_cflags_ldflags.m4     |   20 -
 tools/m4/uuid.m4                   |    9 -
 73 files changed, 15115 insertions(+), 1076 deletions(-)
 create mode 100644 config/Stubdom.mk.in
 create mode 100644 configure.ac
 create mode 100644 m4/curses.m4
 create mode 100644 m4/extfs.m4
 create mode 100644 m4/features.m4
 create mode 100644 m4/fetcher.m4
 create mode 100644 m4/ocaml.m4
 create mode 100644 m4/path_or_fail.m4
 create mode 100644 m4/pkg.m4
 create mode 100644 m4/pthread.m4
 create mode 100644 m4/ptyfuncs.m4
 create mode 100644 m4/python_devel.m4
 create mode 100644 m4/python_version.m4
 create mode 100644 m4/savevar.m4
 create mode 100644 m4/set_cflags_ldflags.m4
 create mode 100644 m4/stubdom.m4
 create mode 100644 m4/uuid.m4
 create mode 100755 stubdom/configure
 create mode 100644 stubdom/configure.ac
 create mode 100644 stubdom/install.sh
 create mode 100644 stubdom/polarssl.patch
 create mode 100644 stubdom/tpmemu-0.7.4.patch
 create mode 100644 stubdom/vtpm/Makefile
 create mode 100644 stubdom/vtpm/README
 create mode 100644 stubdom/vtpm/minios.cfg
 create mode 100644 stubdom/vtpm/vtpm.c
 create mode 100644 stubdom/vtpm/vtpm.h
 create mode 100644 stubdom/vtpm/vtpm_cmd.c
 create mode 100644 stubdom/vtpm/vtpm_cmd.h
 create mode 100644 stubdom/vtpm/vtpm_pcrs.c
 create mode 100644 stubdom/vtpm/vtpm_pcrs.h
 create mode 100644 stubdom/vtpm/vtpmblk.c
 create mode 100644 stubdom/vtpm/vtpmblk.h
 create mode 100644 stubdom/vtpmmgr/Makefile
 create mode 100644 stubdom/vtpmmgr/README
 create mode 100644 stubdom/vtpmmgr/init.c
 create mode 100644 stubdom/vtpmmgr/log.c
 create mode 100644 stubdom/vtpmmgr/log.h
 create mode 100644 stubdom/vtpmmgr/marshal.h
 create mode 100644 stubdom/vtpmmgr/minios.cfg
 create mode 100644 stubdom/vtpmmgr/tcg.h
 create mode 100644 stubdom/vtpmmgr/tpm.c
 create mode 100644 stubdom/vtpmmgr/tpm.h
 create mode 100644 stubdom/vtpmmgr/tpmrsa.c
 create mode 100644 stubdom/vtpmmgr/tpmrsa.h
 create mode 100644 stubdom/vtpmmgr/uuid.h
 create mode 100644 stubdom/vtpmmgr/vtpm_cmd_handler.c
 create mode 100644 stubdom/vtpmmgr/vtpm_manager.h
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.c
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.h
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.c
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.h
 delete mode 100644 tools/m4/curses.m4
 delete mode 100644 tools/m4/extfs.m4
 delete mode 100644 tools/m4/features.m4
 delete mode 100644 tools/m4/fetcher.m4
 delete mode 100644 tools/m4/ocaml.m4
 delete mode 100644 tools/m4/path_or_fail.m4
 delete mode 100644 tools/m4/pkg.m4
 delete mode 100644 tools/m4/pthread.m4
 delete mode 100644 tools/m4/ptyfuncs.m4
 delete mode 100644 tools/m4/python_devel.m4
 delete mode 100644 tools/m4/python_version.m4
 delete mode 100644 tools/m4/savevar.m4
 delete mode 100644 tools/m4/set_cflags_ldflags.m4
 delete mode 100644 tools/m4/uuid.m4

-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:36:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:36:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te81s-0007rL-OH; Thu, 29 Nov 2012 17:36:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te81r-0007qq-AX
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:36:03 +0000
Received: from [85.158.143.99:59729] by server-2.bemta-4.messagelabs.com id
	B5/F4-28922-20D97B05; Thu, 29 Nov 2012 17:36:02 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354210557!22145016!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD,UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12581 invoked from network); 29 Nov 2012 17:35:58 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-12.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:35:58 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158386740;
	Thu, 29 Nov 2012 12:35:48 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com
Date: Thu, 29 Nov 2012 12:35:28 -0500
Message-Id: <1354210534-31052-2-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [VTPM v5 1/7] add vtpm-stubdom code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add the code base for vtpm-stubdom to the stubdom
heirarchy. Makefile changes in later patch.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/vtpm/Makefile    |   37 +++++
 stubdom/vtpm/minios.cfg  |   14 ++
 stubdom/vtpm/vtpm.c      |  404 ++++++++++++++++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm.h      |   36 +++++
 stubdom/vtpm/vtpm_cmd.c  |  256 +++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm_cmd.h  |   31 ++++
 stubdom/vtpm/vtpm_pcrs.c |   43 +++++
 stubdom/vtpm/vtpm_pcrs.h |   53 ++++++
 stubdom/vtpm/vtpmblk.c   |  307 +++++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpmblk.h   |   31 ++++
 10 files changed, 1212 insertions(+)
 create mode 100644 stubdom/vtpm/Makefile
 create mode 100644 stubdom/vtpm/minios.cfg
 create mode 100644 stubdom/vtpm/vtpm.c
 create mode 100644 stubdom/vtpm/vtpm.h
 create mode 100644 stubdom/vtpm/vtpm_cmd.c
 create mode 100644 stubdom/vtpm/vtpm_cmd.h
 create mode 100644 stubdom/vtpm/vtpm_pcrs.c
 create mode 100644 stubdom/vtpm/vtpm_pcrs.h
 create mode 100644 stubdom/vtpm/vtpmblk.c
 create mode 100644 stubdom/vtpm/vtpmblk.h

diff --git a/stubdom/vtpm/Makefile b/stubdom/vtpm/Makefile
new file mode 100644
index 0000000..686c0ea
--- /dev/null
+++ b/stubdom/vtpm/Makefile
@@ -0,0 +1,37 @@
+# Copyright (c) 2010-2012 United States Government, as represented by
+# the Secretary of Defense.  All rights reserved.
+#
+# THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+# ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+# INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+# DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+# SOFTWARE.
+#
+
+XEN_ROOT=../..
+
+PSSL_DIR=../polarssl-$(XEN_TARGET_ARCH)/library
+PSSL_OBJS=aes.o sha1.o entropy.o ctr_drbg.o sha4.o
+
+TARGET=vtpm.a
+OBJS=vtpm.o vtpm_cmd.o vtpmblk.o vtpm_pcrs.o
+
+
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/build
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/tpm
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/crypto
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)
+
+$(TARGET): $(OBJS)
+	ar -cr $@ $(OBJS) $(TPMEMU_OBJS) $(foreach obj,$(PSSL_OBJS),$(PSSL_DIR)/$(obj))
+
+$(OBJS): vtpm_manager.h
+
+vtpm_manager.h:
+	ln -s ../vtpmmgr/vtpm_manager.h vtpm_manager.h
+
+clean:
+	-rm $(TARGET) $(OBJS) vtpm_manager.h
+
+.PHONY: clean
diff --git a/stubdom/vtpm/minios.cfg b/stubdom/vtpm/minios.cfg
new file mode 100644
index 0000000..31652ee
--- /dev/null
+++ b/stubdom/vtpm/minios.cfg
@@ -0,0 +1,14 @@
+CONFIG_TPMFRONT=y
+CONFIG_TPM_TIS=n
+CONFIG_TPMBACK=y
+CONFIG_START_NETWORK=n
+CONFIG_TEST=n
+CONFIG_PCIFRONT=n
+CONFIG_BLKFRONT=y
+CONFIG_NETFRONT=n
+CONFIG_FBFRONT=n
+CONFIG_KBDFRONT=n
+CONFIG_CONSFRONT=n
+CONFIG_XENBUS=y
+CONFIG_LWIP=n
+CONFIG_XC=n
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
new file mode 100644
index 0000000..71aef78
--- /dev/null
+++ b/stubdom/vtpm/vtpm.c
@@ -0,0 +1,404 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <syslog.h>
+#include <stdbool.h>
+#include <errno.h>
+#include <sys/time.h>
+#include <xen/xen.h>
+#include <tpmback.h>
+#include <tpmfront.h>
+
+#include <polarssl/entropy.h>
+#include <polarssl/ctr_drbg.h>
+
+#include "tpm/tpm_emulator_extern.h"
+#include "tpm/tpm_marshalling.h"
+#include "vtpm.h"
+#include "vtpm_cmd.h"
+#include "vtpm_pcrs.h"
+#include "vtpmblk.h"
+
+#define TPM_LOG_INFO LOG_INFO
+#define TPM_LOG_ERROR LOG_ERR
+#define TPM_LOG_DEBUG LOG_DEBUG
+
+/* Global commandline options - default values */
+struct Opt_args opt_args = {
+   .startup = ST_CLEAR,
+   .loglevel = TPM_LOG_INFO,
+   .hwinitpcrs = VTPM_PCRNONE,
+   .tpmconf = 0,
+   .enable_maint_cmds = false,
+};
+
+static uint32_t badords[32];
+static unsigned int n_badords = 0;
+
+entropy_context entropy;
+ctr_drbg_context ctr_drbg;
+
+struct tpmfront_dev* tpmfront_dev;
+
+void vtpm_get_extern_random_bytes(void *buf, size_t nbytes)
+{
+   ctr_drbg_random(&ctr_drbg, buf, nbytes);
+}
+
+int vtpm_read_from_file(uint8_t **data, size_t *data_length) {
+   return read_vtpmblk(tpmfront_dev, data, data_length);
+}
+
+int vtpm_write_to_file(uint8_t *data, size_t data_length) {
+   return write_vtpmblk(tpmfront_dev, data, data_length);
+}
+
+int vtpm_extern_init_fake(void) {
+   return 0;
+}
+
+void vtpm_extern_release_fake(void) {
+}
+
+
+void vtpm_log(int priority, const char *fmt, ...)
+{
+   if(opt_args.loglevel >= priority) {
+      va_list v;
+      va_start(v, fmt);
+      vprintf(fmt, v);
+      va_end(v);
+   }
+}
+
+static uint64_t vtpm_get_ticks(void)
+{
+  static uint64_t old_t = 0;
+  uint64_t new_t, res_t;
+  struct timeval tv;
+  gettimeofday(&tv, NULL);
+  new_t = (uint64_t)tv.tv_sec * 1000000 + (uint64_t)tv.tv_usec;
+  res_t = (old_t > 0) ? new_t - old_t : 0;
+  old_t = new_t;
+  return res_t;
+}
+
+
+static int tpm_entropy_source(void* dummy, unsigned char* data, size_t len, size_t* olen) {
+   UINT32 sz = len;
+   TPM_RESULT rc = VTPM_GetRandom(tpmfront_dev, data, &sz);
+   *olen = sz;
+   return rc == TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
+}
+
+int init_random(void) {
+   /* Initialize the rng */
+   entropy_init(&entropy);
+   entropy_add_source(&entropy, tpm_entropy_source, NULL, 0);
+   entropy_gather(&entropy);
+   ctr_drbg_init(&ctr_drbg, entropy_func, &entropy, NULL, 0);
+   ctr_drbg_set_prediction_resistance( &ctr_drbg, CTR_DRBG_PR_OFF );
+
+   return 0;
+}
+
+int check_ordinal(tpmcmd_t* tpmcmd) {
+   TPM_COMMAND_CODE ord;
+   UINT32 len = 4;
+   BYTE* ptr;
+   unsigned int i;
+
+   if(tpmcmd->req_len < 10) {
+      return true;
+   }
+
+   ptr = tpmcmd->req + 6;
+   tpm_unmarshal_UINT32(&ptr, &len, &ord);
+
+   for(i = 0; i < n_badords; ++i) {
+      if(ord == badords[i]) {
+         error("Disabled command ordinal (%" PRIu32") requested!\n");
+         return false;
+      }
+   }
+   return true;
+}
+
+static void main_loop(void) {
+   tpmcmd_t* tpmcmd = NULL;
+   domid_t domid;		/* Domid of frontend */
+   unsigned int handle;	/* handle of frontend */
+   int res = -1;
+
+   info("VTPM Initializing\n");
+
+   /* Set required tpm config args */
+   opt_args.tpmconf |= TPM_CONF_STRONG_PERSISTENCE;
+   opt_args.tpmconf &= ~TPM_CONF_USE_INTERNAL_PRNG;
+   opt_args.tpmconf |= TPM_CONF_GENERATE_EK;
+   opt_args.tpmconf |= TPM_CONF_GENERATE_SEED_DAA;
+
+   /* Initialize the emulator */
+   tpm_emulator_init(opt_args.startup, opt_args.tpmconf);
+
+   /* Initialize any requested PCRs with hardware TPM values */
+   if(vtpm_initialize_hw_pcrs(tpmfront_dev, opt_args.hwinitpcrs) != TPM_SUCCESS) {
+      error("Failed to initialize PCRs with hardware TPM values");
+      goto abort_postpcrs;
+   }
+
+   /* Wait for the frontend domain to connect */
+   info("Waiting for frontend domain to connect..");
+   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
+      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
+   } else {
+      error("Unable to attach to a frontend");
+   }
+
+   tpmcmd = tpmback_req(domid, handle);
+   while(tpmcmd) {
+      /* Handle the request */
+      if(tpmcmd->req_len) {
+	 tpmcmd->resp = NULL;
+	 tpmcmd->resp_len = 0;
+
+         /* First check for disabled ordinals */
+         if(!check_ordinal(tpmcmd)) {
+            create_error_response(tpmcmd, TPM_BAD_ORDINAL);
+         }
+         /* If not disabled, do the command */
+         else {
+            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
+               error("tpm_handle_command() failed");
+               create_error_response(tpmcmd, TPM_FAIL);
+            }
+         }
+      }
+
+      /* Send the response */
+      tpmback_resp(tpmcmd);
+
+      /* Wait for the next request */
+      tpmcmd = tpmback_req(domid, handle);
+
+   }
+
+abort_postpcrs:
+   info("VTPM Shutting down\n");
+
+   tpm_emulator_shutdown();
+}
+
+int parse_cmd_line(int argc, char** argv)
+{
+   char sval[25];
+   char* logstr = NULL;
+   /* Parse the command strings */
+   for(unsigned int i = 1; i < argc; ++i) {
+      if (sscanf(argv[i], "loglevel=%25s", sval) == 1){
+	 if (!strcmp(sval, "debug")) {
+	    opt_args.loglevel = TPM_LOG_DEBUG;
+	    logstr = "debug";
+	 }
+	 else if (!strcmp(sval, "info")) {
+	    logstr = "info";
+	    opt_args.loglevel = TPM_LOG_INFO;
+	 }
+	 else if (!strcmp(sval, "error")) {
+	    logstr = "error";
+	    opt_args.loglevel = TPM_LOG_ERROR;
+	 }
+      }
+      else if (!strcmp(argv[i], "clear")) {
+	 opt_args.startup = ST_CLEAR;
+      }
+      else if (!strcmp(argv[i], "save")) {
+	 opt_args.startup = ST_SAVE;
+      }
+      else if (!strcmp(argv[i], "deactivated")) {
+	 opt_args.startup = ST_DEACTIVATED;
+      }
+      else if (!strncmp(argv[i], "maintcmds=", 10)) {
+         if(!strcmp(argv[i] + 10, "1")) {
+            opt_args.enable_maint_cmds = true;
+         } else if(!strcmp(argv[i] + 10, "0")) {
+            opt_args.enable_maint_cmds = false;
+         }
+      }
+      else if(!strncmp(argv[i], "hwinitpcr=", 10)) {
+         char *pch = argv[i] + 10;
+         unsigned int v1, v2;
+         pch = strtok(pch, ",");
+         while(pch != NULL) {
+            if(!strcmp(pch, "all")) {
+               //Set all
+               opt_args.hwinitpcrs = VTPM_PCRALL;
+            } else if(!strcmp(pch, "none")) {
+               //Set none
+               opt_args.hwinitpcrs = VTPM_PCRNONE;
+            } else if(sscanf(pch, "%u", &v1) == 1) {
+               //Set one
+               if(v1 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               opt_args.hwinitpcrs |= (1 << v1);
+            } else if(sscanf(pch, "%u-%u", &v1, &v2) == 2) {
+               //Set range
+               if(v1 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               if(v2 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               if(v2 < v1) {
+                  unsigned tp = v1;
+                  v1 = v2;
+                  v2 = tp;
+               }
+               for(unsigned int i = v1; i <= v2; ++i) {
+                  opt_args.hwinitpcrs |= (1 << i);
+               }
+            } else {
+               error("hwintipcr error: Invalid PCR specification : %s", pch);
+               return -1;
+            }
+            pch = strtok(NULL, ",");
+         }
+      }
+      else {
+	 error("Invalid command line option `%s'", argv[i]);
+      }
+
+   }
+
+   /* Check Errors and print results */
+   switch(opt_args.startup) {
+      case ST_CLEAR:
+	 info("Startup mode is `clear'");
+	 break;
+      case ST_SAVE:
+	 info("Startup mode is `save'");
+	 break;
+      case ST_DEACTIVATED:
+	 info("Startup mode is `deactivated'");
+	 break;
+      default:
+	 error("Invalid startup mode %d", opt_args.startup);
+	 return -1;
+   }
+
+   if(opt_args.hwinitpcrs & (VTPM_PCRALL))
+   {
+      char pcrstr[1024];
+      char* ptr = pcrstr;
+
+      pcrstr[0] = '\0';
+      info("The following PCRs will be initialized with values from the hardware TPM:");
+      for(unsigned int i = 0; i < TPM_NUM_PCR; ++i) {
+         if(opt_args.hwinitpcrs & (1 << i)) {
+            ptr += sprintf(ptr, "%u, ", i);
+         }
+      }
+      /* get rid of the last comma if any numbers were printed */
+      *(ptr -2) = '\0';
+
+      info("\t%s", pcrstr);
+   } else {
+      info("All PCRs initialized to default values");
+   }
+
+   if(!opt_args.enable_maint_cmds) {
+      info("TPM Maintenance Commands disabled");
+      badords[n_badords++] = TPM_ORD_CreateMaintenanceArchive;
+      badords[n_badords++] = TPM_ORD_LoadMaintenanceArchive;
+      badords[n_badords++] = TPM_ORD_KillMaintenanceFeature;
+      badords[n_badords++] = TPM_ORD_LoadManuMaintPub;
+      badords[n_badords++] = TPM_ORD_ReadManuMaintPub;
+   } else {
+      info("TPM Maintenance Commands enabled");
+   }
+
+   info("Log level set to %s", logstr);
+
+   return 0;
+}
+
+void cleanup_opt_args(void) {
+}
+
+int main(int argc, char **argv)
+{
+   //FIXME: initializing blkfront without this sleep causes the domain to crash on boot
+   sleep(2);
+
+   /* Setup extern function pointers */
+   tpm_extern_init = vtpm_extern_init_fake;
+   tpm_extern_release = vtpm_extern_release_fake;
+   tpm_malloc = malloc;
+   tpm_free = free;
+   tpm_log = vtpm_log;
+   tpm_get_ticks = vtpm_get_ticks;
+   tpm_get_extern_random_bytes = vtpm_get_extern_random_bytes;
+   tpm_write_to_storage = vtpm_write_to_file;
+   tpm_read_from_storage = vtpm_read_from_file;
+
+   info("starting TPM Emulator (1.2.%d.%d-%d)", VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD);
+   if(parse_cmd_line(argc, argv)) {
+      error("Error parsing commandline\n");
+      return -1;
+   }
+
+   /* Initialize devices */
+   init_tpmback();
+   if((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
+      error("Unable to initialize tpmfront device");
+      goto abort_posttpmfront;
+   }
+
+   /* Seed the RNG with entropy from hardware TPM */
+   if(init_random()) {
+      error("Unable to initialize RNG");
+      goto abort_postrng;
+   }
+
+   /* Initialize blkfront device */
+   if(init_vtpmblk(tpmfront_dev)) {
+      error("Unable to initialize Blkfront persistent storage");
+      goto abort_postvtpmblk;
+   }
+
+   /* Run main loop */
+   main_loop();
+
+   /* Shutdown blkfront */
+   shutdown_vtpmblk();
+abort_postvtpmblk:
+abort_postrng:
+
+   /* Close devices */
+   shutdown_tpmfront(tpmfront_dev);
+abort_posttpmfront:
+   shutdown_tpmback();
+
+   cleanup_opt_args();
+
+   return 0;
+}
diff --git a/stubdom/vtpm/vtpm.h b/stubdom/vtpm/vtpm.h
new file mode 100644
index 0000000..5919e44
--- /dev/null
+++ b/stubdom/vtpm/vtpm.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef VTPM_H
+#define VTPM_H
+
+#include <stdbool.h>
+
+/* For testing */
+#define VERS_CMD "\x00\xC1\x00\x00\x00\x16\x00\x00\x00\x65\x00\x00\x00\x05\x00\x00\x00\x04\x00\x00\x01\x03"
+#define VERS_CMD_LEN 22
+
+/* Global commandline options */
+struct Opt_args {
+   enum StartUp {
+      ST_CLEAR = 1,
+      ST_SAVE = 2,
+      ST_DEACTIVATED = 3
+   } startup;
+   unsigned long hwinitpcrs;
+   int loglevel;
+   uint32_t tpmconf;
+   bool enable_maint_cmds;
+};
+extern struct Opt_args opt_args;
+
+#endif
diff --git a/stubdom/vtpm/vtpm_cmd.c b/stubdom/vtpm/vtpm_cmd.c
new file mode 100644
index 0000000..7eae98b
--- /dev/null
+++ b/stubdom/vtpm/vtpm_cmd.c
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <types.h>
+#include <xen/xen.h>
+#include <mm.h>
+#include <gnttab.h>
+#include "tpm/tpm_marshalling.h"
+#include "vtpm_manager.h"
+#include "vtpm_cmd.h"
+#include <tpmback.h>
+
+#define TRYFAILGOTO(C) \
+   if((C)) { \
+      status = TPM_FAIL; \
+      goto abort_egress; \
+   }
+#define TRYFAILGOTOMSG(C, msg) \
+   if((C)) { \
+      status = TPM_FAIL; \
+      error(msg); \
+      goto abort_egress; \
+   }
+#define CHECKSTATUSGOTO(ret, fname) \
+   if((ret) != TPM_SUCCESS) { \
+      error("%s failed with error code (%lu)", fname, (unsigned long) ret); \
+      status = ord; \
+      goto abort_egress; \
+   }
+
+#define ERR_MALFORMED "Malformed response from backend"
+#define ERR_TPMFRONT "Error sending command through frontend device"
+
+struct shpage {
+   void* page;
+   grant_ref_t grantref;
+};
+
+typedef struct shpage shpage_t;
+
+static inline int pack_header(uint8_t** bptr, UINT32* len, TPM_TAG tag, UINT32 size, TPM_COMMAND_CODE ord)
+{
+   return *bptr == NULL ||
+	 tpm_marshal_UINT16(bptr, len, tag) ||
+	 tpm_marshal_UINT32(bptr, len, size) ||
+	 tpm_marshal_UINT32(bptr, len, ord);
+}
+
+static inline int unpack_header(uint8_t** bptr, UINT32* len, TPM_TAG* tag, UINT32* size, TPM_COMMAND_CODE* ord)
+{
+   return *bptr == NULL ||
+	 tpm_unmarshal_UINT16(bptr, len, tag) ||
+	 tpm_unmarshal_UINT32(bptr, len, size) ||
+	 tpm_unmarshal_UINT32(bptr, len, ord);
+}
+
+int create_error_response(tpmcmd_t* tpmcmd, TPM_RESULT errorcode)
+{
+   TPM_TAG tag;
+   UINT32 len = tpmcmd->req_len;
+   uint8_t* respptr;
+   uint8_t* cmdptr = tpmcmd->req;
+
+   if(!tpm_unmarshal_UINT16(&cmdptr, &len, &tag)) {
+      switch (tag) {
+         case TPM_TAG_RQU_COMMAND:
+            tag = TPM_TAG_RSP_COMMAND;
+            break;
+         case TPM_TAG_RQU_AUTH1_COMMAND:
+            tag = TPM_TAG_RQU_AUTH2_COMMAND;
+            break;
+         case TPM_TAG_RQU_AUTH2_COMMAND:
+            tag = TPM_TAG_RQU_AUTH2_COMMAND;
+            break;
+      }
+   } else {
+      tag = TPM_TAG_RSP_COMMAND;
+   }
+
+   tpmcmd->resp_len = len = 10;
+   tpmcmd->resp = respptr = tpm_malloc(tpmcmd->resp_len);
+
+   return pack_header(&respptr, &len, tag, len, errorcode);
+}
+
+TPM_RESULT VTPM_GetRandom(struct tpmfront_dev* tpmfront_dev, BYTE* bytes, UINT32 *numbytes) {
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* cmdbuf, *resp, *bptr;
+   size_t resplen = 0;
+   UINT32 len;
+
+   /*Ask the real tpm for random bytes for the seed */
+   TPM_TAG tag = TPM_TAG_RQU_COMMAND;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = TPM_ORD_GetRandom;
+   len = size = sizeof(TPM_TAG) + sizeof(UINT32) + sizeof(TPM_COMMAND_CODE) + sizeof(UINT32);
+
+   /*Create the raw tpm command */
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   TRYFAILGOTO(tpm_marshal_UINT32(&bptr, &len, *numbytes));
+
+   /* Send cmd, wait for response */
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen),
+      ERR_TPMFRONT);
+
+   bptr = resp; len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   //Check return status of command
+   CHECKSTATUSGOTO(ord, "TPM_GetRandom()");
+
+   // Get the number of random bytes in the response
+   TRYFAILGOTOMSG(tpm_unmarshal_UINT32(&bptr, &len, &size), ERR_MALFORMED);
+   *numbytes = size;
+
+   //Get the random bytes out, tpm may give us less bytes than what we wanrt
+   TRYFAILGOTOMSG(tpm_unmarshal_BYTE_ARRAY(&bptr, &len, bytes, *numbytes), ERR_MALFORMED);
+
+   goto egress;
+abort_egress:
+egress:
+   free(cmdbuf);
+   return status;
+
+}
+
+TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* bptr, *resp;
+   uint8_t* cmdbuf = NULL;
+   size_t resplen = 0;
+   UINT32 len;
+
+   TPM_TAG tag = VTPM_TAG_REQ;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = VTPM_ORD_LOADHASHKEY;
+
+   /*Create the command*/
+   len = size = VTPM_COMMAND_HEADER_SIZE;
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+
+   /* Send the command to vtpm_manager */
+   info("Requesting Encryption key from backend");
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   /* Unpack response header */
+   bptr = resp;
+   len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   /* Check return code */
+   CHECKSTATUSGOTO(ord, "VTPM_LoadHashKey()");
+
+   /* Get the size of the key */
+   *data_length = size - VTPM_COMMAND_HEADER_SIZE;
+
+   /* Copy the key bits */
+   *data = malloc(*data_length);
+   memcpy(*data, bptr, *data_length);
+
+   goto egress;
+abort_egress:
+   error("VTPM_LoadHashKey failed");
+egress:
+   free(cmdbuf);
+   return status;
+}
+
+TPM_RESULT VTPM_SaveHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* bptr, *resp;
+   uint8_t* cmdbuf = NULL;
+   size_t resplen = 0;
+   UINT32 len;
+
+   TPM_TAG tag = VTPM_TAG_REQ;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = VTPM_ORD_SAVEHASHKEY;
+
+   /*Create the command*/
+   len = size = VTPM_COMMAND_HEADER_SIZE + data_length;
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   memcpy(bptr, data, data_length);
+   bptr += data_length;
+
+   /* Send the command to vtpm_manager */
+   info("Sending encryption key to backend");
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   /* Unpack response header */
+   bptr = resp;
+   len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   /* Check return code */
+   CHECKSTATUSGOTO(ord, "VTPM_SaveHashKey()");
+
+   goto egress;
+abort_egress:
+   error("VTPM_SaveHashKey failed");
+egress:
+   free(cmdbuf);
+   return status;
+}
+
+TPM_RESULT VTPM_PCRRead(struct tpmfront_dev* tpmfront_dev, UINT32 pcrIndex, BYTE* outDigest)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t *cmdbuf, *resp, *bptr;
+   size_t resplen = 0;
+   UINT32 len;
+
+   /*Just send a TPM_PCRRead Command to the HW tpm */
+   TPM_TAG tag = TPM_TAG_RQU_COMMAND;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = TPM_ORD_PCRRead;
+   len = size = sizeof(TPM_TAG) + sizeof(UINT32) + sizeof(TPM_COMMAND_CODE) + sizeof(UINT32);
+
+   /*Create the raw tpm cmd */
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   TRYFAILGOTO(tpm_marshal_UINT32(&bptr, &len, pcrIndex));
+
+   /*Send Cmd wait for response */
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   bptr = resp; len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   //Check return status of command
+   CHECKSTATUSGOTO(ord, "TPM_PCRRead");
+
+   //Get the ptr value
+   memcpy(outDigest, bptr, sizeof(TPM_PCRVALUE));
+
+   goto egress;
+abort_egress:
+egress:
+   free(cmdbuf);
+   return status;
+
+}
diff --git a/stubdom/vtpm/vtpm_cmd.h b/stubdom/vtpm/vtpm_cmd.h
new file mode 100644
index 0000000..b0bfa22
--- /dev/null
+++ b/stubdom/vtpm/vtpm_cmd.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef MANAGER_H
+#define MANAGER_H
+
+#include <tpmfront.h>
+#include <tpmback.h>
+#include "tpm/tpm_structures.h"
+
+/* Create a command response error header */
+int create_error_response(tpmcmd_t* tpmcmd, TPM_RESULT errorcode);
+/* Request random bytes from hardware tpm, returns 0 on success */
+TPM_RESULT VTPM_GetRandom(struct tpmfront_dev* tpmfront_dev, BYTE* bytes, UINT32* numbytes);
+/* Retreive 256 bit AES encryption key from manager */
+TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length);
+/* Manager securely saves our 256 bit AES encryption key */
+TPM_RESULT VTPM_SaveHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length);
+/* Send a TPM_PCRRead command passthrough the manager to the hw tpm */
+TPM_RESULT VTPM_PCRRead(struct tpmfront_dev* tpmfront_dev, UINT32 pcrIndex, BYTE* outDigest);
+
+#endif
diff --git a/stubdom/vtpm/vtpm_pcrs.c b/stubdom/vtpm/vtpm_pcrs.c
new file mode 100644
index 0000000..22a6cef
--- /dev/null
+++ b/stubdom/vtpm/vtpm_pcrs.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include "vtpm_pcrs.h"
+#include "vtpm_cmd.h"
+#include "tpm/tpm_data.h"
+
+#define PCR_VALUE      tpmData.permanent.data.pcrValue
+
+static int write_pcr_direct(unsigned int pcrIndex, uint8_t* val) {
+   if(pcrIndex > TPM_NUM_PCR) {
+      return TPM_BADINDEX;
+   }
+   memcpy(&PCR_VALUE[pcrIndex], val, sizeof(TPM_PCRVALUE));
+   return TPM_SUCCESS;
+}
+
+TPM_RESULT vtpm_initialize_hw_pcrs(struct tpmfront_dev* tpmfront_dev, unsigned long pcrs)
+{
+   TPM_RESULT rc = TPM_SUCCESS;
+   uint8_t digest[sizeof(TPM_PCRVALUE)];
+
+   for(unsigned int i = 0; i < TPM_NUM_PCR; ++i) {
+      if(pcrs & 1 << i) {
+         if((rc = VTPM_PCRRead(tpmfront_dev, i, digest)) != TPM_SUCCESS) {
+            error("TPM_PCRRead failed with error : %d", rc);
+            return rc;
+         }
+         write_pcr_direct(i, digest);
+      }
+   }
+
+   return rc;
+}
diff --git a/stubdom/vtpm/vtpm_pcrs.h b/stubdom/vtpm/vtpm_pcrs.h
new file mode 100644
index 0000000..11835f9
--- /dev/null
+++ b/stubdom/vtpm/vtpm_pcrs.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef VTPM_PCRS_H
+#define VTPM_PCRS_H
+
+#include "tpm/tpm_structures.h"
+
+#define VTPM_PCR0 1
+#define VTPM_PCR1 1 << 1
+#define VTPM_PCR2 1 << 2
+#define VTPM_PCR3 1 << 3
+#define VTPM_PCR4 1 << 4
+#define VTPM_PCR5 1 << 5
+#define VTPM_PCR6 1 << 6
+#define VTPM_PCR7 1 << 7
+#define VTPM_PCR8 1 << 8
+#define VTPM_PCR9 1 << 9
+#define VTPM_PCR10 1 << 10
+#define VTPM_PCR11 1 << 11
+#define VTPM_PCR12 1 << 12
+#define VTPM_PCR13 1 << 13
+#define VTPM_PCR14 1 << 14
+#define VTPM_PCR15 1 << 15
+#define VTPM_PCR16 1 << 16
+#define VTPM_PCR17 1 << 17
+#define VTPM_PCR18 1 << 18
+#define VTPM_PCR19 1 << 19
+#define VTPM_PCR20 1 << 20
+#define VTPM_PCR21 1 << 21
+#define VTPM_PCR22 1 << 22
+#define VTPM_PCR23 1 << 23
+
+#define VTPM_PCRALL (1 << TPM_NUM_PCR) - 1
+#define VTPM_PCRNONE 0
+
+#define VTPM_NUMPCRS 24
+
+struct tpmfront_dev;
+
+TPM_RESULT vtpm_initialize_hw_pcrs(struct tpmfront_dev* tpmfront_dev, unsigned long pcrs);
+
+
+#endif
diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
new file mode 100644
index 0000000..b343bd8
--- /dev/null
+++ b/stubdom/vtpm/vtpmblk.c
@@ -0,0 +1,307 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <mini-os/byteorder.h>
+#include "vtpmblk.h"
+#include "tpm/tpm_marshalling.h"
+#include "vtpm_cmd.h"
+#include "polarssl/aes.h"
+#include "polarssl/sha1.h"
+#include <blkfront.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+
+/*Encryption key and block sizes */
+#define BLKSZ 16
+
+static struct blkfront_dev* blkdev = NULL;
+static int blkfront_fd = -1;
+
+int init_vtpmblk(struct tpmfront_dev* tpmfront_dev)
+{
+   struct blkfront_info blkinfo;
+   info("Initializing persistent NVM storage\n");
+
+   if((blkdev = init_blkfront(NULL, &blkinfo)) == NULL) {
+      error("BLKIO: ERROR Unable to initialize blkfront");
+      return -1;
+   }
+   if (blkinfo.info & VDISK_READONLY || blkinfo.mode != O_RDWR) {
+      error("BLKIO: ERROR block device is read only!");
+      goto error;
+   }
+   if((blkfront_fd = blkfront_open(blkdev)) == -1) {
+      error("Unable to open blkfront file descriptor!");
+      goto error;
+   }
+
+   return 0;
+error:
+   shutdown_blkfront(blkdev);
+   blkdev = NULL;
+   return -1;
+}
+
+void shutdown_vtpmblk(void)
+{
+   close(blkfront_fd);
+   blkfront_fd = -1;
+   blkdev = NULL;
+}
+
+int write_vtpmblk_raw(uint8_t *data, size_t data_length)
+{
+   int rc;
+   uint32_t lenbuf;
+   debug("Begin Write data=%p len=%u", data, data_length);
+
+   lenbuf = cpu_to_be32((uint32_t)data_length);
+
+   lseek(blkfront_fd, 0, SEEK_SET);
+   if((rc = write(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
+      error("write(length) failed! error was %s", strerror(errno));
+      return -1;
+   }
+   if((rc = write(blkfront_fd, data, data_length)) != data_length) {
+      error("write(data) failed! error was %s", strerror(errno));
+      return -1;
+   }
+
+   info("Wrote %u bytes to NVM persistent storage", data_length);
+
+   return 0;
+}
+
+int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
+{
+   int rc;
+   uint32_t lenbuf;
+
+   lseek(blkfront_fd, 0, SEEK_SET);
+   if(( rc = read(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
+      error("read(length) failed! error was %s", strerror(errno));
+      return -1;
+   }
+   *data_length = (size_t) cpu_to_be32(lenbuf);
+   if(*data_length == 0) {
+      error("read 0 data_length for NVM");
+      return -1;
+   }
+
+   *data = tpm_malloc(*data_length);
+   if((rc = read(blkfront_fd, *data, *data_length)) != *data_length) {
+      error("read(data) failed! error was %s", strerror(errno));
+      return -1;
+   }
+
+   info("Read %u bytes from NVM persistent storage", *data_length);
+   return 0;
+}
+
+int encrypt_vtpmblk(uint8_t* clear, size_t clear_len, uint8_t** cipher, size_t* cipher_len, uint8_t* symkey)
+{
+   int rc = 0;
+   uint8_t iv[BLKSZ];
+   aes_context aes_ctx;
+   UINT32 temp;
+   int mod;
+
+   uint8_t* clbuf = NULL;
+
+   uint8_t* ivptr;
+   int ivlen;
+
+   uint8_t* cptr;	//Cipher block pointer
+   int clen;	//Cipher block length
+
+   /*Create a new 256 bit encryption key */
+   if(symkey == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+   tpm_get_extern_random_bytes(symkey, NVMKEYSZ);
+
+   /*Setup initialization vector - random bits and then 4 bytes clear text size at the end*/
+   temp = sizeof(UINT32);
+   ivlen = BLKSZ - temp;
+   tpm_get_extern_random_bytes(iv, ivlen);
+   ivptr = iv + ivlen;
+   tpm_marshal_UINT32(&ivptr, &temp, (UINT32) clear_len);
+
+   /*The clear text needs to be padded out to a multiple of BLKSZ */
+   mod = clear_len % BLKSZ;
+   clen = mod ? clear_len + BLKSZ - mod : clear_len;
+   clbuf = malloc(clen);
+   if (clbuf == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+   memcpy(clbuf, clear, clear_len);
+   /* zero out the padding bits - FIXME: better / more secure way to handle these? */
+   if(clen - clear_len) {
+      memset(clbuf + clear_len, 0, clen - clear_len);
+   }
+
+   /* Setup the ciphertext buffer */
+   *cipher_len = BLKSZ + clen;		/*iv + ciphertext */
+   cptr = *cipher = malloc(*cipher_len);
+   if (*cipher == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Copy the IV to cipher text blob*/
+   memcpy(cptr, iv, BLKSZ);
+   cptr += BLKSZ;
+
+   /* Setup encryption */
+   aes_setkey_enc(&aes_ctx, symkey, 256);
+
+   /* Do encryption now */
+   aes_crypt_cbc(&aes_ctx, AES_ENCRYPT, clen, iv, clbuf, cptr);
+
+   goto egress;
+abort_egress:
+egress:
+   free(clbuf);
+   return rc;
+}
+int decrypt_vtpmblk(uint8_t* cipher, size_t cipher_len, uint8_t** clear, size_t* clear_len, uint8_t* symkey)
+{
+   int rc = 0;
+   uint8_t iv[BLKSZ];
+   uint8_t* ivptr;
+   UINT32 u32, temp;
+   aes_context aes_ctx;
+
+   uint8_t* cptr = cipher;	//cipher block pointer
+   int clen = cipher_len;	//cipher block length
+
+   /* Pull out the initialization vector */
+   memcpy(iv, cipher, BLKSZ);
+   cptr += BLKSZ;
+   clen -= BLKSZ;
+
+   /* Setup the clear text buffer */
+   if((*clear = malloc(clen)) == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Get the length of clear text from last 4 bytes of iv */
+   temp = sizeof(UINT32);
+   ivptr = iv + BLKSZ - temp;
+   tpm_unmarshal_UINT32(&ivptr, &temp, &u32);
+   *clear_len = u32;
+
+   /* Setup decryption */
+   aes_setkey_dec(&aes_ctx, symkey, 256);
+
+   /* Do decryption now */
+   if ((clen % BLKSZ) != 0) {
+      error("Decryption Error: Cipher block size was not a multiple of %u", BLKSZ);
+      rc = -1;
+      goto abort_egress;
+   }
+   aes_crypt_cbc(&aes_ctx, AES_DECRYPT, clen, iv, cptr, *clear);
+
+   goto egress;
+abort_egress:
+egress:
+   return rc;
+}
+
+int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length) {
+   int rc;
+   uint8_t* cipher = NULL;
+   size_t cipher_len = 0;
+   uint8_t hashkey[HASHKEYSZ];
+   uint8_t* symkey = hashkey + HASHSZ;
+
+   /* Encrypt the data */
+   if((rc = encrypt_vtpmblk(data, data_length, &cipher, &cipher_len, symkey))) {
+      goto abort_egress;
+   }
+   /* Write to disk */
+   if((rc = write_vtpmblk_raw(cipher, cipher_len))) {
+      goto abort_egress;
+   }
+   /* Get sha1 hash of data */
+   sha1(cipher, cipher_len, hashkey);
+
+   /* Send hash and key to manager */
+   if((rc = VTPM_SaveHashKey(tpmfront_dev, hashkey, HASHKEYSZ)) != TPM_SUCCESS) {
+      goto abort_egress;
+   }
+   goto egress;
+abort_egress:
+egress:
+   free(cipher);
+   return rc;
+}
+
+int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data_length) {
+   int rc;
+   uint8_t* cipher = NULL;
+   size_t cipher_len = 0;
+   size_t keysize;
+   uint8_t* hashkey = NULL;
+   uint8_t hash[HASHSZ];
+   uint8_t* symkey;
+
+   /* Retreive the hash and the key from the manager */
+   if((rc = VTPM_LoadHashKey(tpmfront_dev, &hashkey, &keysize)) != TPM_SUCCESS) {
+      goto abort_egress;
+   }
+   if(keysize != HASHKEYSZ) {
+      error("Manager returned a hashkey of invalid size! expected %d, actual %d", NVMKEYSZ, keysize);
+      rc = -1;
+      goto abort_egress;
+   }
+   symkey = hashkey + HASHSZ;
+
+   /* Read from disk now */
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len))) {
+      goto abort_egress;
+   }
+
+   /* Compute the hash of the cipher text and compare */
+   sha1(cipher, cipher_len, hash);
+   if(memcmp(hash, hashkey, HASHSZ)) {
+      int i;
+      error("NVM Storage Checksum failed!");
+      printf("Expected: ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hashkey[i]);
+      }
+      printf("\n");
+      printf("Actual:   ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hash[i]);
+      }
+      printf("\n");
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Decrypt the blob */
+   if((rc = decrypt_vtpmblk(cipher, cipher_len, data, data_length, symkey))) {
+      goto abort_egress;
+   }
+   goto egress;
+abort_egress:
+egress:
+   free(cipher);
+   free(hashkey);
+   return rc;
+}
diff --git a/stubdom/vtpm/vtpmblk.h b/stubdom/vtpm/vtpmblk.h
new file mode 100644
index 0000000..282ce6a
--- /dev/null
+++ b/stubdom/vtpm/vtpmblk.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef NVM_H
+#define NVM_H
+#include <mini-os/types.h>
+#include <xen/xen.h>
+#include <tpmfront.h>
+
+#define NVMKEYSZ 32
+#define HASHSZ 20
+#define HASHKEYSZ (NVMKEYSZ + HASHSZ)
+
+int init_vtpmblk(struct tpmfront_dev* tpmfront_dev);
+void shutdown_vtpmblk(void);
+
+/* Encrypts and writes data to blk device */
+int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t *data, size_t data_length);
+/* Reads, Decrypts, and returns data from blk device */
+int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t **data, size_t *data_length);
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:36:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:36:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te81s-0007rL-OH; Thu, 29 Nov 2012 17:36:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te81r-0007qq-AX
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:36:03 +0000
Received: from [85.158.143.99:59729] by server-2.bemta-4.messagelabs.com id
	B5/F4-28922-20D97B05; Thu, 29 Nov 2012 17:36:02 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354210557!22145016!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD,UNPARSEABLE_RELAY,
	UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12581 invoked from network); 29 Nov 2012 17:35:58 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-12.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:35:58 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158386740;
	Thu, 29 Nov 2012 12:35:48 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com
Date: Thu, 29 Nov 2012 12:35:28 -0500
Message-Id: <1354210534-31052-2-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [VTPM v5 1/7] add vtpm-stubdom code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add the code base for vtpm-stubdom to the stubdom
heirarchy. Makefile changes in later patch.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/vtpm/Makefile    |   37 +++++
 stubdom/vtpm/minios.cfg  |   14 ++
 stubdom/vtpm/vtpm.c      |  404 ++++++++++++++++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm.h      |   36 +++++
 stubdom/vtpm/vtpm_cmd.c  |  256 +++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm_cmd.h  |   31 ++++
 stubdom/vtpm/vtpm_pcrs.c |   43 +++++
 stubdom/vtpm/vtpm_pcrs.h |   53 ++++++
 stubdom/vtpm/vtpmblk.c   |  307 +++++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpmblk.h   |   31 ++++
 10 files changed, 1212 insertions(+)
 create mode 100644 stubdom/vtpm/Makefile
 create mode 100644 stubdom/vtpm/minios.cfg
 create mode 100644 stubdom/vtpm/vtpm.c
 create mode 100644 stubdom/vtpm/vtpm.h
 create mode 100644 stubdom/vtpm/vtpm_cmd.c
 create mode 100644 stubdom/vtpm/vtpm_cmd.h
 create mode 100644 stubdom/vtpm/vtpm_pcrs.c
 create mode 100644 stubdom/vtpm/vtpm_pcrs.h
 create mode 100644 stubdom/vtpm/vtpmblk.c
 create mode 100644 stubdom/vtpm/vtpmblk.h

diff --git a/stubdom/vtpm/Makefile b/stubdom/vtpm/Makefile
new file mode 100644
index 0000000..686c0ea
--- /dev/null
+++ b/stubdom/vtpm/Makefile
@@ -0,0 +1,37 @@
+# Copyright (c) 2010-2012 United States Government, as represented by
+# the Secretary of Defense.  All rights reserved.
+#
+# THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+# ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+# INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+# DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+# SOFTWARE.
+#
+
+XEN_ROOT=../..
+
+PSSL_DIR=../polarssl-$(XEN_TARGET_ARCH)/library
+PSSL_OBJS=aes.o sha1.o entropy.o ctr_drbg.o sha4.o
+
+TARGET=vtpm.a
+OBJS=vtpm.o vtpm_cmd.o vtpmblk.o vtpm_pcrs.o
+
+
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/build
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/tpm
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)/crypto
+CPPFLAGS+=-I../tpm_emulator-$(XEN_TARGET_ARCH)
+
+$(TARGET): $(OBJS)
+	ar -cr $@ $(OBJS) $(TPMEMU_OBJS) $(foreach obj,$(PSSL_OBJS),$(PSSL_DIR)/$(obj))
+
+$(OBJS): vtpm_manager.h
+
+vtpm_manager.h:
+	ln -s ../vtpmmgr/vtpm_manager.h vtpm_manager.h
+
+clean:
+	-rm $(TARGET) $(OBJS) vtpm_manager.h
+
+.PHONY: clean
diff --git a/stubdom/vtpm/minios.cfg b/stubdom/vtpm/minios.cfg
new file mode 100644
index 0000000..31652ee
--- /dev/null
+++ b/stubdom/vtpm/minios.cfg
@@ -0,0 +1,14 @@
+CONFIG_TPMFRONT=y
+CONFIG_TPM_TIS=n
+CONFIG_TPMBACK=y
+CONFIG_START_NETWORK=n
+CONFIG_TEST=n
+CONFIG_PCIFRONT=n
+CONFIG_BLKFRONT=y
+CONFIG_NETFRONT=n
+CONFIG_FBFRONT=n
+CONFIG_KBDFRONT=n
+CONFIG_CONSFRONT=n
+CONFIG_XENBUS=y
+CONFIG_LWIP=n
+CONFIG_XC=n
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
new file mode 100644
index 0000000..71aef78
--- /dev/null
+++ b/stubdom/vtpm/vtpm.c
@@ -0,0 +1,404 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <syslog.h>
+#include <stdbool.h>
+#include <errno.h>
+#include <sys/time.h>
+#include <xen/xen.h>
+#include <tpmback.h>
+#include <tpmfront.h>
+
+#include <polarssl/entropy.h>
+#include <polarssl/ctr_drbg.h>
+
+#include "tpm/tpm_emulator_extern.h"
+#include "tpm/tpm_marshalling.h"
+#include "vtpm.h"
+#include "vtpm_cmd.h"
+#include "vtpm_pcrs.h"
+#include "vtpmblk.h"
+
+#define TPM_LOG_INFO LOG_INFO
+#define TPM_LOG_ERROR LOG_ERR
+#define TPM_LOG_DEBUG LOG_DEBUG
+
+/* Global commandline options - default values */
+struct Opt_args opt_args = {
+   .startup = ST_CLEAR,
+   .loglevel = TPM_LOG_INFO,
+   .hwinitpcrs = VTPM_PCRNONE,
+   .tpmconf = 0,
+   .enable_maint_cmds = false,
+};
+
+static uint32_t badords[32];
+static unsigned int n_badords = 0;
+
+entropy_context entropy;
+ctr_drbg_context ctr_drbg;
+
+struct tpmfront_dev* tpmfront_dev;
+
+void vtpm_get_extern_random_bytes(void *buf, size_t nbytes)
+{
+   ctr_drbg_random(&ctr_drbg, buf, nbytes);
+}
+
+int vtpm_read_from_file(uint8_t **data, size_t *data_length) {
+   return read_vtpmblk(tpmfront_dev, data, data_length);
+}
+
+int vtpm_write_to_file(uint8_t *data, size_t data_length) {
+   return write_vtpmblk(tpmfront_dev, data, data_length);
+}
+
+int vtpm_extern_init_fake(void) {
+   return 0;
+}
+
+void vtpm_extern_release_fake(void) {
+}
+
+
+void vtpm_log(int priority, const char *fmt, ...)
+{
+   if(opt_args.loglevel >= priority) {
+      va_list v;
+      va_start(v, fmt);
+      vprintf(fmt, v);
+      va_end(v);
+   }
+}
+
+static uint64_t vtpm_get_ticks(void)
+{
+  static uint64_t old_t = 0;
+  uint64_t new_t, res_t;
+  struct timeval tv;
+  gettimeofday(&tv, NULL);
+  new_t = (uint64_t)tv.tv_sec * 1000000 + (uint64_t)tv.tv_usec;
+  res_t = (old_t > 0) ? new_t - old_t : 0;
+  old_t = new_t;
+  return res_t;
+}
+
+
+static int tpm_entropy_source(void* dummy, unsigned char* data, size_t len, size_t* olen) {
+   UINT32 sz = len;
+   TPM_RESULT rc = VTPM_GetRandom(tpmfront_dev, data, &sz);
+   *olen = sz;
+   return rc == TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
+}
+
+int init_random(void) {
+   /* Initialize the rng */
+   entropy_init(&entropy);
+   entropy_add_source(&entropy, tpm_entropy_source, NULL, 0);
+   entropy_gather(&entropy);
+   ctr_drbg_init(&ctr_drbg, entropy_func, &entropy, NULL, 0);
+   ctr_drbg_set_prediction_resistance( &ctr_drbg, CTR_DRBG_PR_OFF );
+
+   return 0;
+}
+
+int check_ordinal(tpmcmd_t* tpmcmd) {
+   TPM_COMMAND_CODE ord;
+   UINT32 len = 4;
+   BYTE* ptr;
+   unsigned int i;
+
+   if(tpmcmd->req_len < 10) {
+      return true;
+   }
+
+   ptr = tpmcmd->req + 6;
+   tpm_unmarshal_UINT32(&ptr, &len, &ord);
+
+   for(i = 0; i < n_badords; ++i) {
+      if(ord == badords[i]) {
+         error("Disabled command ordinal (%" PRIu32") requested!\n");
+         return false;
+      }
+   }
+   return true;
+}
+
+static void main_loop(void) {
+   tpmcmd_t* tpmcmd = NULL;
+   domid_t domid;		/* Domid of frontend */
+   unsigned int handle;	/* handle of frontend */
+   int res = -1;
+
+   info("VTPM Initializing\n");
+
+   /* Set required tpm config args */
+   opt_args.tpmconf |= TPM_CONF_STRONG_PERSISTENCE;
+   opt_args.tpmconf &= ~TPM_CONF_USE_INTERNAL_PRNG;
+   opt_args.tpmconf |= TPM_CONF_GENERATE_EK;
+   opt_args.tpmconf |= TPM_CONF_GENERATE_SEED_DAA;
+
+   /* Initialize the emulator */
+   tpm_emulator_init(opt_args.startup, opt_args.tpmconf);
+
+   /* Initialize any requested PCRs with hardware TPM values */
+   if(vtpm_initialize_hw_pcrs(tpmfront_dev, opt_args.hwinitpcrs) != TPM_SUCCESS) {
+      error("Failed to initialize PCRs with hardware TPM values");
+      goto abort_postpcrs;
+   }
+
+   /* Wait for the frontend domain to connect */
+   info("Waiting for frontend domain to connect..");
+   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
+      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
+   } else {
+      error("Unable to attach to a frontend");
+   }
+
+   tpmcmd = tpmback_req(domid, handle);
+   while(tpmcmd) {
+      /* Handle the request */
+      if(tpmcmd->req_len) {
+	 tpmcmd->resp = NULL;
+	 tpmcmd->resp_len = 0;
+
+         /* First check for disabled ordinals */
+         if(!check_ordinal(tpmcmd)) {
+            create_error_response(tpmcmd, TPM_BAD_ORDINAL);
+         }
+         /* If not disabled, do the command */
+         else {
+            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
+               error("tpm_handle_command() failed");
+               create_error_response(tpmcmd, TPM_FAIL);
+            }
+         }
+      }
+
+      /* Send the response */
+      tpmback_resp(tpmcmd);
+
+      /* Wait for the next request */
+      tpmcmd = tpmback_req(domid, handle);
+
+   }
+
+abort_postpcrs:
+   info("VTPM Shutting down\n");
+
+   tpm_emulator_shutdown();
+}
+
+int parse_cmd_line(int argc, char** argv)
+{
+   char sval[25];
+   char* logstr = NULL;
+   /* Parse the command strings */
+   for(unsigned int i = 1; i < argc; ++i) {
+      if (sscanf(argv[i], "loglevel=%25s", sval) == 1){
+	 if (!strcmp(sval, "debug")) {
+	    opt_args.loglevel = TPM_LOG_DEBUG;
+	    logstr = "debug";
+	 }
+	 else if (!strcmp(sval, "info")) {
+	    logstr = "info";
+	    opt_args.loglevel = TPM_LOG_INFO;
+	 }
+	 else if (!strcmp(sval, "error")) {
+	    logstr = "error";
+	    opt_args.loglevel = TPM_LOG_ERROR;
+	 }
+      }
+      else if (!strcmp(argv[i], "clear")) {
+	 opt_args.startup = ST_CLEAR;
+      }
+      else if (!strcmp(argv[i], "save")) {
+	 opt_args.startup = ST_SAVE;
+      }
+      else if (!strcmp(argv[i], "deactivated")) {
+	 opt_args.startup = ST_DEACTIVATED;
+      }
+      else if (!strncmp(argv[i], "maintcmds=", 10)) {
+         if(!strcmp(argv[i] + 10, "1")) {
+            opt_args.enable_maint_cmds = true;
+         } else if(!strcmp(argv[i] + 10, "0")) {
+            opt_args.enable_maint_cmds = false;
+         }
+      }
+      else if(!strncmp(argv[i], "hwinitpcr=", 10)) {
+         char *pch = argv[i] + 10;
+         unsigned int v1, v2;
+         pch = strtok(pch, ",");
+         while(pch != NULL) {
+            if(!strcmp(pch, "all")) {
+               //Set all
+               opt_args.hwinitpcrs = VTPM_PCRALL;
+            } else if(!strcmp(pch, "none")) {
+               //Set none
+               opt_args.hwinitpcrs = VTPM_PCRNONE;
+            } else if(sscanf(pch, "%u", &v1) == 1) {
+               //Set one
+               if(v1 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               opt_args.hwinitpcrs |= (1 << v1);
+            } else if(sscanf(pch, "%u-%u", &v1, &v2) == 2) {
+               //Set range
+               if(v1 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               if(v2 >= TPM_NUM_PCR) {
+                  error("hwinitpcr error: Invalid PCR index %u", v1);
+                  return -1;
+               }
+               if(v2 < v1) {
+                  unsigned tp = v1;
+                  v1 = v2;
+                  v2 = tp;
+               }
+               for(unsigned int i = v1; i <= v2; ++i) {
+                  opt_args.hwinitpcrs |= (1 << i);
+               }
+            } else {
+               error("hwintipcr error: Invalid PCR specification : %s", pch);
+               return -1;
+            }
+            pch = strtok(NULL, ",");
+         }
+      }
+      else {
+	 error("Invalid command line option `%s'", argv[i]);
+      }
+
+   }
+
+   /* Check Errors and print results */
+   switch(opt_args.startup) {
+      case ST_CLEAR:
+	 info("Startup mode is `clear'");
+	 break;
+      case ST_SAVE:
+	 info("Startup mode is `save'");
+	 break;
+      case ST_DEACTIVATED:
+	 info("Startup mode is `deactivated'");
+	 break;
+      default:
+	 error("Invalid startup mode %d", opt_args.startup);
+	 return -1;
+   }
+
+   if(opt_args.hwinitpcrs & (VTPM_PCRALL))
+   {
+      char pcrstr[1024];
+      char* ptr = pcrstr;
+
+      pcrstr[0] = '\0';
+      info("The following PCRs will be initialized with values from the hardware TPM:");
+      for(unsigned int i = 0; i < TPM_NUM_PCR; ++i) {
+         if(opt_args.hwinitpcrs & (1 << i)) {
+            ptr += sprintf(ptr, "%u, ", i);
+         }
+      }
+      /* get rid of the last comma if any numbers were printed */
+      *(ptr -2) = '\0';
+
+      info("\t%s", pcrstr);
+   } else {
+      info("All PCRs initialized to default values");
+   }
+
+   if(!opt_args.enable_maint_cmds) {
+      info("TPM Maintenance Commands disabled");
+      badords[n_badords++] = TPM_ORD_CreateMaintenanceArchive;
+      badords[n_badords++] = TPM_ORD_LoadMaintenanceArchive;
+      badords[n_badords++] = TPM_ORD_KillMaintenanceFeature;
+      badords[n_badords++] = TPM_ORD_LoadManuMaintPub;
+      badords[n_badords++] = TPM_ORD_ReadManuMaintPub;
+   } else {
+      info("TPM Maintenance Commands enabled");
+   }
+
+   info("Log level set to %s", logstr);
+
+   return 0;
+}
+
+void cleanup_opt_args(void) {
+}
+
+int main(int argc, char **argv)
+{
+   //FIXME: initializing blkfront without this sleep causes the domain to crash on boot
+   sleep(2);
+
+   /* Setup extern function pointers */
+   tpm_extern_init = vtpm_extern_init_fake;
+   tpm_extern_release = vtpm_extern_release_fake;
+   tpm_malloc = malloc;
+   tpm_free = free;
+   tpm_log = vtpm_log;
+   tpm_get_ticks = vtpm_get_ticks;
+   tpm_get_extern_random_bytes = vtpm_get_extern_random_bytes;
+   tpm_write_to_storage = vtpm_write_to_file;
+   tpm_read_from_storage = vtpm_read_from_file;
+
+   info("starting TPM Emulator (1.2.%d.%d-%d)", VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD);
+   if(parse_cmd_line(argc, argv)) {
+      error("Error parsing commandline\n");
+      return -1;
+   }
+
+   /* Initialize devices */
+   init_tpmback();
+   if((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
+      error("Unable to initialize tpmfront device");
+      goto abort_posttpmfront;
+   }
+
+   /* Seed the RNG with entropy from hardware TPM */
+   if(init_random()) {
+      error("Unable to initialize RNG");
+      goto abort_postrng;
+   }
+
+   /* Initialize blkfront device */
+   if(init_vtpmblk(tpmfront_dev)) {
+      error("Unable to initialize Blkfront persistent storage");
+      goto abort_postvtpmblk;
+   }
+
+   /* Run main loop */
+   main_loop();
+
+   /* Shutdown blkfront */
+   shutdown_vtpmblk();
+abort_postvtpmblk:
+abort_postrng:
+
+   /* Close devices */
+   shutdown_tpmfront(tpmfront_dev);
+abort_posttpmfront:
+   shutdown_tpmback();
+
+   cleanup_opt_args();
+
+   return 0;
+}
diff --git a/stubdom/vtpm/vtpm.h b/stubdom/vtpm/vtpm.h
new file mode 100644
index 0000000..5919e44
--- /dev/null
+++ b/stubdom/vtpm/vtpm.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef VTPM_H
+#define VTPM_H
+
+#include <stdbool.h>
+
+/* For testing */
+#define VERS_CMD "\x00\xC1\x00\x00\x00\x16\x00\x00\x00\x65\x00\x00\x00\x05\x00\x00\x00\x04\x00\x00\x01\x03"
+#define VERS_CMD_LEN 22
+
+/* Global commandline options */
+struct Opt_args {
+   enum StartUp {
+      ST_CLEAR = 1,
+      ST_SAVE = 2,
+      ST_DEACTIVATED = 3
+   } startup;
+   unsigned long hwinitpcrs;
+   int loglevel;
+   uint32_t tpmconf;
+   bool enable_maint_cmds;
+};
+extern struct Opt_args opt_args;
+
+#endif
diff --git a/stubdom/vtpm/vtpm_cmd.c b/stubdom/vtpm/vtpm_cmd.c
new file mode 100644
index 0000000..7eae98b
--- /dev/null
+++ b/stubdom/vtpm/vtpm_cmd.c
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <types.h>
+#include <xen/xen.h>
+#include <mm.h>
+#include <gnttab.h>
+#include "tpm/tpm_marshalling.h"
+#include "vtpm_manager.h"
+#include "vtpm_cmd.h"
+#include <tpmback.h>
+
+#define TRYFAILGOTO(C) \
+   if((C)) { \
+      status = TPM_FAIL; \
+      goto abort_egress; \
+   }
+#define TRYFAILGOTOMSG(C, msg) \
+   if((C)) { \
+      status = TPM_FAIL; \
+      error(msg); \
+      goto abort_egress; \
+   }
+#define CHECKSTATUSGOTO(ret, fname) \
+   if((ret) != TPM_SUCCESS) { \
+      error("%s failed with error code (%lu)", fname, (unsigned long) ret); \
+      status = ord; \
+      goto abort_egress; \
+   }
+
+#define ERR_MALFORMED "Malformed response from backend"
+#define ERR_TPMFRONT "Error sending command through frontend device"
+
+struct shpage {
+   void* page;
+   grant_ref_t grantref;
+};
+
+typedef struct shpage shpage_t;
+
+static inline int pack_header(uint8_t** bptr, UINT32* len, TPM_TAG tag, UINT32 size, TPM_COMMAND_CODE ord)
+{
+   return *bptr == NULL ||
+	 tpm_marshal_UINT16(bptr, len, tag) ||
+	 tpm_marshal_UINT32(bptr, len, size) ||
+	 tpm_marshal_UINT32(bptr, len, ord);
+}
+
+static inline int unpack_header(uint8_t** bptr, UINT32* len, TPM_TAG* tag, UINT32* size, TPM_COMMAND_CODE* ord)
+{
+   return *bptr == NULL ||
+	 tpm_unmarshal_UINT16(bptr, len, tag) ||
+	 tpm_unmarshal_UINT32(bptr, len, size) ||
+	 tpm_unmarshal_UINT32(bptr, len, ord);
+}
+
+int create_error_response(tpmcmd_t* tpmcmd, TPM_RESULT errorcode)
+{
+   TPM_TAG tag;
+   UINT32 len = tpmcmd->req_len;
+   uint8_t* respptr;
+   uint8_t* cmdptr = tpmcmd->req;
+
+   if(!tpm_unmarshal_UINT16(&cmdptr, &len, &tag)) {
+      switch (tag) {
+         case TPM_TAG_RQU_COMMAND:
+            tag = TPM_TAG_RSP_COMMAND;
+            break;
+         case TPM_TAG_RQU_AUTH1_COMMAND:
+            tag = TPM_TAG_RQU_AUTH2_COMMAND;
+            break;
+         case TPM_TAG_RQU_AUTH2_COMMAND:
+            tag = TPM_TAG_RQU_AUTH2_COMMAND;
+            break;
+      }
+   } else {
+      tag = TPM_TAG_RSP_COMMAND;
+   }
+
+   tpmcmd->resp_len = len = 10;
+   tpmcmd->resp = respptr = tpm_malloc(tpmcmd->resp_len);
+
+   return pack_header(&respptr, &len, tag, len, errorcode);
+}
+
+TPM_RESULT VTPM_GetRandom(struct tpmfront_dev* tpmfront_dev, BYTE* bytes, UINT32 *numbytes) {
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* cmdbuf, *resp, *bptr;
+   size_t resplen = 0;
+   UINT32 len;
+
+   /*Ask the real tpm for random bytes for the seed */
+   TPM_TAG tag = TPM_TAG_RQU_COMMAND;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = TPM_ORD_GetRandom;
+   len = size = sizeof(TPM_TAG) + sizeof(UINT32) + sizeof(TPM_COMMAND_CODE) + sizeof(UINT32);
+
+   /*Create the raw tpm command */
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   TRYFAILGOTO(tpm_marshal_UINT32(&bptr, &len, *numbytes));
+
+   /* Send cmd, wait for response */
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen),
+      ERR_TPMFRONT);
+
+   bptr = resp; len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   //Check return status of command
+   CHECKSTATUSGOTO(ord, "TPM_GetRandom()");
+
+   // Get the number of random bytes in the response
+   TRYFAILGOTOMSG(tpm_unmarshal_UINT32(&bptr, &len, &size), ERR_MALFORMED);
+   *numbytes = size;
+
+   //Get the random bytes out, tpm may give us less bytes than what we wanrt
+   TRYFAILGOTOMSG(tpm_unmarshal_BYTE_ARRAY(&bptr, &len, bytes, *numbytes), ERR_MALFORMED);
+
+   goto egress;
+abort_egress:
+egress:
+   free(cmdbuf);
+   return status;
+
+}
+
+TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* bptr, *resp;
+   uint8_t* cmdbuf = NULL;
+   size_t resplen = 0;
+   UINT32 len;
+
+   TPM_TAG tag = VTPM_TAG_REQ;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = VTPM_ORD_LOADHASHKEY;
+
+   /*Create the command*/
+   len = size = VTPM_COMMAND_HEADER_SIZE;
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+
+   /* Send the command to vtpm_manager */
+   info("Requesting Encryption key from backend");
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   /* Unpack response header */
+   bptr = resp;
+   len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   /* Check return code */
+   CHECKSTATUSGOTO(ord, "VTPM_LoadHashKey()");
+
+   /* Get the size of the key */
+   *data_length = size - VTPM_COMMAND_HEADER_SIZE;
+
+   /* Copy the key bits */
+   *data = malloc(*data_length);
+   memcpy(*data, bptr, *data_length);
+
+   goto egress;
+abort_egress:
+   error("VTPM_LoadHashKey failed");
+egress:
+   free(cmdbuf);
+   return status;
+}
+
+TPM_RESULT VTPM_SaveHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* bptr, *resp;
+   uint8_t* cmdbuf = NULL;
+   size_t resplen = 0;
+   UINT32 len;
+
+   TPM_TAG tag = VTPM_TAG_REQ;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = VTPM_ORD_SAVEHASHKEY;
+
+   /*Create the command*/
+   len = size = VTPM_COMMAND_HEADER_SIZE + data_length;
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   memcpy(bptr, data, data_length);
+   bptr += data_length;
+
+   /* Send the command to vtpm_manager */
+   info("Sending encryption key to backend");
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   /* Unpack response header */
+   bptr = resp;
+   len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   /* Check return code */
+   CHECKSTATUSGOTO(ord, "VTPM_SaveHashKey()");
+
+   goto egress;
+abort_egress:
+   error("VTPM_SaveHashKey failed");
+egress:
+   free(cmdbuf);
+   return status;
+}
+
+TPM_RESULT VTPM_PCRRead(struct tpmfront_dev* tpmfront_dev, UINT32 pcrIndex, BYTE* outDigest)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t *cmdbuf, *resp, *bptr;
+   size_t resplen = 0;
+   UINT32 len;
+
+   /*Just send a TPM_PCRRead Command to the HW tpm */
+   TPM_TAG tag = TPM_TAG_RQU_COMMAND;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = TPM_ORD_PCRRead;
+   len = size = sizeof(TPM_TAG) + sizeof(UINT32) + sizeof(TPM_COMMAND_CODE) + sizeof(UINT32);
+
+   /*Create the raw tpm cmd */
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   TRYFAILGOTO(tpm_marshal_UINT32(&bptr, &len, pcrIndex));
+
+   /*Send Cmd wait for response */
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen), ERR_TPMFRONT);
+
+   bptr = resp; len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   //Check return status of command
+   CHECKSTATUSGOTO(ord, "TPM_PCRRead");
+
+   //Get the ptr value
+   memcpy(outDigest, bptr, sizeof(TPM_PCRVALUE));
+
+   goto egress;
+abort_egress:
+egress:
+   free(cmdbuf);
+   return status;
+
+}
diff --git a/stubdom/vtpm/vtpm_cmd.h b/stubdom/vtpm/vtpm_cmd.h
new file mode 100644
index 0000000..b0bfa22
--- /dev/null
+++ b/stubdom/vtpm/vtpm_cmd.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef MANAGER_H
+#define MANAGER_H
+
+#include <tpmfront.h>
+#include <tpmback.h>
+#include "tpm/tpm_structures.h"
+
+/* Create a command response error header */
+int create_error_response(tpmcmd_t* tpmcmd, TPM_RESULT errorcode);
+/* Request random bytes from hardware tpm, returns 0 on success */
+TPM_RESULT VTPM_GetRandom(struct tpmfront_dev* tpmfront_dev, BYTE* bytes, UINT32* numbytes);
+/* Retreive 256 bit AES encryption key from manager */
+TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length);
+/* Manager securely saves our 256 bit AES encryption key */
+TPM_RESULT VTPM_SaveHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length);
+/* Send a TPM_PCRRead command passthrough the manager to the hw tpm */
+TPM_RESULT VTPM_PCRRead(struct tpmfront_dev* tpmfront_dev, UINT32 pcrIndex, BYTE* outDigest);
+
+#endif
diff --git a/stubdom/vtpm/vtpm_pcrs.c b/stubdom/vtpm/vtpm_pcrs.c
new file mode 100644
index 0000000..22a6cef
--- /dev/null
+++ b/stubdom/vtpm/vtpm_pcrs.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include "vtpm_pcrs.h"
+#include "vtpm_cmd.h"
+#include "tpm/tpm_data.h"
+
+#define PCR_VALUE      tpmData.permanent.data.pcrValue
+
+static int write_pcr_direct(unsigned int pcrIndex, uint8_t* val) {
+   if(pcrIndex > TPM_NUM_PCR) {
+      return TPM_BADINDEX;
+   }
+   memcpy(&PCR_VALUE[pcrIndex], val, sizeof(TPM_PCRVALUE));
+   return TPM_SUCCESS;
+}
+
+TPM_RESULT vtpm_initialize_hw_pcrs(struct tpmfront_dev* tpmfront_dev, unsigned long pcrs)
+{
+   TPM_RESULT rc = TPM_SUCCESS;
+   uint8_t digest[sizeof(TPM_PCRVALUE)];
+
+   for(unsigned int i = 0; i < TPM_NUM_PCR; ++i) {
+      if(pcrs & 1 << i) {
+         if((rc = VTPM_PCRRead(tpmfront_dev, i, digest)) != TPM_SUCCESS) {
+            error("TPM_PCRRead failed with error : %d", rc);
+            return rc;
+         }
+         write_pcr_direct(i, digest);
+      }
+   }
+
+   return rc;
+}
diff --git a/stubdom/vtpm/vtpm_pcrs.h b/stubdom/vtpm/vtpm_pcrs.h
new file mode 100644
index 0000000..11835f9
--- /dev/null
+++ b/stubdom/vtpm/vtpm_pcrs.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef VTPM_PCRS_H
+#define VTPM_PCRS_H
+
+#include "tpm/tpm_structures.h"
+
+#define VTPM_PCR0 1
+#define VTPM_PCR1 1 << 1
+#define VTPM_PCR2 1 << 2
+#define VTPM_PCR3 1 << 3
+#define VTPM_PCR4 1 << 4
+#define VTPM_PCR5 1 << 5
+#define VTPM_PCR6 1 << 6
+#define VTPM_PCR7 1 << 7
+#define VTPM_PCR8 1 << 8
+#define VTPM_PCR9 1 << 9
+#define VTPM_PCR10 1 << 10
+#define VTPM_PCR11 1 << 11
+#define VTPM_PCR12 1 << 12
+#define VTPM_PCR13 1 << 13
+#define VTPM_PCR14 1 << 14
+#define VTPM_PCR15 1 << 15
+#define VTPM_PCR16 1 << 16
+#define VTPM_PCR17 1 << 17
+#define VTPM_PCR18 1 << 18
+#define VTPM_PCR19 1 << 19
+#define VTPM_PCR20 1 << 20
+#define VTPM_PCR21 1 << 21
+#define VTPM_PCR22 1 << 22
+#define VTPM_PCR23 1 << 23
+
+#define VTPM_PCRALL (1 << TPM_NUM_PCR) - 1
+#define VTPM_PCRNONE 0
+
+#define VTPM_NUMPCRS 24
+
+struct tpmfront_dev;
+
+TPM_RESULT vtpm_initialize_hw_pcrs(struct tpmfront_dev* tpmfront_dev, unsigned long pcrs);
+
+
+#endif
diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
new file mode 100644
index 0000000..b343bd8
--- /dev/null
+++ b/stubdom/vtpm/vtpmblk.c
@@ -0,0 +1,307 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#include <mini-os/byteorder.h>
+#include "vtpmblk.h"
+#include "tpm/tpm_marshalling.h"
+#include "vtpm_cmd.h"
+#include "polarssl/aes.h"
+#include "polarssl/sha1.h"
+#include <blkfront.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+
+/*Encryption key and block sizes */
+#define BLKSZ 16
+
+static struct blkfront_dev* blkdev = NULL;
+static int blkfront_fd = -1;
+
+int init_vtpmblk(struct tpmfront_dev* tpmfront_dev)
+{
+   struct blkfront_info blkinfo;
+   info("Initializing persistent NVM storage\n");
+
+   if((blkdev = init_blkfront(NULL, &blkinfo)) == NULL) {
+      error("BLKIO: ERROR Unable to initialize blkfront");
+      return -1;
+   }
+   if (blkinfo.info & VDISK_READONLY || blkinfo.mode != O_RDWR) {
+      error("BLKIO: ERROR block device is read only!");
+      goto error;
+   }
+   if((blkfront_fd = blkfront_open(blkdev)) == -1) {
+      error("Unable to open blkfront file descriptor!");
+      goto error;
+   }
+
+   return 0;
+error:
+   shutdown_blkfront(blkdev);
+   blkdev = NULL;
+   return -1;
+}
+
+void shutdown_vtpmblk(void)
+{
+   close(blkfront_fd);
+   blkfront_fd = -1;
+   blkdev = NULL;
+}
+
+int write_vtpmblk_raw(uint8_t *data, size_t data_length)
+{
+   int rc;
+   uint32_t lenbuf;
+   debug("Begin Write data=%p len=%u", data, data_length);
+
+   lenbuf = cpu_to_be32((uint32_t)data_length);
+
+   lseek(blkfront_fd, 0, SEEK_SET);
+   if((rc = write(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
+      error("write(length) failed! error was %s", strerror(errno));
+      return -1;
+   }
+   if((rc = write(blkfront_fd, data, data_length)) != data_length) {
+      error("write(data) failed! error was %s", strerror(errno));
+      return -1;
+   }
+
+   info("Wrote %u bytes to NVM persistent storage", data_length);
+
+   return 0;
+}
+
+int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
+{
+   int rc;
+   uint32_t lenbuf;
+
+   lseek(blkfront_fd, 0, SEEK_SET);
+   if(( rc = read(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
+      error("read(length) failed! error was %s", strerror(errno));
+      return -1;
+   }
+   *data_length = (size_t) cpu_to_be32(lenbuf);
+   if(*data_length == 0) {
+      error("read 0 data_length for NVM");
+      return -1;
+   }
+
+   *data = tpm_malloc(*data_length);
+   if((rc = read(blkfront_fd, *data, *data_length)) != *data_length) {
+      error("read(data) failed! error was %s", strerror(errno));
+      return -1;
+   }
+
+   info("Read %u bytes from NVM persistent storage", *data_length);
+   return 0;
+}
+
+int encrypt_vtpmblk(uint8_t* clear, size_t clear_len, uint8_t** cipher, size_t* cipher_len, uint8_t* symkey)
+{
+   int rc = 0;
+   uint8_t iv[BLKSZ];
+   aes_context aes_ctx;
+   UINT32 temp;
+   int mod;
+
+   uint8_t* clbuf = NULL;
+
+   uint8_t* ivptr;
+   int ivlen;
+
+   uint8_t* cptr;	//Cipher block pointer
+   int clen;	//Cipher block length
+
+   /*Create a new 256 bit encryption key */
+   if(symkey == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+   tpm_get_extern_random_bytes(symkey, NVMKEYSZ);
+
+   /*Setup initialization vector - random bits and then 4 bytes clear text size at the end*/
+   temp = sizeof(UINT32);
+   ivlen = BLKSZ - temp;
+   tpm_get_extern_random_bytes(iv, ivlen);
+   ivptr = iv + ivlen;
+   tpm_marshal_UINT32(&ivptr, &temp, (UINT32) clear_len);
+
+   /*The clear text needs to be padded out to a multiple of BLKSZ */
+   mod = clear_len % BLKSZ;
+   clen = mod ? clear_len + BLKSZ - mod : clear_len;
+   clbuf = malloc(clen);
+   if (clbuf == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+   memcpy(clbuf, clear, clear_len);
+   /* zero out the padding bits - FIXME: better / more secure way to handle these? */
+   if(clen - clear_len) {
+      memset(clbuf + clear_len, 0, clen - clear_len);
+   }
+
+   /* Setup the ciphertext buffer */
+   *cipher_len = BLKSZ + clen;		/*iv + ciphertext */
+   cptr = *cipher = malloc(*cipher_len);
+   if (*cipher == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Copy the IV to cipher text blob*/
+   memcpy(cptr, iv, BLKSZ);
+   cptr += BLKSZ;
+
+   /* Setup encryption */
+   aes_setkey_enc(&aes_ctx, symkey, 256);
+
+   /* Do encryption now */
+   aes_crypt_cbc(&aes_ctx, AES_ENCRYPT, clen, iv, clbuf, cptr);
+
+   goto egress;
+abort_egress:
+egress:
+   free(clbuf);
+   return rc;
+}
+int decrypt_vtpmblk(uint8_t* cipher, size_t cipher_len, uint8_t** clear, size_t* clear_len, uint8_t* symkey)
+{
+   int rc = 0;
+   uint8_t iv[BLKSZ];
+   uint8_t* ivptr;
+   UINT32 u32, temp;
+   aes_context aes_ctx;
+
+   uint8_t* cptr = cipher;	//cipher block pointer
+   int clen = cipher_len;	//cipher block length
+
+   /* Pull out the initialization vector */
+   memcpy(iv, cipher, BLKSZ);
+   cptr += BLKSZ;
+   clen -= BLKSZ;
+
+   /* Setup the clear text buffer */
+   if((*clear = malloc(clen)) == NULL) {
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Get the length of clear text from last 4 bytes of iv */
+   temp = sizeof(UINT32);
+   ivptr = iv + BLKSZ - temp;
+   tpm_unmarshal_UINT32(&ivptr, &temp, &u32);
+   *clear_len = u32;
+
+   /* Setup decryption */
+   aes_setkey_dec(&aes_ctx, symkey, 256);
+
+   /* Do decryption now */
+   if ((clen % BLKSZ) != 0) {
+      error("Decryption Error: Cipher block size was not a multiple of %u", BLKSZ);
+      rc = -1;
+      goto abort_egress;
+   }
+   aes_crypt_cbc(&aes_ctx, AES_DECRYPT, clen, iv, cptr, *clear);
+
+   goto egress;
+abort_egress:
+egress:
+   return rc;
+}
+
+int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length) {
+   int rc;
+   uint8_t* cipher = NULL;
+   size_t cipher_len = 0;
+   uint8_t hashkey[HASHKEYSZ];
+   uint8_t* symkey = hashkey + HASHSZ;
+
+   /* Encrypt the data */
+   if((rc = encrypt_vtpmblk(data, data_length, &cipher, &cipher_len, symkey))) {
+      goto abort_egress;
+   }
+   /* Write to disk */
+   if((rc = write_vtpmblk_raw(cipher, cipher_len))) {
+      goto abort_egress;
+   }
+   /* Get sha1 hash of data */
+   sha1(cipher, cipher_len, hashkey);
+
+   /* Send hash and key to manager */
+   if((rc = VTPM_SaveHashKey(tpmfront_dev, hashkey, HASHKEYSZ)) != TPM_SUCCESS) {
+      goto abort_egress;
+   }
+   goto egress;
+abort_egress:
+egress:
+   free(cipher);
+   return rc;
+}
+
+int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data_length) {
+   int rc;
+   uint8_t* cipher = NULL;
+   size_t cipher_len = 0;
+   size_t keysize;
+   uint8_t* hashkey = NULL;
+   uint8_t hash[HASHSZ];
+   uint8_t* symkey;
+
+   /* Retreive the hash and the key from the manager */
+   if((rc = VTPM_LoadHashKey(tpmfront_dev, &hashkey, &keysize)) != TPM_SUCCESS) {
+      goto abort_egress;
+   }
+   if(keysize != HASHKEYSZ) {
+      error("Manager returned a hashkey of invalid size! expected %d, actual %d", NVMKEYSZ, keysize);
+      rc = -1;
+      goto abort_egress;
+   }
+   symkey = hashkey + HASHSZ;
+
+   /* Read from disk now */
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len))) {
+      goto abort_egress;
+   }
+
+   /* Compute the hash of the cipher text and compare */
+   sha1(cipher, cipher_len, hash);
+   if(memcmp(hash, hashkey, HASHSZ)) {
+      int i;
+      error("NVM Storage Checksum failed!");
+      printf("Expected: ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hashkey[i]);
+      }
+      printf("\n");
+      printf("Actual:   ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hash[i]);
+      }
+      printf("\n");
+      rc = -1;
+      goto abort_egress;
+   }
+
+   /* Decrypt the blob */
+   if((rc = decrypt_vtpmblk(cipher, cipher_len, data, data_length, symkey))) {
+      goto abort_egress;
+   }
+   goto egress;
+abort_egress:
+egress:
+   free(cipher);
+   free(hashkey);
+   return rc;
+}
diff --git a/stubdom/vtpm/vtpmblk.h b/stubdom/vtpm/vtpmblk.h
new file mode 100644
index 0000000..282ce6a
--- /dev/null
+++ b/stubdom/vtpm/vtpmblk.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+#ifndef NVM_H
+#define NVM_H
+#include <mini-os/types.h>
+#include <xen/xen.h>
+#include <tpmfront.h>
+
+#define NVMKEYSZ 32
+#define HASHSZ 20
+#define HASHKEYSZ (NVMKEYSZ + HASHSZ)
+
+int init_vtpmblk(struct tpmfront_dev* tpmfront_dev);
+void shutdown_vtpmblk(void);
+
+/* Encrypts and writes data to blk device */
+int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t *data, size_t data_length);
+/* Reads, Decrypts, and returns data from blk device */
+int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t **data, size_t *data_length);
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:36:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:36:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te81x-0007uH-Rc; Thu, 29 Nov 2012 17:36:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te81v-0007so-Gx
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:36:08 +0000
Received: from [85.158.138.51:40544] by server-2.bemta-3.messagelabs.com id
	02/B9-04744-60D97B05; Thu, 29 Nov 2012 17:36:06 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-9.tower-174.messagelabs.com!1354210557!32037323!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY,UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11050 invoked from network); 29 Nov 2012 17:35:59 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-9.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 17:35:59 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158386742;
	Thu, 29 Nov 2012 12:35:48 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com
Date: Thu, 29 Nov 2012 12:35:29 -0500
Message-Id: <1354210534-31052-3-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [VTPM v5 2/7] add stubdom/vtpmmgr code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add the code base for vtpmmgrdom. Makefile changes
next patch.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/vtpmmgr/Makefile           |   32 ++
 stubdom/vtpmmgr/init.c             |  553 +++++++++++++++++++++
 stubdom/vtpmmgr/log.c              |  151 ++++++
 stubdom/vtpmmgr/log.h              |   85 ++++
 stubdom/vtpmmgr/marshal.h          |  528 ++++++++++++++++++++
 stubdom/vtpmmgr/minios.cfg         |   14 +
 stubdom/vtpmmgr/tcg.h              |  707 +++++++++++++++++++++++++++
 stubdom/vtpmmgr/tpm.c              |  938 ++++++++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/tpm.h              |  218 +++++++++
 stubdom/vtpmmgr/tpmrsa.c           |  175 +++++++
 stubdom/vtpmmgr/tpmrsa.h           |   67 +++
 stubdom/vtpmmgr/uuid.h             |   50 ++
 stubdom/vtpmmgr/vtpm_cmd_handler.c |  152 ++++++
 stubdom/vtpmmgr/vtpm_manager.h     |   64 +++
 stubdom/vtpmmgr/vtpm_storage.c     |  794 ++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/vtpm_storage.h     |   68 +++
 stubdom/vtpmmgr/vtpmmgr.c          |   93 ++++
 stubdom/vtpmmgr/vtpmmgr.h          |   77 +++
 18 files changed, 4766 insertions(+)
 create mode 100644 stubdom/vtpmmgr/Makefile
 create mode 100644 stubdom/vtpmmgr/init.c
 create mode 100644 stubdom/vtpmmgr/log.c
 create mode 100644 stubdom/vtpmmgr/log.h
 create mode 100644 stubdom/vtpmmgr/marshal.h
 create mode 100644 stubdom/vtpmmgr/minios.cfg
 create mode 100644 stubdom/vtpmmgr/tcg.h
 create mode 100644 stubdom/vtpmmgr/tpm.c
 create mode 100644 stubdom/vtpmmgr/tpm.h
 create mode 100644 stubdom/vtpmmgr/tpmrsa.c
 create mode 100644 stubdom/vtpmmgr/tpmrsa.h
 create mode 100644 stubdom/vtpmmgr/uuid.h
 create mode 100644 stubdom/vtpmmgr/vtpm_cmd_handler.c
 create mode 100644 stubdom/vtpmmgr/vtpm_manager.h
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.c
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.h
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.c
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.h

diff --git a/stubdom/vtpmmgr/Makefile b/stubdom/vtpmmgr/Makefile
new file mode 100644
index 0000000..88c83c3
--- /dev/null
+++ b/stubdom/vtpmmgr/Makefile
@@ -0,0 +1,32 @@
+# Copyright (c) 2010-2012 United States Government, as represented by
+# the Secretary of Defense.  All rights reserved.
+#
+# THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+# ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+# INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+# DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+# SOFTWARE.
+#
+
+XEN_ROOT=../..
+
+PSSL_DIR=../polarssl-$(XEN_TARGET_ARCH)/library
+PSSL_OBJS=aes.o sha1.o entropy.o ctr_drbg.o bignum.o sha4.o havege.o timing.o entropy_poll.o
+
+TARGET=vtpmmgr.a
+OBJS=vtpmmgr.o vtpm_cmd_handler.o vtpm_storage.o init.o tpmrsa.o tpm.o log.o
+
+CFLAGS+=-Werror -Iutil -Icrypto -Itcs
+CFLAGS+=-Wno-declaration-after-statement -Wno-unused-label
+
+build: $(TARGET)
+$(TARGET): $(OBJS)
+	ar -rcs $@ $^ $(foreach obj,$(PSSL_OBJS),$(PSSL_DIR)/$(obj))
+
+clean:
+	rm -f $(TARGET) $(OBJS)
+
+distclean: clean
+
+.PHONY: clean distclean
diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
new file mode 100644
index 0000000..a158020
--- /dev/null
+++ b/stubdom/vtpmmgr/init.c
@@ -0,0 +1,553 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+#include <stdint.h>
+#include <stdlib.h>
+
+#include <xen/xen.h>
+#include <mini-os/tpmback.h>
+#include <mini-os/tpmfront.h>
+#include <mini-os/tpm_tis.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <polarssl/sha1.h>
+
+#include "log.h"
+#include "vtpmmgr.h"
+#include "vtpm_storage.h"
+#include "tpm.h"
+#include "marshal.h"
+
+struct Opts {
+   enum {
+      TPMDRV_TPM_TIS,
+      TPMDRV_TPMFRONT,
+   } tpmdriver;
+   unsigned long tpmiomem;
+   unsigned int tpmirq;
+   unsigned int tpmlocality;
+   int gen_owner_auth;
+};
+
+// --------------------------- Well Known Auths --------------------------
+const TPM_AUTHDATA WELLKNOWN_SRK_AUTH = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+const TPM_AUTHDATA WELLKNOWN_OWNER_AUTH = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+
+struct vtpm_globals vtpm_globals = {
+   .tpm_fd = -1,
+   .storage_key = TPM_KEY_INIT,
+   .storage_key_handle = 0,
+   .oiap = { .AuthHandle = 0 }
+};
+
+static int tpm_entropy_source(void* dummy, unsigned char* data, size_t len, size_t* olen) {
+   UINT32 sz = len;
+   TPM_RESULT rc = TPM_GetRandom(&sz, data);
+   *olen = sz;
+   return rc == TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
+}
+
+static TPM_RESULT check_tpm_version(void) {
+   TPM_RESULT status;
+   UINT32 rsize;
+   BYTE* res = NULL;
+   TPM_CAP_VERSION_INFO vinfo;
+
+   TPMTRYRETURN(TPM_GetCapability(
+            TPM_CAP_VERSION_VAL,
+            0,
+            NULL,
+            &rsize,
+            &res));
+   if(rsize < 4) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid size returned by GetCapability!\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   unpack_TPM_CAP_VERSION_INFO(res, &vinfo, UNPACK_ALIAS);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Hardware TPM:\n");
+   vtpmloginfo(VTPM_LOG_VTPM, " version: %hhd %hhd %hhd %hhd\n",
+         vinfo.version.major, vinfo.version.minor, vinfo.version.revMajor, vinfo.version.revMinor);
+   vtpmloginfo(VTPM_LOG_VTPM, " specLevel: %hd\n", vinfo.specLevel);
+   vtpmloginfo(VTPM_LOG_VTPM, " errataRev: %hhd\n", vinfo.errataRev);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorID: %c%c%c%c\n",
+         vinfo.tpmVendorID[0], vinfo.tpmVendorID[1],
+         vinfo.tpmVendorID[2], vinfo.tpmVendorID[3]);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecificSize: %hd\n", vinfo.vendorSpecificSize);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecific: ");
+   for(int i = 0; i < vinfo.vendorSpecificSize; ++i) {
+      vtpmloginfomore(VTPM_LOG_VTPM, "%02hhx", vinfo.vendorSpecific[i]);
+   }
+   vtpmloginfomore(VTPM_LOG_VTPM, "\n");
+
+abort_egress:
+   free(res);
+   return status;
+}
+
+static TPM_RESULT flush_tpm(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   const TPM_RESOURCE_TYPE reslist[] = { TPM_RT_KEY, TPM_RT_AUTH, TPM_RT_TRANS, TPM_RT_COUNTER, TPM_RT_DAA_TPM, TPM_RT_CONTEXT };
+   BYTE* keylist = NULL;
+   UINT32 keylistSize;
+   BYTE* ptr;
+
+   //Iterate through each resource type and flush all handles
+   for(int i = 0; i < sizeof(reslist) / sizeof(TPM_RESOURCE_TYPE); ++i) {
+      TPM_RESOURCE_TYPE beres = cpu_to_be32(reslist[i]);
+      UINT16 size;
+      TPMTRYRETURN(TPM_GetCapability(
+               TPM_CAP_HANDLE,
+               sizeof(TPM_RESOURCE_TYPE),
+               (BYTE*)(&beres),
+               &keylistSize,
+               &keylist));
+
+      ptr = keylist;
+      ptr = unpack_UINT16(ptr, &size);
+
+      //Flush each handle
+      if(size) {
+         vtpmloginfo(VTPM_LOG_VTPM, "Flushing %u handle(s) of type %lu\n", size, (unsigned long) reslist[i]);
+         for(int j = 0; j < size; ++j) {
+            TPM_HANDLE h;
+            ptr = unpack_TPM_HANDLE(ptr, &h);
+            TPMTRYRETURN(TPM_FlushSpecific(h, reslist[i]));
+         }
+      }
+
+      free(keylist);
+      keylist = NULL;
+   }
+
+   goto egress;
+abort_egress:
+   free(keylist);
+egress:
+   return status;
+}
+
+
+static TPM_RESULT try_take_ownership(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_PUBKEY pubEK = TPM_PUBKEY_INIT;
+
+   // If we can read PubEK then there is no owner and we should take it.
+   status = TPM_ReadPubek(&pubEK);
+
+   switch(status) {
+      case TPM_DISABLED_CMD:
+         //Cannot read ek? TPM has owner
+         vtpmloginfo(VTPM_LOG_VTPM, "Failed to readEK meaning TPM has an owner. Creating Keys off existing SRK.\n");
+         status = TPM_SUCCESS;
+         break;
+      case TPM_NO_ENDORSEMENT:
+         {
+            //If theres no ek, we have to create one
+            TPM_KEY_PARMS keyInfo = {
+               .algorithmID = TPM_ALG_RSA,
+               .encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1,
+               .sigScheme = TPM_SS_NONE,
+               .parmSize = 12,
+               .parms.rsa = {
+                  .keyLength = RSA_KEY_SIZE,
+                  .numPrimes = 2,
+                  .exponentSize = 0,
+                  .exponent = NULL,
+               },
+            };
+            TPMTRYRETURN(TPM_CreateEndorsementKeyPair(&keyInfo, &pubEK));
+         }
+         //fall through to take ownership
+      case TPM_SUCCESS:
+         {
+            //Construct the Srk
+            TPM_KEY srk = {
+               .ver = TPM_STRUCT_VER_1_1,
+               .keyUsage = TPM_KEY_STORAGE,
+               .keyFlags = 0x00,
+               .authDataUsage = TPM_AUTH_ALWAYS,
+               .algorithmParms = {
+                  .algorithmID = TPM_ALG_RSA,
+                  .encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1,
+                  .sigScheme =  TPM_SS_NONE,
+                  .parmSize = 12,
+                  .parms.rsa = {
+                     .keyLength = RSA_KEY_SIZE,
+                     .numPrimes = 2,
+                     .exponentSize = 0,
+                     .exponent = NULL,
+                  },
+               },
+               .PCRInfoSize = 0,
+               .pubKey = {
+                  .keyLength = 0,
+                  .key = NULL,
+               },
+               .encDataSize = 0,
+            };
+
+            TPMTRYRETURN(TPM_TakeOwnership(
+                     &pubEK,
+                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
+                     (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+                     &srk,
+                     NULL,
+                     &vtpm_globals.oiap));
+
+            TPMTRYRETURN(TPM_DisablePubekRead(
+                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
+                     &vtpm_globals.oiap));
+         }
+         break;
+      default:
+         break;
+   }
+abort_egress:
+   free_TPM_PUBKEY(&pubEK);
+   return status;
+}
+
+static void init_storage_key(TPM_KEY* key) {
+   key->ver.major = 1;
+   key->ver.minor = 1;
+   key->ver.revMajor = 0;
+   key->ver.revMinor = 0;
+
+   key->keyUsage = TPM_KEY_BIND;
+   key->keyFlags = 0;
+   key->authDataUsage = TPM_AUTH_ALWAYS;
+
+   TPM_KEY_PARMS* p = &key->algorithmParms;
+   p->algorithmID = TPM_ALG_RSA;
+   p->encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
+   p->sigScheme = TPM_SS_NONE;
+   p->parmSize = 12;
+
+   TPM_RSA_KEY_PARMS* r = &p->parms.rsa;
+   r->keyLength = RSA_KEY_SIZE;
+   r->numPrimes = 2;
+   r->exponentSize = 0;
+   r->exponent = NULL;
+
+   key->PCRInfoSize = 0;
+   key->encDataSize = 0;
+   key->encData = NULL;
+}
+
+static int parse_auth_string(char* authstr, BYTE* target, const TPM_AUTHDATA wellknown, int allowrandom) {
+   int rc;
+   /* well known owner auth */
+   if(!strcmp(authstr, "well-known")) {
+      memcpy(target, wellknown, sizeof(TPM_AUTHDATA));
+   }
+   /* Create a randomly generated owner auth */
+   else if(allowrandom && !strcmp(authstr, "random")) {
+      return 1;
+   }
+   /* owner auth is a raw hash */
+   else if(!strncmp(authstr, "hash:", 5)) {
+      authstr += 5;
+      if((rc = strlen(authstr)) != 40) {
+         vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth hex string `%s' must be exactly 40 characters (20 bytes) long, length=%d\n", authstr, rc);
+         return -1;
+      }
+      for(int j = 0; j < 20; ++j) {
+         if(sscanf(authstr, "%hhX", target + j) != 1) {
+            vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth string `%s' is not a valid hex string\n", authstr);
+            return -1;
+         }
+         authstr += 2;
+      }
+   }
+   /* owner auth is a string that will be hashed */
+   else if(!strncmp(authstr, "text:", 5)) {
+      authstr += 5;
+      sha1((const unsigned char*)authstr, strlen(authstr), target);
+   }
+   else {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid auth string %s\n", authstr);
+      return -1;
+   }
+
+   return 0;
+}
+
+int parse_cmdline_opts(int argc, char** argv, struct Opts* opts)
+{
+   int rc;
+   int i;
+
+   //Set defaults
+   memcpy(vtpm_globals.owner_auth, WELLKNOWN_OWNER_AUTH, sizeof(TPM_AUTHDATA));
+   memcpy(vtpm_globals.srk_auth, WELLKNOWN_SRK_AUTH, sizeof(TPM_AUTHDATA));
+
+   for(i = 1; i < argc; ++i) {
+      if(!strncmp(argv[i], "owner_auth:", 10)) {
+         if((rc = parse_auth_string(argv[i] + 10, vtpm_globals.owner_auth, WELLKNOWN_OWNER_AUTH, 1)) < 0) {
+            goto err_invalid;
+         }
+         if(rc == 1) {
+            opts->gen_owner_auth = 1;
+         }
+      }
+      else if(!strncmp(argv[i], "srk_auth:", 8)) {
+         if((rc = parse_auth_string(argv[i] + 8, vtpm_globals.srk_auth, WELLKNOWN_SRK_AUTH, 0)) != 0) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmdriver=", 10)) {
+         if(!strcmp(argv[i] + 10, "tpm_tis")) {
+            opts->tpmdriver = TPMDRV_TPM_TIS;
+         } else if(!strcmp(argv[i] + 10, "tpmfront")) {
+            opts->tpmdriver = TPMDRV_TPMFRONT;
+         } else {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmiomem=",9)) {
+         if(sscanf(argv[i] + 9, "0x%lX", &opts->tpmiomem) != 1) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmirq=",7)) {
+         if(!strcmp(argv[i] + 7, "probe")) {
+            opts->tpmirq = TPM_PROBE_IRQ;
+         } else if( sscanf(argv[i] + 7, "%u", &opts->tpmirq) != 1) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmlocality=",12)) {
+         if(sscanf(argv[i] + 12, "%u", &opts->tpmlocality) != 1 || opts->tpmlocality > 4) {
+            goto err_invalid;
+         }
+      }
+   }
+
+   switch(opts->tpmdriver) {
+      case TPMDRV_TPM_TIS:
+         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpm_tis driver\n");
+         break;
+      case TPMDRV_TPMFRONT:
+         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpmfront driver\n");
+         break;
+   }
+
+   return 0;
+err_invalid:
+   vtpmlogerror(VTPM_LOG_VTPM, "Invalid Option %s\n", argv[i]);
+   return -1;
+}
+
+
+
+static TPM_RESULT vtpmmgr_create(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_AUTH_SESSION osap = TPM_AUTH_SESSION_INIT;
+   TPM_AUTHDATA sharedsecret;
+
+   // Take ownership if TPM is unowned
+   TPMTRYRETURN(try_take_ownership());
+
+   // Generate storage key's auth
+   memset(&vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA));
+
+   TPMTRYRETURN( TPM_OSAP(
+            TPM_ET_KEYHANDLE,
+            TPM_SRK_KEYHANDLE,
+            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+            &sharedsecret,
+            &osap) );
+
+   init_storage_key(&vtpm_globals.storage_key);
+
+   //initialize the storage key
+   TPMTRYRETURN( TPM_CreateWrapKey(
+            TPM_SRK_KEYHANDLE,
+            (const TPM_AUTHDATA*)&sharedsecret,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.storage_key,
+            &osap) );
+
+   //Load Storage Key
+   TPMTRYRETURN( TPM_LoadKey(
+            TPM_SRK_KEYHANDLE,
+            &vtpm_globals.storage_key,
+            &vtpm_globals.storage_key_handle,
+            (const TPM_AUTHDATA*) &vtpm_globals.srk_auth,
+            &vtpm_globals.oiap));
+
+   //Make sure TPM has commited changes
+   TPMTRYRETURN( TPM_SaveState() );
+
+   //Create new disk image
+   TPMTRYRETURN(vtpm_storage_new_header());
+
+   goto egress;
+abort_egress:
+egress:
+   vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager\n");
+
+   //End the OSAP session
+   if(osap.AuthHandle) {
+      TPM_TerminateHandle(osap.AuthHandle);
+   }
+
+   return status;
+}
+
+TPM_RESULT vtpmmgr_init(int argc, char** argv) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   /* Default commandline options */
+   struct Opts opts = {
+      .tpmdriver = TPMDRV_TPM_TIS,
+      .tpmiomem = TPM_BASEADDR,
+      .tpmirq = 0,
+      .tpmlocality = 0,
+      .gen_owner_auth = 0,
+   };
+
+   if(parse_cmdline_opts(argc, argv, &opts) != 0) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Command line parsing failed! exiting..\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   //Setup storage system
+   if(vtpm_storage_init() != 0) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize storage subsystem!\n");
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   //Setup tpmback device
+   init_tpmback();
+
+   //Setup tpm access
+   switch(opts.tpmdriver) {
+      case TPMDRV_TPM_TIS:
+         {
+            struct tpm_chip* tpm;
+            if((tpm = init_tpm_tis(opts.tpmiomem, TPM_TIS_LOCL_INT_TO_FLAG(opts.tpmlocality), opts.tpmirq)) == NULL) {
+               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+               status = TPM_IOERROR;
+               goto abort_egress;
+            }
+            vtpm_globals.tpm_fd = tpm_tis_open(tpm);
+            tpm_tis_request_locality(tpm, opts.tpmlocality);
+         }
+         break;
+      case TPMDRV_TPMFRONT:
+         {
+            struct tpmfront_dev* tpmfront_dev;
+            if((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
+               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+               status = TPM_IOERROR;
+               goto abort_egress;
+            }
+            vtpm_globals.tpm_fd = tpmfront_open(tpmfront_dev);
+         }
+         break;
+   }
+
+   //Get the version of the tpm
+   TPMTRYRETURN(check_tpm_version());
+
+   // Blow away all stale handles left in the tpm
+   if(flush_tpm() != TPM_SUCCESS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_FlushResources failed, continuing anyway..\n");
+   }
+
+   /* Initialize the rng */
+   entropy_init(&vtpm_globals.entropy);
+   entropy_add_source(&vtpm_globals.entropy, tpm_entropy_source, NULL, 0);
+   entropy_gather(&vtpm_globals.entropy);
+   ctr_drbg_init(&vtpm_globals.ctr_drbg, entropy_func, &vtpm_globals.entropy, NULL, 0);
+   ctr_drbg_set_prediction_resistance( &vtpm_globals.ctr_drbg, CTR_DRBG_PR_OFF );
+
+   // Generate Auth for Owner
+   if(opts.gen_owner_auth) {
+      vtpmmgr_rand(vtpm_globals.owner_auth, sizeof(TPM_AUTHDATA));
+   }
+
+   // Create OIAP session for service's authorized commands
+   TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
+
+   /* Load the Manager data, if it fails create a new manager */
+   if (vtpm_storage_load_header() != TPM_SUCCESS) {
+      /* If the OIAP session was closed by an error, create a new one */
+      if(vtpm_globals.oiap.AuthHandle == 0) {
+         TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
+      }
+      vtpmloginfo(VTPM_LOG_VTPM, "Failed to read manager file. Assuming first time initialization.\n");
+      TPMTRYRETURN( vtpmmgr_create() );
+   }
+
+   goto egress;
+abort_egress:
+   vtpmmgr_shutdown();
+egress:
+   return status;
+}
+
+void vtpmmgr_shutdown(void)
+{
+   /* Cleanup resources */
+   free_TPM_KEY(&vtpm_globals.storage_key);
+
+   /* Cleanup TPM resources */
+   TPM_EvictKey(vtpm_globals.storage_key_handle);
+   TPM_TerminateHandle(vtpm_globals.oiap.AuthHandle);
+
+   /* Close tpmback */
+   shutdown_tpmback();
+
+   /* Close the storage system and blkfront */
+   vtpm_storage_shutdown();
+
+   /* Close tpmfront/tpm_tis */
+   close(vtpm_globals.tpm_fd);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
+}
diff --git a/stubdom/vtpmmgr/log.c b/stubdom/vtpmmgr/log.c
new file mode 100644
index 0000000..a82c913
--- /dev/null
+++ b/stubdom/vtpmmgr/log.c
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "tcg.h"
+
+char *module_names[] = { "",
+                                "TPM",
+                                "TPM",
+                                "VTPM",
+                                "VTPM",
+                                "TXDATA",
+                              };
+// Helper code for the consts, eg. to produce messages for error codes.
+
+typedef struct error_code_entry_t {
+  TPM_RESULT code;
+  char * code_name;
+  char * msg;
+} error_code_entry_t;
+
+static const error_code_entry_t error_msgs [] = {
+  { TPM_SUCCESS, "TPM_SUCCESS", "Successful completion of the operation" },
+  { TPM_AUTHFAIL, "TPM_AUTHFAIL", "Authentication failed" },
+  { TPM_BADINDEX, "TPM_BADINDEX", "The index to a PCR, DIR or other register is incorrect" },
+  { TPM_BAD_PARAMETER, "TPM_BAD_PARAMETER", "One or more parameter is bad" },
+  { TPM_AUDITFAILURE, "TPM_AUDITFAILURE", "An operation completed successfully but the auditing of that operation failed." },
+  { TPM_CLEAR_DISABLED, "TPM_CLEAR_DISABLED", "The clear disable flag is set and all clear operations now require physical access" },
+  { TPM_DEACTIVATED, "TPM_DEACTIVATED", "The TPM is deactivated" },
+  { TPM_DISABLED, "TPM_DISABLED", "The TPM is disabled" },
+  { TPM_DISABLED_CMD, "TPM_DISABLED_CMD", "The target command has been disabled" },
+  { TPM_FAIL, "TPM_FAIL", "The operation failed" },
+  { TPM_BAD_ORDINAL, "TPM_BAD_ORDINAL", "The ordinal was unknown or inconsistent" },
+  { TPM_INSTALL_DISABLED, "TPM_INSTALL_DISABLED", "The ability to install an owner is disabled" },
+  { TPM_INVALID_KEYHANDLE, "TPM_INVALID_KEYHANDLE", "The key handle presented was invalid" },
+  { TPM_KEYNOTFOUND, "TPM_KEYNOTFOUND", "The target key was not found" },
+  { TPM_INAPPROPRIATE_ENC, "TPM_INAPPROPRIATE_ENC", "Unacceptable encryption scheme" },
+  { TPM_MIGRATEFAIL, "TPM_MIGRATEFAIL", "Migration authorization failed" },
+  { TPM_INVALID_PCR_INFO, "TPM_INVALID_PCR_INFO", "PCR information could not be interpreted" },
+  { TPM_NOSPACE, "TPM_NOSPACE", "No room to load key." },
+  { TPM_NOSRK, "TPM_NOSRK", "There is no SRK set" },
+  { TPM_NOTSEALED_BLOB, "TPM_NOTSEALED_BLOB", "An encrypted blob is invalid or was not created by this TPM" },
+  { TPM_OWNER_SET, "TPM_OWNER_SET", "There is already an Owner" },
+  { TPM_RESOURCES, "TPM_RESOURCES", "The TPM has insufficient internal resources to perform the requested action." },
+  { TPM_SHORTRANDOM, "TPM_SHORTRANDOM", "A random string was too short" },
+  { TPM_SIZE, "TPM_SIZE", "The TPM does not have the space to perform the operation." },
+  { TPM_WRONGPCRVAL, "TPM_WRONGPCRVAL", "The named PCR value does not match the current PCR value." },
+  { TPM_BAD_PARAM_SIZE, "TPM_BAD_PARAM_SIZE", "The paramSize argument to the command has the incorrect value" },
+  { TPM_SHA_THREAD, "TPM_SHA_THREAD", "There is no existing SHA-1 thread." },
+  { TPM_SHA_ERROR, "TPM_SHA_ERROR", "The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error." },
+  { TPM_FAILEDSELFTEST, "TPM_FAILEDSELFTEST", "Self-test has failed and the TPM has shutdown." },
+  { TPM_AUTH2FAIL, "TPM_AUTH2FAIL", "The authorization for the second key in a 2 key function failed authorization" },
+  { TPM_BADTAG, "TPM_BADTAG", "The tag value sent to for a command is invalid" },
+  { TPM_IOERROR, "TPM_IOERROR", "An IO error occurred transmitting information to the TPM" },
+  { TPM_ENCRYPT_ERROR, "TPM_ENCRYPT_ERROR", "The encryption process had a problem." },
+  { TPM_DECRYPT_ERROR, "TPM_DECRYPT_ERROR", "The decryption process did not complete." },
+  { TPM_INVALID_AUTHHANDLE, "TPM_INVALID_AUTHHANDLE", "An invalid handle was used." },
+  { TPM_NO_ENDORSEMENT, "TPM_NO_ENDORSEMENT", "The TPM does not a EK installed" },
+  { TPM_INVALID_KEYUSAGE, "TPM_INVALID_KEYUSAGE", "The usage of a key is not allowed" },
+  { TPM_WRONG_ENTITYTYPE, "TPM_WRONG_ENTITYTYPE", "The submitted entity type is not allowed" },
+  { TPM_INVALID_POSTINIT, "TPM_INVALID_POSTINIT", "The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup" },
+  { TPM_INAPPROPRIATE_SIG, "TPM_INAPPROPRIATE_SIG", "Signed data cannot include additional DER information" },
+  { TPM_BAD_KEY_PROPERTY, "TPM_BAD_KEY_PROPERTY", "The key properties in TPM_KEY_PARMs are not supported by this TPM" },
+
+  { TPM_BAD_MIGRATION, "TPM_BAD_MIGRATION", "The migration properties of this key are incorrect." },
+  { TPM_BAD_SCHEME, "TPM_BAD_SCHEME", "The signature or encryption scheme for this key is incorrect or not permitted in this situation." },
+  { TPM_BAD_DATASIZE, "TPM_BAD_DATASIZE", "The size of the data (or blob) parameter is bad or inconsistent with the referenced key" },
+  { TPM_BAD_MODE, "TPM_BAD_MODE", "A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob." },
+  { TPM_BAD_PRESENCE, "TPM_BAD_PRESENCE", "Either the physicalPresence or physicalPresenceLock bits have the wrong value" },
+  { TPM_BAD_VERSION, "TPM_BAD_VERSION", "The TPM cannot perform this version of the capability" },
+  { TPM_NO_WRAP_TRANSPORT, "TPM_NO_WRAP_TRANSPORT", "The TPM does not allow for wrapped transport sessions" },
+  { TPM_AUDITFAIL_UNSUCCESSFUL, "TPM_AUDITFAIL_UNSUCCESSFUL", "TPM audit construction failed and the underlying command was returning a failure code also" },
+  { TPM_AUDITFAIL_SUCCESSFUL, "TPM_AUDITFAIL_SUCCESSFUL", "TPM audit construction failed and the underlying command was returning success" },
+  { TPM_NOTRESETABLE, "TPM_NOTRESETABLE", "Attempt to reset a PCR register that does not have the resettable attribute" },
+  { TPM_NOTLOCAL, "TPM_NOTLOCAL", "Attempt to reset a PCR register that requires locality and locality modifier not part of command transport" },
+  { TPM_BAD_TYPE, "TPM_BAD_TYPE", "Make identity blob not properly typed" },
+  { TPM_INVALID_RESOURCE, "TPM_INVALID_RESOURCE", "When saving context identified resource type does not match actual resource" },
+  { TPM_NOTFIPS, "TPM_NOTFIPS", "The TPM is attempting to execute a command only available when in FIPS mode" },
+  { TPM_INVALID_FAMILY, "TPM_INVALID_FAMILY", "The command is attempting to use an invalid family ID" },
+  { TPM_NO_NV_PERMISSION, "TPM_NO_NV_PERMISSION", "The permission to manipulate the NV storage is not available" },
+  { TPM_REQUIRES_SIGN, "TPM_REQUIRES_SIGN", "The operation requires a signed command" },
+  { TPM_KEY_NOTSUPPORTED, "TPM_KEY_NOTSUPPORTED", "Wrong operation to load an NV key" },
+  { TPM_AUTH_CONFLICT, "TPM_AUTH_CONFLICT", "NV_LoadKey blob requires both owner and blob authorization" },
+  { TPM_AREA_LOCKED, "TPM_AREA_LOCKED", "The NV area is locked and not writtable" },
+  { TPM_BAD_LOCALITY, "TPM_BAD_LOCALITY", "The locality is incorrect for the attempted operation" },
+  { TPM_READ_ONLY, "TPM_READ_ONLY", "The NV area is read only and can't be written to" },
+  { TPM_PER_NOWRITE, "TPM_PER_NOWRITE", "There is no protection on the write to the NV area" },
+  { TPM_FAMILYCOUNT, "TPM_FAMILYCOUNT", "The family count value does not match" },
+  { TPM_WRITE_LOCKED, "TPM_WRITE_LOCKED", "The NV area has already been written to" },
+  { TPM_BAD_ATTRIBUTES, "TPM_BAD_ATTRIBUTES", "The NV area attributes conflict" },
+  { TPM_INVALID_STRUCTURE, "TPM_INVALID_STRUCTURE", "The structure tag and version are invalid or inconsistent" },
+  { TPM_KEY_OWNER_CONTROL, "TPM_KEY_OWNER_CONTROL", "The key is under control of the TPM Owner and can only be evicted by the TPM Owner." },
+  { TPM_BAD_COUNTER, "TPM_BAD_COUNTER", "The counter handle is incorrect" },
+  { TPM_NOT_FULLWRITE, "TPM_NOT_FULLWRITE", "The write is not a complete write of the area" },
+  { TPM_CONTEXT_GAP, "TPM_CONTEXT_GAP", "The gap between saved context counts is too large" },
+  { TPM_MAXNVWRITES, "TPM_MAXNVWRITES", "The maximum number of NV writes without an owner has been exceeded" },
+  { TPM_NOOPERATOR, "TPM_NOOPERATOR", "No operator authorization value is set" },
+  { TPM_RESOURCEMISSING, "TPM_RESOURCEMISSING", "The resource pointed to by context is not loaded" },
+  { TPM_DELEGATE_LOCK, "TPM_DELEGATE_LOCK", "The delegate administration is locked" },
+  { TPM_DELEGATE_FAMILY, "TPM_DELEGATE_FAMILY", "Attempt to manage a family other then the delegated family" },
+  { TPM_DELEGATE_ADMIN, "TPM_DELEGATE_ADMIN", "Delegation table management not enabled" },
+  { TPM_TRANSPORT_EXCLUSIVE, "TPM_TRANSPORT_EXCLUSIVE", "There was a command executed outside of an exclusive transport session" },
+};
+
+
+// helper function for the error codes:
+const char* tpm_get_error_name (TPM_RESULT code) {
+  // just do a linear scan for now
+  unsigned i;
+  for (i = 0; i < sizeof(error_msgs)/sizeof(error_msgs[0]); i++)
+    if (code == error_msgs[i].code)
+      return error_msgs[i].code_name;
+
+    return("Unknown Error Code");
+}
diff --git a/stubdom/vtpmmgr/log.h b/stubdom/vtpmmgr/log.h
new file mode 100644
index 0000000..5c7abf5
--- /dev/null
+++ b/stubdom/vtpmmgr/log.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __VTPM_LOG_H__
+#define __VTPM_LOG_H__
+
+#include <stdint.h>             // for uint32_t
+#include <stddef.h>             // for pointer NULL
+#include <stdio.h>
+#include "tcg.h"
+
+// =========================== LOGGING ==============================
+
+// the logging module numbers
+#define VTPM_LOG_TPM         1
+#define VTPM_LOG_TPM_DEEP    2
+#define VTPM_LOG_VTPM        3
+#define VTPM_LOG_VTPM_DEEP   4
+#define VTPM_LOG_TXDATA      5
+
+extern char *module_names[];
+
+// Default to standard logging
+#ifndef LOGGING_MODULES
+#define LOGGING_MODULES (BITMASK(VTPM_LOG_VTPM)|BITMASK(VTPM_LOG_TPM))
+#endif
+
+// bit-access macros
+#define BITMASK(idx)      ( 1U << (idx) )
+#define GETBIT(num,idx)   ( ((num) & BITMASK(idx)) >> idx )
+#define SETBIT(num,idx)   (num) |= BITMASK(idx)
+#define CLEARBIT(num,idx) (num) &= ( ~ BITMASK(idx) )
+
+#define vtpmloginfo(module, fmt, args...) \
+  if (GETBIT (LOGGING_MODULES, module) == 1) {				\
+    fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); \
+  }
+
+#define vtpmloginfomore(module, fmt, args...) \
+  if (GETBIT (LOGGING_MODULES, module) == 1) {			      \
+    fprintf (stdout, fmt,##args);				      \
+  }
+
+#define vtpmlogerror(module, fmt, args...) \
+  fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
+
+//typedef UINT32 tpm_size_t;
+
+// helper function for the error codes:
+const char* tpm_get_error_name (TPM_RESULT code);
+
+#endif // _VTPM_LOG_H_
diff --git a/stubdom/vtpmmgr/marshal.h b/stubdom/vtpmmgr/marshal.h
new file mode 100644
index 0000000..77d32f0
--- /dev/null
+++ b/stubdom/vtpmmgr/marshal.h
@@ -0,0 +1,528 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef MARSHAL_H
+#define MARSHAL_H
+
+#include <stdlib.h>
+#include <mini-os/byteorder.h>
+#include <mini-os/endian.h>
+#include "tcg.h"
+
+typedef enum UnpackPtr {
+   UNPACK_ALIAS,
+   UNPACK_ALLOC
+} UnpackPtr;
+
+inline BYTE* pack_BYTE(BYTE* ptr, BYTE t) {
+   ptr[0] = t;
+   return ++ptr;
+}
+
+inline BYTE* unpack_BYTE(BYTE* ptr, BYTE* t) {
+   t[0] = ptr[0];
+   return ++ptr;
+}
+
+#define pack_BOOL(p, t) pack_BYTE(p, t)
+#define unpack_BOOL(p, t) unpack_BYTE(p, t)
+
+inline BYTE* pack_UINT16(BYTE* ptr, UINT16 t) {
+   BYTE* b = (BYTE*)&t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   ptr[0] = b[1];
+   ptr[1] = b[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   ptr[0] = b[0];
+   ptr[1] = b[1];
+#endif
+   return ptr + sizeof(UINT16);
+}
+
+inline BYTE* unpack_UINT16(BYTE* ptr, UINT16* t) {
+   BYTE* b = (BYTE*)t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   b[0] = ptr[1];
+   b[1] = ptr[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   b[0] = ptr[0];
+   b[1] = ptr[1];
+#endif
+   return ptr + sizeof(UINT16);
+}
+
+inline BYTE* pack_UINT32(BYTE* ptr, UINT32 t) {
+   BYTE* b = (BYTE*)&t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   ptr[3] = b[0];
+   ptr[2] = b[1];
+   ptr[1] = b[2];
+   ptr[0] = b[3];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   ptr[0] = b[0];
+   ptr[1] = b[1];
+   ptr[2] = b[2];
+   ptr[3] = b[3];
+#endif
+   return ptr + sizeof(UINT32);
+}
+
+inline BYTE* unpack_UINT32(BYTE* ptr, UINT32* t) {
+   BYTE* b = (BYTE*)t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   b[0] = ptr[3];
+   b[1] = ptr[2];
+   b[2] = ptr[1];
+   b[3] = ptr[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   b[0] = ptr[0];
+   b[1] = ptr[1];
+   b[2] = ptr[2];
+   b[3] = ptr[3];
+#endif
+   return ptr + sizeof(UINT32);
+}
+
+#define pack_TPM_RESULT(p, t) pack_UINT32(p, t)
+#define pack_TPM_PCRINDEX(p, t) pack_UINT32(p, t)
+#define pack_TPM_DIRINDEX(p, t) pack_UINT32(p, t)
+#define pack_TPM_HANDLE(p, t) pack_UINT32(p, t)
+#define pack_TPM_AUTHHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_HASHHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_HMACHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_ENCHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TPM_KEY_HANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_ENTITYHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TPM_RESOURCE_TYPE(p, t) pack_UINT32(p, t)
+#define pack_TPM_COMMAND_CODE(p, t) pack_UINT32(p, t)
+#define pack_TPM_PROTOCOL_ID(p, t) pack_UINT16(p, t)
+#define pack_TPM_AUTH_DATA_USAGE(p, t) pack_BYTE(p, t)
+#define pack_TPM_ENTITY_TYPE(p, t) pack_UINT16(p, t)
+#define pack_TPM_ALGORITHM_ID(p, t) pack_UINT32(p, t)
+#define pack_TPM_KEY_USAGE(p, t) pack_UINT16(p, t)
+#define pack_TPM_STARTUP_TYPE(p, t) pack_UINT16(p, t)
+#define pack_TPM_CAPABILITY_AREA(p, t) pack_UINT32(p, t)
+#define pack_TPM_ENC_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_SIG_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_MIGRATE_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_PHYSICAL_PRESENCE(p, t) pack_UINT16(p, t)
+#define pack_TPM_KEY_FLAGS(p, t) pack_UINT32(p, t)
+
+#define unpack_TPM_RESULT(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_PCRINDEX(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_DIRINDEX(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_HANDLE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_AUTHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_HASHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_HMACHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_ENCHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TPM_KEY_HANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_ENTITYHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TPM_RESOURCE_TYPE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_COMMAND_CODE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_PROTOCOL_ID(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_AUTH_DATA_USAGE(p, t) unpack_BYTE(p, t)
+#define unpack_TPM_ENTITY_TYPE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_ALGORITHM_ID(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_KEY_USAGE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_STARTUP_TYPE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_CAPABILITY_AREA(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_ENC_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_SIG_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_MIGRATE_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_PHYSICAL_PRESENCE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_KEY_FLAGS(p, t) unpack_UINT32(p, t)
+
+#define pack_TPM_AUTH_HANDLE(p, t) pack_UINT32(p, t);
+#define pack_TCS_CONTEXT_HANDLE(p, t) pack_UINT32(p, t);
+#define pack_TCS_KEY_HANDLE(p, t) pack_UINT32(p, t);
+
+#define unpack_TPM_AUTH_HANDLE(p, t) unpack_UINT32(p, t);
+#define unpack_TCS_CONTEXT_HANDLE(p, t) unpack_UINT32(p, t);
+#define unpack_TCS_KEY_HANDLE(p, t) unpack_UINT32(p, t);
+
+inline BYTE* pack_BUFFER(BYTE* ptr, const BYTE* buf, UINT32 size) {
+   memcpy(ptr, buf, size);
+   return ptr + size;
+}
+
+inline BYTE* unpack_BUFFER(BYTE* ptr, BYTE* buf, UINT32 size) {
+   memcpy(buf, ptr, size);
+   return ptr + size;
+}
+
+inline BYTE* unpack_ALIAS(BYTE* ptr, BYTE** buf, UINT32 size) {
+   *buf = ptr;
+   return ptr + size;
+}
+
+inline BYTE* unpack_ALLOC(BYTE* ptr, BYTE** buf, UINT32 size) {
+   if(size) {
+      *buf = malloc(size);
+      memcpy(*buf, ptr, size);
+   } else {
+      *buf = NULL;
+   }
+   return ptr + size;
+}
+
+inline BYTE* unpack_PTR(BYTE* ptr, BYTE** buf, UINT32 size, UnpackPtr alloc) {
+   if(alloc == UNPACK_ALLOC) {
+      return unpack_ALLOC(ptr, buf, size);
+   } else {
+      return unpack_ALIAS(ptr, buf, size);
+   }
+}
+
+inline BYTE* pack_TPM_AUTHDATA(BYTE* ptr, const TPM_AUTHDATA* d) {
+   return pack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_AUTHDATA(BYTE* ptr, TPM_AUTHDATA* d) {
+   return unpack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
+}
+
+#define pack_TPM_SECRET(p, t) pack_TPM_AUTHDATA(p, t)
+#define pack_TPM_ENCAUTH(p, t) pack_TPM_AUTHDATA(p, t)
+#define pack_TPM_PAYLOAD_TYPE(p, t) pack_BYTE(p, t)
+#define pack_TPM_TAG(p, t) pack_UINT16(p, t)
+#define pack_TPM_STRUCTURE_TAG(p, t) pack_UINT16(p, t)
+
+#define unpack_TPM_SECRET(p, t) unpack_TPM_AUTHDATA(p, t)
+#define unpack_TPM_ENCAUTH(p, t) unpack_TPM_AUTHDATA(p, t)
+#define unpack_TPM_PAYLOAD_TYPE(p, t) unpack_BYTE(p, t)
+#define unpack_TPM_TAG(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_STRUCTURE_TAG(p, t) unpack_UINT16(p, t)
+
+inline BYTE* pack_TPM_VERSION(BYTE* ptr, const TPM_VERSION* t) {
+   ptr[0] = t->major;
+   ptr[1] = t->minor;
+   ptr[2] = t->revMajor;
+   ptr[3] = t->revMinor;
+   return ptr + 4;
+}
+
+inline BYTE* unpack_TPM_VERSION(BYTE* ptr, TPM_VERSION* t) {
+   t->major = ptr[0];
+   t->minor = ptr[1];
+   t->revMajor = ptr[2];
+   t->revMinor = ptr[3];
+   return ptr + 4;
+}
+
+inline BYTE* pack_TPM_CAP_VERSION_INFO(BYTE* ptr, const TPM_CAP_VERSION_INFO* v) {
+   ptr = pack_TPM_STRUCTURE_TAG(ptr, v->tag);
+   ptr = pack_TPM_VERSION(ptr, &v->version);
+   ptr = pack_UINT16(ptr, v->specLevel);
+   ptr = pack_BYTE(ptr, v->errataRev);
+   ptr = pack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));
+   ptr = pack_UINT16(ptr, v->vendorSpecificSize);
+   ptr = pack_BUFFER(ptr, v->vendorSpecific, v->vendorSpecificSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_CAP_VERSION_INFO(BYTE* ptr, TPM_CAP_VERSION_INFO* v, UnpackPtr alloc) {
+   ptr = unpack_TPM_STRUCTURE_TAG(ptr, &v->tag);
+   ptr = unpack_TPM_VERSION(ptr, &v->version);
+   ptr = unpack_UINT16(ptr, &v->specLevel);
+   ptr = unpack_BYTE(ptr, &v->errataRev);
+   ptr = unpack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));
+   ptr = unpack_UINT16(ptr, &v->vendorSpecificSize);
+   ptr = unpack_PTR(ptr, &v->vendorSpecific, v->vendorSpecificSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_DIGEST(BYTE* ptr, const TPM_DIGEST* d) {
+   return pack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_DIGEST(BYTE* ptr, TPM_DIGEST* d) {
+   return unpack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
+}
+
+#define pack_TPM_PCRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_PCRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_COMPOSITE_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_COMPOSITE_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_DIRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_DIRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_HMAC(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_HMAC(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_CHOSENID_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_CHOSENID_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+inline BYTE* pack_TPM_NONCE(BYTE* ptr, const TPM_NONCE* n) {
+   return pack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_NONCE(BYTE* ptr, TPM_NONCE* n) {
+   return unpack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* pack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, const TPM_SYMMETRIC_KEY_PARMS* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_UINT32(ptr, k->blockSize);
+   ptr = pack_UINT32(ptr, k->ivSize);
+   return pack_BUFFER(ptr, k->IV, k->ivSize);
+}
+
+inline BYTE* unpack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, TPM_SYMMETRIC_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_UINT32(ptr, &k->blockSize);
+   ptr = unpack_UINT32(ptr, &k->ivSize);
+   return unpack_PTR(ptr, &k->IV, k->ivSize, alloc);
+}
+
+inline BYTE* pack_TPM_RSA_KEY_PARMS(BYTE* ptr, const TPM_RSA_KEY_PARMS* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_UINT32(ptr, k->numPrimes);
+   ptr = pack_UINT32(ptr, k->exponentSize);
+   return pack_BUFFER(ptr, k->exponent, k->exponentSize);
+}
+
+inline BYTE* unpack_TPM_RSA_KEY_PARMS(BYTE* ptr, TPM_RSA_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_UINT32(ptr, &k->numPrimes);
+   ptr = unpack_UINT32(ptr, &k->exponentSize);
+   return unpack_PTR(ptr, &k->exponent, k->exponentSize, alloc);
+}
+
+inline BYTE* pack_TPM_KEY_PARMS(BYTE* ptr, const TPM_KEY_PARMS* k) {
+   ptr = pack_TPM_ALGORITHM_ID(ptr, k->algorithmID);
+   ptr = pack_TPM_ENC_SCHEME(ptr, k->encScheme);
+   ptr = pack_TPM_SIG_SCHEME(ptr, k->sigScheme);
+   ptr = pack_UINT32(ptr, k->parmSize);
+
+   if(k->parmSize) {
+      switch(k->algorithmID) {
+         case TPM_ALG_RSA:
+            return pack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa);
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            return pack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym);
+      }
+   }
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_KEY_PARMS(BYTE* ptr, TPM_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_ALGORITHM_ID(ptr, &k->algorithmID);
+   ptr = unpack_TPM_ENC_SCHEME(ptr, &k->encScheme);
+   ptr = unpack_TPM_SIG_SCHEME(ptr, &k->sigScheme);
+   ptr = unpack_UINT32(ptr, &k->parmSize);
+
+   if(k->parmSize) {
+      switch(k->algorithmID) {
+         case TPM_ALG_RSA:
+            return unpack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa, alloc);
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            return unpack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym, alloc);
+      }
+   }
+   return ptr;
+}
+
+inline BYTE* pack_TPM_STORE_PUBKEY(BYTE* ptr, const TPM_STORE_PUBKEY* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_BUFFER(ptr, k->key, k->keyLength);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_STORE_PUBKEY(BYTE* ptr, TPM_STORE_PUBKEY* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_PTR(ptr, &k->key, k->keyLength, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PUBKEY(BYTE* ptr, const TPM_PUBKEY* k) {
+   ptr = pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
+   return pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
+}
+
+inline BYTE* unpack_TPM_PUBKEY(BYTE* ptr, TPM_PUBKEY* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
+   return unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
+}
+
+inline BYTE* pack_TPM_PCR_SELECTION(BYTE* ptr, const TPM_PCR_SELECTION* p) {
+   ptr = pack_UINT16(ptr, p->sizeOfSelect);
+   ptr = pack_BUFFER(ptr, p->pcrSelect, p->sizeOfSelect);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_SELECTION(BYTE* ptr, TPM_PCR_SELECTION* p, UnpackPtr alloc) {
+   ptr = unpack_UINT16(ptr, &p->sizeOfSelect);
+   ptr = unpack_PTR(ptr, &p->pcrSelect, p->sizeOfSelect, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PCR_INFO(BYTE* ptr, const TPM_PCR_INFO* p) {
+   ptr = pack_TPM_PCR_SELECTION(ptr, &p->pcrSelection);
+   ptr = pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
+   ptr = pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_INFO(BYTE* ptr, TPM_PCR_INFO* p, UnpackPtr alloc) {
+   ptr = unpack_TPM_PCR_SELECTION(ptr, &p->pcrSelection, alloc);
+   ptr = unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
+   ptr = unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PCR_COMPOSITE(BYTE* ptr, const TPM_PCR_COMPOSITE* p) {
+   ptr = pack_TPM_PCR_SELECTION(ptr, &p->select);
+   ptr = pack_UINT32(ptr, p->valueSize);
+   ptr = pack_BUFFER(ptr, (const BYTE*)p->pcrValue, p->valueSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_COMPOSITE(BYTE* ptr, TPM_PCR_COMPOSITE* p, UnpackPtr alloc) {
+   ptr = unpack_TPM_PCR_SELECTION(ptr, &p->select, alloc);
+   ptr = unpack_UINT32(ptr, &p->valueSize);
+   ptr = unpack_PTR(ptr, (BYTE**)&p->pcrValue, p->valueSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_KEY(BYTE* ptr, const TPM_KEY* k) {
+   ptr = pack_TPM_VERSION(ptr, &k->ver);
+   ptr = pack_TPM_KEY_USAGE(ptr, k->keyUsage);
+   ptr = pack_TPM_KEY_FLAGS(ptr, k->keyFlags);
+   ptr = pack_TPM_AUTH_DATA_USAGE(ptr, k->authDataUsage);
+   ptr = pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
+   ptr = pack_UINT32(ptr, k->PCRInfoSize);
+   if(k->PCRInfoSize) {
+      ptr = pack_TPM_PCR_INFO(ptr, &k->PCRInfo);
+   }
+   ptr = pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
+   ptr = pack_UINT32(ptr, k->encDataSize);
+   return pack_BUFFER(ptr, k->encData, k->encDataSize);
+}
+
+inline BYTE* unpack_TPM_KEY(BYTE* ptr, TPM_KEY* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &k->ver);
+   ptr = unpack_TPM_KEY_USAGE(ptr, &k->keyUsage);
+   ptr = unpack_TPM_KEY_FLAGS(ptr, &k->keyFlags);
+   ptr = unpack_TPM_AUTH_DATA_USAGE(ptr, &k->authDataUsage);
+   ptr = unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
+   ptr = unpack_UINT32(ptr, &k->PCRInfoSize);
+   if(k->PCRInfoSize) {
+      ptr = unpack_TPM_PCR_INFO(ptr, &k->PCRInfo, alloc);
+   }
+   ptr = unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
+   ptr = unpack_UINT32(ptr, &k->encDataSize);
+   return unpack_PTR(ptr, &k->encData, k->encDataSize, alloc);
+}
+
+inline BYTE* pack_TPM_BOUND_DATA(BYTE* ptr, const TPM_BOUND_DATA* b, UINT32 payloadSize) {
+   ptr = pack_TPM_VERSION(ptr, &b->ver);
+   ptr = pack_TPM_PAYLOAD_TYPE(ptr, b->payload);
+   return pack_BUFFER(ptr, b->payloadData, payloadSize);
+}
+
+inline BYTE* unpack_TPM_BOUND_DATA(BYTE* ptr, TPM_BOUND_DATA* b, UINT32 payloadSize, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &b->ver);
+   ptr = unpack_TPM_PAYLOAD_TYPE(ptr, &b->payload);
+   return unpack_PTR(ptr, &b->payloadData, payloadSize, alloc);
+}
+
+inline BYTE* pack_TPM_STORED_DATA(BYTE* ptr, const TPM_STORED_DATA* d) {
+   ptr = pack_TPM_VERSION(ptr, &d->ver);
+   ptr = pack_UINT32(ptr, d->sealInfoSize);
+   if(d->sealInfoSize) {
+      ptr = pack_TPM_PCR_INFO(ptr, &d->sealInfo);
+   }
+   ptr = pack_UINT32(ptr, d->encDataSize);
+   ptr = pack_BUFFER(ptr, d->encData, d->encDataSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_STORED_DATA(BYTE* ptr, TPM_STORED_DATA* d, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &d->ver);
+   ptr = unpack_UINT32(ptr, &d->sealInfoSize);
+   if(d->sealInfoSize) {
+      ptr = unpack_TPM_PCR_INFO(ptr, &d->sealInfo, alloc);
+   }
+   ptr = unpack_UINT32(ptr, &d->encDataSize);
+   ptr = unpack_PTR(ptr, &d->encData, d->encDataSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_AUTH_SESSION(BYTE* ptr, const TPM_AUTH_SESSION* auth) {
+   ptr = pack_TPM_AUTH_HANDLE(ptr, auth->AuthHandle);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+   ptr = pack_TPM_AUTHDATA(ptr, &auth->HMAC);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_AUTH_SESSION(BYTE* ptr, TPM_AUTH_SESSION* auth) {
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = unpack_BOOL(ptr, &auth->fContinueAuthSession);
+   ptr = unpack_TPM_AUTHDATA(ptr, &auth->HMAC);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_RQU_HEADER(BYTE* ptr,
+      TPM_TAG tag,
+      UINT32 size,
+      TPM_COMMAND_CODE ord) {
+   ptr = pack_UINT16(ptr, tag);
+   ptr = pack_UINT32(ptr, size);
+   return pack_UINT32(ptr, ord);
+}
+
+inline BYTE* unpack_TPM_RQU_HEADER(BYTE* ptr,
+      TPM_TAG* tag,
+      UINT32* size,
+      TPM_COMMAND_CODE* ord) {
+   ptr = unpack_UINT16(ptr, tag);
+   ptr = unpack_UINT32(ptr, size);
+   ptr = unpack_UINT32(ptr, ord);
+   return ptr;
+}
+
+#define pack_TPM_RSP_HEADER(p, t, s, r) pack_TPM_RQU_HEADER(p, t, s, r);
+#define unpack_TPM_RSP_HEADER(p, t, s, r) unpack_TPM_RQU_HEADER(p, t, s, r);
+
+#endif
diff --git a/stubdom/vtpmmgr/minios.cfg b/stubdom/vtpmmgr/minios.cfg
new file mode 100644
index 0000000..3fb383d
--- /dev/null
+++ b/stubdom/vtpmmgr/minios.cfg
@@ -0,0 +1,14 @@
+CONFIG_TPMFRONT=y
+CONFIG_TPM_TIS=y
+CONFIG_TPMBACK=y
+CONFIG_START_NETWORK=n
+CONFIG_TEST=n
+CONFIG_PCIFRONT=n
+CONFIG_BLKFRONT=y
+CONFIG_NETFRONT=n
+CONFIG_FBFRONT=n
+CONFIG_KBDFRONT=n
+CONFIG_CONSFRONT=n
+CONFIG_XENBUS=y
+CONFIG_LWIP=n
+CONFIG_XC=n
diff --git a/stubdom/vtpmmgr/tcg.h b/stubdom/vtpmmgr/tcg.h
new file mode 100644
index 0000000..7687eae
--- /dev/null
+++ b/stubdom/vtpmmgr/tcg.h
@@ -0,0 +1,707 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005 Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __TCG_H__
+#define __TCG_H__
+
+#include <stdlib.h>
+#include <stdint.h>
+
+// **************************** CONSTANTS *********************************
+
+// BOOL values
+#define TRUE 0x01
+#define FALSE 0x00
+
+#define TCPA_MAX_BUFFER_LENGTH 0x2000
+
+//
+// TPM_COMMAND_CODE values
+#define TPM_PROTECTED_ORDINAL 0x00000000UL
+#define TPM_UNPROTECTED_ORDINAL 0x80000000UL
+#define TPM_CONNECTION_ORDINAL 0x40000000UL
+#define TPM_VENDOR_ORDINAL 0x20000000UL
+
+#define TPM_ORD_OIAP                     (10UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OSAP                     (11UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuth               (12UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_TakeOwnership            (13UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthAsymStart      (14UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthAsymFinish     (15UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthOwner          (16UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Extend                   (20UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PcrRead                  (21UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Quote                    (22UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Seal                     (23UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Unseal                   (24UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DirWriteAuth             (25UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DirRead                  (26UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_UnBind                   (30UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateWrapKey            (31UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadKey                  (32UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetPubKey                (33UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_EvictKey                 (34UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateMigrationBlob      (40UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReWrapKey                (41UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ConvertMigrationBlob     (42UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_AuthorizeMigrationKey    (43UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateMaintenanceArchive (44UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadMaintenanceArchive   (45UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_KillMaintenanceFeature   (46UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadManuMaintPub         (47UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadManuMaintPub         (48UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CertifyKey               (50UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Sign                     (60UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetRandom                (70UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_StirRandom               (71UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SelfTestFull             (80UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SelfTestStartup          (81UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CertifySelfTest          (82UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ContinueSelfTest         (83UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetTestResult            (84UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Reset                    (90UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerClear               (91UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisableOwnerClear        (92UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ForceClear               (93UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisableForceClear        (94UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapabilitySigned      (100UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapability            (101UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapabilityOwner       (102UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerSetDisable          (110UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalEnable           (111UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalDisable          (112UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetOwnerInstall          (113UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalSetDeactivated   (114UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetTempDeactivated       (115UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateEndorsementKeyPair (120UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_MakeIdentity             (121UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ActivateIdentity         (122UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadPubek                (124UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerReadPubek           (125UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisablePubekRead         (126UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetAuditEvent            (130UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetAuditEventSigned      (131UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetOrdinalAuditStatus    (140UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetOrdinalAuditStatus    (141UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Terminate_Handle         (150UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Init                     (151UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveState                (152UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Startup                  (153UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetRedirection           (154UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Start                (160UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Update               (161UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Complete             (162UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1CompleteExtend       (163UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_FieldUpgrade             (170UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveKeyContext           (180UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadKeyContext           (181UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveAuthContext          (182UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadAuthContext          (183UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveContext                      (184UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadContext                      (185UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_FlushSpecific                    (186UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PCR_Reset                        (200UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_DefineSpace                   (204UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_WriteValue                    (205UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_WriteValueAuth                (206UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_ReadValue                     (207UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_ReadValueAuth                 (208UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_UpdateVerification      (209UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_Manage                  (210UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_CreateKeyDelegation     (212UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_CreateOwnerDelegation   (213UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_VerifyDelegation        (214UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_LoadOwnerDelegation     (216UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_ReadAuth                (217UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_ReadTable               (219UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateCounter                    (220UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_IncrementCounter                 (221UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadCounter                      (222UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseCounter                   (223UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseCounterOwner              (224UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_EstablishTransport               (230UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ExecuteTransport                 (231UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseTransportSigned           (232UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetTicks                         (241UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_TickStampBlob                    (242UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_MAX                              (256UL + TPM_PROTECTED_ORDINAL)
+
+#define TSC_ORD_PhysicalPresence         (10UL + TPM_CONNECTION_ORDINAL)
+
+
+
+//
+// TPM_RESULT values
+//
+// just put in the whole table from spec 1.2
+
+#define TPM_BASE   0x0 // The start of TPM return codes
+#define TPM_VENDOR_ERROR 0x00000400 // Mask to indicate that the error code is vendor specific for vendor specific commands
+#define TPM_NON_FATAL  0x00000800 // Mask to indicate that the error code is a non-fatal failure.
+
+#define TPM_SUCCESS   TPM_BASE // Successful completion of the operation
+#define TPM_AUTHFAIL      TPM_BASE + 1 // Authentication failed
+#define TPM_BADINDEX      TPM_BASE + 2 // The index to a PCR, DIR or other register is incorrect
+#define TPM_BAD_PARAMETER     TPM_BASE + 3 // One or more parameter is bad
+#define TPM_AUDITFAILURE     TPM_BASE + 4 // An operation completed successfully but the auditing of that operation failed.
+#define TPM_CLEAR_DISABLED     TPM_BASE + 5 // The clear disable flag is set and all clear operations now require physical access
+#define TPM_DEACTIVATED     TPM_BASE + 6 // The TPM is deactivated
+#define TPM_DISABLED      TPM_BASE + 7 // The TPM is disabled
+#define TPM_DISABLED_CMD     TPM_BASE + 8 // The target command has been disabled
+#define TPM_FAIL       TPM_BASE + 9 // The operation failed
+#define TPM_BAD_ORDINAL     TPM_BASE + 10 // The ordinal was unknown or inconsistent
+#define TPM_INSTALL_DISABLED   TPM_BASE + 11 // The ability to install an owner is disabled
+#define TPM_INVALID_KEYHANDLE  TPM_BASE + 12 // The key handle presented was invalid
+#define TPM_KEYNOTFOUND     TPM_BASE + 13 // The target key was not found
+#define TPM_INAPPROPRIATE_ENC  TPM_BASE + 14 // Unacceptable encryption scheme
+#define TPM_MIGRATEFAIL     TPM_BASE + 15 // Migration authorization failed
+#define TPM_INVALID_PCR_INFO   TPM_BASE + 16 // PCR information could not be interpreted
+#define TPM_NOSPACE      TPM_BASE + 17 // No room to load key.
+#define TPM_NOSRK       TPM_BASE + 18 // There is no SRK set
+#define TPM_NOTSEALED_BLOB     TPM_BASE + 19 // An encrypted blob is invalid or was not created by this TPM
+#define TPM_OWNER_SET      TPM_BASE + 20 // There is already an Owner
+#define TPM_RESOURCES      TPM_BASE + 21 // The TPM has insufficient internal resources to perform the requested action.
+#define TPM_SHORTRANDOM     TPM_BASE + 22 // A random string was too short
+#define TPM_SIZE       TPM_BASE + 23 // The TPM does not have the space to perform the operation.
+#define TPM_WRONGPCRVAL     TPM_BASE + 24 // The named PCR value does not match the current PCR value.
+#define TPM_BAD_PARAM_SIZE     TPM_BASE + 25 // The paramSize argument to the command has the incorrect value
+#define TPM_SHA_THREAD      TPM_BASE + 26 // There is no existing SHA-1 thread.
+#define TPM_SHA_ERROR      TPM_BASE + 27 // The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error.
+#define TPM_FAILEDSELFTEST     TPM_BASE + 28 // Self-test has failed and the TPM has shutdown.
+#define TPM_AUTH2FAIL      TPM_BASE + 29 // The authorization for the second key in a 2 key function failed authorization
+#define TPM_BADTAG       TPM_BASE + 30 // The tag value sent to for a command is invalid
+#define TPM_IOERROR      TPM_BASE + 31 // An IO error occurred transmitting information to the TPM
+#define TPM_ENCRYPT_ERROR     TPM_BASE + 32 // The encryption process had a problem.
+#define TPM_DECRYPT_ERROR     TPM_BASE + 33 // The decryption process did not complete.
+#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 // An invalid handle was used.
+#define TPM_NO_ENDORSEMENT     TPM_BASE + 35 // The TPM does not a EK installed
+#define TPM_INVALID_KEYUSAGE   TPM_BASE + 36 // The usage of a key is not allowed
+#define TPM_WRONG_ENTITYTYPE   TPM_BASE + 37 // The submitted entity type is not allowed
+#define TPM_INVALID_POSTINIT   TPM_BASE + 38 // The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup
+#define TPM_INAPPROPRIATE_SIG  TPM_BASE + 39 // Signed data cannot include additional DER information
+#define TPM_BAD_KEY_PROPERTY   TPM_BASE + 40 // The key properties in TPM_KEY_PARMs are not supported by this TPM
+
+#define TPM_BAD_MIGRATION      TPM_BASE + 41 // The migration properties of this key are incorrect.
+#define TPM_BAD_SCHEME       TPM_BASE + 42 // The signature or encryption scheme for this key is incorrect or not permitted in this situation.
+#define TPM_BAD_DATASIZE      TPM_BASE + 43 // The size of the data (or blob) parameter is bad or inconsistent with the referenced key
+#define TPM_BAD_MODE       TPM_BASE + 44 // A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob.
+#define TPM_BAD_PRESENCE      TPM_BASE + 45 // Either the physicalPresence or physicalPresenceLock bits have the wrong value
+#define TPM_BAD_VERSION      TPM_BASE + 46 // The TPM cannot perform this version of the capability
+#define TPM_NO_WRAP_TRANSPORT     TPM_BASE + 47 // The TPM does not allow for wrapped transport sessions
+#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 // TPM audit construction failed and the underlying command was returning a failure code also
+#define TPM_AUDITFAIL_SUCCESSFUL   TPM_BASE + 49 // TPM audit construction failed and the underlying command was returning success
+#define TPM_NOTRESETABLE      TPM_BASE + 50 // Attempt to reset a PCR register that does not have the resettable attribute
+#define TPM_NOTLOCAL       TPM_BASE + 51 // Attempt to reset a PCR register that requires locality and locality modifier not part of command transport
+#define TPM_BAD_TYPE       TPM_BASE + 52 // Make identity blob not properly typed
+#define TPM_INVALID_RESOURCE     TPM_BASE + 53 // When saving context identified resource type does not match actual resource
+#define TPM_NOTFIPS       TPM_BASE + 54 // The TPM is attempting to execute a command only available when in FIPS mode
+#define TPM_INVALID_FAMILY      TPM_BASE + 55 // The command is attempting to use an invalid family ID
+#define TPM_NO_NV_PERMISSION     TPM_BASE + 56 // The permission to manipulate the NV storage is not available
+#define TPM_REQUIRES_SIGN      TPM_BASE + 57 // The operation requires a signed command
+#define TPM_KEY_NOTSUPPORTED     TPM_BASE + 58 // Wrong operation to load an NV key
+#define TPM_AUTH_CONFLICT      TPM_BASE + 59 // NV_LoadKey blob requires both owner and blob authorization
+#define TPM_AREA_LOCKED      TPM_BASE + 60 // The NV area is locked and not writtable
+#define TPM_BAD_LOCALITY      TPM_BASE + 61 // The locality is incorrect for the attempted operation
+#define TPM_READ_ONLY       TPM_BASE + 62 // The NV area is read only and can't be written to
+#define TPM_PER_NOWRITE      TPM_BASE + 63 // There is no protection on the write to the NV area
+#define TPM_FAMILYCOUNT      TPM_BASE + 64 // The family count value does not match
+#define TPM_WRITE_LOCKED      TPM_BASE + 65 // The NV area has already been written to
+#define TPM_BAD_ATTRIBUTES      TPM_BASE + 66 // The NV area attributes conflict
+#define TPM_INVALID_STRUCTURE     TPM_BASE + 67 // The structure tag and version are invalid or inconsistent
+#define TPM_KEY_OWNER_CONTROL     TPM_BASE + 68 // The key is under control of the TPM Owner and can only be evicted by the TPM Owner.
+#define TPM_BAD_COUNTER      TPM_BASE + 69 // The counter handle is incorrect
+#define TPM_NOT_FULLWRITE      TPM_BASE + 70 // The write is not a complete write of the area
+#define TPM_CONTEXT_GAP      TPM_BASE + 71 // The gap between saved context counts is too large
+#define TPM_MAXNVWRITES      TPM_BASE + 72 // The maximum number of NV writes without an owner has been exceeded
+#define TPM_NOOPERATOR       TPM_BASE + 73 // No operator authorization value is set
+#define TPM_RESOURCEMISSING     TPM_BASE + 74 // The resource pointed to by context is not loaded
+#define TPM_DELEGATE_LOCK      TPM_BASE + 75 // The delegate administration is locked
+#define TPM_DELEGATE_FAMILY     TPM_BASE + 76 // Attempt to manage a family other then the delegated family
+#define TPM_DELEGATE_ADMIN      TPM_BASE + 77 // Delegation table management not enabled
+#define TPM_TRANSPORT_EXCLUSIVE    TPM_BASE + 78 // There was a command executed outside of an exclusive transport session
+
+// TPM_STARTUP_TYPE values
+#define TPM_ST_CLEAR 0x0001
+#define TPM_ST_STATE 0x0002
+#define TPM_ST_DEACTIVATED 0x003
+
+// TPM_TAG values
+#define TPM_TAG_RQU_COMMAND 0x00c1
+#define TPM_TAG_RQU_AUTH1_COMMAND 0x00c2
+#define TPM_TAG_RQU_AUTH2_COMMAND 0x00c3
+#define TPM_TAG_RSP_COMMAND 0x00c4
+#define TPM_TAG_RSP_AUTH1_COMMAND 0x00c5
+#define TPM_TAG_RSP_AUTH2_COMMAND 0x00c6
+
+// TPM_PAYLOAD_TYPE values
+#define TPM_PT_ASYM 0x01
+#define TPM_PT_BIND 0x02
+#define TPM_PT_MIGRATE 0x03
+#define TPM_PT_MAINT 0x04
+#define TPM_PT_SEAL 0x05
+
+// TPM_ENTITY_TYPE values
+#define TPM_ET_KEYHANDLE 0x0001
+#define TPM_ET_OWNER 0x0002
+#define TPM_ET_DATA 0x0003
+#define TPM_ET_SRK 0x0004
+#define TPM_ET_KEY 0x0005
+
+/// TPM_ResourceTypes
+#define TPM_RT_KEY      0x00000001
+#define TPM_RT_AUTH     0x00000002
+#define TPM_RT_HASH     0x00000003
+#define TPM_RT_TRANS    0x00000004
+#define TPM_RT_CONTEXT  0x00000005
+#define TPM_RT_COUNTER  0x00000006
+#define TPM_RT_DELEGATE 0x00000007
+#define TPM_RT_DAA_TPM  0x00000008
+#define TPM_RT_DAA_V0   0x00000009
+#define TPM_RT_DAA_V1   0x0000000A
+
+
+
+// TPM_PROTOCOL_ID values
+#define TPM_PID_OIAP 0x0001
+#define TPM_PID_OSAP 0x0002
+#define TPM_PID_ADIP 0x0003
+#define TPM_PID_ADCP 0x0004
+#define TPM_PID_OWNER 0x0005
+
+// TPM_ALGORITHM_ID values
+#define TPM_ALG_RSA 0x00000001
+#define TPM_ALG_SHA 0x00000004
+#define TPM_ALG_HMAC 0x00000005
+#define TPM_ALG_AES128 0x00000006
+#define TPM_ALG_MFG1 0x00000007
+#define TPM_ALG_AES192 0x00000008
+#define TPM_ALG_AES256 0x00000009
+#define TPM_ALG_XOR 0x0000000A
+
+// TPM_ENC_SCHEME values
+#define TPM_ES_NONE 0x0001
+#define TPM_ES_RSAESPKCSv15 0x0002
+#define TPM_ES_RSAESOAEP_SHA1_MGF1 0x0003
+
+// TPM_SIG_SCHEME values
+#define TPM_SS_NONE 0x0001
+#define TPM_SS_RSASSAPKCS1v15_SHA1 0x0002
+#define TPM_SS_RSASSAPKCS1v15_DER 0x0003
+
+/*
+ * TPM_CAPABILITY_AREA Values for TPM_GetCapability ([TPM_Part2], Section 21.1)
+ */
+#define TPM_CAP_ORD                     0x00000001
+#define TPM_CAP_ALG                     0x00000002
+#define TPM_CAP_PID                     0x00000003
+#define TPM_CAP_FLAG                    0x00000004
+#define TPM_CAP_PROPERTY                0x00000005
+#define TPM_CAP_VERSION                 0x00000006
+#define TPM_CAP_KEY_HANDLE              0x00000007
+#define TPM_CAP_CHECK_LOADED            0x00000008
+#define TPM_CAP_SYM_MODE                0x00000009
+#define TPM_CAP_KEY_STATUS              0x0000000C
+#define TPM_CAP_NV_LIST                 0x0000000D
+#define TPM_CAP_MFR                     0x00000010
+#define TPM_CAP_NV_INDEX                0x00000011
+#define TPM_CAP_TRANS_ALG               0x00000012
+#define TPM_CAP_HANDLE                  0x00000014
+#define TPM_CAP_TRANS_ES                0x00000015
+#define TPM_CAP_AUTH_ENCRYPT            0x00000017
+#define TPM_CAP_SELECT_SIZE             0x00000018
+#define TPM_CAP_DA_LOGIC                0x00000019
+#define TPM_CAP_VERSION_VAL             0x0000001A
+
+/* subCap definitions ([TPM_Part2], Section 21.2) */
+#define TPM_CAP_PROP_PCR                0x00000101
+#define TPM_CAP_PROP_DIR                0x00000102
+#define TPM_CAP_PROP_MANUFACTURER       0x00000103
+#define TPM_CAP_PROP_KEYS               0x00000104
+#define TPM_CAP_PROP_MIN_COUNTER        0x00000107
+#define TPM_CAP_FLAG_PERMANENT          0x00000108
+#define TPM_CAP_FLAG_VOLATILE           0x00000109
+#define TPM_CAP_PROP_AUTHSESS           0x0000010A
+#define TPM_CAP_PROP_TRANSESS           0x0000010B
+#define TPM_CAP_PROP_COUNTERS           0x0000010C
+#define TPM_CAP_PROP_MAX_AUTHSESS       0x0000010D
+#define TPM_CAP_PROP_MAX_TRANSESS       0x0000010E
+#define TPM_CAP_PROP_MAX_COUNTERS       0x0000010F
+#define TPM_CAP_PROP_MAX_KEYS           0x00000110
+#define TPM_CAP_PROP_OWNER              0x00000111
+#define TPM_CAP_PROP_CONTEXT            0x00000112
+#define TPM_CAP_PROP_MAX_CONTEXT        0x00000113
+#define TPM_CAP_PROP_FAMILYROWS         0x00000114
+#define TPM_CAP_PROP_TIS_TIMEOUT        0x00000115
+#define TPM_CAP_PROP_STARTUP_EFFECT     0x00000116
+#define TPM_CAP_PROP_DELEGATE_ROW       0x00000117
+#define TPM_CAP_PROP_MAX_DAASESS        0x00000119
+#define TPM_CAP_PROP_DAASESS            0x0000011A
+#define TPM_CAP_PROP_CONTEXT_DIST       0x0000011B
+#define TPM_CAP_PROP_DAA_INTERRUPT      0x0000011C
+#define TPM_CAP_PROP_SESSIONS           0x0000011D
+#define TPM_CAP_PROP_MAX_SESSIONS       0x0000011E
+#define TPM_CAP_PROP_CMK_RESTRICTION    0x0000011F
+#define TPM_CAP_PROP_DURATION           0x00000120
+#define TPM_CAP_PROP_ACTIVE_COUNTER     0x00000122
+#define TPM_CAP_PROP_MAX_NV_AVAILABLE   0x00000123
+#define TPM_CAP_PROP_INPUT_BUFFER       0x00000124
+
+// TPM_KEY_USAGE values
+#define TPM_KEY_EK 0x0000
+#define TPM_KEY_SIGNING 0x0010
+#define TPM_KEY_STORAGE 0x0011
+#define TPM_KEY_IDENTITY 0x0012
+#define TPM_KEY_AUTHCHANGE 0X0013
+#define TPM_KEY_BIND 0x0014
+#define TPM_KEY_LEGACY 0x0015
+
+// TPM_AUTH_DATA_USAGE values
+#define TPM_AUTH_NEVER 0x00
+#define TPM_AUTH_ALWAYS 0x01
+
+// Key Handle of owner and srk
+#define TPM_OWNER_KEYHANDLE 0x40000001
+#define TPM_SRK_KEYHANDLE 0x40000000
+
+
+
+// *************************** TYPEDEFS *********************************
+typedef unsigned char BYTE;
+typedef unsigned char BOOL;
+typedef uint16_t UINT16;
+typedef uint32_t UINT32;
+typedef uint64_t UINT64;
+
+typedef UINT32 TPM_RESULT;
+typedef UINT32 TPM_PCRINDEX;
+typedef UINT32 TPM_DIRINDEX;
+typedef UINT32 TPM_HANDLE;
+typedef TPM_HANDLE TPM_AUTHHANDLE;
+typedef TPM_HANDLE TCPA_HASHHANDLE;
+typedef TPM_HANDLE TCPA_HMACHANDLE;
+typedef TPM_HANDLE TCPA_ENCHANDLE;
+typedef TPM_HANDLE TPM_KEY_HANDLE;
+typedef TPM_HANDLE TCPA_ENTITYHANDLE;
+typedef UINT32 TPM_RESOURCE_TYPE;
+typedef UINT32 TPM_COMMAND_CODE;
+typedef UINT16 TPM_PROTOCOL_ID;
+typedef BYTE TPM_AUTH_DATA_USAGE;
+typedef UINT16 TPM_ENTITY_TYPE;
+typedef UINT32 TPM_ALGORITHM_ID;
+typedef UINT16 TPM_KEY_USAGE;
+typedef UINT16 TPM_STARTUP_TYPE;
+typedef UINT32 TPM_CAPABILITY_AREA;
+typedef UINT16 TPM_ENC_SCHEME;
+typedef UINT16 TPM_SIG_SCHEME;
+typedef UINT16 TPM_MIGRATE_SCHEME;
+typedef UINT16 TPM_PHYSICAL_PRESENCE;
+typedef UINT32 TPM_KEY_FLAGS;
+
+#define TPM_DIGEST_SIZE 20  // Don't change this
+typedef BYTE TPM_AUTHDATA[TPM_DIGEST_SIZE];
+typedef TPM_AUTHDATA TPM_SECRET;
+typedef TPM_AUTHDATA TPM_ENCAUTH;
+typedef BYTE TPM_PAYLOAD_TYPE;
+typedef UINT16 TPM_TAG;
+typedef UINT16 TPM_STRUCTURE_TAG;
+
+// Data Types of the TCS
+typedef UINT32 TCS_AUTHHANDLE;  // Handle addressing a authorization session
+typedef UINT32 TCS_CONTEXT_HANDLE; // Basic context handle
+typedef UINT32 TCS_KEY_HANDLE;  // Basic key handle
+
+// ************************* STRUCTURES **********************************
+
+typedef struct TPM_VERSION {
+  BYTE major;
+  BYTE minor;
+  BYTE revMajor;
+  BYTE revMinor;
+} TPM_VERSION;
+
+static const TPM_VERSION TPM_STRUCT_VER_1_1 = { 1,1,0,0 };
+
+typedef struct TPM_CAP_VERSION_INFO {
+   TPM_STRUCTURE_TAG tag;
+   TPM_VERSION version;
+   UINT16 specLevel;
+   BYTE errataRev;
+   BYTE tpmVendorID[4];
+   UINT16 vendorSpecificSize;
+   BYTE* vendorSpecific;
+} TPM_CAP_VERSION_INFO;
+
+inline void free_TPM_CAP_VERSION_INFO(TPM_CAP_VERSION_INFO* v) {
+   free(v->vendorSpecific);
+   v->vendorSpecific = NULL;
+}
+
+typedef struct TPM_DIGEST {
+  BYTE digest[TPM_DIGEST_SIZE];
+} TPM_DIGEST;
+
+typedef TPM_DIGEST TPM_PCRVALUE;
+typedef TPM_DIGEST TPM_COMPOSITE_HASH;
+typedef TPM_DIGEST TPM_DIRVALUE;
+typedef TPM_DIGEST TPM_HMAC;
+typedef TPM_DIGEST TPM_CHOSENID_HASH;
+
+typedef struct TPM_NONCE {
+  BYTE nonce[TPM_DIGEST_SIZE];
+} TPM_NONCE;
+
+typedef struct TPM_SYMMETRIC_KEY_PARMS {
+   UINT32 keyLength;
+   UINT32 blockSize;
+   UINT32 ivSize;
+   BYTE* IV;
+} TPM_SYMMETRIC_KEY_PARMS;
+
+inline void free_TPM_SYMMETRIC_KEY_PARMS(TPM_SYMMETRIC_KEY_PARMS* p) {
+   free(p->IV);
+   p->IV = NULL;
+}
+
+#define TPM_SYMMETRIC_KEY_PARMS_INIT { 0, 0, 0, NULL }
+
+typedef struct TPM_RSA_KEY_PARMS {
+  UINT32 keyLength;
+  UINT32 numPrimes;
+  UINT32 exponentSize;
+  BYTE* exponent;
+} TPM_RSA_KEY_PARMS;
+
+#define TPM_RSA_KEY_PARMS_INIT { 0, 0, 0, NULL }
+
+inline void free_TPM_RSA_KEY_PARMS(TPM_RSA_KEY_PARMS* p) {
+   free(p->exponent);
+   p->exponent = NULL;
+}
+
+typedef struct TPM_KEY_PARMS {
+  TPM_ALGORITHM_ID algorithmID;
+  TPM_ENC_SCHEME encScheme;
+  TPM_SIG_SCHEME sigScheme;
+  UINT32 parmSize;
+  union {
+     TPM_SYMMETRIC_KEY_PARMS sym;
+     TPM_RSA_KEY_PARMS rsa;
+  } parms;
+} TPM_KEY_PARMS;
+
+#define TPM_KEY_PARMS_INIT { 0, 0, 0, 0 }
+
+inline void free_TPM_KEY_PARMS(TPM_KEY_PARMS* p) {
+   if(p->parmSize) {
+      switch(p->algorithmID) {
+         case TPM_ALG_RSA:
+            free_TPM_RSA_KEY_PARMS(&p->parms.rsa);
+            break;
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            free_TPM_SYMMETRIC_KEY_PARMS(&p->parms.sym);
+            break;
+      }
+   }
+}
+
+typedef struct TPM_STORE_PUBKEY {
+  UINT32 keyLength;
+  BYTE* key;
+} TPM_STORE_PUBKEY;
+
+#define TPM_STORE_PUBKEY_INIT { 0, NULL }
+
+inline void free_TPM_STORE_PUBKEY(TPM_STORE_PUBKEY* p) {
+   free(p->key);
+   p->key = NULL;
+}
+
+typedef struct TPM_PUBKEY {
+  TPM_KEY_PARMS algorithmParms;
+  TPM_STORE_PUBKEY pubKey;
+} TPM_PUBKEY;
+
+#define TPM_PUBKEY_INIT { TPM_KEY_PARMS_INIT, TPM_STORE_PUBKEY_INIT }
+
+inline void free_TPM_PUBKEY(TPM_PUBKEY* k) {
+   free_TPM_KEY_PARMS(&k->algorithmParms);
+   free_TPM_STORE_PUBKEY(&k->pubKey);
+}
+
+typedef struct TPM_PCR_SELECTION {
+   UINT16 sizeOfSelect;
+   BYTE* pcrSelect;
+} TPM_PCR_SELECTION;
+
+#define TPM_PCR_SELECTION_INIT { 0, NULL }
+
+inline void free_TPM_PCR_SELECTION(TPM_PCR_SELECTION* p) {
+   free(p->pcrSelect);
+   p->pcrSelect = NULL;
+}
+
+typedef struct TPM_PCR_INFO {
+   TPM_PCR_SELECTION pcrSelection;
+   TPM_COMPOSITE_HASH digestAtRelease;
+   TPM_COMPOSITE_HASH digestAtCreation;
+} TPM_PCR_INFO;
+
+#define TPM_PCR_INFO_INIT { TPM_PCR_SELECTION_INIT }
+
+inline void free_TPM_PCR_INFO(TPM_PCR_INFO* p) {
+   free_TPM_PCR_SELECTION(&p->pcrSelection);
+}
+
+typedef struct TPM_PCR_COMPOSITE {
+  TPM_PCR_SELECTION select;
+  UINT32 valueSize;
+  TPM_PCRVALUE* pcrValue;
+} TPM_PCR_COMPOSITE;
+
+#define TPM_PCR_COMPOSITE_INIT { TPM_PCR_SELECTION_INIT, 0, NULL }
+
+inline void free_TPM_PCR_COMPOSITE(TPM_PCR_COMPOSITE* p) {
+   free_TPM_PCR_SELECTION(&p->select);
+   free(p->pcrValue);
+   p->pcrValue = NULL;
+}
+
+typedef struct TPM_KEY {
+  TPM_VERSION         ver;
+  TPM_KEY_USAGE       keyUsage;
+  TPM_KEY_FLAGS       keyFlags;
+  TPM_AUTH_DATA_USAGE authDataUsage;
+  TPM_KEY_PARMS       algorithmParms;
+  UINT32              PCRInfoSize;
+  TPM_PCR_INFO        PCRInfo;
+  TPM_STORE_PUBKEY    pubKey;
+  UINT32              encDataSize;
+  BYTE*               encData;
+} TPM_KEY;
+
+#define TPM_KEY_INIT { .algorithmParms = TPM_KEY_PARMS_INIT,\
+   .PCRInfoSize = 0, .PCRInfo = TPM_PCR_INFO_INIT, \
+   .pubKey = TPM_STORE_PUBKEY_INIT, \
+   .encDataSize = 0, .encData = NULL }
+
+inline void free_TPM_KEY(TPM_KEY* k) {
+   if(k->PCRInfoSize) {
+      free_TPM_PCR_INFO(&k->PCRInfo);
+   }
+   free_TPM_STORE_PUBKEY(&k->pubKey);
+   free(k->encData);
+   k->encData = NULL;
+}
+
+typedef struct TPM_BOUND_DATA {
+  TPM_VERSION ver;
+  TPM_PAYLOAD_TYPE payload;
+  BYTE* payloadData;
+} TPM_BOUND_DATA;
+
+#define TPM_BOUND_DATA_INIT { .payloadData = NULL }
+
+inline void free_TPM_BOUND_DATA(TPM_BOUND_DATA* d) {
+   free(d->payloadData);
+   d->payloadData = NULL;
+}
+
+typedef struct TPM_STORED_DATA {
+  TPM_VERSION ver;
+  UINT32 sealInfoSize;
+  TPM_PCR_INFO sealInfo;
+  UINT32 encDataSize;
+  BYTE* encData;
+} TPM_STORED_DATA;
+
+#define TPM_STORED_DATA_INIT { .sealInfoSize = 0, sealInfo = TPM_PCR_INFO_INIT,\
+   .encDataSize = 0, .encData = NULL }
+
+inline void free_TPM_STORED_DATA(TPM_STORED_DATA* d) {
+   if(d->sealInfoSize) {
+      free_TPM_PCR_INFO(&d->sealInfo);
+   }
+   free(d->encData);
+   d->encData = NULL;
+}
+
+typedef struct TPM_AUTH_SESSION {
+  TPM_AUTHHANDLE  AuthHandle;
+  TPM_NONCE   NonceOdd;   // system
+  TPM_NONCE   NonceEven;   // TPM
+  BOOL   fContinueAuthSession;
+  TPM_AUTHDATA  HMAC;
+} TPM_AUTH_SESSION;
+
+#define TPM_AUTH_SESSION_INIT { .AuthHandle = 0, .fContinueAuthSession = FALSE }
+
+// ---------------------- Functions for checking TPM_RESULTs -----------------
+
+#include <stdio.h>
+
+// FIXME: Review use of these and delete unneeded ones.
+
+// these are really badly dependent on local structure:
+// DEPENDS: local var 'status' of type TPM_RESULT
+// DEPENDS: label 'abort_egress' which cleans up and returns the status
+#define ERRORDIE(s) do { status = s; \
+                         fprintf (stderr, "*** ERRORDIE in %s at %s: %i\n", __func__, __FILE__, __LINE__); \
+                         goto abort_egress; } \
+                    while (0)
+
+// DEPENDS: local var 'status' of type TPM_RESULT
+// DEPENDS: label 'abort_egress' which cleans up and returns the status
+// Try command c. If it fails, set status to s and goto abort.
+#define TPMTRY(s,c) if (c != TPM_SUCCESS) { \
+                       status = s; \
+                       printf("ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
+                       goto abort_egress; \
+                    } else {\
+                       status = c; \
+                    }
+
+// Try command c. If it fails, print error message, set status to actual return code. Goto abort
+#define TPMTRYRETURN(c) do { status = c; \
+                             if (status != TPM_SUCCESS) { \
+                               fprintf(stderr, "ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
+                               goto abort_egress; \
+                             } \
+                        } while(0)
+
+
+#endif //__TCPA_H__
diff --git a/stubdom/vtpmmgr/tpm.c b/stubdom/vtpmmgr/tpm.c
new file mode 100644
index 0000000..123a27c
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm.c
@@ -0,0 +1,938 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <malloc.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <polarssl/sha1.h>
+
+#include "tcg.h"
+#include "tpm.h"
+#include "log.h"
+#include "marshal.h"
+#include "tpmrsa.h"
+#include "vtpmmgr.h"
+
+#define TCPA_MAX_BUFFER_LENGTH 0x2000
+
+#define TPM_BEGIN(TAG, ORD) \
+   const TPM_TAG intag = TAG;\
+TPM_TAG tag = intag;\
+UINT32 paramSize;\
+const TPM_COMMAND_CODE ordinal = ORD;\
+TPM_RESULT status = TPM_SUCCESS;\
+BYTE in_buf[TCPA_MAX_BUFFER_LENGTH];\
+BYTE out_buf[TCPA_MAX_BUFFER_LENGTH];\
+UINT32 out_len = sizeof(out_buf);\
+BYTE* ptr = in_buf;\
+/*Print a log message */\
+vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);\
+/* Pack the header*/\
+ptr = pack_TPM_TAG(ptr, tag);\
+ptr += sizeof(UINT32);\
+ptr = pack_TPM_COMMAND_CODE(ptr, ordinal)\
+
+#define TPM_AUTH_BEGIN() \
+   sha1_context sha1_ctx;\
+BYTE* authbase = ptr - sizeof(TPM_COMMAND_CODE);\
+TPM_DIGEST paramDigest;\
+sha1_starts(&sha1_ctx)
+
+#define TPM_AUTH1_GEN(HMACkey, auth) do {\
+   sha1_finish(&sha1_ctx, paramDigest.digest);\
+   generateAuth(&paramDigest, HMACkey, auth);\
+   ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_AUTH2_GEN(HMACkey, auth) do {\
+   generateAuth(&paramDigest, HMACkey, auth);\
+   ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_TRANSMIT() do {\
+   /* Pack the command size */\
+   paramSize = ptr - in_buf;\
+   pack_UINT32(in_buf + sizeof(TPM_TAG), paramSize);\
+   if((status = TPM_TransmitData(in_buf, paramSize, out_buf, &out_len)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH_VERIFY_BEGIN() do {\
+   UINT32 buf[2] = { cpu_to_be32(status), cpu_to_be32(ordinal) };\
+   sha1_starts(&sha1_ctx);\
+   sha1_update(&sha1_ctx, (unsigned char*)buf, sizeof(buf));\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH1_VERIFY(HMACkey, auth) do {\
+   sha1_finish(&sha1_ctx, paramDigest.digest);\
+   ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+   if((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH2_VERIFY(HMACkey, auth) do {\
+   ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+   if((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+
+
+#define TPM_UNPACK_VERIFY() do { \
+   ptr = out_buf;\
+   ptr = unpack_TPM_RSP_HEADER(ptr, \
+         &(tag), &(paramSize), &(status));\
+   if((status) != TPM_SUCCESS || (tag) != (intag +3)) { \
+      vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s\n", tpm_get_error_name(status));\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH_HASH() do {\
+   sha1_update(&sha1_ctx, authbase, ptr - authbase);\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH_SKIP() do {\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH_ERR_CHECK(auth) do {\
+   if(status != TPM_SUCCESS || auth->fContinueAuthSession == FALSE) {\
+      vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM\n", auth->AuthHandle);\
+      auth->AuthHandle = 0;\
+   }\
+} while(0)
+
+static void xorEncrypt(const TPM_SECRET* sharedSecret,
+      TPM_NONCE* nonce,
+      const TPM_AUTHDATA* inAuth0,
+      TPM_ENCAUTH outAuth0,
+      const TPM_AUTHDATA* inAuth1,
+      TPM_ENCAUTH outAuth1) {
+   BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
+   BYTE XORkey[TPM_DIGEST_SIZE];
+   BYTE* ptr = XORbuffer;
+   ptr = pack_TPM_SECRET(ptr, sharedSecret);
+   ptr = pack_TPM_NONCE(ptr, nonce);
+
+   sha1(XORbuffer, ptr - XORbuffer, XORkey);
+
+   if(inAuth0) {
+      for(int i = 0; i < TPM_DIGEST_SIZE; ++i) {
+         outAuth0[i] = XORkey[i] ^ (*inAuth0)[i];
+      }
+   }
+   if(inAuth1) {
+      for(int i = 0; i < TPM_DIGEST_SIZE; ++i) {
+         outAuth1[i] = XORkey[i] ^ (*inAuth1)[i];
+      }
+   }
+
+}
+
+static void generateAuth(const TPM_DIGEST* paramDigest,
+      const TPM_SECRET* HMACkey,
+      TPM_AUTH_SESSION *auth)
+{
+   //Generate new OddNonce
+   vtpmmgr_rand((BYTE*)auth->NonceOdd.nonce, sizeof(TPM_NONCE));
+
+   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
+   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
+   BYTE* ptr = hmacText;
+
+   ptr = pack_TPM_DIGEST(ptr, paramDigest);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+
+   sha1_hmac((BYTE *) HMACkey, sizeof(TPM_DIGEST),
+         (BYTE *) hmacText, sizeof(hmacText),
+         auth->HMAC);
+}
+
+static TPM_RESULT verifyAuth(const TPM_DIGEST* paramDigest,
+      /*[IN]*/ const TPM_SECRET *HMACkey,
+      /*[IN,OUT]*/ TPM_AUTH_SESSION *auth)
+{
+
+   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
+   TPM_AUTHDATA hm;
+   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
+   BYTE* ptr = hmacText;
+
+   ptr = pack_TPM_DIGEST(ptr, paramDigest);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+
+   sha1_hmac( (BYTE *) HMACkey, sizeof(TPM_DIGEST),
+         (BYTE *) hmacText, sizeof(hmacText),
+         hm);
+
+   // Compare correct HMAC with provided one.
+   if (memcmp(hm, auth->HMAC, sizeof(TPM_DIGEST)) == 0) { // 0 indicates equality
+      return TPM_SUCCESS;
+   } else {
+      vtpmlogerror(VTPM_LOG_TPM, "Auth Session verification failed!\n");
+      return TPM_AUTHFAIL;
+   }
+}
+
+
+
+// ------------------------------------------------------------------
+// Authorization Commands
+// ------------------------------------------------------------------
+
+TPM_RESULT TPM_OIAP(TPM_AUTH_SESSION*   auth)  // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OIAP);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
+   auth->fContinueAuthSession = TRUE;
+
+   ptr = unpack_UINT32(ptr, &auth->AuthHandle);
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OIAP.\n", auth->AuthHandle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_OSAP(TPM_ENTITY_TYPE  entityType,  // in
+      UINT32    entityValue, // in
+      const TPM_AUTHDATA* usageAuth, //in
+      TPM_SECRET *sharedSecret, //out
+      TPM_AUTH_SESSION *auth)
+{
+   BYTE* nonceOddOSAP;
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OSAP);
+
+   ptr = pack_TPM_ENTITY_TYPE(ptr, entityType);
+   ptr = pack_UINT32(ptr, entityValue);
+
+   //nonce Odd OSAP
+   nonceOddOSAP = ptr;
+   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
+   ptr += TPM_DIGEST_SIZE;
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, &auth->AuthHandle);
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+
+   //Calculate session secret
+   sha1_context ctx;
+   sha1_hmac_starts(&ctx, *usageAuth, TPM_DIGEST_SIZE);
+   sha1_hmac_update(&ctx, ptr, TPM_DIGEST_SIZE); //ptr = nonceEvenOSAP
+   sha1_hmac_update(&ctx, nonceOddOSAP, TPM_DIGEST_SIZE);
+   sha1_hmac_finish(&ctx, *sharedSecret);
+
+   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
+   auth->fContinueAuthSession = FALSE;
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OSAP.\n", auth->AuthHandle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_TakeOwnership(
+      const TPM_PUBKEY *pubEK, //in
+      const TPM_AUTHDATA* ownerAuth, //in
+      const TPM_AUTHDATA* srkAuth, //in
+      const TPM_KEY* inSrk, //in
+      TPM_KEY* outSrk, //out, optional
+      TPM_AUTH_SESSION*   auth)   // in, out
+{
+   int keyAlloced = 0;
+   tpmrsa_context ek_rsa = TPMRSA_CTX_INIT;
+
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_TakeOwnership);
+   TPM_AUTH_BEGIN();
+
+   tpmrsa_set_pubkey(&ek_rsa,
+         pubEK->pubKey.key, pubEK->pubKey.keyLength,
+         pubEK->algorithmParms.parms.rsa.exponent,
+         pubEK->algorithmParms.parms.rsa.exponentSize);
+
+   /* Pack the protocol ID */
+   ptr = pack_UINT16(ptr, TPM_PID_OWNER);
+
+   /* Pack the encrypted owner auth */
+   ptr = pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength / 8);
+   tpmrsa_pub_encrypt_oaep(&ek_rsa,
+         ctr_drbg_random, &vtpm_globals.ctr_drbg,
+         sizeof(TPM_SECRET),
+         (BYTE*) ownerAuth,
+         ptr);
+   ptr += pubEK->algorithmParms.parms.rsa.keyLength / 8;
+
+   /* Pack the encrypted srk auth */
+   ptr = pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength / 8);
+   tpmrsa_pub_encrypt_oaep(&ek_rsa,
+         ctr_drbg_random, &vtpm_globals.ctr_drbg,
+         sizeof(TPM_SECRET),
+         (BYTE*) srkAuth,
+         ptr);
+   ptr += pubEK->algorithmParms.parms.rsa.keyLength / 8;
+
+   /* Pack the Srk key */
+   ptr = pack_TPM_KEY(ptr, inSrk);
+
+   /* Hash everything up to here */
+   TPM_AUTH_HASH();
+
+   /* Generate the authorization */
+   TPM_AUTH1_GEN(ownerAuth, auth);
+
+   /* Send the command to the tpm*/
+   TPM_TRANSMIT();
+   /* Unpack and validate the header */
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   if(outSrk != NULL) {
+      /* If the user wants a copy of the srk we give it to them */
+      keyAlloced = 1;
+      ptr = unpack_TPM_KEY(ptr, outSrk, UNPACK_ALLOC);
+   } else {
+      /*otherwise just parse past it */
+      TPM_KEY temp;
+      ptr = unpack_TPM_KEY(ptr, &temp, UNPACK_ALIAS);
+   }
+
+   /* Hash the output key */
+   TPM_AUTH_HASH();
+
+   /* Verify authorizaton */
+   TPM_AUTH1_VERIFY(ownerAuth, auth);
+
+   goto egress;
+abort_egress:
+   if(keyAlloced) {
+      free_TPM_KEY(outSrk);
+   }
+egress:
+   tpmrsa_free(&ek_rsa);
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+
+TPM_RESULT TPM_DisablePubekRead (
+      const TPM_AUTHDATA* ownerAuth,
+      TPM_AUTH_SESSION*   auth)
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_DisablePubekRead);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(ownerAuth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   TPM_AUTH1_VERIFY(ownerAuth, auth);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+
+TPM_RESULT TPM_TerminateHandle(TPM_AUTHHANDLE  handle)  // in
+{
+   if(handle == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Terminate_Handle);
+
+   ptr = pack_TPM_AUTHHANDLE(ptr, handle);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM_TerminateHandle\n", handle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_Extend( TPM_PCRINDEX  pcrNum,  // in
+      TPM_DIGEST  inDigest, // in
+      TPM_PCRVALUE*  outDigest) // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Extend);
+
+   ptr = pack_TPM_PCRINDEX(ptr, pcrNum);
+   ptr = pack_TPM_DIGEST(ptr, &inDigest);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_TPM_PCRVALUE(ptr, outDigest);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_Seal(
+      TPM_KEY_HANDLE  keyHandle,  // in
+      UINT32    pcrInfoSize, // in
+      TPM_PCR_INFO*    pcrInfo,  // in
+      UINT32    inDataSize,  // in
+      const BYTE*    inData,   // in
+      TPM_STORED_DATA* sealedData, //out
+      const TPM_SECRET* osapSharedSecret, //in
+      const TPM_AUTHDATA* sealedDataAuth, //in
+      TPM_AUTH_SESSION*   pubAuth  // in, out
+      )
+{
+   int dataAlloced = 0;
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_Seal);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, keyHandle);
+
+   TPM_AUTH_SKIP();
+
+   xorEncrypt(osapSharedSecret, &pubAuth->NonceEven,
+         sealedDataAuth, ptr,
+         NULL, NULL);
+   ptr += sizeof(TPM_ENCAUTH);
+
+   ptr = pack_UINT32(ptr, pcrInfoSize);
+   ptr = pack_TPM_PCR_INFO(ptr, pcrInfo);
+
+   ptr = pack_UINT32(ptr, inDataSize);
+   ptr = pack_BUFFER(ptr, inData, inDataSize);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(osapSharedSecret, pubAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_TPM_STORED_DATA(ptr, sealedData, UNPACK_ALLOC);
+   dataAlloced = 1;
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(osapSharedSecret, pubAuth);
+
+   goto egress;
+abort_egress:
+   if(dataAlloced) {
+      free_TPM_STORED_DATA(sealedData);
+   }
+egress:
+   TPM_AUTH_ERR_CHECK(pubAuth);
+   return status;
+}
+
+TPM_RESULT TPM_Unseal(
+      TPM_KEY_HANDLE parentHandle, // in
+      const TPM_STORED_DATA* sealedData,
+      UINT32*   outSize,  // out
+      BYTE**    out, //out
+      const TPM_AUTHDATA* key_usage_auth, //in
+      const TPM_AUTHDATA* data_usage_auth, //in
+      TPM_AUTH_SESSION*   keyAuth,  // in, out
+      TPM_AUTH_SESSION*   dataAuth  // in, out
+      )
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH2_COMMAND, TPM_ORD_Unseal);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, parentHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_TPM_STORED_DATA(ptr, sealedData);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(key_usage_auth, keyAuth);
+   TPM_AUTH2_GEN(data_usage_auth, dataAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, outSize);
+   ptr = unpack_ALLOC(ptr, out, *outSize);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(key_usage_auth, keyAuth);
+   TPM_AUTH2_VERIFY(data_usage_auth, dataAuth);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(keyAuth);
+   TPM_AUTH_ERR_CHECK(dataAuth);
+   return status;
+}
+
+TPM_RESULT TPM_Bind(
+      const TPM_KEY* key,
+      const BYTE* in,
+      UINT32 ilen,
+      BYTE* out)
+{
+   TPM_RESULT status;
+   tpmrsa_context rsa = TPMRSA_CTX_INIT;
+   TPM_BOUND_DATA boundData;
+   uint8_t plain[TCPA_MAX_BUFFER_LENGTH];
+   BYTE* ptr = plain;
+
+   vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);
+
+   tpmrsa_set_pubkey(&rsa,
+         key->pubKey.key, key->pubKey.keyLength,
+         key->algorithmParms.parms.rsa.exponent,
+         key->algorithmParms.parms.rsa.exponentSize);
+
+   // Fill boundData's accessory information
+   boundData.ver = TPM_STRUCT_VER_1_1;
+   boundData.payload = TPM_PT_BIND;
+   boundData.payloadData = (BYTE*)in;
+
+   //marshall the bound data object
+   ptr = pack_TPM_BOUND_DATA(ptr, &boundData, ilen);
+
+   // Encrypt the data
+   TPMTRYRETURN(tpmrsa_pub_encrypt_oaep(&rsa,
+            ctr_drbg_random, &vtpm_globals.ctr_drbg,
+            ptr - plain,
+            plain,
+            out));
+
+abort_egress:
+   tpmrsa_free(&rsa);
+   return status;
+
+}
+
+TPM_RESULT TPM_UnBind(
+      TPM_KEY_HANDLE  keyHandle,  // in
+      UINT32 ilen, //in
+      const BYTE* in, //
+      UINT32* olen, //
+      BYTE*    out, //out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth //in, out
+      )
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_UnBind);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, keyHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_UINT32(ptr, ilen);
+   ptr = pack_BUFFER(ptr, in, ilen);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(usage_auth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, olen);
+   if(*olen > ilen) {
+      vtpmlogerror(VTPM_LOG_TPM, "Output length < input length!\n");
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+   ptr = unpack_BUFFER(ptr, out, *olen);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(usage_auth, auth);
+
+abort_egress:
+egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+TPM_RESULT TPM_CreateWrapKey(
+      TPM_KEY_HANDLE  hWrappingKey,  // in
+      const TPM_AUTHDATA* osapSharedSecret,
+      const TPM_AUTHDATA* dataUsageAuth, //in
+      const TPM_AUTHDATA* dataMigrationAuth, //in
+      TPM_KEY*     key, //in, out
+      TPM_AUTH_SESSION*   pAuth)    // in, out
+{
+   int keyAlloced = 0;
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_CreateWrapKey);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, hWrappingKey);
+
+   TPM_AUTH_SKIP();
+
+   //Encrypted auths
+   xorEncrypt(osapSharedSecret, &pAuth->NonceEven,
+         dataUsageAuth, ptr,
+         dataMigrationAuth, ptr + sizeof(TPM_ENCAUTH));
+   ptr += sizeof(TPM_ENCAUTH) * 2;
+
+   ptr = pack_TPM_KEY(ptr, key);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(osapSharedSecret, pAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   keyAlloced = 1;
+   ptr = unpack_TPM_KEY(ptr, key, UNPACK_ALLOC);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(osapSharedSecret, pAuth);
+
+   goto egress;
+abort_egress:
+   if(keyAlloced) {
+      free_TPM_KEY(key);
+   }
+egress:
+   TPM_AUTH_ERR_CHECK(pAuth);
+   return status;
+}
+
+TPM_RESULT TPM_LoadKey(
+      TPM_KEY_HANDLE  parentHandle, //
+      const TPM_KEY* key, //in
+      TPM_HANDLE*  keyHandle,    // out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth)
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_LoadKey);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, parentHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_TPM_KEY(ptr, key);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(usage_auth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, keyHandle);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(usage_auth, auth);
+
+   vtpmloginfo(VTPM_LOG_TPM, "Key Handle: 0x%x opened by TPM_LoadKey\n", *keyHandle);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+TPM_RESULT TPM_EvictKey( TPM_KEY_HANDLE  hKey)  // in
+{
+   if(hKey == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_EvictKey);
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, hKey);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   vtpmloginfo(VTPM_LOG_TPM, "Key handle: 0x%x closed by TPM_EvictKey\n", hKey);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle,
+      TPM_RESOURCE_TYPE rt) {
+   if(handle == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_FlushSpecific);
+
+   ptr = pack_TPM_HANDLE(ptr, handle);
+   ptr = pack_TPM_RESOURCE_TYPE(ptr, rt);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_GetRandom( UINT32*    bytesRequested, // in, out
+      BYTE*    randomBytes) // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetRandom);
+
+   // check input params
+   if (bytesRequested == NULL || randomBytes == NULL){
+      return TPM_BAD_PARAMETER;
+   }
+
+   ptr = pack_UINT32(ptr, *bytesRequested);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, bytesRequested);
+   ptr = unpack_BUFFER(ptr, randomBytes, *bytesRequested);
+
+abort_egress:
+   return status;
+}
+
+
+TPM_RESULT TPM_ReadPubek(
+      TPM_PUBKEY* pubEK //out
+      )
+{
+   BYTE* antiReplay = NULL;
+   BYTE* kptr = NULL;
+   BYTE digest[TPM_DIGEST_SIZE];
+   sha1_context ctx;
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_ReadPubek);
+
+   //antiReplay nonce
+   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
+   antiReplay = ptr;
+   ptr += TPM_DIGEST_SIZE;
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   //unpack and allocate the key
+   kptr = ptr;
+   ptr = unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
+
+   //Verify the checksum
+   sha1_starts(&ctx);
+   sha1_update(&ctx, kptr, ptr - kptr);
+   sha1_update(&ctx, antiReplay, TPM_DIGEST_SIZE);
+   sha1_finish(&ctx, digest);
+
+   //ptr points to the checksum computed by TPM
+   if(memcmp(digest, ptr, TPM_DIGEST_SIZE)) {
+      vtpmlogerror(VTPM_LOG_TPM, "TPM_ReadPubek: Checksum returned by TPM was invalid!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   goto egress;
+abort_egress:
+   if(kptr != NULL) { //If we unpacked the pubEK, we have to free it
+      free_TPM_PUBKEY(pubEK);
+   }
+egress:
+   return status;
+}
+
+
+TPM_RESULT TPM_SaveState(void)
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_SaveState);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_GetCapability(
+      TPM_CAPABILITY_AREA capArea,
+      UINT32 subCapSize,
+      const BYTE* subCap,
+      UINT32* respSize,
+      BYTE** resp)
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetCapability);
+
+   ptr = pack_TPM_CAPABILITY_AREA(ptr, capArea);
+   ptr = pack_UINT32(ptr, subCapSize);
+   ptr = pack_BUFFER(ptr, subCap, subCapSize);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, respSize);
+   ptr = unpack_ALLOC(ptr, resp, *respSize);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_CreateEndorsementKeyPair(
+      const TPM_KEY_PARMS* keyInfo,
+      TPM_PUBKEY* pubEK)
+{
+   BYTE* kptr = NULL;
+   sha1_context ctx;
+   TPM_DIGEST checksum;
+   TPM_DIGEST hash;
+   TPM_NONCE antiReplay;
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_CreateEndorsementKeyPair);
+
+   //Make anti replay nonce
+   vtpmmgr_rand(antiReplay.nonce, sizeof(antiReplay.nonce));
+
+   ptr = pack_TPM_NONCE(ptr, &antiReplay);
+   ptr = pack_TPM_KEY_PARMS(ptr, keyInfo);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   sha1_starts(&ctx);
+
+   kptr = ptr;
+   ptr = unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
+
+   /* Hash the pub key blob */
+   sha1_update(&ctx, kptr, ptr - kptr);
+   ptr = unpack_TPM_DIGEST(ptr, &checksum);
+
+   sha1_update(&ctx, antiReplay.nonce, sizeof(antiReplay.nonce));
+
+   sha1_finish(&ctx, hash.digest);
+   if(memcmp(checksum.digest, hash.digest, TPM_DIGEST_SIZE)) {
+      vtpmloginfo(VTPM_LOG_VTPM, "TPM_CreateEndorsementKey: Checkum verification failed!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   goto egress;
+abort_egress:
+   if(kptr) {
+      free_TPM_PUBKEY(pubEK);
+   }
+egress:
+   return status;
+}
+
+TPM_RESULT TPM_TransmitData(
+      BYTE* in,
+      UINT32 insize,
+      BYTE* out,
+      UINT32* outsize) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   UINT32 i;
+   vtpmloginfo(VTPM_LOG_TXDATA, "Sending buffer = 0x");
+   for(i = 0 ; i < insize ; i++)
+      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", in[i]);
+
+   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
+
+   ssize_t size = 0;
+
+   // send the request
+   size = write (vtpm_globals.tpm_fd, in, insize);
+   if (size < 0) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "write() failed : %s\n", strerror(errno));
+      ERRORDIE (TPM_IOERROR);
+   }
+   else if ((UINT32) size < insize) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "Wrote %d instead of %d bytes!\n", (int) size, insize);
+      ERRORDIE (TPM_IOERROR);
+   }
+
+   // read the response
+   size = read (vtpm_globals.tpm_fd, out, *outsize);
+   if (size < 0) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "read() failed : %s\n", strerror(errno));
+      ERRORDIE (TPM_IOERROR);
+   }
+
+   vtpmloginfo(VTPM_LOG_TXDATA, "Receiving buffer = 0x");
+   for(i = 0 ; i < size ; i++)
+      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out[i]);
+
+   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
+
+   *outsize = size;
+   goto egress;
+
+abort_egress:
+egress:
+   return status;
+}
diff --git a/stubdom/vtpmmgr/tpm.h b/stubdom/vtpmmgr/tpm.h
new file mode 100644
index 0000000..304e145
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm.h
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005/2006, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __TPM_H__
+#define __TPM_H__
+
+#include "tcg.h"
+
+// ------------------------------------------------------------------
+// Exposed API
+// ------------------------------------------------------------------
+
+// TPM v1.1B Command Set
+
+// Authorzation
+TPM_RESULT TPM_OIAP(
+      TPM_AUTH_SESSION*   auth //out
+      );
+
+TPM_RESULT TPM_OSAP (
+      TPM_ENTITY_TYPE entityType,  // in
+      UINT32    entityValue, // in
+      const TPM_AUTHDATA* usageAuth, //in
+      TPM_SECRET *sharedSecret, //out
+      TPM_AUTH_SESSION *auth);
+
+TPM_RESULT TPM_TakeOwnership(
+      const TPM_PUBKEY *pubEK, //in
+      const TPM_AUTHDATA* ownerAuth, //in
+      const TPM_AUTHDATA* srkAuth, //in
+      const TPM_KEY* inSrk, //in
+      TPM_KEY* outSrk, //out, optional
+      TPM_AUTH_SESSION*   auth   // in, out
+      );
+
+TPM_RESULT TPM_DisablePubekRead (
+      const TPM_AUTHDATA* ownerAuth,
+      TPM_AUTH_SESSION*   auth
+      );
+
+TPM_RESULT TPM_TerminateHandle ( TPM_AUTHHANDLE  handle  // in
+      );
+
+TPM_RESULT TPM_FlushSpecific ( TPM_HANDLE  handle,  // in
+      TPM_RESOURCE_TYPE resourceType //in
+      );
+
+// TPM Mandatory
+TPM_RESULT TPM_Extend ( TPM_PCRINDEX  pcrNum,  // in
+      TPM_DIGEST   inDigest, // in
+      TPM_PCRVALUE*   outDigest // out
+      );
+
+TPM_RESULT TPM_PcrRead ( TPM_PCRINDEX  pcrNum,  // in
+      TPM_PCRVALUE*  outDigest // out
+      );
+
+TPM_RESULT TPM_Quote ( TCS_KEY_HANDLE  keyHandle,  // in
+      TPM_NONCE   antiReplay,  // in
+      UINT32*    PcrDataSize, // in, out
+      BYTE**    PcrData,  // in, out
+      TPM_AUTH_SESSION*   privAuth,  // in, out
+      UINT32*    sigSize,  // out
+      BYTE**    sig    // out
+      );
+
+TPM_RESULT TPM_Seal(
+      TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32    pcrInfoSize, // in
+      TPM_PCR_INFO*    pcrInfo,  // in
+      UINT32    inDataSize,  // in
+      const BYTE*    inData,   // in
+      TPM_STORED_DATA* sealedData, //out
+      const TPM_SECRET* osapSharedSecret, //in
+      const TPM_AUTHDATA* sealDataAuth, //in
+      TPM_AUTH_SESSION*   pubAuth  // in, out
+      );
+
+TPM_RESULT TPM_Unseal (
+      TPM_KEY_HANDLE parentHandle, // in
+      const TPM_STORED_DATA* sealedData,
+      UINT32*   outSize,  // out
+      BYTE**    out, //out
+      const TPM_AUTHDATA* key_usage_auth, //in
+      const TPM_AUTHDATA* data_usage_auth, //in
+      TPM_AUTH_SESSION*   keyAuth,  // in, out
+      TPM_AUTH_SESSION*   dataAuth  // in, out
+      );
+
+TPM_RESULT TPM_DirWriteAuth ( TPM_DIRINDEX  dirIndex,  // in
+      TPM_DIRVALUE  newContents, // in
+      TPM_AUTH_SESSION*   ownerAuth  // in, out
+      );
+
+TPM_RESULT TPM_DirRead ( TPM_DIRINDEX  dirIndex, // in
+      TPM_DIRVALUE*  dirValue // out
+      );
+
+TPM_RESULT TPM_Bind(
+      const TPM_KEY* key, //in
+      const BYTE* in, //in
+      UINT32 ilen, //in
+      BYTE* out //out, must be at least cipher block size
+      );
+
+TPM_RESULT TPM_UnBind (
+      TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32 ilen, //in
+      const BYTE* in, //
+      UINT32*   outDataSize, // out
+      BYTE*    outData, //out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth //in, out
+      );
+
+TPM_RESULT TPM_CreateWrapKey (
+      TCS_KEY_HANDLE  hWrappingKey,  // in
+      const TPM_AUTHDATA* osapSharedSecret,
+      const TPM_AUTHDATA* dataUsageAuth, //in
+      const TPM_AUTHDATA* dataMigrationAuth, //in
+      TPM_KEY*     key, //in
+      TPM_AUTH_SESSION*   pAuth    // in, out
+      );
+
+TPM_RESULT TPM_LoadKey (
+      TPM_KEY_HANDLE  parentHandle, //
+      const TPM_KEY* key, //in
+      TPM_HANDLE*  keyHandle,    // out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth
+      );
+
+TPM_RESULT TPM_GetPubKey (  TCS_KEY_HANDLE  hKey,   // in
+      TPM_AUTH_SESSION*   pAuth,   // in, out
+      UINT32*    pcPubKeySize, // out
+      BYTE**    prgbPubKey  // out
+      );
+
+TPM_RESULT TPM_EvictKey ( TCS_KEY_HANDLE  hKey  // in
+      );
+
+TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle, //in
+      TPM_RESOURCE_TYPE rt //in
+      );
+
+TPM_RESULT TPM_Sign ( TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32    areaToSignSize, // in
+      BYTE*    areaToSign,  // in
+      TPM_AUTH_SESSION*   privAuth,  // in, out
+      UINT32*    sigSize,  // out
+      BYTE**    sig    // out
+      );
+
+TPM_RESULT TPM_GetRandom (  UINT32*    bytesRequested, // in, out
+      BYTE*    randomBytes  // out
+      );
+
+TPM_RESULT TPM_StirRandom (  UINT32    inDataSize, // in
+      BYTE*    inData  // in
+      );
+
+TPM_RESULT TPM_ReadPubek (
+      TPM_PUBKEY* pubEK //out
+      );
+
+TPM_RESULT TPM_GetCapability(
+      TPM_CAPABILITY_AREA capArea,
+      UINT32 subCapSize,
+      const BYTE* subCap,
+      UINT32* respSize,
+      BYTE** resp);
+
+TPM_RESULT TPM_SaveState(void);
+
+TPM_RESULT TPM_CreateEndorsementKeyPair(
+      const TPM_KEY_PARMS* keyInfo,
+      TPM_PUBKEY* pubEK);
+
+TPM_RESULT TPM_TransmitData(
+      BYTE* in,
+      UINT32 insize,
+      BYTE* out,
+      UINT32* outsize);
+
+#endif //TPM_H
diff --git a/stubdom/vtpmmgr/tpmrsa.c b/stubdom/vtpmmgr/tpmrsa.c
new file mode 100644
index 0000000..56094e7
--- /dev/null
+++ b/stubdom/vtpmmgr/tpmrsa.c
@@ -0,0 +1,175 @@
+/*
+ *  The RSA public-key cryptosystem
+ *
+ *  Copyright (C) 2006-2011, Brainspark B.V.
+ *
+ *  This file is part of PolarSSL (http://www.polarssl.org)
+ *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
+ *
+ *  All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ *  RSA was designed by Ron Rivest, Adi Shamir and Len Adleman.
+ *
+ *  http://theory.lcs.mit.edu/~rivest/rsapaper.pdf
+ *  http://www.cacr.math.uwaterloo.ca/hac/about/chap8.pdf
+ */
+
+#include "tcg.h"
+#include "polarssl/sha1.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "tpmrsa.h"
+
+#define HASH_LEN 20
+
+void tpmrsa_set_pubkey(tpmrsa_context* ctx,
+      const unsigned char* key,
+      int keylen,
+      const unsigned char* exponent,
+      int explen) {
+
+   tpmrsa_free(ctx);
+
+   if(explen == 0) { //Default e= 2^16+1
+      mpi_lset(&ctx->E, 65537);
+   } else {
+      mpi_read_binary(&ctx->E, exponent, explen);
+   }
+   mpi_read_binary(&ctx->N, key, keylen);
+
+   ctx->len = ( mpi_msb(&ctx->N) + 7) >> 3;
+}
+
+static TPM_RESULT tpmrsa_public( tpmrsa_context *ctx,
+      const unsigned char *input,
+      unsigned char *output )
+{
+   int ret;
+   size_t olen;
+   mpi T;
+
+   mpi_init( &T );
+
+   MPI_CHK( mpi_read_binary( &T, input, ctx->len ) );
+
+   if( mpi_cmp_mpi( &T, &ctx->N ) >= 0 )
+   {
+      mpi_free( &T );
+      return TPM_ENCRYPT_ERROR;
+   }
+
+   olen = ctx->len;
+   MPI_CHK( mpi_exp_mod( &T, &T, &ctx->E, &ctx->N, &ctx->RN ) );
+   MPI_CHK( mpi_write_binary( &T, output, olen ) );
+
+cleanup:
+
+   mpi_free( &T );
+
+   if( ret != 0 )
+      return TPM_ENCRYPT_ERROR;
+
+   return TPM_SUCCESS;
+}
+
+static void mgf_mask( unsigned char *dst, int dlen, unsigned char *src, int slen)
+{
+   unsigned char mask[HASH_LEN];
+   unsigned char counter[4] = {0, 0, 0, 0};
+   int i;
+   sha1_context mctx;
+
+   //We always hash the src with the counter, so save the partial hash
+   sha1_starts(&mctx);
+   sha1_update(&mctx, src, slen);
+
+   // Generate and apply dbMask
+   while(dlen > 0) {
+      //Copy the sha1 context
+      sha1_context ctx = mctx;
+
+      //compute hash for input || counter
+      sha1_update(&ctx, counter, sizeof(counter));
+      sha1_finish(&ctx, mask);
+
+      //Apply the mask
+      for(i = 0; i < (dlen < HASH_LEN ? dlen : HASH_LEN); ++i) {
+         *(dst++) ^= mask[i];
+      }
+
+      //Increment counter
+      ++counter[3];
+
+      dlen -= HASH_LEN;
+   }
+}
+
+/*
+ * Add the message padding, then do an RSA operation
+ */
+TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
+      int (*f_rng)(void *, unsigned char *, size_t),
+      void *p_rng,
+      size_t ilen,
+      const unsigned char *input,
+      unsigned char *output )
+{
+   int ret;
+   int olen;
+   unsigned char* seed = output + 1;
+   unsigned char* db = output + HASH_LEN +1;
+
+   olen = ctx->len-1;
+
+   if( f_rng == NULL )
+      return TPM_ENCRYPT_ERROR;
+
+   if( ilen > olen - 2 * HASH_LEN - 1)
+      return TPM_ENCRYPT_ERROR;
+
+   output[0] = 0;
+
+   //Encoding parameter p
+   sha1((unsigned char*)"TCPA", 4, db);
+
+   //PS
+   memset(db + HASH_LEN, 0,
+         olen - ilen - 2 * HASH_LEN - 1);
+
+   //constant 1 byte
+   db[olen - ilen - HASH_LEN -1] = 0x01;
+
+   //input string
+   memcpy(db + olen - ilen - HASH_LEN,
+         input, ilen);
+
+   //Generate random seed
+   if( ( ret = f_rng( p_rng, seed, HASH_LEN ) ) != 0 )
+      return TPM_ENCRYPT_ERROR;
+
+   // maskedDB: Apply dbMask to DB
+   mgf_mask( db, olen - HASH_LEN, seed, HASH_LEN);
+
+   // maskedSeed: Apply seedMask to seed
+   mgf_mask( seed, HASH_LEN, db, olen - HASH_LEN);
+
+   // Do the crypto op
+   return tpmrsa_public(ctx, output, output);
+}
diff --git a/stubdom/vtpmmgr/tpmrsa.h b/stubdom/vtpmmgr/tpmrsa.h
new file mode 100644
index 0000000..59579e7
--- /dev/null
+++ b/stubdom/vtpmmgr/tpmrsa.h
@@ -0,0 +1,67 @@
+/**
+ * \file rsa.h
+ *
+ * \brief The RSA public-key cryptosystem
+ *
+ *  Copyright (C) 2006-2010, Brainspark B.V.
+ *
+ *  This file is part of PolarSSL (http://www.polarssl.org)
+ *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
+ *
+ *  All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef TPMRSA_H
+#define TPMRSA_H
+
+#include "tcg.h"
+#include <polarssl/bignum.h>
+
+/* tpm software key */
+typedef struct
+{
+    size_t len;                 /*!<  size(N) in chars  */
+
+    mpi N;                      /*!<  public modulus    */
+    mpi E;                      /*!<  public exponent   */
+
+    mpi RN;                     /*!<  cached R^2 mod N  */
+}
+tpmrsa_context;
+
+#define TPMRSA_CTX_INIT { 0, {0, 0, NULL}, {0, 0, NULL}, {0, 0, NULL}}
+
+/* Setup the rsa context using tpm public key data */
+void tpmrsa_set_pubkey(tpmrsa_context* ctx,
+      const unsigned char* key,
+      int keylen,
+      const unsigned char* exponent,
+      int explen);
+
+/* Do rsa public crypto */
+TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
+      int (*f_rng)(void *, unsigned char *, size_t),
+      void *p_rng,
+      size_t ilen,
+      const unsigned char *input,
+      unsigned char *output );
+
+/* free tpmrsa key */
+inline void tpmrsa_free( tpmrsa_context *ctx ) {
+   mpi_free( &ctx->RN ); mpi_free( &ctx->E  ); mpi_free( &ctx->N  );
+}
+
+#endif /* tpmrsa.h */
diff --git a/stubdom/vtpmmgr/uuid.h b/stubdom/vtpmmgr/uuid.h
new file mode 100644
index 0000000..4737645
--- /dev/null
+++ b/stubdom/vtpmmgr/uuid.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPMMGR_UUID_H
+#define VTPMMGR_UUID_H
+
+#define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
+#define UUID_FMTLEN ((2*16)+4) /* 16 hex bytes plus 4 hypens */
+#define UUID_BYTES(uuid) uuid[0], uuid[1], uuid[2], uuid[3], \
+                                uuid[4], uuid[5], uuid[6], uuid[7], \
+                                uuid[8], uuid[9], uuid[10], uuid[11], \
+                                uuid[12], uuid[13], uuid[14], uuid[15]
+
+
+typedef uint8_t uuid_t[16];
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_cmd_handler.c b/stubdom/vtpmmgr/vtpm_cmd_handler.c
new file mode 100644
index 0000000..f82a2a9
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_cmd_handler.c
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <inttypes.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "marshal.h"
+#include "log.h"
+#include "vtpm_storage.h"
+#include "vtpmmgr.h"
+#include "tpm.h"
+#include "tcg.h"
+
+static TPM_RESULT vtpmmgr_SaveHashKey(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+
+   if(tpmcmd->req_len != VTPM_COMMAND_HEADER_SIZE + HASHKEYSZ) {
+      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_ORD_SAVEHASHKEY hashkey too short!\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   /* Do the command */
+   TPMTRYRETURN(vtpm_storage_save_hashkey(uuid, tpmcmd->req + VTPM_COMMAND_HEADER_SIZE));
+
+abort_egress:
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         VTPM_TAG_RSP, VTPM_COMMAND_HEADER_SIZE, status);
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+
+   return status;
+}
+
+static TPM_RESULT vtpmmgr_LoadHashKey(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+
+   TPMTRYRETURN(vtpm_storage_load_hashkey(uuid, tpmcmd->resp + VTPM_COMMAND_HEADER_SIZE));
+
+   tpmcmd->resp_len += HASHKEYSZ;
+
+abort_egress:
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         VTPM_TAG_RSP, tpmcmd->resp_len, status);
+
+   return status;
+}
+
+
+TPM_RESULT vtpmmgr_handle_cmd(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_TAG tag;
+   UINT32 size;
+   TPM_COMMAND_CODE ord;
+
+   unpack_TPM_RQU_HEADER(tpmcmd->req,
+         &tag, &size, &ord);
+
+   /* Handle the command now */
+   switch(tag) {
+      case VTPM_TAG_REQ:
+         //This is a vTPM command
+         switch(ord) {
+            case VTPM_ORD_SAVEHASHKEY:
+               return vtpmmgr_SaveHashKey(uuid, tpmcmd);
+            case VTPM_ORD_LOADHASHKEY:
+               return vtpmmgr_LoadHashKey(uuid, tpmcmd);
+            default:
+               vtpmlogerror(VTPM_LOG_VTPM, "Invalid vTPM Ordinal %" PRIu32 "\n", ord);
+               status = TPM_BAD_ORDINAL;
+         }
+         break;
+      case TPM_TAG_RQU_COMMAND:
+      case TPM_TAG_RQU_AUTH1_COMMAND:
+      case TPM_TAG_RQU_AUTH2_COMMAND:
+         //This is a TPM passthrough command
+         switch(ord) {
+            case TPM_ORD_GetRandom:
+               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_GetRandom\n");
+               break;
+            case TPM_ORD_PcrRead:
+               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_PcrRead\n");
+               break;
+            default:
+               vtpmlogerror(VTPM_LOG_VTPM, "TPM Disallowed Passthrough ord=%" PRIu32 "\n", ord);
+               status = TPM_DISABLED_CMD;
+               goto abort_egress;
+         }
+
+         size = TCPA_MAX_BUFFER_LENGTH;
+         TPMTRYRETURN(TPM_TransmitData(tpmcmd->req, tpmcmd->req_len, tpmcmd->resp, &size));
+         tpmcmd->resp_len = size;
+
+         unpack_TPM_RESULT(tpmcmd->resp + sizeof(TPM_TAG) + sizeof(UINT32), &status);
+         return status;
+
+         break;
+      default:
+         vtpmlogerror(VTPM_LOG_VTPM, "Invalid tag=%" PRIu16 "\n", tag);
+         status = TPM_BADTAG;
+   }
+
+abort_egress:
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         tag + 3, tpmcmd->resp_len, status);
+
+   return status;
+}
diff --git a/stubdom/vtpmmgr/vtpm_manager.h b/stubdom/vtpmmgr/vtpm_manager.h
new file mode 100644
index 0000000..a2bbcca
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_manager.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPM_MANAGER_H
+#define VTPM_MANAGER_H
+
+#define VTPM_TAG_REQ 0x01c1
+#define VTPM_TAG_RSP 0x01c4
+#define COMMAND_BUFFER_SIZE 4096
+
+// Header size
+#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
+
+//************************ Command Codes ****************************
+#define VTPM_ORD_BASE       0x0000
+#define VTPM_PRIV_MASK      0x01000000 // Priviledged VTPM Command
+#define VTPM_PRIV_BASE      (VTPM_ORD_BASE | VTPM_PRIV_MASK)
+
+// Non-priviledged VTPM Commands (From DMI's)
+#define VTPM_ORD_SAVEHASHKEY      (VTPM_ORD_BASE + 1) // DMI requests encryption key for persistent storage
+#define VTPM_ORD_LOADHASHKEY      (VTPM_ORD_BASE + 2) // DMI requests symkey to be regenerated
+
+//************************ Return Codes ****************************
+#define VTPM_SUCCESS               0
+#define VTPM_FAIL                  1
+#define VTPM_UNSUPPORTED           2
+#define VTPM_FORBIDDEN             3
+#define VTPM_RESTORE_CONTEXT_FAILED    4
+#define VTPM_INVALID_REQUEST       5
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_storage.c b/stubdom/vtpmmgr/vtpm_storage.c
new file mode 100644
index 0000000..abb0dba
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_storage.c
@@ -0,0 +1,794 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+/***************************************************************
+ * DISK IMAGE LAYOUT
+ * *************************************************************
+ * All data is stored in BIG ENDIAN format
+ * *************************************************************
+ * Section 1: Header
+ *
+ * 10 bytes 	 id			ID String "VTPMMGRDOM"
+ * uint32_t	 version	        Disk Image version number (current == 1)
+ * uint32_t      storage_key_len	Length of the storage Key
+ * TPM_KEY       storage_key		Marshalled TPM_KEY structure (See TPM spec v2)
+ * RSA_BLOCK     aes_crypto             Encrypted aes key data (RSA_CIPHER_SIZE bytes), bound by the storage_key
+ *  BYTE[32] aes_key                    Aes key for encrypting the uuid table
+ *  uint32_t cipher_sz                  Encrypted size of the uuid table
+ *
+ * *************************************************************
+ * Section 2: Uuid Table
+ *
+ * This table is encrypted by the aes_key in the header. The cipher text size is just
+ * large enough to hold all of the entries plus required padding.
+ *
+ * Each entry is as follows
+ * BYTE[16] uuid                       Uuid of a vtpm that is stored on this disk
+ * uint32_t offset                     Disk offset where the vtpm data is stored
+ *
+ * *************************************************************
+ * Section 3: Vtpm Table
+ *
+ * The rest of the disk stores vtpms. Each vtpm is an RSA_BLOCK encrypted
+ * by the storage key. Each vtpm must exist on an RSA_BLOCK aligned boundary,
+ * starting at the first RSA_BLOCK aligned offset after the uuid table.
+ * As the uuid table grows, vtpms may be relocated.
+ *
+ * RSA_BLOCK     vtpm_crypto          Vtpm data encrypted by storage_key
+ *   BYTE[20]    hash                 Sha1 hash of vtpm encrypted data
+ *   BYTE[16]    vtpm_aes_key         Encryption key for vtpm data
+ *
+  *************************************************************
+ */
+#define DISKVERS 1
+#define IDSTR "VTPMMGRDOM"
+#define IDSTRLEN 10
+#define AES_BLOCK_SIZE 16
+#define AES_KEY_BITS 256
+#define AES_KEY_SIZE (AES_KEY_BITS/8)
+#define BUF_SIZE 4096
+
+#define UUID_TBL_ENT_SIZE (sizeof(uuid_t) + sizeof(uint32_t))
+
+#define HEADERSZ (10 + 4 + 4)
+
+#define TRY_READ(buf, size, msg) do {\
+   int rc; \
+   if((rc = read(blkfront_fd, buf, (size))) != (size)) { \
+      vtpmlogerror(VTPM_LOG_VTPM, "read() failed! " msg " : rc=(%d/%d), error=(%s)\n", rc, (int)(size), strerror(errno)); \
+      status = TPM_IOERROR;\
+      goto abort_egress;\
+   } \
+} while(0)
+
+#define TRY_WRITE(buf, size, msg) do {\
+   int rc; \
+   if((rc = write(blkfront_fd, buf, (size))) != (size)) { \
+      vtpmlogerror(VTPM_LOG_VTPM, "write() failed! " msg " : rc=(%d/%d), error=(%s)\n", rc, (int)(size), strerror(errno)); \
+      status = TPM_IOERROR;\
+      goto abort_egress;\
+   } \
+} while(0)
+
+#include <blkfront.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <mini-os/byteorder.h>
+#include <polarssl/aes.h>
+
+#include "vtpm_manager.h"
+#include "log.h"
+#include "marshal.h"
+#include "tpm.h"
+#include "uuid.h"
+
+#include "vtpmmgr.h"
+#include "vtpm_storage.h"
+
+#define MAX(a,b) ( ((a) > (b)) ? (a) : (b) )
+#define MIN(a,b) ( ((a) < (b)) ? (a) : (b) )
+
+/* blkfront device objets */
+static struct blkfront_dev* blkdev = NULL;
+static int blkfront_fd = -1;
+
+struct Vtpm {
+   uuid_t uuid;
+   int offset;
+};
+struct Storage {
+   int aes_offset;
+   int uuid_offset;
+   int end_offset;
+
+   int num_vtpms;
+   int num_vtpms_alloced;
+   struct Vtpm* vtpms;
+};
+
+/* Global storage data */
+static struct Storage g_store = {
+   .vtpms = NULL,
+};
+
+static int get_offset(void) {
+   return lseek(blkfront_fd, 0, SEEK_CUR);
+}
+
+static void reset_store(void) {
+   g_store.aes_offset = 0;
+   g_store.uuid_offset = 0;
+   g_store.end_offset = 0;
+
+   g_store.num_vtpms = 0;
+   g_store.num_vtpms_alloced = 0;
+   free(g_store.vtpms);
+   g_store.vtpms = NULL;
+}
+
+static int vtpm_get_index(const uuid_t uuid) {
+   int st = 0;
+   int ed = g_store.num_vtpms-1;
+   while(st <= ed) {
+      int mid = ((unsigned int)st + (unsigned int)ed) >> 1; //avoid overflow
+      int c = memcmp(uuid, &g_store.vtpms[mid].uuid, sizeof(uuid_t));
+      if(c == 0) {
+         return mid;
+      } else if(c > 0) {
+         st = mid + 1;
+      } else {
+         ed = mid - 1;
+      }
+   }
+   return -(st + 1);
+}
+
+static void vtpm_add(const uuid_t uuid, int offset, int index) {
+   /* Realloc more space if needed */
+   if(g_store.num_vtpms >= g_store.num_vtpms_alloced) {
+      g_store.num_vtpms_alloced += 16;
+      g_store.vtpms = realloc(
+            g_store.vtpms,
+            sizeof(struct Vtpm) * g_store.num_vtpms_alloced);
+   }
+
+   /* Move everybody after the new guy */
+   for(int i = g_store.num_vtpms; i > index; --i) {
+      g_store.vtpms[i] = g_store.vtpms[i-1];
+   }
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Registered vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+
+   /* Finally add new one */
+   memcpy(g_store.vtpms[index].uuid, uuid, sizeof(uuid_t));
+   g_store.vtpms[index].offset = offset;
+   ++g_store.num_vtpms;
+}
+
+#if 0
+static void vtpm_remove(int index) {
+   for(i = index; i < g_store.num_vtpms; ++i) {
+      g_store.vtpms[i] = g_store.vtpms[i+1];
+   }
+   --g_store.num_vtpms;
+}
+#endif
+
+static int pack_uuid_table(uint8_t* table, int size, int* nvtpms) {
+   uint8_t* ptr = table;
+   while(*nvtpms < g_store.num_vtpms && size >= 0)
+   {
+      /* Pack the uuid */
+      memcpy(ptr, (uint8_t*)g_store.vtpms[*nvtpms].uuid, sizeof(uuid_t));
+      ptr+= sizeof(uuid_t);
+
+
+      /* Pack the offset */
+      ptr = pack_UINT32(ptr, g_store.vtpms[*nvtpms].offset);
+
+      ++*nvtpms;
+      size -= UUID_TBL_ENT_SIZE;
+   }
+   return ptr - table;
+}
+
+/* Extract the uuids */
+static int extract_uuid_table(uint8_t* table, int size) {
+   uint8_t* ptr = table;
+   for(;size >= UUID_TBL_ENT_SIZE; size -= UUID_TBL_ENT_SIZE) {
+      int index;
+      uint32_t v32;
+
+      /*uuid_t is just an array of bytes, so we can do a direct cast here */
+      uint8_t* uuid = ptr;
+      ptr += sizeof(uuid_t);
+
+      /* Get the offset of the key */
+      ptr = unpack_UINT32(ptr, &v32);
+
+      /* Insert the new vtpm in sorted order */
+      if((index = vtpm_get_index(uuid)) >= 0) {
+         vtpmlogerror(VTPM_LOG_VTPM, "Vtpm (" UUID_FMT ") exists multiple times! ignoring...\n", UUID_BYTES(uuid));
+         continue;
+      }
+      index = -index -1;
+
+      vtpm_add(uuid, v32, index);
+
+   }
+   return ptr - table;
+}
+
+static void vtpm_decrypt_block(aes_context* aes,
+      uint8_t* iv,
+      uint8_t* cipher,
+      uint8_t* plain,
+      int cipher_sz,
+      int* overlap)
+{
+   int bytes_ext;
+   /* Decrypt */
+   aes_crypt_cbc(aes, AES_DECRYPT,
+         cipher_sz,
+         iv, cipher, plain + *overlap);
+
+   /* Extract */
+   bytes_ext = extract_uuid_table(plain, cipher_sz + *overlap);
+
+   /* Copy left overs to the beginning */
+   *overlap = cipher_sz + *overlap - bytes_ext;
+   memcpy(plain, plain + bytes_ext, *overlap);
+}
+
+static int vtpm_encrypt_block(aes_context* aes,
+      uint8_t* iv,
+      uint8_t* plain,
+      uint8_t* cipher,
+      int block_sz,
+      int* overlap,
+      int* num_vtpms)
+{
+   int bytes_to_crypt;
+   int bytes_packed;
+
+   /* Pack the uuid table */
+   bytes_packed = *overlap + pack_uuid_table(plain + *overlap, block_sz - *overlap, num_vtpms);
+   bytes_to_crypt = MIN(bytes_packed, block_sz);
+
+   /* Add padding if we aren't on a multiple of the block size */
+   if(bytes_to_crypt & (AES_BLOCK_SIZE-1)) {
+      int oldsz = bytes_to_crypt;
+      //add padding
+      bytes_to_crypt += AES_BLOCK_SIZE - (bytes_to_crypt & (AES_BLOCK_SIZE-1));
+      //fill padding with random bytes
+      vtpmmgr_rand(plain + oldsz, bytes_to_crypt - oldsz);
+      *overlap = 0;
+   } else {
+      *overlap = bytes_packed - bytes_to_crypt;
+   }
+
+   /* Encrypt this chunk */
+   aes_crypt_cbc(aes, AES_ENCRYPT,
+            bytes_to_crypt,
+            iv, plain, cipher);
+
+   /* Copy the left over partials to the beginning */
+   memcpy(plain, plain + bytes_to_crypt, *overlap);
+
+   return bytes_to_crypt;
+}
+
+static TPM_RESULT vtpm_storage_new_vtpm(const uuid_t uuid, int index) {
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
+   uint8_t buf[BUF_SIZE];
+   uint8_t* ptr;
+   int cipher_sz;
+   aes_context aes;
+
+   /* Add new vtpm to the table */
+   vtpm_add(uuid, g_store.end_offset, index);
+   g_store.end_offset += RSA_CIPHER_SIZE;
+
+   /* Compute the new end location of the encrypted uuid table */
+   cipher_sz = AES_BLOCK_SIZE; //IV
+   cipher_sz += g_store.num_vtpms * UUID_TBL_ENT_SIZE; //uuid table
+   cipher_sz += (AES_BLOCK_SIZE - (cipher_sz & (AES_BLOCK_SIZE -1))) & (AES_BLOCK_SIZE-1); //aes padding
+
+   /* Does this overlap any key data? If so they need to be relocated */
+   int uuid_end = (g_store.uuid_offset + cipher_sz + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+   for(int i = 0; i < g_store.num_vtpms; ++i) {
+      if(g_store.vtpms[i].offset < uuid_end) {
+
+         vtpmloginfo(VTPM_LOG_VTPM, "Relocating vtpm data\n");
+
+         //Read the hashkey cipher text
+         lseek(blkfront_fd, g_store.vtpms[i].offset, SEEK_SET);
+         TRY_READ(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
+
+         //Write the cipher text to new offset
+         lseek(blkfront_fd, g_store.end_offset, SEEK_SET);
+         TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
+
+         //Save new offset
+         g_store.vtpms[i].offset = g_store.end_offset;
+         g_store.end_offset += RSA_CIPHER_SIZE;
+      }
+   }
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Generating a new symmetric key\n");
+
+   /* Generate an aes key */
+   TPMTRYRETURN(vtpmmgr_rand(plain, AES_KEY_SIZE));
+   aes_setkey_enc(&aes, plain, AES_KEY_BITS);
+   ptr = plain + AES_KEY_SIZE;
+
+   /* Pack the crypted size */
+   ptr = pack_UINT32(ptr, cipher_sz);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Binding encrypted key\n");
+
+   /* Seal the key and size */
+   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
+            plain,
+            ptr - plain,
+            buf));
+
+   /* Write the sealed key to disk */
+   lseek(blkfront_fd, g_store.aes_offset, SEEK_SET);
+   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm aes key");
+
+   /* ENCRYPT AND WRITE UUID TABLE */
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Encrypting the uuid table\n");
+
+   int num_vtpms = 0;
+   int overlap = 0;
+   int bytes_crypted;
+   uint8_t iv[AES_BLOCK_SIZE];
+
+   /* Generate the iv for the first block */
+   TPMTRYRETURN(vtpmmgr_rand(iv, AES_BLOCK_SIZE));
+
+   /* Copy the iv to the cipher text buffer to be written to disk */
+   memcpy(buf, iv, AES_BLOCK_SIZE);
+   ptr = buf + AES_BLOCK_SIZE;
+
+   /* Encrypt the first block of the uuid table */
+   bytes_crypted = vtpm_encrypt_block(&aes,
+         iv, //iv
+         plain, //plaintext
+         ptr, //cipher text
+         BUF_SIZE - AES_BLOCK_SIZE,
+         &overlap,
+         &num_vtpms);
+
+   /* Write the iv followed by the crypted table*/
+   TRY_WRITE(buf, bytes_crypted + AES_BLOCK_SIZE, "vtpm uuid table");
+
+   /* Decrement the number of bytes encrypted */
+   cipher_sz -= bytes_crypted + AES_BLOCK_SIZE;
+
+   /* If there are more vtpms, encrypt and write them block by block */
+   while(cipher_sz > 0) {
+      /* Encrypt the next block of the uuid table */
+      bytes_crypted = vtpm_encrypt_block(&aes,
+               iv,
+               plain,
+               buf,
+               BUF_SIZE,
+               &overlap,
+               &num_vtpms);
+
+      /* Write the cipher text to disk */
+      TRY_WRITE(buf, bytes_crypted, "vtpm uuid table");
+
+      cipher_sz -= bytes_crypted;
+   }
+
+   goto egress;
+abort_egress:
+egress:
+   return status;
+}
+
+
+/**************************************
+ * PUBLIC FUNCTIONS
+ * ***********************************/
+
+int vtpm_storage_init(void) {
+   struct blkfront_info info;
+   if((blkdev = init_blkfront(NULL, &info)) == NULL) {
+      return -1;
+   }
+   if((blkfront_fd = blkfront_open(blkdev)) < 0) {
+      return -1;
+   }
+   return 0;
+}
+
+void vtpm_storage_shutdown(void) {
+   reset_store();
+   close(blkfront_fd);
+}
+
+TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ])
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   int index;
+   uint8_t cipher[RSA_CIPHER_SIZE];
+   uint8_t clear[RSA_CIPHER_SIZE];
+   UINT32 clear_size;
+
+   /* Find the index of this uuid */
+   if((index = vtpm_get_index(uuid)) < 0) {
+      index = -index-1;
+      vtpmlogerror(VTPM_LOG_VTPM, "LoadKey failure: Unrecognized uuid! " UUID_FMT "\n", UUID_BYTES(uuid));
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   /* Read the table entry */
+   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
+   TRY_READ(cipher, RSA_CIPHER_SIZE, "vtpm hashkey data");
+
+   /* Decrypt the table entry */
+   TPMTRYRETURN(TPM_UnBind(
+            vtpm_globals.storage_key_handle,
+            RSA_CIPHER_SIZE,
+            cipher,
+            &clear_size,
+            clear,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.oiap));
+
+   if(clear_size < HASHKEYSZ) {
+      vtpmloginfo(VTPM_LOG_VTPM, "Decrypted Hash key size (%" PRIu32 ") was too small!\n", clear_size);
+      status = TPM_RESOURCES;
+      goto abort_egress;
+   }
+
+   memcpy(hashkey, clear, HASHKEYSZ);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Loaded hash and key for vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+   goto egress;
+abort_egress:
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load key\n");
+egress:
+   return status;
+}
+
+TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ])
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   int index;
+   uint8_t buf[RSA_CIPHER_SIZE];
+
+   /* Find the index of this uuid */
+   if((index = vtpm_get_index(uuid)) < 0) {
+      index = -index-1;
+      /* Create a new vtpm */
+      TPMTRYRETURN( vtpm_storage_new_vtpm(uuid, index) );
+   }
+
+   /* Encrypt the hash and key */
+   TPMTRYRETURN( TPM_Bind(&vtpm_globals.storage_key,
+            hashkey,
+            HASHKEYSZ,
+            buf));
+
+   /* Write to disk */
+   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
+   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey data");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saved hash and key for vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+   goto egress;
+abort_egress:
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to save key\n");
+egress:
+   return status;
+}
+
+TPM_RESULT vtpm_storage_new_header()
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t buf[BUF_SIZE];
+   uint8_t keybuf[AES_KEY_SIZE + sizeof(uint32_t)];
+   uint8_t* ptr = buf;
+   uint8_t* sptr;
+
+   /* Clear everything first */
+   reset_store();
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Creating new disk image header\n");
+
+   /*Copy the ID string */
+   memcpy(ptr, IDSTR, IDSTRLEN);
+   ptr += IDSTRLEN;
+
+   /*Copy the version */
+   ptr = pack_UINT32(ptr, DISKVERS);
+
+   /*Save the location of the key size */
+   sptr = ptr;
+   ptr += sizeof(UINT32);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saving root storage key..\n");
+
+   /* Copy the storage key */
+   ptr = pack_TPM_KEY(ptr, &vtpm_globals.storage_key);
+
+   /* Now save the size */
+   pack_UINT32(sptr, ptr - (sptr + 4));
+
+   /* Create a fake aes key and set cipher text size to 0 */
+   memset(keybuf, 0, sizeof(keybuf));
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Binding uuid table symmetric key..\n");
+
+   /* Save the location of the aes key */
+   g_store.aes_offset = ptr - buf;
+
+   /* Store the fake aes key and vtpm count */
+   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
+         keybuf,
+         sizeof(keybuf),
+         ptr));
+   ptr+= RSA_CIPHER_SIZE;
+
+   /* Write the header to disk */
+   lseek(blkfront_fd, 0, SEEK_SET);
+   TRY_WRITE(buf, ptr-buf, "vtpm header");
+
+   /* Save the location of the uuid table */
+   g_store.uuid_offset = get_offset();
+
+   /* Save the end offset */
+   g_store.end_offset = (g_store.uuid_offset + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saved new manager disk header.\n");
+
+   goto egress;
+abort_egress:
+egress:
+   return status;
+}
+
+
+TPM_RESULT vtpm_storage_load_header(void)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint32_t v32;
+   uint8_t buf[BUF_SIZE];
+   uint8_t* ptr = buf;
+   aes_context aes;
+
+   /* Clear everything first */
+   reset_store();
+
+   /* Read the header from disk */
+   lseek(blkfront_fd, 0, SEEK_SET);
+   TRY_READ(buf, IDSTRLEN + sizeof(UINT32) + sizeof(UINT32), "vtpm header");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Loading disk image header\n");
+
+   /* Verify the ID string */
+   if(memcmp(ptr, IDSTR, IDSTRLEN)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid ID string in disk image!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+   ptr+=IDSTRLEN;
+
+   /* Unpack the version */
+   ptr = unpack_UINT32(ptr, &v32);
+
+   /* Verify the version */
+   if(v32 != DISKVERS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unsupported disk image version number %" PRIu32 "\n", v32);
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   /* Size of the storage key */
+   ptr = unpack_UINT32(ptr, &v32);
+
+   /* Sanity check */
+   if(v32 > BUF_SIZE) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Size of storage key (%" PRIu32 ") is too large!\n", v32);
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* read the storage key */
+   TRY_READ(buf, v32, "storage pub key");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Unpacking storage key\n");
+
+   /* unpack the storage key */
+   ptr = unpack_TPM_KEY(buf, &vtpm_globals.storage_key, UNPACK_ALLOC);
+
+   /* Load Storage Key into the TPM */
+   TPMTRYRETURN( TPM_LoadKey(
+            TPM_SRK_KEYHANDLE,
+            &vtpm_globals.storage_key,
+            &vtpm_globals.storage_key_handle,
+            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+            &vtpm_globals.oiap));
+
+   /* Initialize the storage key auth */
+   memset(vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA));
+
+   /* Store the offset of the aes key */
+   g_store.aes_offset = get_offset();
+
+   /* Read the rsa cipher text for the aes key */
+   TRY_READ(buf, RSA_CIPHER_SIZE, "aes key");
+   ptr = buf + RSA_CIPHER_SIZE;
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Unbinding uuid table symmetric key\n");
+
+   /* Decrypt the aes key protecting the uuid table */
+   UINT32 datalen;
+   TPMTRYRETURN(TPM_UnBind(
+            vtpm_globals.storage_key_handle,
+            RSA_CIPHER_SIZE,
+            buf,
+            &datalen,
+            ptr,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.oiap));
+
+   /* Validate the length of the output buffer */
+   if(datalen < AES_KEY_SIZE + sizeof(UINT32)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unbound AES key size (%d) was too small! expected (%ld)\n", datalen, AES_KEY_SIZE + sizeof(UINT32));
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* Extract the aes key */
+   aes_setkey_dec(&aes, ptr, AES_KEY_BITS);
+   ptr+= AES_KEY_SIZE;
+
+   /* Extract the ciphertext size */
+   ptr = unpack_UINT32(ptr, &v32);
+   int cipher_size = v32;
+
+   /* Sanity check */
+   if(cipher_size & (AES_BLOCK_SIZE-1)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Cipher text size (%" PRIu32 ") is not a multiple of the aes block size! (%d)\n", v32, AES_BLOCK_SIZE);
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* Save the location of the uuid table */
+   g_store.uuid_offset = get_offset();
+
+   /* Only decrypt the table if there are vtpms to decrypt */
+   if(cipher_size > 0) {
+      int rbytes;
+      int overlap = 0;
+      uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
+      uint8_t iv[AES_BLOCK_SIZE];
+
+      vtpmloginfo(VTPM_LOG_VTPM, "Decrypting uuid table\n");
+
+      /* Pre allocate the vtpm array */
+      g_store.num_vtpms_alloced = cipher_size / UUID_TBL_ENT_SIZE;
+      g_store.vtpms = malloc(sizeof(struct Vtpm) * g_store.num_vtpms_alloced);
+
+      /* Read the iv and the first chunk of cipher text */
+      rbytes = MIN(cipher_size, BUF_SIZE);
+      TRY_READ(buf, rbytes, "vtpm uuid table\n");
+      cipher_size -= rbytes;
+
+      /* Copy the iv */
+      memcpy(iv, buf, AES_BLOCK_SIZE);
+      ptr = buf + AES_BLOCK_SIZE;
+
+      /* Remove the iv from the number of bytes to decrypt */
+      rbytes -= AES_BLOCK_SIZE;
+
+      /* Decrypt and extract vtpms */
+      vtpm_decrypt_block(&aes,
+            iv, ptr, plain,
+            rbytes, &overlap);
+
+      /* Read the rest of the table if there is more */
+      while(cipher_size > 0) {
+         /* Read next chunk of cipher text */
+         rbytes = MIN(cipher_size, BUF_SIZE);
+         TRY_READ(buf, rbytes, "vtpm uuid table");
+         cipher_size -= rbytes;
+
+         /* Decrypt a block of text */
+         vtpm_decrypt_block(&aes,
+               iv, buf, plain,
+               rbytes, &overlap);
+
+      }
+      vtpmloginfo(VTPM_LOG_VTPM, "Loaded %d vtpms!\n", g_store.num_vtpms);
+   }
+
+   /* The end of the key table, new vtpms go here */
+   int uuid_end = (get_offset() + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+   g_store.end_offset = uuid_end;
+
+   /* Compute the end offset while validating vtpms*/
+   for(int i = 0; i < g_store.num_vtpms; ++i) {
+      /* offset must not collide with previous data */
+      if(g_store.vtpms[i].offset < uuid_end) {
+         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
+               " offset (%d) is before end of uuid table (%d)!\n",
+               UUID_BYTES(g_store.vtpms[i].uuid),
+               g_store.vtpms[i].offset, uuid_end);
+         status = TPM_IOERROR;
+         goto abort_egress;
+      }
+      /* offset must be at a multiple of cipher size */
+      if(g_store.vtpms[i].offset & (RSA_CIPHER_SIZE-1)) {
+         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
+               " offset(%d) is not at a multiple of the rsa cipher text size (%d)!\n",
+               UUID_BYTES(g_store.vtpms[i].uuid),
+               g_store.vtpms[i].offset, RSA_CIPHER_SIZE);
+         status = TPM_IOERROR;
+         goto abort_egress;
+      }
+      /* Save the last offset */
+      if(g_store.vtpms[i].offset >= g_store.end_offset) {
+         g_store.end_offset = g_store.vtpms[i].offset + RSA_CIPHER_SIZE;
+      }
+   }
+
+   goto egress;
+abort_egress:
+   //An error occured somewhere
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load manager data!\n");
+
+   //Clear the data store
+   reset_store();
+
+   //Reset the storage key structure
+   free_TPM_KEY(&vtpm_globals.storage_key);
+   {
+      TPM_KEY key = TPM_KEY_INIT;
+      vtpm_globals.storage_key = key;
+   }
+
+   //Reset the storage key handle
+   TPM_EvictKey(vtpm_globals.storage_key_handle);
+   vtpm_globals.storage_key_handle = 0;
+egress:
+   return status;
+}
+
+#if 0
+/* For testing disk IO */
+void add_fake_vtpms(int num) {
+   for(int i = 0; i < num; ++i) {
+      uint32_t ind = cpu_to_be32(i);
+
+      uuid_t uuid;
+      memset(uuid, 0, sizeof(uuid_t));
+      memcpy(uuid, &ind, sizeof(ind));
+      int index = vtpm_get_index(uuid);
+      index = -index-1;
+
+      vtpm_storage_new_vtpm(uuid, index);
+   }
+}
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_storage.h b/stubdom/vtpmmgr/vtpm_storage.h
new file mode 100644
index 0000000..a5a5fd7
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_storage.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPM_STORAGE_H
+#define VTPM_STORAGE_h
+
+#include "uuid.h"
+
+#define VTPM_NVMKEY_SIZE 32
+#define HASHKEYSZ (sizeof(TPM_DIGEST) + VTPM_NVMKEY_SIZE)
+
+/* Initialize the storage system and its virtual disk */
+int vtpm_storage_init(void);
+
+/* Shutdown the storage system and its virtual disk */
+void vtpm_storage_shutdown(void);
+
+/* Loads Sha1 hash and 256 bit AES key from disk and stores them
+ * packed together in outbuf. outbuf must be freed
+ * by the caller using buffer_free()
+ */
+TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ]);
+
+/* inbuf must contain a sha1 hash followed by a 256 bit AES key.
+ * Encrypts and stores the hash and key to disk */
+TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ]);
+
+/* Load the vtpm manager data - call this on startup */
+TPM_RESULT vtpm_storage_load_header(void);
+
+/* Saves the vtpm manager data - call this on shutdown */
+TPM_RESULT vtpm_storage_new_header(void);
+
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpmmgr.c b/stubdom/vtpmmgr/vtpmmgr.c
new file mode 100644
index 0000000..563f4e8
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpmmgr.c
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdint.h>
+#include <mini-os/tpmback.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "log.h"
+
+#include "vtpmmgr.h"
+#include "tcg.h"
+
+
+void main_loop(void) {
+   tpmcmd_t* tpmcmd;
+   uint8_t respbuf[TCPA_MAX_BUFFER_LENGTH];
+
+   while(1) {
+      /* Wait for requests from a vtpm */
+      vtpmloginfo(VTPM_LOG_VTPM, "Waiting for commands from vTPM's:\n");
+      if((tpmcmd = tpmback_req_any()) == NULL) {
+         vtpmlogerror(VTPM_LOG_VTPM, "NULL tpmcmd\n");
+         continue;
+      }
+
+      tpmcmd->resp = respbuf;
+
+      /* Process the command */
+      vtpmmgr_handle_cmd(tpmcmd->uuid, tpmcmd);
+
+      /* Send response */
+      tpmback_resp(tpmcmd);
+   }
+}
+
+int main(int argc, char** argv)
+{
+   int rc = 0;
+   sleep(2);
+   vtpmloginfo(VTPM_LOG_VTPM, "Starting vTPM manager domain\n");
+
+   /* Initialize the vtpm manager */
+   if(vtpmmgr_init(argc, argv) != TPM_SUCCESS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize vtpmmgr domain!\n");
+      rc = -1;
+      goto exit;
+   }
+
+   main_loop();
+
+   vtpmloginfo(VTPM_LOG_VTPM, "vTPM Manager shutting down...\n");
+
+   vtpmmgr_shutdown();
+
+exit:
+   return rc;
+
+}
diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
new file mode 100644
index 0000000..50a1992
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPMMGR_H
+#define VTPMMGR_H
+
+#include <mini-os/tpmback.h>
+#include <polarssl/entropy.h>
+#include <polarssl/ctr_drbg.h>
+
+#include "uuid.h"
+#include "tcg.h"
+#include "vtpm_manager.h"
+
+#define RSA_KEY_SIZE 0x0800
+#define RSA_CIPHER_SIZE (RSA_KEY_SIZE / 8)
+
+struct vtpm_globals {
+   int tpm_fd;
+   TPM_KEY             storage_key;
+   TPM_HANDLE          storage_key_handle;       // Key used by persistent store
+   TPM_AUTH_SESSION    oiap;                // OIAP session for storageKey
+   TPM_AUTHDATA        storage_key_usage_auth;
+
+   TPM_AUTHDATA        owner_auth;
+   TPM_AUTHDATA        srk_auth;
+
+   entropy_context     entropy;
+   ctr_drbg_context    ctr_drbg;
+};
+
+// --------------------------- Global Values --------------------------
+extern struct vtpm_globals vtpm_globals;   // Key info and DMI states
+
+TPM_RESULT vtpmmgr_init(int argc, char** argv);
+void vtpmmgr_shutdown(void);
+
+TPM_RESULT vtpmmgr_handle_cmd(const uuid_t uuid, tpmcmd_t* tpmcmd);
+
+inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes) {
+   return ctr_drbg_random(&vtpm_globals.ctr_drbg, bytes, num_bytes) == 0 ? 0 : TPM_FAIL;
+}
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:36:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:36:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te81x-0007uH-Rc; Thu, 29 Nov 2012 17:36:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te81v-0007so-Gx
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:36:08 +0000
Received: from [85.158.138.51:40544] by server-2.bemta-3.messagelabs.com id
	02/B9-04744-60D97B05; Thu, 29 Nov 2012 17:36:06 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-9.tower-174.messagelabs.com!1354210557!32037323!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	UNPARSEABLE_RELAY,UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11050 invoked from network); 29 Nov 2012 17:35:59 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-9.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 17:35:59 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158386742;
	Thu, 29 Nov 2012 12:35:48 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com
Date: Thu, 29 Nov 2012 12:35:29 -0500
Message-Id: <1354210534-31052-3-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [VTPM v5 2/7] add stubdom/vtpmmgr code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Add the code base for vtpmmgrdom. Makefile changes
next patch.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/vtpmmgr/Makefile           |   32 ++
 stubdom/vtpmmgr/init.c             |  553 +++++++++++++++++++++
 stubdom/vtpmmgr/log.c              |  151 ++++++
 stubdom/vtpmmgr/log.h              |   85 ++++
 stubdom/vtpmmgr/marshal.h          |  528 ++++++++++++++++++++
 stubdom/vtpmmgr/minios.cfg         |   14 +
 stubdom/vtpmmgr/tcg.h              |  707 +++++++++++++++++++++++++++
 stubdom/vtpmmgr/tpm.c              |  938 ++++++++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/tpm.h              |  218 +++++++++
 stubdom/vtpmmgr/tpmrsa.c           |  175 +++++++
 stubdom/vtpmmgr/tpmrsa.h           |   67 +++
 stubdom/vtpmmgr/uuid.h             |   50 ++
 stubdom/vtpmmgr/vtpm_cmd_handler.c |  152 ++++++
 stubdom/vtpmmgr/vtpm_manager.h     |   64 +++
 stubdom/vtpmmgr/vtpm_storage.c     |  794 ++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/vtpm_storage.h     |   68 +++
 stubdom/vtpmmgr/vtpmmgr.c          |   93 ++++
 stubdom/vtpmmgr/vtpmmgr.h          |   77 +++
 18 files changed, 4766 insertions(+)
 create mode 100644 stubdom/vtpmmgr/Makefile
 create mode 100644 stubdom/vtpmmgr/init.c
 create mode 100644 stubdom/vtpmmgr/log.c
 create mode 100644 stubdom/vtpmmgr/log.h
 create mode 100644 stubdom/vtpmmgr/marshal.h
 create mode 100644 stubdom/vtpmmgr/minios.cfg
 create mode 100644 stubdom/vtpmmgr/tcg.h
 create mode 100644 stubdom/vtpmmgr/tpm.c
 create mode 100644 stubdom/vtpmmgr/tpm.h
 create mode 100644 stubdom/vtpmmgr/tpmrsa.c
 create mode 100644 stubdom/vtpmmgr/tpmrsa.h
 create mode 100644 stubdom/vtpmmgr/uuid.h
 create mode 100644 stubdom/vtpmmgr/vtpm_cmd_handler.c
 create mode 100644 stubdom/vtpmmgr/vtpm_manager.h
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.c
 create mode 100644 stubdom/vtpmmgr/vtpm_storage.h
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.c
 create mode 100644 stubdom/vtpmmgr/vtpmmgr.h

diff --git a/stubdom/vtpmmgr/Makefile b/stubdom/vtpmmgr/Makefile
new file mode 100644
index 0000000..88c83c3
--- /dev/null
+++ b/stubdom/vtpmmgr/Makefile
@@ -0,0 +1,32 @@
+# Copyright (c) 2010-2012 United States Government, as represented by
+# the Secretary of Defense.  All rights reserved.
+#
+# THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+# ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+# INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+# DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+# SOFTWARE.
+#
+
+XEN_ROOT=../..
+
+PSSL_DIR=../polarssl-$(XEN_TARGET_ARCH)/library
+PSSL_OBJS=aes.o sha1.o entropy.o ctr_drbg.o bignum.o sha4.o havege.o timing.o entropy_poll.o
+
+TARGET=vtpmmgr.a
+OBJS=vtpmmgr.o vtpm_cmd_handler.o vtpm_storage.o init.o tpmrsa.o tpm.o log.o
+
+CFLAGS+=-Werror -Iutil -Icrypto -Itcs
+CFLAGS+=-Wno-declaration-after-statement -Wno-unused-label
+
+build: $(TARGET)
+$(TARGET): $(OBJS)
+	ar -rcs $@ $^ $(foreach obj,$(PSSL_OBJS),$(PSSL_DIR)/$(obj))
+
+clean:
+	rm -f $(TARGET) $(OBJS)
+
+distclean: clean
+
+.PHONY: clean distclean
diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
new file mode 100644
index 0000000..a158020
--- /dev/null
+++ b/stubdom/vtpmmgr/init.c
@@ -0,0 +1,553 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+#include <stdint.h>
+#include <stdlib.h>
+
+#include <xen/xen.h>
+#include <mini-os/tpmback.h>
+#include <mini-os/tpmfront.h>
+#include <mini-os/tpm_tis.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <polarssl/sha1.h>
+
+#include "log.h"
+#include "vtpmmgr.h"
+#include "vtpm_storage.h"
+#include "tpm.h"
+#include "marshal.h"
+
+struct Opts {
+   enum {
+      TPMDRV_TPM_TIS,
+      TPMDRV_TPMFRONT,
+   } tpmdriver;
+   unsigned long tpmiomem;
+   unsigned int tpmirq;
+   unsigned int tpmlocality;
+   int gen_owner_auth;
+};
+
+// --------------------------- Well Known Auths --------------------------
+const TPM_AUTHDATA WELLKNOWN_SRK_AUTH = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+const TPM_AUTHDATA WELLKNOWN_OWNER_AUTH = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+
+struct vtpm_globals vtpm_globals = {
+   .tpm_fd = -1,
+   .storage_key = TPM_KEY_INIT,
+   .storage_key_handle = 0,
+   .oiap = { .AuthHandle = 0 }
+};
+
+static int tpm_entropy_source(void* dummy, unsigned char* data, size_t len, size_t* olen) {
+   UINT32 sz = len;
+   TPM_RESULT rc = TPM_GetRandom(&sz, data);
+   *olen = sz;
+   return rc == TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
+}
+
+static TPM_RESULT check_tpm_version(void) {
+   TPM_RESULT status;
+   UINT32 rsize;
+   BYTE* res = NULL;
+   TPM_CAP_VERSION_INFO vinfo;
+
+   TPMTRYRETURN(TPM_GetCapability(
+            TPM_CAP_VERSION_VAL,
+            0,
+            NULL,
+            &rsize,
+            &res));
+   if(rsize < 4) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid size returned by GetCapability!\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   unpack_TPM_CAP_VERSION_INFO(res, &vinfo, UNPACK_ALIAS);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Hardware TPM:\n");
+   vtpmloginfo(VTPM_LOG_VTPM, " version: %hhd %hhd %hhd %hhd\n",
+         vinfo.version.major, vinfo.version.minor, vinfo.version.revMajor, vinfo.version.revMinor);
+   vtpmloginfo(VTPM_LOG_VTPM, " specLevel: %hd\n", vinfo.specLevel);
+   vtpmloginfo(VTPM_LOG_VTPM, " errataRev: %hhd\n", vinfo.errataRev);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorID: %c%c%c%c\n",
+         vinfo.tpmVendorID[0], vinfo.tpmVendorID[1],
+         vinfo.tpmVendorID[2], vinfo.tpmVendorID[3]);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecificSize: %hd\n", vinfo.vendorSpecificSize);
+   vtpmloginfo(VTPM_LOG_VTPM, " vendorSpecific: ");
+   for(int i = 0; i < vinfo.vendorSpecificSize; ++i) {
+      vtpmloginfomore(VTPM_LOG_VTPM, "%02hhx", vinfo.vendorSpecific[i]);
+   }
+   vtpmloginfomore(VTPM_LOG_VTPM, "\n");
+
+abort_egress:
+   free(res);
+   return status;
+}
+
+static TPM_RESULT flush_tpm(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   const TPM_RESOURCE_TYPE reslist[] = { TPM_RT_KEY, TPM_RT_AUTH, TPM_RT_TRANS, TPM_RT_COUNTER, TPM_RT_DAA_TPM, TPM_RT_CONTEXT };
+   BYTE* keylist = NULL;
+   UINT32 keylistSize;
+   BYTE* ptr;
+
+   //Iterate through each resource type and flush all handles
+   for(int i = 0; i < sizeof(reslist) / sizeof(TPM_RESOURCE_TYPE); ++i) {
+      TPM_RESOURCE_TYPE beres = cpu_to_be32(reslist[i]);
+      UINT16 size;
+      TPMTRYRETURN(TPM_GetCapability(
+               TPM_CAP_HANDLE,
+               sizeof(TPM_RESOURCE_TYPE),
+               (BYTE*)(&beres),
+               &keylistSize,
+               &keylist));
+
+      ptr = keylist;
+      ptr = unpack_UINT16(ptr, &size);
+
+      //Flush each handle
+      if(size) {
+         vtpmloginfo(VTPM_LOG_VTPM, "Flushing %u handle(s) of type %lu\n", size, (unsigned long) reslist[i]);
+         for(int j = 0; j < size; ++j) {
+            TPM_HANDLE h;
+            ptr = unpack_TPM_HANDLE(ptr, &h);
+            TPMTRYRETURN(TPM_FlushSpecific(h, reslist[i]));
+         }
+      }
+
+      free(keylist);
+      keylist = NULL;
+   }
+
+   goto egress;
+abort_egress:
+   free(keylist);
+egress:
+   return status;
+}
+
+
+static TPM_RESULT try_take_ownership(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_PUBKEY pubEK = TPM_PUBKEY_INIT;
+
+   // If we can read PubEK then there is no owner and we should take it.
+   status = TPM_ReadPubek(&pubEK);
+
+   switch(status) {
+      case TPM_DISABLED_CMD:
+         //Cannot read ek? TPM has owner
+         vtpmloginfo(VTPM_LOG_VTPM, "Failed to readEK meaning TPM has an owner. Creating Keys off existing SRK.\n");
+         status = TPM_SUCCESS;
+         break;
+      case TPM_NO_ENDORSEMENT:
+         {
+            //If theres no ek, we have to create one
+            TPM_KEY_PARMS keyInfo = {
+               .algorithmID = TPM_ALG_RSA,
+               .encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1,
+               .sigScheme = TPM_SS_NONE,
+               .parmSize = 12,
+               .parms.rsa = {
+                  .keyLength = RSA_KEY_SIZE,
+                  .numPrimes = 2,
+                  .exponentSize = 0,
+                  .exponent = NULL,
+               },
+            };
+            TPMTRYRETURN(TPM_CreateEndorsementKeyPair(&keyInfo, &pubEK));
+         }
+         //fall through to take ownership
+      case TPM_SUCCESS:
+         {
+            //Construct the Srk
+            TPM_KEY srk = {
+               .ver = TPM_STRUCT_VER_1_1,
+               .keyUsage = TPM_KEY_STORAGE,
+               .keyFlags = 0x00,
+               .authDataUsage = TPM_AUTH_ALWAYS,
+               .algorithmParms = {
+                  .algorithmID = TPM_ALG_RSA,
+                  .encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1,
+                  .sigScheme =  TPM_SS_NONE,
+                  .parmSize = 12,
+                  .parms.rsa = {
+                     .keyLength = RSA_KEY_SIZE,
+                     .numPrimes = 2,
+                     .exponentSize = 0,
+                     .exponent = NULL,
+                  },
+               },
+               .PCRInfoSize = 0,
+               .pubKey = {
+                  .keyLength = 0,
+                  .key = NULL,
+               },
+               .encDataSize = 0,
+            };
+
+            TPMTRYRETURN(TPM_TakeOwnership(
+                     &pubEK,
+                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
+                     (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+                     &srk,
+                     NULL,
+                     &vtpm_globals.oiap));
+
+            TPMTRYRETURN(TPM_DisablePubekRead(
+                     (const TPM_AUTHDATA*)&vtpm_globals.owner_auth,
+                     &vtpm_globals.oiap));
+         }
+         break;
+      default:
+         break;
+   }
+abort_egress:
+   free_TPM_PUBKEY(&pubEK);
+   return status;
+}
+
+static void init_storage_key(TPM_KEY* key) {
+   key->ver.major = 1;
+   key->ver.minor = 1;
+   key->ver.revMajor = 0;
+   key->ver.revMinor = 0;
+
+   key->keyUsage = TPM_KEY_BIND;
+   key->keyFlags = 0;
+   key->authDataUsage = TPM_AUTH_ALWAYS;
+
+   TPM_KEY_PARMS* p = &key->algorithmParms;
+   p->algorithmID = TPM_ALG_RSA;
+   p->encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1;
+   p->sigScheme = TPM_SS_NONE;
+   p->parmSize = 12;
+
+   TPM_RSA_KEY_PARMS* r = &p->parms.rsa;
+   r->keyLength = RSA_KEY_SIZE;
+   r->numPrimes = 2;
+   r->exponentSize = 0;
+   r->exponent = NULL;
+
+   key->PCRInfoSize = 0;
+   key->encDataSize = 0;
+   key->encData = NULL;
+}
+
+static int parse_auth_string(char* authstr, BYTE* target, const TPM_AUTHDATA wellknown, int allowrandom) {
+   int rc;
+   /* well known owner auth */
+   if(!strcmp(authstr, "well-known")) {
+      memcpy(target, wellknown, sizeof(TPM_AUTHDATA));
+   }
+   /* Create a randomly generated owner auth */
+   else if(allowrandom && !strcmp(authstr, "random")) {
+      return 1;
+   }
+   /* owner auth is a raw hash */
+   else if(!strncmp(authstr, "hash:", 5)) {
+      authstr += 5;
+      if((rc = strlen(authstr)) != 40) {
+         vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth hex string `%s' must be exactly 40 characters (20 bytes) long, length=%d\n", authstr, rc);
+         return -1;
+      }
+      for(int j = 0; j < 20; ++j) {
+         if(sscanf(authstr, "%hhX", target + j) != 1) {
+            vtpmlogerror(VTPM_LOG_VTPM, "Supplied owner auth string `%s' is not a valid hex string\n", authstr);
+            return -1;
+         }
+         authstr += 2;
+      }
+   }
+   /* owner auth is a string that will be hashed */
+   else if(!strncmp(authstr, "text:", 5)) {
+      authstr += 5;
+      sha1((const unsigned char*)authstr, strlen(authstr), target);
+   }
+   else {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid auth string %s\n", authstr);
+      return -1;
+   }
+
+   return 0;
+}
+
+int parse_cmdline_opts(int argc, char** argv, struct Opts* opts)
+{
+   int rc;
+   int i;
+
+   //Set defaults
+   memcpy(vtpm_globals.owner_auth, WELLKNOWN_OWNER_AUTH, sizeof(TPM_AUTHDATA));
+   memcpy(vtpm_globals.srk_auth, WELLKNOWN_SRK_AUTH, sizeof(TPM_AUTHDATA));
+
+   for(i = 1; i < argc; ++i) {
+      if(!strncmp(argv[i], "owner_auth:", 10)) {
+         if((rc = parse_auth_string(argv[i] + 10, vtpm_globals.owner_auth, WELLKNOWN_OWNER_AUTH, 1)) < 0) {
+            goto err_invalid;
+         }
+         if(rc == 1) {
+            opts->gen_owner_auth = 1;
+         }
+      }
+      else if(!strncmp(argv[i], "srk_auth:", 8)) {
+         if((rc = parse_auth_string(argv[i] + 8, vtpm_globals.srk_auth, WELLKNOWN_SRK_AUTH, 0)) != 0) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmdriver=", 10)) {
+         if(!strcmp(argv[i] + 10, "tpm_tis")) {
+            opts->tpmdriver = TPMDRV_TPM_TIS;
+         } else if(!strcmp(argv[i] + 10, "tpmfront")) {
+            opts->tpmdriver = TPMDRV_TPMFRONT;
+         } else {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmiomem=",9)) {
+         if(sscanf(argv[i] + 9, "0x%lX", &opts->tpmiomem) != 1) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmirq=",7)) {
+         if(!strcmp(argv[i] + 7, "probe")) {
+            opts->tpmirq = TPM_PROBE_IRQ;
+         } else if( sscanf(argv[i] + 7, "%u", &opts->tpmirq) != 1) {
+            goto err_invalid;
+         }
+      }
+      else if(!strncmp(argv[i], "tpmlocality=",12)) {
+         if(sscanf(argv[i] + 12, "%u", &opts->tpmlocality) != 1 || opts->tpmlocality > 4) {
+            goto err_invalid;
+         }
+      }
+   }
+
+   switch(opts->tpmdriver) {
+      case TPMDRV_TPM_TIS:
+         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpm_tis driver\n");
+         break;
+      case TPMDRV_TPMFRONT:
+         vtpmloginfo(VTPM_LOG_VTPM, "Option: Using tpmfront driver\n");
+         break;
+   }
+
+   return 0;
+err_invalid:
+   vtpmlogerror(VTPM_LOG_VTPM, "Invalid Option %s\n", argv[i]);
+   return -1;
+}
+
+
+
+static TPM_RESULT vtpmmgr_create(void) {
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_AUTH_SESSION osap = TPM_AUTH_SESSION_INIT;
+   TPM_AUTHDATA sharedsecret;
+
+   // Take ownership if TPM is unowned
+   TPMTRYRETURN(try_take_ownership());
+
+   // Generate storage key's auth
+   memset(&vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA));
+
+   TPMTRYRETURN( TPM_OSAP(
+            TPM_ET_KEYHANDLE,
+            TPM_SRK_KEYHANDLE,
+            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+            &sharedsecret,
+            &osap) );
+
+   init_storage_key(&vtpm_globals.storage_key);
+
+   //initialize the storage key
+   TPMTRYRETURN( TPM_CreateWrapKey(
+            TPM_SRK_KEYHANDLE,
+            (const TPM_AUTHDATA*)&sharedsecret,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.storage_key,
+            &osap) );
+
+   //Load Storage Key
+   TPMTRYRETURN( TPM_LoadKey(
+            TPM_SRK_KEYHANDLE,
+            &vtpm_globals.storage_key,
+            &vtpm_globals.storage_key_handle,
+            (const TPM_AUTHDATA*) &vtpm_globals.srk_auth,
+            &vtpm_globals.oiap));
+
+   //Make sure TPM has commited changes
+   TPMTRYRETURN( TPM_SaveState() );
+
+   //Create new disk image
+   TPMTRYRETURN(vtpm_storage_new_header());
+
+   goto egress;
+abort_egress:
+egress:
+   vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager\n");
+
+   //End the OSAP session
+   if(osap.AuthHandle) {
+      TPM_TerminateHandle(osap.AuthHandle);
+   }
+
+   return status;
+}
+
+TPM_RESULT vtpmmgr_init(int argc, char** argv) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   /* Default commandline options */
+   struct Opts opts = {
+      .tpmdriver = TPMDRV_TPM_TIS,
+      .tpmiomem = TPM_BASEADDR,
+      .tpmirq = 0,
+      .tpmlocality = 0,
+      .gen_owner_auth = 0,
+   };
+
+   if(parse_cmdline_opts(argc, argv, &opts) != 0) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Command line parsing failed! exiting..\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   //Setup storage system
+   if(vtpm_storage_init() != 0) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize storage subsystem!\n");
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   //Setup tpmback device
+   init_tpmback();
+
+   //Setup tpm access
+   switch(opts.tpmdriver) {
+      case TPMDRV_TPM_TIS:
+         {
+            struct tpm_chip* tpm;
+            if((tpm = init_tpm_tis(opts.tpmiomem, TPM_TIS_LOCL_INT_TO_FLAG(opts.tpmlocality), opts.tpmirq)) == NULL) {
+               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+               status = TPM_IOERROR;
+               goto abort_egress;
+            }
+            vtpm_globals.tpm_fd = tpm_tis_open(tpm);
+            tpm_tis_request_locality(tpm, opts.tpmlocality);
+         }
+         break;
+      case TPMDRV_TPMFRONT:
+         {
+            struct tpmfront_dev* tpmfront_dev;
+            if((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
+               vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+               status = TPM_IOERROR;
+               goto abort_egress;
+            }
+            vtpm_globals.tpm_fd = tpmfront_open(tpmfront_dev);
+         }
+         break;
+   }
+
+   //Get the version of the tpm
+   TPMTRYRETURN(check_tpm_version());
+
+   // Blow away all stale handles left in the tpm
+   if(flush_tpm() != TPM_SUCCESS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_FlushResources failed, continuing anyway..\n");
+   }
+
+   /* Initialize the rng */
+   entropy_init(&vtpm_globals.entropy);
+   entropy_add_source(&vtpm_globals.entropy, tpm_entropy_source, NULL, 0);
+   entropy_gather(&vtpm_globals.entropy);
+   ctr_drbg_init(&vtpm_globals.ctr_drbg, entropy_func, &vtpm_globals.entropy, NULL, 0);
+   ctr_drbg_set_prediction_resistance( &vtpm_globals.ctr_drbg, CTR_DRBG_PR_OFF );
+
+   // Generate Auth for Owner
+   if(opts.gen_owner_auth) {
+      vtpmmgr_rand(vtpm_globals.owner_auth, sizeof(TPM_AUTHDATA));
+   }
+
+   // Create OIAP session for service's authorized commands
+   TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
+
+   /* Load the Manager data, if it fails create a new manager */
+   if (vtpm_storage_load_header() != TPM_SUCCESS) {
+      /* If the OIAP session was closed by an error, create a new one */
+      if(vtpm_globals.oiap.AuthHandle == 0) {
+         TPMTRYRETURN( TPM_OIAP(&vtpm_globals.oiap) );
+      }
+      vtpmloginfo(VTPM_LOG_VTPM, "Failed to read manager file. Assuming first time initialization.\n");
+      TPMTRYRETURN( vtpmmgr_create() );
+   }
+
+   goto egress;
+abort_egress:
+   vtpmmgr_shutdown();
+egress:
+   return status;
+}
+
+void vtpmmgr_shutdown(void)
+{
+   /* Cleanup resources */
+   free_TPM_KEY(&vtpm_globals.storage_key);
+
+   /* Cleanup TPM resources */
+   TPM_EvictKey(vtpm_globals.storage_key_handle);
+   TPM_TerminateHandle(vtpm_globals.oiap.AuthHandle);
+
+   /* Close tpmback */
+   shutdown_tpmback();
+
+   /* Close the storage system and blkfront */
+   vtpm_storage_shutdown();
+
+   /* Close tpmfront/tpm_tis */
+   close(vtpm_globals.tpm_fd);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
+}
diff --git a/stubdom/vtpmmgr/log.c b/stubdom/vtpmmgr/log.c
new file mode 100644
index 0000000..a82c913
--- /dev/null
+++ b/stubdom/vtpmmgr/log.c
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "tcg.h"
+
+char *module_names[] = { "",
+                                "TPM",
+                                "TPM",
+                                "VTPM",
+                                "VTPM",
+                                "TXDATA",
+                              };
+// Helper code for the consts, eg. to produce messages for error codes.
+
+typedef struct error_code_entry_t {
+  TPM_RESULT code;
+  char * code_name;
+  char * msg;
+} error_code_entry_t;
+
+static const error_code_entry_t error_msgs [] = {
+  { TPM_SUCCESS, "TPM_SUCCESS", "Successful completion of the operation" },
+  { TPM_AUTHFAIL, "TPM_AUTHFAIL", "Authentication failed" },
+  { TPM_BADINDEX, "TPM_BADINDEX", "The index to a PCR, DIR or other register is incorrect" },
+  { TPM_BAD_PARAMETER, "TPM_BAD_PARAMETER", "One or more parameter is bad" },
+  { TPM_AUDITFAILURE, "TPM_AUDITFAILURE", "An operation completed successfully but the auditing of that operation failed." },
+  { TPM_CLEAR_DISABLED, "TPM_CLEAR_DISABLED", "The clear disable flag is set and all clear operations now require physical access" },
+  { TPM_DEACTIVATED, "TPM_DEACTIVATED", "The TPM is deactivated" },
+  { TPM_DISABLED, "TPM_DISABLED", "The TPM is disabled" },
+  { TPM_DISABLED_CMD, "TPM_DISABLED_CMD", "The target command has been disabled" },
+  { TPM_FAIL, "TPM_FAIL", "The operation failed" },
+  { TPM_BAD_ORDINAL, "TPM_BAD_ORDINAL", "The ordinal was unknown or inconsistent" },
+  { TPM_INSTALL_DISABLED, "TPM_INSTALL_DISABLED", "The ability to install an owner is disabled" },
+  { TPM_INVALID_KEYHANDLE, "TPM_INVALID_KEYHANDLE", "The key handle presented was invalid" },
+  { TPM_KEYNOTFOUND, "TPM_KEYNOTFOUND", "The target key was not found" },
+  { TPM_INAPPROPRIATE_ENC, "TPM_INAPPROPRIATE_ENC", "Unacceptable encryption scheme" },
+  { TPM_MIGRATEFAIL, "TPM_MIGRATEFAIL", "Migration authorization failed" },
+  { TPM_INVALID_PCR_INFO, "TPM_INVALID_PCR_INFO", "PCR information could not be interpreted" },
+  { TPM_NOSPACE, "TPM_NOSPACE", "No room to load key." },
+  { TPM_NOSRK, "TPM_NOSRK", "There is no SRK set" },
+  { TPM_NOTSEALED_BLOB, "TPM_NOTSEALED_BLOB", "An encrypted blob is invalid or was not created by this TPM" },
+  { TPM_OWNER_SET, "TPM_OWNER_SET", "There is already an Owner" },
+  { TPM_RESOURCES, "TPM_RESOURCES", "The TPM has insufficient internal resources to perform the requested action." },
+  { TPM_SHORTRANDOM, "TPM_SHORTRANDOM", "A random string was too short" },
+  { TPM_SIZE, "TPM_SIZE", "The TPM does not have the space to perform the operation." },
+  { TPM_WRONGPCRVAL, "TPM_WRONGPCRVAL", "The named PCR value does not match the current PCR value." },
+  { TPM_BAD_PARAM_SIZE, "TPM_BAD_PARAM_SIZE", "The paramSize argument to the command has the incorrect value" },
+  { TPM_SHA_THREAD, "TPM_SHA_THREAD", "There is no existing SHA-1 thread." },
+  { TPM_SHA_ERROR, "TPM_SHA_ERROR", "The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error." },
+  { TPM_FAILEDSELFTEST, "TPM_FAILEDSELFTEST", "Self-test has failed and the TPM has shutdown." },
+  { TPM_AUTH2FAIL, "TPM_AUTH2FAIL", "The authorization for the second key in a 2 key function failed authorization" },
+  { TPM_BADTAG, "TPM_BADTAG", "The tag value sent to for a command is invalid" },
+  { TPM_IOERROR, "TPM_IOERROR", "An IO error occurred transmitting information to the TPM" },
+  { TPM_ENCRYPT_ERROR, "TPM_ENCRYPT_ERROR", "The encryption process had a problem." },
+  { TPM_DECRYPT_ERROR, "TPM_DECRYPT_ERROR", "The decryption process did not complete." },
+  { TPM_INVALID_AUTHHANDLE, "TPM_INVALID_AUTHHANDLE", "An invalid handle was used." },
+  { TPM_NO_ENDORSEMENT, "TPM_NO_ENDORSEMENT", "The TPM does not a EK installed" },
+  { TPM_INVALID_KEYUSAGE, "TPM_INVALID_KEYUSAGE", "The usage of a key is not allowed" },
+  { TPM_WRONG_ENTITYTYPE, "TPM_WRONG_ENTITYTYPE", "The submitted entity type is not allowed" },
+  { TPM_INVALID_POSTINIT, "TPM_INVALID_POSTINIT", "The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup" },
+  { TPM_INAPPROPRIATE_SIG, "TPM_INAPPROPRIATE_SIG", "Signed data cannot include additional DER information" },
+  { TPM_BAD_KEY_PROPERTY, "TPM_BAD_KEY_PROPERTY", "The key properties in TPM_KEY_PARMs are not supported by this TPM" },
+
+  { TPM_BAD_MIGRATION, "TPM_BAD_MIGRATION", "The migration properties of this key are incorrect." },
+  { TPM_BAD_SCHEME, "TPM_BAD_SCHEME", "The signature or encryption scheme for this key is incorrect or not permitted in this situation." },
+  { TPM_BAD_DATASIZE, "TPM_BAD_DATASIZE", "The size of the data (or blob) parameter is bad or inconsistent with the referenced key" },
+  { TPM_BAD_MODE, "TPM_BAD_MODE", "A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob." },
+  { TPM_BAD_PRESENCE, "TPM_BAD_PRESENCE", "Either the physicalPresence or physicalPresenceLock bits have the wrong value" },
+  { TPM_BAD_VERSION, "TPM_BAD_VERSION", "The TPM cannot perform this version of the capability" },
+  { TPM_NO_WRAP_TRANSPORT, "TPM_NO_WRAP_TRANSPORT", "The TPM does not allow for wrapped transport sessions" },
+  { TPM_AUDITFAIL_UNSUCCESSFUL, "TPM_AUDITFAIL_UNSUCCESSFUL", "TPM audit construction failed and the underlying command was returning a failure code also" },
+  { TPM_AUDITFAIL_SUCCESSFUL, "TPM_AUDITFAIL_SUCCESSFUL", "TPM audit construction failed and the underlying command was returning success" },
+  { TPM_NOTRESETABLE, "TPM_NOTRESETABLE", "Attempt to reset a PCR register that does not have the resettable attribute" },
+  { TPM_NOTLOCAL, "TPM_NOTLOCAL", "Attempt to reset a PCR register that requires locality and locality modifier not part of command transport" },
+  { TPM_BAD_TYPE, "TPM_BAD_TYPE", "Make identity blob not properly typed" },
+  { TPM_INVALID_RESOURCE, "TPM_INVALID_RESOURCE", "When saving context identified resource type does not match actual resource" },
+  { TPM_NOTFIPS, "TPM_NOTFIPS", "The TPM is attempting to execute a command only available when in FIPS mode" },
+  { TPM_INVALID_FAMILY, "TPM_INVALID_FAMILY", "The command is attempting to use an invalid family ID" },
+  { TPM_NO_NV_PERMISSION, "TPM_NO_NV_PERMISSION", "The permission to manipulate the NV storage is not available" },
+  { TPM_REQUIRES_SIGN, "TPM_REQUIRES_SIGN", "The operation requires a signed command" },
+  { TPM_KEY_NOTSUPPORTED, "TPM_KEY_NOTSUPPORTED", "Wrong operation to load an NV key" },
+  { TPM_AUTH_CONFLICT, "TPM_AUTH_CONFLICT", "NV_LoadKey blob requires both owner and blob authorization" },
+  { TPM_AREA_LOCKED, "TPM_AREA_LOCKED", "The NV area is locked and not writtable" },
+  { TPM_BAD_LOCALITY, "TPM_BAD_LOCALITY", "The locality is incorrect for the attempted operation" },
+  { TPM_READ_ONLY, "TPM_READ_ONLY", "The NV area is read only and can't be written to" },
+  { TPM_PER_NOWRITE, "TPM_PER_NOWRITE", "There is no protection on the write to the NV area" },
+  { TPM_FAMILYCOUNT, "TPM_FAMILYCOUNT", "The family count value does not match" },
+  { TPM_WRITE_LOCKED, "TPM_WRITE_LOCKED", "The NV area has already been written to" },
+  { TPM_BAD_ATTRIBUTES, "TPM_BAD_ATTRIBUTES", "The NV area attributes conflict" },
+  { TPM_INVALID_STRUCTURE, "TPM_INVALID_STRUCTURE", "The structure tag and version are invalid or inconsistent" },
+  { TPM_KEY_OWNER_CONTROL, "TPM_KEY_OWNER_CONTROL", "The key is under control of the TPM Owner and can only be evicted by the TPM Owner." },
+  { TPM_BAD_COUNTER, "TPM_BAD_COUNTER", "The counter handle is incorrect" },
+  { TPM_NOT_FULLWRITE, "TPM_NOT_FULLWRITE", "The write is not a complete write of the area" },
+  { TPM_CONTEXT_GAP, "TPM_CONTEXT_GAP", "The gap between saved context counts is too large" },
+  { TPM_MAXNVWRITES, "TPM_MAXNVWRITES", "The maximum number of NV writes without an owner has been exceeded" },
+  { TPM_NOOPERATOR, "TPM_NOOPERATOR", "No operator authorization value is set" },
+  { TPM_RESOURCEMISSING, "TPM_RESOURCEMISSING", "The resource pointed to by context is not loaded" },
+  { TPM_DELEGATE_LOCK, "TPM_DELEGATE_LOCK", "The delegate administration is locked" },
+  { TPM_DELEGATE_FAMILY, "TPM_DELEGATE_FAMILY", "Attempt to manage a family other then the delegated family" },
+  { TPM_DELEGATE_ADMIN, "TPM_DELEGATE_ADMIN", "Delegation table management not enabled" },
+  { TPM_TRANSPORT_EXCLUSIVE, "TPM_TRANSPORT_EXCLUSIVE", "There was a command executed outside of an exclusive transport session" },
+};
+
+
+// helper function for the error codes:
+const char* tpm_get_error_name (TPM_RESULT code) {
+  // just do a linear scan for now
+  unsigned i;
+  for (i = 0; i < sizeof(error_msgs)/sizeof(error_msgs[0]); i++)
+    if (code == error_msgs[i].code)
+      return error_msgs[i].code_name;
+
+    return("Unknown Error Code");
+}
diff --git a/stubdom/vtpmmgr/log.h b/stubdom/vtpmmgr/log.h
new file mode 100644
index 0000000..5c7abf5
--- /dev/null
+++ b/stubdom/vtpmmgr/log.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __VTPM_LOG_H__
+#define __VTPM_LOG_H__
+
+#include <stdint.h>             // for uint32_t
+#include <stddef.h>             // for pointer NULL
+#include <stdio.h>
+#include "tcg.h"
+
+// =========================== LOGGING ==============================
+
+// the logging module numbers
+#define VTPM_LOG_TPM         1
+#define VTPM_LOG_TPM_DEEP    2
+#define VTPM_LOG_VTPM        3
+#define VTPM_LOG_VTPM_DEEP   4
+#define VTPM_LOG_TXDATA      5
+
+extern char *module_names[];
+
+// Default to standard logging
+#ifndef LOGGING_MODULES
+#define LOGGING_MODULES (BITMASK(VTPM_LOG_VTPM)|BITMASK(VTPM_LOG_TPM))
+#endif
+
+// bit-access macros
+#define BITMASK(idx)      ( 1U << (idx) )
+#define GETBIT(num,idx)   ( ((num) & BITMASK(idx)) >> idx )
+#define SETBIT(num,idx)   (num) |= BITMASK(idx)
+#define CLEARBIT(num,idx) (num) &= ( ~ BITMASK(idx) )
+
+#define vtpmloginfo(module, fmt, args...) \
+  if (GETBIT (LOGGING_MODULES, module) == 1) {				\
+    fprintf (stdout, "INFO[%s]: " fmt, module_names[module], ##args); \
+  }
+
+#define vtpmloginfomore(module, fmt, args...) \
+  if (GETBIT (LOGGING_MODULES, module) == 1) {			      \
+    fprintf (stdout, fmt,##args);				      \
+  }
+
+#define vtpmlogerror(module, fmt, args...) \
+  fprintf (stderr, "ERROR[%s]: " fmt, module_names[module], ##args);
+
+//typedef UINT32 tpm_size_t;
+
+// helper function for the error codes:
+const char* tpm_get_error_name (TPM_RESULT code);
+
+#endif // _VTPM_LOG_H_
diff --git a/stubdom/vtpmmgr/marshal.h b/stubdom/vtpmmgr/marshal.h
new file mode 100644
index 0000000..77d32f0
--- /dev/null
+++ b/stubdom/vtpmmgr/marshal.h
@@ -0,0 +1,528 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef MARSHAL_H
+#define MARSHAL_H
+
+#include <stdlib.h>
+#include <mini-os/byteorder.h>
+#include <mini-os/endian.h>
+#include "tcg.h"
+
+typedef enum UnpackPtr {
+   UNPACK_ALIAS,
+   UNPACK_ALLOC
+} UnpackPtr;
+
+inline BYTE* pack_BYTE(BYTE* ptr, BYTE t) {
+   ptr[0] = t;
+   return ++ptr;
+}
+
+inline BYTE* unpack_BYTE(BYTE* ptr, BYTE* t) {
+   t[0] = ptr[0];
+   return ++ptr;
+}
+
+#define pack_BOOL(p, t) pack_BYTE(p, t)
+#define unpack_BOOL(p, t) unpack_BYTE(p, t)
+
+inline BYTE* pack_UINT16(BYTE* ptr, UINT16 t) {
+   BYTE* b = (BYTE*)&t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   ptr[0] = b[1];
+   ptr[1] = b[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   ptr[0] = b[0];
+   ptr[1] = b[1];
+#endif
+   return ptr + sizeof(UINT16);
+}
+
+inline BYTE* unpack_UINT16(BYTE* ptr, UINT16* t) {
+   BYTE* b = (BYTE*)t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   b[0] = ptr[1];
+   b[1] = ptr[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   b[0] = ptr[0];
+   b[1] = ptr[1];
+#endif
+   return ptr + sizeof(UINT16);
+}
+
+inline BYTE* pack_UINT32(BYTE* ptr, UINT32 t) {
+   BYTE* b = (BYTE*)&t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   ptr[3] = b[0];
+   ptr[2] = b[1];
+   ptr[1] = b[2];
+   ptr[0] = b[3];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   ptr[0] = b[0];
+   ptr[1] = b[1];
+   ptr[2] = b[2];
+   ptr[3] = b[3];
+#endif
+   return ptr + sizeof(UINT32);
+}
+
+inline BYTE* unpack_UINT32(BYTE* ptr, UINT32* t) {
+   BYTE* b = (BYTE*)t;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   b[0] = ptr[3];
+   b[1] = ptr[2];
+   b[2] = ptr[1];
+   b[3] = ptr[0];
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   b[0] = ptr[0];
+   b[1] = ptr[1];
+   b[2] = ptr[2];
+   b[3] = ptr[3];
+#endif
+   return ptr + sizeof(UINT32);
+}
+
+#define pack_TPM_RESULT(p, t) pack_UINT32(p, t)
+#define pack_TPM_PCRINDEX(p, t) pack_UINT32(p, t)
+#define pack_TPM_DIRINDEX(p, t) pack_UINT32(p, t)
+#define pack_TPM_HANDLE(p, t) pack_UINT32(p, t)
+#define pack_TPM_AUTHHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_HASHHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_HMACHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_ENCHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TPM_KEY_HANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TCPA_ENTITYHANDLE(p, t) pack_TPM_HANDLE(p, t)
+#define pack_TPM_RESOURCE_TYPE(p, t) pack_UINT32(p, t)
+#define pack_TPM_COMMAND_CODE(p, t) pack_UINT32(p, t)
+#define pack_TPM_PROTOCOL_ID(p, t) pack_UINT16(p, t)
+#define pack_TPM_AUTH_DATA_USAGE(p, t) pack_BYTE(p, t)
+#define pack_TPM_ENTITY_TYPE(p, t) pack_UINT16(p, t)
+#define pack_TPM_ALGORITHM_ID(p, t) pack_UINT32(p, t)
+#define pack_TPM_KEY_USAGE(p, t) pack_UINT16(p, t)
+#define pack_TPM_STARTUP_TYPE(p, t) pack_UINT16(p, t)
+#define pack_TPM_CAPABILITY_AREA(p, t) pack_UINT32(p, t)
+#define pack_TPM_ENC_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_SIG_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_MIGRATE_SCHEME(p, t) pack_UINT16(p, t)
+#define pack_TPM_PHYSICAL_PRESENCE(p, t) pack_UINT16(p, t)
+#define pack_TPM_KEY_FLAGS(p, t) pack_UINT32(p, t)
+
+#define unpack_TPM_RESULT(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_PCRINDEX(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_DIRINDEX(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_HANDLE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_AUTHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_HASHHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_HMACHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_ENCHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TPM_KEY_HANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TCPA_ENTITYHANDLE(p, t) unpack_TPM_HANDLE(p, t)
+#define unpack_TPM_RESOURCE_TYPE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_COMMAND_CODE(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_PROTOCOL_ID(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_AUTH_DATA_USAGE(p, t) unpack_BYTE(p, t)
+#define unpack_TPM_ENTITY_TYPE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_ALGORITHM_ID(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_KEY_USAGE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_STARTUP_TYPE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_CAPABILITY_AREA(p, t) unpack_UINT32(p, t)
+#define unpack_TPM_ENC_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_SIG_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_MIGRATE_SCHEME(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_PHYSICAL_PRESENCE(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_KEY_FLAGS(p, t) unpack_UINT32(p, t)
+
+#define pack_TPM_AUTH_HANDLE(p, t) pack_UINT32(p, t);
+#define pack_TCS_CONTEXT_HANDLE(p, t) pack_UINT32(p, t);
+#define pack_TCS_KEY_HANDLE(p, t) pack_UINT32(p, t);
+
+#define unpack_TPM_AUTH_HANDLE(p, t) unpack_UINT32(p, t);
+#define unpack_TCS_CONTEXT_HANDLE(p, t) unpack_UINT32(p, t);
+#define unpack_TCS_KEY_HANDLE(p, t) unpack_UINT32(p, t);
+
+inline BYTE* pack_BUFFER(BYTE* ptr, const BYTE* buf, UINT32 size) {
+   memcpy(ptr, buf, size);
+   return ptr + size;
+}
+
+inline BYTE* unpack_BUFFER(BYTE* ptr, BYTE* buf, UINT32 size) {
+   memcpy(buf, ptr, size);
+   return ptr + size;
+}
+
+inline BYTE* unpack_ALIAS(BYTE* ptr, BYTE** buf, UINT32 size) {
+   *buf = ptr;
+   return ptr + size;
+}
+
+inline BYTE* unpack_ALLOC(BYTE* ptr, BYTE** buf, UINT32 size) {
+   if(size) {
+      *buf = malloc(size);
+      memcpy(*buf, ptr, size);
+   } else {
+      *buf = NULL;
+   }
+   return ptr + size;
+}
+
+inline BYTE* unpack_PTR(BYTE* ptr, BYTE** buf, UINT32 size, UnpackPtr alloc) {
+   if(alloc == UNPACK_ALLOC) {
+      return unpack_ALLOC(ptr, buf, size);
+   } else {
+      return unpack_ALIAS(ptr, buf, size);
+   }
+}
+
+inline BYTE* pack_TPM_AUTHDATA(BYTE* ptr, const TPM_AUTHDATA* d) {
+   return pack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_AUTHDATA(BYTE* ptr, TPM_AUTHDATA* d) {
+   return unpack_BUFFER(ptr, *d, TPM_DIGEST_SIZE);
+}
+
+#define pack_TPM_SECRET(p, t) pack_TPM_AUTHDATA(p, t)
+#define pack_TPM_ENCAUTH(p, t) pack_TPM_AUTHDATA(p, t)
+#define pack_TPM_PAYLOAD_TYPE(p, t) pack_BYTE(p, t)
+#define pack_TPM_TAG(p, t) pack_UINT16(p, t)
+#define pack_TPM_STRUCTURE_TAG(p, t) pack_UINT16(p, t)
+
+#define unpack_TPM_SECRET(p, t) unpack_TPM_AUTHDATA(p, t)
+#define unpack_TPM_ENCAUTH(p, t) unpack_TPM_AUTHDATA(p, t)
+#define unpack_TPM_PAYLOAD_TYPE(p, t) unpack_BYTE(p, t)
+#define unpack_TPM_TAG(p, t) unpack_UINT16(p, t)
+#define unpack_TPM_STRUCTURE_TAG(p, t) unpack_UINT16(p, t)
+
+inline BYTE* pack_TPM_VERSION(BYTE* ptr, const TPM_VERSION* t) {
+   ptr[0] = t->major;
+   ptr[1] = t->minor;
+   ptr[2] = t->revMajor;
+   ptr[3] = t->revMinor;
+   return ptr + 4;
+}
+
+inline BYTE* unpack_TPM_VERSION(BYTE* ptr, TPM_VERSION* t) {
+   t->major = ptr[0];
+   t->minor = ptr[1];
+   t->revMajor = ptr[2];
+   t->revMinor = ptr[3];
+   return ptr + 4;
+}
+
+inline BYTE* pack_TPM_CAP_VERSION_INFO(BYTE* ptr, const TPM_CAP_VERSION_INFO* v) {
+   ptr = pack_TPM_STRUCTURE_TAG(ptr, v->tag);
+   ptr = pack_TPM_VERSION(ptr, &v->version);
+   ptr = pack_UINT16(ptr, v->specLevel);
+   ptr = pack_BYTE(ptr, v->errataRev);
+   ptr = pack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));
+   ptr = pack_UINT16(ptr, v->vendorSpecificSize);
+   ptr = pack_BUFFER(ptr, v->vendorSpecific, v->vendorSpecificSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_CAP_VERSION_INFO(BYTE* ptr, TPM_CAP_VERSION_INFO* v, UnpackPtr alloc) {
+   ptr = unpack_TPM_STRUCTURE_TAG(ptr, &v->tag);
+   ptr = unpack_TPM_VERSION(ptr, &v->version);
+   ptr = unpack_UINT16(ptr, &v->specLevel);
+   ptr = unpack_BYTE(ptr, &v->errataRev);
+   ptr = unpack_BUFFER(ptr, v->tpmVendorID, sizeof(v->tpmVendorID));
+   ptr = unpack_UINT16(ptr, &v->vendorSpecificSize);
+   ptr = unpack_PTR(ptr, &v->vendorSpecific, v->vendorSpecificSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_DIGEST(BYTE* ptr, const TPM_DIGEST* d) {
+   return pack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_DIGEST(BYTE* ptr, TPM_DIGEST* d) {
+   return unpack_BUFFER(ptr, d->digest, TPM_DIGEST_SIZE);
+}
+
+#define pack_TPM_PCRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_PCRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_COMPOSITE_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_COMPOSITE_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_DIRVALUE(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_DIRVALUE(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_HMAC(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_HMAC(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+#define pack_TPM_CHOSENID_HASH(ptr, d) pack_TPM_DIGEST(ptr, d);
+#define unpack_TPM_CHOSENID_HASH(ptr, d) unpack_TPM_DIGEST(ptr, d);
+
+inline BYTE* pack_TPM_NONCE(BYTE* ptr, const TPM_NONCE* n) {
+   return pack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* unpack_TPM_NONCE(BYTE* ptr, TPM_NONCE* n) {
+   return unpack_BUFFER(ptr, n->nonce, TPM_DIGEST_SIZE);
+}
+
+inline BYTE* pack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, const TPM_SYMMETRIC_KEY_PARMS* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_UINT32(ptr, k->blockSize);
+   ptr = pack_UINT32(ptr, k->ivSize);
+   return pack_BUFFER(ptr, k->IV, k->ivSize);
+}
+
+inline BYTE* unpack_TPM_SYMMETRIC_KEY_PARMS(BYTE* ptr, TPM_SYMMETRIC_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_UINT32(ptr, &k->blockSize);
+   ptr = unpack_UINT32(ptr, &k->ivSize);
+   return unpack_PTR(ptr, &k->IV, k->ivSize, alloc);
+}
+
+inline BYTE* pack_TPM_RSA_KEY_PARMS(BYTE* ptr, const TPM_RSA_KEY_PARMS* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_UINT32(ptr, k->numPrimes);
+   ptr = pack_UINT32(ptr, k->exponentSize);
+   return pack_BUFFER(ptr, k->exponent, k->exponentSize);
+}
+
+inline BYTE* unpack_TPM_RSA_KEY_PARMS(BYTE* ptr, TPM_RSA_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_UINT32(ptr, &k->numPrimes);
+   ptr = unpack_UINT32(ptr, &k->exponentSize);
+   return unpack_PTR(ptr, &k->exponent, k->exponentSize, alloc);
+}
+
+inline BYTE* pack_TPM_KEY_PARMS(BYTE* ptr, const TPM_KEY_PARMS* k) {
+   ptr = pack_TPM_ALGORITHM_ID(ptr, k->algorithmID);
+   ptr = pack_TPM_ENC_SCHEME(ptr, k->encScheme);
+   ptr = pack_TPM_SIG_SCHEME(ptr, k->sigScheme);
+   ptr = pack_UINT32(ptr, k->parmSize);
+
+   if(k->parmSize) {
+      switch(k->algorithmID) {
+         case TPM_ALG_RSA:
+            return pack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa);
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            return pack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym);
+      }
+   }
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_KEY_PARMS(BYTE* ptr, TPM_KEY_PARMS* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_ALGORITHM_ID(ptr, &k->algorithmID);
+   ptr = unpack_TPM_ENC_SCHEME(ptr, &k->encScheme);
+   ptr = unpack_TPM_SIG_SCHEME(ptr, &k->sigScheme);
+   ptr = unpack_UINT32(ptr, &k->parmSize);
+
+   if(k->parmSize) {
+      switch(k->algorithmID) {
+         case TPM_ALG_RSA:
+            return unpack_TPM_RSA_KEY_PARMS(ptr, &k->parms.rsa, alloc);
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            return unpack_TPM_SYMMETRIC_KEY_PARMS(ptr, &k->parms.sym, alloc);
+      }
+   }
+   return ptr;
+}
+
+inline BYTE* pack_TPM_STORE_PUBKEY(BYTE* ptr, const TPM_STORE_PUBKEY* k) {
+   ptr = pack_UINT32(ptr, k->keyLength);
+   ptr = pack_BUFFER(ptr, k->key, k->keyLength);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_STORE_PUBKEY(BYTE* ptr, TPM_STORE_PUBKEY* k, UnpackPtr alloc) {
+   ptr = unpack_UINT32(ptr, &k->keyLength);
+   ptr = unpack_PTR(ptr, &k->key, k->keyLength, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PUBKEY(BYTE* ptr, const TPM_PUBKEY* k) {
+   ptr = pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
+   return pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
+}
+
+inline BYTE* unpack_TPM_PUBKEY(BYTE* ptr, TPM_PUBKEY* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
+   return unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
+}
+
+inline BYTE* pack_TPM_PCR_SELECTION(BYTE* ptr, const TPM_PCR_SELECTION* p) {
+   ptr = pack_UINT16(ptr, p->sizeOfSelect);
+   ptr = pack_BUFFER(ptr, p->pcrSelect, p->sizeOfSelect);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_SELECTION(BYTE* ptr, TPM_PCR_SELECTION* p, UnpackPtr alloc) {
+   ptr = unpack_UINT16(ptr, &p->sizeOfSelect);
+   ptr = unpack_PTR(ptr, &p->pcrSelect, p->sizeOfSelect, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PCR_INFO(BYTE* ptr, const TPM_PCR_INFO* p) {
+   ptr = pack_TPM_PCR_SELECTION(ptr, &p->pcrSelection);
+   ptr = pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
+   ptr = pack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_INFO(BYTE* ptr, TPM_PCR_INFO* p, UnpackPtr alloc) {
+   ptr = unpack_TPM_PCR_SELECTION(ptr, &p->pcrSelection, alloc);
+   ptr = unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtRelease);
+   ptr = unpack_TPM_COMPOSITE_HASH(ptr, &p->digestAtCreation);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_PCR_COMPOSITE(BYTE* ptr, const TPM_PCR_COMPOSITE* p) {
+   ptr = pack_TPM_PCR_SELECTION(ptr, &p->select);
+   ptr = pack_UINT32(ptr, p->valueSize);
+   ptr = pack_BUFFER(ptr, (const BYTE*)p->pcrValue, p->valueSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_PCR_COMPOSITE(BYTE* ptr, TPM_PCR_COMPOSITE* p, UnpackPtr alloc) {
+   ptr = unpack_TPM_PCR_SELECTION(ptr, &p->select, alloc);
+   ptr = unpack_UINT32(ptr, &p->valueSize);
+   ptr = unpack_PTR(ptr, (BYTE**)&p->pcrValue, p->valueSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_KEY(BYTE* ptr, const TPM_KEY* k) {
+   ptr = pack_TPM_VERSION(ptr, &k->ver);
+   ptr = pack_TPM_KEY_USAGE(ptr, k->keyUsage);
+   ptr = pack_TPM_KEY_FLAGS(ptr, k->keyFlags);
+   ptr = pack_TPM_AUTH_DATA_USAGE(ptr, k->authDataUsage);
+   ptr = pack_TPM_KEY_PARMS(ptr, &k->algorithmParms);
+   ptr = pack_UINT32(ptr, k->PCRInfoSize);
+   if(k->PCRInfoSize) {
+      ptr = pack_TPM_PCR_INFO(ptr, &k->PCRInfo);
+   }
+   ptr = pack_TPM_STORE_PUBKEY(ptr, &k->pubKey);
+   ptr = pack_UINT32(ptr, k->encDataSize);
+   return pack_BUFFER(ptr, k->encData, k->encDataSize);
+}
+
+inline BYTE* unpack_TPM_KEY(BYTE* ptr, TPM_KEY* k, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &k->ver);
+   ptr = unpack_TPM_KEY_USAGE(ptr, &k->keyUsage);
+   ptr = unpack_TPM_KEY_FLAGS(ptr, &k->keyFlags);
+   ptr = unpack_TPM_AUTH_DATA_USAGE(ptr, &k->authDataUsage);
+   ptr = unpack_TPM_KEY_PARMS(ptr, &k->algorithmParms, alloc);
+   ptr = unpack_UINT32(ptr, &k->PCRInfoSize);
+   if(k->PCRInfoSize) {
+      ptr = unpack_TPM_PCR_INFO(ptr, &k->PCRInfo, alloc);
+   }
+   ptr = unpack_TPM_STORE_PUBKEY(ptr, &k->pubKey, alloc);
+   ptr = unpack_UINT32(ptr, &k->encDataSize);
+   return unpack_PTR(ptr, &k->encData, k->encDataSize, alloc);
+}
+
+inline BYTE* pack_TPM_BOUND_DATA(BYTE* ptr, const TPM_BOUND_DATA* b, UINT32 payloadSize) {
+   ptr = pack_TPM_VERSION(ptr, &b->ver);
+   ptr = pack_TPM_PAYLOAD_TYPE(ptr, b->payload);
+   return pack_BUFFER(ptr, b->payloadData, payloadSize);
+}
+
+inline BYTE* unpack_TPM_BOUND_DATA(BYTE* ptr, TPM_BOUND_DATA* b, UINT32 payloadSize, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &b->ver);
+   ptr = unpack_TPM_PAYLOAD_TYPE(ptr, &b->payload);
+   return unpack_PTR(ptr, &b->payloadData, payloadSize, alloc);
+}
+
+inline BYTE* pack_TPM_STORED_DATA(BYTE* ptr, const TPM_STORED_DATA* d) {
+   ptr = pack_TPM_VERSION(ptr, &d->ver);
+   ptr = pack_UINT32(ptr, d->sealInfoSize);
+   if(d->sealInfoSize) {
+      ptr = pack_TPM_PCR_INFO(ptr, &d->sealInfo);
+   }
+   ptr = pack_UINT32(ptr, d->encDataSize);
+   ptr = pack_BUFFER(ptr, d->encData, d->encDataSize);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_STORED_DATA(BYTE* ptr, TPM_STORED_DATA* d, UnpackPtr alloc) {
+   ptr = unpack_TPM_VERSION(ptr, &d->ver);
+   ptr = unpack_UINT32(ptr, &d->sealInfoSize);
+   if(d->sealInfoSize) {
+      ptr = unpack_TPM_PCR_INFO(ptr, &d->sealInfo, alloc);
+   }
+   ptr = unpack_UINT32(ptr, &d->encDataSize);
+   ptr = unpack_PTR(ptr, &d->encData, d->encDataSize, alloc);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_AUTH_SESSION(BYTE* ptr, const TPM_AUTH_SESSION* auth) {
+   ptr = pack_TPM_AUTH_HANDLE(ptr, auth->AuthHandle);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+   ptr = pack_TPM_AUTHDATA(ptr, &auth->HMAC);
+   return ptr;
+}
+
+inline BYTE* unpack_TPM_AUTH_SESSION(BYTE* ptr, TPM_AUTH_SESSION* auth) {
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = unpack_BOOL(ptr, &auth->fContinueAuthSession);
+   ptr = unpack_TPM_AUTHDATA(ptr, &auth->HMAC);
+   return ptr;
+}
+
+inline BYTE* pack_TPM_RQU_HEADER(BYTE* ptr,
+      TPM_TAG tag,
+      UINT32 size,
+      TPM_COMMAND_CODE ord) {
+   ptr = pack_UINT16(ptr, tag);
+   ptr = pack_UINT32(ptr, size);
+   return pack_UINT32(ptr, ord);
+}
+
+inline BYTE* unpack_TPM_RQU_HEADER(BYTE* ptr,
+      TPM_TAG* tag,
+      UINT32* size,
+      TPM_COMMAND_CODE* ord) {
+   ptr = unpack_UINT16(ptr, tag);
+   ptr = unpack_UINT32(ptr, size);
+   ptr = unpack_UINT32(ptr, ord);
+   return ptr;
+}
+
+#define pack_TPM_RSP_HEADER(p, t, s, r) pack_TPM_RQU_HEADER(p, t, s, r);
+#define unpack_TPM_RSP_HEADER(p, t, s, r) unpack_TPM_RQU_HEADER(p, t, s, r);
+
+#endif
diff --git a/stubdom/vtpmmgr/minios.cfg b/stubdom/vtpmmgr/minios.cfg
new file mode 100644
index 0000000..3fb383d
--- /dev/null
+++ b/stubdom/vtpmmgr/minios.cfg
@@ -0,0 +1,14 @@
+CONFIG_TPMFRONT=y
+CONFIG_TPM_TIS=y
+CONFIG_TPMBACK=y
+CONFIG_START_NETWORK=n
+CONFIG_TEST=n
+CONFIG_PCIFRONT=n
+CONFIG_BLKFRONT=y
+CONFIG_NETFRONT=n
+CONFIG_FBFRONT=n
+CONFIG_KBDFRONT=n
+CONFIG_CONSFRONT=n
+CONFIG_XENBUS=y
+CONFIG_LWIP=n
+CONFIG_XC=n
diff --git a/stubdom/vtpmmgr/tcg.h b/stubdom/vtpmmgr/tcg.h
new file mode 100644
index 0000000..7687eae
--- /dev/null
+++ b/stubdom/vtpmmgr/tcg.h
@@ -0,0 +1,707 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005 Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __TCG_H__
+#define __TCG_H__
+
+#include <stdlib.h>
+#include <stdint.h>
+
+// **************************** CONSTANTS *********************************
+
+// BOOL values
+#define TRUE 0x01
+#define FALSE 0x00
+
+#define TCPA_MAX_BUFFER_LENGTH 0x2000
+
+//
+// TPM_COMMAND_CODE values
+#define TPM_PROTECTED_ORDINAL 0x00000000UL
+#define TPM_UNPROTECTED_ORDINAL 0x80000000UL
+#define TPM_CONNECTION_ORDINAL 0x40000000UL
+#define TPM_VENDOR_ORDINAL 0x20000000UL
+
+#define TPM_ORD_OIAP                     (10UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OSAP                     (11UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuth               (12UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_TakeOwnership            (13UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthAsymStart      (14UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthAsymFinish     (15UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ChangeAuthOwner          (16UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Extend                   (20UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PcrRead                  (21UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Quote                    (22UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Seal                     (23UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Unseal                   (24UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DirWriteAuth             (25UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DirRead                  (26UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_UnBind                   (30UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateWrapKey            (31UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadKey                  (32UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetPubKey                (33UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_EvictKey                 (34UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateMigrationBlob      (40UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReWrapKey                (41UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ConvertMigrationBlob     (42UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_AuthorizeMigrationKey    (43UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateMaintenanceArchive (44UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadMaintenanceArchive   (45UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_KillMaintenanceFeature   (46UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadManuMaintPub         (47UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadManuMaintPub         (48UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CertifyKey               (50UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Sign                     (60UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetRandom                (70UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_StirRandom               (71UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SelfTestFull             (80UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SelfTestStartup          (81UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CertifySelfTest          (82UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ContinueSelfTest         (83UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetTestResult            (84UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Reset                    (90UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerClear               (91UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisableOwnerClear        (92UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ForceClear               (93UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisableForceClear        (94UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapabilitySigned      (100UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapability            (101UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetCapabilityOwner       (102UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerSetDisable          (110UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalEnable           (111UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalDisable          (112UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetOwnerInstall          (113UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PhysicalSetDeactivated   (114UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetTempDeactivated       (115UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateEndorsementKeyPair (120UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_MakeIdentity             (121UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ActivateIdentity         (122UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadPubek                (124UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_OwnerReadPubek           (125UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_DisablePubekRead         (126UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetAuditEvent            (130UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetAuditEventSigned      (131UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetOrdinalAuditStatus    (140UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetOrdinalAuditStatus    (141UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Terminate_Handle         (150UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Init                     (151UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveState                (152UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Startup                  (153UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SetRedirection           (154UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Start                (160UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Update               (161UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1Complete             (162UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SHA1CompleteExtend       (163UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_FieldUpgrade             (170UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveKeyContext           (180UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadKeyContext           (181UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveAuthContext          (182UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadAuthContext          (183UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_SaveContext                      (184UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_LoadContext                      (185UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_FlushSpecific                    (186UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_PCR_Reset                        (200UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_DefineSpace                   (204UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_WriteValue                    (205UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_WriteValueAuth                (206UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_ReadValue                     (207UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_NV_ReadValueAuth                 (208UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_UpdateVerification      (209UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_Manage                  (210UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_CreateKeyDelegation     (212UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_CreateOwnerDelegation   (213UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_VerifyDelegation        (214UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_LoadOwnerDelegation     (216UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_ReadAuth                (217UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_Delegate_ReadTable               (219UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_CreateCounter                    (220UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_IncrementCounter                 (221UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReadCounter                      (222UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseCounter                   (223UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseCounterOwner              (224UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_EstablishTransport               (230UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ExecuteTransport                 (231UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_ReleaseTransportSigned           (232UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_GetTicks                         (241UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_TickStampBlob                    (242UL + TPM_PROTECTED_ORDINAL)
+#define TPM_ORD_MAX                              (256UL + TPM_PROTECTED_ORDINAL)
+
+#define TSC_ORD_PhysicalPresence         (10UL + TPM_CONNECTION_ORDINAL)
+
+
+
+//
+// TPM_RESULT values
+//
+// just put in the whole table from spec 1.2
+
+#define TPM_BASE   0x0 // The start of TPM return codes
+#define TPM_VENDOR_ERROR 0x00000400 // Mask to indicate that the error code is vendor specific for vendor specific commands
+#define TPM_NON_FATAL  0x00000800 // Mask to indicate that the error code is a non-fatal failure.
+
+#define TPM_SUCCESS   TPM_BASE // Successful completion of the operation
+#define TPM_AUTHFAIL      TPM_BASE + 1 // Authentication failed
+#define TPM_BADINDEX      TPM_BASE + 2 // The index to a PCR, DIR or other register is incorrect
+#define TPM_BAD_PARAMETER     TPM_BASE + 3 // One or more parameter is bad
+#define TPM_AUDITFAILURE     TPM_BASE + 4 // An operation completed successfully but the auditing of that operation failed.
+#define TPM_CLEAR_DISABLED     TPM_BASE + 5 // The clear disable flag is set and all clear operations now require physical access
+#define TPM_DEACTIVATED     TPM_BASE + 6 // The TPM is deactivated
+#define TPM_DISABLED      TPM_BASE + 7 // The TPM is disabled
+#define TPM_DISABLED_CMD     TPM_BASE + 8 // The target command has been disabled
+#define TPM_FAIL       TPM_BASE + 9 // The operation failed
+#define TPM_BAD_ORDINAL     TPM_BASE + 10 // The ordinal was unknown or inconsistent
+#define TPM_INSTALL_DISABLED   TPM_BASE + 11 // The ability to install an owner is disabled
+#define TPM_INVALID_KEYHANDLE  TPM_BASE + 12 // The key handle presented was invalid
+#define TPM_KEYNOTFOUND     TPM_BASE + 13 // The target key was not found
+#define TPM_INAPPROPRIATE_ENC  TPM_BASE + 14 // Unacceptable encryption scheme
+#define TPM_MIGRATEFAIL     TPM_BASE + 15 // Migration authorization failed
+#define TPM_INVALID_PCR_INFO   TPM_BASE + 16 // PCR information could not be interpreted
+#define TPM_NOSPACE      TPM_BASE + 17 // No room to load key.
+#define TPM_NOSRK       TPM_BASE + 18 // There is no SRK set
+#define TPM_NOTSEALED_BLOB     TPM_BASE + 19 // An encrypted blob is invalid or was not created by this TPM
+#define TPM_OWNER_SET      TPM_BASE + 20 // There is already an Owner
+#define TPM_RESOURCES      TPM_BASE + 21 // The TPM has insufficient internal resources to perform the requested action.
+#define TPM_SHORTRANDOM     TPM_BASE + 22 // A random string was too short
+#define TPM_SIZE       TPM_BASE + 23 // The TPM does not have the space to perform the operation.
+#define TPM_WRONGPCRVAL     TPM_BASE + 24 // The named PCR value does not match the current PCR value.
+#define TPM_BAD_PARAM_SIZE     TPM_BASE + 25 // The paramSize argument to the command has the incorrect value
+#define TPM_SHA_THREAD      TPM_BASE + 26 // There is no existing SHA-1 thread.
+#define TPM_SHA_ERROR      TPM_BASE + 27 // The calculation is unable to proceed because the existing SHA-1 thread has already encountered an error.
+#define TPM_FAILEDSELFTEST     TPM_BASE + 28 // Self-test has failed and the TPM has shutdown.
+#define TPM_AUTH2FAIL      TPM_BASE + 29 // The authorization for the second key in a 2 key function failed authorization
+#define TPM_BADTAG       TPM_BASE + 30 // The tag value sent to for a command is invalid
+#define TPM_IOERROR      TPM_BASE + 31 // An IO error occurred transmitting information to the TPM
+#define TPM_ENCRYPT_ERROR     TPM_BASE + 32 // The encryption process had a problem.
+#define TPM_DECRYPT_ERROR     TPM_BASE + 33 // The decryption process did not complete.
+#define TPM_INVALID_AUTHHANDLE TPM_BASE + 34 // An invalid handle was used.
+#define TPM_NO_ENDORSEMENT     TPM_BASE + 35 // The TPM does not a EK installed
+#define TPM_INVALID_KEYUSAGE   TPM_BASE + 36 // The usage of a key is not allowed
+#define TPM_WRONG_ENTITYTYPE   TPM_BASE + 37 // The submitted entity type is not allowed
+#define TPM_INVALID_POSTINIT   TPM_BASE + 38 // The command was received in the wrong sequence relative to TPM_Init and a subsequent TPM_Startup
+#define TPM_INAPPROPRIATE_SIG  TPM_BASE + 39 // Signed data cannot include additional DER information
+#define TPM_BAD_KEY_PROPERTY   TPM_BASE + 40 // The key properties in TPM_KEY_PARMs are not supported by this TPM
+
+#define TPM_BAD_MIGRATION      TPM_BASE + 41 // The migration properties of this key are incorrect.
+#define TPM_BAD_SCHEME       TPM_BASE + 42 // The signature or encryption scheme for this key is incorrect or not permitted in this situation.
+#define TPM_BAD_DATASIZE      TPM_BASE + 43 // The size of the data (or blob) parameter is bad or inconsistent with the referenced key
+#define TPM_BAD_MODE       TPM_BASE + 44 // A mode parameter is bad, such as capArea or subCapArea for TPM_GetCapability, phsicalPresence parameter for TPM_PhysicalPresence, or migrationType for TPM_CreateMigrationBlob.
+#define TPM_BAD_PRESENCE      TPM_BASE + 45 // Either the physicalPresence or physicalPresenceLock bits have the wrong value
+#define TPM_BAD_VERSION      TPM_BASE + 46 // The TPM cannot perform this version of the capability
+#define TPM_NO_WRAP_TRANSPORT     TPM_BASE + 47 // The TPM does not allow for wrapped transport sessions
+#define TPM_AUDITFAIL_UNSUCCESSFUL TPM_BASE + 48 // TPM audit construction failed and the underlying command was returning a failure code also
+#define TPM_AUDITFAIL_SUCCESSFUL   TPM_BASE + 49 // TPM audit construction failed and the underlying command was returning success
+#define TPM_NOTRESETABLE      TPM_BASE + 50 // Attempt to reset a PCR register that does not have the resettable attribute
+#define TPM_NOTLOCAL       TPM_BASE + 51 // Attempt to reset a PCR register that requires locality and locality modifier not part of command transport
+#define TPM_BAD_TYPE       TPM_BASE + 52 // Make identity blob not properly typed
+#define TPM_INVALID_RESOURCE     TPM_BASE + 53 // When saving context identified resource type does not match actual resource
+#define TPM_NOTFIPS       TPM_BASE + 54 // The TPM is attempting to execute a command only available when in FIPS mode
+#define TPM_INVALID_FAMILY      TPM_BASE + 55 // The command is attempting to use an invalid family ID
+#define TPM_NO_NV_PERMISSION     TPM_BASE + 56 // The permission to manipulate the NV storage is not available
+#define TPM_REQUIRES_SIGN      TPM_BASE + 57 // The operation requires a signed command
+#define TPM_KEY_NOTSUPPORTED     TPM_BASE + 58 // Wrong operation to load an NV key
+#define TPM_AUTH_CONFLICT      TPM_BASE + 59 // NV_LoadKey blob requires both owner and blob authorization
+#define TPM_AREA_LOCKED      TPM_BASE + 60 // The NV area is locked and not writtable
+#define TPM_BAD_LOCALITY      TPM_BASE + 61 // The locality is incorrect for the attempted operation
+#define TPM_READ_ONLY       TPM_BASE + 62 // The NV area is read only and can't be written to
+#define TPM_PER_NOWRITE      TPM_BASE + 63 // There is no protection on the write to the NV area
+#define TPM_FAMILYCOUNT      TPM_BASE + 64 // The family count value does not match
+#define TPM_WRITE_LOCKED      TPM_BASE + 65 // The NV area has already been written to
+#define TPM_BAD_ATTRIBUTES      TPM_BASE + 66 // The NV area attributes conflict
+#define TPM_INVALID_STRUCTURE     TPM_BASE + 67 // The structure tag and version are invalid or inconsistent
+#define TPM_KEY_OWNER_CONTROL     TPM_BASE + 68 // The key is under control of the TPM Owner and can only be evicted by the TPM Owner.
+#define TPM_BAD_COUNTER      TPM_BASE + 69 // The counter handle is incorrect
+#define TPM_NOT_FULLWRITE      TPM_BASE + 70 // The write is not a complete write of the area
+#define TPM_CONTEXT_GAP      TPM_BASE + 71 // The gap between saved context counts is too large
+#define TPM_MAXNVWRITES      TPM_BASE + 72 // The maximum number of NV writes without an owner has been exceeded
+#define TPM_NOOPERATOR       TPM_BASE + 73 // No operator authorization value is set
+#define TPM_RESOURCEMISSING     TPM_BASE + 74 // The resource pointed to by context is not loaded
+#define TPM_DELEGATE_LOCK      TPM_BASE + 75 // The delegate administration is locked
+#define TPM_DELEGATE_FAMILY     TPM_BASE + 76 // Attempt to manage a family other then the delegated family
+#define TPM_DELEGATE_ADMIN      TPM_BASE + 77 // Delegation table management not enabled
+#define TPM_TRANSPORT_EXCLUSIVE    TPM_BASE + 78 // There was a command executed outside of an exclusive transport session
+
+// TPM_STARTUP_TYPE values
+#define TPM_ST_CLEAR 0x0001
+#define TPM_ST_STATE 0x0002
+#define TPM_ST_DEACTIVATED 0x003
+
+// TPM_TAG values
+#define TPM_TAG_RQU_COMMAND 0x00c1
+#define TPM_TAG_RQU_AUTH1_COMMAND 0x00c2
+#define TPM_TAG_RQU_AUTH2_COMMAND 0x00c3
+#define TPM_TAG_RSP_COMMAND 0x00c4
+#define TPM_TAG_RSP_AUTH1_COMMAND 0x00c5
+#define TPM_TAG_RSP_AUTH2_COMMAND 0x00c6
+
+// TPM_PAYLOAD_TYPE values
+#define TPM_PT_ASYM 0x01
+#define TPM_PT_BIND 0x02
+#define TPM_PT_MIGRATE 0x03
+#define TPM_PT_MAINT 0x04
+#define TPM_PT_SEAL 0x05
+
+// TPM_ENTITY_TYPE values
+#define TPM_ET_KEYHANDLE 0x0001
+#define TPM_ET_OWNER 0x0002
+#define TPM_ET_DATA 0x0003
+#define TPM_ET_SRK 0x0004
+#define TPM_ET_KEY 0x0005
+
+/// TPM_ResourceTypes
+#define TPM_RT_KEY      0x00000001
+#define TPM_RT_AUTH     0x00000002
+#define TPM_RT_HASH     0x00000003
+#define TPM_RT_TRANS    0x00000004
+#define TPM_RT_CONTEXT  0x00000005
+#define TPM_RT_COUNTER  0x00000006
+#define TPM_RT_DELEGATE 0x00000007
+#define TPM_RT_DAA_TPM  0x00000008
+#define TPM_RT_DAA_V0   0x00000009
+#define TPM_RT_DAA_V1   0x0000000A
+
+
+
+// TPM_PROTOCOL_ID values
+#define TPM_PID_OIAP 0x0001
+#define TPM_PID_OSAP 0x0002
+#define TPM_PID_ADIP 0x0003
+#define TPM_PID_ADCP 0x0004
+#define TPM_PID_OWNER 0x0005
+
+// TPM_ALGORITHM_ID values
+#define TPM_ALG_RSA 0x00000001
+#define TPM_ALG_SHA 0x00000004
+#define TPM_ALG_HMAC 0x00000005
+#define TPM_ALG_AES128 0x00000006
+#define TPM_ALG_MFG1 0x00000007
+#define TPM_ALG_AES192 0x00000008
+#define TPM_ALG_AES256 0x00000009
+#define TPM_ALG_XOR 0x0000000A
+
+// TPM_ENC_SCHEME values
+#define TPM_ES_NONE 0x0001
+#define TPM_ES_RSAESPKCSv15 0x0002
+#define TPM_ES_RSAESOAEP_SHA1_MGF1 0x0003
+
+// TPM_SIG_SCHEME values
+#define TPM_SS_NONE 0x0001
+#define TPM_SS_RSASSAPKCS1v15_SHA1 0x0002
+#define TPM_SS_RSASSAPKCS1v15_DER 0x0003
+
+/*
+ * TPM_CAPABILITY_AREA Values for TPM_GetCapability ([TPM_Part2], Section 21.1)
+ */
+#define TPM_CAP_ORD                     0x00000001
+#define TPM_CAP_ALG                     0x00000002
+#define TPM_CAP_PID                     0x00000003
+#define TPM_CAP_FLAG                    0x00000004
+#define TPM_CAP_PROPERTY                0x00000005
+#define TPM_CAP_VERSION                 0x00000006
+#define TPM_CAP_KEY_HANDLE              0x00000007
+#define TPM_CAP_CHECK_LOADED            0x00000008
+#define TPM_CAP_SYM_MODE                0x00000009
+#define TPM_CAP_KEY_STATUS              0x0000000C
+#define TPM_CAP_NV_LIST                 0x0000000D
+#define TPM_CAP_MFR                     0x00000010
+#define TPM_CAP_NV_INDEX                0x00000011
+#define TPM_CAP_TRANS_ALG               0x00000012
+#define TPM_CAP_HANDLE                  0x00000014
+#define TPM_CAP_TRANS_ES                0x00000015
+#define TPM_CAP_AUTH_ENCRYPT            0x00000017
+#define TPM_CAP_SELECT_SIZE             0x00000018
+#define TPM_CAP_DA_LOGIC                0x00000019
+#define TPM_CAP_VERSION_VAL             0x0000001A
+
+/* subCap definitions ([TPM_Part2], Section 21.2) */
+#define TPM_CAP_PROP_PCR                0x00000101
+#define TPM_CAP_PROP_DIR                0x00000102
+#define TPM_CAP_PROP_MANUFACTURER       0x00000103
+#define TPM_CAP_PROP_KEYS               0x00000104
+#define TPM_CAP_PROP_MIN_COUNTER        0x00000107
+#define TPM_CAP_FLAG_PERMANENT          0x00000108
+#define TPM_CAP_FLAG_VOLATILE           0x00000109
+#define TPM_CAP_PROP_AUTHSESS           0x0000010A
+#define TPM_CAP_PROP_TRANSESS           0x0000010B
+#define TPM_CAP_PROP_COUNTERS           0x0000010C
+#define TPM_CAP_PROP_MAX_AUTHSESS       0x0000010D
+#define TPM_CAP_PROP_MAX_TRANSESS       0x0000010E
+#define TPM_CAP_PROP_MAX_COUNTERS       0x0000010F
+#define TPM_CAP_PROP_MAX_KEYS           0x00000110
+#define TPM_CAP_PROP_OWNER              0x00000111
+#define TPM_CAP_PROP_CONTEXT            0x00000112
+#define TPM_CAP_PROP_MAX_CONTEXT        0x00000113
+#define TPM_CAP_PROP_FAMILYROWS         0x00000114
+#define TPM_CAP_PROP_TIS_TIMEOUT        0x00000115
+#define TPM_CAP_PROP_STARTUP_EFFECT     0x00000116
+#define TPM_CAP_PROP_DELEGATE_ROW       0x00000117
+#define TPM_CAP_PROP_MAX_DAASESS        0x00000119
+#define TPM_CAP_PROP_DAASESS            0x0000011A
+#define TPM_CAP_PROP_CONTEXT_DIST       0x0000011B
+#define TPM_CAP_PROP_DAA_INTERRUPT      0x0000011C
+#define TPM_CAP_PROP_SESSIONS           0x0000011D
+#define TPM_CAP_PROP_MAX_SESSIONS       0x0000011E
+#define TPM_CAP_PROP_CMK_RESTRICTION    0x0000011F
+#define TPM_CAP_PROP_DURATION           0x00000120
+#define TPM_CAP_PROP_ACTIVE_COUNTER     0x00000122
+#define TPM_CAP_PROP_MAX_NV_AVAILABLE   0x00000123
+#define TPM_CAP_PROP_INPUT_BUFFER       0x00000124
+
+// TPM_KEY_USAGE values
+#define TPM_KEY_EK 0x0000
+#define TPM_KEY_SIGNING 0x0010
+#define TPM_KEY_STORAGE 0x0011
+#define TPM_KEY_IDENTITY 0x0012
+#define TPM_KEY_AUTHCHANGE 0X0013
+#define TPM_KEY_BIND 0x0014
+#define TPM_KEY_LEGACY 0x0015
+
+// TPM_AUTH_DATA_USAGE values
+#define TPM_AUTH_NEVER 0x00
+#define TPM_AUTH_ALWAYS 0x01
+
+// Key Handle of owner and srk
+#define TPM_OWNER_KEYHANDLE 0x40000001
+#define TPM_SRK_KEYHANDLE 0x40000000
+
+
+
+// *************************** TYPEDEFS *********************************
+typedef unsigned char BYTE;
+typedef unsigned char BOOL;
+typedef uint16_t UINT16;
+typedef uint32_t UINT32;
+typedef uint64_t UINT64;
+
+typedef UINT32 TPM_RESULT;
+typedef UINT32 TPM_PCRINDEX;
+typedef UINT32 TPM_DIRINDEX;
+typedef UINT32 TPM_HANDLE;
+typedef TPM_HANDLE TPM_AUTHHANDLE;
+typedef TPM_HANDLE TCPA_HASHHANDLE;
+typedef TPM_HANDLE TCPA_HMACHANDLE;
+typedef TPM_HANDLE TCPA_ENCHANDLE;
+typedef TPM_HANDLE TPM_KEY_HANDLE;
+typedef TPM_HANDLE TCPA_ENTITYHANDLE;
+typedef UINT32 TPM_RESOURCE_TYPE;
+typedef UINT32 TPM_COMMAND_CODE;
+typedef UINT16 TPM_PROTOCOL_ID;
+typedef BYTE TPM_AUTH_DATA_USAGE;
+typedef UINT16 TPM_ENTITY_TYPE;
+typedef UINT32 TPM_ALGORITHM_ID;
+typedef UINT16 TPM_KEY_USAGE;
+typedef UINT16 TPM_STARTUP_TYPE;
+typedef UINT32 TPM_CAPABILITY_AREA;
+typedef UINT16 TPM_ENC_SCHEME;
+typedef UINT16 TPM_SIG_SCHEME;
+typedef UINT16 TPM_MIGRATE_SCHEME;
+typedef UINT16 TPM_PHYSICAL_PRESENCE;
+typedef UINT32 TPM_KEY_FLAGS;
+
+#define TPM_DIGEST_SIZE 20  // Don't change this
+typedef BYTE TPM_AUTHDATA[TPM_DIGEST_SIZE];
+typedef TPM_AUTHDATA TPM_SECRET;
+typedef TPM_AUTHDATA TPM_ENCAUTH;
+typedef BYTE TPM_PAYLOAD_TYPE;
+typedef UINT16 TPM_TAG;
+typedef UINT16 TPM_STRUCTURE_TAG;
+
+// Data Types of the TCS
+typedef UINT32 TCS_AUTHHANDLE;  // Handle addressing a authorization session
+typedef UINT32 TCS_CONTEXT_HANDLE; // Basic context handle
+typedef UINT32 TCS_KEY_HANDLE;  // Basic key handle
+
+// ************************* STRUCTURES **********************************
+
+typedef struct TPM_VERSION {
+  BYTE major;
+  BYTE minor;
+  BYTE revMajor;
+  BYTE revMinor;
+} TPM_VERSION;
+
+static const TPM_VERSION TPM_STRUCT_VER_1_1 = { 1,1,0,0 };
+
+typedef struct TPM_CAP_VERSION_INFO {
+   TPM_STRUCTURE_TAG tag;
+   TPM_VERSION version;
+   UINT16 specLevel;
+   BYTE errataRev;
+   BYTE tpmVendorID[4];
+   UINT16 vendorSpecificSize;
+   BYTE* vendorSpecific;
+} TPM_CAP_VERSION_INFO;
+
+inline void free_TPM_CAP_VERSION_INFO(TPM_CAP_VERSION_INFO* v) {
+   free(v->vendorSpecific);
+   v->vendorSpecific = NULL;
+}
+
+typedef struct TPM_DIGEST {
+  BYTE digest[TPM_DIGEST_SIZE];
+} TPM_DIGEST;
+
+typedef TPM_DIGEST TPM_PCRVALUE;
+typedef TPM_DIGEST TPM_COMPOSITE_HASH;
+typedef TPM_DIGEST TPM_DIRVALUE;
+typedef TPM_DIGEST TPM_HMAC;
+typedef TPM_DIGEST TPM_CHOSENID_HASH;
+
+typedef struct TPM_NONCE {
+  BYTE nonce[TPM_DIGEST_SIZE];
+} TPM_NONCE;
+
+typedef struct TPM_SYMMETRIC_KEY_PARMS {
+   UINT32 keyLength;
+   UINT32 blockSize;
+   UINT32 ivSize;
+   BYTE* IV;
+} TPM_SYMMETRIC_KEY_PARMS;
+
+inline void free_TPM_SYMMETRIC_KEY_PARMS(TPM_SYMMETRIC_KEY_PARMS* p) {
+   free(p->IV);
+   p->IV = NULL;
+}
+
+#define TPM_SYMMETRIC_KEY_PARMS_INIT { 0, 0, 0, NULL }
+
+typedef struct TPM_RSA_KEY_PARMS {
+  UINT32 keyLength;
+  UINT32 numPrimes;
+  UINT32 exponentSize;
+  BYTE* exponent;
+} TPM_RSA_KEY_PARMS;
+
+#define TPM_RSA_KEY_PARMS_INIT { 0, 0, 0, NULL }
+
+inline void free_TPM_RSA_KEY_PARMS(TPM_RSA_KEY_PARMS* p) {
+   free(p->exponent);
+   p->exponent = NULL;
+}
+
+typedef struct TPM_KEY_PARMS {
+  TPM_ALGORITHM_ID algorithmID;
+  TPM_ENC_SCHEME encScheme;
+  TPM_SIG_SCHEME sigScheme;
+  UINT32 parmSize;
+  union {
+     TPM_SYMMETRIC_KEY_PARMS sym;
+     TPM_RSA_KEY_PARMS rsa;
+  } parms;
+} TPM_KEY_PARMS;
+
+#define TPM_KEY_PARMS_INIT { 0, 0, 0, 0 }
+
+inline void free_TPM_KEY_PARMS(TPM_KEY_PARMS* p) {
+   if(p->parmSize) {
+      switch(p->algorithmID) {
+         case TPM_ALG_RSA:
+            free_TPM_RSA_KEY_PARMS(&p->parms.rsa);
+            break;
+         case TPM_ALG_AES128:
+         case TPM_ALG_AES192:
+         case TPM_ALG_AES256:
+            free_TPM_SYMMETRIC_KEY_PARMS(&p->parms.sym);
+            break;
+      }
+   }
+}
+
+typedef struct TPM_STORE_PUBKEY {
+  UINT32 keyLength;
+  BYTE* key;
+} TPM_STORE_PUBKEY;
+
+#define TPM_STORE_PUBKEY_INIT { 0, NULL }
+
+inline void free_TPM_STORE_PUBKEY(TPM_STORE_PUBKEY* p) {
+   free(p->key);
+   p->key = NULL;
+}
+
+typedef struct TPM_PUBKEY {
+  TPM_KEY_PARMS algorithmParms;
+  TPM_STORE_PUBKEY pubKey;
+} TPM_PUBKEY;
+
+#define TPM_PUBKEY_INIT { TPM_KEY_PARMS_INIT, TPM_STORE_PUBKEY_INIT }
+
+inline void free_TPM_PUBKEY(TPM_PUBKEY* k) {
+   free_TPM_KEY_PARMS(&k->algorithmParms);
+   free_TPM_STORE_PUBKEY(&k->pubKey);
+}
+
+typedef struct TPM_PCR_SELECTION {
+   UINT16 sizeOfSelect;
+   BYTE* pcrSelect;
+} TPM_PCR_SELECTION;
+
+#define TPM_PCR_SELECTION_INIT { 0, NULL }
+
+inline void free_TPM_PCR_SELECTION(TPM_PCR_SELECTION* p) {
+   free(p->pcrSelect);
+   p->pcrSelect = NULL;
+}
+
+typedef struct TPM_PCR_INFO {
+   TPM_PCR_SELECTION pcrSelection;
+   TPM_COMPOSITE_HASH digestAtRelease;
+   TPM_COMPOSITE_HASH digestAtCreation;
+} TPM_PCR_INFO;
+
+#define TPM_PCR_INFO_INIT { TPM_PCR_SELECTION_INIT }
+
+inline void free_TPM_PCR_INFO(TPM_PCR_INFO* p) {
+   free_TPM_PCR_SELECTION(&p->pcrSelection);
+}
+
+typedef struct TPM_PCR_COMPOSITE {
+  TPM_PCR_SELECTION select;
+  UINT32 valueSize;
+  TPM_PCRVALUE* pcrValue;
+} TPM_PCR_COMPOSITE;
+
+#define TPM_PCR_COMPOSITE_INIT { TPM_PCR_SELECTION_INIT, 0, NULL }
+
+inline void free_TPM_PCR_COMPOSITE(TPM_PCR_COMPOSITE* p) {
+   free_TPM_PCR_SELECTION(&p->select);
+   free(p->pcrValue);
+   p->pcrValue = NULL;
+}
+
+typedef struct TPM_KEY {
+  TPM_VERSION         ver;
+  TPM_KEY_USAGE       keyUsage;
+  TPM_KEY_FLAGS       keyFlags;
+  TPM_AUTH_DATA_USAGE authDataUsage;
+  TPM_KEY_PARMS       algorithmParms;
+  UINT32              PCRInfoSize;
+  TPM_PCR_INFO        PCRInfo;
+  TPM_STORE_PUBKEY    pubKey;
+  UINT32              encDataSize;
+  BYTE*               encData;
+} TPM_KEY;
+
+#define TPM_KEY_INIT { .algorithmParms = TPM_KEY_PARMS_INIT,\
+   .PCRInfoSize = 0, .PCRInfo = TPM_PCR_INFO_INIT, \
+   .pubKey = TPM_STORE_PUBKEY_INIT, \
+   .encDataSize = 0, .encData = NULL }
+
+inline void free_TPM_KEY(TPM_KEY* k) {
+   if(k->PCRInfoSize) {
+      free_TPM_PCR_INFO(&k->PCRInfo);
+   }
+   free_TPM_STORE_PUBKEY(&k->pubKey);
+   free(k->encData);
+   k->encData = NULL;
+}
+
+typedef struct TPM_BOUND_DATA {
+  TPM_VERSION ver;
+  TPM_PAYLOAD_TYPE payload;
+  BYTE* payloadData;
+} TPM_BOUND_DATA;
+
+#define TPM_BOUND_DATA_INIT { .payloadData = NULL }
+
+inline void free_TPM_BOUND_DATA(TPM_BOUND_DATA* d) {
+   free(d->payloadData);
+   d->payloadData = NULL;
+}
+
+typedef struct TPM_STORED_DATA {
+  TPM_VERSION ver;
+  UINT32 sealInfoSize;
+  TPM_PCR_INFO sealInfo;
+  UINT32 encDataSize;
+  BYTE* encData;
+} TPM_STORED_DATA;
+
+#define TPM_STORED_DATA_INIT { .sealInfoSize = 0, sealInfo = TPM_PCR_INFO_INIT,\
+   .encDataSize = 0, .encData = NULL }
+
+inline void free_TPM_STORED_DATA(TPM_STORED_DATA* d) {
+   if(d->sealInfoSize) {
+      free_TPM_PCR_INFO(&d->sealInfo);
+   }
+   free(d->encData);
+   d->encData = NULL;
+}
+
+typedef struct TPM_AUTH_SESSION {
+  TPM_AUTHHANDLE  AuthHandle;
+  TPM_NONCE   NonceOdd;   // system
+  TPM_NONCE   NonceEven;   // TPM
+  BOOL   fContinueAuthSession;
+  TPM_AUTHDATA  HMAC;
+} TPM_AUTH_SESSION;
+
+#define TPM_AUTH_SESSION_INIT { .AuthHandle = 0, .fContinueAuthSession = FALSE }
+
+// ---------------------- Functions for checking TPM_RESULTs -----------------
+
+#include <stdio.h>
+
+// FIXME: Review use of these and delete unneeded ones.
+
+// these are really badly dependent on local structure:
+// DEPENDS: local var 'status' of type TPM_RESULT
+// DEPENDS: label 'abort_egress' which cleans up and returns the status
+#define ERRORDIE(s) do { status = s; \
+                         fprintf (stderr, "*** ERRORDIE in %s at %s: %i\n", __func__, __FILE__, __LINE__); \
+                         goto abort_egress; } \
+                    while (0)
+
+// DEPENDS: local var 'status' of type TPM_RESULT
+// DEPENDS: label 'abort_egress' which cleans up and returns the status
+// Try command c. If it fails, set status to s and goto abort.
+#define TPMTRY(s,c) if (c != TPM_SUCCESS) { \
+                       status = s; \
+                       printf("ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
+                       goto abort_egress; \
+                    } else {\
+                       status = c; \
+                    }
+
+// Try command c. If it fails, print error message, set status to actual return code. Goto abort
+#define TPMTRYRETURN(c) do { status = c; \
+                             if (status != TPM_SUCCESS) { \
+                               fprintf(stderr, "ERROR in %s at %s:%i code: %s.\n", __func__, __FILE__, __LINE__, tpm_get_error_name(status)); \
+                               goto abort_egress; \
+                             } \
+                        } while(0)
+
+
+#endif //__TCPA_H__
diff --git a/stubdom/vtpmmgr/tpm.c b/stubdom/vtpmmgr/tpm.c
new file mode 100644
index 0000000..123a27c
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm.c
@@ -0,0 +1,938 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <malloc.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <polarssl/sha1.h>
+
+#include "tcg.h"
+#include "tpm.h"
+#include "log.h"
+#include "marshal.h"
+#include "tpmrsa.h"
+#include "vtpmmgr.h"
+
+#define TCPA_MAX_BUFFER_LENGTH 0x2000
+
+#define TPM_BEGIN(TAG, ORD) \
+   const TPM_TAG intag = TAG;\
+TPM_TAG tag = intag;\
+UINT32 paramSize;\
+const TPM_COMMAND_CODE ordinal = ORD;\
+TPM_RESULT status = TPM_SUCCESS;\
+BYTE in_buf[TCPA_MAX_BUFFER_LENGTH];\
+BYTE out_buf[TCPA_MAX_BUFFER_LENGTH];\
+UINT32 out_len = sizeof(out_buf);\
+BYTE* ptr = in_buf;\
+/*Print a log message */\
+vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);\
+/* Pack the header*/\
+ptr = pack_TPM_TAG(ptr, tag);\
+ptr += sizeof(UINT32);\
+ptr = pack_TPM_COMMAND_CODE(ptr, ordinal)\
+
+#define TPM_AUTH_BEGIN() \
+   sha1_context sha1_ctx;\
+BYTE* authbase = ptr - sizeof(TPM_COMMAND_CODE);\
+TPM_DIGEST paramDigest;\
+sha1_starts(&sha1_ctx)
+
+#define TPM_AUTH1_GEN(HMACkey, auth) do {\
+   sha1_finish(&sha1_ctx, paramDigest.digest);\
+   generateAuth(&paramDigest, HMACkey, auth);\
+   ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_AUTH2_GEN(HMACkey, auth) do {\
+   generateAuth(&paramDigest, HMACkey, auth);\
+   ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_TRANSMIT() do {\
+   /* Pack the command size */\
+   paramSize = ptr - in_buf;\
+   pack_UINT32(in_buf + sizeof(TPM_TAG), paramSize);\
+   if((status = TPM_TransmitData(in_buf, paramSize, out_buf, &out_len)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH_VERIFY_BEGIN() do {\
+   UINT32 buf[2] = { cpu_to_be32(status), cpu_to_be32(ordinal) };\
+   sha1_starts(&sha1_ctx);\
+   sha1_update(&sha1_ctx, (unsigned char*)buf, sizeof(buf));\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH1_VERIFY(HMACkey, auth) do {\
+   sha1_finish(&sha1_ctx, paramDigest.digest);\
+   ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+   if((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH2_VERIFY(HMACkey, auth) do {\
+   ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+   if((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+      goto abort_egress;\
+   }\
+} while(0)
+
+
+
+#define TPM_UNPACK_VERIFY() do { \
+   ptr = out_buf;\
+   ptr = unpack_TPM_RSP_HEADER(ptr, \
+         &(tag), &(paramSize), &(status));\
+   if((status) != TPM_SUCCESS || (tag) != (intag +3)) { \
+      vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s\n", tpm_get_error_name(status));\
+      goto abort_egress;\
+   }\
+} while(0)
+
+#define TPM_AUTH_HASH() do {\
+   sha1_update(&sha1_ctx, authbase, ptr - authbase);\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH_SKIP() do {\
+   authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH_ERR_CHECK(auth) do {\
+   if(status != TPM_SUCCESS || auth->fContinueAuthSession == FALSE) {\
+      vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM\n", auth->AuthHandle);\
+      auth->AuthHandle = 0;\
+   }\
+} while(0)
+
+static void xorEncrypt(const TPM_SECRET* sharedSecret,
+      TPM_NONCE* nonce,
+      const TPM_AUTHDATA* inAuth0,
+      TPM_ENCAUTH outAuth0,
+      const TPM_AUTHDATA* inAuth1,
+      TPM_ENCAUTH outAuth1) {
+   BYTE XORbuffer[sizeof(TPM_SECRET) + sizeof(TPM_NONCE)];
+   BYTE XORkey[TPM_DIGEST_SIZE];
+   BYTE* ptr = XORbuffer;
+   ptr = pack_TPM_SECRET(ptr, sharedSecret);
+   ptr = pack_TPM_NONCE(ptr, nonce);
+
+   sha1(XORbuffer, ptr - XORbuffer, XORkey);
+
+   if(inAuth0) {
+      for(int i = 0; i < TPM_DIGEST_SIZE; ++i) {
+         outAuth0[i] = XORkey[i] ^ (*inAuth0)[i];
+      }
+   }
+   if(inAuth1) {
+      for(int i = 0; i < TPM_DIGEST_SIZE; ++i) {
+         outAuth1[i] = XORkey[i] ^ (*inAuth1)[i];
+      }
+   }
+
+}
+
+static void generateAuth(const TPM_DIGEST* paramDigest,
+      const TPM_SECRET* HMACkey,
+      TPM_AUTH_SESSION *auth)
+{
+   //Generate new OddNonce
+   vtpmmgr_rand((BYTE*)auth->NonceOdd.nonce, sizeof(TPM_NONCE));
+
+   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
+   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
+   BYTE* ptr = hmacText;
+
+   ptr = pack_TPM_DIGEST(ptr, paramDigest);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+
+   sha1_hmac((BYTE *) HMACkey, sizeof(TPM_DIGEST),
+         (BYTE *) hmacText, sizeof(hmacText),
+         auth->HMAC);
+}
+
+static TPM_RESULT verifyAuth(const TPM_DIGEST* paramDigest,
+      /*[IN]*/ const TPM_SECRET *HMACkey,
+      /*[IN,OUT]*/ TPM_AUTH_SESSION *auth)
+{
+
+   // Create HMAC text. (Concat inParamsDigest with inAuthSetupParams).
+   TPM_AUTHDATA hm;
+   BYTE hmacText[sizeof(TPM_DIGEST) + (2 * sizeof(TPM_NONCE)) + sizeof(BOOL)];
+   BYTE* ptr = hmacText;
+
+   ptr = pack_TPM_DIGEST(ptr, paramDigest);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceEven);
+   ptr = pack_TPM_NONCE(ptr, &auth->NonceOdd);
+   ptr = pack_BOOL(ptr, auth->fContinueAuthSession);
+
+   sha1_hmac( (BYTE *) HMACkey, sizeof(TPM_DIGEST),
+         (BYTE *) hmacText, sizeof(hmacText),
+         hm);
+
+   // Compare correct HMAC with provided one.
+   if (memcmp(hm, auth->HMAC, sizeof(TPM_DIGEST)) == 0) { // 0 indicates equality
+      return TPM_SUCCESS;
+   } else {
+      vtpmlogerror(VTPM_LOG_TPM, "Auth Session verification failed!\n");
+      return TPM_AUTHFAIL;
+   }
+}
+
+
+
+// ------------------------------------------------------------------
+// Authorization Commands
+// ------------------------------------------------------------------
+
+TPM_RESULT TPM_OIAP(TPM_AUTH_SESSION*   auth)  // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OIAP);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
+   auth->fContinueAuthSession = TRUE;
+
+   ptr = unpack_UINT32(ptr, &auth->AuthHandle);
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OIAP.\n", auth->AuthHandle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_OSAP(TPM_ENTITY_TYPE  entityType,  // in
+      UINT32    entityValue, // in
+      const TPM_AUTHDATA* usageAuth, //in
+      TPM_SECRET *sharedSecret, //out
+      TPM_AUTH_SESSION *auth)
+{
+   BYTE* nonceOddOSAP;
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_OSAP);
+
+   ptr = pack_TPM_ENTITY_TYPE(ptr, entityType);
+   ptr = pack_UINT32(ptr, entityValue);
+
+   //nonce Odd OSAP
+   nonceOddOSAP = ptr;
+   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
+   ptr += TPM_DIGEST_SIZE;
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, &auth->AuthHandle);
+   ptr = unpack_TPM_NONCE(ptr, &auth->NonceEven);
+
+   //Calculate session secret
+   sha1_context ctx;
+   sha1_hmac_starts(&ctx, *usageAuth, TPM_DIGEST_SIZE);
+   sha1_hmac_update(&ctx, ptr, TPM_DIGEST_SIZE); //ptr = nonceEvenOSAP
+   sha1_hmac_update(&ctx, nonceOddOSAP, TPM_DIGEST_SIZE);
+   sha1_hmac_finish(&ctx, *sharedSecret);
+
+   memset(&auth->HMAC, 0, sizeof(TPM_DIGEST));
+   auth->fContinueAuthSession = FALSE;
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x opened by TPM_OSAP.\n", auth->AuthHandle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_TakeOwnership(
+      const TPM_PUBKEY *pubEK, //in
+      const TPM_AUTHDATA* ownerAuth, //in
+      const TPM_AUTHDATA* srkAuth, //in
+      const TPM_KEY* inSrk, //in
+      TPM_KEY* outSrk, //out, optional
+      TPM_AUTH_SESSION*   auth)   // in, out
+{
+   int keyAlloced = 0;
+   tpmrsa_context ek_rsa = TPMRSA_CTX_INIT;
+
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_TakeOwnership);
+   TPM_AUTH_BEGIN();
+
+   tpmrsa_set_pubkey(&ek_rsa,
+         pubEK->pubKey.key, pubEK->pubKey.keyLength,
+         pubEK->algorithmParms.parms.rsa.exponent,
+         pubEK->algorithmParms.parms.rsa.exponentSize);
+
+   /* Pack the protocol ID */
+   ptr = pack_UINT16(ptr, TPM_PID_OWNER);
+
+   /* Pack the encrypted owner auth */
+   ptr = pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength / 8);
+   tpmrsa_pub_encrypt_oaep(&ek_rsa,
+         ctr_drbg_random, &vtpm_globals.ctr_drbg,
+         sizeof(TPM_SECRET),
+         (BYTE*) ownerAuth,
+         ptr);
+   ptr += pubEK->algorithmParms.parms.rsa.keyLength / 8;
+
+   /* Pack the encrypted srk auth */
+   ptr = pack_UINT32(ptr, pubEK->algorithmParms.parms.rsa.keyLength / 8);
+   tpmrsa_pub_encrypt_oaep(&ek_rsa,
+         ctr_drbg_random, &vtpm_globals.ctr_drbg,
+         sizeof(TPM_SECRET),
+         (BYTE*) srkAuth,
+         ptr);
+   ptr += pubEK->algorithmParms.parms.rsa.keyLength / 8;
+
+   /* Pack the Srk key */
+   ptr = pack_TPM_KEY(ptr, inSrk);
+
+   /* Hash everything up to here */
+   TPM_AUTH_HASH();
+
+   /* Generate the authorization */
+   TPM_AUTH1_GEN(ownerAuth, auth);
+
+   /* Send the command to the tpm*/
+   TPM_TRANSMIT();
+   /* Unpack and validate the header */
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   if(outSrk != NULL) {
+      /* If the user wants a copy of the srk we give it to them */
+      keyAlloced = 1;
+      ptr = unpack_TPM_KEY(ptr, outSrk, UNPACK_ALLOC);
+   } else {
+      /*otherwise just parse past it */
+      TPM_KEY temp;
+      ptr = unpack_TPM_KEY(ptr, &temp, UNPACK_ALIAS);
+   }
+
+   /* Hash the output key */
+   TPM_AUTH_HASH();
+
+   /* Verify authorizaton */
+   TPM_AUTH1_VERIFY(ownerAuth, auth);
+
+   goto egress;
+abort_egress:
+   if(keyAlloced) {
+      free_TPM_KEY(outSrk);
+   }
+egress:
+   tpmrsa_free(&ek_rsa);
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+
+TPM_RESULT TPM_DisablePubekRead (
+      const TPM_AUTHDATA* ownerAuth,
+      TPM_AUTH_SESSION*   auth)
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_DisablePubekRead);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(ownerAuth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   TPM_AUTH1_VERIFY(ownerAuth, auth);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+
+TPM_RESULT TPM_TerminateHandle(TPM_AUTHHANDLE  handle)  // in
+{
+   if(handle == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Terminate_Handle);
+
+   ptr = pack_TPM_AUTHHANDLE(ptr, handle);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   vtpmloginfo(VTPM_LOG_TPM, "Auth Session: 0x%x closed by TPM_TerminateHandle\n", handle);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_Extend( TPM_PCRINDEX  pcrNum,  // in
+      TPM_DIGEST  inDigest, // in
+      TPM_PCRVALUE*  outDigest) // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_Extend);
+
+   ptr = pack_TPM_PCRINDEX(ptr, pcrNum);
+   ptr = pack_TPM_DIGEST(ptr, &inDigest);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_TPM_PCRVALUE(ptr, outDigest);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_Seal(
+      TPM_KEY_HANDLE  keyHandle,  // in
+      UINT32    pcrInfoSize, // in
+      TPM_PCR_INFO*    pcrInfo,  // in
+      UINT32    inDataSize,  // in
+      const BYTE*    inData,   // in
+      TPM_STORED_DATA* sealedData, //out
+      const TPM_SECRET* osapSharedSecret, //in
+      const TPM_AUTHDATA* sealedDataAuth, //in
+      TPM_AUTH_SESSION*   pubAuth  // in, out
+      )
+{
+   int dataAlloced = 0;
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_Seal);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, keyHandle);
+
+   TPM_AUTH_SKIP();
+
+   xorEncrypt(osapSharedSecret, &pubAuth->NonceEven,
+         sealedDataAuth, ptr,
+         NULL, NULL);
+   ptr += sizeof(TPM_ENCAUTH);
+
+   ptr = pack_UINT32(ptr, pcrInfoSize);
+   ptr = pack_TPM_PCR_INFO(ptr, pcrInfo);
+
+   ptr = pack_UINT32(ptr, inDataSize);
+   ptr = pack_BUFFER(ptr, inData, inDataSize);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(osapSharedSecret, pubAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_TPM_STORED_DATA(ptr, sealedData, UNPACK_ALLOC);
+   dataAlloced = 1;
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(osapSharedSecret, pubAuth);
+
+   goto egress;
+abort_egress:
+   if(dataAlloced) {
+      free_TPM_STORED_DATA(sealedData);
+   }
+egress:
+   TPM_AUTH_ERR_CHECK(pubAuth);
+   return status;
+}
+
+TPM_RESULT TPM_Unseal(
+      TPM_KEY_HANDLE parentHandle, // in
+      const TPM_STORED_DATA* sealedData,
+      UINT32*   outSize,  // out
+      BYTE**    out, //out
+      const TPM_AUTHDATA* key_usage_auth, //in
+      const TPM_AUTHDATA* data_usage_auth, //in
+      TPM_AUTH_SESSION*   keyAuth,  // in, out
+      TPM_AUTH_SESSION*   dataAuth  // in, out
+      )
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH2_COMMAND, TPM_ORD_Unseal);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, parentHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_TPM_STORED_DATA(ptr, sealedData);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(key_usage_auth, keyAuth);
+   TPM_AUTH2_GEN(data_usage_auth, dataAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, outSize);
+   ptr = unpack_ALLOC(ptr, out, *outSize);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(key_usage_auth, keyAuth);
+   TPM_AUTH2_VERIFY(data_usage_auth, dataAuth);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(keyAuth);
+   TPM_AUTH_ERR_CHECK(dataAuth);
+   return status;
+}
+
+TPM_RESULT TPM_Bind(
+      const TPM_KEY* key,
+      const BYTE* in,
+      UINT32 ilen,
+      BYTE* out)
+{
+   TPM_RESULT status;
+   tpmrsa_context rsa = TPMRSA_CTX_INIT;
+   TPM_BOUND_DATA boundData;
+   uint8_t plain[TCPA_MAX_BUFFER_LENGTH];
+   BYTE* ptr = plain;
+
+   vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);
+
+   tpmrsa_set_pubkey(&rsa,
+         key->pubKey.key, key->pubKey.keyLength,
+         key->algorithmParms.parms.rsa.exponent,
+         key->algorithmParms.parms.rsa.exponentSize);
+
+   // Fill boundData's accessory information
+   boundData.ver = TPM_STRUCT_VER_1_1;
+   boundData.payload = TPM_PT_BIND;
+   boundData.payloadData = (BYTE*)in;
+
+   //marshall the bound data object
+   ptr = pack_TPM_BOUND_DATA(ptr, &boundData, ilen);
+
+   // Encrypt the data
+   TPMTRYRETURN(tpmrsa_pub_encrypt_oaep(&rsa,
+            ctr_drbg_random, &vtpm_globals.ctr_drbg,
+            ptr - plain,
+            plain,
+            out));
+
+abort_egress:
+   tpmrsa_free(&rsa);
+   return status;
+
+}
+
+TPM_RESULT TPM_UnBind(
+      TPM_KEY_HANDLE  keyHandle,  // in
+      UINT32 ilen, //in
+      const BYTE* in, //
+      UINT32* olen, //
+      BYTE*    out, //out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth //in, out
+      )
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_UnBind);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, keyHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_UINT32(ptr, ilen);
+   ptr = pack_BUFFER(ptr, in, ilen);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(usage_auth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, olen);
+   if(*olen > ilen) {
+      vtpmlogerror(VTPM_LOG_TPM, "Output length < input length!\n");
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+   ptr = unpack_BUFFER(ptr, out, *olen);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(usage_auth, auth);
+
+abort_egress:
+egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+TPM_RESULT TPM_CreateWrapKey(
+      TPM_KEY_HANDLE  hWrappingKey,  // in
+      const TPM_AUTHDATA* osapSharedSecret,
+      const TPM_AUTHDATA* dataUsageAuth, //in
+      const TPM_AUTHDATA* dataMigrationAuth, //in
+      TPM_KEY*     key, //in, out
+      TPM_AUTH_SESSION*   pAuth)    // in, out
+{
+   int keyAlloced = 0;
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_CreateWrapKey);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, hWrappingKey);
+
+   TPM_AUTH_SKIP();
+
+   //Encrypted auths
+   xorEncrypt(osapSharedSecret, &pAuth->NonceEven,
+         dataUsageAuth, ptr,
+         dataMigrationAuth, ptr + sizeof(TPM_ENCAUTH));
+   ptr += sizeof(TPM_ENCAUTH) * 2;
+
+   ptr = pack_TPM_KEY(ptr, key);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(osapSharedSecret, pAuth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   keyAlloced = 1;
+   ptr = unpack_TPM_KEY(ptr, key, UNPACK_ALLOC);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(osapSharedSecret, pAuth);
+
+   goto egress;
+abort_egress:
+   if(keyAlloced) {
+      free_TPM_KEY(key);
+   }
+egress:
+   TPM_AUTH_ERR_CHECK(pAuth);
+   return status;
+}
+
+TPM_RESULT TPM_LoadKey(
+      TPM_KEY_HANDLE  parentHandle, //
+      const TPM_KEY* key, //in
+      TPM_HANDLE*  keyHandle,    // out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth)
+{
+   TPM_BEGIN(TPM_TAG_RQU_AUTH1_COMMAND, TPM_ORD_LoadKey);
+   TPM_AUTH_BEGIN();
+
+   TPM_AUTH_HASH();
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, parentHandle);
+
+   TPM_AUTH_SKIP();
+
+   ptr = pack_TPM_KEY(ptr, key);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_GEN(usage_auth, auth);
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+   TPM_AUTH_VERIFY_BEGIN();
+
+   ptr = unpack_UINT32(ptr, keyHandle);
+
+   TPM_AUTH_HASH();
+
+   TPM_AUTH1_VERIFY(usage_auth, auth);
+
+   vtpmloginfo(VTPM_LOG_TPM, "Key Handle: 0x%x opened by TPM_LoadKey\n", *keyHandle);
+
+abort_egress:
+   TPM_AUTH_ERR_CHECK(auth);
+   return status;
+}
+
+TPM_RESULT TPM_EvictKey( TPM_KEY_HANDLE  hKey)  // in
+{
+   if(hKey == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_EvictKey);
+
+   ptr = pack_TPM_KEY_HANDLE(ptr, hKey);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   vtpmloginfo(VTPM_LOG_TPM, "Key handle: 0x%x closed by TPM_EvictKey\n", hKey);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle,
+      TPM_RESOURCE_TYPE rt) {
+   if(handle == 0) {
+      return TPM_SUCCESS;
+   }
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_FlushSpecific);
+
+   ptr = pack_TPM_HANDLE(ptr, handle);
+   ptr = pack_TPM_RESOURCE_TYPE(ptr, rt);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_GetRandom( UINT32*    bytesRequested, // in, out
+      BYTE*    randomBytes) // out
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetRandom);
+
+   // check input params
+   if (bytesRequested == NULL || randomBytes == NULL){
+      return TPM_BAD_PARAMETER;
+   }
+
+   ptr = pack_UINT32(ptr, *bytesRequested);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, bytesRequested);
+   ptr = unpack_BUFFER(ptr, randomBytes, *bytesRequested);
+
+abort_egress:
+   return status;
+}
+
+
+TPM_RESULT TPM_ReadPubek(
+      TPM_PUBKEY* pubEK //out
+      )
+{
+   BYTE* antiReplay = NULL;
+   BYTE* kptr = NULL;
+   BYTE digest[TPM_DIGEST_SIZE];
+   sha1_context ctx;
+
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_ReadPubek);
+
+   //antiReplay nonce
+   vtpmmgr_rand(ptr, TPM_DIGEST_SIZE);
+   antiReplay = ptr;
+   ptr += TPM_DIGEST_SIZE;
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   //unpack and allocate the key
+   kptr = ptr;
+   ptr = unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
+
+   //Verify the checksum
+   sha1_starts(&ctx);
+   sha1_update(&ctx, kptr, ptr - kptr);
+   sha1_update(&ctx, antiReplay, TPM_DIGEST_SIZE);
+   sha1_finish(&ctx, digest);
+
+   //ptr points to the checksum computed by TPM
+   if(memcmp(digest, ptr, TPM_DIGEST_SIZE)) {
+      vtpmlogerror(VTPM_LOG_TPM, "TPM_ReadPubek: Checksum returned by TPM was invalid!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   goto egress;
+abort_egress:
+   if(kptr != NULL) { //If we unpacked the pubEK, we have to free it
+      free_TPM_PUBKEY(pubEK);
+   }
+egress:
+   return status;
+}
+
+
+TPM_RESULT TPM_SaveState(void)
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_SaveState);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_GetCapability(
+      TPM_CAPABILITY_AREA capArea,
+      UINT32 subCapSize,
+      const BYTE* subCap,
+      UINT32* respSize,
+      BYTE** resp)
+{
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_GetCapability);
+
+   ptr = pack_TPM_CAPABILITY_AREA(ptr, capArea);
+   ptr = pack_UINT32(ptr, subCapSize);
+   ptr = pack_BUFFER(ptr, subCap, subCapSize);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   ptr = unpack_UINT32(ptr, respSize);
+   ptr = unpack_ALLOC(ptr, resp, *respSize);
+
+abort_egress:
+   return status;
+}
+
+TPM_RESULT TPM_CreateEndorsementKeyPair(
+      const TPM_KEY_PARMS* keyInfo,
+      TPM_PUBKEY* pubEK)
+{
+   BYTE* kptr = NULL;
+   sha1_context ctx;
+   TPM_DIGEST checksum;
+   TPM_DIGEST hash;
+   TPM_NONCE antiReplay;
+   TPM_BEGIN(TPM_TAG_RQU_COMMAND, TPM_ORD_CreateEndorsementKeyPair);
+
+   //Make anti replay nonce
+   vtpmmgr_rand(antiReplay.nonce, sizeof(antiReplay.nonce));
+
+   ptr = pack_TPM_NONCE(ptr, &antiReplay);
+   ptr = pack_TPM_KEY_PARMS(ptr, keyInfo);
+
+   TPM_TRANSMIT();
+   TPM_UNPACK_VERIFY();
+
+   sha1_starts(&ctx);
+
+   kptr = ptr;
+   ptr = unpack_TPM_PUBKEY(ptr, pubEK, UNPACK_ALLOC);
+
+   /* Hash the pub key blob */
+   sha1_update(&ctx, kptr, ptr - kptr);
+   ptr = unpack_TPM_DIGEST(ptr, &checksum);
+
+   sha1_update(&ctx, antiReplay.nonce, sizeof(antiReplay.nonce));
+
+   sha1_finish(&ctx, hash.digest);
+   if(memcmp(checksum.digest, hash.digest, TPM_DIGEST_SIZE)) {
+      vtpmloginfo(VTPM_LOG_VTPM, "TPM_CreateEndorsementKey: Checkum verification failed!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   goto egress;
+abort_egress:
+   if(kptr) {
+      free_TPM_PUBKEY(pubEK);
+   }
+egress:
+   return status;
+}
+
+TPM_RESULT TPM_TransmitData(
+      BYTE* in,
+      UINT32 insize,
+      BYTE* out,
+      UINT32* outsize) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   UINT32 i;
+   vtpmloginfo(VTPM_LOG_TXDATA, "Sending buffer = 0x");
+   for(i = 0 ; i < insize ; i++)
+      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", in[i]);
+
+   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
+
+   ssize_t size = 0;
+
+   // send the request
+   size = write (vtpm_globals.tpm_fd, in, insize);
+   if (size < 0) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "write() failed : %s\n", strerror(errno));
+      ERRORDIE (TPM_IOERROR);
+   }
+   else if ((UINT32) size < insize) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "Wrote %d instead of %d bytes!\n", (int) size, insize);
+      ERRORDIE (TPM_IOERROR);
+   }
+
+   // read the response
+   size = read (vtpm_globals.tpm_fd, out, *outsize);
+   if (size < 0) {
+      vtpmlogerror(VTPM_LOG_TXDATA, "read() failed : %s\n", strerror(errno));
+      ERRORDIE (TPM_IOERROR);
+   }
+
+   vtpmloginfo(VTPM_LOG_TXDATA, "Receiving buffer = 0x");
+   for(i = 0 ; i < size ; i++)
+      vtpmloginfomore(VTPM_LOG_TXDATA, "%2.2x ", out[i]);
+
+   vtpmloginfomore(VTPM_LOG_TXDATA, "\n");
+
+   *outsize = size;
+   goto egress;
+
+abort_egress:
+egress:
+   return status;
+}
diff --git a/stubdom/vtpmmgr/tpm.h b/stubdom/vtpmmgr/tpm.h
new file mode 100644
index 0000000..304e145
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm.h
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005/2006, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __TPM_H__
+#define __TPM_H__
+
+#include "tcg.h"
+
+// ------------------------------------------------------------------
+// Exposed API
+// ------------------------------------------------------------------
+
+// TPM v1.1B Command Set
+
+// Authorzation
+TPM_RESULT TPM_OIAP(
+      TPM_AUTH_SESSION*   auth //out
+      );
+
+TPM_RESULT TPM_OSAP (
+      TPM_ENTITY_TYPE entityType,  // in
+      UINT32    entityValue, // in
+      const TPM_AUTHDATA* usageAuth, //in
+      TPM_SECRET *sharedSecret, //out
+      TPM_AUTH_SESSION *auth);
+
+TPM_RESULT TPM_TakeOwnership(
+      const TPM_PUBKEY *pubEK, //in
+      const TPM_AUTHDATA* ownerAuth, //in
+      const TPM_AUTHDATA* srkAuth, //in
+      const TPM_KEY* inSrk, //in
+      TPM_KEY* outSrk, //out, optional
+      TPM_AUTH_SESSION*   auth   // in, out
+      );
+
+TPM_RESULT TPM_DisablePubekRead (
+      const TPM_AUTHDATA* ownerAuth,
+      TPM_AUTH_SESSION*   auth
+      );
+
+TPM_RESULT TPM_TerminateHandle ( TPM_AUTHHANDLE  handle  // in
+      );
+
+TPM_RESULT TPM_FlushSpecific ( TPM_HANDLE  handle,  // in
+      TPM_RESOURCE_TYPE resourceType //in
+      );
+
+// TPM Mandatory
+TPM_RESULT TPM_Extend ( TPM_PCRINDEX  pcrNum,  // in
+      TPM_DIGEST   inDigest, // in
+      TPM_PCRVALUE*   outDigest // out
+      );
+
+TPM_RESULT TPM_PcrRead ( TPM_PCRINDEX  pcrNum,  // in
+      TPM_PCRVALUE*  outDigest // out
+      );
+
+TPM_RESULT TPM_Quote ( TCS_KEY_HANDLE  keyHandle,  // in
+      TPM_NONCE   antiReplay,  // in
+      UINT32*    PcrDataSize, // in, out
+      BYTE**    PcrData,  // in, out
+      TPM_AUTH_SESSION*   privAuth,  // in, out
+      UINT32*    sigSize,  // out
+      BYTE**    sig    // out
+      );
+
+TPM_RESULT TPM_Seal(
+      TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32    pcrInfoSize, // in
+      TPM_PCR_INFO*    pcrInfo,  // in
+      UINT32    inDataSize,  // in
+      const BYTE*    inData,   // in
+      TPM_STORED_DATA* sealedData, //out
+      const TPM_SECRET* osapSharedSecret, //in
+      const TPM_AUTHDATA* sealDataAuth, //in
+      TPM_AUTH_SESSION*   pubAuth  // in, out
+      );
+
+TPM_RESULT TPM_Unseal (
+      TPM_KEY_HANDLE parentHandle, // in
+      const TPM_STORED_DATA* sealedData,
+      UINT32*   outSize,  // out
+      BYTE**    out, //out
+      const TPM_AUTHDATA* key_usage_auth, //in
+      const TPM_AUTHDATA* data_usage_auth, //in
+      TPM_AUTH_SESSION*   keyAuth,  // in, out
+      TPM_AUTH_SESSION*   dataAuth  // in, out
+      );
+
+TPM_RESULT TPM_DirWriteAuth ( TPM_DIRINDEX  dirIndex,  // in
+      TPM_DIRVALUE  newContents, // in
+      TPM_AUTH_SESSION*   ownerAuth  // in, out
+      );
+
+TPM_RESULT TPM_DirRead ( TPM_DIRINDEX  dirIndex, // in
+      TPM_DIRVALUE*  dirValue // out
+      );
+
+TPM_RESULT TPM_Bind(
+      const TPM_KEY* key, //in
+      const BYTE* in, //in
+      UINT32 ilen, //in
+      BYTE* out //out, must be at least cipher block size
+      );
+
+TPM_RESULT TPM_UnBind (
+      TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32 ilen, //in
+      const BYTE* in, //
+      UINT32*   outDataSize, // out
+      BYTE*    outData, //out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth //in, out
+      );
+
+TPM_RESULT TPM_CreateWrapKey (
+      TCS_KEY_HANDLE  hWrappingKey,  // in
+      const TPM_AUTHDATA* osapSharedSecret,
+      const TPM_AUTHDATA* dataUsageAuth, //in
+      const TPM_AUTHDATA* dataMigrationAuth, //in
+      TPM_KEY*     key, //in
+      TPM_AUTH_SESSION*   pAuth    // in, out
+      );
+
+TPM_RESULT TPM_LoadKey (
+      TPM_KEY_HANDLE  parentHandle, //
+      const TPM_KEY* key, //in
+      TPM_HANDLE*  keyHandle,    // out
+      const TPM_AUTHDATA* usage_auth,
+      TPM_AUTH_SESSION* auth
+      );
+
+TPM_RESULT TPM_GetPubKey (  TCS_KEY_HANDLE  hKey,   // in
+      TPM_AUTH_SESSION*   pAuth,   // in, out
+      UINT32*    pcPubKeySize, // out
+      BYTE**    prgbPubKey  // out
+      );
+
+TPM_RESULT TPM_EvictKey ( TCS_KEY_HANDLE  hKey  // in
+      );
+
+TPM_RESULT TPM_FlushSpecific(TPM_HANDLE handle, //in
+      TPM_RESOURCE_TYPE rt //in
+      );
+
+TPM_RESULT TPM_Sign ( TCS_KEY_HANDLE  keyHandle,  // in
+      UINT32    areaToSignSize, // in
+      BYTE*    areaToSign,  // in
+      TPM_AUTH_SESSION*   privAuth,  // in, out
+      UINT32*    sigSize,  // out
+      BYTE**    sig    // out
+      );
+
+TPM_RESULT TPM_GetRandom (  UINT32*    bytesRequested, // in, out
+      BYTE*    randomBytes  // out
+      );
+
+TPM_RESULT TPM_StirRandom (  UINT32    inDataSize, // in
+      BYTE*    inData  // in
+      );
+
+TPM_RESULT TPM_ReadPubek (
+      TPM_PUBKEY* pubEK //out
+      );
+
+TPM_RESULT TPM_GetCapability(
+      TPM_CAPABILITY_AREA capArea,
+      UINT32 subCapSize,
+      const BYTE* subCap,
+      UINT32* respSize,
+      BYTE** resp);
+
+TPM_RESULT TPM_SaveState(void);
+
+TPM_RESULT TPM_CreateEndorsementKeyPair(
+      const TPM_KEY_PARMS* keyInfo,
+      TPM_PUBKEY* pubEK);
+
+TPM_RESULT TPM_TransmitData(
+      BYTE* in,
+      UINT32 insize,
+      BYTE* out,
+      UINT32* outsize);
+
+#endif //TPM_H
diff --git a/stubdom/vtpmmgr/tpmrsa.c b/stubdom/vtpmmgr/tpmrsa.c
new file mode 100644
index 0000000..56094e7
--- /dev/null
+++ b/stubdom/vtpmmgr/tpmrsa.c
@@ -0,0 +1,175 @@
+/*
+ *  The RSA public-key cryptosystem
+ *
+ *  Copyright (C) 2006-2011, Brainspark B.V.
+ *
+ *  This file is part of PolarSSL (http://www.polarssl.org)
+ *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
+ *
+ *  All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ *  RSA was designed by Ron Rivest, Adi Shamir and Len Adleman.
+ *
+ *  http://theory.lcs.mit.edu/~rivest/rsapaper.pdf
+ *  http://www.cacr.math.uwaterloo.ca/hac/about/chap8.pdf
+ */
+
+#include "tcg.h"
+#include "polarssl/sha1.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "tpmrsa.h"
+
+#define HASH_LEN 20
+
+void tpmrsa_set_pubkey(tpmrsa_context* ctx,
+      const unsigned char* key,
+      int keylen,
+      const unsigned char* exponent,
+      int explen) {
+
+   tpmrsa_free(ctx);
+
+   if(explen == 0) { //Default e= 2^16+1
+      mpi_lset(&ctx->E, 65537);
+   } else {
+      mpi_read_binary(&ctx->E, exponent, explen);
+   }
+   mpi_read_binary(&ctx->N, key, keylen);
+
+   ctx->len = ( mpi_msb(&ctx->N) + 7) >> 3;
+}
+
+static TPM_RESULT tpmrsa_public( tpmrsa_context *ctx,
+      const unsigned char *input,
+      unsigned char *output )
+{
+   int ret;
+   size_t olen;
+   mpi T;
+
+   mpi_init( &T );
+
+   MPI_CHK( mpi_read_binary( &T, input, ctx->len ) );
+
+   if( mpi_cmp_mpi( &T, &ctx->N ) >= 0 )
+   {
+      mpi_free( &T );
+      return TPM_ENCRYPT_ERROR;
+   }
+
+   olen = ctx->len;
+   MPI_CHK( mpi_exp_mod( &T, &T, &ctx->E, &ctx->N, &ctx->RN ) );
+   MPI_CHK( mpi_write_binary( &T, output, olen ) );
+
+cleanup:
+
+   mpi_free( &T );
+
+   if( ret != 0 )
+      return TPM_ENCRYPT_ERROR;
+
+   return TPM_SUCCESS;
+}
+
+static void mgf_mask( unsigned char *dst, int dlen, unsigned char *src, int slen)
+{
+   unsigned char mask[HASH_LEN];
+   unsigned char counter[4] = {0, 0, 0, 0};
+   int i;
+   sha1_context mctx;
+
+   //We always hash the src with the counter, so save the partial hash
+   sha1_starts(&mctx);
+   sha1_update(&mctx, src, slen);
+
+   // Generate and apply dbMask
+   while(dlen > 0) {
+      //Copy the sha1 context
+      sha1_context ctx = mctx;
+
+      //compute hash for input || counter
+      sha1_update(&ctx, counter, sizeof(counter));
+      sha1_finish(&ctx, mask);
+
+      //Apply the mask
+      for(i = 0; i < (dlen < HASH_LEN ? dlen : HASH_LEN); ++i) {
+         *(dst++) ^= mask[i];
+      }
+
+      //Increment counter
+      ++counter[3];
+
+      dlen -= HASH_LEN;
+   }
+}
+
+/*
+ * Add the message padding, then do an RSA operation
+ */
+TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
+      int (*f_rng)(void *, unsigned char *, size_t),
+      void *p_rng,
+      size_t ilen,
+      const unsigned char *input,
+      unsigned char *output )
+{
+   int ret;
+   int olen;
+   unsigned char* seed = output + 1;
+   unsigned char* db = output + HASH_LEN +1;
+
+   olen = ctx->len-1;
+
+   if( f_rng == NULL )
+      return TPM_ENCRYPT_ERROR;
+
+   if( ilen > olen - 2 * HASH_LEN - 1)
+      return TPM_ENCRYPT_ERROR;
+
+   output[0] = 0;
+
+   //Encoding parameter p
+   sha1((unsigned char*)"TCPA", 4, db);
+
+   //PS
+   memset(db + HASH_LEN, 0,
+         olen - ilen - 2 * HASH_LEN - 1);
+
+   //constant 1 byte
+   db[olen - ilen - HASH_LEN -1] = 0x01;
+
+   //input string
+   memcpy(db + olen - ilen - HASH_LEN,
+         input, ilen);
+
+   //Generate random seed
+   if( ( ret = f_rng( p_rng, seed, HASH_LEN ) ) != 0 )
+      return TPM_ENCRYPT_ERROR;
+
+   // maskedDB: Apply dbMask to DB
+   mgf_mask( db, olen - HASH_LEN, seed, HASH_LEN);
+
+   // maskedSeed: Apply seedMask to seed
+   mgf_mask( seed, HASH_LEN, db, olen - HASH_LEN);
+
+   // Do the crypto op
+   return tpmrsa_public(ctx, output, output);
+}
diff --git a/stubdom/vtpmmgr/tpmrsa.h b/stubdom/vtpmmgr/tpmrsa.h
new file mode 100644
index 0000000..59579e7
--- /dev/null
+++ b/stubdom/vtpmmgr/tpmrsa.h
@@ -0,0 +1,67 @@
+/**
+ * \file rsa.h
+ *
+ * \brief The RSA public-key cryptosystem
+ *
+ *  Copyright (C) 2006-2010, Brainspark B.V.
+ *
+ *  This file is part of PolarSSL (http://www.polarssl.org)
+ *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
+ *
+ *  All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef TPMRSA_H
+#define TPMRSA_H
+
+#include "tcg.h"
+#include <polarssl/bignum.h>
+
+/* tpm software key */
+typedef struct
+{
+    size_t len;                 /*!<  size(N) in chars  */
+
+    mpi N;                      /*!<  public modulus    */
+    mpi E;                      /*!<  public exponent   */
+
+    mpi RN;                     /*!<  cached R^2 mod N  */
+}
+tpmrsa_context;
+
+#define TPMRSA_CTX_INIT { 0, {0, 0, NULL}, {0, 0, NULL}, {0, 0, NULL}}
+
+/* Setup the rsa context using tpm public key data */
+void tpmrsa_set_pubkey(tpmrsa_context* ctx,
+      const unsigned char* key,
+      int keylen,
+      const unsigned char* exponent,
+      int explen);
+
+/* Do rsa public crypto */
+TPM_RESULT tpmrsa_pub_encrypt_oaep( tpmrsa_context *ctx,
+      int (*f_rng)(void *, unsigned char *, size_t),
+      void *p_rng,
+      size_t ilen,
+      const unsigned char *input,
+      unsigned char *output );
+
+/* free tpmrsa key */
+inline void tpmrsa_free( tpmrsa_context *ctx ) {
+   mpi_free( &ctx->RN ); mpi_free( &ctx->E  ); mpi_free( &ctx->N  );
+}
+
+#endif /* tpmrsa.h */
diff --git a/stubdom/vtpmmgr/uuid.h b/stubdom/vtpmmgr/uuid.h
new file mode 100644
index 0000000..4737645
--- /dev/null
+++ b/stubdom/vtpmmgr/uuid.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPMMGR_UUID_H
+#define VTPMMGR_UUID_H
+
+#define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
+#define UUID_FMTLEN ((2*16)+4) /* 16 hex bytes plus 4 hypens */
+#define UUID_BYTES(uuid) uuid[0], uuid[1], uuid[2], uuid[3], \
+                                uuid[4], uuid[5], uuid[6], uuid[7], \
+                                uuid[8], uuid[9], uuid[10], uuid[11], \
+                                uuid[12], uuid[13], uuid[14], uuid[15]
+
+
+typedef uint8_t uuid_t[16];
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_cmd_handler.c b/stubdom/vtpmmgr/vtpm_cmd_handler.c
new file mode 100644
index 0000000..f82a2a9
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_cmd_handler.c
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <inttypes.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "marshal.h"
+#include "log.h"
+#include "vtpm_storage.h"
+#include "vtpmmgr.h"
+#include "tpm.h"
+#include "tcg.h"
+
+static TPM_RESULT vtpmmgr_SaveHashKey(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+
+   if(tpmcmd->req_len != VTPM_COMMAND_HEADER_SIZE + HASHKEYSZ) {
+      vtpmlogerror(VTPM_LOG_VTPM, "VTPM_ORD_SAVEHASHKEY hashkey too short!\n");
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   /* Do the command */
+   TPMTRYRETURN(vtpm_storage_save_hashkey(uuid, tpmcmd->req + VTPM_COMMAND_HEADER_SIZE));
+
+abort_egress:
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         VTPM_TAG_RSP, VTPM_COMMAND_HEADER_SIZE, status);
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+
+   return status;
+}
+
+static TPM_RESULT vtpmmgr_LoadHashKey(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd) {
+   TPM_RESULT status = TPM_SUCCESS;
+
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+
+   TPMTRYRETURN(vtpm_storage_load_hashkey(uuid, tpmcmd->resp + VTPM_COMMAND_HEADER_SIZE));
+
+   tpmcmd->resp_len += HASHKEYSZ;
+
+abort_egress:
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         VTPM_TAG_RSP, tpmcmd->resp_len, status);
+
+   return status;
+}
+
+
+TPM_RESULT vtpmmgr_handle_cmd(
+      const uuid_t uuid,
+      tpmcmd_t* tpmcmd)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   TPM_TAG tag;
+   UINT32 size;
+   TPM_COMMAND_CODE ord;
+
+   unpack_TPM_RQU_HEADER(tpmcmd->req,
+         &tag, &size, &ord);
+
+   /* Handle the command now */
+   switch(tag) {
+      case VTPM_TAG_REQ:
+         //This is a vTPM command
+         switch(ord) {
+            case VTPM_ORD_SAVEHASHKEY:
+               return vtpmmgr_SaveHashKey(uuid, tpmcmd);
+            case VTPM_ORD_LOADHASHKEY:
+               return vtpmmgr_LoadHashKey(uuid, tpmcmd);
+            default:
+               vtpmlogerror(VTPM_LOG_VTPM, "Invalid vTPM Ordinal %" PRIu32 "\n", ord);
+               status = TPM_BAD_ORDINAL;
+         }
+         break;
+      case TPM_TAG_RQU_COMMAND:
+      case TPM_TAG_RQU_AUTH1_COMMAND:
+      case TPM_TAG_RQU_AUTH2_COMMAND:
+         //This is a TPM passthrough command
+         switch(ord) {
+            case TPM_ORD_GetRandom:
+               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_GetRandom\n");
+               break;
+            case TPM_ORD_PcrRead:
+               vtpmloginfo(VTPM_LOG_VTPM, "Passthrough: TPM_PcrRead\n");
+               break;
+            default:
+               vtpmlogerror(VTPM_LOG_VTPM, "TPM Disallowed Passthrough ord=%" PRIu32 "\n", ord);
+               status = TPM_DISABLED_CMD;
+               goto abort_egress;
+         }
+
+         size = TCPA_MAX_BUFFER_LENGTH;
+         TPMTRYRETURN(TPM_TransmitData(tpmcmd->req, tpmcmd->req_len, tpmcmd->resp, &size));
+         tpmcmd->resp_len = size;
+
+         unpack_TPM_RESULT(tpmcmd->resp + sizeof(TPM_TAG) + sizeof(UINT32), &status);
+         return status;
+
+         break;
+      default:
+         vtpmlogerror(VTPM_LOG_VTPM, "Invalid tag=%" PRIu16 "\n", tag);
+         status = TPM_BADTAG;
+   }
+
+abort_egress:
+   tpmcmd->resp_len = VTPM_COMMAND_HEADER_SIZE;
+   pack_TPM_RSP_HEADER(tpmcmd->resp,
+         tag + 3, tpmcmd->resp_len, status);
+
+   return status;
+}
diff --git a/stubdom/vtpmmgr/vtpm_manager.h b/stubdom/vtpmmgr/vtpm_manager.h
new file mode 100644
index 0000000..a2bbcca
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_manager.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPM_MANAGER_H
+#define VTPM_MANAGER_H
+
+#define VTPM_TAG_REQ 0x01c1
+#define VTPM_TAG_RSP 0x01c4
+#define COMMAND_BUFFER_SIZE 4096
+
+// Header size
+#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
+
+//************************ Command Codes ****************************
+#define VTPM_ORD_BASE       0x0000
+#define VTPM_PRIV_MASK      0x01000000 // Priviledged VTPM Command
+#define VTPM_PRIV_BASE      (VTPM_ORD_BASE | VTPM_PRIV_MASK)
+
+// Non-priviledged VTPM Commands (From DMI's)
+#define VTPM_ORD_SAVEHASHKEY      (VTPM_ORD_BASE + 1) // DMI requests encryption key for persistent storage
+#define VTPM_ORD_LOADHASHKEY      (VTPM_ORD_BASE + 2) // DMI requests symkey to be regenerated
+
+//************************ Return Codes ****************************
+#define VTPM_SUCCESS               0
+#define VTPM_FAIL                  1
+#define VTPM_UNSUPPORTED           2
+#define VTPM_FORBIDDEN             3
+#define VTPM_RESTORE_CONTEXT_FAILED    4
+#define VTPM_INVALID_REQUEST       5
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_storage.c b/stubdom/vtpmmgr/vtpm_storage.c
new file mode 100644
index 0000000..abb0dba
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_storage.c
@@ -0,0 +1,794 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * THIS SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT
+ * ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES
+ * INCLUDING, BUT NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR  PURPOSE, AND NONINFRINGEMENT ARE HEREBY
+ * DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND LIABILITY OF USING THE
+ * SOFTWARE.
+ */
+
+/***************************************************************
+ * DISK IMAGE LAYOUT
+ * *************************************************************
+ * All data is stored in BIG ENDIAN format
+ * *************************************************************
+ * Section 1: Header
+ *
+ * 10 bytes 	 id			ID String "VTPMMGRDOM"
+ * uint32_t	 version	        Disk Image version number (current == 1)
+ * uint32_t      storage_key_len	Length of the storage Key
+ * TPM_KEY       storage_key		Marshalled TPM_KEY structure (See TPM spec v2)
+ * RSA_BLOCK     aes_crypto             Encrypted aes key data (RSA_CIPHER_SIZE bytes), bound by the storage_key
+ *  BYTE[32] aes_key                    Aes key for encrypting the uuid table
+ *  uint32_t cipher_sz                  Encrypted size of the uuid table
+ *
+ * *************************************************************
+ * Section 2: Uuid Table
+ *
+ * This table is encrypted by the aes_key in the header. The cipher text size is just
+ * large enough to hold all of the entries plus required padding.
+ *
+ * Each entry is as follows
+ * BYTE[16] uuid                       Uuid of a vtpm that is stored on this disk
+ * uint32_t offset                     Disk offset where the vtpm data is stored
+ *
+ * *************************************************************
+ * Section 3: Vtpm Table
+ *
+ * The rest of the disk stores vtpms. Each vtpm is an RSA_BLOCK encrypted
+ * by the storage key. Each vtpm must exist on an RSA_BLOCK aligned boundary,
+ * starting at the first RSA_BLOCK aligned offset after the uuid table.
+ * As the uuid table grows, vtpms may be relocated.
+ *
+ * RSA_BLOCK     vtpm_crypto          Vtpm data encrypted by storage_key
+ *   BYTE[20]    hash                 Sha1 hash of vtpm encrypted data
+ *   BYTE[16]    vtpm_aes_key         Encryption key for vtpm data
+ *
+  *************************************************************
+ */
+#define DISKVERS 1
+#define IDSTR "VTPMMGRDOM"
+#define IDSTRLEN 10
+#define AES_BLOCK_SIZE 16
+#define AES_KEY_BITS 256
+#define AES_KEY_SIZE (AES_KEY_BITS/8)
+#define BUF_SIZE 4096
+
+#define UUID_TBL_ENT_SIZE (sizeof(uuid_t) + sizeof(uint32_t))
+
+#define HEADERSZ (10 + 4 + 4)
+
+#define TRY_READ(buf, size, msg) do {\
+   int rc; \
+   if((rc = read(blkfront_fd, buf, (size))) != (size)) { \
+      vtpmlogerror(VTPM_LOG_VTPM, "read() failed! " msg " : rc=(%d/%d), error=(%s)\n", rc, (int)(size), strerror(errno)); \
+      status = TPM_IOERROR;\
+      goto abort_egress;\
+   } \
+} while(0)
+
+#define TRY_WRITE(buf, size, msg) do {\
+   int rc; \
+   if((rc = write(blkfront_fd, buf, (size))) != (size)) { \
+      vtpmlogerror(VTPM_LOG_VTPM, "write() failed! " msg " : rc=(%d/%d), error=(%s)\n", rc, (int)(size), strerror(errno)); \
+      status = TPM_IOERROR;\
+      goto abort_egress;\
+   } \
+} while(0)
+
+#include <blkfront.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <mini-os/byteorder.h>
+#include <polarssl/aes.h>
+
+#include "vtpm_manager.h"
+#include "log.h"
+#include "marshal.h"
+#include "tpm.h"
+#include "uuid.h"
+
+#include "vtpmmgr.h"
+#include "vtpm_storage.h"
+
+#define MAX(a,b) ( ((a) > (b)) ? (a) : (b) )
+#define MIN(a,b) ( ((a) < (b)) ? (a) : (b) )
+
+/* blkfront device objets */
+static struct blkfront_dev* blkdev = NULL;
+static int blkfront_fd = -1;
+
+struct Vtpm {
+   uuid_t uuid;
+   int offset;
+};
+struct Storage {
+   int aes_offset;
+   int uuid_offset;
+   int end_offset;
+
+   int num_vtpms;
+   int num_vtpms_alloced;
+   struct Vtpm* vtpms;
+};
+
+/* Global storage data */
+static struct Storage g_store = {
+   .vtpms = NULL,
+};
+
+static int get_offset(void) {
+   return lseek(blkfront_fd, 0, SEEK_CUR);
+}
+
+static void reset_store(void) {
+   g_store.aes_offset = 0;
+   g_store.uuid_offset = 0;
+   g_store.end_offset = 0;
+
+   g_store.num_vtpms = 0;
+   g_store.num_vtpms_alloced = 0;
+   free(g_store.vtpms);
+   g_store.vtpms = NULL;
+}
+
+static int vtpm_get_index(const uuid_t uuid) {
+   int st = 0;
+   int ed = g_store.num_vtpms-1;
+   while(st <= ed) {
+      int mid = ((unsigned int)st + (unsigned int)ed) >> 1; //avoid overflow
+      int c = memcmp(uuid, &g_store.vtpms[mid].uuid, sizeof(uuid_t));
+      if(c == 0) {
+         return mid;
+      } else if(c > 0) {
+         st = mid + 1;
+      } else {
+         ed = mid - 1;
+      }
+   }
+   return -(st + 1);
+}
+
+static void vtpm_add(const uuid_t uuid, int offset, int index) {
+   /* Realloc more space if needed */
+   if(g_store.num_vtpms >= g_store.num_vtpms_alloced) {
+      g_store.num_vtpms_alloced += 16;
+      g_store.vtpms = realloc(
+            g_store.vtpms,
+            sizeof(struct Vtpm) * g_store.num_vtpms_alloced);
+   }
+
+   /* Move everybody after the new guy */
+   for(int i = g_store.num_vtpms; i > index; --i) {
+      g_store.vtpms[i] = g_store.vtpms[i-1];
+   }
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Registered vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+
+   /* Finally add new one */
+   memcpy(g_store.vtpms[index].uuid, uuid, sizeof(uuid_t));
+   g_store.vtpms[index].offset = offset;
+   ++g_store.num_vtpms;
+}
+
+#if 0
+static void vtpm_remove(int index) {
+   for(i = index; i < g_store.num_vtpms; ++i) {
+      g_store.vtpms[i] = g_store.vtpms[i+1];
+   }
+   --g_store.num_vtpms;
+}
+#endif
+
+static int pack_uuid_table(uint8_t* table, int size, int* nvtpms) {
+   uint8_t* ptr = table;
+   while(*nvtpms < g_store.num_vtpms && size >= 0)
+   {
+      /* Pack the uuid */
+      memcpy(ptr, (uint8_t*)g_store.vtpms[*nvtpms].uuid, sizeof(uuid_t));
+      ptr+= sizeof(uuid_t);
+
+
+      /* Pack the offset */
+      ptr = pack_UINT32(ptr, g_store.vtpms[*nvtpms].offset);
+
+      ++*nvtpms;
+      size -= UUID_TBL_ENT_SIZE;
+   }
+   return ptr - table;
+}
+
+/* Extract the uuids */
+static int extract_uuid_table(uint8_t* table, int size) {
+   uint8_t* ptr = table;
+   for(;size >= UUID_TBL_ENT_SIZE; size -= UUID_TBL_ENT_SIZE) {
+      int index;
+      uint32_t v32;
+
+      /*uuid_t is just an array of bytes, so we can do a direct cast here */
+      uint8_t* uuid = ptr;
+      ptr += sizeof(uuid_t);
+
+      /* Get the offset of the key */
+      ptr = unpack_UINT32(ptr, &v32);
+
+      /* Insert the new vtpm in sorted order */
+      if((index = vtpm_get_index(uuid)) >= 0) {
+         vtpmlogerror(VTPM_LOG_VTPM, "Vtpm (" UUID_FMT ") exists multiple times! ignoring...\n", UUID_BYTES(uuid));
+         continue;
+      }
+      index = -index -1;
+
+      vtpm_add(uuid, v32, index);
+
+   }
+   return ptr - table;
+}
+
+static void vtpm_decrypt_block(aes_context* aes,
+      uint8_t* iv,
+      uint8_t* cipher,
+      uint8_t* plain,
+      int cipher_sz,
+      int* overlap)
+{
+   int bytes_ext;
+   /* Decrypt */
+   aes_crypt_cbc(aes, AES_DECRYPT,
+         cipher_sz,
+         iv, cipher, plain + *overlap);
+
+   /* Extract */
+   bytes_ext = extract_uuid_table(plain, cipher_sz + *overlap);
+
+   /* Copy left overs to the beginning */
+   *overlap = cipher_sz + *overlap - bytes_ext;
+   memcpy(plain, plain + bytes_ext, *overlap);
+}
+
+static int vtpm_encrypt_block(aes_context* aes,
+      uint8_t* iv,
+      uint8_t* plain,
+      uint8_t* cipher,
+      int block_sz,
+      int* overlap,
+      int* num_vtpms)
+{
+   int bytes_to_crypt;
+   int bytes_packed;
+
+   /* Pack the uuid table */
+   bytes_packed = *overlap + pack_uuid_table(plain + *overlap, block_sz - *overlap, num_vtpms);
+   bytes_to_crypt = MIN(bytes_packed, block_sz);
+
+   /* Add padding if we aren't on a multiple of the block size */
+   if(bytes_to_crypt & (AES_BLOCK_SIZE-1)) {
+      int oldsz = bytes_to_crypt;
+      //add padding
+      bytes_to_crypt += AES_BLOCK_SIZE - (bytes_to_crypt & (AES_BLOCK_SIZE-1));
+      //fill padding with random bytes
+      vtpmmgr_rand(plain + oldsz, bytes_to_crypt - oldsz);
+      *overlap = 0;
+   } else {
+      *overlap = bytes_packed - bytes_to_crypt;
+   }
+
+   /* Encrypt this chunk */
+   aes_crypt_cbc(aes, AES_ENCRYPT,
+            bytes_to_crypt,
+            iv, plain, cipher);
+
+   /* Copy the left over partials to the beginning */
+   memcpy(plain, plain + bytes_to_crypt, *overlap);
+
+   return bytes_to_crypt;
+}
+
+static TPM_RESULT vtpm_storage_new_vtpm(const uuid_t uuid, int index) {
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
+   uint8_t buf[BUF_SIZE];
+   uint8_t* ptr;
+   int cipher_sz;
+   aes_context aes;
+
+   /* Add new vtpm to the table */
+   vtpm_add(uuid, g_store.end_offset, index);
+   g_store.end_offset += RSA_CIPHER_SIZE;
+
+   /* Compute the new end location of the encrypted uuid table */
+   cipher_sz = AES_BLOCK_SIZE; //IV
+   cipher_sz += g_store.num_vtpms * UUID_TBL_ENT_SIZE; //uuid table
+   cipher_sz += (AES_BLOCK_SIZE - (cipher_sz & (AES_BLOCK_SIZE -1))) & (AES_BLOCK_SIZE-1); //aes padding
+
+   /* Does this overlap any key data? If so they need to be relocated */
+   int uuid_end = (g_store.uuid_offset + cipher_sz + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+   for(int i = 0; i < g_store.num_vtpms; ++i) {
+      if(g_store.vtpms[i].offset < uuid_end) {
+
+         vtpmloginfo(VTPM_LOG_VTPM, "Relocating vtpm data\n");
+
+         //Read the hashkey cipher text
+         lseek(blkfront_fd, g_store.vtpms[i].offset, SEEK_SET);
+         TRY_READ(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
+
+         //Write the cipher text to new offset
+         lseek(blkfront_fd, g_store.end_offset, SEEK_SET);
+         TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey relocate");
+
+         //Save new offset
+         g_store.vtpms[i].offset = g_store.end_offset;
+         g_store.end_offset += RSA_CIPHER_SIZE;
+      }
+   }
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Generating a new symmetric key\n");
+
+   /* Generate an aes key */
+   TPMTRYRETURN(vtpmmgr_rand(plain, AES_KEY_SIZE));
+   aes_setkey_enc(&aes, plain, AES_KEY_BITS);
+   ptr = plain + AES_KEY_SIZE;
+
+   /* Pack the crypted size */
+   ptr = pack_UINT32(ptr, cipher_sz);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Binding encrypted key\n");
+
+   /* Seal the key and size */
+   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
+            plain,
+            ptr - plain,
+            buf));
+
+   /* Write the sealed key to disk */
+   lseek(blkfront_fd, g_store.aes_offset, SEEK_SET);
+   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm aes key");
+
+   /* ENCRYPT AND WRITE UUID TABLE */
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Encrypting the uuid table\n");
+
+   int num_vtpms = 0;
+   int overlap = 0;
+   int bytes_crypted;
+   uint8_t iv[AES_BLOCK_SIZE];
+
+   /* Generate the iv for the first block */
+   TPMTRYRETURN(vtpmmgr_rand(iv, AES_BLOCK_SIZE));
+
+   /* Copy the iv to the cipher text buffer to be written to disk */
+   memcpy(buf, iv, AES_BLOCK_SIZE);
+   ptr = buf + AES_BLOCK_SIZE;
+
+   /* Encrypt the first block of the uuid table */
+   bytes_crypted = vtpm_encrypt_block(&aes,
+         iv, //iv
+         plain, //plaintext
+         ptr, //cipher text
+         BUF_SIZE - AES_BLOCK_SIZE,
+         &overlap,
+         &num_vtpms);
+
+   /* Write the iv followed by the crypted table*/
+   TRY_WRITE(buf, bytes_crypted + AES_BLOCK_SIZE, "vtpm uuid table");
+
+   /* Decrement the number of bytes encrypted */
+   cipher_sz -= bytes_crypted + AES_BLOCK_SIZE;
+
+   /* If there are more vtpms, encrypt and write them block by block */
+   while(cipher_sz > 0) {
+      /* Encrypt the next block of the uuid table */
+      bytes_crypted = vtpm_encrypt_block(&aes,
+               iv,
+               plain,
+               buf,
+               BUF_SIZE,
+               &overlap,
+               &num_vtpms);
+
+      /* Write the cipher text to disk */
+      TRY_WRITE(buf, bytes_crypted, "vtpm uuid table");
+
+      cipher_sz -= bytes_crypted;
+   }
+
+   goto egress;
+abort_egress:
+egress:
+   return status;
+}
+
+
+/**************************************
+ * PUBLIC FUNCTIONS
+ * ***********************************/
+
+int vtpm_storage_init(void) {
+   struct blkfront_info info;
+   if((blkdev = init_blkfront(NULL, &info)) == NULL) {
+      return -1;
+   }
+   if((blkfront_fd = blkfront_open(blkdev)) < 0) {
+      return -1;
+   }
+   return 0;
+}
+
+void vtpm_storage_shutdown(void) {
+   reset_store();
+   close(blkfront_fd);
+}
+
+TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ])
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   int index;
+   uint8_t cipher[RSA_CIPHER_SIZE];
+   uint8_t clear[RSA_CIPHER_SIZE];
+   UINT32 clear_size;
+
+   /* Find the index of this uuid */
+   if((index = vtpm_get_index(uuid)) < 0) {
+      index = -index-1;
+      vtpmlogerror(VTPM_LOG_VTPM, "LoadKey failure: Unrecognized uuid! " UUID_FMT "\n", UUID_BYTES(uuid));
+      status = TPM_BAD_PARAMETER;
+      goto abort_egress;
+   }
+
+   /* Read the table entry */
+   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
+   TRY_READ(cipher, RSA_CIPHER_SIZE, "vtpm hashkey data");
+
+   /* Decrypt the table entry */
+   TPMTRYRETURN(TPM_UnBind(
+            vtpm_globals.storage_key_handle,
+            RSA_CIPHER_SIZE,
+            cipher,
+            &clear_size,
+            clear,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.oiap));
+
+   if(clear_size < HASHKEYSZ) {
+      vtpmloginfo(VTPM_LOG_VTPM, "Decrypted Hash key size (%" PRIu32 ") was too small!\n", clear_size);
+      status = TPM_RESOURCES;
+      goto abort_egress;
+   }
+
+   memcpy(hashkey, clear, HASHKEYSZ);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Loaded hash and key for vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+   goto egress;
+abort_egress:
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load key\n");
+egress:
+   return status;
+}
+
+TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ])
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   int index;
+   uint8_t buf[RSA_CIPHER_SIZE];
+
+   /* Find the index of this uuid */
+   if((index = vtpm_get_index(uuid)) < 0) {
+      index = -index-1;
+      /* Create a new vtpm */
+      TPMTRYRETURN( vtpm_storage_new_vtpm(uuid, index) );
+   }
+
+   /* Encrypt the hash and key */
+   TPMTRYRETURN( TPM_Bind(&vtpm_globals.storage_key,
+            hashkey,
+            HASHKEYSZ,
+            buf));
+
+   /* Write to disk */
+   lseek(blkfront_fd, g_store.vtpms[index].offset, SEEK_SET);
+   TRY_WRITE(buf, RSA_CIPHER_SIZE, "vtpm hashkey data");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saved hash and key for vtpm " UUID_FMT "\n", UUID_BYTES(uuid));
+   goto egress;
+abort_egress:
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to save key\n");
+egress:
+   return status;
+}
+
+TPM_RESULT vtpm_storage_new_header()
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t buf[BUF_SIZE];
+   uint8_t keybuf[AES_KEY_SIZE + sizeof(uint32_t)];
+   uint8_t* ptr = buf;
+   uint8_t* sptr;
+
+   /* Clear everything first */
+   reset_store();
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Creating new disk image header\n");
+
+   /*Copy the ID string */
+   memcpy(ptr, IDSTR, IDSTRLEN);
+   ptr += IDSTRLEN;
+
+   /*Copy the version */
+   ptr = pack_UINT32(ptr, DISKVERS);
+
+   /*Save the location of the key size */
+   sptr = ptr;
+   ptr += sizeof(UINT32);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saving root storage key..\n");
+
+   /* Copy the storage key */
+   ptr = pack_TPM_KEY(ptr, &vtpm_globals.storage_key);
+
+   /* Now save the size */
+   pack_UINT32(sptr, ptr - (sptr + 4));
+
+   /* Create a fake aes key and set cipher text size to 0 */
+   memset(keybuf, 0, sizeof(keybuf));
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Binding uuid table symmetric key..\n");
+
+   /* Save the location of the aes key */
+   g_store.aes_offset = ptr - buf;
+
+   /* Store the fake aes key and vtpm count */
+   TPMTRYRETURN(TPM_Bind(&vtpm_globals.storage_key,
+         keybuf,
+         sizeof(keybuf),
+         ptr));
+   ptr+= RSA_CIPHER_SIZE;
+
+   /* Write the header to disk */
+   lseek(blkfront_fd, 0, SEEK_SET);
+   TRY_WRITE(buf, ptr-buf, "vtpm header");
+
+   /* Save the location of the uuid table */
+   g_store.uuid_offset = get_offset();
+
+   /* Save the end offset */
+   g_store.end_offset = (g_store.uuid_offset + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Saved new manager disk header.\n");
+
+   goto egress;
+abort_egress:
+egress:
+   return status;
+}
+
+
+TPM_RESULT vtpm_storage_load_header(void)
+{
+   TPM_RESULT status = TPM_SUCCESS;
+   uint32_t v32;
+   uint8_t buf[BUF_SIZE];
+   uint8_t* ptr = buf;
+   aes_context aes;
+
+   /* Clear everything first */
+   reset_store();
+
+   /* Read the header from disk */
+   lseek(blkfront_fd, 0, SEEK_SET);
+   TRY_READ(buf, IDSTRLEN + sizeof(UINT32) + sizeof(UINT32), "vtpm header");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Loading disk image header\n");
+
+   /* Verify the ID string */
+   if(memcmp(ptr, IDSTR, IDSTRLEN)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Invalid ID string in disk image!\n");
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+   ptr+=IDSTRLEN;
+
+   /* Unpack the version */
+   ptr = unpack_UINT32(ptr, &v32);
+
+   /* Verify the version */
+   if(v32 != DISKVERS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unsupported disk image version number %" PRIu32 "\n", v32);
+      status = TPM_FAIL;
+      goto abort_egress;
+   }
+
+   /* Size of the storage key */
+   ptr = unpack_UINT32(ptr, &v32);
+
+   /* Sanity check */
+   if(v32 > BUF_SIZE) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Size of storage key (%" PRIu32 ") is too large!\n", v32);
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* read the storage key */
+   TRY_READ(buf, v32, "storage pub key");
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Unpacking storage key\n");
+
+   /* unpack the storage key */
+   ptr = unpack_TPM_KEY(buf, &vtpm_globals.storage_key, UNPACK_ALLOC);
+
+   /* Load Storage Key into the TPM */
+   TPMTRYRETURN( TPM_LoadKey(
+            TPM_SRK_KEYHANDLE,
+            &vtpm_globals.storage_key,
+            &vtpm_globals.storage_key_handle,
+            (const TPM_AUTHDATA*)&vtpm_globals.srk_auth,
+            &vtpm_globals.oiap));
+
+   /* Initialize the storage key auth */
+   memset(vtpm_globals.storage_key_usage_auth, 0, sizeof(TPM_AUTHDATA));
+
+   /* Store the offset of the aes key */
+   g_store.aes_offset = get_offset();
+
+   /* Read the rsa cipher text for the aes key */
+   TRY_READ(buf, RSA_CIPHER_SIZE, "aes key");
+   ptr = buf + RSA_CIPHER_SIZE;
+
+   vtpmloginfo(VTPM_LOG_VTPM, "Unbinding uuid table symmetric key\n");
+
+   /* Decrypt the aes key protecting the uuid table */
+   UINT32 datalen;
+   TPMTRYRETURN(TPM_UnBind(
+            vtpm_globals.storage_key_handle,
+            RSA_CIPHER_SIZE,
+            buf,
+            &datalen,
+            ptr,
+            (const TPM_AUTHDATA*)&vtpm_globals.storage_key_usage_auth,
+            &vtpm_globals.oiap));
+
+   /* Validate the length of the output buffer */
+   if(datalen < AES_KEY_SIZE + sizeof(UINT32)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unbound AES key size (%d) was too small! expected (%ld)\n", datalen, AES_KEY_SIZE + sizeof(UINT32));
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* Extract the aes key */
+   aes_setkey_dec(&aes, ptr, AES_KEY_BITS);
+   ptr+= AES_KEY_SIZE;
+
+   /* Extract the ciphertext size */
+   ptr = unpack_UINT32(ptr, &v32);
+   int cipher_size = v32;
+
+   /* Sanity check */
+   if(cipher_size & (AES_BLOCK_SIZE-1)) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Cipher text size (%" PRIu32 ") is not a multiple of the aes block size! (%d)\n", v32, AES_BLOCK_SIZE);
+      status = TPM_IOERROR;
+      goto abort_egress;
+   }
+
+   /* Save the location of the uuid table */
+   g_store.uuid_offset = get_offset();
+
+   /* Only decrypt the table if there are vtpms to decrypt */
+   if(cipher_size > 0) {
+      int rbytes;
+      int overlap = 0;
+      uint8_t plain[BUF_SIZE + AES_BLOCK_SIZE];
+      uint8_t iv[AES_BLOCK_SIZE];
+
+      vtpmloginfo(VTPM_LOG_VTPM, "Decrypting uuid table\n");
+
+      /* Pre allocate the vtpm array */
+      g_store.num_vtpms_alloced = cipher_size / UUID_TBL_ENT_SIZE;
+      g_store.vtpms = malloc(sizeof(struct Vtpm) * g_store.num_vtpms_alloced);
+
+      /* Read the iv and the first chunk of cipher text */
+      rbytes = MIN(cipher_size, BUF_SIZE);
+      TRY_READ(buf, rbytes, "vtpm uuid table\n");
+      cipher_size -= rbytes;
+
+      /* Copy the iv */
+      memcpy(iv, buf, AES_BLOCK_SIZE);
+      ptr = buf + AES_BLOCK_SIZE;
+
+      /* Remove the iv from the number of bytes to decrypt */
+      rbytes -= AES_BLOCK_SIZE;
+
+      /* Decrypt and extract vtpms */
+      vtpm_decrypt_block(&aes,
+            iv, ptr, plain,
+            rbytes, &overlap);
+
+      /* Read the rest of the table if there is more */
+      while(cipher_size > 0) {
+         /* Read next chunk of cipher text */
+         rbytes = MIN(cipher_size, BUF_SIZE);
+         TRY_READ(buf, rbytes, "vtpm uuid table");
+         cipher_size -= rbytes;
+
+         /* Decrypt a block of text */
+         vtpm_decrypt_block(&aes,
+               iv, buf, plain,
+               rbytes, &overlap);
+
+      }
+      vtpmloginfo(VTPM_LOG_VTPM, "Loaded %d vtpms!\n", g_store.num_vtpms);
+   }
+
+   /* The end of the key table, new vtpms go here */
+   int uuid_end = (get_offset() + RSA_CIPHER_SIZE) & ~(RSA_CIPHER_SIZE -1);
+   g_store.end_offset = uuid_end;
+
+   /* Compute the end offset while validating vtpms*/
+   for(int i = 0; i < g_store.num_vtpms; ++i) {
+      /* offset must not collide with previous data */
+      if(g_store.vtpms[i].offset < uuid_end) {
+         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
+               " offset (%d) is before end of uuid table (%d)!\n",
+               UUID_BYTES(g_store.vtpms[i].uuid),
+               g_store.vtpms[i].offset, uuid_end);
+         status = TPM_IOERROR;
+         goto abort_egress;
+      }
+      /* offset must be at a multiple of cipher size */
+      if(g_store.vtpms[i].offset & (RSA_CIPHER_SIZE-1)) {
+         vtpmlogerror(VTPM_LOG_VTPM, "vtpm: " UUID_FMT
+               " offset(%d) is not at a multiple of the rsa cipher text size (%d)!\n",
+               UUID_BYTES(g_store.vtpms[i].uuid),
+               g_store.vtpms[i].offset, RSA_CIPHER_SIZE);
+         status = TPM_IOERROR;
+         goto abort_egress;
+      }
+      /* Save the last offset */
+      if(g_store.vtpms[i].offset >= g_store.end_offset) {
+         g_store.end_offset = g_store.vtpms[i].offset + RSA_CIPHER_SIZE;
+      }
+   }
+
+   goto egress;
+abort_egress:
+   //An error occured somewhere
+   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load manager data!\n");
+
+   //Clear the data store
+   reset_store();
+
+   //Reset the storage key structure
+   free_TPM_KEY(&vtpm_globals.storage_key);
+   {
+      TPM_KEY key = TPM_KEY_INIT;
+      vtpm_globals.storage_key = key;
+   }
+
+   //Reset the storage key handle
+   TPM_EvictKey(vtpm_globals.storage_key_handle);
+   vtpm_globals.storage_key_handle = 0;
+egress:
+   return status;
+}
+
+#if 0
+/* For testing disk IO */
+void add_fake_vtpms(int num) {
+   for(int i = 0; i < num; ++i) {
+      uint32_t ind = cpu_to_be32(i);
+
+      uuid_t uuid;
+      memset(uuid, 0, sizeof(uuid_t));
+      memcpy(uuid, &ind, sizeof(ind));
+      int index = vtpm_get_index(uuid);
+      index = -index-1;
+
+      vtpm_storage_new_vtpm(uuid, index);
+   }
+}
+#endif
diff --git a/stubdom/vtpmmgr/vtpm_storage.h b/stubdom/vtpmmgr/vtpm_storage.h
new file mode 100644
index 0000000..a5a5fd7
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpm_storage.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPM_STORAGE_H
+#define VTPM_STORAGE_h
+
+#include "uuid.h"
+
+#define VTPM_NVMKEY_SIZE 32
+#define HASHKEYSZ (sizeof(TPM_DIGEST) + VTPM_NVMKEY_SIZE)
+
+/* Initialize the storage system and its virtual disk */
+int vtpm_storage_init(void);
+
+/* Shutdown the storage system and its virtual disk */
+void vtpm_storage_shutdown(void);
+
+/* Loads Sha1 hash and 256 bit AES key from disk and stores them
+ * packed together in outbuf. outbuf must be freed
+ * by the caller using buffer_free()
+ */
+TPM_RESULT vtpm_storage_load_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ]);
+
+/* inbuf must contain a sha1 hash followed by a 256 bit AES key.
+ * Encrypts and stores the hash and key to disk */
+TPM_RESULT vtpm_storage_save_hashkey(const uuid_t uuid, uint8_t hashkey[HASHKEYSZ]);
+
+/* Load the vtpm manager data - call this on startup */
+TPM_RESULT vtpm_storage_load_header(void);
+
+/* Saves the vtpm manager data - call this on shutdown */
+TPM_RESULT vtpm_storage_new_header(void);
+
+
+#endif
diff --git a/stubdom/vtpmmgr/vtpmmgr.c b/stubdom/vtpmmgr/vtpmmgr.c
new file mode 100644
index 0000000..563f4e8
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpmmgr.c
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdint.h>
+#include <mini-os/tpmback.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "log.h"
+
+#include "vtpmmgr.h"
+#include "tcg.h"
+
+
+void main_loop(void) {
+   tpmcmd_t* tpmcmd;
+   uint8_t respbuf[TCPA_MAX_BUFFER_LENGTH];
+
+   while(1) {
+      /* Wait for requests from a vtpm */
+      vtpmloginfo(VTPM_LOG_VTPM, "Waiting for commands from vTPM's:\n");
+      if((tpmcmd = tpmback_req_any()) == NULL) {
+         vtpmlogerror(VTPM_LOG_VTPM, "NULL tpmcmd\n");
+         continue;
+      }
+
+      tpmcmd->resp = respbuf;
+
+      /* Process the command */
+      vtpmmgr_handle_cmd(tpmcmd->uuid, tpmcmd);
+
+      /* Send response */
+      tpmback_resp(tpmcmd);
+   }
+}
+
+int main(int argc, char** argv)
+{
+   int rc = 0;
+   sleep(2);
+   vtpmloginfo(VTPM_LOG_VTPM, "Starting vTPM manager domain\n");
+
+   /* Initialize the vtpm manager */
+   if(vtpmmgr_init(argc, argv) != TPM_SUCCESS) {
+      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize vtpmmgr domain!\n");
+      rc = -1;
+      goto exit;
+   }
+
+   main_loop();
+
+   vtpmloginfo(VTPM_LOG_VTPM, "vTPM Manager shutting down...\n");
+
+   vtpmmgr_shutdown();
+
+exit:
+   return rc;
+
+}
diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
new file mode 100644
index 0000000..50a1992
--- /dev/null
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VTPMMGR_H
+#define VTPMMGR_H
+
+#include <mini-os/tpmback.h>
+#include <polarssl/entropy.h>
+#include <polarssl/ctr_drbg.h>
+
+#include "uuid.h"
+#include "tcg.h"
+#include "vtpm_manager.h"
+
+#define RSA_KEY_SIZE 0x0800
+#define RSA_CIPHER_SIZE (RSA_KEY_SIZE / 8)
+
+struct vtpm_globals {
+   int tpm_fd;
+   TPM_KEY             storage_key;
+   TPM_HANDLE          storage_key_handle;       // Key used by persistent store
+   TPM_AUTH_SESSION    oiap;                // OIAP session for storageKey
+   TPM_AUTHDATA        storage_key_usage_auth;
+
+   TPM_AUTHDATA        owner_auth;
+   TPM_AUTHDATA        srk_auth;
+
+   entropy_context     entropy;
+   ctr_drbg_context    ctr_drbg;
+};
+
+// --------------------------- Global Values --------------------------
+extern struct vtpm_globals vtpm_globals;   // Key info and DMI states
+
+TPM_RESULT vtpmmgr_init(int argc, char** argv);
+void vtpmmgr_shutdown(void);
+
+TPM_RESULT vtpmmgr_handle_cmd(const uuid_t uuid, tpmcmd_t* tpmcmd);
+
+inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes) {
+   return ctr_drbg_random(&vtpm_globals.ctr_drbg, bytes, num_bytes) == 0 ? 0 : TPM_FAIL;
+}
+
+#endif
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:36:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:36:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te829-00080u-UJ; Thu, 29 Nov 2012 17:36:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te827-0007zW-Nn
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:36:20 +0000
Received: from [85.158.139.211:51984] by server-3.bemta-5.messagelabs.com id
	9C/63-18736-21D97B05; Thu, 29 Nov 2012 17:36:18 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-14.tower-206.messagelabs.com!1354210558!18366979!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_23,UNPARSEABLE_RELAY,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27372 invoked from network); 29 Nov 2012 17:35:59 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:35:59 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158386752;
	Thu, 29 Nov 2012 12:35:48 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com
Date: Thu, 29 Nov 2012 12:35:34 -0500
Message-Id: <1354210534-31052-8-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [VTPM v5 7/7] Add a real top level configure script
	that calls the others
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 autogen.sh         |    1 +
 configure          | 3013 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 configure.ac       |   14 +
 tools/configure    |  601 ++++++-----
 tools/configure.ac |    2 +-
 5 files changed, 3341 insertions(+), 290 deletions(-)
 create mode 100644 configure.ac

diff --git a/autogen.sh b/autogen.sh
index ada482c..1456d94 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,4 +1,5 @@
 #!/bin/sh -e
+autoconf
 cd tools
 autoconf
 autoheader
diff --git a/configure b/configure
index ba3bc39..3284a46 100755
--- a/configure
+++ b/configure
@@ -1,2 +1,3011 @@
-#!/bin/sh -e
-cd tools && ./configure $@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for Xen Hypervisor 4.3.
+#
+# Report bugs to <xen-devel@lists.xen.org>.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     # Try only shells that exist, to save several forks.
+	     as_shell=$as_dir/$as_base
+	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+	   done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: xen-devel@lists.xen.org about your system, including
+$0: any error possibly output before this message. Then
+$0: install a modern shell, or manually run the script
+$0: under such a shell if you do have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='Xen Hypervisor'
+PACKAGE_TARNAME='xen'
+PACKAGE_VERSION='4.3'
+PACKAGE_STRING='Xen Hypervisor 4.3'
+PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
+PACKAGE_URL='http://www.xen.org/'
+
+ac_unique_file="./tools/libxl/libxl.c"
+ac_default_prefix=/usr
+enable_option_checking=no
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+subdirs
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias'
+ac_subdirs_all='tools stubdom'
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures Xen Hypervisor 4.3 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking ...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/xen]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of Xen Hypervisor 4.3:";;
+   esac
+  cat <<\_ACEOF
+
+Report bugs to <xen-devel@lists.xen.org>.
+Xen Hypervisor home page: <http://www.xen.org/>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+Xen Hypervisor configure 4.3
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by Xen Hypervisor $as_me 4.3, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append ac_configure_args1 " '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+ac_config_files="$ac_config_files ./config/Tools.mk"
+
+
+ac_aux_dir=
+for ac_dir in . "$srcdir"/.; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in . \"$srcdir\"/." "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+
+
+
+subdirs="$subdirs tools stubdom"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then branch to the quote section.  Otherwise,
+# look for a macro that doesn't take arguments.
+ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
+t clear
+:clear
+s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\)/-D\1=\2/g
+t quote
+s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)/-D\1=\2/g
+t quote
+b any
+:quote
+s/[	 `~#$^&*(){}\\|;'\''"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
+H
+:any
+${
+	g
+	s/^\n//
+	s/\n/ /g
+	p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
+
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by Xen Hypervisor $as_me 4.3, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to <xen-devel@lists.xen.org>.
+Xen Hypervisor home page: <http://www.xen.org/>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+Xen Hypervisor config.status 4.3
+configured by $0, generated by GNU Autoconf 2.69,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=?*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h |  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "./config/Tools.mk") CONFIG_FILES="$CONFIG_FILES ./config/Tools.mk" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
+h
+s///
+s/^/:/
+s/[	 ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[	 ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+
+eval set X "  :F $CONFIG_FILES      "
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$ac_tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$ac_tmp/stdin"
+  case $ac_file in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+
+
+
+  esac
+
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || as_fn_exit 1
+fi
+
+#
+# CONFIG_SUBDIRS section.
+#
+if test "$no_recursion" != yes; then
+
+  # Remove --cache-file, --srcdir, and --disable-option-checking arguments
+  # so they do not pile up.
+  ac_sub_configure_args=
+  ac_prev=
+  eval "set x $ac_configure_args"
+  shift
+  for ac_arg
+  do
+    if test -n "$ac_prev"; then
+      ac_prev=
+      continue
+    fi
+    case $ac_arg in
+    -cache-file | --cache-file | --cache-fil | --cache-fi \
+    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+      ac_prev=cache_file ;;
+    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
+    | --c=*)
+      ;;
+    --config-cache | -C)
+      ;;
+    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+      ac_prev=srcdir ;;
+    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+      ;;
+    -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+      ac_prev=prefix ;;
+    -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+      ;;
+    --disable-option-checking)
+      ;;
+    *)
+      case $ac_arg in
+      *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+      esac
+      as_fn_append ac_sub_configure_args " '$ac_arg'" ;;
+    esac
+  done
+
+  # Always prepend --prefix to ensure using the same prefix
+  # in subdir configurations.
+  ac_arg="--prefix=$prefix"
+  case $ac_arg in
+  *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+  esac
+  ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
+
+  # Pass --silent
+  if test "$silent" = yes; then
+    ac_sub_configure_args="--silent $ac_sub_configure_args"
+  fi
+
+  # Always prepend --disable-option-checking to silence warnings, since
+  # different subdirs can have different --enable and --with options.
+  ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"
+
+  ac_popdir=`pwd`
+  for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
+
+    # Do not complain, so a configure script can configure whichever
+    # parts of a large source tree are present.
+    test -d "$srcdir/$ac_dir" || continue
+
+    ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
+    $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5
+    $as_echo "$ac_msg" >&6
+    as_dir="$ac_dir"; as_fn_mkdir_p
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+    cd "$ac_dir"
+
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      ac_sub_configure=$ac_srcdir/configure.gnu
+    elif test -f "$ac_srcdir/configure"; then
+      ac_sub_configure=$ac_srcdir/configure
+    elif test -f "$ac_srcdir/configure.in"; then
+      # This should be Cygnus configure.
+      ac_sub_configure=$ac_aux_dir/configure
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5
+$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
+      ac_sub_configure=
+    fi
+
+    # The recursion is here.
+    if test -n "$ac_sub_configure"; then
+      # Make the cache file name correct relative to the subdirectory.
+      case $cache_file in
+      [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;;
+      *) # Relative name.
+	ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
+      esac
+
+      { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
+$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
+      # The eval makes quoting arguments work.
+      eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
+	   --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
+	as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5
+    fi
+
+    cd "$ac_popdir"
+  done
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..3a6339c
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,14 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.67])
+AC_INIT([Xen Hypervisor], m4_esyscmd([./version.sh ./xen/Makefile]),
+    [xen-devel@lists.xen.org], [xen], [http://www.xen.org/])
+AC_CONFIG_SRCDIR([./tools/libxl/libxl.c])
+AC_CONFIG_FILES([./config/Tools.mk])
+AC_PREFIX_DEFAULT([/usr])
+AC_CONFIG_AUX_DIR([.])
+
+AC_CONFIG_SUBDIRS([tools stubdom])
+
+AC_OUTPUT()
diff --git a/tools/configure b/tools/configure
index 1168436..fbd48a8 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1,13 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for Xen Hypervisor 4.3.
+# Generated by GNU Autoconf 2.69 for Xen Hypervisor Tools 4.3.
 #
 # Report bugs to <xen-devel@lists.xen.org>.
 #
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -91,6 +89,7 @@ fi
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -135,6 +134,31 @@ export LANGUAGE
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
@@ -168,7 +192,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -213,14 +238,25 @@ IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-	# neutralization value for shells without unset; and this also
-	# works around shells that cannot unset nonexistent variables.
-	BASH_ENV=/dev/null
-	ENV=/dev/null
-	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-	export CONFIG_SHELL
-	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
 fi
 
     if test x$as_have_required = xno; then :
@@ -323,6 +359,14 @@ $as_echo X"$as_dir" |
 
 
 } # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -444,6 +488,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -478,16 +526,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -499,28 +547,8 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -550,10 +578,10 @@ MFLAGS=
 MAKEFLAGS=
 
 # Identity of this package.
-PACKAGE_NAME='Xen Hypervisor'
+PACKAGE_NAME='Xen Hypervisor Tools'
 PACKAGE_TARNAME='xen'
 PACKAGE_VERSION='4.3'
-PACKAGE_STRING='Xen Hypervisor 4.3'
+PACKAGE_STRING='Xen Hypervisor Tools 4.3'
 PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='http://www.xen.org/'
 
@@ -1164,7 +1192,7 @@ Try \`$0 --help' for more information"
     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
   esac
@@ -1215,8 +1243,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1302,7 +1328,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Xen Hypervisor 4.3 to adapt to many kinds of systems.
+\`configure' configures Xen Hypervisor Tools 4.3 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1367,7 +1393,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Xen Hypervisor 4.3:";;
+     short | recursive ) echo "Configuration of Xen Hypervisor Tools 4.3:";;
    esac
   cat <<\_ACEOF
 
@@ -1427,7 +1453,7 @@ Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
 Report bugs to <xen-devel@lists.xen.org>.
-Xen Hypervisor home page: <http://www.xen.org/>.
+Xen Hypervisor Tools home page: <http://www.xen.org/>.
 _ACEOF
 ac_status=$?
 fi
@@ -1490,10 +1516,10 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Xen Hypervisor configure 4.3
-generated by GNU Autoconf 2.67
+Xen Hypervisor Tools configure 4.3
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1537,7 +1563,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_compile
@@ -1574,7 +1600,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
     ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_cpp
@@ -1587,10 +1613,10 @@ fi
 ac_fn_c_check_header_mongrel ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval "test \"\${$3+set}\"" = set; then :
+  if eval \${$3+:} false; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
@@ -1657,7 +1683,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
@@ -1666,7 +1692,7 @@ eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_mongrel
 
@@ -1707,7 +1733,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
        ac_retval=$ac_status
 fi
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_run
@@ -1721,7 +1747,7 @@ ac_fn_c_check_header_compile ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1739,7 +1765,7 @@ fi
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_compile
 
@@ -1770,7 +1796,7 @@ $as_echo "$ac_try_echo"; } >&5
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
 	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
+	 test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -1784,7 +1810,7 @@ fi
   # interfere with the next link command; also delete a directory that is
   # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
@@ -1792,8 +1818,8 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Xen Hypervisor $as_me 4.3, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
+It was created by Xen Hypervisor Tools $as_me 4.3, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -2051,7 +2077,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;}
       || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
@@ -2195,7 +2221,7 @@ $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
 $as_echo_n "checking build system type... " >&6; }
-if test "${ac_cv_build+set}" = set; then :
+if ${ac_cv_build+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
@@ -2211,7 +2237,7 @@ fi
 $as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
 esac
 build=$ac_cv_build
 ac_save_IFS=$IFS; IFS='-'
@@ -2229,7 +2255,7 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
 $as_echo_n "checking host system type... " >&6; }
-if test "${ac_cv_host+set}" = set; then :
+if ${ac_cv_host+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
@@ -2244,7 +2270,7 @@ fi
 $as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
 esac
 host=$ac_cv_host
 ac_save_IFS=$IFS; IFS='-'
@@ -2308,7 +2334,6 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 
-
 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 # serial 1 (pkg-config-0.24)
 #
@@ -2675,7 +2700,7 @@ if test -n "$ac_tool_prefix"; then
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2687,7 +2712,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2715,7 +2740,7 @@ if test -z "$ac_cv_prog_CC"; then
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2727,7 +2752,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2768,7 +2793,7 @@ if test -z "$CC"; then
 set dummy ${ac_tool_prefix}cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2780,7 +2805,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2808,7 +2833,7 @@ if test -z "$CC"; then
 set dummy cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2821,7 +2846,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -2867,7 +2892,7 @@ if test -z "$CC"; then
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2879,7 +2904,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2911,7 +2936,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2923,7 +2948,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2966,7 +2991,7 @@ fi
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -3081,7 +3106,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
@@ -3124,7 +3149,7 @@ else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -3183,7 +3208,7 @@ $as_echo "$ac_try_echo"; } >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
     fi
   fi
 fi
@@ -3194,7 +3219,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
 ac_clean_files=$ac_clean_files_save
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then :
+if ${ac_cv_objext+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3235,7 +3260,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
@@ -3245,7 +3270,7 @@ OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3282,7 +3307,7 @@ ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -3360,7 +3385,7 @@ else
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -3369,8 +3394,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -3459,7 +3483,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -3503,7 +3527,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then :
+if ${ac_cv_path_install+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3523,7 +3547,7 @@ case $as_dir/ in #((
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
 	  if test $ac_prog = install &&
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
@@ -3583,7 +3607,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 set dummy bison; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_BISON+set}" = set; then :
+if ${ac_cv_path_BISON+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $BISON in
@@ -3597,7 +3621,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_BISON="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3623,7 +3647,7 @@ fi
 set dummy flex; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_FLEX+set}" = set; then :
+if ${ac_cv_path_FLEX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $FLEX in
@@ -3637,7 +3661,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_FLEX="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3663,7 +3687,7 @@ fi
 set dummy perl; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PERL+set}" = set; then :
+if ${ac_cv_path_PERL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PERL in
@@ -3677,7 +3701,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3710,7 +3734,7 @@ if test "x$xapi" = "xy"; then :
 set dummy curl-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CURL+set}" = set; then :
+if ${ac_cv_path_CURL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $CURL in
@@ -3724,7 +3748,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_CURL="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3755,7 +3779,7 @@ fi
 set dummy xml2-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_XML+set}" = set; then :
+if ${ac_cv_path_XML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $XML in
@@ -3769,7 +3793,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_XML="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3806,7 +3830,7 @@ if test "x$ocamltools" = "xy"; then :
 set dummy ${ac_tool_prefix}ocamlc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLC+set}" = set; then :
+if ${ac_cv_prog_OCAMLC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLC"; then
@@ -3818,7 +3842,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLC="${ac_tool_prefix}ocamlc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3846,7 +3870,7 @@ if test -z "$ac_cv_prog_OCAMLC"; then
 set dummy ocamlc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLC"; then
@@ -3858,7 +3882,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLC="ocamlc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3917,7 +3941,7 @@ $as_echo "OCaml library path is $OCAMLLIB" >&6; }
 set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLOPT+set}" = set; then :
+if ${ac_cv_prog_OCAMLOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLOPT"; then
@@ -3929,7 +3953,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLOPT="${ac_tool_prefix}ocamlopt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3957,7 +3981,7 @@ if test -z "$ac_cv_prog_OCAMLOPT"; then
 set dummy ocamlopt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLOPT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLOPT"; then
@@ -3969,7 +3993,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLOPT="ocamlopt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4027,7 +4051,7 @@ $as_echo "versions differs from ocamlc; ocamlopt discarded." >&6; }
 set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLCDOTOPT+set}" = set; then :
+if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLCDOTOPT"; then
@@ -4039,7 +4063,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLCDOTOPT="${ac_tool_prefix}ocamlc.opt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4067,7 +4091,7 @@ if test -z "$ac_cv_prog_OCAMLCDOTOPT"; then
 set dummy ocamlc.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLCDOTOPT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLCDOTOPT"; then
@@ -4079,7 +4103,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLCDOTOPT="ocamlc.opt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4131,7 +4155,7 @@ $as_echo "versions differs from ocamlc; ocamlc.opt discarded." >&6; }
 set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLOPTDOTOPT+set}" = set; then :
+if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLOPTDOTOPT"; then
@@ -4143,7 +4167,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLOPTDOTOPT="${ac_tool_prefix}ocamlopt.opt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4171,7 +4195,7 @@ if test -z "$ac_cv_prog_OCAMLOPTDOTOPT"; then
 set dummy ocamlopt.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
@@ -4183,7 +4207,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="ocamlopt.opt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4240,7 +4264,7 @@ $as_echo "version differs from ocamlc; ocamlopt.opt discarded." >&6; }
 set dummy ${ac_tool_prefix}ocaml; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAML+set}" = set; then :
+if ${ac_cv_prog_OCAML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAML"; then
@@ -4252,7 +4276,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAML="${ac_tool_prefix}ocaml"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4280,7 +4304,7 @@ if test -z "$ac_cv_prog_OCAML"; then
 set dummy ocaml; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAML+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAML"; then
@@ -4292,7 +4316,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAML="ocaml"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4334,7 +4358,7 @@ fi
 set dummy ${ac_tool_prefix}ocamldep; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLDEP+set}" = set; then :
+if ${ac_cv_prog_OCAMLDEP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLDEP"; then
@@ -4346,7 +4370,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLDEP="${ac_tool_prefix}ocamldep"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4374,7 +4398,7 @@ if test -z "$ac_cv_prog_OCAMLDEP"; then
 set dummy ocamldep; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLDEP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLDEP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLDEP"; then
@@ -4386,7 +4410,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLDEP="ocamldep"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4428,7 +4452,7 @@ fi
 set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLMKTOP+set}" = set; then :
+if ${ac_cv_prog_OCAMLMKTOP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLMKTOP"; then
@@ -4440,7 +4464,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLMKTOP="${ac_tool_prefix}ocamlmktop"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4468,7 +4492,7 @@ if test -z "$ac_cv_prog_OCAMLMKTOP"; then
 set dummy ocamlmktop; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLMKTOP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLMKTOP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLMKTOP"; then
@@ -4480,7 +4504,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLMKTOP="ocamlmktop"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4522,7 +4546,7 @@ fi
 set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLMKLIB+set}" = set; then :
+if ${ac_cv_prog_OCAMLMKLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLMKLIB"; then
@@ -4534,7 +4558,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLMKLIB="${ac_tool_prefix}ocamlmklib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4562,7 +4586,7 @@ if test -z "$ac_cv_prog_OCAMLMKLIB"; then
 set dummy ocamlmklib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLMKLIB+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLMKLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLMKLIB"; then
@@ -4574,7 +4598,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLMKLIB="ocamlmklib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4616,7 +4640,7 @@ fi
 set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLDOC+set}" = set; then :
+if ${ac_cv_prog_OCAMLDOC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLDOC"; then
@@ -4628,7 +4652,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLDOC="${ac_tool_prefix}ocamldoc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4656,7 +4680,7 @@ if test -z "$ac_cv_prog_OCAMLDOC"; then
 set dummy ocamldoc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLDOC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLDOC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLDOC"; then
@@ -4668,7 +4692,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLDOC="ocamldoc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4710,7 +4734,7 @@ fi
 set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLBUILD+set}" = set; then :
+if ${ac_cv_prog_OCAMLBUILD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLBUILD"; then
@@ -4722,7 +4746,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLBUILD="${ac_tool_prefix}ocamlbuild"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4750,7 +4774,7 @@ if test -z "$ac_cv_prog_OCAMLBUILD"; then
 set dummy ocamlbuild; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLBUILD+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLBUILD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLBUILD"; then
@@ -4762,7 +4786,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLBUILD="ocamlbuild"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4813,7 +4837,7 @@ fi
 set dummy bash; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_BASH+set}" = set; then :
+if ${ac_cv_path_BASH+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $BASH in
@@ -4827,7 +4851,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_BASH="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4868,7 +4892,7 @@ fi
 set dummy $PYTHON; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PYTHONPATH+set}" = set; then :
+if ${ac_cv_path_PYTHONPATH+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PYTHONPATH in
@@ -4882,7 +4906,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PYTHONPATH="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4935,7 +4959,7 @@ if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then :
+  if ${ac_cv_prog_CPP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -5051,7 +5075,7 @@ else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -5063,7 +5087,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then :
+if ${ac_cv_path_GREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
@@ -5077,7 +5101,7 @@ do
     for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+      as_fn_executable_p "$ac_path_GREP" || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
@@ -5126,7 +5150,7 @@ $as_echo "$ac_cv_path_GREP" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then :
+if ${ac_cv_path_EGREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -5143,7 +5167,7 @@ do
     for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      as_fn_executable_p "$ac_path_EGREP" || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -5193,7 +5217,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
+if ${ac_cv_header_stdc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -5329,7 +5353,7 @@ ac_python_version=`$PYTHON -c 'import distutils.sysconfig; \
 set dummy $PYTHON-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_pyconfig+set}" = set; then :
+if ${ac_cv_path_pyconfig+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $pyconfig in
@@ -5343,7 +5367,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_pyconfig="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5392,7 +5416,7 @@ else
 fi
 
 ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default"
-if test "x$ac_cv_header_Python_h" = x""yes; then :
+if test "x$ac_cv_header_Python_h" = xyes; then :
 
 else
   as_fn_error $? "Unable to find Python development headers" "$LINENO" 5
@@ -5402,7 +5426,7 @@ fi
 as_ac_Lib=`$as_echo "ac_cv_lib_python$ac_python_version''_PyArg_ParseTuple" | $as_tr_sh`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PyArg_ParseTuple in -lpython$ac_python_version" >&5
 $as_echo_n "checking for PyArg_ParseTuple in -lpython$ac_python_version... " >&6; }
-if eval "test \"\${$as_ac_Lib+set}\"" = set; then :
+if eval \${$as_ac_Lib+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5455,7 +5479,7 @@ LDLFAGS=$ac_previous_ldflags
 set dummy xgettext; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_XGETTEXT+set}" = set; then :
+if ${ac_cv_path_XGETTEXT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $XGETTEXT in
@@ -5469,7 +5493,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5502,7 +5526,7 @@ i[3456]86|x86_64)
 set dummy as86; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_AS86+set}" = set; then :
+if ${ac_cv_path_AS86+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $AS86 in
@@ -5516,7 +5540,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_AS86="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5547,7 +5571,7 @@ fi
 set dummy ld86; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_LD86+set}" = set; then :
+if ${ac_cv_path_LD86+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $LD86 in
@@ -5561,7 +5585,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_LD86="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5592,7 +5616,7 @@ fi
 set dummy bcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_BCC+set}" = set; then :
+if ${ac_cv_path_BCC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $BCC in
@@ -5606,7 +5630,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_BCC="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5637,7 +5661,7 @@ fi
 set dummy iasl; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_IASL+set}" = set; then :
+if ${ac_cv_path_IASL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $IASL in
@@ -5651,7 +5675,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_IASL="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5682,11 +5706,11 @@ fi
 esac
 
 ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_uuid_h" = x""yes; then :
+if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5
 $as_echo_n "checking for uuid_clear in -luuid... " >&6; }
-if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then :
+if ${ac_cv_lib_uuid_uuid_clear+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5720,7 +5744,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_clear" >&5
 $as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; }
-if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then :
+if test "x$ac_cv_lib_uuid_uuid_clear" = xyes; then :
   libuuid="y"
 fi
 
@@ -5729,7 +5753,7 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_h" = x""yes; then :
+if test "x$ac_cv_header_uuid_h" = xyes; then :
   libuuid="y"
 fi
 
@@ -5742,11 +5766,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default"
-if test "x$ac_cv_header_curses_h" = x""yes; then :
+if test "x$ac_cv_header_curses_h" = xyes; then :
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clear in -lcurses" >&5
 $as_echo_n "checking for clear in -lcurses... " >&6; }
-if test "${ac_cv_lib_curses_clear+set}" = set; then :
+if ${ac_cv_lib_curses_clear+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5780,7 +5804,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_clear" >&5
 $as_echo "$ac_cv_lib_curses_clear" >&6; }
-if test "x$ac_cv_lib_curses_clear" = x""yes; then :
+if test "x$ac_cv_lib_curses_clear" = xyes; then :
   curses="y"
 else
   curses="n"
@@ -5793,11 +5817,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default"
-if test "x$ac_cv_header_ncurses_h" = x""yes; then :
+if test "x$ac_cv_header_ncurses_h" = xyes; then :
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clear in -lncurses" >&5
 $as_echo_n "checking for clear in -lncurses... " >&6; }
-if test "${ac_cv_lib_ncurses_clear+set}" = set; then :
+if ${ac_cv_lib_ncurses_clear+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5831,7 +5855,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_clear" >&5
 $as_echo "$ac_cv_lib_ncurses_clear" >&6; }
-if test "x$ac_cv_lib_ncurses_clear" = x""yes; then :
+if test "x$ac_cv_lib_ncurses_clear" = xyes; then :
   ncurses="y"
 else
   ncurses="n"
@@ -5878,7 +5902,7 @@ if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -5892,7 +5916,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5921,7 +5945,7 @@ if test -z "$ac_cv_path_PKG_CONFIG"; then
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $ac_pt_PKG_CONFIG in
@@ -5935,7 +5959,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6026,7 +6050,7 @@ fi
 
 
 if test $pkg_failed = yes; then
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 
 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -6053,7 +6077,7 @@ Alternatively, you may set the environment variables glib_CFLAGS
 and glib_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details." "$LINENO" 5
 elif test $pkg_failed = untried; then
-     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@@ -6066,7 +6090,7 @@ and glib_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details.
 
 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 else
 	glib_CFLAGS=$pkg_cv_glib_CFLAGS
 	glib_LIBS=$pkg_cv_glib_LIBS
@@ -6079,7 +6103,7 @@ fi
 set dummy wget; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_WGET+set}" = set; then :
+if ${ac_cv_path_WGET+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $WGET in
@@ -6093,7 +6117,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6126,7 +6150,7 @@ else
 set dummy ftp; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_FTP+set}" = set; then :
+if ${ac_cv_path_FTP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $FTP in
@@ -6140,7 +6164,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_FTP="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6179,11 +6203,11 @@ fi
 
 # Checks for libraries.
 ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_bzlib_h" = x""yes; then :
+if test "x$ac_cv_header_bzlib_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzDecompressInit in -lbz2" >&5
 $as_echo_n "checking for BZ2_bzDecompressInit in -lbz2... " >&6; }
-if test "${ac_cv_lib_bz2_BZ2_bzDecompressInit+set}" = set; then :
+if ${ac_cv_lib_bz2_BZ2_bzDecompressInit+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6217,7 +6241,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzDecompressInit" >&5
 $as_echo "$ac_cv_lib_bz2_BZ2_bzDecompressInit" >&6; }
-if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = x""yes; then :
+if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = xyes; then :
   zlib="$zlib -DHAVE_BZLIB -lbz2"
 fi
 
@@ -6226,11 +6250,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default"
-if test "x$ac_cv_header_lzma_h" = x""yes; then :
+if test "x$ac_cv_header_lzma_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_stream_decoder in -llzma" >&5
 $as_echo_n "checking for lzma_stream_decoder in -llzma... " >&6; }
-if test "${ac_cv_lib_lzma_lzma_stream_decoder+set}" = set; then :
+if ${ac_cv_lib_lzma_lzma_stream_decoder+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6264,7 +6288,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_stream_decoder" >&5
 $as_echo "$ac_cv_lib_lzma_lzma_stream_decoder" >&6; }
-if test "x$ac_cv_lib_lzma_lzma_stream_decoder" = x""yes; then :
+if test "x$ac_cv_lib_lzma_lzma_stream_decoder" = xyes; then :
   zlib="$zlib -DHAVE_LZMA -llzma"
 fi
 
@@ -6273,11 +6297,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "lzo/lzo1x.h" "ac_cv_header_lzo_lzo1x_h" "$ac_includes_default"
-if test "x$ac_cv_header_lzo_lzo1x_h" = x""yes; then :
+if test "x$ac_cv_header_lzo_lzo1x_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzo1x_decompress in -llzo2" >&5
 $as_echo_n "checking for lzo1x_decompress in -llzo2... " >&6; }
-if test "${ac_cv_lib_lzo2_lzo1x_decompress+set}" = set; then :
+if ${ac_cv_lib_lzo2_lzo1x_decompress+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6311,7 +6335,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzo2_lzo1x_decompress" >&5
 $as_echo "$ac_cv_lib_lzo2_lzo1x_decompress" >&6; }
-if test "x$ac_cv_lib_lzo2_lzo1x_decompress" = x""yes; then :
+if test "x$ac_cv_lib_lzo2_lzo1x_decompress" = xyes; then :
   zlib="$zlib -DHAVE_LZO1X -llzo2"
 fi
 
@@ -6322,7 +6346,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for io_setup in -laio" >&5
 $as_echo_n "checking for io_setup in -laio... " >&6; }
-if test "${ac_cv_lib_aio_io_setup+set}" = set; then :
+if ${ac_cv_lib_aio_io_setup+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6356,7 +6380,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_aio_io_setup" >&5
 $as_echo "$ac_cv_lib_aio_io_setup" >&6; }
-if test "x$ac_cv_lib_aio_io_setup" = x""yes; then :
+if test "x$ac_cv_lib_aio_io_setup" = xyes; then :
   system_aio="y"
 else
   system_aio="n"
@@ -6365,7 +6389,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5 in -lcrypto" >&5
 $as_echo_n "checking for MD5 in -lcrypto... " >&6; }
-if test "${ac_cv_lib_crypto_MD5+set}" = set; then :
+if ${ac_cv_lib_crypto_MD5+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6399,7 +6423,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5" >&5
 $as_echo "$ac_cv_lib_crypto_MD5" >&6; }
-if test "x$ac_cv_lib_crypto_MD5" = x""yes; then :
+if test "x$ac_cv_lib_crypto_MD5" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBCRYPTO 1
 _ACEOF
@@ -6412,11 +6436,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "ext2fs/ext2fs.h" "ac_cv_header_ext2fs_ext2fs_h" "$ac_includes_default"
-if test "x$ac_cv_header_ext2fs_ext2fs_h" = x""yes; then :
+if test "x$ac_cv_header_ext2fs_ext2fs_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ext2fs_open2 in -lext2fs" >&5
 $as_echo_n "checking for ext2fs_open2 in -lext2fs... " >&6; }
-if test "${ac_cv_lib_ext2fs_ext2fs_open2+set}" = set; then :
+if ${ac_cv_lib_ext2fs_ext2fs_open2+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6450,7 +6474,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext2fs_ext2fs_open2" >&5
 $as_echo "$ac_cv_lib_ext2fs_ext2fs_open2" >&6; }
-if test "x$ac_cv_lib_ext2fs_ext2fs_open2" = x""yes; then :
+if test "x$ac_cv_lib_ext2fs_ext2fs_open2" = xyes; then :
 
 
 $as_echo "#define INCLUDE_EXTFS_H <ext2fs/ext2fs.h>" >>confdefs.h
@@ -6464,11 +6488,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "ext4fs/ext2fs.h" "ac_cv_header_ext4fs_ext2fs_h" "$ac_includes_default"
-if test "x$ac_cv_header_ext4fs_ext2fs_h" = x""yes; then :
+if test "x$ac_cv_header_ext4fs_ext2fs_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ext2fs_open2 in -lext4fs" >&5
 $as_echo_n "checking for ext2fs_open2 in -lext4fs... " >&6; }
-if test "${ac_cv_lib_ext4fs_ext2fs_open2+set}" = set; then :
+if ${ac_cv_lib_ext4fs_ext2fs_open2+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6502,7 +6526,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext4fs_ext2fs_open2" >&5
 $as_echo "$ac_cv_lib_ext4fs_ext2fs_open2" >&6; }
-if test "x$ac_cv_lib_ext4fs_ext2fs_open2" = x""yes; then :
+if test "x$ac_cv_lib_ext4fs_ext2fs_open2" = xyes; then :
 
 
 $as_echo "#define INCLUDE_EXTFS_H <ext4fs/ext2fs.h>" >>confdefs.h
@@ -6519,7 +6543,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_md_hash_buffer in -lgcrypt" >&5
 $as_echo_n "checking for gcry_md_hash_buffer in -lgcrypt... " >&6; }
-if test "${ac_cv_lib_gcrypt_gcry_md_hash_buffer+set}" = set; then :
+if ${ac_cv_lib_gcrypt_gcry_md_hash_buffer+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6553,7 +6577,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcrypt_gcry_md_hash_buffer" >&5
 $as_echo "$ac_cv_lib_gcrypt_gcry_md_hash_buffer" >&6; }
-if test "x$ac_cv_lib_gcrypt_gcry_md_hash_buffer" = x""yes; then :
+if test "x$ac_cv_lib_gcrypt_gcry_md_hash_buffer" = xyes; then :
   libgcrypt="y"
 else
   libgcrypt="n"
@@ -6563,7 +6587,7 @@ fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread flag" >&5
 $as_echo_n "checking for pthread flag... " >&6; }
-if test "${ax_cv_pthread_flags+set}" = set; then :
+if ${ax_cv_pthread_flags+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -6631,7 +6655,7 @@ $as_echo "$ax_cv_pthread_flags" >&6; }
 
     CPPFLAGS="$CPPFLAGS -Werror"
     ac_fn_c_check_header_mongrel "$LINENO" "libutil.h" "ac_cv_header_libutil_h" "$ac_includes_default"
-if test "x$ac_cv_header_libutil_h" = x""yes; then :
+if test "x$ac_cv_header_libutil_h" = xyes; then :
 
 
 $as_echo "#define INCLUDE_LIBUTIL_H <libutil.h>" >>confdefs.h
@@ -6645,7 +6669,7 @@ fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty et al" >&5
 $as_echo_n "checking for openpty et al... " >&6; }
-if test "${ax_cv_ptyfuncs_libs+set}" = set; then :
+if ${ax_cv_ptyfuncs_libs+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -6654,7 +6678,7 @@ else
                 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "Unable to find library for openpty and login_tty
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
             fi
 
     saved_LIBS="$LIBS"
@@ -6692,7 +6716,7 @@ $as_echo "$ax_cv_ptyfuncs_libs" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
 $as_echo_n "checking for yajl_alloc in -lyajl... " >&6; }
-if test "${ac_cv_lib_yajl_yajl_alloc+set}" = set; then :
+if ${ac_cv_lib_yajl_yajl_alloc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6726,7 +6750,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_yajl_yajl_alloc" >&5
 $as_echo "$ac_cv_lib_yajl_yajl_alloc" >&6; }
-if test "x$ac_cv_lib_yajl_yajl_alloc" = x""yes; then :
+if test "x$ac_cv_lib_yajl_yajl_alloc" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBYAJL 1
 _ACEOF
@@ -6739,7 +6763,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflateCopy in -lz" >&5
 $as_echo_n "checking for deflateCopy in -lz... " >&6; }
-if test "${ac_cv_lib_z_deflateCopy+set}" = set; then :
+if ${ac_cv_lib_z_deflateCopy+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6773,7 +6797,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflateCopy" >&5
 $as_echo "$ac_cv_lib_z_deflateCopy" >&6; }
-if test "x$ac_cv_lib_z_deflateCopy" = x""yes; then :
+if test "x$ac_cv_lib_z_deflateCopy" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBZ 1
 _ACEOF
@@ -6786,7 +6810,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5
 $as_echo_n "checking for libiconv_open in -liconv... " >&6; }
-if test "${ac_cv_lib_iconv_libiconv_open+set}" = set; then :
+if ${ac_cv_lib_iconv_libiconv_open+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6820,7 +6844,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5
 $as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; }
-if test "x$ac_cv_lib_iconv_libiconv_open" = x""yes; then :
+if test "x$ac_cv_lib_iconv_libiconv_open" = xyes; then :
   libiconv="y"
 else
   libiconv="n"
@@ -6832,7 +6856,7 @@ fi
 for ac_header in yajl/yajl_version.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "yajl/yajl_version.h" "ac_cv_header_yajl_yajl_version_h" "$ac_includes_default"
-if test "x$ac_cv_header_yajl_yajl_version_h" = x""yes; then :
+if test "x$ac_cv_header_yajl_yajl_version_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_YAJL_YAJL_VERSION_H 1
 _ACEOF
@@ -6906,10 +6930,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
-    test "x$cache_file" != "x/dev/null" &&
+    if test "x$cache_file" != "x/dev/null"; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
-    cat confcache >$cache_file
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
@@ -6941,7 +6976,7 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-: ${CONFIG_STATUS=./config.status}
+: "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -7042,6 +7077,7 @@ fi
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -7237,16 +7273,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -7306,28 +7342,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -7348,8 +7372,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by Xen Hypervisor $as_me 4.3, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
+This file was extended by Xen Hypervisor Tools $as_me 4.3, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -7405,17 +7429,17 @@ Configuration headers:
 $config_headers
 
 Report bugs to <xen-devel@lists.xen.org>.
-Xen Hypervisor home page: <http://www.xen.org/>."
+Xen Hypervisor Tools home page: <http://www.xen.org/>."
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-Xen Hypervisor config.status 4.3
-configured by $0, generated by GNU Autoconf 2.67,
+Xen Hypervisor Tools config.status 4.3
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -7504,7 +7528,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -7536,7 +7560,7 @@ do
     "../config/Tools.mk") CONFIG_FILES="$CONFIG_FILES ../config/Tools.mk" ;;
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
 
-  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
@@ -7558,9 +7582,10 @@ fi
 # after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  tmp=
+  tmp= ac_tmp=
   trap 'exit_status=$?
-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
 ' 0
   trap 'as_fn_exit 1' 1 2 13 15
 }
@@ -7568,12 +7593,13 @@ $debug ||
 
 {
   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
+  test -d "$tmp"
 }  ||
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -7595,7 +7621,7 @@ else
   ac_cs_awk_cr=$ac_cr
 fi
 
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
 _ACEOF
 
 
@@ -7623,7 +7649,7 @@ done
 rm -f conf$$subs.sh
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
 sed -n '
 h
@@ -7671,7 +7697,7 @@ t delim
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = ""
 
@@ -7703,7 +7729,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 else
   cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
   || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
@@ -7737,7 +7763,7 @@ fi # test -n "$CONFIG_FILES"
 # No need to generate them if there are no CONFIG_HEADERS.
 # This happens for instance with `./config.status Makefile'.
 if test -n "$CONFIG_HEADERS"; then
-cat >"$tmp/defines.awk" <<\_ACAWK ||
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
@@ -7749,8 +7775,8 @@ _ACEOF
 # handling of long lines.
 ac_delim='%!_!# '
 for ac_last_try in false false :; do
-  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_t"; then
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
     break
   elif $ac_last_try; then
     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
@@ -7851,7 +7877,7 @@ do
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -7870,7 +7896,7 @@ do
     for ac_f
     do
       case $ac_f in
-      -) ac_f="$tmp/stdin";;
+      -) ac_f="$ac_tmp/stdin";;
       *) # Look for the file first in the build tree, then in the source tree
 	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
 	 # because $ac_f cannot contain `:'.
@@ -7879,7 +7905,7 @@ do
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
       as_fn_append ac_file_inputs " '$ac_f'"
@@ -7905,8 +7931,8 @@ $as_echo "$as_me: creating $ac_file" >&6;}
     esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5  ;;
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -8036,21 +8062,22 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
 s&@INSTALL@&$ac_INSTALL&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&2;}
 
-  rm -f "$tmp/stdin"
+  rm -f "$ac_tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out" && rm -f "$tmp/out";;
-  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
   esac \
   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
@@ -8061,20 +8088,20 @@ which seems to be undefined.  Please make sure it is defined" >&2;}
   if test x"$ac_file" != x-; then
     {
       $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
-    } >"$tmp/config.h" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
-      mv "$tmp/config.h" "$ac_file" \
+      mv "$ac_tmp/config.h" "$ac_file" \
 	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
       || as_fn_error $? "could not create -" "$LINENO" 5
   fi
  ;;
diff --git a/tools/configure.ac b/tools/configure.ac
index 971e3e9..9924852 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.67])
-AC_INIT([Xen Hypervisor], m4_esyscmd([../version.sh ../xen/Makefile]),
+AC_INIT([Xen Hypervisor Tools], m4_esyscmd([../version.sh ../xen/Makefile]),
     [xen-devel@lists.xen.org], [xen], [http://www.xen.org/])
 AC_CONFIG_SRCDIR([libxl/libxl.c])
 AC_CONFIG_FILES([../config/Tools.mk])
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:36:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:36:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te829-00080u-UJ; Thu, 29 Nov 2012 17:36:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te827-0007zW-Nn
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:36:20 +0000
Received: from [85.158.139.211:51984] by server-3.bemta-5.messagelabs.com id
	9C/63-18736-21D97B05; Thu, 29 Nov 2012 17:36:18 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-14.tower-206.messagelabs.com!1354210558!18366979!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_23,UNPARSEABLE_RELAY,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27372 invoked from network); 29 Nov 2012 17:35:59 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:35:59 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158386752;
	Thu, 29 Nov 2012 12:35:48 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com
Date: Thu, 29 Nov 2012 12:35:34 -0500
Message-Id: <1354210534-31052-8-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [VTPM v5 7/7] Add a real top level configure script
	that calls the others
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 autogen.sh         |    1 +
 configure          | 3013 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 configure.ac       |   14 +
 tools/configure    |  601 ++++++-----
 tools/configure.ac |    2 +-
 5 files changed, 3341 insertions(+), 290 deletions(-)
 create mode 100644 configure.ac

diff --git a/autogen.sh b/autogen.sh
index ada482c..1456d94 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,4 +1,5 @@
 #!/bin/sh -e
+autoconf
 cd tools
 autoconf
 autoheader
diff --git a/configure b/configure
index ba3bc39..3284a46 100755
--- a/configure
+++ b/configure
@@ -1,2 +1,3011 @@
-#!/bin/sh -e
-cd tools && ./configure $@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for Xen Hypervisor 4.3.
+#
+# Report bugs to <xen-devel@lists.xen.org>.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     # Try only shells that exist, to save several forks.
+	     as_shell=$as_dir/$as_base
+	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+	   done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: xen-devel@lists.xen.org about your system, including
+$0: any error possibly output before this message. Then
+$0: install a modern shell, or manually run the script
+$0: under such a shell if you do have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='Xen Hypervisor'
+PACKAGE_TARNAME='xen'
+PACKAGE_VERSION='4.3'
+PACKAGE_STRING='Xen Hypervisor 4.3'
+PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
+PACKAGE_URL='http://www.xen.org/'
+
+ac_unique_file="./tools/libxl/libxl.c"
+ac_default_prefix=/usr
+enable_option_checking=no
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+subdirs
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias'
+ac_subdirs_all='tools stubdom'
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures Xen Hypervisor 4.3 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking ...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/xen]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of Xen Hypervisor 4.3:";;
+   esac
+  cat <<\_ACEOF
+
+Report bugs to <xen-devel@lists.xen.org>.
+Xen Hypervisor home page: <http://www.xen.org/>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+Xen Hypervisor configure 4.3
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by Xen Hypervisor $as_me 4.3, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append ac_configure_args1 " '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+ac_config_files="$ac_config_files ./config/Tools.mk"
+
+
+ac_aux_dir=
+for ac_dir in . "$srcdir"/.; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in . \"$srcdir\"/." "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+
+
+
+subdirs="$subdirs tools stubdom"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then branch to the quote section.  Otherwise,
+# look for a macro that doesn't take arguments.
+ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
+t clear
+:clear
+s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\)/-D\1=\2/g
+t quote
+s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)/-D\1=\2/g
+t quote
+b any
+:quote
+s/[	 `~#$^&*(){}\\|;'\''"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
+H
+:any
+${
+	g
+	s/^\n//
+	s/\n/ /g
+	p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
+
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by Xen Hypervisor $as_me 4.3, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to <xen-devel@lists.xen.org>.
+Xen Hypervisor home page: <http://www.xen.org/>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+Xen Hypervisor config.status 4.3
+configured by $0, generated by GNU Autoconf 2.69,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=?*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h |  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "./config/Tools.mk") CONFIG_FILES="$CONFIG_FILES ./config/Tools.mk" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
+h
+s///
+s/^/:/
+s/[	 ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[	 ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+
+eval set X "  :F $CONFIG_FILES      "
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$ac_tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$ac_tmp/stdin"
+  case $ac_file in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+
+
+
+  esac
+
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || as_fn_exit 1
+fi
+
+#
+# CONFIG_SUBDIRS section.
+#
+if test "$no_recursion" != yes; then
+
+  # Remove --cache-file, --srcdir, and --disable-option-checking arguments
+  # so they do not pile up.
+  ac_sub_configure_args=
+  ac_prev=
+  eval "set x $ac_configure_args"
+  shift
+  for ac_arg
+  do
+    if test -n "$ac_prev"; then
+      ac_prev=
+      continue
+    fi
+    case $ac_arg in
+    -cache-file | --cache-file | --cache-fil | --cache-fi \
+    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+      ac_prev=cache_file ;;
+    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
+    | --c=*)
+      ;;
+    --config-cache | -C)
+      ;;
+    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+      ac_prev=srcdir ;;
+    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+      ;;
+    -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+      ac_prev=prefix ;;
+    -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+      ;;
+    --disable-option-checking)
+      ;;
+    *)
+      case $ac_arg in
+      *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+      esac
+      as_fn_append ac_sub_configure_args " '$ac_arg'" ;;
+    esac
+  done
+
+  # Always prepend --prefix to ensure using the same prefix
+  # in subdir configurations.
+  ac_arg="--prefix=$prefix"
+  case $ac_arg in
+  *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+  esac
+  ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
+
+  # Pass --silent
+  if test "$silent" = yes; then
+    ac_sub_configure_args="--silent $ac_sub_configure_args"
+  fi
+
+  # Always prepend --disable-option-checking to silence warnings, since
+  # different subdirs can have different --enable and --with options.
+  ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"
+
+  ac_popdir=`pwd`
+  for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
+
+    # Do not complain, so a configure script can configure whichever
+    # parts of a large source tree are present.
+    test -d "$srcdir/$ac_dir" || continue
+
+    ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
+    $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5
+    $as_echo "$ac_msg" >&6
+    as_dir="$ac_dir"; as_fn_mkdir_p
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+    cd "$ac_dir"
+
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      ac_sub_configure=$ac_srcdir/configure.gnu
+    elif test -f "$ac_srcdir/configure"; then
+      ac_sub_configure=$ac_srcdir/configure
+    elif test -f "$ac_srcdir/configure.in"; then
+      # This should be Cygnus configure.
+      ac_sub_configure=$ac_aux_dir/configure
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5
+$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
+      ac_sub_configure=
+    fi
+
+    # The recursion is here.
+    if test -n "$ac_sub_configure"; then
+      # Make the cache file name correct relative to the subdirectory.
+      case $cache_file in
+      [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;;
+      *) # Relative name.
+	ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
+      esac
+
+      { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
+$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
+      # The eval makes quoting arguments work.
+      eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
+	   --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
+	as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5
+    fi
+
+    cd "$ac_popdir"
+  done
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..3a6339c
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,14 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.67])
+AC_INIT([Xen Hypervisor], m4_esyscmd([./version.sh ./xen/Makefile]),
+    [xen-devel@lists.xen.org], [xen], [http://www.xen.org/])
+AC_CONFIG_SRCDIR([./tools/libxl/libxl.c])
+AC_CONFIG_FILES([./config/Tools.mk])
+AC_PREFIX_DEFAULT([/usr])
+AC_CONFIG_AUX_DIR([.])
+
+AC_CONFIG_SUBDIRS([tools stubdom])
+
+AC_OUTPUT()
diff --git a/tools/configure b/tools/configure
index 1168436..fbd48a8 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1,13 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for Xen Hypervisor 4.3.
+# Generated by GNU Autoconf 2.69 for Xen Hypervisor Tools 4.3.
 #
 # Report bugs to <xen-devel@lists.xen.org>.
 #
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -91,6 +89,7 @@ fi
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -135,6 +134,31 @@ export LANGUAGE
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
@@ -168,7 +192,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -213,14 +238,25 @@ IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-	# neutralization value for shells without unset; and this also
-	# works around shells that cannot unset nonexistent variables.
-	BASH_ENV=/dev/null
-	ENV=/dev/null
-	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-	export CONFIG_SHELL
-	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
 fi
 
     if test x$as_have_required = xno; then :
@@ -323,6 +359,14 @@ $as_echo X"$as_dir" |
 
 
 } # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -444,6 +488,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -478,16 +526,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -499,28 +547,8 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -550,10 +578,10 @@ MFLAGS=
 MAKEFLAGS=
 
 # Identity of this package.
-PACKAGE_NAME='Xen Hypervisor'
+PACKAGE_NAME='Xen Hypervisor Tools'
 PACKAGE_TARNAME='xen'
 PACKAGE_VERSION='4.3'
-PACKAGE_STRING='Xen Hypervisor 4.3'
+PACKAGE_STRING='Xen Hypervisor Tools 4.3'
 PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='http://www.xen.org/'
 
@@ -1164,7 +1192,7 @@ Try \`$0 --help' for more information"
     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
   esac
@@ -1215,8 +1243,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1302,7 +1328,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Xen Hypervisor 4.3 to adapt to many kinds of systems.
+\`configure' configures Xen Hypervisor Tools 4.3 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1367,7 +1393,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Xen Hypervisor 4.3:";;
+     short | recursive ) echo "Configuration of Xen Hypervisor Tools 4.3:";;
    esac
   cat <<\_ACEOF
 
@@ -1427,7 +1453,7 @@ Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
 Report bugs to <xen-devel@lists.xen.org>.
-Xen Hypervisor home page: <http://www.xen.org/>.
+Xen Hypervisor Tools home page: <http://www.xen.org/>.
 _ACEOF
 ac_status=$?
 fi
@@ -1490,10 +1516,10 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Xen Hypervisor configure 4.3
-generated by GNU Autoconf 2.67
+Xen Hypervisor Tools configure 4.3
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1537,7 +1563,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_compile
@@ -1574,7 +1600,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
     ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_cpp
@@ -1587,10 +1613,10 @@ fi
 ac_fn_c_check_header_mongrel ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval "test \"\${$3+set}\"" = set; then :
+  if eval \${$3+:} false; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
@@ -1657,7 +1683,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
@@ -1666,7 +1692,7 @@ eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_mongrel
 
@@ -1707,7 +1733,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
        ac_retval=$ac_status
 fi
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_run
@@ -1721,7 +1747,7 @@ ac_fn_c_check_header_compile ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1739,7 +1765,7 @@ fi
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_compile
 
@@ -1770,7 +1796,7 @@ $as_echo "$ac_try_echo"; } >&5
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
 	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
+	 test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -1784,7 +1810,7 @@ fi
   # interfere with the next link command; also delete a directory that is
   # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
@@ -1792,8 +1818,8 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Xen Hypervisor $as_me 4.3, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
+It was created by Xen Hypervisor Tools $as_me 4.3, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -2051,7 +2077,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;}
       || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
@@ -2195,7 +2221,7 @@ $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
 $as_echo_n "checking build system type... " >&6; }
-if test "${ac_cv_build+set}" = set; then :
+if ${ac_cv_build+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
@@ -2211,7 +2237,7 @@ fi
 $as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
 esac
 build=$ac_cv_build
 ac_save_IFS=$IFS; IFS='-'
@@ -2229,7 +2255,7 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
 $as_echo_n "checking host system type... " >&6; }
-if test "${ac_cv_host+set}" = set; then :
+if ${ac_cv_host+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
@@ -2244,7 +2270,7 @@ fi
 $as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
 esac
 host=$ac_cv_host
 ac_save_IFS=$IFS; IFS='-'
@@ -2308,7 +2334,6 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 
-
 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 # serial 1 (pkg-config-0.24)
 #
@@ -2675,7 +2700,7 @@ if test -n "$ac_tool_prefix"; then
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2687,7 +2712,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2715,7 +2740,7 @@ if test -z "$ac_cv_prog_CC"; then
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2727,7 +2752,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2768,7 +2793,7 @@ if test -z "$CC"; then
 set dummy ${ac_tool_prefix}cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2780,7 +2805,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2808,7 +2833,7 @@ if test -z "$CC"; then
 set dummy cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2821,7 +2846,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -2867,7 +2892,7 @@ if test -z "$CC"; then
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2879,7 +2904,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2911,7 +2936,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2923,7 +2948,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2966,7 +2991,7 @@ fi
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -3081,7 +3106,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
@@ -3124,7 +3149,7 @@ else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -3183,7 +3208,7 @@ $as_echo "$ac_try_echo"; } >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
     fi
   fi
 fi
@@ -3194,7 +3219,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
 ac_clean_files=$ac_clean_files_save
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then :
+if ${ac_cv_objext+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3235,7 +3260,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
@@ -3245,7 +3270,7 @@ OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3282,7 +3307,7 @@ ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -3360,7 +3385,7 @@ else
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -3369,8 +3394,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -3459,7 +3483,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -3503,7 +3527,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then :
+if ${ac_cv_path_install+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3523,7 +3547,7 @@ case $as_dir/ in #((
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
 	  if test $ac_prog = install &&
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
@@ -3583,7 +3607,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 set dummy bison; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_BISON+set}" = set; then :
+if ${ac_cv_path_BISON+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $BISON in
@@ -3597,7 +3621,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_BISON="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3623,7 +3647,7 @@ fi
 set dummy flex; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_FLEX+set}" = set; then :
+if ${ac_cv_path_FLEX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $FLEX in
@@ -3637,7 +3661,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_FLEX="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3663,7 +3687,7 @@ fi
 set dummy perl; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PERL+set}" = set; then :
+if ${ac_cv_path_PERL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PERL in
@@ -3677,7 +3701,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3710,7 +3734,7 @@ if test "x$xapi" = "xy"; then :
 set dummy curl-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CURL+set}" = set; then :
+if ${ac_cv_path_CURL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $CURL in
@@ -3724,7 +3748,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_CURL="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3755,7 +3779,7 @@ fi
 set dummy xml2-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_XML+set}" = set; then :
+if ${ac_cv_path_XML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $XML in
@@ -3769,7 +3793,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_XML="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3806,7 +3830,7 @@ if test "x$ocamltools" = "xy"; then :
 set dummy ${ac_tool_prefix}ocamlc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLC+set}" = set; then :
+if ${ac_cv_prog_OCAMLC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLC"; then
@@ -3818,7 +3842,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLC="${ac_tool_prefix}ocamlc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3846,7 +3870,7 @@ if test -z "$ac_cv_prog_OCAMLC"; then
 set dummy ocamlc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLC"; then
@@ -3858,7 +3882,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLC="ocamlc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3917,7 +3941,7 @@ $as_echo "OCaml library path is $OCAMLLIB" >&6; }
 set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLOPT+set}" = set; then :
+if ${ac_cv_prog_OCAMLOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLOPT"; then
@@ -3929,7 +3953,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLOPT="${ac_tool_prefix}ocamlopt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3957,7 +3981,7 @@ if test -z "$ac_cv_prog_OCAMLOPT"; then
 set dummy ocamlopt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLOPT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLOPT"; then
@@ -3969,7 +3993,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLOPT="ocamlopt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4027,7 +4051,7 @@ $as_echo "versions differs from ocamlc; ocamlopt discarded." >&6; }
 set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLCDOTOPT+set}" = set; then :
+if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLCDOTOPT"; then
@@ -4039,7 +4063,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLCDOTOPT="${ac_tool_prefix}ocamlc.opt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4067,7 +4091,7 @@ if test -z "$ac_cv_prog_OCAMLCDOTOPT"; then
 set dummy ocamlc.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLCDOTOPT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLCDOTOPT"; then
@@ -4079,7 +4103,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLCDOTOPT="ocamlc.opt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4131,7 +4155,7 @@ $as_echo "versions differs from ocamlc; ocamlc.opt discarded." >&6; }
 set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLOPTDOTOPT+set}" = set; then :
+if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLOPTDOTOPT"; then
@@ -4143,7 +4167,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLOPTDOTOPT="${ac_tool_prefix}ocamlopt.opt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4171,7 +4195,7 @@ if test -z "$ac_cv_prog_OCAMLOPTDOTOPT"; then
 set dummy ocamlopt.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
@@ -4183,7 +4207,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="ocamlopt.opt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4240,7 +4264,7 @@ $as_echo "version differs from ocamlc; ocamlopt.opt discarded." >&6; }
 set dummy ${ac_tool_prefix}ocaml; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAML+set}" = set; then :
+if ${ac_cv_prog_OCAML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAML"; then
@@ -4252,7 +4276,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAML="${ac_tool_prefix}ocaml"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4280,7 +4304,7 @@ if test -z "$ac_cv_prog_OCAML"; then
 set dummy ocaml; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAML+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAML"; then
@@ -4292,7 +4316,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAML="ocaml"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4334,7 +4358,7 @@ fi
 set dummy ${ac_tool_prefix}ocamldep; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLDEP+set}" = set; then :
+if ${ac_cv_prog_OCAMLDEP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLDEP"; then
@@ -4346,7 +4370,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLDEP="${ac_tool_prefix}ocamldep"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4374,7 +4398,7 @@ if test -z "$ac_cv_prog_OCAMLDEP"; then
 set dummy ocamldep; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLDEP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLDEP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLDEP"; then
@@ -4386,7 +4410,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLDEP="ocamldep"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4428,7 +4452,7 @@ fi
 set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLMKTOP+set}" = set; then :
+if ${ac_cv_prog_OCAMLMKTOP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLMKTOP"; then
@@ -4440,7 +4464,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLMKTOP="${ac_tool_prefix}ocamlmktop"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4468,7 +4492,7 @@ if test -z "$ac_cv_prog_OCAMLMKTOP"; then
 set dummy ocamlmktop; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLMKTOP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLMKTOP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLMKTOP"; then
@@ -4480,7 +4504,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLMKTOP="ocamlmktop"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4522,7 +4546,7 @@ fi
 set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLMKLIB+set}" = set; then :
+if ${ac_cv_prog_OCAMLMKLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLMKLIB"; then
@@ -4534,7 +4558,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLMKLIB="${ac_tool_prefix}ocamlmklib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4562,7 +4586,7 @@ if test -z "$ac_cv_prog_OCAMLMKLIB"; then
 set dummy ocamlmklib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLMKLIB+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLMKLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLMKLIB"; then
@@ -4574,7 +4598,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLMKLIB="ocamlmklib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4616,7 +4640,7 @@ fi
 set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLDOC+set}" = set; then :
+if ${ac_cv_prog_OCAMLDOC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLDOC"; then
@@ -4628,7 +4652,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLDOC="${ac_tool_prefix}ocamldoc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4656,7 +4680,7 @@ if test -z "$ac_cv_prog_OCAMLDOC"; then
 set dummy ocamldoc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLDOC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLDOC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLDOC"; then
@@ -4668,7 +4692,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLDOC="ocamldoc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4710,7 +4734,7 @@ fi
 set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OCAMLBUILD+set}" = set; then :
+if ${ac_cv_prog_OCAMLBUILD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLBUILD"; then
@@ -4722,7 +4746,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OCAMLBUILD="${ac_tool_prefix}ocamlbuild"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4750,7 +4774,7 @@ if test -z "$ac_cv_prog_OCAMLBUILD"; then
 set dummy ocamlbuild; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OCAMLBUILD+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLBUILD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLBUILD"; then
@@ -4762,7 +4786,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OCAMLBUILD="ocamlbuild"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4813,7 +4837,7 @@ fi
 set dummy bash; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_BASH+set}" = set; then :
+if ${ac_cv_path_BASH+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $BASH in
@@ -4827,7 +4851,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_BASH="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4868,7 +4892,7 @@ fi
 set dummy $PYTHON; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PYTHONPATH+set}" = set; then :
+if ${ac_cv_path_PYTHONPATH+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PYTHONPATH in
@@ -4882,7 +4906,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PYTHONPATH="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4935,7 +4959,7 @@ if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then :
+  if ${ac_cv_prog_CPP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -5051,7 +5075,7 @@ else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -5063,7 +5087,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then :
+if ${ac_cv_path_GREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
@@ -5077,7 +5101,7 @@ do
     for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+      as_fn_executable_p "$ac_path_GREP" || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
@@ -5126,7 +5150,7 @@ $as_echo "$ac_cv_path_GREP" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then :
+if ${ac_cv_path_EGREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -5143,7 +5167,7 @@ do
     for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      as_fn_executable_p "$ac_path_EGREP" || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -5193,7 +5217,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
+if ${ac_cv_header_stdc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -5329,7 +5353,7 @@ ac_python_version=`$PYTHON -c 'import distutils.sysconfig; \
 set dummy $PYTHON-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_pyconfig+set}" = set; then :
+if ${ac_cv_path_pyconfig+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $pyconfig in
@@ -5343,7 +5367,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_pyconfig="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5392,7 +5416,7 @@ else
 fi
 
 ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default"
-if test "x$ac_cv_header_Python_h" = x""yes; then :
+if test "x$ac_cv_header_Python_h" = xyes; then :
 
 else
   as_fn_error $? "Unable to find Python development headers" "$LINENO" 5
@@ -5402,7 +5426,7 @@ fi
 as_ac_Lib=`$as_echo "ac_cv_lib_python$ac_python_version''_PyArg_ParseTuple" | $as_tr_sh`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PyArg_ParseTuple in -lpython$ac_python_version" >&5
 $as_echo_n "checking for PyArg_ParseTuple in -lpython$ac_python_version... " >&6; }
-if eval "test \"\${$as_ac_Lib+set}\"" = set; then :
+if eval \${$as_ac_Lib+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5455,7 +5479,7 @@ LDLFAGS=$ac_previous_ldflags
 set dummy xgettext; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_XGETTEXT+set}" = set; then :
+if ${ac_cv_path_XGETTEXT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $XGETTEXT in
@@ -5469,7 +5493,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5502,7 +5526,7 @@ i[3456]86|x86_64)
 set dummy as86; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_AS86+set}" = set; then :
+if ${ac_cv_path_AS86+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $AS86 in
@@ -5516,7 +5540,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_AS86="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5547,7 +5571,7 @@ fi
 set dummy ld86; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_LD86+set}" = set; then :
+if ${ac_cv_path_LD86+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $LD86 in
@@ -5561,7 +5585,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_LD86="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5592,7 +5616,7 @@ fi
 set dummy bcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_BCC+set}" = set; then :
+if ${ac_cv_path_BCC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $BCC in
@@ -5606,7 +5630,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_BCC="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5637,7 +5661,7 @@ fi
 set dummy iasl; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_IASL+set}" = set; then :
+if ${ac_cv_path_IASL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $IASL in
@@ -5651,7 +5675,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_IASL="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5682,11 +5706,11 @@ fi
 esac
 
 ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_uuid_h" = x""yes; then :
+if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5
 $as_echo_n "checking for uuid_clear in -luuid... " >&6; }
-if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then :
+if ${ac_cv_lib_uuid_uuid_clear+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5720,7 +5744,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_clear" >&5
 $as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; }
-if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then :
+if test "x$ac_cv_lib_uuid_uuid_clear" = xyes; then :
   libuuid="y"
 fi
 
@@ -5729,7 +5753,7 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_h" = x""yes; then :
+if test "x$ac_cv_header_uuid_h" = xyes; then :
   libuuid="y"
 fi
 
@@ -5742,11 +5766,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default"
-if test "x$ac_cv_header_curses_h" = x""yes; then :
+if test "x$ac_cv_header_curses_h" = xyes; then :
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clear in -lcurses" >&5
 $as_echo_n "checking for clear in -lcurses... " >&6; }
-if test "${ac_cv_lib_curses_clear+set}" = set; then :
+if ${ac_cv_lib_curses_clear+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5780,7 +5804,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_clear" >&5
 $as_echo "$ac_cv_lib_curses_clear" >&6; }
-if test "x$ac_cv_lib_curses_clear" = x""yes; then :
+if test "x$ac_cv_lib_curses_clear" = xyes; then :
   curses="y"
 else
   curses="n"
@@ -5793,11 +5817,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default"
-if test "x$ac_cv_header_ncurses_h" = x""yes; then :
+if test "x$ac_cv_header_ncurses_h" = xyes; then :
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clear in -lncurses" >&5
 $as_echo_n "checking for clear in -lncurses... " >&6; }
-if test "${ac_cv_lib_ncurses_clear+set}" = set; then :
+if ${ac_cv_lib_ncurses_clear+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5831,7 +5855,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_clear" >&5
 $as_echo "$ac_cv_lib_ncurses_clear" >&6; }
-if test "x$ac_cv_lib_ncurses_clear" = x""yes; then :
+if test "x$ac_cv_lib_ncurses_clear" = xyes; then :
   ncurses="y"
 else
   ncurses="n"
@@ -5878,7 +5902,7 @@ if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -5892,7 +5916,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5921,7 +5945,7 @@ if test -z "$ac_cv_path_PKG_CONFIG"; then
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $ac_pt_PKG_CONFIG in
@@ -5935,7 +5959,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6026,7 +6050,7 @@ fi
 
 
 if test $pkg_failed = yes; then
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 
 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -6053,7 +6077,7 @@ Alternatively, you may set the environment variables glib_CFLAGS
 and glib_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details." "$LINENO" 5
 elif test $pkg_failed = untried; then
-     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@@ -6066,7 +6090,7 @@ and glib_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details.
 
 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 else
 	glib_CFLAGS=$pkg_cv_glib_CFLAGS
 	glib_LIBS=$pkg_cv_glib_LIBS
@@ -6079,7 +6103,7 @@ fi
 set dummy wget; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_WGET+set}" = set; then :
+if ${ac_cv_path_WGET+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $WGET in
@@ -6093,7 +6117,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6126,7 +6150,7 @@ else
 set dummy ftp; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_FTP+set}" = set; then :
+if ${ac_cv_path_FTP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $FTP in
@@ -6140,7 +6164,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_FTP="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6179,11 +6203,11 @@ fi
 
 # Checks for libraries.
 ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_bzlib_h" = x""yes; then :
+if test "x$ac_cv_header_bzlib_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzDecompressInit in -lbz2" >&5
 $as_echo_n "checking for BZ2_bzDecompressInit in -lbz2... " >&6; }
-if test "${ac_cv_lib_bz2_BZ2_bzDecompressInit+set}" = set; then :
+if ${ac_cv_lib_bz2_BZ2_bzDecompressInit+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6217,7 +6241,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzDecompressInit" >&5
 $as_echo "$ac_cv_lib_bz2_BZ2_bzDecompressInit" >&6; }
-if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = x""yes; then :
+if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = xyes; then :
   zlib="$zlib -DHAVE_BZLIB -lbz2"
 fi
 
@@ -6226,11 +6250,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default"
-if test "x$ac_cv_header_lzma_h" = x""yes; then :
+if test "x$ac_cv_header_lzma_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_stream_decoder in -llzma" >&5
 $as_echo_n "checking for lzma_stream_decoder in -llzma... " >&6; }
-if test "${ac_cv_lib_lzma_lzma_stream_decoder+set}" = set; then :
+if ${ac_cv_lib_lzma_lzma_stream_decoder+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6264,7 +6288,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_stream_decoder" >&5
 $as_echo "$ac_cv_lib_lzma_lzma_stream_decoder" >&6; }
-if test "x$ac_cv_lib_lzma_lzma_stream_decoder" = x""yes; then :
+if test "x$ac_cv_lib_lzma_lzma_stream_decoder" = xyes; then :
   zlib="$zlib -DHAVE_LZMA -llzma"
 fi
 
@@ -6273,11 +6297,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "lzo/lzo1x.h" "ac_cv_header_lzo_lzo1x_h" "$ac_includes_default"
-if test "x$ac_cv_header_lzo_lzo1x_h" = x""yes; then :
+if test "x$ac_cv_header_lzo_lzo1x_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzo1x_decompress in -llzo2" >&5
 $as_echo_n "checking for lzo1x_decompress in -llzo2... " >&6; }
-if test "${ac_cv_lib_lzo2_lzo1x_decompress+set}" = set; then :
+if ${ac_cv_lib_lzo2_lzo1x_decompress+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6311,7 +6335,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzo2_lzo1x_decompress" >&5
 $as_echo "$ac_cv_lib_lzo2_lzo1x_decompress" >&6; }
-if test "x$ac_cv_lib_lzo2_lzo1x_decompress" = x""yes; then :
+if test "x$ac_cv_lib_lzo2_lzo1x_decompress" = xyes; then :
   zlib="$zlib -DHAVE_LZO1X -llzo2"
 fi
 
@@ -6322,7 +6346,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for io_setup in -laio" >&5
 $as_echo_n "checking for io_setup in -laio... " >&6; }
-if test "${ac_cv_lib_aio_io_setup+set}" = set; then :
+if ${ac_cv_lib_aio_io_setup+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6356,7 +6380,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_aio_io_setup" >&5
 $as_echo "$ac_cv_lib_aio_io_setup" >&6; }
-if test "x$ac_cv_lib_aio_io_setup" = x""yes; then :
+if test "x$ac_cv_lib_aio_io_setup" = xyes; then :
   system_aio="y"
 else
   system_aio="n"
@@ -6365,7 +6389,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5 in -lcrypto" >&5
 $as_echo_n "checking for MD5 in -lcrypto... " >&6; }
-if test "${ac_cv_lib_crypto_MD5+set}" = set; then :
+if ${ac_cv_lib_crypto_MD5+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6399,7 +6423,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5" >&5
 $as_echo "$ac_cv_lib_crypto_MD5" >&6; }
-if test "x$ac_cv_lib_crypto_MD5" = x""yes; then :
+if test "x$ac_cv_lib_crypto_MD5" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBCRYPTO 1
 _ACEOF
@@ -6412,11 +6436,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "ext2fs/ext2fs.h" "ac_cv_header_ext2fs_ext2fs_h" "$ac_includes_default"
-if test "x$ac_cv_header_ext2fs_ext2fs_h" = x""yes; then :
+if test "x$ac_cv_header_ext2fs_ext2fs_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ext2fs_open2 in -lext2fs" >&5
 $as_echo_n "checking for ext2fs_open2 in -lext2fs... " >&6; }
-if test "${ac_cv_lib_ext2fs_ext2fs_open2+set}" = set; then :
+if ${ac_cv_lib_ext2fs_ext2fs_open2+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6450,7 +6474,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext2fs_ext2fs_open2" >&5
 $as_echo "$ac_cv_lib_ext2fs_ext2fs_open2" >&6; }
-if test "x$ac_cv_lib_ext2fs_ext2fs_open2" = x""yes; then :
+if test "x$ac_cv_lib_ext2fs_ext2fs_open2" = xyes; then :
 
 
 $as_echo "#define INCLUDE_EXTFS_H <ext2fs/ext2fs.h>" >>confdefs.h
@@ -6464,11 +6488,11 @@ fi
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "ext4fs/ext2fs.h" "ac_cv_header_ext4fs_ext2fs_h" "$ac_includes_default"
-if test "x$ac_cv_header_ext4fs_ext2fs_h" = x""yes; then :
+if test "x$ac_cv_header_ext4fs_ext2fs_h" = xyes; then :
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ext2fs_open2 in -lext4fs" >&5
 $as_echo_n "checking for ext2fs_open2 in -lext4fs... " >&6; }
-if test "${ac_cv_lib_ext4fs_ext2fs_open2+set}" = set; then :
+if ${ac_cv_lib_ext4fs_ext2fs_open2+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6502,7 +6526,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext4fs_ext2fs_open2" >&5
 $as_echo "$ac_cv_lib_ext4fs_ext2fs_open2" >&6; }
-if test "x$ac_cv_lib_ext4fs_ext2fs_open2" = x""yes; then :
+if test "x$ac_cv_lib_ext4fs_ext2fs_open2" = xyes; then :
 
 
 $as_echo "#define INCLUDE_EXTFS_H <ext4fs/ext2fs.h>" >>confdefs.h
@@ -6519,7 +6543,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_md_hash_buffer in -lgcrypt" >&5
 $as_echo_n "checking for gcry_md_hash_buffer in -lgcrypt... " >&6; }
-if test "${ac_cv_lib_gcrypt_gcry_md_hash_buffer+set}" = set; then :
+if ${ac_cv_lib_gcrypt_gcry_md_hash_buffer+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6553,7 +6577,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcrypt_gcry_md_hash_buffer" >&5
 $as_echo "$ac_cv_lib_gcrypt_gcry_md_hash_buffer" >&6; }
-if test "x$ac_cv_lib_gcrypt_gcry_md_hash_buffer" = x""yes; then :
+if test "x$ac_cv_lib_gcrypt_gcry_md_hash_buffer" = xyes; then :
   libgcrypt="y"
 else
   libgcrypt="n"
@@ -6563,7 +6587,7 @@ fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread flag" >&5
 $as_echo_n "checking for pthread flag... " >&6; }
-if test "${ax_cv_pthread_flags+set}" = set; then :
+if ${ax_cv_pthread_flags+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -6631,7 +6655,7 @@ $as_echo "$ax_cv_pthread_flags" >&6; }
 
     CPPFLAGS="$CPPFLAGS -Werror"
     ac_fn_c_check_header_mongrel "$LINENO" "libutil.h" "ac_cv_header_libutil_h" "$ac_includes_default"
-if test "x$ac_cv_header_libutil_h" = x""yes; then :
+if test "x$ac_cv_header_libutil_h" = xyes; then :
 
 
 $as_echo "#define INCLUDE_LIBUTIL_H <libutil.h>" >>confdefs.h
@@ -6645,7 +6669,7 @@ fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty et al" >&5
 $as_echo_n "checking for openpty et al... " >&6; }
-if test "${ax_cv_ptyfuncs_libs+set}" = set; then :
+if ${ax_cv_ptyfuncs_libs+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -6654,7 +6678,7 @@ else
                 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "Unable to find library for openpty and login_tty
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
             fi
 
     saved_LIBS="$LIBS"
@@ -6692,7 +6716,7 @@ $as_echo "$ax_cv_ptyfuncs_libs" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
 $as_echo_n "checking for yajl_alloc in -lyajl... " >&6; }
-if test "${ac_cv_lib_yajl_yajl_alloc+set}" = set; then :
+if ${ac_cv_lib_yajl_yajl_alloc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6726,7 +6750,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_yajl_yajl_alloc" >&5
 $as_echo "$ac_cv_lib_yajl_yajl_alloc" >&6; }
-if test "x$ac_cv_lib_yajl_yajl_alloc" = x""yes; then :
+if test "x$ac_cv_lib_yajl_yajl_alloc" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBYAJL 1
 _ACEOF
@@ -6739,7 +6763,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflateCopy in -lz" >&5
 $as_echo_n "checking for deflateCopy in -lz... " >&6; }
-if test "${ac_cv_lib_z_deflateCopy+set}" = set; then :
+if ${ac_cv_lib_z_deflateCopy+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6773,7 +6797,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflateCopy" >&5
 $as_echo "$ac_cv_lib_z_deflateCopy" >&6; }
-if test "x$ac_cv_lib_z_deflateCopy" = x""yes; then :
+if test "x$ac_cv_lib_z_deflateCopy" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBZ 1
 _ACEOF
@@ -6786,7 +6810,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5
 $as_echo_n "checking for libiconv_open in -liconv... " >&6; }
-if test "${ac_cv_lib_iconv_libiconv_open+set}" = set; then :
+if ${ac_cv_lib_iconv_libiconv_open+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6820,7 +6844,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5
 $as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; }
-if test "x$ac_cv_lib_iconv_libiconv_open" = x""yes; then :
+if test "x$ac_cv_lib_iconv_libiconv_open" = xyes; then :
   libiconv="y"
 else
   libiconv="n"
@@ -6832,7 +6856,7 @@ fi
 for ac_header in yajl/yajl_version.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "yajl/yajl_version.h" "ac_cv_header_yajl_yajl_version_h" "$ac_includes_default"
-if test "x$ac_cv_header_yajl_yajl_version_h" = x""yes; then :
+if test "x$ac_cv_header_yajl_yajl_version_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_YAJL_YAJL_VERSION_H 1
 _ACEOF
@@ -6906,10 +6930,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
-    test "x$cache_file" != "x/dev/null" &&
+    if test "x$cache_file" != "x/dev/null"; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
-    cat confcache >$cache_file
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
@@ -6941,7 +6976,7 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-: ${CONFIG_STATUS=./config.status}
+: "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -7042,6 +7077,7 @@ fi
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -7237,16 +7273,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -7306,28 +7342,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -7348,8 +7372,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by Xen Hypervisor $as_me 4.3, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
+This file was extended by Xen Hypervisor Tools $as_me 4.3, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -7405,17 +7429,17 @@ Configuration headers:
 $config_headers
 
 Report bugs to <xen-devel@lists.xen.org>.
-Xen Hypervisor home page: <http://www.xen.org/>."
+Xen Hypervisor Tools home page: <http://www.xen.org/>."
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-Xen Hypervisor config.status 4.3
-configured by $0, generated by GNU Autoconf 2.67,
+Xen Hypervisor Tools config.status 4.3
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -7504,7 +7528,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -7536,7 +7560,7 @@ do
     "../config/Tools.mk") CONFIG_FILES="$CONFIG_FILES ../config/Tools.mk" ;;
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
 
-  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
@@ -7558,9 +7582,10 @@ fi
 # after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  tmp=
+  tmp= ac_tmp=
   trap 'exit_status=$?
-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
 ' 0
   trap 'as_fn_exit 1' 1 2 13 15
 }
@@ -7568,12 +7593,13 @@ $debug ||
 
 {
   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
+  test -d "$tmp"
 }  ||
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -7595,7 +7621,7 @@ else
   ac_cs_awk_cr=$ac_cr
 fi
 
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
 _ACEOF
 
 
@@ -7623,7 +7649,7 @@ done
 rm -f conf$$subs.sh
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
 sed -n '
 h
@@ -7671,7 +7697,7 @@ t delim
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = ""
 
@@ -7703,7 +7729,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 else
   cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
   || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
@@ -7737,7 +7763,7 @@ fi # test -n "$CONFIG_FILES"
 # No need to generate them if there are no CONFIG_HEADERS.
 # This happens for instance with `./config.status Makefile'.
 if test -n "$CONFIG_HEADERS"; then
-cat >"$tmp/defines.awk" <<\_ACAWK ||
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
@@ -7749,8 +7775,8 @@ _ACEOF
 # handling of long lines.
 ac_delim='%!_!# '
 for ac_last_try in false false :; do
-  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_t"; then
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
     break
   elif $ac_last_try; then
     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
@@ -7851,7 +7877,7 @@ do
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -7870,7 +7896,7 @@ do
     for ac_f
     do
       case $ac_f in
-      -) ac_f="$tmp/stdin";;
+      -) ac_f="$ac_tmp/stdin";;
       *) # Look for the file first in the build tree, then in the source tree
 	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
 	 # because $ac_f cannot contain `:'.
@@ -7879,7 +7905,7 @@ do
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
       as_fn_append ac_file_inputs " '$ac_f'"
@@ -7905,8 +7931,8 @@ $as_echo "$as_me: creating $ac_file" >&6;}
     esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5  ;;
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -8036,21 +8062,22 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
 s&@INSTALL@&$ac_INSTALL&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&2;}
 
-  rm -f "$tmp/stdin"
+  rm -f "$ac_tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out" && rm -f "$tmp/out";;
-  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
   esac \
   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
@@ -8061,20 +8088,20 @@ which seems to be undefined.  Please make sure it is defined" >&2;}
   if test x"$ac_file" != x-; then
     {
       $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
-    } >"$tmp/config.h" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
-      mv "$tmp/config.h" "$ac_file" \
+      mv "$ac_tmp/config.h" "$ac_file" \
 	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
       || as_fn_error $? "could not create -" "$LINENO" 5
   fi
  ;;
diff --git a/tools/configure.ac b/tools/configure.ac
index 971e3e9..9924852 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.67])
-AC_INIT([Xen Hypervisor], m4_esyscmd([../version.sh ../xen/Makefile]),
+AC_INIT([Xen Hypervisor Tools], m4_esyscmd([../version.sh ../xen/Makefile]),
     [xen-devel@lists.xen.org], [xen], [http://www.xen.org/])
 AC_CONFIG_SRCDIR([libxl/libxl.c])
 AC_CONFIG_FILES([../config/Tools.mk])
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:36:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:36:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te82H-00084w-QG; Thu, 29 Nov 2012 17:36:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te82F-000832-9x
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:36:28 +0000
Received: from [193.109.254.147:65298] by server-2.bemta-14.messagelabs.com id
	C5/A0-20829-91D97B05; Thu, 29 Nov 2012 17:36:25 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-6.tower-27.messagelabs.com!1354210557!3163192!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_23, SUBJECT_EXCESS_QP, UNPARSEABLE_RELAY,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28161 invoked from network); 29 Nov 2012 17:36:06 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-6.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 17:36:06 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158386750;
	Thu, 29 Nov 2012 12:35:48 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com
Date: Thu, 29 Nov 2012 12:35:33 -0500
Message-Id: <1354210534-31052-7-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
MIME-Version: 1.0
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] =?utf-8?q?=5BVTPM_v5_6/7=5D_Add_autoconf_to_stubdom?=
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

U2lnbmVkLW9mZi1ieTogTWF0dGhldyBGaW9yYXZhbnRlIDxtYXR0aGV3LmZpb3JhdmFudGVAamh1
YXBsLmVkdT4KLS0tCiBhdXRvZ2VuLnNoICAgICAgICAgICAgICAgICAgICAgfCAgICAyICsKIGNv
bmZpZy9TdHViZG9tLm1rLmluICAgICAgICAgICB8ICAgNDQgKwogbTQvY3Vyc2VzLm00ICAgICAg
ICAgICAgICAgICAgIHwgICAyMCArCiBtNC9leHRmcy5tNCAgICAgICAgICAgICAgICAgICAgfCAg
IDIwICsKIG00L2ZlYXR1cmVzLm00ICAgICAgICAgICAgICAgICB8ICAgMjEgKwogbTQvZmV0Y2hl
ci5tNCAgICAgICAgICAgICAgICAgIHwgICAxNCArCiBtNC9vY2FtbC5tNCAgICAgICAgICAgICAg
ICAgICAgfCAgMjQxICsrKwogbTQvcGF0aF9vcl9mYWlsLm00ICAgICAgICAgICAgIHwgICAxMyAr
CiBtNC9wa2cubTQgICAgICAgICAgICAgICAgICAgICAgfCAgMTU3ICsrCiBtNC9wdGhyZWFkLm00
ICAgICAgICAgICAgICAgICAgfCAgIDQxICsKIG00L3B0eWZ1bmNzLm00ICAgICAgICAgICAgICAg
ICB8ICAgMzUgKwogbTQvcHl0aG9uX2RldmVsLm00ICAgICAgICAgICAgIHwgICAzNiArCiBtNC9w
eXRob25fdmVyc2lvbi5tNCAgICAgICAgICAgfCAgIDEyICsKIG00L3NhdmV2YXIubTQgICAgICAg
ICAgICAgICAgICB8ICAgIDYgKwogbTQvc2V0X2NmbGFnc19sZGZsYWdzLm00ICAgICAgIHwgICAx
OSArCiBtNC9zdHViZG9tLm00ICAgICAgICAgICAgICAgICAgfCAgIDYzICsKIG00L3V1aWQubTQg
ICAgICAgICAgICAgICAgICAgICB8ICAgIDkgKwogc3R1YmRvbS9NYWtlZmlsZSAgICAgICAgICAg
ICAgIHwgICA0OCArLQogc3R1YmRvbS9jb25maWd1cmUgICAgICAgICAgICAgIHwgNDM3MCArKysr
KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrCiBzdHViZG9tL2NvbmZpZ3VyZS5h
YyAgICAgICAgICAgfCAgIDU0ICsKIHN0dWJkb20vaW5zdGFsbC5zaCAgICAgICAgICAgICB8ICAg
IDEgKwogdG9vbHMvY29uZmlndXJlICAgICAgICAgICAgICAgIHwgICAgMiArCiB0b29scy9jb25m
aWd1cmUuYWMgICAgICAgICAgICAgfCAgIDI4ICstCiB0b29scy9tNC9jdXJzZXMubTQgICAgICAg
ICAgICAgfCAgIDIwIC0KIHRvb2xzL200L2V4dGZzLm00ICAgICAgICAgICAgICB8ICAgMjAgLQog
dG9vbHMvbTQvZmVhdHVyZXMubTQgICAgICAgICAgIHwgICAyMSAtCiB0b29scy9tNC9mZXRjaGVy
Lm00ICAgICAgICAgICAgfCAgIDE0IC0KIHRvb2xzL200L29jYW1sLm00ICAgICAgICAgICAgICB8
ICAyNDEgLS0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o7IGRvCisgICAgICBjYXNlICRhc19kaXIgaW4gIygKKyAgICAg
ICpcJyopIGFzX3FkaXI9YCRhc19lY2hvICIkYXNfZGlyIiB8IHNlZCAicy8nLydcXFxcXFxcXCcn
L2ciYDs7ICMnKAorICAgICAgKikgYXNfcWRpcj0kYXNfZGlyOzsKKyAgICAgIGVzYWMKKyAgICAg
IGFzX2RpcnM9IickYXNfcWRpcicgJGFzX2RpcnMiCisgICAgICBhc19kaXI9YCRhc19kaXJuYW1l
IC0tICIkYXNfZGlyIiB8fAorJGFzX2V4cHIgWCIkYXNfZGlyIiA6ICdYXCguKlteL11cKS8vKlte
L11bXi9dKi8qJCcgXHwgXAorCSBYIiRhc19kaXIiIDogJ1hcKC8vXClbXi9dJyBcfCBcCisJIFgi
JGFzX2RpciIgOiAnWFwoLy9cKSQnIFx8IFwKKwkgWCIkYXNfZGlyIiA6ICdYXCgvXCknIFx8IC4g
Mj4vZGV2L251bGwgfHwKKyRhc19lY2hvIFgiJGFzX2RpciIgfAorICAgIHNlZCAnL15YXCguKlte
L11cKVwvXC8qW14vXVteL10qXC8qJC97CisJICAgIHMvL1wxLworCSAgICBxCisJICB9CisJICAv
XlhcKFwvXC9cKVteL10uKi97CisJICAgIHMvL1wxLworCSAgICBxCisJICB9CisJICAvXlhcKFwv
XC9cKSQveworCSAgICBzLy9cMS8KKwkgICAgcQorCSAgfQorCSAgL15YXChcL1wpLioveworCSAg
ICBzLy9cMS8KKwkgICAgcQorCSAgfQorCSAgcy8uKi8uLzsgcSdgCisgICAgICB0ZXN0IC1kICIk
YXNfZGlyIiAmJiBicmVhaworICAgIGRvbmUKKyAgICB0ZXN0IC16ICIkYXNfZGlycyIgfHwgZXZh
bCAibWtkaXIgJGFzX2RpcnMiCisgIH0gfHwgdGVzdCAtZCAiJGFzX2RpciIgfHwgYXNfZm5fZXJy
b3IgJD8gImNhbm5vdCBjcmVhdGUgZGlyZWN0b3J5ICRhc19kaXIiCisKKworfSAjIGFzX2ZuX21r
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MvL1wxLworCSAgICBxCisJICB9CisJ
ICAvXlhcL1woXC9cKS4qL3sKKwkgICAgcy8vXDEvCisJICAgIHEKKwkgIH0KKwkgIHMvLiovLi87
IHEnYAorCisjIEF2b2lkIGRlcGVuZGluZyB1cG9uIENoYXJhY3RlciBSYW5nZXMuCithc19jcl9s
ZXR0ZXJzPSdhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5eicKK2FzX2NyX0xFVFRFUlM9J0FCQ0RF
RkdISUpLTE1OT1BRUlNUVVZXWFlaJworYXNfY3JfTGV0dGVycz0kYXNfY3JfbGV0dGVycyRhc19j
cl9MRVRURVJTCithc19jcl9kaWdpdHM9JzAxMjM0NTY3ODknCithc19jcl9hbG51bT0kYXNfY3Jf
TGV0dGVycyRhc19jcl9kaWdpdHMKKworCisgIGFzX2xpbmVub18xPSRMSU5FTk8gYXNfbGluZW5v
XzFhPSRMSU5FTk8KKyAgYXNfbGluZW5vXzI9JExJTkVOTyBhc19saW5lbm9fMmE9JExJTkVOTwor
ICBldmFsICd0ZXN0ICJ4JGFzX2xpbmVub18xJyRhc19ydW4nIiAhPSAieCRhc19saW5lbm9fMick
YXNfcnVuJyIgJiYKKyAgdGVzdCAieGBleHByICRhc19saW5lbm9fMSckYXNfcnVuJyArIDFgIiA9
ICJ4JGFzX2xpbmVub18yJyRhc19ydW4nIicgfHwgeworICAjIEJsYW1lIExlZSBFLiBNY01haG9u
ICgxOTMxLTE5ODkpIGZvciBzZWQncyBzeW50YXguICA6LSkKKyAgc2VkIC1uICcKKyAgICBwCisg
ICAgL1skXUxJTkVOTy89CisgICcgPCRhc19teXNlbGYgfAorICAgIHNlZCAnCisgICAgICBzL1sk
XUxJTkVOTy4qLyYtLworICAgICAgdCBsaW5lbm8KKyAgICAgIGIKKyAgICAgIDpsaW5lbm8KKyAg
ICAgIE4KKyAgICAgIDpsb29wCisgICAgICBzL1skXUxJTkVOT1woW14nJGFzX2NyX2FsbnVtJ19d
LipcblwpXCguKlwpL1wyX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9iamVjdCBmaWxlczogY2Fubm90IGNvbXBpbGUKK1NlZSBcYGNvbmZpZy5s
b2cnIGZvciBtb3JlIGRldGFpbHMiICIkTElORU5PIiA1OyB9CitmaQorcm0gLWYgY29uZnRlc3Qu
JGFjX2N2X29iamV4dCBjb25mdGVzdC4kYWNfZXh0CitmaQoreyAkYXNfZWNobyAiJGFzX21lOiR7
YXNfbGluZW5vLSRMSU5FTk99OiByZXN1bHQ6ICRhY19jdl9vYmpleHQiID4mNQorJGFzX2VjaG8g
IiRhY19jdl9vYmpleHQiID4mNjsgfQorT0JKRVhUPSRhY19jdl9vYmpleHQKK2FjX29iamV4dD0k
T0JKRVhUCit7ICRhc19lY2hvICIkYXNfbWU6JHthc19saW5lbm8tJExJTkVOT306IGNoZWNraW5n
IHdoZXRoZXIgd2UgYXJlIHVzaW5nIHRoZSBHTlUgQyBjb21waWxlciIgPiY1CiskYXNfZWNob19u
ICJjaGVja2luZyB3aGV0aGVyIHdlIGFyZSB1c2luZyB0aGUgR05VIEMgY29tcGlsZXIuLi4gIiA+
JjY7IH0KK2lmICR7YWNfY3ZfY19jb21waWxlcl9nbnUrOn0gZmFsc2U7IHRoZW4gOgorICAkYXNf
ZWNob19uICIoY2FjaGVkKSAiID4mNgorZWxzZQorICBjYXQgY29uZmRlZnMuaCAtIDw8X0FDRU9G
ID5jb25mdGVzdC4kYWNfZXh0CisvKiBlbmQgY29uZmRlZnMuaC4gICovCisKK2ludAorbWFpbiAo
KQoreworI2lmbmRlZiBfX0dOVUNfXworICAgICAgIGNob2tlIG1lCisjZW5kaWYKKworICA7Cisg
IHJldHVybiAwOworfQorX0FDRU9GCitpZiBhY19mbl9jX3RyeV9jb21waWxlICIkTElORU5PIjsg
dGhlbiA6CisgIGFjX2NvbXBpbGVyX2dudT15ZXMKK2Vsc2UKKyAgYWNfY29tcGlsZXJfZ251PW5v
CitmaQorcm0gLWYgY29yZSBjb25mdGVzdC5lcnIgY29uZnRlc3QuJGFjX29iamV4dCBjb25m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dXVpZC5tNAorKysgL2Rldi9udWxsCkBAIC0xLDkg
KzAsMCBAQAotQUNfREVGVU4oW0FYX0NIRUNLX1VVSURdLCBbCi1BQ19DSEVDS19IRUFERVIoW3V1
aWQvdXVpZC5oXSxbCi0gICAgQUNfQ0hFQ0tfTElCKFt1dWlkXSwgW3V1aWRfY2xlYXJdLCBbbGli
dXVpZD0ieSJdKQotXSkKLUFDX0NIRUNLX0hFQURFUihbdXVpZC5oXSxbbGlidXVpZD0ieSJdKQot
QVNfSUYoW3Rlc3QgIiRsaWJ1dWlkIiAhPSAieSJdLCBbCi0gICAgQUNfTVNHX0VSUk9SKFtjYW5u
b3QgZmluZCBhIHZhbGlkIHV1aWQgbGlicmFyeV0pCi1dKQotXSkKLS0gCjEuNy4xMC40CgoKX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVsIG1h
aWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9yZy94
ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:36:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:36:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te82H-00084w-QG; Thu, 29 Nov 2012 17:36:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te82F-000832-9x
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:36:28 +0000
Received: from [193.109.254.147:65298] by server-2.bemta-14.messagelabs.com id
	C5/A0-20829-91D97B05; Thu, 29 Nov 2012 17:36:25 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-6.tower-27.messagelabs.com!1354210557!3163192!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_23, SUBJECT_EXCESS_QP, UNPARSEABLE_RELAY,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28161 invoked from network); 29 Nov 2012 17:36:06 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-6.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 17:36:06 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158386750;
	Thu, 29 Nov 2012 12:35:48 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com
Date: Thu, 29 Nov 2012 12:35:33 -0500
Message-Id: <1354210534-31052-7-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
MIME-Version: 1.0
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] =?utf-8?q?=5BVTPM_v5_6/7=5D_Add_autoconf_to_stubdom?=
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

U2lnbmVkLW9mZi1ieTogTWF0dGhldyBGaW9yYXZhbnRlIDxtYXR0aGV3LmZpb3JhdmFudGVAamh1
YXBsLmVkdT4KLS0tCiBhdXRvZ2VuLnNoICAgICAgICAgICAgICAgICAgICAgfCAgICAyICsKIGNv
bmZpZy9TdHViZG9tLm1rLmluICAgICAgICAgICB8ICAgNDQgKwogbTQvY3Vyc2VzLm00ICAgICAg
ICAgICAgICAgICAgIHwgICAyMCArCiBtNC9leHRmcy5tNCAgICAgICAgICAgICAgICAgICAgfCAg
IDIwICsKIG00L2ZlYXR1cmVzLm00ICAgICAgICAgICAgICAgICB8ICAgMjEgKwogbTQvZmV0Y2hl
ci5tNCAgICAgICAgICAgICAgICAgIHwgICAxNCArCiBtNC9vY2FtbC5tNCAgICAgICAgICAgICAg
ICAgICAgfCAgMjQxICsrKwogbTQvcGF0aF9vcl9mYWlsLm00ICAgICAgICAgICAgIHwgICAxMyAr
CiBtNC9wa2cubTQgICAgICAgICAgICAgICAgICAgICAgfCAgMTU3ICsrCiBtNC9wdGhyZWFkLm00
ICAgICAgICAgICAgICAgICAgfCAgIDQxICsKIG00L3B0eWZ1bmNzLm00ICAgICAgICAgICAgICAg
ICB8ICAgMzUgKwogbTQvcHl0aG9uX2RldmVsLm00ICAgICAgICAgICAgIHwgICAzNiArCiBtNC9w
eXRob25fdmVyc2lvbi5tNCAgICAgICAgICAgfCAgIDEyICsKIG00L3NhdmV2YXIubTQgICAgICAg
ICAgICAgICAgICB8ICAgIDYgKwogbTQvc2V0X2NmbGFnc19sZGZsYWdzLm00ICAgICAgIHwgICAx
OSArCiBtNC9zdHViZG9tLm00ICAgICAgICAgICAgICAgICAgfCAgIDYzICsKIG00L3V1aWQubTQg
ICAgICAgICAgICAgICAgICAgICB8ICAgIDkgKwogc3R1YmRvbS9NYWtlZmlsZSAgICAgICAgICAg
ICAgIHwgICA0OCArLQogc3R1YmRvbS9jb25maWd1cmUgICAgICAgICAgICAgIHwgNDM3MCArKysr
KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrCiBzdHViZG9tL2NvbmZpZ3VyZS5h
YyAgICAgICAgICAgfCAgIDU0ICsKIHN0dWJkb20vaW5zdGFsbC5zaCAgICAgICAgICAgICB8ICAg
IDEgKwogdG9vbHMvY29uZmlndXJlICAgICAgICAgICAgICAgIHwgICAgMiArCiB0b29scy9jb25m
aWd1cmUuYWMgICAgICAgICAgICAgfCAgIDI4ICstCiB0b29scy9tNC9jdXJzZXMubTQgICAgICAg
ICAgICAgfCAgIDIwIC0KIHRvb2xzL200L2V4dGZzLm00ICAgICAgICAgICAgICB8ICAgMjAgLQog
dG9vbHMvbTQvZmVhdHVyZXMubTQgICAgICAgICAgIHwgICAyMSAtCiB0b29scy9tNC9mZXRjaGVy
Lm00ICAgICAgICAgICAgfCAgIDE0IC0KIHRvb2xzL200L29jYW1sLm00ICAgICAgICAgICAgICB8
ICAyNDEgLS0tCiB0b29scy9tNC9wYXRoX29yX2ZhaWwubTQgICAgICAgfCAgICA2IC0KIHRvb2xz
L200L3BrZy5tNCAgICAgICAgICAgICAgICB8ICAxNTcgLS0KIHRvb2xzL200L3B0aHJlYWQubTQg
ICAgICAgICAgICB8ICAgNDEgLQogdG9vbHMvbTQvcHR5ZnVuY3MubTQgICAgICAgICAgIHwgICAz
NSAtCiB0b29scy9tNC9weXRob25fZGV2ZWwubTQgICAgICAgfCAgIDM2IC0KIHRvb2xzL200L3B5
dGhvbl92ZXJzaW9uLm00ICAgICB8ICAgMTIgLQogdG9vbHMvbTQvc2F2ZXZhci5tNCAgICAgICAg
ICAgIHwgICAgNiAtCiB0b29scy9tNC9zZXRfY2ZsYWdzX2xkZmxhZ3MubTQgfCAgIDIwIC0KIHRv
b2xzL200L3V1aW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pbmVub18xPSRMSU5FTk8gYXNfbGluZW5v
XzFhPSRMSU5FTk8KKyAgYXNfbGluZW5vXzI9JExJTkVOTyBhc19saW5lbm9fMmE9JExJTkVOTwor
ICBldmFsICd0ZXN0ICJ4JGFzX2xpbmVub18xJyRhc19ydW4nIiAhPSAieCRhc19saW5lbm9fMick
YXNfcnVuJyIgJiYKKyAgdGVzdCAieGBleHByICRhc19saW5lbm9fMSckYXNfcnVuJyArIDFgIiA9
ICJ4JGFzX2xpbmVub18yJyRhc19ydW4nIicgfHwgeworICAjIEJsYW1lIExlZSBFLiBNY01haG9u
ICgxOTMxLTE5ODkpIGZvciBzZWQncyBzeW50YXguICA6LSkKKyAgc2VkIC1uICcKKyAgICBwCisg
ICAgL1skXUxJTkVOTy89CisgICcgPCRhc19teXNlbGYgfAorICAgIHNlZCAnCisgICAgICBzL1sk
XUxJTkVOTy4qLyYtLworICAgICAgdCBsaW5lbm8KKyAgICAgIGIKKyAgICAgIDpsaW5lbm8KKyAg
ICAgIE4KKyAgICAgIDpsb29wCisgICAgICBzL1skXUxJTkVOT1woW14nJGFzX2NyX2FsbnVtJ19d
LipcblwpXCguKlwpL1wyXDFcMi8KKyAgICAgIHQgbG9vcAorICAgICAgcy8tXG4uKi8vCisgICAg
JyA+JGFzX21lLmxpbmVubyAmJgorICBjaG1vZCAreCAiJGFzX21lLmxpbmVubyIgfHwKKyAgICB7
ICRhc19lY2hvICIkYXNfbWU6IGVycm9yOiBjYW5ub3QgY3JlYXRlICRhc19tZS5saW5lbm87IHJl
cnVuIHdpdGggYSBQT1NJWCBzaGVsbCIgPiYyOyBhc19mbl9leGl0IDE7IH0KKworICAjIElmIHdl
IGhhZCB0byByZS1leGVjdXRlIHdpdGggJENPTkZJR19TSEVMTCwgd2UncmUgZW5zdXJlZCB0byBo
YXZlCisgICMgYWxyZWFkeSBkb25lIHRoYXQsIHNvIGVuc3VyZSB3ZSBkb24ndCB0cnkgdG8gZG8g
c28gYWdhaW4gYW5kIGZhbG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zYW1lCisjIHZhbHVlLgorYWNfY2FjaGVfY29ycnVwdGVkPWZhbHNlCitmb3IgYWNf
dmFyIGluICRhY19wcmVjaW91c192YXJzOyBkbworICBldmFsIGFjX29sZF9zZXQ9XCRhY19jdl9l
bnZfJHthY192YXJ9X3NldAorICBldmFsIGFjX25ld19zZXQ9XCRhY19lbnZfJHthY192YXJ9X3Nl
dAorICBldmFsIGFjX29sZF92YWw9XCRhY19jdl9lbnZfJHthY192YXJ9X3ZhbHVlCisgIGV2YWwg
YWNfbmV3X3ZhbD1cJGFjX2Vudl8ke2FjX3Zhcn1fdmFsdWUKKyAgY2FzZSAkYWNfb2xkX3NldCwk
YWNfbmV3X3NldCBpbgorICAgIHNldCwpCisgICAgICB7ICRhc19lY2hvICIkYXNfbWU6JHthc19s
aW5lbm8tJExJTkVOT306IGVycm9yOiBcYCRhY192YXInIHdhcyBzZXQgdG8gXGAkYWNfb2xkX3Zh
bCcgaW4gdGhlIHByZXZpb3VzIHJ1biIgPiY1CiskYXNfZWNobyAiJGFzX21lOiBlcnJvcjogXGAk
YWNfdmFyJyB3YXMgc2V0IHRvIFxgJGFjX29sZF92YWwnIGluIHRoZSBwcmV2aW91cyBydW4iID4m
Mjt9CisgICAgICBhY19jYWNoZV9jb3JydXB0ZWQ9OiA7OworICAgICxzZXQpCisgICAgICB7ICRh
c19lY2hvICIkYXNfbWU6JHthc19saW5lbm8tJExJTkVOT306IGVycm9yOiBcYCRhY192YXInIHdh
cyBub3Qgc2V0IGluIHRoZSBwcmV2aW91cyBydW4iID4mNQorJGFzX2VjaG8gIiRhc19tZTogZXJy
b3I6IFxgJGFjX3Zhcicgd2FzIG5vdCBzZXQgaW4gdGhlIHByZXZpb3VzIHJ1biIgPiYyO30KKyAg
ICAgIGFjX2NhY2hlX2NvcnJ1cHRlZD06IDs7CisgICAgLCk7OworICAgICopCisgICAgICBpZiB0
ZXN0ICJ4JGFjX29sZF92YWwiICE9ICJ4JGFjX25ld192YWwiOyB0aGVuCisJ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19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVsIG1h
aWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9yZy94
ZW4tZGV2ZWwK

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:37:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:37:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te83a-00008q-TF; Thu, 29 Nov 2012 17:37:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te83Y-00007p-J3
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:37:48 +0000
Received: from [85.158.143.35:47406] by server-1.bemta-4.messagelabs.com id
	FC/61-27934-B6D97B05; Thu, 29 Nov 2012 17:37:47 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-4.tower-21.messagelabs.com!1354210557!5385488!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_23,
	UNPARSEABLE_RELAY,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22788 invoked from network); 29 Nov 2012 17:35:58 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-4.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 17:35:58 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158386746;
	Thu, 29 Nov 2012 12:35:48 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com
Date: Thu, 29 Nov 2012 12:35:31 -0500
Message-Id: <1354210534-31052-5-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [VTPM v5 4/7] Add vtpm documentation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

See the files included in this patch for details

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 docs/misc/vtpm.txt     |  357 ++++++++++++++++++++++++++++++++++--------------
 stubdom/vtpm/README    |   75 ++++++++++
 stubdom/vtpmmgr/README |   75 ++++++++++
 3 files changed, 401 insertions(+), 106 deletions(-)
 create mode 100644 stubdom/vtpm/README
 create mode 100644 stubdom/vtpmmgr/README

diff --git a/docs/misc/vtpm.txt b/docs/misc/vtpm.txt
index ad37fe8..fc6029a 100644
--- a/docs/misc/vtpm.txt
+++ b/docs/misc/vtpm.txt
@@ -1,152 +1,297 @@
-Copyright: IBM Corporation (C), Intel Corporation
-29 June 2006
-Authors: Stefan Berger <stefanb@us.ibm.com> (IBM), 
-         Employees of Intel Corp
-
-This document gives a short introduction to the virtual TPM support
-in XEN and goes as far as connecting a user domain to a virtual TPM
-instance and doing a short test to verify success. It is assumed
-that the user is fairly familiar with compiling and installing XEN
-and Linux on a machine. 
+Copyright (c) 2010-2012 United States Government, as represented by
+the Secretary of Defense.  All rights reserved.
+November 12 2012
+Authors: Matthew Fioravante (JHUAPL),
+
+This document describes the virtual Trusted Platform Module (vTPM) subsystem
+for Xen. The reader is assumed to have familiarity with building and installing
+Xen, Linux, and a basic understanding of the TPM and vTPM concepts.
+
+------------------------------
+INTRODUCTION
+------------------------------
+The goal of this work is to provide a TPM functionality to a virtual guest
+operating system (a DomU).  This allows programs to interact with a TPM in a
+virtual system the same way they interact with a TPM on the physical system.
+Each guest gets its own unique, emulated, software TPM.  However, each of the
+vTPM's secrets (Keys, NVRAM, etc) are managed by a vTPM Manager domain, which
+seals the secrets to the Physical TPM.  Thus, the vTPM subsystem extends the
+chain of trust rooted in the hardware TPM to virtual machines in Xen. Each
+major component of vTPM is implemented as a separate domain, providing secure
+separation guaranteed by the hypervisor. The vTPM domains are implemented in
+mini-os to reduce memory and processor overhead.
+
+This mini-os vTPM subsystem was built on top of the previous vTPM
+work done by IBM and Intel corporation.
  
-Production Prerequisites: An x86-based machine machine with a
-Linux-supported TPM on the motherboard (NSC, Atmel, Infineon, TPM V1.2).
-Development Prerequisites: An emulator for TESTING ONLY is provided
-
+------------------------------
+DESIGN OVERVIEW
+------------------------------
+
+The architecture of vTPM is described below:
+
++------------------+
+|    Linux DomU    | ...
+|       |  ^       |
+|       v  |       |
+|   xen-tpmfront   |
++------------------+
+        |  ^
+        v  |
++------------------+
+| mini-os/tpmback  |
+|       |  ^       |
+|       v  |       |
+|  vtpm-stubdom    | ...
+|       |  ^       |
+|       v  |       |
+| mini-os/tpmfront |
++------------------+
+        |  ^
+        v  |
++------------------+
+| mini-os/tpmback  |
+|       |  ^       |
+|       v  |       |
+|   vtpmmgrdom     |
+|       |  ^       |
+|       v  |       |
+| mini-os/tpm_tis  |
++------------------+
+        |  ^
+        v  |
++------------------+
+|   Hardware TPM   |
++------------------+
+ * Linux DomU: The Linux based guest that wants to use a vTPM. There many be
+               more than one of these.
+
+ * xen-tpmfront.ko: Linux kernel virtual TPM frontend driver. This driver
+                    provides vTPM access to a para-virtualized Linux based DomU.
+
+ * mini-os/tpmback: Mini-os TPM backend driver. The Linux frontend driver
+                    connects to this backend driver to facilitate
+                    communications between the Linux DomU and its vTPM. This
+                    driver is also used by vtpmmgrdom to communicate with
+                    vtpm-stubdom.
+
+ * vtpm-stubdom: A mini-os stub domain that implements a vTPM. There is a
+                 one to one mapping between running vtpm-stubdom instances and
+                 logical vtpms on the system. The vTPM Platform Configuration
+                 Registers (PCRs) are all initialized to zero.
+
+ * mini-os/tpmfront: Mini-os TPM frontend driver. The vTPM mini-os domain
+                     vtpm-stubdom uses this driver to communicate with
+                     vtpmmgrdom. This driver could also be used separately to
+                     implement a mini-os domain that wishes to use a vTPM of
+                     its own.
+
+ * vtpmmgrdom: A mini-os domain that implements the vTPM manager.
+               There is only one vTPM manager and it should be running during
+               the entire lifetime of the machine.  This domain regulates
+               access to the physical TPM on the system and secures the
+               persistent state of each vTPM.
+
+ * mini-os/tpm_tis: Mini-os TPM version 1.2 TPM Interface Specification (TIS)
+                    driver. This driver used by vtpmmgrdom to talk directly to
+                    the hardware TPM. Communication is facilitated by mapping
+                    hardware memory pages into vtpmmgrdom.
+
+ * Hardware TPM: The physical TPM that is soldered onto the motherboard.
+
+------------------------------
+INSTALLATION
+------------------------------
+
+Prerequisites:
+--------------
+You must have an x86 machine with a TPM on the motherboard.
+The only software requirement to compiling vTPM is cmake.
+You must use libxl to manage domains with vTPMs. 'xm' is
+deprecated and does not support vTPM.
 
 Compiling the XEN tree:
 -----------------------
 
-Compile the XEN tree as usual after the following lines set in the
-linux-2.6.??-xen/.config file:
+Compile and install the XEN tree as usual. Be sure to build and install
+the stubdom tree.
+
+Compiling the LINUX dom0 kernel:
+--------------------------------
 
-CONFIG_XEN_TPMDEV_BACKEND=m
+The Linux dom0 kernel has no special prerequisites.
 
-CONFIG_TCG_TPM=m
-CONFIG_TCG_TIS=m      (supported after 2.6.17-rc4)
-CONFIG_TCG_NSC=m
-CONFIG_TCG_ATMEL=m
-CONFIG_TCG_INFINEON=m
-CONFIG_TCG_XEN=m
-<possible other TPM drivers supported by Linux>
+Compiling the LINUX domU kernel:
+--------------------------------
 
-If the frontend driver needs to be compiled into the user domain
-kernel, then the following two lines should be changed.
+The domU kernel used by domains with vtpms must
+include the xen-tpmfront.ko driver. It can be built
+directly into the kernel or as a module.
 
 CONFIG_TCG_TPM=y
 CONFIG_TCG_XEN=y
 
+------------------------------
+VTPM MANAGER SETUP
+------------------------------
+
+Manager disk image setup:
+-------------------------
+
+The vTPM Manager requires a disk image to store its
+encrypted data. The image does not require a filesystem
+and can live anywhere on the host disk. The image does not need
+to be large. 8 to 16 Mb should be sufficient.
+
+# dd if=/dev/zero of=/var/vtpmmgrdom.img bs=16M count=1
+
+Manager config file:
+--------------------
+
+The vTPM Manager domain (vtpmmgrdom) must be started like
+any other Xen virtual machine and requires a config file.
+The manager requires a disk image for storage and permission
+to access the hardware memory pages for the TPM. An
+example configuration looks like the following.
+
+kernel="/usr/lib/xen/boot/vtpmmgrdom.gz"
+memory=16
+disk=["file:/var/vtpmmgrdom.img,hda,w"]
+name="vtpmmgrdom"
+iomem=["fed40,5"]
+
+The iomem line tells xl to allow access to the TPM
+IO memory pages, which are 5 pages that start at
+0xfed40000.
+
+Starting and stopping the manager:
+----------------------------------
+
+The vTPM manager should be started at boot, you may wish to
+create an init script to do this.
+
+# xl create -c vtpmmgrdom.cfg
+
+Once initialization is complete you should see the following:
+INFO[VTPM]: Waiting for commands from vTPM's:
+
+To shutdown the manager you must destroy it. To avoid data corruption,
+only destroy the manager when you see the above "Waiting for commands"
+message. This ensures the disk is in a consistent state.
+
+# xl destroy vtpmmgrdom
+
+------------------------------
+VTPM AND LINUX PVM SETUP
+------------------------------
 
-You must also enable the virtual TPM to be built:
+In the following examples we will assume we have Linux
+guest named "domu" with its associated configuration
+located at /home/user/domu. It's vtpm will be named
+domu-vtpm.
 
-In Config.mk in the Xen root directory set the line
+vTPM disk image setup:
+----------------------
 
-VTPM_TOOLS ?= y
+The vTPM requires a disk image to store its persistent
+data. The image does not require a filesystem. The image
+does not need to be large. 8 Mb should be sufficient.
 
-and in
+# dd if=/dev/zero of=/home/user/domu/vtpm.img bs=8M count=1
 
-tools/vtpm/Rules.mk set the line
+vTPM config file:
+-----------------
 
-BUILD_EMULATOR = y
+The vTPM domain requires a configuration file like
+any other domain. The vTPM requires a disk image for
+storage and a TPM frontend driver to communicate
+with the manager. An example configuration is given:
 
-Now build the Xen sources from Xen's root directory:
+kernel="/usr/lib/xen/boot/vtpm-stubdom.gz"
+memory=8
+disk=["file:/home/user/domu/vtpm.img,hda,w"]
+name="domu-vtpm"
+vtpm=["backend=vtpmmgrdom,uuid=ac0a5b9e-cbe2-4c07-b43b-1d69e46fb839"]
 
-make install
+The vtpm= line sets up the tpm frontend driver. The backend must set
+to vtpmmgrdom. You are required to generate a uuid for this vtpm.
+You can use the uuidgen unix program or some other method to create a
+uuid. The uuid uniquely identifies this vtpm to manager.
 
+If you wish to clear the vTPM data you can either recreate the
+disk image or change the uuid.
 
-Also build the initial RAM disk if necessary.
+Linux Guest config file:
+------------------------
 
-Reboot the machine with the created Xen kernel.
+The Linux guest config file needs to be modified to include
+the Linux tpmfront driver. Add the following line:
 
-Note: If you do not want any TPM-related code compiled into your
-kernel or built as module then comment all the above lines like
-this example:
-# CONFIG_TCG_TPM is not set
+vtpm=["backend=domu-vtpm"]
 
+Currently only paravirtualized guests are supported.
 
-Modifying VM Configuration files:
----------------------------------
+Launching and shut down:
+------------------------
 
-VM configuration files need to be adapted to make a TPM instance
-available to a user domain. The following VM configuration file is
-an example of how a user domain can be configured to have a TPM
-available. It works similar to making a network interface
-available to a domain.
+To launch a Linux guest with a vTPM we first have to start the vTPM domain.
 
-kernel = "/boot/vmlinuz-2.6.x"
-ramdisk = "/xen/initrd_domU/U1_ramdisk.img"
-memory = 32
-name = "TPMUserDomain0"
-vtpm = ['instance=1,backend=0']
-root = "/dev/ram0 console=tty ro"
-vif = ['backend=0']
+# xl create -c /home/user/domu/vtpm.cfg
 
-In the above configuration file the line 'vtpm = ...' provides
-information about the domain where the virtual TPM is running and
-where the TPM backend has been compiled into - this has to be 
-domain 0  at the moment - and which TPM instance the user domain
-is supposed to talk to. Note that each running VM must use a 
-different instance and that using instance 0 is NOT allowed. The
-instance parameter is taken as the desired instance number, but
-the actual instance number that is assigned to the virtual machine
-can be different. This is the case if for example that particular
-instance is already used by another virtual machine. The association
-of which TPM instance number is used by which virtual machine is
-kept in the file /var/vtpm/vtpm.db. Associations are maintained by
-a xend-internal vTPM UUID and vTPM instance number.
+After initialization is complete, you should see the following:
+Info: Waiting for frontend domain to connect..
 
-Note: If you do not want TPM functionality for your user domain simply
-leave out the 'vtpm' line in the configuration file.
+Next, launch the Linux guest
 
+# xl create -c /home/user/domu/domu.cfg
 
-Running the TPM:
-----------------
+If xen-tpmfront was compiled as a module, be sure to load it
+in the guest.
 
-To run the vTPM, the device /dev/vtpm must be available.
-Verify that 'ls -l /dev/vtpm' shows the following output:
+# modprobe xen-tpmfront
 
-crw-------  1 root root 10, 225 Aug 11 06:58 /dev/vtpm
+After the Linux domain boots and the xen-tpmfront driver is loaded,
+you should see the following on the vtpm console:
 
-If it is not available, run the following command as 'root'.
-mknod /dev/vtpm c 10 225
+Info: VTPM attached to Frontend X/Y
 
-Make sure that the vTPM is running in domain 0. To do this run the
-following:
+If you have trousers and tpm_tools installed on the guest, you can test the
+vtpm.
 
-modprobe tpmbk
+On guest:
+# tcsd (if tcsd is not running already)
+# tpm_version
 
-/usr/bin/vtpm_managerd
+The version command should return the following:
+  TPM 1.2 Version Info:
+  Chip Version:        1.2.0.7
+  Spec Level:          2
+  Errata Revision:     1
+  TPM Vendor ID:       ETHZ
+  TPM Version:         01010000
+  Manufacturer Info:   4554485a
 
-Start a user domain using the 'xm create' command. Once you are in the
-shell of the user domain, you should be able to do the following as
-user 'root':
+You should also see the command being sent to the vtpm console as well
+as the vtpm saving its state. You should see the vtpm key being
+encrypted and stored on the vtpmmgrdom console.
 
-Insert the TPM frontend into the kernel if it has been compiled as a
-kernel module.
+To shutdown the guest and its vtpm, you just have to shutdown the guest
+normally. As soon as the guest vm disconnects, the vtpm will shut itself
+down automatically.
 
-> modprobe tpm_xenu
+On guest:
+# shutdown -h now
 
-Check the status of the TPM
+You may wish to write a script to start your vtpm and guest together.
 
-> cd /sys/devices/xen/vtpm-0
-> ls
-[...]  cancel  caps   pcrs    pubek   [...]
-> cat pcrs
-PCR-00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-01: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-02: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-03: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-04: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-05: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-06: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-07: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-08: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-[...]
+------------------------------
+MORE INFORMATION
+------------------------------
 
-At this point the user domain has been successfully connected to its
-virtual TPM instance.
+See stubdom/vtpmmgr/README for more details about how
+the manager domain works, how to use it, and its command line
+parameters.
 
-For further information please read the documentation in 
-tools/vtpm_manager/README and tools/vtpm/README
+See stubdom/vtpm/README for more specifics about how vtpm-stubdom
+operates and the command line options it accepts.
 
-Stefan Berger and Employees of the Intel Corp
diff --git a/stubdom/vtpm/README b/stubdom/vtpm/README
new file mode 100644
index 0000000..11bdacb
--- /dev/null
+++ b/stubdom/vtpm/README
@@ -0,0 +1,75 @@
+Copyright (c) 2010-2012 United States Government, as represented by
+the Secretary of Defense.  All rights reserved.
+November 12 2012
+Authors: Matthew Fioravante (JHUAPL),
+
+This document describes the operation and command line interface
+of vtpm-stubdom. See docs/misc/vtpm.txt for details on the
+vTPM subsystem as a whole.
+
+
+------------------------------
+OPERATION
+------------------------------
+
+The vtpm-stubdom is a mini-OS domain that emulates a TPM for the guest OS to
+use. It is a small wrapper around the Berlios TPM emulator
+version 0.7.4. Commands are passed from the linux guest via the
+mini-os TPM backend driver. vTPM data is encrypted and stored via a disk image
+provided to the virtual machine. The key used to encrypt the data along
+with a hash of the vTPM's data is sent to the vTPM manager for secure storage
+and later retrieval.  The vTPM domain communicates with the manager using a
+mini-os tpm front/back device pair.
+
+------------------------------
+COMMAND LINE ARGUMENTS
+------------------------------
+
+Command line arguments are passed to the domain via the 'extra'
+parameter in the VM config file. Each parameter is separated
+by white space. For example:
+
+extra="foo=bar baz"
+
+List of Arguments:
+------------------
+
+loglevel=<LOG>: Controls the amount of logging printed to the console.
+	The possible values for <LOG> are:
+	 error
+	 info (default)
+	 debug
+
+clear: Start the Berlios emulator in "clear" mode. (default)
+
+save: Start the Berlios emulator in "save" mode.
+
+deactivated: Start the Berlios emulator in "deactivated" mode.
+	See the Berlios TPM emulator documentation for details
+	about the startup mode. For all normal use, always use clear
+	which is the default. You should not need to specify any of these.
+
+maintcmds=<1|0>: Enable to disable the TPM maintenance commands.
+	These commands are used by tpm manufacturers and thus
+	open a security hole. They are disabled by default.
+
+hwinitpcr=<PCRSPEC>: Initialize the virtual Platform Configuration Registers
+	(PCRs) with PCR values from the hardware TPM. Each pcr specified by
+	<PCRSPEC> will be initialized with the value of that same PCR in TPM
+	once at startup. By default all PCRs are zero initialized.
+	Value values of <PCRSPEC> are:
+	 all: copy all pcrs
+	 none: copy no pcrs (default)
+	 <N>: copy pcr n
+	 <X-Y>: copy pcrs x to y (inclusive)
+
+	These can also be combined by comma separation, for example:
+	 hwinitpcrs=5,12-16
+	will copy pcrs 5, 12, 13, 14, 15, and 16.
+
+------------------------------
+REFERENCES
+------------------------------
+
+Berlios TPM Emulator:
+http://tpm-emulator.berlios.de/
diff --git a/stubdom/vtpmmgr/README b/stubdom/vtpmmgr/README
new file mode 100644
index 0000000..09f3958
--- /dev/null
+++ b/stubdom/vtpmmgr/README
@@ -0,0 +1,75 @@
+Copyright (c) 2010-2012 United States Government, as represented by
+the Secretary of Defense.  All rights reserved.
+November 12 2012
+Authors: Matthew Fioravante (JHUAPL),
+
+This document describes the operation and command line interface
+of vtpmmgrdom. See docs/misc/vtpm.txt for details on the
+vTPM subsystem as a whole.
+
+
+------------------------------
+OPERATION
+------------------------------
+
+The vtpmmgrdom implements a vTPM manager who has two major functions:
+
+ - Securely store encryption keys for each of the vTPMS
+ - Regulate access to the hardware TPM for the entire system
+
+The manager accepts commands from the vtpm-stubdom domains via the mini-os
+TPM backend driver. The vTPM manager communicates directly with hardware TPM
+using the mini-os tpm_tis driver.
+
+
+When the manager starts for the first time it will check if the TPM
+has an owner. If the TPM is unowned, it will attempt to take ownership
+with the supplied owner_auth (see below) and then create a TPM
+storage key which will be used to secure vTPM key data. Currently the
+manager only binds vTPM keys to the disk. In the future support
+for sealing to PCRs should be added.
+
+------------------------------
+COMMAND LINE ARGUMENTS
+------------------------------
+
+Command line arguments are passed to the domain via the 'extra'
+parameter in the VM config file. Each parameter is separated
+by white space. For example:
+
+extra="foo=bar baz"
+
+List of Arguments:
+------------------
+
+owner_auth=<AUTHSPEC>: Set the owner auth of the TPM. The default
+	is the well known owner auth of all ones.
+
+srk_auth=<AUTHSPEC>: Set the SRK auth for the TPM. The default is
+	the well known srk auth of all zeroes.
+	The possible values of <AUTHSPEC> are:
+	 well-known: Use the well known auth (default)
+	 random: Randomly generate an auth
+	 hash: <HASH>: Use the given 40 character ASCII hex string
+	 text: <STR>: Use sha1 hash of <STR>.
+
+tpmdriver=<DRIVER>: Which driver to use to talk to the hardware TPM.
+	Don't change this unless you know what you're doing.
+	The possible values of <DRIVER> are:
+	 tpm_tis: Use the tpm_tis driver to talk directly to the TPM.
+		The domain must have access to TPM IO memory.  (default)
+	 tpmfront: Use tpmfront to talk to the TPM. The domain must have
+		a tpmfront device setup to talk to another domain
+		which provides access to the TPM.
+
+The following options only apply to the tpm_tis driver:
+
+tpmiomem=<ADDR>: The base address of the hardware memory pages of the
+	TPM (default 0xfed40000).
+
+tpmirq=<IRQ>: The irq of the hardware TPM if using interrupts. A value of
+	"probe" can be set to probe for the irq. A value of 0
+	disabled interrupts and uses polling (default 0).
+
+tpmlocality=<LOC>: Attempt to use locality <LOC> of the hardware TPM.
+	(default 0)
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:37:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:37:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te83a-00008q-TF; Thu, 29 Nov 2012 17:37:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te83Y-00007p-J3
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:37:48 +0000
Received: from [85.158.143.35:47406] by server-1.bemta-4.messagelabs.com id
	FC/61-27934-B6D97B05; Thu, 29 Nov 2012 17:37:47 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-4.tower-21.messagelabs.com!1354210557!5385488!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_23,
	UNPARSEABLE_RELAY,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22788 invoked from network); 29 Nov 2012 17:35:58 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-4.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 17:35:58 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158386746;
	Thu, 29 Nov 2012 12:35:48 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: xen-devel@lists.xen.org, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com
Date: Thu, 29 Nov 2012 12:35:31 -0500
Message-Id: <1354210534-31052-5-git-send-email-matthew.fioravante@jhuapl.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
Cc: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Subject: [Xen-devel] [VTPM v5 4/7] Add vtpm documentation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

See the files included in this patch for details

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 docs/misc/vtpm.txt     |  357 ++++++++++++++++++++++++++++++++++--------------
 stubdom/vtpm/README    |   75 ++++++++++
 stubdom/vtpmmgr/README |   75 ++++++++++
 3 files changed, 401 insertions(+), 106 deletions(-)
 create mode 100644 stubdom/vtpm/README
 create mode 100644 stubdom/vtpmmgr/README

diff --git a/docs/misc/vtpm.txt b/docs/misc/vtpm.txt
index ad37fe8..fc6029a 100644
--- a/docs/misc/vtpm.txt
+++ b/docs/misc/vtpm.txt
@@ -1,152 +1,297 @@
-Copyright: IBM Corporation (C), Intel Corporation
-29 June 2006
-Authors: Stefan Berger <stefanb@us.ibm.com> (IBM), 
-         Employees of Intel Corp
-
-This document gives a short introduction to the virtual TPM support
-in XEN and goes as far as connecting a user domain to a virtual TPM
-instance and doing a short test to verify success. It is assumed
-that the user is fairly familiar with compiling and installing XEN
-and Linux on a machine. 
+Copyright (c) 2010-2012 United States Government, as represented by
+the Secretary of Defense.  All rights reserved.
+November 12 2012
+Authors: Matthew Fioravante (JHUAPL),
+
+This document describes the virtual Trusted Platform Module (vTPM) subsystem
+for Xen. The reader is assumed to have familiarity with building and installing
+Xen, Linux, and a basic understanding of the TPM and vTPM concepts.
+
+------------------------------
+INTRODUCTION
+------------------------------
+The goal of this work is to provide a TPM functionality to a virtual guest
+operating system (a DomU).  This allows programs to interact with a TPM in a
+virtual system the same way they interact with a TPM on the physical system.
+Each guest gets its own unique, emulated, software TPM.  However, each of the
+vTPM's secrets (Keys, NVRAM, etc) are managed by a vTPM Manager domain, which
+seals the secrets to the Physical TPM.  Thus, the vTPM subsystem extends the
+chain of trust rooted in the hardware TPM to virtual machines in Xen. Each
+major component of vTPM is implemented as a separate domain, providing secure
+separation guaranteed by the hypervisor. The vTPM domains are implemented in
+mini-os to reduce memory and processor overhead.
+
+This mini-os vTPM subsystem was built on top of the previous vTPM
+work done by IBM and Intel corporation.
  
-Production Prerequisites: An x86-based machine machine with a
-Linux-supported TPM on the motherboard (NSC, Atmel, Infineon, TPM V1.2).
-Development Prerequisites: An emulator for TESTING ONLY is provided
-
+------------------------------
+DESIGN OVERVIEW
+------------------------------
+
+The architecture of vTPM is described below:
+
++------------------+
+|    Linux DomU    | ...
+|       |  ^       |
+|       v  |       |
+|   xen-tpmfront   |
++------------------+
+        |  ^
+        v  |
++------------------+
+| mini-os/tpmback  |
+|       |  ^       |
+|       v  |       |
+|  vtpm-stubdom    | ...
+|       |  ^       |
+|       v  |       |
+| mini-os/tpmfront |
++------------------+
+        |  ^
+        v  |
++------------------+
+| mini-os/tpmback  |
+|       |  ^       |
+|       v  |       |
+|   vtpmmgrdom     |
+|       |  ^       |
+|       v  |       |
+| mini-os/tpm_tis  |
++------------------+
+        |  ^
+        v  |
++------------------+
+|   Hardware TPM   |
++------------------+
+ * Linux DomU: The Linux based guest that wants to use a vTPM. There many be
+               more than one of these.
+
+ * xen-tpmfront.ko: Linux kernel virtual TPM frontend driver. This driver
+                    provides vTPM access to a para-virtualized Linux based DomU.
+
+ * mini-os/tpmback: Mini-os TPM backend driver. The Linux frontend driver
+                    connects to this backend driver to facilitate
+                    communications between the Linux DomU and its vTPM. This
+                    driver is also used by vtpmmgrdom to communicate with
+                    vtpm-stubdom.
+
+ * vtpm-stubdom: A mini-os stub domain that implements a vTPM. There is a
+                 one to one mapping between running vtpm-stubdom instances and
+                 logical vtpms on the system. The vTPM Platform Configuration
+                 Registers (PCRs) are all initialized to zero.
+
+ * mini-os/tpmfront: Mini-os TPM frontend driver. The vTPM mini-os domain
+                     vtpm-stubdom uses this driver to communicate with
+                     vtpmmgrdom. This driver could also be used separately to
+                     implement a mini-os domain that wishes to use a vTPM of
+                     its own.
+
+ * vtpmmgrdom: A mini-os domain that implements the vTPM manager.
+               There is only one vTPM manager and it should be running during
+               the entire lifetime of the machine.  This domain regulates
+               access to the physical TPM on the system and secures the
+               persistent state of each vTPM.
+
+ * mini-os/tpm_tis: Mini-os TPM version 1.2 TPM Interface Specification (TIS)
+                    driver. This driver used by vtpmmgrdom to talk directly to
+                    the hardware TPM. Communication is facilitated by mapping
+                    hardware memory pages into vtpmmgrdom.
+
+ * Hardware TPM: The physical TPM that is soldered onto the motherboard.
+
+------------------------------
+INSTALLATION
+------------------------------
+
+Prerequisites:
+--------------
+You must have an x86 machine with a TPM on the motherboard.
+The only software requirement to compiling vTPM is cmake.
+You must use libxl to manage domains with vTPMs. 'xm' is
+deprecated and does not support vTPM.
 
 Compiling the XEN tree:
 -----------------------
 
-Compile the XEN tree as usual after the following lines set in the
-linux-2.6.??-xen/.config file:
+Compile and install the XEN tree as usual. Be sure to build and install
+the stubdom tree.
+
+Compiling the LINUX dom0 kernel:
+--------------------------------
 
-CONFIG_XEN_TPMDEV_BACKEND=m
+The Linux dom0 kernel has no special prerequisites.
 
-CONFIG_TCG_TPM=m
-CONFIG_TCG_TIS=m      (supported after 2.6.17-rc4)
-CONFIG_TCG_NSC=m
-CONFIG_TCG_ATMEL=m
-CONFIG_TCG_INFINEON=m
-CONFIG_TCG_XEN=m
-<possible other TPM drivers supported by Linux>
+Compiling the LINUX domU kernel:
+--------------------------------
 
-If the frontend driver needs to be compiled into the user domain
-kernel, then the following two lines should be changed.
+The domU kernel used by domains with vtpms must
+include the xen-tpmfront.ko driver. It can be built
+directly into the kernel or as a module.
 
 CONFIG_TCG_TPM=y
 CONFIG_TCG_XEN=y
 
+------------------------------
+VTPM MANAGER SETUP
+------------------------------
+
+Manager disk image setup:
+-------------------------
+
+The vTPM Manager requires a disk image to store its
+encrypted data. The image does not require a filesystem
+and can live anywhere on the host disk. The image does not need
+to be large. 8 to 16 Mb should be sufficient.
+
+# dd if=/dev/zero of=/var/vtpmmgrdom.img bs=16M count=1
+
+Manager config file:
+--------------------
+
+The vTPM Manager domain (vtpmmgrdom) must be started like
+any other Xen virtual machine and requires a config file.
+The manager requires a disk image for storage and permission
+to access the hardware memory pages for the TPM. An
+example configuration looks like the following.
+
+kernel="/usr/lib/xen/boot/vtpmmgrdom.gz"
+memory=16
+disk=["file:/var/vtpmmgrdom.img,hda,w"]
+name="vtpmmgrdom"
+iomem=["fed40,5"]
+
+The iomem line tells xl to allow access to the TPM
+IO memory pages, which are 5 pages that start at
+0xfed40000.
+
+Starting and stopping the manager:
+----------------------------------
+
+The vTPM manager should be started at boot, you may wish to
+create an init script to do this.
+
+# xl create -c vtpmmgrdom.cfg
+
+Once initialization is complete you should see the following:
+INFO[VTPM]: Waiting for commands from vTPM's:
+
+To shutdown the manager you must destroy it. To avoid data corruption,
+only destroy the manager when you see the above "Waiting for commands"
+message. This ensures the disk is in a consistent state.
+
+# xl destroy vtpmmgrdom
+
+------------------------------
+VTPM AND LINUX PVM SETUP
+------------------------------
 
-You must also enable the virtual TPM to be built:
+In the following examples we will assume we have Linux
+guest named "domu" with its associated configuration
+located at /home/user/domu. It's vtpm will be named
+domu-vtpm.
 
-In Config.mk in the Xen root directory set the line
+vTPM disk image setup:
+----------------------
 
-VTPM_TOOLS ?= y
+The vTPM requires a disk image to store its persistent
+data. The image does not require a filesystem. The image
+does not need to be large. 8 Mb should be sufficient.
 
-and in
+# dd if=/dev/zero of=/home/user/domu/vtpm.img bs=8M count=1
 
-tools/vtpm/Rules.mk set the line
+vTPM config file:
+-----------------
 
-BUILD_EMULATOR = y
+The vTPM domain requires a configuration file like
+any other domain. The vTPM requires a disk image for
+storage and a TPM frontend driver to communicate
+with the manager. An example configuration is given:
 
-Now build the Xen sources from Xen's root directory:
+kernel="/usr/lib/xen/boot/vtpm-stubdom.gz"
+memory=8
+disk=["file:/home/user/domu/vtpm.img,hda,w"]
+name="domu-vtpm"
+vtpm=["backend=vtpmmgrdom,uuid=ac0a5b9e-cbe2-4c07-b43b-1d69e46fb839"]
 
-make install
+The vtpm= line sets up the tpm frontend driver. The backend must set
+to vtpmmgrdom. You are required to generate a uuid for this vtpm.
+You can use the uuidgen unix program or some other method to create a
+uuid. The uuid uniquely identifies this vtpm to manager.
 
+If you wish to clear the vTPM data you can either recreate the
+disk image or change the uuid.
 
-Also build the initial RAM disk if necessary.
+Linux Guest config file:
+------------------------
 
-Reboot the machine with the created Xen kernel.
+The Linux guest config file needs to be modified to include
+the Linux tpmfront driver. Add the following line:
 
-Note: If you do not want any TPM-related code compiled into your
-kernel or built as module then comment all the above lines like
-this example:
-# CONFIG_TCG_TPM is not set
+vtpm=["backend=domu-vtpm"]
 
+Currently only paravirtualized guests are supported.
 
-Modifying VM Configuration files:
----------------------------------
+Launching and shut down:
+------------------------
 
-VM configuration files need to be adapted to make a TPM instance
-available to a user domain. The following VM configuration file is
-an example of how a user domain can be configured to have a TPM
-available. It works similar to making a network interface
-available to a domain.
+To launch a Linux guest with a vTPM we first have to start the vTPM domain.
 
-kernel = "/boot/vmlinuz-2.6.x"
-ramdisk = "/xen/initrd_domU/U1_ramdisk.img"
-memory = 32
-name = "TPMUserDomain0"
-vtpm = ['instance=1,backend=0']
-root = "/dev/ram0 console=tty ro"
-vif = ['backend=0']
+# xl create -c /home/user/domu/vtpm.cfg
 
-In the above configuration file the line 'vtpm = ...' provides
-information about the domain where the virtual TPM is running and
-where the TPM backend has been compiled into - this has to be 
-domain 0  at the moment - and which TPM instance the user domain
-is supposed to talk to. Note that each running VM must use a 
-different instance and that using instance 0 is NOT allowed. The
-instance parameter is taken as the desired instance number, but
-the actual instance number that is assigned to the virtual machine
-can be different. This is the case if for example that particular
-instance is already used by another virtual machine. The association
-of which TPM instance number is used by which virtual machine is
-kept in the file /var/vtpm/vtpm.db. Associations are maintained by
-a xend-internal vTPM UUID and vTPM instance number.
+After initialization is complete, you should see the following:
+Info: Waiting for frontend domain to connect..
 
-Note: If you do not want TPM functionality for your user domain simply
-leave out the 'vtpm' line in the configuration file.
+Next, launch the Linux guest
 
+# xl create -c /home/user/domu/domu.cfg
 
-Running the TPM:
-----------------
+If xen-tpmfront was compiled as a module, be sure to load it
+in the guest.
 
-To run the vTPM, the device /dev/vtpm must be available.
-Verify that 'ls -l /dev/vtpm' shows the following output:
+# modprobe xen-tpmfront
 
-crw-------  1 root root 10, 225 Aug 11 06:58 /dev/vtpm
+After the Linux domain boots and the xen-tpmfront driver is loaded,
+you should see the following on the vtpm console:
 
-If it is not available, run the following command as 'root'.
-mknod /dev/vtpm c 10 225
+Info: VTPM attached to Frontend X/Y
 
-Make sure that the vTPM is running in domain 0. To do this run the
-following:
+If you have trousers and tpm_tools installed on the guest, you can test the
+vtpm.
 
-modprobe tpmbk
+On guest:
+# tcsd (if tcsd is not running already)
+# tpm_version
 
-/usr/bin/vtpm_managerd
+The version command should return the following:
+  TPM 1.2 Version Info:
+  Chip Version:        1.2.0.7
+  Spec Level:          2
+  Errata Revision:     1
+  TPM Vendor ID:       ETHZ
+  TPM Version:         01010000
+  Manufacturer Info:   4554485a
 
-Start a user domain using the 'xm create' command. Once you are in the
-shell of the user domain, you should be able to do the following as
-user 'root':
+You should also see the command being sent to the vtpm console as well
+as the vtpm saving its state. You should see the vtpm key being
+encrypted and stored on the vtpmmgrdom console.
 
-Insert the TPM frontend into the kernel if it has been compiled as a
-kernel module.
+To shutdown the guest and its vtpm, you just have to shutdown the guest
+normally. As soon as the guest vm disconnects, the vtpm will shut itself
+down automatically.
 
-> modprobe tpm_xenu
+On guest:
+# shutdown -h now
 
-Check the status of the TPM
+You may wish to write a script to start your vtpm and guest together.
 
-> cd /sys/devices/xen/vtpm-0
-> ls
-[...]  cancel  caps   pcrs    pubek   [...]
-> cat pcrs
-PCR-00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-01: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-02: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-03: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-04: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-05: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-06: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-07: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-PCR-08: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-[...]
+------------------------------
+MORE INFORMATION
+------------------------------
 
-At this point the user domain has been successfully connected to its
-virtual TPM instance.
+See stubdom/vtpmmgr/README for more details about how
+the manager domain works, how to use it, and its command line
+parameters.
 
-For further information please read the documentation in 
-tools/vtpm_manager/README and tools/vtpm/README
+See stubdom/vtpm/README for more specifics about how vtpm-stubdom
+operates and the command line options it accepts.
 
-Stefan Berger and Employees of the Intel Corp
diff --git a/stubdom/vtpm/README b/stubdom/vtpm/README
new file mode 100644
index 0000000..11bdacb
--- /dev/null
+++ b/stubdom/vtpm/README
@@ -0,0 +1,75 @@
+Copyright (c) 2010-2012 United States Government, as represented by
+the Secretary of Defense.  All rights reserved.
+November 12 2012
+Authors: Matthew Fioravante (JHUAPL),
+
+This document describes the operation and command line interface
+of vtpm-stubdom. See docs/misc/vtpm.txt for details on the
+vTPM subsystem as a whole.
+
+
+------------------------------
+OPERATION
+------------------------------
+
+The vtpm-stubdom is a mini-OS domain that emulates a TPM for the guest OS to
+use. It is a small wrapper around the Berlios TPM emulator
+version 0.7.4. Commands are passed from the linux guest via the
+mini-os TPM backend driver. vTPM data is encrypted and stored via a disk image
+provided to the virtual machine. The key used to encrypt the data along
+with a hash of the vTPM's data is sent to the vTPM manager for secure storage
+and later retrieval.  The vTPM domain communicates with the manager using a
+mini-os tpm front/back device pair.
+
+------------------------------
+COMMAND LINE ARGUMENTS
+------------------------------
+
+Command line arguments are passed to the domain via the 'extra'
+parameter in the VM config file. Each parameter is separated
+by white space. For example:
+
+extra="foo=bar baz"
+
+List of Arguments:
+------------------
+
+loglevel=<LOG>: Controls the amount of logging printed to the console.
+	The possible values for <LOG> are:
+	 error
+	 info (default)
+	 debug
+
+clear: Start the Berlios emulator in "clear" mode. (default)
+
+save: Start the Berlios emulator in "save" mode.
+
+deactivated: Start the Berlios emulator in "deactivated" mode.
+	See the Berlios TPM emulator documentation for details
+	about the startup mode. For all normal use, always use clear
+	which is the default. You should not need to specify any of these.
+
+maintcmds=<1|0>: Enable to disable the TPM maintenance commands.
+	These commands are used by tpm manufacturers and thus
+	open a security hole. They are disabled by default.
+
+hwinitpcr=<PCRSPEC>: Initialize the virtual Platform Configuration Registers
+	(PCRs) with PCR values from the hardware TPM. Each pcr specified by
+	<PCRSPEC> will be initialized with the value of that same PCR in TPM
+	once at startup. By default all PCRs are zero initialized.
+	Value values of <PCRSPEC> are:
+	 all: copy all pcrs
+	 none: copy no pcrs (default)
+	 <N>: copy pcr n
+	 <X-Y>: copy pcrs x to y (inclusive)
+
+	These can also be combined by comma separation, for example:
+	 hwinitpcrs=5,12-16
+	will copy pcrs 5, 12, 13, 14, 15, and 16.
+
+------------------------------
+REFERENCES
+------------------------------
+
+Berlios TPM Emulator:
+http://tpm-emulator.berlios.de/
diff --git a/stubdom/vtpmmgr/README b/stubdom/vtpmmgr/README
new file mode 100644
index 0000000..09f3958
--- /dev/null
+++ b/stubdom/vtpmmgr/README
@@ -0,0 +1,75 @@
+Copyright (c) 2010-2012 United States Government, as represented by
+the Secretary of Defense.  All rights reserved.
+November 12 2012
+Authors: Matthew Fioravante (JHUAPL),
+
+This document describes the operation and command line interface
+of vtpmmgrdom. See docs/misc/vtpm.txt for details on the
+vTPM subsystem as a whole.
+
+
+------------------------------
+OPERATION
+------------------------------
+
+The vtpmmgrdom implements a vTPM manager who has two major functions:
+
+ - Securely store encryption keys for each of the vTPMS
+ - Regulate access to the hardware TPM for the entire system
+
+The manager accepts commands from the vtpm-stubdom domains via the mini-os
+TPM backend driver. The vTPM manager communicates directly with hardware TPM
+using the mini-os tpm_tis driver.
+
+
+When the manager starts for the first time it will check if the TPM
+has an owner. If the TPM is unowned, it will attempt to take ownership
+with the supplied owner_auth (see below) and then create a TPM
+storage key which will be used to secure vTPM key data. Currently the
+manager only binds vTPM keys to the disk. In the future support
+for sealing to PCRs should be added.
+
+------------------------------
+COMMAND LINE ARGUMENTS
+------------------------------
+
+Command line arguments are passed to the domain via the 'extra'
+parameter in the VM config file. Each parameter is separated
+by white space. For example:
+
+extra="foo=bar baz"
+
+List of Arguments:
+------------------
+
+owner_auth=<AUTHSPEC>: Set the owner auth of the TPM. The default
+	is the well known owner auth of all ones.
+
+srk_auth=<AUTHSPEC>: Set the SRK auth for the TPM. The default is
+	the well known srk auth of all zeroes.
+	The possible values of <AUTHSPEC> are:
+	 well-known: Use the well known auth (default)
+	 random: Randomly generate an auth
+	 hash: <HASH>: Use the given 40 character ASCII hex string
+	 text: <STR>: Use sha1 hash of <STR>.
+
+tpmdriver=<DRIVER>: Which driver to use to talk to the hardware TPM.
+	Don't change this unless you know what you're doing.
+	The possible values of <DRIVER> are:
+	 tpm_tis: Use the tpm_tis driver to talk directly to the TPM.
+		The domain must have access to TPM IO memory.  (default)
+	 tpmfront: Use tpmfront to talk to the TPM. The domain must have
+		a tpmfront device setup to talk to another domain
+		which provides access to the TPM.
+
+The following options only apply to the tpm_tis driver:
+
+tpmiomem=<ADDR>: The base address of the hardware memory pages of the
+	TPM (default 0xfed40000).
+
+tpmirq=<IRQ>: The irq of the hardware TPM if using interrupts. A value of
+	"probe" can be set to probe for the irq. A value of 0
+	disabled interrupts and uses polling (default 0).
+
+tpmlocality=<LOC>: Attempt to use locality <LOC> of the hardware TPM.
+	(default 0)
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:41:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:41:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te878-0000oa-NW; Thu, 29 Nov 2012 17:41:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1Te877-0000mH-Tk; Thu, 29 Nov 2012 17:41:30 +0000
Received: from [193.109.254.147:34537] by server-9.bemta-14.messagelabs.com id
	95/D4-30773-94E97B05; Thu, 29 Nov 2012 17:41:29 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1354210888!1957460!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21483 invoked from network); 29 Nov 2012 17:41:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:41:28 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076781"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:41:28 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Thu, 29 Nov 2012
	17:41:28 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Thu, 29 Nov 2012 17:41:28 +0000
Thread-Topic: [Xen-devel] [PATCH 10 of 15] libxc/ocaml: Add simple binding
	for xentoollog (output only)
Thread-Index: Ac3HRzNGwlsttWOXQqGpSzgfrDpfBQHDsQTg
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107B2@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<2b433b1523e4295bb1ed.1353432210@cosworth.uk.xensource.com>
In-Reply-To: <2b433b1523e4295bb1ed.1353432210@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 10 of 15] libxc/ocaml: Add simple binding
 for xentoollog (output only)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> 2b433b1523e4295bb1ed74a7b71e2a20e00f1802
> # Parent  5173d29f64fa541f6ec0c48481c4957a03f0302c
> libxc/ocaml: Add simple binding for xentoollog (output only).
> 
> These bindings allow ocaml code to receive log message via xentoollog but
> do not support injecting messages into xentoollog from ocaml.
> Receiving log messages from libx{c,l} and forwarding them to ocaml is the
> use case which is needed by the following patches.
> 
> Add a simple noddy test case (tools/ocaml/test).
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 

This is potentially very useful. However, I have a few concerns about the callbacks to OCaml.

The most important issue is that we'd like to wrap potentially blocking C code in caml_enter_blocking_section and caml_leave_blocking section calls, to make sure that this code won't block the entire OCaml program. Within such a block, it is not allowed to interact with the OCaml runtime in any way. This includes callbacks.

I have notice some weird segfaults happening when using this logging code, and they seemed to have gone away when I removed the blocking_section calls.

I can't think of a good solution yet, but to make this really useful, I think we may need to do it slightly differently.

I included some smaller comments below.

> diff -r 5173d29f64fa -r 2b433b1523e4 .gitignore
> --- a/.gitignore	Tue Nov 20 17:22:21 2012 +0000
> +++ b/.gitignore	Tue Nov 20 17:22:21 2012 +0000
> @@ -364,6 +364,7 @@ tools/ocaml/libs/xl/_libxl_types.mli.in

[.....]

> +static void stub_xtl_ocaml_vmessage(struct xentoollog_logger *logger,
> +			       xentoollog_level level,
> +			       int errnoval,
> +			       const char *context,
> +			       const char *format,
> +			       va_list al)
> +{
> +	struct caml_xtl *xtl = (struct caml_xtl*)logger;
> +	value *func = caml_named_value(xtl->vmessage_cb) ;
> +	value args[4];

I think it is safer to use this instead:

       CAMLparam0();
       CAMLlocalN(args, 4);

> +	char *msg;
> +
> +	if (args == NULL)
> +		caml_raise_out_of_memory();
> +	if (func == NULL)
> +		caml_raise_sys_error(caml_copy_string("Unable to find
> callback"));
> +	if (vasprintf(&msg, format, al) < 0)
> +		caml_raise_out_of_memory();
> +
> +	/* vmessage : level -> int option -> string option -> string -> unit; */
> +	args[0] = Val_level(level);
> +	args[1] = Val_errno(errnoval);
> +	args[2] = Val_context(context);
> +	args[3] = caml_copy_string(msg);
> +
> +	free(msg);
> +
> +	caml_callbackN(*func, 4, args);

Because of the above, we should also add CAMLreturn0.

> +}
> +
> +static void stub_xtl_ocaml_progress(struct xentoollog_logger *logger,
> +				    const char *context,
> +				    const char *doing_what /* no \r,\n */,
> +				    int percent, unsigned long done, unsigned
> long total) {
> +	struct caml_xtl *xtl = (struct caml_xtl*)logger;
> +	value *func = caml_named_value(xtl->progress_cb) ;
> +	value args[5];

Here as well:

       CAMLparam0();
       CAMLlocalN(args, 5);

> +
> +	if (args == NULL)
> +		caml_raise_out_of_memory();
> +	if (func == NULL)
> +		caml_raise_sys_error(caml_copy_string("Unable to find
> callback"));
> +
> +	/* progress : string option -> string -> int -> int64 -> int64 -> unit; */
> +	args[0] = Val_context(context);
> +	args[1] = caml_copy_string(doing_what);
> +	args[2] = Val_int(percent);
> +	args[3] = caml_copy_int64(done);
> +	args[4] = caml_copy_int64(total);
> +
> +	caml_callbackN(*func, 5, args);

And CAMLreturn0.

> +}
> +
> +static void xtl_destroy(struct xentoollog_logger *logger) {
> +	struct caml_xtl *xtl = (struct caml_xtl*)logger;
> +	free(xtl->vmessage_cb);
> +	free(xtl->progress_cb);
> +	free(xtl);
> +}
> +

[...]

> diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/test/Makefile
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
> @@ -0,0 +1,27 @@
> +XEN_ROOT = $(CURDIR)/../../..
> +OCAML_TOPLEVEL = $(CURDIR)/..
> +include $(OCAML_TOPLEVEL)/common.make
> +
> +OCAMLINCLUDE += \
> +	-I $(OCAML_TOPLEVEL)/libs/xentoollog
> +
> +OBJS = xtl
> +
> +PROGRAMS = xtl
> +
> +xtl_LIBS =  \
> +	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog
> +$(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa

I had to add "-cclib -lxenctrl" here to get it to link properly.

> +
> +xtl_OBJS = xtl
> +
> +OCAML_PROGRAM = xtl
> +
> +all: $(PROGRAMS)
> +
> +bins: $(PROGRAMS)
> +
> +install: all
> +	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
> +	$(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(BINDIR)
> +
> +include $(OCAML_TOPLEVEL)/Makefile.rules
> diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/test/xtl.ml
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/ocaml/test/xtl.ml	Tue Nov 20 17:22:21 2012 +0000
> @@ -0,0 +1,20 @@
> +open Arg
> +open Xentoollog
> +
> +let do_test level =
> +  let lgr = Xentoollog.create_stdio_logger ~level:level () in
> +  begin
> +    Xentoollog.test lgr;
> +    Xentoollog.destroy lgr;
> +  end
> +
> +let () =
> +  let debug_level = ref Xentoollog.Info in
> +  let speclist = [
> +    ("-v", Arg.Unit (fun () -> debug_level := Xentoollog.Debug), "Verbose");
> +    ("-q", Arg.Unit (fun () -> debug_level := Xentoollog.Critical),
> +"Quiet");
> +  ] in
> +  let usage_msg = "usage: xtl [OPTIONS]" in
> +  Arg.parse speclist (fun s -> ()) usage_msg;
> +
> +  do_test !debug_level
> 

Cheers,
Rob

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:41:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:41:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te878-0000oa-NW; Thu, 29 Nov 2012 17:41:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1Te877-0000mH-Tk; Thu, 29 Nov 2012 17:41:30 +0000
Received: from [193.109.254.147:34537] by server-9.bemta-14.messagelabs.com id
	95/D4-30773-94E97B05; Thu, 29 Nov 2012 17:41:29 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1354210888!1957460!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21483 invoked from network); 29 Nov 2012 17:41:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:41:28 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076781"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:41:28 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Thu, 29 Nov 2012
	17:41:28 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Thu, 29 Nov 2012 17:41:28 +0000
Thread-Topic: [Xen-devel] [PATCH 10 of 15] libxc/ocaml: Add simple binding
	for xentoollog (output only)
Thread-Index: Ac3HRzNGwlsttWOXQqGpSzgfrDpfBQHDsQTg
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107B2@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<2b433b1523e4295bb1ed.1353432210@cosworth.uk.xensource.com>
In-Reply-To: <2b433b1523e4295bb1ed.1353432210@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 10 of 15] libxc/ocaml: Add simple binding
 for xentoollog (output only)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> 2b433b1523e4295bb1ed74a7b71e2a20e00f1802
> # Parent  5173d29f64fa541f6ec0c48481c4957a03f0302c
> libxc/ocaml: Add simple binding for xentoollog (output only).
> 
> These bindings allow ocaml code to receive log message via xentoollog but
> do not support injecting messages into xentoollog from ocaml.
> Receiving log messages from libx{c,l} and forwarding them to ocaml is the
> use case which is needed by the following patches.
> 
> Add a simple noddy test case (tools/ocaml/test).
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 

This is potentially very useful. However, I have a few concerns about the callbacks to OCaml.

The most important issue is that we'd like to wrap potentially blocking C code in caml_enter_blocking_section and caml_leave_blocking section calls, to make sure that this code won't block the entire OCaml program. Within such a block, it is not allowed to interact with the OCaml runtime in any way. This includes callbacks.

I have notice some weird segfaults happening when using this logging code, and they seemed to have gone away when I removed the blocking_section calls.

I can't think of a good solution yet, but to make this really useful, I think we may need to do it slightly differently.

I included some smaller comments below.

> diff -r 5173d29f64fa -r 2b433b1523e4 .gitignore
> --- a/.gitignore	Tue Nov 20 17:22:21 2012 +0000
> +++ b/.gitignore	Tue Nov 20 17:22:21 2012 +0000
> @@ -364,6 +364,7 @@ tools/ocaml/libs/xl/_libxl_types.mli.in

[.....]

> +static void stub_xtl_ocaml_vmessage(struct xentoollog_logger *logger,
> +			       xentoollog_level level,
> +			       int errnoval,
> +			       const char *context,
> +			       const char *format,
> +			       va_list al)
> +{
> +	struct caml_xtl *xtl = (struct caml_xtl*)logger;
> +	value *func = caml_named_value(xtl->vmessage_cb) ;
> +	value args[4];

I think it is safer to use this instead:

       CAMLparam0();
       CAMLlocalN(args, 4);

> +	char *msg;
> +
> +	if (args == NULL)
> +		caml_raise_out_of_memory();
> +	if (func == NULL)
> +		caml_raise_sys_error(caml_copy_string("Unable to find
> callback"));
> +	if (vasprintf(&msg, format, al) < 0)
> +		caml_raise_out_of_memory();
> +
> +	/* vmessage : level -> int option -> string option -> string -> unit; */
> +	args[0] = Val_level(level);
> +	args[1] = Val_errno(errnoval);
> +	args[2] = Val_context(context);
> +	args[3] = caml_copy_string(msg);
> +
> +	free(msg);
> +
> +	caml_callbackN(*func, 4, args);

Because of the above, we should also add CAMLreturn0.

> +}
> +
> +static void stub_xtl_ocaml_progress(struct xentoollog_logger *logger,
> +				    const char *context,
> +				    const char *doing_what /* no \r,\n */,
> +				    int percent, unsigned long done, unsigned
> long total) {
> +	struct caml_xtl *xtl = (struct caml_xtl*)logger;
> +	value *func = caml_named_value(xtl->progress_cb) ;
> +	value args[5];

Here as well:

       CAMLparam0();
       CAMLlocalN(args, 5);

> +
> +	if (args == NULL)
> +		caml_raise_out_of_memory();
> +	if (func == NULL)
> +		caml_raise_sys_error(caml_copy_string("Unable to find
> callback"));
> +
> +	/* progress : string option -> string -> int -> int64 -> int64 -> unit; */
> +	args[0] = Val_context(context);
> +	args[1] = caml_copy_string(doing_what);
> +	args[2] = Val_int(percent);
> +	args[3] = caml_copy_int64(done);
> +	args[4] = caml_copy_int64(total);
> +
> +	caml_callbackN(*func, 5, args);

And CAMLreturn0.

> +}
> +
> +static void xtl_destroy(struct xentoollog_logger *logger) {
> +	struct caml_xtl *xtl = (struct caml_xtl*)logger;
> +	free(xtl->vmessage_cb);
> +	free(xtl->progress_cb);
> +	free(xtl);
> +}
> +

[...]

> diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/test/Makefile
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
> @@ -0,0 +1,27 @@
> +XEN_ROOT = $(CURDIR)/../../..
> +OCAML_TOPLEVEL = $(CURDIR)/..
> +include $(OCAML_TOPLEVEL)/common.make
> +
> +OCAMLINCLUDE += \
> +	-I $(OCAML_TOPLEVEL)/libs/xentoollog
> +
> +OBJS = xtl
> +
> +PROGRAMS = xtl
> +
> +xtl_LIBS =  \
> +	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog
> +$(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa

I had to add "-cclib -lxenctrl" here to get it to link properly.

> +
> +xtl_OBJS = xtl
> +
> +OCAML_PROGRAM = xtl
> +
> +all: $(PROGRAMS)
> +
> +bins: $(PROGRAMS)
> +
> +install: all
> +	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
> +	$(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(BINDIR)
> +
> +include $(OCAML_TOPLEVEL)/Makefile.rules
> diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/test/xtl.ml
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/ocaml/test/xtl.ml	Tue Nov 20 17:22:21 2012 +0000
> @@ -0,0 +1,20 @@
> +open Arg
> +open Xentoollog
> +
> +let do_test level =
> +  let lgr = Xentoollog.create_stdio_logger ~level:level () in
> +  begin
> +    Xentoollog.test lgr;
> +    Xentoollog.destroy lgr;
> +  end
> +
> +let () =
> +  let debug_level = ref Xentoollog.Info in
> +  let speclist = [
> +    ("-v", Arg.Unit (fun () -> debug_level := Xentoollog.Debug), "Verbose");
> +    ("-q", Arg.Unit (fun () -> debug_level := Xentoollog.Critical),
> +"Quiet");
> +  ] in
> +  let usage_msg = "usage: xtl [OPTIONS]" in
> +  Arg.parse speclist (fun s -> ()) usage_msg;
> +
> +  do_test !debug_level
> 

Cheers,
Rob

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:43:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:43:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te88c-00013r-4G; Thu, 29 Nov 2012 17:43:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Te88Z-00013F-VB; Thu, 29 Nov 2012 17:43:00 +0000
Received: from [85.158.137.99:29004] by server-14.bemta-3.messagelabs.com id
	08/9D-31424-3AE97B05; Thu, 29 Nov 2012 17:42:59 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1354210978!12436990!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10405 invoked from network); 29 Nov 2012 17:42:58 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:42:58 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076806"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:42:50 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 17:42:50 +0000
Message-ID: <1354210968.6269.59.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Rob Hoes <Rob.Hoes@citrix.com>
Date: Thu, 29 Nov 2012 17:42:48 +0000
In-Reply-To: <7EA643C653F17F4C80DE959E978F10EDFA101107B0@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<21c5e58956d09437903e.1353432208@cosworth.uk.xensource.com>
	<7EA643C653F17F4C80DE959E978F10EDFA101107B0@LONPMAILBOX01.citrite.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-api@lists.xen.org" <xen-api@lists.xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 08 of 15] libxl/ocaml: add some more builtin
 types
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 17:19 +0000, Rob Hoes wrote:
> > # HG changeset patch
> > # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> > 21c5e58956d09437903e1ee1b0588d61a7c28145
> > # Parent  0cf342afa9e6b506fad68346cb3a1207030372eb
> > libxl/ocaml: add some more builtin types.
> > 
> >   * bitmaps
> >   * string_list
> >   * cpuid_policy_list (actually opaque)
> >   * key_value_list
> > 
> > None of these are used yet, so no change to the generated code.
> > 
> > Bitmap_val requires a ctx, so leave it as an abort for now.
> > 
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > 
> > diff -r 0cf342afa9e6 -r 21c5e58956d0 tools/ocaml/libs/xl/genwrap.py
> > --- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> > +++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> > @@ -13,9 +13,13 @@ builtins = {
> >      "libxl_devid":          ("devid",                  "%(c)s = Int_val(%(o)s)",
> > "Val_int(%(c)s)"  ),
> >      "libxl_defbool":        ("bool option",            "%(c)s = Defbool_val(%(o)s)",
> > "Val_defbool(%(c)s)" ),
> >      "libxl_uuid":           ("int array",              "Uuid_val(gc, lg, &%(c)s, %(o)s)",
> > "Val_uuid(&%(c)s)"),
> > -    "libxl_key_value_list": ("(string * string) list", None,
> > None),
> > +    "libxl_bitmap":         ("bool array",             "Bitmap_val(gc, lg,
> > &%(c)s, %(o)s)",   "Val_bitmap(&%(c)s)"),
> > +    "libxl_key_value_list": ("(string * string) list",
> > "libxl_key_value_list_val(gc, lg, &%(c)s, %(o)s)",                              None),
> > +    "libxl_string_list":    ("string list",            "libxl_string_list_val(gc, lg,
> > &%(c)s, %(o)s)",                                 "String_list_val(gc, lg, &%(c)s, %(o)s)"),
> >      "libxl_mac":            ("int array",              "Mac_val(gc, lg, &%(c)s, %(o)s)",
> > "Val_mac(&%(c)s)"),
> >      "libxl_hwcap":          ("int32 array",            None,
> > "Val_hwcap(&%(c)s)"),
> > +    # This is an opaque type
> > +    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(gc,
> > lg, &%(c)s, %(o)s)",   "Val_cpuid_policy_list(&%(c)s)"),
> >      }
> > 
> >  DEVICE_FUNCTIONS = [ ("add",            ["t", "domid", "unit"]),
> > diff -r 0cf342afa9e6 -r 21c5e58956d0 tools/ocaml/libs/xl/xenlight.ml.in
> > --- a/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012
> > +0000
> > +++ b/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012
> > +0000
> > @@ -18,6 +18,10 @@ exception Error of string  type domid = int  type devid
> > = int
> > 
> > +module Cpuid_policy = struct
> > +	type t
> > +end
> > +
> 
> Do you expect this type to become more complicated, or non-opaque, in future?

IIRC it is opaque at the libxc layer too and I don't see this changing.
Mostly because its a total brain bender ;-)

>  Or would it have functions associated with it like for the devices?

I think it will eventually get functions to initialise the opaque thing,
corresponding to one or more of:

int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str);
int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *cpuid,
                                  const char* str);
void libxl_cpuid_apply_policy(libxl_ctx *ctx, uint32_t domid);
void libxl_cpuid_set(libxl_ctx *ctx, uint32_t domid,
                     libxl_cpuid_policy_list cpuid);

or some new accessor useful to you guys.

>  If not, perhaps we can use a simpler type definition:
> 
> type cpuid_policy_list
> 
> >  (* @@LIBXL_TYPES@@ *)
> > 
> >  external send_trigger : domid -> trigger -> int -> unit =
> > "stub_xl_send_trigger"
> > diff -r 0cf342afa9e6 -r 21c5e58956d0 tools/ocaml/libs/xl/xenlight_stubs.c
> > --- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012
> > +0000
> > +++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012
> > +0000
> > @@ -27,6 +27,7 @@
> >  #include <string.h>
> > 
> >  #include <libxl.h>
> > +#include <libxl_utils.h>
> > 
> >  struct caml_logger {
> >  	struct xentoollog_logger logger;
> > @@ -96,7 +97,6 @@ static void failwith_xl(char *fname, str
> >  	caml_raise_with_string(*caml_named_value("xl.error"), s);  }
> > 
> > -#if 0 /* TODO: wrap libxl_domain_create(), these functions will be needed
> > then */  static void * gc_calloc(caml_gc *gc, size_t nmemb, size_t size)  {
> >  	void *ptr;
> > @@ -107,28 +107,62 @@ static void * gc_calloc(caml_gc *gc, siz
> >  	return ptr;
> >  }
> > 
> > -static int string_string_tuple_array_val (caml_gc *gc, char ***c_val, value v)
> > +static int list_len(value v)
> > +{
> > +	int len = 0;
> > +	while ( v != Val_emptylist ) {
> > +		len++;
> > +		v = Field(v, 1);
> > +	}
> > +	return len;
> > +}
> > +
> 
> It is probably best to use CAMLparam1(v) and CAMLreturn(len) here, just in case.

Yes, thanks.

> 
> > +static int libxl_key_value_list_val(caml_gc *gc, struct caml_logger *lg,
> > +				    libxl_key_value_list *c_val,
> > +				    value v)
> >  {
> >  	CAMLparam1(v);
> > -	CAMLlocal1(a);
> > -	int i;
> > -	char **array;
> > +	CAMLlocal1(elem);
> > +	int nr, i;
> > +	libxl_key_value_list array;
> > 
> > -	for (i = 0, a = Field(v, 5); a != Val_emptylist; a = Field(a, 1)) { i++; }
> > +	nr = list_len(v);
> > 
> > -	array = gc_calloc(gc, (i + 1) * 2, sizeof(char *));
> > +	array = gc_calloc(gc, (nr + 1) * 2, sizeof(char *));
> >  	if (!array)
> > -		return 1;
> > -	for (i = 0, a = Field(v, 5); a != Val_emptylist; a = Field(a, 1), i++) {
> > -		value b = Field(a, 0);
> > -		array[i * 2] = dup_String_val(gc, Field(b, 0));
> > -		array[i * 2 + 1] = dup_String_val(gc, Field(b, 1));
> > +		caml_raise_out_of_memory();
> > +
> > +	for (i=0; v != Val_emptylist; i++, v = Field(v, 1) ) {
> > +		elem = Field(v, 0);
> > +
> > +		array[i * 2] = dup_String_val(gc, Field(elem, 0));
> > +		array[i * 2 + 1] = dup_String_val(gc, Field(elem, 1));
> >  	}
> > +
> >  	*c_val = array;
> >  	CAMLreturn(0);
> >  }
> > 
> > -#endif
> > +static int libxl_string_list_val(caml_gc *gc, struct caml_logger *lg,
> > +				 libxl_string_list *c_val,
> > +				 value v)
> > +{
> > +	CAMLparam1(v);
> > +	int nr, i;
> > +	libxl_key_value_list array;
> 
> This should probably be a libxl_string_list.

Yes!

(they are actually the same type under the hood, which is why gcc
doesn't complain)

> 
> > +
> > +	nr = list_len(v);
> > +
> > +	array = gc_calloc(gc, (nr + 1), sizeof(char *));
> > +	if (!array)
> > +		caml_raise_out_of_memory();
> > +
> > +	for (i=0; v != Val_emptylist; i++, v = Field(v, 1) )
> > +		array[i] = dup_String_val(gc, Field(v, 0));
> > +
> > +	*c_val = array;
> > +	CAMLreturn(0);
> > +}
> > 
> >  /* Option type support as per http://www.linux-
> > nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php */  #define Val_none
> > Val_int(0) @@ -168,6 +202,45 @@ static int Mac_val(caml_gc *gc, struct c
> >  	CAMLreturn(0);
> >  }
> > 
> > +static value Val_bitmap (libxl_bitmap *c_val) {
> > +	CAMLparam0();
> > +	CAMLlocal1(v);
> > +	int i;
> > +
> > +	v = caml_alloc(8 * (c_val->size), 0);
> > +	libxl_for_each_bit(i, *c_val) {
> > +		if (libxl_bitmap_test(c_val, i))
> > +			Store_field(v, i, Val_true);
> > +		else
> > +			Store_field(v, i, Val_false);
> > +	}
> > +	CAMLreturn(v);
> > +}
> > +
> > +static int Bitmap_val(caml_gc *gc, struct caml_logger *lg,
> > +		      libxl_bitmap *c_val, value v)
> > +{
> > +	abort(); /* XXX */
> > +}
> > +
> > +static value Val_cpuid_policy_list(libxl_cpuid_policy_list *c_val) {
> > +	CAMLparam0();
> > +	/* An opaque pointer */
> > +	CAMLreturn((value)c_val);
> > +}
> > +
> > +static int Cpuid_policy_list_val(caml_gc *gc, struct caml_logger *lg,
> > +				 libxl_cpuid_policy_list **c_val, value v) {
> > +	CAMLparam1(v);
> > +
> > +	/* An opaque pointer */
> > +	*c_val = (libxl_cpuid_policy_list*)v;
> > +	CAMLreturn(0);
> > +}
> > +
> >  static value Val_uuid (libxl_uuid *c_val)  {
> >  	CAMLparam0();
> 
> For the rest it looks good to me.
> 
> Cheers,
> Rob
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:43:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:43:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te88c-00013r-4G; Thu, 29 Nov 2012 17:43:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Te88Z-00013F-VB; Thu, 29 Nov 2012 17:43:00 +0000
Received: from [85.158.137.99:29004] by server-14.bemta-3.messagelabs.com id
	08/9D-31424-3AE97B05; Thu, 29 Nov 2012 17:42:59 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1354210978!12436990!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10405 invoked from network); 29 Nov 2012 17:42:58 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 17:42:58 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16076806"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:42:50 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 17:42:50 +0000
Message-ID: <1354210968.6269.59.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Rob Hoes <Rob.Hoes@citrix.com>
Date: Thu, 29 Nov 2012 17:42:48 +0000
In-Reply-To: <7EA643C653F17F4C80DE959E978F10EDFA101107B0@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<21c5e58956d09437903e.1353432208@cosworth.uk.xensource.com>
	<7EA643C653F17F4C80DE959E978F10EDFA101107B0@LONPMAILBOX01.citrite.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-api@lists.xen.org" <xen-api@lists.xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 08 of 15] libxl/ocaml: add some more builtin
 types
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 17:19 +0000, Rob Hoes wrote:
> > # HG changeset patch
> > # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> > 21c5e58956d09437903e1ee1b0588d61a7c28145
> > # Parent  0cf342afa9e6b506fad68346cb3a1207030372eb
> > libxl/ocaml: add some more builtin types.
> > 
> >   * bitmaps
> >   * string_list
> >   * cpuid_policy_list (actually opaque)
> >   * key_value_list
> > 
> > None of these are used yet, so no change to the generated code.
> > 
> > Bitmap_val requires a ctx, so leave it as an abort for now.
> > 
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > 
> > diff -r 0cf342afa9e6 -r 21c5e58956d0 tools/ocaml/libs/xl/genwrap.py
> > --- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> > +++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> > @@ -13,9 +13,13 @@ builtins = {
> >      "libxl_devid":          ("devid",                  "%(c)s = Int_val(%(o)s)",
> > "Val_int(%(c)s)"  ),
> >      "libxl_defbool":        ("bool option",            "%(c)s = Defbool_val(%(o)s)",
> > "Val_defbool(%(c)s)" ),
> >      "libxl_uuid":           ("int array",              "Uuid_val(gc, lg, &%(c)s, %(o)s)",
> > "Val_uuid(&%(c)s)"),
> > -    "libxl_key_value_list": ("(string * string) list", None,
> > None),
> > +    "libxl_bitmap":         ("bool array",             "Bitmap_val(gc, lg,
> > &%(c)s, %(o)s)",   "Val_bitmap(&%(c)s)"),
> > +    "libxl_key_value_list": ("(string * string) list",
> > "libxl_key_value_list_val(gc, lg, &%(c)s, %(o)s)",                              None),
> > +    "libxl_string_list":    ("string list",            "libxl_string_list_val(gc, lg,
> > &%(c)s, %(o)s)",                                 "String_list_val(gc, lg, &%(c)s, %(o)s)"),
> >      "libxl_mac":            ("int array",              "Mac_val(gc, lg, &%(c)s, %(o)s)",
> > "Val_mac(&%(c)s)"),
> >      "libxl_hwcap":          ("int32 array",            None,
> > "Val_hwcap(&%(c)s)"),
> > +    # This is an opaque type
> > +    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(gc,
> > lg, &%(c)s, %(o)s)",   "Val_cpuid_policy_list(&%(c)s)"),
> >      }
> > 
> >  DEVICE_FUNCTIONS = [ ("add",            ["t", "domid", "unit"]),
> > diff -r 0cf342afa9e6 -r 21c5e58956d0 tools/ocaml/libs/xl/xenlight.ml.in
> > --- a/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012
> > +0000
> > +++ b/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012
> > +0000
> > @@ -18,6 +18,10 @@ exception Error of string  type domid = int  type devid
> > = int
> > 
> > +module Cpuid_policy = struct
> > +	type t
> > +end
> > +
> 
> Do you expect this type to become more complicated, or non-opaque, in future?

IIRC it is opaque at the libxc layer too and I don't see this changing.
Mostly because its a total brain bender ;-)

>  Or would it have functions associated with it like for the devices?

I think it will eventually get functions to initialise the opaque thing,
corresponding to one or more of:

int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str);
int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *cpuid,
                                  const char* str);
void libxl_cpuid_apply_policy(libxl_ctx *ctx, uint32_t domid);
void libxl_cpuid_set(libxl_ctx *ctx, uint32_t domid,
                     libxl_cpuid_policy_list cpuid);

or some new accessor useful to you guys.

>  If not, perhaps we can use a simpler type definition:
> 
> type cpuid_policy_list
> 
> >  (* @@LIBXL_TYPES@@ *)
> > 
> >  external send_trigger : domid -> trigger -> int -> unit =
> > "stub_xl_send_trigger"
> > diff -r 0cf342afa9e6 -r 21c5e58956d0 tools/ocaml/libs/xl/xenlight_stubs.c
> > --- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012
> > +0000
> > +++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012
> > +0000
> > @@ -27,6 +27,7 @@
> >  #include <string.h>
> > 
> >  #include <libxl.h>
> > +#include <libxl_utils.h>
> > 
> >  struct caml_logger {
> >  	struct xentoollog_logger logger;
> > @@ -96,7 +97,6 @@ static void failwith_xl(char *fname, str
> >  	caml_raise_with_string(*caml_named_value("xl.error"), s);  }
> > 
> > -#if 0 /* TODO: wrap libxl_domain_create(), these functions will be needed
> > then */  static void * gc_calloc(caml_gc *gc, size_t nmemb, size_t size)  {
> >  	void *ptr;
> > @@ -107,28 +107,62 @@ static void * gc_calloc(caml_gc *gc, siz
> >  	return ptr;
> >  }
> > 
> > -static int string_string_tuple_array_val (caml_gc *gc, char ***c_val, value v)
> > +static int list_len(value v)
> > +{
> > +	int len = 0;
> > +	while ( v != Val_emptylist ) {
> > +		len++;
> > +		v = Field(v, 1);
> > +	}
> > +	return len;
> > +}
> > +
> 
> It is probably best to use CAMLparam1(v) and CAMLreturn(len) here, just in case.

Yes, thanks.

> 
> > +static int libxl_key_value_list_val(caml_gc *gc, struct caml_logger *lg,
> > +				    libxl_key_value_list *c_val,
> > +				    value v)
> >  {
> >  	CAMLparam1(v);
> > -	CAMLlocal1(a);
> > -	int i;
> > -	char **array;
> > +	CAMLlocal1(elem);
> > +	int nr, i;
> > +	libxl_key_value_list array;
> > 
> > -	for (i = 0, a = Field(v, 5); a != Val_emptylist; a = Field(a, 1)) { i++; }
> > +	nr = list_len(v);
> > 
> > -	array = gc_calloc(gc, (i + 1) * 2, sizeof(char *));
> > +	array = gc_calloc(gc, (nr + 1) * 2, sizeof(char *));
> >  	if (!array)
> > -		return 1;
> > -	for (i = 0, a = Field(v, 5); a != Val_emptylist; a = Field(a, 1), i++) {
> > -		value b = Field(a, 0);
> > -		array[i * 2] = dup_String_val(gc, Field(b, 0));
> > -		array[i * 2 + 1] = dup_String_val(gc, Field(b, 1));
> > +		caml_raise_out_of_memory();
> > +
> > +	for (i=0; v != Val_emptylist; i++, v = Field(v, 1) ) {
> > +		elem = Field(v, 0);
> > +
> > +		array[i * 2] = dup_String_val(gc, Field(elem, 0));
> > +		array[i * 2 + 1] = dup_String_val(gc, Field(elem, 1));
> >  	}
> > +
> >  	*c_val = array;
> >  	CAMLreturn(0);
> >  }
> > 
> > -#endif
> > +static int libxl_string_list_val(caml_gc *gc, struct caml_logger *lg,
> > +				 libxl_string_list *c_val,
> > +				 value v)
> > +{
> > +	CAMLparam1(v);
> > +	int nr, i;
> > +	libxl_key_value_list array;
> 
> This should probably be a libxl_string_list.

Yes!

(they are actually the same type under the hood, which is why gcc
doesn't complain)

> 
> > +
> > +	nr = list_len(v);
> > +
> > +	array = gc_calloc(gc, (nr + 1), sizeof(char *));
> > +	if (!array)
> > +		caml_raise_out_of_memory();
> > +
> > +	for (i=0; v != Val_emptylist; i++, v = Field(v, 1) )
> > +		array[i] = dup_String_val(gc, Field(v, 0));
> > +
> > +	*c_val = array;
> > +	CAMLreturn(0);
> > +}
> > 
> >  /* Option type support as per http://www.linux-
> > nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php */  #define Val_none
> > Val_int(0) @@ -168,6 +202,45 @@ static int Mac_val(caml_gc *gc, struct c
> >  	CAMLreturn(0);
> >  }
> > 
> > +static value Val_bitmap (libxl_bitmap *c_val) {
> > +	CAMLparam0();
> > +	CAMLlocal1(v);
> > +	int i;
> > +
> > +	v = caml_alloc(8 * (c_val->size), 0);
> > +	libxl_for_each_bit(i, *c_val) {
> > +		if (libxl_bitmap_test(c_val, i))
> > +			Store_field(v, i, Val_true);
> > +		else
> > +			Store_field(v, i, Val_false);
> > +	}
> > +	CAMLreturn(v);
> > +}
> > +
> > +static int Bitmap_val(caml_gc *gc, struct caml_logger *lg,
> > +		      libxl_bitmap *c_val, value v)
> > +{
> > +	abort(); /* XXX */
> > +}
> > +
> > +static value Val_cpuid_policy_list(libxl_cpuid_policy_list *c_val) {
> > +	CAMLparam0();
> > +	/* An opaque pointer */
> > +	CAMLreturn((value)c_val);
> > +}
> > +
> > +static int Cpuid_policy_list_val(caml_gc *gc, struct caml_logger *lg,
> > +				 libxl_cpuid_policy_list **c_val, value v) {
> > +	CAMLparam1(v);
> > +
> > +	/* An opaque pointer */
> > +	*c_val = (libxl_cpuid_policy_list*)v;
> > +	CAMLreturn(0);
> > +}
> > +
> >  static value Val_uuid (libxl_uuid *c_val)  {
> >  	CAMLparam0();
> 
> For the rest it looks good to me.
> 
> Cheers,
> Rob
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:46:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:46:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8BO-0001QC-T3; Thu, 29 Nov 2012 17:45:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te8BN-0001Pz-4B
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:45:53 +0000
Received: from [85.158.139.211:58445] by server-8.bemta-5.messagelabs.com id
	5F/B3-06050-05F97B05; Thu, 29 Nov 2012 17:45:52 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354211151!17977338!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29553 invoked from network); 29 Nov 2012 17:45:51 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:45:51 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te8BJ-000MGG-W2; Thu, 29 Nov 2012 17:45:49 +0000
Date: Thu, 29 Nov 2012 17:45:49 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121129174549.GJ80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-6-git-send-email-ian.campbell@citrix.com>
	<20121129170638.GG80627@ocelot.phlegethon.org>
	<1354209553.6269.51.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354209553.6269.51.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 06/12] arm: avoid allocating the heaps over
	modules or xen itself.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 17:19 +0000 on 29 Nov (1354209553), Ian Campbell wrote:
> On Thu, 2012-11-29 at 17:06 +0000, Tim Deegan wrote:
> > At 16:23 +0000 on 13 Nov (1352823798), Ian Campbell wrote:
> > > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > > ---
> > >  xen/arch/arm/setup.c |   89 +++++++++++++++++++++++++++++++++++++++++++------
> > >  1 files changed, 78 insertions(+), 11 deletions(-)
> > > 
> > > @@ -215,8 +260,30 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
> > >      copy_from_paddr(device_tree_flattened, dtb_paddr, dtb_size, BUFFERABLE);
> > >  
> > >      /* Add non-xenheap memory */
> > > -    init_boot_pages(pfn_to_paddr(xenheap_mfn_start + xenheap_pages),
> > > -                    pfn_to_paddr(xenheap_mfn_start + xenheap_pages + domheap_pages));
> > > +    s = ram_start;
> > > +    while ( s < ram_end )
> > > +    {
> > > +        paddr_t n = ram_end;
> > > +
> > > +        e = next_module(s, &n);
> > 
> > Does this DTRT if there's a module starting at exactly ram_start?
> 
> I should probably try it...
> 
> I think in this case next_module will return the start of that module,
> so e = s, and it will also set n to the end of the module.

Yes, I see; you go nce around the loop with a 0-length range, which
init_boot_pages will ignore.  Fine. 

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:46:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:46:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8BO-0001QC-T3; Thu, 29 Nov 2012 17:45:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te8BN-0001Pz-4B
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:45:53 +0000
Received: from [85.158.139.211:58445] by server-8.bemta-5.messagelabs.com id
	5F/B3-06050-05F97B05; Thu, 29 Nov 2012 17:45:52 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354211151!17977338!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29553 invoked from network); 29 Nov 2012 17:45:51 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:45:51 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te8BJ-000MGG-W2; Thu, 29 Nov 2012 17:45:49 +0000
Date: Thu, 29 Nov 2012 17:45:49 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121129174549.GJ80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-6-git-send-email-ian.campbell@citrix.com>
	<20121129170638.GG80627@ocelot.phlegethon.org>
	<1354209553.6269.51.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354209553.6269.51.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 06/12] arm: avoid allocating the heaps over
	modules or xen itself.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 17:19 +0000 on 29 Nov (1354209553), Ian Campbell wrote:
> On Thu, 2012-11-29 at 17:06 +0000, Tim Deegan wrote:
> > At 16:23 +0000 on 13 Nov (1352823798), Ian Campbell wrote:
> > > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > > ---
> > >  xen/arch/arm/setup.c |   89 +++++++++++++++++++++++++++++++++++++++++++------
> > >  1 files changed, 78 insertions(+), 11 deletions(-)
> > > 
> > > @@ -215,8 +260,30 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
> > >      copy_from_paddr(device_tree_flattened, dtb_paddr, dtb_size, BUFFERABLE);
> > >  
> > >      /* Add non-xenheap memory */
> > > -    init_boot_pages(pfn_to_paddr(xenheap_mfn_start + xenheap_pages),
> > > -                    pfn_to_paddr(xenheap_mfn_start + xenheap_pages + domheap_pages));
> > > +    s = ram_start;
> > > +    while ( s < ram_end )
> > > +    {
> > > +        paddr_t n = ram_end;
> > > +
> > > +        e = next_module(s, &n);
> > 
> > Does this DTRT if there's a module starting at exactly ram_start?
> 
> I should probably try it...
> 
> I think in this case next_module will return the start of that module,
> so e = s, and it will also set n to the end of the module.

Yes, I see; you go nce around the loop with a 0-length range, which
init_boot_pages will ignore.  Fine. 

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:55:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8Kj-0001mK-1q; Thu, 29 Nov 2012 17:55:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te8Kh-0001mF-4u
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:55:31 +0000
Received: from [85.158.137.99:16562] by server-9.bemta-3.messagelabs.com id
	ED/2E-02388-291A7B05; Thu, 29 Nov 2012 17:55:30 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-6.tower-217.messagelabs.com!1354211728!12100677!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30637 invoked from network); 29 Nov 2012 17:55:29 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-6.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:55:29 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te8Ke-000MIg-4w; Thu, 29 Nov 2012 17:55:28 +0000
Date: Thu, 29 Nov 2012 17:55:28 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121129175528.GK80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-9-git-send-email-ian.campbell@citrix.com>
	<20121129171529.GI80627@ocelot.phlegethon.org>
	<1354209882.6269.55.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354209882.6269.55.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 09/12] arm: load dom0 kernel from first boot
	module
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 17:24 +0000 on 29 Nov (1354209882), Ian Campbell wrote:
> On Thu, 2012-11-29 at 17:15 +0000, Tim Deegan wrote:
> > At 16:23 +0000 on 13 Nov (1352823801), Ian Campbell wrote:
> > > -static int kernel_try_zimage_prepare(struct kernel_info *info)
> > > +static int kernel_try_zimage_prepare(struct kernel_info *info,
> > > +                                     paddr_t addr, paddr_t size)
> > >  {
> > >      uint32_t *zimage = (void *)FIXMAP_ADDR(FIXMAP_MISC);
> > >      uint32_t start, end;
> > >      struct minimal_dtb_header dtb_hdr;
> > >  
> > > -    set_fixmap(FIXMAP_MISC, KERNEL_FLASH_ADDRESS >> PAGE_SHIFT, DEV_SHARED);
> > > +    set_fixmap(FIXMAP_MISC, addr >> PAGE_SHIFT, DEV_SHARED);
> > > +
> > > +    zimage += addr & ~PAGE_MASK;
> > >  
> > >      if (zimage[ZIMAGE_MAGIC_OFFSET/4] != ZIMAGE_MAGIC)
> > > +    {
> > > +        clear_fixmap(FIXMAP_MISC);
> > >          return -EINVAL;
> > > +    }
> > >  
> > >      start = zimage[ZIMAGE_START_OFFSET/4];
> > >      end = zimage[ZIMAGE_END_OFFSET/4];
> > >  
> > >      clear_fixmap(FIXMAP_MISC);
> > >  
> > > +    if ( end > addr + size )
> > > +        return -EINVAL;
> > 
> > Should this also check for start == 0 && end > size?
> 
> Possibly ought to be checking for (end - start) > size which covers
> both?

Er, yes. :)

> > Do we want (here or elsewhere) to check that start is page-aligned?
> 
> I think kernel_try_zimage_prepare tries to do the right thing

Oh, so it does.  But kernel_zimage_load doesn't seem to -- it will copy
the data just below the start (which may be OK) but might not copy the
last part-page.   Also it won't handle the case where the 
(load_addr & 0xfff) != (source_addr & 0xfff).

Tim.

> Although you've made me look and I suspect it is buggy if start is <
> sizeof(zimage header) from the end of a page. It should probably just
> use copy_from_paddr into a local buffer.
> 
> Ian.
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:55:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8Kj-0001mK-1q; Thu, 29 Nov 2012 17:55:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te8Kh-0001mF-4u
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:55:31 +0000
Received: from [85.158.137.99:16562] by server-9.bemta-3.messagelabs.com id
	ED/2E-02388-291A7B05; Thu, 29 Nov 2012 17:55:30 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-6.tower-217.messagelabs.com!1354211728!12100677!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30637 invoked from network); 29 Nov 2012 17:55:29 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-6.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:55:29 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te8Ke-000MIg-4w; Thu, 29 Nov 2012 17:55:28 +0000
Date: Thu, 29 Nov 2012 17:55:28 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121129175528.GK80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-9-git-send-email-ian.campbell@citrix.com>
	<20121129171529.GI80627@ocelot.phlegethon.org>
	<1354209882.6269.55.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354209882.6269.55.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 09/12] arm: load dom0 kernel from first boot
	module
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 17:24 +0000 on 29 Nov (1354209882), Ian Campbell wrote:
> On Thu, 2012-11-29 at 17:15 +0000, Tim Deegan wrote:
> > At 16:23 +0000 on 13 Nov (1352823801), Ian Campbell wrote:
> > > -static int kernel_try_zimage_prepare(struct kernel_info *info)
> > > +static int kernel_try_zimage_prepare(struct kernel_info *info,
> > > +                                     paddr_t addr, paddr_t size)
> > >  {
> > >      uint32_t *zimage = (void *)FIXMAP_ADDR(FIXMAP_MISC);
> > >      uint32_t start, end;
> > >      struct minimal_dtb_header dtb_hdr;
> > >  
> > > -    set_fixmap(FIXMAP_MISC, KERNEL_FLASH_ADDRESS >> PAGE_SHIFT, DEV_SHARED);
> > > +    set_fixmap(FIXMAP_MISC, addr >> PAGE_SHIFT, DEV_SHARED);
> > > +
> > > +    zimage += addr & ~PAGE_MASK;
> > >  
> > >      if (zimage[ZIMAGE_MAGIC_OFFSET/4] != ZIMAGE_MAGIC)
> > > +    {
> > > +        clear_fixmap(FIXMAP_MISC);
> > >          return -EINVAL;
> > > +    }
> > >  
> > >      start = zimage[ZIMAGE_START_OFFSET/4];
> > >      end = zimage[ZIMAGE_END_OFFSET/4];
> > >  
> > >      clear_fixmap(FIXMAP_MISC);
> > >  
> > > +    if ( end > addr + size )
> > > +        return -EINVAL;
> > 
> > Should this also check for start == 0 && end > size?
> 
> Possibly ought to be checking for (end - start) > size which covers
> both?

Er, yes. :)

> > Do we want (here or elsewhere) to check that start is page-aligned?
> 
> I think kernel_try_zimage_prepare tries to do the right thing

Oh, so it does.  But kernel_zimage_load doesn't seem to -- it will copy
the data just below the start (which may be OK) but might not copy the
last part-page.   Also it won't handle the case where the 
(load_addr & 0xfff) != (source_addr & 0xfff).

Tim.

> Although you've made me look and I suspect it is buggy if start is <
> sizeof(zimage header) from the end of a page. It should probably just
> use copy_from_paddr into a local buffer.
> 
> Ian.
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:59:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:59:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8OU-0001ts-Oq; Thu, 29 Nov 2012 17:59:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te8OT-0001tm-Vw
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:59:26 +0000
Received: from [85.158.137.99:29687] by server-13.bemta-3.messagelabs.com id
	B0/0F-24887-D72A7B05; Thu, 29 Nov 2012 17:59:25 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-12.tower-217.messagelabs.com!1354211964!14083918!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19751 invoked from network); 29 Nov 2012 17:59:24 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:59:24 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te8OR-000MJE-Dq; Thu, 29 Nov 2012 17:59:23 +0000
Date: Thu, 29 Nov 2012 17:59:23 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121129175923.GL80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352824724.7491.103.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352824724.7491.103.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2 00/12] arm: support for initial modules
	(e.g. dom0) and DTB supplied in RAM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Right.  For 1, 2, 3, 6 and 11:

Acked-by: Tim Deegan <tim@xen.org>

5, 7 and 10 already have my Ack on them.  4, 8, 9 and 12 need some more
attention.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 17:59:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 17:59:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8OU-0001ts-Oq; Thu, 29 Nov 2012 17:59:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te8OT-0001tm-Vw
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 17:59:26 +0000
Received: from [85.158.137.99:29687] by server-13.bemta-3.messagelabs.com id
	B0/0F-24887-D72A7B05; Thu, 29 Nov 2012 17:59:25 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-12.tower-217.messagelabs.com!1354211964!14083918!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19751 invoked from network); 29 Nov 2012 17:59:24 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-12.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 17:59:24 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te8OR-000MJE-Dq; Thu, 29 Nov 2012 17:59:23 +0000
Date: Thu, 29 Nov 2012 17:59:23 +0000
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121129175923.GL80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352824724.7491.103.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1352824724.7491.103.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2 00/12] arm: support for initial modules
	(e.g. dom0) and DTB supplied in RAM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Right.  For 1, 2, 3, 6 and 11:

Acked-by: Tim Deegan <tim@xen.org>

5, 7 and 10 already have my Ack on them.  4, 8, 9 and 12 need some more
attention.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 18:01:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:01:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8Q3-00023S-8G; Thu, 29 Nov 2012 18:01:03 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Te8Q1-000234-N5
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:01:01 +0000
Received: from [85.158.139.83:47124] by server-13.bemta-5.messagelabs.com id
	87/CA-27809-CD2A7B05; Thu, 29 Nov 2012 18:01:00 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1354212060!27151813!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22686 invoked from network); 29 Nov 2012 18:01:00 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-13.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 18:01:00 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16077159"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:55:00 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 29 Nov 2012 17:55:00 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Te8KC-0007pB-17; Thu, 29 Nov 2012 17:55:00 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Te8KB-0008DZ-Sy;
	Thu, 29 Nov 2012 17:54:59 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20663.41331.674520.639570@mariner.uk.xensource.com>
Date: Thu, 29 Nov 2012 17:54:59 +0000
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
In-Reply-To: <50B76905.90503@jhuapl.edu>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353664797.13542.190.camel@zakaz.uk.xensource.com>
	<20663.18782.886504.606333@mariner.uk.xensource.com>
	<20663.18917.138256.303363@mariner.uk.xensource.com>
	<50B76905.90503@jhuapl.edu>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs
 to stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante writes ("Re: [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs to stubdom/Makefile"):
> Add a configure.ac to stubdom. I can whip up a simple one where you can 
> enable/disable specific stub domains. Other options could be setting the 
> fetch urls for the libraries. People can add more options later. Now if 
> people disable vtpm, the check for cmake goes away.

This would be fine, if you feel like doing it.

> Move /tools/configure.ac to /configure.ac. Use this configure script to 
> configure the entire build. /Makefile still exists and works with or 
> without configuring, to enable building of the hypervisor.

That would also be OK by me but would need wider agreement.

> If we don't want to do this now, then I vote to just make cmake a 
> dependency for Xen without adding messy conditional hacks.

We already have a number of things you can enable/disable with a
simple y/n in Config.mk.  I don't see why adding one more would be a
problem.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 18:01:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:01:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8Q3-00023S-8G; Thu, 29 Nov 2012 18:01:03 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1Te8Q1-000234-N5
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:01:01 +0000
Received: from [85.158.139.83:47124] by server-13.bemta-5.messagelabs.com id
	87/CA-27809-CD2A7B05; Thu, 29 Nov 2012 18:01:00 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1354212060!27151813!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22686 invoked from network); 29 Nov 2012 18:01:00 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-13.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 18:01:00 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16077159"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 17:55:00 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 29 Nov 2012 17:55:00 +0000
Received: from mariner.cam.xci-test.com	([10.80.2.22]
	helo=mariner.uk.xensource.com ident=Debian-exim)	by
	norwich.cam.xci-test.com
	with esmtp (Exim 4.72)	(envelope-from <Ian.Jackson@eu.citrix.com>)	id
	1Te8KC-0007pB-17; Thu, 29 Nov 2012 17:55:00 +0000
Received: from iwj by mariner.uk.xensource.com with local (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>)	id 1Te8KB-0008DZ-Sy;
	Thu, 29 Nov 2012 17:54:59 +0000
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
MIME-Version: 1.0
Message-ID: <20663.41331.674520.639570@mariner.uk.xensource.com>
Date: Thu, 29 Nov 2012 17:54:59 +0000
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
In-Reply-To: <50B76905.90503@jhuapl.edu>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353664797.13542.190.camel@zakaz.uk.xensource.com>
	<20663.18782.886504.606333@mariner.uk.xensource.com>
	<20663.18917.138256.303363@mariner.uk.xensource.com>
	<50B76905.90503@jhuapl.edu>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs
 to stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante writes ("Re: [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs to stubdom/Makefile"):
> Add a configure.ac to stubdom. I can whip up a simple one where you can 
> enable/disable specific stub domains. Other options could be setting the 
> fetch urls for the libraries. People can add more options later. Now if 
> people disable vtpm, the check for cmake goes away.

This would be fine, if you feel like doing it.

> Move /tools/configure.ac to /configure.ac. Use this configure script to 
> configure the entire build. /Makefile still exists and works with or 
> without configuring, to enable building of the hypervisor.

That would also be OK by me but would need wider agreement.

> If we don't want to do this now, then I vote to just make cmake a 
> dependency for Xen without adding messy conditional hacks.

We already have a number of things you can enable/disable with a
simple y/n in Config.mk.  I don't see why adding one more would be a
problem.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 18:03:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:03:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8SL-0002Lk-3j; Thu, 29 Nov 2012 18:03:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Te8SI-0002LP-U9; Thu, 29 Nov 2012 18:03:23 +0000
Received: from [85.158.139.211:43077] by server-1.bemta-5.messagelabs.com id
	4E/96-09311-A63A7B05; Thu, 29 Nov 2012 18:03:22 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1354212201!18459162!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9791 invoked from network); 29 Nov 2012 18:03:21 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 18:03:21 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16077309"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 18:03:21 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 18:03:21 +0000
Message-ID: <1354212199.6269.67.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Rob Hoes <Rob.Hoes@citrix.com>
Date: Thu, 29 Nov 2012 18:03:19 +0000
In-Reply-To: <7EA643C653F17F4C80DE959E978F10EDFA101107B2@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<2b433b1523e4295bb1ed.1353432210@cosworth.uk.xensource.com>
	<7EA643C653F17F4C80DE959E978F10EDFA101107B2@LONPMAILBOX01.citrite.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-api@lists.xen.org" <xen-api@lists.xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 10 of 15] libxc/ocaml: Add simple binding
 for xentoollog (output only)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 17:41 +0000, Rob Hoes wrote:
> > # HG changeset patch
> > # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> > 2b433b1523e4295bb1ed74a7b71e2a20e00f1802
> > # Parent  5173d29f64fa541f6ec0c48481c4957a03f0302c
> > libxc/ocaml: Add simple binding for xentoollog (output only).
> > 
> > These bindings allow ocaml code to receive log message via xentoollog but
> > do not support injecting messages into xentoollog from ocaml.
> > Receiving log messages from libx{c,l} and forwarding them to ocaml is the
> > use case which is needed by the following patches.
> > 
> > Add a simple noddy test case (tools/ocaml/test).
> > 
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > 
> 
> This is potentially very useful. However, I have a few concerns about the callbacks to OCaml.
> 
> The most important issue is that we'd like to wrap potentially
> blocking C code in caml_enter_blocking_section and caml_leave_blocking
> section calls, to make sure that this code won't block the entire
> OCaml program. Within such a block, it is not allowed to interact with
> the OCaml runtime in any way. This includes callbacks.

> 
> I have notice some weird segfaults happening when using this logging
> code, and they seemed to have gone away when I removed the
> blocking_section calls.
> 
> I can't think of a good solution yet, but to make this really useful,
> I think we may need to do it slightly differently.

Can we call leave/enter from the C part of the callback before heading
back to ocaml, or does it not work like that? Would this require us to
*always* call enter/leave when calling into libxl, in case it generates
a callback (i.e. to balance things out correctly)?

Another idea might be to make the bindings use the async interfaces
wherever possible by default, by definition anything potentially
blocking has supports this and that would avoid the need for
enter/leave, but at the expense of making the ocaml callers ugly
perhaps? Or maybe this sort of thing ends up looking very natural in
ocaml? Depends on your application's event mechanism I suspect.

Last half witted idea: everything could be async but the bindings
include the loop to wait for the async event, i.e. effectively making
the call sync again. This sounds silly but it might allow better control
over the placement of enter/leave vs callbacks, since you would just
drop it over libxl_event_wait?

> I included some smaller comments below.
> 
> > diff -r 5173d29f64fa -r 2b433b1523e4 .gitignore
> > --- a/.gitignore	Tue Nov 20 17:22:21 2012 +0000
> > +++ b/.gitignore	Tue Nov 20 17:22:21 2012 +0000
> > @@ -364,6 +364,7 @@ tools/ocaml/libs/xl/_libxl_types.mli.in
> 
> [.....]
> 
> > +static void stub_xtl_ocaml_vmessage(struct xentoollog_logger *logger,
> > +			       xentoollog_level level,
> > +			       int errnoval,
> > +			       const char *context,
> > +			       const char *format,
> > +			       va_list al)
> > +{
> > +	struct caml_xtl *xtl = (struct caml_xtl*)logger;
> > +	value *func = caml_named_value(xtl->vmessage_cb) ;
> > +	value args[4];
> 
> I think it is safer to use this instead:
> 
>        CAMLparam0();
>        CAMLlocalN(args, 4);
> 
> > +	char *msg;
> > +
> > +	if (args == NULL)
> > +		caml_raise_out_of_memory();
> > +	if (func == NULL)
> > +		caml_raise_sys_error(caml_copy_string("Unable to find
> > callback"));
> > +	if (vasprintf(&msg, format, al) < 0)
> > +		caml_raise_out_of_memory();
> > +
> > +	/* vmessage : level -> int option -> string option -> string -> unit; */
> > +	args[0] = Val_level(level);
> > +	args[1] = Val_errno(errnoval);
> > +	args[2] = Val_context(context);
> > +	args[3] = caml_copy_string(msg);
> > +
> > +	free(msg);
> > +
> > +	caml_callbackN(*func, 4, args);
> 
> Because of the above, we should also add CAMLreturn0.
> 
> > +}
> > +
> > +static void stub_xtl_ocaml_progress(struct xentoollog_logger *logger,
> > +				    const char *context,
> > +				    const char *doing_what /* no \r,\n */,
> > +				    int percent, unsigned long done, unsigned
> > long total) {
> > +	struct caml_xtl *xtl = (struct caml_xtl*)logger;
> > +	value *func = caml_named_value(xtl->progress_cb) ;
> > +	value args[5];
> 
> Here as well:
> 
>        CAMLparam0();
>        CAMLlocalN(args, 5);
> 
> > +
> > +	if (args == NULL)
> > +		caml_raise_out_of_memory();
> > +	if (func == NULL)
> > +		caml_raise_sys_error(caml_copy_string("Unable to find
> > callback"));
> > +
> > +	/* progress : string option -> string -> int -> int64 -> int64 -> unit; */
> > +	args[0] = Val_context(context);
> > +	args[1] = caml_copy_string(doing_what);
> > +	args[2] = Val_int(percent);
> > +	args[3] = caml_copy_int64(done);
> > +	args[4] = caml_copy_int64(total);
> > +
> > +	caml_callbackN(*func, 5, args);
> 
> And CAMLreturn0.
> 
> > +}
> > +
> > +static void xtl_destroy(struct xentoollog_logger *logger) {
> > +	struct caml_xtl *xtl = (struct caml_xtl*)logger;
> > +	free(xtl->vmessage_cb);
> > +	free(xtl->progress_cb);
> > +	free(xtl);
> > +}
> > +
> 
> [...]
> 
> > diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/test/Makefile
> > --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> > +++ b/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
> > @@ -0,0 +1,27 @@
> > +XEN_ROOT = $(CURDIR)/../../..
> > +OCAML_TOPLEVEL = $(CURDIR)/..
> > +include $(OCAML_TOPLEVEL)/common.make
> > +
> > +OCAMLINCLUDE += \
> > +	-I $(OCAML_TOPLEVEL)/libs/xentoollog
> > +
> > +OBJS = xtl
> > +
> > +PROGRAMS = xtl
> > +
> > +xtl_LIBS =  \
> > +	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog
> > +$(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa
> 
> I had to add "-cclib -lxenctrl" here to get it to link properly.
> 
> > +
> > +xtl_OBJS = xtl
> > +
> > +OCAML_PROGRAM = xtl
> > +
> > +all: $(PROGRAMS)
> > +
> > +bins: $(PROGRAMS)
> > +
> > +install: all
> > +	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
> > +	$(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(BINDIR)
> > +
> > +include $(OCAML_TOPLEVEL)/Makefile.rules
> > diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/test/xtl.ml
> > --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> > +++ b/tools/ocaml/test/xtl.ml	Tue Nov 20 17:22:21 2012 +0000
> > @@ -0,0 +1,20 @@
> > +open Arg
> > +open Xentoollog
> > +
> > +let do_test level =
> > +  let lgr = Xentoollog.create_stdio_logger ~level:level () in
> > +  begin
> > +    Xentoollog.test lgr;
> > +    Xentoollog.destroy lgr;
> > +  end
> > +
> > +let () =
> > +  let debug_level = ref Xentoollog.Info in
> > +  let speclist = [
> > +    ("-v", Arg.Unit (fun () -> debug_level := Xentoollog.Debug), "Verbose");
> > +    ("-q", Arg.Unit (fun () -> debug_level := Xentoollog.Critical),
> > +"Quiet");
> > +  ] in
> > +  let usage_msg = "usage: xtl [OPTIONS]" in
> > +  Arg.parse speclist (fun s -> ()) usage_msg;
> > +
> > +  do_test !debug_level
> > 
> 
> Cheers,
> Rob



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 18:03:35 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:03:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8SL-0002Lk-3j; Thu, 29 Nov 2012 18:03:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1Te8SI-0002LP-U9; Thu, 29 Nov 2012 18:03:23 +0000
Received: from [85.158.139.211:43077] by server-1.bemta-5.messagelabs.com id
	4E/96-09311-A63A7B05; Thu, 29 Nov 2012 18:03:22 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1354212201!18459162!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9791 invoked from network); 29 Nov 2012 18:03:21 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 18:03:21 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16077309"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 18:03:21 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 18:03:21 +0000
Message-ID: <1354212199.6269.67.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Rob Hoes <Rob.Hoes@citrix.com>
Date: Thu, 29 Nov 2012 18:03:19 +0000
In-Reply-To: <7EA643C653F17F4C80DE959E978F10EDFA101107B2@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<2b433b1523e4295bb1ed.1353432210@cosworth.uk.xensource.com>
	<7EA643C653F17F4C80DE959E978F10EDFA101107B2@LONPMAILBOX01.citrite.net>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-api@lists.xen.org" <xen-api@lists.xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 10 of 15] libxc/ocaml: Add simple binding
 for xentoollog (output only)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 17:41 +0000, Rob Hoes wrote:
> > # HG changeset patch
> > # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> > 2b433b1523e4295bb1ed74a7b71e2a20e00f1802
> > # Parent  5173d29f64fa541f6ec0c48481c4957a03f0302c
> > libxc/ocaml: Add simple binding for xentoollog (output only).
> > 
> > These bindings allow ocaml code to receive log message via xentoollog but
> > do not support injecting messages into xentoollog from ocaml.
> > Receiving log messages from libx{c,l} and forwarding them to ocaml is the
> > use case which is needed by the following patches.
> > 
> > Add a simple noddy test case (tools/ocaml/test).
> > 
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > 
> 
> This is potentially very useful. However, I have a few concerns about the callbacks to OCaml.
> 
> The most important issue is that we'd like to wrap potentially
> blocking C code in caml_enter_blocking_section and caml_leave_blocking
> section calls, to make sure that this code won't block the entire
> OCaml program. Within such a block, it is not allowed to interact with
> the OCaml runtime in any way. This includes callbacks.

> 
> I have notice some weird segfaults happening when using this logging
> code, and they seemed to have gone away when I removed the
> blocking_section calls.
> 
> I can't think of a good solution yet, but to make this really useful,
> I think we may need to do it slightly differently.

Can we call leave/enter from the C part of the callback before heading
back to ocaml, or does it not work like that? Would this require us to
*always* call enter/leave when calling into libxl, in case it generates
a callback (i.e. to balance things out correctly)?

Another idea might be to make the bindings use the async interfaces
wherever possible by default, by definition anything potentially
blocking has supports this and that would avoid the need for
enter/leave, but at the expense of making the ocaml callers ugly
perhaps? Or maybe this sort of thing ends up looking very natural in
ocaml? Depends on your application's event mechanism I suspect.

Last half witted idea: everything could be async but the bindings
include the loop to wait for the async event, i.e. effectively making
the call sync again. This sounds silly but it might allow better control
over the placement of enter/leave vs callbacks, since you would just
drop it over libxl_event_wait?

> I included some smaller comments below.
> 
> > diff -r 5173d29f64fa -r 2b433b1523e4 .gitignore
> > --- a/.gitignore	Tue Nov 20 17:22:21 2012 +0000
> > +++ b/.gitignore	Tue Nov 20 17:22:21 2012 +0000
> > @@ -364,6 +364,7 @@ tools/ocaml/libs/xl/_libxl_types.mli.in
> 
> [.....]
> 
> > +static void stub_xtl_ocaml_vmessage(struct xentoollog_logger *logger,
> > +			       xentoollog_level level,
> > +			       int errnoval,
> > +			       const char *context,
> > +			       const char *format,
> > +			       va_list al)
> > +{
> > +	struct caml_xtl *xtl = (struct caml_xtl*)logger;
> > +	value *func = caml_named_value(xtl->vmessage_cb) ;
> > +	value args[4];
> 
> I think it is safer to use this instead:
> 
>        CAMLparam0();
>        CAMLlocalN(args, 4);
> 
> > +	char *msg;
> > +
> > +	if (args == NULL)
> > +		caml_raise_out_of_memory();
> > +	if (func == NULL)
> > +		caml_raise_sys_error(caml_copy_string("Unable to find
> > callback"));
> > +	if (vasprintf(&msg, format, al) < 0)
> > +		caml_raise_out_of_memory();
> > +
> > +	/* vmessage : level -> int option -> string option -> string -> unit; */
> > +	args[0] = Val_level(level);
> > +	args[1] = Val_errno(errnoval);
> > +	args[2] = Val_context(context);
> > +	args[3] = caml_copy_string(msg);
> > +
> > +	free(msg);
> > +
> > +	caml_callbackN(*func, 4, args);
> 
> Because of the above, we should also add CAMLreturn0.
> 
> > +}
> > +
> > +static void stub_xtl_ocaml_progress(struct xentoollog_logger *logger,
> > +				    const char *context,
> > +				    const char *doing_what /* no \r,\n */,
> > +				    int percent, unsigned long done, unsigned
> > long total) {
> > +	struct caml_xtl *xtl = (struct caml_xtl*)logger;
> > +	value *func = caml_named_value(xtl->progress_cb) ;
> > +	value args[5];
> 
> Here as well:
> 
>        CAMLparam0();
>        CAMLlocalN(args, 5);
> 
> > +
> > +	if (args == NULL)
> > +		caml_raise_out_of_memory();
> > +	if (func == NULL)
> > +		caml_raise_sys_error(caml_copy_string("Unable to find
> > callback"));
> > +
> > +	/* progress : string option -> string -> int -> int64 -> int64 -> unit; */
> > +	args[0] = Val_context(context);
> > +	args[1] = caml_copy_string(doing_what);
> > +	args[2] = Val_int(percent);
> > +	args[3] = caml_copy_int64(done);
> > +	args[4] = caml_copy_int64(total);
> > +
> > +	caml_callbackN(*func, 5, args);
> 
> And CAMLreturn0.
> 
> > +}
> > +
> > +static void xtl_destroy(struct xentoollog_logger *logger) {
> > +	struct caml_xtl *xtl = (struct caml_xtl*)logger;
> > +	free(xtl->vmessage_cb);
> > +	free(xtl->progress_cb);
> > +	free(xtl);
> > +}
> > +
> 
> [...]
> 
> > diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/test/Makefile
> > --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> > +++ b/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
> > @@ -0,0 +1,27 @@
> > +XEN_ROOT = $(CURDIR)/../../..
> > +OCAML_TOPLEVEL = $(CURDIR)/..
> > +include $(OCAML_TOPLEVEL)/common.make
> > +
> > +OCAMLINCLUDE += \
> > +	-I $(OCAML_TOPLEVEL)/libs/xentoollog
> > +
> > +OBJS = xtl
> > +
> > +PROGRAMS = xtl
> > +
> > +xtl_LIBS =  \
> > +	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog
> > +$(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa
> 
> I had to add "-cclib -lxenctrl" here to get it to link properly.
> 
> > +
> > +xtl_OBJS = xtl
> > +
> > +OCAML_PROGRAM = xtl
> > +
> > +all: $(PROGRAMS)
> > +
> > +bins: $(PROGRAMS)
> > +
> > +install: all
> > +	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
> > +	$(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(BINDIR)
> > +
> > +include $(OCAML_TOPLEVEL)/Makefile.rules
> > diff -r 5173d29f64fa -r 2b433b1523e4 tools/ocaml/test/xtl.ml
> > --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> > +++ b/tools/ocaml/test/xtl.ml	Tue Nov 20 17:22:21 2012 +0000
> > @@ -0,0 +1,20 @@
> > +open Arg
> > +open Xentoollog
> > +
> > +let do_test level =
> > +  let lgr = Xentoollog.create_stdio_logger ~level:level () in
> > +  begin
> > +    Xentoollog.test lgr;
> > +    Xentoollog.destroy lgr;
> > +  end
> > +
> > +let () =
> > +  let debug_level = ref Xentoollog.Info in
> > +  let speclist = [
> > +    ("-v", Arg.Unit (fun () -> debug_level := Xentoollog.Debug), "Verbose");
> > +    ("-q", Arg.Unit (fun () -> debug_level := Xentoollog.Critical),
> > +"Quiet");
> > +  ] in
> > +  let usage_msg = "usage: xtl [OPTIONS]" in
> > +  Arg.parse speclist (fun s -> ()) usage_msg;
> > +
> > +  do_test !debug_level
> > 
> 
> Cheers,
> Rob



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 18:05:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:05:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8UO-0002af-TE; Thu, 29 Nov 2012 18:05:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te8UN-0002aS-O9
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:05:31 +0000
Received: from [85.158.138.51:43807] by server-11.bemta-3.messagelabs.com id
	1E/3F-19361-6E3A7B05; Thu, 29 Nov 2012 18:05:26 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1354212325!31992981!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18129 invoked from network); 29 Nov 2012 18:05:26 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 18:05:26 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16077330"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 18:05:01 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 18:05:01 +0000
Message-ID: <1354212300.6269.68.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Thu, 29 Nov 2012 18:05:00 +0000
In-Reply-To: <20121129175923.GL80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352824724.7491.103.camel@zakaz.uk.xensource.com>
	<20121129175923.GL80627@ocelot.phlegethon.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2 00/12] arm: support for initial modules
 (e.g. dom0) and DTB supplied in RAM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 17:59 +0000, Tim Deegan wrote:
> Right.  For 1, 2, 3, 6 and 11:
> 
> Acked-by: Tim Deegan <tim@xen.org>
> 
> 5, 7 and 10 already have my Ack on them.  4, 8, 9 and 12 need some more
> attention.

Thanks!

I'll see what I can sweep through into the tree (perhaps tomorrow) given
this set of acks and then look at addressing your comments on the rest.

Cheers,
Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 18:05:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:05:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8UO-0002af-TE; Thu, 29 Nov 2012 18:05:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1Te8UN-0002aS-O9
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:05:31 +0000
Received: from [85.158.138.51:43807] by server-11.bemta-3.messagelabs.com id
	1E/3F-19361-6E3A7B05; Thu, 29 Nov 2012 18:05:26 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1354212325!31992981!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDUyNzg=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18129 invoked from network); 29 Nov 2012 18:05:26 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 18:05:26 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16077330"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 18:05:01 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Thu, 29 Nov 2012 18:05:01 +0000
Message-ID: <1354212300.6269.68.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Tim Deegan <tim@xen.org>
Date: Thu, 29 Nov 2012 18:05:00 +0000
In-Reply-To: <20121129175923.GL80627@ocelot.phlegethon.org>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352824724.7491.103.camel@zakaz.uk.xensource.com>
	<20121129175923.GL80627@ocelot.phlegethon.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2 00/12] arm: support for initial modules
 (e.g. dom0) and DTB supplied in RAM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 17:59 +0000, Tim Deegan wrote:
> Right.  For 1, 2, 3, 6 and 11:
> 
> Acked-by: Tim Deegan <tim@xen.org>
> 
> 5, 7 and 10 already have my Ack on them.  4, 8, 9 and 12 need some more
> attention.

Thanks!

I'll see what I can sweep through into the tree (perhaps tomorrow) given
this set of acks and then look at addressing your comments on the rest.

Cheers,
Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 18:05:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:05:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8Ua-0002cT-AI; Thu, 29 Nov 2012 18:05:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te8UZ-0002c7-Aa
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:05:43 +0000
Received: from [193.109.254.147:55982] by server-11.bemta-14.messagelabs.com
	id 69/1E-29027-6F3A7B05; Thu, 29 Nov 2012 18:05:42 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1354212323!8523397!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1483 invoked from network); 29 Nov 2012 18:05:24 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-12.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 18:05:24 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te8UF-000MLF-Fo; Thu, 29 Nov 2012 18:05:23 +0000
Date: Thu, 29 Nov 2012 18:05:23 +0000
From: Tim Deegan <tim@xen.org>
To: Razvan Cojocaru <rzvncj@gmail.com>
Message-ID: <20121129180523.GM80627@ocelot.phlegethon.org>
References: <50B77375.9070904@gmail.com>
	<20121129155831.GE80627@ocelot.phlegethon.org>
	<50B78B4B.2050106@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B78B4B.2050106@gmail.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 18:20 +0200 on 29 Nov (1354213227), Razvan Cojocaru wrote:
> Hello, thank you for the quick reply!
> >That might work for single-vcpu guests.  On multi-vcpu, you'd have to
> >pause the whole VM, unprotect the page, single-step the one vcpu that
> >trapped, re-protect the page, and unpause the VM.  That might be
> >unacceptably slow.
> 
> Ah, the simple fact that the words "unacceptably slow" could be employed 
> to describe the situation makes this approach very unlikely to fit my 
> purposes.
> 
> I'm still interested in how the debugger API works, though. Maybe, just 
> maybe, it'll just be acceptably slow. :)

:) I think it will depend entirely on how much memory you protect and
what the guest is doing with it.

It should be possible to make the multi-vcpu case of single-stepping
work better by having per-cpu EPT tables, if you're up for hacking away
at Xen.  That way you wouldn't have to pause the other vcpus while you
made the memory writeable.

> >You could try:
> >  - pause the domain
> >  - copy out the contents of the page
> >  - use XENMEM_decrease_reservation to remove the page from the guest
> >  - unpause the domain
> >
> >Then all accesses to that page will get emulated by Xen and forwarded to
> >qemu, just like happens for emulated MMIO devices.  In qemu, you can
> >emulate the read or write access, and do anything else you like at the
> >same time.
> >
> >That won't work for memory that's accessed in non-trivial ways
> >(e.g. used for pagetables or descriptor tables) or using instructions
> >that are unsupported/buggy in Xen's instruction emulator.
> 
> Well, I need it to be able to work on _all_ memory, however accessed. 

Ah, in that case this won't work for you.  I think the single-step may
be your only option.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 18:05:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:05:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8Ua-0002cT-AI; Thu, 29 Nov 2012 18:05:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1Te8UZ-0002c7-Aa
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:05:43 +0000
Received: from [193.109.254.147:55982] by server-11.bemta-14.messagelabs.com
	id 69/1E-29027-6F3A7B05; Thu, 29 Nov 2012 18:05:42 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1354212323!8523397!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1483 invoked from network); 29 Nov 2012 18:05:24 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-12.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 18:05:24 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1Te8UF-000MLF-Fo; Thu, 29 Nov 2012 18:05:23 +0000
Date: Thu, 29 Nov 2012 18:05:23 +0000
From: Tim Deegan <tim@xen.org>
To: Razvan Cojocaru <rzvncj@gmail.com>
Message-ID: <20121129180523.GM80627@ocelot.phlegethon.org>
References: <50B77375.9070904@gmail.com>
	<20121129155831.GE80627@ocelot.phlegethon.org>
	<50B78B4B.2050106@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B78B4B.2050106@gmail.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 18:20 +0200 on 29 Nov (1354213227), Razvan Cojocaru wrote:
> Hello, thank you for the quick reply!
> >That might work for single-vcpu guests.  On multi-vcpu, you'd have to
> >pause the whole VM, unprotect the page, single-step the one vcpu that
> >trapped, re-protect the page, and unpause the VM.  That might be
> >unacceptably slow.
> 
> Ah, the simple fact that the words "unacceptably slow" could be employed 
> to describe the situation makes this approach very unlikely to fit my 
> purposes.
> 
> I'm still interested in how the debugger API works, though. Maybe, just 
> maybe, it'll just be acceptably slow. :)

:) I think it will depend entirely on how much memory you protect and
what the guest is doing with it.

It should be possible to make the multi-vcpu case of single-stepping
work better by having per-cpu EPT tables, if you're up for hacking away
at Xen.  That way you wouldn't have to pause the other vcpus while you
made the memory writeable.

> >You could try:
> >  - pause the domain
> >  - copy out the contents of the page
> >  - use XENMEM_decrease_reservation to remove the page from the guest
> >  - unpause the domain
> >
> >Then all accesses to that page will get emulated by Xen and forwarded to
> >qemu, just like happens for emulated MMIO devices.  In qemu, you can
> >emulate the read or write access, and do anything else you like at the
> >same time.
> >
> >That won't work for memory that's accessed in non-trivial ways
> >(e.g. used for pagetables or descriptor tables) or using instructions
> >that are unsupported/buggy in Xen's instruction emulator.
> 
> Well, I need it to be able to work on _all_ memory, however accessed. 

Ah, in that case this won't work for you.  I think the single-step may
be your only option.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 18:08:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:08:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8Wf-0002rQ-52; Thu, 29 Nov 2012 18:07:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te8Wd-0002rD-H8
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:07:51 +0000
Received: from [85.158.138.51:9366] by server-5.bemta-3.messagelabs.com id
	A5/EC-26311-674A7B05; Thu, 29 Nov 2012 18:07:50 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-4.tower-174.messagelabs.com!1354212468!32028174!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7891 invoked from network); 29 Nov 2012 18:07:49 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-4.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 18:07:49 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158390573;
	Thu, 29 Nov 2012 13:07:31 -0500
Message-ID: <50B7A45D.1050607@jhuapl.edu>
Date: Thu, 29 Nov 2012 13:07:25 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B52524.6030707@tycho.nsa.gov>
	<1354054610-10720-1-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1354054610-10720-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: "samuel.thibault@ens-lyon.org" <samuel.thibault@ens-lyon.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] stubdom/vtpm: make state save operation
	atomic
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1863171024055754067=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============1863171024055754067==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms000306090006050103030206"

This is a cryptographically signed message in MIME format.

--------------ms000306090006050103030206
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/27/2012 05:16 PM, Daniel De Graaf wrote:
> This changes the save format of the vtpm stubdom to include two copies
> of the saved data: one active, and one inactive. When saving the state,=

> data is written to the inactive slot before updating the key and hash
> saved with the TPM Manager, which determines the active slot when the
> vTPM starts up.
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>   stubdom/vtpm/vtpmblk.c | 66 +++++++++++++++++++++++++++++++++++++++++=
---------
>   1 file changed, 54 insertions(+), 12 deletions(-)
>
> diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
> index b343bd8..f988606 100644
> --- a/stubdom/vtpm/vtpmblk.c
> +++ b/stubdom/vtpm/vtpmblk.c
> @@ -23,6 +23,8 @@
>  =20
>   /*Encryption key and block sizes */
>   #define BLKSZ 16
> +/* Maximum size of one saved-state slot */
> +#define SLOT_SIZE 32768
Instead of statically defining a slot size and stressing over whether or =

not it may be too small, why not make it half the size of the disk=20
image? You can retrieve the disk size by doing fstat(blkfront_fd).
>  =20
>   static struct blkfront_dev* blkdev =3D NULL;
>   static int blkfront_fd =3D -1;
> @@ -59,15 +61,20 @@ void shutdown_vtpmblk(void)
>      blkdev =3D NULL;
>   }
>  =20
> -int write_vtpmblk_raw(uint8_t *data, size_t data_length)
> +static int write_vtpmblk_raw(uint8_t *data, size_t data_length, int sl=
ot)
>   {
>      int rc;
>      uint32_t lenbuf;
>      debug("Begin Write data=3D%p len=3D%u", data, data_length);
Should add which slot were writing to and possibly the disk offset as=20
well to the debug print
>  =20
> +   if (data_length > SLOT_SIZE - 4) {
> +      error("write(data) cannot fit in data slot (%d). Increase SLOT_S=
IZE.", data_length);
> +      return -1;
> +   }
> +
>      lenbuf =3D cpu_to_be32((uint32_t)data_length);
>  =20
> -   lseek(blkfront_fd, 0, SEEK_SET);
> +   lseek(blkfront_fd, slot * SLOT_SIZE, SEEK_SET);
>      if((rc =3D write(blkfront_fd, (uint8_t*)&lenbuf, 4)) !=3D 4) {
>         error("write(length) failed! error was %s", strerror(errno));
>         return -1;
> @@ -82,12 +89,12 @@ int write_vtpmblk_raw(uint8_t *data, size_t data_le=
ngth)
>      return 0;
>   }
>  =20
> -int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
> +static int read_vtpmblk_raw(uint8_t **data, size_t *data_length, int s=
lot)
>   {
>      int rc;
>      uint32_t lenbuf;
>  =20
> -   lseek(blkfront_fd, 0, SEEK_SET);
> +   lseek(blkfront_fd, slot * SLOT_SIZE, SEEK_SET);
>      if(( rc =3D read(blkfront_fd, (uint8_t*)&lenbuf, 4)) !=3D 4) {
>         error("read(length) failed! error was %s", strerror(errno));
>         return -1;
> @@ -97,6 +104,10 @@ int read_vtpmblk_raw(uint8_t **data, size_t *data_l=
ength)
>         error("read 0 data_length for NVM");
>         return -1;
>      }
> +   if(*data_length > SLOT_SIZE - 4) {
> +      error("read invalid data_length for NVM");
> +      return -1;
> +   }
>  =20
>      *data =3D tpm_malloc(*data_length);
>      if((rc =3D read(blkfront_fd, *data, *data_length)) !=3D *data_leng=
th) {
> @@ -221,6 +232,8 @@ egress:
>      return rc;
>   }
>  =20
> +static int active_slot =3D -1;
I think we should initialize to 0 or 1 because -1 is an invalid state.
For a new vtpm, read_vtpmblk() will fail and I think this is what happens=
:
read_vtpmblk()
try_fetch_key_from_manager() -> fails
goto abort_egress
active_slot =3D -1 (you have this below)

Then later
write_vtpmblk()
active_slot =3D !active_slot (!-1 =3D 0)

The last line happens to work correctly but I don't think its very=20
clear. I think we should initialize to 1 and set it to 1 if=20
read_vtpmblk() fails.

Also a minor nitpick, the name is active_slot, but what it really is is=20
the last_slot_written_to because everytime you write you change it first.=

> +
>   int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, s=
ize_t data_length) {
>      int rc;
>      uint8_t* cipher =3D NULL;
> @@ -228,12 +241,15 @@ int write_vtpmblk(struct tpmfront_dev* tpmfront_d=
ev, uint8_t* data, size_t data_
>      uint8_t hashkey[HASHKEYSZ];
>      uint8_t* symkey =3D hashkey + HASHSZ;
>  =20
> +   /* Switch to the other slot */
> +   active_slot =3D !active_slot;
> +
>      /* Encrypt the data */
>      if((rc =3D encrypt_vtpmblk(data, data_length, &cipher, &cipher_len=
, symkey))) {
>         goto abort_egress;
>      }
>      /* Write to disk */
> -   if((rc =3D write_vtpmblk_raw(cipher, cipher_len))) {
> +   if((rc =3D write_vtpmblk_raw(cipher, cipher_len, active_slot))) {
>         goto abort_egress;
>      }
>      /* Get sha1 hash of data */
> @@ -256,7 +272,8 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev,=
 uint8_t** data, size_t *data
>      size_t cipher_len =3D 0;
>      size_t keysize;
>      uint8_t* hashkey =3D NULL;
> -   uint8_t hash[HASHSZ];
> +   uint8_t hash0[HASHSZ];
> +   uint8_t hash1[HASHSZ];
>      uint8_t* symkey;
>  =20
>      /* Retreive the hash and the key from the manager */
> @@ -270,14 +287,32 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_de=
v, uint8_t** data, size_t *data
>      }
>      symkey =3D hashkey + HASHSZ;
>  =20
> -   /* Read from disk now */
> -   if((rc =3D read_vtpmblk_raw(&cipher, &cipher_len))) {
> +   active_slot =3D 0;
> +   /* Read slot 0 from disk now */
> +   if((rc =3D read_vtpmblk_raw(&cipher, &cipher_len, 0))) {
> +      goto abort_egress;
> +   }
> +
> +   /* Compute the hash of the cipher text and compare */
> +   sha1(cipher, cipher_len, hash0);
> +   if(!memcmp(hash0, hashkey, HASHSZ))
> +      goto valid;
> +
> +   free(cipher);
> +   cipher =3D NULL;
> +
> +   active_slot =3D 1;
> +   /* Read slot 1 from disk now */
> +   if((rc =3D read_vtpmblk_raw(&cipher, &cipher_len, 1))) {
>         goto abort_egress;
>      }
>  =20
>      /* Compute the hash of the cipher text and compare */
> -   sha1(cipher, cipher_len, hash);
> -   if(memcmp(hash, hashkey, HASHSZ)) {
> +   sha1(cipher, cipher_len, hash1);
> +   if(!memcmp(hash1, hashkey, HASHSZ))
> +      goto valid;
> +
> +   {
>         int i;
>         error("NVM Storage Checksum failed!");
>         printf("Expected: ");
> @@ -285,14 +320,20 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_de=
v, uint8_t** data, size_t *data
>   	 printf("%02hhX ", hashkey[i]);
>         }
>         printf("\n");
> -      printf("Actual:   ");
> +      printf("Slot 0:   ");
> +      for(i =3D 0; i < HASHSZ; ++i) {
> +	 printf("%02hhX ", hash0[i]);
> +      }
> +      printf("\n");
> +      printf("Slot 1:   ");
>         for(i =3D 0; i < HASHSZ; ++i) {
> -	 printf("%02hhX ", hash[i]);
> +	 printf("%02hhX ", hash1[i]);
>         }
>         printf("\n");
>         rc =3D -1;
>         goto abort_egress;
>      }
> +valid:
>  =20
>      /* Decrypt the blob */
>      if((rc =3D decrypt_vtpmblk(cipher, cipher_len, data, data_length, =
symkey))) {
> @@ -300,6 +341,7 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev,=
 uint8_t** data, size_t *data
>      }
>      goto egress;
>   abort_egress:
> +   active_slot =3D -1;
See my comment above
>   egress:
>      free(cipher);
>      free(hashkey);



--------------ms000306090006050103030206
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlCwMBAQEBBAoWCGZpb3JhbWUxMBsGDSsGAQQBsyUL
AwEBAQIEChIIMDAxMDQyNjEwWAYJYIZIAYb6ax4BBEsMSVRoZSBwcml2YXRlIGtleSBjb3Jy
ZXNwb25kaW5nIHRvIHRoaXMgY2VydGlmaWNhdGUgbWF5IGhhdmUgYmVlbiBleHBvcnRlZC4w
KAYDVR0RBCEwH4EdTWF0dGhldy5GaW9yYXZhbnRlQGpodWFwbC5lZHUwUgYDVR0fBEswSTBH
oEWgQ6RBMD8xC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-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

--===============1863171024055754067==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 18:08:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:08:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8Wf-0002rQ-52; Thu, 29 Nov 2012 18:07:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te8Wd-0002rD-H8
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:07:51 +0000
Received: from [85.158.138.51:9366] by server-5.bemta-3.messagelabs.com id
	A5/EC-26311-674A7B05; Thu, 29 Nov 2012 18:07:50 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-4.tower-174.messagelabs.com!1354212468!32028174!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7891 invoked from network); 29 Nov 2012 18:07:49 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-4.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 18:07:49 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158390573;
	Thu, 29 Nov 2012 13:07:31 -0500
Message-ID: <50B7A45D.1050607@jhuapl.edu>
Date: Thu, 29 Nov 2012 13:07:25 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B52524.6030707@tycho.nsa.gov>
	<1354054610-10720-1-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1354054610-10720-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: "samuel.thibault@ens-lyon.org" <samuel.thibault@ens-lyon.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] stubdom/vtpm: make state save operation
	atomic
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1863171024055754067=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============1863171024055754067==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms000306090006050103030206"

This is a cryptographically signed message in MIME format.

--------------ms000306090006050103030206
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/27/2012 05:16 PM, Daniel De Graaf wrote:
> This changes the save format of the vtpm stubdom to include two copies
> of the saved data: one active, and one inactive. When saving the state,=

> data is written to the inactive slot before updating the key and hash
> saved with the TPM Manager, which determines the active slot when the
> vTPM starts up.
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>   stubdom/vtpm/vtpmblk.c | 66 +++++++++++++++++++++++++++++++++++++++++=
---------
>   1 file changed, 54 insertions(+), 12 deletions(-)
>
> diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
> index b343bd8..f988606 100644
> --- a/stubdom/vtpm/vtpmblk.c
> +++ b/stubdom/vtpm/vtpmblk.c
> @@ -23,6 +23,8 @@
>  =20
>   /*Encryption key and block sizes */
>   #define BLKSZ 16
> +/* Maximum size of one saved-state slot */
> +#define SLOT_SIZE 32768
Instead of statically defining a slot size and stressing over whether or =

not it may be too small, why not make it half the size of the disk=20
image? You can retrieve the disk size by doing fstat(blkfront_fd).
>  =20
>   static struct blkfront_dev* blkdev =3D NULL;
>   static int blkfront_fd =3D -1;
> @@ -59,15 +61,20 @@ void shutdown_vtpmblk(void)
>      blkdev =3D NULL;
>   }
>  =20
> -int write_vtpmblk_raw(uint8_t *data, size_t data_length)
> +static int write_vtpmblk_raw(uint8_t *data, size_t data_length, int sl=
ot)
>   {
>      int rc;
>      uint32_t lenbuf;
>      debug("Begin Write data=3D%p len=3D%u", data, data_length);
Should add which slot were writing to and possibly the disk offset as=20
well to the debug print
>  =20
> +   if (data_length > SLOT_SIZE - 4) {
> +      error("write(data) cannot fit in data slot (%d). Increase SLOT_S=
IZE.", data_length);
> +      return -1;
> +   }
> +
>      lenbuf =3D cpu_to_be32((uint32_t)data_length);
>  =20
> -   lseek(blkfront_fd, 0, SEEK_SET);
> +   lseek(blkfront_fd, slot * SLOT_SIZE, SEEK_SET);
>      if((rc =3D write(blkfront_fd, (uint8_t*)&lenbuf, 4)) !=3D 4) {
>         error("write(length) failed! error was %s", strerror(errno));
>         return -1;
> @@ -82,12 +89,12 @@ int write_vtpmblk_raw(uint8_t *data, size_t data_le=
ngth)
>      return 0;
>   }
>  =20
> -int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
> +static int read_vtpmblk_raw(uint8_t **data, size_t *data_length, int s=
lot)
>   {
>      int rc;
>      uint32_t lenbuf;
>  =20
> -   lseek(blkfront_fd, 0, SEEK_SET);
> +   lseek(blkfront_fd, slot * SLOT_SIZE, SEEK_SET);
>      if(( rc =3D read(blkfront_fd, (uint8_t*)&lenbuf, 4)) !=3D 4) {
>         error("read(length) failed! error was %s", strerror(errno));
>         return -1;
> @@ -97,6 +104,10 @@ int read_vtpmblk_raw(uint8_t **data, size_t *data_l=
ength)
>         error("read 0 data_length for NVM");
>         return -1;
>      }
> +   if(*data_length > SLOT_SIZE - 4) {
> +      error("read invalid data_length for NVM");
> +      return -1;
> +   }
>  =20
>      *data =3D tpm_malloc(*data_length);
>      if((rc =3D read(blkfront_fd, *data, *data_length)) !=3D *data_leng=
th) {
> @@ -221,6 +232,8 @@ egress:
>      return rc;
>   }
>  =20
> +static int active_slot =3D -1;
I think we should initialize to 0 or 1 because -1 is an invalid state.
For a new vtpm, read_vtpmblk() will fail and I think this is what happens=
:
read_vtpmblk()
try_fetch_key_from_manager() -> fails
goto abort_egress
active_slot =3D -1 (you have this below)

Then later
write_vtpmblk()
active_slot =3D !active_slot (!-1 =3D 0)

The last line happens to work correctly but I don't think its very=20
clear. I think we should initialize to 1 and set it to 1 if=20
read_vtpmblk() fails.

Also a minor nitpick, the name is active_slot, but what it really is is=20
the last_slot_written_to because everytime you write you change it first.=

> +
>   int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, s=
ize_t data_length) {
>      int rc;
>      uint8_t* cipher =3D NULL;
> @@ -228,12 +241,15 @@ int write_vtpmblk(struct tpmfront_dev* tpmfront_d=
ev, uint8_t* data, size_t data_
>      uint8_t hashkey[HASHKEYSZ];
>      uint8_t* symkey =3D hashkey + HASHSZ;
>  =20
> +   /* Switch to the other slot */
> +   active_slot =3D !active_slot;
> +
>      /* Encrypt the data */
>      if((rc =3D encrypt_vtpmblk(data, data_length, &cipher, &cipher_len=
, symkey))) {
>         goto abort_egress;
>      }
>      /* Write to disk */
> -   if((rc =3D write_vtpmblk_raw(cipher, cipher_len))) {
> +   if((rc =3D write_vtpmblk_raw(cipher, cipher_len, active_slot))) {
>         goto abort_egress;
>      }
>      /* Get sha1 hash of data */
> @@ -256,7 +272,8 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev,=
 uint8_t** data, size_t *data
>      size_t cipher_len =3D 0;
>      size_t keysize;
>      uint8_t* hashkey =3D NULL;
> -   uint8_t hash[HASHSZ];
> +   uint8_t hash0[HASHSZ];
> +   uint8_t hash1[HASHSZ];
>      uint8_t* symkey;
>  =20
>      /* Retreive the hash and the key from the manager */
> @@ -270,14 +287,32 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_de=
v, uint8_t** data, size_t *data
>      }
>      symkey =3D hashkey + HASHSZ;
>  =20
> -   /* Read from disk now */
> -   if((rc =3D read_vtpmblk_raw(&cipher, &cipher_len))) {
> +   active_slot =3D 0;
> +   /* Read slot 0 from disk now */
> +   if((rc =3D read_vtpmblk_raw(&cipher, &cipher_len, 0))) {
> +      goto abort_egress;
> +   }
> +
> +   /* Compute the hash of the cipher text and compare */
> +   sha1(cipher, cipher_len, hash0);
> +   if(!memcmp(hash0, hashkey, HASHSZ))
> +      goto valid;
> +
> +   free(cipher);
> +   cipher =3D NULL;
> +
> +   active_slot =3D 1;
> +   /* Read slot 1 from disk now */
> +   if((rc =3D read_vtpmblk_raw(&cipher, &cipher_len, 1))) {
>         goto abort_egress;
>      }
>  =20
>      /* Compute the hash of the cipher text and compare */
> -   sha1(cipher, cipher_len, hash);
> -   if(memcmp(hash, hashkey, HASHSZ)) {
> +   sha1(cipher, cipher_len, hash1);
> +   if(!memcmp(hash1, hashkey, HASHSZ))
> +      goto valid;
> +
> +   {
>         int i;
>         error("NVM Storage Checksum failed!");
>         printf("Expected: ");
> @@ -285,14 +320,20 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_de=
v, uint8_t** data, size_t *data
>   	 printf("%02hhX ", hashkey[i]);
>         }
>         printf("\n");
> -      printf("Actual:   ");
> +      printf("Slot 0:   ");
> +      for(i =3D 0; i < HASHSZ; ++i) {
> +	 printf("%02hhX ", hash0[i]);
> +      }
> +      printf("\n");
> +      printf("Slot 1:   ");
>         for(i =3D 0; i < HASHSZ; ++i) {
> -	 printf("%02hhX ", hash[i]);
> +	 printf("%02hhX ", hash1[i]);
>         }
>         printf("\n");
>         rc =3D -1;
>         goto abort_egress;
>      }
> +valid:
>  =20
>      /* Decrypt the blob */
>      if((rc =3D decrypt_vtpmblk(cipher, cipher_len, data, data_length, =
symkey))) {
> @@ -300,6 +341,7 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev,=
 uint8_t** data, size_t *data
>      }
>      goto egress;
>   abort_egress:
> +   active_slot =3D -1;
See my comment above
>   egress:
>      free(cipher);
>      free(hashkey);



--------------ms000306090006050103030206
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5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hvcNAQkFMQ8XDTEyMTEyOTE4MDcyNVowIwYJKoZIhvcNAQkEMRYEFHwvosWgCwnRopDG
u3htj0yCYz+NMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAH3ImdgCdCtPGu2f78YFo+JSXAmMRzflb5
Ly0a2tqLvvQk5nvSx7C7RDCgMmJBlKTrUGrnYkgOs40Y56z70k0lW3wjWU4qGFQ3BSxosPq+
sdGRNADBnTxwg3WUM5aybJ4IgYV9A3eu4ZiAS2lrUb+y5QFXAzMt3NeLmhxMm17SfQAAAAAA
AA==
--------------ms000306090006050103030206--


--===============1863171024055754067==
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.xen.org
http://lists.xen.org/xen-devel

--===============1863171024055754067==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 18:21:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:21:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8jQ-0003JZ-Nl; Thu, 29 Nov 2012 18:21:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <anil@recoil.org>) id 1Te8jO-0003JP-TT
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:21:03 +0000
Received: from [85.158.139.211:34069] by server-11.bemta-5.messagelabs.com id
	D8/9D-03409-E87A7B05; Thu, 29 Nov 2012 18:21:02 +0000
X-Env-Sender: anil@recoil.org
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354213261!14184702!1
X-Originating-IP: [89.16.177.154]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5192 invoked from network); 29 Nov 2012 18:21:01 -0000
Received: from recoil.dh.bytemark.co.uk (HELO dark.recoil.org) (89.16.177.154)
	by server-13.tower-206.messagelabs.com with SMTP;
	29 Nov 2012 18:21:01 -0000
Received: (qmail 1708 invoked by uid 634); 29 Nov 2012 18:21:01 -0000
X-Spam-Level: *
X-Spam-Status: No, hits=-1.0 required=5.0
	tests=ALL_TRUSTED
X-Spam-Check-By: dark.recoil.org
Received: from volstagg-0.srg.cl.cam.ac.uk (HELO [10.0.0.83]) (128.232.32.232)
	(smtp-auth username remote@recoil.org, mechanism cram-md5)
	by dark.recoil.org (qpsmtpd/0.84) with ESMTPA;
	Thu, 29 Nov 2012 18:21:00 +0000
Mime-Version: 1.0 (Mac OS X Mail 6.1 \(1498\))
From: Anil Madhavapeddy <anil@recoil.org>
In-Reply-To: <1354212199.6269.67.camel@zakaz.uk.xensource.com>
Date: Thu, 29 Nov 2012 18:20:57 +0000
Message-Id: <5DC583C2-ED2D-4305-9AC5-74F8F57F300D@recoil.org>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<2b433b1523e4295bb1ed.1353432210@cosworth.uk.xensource.com>
	<7EA643C653F17F4C80DE959E978F10EDFA101107B2@LONPMAILBOX01.citrite.net>
	<1354212199.6269.67.camel@zakaz.uk.xensource.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
X-Mailer: Apple Mail (2.1498)
X-Virus-Checked: Checked by ClamAV on dark.recoil.org
Cc: xen-devel@lists.xen.org, Rob Hoes <Rob.Hoes@citrix.com>,
	David Scott <scott.dj@gmail.com>, xen-api@lists.xen.org
Subject: Re: [Xen-devel] [Xen-API] [PATCH 10 of 15] libxc/ocaml: Add simple
	binding for xentoollog (output only)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 29 Nov 2012, at 18:03, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> 
> Another idea might be to make the bindings use the async interfaces
> wherever possible by default, by definition anything potentially
> blocking has supports this and that would avoid the need for
> enter/leave, but at the expense of making the ocaml callers ugly
> perhaps? Or maybe this sort of thing ends up looking very natural in
> ocaml? Depends on your application's event mechanism I suspect.
> 
> Last half witted idea: everything could be async but the bindings
> include the loop to wait for the async event, i.e. effectively making
> the call sync again. This sounds silly but it might allow better control
> over the placement of enter/leave vs callbacks, since you would just
> drop it over libxl_event_wait?

Making everything explicitly async and non-blocking is by far the
preferred solution in terms of stability, as it largely removes the
need to worry about the GC interface and thread interactions.

There are several libraries to wrap async interfaces in convenient
synchronous programming, most notably Lwt (http://ocsigen.org/lwt).
With this interface, all the OCaml callbacks are implemented in
OCaml, and it just needs a select/epoll or equivalent to wake up
sleeping threads when an IO event occurs.

Dave has already done some bindings to Lwt, so I've CCed him...

-anil


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 18:21:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:21:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8jQ-0003JZ-Nl; Thu, 29 Nov 2012 18:21:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <anil@recoil.org>) id 1Te8jO-0003JP-TT
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:21:03 +0000
Received: from [85.158.139.211:34069] by server-11.bemta-5.messagelabs.com id
	D8/9D-03409-E87A7B05; Thu, 29 Nov 2012 18:21:02 +0000
X-Env-Sender: anil@recoil.org
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354213261!14184702!1
X-Originating-IP: [89.16.177.154]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5192 invoked from network); 29 Nov 2012 18:21:01 -0000
Received: from recoil.dh.bytemark.co.uk (HELO dark.recoil.org) (89.16.177.154)
	by server-13.tower-206.messagelabs.com with SMTP;
	29 Nov 2012 18:21:01 -0000
Received: (qmail 1708 invoked by uid 634); 29 Nov 2012 18:21:01 -0000
X-Spam-Level: *
X-Spam-Status: No, hits=-1.0 required=5.0
	tests=ALL_TRUSTED
X-Spam-Check-By: dark.recoil.org
Received: from volstagg-0.srg.cl.cam.ac.uk (HELO [10.0.0.83]) (128.232.32.232)
	(smtp-auth username remote@recoil.org, mechanism cram-md5)
	by dark.recoil.org (qpsmtpd/0.84) with ESMTPA;
	Thu, 29 Nov 2012 18:21:00 +0000
Mime-Version: 1.0 (Mac OS X Mail 6.1 \(1498\))
From: Anil Madhavapeddy <anil@recoil.org>
In-Reply-To: <1354212199.6269.67.camel@zakaz.uk.xensource.com>
Date: Thu, 29 Nov 2012 18:20:57 +0000
Message-Id: <5DC583C2-ED2D-4305-9AC5-74F8F57F300D@recoil.org>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<2b433b1523e4295bb1ed.1353432210@cosworth.uk.xensource.com>
	<7EA643C653F17F4C80DE959E978F10EDFA101107B2@LONPMAILBOX01.citrite.net>
	<1354212199.6269.67.camel@zakaz.uk.xensource.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
X-Mailer: Apple Mail (2.1498)
X-Virus-Checked: Checked by ClamAV on dark.recoil.org
Cc: xen-devel@lists.xen.org, Rob Hoes <Rob.Hoes@citrix.com>,
	David Scott <scott.dj@gmail.com>, xen-api@lists.xen.org
Subject: Re: [Xen-devel] [Xen-API] [PATCH 10 of 15] libxc/ocaml: Add simple
	binding for xentoollog (output only)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 29 Nov 2012, at 18:03, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> 
> Another idea might be to make the bindings use the async interfaces
> wherever possible by default, by definition anything potentially
> blocking has supports this and that would avoid the need for
> enter/leave, but at the expense of making the ocaml callers ugly
> perhaps? Or maybe this sort of thing ends up looking very natural in
> ocaml? Depends on your application's event mechanism I suspect.
> 
> Last half witted idea: everything could be async but the bindings
> include the loop to wait for the async event, i.e. effectively making
> the call sync again. This sounds silly but it might allow better control
> over the placement of enter/leave vs callbacks, since you would just
> drop it over libxl_event_wait?

Making everything explicitly async and non-blocking is by far the
preferred solution in terms of stability, as it largely removes the
need to worry about the GC interface and thread interactions.

There are several libraries to wrap async interfaces in convenient
synchronous programming, most notably Lwt (http://ocsigen.org/lwt).
With this interface, all the OCaml callbacks are implemented in
OCaml, and it just needs a select/epoll or equivalent to wake up
sleeping threads when an IO event occurs.

Dave has already done some bindings to Lwt, so I've CCed him...

-anil


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 18:26:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:26:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8o1-0003fX-J5; Thu, 29 Nov 2012 18:25:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <buhrow@lothlorien.nfbcal.org>) id 1Te8hG-0003IF-Aq
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:18:50 +0000
Received: from [85.158.137.99:11661] by server-11.bemta-3.messagelabs.com id
	5B/BD-19361-907A7B05; Thu, 29 Nov 2012 18:18:49 +0000
X-Env-Sender: buhrow@lothlorien.nfbcal.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1354213126!17208708!1
X-Originating-IP: [157.22.230.125]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22215 invoked from network); 29 Nov 2012 18:18:48 -0000
Received: from ns.nfbcal.org (HELO lothlorien.nfbcal.org) (157.22.230.125)
	by server-14.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 18:18:48 -0000
Received: from lothlorien.nfbcal.org (localhost [127.0.0.1])
	by lothlorien.nfbcal.org (8.14.1/8.14.1-NFBNETBSD) with ESMTP id
	qATIIfCF024567
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 29 Nov 2012 10:18:41 -0800 (PST)
X-Virus-Status: Clean
X-Virus-Scanned: clamav-milter 0.97.3 at lothlorien.nfbcal.org
Received: (from buhrow@localhost)
	by lothlorien.nfbcal.org (8.14.1/8.12.11) id qATIIfbX012104;
	Thu, 29 Nov 2012 10:18:41 -0800 (PST)
Message-Id: <201211291818.qATIIfbX012104@lothlorien.nfbcal.org>
From: Brian Buhrow <buhrow@nfbcal.org>
Date: Thu, 29 Nov 2012 10:18:41 -0800
In-Reply-To: <50B73382.8070300@citrix.com>
X-Mailer: Mail User's Shell (7.2.6 beta(4.pl1)+dynamic 20000103)
To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>,
	Toby Karyadi <toby.karyadi@gmail.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.6
	(lothlorien.nfbcal.org [127.0.0.1]);
	Thu, 29 Nov 2012 10:18:41 -0800 (PST)
X-Mailman-Approved-At: Thu, 29 Nov 2012 18:25:47 +0000
Cc: buhrow@nfbcal.org, "port-xen@netbsd.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

}On 28/11/12 20:40, Toby Karyadi wrote:
}> On 11/28/12 10:29 AM, Thor Lancelot Simon wrote:
}>> On Wed, Nov 28, 2012 at 03:41:56PM +0100, Roger Pau Monn? wrote:
}>>> On 28/11/12 14:26, Thor Lancelot Simon wrote:
}>>>> I am assuming there's some reason we want this, rather than handling
}>>>> such requests in-kernel.  But what is it?
}>>> I should have marked this as "experimental", or something like this. I'm
}>>> not sure if switching to Qdisk for all image file backends is needed.
}>>> >From the Xen wiki (http://wiki.xen.org/wiki/Blktap) I've found that:
}>>>
}>>> "loop device had problems with flushing dirty pages (specifically, doing
}>>> a large number of writes to an NFS-backed image don't result in the OOM
}>>> killer going berserk)."
}>>>
}>>> I'm not sure if NetBSD is in the same situation, but if I remember
}>>> correctly (haven't tried that in a long time), trying to use a disk file
}>>> on a NFS share caused the NetBSD Dom0 kernel to crash. The PR for this
}>>> issue is: http://gnats.netbsd.org/40726.
}>> It seems highly unlikely to me that a problem with the loop device driver
}>> on Linux is tremendously relevant to NetBSD.
}>>
}>> But, even if there is some problem with vnd backed by NFS, that hardly
}>> seems like it would be a good reason to make a change that reduces I/O
}>> throughput for the *non* NFS-backed case by at least 20%.  Why would one
}>> keep disk images for guests, as a general rule, on NFS, rather than simply
}>> doing the NFS mounts on the guests themselves, or using a more sensible
}>> protocol like iSCSI?  I have to assume most folks using files as disks are
}>> storing them on local filesystems on the dom0, and wrecking performance
}>> for that case to solve a problem with NFS that may or may not be hypothetical
}>> seems like a very, very bad trade-off.
}>>
}>> Thor
}> Yeah, I usually don't pipe up, but I strongly dislike being forced to 
}> use qemu to read raw disk file instead of being able to use vnd on 
}> netbsd dom0.
}
}I'm not a fan of Qemu either, but I don't know an easy way to detect if
}an image is in a NFS share, or if an image is in qcow, qcow2 or raw. I'm
}open to a solution that only launches Qemu if image format is different
}than raw or if the image file is in a NFS share.
	I admit that I don't know a lot about this particular problem and I'm
joining the discussion late, but isn't there a relatively easy set of steps
to follow to determinne if qemu needs to be called?

1. Look at the filesystem type of the filesystem in which the target
resides.  If it's an NFS filesystem, call qemu.  Otherwise, go to step 2.

2.  Examine the file and see if it has a signature for QCOW or QCOW2 format.
(How does qemu figure out which it is?  Is it a simple bit of code that
could be snagged for re-use?)  Alternatively, check to see if it's a raw
image, and, if it is not, call qemu, otherwise, call vnd and use the
existing backend  block driver.  

	I seem to remember that under xen3.3, there is a python script that does 
essentially step 2, except that it's tuned to detecte linux images or X86
partition tables and knows nothing about NetBSD partitions or FreeBSD
slices.

-Brian


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 18:26:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:26:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8o1-0003fX-J5; Thu, 29 Nov 2012 18:25:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <buhrow@lothlorien.nfbcal.org>) id 1Te8hG-0003IF-Aq
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:18:50 +0000
Received: from [85.158.137.99:11661] by server-11.bemta-3.messagelabs.com id
	5B/BD-19361-907A7B05; Thu, 29 Nov 2012 18:18:49 +0000
X-Env-Sender: buhrow@lothlorien.nfbcal.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1354213126!17208708!1
X-Originating-IP: [157.22.230.125]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22215 invoked from network); 29 Nov 2012 18:18:48 -0000
Received: from ns.nfbcal.org (HELO lothlorien.nfbcal.org) (157.22.230.125)
	by server-14.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 18:18:48 -0000
Received: from lothlorien.nfbcal.org (localhost [127.0.0.1])
	by lothlorien.nfbcal.org (8.14.1/8.14.1-NFBNETBSD) with ESMTP id
	qATIIfCF024567
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 29 Nov 2012 10:18:41 -0800 (PST)
X-Virus-Status: Clean
X-Virus-Scanned: clamav-milter 0.97.3 at lothlorien.nfbcal.org
Received: (from buhrow@localhost)
	by lothlorien.nfbcal.org (8.14.1/8.12.11) id qATIIfbX012104;
	Thu, 29 Nov 2012 10:18:41 -0800 (PST)
Message-Id: <201211291818.qATIIfbX012104@lothlorien.nfbcal.org>
From: Brian Buhrow <buhrow@nfbcal.org>
Date: Thu, 29 Nov 2012 10:18:41 -0800
In-Reply-To: <50B73382.8070300@citrix.com>
X-Mailer: Mail User's Shell (7.2.6 beta(4.pl1)+dynamic 20000103)
To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>,
	Toby Karyadi <toby.karyadi@gmail.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.6
	(lothlorien.nfbcal.org [127.0.0.1]);
	Thu, 29 Nov 2012 10:18:41 -0800 (PST)
X-Mailman-Approved-At: Thu, 29 Nov 2012 18:25:47 +0000
Cc: buhrow@nfbcal.org, "port-xen@netbsd.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
	handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

}On 28/11/12 20:40, Toby Karyadi wrote:
}> On 11/28/12 10:29 AM, Thor Lancelot Simon wrote:
}>> On Wed, Nov 28, 2012 at 03:41:56PM +0100, Roger Pau Monn? wrote:
}>>> On 28/11/12 14:26, Thor Lancelot Simon wrote:
}>>>> I am assuming there's some reason we want this, rather than handling
}>>>> such requests in-kernel.  But what is it?
}>>> I should have marked this as "experimental", or something like this. I'm
}>>> not sure if switching to Qdisk for all image file backends is needed.
}>>> >From the Xen wiki (http://wiki.xen.org/wiki/Blktap) I've found that:
}>>>
}>>> "loop device had problems with flushing dirty pages (specifically, doing
}>>> a large number of writes to an NFS-backed image don't result in the OOM
}>>> killer going berserk)."
}>>>
}>>> I'm not sure if NetBSD is in the same situation, but if I remember
}>>> correctly (haven't tried that in a long time), trying to use a disk file
}>>> on a NFS share caused the NetBSD Dom0 kernel to crash. The PR for this
}>>> issue is: http://gnats.netbsd.org/40726.
}>> It seems highly unlikely to me that a problem with the loop device driver
}>> on Linux is tremendously relevant to NetBSD.
}>>
}>> But, even if there is some problem with vnd backed by NFS, that hardly
}>> seems like it would be a good reason to make a change that reduces I/O
}>> throughput for the *non* NFS-backed case by at least 20%.  Why would one
}>> keep disk images for guests, as a general rule, on NFS, rather than simply
}>> doing the NFS mounts on the guests themselves, or using a more sensible
}>> protocol like iSCSI?  I have to assume most folks using files as disks are
}>> storing them on local filesystems on the dom0, and wrecking performance
}>> for that case to solve a problem with NFS that may or may not be hypothetical
}>> seems like a very, very bad trade-off.
}>>
}>> Thor
}> Yeah, I usually don't pipe up, but I strongly dislike being forced to 
}> use qemu to read raw disk file instead of being able to use vnd on 
}> netbsd dom0.
}
}I'm not a fan of Qemu either, but I don't know an easy way to detect if
}an image is in a NFS share, or if an image is in qcow, qcow2 or raw. I'm
}open to a solution that only launches Qemu if image format is different
}than raw or if the image file is in a NFS share.
	I admit that I don't know a lot about this particular problem and I'm
joining the discussion late, but isn't there a relatively easy set of steps
to follow to determinne if qemu needs to be called?

1. Look at the filesystem type of the filesystem in which the target
resides.  If it's an NFS filesystem, call qemu.  Otherwise, go to step 2.

2.  Examine the file and see if it has a signature for QCOW or QCOW2 format.
(How does qemu figure out which it is?  Is it a simple bit of code that
could be snagged for re-use?)  Alternatively, check to see if it's a raw
image, and, if it is not, call qemu, otherwise, call vnd and use the
existing backend  block driver.  

	I seem to remember that under xen3.3, there is a python script that does 
essentially step 2, except that it's tuned to detecte linux images or X86
partition tables and knows nothing about NetBSD partitions or FreeBSD
slices.

-Brian


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 18:31:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:31:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8t2-0003pA-BA; Thu, 29 Nov 2012 18:31:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te8t1-0003p5-AA
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:30:59 +0000
Received: from [85.158.137.99:62214] by server-10.bemta-3.messagelabs.com id
	D9/3A-19806-1E9A7B05; Thu, 29 Nov 2012 18:30:57 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354213855!16916975!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3284 invoked from network); 29 Nov 2012 18:30:56 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-2.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 18:30:56 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158395601;
	Thu, 29 Nov 2012 13:30:49 -0500
Message-ID: <50B7A9D3.2090208@jhuapl.edu>
Date: Thu, 29 Nov 2012 13:30:43 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353664797.13542.190.camel@zakaz.uk.xensource.com>
	<20663.18782.886504.606333@mariner.uk.xensource.com>
	<20663.18917.138256.303363@mariner.uk.xensource.com>
	<50B76905.90503@jhuapl.edu>
	<20663.41331.674520.639570@mariner.uk.xensource.com>
In-Reply-To: <20663.41331.674520.639570@mariner.uk.xensource.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs
	to stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5753540817286176382=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============5753540817286176382==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms040204030003030900080608"

This is a cryptographically signed message in MIME format.

--------------ms040204030003030900080608
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/29/2012 12:54 PM, Ian Jackson wrote:
> Matthew Fioravante writes ("Re: [PATCH VTPM v4 3/5] vtpm/vtpmmgr and re=
quired libs to stubdom/Makefile"):
>> Add a configure.ac to stubdom. I can whip up a simple one where you ca=
n
>> enable/disable specific stub domains. Other options could be setting t=
he
>> fetch urls for the libraries. People can add more options later. Now i=
f
>> people disable vtpm, the check for cmake goes away.
> This would be fine, if you feel like doing it.
>
>> Move /tools/configure.ac to /configure.ac. Use this configure script t=
o
>> configure the entire build. /Makefile still exists and works with or
>> without configuring, to enable building of the hypervisor.
> That would also be OK by me but would need wider agreement.
>
>> If we don't want to do this now, then I vote to just make cmake a
>> dependency for Xen without adding messy conditional hacks.
> We already have a number of things you can enable/disable with a
> simple y/n in Config.mk.  I don't see why adding one more would be a
> problem.
Maybe at some point they can all be moved into the configure script and=20
retired.
>
> Ian.



--------------ms040204030003030900080608
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/M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TYwHwYDVR0jBBgwFoAUCDUpmxH52EU2CyWmF2EJMB1yqeswHQYD
VR0OBBYEFO6LYxg6r9wHZ+zdQtBHn1dZ/YTNMAkGA1UdEwQCMAAwGQYJKoZIhvZ9B0EABAww
ChsEVjcuMQMCBLAwDQYJKoZIhvcNAQEFBQADgYEAJO9HQh4YNChVLzuZqK5ARJARD8JoujGZ
fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEyOTE4MzA0M1owIwYJKoZIhvcNAQkEMRYEFJ5Tezd5zzYyaV0x
lS5BinCoGzQYMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYCMF5ejWiXrUC4i4rGcIlDzzjkoqu9lHjE5
WsWQC7prKJ95dIoVMe5aUk9r2WZmKVdF+bggryKoMHItM9ayu2zSQgIpYbqvLyD2EcGEVr8d
/O//KUeaOTg4o320HQRp8E9SJqbsCH5h9dWJuzckyN2q7KX6nLlIvu/PGRkpAl6YYAAAAAAA
AA==
--------------ms040204030003030900080608--


--===============5753540817286176382==
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.xen.org
http://lists.xen.org/xen-devel

--===============5753540817286176382==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 18:31:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:31:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te8t2-0003pA-BA; Thu, 29 Nov 2012 18:31:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te8t1-0003p5-AA
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:30:59 +0000
Received: from [85.158.137.99:62214] by server-10.bemta-3.messagelabs.com id
	D9/3A-19806-1E9A7B05; Thu, 29 Nov 2012 18:30:57 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354213855!16916975!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3284 invoked from network); 29 Nov 2012 18:30:56 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-2.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 18:30:56 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158395601;
	Thu, 29 Nov 2012 13:30:49 -0500
Message-ID: <50B7A9D3.2090208@jhuapl.edu>
Date: Thu, 29 Nov 2012 13:30:43 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
References: <1353421272-24797-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353421272-24797-3-git-send-email-matthew.fioravante@jhuapl.edu>
	<1353664797.13542.190.camel@zakaz.uk.xensource.com>
	<20663.18782.886504.606333@mariner.uk.xensource.com>
	<20663.18917.138256.303363@mariner.uk.xensource.com>
	<50B76905.90503@jhuapl.edu>
	<20663.41331.674520.639570@mariner.uk.xensource.com>
In-Reply-To: <20663.41331.674520.639570@mariner.uk.xensource.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH VTPM v4 3/5] vtpm/vtpmmgr and required libs
	to stubdom/Makefile
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5753540817286176382=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============5753540817286176382==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms040204030003030900080608"

This is a cryptographically signed message in MIME format.

--------------ms040204030003030900080608
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/29/2012 12:54 PM, Ian Jackson wrote:
> Matthew Fioravante writes ("Re: [PATCH VTPM v4 3/5] vtpm/vtpmmgr and re=
quired libs to stubdom/Makefile"):
>> Add a configure.ac to stubdom. I can whip up a simple one where you ca=
n
>> enable/disable specific stub domains. Other options could be setting t=
he
>> fetch urls for the libraries. People can add more options later. Now i=
f
>> people disable vtpm, the check for cmake goes away.
> This would be fine, if you feel like doing it.
>
>> Move /tools/configure.ac to /configure.ac. Use this configure script t=
o
>> configure the entire build. /Makefile still exists and works with or
>> without configuring, to enable building of the hypervisor.
> That would also be OK by me but would need wider agreement.
>
>> If we don't want to do this now, then I vote to just make cmake a
>> dependency for Xen without adding messy conditional hacks.
> We already have a number of things you can enable/disable with a
> simple y/n in Config.mk.  I don't see why adding one more would be a
> problem.
Maybe at some point they can all be moved into the configure script and=20
retired.
>
> Ian.



--------------ms040204030003030900080608
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAb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b3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYCMF5ejWiXrUC4i4rGcIlDzzjkoqu9lHjE5
WsWQC7prKJ95dIoVMe5aUk9r2WZmKVdF+bggryKoMHItM9ayu2zSQgIpYbqvLyD2EcGEVr8d
/O//KUeaOTg4o320HQRp8E9SJqbsCH5h9dWJuzckyN2q7KX6nLlIvu/PGRkpAl6YYAAAAAAA
AA==
--------------ms040204030003030900080608--


--===============5753540817286176382==
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.xen.org
http://lists.xen.org/xen-devel

--===============5753540817286176382==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 18:54:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:54:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te9FK-0004tI-JO; Thu, 29 Nov 2012 18:54:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te9FJ-0004tD-5K
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:54:01 +0000
Received: from [85.158.143.99:20575] by server-2.bemta-4.messagelabs.com id
	06/B9-28922-84FA7B05; Thu, 29 Nov 2012 18:54:00 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-5.tower-216.messagelabs.com!1354215238!27075629!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10756 invoked from network); 29 Nov 2012 18:53:59 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-5.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 18:53:59 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158398257;
	Thu, 29 Nov 2012 13:53:52 -0500
Message-ID: <50B7AF3A.3090009@jhuapl.edu>
Date: Thu, 29 Nov 2012 13:53:46 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-3-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1354029286-17652-3-git-send-email-dgdegra@tycho.nsa.gov>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/4] stubdom/vtpm: Add reconfiguration
	support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4141686257497628723=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============4141686257497628723==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms050103060508070608090504"

This is a cryptographically signed message in MIME format.

--------------ms050103060508070608090504
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

The purpose of this is to allow 2 entities in the same vm to use tpm=20
drivers, pv_grub and the linux guest. The Xenbus Reconfigure states are=20
new to me. Is this intended behavior in line with the original purpose=20
of the Reconfigure states or are we hijacking them to do something not=20
in the original xen front/back driver spec?

It looks like pv-grub just shuts down blkfront and the others without=20
any reconfigure magic. Given that vtpm-stubdom will no longer=20
automatically shutdown with your later patch, is there any reason we=20
cannot just do the same here?

On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
> Allow the vtpm device to be disconnected and reconnected so that a
> bootloader (like pv-grub) can submit measurements and return the vtpm
> device to its initial state before booting the target kernel.
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>   extras/mini-os/include/tpmfront.h |  2 +-
>   extras/mini-os/lib/sys.c          |  2 +-
>   extras/mini-os/tpmback.c          |  5 +++++
>   extras/mini-os/tpmfront.c         | 15 +++++++++------
>   stubdom/vtpm/vtpm.c               |  2 +-
>   5 files changed, 17 insertions(+), 9 deletions(-)
>
> diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include=
/tpmfront.h
> index a0c7c4d..913faa4 100644
> --- a/extras/mini-os/include/tpmfront.h
> +++ b/extras/mini-os/include/tpmfront.h
> @@ -61,7 +61,7 @@ struct tpmfront_dev {
>   /*Initialize frontend */
>   struct tpmfront_dev* init_tpmfront(const char* nodename);
>   /*Shutdown frontend */
> -void shutdown_tpmfront(struct tpmfront_dev* dev);
> +void shutdown_tpmfront(struct tpmfront_dev* dev, int for_reconfig);
>  =20
>   /* Send a tpm command to the backend and wait for the response
>    *
> diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
> index 3cc3340..03da4f0 100644
> --- a/extras/mini-os/lib/sys.c
> +++ b/extras/mini-os/lib/sys.c
> @@ -459,7 +459,7 @@ int close(int fd)
>   #endif
>   #ifdef CONFIG_TPMFRONT
>   	case FTYPE_TPMFRONT:
> -            shutdown_tpmfront(files[fd].tpmfront.dev);
> +            shutdown_tpmfront(files[fd].tpmfront.dev, 0);
>   	    files[fd].type =3D FTYPE_NONE;
>   	    return 0;
>   #endif
> diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
> index 2d31061..ea42235 100644
> --- a/extras/mini-os/tpmback.c
> +++ b/extras/mini-os/tpmback.c
> @@ -664,6 +664,7 @@ static int frontend_changed(tpmif_t* tpmif)
>      switch (state) {
>         case XenbusStateInitialising:
>         case XenbusStateInitialised:
> +      case XenbusStateReconfigured:
>   	 break;
>  =20
>         case XenbusStateConnected:
> @@ -678,6 +679,10 @@ static int frontend_changed(tpmif_t* tpmif)
>   	 tpmif_change_state(tpmif, XenbusStateClosing);
>   	 break;
>  =20
> +      case XenbusStateReconfiguring:
> +         disconnect_fe(tpmif);
> +	 break;
> +
>         case XenbusStateUnknown: /* keep it here */
>         case XenbusStateClosed:
>   	 free_tpmif(tpmif);
> diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
> index c1cbab3..b725ba0 100644
> --- a/extras/mini-os/tpmfront.c
> +++ b/extras/mini-os/tpmfront.c
> @@ -344,10 +344,10 @@ struct tpmfront_dev* init_tpmfront(const char* _n=
odename)
>      return dev;
>  =20
>   error:
> -   shutdown_tpmfront(dev);
> +   shutdown_tpmfront(dev, 0);
>      return NULL;
>   }
> -void shutdown_tpmfront(struct tpmfront_dev* dev)
> +void shutdown_tpmfront(struct tpmfront_dev* dev, int for_reconfig)
It might be cleaner to create a new function like reconfigure_tpmfront() =

or something like that instead of adding an option to shutdown_tpmfront()=
=2E
>   {
>      char* err;
>      char path[512];
> @@ -357,8 +357,7 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>      TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for re=
configure" : "");
>      /* disconnect */
>      if(dev->state =3D=3D XenbusStateConnected) {
> -      dev->state =3D XenbusStateClosing;
> -      //FIXME: Transaction for this?
> +      dev->state =3D for_reconfig ? XenbusStateReconfiguring : XenbusS=
tateClosing;
>         /* Tell backend we are closing */
>         if((err =3D xenbus_printf(XBT_NIL, dev->nodename, "state", "%u"=
, (unsigned int) dev->state))) {
>   	 free(err);
> @@ -374,15 +373,19 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>   	 free(err);
>         }
>  =20
> +      if (for_reconfig)
> +         wait_for_backend_state_changed(dev, XenbusStateReconfigured);=

> +
>         /* Tell backend we are closed */
> -      dev->state =3D XenbusStateClosed;
> +      dev->state =3D for_reconfig ? XenbusStateInitialising : XenbusSt=
ateClosed;
>         if((err =3D xenbus_printf(XBT_NIL, dev->nodename, "state", "%u"=
, (unsigned int) dev->state))) {
>   	 TPMFRONT_ERR("Unable to write to %s, error was %s", dev->nodename, =
err);
>   	 free(err);
>         }
>  =20
>         /* Wait for the backend to close and unmap shared pages, ignore=
 any errors */
> -      wait_for_backend_state_changed(dev, XenbusStateClosed);
> +      if (!for_reconfig)
> +         wait_for_backend_state_changed(dev, XenbusStateClosed);
>  =20
>         /* Close event channel and unmap shared page */
>         mask_evtchn(dev->evtchn);
> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
> index 71aef78..c33e078 100644
> --- a/stubdom/vtpm/vtpm.c
> +++ b/stubdom/vtpm/vtpm.c
> @@ -394,7 +394,7 @@ abort_postvtpmblk:
>   abort_postrng:
>  =20
>      /* Close devices */
> -   shutdown_tpmfront(tpmfront_dev);
> +   shutdown_tpmfront(tpmfront_dev, 0);
>   abort_posttpmfront:
>      shutdown_tpmback();
>  =20



--------------ms050103060508070608090504
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFqdiIPJwZL8FYTRQ/zsCAwEA
AaOCAbYwggGyMAsGA1UdDwQEAwIHgDArBgNVHRAEJDAigA8yMDEwMDYxMTE4MjIwNlqBDzIw
MTIwNzE3MjI1MjA2WjAbBg0rBgEEAbMlCwMBAQEBBAoWCGZpb3JhbWUxMBsGDSsGAQQBsyUL
AwEBAQIEChIIMDAxMDQyNjEwWAYJYIZIAYb6ax4BBEsMSVRoZSBwcml2YXRlIGtleSBjb3Jy
ZXNwb25kaW5nIHRvIHRoaXMgY2VydGlmaWNhdGUgbWF5IGhhdmUgYmVlbiBleHBvcnRlZC4w
KAYDVR0RBCEwH4EdTWF0dGhldy5GaW9yYXZhbnRlQGpodWFwbC5lZHUwUgYDVR0fBEswSTBH
oEWgQ6RBMD8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJU0RD
QTEOMAwGA1UEAxMFQ1JMNTYwHwYDVR0jBBgwFoAUCDUpmxH52EU2CyWmF2EJMB1yqeswHQYD
VR0OBBYEFO6LYxg6r9wHZ+zdQtBHn1dZ/YTNMAkGA1UdEwQCMAAwGQYJKoZIhvZ9B0EABAww
ChsEVjcuMQMCBLAwDQYJKoZIhvcNAQEFBQADgYEAJO9HQh4YNChVLzuZqK5ARJARD8JoujGZ
fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEyOTE4NTM0NlowIwYJKoZIhvcNAQkEMRYEFIJPY/emkvc0mIN3
C20qfCBlkzHDMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAIPSDvJl3gWWTiclNZdL50L0BHmX2M1cwN
O0AShRpmWFzUGQqiGlMpMe4l4NGVCPpLnbcOs/zJexBwfWajCYXLbA83SLSaUfEjKU9UgYS4
cyxMz1Y9YDAduSc987/22f7bhGTM169Z3FG/bvFgP5WygTiWrCTUVAgcADlTO+uj+QAAAAAA
AA==
--------------ms050103060508070608090504--


--===============4141686257497628723==
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.xen.org
http://lists.xen.org/xen-devel

--===============4141686257497628723==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 18:54:22 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:54:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te9FK-0004tI-JO; Thu, 29 Nov 2012 18:54:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te9FJ-0004tD-5K
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:54:01 +0000
Received: from [85.158.143.99:20575] by server-2.bemta-4.messagelabs.com id
	06/B9-28922-84FA7B05; Thu, 29 Nov 2012 18:54:00 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-5.tower-216.messagelabs.com!1354215238!27075629!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10756 invoked from network); 29 Nov 2012 18:53:59 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-5.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 18:53:59 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158398257;
	Thu, 29 Nov 2012 13:53:52 -0500
Message-ID: <50B7AF3A.3090009@jhuapl.edu>
Date: Thu, 29 Nov 2012 13:53:46 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-3-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1354029286-17652-3-git-send-email-dgdegra@tycho.nsa.gov>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/4] stubdom/vtpm: Add reconfiguration
	support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4141686257497628723=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============4141686257497628723==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms050103060508070608090504"

This is a cryptographically signed message in MIME format.

--------------ms050103060508070608090504
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

The purpose of this is to allow 2 entities in the same vm to use tpm=20
drivers, pv_grub and the linux guest. The Xenbus Reconfigure states are=20
new to me. Is this intended behavior in line with the original purpose=20
of the Reconfigure states or are we hijacking them to do something not=20
in the original xen front/back driver spec?

It looks like pv-grub just shuts down blkfront and the others without=20
any reconfigure magic. Given that vtpm-stubdom will no longer=20
automatically shutdown with your later patch, is there any reason we=20
cannot just do the same here?

On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
> Allow the vtpm device to be disconnected and reconnected so that a
> bootloader (like pv-grub) can submit measurements and return the vtpm
> device to its initial state before booting the target kernel.
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>   extras/mini-os/include/tpmfront.h |  2 +-
>   extras/mini-os/lib/sys.c          |  2 +-
>   extras/mini-os/tpmback.c          |  5 +++++
>   extras/mini-os/tpmfront.c         | 15 +++++++++------
>   stubdom/vtpm/vtpm.c               |  2 +-
>   5 files changed, 17 insertions(+), 9 deletions(-)
>
> diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include=
/tpmfront.h
> index a0c7c4d..913faa4 100644
> --- a/extras/mini-os/include/tpmfront.h
> +++ b/extras/mini-os/include/tpmfront.h
> @@ -61,7 +61,7 @@ struct tpmfront_dev {
>   /*Initialize frontend */
>   struct tpmfront_dev* init_tpmfront(const char* nodename);
>   /*Shutdown frontend */
> -void shutdown_tpmfront(struct tpmfront_dev* dev);
> +void shutdown_tpmfront(struct tpmfront_dev* dev, int for_reconfig);
>  =20
>   /* Send a tpm command to the backend and wait for the response
>    *
> diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
> index 3cc3340..03da4f0 100644
> --- a/extras/mini-os/lib/sys.c
> +++ b/extras/mini-os/lib/sys.c
> @@ -459,7 +459,7 @@ int close(int fd)
>   #endif
>   #ifdef CONFIG_TPMFRONT
>   	case FTYPE_TPMFRONT:
> -            shutdown_tpmfront(files[fd].tpmfront.dev);
> +            shutdown_tpmfront(files[fd].tpmfront.dev, 0);
>   	    files[fd].type =3D FTYPE_NONE;
>   	    return 0;
>   #endif
> diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
> index 2d31061..ea42235 100644
> --- a/extras/mini-os/tpmback.c
> +++ b/extras/mini-os/tpmback.c
> @@ -664,6 +664,7 @@ static int frontend_changed(tpmif_t* tpmif)
>      switch (state) {
>         case XenbusStateInitialising:
>         case XenbusStateInitialised:
> +      case XenbusStateReconfigured:
>   	 break;
>  =20
>         case XenbusStateConnected:
> @@ -678,6 +679,10 @@ static int frontend_changed(tpmif_t* tpmif)
>   	 tpmif_change_state(tpmif, XenbusStateClosing);
>   	 break;
>  =20
> +      case XenbusStateReconfiguring:
> +         disconnect_fe(tpmif);
> +	 break;
> +
>         case XenbusStateUnknown: /* keep it here */
>         case XenbusStateClosed:
>   	 free_tpmif(tpmif);
> diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
> index c1cbab3..b725ba0 100644
> --- a/extras/mini-os/tpmfront.c
> +++ b/extras/mini-os/tpmfront.c
> @@ -344,10 +344,10 @@ struct tpmfront_dev* init_tpmfront(const char* _n=
odename)
>      return dev;
>  =20
>   error:
> -   shutdown_tpmfront(dev);
> +   shutdown_tpmfront(dev, 0);
>      return NULL;
>   }
> -void shutdown_tpmfront(struct tpmfront_dev* dev)
> +void shutdown_tpmfront(struct tpmfront_dev* dev, int for_reconfig)
It might be cleaner to create a new function like reconfigure_tpmfront() =

or something like that instead of adding an option to shutdown_tpmfront()=
=2E
>   {
>      char* err;
>      char path[512];
> @@ -357,8 +357,7 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>      TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for re=
configure" : "");
>      /* disconnect */
>      if(dev->state =3D=3D XenbusStateConnected) {
> -      dev->state =3D XenbusStateClosing;
> -      //FIXME: Transaction for this?
> +      dev->state =3D for_reconfig ? XenbusStateReconfiguring : XenbusS=
tateClosing;
>         /* Tell backend we are closing */
>         if((err =3D xenbus_printf(XBT_NIL, dev->nodename, "state", "%u"=
, (unsigned int) dev->state))) {
>   	 free(err);
> @@ -374,15 +373,19 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>   	 free(err);
>         }
>  =20
> +      if (for_reconfig)
> +         wait_for_backend_state_changed(dev, XenbusStateReconfigured);=

> +
>         /* Tell backend we are closed */
> -      dev->state =3D XenbusStateClosed;
> +      dev->state =3D for_reconfig ? XenbusStateInitialising : XenbusSt=
ateClosed;
>         if((err =3D xenbus_printf(XBT_NIL, dev->nodename, "state", "%u"=
, (unsigned int) dev->state))) {
>   	 TPMFRONT_ERR("Unable to write to %s, error was %s", dev->nodename, =
err);
>   	 free(err);
>         }
>  =20
>         /* Wait for the backend to close and unmap shared pages, ignore=
 any errors */
> -      wait_for_backend_state_changed(dev, XenbusStateClosed);
> +      if (!for_reconfig)
> +         wait_for_backend_state_changed(dev, XenbusStateClosed);
>  =20
>         /* Close event channel and unmap shared page */
>         mask_evtchn(dev->evtchn);
> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
> index 71aef78..c33e078 100644
> --- a/stubdom/vtpm/vtpm.c
> +++ b/stubdom/vtpm/vtpm.c
> @@ -394,7 +394,7 @@ abort_postvtpmblk:
>   abort_postrng:
>  =20
>      /* Close devices */
> -   shutdown_tpmfront(tpmfront_dev);
> +   shutdown_tpmfront(tpmfront_dev, 0);
>   abort_posttpmfront:
>      shutdown_tpmback();
>  =20



--------------ms050103060508070608090504
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQ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pyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEyOTE4NTM0NlowIwYJKoZIhvcNAQkEMRYEFIJPY/emkvc0mIN3
C20qfCBlkzHDMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAIPSDvJl3gWWTiclNZdL50L0BHmX2M1cwN
O0AShRpmWFzUGQqiGlMpMe4l4NGVCPpLnbcOs/zJexBwfWajCYXLbA83SLSaUfEjKU9UgYS4
cyxMz1Y9YDAduSc987/22f7bhGTM169Z3FG/bvFgP5WygTiWrCTUVAgcADlTO+uj+QAAAAAA
AA==
--------------ms050103060508070608090504--


--===============4141686257497628723==
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.xen.org
http://lists.xen.org/xen-devel

--===============4141686257497628723==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 18:55:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:55:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te9Gk-0004xy-4O; Thu, 29 Nov 2012 18:55:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <marmarek@invisiblethingslab.com>) id 1Te9Gh-0004xk-DX
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:55:28 +0000
Received: from [85.158.143.99:7502] by server-1.bemta-4.messagelabs.com id
	1D/A5-27934-E9FA7B05; Thu, 29 Nov 2012 18:55:26 +0000
X-Env-Sender: marmarek@invisiblethingslab.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1354215324!20370402!1
X-Originating-IP: [66.111.4.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTExLjQuMjggPT4gNTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7459 invoked from network); 29 Nov 2012 18:55:25 -0000
Received: from out4-smtp.messagingengine.com (HELO
	out4-smtp.messagingengine.com) (66.111.4.28)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 18:55:25 -0000
Received: from compute5.internal (compute5.nyi.mail.srv.osa [10.202.2.45])
	by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 61F5420CFB
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 13:55:24 -0500 (EST)
Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160])
	by compute5.internal (MEProxy); Thu, 29 Nov 2012 13:55:24 -0500
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=message-id:date:from:mime-version:to
	:subject:content-type; s=mesmtp; bh=HIBktHiZvcR27MBVJfrXttc6Kcs=; b=
	KyFHzSF6QibWTJ4rAcs3ZAFDCK0pU9kO2c72eYj6nA10Z3+Xql+lhmtpTKvZq3rH
	hnZMkEtHJmJnG0cNd2Bz2Jg6dCIEXw6/eIgDfv5IhS2bTBmYbWt1AqqYtrJU3Xja
	E+u6rgpId4ilQP1IhIz/k5Gvs/DK9Qkzjp57J9Gb0/c=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	messagingengine.com; h=message-id:date:from:mime-version:to
	:subject:content-type; s=smtpout; bh=HIBktHiZvcR27MBVJfrXttc6Kcs
	=; b=NNIt70G2Db2AabPKwVBUQ8Zz6uTbKKUa4rC1Sjqo0j5jEyhnBArGVsN3Byq
	Zu1YVXaMBsjE+xXIVcHnoU1KhsAATe3o7fdXq4KCez+vsMYqepyR1TJT9UfPpXHn
	VTxkvi2XzSyPGNXBVIqIlXxFdKMKrkUB811HYFPWJy2l7eTc=
X-Sasl-enc: GH/NSOLJ78aXBVVQVbdKYyoD13rol7s5gTeWePh2Q2QP 1354215321
Received: from [10.137.1.17] (unknown [93.157.76.159])
	by mail.messagingengine.com (Postfix) with ESMTPA id F3BEA8E04CE
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 13:55:20 -0500 (EST)
Message-ID: <50B7AF8A.5010304@invisiblethingslab.com>
Date: Thu, 29 Nov 2012 19:55:06 +0100
From: Marek Marczykowski <marmarek@invisiblethingslab.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: xen-devel <xen-devel@lists.xen.org>
X-Enigmail-Version: 1.4.6
Subject: [Xen-devel] Only CPU0 active after ACPI S3, xen 4.1.3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1945915925389597712=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============1945915925389597712==
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="------------enig5230F3E2DC98D5B5654D4AE2"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig5230F3E2DC98D5B5654D4AE2
Content-Type: multipart/mixed;
 boundary="------------050106030504030501010304"

This is a multi-part message in MIME format.
--------------050106030504030501010304
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi all,

After resume from ACPI S3 system has only CPU0 enabled, every vCPU from e=
very
domain works on CPU0 [1].  When trying to pin some vCPU to CPU1 got error=
:
xl vcpu-pin testvm 1 1
libxl: error: libxl.c:2565:libxl_set_vcpuaffinity setting vcpu affinity:
Invalid argument

What went wrong? How can I reenable CPU1-CPU3?

System info:
xen 4.1.3
linux 3.4.18 with acpi-s3 patches from Konrad's git
Processor: Intel i5-2520M

dmesg from dom0 and hypervisor attached.

BTW Are there any plans to upstream acpi-s3 patches?

[1] xl vcpu-list:
Name                                ID  VCPU   CPU State   Time(s) CPU Af=
finity
dom0                                 0     0    0   r--    1347.8  any cp=
u
dom0                                 0     1    0   -b-     594.4  any cp=
u
dom0                                 0     2    0   -b-     421.1  any cp=
u
dom0                                 0     3    0   -b-     432.6  any cp=
u
netvm                                1     0    0   -b-     596.6  any cp=
u
netvm                                1     1    0   -b-     363.7  any cp=
u
firewallvm                           2     0    0   -b-     170.5  any cp=
u
firewallvm                           2     1    0   -b-     122.5  any cp=
u
devel17                              3     0    0   -b-     137.0  any cp=
u
devel17                              3     1    0   -b-     112.9  any cp=
u
devel17                              3     2    0   -b-      97.9  any cp=
u
devel17                              3     3    0   -b-     116.0  any cp=
u
vm2                                  4     0    0   -b-     418.6  any cp=
u
vm2                                  4     1    0   -b-     390.2  any cp=
u
private                              5     0    0   -b-     175.9  any cp=
u
private                              5     1    0   -b-     161.6  any cp=
u
mail                                 6     0    0   -b-    1587.1  any cp=
u
mail                                 6     1    0   -b-    1717.5  any cp=
u
testvm                               7     0    0   -b-      73.0  any cp=
u
testvm                               7     1    0   -b-      68.9  any cp=
u
testvm                               7     2    0   -b-      51.4  any cp=
u
testvm                               7     3    0   -b-      67.1  any cp=
u
disp1                                8     0    0   -b-     199.9  any cp=
u


--=20
Best Regards / Pozdrawiam,
Marek Marczykowski
Invisible Things Lab

--------------050106030504030501010304
Content-Type: text/plain; charset=UTF-8;
 name="dom0-dmesg.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="dom0-dmesg.txt"

WyAgICAwLjAwMDAwMF0gSW5pdGlhbGl6aW5nIGNncm91cCBzdWJzeXMgY3B1c2V0ClsgICAg
MC4wMDAwMDBdIEluaXRpYWxpemluZyBjZ3JvdXAgc3Vic3lzIGNwdQpbICAgIDAuMDAwMDAw
XSBMaW51eCB2ZXJzaW9uIDMuNC4xOC0yLnB2b3BzLnF1YmVzLng4Nl82NCAodXNlckBuZW1l
emlzLm1hcm1hcmVrLm5ldCkgKGdjYyB2ZXJzaW9uIDQuNC41IDIwMTAxMTEyIChSZWQgSGF0
IDQuNC41LTIpIChHQ0MpICkgIzEgU01QIFdlZCBOb3YgNyAyMjo0NzoyMSBFU1QgMjAxMgpb
ICAgIDAuMDAwMDAwXSBDb21tYW5kIGxpbmU6IHJvIHJvb3Q9L2Rldi9tYXBwZXIvdmdfZG9t
MC1sdl9yb290IHJkX0xVS1NfVVVJRD1sdWtzLTQwMDMzNmZhLWM3YzQtNGJlMy1hMjQ0LWM5
MDlhYTE2YTE4YyByZF9MVk1fTFY9dmdfZG9tMC9sdl9yb290IHJkX0xWTV9MVj12Z19kb20w
L2x2X3N3YXAgcmRfTk9fTUQgcmRfTk9fRE0gTEFORz1lbl9VUy5VVEYtOCBTWVNGT05UPWxh
dGFyY3lyaGViLXN1bjE2IEtFWVRBQkxFPXBsMiByaGdiIHF1aWV0IG1heF9s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yAgNzQwLjMyNzcxMV0gc2RoY2ktcGNpIDAwMDA6MGE6MDAuMDogY291bGQg
bm90IHNldCByZWd1bGF0b3IgT0NSICgtMjIpClsgIDc0MC4zNzM5MzFdIHNkaGNpLXBjaSAw
MDAwOjBhOjAwLjA6IGNvdWxkIG5vdCBzZXQgcmVndWxhdG9yIE9DUiAoLTIyKQpbICA3NDIu
NTQyMDIyXSBocnRpbWVyOiBpbnRlcnJ1cHQgdG9vayAxMDI5ODAwMzEgbnMKWyAgNzU3LjYw
OTAzMV0gW3NjaGVkX2RlbGF5ZWRdIHNjaGVkOiBSVCB0aHJvdHRsaW5nIGFjdGl2YXRlZApb
ICA3NjAuMTY0NDI3XSBoZGEtaW50ZWw6IElSUSB0aW1pbmcgd29ya2Fyb3VuZCBpcyBhY3Rp
dmF0ZWQgZm9yIGNhcmQgIzAuIFN1Z2dlc3QgYSBiaWdnZXIgYmRsX3Bvc19hZGouCg==
--------------050106030504030501010304
Content-Type: text/plain; charset=UTF-8;
 name="xl-dmesg.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="xl-dmesg.txt"

KFhFTikgWGVuIHZlcnNpb24gNC4xLjMgKHVzZXJAbWFybWFyZWsubmV0KSAoZ2NjIHZlcnNp
b24gNC40LjUgMjAxMDExMTIgKFJlZCBIYXQgNC40LjUtMikgKEdDQykgKSBNb24gTm92IDI2
IDE1OjI1OjMyIEVTVCAyMDEyCihYRU4pIExhdGVzdCBDaGFuZ2VTZXQ6IHVuYXZhaWxhYmxl
CihYRU4pIEJvb3Rsb2FkZXI6IEdOVSBHUlVCIDAuOTcKKFhFTikgQ29tbWFuZCBsaW5lOiBj
b25zb2xlPW5vbmUgY3B1ZnJlcT12ZXJib3NlPTEKKFhFTikgVmlkZW8gaW5mb3JtYXRpb246
CihYRU4pICBWR0EgaXMgdGV4dCBtb2RlIDgweDI1LCBmb250IDh4MTYKKFhFTikgIFZCRS9E
REMgbWV0aG9kczogVjI7IEVESUQgdHJhbnNm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N10KKFhFTikgICAgIEMwOgl1c2FnZVswMDgy
NTAyMl0gZHVyYXRpb25bNzIyMzQ1MzE5ODgyXQooWEVOKSBQQzNbMF0gUEM2WzBdIFBDN1sw
XQooWEVOKSBDQzNbMF0gQ0M2WzBdCihYRU4pID09Y3B1Mz09CihYRU4pIGFjdGl2ZSBzdGF0
ZToJCUMxCihYRU4pIG1heF9jc3RhdGU6CQlDNwooWEVOKSBzdGF0ZXM6CihYRU4pICAgICpD
MToJdHlwZVtDMV0gbGF0ZW5jeVswMDBdIHVzYWdlWzAwODEwMjkyXSBtZXRob2RbIEhBTFRd
IGR1cmF0aW9uWzY5ODA4MzU5MDc4NTddCihYRU4pICAgICBDMDoJdXNhZ2VbMDA4MTAyOTJd
IGR1cmF0aW9uWzcyMzAzNjg0NDc3OV0KKFhFTikgUEMzWzBdIFBDNlswXSBQQzdbMF0KKFhF
TikgQ0MzWzBdIENDNlswXQo=
--------------050106030504030501010304--

--------------enig5230F3E2DC98D5B5654D4AE2
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQEcBAEBAgAGBQJQt6+LAAoJENuP0xzK19csMMoH/RoHGgzxN+8awGwLwaP1/xcN
BdH8Aq5EONXbuY7yg5MZZHW4npU45FY4i+pmNjq0DZbS3UNfOwOddDvH+eqJRBbG
JLl2HpCewxAuXmbOyFCmzR89w4P2CUcfxwQymBj7CnzvBIjUpkNIXZGduc+ZObUb
ndChvbcYKPKTSP/au4rrHx7krdaYarNeTwRaVhykg2peTkcRLlOXfWmFw3euuSL2
fsK9JoARSBfUB3UdzamSIXXm+BIf3wRtR0fc3BbBoO/mYvwx0KzAQFe+K3hmTx+u
Od3MHlEFNLwz09o4VhlKSYaQ7OpVIHaQOGMXXC0wQZe/cXgdMu0UjPjM/pY//sg=
=LuRe
-----END PGP SIGNATURE-----

--------------enig5230F3E2DC98D5B5654D4AE2--


--===============1945915925389597712==
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.xen.org
http://lists.xen.org/xen-devel

--===============1945915925389597712==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 18:55:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:55:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te9Gk-0004xy-4O; Thu, 29 Nov 2012 18:55:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <marmarek@invisiblethingslab.com>) id 1Te9Gh-0004xk-DX
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:55:28 +0000
Received: from [85.158.143.99:7502] by server-1.bemta-4.messagelabs.com id
	1D/A5-27934-E9FA7B05; Thu, 29 Nov 2012 18:55:26 +0000
X-Env-Sender: marmarek@invisiblethingslab.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1354215324!20370402!1
X-Originating-IP: [66.111.4.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTExLjQuMjggPT4gNTk5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7459 invoked from network); 29 Nov 2012 18:55:25 -0000
Received: from out4-smtp.messagingengine.com (HELO
	out4-smtp.messagingengine.com) (66.111.4.28)
	by server-6.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 18:55:25 -0000
Received: from compute5.internal (compute5.nyi.mail.srv.osa [10.202.2.45])
	by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 61F5420CFB
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 13:55:24 -0500 (EST)
Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160])
	by compute5.internal (MEProxy); Thu, 29 Nov 2012 13:55:24 -0500
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=message-id:date:from:mime-version:to
	:subject:content-type; s=mesmtp; bh=HIBktHiZvcR27MBVJfrXttc6Kcs=; b=
	KyFHzSF6QibWTJ4rAcs3ZAFDCK0pU9kO2c72eYj6nA10Z3+Xql+lhmtpTKvZq3rH
	hnZMkEtHJmJnG0cNd2Bz2Jg6dCIEXw6/eIgDfv5IhS2bTBmYbWt1AqqYtrJU3Xja
	E+u6rgpId4ilQP1IhIz/k5Gvs/DK9Qkzjp57J9Gb0/c=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	messagingengine.com; h=message-id:date:from:mime-version:to
	:subject:content-type; s=smtpout; bh=HIBktHiZvcR27MBVJfrXttc6Kcs
	=; b=NNIt70G2Db2AabPKwVBUQ8Zz6uTbKKUa4rC1Sjqo0j5jEyhnBArGVsN3Byq
	Zu1YVXaMBsjE+xXIVcHnoU1KhsAATe3o7fdXq4KCez+vsMYqepyR1TJT9UfPpXHn
	VTxkvi2XzSyPGNXBVIqIlXxFdKMKrkUB811HYFPWJy2l7eTc=
X-Sasl-enc: GH/NSOLJ78aXBVVQVbdKYyoD13rol7s5gTeWePh2Q2QP 1354215321
Received: from [10.137.1.17] (unknown [93.157.76.159])
	by mail.messagingengine.com (Postfix) with ESMTPA id F3BEA8E04CE
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 13:55:20 -0500 (EST)
Message-ID: <50B7AF8A.5010304@invisiblethingslab.com>
Date: Thu, 29 Nov 2012 19:55:06 +0100
From: Marek Marczykowski <marmarek@invisiblethingslab.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: xen-devel <xen-devel@lists.xen.org>
X-Enigmail-Version: 1.4.6
Subject: [Xen-devel] Only CPU0 active after ACPI S3, xen 4.1.3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1945915925389597712=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============1945915925389597712==
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="------------enig5230F3E2DC98D5B5654D4AE2"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig5230F3E2DC98D5B5654D4AE2
Content-Type: multipart/mixed;
 boundary="------------050106030504030501010304"

This is a multi-part message in MIME format.
--------------050106030504030501010304
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi all,

After resume from ACPI S3 system has only CPU0 enabled, every vCPU from e=
very
domain works on CPU0 [1].  When trying to pin some vCPU to CPU1 got error=
:
xl vcpu-pin testvm 1 1
libxl: error: libxl.c:2565:libxl_set_vcpuaffinity setting vcpu affinity:
Invalid argument

What went wrong? How can I reenable CPU1-CPU3?

System info:
xen 4.1.3
linux 3.4.18 with acpi-s3 patches from Konrad's git
Processor: Intel i5-2520M

dmesg from dom0 and hypervisor attached.

BTW Are there any plans to upstream acpi-s3 patches?

[1] xl vcpu-list:
Name                                ID  VCPU   CPU State   Time(s) CPU Af=
finity
dom0                                 0     0    0   r--    1347.8  any cp=
u
dom0                                 0     1    0   -b-     594.4  any cp=
u
dom0                                 0     2    0   -b-     421.1  any cp=
u
dom0                                 0     3    0   -b-     432.6  any cp=
u
netvm                                1     0    0   -b-     596.6  any cp=
u
netvm                                1     1    0   -b-     363.7  any cp=
u
firewallvm                           2     0    0   -b-     170.5  any cp=
u
firewallvm                           2     1    0   -b-     122.5  any cp=
u
devel17                              3     0    0   -b-     137.0  any cp=
u
devel17                              3     1    0   -b-     112.9  any cp=
u
devel17                              3     2    0   -b-      97.9  any cp=
u
devel17                              3     3    0   -b-     116.0  any cp=
u
vm2                                  4     0    0   -b-     418.6  any cp=
u
vm2                                  4     1    0   -b-     390.2  any cp=
u
private                              5     0    0   -b-     175.9  any cp=
u
private                              5     1    0   -b-     161.6  any cp=
u
mail                                 6     0    0   -b-    1587.1  any cp=
u
mail                                 6     1    0   -b-    1717.5  any cp=
u
testvm                               7     0    0   -b-      73.0  any cp=
u
testvm                               7     1    0   -b-      68.9  any cp=
u
testvm                               7     2    0   -b-      51.4  any cp=
u
testvm                               7     3    0   -b-      67.1  any cp=
u
disp1                                8     0    0   -b-     199.9  any cp=
u


--=20
Best Regards / Pozdrawiam,
Marek Marczykowski
Invisible Things Lab

--------------050106030504030501010304
Content-Type: text/plain; charset=UTF-8;
 name="dom0-dmesg.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="dom0-dmesg.txt"

WyAgICAwLjAwMDAwMF0gSW5pdGlhbGl6aW5nIGNncm91cCBzdWJzeXMgY3B1c2V0ClsgICAg
MC4wMDAwMDBdIEluaXRpYWxpemluZyBjZ3JvdXAgc3Vic3lzIGNwdQpbICAgIDAuMDAwMDAw
XSBMaW51eCB2ZXJzaW9uIDMuNC4xOC0yLnB2b3BzLnF1YmVzLng4Nl82NCAodXNlckBuZW1l
emlzLm1hcm1hcmVrLm5ldCkgKGdjYyB2Z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c2VjcwpbICA3MzguOTA1
OTIyXSBQTTogRmluaXNoaW5nIHdha2V1cC4KWyAgNzM4LjkwNTkyNl0gUmVzdGFydGluZyB0
YXNrcyAuLi4gZG9uZS4KWyAgNzM4LjkxMTMzNF0gdmlkZW8gTE5YVklERU86MDA6IFJlc3Rv
cmluZyBiYWNrbGlnaHQgc3RhdGUKWyAgNzM5LjgzNjI1MF0gZGVsbF93bWk6IFJlY2VpdmVk
IHVua25vd24gV01JIGV2ZW50ICgweDApClsgIDc0MC4xODQ3NTldIHNkaGNpLXBjaSAwMDAw
OjBhOjAwLjA6IGNvdWxkIG5vdCBzZXQgcmVndWxhdG9yIE9DUiAoLTIyKQpbICA3NDAuMjM5
NzMwXSBzZGhjaS1wY2kgMDAwMDowYTowMC4wOiBjb3VsZCBub3Qgc2V0IHJlZ3VsYXRvciBP
Q1IgKC0yMikKWyAgNzQwLjMyNzcxMV0gc2RoY2ktcGNpIDAwMDA6MGE6MDAuMDogY291bGQg
bm90IHNldCByZWd1bGF0b3IgT0NSICgtMjIpClsgIDc0MC4zNzM5MzFdIHNkaGNpLXBjaSAw
MDAwOjBhOjAwLjA6IGNvdWxkIG5vdCBzZXQgcmVndWxhdG9yIE9DUiAoLTIyKQpbICA3NDIu
NTQyMDIyXSBocnRpbWVyOiBpbnRlcnJ1cHQgdG9vayAxMDI5ODAwMzEgbnMKWyAgNzU3LjYw
OTAzMV0gW3NjaGVkX2RlbGF5ZWRdIHNjaGVkOiBSVCB0aHJvdHRsaW5nIGFjdGl2YXRlZApb
ICA3NjAuMTY0NDI3XSBoZGEtaW50ZWw6IElSUSB0aW1pbmcgd29ya2Fyb3VuZCBpcyBhY3Rp
dmF0ZWQgZm9yIGNhcmQgIzAuIFN1Z2dlc3QgYSBiaWdnZXIgYmRsX3Bvc19hZGouCg==
--------------050106030504030501010304
Content-Type: text/plain; charset=UTF-8;
 name="xl-dmesg.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="xl-dmesg.txt"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AgICAqQzE6CXR5cGVbQzFdIGxhdGVuY3lbMDAwXSB1c2FnZVswMDgwODAyN10gbWV0
aG9kWyBIQUxUXSBkdXJhdGlvbls2OTc4Nzk5MzA2NzUwXQooWEVOKSAgICAgQzA6CXVzYWdl
WzAwODA4MDI3XSBkdXJhdGlvbls3MjUwNzMzOTgxMDRdCihYRU4pIFBDM1swXSBQQzZbMF0g
UEM3WzBdCihYRU4pIENDM1swXSBDQzZbMF0KKFhFTikgPT1jcHUyPT0KKFhFTikgYWN0aXZl
IHN0YXRlOgkJQzEKKFhFTikgbWF4X2NzdGF0ZToJCUM3CihYRU4pIHN0YXRlczoKKFhFTikg
ICAgKkMxOgl0eXBlW0MxXSBsYXRlbmN5WzAwMF0gdXNhZ2VbMDA4MjUwMjJdIG1ldGhvZFsg
SEFMVF0gZHVyYXRpb25bNjk4MTUyNzQxNjA5N10KKFhFTikgICAgIEMwOgl1c2FnZVswMDgy
NTAyMl0gZHVyYXRpb25bNzIyMzQ1MzE5ODgyXQooWEVOKSBQQzNbMF0gUEM2WzBdIFBDN1sw
XQooWEVOKSBDQzNbMF0gQ0M2WzBdCihYRU4pID09Y3B1Mz09CihYRU4pIGFjdGl2ZSBzdGF0
ZToJCUMxCihYRU4pIG1heF9jc3RhdGU6CQlDNwooWEVOKSBzdGF0ZXM6CihYRU4pICAgICpD
MToJdHlwZVtDMV0gbGF0ZW5jeVswMDBdIHVzYWdlWzAwODEwMjkyXSBtZXRob2RbIEhBTFRd
IGR1cmF0aW9uWzY5ODA4MzU5MDc4NTddCihYRU4pICAgICBDMDoJdXNhZ2VbMDA4MTAyOTJd
IGR1cmF0aW9uWzcyMzAzNjg0NDc3OV0KKFhFTikgUEMzWzBdIFBDNlswXSBQQzdbMF0KKFhF
TikgQ0MzWzBdIENDNlswXQo=
--------------050106030504030501010304--

--------------enig5230F3E2DC98D5B5654D4AE2
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQEcBAEBAgAGBQJQt6+LAAoJENuP0xzK19csMMoH/RoHGgzxN+8awGwLwaP1/xcN
BdH8Aq5EONXbuY7yg5MZZHW4npU45FY4i+pmNjq0DZbS3UNfOwOddDvH+eqJRBbG
JLl2HpCewxAuXmbOyFCmzR89w4P2CUcfxwQymBj7CnzvBIjUpkNIXZGduc+ZObUb
ndChvbcYKPKTSP/au4rrHx7krdaYarNeTwRaVhykg2peTkcRLlOXfWmFw3euuSL2
fsK9JoARSBfUB3UdzamSIXXm+BIf3wRtR0fc3BbBoO/mYvwx0KzAQFe+K3hmTx+u
Od3MHlEFNLwz09o4VhlKSYaQ7OpVIHaQOGMXXC0wQZe/cXgdMu0UjPjM/pY//sg=
=LuRe
-----END PGP SIGNATURE-----

--------------enig5230F3E2DC98D5B5654D4AE2--


--===============1945915925389597712==
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.xen.org
http://lists.xen.org/xen-devel

--===============1945915925389597712==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 18:56:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:56:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te9Ht-000553-Ul; Thu, 29 Nov 2012 18:56:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bouyer@antioche.eu.org>) id 1Te9Ht-00054o-2d
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:56:41 +0000
Received: from [85.158.139.83:63771] by server-14.bemta-5.messagelabs.com id
	4E/C7-21768-8EFA7B05; Thu, 29 Nov 2012 18:56:40 +0000
X-Env-Sender: bouyer@antioche.eu.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1354215398!27158094!1
X-Originating-IP: [62.212.96.44]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13731 invoked from network); 29 Nov 2012 18:56:39 -0000
Received: from bouyer.net1.nerim.net (HELO chassiron.antioche.eu.org)
	(62.212.96.44) by server-13.tower-182.messagelabs.com with SMTP;
	29 Nov 2012 18:56:39 -0000
Received: from rochebonne.antioche.eu.org (rochebonne
	[IPv6:2001:7a8:242c:0:213:72ff:fe8e:9910])
	by chassiron.antioche.eu.org (8.14.4/8.12.11) with ESMTP id
	qATIuZpR010588; Thu, 29 Nov 2012 19:56:35 +0100 (MET)
Received: by rochebonne.antioche.eu.org (Postfix, from userid 1210)
	id 379842A3A; Thu, 29 Nov 2012 19:56:35 +0100 (CET)
Date: Thu, 29 Nov 2012 19:56:35 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Roger Pau Monne <roger.pau@citrix.com>
Message-ID: <20121129185635.GA1045@asim.lip6.fr>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6
	(chassiron.antioche.eu.org [IPv6:2001:7a8:242c:1::1]);
	Thu, 29 Nov 2012 19:56:35 +0100 (MET)
Cc: port-xen@NetBSD.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 06:31:45PM +0100, Roger Pau Monne wrote:
> The following series adds support for NetBSD gntdev to libxc, and 
> makes libxl use Qemu as a disk backend if an image file stored on a 
> remote filesystem is used.


Can't you let the administrator decide this in the domU's config file ?
Right now vnd on nfs has problems, but nothing unfixable.
So one day you'll want to use the kernel driver for nfs too.
But maybe other local filesystems will have the problem.
So it's not for the tool do decide in the back of the admin.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 18:56:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 18:56:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te9Ht-000553-Ul; Thu, 29 Nov 2012 18:56:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bouyer@antioche.eu.org>) id 1Te9Ht-00054o-2d
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 18:56:41 +0000
Received: from [85.158.139.83:63771] by server-14.bemta-5.messagelabs.com id
	4E/C7-21768-8EFA7B05; Thu, 29 Nov 2012 18:56:40 +0000
X-Env-Sender: bouyer@antioche.eu.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1354215398!27158094!1
X-Originating-IP: [62.212.96.44]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13731 invoked from network); 29 Nov 2012 18:56:39 -0000
Received: from bouyer.net1.nerim.net (HELO chassiron.antioche.eu.org)
	(62.212.96.44) by server-13.tower-182.messagelabs.com with SMTP;
	29 Nov 2012 18:56:39 -0000
Received: from rochebonne.antioche.eu.org (rochebonne
	[IPv6:2001:7a8:242c:0:213:72ff:fe8e:9910])
	by chassiron.antioche.eu.org (8.14.4/8.12.11) with ESMTP id
	qATIuZpR010588; Thu, 29 Nov 2012 19:56:35 +0100 (MET)
Received: by rochebonne.antioche.eu.org (Postfix, from userid 1210)
	id 379842A3A; Thu, 29 Nov 2012 19:56:35 +0100 (CET)
Date: Thu, 29 Nov 2012 19:56:35 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Roger Pau Monne <roger.pau@citrix.com>
Message-ID: <20121129185635.GA1045@asim.lip6.fr>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6
	(chassiron.antioche.eu.org [IPv6:2001:7a8:242c:1::1]);
	Thu, 29 Nov 2012 19:56:35 +0100 (MET)
Cc: port-xen@NetBSD.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 06:31:45PM +0100, Roger Pau Monne wrote:
> The following series adds support for NetBSD gntdev to libxc, and 
> makes libxl use Qemu as a disk backend if an image file stored on a 
> remote filesystem is used.


Can't you let the administrator decide this in the domU's config file ?
Right now vnd on nfs has problems, but nothing unfixable.
So one day you'll want to use the kernel driver for nfs too.
But maybe other local filesystems will have the problem.
So it's not for the tool do decide in the back of the admin.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 19:10:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 19:10:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te9Ur-0005Yr-BP; Thu, 29 Nov 2012 19:10:05 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te9Up-0005Ym-S2
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 19:10:04 +0000
Received: from [193.109.254.147:22768] by server-6.bemta-14.messagelabs.com id
	97/64-02788-B03B7B05; Thu, 29 Nov 2012 19:10:03 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-4.tower-27.messagelabs.com!1354216200!8817154!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26684 invoked from network); 29 Nov 2012 19:10:01 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-4.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 19:10:01 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158399852;
	Thu, 29 Nov 2012 14:09:55 -0500
Message-ID: <50B7B2FD.5080205@jhuapl.edu>
Date: Thu, 29 Nov 2012 14:09:49 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0208902575666907630=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============0208902575666907630==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms080006030705090900010804"

This is a cryptographically signed message in MIME format.

--------------ms080006030705090900010804
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Looks good. I'm actually kind of surprised that the emulator doesn't prov=
ide
an interface to set the requested locality.

Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
> The vTPM protocol now contains a field allowing the locality of a
> command to be specified; pass this to the TPM when processing a packet.=

> This also enables a single vTPM to provide multiple tpmback interfaces
> so that several closely related domains can share a vTPM (for example, =
a
> qemu device stubdom and its target domain).
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>   stubdom/tpmemu-0.7.4.patch | 61 +++++++++++++++++++++++++++++++++++++=
+++++----
>   stubdom/vtpm/vtpm.c        | 16 +++---------
>   2 files changed, 59 insertions(+), 18 deletions(-)
>
> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
> index b84eff1..31ace1a 100644
> --- a/stubdom/tpmemu-0.7.4.patch
> +++ b/stubdom/tpmemu-0.7.4.patch
> @@ -1,9 +1,60 @@
> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emul=
ator-x86_64/tpm/tpm_emulator_extern.c
> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c	2012-04-27 10:5=
5:46.581963398 -0400
> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c	2012-04-27 10:56:02.=
193034152 -0400
> -@@ -249,7 +249,7 @@
> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
> +index 60bbb90..f8f7f0f 100644
> +--- a/tpm/tpm_capability.c
> ++++ b/tpm/tpm_capability.c
> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *=
setValue,
> +                              UINT32 setValueSize, BOOL ownerAuth,
> +                              BOOL deactivated, BOOL disabled)
> + {
> ++  if (tpmData.stany.flags.localityModifier !=3D 8)
> ++    return TPM_BAD_PARAMETER;
> +   /* set the capability area with the specified data, on failure
> +      deactivate the TPM */
> +   switch (subCap) {
> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
> +index 288d1ce..9e1cfb4 100644
> +--- a/tpm/tpm_cmd_handler.c
> ++++ b/tpm/tpm_cmd_handler.c
> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
> +   tpm_extern_release();
> + }
> +
> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t *=
*out, uint32_t *out_size)
> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t *=
*out, uint32_t *out_size, int locality)
> + {
> +   TPM_REQUEST req;
> +   TPM_RESPONSE rsp;
> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32=
_t in_size, uint8_t **out, uint3
> +   UINT32 len;
> +   BOOL free_out;
> +
> +-  debug("tpm_handle_command()");
> ++  debug("tpm_handle_command(%d)", locality);
> ++  if (locality !=3D -1)
> ++    tpmData.stany.flags.localityModifier =3D locality;
> +
> +   /* we need the whole packet at once, otherwise unmarshalling will f=
ail */
> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) !=3D =
0) {
> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
> +index eed749e..4c228bd 100644
> +--- a/tpm/tpm_emulator.h
> ++++ b/tpm/tpm_emulator.h
> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
> +  * its usage. In case of an error, all internally allocated memory
> +  * is released and the the state of out and out_size is unspecified.
> +  */
> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t *=
*out, uint32_t *out_size);
> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t *=
*out, uint32_t *out_size, int locality);
> +
> + #endif /* _TPM_EMULATOR_H_ */
> +
> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c
> +index aabe6c3..440a01b 100644
> +--- a/tpm/tpm_emulator_extern.c
> ++++ b/tpm/tpm_emulator_extern.c
> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, size_=
t *data_length) =3D _tpm_read_fr
>    #else /* TPM_NO_EXTERN */
> -
> +
>    int (*tpm_extern_init)(void)                                      =3D=
 NULL;
>   -int (*tpm_extern_release)(void)                                   =3D=
 NULL;
>   +void (*tpm_extern_release)(void)                                   =3D=
 NULL;
> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
> index c33e078..dcfc3b9 100644
> --- a/stubdom/vtpm/vtpm.c
> +++ b/stubdom/vtpm/vtpm.c
> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>  =20
>   static void main_loop(void) {
>      tpmcmd_t* tpmcmd =3D NULL;
> -   domid_t domid;		/* Domid of frontend */
> -   unsigned int handle;	/* handle of frontend */
>      int res =3D -1;
>  =20
>      info("VTPM Initializing\n");
> @@ -162,15 +160,7 @@ static void main_loop(void) {
>         goto abort_postpcrs;
>      }
>  =20
> -   /* Wait for the frontend domain to connect */
> -   info("Waiting for frontend domain to connect..");
> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) =3D=3D 0) {
> -      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, ha=
ndle);
> -   } else {
> -      error("Unable to attach to a frontend");
> -   }
> -
> -   tpmcmd =3D tpmback_req(domid, handle);
> +   tpmcmd =3D tpmback_req_any();
>      while(tpmcmd) {
>         /* Handle the request */
>         if(tpmcmd->req_len) {
> @@ -183,7 +173,7 @@ static void main_loop(void) {
>            }
>            /* If not disabled, do the command */
>            else {
> -            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->req_le=
n, &tpmcmd->resp, &tpmcmd->resp_len)) !=3D 0) {
> +            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->req_le=
n, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) !=3D 0) {
>                  error("tpm_handle_command() failed");
>                  create_error_response(tpmcmd, TPM_FAIL);
>               }
> @@ -194,7 +184,7 @@ static void main_loop(void) {
>         tpmback_resp(tpmcmd);
>  =20
>         /* Wait for the next request */
> -      tpmcmd =3D tpmback_req(domid, handle);
> +      tpmcmd =3D tpmback_req_any();
>  =20
>      }
>  =20



--------------ms080006030705090900010804
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4Bq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0OVowIwYJKoZIhvcNAQkEMRYEFIErKoc/yOhX2kdh
kZDvIbhHYU8XMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAIjG4GFzNAR2xIfzAPLWI4QSAUzKET19M3
cIpkHxFGiH06PRWAa9dFc2a3S3WDd8TqOZby62ZCRTOAYBcQ1iWRf5H0StkDkWy8FNXtMWDs
H37dwo53scU9IiuS+yVx4rc6YVKV+0gfZE5nfK20eW2nV9wnxrvj61zWYRfwzYNqgQAAAAAA
AA==
--------------ms080006030705090900010804--


--===============0208902575666907630==
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.xen.org
http://lists.xen.org/xen-devel

--===============0208902575666907630==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 19:10:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 19:10:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te9Ur-0005Yr-BP; Thu, 29 Nov 2012 19:10:05 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1Te9Up-0005Ym-S2
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 19:10:04 +0000
Received: from [193.109.254.147:22768] by server-6.bemta-14.messagelabs.com id
	97/64-02788-B03B7B05; Thu, 29 Nov 2012 19:10:03 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-4.tower-27.messagelabs.com!1354216200!8817154!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26684 invoked from network); 29 Nov 2012 19:10:01 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-4.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 19:10:01 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158399852;
	Thu, 29 Nov 2012 14:09:55 -0500
Message-ID: <50B7B2FD.5080205@jhuapl.edu>
Date: Thu, 29 Nov 2012 14:09:49 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
In-Reply-To: <1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0208902575666907630=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============0208902575666907630==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms080006030705090900010804"

This is a cryptographically signed message in MIME format.

--------------ms080006030705090900010804
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Looks good. I'm actually kind of surprised that the emulator doesn't prov=
ide
an interface to set the requested locality.

Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>

On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
> The vTPM protocol now contains a field allowing the locality of a
> command to be specified; pass this to the TPM when processing a packet.=

> This also enables a single vTPM to provide multiple tpmback interfaces
> so that several closely related domains can share a vTPM (for example, =
a
> qemu device stubdom and its target domain).
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
>   stubdom/tpmemu-0.7.4.patch | 61 +++++++++++++++++++++++++++++++++++++=
+++++----
>   stubdom/vtpm/vtpm.c        | 16 +++---------
>   2 files changed, 59 insertions(+), 18 deletions(-)
>
> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
> index b84eff1..31ace1a 100644
> --- a/stubdom/tpmemu-0.7.4.patch
> +++ b/stubdom/tpmemu-0.7.4.patch
> @@ -1,9 +1,60 @@
> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emul=
ator-x86_64/tpm/tpm_emulator_extern.c
> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c	2012-04-27 10:5=
5:46.581963398 -0400
> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c	2012-04-27 10:56:02.=
193034152 -0400
> -@@ -249,7 +249,7 @@
> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
> +index 60bbb90..f8f7f0f 100644
> +--- a/tpm/tpm_capability.c
> ++++ b/tpm/tpm_capability.c
> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *=
setValue,
> +                              UINT32 setValueSize, BOOL ownerAuth,
> +                              BOOL deactivated, BOOL disabled)
> + {
> ++  if (tpmData.stany.flags.localityModifier !=3D 8)
> ++    return TPM_BAD_PARAMETER;
> +   /* set the capability area with the specified data, on failure
> +      deactivate the TPM */
> +   switch (subCap) {
> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
> +index 288d1ce..9e1cfb4 100644
> +--- a/tpm/tpm_cmd_handler.c
> ++++ b/tpm/tpm_cmd_handler.c
> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
> +   tpm_extern_release();
> + }
> +
> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t *=
*out, uint32_t *out_size)
> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t *=
*out, uint32_t *out_size, int locality)
> + {
> +   TPM_REQUEST req;
> +   TPM_RESPONSE rsp;
> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32=
_t in_size, uint8_t **out, uint3
> +   UINT32 len;
> +   BOOL free_out;
> +
> +-  debug("tpm_handle_command()");
> ++  debug("tpm_handle_command(%d)", locality);
> ++  if (locality !=3D -1)
> ++    tpmData.stany.flags.localityModifier =3D locality;
> +
> +   /* we need the whole packet at once, otherwise unmarshalling will f=
ail */
> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) !=3D =
0) {
> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
> +index eed749e..4c228bd 100644
> +--- a/tpm/tpm_emulator.h
> ++++ b/tpm/tpm_emulator.h
> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
> +  * its usage. In case of an error, all internally allocated memory
> +  * is released and the the state of out and out_size is unspecified.
> +  */
> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t *=
*out, uint32_t *out_size);
> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t *=
*out, uint32_t *out_size, int locality);
> +
> + #endif /* _TPM_EMULATOR_H_ */
> +
> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c
> +index aabe6c3..440a01b 100644
> +--- a/tpm/tpm_emulator_extern.c
> ++++ b/tpm/tpm_emulator_extern.c
> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, size_=
t *data_length) =3D _tpm_read_fr
>    #else /* TPM_NO_EXTERN */
> -
> +
>    int (*tpm_extern_init)(void)                                      =3D=
 NULL;
>   -int (*tpm_extern_release)(void)                                   =3D=
 NULL;
>   +void (*tpm_extern_release)(void)                                   =3D=
 NULL;
> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
> index c33e078..dcfc3b9 100644
> --- a/stubdom/vtpm/vtpm.c
> +++ b/stubdom/vtpm/vtpm.c
> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>  =20
>   static void main_loop(void) {
>      tpmcmd_t* tpmcmd =3D NULL;
> -   domid_t domid;		/* Domid of frontend */
> -   unsigned int handle;	/* handle of frontend */
>      int res =3D -1;
>  =20
>      info("VTPM Initializing\n");
> @@ -162,15 +160,7 @@ static void main_loop(void) {
>         goto abort_postpcrs;
>      }
>  =20
> -   /* Wait for the frontend domain to connect */
> -   info("Waiting for frontend domain to connect..");
> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) =3D=3D 0) {
> -      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, ha=
ndle);
> -   } else {
> -      error("Unable to attach to a frontend");
> -   }
> -
> -   tpmcmd =3D tpmback_req(domid, handle);
> +   tpmcmd =3D tpmback_req_any();
>      while(tpmcmd) {
>         /* Handle the request */
>         if(tpmcmd->req_len) {
> @@ -183,7 +173,7 @@ static void main_loop(void) {
>            }
>            /* If not disabled, do the command */
>            else {
> -            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->req_le=
n, &tpmcmd->resp, &tpmcmd->resp_len)) !=3D 0) {
> +            if((res =3D tpm_handle_command(tpmcmd->req, tpmcmd->req_le=
n, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) !=3D 0) {
>                  error("tpm_handle_command() failed");
>                  create_error_response(tpmcmd, TPM_FAIL);
>               }
> @@ -194,7 +184,7 @@ static void main_loop(void) {
>         tpmback_resp(tpmcmd);
>  =20
>         /* Wait for the next request */
> -      tpmcmd =3D tpmback_req(domid, handle);
> +      tpmcmd =3D tpmback_req_any();
>  =20
>      }
>  =20



--------------ms080006030705090900010804
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgDKi5DoD1UHDQEwp
bY7iHLJeq0NPr4BqYNqnCFPbE6HC8zSJrr4qKn+gVUQT39SIFq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hX2kdh
kZDvIbhHYU8XMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYAIjG4GFzNAR2xIfzAPLWI4QSAUzKET19M3
cIpkHxFGiH06PRWAa9dFc2a3S3WDd8TqOZby62ZCRTOAYBcQ1iWRf5H0StkDkWy8FNXtMWDs
H37dwo53scU9IiuS+yVx4rc6YVKV+0gfZE5nfK20eW2nV9wnxrvj61zWYRfwzYNqgQAAAAAA
AA==
--------------ms080006030705090900010804--


--===============0208902575666907630==
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.xen.org
http://lists.xen.org/xen-devel

--===============0208902575666907630==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 19:20:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 19:20:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te9ew-0005r6-GK; Thu, 29 Nov 2012 19:20:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1Te9eu-0005r1-Pl
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 19:20:29 +0000
Received: from [85.158.138.51:42820] by server-2.bemta-3.messagelabs.com id
	BF/86-04744-775B7B05; Thu, 29 Nov 2012 19:20:23 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-174.messagelabs.com!1354216821!30136743!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26705 invoked from network); 29 Nov 2012 19:20:22 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-15.tower-174.messagelabs.com with SMTP;
	29 Nov 2012 19:20:22 -0000
X-TM-IMSS-Message-ID: <cc468b540004ff9e@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id cc468b540004ff9e ;
	Thu, 29 Nov 2012 14:20:27 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qATJKJuS018620; 
	Thu, 29 Nov 2012 14:20:19 -0500
Message-ID: <50B7B573.6000506@tycho.nsa.gov>
Date: Thu, 29 Nov 2012 14:20:19 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B7B2FD.5080205@jhuapl.edu>
In-Reply-To: <50B7B2FD.5080205@jhuapl.edu>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/29/2012 02:09 PM, Matthew Fioravante wrote:
> Looks good. I'm actually kind of surprised that the emulator doesn't provide
> an interface to set the requested locality.

It does; however, it's a rather bad interface: you can send a vendor-specific
command to change the entire STANY_FLAGS data structure, which contains the
locality field along with some others that really shouldn't be changed. This
patch restricts that vendor-specific command interface to locality 8, which
can itself be restricted or unavailable once locality restrictions are
implemented. The number 8 was chosen because it's not usable as a quoting
locality since (1<<8) won't fit in uint8_t.
 
> Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> 
> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>> The vTPM protocol now contains a field allowing the locality of a
>> command to be specified; pass this to the TPM when processing a packet.
>> This also enables a single vTPM to provide multiple tpmback interfaces
>> so that several closely related domains can share a vTPM (for example, a
>> qemu device stubdom and its target domain).
>>
>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> ---
>>   stubdom/tpmemu-0.7.4.patch | 61 ++++++++++++++++++++++++++++++++++++++++++----
>>   stubdom/vtpm/vtpm.c        | 16 +++---------
>>   2 files changed, 59 insertions(+), 18 deletions(-)
>>
>> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
>> index b84eff1..31ace1a 100644
>> --- a/stubdom/tpmemu-0.7.4.patch
>> +++ b/stubdom/tpmemu-0.7.4.patch
>> @@ -1,9 +1,60 @@
>> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
>> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c    2012-04-27 10:55:46.581963398 -0400
>> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c    2012-04-27 10:56:02.193034152 -0400
>> -@@ -249,7 +249,7 @@
>> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
>> +index 60bbb90..f8f7f0f 100644
>> +--- a/tpm/tpm_capability.c
>> ++++ b/tpm/tpm_capability.c
>> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *setValue,
>> +                              UINT32 setValueSize, BOOL ownerAuth,
>> +                              BOOL deactivated, BOOL disabled)
>> + {
>> ++  if (tpmData.stany.flags.localityModifier != 8)
>> ++    return TPM_BAD_PARAMETER;
>> +   /* set the capability area with the specified data, on failure
>> +      deactivate the TPM */
>> +   switch (subCap) {
>> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
>> +index 288d1ce..9e1cfb4 100644
>> +--- a/tpm/tpm_cmd_handler.c
>> ++++ b/tpm/tpm_cmd_handler.c
>> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
>> +   tpm_extern_release();
>> + }
>> +
>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size)
>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality)
>> + {
>> +   TPM_REQUEST req;
>> +   TPM_RESPONSE rsp;
>> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint3
>> +   UINT32 len;
>> +   BOOL free_out;
>> +
>> +-  debug("tpm_handle_command()");
>> ++  debug("tpm_handle_command(%d)", locality);
>> ++  if (locality != -1)
>> ++    tpmData.stany.flags.localityModifier = locality;
>> +
>> +   /* we need the whole packet at once, otherwise unmarshalling will fail */
>> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) != 0) {
>> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
>> +index eed749e..4c228bd 100644
>> +--- a/tpm/tpm_emulator.h
>> ++++ b/tpm/tpm_emulator.h
>> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
>> +  * its usage. In case of an error, all internally allocated memory
>> +  * is released and the the state of out and out_size is unspecified.
>> +  */
>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size);
>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality);
>> +
>> + #endif /* _TPM_EMULATOR_H_ */
>> +
>> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c
>> +index aabe6c3..440a01b 100644
>> +--- a/tpm/tpm_emulator_extern.c
>> ++++ b/tpm/tpm_emulator_extern.c
>> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length) = _tpm_read_fr
>>    #else /* TPM_NO_EXTERN */
>> -
>> +
>>    int (*tpm_extern_init)(void)                                      = NULL;
>>   -int (*tpm_extern_release)(void)                                   = NULL;
>>   +void (*tpm_extern_release)(void)                                   = NULL;
>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>> index c33e078..dcfc3b9 100644
>> --- a/stubdom/vtpm/vtpm.c
>> +++ b/stubdom/vtpm/vtpm.c
>> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>>     static void main_loop(void) {
>>      tpmcmd_t* tpmcmd = NULL;
>> -   domid_t domid;        /* Domid of frontend */
>> -   unsigned int handle;    /* handle of frontend */
>>      int res = -1;
>>        info("VTPM Initializing\n");
>> @@ -162,15 +160,7 @@ static void main_loop(void) {
>>         goto abort_postpcrs;
>>      }
>>   -   /* Wait for the frontend domain to connect */
>> -   info("Waiting for frontend domain to connect..");
>> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
>> -      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
>> -   } else {
>> -      error("Unable to attach to a frontend");
>> -   }
>> -
>> -   tpmcmd = tpmback_req(domid, handle);
>> +   tpmcmd = tpmback_req_any();
>>      while(tpmcmd) {
>>         /* Handle the request */
>>         if(tpmcmd->req_len) {
>> @@ -183,7 +173,7 @@ static void main_loop(void) {
>>            }
>>            /* If not disabled, do the command */
>>            else {
>> -            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
>> +            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) != 0) {
>>                  error("tpm_handle_command() failed");
>>                  create_error_response(tpmcmd, TPM_FAIL);
>>               }
>> @@ -194,7 +184,7 @@ static void main_loop(void) {
>>         tpmback_resp(tpmcmd);
>>           /* Wait for the next request */
>> -      tpmcmd = tpmback_req(domid, handle);
>> +      tpmcmd = tpmback_req_any();
>>        }
>>   
> 
> 


-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 19:20:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 19:20:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te9ew-0005r6-GK; Thu, 29 Nov 2012 19:20:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1Te9eu-0005r1-Pl
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 19:20:29 +0000
Received: from [85.158.138.51:42820] by server-2.bemta-3.messagelabs.com id
	BF/86-04744-775B7B05; Thu, 29 Nov 2012 19:20:23 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-174.messagelabs.com!1354216821!30136743!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26705 invoked from network); 29 Nov 2012 19:20:22 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-15.tower-174.messagelabs.com with SMTP;
	29 Nov 2012 19:20:22 -0000
X-TM-IMSS-Message-ID: <cc468b540004ff9e@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id cc468b540004ff9e ;
	Thu, 29 Nov 2012 14:20:27 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qATJKJuS018620; 
	Thu, 29 Nov 2012 14:20:19 -0500
Message-ID: <50B7B573.6000506@tycho.nsa.gov>
Date: Thu, 29 Nov 2012 14:20:19 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-5-git-send-email-dgdegra@tycho.nsa.gov>
	<50B7B2FD.5080205@jhuapl.edu>
In-Reply-To: <50B7B2FD.5080205@jhuapl.edu>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 4/4] stubdom/vtpm: Support multiple backends
	and locality
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/29/2012 02:09 PM, Matthew Fioravante wrote:
> Looks good. I'm actually kind of surprised that the emulator doesn't provide
> an interface to set the requested locality.

It does; however, it's a rather bad interface: you can send a vendor-specific
command to change the entire STANY_FLAGS data structure, which contains the
locality field along with some others that really shouldn't be changed. This
patch restricts that vendor-specific command interface to locality 8, which
can itself be restricted or unavailable once locality restrictions are
implemented. The number 8 was chosen because it's not usable as a quoting
locality since (1<<8) won't fit in uint8_t.
 
> Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> 
> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>> The vTPM protocol now contains a field allowing the locality of a
>> command to be specified; pass this to the TPM when processing a packet.
>> This also enables a single vTPM to provide multiple tpmback interfaces
>> so that several closely related domains can share a vTPM (for example, a
>> qemu device stubdom and its target domain).
>>
>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> ---
>>   stubdom/tpmemu-0.7.4.patch | 61 ++++++++++++++++++++++++++++++++++++++++++----
>>   stubdom/vtpm/vtpm.c        | 16 +++---------
>>   2 files changed, 59 insertions(+), 18 deletions(-)
>>
>> diff --git a/stubdom/tpmemu-0.7.4.patch b/stubdom/tpmemu-0.7.4.patch
>> index b84eff1..31ace1a 100644
>> --- a/stubdom/tpmemu-0.7.4.patch
>> +++ b/stubdom/tpmemu-0.7.4.patch
>> @@ -1,9 +1,60 @@
>> -diff -Naur tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c tpm_emulator-x86_64/tpm/tpm_emulator_extern.c
>> ---- tpm_emulator-x86_64-back/tpm/tpm_emulator_extern.c    2012-04-27 10:55:46.581963398 -0400
>> -+++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.c    2012-04-27 10:56:02.193034152 -0400
>> -@@ -249,7 +249,7 @@
>> +diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
>> +index 60bbb90..f8f7f0f 100644
>> +--- a/tpm/tpm_capability.c
>> ++++ b/tpm/tpm_capability.c
>> +@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *setValue,
>> +                              UINT32 setValueSize, BOOL ownerAuth,
>> +                              BOOL deactivated, BOOL disabled)
>> + {
>> ++  if (tpmData.stany.flags.localityModifier != 8)
>> ++    return TPM_BAD_PARAMETER;
>> +   /* set the capability area with the specified data, on failure
>> +      deactivate the TPM */
>> +   switch (subCap) {
>> +diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
>> +index 288d1ce..9e1cfb4 100644
>> +--- a/tpm/tpm_cmd_handler.c
>> ++++ b/tpm/tpm_cmd_handler.c
>> +@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
>> +   tpm_extern_release();
>> + }
>> +
>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size)
>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality)
>> + {
>> +   TPM_REQUEST req;
>> +   TPM_RESPONSE rsp;
>> +@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint3
>> +   UINT32 len;
>> +   BOOL free_out;
>> +
>> +-  debug("tpm_handle_command()");
>> ++  debug("tpm_handle_command(%d)", locality);
>> ++  if (locality != -1)
>> ++    tpmData.stany.flags.localityModifier = locality;
>> +
>> +   /* we need the whole packet at once, otherwise unmarshalling will fail */
>> +   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) != 0) {
>> +diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
>> +index eed749e..4c228bd 100644
>> +--- a/tpm/tpm_emulator.h
>> ++++ b/tpm/tpm_emulator.h
>> +@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
>> +  * its usage. In case of an error, all internally allocated memory
>> +  * is released and the the state of out and out_size is unspecified.
>> +  */
>> +-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size);
>> ++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality);
>> +
>> + #endif /* _TPM_EMULATOR_H_ */
>> +
>> +diff --git a/tpm/tpm_emulator_extern.c b/tpm/tpm_emulator_extern.c
>> +index aabe6c3..440a01b 100644
>> +--- a/tpm/tpm_emulator_extern.c
>> ++++ b/tpm/tpm_emulator_extern.c
>> +@@ -249,7 +249,7 @@ int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length) = _tpm_read_fr
>>    #else /* TPM_NO_EXTERN */
>> -
>> +
>>    int (*tpm_extern_init)(void)                                      = NULL;
>>   -int (*tpm_extern_release)(void)                                   = NULL;
>>   +void (*tpm_extern_release)(void)                                   = NULL;
>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>> index c33e078..dcfc3b9 100644
>> --- a/stubdom/vtpm/vtpm.c
>> +++ b/stubdom/vtpm/vtpm.c
>> @@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
>>     static void main_loop(void) {
>>      tpmcmd_t* tpmcmd = NULL;
>> -   domid_t domid;        /* Domid of frontend */
>> -   unsigned int handle;    /* handle of frontend */
>>      int res = -1;
>>        info("VTPM Initializing\n");
>> @@ -162,15 +160,7 @@ static void main_loop(void) {
>>         goto abort_postpcrs;
>>      }
>>   -   /* Wait for the frontend domain to connect */
>> -   info("Waiting for frontend domain to connect..");
>> -   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
>> -      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
>> -   } else {
>> -      error("Unable to attach to a frontend");
>> -   }
>> -
>> -   tpmcmd = tpmback_req(domid, handle);
>> +   tpmcmd = tpmback_req_any();
>>      while(tpmcmd) {
>>         /* Handle the request */
>>         if(tpmcmd->req_len) {
>> @@ -183,7 +173,7 @@ static void main_loop(void) {
>>            }
>>            /* If not disabled, do the command */
>>            else {
>> -            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
>> +            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) != 0) {
>>                  error("tpm_handle_command() failed");
>>                  create_error_response(tpmcmd, TPM_FAIL);
>>               }
>> @@ -194,7 +184,7 @@ static void main_loop(void) {
>>         tpmback_resp(tpmcmd);
>>           /* Wait for the next request */
>> -      tpmcmd = tpmback_req(domid, handle);
>> +      tpmcmd = tpmback_req_any();
>>        }
>>   
> 
> 


-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 19:29:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 19:29:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te9nC-00069P-ID; Thu, 29 Nov 2012 19:29:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1Te9nA-00069K-Qn
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 19:29:01 +0000
Received: from [85.158.139.83:35827] by server-15.bemta-5.messagelabs.com id
	8F/DF-26920-B77B7B05; Thu, 29 Nov 2012 19:28:59 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-182.messagelabs.com!1354217338!27615395!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32256 invoked from network); 29 Nov 2012 19:28:58 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-15.tower-182.messagelabs.com with SMTP;
	29 Nov 2012 19:28:58 -0000
X-TM-IMSS-Message-ID: <2f3fa1e1000206dd@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 2f3fa1e1000206dd ;
	Thu, 29 Nov 2012 14:27:52 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qATJSusE019004; 
	Thu, 29 Nov 2012 14:28:56 -0500
Message-ID: <50B7B778.5020806@tycho.nsa.gov>
Date: Thu, 29 Nov 2012 14:28:56 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-3-git-send-email-dgdegra@tycho.nsa.gov>
	<50B7AF3A.3090009@jhuapl.edu>
In-Reply-To: <50B7AF3A.3090009@jhuapl.edu>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/4] stubdom/vtpm: Add reconfiguration
	support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/29/2012 01:53 PM, Matthew Fioravante wrote:
> The purpose of this is to allow 2 entities in the same vm to use tpm drivers, pv_grub and the linux guest. The Xenbus Reconfigure states are new to me. Is this intended behavior in line with the original purpose of the Reconfigure states or are we hijacking them to do something not in the original xen front/back driver spec?
> 
> It looks like pv-grub just shuts down blkfront and the others without any reconfigure magic. Given that vtpm-stubdom will no longer automatically shutdown with your later patch, is there any reason we cannot just do the same here?

The vtpm backend in mini-os cleans up after itself destructively when it is
closed: it removes xenstore entries and frees the data structures, and so
requires the xenstore directory to be re-created. I originally wanted to keep
the shutdown semantics the same (to preserve the vtpm auto-shutdown), although
that's not reflected in this patch queue.

I think the correct method here is to make the backend act like it does for the
reconfigure on close, and trigger free only when the xenstore entry vanishes.
 
> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>> Allow the vtpm device to be disconnected and reconnected so that a
>> bootloader (like pv-grub) can submit measurements and return the vtpm
>> device to its initial state before booting the target kernel.
>>
>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> ---
>>   extras/mini-os/include/tpmfront.h |  2 +-
>>   extras/mini-os/lib/sys.c          |  2 +-
>>   extras/mini-os/tpmback.c          |  5 +++++
>>   extras/mini-os/tpmfront.c         | 15 +++++++++------
>>   stubdom/vtpm/vtpm.c               |  2 +-
>>   5 files changed, 17 insertions(+), 9 deletions(-)
>>
>> diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include/tpmfront.h
>> index a0c7c4d..913faa4 100644
>> --- a/extras/mini-os/include/tpmfront.h
>> +++ b/extras/mini-os/include/tpmfront.h
>> @@ -61,7 +61,7 @@ struct tpmfront_dev {
>>   /*Initialize frontend */
>>   struct tpmfront_dev* init_tpmfront(const char* nodename);
>>   /*Shutdown frontend */
>> -void shutdown_tpmfront(struct tpmfront_dev* dev);
>> +void shutdown_tpmfront(struct tpmfront_dev* dev, int for_reconfig);
>>     /* Send a tpm command to the backend and wait for the response
>>    *
>> diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
>> index 3cc3340..03da4f0 100644
>> --- a/extras/mini-os/lib/sys.c
>> +++ b/extras/mini-os/lib/sys.c
>> @@ -459,7 +459,7 @@ int close(int fd)
>>   #endif
>>   #ifdef CONFIG_TPMFRONT
>>       case FTYPE_TPMFRONT:
>> -            shutdown_tpmfront(files[fd].tpmfront.dev);
>> +            shutdown_tpmfront(files[fd].tpmfront.dev, 0);
>>           files[fd].type = FTYPE_NONE;
>>           return 0;
>>   #endif
>> diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
>> index 2d31061..ea42235 100644
>> --- a/extras/mini-os/tpmback.c
>> +++ b/extras/mini-os/tpmback.c
>> @@ -664,6 +664,7 @@ static int frontend_changed(tpmif_t* tpmif)
>>      switch (state) {
>>         case XenbusStateInitialising:
>>         case XenbusStateInitialised:
>> +      case XenbusStateReconfigured:
>>        break;
>>           case XenbusStateConnected:
>> @@ -678,6 +679,10 @@ static int frontend_changed(tpmif_t* tpmif)
>>        tpmif_change_state(tpmif, XenbusStateClosing);
>>        break;
>>   +      case XenbusStateReconfiguring:
>> +         disconnect_fe(tpmif);
>> +     break;
>> +
>>         case XenbusStateUnknown: /* keep it here */
>>         case XenbusStateClosed:
>>        free_tpmif(tpmif);
>> diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
>> index c1cbab3..b725ba0 100644
>> --- a/extras/mini-os/tpmfront.c
>> +++ b/extras/mini-os/tpmfront.c
>> @@ -344,10 +344,10 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
>>      return dev;
>>     error:
>> -   shutdown_tpmfront(dev);
>> +   shutdown_tpmfront(dev, 0);
>>      return NULL;
>>   }
>> -void shutdown_tpmfront(struct tpmfront_dev* dev)
>> +void shutdown_tpmfront(struct tpmfront_dev* dev, int for_reconfig)
> It might be cleaner to create a new function like reconfigure_tpmfront() or something like that instead of adding an option to shutdown_tpmfront().
>>   {
>>      char* err;
>>      char path[512];
>> @@ -357,8 +357,7 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>>      TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for reconfigure" : "");
>>      /* disconnect */
>>      if(dev->state == XenbusStateConnected) {
>> -      dev->state = XenbusStateClosing;
>> -      //FIXME: Transaction for this?
>> +      dev->state = for_reconfig ? XenbusStateReconfiguring : XenbusStateClosing;
>>         /* Tell backend we are closing */
>>         if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
>>        free(err);
>> @@ -374,15 +373,19 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>>        free(err);
>>         }
>>   +      if (for_reconfig)
>> +         wait_for_backend_state_changed(dev, XenbusStateReconfigured);
>> +
>>         /* Tell backend we are closed */
>> -      dev->state = XenbusStateClosed;
>> +      dev->state = for_reconfig ? XenbusStateInitialising : XenbusStateClosed;
>>         if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
>>        TPMFRONT_ERR("Unable to write to %s, error was %s", dev->nodename, err);
>>        free(err);
>>         }
>>           /* Wait for the backend to close and unmap shared pages, ignore any errors */
>> -      wait_for_backend_state_changed(dev, XenbusStateClosed);
>> +      if (!for_reconfig)
>> +         wait_for_backend_state_changed(dev, XenbusStateClosed);
>>           /* Close event channel and unmap shared page */
>>         mask_evtchn(dev->evtchn);
>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>> index 71aef78..c33e078 100644
>> --- a/stubdom/vtpm/vtpm.c
>> +++ b/stubdom/vtpm/vtpm.c
>> @@ -394,7 +394,7 @@ abort_postvtpmblk:
>>   abort_postrng:
>>        /* Close devices */
>> -   shutdown_tpmfront(tpmfront_dev);
>> +   shutdown_tpmfront(tpmfront_dev, 0);
>>   abort_posttpmfront:
>>      shutdown_tpmback();
>>   
> 
> 


-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 19:29:18 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 19:29:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1Te9nC-00069P-ID; Thu, 29 Nov 2012 19:29:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1Te9nA-00069K-Qn
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 19:29:01 +0000
Received: from [85.158.139.83:35827] by server-15.bemta-5.messagelabs.com id
	8F/DF-26920-B77B7B05; Thu, 29 Nov 2012 19:28:59 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-182.messagelabs.com!1354217338!27615395!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32256 invoked from network); 29 Nov 2012 19:28:58 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-15.tower-182.messagelabs.com with SMTP;
	29 Nov 2012 19:28:58 -0000
X-TM-IMSS-Message-ID: <2f3fa1e1000206dd@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 2f3fa1e1000206dd ;
	Thu, 29 Nov 2012 14:27:52 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qATJSusE019004; 
	Thu, 29 Nov 2012 14:28:56 -0500
Message-ID: <50B7B778.5020806@tycho.nsa.gov>
Date: Thu, 29 Nov 2012 14:28:56 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-3-git-send-email-dgdegra@tycho.nsa.gov>
	<50B7AF3A.3090009@jhuapl.edu>
In-Reply-To: <50B7AF3A.3090009@jhuapl.edu>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/4] stubdom/vtpm: Add reconfiguration
	support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/29/2012 01:53 PM, Matthew Fioravante wrote:
> The purpose of this is to allow 2 entities in the same vm to use tpm drivers, pv_grub and the linux guest. The Xenbus Reconfigure states are new to me. Is this intended behavior in line with the original purpose of the Reconfigure states or are we hijacking them to do something not in the original xen front/back driver spec?
> 
> It looks like pv-grub just shuts down blkfront and the others without any reconfigure magic. Given that vtpm-stubdom will no longer automatically shutdown with your later patch, is there any reason we cannot just do the same here?

The vtpm backend in mini-os cleans up after itself destructively when it is
closed: it removes xenstore entries and frees the data structures, and so
requires the xenstore directory to be re-created. I originally wanted to keep
the shutdown semantics the same (to preserve the vtpm auto-shutdown), although
that's not reflected in this patch queue.

I think the correct method here is to make the backend act like it does for the
reconfigure on close, and trigger free only when the xenstore entry vanishes.
 
> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>> Allow the vtpm device to be disconnected and reconnected so that a
>> bootloader (like pv-grub) can submit measurements and return the vtpm
>> device to its initial state before booting the target kernel.
>>
>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> ---
>>   extras/mini-os/include/tpmfront.h |  2 +-
>>   extras/mini-os/lib/sys.c          |  2 +-
>>   extras/mini-os/tpmback.c          |  5 +++++
>>   extras/mini-os/tpmfront.c         | 15 +++++++++------
>>   stubdom/vtpm/vtpm.c               |  2 +-
>>   5 files changed, 17 insertions(+), 9 deletions(-)
>>
>> diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include/tpmfront.h
>> index a0c7c4d..913faa4 100644
>> --- a/extras/mini-os/include/tpmfront.h
>> +++ b/extras/mini-os/include/tpmfront.h
>> @@ -61,7 +61,7 @@ struct tpmfront_dev {
>>   /*Initialize frontend */
>>   struct tpmfront_dev* init_tpmfront(const char* nodename);
>>   /*Shutdown frontend */
>> -void shutdown_tpmfront(struct tpmfront_dev* dev);
>> +void shutdown_tpmfront(struct tpmfront_dev* dev, int for_reconfig);
>>     /* Send a tpm command to the backend and wait for the response
>>    *
>> diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
>> index 3cc3340..03da4f0 100644
>> --- a/extras/mini-os/lib/sys.c
>> +++ b/extras/mini-os/lib/sys.c
>> @@ -459,7 +459,7 @@ int close(int fd)
>>   #endif
>>   #ifdef CONFIG_TPMFRONT
>>       case FTYPE_TPMFRONT:
>> -            shutdown_tpmfront(files[fd].tpmfront.dev);
>> +            shutdown_tpmfront(files[fd].tpmfront.dev, 0);
>>           files[fd].type = FTYPE_NONE;
>>           return 0;
>>   #endif
>> diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
>> index 2d31061..ea42235 100644
>> --- a/extras/mini-os/tpmback.c
>> +++ b/extras/mini-os/tpmback.c
>> @@ -664,6 +664,7 @@ static int frontend_changed(tpmif_t* tpmif)
>>      switch (state) {
>>         case XenbusStateInitialising:
>>         case XenbusStateInitialised:
>> +      case XenbusStateReconfigured:
>>        break;
>>           case XenbusStateConnected:
>> @@ -678,6 +679,10 @@ static int frontend_changed(tpmif_t* tpmif)
>>        tpmif_change_state(tpmif, XenbusStateClosing);
>>        break;
>>   +      case XenbusStateReconfiguring:
>> +         disconnect_fe(tpmif);
>> +     break;
>> +
>>         case XenbusStateUnknown: /* keep it here */
>>         case XenbusStateClosed:
>>        free_tpmif(tpmif);
>> diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
>> index c1cbab3..b725ba0 100644
>> --- a/extras/mini-os/tpmfront.c
>> +++ b/extras/mini-os/tpmfront.c
>> @@ -344,10 +344,10 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
>>      return dev;
>>     error:
>> -   shutdown_tpmfront(dev);
>> +   shutdown_tpmfront(dev, 0);
>>      return NULL;
>>   }
>> -void shutdown_tpmfront(struct tpmfront_dev* dev)
>> +void shutdown_tpmfront(struct tpmfront_dev* dev, int for_reconfig)
> It might be cleaner to create a new function like reconfigure_tpmfront() or something like that instead of adding an option to shutdown_tpmfront().
>>   {
>>      char* err;
>>      char path[512];
>> @@ -357,8 +357,7 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>>      TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for reconfigure" : "");
>>      /* disconnect */
>>      if(dev->state == XenbusStateConnected) {
>> -      dev->state = XenbusStateClosing;
>> -      //FIXME: Transaction for this?
>> +      dev->state = for_reconfig ? XenbusStateReconfiguring : XenbusStateClosing;
>>         /* Tell backend we are closing */
>>         if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
>>        free(err);
>> @@ -374,15 +373,19 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>>        free(err);
>>         }
>>   +      if (for_reconfig)
>> +         wait_for_backend_state_changed(dev, XenbusStateReconfigured);
>> +
>>         /* Tell backend we are closed */
>> -      dev->state = XenbusStateClosed;
>> +      dev->state = for_reconfig ? XenbusStateInitialising : XenbusStateClosed;
>>         if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
>>        TPMFRONT_ERR("Unable to write to %s, error was %s", dev->nodename, err);
>>        free(err);
>>         }
>>           /* Wait for the backend to close and unmap shared pages, ignore any errors */
>> -      wait_for_backend_state_changed(dev, XenbusStateClosed);
>> +      if (!for_reconfig)
>> +         wait_for_backend_state_changed(dev, XenbusStateClosed);
>>           /* Close event channel and unmap shared page */
>>         mask_evtchn(dev->evtchn);
>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>> index 71aef78..c33e078 100644
>> --- a/stubdom/vtpm/vtpm.c
>> +++ b/stubdom/vtpm/vtpm.c
>> @@ -394,7 +394,7 @@ abort_postvtpmblk:
>>   abort_postrng:
>>        /* Close devices */
>> -   shutdown_tpmfront(tpmfront_dev);
>> +   shutdown_tpmfront(tpmfront_dev, 0);
>>   abort_posttpmfront:
>>      shutdown_tpmback();
>>   
> 
> 


-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 19:48:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 19:48:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeA5N-0006eZ-Ga; Thu, 29 Nov 2012 19:47:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TeA5L-0006eS-G6
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 19:47:47 +0000
Received: from [85.158.139.83:44216] by server-9.bemta-5.messagelabs.com id
	18/76-29295-2EBB7B05; Thu, 29 Nov 2012 19:47:46 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-14.tower-182.messagelabs.com!1354218464!23427636!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11046 invoked from network); 29 Nov 2012 19:47:45 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-14.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 19:47:45 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158404358;
	Thu, 29 Nov 2012 14:47:23 -0500
Message-ID: <50B7BBC5.1020203@jhuapl.edu>
Date: Thu, 29 Nov 2012 14:47:17 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-3-git-send-email-dgdegra@tycho.nsa.gov>
	<50B7AF3A.3090009@jhuapl.edu> <50B7B778.5020806@tycho.nsa.gov>
In-Reply-To: <50B7B778.5020806@tycho.nsa.gov>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/4] stubdom/vtpm: Add reconfiguration
	support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4262235515863216802=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============4262235515863216802==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms070709070307060804090102"

This is a cryptographically signed message in MIME format.

--------------ms070709070307060804090102
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/29/2012 02:28 PM, Daniel De Graaf wrote:
> On 11/29/2012 01:53 PM, Matthew Fioravante wrote:
>> The purpose of this is to allow 2 entities in the same vm to use tpm d=
rivers, pv_grub and the linux guest. The Xenbus Reconfigure states are ne=
w to me. Is this intended behavior in line with the original purpose of t=
he Reconfigure states or are we hijacking them to do something not in the=
 original xen front/back driver spec?
>>
>> It looks like pv-grub just shuts down blkfront and the others without =
any reconfigure magic. Given that vtpm-stubdom will no longer automatical=
ly shutdown with your later patch, is there any reason we cannot just do =
the same here?
> The vtpm backend in mini-os cleans up after itself destructively when i=
t is
> closed: it removes xenstore entries and frees the data structures, and =
so
> requires the xenstore directory to be re-created. I originally wanted t=
o keep
> the shutdown semantics the same (to preserve the vtpm auto-shutdown), a=
lthough
> that's not reflected in this patch queue.
>
> I think the correct method here is to make the backend act like it does=
 for the
> reconfigure on close, and trigger free only when the xenstore entry van=
ishes.
A cursory look at blkback in linux and it looks like the backend driver=20
doesn't tear down the xenstore entries at all. I think its supposed to=20
be the job of libxl to do that no? So I think I agree with you that what =

we really want is to change the backend to leave xenstore alone and=20
maintain enough state so that the device can reconnect later.
>  =20
>> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>>> Allow the vtpm device to be disconnected and reconnected so that a
>>> bootloader (like pv-grub) can submit measurements and return the vtpm=

>>> device to its initial state before booting the target kernel.
>>>
>>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>> ---
>>>    extras/mini-os/include/tpmfront.h |  2 +-
>>>    extras/mini-os/lib/sys.c          |  2 +-
>>>    extras/mini-os/tpmback.c          |  5 +++++
>>>    extras/mini-os/tpmfront.c         | 15 +++++++++------
>>>    stubdom/vtpm/vtpm.c               |  2 +-
>>>    5 files changed, 17 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/inclu=
de/tpmfront.h
>>> index a0c7c4d..913faa4 100644
>>> --- a/extras/mini-os/include/tpmfront.h
>>> +++ b/extras/mini-os/include/tpmfront.h
>>> @@ -61,7 +61,7 @@ struct tpmfront_dev {
>>>    /*Initialize frontend */
>>>    struct tpmfront_dev* init_tpmfront(const char* nodename);
>>>    /*Shutdown frontend */
>>> -void shutdown_tpmfront(struct tpmfront_dev* dev);
>>> +void shutdown_tpmfront(struct tpmfront_dev* dev, int for_reconfig);
>>>      /* Send a tpm command to the backend and wait for the response
>>>     *
>>> diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
>>> index 3cc3340..03da4f0 100644
>>> --- a/extras/mini-os/lib/sys.c
>>> +++ b/extras/mini-os/lib/sys.c
>>> @@ -459,7 +459,7 @@ int close(int fd)
>>>    #endif
>>>    #ifdef CONFIG_TPMFRONT
>>>        case FTYPE_TPMFRONT:
>>> -            shutdown_tpmfront(files[fd].tpmfront.dev);
>>> +            shutdown_tpmfront(files[fd].tpmfront.dev, 0);
>>>            files[fd].type =3D FTYPE_NONE;
>>>            return 0;
>>>    #endif
>>> diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
>>> index 2d31061..ea42235 100644
>>> --- a/extras/mini-os/tpmback.c
>>> +++ b/extras/mini-os/tpmback.c
>>> @@ -664,6 +664,7 @@ static int frontend_changed(tpmif_t* tpmif)
>>>       switch (state) {
>>>          case XenbusStateInitialising:
>>>          case XenbusStateInitialised:
>>> +      case XenbusStateReconfigured:
>>>         break;
>>>            case XenbusStateConnected:
>>> @@ -678,6 +679,10 @@ static int frontend_changed(tpmif_t* tpmif)
>>>         tpmif_change_state(tpmif, XenbusStateClosing);
>>>         break;
>>>    +      case XenbusStateReconfiguring:
>>> +         disconnect_fe(tpmif);
>>> +     break;
>>> +
>>>          case XenbusStateUnknown: /* keep it here */
>>>          case XenbusStateClosed:
>>>         free_tpmif(tpmif);
>>> diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
>>> index c1cbab3..b725ba0 100644
>>> --- a/extras/mini-os/tpmfront.c
>>> +++ b/extras/mini-os/tpmfront.c
>>> @@ -344,10 +344,10 @@ struct tpmfront_dev* init_tpmfront(const char* =
_nodename)
>>>       return dev;
>>>      error:
>>> -   shutdown_tpmfront(dev);
>>> +   shutdown_tpmfront(dev, 0);
>>>       return NULL;
>>>    }
>>> -void shutdown_tpmfront(struct tpmfront_dev* dev)
>>> +void shutdown_tpmfront(struct tpmfront_dev* dev, int for_reconfig)
>> It might be cleaner to create a new function like reconfigure_tpmfront=
() or something like that instead of adding an option to shutdown_tpmfron=
t().
>>>    {
>>>       char* err;
>>>       char path[512];
>>> @@ -357,8 +357,7 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>>>       TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for=
 reconfigure" : "");
>>>       /* disconnect */
>>>       if(dev->state =3D=3D XenbusStateConnected) {
>>> -      dev->state =3D XenbusStateClosing;
>>> -      //FIXME: Transaction for this?
>>> +      dev->state =3D for_reconfig ? XenbusStateReconfiguring : Xenbu=
sStateClosing;
>>>          /* Tell backend we are closing */
>>>          if((err =3D xenbus_printf(XBT_NIL, dev->nodename, "state", "=
%u", (unsigned int) dev->state))) {
>>>         free(err);
>>> @@ -374,15 +373,19 @@ void shutdown_tpmfront(struct tpmfront_dev* dev=
)
>>>         free(err);
>>>          }
>>>    +      if (for_reconfig)
>>> +         wait_for_backend_state_changed(dev, XenbusStateReconfigured=
);
>>> +
>>>          /* Tell backend we are closed */
>>> -      dev->state =3D XenbusStateClosed;
>>> +      dev->state =3D for_reconfig ? XenbusStateInitialising : Xenbus=
StateClosed;
>>>          if((err =3D xenbus_printf(XBT_NIL, dev->nodename, "state", "=
%u", (unsigned int) dev->state))) {
>>>         TPMFRONT_ERR("Unable to write to %s, error was %s", dev->node=
name, err);
>>>         free(err);
>>>          }
>>>            /* Wait for the backend to close and unmap shared pages, i=
gnore any errors */
>>> -      wait_for_backend_state_changed(dev, XenbusStateClosed);
>>> +      if (!for_reconfig)
>>> +         wait_for_backend_state_changed(dev, XenbusStateClosed);
>>>            /* Close event channel and unmap shared page */
>>>          mask_evtchn(dev->evtchn);
>>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>>> index 71aef78..c33e078 100644
>>> --- a/stubdom/vtpm/vtpm.c
>>> +++ b/stubdom/vtpm/vtpm.c
>>> @@ -394,7 +394,7 @@ abort_postvtpmblk:
>>>    abort_postrng:
>>>         /* Close devices */
>>> -   shutdown_tpmfront(tpmfront_dev);
>>> +   shutdown_tpmfront(tpmfront_dev, 0);
>>>    abort_posttpmfront:
>>>       shutdown_tpmback();
>>>   =20
>>
>



--------------ms070709070307060804090102
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvc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Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEyOTE5NDcxN1owIwYJKoZIhvcNAQkEMRYEFE/gZQStCCg3VYiu
7xDXQfrUK7iEMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYCPxyYSTt+deJP3HQ9pUQb8Z4uWdL4Hc48l
fu4W/UHE4CXbGl15KYpOiwkMUmAPlPTAiHm1tgaz/ak8ScE1LIEbxBDx47NiaHfnZCOmtBBV
2tmWpcJH9MZ+R7u8OsxGp0iw9cYy0kari/qS6ZUbqxGzHu+5co+WScggNiwBpXOw1QAAAAAA
AA==
--------------ms070709070307060804090102--


--===============4262235515863216802==
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.xen.org
http://lists.xen.org/xen-devel

--===============4262235515863216802==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 19:48:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 19:48:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeA5N-0006eZ-Ga; Thu, 29 Nov 2012 19:47:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TeA5L-0006eS-G6
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 19:47:47 +0000
Received: from [85.158.139.83:44216] by server-9.bemta-5.messagelabs.com id
	18/76-29295-2EBB7B05; Thu, 29 Nov 2012 19:47:46 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-14.tower-182.messagelabs.com!1354218464!23427636!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11046 invoked from network); 29 Nov 2012 19:47:45 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-14.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 19:47:45 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158404358;
	Thu, 29 Nov 2012 14:47:23 -0500
Message-ID: <50B7BBC5.1020203@jhuapl.edu>
Date: Thu, 29 Nov 2012 14:47:17 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-3-git-send-email-dgdegra@tycho.nsa.gov>
	<50B7AF3A.3090009@jhuapl.edu> <50B7B778.5020806@tycho.nsa.gov>
In-Reply-To: <50B7B778.5020806@tycho.nsa.gov>
Cc: "Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/4] stubdom/vtpm: Add reconfiguration
	support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4262235515863216802=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============4262235515863216802==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms070709070307060804090102"

This is a cryptographically signed message in MIME format.

--------------ms070709070307060804090102
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/29/2012 02:28 PM, Daniel De Graaf wrote:
> On 11/29/2012 01:53 PM, Matthew Fioravante wrote:
>> The purpose of this is to allow 2 entities in the same vm to use tpm d=
rivers, pv_grub and the linux guest. The Xenbus Reconfigure states are ne=
w to me. Is this intended behavior in line with the original purpose of t=
he Reconfigure states or are we hijacking them to do something not in the=
 original xen front/back driver spec?
>>
>> It looks like pv-grub just shuts down blkfront and the others without =
any reconfigure magic. Given that vtpm-stubdom will no longer automatical=
ly shutdown with your later patch, is there any reason we cannot just do =
the same here?
> The vtpm backend in mini-os cleans up after itself destructively when i=
t is
> closed: it removes xenstore entries and frees the data structures, and =
so
> requires the xenstore directory to be re-created. I originally wanted t=
o keep
> the shutdown semantics the same (to preserve the vtpm auto-shutdown), a=
lthough
> that's not reflected in this patch queue.
>
> I think the correct method here is to make the backend act like it does=
 for the
> reconfigure on close, and trigger free only when the xenstore entry van=
ishes.
A cursory look at blkback in linux and it looks like the backend driver=20
doesn't tear down the xenstore entries at all. I think its supposed to=20
be the job of libxl to do that no? So I think I agree with you that what =

we really want is to change the backend to leave xenstore alone and=20
maintain enough state so that the device can reconnect later.
>  =20
>> On 11/27/2012 10:14 AM, Daniel De Graaf wrote:
>>> Allow the vtpm device to be disconnected and reconnected so that a
>>> bootloader (like pv-grub) can submit measurements and return the vtpm=

>>> device to its initial state before booting the target kernel.
>>>
>>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>> ---
>>>    extras/mini-os/include/tpmfront.h |  2 +-
>>>    extras/mini-os/lib/sys.c          |  2 +-
>>>    extras/mini-os/tpmback.c          |  5 +++++
>>>    extras/mini-os/tpmfront.c         | 15 +++++++++------
>>>    stubdom/vtpm/vtpm.c               |  2 +-
>>>    5 files changed, 17 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/inclu=
de/tpmfront.h
>>> index a0c7c4d..913faa4 100644
>>> --- a/extras/mini-os/include/tpmfront.h
>>> +++ b/extras/mini-os/include/tpmfront.h
>>> @@ -61,7 +61,7 @@ struct tpmfront_dev {
>>>    /*Initialize frontend */
>>>    struct tpmfront_dev* init_tpmfront(const char* nodename);
>>>    /*Shutdown frontend */
>>> -void shutdown_tpmfront(struct tpmfront_dev* dev);
>>> +void shutdown_tpmfront(struct tpmfront_dev* dev, int for_reconfig);
>>>      /* Send a tpm command to the backend and wait for the response
>>>     *
>>> diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
>>> index 3cc3340..03da4f0 100644
>>> --- a/extras/mini-os/lib/sys.c
>>> +++ b/extras/mini-os/lib/sys.c
>>> @@ -459,7 +459,7 @@ int close(int fd)
>>>    #endif
>>>    #ifdef CONFIG_TPMFRONT
>>>        case FTYPE_TPMFRONT:
>>> -            shutdown_tpmfront(files[fd].tpmfront.dev);
>>> +            shutdown_tpmfront(files[fd].tpmfront.dev, 0);
>>>            files[fd].type =3D FTYPE_NONE;
>>>            return 0;
>>>    #endif
>>> diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
>>> index 2d31061..ea42235 100644
>>> --- a/extras/mini-os/tpmback.c
>>> +++ b/extras/mini-os/tpmback.c
>>> @@ -664,6 +664,7 @@ static int frontend_changed(tpmif_t* tpmif)
>>>       switch (state) {
>>>          case XenbusStateInitialising:
>>>          case XenbusStateInitialised:
>>> +      case XenbusStateReconfigured:
>>>         break;
>>>            case XenbusStateConnected:
>>> @@ -678,6 +679,10 @@ static int frontend_changed(tpmif_t* tpmif)
>>>         tpmif_change_state(tpmif, XenbusStateClosing);
>>>         break;
>>>    +      case XenbusStateReconfiguring:
>>> +         disconnect_fe(tpmif);
>>> +     break;
>>> +
>>>          case XenbusStateUnknown: /* keep it here */
>>>          case XenbusStateClosed:
>>>         free_tpmif(tpmif);
>>> diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
>>> index c1cbab3..b725ba0 100644
>>> --- a/extras/mini-os/tpmfront.c
>>> +++ b/extras/mini-os/tpmfront.c
>>> @@ -344,10 +344,10 @@ struct tpmfront_dev* init_tpmfront(const char* =
_nodename)
>>>       return dev;
>>>      error:
>>> -   shutdown_tpmfront(dev);
>>> +   shutdown_tpmfront(dev, 0);
>>>       return NULL;
>>>    }
>>> -void shutdown_tpmfront(struct tpmfront_dev* dev)
>>> +void shutdown_tpmfront(struct tpmfront_dev* dev, int for_reconfig)
>> It might be cleaner to create a new function like reconfigure_tpmfront=
() or something like that instead of adding an option to shutdown_tpmfron=
t().
>>>    {
>>>       char* err;
>>>       char path[512];
>>> @@ -357,8 +357,7 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
>>>       TPMFRONT_LOG("Shutting down tpmfront%s\n", for_reconfig ? " for=
 reconfigure" : "");
>>>       /* disconnect */
>>>       if(dev->state =3D=3D XenbusStateConnected) {
>>> -      dev->state =3D XenbusStateClosing;
>>> -      //FIXME: Transaction for this?
>>> +      dev->state =3D for_reconfig ? XenbusStateReconfiguring : Xenbu=
sStateClosing;
>>>          /* Tell backend we are closing */
>>>          if((err =3D xenbus_printf(XBT_NIL, dev->nodename, "state", "=
%u", (unsigned int) dev->state))) {
>>>         free(err);
>>> @@ -374,15 +373,19 @@ void shutdown_tpmfront(struct tpmfront_dev* dev=
)
>>>         free(err);
>>>          }
>>>    +      if (for_reconfig)
>>> +         wait_for_backend_state_changed(dev, XenbusStateReconfigured=
);
>>> +
>>>          /* Tell backend we are closed */
>>> -      dev->state =3D XenbusStateClosed;
>>> +      dev->state =3D for_reconfig ? XenbusStateInitialising : Xenbus=
StateClosed;
>>>          if((err =3D xenbus_printf(XBT_NIL, dev->nodename, "state", "=
%u", (unsigned int) dev->state))) {
>>>         TPMFRONT_ERR("Unable to write to %s, error was %s", dev->node=
name, err);
>>>         free(err);
>>>          }
>>>            /* Wait for the backend to close and unmap shared pages, i=
gnore any errors */
>>> -      wait_for_backend_state_changed(dev, XenbusStateClosed);
>>> +      if (!for_reconfig)
>>> +         wait_for_backend_state_changed(dev, XenbusStateClosed);
>>>            /* Close event channel and unmap shared page */
>>>          mask_evtchn(dev->evtchn);
>>> diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
>>> index 71aef78..c33e078 100644
>>> --- a/stubdom/vtpm/vtpm.c
>>> +++ b/stubdom/vtpm/vtpm.c
>>> @@ -394,7 +394,7 @@ abort_postvtpmblk:
>>>    abort_postrng:
>>>         /* Close devices */
>>> -   shutdown_tpmfront(tpmfront_dev);
>>> +   shutdown_tpmfront(tpmfront_dev, 0);
>>>    abort_posttpmfront:
>>>       shutdown_tpmback();
>>>   =20
>>
>



--------------ms070709070307060804090102
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMC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VR0OBBYEFO6LYxg6r9wHZ+zdQtBHn1dZ/YTNMAkGA1UdEwQCMAAwGQYJKoZIhvZ9B0EABAww
ChsEVjcuMQMCBLAwDQYJKoZIhvcNAQEFBQADgYEAJO9HQh4YNChVLzuZqK5ARJARD8JoujGZ
fdo75quvg2jXFQe2sEjvLnxJZgm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEyOTE5NDcxN1owIwYJKoZIhvcNAQkEMRYEFE/gZQStCCg3VYiu
7xDXQfrUK7iEMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYCPxyYSTt+deJP3HQ9pUQb8Z4uWdL4Hc48l
fu4W/UHE4CXbGl15KYpOiwkMUmAPlPTAiHm1tgaz/ak8ScE1LIEbxBDx47NiaHfnZCOmtBBV
2tmWpcJH9MZ+R7u8OsxGp0iw9cYy0kari/qS6ZUbqxGzHu+5co+WScggNiwBpXOw1QAAAAAA
AA==
--------------ms070709070307060804090102--


--===============4262235515863216802==
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.xen.org
http://lists.xen.org/xen-devel

--===============4262235515863216802==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 20:25:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 20:25:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeAf9-0007Yq-8s; Thu, 29 Nov 2012 20:24:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeAf7-0007Yj-Jx
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 20:24:45 +0000
Received: from [85.158.139.83:35555] by server-15.bemta-5.messagelabs.com id
	F6/1E-26920-C84C7B05; Thu, 29 Nov 2012 20:24:44 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-182.messagelabs.com!1354220682!23430984!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7986 invoked from network); 29 Nov 2012 20:24:43 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-14.tower-182.messagelabs.com with SMTP;
	29 Nov 2012 20:24:43 -0000
X-TM-IMSS-Message-ID: <2f727bdc00021416@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 2f727bdc00021416 ;
	Thu, 29 Nov 2012 15:23:25 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qATKOR7J022980; 
	Thu, 29 Nov 2012 15:24:27 -0500
Message-ID: <50B7C47B.5080205@tycho.nsa.gov>
Date: Thu, 29 Nov 2012 15:24:27 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
References: <50B52524.6030707@tycho.nsa.gov>
	<1354054610-10720-1-git-send-email-dgdegra@tycho.nsa.gov>
	<50B7A45D.1050607@jhuapl.edu>
In-Reply-To: <50B7A45D.1050607@jhuapl.edu>
Cc: "samuel.thibault@ens-lyon.org" <samuel.thibault@ens-lyon.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] stubdom/vtpm: make state save operation
	atomic
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/29/2012 01:07 PM, Matthew Fioravante wrote:
> On 11/27/2012 05:16 PM, Daniel De Graaf wrote:
>> This changes the save format of the vtpm stubdom to include two copies
>> of the saved data: one active, and one inactive. When saving the state,
>> data is written to the inactive slot before updating the key and hash
>> saved with the TPM Manager, which determines the active slot when the
>> vTPM starts up.
>>
>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> ---
>>   stubdom/vtpm/vtpmblk.c | 66 +++++++++++++++++++++++++++++++++++++++++---------
>>   1 file changed, 54 insertions(+), 12 deletions(-)
>>
>> diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
>> index b343bd8..f988606 100644
>> --- a/stubdom/vtpm/vtpmblk.c
>> +++ b/stubdom/vtpm/vtpmblk.c
>> @@ -23,6 +23,8 @@
>>     /*Encryption key and block sizes */
>>   #define BLKSZ 16
>> +/* Maximum size of one saved-state slot */
>> +#define SLOT_SIZE 32768
> Instead of statically defining a slot size and stressing over whether or not it may be too small, why not make it half the size of the disk image? You can retrieve the disk size by doing fstat(blkfront_fd).

Ah, I didn't see that information was available in mini-os. Actually, the blkinfo
structure in init_vtpmblk is more convenient, so I'll use that.

>>     static struct blkfront_dev* blkdev = NULL;
>>   static int blkfront_fd = -1;
>> @@ -59,15 +61,20 @@ void shutdown_vtpmblk(void)
>>      blkdev = NULL;
>>   }
>>   -int write_vtpmblk_raw(uint8_t *data, size_t data_length)
>> +static int write_vtpmblk_raw(uint8_t *data, size_t data_length, int slot)
>>   {
>>      int rc;
>>      uint32_t lenbuf;
>>      debug("Begin Write data=%p len=%u", data, data_length);
> Should add which slot were writing to and possibly the disk offset as well to the debug print

A number of debug outputs will be improved with slot info.

>>   +   if (data_length > SLOT_SIZE - 4) {
>> +      error("write(data) cannot fit in data slot (%d). Increase SLOT_SIZE.", data_length);
>> +      return -1;
>> +   }
>> +
>>      lenbuf = cpu_to_be32((uint32_t)data_length);
>>   -   lseek(blkfront_fd, 0, SEEK_SET);
>> +   lseek(blkfront_fd, slot * SLOT_SIZE, SEEK_SET);
>>      if((rc = write(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
>>         error("write(length) failed! error was %s", strerror(errno));
>>         return -1;
>> @@ -82,12 +89,12 @@ int write_vtpmblk_raw(uint8_t *data, size_t data_length)
>>      return 0;
>>   }
>>   -int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
>> +static int read_vtpmblk_raw(uint8_t **data, size_t *data_length, int slot)
>>   {
>>      int rc;
>>      uint32_t lenbuf;
>>   -   lseek(blkfront_fd, 0, SEEK_SET);
>> +   lseek(blkfront_fd, slot * SLOT_SIZE, SEEK_SET);
>>      if(( rc = read(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
>>         error("read(length) failed! error was %s", strerror(errno));
>>         return -1;
>> @@ -97,6 +104,10 @@ int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
>>         error("read 0 data_length for NVM");
>>         return -1;
>>      }
>> +   if(*data_length > SLOT_SIZE - 4) {
>> +      error("read invalid data_length for NVM");
>> +      return -1;
>> +   }
>>        *data = tpm_malloc(*data_length);
>>      if((rc = read(blkfront_fd, *data, *data_length)) != *data_length) {
>> @@ -221,6 +232,8 @@ egress:
>>      return rc;
>>   }
>>   +static int active_slot = -1;
> I think we should initialize to 0 or 1 because -1 is an invalid state.
> For a new vtpm, read_vtpmblk() will fail and I think this is what happens:
> read_vtpmblk()
> try_fetch_key_from_manager() -> fails
> goto abort_egress
> active_slot = -1 (you have this below)

Yes, that's intentional. That way, you can tell the difference between slot 1
being active and no slot being active.
 
> Then later
> write_vtpmblk()
> active_slot = !active_slot (!-1 = 0)
> 
> The last line happens to work correctly but I don't think its very clear. I think we should initialize to 1 and set it to 1 if read_vtpmblk() fails.

I think I'll just put a comment at the !active_slot to note that active_slot is
-1 => 0 if no active slots existed.

> Also a minor nitpick, the name is active_slot, but what it really is is the last_slot_written_to because everytime you write you change it first.

That still makes it the active slot: at the point when it's changed, the value is
the new active slot (and we're just working to commit that change to disk).

>> +
>>   int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length) {
>>      int rc;
>>      uint8_t* cipher = NULL;
>> @@ -228,12 +241,15 @@ int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_
>>      uint8_t hashkey[HASHKEYSZ];
>>      uint8_t* symkey = hashkey + HASHSZ;
>>   +   /* Switch to the other slot */
>> +   active_slot = !active_slot;
>> +
>>      /* Encrypt the data */
>>      if((rc = encrypt_vtpmblk(data, data_length, &cipher, &cipher_len, symkey))) {
>>         goto abort_egress;
>>      }
>>      /* Write to disk */
>> -   if((rc = write_vtpmblk_raw(cipher, cipher_len))) {
>> +   if((rc = write_vtpmblk_raw(cipher, cipher_len, active_slot))) {
>>         goto abort_egress;
>>      }
>>      /* Get sha1 hash of data */
>> @@ -256,7 +272,8 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
>>      size_t cipher_len = 0;
>>      size_t keysize;
>>      uint8_t* hashkey = NULL;
>> -   uint8_t hash[HASHSZ];
>> +   uint8_t hash0[HASHSZ];
>> +   uint8_t hash1[HASHSZ];
>>      uint8_t* symkey;
>>        /* Retreive the hash and the key from the manager */
>> @@ -270,14 +287,32 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
>>      }
>>      symkey = hashkey + HASHSZ;
>>   -   /* Read from disk now */
>> -   if((rc = read_vtpmblk_raw(&cipher, &cipher_len))) {
>> +   active_slot = 0;
>> +   /* Read slot 0 from disk now */
>> +   if((rc = read_vtpmblk_raw(&cipher, &cipher_len, 0))) {
>> +      goto abort_egress;
>> +   }
>> +
>> +   /* Compute the hash of the cipher text and compare */
>> +   sha1(cipher, cipher_len, hash0);
>> +   if(!memcmp(hash0, hashkey, HASHSZ))
>> +      goto valid;
>> +
>> +   free(cipher);
>> +   cipher = NULL;
>> +
>> +   active_slot = 1;
>> +   /* Read slot 1 from disk now */
>> +   if((rc = read_vtpmblk_raw(&cipher, &cipher_len, 1))) {
>>         goto abort_egress;
>>      }
>>        /* Compute the hash of the cipher text and compare */
>> -   sha1(cipher, cipher_len, hash);
>> -   if(memcmp(hash, hashkey, HASHSZ)) {
>> +   sha1(cipher, cipher_len, hash1);
>> +   if(!memcmp(hash1, hashkey, HASHSZ))
>> +      goto valid;
>> +
>> +   {
>>         int i;
>>         error("NVM Storage Checksum failed!");
>>         printf("Expected: ");
>> @@ -285,14 +320,20 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
>>        printf("%02hhX ", hashkey[i]);
>>         }
>>         printf("\n");
>> -      printf("Actual:   ");
>> +      printf("Slot 0:   ");
>> +      for(i = 0; i < HASHSZ; ++i) {
>> +     printf("%02hhX ", hash0[i]);
>> +      }
>> +      printf("\n");
>> +      printf("Slot 1:   ");
>>         for(i = 0; i < HASHSZ; ++i) {
>> -     printf("%02hhX ", hash[i]);
>> +     printf("%02hhX ", hash1[i]);
>>         }
>>         printf("\n");
>>         rc = -1;
>>         goto abort_egress;
>>      }
>> +valid:
>>        /* Decrypt the blob */
>>      if((rc = decrypt_vtpmblk(cipher, cipher_len, data, data_length, symkey))) {
>> @@ -300,6 +341,7 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
>>      }
>>      goto egress;
>>   abort_egress:
>> +   active_slot = -1;
> See my comment above
>>   egress:
>>      free(cipher);
>>      free(hashkey);
> 
> 


-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 20:25:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 20:25:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeAf9-0007Yq-8s; Thu, 29 Nov 2012 20:24:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeAf7-0007Yj-Jx
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 20:24:45 +0000
Received: from [85.158.139.83:35555] by server-15.bemta-5.messagelabs.com id
	F6/1E-26920-C84C7B05; Thu, 29 Nov 2012 20:24:44 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-182.messagelabs.com!1354220682!23430984!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=1.8 required=7.0 tests=RATWARE_GECKO_BUILD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7986 invoked from network); 29 Nov 2012 20:24:43 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-14.tower-182.messagelabs.com with SMTP;
	29 Nov 2012 20:24:43 -0000
X-TM-IMSS-Message-ID: <2f727bdc00021416@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 2f727bdc00021416 ;
	Thu, 29 Nov 2012 15:23:25 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qATKOR7J022980; 
	Thu, 29 Nov 2012 15:24:27 -0500
Message-ID: <50B7C47B.5080205@tycho.nsa.gov>
Date: Thu, 29 Nov 2012 15:24:27 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Organization: National Security Agency
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
References: <50B52524.6030707@tycho.nsa.gov>
	<1354054610-10720-1-git-send-email-dgdegra@tycho.nsa.gov>
	<50B7A45D.1050607@jhuapl.edu>
In-Reply-To: <50B7A45D.1050607@jhuapl.edu>
Cc: "samuel.thibault@ens-lyon.org" <samuel.thibault@ens-lyon.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] stubdom/vtpm: make state save operation
	atomic
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 11/29/2012 01:07 PM, Matthew Fioravante wrote:
> On 11/27/2012 05:16 PM, Daniel De Graaf wrote:
>> This changes the save format of the vtpm stubdom to include two copies
>> of the saved data: one active, and one inactive. When saving the state,
>> data is written to the inactive slot before updating the key and hash
>> saved with the TPM Manager, which determines the active slot when the
>> vTPM starts up.
>>
>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> ---
>>   stubdom/vtpm/vtpmblk.c | 66 +++++++++++++++++++++++++++++++++++++++++---------
>>   1 file changed, 54 insertions(+), 12 deletions(-)
>>
>> diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
>> index b343bd8..f988606 100644
>> --- a/stubdom/vtpm/vtpmblk.c
>> +++ b/stubdom/vtpm/vtpmblk.c
>> @@ -23,6 +23,8 @@
>>     /*Encryption key and block sizes */
>>   #define BLKSZ 16
>> +/* Maximum size of one saved-state slot */
>> +#define SLOT_SIZE 32768
> Instead of statically defining a slot size and stressing over whether or not it may be too small, why not make it half the size of the disk image? You can retrieve the disk size by doing fstat(blkfront_fd).

Ah, I didn't see that information was available in mini-os. Actually, the blkinfo
structure in init_vtpmblk is more convenient, so I'll use that.

>>     static struct blkfront_dev* blkdev = NULL;
>>   static int blkfront_fd = -1;
>> @@ -59,15 +61,20 @@ void shutdown_vtpmblk(void)
>>      blkdev = NULL;
>>   }
>>   -int write_vtpmblk_raw(uint8_t *data, size_t data_length)
>> +static int write_vtpmblk_raw(uint8_t *data, size_t data_length, int slot)
>>   {
>>      int rc;
>>      uint32_t lenbuf;
>>      debug("Begin Write data=%p len=%u", data, data_length);
> Should add which slot were writing to and possibly the disk offset as well to the debug print

A number of debug outputs will be improved with slot info.

>>   +   if (data_length > SLOT_SIZE - 4) {
>> +      error("write(data) cannot fit in data slot (%d). Increase SLOT_SIZE.", data_length);
>> +      return -1;
>> +   }
>> +
>>      lenbuf = cpu_to_be32((uint32_t)data_length);
>>   -   lseek(blkfront_fd, 0, SEEK_SET);
>> +   lseek(blkfront_fd, slot * SLOT_SIZE, SEEK_SET);
>>      if((rc = write(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
>>         error("write(length) failed! error was %s", strerror(errno));
>>         return -1;
>> @@ -82,12 +89,12 @@ int write_vtpmblk_raw(uint8_t *data, size_t data_length)
>>      return 0;
>>   }
>>   -int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
>> +static int read_vtpmblk_raw(uint8_t **data, size_t *data_length, int slot)
>>   {
>>      int rc;
>>      uint32_t lenbuf;
>>   -   lseek(blkfront_fd, 0, SEEK_SET);
>> +   lseek(blkfront_fd, slot * SLOT_SIZE, SEEK_SET);
>>      if(( rc = read(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
>>         error("read(length) failed! error was %s", strerror(errno));
>>         return -1;
>> @@ -97,6 +104,10 @@ int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
>>         error("read 0 data_length for NVM");
>>         return -1;
>>      }
>> +   if(*data_length > SLOT_SIZE - 4) {
>> +      error("read invalid data_length for NVM");
>> +      return -1;
>> +   }
>>        *data = tpm_malloc(*data_length);
>>      if((rc = read(blkfront_fd, *data, *data_length)) != *data_length) {
>> @@ -221,6 +232,8 @@ egress:
>>      return rc;
>>   }
>>   +static int active_slot = -1;
> I think we should initialize to 0 or 1 because -1 is an invalid state.
> For a new vtpm, read_vtpmblk() will fail and I think this is what happens:
> read_vtpmblk()
> try_fetch_key_from_manager() -> fails
> goto abort_egress
> active_slot = -1 (you have this below)

Yes, that's intentional. That way, you can tell the difference between slot 1
being active and no slot being active.
 
> Then later
> write_vtpmblk()
> active_slot = !active_slot (!-1 = 0)
> 
> The last line happens to work correctly but I don't think its very clear. I think we should initialize to 1 and set it to 1 if read_vtpmblk() fails.

I think I'll just put a comment at the !active_slot to note that active_slot is
-1 => 0 if no active slots existed.

> Also a minor nitpick, the name is active_slot, but what it really is is the last_slot_written_to because everytime you write you change it first.

That still makes it the active slot: at the point when it's changed, the value is
the new active slot (and we're just working to commit that change to disk).

>> +
>>   int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length) {
>>      int rc;
>>      uint8_t* cipher = NULL;
>> @@ -228,12 +241,15 @@ int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_
>>      uint8_t hashkey[HASHKEYSZ];
>>      uint8_t* symkey = hashkey + HASHSZ;
>>   +   /* Switch to the other slot */
>> +   active_slot = !active_slot;
>> +
>>      /* Encrypt the data */
>>      if((rc = encrypt_vtpmblk(data, data_length, &cipher, &cipher_len, symkey))) {
>>         goto abort_egress;
>>      }
>>      /* Write to disk */
>> -   if((rc = write_vtpmblk_raw(cipher, cipher_len))) {
>> +   if((rc = write_vtpmblk_raw(cipher, cipher_len, active_slot))) {
>>         goto abort_egress;
>>      }
>>      /* Get sha1 hash of data */
>> @@ -256,7 +272,8 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
>>      size_t cipher_len = 0;
>>      size_t keysize;
>>      uint8_t* hashkey = NULL;
>> -   uint8_t hash[HASHSZ];
>> +   uint8_t hash0[HASHSZ];
>> +   uint8_t hash1[HASHSZ];
>>      uint8_t* symkey;
>>        /* Retreive the hash and the key from the manager */
>> @@ -270,14 +287,32 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
>>      }
>>      symkey = hashkey + HASHSZ;
>>   -   /* Read from disk now */
>> -   if((rc = read_vtpmblk_raw(&cipher, &cipher_len))) {
>> +   active_slot = 0;
>> +   /* Read slot 0 from disk now */
>> +   if((rc = read_vtpmblk_raw(&cipher, &cipher_len, 0))) {
>> +      goto abort_egress;
>> +   }
>> +
>> +   /* Compute the hash of the cipher text and compare */
>> +   sha1(cipher, cipher_len, hash0);
>> +   if(!memcmp(hash0, hashkey, HASHSZ))
>> +      goto valid;
>> +
>> +   free(cipher);
>> +   cipher = NULL;
>> +
>> +   active_slot = 1;
>> +   /* Read slot 1 from disk now */
>> +   if((rc = read_vtpmblk_raw(&cipher, &cipher_len, 1))) {
>>         goto abort_egress;
>>      }
>>        /* Compute the hash of the cipher text and compare */
>> -   sha1(cipher, cipher_len, hash);
>> -   if(memcmp(hash, hashkey, HASHSZ)) {
>> +   sha1(cipher, cipher_len, hash1);
>> +   if(!memcmp(hash1, hashkey, HASHSZ))
>> +      goto valid;
>> +
>> +   {
>>         int i;
>>         error("NVM Storage Checksum failed!");
>>         printf("Expected: ");
>> @@ -285,14 +320,20 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
>>        printf("%02hhX ", hashkey[i]);
>>         }
>>         printf("\n");
>> -      printf("Actual:   ");
>> +      printf("Slot 0:   ");
>> +      for(i = 0; i < HASHSZ; ++i) {
>> +     printf("%02hhX ", hash0[i]);
>> +      }
>> +      printf("\n");
>> +      printf("Slot 1:   ");
>>         for(i = 0; i < HASHSZ; ++i) {
>> -     printf("%02hhX ", hash[i]);
>> +     printf("%02hhX ", hash1[i]);
>>         }
>>         printf("\n");
>>         rc = -1;
>>         goto abort_egress;
>>      }
>> +valid:
>>        /* Decrypt the blob */
>>      if((rc = decrypt_vtpmblk(cipher, cipher_len, data, data_length, symkey))) {
>> @@ -300,6 +341,7 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
>>      }
>>      goto egress;
>>   abort_egress:
>> +   active_slot = -1;
> See my comment above
>>   egress:
>>      free(cipher);
>>      free(hashkey);
> 
> 


-- 
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 20:49:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 20:49:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeB2V-00087R-Jl; Thu, 29 Nov 2012 20:48:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TeB2T-000864-90
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 20:48:53 +0000
Received: from [85.158.137.99:15487] by server-4.bemta-3.messagelabs.com id
	A9/E6-30023-43AC7B05; Thu, 29 Nov 2012 20:48:52 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-5.tower-217.messagelabs.com!1354222129!12345877!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 527 invoked from network); 29 Nov 2012 20:48:50 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-5.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 20:48:50 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158410929;
	Thu, 29 Nov 2012 15:48:30 -0500
Message-ID: <50B7CA18.6090607@jhuapl.edu>
Date: Thu, 29 Nov 2012 15:48:24 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B52524.6030707@tycho.nsa.gov>
	<1354054610-10720-1-git-send-email-dgdegra@tycho.nsa.gov>
	<50B7A45D.1050607@jhuapl.edu> <50B7C47B.5080205@tycho.nsa.gov>
In-Reply-To: <50B7C47B.5080205@tycho.nsa.gov>
Cc: "samuel.thibault@ens-lyon.org" <samuel.thibault@ens-lyon.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] stubdom/vtpm: make state save operation
	atomic
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3719179473875863799=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============3719179473875863799==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms070204090606000300010303"

This is a cryptographically signed message in MIME format.

--------------ms070204090606000300010303
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/29/2012 03:24 PM, Daniel De Graaf wrote:
> On 11/29/2012 01:07 PM, Matthew Fioravante wrote:
>> On 11/27/2012 05:16 PM, Daniel De Graaf wrote:
>>> This changes the save format of the vtpm stubdom to include two copie=
s
>>> of the saved data: one active, and one inactive. When saving the stat=
e,
>>> data is written to the inactive slot before updating the key and hash=

>>> saved with the TPM Manager, which determines the active slot when the=

>>> vTPM starts up.
>>>
>>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>> ---
>>>    stubdom/vtpm/vtpmblk.c | 66 ++++++++++++++++++++++++++++++++++++++=
+++---------
>>>    1 file changed, 54 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
>>> index b343bd8..f988606 100644
>>> --- a/stubdom/vtpm/vtpmblk.c
>>> +++ b/stubdom/vtpm/vtpmblk.c
>>> @@ -23,6 +23,8 @@
>>>      /*Encryption key and block sizes */
>>>    #define BLKSZ 16
>>> +/* Maximum size of one saved-state slot */
>>> +#define SLOT_SIZE 32768
>> Instead of statically defining a slot size and stressing over whether =
or not it may be too small, why not make it half the size of the disk ima=
ge? You can retrieve the disk size by doing fstat(blkfront_fd).
> Ah, I didn't see that information was available in mini-os. Actually, t=
he blkinfo
> structure in init_vtpmblk is more convenient, so I'll use that.
>
>>>      static struct blkfront_dev* blkdev =3D NULL;
>>>    static int blkfront_fd =3D -1;
>>> @@ -59,15 +61,20 @@ void shutdown_vtpmblk(void)
>>>       blkdev =3D NULL;
>>>    }
>>>    -int write_vtpmblk_raw(uint8_t *data, size_t data_length)
>>> +static int write_vtpmblk_raw(uint8_t *data, size_t data_length, int =
slot)
>>>    {
>>>       int rc;
>>>       uint32_t lenbuf;
>>>       debug("Begin Write data=3D%p len=3D%u", data, data_length);
>> Should add which slot were writing to and possibly the disk offset as =
well to the debug print
> A number of debug outputs will be improved with slot info.
>
>>>    +   if (data_length > SLOT_SIZE - 4) {
>>> +      error("write(data) cannot fit in data slot (%d). Increase SLOT=
_SIZE.", data_length);
>>> +      return -1;
>>> +   }
>>> +
>>>       lenbuf =3D cpu_to_be32((uint32_t)data_length);
>>>    -   lseek(blkfront_fd, 0, SEEK_SET);
>>> +   lseek(blkfront_fd, slot * SLOT_SIZE, SEEK_SET);
>>>       if((rc =3D write(blkfront_fd, (uint8_t*)&lenbuf, 4)) !=3D 4) {
>>>          error("write(length) failed! error was %s", strerror(errno))=
;
>>>          return -1;
>>> @@ -82,12 +89,12 @@ int write_vtpmblk_raw(uint8_t *data, size_t data_=
length)
>>>       return 0;
>>>    }
>>>    -int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
>>> +static int read_vtpmblk_raw(uint8_t **data, size_t *data_length, int=
 slot)
>>>    {
>>>       int rc;
>>>       uint32_t lenbuf;
>>>    -   lseek(blkfront_fd, 0, SEEK_SET);
>>> +   lseek(blkfront_fd, slot * SLOT_SIZE, SEEK_SET);
>>>       if(( rc =3D read(blkfront_fd, (uint8_t*)&lenbuf, 4)) !=3D 4) {
>>>          error("read(length) failed! error was %s", strerror(errno));=

>>>          return -1;
>>> @@ -97,6 +104,10 @@ int read_vtpmblk_raw(uint8_t **data, size_t *data=
_length)
>>>          error("read 0 data_length for NVM");
>>>          return -1;
>>>       }
>>> +   if(*data_length > SLOT_SIZE - 4) {
>>> +      error("read invalid data_length for NVM");
>>> +      return -1;
>>> +   }
>>>         *data =3D tpm_malloc(*data_length);
>>>       if((rc =3D read(blkfront_fd, *data, *data_length)) !=3D *data_l=
ength) {
>>> @@ -221,6 +232,8 @@ egress:
>>>       return rc;
>>>    }
>>>    +static int active_slot =3D -1;
>> I think we should initialize to 0 or 1 because -1 is an invalid state.=

>> For a new vtpm, read_vtpmblk() will fail and I think this is what happ=
ens:
>> read_vtpmblk()
>> try_fetch_key_from_manager() -> fails
>> goto abort_egress
>> active_slot =3D -1 (you have this below)
> Yes, that's intentional. That way, you can tell the difference between =
slot 1
> being active and no slot being active.
Other than possibly for debugging, do we really care if no slot is=20
active? If there is no logical active slot then either slot 0 or 1 is=20
valid for the next write.
>  =20
>> Then later
>> write_vtpmblk()
>> active_slot =3D !active_slot (!-1 =3D 0)
>>
>> The last line happens to work correctly but I don't think its very cle=
ar. I think we should initialize to 1 and set it to 1 if read_vtpmblk() f=
ails.
> I think I'll just put a comment at the !active_slot to note that active=
_slot is
> -1 =3D> 0 if no active slots existed.
If we keep the -1, then defiantly a comment is warranted. There should=20
be a block comment at active_slot's definition to briefly explain all of =

this, what the valid states of active_slot are (-1, 0, 1), and what they =

mean because at first glance its not intuitive and looks like it could=20
be a bug. Another self documenting option would be to use an enum or=20
#define INVALID_SLOT -1 if you don't want to write as much comment text.
>
>> Also a minor nitpick, the name is active_slot, but what it really is i=
s the last_slot_written_to because everytime you write you change it firs=
t.
> That still makes it the active slot: at the point when it's changed, th=
e value is
> the new active slot (and we're just working to commit that change to di=
sk).
>
>>> +
>>>    int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data=
, size_t data_length) {
>>>       int rc;
>>>       uint8_t* cipher =3D NULL;
>>> @@ -228,12 +241,15 @@ int write_vtpmblk(struct tpmfront_dev* tpmfront=
_dev, uint8_t* data, size_t data_
>>>       uint8_t hashkey[HASHKEYSZ];
>>>       uint8_t* symkey =3D hashkey + HASHSZ;
>>>    +   /* Switch to the other slot */
>>> +   active_slot =3D !active_slot;
>>> +
>>>       /* Encrypt the data */
>>>       if((rc =3D encrypt_vtpmblk(data, data_length, &cipher, &cipher_=
len, symkey))) {
>>>          goto abort_egress;
>>>       }
>>>       /* Write to disk */
>>> -   if((rc =3D write_vtpmblk_raw(cipher, cipher_len))) {
>>> +   if((rc =3D write_vtpmblk_raw(cipher, cipher_len, active_slot))) {=

>>>          goto abort_egress;
>>>       }
>>>       /* Get sha1 hash of data */
>>> @@ -256,7 +272,8 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_de=
v, uint8_t** data, size_t *data
>>>       size_t cipher_len =3D 0;
>>>       size_t keysize;
>>>       uint8_t* hashkey =3D NULL;
>>> -   uint8_t hash[HASHSZ];
>>> +   uint8_t hash0[HASHSZ];
>>> +   uint8_t hash1[HASHSZ];
>>>       uint8_t* symkey;
>>>         /* Retreive the hash and the key from the manager */
>>> @@ -270,14 +287,32 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_=
dev, uint8_t** data, size_t *data
>>>       }
>>>       symkey =3D hashkey + HASHSZ;
>>>    -   /* Read from disk now */
>>> -   if((rc =3D read_vtpmblk_raw(&cipher, &cipher_len))) {
>>> +   active_slot =3D 0;
>>> +   /* Read slot 0 from disk now */
>>> +   if((rc =3D read_vtpmblk_raw(&cipher, &cipher_len, 0))) {
>>> +      goto abort_egress;
>>> +   }
>>> +
>>> +   /* Compute the hash of the cipher text and compare */
>>> +   sha1(cipher, cipher_len, hash0);
>>> +   if(!memcmp(hash0, hashkey, HASHSZ))
>>> +      goto valid;
>>> +
>>> +   free(cipher);
>>> +   cipher =3D NULL;
>>> +
>>> +   active_slot =3D 1;
>>> +   /* Read slot 1 from disk now */
>>> +   if((rc =3D read_vtpmblk_raw(&cipher, &cipher_len, 1))) {
>>>          goto abort_egress;
>>>       }
>>>         /* Compute the hash of the cipher text and compare */
>>> -   sha1(cipher, cipher_len, hash);
>>> -   if(memcmp(hash, hashkey, HASHSZ)) {
>>> +   sha1(cipher, cipher_len, hash1);
>>> +   if(!memcmp(hash1, hashkey, HASHSZ))
>>> +      goto valid;
>>> +
>>> +   {
>>>          int i;
>>>          error("NVM Storage Checksum failed!");
>>>          printf("Expected: ");
>>> @@ -285,14 +320,20 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_=
dev, uint8_t** data, size_t *data
>>>         printf("%02hhX ", hashkey[i]);
>>>          }
>>>          printf("\n");
>>> -      printf("Actual:   ");
>>> +      printf("Slot 0:   ");
>>> +      for(i =3D 0; i < HASHSZ; ++i) {
>>> +     printf("%02hhX ", hash0[i]);
>>> +      }
>>> +      printf("\n");
>>> +      printf("Slot 1:   ");
>>>          for(i =3D 0; i < HASHSZ; ++i) {
>>> -     printf("%02hhX ", hash[i]);
>>> +     printf("%02hhX ", hash1[i]);
>>>          }
>>>          printf("\n");
>>>          rc =3D -1;
>>>          goto abort_egress;
>>>       }
>>> +valid:
>>>         /* Decrypt the blob */
>>>       if((rc =3D decrypt_vtpmblk(cipher, cipher_len, data, data_lengt=
h, symkey))) {
>>> @@ -300,6 +341,7 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_de=
v, uint8_t** data, size_t *data
>>>       }
>>>       goto egress;
>>>    abort_egress:
>>> +   active_slot =3D -1;
>> See my comment above
>>>    egress:
>>>       free(cipher);
>>>       free(hashkey);
>>
>



--------------ms070204090606000300010303
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxMTE4
NTIwNlowZjELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkpIVUFQTDEPMA0GA1UECxMGUGVvcGxl
MTUwFgYDVQQLEw9WUE5Hcm91cC1CSVNEQ0EwGwYDVQQDExRNYXR0aGV3IEUgRmlvcmF2YW50
ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnpbwVSP6o1Nb5lcW7dd3yTo9iBJdi7qz
4nANOMFPK7JOy5npKN1iiousl28U/scUJES55gPwAWYJK3uVyQAsA4adgD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oZIhvcNAQkFMQ8XDTEyMTEyOTIwNDgyNFowIwYJKoZIhvcNAQkEMRYEFB5BepibPW02PD5g
5ofamIYIUTxjMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYCRKuE1XO+tcP5jY7A1yDsHZo2qf7pcMdqI
cgNXBBsRj/9W1hVuplqXyCOQLIFQpYEYHx7P+zdAHG49NHZyu/o9iZJhY+Sj7jw69gz3bAju
2NUkPfQ/qsNsQq6lpFYG6YlA2VMPBivmDzjUVodG3iZiWYAt3YrsBYGvFY64BBENSQAAAAAA
AA==
--------------ms070204090606000300010303--


--===============3719179473875863799==
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.xen.org
http://lists.xen.org/xen-devel

--===============3719179473875863799==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 20:49:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 20:49:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeB2V-00087R-Jl; Thu, 29 Nov 2012 20:48:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <matthew.fioravante@jhuapl.edu>) id 1TeB2T-000864-90
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 20:48:53 +0000
Received: from [85.158.137.99:15487] by server-4.bemta-3.messagelabs.com id
	A9/E6-30023-43AC7B05; Thu, 29 Nov 2012 20:48:52 +0000
X-Env-Sender: matthew.fioravante@jhuapl.edu
X-Msg-Ref: server-5.tower-217.messagelabs.com!1354222129!12345877!1
X-Originating-IP: [128.244.251.36]
X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 527 invoked from network); 29 Nov 2012 20:48:50 -0000
Received: from pilot.jhuapl.edu (HELO jhuapl.edu) (128.244.251.36)
	by server-5.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Nov 2012 20:48:50 -0000
Received: from ([128.244.206.185])
	by pilot.jhuapl.edu with ESMTP with TLS id 63GHCH1.158410929;
	Thu, 29 Nov 2012 15:48:30 -0500
Message-ID: <50B7CA18.6090607@jhuapl.edu>
Date: Thu, 29 Nov 2012 15:48:24 -0500
From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
References: <50B52524.6030707@tycho.nsa.gov>
	<1354054610-10720-1-git-send-email-dgdegra@tycho.nsa.gov>
	<50B7A45D.1050607@jhuapl.edu> <50B7C47B.5080205@tycho.nsa.gov>
In-Reply-To: <50B7C47B.5080205@tycho.nsa.gov>
Cc: "samuel.thibault@ens-lyon.org" <samuel.thibault@ens-lyon.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] stubdom/vtpm: make state save operation
	atomic
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3719179473875863799=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a cryptographically signed message in MIME format.

--===============3719179473875863799==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms070204090606000300010303"

This is a cryptographically signed message in MIME format.

--------------ms070204090606000300010303
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 11/29/2012 03:24 PM, Daniel De Graaf wrote:
> On 11/29/2012 01:07 PM, Matthew Fioravante wrote:
>> On 11/27/2012 05:16 PM, Daniel De Graaf wrote:
>>> This changes the save format of the vtpm stubdom to include two copie=
s
>>> of the saved data: one active, and one inactive. When saving the stat=
e,
>>> data is written to the inactive slot before updating the key and hash=

>>> saved with the TPM Manager, which determines the active slot when the=

>>> vTPM starts up.
>>>
>>> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>> ---
>>>    stubdom/vtpm/vtpmblk.c | 66 ++++++++++++++++++++++++++++++++++++++=
+++---------
>>>    1 file changed, 54 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
>>> index b343bd8..f988606 100644
>>> --- a/stubdom/vtpm/vtpmblk.c
>>> +++ b/stubdom/vtpm/vtpmblk.c
>>> @@ -23,6 +23,8 @@
>>>      /*Encryption key and block sizes */
>>>    #define BLKSZ 16
>>> +/* Maximum size of one saved-state slot */
>>> +#define SLOT_SIZE 32768
>> Instead of statically defining a slot size and stressing over whether =
or not it may be too small, why not make it half the size of the disk ima=
ge? You can retrieve the disk size by doing fstat(blkfront_fd).
> Ah, I didn't see that information was available in mini-os. Actually, t=
he blkinfo
> structure in init_vtpmblk is more convenient, so I'll use that.
>
>>>      static struct blkfront_dev* blkdev =3D NULL;
>>>    static int blkfront_fd =3D -1;
>>> @@ -59,15 +61,20 @@ void shutdown_vtpmblk(void)
>>>       blkdev =3D NULL;
>>>    }
>>>    -int write_vtpmblk_raw(uint8_t *data, size_t data_length)
>>> +static int write_vtpmblk_raw(uint8_t *data, size_t data_length, int =
slot)
>>>    {
>>>       int rc;
>>>       uint32_t lenbuf;
>>>       debug("Begin Write data=3D%p len=3D%u", data, data_length);
>> Should add which slot were writing to and possibly the disk offset as =
well to the debug print
> A number of debug outputs will be improved with slot info.
>
>>>    +   if (data_length > SLOT_SIZE - 4) {
>>> +      error("write(data) cannot fit in data slot (%d). Increase SLOT=
_SIZE.", data_length);
>>> +      return -1;
>>> +   }
>>> +
>>>       lenbuf =3D cpu_to_be32((uint32_t)data_length);
>>>    -   lseek(blkfront_fd, 0, SEEK_SET);
>>> +   lseek(blkfront_fd, slot * SLOT_SIZE, SEEK_SET);
>>>       if((rc =3D write(blkfront_fd, (uint8_t*)&lenbuf, 4)) !=3D 4) {
>>>          error("write(length) failed! error was %s", strerror(errno))=
;
>>>          return -1;
>>> @@ -82,12 +89,12 @@ int write_vtpmblk_raw(uint8_t *data, size_t data_=
length)
>>>       return 0;
>>>    }
>>>    -int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
>>> +static int read_vtpmblk_raw(uint8_t **data, size_t *data_length, int=
 slot)
>>>    {
>>>       int rc;
>>>       uint32_t lenbuf;
>>>    -   lseek(blkfront_fd, 0, SEEK_SET);
>>> +   lseek(blkfront_fd, slot * SLOT_SIZE, SEEK_SET);
>>>       if(( rc =3D read(blkfront_fd, (uint8_t*)&lenbuf, 4)) !=3D 4) {
>>>          error("read(length) failed! error was %s", strerror(errno));=

>>>          return -1;
>>> @@ -97,6 +104,10 @@ int read_vtpmblk_raw(uint8_t **data, size_t *data=
_length)
>>>          error("read 0 data_length for NVM");
>>>          return -1;
>>>       }
>>> +   if(*data_length > SLOT_SIZE - 4) {
>>> +      error("read invalid data_length for NVM");
>>> +      return -1;
>>> +   }
>>>         *data =3D tpm_malloc(*data_length);
>>>       if((rc =3D read(blkfront_fd, *data, *data_length)) !=3D *data_l=
ength) {
>>> @@ -221,6 +232,8 @@ egress:
>>>       return rc;
>>>    }
>>>    +static int active_slot =3D -1;
>> I think we should initialize to 0 or 1 because -1 is an invalid state.=

>> For a new vtpm, read_vtpmblk() will fail and I think this is what happ=
ens:
>> read_vtpmblk()
>> try_fetch_key_from_manager() -> fails
>> goto abort_egress
>> active_slot =3D -1 (you have this below)
> Yes, that's intentional. That way, you can tell the difference between =
slot 1
> being active and no slot being active.
Other than possibly for debugging, do we really care if no slot is=20
active? If there is no logical active slot then either slot 0 or 1 is=20
valid for the next write.
>  =20
>> Then later
>> write_vtpmblk()
>> active_slot =3D !active_slot (!-1 =3D 0)
>>
>> The last line happens to work correctly but I don't think its very cle=
ar. I think we should initialize to 1 and set it to 1 if read_vtpmblk() f=
ails.
> I think I'll just put a comment at the !active_slot to note that active=
_slot is
> -1 =3D> 0 if no active slots existed.
If we keep the -1, then defiantly a comment is warranted. There should=20
be a block comment at active_slot's definition to briefly explain all of =

this, what the valid states of active_slot are (-1, 0, 1), and what they =

mean because at first glance its not intuitive and looks like it could=20
be a bug. Another self documenting option would be to use an enum or=20
#define INVALID_SLOT -1 if you don't want to write as much comment text.
>
>> Also a minor nitpick, the name is active_slot, but what it really is i=
s the last_slot_written_to because everytime you write you change it firs=
t.
> That still makes it the active slot: at the point when it's changed, th=
e value is
> the new active slot (and we're just working to commit that change to di=
sk).
>
>>> +
>>>    int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data=
, size_t data_length) {
>>>       int rc;
>>>       uint8_t* cipher =3D NULL;
>>> @@ -228,12 +241,15 @@ int write_vtpmblk(struct tpmfront_dev* tpmfront=
_dev, uint8_t* data, size_t data_
>>>       uint8_t hashkey[HASHKEYSZ];
>>>       uint8_t* symkey =3D hashkey + HASHSZ;
>>>    +   /* Switch to the other slot */
>>> +   active_slot =3D !active_slot;
>>> +
>>>       /* Encrypt the data */
>>>       if((rc =3D encrypt_vtpmblk(data, data_length, &cipher, &cipher_=
len, symkey))) {
>>>          goto abort_egress;
>>>       }
>>>       /* Write to disk */
>>> -   if((rc =3D write_vtpmblk_raw(cipher, cipher_len))) {
>>> +   if((rc =3D write_vtpmblk_raw(cipher, cipher_len, active_slot))) {=

>>>          goto abort_egress;
>>>       }
>>>       /* Get sha1 hash of data */
>>> @@ -256,7 +272,8 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_de=
v, uint8_t** data, size_t *data
>>>       size_t cipher_len =3D 0;
>>>       size_t keysize;
>>>       uint8_t* hashkey =3D NULL;
>>> -   uint8_t hash[HASHSZ];
>>> +   uint8_t hash0[HASHSZ];
>>> +   uint8_t hash1[HASHSZ];
>>>       uint8_t* symkey;
>>>         /* Retreive the hash and the key from the manager */
>>> @@ -270,14 +287,32 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_=
dev, uint8_t** data, size_t *data
>>>       }
>>>       symkey =3D hashkey + HASHSZ;
>>>    -   /* Read from disk now */
>>> -   if((rc =3D read_vtpmblk_raw(&cipher, &cipher_len))) {
>>> +   active_slot =3D 0;
>>> +   /* Read slot 0 from disk now */
>>> +   if((rc =3D read_vtpmblk_raw(&cipher, &cipher_len, 0))) {
>>> +      goto abort_egress;
>>> +   }
>>> +
>>> +   /* Compute the hash of the cipher text and compare */
>>> +   sha1(cipher, cipher_len, hash0);
>>> +   if(!memcmp(hash0, hashkey, HASHSZ))
>>> +      goto valid;
>>> +
>>> +   free(cipher);
>>> +   cipher =3D NULL;
>>> +
>>> +   active_slot =3D 1;
>>> +   /* Read slot 1 from disk now */
>>> +   if((rc =3D read_vtpmblk_raw(&cipher, &cipher_len, 1))) {
>>>          goto abort_egress;
>>>       }
>>>         /* Compute the hash of the cipher text and compare */
>>> -   sha1(cipher, cipher_len, hash);
>>> -   if(memcmp(hash, hashkey, HASHSZ)) {
>>> +   sha1(cipher, cipher_len, hash1);
>>> +   if(!memcmp(hash1, hashkey, HASHSZ))
>>> +      goto valid;
>>> +
>>> +   {
>>>          int i;
>>>          error("NVM Storage Checksum failed!");
>>>          printf("Expected: ");
>>> @@ -285,14 +320,20 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_=
dev, uint8_t** data, size_t *data
>>>         printf("%02hhX ", hashkey[i]);
>>>          }
>>>          printf("\n");
>>> -      printf("Actual:   ");
>>> +      printf("Slot 0:   ");
>>> +      for(i =3D 0; i < HASHSZ; ++i) {
>>> +     printf("%02hhX ", hash0[i]);
>>> +      }
>>> +      printf("\n");
>>> +      printf("Slot 1:   ");
>>>          for(i =3D 0; i < HASHSZ; ++i) {
>>> -     printf("%02hhX ", hash[i]);
>>> +     printf("%02hhX ", hash1[i]);
>>>          }
>>>          printf("\n");
>>>          rc =3D -1;
>>>          goto abort_egress;
>>>       }
>>> +valid:
>>>         /* Decrypt the blob */
>>>       if((rc =3D decrypt_vtpmblk(cipher, cipher_len, data, data_lengt=
h, symkey))) {
>>> @@ -300,6 +341,7 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_de=
v, uint8_t** data, size_t *data
>>>       }
>>>       goto egress;
>>>    abort_egress:
>>> +   active_slot =3D -1;
>> See my comment above
>>>    egress:
>>>       free(cipher);
>>>       free(hashkey);
>>
>



--------------ms070204090606000300010303
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDyjCC
A8YwggMvoAMCAQICBD/xyf0wDQYJKoZIhvcNAQEFBQAwLzELMAkGA1UEBhMCVVMxDzANBgNV
BAoTBkpIVUFQTDEPMA0GA1UECxMGQklTRENBMB4XDTEwMDYxMTE4MjIwNloXDTEzMDYxM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gm/pv8fdZakq48CWwjYHKuvIp7sDjTEsQfo+y7SpN/N2NvJ
WU5SqfK1VgYtNLRRoGJUB5Q1aZ+Dg95g3kqpyfpUMISJL8IKVLtJVfN4fggFVUYZ9wwxggGr
MIIBpwIBATA3MC8xCzAJBgNVBAYTAlVTMQ8wDQYDVQQKEwZKSFVBUEwxDzANBgNVBAsTBkJJ
U0RDQQIEP/HJ/TAJBgUrDgMCGgUAoIHLMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ
KoZIhvcNAQkFMQ8XDTEyMTEyOTIwNDgyNFowIwYJKoZIhvcNAQkEMRYEFB5BepibPW02PD5g
5ofamIYIUTxjMGwGCSqGSIb3DQEJDzFfMF0wCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBAjAK
BggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYI
KoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYCRKuE1XO+tcP5jY7A1yDsHZo2qf7pcMdqI
cgNXBBsRj/9W1hVuplqXyCOQLIFQpYEYHx7P+zdAHG49NHZyu/o9iZJhY+Sj7jw69gz3bAju
2NUkPfQ/qsNsQq6lpFYG6YlA2VMPBivmDzjUVodG3iZiWYAt3YrsBYGvFY64BBENSQAAAAAA
AA==
--------------ms070204090606000300010303--


--===============3719179473875863799==
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.xen.org
http://lists.xen.org/xen-devel

--===============3719179473875863799==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 21:13:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 21:13:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeBQL-0001ly-1Q; Thu, 29 Nov 2012 21:13:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeBQJ-0001lt-D7
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 21:13:31 +0000
Received: from [193.109.254.147:53862] by server-13.bemta-14.messagelabs.com
	id FF/30-11239-AFFC7B05; Thu, 29 Nov 2012 21:13:30 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1354223608!8804863!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU2Nzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26231 invoked from network); 29 Nov 2012 21:13:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 21:13:28 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16079644"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 21:13:27 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 29 Nov 2012 21:13:27 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeBQF-0000bj-CN;
	Thu, 29 Nov 2012 21:13:27 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeBQF-0005wL-0M;
	Thu, 29 Nov 2012 21:13:27 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14494-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 29 Nov 2012 21:13:27 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14494: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14494 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14494/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-pv           5 xen-boot                  fail REGR. vs. 14482
 test-amd64-i386-qemut-rhel6hvm-amd  5 xen-boot            fail REGR. vs. 14482
 test-amd64-i386-xl-multivcpu  5 xen-boot                  fail REGR. vs. 14482
 test-amd64-i386-xl            5 xen-boot                  fail REGR. vs. 14482
 test-amd64-i386-qemuu-rhel6hvm-amd  5 xen-boot            fail REGR. vs. 14482
 test-amd64-amd64-xl-qemuu-win7-amd64  5 xen-boot          fail REGR. vs. 14482
 test-amd64-i386-pair          8 xen-boot/dst_host         fail REGR. vs. 14482
 test-amd64-i386-pair          7 xen-boot/src_host         fail REGR. vs. 14482
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1  5 xen-boot      fail REGR. vs. 14482
 test-amd64-i386-xl-winxpsp3-vcpus1  5 xen-boot            fail REGR. vs. 14482
 test-amd64-amd64-pair         8 xen-boot/dst_host         fail REGR. vs. 14482
 test-amd64-amd64-pair         7 xen-boot/src_host         fail REGR. vs. 14482
 test-amd64-i386-xend-qemut-winxpsp3  5 xen-boot           fail REGR. vs. 14482
 test-amd64-i386-qemut-win     5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-win       5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-win7-amd64  5 xen-boot                fail REGR. vs. 14482
 test-amd64-amd64-qemut-win    5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-qemut-win  5 xen-boot                 fail REGR. vs. 14482
 test-amd64-amd64-xl-qemut-winxpsp3  5 xen-boot            fail REGR. vs. 14482

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin  5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14482

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  9d88ac6046d8
baseline version:
 xen                  1c69c938f641

------------------------------------------------------------
People who touched revisions under test:
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Kouya Shimura <kouya@jp.fujitsu.com>
  Roger Pau Monn? <roger.pau@citrix.com>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           fail    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          fail    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26205:9d88ac6046d8
tag:         tip
user:        Roger Pau Monne <roger.pau@citrix.com>
date:        Thu Nov 29 11:28:18 2012 +0000
    
    docs: fix persistent grants doc typo
    
    Signed-off-by: Roger Pau Monn? <roger.pau@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- fix additional typo s/this grants/these grants/g ]
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26204:48e211812551
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 29 11:28:17 2012 +0000
    
    xen/arm: build as zImage
    
    The zImage format is extremely simple: it only consists of a magic
    number and 2 addresses in a specific position (see
    http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
    
    Some bootloaders expect a zImage; considering that it doesn't cost us
    much to build Xen compatible with the format, make it so.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- switch from 7*nop + nop to just 8*nop ]
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26203:b5cb6cccc32c
user:        Tim Deegan <tim@xen.org>
date:        Thu Nov 29 11:01:00 2012 +0000
    
    x86/hap: Fix memory leak of domain->arch.hvm_domain.dirty_vram
    
    Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    Committed-by: Tim Deegan <tim@xen.org>
    
    
changeset:   26202:9c6c13bf3803
user:        Tim Deegan <tim@xen.org>
date:        Thu Nov 29 10:49:53 2012 +0000
    
    x86/mm: Comment the definitions of _mfn(), _gfn() &c.
    
    It's not very easy to find them if you don't know to look for the
    TYPE_SAFE() macro.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Committed-by: Tim Deegan <tim@xen.org>
    
    
changeset:   26201:5d7e3c2742e8
user:        Jan Beulich <jbeulich@suse.com>
date:        Thu Nov 29 09:14:55 2012 +0100
    
    VT-d: make scope parsing code type safe
    
    Rather than requiring the scopes to be the first members of their
    respective structures (so that casts can be used to switch between the
    different views), properly use types and container_of().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by Xiantao Zhang <xiantao.zhang@intel.com>
    
    
changeset:   26200:836697b19746
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 17:00:56 2012 +0100
    
    IOMMU: imply "verbose" from "debug"
    
    I think that generally enabling debugging code without also enabling
    verbose output is rather pointless; if someone really wants this, they
    can always pass e.g. "iommu=debug,no-verbose".
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26199:1fce7522daa6
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:08:24 2012 +0100
    
    VT-d: adjust IOMMU interrupt affinities when all CPUs are online
    
    Since these interrupts get setup before APs get brought online, their
    affinities naturally could only ever point to CPU 0 alone so far.
    Adjust this to include potentially multiple CPUs in the target mask
    (when running in one of the cluster modes), and take into account NUMA
    information (to handle the interrupts on a CPU on the node where the
    respective IOMMU is).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26198:ba90ecb0231f
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:07:11 2012 +0100
    
    AMD IOMMU: include IOMMU interrupt information in 'M' debug key output
    
    Note that this also adds a few pieces missing from c/s
    25903:5e4a00b4114c (relevant only when the PCI MSI mask bit is
    supported by an IOMMU, which apparently isn't the case for existing
    implementations).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26197:0bc3a489018f
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:05:52 2012 +0100
    
    VT-d: include IOMMU interrupt information in 'M' debug key output
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26196:5faf5b8b702e
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:03:51 2012 +0100
    
    ACPI: fix return value of XEN_PM_PDC platform op
    
    Should return -EFAULT when copying to guest memory fails.
    
    Once touching this code, also switch to using the more relaxed copy
    function (copying from the same guest memory already validated the
    virtual address range).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26195:7670eabcbafc
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:02:26 2012 +0100
    
    x86: fix hypercall continuation cancellation in XENMAPSPACE_gmfn_range compat wrapper
    
    When no continuation was established, there must also not be an attempt
    to cancel it - hypercall_cancel_continuation(), in the non-HVM, non-
    multicall case, adjusts the guest mode return address in a way assuming
    that an earlier call hypercall_create_continuation() took place.
    
    Once touching this code, also restructure it slightly to improve
    readability and switch to using the more relaxed copy function (copying
    from the same guest memory already validated the virtual address
    range).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26194:0aa1c5136a54
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:01:33 2012 +0100
    
    README: adjust gcc version requirement
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26193:1c69c938f641
user:        George Dunlap <george.dunlap@eu.citrix.com>
date:        Tue Nov 27 14:13:41 2012 +0000
    
    libxl: Fix bug in libxl_cdrom_insert, make more robust against bad xenstore data
    
    libxl_cdrom_insert was failing to initialize the backend type,
    resulting in the wrong default backend.  The result was not only that
    the CD was not inserted properly, but also that some improper xenstore
    entries were created, causing further block commands to fail.
    
    This patch fixes the bug by setting the disk backend type based on the
    type of the existing device.
    
    It also makes the system more robust by checking to see that it has
    got a valid path before proceeding to write a partial xenstore entry.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 21:13:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 21:13:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeBQL-0001ly-1Q; Thu, 29 Nov 2012 21:13:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeBQJ-0001lt-D7
	for xen-devel@lists.xensource.com; Thu, 29 Nov 2012 21:13:31 +0000
Received: from [193.109.254.147:53862] by server-13.bemta-14.messagelabs.com
	id FF/30-11239-AFFC7B05; Thu, 29 Nov 2012 21:13:30 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1354223608!8804863!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU2Nzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26231 invoked from network); 29 Nov 2012 21:13:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 21:13:28 -0000
X-IronPort-AV: E=Sophos;i="4.84,186,1355097600"; d="scan'208";a="16079644"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	29 Nov 2012 21:13:27 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Thu, 29 Nov 2012 21:13:27 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeBQF-0000bj-CN;
	Thu, 29 Nov 2012 21:13:27 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeBQF-0005wL-0M;
	Thu, 29 Nov 2012 21:13:27 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14494-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Thu, 29 Nov 2012 21:13:27 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14494: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14494 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14494/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-pv           5 xen-boot                  fail REGR. vs. 14482
 test-amd64-i386-qemut-rhel6hvm-amd  5 xen-boot            fail REGR. vs. 14482
 test-amd64-i386-xl-multivcpu  5 xen-boot                  fail REGR. vs. 14482
 test-amd64-i386-xl            5 xen-boot                  fail REGR. vs. 14482
 test-amd64-i386-qemuu-rhel6hvm-amd  5 xen-boot            fail REGR. vs. 14482
 test-amd64-amd64-xl-qemuu-win7-amd64  5 xen-boot          fail REGR. vs. 14482
 test-amd64-i386-pair          8 xen-boot/dst_host         fail REGR. vs. 14482
 test-amd64-i386-pair          7 xen-boot/src_host         fail REGR. vs. 14482
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1  5 xen-boot      fail REGR. vs. 14482
 test-amd64-i386-xl-winxpsp3-vcpus1  5 xen-boot            fail REGR. vs. 14482
 test-amd64-amd64-pair         8 xen-boot/dst_host         fail REGR. vs. 14482
 test-amd64-amd64-pair         7 xen-boot/src_host         fail REGR. vs. 14482
 test-amd64-i386-xend-qemut-winxpsp3  5 xen-boot           fail REGR. vs. 14482
 test-amd64-i386-qemut-win     5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-win       5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-win7-amd64  5 xen-boot                fail REGR. vs. 14482
 test-amd64-amd64-qemut-win    5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-qemut-win  5 xen-boot                 fail REGR. vs. 14482
 test-amd64-amd64-xl-qemut-winxpsp3  5 xen-boot            fail REGR. vs. 14482

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin  5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14482

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  9d88ac6046d8
baseline version:
 xen                  1c69c938f641

------------------------------------------------------------
People who touched revisions under test:
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Kouya Shimura <kouya@jp.fujitsu.com>
  Roger Pau Monn? <roger.pau@citrix.com>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           fail    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          fail    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26205:9d88ac6046d8
tag:         tip
user:        Roger Pau Monne <roger.pau@citrix.com>
date:        Thu Nov 29 11:28:18 2012 +0000
    
    docs: fix persistent grants doc typo
    
    Signed-off-by: Roger Pau Monn? <roger.pau@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- fix additional typo s/this grants/these grants/g ]
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26204:48e211812551
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 29 11:28:17 2012 +0000
    
    xen/arm: build as zImage
    
    The zImage format is extremely simple: it only consists of a magic
    number and 2 addresses in a specific position (see
    http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
    
    Some bootloaders expect a zImage; considering that it doesn't cost us
    much to build Xen compatible with the format, make it so.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- switch from 7*nop + nop to just 8*nop ]
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26203:b5cb6cccc32c
user:        Tim Deegan <tim@xen.org>
date:        Thu Nov 29 11:01:00 2012 +0000
    
    x86/hap: Fix memory leak of domain->arch.hvm_domain.dirty_vram
    
    Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    Committed-by: Tim Deegan <tim@xen.org>
    
    
changeset:   26202:9c6c13bf3803
user:        Tim Deegan <tim@xen.org>
date:        Thu Nov 29 10:49:53 2012 +0000
    
    x86/mm: Comment the definitions of _mfn(), _gfn() &c.
    
    It's not very easy to find them if you don't know to look for the
    TYPE_SAFE() macro.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Committed-by: Tim Deegan <tim@xen.org>
    
    
changeset:   26201:5d7e3c2742e8
user:        Jan Beulich <jbeulich@suse.com>
date:        Thu Nov 29 09:14:55 2012 +0100
    
    VT-d: make scope parsing code type safe
    
    Rather than requiring the scopes to be the first members of their
    respective structures (so that casts can be used to switch between the
    different views), properly use types and container_of().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by Xiantao Zhang <xiantao.zhang@intel.com>
    
    
changeset:   26200:836697b19746
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 17:00:56 2012 +0100
    
    IOMMU: imply "verbose" from "debug"
    
    I think that generally enabling debugging code without also enabling
    verbose output is rather pointless; if someone really wants this, they
    can always pass e.g. "iommu=debug,no-verbose".
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26199:1fce7522daa6
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:08:24 2012 +0100
    
    VT-d: adjust IOMMU interrupt affinities when all CPUs are online
    
    Since these interrupts get setup before APs get brought online, their
    affinities naturally could only ever point to CPU 0 alone so far.
    Adjust this to include potentially multiple CPUs in the target mask
    (when running in one of the cluster modes), and take into account NUMA
    information (to handle the interrupts on a CPU on the node where the
    respective IOMMU is).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26198:ba90ecb0231f
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:07:11 2012 +0100
    
    AMD IOMMU: include IOMMU interrupt information in 'M' debug key output
    
    Note that this also adds a few pieces missing from c/s
    25903:5e4a00b4114c (relevant only when the PCI MSI mask bit is
    supported by an IOMMU, which apparently isn't the case for existing
    implementations).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26197:0bc3a489018f
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:05:52 2012 +0100
    
    VT-d: include IOMMU interrupt information in 'M' debug key output
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26196:5faf5b8b702e
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:03:51 2012 +0100
    
    ACPI: fix return value of XEN_PM_PDC platform op
    
    Should return -EFAULT when copying to guest memory fails.
    
    Once touching this code, also switch to using the more relaxed copy
    function (copying from the same guest memory already validated the
    virtual address range).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26195:7670eabcbafc
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:02:26 2012 +0100
    
    x86: fix hypercall continuation cancellation in XENMAPSPACE_gmfn_range compat wrapper
    
    When no continuation was established, there must also not be an attempt
    to cancel it - hypercall_cancel_continuation(), in the non-HVM, non-
    multicall case, adjusts the guest mode return address in a way assuming
    that an earlier call hypercall_create_continuation() took place.
    
    Once touching this code, also restructure it slightly to improve
    readability and switch to using the more relaxed copy function (copying
    from the same guest memory already validated the virtual address
    range).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26194:0aa1c5136a54
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:01:33 2012 +0100
    
    README: adjust gcc version requirement
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26193:1c69c938f641
user:        George Dunlap <george.dunlap@eu.citrix.com>
date:        Tue Nov 27 14:13:41 2012 +0000
    
    libxl: Fix bug in libxl_cdrom_insert, make more robust against bad xenstore data
    
    libxl_cdrom_insert was failing to initialize the backend type,
    resulting in the wrong default backend.  The result was not only that
    the CD was not inserted properly, but also that some improper xenstore
    entries were created, causing further block commands to fail.
    
    This patch fixes the bug by setting the disk backend type based on the
    type of the existing device.
    
    It also makes the system more robust by checking to see that it has
    got a valid path before proceeding to write a partial xenstore entry.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 21:38:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 21:38:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeBoD-0002FK-8H; Thu, 29 Nov 2012 21:38:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TeBoB-0002FF-Tl
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 21:38:12 +0000
Received: from [85.158.137.99:21084] by server-15.bemta-3.messagelabs.com id
	1F/5C-23779-EB5D7B05; Thu, 29 Nov 2012 21:38:06 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-10.tower-217.messagelabs.com!1354225085!17267108!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6803 invoked from network); 29 Nov 2012 21:38:05 -0000
Received: from toccata.ens-lyon.org (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-10.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 21:38:05 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 49AF88407B;
	Thu, 29 Nov 2012 22:38:05 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id ywS0KRaNLXtf; Thu, 29 Nov 2012 22:38:05 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id 76F128407A;
	Thu, 29 Nov 2012 22:38:03 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TeBnx-00039y-75; Thu, 29 Nov 2012 22:37:57 +0100
Date: Thu, 29 Nov 2012 22:37:57 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121129213757.GJ5830@type>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-3-git-send-email-dgdegra@tycho.nsa.gov>
	<50B7AF3A.3090009@jhuapl.edu> <50B7B778.5020806@tycho.nsa.gov>
	<50B7BBC5.1020203@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B7BBC5.1020203@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/4] stubdom/vtpm: Add reconfiguration
	support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Thu 29 Nov 2012 14:47:17 -0500, a =E9crit :
> I think I agree with you that what we really want is to change the
> backend to leave xenstore alone and maintain enough state so that the
> device can reconnect later.

Yes, I believe that's much nicer.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 21:38:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 21:38:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeBoD-0002FK-8H; Thu, 29 Nov 2012 21:38:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TeBoB-0002FF-Tl
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 21:38:12 +0000
Received: from [85.158.137.99:21084] by server-15.bemta-3.messagelabs.com id
	1F/5C-23779-EB5D7B05; Thu, 29 Nov 2012 21:38:06 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-10.tower-217.messagelabs.com!1354225085!17267108!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6803 invoked from network); 29 Nov 2012 21:38:05 -0000
Received: from toccata.ens-lyon.org (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-10.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 21:38:05 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id 49AF88407B;
	Thu, 29 Nov 2012 22:38:05 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id ywS0KRaNLXtf; Thu, 29 Nov 2012 22:38:05 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id 76F128407A;
	Thu, 29 Nov 2012 22:38:03 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TeBnx-00039y-75; Thu, 29 Nov 2012 22:37:57 +0100
Date: Thu, 29 Nov 2012 22:37:57 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121129213757.GJ5830@type>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Matthew Fioravante <matthew.fioravante@jhuapl.edu>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-3-git-send-email-dgdegra@tycho.nsa.gov>
	<50B7AF3A.3090009@jhuapl.edu> <50B7B778.5020806@tycho.nsa.gov>
	<50B7BBC5.1020203@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B7BBC5.1020203@jhuapl.edu>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/4] stubdom/vtpm: Add reconfiguration
	support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Matthew Fioravante, le Thu 29 Nov 2012 14:47:17 -0500, a =E9crit :
> I think I agree with you that what we really want is to change the
> backend to leave xenstore alone and maintain enough state so that the
> device can reconnect later.

Yes, I believe that's much nicer.

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 22:11:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 22:11:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeCKC-0002rn-8p; Thu, 29 Nov 2012 22:11:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg.zapp@gmail.com>) id 1TeCKB-0002ri-3y
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 22:11:15 +0000
Received: from [85.158.143.35:54790] by server-1.bemta-4.messagelabs.com id
	83/5E-27934-28DD7B05; Thu, 29 Nov 2012 22:11:14 +0000
X-Env-Sender: greg.zapp@gmail.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354227071!15957771!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=1.5 required=7.0 tests=HTML_00_10,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3725 invoked from network); 29 Nov 2012 22:11:12 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 22:11:12 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so18742597vbi.32
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 14:11:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=9m0xUYHdhBnR5PM2znvKoaLZyRLxrUmgIxDFvDsClEk=;
	b=zIJfCRyVpl2H1SE0dSaYuMDa+aIA7ETsMov5nOvGi5EbWsT5BAqXE1EfU3QNYMhOC3
	wtjwT82ubeacBklbscdh1QFckn2mJaNOSm37WQ8Jn8TR12UOYNiaRE1y8GKr2Iytki2H
	rqskil0nxBpKBz1yLxlbNJp22z2Y+FvU+FE87ukrXaPAJEQXlP03ipe97BdVqW+Xje/J
	2zgVX9EiGni3oP9xbe3IYYISEvmBMKYXo6LCwT+d0NxbCasnOsXr+sZEfv7IeoXtZik7
	skJhd+JmYWhYmnJQ4sRDqEDYLCbeetiIH9i0AWCjWB/oP7pYjTgocxq+b/UF/sAs297x
	5kPA==
MIME-Version: 1.0
Received: by 10.52.179.2 with SMTP id dc2mr28913935vdc.50.1354227071121; Thu,
	29 Nov 2012 14:11:11 -0800 (PST)
Received: by 10.58.128.37 with HTTP; Thu, 29 Nov 2012 14:11:11 -0800 (PST)
In-Reply-To: <20121129150736.GH8912@reaktio.net>
References: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
	<20121129150736.GH8912@reaktio.net>
Date: Fri, 30 Nov 2012 11:11:11 +1300
Message-ID: <CAEHxbC1gG5RR9h9odxx59BZm2+SUdoGuwZc8Sco_yNtxVwod=Q@mail.gmail.com>
From: Greg Zapp <greg.zapp@gmail.com>
To: =?ISO-8859-1?Q?Pasi_K=E4rkk=E4inen?= <pasik@iki.fi>
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Enabling NLB is crashing VM's/DRBD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4655280266448881016=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4655280266448881016==
Content-Type: multipart/alternative; boundary=bcaec5014a4384fb0804cfa98f7a

--bcaec5014a4384fb0804cfa98f7a
Content-Type: text/plain; charset=ISO-8859-1

HI,

We are running Debian's provided xen-hypervisor-4.0-amd64(4.0.
1-4).  The kernel is 2.6.32-5-xen-amd64(2.6.32-46) from Debian.

The previously posted log lines were from the dom0's /var/log/messages.
The only thing I'm seeing form xm dmesg is the following:
(XEN) grant_table.c:1717:d0 Bad grant reference

I've also picked up on some more entries from syslog that were not present
in messages.  Here is what's present in syslog.  Time seems to be sync'd to
the second on both machines:
Nov 28 10:55:03 nodeA kernel: [1239467.400293] eth0: port 11(nlb2.e0)
entering disabled state
Nov 28 10:55:03 nodeA kernel: [1239467.400516] eth0: port 11(nlb2.e0)
entering disabled state
Nov 28 10:55:04 nodeA kernel: [1239467.731442] frontend_changed:
backend/vif/73/0: prepare for reconnect
Nov 28 10:55:04 nodeA logger: /etc/xen/scripts/vif-bridge: offline
XENBUS_PATH=backend/vif/73/0
Nov 28 10:55:05 nodeA logger: /etc/xen/scripts/vif-bridge: brctl delif eth0
nlb2.e0 failed
Nov 28 10:55:05 nodeA logger: /etc/xen/scripts/vif-bridge: ifconfig nlb2.e0
down failed
Nov 28 10:55:06 nodeA logger: /etc/xen/scripts/vif-bridge: Successful
vif-bridge offline for nlb2.e0, bridge eth0.
Nov 28 10:55:06 nodeA logger: /etc/xen/scripts/vif-bridge: online
XENBUS_PATH=backend/vif/73/0
Nov 28 10:55:08 nodeA kernel: [1239471.758583] device nlb2.e0 entered
promiscuous mode
Nov 28 10:55:10 nodeA kernel: [1239473.795967] block drbd23: sock was shut
down by peer
Nov 28 10:55:27 nodeA kernel: [1239473.795973] block drbd23: peer( Primary
-> Unknown ) conn( Connected -> BrokenPipe ) pdsk( UpToDate -> DUnknown )
Nov 28 10:55:27 nodeA kernel: [1239473.795980] block drbd23: short read
expecting header on sock: r=0
Nov 28 10:55:27 nodeA kernel: [1239474.009951] block drbd31: sock was shut
down by peer


Nov 28 10:55:09 nodeB kernel: [1239622.217505] block drbd23: PingAck did
not arrive in time.
Nov 28 10:55:09 nodeB kernel: [1239622.217542] block drbd23: peer(
Secondary -> Unknown ) conn( Connected -> NetworkFailure ) pdsk( UpToDate
-> DUnknown )
Nov 28 10:55:09 nodeB kernel: [1239622.217551] block drbd23: asender
terminated
Nov 28 10:55:09 nodeB kernel: [1239622.217554] block drbd23: Terminating
drbd23_asender
Nov 28 10:55:09 nodeB kernel: [1239622.217795] block drbd23: short read
expecting header on sock: r=-512
Nov 28 10:55:09 nodeB kernel: [1239622.217887] block drbd23: Creating new
current UUID
Nov 28 10:55:09 nodeB kernel: [1239622.218118] block drbd23: Connection
closed
Nov 28 10:55:09 nodeB kernel: [1239622.218125] block drbd23: conn(
NetworkFailure -> Unconnected )
Nov 28 10:55:09 nodeB kernel: [1239622.218135] block drbd23: receiver
terminated
Nov 28 10:55:09 nodeB kernel: [1239622.218137] block drbd23: Restarting
drbd23_receiver
Nov 28 10:55:09 nodeB kernel: [1239622.218140] block drbd23: receiver
(re)started
Nov 28 10:55:09 nodeB kernel: [1239622.218143] block drbd23: conn(
Unconnected -> WFConnection )
Nov 28 10:55:09 nodeB kernel: [1239622.353589] block drbd30: PingAck did
not arrive in time.
Nov 28 10:55:09 nodeB kernel: [1239622.353627] block drbd30: peer(
Secondary -> Unknown ) conn( Connected -> NetworkFailure ) pdsk( UpToDate
-> DUnknown )
Nov 28 10:55:09 nodeB kernel: [1239622.353637] block drbd30: asender
terminated
Nov 28 10:55:09 nodeB kernel: [1239622.353639] block drbd30: Terminating
drbd30_asender
Nov 28 10:55:09 nodeB kernel: [1239622.353668] block drbd30: short read
expecting header on sock: r=-512
Nov 28 10:55:09 nodeB kernel: [1239622.353754] block drbd30: Creating new
current UUID
Nov 28 10:55:09 nodeB kernel: [1239622.388101] block drbd30: Connection
closed
Nov 28 10:55:09 nodeB kernel: [1239622.388107] block drbd30: conn(
NetworkFailure -> Unconnected )
Nov 28 10:55:09 nodeB kernel: [1239622.388111] block drbd30: receiver
terminated
Nov 28 10:55:09 nodeB kernel: [1239622.388113] block drbd30: Restarting
drbd30_receiver
Nov 28 10:55:09 nodeB kernel: [1239622.388116] block drbd30: receiver
(re)started
Nov 28 10:55:09 nodeB kernel: [1239622.388119] block drbd30: conn(
Unconnected -> WFConnection )

I've also looked at the qemu, xend-hotplug, and xend logs and do not see
any telling errors.  In xend.log I just see lines pertaining to VM's being
rebooted.

As for GPLPV.. I haven't been able to reproduce the "network crashing" and
rebooting in the lab and probably won't be able to until I can get a more
robust production-like environment setup.  Unfortunately I can't risk more
customer down time by attempting to setup NLB without the GPLPV drivers in
production.  If I can manage to reproduce this in staging I will of course
attempt without the GPLPV drivers.

-Greg

--bcaec5014a4384fb0804cfa98f7a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

HI,<br><br>We are running Debian&#39;s provided xen-hypervisor-4.0-amd64(4.=
0.<div id=3D":1xk">1-4).=A0 The kernel is 2.6.32-5-xen-amd64(2.6.32-46) fro=
m Debian.<br><br>The
 previously posted log lines were from the dom0&#39;s /var/log/messages.=A0=
=20
The only thing I&#39;m seeing form xm dmesg is the following:<br>
(XEN) grant_table.c:1717:d0 Bad grant reference<br>
<br>I&#39;ve also picked up on some more entries from syslog that were not=
=20
present in messages.=A0 Here is what&#39;s present in syslog.=A0 Time seems=
 to=20
be sync&#39;d to the second on both machines:<br>Nov 28 10:55:03 nodeA kern=
el: [1239467.400293] eth0: port 11(nlb2.e0) entering disabled state<br>
Nov 28 10:55:03 nodeA kernel: [1239467.400516] eth0: port 11(nlb2.e0) enter=
ing disabled state<br>Nov 28 10:55:04 nodeA kernel: [1239467.731442] fronte=
nd_changed: backend/vif/73/0: prepare for reconnect<br>Nov 28 10:55:04 node=
A logger: /etc/xen/scripts/vif-bridge: offline XENBUS_PATH=3Dbackend/vif/73=
/0<br>

Nov 28 10:55:05 nodeA logger: /etc/xen/scripts/vif-bridge: brctl delif eth0=
 nlb2.e0 failed<br>Nov 28 10:55:05 nodeA logger: /etc/xen/scripts/vif-bridg=
e: ifconfig nlb2.e0 down failed<br>Nov 28 10:55:06 nodeA logger: /etc/xen/s=
cripts/vif-bridge: Successful vif-bridge offline for nlb2.e0, bridge eth0.<=
br>

Nov 28 10:55:06 nodeA logger: /etc/xen/scripts/vif-bridge: online XENBUS_PA=
TH=3Dbackend/vif/73/0<br>Nov 28 10:55:08 nodeA kernel: [1239471.758583] dev=
ice nlb2.e0 entered promiscuous mode<br>Nov 28 10:55:10 nodeA kernel: [1239=
473.795967] block drbd23: sock was shut down by peer<br>

Nov 28 10:55:27 nodeA kernel: [1239473.795973] block drbd23: peer(=20
Primary -&gt; Unknown ) conn( Connected -&gt; BrokenPipe ) pdsk(=20
UpToDate -&gt; DUnknown ) <br>Nov 28 10:55:27 nodeA kernel: [1239473.795980=
] block drbd23: short read expecting header on sock: r=3D0<br>
Nov 28 10:55:27 nodeA kernel: [1239474.009951] block drbd31: sock was shut =
down by peer<br><br><br>Nov 28 10:55:09 nodeB kernel: [1239622.217505] bloc=
k drbd23: PingAck did not arrive in time.<br>Nov
 28 10:55:09 nodeB kernel: [1239622.217542] block drbd23: peer(=20
Secondary -&gt; Unknown ) conn( Connected -&gt; NetworkFailure ) pdsk(=20
UpToDate -&gt; DUnknown ) <br>
Nov 28 10:55:09 nodeB kernel: [1239622.217551] block drbd23: asender termin=
ated<br>Nov 28 10:55:09 nodeB kernel: [1239622.217554] block drbd23: Termin=
ating drbd23_asender<br>Nov 28 10:55:09 nodeB kernel: [1239622.217795] bloc=
k drbd23: short read expecting header on sock: r=3D-512<br>

Nov 28 10:55:09 nodeB kernel: [1239622.217887] block drbd23: Creating new c=
urrent UUID<br>Nov 28 10:55:09 nodeB kernel: [1239622.218118] block drbd23:=
 Connection closed<br>Nov 28 10:55:09 nodeB kernel: [1239622.218125] block =
drbd23: conn( NetworkFailure -&gt; Unconnected ) <br>

Nov 28 10:55:09 nodeB kernel: [1239622.218135] block drbd23: receiver termi=
nated<br>Nov 28 10:55:09 nodeB kernel: [1239622.218137] block drbd23: Resta=
rting drbd23_receiver<br>Nov 28 10:55:09 nodeB kernel: [1239622.218140] blo=
ck drbd23: receiver (re)started<br>

Nov 28 10:55:09 nodeB kernel: [1239622.218143] block drbd23: conn( Unconnec=
ted -&gt; WFConnection ) <br>Nov 28 10:55:09 nodeB kernel: [1239622.353589]=
 block drbd30: PingAck did not arrive in time.<br>Nov
 28 10:55:09 nodeB kernel: [1239622.353627] block drbd30: peer(=20
Secondary -&gt; Unknown ) conn( Connected -&gt; NetworkFailure ) pdsk(=20
UpToDate -&gt; DUnknown ) <br>
Nov 28 10:55:09 nodeB kernel: [1239622.353637] block drbd30: asender termin=
ated<br>Nov 28 10:55:09 nodeB kernel: [1239622.353639] block drbd30: Termin=
ating drbd30_asender<br>Nov 28 10:55:09 nodeB kernel: [1239622.353668] bloc=
k drbd30: short read expecting header on sock: r=3D-512<br>

Nov 28 10:55:09 nodeB kernel: [1239622.353754] block drbd30: Creating new c=
urrent UUID<br>Nov 28 10:55:09 nodeB kernel: [1239622.388101] block drbd30:=
 Connection closed<br>Nov 28 10:55:09 nodeB kernel: [1239622.388107] block =
drbd30: conn( NetworkFailure -&gt; Unconnected ) <br>

Nov 28 10:55:09 nodeB kernel: [1239622.388111] block drbd30: receiver termi=
nated<br>Nov 28 10:55:09 nodeB kernel: [1239622.388113] block drbd30: Resta=
rting drbd30_receiver<br>Nov 28 10:55:09 nodeB kernel: [1239622.388116] blo=
ck drbd30: receiver (re)started<br>

Nov 28 10:55:09 nodeB kernel: [1239622.388119] block drbd30: conn( Unconnec=
ted -&gt; WFConnection )<br><br>I&#39;ve
 also looked at the qemu, xend-hotplug, and xend logs and do not see any
 telling errors.=A0 In xend.log I just see lines pertaining to VM&#39;s bei=
ng=20
rebooted.<br><br>As for GPLPV.. I haven&#39;t been able to reproduce the &q=
uot;network crashing&quot; and rebooting in
 the lab and probably won&#39;t be able to until I can get a more robust=20
production-like environment setup.=A0 Unfortunately I can&#39;t risk more=
=20
customer down time by attempting to setup NLB without the GPLPV drivers=20
in production.=A0 If I can manage to reproduce this in staging I will of=20
course attempt without the GPLPV drivers.<br><br>-Greg<br></div>

--bcaec5014a4384fb0804cfa98f7a--


--===============4655280266448881016==
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.xen.org
http://lists.xen.org/xen-devel

--===============4655280266448881016==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 22:11:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 22:11:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeCKC-0002rn-8p; Thu, 29 Nov 2012 22:11:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg.zapp@gmail.com>) id 1TeCKB-0002ri-3y
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 22:11:15 +0000
Received: from [85.158.143.35:54790] by server-1.bemta-4.messagelabs.com id
	83/5E-27934-28DD7B05; Thu, 29 Nov 2012 22:11:14 +0000
X-Env-Sender: greg.zapp@gmail.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354227071!15957771!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=1.5 required=7.0 tests=HTML_00_10,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3725 invoked from network); 29 Nov 2012 22:11:12 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	29 Nov 2012 22:11:12 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so18742597vbi.32
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 14:11:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=9m0xUYHdhBnR5PM2znvKoaLZyRLxrUmgIxDFvDsClEk=;
	b=zIJfCRyVpl2H1SE0dSaYuMDa+aIA7ETsMov5nOvGi5EbWsT5BAqXE1EfU3QNYMhOC3
	wtjwT82ubeacBklbscdh1QFckn2mJaNOSm37WQ8Jn8TR12UOYNiaRE1y8GKr2Iytki2H
	rqskil0nxBpKBz1yLxlbNJp22z2Y+FvU+FE87ukrXaPAJEQXlP03ipe97BdVqW+Xje/J
	2zgVX9EiGni3oP9xbe3IYYISEvmBMKYXo6LCwT+d0NxbCasnOsXr+sZEfv7IeoXtZik7
	skJhd+JmYWhYmnJQ4sRDqEDYLCbeetiIH9i0AWCjWB/oP7pYjTgocxq+b/UF/sAs297x
	5kPA==
MIME-Version: 1.0
Received: by 10.52.179.2 with SMTP id dc2mr28913935vdc.50.1354227071121; Thu,
	29 Nov 2012 14:11:11 -0800 (PST)
Received: by 10.58.128.37 with HTTP; Thu, 29 Nov 2012 14:11:11 -0800 (PST)
In-Reply-To: <20121129150736.GH8912@reaktio.net>
References: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
	<20121129150736.GH8912@reaktio.net>
Date: Fri, 30 Nov 2012 11:11:11 +1300
Message-ID: <CAEHxbC1gG5RR9h9odxx59BZm2+SUdoGuwZc8Sco_yNtxVwod=Q@mail.gmail.com>
From: Greg Zapp <greg.zapp@gmail.com>
To: =?ISO-8859-1?Q?Pasi_K=E4rkk=E4inen?= <pasik@iki.fi>
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Enabling NLB is crashing VM's/DRBD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============4655280266448881016=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============4655280266448881016==
Content-Type: multipart/alternative; boundary=bcaec5014a4384fb0804cfa98f7a

--bcaec5014a4384fb0804cfa98f7a
Content-Type: text/plain; charset=ISO-8859-1

HI,

We are running Debian's provided xen-hypervisor-4.0-amd64(4.0.
1-4).  The kernel is 2.6.32-5-xen-amd64(2.6.32-46) from Debian.

The previously posted log lines were from the dom0's /var/log/messages.
The only thing I'm seeing form xm dmesg is the following:
(XEN) grant_table.c:1717:d0 Bad grant reference

I've also picked up on some more entries from syslog that were not present
in messages.  Here is what's present in syslog.  Time seems to be sync'd to
the second on both machines:
Nov 28 10:55:03 nodeA kernel: [1239467.400293] eth0: port 11(nlb2.e0)
entering disabled state
Nov 28 10:55:03 nodeA kernel: [1239467.400516] eth0: port 11(nlb2.e0)
entering disabled state
Nov 28 10:55:04 nodeA kernel: [1239467.731442] frontend_changed:
backend/vif/73/0: prepare for reconnect
Nov 28 10:55:04 nodeA logger: /etc/xen/scripts/vif-bridge: offline
XENBUS_PATH=backend/vif/73/0
Nov 28 10:55:05 nodeA logger: /etc/xen/scripts/vif-bridge: brctl delif eth0
nlb2.e0 failed
Nov 28 10:55:05 nodeA logger: /etc/xen/scripts/vif-bridge: ifconfig nlb2.e0
down failed
Nov 28 10:55:06 nodeA logger: /etc/xen/scripts/vif-bridge: Successful
vif-bridge offline for nlb2.e0, bridge eth0.
Nov 28 10:55:06 nodeA logger: /etc/xen/scripts/vif-bridge: online
XENBUS_PATH=backend/vif/73/0
Nov 28 10:55:08 nodeA kernel: [1239471.758583] device nlb2.e0 entered
promiscuous mode
Nov 28 10:55:10 nodeA kernel: [1239473.795967] block drbd23: sock was shut
down by peer
Nov 28 10:55:27 nodeA kernel: [1239473.795973] block drbd23: peer( Primary
-> Unknown ) conn( Connected -> BrokenPipe ) pdsk( UpToDate -> DUnknown )
Nov 28 10:55:27 nodeA kernel: [1239473.795980] block drbd23: short read
expecting header on sock: r=0
Nov 28 10:55:27 nodeA kernel: [1239474.009951] block drbd31: sock was shut
down by peer


Nov 28 10:55:09 nodeB kernel: [1239622.217505] block drbd23: PingAck did
not arrive in time.
Nov 28 10:55:09 nodeB kernel: [1239622.217542] block drbd23: peer(
Secondary -> Unknown ) conn( Connected -> NetworkFailure ) pdsk( UpToDate
-> DUnknown )
Nov 28 10:55:09 nodeB kernel: [1239622.217551] block drbd23: asender
terminated
Nov 28 10:55:09 nodeB kernel: [1239622.217554] block drbd23: Terminating
drbd23_asender
Nov 28 10:55:09 nodeB kernel: [1239622.217795] block drbd23: short read
expecting header on sock: r=-512
Nov 28 10:55:09 nodeB kernel: [1239622.217887] block drbd23: Creating new
current UUID
Nov 28 10:55:09 nodeB kernel: [1239622.218118] block drbd23: Connection
closed
Nov 28 10:55:09 nodeB kernel: [1239622.218125] block drbd23: conn(
NetworkFailure -> Unconnected )
Nov 28 10:55:09 nodeB kernel: [1239622.218135] block drbd23: receiver
terminated
Nov 28 10:55:09 nodeB kernel: [1239622.218137] block drbd23: Restarting
drbd23_receiver
Nov 28 10:55:09 nodeB kernel: [1239622.218140] block drbd23: receiver
(re)started
Nov 28 10:55:09 nodeB kernel: [1239622.218143] block drbd23: conn(
Unconnected -> WFConnection )
Nov 28 10:55:09 nodeB kernel: [1239622.353589] block drbd30: PingAck did
not arrive in time.
Nov 28 10:55:09 nodeB kernel: [1239622.353627] block drbd30: peer(
Secondary -> Unknown ) conn( Connected -> NetworkFailure ) pdsk( UpToDate
-> DUnknown )
Nov 28 10:55:09 nodeB kernel: [1239622.353637] block drbd30: asender
terminated
Nov 28 10:55:09 nodeB kernel: [1239622.353639] block drbd30: Terminating
drbd30_asender
Nov 28 10:55:09 nodeB kernel: [1239622.353668] block drbd30: short read
expecting header on sock: r=-512
Nov 28 10:55:09 nodeB kernel: [1239622.353754] block drbd30: Creating new
current UUID
Nov 28 10:55:09 nodeB kernel: [1239622.388101] block drbd30: Connection
closed
Nov 28 10:55:09 nodeB kernel: [1239622.388107] block drbd30: conn(
NetworkFailure -> Unconnected )
Nov 28 10:55:09 nodeB kernel: [1239622.388111] block drbd30: receiver
terminated
Nov 28 10:55:09 nodeB kernel: [1239622.388113] block drbd30: Restarting
drbd30_receiver
Nov 28 10:55:09 nodeB kernel: [1239622.388116] block drbd30: receiver
(re)started
Nov 28 10:55:09 nodeB kernel: [1239622.388119] block drbd30: conn(
Unconnected -> WFConnection )

I've also looked at the qemu, xend-hotplug, and xend logs and do not see
any telling errors.  In xend.log I just see lines pertaining to VM's being
rebooted.

As for GPLPV.. I haven't been able to reproduce the "network crashing" and
rebooting in the lab and probably won't be able to until I can get a more
robust production-like environment setup.  Unfortunately I can't risk more
customer down time by attempting to setup NLB without the GPLPV drivers in
production.  If I can manage to reproduce this in staging I will of course
attempt without the GPLPV drivers.

-Greg

--bcaec5014a4384fb0804cfa98f7a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

HI,<br><br>We are running Debian&#39;s provided xen-hypervisor-4.0-amd64(4.=
0.<div id=3D":1xk">1-4).=A0 The kernel is 2.6.32-5-xen-amd64(2.6.32-46) fro=
m Debian.<br><br>The
 previously posted log lines were from the dom0&#39;s /var/log/messages.=A0=
=20
The only thing I&#39;m seeing form xm dmesg is the following:<br>
(XEN) grant_table.c:1717:d0 Bad grant reference<br>
<br>I&#39;ve also picked up on some more entries from syslog that were not=
=20
present in messages.=A0 Here is what&#39;s present in syslog.=A0 Time seems=
 to=20
be sync&#39;d to the second on both machines:<br>Nov 28 10:55:03 nodeA kern=
el: [1239467.400293] eth0: port 11(nlb2.e0) entering disabled state<br>
Nov 28 10:55:03 nodeA kernel: [1239467.400516] eth0: port 11(nlb2.e0) enter=
ing disabled state<br>Nov 28 10:55:04 nodeA kernel: [1239467.731442] fronte=
nd_changed: backend/vif/73/0: prepare for reconnect<br>Nov 28 10:55:04 node=
A logger: /etc/xen/scripts/vif-bridge: offline XENBUS_PATH=3Dbackend/vif/73=
/0<br>

Nov 28 10:55:05 nodeA logger: /etc/xen/scripts/vif-bridge: brctl delif eth0=
 nlb2.e0 failed<br>Nov 28 10:55:05 nodeA logger: /etc/xen/scripts/vif-bridg=
e: ifconfig nlb2.e0 down failed<br>Nov 28 10:55:06 nodeA logger: /etc/xen/s=
cripts/vif-bridge: Successful vif-bridge offline for nlb2.e0, bridge eth0.<=
br>

Nov 28 10:55:06 nodeA logger: /etc/xen/scripts/vif-bridge: online XENBUS_PA=
TH=3Dbackend/vif/73/0<br>Nov 28 10:55:08 nodeA kernel: [1239471.758583] dev=
ice nlb2.e0 entered promiscuous mode<br>Nov 28 10:55:10 nodeA kernel: [1239=
473.795967] block drbd23: sock was shut down by peer<br>

Nov 28 10:55:27 nodeA kernel: [1239473.795973] block drbd23: peer(=20
Primary -&gt; Unknown ) conn( Connected -&gt; BrokenPipe ) pdsk(=20
UpToDate -&gt; DUnknown ) <br>Nov 28 10:55:27 nodeA kernel: [1239473.795980=
] block drbd23: short read expecting header on sock: r=3D0<br>
Nov 28 10:55:27 nodeA kernel: [1239474.009951] block drbd31: sock was shut =
down by peer<br><br><br>Nov 28 10:55:09 nodeB kernel: [1239622.217505] bloc=
k drbd23: PingAck did not arrive in time.<br>Nov
 28 10:55:09 nodeB kernel: [1239622.217542] block drbd23: peer(=20
Secondary -&gt; Unknown ) conn( Connected -&gt; NetworkFailure ) pdsk(=20
UpToDate -&gt; DUnknown ) <br>
Nov 28 10:55:09 nodeB kernel: [1239622.217551] block drbd23: asender termin=
ated<br>Nov 28 10:55:09 nodeB kernel: [1239622.217554] block drbd23: Termin=
ating drbd23_asender<br>Nov 28 10:55:09 nodeB kernel: [1239622.217795] bloc=
k drbd23: short read expecting header on sock: r=3D-512<br>

Nov 28 10:55:09 nodeB kernel: [1239622.217887] block drbd23: Creating new c=
urrent UUID<br>Nov 28 10:55:09 nodeB kernel: [1239622.218118] block drbd23:=
 Connection closed<br>Nov 28 10:55:09 nodeB kernel: [1239622.218125] block =
drbd23: conn( NetworkFailure -&gt; Unconnected ) <br>

Nov 28 10:55:09 nodeB kernel: [1239622.218135] block drbd23: receiver termi=
nated<br>Nov 28 10:55:09 nodeB kernel: [1239622.218137] block drbd23: Resta=
rting drbd23_receiver<br>Nov 28 10:55:09 nodeB kernel: [1239622.218140] blo=
ck drbd23: receiver (re)started<br>

Nov 28 10:55:09 nodeB kernel: [1239622.218143] block drbd23: conn( Unconnec=
ted -&gt; WFConnection ) <br>Nov 28 10:55:09 nodeB kernel: [1239622.353589]=
 block drbd30: PingAck did not arrive in time.<br>Nov
 28 10:55:09 nodeB kernel: [1239622.353627] block drbd30: peer(=20
Secondary -&gt; Unknown ) conn( Connected -&gt; NetworkFailure ) pdsk(=20
UpToDate -&gt; DUnknown ) <br>
Nov 28 10:55:09 nodeB kernel: [1239622.353637] block drbd30: asender termin=
ated<br>Nov 28 10:55:09 nodeB kernel: [1239622.353639] block drbd30: Termin=
ating drbd30_asender<br>Nov 28 10:55:09 nodeB kernel: [1239622.353668] bloc=
k drbd30: short read expecting header on sock: r=3D-512<br>

Nov 28 10:55:09 nodeB kernel: [1239622.353754] block drbd30: Creating new c=
urrent UUID<br>Nov 28 10:55:09 nodeB kernel: [1239622.388101] block drbd30:=
 Connection closed<br>Nov 28 10:55:09 nodeB kernel: [1239622.388107] block =
drbd30: conn( NetworkFailure -&gt; Unconnected ) <br>

Nov 28 10:55:09 nodeB kernel: [1239622.388111] block drbd30: receiver termi=
nated<br>Nov 28 10:55:09 nodeB kernel: [1239622.388113] block drbd30: Resta=
rting drbd30_receiver<br>Nov 28 10:55:09 nodeB kernel: [1239622.388116] blo=
ck drbd30: receiver (re)started<br>

Nov 28 10:55:09 nodeB kernel: [1239622.388119] block drbd30: conn( Unconnec=
ted -&gt; WFConnection )<br><br>I&#39;ve
 also looked at the qemu, xend-hotplug, and xend logs and do not see any
 telling errors.=A0 In xend.log I just see lines pertaining to VM&#39;s bei=
ng=20
rebooted.<br><br>As for GPLPV.. I haven&#39;t been able to reproduce the &q=
uot;network crashing&quot; and rebooting in
 the lab and probably won&#39;t be able to until I can get a more robust=20
production-like environment setup.=A0 Unfortunately I can&#39;t risk more=
=20
customer down time by attempting to setup NLB without the GPLPV drivers=20
in production.=A0 If I can manage to reproduce this in staging I will of=20
course attempt without the GPLPV drivers.<br><br>-Greg<br></div>

--bcaec5014a4384fb0804cfa98f7a--


--===============4655280266448881016==
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.xen.org
http://lists.xen.org/xen-devel

--===============4655280266448881016==--


From xen-devel-bounces@lists.xen.org Thu Nov 29 23:16:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 23:16:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeDKK-00048i-29; Thu, 29 Nov 2012 23:15:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TeDKH-00048b-Um
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 23:15:26 +0000
Received: from [85.158.139.83:45302] by server-13.bemta-5.messagelabs.com id
	08/C5-27809-C8CE7B05; Thu, 29 Nov 2012 23:15:24 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-16.tower-182.messagelabs.com!1354230923!20367219!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDc4OTY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27353 invoked from network); 29 Nov 2012 23:15:24 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-16.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 23:15:24 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id CCD6E142F;
	Fri, 30 Nov 2012 01:15:22 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 9C1ED104001; Fri, 30 Nov 2012 01:15:22 +0200 (EET)
Date: Fri, 30 Nov 2012 01:15:22 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Greg Zapp <greg.zapp@gmail.com>
Message-ID: <20121129231522.GK8912@reaktio.net>
References: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
	<20121129150736.GH8912@reaktio.net>
	<CAEHxbC1gG5RR9h9odxx59BZm2+SUdoGuwZc8Sco_yNtxVwod=Q@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CAEHxbC1gG5RR9h9odxx59BZm2+SUdoGuwZc8Sco_yNtxVwod=Q@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Enabling NLB is crashing VM's/DRBD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 11:11:11AM +1300, Greg Zapp wrote:
>    HI,
> 
>    We are running Debian's provided xen-hypervisor-4.0-amd64(4.0.
>    1-4).  The kernel is 2.6.32-5-xen-amd64(2.6.32-46) from Debian.
> 

Also you didn't tell which version of GPLPV you're using.

>    The previously posted log lines were from the dom0's /var/log/messages.
>    The only thing I'm seeing form xm dmesg is the following:
>    (XEN) grant_table.c:1717:d0 Bad grant reference
> 

That might be related. Does the log entry about bad grant reference show up
at the same time as the problem? 

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Thu Nov 29 23:16:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Nov 2012 23:16:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeDKK-00048i-29; Thu, 29 Nov 2012 23:15:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TeDKH-00048b-Um
	for xen-devel@lists.xen.org; Thu, 29 Nov 2012 23:15:26 +0000
Received: from [85.158.139.83:45302] by server-13.bemta-5.messagelabs.com id
	08/C5-27809-C8CE7B05; Thu, 29 Nov 2012 23:15:24 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-16.tower-182.messagelabs.com!1354230923!20367219!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDc4OTY=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27353 invoked from network); 29 Nov 2012 23:15:24 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-16.tower-182.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 29 Nov 2012 23:15:24 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id CCD6E142F;
	Fri, 30 Nov 2012 01:15:22 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 9C1ED104001; Fri, 30 Nov 2012 01:15:22 +0200 (EET)
Date: Fri, 30 Nov 2012 01:15:22 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Greg Zapp <greg.zapp@gmail.com>
Message-ID: <20121129231522.GK8912@reaktio.net>
References: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
	<20121129150736.GH8912@reaktio.net>
	<CAEHxbC1gG5RR9h9odxx59BZm2+SUdoGuwZc8Sco_yNtxVwod=Q@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CAEHxbC1gG5RR9h9odxx59BZm2+SUdoGuwZc8Sco_yNtxVwod=Q@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Enabling NLB is crashing VM's/DRBD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 11:11:11AM +1300, Greg Zapp wrote:
>    HI,
> 
>    We are running Debian's provided xen-hypervisor-4.0-amd64(4.0.
>    1-4).  The kernel is 2.6.32-5-xen-amd64(2.6.32-46) from Debian.
> 

Also you didn't tell which version of GPLPV you're using.

>    The previously posted log lines were from the dom0's /var/log/messages.
>    The only thing I'm seeing form xm dmesg is the following:
>    (XEN) grant_table.c:1717:d0 Bad grant reference
> 

That might be related. Does the log entry about bad grant reference show up
at the same time as the problem? 

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 00:31:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 00:31:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeEUy-0005kZ-90; Fri, 30 Nov 2012 00:30:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg.zapp@gmail.com>) id 1TeEUw-0005kU-F6
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 00:30:30 +0000
Received: from [85.158.143.35:4794] by server-3.bemta-4.messagelabs.com id
	20/03-06841-52EF7B05; Fri, 30 Nov 2012 00:30:29 +0000
X-Env-Sender: greg.zapp@gmail.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354235427!12689759!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=1.5 required=7.0 tests=HTML_00_10,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22826 invoked from network); 30 Nov 2012 00:30:28 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 00:30:28 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so18855074vbi.32
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 16:29:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=XBzVMQJidR2eCBdZhDvEujLfKyyx7IbYzkzuwBZWPzo=;
	b=AI1F+rArYzmT4V4gkXUBOrrfovT6nvkyu2xF0QVAzHbZNWp3x4+hMn7466uxk7F8fI
	+xTIDOi2P6vfW3k+bPsCpB7AL6h74SluMtf4Lr3j12ypbXYQO55aOfDmOxqQfWi1uORd
	UNH7RmB79flMF4zVgjvCQVUn9FyFBXbkV45a0pcm+G2zrRpylVyJW4o20vUkwK0SQcDn
	wpa7HDQJFqJqsF/k9qfmDQM260t8SPfvgBe5762ggZT+vgmIIl1J1jrN5GsdMau0kjF0
	upRiJz1FHwp9iZUsNHDLu3wcYey0soWb5fnO+DT1QY1xXwx8c9qEkhWa4QdKtefArcT2
	pdNA==
MIME-Version: 1.0
Received: by 10.220.157.68 with SMTP id a4mr33179414vcx.60.1354235367816; Thu,
	29 Nov 2012 16:29:27 -0800 (PST)
Received: by 10.58.128.37 with HTTP; Thu, 29 Nov 2012 16:29:27 -0800 (PST)
In-Reply-To: <20121129231522.GK8912@reaktio.net>
References: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
	<20121129150736.GH8912@reaktio.net>
	<CAEHxbC1gG5RR9h9odxx59BZm2+SUdoGuwZc8Sco_yNtxVwod=Q@mail.gmail.com>
	<20121129231522.GK8912@reaktio.net>
Date: Fri, 30 Nov 2012 13:29:27 +1300
Message-ID: <CAEHxbC1pHuRc6Gb_CCWqixN-X5i_8TBabSqanS21ugLCgZ3ekg@mail.gmail.com>
From: Greg Zapp <greg.zapp@gmail.com>
To: =?ISO-8859-1?Q?Pasi_K=E4rkk=E4inen?= <pasik@iki.fi>
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Enabling NLB is crashing VM's/DRBD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0843079331036680210=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0843079331036680210==
Content-Type: multipart/alternative; boundary=f46d043c7ea80a7d5604cfab7ee9

--f46d043c7ea80a7d5604cfab7ee9
Content-Type: text/plain; charset=ISO-8859-1

Looks like I have GPLPV 0.10.0.135 packaged in(according to the
changelog).  I'm using the Univention signed drivers.

As for that error, you may be on to something.  I'm not sure when those
errors came up as there are no time stamps in the output from 'xm dmesg'.
However, I only see those errors on nodA, which is the node with the VM's
that crashed.

--f46d043c7ea80a7d5604cfab7ee9
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Looks like I have GPLPV 0.10.0.135 packaged in(according to the changelog).=
=A0 I&#39;m using the Univention signed drivers.<br><br>As for that error, =
you may be on to something.=A0 I&#39;m not sure when those errors came up a=
s there are no time stamps in the output from &#39;xm dmesg&#39;.=A0 Howeve=
r, I only see those errors on nodA, which is the node with the VM&#39;s tha=
t crashed.<br>


--f46d043c7ea80a7d5604cfab7ee9--


--===============0843079331036680210==
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.xen.org
http://lists.xen.org/xen-devel

--===============0843079331036680210==--


From xen-devel-bounces@lists.xen.org Fri Nov 30 00:31:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 00:31:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeEUy-0005kZ-90; Fri, 30 Nov 2012 00:30:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg.zapp@gmail.com>) id 1TeEUw-0005kU-F6
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 00:30:30 +0000
Received: from [85.158.143.35:4794] by server-3.bemta-4.messagelabs.com id
	20/03-06841-52EF7B05; Fri, 30 Nov 2012 00:30:29 +0000
X-Env-Sender: greg.zapp@gmail.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354235427!12689759!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=1.5 required=7.0 tests=HTML_00_10,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22826 invoked from network); 30 Nov 2012 00:30:28 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 00:30:28 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so18855074vbi.32
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 16:29:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=XBzVMQJidR2eCBdZhDvEujLfKyyx7IbYzkzuwBZWPzo=;
	b=AI1F+rArYzmT4V4gkXUBOrrfovT6nvkyu2xF0QVAzHbZNWp3x4+hMn7466uxk7F8fI
	+xTIDOi2P6vfW3k+bPsCpB7AL6h74SluMtf4Lr3j12ypbXYQO55aOfDmOxqQfWi1uORd
	UNH7RmB79flMF4zVgjvCQVUn9FyFBXbkV45a0pcm+G2zrRpylVyJW4o20vUkwK0SQcDn
	wpa7HDQJFqJqsF/k9qfmDQM260t8SPfvgBe5762ggZT+vgmIIl1J1jrN5GsdMau0kjF0
	upRiJz1FHwp9iZUsNHDLu3wcYey0soWb5fnO+DT1QY1xXwx8c9qEkhWa4QdKtefArcT2
	pdNA==
MIME-Version: 1.0
Received: by 10.220.157.68 with SMTP id a4mr33179414vcx.60.1354235367816; Thu,
	29 Nov 2012 16:29:27 -0800 (PST)
Received: by 10.58.128.37 with HTTP; Thu, 29 Nov 2012 16:29:27 -0800 (PST)
In-Reply-To: <20121129231522.GK8912@reaktio.net>
References: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
	<20121129150736.GH8912@reaktio.net>
	<CAEHxbC1gG5RR9h9odxx59BZm2+SUdoGuwZc8Sco_yNtxVwod=Q@mail.gmail.com>
	<20121129231522.GK8912@reaktio.net>
Date: Fri, 30 Nov 2012 13:29:27 +1300
Message-ID: <CAEHxbC1pHuRc6Gb_CCWqixN-X5i_8TBabSqanS21ugLCgZ3ekg@mail.gmail.com>
From: Greg Zapp <greg.zapp@gmail.com>
To: =?ISO-8859-1?Q?Pasi_K=E4rkk=E4inen?= <pasik@iki.fi>
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Enabling NLB is crashing VM's/DRBD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0843079331036680210=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============0843079331036680210==
Content-Type: multipart/alternative; boundary=f46d043c7ea80a7d5604cfab7ee9

--f46d043c7ea80a7d5604cfab7ee9
Content-Type: text/plain; charset=ISO-8859-1

Looks like I have GPLPV 0.10.0.135 packaged in(according to the
changelog).  I'm using the Univention signed drivers.

As for that error, you may be on to something.  I'm not sure when those
errors came up as there are no time stamps in the output from 'xm dmesg'.
However, I only see those errors on nodA, which is the node with the VM's
that crashed.

--f46d043c7ea80a7d5604cfab7ee9
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Looks like I have GPLPV 0.10.0.135 packaged in(according to the changelog).=
=A0 I&#39;m using the Univention signed drivers.<br><br>As for that error, =
you may be on to something.=A0 I&#39;m not sure when those errors came up a=
s there are no time stamps in the output from &#39;xm dmesg&#39;.=A0 Howeve=
r, I only see those errors on nodA, which is the node with the VM&#39;s tha=
t crashed.<br>


--f46d043c7ea80a7d5604cfab7ee9--


--===============0843079331036680210==
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.xen.org
http://lists.xen.org/xen-devel

--===============0843079331036680210==--


From xen-devel-bounces@lists.xen.org Fri Nov 30 00:38:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 00:38:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeEcU-00061T-7L; Fri, 30 Nov 2012 00:38:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TeEcS-00061M-6L
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 00:38:16 +0000
Received: from [193.109.254.147:20828] by server-14.bemta-14.messagelabs.com
	id 33/DE-14517-7FFF7B05; Fri, 30 Nov 2012 00:38:15 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1354235892!8841869!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzI2MjAw\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13803 invoked from network); 30 Nov 2012 00:38:13 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-8.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 00:38:13 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga101.jf.intel.com with ESMTP; 29 Nov 2012 16:38:07 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,188,1355126400"; d="scan'208";a="226908437"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by orsmga001.jf.intel.com with ESMTP; 29 Nov 2012 16:38:05 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 29 Nov 2012 16:37:57 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Fri, 30 Nov 2012 08:37:49 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>
Thread-Topic: [Xen-devel] [PATCH, RFC 0/7] IOMMU: add phantom function support
Thread-Index: AQHNzgZ7ISPR/wCD+k2jHDaUEkQbqJgBiMvA
Date: Fri, 30 Nov 2012 00:37:48 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A483456440339A70F@SHSMSX101.ccr.corp.intel.com>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
	<50B7226B02000078000AC608@nat28.tlf.novell.com>
In-Reply-To: <50B7226B02000078000AC608@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Zhang, Xiantao" <xiantao.zhang@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH, RFC 0/7] IOMMU: add phantom function support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Thursday, November 29, 2012 3:53 PM
> To: Zhang, Xiantao
> Cc: xen-devel
> Subject: Re: [Xen-devel] [PATCH, RFC 0/7] IOMMU: add phantom function
> support
> 
> >>> On 28.11.12 at 10:41, "Jan Beulich" <JBeulich@suse.com> wrote:
> > While I'm unaware of devices making use of this functionality in
> > proper ways, the goal of this patch set is to leverage the enabling of
> > the specified behavior as a workaround for devices that behave as if
> > they made use of this functionality _without_ advertising so in the
> > PCIe capability structure.
> >
> > While it would have been possible to leave the generic IOMMU code
> > untouched, and deal with the creation of the necessary device context
> > entries in the individual IOMMUs' implementations, I felt that it was
> > cleaner to have as much of the necessary abstraction in the generic
> > layer.
> >
> > The adjustments in particular imply that for the relevant operations,
> > (PCI-dev, devfn) tuples get passed, with the PCI device referring to
> > the real device and devfn representing either the real device or the
> > phantom function. Consequently, for any operation intended to deal
> > with the real device, the devfn of the device itself must be used,
> > whereas for anything targeting the phantom function the passed in
> > value is the correct one to pass on.
> >
> > 1: IOMMU: adjust (re)assign operation parameters
> > 2: IOMMU: adjust add/remove operation parameters
> > 3: VT-d: adjust context map/unmap parameters
> > 4: AMD IOMMU: adjust flush function parameters
> > 5: IOMMU: consolidate pdev_type() and cache its result for a given
> > device
> > 6: IOMMU: add phantom function support
> > 7: IOMMU: add option to specify devices behaving like ones using
> > phantom functions
> >
> > As the patch set wasn't tested on the affected systems yet, I'm
> > intentionally not adding S-o-b tags yet. I would appreciate review
> > nevertheless (and even more so, given that I won't be able to test
> > this code other than what I did in contrived scenarios).
> 
> One open question (that I realized only after sending the batch) is whether
> for such devices the source ID verification should be set up using one of the
> SQ_13_IGNORE_* (fitting the stride).

Yes,  I think so.  If SVT is set to 01b,  SQ should be specially handled according to phantom device's  enabled functions. 
Xiantao 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 00:38:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 00:38:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeEcU-00061T-7L; Fri, 30 Nov 2012 00:38:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TeEcS-00061M-6L
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 00:38:16 +0000
Received: from [193.109.254.147:20828] by server-14.bemta-14.messagelabs.com
	id 33/DE-14517-7FFF7B05; Fri, 30 Nov 2012 00:38:15 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1354235892!8841869!1
X-Originating-IP: [134.134.136.20]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzI2MjAw\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13803 invoked from network); 30 Nov 2012 00:38:13 -0000
Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20)
	by server-8.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 00:38:13 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga101.jf.intel.com with ESMTP; 29 Nov 2012 16:38:07 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,188,1355126400"; d="scan'208";a="226908437"
Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36])
	by orsmga001.jf.intel.com with ESMTP; 29 Nov 2012 16:38:05 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 29 Nov 2012 16:37:57 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Fri, 30 Nov 2012 08:37:49 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>
Thread-Topic: [Xen-devel] [PATCH, RFC 0/7] IOMMU: add phantom function support
Thread-Index: AQHNzgZ7ISPR/wCD+k2jHDaUEkQbqJgBiMvA
Date: Fri, 30 Nov 2012 00:37:48 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A483456440339A70F@SHSMSX101.ccr.corp.intel.com>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
	<50B7226B02000078000AC608@nat28.tlf.novell.com>
In-Reply-To: <50B7226B02000078000AC608@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Zhang, Xiantao" <xiantao.zhang@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH, RFC 0/7] IOMMU: add phantom function support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Thursday, November 29, 2012 3:53 PM
> To: Zhang, Xiantao
> Cc: xen-devel
> Subject: Re: [Xen-devel] [PATCH, RFC 0/7] IOMMU: add phantom function
> support
> 
> >>> On 28.11.12 at 10:41, "Jan Beulich" <JBeulich@suse.com> wrote:
> > While I'm unaware of devices making use of this functionality in
> > proper ways, the goal of this patch set is to leverage the enabling of
> > the specified behavior as a workaround for devices that behave as if
> > they made use of this functionality _without_ advertising so in the
> > PCIe capability structure.
> >
> > While it would have been possible to leave the generic IOMMU code
> > untouched, and deal with the creation of the necessary device context
> > entries in the individual IOMMUs' implementations, I felt that it was
> > cleaner to have as much of the necessary abstraction in the generic
> > layer.
> >
> > The adjustments in particular imply that for the relevant operations,
> > (PCI-dev, devfn) tuples get passed, with the PCI device referring to
> > the real device and devfn representing either the real device or the
> > phantom function. Consequently, for any operation intended to deal
> > with the real device, the devfn of the device itself must be used,
> > whereas for anything targeting the phantom function the passed in
> > value is the correct one to pass on.
> >
> > 1: IOMMU: adjust (re)assign operation parameters
> > 2: IOMMU: adjust add/remove operation parameters
> > 3: VT-d: adjust context map/unmap parameters
> > 4: AMD IOMMU: adjust flush function parameters
> > 5: IOMMU: consolidate pdev_type() and cache its result for a given
> > device
> > 6: IOMMU: add phantom function support
> > 7: IOMMU: add option to specify devices behaving like ones using
> > phantom functions
> >
> > As the patch set wasn't tested on the affected systems yet, I'm
> > intentionally not adding S-o-b tags yet. I would appreciate review
> > nevertheless (and even more so, given that I won't be able to test
> > this code other than what I did in contrived scenarios).
> 
> One open question (that I realized only after sending the batch) is whether
> for such devices the source ID verification should be set up using one of the
> SQ_13_IGNORE_* (fitting the stride).

Yes,  I think so.  If SVT is set to 01b,  SQ should be specially handled according to phantom device's  enabled functions. 
Xiantao 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 01:25:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 01:25:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeFLx-0002DJ-5P; Fri, 30 Nov 2012 01:25:17 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg@wind.enjellic.com>) id 1TeFLv-0002DE-Sn
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 01:25:16 +0000
Received: from [193.109.254.147:2437] by server-8.bemta-14.messagelabs.com id
	64/AF-05026-BFA08B05; Fri, 30 Nov 2012 01:25:15 +0000
X-Env-Sender: greg@wind.enjellic.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1354238708!6425160!1
X-Originating-IP: [76.10.64.91]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8604 invoked from network); 30 Nov 2012 01:25:08 -0000
Received: from wind.enjellic.com (HELO wind.enjellic.com) (76.10.64.91)
	by server-5.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 01:25:08 -0000
Received: from wind.enjellic.com (localhost [127.0.0.1])
	by wind.enjellic.com (8.14.3/8.14.3) with ESMTP id qAU1P2Yc031055;
	Thu, 29 Nov 2012 19:25:02 -0600
Received: (from greg@localhost)
	by wind.enjellic.com (8.14.3/8.14.3/Submit) id qAU1P143031054;
	Thu, 29 Nov 2012 19:25:01 -0600
Date: Thu, 29 Nov 2012 19:25:01 -0600
From: "Dr. Greg Wettstein" <greg@wind.enjellic.com>
Message-Id: <201211300125.qAU1P143031054@wind.enjellic.com>
In-Reply-To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
	"Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the
	virtual machine created by xl command?" (Nov 28, 4:04pm)
X-Mailer: Mail User's Shell (7.2.6-ESD1.0 03/31/2012)
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.3
	(wind.enjellic.com [0.0.0.0]);
	Thu, 29 Nov 2012 19:25:02 -0600 (CST)
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>, Qian Hu <qianhu2011@gmail.com>
Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the
	virtual machine created by xl command?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: greg@enjellic.com
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Nov 28,  4:04pm, Konrad Rzeszutek Wilk wrote:
} Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the v

> On Sat, Nov 17, 2012 at 09:17:36AM -0600, Dr. Greg Wettstein wrote:
> > On Nov 14,  3:40pm, "Dr. Greg Wettstein" wrote:
> > } Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the v
> > 
> > Good morning, hope the day is going well for everyone.

> Heya!

Good evening, thanks for taking the time to respond.

> > We then went back and tested the 3.4.18 kernel and with both xm and xl
> > the guest faults on the first attempt to do an I/O port access.  All
> > factors (windows image, hardware, xen guest config) are held identical
> > so the difference would seem to be linked to the PCI passthrough
> > implementation between the two kernels.  I've copied Konrad on the
> > note since he would seem to be the person most familiar with this
> > area.
> > 
> > I'm including below a diff between a successful qemu-dm passthrough
> > session (2.6.32.45) and an unsuccessful session (3.4.18).  It would
> > appear 3.4.18 is getting the both the I/O port and memory ranges
> > wrong.

I was going to get an update back to everyone but got swamped by the
holiday weekend and a series of hardware failures I had to chase
after.

I took advantage of some time over the holiday weekend to chase down
the passthrough problems and now have it working well on 4.2.0 on all
kernels up to 3.4.19 using XM.  The original ATI patches have a bug in
them which causes qemu-dm to core dump on kernels somewhere after
2.6.32.x.

The original patches were bracketing the inb/outb instructions used in
ati_hw_read()/ati_hw_write with an ioperm() call.  The fix was a
straight forward replacement of the ioperm() call with a call to
iopl(3).

I seem to vaguely remember something about the kernel not properly
enforcing access controlls on in/out instructions but don't remember
if that was with a pvops or standard kernel.  In any event the kernel
behavior changed after 2.6.32.x which triggered the breakage.

I will post an updated version of the ATI patches under separate cover
in case anytone else is using them.

> Hm, can you also provide the 'lspci -vvv' with the 2.6.32.45 and
> 3.4.18 kernel?
>
> I am specifically looking to see if there are any:
> 
> [from git commit c341ca45ce56143804ef5a8f4db753e554e640b4]
> Author: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Date:   Tue Sep 25 16:48:24 2012 -0400
> 
>    
> 	.. snip.. 
>     -       Region 0: [virtual] Memory at fe8c0000 (32-bit, non-prefetchable) [size=128K]
>     -       Region 1: [virtual] Memory at fe800000 (32-bit, non-prefetchable) [size=512K]
>     +       Region 0: Memory at fe8c0000 (32-bit, non-prefetchable) [size=128K]
>     +       Region 1: Memory at fe800000 (32-bit, non-prefetchable) [size=512K]
>             Region 2: I/O ports at c000 [size=32]
>     -       Region 3: [virtual] Memory at fe8e0000 (32-bit, non-prefetchable) [size=16K]
>     +       Region 3: Memory at fe8e0000 (32-bit, non-prefetchable) [size=16K]

>     The [virtual] means that lspci read those entries from SysFS but when
>     it read them from the device it got a different value (0xfffffff).
>
> Any of those '[virtual]' ones? And how are you reserving the PCI devices?
> Are you using xen-pciback.hide on the Linux command line?
> 
> Does 'xm dmesg' give you an logs? Do the logs have any warnings?

We were under some time constraints to get Windows access back working
with a 'modern' kernel so once things were working reliably with xm I
didn't get a chance to fiddle with xl.  Given the behavior I saw on
2.6.32.x with xl I'm suspicious it may not work.  I'm hoping to get
back and do some testing early next week.

I just checked the machine (which is running a Windows session as I
write this) and dont see any [virtual] references.  This is on 3.4.18
but I also haven't had the chance to check xl on that kernel.  At
least a couple of hundred Windows 7 boots have been done with xm so
4.2.0 seems solid with that control plane.

With respect to reservation of the PCI device we have a script which
unplugs the device and re-plugs it after the Window session
completes.  The machines are Linux/Windows dual-use so the cards need
to be active for the Linux sessions.

The script can be picked up at the following location:

	ftp://ftp.enjellic.com/pub/xen/run-passthrough

I will give xl a try later in the weekend with the updated qemu-dm and
I will report back the results from a more throroughly controlled test
environment.

Thanks for the input, have a good weekend.

Greg

}-- End of excerpt from Konrad Rzeszutek Wilk

As always,
Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
4206 N. 19th Ave.           Specializing in information infra-structure
Fargo, ND  58102            development.
PH: 701-281-1686
FAX: 701-281-3949           EMAIL: greg@enjellic.com
------------------------------------------------------------------------------
"Not only is this incomprehensible, but the ink is ugly and the paper
 is from the wrong kind of tree."
                                -- Professor W.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 01:25:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 01:25:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeFLx-0002DJ-5P; Fri, 30 Nov 2012 01:25:17 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg@wind.enjellic.com>) id 1TeFLv-0002DE-Sn
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 01:25:16 +0000
Received: from [193.109.254.147:2437] by server-8.bemta-14.messagelabs.com id
	64/AF-05026-BFA08B05; Fri, 30 Nov 2012 01:25:15 +0000
X-Env-Sender: greg@wind.enjellic.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1354238708!6425160!1
X-Originating-IP: [76.10.64.91]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8604 invoked from network); 30 Nov 2012 01:25:08 -0000
Received: from wind.enjellic.com (HELO wind.enjellic.com) (76.10.64.91)
	by server-5.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 01:25:08 -0000
Received: from wind.enjellic.com (localhost [127.0.0.1])
	by wind.enjellic.com (8.14.3/8.14.3) with ESMTP id qAU1P2Yc031055;
	Thu, 29 Nov 2012 19:25:02 -0600
Received: (from greg@localhost)
	by wind.enjellic.com (8.14.3/8.14.3/Submit) id qAU1P143031054;
	Thu, 29 Nov 2012 19:25:01 -0600
Date: Thu, 29 Nov 2012 19:25:01 -0600
From: "Dr. Greg Wettstein" <greg@wind.enjellic.com>
Message-Id: <201211300125.qAU1P143031054@wind.enjellic.com>
In-Reply-To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
	"Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the
	virtual machine created by xl command?" (Nov 28, 4:04pm)
X-Mailer: Mail User's Shell (7.2.6-ESD1.0 03/31/2012)
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.3
	(wind.enjellic.com [0.0.0.0]);
	Thu, 29 Nov 2012 19:25:02 -0600 (CST)
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>, Qian Hu <qianhu2011@gmail.com>
Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the
	virtual machine created by xl command?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: greg@enjellic.com
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Nov 28,  4:04pm, Konrad Rzeszutek Wilk wrote:
} Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the v

> On Sat, Nov 17, 2012 at 09:17:36AM -0600, Dr. Greg Wettstein wrote:
> > On Nov 14,  3:40pm, "Dr. Greg Wettstein" wrote:
> > } Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the v
> > 
> > Good morning, hope the day is going well for everyone.

> Heya!

Good evening, thanks for taking the time to respond.

> > We then went back and tested the 3.4.18 kernel and with both xm and xl
> > the guest faults on the first attempt to do an I/O port access.  All
> > factors (windows image, hardware, xen guest config) are held identical
> > so the difference would seem to be linked to the PCI passthrough
> > implementation between the two kernels.  I've copied Konrad on the
> > note since he would seem to be the person most familiar with this
> > area.
> > 
> > I'm including below a diff between a successful qemu-dm passthrough
> > session (2.6.32.45) and an unsuccessful session (3.4.18).  It would
> > appear 3.4.18 is getting the both the I/O port and memory ranges
> > wrong.

I was going to get an update back to everyone but got swamped by the
holiday weekend and a series of hardware failures I had to chase
after.

I took advantage of some time over the holiday weekend to chase down
the passthrough problems and now have it working well on 4.2.0 on all
kernels up to 3.4.19 using XM.  The original ATI patches have a bug in
them which causes qemu-dm to core dump on kernels somewhere after
2.6.32.x.

The original patches were bracketing the inb/outb instructions used in
ati_hw_read()/ati_hw_write with an ioperm() call.  The fix was a
straight forward replacement of the ioperm() call with a call to
iopl(3).

I seem to vaguely remember something about the kernel not properly
enforcing access controlls on in/out instructions but don't remember
if that was with a pvops or standard kernel.  In any event the kernel
behavior changed after 2.6.32.x which triggered the breakage.

I will post an updated version of the ATI patches under separate cover
in case anytone else is using them.

> Hm, can you also provide the 'lspci -vvv' with the 2.6.32.45 and
> 3.4.18 kernel?
>
> I am specifically looking to see if there are any:
> 
> [from git commit c341ca45ce56143804ef5a8f4db753e554e640b4]
> Author: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Date:   Tue Sep 25 16:48:24 2012 -0400
> 
>    
> 	.. snip.. 
>     -       Region 0: [virtual] Memory at fe8c0000 (32-bit, non-prefetchable) [size=128K]
>     -       Region 1: [virtual] Memory at fe800000 (32-bit, non-prefetchable) [size=512K]
>     +       Region 0: Memory at fe8c0000 (32-bit, non-prefetchable) [size=128K]
>     +       Region 1: Memory at fe800000 (32-bit, non-prefetchable) [size=512K]
>             Region 2: I/O ports at c000 [size=32]
>     -       Region 3: [virtual] Memory at fe8e0000 (32-bit, non-prefetchable) [size=16K]
>     +       Region 3: Memory at fe8e0000 (32-bit, non-prefetchable) [size=16K]

>     The [virtual] means that lspci read those entries from SysFS but when
>     it read them from the device it got a different value (0xfffffff).
>
> Any of those '[virtual]' ones? And how are you reserving the PCI devices?
> Are you using xen-pciback.hide on the Linux command line?
> 
> Does 'xm dmesg' give you an logs? Do the logs have any warnings?

We were under some time constraints to get Windows access back working
with a 'modern' kernel so once things were working reliably with xm I
didn't get a chance to fiddle with xl.  Given the behavior I saw on
2.6.32.x with xl I'm suspicious it may not work.  I'm hoping to get
back and do some testing early next week.

I just checked the machine (which is running a Windows session as I
write this) and dont see any [virtual] references.  This is on 3.4.18
but I also haven't had the chance to check xl on that kernel.  At
least a couple of hundred Windows 7 boots have been done with xm so
4.2.0 seems solid with that control plane.

With respect to reservation of the PCI device we have a script which
unplugs the device and re-plugs it after the Window session
completes.  The machines are Linux/Windows dual-use so the cards need
to be active for the Linux sessions.

The script can be picked up at the following location:

	ftp://ftp.enjellic.com/pub/xen/run-passthrough

I will give xl a try later in the weekend with the updated qemu-dm and
I will report back the results from a more throroughly controlled test
environment.

Thanks for the input, have a good weekend.

Greg

}-- End of excerpt from Konrad Rzeszutek Wilk

As always,
Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
4206 N. 19th Ave.           Specializing in information infra-structure
Fargo, ND  58102            development.
PH: 701-281-1686
FAX: 701-281-3949           EMAIL: greg@enjellic.com
------------------------------------------------------------------------------
"Not only is this incomprehensible, but the ink is ugly and the paper
 is from the wrong kind of tree."
                                -- Professor W.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 01:53:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 01:53:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeFmU-0002lE-IB; Fri, 30 Nov 2012 01:52:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg.zapp@gmail.com>) id 1TeFmS-0002l9-RG
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 01:52:41 +0000
Received: from [85.158.138.51:59346] by server-1.bemta-3.messagelabs.com id
	69/F1-12169-36118B05; Fri, 30 Nov 2012 01:52:35 +0000
X-Env-Sender: greg.zapp@gmail.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1354240352!23202109!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8303 invoked from network); 30 Nov 2012 01:52:34 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 01:52:34 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so18912741vbi.32
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 17:52:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=gypRukuy7jtzvezWDI3ZBGBc3tQ4kExpapJ/QdoijRY=;
	b=M7hPNIJSbb+ymHh8kJYYgzu1zmNhpnYwvVBdOieeNVSP8hp1bGh/Pgz3ogZbk4yYDs
	8ZW2gT8xkXfAkp2Whnm4+19FRYjZyMND72MUff9Wcw2OIrK9kX2pisGWGWQLIVnX/gK1
	+336FqHx52NdoBOAFVEWnAW9kyvOOCDphsHcOZdnZASHBe2Ksl5saTy/qL/ft0iOmy5Y
	1/OpoXSEnF00LyhP2oeEeBC4w8ZhyynZezYPLo/tUUnEIY/+/h+kNBUuGYQxuk3XLhib
	zai4qAKadsm/YQszyqq0eGRW3kxBRbkyQ/Pgt2SAhyWIgW4BKc3lf3FLh7WTckWump+g
	1Q5w==
MIME-Version: 1.0
Received: by 10.52.179.2 with SMTP id dc2mr29324364vdc.50.1354240352549; Thu,
	29 Nov 2012 17:52:32 -0800 (PST)
Received: by 10.58.128.37 with HTTP; Thu, 29 Nov 2012 17:52:32 -0800 (PST)
In-Reply-To: <CAEHxbC1pHuRc6Gb_CCWqixN-X5i_8TBabSqanS21ugLCgZ3ekg@mail.gmail.com>
References: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
	<20121129150736.GH8912@reaktio.net>
	<CAEHxbC1gG5RR9h9odxx59BZm2+SUdoGuwZc8Sco_yNtxVwod=Q@mail.gmail.com>
	<20121129231522.GK8912@reaktio.net>
	<CAEHxbC1pHuRc6Gb_CCWqixN-X5i_8TBabSqanS21ugLCgZ3ekg@mail.gmail.com>
Date: Fri, 30 Nov 2012 14:52:32 +1300
Message-ID: <CAEHxbC1ns+rjOMZiPt-8h-UNsjK3z4pWJaSr2TNvsL-4Ka1d+Q@mail.gmail.com>
From: Greg Zapp <greg.zapp@gmail.com>
To: =?ISO-8859-1?Q?Pasi_K=E4rkk=E4inen?= <pasik@iki.fi>
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Enabling NLB is crashing VM's/DRBD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8690086564215213103=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============8690086564215213103==
Content-Type: multipart/alternative; boundary=bcaec5014a43277a3104cfaca764

--bcaec5014a43277a3104cfaca764
Content-Type: text/plain; charset=ISO-8859-1

Looks like these are the same errors as referenced in here:
http://old-list-archives.xen.org/archives/html/xen-devel/2011-04/msg00453.html.
 It's indicated in that trouble could be triggered from the netback
code.  If so, I'm curious if some combination of the number of HVM guests
running and the re-connecting of the network adapter could be triggering
the issue?

On Fri, Nov 30, 2012 at 1:29 PM, Greg Zapp <greg.zapp@gmail.com> wrote:

> Looks like I have GPLPV 0.10.0.135 packaged in(according to the
> changelog).  I'm using the Univention signed drivers.
>
> As for that error, you may be on to something.  I'm not sure when those
> errors came up as there are no time stamps in the output from 'xm dmesg'.
> However, I only see those errors on nodA, which is the node with the VM's
> that crashed.
>

--bcaec5014a43277a3104cfaca764
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Looks like these are the same errors as referenced in here: <a href=3D"http=
://old-list-archives.xen.org/archives/html/xen-devel/2011-04/msg00453.html"=
>http://old-list-archives.xen.org/archives/html/xen-devel/2011-04/msg00453.=
html</a> .=A0 It&#39;s indicated in that trouble could be triggered from th=
e netback code.=A0 If so, I&#39;m curious if some combination of the number=
 of HVM guests running and the re-connecting of the network adapter could b=
e triggering the issue?<br>
<br><div class=3D"gmail_quote">On Fri, Nov 30, 2012 at 1:29 PM, Greg Zapp <=
span dir=3D"ltr">&lt;<a href=3D"mailto:greg.zapp@gmail.com" target=3D"_blan=
k">greg.zapp@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_=
quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1=
ex">
Looks like I have GPLPV 0.10.0.135 packaged in(according to the changelog).=
=A0 I&#39;m using the Univention signed drivers.<br><br>As for that error, =
you may be on to something.=A0 I&#39;m not sure when those errors came up a=
s there are no time stamps in the output from &#39;xm dmesg&#39;.=A0 Howeve=
r, I only see those errors on nodA, which is the node with the VM&#39;s tha=
t crashed.<br>


</blockquote></div><br>

--bcaec5014a43277a3104cfaca764--


--===============8690086564215213103==
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.xen.org
http://lists.xen.org/xen-devel

--===============8690086564215213103==--


From xen-devel-bounces@lists.xen.org Fri Nov 30 01:53:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 01:53:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeFmU-0002lE-IB; Fri, 30 Nov 2012 01:52:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <greg.zapp@gmail.com>) id 1TeFmS-0002l9-RG
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 01:52:41 +0000
Received: from [85.158.138.51:59346] by server-1.bemta-3.messagelabs.com id
	69/F1-12169-36118B05; Fri, 30 Nov 2012 01:52:35 +0000
X-Env-Sender: greg.zapp@gmail.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1354240352!23202109!1
X-Originating-IP: [209.85.212.45]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	ML_RADAR_SPEW_LINKS_14,RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8303 invoked from network); 30 Nov 2012 01:52:34 -0000
Received: from mail-vb0-f45.google.com (HELO mail-vb0-f45.google.com)
	(209.85.212.45)
	by server-7.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 01:52:34 -0000
Received: by mail-vb0-f45.google.com with SMTP id p1so18912741vbi.32
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 17:52:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=gypRukuy7jtzvezWDI3ZBGBc3tQ4kExpapJ/QdoijRY=;
	b=M7hPNIJSbb+ymHh8kJYYgzu1zmNhpnYwvVBdOieeNVSP8hp1bGh/Pgz3ogZbk4yYDs
	8ZW2gT8xkXfAkp2Whnm4+19FRYjZyMND72MUff9Wcw2OIrK9kX2pisGWGWQLIVnX/gK1
	+336FqHx52NdoBOAFVEWnAW9kyvOOCDphsHcOZdnZASHBe2Ksl5saTy/qL/ft0iOmy5Y
	1/OpoXSEnF00LyhP2oeEeBC4w8ZhyynZezYPLo/tUUnEIY/+/h+kNBUuGYQxuk3XLhib
	zai4qAKadsm/YQszyqq0eGRW3kxBRbkyQ/Pgt2SAhyWIgW4BKc3lf3FLh7WTckWump+g
	1Q5w==
MIME-Version: 1.0
Received: by 10.52.179.2 with SMTP id dc2mr29324364vdc.50.1354240352549; Thu,
	29 Nov 2012 17:52:32 -0800 (PST)
Received: by 10.58.128.37 with HTTP; Thu, 29 Nov 2012 17:52:32 -0800 (PST)
In-Reply-To: <CAEHxbC1pHuRc6Gb_CCWqixN-X5i_8TBabSqanS21ugLCgZ3ekg@mail.gmail.com>
References: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
	<20121129150736.GH8912@reaktio.net>
	<CAEHxbC1gG5RR9h9odxx59BZm2+SUdoGuwZc8Sco_yNtxVwod=Q@mail.gmail.com>
	<20121129231522.GK8912@reaktio.net>
	<CAEHxbC1pHuRc6Gb_CCWqixN-X5i_8TBabSqanS21ugLCgZ3ekg@mail.gmail.com>
Date: Fri, 30 Nov 2012 14:52:32 +1300
Message-ID: <CAEHxbC1ns+rjOMZiPt-8h-UNsjK3z4pWJaSr2TNvsL-4Ka1d+Q@mail.gmail.com>
From: Greg Zapp <greg.zapp@gmail.com>
To: =?ISO-8859-1?Q?Pasi_K=E4rkk=E4inen?= <pasik@iki.fi>
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Enabling NLB is crashing VM's/DRBD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8690086564215213103=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============8690086564215213103==
Content-Type: multipart/alternative; boundary=bcaec5014a43277a3104cfaca764

--bcaec5014a43277a3104cfaca764
Content-Type: text/plain; charset=ISO-8859-1

Looks like these are the same errors as referenced in here:
http://old-list-archives.xen.org/archives/html/xen-devel/2011-04/msg00453.html.
 It's indicated in that trouble could be triggered from the netback
code.  If so, I'm curious if some combination of the number of HVM guests
running and the re-connecting of the network adapter could be triggering
the issue?

On Fri, Nov 30, 2012 at 1:29 PM, Greg Zapp <greg.zapp@gmail.com> wrote:

> Looks like I have GPLPV 0.10.0.135 packaged in(according to the
> changelog).  I'm using the Univention signed drivers.
>
> As for that error, you may be on to something.  I'm not sure when those
> errors came up as there are no time stamps in the output from 'xm dmesg'.
> However, I only see those errors on nodA, which is the node with the VM's
> that crashed.
>

--bcaec5014a43277a3104cfaca764
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Looks like these are the same errors as referenced in here: <a href=3D"http=
://old-list-archives.xen.org/archives/html/xen-devel/2011-04/msg00453.html"=
>http://old-list-archives.xen.org/archives/html/xen-devel/2011-04/msg00453.=
html</a> .=A0 It&#39;s indicated in that trouble could be triggered from th=
e netback code.=A0 If so, I&#39;m curious if some combination of the number=
 of HVM guests running and the re-connecting of the network adapter could b=
e triggering the issue?<br>
<br><div class=3D"gmail_quote">On Fri, Nov 30, 2012 at 1:29 PM, Greg Zapp <=
span dir=3D"ltr">&lt;<a href=3D"mailto:greg.zapp@gmail.com" target=3D"_blan=
k">greg.zapp@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_=
quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1=
ex">
Looks like I have GPLPV 0.10.0.135 packaged in(according to the changelog).=
=A0 I&#39;m using the Univention signed drivers.<br><br>As for that error, =
you may be on to something.=A0 I&#39;m not sure when those errors came up a=
s there are no time stamps in the output from &#39;xm dmesg&#39;.=A0 Howeve=
r, I only see those errors on nodA, which is the node with the VM&#39;s tha=
t crashed.<br>


</blockquote></div><br>

--bcaec5014a43277a3104cfaca764--


--===============8690086564215213103==
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.xen.org
http://lists.xen.org/xen-devel

--===============8690086564215213103==--


From xen-devel-bounces@lists.xen.org Fri Nov 30 01:54:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 01:54:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeFo1-0002pS-29; Fri, 30 Nov 2012 01:54:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jun.nakajima@intel.com>) id 1TeFnz-0002pK-5g
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 01:54:15 +0000
Received: from [85.158.139.83:8103] by server-2.bemta-5.messagelabs.com id
	A0/43-04892-6C118B05; Fri, 30 Nov 2012 01:54:14 +0000
X-Env-Sender: jun.nakajima@intel.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1354240451!27993726!1
X-Originating-IP: [134.134.136.21]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18269 invoked from network); 30 Nov 2012 01:54:13 -0000
Received: from mga06.intel.com (HELO orsmga101.jf.intel.com) (134.134.136.21)
	by server-10.tower-182.messagelabs.com with SMTP;
	30 Nov 2012 01:54:13 -0000
Received: from mail-vb0-f69.google.com ([209.85.212.69])
	by mga02.intel.com with ESMTP/TLS/RC4-SHA; 29 Nov 2012 17:54:10 -0800
Received: by mail-vb0-f69.google.com with SMTP id fn1so20636561vbb.8
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 17:54:08 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=xuzKBMzQLYBCGPWfLyqPT4EGjwNZR0QfchHDUtCcXoU=;
	b=AhcG+cN9gu/Jd/s1xiOHin8w0qbe63GtvHcaxP2xhaEut8joUUlSuHP29l1CJ+13do
	8DagW6EYKamckpIIxTEPvTiBNEP37XWuAYTHy4XiaP4GqqB+orpVx1DTFMhFlIoij3GI
	qAaQts10a0i4A/q7XQvMyGa6QYTvFfDKGpj7bdNWVYvuYWY+rv6NU3dTwQKhTFTXvetz
	92kftFqfOUXKVXmbpDFb259VULLKkdzFTLutYoJMQdIGiEki6A9TmaGxD9KHYAAnO6bi
	POGv7TTbtk/QDs85AfJEnuavVX/rGzkwuoNVd9qZ/NF7WdycvrMsnOpglws/1y64a5yN
	rixw==
Received: by 10.224.71.16 with SMTP id f16mr693577qaj.45.1354240448042;
	Thu, 29 Nov 2012 17:54:08 -0800 (PST)
MIME-Version: 1.0
Received: by 10.224.71.16 with SMTP id f16mr693569qaj.45.1354240447961; Thu,
	29 Nov 2012 17:54:07 -0800 (PST)
Received: by 10.229.27.148 with HTTP; Thu, 29 Nov 2012 17:54:07 -0800 (PST)
In-Reply-To: <50B5F0B102000078000AC172@nat28.tlf.novell.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
	<50B5F0B102000078000AC172@nat28.tlf.novell.com>
Date: Thu, 29 Nov 2012 17:54:07 -0800
Message-ID: <CAL54oT0BCcBC+NND_DBXuDgNPJHTFCGjxHQqH30HjFCHic+RVA@mail.gmail.com>
From: "Nakajima, Jun" <jun.nakajima@intel.com>
To: Jan Beulich <JBeulich@suse.com>
X-Gm-Message-State: ALoCoQnPz0XFLJeG65UF+8+FCZTaVKMTU8hurnMFESEvFF+fayRsWXxTBmIaV9oeipVY5s2LxcoIK6sSaAuvmPBoMKQMy9Lwiiw0rT9HbxujNljVy6tyKg7LGLJLc2rheI1qsgpDsJAR/z18zftb2NLu89D+gddOow==
Cc: Dongxiao Xu <dongxiao.xu@intel.com>, Eddie Dong <eddie.dong@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 0/9] nested vmx: expose some vmx features to
 L1 VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 2:08 AM, Jan Beulich <JBeulich@suse.com> wrote:
>
> >>> On 28.11.12 at 08:11, Dongxiao Xu <dongxiao.xu@intel.com> wrote:
> > This patch series expose some vmx features to L1 VMM, including MTF,
> > NMI-window exiting, etc.
> > Please help to review and pull.
>
> Looks reasonable to me, but clearly wants to be acked by at
> least one of the formally listed VMX maintainers.

Ack.

>
> Jan
>
> > Dongxiao Xu (9):
> >   nested vmx: enable Monitor Trap Flag for L1 VMM
> >   nested vmx: enable NMI-window exiting for L1 VMM
> >   nested vmx: enable secondary processor-based VM-Execution controls
> >   nested vmx: enable Descriptor-table exiting for L1 VMM
> >   nested vmx: enable VMX-preemption timer for L1 VMM
> >   nested vmx: enable save VMX-preemption timer feature for L1 VMM
> >   nested vmx: enable load and save IA32_PAT feature for L1 VMM
> >   nested vmx: enable load and save IA32_EFER feature for L1 VMM
> >   nested vmx: enable load IA32_PERF_GLOBAL_CTRL feature for L1 VMM
> >
> >  xen/arch/x86/hvm/vmx/vmx.c         |    2 +-
> >  xen/arch/x86/hvm/vmx/vvmx.c        |  108
> > +++++++++++++++++++++++++++++++-----
> >  xen/include/asm-x86/hvm/vmx/vmcs.h |   12 ++++
> >  xen/include/asm-x86/hvm/vmx/vmx.h  |    1 +
> >  4 files changed, 108 insertions(+), 15 deletions(-)
> >

--
Jun
Intel Open Source Technology Center

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 01:54:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 01:54:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeFo1-0002pS-29; Fri, 30 Nov 2012 01:54:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jun.nakajima@intel.com>) id 1TeFnz-0002pK-5g
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 01:54:15 +0000
Received: from [85.158.139.83:8103] by server-2.bemta-5.messagelabs.com id
	A0/43-04892-6C118B05; Fri, 30 Nov 2012 01:54:14 +0000
X-Env-Sender: jun.nakajima@intel.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1354240451!27993726!1
X-Originating-IP: [134.134.136.21]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18269 invoked from network); 30 Nov 2012 01:54:13 -0000
Received: from mga06.intel.com (HELO orsmga101.jf.intel.com) (134.134.136.21)
	by server-10.tower-182.messagelabs.com with SMTP;
	30 Nov 2012 01:54:13 -0000
Received: from mail-vb0-f69.google.com ([209.85.212.69])
	by mga02.intel.com with ESMTP/TLS/RC4-SHA; 29 Nov 2012 17:54:10 -0800
Received: by mail-vb0-f69.google.com with SMTP id fn1so20636561vbb.8
	for <xen-devel@lists.xen.org>; Thu, 29 Nov 2012 17:54:08 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=xuzKBMzQLYBCGPWfLyqPT4EGjwNZR0QfchHDUtCcXoU=;
	b=AhcG+cN9gu/Jd/s1xiOHin8w0qbe63GtvHcaxP2xhaEut8joUUlSuHP29l1CJ+13do
	8DagW6EYKamckpIIxTEPvTiBNEP37XWuAYTHy4XiaP4GqqB+orpVx1DTFMhFlIoij3GI
	qAaQts10a0i4A/q7XQvMyGa6QYTvFfDKGpj7bdNWVYvuYWY+rv6NU3dTwQKhTFTXvetz
	92kftFqfOUXKVXmbpDFb259VULLKkdzFTLutYoJMQdIGiEki6A9TmaGxD9KHYAAnO6bi
	POGv7TTbtk/QDs85AfJEnuavVX/rGzkwuoNVd9qZ/NF7WdycvrMsnOpglws/1y64a5yN
	rixw==
Received: by 10.224.71.16 with SMTP id f16mr693577qaj.45.1354240448042;
	Thu, 29 Nov 2012 17:54:08 -0800 (PST)
MIME-Version: 1.0
Received: by 10.224.71.16 with SMTP id f16mr693569qaj.45.1354240447961; Thu,
	29 Nov 2012 17:54:07 -0800 (PST)
Received: by 10.229.27.148 with HTTP; Thu, 29 Nov 2012 17:54:07 -0800 (PST)
In-Reply-To: <50B5F0B102000078000AC172@nat28.tlf.novell.com>
References: <1354086724-1959-1-git-send-email-dongxiao.xu@intel.com>
	<50B5F0B102000078000AC172@nat28.tlf.novell.com>
Date: Thu, 29 Nov 2012 17:54:07 -0800
Message-ID: <CAL54oT0BCcBC+NND_DBXuDgNPJHTFCGjxHQqH30HjFCHic+RVA@mail.gmail.com>
From: "Nakajima, Jun" <jun.nakajima@intel.com>
To: Jan Beulich <JBeulich@suse.com>
X-Gm-Message-State: ALoCoQnPz0XFLJeG65UF+8+FCZTaVKMTU8hurnMFESEvFF+fayRsWXxTBmIaV9oeipVY5s2LxcoIK6sSaAuvmPBoMKQMy9Lwiiw0rT9HbxujNljVy6tyKg7LGLJLc2rheI1qsgpDsJAR/z18zftb2NLu89D+gddOow==
Cc: Dongxiao Xu <dongxiao.xu@intel.com>, Eddie Dong <eddie.dong@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 0/9] nested vmx: expose some vmx features to
 L1 VMM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 2:08 AM, Jan Beulich <JBeulich@suse.com> wrote:
>
> >>> On 28.11.12 at 08:11, Dongxiao Xu <dongxiao.xu@intel.com> wrote:
> > This patch series expose some vmx features to L1 VMM, including MTF,
> > NMI-window exiting, etc.
> > Please help to review and pull.
>
> Looks reasonable to me, but clearly wants to be acked by at
> least one of the formally listed VMX maintainers.

Ack.

>
> Jan
>
> > Dongxiao Xu (9):
> >   nested vmx: enable Monitor Trap Flag for L1 VMM
> >   nested vmx: enable NMI-window exiting for L1 VMM
> >   nested vmx: enable secondary processor-based VM-Execution controls
> >   nested vmx: enable Descriptor-table exiting for L1 VMM
> >   nested vmx: enable VMX-preemption timer for L1 VMM
> >   nested vmx: enable save VMX-preemption timer feature for L1 VMM
> >   nested vmx: enable load and save IA32_PAT feature for L1 VMM
> >   nested vmx: enable load and save IA32_EFER feature for L1 VMM
> >   nested vmx: enable load IA32_PERF_GLOBAL_CTRL feature for L1 VMM
> >
> >  xen/arch/x86/hvm/vmx/vmx.c         |    2 +-
> >  xen/arch/x86/hvm/vmx/vvmx.c        |  108
> > +++++++++++++++++++++++++++++++-----
> >  xen/include/asm-x86/hvm/vmx/vmcs.h |   12 ++++
> >  xen/include/asm-x86/hvm/vmx/vmx.h  |    1 +
> >  4 files changed, 108 insertions(+), 15 deletions(-)
> >

--
Jun
Intel Open Source Technology Center

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 02:39:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 02:39:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeGVF-0003uQ-Kp; Fri, 30 Nov 2012 02:38:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TeGVD-0003uL-E3
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 02:38:55 +0000
Received: from [85.158.137.99:64450] by server-11.bemta-3.messagelabs.com id
	10/F1-19361-E3C18B05; Fri, 30 Nov 2012 02:38:54 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1354243132!14920760!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODYyMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23060 invoked from network); 30 Nov 2012 02:38:53 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-15.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 02:38:53 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAU2cmir001474
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 30 Nov 2012 02:38:51 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAU2clRu000373
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 30 Nov 2012 02:38:48 GMT
Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAU2cl3X011895; Thu, 29 Nov 2012 20:38:47 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 29 Nov 2012 18:38:47 -0800
Date: Thu, 29 Nov 2012 18:38:45 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: "Jan Beulich" <JBeulich@suse.com>
Message-ID: <20121129183845.09589b87@mantra.us.oracle.com>
In-Reply-To: <50B71CB202000078000AC5D1@nat28.tlf.novell.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
	<20121128175039.62112c96@mantra.us.oracle.com>
	<50B71CB202000078000AC5D1@nat28.tlf.novell.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 29 Nov 2012 07:28:34 +0000
"Jan Beulich" <JBeulich@suse.com> wrote:

> >>> On 29.11.12 at 02:50, Mukesh Rathor <mukesh.rathor@oracle.com>
> >>> wrote:
> > On Wed, 28 Nov 2012 08:24:04 +0000
> > "Jan Beulich" <JBeulich@suse.com> wrote:
> > 
> >> >>> On 27.11.12 at 22:31, Konrad Rzeszutek Wilk
> >> >>> <konrad.wilk@oracle.com> wrote:
> >> > Mukesh Rathor (6):
> >> >       xen/pvh: Support ParaVirtualized Hardware extensions.
> >> >       xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
> >> >       xen/pvh: Implement MMU changes for PVH.
> >> >       xen/pvh: bootup and setup (E820) related changes.
> >> >       xen/pvh: balloon and grant changes.
> >> >       xen/pvh: /dev/xen/privcmd changes.
> >> 
> >> As said before - I don't think it is a good idea to push the kernel
> >> side changes into an official release when the hypervisor side ones
> >> didn't even get an initial review yet.
> > 
> > On the xen patch side, I've refrshed my tree. I realized I had
> > undone the union of pv_domain and hvm_domain since I used fields
> > from both. I'm now redoing that to make that a union and add a
> > struct in hvm_domain for fields from pv_domain that are used by
> > PVH. 
> 
> Perhaps better to move out of the union just the shared fields?
> 

Well, not sure which is better. Those fields are not many, and only used
by PVH and not HVM. So, for now I just put it part of hvm_vcpu.
That way it's less confusing and obvious to anyone reading the code or
debugging. BTW, earlier I meant pv/hvm_vcpu and not pv/hvm_domain. If
it makes struct size smaller I could create pv_pvh_vcpu {} and put
those fields there, but that involves lot of unnecessary code changes.

thanks
mukesh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 02:39:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 02:39:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeGVF-0003uQ-Kp; Fri, 30 Nov 2012 02:38:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mukesh.rathor@oracle.com>) id 1TeGVD-0003uL-E3
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 02:38:55 +0000
Received: from [85.158.137.99:64450] by server-11.bemta-3.messagelabs.com id
	10/F1-19361-E3C18B05; Fri, 30 Nov 2012 02:38:54 +0000
X-Env-Sender: mukesh.rathor@oracle.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1354243132!14920760!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODYyMTQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23060 invoked from network); 30 Nov 2012 02:38:53 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-15.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 02:38:53 -0000
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAU2cmir001474
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 30 Nov 2012 02:38:51 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAU2clRu000373
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 30 Nov 2012 02:38:48 GMT
Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAU2cl3X011895; Thu, 29 Nov 2012 20:38:47 -0600
Received: from mantra.us.oracle.com (/130.35.68.95)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Thu, 29 Nov 2012 18:38:47 -0800
Date: Thu, 29 Nov 2012 18:38:45 -0800
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: "Jan Beulich" <JBeulich@suse.com>
Message-ID: <20121129183845.09589b87@mantra.us.oracle.com>
In-Reply-To: <50B71CB202000078000AC5D1@nat28.tlf.novell.com>
References: <20121127213143.GB13890@phenom.dumpdata.com>
	<50B5D83402000078000ABFF1@nat28.tlf.novell.com>
	<20121128175039.62112c96@mantra.us.oracle.com>
	<50B71CB202000078000AC5D1@nat28.tlf.novell.com>
Organization: Oracle Corporation
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Patches for v3.8
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 29 Nov 2012 07:28:34 +0000
"Jan Beulich" <JBeulich@suse.com> wrote:

> >>> On 29.11.12 at 02:50, Mukesh Rathor <mukesh.rathor@oracle.com>
> >>> wrote:
> > On Wed, 28 Nov 2012 08:24:04 +0000
> > "Jan Beulich" <JBeulich@suse.com> wrote:
> > 
> >> >>> On 27.11.12 at 22:31, Konrad Rzeszutek Wilk
> >> >>> <konrad.wilk@oracle.com> wrote:
> >> > Mukesh Rathor (6):
> >> >       xen/pvh: Support ParaVirtualized Hardware extensions.
> >> >       xen/pvh: Extend vcpu_guest_context, p2m, event, and XenBus.
> >> >       xen/pvh: Implement MMU changes for PVH.
> >> >       xen/pvh: bootup and setup (E820) related changes.
> >> >       xen/pvh: balloon and grant changes.
> >> >       xen/pvh: /dev/xen/privcmd changes.
> >> 
> >> As said before - I don't think it is a good idea to push the kernel
> >> side changes into an official release when the hypervisor side ones
> >> didn't even get an initial review yet.
> > 
> > On the xen patch side, I've refrshed my tree. I realized I had
> > undone the union of pv_domain and hvm_domain since I used fields
> > from both. I'm now redoing that to make that a union and add a
> > struct in hvm_domain for fields from pv_domain that are used by
> > PVH. 
> 
> Perhaps better to move out of the union just the shared fields?
> 

Well, not sure which is better. Those fields are not many, and only used
by PVH and not HVM. So, for now I just put it part of hvm_vcpu.
That way it's less confusing and obvious to anyone reading the code or
debugging. BTW, earlier I meant pv/hvm_vcpu and not pv/hvm_domain. If
it makes struct size smaller I could create pv_pvh_vcpu {} and put
those fields there, but that involves lot of unnecessary code changes.

thanks
mukesh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 03:08:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 03:08:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeGxZ-0004Vk-B9; Fri, 30 Nov 2012 03:08:13 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TeGxX-0004Vf-C8
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 03:08:11 +0000
Received: from [193.109.254.147:63919] by server-9.bemta-14.messagelabs.com id
	7B/F6-30773-A1328B05; Fri, 30 Nov 2012 03:08:10 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1354244887!3200949!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4OTUwMA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16779 invoked from network); 30 Nov 2012 03:08:08 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-6.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 03:08:08 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 29 Nov 2012 19:08:06 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,189,1355126400"; d="scan'208";a="255364845"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by fmsmga001.fm.intel.com with ESMTP; 29 Nov 2012 19:08:06 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 29 Nov 2012 19:08:05 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Fri, 30 Nov 2012 11:08:02 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thread-Topic: [PATCH V1 1/2] Xen acpi memory hotplug driver
Thread-Index: AQHNzZ49ARZC8Pre50KuGp78qorc1ZgBk0jw
Date: Fri, 30 Nov 2012 03:08:02 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233539AC1D@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC82923353942F9@SHSMSX101.ccr.corp.intel.com>
	<20121128192601.GA15871@phenom.dumpdata.com>
In-Reply-To: <20121128192601.GA15871@phenom.dumpdata.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"lenb@kernel.org" <lenb@kernel.org>
Subject: Re: [Xen-devel] [PATCH V1 1/2] Xen acpi memory hotplug driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Konrad Rzeszutek Wilk wrote:
> On Wed, Nov 21, 2012 at 11:45:04AM +0000, Liu, Jinsong wrote:
>>> From 630c65690c878255ce71e7c1172338ed08709273 Mon Sep 17 00:00:00
>>> 2001 
>> From: Liu Jinsong <jinsong.liu@intel.com>
>> Date: Tue, 20 Nov 2012 21:14:37 +0800
>> Subject: [PATCH 1/2] Xen acpi memory hotplug driver
>> 
>> Xen acpi memory hotplug consists of 2 logic components:
>> Xen acpi memory hotplug driver and Xen hypercall.
>> 
>> This patch implement Xen acpi memory hotplug driver. When running
>> under xen platform, Xen driver will early occupy (so native driver
> 
> How will it 'early occupy'? Can you spell it out here please?

Sure, will add it like
'When running under xen platform, at booting stage xen memory hotplug driver will early occupy via subsys_initcall (earlier than native module_init), so xen driver will take effect and native driver will be blocked'.

> 
>> will be blocked). When acpi memory notify OSPM, xen driver will take
>> effect, adding related memory device and parsing memory information.
>> 
>> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
>> ---
>>  drivers/xen/Kconfig               |   11 +
>>  drivers/xen/Makefile              |    1 +
>>  drivers/xen/xen-acpi-memhotplug.c |  383
>>  +++++++++++++++++++++++++++++++++++++ 3 files changed, 395
>>  insertions(+), 0 deletions(-) create mode 100644
>> drivers/xen/xen-acpi-memhotplug.c 
>> 
>> diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
>> index 126d8ce..abd0396 100644
>> --- a/drivers/xen/Kconfig
>> +++ b/drivers/xen/Kconfig
>> @@ -206,4 +206,15 @@ config XEN_MCE_LOG
>>  	  Allow kernel fetching MCE error from Xen platform and
>>  	  converting it into Linux mcelog format for mcelog tools
>> 
>> +config XEN_ACPI_MEMORY_HOTPLUG
>> +	bool "Xen ACPI memory hotplug"
> 
> There should be a way to make this a module.

I have some concerns to make it a module:
1. xen and native memhotplug driver both work as module, while we need early load xen driver.
2. if possible, a xen stub driver may solve load sequence issue, but it may involve other issues
  * if xen driver load then unload, native driver may have chance to load successfully;
  * if xen driver load --> unload --> load again, then it will lose hotplug notification during unload period;
  * if xen driver load --> unload --> load again, then it will re-add all memory devices, but the handle for 'booting memory device' and 'hotplug memory device' are different while we have no way to distinguish these 2 kind of devices.

IMHO I think to make xen hotplug logic as module may involves unexpected result. Is there any obvious advantages of doing so? after all we have provided config choice to user. Thoughts?

> 
> 
>> +	depends on XEN_DOM0 && X86_64 && ACPI
>> +	default n
>> +	help
>> +	  This is Xen acpi memory hotplug.
>                       ^^^^ -> ACPI
> 
>> +
>> +	  Currently Xen only support acpi memory hot-add. If you want
>                                      ^^^^-> ACPI
> 
>> +	  to hot-add memory at runtime (the hot-added memory cannot be
>> +	  removed until machine stop), select Y here, otherwise select N. +
>>  endmenu
>> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
>> index 7435470..c339eb4 100644
>> --- a/drivers/xen/Makefile
>> +++ b/drivers/xen/Makefile
>> @@ -30,6 +30,7 @@ obj-$(CONFIG_XEN_MCE_LOG)		+= mcelog.o
>>  obj-$(CONFIG_XEN_PCIDEV_BACKEND)	+= xen-pciback/
>>  obj-$(CONFIG_XEN_PRIVCMD)		+= xen-privcmd.o
>>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)	+= xen-acpi-processor.o
>> +obj-$(CONFIG_XEN_ACPI_MEMORY_HOTPLUG)	+= xen-acpi-memhotplug.o 
>>  xen-evtchn-y				:= evtchn.o xen-gntdev-y				:= gntdev.o
>>  xen-gntalloc-y				:= gntalloc.o
>> diff --git a/drivers/xen/xen-acpi-memhotplug.c
>> b/drivers/xen/xen-acpi-memhotplug.c new file mode 100644 index
>> 0000000..f0c7990 --- /dev/null
>> +++ b/drivers/xen/xen-acpi-memhotplug.c
>> @@ -0,0 +1,383 @@
>> +/*
>> + * Copyright (C) 2012 Intel Corporation
>> + *    Author: Liu Jinsong <jinsong.liu@intel.com>
>> + *    Author: Jiang Yunhong <yunhong.jiang@intel.com> + *
>> + * This program is free software; you can redistribute it and/or
>> modify + * it under the terms of the GNU General Public License as
>> published by + * the Free Software Foundation; either version 2 of
>> the License, or (at + * your option) any later version.
>> + *
>> + * 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, GOOD TITLE
>> or + * NON INFRINGEMENT.  See the GNU General Public License for
>> more + * details. + */
>> +
>> +#include <linux/kernel.h>
>> +#include <linux/init.h>
>> +#include <linux/types.h>
>> +#include <acpi/acpi_drivers.h>
>> +
>> +#define ACPI_MEMORY_DEVICE_CLASS		"memory"
>> +#define ACPI_MEMORY_DEVICE_HID			"PNP0C80"
>> +#define ACPI_MEMORY_DEVICE_NAME			"Hotplug Mem Device"
> 
> Weird tabs?
> 

It ported from native and seems right tabs? will double check.

>> +
>> +#undef PREFIX
> 
> Why the #undef ?
>> +#define PREFIX "ACPI:memory_hp:"
> 
> 
> Not "ACPI:memory_xen:" ?

OK, how about more detailed "ACPI:xen_memory_hotplug:"?

> 
> 
>> +
>> +static int acpi_memory_device_add(struct acpi_device *device);
>> +static int acpi_memory_device_remove(struct acpi_device *device,
>> int type); + +static const struct acpi_device_id memory_device_ids[]
>> = { +	{ACPI_MEMORY_DEVICE_HID, 0},
>> +	{"", 0},
>> +};
>> +
>> +static struct acpi_driver acpi_memory_device_driver = {
>> +	.name = "acpi_memhotplug",
> 
> Not 'xen_acpi_memhotplug' ?

No, here driver name (same as native driver name) used to block native driver loading.

> 
>> +	.class = ACPI_MEMORY_DEVICE_CLASS,
>> +	.ids = memory_device_ids,
>> +	.ops = {
>> +		.add = acpi_memory_device_add,
>> +		.remove = acpi_memory_device_remove,
> 
> Just for sake of clarity I would prefix those with 'xen_'.

OK.

> 
>> +		},
>> +};
>> +
>> +struct acpi_memory_info {
>> +	struct list_head list;
>> +	u64 start_addr;		/* Memory Range start physical addr */
>> +	u64 length;		/* Memory Range length */
>> +	unsigned short caching;	/* memory cache attribute */
>> +	unsigned short write_protect;	/* memory read/write attribute */
> 
> Can't the write_protect by a bit field like the 'enabled'? So
> 	unsigned int write_protect:1;
> ?

Seems not good, write_protect copied from an acpi buffer (byte3) getting from _CRS evaluation.

>> +	unsigned int enabled:1;
>> +};
>> +
>> +struct acpi_memory_device {
>> +	struct acpi_device *device;
>> +	struct list_head res_list;
>> +};
>> +
>> +static int acpi_hotmem_initialized;
> 
> Just make it a bool and also use __read_mostly please.

OK.

> 
>> +
>> +
>> +int xen_acpi_memory_enable_device(struct acpi_memory_device
>> *mem_device) +{ +	return 0;
>> +}
> 
> Why even have this function if it does not do anything?

Not a nop, it implemented at patch 2/2.

> 
>> +
>> +static acpi_status
>> +acpi_memory_get_resource(struct acpi_resource *resource, void
>> *context) +{ +	struct acpi_memory_device *mem_device = context;
>> +	struct acpi_resource_address64 address64;
>> +	struct acpi_memory_info *info, *new;
>> +	acpi_status status;
>> +
>> +	status = acpi_resource_to_address64(resource, &address64); +	if
>> (ACPI_FAILURE(status) || +	    (address64.resource_type !=
>> ACPI_MEMORY_RANGE)) +		return AE_OK; +
>> +	list_for_each_entry(info, &mem_device->res_list, list) {
>> +		/* Can we combine the resource range information? */
> 
> I don't know? Is this is a future TODO?

I'm also not quite sure, this comments ported from native side.

> 
>> +		if ((info->caching == address64.info.mem.caching) &&
>> +		    (info->write_protect == address64.info.mem.write_protect) &&
>> +		    (info->start_addr + info->length == address64.minimum)) {
>> +			info->length += address64.address_length;
>> +			return AE_OK;
>> +		}
>> +	}
>> +
>> +	new = kzalloc(sizeof(struct acpi_memory_info), GFP_KERNEL); +	if
>> (!new) +		return AE_ERROR;
>> +
>> +	INIT_LIST_HEAD(&new->list);
>> +	new->caching = address64.info.mem.caching;
>> +	new->write_protect = address64.info.mem.write_protect;
>> +	new->start_addr = address64.minimum;
>> +	new->length = address64.address_length;
>> +	list_add_tail(&new->list, &mem_device->res_list); +
>> +	return AE_OK;
>> +}
>> +
>> +static int
>> +acpi_memory_get_device_resources(struct acpi_memory_device
>> *mem_device) +{ +	acpi_status status;
>> +	struct acpi_memory_info *info, *n;
>> +
>> +	if (!list_empty(&mem_device->res_list))
>> +		return 0;
>> +
>> +	status = acpi_walk_resources(mem_device->device->handle,
>> +		METHOD_NAME__CRS, acpi_memory_get_resource, mem_device); +
>> +	if (ACPI_FAILURE(status)) {
>> +		list_for_each_entry_safe(info, n, &mem_device->res_list, list)
>> +			kfree(info); +		INIT_LIST_HEAD(&mem_device->res_list);
>> +		return -EINVAL;
>> +	}
>> +
>> +	return 0;
>> +}
>> +
>> +static int
>> +acpi_memory_get_device(acpi_handle handle,
>> +		       struct acpi_memory_device **mem_device)
>> +{
>> +	acpi_status status;
>> +	acpi_handle phandle;
>> +	struct acpi_device *device = NULL;
>> +	struct acpi_device *pdevice = NULL;
>> +	int result;
>> +
>> +	if (!acpi_bus_get_device(handle, &device) && device) +		goto end;
>> +
>> +	status = acpi_get_parent(handle, &phandle);
>> +	if (ACPI_FAILURE(status)) {
>> +		pr_warn(PREFIX "Cannot find acpi parent\n");
>> +		return -EINVAL;
>> +	}
>> +
>> +	/* Get the parent device */
>> +	result = acpi_bus_get_device(phandle, &pdevice);
>> +	if (result) {
>> +		pr_warn(PREFIX "Cannot get acpi bus device\n");
>> +		return -EINVAL;
>> +	}
>> +
>> +	/*
>> +	 * Now add the notified device.  This creates the acpi_device
>> +	 * and invokes .add function
>> +	 */
>> +	result = acpi_bus_add(&device, pdevice, handle,
>> ACPI_BUS_TYPE_DEVICE); +	if (result) { +		pr_warn(PREFIX "Cannot add
>> acpi bus\n"); +		return -EINVAL;
>> +	}
>> +
>> +end:
>> +	*mem_device = acpi_driver_data(device);
>> +	if (!(*mem_device)) {
>> +		pr_err(PREFIX "Driver data not found\n");
>> +		return -ENODEV;
>> +	}
>> +
>> +	return 0;
>> +}
>> +
>> +static int acpi_memory_check_device(struct acpi_memory_device
>> *mem_device) +{ +	unsigned long long current_status;
>> +
>> +	/* Get device present/absent information from the _STA */
>> +	if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle,
>> +				"_STA", NULL, &current_status)))
>> +		return -ENODEV;
>> +	/*
>> +	 * Check for device status. Device should be
>> +	 * present/enabled/functioning.
>> +	 */
>> +	if (!((current_status & ACPI_STA_DEVICE_PRESENT)
>> +	      && (current_status & ACPI_STA_DEVICE_ENABLED)
>> +	      && (current_status & ACPI_STA_DEVICE_FUNCTIONING)))
>> +		return -ENODEV; +
>> +	return 0;
>> +}
>> +
>> +static int acpi_memory_disable_device(struct acpi_memory_device
>> *mem_device) +{ +	pr_warn(PREFIX "Xen does not support memory
>> hotremove\n"); + +	return -ENOSYS;
>> +}
>> +
>> +static void acpi_memory_device_notify(acpi_handle handle, u32
>> event, void *data) +{ +	struct acpi_memory_device *mem_device;
>> +	struct acpi_device *device;
>> +	u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ +
>> +	switch (event) {
>> +	case ACPI_NOTIFY_BUS_CHECK:
>> +		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
>> +			"\nReceived BUS CHECK notification for device\n")); +		/* Fall
>> Through */ +	case ACPI_NOTIFY_DEVICE_CHECK:
>> +		if (event == ACPI_NOTIFY_DEVICE_CHECK)
>> +			ACPI_DEBUG_PRINT((ACPI_DB_INFO,
>> +			"\nReceived DEVICE CHECK notification for device\n")); +
>> +		if (acpi_memory_get_device(handle, &mem_device)) {
>> +			pr_err(PREFIX "Cannot find driver data\n");
>> +			break;
>> +		}
>> +
>> +		ost_code = ACPI_OST_SC_SUCCESS;
>> +		break;
>> +
>> +	case ACPI_NOTIFY_EJECT_REQUEST:
>> +		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
>> +			"\nReceived EJECT REQUEST notification for device\n")); +
>> +		if (acpi_bus_get_device(handle, &device)) {
>> +			pr_err(PREFIX "Device doesn't exist\n");
>> +			break;
>> +		}
>> +		mem_device = acpi_driver_data(device);
>> +		if (!mem_device) {
>> +			pr_err(PREFIX "Driver Data is NULL\n");
>> +			break;
>> +		}
>> +
>> +		/*
>> +		 * TBD: implement acpi_memory_disable_device and invoke
>> +		 * acpi_bus_remove if Xen support hotremove in the future +		 */
>> +		acpi_memory_disable_device(mem_device);
>> +		break;
>> +
>> +	default:
>> +		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
>> +				  "Unsupported event [0x%x]\n", event));
>> +		/* non-hotplug event; possibly handled by other handler */
>> +		return; +	}
>> +
>> +	/* Inform firmware that the hotplug operation has completed */
>> +	(void) acpi_evaluate_hotplug_ost(handle, event, ost_code, NULL);
> 
> 
> Hm, even if we failed? Say for the ACPI_NOTIFY_EJECT_REQUEST ?

OK, let's remove this the comments 'Inform firmware that the hotplug operation has completed'
For ACPI_NOTIFY_EJECT_REQUEST, it in fact inform firmware 'ACPI_OST_SC_NON_SPECIFIC_FAILURE'.

> 
>> +	return;
>> +}
>> +
>> +static int acpi_memory_device_add(struct acpi_device *device) +{
>> +	int result;
>> +	struct acpi_memory_device *mem_device = NULL;
>> +
>> +
>> +	if (!device)
>> +		return -EINVAL;
>> +
>> +	mem_device = kzalloc(sizeof(struct acpi_memory_device),
>> GFP_KERNEL); +	if (!mem_device) +		return -ENOMEM;
>> +
>> +	INIT_LIST_HEAD(&mem_device->res_list);
>> +	mem_device->device = device;
>> +	sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME);
>> +	sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS);
>> +	device->driver_data = mem_device;
>> +
>> +	/* Get the range from the _CRS */
>> +	result = acpi_memory_get_device_resources(mem_device); +	if
>> (result) { +		kfree(mem_device);
>> +		return result;
>> +	}
>> +
>> +	/*
>> +	 * Early boot code has recognized memory area by EFI/E820.
>> +	 * If DSDT shows these memory devices on boot, hotplug is not
>> necessary +	 * for them. So, it just returns until completion of
>> this driver's +	 * start up. +	 */
>> +	if (!acpi_hotmem_initialized)
>> +		return 0;
>> +
>> +	if (!acpi_memory_check_device(mem_device))
>> +		result = xen_acpi_memory_enable_device(mem_device);
> 
> This is a nop. Could you just do:
> 		result = 0;
> ?

It implemented at patch 2/2.

Thanks,
Jinsong

> 
>> +
>> +	return result;
>> +}
>> +
>> +static int acpi_memory_device_remove(struct acpi_device *device,
>> int type) +{ +	struct acpi_memory_device *mem_device = NULL;
>> +
>> +	if (!device || !acpi_driver_data(device))
>> +		return -EINVAL;
>> +
>> +	mem_device = acpi_driver_data(device);
>> +	kfree(mem_device);
>> +
>> +	return 0;
>> +}
>> +
>> +/*
>> + * Helper function to check for memory device
>> + */
>> +static acpi_status is_memory_device(acpi_handle handle) +{
>> +	char *hardware_id;
>> +	acpi_status status;
>> +	struct acpi_device_info *info;
>> +
>> +	status = acpi_get_object_info(handle, &info);
>> +	if (ACPI_FAILURE(status))
>> +		return status;
>> +
>> +	if (!(info->valid & ACPI_VALID_HID)) {
>> +		kfree(info);
>> +		return AE_ERROR;
>> +	}
>> +
>> +	hardware_id = info->hardware_id.string;
>> +	if ((hardware_id == NULL) ||
>> +	    (strcmp(hardware_id, ACPI_MEMORY_DEVICE_HID))) +		status =
>> AE_ERROR; +
>> +	kfree(info);
>> +	return status;
>> +}
>> +
>> +static acpi_status
>> +acpi_memory_register_notify_handler(acpi_handle handle,
>> +				    u32 level, void *ctxt, void **retv)
>> +{
>> +	acpi_status status;
>> +
>> +	status = is_memory_device(handle);
>> +	if (ACPI_FAILURE(status))
>> +		return AE_OK;	/* continue */
>> +
>> +	status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
>> +					     acpi_memory_device_notify, NULL);
>> +	/* continue */
>> +	return AE_OK;
>> +}
>> +
>> +static int __init xen_acpi_memory_device_init(void) +{
>> +	int result;
>> +	acpi_status status;
>> +
>> +	/* only dom0 is responsible for xen acpi memory hotplug */ +	if
>> (!xen_initial_domain()) +		return -ENODEV;
>> +
>> +	result = acpi_bus_register_driver(&acpi_memory_device_driver);
>> +	if (result < 0) +		return -ENODEV;
>> +
>> +	status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
>> +				     ACPI_UINT32_MAX, +				    
>> acpi_memory_register_notify_handler, NULL, +				     NULL, NULL); +
>> +	if (ACPI_FAILURE(status)) {
>> +		pr_warn(PREFIX "walk_namespace failed\n");
>> +		acpi_bus_unregister_driver(&acpi_memory_device_driver); +		return
>> -ENODEV; +	}
>> +
>> +	acpi_hotmem_initialized = 1;
>> +	return 0;
>> +}
>> +subsys_initcall(xen_acpi_memory_device_init);
>> --
>> 1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 03:08:39 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 03:08:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeGxZ-0004Vk-B9; Fri, 30 Nov 2012 03:08:13 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TeGxX-0004Vf-C8
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 03:08:11 +0000
Received: from [193.109.254.147:63919] by server-9.bemta-14.messagelabs.com id
	7B/F6-30773-A1328B05; Fri, 30 Nov 2012 03:08:10 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1354244887!3200949!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4OTUwMA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16779 invoked from network); 30 Nov 2012 03:08:08 -0000
Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93)
	by server-6.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 03:08:08 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 29 Nov 2012 19:08:06 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,189,1355126400"; d="scan'208";a="255364845"
Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228])
	by fmsmga001.fm.intel.com with ESMTP; 29 Nov 2012 19:08:06 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Thu, 29 Nov 2012 19:08:05 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Fri, 30 Nov 2012 11:08:02 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thread-Topic: [PATCH V1 1/2] Xen acpi memory hotplug driver
Thread-Index: AQHNzZ49ARZC8Pre50KuGp78qorc1ZgBk0jw
Date: Fri, 30 Nov 2012 03:08:02 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233539AC1D@SHSMSX101.ccr.corp.intel.com>
References: <DE8DF0795D48FD4CA783C40EC82923353942F9@SHSMSX101.ccr.corp.intel.com>
	<20121128192601.GA15871@phenom.dumpdata.com>
In-Reply-To: <20121128192601.GA15871@phenom.dumpdata.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"lenb@kernel.org" <lenb@kernel.org>
Subject: Re: [Xen-devel] [PATCH V1 1/2] Xen acpi memory hotplug driver
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Konrad Rzeszutek Wilk wrote:
> On Wed, Nov 21, 2012 at 11:45:04AM +0000, Liu, Jinsong wrote:
>>> From 630c65690c878255ce71e7c1172338ed08709273 Mon Sep 17 00:00:00
>>> 2001 
>> From: Liu Jinsong <jinsong.liu@intel.com>
>> Date: Tue, 20 Nov 2012 21:14:37 +0800
>> Subject: [PATCH 1/2] Xen acpi memory hotplug driver
>> 
>> Xen acpi memory hotplug consists of 2 logic components:
>> Xen acpi memory hotplug driver and Xen hypercall.
>> 
>> This patch implement Xen acpi memory hotplug driver. When running
>> under xen platform, Xen driver will early occupy (so native driver
> 
> How will it 'early occupy'? Can you spell it out here please?

Sure, will add it like
'When running under xen platform, at booting stage xen memory hotplug driver will early occupy via subsys_initcall (earlier than native module_init), so xen driver will take effect and native driver will be blocked'.

> 
>> will be blocked). When acpi memory notify OSPM, xen driver will take
>> effect, adding related memory device and parsing memory information.
>> 
>> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
>> ---
>>  drivers/xen/Kconfig               |   11 +
>>  drivers/xen/Makefile              |    1 +
>>  drivers/xen/xen-acpi-memhotplug.c |  383
>>  +++++++++++++++++++++++++++++++++++++ 3 files changed, 395
>>  insertions(+), 0 deletions(-) create mode 100644
>> drivers/xen/xen-acpi-memhotplug.c 
>> 
>> diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
>> index 126d8ce..abd0396 100644
>> --- a/drivers/xen/Kconfig
>> +++ b/drivers/xen/Kconfig
>> @@ -206,4 +206,15 @@ config XEN_MCE_LOG
>>  	  Allow kernel fetching MCE error from Xen platform and
>>  	  converting it into Linux mcelog format for mcelog tools
>> 
>> +config XEN_ACPI_MEMORY_HOTPLUG
>> +	bool "Xen ACPI memory hotplug"
> 
> There should be a way to make this a module.

I have some concerns to make it a module:
1. xen and native memhotplug driver both work as module, while we need early load xen driver.
2. if possible, a xen stub driver may solve load sequence issue, but it may involve other issues
  * if xen driver load then unload, native driver may have chance to load successfully;
  * if xen driver load --> unload --> load again, then it will lose hotplug notification during unload period;
  * if xen driver load --> unload --> load again, then it will re-add all memory devices, but the handle for 'booting memory device' and 'hotplug memory device' are different while we have no way to distinguish these 2 kind of devices.

IMHO I think to make xen hotplug logic as module may involves unexpected result. Is there any obvious advantages of doing so? after all we have provided config choice to user. Thoughts?

> 
> 
>> +	depends on XEN_DOM0 && X86_64 && ACPI
>> +	default n
>> +	help
>> +	  This is Xen acpi memory hotplug.
>                       ^^^^ -> ACPI
> 
>> +
>> +	  Currently Xen only support acpi memory hot-add. If you want
>                                      ^^^^-> ACPI
> 
>> +	  to hot-add memory at runtime (the hot-added memory cannot be
>> +	  removed until machine stop), select Y here, otherwise select N. +
>>  endmenu
>> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
>> index 7435470..c339eb4 100644
>> --- a/drivers/xen/Makefile
>> +++ b/drivers/xen/Makefile
>> @@ -30,6 +30,7 @@ obj-$(CONFIG_XEN_MCE_LOG)		+= mcelog.o
>>  obj-$(CONFIG_XEN_PCIDEV_BACKEND)	+= xen-pciback/
>>  obj-$(CONFIG_XEN_PRIVCMD)		+= xen-privcmd.o
>>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)	+= xen-acpi-processor.o
>> +obj-$(CONFIG_XEN_ACPI_MEMORY_HOTPLUG)	+= xen-acpi-memhotplug.o 
>>  xen-evtchn-y				:= evtchn.o xen-gntdev-y				:= gntdev.o
>>  xen-gntalloc-y				:= gntalloc.o
>> diff --git a/drivers/xen/xen-acpi-memhotplug.c
>> b/drivers/xen/xen-acpi-memhotplug.c new file mode 100644 index
>> 0000000..f0c7990 --- /dev/null
>> +++ b/drivers/xen/xen-acpi-memhotplug.c
>> @@ -0,0 +1,383 @@
>> +/*
>> + * Copyright (C) 2012 Intel Corporation
>> + *    Author: Liu Jinsong <jinsong.liu@intel.com>
>> + *    Author: Jiang Yunhong <yunhong.jiang@intel.com> + *
>> + * This program is free software; you can redistribute it and/or
>> modify + * it under the terms of the GNU General Public License as
>> published by + * the Free Software Foundation; either version 2 of
>> the License, or (at + * your option) any later version.
>> + *
>> + * 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, GOOD TITLE
>> or + * NON INFRINGEMENT.  See the GNU General Public License for
>> more + * details. + */
>> +
>> +#include <linux/kernel.h>
>> +#include <linux/init.h>
>> +#include <linux/types.h>
>> +#include <acpi/acpi_drivers.h>
>> +
>> +#define ACPI_MEMORY_DEVICE_CLASS		"memory"
>> +#define ACPI_MEMORY_DEVICE_HID			"PNP0C80"
>> +#define ACPI_MEMORY_DEVICE_NAME			"Hotplug Mem Device"
> 
> Weird tabs?
> 

It ported from native and seems right tabs? will double check.

>> +
>> +#undef PREFIX
> 
> Why the #undef ?
>> +#define PREFIX "ACPI:memory_hp:"
> 
> 
> Not "ACPI:memory_xen:" ?

OK, how about more detailed "ACPI:xen_memory_hotplug:"?

> 
> 
>> +
>> +static int acpi_memory_device_add(struct acpi_device *device);
>> +static int acpi_memory_device_remove(struct acpi_device *device,
>> int type); + +static const struct acpi_device_id memory_device_ids[]
>> = { +	{ACPI_MEMORY_DEVICE_HID, 0},
>> +	{"", 0},
>> +};
>> +
>> +static struct acpi_driver acpi_memory_device_driver = {
>> +	.name = "acpi_memhotplug",
> 
> Not 'xen_acpi_memhotplug' ?

No, here driver name (same as native driver name) used to block native driver loading.

> 
>> +	.class = ACPI_MEMORY_DEVICE_CLASS,
>> +	.ids = memory_device_ids,
>> +	.ops = {
>> +		.add = acpi_memory_device_add,
>> +		.remove = acpi_memory_device_remove,
> 
> Just for sake of clarity I would prefix those with 'xen_'.

OK.

> 
>> +		},
>> +};
>> +
>> +struct acpi_memory_info {
>> +	struct list_head list;
>> +	u64 start_addr;		/* Memory Range start physical addr */
>> +	u64 length;		/* Memory Range length */
>> +	unsigned short caching;	/* memory cache attribute */
>> +	unsigned short write_protect;	/* memory read/write attribute */
> 
> Can't the write_protect by a bit field like the 'enabled'? So
> 	unsigned int write_protect:1;
> ?

Seems not good, write_protect copied from an acpi buffer (byte3) getting from _CRS evaluation.

>> +	unsigned int enabled:1;
>> +};
>> +
>> +struct acpi_memory_device {
>> +	struct acpi_device *device;
>> +	struct list_head res_list;
>> +};
>> +
>> +static int acpi_hotmem_initialized;
> 
> Just make it a bool and also use __read_mostly please.

OK.

> 
>> +
>> +
>> +int xen_acpi_memory_enable_device(struct acpi_memory_device
>> *mem_device) +{ +	return 0;
>> +}
> 
> Why even have this function if it does not do anything?

Not a nop, it implemented at patch 2/2.

> 
>> +
>> +static acpi_status
>> +acpi_memory_get_resource(struct acpi_resource *resource, void
>> *context) +{ +	struct acpi_memory_device *mem_device = context;
>> +	struct acpi_resource_address64 address64;
>> +	struct acpi_memory_info *info, *new;
>> +	acpi_status status;
>> +
>> +	status = acpi_resource_to_address64(resource, &address64); +	if
>> (ACPI_FAILURE(status) || +	    (address64.resource_type !=
>> ACPI_MEMORY_RANGE)) +		return AE_OK; +
>> +	list_for_each_entry(info, &mem_device->res_list, list) {
>> +		/* Can we combine the resource range information? */
> 
> I don't know? Is this is a future TODO?

I'm also not quite sure, this comments ported from native side.

> 
>> +		if ((info->caching == address64.info.mem.caching) &&
>> +		    (info->write_protect == address64.info.mem.write_protect) &&
>> +		    (info->start_addr + info->length == address64.minimum)) {
>> +			info->length += address64.address_length;
>> +			return AE_OK;
>> +		}
>> +	}
>> +
>> +	new = kzalloc(sizeof(struct acpi_memory_info), GFP_KERNEL); +	if
>> (!new) +		return AE_ERROR;
>> +
>> +	INIT_LIST_HEAD(&new->list);
>> +	new->caching = address64.info.mem.caching;
>> +	new->write_protect = address64.info.mem.write_protect;
>> +	new->start_addr = address64.minimum;
>> +	new->length = address64.address_length;
>> +	list_add_tail(&new->list, &mem_device->res_list); +
>> +	return AE_OK;
>> +}
>> +
>> +static int
>> +acpi_memory_get_device_resources(struct acpi_memory_device
>> *mem_device) +{ +	acpi_status status;
>> +	struct acpi_memory_info *info, *n;
>> +
>> +	if (!list_empty(&mem_device->res_list))
>> +		return 0;
>> +
>> +	status = acpi_walk_resources(mem_device->device->handle,
>> +		METHOD_NAME__CRS, acpi_memory_get_resource, mem_device); +
>> +	if (ACPI_FAILURE(status)) {
>> +		list_for_each_entry_safe(info, n, &mem_device->res_list, list)
>> +			kfree(info); +		INIT_LIST_HEAD(&mem_device->res_list);
>> +		return -EINVAL;
>> +	}
>> +
>> +	return 0;
>> +}
>> +
>> +static int
>> +acpi_memory_get_device(acpi_handle handle,
>> +		       struct acpi_memory_device **mem_device)
>> +{
>> +	acpi_status status;
>> +	acpi_handle phandle;
>> +	struct acpi_device *device = NULL;
>> +	struct acpi_device *pdevice = NULL;
>> +	int result;
>> +
>> +	if (!acpi_bus_get_device(handle, &device) && device) +		goto end;
>> +
>> +	status = acpi_get_parent(handle, &phandle);
>> +	if (ACPI_FAILURE(status)) {
>> +		pr_warn(PREFIX "Cannot find acpi parent\n");
>> +		return -EINVAL;
>> +	}
>> +
>> +	/* Get the parent device */
>> +	result = acpi_bus_get_device(phandle, &pdevice);
>> +	if (result) {
>> +		pr_warn(PREFIX "Cannot get acpi bus device\n");
>> +		return -EINVAL;
>> +	}
>> +
>> +	/*
>> +	 * Now add the notified device.  This creates the acpi_device
>> +	 * and invokes .add function
>> +	 */
>> +	result = acpi_bus_add(&device, pdevice, handle,
>> ACPI_BUS_TYPE_DEVICE); +	if (result) { +		pr_warn(PREFIX "Cannot add
>> acpi bus\n"); +		return -EINVAL;
>> +	}
>> +
>> +end:
>> +	*mem_device = acpi_driver_data(device);
>> +	if (!(*mem_device)) {
>> +		pr_err(PREFIX "Driver data not found\n");
>> +		return -ENODEV;
>> +	}
>> +
>> +	return 0;
>> +}
>> +
>> +static int acpi_memory_check_device(struct acpi_memory_device
>> *mem_device) +{ +	unsigned long long current_status;
>> +
>> +	/* Get device present/absent information from the _STA */
>> +	if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle,
>> +				"_STA", NULL, &current_status)))
>> +		return -ENODEV;
>> +	/*
>> +	 * Check for device status. Device should be
>> +	 * present/enabled/functioning.
>> +	 */
>> +	if (!((current_status & ACPI_STA_DEVICE_PRESENT)
>> +	      && (current_status & ACPI_STA_DEVICE_ENABLED)
>> +	      && (current_status & ACPI_STA_DEVICE_FUNCTIONING)))
>> +		return -ENODEV; +
>> +	return 0;
>> +}
>> +
>> +static int acpi_memory_disable_device(struct acpi_memory_device
>> *mem_device) +{ +	pr_warn(PREFIX "Xen does not support memory
>> hotremove\n"); + +	return -ENOSYS;
>> +}
>> +
>> +static void acpi_memory_device_notify(acpi_handle handle, u32
>> event, void *data) +{ +	struct acpi_memory_device *mem_device;
>> +	struct acpi_device *device;
>> +	u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ +
>> +	switch (event) {
>> +	case ACPI_NOTIFY_BUS_CHECK:
>> +		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
>> +			"\nReceived BUS CHECK notification for device\n")); +		/* Fall
>> Through */ +	case ACPI_NOTIFY_DEVICE_CHECK:
>> +		if (event == ACPI_NOTIFY_DEVICE_CHECK)
>> +			ACPI_DEBUG_PRINT((ACPI_DB_INFO,
>> +			"\nReceived DEVICE CHECK notification for device\n")); +
>> +		if (acpi_memory_get_device(handle, &mem_device)) {
>> +			pr_err(PREFIX "Cannot find driver data\n");
>> +			break;
>> +		}
>> +
>> +		ost_code = ACPI_OST_SC_SUCCESS;
>> +		break;
>> +
>> +	case ACPI_NOTIFY_EJECT_REQUEST:
>> +		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
>> +			"\nReceived EJECT REQUEST notification for device\n")); +
>> +		if (acpi_bus_get_device(handle, &device)) {
>> +			pr_err(PREFIX "Device doesn't exist\n");
>> +			break;
>> +		}
>> +		mem_device = acpi_driver_data(device);
>> +		if (!mem_device) {
>> +			pr_err(PREFIX "Driver Data is NULL\n");
>> +			break;
>> +		}
>> +
>> +		/*
>> +		 * TBD: implement acpi_memory_disable_device and invoke
>> +		 * acpi_bus_remove if Xen support hotremove in the future +		 */
>> +		acpi_memory_disable_device(mem_device);
>> +		break;
>> +
>> +	default:
>> +		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
>> +				  "Unsupported event [0x%x]\n", event));
>> +		/* non-hotplug event; possibly handled by other handler */
>> +		return; +	}
>> +
>> +	/* Inform firmware that the hotplug operation has completed */
>> +	(void) acpi_evaluate_hotplug_ost(handle, event, ost_code, NULL);
> 
> 
> Hm, even if we failed? Say for the ACPI_NOTIFY_EJECT_REQUEST ?

OK, let's remove this the comments 'Inform firmware that the hotplug operation has completed'
For ACPI_NOTIFY_EJECT_REQUEST, it in fact inform firmware 'ACPI_OST_SC_NON_SPECIFIC_FAILURE'.

> 
>> +	return;
>> +}
>> +
>> +static int acpi_memory_device_add(struct acpi_device *device) +{
>> +	int result;
>> +	struct acpi_memory_device *mem_device = NULL;
>> +
>> +
>> +	if (!device)
>> +		return -EINVAL;
>> +
>> +	mem_device = kzalloc(sizeof(struct acpi_memory_device),
>> GFP_KERNEL); +	if (!mem_device) +		return -ENOMEM;
>> +
>> +	INIT_LIST_HEAD(&mem_device->res_list);
>> +	mem_device->device = device;
>> +	sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME);
>> +	sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS);
>> +	device->driver_data = mem_device;
>> +
>> +	/* Get the range from the _CRS */
>> +	result = acpi_memory_get_device_resources(mem_device); +	if
>> (result) { +		kfree(mem_device);
>> +		return result;
>> +	}
>> +
>> +	/*
>> +	 * Early boot code has recognized memory area by EFI/E820.
>> +	 * If DSDT shows these memory devices on boot, hotplug is not
>> necessary +	 * for them. So, it just returns until completion of
>> this driver's +	 * start up. +	 */
>> +	if (!acpi_hotmem_initialized)
>> +		return 0;
>> +
>> +	if (!acpi_memory_check_device(mem_device))
>> +		result = xen_acpi_memory_enable_device(mem_device);
> 
> This is a nop. Could you just do:
> 		result = 0;
> ?

It implemented at patch 2/2.

Thanks,
Jinsong

> 
>> +
>> +	return result;
>> +}
>> +
>> +static int acpi_memory_device_remove(struct acpi_device *device,
>> int type) +{ +	struct acpi_memory_device *mem_device = NULL;
>> +
>> +	if (!device || !acpi_driver_data(device))
>> +		return -EINVAL;
>> +
>> +	mem_device = acpi_driver_data(device);
>> +	kfree(mem_device);
>> +
>> +	return 0;
>> +}
>> +
>> +/*
>> + * Helper function to check for memory device
>> + */
>> +static acpi_status is_memory_device(acpi_handle handle) +{
>> +	char *hardware_id;
>> +	acpi_status status;
>> +	struct acpi_device_info *info;
>> +
>> +	status = acpi_get_object_info(handle, &info);
>> +	if (ACPI_FAILURE(status))
>> +		return status;
>> +
>> +	if (!(info->valid & ACPI_VALID_HID)) {
>> +		kfree(info);
>> +		return AE_ERROR;
>> +	}
>> +
>> +	hardware_id = info->hardware_id.string;
>> +	if ((hardware_id == NULL) ||
>> +	    (strcmp(hardware_id, ACPI_MEMORY_DEVICE_HID))) +		status =
>> AE_ERROR; +
>> +	kfree(info);
>> +	return status;
>> +}
>> +
>> +static acpi_status
>> +acpi_memory_register_notify_handler(acpi_handle handle,
>> +				    u32 level, void *ctxt, void **retv)
>> +{
>> +	acpi_status status;
>> +
>> +	status = is_memory_device(handle);
>> +	if (ACPI_FAILURE(status))
>> +		return AE_OK;	/* continue */
>> +
>> +	status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
>> +					     acpi_memory_device_notify, NULL);
>> +	/* continue */
>> +	return AE_OK;
>> +}
>> +
>> +static int __init xen_acpi_memory_device_init(void) +{
>> +	int result;
>> +	acpi_status status;
>> +
>> +	/* only dom0 is responsible for xen acpi memory hotplug */ +	if
>> (!xen_initial_domain()) +		return -ENODEV;
>> +
>> +	result = acpi_bus_register_driver(&acpi_memory_device_driver);
>> +	if (result < 0) +		return -ENODEV;
>> +
>> +	status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
>> +				     ACPI_UINT32_MAX, +				    
>> acpi_memory_register_notify_handler, NULL, +				     NULL, NULL); +
>> +	if (ACPI_FAILURE(status)) {
>> +		pr_warn(PREFIX "walk_namespace failed\n");
>> +		acpi_bus_unregister_driver(&acpi_memory_device_driver); +		return
>> -ENODEV; +	}
>> +
>> +	acpi_hotmem_initialized = 1;
>> +	return 0;
>> +}
>> +subsys_initcall(xen_acpi_memory_device_init);
>> --
>> 1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 06:12:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 06:12:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeJpj-0007ek-Uq; Fri, 30 Nov 2012 06:12:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeJpi-0007ef-8G
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 06:12:18 +0000
Received: from [85.158.138.51:46723] by server-13.bemta-3.messagelabs.com id
	FE/35-24887-14E48B05; Fri, 30 Nov 2012 06:12:17 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1354255936!30180969!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU2Nzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27938 invoked from network); 30 Nov 2012 06:12:16 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 06:12:16 -0000
X-IronPort-AV: E=Sophos;i="4.84,189,1355097600"; d="scan'208";a="16082628"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 06:12:15 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 06:12:15 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeJpf-0003gT-Gv;
	Fri, 30 Nov 2012 06:12:15 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeJpf-0007Fm-Fg;
	Fri, 30 Nov 2012 06:12:15 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14495-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 06:12:15 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14495: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14495 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14495/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-xl-qemut-win7-amd64 12 guest-localmigrate/x10 fail REGR. vs. 14483

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14483
 test-amd64-amd64-xl-sedf     11 guest-localmigrate           fail   like 14483

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  9 guest-localmigrate         fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-i386-i386-qemut-win     16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-i386-i386-xl-qemut-winxpsp3 13 guest-stop                 fail never pass
 test-i386-i386-xl-qemut-win  13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  b3dafd42268a
baseline version:
 xen                  5c5c695863f7

------------------------------------------------------------
People who touched revisions under test:
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-i386-i386-qemut-win                                     fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-i386-i386-xl-qemut-win                                  fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-i386-i386-xl-qemut-winxpsp3                             fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   25931:b3dafd42268a
tag:         tip
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Thu Nov 29 16:07:55 2012 +0000
    
    xl: xl.conf(5): correct advice re autoballooning vs. dom0_mem.
    
    The advice was backwards, you should really disable autoballoon if you
    use dom0_mem. Also add a reference to the command-line docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    xen-unstable changeset: 26192:17ffbe7cf645
    Backport-requested-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   25930:ac8a9f014744
user:        George Dunlap <george.dunlap@eu.citrix.com>
date:        Thu Nov 29 14:58:36 2012 +0000
    
    xl: Suppress spurious warning message for cpupool-list
    
    libxl_cpupool_list() enumerates the cpupools by "probing": calling
    cpupool_info, starting at 0 and stopping when it gets an error. However,
    cpupool_info will print an error when the call to xc_cpupool_getinfo() fails,
    resulting in every xl command that uses libxl_list_cpupool (such as
    cpupool-list) printing that error message spuriously.
    
    Since at the moment the times we want to print the message correspond
    with the use of the existing "exact" parameter, use it to decide
    whether to print the message or not.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    xen-unstable changeset: 26185:d66987697fe3
    Backport-requested-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   25929:5c5c695863f7
user:        Jan Beulich <jbeulich@suse.com>
date:        Tue Nov 27 13:25:17 2012 +0100
    
    x86/time: fix scale_delta() inline assembly
    
    The way it was coded, it clobbered %rdx without telling the compiler.
    This generally didn't cause any problems except when there are two back
    to back invocations (as in plt_overflow()), as in that case the
    compiler may validly assume that it can re-use for the second instance
    the value loaded into %rdx before the first one.
    
    Once at it, also properly relax the second operand of "mul" (there's no
    need for it to be in %rdx, or a register at all), and switch away from
    using explicit register names in the instruction operands.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    xen-unstable changeset: 26188:16bf7f3069a7
    xen-unstable date: Mon Nov 26 16:20:39 UTC 2012
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 06:12:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 06:12:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeJpj-0007ek-Uq; Fri, 30 Nov 2012 06:12:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeJpi-0007ef-8G
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 06:12:18 +0000
Received: from [85.158.138.51:46723] by server-13.bemta-3.messagelabs.com id
	FE/35-24887-14E48B05; Fri, 30 Nov 2012 06:12:17 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1354255936!30180969!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU2Nzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27938 invoked from network); 30 Nov 2012 06:12:16 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 06:12:16 -0000
X-IronPort-AV: E=Sophos;i="4.84,189,1355097600"; d="scan'208";a="16082628"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 06:12:15 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 06:12:15 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeJpf-0003gT-Gv;
	Fri, 30 Nov 2012 06:12:15 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeJpf-0007Fm-Fg;
	Fri, 30 Nov 2012 06:12:15 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14495-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 06:12:15 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14495: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14495 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14495/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-xl-qemut-win7-amd64 12 guest-localmigrate/x10 fail REGR. vs. 14483

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14483
 test-amd64-amd64-xl-sedf     11 guest-localmigrate           fail   like 14483

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  9 guest-localmigrate         fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-i386-i386-qemut-win     16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-i386-i386-xl-qemut-winxpsp3 13 guest-stop                 fail never pass
 test-i386-i386-xl-qemut-win  13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  b3dafd42268a
baseline version:
 xen                  5c5c695863f7

------------------------------------------------------------
People who touched revisions under test:
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-i386-i386-qemut-win                                     fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-i386-i386-xl-qemut-win                                  fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-i386-i386-xl-qemut-winxpsp3                             fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   25931:b3dafd42268a
tag:         tip
user:        Ian Campbell <ian.campbell@citrix.com>
date:        Thu Nov 29 16:07:55 2012 +0000
    
    xl: xl.conf(5): correct advice re autoballooning vs. dom0_mem.
    
    The advice was backwards, you should really disable autoballoon if you
    use dom0_mem. Also add a reference to the command-line docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    xen-unstable changeset: 26192:17ffbe7cf645
    Backport-requested-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   25930:ac8a9f014744
user:        George Dunlap <george.dunlap@eu.citrix.com>
date:        Thu Nov 29 14:58:36 2012 +0000
    
    xl: Suppress spurious warning message for cpupool-list
    
    libxl_cpupool_list() enumerates the cpupools by "probing": calling
    cpupool_info, starting at 0 and stopping when it gets an error. However,
    cpupool_info will print an error when the call to xc_cpupool_getinfo() fails,
    resulting in every xl command that uses libxl_list_cpupool (such as
    cpupool-list) printing that error message spuriously.
    
    Since at the moment the times we want to print the message correspond
    with the use of the existing "exact" parameter, use it to decide
    whether to print the message or not.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    xen-unstable changeset: 26185:d66987697fe3
    Backport-requested-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    
changeset:   25929:5c5c695863f7
user:        Jan Beulich <jbeulich@suse.com>
date:        Tue Nov 27 13:25:17 2012 +0100
    
    x86/time: fix scale_delta() inline assembly
    
    The way it was coded, it clobbered %rdx without telling the compiler.
    This generally didn't cause any problems except when there are two back
    to back invocations (as in plt_overflow()), as in that case the
    compiler may validly assume that it can re-use for the second instance
    the value loaded into %rdx before the first one.
    
    Once at it, also properly relax the second operand of "mul" (there's no
    need for it to be in %rdx, or a register at all), and switch away from
    using explicit register names in the instruction operands.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    xen-unstable changeset: 26188:16bf7f3069a7
    xen-unstable date: Mon Nov 26 16:20:39 UTC 2012
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 07:09:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 07:09:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeKiC-0000DN-6z; Fri, 30 Nov 2012 07:08:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TeKiA-0000DI-4K
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 07:08:34 +0000
Received: from [85.158.143.35:59683] by server-2.bemta-4.messagelabs.com id
	FF/23-28922-17B58B05; Fri, 30 Nov 2012 07:08:33 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-16.tower-21.messagelabs.com!1354259312!13097901!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDkwMDk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5851 invoked from network); 30 Nov 2012 07:08:32 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 30 Nov 2012 07:08:32 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 96823111C;
	Fri, 30 Nov 2012 09:08:31 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 63F6AEC027; Fri, 30 Nov 2012 09:08:31 +0200 (EET)
Date: Fri, 30 Nov 2012 09:08:30 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: greg@enjellic.com
Message-ID: <20121130070830.GL8912@reaktio.net>
References: <konrad.wilk@oracle.com>
	<201211300125.qAU1P143031054@wind.enjellic.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <201211300125.qAU1P143031054@wind.enjellic.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: Qian Hu <qianhu2011@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the
 virtual machine created by xl command?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 07:25:01PM -0600, Dr. Greg Wettstein wrote:
> 
> I was going to get an update back to everyone but got swamped by the
> holiday weekend and a series of hardware failures I had to chase
> after.
> 
> I took advantage of some time over the holiday weekend to chase down
> the passthrough problems and now have it working well on 4.2.0 on all
> kernels up to 3.4.19 using XM.  The original ATI patches have a bug in
> them which causes qemu-dm to core dump on kernels somewhere after
> 2.6.32.x.
> 
> The original patches were bracketing the inb/outb instructions used in
> ati_hw_read()/ati_hw_write with an ioperm() call.  The fix was a
> straight forward replacement of the ioperm() call with a call to
> iopl(3).
> 
> I seem to vaguely remember something about the kernel not properly
> enforcing access controlls on in/out instructions but don't remember
> if that was with a pvops or standard kernel.  In any event the kernel
> behavior changed after 2.6.32.x which triggered the breakage.
> 
> I will post an updated version of the ATI patches under separate cover
> in case anytone else is using them.
> 

Yes please. Thanks!


> 
> We were under some time constraints to get Windows access back working
> with a 'modern' kernel so once things were working reliably with xm I
> didn't get a chance to fiddle with xl.  Given the behavior I saw on
> 2.6.32.x with xl I'm suspicious it may not work.  I'm hoping to get
> back and do some testing early next week.
> 
> I just checked the machine (which is running a Windows session as I
> write this) and dont see any [virtual] references.  This is on 3.4.18
> but I also haven't had the chance to check xl on that kernel.  At
> least a couple of hundred Windows 7 boots have been done with xm so
> 4.2.0 seems solid with that control plane.
> 
> With respect to reservation of the PCI device we have a script which
> unplugs the device and re-plugs it after the Window session
> completes.  The machines are Linux/Windows dual-use so the cards need
> to be active for the Linux sessions.
> 
> The script can be picked up at the following location:
> 
> 	ftp://ftp.enjellic.com/pub/xen/run-passthrough
> 
> I will give xl a try later in the weekend with the updated qemu-dm and
> I will report back the results from a more throroughly controlled test
> environment.
> 
> Thanks for the input, have a good weekend.
> 

Thanks!

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 07:09:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 07:09:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeKiC-0000DN-6z; Fri, 30 Nov 2012 07:08:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TeKiA-0000DI-4K
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 07:08:34 +0000
Received: from [85.158.143.35:59683] by server-2.bemta-4.messagelabs.com id
	FF/23-28922-17B58B05; Fri, 30 Nov 2012 07:08:33 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-16.tower-21.messagelabs.com!1354259312!13097901!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDkwMDk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5851 invoked from network); 30 Nov 2012 07:08:32 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 30 Nov 2012 07:08:32 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 96823111C;
	Fri, 30 Nov 2012 09:08:31 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 63F6AEC027; Fri, 30 Nov 2012 09:08:31 +0200 (EET)
Date: Fri, 30 Nov 2012 09:08:30 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: greg@enjellic.com
Message-ID: <20121130070830.GL8912@reaktio.net>
References: <konrad.wilk@oracle.com>
	<201211300125.qAU1P143031054@wind.enjellic.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <201211300125.qAU1P143031054@wind.enjellic.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: Qian Hu <qianhu2011@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the
 virtual machine created by xl command?
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 07:25:01PM -0600, Dr. Greg Wettstein wrote:
> 
> I was going to get an update back to everyone but got swamped by the
> holiday weekend and a series of hardware failures I had to chase
> after.
> 
> I took advantage of some time over the holiday weekend to chase down
> the passthrough problems and now have it working well on 4.2.0 on all
> kernels up to 3.4.19 using XM.  The original ATI patches have a bug in
> them which causes qemu-dm to core dump on kernels somewhere after
> 2.6.32.x.
> 
> The original patches were bracketing the inb/outb instructions used in
> ati_hw_read()/ati_hw_write with an ioperm() call.  The fix was a
> straight forward replacement of the ioperm() call with a call to
> iopl(3).
> 
> I seem to vaguely remember something about the kernel not properly
> enforcing access controlls on in/out instructions but don't remember
> if that was with a pvops or standard kernel.  In any event the kernel
> behavior changed after 2.6.32.x which triggered the breakage.
> 
> I will post an updated version of the ATI patches under separate cover
> in case anytone else is using them.
> 

Yes please. Thanks!


> 
> We were under some time constraints to get Windows access back working
> with a 'modern' kernel so once things were working reliably with xm I
> didn't get a chance to fiddle with xl.  Given the behavior I saw on
> 2.6.32.x with xl I'm suspicious it may not work.  I'm hoping to get
> back and do some testing early next week.
> 
> I just checked the machine (which is running a Windows session as I
> write this) and dont see any [virtual] references.  This is on 3.4.18
> but I also haven't had the chance to check xl on that kernel.  At
> least a couple of hundred Windows 7 boots have been done with xm so
> 4.2.0 seems solid with that control plane.
> 
> With respect to reservation of the PCI device we have a script which
> unplugs the device and re-plugs it after the Window session
> completes.  The machines are Linux/Windows dual-use so the cards need
> to be active for the Linux sessions.
> 
> The script can be picked up at the following location:
> 
> 	ftp://ftp.enjellic.com/pub/xen/run-passthrough
> 
> I will give xl a try later in the weekend with the updated qemu-dm and
> I will report back the results from a more throroughly controlled test
> environment.
> 
> Thanks for the input, have a good weekend.
> 

Thanks!

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 08:16:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:16:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeLlQ-0001h8-5h; Fri, 30 Nov 2012 08:16:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeLlO-0001h3-Q5
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 08:15:59 +0000
Received: from [85.158.139.211:64839] by server-14.bemta-5.messagelabs.com id
	1A/B5-21768-D3B68B05; Fri, 30 Nov 2012 08:15:57 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354263356!18043828!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3146 invoked from network); 30 Nov 2012 08:15:57 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 08:15:57 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 08:15:56 +0000
Message-Id: <50B8798502000078000ACBD1@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 08:16:53 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
In-Reply-To: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part8EBF6B65.1__="
Cc: xiantao.zhang@intel.com
Subject: [Xen-devel] [PATCH,
 RFC 6.5/7] VT-d: relax source qualifier for MSI of phantom functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part8EBF6B65.1__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

With ordinary requests allowed to come from phantom functions, the
remapping tables ought to be set up to also allow for MSI triggers to
come from other than the "real" device.
---
As the numbering tries to indicate, this ought to go between the 6th
and 7th patch of the previously sent series.

--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -442,13 +442,22 @@ static void set_msi_source_id(struct pci
     devfn =3D pdev->devfn;
     switch ( pdev->type )
     {
+        unsigned int sq;
+
     case DEV_TYPE_PCIe_BRIDGE:
     case DEV_TYPE_PCIe2PCI_BRIDGE:
     case DEV_TYPE_LEGACY_PCI_BRIDGE:
         break;
=20
     case DEV_TYPE_PCIe_ENDPOINT:
-        set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_ALL_16, PCI_BDF2(bus, =
devfn));
+        switch ( pdev->phantom_stride )
+        {
+        case 1: sq =3D SQ_13_IGNORE_3; break;
+        case 2: sq =3D SQ_13_IGNORE_2; break;
+        case 4: sq =3D SQ_13_IGNORE_1; break;
+        default: sq =3D SQ_ALL_16; break;
+        }
+        set_ire_sid(ire, SVT_VERIFY_SID_SQ, sq, PCI_BDF2(bus, devfn));
         break;
=20
     case DEV_TYPE_PCI:



--=__Part8EBF6B65.1__=
Content-Type: text/plain; name="VT-d-phantom-MSI.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="VT-d-phantom-MSI.patch"

VT-d: relax source qualifier for MSI of phantom functions=0A=0AWith =
ordinary requests allowed to come from phantom functions, the=0Aremapping =
tables ought to be set up to also allow for MSI triggers to=0Acome from =
other than the "real" device.=0A---=0AAs the numbering tries to indicate, =
this ought to go between the 6th=0Aand 7th patch of the previously sent =
series.=0A=0A--- a/xen/drivers/passthrough/vtd/intremap.c=0A+++ b/xen/drive=
rs/passthrough/vtd/intremap.c=0A@@ -442,13 +442,22 @@ static void =
set_msi_source_id(struct pci=0A     devfn =3D pdev->devfn;=0A     switch ( =
pdev->type )=0A     {=0A+        unsigned int sq;=0A+=0A     case =
DEV_TYPE_PCIe_BRIDGE:=0A     case DEV_TYPE_PCIe2PCI_BRIDGE:=0A     case =
DEV_TYPE_LEGACY_PCI_BRIDGE:=0A         break;=0A =0A     case DEV_TYPE_PCIe=
_ENDPOINT:=0A-        set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_ALL_16, =
PCI_BDF2(bus, devfn));=0A+        switch ( pdev->phantom_stride )=0A+      =
  {=0A+        case 1: sq =3D SQ_13_IGNORE_3; break;=0A+        case 2: sq =
=3D SQ_13_IGNORE_2; break;=0A+        case 4: sq =3D SQ_13_IGNORE_1; =
break;=0A+        default: sq =3D SQ_ALL_16; break;=0A+        }=0A+       =
 set_ire_sid(ire, SVT_VERIFY_SID_SQ, sq, PCI_BDF2(bus, devfn));=0A         =
break;=0A =0A     case DEV_TYPE_PCI:=0A
--=__Part8EBF6B65.1__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part8EBF6B65.1__=--


From xen-devel-bounces@lists.xen.org Fri Nov 30 08:16:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:16:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeLlQ-0001h8-5h; Fri, 30 Nov 2012 08:16:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeLlO-0001h3-Q5
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 08:15:59 +0000
Received: from [85.158.139.211:64839] by server-14.bemta-5.messagelabs.com id
	1A/B5-21768-D3B68B05; Fri, 30 Nov 2012 08:15:57 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354263356!18043828!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3146 invoked from network); 30 Nov 2012 08:15:57 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 08:15:57 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 08:15:56 +0000
Message-Id: <50B8798502000078000ACBD1@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 08:16:53 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
In-Reply-To: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__Part8EBF6B65.1__="
Cc: xiantao.zhang@intel.com
Subject: [Xen-devel] [PATCH,
 RFC 6.5/7] VT-d: relax source qualifier for MSI of phantom functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part8EBF6B65.1__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

With ordinary requests allowed to come from phantom functions, the
remapping tables ought to be set up to also allow for MSI triggers to
come from other than the "real" device.
---
As the numbering tries to indicate, this ought to go between the 6th
and 7th patch of the previously sent series.

--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -442,13 +442,22 @@ static void set_msi_source_id(struct pci
     devfn =3D pdev->devfn;
     switch ( pdev->type )
     {
+        unsigned int sq;
+
     case DEV_TYPE_PCIe_BRIDGE:
     case DEV_TYPE_PCIe2PCI_BRIDGE:
     case DEV_TYPE_LEGACY_PCI_BRIDGE:
         break;
=20
     case DEV_TYPE_PCIe_ENDPOINT:
-        set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_ALL_16, PCI_BDF2(bus, =
devfn));
+        switch ( pdev->phantom_stride )
+        {
+        case 1: sq =3D SQ_13_IGNORE_3; break;
+        case 2: sq =3D SQ_13_IGNORE_2; break;
+        case 4: sq =3D SQ_13_IGNORE_1; break;
+        default: sq =3D SQ_ALL_16; break;
+        }
+        set_ire_sid(ire, SVT_VERIFY_SID_SQ, sq, PCI_BDF2(bus, devfn));
         break;
=20
     case DEV_TYPE_PCI:



--=__Part8EBF6B65.1__=
Content-Type: text/plain; name="VT-d-phantom-MSI.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="VT-d-phantom-MSI.patch"

VT-d: relax source qualifier for MSI of phantom functions=0A=0AWith =
ordinary requests allowed to come from phantom functions, the=0Aremapping =
tables ought to be set up to also allow for MSI triggers to=0Acome from =
other than the "real" device.=0A---=0AAs the numbering tries to indicate, =
this ought to go between the 6th=0Aand 7th patch of the previously sent =
series.=0A=0A--- a/xen/drivers/passthrough/vtd/intremap.c=0A+++ b/xen/drive=
rs/passthrough/vtd/intremap.c=0A@@ -442,13 +442,22 @@ static void =
set_msi_source_id(struct pci=0A     devfn =3D pdev->devfn;=0A     switch ( =
pdev->type )=0A     {=0A+        unsigned int sq;=0A+=0A     case =
DEV_TYPE_PCIe_BRIDGE:=0A     case DEV_TYPE_PCIe2PCI_BRIDGE:=0A     case =
DEV_TYPE_LEGACY_PCI_BRIDGE:=0A         break;=0A =0A     case DEV_TYPE_PCIe=
_ENDPOINT:=0A-        set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_ALL_16, =
PCI_BDF2(bus, devfn));=0A+        switch ( pdev->phantom_stride )=0A+      =
  {=0A+        case 1: sq =3D SQ_13_IGNORE_3; break;=0A+        case 2: sq =
=3D SQ_13_IGNORE_2; break;=0A+        case 4: sq =3D SQ_13_IGNORE_1; =
break;=0A+        default: sq =3D SQ_ALL_16; break;=0A+        }=0A+       =
 set_ire_sid(ire, SVT_VERIFY_SID_SQ, sq, PCI_BDF2(bus, devfn));=0A         =
break;=0A =0A     case DEV_TYPE_PCI:=0A
--=__Part8EBF6B65.1__=
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.xen.org
http://lists.xen.org/xen-devel

--=__Part8EBF6B65.1__=--


From xen-devel-bounces@lists.xen.org Fri Nov 30 08:22:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:22:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeLrQ-0001pm-2o; Fri, 30 Nov 2012 08:22:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeLrP-0001pd-5h
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 08:22:11 +0000
Received: from [85.158.139.211:16798] by server-16.bemta-5.messagelabs.com id
	CE/E3-21311-2BC68B05; Fri, 30 Nov 2012 08:22:10 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354263729!14247701!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8154 invoked from network); 30 Nov 2012 08:22:09 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 08:22:09 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 08:01:29 +0000
Message-Id: <50B8762102000078000ACBC6@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 08:02:25 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartE9D80C01.2__="
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>
Subject: [Xen-devel] [PATCH] AMD IOMMU: add locking missing from c/s
 26198:ba90ecb0231f
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartE9D80C01.2__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

An oversight of mine; I'm sorry.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -795,6 +795,7 @@ static bool_t __init set_iommu_interrupt
 static void enable_iommu(struct amd_iommu *iommu)
 {
     unsigned long flags;
+    struct irq_desc *desc;
=20
     spin_lock_irqsave(&iommu->lock, flags);
=20
@@ -812,7 +813,11 @@ static void enable_iommu(struct amd_iomm
     if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
         register_iommu_ppr_log_in_mmio_space(iommu);
=20
-    set_msi_affinity(irq_to_desc(iommu->msi.irq), &cpu_online_map);
+    desc =3D irq_to_desc(iommu->msi.irq);
+    spin_lock(&desc->lock);
+    set_msi_affinity(desc, &cpu_online_map);
+    spin_unlock(&desc->lock);
+
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
=20
     set_iommu_ht_flags(iommu);




--=__PartE9D80C01.2__=
Content-Type: text/plain; name="AMD-IOMMU-MSI-fix.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="AMD-IOMMU-MSI-fix.patch"

AMD IOMMU: add locking missing from c/s 26198:ba90ecb0231f=0A=0AAn =
oversight of mine; I'm sorry.=0A=0ASigned-off-by: Jan Beulich <jbeulich@sus=
e.com>=0A=0A--- a/xen/drivers/passthrough/amd/iommu_init.c=0A+++ b/xen/driv=
ers/passthrough/amd/iommu_init.c=0A@@ -795,6 +795,7 @@ static bool_t =
__init set_iommu_interrupt=0A static void enable_iommu(struct amd_iommu =
*iommu)=0A {=0A     unsigned long flags;=0A+    struct irq_desc *desc;=0A =
=0A     spin_lock_irqsave(&iommu->lock, flags);=0A =0A@@ -812,7 +813,11 @@ =
static void enable_iommu(struct amd_iomm=0A     if ( iommu_has_feature(iomm=
u, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )=0A         register_iommu_ppr_log_in_m=
mio_space(iommu);=0A =0A-    set_msi_affinity(irq_to_desc(iommu->msi.irq), =
&cpu_online_map);=0A+    desc =3D irq_to_desc(iommu->msi.irq);=0A+    =
spin_lock(&desc->lock);=0A+    set_msi_affinity(desc, &cpu_online_map);=0A+=
    spin_unlock(&desc->lock);=0A+=0A     amd_iommu_msi_enable(iommu, =
IOMMU_CONTROL_ENABLED);=0A =0A     set_iommu_ht_flags(iommu);=0A
--=__PartE9D80C01.2__=
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.xen.org
http://lists.xen.org/xen-devel

--=__PartE9D80C01.2__=--


From xen-devel-bounces@lists.xen.org Fri Nov 30 08:22:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:22:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeLrQ-0001pm-2o; Fri, 30 Nov 2012 08:22:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeLrP-0001pd-5h
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 08:22:11 +0000
Received: from [85.158.139.211:16798] by server-16.bemta-5.messagelabs.com id
	CE/E3-21311-2BC68B05; Fri, 30 Nov 2012 08:22:10 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354263729!14247701!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8154 invoked from network); 30 Nov 2012 08:22:09 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-13.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 08:22:09 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 08:01:29 +0000
Message-Id: <50B8762102000078000ACBC6@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 08:02:25 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xen.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=__PartE9D80C01.2__="
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>
Subject: [Xen-devel] [PATCH] AMD IOMMU: add locking missing from c/s
 26198:ba90ecb0231f
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartE9D80C01.2__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

An oversight of mine; I'm sorry.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -795,6 +795,7 @@ static bool_t __init set_iommu_interrupt
 static void enable_iommu(struct amd_iommu *iommu)
 {
     unsigned long flags;
+    struct irq_desc *desc;
=20
     spin_lock_irqsave(&iommu->lock, flags);
=20
@@ -812,7 +813,11 @@ static void enable_iommu(struct amd_iomm
     if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
         register_iommu_ppr_log_in_mmio_space(iommu);
=20
-    set_msi_affinity(irq_to_desc(iommu->msi.irq), &cpu_online_map);
+    desc =3D irq_to_desc(iommu->msi.irq);
+    spin_lock(&desc->lock);
+    set_msi_affinity(desc, &cpu_online_map);
+    spin_unlock(&desc->lock);
+
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
=20
     set_iommu_ht_flags(iommu);




--=__PartE9D80C01.2__=
Content-Type: text/plain; name="AMD-IOMMU-MSI-fix.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="AMD-IOMMU-MSI-fix.patch"

AMD IOMMU: add locking missing from c/s 26198:ba90ecb0231f=0A=0AAn =
oversight of mine; I'm sorry.=0A=0ASigned-off-by: Jan Beulich <jbeulich@sus=
e.com>=0A=0A--- a/xen/drivers/passthrough/amd/iommu_init.c=0A+++ b/xen/driv=
ers/passthrough/amd/iommu_init.c=0A@@ -795,6 +795,7 @@ static bool_t =
__init set_iommu_interrupt=0A static void enable_iommu(struct amd_iommu =
*iommu)=0A {=0A     unsigned long flags;=0A+    struct irq_desc *desc;=0A =
=0A     spin_lock_irqsave(&iommu->lock, flags);=0A =0A@@ -812,7 +813,11 @@ =
static void enable_iommu(struct amd_iomm=0A     if ( iommu_has_feature(iomm=
u, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )=0A         register_iommu_ppr_log_in_m=
mio_space(iommu);=0A =0A-    set_msi_affinity(irq_to_desc(iommu->msi.irq), =
&cpu_online_map);=0A+    desc =3D irq_to_desc(iommu->msi.irq);=0A+    =
spin_lock(&desc->lock);=0A+    set_msi_affinity(desc, &cpu_online_map);=0A+=
    spin_unlock(&desc->lock);=0A+=0A     amd_iommu_msi_enable(iommu, =
IOMMU_CONTROL_ENABLED);=0A =0A     set_iommu_ht_flags(iommu);=0A
--=__PartE9D80C01.2__=
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.xen.org
http://lists.xen.org/xen-devel

--=__PartE9D80C01.2__=--


From xen-devel-bounces@lists.xen.org Fri Nov 30 08:22:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:22:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeLrg-0001qY-I8; Fri, 30 Nov 2012 08:22:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeLre-0001qQ-L0
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 08:22:26 +0000
Received: from [85.158.139.211:14736] by server-9.bemta-5.messagelabs.com id
	22/91-29295-1CC68B05; Fri, 30 Nov 2012 08:22:25 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1354263744!18504540!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3437 invoked from network); 30 Nov 2012 08:22:24 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 08:22:24 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 08:22:24 +0000
Message-Id: <50B87B0802000078000ACBDD@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 08:23:20 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Wei Huang" <wei.huang2@amd.com>,"Wei Wang" <weiwang.dd@gmail.com>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
	<50B7226B02000078000AC608@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A483456440339A70F@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A483456440339A70F@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH, RFC 0/7] IOMMU: add phantom function support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 01:37, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:

> 
>> -----Original Message-----
>> From: Jan Beulich [mailto:JBeulich@suse.com]
>> Sent: Thursday, November 29, 2012 3:53 PM
>> To: Zhang, Xiantao
>> Cc: xen-devel
>> Subject: Re: [Xen-devel] [PATCH, RFC 0/7] IOMMU: add phantom function
>> support
>> 
>> >>> On 28.11.12 at 10:41, "Jan Beulich" <JBeulich@suse.com> wrote:
>> > While I'm unaware of devices making use of this functionality in
>> > proper ways, the goal of this patch set is to leverage the enabling of
>> > the specified behavior as a workaround for devices that behave as if
>> > they made use of this functionality _without_ advertising so in the
>> > PCIe capability structure.
>> >
>> > While it would have been possible to leave the generic IOMMU code
>> > untouched, and deal with the creation of the necessary device context
>> > entries in the individual IOMMUs' implementations, I felt that it was
>> > cleaner to have as much of the necessary abstraction in the generic
>> > layer.
>> >
>> > The adjustments in particular imply that for the relevant operations,
>> > (PCI-dev, devfn) tuples get passed, with the PCI device referring to
>> > the real device and devfn representing either the real device or the
>> > phantom function. Consequently, for any operation intended to deal
>> > with the real device, the devfn of the device itself must be used,
>> > whereas for anything targeting the phantom function the passed in
>> > value is the correct one to pass on.
>> >
>> > 1: IOMMU: adjust (re)assign operation parameters
>> > 2: IOMMU: adjust add/remove operation parameters
>> > 3: VT-d: adjust context map/unmap parameters
>> > 4: AMD IOMMU: adjust flush function parameters
>> > 5: IOMMU: consolidate pdev_type() and cache its result for a given
>> > device
>> > 6: IOMMU: add phantom function support
>> > 7: IOMMU: add option to specify devices behaving like ones using
>> > phantom functions
>> >
>> > As the patch set wasn't tested on the affected systems yet, I'm
>> > intentionally not adding S-o-b tags yet. I would appreciate review
>> > nevertheless (and even more so, given that I won't be able to test
>> > this code other than what I did in contrived scenarios).
>> 
>> One open question (that I realized only after sending the batch) is whether
>> for such devices the source ID verification should be set up using one of 
> the
>> SQ_13_IGNORE_* (fitting the stride).
> 
> Yes,  I think so.  If SVT is set to 01b,  SQ should be specially handled 
> according to phantom device's  enabled functions. 
> Xiantao 

I suppose, in a similar fashion, amd_iommu_msi_msg_update_ire()
would need to call update_intremap_entry_from_msi_msg() more
than once for dealing with phantom functions?

If so, in order to make clear that, other than for VT-d, the MSI
message doesn't get altered, I would want to constify that
parameter of update_intremap_entry_from_msi_msg() as I go.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 08:22:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:22:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeLrg-0001qY-I8; Fri, 30 Nov 2012 08:22:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeLre-0001qQ-L0
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 08:22:26 +0000
Received: from [85.158.139.211:14736] by server-9.bemta-5.messagelabs.com id
	22/91-29295-1CC68B05; Fri, 30 Nov 2012 08:22:25 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1354263744!18504540!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3437 invoked from network); 30 Nov 2012 08:22:24 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-4.tower-206.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 08:22:24 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 08:22:24 +0000
Message-Id: <50B87B0802000078000ACBDD@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 08:23:20 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Wei Huang" <wei.huang2@amd.com>,"Wei Wang" <weiwang.dd@gmail.com>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
	<50B7226B02000078000AC608@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A483456440339A70F@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <B6C2EB9186482D47BD0C5A9A483456440339A70F@SHSMSX101.ccr.corp.intel.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH, RFC 0/7] IOMMU: add phantom function support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 01:37, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:

> 
>> -----Original Message-----
>> From: Jan Beulich [mailto:JBeulich@suse.com]
>> Sent: Thursday, November 29, 2012 3:53 PM
>> To: Zhang, Xiantao
>> Cc: xen-devel
>> Subject: Re: [Xen-devel] [PATCH, RFC 0/7] IOMMU: add phantom function
>> support
>> 
>> >>> On 28.11.12 at 10:41, "Jan Beulich" <JBeulich@suse.com> wrote:
>> > While I'm unaware of devices making use of this functionality in
>> > proper ways, the goal of this patch set is to leverage the enabling of
>> > the specified behavior as a workaround for devices that behave as if
>> > they made use of this functionality _without_ advertising so in the
>> > PCIe capability structure.
>> >
>> > While it would have been possible to leave the generic IOMMU code
>> > untouched, and deal with the creation of the necessary device context
>> > entries in the individual IOMMUs' implementations, I felt that it was
>> > cleaner to have as much of the necessary abstraction in the generic
>> > layer.
>> >
>> > The adjustments in particular imply that for the relevant operations,
>> > (PCI-dev, devfn) tuples get passed, with the PCI device referring to
>> > the real device and devfn representing either the real device or the
>> > phantom function. Consequently, for any operation intended to deal
>> > with the real device, the devfn of the device itself must be used,
>> > whereas for anything targeting the phantom function the passed in
>> > value is the correct one to pass on.
>> >
>> > 1: IOMMU: adjust (re)assign operation parameters
>> > 2: IOMMU: adjust add/remove operation parameters
>> > 3: VT-d: adjust context map/unmap parameters
>> > 4: AMD IOMMU: adjust flush function parameters
>> > 5: IOMMU: consolidate pdev_type() and cache its result for a given
>> > device
>> > 6: IOMMU: add phantom function support
>> > 7: IOMMU: add option to specify devices behaving like ones using
>> > phantom functions
>> >
>> > As the patch set wasn't tested on the affected systems yet, I'm
>> > intentionally not adding S-o-b tags yet. I would appreciate review
>> > nevertheless (and even more so, given that I won't be able to test
>> > this code other than what I did in contrived scenarios).
>> 
>> One open question (that I realized only after sending the batch) is whether
>> for such devices the source ID verification should be set up using one of 
> the
>> SQ_13_IGNORE_* (fitting the stride).
> 
> Yes,  I think so.  If SVT is set to 01b,  SQ should be specially handled 
> according to phantom device's  enabled functions. 
> Xiantao 

I suppose, in a similar fashion, amd_iommu_msi_msg_update_ire()
would need to call update_intremap_entry_from_msi_msg() more
than once for dealing with phantom functions?

If so, in order to make clear that, other than for VT-d, the MSI
message doesn't get altered, I would want to constify that
parameter of update_intremap_entry_from_msi_msg() as I go.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 08:33:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:33:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeM2E-0002MU-PD; Fri, 30 Nov 2012 08:33:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeM2E-0002MP-4s
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 08:33:22 +0000
Received: from [193.109.254.147:9234] by server-6.bemta-14.messagelabs.com id
	8D/B5-02788-15F68B05; Fri, 30 Nov 2012 08:33:21 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1354264358!2056892!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17277 invoked from network); 30 Nov 2012 08:32:38 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 08:32:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 08:32:38 +0000
Message-Id: <50B87D6E02000078000ACBF2@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 08:33:34 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Paolo Bonzini" <pbonzini@redhat.com>
References: <1354210461-9739-1-git-send-email-pbonzini@redhat.com>
In-Reply-To: <1354210461-9739-1-git-send-email-pbonzini@redhat.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: find a better location for the
 real-mode trampoline
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 29.11.12 at 18:34, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On some machines, the location at 0x40e does not point to the beginning
> of the EBDA.  Rather, it points to the beginning of the BIOS-reserved
> area of the EBDA, while the option ROMs place their data below that
> segment.
> 
> For this reason, 0x413 is actually a better source than 0x40e to get
> the location of the real-mode trampoline.  But it is even better to
> fetch the information from the multiboot structure, where the boot
> loader has placed the data for us already.

I think if anything we really should make this a minimum calculation
of all three (sanity checked) values, rather than throwing the other
sources out. It's just not certain enough that we can trust all
multiboot implementations.

Of course, ideally we'd consult the memory map, but the E820 one
is unavailable at that point (and getting at it would create a
chicken-and-egg problem).

Jan

> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  xen/arch/x86/boot/head.S | 21 ++++++++++++---------
>  1 file changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
> index 7efa155..1790462 100644
> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -78,16 +78,19 @@ __start:
>          cmp     $0x2BADB002,%eax
>          jne     not_multiboot
>  
> -        /* Set up trampoline segment 64k below EBDA */
> -        movzwl  0x40e,%eax          /* EBDA segment */
> -        cmp     $0xa000,%eax        /* sanity check (high) */
> -        jae     0f
> -        cmp     $0x4000,%eax        /* sanity check (low) */
> -        jae     1f
> -0:
> -        movzwl  0x413,%eax          /* use base memory size on failure */
> -        shl     $10-4,%eax
> +        /* Set up trampoline segment just below end of base memory.
> +         * Prefer to get this information from the multiboot
> +         * structure, if available.
> +         */
> +        mov     4(%ebx),%eax        /* kb of low memory */
> +        testb   $1,(%ebx)           /* test MBI_MEMLIMITS */
> +        jnz     1f
> +
> +        movzwl  0x413,%eax          /* base memory size in kb */
>  1:
> +        shl     $10-4,%eax          /* convert to a segment number */
> +
> +        /* Reserve 64kb for the trampoline */
>          sub     $0x1000,%eax
>  
>          /* From arch/x86/smpboot.c: start_eip had better be page-aligned! */
> -- 
> 1.8.0
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 08:33:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:33:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeM2E-0002MU-PD; Fri, 30 Nov 2012 08:33:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeM2E-0002MP-4s
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 08:33:22 +0000
Received: from [193.109.254.147:9234] by server-6.bemta-14.messagelabs.com id
	8D/B5-02788-15F68B05; Fri, 30 Nov 2012 08:33:21 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1354264358!2056892!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17277 invoked from network); 30 Nov 2012 08:32:38 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 08:32:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 08:32:38 +0000
Message-Id: <50B87D6E02000078000ACBF2@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 08:33:34 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Paolo Bonzini" <pbonzini@redhat.com>
References: <1354210461-9739-1-git-send-email-pbonzini@redhat.com>
In-Reply-To: <1354210461-9739-1-git-send-email-pbonzini@redhat.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen: find a better location for the
 real-mode trampoline
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 29.11.12 at 18:34, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On some machines, the location at 0x40e does not point to the beginning
> of the EBDA.  Rather, it points to the beginning of the BIOS-reserved
> area of the EBDA, while the option ROMs place their data below that
> segment.
> 
> For this reason, 0x413 is actually a better source than 0x40e to get
> the location of the real-mode trampoline.  But it is even better to
> fetch the information from the multiboot structure, where the boot
> loader has placed the data for us already.

I think if anything we really should make this a minimum calculation
of all three (sanity checked) values, rather than throwing the other
sources out. It's just not certain enough that we can trust all
multiboot implementations.

Of course, ideally we'd consult the memory map, but the E820 one
is unavailable at that point (and getting at it would create a
chicken-and-egg problem).

Jan

> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  xen/arch/x86/boot/head.S | 21 ++++++++++++---------
>  1 file changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
> index 7efa155..1790462 100644
> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -78,16 +78,19 @@ __start:
>          cmp     $0x2BADB002,%eax
>          jne     not_multiboot
>  
> -        /* Set up trampoline segment 64k below EBDA */
> -        movzwl  0x40e,%eax          /* EBDA segment */
> -        cmp     $0xa000,%eax        /* sanity check (high) */
> -        jae     0f
> -        cmp     $0x4000,%eax        /* sanity check (low) */
> -        jae     1f
> -0:
> -        movzwl  0x413,%eax          /* use base memory size on failure */
> -        shl     $10-4,%eax
> +        /* Set up trampoline segment just below end of base memory.
> +         * Prefer to get this information from the multiboot
> +         * structure, if available.
> +         */
> +        mov     4(%ebx),%eax        /* kb of low memory */
> +        testb   $1,(%ebx)           /* test MBI_MEMLIMITS */
> +        jnz     1f
> +
> +        movzwl  0x413,%eax          /* base memory size in kb */
>  1:
> +        shl     $10-4,%eax          /* convert to a segment number */
> +
> +        /* Reserve 64kb for the trampoline */
>          sub     $0x1000,%eax
>  
>          /* From arch/x86/smpboot.c: start_eip had better be page-aligned! */
> -- 
> 1.8.0
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 08:36:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:36:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeM4g-0002Ru-B9; Fri, 30 Nov 2012 08:35:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeM4e-0002Rm-GK
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 08:35:52 +0000
Received: from [85.158.138.51:47293] by server-11.bemta-3.messagelabs.com id
	73/B3-19361-7EF68B05; Fri, 30 Nov 2012 08:35:51 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1354264551!32025651!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU2Nzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31465 invoked from network); 30 Nov 2012 08:35:51 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 08:35:51 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16084242"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 08:35:51 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 08:35:50 +0000
Message-ID: <1354264550.6039.37.camel@dagon.hellion.org.uk>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Yi, Shunli" <syi@websense.com>
Date: Fri, 30 Nov 2012 08:35:50 +0000
In-Reply-To: <961EE662BA396D43898AFA993C8F01B775066487@SBJEXCH1A.websense.com>
References: <961EE662BA396D43898AFA993C8F01B775066487@SBJEXCH1A.websense.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [patch] netback: Xennet half die---netback driver
 didn't detect the jiffies wrapping correctly.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-30 at 08:09 +0000, Yi, Shunli wrote:
> Netback driver use " time_after_eq()" to check the jiffies wrapping,
> while this function was only called when the credit is  running out.
> So, if the jiffies wrapped and the credit isn't run out in first half
> jiffies circle, the time_after_eq() cannot check the wrapping any
> more.

Which tree is this against? It doesn't appear to be mainline Linux,
which is all I am really interested in these days.

Also your patch is missing a Signed-off-by and is whitespace damaged.
Please read Documentation/SubmittingPatches and
Documentation/SubmitChecklist.

> This will cause the credit_timerout.expires is set to dozens of days
> in future.
>
>  The netback will stop receiving data from netfront. 
> 
> For example: 
> Jiffies initialized to 0xffffff-(300*HZ), and the
> credit_timeout.expires was initialized to 0xffffff00, 
> After dozens of days,  when the jiffies grow to upper than 0x80000000,
> and the time_after_eq() will cannot check for the wrapping.
> 
> 
> 
> --- drivers/xen/netback/netback.c.org	2012-11-30 15:48:13.109039998 -0500
> +++ drivers/xen/netback/netback.c	2012-11-30 15:48:55.212072898 -0500
> @@ -1272,6 +1272,10 @@ static void net_tx_action(unsigned long
>  		rmb(); /* Ensure that we see the request before we copy it. */
>  		memcpy(&txreq, RING_GET_REQUEST(&netif->tx, i), sizeof(txreq));
>  
> +        /* Check for the jiffies wrapping */
> +        if (time_after_eq(jiffies, netif->credit_timeout.expires))
> +            netif->credit_timeout.expires = jiffies;

Do you not need to remove the similar check from the following block?

I'm also surprised that block doesn't need further adjustment since it
uses netif->credit_timeout.expires as its input and so this change will
change its behaviour.

Perhaps this new addition needs to be in an else block after if
(txreq.size > netif->remaining_credit) ?

Why is there no need to call tx_add_credit in this case? What about
needing to check for a pending timer?

> +
>  		/* Credit-based scheduling. */
>  		if (txreq.size > netif->remaining_credit) {
>  			unsigned long now = jiffies;
> 
> 
> 
> 
> 
>  Protected by Websense Hosted Email Security -- www.websense.com 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 08:36:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:36:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeM4g-0002Ru-B9; Fri, 30 Nov 2012 08:35:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeM4e-0002Rm-GK
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 08:35:52 +0000
Received: from [85.158.138.51:47293] by server-11.bemta-3.messagelabs.com id
	73/B3-19361-7EF68B05; Fri, 30 Nov 2012 08:35:51 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1354264551!32025651!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU2Nzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31465 invoked from network); 30 Nov 2012 08:35:51 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 08:35:51 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16084242"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 08:35:51 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 08:35:50 +0000
Message-ID: <1354264550.6039.37.camel@dagon.hellion.org.uk>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Yi, Shunli" <syi@websense.com>
Date: Fri, 30 Nov 2012 08:35:50 +0000
In-Reply-To: <961EE662BA396D43898AFA993C8F01B775066487@SBJEXCH1A.websense.com>
References: <961EE662BA396D43898AFA993C8F01B775066487@SBJEXCH1A.websense.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [patch] netback: Xennet half die---netback driver
 didn't detect the jiffies wrapping correctly.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-30 at 08:09 +0000, Yi, Shunli wrote:
> Netback driver use " time_after_eq()" to check the jiffies wrapping,
> while this function was only called when the credit is  running out.
> So, if the jiffies wrapped and the credit isn't run out in first half
> jiffies circle, the time_after_eq() cannot check the wrapping any
> more.

Which tree is this against? It doesn't appear to be mainline Linux,
which is all I am really interested in these days.

Also your patch is missing a Signed-off-by and is whitespace damaged.
Please read Documentation/SubmittingPatches and
Documentation/SubmitChecklist.

> This will cause the credit_timerout.expires is set to dozens of days
> in future.
>
>  The netback will stop receiving data from netfront. 
> 
> For example: 
> Jiffies initialized to 0xffffff-(300*HZ), and the
> credit_timeout.expires was initialized to 0xffffff00, 
> After dozens of days,  when the jiffies grow to upper than 0x80000000,
> and the time_after_eq() will cannot check for the wrapping.
> 
> 
> 
> --- drivers/xen/netback/netback.c.org	2012-11-30 15:48:13.109039998 -0500
> +++ drivers/xen/netback/netback.c	2012-11-30 15:48:55.212072898 -0500
> @@ -1272,6 +1272,10 @@ static void net_tx_action(unsigned long
>  		rmb(); /* Ensure that we see the request before we copy it. */
>  		memcpy(&txreq, RING_GET_REQUEST(&netif->tx, i), sizeof(txreq));
>  
> +        /* Check for the jiffies wrapping */
> +        if (time_after_eq(jiffies, netif->credit_timeout.expires))
> +            netif->credit_timeout.expires = jiffies;

Do you not need to remove the similar check from the following block?

I'm also surprised that block doesn't need further adjustment since it
uses netif->credit_timeout.expires as its input and so this change will
change its behaviour.

Perhaps this new addition needs to be in an else block after if
(txreq.size > netif->remaining_credit) ?

Why is there no need to call tx_add_credit in this case? What about
needing to check for a pending timer?

> +
>  		/* Credit-based scheduling. */
>  		if (txreq.size > netif->remaining_credit) {
>  			unsigned long now = jiffies;
> 
> 
> 
> 
> 
>  Protected by Websense Hosted Email Security -- www.websense.com 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 08:39:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:39:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeM7V-0002aA-V4; Fri, 30 Nov 2012 08:38:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeM7U-0002Zx-4U
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 08:38:48 +0000
Received: from [85.158.139.83:32747] by server-15.bemta-5.messagelabs.com id
	70/E3-26920-79078B05; Fri, 30 Nov 2012 08:38:47 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1354264726!27678889!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU2Nzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1162 invoked from network); 30 Nov 2012 08:38:46 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 08:38:46 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16084298"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 08:38:46 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 08:38:46 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeM7S-0004Uz-14;
	Fri, 30 Nov 2012 08:38:46 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeM7R-0007ax-J6;
	Fri, 30 Nov 2012 08:38:45 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14496-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 08:38:45 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14496: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14496 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14496/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-pv           5 xen-boot                  fail REGR. vs. 14482
 test-amd64-i386-qemut-rhel6hvm-amd  5 xen-boot            fail REGR. vs. 14482
 test-amd64-i386-xl-multivcpu  5 xen-boot                  fail REGR. vs. 14482
 test-amd64-i386-xl            5 xen-boot                  fail REGR. vs. 14482
 test-amd64-i386-qemuu-rhel6hvm-amd  5 xen-boot            fail REGR. vs. 14482
 test-amd64-amd64-xl-qemuu-win7-amd64  5 xen-boot          fail REGR. vs. 14482
 test-amd64-i386-pair          8 xen-boot/dst_host         fail REGR. vs. 14482
 test-amd64-i386-pair          7 xen-boot/src_host         fail REGR. vs. 14482
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1  5 xen-boot      fail REGR. vs. 14482
 test-amd64-i386-xl-winxpsp3-vcpus1  5 xen-boot            fail REGR. vs. 14482
 test-amd64-amd64-pair         8 xen-boot/dst_host         fail REGR. vs. 14482
 test-amd64-amd64-pair         7 xen-boot/src_host         fail REGR. vs. 14482
 test-amd64-i386-xend-qemut-winxpsp3  5 xen-boot           fail REGR. vs. 14482
 test-amd64-i386-qemut-win     5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-win       5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-win7-amd64  5 xen-boot                fail REGR. vs. 14482
 test-amd64-amd64-qemut-win    5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-qemut-win  5 xen-boot                 fail REGR. vs. 14482
 test-amd64-amd64-xl-qemut-winxpsp3  5 xen-boot            fail REGR. vs. 14482

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl           5 xen-boot                    fail pass in 14494
 test-amd64-i386-rhel6hvm-amd  5 xen-boot                    fail pass in 14494

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin  5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14482

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  9d88ac6046d8
baseline version:
 xen                  1c69c938f641

------------------------------------------------------------
People who touched revisions under test:
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Kouya Shimura <kouya@jp.fujitsu.com>
  Roger Pau Monn? <roger.pau@citrix.com>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-i386-xl                                           fail    
 test-amd64-i386-rhel6hvm-amd                                 fail    
 test-amd64-i386-qemut-rhel6hvm-amd                           fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          fail    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26205:9d88ac6046d8
tag:         tip
user:        Roger Pau Monne <roger.pau@citrix.com>
date:        Thu Nov 29 11:28:18 2012 +0000
    
    docs: fix persistent grants doc typo
    
    Signed-off-by: Roger Pau Monn? <roger.pau@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- fix additional typo s/this grants/these grants/g ]
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26204:48e211812551
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 29 11:28:17 2012 +0000
    
    xen/arm: build as zImage
    
    The zImage format is extremely simple: it only consists of a magic
    number and 2 addresses in a specific position (see
    http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
    
    Some bootloaders expect a zImage; considering that it doesn't cost us
    much to build Xen compatible with the format, make it so.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- switch from 7*nop + nop to just 8*nop ]
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26203:b5cb6cccc32c
user:        Tim Deegan <tim@xen.org>
date:        Thu Nov 29 11:01:00 2012 +0000
    
    x86/hap: Fix memory leak of domain->arch.hvm_domain.dirty_vram
    
    Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    Committed-by: Tim Deegan <tim@xen.org>
    
    
changeset:   26202:9c6c13bf3803
user:        Tim Deegan <tim@xen.org>
date:        Thu Nov 29 10:49:53 2012 +0000
    
    x86/mm: Comment the definitions of _mfn(), _gfn() &c.
    
    It's not very easy to find them if you don't know to look for the
    TYPE_SAFE() macro.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Committed-by: Tim Deegan <tim@xen.org>
    
    
changeset:   26201:5d7e3c2742e8
user:        Jan Beulich <jbeulich@suse.com>
date:        Thu Nov 29 09:14:55 2012 +0100
    
    VT-d: make scope parsing code type safe
    
    Rather than requiring the scopes to be the first members of their
    respective structures (so that casts can be used to switch between the
    different views), properly use types and container_of().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by Xiantao Zhang <xiantao.zhang@intel.com>
    
    
changeset:   26200:836697b19746
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 17:00:56 2012 +0100
    
    IOMMU: imply "verbose" from "debug"
    
    I think that generally enabling debugging code without also enabling
    verbose output is rather pointless; if someone really wants this, they
    can always pass e.g. "iommu=debug,no-verbose".
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26199:1fce7522daa6
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:08:24 2012 +0100
    
    VT-d: adjust IOMMU interrupt affinities when all CPUs are online
    
    Since these interrupts get setup before APs get brought online, their
    affinities naturally could only ever point to CPU 0 alone so far.
    Adjust this to include potentially multiple CPUs in the target mask
    (when running in one of the cluster modes), and take into account NUMA
    information (to handle the interrupts on a CPU on the node where the
    respective IOMMU is).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26198:ba90ecb0231f
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:07:11 2012 +0100
    
    AMD IOMMU: include IOMMU interrupt information in 'M' debug key output
    
    Note that this also adds a few pieces missing from c/s
    25903:5e4a00b4114c (relevant only when the PCI MSI mask bit is
    supported by an IOMMU, which apparently isn't the case for existing
    implementations).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26197:0bc3a489018f
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:05:52 2012 +0100
    
    VT-d: include IOMMU interrupt information in 'M' debug key output
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26196:5faf5b8b702e
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:03:51 2012 +0100
    
    ACPI: fix return value of XEN_PM_PDC platform op
    
    Should return -EFAULT when copying to guest memory fails.
    
    Once touching this code, also switch to using the more relaxed copy
    function (copying from the same guest memory already validated the
    virtual address range).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26195:7670eabcbafc
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:02:26 2012 +0100
    
    x86: fix hypercall continuation cancellation in XENMAPSPACE_gmfn_range compat wrapper
    
    When no continuation was established, there must also not be an attempt
    to cancel it - hypercall_cancel_continuation(), in the non-HVM, non-
    multicall case, adjusts the guest mode return address in a way assuming
    that an earlier call hypercall_create_continuation() took place.
    
    Once touching this code, also restructure it slightly to improve
    readability and switch to using the more relaxed copy function (copying
    from the same guest memory already validated the virtual address
    range).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26194:0aa1c5136a54
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:01:33 2012 +0100
    
    README: adjust gcc version requirement
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26193:1c69c938f641
user:        George Dunlap <george.dunlap@eu.citrix.com>
date:        Tue Nov 27 14:13:41 2012 +0000
    
    libxl: Fix bug in libxl_cdrom_insert, make more robust against bad xenstore data
    
    libxl_cdrom_insert was failing to initialize the backend type,
    resulting in the wrong default backend.  The result was not only that
    the CD was not inserted properly, but also that some improper xenstore
    entries were created, causing further block commands to fail.
    
    This patch fixes the bug by setting the disk backend type based on the
    type of the existing device.
    
    It also makes the system more robust by checking to see that it has
    got a valid path before proceeding to write a partial xenstore entry.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 08:39:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:39:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeM7V-0002aA-V4; Fri, 30 Nov 2012 08:38:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeM7U-0002Zx-4U
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 08:38:48 +0000
Received: from [85.158.139.83:32747] by server-15.bemta-5.messagelabs.com id
	70/E3-26920-79078B05; Fri, 30 Nov 2012 08:38:47 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1354264726!27678889!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU2Nzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1162 invoked from network); 30 Nov 2012 08:38:46 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 08:38:46 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16084298"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 08:38:46 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 08:38:46 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeM7S-0004Uz-14;
	Fri, 30 Nov 2012 08:38:46 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeM7R-0007ax-J6;
	Fri, 30 Nov 2012 08:38:45 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14496-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 08:38:45 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14496: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14496 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14496/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-pv           5 xen-boot                  fail REGR. vs. 14482
 test-amd64-i386-qemut-rhel6hvm-amd  5 xen-boot            fail REGR. vs. 14482
 test-amd64-i386-xl-multivcpu  5 xen-boot                  fail REGR. vs. 14482
 test-amd64-i386-xl            5 xen-boot                  fail REGR. vs. 14482
 test-amd64-i386-qemuu-rhel6hvm-amd  5 xen-boot            fail REGR. vs. 14482
 test-amd64-amd64-xl-qemuu-win7-amd64  5 xen-boot          fail REGR. vs. 14482
 test-amd64-i386-pair          8 xen-boot/dst_host         fail REGR. vs. 14482
 test-amd64-i386-pair          7 xen-boot/src_host         fail REGR. vs. 14482
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1  5 xen-boot      fail REGR. vs. 14482
 test-amd64-i386-xl-winxpsp3-vcpus1  5 xen-boot            fail REGR. vs. 14482
 test-amd64-amd64-pair         8 xen-boot/dst_host         fail REGR. vs. 14482
 test-amd64-amd64-pair         7 xen-boot/src_host         fail REGR. vs. 14482
 test-amd64-i386-xend-qemut-winxpsp3  5 xen-boot           fail REGR. vs. 14482
 test-amd64-i386-qemut-win     5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-win       5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-win7-amd64  5 xen-boot                fail REGR. vs. 14482
 test-amd64-amd64-qemut-win    5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-qemut-win  5 xen-boot                 fail REGR. vs. 14482
 test-amd64-amd64-xl-qemut-winxpsp3  5 xen-boot            fail REGR. vs. 14482

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl           5 xen-boot                    fail pass in 14494
 test-amd64-i386-rhel6hvm-amd  5 xen-boot                    fail pass in 14494

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin  5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14482

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  9d88ac6046d8
baseline version:
 xen                  1c69c938f641

------------------------------------------------------------
People who touched revisions under test:
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Kouya Shimura <kouya@jp.fujitsu.com>
  Roger Pau Monn? <roger.pau@citrix.com>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-i386-xl                                           fail    
 test-amd64-i386-rhel6hvm-amd                                 fail    
 test-amd64-i386-qemut-rhel6hvm-amd                           fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          fail    
 test-amd64-i386-pv                                           pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26205:9d88ac6046d8
tag:         tip
user:        Roger Pau Monne <roger.pau@citrix.com>
date:        Thu Nov 29 11:28:18 2012 +0000
    
    docs: fix persistent grants doc typo
    
    Signed-off-by: Roger Pau Monn? <roger.pau@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- fix additional typo s/this grants/these grants/g ]
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26204:48e211812551
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 29 11:28:17 2012 +0000
    
    xen/arm: build as zImage
    
    The zImage format is extremely simple: it only consists of a magic
    number and 2 addresses in a specific position (see
    http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
    
    Some bootloaders expect a zImage; considering that it doesn't cost us
    much to build Xen compatible with the format, make it so.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- switch from 7*nop + nop to just 8*nop ]
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26203:b5cb6cccc32c
user:        Tim Deegan <tim@xen.org>
date:        Thu Nov 29 11:01:00 2012 +0000
    
    x86/hap: Fix memory leak of domain->arch.hvm_domain.dirty_vram
    
    Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    Committed-by: Tim Deegan <tim@xen.org>
    
    
changeset:   26202:9c6c13bf3803
user:        Tim Deegan <tim@xen.org>
date:        Thu Nov 29 10:49:53 2012 +0000
    
    x86/mm: Comment the definitions of _mfn(), _gfn() &c.
    
    It's not very easy to find them if you don't know to look for the
    TYPE_SAFE() macro.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Committed-by: Tim Deegan <tim@xen.org>
    
    
changeset:   26201:5d7e3c2742e8
user:        Jan Beulich <jbeulich@suse.com>
date:        Thu Nov 29 09:14:55 2012 +0100
    
    VT-d: make scope parsing code type safe
    
    Rather than requiring the scopes to be the first members of their
    respective structures (so that casts can be used to switch between the
    different views), properly use types and container_of().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by Xiantao Zhang <xiantao.zhang@intel.com>
    
    
changeset:   26200:836697b19746
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 17:00:56 2012 +0100
    
    IOMMU: imply "verbose" from "debug"
    
    I think that generally enabling debugging code without also enabling
    verbose output is rather pointless; if someone really wants this, they
    can always pass e.g. "iommu=debug,no-verbose".
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26199:1fce7522daa6
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:08:24 2012 +0100
    
    VT-d: adjust IOMMU interrupt affinities when all CPUs are online
    
    Since these interrupts get setup before APs get brought online, their
    affinities naturally could only ever point to CPU 0 alone so far.
    Adjust this to include potentially multiple CPUs in the target mask
    (when running in one of the cluster modes), and take into account NUMA
    information (to handle the interrupts on a CPU on the node where the
    respective IOMMU is).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26198:ba90ecb0231f
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:07:11 2012 +0100
    
    AMD IOMMU: include IOMMU interrupt information in 'M' debug key output
    
    Note that this also adds a few pieces missing from c/s
    25903:5e4a00b4114c (relevant only when the PCI MSI mask bit is
    supported by an IOMMU, which apparently isn't the case for existing
    implementations).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26197:0bc3a489018f
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:05:52 2012 +0100
    
    VT-d: include IOMMU interrupt information in 'M' debug key output
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26196:5faf5b8b702e
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:03:51 2012 +0100
    
    ACPI: fix return value of XEN_PM_PDC platform op
    
    Should return -EFAULT when copying to guest memory fails.
    
    Once touching this code, also switch to using the more relaxed copy
    function (copying from the same guest memory already validated the
    virtual address range).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26195:7670eabcbafc
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:02:26 2012 +0100
    
    x86: fix hypercall continuation cancellation in XENMAPSPACE_gmfn_range compat wrapper
    
    When no continuation was established, there must also not be an attempt
    to cancel it - hypercall_cancel_continuation(), in the non-HVM, non-
    multicall case, adjusts the guest mode return address in a way assuming
    that an earlier call hypercall_create_continuation() took place.
    
    Once touching this code, also restructure it slightly to improve
    readability and switch to using the more relaxed copy function (copying
    from the same guest memory already validated the virtual address
    range).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26194:0aa1c5136a54
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:01:33 2012 +0100
    
    README: adjust gcc version requirement
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26193:1c69c938f641
user:        George Dunlap <george.dunlap@eu.citrix.com>
date:        Tue Nov 27 14:13:41 2012 +0000
    
    libxl: Fix bug in libxl_cdrom_insert, make more robust against bad xenstore data
    
    libxl_cdrom_insert was failing to initialize the backend type,
    resulting in the wrong default backend.  The result was not only that
    the CD was not inserted properly, but also that some improper xenstore
    entries were created, causing further block commands to fail.
    
    This patch fixes the bug by setting the disk backend type based on the
    type of the existing device.
    
    It also makes the system more robust by checking to see that it has
    got a valid path before proceeding to write a partial xenstore entry.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 08:41:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:41:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeMA8-0002sg-Re; Fri, 30 Nov 2012 08:41:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeMA7-0002sZ-M7
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 08:41:31 +0000
Received: from [85.158.143.99:52132] by server-1.bemta-4.messagelabs.com id
	A5/0D-27934-A3178B05; Fri, 30 Nov 2012 08:41:30 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1354264890!17696869!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU2Nzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5903 invoked from network); 30 Nov 2012 08:41:30 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 08:41:30 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16084371"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 08:41:30 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 08:41:30 +0000
Message-ID: <1354264889.6039.41.camel@dagon.hellion.org.uk>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Brian Buhrow <buhrow@nfbcal.org>
Date: Fri, 30 Nov 2012 08:41:29 +0000
In-Reply-To: <201211291818.qATIIfbX012104@lothlorien.nfbcal.org>
References: <201211291818.qATIIfbX012104@lothlorien.nfbcal.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Toby Karyadi <toby.karyadi@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"port-xen@netbsd.org" <port-xen@NetBSD.org>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
 handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 18:18 +0000, Brian Buhrow wrote:

> 2.  Examine the file and see if it has a signature for QCOW or QCOW2 format.
> (How does qemu figure out which it is?  Is it a simple bit of code that
> could be snagged for re-use?)  Alternatively, check to see if it's a raw
> image, and, if it is not, call qemu, otherwise, call vnd and use the
> existing backend  block driver.  

You should never probe for raw vs qcow (or any other container format)
in this way.

Imagine a VM with a "raw" disk. A malicious administrator of this VM
could write a qcow header to it turning it into a snapshot backed by any
path they like in dom0 (say /etc/shadow, ssh host keys, etc). Then they
reboot their guest, the probing determines that it is now a qcow image
with the given backing file, the VM admin simply reads from the disk to
get at the dom0 file.

The format of the image must always be specified by the user.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 08:41:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:41:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeMA8-0002sg-Re; Fri, 30 Nov 2012 08:41:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeMA7-0002sZ-M7
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 08:41:31 +0000
Received: from [85.158.143.99:52132] by server-1.bemta-4.messagelabs.com id
	A5/0D-27934-A3178B05; Fri, 30 Nov 2012 08:41:30 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1354264890!17696869!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU2Nzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5903 invoked from network); 30 Nov 2012 08:41:30 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 08:41:30 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16084371"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 08:41:30 +0000
Received: from [127.0.0.1] (10.80.16.67) by smtprelay.citrix.com
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 08:41:30 +0000
Message-ID: <1354264889.6039.41.camel@dagon.hellion.org.uk>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Brian Buhrow <buhrow@nfbcal.org>
Date: Fri, 30 Nov 2012 08:41:29 +0000
In-Reply-To: <201211291818.qATIIfbX012104@lothlorien.nfbcal.org>
References: <201211291818.qATIIfbX012104@lothlorien.nfbcal.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Toby Karyadi <toby.karyadi@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"port-xen@netbsd.org" <port-xen@NetBSD.org>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
 handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 18:18 +0000, Brian Buhrow wrote:

> 2.  Examine the file and see if it has a signature for QCOW or QCOW2 format.
> (How does qemu figure out which it is?  Is it a simple bit of code that
> could be snagged for re-use?)  Alternatively, check to see if it's a raw
> image, and, if it is not, call qemu, otherwise, call vnd and use the
> existing backend  block driver.  

You should never probe for raw vs qcow (or any other container format)
in this way.

Imagine a VM with a "raw" disk. A malicious administrator of this VM
could write a qcow header to it turning it into a snapshot backed by any
path they like in dom0 (say /etc/shadow, ssh host keys, etc). Then they
reboot their guest, the probing determines that it is now a qcow image
with the given backing file, the VM admin simply reads from the disk to
get at the dom0 file.

The format of the image must always be specified by the user.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 08:43:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:43:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeMBT-0002zH-Cm; Fri, 30 Nov 2012 08:42:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TeMBS-0002zB-BV
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 08:42:54 +0000
Received: from [85.158.139.211:58925] by server-13.bemta-5.messagelabs.com id
	72/14-27809-D8178B05; Fri, 30 Nov 2012 08:42:53 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1354264973!18523375!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU2Nzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23168 invoked from network); 30 Nov 2012 08:42:53 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 08:42:53 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16084400"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 08:42:52 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 08:42:52 +0000
Message-ID: <50B8718C.1090405@citrix.com>
Date: Fri, 30 Nov 2012 09:42:52 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Manuel Bouyer <bouyer@antioche.eu.org>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr>
In-Reply-To: <20121129185635.GA1045@asim.lip6.fr>
Cc: "port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 29/11/12 19:56, Manuel Bouyer wrote:
> On Thu, Nov 29, 2012 at 06:31:45PM +0100, Roger Pau Monne wrote:
>> The following series adds support for NetBSD gntdev to libxc, and 
>> makes libxl use Qemu as a disk backend if an image file stored on a 
>> remote filesystem is used.
> 
> 
> Can't you let the administrator decide this in the domU's config file ?
> Right now vnd on nfs has problems, but nothing unfixable.
> So one day you'll want to use the kernel driver for nfs too.
> But maybe other local filesystems will have the problem.
> So it's not for the tool do decide in the back of the admin.

We can always add a configure check later when this is fixed to decide
if it is needed or not. I don't like the idea of having to set a
configuration option if you want to use disk images on NFS, because if
you don't know about this specific issue your whole Dom0 will crash
which is really not desired or user friendly.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 08:43:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:43:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeMBT-0002zH-Cm; Fri, 30 Nov 2012 08:42:55 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TeMBS-0002zB-BV
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 08:42:54 +0000
Received: from [85.158.139.211:58925] by server-13.bemta-5.messagelabs.com id
	72/14-27809-D8178B05; Fri, 30 Nov 2012 08:42:53 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1354264973!18523375!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU2Nzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23168 invoked from network); 30 Nov 2012 08:42:53 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 08:42:53 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16084400"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 08:42:52 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 08:42:52 +0000
Message-ID: <50B8718C.1090405@citrix.com>
Date: Fri, 30 Nov 2012 09:42:52 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Manuel Bouyer <bouyer@antioche.eu.org>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr>
In-Reply-To: <20121129185635.GA1045@asim.lip6.fr>
Cc: "port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 29/11/12 19:56, Manuel Bouyer wrote:
> On Thu, Nov 29, 2012 at 06:31:45PM +0100, Roger Pau Monne wrote:
>> The following series adds support for NetBSD gntdev to libxc, and 
>> makes libxl use Qemu as a disk backend if an image file stored on a 
>> remote filesystem is used.
> 
> 
> Can't you let the administrator decide this in the domU's config file ?
> Right now vnd on nfs has problems, but nothing unfixable.
> So one day you'll want to use the kernel driver for nfs too.
> But maybe other local filesystems will have the problem.
> So it's not for the tool do decide in the back of the admin.

We can always add a configure check later when this is fixed to decide
if it is needed or not. I don't like the idea of having to set a
configuration option if you want to use disk images on NFS, because if
you don't know about this specific issue your whole Dom0 will crash
which is really not desired or user friendly.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 08:46:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:46:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeMF6-0003Bv-0d; Fri, 30 Nov 2012 08:46:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TeMF5-0003Bq-E3
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 08:46:39 +0000
Received: from [85.158.139.211:53698] by server-15.bemta-5.messagelabs.com id
	66/02-26920-E6278B05; Fri, 30 Nov 2012 08:46:38 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354265198!14251194!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10815 invoked from network); 30 Nov 2012 08:46:38 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 08:46:38 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16084524"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 08:46:37 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 08:46:37 +0000
Message-ID: <50B8726D.6020902@citrix.com>
Date: Fri, 30 Nov 2012 09:46:37 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <201211291818.qATIIfbX012104@lothlorien.nfbcal.org>
	<1354264889.6039.41.camel@dagon.hellion.org.uk>
In-Reply-To: <1354264889.6039.41.camel@dagon.hellion.org.uk>
Cc: Toby Karyadi <toby.karyadi@gmail.com>,
	"port-xen@netbsd.org" <port-xen@NetBSD.org>,
	Brian Buhrow <buhrow@nfbcal.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
 handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/12 09:41, Ian Campbell wrote:
> On Thu, 2012-11-29 at 18:18 +0000, Brian Buhrow wrote:
> 
>> 2.  Examine the file and see if it has a signature for QCOW or QCOW2 format.
>> (How does qemu figure out which it is?  Is it a simple bit of code that
>> could be snagged for re-use?)  Alternatively, check to see if it's a raw
>> image, and, if it is not, call qemu, otherwise, call vnd and use the
>> existing backend  block driver.  
> 
> You should never probe for raw vs qcow (or any other container format)
> in this way.
> 
> Imagine a VM with a "raw" disk. A malicious administrator of this VM
> could write a qcow header to it turning it into a snapshot backed by any
> path they like in dom0 (say /etc/shadow, ssh host keys, etc). Then they
> reboot their guest, the probing determines that it is now a qcow image
> with the given backing file, the VM admin simply reads from the disk to
> get at the dom0 file.
> 
> The format of the image must always be specified by the user.

Yes, this was my bad, qcow or other non raw formats have to be specified
in the configuration file. The only thing we have to decide is whether
we will handle the raw image file using vnd or qemu. See version v2 of
this patch series.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 08:46:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:46:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeMF6-0003Bv-0d; Fri, 30 Nov 2012 08:46:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TeMF5-0003Bq-E3
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 08:46:39 +0000
Received: from [85.158.139.211:53698] by server-15.bemta-5.messagelabs.com id
	66/02-26920-E6278B05; Fri, 30 Nov 2012 08:46:38 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354265198!14251194!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10815 invoked from network); 30 Nov 2012 08:46:38 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 08:46:38 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16084524"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 08:46:37 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 08:46:37 +0000
Message-ID: <50B8726D.6020902@citrix.com>
Date: Fri, 30 Nov 2012 09:46:37 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <201211291818.qATIIfbX012104@lothlorien.nfbcal.org>
	<1354264889.6039.41.camel@dagon.hellion.org.uk>
In-Reply-To: <1354264889.6039.41.camel@dagon.hellion.org.uk>
Cc: Toby Karyadi <toby.karyadi@gmail.com>,
	"port-xen@netbsd.org" <port-xen@NetBSD.org>,
	Brian Buhrow <buhrow@nfbcal.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/2] libxl: switch NetBSD image file
 handling to Qemu
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/12 09:41, Ian Campbell wrote:
> On Thu, 2012-11-29 at 18:18 +0000, Brian Buhrow wrote:
> 
>> 2.  Examine the file and see if it has a signature for QCOW or QCOW2 format.
>> (How does qemu figure out which it is?  Is it a simple bit of code that
>> could be snagged for re-use?)  Alternatively, check to see if it's a raw
>> image, and, if it is not, call qemu, otherwise, call vnd and use the
>> existing backend  block driver.  
> 
> You should never probe for raw vs qcow (or any other container format)
> in this way.
> 
> Imagine a VM with a "raw" disk. A malicious administrator of this VM
> could write a qcow header to it turning it into a snapshot backed by any
> path they like in dom0 (say /etc/shadow, ssh host keys, etc). Then they
> reboot their guest, the probing determines that it is now a qcow image
> with the given backing file, the VM admin simply reads from the disk to
> get at the dom0 file.
> 
> The format of the image must always be specified by the user.

Yes, this was my bad, qcow or other non raw formats have to be specified
in the configuration file. The only thing we have to decide is whether
we will handle the raw image file using vnd or qemu. See version v2 of
this patch series.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 08:53:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:53:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeML4-0003Ur-Rp; Fri, 30 Nov 2012 08:52:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bouyer@antioche.eu.org>) id 1TeML3-0003Uk-UB
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 08:52:50 +0000
Received: from [85.158.143.99:53252] by server-2.bemta-4.messagelabs.com id
	A8/70-28922-1E378B05; Fri, 30 Nov 2012 08:52:49 +0000
X-Env-Sender: bouyer@antioche.eu.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1354265566!19937926!1
X-Originating-IP: [62.212.96.44]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20570 invoked from network); 30 Nov 2012 08:52:46 -0000
Received: from bouyer.net1.nerim.net (HELO chassiron.antioche.eu.org)
	(62.212.96.44) by server-11.tower-216.messagelabs.com with SMTP;
	30 Nov 2012 08:52:46 -0000
Received: from rochebonne.antioche.eu.org (rochebonne
	[IPv6:2001:7a8:242c:0:213:72ff:fe8e:9910])
	by chassiron.antioche.eu.org (8.14.4/8.12.11) with ESMTP id
	qAU8qf4c019659; Fri, 30 Nov 2012 09:52:41 +0100 (MET)
Received: by rochebonne.antioche.eu.org (Postfix, from userid 1210)
	id BB96A2A3A; Fri, 30 Nov 2012 09:52:41 +0100 (CET)
Date: Fri, 30 Nov 2012 09:52:41 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Message-ID: <20121130085241.GC311@asim.lip6.fr>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr> <50B8718C.1090405@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B8718C.1090405@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6
	(chassiron.antioche.eu.org
	[IPv6:2001:7a8:242c:0:a00:20ff:fe1c:276e]);
	Fri, 30 Nov 2012 09:52:42 +0100 (MET)
Cc: "port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 09:42:52AM +0100, Roger Pau Monn=E9 wrote:
> On 29/11/12 19:56, Manuel Bouyer wrote:
> > On Thu, Nov 29, 2012 at 06:31:45PM +0100, Roger Pau Monne wrote:
> >> The following series adds support for NetBSD gntdev to libxc, and =

> >> makes libxl use Qemu as a disk backend if an image file stored on a =

> >> remote filesystem is used.
> > =

> > =

> > Can't you let the administrator decide this in the domU's config file ?
> > Right now vnd on nfs has problems, but nothing unfixable.
> > So one day you'll want to use the kernel driver for nfs too.
> > But maybe other local filesystems will have the problem.
> > So it's not for the tool do decide in the back of the admin.
> =

> We can always add a configure check later when this is fixed to decide
> if it is needed or not. I don't like the idea of having to set a
> configuration option if you want to use disk images on NFS, because if
> you don't know about this specific issue your whole Dom0 will crash
> which is really not desired or user friendly.

And I don't like the idea of software doing things in my back.
And, beside this, I don't think local vs remote is the right criteria.
There are remote filesystems which may play nice with vnd. There
are local filesystems that may not play nice with vnd.


-- =

Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 08:53:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 08:53:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeML4-0003Ur-Rp; Fri, 30 Nov 2012 08:52:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bouyer@antioche.eu.org>) id 1TeML3-0003Uk-UB
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 08:52:50 +0000
Received: from [85.158.143.99:53252] by server-2.bemta-4.messagelabs.com id
	A8/70-28922-1E378B05; Fri, 30 Nov 2012 08:52:49 +0000
X-Env-Sender: bouyer@antioche.eu.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1354265566!19937926!1
X-Originating-IP: [62.212.96.44]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20570 invoked from network); 30 Nov 2012 08:52:46 -0000
Received: from bouyer.net1.nerim.net (HELO chassiron.antioche.eu.org)
	(62.212.96.44) by server-11.tower-216.messagelabs.com with SMTP;
	30 Nov 2012 08:52:46 -0000
Received: from rochebonne.antioche.eu.org (rochebonne
	[IPv6:2001:7a8:242c:0:213:72ff:fe8e:9910])
	by chassiron.antioche.eu.org (8.14.4/8.12.11) with ESMTP id
	qAU8qf4c019659; Fri, 30 Nov 2012 09:52:41 +0100 (MET)
Received: by rochebonne.antioche.eu.org (Postfix, from userid 1210)
	id BB96A2A3A; Fri, 30 Nov 2012 09:52:41 +0100 (CET)
Date: Fri, 30 Nov 2012 09:52:41 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Message-ID: <20121130085241.GC311@asim.lip6.fr>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr> <50B8718C.1090405@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B8718C.1090405@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6
	(chassiron.antioche.eu.org
	[IPv6:2001:7a8:242c:0:a00:20ff:fe1c:276e]);
	Fri, 30 Nov 2012 09:52:42 +0100 (MET)
Cc: "port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 09:42:52AM +0100, Roger Pau Monn=E9 wrote:
> On 29/11/12 19:56, Manuel Bouyer wrote:
> > On Thu, Nov 29, 2012 at 06:31:45PM +0100, Roger Pau Monne wrote:
> >> The following series adds support for NetBSD gntdev to libxc, and =

> >> makes libxl use Qemu as a disk backend if an image file stored on a =

> >> remote filesystem is used.
> > =

> > =

> > Can't you let the administrator decide this in the domU's config file ?
> > Right now vnd on nfs has problems, but nothing unfixable.
> > So one day you'll want to use the kernel driver for nfs too.
> > But maybe other local filesystems will have the problem.
> > So it's not for the tool do decide in the back of the admin.
> =

> We can always add a configure check later when this is fixed to decide
> if it is needed or not. I don't like the idea of having to set a
> configuration option if you want to use disk images on NFS, because if
> you don't know about this specific issue your whole Dom0 will crash
> which is really not desired or user friendly.

And I don't like the idea of software doing things in my back.
And, beside this, I don't think local vs remote is the right criteria.
There are remote filesystems which may play nice with vnd. There
are local filesystems that may not play nice with vnd.


-- =

Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:06:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:06:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeMXb-0003pr-Hv; Fri, 30 Nov 2012 09:05:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <syi@websense.com>) id 1TeMXZ-0003pk-8a
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 09:05:45 +0000
Received: from [85.158.143.99:65285] by server-1.bemta-4.messagelabs.com id
	5B/BC-27934-8E678B05; Fri, 30 Nov 2012 09:05:44 +0000
X-Env-Sender: syi@websense.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354266322!22221397!1
X-Originating-IP: [85.115.56.190]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODUuMTE1LjU2LjE5MCA9PiAxMDI3MTUy\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19748 invoked from network); 30 Nov 2012 09:05:23 -0000
Received: from cluster-b.mailcontrol.com (HELO cluster-b.mailcontrol.com)
	(85.115.56.190)
	by server-12.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 09:05:23 -0000
Received: from ssdwbsnapp.websense.com (static-204-15-65-158.websense.com
	[204.15.65.158] (may be forged))
	by rly36b.srv.mailcontrol.com (MailControl) with ESMTP id
	qAU88vbX018928
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 30 Nov 2012 08:08:59 GMT
Received: from SSDEXCH1A.websense.com (unknown [10.8.1.91])
	by Websense Email Security Gateway with ESMTP id 6BB4D1000002;
	Fri, 30 Nov 2012 00:08:38 -0800 (PST)
Received: from SBJEXCH1B.websense.com (10.32.8.102) by SSDEXCH1A.websense.com
	(10.8.1.91) with Microsoft SMTP Server (TLS) id 14.2.283.3;
	Fri, 30 Nov 2012 00:08:55 -0800
Received: from SBJEXCH1A.websense.com ([169.254.1.38]) by
	SBJEXCH1B.websense.com ([169.254.2.183]) with mapi id 14.02.0283.003;
	Fri, 30 Nov 2012 16:09:20 +0800
From: "Yi, Shunli" <syi@websense.com>
To: Ian Campbell <ian.campbell@citrix.com>
Thread-Topic: [patch] netback: Xennet half die---netback driver didn't
	detect the jiffies wrapping correctly. 
Thread-Index: Ac3Oz+iEY12Lj/idR8qDspxLhrcnuw==
Date: Fri, 30 Nov 2012 08:09:19 +0000
Message-ID: <961EE662BA396D43898AFA993C8F01B775066487@SBJEXCH1A.websense.com>
Accept-Language: zh-CN, en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.32.134.106]
Content-Type: multipart/mixed;
	boundary="_002_961EE662BA396D43898AFA993C8F01B775066487SBJEXCH1Awebsen_"
MIME-Version: 1.0
X-Scanned-By: MailControl 11783.69 (www.mailcontrol.com) on 10.66.0.146
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [Xen-devel] [patch] netback: Xennet half die---netback driver
 didn't detect the jiffies wrapping correctly.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_961EE662BA396D43898AFA993C8F01B775066487SBJEXCH1Awebsen_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable


Netback driver use " time_after_eq()" to check the jiffies wrapping, while =
this function was only called when the credit is  running out.
So, if the jiffies wrapped and the credit isn't run out in first half jiffi=
es circle, the time_after_eq() cannot check the wrapping any more.

This will cause the credit_timerout.expires is set to dozens of days in fut=
ure. The netback will stop receiving data from netfront.=20

For example:=20
Jiffies initialized to 0xffffff-(300*HZ), and the credit_timeout.expires wa=
s initialized to 0xffffff00,=20
After dozens of days,  when the jiffies grow to upper than 0x80000000, and =
the time_after_eq() will cannot check for the wrapping.



--- drivers/xen/netback/netback.c.org	2012-11-30 15:48:13.109039998 -0500
+++ drivers/xen/netback/netback.c	2012-11-30 15:48:55.212072898 -0500
@@ -1272,6 +1272,10 @@ static void net_tx_action(unsigned long
 		rmb(); /* Ensure that we see the request before we copy it. */
 		memcpy(&txreq, RING_GET_REQUEST(&netif->tx, i), sizeof(txreq));
=20
+        /* Check for the jiffies wrapping */
+        if (time_after_eq(jiffies, netif->credit_timeout.expires))
+            netif->credit_timeout.expires =3D jiffies;
+
 		/* Credit-based scheduling. */
 		if (txreq.size > netif->remaining_credit) {
 			unsigned long now =3D jiffies;





 Protected by Websense Hosted Email Security -- www.websense.com=20

--_002_961EE662BA396D43898AFA993C8F01B775066487SBJEXCH1Awebsen_
Content-Type: application/octet-stream;
	name="xen-netback-jiffies-wrapping.patch"
Content-Description: xen-netback-jiffies-wrapping.patch
Content-Disposition: attachment; creation-date="Fri, 30 Nov 2012 08:00:51 GMT"; filename="xen-netback-jiffies-wrapping.patch"; modification-date="Fri, 30 Nov 2012 20:49:54 GMT"; size="626"
Content-Transfer-Encoding: base64

LS0tIGRyaXZlcnMveGVuL25ldGJhY2svbmV0YmFjay5jLm9yZwkyMDEyLTEx
LTMwIDE1OjQ4OjEzLjEwOTAzOTk5OCAtMDUwMAorKysgZHJpdmVycy94ZW4v
bmV0YmFjay9uZXRiYWNrLmMJMjAxMi0xMS0zMCAxNTo0ODo1NS4yMTIwNzI4
OTggLTA1MDAKQEAgLTEyNzIsNiArMTI3MiwxMCBAQCBzdGF0aWMgdm9pZCBu
ZXRfdHhfYWN0aW9uKHVuc2lnbmVkIGxvbmcKIAkJcm1iKCk7IC8qIEVuc3Vy
ZSB0aGF0IHdlIHNlZSB0aGUgcmVxdWVzdCBiZWZvcmUgd2UgY29weSBpdC4g
Ki8KIAkJbWVtY3B5KCZ0eHJlcSwgUklOR19HRVRfUkVRVUVTVCgmbmV0aWYt
PnR4LCBpKSwgc2l6ZW9mKHR4cmVxKSk7CiAKKyAgICAgICAgLyogQ2hlY2sg
Zm9yIHRoZSBqaWZmaWVzIHdyYXBwaW5nICovCisgICAgICAgIGlmICh0aW1l
X2FmdGVyX2VxKGppZmZpZXMsIG5ldGlmLT5jcmVkaXRfdGltZW91dC5leHBp
cmVzKSkKKyAgICAgICAgICAgIG5ldGlmLT5jcmVkaXRfdGltZW91dC5leHBp
cmVzID0gamlmZmllczsKKwogCQkvKiBDcmVkaXQtYmFzZWQgc2NoZWR1bGlu
Zy4gKi8KIAkJaWYgKHR4cmVxLnNpemUgPiBuZXRpZi0+cmVtYWluaW5nX2Ny
ZWRpdCkgewogCQkJdW5zaWduZWQgbG9uZyBub3cgPSBqaWZmaWVzOwo=

--_002_961EE662BA396D43898AFA993C8F01B775066487SBJEXCH1Awebsen_
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.xen.org
http://lists.xen.org/xen-devel

--_002_961EE662BA396D43898AFA993C8F01B775066487SBJEXCH1Awebsen_--


From xen-devel-bounces@lists.xen.org Fri Nov 30 09:06:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:06:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeMXb-0003pr-Hv; Fri, 30 Nov 2012 09:05:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <syi@websense.com>) id 1TeMXZ-0003pk-8a
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 09:05:45 +0000
Received: from [85.158.143.99:65285] by server-1.bemta-4.messagelabs.com id
	5B/BC-27934-8E678B05; Fri, 30 Nov 2012 09:05:44 +0000
X-Env-Sender: syi@websense.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354266322!22221397!1
X-Originating-IP: [85.115.56.190]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogODUuMTE1LjU2LjE5MCA9PiAxMDI3MTUy\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19748 invoked from network); 30 Nov 2012 09:05:23 -0000
Received: from cluster-b.mailcontrol.com (HELO cluster-b.mailcontrol.com)
	(85.115.56.190)
	by server-12.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 09:05:23 -0000
Received: from ssdwbsnapp.websense.com (static-204-15-65-158.websense.com
	[204.15.65.158] (may be forged))
	by rly36b.srv.mailcontrol.com (MailControl) with ESMTP id
	qAU88vbX018928
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 30 Nov 2012 08:08:59 GMT
Received: from SSDEXCH1A.websense.com (unknown [10.8.1.91])
	by Websense Email Security Gateway with ESMTP id 6BB4D1000002;
	Fri, 30 Nov 2012 00:08:38 -0800 (PST)
Received: from SBJEXCH1B.websense.com (10.32.8.102) by SSDEXCH1A.websense.com
	(10.8.1.91) with Microsoft SMTP Server (TLS) id 14.2.283.3;
	Fri, 30 Nov 2012 00:08:55 -0800
Received: from SBJEXCH1A.websense.com ([169.254.1.38]) by
	SBJEXCH1B.websense.com ([169.254.2.183]) with mapi id 14.02.0283.003;
	Fri, 30 Nov 2012 16:09:20 +0800
From: "Yi, Shunli" <syi@websense.com>
To: Ian Campbell <ian.campbell@citrix.com>
Thread-Topic: [patch] netback: Xennet half die---netback driver didn't
	detect the jiffies wrapping correctly. 
Thread-Index: Ac3Oz+iEY12Lj/idR8qDspxLhrcnuw==
Date: Fri, 30 Nov 2012 08:09:19 +0000
Message-ID: <961EE662BA396D43898AFA993C8F01B775066487@SBJEXCH1A.websense.com>
Accept-Language: zh-CN, en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
x-originating-ip: [10.32.134.106]
Content-Type: multipart/mixed;
	boundary="_002_961EE662BA396D43898AFA993C8F01B775066487SBJEXCH1Awebsen_"
MIME-Version: 1.0
X-Scanned-By: MailControl 11783.69 (www.mailcontrol.com) on 10.66.0.146
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [Xen-devel] [patch] netback: Xennet half die---netback driver
 didn't detect the jiffies wrapping correctly.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--_002_961EE662BA396D43898AFA993C8F01B775066487SBJEXCH1Awebsen_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable


Netback driver use " time_after_eq()" to check the jiffies wrapping, while =
this function was only called when the credit is  running out.
So, if the jiffies wrapped and the credit isn't run out in first half jiffi=
es circle, the time_after_eq() cannot check the wrapping any more.

This will cause the credit_timerout.expires is set to dozens of days in fut=
ure. The netback will stop receiving data from netfront.=20

For example:=20
Jiffies initialized to 0xffffff-(300*HZ), and the credit_timeout.expires wa=
s initialized to 0xffffff00,=20
After dozens of days,  when the jiffies grow to upper than 0x80000000, and =
the time_after_eq() will cannot check for the wrapping.



--- drivers/xen/netback/netback.c.org	2012-11-30 15:48:13.109039998 -0500
+++ drivers/xen/netback/netback.c	2012-11-30 15:48:55.212072898 -0500
@@ -1272,6 +1272,10 @@ static void net_tx_action(unsigned long
 		rmb(); /* Ensure that we see the request before we copy it. */
 		memcpy(&txreq, RING_GET_REQUEST(&netif->tx, i), sizeof(txreq));
=20
+        /* Check for the jiffies wrapping */
+        if (time_after_eq(jiffies, netif->credit_timeout.expires))
+            netif->credit_timeout.expires =3D jiffies;
+
 		/* Credit-based scheduling. */
 		if (txreq.size > netif->remaining_credit) {
 			unsigned long now =3D jiffies;





 Protected by Websense Hosted Email Security -- www.websense.com=20

--_002_961EE662BA396D43898AFA993C8F01B775066487SBJEXCH1Awebsen_
Content-Type: application/octet-stream;
	name="xen-netback-jiffies-wrapping.patch"
Content-Description: xen-netback-jiffies-wrapping.patch
Content-Disposition: attachment; creation-date="Fri, 30 Nov 2012 08:00:51 GMT"; filename="xen-netback-jiffies-wrapping.patch"; modification-date="Fri, 30 Nov 2012 20:49:54 GMT"; size="626"
Content-Transfer-Encoding: base64

LS0tIGRyaXZlcnMveGVuL25ldGJhY2svbmV0YmFjay5jLm9yZwkyMDEyLTEx
LTMwIDE1OjQ4OjEzLjEwOTAzOTk5OCAtMDUwMAorKysgZHJpdmVycy94ZW4v
bmV0YmFjay9uZXRiYWNrLmMJMjAxMi0xMS0zMCAxNTo0ODo1NS4yMTIwNzI4
OTggLTA1MDAKQEAgLTEyNzIsNiArMTI3MiwxMCBAQCBzdGF0aWMgdm9pZCBu
ZXRfdHhfYWN0aW9uKHVuc2lnbmVkIGxvbmcKIAkJcm1iKCk7IC8qIEVuc3Vy
ZSB0aGF0IHdlIHNlZSB0aGUgcmVxdWVzdCBiZWZvcmUgd2UgY29weSBpdC4g
Ki8KIAkJbWVtY3B5KCZ0eHJlcSwgUklOR19HRVRfUkVRVUVTVCgmbmV0aWYt
PnR4LCBpKSwgc2l6ZW9mKHR4cmVxKSk7CiAKKyAgICAgICAgLyogQ2hlY2sg
Zm9yIHRoZSBqaWZmaWVzIHdyYXBwaW5nICovCisgICAgICAgIGlmICh0aW1l
X2FmdGVyX2VxKGppZmZpZXMsIG5ldGlmLT5jcmVkaXRfdGltZW91dC5leHBp
cmVzKSkKKyAgICAgICAgICAgIG5ldGlmLT5jcmVkaXRfdGltZW91dC5leHBp
cmVzID0gamlmZmllczsKKwogCQkvKiBDcmVkaXQtYmFzZWQgc2NoZWR1bGlu
Zy4gKi8KIAkJaWYgKHR4cmVxLnNpemUgPiBuZXRpZi0+cmVtYWluaW5nX2Ny
ZWRpdCkgewogCQkJdW5zaWduZWQgbG9uZyBub3cgPSBqaWZmaWVzOwo=

--_002_961EE662BA396D43898AFA993C8F01B775066487SBJEXCH1Awebsen_
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.xen.org
http://lists.xen.org/xen-devel

--_002_961EE662BA396D43898AFA993C8F01B775066487SBJEXCH1Awebsen_--


From xen-devel-bounces@lists.xen.org Fri Nov 30 09:22:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:22:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeMn2-0004FR-4j; Fri, 30 Nov 2012 09:21:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TeMn0-0004FM-Se
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:21:43 +0000
Received: from [193.109.254.147:39051] by server-16.bemta-14.messagelabs.com
	id F2/29-09215-6AA78B05; Fri, 30 Nov 2012 09:21:42 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1354267300!8879224!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11998 invoked from network); 30 Nov 2012 09:21:40 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 09:21:40 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16085400"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 09:21:03 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:21:03 +0000
Message-ID: <50B87A7E.5030001@citrix.com>
Date: Fri, 30 Nov 2012 10:21:02 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Manuel Bouyer <bouyer@antioche.eu.org>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr> <50B8718C.1090405@citrix.com>
	<20121130085241.GC311@asim.lip6.fr>
In-Reply-To: <20121130085241.GC311@asim.lip6.fr>
Cc: "port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/12 09:52, Manuel Bouyer wrote:
> On Fri, Nov 30, 2012 at 09:42:52AM +0100, Roger Pau Monn=E9 wrote:
>> On 29/11/12 19:56, Manuel Bouyer wrote:
>>> On Thu, Nov 29, 2012 at 06:31:45PM +0100, Roger Pau Monne wrote:
>>>> The following series adds support for NetBSD gntdev to libxc, and =

>>>> makes libxl use Qemu as a disk backend if an image file stored on a =

>>>> remote filesystem is used.
>>>
>>>
>>> Can't you let the administrator decide this in the domU's config file ?
>>> Right now vnd on nfs has problems, but nothing unfixable.
>>> So one day you'll want to use the kernel driver for nfs too.
>>> But maybe other local filesystems will have the problem.
>>> So it's not for the tool do decide in the back of the admin.
>>
>> We can always add a configure check later when this is fixed to decide
>> if it is needed or not. I don't like the idea of having to set a
>> configuration option if you want to use disk images on NFS, because if
>> you don't know about this specific issue your whole Dom0 will crash
>> which is really not desired or user friendly.
> =

> And I don't like the idea of software doing things in my back.
> And, beside this, I don't think local vs remote is the right criteria.
> There are remote filesystems which may play nice with vnd. There
> are local filesystems that may not play nice with vnd.

I would agree with you if this was a DomU crash, but in this case the
crash happens in the Dom0, and every DomU that the system might be
running crashes completely. This is not acceptable in any way from my
point of view.

I think we should not expect the user to be aware of this kind of
problems. If we cannot guarantee that the vnd driver is functional for
all filesystems, we should not use it. From my point of view reliability
should always come before performance.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:22:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:22:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeMn2-0004FR-4j; Fri, 30 Nov 2012 09:21:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TeMn0-0004FM-Se
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:21:43 +0000
Received: from [193.109.254.147:39051] by server-16.bemta-14.messagelabs.com
	id F2/29-09215-6AA78B05; Fri, 30 Nov 2012 09:21:42 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1354267300!8879224!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11998 invoked from network); 30 Nov 2012 09:21:40 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 09:21:40 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16085400"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 09:21:03 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:21:03 +0000
Message-ID: <50B87A7E.5030001@citrix.com>
Date: Fri, 30 Nov 2012 10:21:02 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Manuel Bouyer <bouyer@antioche.eu.org>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr> <50B8718C.1090405@citrix.com>
	<20121130085241.GC311@asim.lip6.fr>
In-Reply-To: <20121130085241.GC311@asim.lip6.fr>
Cc: "port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/12 09:52, Manuel Bouyer wrote:
> On Fri, Nov 30, 2012 at 09:42:52AM +0100, Roger Pau Monn=E9 wrote:
>> On 29/11/12 19:56, Manuel Bouyer wrote:
>>> On Thu, Nov 29, 2012 at 06:31:45PM +0100, Roger Pau Monne wrote:
>>>> The following series adds support for NetBSD gntdev to libxc, and =

>>>> makes libxl use Qemu as a disk backend if an image file stored on a =

>>>> remote filesystem is used.
>>>
>>>
>>> Can't you let the administrator decide this in the domU's config file ?
>>> Right now vnd on nfs has problems, but nothing unfixable.
>>> So one day you'll want to use the kernel driver for nfs too.
>>> But maybe other local filesystems will have the problem.
>>> So it's not for the tool do decide in the back of the admin.
>>
>> We can always add a configure check later when this is fixed to decide
>> if it is needed or not. I don't like the idea of having to set a
>> configuration option if you want to use disk images on NFS, because if
>> you don't know about this specific issue your whole Dom0 will crash
>> which is really not desired or user friendly.
> =

> And I don't like the idea of software doing things in my back.
> And, beside this, I don't think local vs remote is the right criteria.
> There are remote filesystems which may play nice with vnd. There
> are local filesystems that may not play nice with vnd.

I would agree with you if this was a DomU crash, but in this case the
crash happens in the Dom0, and every DomU that the system might be
running crashes completely. This is not acceptable in any way from my
point of view.

I think we should not expect the user to be aware of this kind of
problems. If we cannot guarantee that the vnd driver is functional for
all filesystems, we should not use it. From my point of view reliability
should always come before performance.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:33:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:33:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeMxk-0004WS-8a; Fri, 30 Nov 2012 09:32:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeMxj-0004WL-4X
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:32:47 +0000
Received: from [85.158.143.99:43267] by server-1.bemta-4.messagelabs.com id
	8A/E1-27934-E3D78B05; Fri, 30 Nov 2012 09:32:46 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1354267965!27146857!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16617 invoked from network); 30 Nov 2012 09:32:45 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 09:32:45 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 09:32:45 +0000
Message-Id: <50B88B8402000078000ACC4C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 09:33:40 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Marek Marczykowski" <marmarek@invisiblethingslab.com>
References: <50B7AF8A.5010304@invisiblethingslab.com>
In-Reply-To: <50B7AF8A.5010304@invisiblethingslab.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Only CPU0 active after ACPI S3, xen 4.1.3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 29.11.12 at 19:55, Marek Marczykowski <marmarek@invisiblethingslab.com> wrote:
> After resume from ACPI S3 system has only CPU0 enabled, every vCPU from 
> every
> domain works on CPU0 [1].  When trying to pin some vCPU to CPU1 got error:
> xl vcpu-pin testvm 1 1
> libxl: error: libxl.c:2565:libxl_set_vcpuaffinity setting vcpu affinity:
> Invalid argument
> 
> What went wrong? How can I reenable CPU1-CPU3?

According to the "xl dmesg" output you sent, CPU1-3 are all
online (their presence in the output following "Dumping timer
queues:" confirms this). So I suppose you will need to go do
some debugging to find out where and why the set-affinity
operation fails, and/or why the scheduler puts everything on
a single pCPU (if it really does, the output of "xl vcpu-list" is
only a hint towards that). Rather than using 'c', 'r' might have
been the more useful debug key.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:33:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:33:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeMxk-0004WS-8a; Fri, 30 Nov 2012 09:32:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeMxj-0004WL-4X
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:32:47 +0000
Received: from [85.158.143.99:43267] by server-1.bemta-4.messagelabs.com id
	8A/E1-27934-E3D78B05; Fri, 30 Nov 2012 09:32:46 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1354267965!27146857!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16617 invoked from network); 30 Nov 2012 09:32:45 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-5.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 09:32:45 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 09:32:45 +0000
Message-Id: <50B88B8402000078000ACC4C@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 09:33:40 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Marek Marczykowski" <marmarek@invisiblethingslab.com>
References: <50B7AF8A.5010304@invisiblethingslab.com>
In-Reply-To: <50B7AF8A.5010304@invisiblethingslab.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Only CPU0 active after ACPI S3, xen 4.1.3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 29.11.12 at 19:55, Marek Marczykowski <marmarek@invisiblethingslab.com> wrote:
> After resume from ACPI S3 system has only CPU0 enabled, every vCPU from 
> every
> domain works on CPU0 [1].  When trying to pin some vCPU to CPU1 got error:
> xl vcpu-pin testvm 1 1
> libxl: error: libxl.c:2565:libxl_set_vcpuaffinity setting vcpu affinity:
> Invalid argument
> 
> What went wrong? How can I reenable CPU1-CPU3?

According to the "xl dmesg" output you sent, CPU1-3 are all
online (their presence in the output following "Dumping timer
queues:" confirms this). So I suppose you will need to go do
some debugging to find out where and why the set-affinity
operation fails, and/or why the scheduler puts everything on
a single pCPU (if it really does, the output of "xl vcpu-list" is
only a hint towards that). Rather than using 'c', 'r' might have
been the more useful debug key.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:34:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:34:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeMyo-0004bt-WA; Fri, 30 Nov 2012 09:33:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeMym-0004bk-Pr
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 09:33:53 +0000
Received: from [85.158.138.51:17966] by server-15.bemta-3.messagelabs.com id
	69/BF-23779-B7D78B05; Fri, 30 Nov 2012 09:33:47 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354268027!25767962!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26606 invoked from network); 30 Nov 2012 09:33:47 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 09:33:47 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16085740"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 09:33:44 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:33:44 +0000
Message-ID: <1354268022.6269.74.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 09:33:42 +0000
In-Reply-To: <osstest-14495-mainreport@xen.org>
References: <osstest-14495-mainreport@xen.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [xen-4.2-testing test] 14495: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-30 at 06:12 +0000, xen.org wrote:
> flight 14495 xen-4.2-testing real [real]
> http://www.chiark.greenend.org.uk/~xensrcts/logs/14495/
> 
> Regressions :-(
> 
> Tests which did not succeed and are blocking,
> including tests which could not be run:
>  test-amd64-i386-xl-qemut-win7-amd64 12 guest-localmigrate/x10 fail REGR. vs. 14483

The logs for this look just like the previous pass, which does include
on each iteration:
                                                                             
        libxl: error: libxl_blktap2.c:80:libxl__device_destroy_tapdisk: Failed to destroy tap device id 4851 minor 2: Input/output error
        libxl: error: libxl.c:1467:devices_destroy_cb: libxl__devices_destroy failed for 8
        
But that's there before so its something to think about but not the
cause of the failure.

The end of the log is:
        xc: Saving memory: iter 29 (last sent 65 skipped 0): 1048575/1048575  100%
        migration target: Transfer complete, requesting permission to start domain.
        migration sender: Target has acknowledged transfer.
        migration sender: Giving target permission to start.
        migration target: Got permission, starting domain.
        migration target: Domain started successsfully.
        migration sender: Target reports successful startup.
        2012-11-30 01:39:58 Z command timed out [400]: ssh -o StrictHostKeyChecking=no -o BatchMode=yes -o ConnectTimeout=100 -o ServerAliveInterval=100 -o PasswordAuthentication=no -o ChallengeResponseAuthentication=no -o UserKnownHostsFile=tmp/t.known_hosts_14495.test-amd64-i386-xl-qemut-win7-amd64 root@10.80.248.105 xl migrate win.guest.osstest localhost
        status (timed out) at Osstest.pm line 598.
        + rc=4

(nb: "successsfully" => s/sss/ss/).

Otherwise the xl and qemu logs look fine, the host dmesg is
uninteresting and the guest screenshot looks healthy.

Maybe we've just regressed in terms of the time taken for the
migrations? The changelog is 
    xl: xl.conf(5): correct advice re autoballooning vs. dom0_mem.
    xl: Suppress spurious warning message for cpupool-list
    x86/time: fix scale_delta() inline assembly

None of which seem especially smoking gun shaped. Perhaps just natural
jitter in the time taken (perhaps we hits Windows' daily "cronjob"
run?). Possibly best to wait for another attempt.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:34:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:34:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeMyo-0004bt-WA; Fri, 30 Nov 2012 09:33:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeMym-0004bk-Pr
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 09:33:53 +0000
Received: from [85.158.138.51:17966] by server-15.bemta-3.messagelabs.com id
	69/BF-23779-B7D78B05; Fri, 30 Nov 2012 09:33:47 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354268027!25767962!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26606 invoked from network); 30 Nov 2012 09:33:47 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 09:33:47 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16085740"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 09:33:44 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:33:44 +0000
Message-ID: <1354268022.6269.74.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 09:33:42 +0000
In-Reply-To: <osstest-14495-mainreport@xen.org>
References: <osstest-14495-mainreport@xen.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [xen-4.2-testing test] 14495: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-30 at 06:12 +0000, xen.org wrote:
> flight 14495 xen-4.2-testing real [real]
> http://www.chiark.greenend.org.uk/~xensrcts/logs/14495/
> 
> Regressions :-(
> 
> Tests which did not succeed and are blocking,
> including tests which could not be run:
>  test-amd64-i386-xl-qemut-win7-amd64 12 guest-localmigrate/x10 fail REGR. vs. 14483

The logs for this look just like the previous pass, which does include
on each iteration:
                                                                             
        libxl: error: libxl_blktap2.c:80:libxl__device_destroy_tapdisk: Failed to destroy tap device id 4851 minor 2: Input/output error
        libxl: error: libxl.c:1467:devices_destroy_cb: libxl__devices_destroy failed for 8
        
But that's there before so its something to think about but not the
cause of the failure.

The end of the log is:
        xc: Saving memory: iter 29 (last sent 65 skipped 0): 1048575/1048575  100%
        migration target: Transfer complete, requesting permission to start domain.
        migration sender: Target has acknowledged transfer.
        migration sender: Giving target permission to start.
        migration target: Got permission, starting domain.
        migration target: Domain started successsfully.
        migration sender: Target reports successful startup.
        2012-11-30 01:39:58 Z command timed out [400]: ssh -o StrictHostKeyChecking=no -o BatchMode=yes -o ConnectTimeout=100 -o ServerAliveInterval=100 -o PasswordAuthentication=no -o ChallengeResponseAuthentication=no -o UserKnownHostsFile=tmp/t.known_hosts_14495.test-amd64-i386-xl-qemut-win7-amd64 root@10.80.248.105 xl migrate win.guest.osstest localhost
        status (timed out) at Osstest.pm line 598.
        + rc=4

(nb: "successsfully" => s/sss/ss/).

Otherwise the xl and qemu logs look fine, the host dmesg is
uninteresting and the guest screenshot looks healthy.

Maybe we've just regressed in terms of the time taken for the
migrations? The changelog is 
    xl: xl.conf(5): correct advice re autoballooning vs. dom0_mem.
    xl: Suppress spurious warning message for cpupool-list
    x86/time: fix scale_delta() inline assembly

None of which seem especially smoking gun shaped. Perhaps just natural
jitter in the time taken (perhaps we hits Windows' daily "cronjob"
run?). Possibly best to wait for another attempt.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:39:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:39:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeN43-0004rq-1S; Fri, 30 Nov 2012 09:39:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeN41-0004rl-M2
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 09:39:17 +0000
Received: from [85.158.139.83:11667] by server-14.bemta-5.messagelabs.com id
	52/5E-21768-4CE78B05; Fri, 30 Nov 2012 09:39:16 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1354268353!23804077!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3541 invoked from network); 30 Nov 2012 09:39:16 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 09:39:16 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16085862"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 09:39:13 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:39:13 +0000
Message-ID: <1354268351.6269.77.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: xen.org <ian.jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Date: Fri, 30 Nov 2012 09:39:11 +0000
In-Reply-To: <osstest-14494-mainreport@xen.org>
References: <osstest-14494-mainreport@xen.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [xen-unstable test] 14494: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 21:13 +0000, xen.org wrote:
> flight 14494 xen-unstable real [real]
> http://www.chiark.greenend.org.uk/~xensrcts/logs/14494/
> 
> Regressions :-(
> 
> Tests which did not succeed and are blocking,
> including tests which could not be run:
>  test-amd64-amd64-pv           5 xen-boot                  fail REGR. vs. 14482

Jan, I assume this relates to your "AMD IOMMU: add locking missing from
c/s 26198:ba90ecb0231f" from this morning?

Nov 29 17:53:03.732540 (XEN) Assertion 'spin_is_locked(&desc->lock)'
failed at msi.c:276
Nov 29 17:53:03.740545 (XEN) ----[ Xen-4.3-unstable  x86_64  debug=y  Not tainted ]----
Nov 29 17:53:03.748543 (XEN) CPU:    0
Nov 29 17:53:03.748570 (XEN) RIP:    e008:[<ffff82c48016607d>] set_msi_affinity+0x4a/0x1ba
Nov 29 17:53:03.756539 (XEN) RFLAGS: 0000000000010046   CONTEXT: hypervisor
Nov 29 17:53:03.764538 (XEN) rax: 0000000000000000   rbx: ffff830116381880   rcx: 0000000000000000
Nov 29 17:53:03.772548 (XEN) rdx: 0000000000000082   rsi: ffff82c480260280   rdi: ffff8301163818a8
Nov 29 17:53:03.780548 (XEN) rbp: ffff82c4802bfd78   rsp: ffff82c4802bfd28   r8:  0000000000000020
Nov 29 17:53:03.788548 (XEN) r9:  0000000000000081   r10: 0000000000000001   r11: ffff82c4802cbe40
Nov 29 17:53:03.796542 (XEN) r12: ffff8301163f0370   r13: 0000000000000001   r14: 0000000000000296
Nov 29 17:53:03.804547 (XEN) r15: ffff82c4802e7f88   cr0: 000000008005003b   cr4: 00000000000006f0
Nov 29 17:53:03.812547 (XEN) cr3: 00000000dfc6f000   cr2: 0000000000000000
Nov 29 17:53:03.820532 (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
Nov 29 17:53:03.828539 (XEN) Xen stack trace from rsp=ffff82c4802bfd28:
Nov 29 17:53:03.832541 (XEN)    ffff82c4802bfd38 0000000000000282 ffff82c4802bfd68 ffff82c480291d5a
Nov 29 17:53:03.840548 (XEN)    0000000000000018 ffff8301163f0350 ffff8301163f0360 ffff82c4802e7f80
Nov 29 17:53:03.848549 (XEN)    0000000000000296 ffff82c4802e7f88 ffff82c4802bfdb8 ffff82c48014cea4
Nov 29 17:53:03.856541 (XEN)    ffff82c3fffff000 ffff8301163f0350 ffff82c3fffff000 ffff82c4802e7f80
Nov 29 17:53:03.864553 (XEN)    ffff82c4802e7f90 ffff82c4802e7f88 ffff82c4802bfe18 ffff82c480288e98
Nov 29 17:53:03.872548 (XEN)    ffff8301163fbfe0 0000000000000018 ffff830116381880 000000188028d379
Nov 29 17:53:03.884540 (XEN)    00000000e0000000 00000000ffffffed 0000000000000000 ffff8301163fbfe0
Nov 29 17:53:03.892538 (XEN)    0000000000000002 0000000000000002 ffff82c4802bfe28 ffff82c480289256
Nov 29 17:53:03.900541 (XEN)    ffff82c4802bfe48 ffff82c480285fce ffff82c4802b8000 ffff830000089fb0
Nov 29 17:53:03.908541 (XEN)    ffff82c4802bff08 ffff82c4802975f5 0000000000000000 0000000000000000
Nov 29 17:53:03.916541 (XEN)    ffff830000089dd0 0000000000f10000 00000000dfa00000 0000000000000000
Nov 29 17:53:03.924538 (XEN)    0000000000301780 ffff82c4ffffffff ffff830000000003 ffff830000089f30
Nov 29 17:53:03.932544 (XEN)    ffff830000089fb0 ffff82c4ffffffff 0000000800000000 000000010000006e
Nov 29 17:53:03.940546 (XEN)    0000000000000003 00000000000002f8 0000000000000000 0000000000000000
Nov 29 17:53:03.948545 (XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
Nov 29 17:53:03.956546 (XEN)    000000000007fe0c ffff82c4801000b5 0000000000000000 0000000000000000
Nov 29 17:53:03.964546 (XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
Nov 29 17:53:03.972545 (XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
Nov 29 17:53:03.980545 (XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
Nov 29 17:53:03.988548 (XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
Nov 29 17:53:03.996551 (XEN) Xen call trace:
Nov 29 17:53:04.000522 (XEN)    [<ffff82c48016607d>] set_msi_affinity+0x4a/0x1ba
Nov 29 17:53:04.008538 (XEN)    [<ffff82c48014cea4>] enable_iommu+0x54d/0x68f
Nov 29 17:53:04.012543 (XEN)    [<ffff82c480288e98>] amd_iommu_init+0x4d0/0x65a
Nov 29 17:53:04.020542 (XEN)    [<ffff82c480289256>] amd_iov_detect+0x6c/0xf6
Nov 29 17:53:04.028535 (XEN)    [<ffff82c480285fce>] iommu_setup+0x67/0x143
Nov 29 17:53:04.032533 (XEN)    [<ffff82c4802975f5>] __start_xen+0x269d/0x2acd
Nov 29 17:53:04.040537 (XEN)    
Nov 29 17:53:04.040559 (XEN) 
Nov 29 17:53:04.040581 (XEN) ****************************************
Nov 29 17:53:04.048557 (XEN) Panic on CPU 0:
Nov 29 17:53:04.052523 (XEN) Assertion 'spin_is_locked(&desc->lock)' failed at msi.c:276
Nov 29 17:53:04.060538 (XEN) ****************************************



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:39:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:39:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeN43-0004rq-1S; Fri, 30 Nov 2012 09:39:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeN41-0004rl-M2
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 09:39:17 +0000
Received: from [85.158.139.83:11667] by server-14.bemta-5.messagelabs.com id
	52/5E-21768-4CE78B05; Fri, 30 Nov 2012 09:39:16 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1354268353!23804077!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3541 invoked from network); 30 Nov 2012 09:39:16 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 09:39:16 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16085862"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 09:39:13 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:39:13 +0000
Message-ID: <1354268351.6269.77.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: xen.org <ian.jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Date: Fri, 30 Nov 2012 09:39:11 +0000
In-Reply-To: <osstest-14494-mainreport@xen.org>
References: <osstest-14494-mainreport@xen.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [xen-unstable test] 14494: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 21:13 +0000, xen.org wrote:
> flight 14494 xen-unstable real [real]
> http://www.chiark.greenend.org.uk/~xensrcts/logs/14494/
> 
> Regressions :-(
> 
> Tests which did not succeed and are blocking,
> including tests which could not be run:
>  test-amd64-amd64-pv           5 xen-boot                  fail REGR. vs. 14482

Jan, I assume this relates to your "AMD IOMMU: add locking missing from
c/s 26198:ba90ecb0231f" from this morning?

Nov 29 17:53:03.732540 (XEN) Assertion 'spin_is_locked(&desc->lock)'
failed at msi.c:276
Nov 29 17:53:03.740545 (XEN) ----[ Xen-4.3-unstable  x86_64  debug=y  Not tainted ]----
Nov 29 17:53:03.748543 (XEN) CPU:    0
Nov 29 17:53:03.748570 (XEN) RIP:    e008:[<ffff82c48016607d>] set_msi_affinity+0x4a/0x1ba
Nov 29 17:53:03.756539 (XEN) RFLAGS: 0000000000010046   CONTEXT: hypervisor
Nov 29 17:53:03.764538 (XEN) rax: 0000000000000000   rbx: ffff830116381880   rcx: 0000000000000000
Nov 29 17:53:03.772548 (XEN) rdx: 0000000000000082   rsi: ffff82c480260280   rdi: ffff8301163818a8
Nov 29 17:53:03.780548 (XEN) rbp: ffff82c4802bfd78   rsp: ffff82c4802bfd28   r8:  0000000000000020
Nov 29 17:53:03.788548 (XEN) r9:  0000000000000081   r10: 0000000000000001   r11: ffff82c4802cbe40
Nov 29 17:53:03.796542 (XEN) r12: ffff8301163f0370   r13: 0000000000000001   r14: 0000000000000296
Nov 29 17:53:03.804547 (XEN) r15: ffff82c4802e7f88   cr0: 000000008005003b   cr4: 00000000000006f0
Nov 29 17:53:03.812547 (XEN) cr3: 00000000dfc6f000   cr2: 0000000000000000
Nov 29 17:53:03.820532 (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
Nov 29 17:53:03.828539 (XEN) Xen stack trace from rsp=ffff82c4802bfd28:
Nov 29 17:53:03.832541 (XEN)    ffff82c4802bfd38 0000000000000282 ffff82c4802bfd68 ffff82c480291d5a
Nov 29 17:53:03.840548 (XEN)    0000000000000018 ffff8301163f0350 ffff8301163f0360 ffff82c4802e7f80
Nov 29 17:53:03.848549 (XEN)    0000000000000296 ffff82c4802e7f88 ffff82c4802bfdb8 ffff82c48014cea4
Nov 29 17:53:03.856541 (XEN)    ffff82c3fffff000 ffff8301163f0350 ffff82c3fffff000 ffff82c4802e7f80
Nov 29 17:53:03.864553 (XEN)    ffff82c4802e7f90 ffff82c4802e7f88 ffff82c4802bfe18 ffff82c480288e98
Nov 29 17:53:03.872548 (XEN)    ffff8301163fbfe0 0000000000000018 ffff830116381880 000000188028d379
Nov 29 17:53:03.884540 (XEN)    00000000e0000000 00000000ffffffed 0000000000000000 ffff8301163fbfe0
Nov 29 17:53:03.892538 (XEN)    0000000000000002 0000000000000002 ffff82c4802bfe28 ffff82c480289256
Nov 29 17:53:03.900541 (XEN)    ffff82c4802bfe48 ffff82c480285fce ffff82c4802b8000 ffff830000089fb0
Nov 29 17:53:03.908541 (XEN)    ffff82c4802bff08 ffff82c4802975f5 0000000000000000 0000000000000000
Nov 29 17:53:03.916541 (XEN)    ffff830000089dd0 0000000000f10000 00000000dfa00000 0000000000000000
Nov 29 17:53:03.924538 (XEN)    0000000000301780 ffff82c4ffffffff ffff830000000003 ffff830000089f30
Nov 29 17:53:03.932544 (XEN)    ffff830000089fb0 ffff82c4ffffffff 0000000800000000 000000010000006e
Nov 29 17:53:03.940546 (XEN)    0000000000000003 00000000000002f8 0000000000000000 0000000000000000
Nov 29 17:53:03.948545 (XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
Nov 29 17:53:03.956546 (XEN)    000000000007fe0c ffff82c4801000b5 0000000000000000 0000000000000000
Nov 29 17:53:03.964546 (XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
Nov 29 17:53:03.972545 (XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
Nov 29 17:53:03.980545 (XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
Nov 29 17:53:03.988548 (XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
Nov 29 17:53:03.996551 (XEN) Xen call trace:
Nov 29 17:53:04.000522 (XEN)    [<ffff82c48016607d>] set_msi_affinity+0x4a/0x1ba
Nov 29 17:53:04.008538 (XEN)    [<ffff82c48014cea4>] enable_iommu+0x54d/0x68f
Nov 29 17:53:04.012543 (XEN)    [<ffff82c480288e98>] amd_iommu_init+0x4d0/0x65a
Nov 29 17:53:04.020542 (XEN)    [<ffff82c480289256>] amd_iov_detect+0x6c/0xf6
Nov 29 17:53:04.028535 (XEN)    [<ffff82c480285fce>] iommu_setup+0x67/0x143
Nov 29 17:53:04.032533 (XEN)    [<ffff82c4802975f5>] __start_xen+0x269d/0x2acd
Nov 29 17:53:04.040537 (XEN)    
Nov 29 17:53:04.040559 (XEN) 
Nov 29 17:53:04.040581 (XEN) ****************************************
Nov 29 17:53:04.048557 (XEN) Panic on CPU 0:
Nov 29 17:53:04.052523 (XEN) Assertion 'spin_is_locked(&desc->lock)' failed at msi.c:276
Nov 29 17:53:04.060538 (XEN) ****************************************



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:40:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:40:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeN5G-0004ws-GY; Fri, 30 Nov 2012 09:40:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeN5E-0004wm-U3
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:40:33 +0000
Received: from [85.158.143.35:49389] by server-2.bemta-4.messagelabs.com id
	67/91-28922-01F78B05; Fri, 30 Nov 2012 09:40:32 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1354268428!12459134!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9145 invoked from network); 30 Nov 2012 09:40:29 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 09:40:29 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16085885"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 09:40:28 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:40:28 +0000
Message-ID: <1354268427.6269.78.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Fri, 30 Nov 2012 09:40:27 +0000
In-Reply-To: <50B8762102000078000ACBC6@nat28.tlf.novell.com>
References: <50B8762102000078000ACBC6@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Wei Huang <wei.huang2@amd.com>, Wei
	Wang <weiwang.dd@gmail.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] AMD IOMMU: add locking missing from c/s
 26198:ba90ecb0231f
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-30 at 08:02 +0000, Jan Beulich wrote:
> An oversight of mine; I'm sorry.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Seems pretty clear cut given the log in test flight #14494

Acked-by: Ian Campbell <ian.campbell@citrix.com>

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:40:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:40:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeN5G-0004ws-GY; Fri, 30 Nov 2012 09:40:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeN5E-0004wm-U3
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:40:33 +0000
Received: from [85.158.143.35:49389] by server-2.bemta-4.messagelabs.com id
	67/91-28922-01F78B05; Fri, 30 Nov 2012 09:40:32 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1354268428!12459134!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9145 invoked from network); 30 Nov 2012 09:40:29 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 09:40:29 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16085885"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 09:40:28 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:40:28 +0000
Message-ID: <1354268427.6269.78.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Fri, 30 Nov 2012 09:40:27 +0000
In-Reply-To: <50B8762102000078000ACBC6@nat28.tlf.novell.com>
References: <50B8762102000078000ACBC6@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Wei Huang <wei.huang2@amd.com>, Wei
	Wang <weiwang.dd@gmail.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] AMD IOMMU: add locking missing from c/s
 26198:ba90ecb0231f
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-30 at 08:02 +0000, Jan Beulich wrote:
> An oversight of mine; I'm sorry.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Seems pretty clear cut given the log in test flight #14494

Acked-by: Ian Campbell <ian.campbell@citrix.com>

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:42:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:42:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeN6T-0005Au-VF; Fri, 30 Nov 2012 09:41:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Manuel.Bouyer@lip6.fr>) id 1TeN6S-0005Ak-Sg
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:41:49 +0000
Received: from [85.158.138.51:51408] by server-7.bemta-3.messagelabs.com id
	E5/BB-01713-C5F78B05; Fri, 30 Nov 2012 09:41:48 +0000
X-Env-Sender: Manuel.Bouyer@lip6.fr
X-Msg-Ref: server-2.tower-174.messagelabs.com!1354268507!28590711!1
X-Originating-IP: [132.227.60.2]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9137 invoked from network); 30 Nov 2012 09:41:47 -0000
Received: from isis.lip6.fr (HELO isis.lip6.fr) (132.227.60.2)
	by server-2.tower-174.messagelabs.com with SMTP;
	30 Nov 2012 09:41:47 -0000
Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2])
	by isis.lip6.fr (8.14.5/lip6) with ESMTP id qAU9fh0q002877
	; Fri, 30 Nov 2012 10:41:43 +0100 (CET)
X-pt: isis.lip6.fr
Received: from armandeche.soc.lip6.fr (armandeche [132.227.63.133])
	by asim.lip6.fr (8.14.5/8.14.4) with ESMTP id qAU9fhrQ001317;
	Fri, 30 Nov 2012 10:41:43 +0100 (MET)
Received: by armandeche.soc.lip6.fr (Postfix, from userid 20331)
	id 265CE34B3E; Fri, 30 Nov 2012 10:41:43 +0100 (MET)
Date: Fri, 30 Nov 2012 10:41:43 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Message-ID: <20121130094143.GA10993@asim.lip6.fr>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr> <50B8718C.1090405@citrix.com>
	<20121130085241.GC311@asim.lip6.fr> <50B87A7E.5030001@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B87A7E.5030001@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7
	(isis.lip6.fr [132.227.60.2]);
	Fri, 30 Nov 2012 10:41:44 +0100 (CET)
X-Scanned-By: MIMEDefang 2.73 on 132.227.60.2
Cc: "port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 10:21:02AM +0100, Roger Pau Monn=E9 wrote:
> > And I don't like the idea of software doing things in my back.
> > And, beside this, I don't think local vs remote is the right criteria.
> > There are remote filesystems which may play nice with vnd. There
> > are local filesystems that may not play nice with vnd.
> =

> I would agree with you if this was a DomU crash, but in this case the
> crash happens in the Dom0, and every DomU that the system might be
> running crashes completely. This is not acceptable in any way from my
> point of view.
> =

> I think we should not expect the user to be aware of this kind of
> problems. If we cannot guarantee that the vnd driver is functional for
> all filesystems, we should not use it. From my point of view reliability
> should always come before performance.

In my POV, the admin show know what he's doing. This includes be aware of t=
he
limitations of the software he uses. A 50% performances loss just "in case"
is not accetpable. Or at last last there should be a way for the admin
to revert to an acceptable configuration, performance wise, without
hacking and rebuilding from sources.

-- =

Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:42:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:42:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeN6T-0005Au-VF; Fri, 30 Nov 2012 09:41:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Manuel.Bouyer@lip6.fr>) id 1TeN6S-0005Ak-Sg
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:41:49 +0000
Received: from [85.158.138.51:51408] by server-7.bemta-3.messagelabs.com id
	E5/BB-01713-C5F78B05; Fri, 30 Nov 2012 09:41:48 +0000
X-Env-Sender: Manuel.Bouyer@lip6.fr
X-Msg-Ref: server-2.tower-174.messagelabs.com!1354268507!28590711!1
X-Originating-IP: [132.227.60.2]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9137 invoked from network); 30 Nov 2012 09:41:47 -0000
Received: from isis.lip6.fr (HELO isis.lip6.fr) (132.227.60.2)
	by server-2.tower-174.messagelabs.com with SMTP;
	30 Nov 2012 09:41:47 -0000
Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2])
	by isis.lip6.fr (8.14.5/lip6) with ESMTP id qAU9fh0q002877
	; Fri, 30 Nov 2012 10:41:43 +0100 (CET)
X-pt: isis.lip6.fr
Received: from armandeche.soc.lip6.fr (armandeche [132.227.63.133])
	by asim.lip6.fr (8.14.5/8.14.4) with ESMTP id qAU9fhrQ001317;
	Fri, 30 Nov 2012 10:41:43 +0100 (MET)
Received: by armandeche.soc.lip6.fr (Postfix, from userid 20331)
	id 265CE34B3E; Fri, 30 Nov 2012 10:41:43 +0100 (MET)
Date: Fri, 30 Nov 2012 10:41:43 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Message-ID: <20121130094143.GA10993@asim.lip6.fr>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr> <50B8718C.1090405@citrix.com>
	<20121130085241.GC311@asim.lip6.fr> <50B87A7E.5030001@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B87A7E.5030001@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7
	(isis.lip6.fr [132.227.60.2]);
	Fri, 30 Nov 2012 10:41:44 +0100 (CET)
X-Scanned-By: MIMEDefang 2.73 on 132.227.60.2
Cc: "port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 10:21:02AM +0100, Roger Pau Monn=E9 wrote:
> > And I don't like the idea of software doing things in my back.
> > And, beside this, I don't think local vs remote is the right criteria.
> > There are remote filesystems which may play nice with vnd. There
> > are local filesystems that may not play nice with vnd.
> =

> I would agree with you if this was a DomU crash, but in this case the
> crash happens in the Dom0, and every DomU that the system might be
> running crashes completely. This is not acceptable in any way from my
> point of view.
> =

> I think we should not expect the user to be aware of this kind of
> problems. If we cannot guarantee that the vnd driver is functional for
> all filesystems, we should not use it. From my point of view reliability
> should always come before performance.

In my POV, the admin show know what he's doing. This includes be aware of t=
he
limitations of the software he uses. A 50% performances loss just "in case"
is not accetpable. Or at last last there should be a way for the admin
to revert to an acceptable configuration, performance wise, without
hacking and rebuilding from sources.

-- =

Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:43:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:43:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeN7V-0005H3-EN; Fri, 30 Nov 2012 09:42:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TeN7U-0005Gs-6z
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:42:52 +0000
Received: from [85.158.143.99:48444] by server-2.bemta-4.messagelabs.com id
	99/D4-28922-B9F78B05; Fri, 30 Nov 2012 09:42:51 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1354268570!20442828!1
X-Originating-IP: [74.125.82.53]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23003 invoked from network); 30 Nov 2012 09:42:51 -0000
Received: from mail-wg0-f53.google.com (HELO mail-wg0-f53.google.com)
	(74.125.82.53)
	by server-6.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 09:42:51 -0000
Received: by mail-wg0-f53.google.com with SMTP id ei8so86516wgb.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 01:42:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=/BHERVpvskxzMjx6mQN3Uvs5omXLWNkNtffU2BLIsHw=;
	b=ofVFvabyWr8RVBuyIKldqOaNLbsyKw+7zhm1EeMwlAT5EHxqFzMCq55H+GmeO1vPE8
	RjLjYBDDHhqS0TphyIK7gS2RS8MuPA8fqGvndcpshFpIvdmYlIreABH1rOaSPE6FzXWu
	66W2ytUI7NA9N4b+2/Omx3uO9ynCitjM/ywiOG4eeCNDdigYimMBm+116Pbtpl8yxI2U
	Gid6udLv6j+1zb7MR+P/ksjdBKvyIqBdl3nkkm+k9/weP2YuZG/mSbrPi5e5gtSXnZrG
	PTzdzgmQ+91lNEyzT76jAHQLSkiosEUNc+vpoyJ4XrF5d+kakHA9y8z+rNwda3WBoURD
	5Dvg==
Received: by 10.180.92.166 with SMTP id cn6mr997791wib.19.1354268570681;
	Fri, 30 Nov 2012 01:42:50 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id i6sm14536098wix.5.2012.11.30.01.42.48
	(version=SSLv3 cipher=OTHER); Fri, 30 Nov 2012 01:42:49 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Fri, 30 Nov 2012 09:42:46 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>, <wei.huang2@amd.com>,
	<weiwang.dd@gmail.com>, <xiantao.zhang@intel.com>
Message-ID: <CCDE3016.54628%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on faults
	for devices used by Xen or Dom0
Thread-Index: Ac3O3w1Q1z7HC68r1kmljBIFWF5w5w==
In-Reply-To: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Dario Faggioli <raistlin@linux.it>, Tim Deegan <tim@xen.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 05/11/2012 16:53, "Jan Beulich" <JBeulich@suse.com> wrote:

> Under the assumption that in these cases recurring faults aren't a
> security issue and it can be expected that the drivers there are going
> to try to take care of the problem.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

This one's sat a while with no comments...

 -- Keir

> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -625,6 +625,18 @@ static void parse_event_log_entry(struct
>          for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ )
>              if ( get_dma_requestor_id(iommu->seg, bdf) == device_id )
>              {
> +                const struct pci_dev *pdev;
> +
> +                spin_lock(&pcidevs_lock);
> +                pdev = pci_get_pdev(iommu->seg, PCI_BUS(bdf),
> PCI_DEVFN2(bdf));
> +                if ( pdev && pdev->domain != dom_xen &&
> +                     (!pdev->domain || !IS_PRIV(pdev->domain)) )
> +                    pdev = NULL;
> +                spin_unlock(&pcidevs_lock);
> +
> +                if ( pdev )
> +                    continue;
> +
>                  cword = pci_conf_read16(iommu->seg, PCI_BUS(bdf),
>                                          PCI_SLOT(bdf), PCI_FUNC(bdf),
>                                          PCI_COMMAND);
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -916,7 +916,8 @@ static void __do_iommu_page_fault(struct
>      reg = cap_fault_reg_offset(iommu->cap);
>      while (1)
>      {
> -        u8 fault_reason;
> +        const struct pci_dev *pdev;
> +        u8 fault_reason, bus;
>          u16 source_id, cword;
>          u32 data;
>          u64 guest_addr;
> @@ -950,14 +951,27 @@ static void __do_iommu_page_fault(struct
>          iommu_page_fault_do_one(iommu, type, fault_reason,
>                                  source_id, guest_addr);
>  
> -        /* Tell the device to stop DMAing; we can't rely on the guest to
> -         * control it for us. */
> -        cword = pci_conf_read16(iommu->intel->drhd->segment,
> -                                PCI_BUS(source_id), PCI_SLOT(source_id),
> -                                PCI_FUNC(source_id), PCI_COMMAND);
> -        pci_conf_write16(iommu->intel->drhd->segment, PCI_BUS(source_id),
> -                         PCI_SLOT(source_id), PCI_FUNC(source_id),
> -                         PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
> +        bus = PCI_BUS(source_id);
> +
> +        spin_lock(&pcidevs_lock);
> +        pdev = pci_get_pdev(iommu->intel->drhd->segment, bus,
> +                            PCI_DEVFN2(source_id));
> +        if ( pdev && pdev->domain != dom_xen &&
> +             (!pdev->domain || !IS_PRIV(pdev->domain)) )
> +            pdev = NULL;
> +        spin_unlock(&pcidevs_lock);
> +
> +        if ( !pdev )
> +        {
> +            /* Tell the device to stop DMAing; we can't rely on the guest to
> +             * control it for us. */
> +            cword = pci_conf_read16(iommu->intel->drhd->segment, bus,
> +                                    PCI_SLOT(source_id), PCI_FUNC(source_id),
> +                                    PCI_COMMAND);
> +            pci_conf_write16(iommu->intel->drhd->segment, bus,
> +                             PCI_SLOT(source_id), PCI_FUNC(source_id),
> +                             PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
> +        }
>  
>          fault_index++;
>          if ( fault_index > cap_num_fault_regs(iommu->cap) )
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:43:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:43:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeN7V-0005H3-EN; Fri, 30 Nov 2012 09:42:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TeN7U-0005Gs-6z
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:42:52 +0000
Received: from [85.158.143.99:48444] by server-2.bemta-4.messagelabs.com id
	99/D4-28922-B9F78B05; Fri, 30 Nov 2012 09:42:51 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1354268570!20442828!1
X-Originating-IP: [74.125.82.53]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23003 invoked from network); 30 Nov 2012 09:42:51 -0000
Received: from mail-wg0-f53.google.com (HELO mail-wg0-f53.google.com)
	(74.125.82.53)
	by server-6.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 09:42:51 -0000
Received: by mail-wg0-f53.google.com with SMTP id ei8so86516wgb.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 01:42:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=/BHERVpvskxzMjx6mQN3Uvs5omXLWNkNtffU2BLIsHw=;
	b=ofVFvabyWr8RVBuyIKldqOaNLbsyKw+7zhm1EeMwlAT5EHxqFzMCq55H+GmeO1vPE8
	RjLjYBDDHhqS0TphyIK7gS2RS8MuPA8fqGvndcpshFpIvdmYlIreABH1rOaSPE6FzXWu
	66W2ytUI7NA9N4b+2/Omx3uO9ynCitjM/ywiOG4eeCNDdigYimMBm+116Pbtpl8yxI2U
	Gid6udLv6j+1zb7MR+P/ksjdBKvyIqBdl3nkkm+k9/weP2YuZG/mSbrPi5e5gtSXnZrG
	PTzdzgmQ+91lNEyzT76jAHQLSkiosEUNc+vpoyJ4XrF5d+kakHA9y8z+rNwda3WBoURD
	5Dvg==
Received: by 10.180.92.166 with SMTP id cn6mr997791wib.19.1354268570681;
	Fri, 30 Nov 2012 01:42:50 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id i6sm14536098wix.5.2012.11.30.01.42.48
	(version=SSLv3 cipher=OTHER); Fri, 30 Nov 2012 01:42:49 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Fri, 30 Nov 2012 09:42:46 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>, <wei.huang2@amd.com>,
	<weiwang.dd@gmail.com>, <xiantao.zhang@intel.com>
Message-ID: <CCDE3016.54628%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on faults
	for devices used by Xen or Dom0
Thread-Index: Ac3O3w1Q1z7HC68r1kmljBIFWF5w5w==
In-Reply-To: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Dario Faggioli <raistlin@linux.it>, Tim Deegan <tim@xen.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 05/11/2012 16:53, "Jan Beulich" <JBeulich@suse.com> wrote:

> Under the assumption that in these cases recurring faults aren't a
> security issue and it can be expected that the drivers there are going
> to try to take care of the problem.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

This one's sat a while with no comments...

 -- Keir

> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -625,6 +625,18 @@ static void parse_event_log_entry(struct
>          for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ )
>              if ( get_dma_requestor_id(iommu->seg, bdf) == device_id )
>              {
> +                const struct pci_dev *pdev;
> +
> +                spin_lock(&pcidevs_lock);
> +                pdev = pci_get_pdev(iommu->seg, PCI_BUS(bdf),
> PCI_DEVFN2(bdf));
> +                if ( pdev && pdev->domain != dom_xen &&
> +                     (!pdev->domain || !IS_PRIV(pdev->domain)) )
> +                    pdev = NULL;
> +                spin_unlock(&pcidevs_lock);
> +
> +                if ( pdev )
> +                    continue;
> +
>                  cword = pci_conf_read16(iommu->seg, PCI_BUS(bdf),
>                                          PCI_SLOT(bdf), PCI_FUNC(bdf),
>                                          PCI_COMMAND);
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -916,7 +916,8 @@ static void __do_iommu_page_fault(struct
>      reg = cap_fault_reg_offset(iommu->cap);
>      while (1)
>      {
> -        u8 fault_reason;
> +        const struct pci_dev *pdev;
> +        u8 fault_reason, bus;
>          u16 source_id, cword;
>          u32 data;
>          u64 guest_addr;
> @@ -950,14 +951,27 @@ static void __do_iommu_page_fault(struct
>          iommu_page_fault_do_one(iommu, type, fault_reason,
>                                  source_id, guest_addr);
>  
> -        /* Tell the device to stop DMAing; we can't rely on the guest to
> -         * control it for us. */
> -        cword = pci_conf_read16(iommu->intel->drhd->segment,
> -                                PCI_BUS(source_id), PCI_SLOT(source_id),
> -                                PCI_FUNC(source_id), PCI_COMMAND);
> -        pci_conf_write16(iommu->intel->drhd->segment, PCI_BUS(source_id),
> -                         PCI_SLOT(source_id), PCI_FUNC(source_id),
> -                         PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
> +        bus = PCI_BUS(source_id);
> +
> +        spin_lock(&pcidevs_lock);
> +        pdev = pci_get_pdev(iommu->intel->drhd->segment, bus,
> +                            PCI_DEVFN2(source_id));
> +        if ( pdev && pdev->domain != dom_xen &&
> +             (!pdev->domain || !IS_PRIV(pdev->domain)) )
> +            pdev = NULL;
> +        spin_unlock(&pcidevs_lock);
> +
> +        if ( !pdev )
> +        {
> +            /* Tell the device to stop DMAing; we can't rely on the guest to
> +             * control it for us. */
> +            cword = pci_conf_read16(iommu->intel->drhd->segment, bus,
> +                                    PCI_SLOT(source_id), PCI_FUNC(source_id),
> +                                    PCI_COMMAND);
> +            pci_conf_write16(iommu->intel->drhd->segment, bus,
> +                             PCI_SLOT(source_id), PCI_FUNC(source_id),
> +                             PCI_COMMAND, cword & ~PCI_COMMAND_MASTER);
> +        }
>  
>          fault_index++;
>          if ( fault_index > cap_num_fault_regs(iommu->cap) )
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:44:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:44:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeN8q-0005Po-V8; Fri, 30 Nov 2012 09:44:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeN8o-0005PY-Rc
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:44:15 +0000
Received: from [85.158.138.51:21023] by server-15.bemta-3.messagelabs.com id
	56/F4-23779-EEF78B05; Fri, 30 Nov 2012 09:44:14 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1354268650!24096131!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3808 invoked from network); 30 Nov 2012 09:44:11 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 09:44:11 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16085977"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 09:44:10 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:44:10 +0000
Message-ID: <1354268649.6269.80.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Fri, 30 Nov 2012 09:44:09 +0000
In-Reply-To: <50B8898D02000078000ACC41@nat28.tlf.novell.com>
References: <961EE662BA396D43898AFA993C8F01B775066487@SBJEXCH1A.websense.com>
	<1354264550.6039.37.camel@dagon.hellion.org.uk>
	<50B8898D02000078000ACC41@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Shunli Yi <syi@websense.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [patch] netback: Xennet half die---netback driver
 didn't detect the jiffies wrapping correctly.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-30 at 09:25 +0000, Jan Beulich wrote:
> >>> On 30.11.12 at 09:35, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Fri, 2012-11-30 at 08:09 +0000, Yi, Shunli wrote:
> >> Netback driver use " time_after_eq()" to check the jiffies wrapping,
> >> while this function was only called when the credit is  running out.
> >> So, if the jiffies wrapped and the credit isn't run out in first half
> >> jiffies circle, the time_after_eq() cannot check the wrapping any
> >> more.
> > 
> > Which tree is this against? It doesn't appear to be mainline Linux,
> > which is all I am really interested in these days.
> > 
> > Also your patch is missing a Signed-off-by and is whitespace damaged.
> > Please read Documentation/SubmittingPatches and
> > Documentation/SubmitChecklist.
> > 
> >> This will cause the credit_timerout.expires is set to dozens of days
> >> in future.
> >>
> >>  The netback will stop receiving data from netfront. 
> >> 
> >> For example: 
> >> Jiffies initialized to 0xffffff-(300*HZ), and the
> >> credit_timeout.expires was initialized to 0xffffff00, 
> >> After dozens of days,  when the jiffies grow to upper than 0x80000000,
> >> and the time_after_eq() will cannot check for the wrapping.
> >> 
> >> 
> >> 
> >> --- drivers/xen/netback/netback.c.org	2012-11-30 15:48:13.109039998 -0500
> >> +++ drivers/xen/netback/netback.c	2012-11-30 15:48:55.212072898 -0500
> >> @@ -1272,6 +1272,10 @@ static void net_tx_action(unsigned long
> >>  		rmb(); /* Ensure that we see the request before we copy it. */
> >>  		memcpy(&txreq, RING_GET_REQUEST(&netif->tx, i), sizeof(txreq));
> >>  
> >> +        /* Check for the jiffies wrapping */
> >> +        if (time_after_eq(jiffies, netif->credit_timeout.expires))
> >> +            netif->credit_timeout.expires = jiffies;
> > 
> > Do you not need to remove the similar check from the following block?
> 
> I don't think so, but I also can't see how that adjustment would
> help in the first place: If it gets executed after a very long period
> of no traffic, it would itself not be able to reliably tell whether the
> clock wrapped.

Hrm, yes, This change would help in the case of a dribble of traffic
which never hits the limit, but not in the case of no timer at all.

> That said, I agree that the code as is appears to have a problem
> (with 32-bit jiffies at least), but I can't see how to easily deal with
> it.

Would it help to always have the pending timer armed, for either the
next tick if credit needs replenishing or for, say MAX_JIFFIES/4 as a
backstop to avoid wrapping issues?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:44:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:44:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeN8q-0005Po-V8; Fri, 30 Nov 2012 09:44:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeN8o-0005PY-Rc
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:44:15 +0000
Received: from [85.158.138.51:21023] by server-15.bemta-3.messagelabs.com id
	56/F4-23779-EEF78B05; Fri, 30 Nov 2012 09:44:14 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1354268650!24096131!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3808 invoked from network); 30 Nov 2012 09:44:11 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 09:44:11 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16085977"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 09:44:10 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:44:10 +0000
Message-ID: <1354268649.6269.80.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Fri, 30 Nov 2012 09:44:09 +0000
In-Reply-To: <50B8898D02000078000ACC41@nat28.tlf.novell.com>
References: <961EE662BA396D43898AFA993C8F01B775066487@SBJEXCH1A.websense.com>
	<1354264550.6039.37.camel@dagon.hellion.org.uk>
	<50B8898D02000078000ACC41@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Shunli Yi <syi@websense.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [patch] netback: Xennet half die---netback driver
 didn't detect the jiffies wrapping correctly.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-30 at 09:25 +0000, Jan Beulich wrote:
> >>> On 30.11.12 at 09:35, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Fri, 2012-11-30 at 08:09 +0000, Yi, Shunli wrote:
> >> Netback driver use " time_after_eq()" to check the jiffies wrapping,
> >> while this function was only called when the credit is  running out.
> >> So, if the jiffies wrapped and the credit isn't run out in first half
> >> jiffies circle, the time_after_eq() cannot check the wrapping any
> >> more.
> > 
> > Which tree is this against? It doesn't appear to be mainline Linux,
> > which is all I am really interested in these days.
> > 
> > Also your patch is missing a Signed-off-by and is whitespace damaged.
> > Please read Documentation/SubmittingPatches and
> > Documentation/SubmitChecklist.
> > 
> >> This will cause the credit_timerout.expires is set to dozens of days
> >> in future.
> >>
> >>  The netback will stop receiving data from netfront. 
> >> 
> >> For example: 
> >> Jiffies initialized to 0xffffff-(300*HZ), and the
> >> credit_timeout.expires was initialized to 0xffffff00, 
> >> After dozens of days,  when the jiffies grow to upper than 0x80000000,
> >> and the time_after_eq() will cannot check for the wrapping.
> >> 
> >> 
> >> 
> >> --- drivers/xen/netback/netback.c.org	2012-11-30 15:48:13.109039998 -0500
> >> +++ drivers/xen/netback/netback.c	2012-11-30 15:48:55.212072898 -0500
> >> @@ -1272,6 +1272,10 @@ static void net_tx_action(unsigned long
> >>  		rmb(); /* Ensure that we see the request before we copy it. */
> >>  		memcpy(&txreq, RING_GET_REQUEST(&netif->tx, i), sizeof(txreq));
> >>  
> >> +        /* Check for the jiffies wrapping */
> >> +        if (time_after_eq(jiffies, netif->credit_timeout.expires))
> >> +            netif->credit_timeout.expires = jiffies;
> > 
> > Do you not need to remove the similar check from the following block?
> 
> I don't think so, but I also can't see how that adjustment would
> help in the first place: If it gets executed after a very long period
> of no traffic, it would itself not be able to reliably tell whether the
> clock wrapped.

Hrm, yes, This change would help in the case of a dribble of traffic
which never hits the limit, but not in the case of no timer at all.

> That said, I agree that the code as is appears to have a problem
> (with 32-bit jiffies at least), but I can't see how to easily deal with
> it.

Would it help to always have the pending timer armed, for either the
next tick if credit needs replenishing or for, say MAX_JIFFIES/4 as a
backstop to avoid wrapping issues?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:44:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:44:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeN9L-0005UO-G1; Fri, 30 Nov 2012 09:44:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeN9J-0005U6-MP
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:44:45 +0000
Received: from [85.158.143.35:4024] by server-2.bemta-4.messagelabs.com id
	62/87-28922-D0088B05; Fri, 30 Nov 2012 09:44:45 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1354268684!13093378!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25828 invoked from network); 30 Nov 2012 09:44:44 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 09:44:44 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 09:24:23 +0000
Message-Id: <50B8898D02000078000ACC41@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 09:25:17 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>,
 "Shunli Yi" <syi@websense.com>
References: <961EE662BA396D43898AFA993C8F01B775066487@SBJEXCH1A.websense.com>
	<1354264550.6039.37.camel@dagon.hellion.org.uk>
In-Reply-To: <1354264550.6039.37.camel@dagon.hellion.org.uk>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [patch] netback: Xennet half die---netback driver
 didn't detect the jiffies wrapping correctly.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 09:35, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Fri, 2012-11-30 at 08:09 +0000, Yi, Shunli wrote:
>> Netback driver use " time_after_eq()" to check the jiffies wrapping,
>> while this function was only called when the credit is  running out.
>> So, if the jiffies wrapped and the credit isn't run out in first half
>> jiffies circle, the time_after_eq() cannot check the wrapping any
>> more.
> 
> Which tree is this against? It doesn't appear to be mainline Linux,
> which is all I am really interested in these days.
> 
> Also your patch is missing a Signed-off-by and is whitespace damaged.
> Please read Documentation/SubmittingPatches and
> Documentation/SubmitChecklist.
> 
>> This will cause the credit_timerout.expires is set to dozens of days
>> in future.
>>
>>  The netback will stop receiving data from netfront. 
>> 
>> For example: 
>> Jiffies initialized to 0xffffff-(300*HZ), and the
>> credit_timeout.expires was initialized to 0xffffff00, 
>> After dozens of days,  when the jiffies grow to upper than 0x80000000,
>> and the time_after_eq() will cannot check for the wrapping.
>> 
>> 
>> 
>> --- drivers/xen/netback/netback.c.org	2012-11-30 15:48:13.109039998 -0500
>> +++ drivers/xen/netback/netback.c	2012-11-30 15:48:55.212072898 -0500
>> @@ -1272,6 +1272,10 @@ static void net_tx_action(unsigned long
>>  		rmb(); /* Ensure that we see the request before we copy it. */
>>  		memcpy(&txreq, RING_GET_REQUEST(&netif->tx, i), sizeof(txreq));
>>  
>> +        /* Check for the jiffies wrapping */
>> +        if (time_after_eq(jiffies, netif->credit_timeout.expires))
>> +            netif->credit_timeout.expires = jiffies;
> 
> Do you not need to remove the similar check from the following block?

I don't think so, but I also can't see how that adjustment would
help in the first place: If it gets executed after a very long period
of no traffic, it would itself not be able to reliably tell whether the
clock wrapped.

That said, I agree that the code as is appears to have a problem
(with 32-bit jiffies at least), but I can't see how to easily deal with
it.

Jan

> I'm also surprised that block doesn't need further adjustment since it
> uses netif->credit_timeout.expires as its input and so this change will
> change its behaviour.
> 
> Perhaps this new addition needs to be in an else block after if
> (txreq.size > netif->remaining_credit) ?
> 
> Why is there no need to call tx_add_credit in this case? What about
> needing to check for a pending timer?
> 
>> +
>>  		/* Credit-based scheduling. */
>>  		if (txreq.size > netif->remaining_credit) {
>>  			unsigned long now = jiffies;
>> 
>> 
>> 
>> 
>> 
>>  Protected by Websense Hosted Email Security -- www.websense.com 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:44:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:44:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeN9L-0005UO-G1; Fri, 30 Nov 2012 09:44:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeN9J-0005U6-MP
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:44:45 +0000
Received: from [85.158.143.35:4024] by server-2.bemta-4.messagelabs.com id
	62/87-28922-D0088B05; Fri, 30 Nov 2012 09:44:45 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1354268684!13093378!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25828 invoked from network); 30 Nov 2012 09:44:44 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 09:44:44 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 09:24:23 +0000
Message-Id: <50B8898D02000078000ACC41@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 09:25:17 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>,
 "Shunli Yi" <syi@websense.com>
References: <961EE662BA396D43898AFA993C8F01B775066487@SBJEXCH1A.websense.com>
	<1354264550.6039.37.camel@dagon.hellion.org.uk>
In-Reply-To: <1354264550.6039.37.camel@dagon.hellion.org.uk>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [patch] netback: Xennet half die---netback driver
 didn't detect the jiffies wrapping correctly.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 09:35, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Fri, 2012-11-30 at 08:09 +0000, Yi, Shunli wrote:
>> Netback driver use " time_after_eq()" to check the jiffies wrapping,
>> while this function was only called when the credit is  running out.
>> So, if the jiffies wrapped and the credit isn't run out in first half
>> jiffies circle, the time_after_eq() cannot check the wrapping any
>> more.
> 
> Which tree is this against? It doesn't appear to be mainline Linux,
> which is all I am really interested in these days.
> 
> Also your patch is missing a Signed-off-by and is whitespace damaged.
> Please read Documentation/SubmittingPatches and
> Documentation/SubmitChecklist.
> 
>> This will cause the credit_timerout.expires is set to dozens of days
>> in future.
>>
>>  The netback will stop receiving data from netfront. 
>> 
>> For example: 
>> Jiffies initialized to 0xffffff-(300*HZ), and the
>> credit_timeout.expires was initialized to 0xffffff00, 
>> After dozens of days,  when the jiffies grow to upper than 0x80000000,
>> and the time_after_eq() will cannot check for the wrapping.
>> 
>> 
>> 
>> --- drivers/xen/netback/netback.c.org	2012-11-30 15:48:13.109039998 -0500
>> +++ drivers/xen/netback/netback.c	2012-11-30 15:48:55.212072898 -0500
>> @@ -1272,6 +1272,10 @@ static void net_tx_action(unsigned long
>>  		rmb(); /* Ensure that we see the request before we copy it. */
>>  		memcpy(&txreq, RING_GET_REQUEST(&netif->tx, i), sizeof(txreq));
>>  
>> +        /* Check for the jiffies wrapping */
>> +        if (time_after_eq(jiffies, netif->credit_timeout.expires))
>> +            netif->credit_timeout.expires = jiffies;
> 
> Do you not need to remove the similar check from the following block?

I don't think so, but I also can't see how that adjustment would
help in the first place: If it gets executed after a very long period
of no traffic, it would itself not be able to reliably tell whether the
clock wrapped.

That said, I agree that the code as is appears to have a problem
(with 32-bit jiffies at least), but I can't see how to easily deal with
it.

Jan

> I'm also surprised that block doesn't need further adjustment since it
> uses netif->credit_timeout.expires as its input and so this change will
> change its behaviour.
> 
> Perhaps this new addition needs to be in an else block after if
> (txreq.size > netif->remaining_credit) ?
> 
> Why is there no need to call tx_add_credit in this case? What about
> needing to check for a pending timer?
> 
>> +
>>  		/* Credit-based scheduling. */
>>  		if (txreq.size > netif->remaining_credit) {
>>  			unsigned long now = jiffies;
>> 
>> 
>> 
>> 
>> 
>>  Protected by Websense Hosted Email Security -- www.websense.com 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:47:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:47:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNBl-0005mt-9Z; Fri, 30 Nov 2012 09:47:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeNBk-0005mk-7i
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 09:47:16 +0000
Received: from [85.158.143.35:20513] by server-2.bemta-4.messagelabs.com id
	49/0B-28922-3A088B05; Fri, 30 Nov 2012 09:47:15 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1354268833!12460027!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31098 invoked from network); 30 Nov 2012 09:47:14 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 09:47:14 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 09:47:13 +0000
Message-Id: <50B88EE702000078000ACC87@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 09:48:07 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <osstest-14494-mainreport@xen.org>
	<1354268351.6269.77.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354268351.6269.77.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"xen.org" <ian.jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [xen-unstable test] 14494: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 10:39, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Thu, 2012-11-29 at 21:13 +0000, xen.org wrote:
>> flight 14494 xen-unstable real [real]
>> http://www.chiark.greenend.org.uk/~xensrcts/logs/14494/ 
>> 
>> Regressions :-(
>> 
>> Tests which did not succeed and are blocking,
>> including tests which could not be run:
>>  test-amd64-amd64-pv           5 xen-boot                  fail REGR. vs. 
> 14482
> 
> Jan, I assume this relates to your "AMD IOMMU: add locking missing from
> c/s 26198:ba90ecb0231f" from this morning?

Yes, that patch was prompted by these failures. I'll be in the
office today only until about 1pm, so I'll wait for a little more to
see if I can get e.g. Keir's ack on it, but will try to remember to
commit it even without before leaving.

Jan

> Nov 29 17:53:03.732540 (XEN) Assertion 'spin_is_locked(&desc->lock)'
> failed at msi.c:276
> Nov 29 17:53:03.740545 (XEN) ----[ Xen-4.3-unstable  x86_64  debug=y  Not 
> tainted ]----
> Nov 29 17:53:03.748543 (XEN) CPU:    0
> Nov 29 17:53:03.748570 (XEN) RIP:    e008:[<ffff82c48016607d>] 
> set_msi_affinity+0x4a/0x1ba
> Nov 29 17:53:03.756539 (XEN) RFLAGS: 0000000000010046   CONTEXT: hypervisor
> Nov 29 17:53:03.764538 (XEN) rax: 0000000000000000   rbx: ffff830116381880   
> rcx: 0000000000000000
> Nov 29 17:53:03.772548 (XEN) rdx: 0000000000000082   rsi: ffff82c480260280   
> rdi: ffff8301163818a8
> Nov 29 17:53:03.780548 (XEN) rbp: ffff82c4802bfd78   rsp: ffff82c4802bfd28   
> r8:  0000000000000020
> Nov 29 17:53:03.788548 (XEN) r9:  0000000000000081   r10: 0000000000000001   
> r11: ffff82c4802cbe40
> Nov 29 17:53:03.796542 (XEN) r12: ffff8301163f0370   r13: 0000000000000001   
> r14: 0000000000000296
> Nov 29 17:53:03.804547 (XEN) r15: ffff82c4802e7f88   cr0: 000000008005003b   
> cr4: 00000000000006f0
> Nov 29 17:53:03.812547 (XEN) cr3: 00000000dfc6f000   cr2: 0000000000000000
> Nov 29 17:53:03.820532 (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 
> 0000   cs: e008
> Nov 29 17:53:03.828539 (XEN) Xen stack trace from rsp=ffff82c4802bfd28:
> Nov 29 17:53:03.832541 (XEN)    ffff82c4802bfd38 0000000000000282 
> ffff82c4802bfd68 ffff82c480291d5a
> Nov 29 17:53:03.840548 (XEN)    0000000000000018 ffff8301163f0350 
> ffff8301163f0360 ffff82c4802e7f80
> Nov 29 17:53:03.848549 (XEN)    0000000000000296 ffff82c4802e7f88 
> ffff82c4802bfdb8 ffff82c48014cea4
> Nov 29 17:53:03.856541 (XEN)    ffff82c3fffff000 ffff8301163f0350 
> ffff82c3fffff000 ffff82c4802e7f80
> Nov 29 17:53:03.864553 (XEN)    ffff82c4802e7f90 ffff82c4802e7f88 
> ffff82c4802bfe18 ffff82c480288e98
> Nov 29 17:53:03.872548 (XEN)    ffff8301163fbfe0 0000000000000018 
> ffff830116381880 000000188028d379
> Nov 29 17:53:03.884540 (XEN)    00000000e0000000 00000000ffffffed 
> 0000000000000000 ffff8301163fbfe0
> Nov 29 17:53:03.892538 (XEN)    0000000000000002 0000000000000002 
> ffff82c4802bfe28 ffff82c480289256
> Nov 29 17:53:03.900541 (XEN)    ffff82c4802bfe48 ffff82c480285fce 
> ffff82c4802b8000 ffff830000089fb0
> Nov 29 17:53:03.908541 (XEN)    ffff82c4802bff08 ffff82c4802975f5 
> 0000000000000000 0000000000000000
> Nov 29 17:53:03.916541 (XEN)    ffff830000089dd0 0000000000f10000 
> 00000000dfa00000 0000000000000000
> Nov 29 17:53:03.924538 (XEN)    0000000000301780 ffff82c4ffffffff 
> ffff830000000003 ffff830000089f30
> Nov 29 17:53:03.932544 (XEN)    ffff830000089fb0 ffff82c4ffffffff 
> 0000000800000000 000000010000006e
> Nov 29 17:53:03.940546 (XEN)    0000000000000003 00000000000002f8 
> 0000000000000000 0000000000000000
> Nov 29 17:53:03.948545 (XEN)    0000000000000000 0000000000000000 
> 0000000000000000 0000000000000000
> Nov 29 17:53:03.956546 (XEN)    000000000007fe0c ffff82c4801000b5 
> 0000000000000000 0000000000000000
> Nov 29 17:53:03.964546 (XEN)    0000000000000000 0000000000000000 
> 0000000000000000 0000000000000000
> Nov 29 17:53:03.972545 (XEN)    0000000000000000 0000000000000000 
> 0000000000000000 0000000000000000
> Nov 29 17:53:03.980545 (XEN)    0000000000000000 0000000000000000 
> 0000000000000000 0000000000000000
> Nov 29 17:53:03.988548 (XEN)    0000000000000000 0000000000000000 
> 0000000000000000 0000000000000000
> Nov 29 17:53:03.996551 (XEN) Xen call trace:
> Nov 29 17:53:04.000522 (XEN)    [<ffff82c48016607d>] 
> set_msi_affinity+0x4a/0x1ba
> Nov 29 17:53:04.008538 (XEN)    [<ffff82c48014cea4>] enable_iommu+0x54d/0x68f
> Nov 29 17:53:04.012543 (XEN)    [<ffff82c480288e98>] 
> amd_iommu_init+0x4d0/0x65a
> Nov 29 17:53:04.020542 (XEN)    [<ffff82c480289256>] amd_iov_detect+0x6c/0xf6
> Nov 29 17:53:04.028535 (XEN)    [<ffff82c480285fce>] iommu_setup+0x67/0x143
> Nov 29 17:53:04.032533 (XEN)    [<ffff82c4802975f5>] __start_xen+0x269d/0x2acd
> Nov 29 17:53:04.040537 (XEN)    
> Nov 29 17:53:04.040559 (XEN) 
> Nov 29 17:53:04.040581 (XEN) ****************************************
> Nov 29 17:53:04.048557 (XEN) Panic on CPU 0:
> Nov 29 17:53:04.052523 (XEN) Assertion 'spin_is_locked(&desc->lock)' failed at 
> msi.c:276
> Nov 29 17:53:04.060538 (XEN) ****************************************



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:47:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:47:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNBl-0005mt-9Z; Fri, 30 Nov 2012 09:47:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeNBk-0005mk-7i
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 09:47:16 +0000
Received: from [85.158.143.35:20513] by server-2.bemta-4.messagelabs.com id
	49/0B-28922-3A088B05; Fri, 30 Nov 2012 09:47:15 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1354268833!12460027!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31098 invoked from network); 30 Nov 2012 09:47:14 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 09:47:14 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 09:47:13 +0000
Message-Id: <50B88EE702000078000ACC87@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 09:48:07 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <osstest-14494-mainreport@xen.org>
	<1354268351.6269.77.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354268351.6269.77.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"xen.org" <ian.jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [xen-unstable test] 14494: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 10:39, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Thu, 2012-11-29 at 21:13 +0000, xen.org wrote:
>> flight 14494 xen-unstable real [real]
>> http://www.chiark.greenend.org.uk/~xensrcts/logs/14494/ 
>> 
>> Regressions :-(
>> 
>> Tests which did not succeed and are blocking,
>> including tests which could not be run:
>>  test-amd64-amd64-pv           5 xen-boot                  fail REGR. vs. 
> 14482
> 
> Jan, I assume this relates to your "AMD IOMMU: add locking missing from
> c/s 26198:ba90ecb0231f" from this morning?

Yes, that patch was prompted by these failures. I'll be in the
office today only until about 1pm, so I'll wait for a little more to
see if I can get e.g. Keir's ack on it, but will try to remember to
commit it even without before leaving.

Jan

> Nov 29 17:53:03.732540 (XEN) Assertion 'spin_is_locked(&desc->lock)'
> failed at msi.c:276
> Nov 29 17:53:03.740545 (XEN) ----[ Xen-4.3-unstable  x86_64  debug=y  Not 
> tainted ]----
> Nov 29 17:53:03.748543 (XEN) CPU:    0
> Nov 29 17:53:03.748570 (XEN) RIP:    e008:[<ffff82c48016607d>] 
> set_msi_affinity+0x4a/0x1ba
> Nov 29 17:53:03.756539 (XEN) RFLAGS: 0000000000010046   CONTEXT: hypervisor
> Nov 29 17:53:03.764538 (XEN) rax: 0000000000000000   rbx: ffff830116381880   
> rcx: 0000000000000000
> Nov 29 17:53:03.772548 (XEN) rdx: 0000000000000082   rsi: ffff82c480260280   
> rdi: ffff8301163818a8
> Nov 29 17:53:03.780548 (XEN) rbp: ffff82c4802bfd78   rsp: ffff82c4802bfd28   
> r8:  0000000000000020
> Nov 29 17:53:03.788548 (XEN) r9:  0000000000000081   r10: 0000000000000001   
> r11: ffff82c4802cbe40
> Nov 29 17:53:03.796542 (XEN) r12: ffff8301163f0370   r13: 0000000000000001   
> r14: 0000000000000296
> Nov 29 17:53:03.804547 (XEN) r15: ffff82c4802e7f88   cr0: 000000008005003b   
> cr4: 00000000000006f0
> Nov 29 17:53:03.812547 (XEN) cr3: 00000000dfc6f000   cr2: 0000000000000000
> Nov 29 17:53:03.820532 (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 
> 0000   cs: e008
> Nov 29 17:53:03.828539 (XEN) Xen stack trace from rsp=ffff82c4802bfd28:
> Nov 29 17:53:03.832541 (XEN)    ffff82c4802bfd38 0000000000000282 
> ffff82c4802bfd68 ffff82c480291d5a
> Nov 29 17:53:03.840548 (XEN)    0000000000000018 ffff8301163f0350 
> ffff8301163f0360 ffff82c4802e7f80
> Nov 29 17:53:03.848549 (XEN)    0000000000000296 ffff82c4802e7f88 
> ffff82c4802bfdb8 ffff82c48014cea4
> Nov 29 17:53:03.856541 (XEN)    ffff82c3fffff000 ffff8301163f0350 
> ffff82c3fffff000 ffff82c4802e7f80
> Nov 29 17:53:03.864553 (XEN)    ffff82c4802e7f90 ffff82c4802e7f88 
> ffff82c4802bfe18 ffff82c480288e98
> Nov 29 17:53:03.872548 (XEN)    ffff8301163fbfe0 0000000000000018 
> ffff830116381880 000000188028d379
> Nov 29 17:53:03.884540 (XEN)    00000000e0000000 00000000ffffffed 
> 0000000000000000 ffff8301163fbfe0
> Nov 29 17:53:03.892538 (XEN)    0000000000000002 0000000000000002 
> ffff82c4802bfe28 ffff82c480289256
> Nov 29 17:53:03.900541 (XEN)    ffff82c4802bfe48 ffff82c480285fce 
> ffff82c4802b8000 ffff830000089fb0
> Nov 29 17:53:03.908541 (XEN)    ffff82c4802bff08 ffff82c4802975f5 
> 0000000000000000 0000000000000000
> Nov 29 17:53:03.916541 (XEN)    ffff830000089dd0 0000000000f10000 
> 00000000dfa00000 0000000000000000
> Nov 29 17:53:03.924538 (XEN)    0000000000301780 ffff82c4ffffffff 
> ffff830000000003 ffff830000089f30
> Nov 29 17:53:03.932544 (XEN)    ffff830000089fb0 ffff82c4ffffffff 
> 0000000800000000 000000010000006e
> Nov 29 17:53:03.940546 (XEN)    0000000000000003 00000000000002f8 
> 0000000000000000 0000000000000000
> Nov 29 17:53:03.948545 (XEN)    0000000000000000 0000000000000000 
> 0000000000000000 0000000000000000
> Nov 29 17:53:03.956546 (XEN)    000000000007fe0c ffff82c4801000b5 
> 0000000000000000 0000000000000000
> Nov 29 17:53:03.964546 (XEN)    0000000000000000 0000000000000000 
> 0000000000000000 0000000000000000
> Nov 29 17:53:03.972545 (XEN)    0000000000000000 0000000000000000 
> 0000000000000000 0000000000000000
> Nov 29 17:53:03.980545 (XEN)    0000000000000000 0000000000000000 
> 0000000000000000 0000000000000000
> Nov 29 17:53:03.988548 (XEN)    0000000000000000 0000000000000000 
> 0000000000000000 0000000000000000
> Nov 29 17:53:03.996551 (XEN) Xen call trace:
> Nov 29 17:53:04.000522 (XEN)    [<ffff82c48016607d>] 
> set_msi_affinity+0x4a/0x1ba
> Nov 29 17:53:04.008538 (XEN)    [<ffff82c48014cea4>] enable_iommu+0x54d/0x68f
> Nov 29 17:53:04.012543 (XEN)    [<ffff82c480288e98>] 
> amd_iommu_init+0x4d0/0x65a
> Nov 29 17:53:04.020542 (XEN)    [<ffff82c480289256>] amd_iov_detect+0x6c/0xf6
> Nov 29 17:53:04.028535 (XEN)    [<ffff82c480285fce>] iommu_setup+0x67/0x143
> Nov 29 17:53:04.032533 (XEN)    [<ffff82c4802975f5>] __start_xen+0x269d/0x2acd
> Nov 29 17:53:04.040537 (XEN)    
> Nov 29 17:53:04.040559 (XEN) 
> Nov 29 17:53:04.040581 (XEN) ****************************************
> Nov 29 17:53:04.048557 (XEN) Panic on CPU 0:
> Nov 29 17:53:04.052523 (XEN) Assertion 'spin_is_locked(&desc->lock)' failed at 
> msi.c:276
> Nov 29 17:53:04.060538 (XEN) ****************************************



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:50:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:50:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNEF-0005yw-Si; Fri, 30 Nov 2012 09:49:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeNEE-0005yn-Kr
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:49:50 +0000
Received: from [85.158.143.35:38965] by server-3.bemta-4.messagelabs.com id
	35/EA-06841-D3188B05; Fri, 30 Nov 2012 09:49:49 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1354268988!11263994!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6301 invoked from network); 30 Nov 2012 09:49:49 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 09:49:49 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 09:49:48 +0000
Message-Id: <50B88F8002000078000ACC8A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 09:50:40 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <wei.huang2@amd.com>,<weiwang.dd@gmail.com>,
	<xiantao.zhang@intel.com>, "Keir Fraser" <keir@xen.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCDE3016.54628%keir@xen.org>
In-Reply-To: <CCDE3016.54628%keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Tim Deegan <tim@xen.org>, Dario Faggioli <raistlin@linux.it>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 10:42, Keir Fraser <keir@xen.org> wrote:
> On 05/11/2012 16:53, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>> Under the assumption that in these cases recurring faults aren't a
>> security issue and it can be expected that the drivers there are going
>> to try to take care of the problem.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> This one's sat a while with no comments...

It's in already (26133:fdb69dd527cd), with Tim's and Dario's ack
(who were the ones involved in creating the original change this
modifies).

But yes, we're having a general response problem for IOMMU
related stuff - I already asked for this to be a topic on the next
community call.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:50:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:50:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNEF-0005yw-Si; Fri, 30 Nov 2012 09:49:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeNEE-0005yn-Kr
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:49:50 +0000
Received: from [85.158.143.35:38965] by server-3.bemta-4.messagelabs.com id
	35/EA-06841-D3188B05; Fri, 30 Nov 2012 09:49:49 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1354268988!11263994!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6301 invoked from network); 30 Nov 2012 09:49:49 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-11.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 09:49:49 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 09:49:48 +0000
Message-Id: <50B88F8002000078000ACC8A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 09:50:40 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: <wei.huang2@amd.com>,<weiwang.dd@gmail.com>,
	<xiantao.zhang@intel.com>, "Keir Fraser" <keir@xen.org>
References: <5097FD2902000078000A66BF@nat28.tlf.novell.com>
	<CCDE3016.54628%keir@xen.org>
In-Reply-To: <CCDE3016.54628%keir@xen.org>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Tim Deegan <tim@xen.org>, Dario Faggioli <raistlin@linux.it>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] IOMMU: don't disable bus mastering on
 faults for devices used by Xen or Dom0
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 10:42, Keir Fraser <keir@xen.org> wrote:
> On 05/11/2012 16:53, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>> Under the assumption that in these cases recurring faults aren't a
>> security issue and it can be expected that the drivers there are going
>> to try to take care of the problem.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> This one's sat a while with no comments...

It's in already (26133:fdb69dd527cd), with Tim's and Dario's ack
(who were the ones involved in creating the original change this
modifies).

But yes, we're having a general response problem for IOMMU
related stuff - I already asked for this to be a topic on the next
community call.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:50:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:50:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNFA-00064a-GP; Fri, 30 Nov 2012 09:50:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TeNF9-00064I-1J; Fri, 30 Nov 2012 09:50:47 +0000
Received: from [85.158.138.51:43022] by server-14.bemta-3.messagelabs.com id
	8A/8F-31424-67188B05; Fri, 30 Nov 2012 09:50:46 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1354269043!28093557!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU2Nzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30087 invoked from network); 30 Nov 2012 09:50:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 09:50:44 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16086162"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 09:50:43 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:50:43 +0000
Message-ID: <1354269042.6269.85.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Anil Madhavapeddy <anil@recoil.org>
Date: Fri, 30 Nov 2012 09:50:42 +0000
In-Reply-To: <5DC583C2-ED2D-4305-9AC5-74F8F57F300D@recoil.org>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<2b433b1523e4295bb1ed.1353432210@cosworth.uk.xensource.com>
	<7EA643C653F17F4C80DE959E978F10EDFA101107B2@LONPMAILBOX01.citrite.net>
	<1354212199.6269.67.camel@zakaz.uk.xensource.com>
	<5DC583C2-ED2D-4305-9AC5-74F8F57F300D@recoil.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Rob Hoes <Rob.Hoes@citrix.com>, David Scott <scott.dj@gmail.com>,
	"xen-api@lists.xen.org" <xen-api@lists.xen.org>
Subject: Re: [Xen-devel] [Xen-API] [PATCH 10 of 15] libxc/ocaml: Add simple
 binding for xentoollog (output only)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 18:20 +0000, Anil Madhavapeddy wrote:
> On 29 Nov 2012, at 18:03, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > 
> > Another idea might be to make the bindings use the async interfaces
> > wherever possible by default, by definition anything potentially
> > blocking has supports this and that would avoid the need for
> > enter/leave, but at the expense of making the ocaml callers ugly
> > perhaps? Or maybe this sort of thing ends up looking very natural in
> > ocaml? Depends on your application's event mechanism I suspect.
> > 
> > Last half witted idea: everything could be async but the bindings
> > include the loop to wait for the async event, i.e. effectively making
> > the call sync again. This sounds silly but it might allow better control
> > over the placement of enter/leave vs callbacks, since you would just
> > drop it over libxl_event_wait?
> 
> Making everything explicitly async and non-blocking is by far the
> preferred solution in terms of stability, as it largely removes the
> need to worry about the GC interface and thread interactions.
> 
> There are several libraries to wrap async interfaces in convenient
> synchronous programming, most notably Lwt (http://ocsigen.org/lwt).

I'll have to take your word for that ;-)

> With this interface, all the OCaml callbacks are implemented in
> OCaml, and it just needs a select/epoll or equivalent to wake up
> sleeping threads when an IO event occurs.

On the libxl side you'd want to be using the ao_how thing described in
libxl.h[0] and probably the event loop stuff in libxl_event.h[1]. My gut
feeling is that you'd want to go the libxl_osevent_register_hooks route
to integrate libxl into lwt's event loop rather than the
libxl_osevent_{before,after}poll option.

[0] http://xenbits.xen.org/hg/xen-unstable.hg/file/1c69c938f641/tools/libxl/libxl.h#l377
[1] http://xenbits.xen.org/hg/xen-unstable.hg/file/1c69c938f641/tools/libxl/libxl_event.h

Ian.

> 
> Dave has already done some bindings to Lwt, so I've CCed him...
> 
> -anil
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:50:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:50:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNFA-00064a-GP; Fri, 30 Nov 2012 09:50:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1TeNF9-00064I-1J; Fri, 30 Nov 2012 09:50:47 +0000
Received: from [85.158.138.51:43022] by server-14.bemta-3.messagelabs.com id
	8A/8F-31424-67188B05; Fri, 30 Nov 2012 09:50:46 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1354269043!28093557!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU2Nzk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30087 invoked from network); 30 Nov 2012 09:50:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-10.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 09:50:44 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16086162"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 09:50:43 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:50:43 +0000
Message-ID: <1354269042.6269.85.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Anil Madhavapeddy <anil@recoil.org>
Date: Fri, 30 Nov 2012 09:50:42 +0000
In-Reply-To: <5DC583C2-ED2D-4305-9AC5-74F8F57F300D@recoil.org>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<2b433b1523e4295bb1ed.1353432210@cosworth.uk.xensource.com>
	<7EA643C653F17F4C80DE959E978F10EDFA101107B2@LONPMAILBOX01.citrite.net>
	<1354212199.6269.67.camel@zakaz.uk.xensource.com>
	<5DC583C2-ED2D-4305-9AC5-74F8F57F300D@recoil.org>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Rob Hoes <Rob.Hoes@citrix.com>, David Scott <scott.dj@gmail.com>,
	"xen-api@lists.xen.org" <xen-api@lists.xen.org>
Subject: Re: [Xen-devel] [Xen-API] [PATCH 10 of 15] libxc/ocaml: Add simple
 binding for xentoollog (output only)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 18:20 +0000, Anil Madhavapeddy wrote:
> On 29 Nov 2012, at 18:03, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > 
> > Another idea might be to make the bindings use the async interfaces
> > wherever possible by default, by definition anything potentially
> > blocking has supports this and that would avoid the need for
> > enter/leave, but at the expense of making the ocaml callers ugly
> > perhaps? Or maybe this sort of thing ends up looking very natural in
> > ocaml? Depends on your application's event mechanism I suspect.
> > 
> > Last half witted idea: everything could be async but the bindings
> > include the loop to wait for the async event, i.e. effectively making
> > the call sync again. This sounds silly but it might allow better control
> > over the placement of enter/leave vs callbacks, since you would just
> > drop it over libxl_event_wait?
> 
> Making everything explicitly async and non-blocking is by far the
> preferred solution in terms of stability, as it largely removes the
> need to worry about the GC interface and thread interactions.
> 
> There are several libraries to wrap async interfaces in convenient
> synchronous programming, most notably Lwt (http://ocsigen.org/lwt).

I'll have to take your word for that ;-)

> With this interface, all the OCaml callbacks are implemented in
> OCaml, and it just needs a select/epoll or equivalent to wake up
> sleeping threads when an IO event occurs.

On the libxl side you'd want to be using the ao_how thing described in
libxl.h[0] and probably the event loop stuff in libxl_event.h[1]. My gut
feeling is that you'd want to go the libxl_osevent_register_hooks route
to integrate libxl into lwt's event loop rather than the
libxl_osevent_{before,after}poll option.

[0] http://xenbits.xen.org/hg/xen-unstable.hg/file/1c69c938f641/tools/libxl/libxl.h#l377
[1] http://xenbits.xen.org/hg/xen-unstable.hg/file/1c69c938f641/tools/libxl/libxl_event.h

Ian.

> 
> Dave has already done some bindings to Lwt, so I've CCed him...
> 
> -anil
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:58:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:58:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNMP-0006hJ-2g; Fri, 30 Nov 2012 09:58:17 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TeNMM-0006h8-WB
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:58:15 +0000
Received: from [193.109.254.147:51835] by server-6.bemta-14.messagelabs.com id
	7F/E5-02788-63388B05; Fri, 30 Nov 2012 09:58:14 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1354269478!2067935!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6652 invoked from network); 30 Nov 2012 09:57:58 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 09:57:58 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16086450"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 09:57:58 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:57:58 +0000
Message-ID: <50B88325.1050009@citrix.com>
Date: Fri, 30 Nov 2012 10:57:57 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Manuel Bouyer <bouyer@antioche.eu.org>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr> <50B8718C.1090405@citrix.com>
	<20121130085241.GC311@asim.lip6.fr> <50B87A7E.5030001@citrix.com>
	<20121130094143.GA10993@asim.lip6.fr>
In-Reply-To: <20121130094143.GA10993@asim.lip6.fr>
Cc: "port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/12 10:41, Manuel Bouyer wrote:
> On Fri, Nov 30, 2012 at 10:21:02AM +0100, Roger Pau Monn=E9 wrote:
>>> And I don't like the idea of software doing things in my back.
>>> And, beside this, I don't think local vs remote is the right criteria.
>>> There are remote filesystems which may play nice with vnd. There
>>> are local filesystems that may not play nice with vnd.
>>
>> I would agree with you if this was a DomU crash, but in this case the
>> crash happens in the Dom0, and every DomU that the system might be
>> running crashes completely. This is not acceptable in any way from my
>> point of view.
>>
>> I think we should not expect the user to be aware of this kind of
>> problems. If we cannot guarantee that the vnd driver is functional for
>> all filesystems, we should not use it. From my point of view reliability
>> should always come before performance.
> =

> In my POV, the admin show know what he's doing. This includes be aware of=
 the
> limitations of the software he uses. A 50% performances loss just "in cas=
e"
> is not accetpable. Or at last last there should be a way for the admin
> to revert to an acceptable configuration, performance wise, without
> hacking and rebuilding from sources.

There are also other tools that build on top of libxl, like libvirt, are
we going to modify those high level tools to add a new option to the
config file if the disk of a DomU is in NFS and the Dom0 is NetBSD? I
don't think we should take that road, I think libxl should take care of
all those quicks, and provide an uniform layer that can be trusted
independently of the environment, so the same configuration file can be
used in all supported Dom0 OSes.

Not fixing this in libxl just moves the problem a layer upper, where
there's a lot more of options, and of course a lot more of work to track
and fix them all.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:58:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:58:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNMP-0006hJ-2g; Fri, 30 Nov 2012 09:58:17 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <roger.pau@citrix.com>) id 1TeNMM-0006h8-WB
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:58:15 +0000
Received: from [193.109.254.147:51835] by server-6.bemta-14.messagelabs.com id
	7F/E5-02788-63388B05; Fri, 30 Nov 2012 09:58:14 +0000
X-Env-Sender: roger.pau@citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1354269478!2067935!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6652 invoked from network); 30 Nov 2012 09:57:58 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 09:57:58 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16086450"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 09:57:58 +0000
Received: from [192.168.1.30] (10.31.3.229) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:57:58 +0000
Message-ID: <50B88325.1050009@citrix.com>
Date: Fri, 30 Nov 2012 10:57:57 +0100
From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Manuel Bouyer <bouyer@antioche.eu.org>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr> <50B8718C.1090405@citrix.com>
	<20121130085241.GC311@asim.lip6.fr> <50B87A7E.5030001@citrix.com>
	<20121130094143.GA10993@asim.lip6.fr>
In-Reply-To: <20121130094143.GA10993@asim.lip6.fr>
Cc: "port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/12 10:41, Manuel Bouyer wrote:
> On Fri, Nov 30, 2012 at 10:21:02AM +0100, Roger Pau Monn=E9 wrote:
>>> And I don't like the idea of software doing things in my back.
>>> And, beside this, I don't think local vs remote is the right criteria.
>>> There are remote filesystems which may play nice with vnd. There
>>> are local filesystems that may not play nice with vnd.
>>
>> I would agree with you if this was a DomU crash, but in this case the
>> crash happens in the Dom0, and every DomU that the system might be
>> running crashes completely. This is not acceptable in any way from my
>> point of view.
>>
>> I think we should not expect the user to be aware of this kind of
>> problems. If we cannot guarantee that the vnd driver is functional for
>> all filesystems, we should not use it. From my point of view reliability
>> should always come before performance.
> =

> In my POV, the admin show know what he's doing. This includes be aware of=
 the
> limitations of the software he uses. A 50% performances loss just "in cas=
e"
> is not accetpable. Or at last last there should be a way for the admin
> to revert to an acceptable configuration, performance wise, without
> hacking and rebuilding from sources.

There are also other tools that build on top of libxl, like libvirt, are
we going to modify those high level tools to add a new option to the
config file if the disk of a DomU is in NFS and the Dom0 is NetBSD? I
don't think we should take that road, I think libxl should take care of
all those quicks, and provide an uniform layer that can be trusted
independently of the environment, so the same configuration file can be
used in all supported Dom0 OSes.

Not fixing this in libxl just moves the problem a layer upper, where
there's a lot more of options, and of course a lot more of work to track
and fix them all.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:59:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:59:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNNm-0006o2-Im; Fri, 30 Nov 2012 09:59:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeNNl-0006np-81
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:59:41 +0000
Received: from [85.158.143.35:63550] by server-3.bemta-4.messagelabs.com id
	02/68-06841-C8388B05; Fri, 30 Nov 2012 09:59:40 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354269579!4615195!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12257 invoked from network); 30 Nov 2012 09:59:39 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 09:59:39 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16086492"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 09:59:29 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:59:29 +0000
Message-ID: <1354269567.6269.91.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Fri, 30 Nov 2012 09:59:27 +0000
In-Reply-To: <50B7AF3A.3090009@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-3-git-send-email-dgdegra@tycho.nsa.gov>
	<50B7AF3A.3090009@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/4] stubdom/vtpm: Add reconfiguration
 support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

(can you not top post please)

On Thu, 2012-11-29 at 18:53 +0000, Matthew Fioravante wrote:
> The purpose of this is to allow 2 entities in the same vm to use tpm 
> drivers, pv_grub and the linux guest. The Xenbus Reconfigure states are 
> new to me. Is this intended behavior in line with the original purpose 
> of the Reconfigure states or are we hijacking them to do something not 
> in the original xen front/back driver spec?

I'm not sure there was ever such a thing.

The reconfigure states were originally added by the pcifront/back
drivers which used them to implement device hotplug iirc.

It's looks to me like the use case here is more akin to the "online"
node which the block and net stuff has?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 09:59:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 09:59:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNNm-0006o2-Im; Fri, 30 Nov 2012 09:59:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeNNl-0006np-81
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 09:59:41 +0000
Received: from [85.158.143.35:63550] by server-3.bemta-4.messagelabs.com id
	02/68-06841-C8388B05; Fri, 30 Nov 2012 09:59:40 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354269579!4615195!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12257 invoked from network); 30 Nov 2012 09:59:39 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 09:59:39 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16086492"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 09:59:29 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:59:29 +0000
Message-ID: <1354269567.6269.91.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Fri, 30 Nov 2012 09:59:27 +0000
In-Reply-To: <50B7AF3A.3090009@jhuapl.edu>
References: <50B4D060.9070403@jhuapl.edu>
	<1354029286-17652-1-git-send-email-dgdegra@tycho.nsa.gov>
	<1354029286-17652-3-git-send-email-dgdegra@tycho.nsa.gov>
	<50B7AF3A.3090009@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 2/4] stubdom/vtpm: Add reconfiguration
 support
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

(can you not top post please)

On Thu, 2012-11-29 at 18:53 +0000, Matthew Fioravante wrote:
> The purpose of this is to allow 2 entities in the same vm to use tpm 
> drivers, pv_grub and the linux guest. The Xenbus Reconfigure states are 
> new to me. Is this intended behavior in line with the original purpose 
> of the Reconfigure states or are we hijacking them to do something not 
> in the original xen front/back driver spec?

I'm not sure there was ever such a thing.

The reconfigure states were originally added by the pcifront/back
drivers which used them to implement device hotplug iirc.

It's looks to me like the use case here is more akin to the "online"
node which the block and net stuff has?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:01:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:01:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNPb-00079T-3K; Fri, 30 Nov 2012 10:01:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeNPZ-00079I-Rk
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:01:34 +0000
Received: from [85.158.143.35:11949] by server-1.bemta-4.messagelabs.com id
	ED/CA-27934-DF388B05; Fri, 30 Nov 2012 10:01:33 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1354269687!13095554!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28296 invoked from network); 30 Nov 2012 10:01:29 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 10:01:29 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 10:01:27 +0000
Message-Id: <50B8923E02000078000ACCBC@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 10:02:22 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <961EE662BA396D43898AFA993C8F01B775066487@SBJEXCH1A.websense.com>
	<1354264550.6039.37.camel@dagon.hellion.org.uk>
	<50B8898D02000078000ACC41@nat28.tlf.novell.com>
	<1354268649.6269.80.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354268649.6269.80.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Shunli Yi <syi@websense.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [patch] netback: Xennet half die---netback driver
 didn't detect the jiffies wrapping correctly.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 10:44, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Fri, 2012-11-30 at 09:25 +0000, Jan Beulich wrote:
>> >>> On 30.11.12 at 09:35, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> > On Fri, 2012-11-30 at 08:09 +0000, Yi, Shunli wrote:
>> >> Netback driver use " time_after_eq()" to check the jiffies wrapping,
>> >> while this function was only called when the credit is  running out.
>> >> So, if the jiffies wrapped and the credit isn't run out in first half
>> >> jiffies circle, the time_after_eq() cannot check the wrapping any
>> >> more.
>> > 
>> > Which tree is this against? It doesn't appear to be mainline Linux,
>> > which is all I am really interested in these days.
>> > 
>> > Also your patch is missing a Signed-off-by and is whitespace damaged.
>> > Please read Documentation/SubmittingPatches and
>> > Documentation/SubmitChecklist.
>> > 
>> >> This will cause the credit_timerout.expires is set to dozens of days
>> >> in future.
>> >>
>> >>  The netback will stop receiving data from netfront. 
>> >> 
>> >> For example: 
>> >> Jiffies initialized to 0xffffff-(300*HZ), and the
>> >> credit_timeout.expires was initialized to 0xffffff00, 
>> >> After dozens of days,  when the jiffies grow to upper than 0x80000000,
>> >> and the time_after_eq() will cannot check for the wrapping.
>> >> 
>> >> 
>> >> 
>> >> --- drivers/xen/netback/netback.c.org	2012-11-30 15:48:13.109039998 -0500
>> >> +++ drivers/xen/netback/netback.c	2012-11-30 15:48:55.212072898 -0500
>> >> @@ -1272,6 +1272,10 @@ static void net_tx_action(unsigned long
>> >>  		rmb(); /* Ensure that we see the request before we copy it. */
>> >>  		memcpy(&txreq, RING_GET_REQUEST(&netif->tx, i), sizeof(txreq));
>> >>  
>> >> +        /* Check for the jiffies wrapping */
>> >> +        if (time_after_eq(jiffies, netif->credit_timeout.expires))
>> >> +            netif->credit_timeout.expires = jiffies;
>> > 
>> > Do you not need to remove the similar check from the following block?
>> 
>> I don't think so, but I also can't see how that adjustment would
>> help in the first place: If it gets executed after a very long period
>> of no traffic, it would itself not be able to reliably tell whether the
>> clock wrapped.
> 
> Hrm, yes, This change would help in the case of a dribble of traffic
> which never hits the limit, but not in the case of no timer at all.
> 
>> That said, I agree that the code as is appears to have a problem
>> (with 32-bit jiffies at least), but I can't see how to easily deal with
>> it.
> 
> Would it help to always have the pending timer armed, for either the
> next tick if credit needs replenishing or for, say MAX_JIFFIES/4 as a
> backstop to avoid wrapping issues?

If that can be made work cleanly, that would probably be the
easiest solution. But I don't see MAX_JIFFIES being defined
anywhere, and I'm unsure ULONG_MAX/4 would be well received
as a timeout on 64-bit systems.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:01:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:01:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNPb-00079T-3K; Fri, 30 Nov 2012 10:01:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeNPZ-00079I-Rk
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:01:34 +0000
Received: from [85.158.143.35:11949] by server-1.bemta-4.messagelabs.com id
	ED/CA-27934-DF388B05; Fri, 30 Nov 2012 10:01:33 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1354269687!13095554!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28296 invoked from network); 30 Nov 2012 10:01:29 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 10:01:29 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 10:01:27 +0000
Message-Id: <50B8923E02000078000ACCBC@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 10:02:22 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <961EE662BA396D43898AFA993C8F01B775066487@SBJEXCH1A.websense.com>
	<1354264550.6039.37.camel@dagon.hellion.org.uk>
	<50B8898D02000078000ACC41@nat28.tlf.novell.com>
	<1354268649.6269.80.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354268649.6269.80.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Shunli Yi <syi@websense.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [patch] netback: Xennet half die---netback driver
 didn't detect the jiffies wrapping correctly.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 10:44, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Fri, 2012-11-30 at 09:25 +0000, Jan Beulich wrote:
>> >>> On 30.11.12 at 09:35, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> > On Fri, 2012-11-30 at 08:09 +0000, Yi, Shunli wrote:
>> >> Netback driver use " time_after_eq()" to check the jiffies wrapping,
>> >> while this function was only called when the credit is  running out.
>> >> So, if the jiffies wrapped and the credit isn't run out in first half
>> >> jiffies circle, the time_after_eq() cannot check the wrapping any
>> >> more.
>> > 
>> > Which tree is this against? It doesn't appear to be mainline Linux,
>> > which is all I am really interested in these days.
>> > 
>> > Also your patch is missing a Signed-off-by and is whitespace damaged.
>> > Please read Documentation/SubmittingPatches and
>> > Documentation/SubmitChecklist.
>> > 
>> >> This will cause the credit_timerout.expires is set to dozens of days
>> >> in future.
>> >>
>> >>  The netback will stop receiving data from netfront. 
>> >> 
>> >> For example: 
>> >> Jiffies initialized to 0xffffff-(300*HZ), and the
>> >> credit_timeout.expires was initialized to 0xffffff00, 
>> >> After dozens of days,  when the jiffies grow to upper than 0x80000000,
>> >> and the time_after_eq() will cannot check for the wrapping.
>> >> 
>> >> 
>> >> 
>> >> --- drivers/xen/netback/netback.c.org	2012-11-30 15:48:13.109039998 -0500
>> >> +++ drivers/xen/netback/netback.c	2012-11-30 15:48:55.212072898 -0500
>> >> @@ -1272,6 +1272,10 @@ static void net_tx_action(unsigned long
>> >>  		rmb(); /* Ensure that we see the request before we copy it. */
>> >>  		memcpy(&txreq, RING_GET_REQUEST(&netif->tx, i), sizeof(txreq));
>> >>  
>> >> +        /* Check for the jiffies wrapping */
>> >> +        if (time_after_eq(jiffies, netif->credit_timeout.expires))
>> >> +            netif->credit_timeout.expires = jiffies;
>> > 
>> > Do you not need to remove the similar check from the following block?
>> 
>> I don't think so, but I also can't see how that adjustment would
>> help in the first place: If it gets executed after a very long period
>> of no traffic, it would itself not be able to reliably tell whether the
>> clock wrapped.
> 
> Hrm, yes, This change would help in the case of a dribble of traffic
> which never hits the limit, but not in the case of no timer at all.
> 
>> That said, I agree that the code as is appears to have a problem
>> (with 32-bit jiffies at least), but I can't see how to easily deal with
>> it.
> 
> Would it help to always have the pending timer armed, for either the
> next tick if credit needs replenishing or for, say MAX_JIFFIES/4 as a
> backstop to avoid wrapping issues?

If that can be made work cleanly, that would probably be the
easiest solution. But I don't see MAX_JIFFIES being defined
anywhere, and I'm unsure ULONG_MAX/4 would be well received
as a timeout on 64-bit systems.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:03:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:03:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNRK-0007IF-Ja; Fri, 30 Nov 2012 10:03:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeNRI-0007I3-Kl
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:03:20 +0000
Received: from [85.158.143.35:19698] by server-1.bemta-4.messagelabs.com id
	3E/FD-27934-76488B05; Fri, 30 Nov 2012 10:03:19 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1354269799!13117882!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23740 invoked from network); 30 Nov 2012 10:03:19 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 10:03:19 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 10:03:19 +0000
Message-Id: <50B892AF02000078000ACCBF@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 10:04:15 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>,
	"xen.org" <ian.jackson@eu.citrix.com>
References: <osstest-14495-mainreport@xen.org>
	<1354268022.6269.74.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354268022.6269.74.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [xen-4.2-testing test] 14495: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 10:33, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> Maybe we've just regressed in terms of the time taken for the
> migrations? The changelog is 
>     xl: xl.conf(5): correct advice re autoballooning vs. dom0_mem.
>     xl: Suppress spurious warning message for cpupool-list
>     x86/time: fix scale_delta() inline assembly
> 
> None of which seem especially smoking gun shaped. Perhaps just natural
> jitter in the time taken (perhaps we hits Windows' daily "cronjob"
> run?). Possibly best to wait for another attempt.

Iirc this test has been failing now and then in the past.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:03:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:03:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNRK-0007IF-Ja; Fri, 30 Nov 2012 10:03:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeNRI-0007I3-Kl
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:03:20 +0000
Received: from [85.158.143.35:19698] by server-1.bemta-4.messagelabs.com id
	3E/FD-27934-76488B05; Fri, 30 Nov 2012 10:03:19 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1354269799!13117882!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23740 invoked from network); 30 Nov 2012 10:03:19 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 10:03:19 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 10:03:19 +0000
Message-Id: <50B892AF02000078000ACCBF@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 10:04:15 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>,
	"xen.org" <ian.jackson@eu.citrix.com>
References: <osstest-14495-mainreport@xen.org>
	<1354268022.6269.74.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354268022.6269.74.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [xen-4.2-testing test] 14495: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 10:33, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> Maybe we've just regressed in terms of the time taken for the
> migrations? The changelog is 
>     xl: xl.conf(5): correct advice re autoballooning vs. dom0_mem.
>     xl: Suppress spurious warning message for cpupool-list
>     x86/time: fix scale_delta() inline assembly
> 
> None of which seem especially smoking gun shaped. Perhaps just natural
> jitter in the time taken (perhaps we hits Windows' daily "cronjob"
> run?). Possibly best to wait for another attempt.

Iirc this test has been failing now and then in the past.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:06:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:06:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNTm-0007bc-75; Fri, 30 Nov 2012 10:05:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1TeNTk-0007b6-6c; Fri, 30 Nov 2012 10:05:52 +0000
Received: from [85.158.138.51:37554] by server-16.bemta-3.messagelabs.com id
	25/2B-07461-FF488B05; Fri, 30 Nov 2012 10:05:51 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1354269938!24216240!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 555 invoked from network); 30 Nov 2012 10:05:39 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 10:05:39 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16086638"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 10:04:09 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Fri, 30 Nov 2012
	10:04:09 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, Anil Madhavapeddy <anil@recoil.org>
Date: Fri, 30 Nov 2012 10:04:09 +0000
Thread-Topic: [Xen-API] [Xen-devel] [PATCH 10 of 15] libxc/ocaml: Add simple
	binding for xentoollog (output only)
Thread-Index: Ac3O4CpPbm02/4/USBaFwmW9521s1QAAPaMw
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107B3@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<2b433b1523e4295bb1ed.1353432210@cosworth.uk.xensource.com>
	<7EA643C653F17F4C80DE959E978F10EDFA101107B2@LONPMAILBOX01.citrite.net>
	<1354212199.6269.67.camel@zakaz.uk.xensource.com>
	<5DC583C2-ED2D-4305-9AC5-74F8F57F300D@recoil.org>
	<1354269042.6269.85.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354269042.6269.85.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	David Scott <scott.dj@gmail.com>,
	"xen-api@lists.xen.org" <xen-api@lists.xen.org>
Subject: Re: [Xen-devel] [Xen-API] [PATCH 10 of 15] libxc/ocaml: Add simple
 binding for xentoollog (output only)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> > > Another idea might be to make the bindings use the async interfaces
> > > wherever possible by default, by definition anything potentially
> > > blocking has supports this and that would avoid the need for
> > > enter/leave, but at the expense of making the ocaml callers ugly
> > > perhaps? Or maybe this sort of thing ends up looking very natural in
> > > ocaml? Depends on your application's event mechanism I suspect.
> > >
> > > Last half witted idea: everything could be async but the bindings
> > > include the loop to wait for the async event, i.e. effectively
> > > making the call sync again. This sounds silly but it might allow
> > > better control over the placement of enter/leave vs callbacks, since
> > > you would just drop it over libxl_event_wait?
> >
> > Making everything explicitly async and non-blocking is by far the
> > preferred solution in terms of stability, as it largely removes the
> > need to worry about the GC interface and thread interactions.
> >
> > There are several libraries to wrap async interfaces in convenient
> > synchronous programming, most notably Lwt (http://ocsigen.org/lwt).
> 
> I'll have to take your word for that ;-)
> 
> > With this interface, all the OCaml callbacks are implemented in OCaml,
> > and it just needs a select/epoll or equivalent to wake up sleeping
> > threads when an IO event occurs.
> 
> On the libxl side you'd want to be using the ao_how thing described in
> libxl.h[0] and probably the event loop stuff in libxl_event.h[1]. My gut
> feeling is that you'd want to go the libxl_osevent_register_hooks route to
> integrate libxl into lwt's event loop rather than the
> libxl_osevent_{before,after}poll option.
> 
> [0] http://xenbits.xen.org/hg/xen-
> unstable.hg/file/1c69c938f641/tools/libxl/libxl.h#l377
> [1] http://xenbits.xen.org/hg/xen-
> unstable.hg/file/1c69c938f641/tools/libxl/libxl_event.h

Great, I completely forgot about the possibility of doing async calls to libxl. This sounds like an ideal solution, especially if we can avoid messing with the GC system this way (those segfaults are really hard to debug). It may be a nice excuse to get started with Lwt as well ;)

I'll do some investigation on how to integrate this.

Cheers,
Rob

> 
> Ian.
> 
> >
> > Dave has already done some bindings to Lwt, so I've CCed him...
> >
> > -anil
> >
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:06:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:06:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNTm-0007bc-75; Fri, 30 Nov 2012 10:05:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1TeNTk-0007b6-6c; Fri, 30 Nov 2012 10:05:52 +0000
Received: from [85.158.138.51:37554] by server-16.bemta-3.messagelabs.com id
	25/2B-07461-FF488B05; Fri, 30 Nov 2012 10:05:51 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1354269938!24216240!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 555 invoked from network); 30 Nov 2012 10:05:39 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 10:05:39 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16086638"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 10:04:09 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Fri, 30 Nov 2012
	10:04:09 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, Anil Madhavapeddy <anil@recoil.org>
Date: Fri, 30 Nov 2012 10:04:09 +0000
Thread-Topic: [Xen-API] [Xen-devel] [PATCH 10 of 15] libxc/ocaml: Add simple
	binding for xentoollog (output only)
Thread-Index: Ac3O4CpPbm02/4/USBaFwmW9521s1QAAPaMw
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107B3@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<2b433b1523e4295bb1ed.1353432210@cosworth.uk.xensource.com>
	<7EA643C653F17F4C80DE959E978F10EDFA101107B2@LONPMAILBOX01.citrite.net>
	<1354212199.6269.67.camel@zakaz.uk.xensource.com>
	<5DC583C2-ED2D-4305-9AC5-74F8F57F300D@recoil.org>
	<1354269042.6269.85.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354269042.6269.85.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	David Scott <scott.dj@gmail.com>,
	"xen-api@lists.xen.org" <xen-api@lists.xen.org>
Subject: Re: [Xen-devel] [Xen-API] [PATCH 10 of 15] libxc/ocaml: Add simple
 binding for xentoollog (output only)
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> > > Another idea might be to make the bindings use the async interfaces
> > > wherever possible by default, by definition anything potentially
> > > blocking has supports this and that would avoid the need for
> > > enter/leave, but at the expense of making the ocaml callers ugly
> > > perhaps? Or maybe this sort of thing ends up looking very natural in
> > > ocaml? Depends on your application's event mechanism I suspect.
> > >
> > > Last half witted idea: everything could be async but the bindings
> > > include the loop to wait for the async event, i.e. effectively
> > > making the call sync again. This sounds silly but it might allow
> > > better control over the placement of enter/leave vs callbacks, since
> > > you would just drop it over libxl_event_wait?
> >
> > Making everything explicitly async and non-blocking is by far the
> > preferred solution in terms of stability, as it largely removes the
> > need to worry about the GC interface and thread interactions.
> >
> > There are several libraries to wrap async interfaces in convenient
> > synchronous programming, most notably Lwt (http://ocsigen.org/lwt).
> 
> I'll have to take your word for that ;-)
> 
> > With this interface, all the OCaml callbacks are implemented in OCaml,
> > and it just needs a select/epoll or equivalent to wake up sleeping
> > threads when an IO event occurs.
> 
> On the libxl side you'd want to be using the ao_how thing described in
> libxl.h[0] and probably the event loop stuff in libxl_event.h[1]. My gut
> feeling is that you'd want to go the libxl_osevent_register_hooks route to
> integrate libxl into lwt's event loop rather than the
> libxl_osevent_{before,after}poll option.
> 
> [0] http://xenbits.xen.org/hg/xen-
> unstable.hg/file/1c69c938f641/tools/libxl/libxl.h#l377
> [1] http://xenbits.xen.org/hg/xen-
> unstable.hg/file/1c69c938f641/tools/libxl/libxl_event.h

Great, I completely forgot about the possibility of doing async calls to libxl. This sounds like an ideal solution, especially if we can avoid messing with the GC system this way (those segfaults are really hard to debug). It may be a nice excuse to get started with Lwt as well ;)

I'll do some investigation on how to integrate this.

Cheers,
Rob

> 
> Ian.
> 
> >
> > Dave has already done some bindings to Lwt, so I've CCed him...
> >
> > -anil
> >
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:10:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:10:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNYY-0008JS-PL; Fri, 30 Nov 2012 10:10:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Manuel.Bouyer@lip6.fr>) id 1TeNYW-0008Ig-Pn
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:10:49 +0000
Received: from [85.158.139.211:31624] by server-11.bemta-5.messagelabs.com id
	E8/ED-03409-72688B05; Fri, 30 Nov 2012 10:10:47 +0000
X-Env-Sender: Manuel.Bouyer@lip6.fr
X-Msg-Ref: server-3.tower-206.messagelabs.com!1354270244!18512362!1
X-Originating-IP: [132.227.60.2]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15830 invoked from network); 30 Nov 2012 10:10:45 -0000
Received: from isis.lip6.fr (HELO isis.lip6.fr) (132.227.60.2)
	by server-3.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 10:10:45 -0000
Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2])
	by isis.lip6.fr (8.14.5/lip6) with ESMTP id qAUAAgel006939
	; Fri, 30 Nov 2012 11:10:42 +0100 (CET)
X-pt: isis.lip6.fr
Received: from armandeche.soc.lip6.fr (armandeche [132.227.63.133])
	by asim.lip6.fr (8.14.5/8.14.4) with ESMTP id qAUAAfpU011424;
	Fri, 30 Nov 2012 11:10:41 +0100 (MET)
Received: by armandeche.soc.lip6.fr (Postfix, from userid 20331)
	id DE8E834B3E; Fri, 30 Nov 2012 11:10:41 +0100 (MET)
Date: Fri, 30 Nov 2012 11:10:41 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Message-ID: <20121130101041.GA4978@asim.lip6.fr>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr> <50B8718C.1090405@citrix.com>
	<20121130085241.GC311@asim.lip6.fr> <50B87A7E.5030001@citrix.com>
	<20121130094143.GA10993@asim.lip6.fr> <50B88325.1050009@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B88325.1050009@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7
	(isis.lip6.fr [132.227.60.2]);
	Fri, 30 Nov 2012 11:10:42 +0100 (CET)
X-Scanned-By: MIMEDefang 2.73 on 132.227.60.2
Cc: "port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 10:57:57AM +0100, Roger Pau Monn=E9 wrote:
> There are also other tools that build on top of libxl, like libvirt, are
> we going to modify those high level tools to add a new option to the
> config file if the disk of a DomU is in NFS and the Dom0 is NetBSD? I

No if. the admin should be able to choose what backend to use, regardless
of the storage used, and probably of the dom0 OS (you have several backend
available in linux as well, isn't it) ?

> don't think we should take that road, I think libxl should take care of
> all those quicks, and provide an uniform layer that can be trusted
> independently of the environment, so the same configuration file can be
> used in all supported Dom0 OSes.

Ho, that won't work anyway. The options to setup the network are different,
for example.

> =

> Not fixing this in libxl just moves the problem a layer upper, where
> there's a lot more of options, and of course a lot more of work to track
> and fix them all.

Then, as a compromise, could the default be specified in xend-config.sxp
and be overridable in the domU's config file ?
this way, the admin can set a sane defaut for his setup, and eventually
decide what to use on a per-domU basis.

-- =

Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:10:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:10:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNYY-0008JS-PL; Fri, 30 Nov 2012 10:10:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Manuel.Bouyer@lip6.fr>) id 1TeNYW-0008Ig-Pn
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:10:49 +0000
Received: from [85.158.139.211:31624] by server-11.bemta-5.messagelabs.com id
	E8/ED-03409-72688B05; Fri, 30 Nov 2012 10:10:47 +0000
X-Env-Sender: Manuel.Bouyer@lip6.fr
X-Msg-Ref: server-3.tower-206.messagelabs.com!1354270244!18512362!1
X-Originating-IP: [132.227.60.2]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15830 invoked from network); 30 Nov 2012 10:10:45 -0000
Received: from isis.lip6.fr (HELO isis.lip6.fr) (132.227.60.2)
	by server-3.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 10:10:45 -0000
Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2])
	by isis.lip6.fr (8.14.5/lip6) with ESMTP id qAUAAgel006939
	; Fri, 30 Nov 2012 11:10:42 +0100 (CET)
X-pt: isis.lip6.fr
Received: from armandeche.soc.lip6.fr (armandeche [132.227.63.133])
	by asim.lip6.fr (8.14.5/8.14.4) with ESMTP id qAUAAfpU011424;
	Fri, 30 Nov 2012 11:10:41 +0100 (MET)
Received: by armandeche.soc.lip6.fr (Postfix, from userid 20331)
	id DE8E834B3E; Fri, 30 Nov 2012 11:10:41 +0100 (MET)
Date: Fri, 30 Nov 2012 11:10:41 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Message-ID: <20121130101041.GA4978@asim.lip6.fr>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr> <50B8718C.1090405@citrix.com>
	<20121130085241.GC311@asim.lip6.fr> <50B87A7E.5030001@citrix.com>
	<20121130094143.GA10993@asim.lip6.fr> <50B88325.1050009@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B88325.1050009@citrix.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7
	(isis.lip6.fr [132.227.60.2]);
	Fri, 30 Nov 2012 11:10:42 +0100 (CET)
X-Scanned-By: MIMEDefang 2.73 on 132.227.60.2
Cc: "port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 10:57:57AM +0100, Roger Pau Monn=E9 wrote:
> There are also other tools that build on top of libxl, like libvirt, are
> we going to modify those high level tools to add a new option to the
> config file if the disk of a DomU is in NFS and the Dom0 is NetBSD? I

No if. the admin should be able to choose what backend to use, regardless
of the storage used, and probably of the dom0 OS (you have several backend
available in linux as well, isn't it) ?

> don't think we should take that road, I think libxl should take care of
> all those quicks, and provide an uniform layer that can be trusted
> independently of the environment, so the same configuration file can be
> used in all supported Dom0 OSes.

Ho, that won't work anyway. The options to setup the network are different,
for example.

> =

> Not fixing this in libxl just moves the problem a layer upper, where
> there's a lot more of options, and of course a lot more of work to track
> and fix them all.

Then, as a compromise, could the default be specified in xend-config.sxp
and be overridable in the domU's config file ?
this way, the admin can set a sane defaut for his setup, and eventually
decide what to use on a per-domU basis.

-- =

Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:15:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:15:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNcr-0000Jh-A6; Fri, 30 Nov 2012 10:15:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeNcp-0000JR-NO
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:15:15 +0000
Received: from [85.158.139.83:30195] by server-7.bemta-5.messagelabs.com id
	15/04-23096-23788B05; Fri, 30 Nov 2012 10:15:14 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1354270513!20430844!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22297 invoked from network); 30 Nov 2012 10:15:13 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 10:15:13 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16086919"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 10:15:13 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 10:15:12 +0000
Message-ID: <1354270510.6269.95.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Fri, 30 Nov 2012 10:15:10 +0000
In-Reply-To: <50B8923E02000078000ACCBC@nat28.tlf.novell.com>
References: <961EE662BA396D43898AFA993C8F01B775066487@SBJEXCH1A.websense.com>
	<1354264550.6039.37.camel@dagon.hellion.org.uk>
	<50B8898D02000078000ACC41@nat28.tlf.novell.com>
	<1354268649.6269.80.camel@zakaz.uk.xensource.com>
	<50B8923E02000078000ACCBC@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Shunli Yi <syi@websense.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [patch] netback: Xennet half die---netback driver
 didn't detect the jiffies wrapping correctly.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-30 at 10:02 +0000, Jan Beulich wrote:
> >>> On 30.11.12 at 10:44, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Fri, 2012-11-30 at 09:25 +0000, Jan Beulich wrote:
> >> >>> On 30.11.12 at 09:35, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> >> > On Fri, 2012-11-30 at 08:09 +0000, Yi, Shunli wrote:
> >> >> Netback driver use " time_after_eq()" to check the jiffies wrapping,
> >> >> while this function was only called when the credit is  running out.
> >> >> So, if the jiffies wrapped and the credit isn't run out in first half
> >> >> jiffies circle, the time_after_eq() cannot check the wrapping any
> >> >> more.
> >> > 
> >> > Which tree is this against? It doesn't appear to be mainline Linux,
> >> > which is all I am really interested in these days.
> >> > 
> >> > Also your patch is missing a Signed-off-by and is whitespace damaged.
> >> > Please read Documentation/SubmittingPatches and
> >> > Documentation/SubmitChecklist.
> >> > 
> >> >> This will cause the credit_timerout.expires is set to dozens of days
> >> >> in future.
> >> >>
> >> >>  The netback will stop receiving data from netfront. 
> >> >> 
> >> >> For example: 
> >> >> Jiffies initialized to 0xffffff-(300*HZ), and the
> >> >> credit_timeout.expires was initialized to 0xffffff00, 
> >> >> After dozens of days,  when the jiffies grow to upper than 0x80000000,
> >> >> and the time_after_eq() will cannot check for the wrapping.
> >> >> 
> >> >> 
> >> >> 
> >> >> --- drivers/xen/netback/netback.c.org	2012-11-30 15:48:13.109039998 -0500
> >> >> +++ drivers/xen/netback/netback.c	2012-11-30 15:48:55.212072898 -0500
> >> >> @@ -1272,6 +1272,10 @@ static void net_tx_action(unsigned long
> >> >>  		rmb(); /* Ensure that we see the request before we copy it. */
> >> >>  		memcpy(&txreq, RING_GET_REQUEST(&netif->tx, i), sizeof(txreq));
> >> >>  
> >> >> +        /* Check for the jiffies wrapping */
> >> >> +        if (time_after_eq(jiffies, netif->credit_timeout.expires))
> >> >> +            netif->credit_timeout.expires = jiffies;
> >> > 
> >> > Do you not need to remove the similar check from the following block?
> >> 
> >> I don't think so, but I also can't see how that adjustment would
> >> help in the first place: If it gets executed after a very long period
> >> of no traffic, it would itself not be able to reliably tell whether the
> >> clock wrapped.
> > 
> > Hrm, yes, This change would help in the case of a dribble of traffic
> > which never hits the limit, but not in the case of no timer at all.
> > 
> >> That said, I agree that the code as is appears to have a problem
> >> (with 32-bit jiffies at least), but I can't see how to easily deal with
> >> it.
> > 
> > Would it help to always have the pending timer armed, for either the
> > next tick if credit needs replenishing or for, say MAX_JIFFIES/4 as a
> > backstop to avoid wrapping issues?
> 
> If that can be made work cleanly, that would probably be the
> easiest solution. But I don't see MAX_JIFFIES being defined
> anywhere, and I'm unsure ULONG_MAX/4 would be well received
> as a timeout on 64-bit systems.

I guess several trillion years *is* a tad extreme ;-) (or my maths is
wrong).

We could always choose a more practical backstop, like a day or even a
just few minutes -- we'd expect in general to always be pushing the
timeout ahead rather than hitting it.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:15:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:15:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNcr-0000Jh-A6; Fri, 30 Nov 2012 10:15:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeNcp-0000JR-NO
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:15:15 +0000
Received: from [85.158.139.83:30195] by server-7.bemta-5.messagelabs.com id
	15/04-23096-23788B05; Fri, 30 Nov 2012 10:15:14 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1354270513!20430844!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22297 invoked from network); 30 Nov 2012 10:15:13 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 10:15:13 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16086919"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 10:15:13 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 10:15:12 +0000
Message-ID: <1354270510.6269.95.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Date: Fri, 30 Nov 2012 10:15:10 +0000
In-Reply-To: <50B8923E02000078000ACCBC@nat28.tlf.novell.com>
References: <961EE662BA396D43898AFA993C8F01B775066487@SBJEXCH1A.websense.com>
	<1354264550.6039.37.camel@dagon.hellion.org.uk>
	<50B8898D02000078000ACC41@nat28.tlf.novell.com>
	<1354268649.6269.80.camel@zakaz.uk.xensource.com>
	<50B8923E02000078000ACCBC@nat28.tlf.novell.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Shunli Yi <syi@websense.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [patch] netback: Xennet half die---netback driver
 didn't detect the jiffies wrapping correctly.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-30 at 10:02 +0000, Jan Beulich wrote:
> >>> On 30.11.12 at 10:44, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Fri, 2012-11-30 at 09:25 +0000, Jan Beulich wrote:
> >> >>> On 30.11.12 at 09:35, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> >> > On Fri, 2012-11-30 at 08:09 +0000, Yi, Shunli wrote:
> >> >> Netback driver use " time_after_eq()" to check the jiffies wrapping,
> >> >> while this function was only called when the credit is  running out.
> >> >> So, if the jiffies wrapped and the credit isn't run out in first half
> >> >> jiffies circle, the time_after_eq() cannot check the wrapping any
> >> >> more.
> >> > 
> >> > Which tree is this against? It doesn't appear to be mainline Linux,
> >> > which is all I am really interested in these days.
> >> > 
> >> > Also your patch is missing a Signed-off-by and is whitespace damaged.
> >> > Please read Documentation/SubmittingPatches and
> >> > Documentation/SubmitChecklist.
> >> > 
> >> >> This will cause the credit_timerout.expires is set to dozens of days
> >> >> in future.
> >> >>
> >> >>  The netback will stop receiving data from netfront. 
> >> >> 
> >> >> For example: 
> >> >> Jiffies initialized to 0xffffff-(300*HZ), and the
> >> >> credit_timeout.expires was initialized to 0xffffff00, 
> >> >> After dozens of days,  when the jiffies grow to upper than 0x80000000,
> >> >> and the time_after_eq() will cannot check for the wrapping.
> >> >> 
> >> >> 
> >> >> 
> >> >> --- drivers/xen/netback/netback.c.org	2012-11-30 15:48:13.109039998 -0500
> >> >> +++ drivers/xen/netback/netback.c	2012-11-30 15:48:55.212072898 -0500
> >> >> @@ -1272,6 +1272,10 @@ static void net_tx_action(unsigned long
> >> >>  		rmb(); /* Ensure that we see the request before we copy it. */
> >> >>  		memcpy(&txreq, RING_GET_REQUEST(&netif->tx, i), sizeof(txreq));
> >> >>  
> >> >> +        /* Check for the jiffies wrapping */
> >> >> +        if (time_after_eq(jiffies, netif->credit_timeout.expires))
> >> >> +            netif->credit_timeout.expires = jiffies;
> >> > 
> >> > Do you not need to remove the similar check from the following block?
> >> 
> >> I don't think so, but I also can't see how that adjustment would
> >> help in the first place: If it gets executed after a very long period
> >> of no traffic, it would itself not be able to reliably tell whether the
> >> clock wrapped.
> > 
> > Hrm, yes, This change would help in the case of a dribble of traffic
> > which never hits the limit, but not in the case of no timer at all.
> > 
> >> That said, I agree that the code as is appears to have a problem
> >> (with 32-bit jiffies at least), but I can't see how to easily deal with
> >> it.
> > 
> > Would it help to always have the pending timer armed, for either the
> > next tick if credit needs replenishing or for, say MAX_JIFFIES/4 as a
> > backstop to avoid wrapping issues?
> 
> If that can be made work cleanly, that would probably be the
> easiest solution. But I don't see MAX_JIFFIES being defined
> anywhere, and I'm unsure ULONG_MAX/4 would be well received
> as a timeout on 64-bit systems.

I guess several trillion years *is* a tad extreme ;-) (or my maths is
wrong).

We could always choose a more practical backstop, like a day or even a
just few minutes -- we'd expect in general to always be pushing the
timeout ahead rather than hitting it.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:26:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:26:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNnw-00018L-TX; Fri, 30 Nov 2012 10:26:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeNnv-00018F-7g
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:26:43 +0000
Received: from [85.158.143.35:60333] by server-2.bemta-4.messagelabs.com id
	37/76-28922-2E988B05; Fri, 30 Nov 2012 10:26:42 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1354271183!15728202!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12984 invoked from network); 30 Nov 2012 10:26:24 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 10:26:24 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 10:26:25 +0000
Message-Id: <50B8981802000078000ACCFE@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 10:27:20 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "George Dunlap" <dunlapg@umich.edu>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B63CCC02000078000AC34E@nat28.tlf.novell.com>
In-Reply-To: <50B63CCC02000078000AC34E@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 28.11.12 at 16:33, "Jan Beulich" <JBeulich@suse.com> wrote:
>>>> On 26.11.12 at 18:57, George Dunlap <dunlapg@umich.edu> wrote:
>> So while doing a bit of investigation into a request that we have
>> instructions for how to sign a Xen binary, I came across a related pair of
>> questions.  If we boot from a signed Xen binary, then:
>> 1. Will Xen then successfully boot a signed dom0 kernel / initrd?
>> 2. Will Xen fail to boot an unsigned dom0 kernel / initrd?
>> 
>> I think if Xen is signed, then ideally we want both 1 and 2 to be true,
>> right?
> 
> Not necessarily: With the shim approach that most people now
> seem to agree to, it would depend on whether xen.efi actually
> got loaded directly or through the shim. When loaded through
> the shim, both ought to be true. If loaded without the shim,
> whether Xen is signed doesn't matter, and hence whether the
> Dom0 kernel image is signed shouldn't matter either.
> 
> The grub2 code I just looked at doesn't verify the initrd btw,
> that's apparently left to the kernel.
> 
>> Does UEFI provide a way to check the signature of files? Does
>> it happen automatically, or would we need to add extra support?
>> Or would we need to embed a public key within the Xen binary
>> and have Xen check the signatures of files that it reads?
> 
> No, that's what the shim is actually for - it publishes a suitable,
> trivial protocol.
> 
> Adding the verification step has turned out to require 19 added
> lines, so pretty trivial. I didn't look into what additional data Dom0
> may need access to, yet.

So I learned a little more meanwhile - it's not that trivial: I'm told
the shim uses UEFI services to do the verification, and those
services only handle PE images. But we obviously can't reasonably
expect the Dom0 kernel to be packaged as PE image, as that
would then be unusable as DomU kernel (on older hosts at least,
i.e. even if we added a PE loader to libxc).

I'm therefore considering to create a PE image from the kernel
binary [if compressed, even without uncompressing] on the fly
(in memory), and present that to the verification routine. Which
requires a way to locate the signature within that binary kernel
blob, which would need to be placed there without disturbing the
decompression of the image - not sure if that's possible at all.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:26:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:26:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNnw-00018L-TX; Fri, 30 Nov 2012 10:26:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeNnv-00018F-7g
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:26:43 +0000
Received: from [85.158.143.35:60333] by server-2.bemta-4.messagelabs.com id
	37/76-28922-2E988B05; Fri, 30 Nov 2012 10:26:42 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1354271183!15728202!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12984 invoked from network); 30 Nov 2012 10:26:24 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 10:26:24 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 10:26:25 +0000
Message-Id: <50B8981802000078000ACCFE@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 10:27:20 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "George Dunlap" <dunlapg@umich.edu>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B63CCC02000078000AC34E@nat28.tlf.novell.com>
In-Reply-To: <50B63CCC02000078000AC34E@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 28.11.12 at 16:33, "Jan Beulich" <JBeulich@suse.com> wrote:
>>>> On 26.11.12 at 18:57, George Dunlap <dunlapg@umich.edu> wrote:
>> So while doing a bit of investigation into a request that we have
>> instructions for how to sign a Xen binary, I came across a related pair of
>> questions.  If we boot from a signed Xen binary, then:
>> 1. Will Xen then successfully boot a signed dom0 kernel / initrd?
>> 2. Will Xen fail to boot an unsigned dom0 kernel / initrd?
>> 
>> I think if Xen is signed, then ideally we want both 1 and 2 to be true,
>> right?
> 
> Not necessarily: With the shim approach that most people now
> seem to agree to, it would depend on whether xen.efi actually
> got loaded directly or through the shim. When loaded through
> the shim, both ought to be true. If loaded without the shim,
> whether Xen is signed doesn't matter, and hence whether the
> Dom0 kernel image is signed shouldn't matter either.
> 
> The grub2 code I just looked at doesn't verify the initrd btw,
> that's apparently left to the kernel.
> 
>> Does UEFI provide a way to check the signature of files? Does
>> it happen automatically, or would we need to add extra support?
>> Or would we need to embed a public key within the Xen binary
>> and have Xen check the signatures of files that it reads?
> 
> No, that's what the shim is actually for - it publishes a suitable,
> trivial protocol.
> 
> Adding the verification step has turned out to require 19 added
> lines, so pretty trivial. I didn't look into what additional data Dom0
> may need access to, yet.

So I learned a little more meanwhile - it's not that trivial: I'm told
the shim uses UEFI services to do the verification, and those
services only handle PE images. But we obviously can't reasonably
expect the Dom0 kernel to be packaged as PE image, as that
would then be unusable as DomU kernel (on older hosts at least,
i.e. even if we added a PE loader to libxc).

I'm therefore considering to create a PE image from the kernel
binary [if compressed, even without uncompressing] on the fly
(in memory), and present that to the verification routine. Which
requires a way to locate the signature within that binary kernel
blob, which would need to be placed there without disturbing the
decompression of the image - not sure if that's possible at all.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:32:49 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:32:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNte-0001VC-NP; Fri, 30 Nov 2012 10:32:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeNtc-0001V3-VW
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:32:37 +0000
Received: from [85.158.139.211:6316] by server-12.bemta-5.messagelabs.com id
	34/83-02886-44B88B05; Fri, 30 Nov 2012 10:32:36 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1354271554!16597495!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3644 invoked from network); 30 Nov 2012 10:32:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 10:32:35 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16087627"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 10:32:34 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 10:32:34 +0000
Message-ID: <1354271552.6269.110.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau =?ISO-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Date: Fri, 30 Nov 2012 10:32:32 +0000
In-Reply-To: <50B88325.1050009@citrix.com>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr> <50B8718C.1090405@citrix.com>
	<20121130085241.GC311@asim.lip6.fr> <50B87A7E.5030001@citrix.com>
	<20121130094143.GA10993@asim.lip6.fr> <50B88325.1050009@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Manuel Bouyer <bouyer@antioche.eu.org>,
	"port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gRnJpLCAyMDEyLTExLTMwIGF0IDA5OjU3ICswMDAwLCBSb2dlciBQYXUgTW9ubsOpIHdyb3Rl
Ogo+IE9uIDMwLzExLzEyIDEwOjQxLCBNYW51ZWwgQm91eWVyIHdyb3RlOgo+ID4gT24gRnJpLCBO
b3YgMzAsIDIwMTIgYXQgMTA6MjE6MDJBTSArMDEwMCwgUm9nZXIgUGF1IE1vbm7DqSB3cm90ZToK
PiA+Pj4gQW5kIEkgZG9uJ3QgbGlrZSB0aGUgaWRlYSBvZiBzb2Z0d2FyZSBkb2luZyB0aGluZ3Mg
aW4gbXkgYmFjay4KPiA+Pj4gQW5kLCBiZXNpZGUgdGhpcywgSSBkb24ndCB0aGluayBsb2NhbCB2
cyByZW1vdGUgaXMgdGhlIHJpZ2h0IGNyaXRlcmlhLgo+ID4+PiBUaGVyZSBhcmUgcmVtb3RlIGZp
bGVzeXN0ZW1zIHdoaWNoIG1heSBwbGF5IG5pY2Ugd2l0aCB2bmQuIFRoZXJlCj4gPj4+IGFyZSBs
b2NhbCBmaWxlc3lzdGVtcyB0aGF0IG1heSBub3QgcGxheSBuaWNlIHdpdGggdm5kLgo+ID4+Cj4g
Pj4gSSB3b3VsZCBhZ3JlZSB3aXRoIHlvdSBpZiB0aGlzIHdhcyBhIERv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ounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:32:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNte-0001VC-NP; Fri, 30 Nov 2012 10:32:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeNtc-0001V3-VW
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:32:37 +0000
Received: from [85.158.139.211:6316] by server-12.bemta-5.messagelabs.com id
	34/83-02886-44B88B05; Fri, 30 Nov 2012 10:32:36 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1354271554!16597495!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3644 invoked from network); 30 Nov 2012 10:32:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 10:32:35 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16087627"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 10:32:34 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 10:32:34 +0000
Message-ID: <1354271552.6269.110.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roger Pau =?ISO-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Date: Fri, 30 Nov 2012 10:32:32 +0000
In-Reply-To: <50B88325.1050009@citrix.com>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr> <50B8718C.1090405@citrix.com>
	<20121130085241.GC311@asim.lip6.fr> <50B87A7E.5030001@citrix.com>
	<20121130094143.GA10993@asim.lip6.fr> <50B88325.1050009@citrix.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Manuel Bouyer <bouyer@antioche.eu.org>,
	"port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gRnJpLCAyMDEyLTExLTMwIGF0IDA5OjU3ICswMDAwLCBSb2dlciBQYXUgTW9ubsOpIHdyb3Rl
Ogo+IE9uIDMwLzExLzEyIDEwOjQxLCBNYW51ZWwgQm91eWVyIHdyb3RlOgo+ID4gT24gRnJpLCBO
b3YgMzAsIDIwMTIgYXQgMTA6MjE6MDJBTSArMDEwMCwgUm9nZXIgUGF1I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maWVzCk1hbnVlbCdzICJ0aGVyZSBzaG91
bGQgYmUgYSB3YXkgZm9yIHRoZSBhZG1pbi4uLiIgcmVxdWlyZW1lbnQuCgpJIGFncmVlIHRoYXQg
aXQgZG9lc24ndCBzZWVtIHJpZ2h0IHRvIGV4cGVjdCB1cHBlciBsYXllcnMgdG8KYXV0b21hdGlj
YWxseSBzZXQgdGhpcyBtYW51YWwgb3ZlcnJpZGUsIElZU1dJTSwgdGhvdWdoLgoKSWFuLgoKCl9f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBt
YWlsaW5nIGxpc3QKWGVuLWRldmVsQGxpc3RzLnhlbi5vcmcKaHR0cDovL2xpc3RzLnhlbi5vcmcv
eGVuLWRldmVsCg==

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:38:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:38:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNzJ-0001e7-I9; Fri, 30 Nov 2012 10:38:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Manuel.Bouyer@lip6.fr>) id 1TeNzH-0001e2-Hv
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:38:27 +0000
Received: from [193.109.254.147:62814] by server-1.bemta-14.messagelabs.com id
	0E/BA-25314-2AC88B05; Fri, 30 Nov 2012 10:38:26 +0000
X-Env-Sender: Manuel.Bouyer@lip6.fr
X-Msg-Ref: server-3.tower-27.messagelabs.com!1354271905!8970157!1
X-Originating-IP: [132.227.60.2]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11180 invoked from network); 30 Nov 2012 10:38:25 -0000
Received: from isis.lip6.fr (HELO isis.lip6.fr) (132.227.60.2)
	by server-3.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 10:38:25 -0000
Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2])
	by isis.lip6.fr (8.14.5/lip6) with ESMTP id qAUAcNJq017897
	; Fri, 30 Nov 2012 11:38:23 +0100 (CET)
X-pt: isis.lip6.fr
Received: from armandeche.soc.lip6.fr (armandeche [132.227.63.133])
	by asim.lip6.fr (8.14.5/8.14.4) with ESMTP id qAUAcNUr024267;
	Fri, 30 Nov 2012 11:38:23 +0100 (MET)
Received: by armandeche.soc.lip6.fr (Postfix, from userid 20331)
	id 6A14734B3E; Fri, 30 Nov 2012 11:38:23 +0100 (MET)
Date: Fri, 30 Nov 2012 11:38:23 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121130103823.GA9562@asim.lip6.fr>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr> <50B8718C.1090405@citrix.com>
	<20121130085241.GC311@asim.lip6.fr> <50B87A7E.5030001@citrix.com>
	<20121130094143.GA10993@asim.lip6.fr> <50B88325.1050009@citrix.com>
	<1354271552.6269.110.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354271552.6269.110.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7
	(isis.lip6.fr [132.227.60.2]);
	Fri, 30 Nov 2012 11:38:23 +0100 (CET)
X-Scanned-By: MIMEDefang 2.73 on 132.227.60.2
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 10:32:32AM +0000, Ian Campbell wrote:
> libxl only selects the backend itself if the caller doesn't provide one.
> If the caller sets the backend field !=  UNKNOWN then libxl will (try)
> and use it. This field is exposed by xl via the backendtype= key in the
> disk configuration
> http://xenbits.xen.org/docs/unstable/misc/xl-disk-configuration.txt

thanks for pointing this out.
I guess qdisk is the qemu backend, and tap would be the in-kernel backend ?

Is there a way to specify in a config file which default xl should use ?

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:38:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:38:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeNzJ-0001e7-I9; Fri, 30 Nov 2012 10:38:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Manuel.Bouyer@lip6.fr>) id 1TeNzH-0001e2-Hv
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:38:27 +0000
Received: from [193.109.254.147:62814] by server-1.bemta-14.messagelabs.com id
	0E/BA-25314-2AC88B05; Fri, 30 Nov 2012 10:38:26 +0000
X-Env-Sender: Manuel.Bouyer@lip6.fr
X-Msg-Ref: server-3.tower-27.messagelabs.com!1354271905!8970157!1
X-Originating-IP: [132.227.60.2]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11180 invoked from network); 30 Nov 2012 10:38:25 -0000
Received: from isis.lip6.fr (HELO isis.lip6.fr) (132.227.60.2)
	by server-3.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 10:38:25 -0000
Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2])
	by isis.lip6.fr (8.14.5/lip6) with ESMTP id qAUAcNJq017897
	; Fri, 30 Nov 2012 11:38:23 +0100 (CET)
X-pt: isis.lip6.fr
Received: from armandeche.soc.lip6.fr (armandeche [132.227.63.133])
	by asim.lip6.fr (8.14.5/8.14.4) with ESMTP id qAUAcNUr024267;
	Fri, 30 Nov 2012 11:38:23 +0100 (MET)
Received: by armandeche.soc.lip6.fr (Postfix, from userid 20331)
	id 6A14734B3E; Fri, 30 Nov 2012 11:38:23 +0100 (MET)
Date: Fri, 30 Nov 2012 11:38:23 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121130103823.GA9562@asim.lip6.fr>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr> <50B8718C.1090405@citrix.com>
	<20121130085241.GC311@asim.lip6.fr> <50B87A7E.5030001@citrix.com>
	<20121130094143.GA10993@asim.lip6.fr> <50B88325.1050009@citrix.com>
	<1354271552.6269.110.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354271552.6269.110.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7
	(isis.lip6.fr [132.227.60.2]);
	Fri, 30 Nov 2012 11:38:23 +0100 (CET)
X-Scanned-By: MIMEDefang 2.73 on 132.227.60.2
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 10:32:32AM +0000, Ian Campbell wrote:
> libxl only selects the backend itself if the caller doesn't provide one.
> If the caller sets the backend field !=  UNKNOWN then libxl will (try)
> and use it. This field is exposed by xl via the backendtype= key in the
> disk configuration
> http://xenbits.xen.org/docs/unstable/misc/xl-disk-configuration.txt

thanks for pointing this out.
I guess qdisk is the qemu backend, and tap would be the in-kernel backend ?

Is there a way to specify in a config file which default xl should use ?

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:43:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:43:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeO3e-0001p5-8p; Fri, 30 Nov 2012 10:42:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TeO3d-0001oz-1g
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:42:57 +0000
Received: from [85.158.139.83:5176] by server-13.bemta-5.messagelabs.com id
	0E/E2-27809-0BD88B05; Fri, 30 Nov 2012 10:42:56 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1354272169!20553927!1
X-Originating-IP: [209.85.220.177]
X-SpamReason: No, hits=0.9 required=7.0 tests=HTML_40_50,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27007 invoked from network); 30 Nov 2012 10:42:50 -0000
Received: from mail-vc0-f177.google.com (HELO mail-vc0-f177.google.com)
	(209.85.220.177)
	by server-11.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 10:42:50 -0000
Received: by mail-vc0-f177.google.com with SMTP id m8so308505vcd.36
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 02:42:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=HY/tl8ZvdfJVBomwLwvMdv0CwpZhE9U5zY2q1KWX0bU=;
	b=xIkvcNoV15bOrggZBA2hgDfzrMC1EQf1ikNg+RaCvHgB/2R6VJWqmkLj2u6rENPmqi
	Bou4n68WbOaz7PDsRYEYBXoxtOkjknhTZrrJBQ0/fXruLegVB7kpYO/NNrmNQaTH4rID
	rVwRDDYCrN5wePMHznd81S1hw10wPEkyYMoGa1NLplWtgTrUAUU53uz2emPrTr2nnsIM
	NJgdhLbHMODdgmiz3I4aCe76IaEL2Vz2UdKeaGVAbEe9TScXQxSgIImZjFa/QJ1NqCnj
	hNUkK8hUscwazFnxY1ZW7JWjSxZlwpN7ddGOlM+qFVvK7FDbp8+PMPmz95SimpiKqAuy
	j31w==
MIME-Version: 1.0
Received: by 10.52.156.40 with SMTP id wb8mr581809vdb.39.1354272169439; Fri,
	30 Nov 2012 02:42:49 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Fri, 30 Nov 2012 02:42:49 -0800 (PST)
In-Reply-To: <50B8981802000078000ACCFE@nat28.tlf.novell.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B63CCC02000078000AC34E@nat28.tlf.novell.com>
	<50B8981802000078000ACCFE@nat28.tlf.novell.com>
Date: Fri, 30 Nov 2012 10:42:49 +0000
X-Google-Sender-Auth: 83tE9YlTYgcgVJx7WF7LfTrv8Go
Message-ID: <CAFLBxZb7sbeEa8SnikOafzMhsyqnJW52J03dLr2PiUs0TM=-yw@mail.gmail.com>
From: George Dunlap <dunlapg@umich.edu>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7096605885863878601=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============7096605885863878601==
Content-Type: multipart/alternative; boundary=bcaec53aedb496b40404cfb40fd7

--bcaec53aedb496b40404cfb40fd7
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich <JBeulich@suse.com> wrote:

> So I learned a little more meanwhile - it's not that trivial: I'm told
> the shim uses UEFI services to do the verification, and those
> services only handle PE images. But we obviously can't reasonably
> expect the Dom0 kernel to be packaged as PE image, as that
> would then be unusable as DomU kernel (on older hosts at least,
> i.e. even if we added a PE loader to libxc).
>

Sorry for the n00b question, but what's a PE image in this context?

 -George

--bcaec53aedb496b40404cfb40fd7
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich <span dir=3D"ltr">&lt;<a href=
=3D"mailto:JBeulich@suse.com" target=3D"_blank">JBeulich@suse.com</a>&gt;</=
span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_quote"><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #cc=
c solid;padding-left:1ex">
<div class=3D"HOEnZb"><div class=3D"h5">So I learned a little more meanwhil=
e - it&#39;s not that trivial: I&#39;m told<br></div></div>
the shim uses UEFI services to do the verification, and those<br>
services only handle PE images. But we obviously can&#39;t reasonably<br>
expect the Dom0 kernel to be packaged as PE image, as that<br>
would then be unusable as DomU kernel (on older hosts at least,<br>
i.e. even if we added a PE loader to libxc).<br></blockquote><div><br>Sorry=
 for the n00b question, but what&#39;s a PE image in this context?<br><br>=
=A0-George<br></div></div><br></div>

--bcaec53aedb496b40404cfb40fd7--


--===============7096605885863878601==
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.xen.org
http://lists.xen.org/xen-devel

--===============7096605885863878601==--


From xen-devel-bounces@lists.xen.org Fri Nov 30 10:43:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:43:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeO3e-0001p5-8p; Fri, 30 Nov 2012 10:42:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TeO3d-0001oz-1g
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:42:57 +0000
Received: from [85.158.139.83:5176] by server-13.bemta-5.messagelabs.com id
	0E/E2-27809-0BD88B05; Fri, 30 Nov 2012 10:42:56 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1354272169!20553927!1
X-Originating-IP: [209.85.220.177]
X-SpamReason: No, hits=0.9 required=7.0 tests=HTML_40_50,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27007 invoked from network); 30 Nov 2012 10:42:50 -0000
Received: from mail-vc0-f177.google.com (HELO mail-vc0-f177.google.com)
	(209.85.220.177)
	by server-11.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 10:42:50 -0000
Received: by mail-vc0-f177.google.com with SMTP id m8so308505vcd.36
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 02:42:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=HY/tl8ZvdfJVBomwLwvMdv0CwpZhE9U5zY2q1KWX0bU=;
	b=xIkvcNoV15bOrggZBA2hgDfzrMC1EQf1ikNg+RaCvHgB/2R6VJWqmkLj2u6rENPmqi
	Bou4n68WbOaz7PDsRYEYBXoxtOkjknhTZrrJBQ0/fXruLegVB7kpYO/NNrmNQaTH4rID
	rVwRDDYCrN5wePMHznd81S1hw10wPEkyYMoGa1NLplWtgTrUAUU53uz2emPrTr2nnsIM
	NJgdhLbHMODdgmiz3I4aCe76IaEL2Vz2UdKeaGVAbEe9TScXQxSgIImZjFa/QJ1NqCnj
	hNUkK8hUscwazFnxY1ZW7JWjSxZlwpN7ddGOlM+qFVvK7FDbp8+PMPmz95SimpiKqAuy
	j31w==
MIME-Version: 1.0
Received: by 10.52.156.40 with SMTP id wb8mr581809vdb.39.1354272169439; Fri,
	30 Nov 2012 02:42:49 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Fri, 30 Nov 2012 02:42:49 -0800 (PST)
In-Reply-To: <50B8981802000078000ACCFE@nat28.tlf.novell.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B63CCC02000078000AC34E@nat28.tlf.novell.com>
	<50B8981802000078000ACCFE@nat28.tlf.novell.com>
Date: Fri, 30 Nov 2012 10:42:49 +0000
X-Google-Sender-Auth: 83tE9YlTYgcgVJx7WF7LfTrv8Go
Message-ID: <CAFLBxZb7sbeEa8SnikOafzMhsyqnJW52J03dLr2PiUs0TM=-yw@mail.gmail.com>
From: George Dunlap <dunlapg@umich.edu>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============7096605885863878601=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============7096605885863878601==
Content-Type: multipart/alternative; boundary=bcaec53aedb496b40404cfb40fd7

--bcaec53aedb496b40404cfb40fd7
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich <JBeulich@suse.com> wrote:

> So I learned a little more meanwhile - it's not that trivial: I'm told
> the shim uses UEFI services to do the verification, and those
> services only handle PE images. But we obviously can't reasonably
> expect the Dom0 kernel to be packaged as PE image, as that
> would then be unusable as DomU kernel (on older hosts at least,
> i.e. even if we added a PE loader to libxc).
>

Sorry for the n00b question, but what's a PE image in this context?

 -George

--bcaec53aedb496b40404cfb40fd7
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich <span dir=3D"ltr">&lt;<a href=
=3D"mailto:JBeulich@suse.com" target=3D"_blank">JBeulich@suse.com</a>&gt;</=
span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_quote"><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #cc=
c solid;padding-left:1ex">
<div class=3D"HOEnZb"><div class=3D"h5">So I learned a little more meanwhil=
e - it&#39;s not that trivial: I&#39;m told<br></div></div>
the shim uses UEFI services to do the verification, and those<br>
services only handle PE images. But we obviously can&#39;t reasonably<br>
expect the Dom0 kernel to be packaged as PE image, as that<br>
would then be unusable as DomU kernel (on older hosts at least,<br>
i.e. even if we added a PE loader to libxc).<br></blockquote><div><br>Sorry=
 for the n00b question, but what&#39;s a PE image in this context?<br><br>=
=A0-George<br></div></div><br></div>

--bcaec53aedb496b40404cfb40fd7--


--===============7096605885863878601==
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.xen.org
http://lists.xen.org/xen-devel

--===============7096605885863878601==--


From xen-devel-bounces@lists.xen.org Fri Nov 30 10:43:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:43:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeO45-0001yt-SJ; Fri, 30 Nov 2012 10:43:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeO44-0001yi-5o
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:43:24 +0000
Received: from [85.158.139.211:2185] by server-5.bemta-5.messagelabs.com id
	65/CB-11353-BCD88B05; Fri, 30 Nov 2012 10:43:23 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354272202!18528855!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28809 invoked from network); 30 Nov 2012 10:43:22 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 10:43:22 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16087911"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 10:43:22 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 10:43:22 +0000
Message-ID: <1354272201.6269.113.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Manuel Bouyer <bouyer@antioche.eu.org>
Date: Fri, 30 Nov 2012 10:43:21 +0000
In-Reply-To: <20121130103823.GA9562@asim.lip6.fr>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr> <50B8718C.1090405@citrix.com>
	<20121130085241.GC311@asim.lip6.fr> <50B87A7E.5030001@citrix.com>
	<20121130094143.GA10993@asim.lip6.fr> <50B88325.1050009@citrix.com>
	<1354271552.6269.110.camel@zakaz.uk.xensource.com>
	<20121130103823.GA9562@asim.lip6.fr>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-30 at 10:38 +0000, Manuel Bouyer wrote:
> On Fri, Nov 30, 2012 at 10:32:32AM +0000, Ian Campbell wrote:
> > libxl only selects the backend itself if the caller doesn't provide one.
> > If the caller sets the backend field !=  UNKNOWN then libxl will (try)
> > and use it. This field is exposed by xl via the backendtype= key in the
> > disk configuration
> > http://xenbits.xen.org/docs/unstable/misc/xl-disk-configuration.txt
> 
> thanks for pointing this out.
> I guess qdisk is the qemu backend, and tap would be the in-kernel backend ?

qdisk == qemu, tap == blktap, phy == in kernel.

> Is there a way to specify in a config file which default xl should use ?

backendtype=phy in your disk configure string will do it. Or did you
mean globally? In that case no (or not AFAIK).

That's not to say it couldn't be made configurable, but someone would
have to figure out a sensible looking patch. You'd probably want a
per-format setting?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:43:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:43:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeO45-0001yt-SJ; Fri, 30 Nov 2012 10:43:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeO44-0001yi-5o
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:43:24 +0000
Received: from [85.158.139.211:2185] by server-5.bemta-5.messagelabs.com id
	65/CB-11353-BCD88B05; Fri, 30 Nov 2012 10:43:23 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354272202!18528855!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28809 invoked from network); 30 Nov 2012 10:43:22 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 10:43:22 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16087911"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 10:43:22 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 10:43:22 +0000
Message-ID: <1354272201.6269.113.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Manuel Bouyer <bouyer@antioche.eu.org>
Date: Fri, 30 Nov 2012 10:43:21 +0000
In-Reply-To: <20121130103823.GA9562@asim.lip6.fr>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr> <50B8718C.1090405@citrix.com>
	<20121130085241.GC311@asim.lip6.fr> <50B87A7E.5030001@citrix.com>
	<20121130094143.GA10993@asim.lip6.fr> <50B88325.1050009@citrix.com>
	<1354271552.6269.110.camel@zakaz.uk.xensource.com>
	<20121130103823.GA9562@asim.lip6.fr>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-30 at 10:38 +0000, Manuel Bouyer wrote:
> On Fri, Nov 30, 2012 at 10:32:32AM +0000, Ian Campbell wrote:
> > libxl only selects the backend itself if the caller doesn't provide one.
> > If the caller sets the backend field !=  UNKNOWN then libxl will (try)
> > and use it. This field is exposed by xl via the backendtype= key in the
> > disk configuration
> > http://xenbits.xen.org/docs/unstable/misc/xl-disk-configuration.txt
> 
> thanks for pointing this out.
> I guess qdisk is the qemu backend, and tap would be the in-kernel backend ?

qdisk == qemu, tap == blktap, phy == in kernel.

> Is there a way to specify in a config file which default xl should use ?

backendtype=phy in your disk configure string will do it. Or did you
mean globally? In that case no (or not AFAIK).

That's not to say it couldn't be made configurable, but someone would
have to figure out a sensible looking patch. You'd probably want a
per-format setting?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:51:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:51:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOBV-0002Lr-0G; Fri, 30 Nov 2012 10:51:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Manuel.Bouyer@lip6.fr>) id 1TeOBS-0002Lj-HJ
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:51:02 +0000
Received: from [85.158.139.211:60051] by server-16.bemta-5.messagelabs.com id
	67/77-21311-59F88B05; Fri, 30 Nov 2012 10:51:01 +0000
X-Env-Sender: Manuel.Bouyer@lip6.fr
X-Msg-Ref: server-15.tower-206.messagelabs.com!1354272661!18546064!1
X-Originating-IP: [132.227.60.2]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2793 invoked from network); 30 Nov 2012 10:51:01 -0000
Received: from isis.lip6.fr (HELO isis.lip6.fr) (132.227.60.2)
	by server-15.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 10:51:01 -0000
Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2])
	by isis.lip6.fr (8.14.5/lip6) with ESMTP id qAUAowHC029066
	; Fri, 30 Nov 2012 11:50:58 +0100 (CET)
X-pt: isis.lip6.fr
Received: from armandeche.soc.lip6.fr (armandeche [132.227.63.133])
	by asim.lip6.fr (8.14.5/8.14.4) with ESMTP id qAUAowAs009840;
	Fri, 30 Nov 2012 11:50:58 +0100 (MET)
Received: by armandeche.soc.lip6.fr (Postfix, from userid 20331)
	id 70D9934B3E; Fri, 30 Nov 2012 11:50:58 +0100 (MET)
Date: Fri, 30 Nov 2012 11:50:58 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121130105058.GA3457@asim.lip6.fr>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr> <50B8718C.1090405@citrix.com>
	<20121130085241.GC311@asim.lip6.fr> <50B87A7E.5030001@citrix.com>
	<20121130094143.GA10993@asim.lip6.fr> <50B88325.1050009@citrix.com>
	<1354271552.6269.110.camel@zakaz.uk.xensource.com>
	<20121130103823.GA9562@asim.lip6.fr>
	<1354272201.6269.113.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354272201.6269.113.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7
	(isis.lip6.fr [132.227.60.2]);
	Fri, 30 Nov 2012 11:50:59 +0100 (CET)
X-Scanned-By: MIMEDefang 2.73 on 132.227.60.2
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 10:43:21AM +0000, Ian Campbell wrote:
> On Fri, 2012-11-30 at 10:38 +0000, Manuel Bouyer wrote:
> > On Fri, Nov 30, 2012 at 10:32:32AM +0000, Ian Campbell wrote:
> > > libxl only selects the backend itself if the caller doesn't provide one.
> > > If the caller sets the backend field !=  UNKNOWN then libxl will (try)
> > > and use it. This field is exposed by xl via the backendtype= key in the
> > > disk configuration
> > > http://xenbits.xen.org/docs/unstable/misc/xl-disk-configuration.txt
> > 
> > thanks for pointing this out.
> > I guess qdisk is the qemu backend, and tap would be the in-kernel backend ?
> 
> qdisk == qemu, tap == blktap, phy == in kernel.

OK; but then, how does the script called by xenbackendd know what setup
is should do ? With xm, it would get a string in the form
phy:/dev/wd0e
or
file:/domains/foo.img

but from what I've understant, this syntax is deprecated now ?

> 
> > Is there a way to specify in a config file which default xl should use ?
> 
> backendtype=phy in your disk configure string will do it. Or did you
> mean globally? In that case no (or not AFAIK).

Yes, I mean globally.

> 
> That's not to say it couldn't be made configurable, but someone would
> have to figure out a sensible looking patch. You'd probably want a
> per-format setting?

I guess so, but I've not played with the new tools yet.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:51:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:51:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOBV-0002Lr-0G; Fri, 30 Nov 2012 10:51:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Manuel.Bouyer@lip6.fr>) id 1TeOBS-0002Lj-HJ
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:51:02 +0000
Received: from [85.158.139.211:60051] by server-16.bemta-5.messagelabs.com id
	67/77-21311-59F88B05; Fri, 30 Nov 2012 10:51:01 +0000
X-Env-Sender: Manuel.Bouyer@lip6.fr
X-Msg-Ref: server-15.tower-206.messagelabs.com!1354272661!18546064!1
X-Originating-IP: [132.227.60.2]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2793 invoked from network); 30 Nov 2012 10:51:01 -0000
Received: from isis.lip6.fr (HELO isis.lip6.fr) (132.227.60.2)
	by server-15.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 10:51:01 -0000
Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2])
	by isis.lip6.fr (8.14.5/lip6) with ESMTP id qAUAowHC029066
	; Fri, 30 Nov 2012 11:50:58 +0100 (CET)
X-pt: isis.lip6.fr
Received: from armandeche.soc.lip6.fr (armandeche [132.227.63.133])
	by asim.lip6.fr (8.14.5/8.14.4) with ESMTP id qAUAowAs009840;
	Fri, 30 Nov 2012 11:50:58 +0100 (MET)
Received: by armandeche.soc.lip6.fr (Postfix, from userid 20331)
	id 70D9934B3E; Fri, 30 Nov 2012 11:50:58 +0100 (MET)
Date: Fri, 30 Nov 2012 11:50:58 +0100
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <20121130105058.GA3457@asim.lip6.fr>
References: <1354210308-23251-1-git-send-email-roger.pau@citrix.com>
	<20121129185635.GA1045@asim.lip6.fr> <50B8718C.1090405@citrix.com>
	<20121130085241.GC311@asim.lip6.fr> <50B87A7E.5030001@citrix.com>
	<20121130094143.GA10993@asim.lip6.fr> <50B88325.1050009@citrix.com>
	<1354271552.6269.110.camel@zakaz.uk.xensource.com>
	<20121130103823.GA9562@asim.lip6.fr>
	<1354272201.6269.113.camel@zakaz.uk.xensource.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354272201.6269.113.camel@zakaz.uk.xensource.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7
	(isis.lip6.fr [132.227.60.2]);
	Fri, 30 Nov 2012 11:50:59 +0100 (CET)
X-Scanned-By: MIMEDefang 2.73 on 132.227.60.2
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"port-xen@NetBSD.org" <port-xen@NetBSD.org>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v2 0/3] Add support for NetBSD gntdev
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 10:43:21AM +0000, Ian Campbell wrote:
> On Fri, 2012-11-30 at 10:38 +0000, Manuel Bouyer wrote:
> > On Fri, Nov 30, 2012 at 10:32:32AM +0000, Ian Campbell wrote:
> > > libxl only selects the backend itself if the caller doesn't provide one.
> > > If the caller sets the backend field !=  UNKNOWN then libxl will (try)
> > > and use it. This field is exposed by xl via the backendtype= key in the
> > > disk configuration
> > > http://xenbits.xen.org/docs/unstable/misc/xl-disk-configuration.txt
> > 
> > thanks for pointing this out.
> > I guess qdisk is the qemu backend, and tap would be the in-kernel backend ?
> 
> qdisk == qemu, tap == blktap, phy == in kernel.

OK; but then, how does the script called by xenbackendd know what setup
is should do ? With xm, it would get a string in the form
phy:/dev/wd0e
or
file:/domains/foo.img

but from what I've understant, this syntax is deprecated now ?

> 
> > Is there a way to specify in a config file which default xl should use ?
> 
> backendtype=phy in your disk configure string will do it. Or did you
> mean globally? In that case no (or not AFAIK).

Yes, I mean globally.

> 
> That's not to say it couldn't be made configurable, but someone would
> have to figure out a sensible looking patch. You'd probably want a
> per-format setting?

I guess so, but I've not played with the new tools yet.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:53:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:53:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOE1-0002cp-RK; Fri, 30 Nov 2012 10:53:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeOE0-0002cj-PW
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:53:40 +0000
Received: from [85.158.137.99:19617] by server-10.bemta-3.messagelabs.com id
	5A/A7-19806-F2098B05; Fri, 30 Nov 2012 10:53:35 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1354272812!17343154!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26946 invoked from network); 30 Nov 2012 10:53:32 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 10:53:32 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 10:28:09 +0000
Message-Id: <50B8988002000078000ACD01@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 10:29:04 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <961EE662BA396D43898AFA993C8F01B775066487@SBJEXCH1A.websense.com>
	<1354264550.6039.37.camel@dagon.hellion.org.uk>
	<50B8898D02000078000ACC41@nat28.tlf.novell.com>
	<1354268649.6269.80.camel@zakaz.uk.xensource.com>
	<50B8923E02000078000ACCBC@nat28.tlf.novell.com>
	<1354270510.6269.95.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354270510.6269.95.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Shunli Yi <syi@websense.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [patch] netback: Xennet half die---netback driver
 didn't detect the jiffies wrapping correctly.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 11:15, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> We could always choose a more practical backstop, like a day or even a
> just few minutes -- we'd expect in general to always be pushing the
> timeout ahead rather than hitting it.

Or really, if cleanly doable, we could consider not enabling this
when jiffies if 64 bits wide anyway.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:53:57 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:53:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOE1-0002cp-RK; Fri, 30 Nov 2012 10:53:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeOE0-0002cj-PW
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:53:40 +0000
Received: from [85.158.137.99:19617] by server-10.bemta-3.messagelabs.com id
	5A/A7-19806-F2098B05; Fri, 30 Nov 2012 10:53:35 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1354272812!17343154!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26946 invoked from network); 30 Nov 2012 10:53:32 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-10.tower-217.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 10:53:32 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 10:28:09 +0000
Message-Id: <50B8988002000078000ACD01@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 10:29:04 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "Ian Campbell" <Ian.Campbell@citrix.com>
References: <961EE662BA396D43898AFA993C8F01B775066487@SBJEXCH1A.websense.com>
	<1354264550.6039.37.camel@dagon.hellion.org.uk>
	<50B8898D02000078000ACC41@nat28.tlf.novell.com>
	<1354268649.6269.80.camel@zakaz.uk.xensource.com>
	<50B8923E02000078000ACCBC@nat28.tlf.novell.com>
	<1354270510.6269.95.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354270510.6269.95.camel@zakaz.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Shunli Yi <syi@websense.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [patch] netback: Xennet half die---netback driver
 didn't detect the jiffies wrapping correctly.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 11:15, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> We could always choose a more practical backstop, like a day or even a
> just few minutes -- we'd expect in general to always be pushing the
> timeout ahead rather than hitting it.

Or really, if cleanly doable, we could consider not enabling this
when jiffies if 64 bits wide anyway.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:57:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:57:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOHC-0002mK-GK; Fri, 30 Nov 2012 10:56:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TeOHA-0002mF-VG
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:56:57 +0000
Received: from [85.158.137.99:8950] by server-13.bemta-3.messagelabs.com id
	C9/00-24887-6F098B05; Fri, 30 Nov 2012 10:56:54 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354272963!17334311!1
X-Originating-IP: [209.85.220.177]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30854 invoked from network); 30 Nov 2012 10:56:05 -0000
Received: from mail-vc0-f177.google.com (HELO mail-vc0-f177.google.com)
	(209.85.220.177)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 10:56:05 -0000
Received: by mail-vc0-f177.google.com with SMTP id m8so318868vcd.36
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 02:56:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=kDCsvK9wLfQFSfMyyU+U8WurQobi+kgRwh6AxgMHWLQ=;
	b=pii9u77fvOYCQXWHsJF+lN9o0FCd7KUL+LOTsqvJYybvB3vFy+OK3mhJ46c0h6iFms
	SXgX4Y1DhEhNXe17JvRrQ5GkWSfrhqBBRMP2FbRuQ1v9AbCPrgMKOe3Jp2XPiurpcoc+
	OoQGHgJi057thxtcdORp6xj/HM/Yx8xt4+dh/7mXmxFDfpUdCi8QK9u3n0kvNFLj/HvA
	SzUFoKtJWZ4E0i822UTaBhi2qjPBWs3sHDDhDZArjuGpGVkbqIVa2cqHeBm0pfWljLP7
	qlOt7OM0GrGNbvBEo1tFBZtaZegGqq8juKErm4i3BVbEhAhiYVFwVMHino0OyvlAKcWi
	ER5w==
MIME-Version: 1.0
Received: by 10.221.11.2 with SMTP id pc2mr693131vcb.10.1354272963626; Fri, 30
	Nov 2012 02:56:03 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Fri, 30 Nov 2012 02:56:03 -0800 (PST)
In-Reply-To: <50B8981802000078000ACCFE@nat28.tlf.novell.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B63CCC02000078000AC34E@nat28.tlf.novell.com>
	<50B8981802000078000ACCFE@nat28.tlf.novell.com>
Date: Fri, 30 Nov 2012 10:56:03 +0000
X-Google-Sender-Auth: Ak4Mx0tKxfQMLXB-cTCbVB-PwUY
Message-ID: <CAFLBxZYKtq5-dfbXucB8Uf0zFoMC91hAxcNdWd_FA-7-Bc-hMg@mail.gmail.com>
From: George Dunlap <dunlapg@umich.edu>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5152858365102582613=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5152858365102582613==
Content-Type: multipart/alternative; boundary=bcaec54eec40ed061204cfb43ea5

--bcaec54eec40ed061204cfb43ea5
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich <JBeulich@suse.com> wrote:

>
> So I learned a little more meanwhile - it's not that trivial: I'm told
> the shim uses UEFI services to do the verification, and those
> services only handle PE images. But we obviously can't reasonably
> expect the Dom0 kernel to be packaged as PE image, as that
> would then be unusable as DomU kernel (on older hosts at least,
> i.e. even if we added a PE loader to libxc).
>

But what does the shim use to check the signature of Xen in this case?
Does Xen / native Linux need to be a PE image to boot from the shim?  If
not, wouldn't the native PE image suffice?  And if so, why can't the shim
check signatures the same way it checks the sig for the thing it's booting?

 -George

--bcaec54eec40ed061204cfb43ea5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich <span dir=3D"ltr">&lt;<a href=
=3D"mailto:JBeulich@suse.com" target=3D"_blank">JBeulich@suse.com</a>&gt;</=
span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_quote"><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #cc=
c solid;padding-left:1ex">
<div class=3D"HOEnZb"><div class=3D"h5"><br>
</div></div>So I learned a little more meanwhile - it&#39;s not that trivia=
l: I&#39;m told<br>
the shim uses UEFI services to do the verification, and those<br>
services only handle PE images. But we obviously can&#39;t reasonably<br>
expect the Dom0 kernel to be packaged as PE image, as that<br>
would then be unusable as DomU kernel (on older hosts at least,<br>
i.e. even if we added a PE loader to libxc).<br></blockquote><div><br>But w=
hat does the shim use to check the signature of Xen in this case?=A0 Does X=
en / native Linux need to be a PE image to boot from the shim?=A0 If not, w=
ouldn&#39;t the native PE image suffice?=A0 And if so, why can&#39;t the sh=
im check signatures the same way it checks the sig for the thing it&#39;s b=
ooting?<br>
<br>=A0-George<br></div></div><br></div>

--bcaec54eec40ed061204cfb43ea5--


--===============5152858365102582613==
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.xen.org
http://lists.xen.org/xen-devel

--===============5152858365102582613==--


From xen-devel-bounces@lists.xen.org Fri Nov 30 10:57:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:57:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOHC-0002mK-GK; Fri, 30 Nov 2012 10:56:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TeOHA-0002mF-VG
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:56:57 +0000
Received: from [85.158.137.99:8950] by server-13.bemta-3.messagelabs.com id
	C9/00-24887-6F098B05; Fri, 30 Nov 2012 10:56:54 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354272963!17334311!1
X-Originating-IP: [209.85.220.177]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30854 invoked from network); 30 Nov 2012 10:56:05 -0000
Received: from mail-vc0-f177.google.com (HELO mail-vc0-f177.google.com)
	(209.85.220.177)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 10:56:05 -0000
Received: by mail-vc0-f177.google.com with SMTP id m8so318868vcd.36
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 02:56:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=kDCsvK9wLfQFSfMyyU+U8WurQobi+kgRwh6AxgMHWLQ=;
	b=pii9u77fvOYCQXWHsJF+lN9o0FCd7KUL+LOTsqvJYybvB3vFy+OK3mhJ46c0h6iFms
	SXgX4Y1DhEhNXe17JvRrQ5GkWSfrhqBBRMP2FbRuQ1v9AbCPrgMKOe3Jp2XPiurpcoc+
	OoQGHgJi057thxtcdORp6xj/HM/Yx8xt4+dh/7mXmxFDfpUdCi8QK9u3n0kvNFLj/HvA
	SzUFoKtJWZ4E0i822UTaBhi2qjPBWs3sHDDhDZArjuGpGVkbqIVa2cqHeBm0pfWljLP7
	qlOt7OM0GrGNbvBEo1tFBZtaZegGqq8juKErm4i3BVbEhAhiYVFwVMHino0OyvlAKcWi
	ER5w==
MIME-Version: 1.0
Received: by 10.221.11.2 with SMTP id pc2mr693131vcb.10.1354272963626; Fri, 30
	Nov 2012 02:56:03 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Fri, 30 Nov 2012 02:56:03 -0800 (PST)
In-Reply-To: <50B8981802000078000ACCFE@nat28.tlf.novell.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B63CCC02000078000AC34E@nat28.tlf.novell.com>
	<50B8981802000078000ACCFE@nat28.tlf.novell.com>
Date: Fri, 30 Nov 2012 10:56:03 +0000
X-Google-Sender-Auth: Ak4Mx0tKxfQMLXB-cTCbVB-PwUY
Message-ID: <CAFLBxZYKtq5-dfbXucB8Uf0zFoMC91hAxcNdWd_FA-7-Bc-hMg@mail.gmail.com>
From: George Dunlap <dunlapg@umich.edu>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5152858365102582613=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============5152858365102582613==
Content-Type: multipart/alternative; boundary=bcaec54eec40ed061204cfb43ea5

--bcaec54eec40ed061204cfb43ea5
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich <JBeulich@suse.com> wrote:

>
> So I learned a little more meanwhile - it's not that trivial: I'm told
> the shim uses UEFI services to do the verification, and those
> services only handle PE images. But we obviously can't reasonably
> expect the Dom0 kernel to be packaged as PE image, as that
> would then be unusable as DomU kernel (on older hosts at least,
> i.e. even if we added a PE loader to libxc).
>

But what does the shim use to check the signature of Xen in this case?
Does Xen / native Linux need to be a PE image to boot from the shim?  If
not, wouldn't the native PE image suffice?  And if so, why can't the shim
check signatures the same way it checks the sig for the thing it's booting?

 -George

--bcaec54eec40ed061204cfb43ea5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich <span dir=3D"ltr">&lt;<a href=
=3D"mailto:JBeulich@suse.com" target=3D"_blank">JBeulich@suse.com</a>&gt;</=
span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_quote"><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #cc=
c solid;padding-left:1ex">
<div class=3D"HOEnZb"><div class=3D"h5"><br>
</div></div>So I learned a little more meanwhile - it&#39;s not that trivia=
l: I&#39;m told<br>
the shim uses UEFI services to do the verification, and those<br>
services only handle PE images. But we obviously can&#39;t reasonably<br>
expect the Dom0 kernel to be packaged as PE image, as that<br>
would then be unusable as DomU kernel (on older hosts at least,<br>
i.e. even if we added a PE loader to libxc).<br></blockquote><div><br>But w=
hat does the shim use to check the signature of Xen in this case?=A0 Does X=
en / native Linux need to be a PE image to boot from the shim?=A0 If not, w=
ouldn&#39;t the native PE image suffice?=A0 And if so, why can&#39;t the sh=
im check signatures the same way it checks the sig for the thing it&#39;s b=
ooting?<br>
<br>=A0-George<br></div></div><br></div>

--bcaec54eec40ed061204cfb43ea5--


--===============5152858365102582613==
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.xen.org
http://lists.xen.org/xen-devel

--===============5152858365102582613==--


From xen-devel-bounces@lists.xen.org Fri Nov 30 10:57:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:57:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOHc-0002p7-3j; Fri, 30 Nov 2012 10:57:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1TeOHa-0002oj-CL; Fri, 30 Nov 2012 10:57:22 +0000
Received: from [85.158.137.99:61164] by server-12.bemta-3.messagelabs.com id
	B2/62-22757-C0198B05; Fri, 30 Nov 2012 10:57:16 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1354272907!17304070!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31185 invoked from network); 30 Nov 2012 10:55:08 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 10:55:08 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16088206"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 10:55:05 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Fri, 30 Nov 2012
	10:55:05 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Fri, 30 Nov 2012 10:55:05 +0000
Thread-Topic: [Xen-devel] [PATCH 11 of 15] libxl: ocaml: allocate a long
	lived	libxl context
Thread-Index: Ac3HRyZuPBs/5C1SSSaBzRZ+EiOrfQHnrwcw
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107B6@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<bdd9c3e423d7f505f93e.1353432211@cosworth.uk.xensource.com>
In-Reply-To: <bdd9c3e423d7f505f93e.1353432211@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 11 of 15] libxl: ocaml: allocate a long
 lived	libxl context
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> bdd9c3e423d7f505f93edf413a92ad7b47ed9e39
> # Parent  2b433b1523e4295bb1ed74a7b71e2a20e00f1802
> libxl: ocaml: allocate a long lived libxl context.
> 
> Rather than allocating a new context for every libxl call begin to switch to a
> model where a context is allocated by the caller and may then be used for
> multiple calls down into the library.
> 
> As a starting point convert list_domains and send_debug_keys and
> implement simple tests which use them. These are just PoC of the
> infrastructure, I don't intend to add one for every function...
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Looks good to me. I just included a few minor comments below. Otherwise:

Acked-by: Rob Hoes <rob.hoes@citrix.com>

Cheers,
Rob

> diff -r 2b433b1523e4 -r bdd9c3e423d7 .gitignore
> --- a/.gitignore	Tue Nov 20 17:22:21 2012 +0000
> +++ b/.gitignore	Tue Nov 20 17:22:21 2012 +0000
> @@ -365,7 +365,8 @@ tools/ocaml/libs/xl/xenlight.ml
> tools/ocaml/libs/xl/xenlight.mli  tools/ocaml/xenstored/oxenstored
> tools/ocaml/test/xtl
> -
> +tools/ocaml/test/send_debug_keys
> +tools/ocaml/test/list_domains
>  tools/debugger/kdd/kdd
>  tools/firmware/etherboot/ipxe.tar.gz
>  tools/firmware/etherboot/ipxe/
> diff -r 2b433b1523e4 -r bdd9c3e423d7 .hgignore
> --- a/.hgignore	Tue Nov 20 17:22:21 2012 +0000
> +++ b/.hgignore	Tue Nov 20 17:22:21 2012 +0000
> @@ -306,6 +306,8 @@
>  ^tools/ocaml/libs/xl/xenlight\.mli$
>  ^tools/ocaml/xenstored/oxenstored$
>  ^tools/ocaml/test/xtl$
> +^tools/ocaml/test/send_debug_keys$
> +^tools/ocaml/test/list_domains$
>  ^tools/autom4te\.cache$
>  ^tools/config\.h$
>  ^tools/config\.log$
> diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/libs/xl/Makefile
> --- a/tools/ocaml/libs/xl/Makefile	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/Makefile	Tue Nov 20 17:22:21 2012 +0000
> @@ -10,6 +10,8 @@ OBJS = xenlight
>  INTF = xenlight.cmi
>  LIBS = xenlight.cma xenlight.cmxa
> 
> +OCAMLINCLUDE += -I ../xentoollog
> +
>  LIBS_xenlight = $(LDLIBS_libxenlight)
> 
>  xenlight_OBJS = $(OBJS)

I had to also add 'requires = "xentoollog"' to tools/ocaml/libs/xl/META.in.

> diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/libs/xl/xenlight.ml.in
> --- a/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012
> +0000
> @@ -13,6 +13,8 @@
>   * GNU Lesser General Public License for more details.
>   *)
> 
> +open Xentoollog
> +
>  exception Error of string
> 
>  type domid = int
> @@ -24,8 +26,15 @@ end
> 
>  (* @@LIBXL_TYPES@@ *)
> 
> +type ctx
> +
> +external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
> +external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
> +
> +external list_domain: ctx -> Dominfo.t list = "stub_libxl_list_domain"

I wrote a similar function to this one, but instead used the IDL thing. I added "dominfo" to the list of functions in genwrap.py, with "list" and "get" functions, so in OCaml you can do something like 'Dominfo.list ctx'.

> +
>  external send_trigger : domid -> trigger -> int -> unit =
> "stub_xl_send_trigger"
>  external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
> -external send_debug_keys : domid -> string -> unit =
> "stub_xl_send_debug_keys"
> +external send_debug_keys : ctx -> string -> unit =
> "stub_xl_send_debug_keys"
> 
>  let _ = Callback.register_exception "xl.error" (Error "register_callback") diff
> -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/libs/xl/xenlight.mli.in
> --- a/tools/ocaml/libs/xl/xenlight.mli.in	Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight.mli.in	Tue Nov 20 17:22:21 2012
> +0000
> @@ -13,6 +13,8 @@
>   * GNU Lesser General Public License for more details.
>   *)
> 
> +open Xentoollog
> +

You don't really need to open this here if you are using the "Xentoollog." prefix as done below. I think is generally better to not use "open" too much, and just prefix values/functions and type with the module name, so it is easier to see where they come from, and you avoid namespace issues (open != #include). I'd only use "open" if there are lots of them. There are few more of these in other parts of the code.

>  exception Error of string
> 
>  type domid = int
> @@ -20,6 +22,13 @@ type devid = int
> 
>  (* @@LIBXL_TYPES@@ *)
> 
> +type ctx
> +
> +external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
> +external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
> +
> +external list_domain: ctx -> Dominfo.t list = "stub_libxl_list_domain"
> +
>  external send_trigger : domid -> trigger -> int -> unit =
> "stub_xl_send_trigger"
>  external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
> -external send_debug_keys : domid -> string -> unit =
> "stub_xl_send_debug_keys"
> +external send_debug_keys : ctx -> string -> unit =
> "stub_xl_send_debug_keys"
> diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/libs/xl/xenlight_stubs.c
> --- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012
> +0000
> @@ -29,6 +29,8 @@
>  #include <libxl.h>
>  #include <libxl_utils.h>
> 
> +#define CTX ((libxl_ctx *)ctx)
> +
>  struct caml_logger {
>  	struct xentoollog_logger logger;
>  	int log_offset;
> @@ -59,6 +61,8 @@ static void log_destroy(struct xentoollo
>  	lg.logger.vmessage = log_vmessage; \
>  	lg.logger.destroy = log_destroy; \
>  	lg.logger.progress = NULL; \
> +	lg.log_offset = 0; \
> +	memset(&lg.log_buf,0,sizeof(lg.log_buf));	\
>  	caml_enter_blocking_section(); \
>  	ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct
> xentoollog_logger *) &lg); \
>  	if (ret != 0) \
> @@ -77,7 +81,7 @@ static char * dup_String_val(caml_gc *gc
>  	c = calloc(len + 1, sizeof(char));
>  	if (!c)
>  		caml_raise_out_of_memory();
> -	gc->ptrs[gc->offset++] = c;
> +	if (gc) gc->ptrs[gc->offset++] = c;
>  	memcpy(c, String_val(s), len);
>  	return c;
>  }
> @@ -94,9 +98,35 @@ static void failwith_xl(char *fname, str  {
>  	char *s;
>  	s = (lg) ? lg->log_buf : fname;
> +	printf("Error: %s\n", fname);
>  	caml_raise_with_string(*caml_named_value("xl.error"), s);  }
> 
> +CAMLprim value stub_libxl_ctx_alloc(value logger) {
> +	CAMLparam1(logger);
> +	libxl_ctx *ctx;
> +	int ret;
> +
> +	caml_enter_blocking_section();

I had to remove this to avoid segfaults, but that is probably due to the thing we discussed on the logger thread. If we are going completely async for all potentially blocking calls, we can remove this anyway.

> +	ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct
> xentoollog_logger *) logger);
> +	if (ret != 0) \
> +		failwith_xl("cannot init context", NULL);
> +	caml_leave_blocking_section();
> +	CAMLreturn((value)ctx);
> +}
> +
> +CAMLprim value stub_libxl_ctx_free(value ctx) {
> +	CAMLparam1(ctx);
> +
> +	caml_enter_blocking_section();
> +	libxl_ctx_free(CTX);
> +	caml_leave_blocking_section();
> +
> +	CAMLreturn(Val_unit);
> +}
> +
>  static void * gc_calloc(caml_gc *gc, size_t nmemb, size_t size)  {
>  	void *ptr;
> @@ -311,6 +341,39 @@ static value Val_hwcap(libxl_hwcap *c_va
> 
>  #include "_libxl_types.inc"
> 
> +value stub_libxl_list_domain(value ctx) {
> +	CAMLparam1(ctx);
> +	CAMLlocal2( cli, cons );
> +	struct caml_gc gc;
> +	libxl_dominfo *info;
> +	int i, nr;
> +
> +	gc.offset = 0;
> +	info = libxl_list_domain(CTX, &nr);
> +	if (info == NULL)
> +		failwith_xl("list_domain", NULL);
> +
> +	cli = Val_emptylist;
> +
> +	for (i = nr - 1; i >= 0; i--) {
> +		cons = caml_alloc(2, 0);
> +
> +		/* Head */
> +		Store_field(cons, 0, Val_dominfo(&gc, NULL, &info[i]));
> +		/* Tail */
> +		Store_field(cons, 1, cli);
> +
> +		cli = cons;
> +	}
> +
> +	libxl_dominfo_list_free(info, nr);
> +
> +	gc_free(&gc);
> +
> +	CAMLreturn(cli);
> +}
> +
>  value stub_xl_device_disk_add(value info, value domid)  {
>  	CAMLparam2(info, domid);
> @@ -637,20 +700,20 @@ value stub_xl_send_sysrq(value domid, va
>  	CAMLreturn(Val_unit);
>  }
> 
> -value stub_xl_send_debug_keys(value keys)
> +value stub_xl_send_debug_keys(value ctx, value keys)
>  {
> -	CAMLparam1(keys);
> +	CAMLparam2(ctx, keys);
>  	int ret;
>  	char *c_keys;
> -	INIT_STRUCT();
> 
> -	c_keys = dup_String_val(&gc, keys);
> +	c_keys = dup_String_val(NULL, keys);
> 
> -	INIT_CTX();
> -	ret = libxl_send_debug_keys(ctx, c_keys);
> +	ret = libxl_send_debug_keys(CTX, c_keys);
>  	if (ret != 0)
> -		failwith_xl("send_debug_keys", &lg);
> -	FREE_CTX();
> +		failwith_xl("send_debug_keys", NULL);
> +
> +	free(c_keys);
> +
>  	CAMLreturn(Val_unit);
>  }
> 
> diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/test/Makefile
> --- a/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
> @@ -3,18 +3,31 @@ OCAML_TOPLEVEL = $(CURDIR)/..
>  include $(OCAML_TOPLEVEL)/common.make
> 
>  OCAMLINCLUDE += \
> -	-I $(OCAML_TOPLEVEL)/libs/xentoollog
> +	-I $(OCAML_TOPLEVEL)/libs/xentoollog \
> +	-I $(OCAML_TOPLEVEL)/libs/xl
> 
> -OBJS = xtl
> +OBJS = xtl send_debug_keys list_domains
> 
> -PROGRAMS = xtl
> +PROGRAMS = xtl send_debug_keys list_domains
> 
>  xtl_LIBS =  \
>  	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog
> $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa
> 
>  xtl_OBJS = xtl
> 
> -OCAML_PROGRAM = xtl
> +send_debug_keys_LIBS =  \
> +	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog
> $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
> +	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl
> +$(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
> +
> +send_debug_keys_OBJS = send_debug_keys
> +
> +list_domains_LIBS =  \
> +	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog
> $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
> +	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl
> +$(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
> +
> +list_domains_OBJS = list_domains
> +
> +OCAML_PROGRAM = xtl send_debug_keys list_domains
> 
>  all: $(PROGRAMS)
> 
> diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/test/list_domains.ml
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/ocaml/test/list_domains.ml	Tue Nov 20 17:22:21 2012
> +0000
> @@ -0,0 +1,26 @@
> +open Arg
> +open Printf
> +open Xentoollog
> +open Xenlight
> +
> +let bool_as_char b c = if b then c else '-'
> +
> +let print_dominfo dominfo =
> +  let id = dominfo.Xenlight.Dominfo.domid
> +  and running = bool_as_char dominfo.Xenlight.Dominfo.running 'r'
> +  and blocked = bool_as_char dominfo.Xenlight.Dominfo.blocked 'b'
> +  and paused = bool_as_char dominfo.Xenlight.Dominfo.paused 'p'
> +  and shutdown = bool_as_char dominfo.Xenlight.Dominfo.shutdown 's'
> +  and dying = bool_as_char dominfo.Xenlight.Dominfo.dying 'd'
> +  and memory = dominfo.Xenlight.Dominfo.current_memkb
> +  in
> +  printf "Dom %d: %c%c%c%c%c %LdKB\n" id running blocked paused
> +shutdown dying memory
> +
> +let _ =
> +  let logger = Xentoollog.create_stdio_logger
> +(*~level:Xentoollog.Debug*) () in
> +  let ctx = Xenlight.ctx_alloc logger in
> +  let domains = Xenlight.list_domain ctx in
> +  List.iter (fun d -> print_dominfo d) domains;
> +  Xenlight.ctx_free ctx;
> +  Xentoollog.destroy logger;
> +
> diff -r 2b433b1523e4 -r bdd9c3e423d7
> tools/ocaml/test/send_debug_keys.ml
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/ocaml/test/send_debug_keys.ml	Tue Nov 20 17:22:21 2012
> +0000
> @@ -0,0 +1,17 @@
> +open Arg
> +open Printf
> +open Xentoollog
> +open Xenlight
> +
> +let send_keys ctx s =
> +  printf "Sending debug key %s\n" s;
> +  Xenlight.send_debug_keys ctx s;
> +  ()
> +
> +let _ =
> +  let logger = Xentoollog.create_stdio_logger () in
> +  let ctx = Xenlight.ctx_alloc logger in
> +  Arg.parse [
> +  ] (fun s -> send_keys ctx s) "usage: send_debug_keys <keys>";
> +  Xenlight.ctx_free ctx;
> +  Xentoollog.destroy logger
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:57:34 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:57:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOHc-0002p7-3j; Fri, 30 Nov 2012 10:57:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1TeOHa-0002oj-CL; Fri, 30 Nov 2012 10:57:22 +0000
Received: from [85.158.137.99:61164] by server-12.bemta-3.messagelabs.com id
	B2/62-22757-C0198B05; Fri, 30 Nov 2012 10:57:16 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1354272907!17304070!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31185 invoked from network); 30 Nov 2012 10:55:08 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 10:55:08 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16088206"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 10:55:05 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Fri, 30 Nov 2012
	10:55:05 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Fri, 30 Nov 2012 10:55:05 +0000
Thread-Topic: [Xen-devel] [PATCH 11 of 15] libxl: ocaml: allocate a long
	lived	libxl context
Thread-Index: Ac3HRyZuPBs/5C1SSSaBzRZ+EiOrfQHnrwcw
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107B6@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<bdd9c3e423d7f505f93e.1353432211@cosworth.uk.xensource.com>
In-Reply-To: <bdd9c3e423d7f505f93e.1353432211@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 11 of 15] libxl: ocaml: allocate a long
 lived	libxl context
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> bdd9c3e423d7f505f93edf413a92ad7b47ed9e39
> # Parent  2b433b1523e4295bb1ed74a7b71e2a20e00f1802
> libxl: ocaml: allocate a long lived libxl context.
> 
> Rather than allocating a new context for every libxl call begin to switch to a
> model where a context is allocated by the caller and may then be used for
> multiple calls down into the library.
> 
> As a starting point convert list_domains and send_debug_keys and
> implement simple tests which use them. These are just PoC of the
> infrastructure, I don't intend to add one for every function...
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Looks good to me. I just included a few minor comments below. Otherwise:

Acked-by: Rob Hoes <rob.hoes@citrix.com>

Cheers,
Rob

> diff -r 2b433b1523e4 -r bdd9c3e423d7 .gitignore
> --- a/.gitignore	Tue Nov 20 17:22:21 2012 +0000
> +++ b/.gitignore	Tue Nov 20 17:22:21 2012 +0000
> @@ -365,7 +365,8 @@ tools/ocaml/libs/xl/xenlight.ml
> tools/ocaml/libs/xl/xenlight.mli  tools/ocaml/xenstored/oxenstored
> tools/ocaml/test/xtl
> -
> +tools/ocaml/test/send_debug_keys
> +tools/ocaml/test/list_domains
>  tools/debugger/kdd/kdd
>  tools/firmware/etherboot/ipxe.tar.gz
>  tools/firmware/etherboot/ipxe/
> diff -r 2b433b1523e4 -r bdd9c3e423d7 .hgignore
> --- a/.hgignore	Tue Nov 20 17:22:21 2012 +0000
> +++ b/.hgignore	Tue Nov 20 17:22:21 2012 +0000
> @@ -306,6 +306,8 @@
>  ^tools/ocaml/libs/xl/xenlight\.mli$
>  ^tools/ocaml/xenstored/oxenstored$
>  ^tools/ocaml/test/xtl$
> +^tools/ocaml/test/send_debug_keys$
> +^tools/ocaml/test/list_domains$
>  ^tools/autom4te\.cache$
>  ^tools/config\.h$
>  ^tools/config\.log$
> diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/libs/xl/Makefile
> --- a/tools/ocaml/libs/xl/Makefile	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/Makefile	Tue Nov 20 17:22:21 2012 +0000
> @@ -10,6 +10,8 @@ OBJS = xenlight
>  INTF = xenlight.cmi
>  LIBS = xenlight.cma xenlight.cmxa
> 
> +OCAMLINCLUDE += -I ../xentoollog
> +
>  LIBS_xenlight = $(LDLIBS_libxenlight)
> 
>  xenlight_OBJS = $(OBJS)

I had to also add 'requires = "xentoollog"' to tools/ocaml/libs/xl/META.in.

> diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/libs/xl/xenlight.ml.in
> --- a/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight.ml.in	Tue Nov 20 17:22:21 2012
> +0000
> @@ -13,6 +13,8 @@
>   * GNU Lesser General Public License for more details.
>   *)
> 
> +open Xentoollog
> +
>  exception Error of string
> 
>  type domid = int
> @@ -24,8 +26,15 @@ end
> 
>  (* @@LIBXL_TYPES@@ *)
> 
> +type ctx
> +
> +external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
> +external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
> +
> +external list_domain: ctx -> Dominfo.t list = "stub_libxl_list_domain"

I wrote a similar function to this one, but instead used the IDL thing. I added "dominfo" to the list of functions in genwrap.py, with "list" and "get" functions, so in OCaml you can do something like 'Dominfo.list ctx'.

> +
>  external send_trigger : domid -> trigger -> int -> unit =
> "stub_xl_send_trigger"
>  external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
> -external send_debug_keys : domid -> string -> unit =
> "stub_xl_send_debug_keys"
> +external send_debug_keys : ctx -> string -> unit =
> "stub_xl_send_debug_keys"
> 
>  let _ = Callback.register_exception "xl.error" (Error "register_callback") diff
> -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/libs/xl/xenlight.mli.in
> --- a/tools/ocaml/libs/xl/xenlight.mli.in	Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight.mli.in	Tue Nov 20 17:22:21 2012
> +0000
> @@ -13,6 +13,8 @@
>   * GNU Lesser General Public License for more details.
>   *)
> 
> +open Xentoollog
> +

You don't really need to open this here if you are using the "Xentoollog." prefix as done below. I think is generally better to not use "open" too much, and just prefix values/functions and type with the module name, so it is easier to see where they come from, and you avoid namespace issues (open != #include). I'd only use "open" if there are lots of them. There are few more of these in other parts of the code.

>  exception Error of string
> 
>  type domid = int
> @@ -20,6 +22,13 @@ type devid = int
> 
>  (* @@LIBXL_TYPES@@ *)
> 
> +type ctx
> +
> +external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
> +external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
> +
> +external list_domain: ctx -> Dominfo.t list = "stub_libxl_list_domain"
> +
>  external send_trigger : domid -> trigger -> int -> unit =
> "stub_xl_send_trigger"
>  external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
> -external send_debug_keys : domid -> string -> unit =
> "stub_xl_send_debug_keys"
> +external send_debug_keys : ctx -> string -> unit =
> "stub_xl_send_debug_keys"
> diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/libs/xl/xenlight_stubs.c
> --- a/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Tue Nov 20 17:22:21 2012
> +0000
> @@ -29,6 +29,8 @@
>  #include <libxl.h>
>  #include <libxl_utils.h>
> 
> +#define CTX ((libxl_ctx *)ctx)
> +
>  struct caml_logger {
>  	struct xentoollog_logger logger;
>  	int log_offset;
> @@ -59,6 +61,8 @@ static void log_destroy(struct xentoollo
>  	lg.logger.vmessage = log_vmessage; \
>  	lg.logger.destroy = log_destroy; \
>  	lg.logger.progress = NULL; \
> +	lg.log_offset = 0; \
> +	memset(&lg.log_buf,0,sizeof(lg.log_buf));	\
>  	caml_enter_blocking_section(); \
>  	ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct
> xentoollog_logger *) &lg); \
>  	if (ret != 0) \
> @@ -77,7 +81,7 @@ static char * dup_String_val(caml_gc *gc
>  	c = calloc(len + 1, sizeof(char));
>  	if (!c)
>  		caml_raise_out_of_memory();
> -	gc->ptrs[gc->offset++] = c;
> +	if (gc) gc->ptrs[gc->offset++] = c;
>  	memcpy(c, String_val(s), len);
>  	return c;
>  }
> @@ -94,9 +98,35 @@ static void failwith_xl(char *fname, str  {
>  	char *s;
>  	s = (lg) ? lg->log_buf : fname;
> +	printf("Error: %s\n", fname);
>  	caml_raise_with_string(*caml_named_value("xl.error"), s);  }
> 
> +CAMLprim value stub_libxl_ctx_alloc(value logger) {
> +	CAMLparam1(logger);
> +	libxl_ctx *ctx;
> +	int ret;
> +
> +	caml_enter_blocking_section();

I had to remove this to avoid segfaults, but that is probably due to the thing we discussed on the logger thread. If we are going completely async for all potentially blocking calls, we can remove this anyway.

> +	ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct
> xentoollog_logger *) logger);
> +	if (ret != 0) \
> +		failwith_xl("cannot init context", NULL);
> +	caml_leave_blocking_section();
> +	CAMLreturn((value)ctx);
> +}
> +
> +CAMLprim value stub_libxl_ctx_free(value ctx) {
> +	CAMLparam1(ctx);
> +
> +	caml_enter_blocking_section();
> +	libxl_ctx_free(CTX);
> +	caml_leave_blocking_section();
> +
> +	CAMLreturn(Val_unit);
> +}
> +
>  static void * gc_calloc(caml_gc *gc, size_t nmemb, size_t size)  {
>  	void *ptr;
> @@ -311,6 +341,39 @@ static value Val_hwcap(libxl_hwcap *c_va
> 
>  #include "_libxl_types.inc"
> 
> +value stub_libxl_list_domain(value ctx) {
> +	CAMLparam1(ctx);
> +	CAMLlocal2( cli, cons );
> +	struct caml_gc gc;
> +	libxl_dominfo *info;
> +	int i, nr;
> +
> +	gc.offset = 0;
> +	info = libxl_list_domain(CTX, &nr);
> +	if (info == NULL)
> +		failwith_xl("list_domain", NULL);
> +
> +	cli = Val_emptylist;
> +
> +	for (i = nr - 1; i >= 0; i--) {
> +		cons = caml_alloc(2, 0);
> +
> +		/* Head */
> +		Store_field(cons, 0, Val_dominfo(&gc, NULL, &info[i]));
> +		/* Tail */
> +		Store_field(cons, 1, cli);
> +
> +		cli = cons;
> +	}
> +
> +	libxl_dominfo_list_free(info, nr);
> +
> +	gc_free(&gc);
> +
> +	CAMLreturn(cli);
> +}
> +
>  value stub_xl_device_disk_add(value info, value domid)  {
>  	CAMLparam2(info, domid);
> @@ -637,20 +700,20 @@ value stub_xl_send_sysrq(value domid, va
>  	CAMLreturn(Val_unit);
>  }
> 
> -value stub_xl_send_debug_keys(value keys)
> +value stub_xl_send_debug_keys(value ctx, value keys)
>  {
> -	CAMLparam1(keys);
> +	CAMLparam2(ctx, keys);
>  	int ret;
>  	char *c_keys;
> -	INIT_STRUCT();
> 
> -	c_keys = dup_String_val(&gc, keys);
> +	c_keys = dup_String_val(NULL, keys);
> 
> -	INIT_CTX();
> -	ret = libxl_send_debug_keys(ctx, c_keys);
> +	ret = libxl_send_debug_keys(CTX, c_keys);
>  	if (ret != 0)
> -		failwith_xl("send_debug_keys", &lg);
> -	FREE_CTX();
> +		failwith_xl("send_debug_keys", NULL);
> +
> +	free(c_keys);
> +
>  	CAMLreturn(Val_unit);
>  }
> 
> diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/test/Makefile
> --- a/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/test/Makefile	Tue Nov 20 17:22:21 2012 +0000
> @@ -3,18 +3,31 @@ OCAML_TOPLEVEL = $(CURDIR)/..
>  include $(OCAML_TOPLEVEL)/common.make
> 
>  OCAMLINCLUDE += \
> -	-I $(OCAML_TOPLEVEL)/libs/xentoollog
> +	-I $(OCAML_TOPLEVEL)/libs/xentoollog \
> +	-I $(OCAML_TOPLEVEL)/libs/xl
> 
> -OBJS = xtl
> +OBJS = xtl send_debug_keys list_domains
> 
> -PROGRAMS = xtl
> +PROGRAMS = xtl send_debug_keys list_domains
> 
>  xtl_LIBS =  \
>  	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog
> $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa
> 
>  xtl_OBJS = xtl
> 
> -OCAML_PROGRAM = xtl
> +send_debug_keys_LIBS =  \
> +	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog
> $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
> +	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl
> +$(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
> +
> +send_debug_keys_OBJS = send_debug_keys
> +
> +list_domains_LIBS =  \
> +	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog
> $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
> +	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl
> +$(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
> +
> +list_domains_OBJS = list_domains
> +
> +OCAML_PROGRAM = xtl send_debug_keys list_domains
> 
>  all: $(PROGRAMS)
> 
> diff -r 2b433b1523e4 -r bdd9c3e423d7 tools/ocaml/test/list_domains.ml
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/ocaml/test/list_domains.ml	Tue Nov 20 17:22:21 2012
> +0000
> @@ -0,0 +1,26 @@
> +open Arg
> +open Printf
> +open Xentoollog
> +open Xenlight
> +
> +let bool_as_char b c = if b then c else '-'
> +
> +let print_dominfo dominfo =
> +  let id = dominfo.Xenlight.Dominfo.domid
> +  and running = bool_as_char dominfo.Xenlight.Dominfo.running 'r'
> +  and blocked = bool_as_char dominfo.Xenlight.Dominfo.blocked 'b'
> +  and paused = bool_as_char dominfo.Xenlight.Dominfo.paused 'p'
> +  and shutdown = bool_as_char dominfo.Xenlight.Dominfo.shutdown 's'
> +  and dying = bool_as_char dominfo.Xenlight.Dominfo.dying 'd'
> +  and memory = dominfo.Xenlight.Dominfo.current_memkb
> +  in
> +  printf "Dom %d: %c%c%c%c%c %LdKB\n" id running blocked paused
> +shutdown dying memory
> +
> +let _ =
> +  let logger = Xentoollog.create_stdio_logger
> +(*~level:Xentoollog.Debug*) () in
> +  let ctx = Xenlight.ctx_alloc logger in
> +  let domains = Xenlight.list_domain ctx in
> +  List.iter (fun d -> print_dominfo d) domains;
> +  Xenlight.ctx_free ctx;
> +  Xentoollog.destroy logger;
> +
> diff -r 2b433b1523e4 -r bdd9c3e423d7
> tools/ocaml/test/send_debug_keys.ml
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/ocaml/test/send_debug_keys.ml	Tue Nov 20 17:22:21 2012
> +0000
> @@ -0,0 +1,17 @@
> +open Arg
> +open Printf
> +open Xentoollog
> +open Xenlight
> +
> +let send_keys ctx s =
> +  printf "Sending debug key %s\n" s;
> +  Xenlight.send_debug_keys ctx s;
> +  ()
> +
> +let _ =
> +  let logger = Xentoollog.create_stdio_logger () in
> +  let ctx = Xenlight.ctx_alloc logger in
> +  Arg.parse [
> +  ] (fun s -> send_keys ctx s) "usage: send_debug_keys <keys>";
> +  Xenlight.ctx_free ctx;
> +  Xentoollog.destroy logger
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:58:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:58:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOIV-0002zC-Te; Fri, 30 Nov 2012 10:58:19 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TeOIU-0002yk-D0
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:58:18 +0000
Received: from [193.109.254.147:59089] by server-13.bemta-14.messagelabs.com
	id 19/35-11239-94198B05; Fri, 30 Nov 2012 10:58:17 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1354273087!6473756!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18807 invoked from network); 30 Nov 2012 10:58:09 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 10:58:09 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46148071"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	30 Nov 2012 10:58:07 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 30 Nov 2012 05:58:06 -0500
Message-ID: <50B8913D.40100@citrix.com>
Date: Fri, 30 Nov 2012 10:58:05 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B63CCC02000078000AC34E@nat28.tlf.novell.com>
	<50B8981802000078000ACCFE@nat28.tlf.novell.com>
	<CAFLBxZb7sbeEa8SnikOafzMhsyqnJW52J03dLr2PiUs0TM=-yw@mail.gmail.com>
In-Reply-To: <CAFLBxZb7sbeEa8SnikOafzMhsyqnJW52J03dLr2PiUs0TM=-yw@mail.gmail.com>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/12 10:42, George Dunlap wrote:
> On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich <JBeulich@suse.com 
> <mailto:JBeulich@suse.com>> wrote:
>
>     So I learned a little more meanwhile - it's not that trivial: I'm told
>     the shim uses UEFI services to do the verification, and those
>     services only handle PE images. But we obviously can't reasonably
>     expect the Dom0 kernel to be packaged as PE image, as that
>     would then be unusable as DomU kernel (on older hosts at least,
>     i.e. even if we added a PE loader to libxc).
>
>
> Sorry for the n00b question, but what's a PE image in this context?
I think this refers to the Microsoft PE (portable executable) file 
format - that is, the file should be like a .EXE or .DLL on windows.

I wish I thought I was wrong here, but I'm afraid that MS solutions are 
rather popular in some camps...
Further searching seems to confirm that PE is indeed "standard format" 
for EFI.
http://en.wikipedia.org/wiki/Portable_Executable

--
Mats
>
>  -George
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 10:58:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 10:58:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOIV-0002zC-Te; Fri, 30 Nov 2012 10:58:19 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TeOIU-0002yk-D0
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 10:58:18 +0000
Received: from [193.109.254.147:59089] by server-13.bemta-14.messagelabs.com
	id 19/35-11239-94198B05; Fri, 30 Nov 2012 10:58:17 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1354273087!6473756!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18807 invoked from network); 30 Nov 2012 10:58:09 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 10:58:09 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46148071"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	30 Nov 2012 10:58:07 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 30 Nov 2012 05:58:06 -0500
Message-ID: <50B8913D.40100@citrix.com>
Date: Fri, 30 Nov 2012 10:58:05 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B63CCC02000078000AC34E@nat28.tlf.novell.com>
	<50B8981802000078000ACCFE@nat28.tlf.novell.com>
	<CAFLBxZb7sbeEa8SnikOafzMhsyqnJW52J03dLr2PiUs0TM=-yw@mail.gmail.com>
In-Reply-To: <CAFLBxZb7sbeEa8SnikOafzMhsyqnJW52J03dLr2PiUs0TM=-yw@mail.gmail.com>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/12 10:42, George Dunlap wrote:
> On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich <JBeulich@suse.com 
> <mailto:JBeulich@suse.com>> wrote:
>
>     So I learned a little more meanwhile - it's not that trivial: I'm told
>     the shim uses UEFI services to do the verification, and those
>     services only handle PE images. But we obviously can't reasonably
>     expect the Dom0 kernel to be packaged as PE image, as that
>     would then be unusable as DomU kernel (on older hosts at least,
>     i.e. even if we added a PE loader to libxc).
>
>
> Sorry for the n00b question, but what's a PE image in this context?
I think this refers to the Microsoft PE (portable executable) file 
format - that is, the file should be like a .EXE or .DLL on windows.

I wish I thought I was wrong here, but I'm afraid that MS solutions are 
rather popular in some camps...
Further searching seems to confirm that PE is indeed "standard format" 
for EFI.
http://en.wikipedia.org/wiki/Portable_Executable

--
Mats
>
>  -George
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:05:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:05:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOP9-0003bD-TD; Fri, 30 Nov 2012 11:05:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeOP8-0003b5-F2
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:05:10 +0000
Received: from [85.158.143.35:2818] by server-3.bemta-4.messagelabs.com id
	67/60-06841-5E298B05; Fri, 30 Nov 2012 11:05:09 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1354273472!13126854!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20319 invoked from network); 30 Nov 2012 11:04:33 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 11:04:33 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 11:04:32 +0000
Message-Id: <50B8A10602000078000ACD6A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 11:05:26 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "George Dunlap" <dunlapg@umich.edu>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B63CCC02000078000AC34E@nat28.tlf.novell.com>
	<50B8981802000078000ACCFE@nat28.tlf.novell.com>
	<CAFLBxZb7sbeEa8SnikOafzMhsyqnJW52J03dLr2PiUs0TM=-yw@mail.gmail.com>
In-Reply-To: <CAFLBxZb7sbeEa8SnikOafzMhsyqnJW52J03dLr2PiUs0TM=-yw@mail.gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 11:42, George Dunlap <dunlapg@umich.edu> wrote:
> On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich <JBeulich@suse.com> wrote:
> 
>> So I learned a little more meanwhile - it's not that trivial: I'm told
>> the shim uses UEFI services to do the verification, and those
>> services only handle PE images. But we obviously can't reasonably
>> expect the Dom0 kernel to be packaged as PE image, as that
>> would then be unusable as DomU kernel (on older hosts at least,
>> i.e. even if we added a PE loader to libxc).
>>
> 
> Sorry for the n00b question, but what's a PE image in this context?

"Portable Executable", i.e. the binary format used by Windows
and EFI for their executables.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:05:24 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:05:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOP9-0003bD-TD; Fri, 30 Nov 2012 11:05:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeOP8-0003b5-F2
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:05:10 +0000
Received: from [85.158.143.35:2818] by server-3.bemta-4.messagelabs.com id
	67/60-06841-5E298B05; Fri, 30 Nov 2012 11:05:09 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1354273472!13126854!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20319 invoked from network); 30 Nov 2012 11:04:33 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 11:04:33 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 11:04:32 +0000
Message-Id: <50B8A10602000078000ACD6A@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 11:05:26 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "George Dunlap" <dunlapg@umich.edu>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B63CCC02000078000AC34E@nat28.tlf.novell.com>
	<50B8981802000078000ACCFE@nat28.tlf.novell.com>
	<CAFLBxZb7sbeEa8SnikOafzMhsyqnJW52J03dLr2PiUs0TM=-yw@mail.gmail.com>
In-Reply-To: <CAFLBxZb7sbeEa8SnikOafzMhsyqnJW52J03dLr2PiUs0TM=-yw@mail.gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 11:42, George Dunlap <dunlapg@umich.edu> wrote:
> On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich <JBeulich@suse.com> wrote:
> 
>> So I learned a little more meanwhile - it's not that trivial: I'm told
>> the shim uses UEFI services to do the verification, and those
>> services only handle PE images. But we obviously can't reasonably
>> expect the Dom0 kernel to be packaged as PE image, as that
>> would then be unusable as DomU kernel (on older hosts at least,
>> i.e. even if we added a PE loader to libxc).
>>
> 
> Sorry for the n00b question, but what's a PE image in this context?

"Portable Executable", i.e. the binary format used by Windows
and EFI for their executables.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:10:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:10:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOTq-0003iE-Ks; Fri, 30 Nov 2012 11:10:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TeOTp-0003i3-IS
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:10:01 +0000
Received: from [85.158.143.35:26316] by server-1.bemta-4.messagelabs.com id
	6C/C1-27934-80498B05; Fri, 30 Nov 2012 11:10:00 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1354273773!3940464!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23989 invoked from network); 30 Nov 2012 11:09:35 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:09:35 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="215985996"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 11:08:34 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 06:08:33 -0500
Received: from qabil.uk.xensource.com ([10.80.2.76])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<david.vrabel@citrix.com>)	id 1TeOSP-0000TZ-Hx;
	Fri, 30 Nov 2012 11:08:33 +0000
From: David Vrabel <david.vrabel@citrix.com>
To: <xen-devel@lists.xen.org>
Date: Fri, 30 Nov 2012 11:08:25 +0000
Message-ID: <1354273705-14705-1-git-send-email-david.vrabel@citrix.com>
X-Mailer: git-send-email 1.7.2.5
MIME-Version: 1.0
Cc: Tim Deegan <tim@xen.org>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH] MAINTAINERS: Device tree is maintained by the
	ARM maintainers
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

From: David Vrabel <david.vrabel@citrix.com>

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@citrix.com>
Cc: Tim Deegan <tim@xen.org>

Feel free to adjust the maintainers list as appropriate.
---
 MAINTAINERS |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 68f17a8..88a4c50 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -113,7 +113,9 @@ S:	Supported
 F:	xen/common/cpupool.c
 
 DEVICE TREE
-M:	David Vrabel <david.vrabel@citrix.com>
+M:	Ian Campbell <ian.campbell@citrix.com>
+M:	Stefano Stabellini <stefano.stabellini@citrix.com>
+M:	Tim Deegan <tim@xen.org>
 S:	Supported
 F:	xen/common/libfdt/
 F:	xen/common/device_tree.c
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:10:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:10:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOTq-0003iE-Ks; Fri, 30 Nov 2012 11:10:02 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TeOTp-0003i3-IS
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:10:01 +0000
Received: from [85.158.143.35:26316] by server-1.bemta-4.messagelabs.com id
	6C/C1-27934-80498B05; Fri, 30 Nov 2012 11:10:00 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1354273773!3940464!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23989 invoked from network); 30 Nov 2012 11:09:35 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:09:35 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="215985996"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 11:08:34 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 06:08:33 -0500
Received: from qabil.uk.xensource.com ([10.80.2.76])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<david.vrabel@citrix.com>)	id 1TeOSP-0000TZ-Hx;
	Fri, 30 Nov 2012 11:08:33 +0000
From: David Vrabel <david.vrabel@citrix.com>
To: <xen-devel@lists.xen.org>
Date: Fri, 30 Nov 2012 11:08:25 +0000
Message-ID: <1354273705-14705-1-git-send-email-david.vrabel@citrix.com>
X-Mailer: git-send-email 1.7.2.5
MIME-Version: 1.0
Cc: Tim Deegan <tim@xen.org>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH] MAINTAINERS: Device tree is maintained by the
	ARM maintainers
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

From: David Vrabel <david.vrabel@citrix.com>

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@citrix.com>
Cc: Tim Deegan <tim@xen.org>

Feel free to adjust the maintainers list as appropriate.
---
 MAINTAINERS |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 68f17a8..88a4c50 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -113,7 +113,9 @@ S:	Supported
 F:	xen/common/cpupool.c
 
 DEVICE TREE
-M:	David Vrabel <david.vrabel@citrix.com>
+M:	Ian Campbell <ian.campbell@citrix.com>
+M:	Stefano Stabellini <stefano.stabellini@citrix.com>
+M:	Tim Deegan <tim@xen.org>
 S:	Supported
 F:	xen/common/libfdt/
 F:	xen/common/device_tree.c
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:12:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:12:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOWM-0003q1-DX; Fri, 30 Nov 2012 11:12:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1TeOWJ-0003pl-TP; Fri, 30 Nov 2012 11:12:36 +0000
Received: from [85.158.137.99:56995] by server-11.bemta-3.messagelabs.com id
	C5/A2-19361-E9498B05; Fri, 30 Nov 2012 11:12:30 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354273949!17337729!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26805 invoked from network); 30 Nov 2012 11:12:29 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:12:29 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16088863"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 11:12:29 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Fri, 30 Nov 2012
	11:12:28 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Fri, 30 Nov 2012 11:12:29 +0000
Thread-Topic: [Xen-devel] [PATCH 12 of 15] libxl: ocaml: switch all
	functions over to take a context
Thread-Index: Ac3HRycEPDO0LXuKTtSj49Eq+LkmUwHonaoA
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107B7@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<e4525795eac22c7d199c.1353432212@cosworth.uk.xensource.com>
In-Reply-To: <e4525795eac22c7d199c.1353432212@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 12 of 15] libxl: ocaml: switch all functions
 over to take a context
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> e4525795eac22c7d199ceae8714e95ed660a00c4
> # Parent  bdd9c3e423d7f505f93edf413a92ad7b47ed9e39
> libxl: ocaml: switch all functions over to take a context.
>
> Since the context has a logger we can get rid of the logger built into these
> bindings and use the xentoollog bindings instead.
>
> The gc is of limited use when most things are freed with libxl_FOO_dispose,
> so get rid of that too.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Looks good, apart from one small bug/typo below.
Otherwise:

Acked-by: Rob Hoes <rob.hoes@citrix.com>


> diff -r bdd9c3e423d7 -r e4525795eac2 tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py  Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py  Tue Nov 20 17:22:21 2012 +0000
> @@ -8,23 +8,23 @@ import idl
>  builtins = {
>      "bool":                 ("bool",                   "%(c)s = Bool_val(%(o)s)",
> "Val_bool(%(c)s)" ),
>      "int":                  ("int",                    "%(c)s = Int_val(%(o)s)",
> "Val_int(%(c)s)"  ),
> -    "char *":               ("string",                 "%(c)s = dup_String_val(gc, %(o)s)",
> "caml_copy_string(%(c)s)"),
> +    "char *":               ("string",                 "%(c)s = dup_String_val(%(o)s)",
> "caml_copy_string(%(c)s)"),
>      "libxl_domid":          ("domid",                  "%(c)s = Int_val(%(o)s)",
> "Val_int(%(c)s)"  ),
>      "libxl_devid":          ("devid",                  "%(c)s = Int_val(%(o)s)",
> "Val_int(%(c)s)"  ),
>      "libxl_defbool":        ("bool option",            "%(c)s = Defbool_val(%(o)s)",
> "Val_defbool(%(c)s)" ),
> -    "libxl_uuid":           ("int array",              "Uuid_val(gc, lg, &%(c)s, %(o)s)",
> "Val_uuid(&%(c)s)"),
> -    "libxl_bitmap":         ("bool array",             "Bitmap_val(gc, lg,
> &%(c)s, %(o)s)",   "Val_bitmap(&%(c)s)"),
> -    "libxl_key_value_list": ("(string * string) list", "libxl_key_value_list_val(gc,
> lg, &%(c)s, %(o)s)",                              None),
> -    "libxl_string_list":    ("string list",            "libxl_string_list_val(gc, lg,
> &%(c)s, %(o)s)",                                 "String_list_val(gc, lg, &%(c)s, %(o)s)"),
> -    "libxl_mac":            ("int array",              "Mac_val(gc, lg, &%(c)s, %(o)s)",
> "Val_mac(&%(c)s)"),
> +    "libxl_uuid":           ("int array",              "Uuid_val(&%(c)s, %(o)s)",
> "Val_uuid(&%(c)s)"),
> +    "libxl_bitmap":         ("bool array",             "Bitmap_val(ctx, &%(c)s, %(o)s)",
> "Val_bitmap(&%(c)s)"),
> +    "libxl_key_value_list": ("(string * string) list",
> "libxl_key_value_list_val(&%(c)s, %(o)s)",                              None),
> +    "libxl_string_list":    ("string list",
> "libxl_string_list_val(&%(c)s, %(o)s)",
> "String_list_val(&%(c)s, %(o)s)"),
> +    "libxl_mac":            ("int array",              "Mac_val(&%(c)s, %(o)s)",
> "Val_mac(&%(c)s)"),
>      "libxl_hwcap":          ("int32 array",            None,
> "Val_hwcap(&%(c)s)"),
>      # This is an opaque type
> -    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(gc,
> lg, &%(c)s, %(o)s)",   "Val_cpuid_policy_list(%(c)s)"),
> +    "libxl_cpuid_policy_list": ("Cpuid_policy.t",
> "Cpuid_policy_list_val(&%(c)s, %(o)s)",   "Val_cpuid_policy_list(%(c)s)"),
>      }
>
> -DEVICE_FUNCTIONS = [ ("add",            ["t", "domid", "unit"]),
> -                     ("remove",         ["t", "domid", "unit"]),
> -                     ("destroy",        ["t", "domid", "unit"]),
> +DEVICE_FUNCTIONS = [ ("add",            ["handle", "t", "domid", "unit"]),
> +                     ("remove",         ["handle", "t", "domid", "unit"]),
> +                     ("destroy",        ["handle", "t", "domid", "unit"]),
>                     ]

This must be "ctx", which is the correct type for the libxl_ctx, instead of "handle".
Same just below here.

>
>  functions = { # ( name , [type1,type2,....] ) @@ -33,13 +33,13 @@ functions =
> { # ( name , [type1,type2,..
>      "device_disk":    DEVICE_FUNCTIONS,
>      "device_nic":     DEVICE_FUNCTIONS,
>      "device_pci":     DEVICE_FUNCTIONS,
> -    "physinfo":       [ ("get",            ["unit", "t"]),
> +    "physinfo":       [ ("get",            ["handle", "t"]),
>                        ],
> -    "cputopology":    [ ("get",            ["unit", "t array"]),
> +    "cputopology":    [ ("get",            ["handle", "t array"]),
>                        ],
>      "domain_sched_params":
> -                      [ ("get",            ["domid", "t"]),
> -                        ("set",            ["domid", "t", "unit"]),
> +                      [ ("get",            ["handle", "domid", "t"]),
> +                        ("set",            ["handle", "domid", "t", "unit"]),
>                        ],
>  }
>  def stub_fn_name(ty, name):
> @@ -228,7 +228,7 @@ def c_val(ty, c, o, indent="", parent =
>          for e in ty.values:
>              s += "    case %d: *%s = %s; break;\n" % (n, c, e.name)
>              n += 1
> -        s += "    default: failwith_xl(\"cannot convert value to %s\", lg);
> break;\n" % ty.typename
> +        s += "    default: failwith_xl(\"cannot convert value to %s\");
> break;\n" % ty.typename
>          s += "}"
>      elif isinstance(ty, idl.KeyedUnion):
>          s += "{\n"
> @@ -241,7 +241,7 @@ def c_val(ty, c, o, indent="", parent =
>                                                      parent + ty.keyvar.name,
>                                                      f.enumname)
>              n += 1
> -        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (long)\",
> lg); break;\n" % (parent, ty.keyvar.name)
> +        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (long)\");
> break;\n" % (parent, ty.keyvar.name)
>          s += "\t\t}\n"
>          s += "\t} else {\n"
>          s += "\t\t/* Is block... */\n"
> @@ -257,7 +257,7 @@ def c_val(ty, c, o, indent="", parent =
>                  s += "%s" % c_val(f.type, fexpr, o, indent=indent+"\t\t        ")
>                  s += "break;\n"
>              n += 1
> -        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (block)\",
> lg); break;\n" % (parent, ty.keyvar.name)
> +        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (block)\");
> break;\n" % (parent, ty.keyvar.name)
>          s += "\t\t}\n"
>          s += "\t}\n"
>          s += "}"
> @@ -270,14 +270,14 @@ def c_val(ty, c, o, indent="", parent =
>              s += "%s\n" % c_val(f.type, fexpr, "Field(%s, %d)" % (o,n),
> parent=nparent)
>              n = n + 1
>      else:
> -        s += "%s_val(gc, lg, %s, %s);" % (ty.rawname, ty.pass_arg(c, parent is
> None, passby=idl.PASS_BY_REFERENCE), o)
> +        s += "%s_val(ctx, %s, %s);" % (ty.rawname, ty.pass_arg(c,
> + parent is None, passby=idl.PASS_BY_REFERENCE), o)
>
>      return s.replace("\n", "\n%s" % indent)
>
>  def gen_c_val(ty, indent=""):
>      s = "/* Convert caml value to %s */\n" % ty.rawname
>
> -    s += "static int %s_val (caml_gc *gc, struct caml_logger *lg, %s, value
> v)\n" % (ty.rawname, ty.make_arg("c_val",
> passby=idl.PASS_BY_REFERENCE))
> +    s += "static int %s_val (libxl_ctx *ctx, %s, value v)\n" %
> + (ty.rawname, ty.make_arg("c_val", passby=idl.PASS_BY_REFERENCE))
>      s += "{\n"
>      s += "\tCAMLparam1(v);\n"
>      s += "\n"
> @@ -326,7 +326,7 @@ def ocaml_Val(ty, o, c, indent="", paren
>          for e in ty.values:
>              s += "    case %s: %s = Int_val(%d); break;\n" % (e.name, o, n)
>              n += 1
> -        s += "    default: failwith_xl(\"cannot convert value from %s\", lg);
> break;\n" % ty.typename
> +        s += "    default: failwith_xl(\"cannot convert value from %s\");
> break;\n" % ty.typename
>          s += "}"
>      elif isinstance(ty, idl.KeyedUnion):
>          n = 0
> @@ -347,7 +347,7 @@ def ocaml_Val(ty, o, c, indent="", paren
>                  #s += "\t        %s = caml_alloc(%d,%d);\n" % (o,len(f.type.fields),n)
>              s += "\t        break;\n"
>              n += 1
> -        s += "\t    default: failwith_xl(\"cannot convert value from %s\", lg);
> break;\n" % ty.typename
> +        s += "\t    default: failwith_xl(\"cannot convert value from %s\");
> break;\n" % ty.typename
>          s += "\t}"
>      elif isinstance(ty,idl.Aggregate) and (parent is None or ty.rawname is
> None):
>          s += "{\n"
> @@ -375,14 +375,14 @@ def ocaml_Val(ty, o, c, indent="", paren
>              n = n + 1
>          s += "}"
>      else:
> -        s += "%s = Val_%s(gc, lg, %s);" % (o, ty.rawname, ty.pass_arg(c, parent is
> None))
> +        s += "%s = Val_%s(ctx, %s);" % (o, ty.rawname, ty.pass_arg(c,
> + parent is None))
>
>      return s.replace("\n", "\n%s" % indent).rstrip(indent)
>
>  def gen_Val_ocaml(ty, indent=""):
>      s = "/* Convert %s to a caml value */\n" % ty.rawname
>
> -    s += "static value Val_%s (caml_gc *gc, struct caml_logger *lg, %s)\n" %
> (ty.rawname, ty.make_arg(ty.rawname+"_c"))
> +    s += "static value Val_%s (libxl_ctx *ctx, %s)\n" % (ty.rawname,
> + ty.make_arg(ty.rawname+"_c"))
>      s += "{\n"
>      s += "\tCAMLparam0();\n"
>      s += "\tCAMLlocal1(%s_ocaml);\n" % ty.rawname diff -r bdd9c3e423d7 -r
> e4525795eac2 tools/ocaml/libs/xl/xenlight.ml.in
> --- a/tools/ocaml/libs/xl/xenlight.ml.in      Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight.ml.in      Tue Nov 20 17:22:21 2012
> +0000
> @@ -37,4 +37,4 @@ external send_trigger : domid -> trigger  external
> send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
>  external send_debug_keys : ctx -> string -> unit =
> "stub_xl_send_debug_keys"
>
> -let _ = Callback.register_exception "xl.error" (Error "register_callback")
> +let _ = Callback.register_exception "Xenlight.Error" (Error(""))
> diff -r bdd9c3e423d7 -r e4525795eac2 tools/ocaml/libs/xl/xenlight_stubs.c
> --- a/tools/ocaml/libs/xl/xenlight_stubs.c    Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight_stubs.c    Tue Nov 20 17:22:21 2012
> +0000
> @@ -31,49 +31,7 @@
>
>  #define CTX ((libxl_ctx *)ctx)
>
> -struct caml_logger {
> -     struct xentoollog_logger logger;
> -     int log_offset;
> -     char log_buf[2048];
> -};
> -
> -typedef struct caml_gc {
> -     int offset;
> -     void *ptrs[64];
> -} caml_gc;
> -
> -static void log_vmessage(struct xentoollog_logger *logger,
> xentoollog_level level,
> -                  int errnoval, const char *context, const char *format, va_list al)
> -{
> -     struct caml_logger *ologger = (struct caml_logger *) logger;
> -
> -     ologger->log_offset += vsnprintf(ologger->log_buf + ologger-
> >log_offset,
> -                                      2048 - ologger->log_offset, format, al);
> -}
> -
> -static void log_destroy(struct xentoollog_logger *logger) -{ -}
> -
> -#define INIT_STRUCT() libxl_ctx *ctx; struct caml_logger lg; struct caml_gc
> gc; gc.offset = 0;
> -
> -#define INIT_CTX()  \
> -     lg.logger.vmessage = log_vmessage; \
> -     lg.logger.destroy = log_destroy; \
> -     lg.logger.progress = NULL; \
> -     lg.log_offset = 0; \
> -     memset(&lg.log_buf,0,sizeof(lg.log_buf));       \
> -     caml_enter_blocking_section(); \
> -     ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct
> xentoollog_logger *) &lg); \
> -     if (ret != 0) \
> -             failwith_xl("cannot init context", &lg);
> -
> -#define FREE_CTX()  \
> -     gc_free(&gc); \
> -     caml_leave_blocking_section(); \
> -     libxl_ctx_free(ctx)
> -
> -static char * dup_String_val(caml_gc *gc, value s)
> +static char * dup_String_val(value s)
>  {
>       int len;
>       char *c;
> @@ -81,25 +39,16 @@ static char * dup_String_val(caml_gc *gc
>       c = calloc(len + 1, sizeof(char));
>       if (!c)
>               caml_raise_out_of_memory();
> -     if (gc) gc->ptrs[gc->offset++] = c;
>       memcpy(c, String_val(s), len);
>       return c;
>  }
>
> -static void gc_free(caml_gc *gc)
> +static void failwith_xl(char *fname)
>  {
> -     int i;
> -     for (i = 0; i < gc->offset; i++) {
> -             free(gc->ptrs[i]);
> -     }
> -}
> -
> -static void failwith_xl(char *fname, struct caml_logger *lg) -{
> -     char *s;
> -     s = (lg) ? lg->log_buf : fname;
> -     printf("Error: %s\n", fname);
> -     caml_raise_with_string(*caml_named_value("xl.error"), s);
> +     value *exc = caml_named_value("Xenlight.Error");
> +     if (!exc)
> +             caml_invalid_argument("Exception Xenlight.Error not
> initialized, please link xl.cma");
> +     caml_raise_with_string(*exc, fname);
>  }
>
>  CAMLprim value stub_libxl_ctx_alloc(value logger) @@ -111,7 +60,7 @@
> CAMLprim value stub_libxl_ctx_alloc(valu
>       caml_enter_blocking_section();
>       ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct
> xentoollog_logger *) logger);
>       if (ret != 0) \
> -             failwith_xl("cannot init context", NULL);
> +             failwith_xl("cannot init context");
>       caml_leave_blocking_section();
>       CAMLreturn((value)ctx);
>  }
> @@ -127,16 +76,6 @@ CAMLprim value stub_libxl_ctx_free(value
>       CAMLreturn(Val_unit);
>  }
>
> -static void * gc_calloc(caml_gc *gc, size_t nmemb, size_t size) -{
> -     void *ptr;
> -     ptr = calloc(nmemb, size);
> -     if (!ptr)
> -             caml_raise_out_of_memory();
> -     gc->ptrs[gc->offset++] = ptr;
> -     return ptr;
> -}
> -
>  static int list_len(value v)
>  {
>       int len = 0;
> @@ -147,8 +86,7 @@ static int list_len(value v)
>       return len;
>  }
>
> -static int libxl_key_value_list_val(caml_gc *gc, struct caml_logger *lg,
> -                                 libxl_key_value_list *c_val,
> +static int libxl_key_value_list_val(libxl_key_value_list *c_val,
>                                   value v)
>  {
>       CAMLparam1(v);
> @@ -158,24 +96,22 @@ static int libxl_key_value_list_val(caml
>
>       nr = list_len(v);
>
> -     array = gc_calloc(gc, (nr + 1) * 2, sizeof(char *));
> +     array = calloc((nr + 1) * 2, sizeof(char *));
>       if (!array)
>               caml_raise_out_of_memory();
>
>       for (i=0; v != Val_emptylist; i++, v = Field(v, 1) ) {
>               elem = Field(v, 0);
>
> -             array[i * 2] = dup_String_val(gc, Field(elem, 0));
> -             array[i * 2 + 1] = dup_String_val(gc, Field(elem, 1));
> +             array[i * 2] = dup_String_val(Field(elem, 0));
> +             array[i * 2 + 1] = dup_String_val(Field(elem, 1));
>       }
>
>       *c_val = array;
>       CAMLreturn(0);
>  }
>
> -static int libxl_string_list_val(caml_gc *gc, struct caml_logger *lg,
> -                              libxl_string_list *c_val,
> -                              value v)
> +static int libxl_string_list_val(libxl_string_list *c_val, value v)
>  {
>       CAMLparam1(v);
>       int nr, i;
> @@ -183,12 +119,12 @@ static int libxl_string_list_val(caml_gc
>
>       nr = list_len(v);
>
> -     array = gc_calloc(gc, (nr + 1), sizeof(char *));
> +     array = calloc(nr + 1, sizeof(char *));
>       if (!array)
>               caml_raise_out_of_memory();
>
>       for (i=0; v != Val_emptylist; i++, v = Field(v, 1) )
> -             array[i] = dup_String_val(gc, Field(v, 0));
> +             array[i] = dup_String_val(Field(v, 0));
>
>       *c_val = array;
>       CAMLreturn(0);
> @@ -221,7 +157,7 @@ static value Val_mac (libxl_mac *c_val)
>       CAMLreturn(v);
>  }
>
> -static int Mac_val(caml_gc *gc, struct caml_logger *lg, libxl_mac *c_val,
> value v)
> +static int Mac_val(libxl_mac *c_val, value v)
>  {
>       CAMLparam1(v);
>       int i;
> @@ -248,10 +184,20 @@ static value Val_bitmap (libxl_bitmap *c
>       CAMLreturn(v);
>  }
>
> -static int Bitmap_val(caml_gc *gc, struct caml_logger *lg,
> -                   libxl_bitmap *c_val, value v)
> +static int Bitmap_val(libxl_ctx *ctx, libxl_bitmap *c_val, value v)
>  {
> -     abort(); /* XXX */
> +     CAMLparam1(v);
> +     int i, len = Wosize_val(v);
> +
> +     if (!libxl_bitmap_alloc(ctx, c_val, len))
> +             failwith_xl("cannot allocate bitmap");
> +     for (i=0; i<len; i++) {
> +             if (Int_val(Field(v, i)))
> +                     libxl_bitmap_set(c_val, i);
> +             else
> +                     libxl_bitmap_reset(c_val, i);
> +     }
> +     CAMLreturn(0);
>  }
>
>  static value Val_cpuid_policy_list(libxl_cpuid_policy_list c_val) @@ -261,8
> +207,7 @@ static value Val_cpuid_policy_list(libxl
>       CAMLreturn((value)c_val);
>  }
>
> -static int Cpuid_policy_list_val(caml_gc *gc, struct caml_logger *lg,
> -                              libxl_cpuid_policy_list *c_val, value v)
> +static int Cpuid_policy_list_val(libxl_cpuid_policy_list *c_val, value
> +v)
>  {
>       CAMLparam1(v);
>
> @@ -287,7 +232,7 @@ static value Val_uuid (libxl_uuid *c_val
>       CAMLreturn(v);
>  }
>
> -static int Uuid_val(caml_gc *gc, struct caml_logger *lg, libxl_uuid *c_val,
> value v)
> +static int Uuid_val(libxl_uuid *c_val, value v)
>  {
>       CAMLparam1(v);
>       int i;
> @@ -345,14 +290,12 @@ value stub_libxl_list_domain(value ctx)  {
>       CAMLparam1(ctx);
>       CAMLlocal2( cli, cons );
> -     struct caml_gc gc;
>       libxl_dominfo *info;
>       int i, nr;
>
> -     gc.offset = 0;
>       info = libxl_list_domain(CTX, &nr);
>       if (info == NULL)
> -             failwith_xl("list_domain", NULL);
> +             failwith_xl("list_domain");
>
>       cli = Val_emptylist;
>
> @@ -360,7 +303,7 @@ value stub_libxl_list_domain(value ctx)
>               cons = caml_alloc(2, 0);
>
>               /* Head */
> -             Store_field(cons, 0, Val_dominfo(&gc, NULL, &info[i]));
> +             Store_field(cons, 0, Val_dominfo(CTX, &info[i]));
>               /* Tail */
>               Store_field(cons, 1, cli);
>
> @@ -369,259 +312,77 @@ value stub_libxl_list_domain(value ctx)
>
>       libxl_dominfo_list_free(info, nr);
>
> -     gc_free(&gc);
> -
>       CAMLreturn(cli);
>  }
>
> -value stub_xl_device_disk_add(value info, value domid) -{
> -     CAMLparam2(info, domid);
> -     libxl_device_disk c_info;
> -     int ret;
> -     INIT_STRUCT();
> +#define _STRINGIFY(x) #x
> +#define STRINGIFY(x) _STRINGIFY(x)
>
> -     device_disk_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_disk_add(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("disk_add", &lg);
> -     FREE_CTX();
> -     CAMLreturn(Val_unit);
> +#define _DEVICE_ADDREMOVE(type,op)
>       \
> +value stub_xl_device_##type##_##op(value ctx, value info, value domid)
>       \
> +{                                                                    \
> +     CAMLparam3(ctx, info, domid);
>       \
> +     libxl_device_##type c_info;                                     \
> +     int ret, marker_var;                                            \
> +                                                                     \
> +     device_##type##_val(CTX, &c_info, info);                        \
> +                                                                     \
> +     ret = libxl_device_##type##_##op(CTX, Int_val(domid), &c_info, 0); \
> +                                                                     \
> +     libxl_device_##type##_dispose(&c_info);
>       \
> +                                                                     \
> +     if (ret != 0)                                                   \
> +             failwith_xl(STRINGIFY(type) "_" STRINGIFY(op));
>       \
> +                                                                     \
> +     CAMLreturn(Val_unit);                                           \
>  }
>
> -value stub_xl_device_disk_del(value info, value domid)
> +#define DEVICE_ADDREMOVE(type) \
> +     _DEVICE_ADDREMOVE(type, add) \
> +     _DEVICE_ADDREMOVE(type, remove) \
> +     _DEVICE_ADDREMOVE(type, destroy)
> +
> +DEVICE_ADDREMOVE(disk)
> +DEVICE_ADDREMOVE(nic)
> +DEVICE_ADDREMOVE(vfb)
> +DEVICE_ADDREMOVE(vkb)
> +DEVICE_ADDREMOVE(pci)
> +
> +value stub_xl_physinfo_get(value ctx)
>  {
> -     CAMLparam2(info, domid);
> -     libxl_device_disk c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_disk_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_disk_remove(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("disk_del", &lg);
> -     FREE_CTX();
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_nic_add(value info, value domid) -{
> -     CAMLparam2(info, domid);
> -     libxl_device_nic c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_nic_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_nic_add(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("nic_add", &lg);
> -     FREE_CTX();
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_nic_del(value info, value domid) -{
> -     CAMLparam2(info, domid);
> -     libxl_device_nic c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_nic_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_nic_remove(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("nic_del", &lg);
> -     FREE_CTX();
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_vkb_add(value info, value domid) -{
> -     CAMLparam2(info, domid);
> -     libxl_device_vkb c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_vkb_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_vkb_add(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("vkb_add", &lg);
> -     FREE_CTX();
> -
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_vkb_remove(value info, value domid) -{
> -     CAMLparam1(domid);
> -     libxl_device_vkb c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_vkb_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_vkb_remove(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("vkb_clean_shutdown", &lg);
> -     FREE_CTX();
> -
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_vkb_destroy(value info, value domid) -{
> -     CAMLparam1(domid);
> -     libxl_device_vkb c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_vkb_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_vkb_destroy(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("vkb_hard_shutdown", &lg);
> -     FREE_CTX();
> -
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_vfb_add(value info, value domid) -{
> -     CAMLparam2(info, domid);
> -     libxl_device_vfb c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_vfb_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_vfb_add(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("vfb_add", &lg);
> -     FREE_CTX();
> -
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_vfb_remove(value info, value domid) -{
> -     CAMLparam1(domid);
> -     libxl_device_vfb c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_vfb_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_vfb_remove(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("vfb_clean_shutdown", &lg);
> -     FREE_CTX();
> -
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_vfb_destroy(value info, value domid) -{
> -     CAMLparam1(domid);
> -     libxl_device_vfb c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_vfb_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_vfb_destroy(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("vfb_hard_shutdown", &lg);
> -     FREE_CTX();
> -
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_pci_add(value info, value domid) -{
> -     CAMLparam2(info, domid);
> -     libxl_device_pci c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_pci_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_pci_add(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("pci_add", &lg);
> -     FREE_CTX();
> -
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_pci_remove(value info, value domid) -{
> -     CAMLparam2(info, domid);
> -     libxl_device_pci c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_pci_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_pci_remove(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("pci_remove", &lg);
> -     FREE_CTX();
> -
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_physinfo_get(value unit)
> -{
> -     CAMLparam1(unit);
> +     CAMLparam1(ctx);
>       CAMLlocal1(physinfo);
>       libxl_physinfo c_physinfo;
>       int ret;
> -     INIT_STRUCT();
>
> -     INIT_CTX();
> -     ret = libxl_get_physinfo(ctx, &c_physinfo);
> +     ret = libxl_get_physinfo(CTX, &c_physinfo);
> +
>       if (ret != 0)
> -             failwith_xl("physinfo", &lg);
> -     FREE_CTX();
> +             failwith_xl("get_physinfo");
>
> -     physinfo = Val_physinfo(&gc, &lg, &c_physinfo);
> +     physinfo = Val_physinfo(CTX, &c_physinfo);
> +
> +     libxl_physinfo_dispose(&c_physinfo);
> +
>       CAMLreturn(physinfo);
>  }
>
> -value stub_xl_cputopology_get(value unit)
> +value stub_xl_cputopology_get(value ctx)
>  {
> -     CAMLparam1(unit);
> +     CAMLparam1(ctx);
>       CAMLlocal2(topology, v);
>       libxl_cputopology *c_topology;
> -     int i, nr, ret;
> -     INIT_STRUCT();
> +     int i, nr;
>
> -     INIT_CTX();
> +     c_topology = libxl_get_cpu_topology(CTX, &nr);
>
> -     c_topology = libxl_get_cpu_topology(ctx, &nr);
> -     if (ret != 0)
> -             failwith_xl("topologyinfo", &lg);
> +     if (!c_topology)
> +             failwith_xl("topologyinfo");
>
>       topology = caml_alloc_tuple(nr);
>       for (i = 0; i < nr; i++) {
>               if (c_topology[i].core !=
> LIBXL_CPUTOPOLOGY_INVALID_ENTRY)
> -                     v = Val_some(Val_cputopology(&gc, &lg,
> &c_topology[i]));
> +                     v = Val_some(Val_cputopology(CTX,
> &c_topology[i]));
>               else
>                       v = Val_none;
>               Store_field(topology, i, v);
> @@ -629,74 +390,72 @@ value stub_xl_cputopology_get(value unit
>
>       libxl_cputopology_list_free(c_topology, nr);
>
> -     FREE_CTX();
>       CAMLreturn(topology);
>  }
>
> -value stub_xl_domain_sched_params_get(value domid)
> +value stub_xl_domain_sched_params_get(value ctx, value domid)
>  {
> -     CAMLparam1(domid);
> +     CAMLparam2(ctx, domid);
>       CAMLlocal1(scinfo);
>       libxl_domain_sched_params c_scinfo;
>       int ret;
> -     INIT_STRUCT();
>
> -     INIT_CTX();
> -     ret = libxl_domain_sched_params_get(ctx, Int_val(domid),
> &c_scinfo);
> +     ret = libxl_domain_sched_params_get(CTX, Int_val(domid),
> &c_scinfo);
>       if (ret != 0)
> -             failwith_xl("domain_sched_params_get", &lg);
> -     FREE_CTX();
> +             failwith_xl("domain_sched_params_get");
>
> -     scinfo = Val_domain_sched_params(&gc, &lg, &c_scinfo);
> +     scinfo = Val_domain_sched_params(CTX, &c_scinfo);
> +
> +     libxl_domain_sched_params_dispose(&c_scinfo);
> +
>       CAMLreturn(scinfo);
>  }
>
> -value stub_xl_domain_sched_params_set(value domid, value scinfo)
> +value stub_xl_domain_sched_params_set(value ctx, value domid, value
> +scinfo)
>  {
> -     CAMLparam2(domid, scinfo);
> +     CAMLparam3(ctx, domid, scinfo);
>       libxl_domain_sched_params c_scinfo;
>       int ret;
> -     INIT_STRUCT();
>
> -     domain_sched_params_val(&gc, &lg, &c_scinfo, scinfo);
> +     domain_sched_params_val(CTX, &c_scinfo, scinfo);
>
> -     INIT_CTX();
> -     ret = libxl_domain_sched_params_set(ctx, Int_val(domid),
> &c_scinfo);
> +     ret = libxl_domain_sched_params_set(CTX, Int_val(domid),
> &c_scinfo);
> +
> +     libxl_domain_sched_params_dispose(&c_scinfo);
> +
>       if (ret != 0)
> -             failwith_xl("domain_sched_params_set", &lg);
> -     FREE_CTX();
> +             failwith_xl("domain_sched_params_set");
>
>       CAMLreturn(Val_unit);
>  }
>
> -value stub_xl_send_trigger(value domid, value trigger, value vcpuid)
> +value stub_xl_send_trigger(value ctx, value domid, value trigger, value
> +vcpuid)
>  {
> -     CAMLparam3(domid, trigger, vcpuid);
> +     CAMLparam4(ctx, domid, trigger, vcpuid);
>       int ret;
>       libxl_trigger c_trigger = LIBXL_TRIGGER_UNKNOWN;
> -     INIT_STRUCT();
>
> -     trigger_val(&gc, &lg, &c_trigger, trigger);
> +     trigger_val(CTX, &c_trigger, trigger);
>
> -     INIT_CTX();
> -     ret = libxl_send_trigger(ctx, Int_val(domid), c_trigger,
> Int_val(vcpuid));
> +     ret = libxl_send_trigger(CTX, Int_val(domid),
> +                              c_trigger, Int_val(vcpuid));
> +
>       if (ret != 0)
> -             failwith_xl("send_trigger", &lg);
> -     FREE_CTX();
> +             failwith_xl("send_trigger");
> +
>       CAMLreturn(Val_unit);
>  }
>
> -value stub_xl_send_sysrq(value domid, value sysrq)
> +value stub_xl_send_sysrq(value ctx, value domid, value sysrq)
>  {
> -     CAMLparam2(domid, sysrq);
> +     CAMLparam3(ctx, domid, sysrq);
>       int ret;
> -     INIT_STRUCT();
>
> -     INIT_CTX();
> -     ret = libxl_send_sysrq(ctx, Int_val(domid), Int_val(sysrq));
> +     ret = libxl_send_sysrq(CTX, Int_val(domid), Int_val(sysrq));
> +
>       if (ret != 0)
> -             failwith_xl("send_sysrq", &lg);
> -     FREE_CTX();
> +             failwith_xl("send_sysrq");
> +
>       CAMLreturn(Val_unit);
>  }
>
> @@ -706,11 +465,11 @@ value stub_xl_send_debug_keys(value ctx,
>       int ret;
>       char *c_keys;
>
> -     c_keys = dup_String_val(NULL, keys);
> +     c_keys = dup_String_val(keys);
>
>       ret = libxl_send_debug_keys(CTX, c_keys);
>       if (ret != 0)
> -             failwith_xl("send_debug_keys", NULL);
> +             failwith_xl("send_debug_keys");
>
>       free(c_keys);
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:12:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:12:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOWM-0003q1-DX; Fri, 30 Nov 2012 11:12:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1TeOWJ-0003pl-TP; Fri, 30 Nov 2012 11:12:36 +0000
Received: from [85.158.137.99:56995] by server-11.bemta-3.messagelabs.com id
	C5/A2-19361-E9498B05; Fri, 30 Nov 2012 11:12:30 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354273949!17337729!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26805 invoked from network); 30 Nov 2012 11:12:29 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:12:29 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16088863"
Received: from lonpmailmx02.citrite.net ([10.30.203.163])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 11:12:29 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX02.citrite.net ([10.30.203.163]) with mapi; Fri, 30 Nov 2012
	11:12:28 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Fri, 30 Nov 2012 11:12:29 +0000
Thread-Topic: [Xen-devel] [PATCH 12 of 15] libxl: ocaml: switch all
	functions over to take a context
Thread-Index: Ac3HRycEPDO0LXuKTtSj49Eq+LkmUwHonaoA
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107B7@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<e4525795eac22c7d199c.1353432212@cosworth.uk.xensource.com>
In-Reply-To: <e4525795eac22c7d199c.1353432212@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 12 of 15] libxl: ocaml: switch all functions
 over to take a context
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> e4525795eac22c7d199ceae8714e95ed660a00c4
> # Parent  bdd9c3e423d7f505f93edf413a92ad7b47ed9e39
> libxl: ocaml: switch all functions over to take a context.
>
> Since the context has a logger we can get rid of the logger built into these
> bindings and use the xentoollog bindings instead.
>
> The gc is of limited use when most things are freed with libxl_FOO_dispose,
> so get rid of that too.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Looks good, apart from one small bug/typo below.
Otherwise:

Acked-by: Rob Hoes <rob.hoes@citrix.com>


> diff -r bdd9c3e423d7 -r e4525795eac2 tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py  Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py  Tue Nov 20 17:22:21 2012 +0000
> @@ -8,23 +8,23 @@ import idl
>  builtins = {
>      "bool":                 ("bool",                   "%(c)s = Bool_val(%(o)s)",
> "Val_bool(%(c)s)" ),
>      "int":                  ("int",                    "%(c)s = Int_val(%(o)s)",
> "Val_int(%(c)s)"  ),
> -    "char *":               ("string",                 "%(c)s = dup_String_val(gc, %(o)s)",
> "caml_copy_string(%(c)s)"),
> +    "char *":               ("string",                 "%(c)s = dup_String_val(%(o)s)",
> "caml_copy_string(%(c)s)"),
>      "libxl_domid":          ("domid",                  "%(c)s = Int_val(%(o)s)",
> "Val_int(%(c)s)"  ),
>      "libxl_devid":          ("devid",                  "%(c)s = Int_val(%(o)s)",
> "Val_int(%(c)s)"  ),
>      "libxl_defbool":        ("bool option",            "%(c)s = Defbool_val(%(o)s)",
> "Val_defbool(%(c)s)" ),
> -    "libxl_uuid":           ("int array",              "Uuid_val(gc, lg, &%(c)s, %(o)s)",
> "Val_uuid(&%(c)s)"),
> -    "libxl_bitmap":         ("bool array",             "Bitmap_val(gc, lg,
> &%(c)s, %(o)s)",   "Val_bitmap(&%(c)s)"),
> -    "libxl_key_value_list": ("(string * string) list", "libxl_key_value_list_val(gc,
> lg, &%(c)s, %(o)s)",                              None),
> -    "libxl_string_list":    ("string list",            "libxl_string_list_val(gc, lg,
> &%(c)s, %(o)s)",                                 "String_list_val(gc, lg, &%(c)s, %(o)s)"),
> -    "libxl_mac":            ("int array",              "Mac_val(gc, lg, &%(c)s, %(o)s)",
> "Val_mac(&%(c)s)"),
> +    "libxl_uuid":           ("int array",              "Uuid_val(&%(c)s, %(o)s)",
> "Val_uuid(&%(c)s)"),
> +    "libxl_bitmap":         ("bool array",             "Bitmap_val(ctx, &%(c)s, %(o)s)",
> "Val_bitmap(&%(c)s)"),
> +    "libxl_key_value_list": ("(string * string) list",
> "libxl_key_value_list_val(&%(c)s, %(o)s)",                              None),
> +    "libxl_string_list":    ("string list",
> "libxl_string_list_val(&%(c)s, %(o)s)",
> "String_list_val(&%(c)s, %(o)s)"),
> +    "libxl_mac":            ("int array",              "Mac_val(&%(c)s, %(o)s)",
> "Val_mac(&%(c)s)"),
>      "libxl_hwcap":          ("int32 array",            None,
> "Val_hwcap(&%(c)s)"),
>      # This is an opaque type
> -    "libxl_cpuid_policy_list": ("Cpuid_policy.t",      "Cpuid_policy_list_val(gc,
> lg, &%(c)s, %(o)s)",   "Val_cpuid_policy_list(%(c)s)"),
> +    "libxl_cpuid_policy_list": ("Cpuid_policy.t",
> "Cpuid_policy_list_val(&%(c)s, %(o)s)",   "Val_cpuid_policy_list(%(c)s)"),
>      }
>
> -DEVICE_FUNCTIONS = [ ("add",            ["t", "domid", "unit"]),
> -                     ("remove",         ["t", "domid", "unit"]),
> -                     ("destroy",        ["t", "domid", "unit"]),
> +DEVICE_FUNCTIONS = [ ("add",            ["handle", "t", "domid", "unit"]),
> +                     ("remove",         ["handle", "t", "domid", "unit"]),
> +                     ("destroy",        ["handle", "t", "domid", "unit"]),
>                     ]

This must be "ctx", which is the correct type for the libxl_ctx, instead of "handle".
Same just below here.

>
>  functions = { # ( name , [type1,type2,....] ) @@ -33,13 +33,13 @@ functions =
> { # ( name , [type1,type2,..
>      "device_disk":    DEVICE_FUNCTIONS,
>      "device_nic":     DEVICE_FUNCTIONS,
>      "device_pci":     DEVICE_FUNCTIONS,
> -    "physinfo":       [ ("get",            ["unit", "t"]),
> +    "physinfo":       [ ("get",            ["handle", "t"]),
>                        ],
> -    "cputopology":    [ ("get",            ["unit", "t array"]),
> +    "cputopology":    [ ("get",            ["handle", "t array"]),
>                        ],
>      "domain_sched_params":
> -                      [ ("get",            ["domid", "t"]),
> -                        ("set",            ["domid", "t", "unit"]),
> +                      [ ("get",            ["handle", "domid", "t"]),
> +                        ("set",            ["handle", "domid", "t", "unit"]),
>                        ],
>  }
>  def stub_fn_name(ty, name):
> @@ -228,7 +228,7 @@ def c_val(ty, c, o, indent="", parent =
>          for e in ty.values:
>              s += "    case %d: *%s = %s; break;\n" % (n, c, e.name)
>              n += 1
> -        s += "    default: failwith_xl(\"cannot convert value to %s\", lg);
> break;\n" % ty.typename
> +        s += "    default: failwith_xl(\"cannot convert value to %s\");
> break;\n" % ty.typename
>          s += "}"
>      elif isinstance(ty, idl.KeyedUnion):
>          s += "{\n"
> @@ -241,7 +241,7 @@ def c_val(ty, c, o, indent="", parent =
>                                                      parent + ty.keyvar.name,
>                                                      f.enumname)
>              n += 1
> -        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (long)\",
> lg); break;\n" % (parent, ty.keyvar.name)
> +        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (long)\");
> break;\n" % (parent, ty.keyvar.name)
>          s += "\t\t}\n"
>          s += "\t} else {\n"
>          s += "\t\t/* Is block... */\n"
> @@ -257,7 +257,7 @@ def c_val(ty, c, o, indent="", parent =
>                  s += "%s" % c_val(f.type, fexpr, o, indent=indent+"\t\t        ")
>                  s += "break;\n"
>              n += 1
> -        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (block)\",
> lg); break;\n" % (parent, ty.keyvar.name)
> +        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (block)\");
> break;\n" % (parent, ty.keyvar.name)
>          s += "\t\t}\n"
>          s += "\t}\n"
>          s += "}"
> @@ -270,14 +270,14 @@ def c_val(ty, c, o, indent="", parent =
>              s += "%s\n" % c_val(f.type, fexpr, "Field(%s, %d)" % (o,n),
> parent=nparent)
>              n = n + 1
>      else:
> -        s += "%s_val(gc, lg, %s, %s);" % (ty.rawname, ty.pass_arg(c, parent is
> None, passby=idl.PASS_BY_REFERENCE), o)
> +        s += "%s_val(ctx, %s, %s);" % (ty.rawname, ty.pass_arg(c,
> + parent is None, passby=idl.PASS_BY_REFERENCE), o)
>
>      return s.replace("\n", "\n%s" % indent)
>
>  def gen_c_val(ty, indent=""):
>      s = "/* Convert caml value to %s */\n" % ty.rawname
>
> -    s += "static int %s_val (caml_gc *gc, struct caml_logger *lg, %s, value
> v)\n" % (ty.rawname, ty.make_arg("c_val",
> passby=idl.PASS_BY_REFERENCE))
> +    s += "static int %s_val (libxl_ctx *ctx, %s, value v)\n" %
> + (ty.rawname, ty.make_arg("c_val", passby=idl.PASS_BY_REFERENCE))
>      s += "{\n"
>      s += "\tCAMLparam1(v);\n"
>      s += "\n"
> @@ -326,7 +326,7 @@ def ocaml_Val(ty, o, c, indent="", paren
>          for e in ty.values:
>              s += "    case %s: %s = Int_val(%d); break;\n" % (e.name, o, n)
>              n += 1
> -        s += "    default: failwith_xl(\"cannot convert value from %s\", lg);
> break;\n" % ty.typename
> +        s += "    default: failwith_xl(\"cannot convert value from %s\");
> break;\n" % ty.typename
>          s += "}"
>      elif isinstance(ty, idl.KeyedUnion):
>          n = 0
> @@ -347,7 +347,7 @@ def ocaml_Val(ty, o, c, indent="", paren
>                  #s += "\t        %s = caml_alloc(%d,%d);\n" % (o,len(f.type.fields),n)
>              s += "\t        break;\n"
>              n += 1
> -        s += "\t    default: failwith_xl(\"cannot convert value from %s\", lg);
> break;\n" % ty.typename
> +        s += "\t    default: failwith_xl(\"cannot convert value from %s\");
> break;\n" % ty.typename
>          s += "\t}"
>      elif isinstance(ty,idl.Aggregate) and (parent is None or ty.rawname is
> None):
>          s += "{\n"
> @@ -375,14 +375,14 @@ def ocaml_Val(ty, o, c, indent="", paren
>              n = n + 1
>          s += "}"
>      else:
> -        s += "%s = Val_%s(gc, lg, %s);" % (o, ty.rawname, ty.pass_arg(c, parent is
> None))
> +        s += "%s = Val_%s(ctx, %s);" % (o, ty.rawname, ty.pass_arg(c,
> + parent is None))
>
>      return s.replace("\n", "\n%s" % indent).rstrip(indent)
>
>  def gen_Val_ocaml(ty, indent=""):
>      s = "/* Convert %s to a caml value */\n" % ty.rawname
>
> -    s += "static value Val_%s (caml_gc *gc, struct caml_logger *lg, %s)\n" %
> (ty.rawname, ty.make_arg(ty.rawname+"_c"))
> +    s += "static value Val_%s (libxl_ctx *ctx, %s)\n" % (ty.rawname,
> + ty.make_arg(ty.rawname+"_c"))
>      s += "{\n"
>      s += "\tCAMLparam0();\n"
>      s += "\tCAMLlocal1(%s_ocaml);\n" % ty.rawname diff -r bdd9c3e423d7 -r
> e4525795eac2 tools/ocaml/libs/xl/xenlight.ml.in
> --- a/tools/ocaml/libs/xl/xenlight.ml.in      Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight.ml.in      Tue Nov 20 17:22:21 2012
> +0000
> @@ -37,4 +37,4 @@ external send_trigger : domid -> trigger  external
> send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
>  external send_debug_keys : ctx -> string -> unit =
> "stub_xl_send_debug_keys"
>
> -let _ = Callback.register_exception "xl.error" (Error "register_callback")
> +let _ = Callback.register_exception "Xenlight.Error" (Error(""))
> diff -r bdd9c3e423d7 -r e4525795eac2 tools/ocaml/libs/xl/xenlight_stubs.c
> --- a/tools/ocaml/libs/xl/xenlight_stubs.c    Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight_stubs.c    Tue Nov 20 17:22:21 2012
> +0000
> @@ -31,49 +31,7 @@
>
>  #define CTX ((libxl_ctx *)ctx)
>
> -struct caml_logger {
> -     struct xentoollog_logger logger;
> -     int log_offset;
> -     char log_buf[2048];
> -};
> -
> -typedef struct caml_gc {
> -     int offset;
> -     void *ptrs[64];
> -} caml_gc;
> -
> -static void log_vmessage(struct xentoollog_logger *logger,
> xentoollog_level level,
> -                  int errnoval, const char *context, const char *format, va_list al)
> -{
> -     struct caml_logger *ologger = (struct caml_logger *) logger;
> -
> -     ologger->log_offset += vsnprintf(ologger->log_buf + ologger-
> >log_offset,
> -                                      2048 - ologger->log_offset, format, al);
> -}
> -
> -static void log_destroy(struct xentoollog_logger *logger) -{ -}
> -
> -#define INIT_STRUCT() libxl_ctx *ctx; struct caml_logger lg; struct caml_gc
> gc; gc.offset = 0;
> -
> -#define INIT_CTX()  \
> -     lg.logger.vmessage = log_vmessage; \
> -     lg.logger.destroy = log_destroy; \
> -     lg.logger.progress = NULL; \
> -     lg.log_offset = 0; \
> -     memset(&lg.log_buf,0,sizeof(lg.log_buf));       \
> -     caml_enter_blocking_section(); \
> -     ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct
> xentoollog_logger *) &lg); \
> -     if (ret != 0) \
> -             failwith_xl("cannot init context", &lg);
> -
> -#define FREE_CTX()  \
> -     gc_free(&gc); \
> -     caml_leave_blocking_section(); \
> -     libxl_ctx_free(ctx)
> -
> -static char * dup_String_val(caml_gc *gc, value s)
> +static char * dup_String_val(value s)
>  {
>       int len;
>       char *c;
> @@ -81,25 +39,16 @@ static char * dup_String_val(caml_gc *gc
>       c = calloc(len + 1, sizeof(char));
>       if (!c)
>               caml_raise_out_of_memory();
> -     if (gc) gc->ptrs[gc->offset++] = c;
>       memcpy(c, String_val(s), len);
>       return c;
>  }
>
> -static void gc_free(caml_gc *gc)
> +static void failwith_xl(char *fname)
>  {
> -     int i;
> -     for (i = 0; i < gc->offset; i++) {
> -             free(gc->ptrs[i]);
> -     }
> -}
> -
> -static void failwith_xl(char *fname, struct caml_logger *lg) -{
> -     char *s;
> -     s = (lg) ? lg->log_buf : fname;
> -     printf("Error: %s\n", fname);
> -     caml_raise_with_string(*caml_named_value("xl.error"), s);
> +     value *exc = caml_named_value("Xenlight.Error");
> +     if (!exc)
> +             caml_invalid_argument("Exception Xenlight.Error not
> initialized, please link xl.cma");
> +     caml_raise_with_string(*exc, fname);
>  }
>
>  CAMLprim value stub_libxl_ctx_alloc(value logger) @@ -111,7 +60,7 @@
> CAMLprim value stub_libxl_ctx_alloc(valu
>       caml_enter_blocking_section();
>       ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct
> xentoollog_logger *) logger);
>       if (ret != 0) \
> -             failwith_xl("cannot init context", NULL);
> +             failwith_xl("cannot init context");
>       caml_leave_blocking_section();
>       CAMLreturn((value)ctx);
>  }
> @@ -127,16 +76,6 @@ CAMLprim value stub_libxl_ctx_free(value
>       CAMLreturn(Val_unit);
>  }
>
> -static void * gc_calloc(caml_gc *gc, size_t nmemb, size_t size) -{
> -     void *ptr;
> -     ptr = calloc(nmemb, size);
> -     if (!ptr)
> -             caml_raise_out_of_memory();
> -     gc->ptrs[gc->offset++] = ptr;
> -     return ptr;
> -}
> -
>  static int list_len(value v)
>  {
>       int len = 0;
> @@ -147,8 +86,7 @@ static int list_len(value v)
>       return len;
>  }
>
> -static int libxl_key_value_list_val(caml_gc *gc, struct caml_logger *lg,
> -                                 libxl_key_value_list *c_val,
> +static int libxl_key_value_list_val(libxl_key_value_list *c_val,
>                                   value v)
>  {
>       CAMLparam1(v);
> @@ -158,24 +96,22 @@ static int libxl_key_value_list_val(caml
>
>       nr = list_len(v);
>
> -     array = gc_calloc(gc, (nr + 1) * 2, sizeof(char *));
> +     array = calloc((nr + 1) * 2, sizeof(char *));
>       if (!array)
>               caml_raise_out_of_memory();
>
>       for (i=0; v != Val_emptylist; i++, v = Field(v, 1) ) {
>               elem = Field(v, 0);
>
> -             array[i * 2] = dup_String_val(gc, Field(elem, 0));
> -             array[i * 2 + 1] = dup_String_val(gc, Field(elem, 1));
> +             array[i * 2] = dup_String_val(Field(elem, 0));
> +             array[i * 2 + 1] = dup_String_val(Field(elem, 1));
>       }
>
>       *c_val = array;
>       CAMLreturn(0);
>  }
>
> -static int libxl_string_list_val(caml_gc *gc, struct caml_logger *lg,
> -                              libxl_string_list *c_val,
> -                              value v)
> +static int libxl_string_list_val(libxl_string_list *c_val, value v)
>  {
>       CAMLparam1(v);
>       int nr, i;
> @@ -183,12 +119,12 @@ static int libxl_string_list_val(caml_gc
>
>       nr = list_len(v);
>
> -     array = gc_calloc(gc, (nr + 1), sizeof(char *));
> +     array = calloc(nr + 1, sizeof(char *));
>       if (!array)
>               caml_raise_out_of_memory();
>
>       for (i=0; v != Val_emptylist; i++, v = Field(v, 1) )
> -             array[i] = dup_String_val(gc, Field(v, 0));
> +             array[i] = dup_String_val(Field(v, 0));
>
>       *c_val = array;
>       CAMLreturn(0);
> @@ -221,7 +157,7 @@ static value Val_mac (libxl_mac *c_val)
>       CAMLreturn(v);
>  }
>
> -static int Mac_val(caml_gc *gc, struct caml_logger *lg, libxl_mac *c_val,
> value v)
> +static int Mac_val(libxl_mac *c_val, value v)
>  {
>       CAMLparam1(v);
>       int i;
> @@ -248,10 +184,20 @@ static value Val_bitmap (libxl_bitmap *c
>       CAMLreturn(v);
>  }
>
> -static int Bitmap_val(caml_gc *gc, struct caml_logger *lg,
> -                   libxl_bitmap *c_val, value v)
> +static int Bitmap_val(libxl_ctx *ctx, libxl_bitmap *c_val, value v)
>  {
> -     abort(); /* XXX */
> +     CAMLparam1(v);
> +     int i, len = Wosize_val(v);
> +
> +     if (!libxl_bitmap_alloc(ctx, c_val, len))
> +             failwith_xl("cannot allocate bitmap");
> +     for (i=0; i<len; i++) {
> +             if (Int_val(Field(v, i)))
> +                     libxl_bitmap_set(c_val, i);
> +             else
> +                     libxl_bitmap_reset(c_val, i);
> +     }
> +     CAMLreturn(0);
>  }
>
>  static value Val_cpuid_policy_list(libxl_cpuid_policy_list c_val) @@ -261,8
> +207,7 @@ static value Val_cpuid_policy_list(libxl
>       CAMLreturn((value)c_val);
>  }
>
> -static int Cpuid_policy_list_val(caml_gc *gc, struct caml_logger *lg,
> -                              libxl_cpuid_policy_list *c_val, value v)
> +static int Cpuid_policy_list_val(libxl_cpuid_policy_list *c_val, value
> +v)
>  {
>       CAMLparam1(v);
>
> @@ -287,7 +232,7 @@ static value Val_uuid (libxl_uuid *c_val
>       CAMLreturn(v);
>  }
>
> -static int Uuid_val(caml_gc *gc, struct caml_logger *lg, libxl_uuid *c_val,
> value v)
> +static int Uuid_val(libxl_uuid *c_val, value v)
>  {
>       CAMLparam1(v);
>       int i;
> @@ -345,14 +290,12 @@ value stub_libxl_list_domain(value ctx)  {
>       CAMLparam1(ctx);
>       CAMLlocal2( cli, cons );
> -     struct caml_gc gc;
>       libxl_dominfo *info;
>       int i, nr;
>
> -     gc.offset = 0;
>       info = libxl_list_domain(CTX, &nr);
>       if (info == NULL)
> -             failwith_xl("list_domain", NULL);
> +             failwith_xl("list_domain");
>
>       cli = Val_emptylist;
>
> @@ -360,7 +303,7 @@ value stub_libxl_list_domain(value ctx)
>               cons = caml_alloc(2, 0);
>
>               /* Head */
> -             Store_field(cons, 0, Val_dominfo(&gc, NULL, &info[i]));
> +             Store_field(cons, 0, Val_dominfo(CTX, &info[i]));
>               /* Tail */
>               Store_field(cons, 1, cli);
>
> @@ -369,259 +312,77 @@ value stub_libxl_list_domain(value ctx)
>
>       libxl_dominfo_list_free(info, nr);
>
> -     gc_free(&gc);
> -
>       CAMLreturn(cli);
>  }
>
> -value stub_xl_device_disk_add(value info, value domid) -{
> -     CAMLparam2(info, domid);
> -     libxl_device_disk c_info;
> -     int ret;
> -     INIT_STRUCT();
> +#define _STRINGIFY(x) #x
> +#define STRINGIFY(x) _STRINGIFY(x)
>
> -     device_disk_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_disk_add(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("disk_add", &lg);
> -     FREE_CTX();
> -     CAMLreturn(Val_unit);
> +#define _DEVICE_ADDREMOVE(type,op)
>       \
> +value stub_xl_device_##type##_##op(value ctx, value info, value domid)
>       \
> +{                                                                    \
> +     CAMLparam3(ctx, info, domid);
>       \
> +     libxl_device_##type c_info;                                     \
> +     int ret, marker_var;                                            \
> +                                                                     \
> +     device_##type##_val(CTX, &c_info, info);                        \
> +                                                                     \
> +     ret = libxl_device_##type##_##op(CTX, Int_val(domid), &c_info, 0); \
> +                                                                     \
> +     libxl_device_##type##_dispose(&c_info);
>       \
> +                                                                     \
> +     if (ret != 0)                                                   \
> +             failwith_xl(STRINGIFY(type) "_" STRINGIFY(op));
>       \
> +                                                                     \
> +     CAMLreturn(Val_unit);                                           \
>  }
>
> -value stub_xl_device_disk_del(value info, value domid)
> +#define DEVICE_ADDREMOVE(type) \
> +     _DEVICE_ADDREMOVE(type, add) \
> +     _DEVICE_ADDREMOVE(type, remove) \
> +     _DEVICE_ADDREMOVE(type, destroy)
> +
> +DEVICE_ADDREMOVE(disk)
> +DEVICE_ADDREMOVE(nic)
> +DEVICE_ADDREMOVE(vfb)
> +DEVICE_ADDREMOVE(vkb)
> +DEVICE_ADDREMOVE(pci)
> +
> +value stub_xl_physinfo_get(value ctx)
>  {
> -     CAMLparam2(info, domid);
> -     libxl_device_disk c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_disk_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_disk_remove(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("disk_del", &lg);
> -     FREE_CTX();
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_nic_add(value info, value domid) -{
> -     CAMLparam2(info, domid);
> -     libxl_device_nic c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_nic_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_nic_add(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("nic_add", &lg);
> -     FREE_CTX();
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_nic_del(value info, value domid) -{
> -     CAMLparam2(info, domid);
> -     libxl_device_nic c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_nic_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_nic_remove(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("nic_del", &lg);
> -     FREE_CTX();
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_vkb_add(value info, value domid) -{
> -     CAMLparam2(info, domid);
> -     libxl_device_vkb c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_vkb_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_vkb_add(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("vkb_add", &lg);
> -     FREE_CTX();
> -
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_vkb_remove(value info, value domid) -{
> -     CAMLparam1(domid);
> -     libxl_device_vkb c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_vkb_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_vkb_remove(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("vkb_clean_shutdown", &lg);
> -     FREE_CTX();
> -
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_vkb_destroy(value info, value domid) -{
> -     CAMLparam1(domid);
> -     libxl_device_vkb c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_vkb_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_vkb_destroy(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("vkb_hard_shutdown", &lg);
> -     FREE_CTX();
> -
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_vfb_add(value info, value domid) -{
> -     CAMLparam2(info, domid);
> -     libxl_device_vfb c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_vfb_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_vfb_add(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("vfb_add", &lg);
> -     FREE_CTX();
> -
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_vfb_remove(value info, value domid) -{
> -     CAMLparam1(domid);
> -     libxl_device_vfb c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_vfb_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_vfb_remove(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("vfb_clean_shutdown", &lg);
> -     FREE_CTX();
> -
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_vfb_destroy(value info, value domid) -{
> -     CAMLparam1(domid);
> -     libxl_device_vfb c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_vfb_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_vfb_destroy(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("vfb_hard_shutdown", &lg);
> -     FREE_CTX();
> -
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_pci_add(value info, value domid) -{
> -     CAMLparam2(info, domid);
> -     libxl_device_pci c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_pci_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_pci_add(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("pci_add", &lg);
> -     FREE_CTX();
> -
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_device_pci_remove(value info, value domid) -{
> -     CAMLparam2(info, domid);
> -     libxl_device_pci c_info;
> -     int ret;
> -     INIT_STRUCT();
> -
> -     device_pci_val(&gc, &lg, &c_info, info);
> -
> -     INIT_CTX();
> -     ret = libxl_device_pci_remove(ctx, Int_val(domid), &c_info, 0);
> -     if (ret != 0)
> -             failwith_xl("pci_remove", &lg);
> -     FREE_CTX();
> -
> -     CAMLreturn(Val_unit);
> -}
> -
> -value stub_xl_physinfo_get(value unit)
> -{
> -     CAMLparam1(unit);
> +     CAMLparam1(ctx);
>       CAMLlocal1(physinfo);
>       libxl_physinfo c_physinfo;
>       int ret;
> -     INIT_STRUCT();
>
> -     INIT_CTX();
> -     ret = libxl_get_physinfo(ctx, &c_physinfo);
> +     ret = libxl_get_physinfo(CTX, &c_physinfo);
> +
>       if (ret != 0)
> -             failwith_xl("physinfo", &lg);
> -     FREE_CTX();
> +             failwith_xl("get_physinfo");
>
> -     physinfo = Val_physinfo(&gc, &lg, &c_physinfo);
> +     physinfo = Val_physinfo(CTX, &c_physinfo);
> +
> +     libxl_physinfo_dispose(&c_physinfo);
> +
>       CAMLreturn(physinfo);
>  }
>
> -value stub_xl_cputopology_get(value unit)
> +value stub_xl_cputopology_get(value ctx)
>  {
> -     CAMLparam1(unit);
> +     CAMLparam1(ctx);
>       CAMLlocal2(topology, v);
>       libxl_cputopology *c_topology;
> -     int i, nr, ret;
> -     INIT_STRUCT();
> +     int i, nr;
>
> -     INIT_CTX();
> +     c_topology = libxl_get_cpu_topology(CTX, &nr);
>
> -     c_topology = libxl_get_cpu_topology(ctx, &nr);
> -     if (ret != 0)
> -             failwith_xl("topologyinfo", &lg);
> +     if (!c_topology)
> +             failwith_xl("topologyinfo");
>
>       topology = caml_alloc_tuple(nr);
>       for (i = 0; i < nr; i++) {
>               if (c_topology[i].core !=
> LIBXL_CPUTOPOLOGY_INVALID_ENTRY)
> -                     v = Val_some(Val_cputopology(&gc, &lg,
> &c_topology[i]));
> +                     v = Val_some(Val_cputopology(CTX,
> &c_topology[i]));
>               else
>                       v = Val_none;
>               Store_field(topology, i, v);
> @@ -629,74 +390,72 @@ value stub_xl_cputopology_get(value unit
>
>       libxl_cputopology_list_free(c_topology, nr);
>
> -     FREE_CTX();
>       CAMLreturn(topology);
>  }
>
> -value stub_xl_domain_sched_params_get(value domid)
> +value stub_xl_domain_sched_params_get(value ctx, value domid)
>  {
> -     CAMLparam1(domid);
> +     CAMLparam2(ctx, domid);
>       CAMLlocal1(scinfo);
>       libxl_domain_sched_params c_scinfo;
>       int ret;
> -     INIT_STRUCT();
>
> -     INIT_CTX();
> -     ret = libxl_domain_sched_params_get(ctx, Int_val(domid),
> &c_scinfo);
> +     ret = libxl_domain_sched_params_get(CTX, Int_val(domid),
> &c_scinfo);
>       if (ret != 0)
> -             failwith_xl("domain_sched_params_get", &lg);
> -     FREE_CTX();
> +             failwith_xl("domain_sched_params_get");
>
> -     scinfo = Val_domain_sched_params(&gc, &lg, &c_scinfo);
> +     scinfo = Val_domain_sched_params(CTX, &c_scinfo);
> +
> +     libxl_domain_sched_params_dispose(&c_scinfo);
> +
>       CAMLreturn(scinfo);
>  }
>
> -value stub_xl_domain_sched_params_set(value domid, value scinfo)
> +value stub_xl_domain_sched_params_set(value ctx, value domid, value
> +scinfo)
>  {
> -     CAMLparam2(domid, scinfo);
> +     CAMLparam3(ctx, domid, scinfo);
>       libxl_domain_sched_params c_scinfo;
>       int ret;
> -     INIT_STRUCT();
>
> -     domain_sched_params_val(&gc, &lg, &c_scinfo, scinfo);
> +     domain_sched_params_val(CTX, &c_scinfo, scinfo);
>
> -     INIT_CTX();
> -     ret = libxl_domain_sched_params_set(ctx, Int_val(domid),
> &c_scinfo);
> +     ret = libxl_domain_sched_params_set(CTX, Int_val(domid),
> &c_scinfo);
> +
> +     libxl_domain_sched_params_dispose(&c_scinfo);
> +
>       if (ret != 0)
> -             failwith_xl("domain_sched_params_set", &lg);
> -     FREE_CTX();
> +             failwith_xl("domain_sched_params_set");
>
>       CAMLreturn(Val_unit);
>  }
>
> -value stub_xl_send_trigger(value domid, value trigger, value vcpuid)
> +value stub_xl_send_trigger(value ctx, value domid, value trigger, value
> +vcpuid)
>  {
> -     CAMLparam3(domid, trigger, vcpuid);
> +     CAMLparam4(ctx, domid, trigger, vcpuid);
>       int ret;
>       libxl_trigger c_trigger = LIBXL_TRIGGER_UNKNOWN;
> -     INIT_STRUCT();
>
> -     trigger_val(&gc, &lg, &c_trigger, trigger);
> +     trigger_val(CTX, &c_trigger, trigger);
>
> -     INIT_CTX();
> -     ret = libxl_send_trigger(ctx, Int_val(domid), c_trigger,
> Int_val(vcpuid));
> +     ret = libxl_send_trigger(CTX, Int_val(domid),
> +                              c_trigger, Int_val(vcpuid));
> +
>       if (ret != 0)
> -             failwith_xl("send_trigger", &lg);
> -     FREE_CTX();
> +             failwith_xl("send_trigger");
> +
>       CAMLreturn(Val_unit);
>  }
>
> -value stub_xl_send_sysrq(value domid, value sysrq)
> +value stub_xl_send_sysrq(value ctx, value domid, value sysrq)
>  {
> -     CAMLparam2(domid, sysrq);
> +     CAMLparam3(ctx, domid, sysrq);
>       int ret;
> -     INIT_STRUCT();
>
> -     INIT_CTX();
> -     ret = libxl_send_sysrq(ctx, Int_val(domid), Int_val(sysrq));
> +     ret = libxl_send_sysrq(CTX, Int_val(domid), Int_val(sysrq));
> +
>       if (ret != 0)
> -             failwith_xl("send_sysrq", &lg);
> -     FREE_CTX();
> +             failwith_xl("send_sysrq");
> +
>       CAMLreturn(Val_unit);
>  }
>
> @@ -706,11 +465,11 @@ value stub_xl_send_debug_keys(value ctx,
>       int ret;
>       char *c_keys;
>
> -     c_keys = dup_String_val(NULL, keys);
> +     c_keys = dup_String_val(keys);
>
>       ret = libxl_send_debug_keys(CTX, c_keys);
>       if (ret != 0)
> -             failwith_xl("send_debug_keys", NULL);
> +             failwith_xl("send_debug_keys");
>
>       free(c_keys);
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:14:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:14:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOYH-000435-G8; Fri, 30 Nov 2012 11:14:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1TeOYF-00042d-JH; Fri, 30 Nov 2012 11:14:36 +0000
Received: from [85.158.138.51:30676] by server-10.bemta-3.messagelabs.com id
	61/67-19806-A1598B05; Fri, 30 Nov 2012 11:14:34 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1354274070!32089658!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2764 invoked from network); 30 Nov 2012 11:14:30 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:14:30 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16088896"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 11:13:41 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Fri, 30 Nov 2012
	11:13:41 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Fri, 30 Nov 2012 11:13:41 +0000
Thread-Topic: [Xen-devel] [PATCH 13 of 15] libxl: ocaml: propagate the libxl
	return error code in exceptions
Thread-Index: Ac3HRzP9mobSXKqJRFSaUwf5bNYa0AHpGeCw
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107B8@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<c8d22bfef298ce525c98.1353432213@cosworth.uk.xensource.com>
In-Reply-To: <c8d22bfef298ce525c98.1353432213@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 13 of 15] libxl: ocaml: propagate the libxl
 return error code in exceptions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> c8d22bfef298ce525c98b5a3f0c394068ab01572
> # Parent  e4525795eac22c7d199ceae8714e95ed660a00c4
> libxl: ocaml: propagate the libxl return error code in exceptions
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Acked-by: Rob Hoes <rob.hoes@citrix.com>

> diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py  Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py  Tue Nov 20 17:22:21 2012 +0000
> @@ -228,7 +228,7 @@ def c_val(ty, c, o, indent="", parent =
>          for e in ty.values:
>              s += "    case %d: *%s = %s; break;\n" % (n, c, e.name)
>              n += 1
> -        s += "    default: failwith_xl(\"cannot convert value to %s\"); break;\n" %
> ty.typename
> +        s += "    default: failwith_xl(ERROR_FAIL, \"cannot convert value
> to %s\"); break;\n" % ty.typename
>          s += "}"
>      elif isinstance(ty, idl.KeyedUnion):
>          s += "{\n"
> @@ -241,7 +241,7 @@ def c_val(ty, c, o, indent="", parent =
>                                                      parent + ty.keyvar.name,
>                                                      f.enumname)
>              n += 1
> -        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (long)\");
> break;\n" % (parent, ty.keyvar.name)
> +        s += "\t\t    default: failwith_xl(ERROR_FAIL, \"variant handling
> bug %s%s (long)\"); break;\n" % (parent, ty.keyvar.name)
>          s += "\t\t}\n"
>          s += "\t} else {\n"
>          s += "\t\t/* Is block... */\n"
> @@ -257,7 +257,7 @@ def c_val(ty, c, o, indent="", parent =
>                  s += "%s" % c_val(f.type, fexpr, o, indent=indent+"\t\t        ")
>                  s += "break;\n"
>              n += 1
> -        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (block)\");
> break;\n" % (parent, ty.keyvar.name)
> +        s += "\t\t    default: failwith_xl(ERROR_FAIL, \"variant handling
> bug %s%s (block)\"); break;\n" % (parent, ty.keyvar.name)
>          s += "\t\t}\n"
>          s += "\t}\n"
>          s += "}"
> @@ -326,7 +326,7 @@ def ocaml_Val(ty, o, c, indent="", paren
>          for e in ty.values:
>              s += "    case %s: %s = Int_val(%d); break;\n" % (e.name, o, n)
>              n += 1
> -        s += "    default: failwith_xl(\"cannot convert value from %s\");
> break;\n" % ty.typename
> +        s += "    default: failwith_xl(ERROR_FAIL, \"cannot convert value
> from %s\"); break;\n" % ty.typename
>          s += "}"
>      elif isinstance(ty, idl.KeyedUnion):
>          n = 0
> @@ -347,7 +347,7 @@ def ocaml_Val(ty, o, c, indent="", paren
>                  #s += "\t        %s = caml_alloc(%d,%d);\n" % (o,len(f.type.fields),n)
>              s += "\t        break;\n"
>              n += 1
> -        s += "\t    default: failwith_xl(\"cannot convert value from %s\");
> break;\n" % ty.typename
> +        s += "\t    default: failwith_xl(ERROR_FAIL, \"cannot convert value
> from %s\"); break;\n" % ty.typename
>          s += "\t}"
>      elif isinstance(ty,idl.Aggregate) and (parent is None or ty.rawname is
> None):
>          s += "{\n"
> diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/libs/xl/xenlight.ml.in
> --- a/tools/ocaml/libs/xl/xenlight.ml.in      Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight.ml.in      Tue Nov 20 17:22:21 2012
> +0000
> @@ -15,7 +15,47 @@
>
>  open Xentoollog
>
> -exception Error of string
> +type error =
> +    Nonspecific |
> +    Version |
> +    Fail |
> +    Ni |
> +    Nomem |
> +    Inval |
> +    Badfail |
> +    Guest_Timedout |
> +    Timedout |
> +    Noparavirt |
> +    Not_Ready |
> +    Osevent_Reg_Fail |
> +    Bufferfull |
> +    Unknown_Child
> +
> +let string_of_error error =
> +  match error with
> +  | Nonspecific -> "Non specific"
> +  | Version -> "Version"
> +  | Fail -> "Fail"
> +  | Ni -> "Ni"
> +  | Nomem -> "Nomem"
> +  | Inval -> "Inval"
> +  | Badfail -> "Badfail"
> +  | Guest_Timedout -> "Guest Timedout"
> +  | Timedout -> "Timedout"
> +  | Noparavirt -> "Noparavirt"
> +  | Not_Ready -> "Not Ready"
> +  | Osevent_Reg_Fail -> "Osevent Reg Fail"
> +  | Bufferfull -> "Bufferfull"
> +  | Unknown_Child -> "Unknown Child"
> +
> +exception Error of (error * string)
> +
> +type ctx
> +
> +external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
> +external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
> +
> +external test_raise_exception: unit -> unit = "stub_raise_exception"
>
>  type domid = int
>  type devid = int
> @@ -26,15 +66,10 @@ end
>
>  (* @@LIBXL_TYPES@@ *)
>
> -type ctx
> -
> -external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
> -external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
> -
>  external list_domain: ctx -> Dominfo.t list = "stub_libxl_list_domain"
>
>  external send_trigger : domid -> trigger -> int -> unit =
> "stub_xl_send_trigger"
>  external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
>  external send_debug_keys : ctx -> string -> unit =
> "stub_xl_send_debug_keys"
>
> -let _ = Callback.register_exception "Xenlight.Error" (Error(""))
> +let _ = Callback.register_exception "Xenlight.Error" (Error(Fail, ""))
> diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/libs/xl/xenlight.mli.in
> --- a/tools/ocaml/libs/xl/xenlight.mli.in     Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight.mli.in     Tue Nov 20 17:22:21 2012
> +0000
> @@ -15,7 +15,32 @@
>
>  open Xentoollog
>
> -exception Error of string
> +type error =
> +    Nonspecific |
> +    Version |
> +    Fail |
> +    Ni |
> +    Nomem |
> +    Inval |
> +    Badfail |
> +    Guest_Timedout |
> +    Timedout |
> +    Noparavirt |
> +    Not_Ready |
> +    Osevent_Reg_Fail |
> +    Bufferfull |
> +    Unknown_Child
> +
> +val string_of_error: error -> string
> +
> +exception Error of (error * string)
> +
> +type ctx
> +
> +external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
> +external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
> +
> +external test_raise_exception: unit = "stub_raise_exception"
>
>  type domid = int
>  type devid = int
> @@ -24,9 +49,6 @@ type devid = int
>
>  type ctx
>
> -external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
> -external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
> -
>  external list_domain: ctx -> Dominfo.t list = "stub_libxl_list_domain"
>
>  external send_trigger : domid -> trigger -> int -> unit =
> "stub_xl_send_trigger"
> diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/libs/xl/xenlight_stubs.c
> --- a/tools/ocaml/libs/xl/xenlight_stubs.c    Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight_stubs.c    Tue Nov 20 17:22:21 2012
> +0000
> @@ -43,12 +43,54 @@ static char * dup_String_val(value s)
>       return c;
>  }
>
> -static void failwith_xl(char *fname)
> +static value Val_error(int error)
>  {
> +     switch (error) {
> +     case ERROR_NONSPECIFIC: return Val_int(0);
> +     case ERROR_VERSION:     return Val_int(1);
> +     case ERROR_FAIL:        return Val_int(2);
> +     case ERROR_NI:          return Val_int(3);
> +     case ERROR_NOMEM:       return Val_int(4);
> +     case ERROR_INVAL:       return Val_int(5);
> +     case ERROR_BADFAIL:     return Val_int(6);
> +     case ERROR_GUEST_TIMEDOUT: return Val_int(7);
> +     case ERROR_TIMEDOUT:    return Val_int(8);
> +     case ERROR_NOPARAVIRT:  return Val_int(9);
> +     case ERROR_NOT_READY:   return Val_int(10);
> +     case ERROR_OSEVENT_REG_FAIL: return Val_int(11);
> +     case ERROR_BUFFERFULL:  return Val_int(12);
> +     case ERROR_UNKNOWN_CHILD: return Val_int(13); #if 0 /* Let the
> +compiler catch this */
> +     default:
> +             caml_raise_sys_error(caml_copy_string("Unknown libxl
> ERROR"));
> +             break;
> +#endif
> +     }
> +     /* Should not reach here */
> +     abort();
> +}
> +
> +static void failwith_xl(int error, char *fname) {
> +     CAMLlocal1(arg);
>       value *exc = caml_named_value("Xenlight.Error");
> +
>       if (!exc)
>               caml_invalid_argument("Exception Xenlight.Error not
> initialized, please link xl.cma");
> -     caml_raise_with_string(*exc, fname);
> +
> +     arg = caml_alloc_small(2, 0);
> +
> +     Field(arg, 0) = Val_error(error);
> +     Field(arg, 1) = caml_copy_string(fname);
> +
> +     caml_raise_with_arg(*exc, arg);
> +}
> +
> +CAMLprim value stub_raise_exception(value unit) {
> +     CAMLparam1(unit);
> +     failwith_xl(ERROR_FAIL, "test exception");
> +     CAMLreturn(Val_unit);
>  }
>
>  CAMLprim value stub_libxl_ctx_alloc(value logger) @@ -60,7 +102,7 @@
> CAMLprim value stub_libxl_ctx_alloc(valu
>       caml_enter_blocking_section();
>       ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct
> xentoollog_logger *) logger);
>       if (ret != 0) \
> -             failwith_xl("cannot init context");
> +             failwith_xl(ERROR_FAIL, "cannot init context");
>       caml_leave_blocking_section();
>       CAMLreturn((value)ctx);
>  }
> @@ -190,7 +232,7 @@ static int Bitmap_val(libxl_ctx *ctx, li
>       int i, len = Wosize_val(v);
>
>       if (!libxl_bitmap_alloc(ctx, c_val, len))
> -             failwith_xl("cannot allocate bitmap");
> +             failwith_xl(ERROR_NOMEM, "cannot allocate bitmap");
>       for (i=0; i<len; i++) {
>               if (Int_val(Field(v, i)))
>                       libxl_bitmap_set(c_val, i);
> @@ -295,7 +337,7 @@ value stub_libxl_list_domain(value ctx)
>
>       info = libxl_list_domain(CTX, &nr);
>       if (info == NULL)
> -             failwith_xl("list_domain");
> +             failwith_xl(ERROR_FAIL, "list_domain");
>
>       cli = Val_emptylist;
>
> @@ -332,7 +374,7 @@ value stub_xl_device_##type##_##op(value
>       libxl_device_##type##_dispose(&c_info);
>       \
>                                                                       \
>       if (ret != 0)                                                   \
> -             failwith_xl(STRINGIFY(type) "_" STRINGIFY(op));
>       \
> +             failwith_xl(ret, STRINGIFY(type) "_" STRINGIFY(op));    \
>                                                                       \
>       CAMLreturn(Val_unit);                                           \
>  }
> @@ -358,7 +400,7 @@ value stub_xl_physinfo_get(value ctx)
>       ret = libxl_get_physinfo(CTX, &c_physinfo);
>
>       if (ret != 0)
> -             failwith_xl("get_physinfo");
> +             failwith_xl(ret, "get_physinfo");
>
>       physinfo = Val_physinfo(CTX, &c_physinfo);
>
> @@ -377,7 +419,7 @@ value stub_xl_cputopology_get(value ctx)
>       c_topology = libxl_get_cpu_topology(CTX, &nr);
>
>       if (!c_topology)
> -             failwith_xl("topologyinfo");
> +             failwith_xl(ERROR_FAIL, "get_cpu_topologyinfo");
>
>       topology = caml_alloc_tuple(nr);
>       for (i = 0; i < nr; i++) {
> @@ -402,7 +444,7 @@ value stub_xl_domain_sched_params_get(va
>
>       ret = libxl_domain_sched_params_get(CTX, Int_val(domid),
> &c_scinfo);
>       if (ret != 0)
> -             failwith_xl("domain_sched_params_get");
> +             failwith_xl(ret, "domain_sched_params_get");
>
>       scinfo = Val_domain_sched_params(CTX, &c_scinfo);
>
> @@ -424,7 +466,7 @@ value stub_xl_domain_sched_params_set(va
>       libxl_domain_sched_params_dispose(&c_scinfo);
>
>       if (ret != 0)
> -             failwith_xl("domain_sched_params_set");
> +             failwith_xl(ret, "domain_sched_params_set");
>
>       CAMLreturn(Val_unit);
>  }
> @@ -441,7 +483,7 @@ value stub_xl_send_trigger(value ctx, va
>                                c_trigger, Int_val(vcpuid));
>
>       if (ret != 0)
> -             failwith_xl("send_trigger");
> +             failwith_xl(ret, "send_trigger");
>
>       CAMLreturn(Val_unit);
>  }
> @@ -454,7 +496,7 @@ value stub_xl_send_sysrq(value ctx, valu
>       ret = libxl_send_sysrq(CTX, Int_val(domid), Int_val(sysrq));
>
>       if (ret != 0)
> -             failwith_xl("send_sysrq");
> +             failwith_xl(ret, "send_sysrq");
>
>       CAMLreturn(Val_unit);
>  }
> @@ -469,7 +511,7 @@ value stub_xl_send_debug_keys(value ctx,
>
>       ret = libxl_send_debug_keys(CTX, c_keys);
>       if (ret != 0)
> -             failwith_xl("send_debug_keys");
> +             failwith_xl(ret, "send_debug_keys");
>
>       free(c_keys);
>
> diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/test/Makefile
> --- a/tools/ocaml/test/Makefile       Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/test/Makefile       Tue Nov 20 17:22:21 2012 +0000
> @@ -6,9 +6,9 @@ OCAMLINCLUDE += \
>       -I $(OCAML_TOPLEVEL)/libs/xentoollog \
>       -I $(OCAML_TOPLEVEL)/libs/xl
>
> -OBJS = xtl send_debug_keys list_domains
> +OBJS = xtl send_debug_keys list_domains raise_exception
>
> -PROGRAMS = xtl send_debug_keys list_domains
> +PROGRAMS = xtl send_debug_keys list_domains raise_exception
>
>  xtl_LIBS =  \
>       -ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog
> $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa
> @@ -27,7 +27,13 @@ list_domains_LIBS =  \
>
>  list_domains_OBJS = list_domains
>
> -OCAML_PROGRAM = xtl send_debug_keys list_domains
> +raise_exception_LIBS =  \
> +     -ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog
> $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
> +     -ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl
> +$(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
> +
> +raise_exception_OBJS = raise_exception
> +
> +OCAML_PROGRAM = xtl send_debug_keys list_domains raise_exception
>
>  all: $(PROGRAMS)
>
> diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/test/list_domains.ml
> --- a/tools/ocaml/test/list_domains.ml        Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/test/list_domains.ml        Tue Nov 20 17:22:21 2012
> +0000
> @@ -19,8 +19,11 @@ let print_dominfo dominfo =  let _ =
>    let logger = Xentoollog.create_stdio_logger (*~level:Xentoollog.Debug*) ()
> in
>    let ctx = Xenlight.ctx_alloc logger in
> -  let domains = Xenlight.list_domain ctx in
> -  List.iter (fun d -> print_dominfo d) domains;
> -  Xenlight.ctx_free ctx;
> -  Xentoollog.destroy logger;
> -
> +  try
> +    let domains = Xenlight.list_domain ctx in
> +    List.iter (fun d -> print_dominfo d) domains;
> +    Xenlight.ctx_free ctx;
> +    Xentoollog.destroy logger;
> +  with Xenlight.Error(err, fn) -> begin
> +    printf "Caught Exception: %s: %s\n" (Xenlight.string_of_error err)
> + fn;  end
> diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/test/raise_exception.ml
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/ocaml/test/raise_exception.ml     Tue Nov 20 17:22:21 2012
> +0000
> @@ -0,0 +1,15 @@
> +open Printf
> +open Xentoollog
> +open Xenlight
> +
> +let _ =
> +  let logger = Xentoollog.create_stdio_logger
> +(*~level:Xentoollog.Debug*) () in
> +  let ctx = Xenlight.ctx_alloc logger in
> +  try
> +    Xenlight.test_raise_exception ()
> +  with Xenlight.Error(err, fn) -> begin
> +    printf "Caught Exception: %s: %s\n" (Xenlight.string_of_error err)
> +fn;
> +  end;
> +  Xenlight.ctx_free ctx;
> +  Xentoollog.destroy logger;
> +
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:14:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:14:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOYH-000435-G8; Fri, 30 Nov 2012 11:14:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1TeOYF-00042d-JH; Fri, 30 Nov 2012 11:14:36 +0000
Received: from [85.158.138.51:30676] by server-10.bemta-3.messagelabs.com id
	61/67-19806-A1598B05; Fri, 30 Nov 2012 11:14:34 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1354274070!32089658!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2764 invoked from network); 30 Nov 2012 11:14:30 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:14:30 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16088896"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 11:13:41 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Fri, 30 Nov 2012
	11:13:41 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Fri, 30 Nov 2012 11:13:41 +0000
Thread-Topic: [Xen-devel] [PATCH 13 of 15] libxl: ocaml: propagate the libxl
	return error code in exceptions
Thread-Index: Ac3HRzP9mobSXKqJRFSaUwf5bNYa0AHpGeCw
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107B8@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<c8d22bfef298ce525c98.1353432213@cosworth.uk.xensource.com>
In-Reply-To: <c8d22bfef298ce525c98.1353432213@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 13 of 15] libxl: ocaml: propagate the libxl
 return error code in exceptions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> c8d22bfef298ce525c98b5a3f0c394068ab01572
> # Parent  e4525795eac22c7d199ceae8714e95ed660a00c4
> libxl: ocaml: propagate the libxl return error code in exceptions
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Acked-by: Rob Hoes <rob.hoes@citrix.com>

> diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py  Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py  Tue Nov 20 17:22:21 2012 +0000
> @@ -228,7 +228,7 @@ def c_val(ty, c, o, indent="", parent =
>          for e in ty.values:
>              s += "    case %d: *%s = %s; break;\n" % (n, c, e.name)
>              n += 1
> -        s += "    default: failwith_xl(\"cannot convert value to %s\"); break;\n" %
> ty.typename
> +        s += "    default: failwith_xl(ERROR_FAIL, \"cannot convert value
> to %s\"); break;\n" % ty.typename
>          s += "}"
>      elif isinstance(ty, idl.KeyedUnion):
>          s += "{\n"
> @@ -241,7 +241,7 @@ def c_val(ty, c, o, indent="", parent =
>                                                      parent + ty.keyvar.name,
>                                                      f.enumname)
>              n += 1
> -        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (long)\");
> break;\n" % (parent, ty.keyvar.name)
> +        s += "\t\t    default: failwith_xl(ERROR_FAIL, \"variant handling
> bug %s%s (long)\"); break;\n" % (parent, ty.keyvar.name)
>          s += "\t\t}\n"
>          s += "\t} else {\n"
>          s += "\t\t/* Is block... */\n"
> @@ -257,7 +257,7 @@ def c_val(ty, c, o, indent="", parent =
>                  s += "%s" % c_val(f.type, fexpr, o, indent=indent+"\t\t        ")
>                  s += "break;\n"
>              n += 1
> -        s += "\t\t    default: failwith_xl(\"variant handling bug %s%s (block)\");
> break;\n" % (parent, ty.keyvar.name)
> +        s += "\t\t    default: failwith_xl(ERROR_FAIL, \"variant handling
> bug %s%s (block)\"); break;\n" % (parent, ty.keyvar.name)
>          s += "\t\t}\n"
>          s += "\t}\n"
>          s += "}"
> @@ -326,7 +326,7 @@ def ocaml_Val(ty, o, c, indent="", paren
>          for e in ty.values:
>              s += "    case %s: %s = Int_val(%d); break;\n" % (e.name, o, n)
>              n += 1
> -        s += "    default: failwith_xl(\"cannot convert value from %s\");
> break;\n" % ty.typename
> +        s += "    default: failwith_xl(ERROR_FAIL, \"cannot convert value
> from %s\"); break;\n" % ty.typename
>          s += "}"
>      elif isinstance(ty, idl.KeyedUnion):
>          n = 0
> @@ -347,7 +347,7 @@ def ocaml_Val(ty, o, c, indent="", paren
>                  #s += "\t        %s = caml_alloc(%d,%d);\n" % (o,len(f.type.fields),n)
>              s += "\t        break;\n"
>              n += 1
> -        s += "\t    default: failwith_xl(\"cannot convert value from %s\");
> break;\n" % ty.typename
> +        s += "\t    default: failwith_xl(ERROR_FAIL, \"cannot convert value
> from %s\"); break;\n" % ty.typename
>          s += "\t}"
>      elif isinstance(ty,idl.Aggregate) and (parent is None or ty.rawname is
> None):
>          s += "{\n"
> diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/libs/xl/xenlight.ml.in
> --- a/tools/ocaml/libs/xl/xenlight.ml.in      Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight.ml.in      Tue Nov 20 17:22:21 2012
> +0000
> @@ -15,7 +15,47 @@
>
>  open Xentoollog
>
> -exception Error of string
> +type error =
> +    Nonspecific |
> +    Version |
> +    Fail |
> +    Ni |
> +    Nomem |
> +    Inval |
> +    Badfail |
> +    Guest_Timedout |
> +    Timedout |
> +    Noparavirt |
> +    Not_Ready |
> +    Osevent_Reg_Fail |
> +    Bufferfull |
> +    Unknown_Child
> +
> +let string_of_error error =
> +  match error with
> +  | Nonspecific -> "Non specific"
> +  | Version -> "Version"
> +  | Fail -> "Fail"
> +  | Ni -> "Ni"
> +  | Nomem -> "Nomem"
> +  | Inval -> "Inval"
> +  | Badfail -> "Badfail"
> +  | Guest_Timedout -> "Guest Timedout"
> +  | Timedout -> "Timedout"
> +  | Noparavirt -> "Noparavirt"
> +  | Not_Ready -> "Not Ready"
> +  | Osevent_Reg_Fail -> "Osevent Reg Fail"
> +  | Bufferfull -> "Bufferfull"
> +  | Unknown_Child -> "Unknown Child"
> +
> +exception Error of (error * string)
> +
> +type ctx
> +
> +external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
> +external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
> +
> +external test_raise_exception: unit -> unit = "stub_raise_exception"
>
>  type domid = int
>  type devid = int
> @@ -26,15 +66,10 @@ end
>
>  (* @@LIBXL_TYPES@@ *)
>
> -type ctx
> -
> -external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
> -external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
> -
>  external list_domain: ctx -> Dominfo.t list = "stub_libxl_list_domain"
>
>  external send_trigger : domid -> trigger -> int -> unit =
> "stub_xl_send_trigger"
>  external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
>  external send_debug_keys : ctx -> string -> unit =
> "stub_xl_send_debug_keys"
>
> -let _ = Callback.register_exception "Xenlight.Error" (Error(""))
> +let _ = Callback.register_exception "Xenlight.Error" (Error(Fail, ""))
> diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/libs/xl/xenlight.mli.in
> --- a/tools/ocaml/libs/xl/xenlight.mli.in     Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight.mli.in     Tue Nov 20 17:22:21 2012
> +0000
> @@ -15,7 +15,32 @@
>
>  open Xentoollog
>
> -exception Error of string
> +type error =
> +    Nonspecific |
> +    Version |
> +    Fail |
> +    Ni |
> +    Nomem |
> +    Inval |
> +    Badfail |
> +    Guest_Timedout |
> +    Timedout |
> +    Noparavirt |
> +    Not_Ready |
> +    Osevent_Reg_Fail |
> +    Bufferfull |
> +    Unknown_Child
> +
> +val string_of_error: error -> string
> +
> +exception Error of (error * string)
> +
> +type ctx
> +
> +external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
> +external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
> +
> +external test_raise_exception: unit = "stub_raise_exception"
>
>  type domid = int
>  type devid = int
> @@ -24,9 +49,6 @@ type devid = int
>
>  type ctx
>
> -external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
> -external ctx_free: ctx -> unit = "stub_libxl_ctx_free"
> -
>  external list_domain: ctx -> Dominfo.t list = "stub_libxl_list_domain"
>
>  external send_trigger : domid -> trigger -> int -> unit =
> "stub_xl_send_trigger"
> diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/libs/xl/xenlight_stubs.c
> --- a/tools/ocaml/libs/xl/xenlight_stubs.c    Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/libs/xl/xenlight_stubs.c    Tue Nov 20 17:22:21 2012
> +0000
> @@ -43,12 +43,54 @@ static char * dup_String_val(value s)
>       return c;
>  }
>
> -static void failwith_xl(char *fname)
> +static value Val_error(int error)
>  {
> +     switch (error) {
> +     case ERROR_NONSPECIFIC: return Val_int(0);
> +     case ERROR_VERSION:     return Val_int(1);
> +     case ERROR_FAIL:        return Val_int(2);
> +     case ERROR_NI:          return Val_int(3);
> +     case ERROR_NOMEM:       return Val_int(4);
> +     case ERROR_INVAL:       return Val_int(5);
> +     case ERROR_BADFAIL:     return Val_int(6);
> +     case ERROR_GUEST_TIMEDOUT: return Val_int(7);
> +     case ERROR_TIMEDOUT:    return Val_int(8);
> +     case ERROR_NOPARAVIRT:  return Val_int(9);
> +     case ERROR_NOT_READY:   return Val_int(10);
> +     case ERROR_OSEVENT_REG_FAIL: return Val_int(11);
> +     case ERROR_BUFFERFULL:  return Val_int(12);
> +     case ERROR_UNKNOWN_CHILD: return Val_int(13); #if 0 /* Let the
> +compiler catch this */
> +     default:
> +             caml_raise_sys_error(caml_copy_string("Unknown libxl
> ERROR"));
> +             break;
> +#endif
> +     }
> +     /* Should not reach here */
> +     abort();
> +}
> +
> +static void failwith_xl(int error, char *fname) {
> +     CAMLlocal1(arg);
>       value *exc = caml_named_value("Xenlight.Error");
> +
>       if (!exc)
>               caml_invalid_argument("Exception Xenlight.Error not
> initialized, please link xl.cma");
> -     caml_raise_with_string(*exc, fname);
> +
> +     arg = caml_alloc_small(2, 0);
> +
> +     Field(arg, 0) = Val_error(error);
> +     Field(arg, 1) = caml_copy_string(fname);
> +
> +     caml_raise_with_arg(*exc, arg);
> +}
> +
> +CAMLprim value stub_raise_exception(value unit) {
> +     CAMLparam1(unit);
> +     failwith_xl(ERROR_FAIL, "test exception");
> +     CAMLreturn(Val_unit);
>  }
>
>  CAMLprim value stub_libxl_ctx_alloc(value logger) @@ -60,7 +102,7 @@
> CAMLprim value stub_libxl_ctx_alloc(valu
>       caml_enter_blocking_section();
>       ret = libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (struct
> xentoollog_logger *) logger);
>       if (ret != 0) \
> -             failwith_xl("cannot init context");
> +             failwith_xl(ERROR_FAIL, "cannot init context");
>       caml_leave_blocking_section();
>       CAMLreturn((value)ctx);
>  }
> @@ -190,7 +232,7 @@ static int Bitmap_val(libxl_ctx *ctx, li
>       int i, len = Wosize_val(v);
>
>       if (!libxl_bitmap_alloc(ctx, c_val, len))
> -             failwith_xl("cannot allocate bitmap");
> +             failwith_xl(ERROR_NOMEM, "cannot allocate bitmap");
>       for (i=0; i<len; i++) {
>               if (Int_val(Field(v, i)))
>                       libxl_bitmap_set(c_val, i);
> @@ -295,7 +337,7 @@ value stub_libxl_list_domain(value ctx)
>
>       info = libxl_list_domain(CTX, &nr);
>       if (info == NULL)
> -             failwith_xl("list_domain");
> +             failwith_xl(ERROR_FAIL, "list_domain");
>
>       cli = Val_emptylist;
>
> @@ -332,7 +374,7 @@ value stub_xl_device_##type##_##op(value
>       libxl_device_##type##_dispose(&c_info);
>       \
>                                                                       \
>       if (ret != 0)                                                   \
> -             failwith_xl(STRINGIFY(type) "_" STRINGIFY(op));
>       \
> +             failwith_xl(ret, STRINGIFY(type) "_" STRINGIFY(op));    \
>                                                                       \
>       CAMLreturn(Val_unit);                                           \
>  }
> @@ -358,7 +400,7 @@ value stub_xl_physinfo_get(value ctx)
>       ret = libxl_get_physinfo(CTX, &c_physinfo);
>
>       if (ret != 0)
> -             failwith_xl("get_physinfo");
> +             failwith_xl(ret, "get_physinfo");
>
>       physinfo = Val_physinfo(CTX, &c_physinfo);
>
> @@ -377,7 +419,7 @@ value stub_xl_cputopology_get(value ctx)
>       c_topology = libxl_get_cpu_topology(CTX, &nr);
>
>       if (!c_topology)
> -             failwith_xl("topologyinfo");
> +             failwith_xl(ERROR_FAIL, "get_cpu_topologyinfo");
>
>       topology = caml_alloc_tuple(nr);
>       for (i = 0; i < nr; i++) {
> @@ -402,7 +444,7 @@ value stub_xl_domain_sched_params_get(va
>
>       ret = libxl_domain_sched_params_get(CTX, Int_val(domid),
> &c_scinfo);
>       if (ret != 0)
> -             failwith_xl("domain_sched_params_get");
> +             failwith_xl(ret, "domain_sched_params_get");
>
>       scinfo = Val_domain_sched_params(CTX, &c_scinfo);
>
> @@ -424,7 +466,7 @@ value stub_xl_domain_sched_params_set(va
>       libxl_domain_sched_params_dispose(&c_scinfo);
>
>       if (ret != 0)
> -             failwith_xl("domain_sched_params_set");
> +             failwith_xl(ret, "domain_sched_params_set");
>
>       CAMLreturn(Val_unit);
>  }
> @@ -441,7 +483,7 @@ value stub_xl_send_trigger(value ctx, va
>                                c_trigger, Int_val(vcpuid));
>
>       if (ret != 0)
> -             failwith_xl("send_trigger");
> +             failwith_xl(ret, "send_trigger");
>
>       CAMLreturn(Val_unit);
>  }
> @@ -454,7 +496,7 @@ value stub_xl_send_sysrq(value ctx, valu
>       ret = libxl_send_sysrq(CTX, Int_val(domid), Int_val(sysrq));
>
>       if (ret != 0)
> -             failwith_xl("send_sysrq");
> +             failwith_xl(ret, "send_sysrq");
>
>       CAMLreturn(Val_unit);
>  }
> @@ -469,7 +511,7 @@ value stub_xl_send_debug_keys(value ctx,
>
>       ret = libxl_send_debug_keys(CTX, c_keys);
>       if (ret != 0)
> -             failwith_xl("send_debug_keys");
> +             failwith_xl(ret, "send_debug_keys");
>
>       free(c_keys);
>
> diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/test/Makefile
> --- a/tools/ocaml/test/Makefile       Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/test/Makefile       Tue Nov 20 17:22:21 2012 +0000
> @@ -6,9 +6,9 @@ OCAMLINCLUDE += \
>       -I $(OCAML_TOPLEVEL)/libs/xentoollog \
>       -I $(OCAML_TOPLEVEL)/libs/xl
>
> -OBJS = xtl send_debug_keys list_domains
> +OBJS = xtl send_debug_keys list_domains raise_exception
>
> -PROGRAMS = xtl send_debug_keys list_domains
> +PROGRAMS = xtl send_debug_keys list_domains raise_exception
>
>  xtl_LIBS =  \
>       -ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog
> $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa
> @@ -27,7 +27,13 @@ list_domains_LIBS =  \
>
>  list_domains_OBJS = list_domains
>
> -OCAML_PROGRAM = xtl send_debug_keys list_domains
> +raise_exception_LIBS =  \
> +     -ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog
> $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
> +     -ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl
> +$(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
> +
> +raise_exception_OBJS = raise_exception
> +
> +OCAML_PROGRAM = xtl send_debug_keys list_domains raise_exception
>
>  all: $(PROGRAMS)
>
> diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/test/list_domains.ml
> --- a/tools/ocaml/test/list_domains.ml        Tue Nov 20 17:22:21 2012
> +0000
> +++ b/tools/ocaml/test/list_domains.ml        Tue Nov 20 17:22:21 2012
> +0000
> @@ -19,8 +19,11 @@ let print_dominfo dominfo =  let _ =
>    let logger = Xentoollog.create_stdio_logger (*~level:Xentoollog.Debug*) ()
> in
>    let ctx = Xenlight.ctx_alloc logger in
> -  let domains = Xenlight.list_domain ctx in
> -  List.iter (fun d -> print_dominfo d) domains;
> -  Xenlight.ctx_free ctx;
> -  Xentoollog.destroy logger;
> -
> +  try
> +    let domains = Xenlight.list_domain ctx in
> +    List.iter (fun d -> print_dominfo d) domains;
> +    Xenlight.ctx_free ctx;
> +    Xentoollog.destroy logger;
> +  with Xenlight.Error(err, fn) -> begin
> +    printf "Caught Exception: %s: %s\n" (Xenlight.string_of_error err)
> + fn;  end
> diff -r e4525795eac2 -r c8d22bfef298 tools/ocaml/test/raise_exception.ml
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/ocaml/test/raise_exception.ml     Tue Nov 20 17:22:21 2012
> +0000
> @@ -0,0 +1,15 @@
> +open Printf
> +open Xentoollog
> +open Xenlight
> +
> +let _ =
> +  let logger = Xentoollog.create_stdio_logger
> +(*~level:Xentoollog.Debug*) () in
> +  let ctx = Xenlight.ctx_alloc logger in
> +  try
> +    Xenlight.test_raise_exception ()
> +  with Xenlight.Error(err, fn) -> begin
> +    printf "Caught Exception: %s: %s\n" (Xenlight.string_of_error err)
> +fn;
> +  end;
> +  Xenlight.ctx_free ctx;
> +  Xentoollog.destroy logger;
> +
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:14:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:14:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOYN-000445-3I; Fri, 30 Nov 2012 11:14:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1TeOYL-00043e-84; Fri, 30 Nov 2012 11:14:41 +0000
Received: from [85.158.138.51:31185] by server-16.bemta-3.messagelabs.com id
	39/58-07461-02598B05; Fri, 30 Nov 2012 11:14:40 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1354274078!28607604!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15095 invoked from network); 30 Nov 2012 11:14:39 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:14:39 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16088911"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 11:14:08 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Fri, 30 Nov 2012
	11:14:08 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Fri, 30 Nov 2012 11:14:07 +0000
Thread-Topic: [Xen-devel] [PATCH 14 of 15] libxl: ocaml: generate
	libxl_domain_config bindings
Thread-Index: Ac3HRyOx4kmvHg4aSlag3RiIX1rRQwHpKGCA
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107B9@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<41f0137955f4a1a5a76a.1353432214@cosworth.uk.xensource.com>
In-Reply-To: <41f0137955f4a1a5a76a.1353432214@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 14 of 15] libxl: ocaml:
	generate	libxl_domain_config bindings
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> 41f0137955f4a1a5a76ad34a5a6440e32d0090ef
> # Parent  c8d22bfef298ce525c98b5a3f0c394068ab01572
> libxl: ocaml: generate libxl_domain_config bindings
> 
> With the infrastructure we now have in place this is trivial.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Acked-by: Rob Hoes <rob.hoes@citrix.com>

> diff -r c8d22bfef298 -r 41f0137955f4 tools/libxl/libxl_types.idl
> --- a/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:21 2012 +0000
> @@ -417,7 +417,7 @@ libxl_domain_config = Struct("domain_con
>      ("on_reboot", libxl_action_on_shutdown),
>      ("on_watchdog", libxl_action_on_shutdown),
>      ("on_crash", libxl_action_on_shutdown),
> -    ])
> +    ], dir=DIR_IN)
> 
>  libxl_diskinfo = Struct("diskinfo", [
>      ("backend", string),
> diff -r c8d22bfef298 -r 41f0137955f4 tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -420,7 +420,6 @@ if __name__ == '__main__':
>      # Do not generate these yet.
>      blacklist = [
>          "cpupoolinfo",
> -        "domain_config",
>          "vcpuinfo",
>          ]
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:14:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:14:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOYN-000445-3I; Fri, 30 Nov 2012 11:14:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Rob.Hoes@citrix.com>)
	id 1TeOYL-00043e-84; Fri, 30 Nov 2012 11:14:41 +0000
Received: from [85.158.138.51:31185] by server-16.bemta-3.messagelabs.com id
	39/58-07461-02598B05; Fri, 30 Nov 2012 11:14:40 +0000
X-Env-Sender: Rob.Hoes@citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1354274078!28607604!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15095 invoked from network); 30 Nov 2012 11:14:39 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:14:39 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16088911"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 11:14:08 +0000
Received: from LONPMAILBOX01.citrite.net ([10.30.224.161]) by
	LONPMAILMX01.citrite.net ([10.30.203.162]) with mapi; Fri, 30 Nov 2012
	11:14:08 +0000
From: Rob Hoes <Rob.Hoes@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org"
	<xen-devel@lists.xen.org>, "xen-api@lists.xen.org" <xen-api@lists.xen.org>
Date: Fri, 30 Nov 2012 11:14:07 +0000
Thread-Topic: [Xen-devel] [PATCH 14 of 15] libxl: ocaml: generate
	libxl_domain_config bindings
Thread-Index: Ac3HRyOx4kmvHg4aSlag3RiIX1rRQwHpKGCA
Message-ID: <7EA643C653F17F4C80DE959E978F10EDFA101107B9@LONPMAILBOX01.citrite.net>
References: <patchbomb.1353432200@cosworth.uk.xensource.com>
	<41f0137955f4a1a5a76a.1353432214@cosworth.uk.xensource.com>
In-Reply-To: <41f0137955f4a1a5a76a.1353432214@cosworth.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: Re: [Xen-devel] [PATCH 14 of 15] libxl: ocaml:
	generate	libxl_domain_config bindings
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> # HG changeset patch
> # User Ian Campbell <ijc@hellion.org.uk> # Date 1353432141 0 # Node ID
> 41f0137955f4a1a5a76ad34a5a6440e32d0090ef
> # Parent  c8d22bfef298ce525c98b5a3f0c394068ab01572
> libxl: ocaml: generate libxl_domain_config bindings
> 
> With the infrastructure we now have in place this is trivial.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Acked-by: Rob Hoes <rob.hoes@citrix.com>

> diff -r c8d22bfef298 -r 41f0137955f4 tools/libxl/libxl_types.idl
> --- a/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/libxl/libxl_types.idl	Tue Nov 20 17:22:21 2012 +0000
> @@ -417,7 +417,7 @@ libxl_domain_config = Struct("domain_con
>      ("on_reboot", libxl_action_on_shutdown),
>      ("on_watchdog", libxl_action_on_shutdown),
>      ("on_crash", libxl_action_on_shutdown),
> -    ])
> +    ], dir=DIR_IN)
> 
>  libxl_diskinfo = Struct("diskinfo", [
>      ("backend", string),
> diff -r c8d22bfef298 -r 41f0137955f4 tools/ocaml/libs/xl/genwrap.py
> --- a/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> +++ b/tools/ocaml/libs/xl/genwrap.py	Tue Nov 20 17:22:21 2012 +0000
> @@ -420,7 +420,6 @@ if __name__ == '__main__':
>      # Do not generate these yet.
>      blacklist = [
>          "cpupoolinfo",
> -        "domain_config",
>          "vcpuinfo",
>          ]
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:15:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:15:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOYu-0004Cc-He; Fri, 30 Nov 2012 11:15:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TeOYt-0004CD-7i
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:15:15 +0000
Received: from [85.158.143.35:4149] by server-3.bemta-4.messagelabs.com id
	8D/AF-06841-24598B05; Fri, 30 Nov 2012 11:15:14 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1354274113!15735081!1
X-Originating-IP: [74.125.82.53]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15922 invoked from network); 30 Nov 2012 11:15:13 -0000
Received: from mail-wg0-f53.google.com (HELO mail-wg0-f53.google.com)
	(74.125.82.53)
	by server-14.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:15:13 -0000
Received: by mail-wg0-f53.google.com with SMTP id ei8so113886wgb.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 03:15:13 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=aXYWS9KNSM2NKsyk4JlTzXEJXSe0z1S/9Rg9QnHVrA4=;
	b=ejJU/qonzfXeQ5xNkRbQpSEESLT3XHAiOW2jQX6/DAG6gqhgiducd9TXySMGuH7krZ
	HQ44WTCm6wY2aLUujW17C13rObUT2ScWChpVePyausIGcJdyZ1ltibx1WpyDcJPHDRg+
	wStBPSomkcIw8f1tTEQFB8XUNNhOHMO0+k7nsVg5Y+LApSgrH4cr4HHOVcSsqxa3843E
	4GJyAjvvL4Z2ybINuqWlZKDtXLuKtmKfLf8V85MFsxfyI+cqjL+tM5mL6Fu8XmiLHlco
	VhHaD2NzdNR9eMq/lGbWEeVZGc9n6boRWyb0CZki4626kioYFf+WyQiRjqOs0VSe3JQb
	NF1w==
Received: by 10.180.93.3 with SMTP id cq3mr43568451wib.1.1354274112977;
	Fri, 30 Nov 2012 03:15:12 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id dm3sm14827228wib.9.2012.11.30.03.15.08
	(version=SSLv3 cipher=OTHER); Fri, 30 Nov 2012 03:15:12 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Fri, 30 Nov 2012 11:14:57 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCDE45B1.54678%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] AMD IOMMU: add locking missing from c/s
	26198:ba90ecb0231f
Thread-Index: Ac3O6+4LgOaOu4NLA0mY2dm+sGi5kQ==
In-Reply-To: <50B8762102000078000ACBC6@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>
Subject: Re: [Xen-devel] [PATCH] AMD IOMMU: add locking missing from c/s
 26198:ba90ecb0231f
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/2012 08:02, "Jan Beulich" <JBeulich@suse.com> wrote:

> An oversight of mine; I'm sorry.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -795,6 +795,7 @@ static bool_t __init set_iommu_interrupt
>  static void enable_iommu(struct amd_iommu *iommu)
>  {
>      unsigned long flags;
> +    struct irq_desc *desc;
>  
>      spin_lock_irqsave(&iommu->lock, flags);
>  
> @@ -812,7 +813,11 @@ static void enable_iommu(struct amd_iomm
>      if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
>          register_iommu_ppr_log_in_mmio_space(iommu);
>  
> -    set_msi_affinity(irq_to_desc(iommu->msi.irq), &cpu_online_map);
> +    desc = irq_to_desc(iommu->msi.irq);
> +    spin_lock(&desc->lock);
> +    set_msi_affinity(desc, &cpu_online_map);
> +    spin_unlock(&desc->lock);
> +
>      amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
>  
>      set_iommu_ht_flags(iommu);
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:15:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:15:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOYu-0004Cc-He; Fri, 30 Nov 2012 11:15:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TeOYt-0004CD-7i
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:15:15 +0000
Received: from [85.158.143.35:4149] by server-3.bemta-4.messagelabs.com id
	8D/AF-06841-24598B05; Fri, 30 Nov 2012 11:15:14 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1354274113!15735081!1
X-Originating-IP: [74.125.82.53]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15922 invoked from network); 30 Nov 2012 11:15:13 -0000
Received: from mail-wg0-f53.google.com (HELO mail-wg0-f53.google.com)
	(74.125.82.53)
	by server-14.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:15:13 -0000
Received: by mail-wg0-f53.google.com with SMTP id ei8so113886wgb.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 03:15:13 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=aXYWS9KNSM2NKsyk4JlTzXEJXSe0z1S/9Rg9QnHVrA4=;
	b=ejJU/qonzfXeQ5xNkRbQpSEESLT3XHAiOW2jQX6/DAG6gqhgiducd9TXySMGuH7krZ
	HQ44WTCm6wY2aLUujW17C13rObUT2ScWChpVePyausIGcJdyZ1ltibx1WpyDcJPHDRg+
	wStBPSomkcIw8f1tTEQFB8XUNNhOHMO0+k7nsVg5Y+LApSgrH4cr4HHOVcSsqxa3843E
	4GJyAjvvL4Z2ybINuqWlZKDtXLuKtmKfLf8V85MFsxfyI+cqjL+tM5mL6Fu8XmiLHlco
	VhHaD2NzdNR9eMq/lGbWEeVZGc9n6boRWyb0CZki4626kioYFf+WyQiRjqOs0VSe3JQb
	NF1w==
Received: by 10.180.93.3 with SMTP id cq3mr43568451wib.1.1354274112977;
	Fri, 30 Nov 2012 03:15:12 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id dm3sm14827228wib.9.2012.11.30.03.15.08
	(version=SSLv3 cipher=OTHER); Fri, 30 Nov 2012 03:15:12 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Fri, 30 Nov 2012 11:14:57 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xen.org>
Message-ID: <CCDE45B1.54678%keir@xen.org>
Thread-Topic: [Xen-devel] [PATCH] AMD IOMMU: add locking missing from c/s
	26198:ba90ecb0231f
Thread-Index: Ac3O6+4LgOaOu4NLA0mY2dm+sGi5kQ==
In-Reply-To: <50B8762102000078000ACBC6@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: Wei Huang <wei.huang2@amd.com>, Wei Wang <weiwang.dd@gmail.com>
Subject: Re: [Xen-devel] [PATCH] AMD IOMMU: add locking missing from c/s
 26198:ba90ecb0231f
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/2012 08:02, "Jan Beulich" <JBeulich@suse.com> wrote:

> An oversight of mine; I'm sorry.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -795,6 +795,7 @@ static bool_t __init set_iommu_interrupt
>  static void enable_iommu(struct amd_iommu *iommu)
>  {
>      unsigned long flags;
> +    struct irq_desc *desc;
>  
>      spin_lock_irqsave(&iommu->lock, flags);
>  
> @@ -812,7 +813,11 @@ static void enable_iommu(struct amd_iomm
>      if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
>          register_iommu_ppr_log_in_mmio_space(iommu);
>  
> -    set_msi_affinity(irq_to_desc(iommu->msi.irq), &cpu_online_map);
> +    desc = irq_to_desc(iommu->msi.irq);
> +    spin_lock(&desc->lock);
> +    set_msi_affinity(desc, &cpu_online_map);
> +    spin_unlock(&desc->lock);
> +
>      amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
>  
>      set_iommu_ht_flags(iommu);
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:15:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:15:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOYz-0004EG-VH; Fri, 30 Nov 2012 11:15:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TeOYy-0004DX-Jz
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 11:15:20 +0000
Received: from [85.158.137.99:39623] by server-1.bemta-3.messagelabs.com id
	C3/10-12169-74598B05; Fri, 30 Nov 2012 11:15:19 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1354274115!16457155!1
X-Originating-IP: [74.125.82.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11092 invoked from network); 30 Nov 2012 11:15:15 -0000
Received: from mail-wg0-f45.google.com (HELO mail-wg0-f45.google.com)
	(74.125.82.45)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:15:15 -0000
Received: by mail-wg0-f45.google.com with SMTP id dq12so154086wgb.24
	for <xen-devel@lists.xensource.com>;
	Fri, 30 Nov 2012 03:15:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=gIW8gWXy8QyltkFTRscXeMv318O4OZttqjRTlQaF2Sk=;
	b=tc+Za8EO7JdgnTJYXoZ6LOYadj5DKl4eWJssZxGuUlXMjOUv5VL9SdVY5hSCmJKYGk
	93Ow3PGLiDfduzeBqHChCNmA9UkqEKI/B4xwQz/4FvGMj+m0H2plihZSFWkT0fZ31Dpr
	5kaP3E7W98OeT34TL5Xo5UY7iYJ3p2W4gpbf5i6o5s2wAhEFLMk9CRGeJFEmkQ4fb5DR
	RYw0jxckYatNCtTDuYZvnMkfyvgf0LReTFUm+BioiqH5b7mCSSx3R1d+DgKP9zs+rkX3
	DHxQ9zESc1Bc4jQ7b37334RCDz7RJuRaUy22obsSpZWBmNaadpr3t6avPpTGQ6fPjvSl
	TDgA==
Received: by 10.180.33.202 with SMTP id t10mr1483523wii.3.1354274114788;
	Fri, 30 Nov 2012 03:15:14 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id dm3sm14827228wib.9.2012.11.30.03.15.13
	(version=SSLv3 cipher=OTHER); Fri, 30 Nov 2012 03:15:14 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Fri, 30 Nov 2012 11:15:11 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <CCDE45BF.54679%keir@xen.org>
Thread-Topic: [Xen-devel] [xen-unstable test] 14494: regressions - FAIL
Thread-Index: Ac3O6/ZkkvfcN4ukJEu7N2asZJFW0g==
In-Reply-To: <50B88EE702000078000ACC87@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [xen-unstable test] 14494: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/2012 09:48, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 30.11.12 at 10:39, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> On Thu, 2012-11-29 at 21:13 +0000, xen.org wrote:
>>> flight 14494 xen-unstable real [real]
>>> http://www.chiark.greenend.org.uk/~xensrcts/logs/14494/
>>> 
>>> Regressions :-(
>>> 
>>> Tests which did not succeed and are blocking,
>>> including tests which could not be run:
>>>  test-amd64-amd64-pv           5 xen-boot                  fail REGR. vs.
>> 14482
>> 
>> Jan, I assume this relates to your "AMD IOMMU: add locking missing from
>> c/s 26198:ba90ecb0231f" from this morning?
> 
> Yes, that patch was prompted by these failures. I'll be in the
> office today only until about 1pm, so I'll wait for a little more to
> see if I can get e.g. Keir's ack on it, but will try to remember to
> commit it even without before leaving.

I have just sent an Ack.

 K.

> Jan
> 
>> Nov 29 17:53:03.732540 (XEN) Assertion 'spin_is_locked(&desc->lock)'
>> failed at msi.c:276
>> Nov 29 17:53:03.740545 (XEN) ----[ Xen-4.3-unstable  x86_64  debug=y  Not
>> tainted ]----
>> Nov 29 17:53:03.748543 (XEN) CPU:    0
>> Nov 29 17:53:03.748570 (XEN) RIP:    e008:[<ffff82c48016607d>]
>> set_msi_affinity+0x4a/0x1ba
>> Nov 29 17:53:03.756539 (XEN) RFLAGS: 0000000000010046   CONTEXT: hypervisor
>> Nov 29 17:53:03.764538 (XEN) rax: 0000000000000000   rbx: ffff830116381880
>> rcx: 0000000000000000
>> Nov 29 17:53:03.772548 (XEN) rdx: 0000000000000082   rsi: ffff82c480260280
>> rdi: ffff8301163818a8
>> Nov 29 17:53:03.780548 (XEN) rbp: ffff82c4802bfd78   rsp: ffff82c4802bfd28
>> r8:  0000000000000020
>> Nov 29 17:53:03.788548 (XEN) r9:  0000000000000081   r10: 0000000000000001
>> r11: ffff82c4802cbe40
>> Nov 29 17:53:03.796542 (XEN) r12: ffff8301163f0370   r13: 0000000000000001
>> r14: 0000000000000296
>> Nov 29 17:53:03.804547 (XEN) r15: ffff82c4802e7f88   cr0: 000000008005003b
>> cr4: 00000000000006f0
>> Nov 29 17:53:03.812547 (XEN) cr3: 00000000dfc6f000   cr2: 0000000000000000
>> Nov 29 17:53:03.820532 (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss:
>> 0000   cs: e008
>> Nov 29 17:53:03.828539 (XEN) Xen stack trace from rsp=ffff82c4802bfd28:
>> Nov 29 17:53:03.832541 (XEN)    ffff82c4802bfd38 0000000000000282
>> ffff82c4802bfd68 ffff82c480291d5a
>> Nov 29 17:53:03.840548 (XEN)    0000000000000018 ffff8301163f0350
>> ffff8301163f0360 ffff82c4802e7f80
>> Nov 29 17:53:03.848549 (XEN)    0000000000000296 ffff82c4802e7f88
>> ffff82c4802bfdb8 ffff82c48014cea4
>> Nov 29 17:53:03.856541 (XEN)    ffff82c3fffff000 ffff8301163f0350
>> ffff82c3fffff000 ffff82c4802e7f80
>> Nov 29 17:53:03.864553 (XEN)    ffff82c4802e7f90 ffff82c4802e7f88
>> ffff82c4802bfe18 ffff82c480288e98
>> Nov 29 17:53:03.872548 (XEN)    ffff8301163fbfe0 0000000000000018
>> ffff830116381880 000000188028d379
>> Nov 29 17:53:03.884540 (XEN)    00000000e0000000 00000000ffffffed
>> 0000000000000000 ffff8301163fbfe0
>> Nov 29 17:53:03.892538 (XEN)    0000000000000002 0000000000000002
>> ffff82c4802bfe28 ffff82c480289256
>> Nov 29 17:53:03.900541 (XEN)    ffff82c4802bfe48 ffff82c480285fce
>> ffff82c4802b8000 ffff830000089fb0
>> Nov 29 17:53:03.908541 (XEN)    ffff82c4802bff08 ffff82c4802975f5
>> 0000000000000000 0000000000000000
>> Nov 29 17:53:03.916541 (XEN)    ffff830000089dd0 0000000000f10000
>> 00000000dfa00000 0000000000000000
>> Nov 29 17:53:03.924538 (XEN)    0000000000301780 ffff82c4ffffffff
>> ffff830000000003 ffff830000089f30
>> Nov 29 17:53:03.932544 (XEN)    ffff830000089fb0 ffff82c4ffffffff
>> 0000000800000000 000000010000006e
>> Nov 29 17:53:03.940546 (XEN)    0000000000000003 00000000000002f8
>> 0000000000000000 0000000000000000
>> Nov 29 17:53:03.948545 (XEN)    0000000000000000 0000000000000000
>> 0000000000000000 0000000000000000
>> Nov 29 17:53:03.956546 (XEN)    000000000007fe0c ffff82c4801000b5
>> 0000000000000000 0000000000000000
>> Nov 29 17:53:03.964546 (XEN)    0000000000000000 0000000000000000
>> 0000000000000000 0000000000000000
>> Nov 29 17:53:03.972545 (XEN)    0000000000000000 0000000000000000
>> 0000000000000000 0000000000000000
>> Nov 29 17:53:03.980545 (XEN)    0000000000000000 0000000000000000
>> 0000000000000000 0000000000000000
>> Nov 29 17:53:03.988548 (XEN)    0000000000000000 0000000000000000
>> 0000000000000000 0000000000000000
>> Nov 29 17:53:03.996551 (XEN) Xen call trace:
>> Nov 29 17:53:04.000522 (XEN)    [<ffff82c48016607d>]
>> set_msi_affinity+0x4a/0x1ba
>> Nov 29 17:53:04.008538 (XEN)    [<ffff82c48014cea4>] enable_iommu+0x54d/0x68f
>> Nov 29 17:53:04.012543 (XEN)    [<ffff82c480288e98>]
>> amd_iommu_init+0x4d0/0x65a
>> Nov 29 17:53:04.020542 (XEN)    [<ffff82c480289256>] amd_iov_detect+0x6c/0xf6
>> Nov 29 17:53:04.028535 (XEN)    [<ffff82c480285fce>] iommu_setup+0x67/0x143
>> Nov 29 17:53:04.032533 (XEN)    [<ffff82c4802975f5>]
>> __start_xen+0x269d/0x2acd
>> Nov 29 17:53:04.040537 (XEN)
>> Nov 29 17:53:04.040559 (XEN)
>> Nov 29 17:53:04.040581 (XEN) ****************************************
>> Nov 29 17:53:04.048557 (XEN) Panic on CPU 0:
>> Nov 29 17:53:04.052523 (XEN) Assertion 'spin_is_locked(&desc->lock)' failed
>> at 
>> msi.c:276
>> Nov 29 17:53:04.060538 (XEN) ****************************************
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:15:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:15:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOYz-0004EG-VH; Fri, 30 Nov 2012 11:15:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <keir.xen@gmail.com>) id 1TeOYy-0004DX-Jz
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 11:15:20 +0000
Received: from [85.158.137.99:39623] by server-1.bemta-3.messagelabs.com id
	C3/10-12169-74598B05; Fri, 30 Nov 2012 11:15:19 +0000
X-Env-Sender: keir.xen@gmail.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1354274115!16457155!1
X-Originating-IP: [74.125.82.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11092 invoked from network); 30 Nov 2012 11:15:15 -0000
Received: from mail-wg0-f45.google.com (HELO mail-wg0-f45.google.com)
	(74.125.82.45)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:15:15 -0000
Received: by mail-wg0-f45.google.com with SMTP id dq12so154086wgb.24
	for <xen-devel@lists.xensource.com>;
	Fri, 30 Nov 2012 03:15:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic
	:thread-index:in-reply-to:mime-version:content-type
	:content-transfer-encoding;
	bh=gIW8gWXy8QyltkFTRscXeMv318O4OZttqjRTlQaF2Sk=;
	b=tc+Za8EO7JdgnTJYXoZ6LOYadj5DKl4eWJssZxGuUlXMjOUv5VL9SdVY5hSCmJKYGk
	93Ow3PGLiDfduzeBqHChCNmA9UkqEKI/B4xwQz/4FvGMj+m0H2plihZSFWkT0fZ31Dpr
	5kaP3E7W98OeT34TL5Xo5UY7iYJ3p2W4gpbf5i6o5s2wAhEFLMk9CRGeJFEmkQ4fb5DR
	RYw0jxckYatNCtTDuYZvnMkfyvgf0LReTFUm+BioiqH5b7mCSSx3R1d+DgKP9zs+rkX3
	DHxQ9zESc1Bc4jQ7b37334RCDz7RJuRaUy22obsSpZWBmNaadpr3t6avPpTGQ6fPjvSl
	TDgA==
Received: by 10.180.33.202 with SMTP id t10mr1483523wii.3.1354274114788;
	Fri, 30 Nov 2012 03:15:14 -0800 (PST)
Received: from [192.168.1.3] (host86-183-153-239.range86-183.btcentralplus.com.
	[86.183.153.239])
	by mx.google.com with ESMTPS id dm3sm14827228wib.9.2012.11.30.03.15.13
	(version=SSLv3 cipher=OTHER); Fri, 30 Nov 2012 03:15:14 -0800 (PST)
User-Agent: Microsoft-Entourage/12.34.0.120813
Date: Fri, 30 Nov 2012 11:15:11 +0000
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Message-ID: <CCDE45BF.54679%keir@xen.org>
Thread-Topic: [Xen-devel] [xen-unstable test] 14494: regressions - FAIL
Thread-Index: Ac3O6/ZkkvfcN4ukJEu7N2asZJFW0g==
In-Reply-To: <50B88EE702000078000ACC87@nat28.tlf.novell.com>
Mime-version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Xen-devel] [xen-unstable test] 14494: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/2012 09:48, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 30.11.12 at 10:39, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> On Thu, 2012-11-29 at 21:13 +0000, xen.org wrote:
>>> flight 14494 xen-unstable real [real]
>>> http://www.chiark.greenend.org.uk/~xensrcts/logs/14494/
>>> 
>>> Regressions :-(
>>> 
>>> Tests which did not succeed and are blocking,
>>> including tests which could not be run:
>>>  test-amd64-amd64-pv           5 xen-boot                  fail REGR. vs.
>> 14482
>> 
>> Jan, I assume this relates to your "AMD IOMMU: add locking missing from
>> c/s 26198:ba90ecb0231f" from this morning?
> 
> Yes, that patch was prompted by these failures. I'll be in the
> office today only until about 1pm, so I'll wait for a little more to
> see if I can get e.g. Keir's ack on it, but will try to remember to
> commit it even without before leaving.

I have just sent an Ack.

 K.

> Jan
> 
>> Nov 29 17:53:03.732540 (XEN) Assertion 'spin_is_locked(&desc->lock)'
>> failed at msi.c:276
>> Nov 29 17:53:03.740545 (XEN) ----[ Xen-4.3-unstable  x86_64  debug=y  Not
>> tainted ]----
>> Nov 29 17:53:03.748543 (XEN) CPU:    0
>> Nov 29 17:53:03.748570 (XEN) RIP:    e008:[<ffff82c48016607d>]
>> set_msi_affinity+0x4a/0x1ba
>> Nov 29 17:53:03.756539 (XEN) RFLAGS: 0000000000010046   CONTEXT: hypervisor
>> Nov 29 17:53:03.764538 (XEN) rax: 0000000000000000   rbx: ffff830116381880
>> rcx: 0000000000000000
>> Nov 29 17:53:03.772548 (XEN) rdx: 0000000000000082   rsi: ffff82c480260280
>> rdi: ffff8301163818a8
>> Nov 29 17:53:03.780548 (XEN) rbp: ffff82c4802bfd78   rsp: ffff82c4802bfd28
>> r8:  0000000000000020
>> Nov 29 17:53:03.788548 (XEN) r9:  0000000000000081   r10: 0000000000000001
>> r11: ffff82c4802cbe40
>> Nov 29 17:53:03.796542 (XEN) r12: ffff8301163f0370   r13: 0000000000000001
>> r14: 0000000000000296
>> Nov 29 17:53:03.804547 (XEN) r15: ffff82c4802e7f88   cr0: 000000008005003b
>> cr4: 00000000000006f0
>> Nov 29 17:53:03.812547 (XEN) cr3: 00000000dfc6f000   cr2: 0000000000000000
>> Nov 29 17:53:03.820532 (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss:
>> 0000   cs: e008
>> Nov 29 17:53:03.828539 (XEN) Xen stack trace from rsp=ffff82c4802bfd28:
>> Nov 29 17:53:03.832541 (XEN)    ffff82c4802bfd38 0000000000000282
>> ffff82c4802bfd68 ffff82c480291d5a
>> Nov 29 17:53:03.840548 (XEN)    0000000000000018 ffff8301163f0350
>> ffff8301163f0360 ffff82c4802e7f80
>> Nov 29 17:53:03.848549 (XEN)    0000000000000296 ffff82c4802e7f88
>> ffff82c4802bfdb8 ffff82c48014cea4
>> Nov 29 17:53:03.856541 (XEN)    ffff82c3fffff000 ffff8301163f0350
>> ffff82c3fffff000 ffff82c4802e7f80
>> Nov 29 17:53:03.864553 (XEN)    ffff82c4802e7f90 ffff82c4802e7f88
>> ffff82c4802bfe18 ffff82c480288e98
>> Nov 29 17:53:03.872548 (XEN)    ffff8301163fbfe0 0000000000000018
>> ffff830116381880 000000188028d379
>> Nov 29 17:53:03.884540 (XEN)    00000000e0000000 00000000ffffffed
>> 0000000000000000 ffff8301163fbfe0
>> Nov 29 17:53:03.892538 (XEN)    0000000000000002 0000000000000002
>> ffff82c4802bfe28 ffff82c480289256
>> Nov 29 17:53:03.900541 (XEN)    ffff82c4802bfe48 ffff82c480285fce
>> ffff82c4802b8000 ffff830000089fb0
>> Nov 29 17:53:03.908541 (XEN)    ffff82c4802bff08 ffff82c4802975f5
>> 0000000000000000 0000000000000000
>> Nov 29 17:53:03.916541 (XEN)    ffff830000089dd0 0000000000f10000
>> 00000000dfa00000 0000000000000000
>> Nov 29 17:53:03.924538 (XEN)    0000000000301780 ffff82c4ffffffff
>> ffff830000000003 ffff830000089f30
>> Nov 29 17:53:03.932544 (XEN)    ffff830000089fb0 ffff82c4ffffffff
>> 0000000800000000 000000010000006e
>> Nov 29 17:53:03.940546 (XEN)    0000000000000003 00000000000002f8
>> 0000000000000000 0000000000000000
>> Nov 29 17:53:03.948545 (XEN)    0000000000000000 0000000000000000
>> 0000000000000000 0000000000000000
>> Nov 29 17:53:03.956546 (XEN)    000000000007fe0c ffff82c4801000b5
>> 0000000000000000 0000000000000000
>> Nov 29 17:53:03.964546 (XEN)    0000000000000000 0000000000000000
>> 0000000000000000 0000000000000000
>> Nov 29 17:53:03.972545 (XEN)    0000000000000000 0000000000000000
>> 0000000000000000 0000000000000000
>> Nov 29 17:53:03.980545 (XEN)    0000000000000000 0000000000000000
>> 0000000000000000 0000000000000000
>> Nov 29 17:53:03.988548 (XEN)    0000000000000000 0000000000000000
>> 0000000000000000 0000000000000000
>> Nov 29 17:53:03.996551 (XEN) Xen call trace:
>> Nov 29 17:53:04.000522 (XEN)    [<ffff82c48016607d>]
>> set_msi_affinity+0x4a/0x1ba
>> Nov 29 17:53:04.008538 (XEN)    [<ffff82c48014cea4>] enable_iommu+0x54d/0x68f
>> Nov 29 17:53:04.012543 (XEN)    [<ffff82c480288e98>]
>> amd_iommu_init+0x4d0/0x65a
>> Nov 29 17:53:04.020542 (XEN)    [<ffff82c480289256>] amd_iov_detect+0x6c/0xf6
>> Nov 29 17:53:04.028535 (XEN)    [<ffff82c480285fce>] iommu_setup+0x67/0x143
>> Nov 29 17:53:04.032533 (XEN)    [<ffff82c4802975f5>]
>> __start_xen+0x269d/0x2acd
>> Nov 29 17:53:04.040537 (XEN)
>> Nov 29 17:53:04.040559 (XEN)
>> Nov 29 17:53:04.040581 (XEN) ****************************************
>> Nov 29 17:53:04.048557 (XEN) Panic on CPU 0:
>> Nov 29 17:53:04.052523 (XEN) Assertion 'spin_is_locked(&desc->lock)' failed
>> at 
>> msi.c:276
>> Nov 29 17:53:04.060538 (XEN) ****************************************
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:21:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:21:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOey-0005Ib-KC; Fri, 30 Nov 2012 11:21:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeOex-0005IS-0i
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:21:31 +0000
Received: from [85.158.137.99:18109] by server-12.bemta-3.messagelabs.com id
	7F/C7-22757-AB698B05; Fri, 30 Nov 2012 11:21:30 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1354274488!14183956!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2282 invoked from network); 30 Nov 2012 11:21:29 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:21:29 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46150475"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 11:21:27 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 06:21:27 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TeOet-0000fK-4z;
	Fri, 30 Nov 2012 11:21:27 +0000
MIME-Version: 1.0
Message-ID: <patchbomb.1354274486@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Fri, 30 Nov 2012 11:21:26 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [PATCH 0 of 2] xl: add helpers for option parsing
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a repost of the last two patches of "xl shutdown compatibility
with xm" which were actually helpers for xl option parsing.

I've addresses Ian J's review comments on the second patch and rebased.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:21:45 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:21:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOey-0005Ib-KC; Fri, 30 Nov 2012 11:21:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeOex-0005IS-0i
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:21:31 +0000
Received: from [85.158.137.99:18109] by server-12.bemta-3.messagelabs.com id
	7F/C7-22757-AB698B05; Fri, 30 Nov 2012 11:21:30 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1354274488!14183956!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2282 invoked from network); 30 Nov 2012 11:21:29 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:21:29 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46150475"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 11:21:27 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 06:21:27 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TeOet-0000fK-4z;
	Fri, 30 Nov 2012 11:21:27 +0000
MIME-Version: 1.0
Message-ID: <patchbomb.1354274486@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Fri, 30 Nov 2012 11:21:26 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [PATCH 0 of 2] xl: add helpers for option parsing
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is a repost of the last two patches of "xl shutdown compatibility
with xm" which were actually helpers for xl option parsing.

I've addresses Ian J's review comments on the second patch and rebased.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:21:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:21:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOf6-0005Jm-Eo; Fri, 30 Nov 2012 11:21:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeOf4-0005JB-0S
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:21:38 +0000
Received: from [85.158.139.83:3905] by server-4.bemta-5.messagelabs.com id
	0D/9F-15011-1C698B05; Fri, 30 Nov 2012 11:21:37 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1354274488!27709762!2
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31874 invoked from network); 30 Nov 2012 11:21:31 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:21:31 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="215987225"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 11:21:28 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 06:21:27 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TeOet-0000fK-6H;
	Fri, 30 Nov 2012 11:21:27 +0000
MIME-Version: 1.0
X-Mercurial-Node: d4cc790b47d8735ae3f2b0c4707bfa58f90a2cd3
Message-ID: <d4cc790b47d8735ae3f2.1354274488@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1354274486@cosworth.uk.xensource.com>
References: <patchbomb.1354274486@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Fri, 30 Nov 2012 11:21:28 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [PATCH 2 of 2] xl: Introduce helper macro for option
	parsing
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1354274264 0
# Node ID d4cc790b47d8735ae3f2b0c4707bfa58f90a2cd3
# Parent  b63fbacd5037e79bc4f40429453cb59816f94793
xl: Introduce helper macro for option parsing.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
v2:
- s/FOREACH_OPT/SWITCH_FOREACH_OPT/
- Document the macro

diff -r b63fbacd5037 -r d4cc790b47d8 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Nov 30 11:17:44 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Fri Nov 30 11:17:44 2012 +0000
@@ -2297,6 +2297,10 @@ static int64_t parse_mem_size_kb(const c
 
 #define COMMON_LONG_OPTS {"help", 0, 0, 'h'}
 
+/*
+ * Callers should use SWITCH_FOREACH_OPT in preference to calling this
+ * directly.
+ */
 static int def_getopt(int argc, char * const argv[],
                       const char *optstring,
                       const struct option *longopts,
@@ -2335,6 +2339,57 @@ static int def_getopt(int argc, char * c
     return -1;
 }
 
+/*
+ * Wraps def_getopt into a convenient loop+switch to process all arguments.
+ *
+ * _opt:        an int variable, holds the current option during processing.
+ * _opts:       short options, as per getopt_long(3)'s optstring argument.
+ * _lopts:      long options, as per getopt_long(3)'s longopts argument. May
+ *              be null.
+ * _help:       name of this command, for usage string.
+ * _req:        number of non-option command line parameters which are required.
+ *
+ * In addition the calling context is expected to contain variables
+ * "argc" and "argv" in the conventional C-style:
+ *   main(int argc, char **argv)
+ * manner.
+ *
+ * Callers should treat SWITCH_FOREACH_OPT as they would a switch
+ * statement over the value of _opt. Each option given in _opts (or
+ * _lopts) should be handled by a case statement as if it were inside
+ * a switch statement.
+ *
+ * In addition to the options provided in _opts callers must handle
+ * two additional pseudo options:
+ *  0 -- generated if the user passes a -h option. help will be printed,
+ *       caller should return 0.
+ *  2 -- generated if the user does not provided _req non-option arguments,
+ *       caller should return 2.
+ *
+ * Example:
+ *
+ * int main_foo(int argc, char **argv) {
+ *     int opt;
+ *
+ *     SWITCH_FOREACH_OPT(opt, "blah", NULL, "foo", 0) {
+ *     case 0: case2:
+ *          return opt;
+ *      case 'b':
+ *          ... handle b option...
+ *          break;
+ *      case 'l':
+ *          ... handle l option ...
+ *          break;
+ *      case etc etc...
+ *      }
+ *      ... do something useful with the options ...
+ * }
+ */
+#define SWITCH_FOREACH_OPT(_opt, _opts, _lopts, _help, _req)    \
+    while (((_opt) = def_getopt(argc, argv, (_opts), (_lopts),  \
+                                (_help), (_req))) != -1)        \
+        switch (opt)
+
 static int set_memory_max(uint32_t domid, const char *mem)
 {
     int64_t memorykb;
@@ -2358,8 +2413,10 @@ int main_memmax(int argc, char **argv)
     char *mem;
     int rc;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "mem-max", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "mem-max", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind]);
     mem = argv[optind + 1];
@@ -2392,8 +2449,10 @@ int main_memset(int argc, char **argv)
     int opt = 0;
     const char *mem;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "mem-set", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "mem-set", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind]);
     mem = argv[optind + 1];
@@ -2431,8 +2490,10 @@ int main_cd_eject(int argc, char **argv)
     int opt = 0;
     const char *virtdev;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "cd-eject", 2)) != -1)
-        return opt;
+    SWITCH_FOREACH_OPT(opt, "", NULL, "cd-eject", 2) {
+        case 0: case 2:
+            return opt;
+    }
 
     domid = find_domain(argv[optind]);
     virtdev = argv[optind + 1];
@@ -2448,8 +2509,10 @@ int main_cd_insert(int argc, char **argv
     const char *virtdev;
     char *file = NULL; /* modified by cd_insert tokenising it */
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "cd-insert", 3)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "cd-insert", 3) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind]);
     virtdev = argv[optind + 1];
@@ -2465,24 +2528,22 @@ int main_console(int argc, char **argv)
     int opt = 0, num = 0;
     libxl_console_type type = 0;
 
-    while ((opt = def_getopt(argc, argv, "n:t:", NULL, "console", 1)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 't':
-            if (!strcmp(optarg, "pv"))
-                type = LIBXL_CONSOLE_TYPE_PV;
-            else if (!strcmp(optarg, "serial"))
-                type = LIBXL_CONSOLE_TYPE_SERIAL;
-            else {
-                fprintf(stderr, "console type supported are: pv, serial\n");
-                return 2;
-            }
-            break;
-        case 'n':
-            num = atoi(optarg);
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "n:t:", NULL, "console", 1) {
+    case 0: case 2:
+        return opt;
+    case 't':
+        if (!strcmp(optarg, "pv"))
+            type = LIBXL_CONSOLE_TYPE_PV;
+        else if (!strcmp(optarg, "serial"))
+            type = LIBXL_CONSOLE_TYPE_SERIAL;
+        else {
+            fprintf(stderr, "console type supported are: pv, serial\n");
+            return 2;
+        }
+        break;
+    case 'n':
+        num = atoi(optarg);
+        break;
     }
 
     domid = find_domain(argv[optind]);
@@ -2505,14 +2566,12 @@ int main_vncviewer(int argc, char **argv
     uint32_t domid;
     int opt, autopass = 0;
 
-    while ((opt = def_getopt(argc, argv, "ah", opts, "vncviewer", 1)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'a':
-            autopass = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "ah", opts, "vncviewer", 1) {
+    case 0: case 2:
+        return opt;
+    case 'a':
+        autopass = 1;
+        break;
     }
 
     domid = find_domain(argv[optind]);
@@ -2545,8 +2604,10 @@ int main_pcilist(int argc, char **argv)
     uint32_t domid;
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "pci-list", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "pci-list", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind]);
 
@@ -2584,14 +2645,12 @@ int main_pcidetach(int argc, char **argv
     int force = 0;
     const char *bdf = NULL;
 
-    while ((opt = def_getopt(argc, argv, "f", NULL, "pci-detach", 2)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'f':
-            force = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "f", NULL, "pci-detach", 2) {
+    case 0: case 2:
+        return opt;
+    case 'f':
+        force = 1;
+        break;
     }
 
     domid = find_domain(argv[optind]);
@@ -2626,8 +2685,10 @@ int main_pciattach(int argc, char **argv
     int opt;
     const char *bdf = NULL, *vs = NULL;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "pci-attach", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "pci-attach", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind]);
     bdf = argv[optind + 1];
@@ -2660,8 +2721,10 @@ int main_pciassignable_list(int argc, ch
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "pci-assignable-list", 0)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "pci-assignable-list", 0) {
+    case 0: case 2:
         return opt;
+    }
 
     pciassignable_list();
     return 0;
@@ -2692,11 +2755,9 @@ int main_pciassignable_add(int argc, cha
     int opt;
     const char *bdf = NULL;
 
-    while ((opt = def_getopt(argc, argv, "", NULL, "pci-assignable-add", 1)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        }
+    SWITCH_FOREACH_OPT(opt, "", NULL, "pci-assignable-add", 1) {
+    case 0: case 2:
+        return opt;
     }
 
     bdf = argv[optind];
@@ -2731,14 +2792,12 @@ int main_pciassignable_remove(int argc, 
     const char *bdf = NULL;
     int rebind = 0;
 
-    while ((opt = def_getopt(argc, argv, "r", NULL, "pci-assignable-remove", 1)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'r':
-            rebind=1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "r", NULL, "pci-assignable-remove", 1) {
+    case 0: case 2:
+        return opt;
+    case 'r':
+        rebind=1;
+        break;
     }
 
     bdf = argv[optind];
@@ -3549,34 +3608,31 @@ int main_restore(int argc, char **argv)
         {0, 0, 0, 0}
     };
 
-    while ((opt = def_getopt(argc, argv, "FhcpdeVA",
-                             opts, "restore", 1)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'c':
-            console_autoconnect = 1;
-            break;
-        case 'p':
-            paused = 1;
-            break;
-        case 'd':
-            debug = 1;
-            break;
-        case 'F':
-            daemonize = 0;
-            break;
-        case 'e':
-            daemonize = 0;
-            monitor = 0;
-            break;
-        case 'V':
-            vnc = 1;
-            break;
-        case 'A':
-            vnc = vncautopass = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "FhcpdeVA", opts, "restore", 1) {
+    case 0: case 2:
+        return opt;
+    case 'c':
+        console_autoconnect = 1;
+        break;
+    case 'p':
+        paused = 1;
+        break;
+    case 'd':
+        debug = 1;
+        break;
+    case 'F':
+        daemonize = 0;
+        break;
+    case 'e':
+        daemonize = 0;
+        monitor = 0;
+        break;
+    case 'V':
+        vnc = 1;
+        break;
+    case 'A':
+        vnc = vncautopass = 1;
+        break;
     }
 
     if (argc-optind == 1) {
@@ -3613,24 +3669,22 @@ int main_migrate_receive(int argc, char 
     int debug = 0, daemonize = 1, monitor = 1, remus = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "Fedr", NULL, "migrate-receive", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'F':
-            daemonize = 0;
-            break;
-        case 'e':
-            daemonize = 0;
-            monitor = 0;
-            break;
-        case 'd':
-            debug = 1;
-            break;
-        case 'r':
-            remus = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "Fedr", NULL, "migrate-receive", 0) {
+    case 0: case 2:
+        return opt;
+    case 'F':
+        daemonize = 0;
+        break;
+    case 'e':
+        daemonize = 0;
+        monitor = 0;
+        break;
+    case 'd':
+        debug = 1;
+        break;
+    case 'r':
+        remus = 1;
+        break;
     }
 
     if (argc-optind != 0) {
@@ -3652,14 +3706,12 @@ int main_save(int argc, char **argv)
     int checkpoint = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "c", NULL, "save", 2)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'c':
-            checkpoint = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "c", NULL, "save", 2) {
+    case 0: case 2:
+        return opt;
+    case 'c':
+        checkpoint = 1;
+        break;
     }
 
     if (argc-optind > 3) {
@@ -3685,27 +3737,25 @@ int main_migrate(int argc, char **argv)
     char *host;
     int opt, daemonize = 1, monitor = 1, debug = 0;
 
-    while ((opt = def_getopt(argc, argv, "FC:s:ed", NULL, "migrate", 2)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'C':
-            config_filename = optarg;
-            break;
-        case 's':
-            ssh_command = optarg;
-            break;
-        case 'F':
-            daemonize = 0;
-            break;
-        case 'e':
-            daemonize = 0;
-            monitor = 0;
-            break;
-        case 'd':
-            debug = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "FC:s:ed", NULL, "migrate", 2) {
+    case 0: case 2:
+        return opt;
+    case 'C':
+        config_filename = optarg;
+        break;
+    case 's':
+        ssh_command = optarg;
+        break;
+    case 'F':
+        daemonize = 0;
+        break;
+    case 'e':
+        daemonize = 0;
+        monitor = 0;
+        break;
+    case 'd':
+        debug = 1;
+        break;
     }
 
     domid = find_domain(argv[optind]);
@@ -3729,8 +3779,10 @@ int main_dump_core(int argc, char **argv
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "dump-core", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "dump-core", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     core_dump_domain(find_domain(argv[optind]), argv[optind + 1]);
     return 0;
@@ -3740,8 +3792,10 @@ int main_pause(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "pause", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "pause", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     pause_domain(find_domain(argv[optind]));
 
@@ -3752,8 +3806,10 @@ int main_unpause(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "unpause", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "unpause", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     unpause_domain(find_domain(argv[optind]));
 
@@ -3764,8 +3820,10 @@ int main_destroy(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "destroy", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "destroy", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     destroy_domain(find_domain(argv[optind]));
     return 0;
@@ -3787,20 +3845,18 @@ static int main_shutdown_or_reboot(int d
         {0, 0, 0, 0}
     };
 
-    while ((opt = def_getopt(argc, argv, "awF", opts, what, 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'a':
-            all = 1;
-            break;
-        case 'w':
-            wait_for_it = 1;
-            break;
-        case 'F':
-            fallback_trigger = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "awF", opts, what, 0) {
+    case 0: case 2:
+        return opt;
+    case 'a':
+        all = 1;
+        break;
+    case 'w':
+        wait_for_it = 1;
+        break;
+    case 'F':
+        fallback_trigger = 1;
+        break;
     }
 
     if (!argv[optind] && !all) {
@@ -3871,23 +3927,18 @@ int main_list(int argc, char **argv)
     libxl_dominfo *info, *info_free=0;
     int nb_domain, rc;
 
-    while ((opt = def_getopt(argc, argv, "lvhZ", opts, "list", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'l':
-            details = 1;
-            break;
-        case 'h':
-            help("list");
-            return 0;
-        case 'v':
-            verbose = 1;
-            break;
-        case 'Z':
-            context = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "lvhZ", opts, "list", 0) {
+    case 0: case 2:
+        return opt;
+    case 'l':
+        details = 1;
+        break;
+    case 'v':
+        verbose = 1;
+        break;
+    case 'Z':
+        context = 1;
+        break;
     }
 
     if (optind >= argc) {
@@ -3933,8 +3984,10 @@ int main_vm_list(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "vm-list", 0)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "vm-list", 0) {
+    case 0: case 2:
         return opt;
+    }
 
     list_vm();
     return 0;
@@ -3964,45 +4017,40 @@ int main_create(int argc, char **argv)
         argc--; argv++;
     }
 
-    while ((opt = def_getopt(argc, argv, "Fhnqf:pcdeVA", opts, "create", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'f':
-            filename = optarg;
-            break;
-        case 'p':
-            paused = 1;
-            break;
-        case 'c':
-            console_autoconnect = 1;
-            break;
-        case 'd':
-            debug = 1;
-            break;
-        case 'F':
-            daemonize = 0;
-            break;
-        case 'e':
-            daemonize = 0;
-            monitor = 0;
-            break;
-        case 'h':
-            help("create");
-            return 0;
-        case 'n':
-            dryrun_only = 1;
-            break;
-        case 'q':
-            quiet = 1;
-            break;
-        case 'V':
-            vnc = 1;
-            break;
-        case 'A':
-            vnc = vncautopass = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "Fhnqf:pcdeVA", opts, "create", 0) {
+    case 0: case 2:
+        return opt;
+    case 'f':
+        filename = optarg;
+        break;
+    case 'p':
+        paused = 1;
+        break;
+    case 'c':
+        console_autoconnect = 1;
+        break;
+    case 'd':
+        debug = 1;
+        break;
+    case 'F':
+        daemonize = 0;
+        break;
+    case 'e':
+        daemonize = 0;
+        monitor = 0;
+        break;
+    case 'n':
+        dryrun_only = 1;
+        break;
+    case 'q':
+        quiet = 1;
+        break;
+    case 'V':
+        vnc = 1;
+        break;
+    case 'A':
+        vnc = vncautopass = 1;
+        break;
     }
 
     extra_config[0] = '\0';
@@ -4070,17 +4118,15 @@ int main_config_update(int argc, char **
         argc--; argv++;
     }
 
-    while ((opt = def_getopt(argc, argv, "dhqf:", opts, "config_update", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'd':
-            debug = 1;
-            break;
-        case 'f':
-            filename = optarg;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "dhqf:", opts, "config_update", 0) {
+    case 0: case 2:
+        return opt;
+    case 'd':
+        debug = 1;
+        break;
+    case 'f':
+        filename = optarg;
+        break;
     }
 
     extra_config[0] = '\0';
@@ -4168,8 +4214,11 @@ int main_button_press(int argc, char **a
     fprintf(stderr, "WARNING: \"button-press\" is deprecated. "
             "Please use \"trigger\"\n");
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "button-press", 2)) != -1)
+
+    SWITCH_FOREACH_OPT(opt, "", NULL, "button-press", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     button_press(find_domain(argv[optind]), argv[optind + 1]);
 
@@ -4309,8 +4358,10 @@ int main_vcpulist(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "cpu-list", 0)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "cpu-list", 0) {
+    case 0: case 2:
         return opt;
+    }
 
     vcpulist(argc - optind, argv + optind);
     return 0;
@@ -4370,8 +4421,10 @@ int main_vcpupin(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "vcpu-pin", 3)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "vcpu-pin", 3) {
+    case 0: case 2:
         return opt;
+    }
 
     vcpupin(find_domain(argv[optind]), argv[optind+1] , argv[optind+2]);
     return 0;
@@ -4406,8 +4459,10 @@ int main_vcpuset(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "vcpu-set", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "vcpu-set", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     vcpuset(find_domain(argv[optind]), argv[optind+1]);
     return 0;
@@ -4589,14 +4644,12 @@ int main_info(int argc, char **argv)
     };
     int numa = 0;
 
-    while ((opt = def_getopt(argc, argv, "hn", opts, "info", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'n':
-            numa = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "hn", opts, "info", 0) {
+    case 0: case 2:
+        return opt;
+    case 'n':
+        numa = 1;
+        break;
     }
 
     print_info(numa);
@@ -4630,8 +4683,10 @@ int main_sharing(int argc, char **argv)
     libxl_dominfo *info, *info_free = NULL;
     int nb_domain, rc;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "sharing", 0)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "sharing", 0) {
+    case 0: case 2:
         return opt;
+    }
 
     if (optind >= argc) {
         info = libxl_list_domain(ctx, &nb_domain);
@@ -4911,36 +4966,34 @@ int main_sched_credit(int argc, char **a
         {0, 0, 0, 0}
     };
 
-    while ((opt = def_getopt(argc, argv, "d:w:c:p:t:r:hs", opts, "sched-credit", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'd':
-            dom = optarg;
-            break;
-        case 'w':
-            weight = strtol(optarg, NULL, 10);
-            opt_w = 1;
-            break;
-        case 'c':
-            cap = strtol(optarg, NULL, 10);
-            opt_c = 1;
-            break;
-        case 't':
-            tslice = strtol(optarg, NULL, 10);
-            opt_t = 1;
-            break;
-        case 'r':
-            ratelimit = strtol(optarg, NULL, 10);
-            opt_r = 1;
-            break;
-        case 's':
-            opt_s = 1;
-            break;
-        case 'p':
-            cpupool = optarg;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "d:w:c:p:t:r:hs", opts, "sched-credit", 0) {
+    case 0: case 2:
+        return opt;
+    case 'd':
+        dom = optarg;
+        break;
+    case 'w':
+        weight = strtol(optarg, NULL, 10);
+        opt_w = 1;
+        break;
+    case 'c':
+        cap = strtol(optarg, NULL, 10);
+        opt_c = 1;
+        break;
+    case 't':
+        tslice = strtol(optarg, NULL, 10);
+        opt_t = 1;
+        break;
+    case 'r':
+        ratelimit = strtol(optarg, NULL, 10);
+        opt_r = 1;
+        break;
+    case 's':
+        opt_s = 1;
+        break;
+    case 'p':
+        cpupool = optarg;
+        break;
     }
 
     if ((cpupool || opt_s) && (dom || opt_w || opt_c)) {
@@ -5030,21 +5083,19 @@ int main_sched_credit2(int argc, char **
         {0, 0, 0, 0}
     };
 
-    while ((opt = def_getopt(argc, argv, "d:w:p:h", opts, "sched-credit2", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'd':
-            dom = optarg;
-            break;
-        case 'w':
-            weight = strtol(optarg, NULL, 10);
-            opt_w = 1;
-            break;
-        case 'p':
-            cpupool = optarg;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "d:w:p:h", opts, "sched-credit2", 0) {
+    case 0: case 2:
+        return opt;
+    case 'd':
+        dom = optarg;
+        break;
+    case 'w':
+        weight = strtol(optarg, NULL, 10);
+        opt_w = 1;
+        break;
+    case 'p':
+        cpupool = optarg;
+        break;
     }
 
     if (cpupool && (dom || opt_w)) {
@@ -5105,37 +5156,35 @@ int main_sched_sedf(int argc, char **arg
         {0, 0, 0, 0}
     };
 
-    while ((opt = def_getopt(argc, argv, "d:p:s:l:e:w:c:h", opts, "sched-sedf", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'd':
-            dom = optarg;
-            break;
-        case 'p':
-            period = strtol(optarg, NULL, 10);
-            opt_p = 1;
-            break;
-        case 's':
-            slice = strtol(optarg, NULL, 10);
-            opt_s = 1;
-            break;
-        case 'l':
-            latency = strtol(optarg, NULL, 10);
-            opt_l = 1;
-            break;
-        case 'e':
-            extra = strtol(optarg, NULL, 10);
-            opt_e = 1;
-            break;
-        case 'w':
-            weight = strtol(optarg, NULL, 10);
-            opt_w = 1;
-            break;
-        case 'c':
-            cpupool = optarg;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "d:p:s:l:e:w:c:h", opts, "sched-sedf", 0) {
+    case 0: case 2:
+        return opt;
+    case 'd':
+        dom = optarg;
+        break;
+    case 'p':
+        period = strtol(optarg, NULL, 10);
+        opt_p = 1;
+        break;
+    case 's':
+        slice = strtol(optarg, NULL, 10);
+        opt_s = 1;
+        break;
+    case 'l':
+        latency = strtol(optarg, NULL, 10);
+        opt_l = 1;
+        break;
+    case 'e':
+        extra = strtol(optarg, NULL, 10);
+        opt_e = 1;
+        break;
+    case 'w':
+        weight = strtol(optarg, NULL, 10);
+        opt_w = 1;
+        break;
+    case 'c':
+        cpupool = optarg;
+        break;
     }
 
     if (cpupool && (dom || opt_p || opt_s || opt_l || opt_e || opt_w)) {
@@ -5202,8 +5251,10 @@ int main_domid(int argc, char **argv)
     int opt;
     const char *domname = NULL;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "domid", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "domid", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     domname = argv[optind];
 
@@ -5224,8 +5275,10 @@ int main_domname(int argc, char **argv)
     char *domname = NULL;
     char *endptr = NULL;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "domname", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "domname", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = strtol(argv[optind], &endptr, 10);
     if (domid == 0 && !strcmp(endptr, argv[optind])) {
@@ -5252,8 +5305,10 @@ int main_rename(int argc, char **argv)
     int opt;
     const char *dom, *new_name;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "rename", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "rename", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     dom = argv[optind++];
     new_name = argv[optind];
@@ -5276,8 +5331,10 @@ int main_trigger(int argc, char **argv)
     const char *trigger_name = NULL;
     libxl_trigger trigger;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "trigger", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "trigger", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind++]);
 
@@ -5306,8 +5363,10 @@ int main_sysrq(int argc, char **argv)
     int opt;
     const char *sysrq = NULL;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "sysrq", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "sysrq", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind++]);
 
@@ -5329,8 +5388,10 @@ int main_debug_keys(int argc, char **arg
     int opt;
     char *keys;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "debug-keys", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "debug-keys", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     keys = argv[optind];
 
@@ -5349,14 +5410,12 @@ int main_dmesg(int argc, char **argv)
     char *line;
     int opt, ret = 1;
 
-    while ((opt = def_getopt(argc, argv, "c", NULL, "dmesg", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'c':
-            clear = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "c", NULL, "dmesg", 0) {
+    case 0: case 2:
+        return opt;
+    case 'c':
+        clear = 1;
+        break;
     }
 
     cr = libxl_xen_console_read_start(ctx, clear);
@@ -5375,8 +5434,10 @@ int main_top(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "top", 0)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "top", 0) {
+    case 0: case 2:
         return opt;
+    }
 
     return system("xentop");
 }
@@ -5392,8 +5453,10 @@ int main_networkattach(int argc, char **
     int i;
     unsigned int val;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "network-attach", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "network-attach", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     if (argc-optind > 11) {
         help("network-attach");
@@ -5479,8 +5542,10 @@ int main_networklist(int argc, char **ar
     libxl_nicinfo nicinfo;
     int nb, i;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "network-list", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "network-list", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     /*      Idx  BE   MAC   Hdl  Sta  evch txr/rxr  BE-path */
     printf("%-3s %-2s %-17s %-6s %-5s %-6s %5s/%-5s %-30s\n",
@@ -5516,8 +5581,10 @@ int main_networkdetach(int argc, char **
     int opt;
     libxl_device_nic nic;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "network-detach", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "network-detach", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind]);
 
@@ -5547,8 +5614,10 @@ int main_blockattach(int argc, char **ar
     libxl_device_disk disk = { 0 };
     XLU_Config *config = 0;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "block-attach", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "block-attach", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     if (domain_qualifier_to_domid(argv[optind], &fe_domid, 0) < 0) {
         fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
@@ -5582,8 +5651,10 @@ int main_blocklist(int argc, char **argv
     libxl_device_disk *disks;
     libxl_diskinfo diskinfo;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "block-list", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "block-list", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     printf("%-5s %-3s %-6s %-5s %-6s %-8s %-30s\n",
            "Vdev", "BE", "handle", "state", "evt-ch", "ring-ref", "BE-path");
@@ -5618,8 +5689,10 @@ int main_blockdetach(int argc, char **ar
     int opt, rc = 0;
     libxl_device_disk disk;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "block-detach", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "block-detach", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind]);
 
@@ -5643,8 +5716,10 @@ int main_vtpmattach(int argc, char **arg
     unsigned int val;
     uint32_t domid;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "vtpm-attach", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "vtpm-attach", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     if (domain_qualifier_to_domid(argv[optind], &domid, 0) < 0) {
         fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
@@ -5696,8 +5771,10 @@ int main_vtpmlist(int argc, char **argv)
     libxl_vtpminfo vtpminfo;
     int nb, i;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "vtpm-list", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "vtpm-list", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     /*      Idx  BE   UUID   Hdl  Sta  evch rref  BE-path */
     printf("%-3s %-2s %-36s %-6s %-5s %-6s %-5s %-10s\n",
@@ -5736,8 +5813,10 @@ int main_vtpmdetach(int argc, char **arg
     libxl_device_vtpm vtpm;
     libxl_uuid uuid;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "vtpm-detach", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "vtpm-detach", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind]);
 
@@ -5928,14 +6007,12 @@ int main_uptime(int argc, char **argv)
     int nb_doms = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "s", NULL, "uptime", 1)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 's':
-            short_mode = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "s", NULL, "uptime", 1) {
+    case 0: case 2:
+        return opt;
+    case 's':
+        short_mode = 1;
+        break;
     }
 
     for (;(dom = argv[optind]) != NULL; nb_doms++,optind++)
@@ -5955,17 +6032,15 @@ int main_tmem_list(int argc, char **argv
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "al", NULL, "tmem-list", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'l':
-            use_long = 1;
-            break;
-        case 'a':
-            all = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "al", NULL, "tmem-list", 0) {
+    case 0: case 2:
+        return opt;
+    case 'l':
+        use_long = 1;
+        break;
+    case 'a':
+        all = 1;
+        break;
     }
 
     dom = argv[optind];
@@ -5996,14 +6071,12 @@ int main_tmem_freeze(int argc, char **ar
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "a", NULL, "tmem-freeze", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'a':
-            all = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "a", NULL, "tmem-freeze", 0) {
+    case 0: case 2:
+        return opt;
+    case 'a':
+        all = 1;
+        break;
     }
 
     dom = argv[optind];
@@ -6029,14 +6102,12 @@ int main_tmem_thaw(int argc, char **argv
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "a", NULL, "tmem-thaw", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'a':
-            all = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "a", NULL, "tmem-thaw", 0) {
+    case 0: case 2:
+        return opt;
+    case 'a':
+        all = 1;
+        break;
     }
 
     dom = argv[optind];
@@ -6064,26 +6135,24 @@ int main_tmem_set(int argc, char **argv)
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "aw:c:p:", NULL, "tmem-set", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'a':
-            all = 1;
-            break;
-        case 'w':
-            weight = strtol(optarg, NULL, 10);
-            opt_w = 1;
-            break;
-        case 'c':
-            cap = strtol(optarg, NULL, 10);
-            opt_c = 1;
-            break;
-        case 'p':
-            compress = strtol(optarg, NULL, 10);
-            opt_p = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "aw:c:p:", NULL, "tmem-set", 0) {
+    case 0: case 2:
+        return opt;
+    case 'a':
+        all = 1;
+        break;
+    case 'w':
+        weight = strtol(optarg, NULL, 10);
+        opt_w = 1;
+        break;
+    case 'c':
+        cap = strtol(optarg, NULL, 10);
+        opt_c = 1;
+        break;
+    case 'p':
+        compress = strtol(optarg, NULL, 10);
+        opt_p = 1;
+        break;
     }
 
     dom = argv[optind];
@@ -6125,20 +6194,18 @@ int main_tmem_shared_auth(int argc, char
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "au:A:", NULL, "tmem-shared-auth", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'a':
-            all = 1;
-            break;
-        case 'u':
-            uuid = optarg;
-            break;
-        case 'A':
-            autharg = optarg;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "au:A:", NULL, "tmem-shared-auth", 0) {
+    case 0: case 2:
+        return opt;
+    case 'a':
+        all = 1;
+        break;
+    case 'u':
+        uuid = optarg;
+        break;
+    case 'A':
+        autharg = optarg;
+        break;
     }
 
     dom = argv[optind];
@@ -6175,8 +6242,10 @@ int main_tmem_freeable(int argc, char **
     int opt;
     int mb;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "tmem-freeable", 0)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "tmem-freeale", 0) {
+    case 0: case 2:
         return opt;
+    }
 
     mb = libxl_tmem_freeable(ctx);
     if (mb == -1)
@@ -6215,17 +6284,15 @@ int main_cpupoolcreate(int argc, char **
     libxl_cputopology *topology;
     int rc = -ERROR_FAIL;
 
-    while ((opt = def_getopt(argc, argv, "hnf:", opts, "cpupool-create", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'f':
-            filename = optarg;
-            break;
-        case 'n':
-            dryrun_only = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "hnf:", opts, "cpupool-create", 0) {
+    case 0: case 2:
+        return opt;
+    case 'f':
+        filename = optarg;
+        break;
+    case 'n':
+        dryrun_only = 1;
+        break;
     }
 
     memset(extra_config, 0, sizeof(extra_config));
@@ -6400,14 +6467,12 @@ int main_cpupoollist(int argc, char **ar
     char *name;
     int ret = 0;
 
-    while ((opt = def_getopt(argc, argv, "hc", opts, "cpupool-list", 1)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            break;
-        case 'c':
-            opt_cpus = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "hc", opts, "cpupool-list", 1) {
+    case 0: case 2:
+        break;
+    case 'c':
+        opt_cpus = 1;
+        break;
     }
 
     if (optind < argc) {
@@ -6467,8 +6532,10 @@ int main_cpupooldestroy(int argc, char *
     const char *pool;
     uint32_t poolid;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-destroy", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "cpupool-destroy", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     pool = argv[optind];
 
@@ -6488,8 +6555,10 @@ int main_cpupoolrename(int argc, char **
     const char *new_name;
     uint32_t poolid;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-rename", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "cpupool-rename", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     pool = argv[optind++];
 
@@ -6518,8 +6587,10 @@ int main_cpupoolcpuadd(int argc, char **
     int node;
     int n;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-cpu-add", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "cpupool-cpu-add", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     pool = argv[optind++];
     node = -1;
@@ -6562,8 +6633,10 @@ int main_cpupoolcpuremove(int argc, char
     int node;
     int n;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-cpu-remove", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "cpupool-cpu-remove", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     pool = argv[optind++];
     node = -1;
@@ -6605,8 +6678,10 @@ int main_cpupoolmigrate(int argc, char *
     const char *dom;
     uint32_t domid;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-migrate", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "cpupool-migrate", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     dom = argv[optind++];
     pool = argv[optind];
@@ -6645,8 +6720,11 @@ int main_cpupoolnumasplit(int argc, char
     libxl_cputopology *topology;
     libxl_dominfo info;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-numa-split", 0)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "cpupool-numa-split", 0) {
+    case 0: case 2:
         return opt;
+    }
+
     ret = 0;
 
     poolinfo = libxl_list_cpupool(ctx, &n_pools);
@@ -6898,27 +6976,24 @@ int main_remus(int argc, char **argv)
     r_info.blackhole = 0;
     r_info.compression = 1;
 
-    while ((opt = def_getopt(argc, argv, "bui:s:e", NULL, "remus", 2)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-
-        case 'i':
-	    r_info.interval = atoi(optarg);
-            break;
-        case 'b':
-            r_info.blackhole = 1;
-            break;
-        case 'u':
-	    r_info.compression = 0;
-            break;
-        case 's':
-            ssh_command = optarg;
-            break;
-        case 'e':
-            daemonize = 0;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "bui:s:e", NULL, "remus", 2) {
+    case 0: case 2:
+        return opt;
+    case 'i':
+        r_info.interval = atoi(optarg);
+        break;
+    case 'b':
+        r_info.blackhole = 1;
+        break;
+    case 'u':
+        r_info.compression = 0;
+        break;
+    case 's':
+        ssh_command = optarg;
+        break;
+    case 'e':
+        daemonize = 0;
+        break;
     }
 
     domid = find_domain(argv[optind]);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:21:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:21:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOf6-0005Jm-Eo; Fri, 30 Nov 2012 11:21:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeOf4-0005JB-0S
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:21:38 +0000
Received: from [85.158.139.83:3905] by server-4.bemta-5.messagelabs.com id
	0D/9F-15011-1C698B05; Fri, 30 Nov 2012 11:21:37 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1354274488!27709762!2
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31874 invoked from network); 30 Nov 2012 11:21:31 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:21:31 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="215987225"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 11:21:28 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 06:21:27 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TeOet-0000fK-6H;
	Fri, 30 Nov 2012 11:21:27 +0000
MIME-Version: 1.0
X-Mercurial-Node: d4cc790b47d8735ae3f2b0c4707bfa58f90a2cd3
Message-ID: <d4cc790b47d8735ae3f2.1354274488@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1354274486@cosworth.uk.xensource.com>
References: <patchbomb.1354274486@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Fri, 30 Nov 2012 11:21:28 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [PATCH 2 of 2] xl: Introduce helper macro for option
	parsing
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1354274264 0
# Node ID d4cc790b47d8735ae3f2b0c4707bfa58f90a2cd3
# Parent  b63fbacd5037e79bc4f40429453cb59816f94793
xl: Introduce helper macro for option parsing.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
v2:
- s/FOREACH_OPT/SWITCH_FOREACH_OPT/
- Document the macro

diff -r b63fbacd5037 -r d4cc790b47d8 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Nov 30 11:17:44 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Fri Nov 30 11:17:44 2012 +0000
@@ -2297,6 +2297,10 @@ static int64_t parse_mem_size_kb(const c
 
 #define COMMON_LONG_OPTS {"help", 0, 0, 'h'}
 
+/*
+ * Callers should use SWITCH_FOREACH_OPT in preference to calling this
+ * directly.
+ */
 static int def_getopt(int argc, char * const argv[],
                       const char *optstring,
                       const struct option *longopts,
@@ -2335,6 +2339,57 @@ static int def_getopt(int argc, char * c
     return -1;
 }
 
+/*
+ * Wraps def_getopt into a convenient loop+switch to process all arguments.
+ *
+ * _opt:        an int variable, holds the current option during processing.
+ * _opts:       short options, as per getopt_long(3)'s optstring argument.
+ * _lopts:      long options, as per getopt_long(3)'s longopts argument. May
+ *              be null.
+ * _help:       name of this command, for usage string.
+ * _req:        number of non-option command line parameters which are required.
+ *
+ * In addition the calling context is expected to contain variables
+ * "argc" and "argv" in the conventional C-style:
+ *   main(int argc, char **argv)
+ * manner.
+ *
+ * Callers should treat SWITCH_FOREACH_OPT as they would a switch
+ * statement over the value of _opt. Each option given in _opts (or
+ * _lopts) should be handled by a case statement as if it were inside
+ * a switch statement.
+ *
+ * In addition to the options provided in _opts callers must handle
+ * two additional pseudo options:
+ *  0 -- generated if the user passes a -h option. help will be printed,
+ *       caller should return 0.
+ *  2 -- generated if the user does not provided _req non-option arguments,
+ *       caller should return 2.
+ *
+ * Example:
+ *
+ * int main_foo(int argc, char **argv) {
+ *     int opt;
+ *
+ *     SWITCH_FOREACH_OPT(opt, "blah", NULL, "foo", 0) {
+ *     case 0: case2:
+ *          return opt;
+ *      case 'b':
+ *          ... handle b option...
+ *          break;
+ *      case 'l':
+ *          ... handle l option ...
+ *          break;
+ *      case etc etc...
+ *      }
+ *      ... do something useful with the options ...
+ * }
+ */
+#define SWITCH_FOREACH_OPT(_opt, _opts, _lopts, _help, _req)    \
+    while (((_opt) = def_getopt(argc, argv, (_opts), (_lopts),  \
+                                (_help), (_req))) != -1)        \
+        switch (opt)
+
 static int set_memory_max(uint32_t domid, const char *mem)
 {
     int64_t memorykb;
@@ -2358,8 +2413,10 @@ int main_memmax(int argc, char **argv)
     char *mem;
     int rc;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "mem-max", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "mem-max", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind]);
     mem = argv[optind + 1];
@@ -2392,8 +2449,10 @@ int main_memset(int argc, char **argv)
     int opt = 0;
     const char *mem;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "mem-set", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "mem-set", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind]);
     mem = argv[optind + 1];
@@ -2431,8 +2490,10 @@ int main_cd_eject(int argc, char **argv)
     int opt = 0;
     const char *virtdev;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "cd-eject", 2)) != -1)
-        return opt;
+    SWITCH_FOREACH_OPT(opt, "", NULL, "cd-eject", 2) {
+        case 0: case 2:
+            return opt;
+    }
 
     domid = find_domain(argv[optind]);
     virtdev = argv[optind + 1];
@@ -2448,8 +2509,10 @@ int main_cd_insert(int argc, char **argv
     const char *virtdev;
     char *file = NULL; /* modified by cd_insert tokenising it */
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "cd-insert", 3)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "cd-insert", 3) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind]);
     virtdev = argv[optind + 1];
@@ -2465,24 +2528,22 @@ int main_console(int argc, char **argv)
     int opt = 0, num = 0;
     libxl_console_type type = 0;
 
-    while ((opt = def_getopt(argc, argv, "n:t:", NULL, "console", 1)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 't':
-            if (!strcmp(optarg, "pv"))
-                type = LIBXL_CONSOLE_TYPE_PV;
-            else if (!strcmp(optarg, "serial"))
-                type = LIBXL_CONSOLE_TYPE_SERIAL;
-            else {
-                fprintf(stderr, "console type supported are: pv, serial\n");
-                return 2;
-            }
-            break;
-        case 'n':
-            num = atoi(optarg);
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "n:t:", NULL, "console", 1) {
+    case 0: case 2:
+        return opt;
+    case 't':
+        if (!strcmp(optarg, "pv"))
+            type = LIBXL_CONSOLE_TYPE_PV;
+        else if (!strcmp(optarg, "serial"))
+            type = LIBXL_CONSOLE_TYPE_SERIAL;
+        else {
+            fprintf(stderr, "console type supported are: pv, serial\n");
+            return 2;
+        }
+        break;
+    case 'n':
+        num = atoi(optarg);
+        break;
     }
 
     domid = find_domain(argv[optind]);
@@ -2505,14 +2566,12 @@ int main_vncviewer(int argc, char **argv
     uint32_t domid;
     int opt, autopass = 0;
 
-    while ((opt = def_getopt(argc, argv, "ah", opts, "vncviewer", 1)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'a':
-            autopass = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "ah", opts, "vncviewer", 1) {
+    case 0: case 2:
+        return opt;
+    case 'a':
+        autopass = 1;
+        break;
     }
 
     domid = find_domain(argv[optind]);
@@ -2545,8 +2604,10 @@ int main_pcilist(int argc, char **argv)
     uint32_t domid;
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "pci-list", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "pci-list", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind]);
 
@@ -2584,14 +2645,12 @@ int main_pcidetach(int argc, char **argv
     int force = 0;
     const char *bdf = NULL;
 
-    while ((opt = def_getopt(argc, argv, "f", NULL, "pci-detach", 2)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'f':
-            force = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "f", NULL, "pci-detach", 2) {
+    case 0: case 2:
+        return opt;
+    case 'f':
+        force = 1;
+        break;
     }
 
     domid = find_domain(argv[optind]);
@@ -2626,8 +2685,10 @@ int main_pciattach(int argc, char **argv
     int opt;
     const char *bdf = NULL, *vs = NULL;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "pci-attach", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "pci-attach", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind]);
     bdf = argv[optind + 1];
@@ -2660,8 +2721,10 @@ int main_pciassignable_list(int argc, ch
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "pci-assignable-list", 0)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "pci-assignable-list", 0) {
+    case 0: case 2:
         return opt;
+    }
 
     pciassignable_list();
     return 0;
@@ -2692,11 +2755,9 @@ int main_pciassignable_add(int argc, cha
     int opt;
     const char *bdf = NULL;
 
-    while ((opt = def_getopt(argc, argv, "", NULL, "pci-assignable-add", 1)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        }
+    SWITCH_FOREACH_OPT(opt, "", NULL, "pci-assignable-add", 1) {
+    case 0: case 2:
+        return opt;
     }
 
     bdf = argv[optind];
@@ -2731,14 +2792,12 @@ int main_pciassignable_remove(int argc, 
     const char *bdf = NULL;
     int rebind = 0;
 
-    while ((opt = def_getopt(argc, argv, "r", NULL, "pci-assignable-remove", 1)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'r':
-            rebind=1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "r", NULL, "pci-assignable-remove", 1) {
+    case 0: case 2:
+        return opt;
+    case 'r':
+        rebind=1;
+        break;
     }
 
     bdf = argv[optind];
@@ -3549,34 +3608,31 @@ int main_restore(int argc, char **argv)
         {0, 0, 0, 0}
     };
 
-    while ((opt = def_getopt(argc, argv, "FhcpdeVA",
-                             opts, "restore", 1)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'c':
-            console_autoconnect = 1;
-            break;
-        case 'p':
-            paused = 1;
-            break;
-        case 'd':
-            debug = 1;
-            break;
-        case 'F':
-            daemonize = 0;
-            break;
-        case 'e':
-            daemonize = 0;
-            monitor = 0;
-            break;
-        case 'V':
-            vnc = 1;
-            break;
-        case 'A':
-            vnc = vncautopass = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "FhcpdeVA", opts, "restore", 1) {
+    case 0: case 2:
+        return opt;
+    case 'c':
+        console_autoconnect = 1;
+        break;
+    case 'p':
+        paused = 1;
+        break;
+    case 'd':
+        debug = 1;
+        break;
+    case 'F':
+        daemonize = 0;
+        break;
+    case 'e':
+        daemonize = 0;
+        monitor = 0;
+        break;
+    case 'V':
+        vnc = 1;
+        break;
+    case 'A':
+        vnc = vncautopass = 1;
+        break;
     }
 
     if (argc-optind == 1) {
@@ -3613,24 +3669,22 @@ int main_migrate_receive(int argc, char 
     int debug = 0, daemonize = 1, monitor = 1, remus = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "Fedr", NULL, "migrate-receive", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'F':
-            daemonize = 0;
-            break;
-        case 'e':
-            daemonize = 0;
-            monitor = 0;
-            break;
-        case 'd':
-            debug = 1;
-            break;
-        case 'r':
-            remus = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "Fedr", NULL, "migrate-receive", 0) {
+    case 0: case 2:
+        return opt;
+    case 'F':
+        daemonize = 0;
+        break;
+    case 'e':
+        daemonize = 0;
+        monitor = 0;
+        break;
+    case 'd':
+        debug = 1;
+        break;
+    case 'r':
+        remus = 1;
+        break;
     }
 
     if (argc-optind != 0) {
@@ -3652,14 +3706,12 @@ int main_save(int argc, char **argv)
     int checkpoint = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "c", NULL, "save", 2)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'c':
-            checkpoint = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "c", NULL, "save", 2) {
+    case 0: case 2:
+        return opt;
+    case 'c':
+        checkpoint = 1;
+        break;
     }
 
     if (argc-optind > 3) {
@@ -3685,27 +3737,25 @@ int main_migrate(int argc, char **argv)
     char *host;
     int opt, daemonize = 1, monitor = 1, debug = 0;
 
-    while ((opt = def_getopt(argc, argv, "FC:s:ed", NULL, "migrate", 2)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'C':
-            config_filename = optarg;
-            break;
-        case 's':
-            ssh_command = optarg;
-            break;
-        case 'F':
-            daemonize = 0;
-            break;
-        case 'e':
-            daemonize = 0;
-            monitor = 0;
-            break;
-        case 'd':
-            debug = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "FC:s:ed", NULL, "migrate", 2) {
+    case 0: case 2:
+        return opt;
+    case 'C':
+        config_filename = optarg;
+        break;
+    case 's':
+        ssh_command = optarg;
+        break;
+    case 'F':
+        daemonize = 0;
+        break;
+    case 'e':
+        daemonize = 0;
+        monitor = 0;
+        break;
+    case 'd':
+        debug = 1;
+        break;
     }
 
     domid = find_domain(argv[optind]);
@@ -3729,8 +3779,10 @@ int main_dump_core(int argc, char **argv
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "dump-core", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "dump-core", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     core_dump_domain(find_domain(argv[optind]), argv[optind + 1]);
     return 0;
@@ -3740,8 +3792,10 @@ int main_pause(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "pause", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "pause", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     pause_domain(find_domain(argv[optind]));
 
@@ -3752,8 +3806,10 @@ int main_unpause(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "unpause", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "unpause", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     unpause_domain(find_domain(argv[optind]));
 
@@ -3764,8 +3820,10 @@ int main_destroy(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "destroy", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "destroy", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     destroy_domain(find_domain(argv[optind]));
     return 0;
@@ -3787,20 +3845,18 @@ static int main_shutdown_or_reboot(int d
         {0, 0, 0, 0}
     };
 
-    while ((opt = def_getopt(argc, argv, "awF", opts, what, 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'a':
-            all = 1;
-            break;
-        case 'w':
-            wait_for_it = 1;
-            break;
-        case 'F':
-            fallback_trigger = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "awF", opts, what, 0) {
+    case 0: case 2:
+        return opt;
+    case 'a':
+        all = 1;
+        break;
+    case 'w':
+        wait_for_it = 1;
+        break;
+    case 'F':
+        fallback_trigger = 1;
+        break;
     }
 
     if (!argv[optind] && !all) {
@@ -3871,23 +3927,18 @@ int main_list(int argc, char **argv)
     libxl_dominfo *info, *info_free=0;
     int nb_domain, rc;
 
-    while ((opt = def_getopt(argc, argv, "lvhZ", opts, "list", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'l':
-            details = 1;
-            break;
-        case 'h':
-            help("list");
-            return 0;
-        case 'v':
-            verbose = 1;
-            break;
-        case 'Z':
-            context = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "lvhZ", opts, "list", 0) {
+    case 0: case 2:
+        return opt;
+    case 'l':
+        details = 1;
+        break;
+    case 'v':
+        verbose = 1;
+        break;
+    case 'Z':
+        context = 1;
+        break;
     }
 
     if (optind >= argc) {
@@ -3933,8 +3984,10 @@ int main_vm_list(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "vm-list", 0)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "vm-list", 0) {
+    case 0: case 2:
         return opt;
+    }
 
     list_vm();
     return 0;
@@ -3964,45 +4017,40 @@ int main_create(int argc, char **argv)
         argc--; argv++;
     }
 
-    while ((opt = def_getopt(argc, argv, "Fhnqf:pcdeVA", opts, "create", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'f':
-            filename = optarg;
-            break;
-        case 'p':
-            paused = 1;
-            break;
-        case 'c':
-            console_autoconnect = 1;
-            break;
-        case 'd':
-            debug = 1;
-            break;
-        case 'F':
-            daemonize = 0;
-            break;
-        case 'e':
-            daemonize = 0;
-            monitor = 0;
-            break;
-        case 'h':
-            help("create");
-            return 0;
-        case 'n':
-            dryrun_only = 1;
-            break;
-        case 'q':
-            quiet = 1;
-            break;
-        case 'V':
-            vnc = 1;
-            break;
-        case 'A':
-            vnc = vncautopass = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "Fhnqf:pcdeVA", opts, "create", 0) {
+    case 0: case 2:
+        return opt;
+    case 'f':
+        filename = optarg;
+        break;
+    case 'p':
+        paused = 1;
+        break;
+    case 'c':
+        console_autoconnect = 1;
+        break;
+    case 'd':
+        debug = 1;
+        break;
+    case 'F':
+        daemonize = 0;
+        break;
+    case 'e':
+        daemonize = 0;
+        monitor = 0;
+        break;
+    case 'n':
+        dryrun_only = 1;
+        break;
+    case 'q':
+        quiet = 1;
+        break;
+    case 'V':
+        vnc = 1;
+        break;
+    case 'A':
+        vnc = vncautopass = 1;
+        break;
     }
 
     extra_config[0] = '\0';
@@ -4070,17 +4118,15 @@ int main_config_update(int argc, char **
         argc--; argv++;
     }
 
-    while ((opt = def_getopt(argc, argv, "dhqf:", opts, "config_update", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'd':
-            debug = 1;
-            break;
-        case 'f':
-            filename = optarg;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "dhqf:", opts, "config_update", 0) {
+    case 0: case 2:
+        return opt;
+    case 'd':
+        debug = 1;
+        break;
+    case 'f':
+        filename = optarg;
+        break;
     }
 
     extra_config[0] = '\0';
@@ -4168,8 +4214,11 @@ int main_button_press(int argc, char **a
     fprintf(stderr, "WARNING: \"button-press\" is deprecated. "
             "Please use \"trigger\"\n");
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "button-press", 2)) != -1)
+
+    SWITCH_FOREACH_OPT(opt, "", NULL, "button-press", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     button_press(find_domain(argv[optind]), argv[optind + 1]);
 
@@ -4309,8 +4358,10 @@ int main_vcpulist(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "cpu-list", 0)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "cpu-list", 0) {
+    case 0: case 2:
         return opt;
+    }
 
     vcpulist(argc - optind, argv + optind);
     return 0;
@@ -4370,8 +4421,10 @@ int main_vcpupin(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "vcpu-pin", 3)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "vcpu-pin", 3) {
+    case 0: case 2:
         return opt;
+    }
 
     vcpupin(find_domain(argv[optind]), argv[optind+1] , argv[optind+2]);
     return 0;
@@ -4406,8 +4459,10 @@ int main_vcpuset(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "vcpu-set", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "vcpu-set", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     vcpuset(find_domain(argv[optind]), argv[optind+1]);
     return 0;
@@ -4589,14 +4644,12 @@ int main_info(int argc, char **argv)
     };
     int numa = 0;
 
-    while ((opt = def_getopt(argc, argv, "hn", opts, "info", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'n':
-            numa = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "hn", opts, "info", 0) {
+    case 0: case 2:
+        return opt;
+    case 'n':
+        numa = 1;
+        break;
     }
 
     print_info(numa);
@@ -4630,8 +4683,10 @@ int main_sharing(int argc, char **argv)
     libxl_dominfo *info, *info_free = NULL;
     int nb_domain, rc;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "sharing", 0)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "sharing", 0) {
+    case 0: case 2:
         return opt;
+    }
 
     if (optind >= argc) {
         info = libxl_list_domain(ctx, &nb_domain);
@@ -4911,36 +4966,34 @@ int main_sched_credit(int argc, char **a
         {0, 0, 0, 0}
     };
 
-    while ((opt = def_getopt(argc, argv, "d:w:c:p:t:r:hs", opts, "sched-credit", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'd':
-            dom = optarg;
-            break;
-        case 'w':
-            weight = strtol(optarg, NULL, 10);
-            opt_w = 1;
-            break;
-        case 'c':
-            cap = strtol(optarg, NULL, 10);
-            opt_c = 1;
-            break;
-        case 't':
-            tslice = strtol(optarg, NULL, 10);
-            opt_t = 1;
-            break;
-        case 'r':
-            ratelimit = strtol(optarg, NULL, 10);
-            opt_r = 1;
-            break;
-        case 's':
-            opt_s = 1;
-            break;
-        case 'p':
-            cpupool = optarg;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "d:w:c:p:t:r:hs", opts, "sched-credit", 0) {
+    case 0: case 2:
+        return opt;
+    case 'd':
+        dom = optarg;
+        break;
+    case 'w':
+        weight = strtol(optarg, NULL, 10);
+        opt_w = 1;
+        break;
+    case 'c':
+        cap = strtol(optarg, NULL, 10);
+        opt_c = 1;
+        break;
+    case 't':
+        tslice = strtol(optarg, NULL, 10);
+        opt_t = 1;
+        break;
+    case 'r':
+        ratelimit = strtol(optarg, NULL, 10);
+        opt_r = 1;
+        break;
+    case 's':
+        opt_s = 1;
+        break;
+    case 'p':
+        cpupool = optarg;
+        break;
     }
 
     if ((cpupool || opt_s) && (dom || opt_w || opt_c)) {
@@ -5030,21 +5083,19 @@ int main_sched_credit2(int argc, char **
         {0, 0, 0, 0}
     };
 
-    while ((opt = def_getopt(argc, argv, "d:w:p:h", opts, "sched-credit2", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'd':
-            dom = optarg;
-            break;
-        case 'w':
-            weight = strtol(optarg, NULL, 10);
-            opt_w = 1;
-            break;
-        case 'p':
-            cpupool = optarg;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "d:w:p:h", opts, "sched-credit2", 0) {
+    case 0: case 2:
+        return opt;
+    case 'd':
+        dom = optarg;
+        break;
+    case 'w':
+        weight = strtol(optarg, NULL, 10);
+        opt_w = 1;
+        break;
+    case 'p':
+        cpupool = optarg;
+        break;
     }
 
     if (cpupool && (dom || opt_w)) {
@@ -5105,37 +5156,35 @@ int main_sched_sedf(int argc, char **arg
         {0, 0, 0, 0}
     };
 
-    while ((opt = def_getopt(argc, argv, "d:p:s:l:e:w:c:h", opts, "sched-sedf", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'd':
-            dom = optarg;
-            break;
-        case 'p':
-            period = strtol(optarg, NULL, 10);
-            opt_p = 1;
-            break;
-        case 's':
-            slice = strtol(optarg, NULL, 10);
-            opt_s = 1;
-            break;
-        case 'l':
-            latency = strtol(optarg, NULL, 10);
-            opt_l = 1;
-            break;
-        case 'e':
-            extra = strtol(optarg, NULL, 10);
-            opt_e = 1;
-            break;
-        case 'w':
-            weight = strtol(optarg, NULL, 10);
-            opt_w = 1;
-            break;
-        case 'c':
-            cpupool = optarg;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "d:p:s:l:e:w:c:h", opts, "sched-sedf", 0) {
+    case 0: case 2:
+        return opt;
+    case 'd':
+        dom = optarg;
+        break;
+    case 'p':
+        period = strtol(optarg, NULL, 10);
+        opt_p = 1;
+        break;
+    case 's':
+        slice = strtol(optarg, NULL, 10);
+        opt_s = 1;
+        break;
+    case 'l':
+        latency = strtol(optarg, NULL, 10);
+        opt_l = 1;
+        break;
+    case 'e':
+        extra = strtol(optarg, NULL, 10);
+        opt_e = 1;
+        break;
+    case 'w':
+        weight = strtol(optarg, NULL, 10);
+        opt_w = 1;
+        break;
+    case 'c':
+        cpupool = optarg;
+        break;
     }
 
     if (cpupool && (dom || opt_p || opt_s || opt_l || opt_e || opt_w)) {
@@ -5202,8 +5251,10 @@ int main_domid(int argc, char **argv)
     int opt;
     const char *domname = NULL;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "domid", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "domid", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     domname = argv[optind];
 
@@ -5224,8 +5275,10 @@ int main_domname(int argc, char **argv)
     char *domname = NULL;
     char *endptr = NULL;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "domname", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "domname", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = strtol(argv[optind], &endptr, 10);
     if (domid == 0 && !strcmp(endptr, argv[optind])) {
@@ -5252,8 +5305,10 @@ int main_rename(int argc, char **argv)
     int opt;
     const char *dom, *new_name;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "rename", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "rename", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     dom = argv[optind++];
     new_name = argv[optind];
@@ -5276,8 +5331,10 @@ int main_trigger(int argc, char **argv)
     const char *trigger_name = NULL;
     libxl_trigger trigger;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "trigger", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "trigger", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind++]);
 
@@ -5306,8 +5363,10 @@ int main_sysrq(int argc, char **argv)
     int opt;
     const char *sysrq = NULL;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "sysrq", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "sysrq", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind++]);
 
@@ -5329,8 +5388,10 @@ int main_debug_keys(int argc, char **arg
     int opt;
     char *keys;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "debug-keys", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "debug-keys", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     keys = argv[optind];
 
@@ -5349,14 +5410,12 @@ int main_dmesg(int argc, char **argv)
     char *line;
     int opt, ret = 1;
 
-    while ((opt = def_getopt(argc, argv, "c", NULL, "dmesg", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'c':
-            clear = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "c", NULL, "dmesg", 0) {
+    case 0: case 2:
+        return opt;
+    case 'c':
+        clear = 1;
+        break;
     }
 
     cr = libxl_xen_console_read_start(ctx, clear);
@@ -5375,8 +5434,10 @@ int main_top(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "top", 0)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "top", 0) {
+    case 0: case 2:
         return opt;
+    }
 
     return system("xentop");
 }
@@ -5392,8 +5453,10 @@ int main_networkattach(int argc, char **
     int i;
     unsigned int val;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "network-attach", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "network-attach", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     if (argc-optind > 11) {
         help("network-attach");
@@ -5479,8 +5542,10 @@ int main_networklist(int argc, char **ar
     libxl_nicinfo nicinfo;
     int nb, i;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "network-list", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "network-list", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     /*      Idx  BE   MAC   Hdl  Sta  evch txr/rxr  BE-path */
     printf("%-3s %-2s %-17s %-6s %-5s %-6s %5s/%-5s %-30s\n",
@@ -5516,8 +5581,10 @@ int main_networkdetach(int argc, char **
     int opt;
     libxl_device_nic nic;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "network-detach", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "network-detach", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind]);
 
@@ -5547,8 +5614,10 @@ int main_blockattach(int argc, char **ar
     libxl_device_disk disk = { 0 };
     XLU_Config *config = 0;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "block-attach", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "block-attach", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     if (domain_qualifier_to_domid(argv[optind], &fe_domid, 0) < 0) {
         fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
@@ -5582,8 +5651,10 @@ int main_blocklist(int argc, char **argv
     libxl_device_disk *disks;
     libxl_diskinfo diskinfo;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "block-list", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "block-list", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     printf("%-5s %-3s %-6s %-5s %-6s %-8s %-30s\n",
            "Vdev", "BE", "handle", "state", "evt-ch", "ring-ref", "BE-path");
@@ -5618,8 +5689,10 @@ int main_blockdetach(int argc, char **ar
     int opt, rc = 0;
     libxl_device_disk disk;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "block-detach", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "block-detach", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind]);
 
@@ -5643,8 +5716,10 @@ int main_vtpmattach(int argc, char **arg
     unsigned int val;
     uint32_t domid;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "vtpm-attach", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "vtpm-attach", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     if (domain_qualifier_to_domid(argv[optind], &domid, 0) < 0) {
         fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
@@ -5696,8 +5771,10 @@ int main_vtpmlist(int argc, char **argv)
     libxl_vtpminfo vtpminfo;
     int nb, i;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "vtpm-list", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "vtpm-list", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     /*      Idx  BE   UUID   Hdl  Sta  evch rref  BE-path */
     printf("%-3s %-2s %-36s %-6s %-5s %-6s %-5s %-10s\n",
@@ -5736,8 +5813,10 @@ int main_vtpmdetach(int argc, char **arg
     libxl_device_vtpm vtpm;
     libxl_uuid uuid;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "vtpm-detach", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "vtpm-detach", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     domid = find_domain(argv[optind]);
 
@@ -5928,14 +6007,12 @@ int main_uptime(int argc, char **argv)
     int nb_doms = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "s", NULL, "uptime", 1)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 's':
-            short_mode = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "s", NULL, "uptime", 1) {
+    case 0: case 2:
+        return opt;
+    case 's':
+        short_mode = 1;
+        break;
     }
 
     for (;(dom = argv[optind]) != NULL; nb_doms++,optind++)
@@ -5955,17 +6032,15 @@ int main_tmem_list(int argc, char **argv
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "al", NULL, "tmem-list", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'l':
-            use_long = 1;
-            break;
-        case 'a':
-            all = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "al", NULL, "tmem-list", 0) {
+    case 0: case 2:
+        return opt;
+    case 'l':
+        use_long = 1;
+        break;
+    case 'a':
+        all = 1;
+        break;
     }
 
     dom = argv[optind];
@@ -5996,14 +6071,12 @@ int main_tmem_freeze(int argc, char **ar
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "a", NULL, "tmem-freeze", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'a':
-            all = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "a", NULL, "tmem-freeze", 0) {
+    case 0: case 2:
+        return opt;
+    case 'a':
+        all = 1;
+        break;
     }
 
     dom = argv[optind];
@@ -6029,14 +6102,12 @@ int main_tmem_thaw(int argc, char **argv
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "a", NULL, "tmem-thaw", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'a':
-            all = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "a", NULL, "tmem-thaw", 0) {
+    case 0: case 2:
+        return opt;
+    case 'a':
+        all = 1;
+        break;
     }
 
     dom = argv[optind];
@@ -6064,26 +6135,24 @@ int main_tmem_set(int argc, char **argv)
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "aw:c:p:", NULL, "tmem-set", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'a':
-            all = 1;
-            break;
-        case 'w':
-            weight = strtol(optarg, NULL, 10);
-            opt_w = 1;
-            break;
-        case 'c':
-            cap = strtol(optarg, NULL, 10);
-            opt_c = 1;
-            break;
-        case 'p':
-            compress = strtol(optarg, NULL, 10);
-            opt_p = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "aw:c:p:", NULL, "tmem-set", 0) {
+    case 0: case 2:
+        return opt;
+    case 'a':
+        all = 1;
+        break;
+    case 'w':
+        weight = strtol(optarg, NULL, 10);
+        opt_w = 1;
+        break;
+    case 'c':
+        cap = strtol(optarg, NULL, 10);
+        opt_c = 1;
+        break;
+    case 'p':
+        compress = strtol(optarg, NULL, 10);
+        opt_p = 1;
+        break;
     }
 
     dom = argv[optind];
@@ -6125,20 +6194,18 @@ int main_tmem_shared_auth(int argc, char
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "au:A:", NULL, "tmem-shared-auth", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'a':
-            all = 1;
-            break;
-        case 'u':
-            uuid = optarg;
-            break;
-        case 'A':
-            autharg = optarg;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "au:A:", NULL, "tmem-shared-auth", 0) {
+    case 0: case 2:
+        return opt;
+    case 'a':
+        all = 1;
+        break;
+    case 'u':
+        uuid = optarg;
+        break;
+    case 'A':
+        autharg = optarg;
+        break;
     }
 
     dom = argv[optind];
@@ -6175,8 +6242,10 @@ int main_tmem_freeable(int argc, char **
     int opt;
     int mb;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "tmem-freeable", 0)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "tmem-freeale", 0) {
+    case 0: case 2:
         return opt;
+    }
 
     mb = libxl_tmem_freeable(ctx);
     if (mb == -1)
@@ -6215,17 +6284,15 @@ int main_cpupoolcreate(int argc, char **
     libxl_cputopology *topology;
     int rc = -ERROR_FAIL;
 
-    while ((opt = def_getopt(argc, argv, "hnf:", opts, "cpupool-create", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'f':
-            filename = optarg;
-            break;
-        case 'n':
-            dryrun_only = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "hnf:", opts, "cpupool-create", 0) {
+    case 0: case 2:
+        return opt;
+    case 'f':
+        filename = optarg;
+        break;
+    case 'n':
+        dryrun_only = 1;
+        break;
     }
 
     memset(extra_config, 0, sizeof(extra_config));
@@ -6400,14 +6467,12 @@ int main_cpupoollist(int argc, char **ar
     char *name;
     int ret = 0;
 
-    while ((opt = def_getopt(argc, argv, "hc", opts, "cpupool-list", 1)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            break;
-        case 'c':
-            opt_cpus = 1;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "hc", opts, "cpupool-list", 1) {
+    case 0: case 2:
+        break;
+    case 'c':
+        opt_cpus = 1;
+        break;
     }
 
     if (optind < argc) {
@@ -6467,8 +6532,10 @@ int main_cpupooldestroy(int argc, char *
     const char *pool;
     uint32_t poolid;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-destroy", 1)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "cpupool-destroy", 1) {
+    case 0: case 2:
         return opt;
+    }
 
     pool = argv[optind];
 
@@ -6488,8 +6555,10 @@ int main_cpupoolrename(int argc, char **
     const char *new_name;
     uint32_t poolid;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-rename", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "cpupool-rename", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     pool = argv[optind++];
 
@@ -6518,8 +6587,10 @@ int main_cpupoolcpuadd(int argc, char **
     int node;
     int n;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-cpu-add", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "cpupool-cpu-add", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     pool = argv[optind++];
     node = -1;
@@ -6562,8 +6633,10 @@ int main_cpupoolcpuremove(int argc, char
     int node;
     int n;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-cpu-remove", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "cpupool-cpu-remove", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     pool = argv[optind++];
     node = -1;
@@ -6605,8 +6678,10 @@ int main_cpupoolmigrate(int argc, char *
     const char *dom;
     uint32_t domid;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-migrate", 2)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "cpupool-migrate", 2) {
+    case 0: case 2:
         return opt;
+    }
 
     dom = argv[optind++];
     pool = argv[optind];
@@ -6645,8 +6720,11 @@ int main_cpupoolnumasplit(int argc, char
     libxl_cputopology *topology;
     libxl_dominfo info;
 
-    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-numa-split", 0)) != -1)
+    SWITCH_FOREACH_OPT(opt, "", NULL, "cpupool-numa-split", 0) {
+    case 0: case 2:
         return opt;
+    }
+
     ret = 0;
 
     poolinfo = libxl_list_cpupool(ctx, &n_pools);
@@ -6898,27 +6976,24 @@ int main_remus(int argc, char **argv)
     r_info.blackhole = 0;
     r_info.compression = 1;
 
-    while ((opt = def_getopt(argc, argv, "bui:s:e", NULL, "remus", 2)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-
-        case 'i':
-	    r_info.interval = atoi(optarg);
-            break;
-        case 'b':
-            r_info.blackhole = 1;
-            break;
-        case 'u':
-	    r_info.compression = 0;
-            break;
-        case 's':
-            ssh_command = optarg;
-            break;
-        case 'e':
-            daemonize = 0;
-            break;
-        }
+    SWITCH_FOREACH_OPT(opt, "bui:s:e", NULL, "remus", 2) {
+    case 0: case 2:
+        return opt;
+    case 'i':
+        r_info.interval = atoi(optarg);
+        break;
+    case 'b':
+        r_info.blackhole = 1;
+        break;
+    case 'u':
+        r_info.compression = 0;
+        break;
+    case 's':
+        ssh_command = optarg;
+        break;
+    case 'e':
+        daemonize = 0;
+        break;
     }
 
     domid = find_domain(argv[optind]);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:21:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:21:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOf6-0005Jb-0X; Fri, 30 Nov 2012 11:21:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeOf3-0005J6-K2
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:21:38 +0000
Received: from [85.158.139.83:19104] by server-14.bemta-5.messagelabs.com id
	50/40-21768-0C698B05; Fri, 30 Nov 2012 11:21:36 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1354274488!27709762!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31784 invoked from network); 30 Nov 2012 11:21:29 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:21:29 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="215987224"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 11:21:28 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 06:21:27 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TeOet-0000fK-5Z;
	Fri, 30 Nov 2012 11:21:27 +0000
MIME-Version: 1.0
X-Mercurial-Node: b63fbacd5037e79bc4f40429453cb59816f94793
Message-ID: <b63fbacd5037e79bc4f4.1354274487@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1354274486@cosworth.uk.xensource.com>
References: <patchbomb.1354274486@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Fri, 30 Nov 2012 11:21:27 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [PATCH 1 of 2] xl: allow def_getopt to handle long
	options
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1354274264 0
# Node ID b63fbacd5037e79bc4f40429453cb59816f94793
# Parent  7b2827b336543c854b15163aefcfe211fd89785d
xl: allow def_getopt to handle long options

Improves consistency of option parsing and error handling.

Consistently support --help for all options.

Many users of getopt_long were needlessly passing an option_index
pointer which was not used.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

diff -r 7b2827b33654 -r b63fbacd5037 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Nov 30 11:17:15 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Fri Nov 30 11:17:44 2012 +0000
@@ -2295,19 +2295,34 @@ static int64_t parse_mem_size_kb(const c
     return kbytes;
 }
 
-static int def_getopt(int argc, char * const argv[], const char *optstring,
+#define COMMON_LONG_OPTS {"help", 0, 0, 'h'}
+
+static int def_getopt(int argc, char * const argv[],
+                      const char *optstring,
+                      const struct option *longopts,
                       const char* helpstr, int reqargs)
 {
     int opt;
+    const struct option def_options[] = {
+        COMMON_LONG_OPTS,
+        {0, 0, 0, 0}
+    };
+
+    if (!longopts)
+        longopts = def_options;
 
     opterr = 0;
-    while ((opt = getopt(argc, argv, optstring)) == '?') {
+    while ((opt = getopt_long(argc, argv, optstring, longopts, NULL)) == '?') {
         if (optopt == 'h') {
             help(helpstr);
             return 0;
         }
         fprintf(stderr, "option `%c' not supported.\n", optopt);
     }
+    if (opt == 'h') {
+        help(helpstr);
+        return 0;
+    }
     if (opt != -1)
         return opt;
 
@@ -2343,7 +2358,7 @@ int main_memmax(int argc, char **argv)
     char *mem;
     int rc;
 
-    if ((opt = def_getopt(argc, argv, "", "mem-max", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "mem-max", 2)) != -1)
         return opt;
 
     domid = find_domain(argv[optind]);
@@ -2377,7 +2392,7 @@ int main_memset(int argc, char **argv)
     int opt = 0;
     const char *mem;
 
-    if ((opt = def_getopt(argc, argv, "", "mem-set", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "mem-set", 2)) != -1)
         return opt;
 
     domid = find_domain(argv[optind]);
@@ -2416,7 +2431,7 @@ int main_cd_eject(int argc, char **argv)
     int opt = 0;
     const char *virtdev;
 
-    if ((opt = def_getopt(argc, argv, "", "cd-eject", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "cd-eject", 2)) != -1)
         return opt;
 
     domid = find_domain(argv[optind]);
@@ -2433,7 +2448,7 @@ int main_cd_insert(int argc, char **argv
     const char *virtdev;
     char *file = NULL; /* modified by cd_insert tokenising it */
 
-    if ((opt = def_getopt(argc, argv, "", "cd-insert", 3)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "cd-insert", 3)) != -1)
         return opt;
 
     domid = find_domain(argv[optind]);
@@ -2450,7 +2465,7 @@ int main_console(int argc, char **argv)
     int opt = 0, num = 0;
     libxl_console_type type = 0;
 
-    while ((opt = def_getopt(argc, argv, "n:t:", "console", 1)) != -1) {
+    while ((opt = def_getopt(argc, argv, "n:t:", NULL, "console", 1)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -2481,36 +2496,23 @@ int main_console(int argc, char **argv)
 
 int main_vncviewer(int argc, char **argv)
 {
-    static const struct option long_options[] = {
+    static const struct option opts[] = {
         {"autopass", 0, 0, 'a'},
         {"vncviewer-autopass", 0, 0, 'a'},
-        {"help", 0, 0, 'h'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
     uint32_t domid;
     int opt, autopass = 0;
 
-    while (1) {
-        opt = getopt_long(argc, argv, "ah", long_options, NULL);
-        if (opt == -1)
-            break;
-
+    while ((opt = def_getopt(argc, argv, "ah", opts, "vncviewer", 1)) != -1) {
         switch (opt) {
+        case 0: case 2:
+            return opt;
         case 'a':
             autopass = 1;
             break;
-        case 'h':
-            help("vncviewer");
-            return 0;
-        default:
-            fprintf(stderr, "option `%c' not supported.\n", optopt);
-            break;
-        }
-    }
-
-    if (argc - optind != 1) {
-        help("vncviewer");
-        return 2;
+        }
     }
 
     domid = find_domain(argv[optind]);
@@ -2543,7 +2545,7 @@ int main_pcilist(int argc, char **argv)
     uint32_t domid;
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "pci-list", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "pci-list", 1)) != -1)
         return opt;
 
     domid = find_domain(argv[optind]);
@@ -2582,7 +2584,7 @@ int main_pcidetach(int argc, char **argv
     int force = 0;
     const char *bdf = NULL;
 
-    while ((opt = def_getopt(argc, argv, "f", "pci-detach", 2)) != -1) {
+    while ((opt = def_getopt(argc, argv, "f", NULL, "pci-detach", 2)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -2624,7 +2626,7 @@ int main_pciattach(int argc, char **argv
     int opt;
     const char *bdf = NULL, *vs = NULL;
 
-    if ((opt = def_getopt(argc, argv, "", "pci-attach", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "pci-attach", 2)) != -1)
         return opt;
 
     domid = find_domain(argv[optind]);
@@ -2658,7 +2660,7 @@ int main_pciassignable_list(int argc, ch
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "pci-assignable-list", 0)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "pci-assignable-list", 0)) != -1)
         return opt;
 
     pciassignable_list();
@@ -2690,7 +2692,7 @@ int main_pciassignable_add(int argc, cha
     int opt;
     const char *bdf = NULL;
 
-    while ((opt = def_getopt(argc, argv, "", "pci-assignable-add", 1)) != -1) {
+    while ((opt = def_getopt(argc, argv, "", NULL, "pci-assignable-add", 1)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -2729,7 +2731,7 @@ int main_pciassignable_remove(int argc, 
     const char *bdf = NULL;
     int rebind = 0;
 
-    while ((opt = def_getopt(argc, argv, "r", "pci-assignable-remove", 1)) != -1) {
+    while ((opt = def_getopt(argc, argv, "r", NULL, "pci-assignable-remove", 1)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -3540,24 +3542,18 @@ int main_restore(int argc, char **argv)
     int paused = 0, debug = 0, daemonize = 1, monitor = 1,
         console_autoconnect = 0, vnc = 0, vncautopass = 0;
     int opt, rc;
-    int option_index = 0;
-    static struct option long_options[] = {
+    static struct option opts[] = {
         {"vncviewer", 0, 0, 'V'},
         {"vncviewer-autopass", 0, 0, 'A'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
 
-    while (1) {
-        opt = getopt_long(argc, argv, "FhcpdeVA", long_options, &option_index);
-        if (opt == -1)
-            break;
-
+    while ((opt = def_getopt(argc, argv, "FhcpdeVA",
+                             opts, "restore", 1)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
-        case 'h':
-            help("restore");
-            return 2;
         case 'c':
             console_autoconnect = 1;
             break;
@@ -3617,7 +3613,7 @@ int main_migrate_receive(int argc, char 
     int debug = 0, daemonize = 1, monitor = 1, remus = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "Fedr", "migrate-receive", 0)) != -1) {
+    while ((opt = def_getopt(argc, argv, "Fedr", NULL, "migrate-receive", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -3656,7 +3652,7 @@ int main_save(int argc, char **argv)
     int checkpoint = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "c", "save", 2)) != -1) {
+    while ((opt = def_getopt(argc, argv, "c", NULL, "save", 2)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -3689,7 +3685,7 @@ int main_migrate(int argc, char **argv)
     char *host;
     int opt, daemonize = 1, monitor = 1, debug = 0;
 
-    while ((opt = def_getopt(argc, argv, "FC:s:ed", "migrate", 2)) != -1) {
+    while ((opt = def_getopt(argc, argv, "FC:s:ed", NULL, "migrate", 2)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -3733,7 +3729,7 @@ int main_dump_core(int argc, char **argv
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "dump-core", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "dump-core", 2)) != -1)
         return opt;
 
     core_dump_domain(find_domain(argv[optind]), argv[optind + 1]);
@@ -3744,7 +3740,7 @@ int main_pause(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "pause", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "pause", 1)) != -1)
         return opt;
 
     pause_domain(find_domain(argv[optind]));
@@ -3756,7 +3752,7 @@ int main_unpause(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "unpause", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "unpause", 1)) != -1)
         return opt;
 
     unpause_domain(find_domain(argv[optind]));
@@ -3768,7 +3764,7 @@ int main_destroy(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "destroy", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "destroy", 1)) != -1)
         return opt;
 
     destroy_domain(find_domain(argv[optind]));
@@ -3777,19 +3773,21 @@ int main_destroy(int argc, char **argv)
 
 static int main_shutdown_or_reboot(int do_reboot, int argc, char **argv)
 {
+    const char *what = do_reboot ? "reboot" : "shutdown";
     void (*fn)(uint32_t domid,
                libxl_evgen_domain_death **, libxl_ev_user, int) =
         do_reboot ? &reboot_domain : &shutdown_domain;
     int opt, i, nb_domain;
     int wait_for_it = 0, all =0;
     int fallback_trigger = 0;
-    static struct option long_options[] = {
+    static struct option opts[] = {
         {"all", 0, 0, 'a'},
         {"wait", 0, 0, 'w'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
 
-    while ((opt = getopt_long(argc, argv, "awF", long_options, NULL)) != -1) {
+    while ((opt = def_getopt(argc, argv, "awF", opts, what, 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -3861,12 +3859,11 @@ int main_list(int argc, char **argv)
     int opt, verbose = 0;
     int context = 0;
     int details = 0;
-    int option_index = 0;
-    static struct option long_options[] = {
+    static struct option opts[] = {
         {"long", 0, 0, 'l'},
-        {"help", 0, 0, 'h'},
         {"verbose", 0, 0, 'v'},
         {"context", 0, 0, 'Z'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
 
@@ -3874,12 +3871,10 @@ int main_list(int argc, char **argv)
     libxl_dominfo *info, *info_free=0;
     int nb_domain, rc;
 
-    while (1) {
-        opt = getopt_long(argc, argv, "lvhZ", long_options, &option_index);
-        if (opt == -1)
-            break;
-
+    while ((opt = def_getopt(argc, argv, "lvhZ", opts, "list", 0)) != -1) {
         switch (opt) {
+        case 0: case 2:
+            return opt;
         case 'l':
             details = 1;
             break;
@@ -3892,9 +3887,6 @@ int main_list(int argc, char **argv)
         case 'Z':
             context = 1;
             break;
-        default:
-            fprintf(stderr, "option `%c' not supported.\n", optopt);
-            break;
         }
     }
 
@@ -3941,7 +3933,7 @@ int main_vm_list(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "vm-list", 0)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "vm-list", 0)) != -1)
         return opt;
 
     list_vm();
@@ -3957,14 +3949,13 @@ int main_create(int argc, char **argv)
     int paused = 0, debug = 0, daemonize = 1, console_autoconnect = 0,
         quiet = 0, monitor = 1, vnc = 0, vncautopass = 0;
     int opt, rc;
-    int option_index = 0;
-    static struct option long_options[] = {
+    static struct option opts[] = {
         {"dryrun", 0, 0, 'n'},
         {"quiet", 0, 0, 'q'},
-        {"help", 0, 0, 'h'},
         {"defconfig", 1, 0, 'f'},
         {"vncviewer", 0, 0, 'V'},
         {"vncviewer-autopass", 0, 0, 'A'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
 
@@ -3973,12 +3964,10 @@ int main_create(int argc, char **argv)
         argc--; argv++;
     }
 
-    while (1) {
-        opt = getopt_long(argc, argv, "Fhnqf:pcdeVA", long_options, &option_index);
-        if (opt == -1)
-            break;
-
+    while ((opt = def_getopt(argc, argv, "Fhnqf:pcdeVA", opts, "create", 0)) != -1) {
         switch (opt) {
+        case 0: case 2:
+            return opt;
         case 'f':
             filename = optarg;
             break;
@@ -4013,9 +4002,6 @@ int main_create(int argc, char **argv)
         case 'A':
             vnc = vncautopass = 1;
             break;
-        default:
-            fprintf(stderr, "option `%c' not supported.\n", optopt);
-            break;
         }
     }
 
@@ -4063,11 +4049,10 @@ int main_config_update(int argc, char **
     int config_len = 0;
     libxl_domain_config d_config;
     int opt, rc;
-    int option_index = 0;
     int debug = 0;
-    static struct option long_options[] = {
-        {"help", 0, 0, 'h'},
+    static struct option opts[] = {
         {"defconfig", 1, 0, 'f'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
 
@@ -4085,24 +4070,16 @@ int main_config_update(int argc, char **
         argc--; argv++;
     }
 
-    while (1) {
-        opt = getopt_long(argc, argv, "dhqf:", long_options, &option_index);
-        if (opt == -1)
-            break;
-
+    while ((opt = def_getopt(argc, argv, "dhqf:", opts, "config_update", 0)) != -1) {
         switch (opt) {
+        case 0: case 2:
+            return opt;
         case 'd':
             debug = 1;
             break;
         case 'f':
             filename = optarg;
             break;
-        case 'h':
-            help("create");
-            return 0;
-        default:
-            fprintf(stderr, "option `%c' not supported.\n", optopt);
-            break;
         }
     }
 
@@ -4191,7 +4168,7 @@ int main_button_press(int argc, char **a
     fprintf(stderr, "WARNING: \"button-press\" is deprecated. "
             "Please use \"trigger\"\n");
 
-    if ((opt = def_getopt(argc, argv, "", "button-press", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "button-press", 2)) != -1)
         return opt;
 
     button_press(find_domain(argv[optind]), argv[optind + 1]);
@@ -4332,7 +4309,7 @@ int main_vcpulist(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "cpu-list", 0)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "cpu-list", 0)) != -1)
         return opt;
 
     vcpulist(argc - optind, argv + optind);
@@ -4393,7 +4370,7 @@ int main_vcpupin(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "vcpu-pin", 3)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "vcpu-pin", 3)) != -1)
         return opt;
 
     vcpupin(find_domain(argv[optind]), argv[optind+1] , argv[optind+2]);
@@ -4429,7 +4406,7 @@ int main_vcpuset(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "vcpu-set", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "vcpu-set", 2)) != -1)
         return opt;
 
     vcpuset(find_domain(argv[optind]), argv[optind+1]);
@@ -4605,25 +4582,20 @@ static void print_info(int numa)
 int main_info(int argc, char **argv)
 {
     int opt;
-    int option_index = 0;
-    static struct option long_options[] = {
-        {"help", 0, 0, 'h'},
+    static struct option opts[] = {
         {"numa", 0, 0, 'n'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
     int numa = 0;
 
-    while ((opt = getopt_long(argc, argv, "hn", long_options, &option_index)) != -1) {
+    while ((opt = def_getopt(argc, argv, "hn", opts, "info", 0)) != -1) {
         switch (opt) {
-        case 'h':
-            help("info");
-            return 0;
+        case 0: case 2:
+            return opt;
         case 'n':
             numa = 1;
             break;
-        default:
-            fprintf(stderr, "option `%c' not supported.\n", optopt);
-            break;
         }
     }
 
@@ -4658,7 +4630,7 @@ int main_sharing(int argc, char **argv)
     libxl_dominfo *info, *info_free = NULL;
     int nb_domain, rc;
 
-    if ((opt = def_getopt(argc, argv, "", "sharing", 0)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "sharing", 0)) != -1)
         return opt;
 
     if (optind >= argc) {
@@ -4927,8 +4899,7 @@ int main_sched_credit(int argc, char **a
     int opt_s = 0;
     int tslice = 0, opt_t = 0, ratelimit = 0, opt_r = 0;
     int opt, rc;
-    int option_index = 0;
-    static struct option long_options[] = {
+    static struct option opts[] = {
         {"domain", 1, 0, 'd'},
         {"weight", 1, 0, 'w'},
         {"cap", 1, 0, 'c'},
@@ -4936,15 +4907,11 @@ int main_sched_credit(int argc, char **a
         {"tslice_ms", 1, 0, 't'},
         {"ratelimit_us", 1, 0, 'r'},
         {"cpupool", 1, 0, 'p'},
-        {"help", 0, 0, 'h'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
 
-    while (1) {
-        opt = getopt_long(argc, argv, "d:w:c:p:t:r:hs", long_options,
-                          &option_index);
-        if (opt == -1)
-            break;
+    while ((opt = def_getopt(argc, argv, "d:w:c:p:t:r:hs", opts, "sched-credit", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -4973,9 +4940,6 @@ int main_sched_credit(int argc, char **a
         case 'p':
             cpupool = optarg;
             break;
-        case 'h':
-            help("sched-credit");
-            return 0;
         }
     }
 
@@ -5058,19 +5022,15 @@ int main_sched_credit2(int argc, char **
     const char *cpupool = NULL;
     int weight = 256, opt_w = 0;
     int opt, rc;
-    int option_index = 0;
-    static struct option long_options[] = {
+    static struct option opts[] = {
         {"domain", 1, 0, 'd'},
         {"weight", 1, 0, 'w'},
         {"cpupool", 1, 0, 'p'},
-        {"help", 0, 0, 'h'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
 
-    while (1) {
-        opt = getopt_long(argc, argv, "d:w:p:h", long_options, &option_index);
-        if (opt == -1)
-            break;
+    while ((opt = def_getopt(argc, argv, "d:w:p:h", opts, "sched-credit2", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -5084,9 +5044,6 @@ int main_sched_credit2(int argc, char **
         case 'p':
             cpupool = optarg;
             break;
-        case 'h':
-            help("sched-credit");
-            return 0;
         }
     }
 
@@ -5137,23 +5094,18 @@ int main_sched_sedf(int argc, char **arg
     int extra = 0, opt_e = 0;
     int weight = 0, opt_w = 0;
     int opt, rc;
-    int option_index = 0;
-    static struct option long_options[] = {
+    static struct option opts[] = {
         {"period", 1, 0, 'p'},
         {"slice", 1, 0, 's'},
         {"latency", 1, 0, 'l'},
         {"extra", 1, 0, 'e'},
         {"weight", 1, 0, 'w'},
         {"cpupool", 1, 0, 'c'},
-        {"help", 0, 0, 'h'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
 
-    while (1) {
-        opt = getopt_long(argc, argv, "d:p:s:l:e:w:c:h", long_options,
-                          &option_index);
-        if (opt == -1)
-            break;
+    while ((opt = def_getopt(argc, argv, "d:p:s:l:e:w:c:h", opts, "sched-sedf", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -5183,9 +5135,6 @@ int main_sched_sedf(int argc, char **arg
         case 'c':
             cpupool = optarg;
             break;
-        case 'h':
-            help("sched-sedf");
-            return 0;
         }
     }
 
@@ -5253,7 +5202,7 @@ int main_domid(int argc, char **argv)
     int opt;
     const char *domname = NULL;
 
-    if ((opt = def_getopt(argc, argv, "", "domid", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "domid", 1)) != -1)
         return opt;
 
     domname = argv[optind];
@@ -5275,7 +5224,7 @@ int main_domname(int argc, char **argv)
     char *domname = NULL;
     char *endptr = NULL;
 
-    if ((opt = def_getopt(argc, argv, "", "domname", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "domname", 1)) != -1)
         return opt;
 
     domid = strtol(argv[optind], &endptr, 10);
@@ -5303,7 +5252,7 @@ int main_rename(int argc, char **argv)
     int opt;
     const char *dom, *new_name;
 
-    if ((opt = def_getopt(argc, argv, "", "rename", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "rename", 2)) != -1)
         return opt;
 
     dom = argv[optind++];
@@ -5327,7 +5276,7 @@ int main_trigger(int argc, char **argv)
     const char *trigger_name = NULL;
     libxl_trigger trigger;
 
-    if ((opt = def_getopt(argc, argv, "", "trigger", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "trigger", 2)) != -1)
         return opt;
 
     domid = find_domain(argv[optind++]);
@@ -5357,7 +5306,7 @@ int main_sysrq(int argc, char **argv)
     int opt;
     const char *sysrq = NULL;
 
-    if ((opt = def_getopt(argc, argv, "", "sysrq", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "sysrq", 2)) != -1)
         return opt;
 
     domid = find_domain(argv[optind++]);
@@ -5380,7 +5329,7 @@ int main_debug_keys(int argc, char **arg
     int opt;
     char *keys;
 
-    if ((opt = def_getopt(argc, argv, "", "debug-keys", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "debug-keys", 1)) != -1)
         return opt;
 
     keys = argv[optind];
@@ -5400,7 +5349,7 @@ int main_dmesg(int argc, char **argv)
     char *line;
     int opt, ret = 1;
 
-    while ((opt = def_getopt(argc, argv, "c", "dmesg", 0)) != -1) {
+    while ((opt = def_getopt(argc, argv, "c", NULL, "dmesg", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -5426,7 +5375,7 @@ int main_top(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "top", 0)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "top", 0)) != -1)
         return opt;
 
     return system("xentop");
@@ -5443,7 +5392,7 @@ int main_networkattach(int argc, char **
     int i;
     unsigned int val;
 
-    if ((opt = def_getopt(argc, argv, "", "network-attach", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "network-attach", 1)) != -1)
         return opt;
 
     if (argc-optind > 11) {
@@ -5530,7 +5479,7 @@ int main_networklist(int argc, char **ar
     libxl_nicinfo nicinfo;
     int nb, i;
 
-    if ((opt = def_getopt(argc, argv, "", "network-list", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "network-list", 1)) != -1)
         return opt;
 
     /*      Idx  BE   MAC   Hdl  Sta  evch txr/rxr  BE-path */
@@ -5567,7 +5516,7 @@ int main_networkdetach(int argc, char **
     int opt;
     libxl_device_nic nic;
 
-    if ((opt = def_getopt(argc, argv, "", "network-detach", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "network-detach", 2)) != -1)
         return opt;
 
     domid = find_domain(argv[optind]);
@@ -5598,7 +5547,7 @@ int main_blockattach(int argc, char **ar
     libxl_device_disk disk = { 0 };
     XLU_Config *config = 0;
 
-    if ((opt = def_getopt(argc, argv, "", "block-attach", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "block-attach", 2)) != -1)
         return opt;
 
     if (domain_qualifier_to_domid(argv[optind], &fe_domid, 0) < 0) {
@@ -5633,7 +5582,7 @@ int main_blocklist(int argc, char **argv
     libxl_device_disk *disks;
     libxl_diskinfo diskinfo;
 
-    if ((opt = def_getopt(argc, argv, "", "block-list", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "block-list", 1)) != -1)
         return opt;
 
     printf("%-5s %-3s %-6s %-5s %-6s %-8s %-30s\n",
@@ -5669,7 +5618,7 @@ int main_blockdetach(int argc, char **ar
     int opt, rc = 0;
     libxl_device_disk disk;
 
-    if ((opt = def_getopt(argc, argv, "", "block-detach", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "block-detach", 2)) != -1)
         return opt;
 
     domid = find_domain(argv[optind]);
@@ -5694,7 +5643,7 @@ int main_vtpmattach(int argc, char **arg
     unsigned int val;
     uint32_t domid;
 
-    if ((opt = def_getopt(argc, argv, "", "vtpm-attach", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "vtpm-attach", 1)) != -1)
         return opt;
 
     if (domain_qualifier_to_domid(argv[optind], &domid, 0) < 0) {
@@ -5747,7 +5696,7 @@ int main_vtpmlist(int argc, char **argv)
     libxl_vtpminfo vtpminfo;
     int nb, i;
 
-    if ((opt = def_getopt(argc, argv, "", "vtpm-list", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "vtpm-list", 1)) != -1)
         return opt;
 
     /*      Idx  BE   UUID   Hdl  Sta  evch rref  BE-path */
@@ -5787,7 +5736,7 @@ int main_vtpmdetach(int argc, char **arg
     libxl_device_vtpm vtpm;
     libxl_uuid uuid;
 
-    if ((opt = def_getopt(argc, argv, "", "vtpm-detach", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "vtpm-detach", 2)) != -1)
         return opt;
 
     domid = find_domain(argv[optind]);
@@ -5979,7 +5928,7 @@ int main_uptime(int argc, char **argv)
     int nb_doms = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "s", "uptime", 1)) != -1) {
+    while ((opt = def_getopt(argc, argv, "s", NULL, "uptime", 1)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -6006,7 +5955,7 @@ int main_tmem_list(int argc, char **argv
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "al", "tmem-list", 0)) != -1) {
+    while ((opt = def_getopt(argc, argv, "al", NULL, "tmem-list", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -6047,7 +5996,7 @@ int main_tmem_freeze(int argc, char **ar
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "a", "tmem-freeze", 0)) != -1) {
+    while ((opt = def_getopt(argc, argv, "a", NULL, "tmem-freeze", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -6080,7 +6029,7 @@ int main_tmem_thaw(int argc, char **argv
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "a", "tmem-thaw", 0)) != -1) {
+    while ((opt = def_getopt(argc, argv, "a", NULL, "tmem-thaw", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -6115,7 +6064,7 @@ int main_tmem_set(int argc, char **argv)
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "aw:c:p:", "tmem-set", 0)) != -1) {
+    while ((opt = def_getopt(argc, argv, "aw:c:p:", NULL, "tmem-set", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -6176,7 +6125,7 @@ int main_tmem_shared_auth(int argc, char
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "au:A:", "tmem-shared-auth", 0)) != -1) {
+    while ((opt = def_getopt(argc, argv, "au:A:", NULL, "tmem-shared-auth", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -6226,7 +6175,7 @@ int main_tmem_freeable(int argc, char **
     int opt;
     int mb;
 
-    if ((opt = def_getopt(argc, argv, "", "tmem-freeable", 0)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "tmem-freeable", 0)) != -1)
         return opt;
 
     mb = libxl_tmem_freeable(ctx);
@@ -6243,11 +6192,10 @@ int main_cpupoolcreate(int argc, char **
     const char *p;
     char extra_config[1024];
     int opt;
-    int option_index = 0;
-    static struct option long_options[] = {
-        {"help", 0, 0, 'h'},
+    static struct option opts[] = {
         {"defconfig", 1, 0, 'f'},
         {"dryrun", 0, 0, 'n'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
     int ret;
@@ -6265,26 +6213,18 @@ int main_cpupoolcreate(int argc, char **
     libxl_bitmap cpumap;
     libxl_uuid uuid;
     libxl_cputopology *topology;
-    int rc = -ERROR_FAIL; 
-
-    while (1) {
-        opt = getopt_long(argc, argv, "hnf:", long_options, &option_index);
-        if (opt == -1)
-            break;
-
+    int rc = -ERROR_FAIL;
+
+    while ((opt = def_getopt(argc, argv, "hnf:", opts, "cpupool-create", 0)) != -1) {
         switch (opt) {
+        case 0: case 2:
+            return opt;
         case 'f':
             filename = optarg;
             break;
-        case 'h':
-            help("cpupool-create");
-            return 0;
         case 'n':
             dryrun_only = 1;
             break;
-        default:
-            fprintf(stderr, "option `%c' not supported.\n", optopt);
-            break;
         }
     }
 
@@ -6447,10 +6387,9 @@ out:
 int main_cpupoollist(int argc, char **argv)
 {
     int opt;
-    int option_index = 0;
-    static struct option long_options[] = {
-        {"help", 0, 0, 'h'},
+    static struct option opts[] = {
         {"cpus", 0, 0, 'c'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
     int opt_cpus = 0;
@@ -6461,28 +6400,16 @@ int main_cpupoollist(int argc, char **ar
     char *name;
     int ret = 0;
 
-    while (1) {
-        opt = getopt_long(argc, argv, "hc", long_options, &option_index);
-        if (opt == -1)
+    while ((opt = def_getopt(argc, argv, "hc", opts, "cpupool-list", 1)) != -1) {
+        switch (opt) {
+        case 0: case 2:
             break;
-
-        switch (opt) {
-        case 'h':
-            help("cpupool-list");
-            return 0;
         case 'c':
             opt_cpus = 1;
             break;
-        default:
-            fprintf(stderr, "option `%c' not supported.\n", optopt);
-            break;
-        }
-    }
-
-    if ((optind + 1) < argc) {
-        help("cpupool-list");
-        return -ERROR_FAIL;
-    }
+        }
+    }
+
     if (optind < argc) {
         pool = argv[optind];
         if (libxl_name_to_cpupoolid(ctx, pool, &poolid)) {
@@ -6540,7 +6467,7 @@ int main_cpupooldestroy(int argc, char *
     const char *pool;
     uint32_t poolid;
 
-    if ((opt = def_getopt(argc, argv, "", "cpupool-destroy", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-destroy", 1)) != -1)
         return opt;
 
     pool = argv[optind];
@@ -6561,7 +6488,7 @@ int main_cpupoolrename(int argc, char **
     const char *new_name;
     uint32_t poolid;
 
-    if ((opt = def_getopt(argc, argv, "", "cpupool-rename", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-rename", 2)) != -1)
         return opt;
 
     pool = argv[optind++];
@@ -6591,7 +6518,7 @@ int main_cpupoolcpuadd(int argc, char **
     int node;
     int n;
 
-    if ((opt = def_getopt(argc, argv, "", "cpupool-cpu-add", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-cpu-add", 2)) != -1)
         return opt;
 
     pool = argv[optind++];
@@ -6635,7 +6562,7 @@ int main_cpupoolcpuremove(int argc, char
     int node;
     int n;
 
-    if ((opt = def_getopt(argc, argv, "", "cpupool-cpu-remove", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-cpu-remove", 2)) != -1)
         return opt;
 
     pool = argv[optind++];
@@ -6678,7 +6605,7 @@ int main_cpupoolmigrate(int argc, char *
     const char *dom;
     uint32_t domid;
 
-    if ((opt = def_getopt(argc, argv, "", "cpupool-migrate", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-migrate", 2)) != -1)
         return opt;
 
     dom = argv[optind++];
@@ -6718,7 +6645,7 @@ int main_cpupoolnumasplit(int argc, char
     libxl_cputopology *topology;
     libxl_dominfo info;
 
-    if ((opt = def_getopt(argc, argv, "", "cpupool-numa-split", 0)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-numa-split", 0)) != -1)
         return opt;
     ret = 0;
 
@@ -6971,7 +6898,7 @@ int main_remus(int argc, char **argv)
     r_info.blackhole = 0;
     r_info.compression = 1;
 
-    while ((opt = def_getopt(argc, argv, "bui:s:e", "remus", 2)) != -1) {
+    while ((opt = def_getopt(argc, argv, "bui:s:e", NULL, "remus", 2)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:21:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:21:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOf6-0005Jb-0X; Fri, 30 Nov 2012 11:21:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeOf3-0005J6-K2
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:21:38 +0000
Received: from [85.158.139.83:19104] by server-14.bemta-5.messagelabs.com id
	50/40-21768-0C698B05; Fri, 30 Nov 2012 11:21:36 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1354274488!27709762!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31784 invoked from network); 30 Nov 2012 11:21:29 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:21:29 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="215987224"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 11:21:28 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 06:21:27 -0500
Received: from cosworth.uk.xensource.com ([10.80.16.52] ident=ianc)	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<ian.campbell@citrix.com>)	id 1TeOet-0000fK-5Z;
	Fri, 30 Nov 2012 11:21:27 +0000
MIME-Version: 1.0
X-Mercurial-Node: b63fbacd5037e79bc4f40429453cb59816f94793
Message-ID: <b63fbacd5037e79bc4f4.1354274487@cosworth.uk.xensource.com>
In-Reply-To: <patchbomb.1354274486@cosworth.uk.xensource.com>
References: <patchbomb.1354274486@cosworth.uk.xensource.com>
User-Agent: Mercurial-patchbomb/1.6.4
Date: Fri, 30 Nov 2012 11:21:27 +0000
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [PATCH 1 of 2] xl: allow def_getopt to handle long
	options
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ijc@hellion.org.uk>
# Date 1354274264 0
# Node ID b63fbacd5037e79bc4f40429453cb59816f94793
# Parent  7b2827b336543c854b15163aefcfe211fd89785d
xl: allow def_getopt to handle long options

Improves consistency of option parsing and error handling.

Consistently support --help for all options.

Many users of getopt_long were needlessly passing an option_index
pointer which was not used.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

diff -r 7b2827b33654 -r b63fbacd5037 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Nov 30 11:17:15 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Fri Nov 30 11:17:44 2012 +0000
@@ -2295,19 +2295,34 @@ static int64_t parse_mem_size_kb(const c
     return kbytes;
 }
 
-static int def_getopt(int argc, char * const argv[], const char *optstring,
+#define COMMON_LONG_OPTS {"help", 0, 0, 'h'}
+
+static int def_getopt(int argc, char * const argv[],
+                      const char *optstring,
+                      const struct option *longopts,
                       const char* helpstr, int reqargs)
 {
     int opt;
+    const struct option def_options[] = {
+        COMMON_LONG_OPTS,
+        {0, 0, 0, 0}
+    };
+
+    if (!longopts)
+        longopts = def_options;
 
     opterr = 0;
-    while ((opt = getopt(argc, argv, optstring)) == '?') {
+    while ((opt = getopt_long(argc, argv, optstring, longopts, NULL)) == '?') {
         if (optopt == 'h') {
             help(helpstr);
             return 0;
         }
         fprintf(stderr, "option `%c' not supported.\n", optopt);
     }
+    if (opt == 'h') {
+        help(helpstr);
+        return 0;
+    }
     if (opt != -1)
         return opt;
 
@@ -2343,7 +2358,7 @@ int main_memmax(int argc, char **argv)
     char *mem;
     int rc;
 
-    if ((opt = def_getopt(argc, argv, "", "mem-max", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "mem-max", 2)) != -1)
         return opt;
 
     domid = find_domain(argv[optind]);
@@ -2377,7 +2392,7 @@ int main_memset(int argc, char **argv)
     int opt = 0;
     const char *mem;
 
-    if ((opt = def_getopt(argc, argv, "", "mem-set", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "mem-set", 2)) != -1)
         return opt;
 
     domid = find_domain(argv[optind]);
@@ -2416,7 +2431,7 @@ int main_cd_eject(int argc, char **argv)
     int opt = 0;
     const char *virtdev;
 
-    if ((opt = def_getopt(argc, argv, "", "cd-eject", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "cd-eject", 2)) != -1)
         return opt;
 
     domid = find_domain(argv[optind]);
@@ -2433,7 +2448,7 @@ int main_cd_insert(int argc, char **argv
     const char *virtdev;
     char *file = NULL; /* modified by cd_insert tokenising it */
 
-    if ((opt = def_getopt(argc, argv, "", "cd-insert", 3)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "cd-insert", 3)) != -1)
         return opt;
 
     domid = find_domain(argv[optind]);
@@ -2450,7 +2465,7 @@ int main_console(int argc, char **argv)
     int opt = 0, num = 0;
     libxl_console_type type = 0;
 
-    while ((opt = def_getopt(argc, argv, "n:t:", "console", 1)) != -1) {
+    while ((opt = def_getopt(argc, argv, "n:t:", NULL, "console", 1)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -2481,36 +2496,23 @@ int main_console(int argc, char **argv)
 
 int main_vncviewer(int argc, char **argv)
 {
-    static const struct option long_options[] = {
+    static const struct option opts[] = {
         {"autopass", 0, 0, 'a'},
         {"vncviewer-autopass", 0, 0, 'a'},
-        {"help", 0, 0, 'h'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
     uint32_t domid;
     int opt, autopass = 0;
 
-    while (1) {
-        opt = getopt_long(argc, argv, "ah", long_options, NULL);
-        if (opt == -1)
-            break;
-
+    while ((opt = def_getopt(argc, argv, "ah", opts, "vncviewer", 1)) != -1) {
         switch (opt) {
+        case 0: case 2:
+            return opt;
         case 'a':
             autopass = 1;
             break;
-        case 'h':
-            help("vncviewer");
-            return 0;
-        default:
-            fprintf(stderr, "option `%c' not supported.\n", optopt);
-            break;
-        }
-    }
-
-    if (argc - optind != 1) {
-        help("vncviewer");
-        return 2;
+        }
     }
 
     domid = find_domain(argv[optind]);
@@ -2543,7 +2545,7 @@ int main_pcilist(int argc, char **argv)
     uint32_t domid;
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "pci-list", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "pci-list", 1)) != -1)
         return opt;
 
     domid = find_domain(argv[optind]);
@@ -2582,7 +2584,7 @@ int main_pcidetach(int argc, char **argv
     int force = 0;
     const char *bdf = NULL;
 
-    while ((opt = def_getopt(argc, argv, "f", "pci-detach", 2)) != -1) {
+    while ((opt = def_getopt(argc, argv, "f", NULL, "pci-detach", 2)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -2624,7 +2626,7 @@ int main_pciattach(int argc, char **argv
     int opt;
     const char *bdf = NULL, *vs = NULL;
 
-    if ((opt = def_getopt(argc, argv, "", "pci-attach", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "pci-attach", 2)) != -1)
         return opt;
 
     domid = find_domain(argv[optind]);
@@ -2658,7 +2660,7 @@ int main_pciassignable_list(int argc, ch
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "pci-assignable-list", 0)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "pci-assignable-list", 0)) != -1)
         return opt;
 
     pciassignable_list();
@@ -2690,7 +2692,7 @@ int main_pciassignable_add(int argc, cha
     int opt;
     const char *bdf = NULL;
 
-    while ((opt = def_getopt(argc, argv, "", "pci-assignable-add", 1)) != -1) {
+    while ((opt = def_getopt(argc, argv, "", NULL, "pci-assignable-add", 1)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -2729,7 +2731,7 @@ int main_pciassignable_remove(int argc, 
     const char *bdf = NULL;
     int rebind = 0;
 
-    while ((opt = def_getopt(argc, argv, "r", "pci-assignable-remove", 1)) != -1) {
+    while ((opt = def_getopt(argc, argv, "r", NULL, "pci-assignable-remove", 1)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -3540,24 +3542,18 @@ int main_restore(int argc, char **argv)
     int paused = 0, debug = 0, daemonize = 1, monitor = 1,
         console_autoconnect = 0, vnc = 0, vncautopass = 0;
     int opt, rc;
-    int option_index = 0;
-    static struct option long_options[] = {
+    static struct option opts[] = {
         {"vncviewer", 0, 0, 'V'},
         {"vncviewer-autopass", 0, 0, 'A'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
 
-    while (1) {
-        opt = getopt_long(argc, argv, "FhcpdeVA", long_options, &option_index);
-        if (opt == -1)
-            break;
-
+    while ((opt = def_getopt(argc, argv, "FhcpdeVA",
+                             opts, "restore", 1)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
-        case 'h':
-            help("restore");
-            return 2;
         case 'c':
             console_autoconnect = 1;
             break;
@@ -3617,7 +3613,7 @@ int main_migrate_receive(int argc, char 
     int debug = 0, daemonize = 1, monitor = 1, remus = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "Fedr", "migrate-receive", 0)) != -1) {
+    while ((opt = def_getopt(argc, argv, "Fedr", NULL, "migrate-receive", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -3656,7 +3652,7 @@ int main_save(int argc, char **argv)
     int checkpoint = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "c", "save", 2)) != -1) {
+    while ((opt = def_getopt(argc, argv, "c", NULL, "save", 2)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -3689,7 +3685,7 @@ int main_migrate(int argc, char **argv)
     char *host;
     int opt, daemonize = 1, monitor = 1, debug = 0;
 
-    while ((opt = def_getopt(argc, argv, "FC:s:ed", "migrate", 2)) != -1) {
+    while ((opt = def_getopt(argc, argv, "FC:s:ed", NULL, "migrate", 2)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -3733,7 +3729,7 @@ int main_dump_core(int argc, char **argv
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "dump-core", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "dump-core", 2)) != -1)
         return opt;
 
     core_dump_domain(find_domain(argv[optind]), argv[optind + 1]);
@@ -3744,7 +3740,7 @@ int main_pause(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "pause", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "pause", 1)) != -1)
         return opt;
 
     pause_domain(find_domain(argv[optind]));
@@ -3756,7 +3752,7 @@ int main_unpause(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "unpause", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "unpause", 1)) != -1)
         return opt;
 
     unpause_domain(find_domain(argv[optind]));
@@ -3768,7 +3764,7 @@ int main_destroy(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "destroy", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "destroy", 1)) != -1)
         return opt;
 
     destroy_domain(find_domain(argv[optind]));
@@ -3777,19 +3773,21 @@ int main_destroy(int argc, char **argv)
 
 static int main_shutdown_or_reboot(int do_reboot, int argc, char **argv)
 {
+    const char *what = do_reboot ? "reboot" : "shutdown";
     void (*fn)(uint32_t domid,
                libxl_evgen_domain_death **, libxl_ev_user, int) =
         do_reboot ? &reboot_domain : &shutdown_domain;
     int opt, i, nb_domain;
     int wait_for_it = 0, all =0;
     int fallback_trigger = 0;
-    static struct option long_options[] = {
+    static struct option opts[] = {
         {"all", 0, 0, 'a'},
         {"wait", 0, 0, 'w'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
 
-    while ((opt = getopt_long(argc, argv, "awF", long_options, NULL)) != -1) {
+    while ((opt = def_getopt(argc, argv, "awF", opts, what, 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -3861,12 +3859,11 @@ int main_list(int argc, char **argv)
     int opt, verbose = 0;
     int context = 0;
     int details = 0;
-    int option_index = 0;
-    static struct option long_options[] = {
+    static struct option opts[] = {
         {"long", 0, 0, 'l'},
-        {"help", 0, 0, 'h'},
         {"verbose", 0, 0, 'v'},
         {"context", 0, 0, 'Z'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
 
@@ -3874,12 +3871,10 @@ int main_list(int argc, char **argv)
     libxl_dominfo *info, *info_free=0;
     int nb_domain, rc;
 
-    while (1) {
-        opt = getopt_long(argc, argv, "lvhZ", long_options, &option_index);
-        if (opt == -1)
-            break;
-
+    while ((opt = def_getopt(argc, argv, "lvhZ", opts, "list", 0)) != -1) {
         switch (opt) {
+        case 0: case 2:
+            return opt;
         case 'l':
             details = 1;
             break;
@@ -3892,9 +3887,6 @@ int main_list(int argc, char **argv)
         case 'Z':
             context = 1;
             break;
-        default:
-            fprintf(stderr, "option `%c' not supported.\n", optopt);
-            break;
         }
     }
 
@@ -3941,7 +3933,7 @@ int main_vm_list(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "vm-list", 0)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "vm-list", 0)) != -1)
         return opt;
 
     list_vm();
@@ -3957,14 +3949,13 @@ int main_create(int argc, char **argv)
     int paused = 0, debug = 0, daemonize = 1, console_autoconnect = 0,
         quiet = 0, monitor = 1, vnc = 0, vncautopass = 0;
     int opt, rc;
-    int option_index = 0;
-    static struct option long_options[] = {
+    static struct option opts[] = {
         {"dryrun", 0, 0, 'n'},
         {"quiet", 0, 0, 'q'},
-        {"help", 0, 0, 'h'},
         {"defconfig", 1, 0, 'f'},
         {"vncviewer", 0, 0, 'V'},
         {"vncviewer-autopass", 0, 0, 'A'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
 
@@ -3973,12 +3964,10 @@ int main_create(int argc, char **argv)
         argc--; argv++;
     }
 
-    while (1) {
-        opt = getopt_long(argc, argv, "Fhnqf:pcdeVA", long_options, &option_index);
-        if (opt == -1)
-            break;
-
+    while ((opt = def_getopt(argc, argv, "Fhnqf:pcdeVA", opts, "create", 0)) != -1) {
         switch (opt) {
+        case 0: case 2:
+            return opt;
         case 'f':
             filename = optarg;
             break;
@@ -4013,9 +4002,6 @@ int main_create(int argc, char **argv)
         case 'A':
             vnc = vncautopass = 1;
             break;
-        default:
-            fprintf(stderr, "option `%c' not supported.\n", optopt);
-            break;
         }
     }
 
@@ -4063,11 +4049,10 @@ int main_config_update(int argc, char **
     int config_len = 0;
     libxl_domain_config d_config;
     int opt, rc;
-    int option_index = 0;
     int debug = 0;
-    static struct option long_options[] = {
-        {"help", 0, 0, 'h'},
+    static struct option opts[] = {
         {"defconfig", 1, 0, 'f'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
 
@@ -4085,24 +4070,16 @@ int main_config_update(int argc, char **
         argc--; argv++;
     }
 
-    while (1) {
-        opt = getopt_long(argc, argv, "dhqf:", long_options, &option_index);
-        if (opt == -1)
-            break;
-
+    while ((opt = def_getopt(argc, argv, "dhqf:", opts, "config_update", 0)) != -1) {
         switch (opt) {
+        case 0: case 2:
+            return opt;
         case 'd':
             debug = 1;
             break;
         case 'f':
             filename = optarg;
             break;
-        case 'h':
-            help("create");
-            return 0;
-        default:
-            fprintf(stderr, "option `%c' not supported.\n", optopt);
-            break;
         }
     }
 
@@ -4191,7 +4168,7 @@ int main_button_press(int argc, char **a
     fprintf(stderr, "WARNING: \"button-press\" is deprecated. "
             "Please use \"trigger\"\n");
 
-    if ((opt = def_getopt(argc, argv, "", "button-press", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "button-press", 2)) != -1)
         return opt;
 
     button_press(find_domain(argv[optind]), argv[optind + 1]);
@@ -4332,7 +4309,7 @@ int main_vcpulist(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "cpu-list", 0)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "cpu-list", 0)) != -1)
         return opt;
 
     vcpulist(argc - optind, argv + optind);
@@ -4393,7 +4370,7 @@ int main_vcpupin(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "vcpu-pin", 3)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "vcpu-pin", 3)) != -1)
         return opt;
 
     vcpupin(find_domain(argv[optind]), argv[optind+1] , argv[optind+2]);
@@ -4429,7 +4406,7 @@ int main_vcpuset(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "vcpu-set", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "vcpu-set", 2)) != -1)
         return opt;
 
     vcpuset(find_domain(argv[optind]), argv[optind+1]);
@@ -4605,25 +4582,20 @@ static void print_info(int numa)
 int main_info(int argc, char **argv)
 {
     int opt;
-    int option_index = 0;
-    static struct option long_options[] = {
-        {"help", 0, 0, 'h'},
+    static struct option opts[] = {
         {"numa", 0, 0, 'n'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
     int numa = 0;
 
-    while ((opt = getopt_long(argc, argv, "hn", long_options, &option_index)) != -1) {
+    while ((opt = def_getopt(argc, argv, "hn", opts, "info", 0)) != -1) {
         switch (opt) {
-        case 'h':
-            help("info");
-            return 0;
+        case 0: case 2:
+            return opt;
         case 'n':
             numa = 1;
             break;
-        default:
-            fprintf(stderr, "option `%c' not supported.\n", optopt);
-            break;
         }
     }
 
@@ -4658,7 +4630,7 @@ int main_sharing(int argc, char **argv)
     libxl_dominfo *info, *info_free = NULL;
     int nb_domain, rc;
 
-    if ((opt = def_getopt(argc, argv, "", "sharing", 0)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "sharing", 0)) != -1)
         return opt;
 
     if (optind >= argc) {
@@ -4927,8 +4899,7 @@ int main_sched_credit(int argc, char **a
     int opt_s = 0;
     int tslice = 0, opt_t = 0, ratelimit = 0, opt_r = 0;
     int opt, rc;
-    int option_index = 0;
-    static struct option long_options[] = {
+    static struct option opts[] = {
         {"domain", 1, 0, 'd'},
         {"weight", 1, 0, 'w'},
         {"cap", 1, 0, 'c'},
@@ -4936,15 +4907,11 @@ int main_sched_credit(int argc, char **a
         {"tslice_ms", 1, 0, 't'},
         {"ratelimit_us", 1, 0, 'r'},
         {"cpupool", 1, 0, 'p'},
-        {"help", 0, 0, 'h'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
 
-    while (1) {
-        opt = getopt_long(argc, argv, "d:w:c:p:t:r:hs", long_options,
-                          &option_index);
-        if (opt == -1)
-            break;
+    while ((opt = def_getopt(argc, argv, "d:w:c:p:t:r:hs", opts, "sched-credit", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -4973,9 +4940,6 @@ int main_sched_credit(int argc, char **a
         case 'p':
             cpupool = optarg;
             break;
-        case 'h':
-            help("sched-credit");
-            return 0;
         }
     }
 
@@ -5058,19 +5022,15 @@ int main_sched_credit2(int argc, char **
     const char *cpupool = NULL;
     int weight = 256, opt_w = 0;
     int opt, rc;
-    int option_index = 0;
-    static struct option long_options[] = {
+    static struct option opts[] = {
         {"domain", 1, 0, 'd'},
         {"weight", 1, 0, 'w'},
         {"cpupool", 1, 0, 'p'},
-        {"help", 0, 0, 'h'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
 
-    while (1) {
-        opt = getopt_long(argc, argv, "d:w:p:h", long_options, &option_index);
-        if (opt == -1)
-            break;
+    while ((opt = def_getopt(argc, argv, "d:w:p:h", opts, "sched-credit2", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -5084,9 +5044,6 @@ int main_sched_credit2(int argc, char **
         case 'p':
             cpupool = optarg;
             break;
-        case 'h':
-            help("sched-credit");
-            return 0;
         }
     }
 
@@ -5137,23 +5094,18 @@ int main_sched_sedf(int argc, char **arg
     int extra = 0, opt_e = 0;
     int weight = 0, opt_w = 0;
     int opt, rc;
-    int option_index = 0;
-    static struct option long_options[] = {
+    static struct option opts[] = {
         {"period", 1, 0, 'p'},
         {"slice", 1, 0, 's'},
         {"latency", 1, 0, 'l'},
         {"extra", 1, 0, 'e'},
         {"weight", 1, 0, 'w'},
         {"cpupool", 1, 0, 'c'},
-        {"help", 0, 0, 'h'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
 
-    while (1) {
-        opt = getopt_long(argc, argv, "d:p:s:l:e:w:c:h", long_options,
-                          &option_index);
-        if (opt == -1)
-            break;
+    while ((opt = def_getopt(argc, argv, "d:p:s:l:e:w:c:h", opts, "sched-sedf", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -5183,9 +5135,6 @@ int main_sched_sedf(int argc, char **arg
         case 'c':
             cpupool = optarg;
             break;
-        case 'h':
-            help("sched-sedf");
-            return 0;
         }
     }
 
@@ -5253,7 +5202,7 @@ int main_domid(int argc, char **argv)
     int opt;
     const char *domname = NULL;
 
-    if ((opt = def_getopt(argc, argv, "", "domid", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "domid", 1)) != -1)
         return opt;
 
     domname = argv[optind];
@@ -5275,7 +5224,7 @@ int main_domname(int argc, char **argv)
     char *domname = NULL;
     char *endptr = NULL;
 
-    if ((opt = def_getopt(argc, argv, "", "domname", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "domname", 1)) != -1)
         return opt;
 
     domid = strtol(argv[optind], &endptr, 10);
@@ -5303,7 +5252,7 @@ int main_rename(int argc, char **argv)
     int opt;
     const char *dom, *new_name;
 
-    if ((opt = def_getopt(argc, argv, "", "rename", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "rename", 2)) != -1)
         return opt;
 
     dom = argv[optind++];
@@ -5327,7 +5276,7 @@ int main_trigger(int argc, char **argv)
     const char *trigger_name = NULL;
     libxl_trigger trigger;
 
-    if ((opt = def_getopt(argc, argv, "", "trigger", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "trigger", 2)) != -1)
         return opt;
 
     domid = find_domain(argv[optind++]);
@@ -5357,7 +5306,7 @@ int main_sysrq(int argc, char **argv)
     int opt;
     const char *sysrq = NULL;
 
-    if ((opt = def_getopt(argc, argv, "", "sysrq", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "sysrq", 2)) != -1)
         return opt;
 
     domid = find_domain(argv[optind++]);
@@ -5380,7 +5329,7 @@ int main_debug_keys(int argc, char **arg
     int opt;
     char *keys;
 
-    if ((opt = def_getopt(argc, argv, "", "debug-keys", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "debug-keys", 1)) != -1)
         return opt;
 
     keys = argv[optind];
@@ -5400,7 +5349,7 @@ int main_dmesg(int argc, char **argv)
     char *line;
     int opt, ret = 1;
 
-    while ((opt = def_getopt(argc, argv, "c", "dmesg", 0)) != -1) {
+    while ((opt = def_getopt(argc, argv, "c", NULL, "dmesg", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -5426,7 +5375,7 @@ int main_top(int argc, char **argv)
 {
     int opt;
 
-    if ((opt = def_getopt(argc, argv, "", "top", 0)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "top", 0)) != -1)
         return opt;
 
     return system("xentop");
@@ -5443,7 +5392,7 @@ int main_networkattach(int argc, char **
     int i;
     unsigned int val;
 
-    if ((opt = def_getopt(argc, argv, "", "network-attach", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "network-attach", 1)) != -1)
         return opt;
 
     if (argc-optind > 11) {
@@ -5530,7 +5479,7 @@ int main_networklist(int argc, char **ar
     libxl_nicinfo nicinfo;
     int nb, i;
 
-    if ((opt = def_getopt(argc, argv, "", "network-list", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "network-list", 1)) != -1)
         return opt;
 
     /*      Idx  BE   MAC   Hdl  Sta  evch txr/rxr  BE-path */
@@ -5567,7 +5516,7 @@ int main_networkdetach(int argc, char **
     int opt;
     libxl_device_nic nic;
 
-    if ((opt = def_getopt(argc, argv, "", "network-detach", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "network-detach", 2)) != -1)
         return opt;
 
     domid = find_domain(argv[optind]);
@@ -5598,7 +5547,7 @@ int main_blockattach(int argc, char **ar
     libxl_device_disk disk = { 0 };
     XLU_Config *config = 0;
 
-    if ((opt = def_getopt(argc, argv, "", "block-attach", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "block-attach", 2)) != -1)
         return opt;
 
     if (domain_qualifier_to_domid(argv[optind], &fe_domid, 0) < 0) {
@@ -5633,7 +5582,7 @@ int main_blocklist(int argc, char **argv
     libxl_device_disk *disks;
     libxl_diskinfo diskinfo;
 
-    if ((opt = def_getopt(argc, argv, "", "block-list", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "block-list", 1)) != -1)
         return opt;
 
     printf("%-5s %-3s %-6s %-5s %-6s %-8s %-30s\n",
@@ -5669,7 +5618,7 @@ int main_blockdetach(int argc, char **ar
     int opt, rc = 0;
     libxl_device_disk disk;
 
-    if ((opt = def_getopt(argc, argv, "", "block-detach", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "block-detach", 2)) != -1)
         return opt;
 
     domid = find_domain(argv[optind]);
@@ -5694,7 +5643,7 @@ int main_vtpmattach(int argc, char **arg
     unsigned int val;
     uint32_t domid;
 
-    if ((opt = def_getopt(argc, argv, "", "vtpm-attach", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "vtpm-attach", 1)) != -1)
         return opt;
 
     if (domain_qualifier_to_domid(argv[optind], &domid, 0) < 0) {
@@ -5747,7 +5696,7 @@ int main_vtpmlist(int argc, char **argv)
     libxl_vtpminfo vtpminfo;
     int nb, i;
 
-    if ((opt = def_getopt(argc, argv, "", "vtpm-list", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "vtpm-list", 1)) != -1)
         return opt;
 
     /*      Idx  BE   UUID   Hdl  Sta  evch rref  BE-path */
@@ -5787,7 +5736,7 @@ int main_vtpmdetach(int argc, char **arg
     libxl_device_vtpm vtpm;
     libxl_uuid uuid;
 
-    if ((opt = def_getopt(argc, argv, "", "vtpm-detach", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "vtpm-detach", 2)) != -1)
         return opt;
 
     domid = find_domain(argv[optind]);
@@ -5979,7 +5928,7 @@ int main_uptime(int argc, char **argv)
     int nb_doms = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "s", "uptime", 1)) != -1) {
+    while ((opt = def_getopt(argc, argv, "s", NULL, "uptime", 1)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -6006,7 +5955,7 @@ int main_tmem_list(int argc, char **argv
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "al", "tmem-list", 0)) != -1) {
+    while ((opt = def_getopt(argc, argv, "al", NULL, "tmem-list", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -6047,7 +5996,7 @@ int main_tmem_freeze(int argc, char **ar
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "a", "tmem-freeze", 0)) != -1) {
+    while ((opt = def_getopt(argc, argv, "a", NULL, "tmem-freeze", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -6080,7 +6029,7 @@ int main_tmem_thaw(int argc, char **argv
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "a", "tmem-thaw", 0)) != -1) {
+    while ((opt = def_getopt(argc, argv, "a", NULL, "tmem-thaw", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -6115,7 +6064,7 @@ int main_tmem_set(int argc, char **argv)
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "aw:c:p:", "tmem-set", 0)) != -1) {
+    while ((opt = def_getopt(argc, argv, "aw:c:p:", NULL, "tmem-set", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -6176,7 +6125,7 @@ int main_tmem_shared_auth(int argc, char
     int all = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "au:A:", "tmem-shared-auth", 0)) != -1) {
+    while ((opt = def_getopt(argc, argv, "au:A:", NULL, "tmem-shared-auth", 0)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -6226,7 +6175,7 @@ int main_tmem_freeable(int argc, char **
     int opt;
     int mb;
 
-    if ((opt = def_getopt(argc, argv, "", "tmem-freeable", 0)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "tmem-freeable", 0)) != -1)
         return opt;
 
     mb = libxl_tmem_freeable(ctx);
@@ -6243,11 +6192,10 @@ int main_cpupoolcreate(int argc, char **
     const char *p;
     char extra_config[1024];
     int opt;
-    int option_index = 0;
-    static struct option long_options[] = {
-        {"help", 0, 0, 'h'},
+    static struct option opts[] = {
         {"defconfig", 1, 0, 'f'},
         {"dryrun", 0, 0, 'n'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
     int ret;
@@ -6265,26 +6213,18 @@ int main_cpupoolcreate(int argc, char **
     libxl_bitmap cpumap;
     libxl_uuid uuid;
     libxl_cputopology *topology;
-    int rc = -ERROR_FAIL; 
-
-    while (1) {
-        opt = getopt_long(argc, argv, "hnf:", long_options, &option_index);
-        if (opt == -1)
-            break;
-
+    int rc = -ERROR_FAIL;
+
+    while ((opt = def_getopt(argc, argv, "hnf:", opts, "cpupool-create", 0)) != -1) {
         switch (opt) {
+        case 0: case 2:
+            return opt;
         case 'f':
             filename = optarg;
             break;
-        case 'h':
-            help("cpupool-create");
-            return 0;
         case 'n':
             dryrun_only = 1;
             break;
-        default:
-            fprintf(stderr, "option `%c' not supported.\n", optopt);
-            break;
         }
     }
 
@@ -6447,10 +6387,9 @@ out:
 int main_cpupoollist(int argc, char **argv)
 {
     int opt;
-    int option_index = 0;
-    static struct option long_options[] = {
-        {"help", 0, 0, 'h'},
+    static struct option opts[] = {
         {"cpus", 0, 0, 'c'},
+        COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
     int opt_cpus = 0;
@@ -6461,28 +6400,16 @@ int main_cpupoollist(int argc, char **ar
     char *name;
     int ret = 0;
 
-    while (1) {
-        opt = getopt_long(argc, argv, "hc", long_options, &option_index);
-        if (opt == -1)
+    while ((opt = def_getopt(argc, argv, "hc", opts, "cpupool-list", 1)) != -1) {
+        switch (opt) {
+        case 0: case 2:
             break;
-
-        switch (opt) {
-        case 'h':
-            help("cpupool-list");
-            return 0;
         case 'c':
             opt_cpus = 1;
             break;
-        default:
-            fprintf(stderr, "option `%c' not supported.\n", optopt);
-            break;
-        }
-    }
-
-    if ((optind + 1) < argc) {
-        help("cpupool-list");
-        return -ERROR_FAIL;
-    }
+        }
+    }
+
     if (optind < argc) {
         pool = argv[optind];
         if (libxl_name_to_cpupoolid(ctx, pool, &poolid)) {
@@ -6540,7 +6467,7 @@ int main_cpupooldestroy(int argc, char *
     const char *pool;
     uint32_t poolid;
 
-    if ((opt = def_getopt(argc, argv, "", "cpupool-destroy", 1)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-destroy", 1)) != -1)
         return opt;
 
     pool = argv[optind];
@@ -6561,7 +6488,7 @@ int main_cpupoolrename(int argc, char **
     const char *new_name;
     uint32_t poolid;
 
-    if ((opt = def_getopt(argc, argv, "", "cpupool-rename", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-rename", 2)) != -1)
         return opt;
 
     pool = argv[optind++];
@@ -6591,7 +6518,7 @@ int main_cpupoolcpuadd(int argc, char **
     int node;
     int n;
 
-    if ((opt = def_getopt(argc, argv, "", "cpupool-cpu-add", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-cpu-add", 2)) != -1)
         return opt;
 
     pool = argv[optind++];
@@ -6635,7 +6562,7 @@ int main_cpupoolcpuremove(int argc, char
     int node;
     int n;
 
-    if ((opt = def_getopt(argc, argv, "", "cpupool-cpu-remove", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-cpu-remove", 2)) != -1)
         return opt;
 
     pool = argv[optind++];
@@ -6678,7 +6605,7 @@ int main_cpupoolmigrate(int argc, char *
     const char *dom;
     uint32_t domid;
 
-    if ((opt = def_getopt(argc, argv, "", "cpupool-migrate", 2)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-migrate", 2)) != -1)
         return opt;
 
     dom = argv[optind++];
@@ -6718,7 +6645,7 @@ int main_cpupoolnumasplit(int argc, char
     libxl_cputopology *topology;
     libxl_dominfo info;
 
-    if ((opt = def_getopt(argc, argv, "", "cpupool-numa-split", 0)) != -1)
+    if ((opt = def_getopt(argc, argv, "", NULL, "cpupool-numa-split", 0)) != -1)
         return opt;
     ret = 0;
 
@@ -6971,7 +6898,7 @@ int main_remus(int argc, char **argv)
     r_info.blackhole = 0;
     r_info.compression = 1;
 
-    while ((opt = def_getopt(argc, argv, "bui:s:e", "remus", 2)) != -1) {
+    while ((opt = def_getopt(argc, argv, "bui:s:e", NULL, "remus", 2)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:22:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:22:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOfr-0005Vj-9b; Fri, 30 Nov 2012 11:22:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeOfp-0005VK-V1
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:22:26 +0000
Received: from [85.158.143.99:53499] by server-3.bemta-4.messagelabs.com id
	8D/E9-06841-1F698B05; Fri, 30 Nov 2012 11:22:25 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1354274543!17863991!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12762 invoked from network); 30 Nov 2012 11:22:24 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 11:22:24 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 11:22:23 +0000
Message-Id: <50B8A53702000078000ACD99@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 11:23:19 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "George Dunlap" <dunlapg@umich.edu>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B63CCC02000078000AC34E@nat28.tlf.novell.com>
	<50B8981802000078000ACCFE@nat28.tlf.novell.com>
	<CAFLBxZYKtq5-dfbXucB8Uf0zFoMC91hAxcNdWd_FA-7-Bc-hMg@mail.gmail.com>
In-Reply-To: <CAFLBxZYKtq5-dfbXucB8Uf0zFoMC91hAxcNdWd_FA-7-Bc-hMg@mail.gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 11:56, George Dunlap <dunlapg@umich.edu> wrote:
> On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich <JBeulich@suse.com> wrote:
> 
>>
>> So I learned a little more meanwhile - it's not that trivial: I'm told
>> the shim uses UEFI services to do the verification, and those
>> services only handle PE images. But we obviously can't reasonably
>> expect the Dom0 kernel to be packaged as PE image, as that
>> would then be unusable as DomU kernel (on older hosts at least,
>> i.e. even if we added a PE loader to libxc).
>>
> 
> But what does the shim use to check the signature of Xen in this case?
> Does Xen / native Linux need to be a PE image to boot from the shim?

Yes - xen.efi just needs to get a signature implanted for that
part to work, and native Linux uses the EFI_STUB mechanism
to gets its binary into said format (which then also only needs a
signature added).

>  If
> not, wouldn't the native PE image suffice?  And if so, why can't the shim
> check signatures the same way it checks the sig for the thing it's booting?

The checking code only knows to locate signatures inside PE
images. Consequently, whatever you want to pass to that code
needs to look like one. xen.efi and native Linux with EFI_STUB
enabled already do, but if you handed such a kernel binary to
either of the two PV domain kernel loaders Xen has, they would
just bail.

But - now that I checked what I was told, I can't see the EFI_STUB
config option to result in a PE binary to be created. So I'm back to
square 1...

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:22:33 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:22:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOfr-0005Vj-9b; Fri, 30 Nov 2012 11:22:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeOfp-0005VK-V1
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:22:26 +0000
Received: from [85.158.143.99:53499] by server-3.bemta-4.messagelabs.com id
	8D/E9-06841-1F698B05; Fri, 30 Nov 2012 11:22:25 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1354274543!17863991!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12762 invoked from network); 30 Nov 2012 11:22:24 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-14.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 11:22:24 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 11:22:23 +0000
Message-Id: <50B8A53702000078000ACD99@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 11:23:19 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "George Dunlap" <dunlapg@umich.edu>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B63CCC02000078000AC34E@nat28.tlf.novell.com>
	<50B8981802000078000ACCFE@nat28.tlf.novell.com>
	<CAFLBxZYKtq5-dfbXucB8Uf0zFoMC91hAxcNdWd_FA-7-Bc-hMg@mail.gmail.com>
In-Reply-To: <CAFLBxZYKtq5-dfbXucB8Uf0zFoMC91hAxcNdWd_FA-7-Bc-hMg@mail.gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 11:56, George Dunlap <dunlapg@umich.edu> wrote:
> On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich <JBeulich@suse.com> wrote:
> 
>>
>> So I learned a little more meanwhile - it's not that trivial: I'm told
>> the shim uses UEFI services to do the verification, and those
>> services only handle PE images. But we obviously can't reasonably
>> expect the Dom0 kernel to be packaged as PE image, as that
>> would then be unusable as DomU kernel (on older hosts at least,
>> i.e. even if we added a PE loader to libxc).
>>
> 
> But what does the shim use to check the signature of Xen in this case?
> Does Xen / native Linux need to be a PE image to boot from the shim?

Yes - xen.efi just needs to get a signature implanted for that
part to work, and native Linux uses the EFI_STUB mechanism
to gets its binary into said format (which then also only needs a
signature added).

>  If
> not, wouldn't the native PE image suffice?  And if so, why can't the shim
> check signatures the same way it checks the sig for the thing it's booting?

The checking code only knows to locate signatures inside PE
images. Consequently, whatever you want to pass to that code
needs to look like one. xen.efi and native Linux with EFI_STUB
enabled already do, but if you handed such a kernel binary to
either of the two PV domain kernel loaders Xen has, they would
just bail.

But - now that I checked what I was told, I can't see the EFI_STUB
config option to result in a PE binary to be created. So I'm back to
square 1...

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:26:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:26:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOjN-00063t-Vb; Fri, 30 Nov 2012 11:26:05 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeOjM-00063g-IZ
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:26:04 +0000
Received: from [85.158.143.99:20044] by server-1.bemta-4.messagelabs.com id
	8C/98-27934-BC798B05; Fri, 30 Nov 2012 11:26:03 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1354274738!26930037!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1770 invoked from network); 30 Nov 2012 11:25:38 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 11:25:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 11:25:38 +0000
Message-Id: <50B8A5F902000078000ACDC6@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 11:26:33 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "George Dunlap" <dunlapg@umich.edu>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B63CCC02000078000AC34E@nat28.tlf.novell.com>
	<50B8981802000078000ACCFE@nat28.tlf.novell.com>
	<CAFLBxZYKtq5-dfbXucB8Uf0zFoMC91hAxcNdWd_FA-7-Bc-hMg@mail.gmail.com>
	<50B8A53702000078000ACD99@nat28.tlf.novell.com>
In-Reply-To: <50B8A53702000078000ACD99@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 12:23, "Jan Beulich" <JBeulich@suse.com> wrote:
> But - now that I checked what I was told, I can't see the EFI_STUB
> config option to result in a PE binary to be created. So I'm back to
> square 1...

Wait - I looked at the wrong file, it _is_ a PE binary that results.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:26:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:26:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOjN-00063t-Vb; Fri, 30 Nov 2012 11:26:05 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TeOjM-00063g-IZ
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:26:04 +0000
Received: from [85.158.143.99:20044] by server-1.bemta-4.messagelabs.com id
	8C/98-27934-BC798B05; Fri, 30 Nov 2012 11:26:03 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1354274738!26930037!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1770 invoked from network); 30 Nov 2012 11:25:38 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-3.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 11:25:38 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 11:25:38 +0000
Message-Id: <50B8A5F902000078000ACDC6@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 11:26:33 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "George Dunlap" <dunlapg@umich.edu>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B63CCC02000078000AC34E@nat28.tlf.novell.com>
	<50B8981802000078000ACCFE@nat28.tlf.novell.com>
	<CAFLBxZYKtq5-dfbXucB8Uf0zFoMC91hAxcNdWd_FA-7-Bc-hMg@mail.gmail.com>
	<50B8A53702000078000ACD99@nat28.tlf.novell.com>
In-Reply-To: <50B8A53702000078000ACD99@nat28.tlf.novell.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 12:23, "Jan Beulich" <JBeulich@suse.com> wrote:
> But - now that I checked what I was told, I can't see the EFI_STUB
> config option to result in a PE binary to be created. So I'm back to
> square 1...

Wait - I looked at the wrong file, it _is_ a PE binary that results.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:27:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:27:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOkH-0006AE-Ui; Fri, 30 Nov 2012 11:27:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TeOkF-00069y-Ro
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 11:27:00 +0000
Received: from [85.158.139.211:6071] by server-11.bemta-5.messagelabs.com id
	B9/E0-03409-30898B05; Fri, 30 Nov 2012 11:26:59 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1354274788!18398297!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22964 invoked from network); 30 Nov 2012 11:26:29 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:26:29 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="215987478"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	30 Nov 2012 11:26:27 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL03.citrite.net
	(10.13.107.80) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 30 Nov 2012 06:26:27 -0500
Message-ID: <50B897E1.70306@citrix.com>
Date: Fri, 30 Nov 2012 11:26:25 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
In-Reply-To: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
X-Originating-IP: [10.80.2.76]
Cc: Anthony.Perard@citrix.com, xen-devel@lists.xensource.com,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 23/11/12 15:21, Stefano Stabellini wrote:
> Get the address of the GIC distributor, cpu, virtual and virtual cpu
> interfaces registers from device tree.

The original intention of the early DTB parsing was to get the minimum
of info needed before the DTB could be translated into a more useful
form (similar to what Linux does).

Is this something that is still being considered in the long term?  If
so, should the GIC be initialized from this translated form, instead of
using the early parsing?

David


> 
> 
> Note: I couldn't completely get rid of GIC_BASE_ADDRESS, GIC_DR_OFFSET
> and friends because we are using them from mode_switch.S, that is
> executed before device tree has been parsed. But at least mode_switch.S
> is known to contain vexpress specific code anyway.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
[...]
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index da0af77..79b1dd1 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -54,6 +54,27 @@ bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
>      return !strncmp(prop, match, len);
>  }
>  
> +bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)
> +{
> +    int len, l;
> +    const void *prop;
> +
> +    prop = fdt_getprop(fdt, node, "compatible", &len);
> +    if ( prop == NULL )
> +        return 0;
> +
> +    while ( len > 0 ) {
> +        if ( !strncmp(prop, match, strlen(match)) )
> +            return 1;
> +        l = strlen(prop) + 1;
> +        prop += l;
> +        len -= l;
> +    }

This doesn't look right.  Don't you need to split the prop string on
comma boundaries?

> +
> +    return 0;
> +}
> +
> +
>  static void __init get_val(const u32 **cell, u32 cells, u64 *val)
>  {
>      *val = 0;
> @@ -270,6 +291,50 @@ static void __init process_cpu_node(const void *fdt, int node,
>      cpumask_set_cpu(start, &cpu_possible_map);
>  }
>  
> +static void __init process_gic_node(const void *fdt, int node,
> +                                    const char *name,
> +                                    u32 address_cells, u32 size_cells)
> +{
> +    const struct fdt_property *prop;
> +    const u32 *cell;
> +    paddr_t start, size;
> +    int reg_cells, interfaces;
> +
> +    if ( address_cells < 1 || size_cells < 1 )
> +    {
> +        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
> +                     name);
> +        return;
> +    }
> +
> +    prop = fdt_get_property(fdt, node, "reg", NULL);
> +    if ( !prop )
> +    {
> +        early_printk("fdt: node `%s': missing `reg' property\n", name);
> +        return;
> +    }
> +
> +    cell = (const u32 *)prop->data;
> +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);

Is this needed?  This cell is reread below.

> +
> +    cell = (const u32 *)prop->data;
> +    reg_cells = address_cells + size_cells;
> +    interfaces = fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32));

Perhaps wrap this in a helper function?  Look like it might be useful
elsewhere.

> +    if ( interfaces < 4 )
> +    {
> +        early_printk("fdt: node `%s': invalid `reg' property\n", name);
> +        return;
> +    }
> +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> +    early_info.gic.gic_dist_addr = start;
> +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> +    early_info.gic.gic_cpu_addr = start;
> +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> +    early_info.gic.gic_hyp_addr = start;
> +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> +    early_info.gic.gic_vcpu_addr = start;

Is the GIC driver still hardcoding the register region sizes?  Or does
it not need the size?

> +}
> +
>  static int __init early_scan_node(const void *fdt,
>                                    int node, const char *name, int depth,
>                                    u32 address_cells, u32 size_cells,
> @@ -279,6 +344,8 @@ static int __init early_scan_node(const void *fdt,
>          process_memory_node(fdt, node, name, address_cells, size_cells);
>      else if ( device_tree_type_matches(fdt, node, "cpu") )
>          process_cpu_node(fdt, node, name, address_cells, size_cells);
> +    else if ( device_tree_node_compatible(fdt, node, "arm,cortex-a15-gic") )
> +        process_gic_node(fdt, node, name, address_cells, size_cells);

Long term, I don't think you want a long list of all the different
interrupt controllers here.

David

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:27:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:27:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOkH-0006AE-Ui; Fri, 30 Nov 2012 11:27:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TeOkF-00069y-Ro
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 11:27:00 +0000
Received: from [85.158.139.211:6071] by server-11.bemta-5.messagelabs.com id
	B9/E0-03409-30898B05; Fri, 30 Nov 2012 11:26:59 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1354274788!18398297!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22964 invoked from network); 30 Nov 2012 11:26:29 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:26:29 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="215987478"
Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	30 Nov 2012 11:26:27 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL03.citrite.net
	(10.13.107.80) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 30 Nov 2012 06:26:27 -0500
Message-ID: <50B897E1.70306@citrix.com>
Date: Fri, 30 Nov 2012 11:26:25 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
In-Reply-To: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
X-Originating-IP: [10.80.2.76]
Cc: Anthony.Perard@citrix.com, xen-devel@lists.xensource.com,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 23/11/12 15:21, Stefano Stabellini wrote:
> Get the address of the GIC distributor, cpu, virtual and virtual cpu
> interfaces registers from device tree.

The original intention of the early DTB parsing was to get the minimum
of info needed before the DTB could be translated into a more useful
form (similar to what Linux does).

Is this something that is still being considered in the long term?  If
so, should the GIC be initialized from this translated form, instead of
using the early parsing?

David


> 
> 
> Note: I couldn't completely get rid of GIC_BASE_ADDRESS, GIC_DR_OFFSET
> and friends because we are using them from mode_switch.S, that is
> executed before device tree has been parsed. But at least mode_switch.S
> is known to contain vexpress specific code anyway.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
[...]
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index da0af77..79b1dd1 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -54,6 +54,27 @@ bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
>      return !strncmp(prop, match, len);
>  }
>  
> +bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)
> +{
> +    int len, l;
> +    const void *prop;
> +
> +    prop = fdt_getprop(fdt, node, "compatible", &len);
> +    if ( prop == NULL )
> +        return 0;
> +
> +    while ( len > 0 ) {
> +        if ( !strncmp(prop, match, strlen(match)) )
> +            return 1;
> +        l = strlen(prop) + 1;
> +        prop += l;
> +        len -= l;
> +    }

This doesn't look right.  Don't you need to split the prop string on
comma boundaries?

> +
> +    return 0;
> +}
> +
> +
>  static void __init get_val(const u32 **cell, u32 cells, u64 *val)
>  {
>      *val = 0;
> @@ -270,6 +291,50 @@ static void __init process_cpu_node(const void *fdt, int node,
>      cpumask_set_cpu(start, &cpu_possible_map);
>  }
>  
> +static void __init process_gic_node(const void *fdt, int node,
> +                                    const char *name,
> +                                    u32 address_cells, u32 size_cells)
> +{
> +    const struct fdt_property *prop;
> +    const u32 *cell;
> +    paddr_t start, size;
> +    int reg_cells, interfaces;
> +
> +    if ( address_cells < 1 || size_cells < 1 )
> +    {
> +        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
> +                     name);
> +        return;
> +    }
> +
> +    prop = fdt_get_property(fdt, node, "reg", NULL);
> +    if ( !prop )
> +    {
> +        early_printk("fdt: node `%s': missing `reg' property\n", name);
> +        return;
> +    }
> +
> +    cell = (const u32 *)prop->data;
> +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);

Is this needed?  This cell is reread below.

> +
> +    cell = (const u32 *)prop->data;
> +    reg_cells = address_cells + size_cells;
> +    interfaces = fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32));

Perhaps wrap this in a helper function?  Look like it might be useful
elsewhere.

> +    if ( interfaces < 4 )
> +    {
> +        early_printk("fdt: node `%s': invalid `reg' property\n", name);
> +        return;
> +    }
> +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> +    early_info.gic.gic_dist_addr = start;
> +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> +    early_info.gic.gic_cpu_addr = start;
> +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> +    early_info.gic.gic_hyp_addr = start;
> +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> +    early_info.gic.gic_vcpu_addr = start;

Is the GIC driver still hardcoding the register region sizes?  Or does
it not need the size?

> +}
> +
>  static int __init early_scan_node(const void *fdt,
>                                    int node, const char *name, int depth,
>                                    u32 address_cells, u32 size_cells,
> @@ -279,6 +344,8 @@ static int __init early_scan_node(const void *fdt,
>          process_memory_node(fdt, node, name, address_cells, size_cells);
>      else if ( device_tree_type_matches(fdt, node, "cpu") )
>          process_cpu_node(fdt, node, name, address_cells, size_cells);
> +    else if ( device_tree_node_compatible(fdt, node, "arm,cortex-a15-gic") )
> +        process_gic_node(fdt, node, name, address_cells, size_cells);

Long term, I don't think you want a long list of all the different
interrupt controllers here.

David

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:34:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:34:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOrj-0006fh-69; Fri, 30 Nov 2012 11:34:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TeOri-0006fa-2K
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:34:42 +0000
Received: from [193.109.254.147:47563] by server-3.bemta-14.messagelabs.com id
	E0/DC-01317-0D998B05; Fri, 30 Nov 2012 11:34:40 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1354275273!3249813!1
X-Originating-IP: [209.85.212.51]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_20_30,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5839 invoked from network); 30 Nov 2012 11:34:34 -0000
Received: from mail-vb0-f51.google.com (HELO mail-vb0-f51.google.com)
	(209.85.212.51)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:34:34 -0000
Received: by mail-vb0-f51.google.com with SMTP id fq11so11618901vbb.38
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 03:34:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=DO+aeWqG4My5+X6bv3HHvJCnpU8/yxsLpbhnM6ZTECY=;
	b=HFXWGcQUn1QJlkhCty9KsqsGPdO2SETQz5tQt0jje911jAQsFqWaEiUT4qHDU73uZZ
	KGT0SBW9wfWnUVdPLZrO4jZi4CWgJlqMvxTuyGxpuILoJZ5HJDFrHL21OPdUW9CaACxK
	6IX5E/0xj2I8FG2BiyJX1TZbYgnZVXfpNr0pNLlrFPUVRrG/sZBoWP6/EmnfDwP9NS90
	GM6zAVQQ0QU9gQhFy4g9LHdWlQU7Y4U3s9Bs3BHr9/evrlKVmV5jqXxGJxB0Kb+ds1I6
	ABFnZAeHaCILAdgGEjX74vG+thOqG0gXZBZtYSa9AsYTVaD2l/E32d8qk+G1YUtg9zz3
	L0YA==
MIME-Version: 1.0
Received: by 10.52.68.242 with SMTP id z18mr710670vdt.0.1354275272963; Fri, 30
	Nov 2012 03:34:32 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Fri, 30 Nov 2012 03:34:32 -0800 (PST)
In-Reply-To: <50B8A53702000078000ACD99@nat28.tlf.novell.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B63CCC02000078000AC34E@nat28.tlf.novell.com>
	<50B8981802000078000ACCFE@nat28.tlf.novell.com>
	<CAFLBxZYKtq5-dfbXucB8Uf0zFoMC91hAxcNdWd_FA-7-Bc-hMg@mail.gmail.com>
	<50B8A53702000078000ACD99@nat28.tlf.novell.com>
Date: Fri, 30 Nov 2012 11:34:32 +0000
X-Google-Sender-Auth: BjrDx2lgjRwDvVOt0lcI7P2_gNg
Message-ID: <CAFLBxZY8Wx56mSpV6KRfcO=GWmwtguv_6=kT5F3hJ4SieJENQg@mail.gmail.com>
From: George Dunlap <dunlapg@umich.edu>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1011263531188559677=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============1011263531188559677==
Content-Type: multipart/alternative; boundary=20cf3079bb9c92b54d04cfb4c8da

--20cf3079bb9c92b54d04cfb4c8da
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Nov 30, 2012 at 11:23 AM, Jan Beulich <JBeulich@suse.com> wrote:

> >>> On 30.11.12 at 11:56, George Dunlap <dunlapg@umich.edu> wrote:
> > On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich <JBeulich@suse.com> wrote:
> >
> >>
> >> So I learned a little more meanwhile - it's not that trivial: I'm told
> >> the shim uses UEFI services to do the verification, and those
> >> services only handle PE images. But we obviously can't reasonably
> >> expect the Dom0 kernel to be packaged as PE image, as that
> >> would then be unusable as DomU kernel (on older hosts at least,
> >> i.e. even if we added a PE loader to libxc).
> >>
> >
> > But what does the shim use to check the signature of Xen in this case?
> > Does Xen / native Linux need to be a PE image to boot from the shim?
>
> Yes - xen.efi just needs to get a signature implanted for that
> part to work, and native Linux uses the EFI_STUB mechanism
> to gets its binary into said format (which then also only needs a
> signature added).
>
> >  If
> > not, wouldn't the native PE image suffice?  And if so, why can't the shim
> > check signatures the same way it checks the sig for the thing it's
> booting?
>
> The checking code only knows to locate signatures inside PE
> images. Consequently, whatever you want to pass to that code
> needs to look like one. xen.efi and native Linux with EFI_STUB
> enabled already do, but if you handed such a kernel binary to
> either of the two PV domain kernel loaders Xen has, they would
> just bail.
>

OK... so Fedora and Ubuntu are going to be shipping signed kernel
binaries.  Are those binaries going to be in PE / EFI format then?  If so:
1. You won't need to do any fancy on-the-fly repackaging in Xen; you can
just pass the already-signed distro-supplied binary
2. The toolstack is simply going to have to be able to read PE kernels for
PV guests
3. If distros don't include non-PE kernels, we're going to have to backport
that functionality to older versions of Xen.

 -George

--20cf3079bb9c92b54d04cfb4c8da
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 30, 2012 at 11:23 AM, Jan Beulich <span dir=3D"ltr">&lt;<a href=
=3D"mailto:JBeulich@suse.com" target=3D"_blank">JBeulich@suse.com</a>&gt;</=
span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_quote"><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #cc=
c solid;padding-left:1ex">
<div class=3D"im">&gt;&gt;&gt; On 30.11.12 at 11:56, George Dunlap &lt;<a h=
ref=3D"mailto:dunlapg@umich.edu">dunlapg@umich.edu</a>&gt; wrote:<br>
&gt; On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich &lt;<a href=3D"mailto:JB=
eulich@suse.com">JBeulich@suse.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; So I learned a little more meanwhile - it&#39;s not that trivial: =
I&#39;m told<br>
&gt;&gt; the shim uses UEFI services to do the verification, and those<br>
&gt;&gt; services only handle PE images. But we obviously can&#39;t reasona=
bly<br>
&gt;&gt; expect the Dom0 kernel to be packaged as PE image, as that<br>
&gt;&gt; would then be unusable as DomU kernel (on older hosts at least,<br=
>
&gt;&gt; i.e. even if we added a PE loader to libxc).<br>
&gt;&gt;<br>
&gt;<br>
&gt; But what does the shim use to check the signature of Xen in this case?=
<br>
&gt; Does Xen / native Linux need to be a PE image to boot from the shim?<b=
r>
<br>
</div>Yes - xen.efi just needs to get a signature implanted for that<br>
part to work, and native Linux uses the EFI_STUB mechanism<br>
to gets its binary into said format (which then also only needs a<br>
signature added).<br>
<div class=3D"im"><br>
&gt; =A0If<br>
&gt; not, wouldn&#39;t the native PE image suffice? =A0And if so, why can&#=
39;t the shim<br>
&gt; check signatures the same way it checks the sig for the thing it&#39;s=
 booting?<br>
<br>
</div>The checking code only knows to locate signatures inside PE<br>
images. Consequently, whatever you want to pass to that code<br>
needs to look like one. xen.efi and native Linux with EFI_STUB<br>
enabled already do, but if you handed such a kernel binary to<br>
either of the two PV domain kernel loaders Xen has, they would<br>
just bail.<br></blockquote><br></div>OK... so Fedora and Ubuntu are going t=
o be shipping signed kernel binaries.=A0 Are those binaries going to be in =
PE / EFI format then?=A0 If so:<br>1. You won&#39;t need to do any fancy on=
-the-fly repackaging in Xen; you can just pass the already-signed distro-su=
pplied binary<br>
2. The toolstack is simply going to have to be able to read PE kernels for =
PV guests<br>3. If distros don&#39;t include non-PE kernels, we&#39;re goin=
g to have to backport that functionality to older versions of Xen.<br><br>
=A0-George<br><br></div>

--20cf3079bb9c92b54d04cfb4c8da--


--===============1011263531188559677==
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.xen.org
http://lists.xen.org/xen-devel

--===============1011263531188559677==--


From xen-devel-bounces@lists.xen.org Fri Nov 30 11:34:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:34:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOrj-0006fh-69; Fri, 30 Nov 2012 11:34:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TeOri-0006fa-2K
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:34:42 +0000
Received: from [193.109.254.147:47563] by server-3.bemta-14.messagelabs.com id
	E0/DC-01317-0D998B05; Fri, 30 Nov 2012 11:34:40 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1354275273!3249813!1
X-Originating-IP: [209.85.212.51]
X-SpamReason: No, hits=1.2 required=7.0 tests=HTML_20_30,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5839 invoked from network); 30 Nov 2012 11:34:34 -0000
Received: from mail-vb0-f51.google.com (HELO mail-vb0-f51.google.com)
	(209.85.212.51)
	by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:34:34 -0000
Received: by mail-vb0-f51.google.com with SMTP id fq11so11618901vbb.38
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 03:34:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=DO+aeWqG4My5+X6bv3HHvJCnpU8/yxsLpbhnM6ZTECY=;
	b=HFXWGcQUn1QJlkhCty9KsqsGPdO2SETQz5tQt0jje911jAQsFqWaEiUT4qHDU73uZZ
	KGT0SBW9wfWnUVdPLZrO4jZi4CWgJlqMvxTuyGxpuILoJZ5HJDFrHL21OPdUW9CaACxK
	6IX5E/0xj2I8FG2BiyJX1TZbYgnZVXfpNr0pNLlrFPUVRrG/sZBoWP6/EmnfDwP9NS90
	GM6zAVQQ0QU9gQhFy4g9LHdWlQU7Y4U3s9Bs3BHr9/evrlKVmV5jqXxGJxB0Kb+ds1I6
	ABFnZAeHaCILAdgGEjX74vG+thOqG0gXZBZtYSa9AsYTVaD2l/E32d8qk+G1YUtg9zz3
	L0YA==
MIME-Version: 1.0
Received: by 10.52.68.242 with SMTP id z18mr710670vdt.0.1354275272963; Fri, 30
	Nov 2012 03:34:32 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Fri, 30 Nov 2012 03:34:32 -0800 (PST)
In-Reply-To: <50B8A53702000078000ACD99@nat28.tlf.novell.com>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B63CCC02000078000AC34E@nat28.tlf.novell.com>
	<50B8981802000078000ACCFE@nat28.tlf.novell.com>
	<CAFLBxZYKtq5-dfbXucB8Uf0zFoMC91hAxcNdWd_FA-7-Bc-hMg@mail.gmail.com>
	<50B8A53702000078000ACD99@nat28.tlf.novell.com>
Date: Fri, 30 Nov 2012 11:34:32 +0000
X-Google-Sender-Auth: BjrDx2lgjRwDvVOt0lcI7P2_gNg
Message-ID: <CAFLBxZY8Wx56mSpV6KRfcO=GWmwtguv_6=kT5F3hJ4SieJENQg@mail.gmail.com>
From: George Dunlap <dunlapg@umich.edu>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1011263531188559677=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============1011263531188559677==
Content-Type: multipart/alternative; boundary=20cf3079bb9c92b54d04cfb4c8da

--20cf3079bb9c92b54d04cfb4c8da
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Nov 30, 2012 at 11:23 AM, Jan Beulich <JBeulich@suse.com> wrote:

> >>> On 30.11.12 at 11:56, George Dunlap <dunlapg@umich.edu> wrote:
> > On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich <JBeulich@suse.com> wrote:
> >
> >>
> >> So I learned a little more meanwhile - it's not that trivial: I'm told
> >> the shim uses UEFI services to do the verification, and those
> >> services only handle PE images. But we obviously can't reasonably
> >> expect the Dom0 kernel to be packaged as PE image, as that
> >> would then be unusable as DomU kernel (on older hosts at least,
> >> i.e. even if we added a PE loader to libxc).
> >>
> >
> > But what does the shim use to check the signature of Xen in this case?
> > Does Xen / native Linux need to be a PE image to boot from the shim?
>
> Yes - xen.efi just needs to get a signature implanted for that
> part to work, and native Linux uses the EFI_STUB mechanism
> to gets its binary into said format (which then also only needs a
> signature added).
>
> >  If
> > not, wouldn't the native PE image suffice?  And if so, why can't the shim
> > check signatures the same way it checks the sig for the thing it's
> booting?
>
> The checking code only knows to locate signatures inside PE
> images. Consequently, whatever you want to pass to that code
> needs to look like one. xen.efi and native Linux with EFI_STUB
> enabled already do, but if you handed such a kernel binary to
> either of the two PV domain kernel loaders Xen has, they would
> just bail.
>

OK... so Fedora and Ubuntu are going to be shipping signed kernel
binaries.  Are those binaries going to be in PE / EFI format then?  If so:
1. You won't need to do any fancy on-the-fly repackaging in Xen; you can
just pass the already-signed distro-supplied binary
2. The toolstack is simply going to have to be able to read PE kernels for
PV guests
3. If distros don't include non-PE kernels, we're going to have to backport
that functionality to older versions of Xen.

 -George

--20cf3079bb9c92b54d04cfb4c8da
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 30, 2012 at 11:23 AM, Jan Beulich <span dir=3D"ltr">&lt;<a href=
=3D"mailto:JBeulich@suse.com" target=3D"_blank">JBeulich@suse.com</a>&gt;</=
span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_quote"><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #cc=
c solid;padding-left:1ex">
<div class=3D"im">&gt;&gt;&gt; On 30.11.12 at 11:56, George Dunlap &lt;<a h=
ref=3D"mailto:dunlapg@umich.edu">dunlapg@umich.edu</a>&gt; wrote:<br>
&gt; On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich &lt;<a href=3D"mailto:JB=
eulich@suse.com">JBeulich@suse.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; So I learned a little more meanwhile - it&#39;s not that trivial: =
I&#39;m told<br>
&gt;&gt; the shim uses UEFI services to do the verification, and those<br>
&gt;&gt; services only handle PE images. But we obviously can&#39;t reasona=
bly<br>
&gt;&gt; expect the Dom0 kernel to be packaged as PE image, as that<br>
&gt;&gt; would then be unusable as DomU kernel (on older hosts at least,<br=
>
&gt;&gt; i.e. even if we added a PE loader to libxc).<br>
&gt;&gt;<br>
&gt;<br>
&gt; But what does the shim use to check the signature of Xen in this case?=
<br>
&gt; Does Xen / native Linux need to be a PE image to boot from the shim?<b=
r>
<br>
</div>Yes - xen.efi just needs to get a signature implanted for that<br>
part to work, and native Linux uses the EFI_STUB mechanism<br>
to gets its binary into said format (which then also only needs a<br>
signature added).<br>
<div class=3D"im"><br>
&gt; =A0If<br>
&gt; not, wouldn&#39;t the native PE image suffice? =A0And if so, why can&#=
39;t the shim<br>
&gt; check signatures the same way it checks the sig for the thing it&#39;s=
 booting?<br>
<br>
</div>The checking code only knows to locate signatures inside PE<br>
images. Consequently, whatever you want to pass to that code<br>
needs to look like one. xen.efi and native Linux with EFI_STUB<br>
enabled already do, but if you handed such a kernel binary to<br>
either of the two PV domain kernel loaders Xen has, they would<br>
just bail.<br></blockquote><br></div>OK... so Fedora and Ubuntu are going t=
o be shipping signed kernel binaries.=A0 Are those binaries going to be in =
PE / EFI format then?=A0 If so:<br>1. You won&#39;t need to do any fancy on=
-the-fly repackaging in Xen; you can just pass the already-signed distro-su=
pplied binary<br>
2. The toolstack is simply going to have to be able to read PE kernels for =
PV guests<br>3. If distros don&#39;t include non-PE kernels, we&#39;re goin=
g to have to backport that functionality to older versions of Xen.<br><br>
=A0-George<br><br></div>

--20cf3079bb9c92b54d04cfb4c8da--


--===============1011263531188559677==
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.xen.org
http://lists.xen.org/xen-devel

--===============1011263531188559677==--


From xen-devel-bounces@lists.xen.org Fri Nov 30 11:37:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:37:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOtv-0006xy-Rj; Fri, 30 Nov 2012 11:36:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TeOtu-0006xq-HQ
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:36:58 +0000
Received: from [193.109.254.147:22391] by server-2.bemta-14.messagelabs.com id
	63/17-20829-95A98B05; Fri, 30 Nov 2012 11:36:57 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-10.tower-27.messagelabs.com!1354275415!3744621!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDk4NDk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24863 invoked from network); 30 Nov 2012 11:36:56 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-10.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 30 Nov 2012 11:36:56 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 987B81A9A;
	Fri, 30 Nov 2012 13:36:55 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 7785FEC027; Fri, 30 Nov 2012 13:36:55 +0200 (EET)
Date: Fri, 30 Nov 2012 13:36:55 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Greg Zapp <greg.zapp@gmail.com>
Message-ID: <20121130113655.GP8912@reaktio.net>
References: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
	<20121129150736.GH8912@reaktio.net>
	<CAEHxbC1gG5RR9h9odxx59BZm2+SUdoGuwZc8Sco_yNtxVwod=Q@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CAEHxbC1gG5RR9h9odxx59BZm2+SUdoGuwZc8Sco_yNtxVwod=Q@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Enabling NLB is crashing VM's/DRBD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 11:11:11AM +1300, Greg Zapp wrote:
>    HI,
> 
>    We are running Debian's provided xen-hypervisor-4.0-amd64(4.0.
>    1-4).  The kernel is 2.6.32-5-xen-amd64(2.6.32-46) from Debian.
> 
>    The previously posted log lines were from the dom0's /var/log/messages.
>    The only thing I'm seeing form xm dmesg is the following:
>    (XEN) grant_table.c:1717:d0 Bad grant reference
> 
>    I've also picked up on some more entries from syslog that were not present
>    in messages.  Here is what's present in syslog.  Time seems to be sync'd
>    to the second on both machines:
>    Nov 28 10:55:03 nodeA kernel: [1239467.400293] eth0: port 11(nlb2.e0)
>    entering disabled state
>    Nov 28 10:55:03 nodeA kernel: [1239467.400516] eth0: port 11(nlb2.e0)
>    entering disabled state

How's your networking set up? 

I hope the the Windows NLB VMs aren't using the same bridge/VLAN as DRBD is using? 


-- Pasi


>    Nov 28 10:55:04 nodeA kernel: [1239467.731442] frontend_changed:
>    backend/vif/73/0: prepare for reconnect
>    Nov 28 10:55:04 nodeA logger: /etc/xen/scripts/vif-bridge: offline
>    XENBUS_PATH=backend/vif/73/0
>    Nov 28 10:55:05 nodeA logger: /etc/xen/scripts/vif-bridge: brctl delif
>    eth0 nlb2.e0 failed
>    Nov 28 10:55:05 nodeA logger: /etc/xen/scripts/vif-bridge: ifconfig
>    nlb2.e0 down failed
>    Nov 28 10:55:06 nodeA logger: /etc/xen/scripts/vif-bridge: Successful
>    vif-bridge offline for nlb2.e0, bridge eth0.
>    Nov 28 10:55:06 nodeA logger: /etc/xen/scripts/vif-bridge: online
>    XENBUS_PATH=backend/vif/73/0
>    Nov 28 10:55:08 nodeA kernel: [1239471.758583] device nlb2.e0 entered
>    promiscuous mode
>    Nov 28 10:55:10 nodeA kernel: [1239473.795967] block drbd23: sock was shut
>    down by peer
>    Nov 28 10:55:27 nodeA kernel: [1239473.795973] block drbd23: peer( Primary
>    -> Unknown ) conn( Connected -> BrokenPipe ) pdsk( UpToDate -> DUnknown )
>    Nov 28 10:55:27 nodeA kernel: [1239473.795980] block drbd23: short read
>    expecting header on sock: r=0
>    Nov 28 10:55:27 nodeA kernel: [1239474.009951] block drbd31: sock was shut
>    down by peer
> 
>    Nov 28 10:55:09 nodeB kernel: [1239622.217505] block drbd23: PingAck did
>    not arrive in time.
>    Nov 28 10:55:09 nodeB kernel: [1239622.217542] block drbd23: peer(
>    Secondary -> Unknown ) conn( Connected -> NetworkFailure ) pdsk( UpToDate
>    -> DUnknown )
>    Nov 28 10:55:09 nodeB kernel: [1239622.217551] block drbd23: asender
>    terminated
>    Nov 28 10:55:09 nodeB kernel: [1239622.217554] block drbd23: Terminating
>    drbd23_asender
>    Nov 28 10:55:09 nodeB kernel: [1239622.217795] block drbd23: short read
>    expecting header on sock: r=-512
>    Nov 28 10:55:09 nodeB kernel: [1239622.217887] block drbd23: Creating new
>    current UUID
>    Nov 28 10:55:09 nodeB kernel: [1239622.218118] block drbd23: Connection
>    closed
>    Nov 28 10:55:09 nodeB kernel: [1239622.218125] block drbd23: conn(
>    NetworkFailure -> Unconnected )
>    Nov 28 10:55:09 nodeB kernel: [1239622.218135] block drbd23: receiver
>    terminated
>    Nov 28 10:55:09 nodeB kernel: [1239622.218137] block drbd23: Restarting
>    drbd23_receiver
>    Nov 28 10:55:09 nodeB kernel: [1239622.218140] block drbd23: receiver
>    (re)started
>    Nov 28 10:55:09 nodeB kernel: [1239622.218143] block drbd23: conn(
>    Unconnected -> WFConnection )
>    Nov 28 10:55:09 nodeB kernel: [1239622.353589] block drbd30: PingAck did
>    not arrive in time.
>    Nov 28 10:55:09 nodeB kernel: [1239622.353627] block drbd30: peer(
>    Secondary -> Unknown ) conn( Connected -> NetworkFailure ) pdsk( UpToDate
>    -> DUnknown )
>    Nov 28 10:55:09 nodeB kernel: [1239622.353637] block drbd30: asender
>    terminated
>    Nov 28 10:55:09 nodeB kernel: [1239622.353639] block drbd30: Terminating
>    drbd30_asender
>    Nov 28 10:55:09 nodeB kernel: [1239622.353668] block drbd30: short read
>    expecting header on sock: r=-512
>    Nov 28 10:55:09 nodeB kernel: [1239622.353754] block drbd30: Creating new
>    current UUID
>    Nov 28 10:55:09 nodeB kernel: [1239622.388101] block drbd30: Connection
>    closed
>    Nov 28 10:55:09 nodeB kernel: [1239622.388107] block drbd30: conn(
>    NetworkFailure -> Unconnected )
>    Nov 28 10:55:09 nodeB kernel: [1239622.388111] block drbd30: receiver
>    terminated
>    Nov 28 10:55:09 nodeB kernel: [1239622.388113] block drbd30: Restarting
>    drbd30_receiver
>    Nov 28 10:55:09 nodeB kernel: [1239622.388116] block drbd30: receiver
>    (re)started
>    Nov 28 10:55:09 nodeB kernel: [1239622.388119] block drbd30: conn(
>    Unconnected -> WFConnection )
> 
>    I've also looked at the qemu, xend-hotplug, and xend logs and do not see
>    any telling errors.  In xend.log I just see lines pertaining to VM's being
>    rebooted.
> 
>    As for GPLPV.. I haven't been able to reproduce the "network crashing" and
>    rebooting in the lab and probably won't be able to until I can get a more
>    robust production-like environment setup.  Unfortunately I can't risk more
>    customer down time by attempting to setup NLB without the GPLPV drivers in
>    production.  If I can manage to reproduce this in staging I will of course
>    attempt without the GPLPV drivers.
> 
>    -Greg

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:37:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:37:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeOtv-0006xy-Rj; Fri, 30 Nov 2012 11:36:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TeOtu-0006xq-HQ
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:36:58 +0000
Received: from [193.109.254.147:22391] by server-2.bemta-14.messagelabs.com id
	63/17-20829-95A98B05; Fri, 30 Nov 2012 11:36:57 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-10.tower-27.messagelabs.com!1354275415!3744621!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDk4NDk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24863 invoked from network); 30 Nov 2012 11:36:56 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-10.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 30 Nov 2012 11:36:56 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 987B81A9A;
	Fri, 30 Nov 2012 13:36:55 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 7785FEC027; Fri, 30 Nov 2012 13:36:55 +0200 (EET)
Date: Fri, 30 Nov 2012 13:36:55 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Greg Zapp <greg.zapp@gmail.com>
Message-ID: <20121130113655.GP8912@reaktio.net>
References: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
	<20121129150736.GH8912@reaktio.net>
	<CAEHxbC1gG5RR9h9odxx59BZm2+SUdoGuwZc8Sco_yNtxVwod=Q@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CAEHxbC1gG5RR9h9odxx59BZm2+SUdoGuwZc8Sco_yNtxVwod=Q@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Enabling NLB is crashing VM's/DRBD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 11:11:11AM +1300, Greg Zapp wrote:
>    HI,
> 
>    We are running Debian's provided xen-hypervisor-4.0-amd64(4.0.
>    1-4).  The kernel is 2.6.32-5-xen-amd64(2.6.32-46) from Debian.
> 
>    The previously posted log lines were from the dom0's /var/log/messages.
>    The only thing I'm seeing form xm dmesg is the following:
>    (XEN) grant_table.c:1717:d0 Bad grant reference
> 
>    I've also picked up on some more entries from syslog that were not present
>    in messages.  Here is what's present in syslog.  Time seems to be sync'd
>    to the second on both machines:
>    Nov 28 10:55:03 nodeA kernel: [1239467.400293] eth0: port 11(nlb2.e0)
>    entering disabled state
>    Nov 28 10:55:03 nodeA kernel: [1239467.400516] eth0: port 11(nlb2.e0)
>    entering disabled state

How's your networking set up? 

I hope the the Windows NLB VMs aren't using the same bridge/VLAN as DRBD is using? 


-- Pasi


>    Nov 28 10:55:04 nodeA kernel: [1239467.731442] frontend_changed:
>    backend/vif/73/0: prepare for reconnect
>    Nov 28 10:55:04 nodeA logger: /etc/xen/scripts/vif-bridge: offline
>    XENBUS_PATH=backend/vif/73/0
>    Nov 28 10:55:05 nodeA logger: /etc/xen/scripts/vif-bridge: brctl delif
>    eth0 nlb2.e0 failed
>    Nov 28 10:55:05 nodeA logger: /etc/xen/scripts/vif-bridge: ifconfig
>    nlb2.e0 down failed
>    Nov 28 10:55:06 nodeA logger: /etc/xen/scripts/vif-bridge: Successful
>    vif-bridge offline for nlb2.e0, bridge eth0.
>    Nov 28 10:55:06 nodeA logger: /etc/xen/scripts/vif-bridge: online
>    XENBUS_PATH=backend/vif/73/0
>    Nov 28 10:55:08 nodeA kernel: [1239471.758583] device nlb2.e0 entered
>    promiscuous mode
>    Nov 28 10:55:10 nodeA kernel: [1239473.795967] block drbd23: sock was shut
>    down by peer
>    Nov 28 10:55:27 nodeA kernel: [1239473.795973] block drbd23: peer( Primary
>    -> Unknown ) conn( Connected -> BrokenPipe ) pdsk( UpToDate -> DUnknown )
>    Nov 28 10:55:27 nodeA kernel: [1239473.795980] block drbd23: short read
>    expecting header on sock: r=0
>    Nov 28 10:55:27 nodeA kernel: [1239474.009951] block drbd31: sock was shut
>    down by peer
> 
>    Nov 28 10:55:09 nodeB kernel: [1239622.217505] block drbd23: PingAck did
>    not arrive in time.
>    Nov 28 10:55:09 nodeB kernel: [1239622.217542] block drbd23: peer(
>    Secondary -> Unknown ) conn( Connected -> NetworkFailure ) pdsk( UpToDate
>    -> DUnknown )
>    Nov 28 10:55:09 nodeB kernel: [1239622.217551] block drbd23: asender
>    terminated
>    Nov 28 10:55:09 nodeB kernel: [1239622.217554] block drbd23: Terminating
>    drbd23_asender
>    Nov 28 10:55:09 nodeB kernel: [1239622.217795] block drbd23: short read
>    expecting header on sock: r=-512
>    Nov 28 10:55:09 nodeB kernel: [1239622.217887] block drbd23: Creating new
>    current UUID
>    Nov 28 10:55:09 nodeB kernel: [1239622.218118] block drbd23: Connection
>    closed
>    Nov 28 10:55:09 nodeB kernel: [1239622.218125] block drbd23: conn(
>    NetworkFailure -> Unconnected )
>    Nov 28 10:55:09 nodeB kernel: [1239622.218135] block drbd23: receiver
>    terminated
>    Nov 28 10:55:09 nodeB kernel: [1239622.218137] block drbd23: Restarting
>    drbd23_receiver
>    Nov 28 10:55:09 nodeB kernel: [1239622.218140] block drbd23: receiver
>    (re)started
>    Nov 28 10:55:09 nodeB kernel: [1239622.218143] block drbd23: conn(
>    Unconnected -> WFConnection )
>    Nov 28 10:55:09 nodeB kernel: [1239622.353589] block drbd30: PingAck did
>    not arrive in time.
>    Nov 28 10:55:09 nodeB kernel: [1239622.353627] block drbd30: peer(
>    Secondary -> Unknown ) conn( Connected -> NetworkFailure ) pdsk( UpToDate
>    -> DUnknown )
>    Nov 28 10:55:09 nodeB kernel: [1239622.353637] block drbd30: asender
>    terminated
>    Nov 28 10:55:09 nodeB kernel: [1239622.353639] block drbd30: Terminating
>    drbd30_asender
>    Nov 28 10:55:09 nodeB kernel: [1239622.353668] block drbd30: short read
>    expecting header on sock: r=-512
>    Nov 28 10:55:09 nodeB kernel: [1239622.353754] block drbd30: Creating new
>    current UUID
>    Nov 28 10:55:09 nodeB kernel: [1239622.388101] block drbd30: Connection
>    closed
>    Nov 28 10:55:09 nodeB kernel: [1239622.388107] block drbd30: conn(
>    NetworkFailure -> Unconnected )
>    Nov 28 10:55:09 nodeB kernel: [1239622.388111] block drbd30: receiver
>    terminated
>    Nov 28 10:55:09 nodeB kernel: [1239622.388113] block drbd30: Restarting
>    drbd30_receiver
>    Nov 28 10:55:09 nodeB kernel: [1239622.388116] block drbd30: receiver
>    (re)started
>    Nov 28 10:55:09 nodeB kernel: [1239622.388119] block drbd30: conn(
>    Unconnected -> WFConnection )
> 
>    I've also looked at the qemu, xend-hotplug, and xend logs and do not see
>    any telling errors.  In xend.log I just see lines pertaining to VM's being
>    rebooted.
> 
>    As for GPLPV.. I haven't been able to reproduce the "network crashing" and
>    rebooting in the lab and probably won't be able to until I can get a more
>    robust production-like environment setup.  Unfortunately I can't risk more
>    customer down time by attempting to setup NLB without the GPLPV drivers in
>    production.  If I can manage to reproduce this in staging I will of course
>    attempt without the GPLPV drivers.
> 
>    -Greg

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:46:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:46:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeP39-0007On-0i; Fri, 30 Nov 2012 11:46:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TeP36-0007Oi-Mc
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:46:28 +0000
Received: from [85.158.139.211:29480] by server-3.bemta-5.messagelabs.com id
	4F/DE-18736-29C98B05; Fri, 30 Nov 2012 11:46:26 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354275984!18539922!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDk4NDk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12137 invoked from network); 30 Nov 2012 11:46:25 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 30 Nov 2012 11:46:25 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 3B1931F41;
	Fri, 30 Nov 2012 13:46:24 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 09E2BEC027; Fri, 30 Nov 2012 13:46:24 +0200 (EET)
Date: Fri, 30 Nov 2012 13:46:23 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Greg Zapp <greg.zapp@gmail.com>
Message-ID: <20121130114623.GQ8912@reaktio.net>
References: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
	<20121129150736.GH8912@reaktio.net>
	<CAEHxbC1gG5RR9h9odxx59BZm2+SUdoGuwZc8Sco_yNtxVwod=Q@mail.gmail.com>
	<20121130113655.GP8912@reaktio.net>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121130113655.GP8912@reaktio.net>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Enabling NLB is crashing VM's/DRBD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 01:36:55PM +0200, Pasi K=E4rkk=E4inen wrote:
> On Fri, Nov 30, 2012 at 11:11:11AM +1300, Greg Zapp wrote:
> >    HI,
> > =

> >    We are running Debian's provided xen-hypervisor-4.0-amd64(4.0.
> >    1-4).  The kernel is 2.6.32-5-xen-amd64(2.6.32-46) from Debian.
> > =

> >    The previously posted log lines were from the dom0's /var/log/messag=
es.
> >    The only thing I'm seeing form xm dmesg is the following:
> >    (XEN) grant_table.c:1717:d0 Bad grant reference
> > =

> >    I've also picked up on some more entries from syslog that were not p=
resent
> >    in messages.  Here is what's present in syslog.  Time seems to be sy=
nc'd
> >    to the second on both machines:
> >    Nov 28 10:55:03 nodeA kernel: [1239467.400293] eth0: port 11(nlb2.e0)
> >    entering disabled state
> >    Nov 28 10:55:03 nodeA kernel: [1239467.400516] eth0: port 11(nlb2.e0)
> >    entering disabled state
> =

> How's your networking set up? =

> =

> I hope the the Windows NLB VMs aren't using the same bridge/VLAN as DRBD =
is using? =

> =


Also in what mode are you using NLB? =



-- Pasi



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:46:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:46:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeP39-0007On-0i; Fri, 30 Nov 2012 11:46:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TeP36-0007Oi-Mc
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:46:28 +0000
Received: from [85.158.139.211:29480] by server-3.bemta-5.messagelabs.com id
	4F/DE-18736-29C98B05; Fri, 30 Nov 2012 11:46:26 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354275984!18539922!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDk4NDk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12137 invoked from network); 30 Nov 2012 11:46:25 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 30 Nov 2012 11:46:25 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 3B1931F41;
	Fri, 30 Nov 2012 13:46:24 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 09E2BEC027; Fri, 30 Nov 2012 13:46:24 +0200 (EET)
Date: Fri, 30 Nov 2012 13:46:23 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Greg Zapp <greg.zapp@gmail.com>
Message-ID: <20121130114623.GQ8912@reaktio.net>
References: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
	<20121129150736.GH8912@reaktio.net>
	<CAEHxbC1gG5RR9h9odxx59BZm2+SUdoGuwZc8Sco_yNtxVwod=Q@mail.gmail.com>
	<20121130113655.GP8912@reaktio.net>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121130113655.GP8912@reaktio.net>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Enabling NLB is crashing VM's/DRBD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 01:36:55PM +0200, Pasi K=E4rkk=E4inen wrote:
> On Fri, Nov 30, 2012 at 11:11:11AM +1300, Greg Zapp wrote:
> >    HI,
> > =

> >    We are running Debian's provided xen-hypervisor-4.0-amd64(4.0.
> >    1-4).  The kernel is 2.6.32-5-xen-amd64(2.6.32-46) from Debian.
> > =

> >    The previously posted log lines were from the dom0's /var/log/messag=
es.
> >    The only thing I'm seeing form xm dmesg is the following:
> >    (XEN) grant_table.c:1717:d0 Bad grant reference
> > =

> >    I've also picked up on some more entries from syslog that were not p=
resent
> >    in messages.  Here is what's present in syslog.  Time seems to be sy=
nc'd
> >    to the second on both machines:
> >    Nov 28 10:55:03 nodeA kernel: [1239467.400293] eth0: port 11(nlb2.e0)
> >    entering disabled state
> >    Nov 28 10:55:03 nodeA kernel: [1239467.400516] eth0: port 11(nlb2.e0)
> >    entering disabled state
> =

> How's your networking set up? =

> =

> I hope the the Windows NLB VMs aren't using the same bridge/VLAN as DRBD =
is using? =

> =


Also in what mode are you using NLB? =



-- Pasi



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:50:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:50:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeP71-0007Xk-TE; Fri, 30 Nov 2012 11:50:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeP70-0007Xe-Az
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:50:30 +0000
Received: from [85.158.137.99:16154] by server-7.bemta-3.messagelabs.com id
	C1/52-01713-58D98B05; Fri, 30 Nov 2012 11:50:29 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354276227!17022939!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8027 invoked from network); 30 Nov 2012 11:50:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:50:28 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16089728"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 11:50:27 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 11:50:27 +0000
Message-ID: <1354276225.6269.131.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Fri, 30 Nov 2012 11:50:25 +0000
In-Reply-To: <1354210534-31052-7-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1354210534-31052-7-git-send-email-matthew.fioravante@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [VTPM v5 6/7] Add autoconf to stubdom
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 17:35 +0000, Matthew Fioravante wrote:
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> ---
>  m4/curses.m4                   |   20 +
> [...]
>  tools/m4/curses.m4             |   20 -

Could you use the -M option the git send-mail or git format-patch so
that it represents renames in the minimal way?

> stubdom/configure              | 4370 ++++++++++++++++++++++++++++++++++++++++

If you can figure out a way to exclude this (easiest is to just not
commit it I think) then that would be good too, from the PoV of
reviewability of the patch.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:50:44 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:50:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeP71-0007Xk-TE; Fri, 30 Nov 2012 11:50:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeP70-0007Xe-Az
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:50:30 +0000
Received: from [85.158.137.99:16154] by server-7.bemta-3.messagelabs.com id
	C1/52-01713-58D98B05; Fri, 30 Nov 2012 11:50:29 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354276227!17022939!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8027 invoked from network); 30 Nov 2012 11:50:28 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:50:28 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16089728"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 11:50:27 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 11:50:27 +0000
Message-ID: <1354276225.6269.131.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Fri, 30 Nov 2012 11:50:25 +0000
In-Reply-To: <1354210534-31052-7-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1354210534-31052-7-git-send-email-matthew.fioravante@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [VTPM v5 6/7] Add autoconf to stubdom
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 17:35 +0000, Matthew Fioravante wrote:
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> ---
>  m4/curses.m4                   |   20 +
> [...]
>  tools/m4/curses.m4             |   20 -

Could you use the -M option the git send-mail or git format-patch so
that it represents renames in the minimal way?

> stubdom/configure              | 4370 ++++++++++++++++++++++++++++++++++++++++

If you can figure out a way to exclude this (easiest is to just not
commit it I think) then that would be good too, from the PoV of
reviewability of the patch.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:57:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:57:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePDa-0007xK-0G; Fri, 30 Nov 2012 11:57:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TePDY-0007xF-B1
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:57:16 +0000
Received: from [85.158.139.83:27923] by server-16.bemta-5.messagelabs.com id
	F0/8D-21311-B1F98B05; Fri, 30 Nov 2012 11:57:15 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1354276632!25089492!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30320 invoked from network); 30 Nov 2012 11:57:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:57:12 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16089894"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 11:57:12 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 11:57:12 +0000
Message-ID: <1354276631.6269.137.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Fri, 30 Nov 2012 11:57:11 +0000
In-Reply-To: <1354210534-31052-8-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1354210534-31052-8-git-send-email-matthew.fioravante@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [VTPM v5 7/7] Add a real top level configure script
 that calls the others
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 17:35 +0000, Matthew Fioravante wrote:
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> ---
>  autogen.sh         |    1 +
>  configure          | 3013 +++++++++++++++++++++++++++++++++++++++++++++++++++-

Pretty impressive for a minimal configure.ac ;-)

>  configure.ac       |   14 +
>  tools/configure    |  601 ++++++-----
>  tools/configure.ac |    2 +-
>  5 files changed, 3341 insertions(+), 290 deletions(-)
>  create mode 100644 configure.ac


> diff --git a/configure.ac b/configure.ac
> new file mode 100644
> index 0000000..3a6339c
> --- /dev/null
> +++ b/configure.ac
> @@ -0,0 +1,14 @@
> +#                                               -*- Autoconf -*-
> +# Process this file with autoconf to produce a configure script.
> +
> +AC_PREREQ([2.67])
> +AC_INIT([Xen Hypervisor], m4_esyscmd([./version.sh ./xen/Makefile]),
> +    [xen-devel@lists.xen.org], [xen], [http://www.xen.org/])
> +AC_CONFIG_SRCDIR([./tools/libxl/libxl.c])
> +AC_CONFIG_FILES([./config/Tools.mk])

If I understand correctly this causes this script to consider
config/Tools.mk as an output file, which it isn't for this script (that
is tools/configure's job).

If this is needed then why is config/Stubdom.mk similarly listed?

> +AC_PREFIX_DEFAULT([/usr])
> +AC_CONFIG_AUX_DIR([.])

Looking at
http://www.gnu.org/software/automake/manual/html_node/Optional.html I
wonder if we shouldn't also change the sub-configures to use .. with
this macro, such that they pickup the toplevel config.{sub,guess} etc
which this implies instead of having their own copy?

Since the default is ., .. or ../.. do we need this at all?

> +
> +AC_CONFIG_SUBDIRS([tools stubdom])
> +
> +AC_OUTPUT()

Is this mandatory? This configure script shouldn't have any output other
than the call to the sub-configures.

[...]
> diff --git a/tools/configure.ac b/tools/configure.ac
> index 971e3e9..9924852 100644
> --- a/tools/configure.ac
> +++ b/tools/configure.ac
> @@ -2,7 +2,7 @@
>  # Process this file with autoconf to produce a configure script.
> 
>  AC_PREREQ([2.67])
> -AC_INIT([Xen Hypervisor], m4_esyscmd([../version.sh ../xen/Makefile]),
> +AC_INIT([Xen Hypervisor Tools], m4_esyscmd([../version.sh ../xen/Makefile]),
>      [xen-devel@lists.xen.org], [xen], [http://www.xen.org/])
>  AC_CONFIG_SRCDIR([libxl/libxl.c])
>  AC_CONFIG_FILES([../config/Tools.mk])
> --
> 1.7.10.4
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 11:57:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 11:57:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePDa-0007xK-0G; Fri, 30 Nov 2012 11:57:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TePDY-0007xF-B1
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 11:57:16 +0000
Received: from [85.158.139.83:27923] by server-16.bemta-5.messagelabs.com id
	F0/8D-21311-B1F98B05; Fri, 30 Nov 2012 11:57:15 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1354276632!25089492!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30320 invoked from network); 30 Nov 2012 11:57:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 11:57:12 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16089894"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 11:57:12 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 11:57:12 +0000
Message-ID: <1354276631.6269.137.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Date: Fri, 30 Nov 2012 11:57:11 +0000
In-Reply-To: <1354210534-31052-8-git-send-email-matthew.fioravante@jhuapl.edu>
References: <1354210534-31052-1-git-send-email-matthew.fioravante@jhuapl.edu>
	<1354210534-31052-8-git-send-email-matthew.fioravante@jhuapl.edu>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [VTPM v5 7/7] Add a real top level configure script
 that calls the others
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 17:35 +0000, Matthew Fioravante wrote:
> Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> ---
>  autogen.sh         |    1 +
>  configure          | 3013 +++++++++++++++++++++++++++++++++++++++++++++++++++-

Pretty impressive for a minimal configure.ac ;-)

>  configure.ac       |   14 +
>  tools/configure    |  601 ++++++-----
>  tools/configure.ac |    2 +-
>  5 files changed, 3341 insertions(+), 290 deletions(-)
>  create mode 100644 configure.ac


> diff --git a/configure.ac b/configure.ac
> new file mode 100644
> index 0000000..3a6339c
> --- /dev/null
> +++ b/configure.ac
> @@ -0,0 +1,14 @@
> +#                                               -*- Autoconf -*-
> +# Process this file with autoconf to produce a configure script.
> +
> +AC_PREREQ([2.67])
> +AC_INIT([Xen Hypervisor], m4_esyscmd([./version.sh ./xen/Makefile]),
> +    [xen-devel@lists.xen.org], [xen], [http://www.xen.org/])
> +AC_CONFIG_SRCDIR([./tools/libxl/libxl.c])
> +AC_CONFIG_FILES([./config/Tools.mk])

If I understand correctly this causes this script to consider
config/Tools.mk as an output file, which it isn't for this script (that
is tools/configure's job).

If this is needed then why is config/Stubdom.mk similarly listed?

> +AC_PREFIX_DEFAULT([/usr])
> +AC_CONFIG_AUX_DIR([.])

Looking at
http://www.gnu.org/software/automake/manual/html_node/Optional.html I
wonder if we shouldn't also change the sub-configures to use .. with
this macro, such that they pickup the toplevel config.{sub,guess} etc
which this implies instead of having their own copy?

Since the default is ., .. or ../.. do we need this at all?

> +
> +AC_CONFIG_SUBDIRS([tools stubdom])
> +
> +AC_OUTPUT()

Is this mandatory? This configure script shouldn't have any output other
than the call to the sub-configures.

[...]
> diff --git a/tools/configure.ac b/tools/configure.ac
> index 971e3e9..9924852 100644
> --- a/tools/configure.ac
> +++ b/tools/configure.ac
> @@ -2,7 +2,7 @@
>  # Process this file with autoconf to produce a configure script.
> 
>  AC_PREREQ([2.67])
> -AC_INIT([Xen Hypervisor], m4_esyscmd([../version.sh ../xen/Makefile]),
> +AC_INIT([Xen Hypervisor Tools], m4_esyscmd([../version.sh ../xen/Makefile]),
>      [xen-devel@lists.xen.org], [xen], [http://www.xen.org/])
>  AC_CONFIG_SRCDIR([libxl/libxl.c])
>  AC_CONFIG_FILES([../config/Tools.mk])
> --
> 1.7.10.4
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:09:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:09:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePOb-0000Cs-4J; Fri, 30 Nov 2012 12:08:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TePOZ-0000Cn-OA
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 12:08:39 +0000
Received: from [85.158.139.211:4635] by server-7.bemta-5.messagelabs.com id
	C2/1C-23096-7C1A8B05; Fri, 30 Nov 2012 12:08:39 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1354277317!18405409!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26524 invoked from network); 30 Nov 2012 12:08:38 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 12:08:38 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46153706"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 12:08:36 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 07:08:36 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TePOV-0001Kz-Vn;
	Fri, 30 Nov 2012 12:08:35 +0000
Date: Fri, 30 Nov 2012 12:08:31 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1354185641.25834.126.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211301147000.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<1354185641.25834.126.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 29 Nov 2012, Ian Campbell wrote:
> On Fri, 2012-11-23 at 15:21 +0000, Stefano Stabellini wrote:
> > Get the address of the GIC distributor, cpu, virtual and virtual cpu
> > interfaces registers from device tree.
> > 
> > 
> > Note: I couldn't completely get rid of GIC_BASE_ADDRESS, GIC_DR_OFFSET
> > and friends because we are using them from mode_switch.S, that is
> > executed before device tree has been parsed. But at least mode_switch.S
> > is known to contain vexpress specific code anyway.
> > 
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> I've a few comments on mostly pre-existing things which I happened to
> notice while reviewing this:
> 
> > diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> > index 0c6fab9..8efbeb3 100644
> > --- a/xen/arch/arm/gic.c
> > +++ b/xen/arch/arm/gic.c
> > @@ -34,9 +35,9 @@
> >  /* Access to the GIC Distributor registers through the fixmap */
> >  #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
> 
> There's an implicit assumption here that the GICD is correctly aligned
> -- I suspect it really ought to be handled like the others... but...
> 
> >  #define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
> > -                                     + (GIC_CR_OFFSET & 0xfff)))
> > +                                     + ((uint32_t) gic.cbase & 0xfff)))
> >  #define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
> > -                                     + (GIC_HR_OFFSET & 0xfff)))
> > +                                     + ((uint32_t) gic.hbase & 0xfff)))
> 
> ... is there actually any chance of these being non-page aligned?

I couldn't find any specific references to interface alignment in the
GIC documentation, but I strongly doubt they can be non-page aligned.
I think we should just add a check to see if they are page aligned,
aborting if they are not.


> Also now that these are dynamic perhaps an actual variable initialised
> at start of day would be better than a #define?

After all the virtual addresses for gicd, gicc and gich are always going
to be the same, no matter what the their physical address is.
I don't think is worth turning the #define into variables.


---

arm: add few checks to gic_init

Check for:
- uninitialized GIC interface addresses;
- non-page aligned GIC interface addresses.

Return in both cases with an error message.
Also remove the code from GICH and GICC to handle non-page aligned
interfaces.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 8efbeb3..301d223 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -34,10 +34,8 @@
 
 /* Access to the GIC Distributor registers through the fixmap */
 #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
-#define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
-                                     + ((uint32_t) gic.cbase & 0xfff)))
-#define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
-                                     + ((uint32_t) gic.hbase & 0xfff)))
+#define GICC ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICC1)) 
+#define GICH ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICH))
 static void gic_restore_pending_irqs(struct vcpu *v);
 
 /* Global state */
@@ -308,6 +306,23 @@ static void __cpuinit gic_hyp_disable(void)
 /* Set up the GIC */
 void __init gic_init(void)
 {
+	if ( !early_info.gic.gic_dist_addr ||
+			!early_info.gic.gic_cpu_addr ||
+			!early_info.gic.gic_hyp_addr ||
+			!early_info.gic.gic_vcpu_addr )
+	{
+		printk("error: incorrect physical address of the GIC interfaces.\n");
+		return;
+	}
+	if ( (early_info.gic.gic_dist_addr & ((1 << PAGE_SHIFT) - 1)) ||
+			(early_info.gic.gic_cpu_addr & ((1 << PAGE_SHIFT) - 1)) ||
+			(early_info.gic.gic_hyp_addr & ((1 << PAGE_SHIFT) - 1)) ||
+			(early_info.gic.gic_vcpu_addr & ((1 << PAGE_SHIFT) - 1)) )
+	{
+		printk("error: GIC interfaces not page aligned.\n");
+		return;
+	}
+
     gic.dbase = early_info.gic.gic_dist_addr;
     gic.cbase = early_info.gic.gic_cpu_addr;
     gic.hbase = early_info.gic.gic_hyp_addr;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:09:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:09:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePOb-0000Cs-4J; Fri, 30 Nov 2012 12:08:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TePOZ-0000Cn-OA
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 12:08:39 +0000
Received: from [85.158.139.211:4635] by server-7.bemta-5.messagelabs.com id
	C2/1C-23096-7C1A8B05; Fri, 30 Nov 2012 12:08:39 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1354277317!18405409!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26524 invoked from network); 30 Nov 2012 12:08:38 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 12:08:38 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46153706"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 12:08:36 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 07:08:36 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TePOV-0001Kz-Vn;
	Fri, 30 Nov 2012 12:08:35 +0000
Date: Fri, 30 Nov 2012 12:08:31 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1354185641.25834.126.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211301147000.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<1354185641.25834.126.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 29 Nov 2012, Ian Campbell wrote:
> On Fri, 2012-11-23 at 15:21 +0000, Stefano Stabellini wrote:
> > Get the address of the GIC distributor, cpu, virtual and virtual cpu
> > interfaces registers from device tree.
> > 
> > 
> > Note: I couldn't completely get rid of GIC_BASE_ADDRESS, GIC_DR_OFFSET
> > and friends because we are using them from mode_switch.S, that is
> > executed before device tree has been parsed. But at least mode_switch.S
> > is known to contain vexpress specific code anyway.
> > 
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> I've a few comments on mostly pre-existing things which I happened to
> notice while reviewing this:
> 
> > diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> > index 0c6fab9..8efbeb3 100644
> > --- a/xen/arch/arm/gic.c
> > +++ b/xen/arch/arm/gic.c
> > @@ -34,9 +35,9 @@
> >  /* Access to the GIC Distributor registers through the fixmap */
> >  #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
> 
> There's an implicit assumption here that the GICD is correctly aligned
> -- I suspect it really ought to be handled like the others... but...
> 
> >  #define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
> > -                                     + (GIC_CR_OFFSET & 0xfff)))
> > +                                     + ((uint32_t) gic.cbase & 0xfff)))
> >  #define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
> > -                                     + (GIC_HR_OFFSET & 0xfff)))
> > +                                     + ((uint32_t) gic.hbase & 0xfff)))
> 
> ... is there actually any chance of these being non-page aligned?

I couldn't find any specific references to interface alignment in the
GIC documentation, but I strongly doubt they can be non-page aligned.
I think we should just add a check to see if they are page aligned,
aborting if they are not.


> Also now that these are dynamic perhaps an actual variable initialised
> at start of day would be better than a #define?

After all the virtual addresses for gicd, gicc and gich are always going
to be the same, no matter what the their physical address is.
I don't think is worth turning the #define into variables.


---

arm: add few checks to gic_init

Check for:
- uninitialized GIC interface addresses;
- non-page aligned GIC interface addresses.

Return in both cases with an error message.
Also remove the code from GICH and GICC to handle non-page aligned
interfaces.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 8efbeb3..301d223 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -34,10 +34,8 @@
 
 /* Access to the GIC Distributor registers through the fixmap */
 #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
-#define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
-                                     + ((uint32_t) gic.cbase & 0xfff)))
-#define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
-                                     + ((uint32_t) gic.hbase & 0xfff)))
+#define GICC ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICC1)) 
+#define GICH ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICH))
 static void gic_restore_pending_irqs(struct vcpu *v);
 
 /* Global state */
@@ -308,6 +306,23 @@ static void __cpuinit gic_hyp_disable(void)
 /* Set up the GIC */
 void __init gic_init(void)
 {
+	if ( !early_info.gic.gic_dist_addr ||
+			!early_info.gic.gic_cpu_addr ||
+			!early_info.gic.gic_hyp_addr ||
+			!early_info.gic.gic_vcpu_addr )
+	{
+		printk("error: incorrect physical address of the GIC interfaces.\n");
+		return;
+	}
+	if ( (early_info.gic.gic_dist_addr & ((1 << PAGE_SHIFT) - 1)) ||
+			(early_info.gic.gic_cpu_addr & ((1 << PAGE_SHIFT) - 1)) ||
+			(early_info.gic.gic_hyp_addr & ((1 << PAGE_SHIFT) - 1)) ||
+			(early_info.gic.gic_vcpu_addr & ((1 << PAGE_SHIFT) - 1)) )
+	{
+		printk("error: GIC interfaces not page aligned.\n");
+		return;
+	}
+
     gic.dbase = early_info.gic.gic_dist_addr;
     gic.cbase = early_info.gic.gic_cpu_addr;
     gic.hbase = early_info.gic.gic_hyp_addr;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:14:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:14:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePUE-0000Z0-VC; Fri, 30 Nov 2012 12:14:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TePUE-0000Yv-4A
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 12:14:30 +0000
Received: from [193.109.254.147:21880] by server-4.bemta-14.messagelabs.com id
	88/52-18856-523A8B05; Fri, 30 Nov 2012 12:14:29 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1354277668!8904899!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18557 invoked from network); 30 Nov 2012 12:14:28 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 12:14:28 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 12:14:28 +0000
Message-Id: <50B8B16C02000078000ACE01@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 12:15:24 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "George Dunlap" <dunlapg@umich.edu>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B63CCC02000078000AC34E@nat28.tlf.novell.com>
	<50B8981802000078000ACCFE@nat28.tlf.novell.com>
	<CAFLBxZYKtq5-dfbXucB8Uf0zFoMC91hAxcNdWd_FA-7-Bc-hMg@mail.gmail.com>
	<50B8A53702000078000ACD99@nat28.tlf.novell.com>
	<CAFLBxZY8Wx56mSpV6KRfcO=GWmwtguv_6=kT5F3hJ4SieJENQg@mail.gmail.com>
In-Reply-To: <CAFLBxZY8Wx56mSpV6KRfcO=GWmwtguv_6=kT5F3hJ4SieJENQg@mail.gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 12:34, George Dunlap <dunlapg@umich.edu> wrote:
> On Fri, Nov 30, 2012 at 11:23 AM, Jan Beulich <JBeulich@suse.com> wrote:
> 
>> >>> On 30.11.12 at 11:56, George Dunlap <dunlapg@umich.edu> wrote:
>> > On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich <JBeulich@suse.com> wrote:
>> >
>> >>
>> >> So I learned a little more meanwhile - it's not that trivial: I'm told
>> >> the shim uses UEFI services to do the verification, and those
>> >> services only handle PE images. But we obviously can't reasonably
>> >> expect the Dom0 kernel to be packaged as PE image, as that
>> >> would then be unusable as DomU kernel (on older hosts at least,
>> >> i.e. even if we added a PE loader to libxc).
>> >>
>> >
>> > But what does the shim use to check the signature of Xen in this case?
>> > Does Xen / native Linux need to be a PE image to boot from the shim?
>>
>> Yes - xen.efi just needs to get a signature implanted for that
>> part to work, and native Linux uses the EFI_STUB mechanism
>> to gets its binary into said format (which then also only needs a
>> signature added).
>>
>> >  If
>> > not, wouldn't the native PE image suffice?  And if so, why can't the shim
>> > check signatures the same way it checks the sig for the thing it's
>> booting?
>>
>> The checking code only knows to locate signatures inside PE
>> images. Consequently, whatever you want to pass to that code
>> needs to look like one. xen.efi and native Linux with EFI_STUB
>> enabled already do, but if you handed such a kernel binary to
>> either of the two PV domain kernel loaders Xen has, they would
>> just bail.
>>
> 
> OK... so Fedora and Ubuntu are going to be shipping signed kernel
> binaries.  Are those binaries going to be in PE / EFI format then?  If so:
> 1. You won't need to do any fancy on-the-fly repackaging in Xen; you can
> just pass the already-signed distro-supplied binary
> 2. The toolstack is simply going to have to be able to read PE kernels for
> PV guests
> 3. If distros don't include non-PE kernels, we're going to have to backport
> that functionality to older versions of Xen.

Looks like our bzImage loader may be able to deal with these
(fake) PE images already, so that should then be backwards
compatible back to 3.4.2 (DomU loader) and 4.0.0 (Dom0
loader). Good enough, I think. I'll check next week whether
that's actually true.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:14:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:14:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePUE-0000Z0-VC; Fri, 30 Nov 2012 12:14:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <JBeulich@suse.com>) id 1TePUE-0000Yv-4A
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 12:14:30 +0000
Received: from [193.109.254.147:21880] by server-4.bemta-14.messagelabs.com id
	88/52-18856-523A8B05; Fri, 30 Nov 2012 12:14:29 +0000
X-Env-Sender: JBeulich@suse.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1354277668!8904899!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18557 invoked from network); 30 Nov 2012 12:14:28 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-8.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 12:14:28 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 12:14:28 +0000
Message-Id: <50B8B16C02000078000ACE01@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 12:15:24 +0000
From: "Jan Beulich" <JBeulich@suse.com>
To: "George Dunlap" <dunlapg@umich.edu>
References: <CAFLBxZaQqh0K=W_nc3LM1u4U9DZvTu6jMGHNduE4JgkVo317WQ@mail.gmail.com>
	<50B63CCC02000078000AC34E@nat28.tlf.novell.com>
	<50B8981802000078000ACCFE@nat28.tlf.novell.com>
	<CAFLBxZYKtq5-dfbXucB8Uf0zFoMC91hAxcNdWd_FA-7-Bc-hMg@mail.gmail.com>
	<50B8A53702000078000ACD99@nat28.tlf.novell.com>
	<CAFLBxZY8Wx56mSpV6KRfcO=GWmwtguv_6=kT5F3hJ4SieJENQg@mail.gmail.com>
In-Reply-To: <CAFLBxZY8Wx56mSpV6KRfcO=GWmwtguv_6=kT5F3hJ4SieJENQg@mail.gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: Keir Fraser <keir@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Xen.efi and secure boot
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> On 30.11.12 at 12:34, George Dunlap <dunlapg@umich.edu> wrote:
> On Fri, Nov 30, 2012 at 11:23 AM, Jan Beulich <JBeulich@suse.com> wrote:
> 
>> >>> On 30.11.12 at 11:56, George Dunlap <dunlapg@umich.edu> wrote:
>> > On Fri, Nov 30, 2012 at 10:27 AM, Jan Beulich <JBeulich@suse.com> wrote:
>> >
>> >>
>> >> So I learned a little more meanwhile - it's not that trivial: I'm told
>> >> the shim uses UEFI services to do the verification, and those
>> >> services only handle PE images. But we obviously can't reasonably
>> >> expect the Dom0 kernel to be packaged as PE image, as that
>> >> would then be unusable as DomU kernel (on older hosts at least,
>> >> i.e. even if we added a PE loader to libxc).
>> >>
>> >
>> > But what does the shim use to check the signature of Xen in this case?
>> > Does Xen / native Linux need to be a PE image to boot from the shim?
>>
>> Yes - xen.efi just needs to get a signature implanted for that
>> part to work, and native Linux uses the EFI_STUB mechanism
>> to gets its binary into said format (which then also only needs a
>> signature added).
>>
>> >  If
>> > not, wouldn't the native PE image suffice?  And if so, why can't the shim
>> > check signatures the same way it checks the sig for the thing it's
>> booting?
>>
>> The checking code only knows to locate signatures inside PE
>> images. Consequently, whatever you want to pass to that code
>> needs to look like one. xen.efi and native Linux with EFI_STUB
>> enabled already do, but if you handed such a kernel binary to
>> either of the two PV domain kernel loaders Xen has, they would
>> just bail.
>>
> 
> OK... so Fedora and Ubuntu are going to be shipping signed kernel
> binaries.  Are those binaries going to be in PE / EFI format then?  If so:
> 1. You won't need to do any fancy on-the-fly repackaging in Xen; you can
> just pass the already-signed distro-supplied binary
> 2. The toolstack is simply going to have to be able to read PE kernels for
> PV guests
> 3. If distros don't include non-PE kernels, we're going to have to backport
> that functionality to older versions of Xen.

Looks like our bzImage loader may be able to deal with these
(fake) PE images already, so that should then be backwards
compatible back to 3.4.2 (DomU loader) and 4.0.0 (Dom0
loader). Good enough, I think. I'll check next week whether
that's actually true.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:19:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:19:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePYn-0000iQ-4P; Fri, 30 Nov 2012 12:19:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TePYl-0000iB-DK
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 12:19:11 +0000
Received: from [85.158.137.99:23192] by server-14.bemta-3.messagelabs.com id
	C9/04-31424-E34A8B05; Fri, 30 Nov 2012 12:19:10 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1354277949!12277706!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17414 invoked from network); 30 Nov 2012 12:19:10 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 12:19:10 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16090456"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 12:19:09 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 12:19:09 +0000
Message-ID: <1354277948.6269.142.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Fri, 30 Nov 2012 12:19:08 +0000
In-Reply-To: <alpine.DEB.2.02.1211301147000.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<1354185641.25834.126.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211301147000.5310@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-30 at 12:08 +0000, Stefano Stabellini wrote:
> On Thu, 29 Nov 2012, Ian Campbell wrote:
> > On Fri, 2012-11-23 at 15:21 +0000, Stefano Stabellini wrote:
> > > Get the address of the GIC distributor, cpu, virtual and virtual cpu
> > > interfaces registers from device tree.
> > > 
> > > 
> > > Note: I couldn't completely get rid of GIC_BASE_ADDRESS, GIC_DR_OFFSET
> > > and friends because we are using them from mode_switch.S, that is
> > > executed before device tree has been parsed. But at least mode_switch.S
> > > is known to contain vexpress specific code anyway.
> > > 
> > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > 
> > I've a few comments on mostly pre-existing things which I happened to
> > notice while reviewing this:
> > 
> > > diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> > > index 0c6fab9..8efbeb3 100644
> > > --- a/xen/arch/arm/gic.c
> > > +++ b/xen/arch/arm/gic.c
> > > @@ -34,9 +35,9 @@
> > >  /* Access to the GIC Distributor registers through the fixmap */
> > >  #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
> > 
> > There's an implicit assumption here that the GICD is correctly aligned
> > -- I suspect it really ought to be handled like the others... but...
> > 
> > >  #define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
> > > -                                     + (GIC_CR_OFFSET & 0xfff)))
> > > +                                     + ((uint32_t) gic.cbase & 0xfff)))
> > >  #define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
> > > -                                     + (GIC_HR_OFFSET & 0xfff)))
> > > +                                     + ((uint32_t) gic.hbase & 0xfff)))
> > 
> > ... is there actually any chance of these being non-page aligned?
> 
> I couldn't find any specific references to interface alignment in the
> GIC documentation, but I strongly doubt they can be non-page aligned.
> I think we should just add a check to see if they are page aligned,
> aborting if they are not.

Agreed.

> > Also now that these are dynamic perhaps an actual variable initialised
> > at start of day would be better than a #define?
> 
> After all the virtual addresses for gicd, gicc and gich are always going
> to be the same, no matter what the their physical address is.
> I don't think is worth turning the #define into variables.

Right, with the above change this is indeed pointless.

> 
> 
> ---
> 
> arm: add few checks to gic_init
> 
> Check for:
> - uninitialized GIC interface addresses;
> - non-page aligned GIC interface addresses.
> 
> Return in both cases with an error message.
> Also remove the code from GICH and GICC to handle non-page aligned
> interfaces.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> index 8efbeb3..301d223 100644
> --- a/xen/arch/arm/gic.c
> +++ b/xen/arch/arm/gic.c
> @@ -34,10 +34,8 @@
>  
>  /* Access to the GIC Distributor registers through the fixmap */
>  #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
> -#define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
> -                                     + ((uint32_t) gic.cbase & 0xfff)))
> -#define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
> -                                     + ((uint32_t) gic.hbase & 0xfff)))
> +#define GICC ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICC1)) 
> +#define GICH ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICH))
>  static void gic_restore_pending_irqs(struct vcpu *v);
>  
>  /* Global state */
> @@ -308,6 +306,23 @@ static void __cpuinit gic_hyp_disable(void)
>  /* Set up the GIC */
>  void __init gic_init(void)
>  {
> +	if ( !early_info.gic.gic_dist_addr ||
> +			!early_info.gic.gic_cpu_addr ||
> +			!early_info.gic.gic_hyp_addr ||
> +			!early_info.gic.gic_vcpu_addr )

This indent is pretty odd. Better to align the "!"s I think.

Also you appear to have hard tabs in here (perhaps that is the problem)

> +	{
> +		printk("error: incorrect physical address of the GIC interfaces.\n");

Incorrect isn't quite right, they are missing.

>From a debugging PoV it might be worth checking GICD and GICC (which are
common) from GICH and GICV (which we might plausibly expect to be
missing on occasion) and/or print out the actual values.

> +		return;
> +	}
> +	if ( (early_info.gic.gic_dist_addr & ((1 << PAGE_SHIFT) - 1)) ||
> +			(early_info.gic.gic_cpu_addr & ((1 << PAGE_SHIFT) - 1)) ||
> +			(early_info.gic.gic_hyp_addr & ((1 << PAGE_SHIFT) - 1)) ||
> +			(early_info.gic.gic_vcpu_addr & ((1 << PAGE_SHIFT) - 1)) )

Alignment (and hard tabs) again.

> +	{
> +		printk("error: GIC interfaces not page aligned.\n");
> +		return;
> +	}
> +
>      gic.dbase = early_info.gic.gic_dist_addr;
>      gic.cbase = early_info.gic.gic_cpu_addr;
>      gic.hbase = early_info.gic.gic_hyp_addr;
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:19:27 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:19:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePYn-0000iQ-4P; Fri, 30 Nov 2012 12:19:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TePYl-0000iB-DK
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 12:19:11 +0000
Received: from [85.158.137.99:23192] by server-14.bemta-3.messagelabs.com id
	C9/04-31424-E34A8B05; Fri, 30 Nov 2012 12:19:10 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1354277949!12277706!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17414 invoked from network); 30 Nov 2012 12:19:10 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-3.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 12:19:10 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16090456"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 12:19:09 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 12:19:09 +0000
Message-ID: <1354277948.6269.142.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Fri, 30 Nov 2012 12:19:08 +0000
In-Reply-To: <alpine.DEB.2.02.1211301147000.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<1354185641.25834.126.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211301147000.5310@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-30 at 12:08 +0000, Stefano Stabellini wrote:
> On Thu, 29 Nov 2012, Ian Campbell wrote:
> > On Fri, 2012-11-23 at 15:21 +0000, Stefano Stabellini wrote:
> > > Get the address of the GIC distributor, cpu, virtual and virtual cpu
> > > interfaces registers from device tree.
> > > 
> > > 
> > > Note: I couldn't completely get rid of GIC_BASE_ADDRESS, GIC_DR_OFFSET
> > > and friends because we are using them from mode_switch.S, that is
> > > executed before device tree has been parsed. But at least mode_switch.S
> > > is known to contain vexpress specific code anyway.
> > > 
> > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > 
> > I've a few comments on mostly pre-existing things which I happened to
> > notice while reviewing this:
> > 
> > > diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> > > index 0c6fab9..8efbeb3 100644
> > > --- a/xen/arch/arm/gic.c
> > > +++ b/xen/arch/arm/gic.c
> > > @@ -34,9 +35,9 @@
> > >  /* Access to the GIC Distributor registers through the fixmap */
> > >  #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
> > 
> > There's an implicit assumption here that the GICD is correctly aligned
> > -- I suspect it really ought to be handled like the others... but...
> > 
> > >  #define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
> > > -                                     + (GIC_CR_OFFSET & 0xfff)))
> > > +                                     + ((uint32_t) gic.cbase & 0xfff)))
> > >  #define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
> > > -                                     + (GIC_HR_OFFSET & 0xfff)))
> > > +                                     + ((uint32_t) gic.hbase & 0xfff)))
> > 
> > ... is there actually any chance of these being non-page aligned?
> 
> I couldn't find any specific references to interface alignment in the
> GIC documentation, but I strongly doubt they can be non-page aligned.
> I think we should just add a check to see if they are page aligned,
> aborting if they are not.

Agreed.

> > Also now that these are dynamic perhaps an actual variable initialised
> > at start of day would be better than a #define?
> 
> After all the virtual addresses for gicd, gicc and gich are always going
> to be the same, no matter what the their physical address is.
> I don't think is worth turning the #define into variables.

Right, with the above change this is indeed pointless.

> 
> 
> ---
> 
> arm: add few checks to gic_init
> 
> Check for:
> - uninitialized GIC interface addresses;
> - non-page aligned GIC interface addresses.
> 
> Return in both cases with an error message.
> Also remove the code from GICH and GICC to handle non-page aligned
> interfaces.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> index 8efbeb3..301d223 100644
> --- a/xen/arch/arm/gic.c
> +++ b/xen/arch/arm/gic.c
> @@ -34,10 +34,8 @@
>  
>  /* Access to the GIC Distributor registers through the fixmap */
>  #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
> -#define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
> -                                     + ((uint32_t) gic.cbase & 0xfff)))
> -#define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
> -                                     + ((uint32_t) gic.hbase & 0xfff)))
> +#define GICC ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICC1)) 
> +#define GICH ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICH))
>  static void gic_restore_pending_irqs(struct vcpu *v);
>  
>  /* Global state */
> @@ -308,6 +306,23 @@ static void __cpuinit gic_hyp_disable(void)
>  /* Set up the GIC */
>  void __init gic_init(void)
>  {
> +	if ( !early_info.gic.gic_dist_addr ||
> +			!early_info.gic.gic_cpu_addr ||
> +			!early_info.gic.gic_hyp_addr ||
> +			!early_info.gic.gic_vcpu_addr )

This indent is pretty odd. Better to align the "!"s I think.

Also you appear to have hard tabs in here (perhaps that is the problem)

> +	{
> +		printk("error: incorrect physical address of the GIC interfaces.\n");

Incorrect isn't quite right, they are missing.

>From a debugging PoV it might be worth checking GICD and GICC (which are
common) from GICH and GICV (which we might plausibly expect to be
missing on occasion) and/or print out the actual values.

> +		return;
> +	}
> +	if ( (early_info.gic.gic_dist_addr & ((1 << PAGE_SHIFT) - 1)) ||
> +			(early_info.gic.gic_cpu_addr & ((1 << PAGE_SHIFT) - 1)) ||
> +			(early_info.gic.gic_hyp_addr & ((1 << PAGE_SHIFT) - 1)) ||
> +			(early_info.gic.gic_vcpu_addr & ((1 << PAGE_SHIFT) - 1)) )

Alignment (and hard tabs) again.

> +	{
> +		printk("error: GIC interfaces not page aligned.\n");
> +		return;
> +	}
> +
>      gic.dbase = early_info.gic.gic_dist_addr;
>      gic.cbase = early_info.gic.gic_cpu_addr;
>      gic.hbase = early_info.gic.gic_hyp_addr;
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:19:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:19:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePYl-0000iI-NN; Fri, 30 Nov 2012 12:19:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TePYj-0000i2-W5
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 12:19:10 +0000
Received: from [193.109.254.147:58793] by server-12.bemta-14.messagelabs.com
	id 7D/CD-00510-D34A8B05; Fri, 30 Nov 2012 12:19:09 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1354277938!1218851!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16502 invoked from network); 30 Nov 2012 12:18:58 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-7.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 12:18:58 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TePYV-000PF2-Go; Fri, 30 Nov 2012 12:18:55 +0000
Date: Fri, 30 Nov 2012 12:18:55 +0000
From: Tim Deegan <tim@xen.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121130121855.GA95877@ocelot.phlegethon.org>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<1354185641.25834.126.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211301147000.5310@kaball.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1211301147000.5310@kaball.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 12:08 +0000 on 30 Nov (1354277311), Stefano Stabellini wrote:
> arm: add few checks to gic_init
> 
> Check for:
> - uninitialized GIC interface addresses;
> - non-page aligned GIC interface addresses.
> 
> Return in both cases with an error message.
> Also remove the code from GICH and GICC to handle non-page aligned
> interfaces.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> index 8efbeb3..301d223 100644
> --- a/xen/arch/arm/gic.c
> +++ b/xen/arch/arm/gic.c
> @@ -34,10 +34,8 @@
>  
>  /* Access to the GIC Distributor registers through the fixmap */
>  #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
> -#define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
> -                                     + ((uint32_t) gic.cbase & 0xfff)))
> -#define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
> -                                     + ((uint32_t) gic.hbase & 0xfff)))
> +#define GICC ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICC1)) 
> +#define GICH ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICH))
>  static void gic_restore_pending_irqs(struct vcpu *v);
>  
>  /* Global state */
> @@ -308,6 +306,23 @@ static void __cpuinit gic_hyp_disable(void)
>  /* Set up the GIC */
>  void __init gic_init(void)
>  {
> +	if ( !early_info.gic.gic_dist_addr ||

Some hard tabs have snuck in here.

> +			!early_info.gic.gic_cpu_addr ||
> +			!early_info.gic.gic_hyp_addr ||
> +			!early_info.gic.gic_vcpu_addr )
> +	{
> +		printk("error: incorrect physical address of the GIC interfaces.\n");
> +		return;

Maybe panic() here (and below) rather than printk?

> +	}
> +	if ( (early_info.gic.gic_dist_addr & ((1 << PAGE_SHIFT) - 1)) ||

(foo & ~PAGE_MASK) is usual for that.

Cheers,

Tim.

> +			(early_info.gic.gic_cpu_addr & ((1 << PAGE_SHIFT) - 1)) ||
> +			(early_info.gic.gic_hyp_addr & ((1 << PAGE_SHIFT) - 1)) ||
> +			(early_info.gic.gic_vcpu_addr & ((1 << PAGE_SHIFT) - 1)) )
> +	{
> +		printk("error: GIC interfaces not page aligned.\n");
> +		return;
> +	}
> +
>      gic.dbase = early_info.gic.gic_dist_addr;
>      gic.cbase = early_info.gic.gic_cpu_addr;
>      gic.hbase = early_info.gic.gic_hyp_addr;
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:19:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:19:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePYl-0000iI-NN; Fri, 30 Nov 2012 12:19:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TePYj-0000i2-W5
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 12:19:10 +0000
Received: from [193.109.254.147:58793] by server-12.bemta-14.messagelabs.com
	id 7D/CD-00510-D34A8B05; Fri, 30 Nov 2012 12:19:09 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1354277938!1218851!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16502 invoked from network); 30 Nov 2012 12:18:58 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-7.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 12:18:58 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TePYV-000PF2-Go; Fri, 30 Nov 2012 12:18:55 +0000
Date: Fri, 30 Nov 2012 12:18:55 +0000
From: Tim Deegan <tim@xen.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-ID: <20121130121855.GA95877@ocelot.phlegethon.org>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<1354185641.25834.126.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211301147000.5310@kaball.uk.xensource.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.02.1211301147000.5310@kaball.uk.xensource.com>
User-Agent: Mutt/1.4.2.1i
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 12:08 +0000 on 30 Nov (1354277311), Stefano Stabellini wrote:
> arm: add few checks to gic_init
> 
> Check for:
> - uninitialized GIC interface addresses;
> - non-page aligned GIC interface addresses.
> 
> Return in both cases with an error message.
> Also remove the code from GICH and GICC to handle non-page aligned
> interfaces.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> index 8efbeb3..301d223 100644
> --- a/xen/arch/arm/gic.c
> +++ b/xen/arch/arm/gic.c
> @@ -34,10 +34,8 @@
>  
>  /* Access to the GIC Distributor registers through the fixmap */
>  #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
> -#define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
> -                                     + ((uint32_t) gic.cbase & 0xfff)))
> -#define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
> -                                     + ((uint32_t) gic.hbase & 0xfff)))
> +#define GICC ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICC1)) 
> +#define GICH ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICH))
>  static void gic_restore_pending_irqs(struct vcpu *v);
>  
>  /* Global state */
> @@ -308,6 +306,23 @@ static void __cpuinit gic_hyp_disable(void)
>  /* Set up the GIC */
>  void __init gic_init(void)
>  {
> +	if ( !early_info.gic.gic_dist_addr ||

Some hard tabs have snuck in here.

> +			!early_info.gic.gic_cpu_addr ||
> +			!early_info.gic.gic_hyp_addr ||
> +			!early_info.gic.gic_vcpu_addr )
> +	{
> +		printk("error: incorrect physical address of the GIC interfaces.\n");
> +		return;

Maybe panic() here (and below) rather than printk?

> +	}
> +	if ( (early_info.gic.gic_dist_addr & ((1 << PAGE_SHIFT) - 1)) ||

(foo & ~PAGE_MASK) is usual for that.

Cheers,

Tim.

> +			(early_info.gic.gic_cpu_addr & ((1 << PAGE_SHIFT) - 1)) ||
> +			(early_info.gic.gic_hyp_addr & ((1 << PAGE_SHIFT) - 1)) ||
> +			(early_info.gic.gic_vcpu_addr & ((1 << PAGE_SHIFT) - 1)) )
> +	{
> +		printk("error: GIC interfaces not page aligned.\n");
> +		return;
> +	}
> +
>      gic.dbase = early_info.gic.gic_dist_addr;
>      gic.cbase = early_info.gic.gic_cpu_addr;
>      gic.hbase = early_info.gic.gic_hyp_addr;
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:21:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:21:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePaf-00012I-MA; Fri, 30 Nov 2012 12:21:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TePaf-000129-45
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 12:21:09 +0000
Received: from [85.158.143.35:48215] by server-3.bemta-4.messagelabs.com id
	CC/2F-06841-4B4A8B05; Fri, 30 Nov 2012 12:21:08 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354278067!4636363!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19949 invoked from network); 30 Nov 2012 12:21:07 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 12:21:07 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16090496"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 12:20:41 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 12:20:41 +0000
Message-ID: <1354278039.6269.143.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Tim (Xen.org)" <tim@xen.org>
Date: Fri, 30 Nov 2012 12:20:39 +0000
In-Reply-To: <1354212300.6269.68.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352824724.7491.103.camel@zakaz.uk.xensource.com>
	<20121129175923.GL80627@ocelot.phlegethon.org>
	<1354212300.6269.68.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2 00/12] arm: support for initial modules
 (e.g. dom0) and DTB supplied in RAM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 18:05 +0000, Ian Campbell wrote:
> On Thu, 2012-11-29 at 17:59 +0000, Tim Deegan wrote:
> > Right.  For 1, 2, 3, 6 and 11:
> > 
> > Acked-by: Tim Deegan <tim@xen.org>
> > 
> > 5, 7 and 10 already have my Ack on them.  4, 8, 9 and 12 need some more
> > attention.
> 
> Thanks!
> 
> I'll see what I can sweep through into the tree (perhaps tomorrow) given
> this set of acks and then look at addressing your comments on the rest.

Thanks, I have applied 1-3 & 7:
arm: Enable build without CONFIG_DTB_FILE
arm: create a raw binary target.
arm: handle xenheap which isn't at the start of RAM.
arm: const-correctness in virt_to_maddr

The rest of the acked ones didn't make sense without some of the unacked
ones.

> 
> Cheers,
> Ian.
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:21:23 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:21:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePaf-00012I-MA; Fri, 30 Nov 2012 12:21:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TePaf-000129-45
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 12:21:09 +0000
Received: from [85.158.143.35:48215] by server-3.bemta-4.messagelabs.com id
	CC/2F-06841-4B4A8B05; Fri, 30 Nov 2012 12:21:08 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1354278067!4636363!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19949 invoked from network); 30 Nov 2012 12:21:07 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 12:21:07 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16090496"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 12:20:41 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 12:20:41 +0000
Message-ID: <1354278039.6269.143.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Tim (Xen.org)" <tim@xen.org>
Date: Fri, 30 Nov 2012 12:20:39 +0000
In-Reply-To: <1354212300.6269.68.camel@zakaz.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352824724.7491.103.camel@zakaz.uk.xensource.com>
	<20121129175923.GL80627@ocelot.phlegethon.org>
	<1354212300.6269.68.camel@zakaz.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH V2 00/12] arm: support for initial modules
 (e.g. dom0) and DTB supplied in RAM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 2012-11-29 at 18:05 +0000, Ian Campbell wrote:
> On Thu, 2012-11-29 at 17:59 +0000, Tim Deegan wrote:
> > Right.  For 1, 2, 3, 6 and 11:
> > 
> > Acked-by: Tim Deegan <tim@xen.org>
> > 
> > 5, 7 and 10 already have my Ack on them.  4, 8, 9 and 12 need some more
> > attention.
> 
> Thanks!
> 
> I'll see what I can sweep through into the tree (perhaps tomorrow) given
> this set of acks and then look at addressing your comments on the rest.

Thanks, I have applied 1-3 & 7:
arm: Enable build without CONFIG_DTB_FILE
arm: create a raw binary target.
arm: handle xenheap which isn't at the start of RAM.
arm: const-correctness in virt_to_maddr

The rest of the acked ones didn't make sense without some of the unacked
ones.

> 
> Cheers,
> Ian.
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:21:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:21:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePb2-000194-3v; Fri, 30 Nov 2012 12:21:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TePb0-00016u-Tj
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 12:21:31 +0000
Received: from [85.158.137.99:64666] by server-13.bemta-3.messagelabs.com id
	81/9A-24887-5C4A8B05; Fri, 30 Nov 2012 12:21:25 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-8.tower-217.messagelabs.com!1354278014!11982347!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDk4NDk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14198 invoked from network); 30 Nov 2012 12:20:15 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-8.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 30 Nov 2012 12:20:15 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 9A9371151;
	Fri, 30 Nov 2012 14:20:14 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 3BFEAEC027; Fri, 30 Nov 2012 14:20:14 +0200 (EET)
Date: Fri, 30 Nov 2012 14:20:14 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Greg Zapp <greg.zapp@gmail.com>
Message-ID: <20121130122014.GR8912@reaktio.net>
References: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
	<20121129150736.GH8912@reaktio.net>
	<CAEHxbC1gG5RR9h9odxx59BZm2+SUdoGuwZc8Sco_yNtxVwod=Q@mail.gmail.com>
	<20121129231522.GK8912@reaktio.net>
	<CAEHxbC1pHuRc6Gb_CCWqixN-X5i_8TBabSqanS21ugLCgZ3ekg@mail.gmail.com>
	<CAEHxbC1ns+rjOMZiPt-8h-UNsjK3z4pWJaSr2TNvsL-4Ka1d+Q@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CAEHxbC1ns+rjOMZiPt-8h-UNsjK3z4pWJaSr2TNvsL-4Ka1d+Q@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Enabling NLB is crashing VM's/DRBD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 02:52:32PM +1300, Greg Zapp wrote:
>    Looks like these are the same errors as referenced in here:
>    [1]http://old-list-archives.xen.org/archives/html/xen-devel/2011-04/msg00453.html
>    .  It's indicated in that trouble could be triggered from the netback
>    code.  If so, I'm curious if some combination of the number of HVM guests
>    running and the re-connecting of the network adapter could be triggering
>    the issue?
> 
>    On Fri, Nov 30, 2012 at 1:29 PM, Greg Zapp <[2]greg.zapp@gmail.com> wrote:
> 
>      Looks like I have GPLPV 0.10.0.135 packaged in(according to the
>      changelog).  I'm using the Univention signed drivers.
> 

Hmm.. based on the changelog (http://xenbits.xen.org/ext/win-pvdrivers)
0.10.0.135 is very old version from 2009.

There have been tons of changes/fixes after that.

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:21:47 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:21:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePb2-000194-3v; Fri, 30 Nov 2012 12:21:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <pasik@iki.fi>) id 1TePb0-00016u-Tj
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 12:21:31 +0000
Received: from [85.158.137.99:64666] by server-13.bemta-3.messagelabs.com id
	81/9A-24887-5C4A8B05; Fri, 30 Nov 2012 12:21:25 +0000
X-Env-Sender: pasik@iki.fi
X-Msg-Ref: server-8.tower-217.messagelabs.com!1354278014!11982347!1
X-Originating-IP: [192.89.123.25]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjg5LjEyMy4yNSA9PiA1MDk4NDk=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14198 invoked from network); 30 Nov 2012 12:20:15 -0000
Received: from smtp.tele.fi (HELO smtp.tele.fi) (192.89.123.25)
	by server-8.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 30 Nov 2012 12:20:15 -0000
X-Originating-Ip: [194.89.68.22]
Received: from ydin.reaktio.net (reaktio.net [194.89.68.22])
	by smtp.tele.fi (Postfix) with ESMTP id 9A9371151;
	Fri, 30 Nov 2012 14:20:14 +0200 (EET)
Received: by ydin.reaktio.net (Postfix, from userid 1001)
	id 3BFEAEC027; Fri, 30 Nov 2012 14:20:14 +0200 (EET)
Date: Fri, 30 Nov 2012 14:20:14 +0200
From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= <pasik@iki.fi>
To: Greg Zapp <greg.zapp@gmail.com>
Message-ID: <20121130122014.GR8912@reaktio.net>
References: <CAEHxbC3AVBR6OmnFShnORtDb94B3aC3tcudg0rfZ1xb6bKBu=w@mail.gmail.com>
	<20121129150736.GH8912@reaktio.net>
	<CAEHxbC1gG5RR9h9odxx59BZm2+SUdoGuwZc8Sco_yNtxVwod=Q@mail.gmail.com>
	<20121129231522.GK8912@reaktio.net>
	<CAEHxbC1pHuRc6Gb_CCWqixN-X5i_8TBabSqanS21ugLCgZ3ekg@mail.gmail.com>
	<CAEHxbC1ns+rjOMZiPt-8h-UNsjK3z4pWJaSr2TNvsL-4Ka1d+Q@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CAEHxbC1ns+rjOMZiPt-8h-UNsjK3z4pWJaSr2TNvsL-4Ka1d+Q@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Enabling NLB is crashing VM's/DRBD
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 02:52:32PM +1300, Greg Zapp wrote:
>    Looks like these are the same errors as referenced in here:
>    [1]http://old-list-archives.xen.org/archives/html/xen-devel/2011-04/msg00453.html
>    .  It's indicated in that trouble could be triggered from the netback
>    code.  If so, I'm curious if some combination of the number of HVM guests
>    running and the re-connecting of the network adapter could be triggering
>    the issue?
> 
>    On Fri, Nov 30, 2012 at 1:29 PM, Greg Zapp <[2]greg.zapp@gmail.com> wrote:
> 
>      Looks like I have GPLPV 0.10.0.135 packaged in(according to the
>      changelog).  I'm using the Univention signed drivers.
> 

Hmm.. based on the changelog (http://xenbits.xen.org/ext/win-pvdrivers)
0.10.0.135 is very old version from 2009.

There have been tons of changes/fixes after that.

-- Pasi


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:25:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:25:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePf1-0001Uo-4Q; Fri, 30 Nov 2012 12:25:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TePey-0001Uc-US
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 12:25:37 +0000
Received: from [193.109.254.147:39254] by server-15.bemta-14.messagelabs.com
	id 45/5E-12105-0C5A8B05; Fri, 30 Nov 2012 12:25:36 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1354278334!2070632!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7751 invoked from network); 30 Nov 2012 12:25:35 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 12:25:35 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46155375"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 12:25:33 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 07:25:33 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TePev-0001Yu-8l;
	Fri, 30 Nov 2012 12:25:33 +0000
Date: Fri, 30 Nov 2012 12:25:28 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: David Vrabel <david.vrabel@citrix.com>
In-Reply-To: <50B897E1.70306@citrix.com>
Message-ID: <alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<50B897E1.70306@citrix.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 30 Nov 2012, David Vrabel wrote:
> On 23/11/12 15:21, Stefano Stabellini wrote:
> > Get the address of the GIC distributor, cpu, virtual and virtual cpu
> > interfaces registers from device tree.
> 
> The original intention of the early DTB parsing was to get the minimum
> of info needed before the DTB could be translated into a more useful
> form (similar to what Linux does).
> 
> Is this something that is still being considered in the long term?  If
> so, should the GIC be initialized from this translated form, instead of
> using the early parsing?

Regardless of the final form of DT parsing in Xen, I think that CPU,
memory and GIC are the three things that should be parsed early.


> > Note: I couldn't completely get rid of GIC_BASE_ADDRESS, GIC_DR_OFFSET
> > and friends because we are using them from mode_switch.S, that is
> > executed before device tree has been parsed. But at least mode_switch.S
> > is known to contain vexpress specific code anyway.
> > 
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > 
> [...]
> > diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> > index da0af77..79b1dd1 100644
> > --- a/xen/common/device_tree.c
> > +++ b/xen/common/device_tree.c
> > @@ -54,6 +54,27 @@ bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
> >      return !strncmp(prop, match, len);
> >  }
> >  
> > +bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)
> > +{
> > +    int len, l;
> > +    const void *prop;
> > +
> > +    prop = fdt_getprop(fdt, node, "compatible", &len);
> > +    if ( prop == NULL )
> > +        return 0;
> > +
> > +    while ( len > 0 ) {
> > +        if ( !strncmp(prop, match, strlen(match)) )
> > +            return 1;
> > +        l = strlen(prop) + 1;
> > +        prop += l;
> > +        len -= l;
> > +    }
> 
> This doesn't look right.  Don't you need to split the prop string on
> comma boundaries?

Nope, the compatible string to match is, for example, the entirety of
"arm,cortex-a15-gic", or alternatively "arm,cortex-a9-gic". Trying to
match just "cortex-a15-gic" would be incorrect.
This is what Linux does too.


> > +    return 0;
> > +}
> > +
> > +
> >  static void __init get_val(const u32 **cell, u32 cells, u64 *val)
> >  {
> >      *val = 0;
> > @@ -270,6 +291,50 @@ static void __init process_cpu_node(const void *fdt, int node,
> >      cpumask_set_cpu(start, &cpu_possible_map);
> >  }
> >  
> > +static void __init process_gic_node(const void *fdt, int node,
> > +                                    const char *name,
> > +                                    u32 address_cells, u32 size_cells)
> > +{
> > +    const struct fdt_property *prop;
> > +    const u32 *cell;
> > +    paddr_t start, size;
> > +    int reg_cells, interfaces;
> > +
> > +    if ( address_cells < 1 || size_cells < 1 )
> > +    {
> > +        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
> > +                     name);
> > +        return;
> > +    }
> > +
> > +    prop = fdt_get_property(fdt, node, "reg", NULL);
> > +    if ( !prop )
> > +    {
> > +        early_printk("fdt: node `%s': missing `reg' property\n", name);
> > +        return;
> > +    }
> > +
> > +    cell = (const u32 *)prop->data;
> > +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> 
> Is this needed?  This cell is reread below.

Yes, because device_tree_get_reg increments the cell pointer

> > +
> > +    cell = (const u32 *)prop->data;
> > +    reg_cells = address_cells + size_cells;
> > +    interfaces = fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32));
> 
> Perhaps wrap this in a helper function?  Look like it might be useful
> elsewhere.

OK


> > +    if ( interfaces < 4 )
> > +    {
> > +        early_printk("fdt: node `%s': invalid `reg' property\n", name);
> > +        return;
> > +    }
> > +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> > +    early_info.gic.gic_dist_addr = start;
> > +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> > +    early_info.gic.gic_cpu_addr = start;
> > +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> > +    early_info.gic.gic_hyp_addr = start;
> > +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> > +    early_info.gic.gic_vcpu_addr = start;
> 
> Is the GIC driver still hardcoding the register region sizes?  Or does
> it not need the size?

Yes, it is. However we do know the size of all the GIC interfaces
because they are specified in the GIC docs.


> > +}
> > +
> >  static int __init early_scan_node(const void *fdt,
> >                                    int node, const char *name, int depth,
> >                                    u32 address_cells, u32 size_cells,
> > @@ -279,6 +344,8 @@ static int __init early_scan_node(const void *fdt,
> >          process_memory_node(fdt, node, name, address_cells, size_cells);
> >      else if ( device_tree_type_matches(fdt, node, "cpu") )
> >          process_cpu_node(fdt, node, name, address_cells, size_cells);
> > +    else if ( device_tree_node_compatible(fdt, node, "arm,cortex-a15-gic") )
> > +        process_gic_node(fdt, node, name, address_cells, size_cells);
> 
> Long term, I don't think you want a long list of all the different
> interrupt controllers here.

Well, in practice there is just one interrupt controller in the ARMv7
and ARMv8 worlds right now, that is the GIC. I don't think that's going
to change anytime soon.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:25:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:25:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePf1-0001Uo-4Q; Fri, 30 Nov 2012 12:25:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TePey-0001Uc-US
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 12:25:37 +0000
Received: from [193.109.254.147:39254] by server-15.bemta-14.messagelabs.com
	id 45/5E-12105-0C5A8B05; Fri, 30 Nov 2012 12:25:36 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1354278334!2070632!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7751 invoked from network); 30 Nov 2012 12:25:35 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 12:25:35 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46155375"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 12:25:33 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 07:25:33 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TePev-0001Yu-8l;
	Fri, 30 Nov 2012 12:25:33 +0000
Date: Fri, 30 Nov 2012 12:25:28 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: David Vrabel <david.vrabel@citrix.com>
In-Reply-To: <50B897E1.70306@citrix.com>
Message-ID: <alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<50B897E1.70306@citrix.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 30 Nov 2012, David Vrabel wrote:
> On 23/11/12 15:21, Stefano Stabellini wrote:
> > Get the address of the GIC distributor, cpu, virtual and virtual cpu
> > interfaces registers from device tree.
> 
> The original intention of the early DTB parsing was to get the minimum
> of info needed before the DTB could be translated into a more useful
> form (similar to what Linux does).
> 
> Is this something that is still being considered in the long term?  If
> so, should the GIC be initialized from this translated form, instead of
> using the early parsing?

Regardless of the final form of DT parsing in Xen, I think that CPU,
memory and GIC are the three things that should be parsed early.


> > Note: I couldn't completely get rid of GIC_BASE_ADDRESS, GIC_DR_OFFSET
> > and friends because we are using them from mode_switch.S, that is
> > executed before device tree has been parsed. But at least mode_switch.S
> > is known to contain vexpress specific code anyway.
> > 
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > 
> [...]
> > diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> > index da0af77..79b1dd1 100644
> > --- a/xen/common/device_tree.c
> > +++ b/xen/common/device_tree.c
> > @@ -54,6 +54,27 @@ bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
> >      return !strncmp(prop, match, len);
> >  }
> >  
> > +bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)
> > +{
> > +    int len, l;
> > +    const void *prop;
> > +
> > +    prop = fdt_getprop(fdt, node, "compatible", &len);
> > +    if ( prop == NULL )
> > +        return 0;
> > +
> > +    while ( len > 0 ) {
> > +        if ( !strncmp(prop, match, strlen(match)) )
> > +            return 1;
> > +        l = strlen(prop) + 1;
> > +        prop += l;
> > +        len -= l;
> > +    }
> 
> This doesn't look right.  Don't you need to split the prop string on
> comma boundaries?

Nope, the compatible string to match is, for example, the entirety of
"arm,cortex-a15-gic", or alternatively "arm,cortex-a9-gic". Trying to
match just "cortex-a15-gic" would be incorrect.
This is what Linux does too.


> > +    return 0;
> > +}
> > +
> > +
> >  static void __init get_val(const u32 **cell, u32 cells, u64 *val)
> >  {
> >      *val = 0;
> > @@ -270,6 +291,50 @@ static void __init process_cpu_node(const void *fdt, int node,
> >      cpumask_set_cpu(start, &cpu_possible_map);
> >  }
> >  
> > +static void __init process_gic_node(const void *fdt, int node,
> > +                                    const char *name,
> > +                                    u32 address_cells, u32 size_cells)
> > +{
> > +    const struct fdt_property *prop;
> > +    const u32 *cell;
> > +    paddr_t start, size;
> > +    int reg_cells, interfaces;
> > +
> > +    if ( address_cells < 1 || size_cells < 1 )
> > +    {
> > +        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
> > +                     name);
> > +        return;
> > +    }
> > +
> > +    prop = fdt_get_property(fdt, node, "reg", NULL);
> > +    if ( !prop )
> > +    {
> > +        early_printk("fdt: node `%s': missing `reg' property\n", name);
> > +        return;
> > +    }
> > +
> > +    cell = (const u32 *)prop->data;
> > +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> 
> Is this needed?  This cell is reread below.

Yes, because device_tree_get_reg increments the cell pointer

> > +
> > +    cell = (const u32 *)prop->data;
> > +    reg_cells = address_cells + size_cells;
> > +    interfaces = fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32));
> 
> Perhaps wrap this in a helper function?  Look like it might be useful
> elsewhere.

OK


> > +    if ( interfaces < 4 )
> > +    {
> > +        early_printk("fdt: node `%s': invalid `reg' property\n", name);
> > +        return;
> > +    }
> > +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> > +    early_info.gic.gic_dist_addr = start;
> > +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> > +    early_info.gic.gic_cpu_addr = start;
> > +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> > +    early_info.gic.gic_hyp_addr = start;
> > +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> > +    early_info.gic.gic_vcpu_addr = start;
> 
> Is the GIC driver still hardcoding the register region sizes?  Or does
> it not need the size?

Yes, it is. However we do know the size of all the GIC interfaces
because they are specified in the GIC docs.


> > +}
> > +
> >  static int __init early_scan_node(const void *fdt,
> >                                    int node, const char *name, int depth,
> >                                    u32 address_cells, u32 size_cells,
> > @@ -279,6 +344,8 @@ static int __init early_scan_node(const void *fdt,
> >          process_memory_node(fdt, node, name, address_cells, size_cells);
> >      else if ( device_tree_type_matches(fdt, node, "cpu") )
> >          process_cpu_node(fdt, node, name, address_cells, size_cells);
> > +    else if ( device_tree_node_compatible(fdt, node, "arm,cortex-a15-gic") )
> > +        process_gic_node(fdt, node, name, address_cells, size_cells);
> 
> Long term, I don't think you want a long list of all the different
> interrupt controllers here.

Well, in practice there is just one interrupt controller in the ARMv7
and ARMv8 worlds right now, that is the GIC. I don't think that's going
to change anytime soon.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:29:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:29:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePiR-0001fQ-P1; Fri, 30 Nov 2012 12:29:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TePiR-0001fI-16
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 12:29:11 +0000
Received: from [85.158.143.35:19102] by server-3.bemta-4.messagelabs.com id
	1D/B9-06841-696A8B05; Fri, 30 Nov 2012 12:29:10 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1354278547!11283104!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY5NDIy\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11414 invoked from network); 30 Nov 2012 12:29:08 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-11.tower-21.messagelabs.com with SMTP;
	30 Nov 2012 12:29:08 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 30 Nov 2012 04:28:22 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,191,1355126400"; d="scan'208";a="227127095"
Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35])
	by orsmga001.jf.intel.com with ESMTP; 30 Nov 2012 04:29:06 -0800
Received: from fmsmsx102.amr.corp.intel.com (10.19.9.53) by
	FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 30 Nov 2012 04:29:05 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX102.amr.corp.intel.com (10.19.9.53) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 30 Nov 2012 04:29:05 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Fri, 30 Nov 2012 20:29:03 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>
Thread-Topic: ATS and dependent features
Thread-Index: AQHNzINiSOuk8WhZTUOv61PMlYmAhZgAAhig///uAQCAAJGFcP//hsAAgAJJkKA=
Date: Fri, 30 Nov 2012 12:29:02 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A483456440339B365@SHSMSX101.ccr.corp.intel.com>
References: <50B498E502000078000AB8B3@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403398F24@SHSMSX101.ccr.corp.intel.com>
	<50B7243602000078000AC61A@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033994C8@SHSMSX101.ccr.corp.intel.com>
	<50B7389202000078000AC669@nat28.tlf.novell.com>
In-Reply-To: <50B7389202000078000AC669@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Zhang, Xiantao" <xiantao.zhang@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] ATS and dependent features
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Thursday, November 29, 2012 5:28 PM
> To: Zhang, Xiantao
> Cc: xen-devel
> Subject: RE: ATS and dependent features
> 
> >>> On 29.11.12 at 10:19, "Zhang, Xiantao" <xiantao.zhang@intel.com>
> wrote:
> 
> >
> >> -----Original Message-----
> >> From: Jan Beulich [mailto:JBeulich@suse.com]
> >> Sent: Thursday, November 29, 2012 4:01 PM
> >> To: Zhang, Xiantao
> >> Cc: xen-devel
> >> Subject: RE: ATS and dependent features
> >>
> >> >>> On 29.11.12 at 02:07, "Zhang, Xiantao" <xiantao.zhang@intel.com>
> >> wrote:
> >> > ATS should be a host feature controlled by iommu, and I don't think
> >> > dom0 can control  it from Xen's architecture.
> >>
> >> "Can" or "should"? Because from all I can tell it currently clearly does.
> >
> > I mean Xen shouldn't  allow these capabilities can be detected by
> > dom0.  If it does, we need to fix it.
> 
> It sort of hides it - all callers sit in the kernel's IOMMU code, and IOMMU
> detection is being prevented. So it looks like the code is simply dead when
> running on top of Xen.

I'm curious why dom0's !Xen kernel option for these features can solve the issue you met. 

> >> >   Perhaps we need to forbid dom0 controlling these features.
> >>
> >> That's what I was trying to find out. How to properly do that with
> >> pv-ops I don't know; in our forward ported kernels I can simply make
> >> the respective config options conditional upon !XEN.
> >
> > As to the clean solution, Xen should intercept all the accesses to the
> > device's PCI config space from dom0, and emulates the related registers.
> 
> Why? That would e.g. make lspci completely unreliable.

yes,  if these capabilities are completely virtualized, lspci should be  break. 
Xiantao 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:29:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:29:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePiR-0001fQ-P1; Fri, 30 Nov 2012 12:29:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TePiR-0001fI-16
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 12:29:11 +0000
Received: from [85.158.143.35:19102] by server-3.bemta-4.messagelabs.com id
	1D/B9-06841-696A8B05; Fri, 30 Nov 2012 12:29:10 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1354278547!11283104!1
X-Originating-IP: [134.134.136.24]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzY5NDIy\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11414 invoked from network); 30 Nov 2012 12:29:08 -0000
Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24)
	by server-11.tower-21.messagelabs.com with SMTP;
	30 Nov 2012 12:29:08 -0000
Received: from orsmga001.jf.intel.com ([10.7.209.18])
	by orsmga102.jf.intel.com with ESMTP; 30 Nov 2012 04:28:22 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,191,1355126400"; d="scan'208";a="227127095"
Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35])
	by orsmga001.jf.intel.com with ESMTP; 30 Nov 2012 04:29:06 -0800
Received: from fmsmsx102.amr.corp.intel.com (10.19.9.53) by
	FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 30 Nov 2012 04:29:05 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX102.amr.corp.intel.com (10.19.9.53) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 30 Nov 2012 04:29:05 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Fri, 30 Nov 2012 20:29:03 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>
Thread-Topic: ATS and dependent features
Thread-Index: AQHNzINiSOuk8WhZTUOv61PMlYmAhZgAAhig///uAQCAAJGFcP//hsAAgAJJkKA=
Date: Fri, 30 Nov 2012 12:29:02 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A483456440339B365@SHSMSX101.ccr.corp.intel.com>
References: <50B498E502000078000AB8B3@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A4834564403398F24@SHSMSX101.ccr.corp.intel.com>
	<50B7243602000078000AC61A@nat28.tlf.novell.com>
	<B6C2EB9186482D47BD0C5A9A48345644033994C8@SHSMSX101.ccr.corp.intel.com>
	<50B7389202000078000AC669@nat28.tlf.novell.com>
In-Reply-To: <50B7389202000078000AC669@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Zhang, Xiantao" <xiantao.zhang@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] ATS and dependent features
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Thursday, November 29, 2012 5:28 PM
> To: Zhang, Xiantao
> Cc: xen-devel
> Subject: RE: ATS and dependent features
> 
> >>> On 29.11.12 at 10:19, "Zhang, Xiantao" <xiantao.zhang@intel.com>
> wrote:
> 
> >
> >> -----Original Message-----
> >> From: Jan Beulich [mailto:JBeulich@suse.com]
> >> Sent: Thursday, November 29, 2012 4:01 PM
> >> To: Zhang, Xiantao
> >> Cc: xen-devel
> >> Subject: RE: ATS and dependent features
> >>
> >> >>> On 29.11.12 at 02:07, "Zhang, Xiantao" <xiantao.zhang@intel.com>
> >> wrote:
> >> > ATS should be a host feature controlled by iommu, and I don't think
> >> > dom0 can control  it from Xen's architecture.
> >>
> >> "Can" or "should"? Because from all I can tell it currently clearly does.
> >
> > I mean Xen shouldn't  allow these capabilities can be detected by
> > dom0.  If it does, we need to fix it.
> 
> It sort of hides it - all callers sit in the kernel's IOMMU code, and IOMMU
> detection is being prevented. So it looks like the code is simply dead when
> running on top of Xen.

I'm curious why dom0's !Xen kernel option for these features can solve the issue you met. 

> >> >   Perhaps we need to forbid dom0 controlling these features.
> >>
> >> That's what I was trying to find out. How to properly do that with
> >> pv-ops I don't know; in our forward ported kernels I can simply make
> >> the respective config options conditional upon !XEN.
> >
> > As to the clean solution, Xen should intercept all the accesses to the
> > device's PCI config space from dom0, and emulates the related registers.
> 
> Why? That would e.g. make lspci completely unreliable.

yes,  if these capabilities are completely virtualized, lspci should be  break. 
Xiantao 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:29:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:29:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePij-0001i0-5y; Fri, 30 Nov 2012 12:29:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TePih-0001hR-Rd
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 12:29:28 +0000
Received: from [85.158.139.83:60179] by server-1.bemta-5.messagelabs.com id
	B6/62-09311-7A6A8B05; Fri, 30 Nov 2012 12:29:27 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1354278566!27722875!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4609 invoked from network); 30 Nov 2012 12:29:26 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 12:29:26 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16090670"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 12:29:26 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 12:29:26 +0000
Message-ID: <1354278564.6269.144.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Fri, 30 Nov 2012 12:29:24 +0000
In-Reply-To: <alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<50B897E1.70306@citrix.com>
	<alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	David Vrabel <david.vrabel@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-30 at 12:25 +0000, Stefano Stabellini wrote:
> 
> 
> > > +    if ( interfaces < 4 )
> > > +    {
> > > +        early_printk("fdt: node `%s': invalid `reg' property\n",
> name);
> > > +        return;
> > > +    }
> > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> &size);
> > > +    early_info.gic.gic_dist_addr = start;
> > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> &size);
> > > +    early_info.gic.gic_cpu_addr = start;
> > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> &size);
> > > +    early_info.gic.gic_hyp_addr = start;
> > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> &size);
> > > +    early_info.gic.gic_vcpu_addr = start;
> > 
> > Is the GIC driver still hardcoding the register region sizes?  Or
> does
> > it not need the size?
> 
> Yes, it is. However we do know the size of all the GIC interfaces
> because they are specified in the GIC docs.

Perhaps we ought to check that the size given meets (either == or >=)
our expectations?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:29:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:29:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePij-0001i0-5y; Fri, 30 Nov 2012 12:29:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TePih-0001hR-Rd
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 12:29:28 +0000
Received: from [85.158.139.83:60179] by server-1.bemta-5.messagelabs.com id
	B6/62-09311-7A6A8B05; Fri, 30 Nov 2012 12:29:27 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1354278566!27722875!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4609 invoked from network); 30 Nov 2012 12:29:26 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 12:29:26 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16090670"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 12:29:26 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 12:29:26 +0000
Message-ID: <1354278564.6269.144.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Fri, 30 Nov 2012 12:29:24 +0000
In-Reply-To: <alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<50B897E1.70306@citrix.com>
	<alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	David Vrabel <david.vrabel@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-30 at 12:25 +0000, Stefano Stabellini wrote:
> 
> 
> > > +    if ( interfaces < 4 )
> > > +    {
> > > +        early_printk("fdt: node `%s': invalid `reg' property\n",
> name);
> > > +        return;
> > > +    }
> > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> &size);
> > > +    early_info.gic.gic_dist_addr = start;
> > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> &size);
> > > +    early_info.gic.gic_cpu_addr = start;
> > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> &size);
> > > +    early_info.gic.gic_hyp_addr = start;
> > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> &size);
> > > +    early_info.gic.gic_vcpu_addr = start;
> > 
> > Is the GIC driver still hardcoding the register region sizes?  Or
> does
> > it not need the size?
> 
> Yes, it is. However we do know the size of all the GIC interfaces
> because they are specified in the GIC docs.

Perhaps we ought to check that the size given meets (either == or >=)
our expectations?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:32:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:32:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePl7-00027l-Qk; Fri, 30 Nov 2012 12:31:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TePl6-00027a-IW
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 12:31:56 +0000
Received: from [85.158.137.99:51980] by server-10.bemta-3.messagelabs.com id
	12/C4-19806-B37A8B05; Fri, 30 Nov 2012 12:31:55 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1354278713!17320327!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjM1MjEw\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13170 invoked from network); 30 Nov 2012 12:31:55 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-14.tower-217.messagelabs.com with SMTP;
	30 Nov 2012 12:31:55 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga102.ch.intel.com with ESMTP; 30 Nov 2012 04:31:52 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,191,1355126400"; d="scan'208";a="224731206"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by azsmga001.ch.intel.com with ESMTP; 30 Nov 2012 04:31:52 -0800
Received: from fmsmsx153.amr.corp.intel.com (10.19.17.7) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 30 Nov 2012 04:31:52 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX153.amr.corp.intel.com (10.19.17.7) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 30 Nov 2012 04:31:51 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Fri, 30 Nov 2012 20:31:50 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Thread-Topic: [PATCH, RFC 6.5/7] VT-d: relax source qualifier for MSI of
	phantom functions
Thread-Index: AQHNztMOWvDi6S+o+keJxbBpK2qZ2JgCT52g
Date: Fri, 30 Nov 2012 12:31:49 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A483456440339B388@SHSMSX101.ccr.corp.intel.com>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
	<50B8798502000078000ACBD1@nat28.tlf.novell.com>
In-Reply-To: <50B8798502000078000ACBD1@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Zhang, Xiantao" <xiantao.zhang@intel.com>
Subject: Re: [Xen-devel] [PATCH,
 RFC 6.5/7] VT-d: relax source qualifier for MSI of phantom functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Acked, thanks!
Xiantao 

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Friday, November 30, 2012 4:17 PM
> To: xen-devel
> Cc: Zhang, Xiantao
> Subject: [PATCH, RFC 6.5/7] VT-d: relax source qualifier for MSI of phantom
> functions
> 
> With ordinary requests allowed to come from phantom functions, the
> remapping tables ought to be set up to also allow for MSI triggers to come
> from other than the "real" device.
> ---
> As the numbering tries to indicate, this ought to go between the 6th and 7th
> patch of the previously sent series.
> 
> --- a/xen/drivers/passthrough/vtd/intremap.c
> +++ b/xen/drivers/passthrough/vtd/intremap.c
> @@ -442,13 +442,22 @@ static void set_msi_source_id(struct pci
>      devfn = pdev->devfn;
>      switch ( pdev->type )
>      {
> +        unsigned int sq;
> +
>      case DEV_TYPE_PCIe_BRIDGE:
>      case DEV_TYPE_PCIe2PCI_BRIDGE:
>      case DEV_TYPE_LEGACY_PCI_BRIDGE:
>          break;
> 
>      case DEV_TYPE_PCIe_ENDPOINT:
> -        set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_ALL_16, PCI_BDF2(bus,
> devfn));
> +        switch ( pdev->phantom_stride )
> +        {
> +        case 1: sq = SQ_13_IGNORE_3; break;
> +        case 2: sq = SQ_13_IGNORE_2; break;
> +        case 4: sq = SQ_13_IGNORE_1; break;
> +        default: sq = SQ_ALL_16; break;
> +        }
> +        set_ire_sid(ire, SVT_VERIFY_SID_SQ, sq, PCI_BDF2(bus, devfn));
>          break;
> 
>      case DEV_TYPE_PCI:
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:32:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:32:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePl7-00027l-Qk; Fri, 30 Nov 2012 12:31:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xiantao.zhang@intel.com>) id 1TePl6-00027a-IW
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 12:31:56 +0000
Received: from [85.158.137.99:51980] by server-10.bemta-3.messagelabs.com id
	12/C4-19806-B37A8B05; Fri, 30 Nov 2012 12:31:55 +0000
X-Env-Sender: xiantao.zhang@intel.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1354278713!17320327!1
X-Originating-IP: [143.182.124.37]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMzcgPT4gMjM1MjEw\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13170 invoked from network); 30 Nov 2012 12:31:55 -0000
Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37)
	by server-14.tower-217.messagelabs.com with SMTP;
	30 Nov 2012 12:31:55 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga102.ch.intel.com with ESMTP; 30 Nov 2012 04:31:52 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,191,1355126400"; d="scan'208";a="224731206"
Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34])
	by azsmga001.ch.intel.com with ESMTP; 30 Nov 2012 04:31:52 -0800
Received: from fmsmsx153.amr.corp.intel.com (10.19.17.7) by
	FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 30 Nov 2012 04:31:52 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
	FMSMSX153.amr.corp.intel.com (10.19.17.7) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 30 Nov 2012 04:31:51 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX151.ccr.corp.intel.com ([169.254.3.9]) with mapi id
	14.01.0355.002; Fri, 30 Nov 2012 20:31:50 +0800
From: "Zhang, Xiantao" <xiantao.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Thread-Topic: [PATCH, RFC 6.5/7] VT-d: relax source qualifier for MSI of
	phantom functions
Thread-Index: AQHNztMOWvDi6S+o+keJxbBpK2qZ2JgCT52g
Date: Fri, 30 Nov 2012 12:31:49 +0000
Message-ID: <B6C2EB9186482D47BD0C5A9A483456440339B388@SHSMSX101.ccr.corp.intel.com>
References: <50B5EA6502000078000AC0FA@nat28.tlf.novell.com>
	<50B8798502000078000ACBD1@nat28.tlf.novell.com>
In-Reply-To: <50B8798502000078000ACBD1@nat28.tlf.novell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "Zhang, Xiantao" <xiantao.zhang@intel.com>
Subject: Re: [Xen-devel] [PATCH,
 RFC 6.5/7] VT-d: relax source qualifier for MSI of phantom functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Acked, thanks!
Xiantao 

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Friday, November 30, 2012 4:17 PM
> To: xen-devel
> Cc: Zhang, Xiantao
> Subject: [PATCH, RFC 6.5/7] VT-d: relax source qualifier for MSI of phantom
> functions
> 
> With ordinary requests allowed to come from phantom functions, the
> remapping tables ought to be set up to also allow for MSI triggers to come
> from other than the "real" device.
> ---
> As the numbering tries to indicate, this ought to go between the 6th and 7th
> patch of the previously sent series.
> 
> --- a/xen/drivers/passthrough/vtd/intremap.c
> +++ b/xen/drivers/passthrough/vtd/intremap.c
> @@ -442,13 +442,22 @@ static void set_msi_source_id(struct pci
>      devfn = pdev->devfn;
>      switch ( pdev->type )
>      {
> +        unsigned int sq;
> +
>      case DEV_TYPE_PCIe_BRIDGE:
>      case DEV_TYPE_PCIe2PCI_BRIDGE:
>      case DEV_TYPE_LEGACY_PCI_BRIDGE:
>          break;
> 
>      case DEV_TYPE_PCIe_ENDPOINT:
> -        set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_ALL_16, PCI_BDF2(bus,
> devfn));
> +        switch ( pdev->phantom_stride )
> +        {
> +        case 1: sq = SQ_13_IGNORE_3; break;
> +        case 2: sq = SQ_13_IGNORE_2; break;
> +        case 4: sq = SQ_13_IGNORE_1; break;
> +        default: sq = SQ_ALL_16; break;
> +        }
> +        set_ire_sid(ire, SVT_VERIFY_SID_SQ, sq, PCI_BDF2(bus, devfn));
>          break;
> 
>      case DEV_TYPE_PCI:
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:39:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:39:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePrs-0002ON-BO; Fri, 30 Nov 2012 12:38:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TePrq-0002O9-R8
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 12:38:55 +0000
Received: from [85.158.143.99:8240] by server-2.bemta-4.messagelabs.com id
	81/A2-28922-ED8A8B05; Fri, 30 Nov 2012 12:38:54 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1354279132!27392679!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29103 invoked from network); 30 Nov 2012 12:38:53 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 12:38:53 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46156137"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 12:38:35 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 07:38:34 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TePrW-0001jn-8i;
	Fri, 30 Nov 2012 12:38:34 +0000
Date: Fri, 30 Nov 2012 12:38:29 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: <xen-devel@lists.xensource.com>
Message-ID: <alpine.DEB.2.02.1211301236230.5310@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Tim Deegan <tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH v2] arm: add few checks to gic_init
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Check for:
- uninitialized GIC interface addresses;
- non-page aligned GIC interface addresses.

Panic in both cases.
Also remove the code from GICH and GICC to handle non-page aligned
interfaces.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 8efbeb3..2b29e7e 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -34,10 +34,8 @@
 
 /* Access to the GIC Distributor registers through the fixmap */
 #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
-#define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
-                                     + ((uint32_t) gic.cbase & 0xfff)))
-#define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
-                                     + ((uint32_t) gic.hbase & 0xfff)))
+#define GICC ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICC1)) 
+#define GICH ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICH))
 static void gic_restore_pending_irqs(struct vcpu *v);
 
 /* Global state */
@@ -308,6 +306,23 @@ static void __cpuinit gic_hyp_disable(void)
 /* Set up the GIC */
 void __init gic_init(void)
 {
+    if ( !early_info.gic.gic_dist_addr ||
+         !early_info.gic.gic_cpu_addr ||
+         !early_info.gic.gic_hyp_addr ||
+         !early_info.gic.gic_vcpu_addr )
+        panic("the physical address of one of the GIC interfaces is missing:\n"
+              "        gic_dist_addr=%"PRIpaddr"\n"
+              "        gic_cpu_addr=%"PRIpaddr"\n"
+              "        gic_hyp_addr=%"PRIpaddr"\n"
+              "        gic_vcpu_addr=%"PRIpaddr"\n",
+              early_info.gic.gic_dist_addr, early_info.gic.gic_cpu_addr,
+              early_info.gic.gic_hyp_addr, early_info.gic.gic_vcpu_addr);
+    if ( (early_info.gic.gic_dist_addr & ~PAGE_MASK) ||
+         (early_info.gic.gic_cpu_addr & ~PAGE_MASK) ||
+         (early_info.gic.gic_hyp_addr & ~PAGE_MASK) ||
+         (early_info.gic.gic_vcpu_addr & ~PAGE_MASK) )
+        panic("error: GIC interfaces not page aligned.\n");
+
     gic.dbase = early_info.gic.gic_dist_addr;
     gic.cbase = early_info.gic.gic_cpu_addr;
     gic.hbase = early_info.gic.gic_hyp_addr;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:39:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:39:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TePrs-0002ON-BO; Fri, 30 Nov 2012 12:38:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TePrq-0002O9-R8
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 12:38:55 +0000
Received: from [85.158.143.99:8240] by server-2.bemta-4.messagelabs.com id
	81/A2-28922-ED8A8B05; Fri, 30 Nov 2012 12:38:54 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1354279132!27392679!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29103 invoked from network); 30 Nov 2012 12:38:53 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 12:38:53 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46156137"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 12:38:35 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 07:38:34 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TePrW-0001jn-8i;
	Fri, 30 Nov 2012 12:38:34 +0000
Date: Fri, 30 Nov 2012 12:38:29 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: <xen-devel@lists.xensource.com>
Message-ID: <alpine.DEB.2.02.1211301236230.5310@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Tim Deegan <tim@xen.org>, Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH v2] arm: add few checks to gic_init
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Check for:
- uninitialized GIC interface addresses;
- non-page aligned GIC interface addresses.

Panic in both cases.
Also remove the code from GICH and GICC to handle non-page aligned
interfaces.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 8efbeb3..2b29e7e 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -34,10 +34,8 @@
 
 /* Access to the GIC Distributor registers through the fixmap */
 #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
-#define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
-                                     + ((uint32_t) gic.cbase & 0xfff)))
-#define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
-                                     + ((uint32_t) gic.hbase & 0xfff)))
+#define GICC ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICC1)) 
+#define GICH ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICH))
 static void gic_restore_pending_irqs(struct vcpu *v);
 
 /* Global state */
@@ -308,6 +306,23 @@ static void __cpuinit gic_hyp_disable(void)
 /* Set up the GIC */
 void __init gic_init(void)
 {
+    if ( !early_info.gic.gic_dist_addr ||
+         !early_info.gic.gic_cpu_addr ||
+         !early_info.gic.gic_hyp_addr ||
+         !early_info.gic.gic_vcpu_addr )
+        panic("the physical address of one of the GIC interfaces is missing:\n"
+              "        gic_dist_addr=%"PRIpaddr"\n"
+              "        gic_cpu_addr=%"PRIpaddr"\n"
+              "        gic_hyp_addr=%"PRIpaddr"\n"
+              "        gic_vcpu_addr=%"PRIpaddr"\n",
+              early_info.gic.gic_dist_addr, early_info.gic.gic_cpu_addr,
+              early_info.gic.gic_hyp_addr, early_info.gic.gic_vcpu_addr);
+    if ( (early_info.gic.gic_dist_addr & ~PAGE_MASK) ||
+         (early_info.gic.gic_cpu_addr & ~PAGE_MASK) ||
+         (early_info.gic.gic_hyp_addr & ~PAGE_MASK) ||
+         (early_info.gic.gic_vcpu_addr & ~PAGE_MASK) )
+        panic("error: GIC interfaces not page aligned.\n");
+
     gic.dbase = early_info.gic.gic_dist_addr;
     gic.cbase = early_info.gic.gic_cpu_addr;
     gic.hbase = early_info.gic.gic_hyp_addr;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:49:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:49:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeQ1S-000318-Cy; Fri, 30 Nov 2012 12:48:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TeQ1Q-000311-Qg
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 12:48:49 +0000
Received: from [85.158.138.51:48101] by server-15.bemta-3.messagelabs.com id
	EF/E7-23779-F2BA8B05; Fri, 30 Nov 2012 12:48:47 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1354279726!24245693!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13489 invoked from network); 30 Nov 2012 12:48:47 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 12:48:47 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="215993241"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 12:48:45 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 07:48:45 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TeQ1N-0001rx-0a;
	Fri, 30 Nov 2012 12:48:45 +0000
Date: Fri, 30 Nov 2012 12:48:40 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1354278564.6269.144.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211301248200.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<50B897E1.70306@citrix.com>
	<alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
	<1354278564.6269.144.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 30 Nov 2012, Ian Campbell wrote:
> On Fri, 2012-11-30 at 12:25 +0000, Stefano Stabellini wrote:
> > 
> > 
> > > > +    if ( interfaces < 4 )
> > > > +    {
> > > > +        early_printk("fdt: node `%s': invalid `reg' property\n",
> > name);
> > > > +        return;
> > > > +    }
> > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > &size);
> > > > +    early_info.gic.gic_dist_addr = start;
> > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > &size);
> > > > +    early_info.gic.gic_cpu_addr = start;
> > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > &size);
> > > > +    early_info.gic.gic_hyp_addr = start;
> > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > &size);
> > > > +    early_info.gic.gic_vcpu_addr = start;
> > > 
> > > Is the GIC driver still hardcoding the register region sizes?  Or
> > does
> > > it not need the size?
> > 
> > Yes, it is. However we do know the size of all the GIC interfaces
> > because they are specified in the GIC docs.
> 
> Perhaps we ought to check that the size given meets (either == or >=)
> our expectations?

OK, in that case I am going to merge the patch with the checks with the
original

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 12:49:03 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 12:49:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeQ1S-000318-Cy; Fri, 30 Nov 2012 12:48:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TeQ1Q-000311-Qg
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 12:48:49 +0000
Received: from [85.158.138.51:48101] by server-15.bemta-3.messagelabs.com id
	EF/E7-23779-F2BA8B05; Fri, 30 Nov 2012 12:48:47 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1354279726!24245693!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13489 invoked from network); 30 Nov 2012 12:48:47 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 12:48:47 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="215993241"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 12:48:45 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 07:48:45 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TeQ1N-0001rx-0a;
	Fri, 30 Nov 2012 12:48:45 +0000
Date: Fri, 30 Nov 2012 12:48:40 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1354278564.6269.144.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211301248200.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<50B897E1.70306@citrix.com>
	<alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
	<1354278564.6269.144.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 30 Nov 2012, Ian Campbell wrote:
> On Fri, 2012-11-30 at 12:25 +0000, Stefano Stabellini wrote:
> > 
> > 
> > > > +    if ( interfaces < 4 )
> > > > +    {
> > > > +        early_printk("fdt: node `%s': invalid `reg' property\n",
> > name);
> > > > +        return;
> > > > +    }
> > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > &size);
> > > > +    early_info.gic.gic_dist_addr = start;
> > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > &size);
> > > > +    early_info.gic.gic_cpu_addr = start;
> > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > &size);
> > > > +    early_info.gic.gic_hyp_addr = start;
> > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > &size);
> > > > +    early_info.gic.gic_vcpu_addr = start;
> > > 
> > > Is the GIC driver still hardcoding the register region sizes?  Or
> > does
> > > it not need the size?
> > 
> > Yes, it is. However we do know the size of all the GIC interfaces
> > because they are specified in the GIC docs.
> 
> Perhaps we ought to check that the size given meets (either == or >=)
> our expectations?

OK, in that case I am going to merge the patch with the checks with the
original

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 13:16:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 13:16:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeQRU-00041U-1V; Fri, 30 Nov 2012 13:15:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TeQRR-00041P-PR
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 13:15:41 +0000
Received: from [85.158.137.99:16090] by server-3.bemta-3.messagelabs.com id
	DF/05-31566-C71B8B05; Fri, 30 Nov 2012 13:15:40 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1354281336!16480027!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9872 invoked from network); 30 Nov 2012 13:15:37 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 13:15:37 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="215995540"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	30 Nov 2012 13:15:35 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 30 Nov 2012 08:15:35 -0500
Message-ID: <50B8B176.3070206@citrix.com>
Date: Fri, 30 Nov 2012 13:15:34 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<50B897E1.70306@citrix.com>
	<alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
In-Reply-To: <alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
X-Originating-IP: [10.80.2.76]
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/12 12:25, Stefano Stabellini wrote:
> On Fri, 30 Nov 2012, David Vrabel wrote:
>> On 23/11/12 15:21, Stefano Stabellini wrote:
>>> Get the address of the GIC distributor, cpu, virtual and virtual cpu
>>> interfaces registers from device tree.
>>
>> The original intention of the early DTB parsing was to get the minimum
>> of info needed before the DTB could be translated into a more useful
>> form (similar to what Linux does).
>>
>> Is this something that is still being considered in the long term?  If
>> so, should the GIC be initialized from this translated form, instead of
>> using the early parsing?
> 
> Regardless of the final form of DT parsing in Xen, I think that CPU,
> memory and GIC are the three things that should be parsed early.

Ok.

>>> +bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)
>>> +{
>>> +    int len, l;
>>> +    const void *prop;
>>> +
>>> +    prop = fdt_getprop(fdt, node, "compatible", &len);
>>> +    if ( prop == NULL )
>>> +        return 0;
>>> +
>>> +    while ( len > 0 ) {
>>> +        if ( !strncmp(prop, match, strlen(match)) )
>>> +            return 1;
>>> +        l = strlen(prop) + 1;
>>> +        prop += l;
>>> +        len -= l;
>>> +    }
>>
>> This doesn't look right.  Don't you need to split the prop string on
>> comma boundaries?
> 
> Nope, the compatible string to match is, for example, the entirety of
> "arm,cortex-a15-gic", or alternatively "arm,cortex-a9-gic". Trying to
> match just "cortex-a15-gic" would be incorrect.
> This is what Linux does too.

Yes, you're right. I was misrembering the format.

>>> +    cell = (const u32 *)prop->data;
>>> +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
>>
>> Is this needed?  This cell is reread below.
> 
> Yes, because device_tree_get_reg increments the cell pointer

Perhaps I wasn't clear.  The result of this device_tree_get_reg() is not
used anywhere, and the side effect of advancing cell is also not used.

>>> +
>>> +    cell = (const u32 *)prop->data;
>>> +    reg_cells = address_cells + size_cells;
>>> +    interfaces = fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32));

David

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 13:16:06 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 13:16:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeQRU-00041U-1V; Fri, 30 Nov 2012 13:15:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <david.vrabel@citrix.com>) id 1TeQRR-00041P-PR
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 13:15:41 +0000
Received: from [85.158.137.99:16090] by server-3.bemta-3.messagelabs.com id
	DF/05-31566-C71B8B05; Fri, 30 Nov 2012 13:15:40 +0000
X-Env-Sender: david.vrabel@citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1354281336!16480027!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9872 invoked from network); 30 Nov 2012 13:15:37 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-11.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 13:15:37 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="215995540"
Received: from unknown (HELO FTLPEX01CL02.citrite.net) ([10.13.107.79])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	30 Nov 2012 13:15:35 +0000
Received: from [10.80.2.76] (10.80.2.76) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 30 Nov 2012 08:15:35 -0500
Message-ID: <50B8B176.3070206@citrix.com>
Date: Fri, 30 Nov 2012 13:15:34 +0000
From: David Vrabel <david.vrabel@citrix.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.16) Gecko/20120428 Iceowl/1.0b1 Icedove/3.0.11
MIME-Version: 1.0
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<50B897E1.70306@citrix.com>
	<alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
In-Reply-To: <alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
X-Originating-IP: [10.80.2.76]
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/12 12:25, Stefano Stabellini wrote:
> On Fri, 30 Nov 2012, David Vrabel wrote:
>> On 23/11/12 15:21, Stefano Stabellini wrote:
>>> Get the address of the GIC distributor, cpu, virtual and virtual cpu
>>> interfaces registers from device tree.
>>
>> The original intention of the early DTB parsing was to get the minimum
>> of info needed before the DTB could be translated into a more useful
>> form (similar to what Linux does).
>>
>> Is this something that is still being considered in the long term?  If
>> so, should the GIC be initialized from this translated form, instead of
>> using the early parsing?
> 
> Regardless of the final form of DT parsing in Xen, I think that CPU,
> memory and GIC are the three things that should be parsed early.

Ok.

>>> +bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)
>>> +{
>>> +    int len, l;
>>> +    const void *prop;
>>> +
>>> +    prop = fdt_getprop(fdt, node, "compatible", &len);
>>> +    if ( prop == NULL )
>>> +        return 0;
>>> +
>>> +    while ( len > 0 ) {
>>> +        if ( !strncmp(prop, match, strlen(match)) )
>>> +            return 1;
>>> +        l = strlen(prop) + 1;
>>> +        prop += l;
>>> +        len -= l;
>>> +    }
>>
>> This doesn't look right.  Don't you need to split the prop string on
>> comma boundaries?
> 
> Nope, the compatible string to match is, for example, the entirety of
> "arm,cortex-a15-gic", or alternatively "arm,cortex-a9-gic". Trying to
> match just "cortex-a15-gic" would be incorrect.
> This is what Linux does too.

Yes, you're right. I was misrembering the format.

>>> +    cell = (const u32 *)prop->data;
>>> +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
>>
>> Is this needed?  This cell is reread below.
> 
> Yes, because device_tree_get_reg increments the cell pointer

Perhaps I wasn't clear.  The result of this device_tree_get_reg() is not
used anywhere, and the side effect of advancing cell is also not used.

>>> +
>>> +    cell = (const u32 *)prop->data;
>>> +    reg_cells = address_cells + size_cells;
>>> +    interfaces = fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32));

David

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 13:22:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 13:22:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeQXR-0004Mr-2W; Fri, 30 Nov 2012 13:21:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <syi@websense.com>) id 1TeQXP-0004Ml-VB
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 13:21:52 +0000
Received: from [85.158.138.51:3655] by server-13.bemta-3.messagelabs.com id
	90/CB-24887-FE2B8B05; Fri, 30 Nov 2012 13:21:51 +0000
X-Env-Sender: syi@websense.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1354281709!24084347!1
X-Originating-IP: [208.87.234.190]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA4Ljg3LjIzNC4xOTAgPT4gMTY3MDA5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8710 invoked from network); 30 Nov 2012 13:21:50 -0000
Received: from cluster-h.mailcontrol.com (HELO cluster-h.mailcontrol.com)
	(208.87.234.190)
	by server-3.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 30 Nov 2012 13:21:50 -0000
Received: from ssdwbsnapp.websense.com (static-204-15-65-158.websense.com
	[204.15.65.158] (may be forged))
	by rly26h.srv.mailcontrol.com (MailControl) with ESMTP id
	qAUDLjhG022787
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 30 Nov 2012 13:21:46 GMT
Received: from SSDEXCH1A.websense.com (unknown [10.8.1.91])
	by Websense Email Security Gateway with ESMTP id 31936100000F;
	Fri, 30 Nov 2012 05:21:41 -0800 (PST)
Received: from SBJEXCH2B.websense.com (10.32.8.112) by SSDEXCH1A.websense.com
	(10.8.1.91) with Microsoft SMTP Server (TLS) id 14.2.283.3;
	Fri, 30 Nov 2012 05:21:44 -0800
Received: from SBJEXCH1A.websense.com ([169.254.1.38]) by
	SBJEXCH2B.websense.com ([::1]) with mapi id 14.02.0283.003;
	Fri, 30 Nov 2012 21:22:09 +0800
From: "Yi, Shunli" <syi@websense.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Thread-Topic: [Xen-devel] [patch] netback: Xennet half die---netback driver
	didn't detect the jiffies wrapping correctly.
Thread-Index: AQHNztXKafwN/Mr5OkGv9eMIluIONJgBlXCAgAAFRYCAAAUXAIAAA5QAgAC3ZLA=
Date: Fri, 30 Nov 2012 13:22:08 +0000
Message-ID: <961EE662BA396D43898AFA993C8F01B7750666E8@SBJEXCH1A.websense.com>
References: <961EE662BA396D43898AFA993C8F01B775066487@SBJEXCH1A.websense.com>
	<1354264550.6039.37.camel@dagon.hellion.org.uk>
	<50B8898D02000078000ACC41@nat28.tlf.novell.com>
	<1354268649.6269.80.camel@zakaz.uk.xensource.com>
	<50B8923E02000078000ACCBC@nat28.tlf.novell.com>
	<1354270510.6269.95.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354270510.6269.95.camel@zakaz.uk.xensource.com>
Accept-Language: zh-CN, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.32.134.106]
MIME-Version: 1.0
X-Scanned-By: MailControl 11783.69 (www.mailcontrol.com) on 10.72.0.136
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [patch] netback: Xennet half die---netback driver
 didn't detect the jiffies wrapping correctly.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> >> >> --- drivers/xen/netback/netback.c.org	2012-11-30 15:48:13.109039998 -0500
> >> >> +++ drivers/xen/netback/netback.c	2012-11-30 15:48:55.212072898 -0500
> >> >> @@ -1272,6 +1272,10 @@ static void net_tx_action(unsigned long
> >> >>  		rmb(); /* Ensure that we see the request before we copy it. */
> >> >>  		memcpy(&txreq, RING_GET_REQUEST(&netif->tx, i), 
> >> >> sizeof(txreq));
> >> >>  
> >> >> +        /* Check for the jiffies wrapping */
> >> >> +        if (time_after_eq(jiffies, netif->credit_timeout.expires))
> >> >> +            netif->credit_timeout.expires = jiffies;
> >> > 
> >> > Do you not need to remove the similar check from the following block?
> >> 
> >> I don't think so, but I also can't see how that adjustment would 
> >> help in the first place: If it gets executed after a very long 
> >> period of no traffic, it would itself not be able to reliably tell 
> >> whether the clock wrapped.
> > 
> > Hrm, yes, This change would help in the case of a dribble of traffic 
> > which never hits the limit, but not in the case of no timer at all.
> > 
> >> That said, I agree that the code as is appears to have a problem 
> >> (with 32-bit jiffies at least), but I can't see how to easily deal 
> >> with it.
> > 
> > Would it help to always have the pending timer armed, for either the 
> > next tick if credit needs replenishing or for, say MAX_JIFFIES/4 as 
> > a backstop to avoid wrapping issues?
> 
> If that can be made work cleanly, that would probably be the easiest 
> solution. But I don't see MAX_JIFFIES being defined anywhere, and I'm 
> unsure ULONG_MAX/4 would be well received as a timeout on 64-bit 
> systems.


Thanks guys for your input, I'm really a newbie in kernel coding. The patch base on following thoughs:
    - If we enabled the credit mechanism, the next_credit should always in future of jiffies. 
    - So, the timer should not be in pending(the code will be run, we just carry the timer with jiffies) or the timer is set to a time in future ( the code will not run )


I'm not sure my understand the credit mechanism right, but we can always calculate the next_credit base on jiffies instead of the old timer value:
	unsigned long next_credit =
                	netif->credit_timeout.expires +
                	msecs_to_jiffies(netif->credit_usec / 1000);

> I guess several trillion years *is* a tad extreme ;-) (or my maths is wrong).

>We could always choose a more practical backstop, like a day or even a just few minutes -- we'd expect in general to always be pushing the timeout ahead rather than hitting it.

>Ian



 To report this as spam, please forward to spam@websense.com.  Thank you.


 Protected by Websense Hosted Email Security -- www.websense.com 
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 13:22:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 13:22:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeQXR-0004Mr-2W; Fri, 30 Nov 2012 13:21:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <syi@websense.com>) id 1TeQXP-0004Ml-VB
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 13:21:52 +0000
Received: from [85.158.138.51:3655] by server-13.bemta-3.messagelabs.com id
	90/CB-24887-FE2B8B05; Fri, 30 Nov 2012 13:21:51 +0000
X-Env-Sender: syi@websense.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1354281709!24084347!1
X-Originating-IP: [208.87.234.190]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMjA4Ljg3LjIzNC4xOTAgPT4gMTY3MDA5MA==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8710 invoked from network); 30 Nov 2012 13:21:50 -0000
Received: from cluster-h.mailcontrol.com (HELO cluster-h.mailcontrol.com)
	(208.87.234.190)
	by server-3.tower-174.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 30 Nov 2012 13:21:50 -0000
Received: from ssdwbsnapp.websense.com (static-204-15-65-158.websense.com
	[204.15.65.158] (may be forged))
	by rly26h.srv.mailcontrol.com (MailControl) with ESMTP id
	qAUDLjhG022787
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 30 Nov 2012 13:21:46 GMT
Received: from SSDEXCH1A.websense.com (unknown [10.8.1.91])
	by Websense Email Security Gateway with ESMTP id 31936100000F;
	Fri, 30 Nov 2012 05:21:41 -0800 (PST)
Received: from SBJEXCH2B.websense.com (10.32.8.112) by SSDEXCH1A.websense.com
	(10.8.1.91) with Microsoft SMTP Server (TLS) id 14.2.283.3;
	Fri, 30 Nov 2012 05:21:44 -0800
Received: from SBJEXCH1A.websense.com ([169.254.1.38]) by
	SBJEXCH2B.websense.com ([::1]) with mapi id 14.02.0283.003;
	Fri, 30 Nov 2012 21:22:09 +0800
From: "Yi, Shunli" <syi@websense.com>
To: Ian Campbell <Ian.Campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Thread-Topic: [Xen-devel] [patch] netback: Xennet half die---netback driver
	didn't detect the jiffies wrapping correctly.
Thread-Index: AQHNztXKafwN/Mr5OkGv9eMIluIONJgBlXCAgAAFRYCAAAUXAIAAA5QAgAC3ZLA=
Date: Fri, 30 Nov 2012 13:22:08 +0000
Message-ID: <961EE662BA396D43898AFA993C8F01B7750666E8@SBJEXCH1A.websense.com>
References: <961EE662BA396D43898AFA993C8F01B775066487@SBJEXCH1A.websense.com>
	<1354264550.6039.37.camel@dagon.hellion.org.uk>
	<50B8898D02000078000ACC41@nat28.tlf.novell.com>
	<1354268649.6269.80.camel@zakaz.uk.xensource.com>
	<50B8923E02000078000ACCBC@nat28.tlf.novell.com>
	<1354270510.6269.95.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354270510.6269.95.camel@zakaz.uk.xensource.com>
Accept-Language: zh-CN, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.32.134.106]
MIME-Version: 1.0
X-Scanned-By: MailControl 11783.69 (www.mailcontrol.com) on 10.72.0.136
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [patch] netback: Xennet half die---netback driver
 didn't detect the jiffies wrapping correctly.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> >> >> --- drivers/xen/netback/netback.c.org	2012-11-30 15:48:13.109039998 -0500
> >> >> +++ drivers/xen/netback/netback.c	2012-11-30 15:48:55.212072898 -0500
> >> >> @@ -1272,6 +1272,10 @@ static void net_tx_action(unsigned long
> >> >>  		rmb(); /* Ensure that we see the request before we copy it. */
> >> >>  		memcpy(&txreq, RING_GET_REQUEST(&netif->tx, i), 
> >> >> sizeof(txreq));
> >> >>  
> >> >> +        /* Check for the jiffies wrapping */
> >> >> +        if (time_after_eq(jiffies, netif->credit_timeout.expires))
> >> >> +            netif->credit_timeout.expires = jiffies;
> >> > 
> >> > Do you not need to remove the similar check from the following block?
> >> 
> >> I don't think so, but I also can't see how that adjustment would 
> >> help in the first place: If it gets executed after a very long 
> >> period of no traffic, it would itself not be able to reliably tell 
> >> whether the clock wrapped.
> > 
> > Hrm, yes, This change would help in the case of a dribble of traffic 
> > which never hits the limit, but not in the case of no timer at all.
> > 
> >> That said, I agree that the code as is appears to have a problem 
> >> (with 32-bit jiffies at least), but I can't see how to easily deal 
> >> with it.
> > 
> > Would it help to always have the pending timer armed, for either the 
> > next tick if credit needs replenishing or for, say MAX_JIFFIES/4 as 
> > a backstop to avoid wrapping issues?
> 
> If that can be made work cleanly, that would probably be the easiest 
> solution. But I don't see MAX_JIFFIES being defined anywhere, and I'm 
> unsure ULONG_MAX/4 would be well received as a timeout on 64-bit 
> systems.


Thanks guys for your input, I'm really a newbie in kernel coding. The patch base on following thoughs:
    - If we enabled the credit mechanism, the next_credit should always in future of jiffies. 
    - So, the timer should not be in pending(the code will be run, we just carry the timer with jiffies) or the timer is set to a time in future ( the code will not run )


I'm not sure my understand the credit mechanism right, but we can always calculate the next_credit base on jiffies instead of the old timer value:
	unsigned long next_credit =
                	netif->credit_timeout.expires +
                	msecs_to_jiffies(netif->credit_usec / 1000);

> I guess several trillion years *is* a tad extreme ;-) (or my maths is wrong).

>We could always choose a more practical backstop, like a day or even a just few minutes -- we'd expect in general to always be pushing the timeout ahead rather than hitting it.

>Ian



 To report this as spam, please forward to spam@websense.com.  Thank you.


 Protected by Websense Hosted Email Security -- www.websense.com 
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:08:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:08:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRFy-0005cq-VB; Fri, 30 Nov 2012 14:07:54 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TeRFx-0005cl-63
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 14:07:53 +0000
Received: from [193.109.254.147:5136] by server-10.bemta-14.messagelabs.com id
	00/40-31741-8BDB8B05; Fri, 30 Nov 2012 14:07:52 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1354284177!8896857!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21336 invoked from network); 30 Nov 2012 14:02:59 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 14:02:59 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="216000258"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 14:02:57 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:02:57 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TeRBB-0002t4-1N;
	Fri, 30 Nov 2012 14:02:57 +0000
Date: Fri, 30 Nov 2012 14:02:52 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
In-Reply-To: <alpine.DEB.2.02.1211301248200.5310@kaball.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211301301201.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<50B897E1.70306@citrix.com>
	<alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
	<1354278564.6269.144.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211301248200.5310@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	David Vrabel <david.vrabel@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 30 Nov 2012, Stefano Stabellini wrote:
> On Fri, 30 Nov 2012, Ian Campbell wrote:
> > On Fri, 2012-11-30 at 12:25 +0000, Stefano Stabellini wrote:
> > > 
> > > 
> > > > > +    if ( interfaces < 4 )
> > > > > +    {
> > > > > +        early_printk("fdt: node `%s': invalid `reg' property\n",
> > > name);
> > > > > +        return;
> > > > > +    }
> > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > &size);
> > > > > +    early_info.gic.gic_dist_addr = start;
> > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > &size);
> > > > > +    early_info.gic.gic_cpu_addr = start;
> > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > &size);
> > > > > +    early_info.gic.gic_hyp_addr = start;
> > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > &size);
> > > > > +    early_info.gic.gic_vcpu_addr = start;
> > > > 
> > > > Is the GIC driver still hardcoding the register region sizes?  Or
> > > does
> > > > it not need the size?
> > > 
> > > Yes, it is. However we do know the size of all the GIC interfaces
> > > because they are specified in the GIC docs.
> > 
> > Perhaps we ought to check that the size given meets (either == or >=)
> > our expectations?
> 
> OK, in that case I am going to merge the patch with the checks with the
> original

Actually I found an issue in the GIC DT specs:

- reg : Specifies base physical address(s) and size of the GIC registers. The
  first region is the GIC distributor register base and size. The 2nd region is
  the GIC cpu interface register base and size.

however this is what I get for vexpress:

reg = <0 0x2c001000 0 0x1000>,
      <0 0x2c002000 0 0x1000>,
      <0 0x2c004000 0 0x2000>,
      <0 0x2c006000 0 0x2000>;

Leaving aside the last two regions that are due to the virtualization
extensions, the size of the cpu interface is one page according to DT.
However the GIC specs state that the GICC_DIR register is at offset
0x1000, so it is certainly slightly bigger than one page.
I think that nobody noticed this in the Linux world because they don't
seem to be using the GICC_DIR register at all so they can get away with
a cpu interface of just one page.

So I think we should not check for sizes :)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:08:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:08:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRFy-0005cq-VB; Fri, 30 Nov 2012 14:07:54 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TeRFx-0005cl-63
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 14:07:53 +0000
Received: from [193.109.254.147:5136] by server-10.bemta-14.messagelabs.com id
	00/40-31741-8BDB8B05; Fri, 30 Nov 2012 14:07:52 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1354284177!8896857!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21336 invoked from network); 30 Nov 2012 14:02:59 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 14:02:59 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="216000258"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 14:02:57 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:02:57 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TeRBB-0002t4-1N;
	Fri, 30 Nov 2012 14:02:57 +0000
Date: Fri, 30 Nov 2012 14:02:52 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
In-Reply-To: <alpine.DEB.2.02.1211301248200.5310@kaball.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211301301201.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<50B897E1.70306@citrix.com>
	<alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
	<1354278564.6269.144.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211301248200.5310@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	David Vrabel <david.vrabel@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 30 Nov 2012, Stefano Stabellini wrote:
> On Fri, 30 Nov 2012, Ian Campbell wrote:
> > On Fri, 2012-11-30 at 12:25 +0000, Stefano Stabellini wrote:
> > > 
> > > 
> > > > > +    if ( interfaces < 4 )
> > > > > +    {
> > > > > +        early_printk("fdt: node `%s': invalid `reg' property\n",
> > > name);
> > > > > +        return;
> > > > > +    }
> > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > &size);
> > > > > +    early_info.gic.gic_dist_addr = start;
> > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > &size);
> > > > > +    early_info.gic.gic_cpu_addr = start;
> > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > &size);
> > > > > +    early_info.gic.gic_hyp_addr = start;
> > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > &size);
> > > > > +    early_info.gic.gic_vcpu_addr = start;
> > > > 
> > > > Is the GIC driver still hardcoding the register region sizes?  Or
> > > does
> > > > it not need the size?
> > > 
> > > Yes, it is. However we do know the size of all the GIC interfaces
> > > because they are specified in the GIC docs.
> > 
> > Perhaps we ought to check that the size given meets (either == or >=)
> > our expectations?
> 
> OK, in that case I am going to merge the patch with the checks with the
> original

Actually I found an issue in the GIC DT specs:

- reg : Specifies base physical address(s) and size of the GIC registers. The
  first region is the GIC distributor register base and size. The 2nd region is
  the GIC cpu interface register base and size.

however this is what I get for vexpress:

reg = <0 0x2c001000 0 0x1000>,
      <0 0x2c002000 0 0x1000>,
      <0 0x2c004000 0 0x2000>,
      <0 0x2c006000 0 0x2000>;

Leaving aside the last two regions that are due to the virtualization
extensions, the size of the cpu interface is one page according to DT.
However the GIC specs state that the GICC_DIR register is at offset
0x1000, so it is certainly slightly bigger than one page.
I think that nobody noticed this in the Linux world because they don't
seem to be using the GICC_DIR register at all so they can get away with
a cpu interface of just one page.

So I think we should not check for sizes :)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:09:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:09:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRGi-0005fL-DY; Fri, 30 Nov 2012 14:08:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeRGg-0005fB-TD
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 14:08:39 +0000
Received: from [85.158.139.83:38431] by server-9.bemta-5.messagelabs.com id
	FD/7C-29295-6EDB8B05; Fri, 30 Nov 2012 14:08:38 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1354284517!27864180!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27250 invoked from network); 30 Nov 2012 14:08:37 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 14:08:37 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16092912"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 14:08:37 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 14:08:37 +0000
Message-ID: <1354284515.6269.160.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Fri, 30 Nov 2012 14:08:35 +0000
In-Reply-To: <alpine.DEB.2.02.1211301301201.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<50B897E1.70306@citrix.com>
	<alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
	<1354278564.6269.144.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211301248200.5310@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1211301301201.5310@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	David Vrabel <david.vrabel@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-30 at 14:02 +0000, Stefano Stabellini wrote:
> On Fri, 30 Nov 2012, Stefano Stabellini wrote:
> > On Fri, 30 Nov 2012, Ian Campbell wrote:
> > > On Fri, 2012-11-30 at 12:25 +0000, Stefano Stabellini wrote:
> > > > 
> > > > 
> > > > > > +    if ( interfaces < 4 )
> > > > > > +    {
> > > > > > +        early_printk("fdt: node `%s': invalid `reg' property\n",
> > > > name);
> > > > > > +        return;
> > > > > > +    }
> > > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > > &size);
> > > > > > +    early_info.gic.gic_dist_addr = start;
> > > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > > &size);
> > > > > > +    early_info.gic.gic_cpu_addr = start;
> > > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > > &size);
> > > > > > +    early_info.gic.gic_hyp_addr = start;
> > > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > > &size);
> > > > > > +    early_info.gic.gic_vcpu_addr = start;
> > > > > 
> > > > > Is the GIC driver still hardcoding the register region sizes?  Or
> > > > does
> > > > > it not need the size?
> > > > 
> > > > Yes, it is. However we do know the size of all the GIC interfaces
> > > > because they are specified in the GIC docs.
> > > 
> > > Perhaps we ought to check that the size given meets (either == or >=)
> > > our expectations?
> > 
> > OK, in that case I am going to merge the patch with the checks with the
> > original
> 
> Actually I found an issue in the GIC DT specs:
> 
> - reg : Specifies base physical address(s) and size of the GIC registers. The
>   first region is the GIC distributor register base and size. The 2nd region is
>   the GIC cpu interface register base and size.
> 
> however this is what I get for vexpress:
> 
> reg = <0 0x2c001000 0 0x1000>,
>       <0 0x2c002000 0 0x1000>,
>       <0 0x2c004000 0 0x2000>,
>       <0 0x2c006000 0 0x2000>;
> 
> Leaving aside the last two regions that are due to the virtualization
> extensions, the size of the cpu interface is one page according to DT.
> However the GIC specs state that the GICC_DIR register is at offset
> 0x1000, so it is certainly slightly bigger than one page.

I think, and I'm not at all sure about this, that 0x1000 is GIC v1 and
the second page of GICC stuff was introduced with GIC v2.

I wonder what version the cortex a9 implemented. This could well be a
meaningful difference between compat = arm,cortex-a9-gic and
arm,cortex-a15-gic which isn't current expressed in the DT?

> I think that nobody noticed this in the Linux world because they don't
> seem to be using the GICC_DIR register at all so they can get away with
> a cpu interface of just one page.
> 
> So I think we should not check for sizes :)



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:09:01 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:09:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRGi-0005fL-DY; Fri, 30 Nov 2012 14:08:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>) id 1TeRGg-0005fB-TD
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 14:08:39 +0000
Received: from [85.158.139.83:38431] by server-9.bemta-5.messagelabs.com id
	FD/7C-29295-6EDB8B05; Fri, 30 Nov 2012 14:08:38 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1354284517!27864180!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27250 invoked from network); 30 Nov 2012 14:08:37 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 14:08:37 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16092912"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 14:08:37 +0000
Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 14:08:37 +0000
Message-ID: <1354284515.6269.160.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Fri, 30 Nov 2012 14:08:35 +0000
In-Reply-To: <alpine.DEB.2.02.1211301301201.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<50B897E1.70306@citrix.com>
	<alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
	<1354278564.6269.144.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211301248200.5310@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1211301301201.5310@kaball.uk.xensource.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.4.4-1 
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	David Vrabel <david.vrabel@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 2012-11-30 at 14:02 +0000, Stefano Stabellini wrote:
> On Fri, 30 Nov 2012, Stefano Stabellini wrote:
> > On Fri, 30 Nov 2012, Ian Campbell wrote:
> > > On Fri, 2012-11-30 at 12:25 +0000, Stefano Stabellini wrote:
> > > > 
> > > > 
> > > > > > +    if ( interfaces < 4 )
> > > > > > +    {
> > > > > > +        early_printk("fdt: node `%s': invalid `reg' property\n",
> > > > name);
> > > > > > +        return;
> > > > > > +    }
> > > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > > &size);
> > > > > > +    early_info.gic.gic_dist_addr = start;
> > > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > > &size);
> > > > > > +    early_info.gic.gic_cpu_addr = start;
> > > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > > &size);
> > > > > > +    early_info.gic.gic_hyp_addr = start;
> > > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > > &size);
> > > > > > +    early_info.gic.gic_vcpu_addr = start;
> > > > > 
> > > > > Is the GIC driver still hardcoding the register region sizes?  Or
> > > > does
> > > > > it not need the size?
> > > > 
> > > > Yes, it is. However we do know the size of all the GIC interfaces
> > > > because they are specified in the GIC docs.
> > > 
> > > Perhaps we ought to check that the size given meets (either == or >=)
> > > our expectations?
> > 
> > OK, in that case I am going to merge the patch with the checks with the
> > original
> 
> Actually I found an issue in the GIC DT specs:
> 
> - reg : Specifies base physical address(s) and size of the GIC registers. The
>   first region is the GIC distributor register base and size. The 2nd region is
>   the GIC cpu interface register base and size.
> 
> however this is what I get for vexpress:
> 
> reg = <0 0x2c001000 0 0x1000>,
>       <0 0x2c002000 0 0x1000>,
>       <0 0x2c004000 0 0x2000>,
>       <0 0x2c006000 0 0x2000>;
> 
> Leaving aside the last two regions that are due to the virtualization
> extensions, the size of the cpu interface is one page according to DT.
> However the GIC specs state that the GICC_DIR register is at offset
> 0x1000, so it is certainly slightly bigger than one page.

I think, and I'm not at all sure about this, that 0x1000 is GIC v1 and
the second page of GICC stuff was introduced with GIC v2.

I wonder what version the cortex a9 implemented. This could well be a
meaningful difference between compat = arm,cortex-a9-gic and
arm,cortex-a15-gic which isn't current expressed in the DT?

> I think that nobody noticed this in the Linux world because they don't
> seem to be using the GICC_DIR register at all so they can get away with
> a cpu interface of just one page.
> 
> So I think we should not check for sizes :)



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:09:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:09:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRGt-0005gE-RL; Fri, 30 Nov 2012 14:08:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeRGs-0005g5-0p
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 14:08:50 +0000
Received: from [85.158.137.99:23428] by server-8.bemta-3.messagelabs.com id
	5D/2C-07786-CEDB8B05; Fri, 30 Nov 2012 14:08:44 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1354284524!17353963!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16987 invoked from network); 30 Nov 2012 14:08:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 14:08:44 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16092915"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 14:08:44 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 14:08:43 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeRGl-0006Hx-Nl;
	Fri, 30 Nov 2012 14:08:43 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeRGl-0002ee-Ia;
	Fri, 30 Nov 2012 14:08:43 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14501-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 14:08:43 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14501: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14501 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14501/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14483
 test-amd64-amd64-xl-sedf     11 guest-localmigrate           fail   like 14483

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  9 guest-localmigrate         fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-i386-i386-qemut-win     16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-i386-i386-xl-qemut-winxpsp3 13 guest-stop                 fail never pass
 test-i386-i386-xl-qemut-win  13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  b3dafd42268a
baseline version:
 xen                  5c5c695863f7

------------------------------------------------------------
People who touched revisions under test:
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-i386-i386-qemut-win                                     fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-i386-i386-xl-qemut-win                                  fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-i386-i386-xl-qemut-winxpsp3                             fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.2-testing
+ revision=b3dafd42268a
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.2-testing b3dafd42268a
+ branch=xen-4.2-testing
+ revision=b3dafd42268a
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.2-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.2-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
++ : daily-cron.xen-4.2-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.2-testing.git
+ info_linux_tree xen-4.2-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.2-testing.hg
+ hg push -r b3dafd42268a ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 3 changes to 3 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:09:10 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:09:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRGt-0005gE-RL; Fri, 30 Nov 2012 14:08:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeRGs-0005g5-0p
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 14:08:50 +0000
Received: from [85.158.137.99:23428] by server-8.bemta-3.messagelabs.com id
	5D/2C-07786-CEDB8B05; Fri, 30 Nov 2012 14:08:44 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1354284524!17353963!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16987 invoked from network); 30 Nov 2012 14:08:44 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-16.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 14:08:44 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16092915"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 14:08:44 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 14:08:43 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeRGl-0006Hx-Nl;
	Fri, 30 Nov 2012 14:08:43 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeRGl-0002ee-Ia;
	Fri, 30 Nov 2012 14:08:43 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14501-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 14:08:43 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-4.2-testing test] 14501: tolerable FAIL - PUSHED
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14501 xen-4.2-testing real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14501/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin 10 guest-saverestore            fail   like 14483
 test-amd64-amd64-xl-sedf     11 guest-localmigrate           fail   like 14483

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-i386-i386-xl-qemuu-winxpsp3  9 guest-localmigrate         fail never pass
 test-amd64-amd64-xl-qemuu-win7-amd64  9 guest-localmigrate     fail never pass
 test-i386-i386-qemut-win     16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop                   fail  never pass
 test-amd64-i386-xend-winxpsp3 16 leak-check/check             fail  never pass
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-qemut-win    16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win7-amd64 13 guest-stop                   fail never pass
 test-amd64-i386-xend-qemut-winxpsp3 16 leak-check/check        fail never pass
 test-amd64-amd64-xl-qemut-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop                   fail  never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 13 guest-stop         fail never pass
 test-amd64-i386-xl-winxpsp3-vcpus1 13 guest-stop               fail never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop              fail never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check           fail never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop              fail never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check             fail   never pass
 test-i386-i386-xl-winxpsp3   13 guest-stop                   fail   never pass
 test-amd64-i386-win          16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-win      13 guest-stop                   fail   never pass
 test-i386-i386-xl-qemut-winxpsp3 13 guest-stop                 fail never pass
 test-i386-i386-xl-qemut-win  13 guest-stop                   fail   never pass
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-amd64-xl-qemuu-winxpsp3  9 guest-localmigrate       fail never pass
 test-i386-i386-win           16 leak-check/check             fail   never pass
 test-i386-i386-xl-win        13 guest-stop                   fail   never pass
 test-amd64-amd64-xl-qemut-win 13 guest-stop                   fail  never pass
 test-amd64-amd64-qemut-win   16 leak-check/check             fail   never pass

version targeted for testing:
 xen                  b3dafd42268a
baseline version:
 xen                  5c5c695863f7

------------------------------------------------------------
People who touched revisions under test:
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Ian Jackson <ian.jackson@eu.citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-i386-i386-xl                                            pass    
 test-amd64-i386-rhel6hvm-amd                                 pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                fail    
 test-amd64-i386-xl-credit2                                   pass    
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-i386-xl-multivcpu                                 pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-i386-i386-pair                                          pass    
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          pass    
 test-amd64-i386-pv                                           pass    
 test-i386-i386-pv                                            pass    
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   fail    
 test-amd64-i386-qemut-win-vcpus1                             fail    
 test-amd64-i386-xl-qemut-win-vcpus1                          fail    
 test-amd64-i386-xl-win-vcpus1                                fail    
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     fail    
 test-amd64-i386-xl-winxpsp3-vcpus1                           fail    
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          fail    
 test-i386-i386-win                                           fail    
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    fail    
 test-i386-i386-qemut-win                                     fail    
 test-amd64-amd64-xl-qemut-win                                fail    
 test-i386-i386-xl-qemut-win                                  fail    
 test-amd64-amd64-xl-win                                      fail    
 test-i386-i386-xl-win                                        fail    
 test-amd64-i386-xend-qemut-winxpsp3                          fail    
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-i386-i386-xl-qemut-winxpsp3                             fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-i386-i386-xl-qemuu-winxpsp3                             fail    
 test-amd64-i386-xend-winxpsp3                                fail    
 test-amd64-amd64-xl-winxpsp3                                 fail    
 test-i386-i386-xl-winxpsp3                                   fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Pushing revision :

+ branch=xen-4.2-testing
+ revision=b3dafd42268a
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x '!=' x/export/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/export/home/osstest/repos/lock
++ exec with-lock-ex -w /export/home/osstest/repos/lock ./ap-push xen-4.2-testing b3dafd42268a
+ branch=xen-4.2-testing
+ revision=b3dafd42268a
+ . cri-lock-repos
++ . cri-common
+++ umask 002
+++ getconfig Repos
+++ perl -e '
                use Osstest;
                readconfigonly();
                print $c{Repos} or die $!;
        '
++ repos=/export/home/osstest/repos
++ repos_lock=/export/home/osstest/repos/lock
++ '[' x/export/home/osstest/repos/lock '!=' x/export/home/osstest/repos/lock ']'
+ . cri-common
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=xen
+ xenbranch=xen-4.2-testing
+ '[' xxen = xlinux ']'
+ linuxbranch=linux
+ : master
+ : tested/2.6.39.x
+ . ap-common
++ : xen@xenbits.xensource.com
++ : http://xenbits.xen.org/hg/staging/xen-4.2-testing.hg
++ : git://xenbits.xen.org/staging/qemu-xen-4.2-testing.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : xen@xenbits.xensource.com:git/linux-pvops.git
++ : git://xenbits.xen.org/linux-pvops.git
++ : master
++ : git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
++ : tested/2.6.39.x
++ : daily-cron.xen-4.2-testing
++ : http://hg.uk.xensource.com/carbon/trunk/linux-2.6.27
++ : git://xenbits.xen.org/staging/qemu-upstream-4.2-testing.git
++ : daily-cron.xen-4.2-testing
+ TREE_LINUX=xen@xenbits.xensource.com:git/linux-pvops.git
+ TREE_QEMU_UPSTREAM=xen@xenbits.xensource.com:git/qemu-upstream-4.2-testing.git
+ info_linux_tree xen-4.2-testing
+ case $1 in
+ return 1
+ case "$branch" in
+ cd /export/home/osstest/repos/xen-4.2-testing.hg
+ hg push -r b3dafd42268a ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
pushing to ssh://xen@xenbits.xensource.com/HG/xen-4.2-testing.hg
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 3 changes to 3 files

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:09:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:09:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRH0-0005hf-Dg; Fri, 30 Nov 2012 14:08:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TeRGy-0005h8-FL
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 14:08:56 +0000
Received: from [85.158.139.83:57692] by server-10.bemta-5.messagelabs.com id
	EB/FF-09257-7FDB8B05; Fri, 30 Nov 2012 14:08:55 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1354284534!16559879!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8514 invoked from network); 30 Nov 2012 14:08:55 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-8.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 14:08:55 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="216000938"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 14:08:53 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:08:53 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TeRGu-0002xu-T6;
	Fri, 30 Nov 2012 14:08:52 +0000
Date: Fri, 30 Nov 2012 14:08:47 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: David Vrabel <david.vrabel@citrix.com>
In-Reply-To: <50B8B176.3070206@citrix.com>
Message-ID: <alpine.DEB.2.02.1211301406080.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<50B897E1.70306@citrix.com>
	<alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
	<50B8B176.3070206@citrix.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 30 Nov 2012, David Vrabel wrote:
> >>> +    cell = (const u32 *)prop->data;
> >>> +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> >>
> >> Is this needed?  This cell is reread below.
> > 
> > Yes, because device_tree_get_reg increments the cell pointer
> 
> Perhaps I wasn't clear.  The result of this device_tree_get_reg() is not
> used anywhere, and the side effect of advancing cell is also not used.

You are right, I am not sure how it ended up there, I'll remove those
two lines.
Thanks!

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:09:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:09:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRH0-0005hf-Dg; Fri, 30 Nov 2012 14:08:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TeRGy-0005h8-FL
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 14:08:56 +0000
Received: from [85.158.139.83:57692] by server-10.bemta-5.messagelabs.com id
	EB/FF-09257-7FDB8B05; Fri, 30 Nov 2012 14:08:55 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1354284534!16559879!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8514 invoked from network); 30 Nov 2012 14:08:55 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-8.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 14:08:55 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="216000938"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 14:08:53 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:08:53 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TeRGu-0002xu-T6;
	Fri, 30 Nov 2012 14:08:52 +0000
Date: Fri, 30 Nov 2012 14:08:47 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: David Vrabel <david.vrabel@citrix.com>
In-Reply-To: <50B8B176.3070206@citrix.com>
Message-ID: <alpine.DEB.2.02.1211301406080.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<50B897E1.70306@citrix.com>
	<alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
	<50B8B176.3070206@citrix.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 30 Nov 2012, David Vrabel wrote:
> >>> +    cell = (const u32 *)prop->data;
> >>> +    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> >>
> >> Is this needed?  This cell is reread below.
> > 
> > Yes, because device_tree_get_reg increments the cell pointer
> 
> Perhaps I wasn't clear.  The result of this device_tree_get_reg() is not
> used anywhere, and the side effect of advancing cell is also not used.

You are right, I am not sure how it ended up there, I'll remove those
two lines.
Thanks!

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:11:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRJ8-0006EQ-06; Fri, 30 Nov 2012 14:11:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TeRJ6-0006EE-IU
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 14:11:08 +0000
Received: from [85.158.137.99:43249] by server-9.bemta-3.messagelabs.com id
	6A/3E-02388-B7EB8B05; Fri, 30 Nov 2012 14:11:07 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1354284665!12231695!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28280 invoked from network); 30 Nov 2012 14:11:07 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 14:11:07 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46164960"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 14:11:04 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:11:04 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TeRJ2-0002zj-AG;
	Fri, 30 Nov 2012 14:11:04 +0000
Date: Fri, 30 Nov 2012 14:10:59 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1354284515.6269.160.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211301410130.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<50B897E1.70306@citrix.com>
	<alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
	<1354278564.6269.144.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211301248200.5310@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1211301301201.5310@kaball.uk.xensource.com>
	<1354284515.6269.160.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 30 Nov 2012, Ian Campbell wrote:
> On Fri, 2012-11-30 at 14:02 +0000, Stefano Stabellini wrote:
> > On Fri, 30 Nov 2012, Stefano Stabellini wrote:
> > > On Fri, 30 Nov 2012, Ian Campbell wrote:
> > > > On Fri, 2012-11-30 at 12:25 +0000, Stefano Stabellini wrote:
> > > > > 
> > > > > 
> > > > > > > +    if ( interfaces < 4 )
> > > > > > > +    {
> > > > > > > +        early_printk("fdt: node `%s': invalid `reg' property\n",
> > > > > name);
> > > > > > > +        return;
> > > > > > > +    }
> > > > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > > > &size);
> > > > > > > +    early_info.gic.gic_dist_addr = start;
> > > > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > > > &size);
> > > > > > > +    early_info.gic.gic_cpu_addr = start;
> > > > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > > > &size);
> > > > > > > +    early_info.gic.gic_hyp_addr = start;
> > > > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > > > &size);
> > > > > > > +    early_info.gic.gic_vcpu_addr = start;
> > > > > > 
> > > > > > Is the GIC driver still hardcoding the register region sizes?  Or
> > > > > does
> > > > > > it not need the size?
> > > > > 
> > > > > Yes, it is. However we do know the size of all the GIC interfaces
> > > > > because they are specified in the GIC docs.
> > > > 
> > > > Perhaps we ought to check that the size given meets (either == or >=)
> > > > our expectations?
> > > 
> > > OK, in that case I am going to merge the patch with the checks with the
> > > original
> > 
> > Actually I found an issue in the GIC DT specs:
> > 
> > - reg : Specifies base physical address(s) and size of the GIC registers. The
> >   first region is the GIC distributor register base and size. The 2nd region is
> >   the GIC cpu interface register base and size.
> > 
> > however this is what I get for vexpress:
> > 
> > reg = <0 0x2c001000 0 0x1000>,
> >       <0 0x2c002000 0 0x1000>,
> >       <0 0x2c004000 0 0x2000>,
> >       <0 0x2c006000 0 0x2000>;
> > 
> > Leaving aside the last two regions that are due to the virtualization
> > extensions, the size of the cpu interface is one page according to DT.
> > However the GIC specs state that the GICC_DIR register is at offset
> > 0x1000, so it is certainly slightly bigger than one page.
> 
> I think, and I'm not at all sure about this, that 0x1000 is GIC v1 and
> the second page of GICC stuff was introduced with GIC v2.

That's right

> I wonder what version the cortex a9 implemented. This could well be a
> meaningful difference between compat = arm,cortex-a9-gic and
> arm,cortex-a15-gic which isn't current expressed in the DT?

yes, I think the DT hasn't been updated

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:11:20 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRJ8-0006EQ-06; Fri, 30 Nov 2012 14:11:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TeRJ6-0006EE-IU
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 14:11:08 +0000
Received: from [85.158.137.99:43249] by server-9.bemta-3.messagelabs.com id
	6A/3E-02388-B7EB8B05; Fri, 30 Nov 2012 14:11:07 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1354284665!12231695!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28280 invoked from network); 30 Nov 2012 14:11:07 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-6.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 14:11:07 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46164960"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 14:11:04 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:11:04 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TeRJ2-0002zj-AG;
	Fri, 30 Nov 2012 14:11:04 +0000
Date: Fri, 30 Nov 2012 14:10:59 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1354284515.6269.160.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211301410130.5310@kaball.uk.xensource.com>
References: <alpine.DEB.2.02.1211231517050.13749@kaball.uk.xensource.com>
	<50B897E1.70306@citrix.com>
	<alpine.DEB.2.02.1211301209300.5310@kaball.uk.xensource.com>
	<1354278564.6269.144.camel@zakaz.uk.xensource.com>
	<alpine.DEB.2.02.1211301248200.5310@kaball.uk.xensource.com>
	<alpine.DEB.2.02.1211301301201.5310@kaball.uk.xensource.com>
	<1354284515.6269.160.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, 30 Nov 2012, Ian Campbell wrote:
> On Fri, 2012-11-30 at 14:02 +0000, Stefano Stabellini wrote:
> > On Fri, 30 Nov 2012, Stefano Stabellini wrote:
> > > On Fri, 30 Nov 2012, Ian Campbell wrote:
> > > > On Fri, 2012-11-30 at 12:25 +0000, Stefano Stabellini wrote:
> > > > > 
> > > > > 
> > > > > > > +    if ( interfaces < 4 )
> > > > > > > +    {
> > > > > > > +        early_printk("fdt: node `%s': invalid `reg' property\n",
> > > > > name);
> > > > > > > +        return;
> > > > > > > +    }
> > > > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > > > &size);
> > > > > > > +    early_info.gic.gic_dist_addr = start;
> > > > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > > > &size);
> > > > > > > +    early_info.gic.gic_cpu_addr = start;
> > > > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > > > &size);
> > > > > > > +    early_info.gic.gic_hyp_addr = start;
> > > > > > > +    device_tree_get_reg(&cell, address_cells, size_cells, &start,
> > > > > &size);
> > > > > > > +    early_info.gic.gic_vcpu_addr = start;
> > > > > > 
> > > > > > Is the GIC driver still hardcoding the register region sizes?  Or
> > > > > does
> > > > > > it not need the size?
> > > > > 
> > > > > Yes, it is. However we do know the size of all the GIC interfaces
> > > > > because they are specified in the GIC docs.
> > > > 
> > > > Perhaps we ought to check that the size given meets (either == or >=)
> > > > our expectations?
> > > 
> > > OK, in that case I am going to merge the patch with the checks with the
> > > original
> > 
> > Actually I found an issue in the GIC DT specs:
> > 
> > - reg : Specifies base physical address(s) and size of the GIC registers. The
> >   first region is the GIC distributor register base and size. The 2nd region is
> >   the GIC cpu interface register base and size.
> > 
> > however this is what I get for vexpress:
> > 
> > reg = <0 0x2c001000 0 0x1000>,
> >       <0 0x2c002000 0 0x1000>,
> >       <0 0x2c004000 0 0x2000>,
> >       <0 0x2c006000 0 0x2000>;
> > 
> > Leaving aside the last two regions that are due to the virtualization
> > extensions, the size of the cpu interface is one page according to DT.
> > However the GIC specs state that the GICC_DIR register is at offset
> > 0x1000, so it is certainly slightly bigger than one page.
> 
> I think, and I'm not at all sure about this, that 0x1000 is GIC v1 and
> the second page of GICC stuff was introduced with GIC v2.

That's right

> I wonder what version the cortex a9 implemented. This could well be a
> meaningful difference between compat = arm,cortex-a9-gic and
> arm,cortex-a15-gic which isn't current expressed in the DT?

yes, I think the DT hasn't been updated

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:30:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:30:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRbr-0006tL-1o; Fri, 30 Nov 2012 14:30:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TeRbp-0006tG-KT
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 14:30:29 +0000
Received: from [85.158.138.51:4602] by server-11.bemta-3.messagelabs.com id
	3D/E2-19361-203C8B05; Fri, 30 Nov 2012 14:30:26 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1354285708!30259165!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6722 invoked from network); 30 Nov 2012 14:28:29 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 14:28:29 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46167366"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 14:28:27 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:28:27 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TeRZq-0003Ft-Tx;
	Fri, 30 Nov 2012 14:28:26 +0000
Date: Fri, 30 Nov 2012 14:28:21 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Message-ID: <alpine.DEB.2.02.1211301426120.5310@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH v2] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Get the address of the GIC distributor, cpu, virtual and virtual cpu
interfaces registers from device tree.

Note: I couldn't completely get rid of GIC_BASE_ADDRESS, GIC_DR_OFFSET
and friends because we are using them from mode_switch.S, that is
executed before device tree has been parsed. But at least mode_switch.S
is known to contain vexpress specific code anyway.


Changes in v2:
- remove 2 superflous lines from process_gic_node;
- introduce device_tree_get_reg_ranges;
- add a check for uninitialized GIC interface addresses;
- add a check for non-page aligned GIC interface addresses;
- remove the code to deal with non-page aligned addresses from GICC and
GICH.


Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 0c6fab9..2b29e7e 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -26,6 +26,7 @@
 #include <xen/errno.h>
 #include <xen/softirq.h>
 #include <xen/list.h>
+#include <xen/device_tree.h>
 #include <asm/p2m.h>
 #include <asm/domain.h>
 
@@ -33,10 +34,8 @@
 
 /* Access to the GIC Distributor registers through the fixmap */
 #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
-#define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
-                                     + (GIC_CR_OFFSET & 0xfff)))
-#define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
-                                     + (GIC_HR_OFFSET & 0xfff)))
+#define GICC ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICC1)) 
+#define GICH ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICH))
 static void gic_restore_pending_irqs(struct vcpu *v);
 
 /* Global state */
@@ -44,6 +43,7 @@ static struct {
     paddr_t dbase;       /* Address of distributor registers */
     paddr_t cbase;       /* Address of CPU interface registers */
     paddr_t hbase;       /* Address of virtual interface registers */
+    paddr_t vbase;       /* Address of virtual cpu interface registers */
     unsigned int lines;
     unsigned int cpus;
     spinlock_t lock;
@@ -306,10 +306,27 @@ static void __cpuinit gic_hyp_disable(void)
 /* Set up the GIC */
 void __init gic_init(void)
 {
-    /* XXX FIXME get this from devicetree */
-    gic.dbase = GIC_BASE_ADDRESS + GIC_DR_OFFSET;
-    gic.cbase = GIC_BASE_ADDRESS + GIC_CR_OFFSET;
-    gic.hbase = GIC_BASE_ADDRESS + GIC_HR_OFFSET;
+    if ( !early_info.gic.gic_dist_addr ||
+         !early_info.gic.gic_cpu_addr ||
+         !early_info.gic.gic_hyp_addr ||
+         !early_info.gic.gic_vcpu_addr )
+        panic("the physical address of one of the GIC interfaces is missing:\n"
+              "        gic_dist_addr=%"PRIpaddr"\n"
+              "        gic_cpu_addr=%"PRIpaddr"\n"
+              "        gic_hyp_addr=%"PRIpaddr"\n"
+              "        gic_vcpu_addr=%"PRIpaddr"\n",
+              early_info.gic.gic_dist_addr, early_info.gic.gic_cpu_addr,
+              early_info.gic.gic_hyp_addr, early_info.gic.gic_vcpu_addr);
+    if ( (early_info.gic.gic_dist_addr & ~PAGE_MASK) ||
+         (early_info.gic.gic_cpu_addr & ~PAGE_MASK) ||
+         (early_info.gic.gic_hyp_addr & ~PAGE_MASK) ||
+         (early_info.gic.gic_vcpu_addr & ~PAGE_MASK) )
+        panic("error: GIC interfaces not page aligned.\n");
+
+    gic.dbase = early_info.gic.gic_dist_addr;
+    gic.cbase = early_info.gic.gic_cpu_addr;
+    gic.hbase = early_info.gic.gic_hyp_addr;
+    gic.vbase = early_info.gic.gic_vcpu_addr;
     set_fixmap(FIXMAP_GICD, gic.dbase >> PAGE_SHIFT, DEV_SHARED);
     BUILD_BUG_ON(FIXMAP_ADDR(FIXMAP_GICC1) !=
                  FIXMAP_ADDR(FIXMAP_GICC2)-PAGE_SIZE);
@@ -569,9 +586,9 @@ int gicv_setup(struct domain *d)
 {
     /* map the gic virtual cpu interface in the gic cpu interface region of
      * the guest */
-    return map_mmio_regions(d, GIC_BASE_ADDRESS + GIC_CR_OFFSET,
-                        GIC_BASE_ADDRESS + GIC_CR_OFFSET + (2 * PAGE_SIZE) - 1,
-                        GIC_BASE_ADDRESS + GIC_VR_OFFSET);
+    return map_mmio_regions(d, gic.cbase,
+                        gic.cbase + (2 * PAGE_SIZE) - 1,
+                        gic.vbase);
 }
 
 static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index da0af77..8d5b6b0 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -54,6 +54,33 @@ bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
     return !strncmp(prop, match, len);
 }
 
+bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)
+{
+    int len, l;
+    const void *prop;
+
+    prop = fdt_getprop(fdt, node, "compatible", &len);
+    if ( prop == NULL )
+        return 0;
+
+    while ( len > 0 ) {
+        if ( !strncmp(prop, match, strlen(match)) )
+            return 1;
+        l = strlen(prop) + 1;
+        prop += l;
+        len -= l;
+    }
+
+    return 0;
+}
+
+static void device_tree_get_reg_ranges(const struct fdt_property *prop,
+        u32 address_cells, u32 size_cells, int *ranges)
+{
+    u32 reg_cells = address_cells + size_cells;
+    *ranges = fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32));
+}
+
 static void __init get_val(const u32 **cell, u32 cells, u64 *val)
 {
     *val = 0;
@@ -209,7 +236,6 @@ static void __init process_memory_node(const void *fdt, int node,
                                        u32 address_cells, u32 size_cells)
 {
     const struct fdt_property *prop;
-    size_t reg_cells;
     int i;
     int banks;
     const u32 *cell;
@@ -230,8 +256,7 @@ static void __init process_memory_node(const void *fdt, int node,
     }
 
     cell = (const u32 *)prop->data;
-    reg_cells = address_cells + size_cells;
-    banks = fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32));
+    device_tree_get_reg_ranges(prop, address_cells, size_cells, &banks);
 
     for ( i = 0; i < banks && early_info.mem.nr_banks < NR_MEM_BANKS; i++ )
     {
@@ -270,6 +295,46 @@ static void __init process_cpu_node(const void *fdt, int node,
     cpumask_set_cpu(start, &cpu_possible_map);
 }
 
+static void __init process_gic_node(const void *fdt, int node,
+                                    const char *name,
+                                    u32 address_cells, u32 size_cells)
+{
+    const struct fdt_property *prop;
+    const u32 *cell;
+    paddr_t start, size;
+    int interfaces;
+
+    if ( address_cells < 1 || size_cells < 1 )
+    {
+        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
+                     name);
+        return;
+    }
+
+    prop = fdt_get_property(fdt, node, "reg", NULL);
+    if ( !prop )
+    {
+        early_printk("fdt: node `%s': missing `reg' property\n", name);
+        return;
+    }
+
+    cell = (const u32 *)prop->data;
+    device_tree_get_reg_ranges(prop, address_cells, size_cells, &interfaces);
+    if ( interfaces < 4 )
+    {
+        early_printk("fdt: node `%s': invalid `reg' property\n", name);
+        return;
+    }
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_dist_addr = start;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_cpu_addr = start;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_hyp_addr = start;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_vcpu_addr = start;
+}
+
 static int __init early_scan_node(const void *fdt,
                                   int node, const char *name, int depth,
                                   u32 address_cells, u32 size_cells,
@@ -279,6 +344,8 @@ static int __init early_scan_node(const void *fdt,
         process_memory_node(fdt, node, name, address_cells, size_cells);
     else if ( device_tree_type_matches(fdt, node, "cpu") )
         process_cpu_node(fdt, node, name, address_cells, size_cells);
+    else if ( device_tree_node_compatible(fdt, node, "arm,cortex-a15-gic") )
+        process_gic_node(fdt, node, name, address_cells, size_cells);
 
     return 0;
 }
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 4d010c0..a0e3a97 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -26,8 +26,16 @@ struct dt_mem_info {
     struct membank bank[NR_MEM_BANKS];
 };
 
+struct dt_gic_info {
+    paddr_t gic_dist_addr;
+    paddr_t gic_cpu_addr;
+    paddr_t gic_hyp_addr;
+    paddr_t gic_vcpu_addr;
+};
+
 struct dt_early_info {
     struct dt_mem_info mem;
+    struct dt_gic_info gic;
 };
 
 typedef int (*device_tree_node_func)(const void *fdt,

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:30:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:30:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRbr-0006tL-1o; Fri, 30 Nov 2012 14:30:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TeRbp-0006tG-KT
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 14:30:29 +0000
Received: from [85.158.138.51:4602] by server-11.bemta-3.messagelabs.com id
	3D/E2-19361-203C8B05; Fri, 30 Nov 2012 14:30:26 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1354285708!30259165!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6722 invoked from network); 30 Nov 2012 14:28:29 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-15.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 14:28:29 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46167366"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 14:28:27 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:28:27 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TeRZq-0003Ft-Tx;
	Fri, 30 Nov 2012 14:28:26 +0000
Date: Fri, 30 Nov 2012 14:28:21 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Message-ID: <alpine.DEB.2.02.1211301426120.5310@kaball.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Anthony Perard <anthony.perard@citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH v2] xen: get GIC addresses from DT
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Get the address of the GIC distributor, cpu, virtual and virtual cpu
interfaces registers from device tree.

Note: I couldn't completely get rid of GIC_BASE_ADDRESS, GIC_DR_OFFSET
and friends because we are using them from mode_switch.S, that is
executed before device tree has been parsed. But at least mode_switch.S
is known to contain vexpress specific code anyway.


Changes in v2:
- remove 2 superflous lines from process_gic_node;
- introduce device_tree_get_reg_ranges;
- add a check for uninitialized GIC interface addresses;
- add a check for non-page aligned GIC interface addresses;
- remove the code to deal with non-page aligned addresses from GICC and
GICH.


Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 0c6fab9..2b29e7e 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -26,6 +26,7 @@
 #include <xen/errno.h>
 #include <xen/softirq.h>
 #include <xen/list.h>
+#include <xen/device_tree.h>
 #include <asm/p2m.h>
 #include <asm/domain.h>
 
@@ -33,10 +34,8 @@
 
 /* Access to the GIC Distributor registers through the fixmap */
 #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
-#define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
-                                     + (GIC_CR_OFFSET & 0xfff)))
-#define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
-                                     + (GIC_HR_OFFSET & 0xfff)))
+#define GICC ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICC1)) 
+#define GICH ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICH))
 static void gic_restore_pending_irqs(struct vcpu *v);
 
 /* Global state */
@@ -44,6 +43,7 @@ static struct {
     paddr_t dbase;       /* Address of distributor registers */
     paddr_t cbase;       /* Address of CPU interface registers */
     paddr_t hbase;       /* Address of virtual interface registers */
+    paddr_t vbase;       /* Address of virtual cpu interface registers */
     unsigned int lines;
     unsigned int cpus;
     spinlock_t lock;
@@ -306,10 +306,27 @@ static void __cpuinit gic_hyp_disable(void)
 /* Set up the GIC */
 void __init gic_init(void)
 {
-    /* XXX FIXME get this from devicetree */
-    gic.dbase = GIC_BASE_ADDRESS + GIC_DR_OFFSET;
-    gic.cbase = GIC_BASE_ADDRESS + GIC_CR_OFFSET;
-    gic.hbase = GIC_BASE_ADDRESS + GIC_HR_OFFSET;
+    if ( !early_info.gic.gic_dist_addr ||
+         !early_info.gic.gic_cpu_addr ||
+         !early_info.gic.gic_hyp_addr ||
+         !early_info.gic.gic_vcpu_addr )
+        panic("the physical address of one of the GIC interfaces is missing:\n"
+              "        gic_dist_addr=%"PRIpaddr"\n"
+              "        gic_cpu_addr=%"PRIpaddr"\n"
+              "        gic_hyp_addr=%"PRIpaddr"\n"
+              "        gic_vcpu_addr=%"PRIpaddr"\n",
+              early_info.gic.gic_dist_addr, early_info.gic.gic_cpu_addr,
+              early_info.gic.gic_hyp_addr, early_info.gic.gic_vcpu_addr);
+    if ( (early_info.gic.gic_dist_addr & ~PAGE_MASK) ||
+         (early_info.gic.gic_cpu_addr & ~PAGE_MASK) ||
+         (early_info.gic.gic_hyp_addr & ~PAGE_MASK) ||
+         (early_info.gic.gic_vcpu_addr & ~PAGE_MASK) )
+        panic("error: GIC interfaces not page aligned.\n");
+
+    gic.dbase = early_info.gic.gic_dist_addr;
+    gic.cbase = early_info.gic.gic_cpu_addr;
+    gic.hbase = early_info.gic.gic_hyp_addr;
+    gic.vbase = early_info.gic.gic_vcpu_addr;
     set_fixmap(FIXMAP_GICD, gic.dbase >> PAGE_SHIFT, DEV_SHARED);
     BUILD_BUG_ON(FIXMAP_ADDR(FIXMAP_GICC1) !=
                  FIXMAP_ADDR(FIXMAP_GICC2)-PAGE_SIZE);
@@ -569,9 +586,9 @@ int gicv_setup(struct domain *d)
 {
     /* map the gic virtual cpu interface in the gic cpu interface region of
      * the guest */
-    return map_mmio_regions(d, GIC_BASE_ADDRESS + GIC_CR_OFFSET,
-                        GIC_BASE_ADDRESS + GIC_CR_OFFSET + (2 * PAGE_SIZE) - 1,
-                        GIC_BASE_ADDRESS + GIC_VR_OFFSET);
+    return map_mmio_regions(d, gic.cbase,
+                        gic.cbase + (2 * PAGE_SIZE) - 1,
+                        gic.vbase);
 }
 
 static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index da0af77..8d5b6b0 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -54,6 +54,33 @@ bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
     return !strncmp(prop, match, len);
 }
 
+bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)
+{
+    int len, l;
+    const void *prop;
+
+    prop = fdt_getprop(fdt, node, "compatible", &len);
+    if ( prop == NULL )
+        return 0;
+
+    while ( len > 0 ) {
+        if ( !strncmp(prop, match, strlen(match)) )
+            return 1;
+        l = strlen(prop) + 1;
+        prop += l;
+        len -= l;
+    }
+
+    return 0;
+}
+
+static void device_tree_get_reg_ranges(const struct fdt_property *prop,
+        u32 address_cells, u32 size_cells, int *ranges)
+{
+    u32 reg_cells = address_cells + size_cells;
+    *ranges = fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32));
+}
+
 static void __init get_val(const u32 **cell, u32 cells, u64 *val)
 {
     *val = 0;
@@ -209,7 +236,6 @@ static void __init process_memory_node(const void *fdt, int node,
                                        u32 address_cells, u32 size_cells)
 {
     const struct fdt_property *prop;
-    size_t reg_cells;
     int i;
     int banks;
     const u32 *cell;
@@ -230,8 +256,7 @@ static void __init process_memory_node(const void *fdt, int node,
     }
 
     cell = (const u32 *)prop->data;
-    reg_cells = address_cells + size_cells;
-    banks = fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32));
+    device_tree_get_reg_ranges(prop, address_cells, size_cells, &banks);
 
     for ( i = 0; i < banks && early_info.mem.nr_banks < NR_MEM_BANKS; i++ )
     {
@@ -270,6 +295,46 @@ static void __init process_cpu_node(const void *fdt, int node,
     cpumask_set_cpu(start, &cpu_possible_map);
 }
 
+static void __init process_gic_node(const void *fdt, int node,
+                                    const char *name,
+                                    u32 address_cells, u32 size_cells)
+{
+    const struct fdt_property *prop;
+    const u32 *cell;
+    paddr_t start, size;
+    int interfaces;
+
+    if ( address_cells < 1 || size_cells < 1 )
+    {
+        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
+                     name);
+        return;
+    }
+
+    prop = fdt_get_property(fdt, node, "reg", NULL);
+    if ( !prop )
+    {
+        early_printk("fdt: node `%s': missing `reg' property\n", name);
+        return;
+    }
+
+    cell = (const u32 *)prop->data;
+    device_tree_get_reg_ranges(prop, address_cells, size_cells, &interfaces);
+    if ( interfaces < 4 )
+    {
+        early_printk("fdt: node `%s': invalid `reg' property\n", name);
+        return;
+    }
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_dist_addr = start;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_cpu_addr = start;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_hyp_addr = start;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_vcpu_addr = start;
+}
+
 static int __init early_scan_node(const void *fdt,
                                   int node, const char *name, int depth,
                                   u32 address_cells, u32 size_cells,
@@ -279,6 +344,8 @@ static int __init early_scan_node(const void *fdt,
         process_memory_node(fdt, node, name, address_cells, size_cells);
     else if ( device_tree_type_matches(fdt, node, "cpu") )
         process_cpu_node(fdt, node, name, address_cells, size_cells);
+    else if ( device_tree_node_compatible(fdt, node, "arm,cortex-a15-gic") )
+        process_gic_node(fdt, node, name, address_cells, size_cells);
 
     return 0;
 }
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 4d010c0..a0e3a97 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -26,8 +26,16 @@ struct dt_mem_info {
     struct membank bank[NR_MEM_BANKS];
 };
 
+struct dt_gic_info {
+    paddr_t gic_dist_addr;
+    paddr_t gic_cpu_addr;
+    paddr_t gic_hyp_addr;
+    paddr_t gic_vcpu_addr;
+};
+
 struct dt_early_info {
     struct dt_mem_info mem;
+    struct dt_gic_info gic;
 };
 
 typedef int (*device_tree_node_func)(const void *fdt,

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:49:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRuO-0007XG-Du; Fri, 30 Nov 2012 14:49:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRuN-0007Wz-3d
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:39 +0000
Received: from [85.158.139.211:23600] by server-2.bemta-5.messagelabs.com id
	60/15-04892-287C8B05; Fri, 30 Nov 2012 14:49:38 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-12.tower-206.messagelabs.com!1354286977!18432322!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18343 invoked from network); 30 Nov 2012 14:49:37 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-12.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 14:49:37 -0000
X-TM-IMSS-Message-ID: <3366085700026bac@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3366085700026bac ;
	Fri, 30 Nov 2012 09:48:17 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLqn014134; 
	Fri, 30 Nov 2012 09:49:23 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:15 -0500
Message-Id: <1354286955-23900-10-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 9/9] stubdom/vtpm: Add PCR pass-through to
	hardware TPM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This allows the hardware TPM's PCRs to be accessed from a vTPM for
debugging and as a simple alternative to a deep quote in situations
where the integrity of the vTPM's own TCB is not in question.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/Makefile                   |  1 +
 stubdom/vtpm-pcr-passthrough.patch | 73 ++++++++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm_cmd.c            | 38 ++++++++++++++++++++
 3 files changed, 112 insertions(+)
 create mode 100644 stubdom/vtpm-pcr-passthrough.patch

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 790b547..03ec07e 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -210,6 +210,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	patch -d $@ -p1 < vtpm-locality.patch
 	patch -d $@ -p1 < vtpm-bufsize.patch
 	patch -d $@ -p1 < vtpm-locality5-pcrs.patch
+	patch -d $@ -p1 < vtpm-pcr-passthrough.patch
 	mkdir $@/build
 	cd $@/build; $(CMAKE) .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
 	touch $@
diff --git a/stubdom/vtpm-pcr-passthrough.patch b/stubdom/vtpm-pcr-passthrough.patch
new file mode 100644
index 0000000..4e898a5
--- /dev/null
+++ b/stubdom/vtpm-pcr-passthrough.patch
@@ -0,0 +1,73 @@
+diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
+index f8f7f0f..885af52 100644
+--- a/tpm/tpm_capability.c
++++ b/tpm/tpm_capability.c
+@@ -72,7 +72,7 @@ static TPM_RESULT cap_property(UINT32 subCapSize, BYTE *subCap,
+   switch (property) {
+     case TPM_CAP_PROP_PCR:
+       debug("[TPM_CAP_PROP_PCR]");
+-      return return_UINT32(respSize, resp, TPM_NUM_PCR);
++      return return_UINT32(respSize, resp, TPM_NUM_PCR_V);
+ 
+     case TPM_CAP_PROP_DIR:
+       debug("[TPM_CAP_PROP_DIR]");
+diff --git a/tpm/tpm_emulator_extern.h b/tpm/tpm_emulator_extern.h
+index 36a32dd..77ed595 100644
+--- a/tpm/tpm_emulator_extern.h
++++ b/tpm/tpm_emulator_extern.h
+@@ -56,6 +56,7 @@ void (*tpm_free)(/*const*/ void *ptr);
+ /* random numbers */
+ 
+ void (*tpm_get_extern_random_bytes)(void *buf, size_t nbytes);
++void tpm_get_extern_pcr(int index, void *buf);
+ 
+ /* usec since last call */
+ 
+diff --git a/tpm/tpm_integrity.c b/tpm/tpm_integrity.c
+index 66ece83..f3c4196 100644
+--- a/tpm/tpm_integrity.c
++++ b/tpm/tpm_integrity.c
+@@ -56,8 +56,11 @@ TPM_RESULT TPM_Extend(TPM_PCRINDEX pcrNum, TPM_DIGEST *inDigest,
+ TPM_RESULT TPM_PCRRead(TPM_PCRINDEX pcrIndex, TPM_PCRVALUE *outDigest)
+ {
+   info("TPM_PCRRead()");
+-  if (pcrIndex >= TPM_NUM_PCR) return TPM_BADINDEX;
+-  memcpy(outDigest, &PCR_VALUE[pcrIndex], sizeof(TPM_PCRVALUE));
++  if (pcrIndex >= TPM_NUM_PCR_V) return TPM_BADINDEX;
++  if (pcrIndex >= TPM_NUM_PCR)
++	tpm_get_extern_pcr(pcrIndex - TPM_NUM_PCR, outDigest);
++  else
++    memcpy(outDigest, &PCR_VALUE[pcrIndex], sizeof(TPM_PCRVALUE));
+   return TPM_SUCCESS;
+ }
+ 
+@@ -138,12 +141,15 @@ TPM_RESULT tpm_compute_pcr_digest(TPM_PCR_SELECTION *pcrSelection,
+   BYTE *buf, *ptr;
+   info("tpm_compute_pcr_digest()");
+   /* create PCR composite */
+-  if ((pcrSelection->sizeOfSelect * 8) > TPM_NUM_PCR
++  if ((pcrSelection->sizeOfSelect * 8) > TPM_NUM_PCR_V
+       || pcrSelection->sizeOfSelect == 0) return TPM_INVALID_PCR_INFO;
+   for (i = 0, j = 0; i < pcrSelection->sizeOfSelect * 8; i++) {
+     /* is PCR number i selected ? */
+     if (pcrSelection->pcrSelect[i >> 3] & (1 << (i & 7))) {
+-      memcpy(&comp.pcrValue[j++], &PCR_VALUE[i], sizeof(TPM_PCRVALUE));
++      if (i >= TPM_NUM_PCR)
++        tpm_get_extern_pcr(i - TPM_NUM_PCR, &comp.pcrValue[j++]);
++      else
++        memcpy(&comp.pcrValue[j++], &PCR_VALUE[i], sizeof(TPM_PCRVALUE));
+     }
+   }
+   memcpy(&comp.select, pcrSelection, sizeof(TPM_PCR_SELECTION));
+diff --git a/tpm/tpm_structures.h b/tpm/tpm_structures.h
+index 08cef1e..8c97fc5 100644
+--- a/tpm/tpm_structures.h
++++ b/tpm/tpm_structures.h
+@@ -677,6 +677,7 @@ typedef struct tdTPM_CMK_MA_APPROVAL {
+  * Number of PCRs of the TPM (must be a multiple of eight)
+  */
+ #define TPM_NUM_PCR 32
++#define TPM_NUM_PCR_V (TPM_NUM_PCR + 24)
+ 
+ /*
+  * TPM_PCR_SELECTION ([TPM_Part2], Section 8.1)
diff --git a/stubdom/vtpm/vtpm_cmd.c b/stubdom/vtpm/vtpm_cmd.c
index 7eae98b..ed058fb 100644
--- a/stubdom/vtpm/vtpm_cmd.c
+++ b/stubdom/vtpm/vtpm_cmd.c
@@ -134,6 +134,44 @@ egress:
 
 }
 
+extern struct tpmfront_dev* tpmfront_dev;
+void tpm_get_extern_pcr(int index, void *buf) {
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* cmdbuf, *resp, *bptr;
+   size_t resplen = 0;
+   UINT32 len;
+
+   /*Ask the real tpm for the PCR value */
+   TPM_TAG tag = TPM_TAG_RQU_COMMAND;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = TPM_ORD_PCRRead;
+   len = size = sizeof(TPM_TAG) + sizeof(UINT32) + sizeof(TPM_COMMAND_CODE) + sizeof(UINT32);
+
+   /*Create the raw tpm command */
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   TRYFAILGOTO(tpm_marshal_UINT32(&bptr, &len, index));
+
+   /* Send cmd, wait for response */
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen),
+      ERR_TPMFRONT);
+
+   bptr = resp; len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   //Check return status of command
+   CHECKSTATUSGOTO(ord, "TPM_PCRRead()");
+
+   //Get the PCR value out
+   TRYFAILGOTOMSG(tpm_unmarshal_BYTE_ARRAY(&bptr, &len, buf, 20), ERR_MALFORMED);
+
+   goto egress;
+abort_egress:
+   memset(buf, 0x20, 20);
+egress:
+   free(cmdbuf);
+}
+
 TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length)
 {
    TPM_RESULT status = TPM_SUCCESS;
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:49:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRuN-0007X4-1q; Fri, 30 Nov 2012 14:49:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRuL-0007Wz-MG
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:37 +0000
Received: from [85.158.139.211:62786] by server-2.bemta-5.messagelabs.com id
	25/05-04892-087C8B05; Fri, 30 Nov 2012 14:49:36 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-12.tower-206.messagelabs.com!1354286975!18432314!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18217 invoked from network); 30 Nov 2012 14:49:36 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-12.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 14:49:36 -0000
X-TM-IMSS-Message-ID: <3365ff6200026ba3@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3365ff6200026ba3 ;
	Fri, 30 Nov 2012 09:48:15 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLqe014134; 
	Fri, 30 Nov 2012 09:49:21 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:06 -0500
Message-Id: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH v2 0/9] vTPM new ABI, extensions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch queue goes on top of Matthew Fioravante's [VTPM v5 0/7]
series. While some of the patches have been posted before, all have
been cleaned up a bit.

[PATCH 1/9] stubdom: Change vTPM shared page ABI
	* Removed unneeded reconfiguration pieces
	* Removed feature-protocol-v2 xenstore key references

[PATCH 2/9] stubdom/vtpm: Support locality field
	* Add distinct patch file instead of patching a patch
	* Comment on future use of the locality field

[PATCH 3/9] stubdom/vtpm: correct the buffer size returned by
	* New patch

[PATCH 4/9] stubdom/vtpm: Add locality-5 PCRs
	* New patch

[PATCH 5/9] stubdom/vtpm: Allow repoen of closed devices
	* This used to use Reconfigure, but has been changed to use
	  the Closed states similar to blkback

[PATCH 6/9] stubdom/vtpm: make state save operation atomic
	* Avoid hardcoded maximum saved state size
	* Better debug/error messages

[PATCH 7/9] stubdom/grub: send kernel measurements to vTPM
	* Use PolarSSL SHA1 function
	* Use byteswap.h functions

[PATCH 8/9] stubdom/vtpm: support multiple backends
	* Split into its own patch so it can be excluded if
	  automatic vTPM shutdown is required

[PATCH 9/9] stubdom/vtpm: Add PCR pass-through to hardware TPM
	* New patch, RFC; an alternative to hwinitpcrs

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:49:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRuT-0007Z7-7K; Fri, 30 Nov 2012 14:49:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRuR-0007Xy-EC
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:43 +0000
Received: from [85.158.139.83:24699] by server-13.bemta-5.messagelabs.com id
	D6/D0-27809-687C8B05; Fri, 30 Nov 2012 14:49:42 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-6.tower-182.messagelabs.com!1354286981!23956987!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18652 invoked from network); 30 Nov 2012 14:49:41 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-6.tower-182.messagelabs.com with SMTP;
	30 Nov 2012 14:49:41 -0000
X-TM-IMSS-Message-ID: <d074d17d00057ac6@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d074d17d00057ac6 ;
	Fri, 30 Nov 2012 09:49:28 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLqi014134; 
	Fri, 30 Nov 2012 09:49:22 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:10 -0500
Message-Id: <1354286955-23900-5-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 4/9] stubdom/vtpm: Add locality-5 PCRs
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This defines new PCRs (24-31) that are restricted to locality 5, which
can be used by an agent outside a domain to record information about its
measurements and activity. These PCRs cannot be initialized from the
hardware TPM (since most hardware TPMs do not define PCR 24+).

This definition may need to be changed in the future, as the TCG's VTPM
working group is working to define the meaning of PCRs above 23 on a
vTPM; the existing PC-client specification allows these PCRs to be
implementation-defined.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/Makefile                  |  1 +
 stubdom/vtpm-locality5-pcrs.patch | 33 +++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm.c               |  8 ++++----
 stubdom/vtpm/vtpm_pcrs.h          |  6 +++---
 4 files changed, 41 insertions(+), 7 deletions(-)
 create mode 100644 stubdom/vtpm-locality5-pcrs.patch

diff --git a/stubdom/Makefile b/stubdom/Makefile
index c01f1a5..4744b79 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -209,6 +209,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
 	patch -d $@ -p1 < vtpm-locality.patch
 	patch -d $@ -p1 < vtpm-bufsize.patch
+	patch -d $@ -p1 < vtpm-locality5-pcrs.patch
 	mkdir $@/build
 	cd $@/build; $(CMAKE) .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
 	touch $@
diff --git a/stubdom/vtpm-locality5-pcrs.patch b/stubdom/vtpm-locality5-pcrs.patch
new file mode 100644
index 0000000..f697035
--- /dev/null
+++ b/stubdom/vtpm-locality5-pcrs.patch
@@ -0,0 +1,33 @@
+diff --git a/tpm/tpm_data.c b/tpm/tpm_data.c
+index 50c9697..d8cac09 100644
+--- a/tpm/tpm_data.c
++++ b/tpm/tpm_data.c
+@@ -151,9 +151,12 @@ void tpm_init_data(void)
+     init_pcr_attr(22, TRUE, 0x04, 0x04);
+     init_pcr_attr(23, TRUE, 0x1f, 0x1f);
+   }
+-  for (i = 24; i < TPM_NUM_PCR; i++) {
+-    init_pcr_attr(i, TRUE, 0x00, 0x00);
+-  }
++  for (i = 24; i < 28 && i < TPM_NUM_PCR; i++)
++    init_pcr_attr(i, FALSE, 0x00, 0x20);
++  for (i = 28; i < 32 && i < TPM_NUM_PCR; i++)
++    init_pcr_attr(i, TRUE, 0x20, 0x20);
++  for (i = 32; i < TPM_NUM_PCR; i++)
++    init_pcr_attr(i, FALSE, 0x00, 0xC0);
+   if (tpmConf & TPM_CONF_GENERATE_EK) {
+     /* generate a new endorsement key */
+     tpm_rsa_generate_key(&tpmData.permanent.data.endorsementKey, 2048);
+diff --git a/tpm/tpm_structures.h b/tpm/tpm_structures.h
+index f746c05..08cef1e 100644
+--- a/tpm/tpm_structures.h
++++ b/tpm/tpm_structures.h
+@@ -676,7 +676,7 @@ typedef struct tdTPM_CMK_MA_APPROVAL {
+ /*
+  * Number of PCRs of the TPM (must be a multiple of eight)
+  */
+-#define TPM_NUM_PCR 24
++#define TPM_NUM_PCR 32
+ 
+ /*
+  * TPM_PCR_SELECTION ([TPM_Part2], Section 8.1)
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
index eb7912f..aaf1a24 100644
--- a/stubdom/vtpm/vtpm.c
+++ b/stubdom/vtpm/vtpm.c
@@ -253,18 +253,18 @@ int parse_cmd_line(int argc, char** argv)
                opt_args.hwinitpcrs = VTPM_PCRNONE;
             } else if(sscanf(pch, "%u", &v1) == 1) {
                //Set one
-               if(v1 >= TPM_NUM_PCR) {
+               if(v1 >= VTPM_NUMPCRS) {
                   error("hwinitpcr error: Invalid PCR index %u", v1);
                   return -1;
                }
                opt_args.hwinitpcrs |= (1 << v1);
             } else if(sscanf(pch, "%u-%u", &v1, &v2) == 2) {
                //Set range
-               if(v1 >= TPM_NUM_PCR) {
+               if(v1 >= VTPM_NUMPCRS) {
                   error("hwinitpcr error: Invalid PCR index %u", v1);
                   return -1;
                }
-               if(v2 >= TPM_NUM_PCR) {
+               if(v2 >= VTPM_NUMPCRS) {
                   error("hwinitpcr error: Invalid PCR index %u", v1);
                   return -1;
                }
@@ -312,7 +312,7 @@ int parse_cmd_line(int argc, char** argv)
 
       pcrstr[0] = '\0';
       info("The following PCRs will be initialized with values from the hardware TPM:");
-      for(unsigned int i = 0; i < TPM_NUM_PCR; ++i) {
+      for(unsigned int i = 0; i < VTPM_NUMPCRS; ++i) {
          if(opt_args.hwinitpcrs & (1 << i)) {
             ptr += sprintf(ptr, "%u, ", i);
          }
diff --git a/stubdom/vtpm/vtpm_pcrs.h b/stubdom/vtpm/vtpm_pcrs.h
index 11835f9..bd9068c 100644
--- a/stubdom/vtpm/vtpm_pcrs.h
+++ b/stubdom/vtpm/vtpm_pcrs.h
@@ -40,11 +40,11 @@
 #define VTPM_PCR22 1 << 22
 #define VTPM_PCR23 1 << 23
 
-#define VTPM_PCRALL (1 << TPM_NUM_PCR) - 1
-#define VTPM_PCRNONE 0
-
 #define VTPM_NUMPCRS 24
 
+#define VTPM_PCRALL (1 << VTPM_NUMPCRS) - 1
+#define VTPM_PCRNONE 0
+
 struct tpmfront_dev;
 
 TPM_RESULT vtpm_initialize_hw_pcrs(struct tpmfront_dev* tpmfront_dev, unsigned long pcrs);
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:49:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRuS-0007Yu-QV; Fri, 30 Nov 2012 14:49:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRuQ-0007Xh-TE
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:43 +0000
Received: from [85.158.139.83:24625] by server-1.bemta-5.messagelabs.com id
	12/6C-09311-687C8B05; Fri, 30 Nov 2012 14:49:42 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-16.tower-182.messagelabs.com!1354286980!20482575!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15157 invoked from network); 30 Nov 2012 14:49:41 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-16.tower-182.messagelabs.com with SMTP;
	30 Nov 2012 14:49:41 -0000
X-TM-IMSS-Message-ID: <d074d49900057ac7@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d074d49900057ac7 ;
	Fri, 30 Nov 2012 09:49:29 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLql014134; 
	Fri, 30 Nov 2012 09:49:23 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:13 -0500
Message-Id: <1354286955-23900-8-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 7/9] stubdom/grub: send kernel measurements to
	vTPM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This allows a domU with an arbitrary kernel and initrd to take advantage
of the static root of trust provided by a vTPM.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/Makefile        |  2 +-
 stubdom/grub/Makefile   |  1 +
 stubdom/grub/kexec.c    | 54 +++++++++++++++++++++++++++++++++++++++++++++++++
 stubdom/grub/minios.cfg |  1 +
 4 files changed, 57 insertions(+), 1 deletion(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 4744b79..790b547 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -399,7 +399,7 @@ grub-upstream: grub-$(GRUB_VERSION).tar.gz
 	done
 
 .PHONY: grub
-grub: grub-upstream $(CROSS_ROOT)
+grub: cross-polarssl grub-upstream $(CROSS_ROOT)
 	mkdir -p grub-$(XEN_TARGET_ARCH)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ OBJ_DIR=$(CURDIR)/grub-$(XEN_TARGET_ARCH)
 
diff --git a/stubdom/grub/Makefile b/stubdom/grub/Makefile
index d6e3a1e..6bd2c4c 100644
--- a/stubdom/grub/Makefile
+++ b/stubdom/grub/Makefile
@@ -60,6 +60,7 @@ NETBOOT_SOURCES:=$(addprefix netboot/,$(NETBOOT_SOURCES))
 $(BOOT): DEF_CPPFLAGS+=-D__ASSEMBLY__
 
 PV_GRUB_SOURCES = kexec.c mini-os.c
+PV_GRUB_SOURCES += ../polarssl-$(XEN_TARGET_ARCH)/library/sha1.o
 
 SOURCES = $(NETBOOT_SOURCES) $(STAGE2_SOURCES) $(PV_GRUB_SOURCES)
 
diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index b21c91a..cef357e 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -28,7 +28,9 @@
 #include <blkfront.h>
 #include <netfront.h>
 #include <fbfront.h>
+#include <tpmfront.h>
 #include <shared.h>
+#include <byteswap.h>
 
 #include "mini-os.h"
 
@@ -54,6 +56,22 @@ static unsigned long allocated;
 int pin_table(xc_interface *xc_handle, unsigned int type, unsigned long mfn,
               domid_t dom);
 
+#define TPM_TAG_RQU_COMMAND 0xC1
+#define TPM_ORD_Extend 20
+
+struct pcr_extend_cmd {
+	uint16_t tag;
+	uint32_t size;
+	uint32_t ord;
+
+	uint32_t pcr;
+	unsigned char hash[20];
+} __attribute__((packed));
+
+/* Not imported from polarssl's header since the prototype unhelpfully defines
+ * the input as unsigned char, which causes pointer type mismatches */
+void sha1(const void *input, size_t ilen, unsigned char output[20]);
+
 /* We need mfn to appear as target_pfn, so exchange with the MFN there */
 static void do_exchange(struct xc_dom_image *dom, xen_pfn_t target_pfn, xen_pfn_t source_mfn)
 {
@@ -117,6 +135,40 @@ int kexec_allocate(struct xc_dom_image *dom, xen_vaddr_t up_to)
     return 0;
 }
 
+static void tpm_hash2pcr(struct xc_dom_image *dom, char *cmdline)
+{
+	struct tpmfront_dev* tpm = init_tpmfront(NULL);
+	uint8_t *resp;
+	size_t resplen = 0;
+	struct pcr_extend_cmd cmd;
+
+	/* If all guests have access to a vTPM, it may be useful to replace this
+	 * with ASSERT(tpm) to prevent configuration errors from allowing a guest
+	 * to boot without a TPM (or with a TPM that has not been sent any
+	 * measurements, which could allow forging the measurements).
+	 */
+	if (!tpm)
+		return;
+
+	cmd.tag = bswap_16(TPM_TAG_RQU_COMMAND);
+	cmd.size = bswap_32(sizeof(cmd));
+	cmd.ord = bswap_32(TPM_ORD_Extend);
+	cmd.pcr = bswap_32(4); // PCR #4 for kernel
+	sha1(dom->kernel_blob, dom->kernel_size, cmd.hash);
+
+	tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
+
+	cmd.pcr = bswap_32(5); // PCR #5 for cmdline
+	sha1(cmdline, strlen(cmdline), cmd.hash);
+	tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
+
+	cmd.pcr = bswap_32(5); // PCR #5 for initrd
+	sha1(dom->ramdisk_blob, dom->ramdisk_size, cmd.hash);
+	tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
+
+	shutdown_tpmfront(tpm);
+}
+
 void kexec(void *kernel, long kernel_size, void *module, long module_size, char *cmdline, unsigned long flags)
 {
     struct xc_dom_image *dom;
@@ -151,6 +203,8 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
     dom->console_evtchn = start_info.console.domU.evtchn;
     dom->xenstore_evtchn = start_info.store_evtchn;
 
+    tpm_hash2pcr(dom, cmdline);
+
     if ( (rc = xc_dom_boot_xen_init(dom, xc_handle, domid)) != 0 ) {
         grub_printf("xc_dom_boot_xen_init returned %d\n", rc);
         errnum = ERR_BOOT_FAILURE;
diff --git a/stubdom/grub/minios.cfg b/stubdom/grub/minios.cfg
index 40cfa68..8df4909 100644
--- a/stubdom/grub/minios.cfg
+++ b/stubdom/grub/minios.cfg
@@ -1,2 +1,3 @@
 CONFIG_START_NETWORK=n
 CONFIG_SPARSE_BSS=n
+CONFIG_TPMFRONT=y
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:49:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRuT-0007Z7-7K; Fri, 30 Nov 2012 14:49:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRuR-0007Xy-EC
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:43 +0000
Received: from [85.158.139.83:24699] by server-13.bemta-5.messagelabs.com id
	D6/D0-27809-687C8B05; Fri, 30 Nov 2012 14:49:42 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-6.tower-182.messagelabs.com!1354286981!23956987!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18652 invoked from network); 30 Nov 2012 14:49:41 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-6.tower-182.messagelabs.com with SMTP;
	30 Nov 2012 14:49:41 -0000
X-TM-IMSS-Message-ID: <d074d17d00057ac6@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d074d17d00057ac6 ;
	Fri, 30 Nov 2012 09:49:28 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLqi014134; 
	Fri, 30 Nov 2012 09:49:22 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:10 -0500
Message-Id: <1354286955-23900-5-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 4/9] stubdom/vtpm: Add locality-5 PCRs
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This defines new PCRs (24-31) that are restricted to locality 5, which
can be used by an agent outside a domain to record information about its
measurements and activity. These PCRs cannot be initialized from the
hardware TPM (since most hardware TPMs do not define PCR 24+).

This definition may need to be changed in the future, as the TCG's VTPM
working group is working to define the meaning of PCRs above 23 on a
vTPM; the existing PC-client specification allows these PCRs to be
implementation-defined.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/Makefile                  |  1 +
 stubdom/vtpm-locality5-pcrs.patch | 33 +++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm.c               |  8 ++++----
 stubdom/vtpm/vtpm_pcrs.h          |  6 +++---
 4 files changed, 41 insertions(+), 7 deletions(-)
 create mode 100644 stubdom/vtpm-locality5-pcrs.patch

diff --git a/stubdom/Makefile b/stubdom/Makefile
index c01f1a5..4744b79 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -209,6 +209,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
 	patch -d $@ -p1 < vtpm-locality.patch
 	patch -d $@ -p1 < vtpm-bufsize.patch
+	patch -d $@ -p1 < vtpm-locality5-pcrs.patch
 	mkdir $@/build
 	cd $@/build; $(CMAKE) .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
 	touch $@
diff --git a/stubdom/vtpm-locality5-pcrs.patch b/stubdom/vtpm-locality5-pcrs.patch
new file mode 100644
index 0000000..f697035
--- /dev/null
+++ b/stubdom/vtpm-locality5-pcrs.patch
@@ -0,0 +1,33 @@
+diff --git a/tpm/tpm_data.c b/tpm/tpm_data.c
+index 50c9697..d8cac09 100644
+--- a/tpm/tpm_data.c
++++ b/tpm/tpm_data.c
+@@ -151,9 +151,12 @@ void tpm_init_data(void)
+     init_pcr_attr(22, TRUE, 0x04, 0x04);
+     init_pcr_attr(23, TRUE, 0x1f, 0x1f);
+   }
+-  for (i = 24; i < TPM_NUM_PCR; i++) {
+-    init_pcr_attr(i, TRUE, 0x00, 0x00);
+-  }
++  for (i = 24; i < 28 && i < TPM_NUM_PCR; i++)
++    init_pcr_attr(i, FALSE, 0x00, 0x20);
++  for (i = 28; i < 32 && i < TPM_NUM_PCR; i++)
++    init_pcr_attr(i, TRUE, 0x20, 0x20);
++  for (i = 32; i < TPM_NUM_PCR; i++)
++    init_pcr_attr(i, FALSE, 0x00, 0xC0);
+   if (tpmConf & TPM_CONF_GENERATE_EK) {
+     /* generate a new endorsement key */
+     tpm_rsa_generate_key(&tpmData.permanent.data.endorsementKey, 2048);
+diff --git a/tpm/tpm_structures.h b/tpm/tpm_structures.h
+index f746c05..08cef1e 100644
+--- a/tpm/tpm_structures.h
++++ b/tpm/tpm_structures.h
+@@ -676,7 +676,7 @@ typedef struct tdTPM_CMK_MA_APPROVAL {
+ /*
+  * Number of PCRs of the TPM (must be a multiple of eight)
+  */
+-#define TPM_NUM_PCR 24
++#define TPM_NUM_PCR 32
+ 
+ /*
+  * TPM_PCR_SELECTION ([TPM_Part2], Section 8.1)
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
index eb7912f..aaf1a24 100644
--- a/stubdom/vtpm/vtpm.c
+++ b/stubdom/vtpm/vtpm.c
@@ -253,18 +253,18 @@ int parse_cmd_line(int argc, char** argv)
                opt_args.hwinitpcrs = VTPM_PCRNONE;
             } else if(sscanf(pch, "%u", &v1) == 1) {
                //Set one
-               if(v1 >= TPM_NUM_PCR) {
+               if(v1 >= VTPM_NUMPCRS) {
                   error("hwinitpcr error: Invalid PCR index %u", v1);
                   return -1;
                }
                opt_args.hwinitpcrs |= (1 << v1);
             } else if(sscanf(pch, "%u-%u", &v1, &v2) == 2) {
                //Set range
-               if(v1 >= TPM_NUM_PCR) {
+               if(v1 >= VTPM_NUMPCRS) {
                   error("hwinitpcr error: Invalid PCR index %u", v1);
                   return -1;
                }
-               if(v2 >= TPM_NUM_PCR) {
+               if(v2 >= VTPM_NUMPCRS) {
                   error("hwinitpcr error: Invalid PCR index %u", v1);
                   return -1;
                }
@@ -312,7 +312,7 @@ int parse_cmd_line(int argc, char** argv)
 
       pcrstr[0] = '\0';
       info("The following PCRs will be initialized with values from the hardware TPM:");
-      for(unsigned int i = 0; i < TPM_NUM_PCR; ++i) {
+      for(unsigned int i = 0; i < VTPM_NUMPCRS; ++i) {
          if(opt_args.hwinitpcrs & (1 << i)) {
             ptr += sprintf(ptr, "%u, ", i);
          }
diff --git a/stubdom/vtpm/vtpm_pcrs.h b/stubdom/vtpm/vtpm_pcrs.h
index 11835f9..bd9068c 100644
--- a/stubdom/vtpm/vtpm_pcrs.h
+++ b/stubdom/vtpm/vtpm_pcrs.h
@@ -40,11 +40,11 @@
 #define VTPM_PCR22 1 << 22
 #define VTPM_PCR23 1 << 23
 
-#define VTPM_PCRALL (1 << TPM_NUM_PCR) - 1
-#define VTPM_PCRNONE 0
-
 #define VTPM_NUMPCRS 24
 
+#define VTPM_PCRALL (1 << VTPM_NUMPCRS) - 1
+#define VTPM_PCRNONE 0
+
 struct tpmfront_dev;
 
 TPM_RESULT vtpm_initialize_hw_pcrs(struct tpmfront_dev* tpmfront_dev, unsigned long pcrs);
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:49:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRuO-0007XG-Du; Fri, 30 Nov 2012 14:49:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRuN-0007Wz-3d
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:39 +0000
Received: from [85.158.139.211:23600] by server-2.bemta-5.messagelabs.com id
	60/15-04892-287C8B05; Fri, 30 Nov 2012 14:49:38 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-12.tower-206.messagelabs.com!1354286977!18432322!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18343 invoked from network); 30 Nov 2012 14:49:37 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-12.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 14:49:37 -0000
X-TM-IMSS-Message-ID: <3366085700026bac@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3366085700026bac ;
	Fri, 30 Nov 2012 09:48:17 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLqn014134; 
	Fri, 30 Nov 2012 09:49:23 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:15 -0500
Message-Id: <1354286955-23900-10-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 9/9] stubdom/vtpm: Add PCR pass-through to
	hardware TPM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This allows the hardware TPM's PCRs to be accessed from a vTPM for
debugging and as a simple alternative to a deep quote in situations
where the integrity of the vTPM's own TCB is not in question.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/Makefile                   |  1 +
 stubdom/vtpm-pcr-passthrough.patch | 73 ++++++++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm_cmd.c            | 38 ++++++++++++++++++++
 3 files changed, 112 insertions(+)
 create mode 100644 stubdom/vtpm-pcr-passthrough.patch

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 790b547..03ec07e 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -210,6 +210,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	patch -d $@ -p1 < vtpm-locality.patch
 	patch -d $@ -p1 < vtpm-bufsize.patch
 	patch -d $@ -p1 < vtpm-locality5-pcrs.patch
+	patch -d $@ -p1 < vtpm-pcr-passthrough.patch
 	mkdir $@/build
 	cd $@/build; $(CMAKE) .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
 	touch $@
diff --git a/stubdom/vtpm-pcr-passthrough.patch b/stubdom/vtpm-pcr-passthrough.patch
new file mode 100644
index 0000000..4e898a5
--- /dev/null
+++ b/stubdom/vtpm-pcr-passthrough.patch
@@ -0,0 +1,73 @@
+diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
+index f8f7f0f..885af52 100644
+--- a/tpm/tpm_capability.c
++++ b/tpm/tpm_capability.c
+@@ -72,7 +72,7 @@ static TPM_RESULT cap_property(UINT32 subCapSize, BYTE *subCap,
+   switch (property) {
+     case TPM_CAP_PROP_PCR:
+       debug("[TPM_CAP_PROP_PCR]");
+-      return return_UINT32(respSize, resp, TPM_NUM_PCR);
++      return return_UINT32(respSize, resp, TPM_NUM_PCR_V);
+ 
+     case TPM_CAP_PROP_DIR:
+       debug("[TPM_CAP_PROP_DIR]");
+diff --git a/tpm/tpm_emulator_extern.h b/tpm/tpm_emulator_extern.h
+index 36a32dd..77ed595 100644
+--- a/tpm/tpm_emulator_extern.h
++++ b/tpm/tpm_emulator_extern.h
+@@ -56,6 +56,7 @@ void (*tpm_free)(/*const*/ void *ptr);
+ /* random numbers */
+ 
+ void (*tpm_get_extern_random_bytes)(void *buf, size_t nbytes);
++void tpm_get_extern_pcr(int index, void *buf);
+ 
+ /* usec since last call */
+ 
+diff --git a/tpm/tpm_integrity.c b/tpm/tpm_integrity.c
+index 66ece83..f3c4196 100644
+--- a/tpm/tpm_integrity.c
++++ b/tpm/tpm_integrity.c
+@@ -56,8 +56,11 @@ TPM_RESULT TPM_Extend(TPM_PCRINDEX pcrNum, TPM_DIGEST *inDigest,
+ TPM_RESULT TPM_PCRRead(TPM_PCRINDEX pcrIndex, TPM_PCRVALUE *outDigest)
+ {
+   info("TPM_PCRRead()");
+-  if (pcrIndex >= TPM_NUM_PCR) return TPM_BADINDEX;
+-  memcpy(outDigest, &PCR_VALUE[pcrIndex], sizeof(TPM_PCRVALUE));
++  if (pcrIndex >= TPM_NUM_PCR_V) return TPM_BADINDEX;
++  if (pcrIndex >= TPM_NUM_PCR)
++	tpm_get_extern_pcr(pcrIndex - TPM_NUM_PCR, outDigest);
++  else
++    memcpy(outDigest, &PCR_VALUE[pcrIndex], sizeof(TPM_PCRVALUE));
+   return TPM_SUCCESS;
+ }
+ 
+@@ -138,12 +141,15 @@ TPM_RESULT tpm_compute_pcr_digest(TPM_PCR_SELECTION *pcrSelection,
+   BYTE *buf, *ptr;
+   info("tpm_compute_pcr_digest()");
+   /* create PCR composite */
+-  if ((pcrSelection->sizeOfSelect * 8) > TPM_NUM_PCR
++  if ((pcrSelection->sizeOfSelect * 8) > TPM_NUM_PCR_V
+       || pcrSelection->sizeOfSelect == 0) return TPM_INVALID_PCR_INFO;
+   for (i = 0, j = 0; i < pcrSelection->sizeOfSelect * 8; i++) {
+     /* is PCR number i selected ? */
+     if (pcrSelection->pcrSelect[i >> 3] & (1 << (i & 7))) {
+-      memcpy(&comp.pcrValue[j++], &PCR_VALUE[i], sizeof(TPM_PCRVALUE));
++      if (i >= TPM_NUM_PCR)
++        tpm_get_extern_pcr(i - TPM_NUM_PCR, &comp.pcrValue[j++]);
++      else
++        memcpy(&comp.pcrValue[j++], &PCR_VALUE[i], sizeof(TPM_PCRVALUE));
+     }
+   }
+   memcpy(&comp.select, pcrSelection, sizeof(TPM_PCR_SELECTION));
+diff --git a/tpm/tpm_structures.h b/tpm/tpm_structures.h
+index 08cef1e..8c97fc5 100644
+--- a/tpm/tpm_structures.h
++++ b/tpm/tpm_structures.h
+@@ -677,6 +677,7 @@ typedef struct tdTPM_CMK_MA_APPROVAL {
+  * Number of PCRs of the TPM (must be a multiple of eight)
+  */
+ #define TPM_NUM_PCR 32
++#define TPM_NUM_PCR_V (TPM_NUM_PCR + 24)
+ 
+ /*
+  * TPM_PCR_SELECTION ([TPM_Part2], Section 8.1)
diff --git a/stubdom/vtpm/vtpm_cmd.c b/stubdom/vtpm/vtpm_cmd.c
index 7eae98b..ed058fb 100644
--- a/stubdom/vtpm/vtpm_cmd.c
+++ b/stubdom/vtpm/vtpm_cmd.c
@@ -134,6 +134,44 @@ egress:
 
 }
 
+extern struct tpmfront_dev* tpmfront_dev;
+void tpm_get_extern_pcr(int index, void *buf) {
+   TPM_RESULT status = TPM_SUCCESS;
+   uint8_t* cmdbuf, *resp, *bptr;
+   size_t resplen = 0;
+   UINT32 len;
+
+   /*Ask the real tpm for the PCR value */
+   TPM_TAG tag = TPM_TAG_RQU_COMMAND;
+   UINT32 size;
+   TPM_COMMAND_CODE ord = TPM_ORD_PCRRead;
+   len = size = sizeof(TPM_TAG) + sizeof(UINT32) + sizeof(TPM_COMMAND_CODE) + sizeof(UINT32);
+
+   /*Create the raw tpm command */
+   bptr = cmdbuf = malloc(size);
+   TRYFAILGOTO(pack_header(&bptr, &len, tag, size, ord));
+   TRYFAILGOTO(tpm_marshal_UINT32(&bptr, &len, index));
+
+   /* Send cmd, wait for response */
+   TRYFAILGOTOMSG(tpmfront_cmd(tpmfront_dev, cmdbuf, size, &resp, &resplen),
+      ERR_TPMFRONT);
+
+   bptr = resp; len = resplen;
+   TRYFAILGOTOMSG(unpack_header(&bptr, &len, &tag, &size, &ord), ERR_MALFORMED);
+
+   //Check return status of command
+   CHECKSTATUSGOTO(ord, "TPM_PCRRead()");
+
+   //Get the PCR value out
+   TRYFAILGOTOMSG(tpm_unmarshal_BYTE_ARRAY(&bptr, &len, buf, 20), ERR_MALFORMED);
+
+   goto egress;
+abort_egress:
+   memset(buf, 0x20, 20);
+egress:
+   free(cmdbuf);
+}
+
 TPM_RESULT VTPM_LoadHashKey(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t* data_length)
 {
    TPM_RESULT status = TPM_SUCCESS;
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:49:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRuN-0007X4-1q; Fri, 30 Nov 2012 14:49:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRuL-0007Wz-MG
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:37 +0000
Received: from [85.158.139.211:62786] by server-2.bemta-5.messagelabs.com id
	25/05-04892-087C8B05; Fri, 30 Nov 2012 14:49:36 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-12.tower-206.messagelabs.com!1354286975!18432314!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18217 invoked from network); 30 Nov 2012 14:49:36 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-12.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 14:49:36 -0000
X-TM-IMSS-Message-ID: <3365ff6200026ba3@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3365ff6200026ba3 ;
	Fri, 30 Nov 2012 09:48:15 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLqe014134; 
	Fri, 30 Nov 2012 09:49:21 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:06 -0500
Message-Id: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH v2 0/9] vTPM new ABI, extensions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch queue goes on top of Matthew Fioravante's [VTPM v5 0/7]
series. While some of the patches have been posted before, all have
been cleaned up a bit.

[PATCH 1/9] stubdom: Change vTPM shared page ABI
	* Removed unneeded reconfiguration pieces
	* Removed feature-protocol-v2 xenstore key references

[PATCH 2/9] stubdom/vtpm: Support locality field
	* Add distinct patch file instead of patching a patch
	* Comment on future use of the locality field

[PATCH 3/9] stubdom/vtpm: correct the buffer size returned by
	* New patch

[PATCH 4/9] stubdom/vtpm: Add locality-5 PCRs
	* New patch

[PATCH 5/9] stubdom/vtpm: Allow repoen of closed devices
	* This used to use Reconfigure, but has been changed to use
	  the Closed states similar to blkback

[PATCH 6/9] stubdom/vtpm: make state save operation atomic
	* Avoid hardcoded maximum saved state size
	* Better debug/error messages

[PATCH 7/9] stubdom/grub: send kernel measurements to vTPM
	* Use PolarSSL SHA1 function
	* Use byteswap.h functions

[PATCH 8/9] stubdom/vtpm: support multiple backends
	* Split into its own patch so it can be excluded if
	  automatic vTPM shutdown is required

[PATCH 9/9] stubdom/vtpm: Add PCR pass-through to hardware TPM
	* New patch, RFC; an alternative to hwinitpcrs

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:49:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRuS-0007Yu-QV; Fri, 30 Nov 2012 14:49:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRuQ-0007Xh-TE
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:43 +0000
Received: from [85.158.139.83:24625] by server-1.bemta-5.messagelabs.com id
	12/6C-09311-687C8B05; Fri, 30 Nov 2012 14:49:42 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-16.tower-182.messagelabs.com!1354286980!20482575!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15157 invoked from network); 30 Nov 2012 14:49:41 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-16.tower-182.messagelabs.com with SMTP;
	30 Nov 2012 14:49:41 -0000
X-TM-IMSS-Message-ID: <d074d49900057ac7@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d074d49900057ac7 ;
	Fri, 30 Nov 2012 09:49:29 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLql014134; 
	Fri, 30 Nov 2012 09:49:23 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:13 -0500
Message-Id: <1354286955-23900-8-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 7/9] stubdom/grub: send kernel measurements to
	vTPM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This allows a domU with an arbitrary kernel and initrd to take advantage
of the static root of trust provided by a vTPM.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/Makefile        |  2 +-
 stubdom/grub/Makefile   |  1 +
 stubdom/grub/kexec.c    | 54 +++++++++++++++++++++++++++++++++++++++++++++++++
 stubdom/grub/minios.cfg |  1 +
 4 files changed, 57 insertions(+), 1 deletion(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 4744b79..790b547 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -399,7 +399,7 @@ grub-upstream: grub-$(GRUB_VERSION).tar.gz
 	done
 
 .PHONY: grub
-grub: grub-upstream $(CROSS_ROOT)
+grub: cross-polarssl grub-upstream $(CROSS_ROOT)
 	mkdir -p grub-$(XEN_TARGET_ARCH)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ OBJ_DIR=$(CURDIR)/grub-$(XEN_TARGET_ARCH)
 
diff --git a/stubdom/grub/Makefile b/stubdom/grub/Makefile
index d6e3a1e..6bd2c4c 100644
--- a/stubdom/grub/Makefile
+++ b/stubdom/grub/Makefile
@@ -60,6 +60,7 @@ NETBOOT_SOURCES:=$(addprefix netboot/,$(NETBOOT_SOURCES))
 $(BOOT): DEF_CPPFLAGS+=-D__ASSEMBLY__
 
 PV_GRUB_SOURCES = kexec.c mini-os.c
+PV_GRUB_SOURCES += ../polarssl-$(XEN_TARGET_ARCH)/library/sha1.o
 
 SOURCES = $(NETBOOT_SOURCES) $(STAGE2_SOURCES) $(PV_GRUB_SOURCES)
 
diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index b21c91a..cef357e 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -28,7 +28,9 @@
 #include <blkfront.h>
 #include <netfront.h>
 #include <fbfront.h>
+#include <tpmfront.h>
 #include <shared.h>
+#include <byteswap.h>
 
 #include "mini-os.h"
 
@@ -54,6 +56,22 @@ static unsigned long allocated;
 int pin_table(xc_interface *xc_handle, unsigned int type, unsigned long mfn,
               domid_t dom);
 
+#define TPM_TAG_RQU_COMMAND 0xC1
+#define TPM_ORD_Extend 20
+
+struct pcr_extend_cmd {
+	uint16_t tag;
+	uint32_t size;
+	uint32_t ord;
+
+	uint32_t pcr;
+	unsigned char hash[20];
+} __attribute__((packed));
+
+/* Not imported from polarssl's header since the prototype unhelpfully defines
+ * the input as unsigned char, which causes pointer type mismatches */
+void sha1(const void *input, size_t ilen, unsigned char output[20]);
+
 /* We need mfn to appear as target_pfn, so exchange with the MFN there */
 static void do_exchange(struct xc_dom_image *dom, xen_pfn_t target_pfn, xen_pfn_t source_mfn)
 {
@@ -117,6 +135,40 @@ int kexec_allocate(struct xc_dom_image *dom, xen_vaddr_t up_to)
     return 0;
 }
 
+static void tpm_hash2pcr(struct xc_dom_image *dom, char *cmdline)
+{
+	struct tpmfront_dev* tpm = init_tpmfront(NULL);
+	uint8_t *resp;
+	size_t resplen = 0;
+	struct pcr_extend_cmd cmd;
+
+	/* If all guests have access to a vTPM, it may be useful to replace this
+	 * with ASSERT(tpm) to prevent configuration errors from allowing a guest
+	 * to boot without a TPM (or with a TPM that has not been sent any
+	 * measurements, which could allow forging the measurements).
+	 */
+	if (!tpm)
+		return;
+
+	cmd.tag = bswap_16(TPM_TAG_RQU_COMMAND);
+	cmd.size = bswap_32(sizeof(cmd));
+	cmd.ord = bswap_32(TPM_ORD_Extend);
+	cmd.pcr = bswap_32(4); // PCR #4 for kernel
+	sha1(dom->kernel_blob, dom->kernel_size, cmd.hash);
+
+	tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
+
+	cmd.pcr = bswap_32(5); // PCR #5 for cmdline
+	sha1(cmdline, strlen(cmdline), cmd.hash);
+	tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
+
+	cmd.pcr = bswap_32(5); // PCR #5 for initrd
+	sha1(dom->ramdisk_blob, dom->ramdisk_size, cmd.hash);
+	tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
+
+	shutdown_tpmfront(tpm);
+}
+
 void kexec(void *kernel, long kernel_size, void *module, long module_size, char *cmdline, unsigned long flags)
 {
     struct xc_dom_image *dom;
@@ -151,6 +203,8 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
     dom->console_evtchn = start_info.console.domU.evtchn;
     dom->xenstore_evtchn = start_info.store_evtchn;
 
+    tpm_hash2pcr(dom, cmdline);
+
     if ( (rc = xc_dom_boot_xen_init(dom, xc_handle, domid)) != 0 ) {
         grub_printf("xc_dom_boot_xen_init returned %d\n", rc);
         errnum = ERR_BOOT_FAILURE;
diff --git a/stubdom/grub/minios.cfg b/stubdom/grub/minios.cfg
index 40cfa68..8df4909 100644
--- a/stubdom/grub/minios.cfg
+++ b/stubdom/grub/minios.cfg
@@ -1,2 +1,3 @@
 CONFIG_START_NETWORK=n
 CONFIG_SPARSE_BSS=n
+CONFIG_TPMFRONT=y
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:49:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRuT-0007ZN-JV; Fri, 30 Nov 2012 14:49:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRuR-0007Xh-JA
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:43 +0000
Received: from [85.158.139.211:63147] by server-1.bemta-5.messagelabs.com id
	D8/6C-09311-687C8B05; Fri, 30 Nov 2012 14:49:42 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-206.messagelabs.com!1354286981!18587264!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10691 invoked from network); 30 Nov 2012 14:49:41 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-15.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 14:49:41 -0000
X-TM-IMSS-Message-ID: <336606d100026bab@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 336606d100026bab ;
	Fri, 30 Nov 2012 09:48:17 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLqm014134; 
	Fri, 30 Nov 2012 09:49:23 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:14 -0500
Message-Id: <1354286955-23900-9-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 8/9] stubdom/vtpm: support multiple backends
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpm/vtpm.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
index aaf1a24..d576c8f 100644
--- a/stubdom/vtpm/vtpm.c
+++ b/stubdom/vtpm/vtpm.c
@@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
 
 static void main_loop(void) {
    tpmcmd_t* tpmcmd = NULL;
-   domid_t domid;		/* Domid of frontend */
-   unsigned int handle;	/* handle of frontend */
    int res = -1;
 
    info("VTPM Initializing\n");
@@ -162,15 +160,7 @@ static void main_loop(void) {
       goto abort_postpcrs;
    }
 
-   /* Wait for the frontend domain to connect */
-   info("Waiting for frontend domain to connect..");
-   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
-      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
-   } else {
-      error("Unable to attach to a frontend");
-   }
-
-   tpmcmd = tpmback_req(domid, handle);
+   tpmcmd = tpmback_req_any();
    while(tpmcmd) {
       /* Handle the request */
       if(tpmcmd->req_len) {
@@ -194,7 +184,7 @@ static void main_loop(void) {
       tpmback_resp(tpmcmd);
 
       /* Wait for the next request */
-      tpmcmd = tpmback_req(domid, handle);
+      tpmcmd = tpmback_req_any();
 
    }
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:49:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRuT-0007ZZ-VP; Fri, 30 Nov 2012 14:49:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRuR-0007Y0-Lh
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:43 +0000
Received: from [85.158.139.211:27816] by server-15.bemta-5.messagelabs.com id
	96/4B-26920-687C8B05; Fri, 30 Nov 2012 14:49:42 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-5.tower-206.messagelabs.com!1354286980!18492327!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9505 invoked from network); 30 Nov 2012 14:49:41 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-5.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 14:49:41 -0000
X-TM-IMSS-Message-ID: <3366046100026ba9@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3366046100026ba9 ;
	Fri, 30 Nov 2012 09:48:16 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLqj014134; 
	Fri, 30 Nov 2012 09:49:22 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:11 -0500
Message-Id: <1354286955-23900-6-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 5/9] stubdom/vtpm: Allow repoen of closed devices
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Allow the vtpm device to be disconnected and reconnected so that a
bootloader (like pv-grub) can submit measurements and return the vtpm
device to its initial state before booting the target kernel.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/tpmback.c  | 23 ++++++++++++++++++++++-
 extras/mini-os/tpmfront.c | 14 ++++++++++++--
 2 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index 01c2851..9309d26 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -608,6 +608,24 @@ error_post_map:
    return -1;
 }
 
+static void disconnect_fe(tpmif_t* tpmif)
+{
+   if (tpmif->status == CONNECTED) {
+      tpmif->status = DISCONNECTING;
+      mask_evtchn(tpmif->evtchn);
+
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
+	 TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
+      }
+
+      unbind_evtchn(tpmif->evtchn);
+   }
+   tpmif->status = DISCONNECTED;
+   tpmif_change_state(tpmif, XenbusStateInitWait);
+
+   TPMBACK_LOG("Frontend %u/%u disconnected\n", (unsigned int) tpmif->domid, tpmif->handle);
+}
+
 static int frontend_changed(tpmif_t* tpmif)
 {
    int state = xenbus_read_integer(tpmif->fe_state_path);
@@ -634,8 +652,11 @@ static int frontend_changed(tpmif_t* tpmif)
 	 tpmif_change_state(tpmif, XenbusStateClosing);
 	 break;
 
-      case XenbusStateUnknown: /* keep it here */
       case XenbusStateClosed:
+         disconnect_fe(tpmif);
+	 break;
+
+      case XenbusStateUnknown: /* keep it here */
 	 free_tpmif(tpmif);
 	 break;
 
diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
index e66ce3c..181da30 100644
--- a/extras/mini-os/tpmfront.c
+++ b/extras/mini-os/tpmfront.c
@@ -146,6 +146,9 @@ static int wait_for_backend_closed(xenbus_event_queue* events, char* path)
 	 case XenbusStateClosed:
 	    TPMFRONT_LOG("Backend Closed\n");
 	    return 0;
+	 case XenbusStateInitWait:
+	    TPMFRONT_LOG("Backend Closed (waiting for reconnect)\n");
+	    return 0;
 	 default:
 	    xenbus_wait_for_watch(events);
       }
@@ -306,10 +309,10 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
    TPMFRONT_LOG("Shutting down tpmfront\n");
    /* disconnect */
    if(dev->state == XenbusStateConnected) {
-      dev->state = XenbusStateClosing;
-      //FIXME: Transaction for this?
       /* Tell backend we are closing */
+      dev->state = XenbusStateClosing;
       if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
+	 TPMFRONT_ERR("Unable to write to %s, error was %s", dev->nodename, err);
 	 free(err);
       }
 
@@ -333,6 +336,13 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
       /* Wait for the backend to close and unmap shared pages, ignore any errors */
       wait_for_backend_state_changed(dev, XenbusStateClosed);
 
+      /* Prepare for a later reopen (possibly by a kexec'd kernel) */
+      dev->state = XenbusStateInitialising;
+      if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
+	 TPMFRONT_ERR("Unable to write to %s, error was %s", dev->nodename, err);
+	 free(err);
+      }
+
       /* Close event channel and unmap shared page */
       mask_evtchn(dev->evtchn);
       unbind_evtchn(dev->evtchn);
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:49:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRuS-0007Yc-EN; Fri, 30 Nov 2012 14:49:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRuQ-0007Xa-HB
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:42 +0000
Received: from [85.158.139.211:23784] by server-14.bemta-5.messagelabs.com id
	AB/4A-21768-587C8B05; Fri, 30 Nov 2012 14:49:41 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-3.tower-206.messagelabs.com!1354286980!18558236!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32566 invoked from network); 30 Nov 2012 14:49:41 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-3.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 14:49:41 -0000
X-TM-IMSS-Message-ID: <3366028d00026ba6@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3366028d00026ba6 ;
	Fri, 30 Nov 2012 09:48:16 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLqh014134; 
	Fri, 30 Nov 2012 09:49:22 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:09 -0500
Message-Id: <1354286955-23900-4-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 3/9] stubdom/vtpm: correct the buffer size
	returned by TPM_CAP_PROP_INPUT_BUFFER
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/Makefile           |  1 +
 stubdom/vtpm-bufsize.patch | 13 +++++++++++++
 2 files changed, 14 insertions(+)
 create mode 100644 stubdom/vtpm-bufsize.patch

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 683bc51..c01f1a5 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -208,6 +208,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	mv tpm_emulator-$(TPMEMU_VERSION) $@
 	patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
 	patch -d $@ -p1 < vtpm-locality.patch
+	patch -d $@ -p1 < vtpm-bufsize.patch
 	mkdir $@/build
 	cd $@/build; $(CMAKE) .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
 	touch $@
diff --git a/stubdom/vtpm-bufsize.patch b/stubdom/vtpm-bufsize.patch
new file mode 100644
index 0000000..9c9304c
--- /dev/null
+++ b/stubdom/vtpm-bufsize.patch
@@ -0,0 +1,13 @@
+diff --git a/config.h.in b/config.h.in
+index d16a997..8088a2a 100644
+--- a/config.h.in
++++ b/config.h.in
+@@ -27,7 +27,7 @@
+ #define TPM_STORAGE_NAME "${TPM_STORAGE_NAME}"
+ #define TPM_DEVICE_NAME  "${TPM_DEVICE_NAME}"
+ #define TPM_LOG_FILE     "${TPM_LOG_FILE}"
+-#define TPM_CMD_BUF_SIZE 4096
++#define TPM_CMD_BUF_SIZE 4088
+ 
+ #endif /* _CONFIG_H_ */
+ 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:49:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRuP-0007XV-Qu; Fri, 30 Nov 2012 14:49:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRuO-0007XF-Su
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:41 +0000
Received: from [85.158.139.211:23672] by server-16.bemta-5.messagelabs.com id
	9F/9A-21311-487C8B05; Fri, 30 Nov 2012 14:49:40 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-206.messagelabs.com!1354286978!18499108!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28476 invoked from network); 30 Nov 2012 14:49:39 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-14.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 14:49:39 -0000
X-TM-IMSS-Message-ID: <3366058900026baa@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3366058900026baa ;
	Fri, 30 Nov 2012 09:48:17 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLqk014134; 
	Fri, 30 Nov 2012 09:49:22 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:12 -0500
Message-Id: <1354286955-23900-7-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 6/9] stubdom/vtpm: make state save operation
	atomic
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This changes the save format of the vtpm stubdom to include two copies
of the saved data: one active, and one inactive. When saving the state,
data is written to the inactive slot before updating the key and hash
saved with the TPM Manager, which determines the active slot when the
vTPM starts up.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpm/vtpmblk.c | 74 ++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 60 insertions(+), 14 deletions(-)

diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
index b343bd8..fe529ab 100644
--- a/stubdom/vtpm/vtpmblk.c
+++ b/stubdom/vtpm/vtpmblk.c
@@ -26,6 +26,7 @@
 
 static struct blkfront_dev* blkdev = NULL;
 static int blkfront_fd = -1;
+static uint64_t slot_size = 0;
 
 int init_vtpmblk(struct tpmfront_dev* tpmfront_dev)
 {
@@ -45,6 +46,8 @@ int init_vtpmblk(struct tpmfront_dev* tpmfront_dev)
       goto error;
    }
 
+   slot_size = blkinfo.sectors * blkinfo.sector_size / 2;
+
    return 0;
 error:
    shutdown_blkfront(blkdev);
@@ -59,15 +62,20 @@ void shutdown_vtpmblk(void)
    blkdev = NULL;
 }
 
-int write_vtpmblk_raw(uint8_t *data, size_t data_length)
+static int write_vtpmblk_raw(uint8_t *data, size_t data_length, int slot)
 {
    int rc;
    uint32_t lenbuf;
-   debug("Begin Write data=%p len=%u", data, data_length);
+   debug("Begin Write data=%p len=%u slot=%u ssize=%u", data, data_length, slot, slot_size);
+
+   if (data_length > slot_size - 4) {
+      error("vtpm data cannot fit in data slot (%d/%d).", data_length, slot_size - 4);
+      return -1;
+   }
 
    lenbuf = cpu_to_be32((uint32_t)data_length);
 
-   lseek(blkfront_fd, 0, SEEK_SET);
+   lseek(blkfront_fd, slot * slot_size, SEEK_SET);
    if((rc = write(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
       error("write(length) failed! error was %s", strerror(errno));
       return -1;
@@ -82,12 +90,12 @@ int write_vtpmblk_raw(uint8_t *data, size_t data_length)
    return 0;
 }
 
-int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
+static int read_vtpmblk_raw(uint8_t **data, size_t *data_length, int slot)
 {
    int rc;
    uint32_t lenbuf;
 
-   lseek(blkfront_fd, 0, SEEK_SET);
+   lseek(blkfront_fd, slot * slot_size, SEEK_SET);
    if(( rc = read(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
       error("read(length) failed! error was %s", strerror(errno));
       return -1;
@@ -97,6 +105,10 @@ int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
       error("read 0 data_length for NVM");
       return -1;
    }
+   if(*data_length > slot_size - 4) {
+      error("read invalid data_length for NVM");
+      return -1;
+   }
 
    *data = tpm_malloc(*data_length);
    if((rc = read(blkfront_fd, *data, *data_length)) != *data_length) {
@@ -104,7 +116,7 @@ int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
       return -1;
    }
 
-   info("Read %u bytes from NVM persistent storage", *data_length);
+   info("Read %u bytes from NVM persistent storage (slot %d)", *data_length, slot);
    return 0;
 }
 
@@ -221,6 +233,9 @@ egress:
    return rc;
 }
 
+/* Current active state slot, or -1 if no valid saved state exists */
+static int active_slot = -1;
+
 int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length) {
    int rc;
    uint8_t* cipher = NULL;
@@ -228,12 +243,17 @@ int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_
    uint8_t hashkey[HASHKEYSZ];
    uint8_t* symkey = hashkey + HASHSZ;
 
+   /* Switch to the other slot. Note that in a new vTPM, the read will not
+	* succeed, so active_slot will be -1 and we will write to slot 0.
+	*/
+   active_slot = !active_slot;
+
    /* Encrypt the data */
    if((rc = encrypt_vtpmblk(data, data_length, &cipher, &cipher_len, symkey))) {
       goto abort_egress;
    }
    /* Write to disk */
-   if((rc = write_vtpmblk_raw(cipher, cipher_len))) {
+   if((rc = write_vtpmblk_raw(cipher, cipher_len, active_slot))) {
       goto abort_egress;
    }
    /* Get sha1 hash of data */
@@ -256,7 +276,8 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
    size_t cipher_len = 0;
    size_t keysize;
    uint8_t* hashkey = NULL;
-   uint8_t hash[HASHSZ];
+   uint8_t hash0[HASHSZ];
+   uint8_t hash1[HASHSZ];
    uint8_t* symkey;
 
    /* Retreive the hash and the key from the manager */
@@ -270,14 +291,32 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
    }
    symkey = hashkey + HASHSZ;
 
-   /* Read from disk now */
-   if((rc = read_vtpmblk_raw(&cipher, &cipher_len))) {
+   active_slot = 0;
+   debug("Reading slot 0 from disk\n");
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len, 0))) {
       goto abort_egress;
    }
 
    /* Compute the hash of the cipher text and compare */
-   sha1(cipher, cipher_len, hash);
-   if(memcmp(hash, hashkey, HASHSZ)) {
+   sha1(cipher, cipher_len, hash0);
+   if(!memcmp(hash0, hashkey, HASHSZ))
+      goto valid;
+
+   free(cipher);
+   cipher = NULL;
+
+   active_slot = 1;
+   debug("Reading slot 1 from disk (offset=%u)\n", slot_size);
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len, 1))) {
+      goto abort_egress;
+   }
+
+   /* Compute the hash of the cipher text and compare */
+   sha1(cipher, cipher_len, hash1);
+   if(!memcmp(hash1, hashkey, HASHSZ))
+      goto valid;
+
+   {
       int i;
       error("NVM Storage Checksum failed!");
       printf("Expected: ");
@@ -285,14 +324,20 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
 	 printf("%02hhX ", hashkey[i]);
       }
       printf("\n");
-      printf("Actual:   ");
+      printf("Slot 0:   ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hash0[i]);
+      }
+      printf("\n");
+      printf("Slot 1:   ");
       for(i = 0; i < HASHSZ; ++i) {
-	 printf("%02hhX ", hash[i]);
+	 printf("%02hhX ", hash1[i]);
       }
       printf("\n");
       rc = -1;
       goto abort_egress;
    }
+valid:
 
    /* Decrypt the blob */
    if((rc = decrypt_vtpmblk(cipher, cipher_len, data, data_length, symkey))) {
@@ -300,6 +345,7 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
    }
    goto egress;
 abort_egress:
+   active_slot = -1;
 egress:
    free(cipher);
    free(hashkey);
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:49:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRuT-0007ZN-JV; Fri, 30 Nov 2012 14:49:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRuR-0007Xh-JA
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:43 +0000
Received: from [85.158.139.211:63147] by server-1.bemta-5.messagelabs.com id
	D8/6C-09311-687C8B05; Fri, 30 Nov 2012 14:49:42 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-15.tower-206.messagelabs.com!1354286981!18587264!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10691 invoked from network); 30 Nov 2012 14:49:41 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-15.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 14:49:41 -0000
X-TM-IMSS-Message-ID: <336606d100026bab@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 336606d100026bab ;
	Fri, 30 Nov 2012 09:48:17 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLqm014134; 
	Fri, 30 Nov 2012 09:49:23 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:14 -0500
Message-Id: <1354286955-23900-9-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 8/9] stubdom/vtpm: support multiple backends
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpm/vtpm.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
index aaf1a24..d576c8f 100644
--- a/stubdom/vtpm/vtpm.c
+++ b/stubdom/vtpm/vtpm.c
@@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
 
 static void main_loop(void) {
    tpmcmd_t* tpmcmd = NULL;
-   domid_t domid;		/* Domid of frontend */
-   unsigned int handle;	/* handle of frontend */
    int res = -1;
 
    info("VTPM Initializing\n");
@@ -162,15 +160,7 @@ static void main_loop(void) {
       goto abort_postpcrs;
    }
 
-   /* Wait for the frontend domain to connect */
-   info("Waiting for frontend domain to connect..");
-   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
-      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
-   } else {
-      error("Unable to attach to a frontend");
-   }
-
-   tpmcmd = tpmback_req(domid, handle);
+   tpmcmd = tpmback_req_any();
    while(tpmcmd) {
       /* Handle the request */
       if(tpmcmd->req_len) {
@@ -194,7 +184,7 @@ static void main_loop(void) {
       tpmback_resp(tpmcmd);
 
       /* Wait for the next request */
-      tpmcmd = tpmback_req(domid, handle);
+      tpmcmd = tpmback_req_any();
 
    }
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:49:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRuT-0007ZZ-VP; Fri, 30 Nov 2012 14:49:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRuR-0007Y0-Lh
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:43 +0000
Received: from [85.158.139.211:27816] by server-15.bemta-5.messagelabs.com id
	96/4B-26920-687C8B05; Fri, 30 Nov 2012 14:49:42 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-5.tower-206.messagelabs.com!1354286980!18492327!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9505 invoked from network); 30 Nov 2012 14:49:41 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-5.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 14:49:41 -0000
X-TM-IMSS-Message-ID: <3366046100026ba9@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3366046100026ba9 ;
	Fri, 30 Nov 2012 09:48:16 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLqj014134; 
	Fri, 30 Nov 2012 09:49:22 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:11 -0500
Message-Id: <1354286955-23900-6-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 5/9] stubdom/vtpm: Allow repoen of closed devices
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Allow the vtpm device to be disconnected and reconnected so that a
bootloader (like pv-grub) can submit measurements and return the vtpm
device to its initial state before booting the target kernel.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/tpmback.c  | 23 ++++++++++++++++++++++-
 extras/mini-os/tpmfront.c | 14 ++++++++++++--
 2 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index 01c2851..9309d26 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -608,6 +608,24 @@ error_post_map:
    return -1;
 }
 
+static void disconnect_fe(tpmif_t* tpmif)
+{
+   if (tpmif->status == CONNECTED) {
+      tpmif->status = DISCONNECTING;
+      mask_evtchn(tpmif->evtchn);
+
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
+	 TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
+      }
+
+      unbind_evtchn(tpmif->evtchn);
+   }
+   tpmif->status = DISCONNECTED;
+   tpmif_change_state(tpmif, XenbusStateInitWait);
+
+   TPMBACK_LOG("Frontend %u/%u disconnected\n", (unsigned int) tpmif->domid, tpmif->handle);
+}
+
 static int frontend_changed(tpmif_t* tpmif)
 {
    int state = xenbus_read_integer(tpmif->fe_state_path);
@@ -634,8 +652,11 @@ static int frontend_changed(tpmif_t* tpmif)
 	 tpmif_change_state(tpmif, XenbusStateClosing);
 	 break;
 
-      case XenbusStateUnknown: /* keep it here */
       case XenbusStateClosed:
+         disconnect_fe(tpmif);
+	 break;
+
+      case XenbusStateUnknown: /* keep it here */
 	 free_tpmif(tpmif);
 	 break;
 
diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
index e66ce3c..181da30 100644
--- a/extras/mini-os/tpmfront.c
+++ b/extras/mini-os/tpmfront.c
@@ -146,6 +146,9 @@ static int wait_for_backend_closed(xenbus_event_queue* events, char* path)
 	 case XenbusStateClosed:
 	    TPMFRONT_LOG("Backend Closed\n");
 	    return 0;
+	 case XenbusStateInitWait:
+	    TPMFRONT_LOG("Backend Closed (waiting for reconnect)\n");
+	    return 0;
 	 default:
 	    xenbus_wait_for_watch(events);
       }
@@ -306,10 +309,10 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
    TPMFRONT_LOG("Shutting down tpmfront\n");
    /* disconnect */
    if(dev->state == XenbusStateConnected) {
-      dev->state = XenbusStateClosing;
-      //FIXME: Transaction for this?
       /* Tell backend we are closing */
+      dev->state = XenbusStateClosing;
       if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
+	 TPMFRONT_ERR("Unable to write to %s, error was %s", dev->nodename, err);
 	 free(err);
       }
 
@@ -333,6 +336,13 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
       /* Wait for the backend to close and unmap shared pages, ignore any errors */
       wait_for_backend_state_changed(dev, XenbusStateClosed);
 
+      /* Prepare for a later reopen (possibly by a kexec'd kernel) */
+      dev->state = XenbusStateInitialising;
+      if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
+	 TPMFRONT_ERR("Unable to write to %s, error was %s", dev->nodename, err);
+	 free(err);
+      }
+
       /* Close event channel and unmap shared page */
       mask_evtchn(dev->evtchn);
       unbind_evtchn(dev->evtchn);
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:49:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRuS-0007Yc-EN; Fri, 30 Nov 2012 14:49:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRuQ-0007Xa-HB
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:42 +0000
Received: from [85.158.139.211:23784] by server-14.bemta-5.messagelabs.com id
	AB/4A-21768-587C8B05; Fri, 30 Nov 2012 14:49:41 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-3.tower-206.messagelabs.com!1354286980!18558236!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32566 invoked from network); 30 Nov 2012 14:49:41 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-3.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 14:49:41 -0000
X-TM-IMSS-Message-ID: <3366028d00026ba6@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3366028d00026ba6 ;
	Fri, 30 Nov 2012 09:48:16 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLqh014134; 
	Fri, 30 Nov 2012 09:49:22 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:09 -0500
Message-Id: <1354286955-23900-4-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 3/9] stubdom/vtpm: correct the buffer size
	returned by TPM_CAP_PROP_INPUT_BUFFER
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/Makefile           |  1 +
 stubdom/vtpm-bufsize.patch | 13 +++++++++++++
 2 files changed, 14 insertions(+)
 create mode 100644 stubdom/vtpm-bufsize.patch

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 683bc51..c01f1a5 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -208,6 +208,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	mv tpm_emulator-$(TPMEMU_VERSION) $@
 	patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
 	patch -d $@ -p1 < vtpm-locality.patch
+	patch -d $@ -p1 < vtpm-bufsize.patch
 	mkdir $@/build
 	cd $@/build; $(CMAKE) .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
 	touch $@
diff --git a/stubdom/vtpm-bufsize.patch b/stubdom/vtpm-bufsize.patch
new file mode 100644
index 0000000..9c9304c
--- /dev/null
+++ b/stubdom/vtpm-bufsize.patch
@@ -0,0 +1,13 @@
+diff --git a/config.h.in b/config.h.in
+index d16a997..8088a2a 100644
+--- a/config.h.in
++++ b/config.h.in
+@@ -27,7 +27,7 @@
+ #define TPM_STORAGE_NAME "${TPM_STORAGE_NAME}"
+ #define TPM_DEVICE_NAME  "${TPM_DEVICE_NAME}"
+ #define TPM_LOG_FILE     "${TPM_LOG_FILE}"
+-#define TPM_CMD_BUF_SIZE 4096
++#define TPM_CMD_BUF_SIZE 4088
+ 
+ #endif /* _CONFIG_H_ */
+ 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:49:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRuP-0007XV-Qu; Fri, 30 Nov 2012 14:49:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRuO-0007XF-Su
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:41 +0000
Received: from [85.158.139.211:23672] by server-16.bemta-5.messagelabs.com id
	9F/9A-21311-487C8B05; Fri, 30 Nov 2012 14:49:40 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-206.messagelabs.com!1354286978!18499108!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28476 invoked from network); 30 Nov 2012 14:49:39 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-14.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 14:49:39 -0000
X-TM-IMSS-Message-ID: <3366058900026baa@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3366058900026baa ;
	Fri, 30 Nov 2012 09:48:17 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLqk014134; 
	Fri, 30 Nov 2012 09:49:22 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:12 -0500
Message-Id: <1354286955-23900-7-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 6/9] stubdom/vtpm: make state save operation
	atomic
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This changes the save format of the vtpm stubdom to include two copies
of the saved data: one active, and one inactive. When saving the state,
data is written to the inactive slot before updating the key and hash
saved with the TPM Manager, which determines the active slot when the
vTPM starts up.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpm/vtpmblk.c | 74 ++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 60 insertions(+), 14 deletions(-)

diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
index b343bd8..fe529ab 100644
--- a/stubdom/vtpm/vtpmblk.c
+++ b/stubdom/vtpm/vtpmblk.c
@@ -26,6 +26,7 @@
 
 static struct blkfront_dev* blkdev = NULL;
 static int blkfront_fd = -1;
+static uint64_t slot_size = 0;
 
 int init_vtpmblk(struct tpmfront_dev* tpmfront_dev)
 {
@@ -45,6 +46,8 @@ int init_vtpmblk(struct tpmfront_dev* tpmfront_dev)
       goto error;
    }
 
+   slot_size = blkinfo.sectors * blkinfo.sector_size / 2;
+
    return 0;
 error:
    shutdown_blkfront(blkdev);
@@ -59,15 +62,20 @@ void shutdown_vtpmblk(void)
    blkdev = NULL;
 }
 
-int write_vtpmblk_raw(uint8_t *data, size_t data_length)
+static int write_vtpmblk_raw(uint8_t *data, size_t data_length, int slot)
 {
    int rc;
    uint32_t lenbuf;
-   debug("Begin Write data=%p len=%u", data, data_length);
+   debug("Begin Write data=%p len=%u slot=%u ssize=%u", data, data_length, slot, slot_size);
+
+   if (data_length > slot_size - 4) {
+      error("vtpm data cannot fit in data slot (%d/%d).", data_length, slot_size - 4);
+      return -1;
+   }
 
    lenbuf = cpu_to_be32((uint32_t)data_length);
 
-   lseek(blkfront_fd, 0, SEEK_SET);
+   lseek(blkfront_fd, slot * slot_size, SEEK_SET);
    if((rc = write(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
       error("write(length) failed! error was %s", strerror(errno));
       return -1;
@@ -82,12 +90,12 @@ int write_vtpmblk_raw(uint8_t *data, size_t data_length)
    return 0;
 }
 
-int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
+static int read_vtpmblk_raw(uint8_t **data, size_t *data_length, int slot)
 {
    int rc;
    uint32_t lenbuf;
 
-   lseek(blkfront_fd, 0, SEEK_SET);
+   lseek(blkfront_fd, slot * slot_size, SEEK_SET);
    if(( rc = read(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
       error("read(length) failed! error was %s", strerror(errno));
       return -1;
@@ -97,6 +105,10 @@ int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
       error("read 0 data_length for NVM");
       return -1;
    }
+   if(*data_length > slot_size - 4) {
+      error("read invalid data_length for NVM");
+      return -1;
+   }
 
    *data = tpm_malloc(*data_length);
    if((rc = read(blkfront_fd, *data, *data_length)) != *data_length) {
@@ -104,7 +116,7 @@ int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
       return -1;
    }
 
-   info("Read %u bytes from NVM persistent storage", *data_length);
+   info("Read %u bytes from NVM persistent storage (slot %d)", *data_length, slot);
    return 0;
 }
 
@@ -221,6 +233,9 @@ egress:
    return rc;
 }
 
+/* Current active state slot, or -1 if no valid saved state exists */
+static int active_slot = -1;
+
 int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length) {
    int rc;
    uint8_t* cipher = NULL;
@@ -228,12 +243,17 @@ int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_
    uint8_t hashkey[HASHKEYSZ];
    uint8_t* symkey = hashkey + HASHSZ;
 
+   /* Switch to the other slot. Note that in a new vTPM, the read will not
+	* succeed, so active_slot will be -1 and we will write to slot 0.
+	*/
+   active_slot = !active_slot;
+
    /* Encrypt the data */
    if((rc = encrypt_vtpmblk(data, data_length, &cipher, &cipher_len, symkey))) {
       goto abort_egress;
    }
    /* Write to disk */
-   if((rc = write_vtpmblk_raw(cipher, cipher_len))) {
+   if((rc = write_vtpmblk_raw(cipher, cipher_len, active_slot))) {
       goto abort_egress;
    }
    /* Get sha1 hash of data */
@@ -256,7 +276,8 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
    size_t cipher_len = 0;
    size_t keysize;
    uint8_t* hashkey = NULL;
-   uint8_t hash[HASHSZ];
+   uint8_t hash0[HASHSZ];
+   uint8_t hash1[HASHSZ];
    uint8_t* symkey;
 
    /* Retreive the hash and the key from the manager */
@@ -270,14 +291,32 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
    }
    symkey = hashkey + HASHSZ;
 
-   /* Read from disk now */
-   if((rc = read_vtpmblk_raw(&cipher, &cipher_len))) {
+   active_slot = 0;
+   debug("Reading slot 0 from disk\n");
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len, 0))) {
       goto abort_egress;
    }
 
    /* Compute the hash of the cipher text and compare */
-   sha1(cipher, cipher_len, hash);
-   if(memcmp(hash, hashkey, HASHSZ)) {
+   sha1(cipher, cipher_len, hash0);
+   if(!memcmp(hash0, hashkey, HASHSZ))
+      goto valid;
+
+   free(cipher);
+   cipher = NULL;
+
+   active_slot = 1;
+   debug("Reading slot 1 from disk (offset=%u)\n", slot_size);
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len, 1))) {
+      goto abort_egress;
+   }
+
+   /* Compute the hash of the cipher text and compare */
+   sha1(cipher, cipher_len, hash1);
+   if(!memcmp(hash1, hashkey, HASHSZ))
+      goto valid;
+
+   {
       int i;
       error("NVM Storage Checksum failed!");
       printf("Expected: ");
@@ -285,14 +324,20 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
 	 printf("%02hhX ", hashkey[i]);
       }
       printf("\n");
-      printf("Actual:   ");
+      printf("Slot 0:   ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hash0[i]);
+      }
+      printf("\n");
+      printf("Slot 1:   ");
       for(i = 0; i < HASHSZ; ++i) {
-	 printf("%02hhX ", hash[i]);
+	 printf("%02hhX ", hash1[i]);
       }
       printf("\n");
       rc = -1;
       goto abort_egress;
    }
+valid:
 
    /* Decrypt the blob */
    if((rc = decrypt_vtpmblk(cipher, cipher_len, data, data_length, symkey))) {
@@ -300,6 +345,7 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
    }
    goto egress;
 abort_egress:
+   active_slot = -1;
 egress:
    free(cipher);
    free(hashkey);
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:49:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRuU-0007Zu-DO; Fri, 30 Nov 2012 14:49:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRuS-0007Y8-6O
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:44 +0000
Received: from [85.158.139.211:57601] by server-11.bemta-5.messagelabs.com id
	81/16-03409-787C8B05; Fri, 30 Nov 2012 14:49:43 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-12.tower-206.messagelabs.com!1354286981!18432335!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18590 invoked from network); 30 Nov 2012 14:49:41 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-12.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 14:49:41 -0000
X-TM-IMSS-Message-ID: <336600c900026ba4@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 336600c900026ba4 ;
	Fri, 30 Nov 2012 09:48:15 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLqf014134; 
	Fri, 30 Nov 2012 09:49:21 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:07 -0500
Message-Id: <1354286955-23900-2-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 1/9] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This changes the vTPM shared page ABI from a copy of the Xen network
interface to a single-page interface that better reflects the expected
behavior of a TPM: only a single request packet can be sent at any given
time, and every packet sent generates a single response packet. This
protocol change should also increase efficiency as it avoids mapping and
unmapping grants when possible.

While the contents of the shared page have been defined to allow packets
larger than a single page (actually 4088 bytes) by allowing the client
to add extra grant references, the mapping of these extra references has
not been implemented; a feature node in xenstore may be used in the
future to indicate full support for the multi-page protocol. Most uses
of the TPM should not require this feature.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/include/tpmback.h  |   1 +
 extras/mini-os/include/tpmfront.h |   7 ++-
 extras/mini-os/tpmback.c          | 115 +++++++++++++------------------------
 extras/mini-os/tpmfront.c         | 117 +++++++++++++++-----------------------
 xen/include/public/io/tpmif.h     |  45 ++++-----------
 5 files changed, 99 insertions(+), 186 deletions(-)

diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
index ff86732..ec9eda4 100644
--- a/extras/mini-os/include/tpmback.h
+++ b/extras/mini-os/include/tpmback.h
@@ -43,6 +43,7 @@
 
 struct tpmcmd {
    domid_t domid;		/* Domid of the frontend */
+   uint8_t locality;    /* Locality requested by the frontend */
    unsigned int handle;	/* Handle of the frontend */
    unsigned char uuid[16];			/* uuid of the tpm interface */
 
diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include/tpmfront.h
index fd2cb17..a0c7c4d 100644
--- a/extras/mini-os/include/tpmfront.h
+++ b/extras/mini-os/include/tpmfront.h
@@ -37,9 +37,7 @@ struct tpmfront_dev {
    grant_ref_t ring_ref;
    evtchn_port_t evtchn;
 
-   tpmif_tx_interface_t* tx;
-
-   void** pages;
+   vtpm_shared_page_t *page;
 
    domid_t bedomid;
    char* nodename;
@@ -77,6 +75,9 @@ void shutdown_tpmfront(struct tpmfront_dev* dev);
  * */
 int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen);
 
+/* Set the locality used for communicating with a vTPM */
+int tpmfront_set_locality(struct tpmfront_dev* dev, int locality);
+
 #ifdef HAVE_LIBC
 #include <sys/stat.h>
 /* POSIX IO functions:
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index 658fed1..01c2851 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -86,10 +86,7 @@ struct tpmif {
    evtchn_port_t evtchn;
 
    /* Shared page */
-   tpmif_tx_interface_t* tx;
-
-   /* pointer to TPMIF_RX_RING_SIZE pages */
-   void** pages;
+   vtpm_shared_page_t *page;
 
    enum xenbus_state state;
    enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
@@ -312,7 +309,6 @@ int insert_tpmif(tpmif_t* tpmif)
       remove_tpmif(tpmif);
       goto error_post_irq;
    }
-
    return 0;
 error:
    local_irq_restore(flags);
@@ -386,8 +382,7 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
    tpmif->fe_state_path = NULL;
    tpmif->state = XenbusStateInitialising;
    tpmif->status = DISCONNECTED;
-   tpmif->tx = NULL;
-   tpmif->pages = NULL;
+   tpmif->page = NULL;
    tpmif->flags = 0;
    memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
    return tpmif;
@@ -395,9 +390,6 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
 
 void __free_tpmif(tpmif_t* tpmif)
 {
-   if(tpmif->pages) {
-      free(tpmif->pages);
-   }
    if(tpmif->fe_path) {
       free(tpmif->fe_path);
    }
@@ -430,12 +422,6 @@ tpmif_t* new_tpmif(domid_t domid, unsigned int handle)
       goto error;
    }
 
-   /* allocate pages to be used for shared mapping */
-   if((tpmif->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE)) == NULL) {
-      goto error;
-   }
-   memset(tpmif->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-
    if(tpmif_change_state(tpmif, XenbusStateInitWait)) {
       goto error;
    }
@@ -486,7 +472,7 @@ void free_tpmif(tpmif_t* tpmif)
       tpmif->status = DISCONNECTING;
       mask_evtchn(tpmif->evtchn);
 
-      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1)) {
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
 	 TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
       }
 
@@ -529,9 +515,10 @@ void free_tpmif(tpmif_t* tpmif)
 void tpmback_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
 {
    tpmif_t* tpmif = (tpmif_t*) data;
-   tpmif_tx_request_t* tx = &tpmif->tx->ring[0].req;
-   /* Throw away 0 size events, these can trigger from event channel unmasking */
-   if(tx->size == 0)
+   vtpm_shared_page_t* pg = tpmif->page;
+
+   /* Only pay attention if the request is ready */
+   if (pg->state == 0)
       return;
 
    TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
@@ -585,11 +572,10 @@ int connect_fe(tpmif_t* tpmif)
    free(value);
 
    domid = tpmif->domid;
-   if((tpmif->tx = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
+   if((tpmif->page = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
       TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
       return -1;
    }
-   memset(tpmif->tx, 0, PAGE_SIZE);
 
    /*Bind the event channel */
    if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler, tpmif, &tpmif->evtchn)))
@@ -618,7 +604,7 @@ error_post_evtchn:
    mask_evtchn(tpmif->evtchn);
    unbind_evtchn(tpmif->evtchn);
 error_post_map:
-   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1);
+   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1);
    return -1;
 }
 
@@ -874,6 +860,7 @@ void shutdown_tpmback(void)
 inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, unsigned char uuid[16])
 {
    tpmcmd->domid = domid;
+   tpmcmd->locality = -1;
    tpmcmd->handle = handle;
    memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
    tpmcmd->req = NULL;
@@ -884,12 +871,12 @@ inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, un
 
 tpmcmd_t* get_request(tpmif_t* tpmif) {
    tpmcmd_t* cmd;
-   tpmif_tx_request_t* tx;
-   int offset;
-   int tocopy;
-   int i;
-   uint32_t domid;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+   int i;
+#endif
 
    local_irq_save(flags);
 
@@ -899,35 +886,22 @@ tpmcmd_t* get_request(tpmif_t* tpmif) {
    }
    init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);
 
-   tx = &tpmif->tx->ring[0].req;
-   cmd->req_len = tx->size;
+   shr = tpmif->page;
+   cmd->req_len = shr->length;
+   cmd->locality = shr->locality;
+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->req_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
+   }
    /* Allocate the buffer */
    if(cmd->req_len) {
       if((cmd->req = malloc(cmd->req_len)) == NULL) {
 	 goto error;
       }
    }
-   /* Copy the bits from the shared pages */
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->req_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_READ)) == NULL) {
-	 TPMBACK_ERR("%u/%u Unable to map shared page during read!\n", (unsigned int) tpmif->domid, tpmif->handle);
-	 goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->req_len - offset, PAGE_SIZE);
-      memcpy(&cmd->req[offset], tpmif->pages[i], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
-
-   }
+   /* Copy the bits from the shared page(s) */
+   memcpy(cmd->req, offset + (uint8_t*)shr, cmd->req_len);
 
 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Received Tpm Command from %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->req_len);
@@ -958,38 +932,24 @@ error:
 
 void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
 {
-   tpmif_tx_request_t* tx;
-   int offset;
-   int i;
-   uint32_t domid;
-   int tocopy;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+int i;
+#endif
 
    local_irq_save(flags);
 
-   tx = &tpmif->tx->ring[0].req;
-   tx->size = cmd->resp_len;
-
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->resp_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_WRITE)) == NULL) {
-	 TPMBACK_ERR("%u/%u Unable to map shared page during write!\n", (unsigned int) tpmif->domid, tpmif->handle);
-	 goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->resp_len - offset, PAGE_SIZE);
-      memcpy(tpmif->pages[i], &cmd->resp[offset], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
+   shr = tpmif->page;
+   shr->length = cmd->resp_len;
 
+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->resp_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
    }
+   memcpy(offset + (uint8_t*)shr, cmd->resp, cmd->resp_len);
 
 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Sent response to %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->resp_len);
@@ -1003,6 +963,7 @@ void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
 #endif
    /* clear the ready flag and send the event channel notice to the frontend */
    tpmif_req_finished(tpmif);
+   shr->state = 0;
    notify_remote_via_evtchn(tpmif->evtchn);
 error:
    local_irq_restore(flags);
diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
index 0218d7f..e66ce3c 100644
--- a/extras/mini-os/tpmfront.c
+++ b/extras/mini-os/tpmfront.c
@@ -176,7 +176,7 @@ static int wait_for_backend_state_changed(struct tpmfront_dev* dev, XenbusState
 	 ret = wait_for_backend_closed(&events, path);
 	 break;
       default:
-	 break;
+         TPMFRONT_ERR("Bad wait state %d, ignoring\n", state);
    }
 
    if((err = xenbus_unwatch_path_token(XBT_NIL, path, path))) {
@@ -190,13 +190,13 @@ static int tpmfront_connect(struct tpmfront_dev* dev)
 {
    char* err;
    /* Create shared page */
-   dev->tx = (tpmif_tx_interface_t*) alloc_page();
-   if(dev->tx == NULL) {
+   dev->page = (vtpm_shared_page_t*) alloc_page();
+   if(dev->page == NULL) {
       TPMFRONT_ERR("Unable to allocate page for shared memory\n");
       goto error;
    }
-   memset(dev->tx, 0, PAGE_SIZE);
-   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->tx), 0);
+   memset(dev->page, 0, PAGE_SIZE);
+   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->page), 0);
    TPMFRONT_DEBUG("grant ref is %lu\n", (unsigned long) dev->ring_ref);
 
    /*Create event channel */
@@ -228,7 +228,7 @@ error_postevtchn:
       unbind_evtchn(dev->evtchn);
 error_postmap:
       gnttab_end_access(dev->ring_ref);
-      free_page(dev->tx);
+      free_page(dev->page);
 error:
    return -1;
 }
@@ -240,7 +240,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
    char path[512];
    char* value, *err;
    unsigned long long ival;
-   int i;
 
    printk("============= Init TPM Front ================\n");
 
@@ -289,19 +288,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
       goto error;
    }
 
-   /* Allocate pages that will contain the messages */
-   dev->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE);
-   if(dev->pages == NULL) {
-      goto error;
-   }
-   memset(dev->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-   for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-      dev->pages[i] = (void*)alloc_page();
-      if(dev->pages[i] == NULL) {
-	 goto error;
-      }
-   }
-
    TPMFRONT_LOG("Initialization Completed successfully\n");
 
    return dev;
@@ -314,8 +300,6 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
 {
    char* err;
    char path[512];
-   int i;
-   tpmif_tx_request_t* tx;
    if(dev == NULL) {
       return;
    }
@@ -349,27 +333,12 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
       /* Wait for the backend to close and unmap shared pages, ignore any errors */
       wait_for_backend_state_changed(dev, XenbusStateClosed);
 
-      /* Cleanup any shared pages */
-      if(dev->pages) {
-	 for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-	    if(dev->pages[i]) {
-	       tx = &dev->tx->ring[i].req;
-	       if(tx->ref != 0) {
-		  gnttab_end_access(tx->ref);
-	       }
-	       free_page(dev->pages[i]);
-	    }
-	 }
-	 free(dev->pages);
-      }
-
       /* Close event channel and unmap shared page */
       mask_evtchn(dev->evtchn);
       unbind_evtchn(dev->evtchn);
       gnttab_end_access(dev->ring_ref);
 
-      free_page(dev->tx);
-
+      free_page(dev->page);
    }
 
    /* Cleanup memory usage */
@@ -387,13 +356,17 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
 
 int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 {
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
    int i;
-   tpmif_tx_request_t* tx = NULL;
+#endif
    /* Error Checking */
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to send message through disconnected frontend\n");
       return -1;
    }
+   shr = dev->page;
 
 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Sending Msg to backend size=%u", (unsigned int) length);
@@ -407,19 +380,16 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 #endif
 
    /* Copy to shared pages now */
-   for(i = 0; length > 0 && i < TPMIF_TX_RING_SIZE; ++i) {
-      /* Share the page */
-      tx = &dev->tx->ring[i].req;
-      tx->unused = 0;
-      tx->addr = virt_to_mach(dev->pages[i]);
-      tx->ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->pages[i]), 0);
-      /* Copy the bits to the page */
-      tx->size = length > PAGE_SIZE ? PAGE_SIZE : length;
-      memcpy(dev->pages[i], &msg[i * PAGE_SIZE], tx->size);
-
-      /* Update counters */
-      length -= tx->size;
+   offset = sizeof(*shr);
+   if (length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Message too long for shared page\n");
+      return -1;
    }
+   memcpy(offset + (uint8_t*)shr, msg, length);
+   shr->length = length;
+   barrier();
+   shr->state = 1;
+
    dev->waiting = 1;
    dev->resplen = 0;
 #ifdef HAVE_LIBC
@@ -434,44 +404,41 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 }
 int tpmfront_recv(struct tpmfront_dev* dev, uint8_t** msg, size_t *length)
 {
-   tpmif_tx_request_t* tx;
-   int i;
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
+int i;
+#endif
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to receive message from disconnected frontend\n");
       return -1;
    }
    /*Wait for the response */
    wait_event(dev->waitq, (!dev->waiting));
+   shr = dev->page;
+   if (shr->state != 0)
+      goto quit;
 
    /* Initialize */
    *msg = NULL;
-   *length = 0;
+   *length = shr->length;
+   offset = sizeof(*shr);
 
-   /* special case, just quit */
-   tx = &dev->tx->ring[0].req;
-   if(tx->size == 0 ) {
-       goto quit;
-   }
-   /* Get the total size */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      *length += tx->size;
+   if (*length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Reply too long for shared page\n");
+      return -1;
    }
+
    /* Alloc the buffer */
    if(dev->respbuf) {
       free(dev->respbuf);
    }
    *msg = dev->respbuf = malloc(*length);
    dev->resplen = *length;
+
    /* Copy the bits */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      memcpy(&(*msg)[i * PAGE_SIZE], dev->pages[i], tx->size);
-      gnttab_end_access(tx->ref);
-      tx->ref = 0;
-   }
+   memcpy(*msg, offset + (uint8_t*)shr, *length);
+
 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Received response from backend size=%u", (unsigned int) *length);
    for(i = 0; i < *length; ++i) {
@@ -504,6 +471,14 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t*
    return 0;
 }
 
+int tpmfront_set_locality(struct tpmfront_dev* dev, int locality)
+{
+   if (!dev || !dev->page)
+      return -1;
+   dev->page->locality = locality;
+   return 0;
+}
+
 #ifdef HAVE_LIBC
 #include <errno.h>
 int tpmfront_open(struct tpmfront_dev* dev)
diff --git a/xen/include/public/io/tpmif.h b/xen/include/public/io/tpmif.h
index 02ccdab..afc9181 100644
--- a/xen/include/public/io/tpmif.h
+++ b/xen/include/public/io/tpmif.h
@@ -1,7 +1,7 @@
 /******************************************************************************
  * tpmif.h
  *
- * TPM I/O interface for Xen guest OSes.
+ * TPM I/O interface for Xen guest OSes, v2
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -21,48 +21,23 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  *
- * Copyright (c) 2005, IBM Corporation
- *
- * Author: Stefan Berger, stefanb@us.ibm.com
- * Grant table support: Mahadevan Gomathisankaran
- *
- * This code has been derived from tools/libxc/xen/io/netif.h
- *
- * Copyright (c) 2003-2004, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_IO_TPMIF_H__
 #define __XEN_PUBLIC_IO_TPMIF_H__
 
-#include "../grant_table.h"
+struct vtpm_shared_page {
+    uint16_t length;         /* request/response length in bytes */
 
-struct tpmif_tx_request {
-    unsigned long addr;   /* Machine address of packet.   */
-    grant_ref_t ref;      /* grant table access reference */
-    uint16_t unused;
-    uint16_t size;        /* Packet size in bytes.        */
-};
-typedef struct tpmif_tx_request tpmif_tx_request_t;
-
-/*
- * The TPMIF_TX_RING_SIZE defines the number of pages the
- * front-end and backend can exchange (= size of array).
- */
-typedef uint32_t TPMIF_RING_IDX;
-
-#define TPMIF_TX_RING_SIZE 1
-
-/* This structure must fit in a memory page. */
-
-struct tpmif_ring {
-    struct tpmif_tx_request req;
-};
-typedef struct tpmif_ring tpmif_ring_t;
+    uint8_t state;           /* 0 - response ready / idle
+                              * 1 - request ready / working */
+    uint8_t locality;        /* for the current request */
+    uint8_t padding[3];
 
-struct tpmif_tx_interface {
-    struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
+    uint8_t nr_extra_pages;  /* extra pages for long packets; may be zero */
+    uint32_t extra_pages[0]; /* grant IDs; length is actually nr_extra_pages */
 };
-typedef struct tpmif_tx_interface tpmif_tx_interface_t;
+typedef struct vtpm_shared_page vtpm_shared_page_t;
 
 #endif
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:49:56 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRuU-0007Zu-DO; Fri, 30 Nov 2012 14:49:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRuS-0007Y8-6O
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:44 +0000
Received: from [85.158.139.211:57601] by server-11.bemta-5.messagelabs.com id
	81/16-03409-787C8B05; Fri, 30 Nov 2012 14:49:43 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-12.tower-206.messagelabs.com!1354286981!18432335!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18590 invoked from network); 30 Nov 2012 14:49:41 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-12.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 14:49:41 -0000
X-TM-IMSS-Message-ID: <336600c900026ba4@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 336600c900026ba4 ;
	Fri, 30 Nov 2012 09:48:15 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLqf014134; 
	Fri, 30 Nov 2012 09:49:21 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:07 -0500
Message-Id: <1354286955-23900-2-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 1/9] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This changes the vTPM shared page ABI from a copy of the Xen network
interface to a single-page interface that better reflects the expected
behavior of a TPM: only a single request packet can be sent at any given
time, and every packet sent generates a single response packet. This
protocol change should also increase efficiency as it avoids mapping and
unmapping grants when possible.

While the contents of the shared page have been defined to allow packets
larger than a single page (actually 4088 bytes) by allowing the client
to add extra grant references, the mapping of these extra references has
not been implemented; a feature node in xenstore may be used in the
future to indicate full support for the multi-page protocol. Most uses
of the TPM should not require this feature.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/include/tpmback.h  |   1 +
 extras/mini-os/include/tpmfront.h |   7 ++-
 extras/mini-os/tpmback.c          | 115 +++++++++++++------------------------
 extras/mini-os/tpmfront.c         | 117 +++++++++++++++-----------------------
 xen/include/public/io/tpmif.h     |  45 ++++-----------
 5 files changed, 99 insertions(+), 186 deletions(-)

diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
index ff86732..ec9eda4 100644
--- a/extras/mini-os/include/tpmback.h
+++ b/extras/mini-os/include/tpmback.h
@@ -43,6 +43,7 @@
 
 struct tpmcmd {
    domid_t domid;		/* Domid of the frontend */
+   uint8_t locality;    /* Locality requested by the frontend */
    unsigned int handle;	/* Handle of the frontend */
    unsigned char uuid[16];			/* uuid of the tpm interface */
 
diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include/tpmfront.h
index fd2cb17..a0c7c4d 100644
--- a/extras/mini-os/include/tpmfront.h
+++ b/extras/mini-os/include/tpmfront.h
@@ -37,9 +37,7 @@ struct tpmfront_dev {
    grant_ref_t ring_ref;
    evtchn_port_t evtchn;
 
-   tpmif_tx_interface_t* tx;
-
-   void** pages;
+   vtpm_shared_page_t *page;
 
    domid_t bedomid;
    char* nodename;
@@ -77,6 +75,9 @@ void shutdown_tpmfront(struct tpmfront_dev* dev);
  * */
 int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen);
 
+/* Set the locality used for communicating with a vTPM */
+int tpmfront_set_locality(struct tpmfront_dev* dev, int locality);
+
 #ifdef HAVE_LIBC
 #include <sys/stat.h>
 /* POSIX IO functions:
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index 658fed1..01c2851 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -86,10 +86,7 @@ struct tpmif {
    evtchn_port_t evtchn;
 
    /* Shared page */
-   tpmif_tx_interface_t* tx;
-
-   /* pointer to TPMIF_RX_RING_SIZE pages */
-   void** pages;
+   vtpm_shared_page_t *page;
 
    enum xenbus_state state;
    enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
@@ -312,7 +309,6 @@ int insert_tpmif(tpmif_t* tpmif)
       remove_tpmif(tpmif);
       goto error_post_irq;
    }
-
    return 0;
 error:
    local_irq_restore(flags);
@@ -386,8 +382,7 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
    tpmif->fe_state_path = NULL;
    tpmif->state = XenbusStateInitialising;
    tpmif->status = DISCONNECTED;
-   tpmif->tx = NULL;
-   tpmif->pages = NULL;
+   tpmif->page = NULL;
    tpmif->flags = 0;
    memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
    return tpmif;
@@ -395,9 +390,6 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
 
 void __free_tpmif(tpmif_t* tpmif)
 {
-   if(tpmif->pages) {
-      free(tpmif->pages);
-   }
    if(tpmif->fe_path) {
       free(tpmif->fe_path);
    }
@@ -430,12 +422,6 @@ tpmif_t* new_tpmif(domid_t domid, unsigned int handle)
       goto error;
    }
 
-   /* allocate pages to be used for shared mapping */
-   if((tpmif->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE)) == NULL) {
-      goto error;
-   }
-   memset(tpmif->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-
    if(tpmif_change_state(tpmif, XenbusStateInitWait)) {
       goto error;
    }
@@ -486,7 +472,7 @@ void free_tpmif(tpmif_t* tpmif)
       tpmif->status = DISCONNECTING;
       mask_evtchn(tpmif->evtchn);
 
-      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1)) {
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
 	 TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
       }
 
@@ -529,9 +515,10 @@ void free_tpmif(tpmif_t* tpmif)
 void tpmback_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
 {
    tpmif_t* tpmif = (tpmif_t*) data;
-   tpmif_tx_request_t* tx = &tpmif->tx->ring[0].req;
-   /* Throw away 0 size events, these can trigger from event channel unmasking */
-   if(tx->size == 0)
+   vtpm_shared_page_t* pg = tpmif->page;
+
+   /* Only pay attention if the request is ready */
+   if (pg->state == 0)
       return;
 
    TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
@@ -585,11 +572,10 @@ int connect_fe(tpmif_t* tpmif)
    free(value);
 
    domid = tpmif->domid;
-   if((tpmif->tx = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
+   if((tpmif->page = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
       TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
       return -1;
    }
-   memset(tpmif->tx, 0, PAGE_SIZE);
 
    /*Bind the event channel */
    if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler, tpmif, &tpmif->evtchn)))
@@ -618,7 +604,7 @@ error_post_evtchn:
    mask_evtchn(tpmif->evtchn);
    unbind_evtchn(tpmif->evtchn);
 error_post_map:
-   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1);
+   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1);
    return -1;
 }
 
@@ -874,6 +860,7 @@ void shutdown_tpmback(void)
 inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, unsigned char uuid[16])
 {
    tpmcmd->domid = domid;
+   tpmcmd->locality = -1;
    tpmcmd->handle = handle;
    memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
    tpmcmd->req = NULL;
@@ -884,12 +871,12 @@ inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, un
 
 tpmcmd_t* get_request(tpmif_t* tpmif) {
    tpmcmd_t* cmd;
-   tpmif_tx_request_t* tx;
-   int offset;
-   int tocopy;
-   int i;
-   uint32_t domid;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+   int i;
+#endif
 
    local_irq_save(flags);
 
@@ -899,35 +886,22 @@ tpmcmd_t* get_request(tpmif_t* tpmif) {
    }
    init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);
 
-   tx = &tpmif->tx->ring[0].req;
-   cmd->req_len = tx->size;
+   shr = tpmif->page;
+   cmd->req_len = shr->length;
+   cmd->locality = shr->locality;
+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->req_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
+   }
    /* Allocate the buffer */
    if(cmd->req_len) {
       if((cmd->req = malloc(cmd->req_len)) == NULL) {
 	 goto error;
       }
    }
-   /* Copy the bits from the shared pages */
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->req_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_READ)) == NULL) {
-	 TPMBACK_ERR("%u/%u Unable to map shared page during read!\n", (unsigned int) tpmif->domid, tpmif->handle);
-	 goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->req_len - offset, PAGE_SIZE);
-      memcpy(&cmd->req[offset], tpmif->pages[i], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
-
-   }
+   /* Copy the bits from the shared page(s) */
+   memcpy(cmd->req, offset + (uint8_t*)shr, cmd->req_len);
 
 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Received Tpm Command from %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->req_len);
@@ -958,38 +932,24 @@ error:
 
 void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
 {
-   tpmif_tx_request_t* tx;
-   int offset;
-   int i;
-   uint32_t domid;
-   int tocopy;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+int i;
+#endif
 
    local_irq_save(flags);
 
-   tx = &tpmif->tx->ring[0].req;
-   tx->size = cmd->resp_len;
-
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->resp_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_WRITE)) == NULL) {
-	 TPMBACK_ERR("%u/%u Unable to map shared page during write!\n", (unsigned int) tpmif->domid, tpmif->handle);
-	 goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->resp_len - offset, PAGE_SIZE);
-      memcpy(tpmif->pages[i], &cmd->resp[offset], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
+   shr = tpmif->page;
+   shr->length = cmd->resp_len;
 
+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->resp_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
    }
+   memcpy(offset + (uint8_t*)shr, cmd->resp, cmd->resp_len);
 
 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Sent response to %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->resp_len);
@@ -1003,6 +963,7 @@ void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
 #endif
    /* clear the ready flag and send the event channel notice to the frontend */
    tpmif_req_finished(tpmif);
+   shr->state = 0;
    notify_remote_via_evtchn(tpmif->evtchn);
 error:
    local_irq_restore(flags);
diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
index 0218d7f..e66ce3c 100644
--- a/extras/mini-os/tpmfront.c
+++ b/extras/mini-os/tpmfront.c
@@ -176,7 +176,7 @@ static int wait_for_backend_state_changed(struct tpmfront_dev* dev, XenbusState
 	 ret = wait_for_backend_closed(&events, path);
 	 break;
       default:
-	 break;
+         TPMFRONT_ERR("Bad wait state %d, ignoring\n", state);
    }
 
    if((err = xenbus_unwatch_path_token(XBT_NIL, path, path))) {
@@ -190,13 +190,13 @@ static int tpmfront_connect(struct tpmfront_dev* dev)
 {
    char* err;
    /* Create shared page */
-   dev->tx = (tpmif_tx_interface_t*) alloc_page();
-   if(dev->tx == NULL) {
+   dev->page = (vtpm_shared_page_t*) alloc_page();
+   if(dev->page == NULL) {
       TPMFRONT_ERR("Unable to allocate page for shared memory\n");
       goto error;
    }
-   memset(dev->tx, 0, PAGE_SIZE);
-   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->tx), 0);
+   memset(dev->page, 0, PAGE_SIZE);
+   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->page), 0);
    TPMFRONT_DEBUG("grant ref is %lu\n", (unsigned long) dev->ring_ref);
 
    /*Create event channel */
@@ -228,7 +228,7 @@ error_postevtchn:
       unbind_evtchn(dev->evtchn);
 error_postmap:
       gnttab_end_access(dev->ring_ref);
-      free_page(dev->tx);
+      free_page(dev->page);
 error:
    return -1;
 }
@@ -240,7 +240,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
    char path[512];
    char* value, *err;
    unsigned long long ival;
-   int i;
 
    printk("============= Init TPM Front ================\n");
 
@@ -289,19 +288,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
       goto error;
    }
 
-   /* Allocate pages that will contain the messages */
-   dev->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE);
-   if(dev->pages == NULL) {
-      goto error;
-   }
-   memset(dev->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-   for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-      dev->pages[i] = (void*)alloc_page();
-      if(dev->pages[i] == NULL) {
-	 goto error;
-      }
-   }
-
    TPMFRONT_LOG("Initialization Completed successfully\n");
 
    return dev;
@@ -314,8 +300,6 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
 {
    char* err;
    char path[512];
-   int i;
-   tpmif_tx_request_t* tx;
    if(dev == NULL) {
       return;
    }
@@ -349,27 +333,12 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
       /* Wait for the backend to close and unmap shared pages, ignore any errors */
       wait_for_backend_state_changed(dev, XenbusStateClosed);
 
-      /* Cleanup any shared pages */
-      if(dev->pages) {
-	 for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-	    if(dev->pages[i]) {
-	       tx = &dev->tx->ring[i].req;
-	       if(tx->ref != 0) {
-		  gnttab_end_access(tx->ref);
-	       }
-	       free_page(dev->pages[i]);
-	    }
-	 }
-	 free(dev->pages);
-      }
-
       /* Close event channel and unmap shared page */
       mask_evtchn(dev->evtchn);
       unbind_evtchn(dev->evtchn);
       gnttab_end_access(dev->ring_ref);
 
-      free_page(dev->tx);
-
+      free_page(dev->page);
    }
 
    /* Cleanup memory usage */
@@ -387,13 +356,17 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
 
 int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 {
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
    int i;
-   tpmif_tx_request_t* tx = NULL;
+#endif
    /* Error Checking */
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to send message through disconnected frontend\n");
       return -1;
    }
+   shr = dev->page;
 
 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Sending Msg to backend size=%u", (unsigned int) length);
@@ -407,19 +380,16 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 #endif
 
    /* Copy to shared pages now */
-   for(i = 0; length > 0 && i < TPMIF_TX_RING_SIZE; ++i) {
-      /* Share the page */
-      tx = &dev->tx->ring[i].req;
-      tx->unused = 0;
-      tx->addr = virt_to_mach(dev->pages[i]);
-      tx->ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->pages[i]), 0);
-      /* Copy the bits to the page */
-      tx->size = length > PAGE_SIZE ? PAGE_SIZE : length;
-      memcpy(dev->pages[i], &msg[i * PAGE_SIZE], tx->size);
-
-      /* Update counters */
-      length -= tx->size;
+   offset = sizeof(*shr);
+   if (length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Message too long for shared page\n");
+      return -1;
    }
+   memcpy(offset + (uint8_t*)shr, msg, length);
+   shr->length = length;
+   barrier();
+   shr->state = 1;
+
    dev->waiting = 1;
    dev->resplen = 0;
 #ifdef HAVE_LIBC
@@ -434,44 +404,41 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 }
 int tpmfront_recv(struct tpmfront_dev* dev, uint8_t** msg, size_t *length)
 {
-   tpmif_tx_request_t* tx;
-   int i;
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
+int i;
+#endif
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to receive message from disconnected frontend\n");
       return -1;
    }
    /*Wait for the response */
    wait_event(dev->waitq, (!dev->waiting));
+   shr = dev->page;
+   if (shr->state != 0)
+      goto quit;
 
    /* Initialize */
    *msg = NULL;
-   *length = 0;
+   *length = shr->length;
+   offset = sizeof(*shr);
 
-   /* special case, just quit */
-   tx = &dev->tx->ring[0].req;
-   if(tx->size == 0 ) {
-       goto quit;
-   }
-   /* Get the total size */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      *length += tx->size;
+   if (*length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Reply too long for shared page\n");
+      return -1;
    }
+
    /* Alloc the buffer */
    if(dev->respbuf) {
       free(dev->respbuf);
    }
    *msg = dev->respbuf = malloc(*length);
    dev->resplen = *length;
+
    /* Copy the bits */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      memcpy(&(*msg)[i * PAGE_SIZE], dev->pages[i], tx->size);
-      gnttab_end_access(tx->ref);
-      tx->ref = 0;
-   }
+   memcpy(*msg, offset + (uint8_t*)shr, *length);
+
 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Received response from backend size=%u", (unsigned int) *length);
    for(i = 0; i < *length; ++i) {
@@ -504,6 +471,14 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t*
    return 0;
 }
 
+int tpmfront_set_locality(struct tpmfront_dev* dev, int locality)
+{
+   if (!dev || !dev->page)
+      return -1;
+   dev->page->locality = locality;
+   return 0;
+}
+
 #ifdef HAVE_LIBC
 #include <errno.h>
 int tpmfront_open(struct tpmfront_dev* dev)
diff --git a/xen/include/public/io/tpmif.h b/xen/include/public/io/tpmif.h
index 02ccdab..afc9181 100644
--- a/xen/include/public/io/tpmif.h
+++ b/xen/include/public/io/tpmif.h
@@ -1,7 +1,7 @@
 /******************************************************************************
  * tpmif.h
  *
- * TPM I/O interface for Xen guest OSes.
+ * TPM I/O interface for Xen guest OSes, v2
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -21,48 +21,23 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  *
- * Copyright (c) 2005, IBM Corporation
- *
- * Author: Stefan Berger, stefanb@us.ibm.com
- * Grant table support: Mahadevan Gomathisankaran
- *
- * This code has been derived from tools/libxc/xen/io/netif.h
- *
- * Copyright (c) 2003-2004, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_IO_TPMIF_H__
 #define __XEN_PUBLIC_IO_TPMIF_H__
 
-#include "../grant_table.h"
+struct vtpm_shared_page {
+    uint16_t length;         /* request/response length in bytes */
 
-struct tpmif_tx_request {
-    unsigned long addr;   /* Machine address of packet.   */
-    grant_ref_t ref;      /* grant table access reference */
-    uint16_t unused;
-    uint16_t size;        /* Packet size in bytes.        */
-};
-typedef struct tpmif_tx_request tpmif_tx_request_t;
-
-/*
- * The TPMIF_TX_RING_SIZE defines the number of pages the
- * front-end and backend can exchange (= size of array).
- */
-typedef uint32_t TPMIF_RING_IDX;
-
-#define TPMIF_TX_RING_SIZE 1
-
-/* This structure must fit in a memory page. */
-
-struct tpmif_ring {
-    struct tpmif_tx_request req;
-};
-typedef struct tpmif_ring tpmif_ring_t;
+    uint8_t state;           /* 0 - response ready / idle
+                              * 1 - request ready / working */
+    uint8_t locality;        /* for the current request */
+    uint8_t padding[3];
 
-struct tpmif_tx_interface {
-    struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
+    uint8_t nr_extra_pages;  /* extra pages for long packets; may be zero */
+    uint32_t extra_pages[0]; /* grant IDs; length is actually nr_extra_pages */
 };
-typedef struct tpmif_tx_interface tpmif_tx_interface_t;
+typedef struct vtpm_shared_page vtpm_shared_page_t;
 
 #endif
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:50:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:50:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRui-0007k5-1B; Fri, 30 Nov 2012 14:50:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRug-0007iV-BC
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:58 +0000
Received: from [85.158.139.211:64175] by server-5.bemta-5.messagelabs.com id
	6C/B1-11353-597C8B05; Fri, 30 Nov 2012 14:49:57 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354286976!18111717!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 773 invoked from network); 30 Nov 2012 14:49:37 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-7.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 14:49:37 -0000
X-TM-IMSS-Message-ID: <336601f100026ba5@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 336601f100026ba5 ;
	Fri, 30 Nov 2012 09:48:16 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLqg014134; 
	Fri, 30 Nov 2012 09:49:22 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:08 -0500
Message-Id: <1354286955-23900-3-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 2/9] stubdom/vtpm: Support locality field
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The vTPM protocol now contains a field allowing the locality of a
command to be specified; pass this to the TPM when processing a packet.
While the locality is not currently checked for validity, a binding
between locality and some distinguishing feature of the client domain
(such as the XSM label) will need to be defined in order to properly
support a multi-client vTPM.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/Makefile            |  1 +
 stubdom/vtpm-locality.patch | 50 +++++++++++++++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm.c         |  2 +-
 3 files changed, 52 insertions(+), 1 deletion(-)
 create mode 100644 stubdom/vtpm-locality.patch

diff --git a/stubdom/Makefile b/stubdom/Makefile
index fcc608e..683bc51 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -207,6 +207,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	tar xzf $<
 	mv tpm_emulator-$(TPMEMU_VERSION) $@
 	patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
+	patch -d $@ -p1 < vtpm-locality.patch
 	mkdir $@/build
 	cd $@/build; $(CMAKE) .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
 	touch $@
diff --git a/stubdom/vtpm-locality.patch b/stubdom/vtpm-locality.patch
new file mode 100644
index 0000000..8ab7dea
--- /dev/null
+++ b/stubdom/vtpm-locality.patch
@@ -0,0 +1,50 @@
+diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
+index 60bbb90..f8f7f0f 100644
+--- a/tpm/tpm_capability.c
++++ b/tpm/tpm_capability.c
+@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *setValue,
+                              UINT32 setValueSize, BOOL ownerAuth,
+                              BOOL deactivated, BOOL disabled)
+ {
++  if (tpmData.stany.flags.localityModifier != 8)
++    return TPM_BAD_PARAMETER;
+   /* set the capability area with the specified data, on failure
+      deactivate the TPM */
+   switch (subCap) {
+diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
+index 288d1ce..9e1cfb4 100644
+--- a/tpm/tpm_cmd_handler.c
++++ b/tpm/tpm_cmd_handler.c
+@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
+   tpm_extern_release();
+ }
+ 
+-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size)
++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality)
+ {
+   TPM_REQUEST req;
+   TPM_RESPONSE rsp;
+@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint3
+   UINT32 len;
+   BOOL free_out;
+ 
+-  debug("tpm_handle_command()");
++  debug("tpm_handle_command(%d)", locality);
++  if (locality != -1)
++    tpmData.stany.flags.localityModifier = locality;
+ 
+   /* we need the whole packet at once, otherwise unmarshalling will fail */
+   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) != 0) {
+diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
+index eed749e..4c228bd 100644
+--- a/tpm/tpm_emulator.h
++++ b/tpm/tpm_emulator.h
+@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
+  * its usage. In case of an error, all internally allocated memory
+  * is released and the the state of out and out_size is unspecified.
+  */ 
+-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size);
++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality);
+ 
+ #endif /* _TPM_EMULATOR_H_ */
+ 
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
index 71aef78..eb7912f 100644
--- a/stubdom/vtpm/vtpm.c
+++ b/stubdom/vtpm/vtpm.c
@@ -183,7 +183,7 @@ static void main_loop(void) {
          }
          /* If not disabled, do the command */
          else {
-            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
+            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) != 0) {
                error("tpm_handle_command() failed");
                create_error_response(tpmcmd, TPM_FAIL);
             }
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:50:05 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:50:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeRui-0007k5-1B; Fri, 30 Nov 2012 14:50:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeRug-0007iV-BC
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:49:58 +0000
Received: from [85.158.139.211:64175] by server-5.bemta-5.messagelabs.com id
	6C/B1-11353-597C8B05; Fri, 30 Nov 2012 14:49:57 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354286976!18111717!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 773 invoked from network); 30 Nov 2012 14:49:37 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-7.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 14:49:37 -0000
X-TM-IMSS-Message-ID: <336601f100026ba5@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 336601f100026ba5 ;
	Fri, 30 Nov 2012 09:48:16 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUEnLqg014134; 
	Fri, 30 Nov 2012 09:49:22 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: matthew.fioravante@jhuapl.edu, Ian.Campbell@citrix.com
Date: Fri, 30 Nov 2012 09:49:08 -0500
Message-Id: <1354286955-23900-3-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354286955-23900-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH 2/9] stubdom/vtpm: Support locality field
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The vTPM protocol now contains a field allowing the locality of a
command to be specified; pass this to the TPM when processing a packet.
While the locality is not currently checked for validity, a binding
between locality and some distinguishing feature of the client domain
(such as the XSM label) will need to be defined in order to properly
support a multi-client vTPM.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/Makefile            |  1 +
 stubdom/vtpm-locality.patch | 50 +++++++++++++++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm.c         |  2 +-
 3 files changed, 52 insertions(+), 1 deletion(-)
 create mode 100644 stubdom/vtpm-locality.patch

diff --git a/stubdom/Makefile b/stubdom/Makefile
index fcc608e..683bc51 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -207,6 +207,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	tar xzf $<
 	mv tpm_emulator-$(TPMEMU_VERSION) $@
 	patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
+	patch -d $@ -p1 < vtpm-locality.patch
 	mkdir $@/build
 	cd $@/build; $(CMAKE) .. -DCMAKE_C_COMPILER=${CC} -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
 	touch $@
diff --git a/stubdom/vtpm-locality.patch b/stubdom/vtpm-locality.patch
new file mode 100644
index 0000000..8ab7dea
--- /dev/null
+++ b/stubdom/vtpm-locality.patch
@@ -0,0 +1,50 @@
+diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
+index 60bbb90..f8f7f0f 100644
+--- a/tpm/tpm_capability.c
++++ b/tpm/tpm_capability.c
+@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *setValue,
+                              UINT32 setValueSize, BOOL ownerAuth,
+                              BOOL deactivated, BOOL disabled)
+ {
++  if (tpmData.stany.flags.localityModifier != 8)
++    return TPM_BAD_PARAMETER;
+   /* set the capability area with the specified data, on failure
+      deactivate the TPM */
+   switch (subCap) {
+diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
+index 288d1ce..9e1cfb4 100644
+--- a/tpm/tpm_cmd_handler.c
++++ b/tpm/tpm_cmd_handler.c
+@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
+   tpm_extern_release();
+ }
+ 
+-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size)
++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality)
+ {
+   TPM_REQUEST req;
+   TPM_RESPONSE rsp;
+@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint3
+   UINT32 len;
+   BOOL free_out;
+ 
+-  debug("tpm_handle_command()");
++  debug("tpm_handle_command(%d)", locality);
++  if (locality != -1)
++    tpmData.stany.flags.localityModifier = locality;
+ 
+   /* we need the whole packet at once, otherwise unmarshalling will fail */
+   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) != 0) {
+diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
+index eed749e..4c228bd 100644
+--- a/tpm/tpm_emulator.h
++++ b/tpm/tpm_emulator.h
+@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
+  * its usage. In case of an error, all internally allocated memory
+  * is released and the the state of out and out_size is unspecified.
+  */ 
+-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size);
++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality);
+ 
+ #endif /* _TPM_EMULATOR_H_ */
+ 
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
index 71aef78..eb7912f 100644
--- a/stubdom/vtpm/vtpm.c
+++ b/stubdom/vtpm/vtpm.c
@@ -183,7 +183,7 @@ static void main_loop(void) {
          }
          /* If not disabled, do the command */
          else {
-            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
+            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) != 0) {
                error("tpm_handle_command() failed");
                create_error_response(tpmcmd, TPM_FAIL);
             }
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:58:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:58:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeS3J-0000mQ-5N; Fri, 30 Nov 2012 14:58:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TeS3I-0000mL-G9
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:58:52 +0000
Received: from [85.158.138.51:46290] by server-6.bemta-3.messagelabs.com id
	4C/64-28265-BA9C8B05; Fri, 30 Nov 2012 14:58:51 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1354287529!32127457!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26928 invoked from network); 30 Nov 2012 14:58:50 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 14:58:50 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="216007687"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 14:58:44 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:58:44 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TeS3A-0003m2-27;
	Fri, 30 Nov 2012 14:58:44 +0000
Date: Fri, 30 Nov 2012 14:58:39 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <ian.campbell@citrix.com>
In-Reply-To: <1346679056-8108-6-git-send-email-ian.campbell@citrix.com>
Message-ID: <alpine.DEB.2.02.1211301446580.5310@kaball.uk.xensource.com>
References: <1346678886.32462.9.camel@zakaz.uk.xensource.com>
	<1346679056-8108-6-git-send-email-ian.campbell@citrix.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 06/16] arm: parse modules from DT during
 early boot.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 3 Sep 2012, Ian Campbell wrote:
> The bootloader should populate /chosen/nr-modules with the number of
> modules and then for each module 0..nr-modules-1 it should populate
> /chosen/moduleN-{start,end} with the physical address of the module.

Considering that we can traverse the DT and enumerate all the children
of a particular node, we don't need a nr-modules property.

Also I would rather move all the modules under /chosen/modules than have
/chosen/module-N.

We could even go as far as having one single modules node, with every
module expressed as a reg range in memory.

Then you can document that for Xen the first module should be the linux
kernel and the second module should be the initrd.

chosen {
    modules {
        reg = < first_address first_size >, <second_address second_size>;
    };
};

Besides being more concise and requiring simpler parsing, I think that
it is much more... aesthetic :)


> The hypervisor allows for 2 modules (kernel and initrd). Currently we
> don't do anything with them.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
>  xen/common/device_tree.c      |   57 +++++++++++++++++++++++++++++++++++++++++
>  xen/include/xen/device_tree.h |    7 +++++
>  2 files changed, 64 insertions(+), 0 deletions(-)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 3d1f0f4..226e3f3 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -229,6 +229,61 @@ static void __init process_memory_node(const void *fdt, int node,
>      }
>  }
>  
> +static void __init process_chosen_node(const void *fdt, int node,
> +                                       const char *name,
> +                                       u32 address_cells, u32 size_cells)
> +{
> +    const struct fdt_property *prop;
> +    const u32 *cell;
> +    paddr_t size;
> +    int i, nr_modules;
> +
> +    prop = fdt_get_property(fdt, node, "nr-modules", NULL);
> +    if ( !prop )
> +    {
> +        early_info.modules.nr_mods = 0;
> +        return;
> +    }
> +
> +    cell = (const u32 *)prop->data;
> +    get_val(&cell, 1, (u64*)&nr_modules);
> +
> +    if ( nr_modules > NR_MODULES )
> +    {
> +        early_panic("too many modules %d > %d\n", nr_modules, NR_MODULES);
> +    }
> +
> +    for ( i = 0; i < nr_modules; i++ )
> +    {
> +        struct membank *mod = &early_info.modules.module[i];
> +        /* longest prop name is "start", single digit numbers of modules */
> +        char propname[strlen("moduleX-start") + 1];
> +
> +        BUILD_BUG_ON(NR_MODULES > 9);
> +
> +        snprintf(propname, sizeof(propname), "module%d-start", i+1);
> +        prop = fdt_get_property(fdt, node, propname, NULL);
> +        if ( !prop )
> +            early_panic("no start for module %d\n", i);
> +
> +        cell = (const u32 *)prop->data;
> +        device_tree_get_reg(&cell, address_cells, size_cells,
> +                            &mod->start, &size);

I don't think you should be using device_tree_get_reg to parse a non reg
property


> +        snprintf(propname, sizeof(propname), "module%d-end", i+1);
> +        prop = fdt_get_property(fdt, node, propname, NULL);
> +        if ( !prop )
> +            early_panic("no end for module %d\n", i);
> +
> +        cell = (const u32 *)prop->data;
> +        device_tree_get_reg(&cell, address_cells, size_cells,
> +                            &mod->size, &size);
> +        mod->size -= mod->start;
> +    }
> +
> +    early_info.modules.nr_mods = nr_modules;
> +}
> +
>  static int __init early_scan_node(const void *fdt,
>                                    int node, const char *name, int depth,
>                                    u32 address_cells, u32 size_cells,
> @@ -236,6 +291,8 @@ static int __init early_scan_node(const void *fdt,
>  {
>      if ( device_tree_node_matches(fdt, node, "memory") )
>          process_memory_node(fdt, node, name, address_cells, size_cells);
> +    else if ( device_tree_node_matches(fdt, node, "chosen") )
> +        process_chosen_node(fdt, node, name, address_cells, size_cells);
>  
>      return 0;
>  }
> diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
> index 4d010c0..585fcc9 100644
> --- a/xen/include/xen/device_tree.h
> +++ b/xen/include/xen/device_tree.h
> @@ -15,6 +15,7 @@
>  #define DEVICE_TREE_MAX_DEPTH 16
>  
>  #define NR_MEM_BANKS 8
> +#define NR_MODULES 2
>  
>  struct membank {
>      paddr_t start;
> @@ -26,8 +27,14 @@ struct dt_mem_info {
>      struct membank bank[NR_MEM_BANKS];
>  };
>  
> +struct dt_module_info {
> +    int nr_mods;
> +    struct membank module[NR_MODULES];
> +};
> +
>  struct dt_early_info {
>      struct dt_mem_info mem;
> +    struct dt_module_info modules;
>  };
>  
>  typedef int (*device_tree_node_func)(const void *fdt,
> -- 
> 1.7.9.1
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 14:58:59 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 14:58:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeS3J-0000mQ-5N; Fri, 30 Nov 2012 14:58:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TeS3I-0000mL-G9
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 14:58:52 +0000
Received: from [85.158.138.51:46290] by server-6.bemta-3.messagelabs.com id
	4C/64-28265-BA9C8B05; Fri, 30 Nov 2012 14:58:51 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1354287529!32127457!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26928 invoked from network); 30 Nov 2012 14:58:50 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-8.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 14:58:50 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="216007687"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 14:58:44 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 09:58:44 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TeS3A-0003m2-27;
	Fri, 30 Nov 2012 14:58:44 +0000
Date: Fri, 30 Nov 2012 14:58:39 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <ian.campbell@citrix.com>
In-Reply-To: <1346679056-8108-6-git-send-email-ian.campbell@citrix.com>
Message-ID: <alpine.DEB.2.02.1211301446580.5310@kaball.uk.xensource.com>
References: <1346678886.32462.9.camel@zakaz.uk.xensource.com>
	<1346679056-8108-6-git-send-email-ian.campbell@citrix.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 06/16] arm: parse modules from DT during
 early boot.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Mon, 3 Sep 2012, Ian Campbell wrote:
> The bootloader should populate /chosen/nr-modules with the number of
> modules and then for each module 0..nr-modules-1 it should populate
> /chosen/moduleN-{start,end} with the physical address of the module.

Considering that we can traverse the DT and enumerate all the children
of a particular node, we don't need a nr-modules property.

Also I would rather move all the modules under /chosen/modules than have
/chosen/module-N.

We could even go as far as having one single modules node, with every
module expressed as a reg range in memory.

Then you can document that for Xen the first module should be the linux
kernel and the second module should be the initrd.

chosen {
    modules {
        reg = < first_address first_size >, <second_address second_size>;
    };
};

Besides being more concise and requiring simpler parsing, I think that
it is much more... aesthetic :)


> The hypervisor allows for 2 modules (kernel and initrd). Currently we
> don't do anything with them.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
>  xen/common/device_tree.c      |   57 +++++++++++++++++++++++++++++++++++++++++
>  xen/include/xen/device_tree.h |    7 +++++
>  2 files changed, 64 insertions(+), 0 deletions(-)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 3d1f0f4..226e3f3 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -229,6 +229,61 @@ static void __init process_memory_node(const void *fdt, int node,
>      }
>  }
>  
> +static void __init process_chosen_node(const void *fdt, int node,
> +                                       const char *name,
> +                                       u32 address_cells, u32 size_cells)
> +{
> +    const struct fdt_property *prop;
> +    const u32 *cell;
> +    paddr_t size;
> +    int i, nr_modules;
> +
> +    prop = fdt_get_property(fdt, node, "nr-modules", NULL);
> +    if ( !prop )
> +    {
> +        early_info.modules.nr_mods = 0;
> +        return;
> +    }
> +
> +    cell = (const u32 *)prop->data;
> +    get_val(&cell, 1, (u64*)&nr_modules);
> +
> +    if ( nr_modules > NR_MODULES )
> +    {
> +        early_panic("too many modules %d > %d\n", nr_modules, NR_MODULES);
> +    }
> +
> +    for ( i = 0; i < nr_modules; i++ )
> +    {
> +        struct membank *mod = &early_info.modules.module[i];
> +        /* longest prop name is "start", single digit numbers of modules */
> +        char propname[strlen("moduleX-start") + 1];
> +
> +        BUILD_BUG_ON(NR_MODULES > 9);
> +
> +        snprintf(propname, sizeof(propname), "module%d-start", i+1);
> +        prop = fdt_get_property(fdt, node, propname, NULL);
> +        if ( !prop )
> +            early_panic("no start for module %d\n", i);
> +
> +        cell = (const u32 *)prop->data;
> +        device_tree_get_reg(&cell, address_cells, size_cells,
> +                            &mod->start, &size);

I don't think you should be using device_tree_get_reg to parse a non reg
property


> +        snprintf(propname, sizeof(propname), "module%d-end", i+1);
> +        prop = fdt_get_property(fdt, node, propname, NULL);
> +        if ( !prop )
> +            early_panic("no end for module %d\n", i);
> +
> +        cell = (const u32 *)prop->data;
> +        device_tree_get_reg(&cell, address_cells, size_cells,
> +                            &mod->size, &size);
> +        mod->size -= mod->start;
> +    }
> +
> +    early_info.modules.nr_mods = nr_modules;
> +}
> +
>  static int __init early_scan_node(const void *fdt,
>                                    int node, const char *name, int depth,
>                                    u32 address_cells, u32 size_cells,
> @@ -236,6 +291,8 @@ static int __init early_scan_node(const void *fdt,
>  {
>      if ( device_tree_node_matches(fdt, node, "memory") )
>          process_memory_node(fdt, node, name, address_cells, size_cells);
> +    else if ( device_tree_node_matches(fdt, node, "chosen") )
> +        process_chosen_node(fdt, node, name, address_cells, size_cells);
>  
>      return 0;
>  }
> diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
> index 4d010c0..585fcc9 100644
> --- a/xen/include/xen/device_tree.h
> +++ b/xen/include/xen/device_tree.h
> @@ -15,6 +15,7 @@
>  #define DEVICE_TREE_MAX_DEPTH 16
>  
>  #define NR_MEM_BANKS 8
> +#define NR_MODULES 2
>  
>  struct membank {
>      paddr_t start;
> @@ -26,8 +27,14 @@ struct dt_mem_info {
>      struct membank bank[NR_MEM_BANKS];
>  };
>  
> +struct dt_module_info {
> +    int nr_mods;
> +    struct membank module[NR_MODULES];
> +};
> +
>  struct dt_early_info {
>      struct dt_mem_info mem;
> +    struct dt_module_info modules;
>  };
>  
>  typedef int (*device_tree_node_func)(const void *fdt,
> -- 
> 1.7.9.1
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:12:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:12:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSFy-0001I9-NJ; Fri, 30 Nov 2012 15:11:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TeSFx-0001I4-7h
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:11:57 +0000
Received: from [85.158.139.83:22883] by server-16.bemta-5.messagelabs.com id
	B1/31-21311-CBCC8B05; Fri, 30 Nov 2012 15:11:56 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1354288310!23864154!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20625 invoked from network); 30 Nov 2012 15:11:53 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 15:11:53 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46174098"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 15:11:34 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 10:11:33 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TeSFY-0003yC-OM;
	Fri, 30 Nov 2012 15:11:32 +0000
Date: Fri, 30 Nov 2012 15:11:27 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <ian.campbell@citrix.com>
In-Reply-To: <1352823804-28482-4-git-send-email-ian.campbell@citrix.com>
Message-ID: <alpine.DEB.2.02.1211301501150.5310@kaball.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-4-git-send-email-ian.campbell@citrix.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 04/12] arm: parse modules from DT during
 early boot.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 13 Nov 2012, Ian Campbell wrote:
> The bootloader should populate /chosen/module@<N>/ for each module it
> wishes to pass to the hypervisor. The content of these nodes is
> described in docs/misc/arm/device-tree/booting.txt
> 
> The hypervisor allows for 2 modules (@1==kernel and @2==initrd).
> Currently we don't do anything with them.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
> v2: Reserve the zeroeth module for Xen itself (not used yet)
>     Use a more idiomatic DT layout
>     Document said layout
> ---
>  docs/misc/arm/device-tree/booting.txt |   27 ++++++++++++
>  xen/common/device_tree.c              |   75 +++++++++++++++++++++++++++++++++
>  xen/include/xen/device_tree.h         |   14 ++++++
>  3 files changed, 116 insertions(+), 0 deletions(-)
>  create mode 100644 docs/misc/arm/device-tree/booting.txt
> 
> diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt
> new file mode 100644
> index 0000000..2609450
> --- /dev/null
> +++ b/docs/misc/arm/device-tree/booting.txt
> @@ -0,0 +1,27 @@
> +Xen is passed the dom0 kernel and initrd via a reference in the /chosen
> +node of the device tree.
> +
> +Each node has the form /chosen/module@<N> and contains the following
> +properties:

Wouldn't it be better to move all the modules under /chosen/modules or
/chosen/multiboot?


> +- compatible
> +
> +	Must be "xen,multiboot-module"
> +
> +- start
> +
> +	Physical address of the start of this module
> +
> +- end
> +
> +	Physical address of the end of this module

start and end could be encoded as one reg


> +- bootargs (optional)
> +
> +	Command line associated with this module
> +
> +The following modules are understood
> +
> +- 1 -- the domain 0 kernel
> +- 2 -- the domain 0 ramdisk

It would be nice if we could express this via the compatible property
instead.
So the linux kernel could be compatible "linux,kernel" and the initrd
"linux,initrd", in addition to (or instead of) "xen,multiboot-module".
Given that they go from the most specific to the less specific, it would
become:

compatible = "linux,kernel", "xen,multiboot-module";

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:12:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:12:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSFy-0001I9-NJ; Fri, 30 Nov 2012 15:11:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TeSFx-0001I4-7h
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:11:57 +0000
Received: from [85.158.139.83:22883] by server-16.bemta-5.messagelabs.com id
	B1/31-21311-CBCC8B05; Fri, 30 Nov 2012 15:11:56 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1354288310!23864154!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20625 invoked from network); 30 Nov 2012 15:11:53 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-7.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 15:11:53 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46174098"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 15:11:34 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 10:11:33 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TeSFY-0003yC-OM;
	Fri, 30 Nov 2012 15:11:32 +0000
Date: Fri, 30 Nov 2012 15:11:27 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <ian.campbell@citrix.com>
In-Reply-To: <1352823804-28482-4-git-send-email-ian.campbell@citrix.com>
Message-ID: <alpine.DEB.2.02.1211301501150.5310@kaball.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-4-git-send-email-ian.campbell@citrix.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 04/12] arm: parse modules from DT during
 early boot.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, 13 Nov 2012, Ian Campbell wrote:
> The bootloader should populate /chosen/module@<N>/ for each module it
> wishes to pass to the hypervisor. The content of these nodes is
> described in docs/misc/arm/device-tree/booting.txt
> 
> The hypervisor allows for 2 modules (@1==kernel and @2==initrd).
> Currently we don't do anything with them.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
> v2: Reserve the zeroeth module for Xen itself (not used yet)
>     Use a more idiomatic DT layout
>     Document said layout
> ---
>  docs/misc/arm/device-tree/booting.txt |   27 ++++++++++++
>  xen/common/device_tree.c              |   75 +++++++++++++++++++++++++++++++++
>  xen/include/xen/device_tree.h         |   14 ++++++
>  3 files changed, 116 insertions(+), 0 deletions(-)
>  create mode 100644 docs/misc/arm/device-tree/booting.txt
> 
> diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt
> new file mode 100644
> index 0000000..2609450
> --- /dev/null
> +++ b/docs/misc/arm/device-tree/booting.txt
> @@ -0,0 +1,27 @@
> +Xen is passed the dom0 kernel and initrd via a reference in the /chosen
> +node of the device tree.
> +
> +Each node has the form /chosen/module@<N> and contains the following
> +properties:

Wouldn't it be better to move all the modules under /chosen/modules or
/chosen/multiboot?


> +- compatible
> +
> +	Must be "xen,multiboot-module"
> +
> +- start
> +
> +	Physical address of the start of this module
> +
> +- end
> +
> +	Physical address of the end of this module

start and end could be encoded as one reg


> +- bootargs (optional)
> +
> +	Command line associated with this module
> +
> +The following modules are understood
> +
> +- 1 -- the domain 0 kernel
> +- 2 -- the domain 0 ramdisk

It would be nice if we could express this via the compatible property
instead.
So the linux kernel could be compatible "linux,kernel" and the initrd
"linux,initrd", in addition to (or instead of) "xen,multiboot-module".
Given that they go from the most specific to the less specific, it would
become:

compatible = "linux,kernel", "xen,multiboot-module";

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:15:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:15:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSIt-0001dI-9m; Fri, 30 Nov 2012 15:14:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TeSIr-0001dC-HF
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:14:57 +0000
Received: from [85.158.137.99:30280] by server-1.bemta-3.messagelabs.com id
	56/11-12169-07DC8B05; Fri, 30 Nov 2012 15:14:56 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1354288494!12012144!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4216 invoked from network); 30 Nov 2012 15:14:56 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 15:14:56 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46174524"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 15:14:53 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 10:14:53 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TeSIm-00041C-M0;
	Fri, 30 Nov 2012 15:14:52 +0000
Date: Fri, 30 Nov 2012 15:14:47 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1354209234.6269.48.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211301513160.5310@kaball.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-4-git-send-email-ian.campbell@citrix.com>
	<20121129170501.GF80627@ocelot.phlegethon.org>
	<1354209234.6269.48.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 04/12] arm: parse modules from DT during
 early boot.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 29 Nov 2012, Ian Campbell wrote:
> On Thu, 2012-11-29 at 17:05 +0000, Tim Deegan wrote:
> > > +            cell = (const u32 *)prop->data;
> > > +            device_tree_get_reg(&cell, address_cells, size_cells,
> > > +                                &mod->start, &size);
> > 
> > This get_reg returns a start + size -- can/should we encode the module
> > as one of these rather than encdong start + end separately and
> > discarding the 'size' fields?
> 
> Interesting thought, I'm not enough of a DTB guru to know what the right
> way to express this is (CCing Stefano :-))
> 
> This is trying to parse
> / {
> 	chosen { 
> 		module@1 {
> 			start = 0x80000000;
> 			end = 0x2000;
> 		}
> 	}
> which is roughtly equivalent to how Linux bootloaders pass in initrds
> (although the name etc differ)
> 
> I suspect using device_tree_get_reg as things stands is just plain
> wrong, since the above things are not actually regs.
> 
> However you might be right that this should be expressed as
> 
> / {
> 	chosen { 
> 		module@1 {
> 			address = <0x80000000 0x2000>;
> 		}
> 	}
> 
> and then I think using device_tree_get_reg would be correct.
> 
> Stefano -- does that make sense? is "address = < ... >" allowed or does
> the thing have to be called reg?

I don't think we should use device_tree_get_reg to parse something that
is not a reg. If we want a reg then we should just call the property
"reg" (I am in favor of that).

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:15:13 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:15:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSIt-0001dI-9m; Fri, 30 Nov 2012 15:14:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Stefano.Stabellini@eu.citrix.com>)
	id 1TeSIr-0001dC-HF
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:14:57 +0000
Received: from [85.158.137.99:30280] by server-1.bemta-3.messagelabs.com id
	56/11-12169-07DC8B05; Fri, 30 Nov 2012 15:14:56 +0000
X-Env-Sender: Stefano.Stabellini@eu.citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1354288494!12012144!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4216 invoked from network); 30 Nov 2012 15:14:56 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-8.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 15:14:56 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46174524"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 15:14:53 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 10:14:53 -0500
Received: from kaball.uk.xensource.com ([10.80.2.59])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<stefano.stabellini@eu.citrix.com>)	id 1TeSIm-00041C-M0;
	Fri, 30 Nov 2012 15:14:52 +0000
Date: Fri, 30 Nov 2012 15:14:47 +0000
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
X-X-Sender: sstabellini@kaball.uk.xensource.com
To: Ian Campbell <Ian.Campbell@citrix.com>
In-Reply-To: <1354209234.6269.48.camel@zakaz.uk.xensource.com>
Message-ID: <alpine.DEB.2.02.1211301513160.5310@kaball.uk.xensource.com>
References: <1352823779.7491.94.camel@zakaz.uk.xensource.com>
	<1352823804-28482-4-git-send-email-ian.campbell@citrix.com>
	<20121129170501.GF80627@ocelot.phlegethon.org>
	<1354209234.6269.48.camel@zakaz.uk.xensource.com>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"Tim \(Xen.org\)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH 04/12] arm: parse modules from DT during
 early boot.
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, 29 Nov 2012, Ian Campbell wrote:
> On Thu, 2012-11-29 at 17:05 +0000, Tim Deegan wrote:
> > > +            cell = (const u32 *)prop->data;
> > > +            device_tree_get_reg(&cell, address_cells, size_cells,
> > > +                                &mod->start, &size);
> > 
> > This get_reg returns a start + size -- can/should we encode the module
> > as one of these rather than encdong start + end separately and
> > discarding the 'size' fields?
> 
> Interesting thought, I'm not enough of a DTB guru to know what the right
> way to express this is (CCing Stefano :-))
> 
> This is trying to parse
> / {
> 	chosen { 
> 		module@1 {
> 			start = 0x80000000;
> 			end = 0x2000;
> 		}
> 	}
> which is roughtly equivalent to how Linux bootloaders pass in initrds
> (although the name etc differ)
> 
> I suspect using device_tree_get_reg as things stands is just plain
> wrong, since the above things are not actually regs.
> 
> However you might be right that this should be expressed as
> 
> / {
> 	chosen { 
> 		module@1 {
> 			address = <0x80000000 0x2000>;
> 		}
> 	}
> 
> and then I think using device_tree_get_reg would be correct.
> 
> Stefano -- does that make sense? is "address = < ... >" allowed or does
> the thing have to be called reg?

I don't think we should use device_tree_get_reg to parse something that
is not a reg. If we want a reg then we should just call the property
"reg" (I am in favor of that).

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSeq-0002Pu-Ap; Fri, 30 Nov 2012 15:37:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSen-0002Mx-54
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:37 +0000
Received: from [85.158.139.211:63870] by server-8.bemta-5.messagelabs.com id
	46/3A-06050-0C2D8B05; Fri, 30 Nov 2012 15:37:36 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-206.messagelabs.com!1354289854!18505841!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15570 invoked from network); 30 Nov 2012 15:37:35 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-14.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:35 -0000
X-TM-IMSS-Message-ID: <339220e700027abb@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 339220e700027abb ;
	Fri, 30 Nov 2012 10:36:27 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd9017785; 
	Fri, 30 Nov 2012 10:37:33 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:03 -0500
Message-Id: <1354289830-24642-17-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 16/23] xen: Add XSM hook for XENMEM_exchange
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
---
 tools/flask/policy/policy/flask/access_vectors |  1 +
 tools/flask/policy/policy/modules/xen/xen.if   |  2 ++
 xen/common/memory.c                            | 12 +++++++++++-
 xen/include/xsm/dummy.h                        |  7 +++++++
 xen/include/xsm/xsm.h                          |  6 ++++++
 xen/xsm/dummy.c                                |  1 +
 xen/xsm/flask/hooks.c                          |  6 ++++++
 xen/xsm/flask/include/av_perm_to_string.h      |  1 +
 xen/xsm/flask/include/av_permissions.h         |  1 +
 9 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index 8324725..caf65d2 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -142,6 +142,7 @@ class mmu
     memorymap
     remote_remap
 	mmuext_op
+	exchange
 }
 
 class shadow
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index fda5cb5..d9d5344 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -30,6 +30,7 @@ define(`declare_domain', `
 #   containing at most one domain. This is not enforced by policy.
 define(`declare_singleton_domain', `
 	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
+	define(`$1_self', `$1')
 	type $1_channel, event_type;
 	type_transition $1 domain_type:event $1_channel;
 	declare_domain_common($1, $1)
@@ -161,6 +162,7 @@ define(`make_device_model', `
 # use_device(domain, device)
 #   Allow a device to be used by a domain
 define(`use_device', `
+    allow $1 $1_self:mmu exchange;
     allow $1 $2:resource use;
     allow $1 domio_t:mmu { map_read map_write };
 ')
diff --git a/xen/common/memory.c b/xen/common/memory.c
index dd36b83..7d3c326 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -329,9 +329,19 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
         out_chunk_order = exch.in.extent_order - exch.out.extent_order;
     }
 
-    rc = rcu_lock_target_domain_by_id(exch.in.domid, &d);
+    d = rcu_lock_domain_by_any_id(exch.in.domid);
+    if ( d == NULL )
+    {
+        rc = -ESRCH;
+        goto fail_early;
+    }
+
+    rc = xsm_memory_exchange(d);
     if ( rc )
+    {
+        rcu_unlock_domain(d);
         goto fail_early;
+    }
 
     memflags |= MEMF_bits(domain_clamp_alloc_bitsize(
         d,
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 6648739..9894d8d 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -235,6 +235,13 @@ static XSM_INLINE int xsm_grant_query_size(struct domain *d1, struct domain *d2)
     return 0;
 }
 
+static XSM_INLINE int xsm_memory_exchange(struct domain *d)
+{
+    if ( d != current->domain && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
                                                             struct domain *d2)
 {
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index d41eb54..a8c1d87 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -96,6 +96,7 @@ struct xsm_operations {
 
     int (*get_pod_target) (struct domain *d);
     int (*set_pod_target) (struct domain *d);
+    int (*memory_exchange) (struct domain *d);
     int (*memory_adjust_reservation) (struct domain *d1, struct domain *d2);
     int (*memory_stat_reservation) (struct domain *d1, struct domain *d2);
     int (*memory_pin_page) (struct domain *d1, struct domain *d2, struct page_info *page);
@@ -453,6 +454,11 @@ static inline int xsm_set_pod_target (struct domain *d)
     return xsm_ops->set_pod_target(d);
 }
 
+static inline int xsm_memory_exchange (struct domain *d)
+{
+    return xsm_ops->memory_exchange(d);
+}
+
 static inline int xsm_memory_adjust_reservation (struct domain *d1, struct
                                                                     domain *d2)
 {
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 200cbc8..71299d5 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -84,6 +84,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, get_pod_target);
     set_to_dummy_if_null(ops, set_pod_target);
 
+    set_to_dummy_if_null(ops, memory_exchange);
     set_to_dummy_if_null(ops, memory_adjust_reservation);
     set_to_dummy_if_null(ops, memory_stat_reservation);
     set_to_dummy_if_null(ops, memory_pin_page);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index b2f00d8..167f8e6 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -396,6 +396,11 @@ static int flask_set_pod_target(struct domain *d)
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETPODTARGET);
 }
 
+static int flask_memory_exchange(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_MMU, MMU__EXCHANGE);
+}
+
 static int flask_memory_adjust_reservation(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__ADJUST);
@@ -1685,6 +1690,7 @@ static struct xsm_operations flask_ops = {
 
     .get_pod_target = flask_get_pod_target,
     .set_pod_target = flask_set_pod_target,
+    .memory_exchange = flask_memory_exchange,
     .memory_adjust_reservation = flask_memory_adjust_reservation,
     .memory_stat_reservation = flask_memory_stat_reservation,
     .memory_pin_page = flask_memory_pin_page,
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 8f65b96..79d5939 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -112,6 +112,7 @@
    S_(SECCLASS_MMU, MMU__MEMORYMAP, "memorymap")
    S_(SECCLASS_MMU, MMU__REMOTE_REMAP, "remote_remap")
    S_(SECCLASS_MMU, MMU__MMUEXT_OP, "mmuext_op")
+   S_(SECCLASS_MMU, MMU__EXCHANGE, "exchange")
    S_(SECCLASS_SHADOW, SHADOW__DISABLE, "disable")
    S_(SECCLASS_SHADOW, SHADOW__ENABLE, "enable")
    S_(SECCLASS_SHADOW, SHADOW__LOGDIRTY, "logdirty")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index 18454fd..d982328 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -118,6 +118,7 @@
 #define MMU__MEMORYMAP                            0x00000800UL
 #define MMU__REMOTE_REMAP                         0x00001000UL
 #define MMU__MMUEXT_OP                            0x00002000UL
+#define MMU__EXCHANGE                             0x00004000UL
 
 #define SHADOW__DISABLE                           0x00000001UL
 #define SHADOW__ENABLE                            0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSep-0002Ox-Cl; Fri, 30 Nov 2012 15:37:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSem-0002Mb-BA
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:36 +0000
Received: from [85.158.139.211:63815] by server-14.bemta-5.messagelabs.com id
	C9/0A-21768-FB2D8B05; Fri, 30 Nov 2012 15:37:35 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354289851!18119928!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20560 invoked from network); 30 Nov 2012 15:37:32 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-7.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:32 -0000
X-TM-IMSS-Message-ID: <339213ec00027aaf@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 339213ec00027aaf ;
	Fri, 30 Nov 2012 10:36:24 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbScw017785; 
	Fri, 30 Nov 2012 10:37:30 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:52 -0500
Message-Id: <1354289830-24642-6-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 05/23] xsm: Use the dummy XSM module if XSM is
	disabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch moves the implementation of the dummy XSM module to a header
file that provides inline functions when XSM_ENABLE is not defined. This
reduces duplication between the dummy module and callers when the
implementation of the dummy return is not just "return 0", and also
provides better compile-time checking for completeness of the XSM
implementations in the dummy module.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
---
 xen/common/domctl.c     |   2 -
 xen/include/xsm/dummy.h | 628 ++++++++++++++++++++++++++++++++++++++++++++++++
 xen/include/xsm/xsm.h   | 297 +++++++++++------------
 xen/xsm/dummy.c         | 622 +----------------------------------------------
 xen/xsm/flask/hooks.c   |   2 +-
 xen/xsm/xsm_core.c      |   2 +-
 6 files changed, 781 insertions(+), 772 deletions(-)
 create mode 100644 xen/include/xsm/dummy.h

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index a7a6b9f..2f49eb2 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -267,10 +267,8 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             return -EPERM;
         break;
     }
-#ifdef XSM_ENABLE
     case XEN_DOMCTL_getdomaininfo:
         break;
-#endif
     default:
         if ( !IS_PRIV(current->domain) )
             return -EPERM;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
new file mode 100644
index 0000000..4384552
--- /dev/null
+++ b/xen/include/xsm/dummy.h
@@ -0,0 +1,628 @@
+/*
+ *  Default XSM hooks - IS_PRIV and IS_PRIV_FOR checks
+ *
+ *  Author: Daniel De Graaf <dgdegra@tyhco.nsa.gov>
+ *
+ *  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.
+ */
+
+#include <xen/sched.h>
+#include <xsm/xsm.h>
+
+static XSM_INLINE void xsm_security_domaininfo(struct domain *d,
+                                    struct xen_domctl_getdomaininfo *info)
+{
+    return;
+}
+
+static XSM_INLINE int xsm_setvcpucontext(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_pausedomain(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_unpausedomain(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_resumedomain(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_domain_create(struct domain *d, u32 ssidref)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_max_vcpus(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_destroydomain(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_vcpuaffinity(int cmd, struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_scheduler(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
+static XSM_INLINE int xsm_getvcpucontext(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_getvcpuinfo(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_domain_settime(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_domctl(struct domain *d, int cmd)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_set_virq_handler(struct domain *d, uint32_t virq)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_tbufcontrol(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_readconsole(uint32_t clear)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_sched_id(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_setdomainmaxmem(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_setdomainhandle(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_setdebugging(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_perfcontrol(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_debug_keys(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_getcpuinfo(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_get_pmstat(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_setpminfo(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_pm_op(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_do_mca(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_availheap(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE void xsm_free_security_domain(struct domain *d)
+{
+    return;
+}
+
+static XSM_INLINE int xsm_grant_mapref(struct domain *d1, struct domain *d2,
+                                                                uint32_t flags)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_grant_unmapref(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_grant_setup(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_grant_transfer(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_grant_copy(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_grant_query_size(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
+                                                            struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_memory_stat_reservation(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_console_io(struct domain *d, int cmd)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_profile(struct domain *d, int op)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_kexec(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_schedop_shutdown(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
+                                          struct page_info *page)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_evtchn_unbound(struct domain *d, struct evtchn *chn,
+                                         domid_t id2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_evtchn_interdomain(struct domain *d1, struct evtchn
+                                *chan1, struct domain *d2, struct evtchn *chan2)
+{
+    return 0;
+}
+
+static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
+{
+    return;
+}
+
+static XSM_INLINE int xsm_evtchn_send(struct domain *d, struct evtchn *chn)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_evtchn_status(struct domain *d, struct evtchn *chn)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_evtchn_reset(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_alloc_security_evtchn(struct evtchn *chn)
+{
+    return 0;
+}
+
+static XSM_INLINE void xsm_free_security_evtchn(struct evtchn *chn)
+{
+    return;
+}
+
+static XSM_INLINE char *xsm_show_security_evtchn(struct domain *d, const struct evtchn *chn)
+{
+    return NULL;
+}
+
+static XSM_INLINE int xsm_get_pod_target(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_set_pod_target(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_get_device_group(uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_test_assign_device(uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_resource_plug_core(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_resource_unplug_core(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_resource_plug_pci(uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_resource_unplug_pci(uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_resource_setup_pci(uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_resource_setup_gsi(int gsi)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_resource_setup_misc(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_page_offline(uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_lockprof(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_cpupool_op(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_sched_op(void)
+{
+    return 0;
+}
+
+static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
+{
+    return -ENOSYS;
+}
+
+static XSM_INLINE char *xsm_show_irq_sid(int irq)
+{
+    return NULL;
+}
+
+static XSM_INLINE int xsm_map_domain_pirq(struct domain *d, int irq, void *data)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_unmap_domain_pirq(struct domain *d, int irq)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_irq_permission(struct domain *d, int pirq, uint8_t allow)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_iomem_permission(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_iomem_mapping(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_pci_config_permission(struct domain *d, uint32_t machine_bdf,
+                                        uint16_t start, uint16_t end,
+                                        uint8_t access)
+{
+    return 0;
+}
+
+#ifdef CONFIG_X86
+static XSM_INLINE int xsm_shadow_control(struct domain *d, uint32_t op)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_getpageframeinfo(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_getmemlist(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_hypercall_init(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_hvmcontext(struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_address_size(struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_machine_address_size(struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_hvm_set_pci_intx_level(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_hvm_set_isa_irq_level(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_hvm_set_pci_link_route(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_mem_event(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_mem_sharing(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_xen_settime(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_memtype(uint32_t access)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_microcode(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_physinfo(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_firmware_info(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_efi_call(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_acpi_sleep(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_change_freq(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_getidletime(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_machine_memory_map(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_domain_memory_map(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_mmu_normal_update(struct domain *d, struct domain *t,
+                                            struct domain *f, intpte_t fpte)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_mmu_machphys_update(struct domain *d, struct domain *f,
+                                              unsigned long mfn)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f, 
+                                                            l1_pgentry_t pte)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_sendtrigger(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_unbind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_pin_mem_cacheattr(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_ioport_mapping(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+{
+    return 0;
+}
+
+#endif
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 2560229..662f233 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -21,12 +21,6 @@
 typedef void xsm_op_t;
 DEFINE_XEN_GUEST_HANDLE(xsm_op_t);
 
-#ifdef XSM_ENABLE
-    #define xsm_call(fn) xsm_ops->fn
-#else
-    #define xsm_call(fn) 0
-#endif
-
 /* policy magic number (defined by XSM_MAGIC) */
 typedef u32 xsm_magic_t;
 #ifndef XSM_MAGIC
@@ -141,7 +135,7 @@ struct xsm_operations {
     int (*cpupool_op)(void);
     int (*sched_op)(void);
 
-    long (*__do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
+    long (*do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
 
 #ifdef CONFIG_X86
     int (*shadow_control) (struct domain *d, uint32_t op);
@@ -187,645 +181,646 @@ struct xsm_operations {
 #endif
 };
 
-#endif
-
 extern struct xsm_operations *xsm_ops;
 
+#ifndef XSM_NO_WRAPPERS
+
 static inline void xsm_security_domaininfo (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info)
 {
-    (void)xsm_call(security_domaininfo(d, info));
+    xsm_ops->security_domaininfo(d, info);
 }
 
 static inline int xsm_setvcpucontext(struct domain *d)
 {
-    return xsm_call(setvcpucontext(d));
+    return xsm_ops->setvcpucontext(d);
 }
 
 static inline int xsm_pausedomain (struct domain *d)
 {
-    return xsm_call(pausedomain(d));
+    return xsm_ops->pausedomain(d);
 }
 
 static inline int xsm_unpausedomain (struct domain *d)
 {
-    return xsm_call(unpausedomain(d));
+    return xsm_ops->unpausedomain(d);
 }
 
 static inline int xsm_resumedomain (struct domain *d)
 {
-    return xsm_call(resumedomain(d));
+    return xsm_ops->resumedomain(d);
 }
 
 static inline int xsm_domain_create (struct domain *d, u32 ssidref)
 {
-    return xsm_call(domain_create(d, ssidref));
+    return xsm_ops->domain_create(d, ssidref);
 }
 
 static inline int xsm_max_vcpus(struct domain *d)
 {
-    return xsm_call(max_vcpus(d));
+    return xsm_ops->max_vcpus(d);
 }
 
 static inline int xsm_destroydomain (struct domain *d)
 {
-    return xsm_call(destroydomain(d));
+    return xsm_ops->destroydomain(d);
 }
 
 static inline int xsm_vcpuaffinity (int cmd, struct domain *d)
 {
-    return xsm_call(vcpuaffinity(cmd, d));
+    return xsm_ops->vcpuaffinity(cmd, d);
 }
 
 static inline int xsm_scheduler (struct domain *d)
 {
-    return xsm_call(scheduler(d));
+    return xsm_ops->scheduler(d);
 }
 
 static inline int xsm_getdomaininfo (struct domain *d)
 {
-    return xsm_call(getdomaininfo(d));
+    return xsm_ops->getdomaininfo(d);
 }
 
 static inline int xsm_getvcpucontext (struct domain *d)
 {
-    return xsm_call(getvcpucontext(d));
+    return xsm_ops->getvcpucontext(d);
 }
 
 static inline int xsm_getvcpuinfo (struct domain *d)
 {
-    return xsm_call(getvcpuinfo(d));
+    return xsm_ops->getvcpuinfo(d);
 }
 
 static inline int xsm_domain_settime (struct domain *d)
 {
-    return xsm_call(domain_settime(d));
+    return xsm_ops->domain_settime(d);
 }
 
 static inline int xsm_set_target (struct domain *d, struct domain *e)
 {
-    return xsm_call(set_target(d, e));
+    return xsm_ops->set_target(d, e);
 }
 
 static inline int xsm_domctl (struct domain *d, int cmd)
 {
-    return xsm_call(domctl(d, cmd));
+    return xsm_ops->domctl(d, cmd);
 }
 
 static inline int xsm_set_virq_handler (struct domain *d, uint32_t virq)
 {
-    return xsm_call(set_virq_handler(d, virq));
+    return xsm_ops->set_virq_handler(d, virq);
 }
 
 static inline int xsm_tbufcontrol (void)
 {
-    return xsm_call(tbufcontrol());
+    return xsm_ops->tbufcontrol();
 }
 
 static inline int xsm_readconsole (uint32_t clear)
 {
-    return xsm_call(readconsole(clear));
+    return xsm_ops->readconsole(clear);
 }
 
 static inline int xsm_sched_id (void)
 {
-    return xsm_call(sched_id());
+    return xsm_ops->sched_id();
 }
 
 static inline int xsm_setdomainmaxmem (struct domain *d)
 {
-    return xsm_call(setdomainmaxmem(d));
+    return xsm_ops->setdomainmaxmem(d);
 }
 
 static inline int xsm_setdomainhandle (struct domain *d)
 {
-    return xsm_call(setdomainhandle(d));
+    return xsm_ops->setdomainhandle(d);
 }
 
 static inline int xsm_setdebugging (struct domain *d)
 {
-    return xsm_call(setdebugging(d));
+    return xsm_ops->setdebugging(d);
 }
 
 static inline int xsm_perfcontrol (void)
 {
-    return xsm_call(perfcontrol());
+    return xsm_ops->perfcontrol();
 }
 
 static inline int xsm_debug_keys (void)
 {
-    return xsm_call(debug_keys());
+    return xsm_ops->debug_keys();
 }
 
 static inline int xsm_availheap (void)
 {
-    return xsm_call(availheap());
+    return xsm_ops->availheap();
 }
 
 static inline int xsm_getcpuinfo (void)
 {
-    return xsm_call(getcpuinfo());
+    return xsm_ops->getcpuinfo();
 }
 
 static inline int xsm_get_pmstat(void)
 {
-    return xsm_call(get_pmstat());
+    return xsm_ops->get_pmstat();
 }
 
 static inline int xsm_setpminfo(void)
 {
-	return xsm_call(setpminfo());
+    return xsm_ops->setpminfo();
 }
 
 static inline int xsm_pm_op(void)
 {
-    return xsm_call(pm_op());
+    return xsm_ops->pm_op();
 }
 
 static inline int xsm_do_mca(void)
 {
-    return xsm_call(do_mca());
+    return xsm_ops->do_mca();
 }
 
 static inline int xsm_evtchn_unbound (struct domain *d1, struct evtchn *chn,
                                                                     domid_t id2)
 {
-    return xsm_call(evtchn_unbound(d1, chn, id2));
+    return xsm_ops->evtchn_unbound(d1, chn, id2);
 }
 
 static inline int xsm_evtchn_interdomain (struct domain *d1, 
                 struct evtchn *chan1, struct domain *d2, struct evtchn *chan2)
 {
-    return xsm_call(evtchn_interdomain(d1, chan1, d2, chan2));
+    return xsm_ops->evtchn_interdomain(d1, chan1, d2, chan2);
 }
 
 static inline void xsm_evtchn_close_post (struct evtchn *chn)
 {
-    (void)xsm_call(evtchn_close_post(chn));
+    xsm_ops->evtchn_close_post(chn);
 }
 
 static inline int xsm_evtchn_send (struct domain *d, struct evtchn *chn)
 {
-    return xsm_call(evtchn_send(d, chn));
+    return xsm_ops->evtchn_send(d, chn);
 }
 
 static inline int xsm_evtchn_status (struct domain *d, struct evtchn *chn)
 {
-    return xsm_call(evtchn_status(d, chn));
+    return xsm_ops->evtchn_status(d, chn);
 }
 
 static inline int xsm_evtchn_reset (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(evtchn_reset(d1, d2));
+    return xsm_ops->evtchn_reset(d1, d2);
 }
 
 static inline int xsm_grant_mapref (struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
-    return xsm_call(grant_mapref(d1, d2, flags));
+    return xsm_ops->grant_mapref(d1, d2, flags);
 }
 
 static inline int xsm_grant_unmapref (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_unmapref(d1, d2));
+    return xsm_ops->grant_unmapref(d1, d2);
 }
 
 static inline int xsm_grant_setup (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_setup(d1, d2));
+    return xsm_ops->grant_setup(d1, d2);
 }
 
 static inline int xsm_grant_transfer (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_transfer(d1, d2));
+    return xsm_ops->grant_transfer(d1, d2);
 }
 
 static inline int xsm_grant_copy (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_copy(d1, d2));
+    return xsm_ops->grant_copy(d1, d2);
 }
 
 static inline int xsm_grant_query_size (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_query_size(d1, d2));
+    return xsm_ops->grant_query_size(d1, d2);
 }
 
 static inline int xsm_alloc_security_domain (struct domain *d)
 {
-    return xsm_call(alloc_security_domain(d));
+    return xsm_ops->alloc_security_domain(d);
 }
 
 static inline void xsm_free_security_domain (struct domain *d)
 {
-    (void)xsm_call(free_security_domain(d));
+    xsm_ops->free_security_domain(d);
 }
 
 static inline int xsm_alloc_security_evtchn (struct evtchn *chn)
 {
-    return xsm_call(alloc_security_evtchn(chn));
+    return xsm_ops->alloc_security_evtchn(chn);
 }
 
 static inline void xsm_free_security_evtchn (struct evtchn *chn)
 {
-    (void)xsm_call(free_security_evtchn(chn));
+    (void)xsm_ops->free_security_evtchn(chn);
 }
 
 static inline char *xsm_show_security_evtchn (struct domain *d, const struct evtchn *chn)
 {
-    return xsm_call(show_security_evtchn(d, chn));
+    return xsm_ops->show_security_evtchn(d, chn);
 }
 
 static inline int xsm_get_pod_target (struct domain *d)
 {
-    return xsm_call(get_pod_target(d));
+    return xsm_ops->get_pod_target(d);
 }
 
 static inline int xsm_set_pod_target (struct domain *d)
 {
-    return xsm_call(set_pod_target(d));
+    return xsm_ops->set_pod_target(d);
 }
 
 static inline int xsm_memory_adjust_reservation (struct domain *d1, struct
                                                                     domain *d2)
 {
-    return xsm_call(memory_adjust_reservation(d1, d2));
+    return xsm_ops->memory_adjust_reservation(d1, d2);
 }
 
 static inline int xsm_memory_stat_reservation (struct domain *d1,
                                                             struct domain *d2)
 {
-    return xsm_call(memory_stat_reservation(d1, d2));
+    return xsm_ops->memory_stat_reservation(d1, d2);
 }
 
 static inline int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
                                       struct page_info *page)
 {
-    return xsm_call(memory_pin_page(d1, d2, page));
+    return xsm_ops->memory_pin_page(d1, d2, page);
 }
 
 static inline int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
-    return xsm_call(remove_from_physmap(d1, d2));
+    return xsm_ops->remove_from_physmap(d1, d2);
 }
 
 static inline int xsm_console_io (struct domain *d, int cmd)
 {
-    return xsm_call(console_io(d, cmd));
+    return xsm_ops->console_io(d, cmd);
 }
 
 static inline int xsm_profile (struct domain *d, int op)
 {
-    return xsm_call(profile(d, op));
+    return xsm_ops->profile(d, op);
 }
 
 static inline int xsm_kexec (void)
 {
-    return xsm_call(kexec());
+    return xsm_ops->kexec();
 }
 
 static inline int xsm_schedop_shutdown (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(schedop_shutdown(d1, d2));
+    return xsm_ops->schedop_shutdown(d1, d2);
 }
 
 static inline char *xsm_show_irq_sid (int irq)
 {
-    return xsm_call(show_irq_sid(irq));
+    return xsm_ops->show_irq_sid(irq);
 }
 
 static inline int xsm_map_domain_pirq (struct domain *d, int irq, void *data)
 {
-    return xsm_call(map_domain_pirq(d, irq, data));
+    return xsm_ops->map_domain_pirq(d, irq, data);
 }
 
 static inline int xsm_unmap_domain_pirq (struct domain *d, int irq)
 {
-    return xsm_call(unmap_domain_pirq(d, irq));
+    return xsm_ops->unmap_domain_pirq(d, irq);
 }
 
 static inline int xsm_irq_permission (struct domain *d, int pirq, uint8_t allow)
 {
-    return xsm_call(irq_permission(d, pirq, allow));
+    return xsm_ops->irq_permission(d, pirq, allow);
 }
 
 static inline int xsm_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return xsm_call(iomem_permission(d, s, e, allow));
+    return xsm_ops->iomem_permission(d, s, e, allow);
 }
 
 static inline int xsm_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return xsm_call(iomem_mapping(d, s, e, allow));
+    return xsm_ops->iomem_mapping(d, s, e, allow);
 }
 
 static inline int xsm_pci_config_permission (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
-    return xsm_call(pci_config_permission(d, machine_bdf, start, end, access));
+    return xsm_ops->pci_config_permission(d, machine_bdf, start, end, access);
 }
 
 static inline int xsm_get_device_group(uint32_t machine_bdf)
 {
-    return xsm_call(get_device_group(machine_bdf));
+    return xsm_ops->get_device_group(machine_bdf);
 }
 
 static inline int xsm_test_assign_device(uint32_t machine_bdf)
 {
-    return xsm_call(test_assign_device(machine_bdf));
+    return xsm_ops->test_assign_device(machine_bdf);
 }
 
 static inline int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
 {
-    return xsm_call(assign_device(d, machine_bdf));
+    return xsm_ops->assign_device(d, machine_bdf);
 }
 
 static inline int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
-    return xsm_call(deassign_device(d, machine_bdf));
+    return xsm_ops->deassign_device(d, machine_bdf);
 }
 
 static inline int xsm_resource_plug_pci (uint32_t machine_bdf)
 {
-    return xsm_call(resource_plug_pci(machine_bdf));
+    return xsm_ops->resource_plug_pci(machine_bdf);
 }
 
 static inline int xsm_resource_unplug_pci (uint32_t machine_bdf)
 {
-    return xsm_call(resource_unplug_pci(machine_bdf));
+    return xsm_ops->resource_unplug_pci(machine_bdf);
 }
 
 static inline int xsm_resource_plug_core (void)
 {
-    return xsm_call(resource_plug_core());
+    return xsm_ops->resource_plug_core();
 }
 
 static inline int xsm_resource_unplug_core (void)
 {
-    return xsm_call(resource_unplug_core());
+    return xsm_ops->resource_unplug_core();
 }
 
 static inline int xsm_resource_setup_pci (uint32_t machine_bdf)
 {
-    return xsm_call(resource_setup_pci(machine_bdf));
+    return xsm_ops->resource_setup_pci(machine_bdf);
 }
 
 static inline int xsm_resource_setup_gsi (int gsi)
 {
-    return xsm_call(resource_setup_gsi(gsi));
+    return xsm_ops->resource_setup_gsi(gsi);
 }
 
 static inline int xsm_resource_setup_misc (void)
 {
-    return xsm_call(resource_setup_misc());
+    return xsm_ops->resource_setup_misc();
 }
 
 static inline int xsm_page_offline(uint32_t cmd)
 {
-    return xsm_call(page_offline(cmd));
+    return xsm_ops->page_offline(cmd);
 }
 
 static inline int xsm_lockprof(void)
 {
-    return xsm_call(lockprof());
+    return xsm_ops->lockprof();
 }
 
 static inline int xsm_cpupool_op(void)
 {
-    return xsm_call(cpupool_op());
+    return xsm_ops->cpupool_op();
 }
 
 static inline int xsm_sched_op(void)
 {
-    return xsm_call(sched_op());
+    return xsm_ops->sched_op();
 }
 
-static inline long __do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
+static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
-#ifdef XSM_ENABLE
-    return xsm_ops->__do_xsm_op(op);
-#else
-    return -ENOSYS;
-#endif
+    return xsm_ops->do_xsm_op(op);
 }
 
-#ifdef XSM_ENABLE
-extern int xsm_init(unsigned long *module_map, const multiboot_info_t *mbi,
-                    void *(*bootstrap_map)(const module_t *));
-extern int xsm_policy_init(unsigned long *module_map,
-                           const multiboot_info_t *mbi,
-                           void *(*bootstrap_map)(const module_t *));
-extern int register_xsm(struct xsm_operations *ops);
-extern int unregister_xsm(struct xsm_operations *ops);
-#else
-static inline int xsm_init (unsigned long *module_map,
-                            const multiboot_info_t *mbi,
-                            void *(*bootstrap_map)(const module_t *))
-{
-    return 0;
-}
-#endif
-
 #ifdef CONFIG_X86
 static inline int xsm_shadow_control (struct domain *d, uint32_t op)
 {
-    return xsm_call(shadow_control(d, op));
+    return xsm_ops->shadow_control(d, op);
 }
 
 static inline int xsm_getpageframeinfo (struct domain *d)
 {
-    return xsm_call(getpageframeinfo(d));
+    return xsm_ops->getpageframeinfo(d);
 }
 
 static inline int xsm_getmemlist (struct domain *d)
 {
-    return xsm_call(getmemlist(d));
+    return xsm_ops->getmemlist(d);
 }
 
 static inline int xsm_hypercall_init (struct domain *d)
 {
-    return xsm_call(hypercall_init(d));
+    return xsm_ops->hypercall_init(d);
 }
 
 static inline int xsm_hvmcontext (struct domain *d, uint32_t cmd)
 {
-    return xsm_call(hvmcontext(d, cmd));
+    return xsm_ops->hvmcontext(d, cmd);
 }
 
 static inline int xsm_address_size (struct domain *d, uint32_t cmd)
 {
-    return xsm_call(address_size(d, cmd));
+    return xsm_ops->address_size(d, cmd);
 }
 
 static inline int xsm_machine_address_size (struct domain *d, uint32_t cmd)
 {
-    return xsm_call(machine_address_size(d, cmd));
+    return xsm_ops->machine_address_size(d, cmd);
 }
 
 static inline int xsm_hvm_param (struct domain *d, unsigned long op)
 {
-    return xsm_call(hvm_param(d, op));
+    return xsm_ops->hvm_param(d, op);
 }
 
 static inline int xsm_hvm_set_pci_intx_level (struct domain *d)
 {
-    return xsm_call(hvm_set_pci_intx_level(d));
+    return xsm_ops->hvm_set_pci_intx_level(d);
 }
 
 static inline int xsm_hvm_set_isa_irq_level (struct domain *d)
 {
-    return xsm_call(hvm_set_isa_irq_level(d));
+    return xsm_ops->hvm_set_isa_irq_level(d);
 }
 
 static inline int xsm_hvm_set_pci_link_route (struct domain *d)
 {
-    return xsm_call(hvm_set_pci_link_route(d));
+    return xsm_ops->hvm_set_pci_link_route(d);
 }
 
 static inline int xsm_hvm_inject_msi (struct domain *d)
 {
-    return xsm_call(hvm_inject_msi(d));
+    return xsm_ops->hvm_inject_msi(d);
 }
 
 static inline int xsm_mem_event (struct domain *d)
 {
-    return xsm_call(mem_event(d));
+    return xsm_ops->mem_event(d);
 }
 
 static inline int xsm_mem_sharing (struct domain *d)
 {
-    return xsm_call(mem_sharing(d));
+    return xsm_ops->mem_sharing(d);
 }
 
 static inline int xsm_apic (struct domain *d, int cmd)
 {
-    return xsm_call(apic(d, cmd));
+    return xsm_ops->apic(d, cmd);
 }
 
 static inline int xsm_xen_settime (void)
 {
-    return xsm_call(xen_settime());
+    return xsm_ops->xen_settime();
 }
 
 static inline int xsm_memtype (uint32_t access)
 {
-    return xsm_call(memtype(access));
+    return xsm_ops->memtype(access);
 }
 
 static inline int xsm_microcode (void)
 {
-    return xsm_call(microcode());
+    return xsm_ops->microcode();
 }
 
 static inline int xsm_physinfo (void)
 {
-    return xsm_call(physinfo());
+    return xsm_ops->physinfo();
 }
 
 static inline int xsm_platform_quirk (uint32_t quirk)
 {
-    return xsm_call(platform_quirk(quirk));
+    return xsm_ops->platform_quirk(quirk);
 }
 
 static inline int xsm_firmware_info (void)
 {
-    return xsm_call(firmware_info());
+    return xsm_ops->firmware_info();
 }
 
 static inline int xsm_efi_call (void)
 {
-    return xsm_call(efi_call());
+    return xsm_ops->efi_call();
 }
 
 static inline int xsm_acpi_sleep (void)
 {
-    return xsm_call(acpi_sleep());
+    return xsm_ops->acpi_sleep();
 }
 
 static inline int xsm_change_freq (void)
 {
-    return xsm_call(change_freq());
+    return xsm_ops->change_freq();
 }
 
 static inline int xsm_getidletime (void)
 {
-    return xsm_call(getidletime());
+    return xsm_ops->getidletime();
 }
 
 static inline int xsm_machine_memory_map(void)
 {
-    return xsm_call(machine_memory_map());
+    return xsm_ops->machine_memory_map();
 }
 
 static inline int xsm_domain_memory_map(struct domain *d)
 {
-    return xsm_call(domain_memory_map(d));
+    return xsm_ops->domain_memory_map(d);
 }
 
 static inline int xsm_mmu_normal_update (struct domain *d, struct domain *t,
                                          struct domain *f, intpte_t fpte)
 {
-    return xsm_call(mmu_normal_update(d, t, f, fpte));
+    return xsm_ops->mmu_normal_update(d, t, f, fpte);
 }
 
 static inline int xsm_mmu_machphys_update (struct domain *d1, struct domain *d2,
                                            unsigned long mfn)
 {
-    return xsm_call(mmu_machphys_update(d1, d2, mfn));
+    return xsm_ops->mmu_machphys_update(d1, d2, mfn);
 }
 
 static inline int xsm_update_va_mapping(struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
-    return xsm_call(update_va_mapping(d, f, pte));
+    return xsm_ops->update_va_mapping(d, f, pte);
 }
 
 static inline int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
 {
-    return xsm_call(add_to_physmap(d1, d2));
+    return xsm_ops->add_to_physmap(d1, d2);
 }
 
 static inline int xsm_sendtrigger(struct domain *d)
 {
-    return xsm_call(sendtrigger(d));
+    return xsm_ops->sendtrigger(d);
 }
 
 static inline int xsm_bind_pt_irq(struct domain *d, 
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_call(bind_pt_irq(d, bind));
+    return xsm_ops->bind_pt_irq(d, bind);
 }
 
 static inline int xsm_unbind_pt_irq(struct domain *d,
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_call(unbind_pt_irq(d, bind));
+    return xsm_ops->unbind_pt_irq(d, bind);
 }
 
 static inline int xsm_pin_mem_cacheattr(struct domain *d)
 {
-    return xsm_call(pin_mem_cacheattr(d));
+    return xsm_ops->pin_mem_cacheattr(d);
 }
 
 static inline int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
 {
-    return xsm_call(ext_vcpucontext(d, cmd));
+    return xsm_ops->ext_vcpucontext(d, cmd);
 }
 static inline int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
 {
-    return xsm_call(vcpuextstate(d, cmd));
+    return xsm_ops->vcpuextstate(d, cmd);
 }
 
 static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return xsm_call(ioport_permission(d, s, e, allow));
+    return xsm_ops->ioport_permission(d, s, e, allow);
 }
 
 static inline int xsm_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return xsm_call(ioport_mapping(d, s, e, allow));
+    return xsm_ops->ioport_mapping(d, s, e, allow);
 }
 #endif /* CONFIG_X86 */
+#endif /* XSM_NO_WRAPPERS */
+
+extern int xsm_init(unsigned long *module_map, const multiboot_info_t *mbi,
+                    void *(*bootstrap_map)(const module_t *));
+extern int xsm_policy_init(unsigned long *module_map,
+                           const multiboot_info_t *mbi,
+                           void *(*bootstrap_map)(const module_t *));
+extern int register_xsm(struct xsm_operations *ops);
+extern int unregister_xsm(struct xsm_operations *ops);
 
 extern struct xsm_operations dummy_xsm_ops;
 extern void xsm_fixup_ops(struct xsm_operations *ops);
 
+#else /* XSM_ENABLE */
+
+#define XSM_INLINE inline
+#include <xsm/dummy.h>
+
+static inline int xsm_init (unsigned long *module_map,
+                            const multiboot_info_t *mbi,
+                            void *(*bootstrap_map)(const module_t *))
+{
+    return 0;
+}
+#endif /* XSM_ENABLE */
+
 #endif /* __XSM_H */
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 5f078d2..b767cfe 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -10,621 +10,9 @@
  *  as published by the Free Software Foundation.
  */
 
-#include <xen/sched.h>
-#include <xsm/xsm.h>
-
-static void dummy_security_domaininfo(struct domain *d,
-                                    struct xen_domctl_getdomaininfo *info)
-{
-    return;
-}
-
-static int dummy_setvcpucontext(struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_pausedomain (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_unpausedomain (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_resumedomain (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_domain_create(struct domain *d, u32 ssidref)
-{
-    return 0;
-}
-
-static int dummy_max_vcpus(struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_destroydomain (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_vcpuaffinity (int cmd, struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_scheduler (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_getdomaininfo (struct domain *d)
-{
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
-}
-
-static int dummy_getvcpucontext (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_getvcpuinfo (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_domain_settime (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_set_target (struct domain *d, struct domain *e)
-{
-    return 0;
-}
-
-static int dummy_domctl(struct domain *d, int cmd)
-{
-    return 0;
-}
-
-static int dummy_set_virq_handler(struct domain *d, uint32_t virq)
-{
-    return 0;
-}
-
-static int dummy_tbufcontrol (void)
-{
-    return 0;
-}
-
-static int dummy_readconsole (uint32_t clear)
-{
-    return 0;
-}
-
-static int dummy_sched_id (void)
-{
-    return 0;
-}
-
-static int dummy_setdomainmaxmem (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_setdomainhandle (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_setdebugging (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_perfcontrol (void)
-{
-    return 0;
-}
-
-static int dummy_debug_keys (void)
-{
-    return 0;
-}
-
-static int dummy_getcpuinfo (void)
-{
-    return 0;
-}
-
-static int dummy_get_pmstat (void)
-{
-    return 0;
-}
-
-static int dummy_setpminfo (void)
-{
-    return 0;
-}
-
-static int dummy_pm_op (void)
-{
-    return 0;
-}
-
-static int dummy_do_mca (void)
-{
-    return 0;
-}
-
-static int dummy_availheap (void)
-{
-    return 0;
-}
-
-static int dummy_alloc_security_domain (struct domain *d)
-{
-    return 0;
-}
-
-static void dummy_free_security_domain (struct domain *d)
-{
-    return;
-}
-
-static int dummy_grant_mapref (struct domain *d1, struct domain *d2,
-                                                                uint32_t flags)
-{
-    return 0;
-}
-
-static int dummy_grant_unmapref (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_grant_setup (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_grant_transfer (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_grant_copy (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_grant_query_size (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_memory_adjust_reservation (struct domain *d1,
-                                                            struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_memory_stat_reservation (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_console_io (struct domain *d, int cmd)
-{
-    return 0;
-}
-
-static int dummy_profile (struct domain *d, int op)
-{
-    return 0;
-}
-
-static int dummy_kexec (void)
-{
-    return 0;
-}
-
-static int dummy_schedop_shutdown (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_memory_pin_page(struct domain *d1, struct domain *d2, struct page_info *page)
-{
-    return 0;
-}
-
-static int dummy_evtchn_unbound (struct domain *d, struct evtchn *chn,
-                                                                    domid_t id2)
-{
-    return 0;
-}
-
-static int dummy_evtchn_interdomain (struct domain *d1, struct evtchn
-                                *chan1, struct domain *d2, struct evtchn *chan2)
-{
-    return 0;
-}
-
-static void dummy_evtchn_close_post (struct evtchn *chn)
-{
-    return;
-}
-
-static int dummy_evtchn_send (struct domain *d, struct evtchn *chn)
-{
-    return 0;
-}
-
-static int dummy_evtchn_status (struct domain *d, struct evtchn *chn)
-{
-    return 0;
-}
-
-static int dummy_evtchn_reset (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_alloc_security_evtchn (struct evtchn *chn)
-{
-    return 0;
-}
-
-static void dummy_free_security_evtchn (struct evtchn *chn)
-{
-    return;
-}
-
-static char *dummy_show_security_evtchn (struct domain *d, const struct evtchn *chn)
-{
-    return NULL;
-}
-
-static int dummy_get_pod_target(struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_set_pod_target(struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_get_device_group (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_test_assign_device (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_assign_device (struct domain *d, uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_deassign_device (struct domain *d, uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_resource_plug_core (void)
-{
-    return 0;
-}
-
-static int dummy_resource_unplug_core (void)
-{
-    return 0;
-}
-
-static int dummy_resource_plug_pci (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_resource_unplug_pci (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_resource_setup_pci (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_resource_setup_gsi (int gsi)
-{
-    return 0;
-}
-
-static int dummy_resource_setup_misc (void)
-{
-    return 0;
-}
-
-static int dummy_page_offline (uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_lockprof (void)
-{
-    return 0;
-}
-
-static int dummy_cpupool_op (void)
-{
-    return 0;
-}
-
-static int dummy_sched_op (void)
-{
-    return 0;
-}
-
-static long dummy___do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
-{
-    return -ENOSYS;
-}
-
-static char *dummy_show_irq_sid (int irq)
-{
-    return NULL;
-}
-
-static int dummy_map_domain_pirq (struct domain *d, int irq, void *data)
-{
-    return 0;
-}
-
-static int dummy_unmap_domain_pirq (struct domain *d, int irq)
-{
-    return 0;
-}
-
-static int dummy_irq_permission (struct domain *d, int pirq, uint8_t allow)
-{
-    return 0;
-}
-
-static int dummy_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
-{
-    return 0;
-}
-
-static int dummy_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
-{
-    return 0;
-}
-
-static int dummy_pci_config_permission (struct domain *d, uint32_t machine_bdf,
-                                        uint16_t start, uint16_t end,
-                                        uint8_t access)
-{
-    return 0;
-}
-
-#ifdef CONFIG_X86
-static int dummy_shadow_control (struct domain *d, uint32_t op)
-{
-    return 0;
-}
-
-static int dummy_getpageframeinfo (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_getmemlist (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hypercall_init (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hvmcontext (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_address_size (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_machine_address_size (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_hvm_param (struct domain *d, unsigned long op)
-{
-    return 0;
-}
-
-static int dummy_hvm_set_pci_intx_level (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hvm_set_isa_irq_level (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hvm_set_pci_link_route (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hvm_inject_msi (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_mem_event (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_mem_sharing (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_apic (struct domain *d, int cmd)
-{
-    return 0;
-}
-
-static int dummy_xen_settime (void)
-{
-    return 0;
-}
-
-static int dummy_memtype (uint32_t access)
-{
-    return 0;
-}
-
-static int dummy_microcode (void)
-{
-    return 0;
-}
-
-static int dummy_physinfo (void)
-{
-    return 0;
-}
-
-static int dummy_platform_quirk (uint32_t quirk)
-{
-    return 0;
-}
-
-static int dummy_firmware_info (void)
-{
-    return 0;
-}
-
-static int dummy_efi_call(void)
-{
-    return 0;
-}
-
-static int dummy_acpi_sleep (void)
-{
-    return 0;
-}
-
-static int dummy_change_freq (void)
-{
-    return 0;
-}
-
-static int dummy_getidletime (void)
-{
-    return 0;
-}
-
-static int dummy_machine_memory_map (void)
-{
-    return 0;
-}
-
-static int dummy_domain_memory_map (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_mmu_normal_update (struct domain *d, struct domain *t,
-                                    struct domain *f, intpte_t fpte)
-{
-    return 0;
-}
-
-static int dummy_mmu_machphys_update (struct domain *d, struct domain *f, unsigned long mfn)
-{
-    return 0;
-}
-
-static int dummy_update_va_mapping (struct domain *d, struct domain *f, 
-                                                            l1_pgentry_t pte)
-{
-    return 0;
-}
-
-static int dummy_add_to_physmap (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_remove_from_physmap (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_sendtrigger (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
-{
-    return 0;
-}
-
-static int dummy_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
-{
-    return 0;
-}
-
-static int dummy_pin_mem_cacheattr (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_ext_vcpucontext (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_vcpuextstate (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
-{
-    return 0;
-}
-
-static int dummy_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
-{
-    return 0;
-}
-#endif
+#define XSM_NO_WRAPPERS
+#define XSM_INLINE /* */
+#include <xsm/dummy.h>
 
 struct xsm_operations dummy_xsm_ops;
 
@@ -632,7 +20,7 @@ struct xsm_operations dummy_xsm_ops;
     do {                                                               \
         if ( !ops->function )                                          \
         {                                                              \
-            ops->function = dummy_##function;                          \
+            ops->function = xsm_##function;                            \
             if (ops != &dummy_xsm_ops)                                 \
                 dprintk(XENLOG_DEBUG, "Had to override the " #function \
                     " security operation with the dummy one.\n");      \
@@ -732,7 +120,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, cpupool_op);
     set_to_dummy_if_null(ops, sched_op);
 
-    set_to_dummy_if_null(ops, __do_xsm_op);
+    set_to_dummy_if_null(ops, do_xsm_op);
 
 #ifdef CONFIG_X86
     set_to_dummy_if_null(ops, shadow_control);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 81ff5ac..31572c5 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1555,7 +1555,7 @@ static struct xsm_operations flask_ops = {
     .cpupool_op = flask_cpupool_op,
     .sched_op = flask_sched_op,
 
-    .__do_xsm_op = do_flask_op,
+    .do_xsm_op = do_flask_op,
 
 #ifdef CONFIG_X86
     .shadow_control = flask_shadow_control,
diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index 46287cb..ca28f91 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -113,7 +113,7 @@ int unregister_xsm(struct xsm_operations *ops)
 
 long do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
-    return __do_xsm_op(op);
+    return xsm_do_xsm_op(op);
 }
 
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSep-0002Ox-Cl; Fri, 30 Nov 2012 15:37:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSem-0002Mb-BA
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:36 +0000
Received: from [85.158.139.211:63815] by server-14.bemta-5.messagelabs.com id
	C9/0A-21768-FB2D8B05; Fri, 30 Nov 2012 15:37:35 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-7.tower-206.messagelabs.com!1354289851!18119928!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20560 invoked from network); 30 Nov 2012 15:37:32 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-7.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:32 -0000
X-TM-IMSS-Message-ID: <339213ec00027aaf@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 339213ec00027aaf ;
	Fri, 30 Nov 2012 10:36:24 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbScw017785; 
	Fri, 30 Nov 2012 10:37:30 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:52 -0500
Message-Id: <1354289830-24642-6-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 05/23] xsm: Use the dummy XSM module if XSM is
	disabled
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch moves the implementation of the dummy XSM module to a header
file that provides inline functions when XSM_ENABLE is not defined. This
reduces duplication between the dummy module and callers when the
implementation of the dummy return is not just "return 0", and also
provides better compile-time checking for completeness of the XSM
implementations in the dummy module.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
---
 xen/common/domctl.c     |   2 -
 xen/include/xsm/dummy.h | 628 ++++++++++++++++++++++++++++++++++++++++++++++++
 xen/include/xsm/xsm.h   | 297 +++++++++++------------
 xen/xsm/dummy.c         | 622 +----------------------------------------------
 xen/xsm/flask/hooks.c   |   2 +-
 xen/xsm/xsm_core.c      |   2 +-
 6 files changed, 781 insertions(+), 772 deletions(-)
 create mode 100644 xen/include/xsm/dummy.h

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index a7a6b9f..2f49eb2 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -267,10 +267,8 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             return -EPERM;
         break;
     }
-#ifdef XSM_ENABLE
     case XEN_DOMCTL_getdomaininfo:
         break;
-#endif
     default:
         if ( !IS_PRIV(current->domain) )
             return -EPERM;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
new file mode 100644
index 0000000..4384552
--- /dev/null
+++ b/xen/include/xsm/dummy.h
@@ -0,0 +1,628 @@
+/*
+ *  Default XSM hooks - IS_PRIV and IS_PRIV_FOR checks
+ *
+ *  Author: Daniel De Graaf <dgdegra@tyhco.nsa.gov>
+ *
+ *  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.
+ */
+
+#include <xen/sched.h>
+#include <xsm/xsm.h>
+
+static XSM_INLINE void xsm_security_domaininfo(struct domain *d,
+                                    struct xen_domctl_getdomaininfo *info)
+{
+    return;
+}
+
+static XSM_INLINE int xsm_setvcpucontext(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_pausedomain(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_unpausedomain(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_resumedomain(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_domain_create(struct domain *d, u32 ssidref)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_max_vcpus(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_destroydomain(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_vcpuaffinity(int cmd, struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_scheduler(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
+static XSM_INLINE int xsm_getvcpucontext(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_getvcpuinfo(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_domain_settime(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_domctl(struct domain *d, int cmd)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_set_virq_handler(struct domain *d, uint32_t virq)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_tbufcontrol(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_readconsole(uint32_t clear)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_sched_id(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_setdomainmaxmem(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_setdomainhandle(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_setdebugging(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_perfcontrol(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_debug_keys(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_getcpuinfo(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_get_pmstat(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_setpminfo(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_pm_op(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_do_mca(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_availheap(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE void xsm_free_security_domain(struct domain *d)
+{
+    return;
+}
+
+static XSM_INLINE int xsm_grant_mapref(struct domain *d1, struct domain *d2,
+                                                                uint32_t flags)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_grant_unmapref(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_grant_setup(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_grant_transfer(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_grant_copy(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_grant_query_size(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
+                                                            struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_memory_stat_reservation(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_console_io(struct domain *d, int cmd)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_profile(struct domain *d, int op)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_kexec(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_schedop_shutdown(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
+                                          struct page_info *page)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_evtchn_unbound(struct domain *d, struct evtchn *chn,
+                                         domid_t id2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_evtchn_interdomain(struct domain *d1, struct evtchn
+                                *chan1, struct domain *d2, struct evtchn *chan2)
+{
+    return 0;
+}
+
+static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
+{
+    return;
+}
+
+static XSM_INLINE int xsm_evtchn_send(struct domain *d, struct evtchn *chn)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_evtchn_status(struct domain *d, struct evtchn *chn)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_evtchn_reset(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_alloc_security_evtchn(struct evtchn *chn)
+{
+    return 0;
+}
+
+static XSM_INLINE void xsm_free_security_evtchn(struct evtchn *chn)
+{
+    return;
+}
+
+static XSM_INLINE char *xsm_show_security_evtchn(struct domain *d, const struct evtchn *chn)
+{
+    return NULL;
+}
+
+static XSM_INLINE int xsm_get_pod_target(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_set_pod_target(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_get_device_group(uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_test_assign_device(uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_resource_plug_core(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_resource_unplug_core(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_resource_plug_pci(uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_resource_unplug_pci(uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_resource_setup_pci(uint32_t machine_bdf)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_resource_setup_gsi(int gsi)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_resource_setup_misc(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_page_offline(uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_lockprof(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_cpupool_op(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_sched_op(void)
+{
+    return 0;
+}
+
+static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
+{
+    return -ENOSYS;
+}
+
+static XSM_INLINE char *xsm_show_irq_sid(int irq)
+{
+    return NULL;
+}
+
+static XSM_INLINE int xsm_map_domain_pirq(struct domain *d, int irq, void *data)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_unmap_domain_pirq(struct domain *d, int irq)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_irq_permission(struct domain *d, int pirq, uint8_t allow)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_iomem_permission(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_iomem_mapping(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_pci_config_permission(struct domain *d, uint32_t machine_bdf,
+                                        uint16_t start, uint16_t end,
+                                        uint8_t access)
+{
+    return 0;
+}
+
+#ifdef CONFIG_X86
+static XSM_INLINE int xsm_shadow_control(struct domain *d, uint32_t op)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_getpageframeinfo(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_getmemlist(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_hypercall_init(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_hvmcontext(struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_address_size(struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_machine_address_size(struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_hvm_set_pci_intx_level(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_hvm_set_isa_irq_level(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_hvm_set_pci_link_route(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_mem_event(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_mem_sharing(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_xen_settime(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_memtype(uint32_t access)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_microcode(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_physinfo(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_firmware_info(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_efi_call(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_acpi_sleep(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_change_freq(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_getidletime(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_machine_memory_map(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_domain_memory_map(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_mmu_normal_update(struct domain *d, struct domain *t,
+                                            struct domain *f, intpte_t fpte)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_mmu_machphys_update(struct domain *d, struct domain *f,
+                                              unsigned long mfn)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f, 
+                                                            l1_pgentry_t pte)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_sendtrigger(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_unbind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_pin_mem_cacheattr(struct domain *d)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_ioport_mapping(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+{
+    return 0;
+}
+
+#endif
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 2560229..662f233 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -21,12 +21,6 @@
 typedef void xsm_op_t;
 DEFINE_XEN_GUEST_HANDLE(xsm_op_t);
 
-#ifdef XSM_ENABLE
-    #define xsm_call(fn) xsm_ops->fn
-#else
-    #define xsm_call(fn) 0
-#endif
-
 /* policy magic number (defined by XSM_MAGIC) */
 typedef u32 xsm_magic_t;
 #ifndef XSM_MAGIC
@@ -141,7 +135,7 @@ struct xsm_operations {
     int (*cpupool_op)(void);
     int (*sched_op)(void);
 
-    long (*__do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
+    long (*do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
 
 #ifdef CONFIG_X86
     int (*shadow_control) (struct domain *d, uint32_t op);
@@ -187,645 +181,646 @@ struct xsm_operations {
 #endif
 };
 
-#endif
-
 extern struct xsm_operations *xsm_ops;
 
+#ifndef XSM_NO_WRAPPERS
+
 static inline void xsm_security_domaininfo (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info)
 {
-    (void)xsm_call(security_domaininfo(d, info));
+    xsm_ops->security_domaininfo(d, info);
 }
 
 static inline int xsm_setvcpucontext(struct domain *d)
 {
-    return xsm_call(setvcpucontext(d));
+    return xsm_ops->setvcpucontext(d);
 }
 
 static inline int xsm_pausedomain (struct domain *d)
 {
-    return xsm_call(pausedomain(d));
+    return xsm_ops->pausedomain(d);
 }
 
 static inline int xsm_unpausedomain (struct domain *d)
 {
-    return xsm_call(unpausedomain(d));
+    return xsm_ops->unpausedomain(d);
 }
 
 static inline int xsm_resumedomain (struct domain *d)
 {
-    return xsm_call(resumedomain(d));
+    return xsm_ops->resumedomain(d);
 }
 
 static inline int xsm_domain_create (struct domain *d, u32 ssidref)
 {
-    return xsm_call(domain_create(d, ssidref));
+    return xsm_ops->domain_create(d, ssidref);
 }
 
 static inline int xsm_max_vcpus(struct domain *d)
 {
-    return xsm_call(max_vcpus(d));
+    return xsm_ops->max_vcpus(d);
 }
 
 static inline int xsm_destroydomain (struct domain *d)
 {
-    return xsm_call(destroydomain(d));
+    return xsm_ops->destroydomain(d);
 }
 
 static inline int xsm_vcpuaffinity (int cmd, struct domain *d)
 {
-    return xsm_call(vcpuaffinity(cmd, d));
+    return xsm_ops->vcpuaffinity(cmd, d);
 }
 
 static inline int xsm_scheduler (struct domain *d)
 {
-    return xsm_call(scheduler(d));
+    return xsm_ops->scheduler(d);
 }
 
 static inline int xsm_getdomaininfo (struct domain *d)
 {
-    return xsm_call(getdomaininfo(d));
+    return xsm_ops->getdomaininfo(d);
 }
 
 static inline int xsm_getvcpucontext (struct domain *d)
 {
-    return xsm_call(getvcpucontext(d));
+    return xsm_ops->getvcpucontext(d);
 }
 
 static inline int xsm_getvcpuinfo (struct domain *d)
 {
-    return xsm_call(getvcpuinfo(d));
+    return xsm_ops->getvcpuinfo(d);
 }
 
 static inline int xsm_domain_settime (struct domain *d)
 {
-    return xsm_call(domain_settime(d));
+    return xsm_ops->domain_settime(d);
 }
 
 static inline int xsm_set_target (struct domain *d, struct domain *e)
 {
-    return xsm_call(set_target(d, e));
+    return xsm_ops->set_target(d, e);
 }
 
 static inline int xsm_domctl (struct domain *d, int cmd)
 {
-    return xsm_call(domctl(d, cmd));
+    return xsm_ops->domctl(d, cmd);
 }
 
 static inline int xsm_set_virq_handler (struct domain *d, uint32_t virq)
 {
-    return xsm_call(set_virq_handler(d, virq));
+    return xsm_ops->set_virq_handler(d, virq);
 }
 
 static inline int xsm_tbufcontrol (void)
 {
-    return xsm_call(tbufcontrol());
+    return xsm_ops->tbufcontrol();
 }
 
 static inline int xsm_readconsole (uint32_t clear)
 {
-    return xsm_call(readconsole(clear));
+    return xsm_ops->readconsole(clear);
 }
 
 static inline int xsm_sched_id (void)
 {
-    return xsm_call(sched_id());
+    return xsm_ops->sched_id();
 }
 
 static inline int xsm_setdomainmaxmem (struct domain *d)
 {
-    return xsm_call(setdomainmaxmem(d));
+    return xsm_ops->setdomainmaxmem(d);
 }
 
 static inline int xsm_setdomainhandle (struct domain *d)
 {
-    return xsm_call(setdomainhandle(d));
+    return xsm_ops->setdomainhandle(d);
 }
 
 static inline int xsm_setdebugging (struct domain *d)
 {
-    return xsm_call(setdebugging(d));
+    return xsm_ops->setdebugging(d);
 }
 
 static inline int xsm_perfcontrol (void)
 {
-    return xsm_call(perfcontrol());
+    return xsm_ops->perfcontrol();
 }
 
 static inline int xsm_debug_keys (void)
 {
-    return xsm_call(debug_keys());
+    return xsm_ops->debug_keys();
 }
 
 static inline int xsm_availheap (void)
 {
-    return xsm_call(availheap());
+    return xsm_ops->availheap();
 }
 
 static inline int xsm_getcpuinfo (void)
 {
-    return xsm_call(getcpuinfo());
+    return xsm_ops->getcpuinfo();
 }
 
 static inline int xsm_get_pmstat(void)
 {
-    return xsm_call(get_pmstat());
+    return xsm_ops->get_pmstat();
 }
 
 static inline int xsm_setpminfo(void)
 {
-	return xsm_call(setpminfo());
+    return xsm_ops->setpminfo();
 }
 
 static inline int xsm_pm_op(void)
 {
-    return xsm_call(pm_op());
+    return xsm_ops->pm_op();
 }
 
 static inline int xsm_do_mca(void)
 {
-    return xsm_call(do_mca());
+    return xsm_ops->do_mca();
 }
 
 static inline int xsm_evtchn_unbound (struct domain *d1, struct evtchn *chn,
                                                                     domid_t id2)
 {
-    return xsm_call(evtchn_unbound(d1, chn, id2));
+    return xsm_ops->evtchn_unbound(d1, chn, id2);
 }
 
 static inline int xsm_evtchn_interdomain (struct domain *d1, 
                 struct evtchn *chan1, struct domain *d2, struct evtchn *chan2)
 {
-    return xsm_call(evtchn_interdomain(d1, chan1, d2, chan2));
+    return xsm_ops->evtchn_interdomain(d1, chan1, d2, chan2);
 }
 
 static inline void xsm_evtchn_close_post (struct evtchn *chn)
 {
-    (void)xsm_call(evtchn_close_post(chn));
+    xsm_ops->evtchn_close_post(chn);
 }
 
 static inline int xsm_evtchn_send (struct domain *d, struct evtchn *chn)
 {
-    return xsm_call(evtchn_send(d, chn));
+    return xsm_ops->evtchn_send(d, chn);
 }
 
 static inline int xsm_evtchn_status (struct domain *d, struct evtchn *chn)
 {
-    return xsm_call(evtchn_status(d, chn));
+    return xsm_ops->evtchn_status(d, chn);
 }
 
 static inline int xsm_evtchn_reset (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(evtchn_reset(d1, d2));
+    return xsm_ops->evtchn_reset(d1, d2);
 }
 
 static inline int xsm_grant_mapref (struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
-    return xsm_call(grant_mapref(d1, d2, flags));
+    return xsm_ops->grant_mapref(d1, d2, flags);
 }
 
 static inline int xsm_grant_unmapref (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_unmapref(d1, d2));
+    return xsm_ops->grant_unmapref(d1, d2);
 }
 
 static inline int xsm_grant_setup (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_setup(d1, d2));
+    return xsm_ops->grant_setup(d1, d2);
 }
 
 static inline int xsm_grant_transfer (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_transfer(d1, d2));
+    return xsm_ops->grant_transfer(d1, d2);
 }
 
 static inline int xsm_grant_copy (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_copy(d1, d2));
+    return xsm_ops->grant_copy(d1, d2);
 }
 
 static inline int xsm_grant_query_size (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(grant_query_size(d1, d2));
+    return xsm_ops->grant_query_size(d1, d2);
 }
 
 static inline int xsm_alloc_security_domain (struct domain *d)
 {
-    return xsm_call(alloc_security_domain(d));
+    return xsm_ops->alloc_security_domain(d);
 }
 
 static inline void xsm_free_security_domain (struct domain *d)
 {
-    (void)xsm_call(free_security_domain(d));
+    xsm_ops->free_security_domain(d);
 }
 
 static inline int xsm_alloc_security_evtchn (struct evtchn *chn)
 {
-    return xsm_call(alloc_security_evtchn(chn));
+    return xsm_ops->alloc_security_evtchn(chn);
 }
 
 static inline void xsm_free_security_evtchn (struct evtchn *chn)
 {
-    (void)xsm_call(free_security_evtchn(chn));
+    (void)xsm_ops->free_security_evtchn(chn);
 }
 
 static inline char *xsm_show_security_evtchn (struct domain *d, const struct evtchn *chn)
 {
-    return xsm_call(show_security_evtchn(d, chn));
+    return xsm_ops->show_security_evtchn(d, chn);
 }
 
 static inline int xsm_get_pod_target (struct domain *d)
 {
-    return xsm_call(get_pod_target(d));
+    return xsm_ops->get_pod_target(d);
 }
 
 static inline int xsm_set_pod_target (struct domain *d)
 {
-    return xsm_call(set_pod_target(d));
+    return xsm_ops->set_pod_target(d);
 }
 
 static inline int xsm_memory_adjust_reservation (struct domain *d1, struct
                                                                     domain *d2)
 {
-    return xsm_call(memory_adjust_reservation(d1, d2));
+    return xsm_ops->memory_adjust_reservation(d1, d2);
 }
 
 static inline int xsm_memory_stat_reservation (struct domain *d1,
                                                             struct domain *d2)
 {
-    return xsm_call(memory_stat_reservation(d1, d2));
+    return xsm_ops->memory_stat_reservation(d1, d2);
 }
 
 static inline int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
                                       struct page_info *page)
 {
-    return xsm_call(memory_pin_page(d1, d2, page));
+    return xsm_ops->memory_pin_page(d1, d2, page);
 }
 
 static inline int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
-    return xsm_call(remove_from_physmap(d1, d2));
+    return xsm_ops->remove_from_physmap(d1, d2);
 }
 
 static inline int xsm_console_io (struct domain *d, int cmd)
 {
-    return xsm_call(console_io(d, cmd));
+    return xsm_ops->console_io(d, cmd);
 }
 
 static inline int xsm_profile (struct domain *d, int op)
 {
-    return xsm_call(profile(d, op));
+    return xsm_ops->profile(d, op);
 }
 
 static inline int xsm_kexec (void)
 {
-    return xsm_call(kexec());
+    return xsm_ops->kexec();
 }
 
 static inline int xsm_schedop_shutdown (struct domain *d1, struct domain *d2)
 {
-    return xsm_call(schedop_shutdown(d1, d2));
+    return xsm_ops->schedop_shutdown(d1, d2);
 }
 
 static inline char *xsm_show_irq_sid (int irq)
 {
-    return xsm_call(show_irq_sid(irq));
+    return xsm_ops->show_irq_sid(irq);
 }
 
 static inline int xsm_map_domain_pirq (struct domain *d, int irq, void *data)
 {
-    return xsm_call(map_domain_pirq(d, irq, data));
+    return xsm_ops->map_domain_pirq(d, irq, data);
 }
 
 static inline int xsm_unmap_domain_pirq (struct domain *d, int irq)
 {
-    return xsm_call(unmap_domain_pirq(d, irq));
+    return xsm_ops->unmap_domain_pirq(d, irq);
 }
 
 static inline int xsm_irq_permission (struct domain *d, int pirq, uint8_t allow)
 {
-    return xsm_call(irq_permission(d, pirq, allow));
+    return xsm_ops->irq_permission(d, pirq, allow);
 }
 
 static inline int xsm_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return xsm_call(iomem_permission(d, s, e, allow));
+    return xsm_ops->iomem_permission(d, s, e, allow);
 }
 
 static inline int xsm_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return xsm_call(iomem_mapping(d, s, e, allow));
+    return xsm_ops->iomem_mapping(d, s, e, allow);
 }
 
 static inline int xsm_pci_config_permission (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
-    return xsm_call(pci_config_permission(d, machine_bdf, start, end, access));
+    return xsm_ops->pci_config_permission(d, machine_bdf, start, end, access);
 }
 
 static inline int xsm_get_device_group(uint32_t machine_bdf)
 {
-    return xsm_call(get_device_group(machine_bdf));
+    return xsm_ops->get_device_group(machine_bdf);
 }
 
 static inline int xsm_test_assign_device(uint32_t machine_bdf)
 {
-    return xsm_call(test_assign_device(machine_bdf));
+    return xsm_ops->test_assign_device(machine_bdf);
 }
 
 static inline int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
 {
-    return xsm_call(assign_device(d, machine_bdf));
+    return xsm_ops->assign_device(d, machine_bdf);
 }
 
 static inline int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
-    return xsm_call(deassign_device(d, machine_bdf));
+    return xsm_ops->deassign_device(d, machine_bdf);
 }
 
 static inline int xsm_resource_plug_pci (uint32_t machine_bdf)
 {
-    return xsm_call(resource_plug_pci(machine_bdf));
+    return xsm_ops->resource_plug_pci(machine_bdf);
 }
 
 static inline int xsm_resource_unplug_pci (uint32_t machine_bdf)
 {
-    return xsm_call(resource_unplug_pci(machine_bdf));
+    return xsm_ops->resource_unplug_pci(machine_bdf);
 }
 
 static inline int xsm_resource_plug_core (void)
 {
-    return xsm_call(resource_plug_core());
+    return xsm_ops->resource_plug_core();
 }
 
 static inline int xsm_resource_unplug_core (void)
 {
-    return xsm_call(resource_unplug_core());
+    return xsm_ops->resource_unplug_core();
 }
 
 static inline int xsm_resource_setup_pci (uint32_t machine_bdf)
 {
-    return xsm_call(resource_setup_pci(machine_bdf));
+    return xsm_ops->resource_setup_pci(machine_bdf);
 }
 
 static inline int xsm_resource_setup_gsi (int gsi)
 {
-    return xsm_call(resource_setup_gsi(gsi));
+    return xsm_ops->resource_setup_gsi(gsi);
 }
 
 static inline int xsm_resource_setup_misc (void)
 {
-    return xsm_call(resource_setup_misc());
+    return xsm_ops->resource_setup_misc();
 }
 
 static inline int xsm_page_offline(uint32_t cmd)
 {
-    return xsm_call(page_offline(cmd));
+    return xsm_ops->page_offline(cmd);
 }
 
 static inline int xsm_lockprof(void)
 {
-    return xsm_call(lockprof());
+    return xsm_ops->lockprof();
 }
 
 static inline int xsm_cpupool_op(void)
 {
-    return xsm_call(cpupool_op());
+    return xsm_ops->cpupool_op();
 }
 
 static inline int xsm_sched_op(void)
 {
-    return xsm_call(sched_op());
+    return xsm_ops->sched_op();
 }
 
-static inline long __do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
+static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
-#ifdef XSM_ENABLE
-    return xsm_ops->__do_xsm_op(op);
-#else
-    return -ENOSYS;
-#endif
+    return xsm_ops->do_xsm_op(op);
 }
 
-#ifdef XSM_ENABLE
-extern int xsm_init(unsigned long *module_map, const multiboot_info_t *mbi,
-                    void *(*bootstrap_map)(const module_t *));
-extern int xsm_policy_init(unsigned long *module_map,
-                           const multiboot_info_t *mbi,
-                           void *(*bootstrap_map)(const module_t *));
-extern int register_xsm(struct xsm_operations *ops);
-extern int unregister_xsm(struct xsm_operations *ops);
-#else
-static inline int xsm_init (unsigned long *module_map,
-                            const multiboot_info_t *mbi,
-                            void *(*bootstrap_map)(const module_t *))
-{
-    return 0;
-}
-#endif
-
 #ifdef CONFIG_X86
 static inline int xsm_shadow_control (struct domain *d, uint32_t op)
 {
-    return xsm_call(shadow_control(d, op));
+    return xsm_ops->shadow_control(d, op);
 }
 
 static inline int xsm_getpageframeinfo (struct domain *d)
 {
-    return xsm_call(getpageframeinfo(d));
+    return xsm_ops->getpageframeinfo(d);
 }
 
 static inline int xsm_getmemlist (struct domain *d)
 {
-    return xsm_call(getmemlist(d));
+    return xsm_ops->getmemlist(d);
 }
 
 static inline int xsm_hypercall_init (struct domain *d)
 {
-    return xsm_call(hypercall_init(d));
+    return xsm_ops->hypercall_init(d);
 }
 
 static inline int xsm_hvmcontext (struct domain *d, uint32_t cmd)
 {
-    return xsm_call(hvmcontext(d, cmd));
+    return xsm_ops->hvmcontext(d, cmd);
 }
 
 static inline int xsm_address_size (struct domain *d, uint32_t cmd)
 {
-    return xsm_call(address_size(d, cmd));
+    return xsm_ops->address_size(d, cmd);
 }
 
 static inline int xsm_machine_address_size (struct domain *d, uint32_t cmd)
 {
-    return xsm_call(machine_address_size(d, cmd));
+    return xsm_ops->machine_address_size(d, cmd);
 }
 
 static inline int xsm_hvm_param (struct domain *d, unsigned long op)
 {
-    return xsm_call(hvm_param(d, op));
+    return xsm_ops->hvm_param(d, op);
 }
 
 static inline int xsm_hvm_set_pci_intx_level (struct domain *d)
 {
-    return xsm_call(hvm_set_pci_intx_level(d));
+    return xsm_ops->hvm_set_pci_intx_level(d);
 }
 
 static inline int xsm_hvm_set_isa_irq_level (struct domain *d)
 {
-    return xsm_call(hvm_set_isa_irq_level(d));
+    return xsm_ops->hvm_set_isa_irq_level(d);
 }
 
 static inline int xsm_hvm_set_pci_link_route (struct domain *d)
 {
-    return xsm_call(hvm_set_pci_link_route(d));
+    return xsm_ops->hvm_set_pci_link_route(d);
 }
 
 static inline int xsm_hvm_inject_msi (struct domain *d)
 {
-    return xsm_call(hvm_inject_msi(d));
+    return xsm_ops->hvm_inject_msi(d);
 }
 
 static inline int xsm_mem_event (struct domain *d)
 {
-    return xsm_call(mem_event(d));
+    return xsm_ops->mem_event(d);
 }
 
 static inline int xsm_mem_sharing (struct domain *d)
 {
-    return xsm_call(mem_sharing(d));
+    return xsm_ops->mem_sharing(d);
 }
 
 static inline int xsm_apic (struct domain *d, int cmd)
 {
-    return xsm_call(apic(d, cmd));
+    return xsm_ops->apic(d, cmd);
 }
 
 static inline int xsm_xen_settime (void)
 {
-    return xsm_call(xen_settime());
+    return xsm_ops->xen_settime();
 }
 
 static inline int xsm_memtype (uint32_t access)
 {
-    return xsm_call(memtype(access));
+    return xsm_ops->memtype(access);
 }
 
 static inline int xsm_microcode (void)
 {
-    return xsm_call(microcode());
+    return xsm_ops->microcode();
 }
 
 static inline int xsm_physinfo (void)
 {
-    return xsm_call(physinfo());
+    return xsm_ops->physinfo();
 }
 
 static inline int xsm_platform_quirk (uint32_t quirk)
 {
-    return xsm_call(platform_quirk(quirk));
+    return xsm_ops->platform_quirk(quirk);
 }
 
 static inline int xsm_firmware_info (void)
 {
-    return xsm_call(firmware_info());
+    return xsm_ops->firmware_info();
 }
 
 static inline int xsm_efi_call (void)
 {
-    return xsm_call(efi_call());
+    return xsm_ops->efi_call();
 }
 
 static inline int xsm_acpi_sleep (void)
 {
-    return xsm_call(acpi_sleep());
+    return xsm_ops->acpi_sleep();
 }
 
 static inline int xsm_change_freq (void)
 {
-    return xsm_call(change_freq());
+    return xsm_ops->change_freq();
 }
 
 static inline int xsm_getidletime (void)
 {
-    return xsm_call(getidletime());
+    return xsm_ops->getidletime();
 }
 
 static inline int xsm_machine_memory_map(void)
 {
-    return xsm_call(machine_memory_map());
+    return xsm_ops->machine_memory_map();
 }
 
 static inline int xsm_domain_memory_map(struct domain *d)
 {
-    return xsm_call(domain_memory_map(d));
+    return xsm_ops->domain_memory_map(d);
 }
 
 static inline int xsm_mmu_normal_update (struct domain *d, struct domain *t,
                                          struct domain *f, intpte_t fpte)
 {
-    return xsm_call(mmu_normal_update(d, t, f, fpte));
+    return xsm_ops->mmu_normal_update(d, t, f, fpte);
 }
 
 static inline int xsm_mmu_machphys_update (struct domain *d1, struct domain *d2,
                                            unsigned long mfn)
 {
-    return xsm_call(mmu_machphys_update(d1, d2, mfn));
+    return xsm_ops->mmu_machphys_update(d1, d2, mfn);
 }
 
 static inline int xsm_update_va_mapping(struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
-    return xsm_call(update_va_mapping(d, f, pte));
+    return xsm_ops->update_va_mapping(d, f, pte);
 }
 
 static inline int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
 {
-    return xsm_call(add_to_physmap(d1, d2));
+    return xsm_ops->add_to_physmap(d1, d2);
 }
 
 static inline int xsm_sendtrigger(struct domain *d)
 {
-    return xsm_call(sendtrigger(d));
+    return xsm_ops->sendtrigger(d);
 }
 
 static inline int xsm_bind_pt_irq(struct domain *d, 
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_call(bind_pt_irq(d, bind));
+    return xsm_ops->bind_pt_irq(d, bind);
 }
 
 static inline int xsm_unbind_pt_irq(struct domain *d,
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_call(unbind_pt_irq(d, bind));
+    return xsm_ops->unbind_pt_irq(d, bind);
 }
 
 static inline int xsm_pin_mem_cacheattr(struct domain *d)
 {
-    return xsm_call(pin_mem_cacheattr(d));
+    return xsm_ops->pin_mem_cacheattr(d);
 }
 
 static inline int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
 {
-    return xsm_call(ext_vcpucontext(d, cmd));
+    return xsm_ops->ext_vcpucontext(d, cmd);
 }
 static inline int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
 {
-    return xsm_call(vcpuextstate(d, cmd));
+    return xsm_ops->vcpuextstate(d, cmd);
 }
 
 static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return xsm_call(ioport_permission(d, s, e, allow));
+    return xsm_ops->ioport_permission(d, s, e, allow);
 }
 
 static inline int xsm_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return xsm_call(ioport_mapping(d, s, e, allow));
+    return xsm_ops->ioport_mapping(d, s, e, allow);
 }
 #endif /* CONFIG_X86 */
+#endif /* XSM_NO_WRAPPERS */
+
+extern int xsm_init(unsigned long *module_map, const multiboot_info_t *mbi,
+                    void *(*bootstrap_map)(const module_t *));
+extern int xsm_policy_init(unsigned long *module_map,
+                           const multiboot_info_t *mbi,
+                           void *(*bootstrap_map)(const module_t *));
+extern int register_xsm(struct xsm_operations *ops);
+extern int unregister_xsm(struct xsm_operations *ops);
 
 extern struct xsm_operations dummy_xsm_ops;
 extern void xsm_fixup_ops(struct xsm_operations *ops);
 
+#else /* XSM_ENABLE */
+
+#define XSM_INLINE inline
+#include <xsm/dummy.h>
+
+static inline int xsm_init (unsigned long *module_map,
+                            const multiboot_info_t *mbi,
+                            void *(*bootstrap_map)(const module_t *))
+{
+    return 0;
+}
+#endif /* XSM_ENABLE */
+
 #endif /* __XSM_H */
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 5f078d2..b767cfe 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -10,621 +10,9 @@
  *  as published by the Free Software Foundation.
  */
 
-#include <xen/sched.h>
-#include <xsm/xsm.h>
-
-static void dummy_security_domaininfo(struct domain *d,
-                                    struct xen_domctl_getdomaininfo *info)
-{
-    return;
-}
-
-static int dummy_setvcpucontext(struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_pausedomain (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_unpausedomain (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_resumedomain (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_domain_create(struct domain *d, u32 ssidref)
-{
-    return 0;
-}
-
-static int dummy_max_vcpus(struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_destroydomain (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_vcpuaffinity (int cmd, struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_scheduler (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_getdomaininfo (struct domain *d)
-{
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
-}
-
-static int dummy_getvcpucontext (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_getvcpuinfo (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_domain_settime (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_set_target (struct domain *d, struct domain *e)
-{
-    return 0;
-}
-
-static int dummy_domctl(struct domain *d, int cmd)
-{
-    return 0;
-}
-
-static int dummy_set_virq_handler(struct domain *d, uint32_t virq)
-{
-    return 0;
-}
-
-static int dummy_tbufcontrol (void)
-{
-    return 0;
-}
-
-static int dummy_readconsole (uint32_t clear)
-{
-    return 0;
-}
-
-static int dummy_sched_id (void)
-{
-    return 0;
-}
-
-static int dummy_setdomainmaxmem (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_setdomainhandle (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_setdebugging (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_perfcontrol (void)
-{
-    return 0;
-}
-
-static int dummy_debug_keys (void)
-{
-    return 0;
-}
-
-static int dummy_getcpuinfo (void)
-{
-    return 0;
-}
-
-static int dummy_get_pmstat (void)
-{
-    return 0;
-}
-
-static int dummy_setpminfo (void)
-{
-    return 0;
-}
-
-static int dummy_pm_op (void)
-{
-    return 0;
-}
-
-static int dummy_do_mca (void)
-{
-    return 0;
-}
-
-static int dummy_availheap (void)
-{
-    return 0;
-}
-
-static int dummy_alloc_security_domain (struct domain *d)
-{
-    return 0;
-}
-
-static void dummy_free_security_domain (struct domain *d)
-{
-    return;
-}
-
-static int dummy_grant_mapref (struct domain *d1, struct domain *d2,
-                                                                uint32_t flags)
-{
-    return 0;
-}
-
-static int dummy_grant_unmapref (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_grant_setup (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_grant_transfer (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_grant_copy (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_grant_query_size (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_memory_adjust_reservation (struct domain *d1,
-                                                            struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_memory_stat_reservation (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_console_io (struct domain *d, int cmd)
-{
-    return 0;
-}
-
-static int dummy_profile (struct domain *d, int op)
-{
-    return 0;
-}
-
-static int dummy_kexec (void)
-{
-    return 0;
-}
-
-static int dummy_schedop_shutdown (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_memory_pin_page(struct domain *d1, struct domain *d2, struct page_info *page)
-{
-    return 0;
-}
-
-static int dummy_evtchn_unbound (struct domain *d, struct evtchn *chn,
-                                                                    domid_t id2)
-{
-    return 0;
-}
-
-static int dummy_evtchn_interdomain (struct domain *d1, struct evtchn
-                                *chan1, struct domain *d2, struct evtchn *chan2)
-{
-    return 0;
-}
-
-static void dummy_evtchn_close_post (struct evtchn *chn)
-{
-    return;
-}
-
-static int dummy_evtchn_send (struct domain *d, struct evtchn *chn)
-{
-    return 0;
-}
-
-static int dummy_evtchn_status (struct domain *d, struct evtchn *chn)
-{
-    return 0;
-}
-
-static int dummy_evtchn_reset (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_alloc_security_evtchn (struct evtchn *chn)
-{
-    return 0;
-}
-
-static void dummy_free_security_evtchn (struct evtchn *chn)
-{
-    return;
-}
-
-static char *dummy_show_security_evtchn (struct domain *d, const struct evtchn *chn)
-{
-    return NULL;
-}
-
-static int dummy_get_pod_target(struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_set_pod_target(struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_get_device_group (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_test_assign_device (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_assign_device (struct domain *d, uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_deassign_device (struct domain *d, uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_resource_plug_core (void)
-{
-    return 0;
-}
-
-static int dummy_resource_unplug_core (void)
-{
-    return 0;
-}
-
-static int dummy_resource_plug_pci (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_resource_unplug_pci (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_resource_setup_pci (uint32_t machine_bdf)
-{
-    return 0;
-}
-
-static int dummy_resource_setup_gsi (int gsi)
-{
-    return 0;
-}
-
-static int dummy_resource_setup_misc (void)
-{
-    return 0;
-}
-
-static int dummy_page_offline (uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_lockprof (void)
-{
-    return 0;
-}
-
-static int dummy_cpupool_op (void)
-{
-    return 0;
-}
-
-static int dummy_sched_op (void)
-{
-    return 0;
-}
-
-static long dummy___do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
-{
-    return -ENOSYS;
-}
-
-static char *dummy_show_irq_sid (int irq)
-{
-    return NULL;
-}
-
-static int dummy_map_domain_pirq (struct domain *d, int irq, void *data)
-{
-    return 0;
-}
-
-static int dummy_unmap_domain_pirq (struct domain *d, int irq)
-{
-    return 0;
-}
-
-static int dummy_irq_permission (struct domain *d, int pirq, uint8_t allow)
-{
-    return 0;
-}
-
-static int dummy_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
-{
-    return 0;
-}
-
-static int dummy_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
-{
-    return 0;
-}
-
-static int dummy_pci_config_permission (struct domain *d, uint32_t machine_bdf,
-                                        uint16_t start, uint16_t end,
-                                        uint8_t access)
-{
-    return 0;
-}
-
-#ifdef CONFIG_X86
-static int dummy_shadow_control (struct domain *d, uint32_t op)
-{
-    return 0;
-}
-
-static int dummy_getpageframeinfo (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_getmemlist (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hypercall_init (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hvmcontext (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_address_size (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_machine_address_size (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_hvm_param (struct domain *d, unsigned long op)
-{
-    return 0;
-}
-
-static int dummy_hvm_set_pci_intx_level (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hvm_set_isa_irq_level (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hvm_set_pci_link_route (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_hvm_inject_msi (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_mem_event (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_mem_sharing (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_apic (struct domain *d, int cmd)
-{
-    return 0;
-}
-
-static int dummy_xen_settime (void)
-{
-    return 0;
-}
-
-static int dummy_memtype (uint32_t access)
-{
-    return 0;
-}
-
-static int dummy_microcode (void)
-{
-    return 0;
-}
-
-static int dummy_physinfo (void)
-{
-    return 0;
-}
-
-static int dummy_platform_quirk (uint32_t quirk)
-{
-    return 0;
-}
-
-static int dummy_firmware_info (void)
-{
-    return 0;
-}
-
-static int dummy_efi_call(void)
-{
-    return 0;
-}
-
-static int dummy_acpi_sleep (void)
-{
-    return 0;
-}
-
-static int dummy_change_freq (void)
-{
-    return 0;
-}
-
-static int dummy_getidletime (void)
-{
-    return 0;
-}
-
-static int dummy_machine_memory_map (void)
-{
-    return 0;
-}
-
-static int dummy_domain_memory_map (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_mmu_normal_update (struct domain *d, struct domain *t,
-                                    struct domain *f, intpte_t fpte)
-{
-    return 0;
-}
-
-static int dummy_mmu_machphys_update (struct domain *d, struct domain *f, unsigned long mfn)
-{
-    return 0;
-}
-
-static int dummy_update_va_mapping (struct domain *d, struct domain *f, 
-                                                            l1_pgentry_t pte)
-{
-    return 0;
-}
-
-static int dummy_add_to_physmap (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_remove_from_physmap (struct domain *d1, struct domain *d2)
-{
-    return 0;
-}
-
-static int dummy_sendtrigger (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
-{
-    return 0;
-}
-
-static int dummy_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
-{
-    return 0;
-}
-
-static int dummy_pin_mem_cacheattr (struct domain *d)
-{
-    return 0;
-}
-
-static int dummy_ext_vcpucontext (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_vcpuextstate (struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static int dummy_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
-{
-    return 0;
-}
-
-static int dummy_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
-{
-    return 0;
-}
-#endif
+#define XSM_NO_WRAPPERS
+#define XSM_INLINE /* */
+#include <xsm/dummy.h>
 
 struct xsm_operations dummy_xsm_ops;
 
@@ -632,7 +20,7 @@ struct xsm_operations dummy_xsm_ops;
     do {                                                               \
         if ( !ops->function )                                          \
         {                                                              \
-            ops->function = dummy_##function;                          \
+            ops->function = xsm_##function;                            \
             if (ops != &dummy_xsm_ops)                                 \
                 dprintk(XENLOG_DEBUG, "Had to override the " #function \
                     " security operation with the dummy one.\n");      \
@@ -732,7 +120,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, cpupool_op);
     set_to_dummy_if_null(ops, sched_op);
 
-    set_to_dummy_if_null(ops, __do_xsm_op);
+    set_to_dummy_if_null(ops, do_xsm_op);
 
 #ifdef CONFIG_X86
     set_to_dummy_if_null(ops, shadow_control);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 81ff5ac..31572c5 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1555,7 +1555,7 @@ static struct xsm_operations flask_ops = {
     .cpupool_op = flask_cpupool_op,
     .sched_op = flask_sched_op,
 
-    .__do_xsm_op = do_flask_op,
+    .do_xsm_op = do_flask_op,
 
 #ifdef CONFIG_X86
     .shadow_control = flask_shadow_control,
diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index 46287cb..ca28f91 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -113,7 +113,7 @@ int unregister_xsm(struct xsm_operations *ops)
 
 long do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
-    return __do_xsm_op(op);
+    return xsm_do_xsm_op(op);
 }
 
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSem-0002Mp-Bx; Fri, 30 Nov 2012 15:37:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSek-0002MC-Nw
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:34 +0000
Received: from [85.158.139.211:30248] by server-2.bemta-5.messagelabs.com id
	33/6F-04892-DB2D8B05; Fri, 30 Nov 2012 15:37:33 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-8.tower-206.messagelabs.com!1354289851!18547803!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24238 invoked from network); 30 Nov 2012 15:37:32 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-8.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:32 -0000
X-TM-IMSS-Message-ID: <3392119b00027aac@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3392119b00027aac ;
	Fri, 30 Nov 2012 10:36:23 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbScu017785; 
	Fri, 30 Nov 2012 10:37:29 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:50 -0500
Message-Id: <1354289830-24642-4-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 03/23] arch/x86: add distinct XSM hooks for
	map/unmap
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The xsm_iomem_permission and xsm_ioport_permission hooks are intended to
be called by the domain builder, while the calls in arch/x86/domctl.c
which control mapping are also performed by the device model. Because of
this, they should not use the same XSM hooks.

This also adds a missing XSM hook in the unbind IRQ domctl.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/domctl.c  |  8 ++++++--
 xen/arch/x86/physdev.c |  2 +-
 xen/include/xsm/xsm.h  | 25 ++++++++++++++++++++++---
 xen/xsm/dummy.c        | 20 +++++++++++++++++++-
 xen/xsm/flask/hooks.c  | 42 ++++++++++++++++++++----------------------
 5 files changed, 68 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 508c77c..7069d7a 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -803,6 +803,10 @@ long arch_do_domctl(
              !irq_access_permitted(current->domain, bind->machine_irq) )
             goto unbind_out;
 
+        ret = xsm_unbind_pt_irq(d, bind);
+        if ( ret )
+            goto unbind_out;
+
         if ( iommu_enabled )
         {
             spin_lock(&pcidevs_lock);
@@ -842,7 +846,7 @@ long arch_do_domctl(
         if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
             break;
 
-        ret = xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, add);
+        ret = xsm_iomem_mapping(d, mfn, mfn + nr_mfns - 1, add);
         if ( ret ) {
             rcu_unlock_domain(d);
             break;
@@ -929,7 +933,7 @@ long arch_do_domctl(
         if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
             break;
 
-        ret = xsm_ioport_permission(d, fmp, fmp + np - 1, add);
+        ret = xsm_ioport_mapping(d, fmp, fmp + np - 1, add);
         if ( ret ) {
             rcu_unlock_domain(d);
             break;
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 751cbd4..2928f1c 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -242,7 +242,7 @@ int physdev_unmap_pirq(domid_t domid, int pirq)
     if ( !IS_PRIV_FOR(current->domain, d) )
         goto free_domain;
 
-    ret = xsm_irq_permission(d, domain_pirq_to_irq(d, pirq), 0);
+    ret = xsm_unmap_domain_pirq(d, domain_pirq_to_irq(d, pirq));
     if ( ret )
         goto free_domain;
 
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index a949c1e..2560229 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -117,8 +117,10 @@ struct xsm_operations {
 
     char *(*show_irq_sid) (int irq);
     int (*map_domain_pirq) (struct domain *d, int irq, void *data);
+    int (*unmap_domain_pirq) (struct domain *d, int irq);
     int (*irq_permission) (struct domain *d, int pirq, uint8_t allow);
     int (*iomem_permission) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
+    int (*iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
     int (*pci_config_permission) (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access);
 
     int (*get_device_group) (uint32_t machine_bdf);
@@ -176,11 +178,12 @@ struct xsm_operations {
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
     int (*sendtrigger) (struct domain *d);
     int (*bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*unbind_pt_irq) (struct domain *d);
+    int (*unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
     int (*pin_mem_cacheattr) (struct domain *d);
     int (*ext_vcpucontext) (struct domain *d, uint32_t cmd);
     int (*vcpuextstate) (struct domain *d, uint32_t cmd);
     int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
+    int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
 #endif
 };
 
@@ -495,6 +498,11 @@ static inline int xsm_map_domain_pirq (struct domain *d, int irq, void *data)
     return xsm_call(map_domain_pirq(d, irq, data));
 }
 
+static inline int xsm_unmap_domain_pirq (struct domain *d, int irq)
+{
+    return xsm_call(unmap_domain_pirq(d, irq));
+}
+
 static inline int xsm_irq_permission (struct domain *d, int pirq, uint8_t allow)
 {
     return xsm_call(irq_permission(d, pirq, allow));
@@ -505,6 +513,11 @@ static inline int xsm_iomem_permission (struct domain *d, uint64_t s, uint64_t e
     return xsm_call(iomem_permission(d, s, e, allow));
 }
 
+static inline int xsm_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+{
+    return xsm_call(iomem_mapping(d, s, e, allow));
+}
+
 static inline int xsm_pci_config_permission (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
     return xsm_call(pci_config_permission(d, machine_bdf, start, end, access));
@@ -781,9 +794,10 @@ static inline int xsm_bind_pt_irq(struct domain *d,
     return xsm_call(bind_pt_irq(d, bind));
 }
 
-static inline int xsm_unbind_pt_irq(struct domain *d)
+static inline int xsm_unbind_pt_irq(struct domain *d,
+                                                struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_call(unbind_pt_irq(d));
+    return xsm_call(unbind_pt_irq(d, bind));
 }
 
 static inline int xsm_pin_mem_cacheattr(struct domain *d)
@@ -804,6 +818,11 @@ static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t
 {
     return xsm_call(ioport_permission(d, s, e, allow));
 }
+
+static inline int xsm_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+{
+    return xsm_call(ioport_mapping(d, s, e, allow));
+}
 #endif /* CONFIG_X86 */
 
 extern struct xsm_operations dummy_xsm_ops;
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index b726eaf..5f078d2 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -395,6 +395,11 @@ static int dummy_map_domain_pirq (struct domain *d, int irq, void *data)
     return 0;
 }
 
+static int dummy_unmap_domain_pirq (struct domain *d, int irq)
+{
+    return 0;
+}
+
 static int dummy_irq_permission (struct domain *d, int pirq, uint8_t allow)
 {
     return 0;
@@ -405,6 +410,11 @@ static int dummy_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uin
     return 0;
 }
 
+static int dummy_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+{
+    return 0;
+}
+
 static int dummy_pci_config_permission (struct domain *d, uint32_t machine_bdf,
                                         uint16_t start, uint16_t end,
                                         uint8_t access)
@@ -585,7 +595,7 @@ static int dummy_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *b
     return 0;
 }
 
-static int dummy_unbind_pt_irq (struct domain *d)
+static int dummy_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
@@ -609,6 +619,11 @@ static int dummy_ioport_permission (struct domain *d, uint32_t s, uint32_t e, ui
 {
     return 0;
 }
+
+static int dummy_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+{
+    return 0;
+}
 #endif
 
 struct xsm_operations dummy_xsm_ops;
@@ -693,8 +708,10 @@ void xsm_fixup_ops (struct xsm_operations *ops)
 
     set_to_dummy_if_null(ops, show_irq_sid);
     set_to_dummy_if_null(ops, map_domain_pirq);
+    set_to_dummy_if_null(ops, unmap_domain_pirq);
     set_to_dummy_if_null(ops, irq_permission);
     set_to_dummy_if_null(ops, iomem_permission);
+    set_to_dummy_if_null(ops, iomem_mapping);
     set_to_dummy_if_null(ops, pci_config_permission);
 
     set_to_dummy_if_null(ops, get_device_group);
@@ -757,5 +774,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, ext_vcpucontext);
     set_to_dummy_if_null(ops, vcpuextstate);
     set_to_dummy_if_null(ops, ioport_permission);
+    set_to_dummy_if_null(ops, ioport_mapping);
 #endif
 }
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 0ca10d0..d4635d0 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -721,43 +721,40 @@ static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
     return rc;
 }
 
-static int flask_irq_permission (struct domain *d, int irq, uint8_t access)
+static int flask_unmap_domain_pirq (struct domain *d, int irq)
 {
-    u32 perm;
-    u32 rsid;
+    u32 sid;
     int rc = -EPERM;
 
-    struct domain_security_struct *ssec, *tsec;
+    struct domain_security_struct *ssec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
-                         resource_to_perm(access));
-
+    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
     if ( rc )
         return rc;
 
-    if ( access )
-        perm = RESOURCE__ADD_IRQ;
-    else
-        perm = RESOURCE__REMOVE_IRQ;
-
     ssec = current->domain->ssid;
-    tsec = d->ssid;
 
-    rc = get_irq_sid(irq, &rsid, &ad);
-    if ( rc )
-        return rc;
-
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
+    if ( irq >= nr_irqs_gsi ) {
+        /* TODO support for MSI here */
+        return 0;
+    } else {
+        rc = get_irq_sid(irq, &sid, &ad);
+    }
     if ( rc )
         return rc;
 
-    if ( access )
-        rc = avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, 
-                            RESOURCE__USE, &ad);
+    rc = avc_has_perm(ssec->sid, sid, SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, &ad);
     return rc;
 }
 
+static int flask_irq_permission (struct domain *d, int pirq, uint8_t access)
+{
+    /* the PIRQ number is not useful; real IRQ is checked during mapping */
+    return domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
+                           resource_to_perm(access));
+}
+
 struct iomem_has_perm_data {
     struct domain_security_struct *ssec, *tsec;
     u32 perm;
@@ -1413,7 +1410,7 @@ static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *b
     return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_unbind_pt_irq (struct domain *d)
+static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
@@ -1533,6 +1530,7 @@ static struct xsm_operations flask_ops = {
     .show_irq_sid = flask_show_irq_sid,
 
     .map_domain_pirq = flask_map_domain_pirq,
+    .unmap_domain_pirq = flask_unmap_domain_pirq,
     .irq_permission = flask_irq_permission,
     .iomem_permission = flask_iomem_permission,
     .pci_config_permission = flask_pci_config_permission,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSen-0002Nb-Dj; Fri, 30 Nov 2012 15:37:37 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSel-0002MP-Ma
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:35 +0000
Received: from [193.109.254.147:42417] by server-16.bemta-14.messagelabs.com
	id FB/07-09215-EB2D8B05; Fri, 30 Nov 2012 15:37:34 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-27.messagelabs.com!1354289853!2114139!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 443 invoked from network); 30 Nov 2012 15:37:33 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-11.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:33 -0000
X-TM-IMSS-Message-ID: <d0a0e913000589c2@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0e913000589c2 ;
	Fri, 30 Nov 2012 10:37:37 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd3017785; 
	Fri, 30 Nov 2012 10:37:32 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:57 -0500
Message-Id: <1354289830-24642-11-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 10/23] xen: convert do_domctl to use XSM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The xsm_domctl hook now covers every domctl, in addition to the more
fine-grained XSM hooks in most sub-functions. This also removes the need
to special-case XEN_DOMCTL_getdomaininfo.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c   |  2 +-
 xen/common/domctl.c     | 32 +++----------------
 xen/include/xsm/dummy.h | 16 ++++++++--
 xen/xsm/flask/hooks.c   | 85 ++++++++++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 104 insertions(+), 31 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 7069d7a..30518aa 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1534,7 +1534,7 @@ long arch_do_domctl(
     {
         struct domain *d;
 
-        ret = rcu_lock_remote_target_domain_by_id(domctl->domain, &d);
+        ret = rcu_lock_remote_domain_by_id(domctl->domain, &d);
         if ( ret != 0 )
             break;
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 536bef5..46bb0e3 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -264,27 +264,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             return -ESRCH;
     }
 
-    switch ( op->cmd )
-    {
-    case XEN_DOMCTL_ioport_mapping:
-    case XEN_DOMCTL_memory_mapping:
-    case XEN_DOMCTL_bind_pt_irq:
-    case XEN_DOMCTL_unbind_pt_irq: {
-        bool_t is_priv = IS_PRIV_FOR(current->domain, d);
-        if ( !is_priv )
-        {
-            ret = -EPERM;
-            goto domctl_out_unlock;
-        }
-        break;
-    }
-    case XEN_DOMCTL_getdomaininfo:
-        break;
-    default:
-        if ( !IS_PRIV(current->domain) )
-            return -EPERM;
-        break;
-    }
+    ret = xsm_domctl(d, op->cmd);
+    if ( ret )
+        goto domctl_out_unlock;
 
     if ( !domctl_lock_acquire() )
     {
@@ -858,17 +840,13 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_subscribe:
     {
-        ret = xsm_domctl(d, op->cmd);
-        if ( !ret )
-            d->suspend_evtchn = op->u.subscribe.port;
+        d->suspend_evtchn = op->u.subscribe.port;
     }
     break;
 
     case XEN_DOMCTL_disable_migrate:
     {
-        ret = xsm_domctl(d, op->cmd);
-        if ( !ret )
-            d->disable_migrate = op->u.disable_migrate.disable;
+        d->disable_migrate = op->u.disable_migrate.disable;
     }
     break;
 
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index ae7b4f6..1c19e15 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -64,8 +64,6 @@ static XSM_INLINE int xsm_scheduler(struct domain *d)
 
 static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
     return 0;
 }
 
@@ -91,6 +89,20 @@ static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
 
 static XSM_INLINE int xsm_domctl(struct domain *d, int cmd)
 {
+    switch ( cmd )
+    {
+    case XEN_DOMCTL_ioport_mapping:
+    case XEN_DOMCTL_memory_mapping:
+    case XEN_DOMCTL_bind_pt_irq:
+    case XEN_DOMCTL_unbind_pt_irq: {
+        if ( !IS_PRIV_FOR(current->domain, d) )
+            return -EPERM;
+        break;
+    }
+    default:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+    }
     return 0;
 }
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index f9a2596..2e002f0 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -589,7 +589,90 @@ static int flask_set_target(struct domain *d, struct domain *e)
 
 static int flask_domctl(struct domain *d, int cmd)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO);
+    switch ( cmd )
+    {
+    /* These have individual XSM hooks (common/domctl.c) */
+    case XEN_DOMCTL_createdomain:
+    case XEN_DOMCTL_destroydomain:
+    case XEN_DOMCTL_pausedomain:
+    case XEN_DOMCTL_unpausedomain:
+    case XEN_DOMCTL_getdomaininfo:
+    case XEN_DOMCTL_setvcpuaffinity:
+    case XEN_DOMCTL_max_mem:
+    case XEN_DOMCTL_setvcpucontext:
+    case XEN_DOMCTL_getvcpucontext:
+    case XEN_DOMCTL_getvcpuinfo:
+    case XEN_DOMCTL_max_vcpus:
+    case XEN_DOMCTL_scheduler_op:
+    case XEN_DOMCTL_setdomainhandle:
+    case XEN_DOMCTL_setdebugging:
+    case XEN_DOMCTL_irq_permission:
+    case XEN_DOMCTL_iomem_permission:
+    case XEN_DOMCTL_settimeoffset:
+    case XEN_DOMCTL_getvcpuaffinity:
+    case XEN_DOMCTL_resumedomain:
+    case XEN_DOMCTL_set_target:
+    case XEN_DOMCTL_set_virq_handler:
+#ifdef CONFIG_X86
+    /* These have individual XSM hooks (arch/x86/domctl.c) */
+    case XEN_DOMCTL_shadow_op:
+    case XEN_DOMCTL_ioport_permission:
+    case XEN_DOMCTL_getpageframeinfo:
+    case XEN_DOMCTL_getpageframeinfo2:
+    case XEN_DOMCTL_getpageframeinfo3:
+    case XEN_DOMCTL_getmemlist:
+    case XEN_DOMCTL_hypercall_init:
+    case XEN_DOMCTL_sethvmcontext:
+    case XEN_DOMCTL_gethvmcontext:
+    case XEN_DOMCTL_gethvmcontext_partial:
+    case XEN_DOMCTL_set_address_size:
+    case XEN_DOMCTL_get_address_size:
+    case XEN_DOMCTL_set_machine_address_size:
+    case XEN_DOMCTL_get_machine_address_size:
+    case XEN_DOMCTL_sendtrigger:
+    case XEN_DOMCTL_bind_pt_irq:
+    case XEN_DOMCTL_unbind_pt_irq:
+    case XEN_DOMCTL_memory_mapping:
+    case XEN_DOMCTL_ioport_mapping:
+    case XEN_DOMCTL_pin_mem_cacheattr:
+    case XEN_DOMCTL_set_ext_vcpucontext:
+    case XEN_DOMCTL_get_ext_vcpucontext:
+    case XEN_DOMCTL_setvcpuextstate:
+    case XEN_DOMCTL_getvcpuextstate:
+    case XEN_DOMCTL_mem_event_op:
+    case XEN_DOMCTL_mem_sharing_op:
+    case XEN_DOMCTL_set_access_required:
+    /* These have individual XSM hooks (drivers/passthrough/iommu.c) */
+    case XEN_DOMCTL_get_device_group:
+    case XEN_DOMCTL_test_assign_device:
+    case XEN_DOMCTL_assign_device:
+    case XEN_DOMCTL_deassign_device:
+#endif
+        return 0;
+
+    case XEN_DOMCTL_subscribe:
+    case XEN_DOMCTL_disable_migrate:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
+                               DOMAIN__SET_MISC_INFO);
+
+    case XEN_DOMCTL_set_cpuid:
+    case XEN_DOMCTL_suppress_spurious_page_faults:
+    case XEN_DOMCTL_debug_op:
+    case XEN_DOMCTL_gettscinfo:
+    case XEN_DOMCTL_settscinfo:
+    case XEN_DOMCTL_audit_p2m:
+    case XEN_DOMCTL_gdbsx_guestmemio:
+    case XEN_DOMCTL_gdbsx_pausevcpu:
+    case XEN_DOMCTL_gdbsx_unpausevcpu:
+    case XEN_DOMCTL_gdbsx_domstatus:
+        /* TODO add per-subfunction hooks */
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+        return 0;
+    default:
+        printk("flask_domctl: Unknown op %d\n", cmd);
+        return -EPERM;
+    }
 }
 
 static int flask_set_virq_handler(struct domain *d, uint32_t virq)
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSem-0002N1-Pa; Fri, 30 Nov 2012 15:37:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSel-0002MC-8Q
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:35 +0000
Received: from [85.158.139.211:30328] by server-2.bemta-5.messagelabs.com id
	C0/7F-04892-EB2D8B05; Fri, 30 Nov 2012 15:37:34 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-10.tower-206.messagelabs.com!1354289852!18533441!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 424 invoked from network); 30 Nov 2012 15:37:33 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-10.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:33 -0000
X-TM-IMSS-Message-ID: <3392168b00027ab1@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3392168b00027ab1 ;
	Fri, 30 Nov 2012 10:36:24 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbScx017785; 
	Fri, 30 Nov 2012 10:37:30 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:53 -0500
Message-Id: <1354289830-24642-7-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 06/23] xen: use XSM instead of IS_PRIV where
	duplicated
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The Xen hypervisor has two basic access control function calls: IS_PRIV
and the xsm_* functions. Most privileged operations currently require
that both checks succeed, and many times the checks are at different
locations in the code. This patch eliminates the explicit and implicit
IS_PRIV checks that are duplicated in XSM hooks.

When XSM_ENABLE is not defined or when the dummy XSM module is used,
this patch should not change any functionality. Because the locations of
privilege checks have sometimes moved below argument validation, error
returns of some functions may change from EPERM to EINVAL or ESRCH if
called with invalid arguments and from a domain without permission to
perform the operation.

Some checks are removed due to non-obvious duplicates in their callers:

 * acpi_enter_sleep is checked in XENPF_enter_acpi_sleep
 * map_domain_pirq has IS_PRIV_FOR checked in its callers:
   * physdev_map_pirq checks when acquiring the RCU lock
   * ioapic_guest_write is checked in PHYSDEVOP_apic_write
 * PHYSDEVOP_{manage_pci_add,manage_pci_add_ext,pci_device_add} are
   checked by xsm_resource_plug_pci in pci_add_device
 * PHYSDEVOP_manage_pci_remove is checked by xsm_resource_unplug_pci
   in pci_remove_device
 * PHYSDEVOP_{restore_msi,restore_msi_ext} are checked by
   xsm_resource_setup_pci in pci_restore_msi_state
 * do_console_io has changed to IS_PRIV from an explicit domid==0

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/acpi/power.c     |  2 +-
 xen/arch/x86/cpu/mcheck/mce.c |  3 ---
 xen/arch/x86/irq.c            |  3 +--
 xen/arch/x86/mm.c             |  3 ---
 xen/arch/x86/physdev.c        | 56 ++++---------------------------------------
 xen/common/kexec.c            |  3 ---
 xen/common/schedule.c         |  6 -----
 xen/drivers/char/console.c    |  6 -----
 xen/include/xsm/dummy.h       | 28 ++++++++++++++++++++++
 xen/xsm/flask/hooks.c         |  5 ++--
 10 files changed, 37 insertions(+), 78 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 9e1f989..c7b37ef 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -238,7 +238,7 @@ static long enter_state_helper(void *data)
  */
 int acpi_enter_sleep(struct xenpf_enter_acpi_sleep *sleep)
 {
-    if ( !IS_PRIV(current->domain) || !acpi_sinfo.pm1a_cnt_blk.address )
+    if ( !acpi_sinfo.pm1a_cnt_blk.address )
         return -EPERM;
 
     /* Sanity check */
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 8b54240..658774a 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1293,9 +1293,6 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
     struct xen_mc_msrinject *mc_msrinject;
     struct xen_mc_mceinject *mc_mceinject;
 
-    if (!IS_PRIV(v->domain) )
-        return x86_mcerr(NULL, -EPERM);
-
     ret = xsm_do_mca();
     if ( ret )
         return x86_mcerr(NULL, ret);
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 05cede5..238600a 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1853,8 +1853,7 @@ int map_domain_pirq(
     ASSERT(spin_is_locked(&d->event_lock));
 
     if ( !IS_PRIV(current->domain) &&
-         !(IS_PRIV_FOR(current->domain, d) &&
-           irq_access_permitted(current->domain, pirq)))
+         !irq_access_permitted(current->domain, pirq))
         return -EPERM;
 
     if ( pirq < 0 || pirq >= d->nr_pirqs || irq < 0 || irq >= nr_irqs )
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index ab94b02..e66c79d 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4508,9 +4508,6 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         XEN_GUEST_HANDLE_PARAM(e820entry_t) buffer_param;
         unsigned int i;
 
-        if ( !IS_PRIV(current->domain) )
-            return -EINVAL;
-
         rc = xsm_machine_memory_map();
         if ( rc )
             return rc;
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 2928f1c..9c30245 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -109,12 +109,6 @@ int physdev_map_pirq(domid_t domid, int type, int *index, int *pirq_p,
     if ( ret )
         return ret;
 
-    if ( !IS_PRIV_FOR(current->domain, d) )
-    {
-        ret = -EPERM;
-        goto free_domain;
-    }
-
     /* Verify or get irq. */
     switch ( type )
     {
@@ -238,10 +232,6 @@ int physdev_unmap_pirq(domid_t domid, int pirq)
             goto free_domain;
     }
 
-    ret = -EPERM;
-    if ( !IS_PRIV_FOR(current->domain, d) )
-        goto free_domain;
-
     ret = xsm_unmap_domain_pirq(d, domain_pirq_to_irq(d, pirq));
     if ( ret )
         goto free_domain;
@@ -433,9 +423,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
         ret = xsm_apic(v->domain, cmd);
         if ( ret )
             break;
@@ -450,9 +437,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
         ret = xsm_apic(v->domain, cmd);
         if ( ret )
             break;
@@ -467,8 +451,10 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&irq_op, arg, 1) != 0 )
             break;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
+        /* Use the APIC check since this dummy hypercall should still only
+         * be called by the domain with access to program the ioapic */
+        ret = xsm_apic(v->domain, cmd);
+        if ( ret )
             break;
 
         /* Vector is only used by hypervisor, and dom0 shouldn't
@@ -517,9 +503,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     case PHYSDEVOP_manage_pci_add: {
         struct physdev_manage_pci manage_pci;
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
         ret = -EFAULT;
         if ( copy_from_guest(&manage_pci, arg, 1) != 0 )
             break;
@@ -530,9 +513,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     case PHYSDEVOP_manage_pci_remove: {
         struct physdev_manage_pci manage_pci;
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
         ret = -EFAULT;
         if ( copy_from_guest(&manage_pci, arg, 1) != 0 )
             break;
@@ -545,10 +525,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct physdev_manage_pci_ext manage_pci_ext;
         struct pci_dev_info pdev_info;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(current->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&manage_pci_ext, arg, 1) != 0 )
             break;
@@ -571,10 +547,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct physdev_pci_device_add add;
         struct pci_dev_info pdev_info;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(current->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&add, arg, 1) != 0 )
             break;
@@ -595,10 +567,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_pci_device_remove: {
         struct physdev_pci_device dev;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&dev, arg, 1) != 0 )
             break;
@@ -610,10 +578,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_pci_mmcfg_reserved: {
         struct physdev_pci_mmcfg_reserved info;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(current->domain) )
-            break;
-
         ret = xsm_resource_setup_misc();
         if ( ret )
             break;
@@ -631,10 +595,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct physdev_restore_msi restore_msi;
         struct pci_dev *pdev;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&restore_msi, arg, 1) != 0 )
             break;
@@ -650,10 +610,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct physdev_pci_device dev;
         struct pci_dev *pdev;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&dev, arg, 1) != 0 )
             break;
@@ -668,10 +624,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_setup_gsi: {
         struct physdev_setup_gsi setup_gsi;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&setup_gsi, arg, 1) != 0 )
             break;
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 25ebd6a..d4f6332 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -852,9 +852,6 @@ static int do_kexec_op_internal(unsigned long op,
     unsigned long flags;
     int ret = -EINVAL;
 
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-
     ret = xsm_kexec();
     if ( ret )
         return ret;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 231e097..cfd173d 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -921,12 +921,6 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             break;
 
-        if ( !IS_PRIV_FOR(current->domain, d) )
-        {
-            rcu_unlock_domain(d);
-            return -EPERM;
-        }
-
         ret = xsm_schedop_shutdown(current->domain, d);
         if ( ret )
         {
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index ff360fe..b2c3ee3 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -406,12 +406,6 @@ long do_console_io(int cmd, int count, XEN_GUEST_HANDLE_PARAM(char) buffer)
     long rc;
     unsigned int idx, len;
 
-#ifndef VERBOSE
-    /* Only domain 0 may access the emergency console. */
-    if ( current->domain->domain_id != 0 )
-        return -EPERM;
-#endif
-
     rc = xsm_console_io(current->domain, cmd);
     if ( rc )
         return rc;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 4384552..fb00a01 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -161,6 +161,8 @@ static XSM_INLINE int xsm_pm_op(void)
 
 static XSM_INLINE int xsm_do_mca(void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
@@ -223,6 +225,10 @@ static XSM_INLINE int xsm_memory_stat_reservation(struct domain *d1, struct doma
 
 static XSM_INLINE int xsm_console_io(struct domain *d, int cmd)
 {
+#ifndef VERBOSE
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+#endif
     return 0;
 }
 
@@ -233,11 +239,15 @@ static XSM_INLINE int xsm_profile(struct domain *d, int op)
 
 static XSM_INLINE int xsm_kexec(void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_schedop_shutdown(struct domain *d1, struct domain *d2)
 {
+    if ( !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
@@ -336,26 +346,36 @@ static XSM_INLINE int xsm_resource_unplug_core(void)
 
 static XSM_INLINE int xsm_resource_plug_pci(uint32_t machine_bdf)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_resource_unplug_pci(uint32_t machine_bdf)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_resource_setup_pci(uint32_t machine_bdf)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_resource_setup_gsi(int gsi)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_resource_setup_misc(void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
@@ -396,6 +416,8 @@ static XSM_INLINE int xsm_map_domain_pirq(struct domain *d, int irq, void *data)
 
 static XSM_INLINE int xsm_unmap_domain_pirq(struct domain *d, int irq)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
@@ -494,6 +516,8 @@ static XSM_INLINE int xsm_mem_sharing(struct domain *d)
 
 static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
 {
+    if ( !IS_PRIV(d) )
+        return -EPERM;
     return 0;
 }
 
@@ -534,6 +558,8 @@ static XSM_INLINE int xsm_efi_call(void)
 
 static XSM_INLINE int xsm_acpi_sleep(void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
@@ -549,6 +575,8 @@ static XSM_INLINE int xsm_getidletime(void)
 
 static XSM_INLINE int xsm_machine_memory_map(void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 31572c5..cb8cf96 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1147,10 +1147,11 @@ static int flask_apic(struct domain *d, int cmd)
 
     switch ( cmd )
     {
-    case PHYSDEVOP_APIC_READ:
+    case PHYSDEVOP_apic_read:
+    case PHYSDEVOP_alloc_irq_vector:
         perm = XEN__READAPIC;
         break;
-    case PHYSDEVOP_APIC_WRITE:
+    case PHYSDEVOP_apic_write:
         perm = XEN__WRITEAPIC;
         break;
     default:
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSeq-0002Pu-Ap; Fri, 30 Nov 2012 15:37:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSen-0002Mx-54
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:37 +0000
Received: from [85.158.139.211:63870] by server-8.bemta-5.messagelabs.com id
	46/3A-06050-0C2D8B05; Fri, 30 Nov 2012 15:37:36 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-206.messagelabs.com!1354289854!18505841!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15570 invoked from network); 30 Nov 2012 15:37:35 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-14.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:35 -0000
X-TM-IMSS-Message-ID: <339220e700027abb@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 339220e700027abb ;
	Fri, 30 Nov 2012 10:36:27 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd9017785; 
	Fri, 30 Nov 2012 10:37:33 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:03 -0500
Message-Id: <1354289830-24642-17-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 16/23] xen: Add XSM hook for XENMEM_exchange
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
---
 tools/flask/policy/policy/flask/access_vectors |  1 +
 tools/flask/policy/policy/modules/xen/xen.if   |  2 ++
 xen/common/memory.c                            | 12 +++++++++++-
 xen/include/xsm/dummy.h                        |  7 +++++++
 xen/include/xsm/xsm.h                          |  6 ++++++
 xen/xsm/dummy.c                                |  1 +
 xen/xsm/flask/hooks.c                          |  6 ++++++
 xen/xsm/flask/include/av_perm_to_string.h      |  1 +
 xen/xsm/flask/include/av_permissions.h         |  1 +
 9 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index 8324725..caf65d2 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -142,6 +142,7 @@ class mmu
     memorymap
     remote_remap
 	mmuext_op
+	exchange
 }
 
 class shadow
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index fda5cb5..d9d5344 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -30,6 +30,7 @@ define(`declare_domain', `
 #   containing at most one domain. This is not enforced by policy.
 define(`declare_singleton_domain', `
 	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
+	define(`$1_self', `$1')
 	type $1_channel, event_type;
 	type_transition $1 domain_type:event $1_channel;
 	declare_domain_common($1, $1)
@@ -161,6 +162,7 @@ define(`make_device_model', `
 # use_device(domain, device)
 #   Allow a device to be used by a domain
 define(`use_device', `
+    allow $1 $1_self:mmu exchange;
     allow $1 $2:resource use;
     allow $1 domio_t:mmu { map_read map_write };
 ')
diff --git a/xen/common/memory.c b/xen/common/memory.c
index dd36b83..7d3c326 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -329,9 +329,19 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
         out_chunk_order = exch.in.extent_order - exch.out.extent_order;
     }
 
-    rc = rcu_lock_target_domain_by_id(exch.in.domid, &d);
+    d = rcu_lock_domain_by_any_id(exch.in.domid);
+    if ( d == NULL )
+    {
+        rc = -ESRCH;
+        goto fail_early;
+    }
+
+    rc = xsm_memory_exchange(d);
     if ( rc )
+    {
+        rcu_unlock_domain(d);
         goto fail_early;
+    }
 
     memflags |= MEMF_bits(domain_clamp_alloc_bitsize(
         d,
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 6648739..9894d8d 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -235,6 +235,13 @@ static XSM_INLINE int xsm_grant_query_size(struct domain *d1, struct domain *d2)
     return 0;
 }
 
+static XSM_INLINE int xsm_memory_exchange(struct domain *d)
+{
+    if ( d != current->domain && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
                                                             struct domain *d2)
 {
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index d41eb54..a8c1d87 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -96,6 +96,7 @@ struct xsm_operations {
 
     int (*get_pod_target) (struct domain *d);
     int (*set_pod_target) (struct domain *d);
+    int (*memory_exchange) (struct domain *d);
     int (*memory_adjust_reservation) (struct domain *d1, struct domain *d2);
     int (*memory_stat_reservation) (struct domain *d1, struct domain *d2);
     int (*memory_pin_page) (struct domain *d1, struct domain *d2, struct page_info *page);
@@ -453,6 +454,11 @@ static inline int xsm_set_pod_target (struct domain *d)
     return xsm_ops->set_pod_target(d);
 }
 
+static inline int xsm_memory_exchange (struct domain *d)
+{
+    return xsm_ops->memory_exchange(d);
+}
+
 static inline int xsm_memory_adjust_reservation (struct domain *d1, struct
                                                                     domain *d2)
 {
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 200cbc8..71299d5 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -84,6 +84,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, get_pod_target);
     set_to_dummy_if_null(ops, set_pod_target);
 
+    set_to_dummy_if_null(ops, memory_exchange);
     set_to_dummy_if_null(ops, memory_adjust_reservation);
     set_to_dummy_if_null(ops, memory_stat_reservation);
     set_to_dummy_if_null(ops, memory_pin_page);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index b2f00d8..167f8e6 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -396,6 +396,11 @@ static int flask_set_pod_target(struct domain *d)
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETPODTARGET);
 }
 
+static int flask_memory_exchange(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_MMU, MMU__EXCHANGE);
+}
+
 static int flask_memory_adjust_reservation(struct domain *d1, struct domain *d2)
 {
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__ADJUST);
@@ -1685,6 +1690,7 @@ static struct xsm_operations flask_ops = {
 
     .get_pod_target = flask_get_pod_target,
     .set_pod_target = flask_set_pod_target,
+    .memory_exchange = flask_memory_exchange,
     .memory_adjust_reservation = flask_memory_adjust_reservation,
     .memory_stat_reservation = flask_memory_stat_reservation,
     .memory_pin_page = flask_memory_pin_page,
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 8f65b96..79d5939 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -112,6 +112,7 @@
    S_(SECCLASS_MMU, MMU__MEMORYMAP, "memorymap")
    S_(SECCLASS_MMU, MMU__REMOTE_REMAP, "remote_remap")
    S_(SECCLASS_MMU, MMU__MMUEXT_OP, "mmuext_op")
+   S_(SECCLASS_MMU, MMU__EXCHANGE, "exchange")
    S_(SECCLASS_SHADOW, SHADOW__DISABLE, "disable")
    S_(SECCLASS_SHADOW, SHADOW__ENABLE, "enable")
    S_(SECCLASS_SHADOW, SHADOW__LOGDIRTY, "logdirty")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index 18454fd..d982328 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -118,6 +118,7 @@
 #define MMU__MEMORYMAP                            0x00000800UL
 #define MMU__REMOTE_REMAP                         0x00001000UL
 #define MMU__MMUEXT_OP                            0x00002000UL
+#define MMU__EXCHANGE                             0x00004000UL
 
 #define SHADOW__DISABLE                           0x00000001UL
 #define SHADOW__ENABLE                            0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSes-0002ST-KZ; Fri, 30 Nov 2012 15:37:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSeo-0002OB-UN
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:39 +0000
Received: from [85.158.139.211:58161] by server-15.bemta-5.messagelabs.com id
	BD/8B-26920-2C2D8B05; Fri, 30 Nov 2012 15:37:38 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-3.tower-206.messagelabs.com!1354289854!18565538!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21570 invoked from network); 30 Nov 2012 15:37:35 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-3.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:35 -0000
X-TM-IMSS-Message-ID: <33921d8d00027ab8@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 33921d8d00027ab8 ;
	Fri, 30 Nov 2012 10:36:26 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd6017785; 
	Fri, 30 Nov 2012 10:37:32 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:00 -0500
Message-Id: <1354289830-24642-14-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: [Xen-devel] [PATCH 13/23] xsm/flask: add distinct SIDs for
	self/target access
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Because the FLASK XSM module no longer checks IS_PRIV for remote domain
accesses covered by XSM permissions, domains now have the ability to
perform memory management and other functions on all domains that have
the same type. While it is possible to prevent this by only creating one
domain per type, this solution significantly limits the flexibility of
the type system.

This patch introduces a domain type transition to represent a domain
that is operating on itself. In the example policy, this is demonstrated
by creating a type with _self appended when declaring a domain type
which will be used for reflexive operations. AVCs for a domain of type
domU_t will look like the following:

scontext=system_u:system_r:domU_t tcontext=system_u:system_r:domU_t_self

This change also allows policy to distinguish between event channels a
domain creates to itself and event channels created between domains of
the same type.

The IS_PRIV_FOR check used for device model domains is also no longer
checked by FLASK; a similar transition is performed when the target is
set and used when the device model accesses its target domain.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 docs/misc/xsm-flask.txt                      |  43 ++-
 tools/flask/policy/policy/modules/xen/xen.if |  60 +++-
 tools/flask/policy/policy/modules/xen/xen.te |  13 +-
 xen/xsm/flask/flask_op.c                     |   9 +
 xen/xsm/flask/hooks.c                        | 422 +++++++++++++--------------
 xen/xsm/flask/include/objsec.h               |   2 +
 6 files changed, 307 insertions(+), 242 deletions(-)

diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index 0778a28..ff81b01 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -68,9 +68,43 @@ HVM domains with stubdomain device models use two types (one per domain):
  - dm_dom_t is the device model for a domain with type domHVM_t
 
 One disadvantage of using type enforcement to enforce isolation is that a new
-type is needed for each group of domains. In addition, it is not possible to
-allow isolated_domU_t cannot to create loopback event channels without allowing
-two domains of type isolated_domU_t to communicate with one another.
+type is needed for each group of domains. The user field can be used to address
+this for the most common case of groups that can communicate internally but not
+externally; see "Users and roles" below.
+
+Type transitions
+----------------
+
+Xen defines a number of operations such as memory mapping that are necessary for
+a domain to perform on itself, but are also undesirable to allow a domain to
+perform on every other domain of the same label. While it is possible to address
+this by only creating one domain per type, this solution significantly limits
+the flexibility of the type system. Another method to address this issue is to
+duplicate the permission names for every operation that can be performed on the
+current domain or on other domains; however, this significantly increases the
+necessary number of permissions and complicates the XSM hooks. Instead, this is
+addressed by allowing a distinct type to be used for a domain's access to
+itself. The same applies for a device model domain's access to its designated
+target, allowing the IS_PRIV_FOR checks used in Xen's DAC model to be
+implemented in FLASK.
+
+Upon domain creation (or relabel), a type transition is computed using the
+domain's label as the source and target. The result of this computation is used
+as the target when the domain accesses itself. In the example policy, this
+computed type is the result of appending _self to a domain's type: domU_t_self
+for domU_t. If no type transition rule exists, the domain will continue to use
+its own label for both the source and target. An AVC message will look like:
+
+    scontext=system_u:system_r:domU_t tcontext=system_u:system_r:domU_t_self
+
+A similar type transition is done when a device model domain is associated with
+its target using the set_target operation. The transition is computed with the
+target domain as the source and the device model domain as the target: this
+ordering was chosen in order to preserve the original label for the target when
+no type transition rule exists. In the example policy, these computed types are
+the result of appending _target to the domain.
+
+Type transitions are also used to compute the labels of event channels.
 
 Users and roles
 ---------------
@@ -84,7 +118,8 @@ the customer_1 user.
 Access control rules involving users and roles are defined in the policy
 constraints file (tools/flask/policy/policy/constraints). The example policy
 provides constraints that prevent different users from communicating using
-grants or event channels, while still allowing communication with dom0.
+grants or event channels, while still allowing communication with the system_u
+user where dom0 resides.
 
 Resource Policy
 ---------------
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 59ba171..d630f47 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -5,15 +5,34 @@
 # Domain creation and setup
 #
 ################################################################################
+define(`declare_domain_common', `
+	allow $1 $2:grant { query setup };
+	allow $1 $2:mmu { adjust physmap map_read map_write stat pinpage updatemp };
+	allow $1 $2:hvm { getparam setparam };
+')
+
 # declare_domain(type, attrs...)
-#   Declare a type as a domain type, and allow basic domain setup
+#   Declare a domain type, along with associated _self and _channel types
+#   Allow the domain to perform basic operations on itself
 define(`declare_domain', `
 	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
+	type $1_self, domain_type, domain_self_type;
+	type_transition $1 $1:domain $1_self;
+	type $1_channel, event_type;
+	type_transition $1 domain_type:event $1_channel;
+	declare_domain_common($1, $1_self)
+')
+
+# declare_singleton_domain(type, attrs...)
+#   Declare a domain type and associated _channel types.
+#   Note: Because the domain can perform basic operations on itself and any
+#   other domain of the same type, this constructor should be used for types
+#   containing at most one domain. This is not enforced by policy.
+define(`declare_singleton_domain', `
+	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
 	type $1_channel, event_type;
 	type_transition $1 domain_type:event $1_channel;
-	allow $1 $1:grant { query setup };
-	allow $1 $1:mmu { adjust physmap map_read map_write stat pinpage };
-	allow $1 $1:hvm { getparam setparam };
+	declare_domain_common($1, $1)
 ')
 
 # declare_build_label(type)
@@ -51,6 +70,7 @@ define(`create_domain_build_label', `
 	allow $1 $2_channel:event create;
 	allow $1 $2_building:domain2 relabelfrom;
 	allow $1 $2:domain2 relabelto;
+	allow $2_building $2:domain transition;
 ')
 
 # manage_domain(priv, target)
@@ -101,20 +121,36 @@ define(`domain_comms', `
 ')
 
 # domain_self_comms(domain)
-#   Allow a domain types to communicate with others of its type using grants
-#   and event channels (this includes event channels to DOMID_SELF)
+#   Allow a non-singleton domain type to communicate with itself using grants
+#   and event channels
 define(`domain_self_comms', `
-	create_channel($1, $1, $1_channel)
-	allow $1 $1:grant { map_read map_write copy unmap };
+	create_channel($1, $1_self, $1_channel)
+	allow $1 $1_self:grant { map_read map_write copy unmap };
 ')
 
 # device_model(dm_dom, hvm_dom)
 #   Define how a device model domain interacts with its target
 define(`device_model', `
-	domain_comms($1, $2)
-	allow $1 $2:domain { set_target shutdown };
-	allow $1 $2:mmu { map_read map_write adjust physmap };
-	allow $1 $2:hvm { getparam setparam trackdirtyvram hvmctl irqlevel pciroute cacheattr send_irq };
+	type $2_target, domain_type, domain_target_type;
+	type_transition $2 $1:domain $2_target;
+	allow $1 $2:domain set_target;
+
+	type_transition $2_target domain_type:event $2_channel;
+	create_channel($1, $2_target, $1_channel)
+	create_channel($2, $1, $2_channel)
+	allow $1 $2_channel:event create;
+
+	allow $1 $2_target:domain shutdown;
+	allow $1 $2_target:mmu { map_read map_write adjust physmap };
+	allow $1 $2_target:hvm { getparam setparam trackdirtyvram hvmctl irqlevel pciroute cacheattr send_irq };
+')
+
+# make_device_model(priv, dm_dom, hvm_dom)
+#   Allow creation of a device model and HVM domain pair
+define(`make_device_model', `
+	device_model($2, $3)
+	allow $1 $2:domain2 make_priv_for;
+	allow $1 $3:domain2 set_as_target;
 ')
 ################################################################################
 #
diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
index 1162153..8d33285 100644
--- a/tools/flask/policy/policy/modules/xen/xen.te
+++ b/tools/flask/policy/policy/modules/xen/xen.te
@@ -8,6 +8,8 @@
 ################################################################################
 attribute xen_type;
 attribute domain_type;
+attribute domain_self_type;
+attribute domain_target_type;
 attribute resource_type;
 attribute event_type;
 attribute mls_priv;
@@ -25,7 +27,7 @@ attribute mls_priv;
 type xen_t, xen_type, mls_priv;
 
 # Domain 0
-declare_domain(dom0_t, mls_priv);
+declare_singleton_domain(dom0_t, mls_priv);
 
 # Untracked I/O memory (pseudo-domain)
 type domio_t, xen_type;
@@ -69,7 +71,7 @@ admin_device(dom0_t, ioport_t)
 admin_device(dom0_t, iomem_t)
 allow dom0_t domio_t:mmu { map_read map_write };
 
-domain_self_comms(dom0_t)
+domain_comms(dom0_t, dom0_t)
 
 auditallow dom0_t security_t:security { load_policy setenforce setbool };
 
@@ -84,11 +86,14 @@ domain_self_comms(domU_t)
 create_domain(dom0_t, domU_t)
 manage_domain(dom0_t, domU_t)
 domain_comms(dom0_t, domU_t)
+domain_comms(domU_t, domU_t)
+domain_self_comms(domU_t)
 
 declare_domain(isolated_domU_t)
 create_domain(dom0_t, isolated_domU_t)
 manage_domain(dom0_t, isolated_domU_t)
 domain_comms(dom0_t, isolated_domU_t)
+domain_self_comms(isolated_domU_t)
 
 # Declare a boolean that denies creation of prot_domU_t domains
 gen_bool(prot_doms_locked, false)
@@ -98,6 +103,8 @@ if (!prot_doms_locked) {
 }
 domain_comms(dom0_t, prot_domU_t)
 domain_comms(domU_t, prot_domU_t)
+domain_comms(prot_domU_t, prot_domU_t)
+domain_self_comms(prot_domU_t)
 
 # domHVM_t is meant to be paired with a qemu-dm stub domain of type dm_dom_t
 declare_domain(domHVM_t)
@@ -110,7 +117,7 @@ declare_domain(dm_dom_t)
 create_domain(dom0_t, dm_dom_t)
 manage_domain(dom0_t, dm_dom_t)
 domain_comms(dom0_t, dm_dom_t)
-device_model(dm_dom_t, domHVM_t)
+make_device_model(dom0_t, dm_dom_t, domHVM_t)
 
 # nomigrate_t must be built via the nomigrate_t_building label; once built,
 # dom0 cannot read its memory.
diff --git a/xen/xsm/flask/flask_op.c b/xen/xsm/flask/flask_op.c
index a5d7748..4426ab9 100644
--- a/xen/xsm/flask/flask_op.c
+++ b/xen/xsm/flask/flask_op.c
@@ -612,6 +612,15 @@ static int flask_relabel_domain(struct xen_flask_relabel *arg)
         goto out;
 
     dsec->sid = arg->sid;
+    dsec->self_sid = arg->sid;
+    security_transition_sid(dsec->sid, dsec->sid, SECCLASS_DOMAIN,
+                            &dsec->self_sid);
+    if ( d->target )
+    {
+        struct domain_security_struct *tsec = d->target->ssid;
+        security_transition_sid(tsec->sid, dsec->sid, SECCLASS_DOMAIN,
+                                &dsec->target_sid);
+    }
 
  out:
     rcu_unlock_domain(d);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index dbbf34f..a8475ea 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -33,38 +33,69 @@
 
 struct xsm_operations *original_ops = NULL;
 
+static u32 domain_sid(struct domain *dom)
+{
+    struct domain_security_struct *dsec = dom->ssid;
+    return dsec->sid;
+}
+
+static u32 domain_target_sid(struct domain *src, struct domain *dst)
+{
+    struct domain_security_struct *ssec = src->ssid;
+    struct domain_security_struct *dsec = dst->ssid;
+    if (src == dst)
+        return ssec->self_sid;
+    if (src->target == dst)
+        return ssec->target_sid;
+    return dsec->sid;
+}
+
+static u32 evtchn_sid(const struct evtchn *chn)
+{
+    struct evtchn_security_struct *esec = chn->ssid;
+    return esec->sid;
+}
+
 static int domain_has_perm(struct domain *dom1, struct domain *dom2, 
                            u16 class, u32 perms)
 {
-    struct domain_security_struct *dsec1, *dsec2;
+    u32 ssid, tsid;
     struct avc_audit_data ad;
     AVC_AUDIT_DATA_INIT(&ad, NONE);
     ad.sdom = dom1;
     ad.tdom = dom2;
 
-    dsec1 = dom1->ssid;
-    dsec2 = dom2->ssid;
+    ssid = domain_sid(dom1);
+    tsid = domain_target_sid(dom1, dom2);
 
-    return avc_has_perm(dsec1->sid, dsec2->sid, class, perms, &ad);
+    return avc_has_perm(ssid, tsid, class, perms, &ad);
 }
 
-static int domain_has_evtchn(struct domain *d, struct evtchn *chn, u32 perms)
+static int avc_current_has_perm(u32 tsid, u16 class, u32 perm,
+                                struct avc_audit_data *ad)
 {
-    struct domain_security_struct *dsec;
-    struct evtchn_security_struct *esec;
+    u32 csid = domain_sid(current->domain);
+    return avc_has_perm(csid, tsid, class, perm, ad);
+}
 
-    dsec = d->ssid;
-    esec = chn->ssid;
+static int current_has_perm(struct domain *d, u16 class, u32 perms)
+{
+    return domain_has_perm(current->domain, d, class, perms);
+}
 
-    return avc_has_perm(dsec->sid, esec->sid, SECCLASS_EVENT, perms, NULL);
+static int domain_has_evtchn(struct domain *d, struct evtchn *chn, u32 perms)
+{
+    u32 dsid = domain_sid(d);
+    u32 esid = evtchn_sid(chn);
+
+    return avc_has_perm(dsid, esid, SECCLASS_EVENT, perms, NULL);
 }
 
 static int domain_has_xen(struct domain *d, u32 perms)
 {
-    struct domain_security_struct *dsec;
-    dsec = d->ssid;
+    u32 dsid = domain_sid(d);
 
-    return avc_has_perm(dsec->sid, SECINITSID_XEN, SECCLASS_XEN, perms, NULL);
+    return avc_has_perm(dsid, SECINITSID_XEN, SECCLASS_XEN, perms, NULL);
 }
 
 static int get_irq_sid(int irq, u32 *sid, struct avc_audit_data *ad)
@@ -123,6 +154,7 @@ static int flask_domain_alloc_security(struct domain *d)
         dsec->sid = SECINITSID_UNLABELED;
     }
 
+    dsec->self_sid = dsec->sid;
     d->ssid = dsec;
 
     return 0;
@@ -142,68 +174,55 @@ static void flask_domain_free_security(struct domain *d)
 static int flask_evtchn_unbound(struct domain *d1, struct evtchn *chn, 
                                 domid_t id2)
 {
-    u32 newsid;
+    u32 sid1, sid2, newsid;
     int rc;
-    domid_t id;
     struct domain *d2;
-    struct domain_security_struct *dsec, *dsec1, *dsec2;
     struct evtchn_security_struct *esec;
 
-    dsec = current->domain->ssid;
-    dsec1 = d1->ssid;
-    esec = chn->ssid;
-
-    if ( id2 == DOMID_SELF )
-        id = current->domain->domain_id;
-    else
-        id = id2;
-
-    d2 = get_domain_by_id(id);
+    d2 = rcu_lock_domain_by_any_id(id2);
     if ( d2 == NULL )
         return -EPERM;
 
-    dsec2 = d2->ssid;
-    rc = security_transition_sid(dsec1->sid, dsec2->sid, SECCLASS_EVENT, 
-                                 &newsid);
+    sid1 = domain_sid(d1);
+    sid2 = domain_target_sid(d1, d2);
+    esec = chn->ssid;
+
+    rc = security_transition_sid(sid1, sid2, SECCLASS_EVENT, &newsid);
     if ( rc )
         goto out;
 
-    rc = avc_has_perm(dsec->sid, newsid, SECCLASS_EVENT, EVENT__CREATE, NULL);
+    rc = avc_current_has_perm(newsid, SECCLASS_EVENT, EVENT__CREATE, NULL);
     if ( rc )
         goto out;
 
-    rc = avc_has_perm(newsid, dsec2->sid, SECCLASS_EVENT, EVENT__BIND, NULL);
+    rc = avc_has_perm(newsid, sid2, SECCLASS_EVENT, EVENT__BIND, NULL);
     if ( rc )
         goto out;
-    else
-        esec->sid = newsid;
+
+    esec->sid = newsid;
 
  out:
-    put_domain(d2);
+    rcu_unlock_domain(d2);
     return rc;
 }
 
 static int flask_evtchn_interdomain(struct domain *d1, struct evtchn *chn1, 
                                     struct domain *d2, struct evtchn *chn2)
 {
-    u32 newsid;
+    u32 sid1, sid2, newsid, reverse_sid;
     int rc;
-    struct domain_security_struct *dsec, *dsec1, *dsec2;
-    struct evtchn_security_struct *esec1, *esec2;
+    struct evtchn_security_struct *esec1;
     struct avc_audit_data ad;
     AVC_AUDIT_DATA_INIT(&ad, NONE);
     ad.sdom = d1;
     ad.tdom = d2;
 
-    dsec = current->domain->ssid;
-    dsec1 = d1->ssid;
-    dsec2 = d2->ssid;
+    sid1 = domain_sid(d1);
+    sid2 = domain_target_sid(d1, d2);
 
     esec1 = chn1->ssid;
-    esec2 = chn2->ssid;
 
-    rc = security_transition_sid(dsec1->sid, dsec2->sid, 
-                                 SECCLASS_EVENT, &newsid);
+    rc = security_transition_sid(sid1, sid2, SECCLASS_EVENT, &newsid);
     if ( rc )
     {
         printk("%s: security_transition_sid failed, rc=%d (domain=%d)\n",
@@ -211,15 +230,20 @@ static int flask_evtchn_interdomain(struct domain *d1, struct evtchn *chn1,
         return rc;
     }
 
-    rc = avc_has_perm(dsec->sid, newsid, SECCLASS_EVENT, EVENT__CREATE, &ad);
+    rc = avc_current_has_perm(newsid, SECCLASS_EVENT, EVENT__CREATE, &ad);
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(newsid, dsec2->sid, SECCLASS_EVENT, EVENT__BIND, &ad);
+    rc = avc_has_perm(newsid, sid2, SECCLASS_EVENT, EVENT__BIND, &ad);
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(esec2->sid, dsec1->sid, SECCLASS_EVENT, EVENT__BIND, &ad);
+    /* It's possible the target domain has changed (relabel or destroy/create)
+     * since the unbound part was created; re-validate this binding now.
+     */
+    reverse_sid = evtchn_sid(chn2);
+    sid1 = domain_target_sid(d2, d1);
+    rc = avc_has_perm(reverse_sid, sid1, SECCLASS_EVENT, EVENT__BIND, &ad);
     if ( rc )
         return rc;
 
@@ -302,7 +326,6 @@ static void flask_free_security_evtchn(struct evtchn *chn)
 
 static char *flask_show_security_evtchn(struct domain *d, const struct evtchn *chn)
 {
-    struct evtchn_security_struct *esec;
     int irq;
     u32 sid = 0;
     char *ctx;
@@ -312,9 +335,7 @@ static char *flask_show_security_evtchn(struct domain *d, const struct evtchn *c
     {
     case ECS_UNBOUND:
     case ECS_INTERDOMAIN:
-        esec = chn->ssid;
-        if ( esec )
-            sid = esec->sid;
+        sid = evtchn_sid(chn);
         break;
     case ECS_PIRQ:
         irq = domain_pirq_to_irq(d, chn->u.pirq.irq);
@@ -367,12 +388,12 @@ static int flask_grant_query_size(struct domain *d1, struct domain *d2)
 
 static int flask_get_pod_target(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__GETPODTARGET);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETPODTARGET);
 }
 
 static int flask_set_pod_target(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SETPODTARGET);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETPODTARGET);
 }
 
 static int flask_memory_adjust_reservation(struct domain *d1, struct domain *d2)
@@ -455,70 +476,65 @@ static int flask_schedop_shutdown(struct domain *d1, struct domain *d2)
 static void flask_security_domaininfo(struct domain *d, 
                                       struct xen_domctl_getdomaininfo *info)
 {
-    struct domain_security_struct *dsec;
-
-    dsec = d->ssid;
-    info->ssidref = dsec->sid;
+    info->ssidref = domain_sid(d);
 }
 
 static int flask_setvcpucontext(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__SETVCPUCONTEXT);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT);
 }
 
 static int flask_pausedomain(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
 }
 
 static int flask_unpausedomain(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
 }
 
 static int flask_resumedomain(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__RESUME);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__RESUME);
 }
 
 static int flask_domain_create(struct domain *d, u32 ssidref)
 {
     int rc;
-    struct domain_security_struct *dsec1;
-    struct domain_security_struct *dsec2;
+    struct domain_security_struct *dsec = d->ssid;
     static int dom0_created = 0;
 
-    dsec1 = current->domain->ssid;
-    dsec2 = d->ssid;
-
     if ( is_idle_domain(current->domain) && !dom0_created )
     {
-        dsec2->sid = SECINITSID_DOM0;
+        dsec->sid = SECINITSID_DOM0;
         dom0_created = 1;
-        return 0;
     }
+    else
+    {
+        rc = avc_current_has_perm(ssidref, SECCLASS_DOMAIN,
+                          DOMAIN__CREATE, NULL);
+        if ( rc )
+            return rc;
 
-    rc = avc_has_perm(dsec1->sid, ssidref, SECCLASS_DOMAIN,
-                      DOMAIN__CREATE, NULL);
-    if ( rc )
-        return rc;
+        dsec->sid = ssidref;
+    }
+    dsec->self_sid = dsec->sid;
 
-    dsec2->sid = ssidref;
+    rc = security_transition_sid(dsec->sid, dsec->sid, SECCLASS_DOMAIN,
+                                 &dsec->self_sid);
 
     return rc;
 }
 
 static int flask_max_vcpus(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__MAX_VCPUS);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS);
 }
 
 static int flask_destroydomain(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__DESTROY);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__DESTROY);
 }
 
 static int flask_vcpuaffinity(int cmd, struct domain *d)
@@ -537,7 +553,7 @@ static int flask_vcpuaffinity(int cmd, struct domain *d)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm );
+    return current_has_perm(d, SECCLASS_DOMAIN, perm );
 }
 
 static int flask_scheduler(struct domain *d)
@@ -548,43 +564,51 @@ static int flask_scheduler(struct domain *d)
     if ( rc )
         return rc;
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__SCHEDULER);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SCHEDULER);
 }
 
 static int flask_getdomaininfo(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__GETDOMAININFO);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO);
 }
 
 static int flask_getvcpucontext(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__GETVCPUCONTEXT);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT);
 }
 
 static int flask_getvcpuinfo(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__GETVCPUINFO);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO);
 }
 
 static int flask_domain_settime(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
 }
 
-static int flask_set_target(struct domain *d, struct domain *e)
+static int flask_set_target(struct domain *d, struct domain *t)
 {
     int rc;
-    rc = domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR);
+    struct domain_security_struct *dsec, *tsec;
+    dsec = d->ssid;
+    tsec = t->ssid;
+
+    rc = current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR);
     if ( rc )
         return rc;
-    rc = domain_has_perm(current->domain, e, SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET);
+    rc = current_has_perm(t, SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET);
     if ( rc )
         return rc;
-    return domain_has_perm(d, e, SECCLASS_DOMAIN, DOMAIN__SET_TARGET);
+    /* Use avc_has_perm to avoid resolving target/current SID */
+    rc = avc_has_perm(dsec->sid, tsec->sid, SECCLASS_DOMAIN, DOMAIN__SET_TARGET, NULL);
+    if ( rc )
+        return rc;
+
+    /* (tsec, dsec) defaults the label to tsec, as it should here */
+    rc = security_transition_sid(tsec->sid, dsec->sid, SECCLASS_DOMAIN,
+                                 &dsec->target_sid);
+    return rc;
 }
 
 static int flask_domctl(struct domain *d, int cmd)
@@ -655,26 +679,24 @@ static int flask_domctl(struct domain *d, int cmd)
     case XEN_DOMCTL_gdbsx_pausevcpu:
     case XEN_DOMCTL_gdbsx_unpausevcpu:
     case XEN_DOMCTL_gdbsx_domstatus:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                               DOMAIN__SETDEBUGGING);
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
 
     case XEN_DOMCTL_subscribe:
     case XEN_DOMCTL_disable_migrate:
     case XEN_DOMCTL_suppress_spurious_page_faults:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                               DOMAIN__SET_MISC_INFO);
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO);
 
     case XEN_DOMCTL_set_cpuid:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID);
+        return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID);
 
     case XEN_DOMCTL_gettscinfo:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__GETTSC);
+        return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__GETTSC);
 
     case XEN_DOMCTL_settscinfo:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__SETTSC);
+        return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SETTSC);
 
     case XEN_DOMCTL_audit_p2m:
-        return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__AUDIT_P2M);
+        return current_has_perm(d, SECCLASS_HVM, HVM__AUDIT_P2M);
 
     default:
         printk("flask_domctl: Unknown op %d\n", cmd);
@@ -716,7 +738,7 @@ static int flask_sysctl(int cmd)
 
 static int flask_set_virq_handler(struct domain *d, uint32_t virq)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
 }
 
 static int flask_tbufcontrol(void)
@@ -741,20 +763,17 @@ static int flask_sched_id(void)
 
 static int flask_setdomainmaxmem(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__SETDOMAINMAXMEM);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM);
 }
 
 static int flask_setdomainhandle(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__SETDOMAINHANDLE);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE);
 }
 
 static int flask_setdebugging(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__SETDEBUGGING);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
 }
 
 static int flask_debug_keys(void)
@@ -816,14 +835,12 @@ static char *flask_show_irq_sid (int irq)
 
 static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
 {
-    u32 sid;
+    u32 sid, dsid;
     int rc = -EPERM;
     struct msi_info *msi = data;
-
-    struct domain_security_struct *ssec, *tsec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__ADD);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
 
     if ( rc )
         return rc;
@@ -839,14 +856,13 @@ static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
     if ( rc )
         return rc;
 
-    ssec = current->domain->ssid;
-    tsec = d->ssid;
+    dsid = domain_sid(d);
 
-    rc = avc_has_perm(ssec->sid, sid, SECCLASS_RESOURCE, RESOURCE__ADD_IRQ, &ad);
+    rc = avc_current_has_perm(sid, SECCLASS_RESOURCE, RESOURCE__ADD_IRQ, &ad);
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    rc = avc_has_perm(dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
     return rc;
 }
 
@@ -854,16 +870,12 @@ static int flask_unmap_domain_pirq (struct domain *d, int irq)
 {
     u32 sid;
     int rc = -EPERM;
-
-    struct domain_security_struct *ssec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
     if ( rc )
         return rc;
 
-    ssec = current->domain->ssid;
-
     if ( irq >= nr_irqs_gsi ) {
         /* TODO support for MSI here */
         return 0;
@@ -873,19 +885,19 @@ static int flask_unmap_domain_pirq (struct domain *d, int irq)
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(ssec->sid, sid, SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, &ad);
+    rc = avc_current_has_perm(sid, SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, &ad);
     return rc;
 }
 
 static int flask_irq_permission (struct domain *d, int pirq, uint8_t access)
 {
     /* the PIRQ number is not useful; real IRQ is checked during mapping */
-    return domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
-                           resource_to_perm(access));
+    return current_has_perm(d, SECCLASS_RESOURCE, resource_to_perm(access));
 }
 
 struct iomem_has_perm_data {
-    struct domain_security_struct *ssec, *tsec;
+    u32 ssid;
+    u32 dsid;
     u32 perm;
 };
 
@@ -899,12 +911,12 @@ static int _iomem_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     ad.range.start = start;
     ad.range.end = end;
 
-    rc = avc_has_perm(data->ssec->sid, sid, SECCLASS_RESOURCE, data->perm, &ad);
+    rc = avc_has_perm(data->ssid, sid, SECCLASS_RESOURCE, data->perm, &ad);
 
     if ( rc )
         return rc;
 
-    return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    return avc_has_perm(data->dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
 static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
@@ -912,7 +924,7 @@ static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end
     struct iomem_has_perm_data data;
     int rc;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
+    rc = current_has_perm(d, SECCLASS_RESOURCE,
                          resource_to_perm(access));
     if ( rc )
         return rc;
@@ -922,8 +934,8 @@ static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end
     else
         data.perm = RESOURCE__REMOVE_IOMEM;
 
-    data.ssec = current->domain->ssid;
-    data.tsec = d->ssid;
+    data.ssid = domain_sid(current->domain);
+    data.dsid = domain_sid(d);
 
     return security_iterate_iomem_sids(start, end, _iomem_has_perm, &data);
 }
@@ -935,10 +947,9 @@ static int flask_iomem_mapping(struct domain *d, uint64_t start, uint64_t end, u
 
 static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
-    u32 rsid;
+    u32 dsid, rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
     u32 perm = RESOURCE__USE;
 
     rc = security_device_sid(machine_bdf, &rsid);
@@ -951,33 +962,24 @@ static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, u
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = d->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
+    dsid = domain_sid(d);
+    return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, perm, &ad);
 
 }
 
 static int flask_resource_plug_core(void)
 {
-    struct domain_security_struct *ssec;
-
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__PLUG, NULL);
+    return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__PLUG, NULL);
 }
 
 static int flask_resource_unplug_core(void)
 {
-    struct domain_security_struct *ssec;
-
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__UNPLUG, NULL);
+    return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__UNPLUG, NULL);
 }
 
 static int flask_resource_use_core(void)
 {
-    struct domain_security_struct *ssec;
-
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__USE, NULL);
+    return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__USE, NULL);
 }
 
 static int flask_resource_plug_pci(uint32_t machine_bdf)
@@ -985,7 +987,6 @@ static int flask_resource_plug_pci(uint32_t machine_bdf)
     u32 rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
@@ -993,8 +994,7 @@ static int flask_resource_plug_pci(uint32_t machine_bdf)
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__PLUG, &ad);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__PLUG, &ad);
 }
 
 static int flask_resource_unplug_pci(uint32_t machine_bdf)
@@ -1002,7 +1002,6 @@ static int flask_resource_unplug_pci(uint32_t machine_bdf)
     u32 rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
@@ -1010,8 +1009,7 @@ static int flask_resource_unplug_pci(uint32_t machine_bdf)
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__UNPLUG, &ad);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__UNPLUG, &ad);
 }
 
 static int flask_resource_setup_pci(uint32_t machine_bdf)
@@ -1019,7 +1017,6 @@ static int flask_resource_setup_pci(uint32_t machine_bdf)
     u32 rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
@@ -1027,8 +1024,7 @@ static int flask_resource_setup_pci(uint32_t machine_bdf)
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
 static int flask_resource_setup_gsi(int gsi)
@@ -1036,22 +1032,17 @@ static int flask_resource_setup_gsi(int gsi)
     u32 rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
 
     rc = get_irq_sid(gsi, &rsid, &ad);
     if ( rc )
         return rc;
 
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
 static int flask_resource_setup_misc(void)
 {
-    struct domain_security_struct *ssec;
-
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);
+    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);
 }
 
 static inline int flask_page_offline(uint32_t cmd)
@@ -1114,11 +1105,12 @@ static int flask_shadow_control(struct domain *d, uint32_t op)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_SHADOW, perm);
+    return current_has_perm(d, SECCLASS_SHADOW, perm);
 }
 
 struct ioport_has_perm_data {
-    struct domain_security_struct *ssec, *tsec;
+    u32 ssid;
+    u32 dsid;
     u32 perm;
 };
 
@@ -1132,12 +1124,12 @@ static int _ioport_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     ad.range.start = start;
     ad.range.end = end;
 
-    rc = avc_has_perm(data->ssec->sid, sid, SECCLASS_RESOURCE, data->perm, &ad);
+    rc = avc_has_perm(data->ssid, sid, SECCLASS_RESOURCE, data->perm, &ad);
 
     if ( rc )
         return rc;
 
-    return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    return avc_has_perm(data->dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
 static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
@@ -1145,7 +1137,7 @@ static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t en
     int rc;
     struct ioport_has_perm_data data;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
+    rc = current_has_perm(d, SECCLASS_RESOURCE,
                          resource_to_perm(access));
 
     if ( rc )
@@ -1156,8 +1148,8 @@ static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t en
     else
         data.perm = RESOURCE__REMOVE_IOPORT;
 
-    data.ssec = current->domain->ssid;
-    data.tsec = d->ssid;
+    data.ssid = domain_sid(current->domain);
+    data.dsid = domain_sid(d);
 
     return security_iterate_ioport_sids(start, end, _ioport_has_perm, &data);
 }
@@ -1169,18 +1161,17 @@ static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end,
 
 static int flask_getpageframeinfo(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_MMU, MMU__PAGEINFO);
+    return current_has_perm(d, SECCLASS_MMU, MMU__PAGEINFO);
 }
 
 static int flask_getmemlist(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_MMU, MMU__PAGELIST);
+    return current_has_perm(d, SECCLASS_MMU, MMU__PAGELIST);
 }
 
 static int flask_hypercall_init(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__HYPERCALL);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__HYPERCALL);
 }
 
 static int flask_hvmcontext(struct domain *d, uint32_t cmd)
@@ -1203,7 +1194,7 @@ static int flask_hvmcontext(struct domain *d, uint32_t cmd)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, perm);
+    return current_has_perm(d, SECCLASS_HVM, perm);
 }
 
 static int flask_address_size(struct domain *d, uint32_t cmd)
@@ -1222,7 +1213,7 @@ static int flask_address_size(struct domain *d, uint32_t cmd)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
+    return current_has_perm(d, SECCLASS_DOMAIN, perm);
 }
 
 static int flask_machine_address_size(struct domain *d, uint32_t cmd)
@@ -1263,37 +1254,37 @@ static int flask_hvm_param(struct domain *d, unsigned long op)
         perm = HVM__HVMCTL;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, perm);
+    return current_has_perm(d, SECCLASS_HVM, perm);
 }
 
 static int flask_hvm_set_pci_intx_level(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__PCILEVEL);
+    return current_has_perm(d, SECCLASS_HVM, HVM__PCILEVEL);
 }
 
 static int flask_hvm_set_isa_irq_level(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__IRQLEVEL);
+    return current_has_perm(d, SECCLASS_HVM, HVM__IRQLEVEL);
 }
 
 static int flask_hvm_set_pci_link_route(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__PCIROUTE);
+    return current_has_perm(d, SECCLASS_HVM, HVM__PCIROUTE);
 }
 
 static int flask_hvm_inject_msi(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__SEND_IRQ);
+    return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
 static int flask_mem_event(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__MEM_EVENT);
+    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
 
 static int flask_mem_sharing(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__MEM_SHARING);
+    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
 }
 
 static int flask_apic(struct domain *d, int cmd)
@@ -1355,11 +1346,7 @@ static int flask_physinfo(void)
 
 static int flask_platform_quirk(uint32_t quirk)
 {
-    struct domain_security_struct *dsec;
-    dsec = current->domain->ssid;
-
-    return avc_has_perm(dsec->sid, SECINITSID_XEN, SECCLASS_XEN, 
-                        XEN__QUIRK, NULL);
+    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN, XEN__QUIRK, NULL);
 }
 
 static int flask_platform_op(uint32_t op)
@@ -1421,16 +1408,12 @@ static int flask_getidletime(void)
 
 static int flask_machine_memory_map(void)
 {
-    struct domain_security_struct *dsec;
-    dsec = current->domain->ssid;
-
-    return avc_has_perm(dsec->sid, SECINITSID_XEN, SECCLASS_MMU, 
-                        MMU__MEMORYMAP, NULL);
+    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_MMU, MMU__MEMORYMAP, NULL);
 }
 
 static int flask_domain_memory_map(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_MMU, MMU__MEMORYMAP);
+    return current_has_perm(d, SECCLASS_MMU, MMU__MEMORYMAP);
 }
 
 static int domain_memory_perm(struct domain *d, struct domain *f, l1_pgentry_t pte)
@@ -1453,17 +1436,17 @@ static int domain_memory_perm(struct domain *d, struct domain *f, l1_pgentry_t p
     if ( f->domain_id == DOMID_IO || !mfn_valid(fmfn) )
     {
         struct avc_audit_data ad;
-        struct domain_security_struct *dsec = d->ssid;
-        u32 fsid;
+        u32 dsid, fsid;
+        rc = security_iomem_sid(fmfn, &fsid);
+        if ( rc )
+            return rc;
         AVC_AUDIT_DATA_INIT(&ad, MEMORY);
         ad.sdom = d;
         ad.tdom = f;
         ad.memory.pte = pte.l1;
         ad.memory.mfn = fmfn;
-        rc = security_iomem_sid(fmfn, &fsid);
-        if ( rc )
-            return rc;
-        return avc_has_perm(dsec->sid, fsid, SECCLASS_MMU, map_perms, &ad);
+        dsid = domain_sid(d);
+        return avc_has_perm(dsid, fsid, SECCLASS_MMU, map_perms, &ad);
     }
 
     return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
@@ -1506,43 +1489,40 @@ static int flask_remove_from_physmap(struct domain *d1, struct domain *d2)
 
 static int flask_sendtrigger(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
 }
 
 static int flask_get_device_group(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
-    struct domain_security_struct *ssec = current->domain->ssid;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
         return rc;
 
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
 }
 
 static int flask_test_assign_device(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
-    struct domain_security_struct *ssec = current->domain->ssid;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
         return rc;
 
-    return rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
 }
 
 static int flask_assign_device(struct domain *d, uint32_t machine_bdf)
 {
-    u32 rsid;
+    u32 dsid, rsid;
     int rc = -EPERM;
-    struct domain_security_struct *ssec, *tsec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__ADD);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
     if ( rc )
         return rc;
 
@@ -1552,22 +1532,20 @@ static int flask_assign_device(struct domain *d, uint32_t machine_bdf)
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = current->domain->ssid;
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__ADD_DEVICE, &ad);
+    rc = avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__ADD_DEVICE, &ad);
     if ( rc )
         return rc;
 
-    tsec = d->ssid;
-    return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    dsid = domain_sid(d);
+    return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
 static int flask_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
-    struct domain_security_struct *ssec = current->domain->ssid;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
     if ( rc )
         return rc;
 
@@ -1575,18 +1553,17 @@ static int flask_deassign_device(struct domain *d, uint32_t machine_bdf)
     if ( rc )
         return rc;
 
-    return rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__REMOVE_DEVICE, NULL);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__REMOVE_DEVICE, NULL);
 }
 
 static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
-    u32 rsid;
+    u32 dsid, rsid;
     int rc = -EPERM;
     int irq;
-    struct domain_security_struct *ssec, *tsec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__ADD);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
     if ( rc )
         return rc;
 
@@ -1596,23 +1573,22 @@ static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *b
     if ( rc )
         return rc;
 
-    ssec = current->domain->ssid;
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_HVM, HVM__BIND_IRQ, &ad);
+    rc = avc_current_has_perm(rsid, SECCLASS_HVM, HVM__BIND_IRQ, &ad);
     if ( rc )
         return rc;
 
-    tsec = d->ssid;
-    return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    dsid = domain_sid(d);
+    return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
 static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
+    return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
 
 static int flask_pin_mem_cacheattr (struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__CACHEATTR);
+    return current_has_perm(d, SECCLASS_HVM, HVM__CACHEATTR);
 }
 
 static int flask_ext_vcpucontext (struct domain *d, uint32_t cmd)
@@ -1631,7 +1607,7 @@ static int flask_ext_vcpucontext (struct domain *d, uint32_t cmd)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
+    return current_has_perm(d, SECCLASS_DOMAIN, perm);
 }
 
 static int flask_vcpuextstate (struct domain *d, uint32_t cmd)
@@ -1650,7 +1626,7 @@ static int flask_vcpuextstate (struct domain *d, uint32_t cmd)
             return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
+    return current_has_perm(d, SECCLASS_DOMAIN, perm);
 }
 #endif
 
diff --git a/xen/xsm/flask/include/objsec.h b/xen/xsm/flask/include/objsec.h
index 4ff52be..6595dc3 100644
--- a/xen/xsm/flask/include/objsec.h
+++ b/xen/xsm/flask/include/objsec.h
@@ -19,6 +19,8 @@
 
 struct domain_security_struct {
     u32 sid;               /* current SID */
+    u32 self_sid;          /* SID for target when operating on DOMID_SELF */
+    u32 target_sid;        /* SID for device model target domain */
 };
 
 struct evtchn_security_struct {
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSem-0002Mp-Bx; Fri, 30 Nov 2012 15:37:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSek-0002MC-Nw
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:34 +0000
Received: from [85.158.139.211:30248] by server-2.bemta-5.messagelabs.com id
	33/6F-04892-DB2D8B05; Fri, 30 Nov 2012 15:37:33 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-8.tower-206.messagelabs.com!1354289851!18547803!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24238 invoked from network); 30 Nov 2012 15:37:32 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-8.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:32 -0000
X-TM-IMSS-Message-ID: <3392119b00027aac@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3392119b00027aac ;
	Fri, 30 Nov 2012 10:36:23 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbScu017785; 
	Fri, 30 Nov 2012 10:37:29 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:50 -0500
Message-Id: <1354289830-24642-4-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 03/23] arch/x86: add distinct XSM hooks for
	map/unmap
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The xsm_iomem_permission and xsm_ioport_permission hooks are intended to
be called by the domain builder, while the calls in arch/x86/domctl.c
which control mapping are also performed by the device model. Because of
this, they should not use the same XSM hooks.

This also adds a missing XSM hook in the unbind IRQ domctl.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/domctl.c  |  8 ++++++--
 xen/arch/x86/physdev.c |  2 +-
 xen/include/xsm/xsm.h  | 25 ++++++++++++++++++++++---
 xen/xsm/dummy.c        | 20 +++++++++++++++++++-
 xen/xsm/flask/hooks.c  | 42 ++++++++++++++++++++----------------------
 5 files changed, 68 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 508c77c..7069d7a 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -803,6 +803,10 @@ long arch_do_domctl(
              !irq_access_permitted(current->domain, bind->machine_irq) )
             goto unbind_out;
 
+        ret = xsm_unbind_pt_irq(d, bind);
+        if ( ret )
+            goto unbind_out;
+
         if ( iommu_enabled )
         {
             spin_lock(&pcidevs_lock);
@@ -842,7 +846,7 @@ long arch_do_domctl(
         if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
             break;
 
-        ret = xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, add);
+        ret = xsm_iomem_mapping(d, mfn, mfn + nr_mfns - 1, add);
         if ( ret ) {
             rcu_unlock_domain(d);
             break;
@@ -929,7 +933,7 @@ long arch_do_domctl(
         if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
             break;
 
-        ret = xsm_ioport_permission(d, fmp, fmp + np - 1, add);
+        ret = xsm_ioport_mapping(d, fmp, fmp + np - 1, add);
         if ( ret ) {
             rcu_unlock_domain(d);
             break;
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 751cbd4..2928f1c 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -242,7 +242,7 @@ int physdev_unmap_pirq(domid_t domid, int pirq)
     if ( !IS_PRIV_FOR(current->domain, d) )
         goto free_domain;
 
-    ret = xsm_irq_permission(d, domain_pirq_to_irq(d, pirq), 0);
+    ret = xsm_unmap_domain_pirq(d, domain_pirq_to_irq(d, pirq));
     if ( ret )
         goto free_domain;
 
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index a949c1e..2560229 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -117,8 +117,10 @@ struct xsm_operations {
 
     char *(*show_irq_sid) (int irq);
     int (*map_domain_pirq) (struct domain *d, int irq, void *data);
+    int (*unmap_domain_pirq) (struct domain *d, int irq);
     int (*irq_permission) (struct domain *d, int pirq, uint8_t allow);
     int (*iomem_permission) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
+    int (*iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
     int (*pci_config_permission) (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access);
 
     int (*get_device_group) (uint32_t machine_bdf);
@@ -176,11 +178,12 @@ struct xsm_operations {
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
     int (*sendtrigger) (struct domain *d);
     int (*bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*unbind_pt_irq) (struct domain *d);
+    int (*unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
     int (*pin_mem_cacheattr) (struct domain *d);
     int (*ext_vcpucontext) (struct domain *d, uint32_t cmd);
     int (*vcpuextstate) (struct domain *d, uint32_t cmd);
     int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
+    int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
 #endif
 };
 
@@ -495,6 +498,11 @@ static inline int xsm_map_domain_pirq (struct domain *d, int irq, void *data)
     return xsm_call(map_domain_pirq(d, irq, data));
 }
 
+static inline int xsm_unmap_domain_pirq (struct domain *d, int irq)
+{
+    return xsm_call(unmap_domain_pirq(d, irq));
+}
+
 static inline int xsm_irq_permission (struct domain *d, int pirq, uint8_t allow)
 {
     return xsm_call(irq_permission(d, pirq, allow));
@@ -505,6 +513,11 @@ static inline int xsm_iomem_permission (struct domain *d, uint64_t s, uint64_t e
     return xsm_call(iomem_permission(d, s, e, allow));
 }
 
+static inline int xsm_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+{
+    return xsm_call(iomem_mapping(d, s, e, allow));
+}
+
 static inline int xsm_pci_config_permission (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
     return xsm_call(pci_config_permission(d, machine_bdf, start, end, access));
@@ -781,9 +794,10 @@ static inline int xsm_bind_pt_irq(struct domain *d,
     return xsm_call(bind_pt_irq(d, bind));
 }
 
-static inline int xsm_unbind_pt_irq(struct domain *d)
+static inline int xsm_unbind_pt_irq(struct domain *d,
+                                                struct xen_domctl_bind_pt_irq *bind)
 {
-    return xsm_call(unbind_pt_irq(d));
+    return xsm_call(unbind_pt_irq(d, bind));
 }
 
 static inline int xsm_pin_mem_cacheattr(struct domain *d)
@@ -804,6 +818,11 @@ static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t
 {
     return xsm_call(ioport_permission(d, s, e, allow));
 }
+
+static inline int xsm_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+{
+    return xsm_call(ioport_mapping(d, s, e, allow));
+}
 #endif /* CONFIG_X86 */
 
 extern struct xsm_operations dummy_xsm_ops;
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index b726eaf..5f078d2 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -395,6 +395,11 @@ static int dummy_map_domain_pirq (struct domain *d, int irq, void *data)
     return 0;
 }
 
+static int dummy_unmap_domain_pirq (struct domain *d, int irq)
+{
+    return 0;
+}
+
 static int dummy_irq_permission (struct domain *d, int pirq, uint8_t allow)
 {
     return 0;
@@ -405,6 +410,11 @@ static int dummy_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uin
     return 0;
 }
 
+static int dummy_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+{
+    return 0;
+}
+
 static int dummy_pci_config_permission (struct domain *d, uint32_t machine_bdf,
                                         uint16_t start, uint16_t end,
                                         uint8_t access)
@@ -585,7 +595,7 @@ static int dummy_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *b
     return 0;
 }
 
-static int dummy_unbind_pt_irq (struct domain *d)
+static int dummy_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
 }
@@ -609,6 +619,11 @@ static int dummy_ioport_permission (struct domain *d, uint32_t s, uint32_t e, ui
 {
     return 0;
 }
+
+static int dummy_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+{
+    return 0;
+}
 #endif
 
 struct xsm_operations dummy_xsm_ops;
@@ -693,8 +708,10 @@ void xsm_fixup_ops (struct xsm_operations *ops)
 
     set_to_dummy_if_null(ops, show_irq_sid);
     set_to_dummy_if_null(ops, map_domain_pirq);
+    set_to_dummy_if_null(ops, unmap_domain_pirq);
     set_to_dummy_if_null(ops, irq_permission);
     set_to_dummy_if_null(ops, iomem_permission);
+    set_to_dummy_if_null(ops, iomem_mapping);
     set_to_dummy_if_null(ops, pci_config_permission);
 
     set_to_dummy_if_null(ops, get_device_group);
@@ -757,5 +774,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, ext_vcpucontext);
     set_to_dummy_if_null(ops, vcpuextstate);
     set_to_dummy_if_null(ops, ioport_permission);
+    set_to_dummy_if_null(ops, ioport_mapping);
 #endif
 }
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 0ca10d0..d4635d0 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -721,43 +721,40 @@ static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
     return rc;
 }
 
-static int flask_irq_permission (struct domain *d, int irq, uint8_t access)
+static int flask_unmap_domain_pirq (struct domain *d, int irq)
 {
-    u32 perm;
-    u32 rsid;
+    u32 sid;
     int rc = -EPERM;
 
-    struct domain_security_struct *ssec, *tsec;
+    struct domain_security_struct *ssec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
-                         resource_to_perm(access));
-
+    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
     if ( rc )
         return rc;
 
-    if ( access )
-        perm = RESOURCE__ADD_IRQ;
-    else
-        perm = RESOURCE__REMOVE_IRQ;
-
     ssec = current->domain->ssid;
-    tsec = d->ssid;
 
-    rc = get_irq_sid(irq, &rsid, &ad);
-    if ( rc )
-        return rc;
-
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
+    if ( irq >= nr_irqs_gsi ) {
+        /* TODO support for MSI here */
+        return 0;
+    } else {
+        rc = get_irq_sid(irq, &sid, &ad);
+    }
     if ( rc )
         return rc;
 
-    if ( access )
-        rc = avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, 
-                            RESOURCE__USE, &ad);
+    rc = avc_has_perm(ssec->sid, sid, SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, &ad);
     return rc;
 }
 
+static int flask_irq_permission (struct domain *d, int pirq, uint8_t access)
+{
+    /* the PIRQ number is not useful; real IRQ is checked during mapping */
+    return domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
+                           resource_to_perm(access));
+}
+
 struct iomem_has_perm_data {
     struct domain_security_struct *ssec, *tsec;
     u32 perm;
@@ -1413,7 +1410,7 @@ static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *b
     return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-static int flask_unbind_pt_irq (struct domain *d)
+static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
@@ -1533,6 +1530,7 @@ static struct xsm_operations flask_ops = {
     .show_irq_sid = flask_show_irq_sid,
 
     .map_domain_pirq = flask_map_domain_pirq,
+    .unmap_domain_pirq = flask_unmap_domain_pirq,
     .irq_permission = flask_irq_permission,
     .iomem_permission = flask_iomem_permission,
     .pci_config_permission = flask_pci_config_permission,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSeo-0002O4-86; Fri, 30 Nov 2012 15:37:38 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSem-0002MP-Gd
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:36 +0000
Received: from [193.109.254.147:14331] by server-16.bemta-14.messagelabs.com
	id 83/17-09215-0C2D8B05; Fri, 30 Nov 2012 15:37:36 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-27.messagelabs.com!1354289854!2114142!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 503 invoked from network); 30 Nov 2012 15:37:34 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-11.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:34 -0000
X-TM-IMSS-Message-ID: <d0a0ed19000589c6@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0ed19000589c6 ;
	Fri, 30 Nov 2012 10:37:39 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd7017785; 
	Fri, 30 Nov 2012 10:37:33 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:01 -0500
Message-Id: <1354289830-24642-15-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 14/23] arch/x86: Add missing mem_sharing XSM
	hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch adds splits up the mem_sharing and mem_event XSM hooks to
better cover what the code is doing. It also changes the utility
function get_mem_event_op_target to rcu_lock_live_remote_domain_by_id
because there is no mm-specific logic in there.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
---
 tools/flask/policy/policy/flask/access_vectors |  1 +
 xen/arch/x86/domctl.c                          |  8 ++---
 xen/arch/x86/mm/mem_event.c                    | 41 ++++++++------------------
 xen/arch/x86/mm/mem_sharing.c                  | 25 +++++++++++++---
 xen/common/domain.c                            | 15 ++++++++++
 xen/include/asm-x86/mem_event.h                |  1 -
 xen/include/xen/sched.h                        |  6 ++++
 xen/include/xsm/dummy.h                        | 23 ++++++++++++++-
 xen/include/xsm/xsm.h                          | 24 +++++++++++++--
 xen/xsm/dummy.c                                |  5 +++-
 xen/xsm/flask/hooks.c                          | 25 ++++++++++++++--
 xen/xsm/flask/include/av_perm_to_string.h      |  1 +
 xen/xsm/flask/include/av_permissions.h         |  1 +
 13 files changed, 130 insertions(+), 46 deletions(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index ea65e45..45ac437 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -102,6 +102,7 @@ class hvm
     mem_sharing
     audit_p2m
     send_irq
+    share_mem
 }
 
 class event
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 30518aa..34e6223 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1503,10 +1503,8 @@ long arch_do_domctl(
         d = rcu_lock_domain_by_id(domctl->domain);
         if ( d != NULL )
         {
-            ret = xsm_mem_event(d);
-            if ( !ret )
-                ret = mem_event_domctl(d, &domctl->u.mem_event_op,
-                                       guest_handle_cast(u_domctl, void));
+            ret = mem_event_domctl(d, &domctl->u.mem_event_op,
+                                   guest_handle_cast(u_domctl, void));
             rcu_unlock_domain(d);
             copy_to_guest(u_domctl, domctl, 1);
         } 
@@ -1562,7 +1560,7 @@ long arch_do_domctl(
         d = rcu_lock_domain_by_id(domctl->domain);
         if ( d != NULL )
         {
-            ret = xsm_mem_event(d);
+            ret = xsm_mem_event_setup(d);
             if ( !ret ) {
                 p2m = p2m_get_hostp2m(d);
                 p2m->access_required = domctl->u.access_required.access_required;
diff --git a/xen/arch/x86/mm/mem_event.c b/xen/arch/x86/mm/mem_event.c
index 27d1cf4..c2b3670 100644
--- a/xen/arch/x86/mm/mem_event.c
+++ b/xen/arch/x86/mm/mem_event.c
@@ -29,6 +29,7 @@
 #include <asm/mem_paging.h>
 #include <asm/mem_access.h>
 #include <asm/mem_sharing.h>
+#include <xsm/xsm.h>
 
 /* for public/io/ring.h macros */
 #define xen_mb()   mb()
@@ -439,35 +440,19 @@ static void mem_sharing_notification(struct vcpu *v, unsigned int port)
         mem_sharing_sharing_resume(v->domain);
 }
 
-struct domain *get_mem_event_op_target(uint32_t domain, int *rc)
-{
-    struct domain *d;
-
-    /* Get the target domain */
-    *rc = rcu_lock_remote_target_domain_by_id(domain, &d);
-    if ( *rc != 0 )
-        return NULL;
-
-    /* Not dying? */
-    if ( d->is_dying )
-    {
-        rcu_unlock_domain(d);
-        *rc = -EINVAL;
-        return NULL;
-    }
-    
-    return d;
-}
-
 int do_mem_event_op(int op, uint32_t domain, void *arg)
 {
     int ret;
     struct domain *d;
 
-    d = get_mem_event_op_target(domain, &ret);
-    if ( !d )
+    ret = rcu_lock_live_remote_domain_by_id(domain, &d);
+    if ( ret )
         return ret;
 
+    ret = xsm_mem_event_op(d, op);
+    if ( ret )
+        goto out;
+
     switch (op)
     {
         case XENMEM_paging_op:
@@ -483,6 +468,7 @@ int do_mem_event_op(int op, uint32_t domain, void *arg)
             ret = -ENOSYS;
     }
 
+ out:
     rcu_unlock_domain(d);
     return ret;
 }
@@ -516,6 +502,10 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
 {
     int rc;
 
+    rc = xsm_mem_event_control(d, mec->mode, mec->op);
+    if ( rc )
+        return rc;
+
     if ( unlikely(d == current->domain) )
     {
         gdprintk(XENLOG_INFO, "Tried to do a memory event op on itself.\n");
@@ -537,13 +527,6 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
         return -EINVAL;
     }
 
-    /* TODO: XSM hook */
-#if 0
-    rc = xsm_mem_event_control(d, mec->op);
-    if ( rc )
-        return rc;
-#endif
-
     rc = -ENOSYS;
 
     switch ( mec->mode )
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..9229b83 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -34,6 +34,7 @@
 #include <asm/atomic.h>
 #include <xen/rcupdate.h>
 #include <asm/event.h>
+#include <xsm/xsm.h>
 
 #include "mm-locks.h"
 
@@ -1345,10 +1346,18 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( !mem_sharing_enabled(d) )
                 return -EINVAL;
 
-            cd = get_mem_event_op_target(mec->u.share.client_domain, &rc);
-            if ( !cd )
+            rc = rcu_lock_live_remote_domain_by_id(mec->u.share.client_domain,
+                                                   &cd);
+            if ( rc )
                 return rc;
 
+            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            if ( rc )
+            {
+                rcu_unlock_domain(cd);
+                return rc;
+            }
+
             if ( !mem_sharing_enabled(cd) )
             {
                 rcu_unlock_domain(cd);
@@ -1401,10 +1410,18 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( !mem_sharing_enabled(d) )
                 return -EINVAL;
 
-            cd = get_mem_event_op_target(mec->u.share.client_domain, &rc);
-            if ( !cd )
+            rc = rcu_lock_live_remote_domain_by_id(mec->u.share.client_domain,
+                                                   &cd);
+            if ( rc )
                 return rc;
 
+            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            if ( rc )
+            {
+                rcu_unlock_domain(cd);
+                return rc;
+            }
+
             if ( !mem_sharing_enabled(cd) )
             {
                 rcu_unlock_domain(cd);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 12c8e24..fcf24e2 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -475,6 +475,21 @@ int rcu_lock_remote_domain_by_id(domid_t dom, struct domain **d)
     return 0;
 }
 
+int rcu_lock_live_remote_domain_by_id(domid_t dom, struct domain **d)
+{
+    int rv;
+    rv = rcu_lock_remote_domain_by_id(dom, d);
+    if ( rv )
+        return rv;
+    if ( (*d)->is_dying )
+    {
+        rcu_unlock_domain(*d);
+        return -EINVAL;
+    }
+
+    return 0;
+}
+
 int domain_kill(struct domain *d)
 {
     int rc = 0;
diff --git a/xen/include/asm-x86/mem_event.h b/xen/include/asm-x86/mem_event.h
index e17f36b..5959621 100644
--- a/xen/include/asm-x86/mem_event.h
+++ b/xen/include/asm-x86/mem_event.h
@@ -62,7 +62,6 @@ void mem_event_put_request(struct domain *d, struct mem_event_domain *med,
 int mem_event_get_response(struct domain *d, struct mem_event_domain *med,
                            mem_event_response_t *rsp);
 
-struct domain *get_mem_event_op_target(uint32_t domain, int *rc);
 int do_mem_event_op(int op, uint32_t domain, void *arg);
 int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
                      XEN_GUEST_HANDLE_PARAM(void) u_domctl);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..90a6537 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -484,6 +484,12 @@ int rcu_lock_remote_target_domain_by_id(domid_t dom, struct domain **d);
  */
 int rcu_lock_remote_domain_by_id(domid_t dom, struct domain **d);
 
+/*
+ * As rcu_lock_remote_domain_by_id() but will fail EINVAL if the domain is
+ * dying.
+ */
+int rcu_lock_live_remote_domain_by_id(domid_t dom, struct domain **d);
+
 /* Finish a RCU critical region started by rcu_lock_domain_by_id(). */
 static inline void rcu_unlock_domain(struct domain *d)
 {
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index e42965c..42b2285 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -551,16 +551,37 @@ static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_event(struct domain *d)
+static XSM_INLINE int xsm_mem_event_setup(struct domain *d)
 {
     return 0;
 }
 
+static XSM_INLINE int xsm_mem_event_control(struct domain *d, int mode, int op)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
+static XSM_INLINE int xsm_mem_event_op(struct domain *d, int op)
+{
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_INLINE int xsm_mem_sharing(struct domain *d)
 {
     return 0;
 }
 
+static XSM_INLINE int xsm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
+{
+    if ( !IS_PRIV_FOR(current->domain, cd) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
 {
     if ( !IS_PRIV(d) )
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 470e3c0..88aa95a 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -151,8 +151,11 @@ struct xsm_operations {
     int (*hvm_set_isa_irq_level) (struct domain *d);
     int (*hvm_set_pci_link_route) (struct domain *d);
     int (*hvm_inject_msi) (struct domain *d);
-    int (*mem_event) (struct domain *d);
+    int (*mem_event_setup) (struct domain *d);
+    int (*mem_event_control) (struct domain *d, int mode, int op);
+    int (*mem_event_op) (struct domain *d, int op);
     int (*mem_sharing) (struct domain *d);
+    int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
     int (*apic) (struct domain *d, int cmd);
     int (*xen_settime) (void);
     int (*memtype) (uint32_t access);
@@ -665,9 +668,19 @@ static inline int xsm_hvm_inject_msi (struct domain *d)
     return xsm_ops->hvm_inject_msi(d);
 }
 
-static inline int xsm_mem_event (struct domain *d)
+static inline int xsm_mem_event_setup (struct domain *d)
 {
-    return xsm_ops->mem_event(d);
+    return xsm_ops->mem_event_setup(d);
+}
+
+static inline int xsm_mem_event_control (struct domain *d, int mode, int op)
+{
+    return xsm_ops->mem_event_control(d, mode, op);
+}
+
+static inline int xsm_mem_event_op (struct domain *d, int op)
+{
+    return xsm_ops->mem_event_op(d, op);
 }
 
 static inline int xsm_mem_sharing (struct domain *d)
@@ -675,6 +688,11 @@ static inline int xsm_mem_sharing (struct domain *d)
     return xsm_ops->mem_sharing(d);
 }
 
+static inline int xsm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
+{
+    return xsm_ops->mem_sharing_op(d, cd, op);
+}
+
 static inline int xsm_apic (struct domain *d, int cmd)
 {
     return xsm_ops->apic(d, cmd);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 1e7f42c..bc9d30f 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -136,8 +136,11 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, hvm_set_isa_irq_level);
     set_to_dummy_if_null(ops, hvm_set_pci_link_route);
     set_to_dummy_if_null(ops, hvm_inject_msi);
-    set_to_dummy_if_null(ops, mem_event);
+    set_to_dummy_if_null(ops, mem_event_setup);
+    set_to_dummy_if_null(ops, mem_event_control);
+    set_to_dummy_if_null(ops, mem_event_op);
     set_to_dummy_if_null(ops, mem_sharing);
+    set_to_dummy_if_null(ops, mem_sharing_op);
     set_to_dummy_if_null(ops, apic);
     set_to_dummy_if_null(ops, xen_settime);
     set_to_dummy_if_null(ops, memtype);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index a8475ea..99d3e21 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1277,7 +1277,17 @@ static int flask_hvm_inject_msi(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
-static int flask_mem_event(struct domain *d)
+static int flask_mem_event_setup(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
+}
+
+static int flask_mem_event_control(struct domain *d, int mode, int op)
+{
+    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
+}
+
+static int flask_mem_event_op(struct domain *d, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
@@ -1287,6 +1297,14 @@ static int flask_mem_sharing(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
 }
 
+static int flask_mem_sharing_op(struct domain *d, struct domain *cd, int op)
+{
+    int rc = current_has_perm(cd, SECCLASS_HVM, HVM__MEM_SHARING);
+    if ( rc )
+        return rc;
+    return domain_has_perm(d, cd, SECCLASS_HVM, HVM__SHARE_MEM);
+}
+
 static int flask_apic(struct domain *d, int cmd)
 {
     u32 perm;
@@ -1736,8 +1754,11 @@ static struct xsm_operations flask_ops = {
     .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
     .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
     .hvm_inject_msi = flask_hvm_inject_msi,
-    .mem_event = flask_mem_event,
+    .mem_event_setup = flask_mem_event_setup,
+    .mem_event_control = flask_mem_event_control,
+    .mem_event_op = flask_mem_event_op,
     .mem_sharing = flask_mem_sharing,
+    .mem_sharing_op = flask_mem_sharing_op,
     .apic = flask_apic,
     .xen_settime = flask_xen_settime,
     .memtype = flask_memtype,
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 894910c..186f1fa 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -84,6 +84,7 @@
    S_(SECCLASS_HVM, HVM__MEM_SHARING, "mem_sharing")
    S_(SECCLASS_HVM, HVM__AUDIT_P2M, "audit_p2m")
    S_(SECCLASS_HVM, HVM__SEND_IRQ, "send_irq")
+   S_(SECCLASS_HVM, HVM__SHARE_MEM, "share_mem")
    S_(SECCLASS_EVENT, EVENT__BIND, "bind")
    S_(SECCLASS_EVENT, EVENT__SEND, "send")
    S_(SECCLASS_EVENT, EVENT__STATUS, "status")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index 1bdb515..b3831f6 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -87,6 +87,7 @@
 #define HVM__MEM_SHARING                          0x00001000UL
 #define HVM__AUDIT_P2M                            0x00002000UL
 #define HVM__SEND_IRQ                             0x00004000UL
+#define HVM__SHARE_MEM                            0x00008000UL
 
 #define EVENT__BIND                               0x00000001UL
 #define EVENT__SEND                               0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSem-0002N1-Pa; Fri, 30 Nov 2012 15:37:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSel-0002MC-8Q
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:35 +0000
Received: from [85.158.139.211:30328] by server-2.bemta-5.messagelabs.com id
	C0/7F-04892-EB2D8B05; Fri, 30 Nov 2012 15:37:34 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-10.tower-206.messagelabs.com!1354289852!18533441!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 424 invoked from network); 30 Nov 2012 15:37:33 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-10.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:33 -0000
X-TM-IMSS-Message-ID: <3392168b00027ab1@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3392168b00027ab1 ;
	Fri, 30 Nov 2012 10:36:24 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbScx017785; 
	Fri, 30 Nov 2012 10:37:30 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:53 -0500
Message-Id: <1354289830-24642-7-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 06/23] xen: use XSM instead of IS_PRIV where
	duplicated
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The Xen hypervisor has two basic access control function calls: IS_PRIV
and the xsm_* functions. Most privileged operations currently require
that both checks succeed, and many times the checks are at different
locations in the code. This patch eliminates the explicit and implicit
IS_PRIV checks that are duplicated in XSM hooks.

When XSM_ENABLE is not defined or when the dummy XSM module is used,
this patch should not change any functionality. Because the locations of
privilege checks have sometimes moved below argument validation, error
returns of some functions may change from EPERM to EINVAL or ESRCH if
called with invalid arguments and from a domain without permission to
perform the operation.

Some checks are removed due to non-obvious duplicates in their callers:

 * acpi_enter_sleep is checked in XENPF_enter_acpi_sleep
 * map_domain_pirq has IS_PRIV_FOR checked in its callers:
   * physdev_map_pirq checks when acquiring the RCU lock
   * ioapic_guest_write is checked in PHYSDEVOP_apic_write
 * PHYSDEVOP_{manage_pci_add,manage_pci_add_ext,pci_device_add} are
   checked by xsm_resource_plug_pci in pci_add_device
 * PHYSDEVOP_manage_pci_remove is checked by xsm_resource_unplug_pci
   in pci_remove_device
 * PHYSDEVOP_{restore_msi,restore_msi_ext} are checked by
   xsm_resource_setup_pci in pci_restore_msi_state
 * do_console_io has changed to IS_PRIV from an explicit domid==0

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/acpi/power.c     |  2 +-
 xen/arch/x86/cpu/mcheck/mce.c |  3 ---
 xen/arch/x86/irq.c            |  3 +--
 xen/arch/x86/mm.c             |  3 ---
 xen/arch/x86/physdev.c        | 56 ++++---------------------------------------
 xen/common/kexec.c            |  3 ---
 xen/common/schedule.c         |  6 -----
 xen/drivers/char/console.c    |  6 -----
 xen/include/xsm/dummy.h       | 28 ++++++++++++++++++++++
 xen/xsm/flask/hooks.c         |  5 ++--
 10 files changed, 37 insertions(+), 78 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 9e1f989..c7b37ef 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -238,7 +238,7 @@ static long enter_state_helper(void *data)
  */
 int acpi_enter_sleep(struct xenpf_enter_acpi_sleep *sleep)
 {
-    if ( !IS_PRIV(current->domain) || !acpi_sinfo.pm1a_cnt_blk.address )
+    if ( !acpi_sinfo.pm1a_cnt_blk.address )
         return -EPERM;
 
     /* Sanity check */
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 8b54240..658774a 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1293,9 +1293,6 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
     struct xen_mc_msrinject *mc_msrinject;
     struct xen_mc_mceinject *mc_mceinject;
 
-    if (!IS_PRIV(v->domain) )
-        return x86_mcerr(NULL, -EPERM);
-
     ret = xsm_do_mca();
     if ( ret )
         return x86_mcerr(NULL, ret);
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 05cede5..238600a 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1853,8 +1853,7 @@ int map_domain_pirq(
     ASSERT(spin_is_locked(&d->event_lock));
 
     if ( !IS_PRIV(current->domain) &&
-         !(IS_PRIV_FOR(current->domain, d) &&
-           irq_access_permitted(current->domain, pirq)))
+         !irq_access_permitted(current->domain, pirq))
         return -EPERM;
 
     if ( pirq < 0 || pirq >= d->nr_pirqs || irq < 0 || irq >= nr_irqs )
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index ab94b02..e66c79d 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4508,9 +4508,6 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         XEN_GUEST_HANDLE_PARAM(e820entry_t) buffer_param;
         unsigned int i;
 
-        if ( !IS_PRIV(current->domain) )
-            return -EINVAL;
-
         rc = xsm_machine_memory_map();
         if ( rc )
             return rc;
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 2928f1c..9c30245 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -109,12 +109,6 @@ int physdev_map_pirq(domid_t domid, int type, int *index, int *pirq_p,
     if ( ret )
         return ret;
 
-    if ( !IS_PRIV_FOR(current->domain, d) )
-    {
-        ret = -EPERM;
-        goto free_domain;
-    }
-
     /* Verify or get irq. */
     switch ( type )
     {
@@ -238,10 +232,6 @@ int physdev_unmap_pirq(domid_t domid, int pirq)
             goto free_domain;
     }
 
-    ret = -EPERM;
-    if ( !IS_PRIV_FOR(current->domain, d) )
-        goto free_domain;
-
     ret = xsm_unmap_domain_pirq(d, domain_pirq_to_irq(d, pirq));
     if ( ret )
         goto free_domain;
@@ -433,9 +423,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
         ret = xsm_apic(v->domain, cmd);
         if ( ret )
             break;
@@ -450,9 +437,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
         ret = xsm_apic(v->domain, cmd);
         if ( ret )
             break;
@@ -467,8 +451,10 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&irq_op, arg, 1) != 0 )
             break;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
+        /* Use the APIC check since this dummy hypercall should still only
+         * be called by the domain with access to program the ioapic */
+        ret = xsm_apic(v->domain, cmd);
+        if ( ret )
             break;
 
         /* Vector is only used by hypervisor, and dom0 shouldn't
@@ -517,9 +503,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     case PHYSDEVOP_manage_pci_add: {
         struct physdev_manage_pci manage_pci;
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
         ret = -EFAULT;
         if ( copy_from_guest(&manage_pci, arg, 1) != 0 )
             break;
@@ -530,9 +513,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     case PHYSDEVOP_manage_pci_remove: {
         struct physdev_manage_pci manage_pci;
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
         ret = -EFAULT;
         if ( copy_from_guest(&manage_pci, arg, 1) != 0 )
             break;
@@ -545,10 +525,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct physdev_manage_pci_ext manage_pci_ext;
         struct pci_dev_info pdev_info;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(current->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&manage_pci_ext, arg, 1) != 0 )
             break;
@@ -571,10 +547,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct physdev_pci_device_add add;
         struct pci_dev_info pdev_info;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(current->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&add, arg, 1) != 0 )
             break;
@@ -595,10 +567,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_pci_device_remove: {
         struct physdev_pci_device dev;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&dev, arg, 1) != 0 )
             break;
@@ -610,10 +578,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_pci_mmcfg_reserved: {
         struct physdev_pci_mmcfg_reserved info;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(current->domain) )
-            break;
-
         ret = xsm_resource_setup_misc();
         if ( ret )
             break;
@@ -631,10 +595,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct physdev_restore_msi restore_msi;
         struct pci_dev *pdev;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&restore_msi, arg, 1) != 0 )
             break;
@@ -650,10 +610,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct physdev_pci_device dev;
         struct pci_dev *pdev;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&dev, arg, 1) != 0 )
             break;
@@ -668,10 +624,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_setup_gsi: {
         struct physdev_setup_gsi setup_gsi;
 
-        ret = -EPERM;
-        if ( !IS_PRIV(v->domain) )
-            break;
-
         ret = -EFAULT;
         if ( copy_from_guest(&setup_gsi, arg, 1) != 0 )
             break;
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 25ebd6a..d4f6332 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -852,9 +852,6 @@ static int do_kexec_op_internal(unsigned long op,
     unsigned long flags;
     int ret = -EINVAL;
 
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-
     ret = xsm_kexec();
     if ( ret )
         return ret;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 231e097..cfd173d 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -921,12 +921,6 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             break;
 
-        if ( !IS_PRIV_FOR(current->domain, d) )
-        {
-            rcu_unlock_domain(d);
-            return -EPERM;
-        }
-
         ret = xsm_schedop_shutdown(current->domain, d);
         if ( ret )
         {
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index ff360fe..b2c3ee3 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -406,12 +406,6 @@ long do_console_io(int cmd, int count, XEN_GUEST_HANDLE_PARAM(char) buffer)
     long rc;
     unsigned int idx, len;
 
-#ifndef VERBOSE
-    /* Only domain 0 may access the emergency console. */
-    if ( current->domain->domain_id != 0 )
-        return -EPERM;
-#endif
-
     rc = xsm_console_io(current->domain, cmd);
     if ( rc )
         return rc;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 4384552..fb00a01 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -161,6 +161,8 @@ static XSM_INLINE int xsm_pm_op(void)
 
 static XSM_INLINE int xsm_do_mca(void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
@@ -223,6 +225,10 @@ static XSM_INLINE int xsm_memory_stat_reservation(struct domain *d1, struct doma
 
 static XSM_INLINE int xsm_console_io(struct domain *d, int cmd)
 {
+#ifndef VERBOSE
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+#endif
     return 0;
 }
 
@@ -233,11 +239,15 @@ static XSM_INLINE int xsm_profile(struct domain *d, int op)
 
 static XSM_INLINE int xsm_kexec(void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_schedop_shutdown(struct domain *d1, struct domain *d2)
 {
+    if ( !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
@@ -336,26 +346,36 @@ static XSM_INLINE int xsm_resource_unplug_core(void)
 
 static XSM_INLINE int xsm_resource_plug_pci(uint32_t machine_bdf)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_resource_unplug_pci(uint32_t machine_bdf)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_resource_setup_pci(uint32_t machine_bdf)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_resource_setup_gsi(int gsi)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_resource_setup_misc(void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
@@ -396,6 +416,8 @@ static XSM_INLINE int xsm_map_domain_pirq(struct domain *d, int irq, void *data)
 
 static XSM_INLINE int xsm_unmap_domain_pirq(struct domain *d, int irq)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
@@ -494,6 +516,8 @@ static XSM_INLINE int xsm_mem_sharing(struct domain *d)
 
 static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
 {
+    if ( !IS_PRIV(d) )
+        return -EPERM;
     return 0;
 }
 
@@ -534,6 +558,8 @@ static XSM_INLINE int xsm_efi_call(void)
 
 static XSM_INLINE int xsm_acpi_sleep(void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
@@ -549,6 +575,8 @@ static XSM_INLINE int xsm_getidletime(void)
 
 static XSM_INLINE int xsm_machine_memory_map(void)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 31572c5..cb8cf96 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1147,10 +1147,11 @@ static int flask_apic(struct domain *d, int cmd)
 
     switch ( cmd )
     {
-    case PHYSDEVOP_APIC_READ:
+    case PHYSDEVOP_apic_read:
+    case PHYSDEVOP_alloc_irq_vector:
         perm = XEN__READAPIC;
         break;
-    case PHYSDEVOP_APIC_WRITE:
+    case PHYSDEVOP_apic_write:
         perm = XEN__WRITEAPIC;
         break;
     default:
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSes-0002ST-KZ; Fri, 30 Nov 2012 15:37:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSeo-0002OB-UN
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:39 +0000
Received: from [85.158.139.211:58161] by server-15.bemta-5.messagelabs.com id
	BD/8B-26920-2C2D8B05; Fri, 30 Nov 2012 15:37:38 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-3.tower-206.messagelabs.com!1354289854!18565538!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21570 invoked from network); 30 Nov 2012 15:37:35 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-3.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:35 -0000
X-TM-IMSS-Message-ID: <33921d8d00027ab8@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 33921d8d00027ab8 ;
	Fri, 30 Nov 2012 10:36:26 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd6017785; 
	Fri, 30 Nov 2012 10:37:32 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:00 -0500
Message-Id: <1354289830-24642-14-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: [Xen-devel] [PATCH 13/23] xsm/flask: add distinct SIDs for
	self/target access
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Because the FLASK XSM module no longer checks IS_PRIV for remote domain
accesses covered by XSM permissions, domains now have the ability to
perform memory management and other functions on all domains that have
the same type. While it is possible to prevent this by only creating one
domain per type, this solution significantly limits the flexibility of
the type system.

This patch introduces a domain type transition to represent a domain
that is operating on itself. In the example policy, this is demonstrated
by creating a type with _self appended when declaring a domain type
which will be used for reflexive operations. AVCs for a domain of type
domU_t will look like the following:

scontext=system_u:system_r:domU_t tcontext=system_u:system_r:domU_t_self

This change also allows policy to distinguish between event channels a
domain creates to itself and event channels created between domains of
the same type.

The IS_PRIV_FOR check used for device model domains is also no longer
checked by FLASK; a similar transition is performed when the target is
set and used when the device model accesses its target domain.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 docs/misc/xsm-flask.txt                      |  43 ++-
 tools/flask/policy/policy/modules/xen/xen.if |  60 +++-
 tools/flask/policy/policy/modules/xen/xen.te |  13 +-
 xen/xsm/flask/flask_op.c                     |   9 +
 xen/xsm/flask/hooks.c                        | 422 +++++++++++++--------------
 xen/xsm/flask/include/objsec.h               |   2 +
 6 files changed, 307 insertions(+), 242 deletions(-)

diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index 0778a28..ff81b01 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -68,9 +68,43 @@ HVM domains with stubdomain device models use two types (one per domain):
  - dm_dom_t is the device model for a domain with type domHVM_t
 
 One disadvantage of using type enforcement to enforce isolation is that a new
-type is needed for each group of domains. In addition, it is not possible to
-allow isolated_domU_t cannot to create loopback event channels without allowing
-two domains of type isolated_domU_t to communicate with one another.
+type is needed for each group of domains. The user field can be used to address
+this for the most common case of groups that can communicate internally but not
+externally; see "Users and roles" below.
+
+Type transitions
+----------------
+
+Xen defines a number of operations such as memory mapping that are necessary for
+a domain to perform on itself, but are also undesirable to allow a domain to
+perform on every other domain of the same label. While it is possible to address
+this by only creating one domain per type, this solution significantly limits
+the flexibility of the type system. Another method to address this issue is to
+duplicate the permission names for every operation that can be performed on the
+current domain or on other domains; however, this significantly increases the
+necessary number of permissions and complicates the XSM hooks. Instead, this is
+addressed by allowing a distinct type to be used for a domain's access to
+itself. The same applies for a device model domain's access to its designated
+target, allowing the IS_PRIV_FOR checks used in Xen's DAC model to be
+implemented in FLASK.
+
+Upon domain creation (or relabel), a type transition is computed using the
+domain's label as the source and target. The result of this computation is used
+as the target when the domain accesses itself. In the example policy, this
+computed type is the result of appending _self to a domain's type: domU_t_self
+for domU_t. If no type transition rule exists, the domain will continue to use
+its own label for both the source and target. An AVC message will look like:
+
+    scontext=system_u:system_r:domU_t tcontext=system_u:system_r:domU_t_self
+
+A similar type transition is done when a device model domain is associated with
+its target using the set_target operation. The transition is computed with the
+target domain as the source and the device model domain as the target: this
+ordering was chosen in order to preserve the original label for the target when
+no type transition rule exists. In the example policy, these computed types are
+the result of appending _target to the domain.
+
+Type transitions are also used to compute the labels of event channels.
 
 Users and roles
 ---------------
@@ -84,7 +118,8 @@ the customer_1 user.
 Access control rules involving users and roles are defined in the policy
 constraints file (tools/flask/policy/policy/constraints). The example policy
 provides constraints that prevent different users from communicating using
-grants or event channels, while still allowing communication with dom0.
+grants or event channels, while still allowing communication with the system_u
+user where dom0 resides.
 
 Resource Policy
 ---------------
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 59ba171..d630f47 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -5,15 +5,34 @@
 # Domain creation and setup
 #
 ################################################################################
+define(`declare_domain_common', `
+	allow $1 $2:grant { query setup };
+	allow $1 $2:mmu { adjust physmap map_read map_write stat pinpage updatemp };
+	allow $1 $2:hvm { getparam setparam };
+')
+
 # declare_domain(type, attrs...)
-#   Declare a type as a domain type, and allow basic domain setup
+#   Declare a domain type, along with associated _self and _channel types
+#   Allow the domain to perform basic operations on itself
 define(`declare_domain', `
 	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
+	type $1_self, domain_type, domain_self_type;
+	type_transition $1 $1:domain $1_self;
+	type $1_channel, event_type;
+	type_transition $1 domain_type:event $1_channel;
+	declare_domain_common($1, $1_self)
+')
+
+# declare_singleton_domain(type, attrs...)
+#   Declare a domain type and associated _channel types.
+#   Note: Because the domain can perform basic operations on itself and any
+#   other domain of the same type, this constructor should be used for types
+#   containing at most one domain. This is not enforced by policy.
+define(`declare_singleton_domain', `
+	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
 	type $1_channel, event_type;
 	type_transition $1 domain_type:event $1_channel;
-	allow $1 $1:grant { query setup };
-	allow $1 $1:mmu { adjust physmap map_read map_write stat pinpage };
-	allow $1 $1:hvm { getparam setparam };
+	declare_domain_common($1, $1)
 ')
 
 # declare_build_label(type)
@@ -51,6 +70,7 @@ define(`create_domain_build_label', `
 	allow $1 $2_channel:event create;
 	allow $1 $2_building:domain2 relabelfrom;
 	allow $1 $2:domain2 relabelto;
+	allow $2_building $2:domain transition;
 ')
 
 # manage_domain(priv, target)
@@ -101,20 +121,36 @@ define(`domain_comms', `
 ')
 
 # domain_self_comms(domain)
-#   Allow a domain types to communicate with others of its type using grants
-#   and event channels (this includes event channels to DOMID_SELF)
+#   Allow a non-singleton domain type to communicate with itself using grants
+#   and event channels
 define(`domain_self_comms', `
-	create_channel($1, $1, $1_channel)
-	allow $1 $1:grant { map_read map_write copy unmap };
+	create_channel($1, $1_self, $1_channel)
+	allow $1 $1_self:grant { map_read map_write copy unmap };
 ')
 
 # device_model(dm_dom, hvm_dom)
 #   Define how a device model domain interacts with its target
 define(`device_model', `
-	domain_comms($1, $2)
-	allow $1 $2:domain { set_target shutdown };
-	allow $1 $2:mmu { map_read map_write adjust physmap };
-	allow $1 $2:hvm { getparam setparam trackdirtyvram hvmctl irqlevel pciroute cacheattr send_irq };
+	type $2_target, domain_type, domain_target_type;
+	type_transition $2 $1:domain $2_target;
+	allow $1 $2:domain set_target;
+
+	type_transition $2_target domain_type:event $2_channel;
+	create_channel($1, $2_target, $1_channel)
+	create_channel($2, $1, $2_channel)
+	allow $1 $2_channel:event create;
+
+	allow $1 $2_target:domain shutdown;
+	allow $1 $2_target:mmu { map_read map_write adjust physmap };
+	allow $1 $2_target:hvm { getparam setparam trackdirtyvram hvmctl irqlevel pciroute cacheattr send_irq };
+')
+
+# make_device_model(priv, dm_dom, hvm_dom)
+#   Allow creation of a device model and HVM domain pair
+define(`make_device_model', `
+	device_model($2, $3)
+	allow $1 $2:domain2 make_priv_for;
+	allow $1 $3:domain2 set_as_target;
 ')
 ################################################################################
 #
diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
index 1162153..8d33285 100644
--- a/tools/flask/policy/policy/modules/xen/xen.te
+++ b/tools/flask/policy/policy/modules/xen/xen.te
@@ -8,6 +8,8 @@
 ################################################################################
 attribute xen_type;
 attribute domain_type;
+attribute domain_self_type;
+attribute domain_target_type;
 attribute resource_type;
 attribute event_type;
 attribute mls_priv;
@@ -25,7 +27,7 @@ attribute mls_priv;
 type xen_t, xen_type, mls_priv;
 
 # Domain 0
-declare_domain(dom0_t, mls_priv);
+declare_singleton_domain(dom0_t, mls_priv);
 
 # Untracked I/O memory (pseudo-domain)
 type domio_t, xen_type;
@@ -69,7 +71,7 @@ admin_device(dom0_t, ioport_t)
 admin_device(dom0_t, iomem_t)
 allow dom0_t domio_t:mmu { map_read map_write };
 
-domain_self_comms(dom0_t)
+domain_comms(dom0_t, dom0_t)
 
 auditallow dom0_t security_t:security { load_policy setenforce setbool };
 
@@ -84,11 +86,14 @@ domain_self_comms(domU_t)
 create_domain(dom0_t, domU_t)
 manage_domain(dom0_t, domU_t)
 domain_comms(dom0_t, domU_t)
+domain_comms(domU_t, domU_t)
+domain_self_comms(domU_t)
 
 declare_domain(isolated_domU_t)
 create_domain(dom0_t, isolated_domU_t)
 manage_domain(dom0_t, isolated_domU_t)
 domain_comms(dom0_t, isolated_domU_t)
+domain_self_comms(isolated_domU_t)
 
 # Declare a boolean that denies creation of prot_domU_t domains
 gen_bool(prot_doms_locked, false)
@@ -98,6 +103,8 @@ if (!prot_doms_locked) {
 }
 domain_comms(dom0_t, prot_domU_t)
 domain_comms(domU_t, prot_domU_t)
+domain_comms(prot_domU_t, prot_domU_t)
+domain_self_comms(prot_domU_t)
 
 # domHVM_t is meant to be paired with a qemu-dm stub domain of type dm_dom_t
 declare_domain(domHVM_t)
@@ -110,7 +117,7 @@ declare_domain(dm_dom_t)
 create_domain(dom0_t, dm_dom_t)
 manage_domain(dom0_t, dm_dom_t)
 domain_comms(dom0_t, dm_dom_t)
-device_model(dm_dom_t, domHVM_t)
+make_device_model(dom0_t, dm_dom_t, domHVM_t)
 
 # nomigrate_t must be built via the nomigrate_t_building label; once built,
 # dom0 cannot read its memory.
diff --git a/xen/xsm/flask/flask_op.c b/xen/xsm/flask/flask_op.c
index a5d7748..4426ab9 100644
--- a/xen/xsm/flask/flask_op.c
+++ b/xen/xsm/flask/flask_op.c
@@ -612,6 +612,15 @@ static int flask_relabel_domain(struct xen_flask_relabel *arg)
         goto out;
 
     dsec->sid = arg->sid;
+    dsec->self_sid = arg->sid;
+    security_transition_sid(dsec->sid, dsec->sid, SECCLASS_DOMAIN,
+                            &dsec->self_sid);
+    if ( d->target )
+    {
+        struct domain_security_struct *tsec = d->target->ssid;
+        security_transition_sid(tsec->sid, dsec->sid, SECCLASS_DOMAIN,
+                                &dsec->target_sid);
+    }
 
  out:
     rcu_unlock_domain(d);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index dbbf34f..a8475ea 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -33,38 +33,69 @@
 
 struct xsm_operations *original_ops = NULL;
 
+static u32 domain_sid(struct domain *dom)
+{
+    struct domain_security_struct *dsec = dom->ssid;
+    return dsec->sid;
+}
+
+static u32 domain_target_sid(struct domain *src, struct domain *dst)
+{
+    struct domain_security_struct *ssec = src->ssid;
+    struct domain_security_struct *dsec = dst->ssid;
+    if (src == dst)
+        return ssec->self_sid;
+    if (src->target == dst)
+        return ssec->target_sid;
+    return dsec->sid;
+}
+
+static u32 evtchn_sid(const struct evtchn *chn)
+{
+    struct evtchn_security_struct *esec = chn->ssid;
+    return esec->sid;
+}
+
 static int domain_has_perm(struct domain *dom1, struct domain *dom2, 
                            u16 class, u32 perms)
 {
-    struct domain_security_struct *dsec1, *dsec2;
+    u32 ssid, tsid;
     struct avc_audit_data ad;
     AVC_AUDIT_DATA_INIT(&ad, NONE);
     ad.sdom = dom1;
     ad.tdom = dom2;
 
-    dsec1 = dom1->ssid;
-    dsec2 = dom2->ssid;
+    ssid = domain_sid(dom1);
+    tsid = domain_target_sid(dom1, dom2);
 
-    return avc_has_perm(dsec1->sid, dsec2->sid, class, perms, &ad);
+    return avc_has_perm(ssid, tsid, class, perms, &ad);
 }
 
-static int domain_has_evtchn(struct domain *d, struct evtchn *chn, u32 perms)
+static int avc_current_has_perm(u32 tsid, u16 class, u32 perm,
+                                struct avc_audit_data *ad)
 {
-    struct domain_security_struct *dsec;
-    struct evtchn_security_struct *esec;
+    u32 csid = domain_sid(current->domain);
+    return avc_has_perm(csid, tsid, class, perm, ad);
+}
 
-    dsec = d->ssid;
-    esec = chn->ssid;
+static int current_has_perm(struct domain *d, u16 class, u32 perms)
+{
+    return domain_has_perm(current->domain, d, class, perms);
+}
 
-    return avc_has_perm(dsec->sid, esec->sid, SECCLASS_EVENT, perms, NULL);
+static int domain_has_evtchn(struct domain *d, struct evtchn *chn, u32 perms)
+{
+    u32 dsid = domain_sid(d);
+    u32 esid = evtchn_sid(chn);
+
+    return avc_has_perm(dsid, esid, SECCLASS_EVENT, perms, NULL);
 }
 
 static int domain_has_xen(struct domain *d, u32 perms)
 {
-    struct domain_security_struct *dsec;
-    dsec = d->ssid;
+    u32 dsid = domain_sid(d);
 
-    return avc_has_perm(dsec->sid, SECINITSID_XEN, SECCLASS_XEN, perms, NULL);
+    return avc_has_perm(dsid, SECINITSID_XEN, SECCLASS_XEN, perms, NULL);
 }
 
 static int get_irq_sid(int irq, u32 *sid, struct avc_audit_data *ad)
@@ -123,6 +154,7 @@ static int flask_domain_alloc_security(struct domain *d)
         dsec->sid = SECINITSID_UNLABELED;
     }
 
+    dsec->self_sid = dsec->sid;
     d->ssid = dsec;
 
     return 0;
@@ -142,68 +174,55 @@ static void flask_domain_free_security(struct domain *d)
 static int flask_evtchn_unbound(struct domain *d1, struct evtchn *chn, 
                                 domid_t id2)
 {
-    u32 newsid;
+    u32 sid1, sid2, newsid;
     int rc;
-    domid_t id;
     struct domain *d2;
-    struct domain_security_struct *dsec, *dsec1, *dsec2;
     struct evtchn_security_struct *esec;
 
-    dsec = current->domain->ssid;
-    dsec1 = d1->ssid;
-    esec = chn->ssid;
-
-    if ( id2 == DOMID_SELF )
-        id = current->domain->domain_id;
-    else
-        id = id2;
-
-    d2 = get_domain_by_id(id);
+    d2 = rcu_lock_domain_by_any_id(id2);
     if ( d2 == NULL )
         return -EPERM;
 
-    dsec2 = d2->ssid;
-    rc = security_transition_sid(dsec1->sid, dsec2->sid, SECCLASS_EVENT, 
-                                 &newsid);
+    sid1 = domain_sid(d1);
+    sid2 = domain_target_sid(d1, d2);
+    esec = chn->ssid;
+
+    rc = security_transition_sid(sid1, sid2, SECCLASS_EVENT, &newsid);
     if ( rc )
         goto out;
 
-    rc = avc_has_perm(dsec->sid, newsid, SECCLASS_EVENT, EVENT__CREATE, NULL);
+    rc = avc_current_has_perm(newsid, SECCLASS_EVENT, EVENT__CREATE, NULL);
     if ( rc )
         goto out;
 
-    rc = avc_has_perm(newsid, dsec2->sid, SECCLASS_EVENT, EVENT__BIND, NULL);
+    rc = avc_has_perm(newsid, sid2, SECCLASS_EVENT, EVENT__BIND, NULL);
     if ( rc )
         goto out;
-    else
-        esec->sid = newsid;
+
+    esec->sid = newsid;
 
  out:
-    put_domain(d2);
+    rcu_unlock_domain(d2);
     return rc;
 }
 
 static int flask_evtchn_interdomain(struct domain *d1, struct evtchn *chn1, 
                                     struct domain *d2, struct evtchn *chn2)
 {
-    u32 newsid;
+    u32 sid1, sid2, newsid, reverse_sid;
     int rc;
-    struct domain_security_struct *dsec, *dsec1, *dsec2;
-    struct evtchn_security_struct *esec1, *esec2;
+    struct evtchn_security_struct *esec1;
     struct avc_audit_data ad;
     AVC_AUDIT_DATA_INIT(&ad, NONE);
     ad.sdom = d1;
     ad.tdom = d2;
 
-    dsec = current->domain->ssid;
-    dsec1 = d1->ssid;
-    dsec2 = d2->ssid;
+    sid1 = domain_sid(d1);
+    sid2 = domain_target_sid(d1, d2);
 
     esec1 = chn1->ssid;
-    esec2 = chn2->ssid;
 
-    rc = security_transition_sid(dsec1->sid, dsec2->sid, 
-                                 SECCLASS_EVENT, &newsid);
+    rc = security_transition_sid(sid1, sid2, SECCLASS_EVENT, &newsid);
     if ( rc )
     {
         printk("%s: security_transition_sid failed, rc=%d (domain=%d)\n",
@@ -211,15 +230,20 @@ static int flask_evtchn_interdomain(struct domain *d1, struct evtchn *chn1,
         return rc;
     }
 
-    rc = avc_has_perm(dsec->sid, newsid, SECCLASS_EVENT, EVENT__CREATE, &ad);
+    rc = avc_current_has_perm(newsid, SECCLASS_EVENT, EVENT__CREATE, &ad);
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(newsid, dsec2->sid, SECCLASS_EVENT, EVENT__BIND, &ad);
+    rc = avc_has_perm(newsid, sid2, SECCLASS_EVENT, EVENT__BIND, &ad);
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(esec2->sid, dsec1->sid, SECCLASS_EVENT, EVENT__BIND, &ad);
+    /* It's possible the target domain has changed (relabel or destroy/create)
+     * since the unbound part was created; re-validate this binding now.
+     */
+    reverse_sid = evtchn_sid(chn2);
+    sid1 = domain_target_sid(d2, d1);
+    rc = avc_has_perm(reverse_sid, sid1, SECCLASS_EVENT, EVENT__BIND, &ad);
     if ( rc )
         return rc;
 
@@ -302,7 +326,6 @@ static void flask_free_security_evtchn(struct evtchn *chn)
 
 static char *flask_show_security_evtchn(struct domain *d, const struct evtchn *chn)
 {
-    struct evtchn_security_struct *esec;
     int irq;
     u32 sid = 0;
     char *ctx;
@@ -312,9 +335,7 @@ static char *flask_show_security_evtchn(struct domain *d, const struct evtchn *c
     {
     case ECS_UNBOUND:
     case ECS_INTERDOMAIN:
-        esec = chn->ssid;
-        if ( esec )
-            sid = esec->sid;
+        sid = evtchn_sid(chn);
         break;
     case ECS_PIRQ:
         irq = domain_pirq_to_irq(d, chn->u.pirq.irq);
@@ -367,12 +388,12 @@ static int flask_grant_query_size(struct domain *d1, struct domain *d2)
 
 static int flask_get_pod_target(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__GETPODTARGET);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETPODTARGET);
 }
 
 static int flask_set_pod_target(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SETPODTARGET);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETPODTARGET);
 }
 
 static int flask_memory_adjust_reservation(struct domain *d1, struct domain *d2)
@@ -455,70 +476,65 @@ static int flask_schedop_shutdown(struct domain *d1, struct domain *d2)
 static void flask_security_domaininfo(struct domain *d, 
                                       struct xen_domctl_getdomaininfo *info)
 {
-    struct domain_security_struct *dsec;
-
-    dsec = d->ssid;
-    info->ssidref = dsec->sid;
+    info->ssidref = domain_sid(d);
 }
 
 static int flask_setvcpucontext(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__SETVCPUCONTEXT);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT);
 }
 
 static int flask_pausedomain(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
 }
 
 static int flask_unpausedomain(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
 }
 
 static int flask_resumedomain(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__RESUME);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__RESUME);
 }
 
 static int flask_domain_create(struct domain *d, u32 ssidref)
 {
     int rc;
-    struct domain_security_struct *dsec1;
-    struct domain_security_struct *dsec2;
+    struct domain_security_struct *dsec = d->ssid;
     static int dom0_created = 0;
 
-    dsec1 = current->domain->ssid;
-    dsec2 = d->ssid;
-
     if ( is_idle_domain(current->domain) && !dom0_created )
     {
-        dsec2->sid = SECINITSID_DOM0;
+        dsec->sid = SECINITSID_DOM0;
         dom0_created = 1;
-        return 0;
     }
+    else
+    {
+        rc = avc_current_has_perm(ssidref, SECCLASS_DOMAIN,
+                          DOMAIN__CREATE, NULL);
+        if ( rc )
+            return rc;
 
-    rc = avc_has_perm(dsec1->sid, ssidref, SECCLASS_DOMAIN,
-                      DOMAIN__CREATE, NULL);
-    if ( rc )
-        return rc;
+        dsec->sid = ssidref;
+    }
+    dsec->self_sid = dsec->sid;
 
-    dsec2->sid = ssidref;
+    rc = security_transition_sid(dsec->sid, dsec->sid, SECCLASS_DOMAIN,
+                                 &dsec->self_sid);
 
     return rc;
 }
 
 static int flask_max_vcpus(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__MAX_VCPUS);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS);
 }
 
 static int flask_destroydomain(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__DESTROY);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__DESTROY);
 }
 
 static int flask_vcpuaffinity(int cmd, struct domain *d)
@@ -537,7 +553,7 @@ static int flask_vcpuaffinity(int cmd, struct domain *d)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm );
+    return current_has_perm(d, SECCLASS_DOMAIN, perm );
 }
 
 static int flask_scheduler(struct domain *d)
@@ -548,43 +564,51 @@ static int flask_scheduler(struct domain *d)
     if ( rc )
         return rc;
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__SCHEDULER);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SCHEDULER);
 }
 
 static int flask_getdomaininfo(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__GETDOMAININFO);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO);
 }
 
 static int flask_getvcpucontext(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, 
-                           DOMAIN__GETVCPUCONTEXT);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT);
 }
 
 static int flask_getvcpuinfo(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__GETVCPUINFO);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO);
 }
 
 static int flask_domain_settime(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
 }
 
-static int flask_set_target(struct domain *d, struct domain *e)
+static int flask_set_target(struct domain *d, struct domain *t)
 {
     int rc;
-    rc = domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR);
+    struct domain_security_struct *dsec, *tsec;
+    dsec = d->ssid;
+    tsec = t->ssid;
+
+    rc = current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR);
     if ( rc )
         return rc;
-    rc = domain_has_perm(current->domain, e, SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET);
+    rc = current_has_perm(t, SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET);
     if ( rc )
         return rc;
-    return domain_has_perm(d, e, SECCLASS_DOMAIN, DOMAIN__SET_TARGET);
+    /* Use avc_has_perm to avoid resolving target/current SID */
+    rc = avc_has_perm(dsec->sid, tsec->sid, SECCLASS_DOMAIN, DOMAIN__SET_TARGET, NULL);
+    if ( rc )
+        return rc;
+
+    /* (tsec, dsec) defaults the label to tsec, as it should here */
+    rc = security_transition_sid(tsec->sid, dsec->sid, SECCLASS_DOMAIN,
+                                 &dsec->target_sid);
+    return rc;
 }
 
 static int flask_domctl(struct domain *d, int cmd)
@@ -655,26 +679,24 @@ static int flask_domctl(struct domain *d, int cmd)
     case XEN_DOMCTL_gdbsx_pausevcpu:
     case XEN_DOMCTL_gdbsx_unpausevcpu:
     case XEN_DOMCTL_gdbsx_domstatus:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                               DOMAIN__SETDEBUGGING);
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
 
     case XEN_DOMCTL_subscribe:
     case XEN_DOMCTL_disable_migrate:
     case XEN_DOMCTL_suppress_spurious_page_faults:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                               DOMAIN__SET_MISC_INFO);
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO);
 
     case XEN_DOMCTL_set_cpuid:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID);
+        return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID);
 
     case XEN_DOMCTL_gettscinfo:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__GETTSC);
+        return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__GETTSC);
 
     case XEN_DOMCTL_settscinfo:
-        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__SETTSC);
+        return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SETTSC);
 
     case XEN_DOMCTL_audit_p2m:
-        return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__AUDIT_P2M);
+        return current_has_perm(d, SECCLASS_HVM, HVM__AUDIT_P2M);
 
     default:
         printk("flask_domctl: Unknown op %d\n", cmd);
@@ -716,7 +738,7 @@ static int flask_sysctl(int cmd)
 
 static int flask_set_virq_handler(struct domain *d, uint32_t virq)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
 }
 
 static int flask_tbufcontrol(void)
@@ -741,20 +763,17 @@ static int flask_sched_id(void)
 
 static int flask_setdomainmaxmem(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__SETDOMAINMAXMEM);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM);
 }
 
 static int flask_setdomainhandle(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__SETDOMAINHANDLE);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE);
 }
 
 static int flask_setdebugging(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__SETDEBUGGING);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
 }
 
 static int flask_debug_keys(void)
@@ -816,14 +835,12 @@ static char *flask_show_irq_sid (int irq)
 
 static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
 {
-    u32 sid;
+    u32 sid, dsid;
     int rc = -EPERM;
     struct msi_info *msi = data;
-
-    struct domain_security_struct *ssec, *tsec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__ADD);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
 
     if ( rc )
         return rc;
@@ -839,14 +856,13 @@ static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
     if ( rc )
         return rc;
 
-    ssec = current->domain->ssid;
-    tsec = d->ssid;
+    dsid = domain_sid(d);
 
-    rc = avc_has_perm(ssec->sid, sid, SECCLASS_RESOURCE, RESOURCE__ADD_IRQ, &ad);
+    rc = avc_current_has_perm(sid, SECCLASS_RESOURCE, RESOURCE__ADD_IRQ, &ad);
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    rc = avc_has_perm(dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
     return rc;
 }
 
@@ -854,16 +870,12 @@ static int flask_unmap_domain_pirq (struct domain *d, int irq)
 {
     u32 sid;
     int rc = -EPERM;
-
-    struct domain_security_struct *ssec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
     if ( rc )
         return rc;
 
-    ssec = current->domain->ssid;
-
     if ( irq >= nr_irqs_gsi ) {
         /* TODO support for MSI here */
         return 0;
@@ -873,19 +885,19 @@ static int flask_unmap_domain_pirq (struct domain *d, int irq)
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(ssec->sid, sid, SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, &ad);
+    rc = avc_current_has_perm(sid, SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, &ad);
     return rc;
 }
 
 static int flask_irq_permission (struct domain *d, int pirq, uint8_t access)
 {
     /* the PIRQ number is not useful; real IRQ is checked during mapping */
-    return domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
-                           resource_to_perm(access));
+    return current_has_perm(d, SECCLASS_RESOURCE, resource_to_perm(access));
 }
 
 struct iomem_has_perm_data {
-    struct domain_security_struct *ssec, *tsec;
+    u32 ssid;
+    u32 dsid;
     u32 perm;
 };
 
@@ -899,12 +911,12 @@ static int _iomem_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     ad.range.start = start;
     ad.range.end = end;
 
-    rc = avc_has_perm(data->ssec->sid, sid, SECCLASS_RESOURCE, data->perm, &ad);
+    rc = avc_has_perm(data->ssid, sid, SECCLASS_RESOURCE, data->perm, &ad);
 
     if ( rc )
         return rc;
 
-    return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    return avc_has_perm(data->dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
 static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
@@ -912,7 +924,7 @@ static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end
     struct iomem_has_perm_data data;
     int rc;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
+    rc = current_has_perm(d, SECCLASS_RESOURCE,
                          resource_to_perm(access));
     if ( rc )
         return rc;
@@ -922,8 +934,8 @@ static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end
     else
         data.perm = RESOURCE__REMOVE_IOMEM;
 
-    data.ssec = current->domain->ssid;
-    data.tsec = d->ssid;
+    data.ssid = domain_sid(current->domain);
+    data.dsid = domain_sid(d);
 
     return security_iterate_iomem_sids(start, end, _iomem_has_perm, &data);
 }
@@ -935,10 +947,9 @@ static int flask_iomem_mapping(struct domain *d, uint64_t start, uint64_t end, u
 
 static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
-    u32 rsid;
+    u32 dsid, rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
     u32 perm = RESOURCE__USE;
 
     rc = security_device_sid(machine_bdf, &rsid);
@@ -951,33 +962,24 @@ static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, u
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = d->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
+    dsid = domain_sid(d);
+    return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, perm, &ad);
 
 }
 
 static int flask_resource_plug_core(void)
 {
-    struct domain_security_struct *ssec;
-
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__PLUG, NULL);
+    return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__PLUG, NULL);
 }
 
 static int flask_resource_unplug_core(void)
 {
-    struct domain_security_struct *ssec;
-
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__UNPLUG, NULL);
+    return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__UNPLUG, NULL);
 }
 
 static int flask_resource_use_core(void)
 {
-    struct domain_security_struct *ssec;
-
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__USE, NULL);
+    return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__USE, NULL);
 }
 
 static int flask_resource_plug_pci(uint32_t machine_bdf)
@@ -985,7 +987,6 @@ static int flask_resource_plug_pci(uint32_t machine_bdf)
     u32 rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
@@ -993,8 +994,7 @@ static int flask_resource_plug_pci(uint32_t machine_bdf)
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__PLUG, &ad);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__PLUG, &ad);
 }
 
 static int flask_resource_unplug_pci(uint32_t machine_bdf)
@@ -1002,7 +1002,6 @@ static int flask_resource_unplug_pci(uint32_t machine_bdf)
     u32 rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
@@ -1010,8 +1009,7 @@ static int flask_resource_unplug_pci(uint32_t machine_bdf)
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__UNPLUG, &ad);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__UNPLUG, &ad);
 }
 
 static int flask_resource_setup_pci(uint32_t machine_bdf)
@@ -1019,7 +1017,6 @@ static int flask_resource_setup_pci(uint32_t machine_bdf)
     u32 rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
@@ -1027,8 +1024,7 @@ static int flask_resource_setup_pci(uint32_t machine_bdf)
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
 static int flask_resource_setup_gsi(int gsi)
@@ -1036,22 +1032,17 @@ static int flask_resource_setup_gsi(int gsi)
     u32 rsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    struct domain_security_struct *ssec;
 
     rc = get_irq_sid(gsi, &rsid, &ad);
     if ( rc )
         return rc;
 
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
 static int flask_resource_setup_misc(void)
 {
-    struct domain_security_struct *ssec;
-
-    ssec = current->domain->ssid;
-    return avc_has_perm(ssec->sid, SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);
+    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);
 }
 
 static inline int flask_page_offline(uint32_t cmd)
@@ -1114,11 +1105,12 @@ static int flask_shadow_control(struct domain *d, uint32_t op)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_SHADOW, perm);
+    return current_has_perm(d, SECCLASS_SHADOW, perm);
 }
 
 struct ioport_has_perm_data {
-    struct domain_security_struct *ssec, *tsec;
+    u32 ssid;
+    u32 dsid;
     u32 perm;
 };
 
@@ -1132,12 +1124,12 @@ static int _ioport_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     ad.range.start = start;
     ad.range.end = end;
 
-    rc = avc_has_perm(data->ssec->sid, sid, SECCLASS_RESOURCE, data->perm, &ad);
+    rc = avc_has_perm(data->ssid, sid, SECCLASS_RESOURCE, data->perm, &ad);
 
     if ( rc )
         return rc;
 
-    return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    return avc_has_perm(data->dsid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
 static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
@@ -1145,7 +1137,7 @@ static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t en
     int rc;
     struct ioport_has_perm_data data;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
+    rc = current_has_perm(d, SECCLASS_RESOURCE,
                          resource_to_perm(access));
 
     if ( rc )
@@ -1156,8 +1148,8 @@ static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t en
     else
         data.perm = RESOURCE__REMOVE_IOPORT;
 
-    data.ssec = current->domain->ssid;
-    data.tsec = d->ssid;
+    data.ssid = domain_sid(current->domain);
+    data.dsid = domain_sid(d);
 
     return security_iterate_ioport_sids(start, end, _ioport_has_perm, &data);
 }
@@ -1169,18 +1161,17 @@ static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end,
 
 static int flask_getpageframeinfo(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_MMU, MMU__PAGEINFO);
+    return current_has_perm(d, SECCLASS_MMU, MMU__PAGEINFO);
 }
 
 static int flask_getmemlist(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_MMU, MMU__PAGELIST);
+    return current_has_perm(d, SECCLASS_MMU, MMU__PAGELIST);
 }
 
 static int flask_hypercall_init(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
-                           DOMAIN__HYPERCALL);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__HYPERCALL);
 }
 
 static int flask_hvmcontext(struct domain *d, uint32_t cmd)
@@ -1203,7 +1194,7 @@ static int flask_hvmcontext(struct domain *d, uint32_t cmd)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, perm);
+    return current_has_perm(d, SECCLASS_HVM, perm);
 }
 
 static int flask_address_size(struct domain *d, uint32_t cmd)
@@ -1222,7 +1213,7 @@ static int flask_address_size(struct domain *d, uint32_t cmd)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
+    return current_has_perm(d, SECCLASS_DOMAIN, perm);
 }
 
 static int flask_machine_address_size(struct domain *d, uint32_t cmd)
@@ -1263,37 +1254,37 @@ static int flask_hvm_param(struct domain *d, unsigned long op)
         perm = HVM__HVMCTL;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, perm);
+    return current_has_perm(d, SECCLASS_HVM, perm);
 }
 
 static int flask_hvm_set_pci_intx_level(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__PCILEVEL);
+    return current_has_perm(d, SECCLASS_HVM, HVM__PCILEVEL);
 }
 
 static int flask_hvm_set_isa_irq_level(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__IRQLEVEL);
+    return current_has_perm(d, SECCLASS_HVM, HVM__IRQLEVEL);
 }
 
 static int flask_hvm_set_pci_link_route(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__PCIROUTE);
+    return current_has_perm(d, SECCLASS_HVM, HVM__PCIROUTE);
 }
 
 static int flask_hvm_inject_msi(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__SEND_IRQ);
+    return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
 static int flask_mem_event(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__MEM_EVENT);
+    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
 
 static int flask_mem_sharing(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__MEM_SHARING);
+    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
 }
 
 static int flask_apic(struct domain *d, int cmd)
@@ -1355,11 +1346,7 @@ static int flask_physinfo(void)
 
 static int flask_platform_quirk(uint32_t quirk)
 {
-    struct domain_security_struct *dsec;
-    dsec = current->domain->ssid;
-
-    return avc_has_perm(dsec->sid, SECINITSID_XEN, SECCLASS_XEN, 
-                        XEN__QUIRK, NULL);
+    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN, XEN__QUIRK, NULL);
 }
 
 static int flask_platform_op(uint32_t op)
@@ -1421,16 +1408,12 @@ static int flask_getidletime(void)
 
 static int flask_machine_memory_map(void)
 {
-    struct domain_security_struct *dsec;
-    dsec = current->domain->ssid;
-
-    return avc_has_perm(dsec->sid, SECINITSID_XEN, SECCLASS_MMU, 
-                        MMU__MEMORYMAP, NULL);
+    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_MMU, MMU__MEMORYMAP, NULL);
 }
 
 static int flask_domain_memory_map(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_MMU, MMU__MEMORYMAP);
+    return current_has_perm(d, SECCLASS_MMU, MMU__MEMORYMAP);
 }
 
 static int domain_memory_perm(struct domain *d, struct domain *f, l1_pgentry_t pte)
@@ -1453,17 +1436,17 @@ static int domain_memory_perm(struct domain *d, struct domain *f, l1_pgentry_t p
     if ( f->domain_id == DOMID_IO || !mfn_valid(fmfn) )
     {
         struct avc_audit_data ad;
-        struct domain_security_struct *dsec = d->ssid;
-        u32 fsid;
+        u32 dsid, fsid;
+        rc = security_iomem_sid(fmfn, &fsid);
+        if ( rc )
+            return rc;
         AVC_AUDIT_DATA_INIT(&ad, MEMORY);
         ad.sdom = d;
         ad.tdom = f;
         ad.memory.pte = pte.l1;
         ad.memory.mfn = fmfn;
-        rc = security_iomem_sid(fmfn, &fsid);
-        if ( rc )
-            return rc;
-        return avc_has_perm(dsec->sid, fsid, SECCLASS_MMU, map_perms, &ad);
+        dsid = domain_sid(d);
+        return avc_has_perm(dsid, fsid, SECCLASS_MMU, map_perms, &ad);
     }
 
     return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
@@ -1506,43 +1489,40 @@ static int flask_remove_from_physmap(struct domain *d1, struct domain *d2)
 
 static int flask_sendtrigger(struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
+    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
 }
 
 static int flask_get_device_group(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
-    struct domain_security_struct *ssec = current->domain->ssid;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
         return rc;
 
-    return avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
 }
 
 static int flask_test_assign_device(uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
-    struct domain_security_struct *ssec = current->domain->ssid;
 
     rc = security_device_sid(machine_bdf, &rsid);
     if ( rc )
         return rc;
 
-    return rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, NULL);
 }
 
 static int flask_assign_device(struct domain *d, uint32_t machine_bdf)
 {
-    u32 rsid;
+    u32 dsid, rsid;
     int rc = -EPERM;
-    struct domain_security_struct *ssec, *tsec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__ADD);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
     if ( rc )
         return rc;
 
@@ -1552,22 +1532,20 @@ static int flask_assign_device(struct domain *d, uint32_t machine_bdf)
 
     AVC_AUDIT_DATA_INIT(&ad, DEV);
     ad.device = (unsigned long) machine_bdf;
-    ssec = current->domain->ssid;
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__ADD_DEVICE, &ad);
+    rc = avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__ADD_DEVICE, &ad);
     if ( rc )
         return rc;
 
-    tsec = d->ssid;
-    return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    dsid = domain_sid(d);
+    return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
 static int flask_deassign_device(struct domain *d, uint32_t machine_bdf)
 {
     u32 rsid;
     int rc = -EPERM;
-    struct domain_security_struct *ssec = current->domain->ssid;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
     if ( rc )
         return rc;
 
@@ -1575,18 +1553,17 @@ static int flask_deassign_device(struct domain *d, uint32_t machine_bdf)
     if ( rc )
         return rc;
 
-    return rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__REMOVE_DEVICE, NULL);
+    return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__REMOVE_DEVICE, NULL);
 }
 
 static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
-    u32 rsid;
+    u32 dsid, rsid;
     int rc = -EPERM;
     int irq;
-    struct domain_security_struct *ssec, *tsec;
     struct avc_audit_data ad;
 
-    rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__ADD);
+    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
     if ( rc )
         return rc;
 
@@ -1596,23 +1573,22 @@ static int flask_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *b
     if ( rc )
         return rc;
 
-    ssec = current->domain->ssid;
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_HVM, HVM__BIND_IRQ, &ad);
+    rc = avc_current_has_perm(rsid, SECCLASS_HVM, HVM__BIND_IRQ, &ad);
     if ( rc )
         return rc;
 
-    tsec = d->ssid;
-    return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+    dsid = domain_sid(d);
+    return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
 static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
+    return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
 
 static int flask_pin_mem_cacheattr (struct domain *d)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__CACHEATTR);
+    return current_has_perm(d, SECCLASS_HVM, HVM__CACHEATTR);
 }
 
 static int flask_ext_vcpucontext (struct domain *d, uint32_t cmd)
@@ -1631,7 +1607,7 @@ static int flask_ext_vcpucontext (struct domain *d, uint32_t cmd)
         return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
+    return current_has_perm(d, SECCLASS_DOMAIN, perm);
 }
 
 static int flask_vcpuextstate (struct domain *d, uint32_t cmd)
@@ -1650,7 +1626,7 @@ static int flask_vcpuextstate (struct domain *d, uint32_t cmd)
             return -EPERM;
     }
 
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
+    return current_has_perm(d, SECCLASS_DOMAIN, perm);
 }
 #endif
 
diff --git a/xen/xsm/flask/include/objsec.h b/xen/xsm/flask/include/objsec.h
index 4ff52be..6595dc3 100644
--- a/xen/xsm/flask/include/objsec.h
+++ b/xen/xsm/flask/include/objsec.h
@@ -19,6 +19,8 @@
 
 struct domain_security_struct {
     u32 sid;               /* current SID */
+    u32 self_sid;          /* SID for target when operating on DOMID_SELF */
+    u32 target_sid;        /* SID for device model target domain */
 };
 
 struct evtchn_security_struct {
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSeo-0002O4-86; Fri, 30 Nov 2012 15:37:38 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSem-0002MP-Gd
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:36 +0000
Received: from [193.109.254.147:14331] by server-16.bemta-14.messagelabs.com
	id 83/17-09215-0C2D8B05; Fri, 30 Nov 2012 15:37:36 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-27.messagelabs.com!1354289854!2114142!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 503 invoked from network); 30 Nov 2012 15:37:34 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-11.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:34 -0000
X-TM-IMSS-Message-ID: <d0a0ed19000589c6@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0ed19000589c6 ;
	Fri, 30 Nov 2012 10:37:39 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd7017785; 
	Fri, 30 Nov 2012 10:37:33 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:01 -0500
Message-Id: <1354289830-24642-15-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 14/23] arch/x86: Add missing mem_sharing XSM
	hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This patch adds splits up the mem_sharing and mem_event XSM hooks to
better cover what the code is doing. It also changes the utility
function get_mem_event_op_target to rcu_lock_live_remote_domain_by_id
because there is no mm-specific logic in there.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
---
 tools/flask/policy/policy/flask/access_vectors |  1 +
 xen/arch/x86/domctl.c                          |  8 ++---
 xen/arch/x86/mm/mem_event.c                    | 41 ++++++++------------------
 xen/arch/x86/mm/mem_sharing.c                  | 25 +++++++++++++---
 xen/common/domain.c                            | 15 ++++++++++
 xen/include/asm-x86/mem_event.h                |  1 -
 xen/include/xen/sched.h                        |  6 ++++
 xen/include/xsm/dummy.h                        | 23 ++++++++++++++-
 xen/include/xsm/xsm.h                          | 24 +++++++++++++--
 xen/xsm/dummy.c                                |  5 +++-
 xen/xsm/flask/hooks.c                          | 25 ++++++++++++++--
 xen/xsm/flask/include/av_perm_to_string.h      |  1 +
 xen/xsm/flask/include/av_permissions.h         |  1 +
 13 files changed, 130 insertions(+), 46 deletions(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index ea65e45..45ac437 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -102,6 +102,7 @@ class hvm
     mem_sharing
     audit_p2m
     send_irq
+    share_mem
 }
 
 class event
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 30518aa..34e6223 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1503,10 +1503,8 @@ long arch_do_domctl(
         d = rcu_lock_domain_by_id(domctl->domain);
         if ( d != NULL )
         {
-            ret = xsm_mem_event(d);
-            if ( !ret )
-                ret = mem_event_domctl(d, &domctl->u.mem_event_op,
-                                       guest_handle_cast(u_domctl, void));
+            ret = mem_event_domctl(d, &domctl->u.mem_event_op,
+                                   guest_handle_cast(u_domctl, void));
             rcu_unlock_domain(d);
             copy_to_guest(u_domctl, domctl, 1);
         } 
@@ -1562,7 +1560,7 @@ long arch_do_domctl(
         d = rcu_lock_domain_by_id(domctl->domain);
         if ( d != NULL )
         {
-            ret = xsm_mem_event(d);
+            ret = xsm_mem_event_setup(d);
             if ( !ret ) {
                 p2m = p2m_get_hostp2m(d);
                 p2m->access_required = domctl->u.access_required.access_required;
diff --git a/xen/arch/x86/mm/mem_event.c b/xen/arch/x86/mm/mem_event.c
index 27d1cf4..c2b3670 100644
--- a/xen/arch/x86/mm/mem_event.c
+++ b/xen/arch/x86/mm/mem_event.c
@@ -29,6 +29,7 @@
 #include <asm/mem_paging.h>
 #include <asm/mem_access.h>
 #include <asm/mem_sharing.h>
+#include <xsm/xsm.h>
 
 /* for public/io/ring.h macros */
 #define xen_mb()   mb()
@@ -439,35 +440,19 @@ static void mem_sharing_notification(struct vcpu *v, unsigned int port)
         mem_sharing_sharing_resume(v->domain);
 }
 
-struct domain *get_mem_event_op_target(uint32_t domain, int *rc)
-{
-    struct domain *d;
-
-    /* Get the target domain */
-    *rc = rcu_lock_remote_target_domain_by_id(domain, &d);
-    if ( *rc != 0 )
-        return NULL;
-
-    /* Not dying? */
-    if ( d->is_dying )
-    {
-        rcu_unlock_domain(d);
-        *rc = -EINVAL;
-        return NULL;
-    }
-    
-    return d;
-}
-
 int do_mem_event_op(int op, uint32_t domain, void *arg)
 {
     int ret;
     struct domain *d;
 
-    d = get_mem_event_op_target(domain, &ret);
-    if ( !d )
+    ret = rcu_lock_live_remote_domain_by_id(domain, &d);
+    if ( ret )
         return ret;
 
+    ret = xsm_mem_event_op(d, op);
+    if ( ret )
+        goto out;
+
     switch (op)
     {
         case XENMEM_paging_op:
@@ -483,6 +468,7 @@ int do_mem_event_op(int op, uint32_t domain, void *arg)
             ret = -ENOSYS;
     }
 
+ out:
     rcu_unlock_domain(d);
     return ret;
 }
@@ -516,6 +502,10 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
 {
     int rc;
 
+    rc = xsm_mem_event_control(d, mec->mode, mec->op);
+    if ( rc )
+        return rc;
+
     if ( unlikely(d == current->domain) )
     {
         gdprintk(XENLOG_INFO, "Tried to do a memory event op on itself.\n");
@@ -537,13 +527,6 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
         return -EINVAL;
     }
 
-    /* TODO: XSM hook */
-#if 0
-    rc = xsm_mem_event_control(d, mec->op);
-    if ( rc )
-        return rc;
-#endif
-
     rc = -ENOSYS;
 
     switch ( mec->mode )
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5103285..9229b83 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -34,6 +34,7 @@
 #include <asm/atomic.h>
 #include <xen/rcupdate.h>
 #include <asm/event.h>
+#include <xsm/xsm.h>
 
 #include "mm-locks.h"
 
@@ -1345,10 +1346,18 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( !mem_sharing_enabled(d) )
                 return -EINVAL;
 
-            cd = get_mem_event_op_target(mec->u.share.client_domain, &rc);
-            if ( !cd )
+            rc = rcu_lock_live_remote_domain_by_id(mec->u.share.client_domain,
+                                                   &cd);
+            if ( rc )
                 return rc;
 
+            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            if ( rc )
+            {
+                rcu_unlock_domain(cd);
+                return rc;
+            }
+
             if ( !mem_sharing_enabled(cd) )
             {
                 rcu_unlock_domain(cd);
@@ -1401,10 +1410,18 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( !mem_sharing_enabled(d) )
                 return -EINVAL;
 
-            cd = get_mem_event_op_target(mec->u.share.client_domain, &rc);
-            if ( !cd )
+            rc = rcu_lock_live_remote_domain_by_id(mec->u.share.client_domain,
+                                                   &cd);
+            if ( rc )
                 return rc;
 
+            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            if ( rc )
+            {
+                rcu_unlock_domain(cd);
+                return rc;
+            }
+
             if ( !mem_sharing_enabled(cd) )
             {
                 rcu_unlock_domain(cd);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 12c8e24..fcf24e2 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -475,6 +475,21 @@ int rcu_lock_remote_domain_by_id(domid_t dom, struct domain **d)
     return 0;
 }
 
+int rcu_lock_live_remote_domain_by_id(domid_t dom, struct domain **d)
+{
+    int rv;
+    rv = rcu_lock_remote_domain_by_id(dom, d);
+    if ( rv )
+        return rv;
+    if ( (*d)->is_dying )
+    {
+        rcu_unlock_domain(*d);
+        return -EINVAL;
+    }
+
+    return 0;
+}
+
 int domain_kill(struct domain *d)
 {
     int rc = 0;
diff --git a/xen/include/asm-x86/mem_event.h b/xen/include/asm-x86/mem_event.h
index e17f36b..5959621 100644
--- a/xen/include/asm-x86/mem_event.h
+++ b/xen/include/asm-x86/mem_event.h
@@ -62,7 +62,6 @@ void mem_event_put_request(struct domain *d, struct mem_event_domain *med,
 int mem_event_get_response(struct domain *d, struct mem_event_domain *med,
                            mem_event_response_t *rsp);
 
-struct domain *get_mem_event_op_target(uint32_t domain, int *rc);
 int do_mem_event_op(int op, uint32_t domain, void *arg);
 int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
                      XEN_GUEST_HANDLE_PARAM(void) u_domctl);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6c55039..90a6537 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -484,6 +484,12 @@ int rcu_lock_remote_target_domain_by_id(domid_t dom, struct domain **d);
  */
 int rcu_lock_remote_domain_by_id(domid_t dom, struct domain **d);
 
+/*
+ * As rcu_lock_remote_domain_by_id() but will fail EINVAL if the domain is
+ * dying.
+ */
+int rcu_lock_live_remote_domain_by_id(domid_t dom, struct domain **d);
+
 /* Finish a RCU critical region started by rcu_lock_domain_by_id(). */
 static inline void rcu_unlock_domain(struct domain *d)
 {
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index e42965c..42b2285 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -551,16 +551,37 @@ static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_event(struct domain *d)
+static XSM_INLINE int xsm_mem_event_setup(struct domain *d)
 {
     return 0;
 }
 
+static XSM_INLINE int xsm_mem_event_control(struct domain *d, int mode, int op)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
+static XSM_INLINE int xsm_mem_event_op(struct domain *d, int op)
+{
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_INLINE int xsm_mem_sharing(struct domain *d)
 {
     return 0;
 }
 
+static XSM_INLINE int xsm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
+{
+    if ( !IS_PRIV_FOR(current->domain, cd) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
 {
     if ( !IS_PRIV(d) )
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 470e3c0..88aa95a 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -151,8 +151,11 @@ struct xsm_operations {
     int (*hvm_set_isa_irq_level) (struct domain *d);
     int (*hvm_set_pci_link_route) (struct domain *d);
     int (*hvm_inject_msi) (struct domain *d);
-    int (*mem_event) (struct domain *d);
+    int (*mem_event_setup) (struct domain *d);
+    int (*mem_event_control) (struct domain *d, int mode, int op);
+    int (*mem_event_op) (struct domain *d, int op);
     int (*mem_sharing) (struct domain *d);
+    int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
     int (*apic) (struct domain *d, int cmd);
     int (*xen_settime) (void);
     int (*memtype) (uint32_t access);
@@ -665,9 +668,19 @@ static inline int xsm_hvm_inject_msi (struct domain *d)
     return xsm_ops->hvm_inject_msi(d);
 }
 
-static inline int xsm_mem_event (struct domain *d)
+static inline int xsm_mem_event_setup (struct domain *d)
 {
-    return xsm_ops->mem_event(d);
+    return xsm_ops->mem_event_setup(d);
+}
+
+static inline int xsm_mem_event_control (struct domain *d, int mode, int op)
+{
+    return xsm_ops->mem_event_control(d, mode, op);
+}
+
+static inline int xsm_mem_event_op (struct domain *d, int op)
+{
+    return xsm_ops->mem_event_op(d, op);
 }
 
 static inline int xsm_mem_sharing (struct domain *d)
@@ -675,6 +688,11 @@ static inline int xsm_mem_sharing (struct domain *d)
     return xsm_ops->mem_sharing(d);
 }
 
+static inline int xsm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
+{
+    return xsm_ops->mem_sharing_op(d, cd, op);
+}
+
 static inline int xsm_apic (struct domain *d, int cmd)
 {
     return xsm_ops->apic(d, cmd);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 1e7f42c..bc9d30f 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -136,8 +136,11 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, hvm_set_isa_irq_level);
     set_to_dummy_if_null(ops, hvm_set_pci_link_route);
     set_to_dummy_if_null(ops, hvm_inject_msi);
-    set_to_dummy_if_null(ops, mem_event);
+    set_to_dummy_if_null(ops, mem_event_setup);
+    set_to_dummy_if_null(ops, mem_event_control);
+    set_to_dummy_if_null(ops, mem_event_op);
     set_to_dummy_if_null(ops, mem_sharing);
+    set_to_dummy_if_null(ops, mem_sharing_op);
     set_to_dummy_if_null(ops, apic);
     set_to_dummy_if_null(ops, xen_settime);
     set_to_dummy_if_null(ops, memtype);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index a8475ea..99d3e21 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1277,7 +1277,17 @@ static int flask_hvm_inject_msi(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
-static int flask_mem_event(struct domain *d)
+static int flask_mem_event_setup(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
+}
+
+static int flask_mem_event_control(struct domain *d, int mode, int op)
+{
+    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
+}
+
+static int flask_mem_event_op(struct domain *d, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
@@ -1287,6 +1297,14 @@ static int flask_mem_sharing(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
 }
 
+static int flask_mem_sharing_op(struct domain *d, struct domain *cd, int op)
+{
+    int rc = current_has_perm(cd, SECCLASS_HVM, HVM__MEM_SHARING);
+    if ( rc )
+        return rc;
+    return domain_has_perm(d, cd, SECCLASS_HVM, HVM__SHARE_MEM);
+}
+
 static int flask_apic(struct domain *d, int cmd)
 {
     u32 perm;
@@ -1736,8 +1754,11 @@ static struct xsm_operations flask_ops = {
     .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
     .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
     .hvm_inject_msi = flask_hvm_inject_msi,
-    .mem_event = flask_mem_event,
+    .mem_event_setup = flask_mem_event_setup,
+    .mem_event_control = flask_mem_event_control,
+    .mem_event_op = flask_mem_event_op,
     .mem_sharing = flask_mem_sharing,
+    .mem_sharing_op = flask_mem_sharing_op,
     .apic = flask_apic,
     .xen_settime = flask_xen_settime,
     .memtype = flask_memtype,
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 894910c..186f1fa 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -84,6 +84,7 @@
    S_(SECCLASS_HVM, HVM__MEM_SHARING, "mem_sharing")
    S_(SECCLASS_HVM, HVM__AUDIT_P2M, "audit_p2m")
    S_(SECCLASS_HVM, HVM__SEND_IRQ, "send_irq")
+   S_(SECCLASS_HVM, HVM__SHARE_MEM, "share_mem")
    S_(SECCLASS_EVENT, EVENT__BIND, "bind")
    S_(SECCLASS_EVENT, EVENT__SEND, "send")
    S_(SECCLASS_EVENT, EVENT__STATUS, "status")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index 1bdb515..b3831f6 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -87,6 +87,7 @@
 #define HVM__MEM_SHARING                          0x00001000UL
 #define HVM__AUDIT_P2M                            0x00002000UL
 #define HVM__SEND_IRQ                             0x00004000UL
+#define HVM__SHARE_MEM                            0x00008000UL
 
 #define EVENT__BIND                               0x00000001UL
 #define EVENT__SEND                               0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSen-0002Nb-Dj; Fri, 30 Nov 2012 15:37:37 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSel-0002MP-Ma
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:35 +0000
Received: from [193.109.254.147:42417] by server-16.bemta-14.messagelabs.com
	id FB/07-09215-EB2D8B05; Fri, 30 Nov 2012 15:37:34 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-27.messagelabs.com!1354289853!2114139!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 443 invoked from network); 30 Nov 2012 15:37:33 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-11.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:33 -0000
X-TM-IMSS-Message-ID: <d0a0e913000589c2@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0e913000589c2 ;
	Fri, 30 Nov 2012 10:37:37 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd3017785; 
	Fri, 30 Nov 2012 10:37:32 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:57 -0500
Message-Id: <1354289830-24642-11-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 10/23] xen: convert do_domctl to use XSM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The xsm_domctl hook now covers every domctl, in addition to the more
fine-grained XSM hooks in most sub-functions. This also removes the need
to special-case XEN_DOMCTL_getdomaininfo.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c   |  2 +-
 xen/common/domctl.c     | 32 +++----------------
 xen/include/xsm/dummy.h | 16 ++++++++--
 xen/xsm/flask/hooks.c   | 85 ++++++++++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 104 insertions(+), 31 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 7069d7a..30518aa 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1534,7 +1534,7 @@ long arch_do_domctl(
     {
         struct domain *d;
 
-        ret = rcu_lock_remote_target_domain_by_id(domctl->domain, &d);
+        ret = rcu_lock_remote_domain_by_id(domctl->domain, &d);
         if ( ret != 0 )
             break;
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 536bef5..46bb0e3 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -264,27 +264,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             return -ESRCH;
     }
 
-    switch ( op->cmd )
-    {
-    case XEN_DOMCTL_ioport_mapping:
-    case XEN_DOMCTL_memory_mapping:
-    case XEN_DOMCTL_bind_pt_irq:
-    case XEN_DOMCTL_unbind_pt_irq: {
-        bool_t is_priv = IS_PRIV_FOR(current->domain, d);
-        if ( !is_priv )
-        {
-            ret = -EPERM;
-            goto domctl_out_unlock;
-        }
-        break;
-    }
-    case XEN_DOMCTL_getdomaininfo:
-        break;
-    default:
-        if ( !IS_PRIV(current->domain) )
-            return -EPERM;
-        break;
-    }
+    ret = xsm_domctl(d, op->cmd);
+    if ( ret )
+        goto domctl_out_unlock;
 
     if ( !domctl_lock_acquire() )
     {
@@ -858,17 +840,13 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_subscribe:
     {
-        ret = xsm_domctl(d, op->cmd);
-        if ( !ret )
-            d->suspend_evtchn = op->u.subscribe.port;
+        d->suspend_evtchn = op->u.subscribe.port;
     }
     break;
 
     case XEN_DOMCTL_disable_migrate:
     {
-        ret = xsm_domctl(d, op->cmd);
-        if ( !ret )
-            d->disable_migrate = op->u.disable_migrate.disable;
+        d->disable_migrate = op->u.disable_migrate.disable;
     }
     break;
 
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index ae7b4f6..1c19e15 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -64,8 +64,6 @@ static XSM_INLINE int xsm_scheduler(struct domain *d)
 
 static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
     return 0;
 }
 
@@ -91,6 +89,20 @@ static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
 
 static XSM_INLINE int xsm_domctl(struct domain *d, int cmd)
 {
+    switch ( cmd )
+    {
+    case XEN_DOMCTL_ioport_mapping:
+    case XEN_DOMCTL_memory_mapping:
+    case XEN_DOMCTL_bind_pt_irq:
+    case XEN_DOMCTL_unbind_pt_irq: {
+        if ( !IS_PRIV_FOR(current->domain, d) )
+            return -EPERM;
+        break;
+    }
+    default:
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+    }
     return 0;
 }
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index f9a2596..2e002f0 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -589,7 +589,90 @@ static int flask_set_target(struct domain *d, struct domain *e)
 
 static int flask_domctl(struct domain *d, int cmd)
 {
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO);
+    switch ( cmd )
+    {
+    /* These have individual XSM hooks (common/domctl.c) */
+    case XEN_DOMCTL_createdomain:
+    case XEN_DOMCTL_destroydomain:
+    case XEN_DOMCTL_pausedomain:
+    case XEN_DOMCTL_unpausedomain:
+    case XEN_DOMCTL_getdomaininfo:
+    case XEN_DOMCTL_setvcpuaffinity:
+    case XEN_DOMCTL_max_mem:
+    case XEN_DOMCTL_setvcpucontext:
+    case XEN_DOMCTL_getvcpucontext:
+    case XEN_DOMCTL_getvcpuinfo:
+    case XEN_DOMCTL_max_vcpus:
+    case XEN_DOMCTL_scheduler_op:
+    case XEN_DOMCTL_setdomainhandle:
+    case XEN_DOMCTL_setdebugging:
+    case XEN_DOMCTL_irq_permission:
+    case XEN_DOMCTL_iomem_permission:
+    case XEN_DOMCTL_settimeoffset:
+    case XEN_DOMCTL_getvcpuaffinity:
+    case XEN_DOMCTL_resumedomain:
+    case XEN_DOMCTL_set_target:
+    case XEN_DOMCTL_set_virq_handler:
+#ifdef CONFIG_X86
+    /* These have individual XSM hooks (arch/x86/domctl.c) */
+    case XEN_DOMCTL_shadow_op:
+    case XEN_DOMCTL_ioport_permission:
+    case XEN_DOMCTL_getpageframeinfo:
+    case XEN_DOMCTL_getpageframeinfo2:
+    case XEN_DOMCTL_getpageframeinfo3:
+    case XEN_DOMCTL_getmemlist:
+    case XEN_DOMCTL_hypercall_init:
+    case XEN_DOMCTL_sethvmcontext:
+    case XEN_DOMCTL_gethvmcontext:
+    case XEN_DOMCTL_gethvmcontext_partial:
+    case XEN_DOMCTL_set_address_size:
+    case XEN_DOMCTL_get_address_size:
+    case XEN_DOMCTL_set_machine_address_size:
+    case XEN_DOMCTL_get_machine_address_size:
+    case XEN_DOMCTL_sendtrigger:
+    case XEN_DOMCTL_bind_pt_irq:
+    case XEN_DOMCTL_unbind_pt_irq:
+    case XEN_DOMCTL_memory_mapping:
+    case XEN_DOMCTL_ioport_mapping:
+    case XEN_DOMCTL_pin_mem_cacheattr:
+    case XEN_DOMCTL_set_ext_vcpucontext:
+    case XEN_DOMCTL_get_ext_vcpucontext:
+    case XEN_DOMCTL_setvcpuextstate:
+    case XEN_DOMCTL_getvcpuextstate:
+    case XEN_DOMCTL_mem_event_op:
+    case XEN_DOMCTL_mem_sharing_op:
+    case XEN_DOMCTL_set_access_required:
+    /* These have individual XSM hooks (drivers/passthrough/iommu.c) */
+    case XEN_DOMCTL_get_device_group:
+    case XEN_DOMCTL_test_assign_device:
+    case XEN_DOMCTL_assign_device:
+    case XEN_DOMCTL_deassign_device:
+#endif
+        return 0;
+
+    case XEN_DOMCTL_subscribe:
+    case XEN_DOMCTL_disable_migrate:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
+                               DOMAIN__SET_MISC_INFO);
+
+    case XEN_DOMCTL_set_cpuid:
+    case XEN_DOMCTL_suppress_spurious_page_faults:
+    case XEN_DOMCTL_debug_op:
+    case XEN_DOMCTL_gettscinfo:
+    case XEN_DOMCTL_settscinfo:
+    case XEN_DOMCTL_audit_p2m:
+    case XEN_DOMCTL_gdbsx_guestmemio:
+    case XEN_DOMCTL_gdbsx_pausevcpu:
+    case XEN_DOMCTL_gdbsx_unpausevcpu:
+    case XEN_DOMCTL_gdbsx_domstatus:
+        /* TODO add per-subfunction hooks */
+        if ( !IS_PRIV(current->domain) )
+            return -EPERM;
+        return 0;
+    default:
+        printk("flask_domctl: Unknown op %d\n", cmd);
+        return -EPERM;
+    }
 }
 
 static int flask_set_virq_handler(struct domain *d, uint32_t virq)
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSel-0002MR-II; Fri, 30 Nov 2012 15:37:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSej-0002MB-TV
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:34 +0000
Received: from [85.158.139.211:63646] by server-1.bemta-5.messagelabs.com id
	9B/45-09311-DB2D8B05; Fri, 30 Nov 2012 15:37:33 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-5.tower-206.messagelabs.com!1354289851!18499796!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16986 invoked from network); 30 Nov 2012 15:37:32 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-5.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:32 -0000
X-TM-IMSS-Message-ID: <339212a400027aad@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 339212a400027aad ;
	Fri, 30 Nov 2012 10:36:23 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbScv017785; 
	Fri, 30 Nov 2012 10:37:29 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:51 -0500
Message-Id: <1354289830-24642-5-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: [Xen-devel] [PATCH 04/23] xsm/flask: Add checks on the domain
	performing the set_target operation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The existing domain__set_target check only verifies that the source and
target domains can be associated. We also need to check that the
privileged domain making this association is allowed to do so.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 tools/flask/policy/policy/flask/access_vectors | 2 ++
 xen/xsm/flask/hooks.c                          | 7 +++++++
 xen/xsm/flask/include/av_perm_to_string.h      | 2 ++
 xen/xsm/flask/include/av_permissions.h         | 2 ++
 4 files changed, 13 insertions(+)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index c7e29ab..11d02da 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -78,6 +78,8 @@ class domain2
 	relabelfrom
 	relabelto
 	relabelself
+	make_priv_for
+	set_as_target
 }
 
 class hvm
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index d4635d0..81ff5ac 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -577,6 +577,13 @@ static int flask_domain_settime(struct domain *d)
 
 static int flask_set_target(struct domain *d, struct domain *e)
 {
+    int rc;
+    rc = domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR);
+    if ( rc )
+        return rc;
+    rc = domain_has_perm(current->domain, e, SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET);
+    if ( rc )
+        return rc;
     return domain_has_perm(d, e, SECCLASS_DOMAIN, DOMAIN__SET_TARGET);
 }
 
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index e7e2058..10f8e80 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -64,6 +64,8 @@
    S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELFROM, "relabelfrom")
    S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELTO, "relabelto")
    S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELSELF, "relabelself")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR, "make_priv_for")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET, "set_as_target")
    S_(SECCLASS_HVM, HVM__SETHVMC, "sethvmc")
    S_(SECCLASS_HVM, HVM__GETHVMC, "gethvmc")
    S_(SECCLASS_HVM, HVM__SETPARAM, "setparam")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index cb1c5dc..f7cfee1 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -66,6 +66,8 @@
 #define DOMAIN2__RELABELFROM                      0x00000001UL
 #define DOMAIN2__RELABELTO                        0x00000002UL
 #define DOMAIN2__RELABELSELF                      0x00000004UL
+#define DOMAIN2__MAKE_PRIV_FOR                    0x00000008UL
+#define DOMAIN2__SET_AS_TARGET                    0x00000010UL
 
 #define HVM__SETHVMC                              0x00000001UL
 #define HVM__GETHVMC                              0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSel-0002MR-II; Fri, 30 Nov 2012 15:37:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSej-0002MB-TV
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:34 +0000
Received: from [85.158.139.211:63646] by server-1.bemta-5.messagelabs.com id
	9B/45-09311-DB2D8B05; Fri, 30 Nov 2012 15:37:33 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-5.tower-206.messagelabs.com!1354289851!18499796!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16986 invoked from network); 30 Nov 2012 15:37:32 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-5.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:32 -0000
X-TM-IMSS-Message-ID: <339212a400027aad@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 339212a400027aad ;
	Fri, 30 Nov 2012 10:36:23 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbScv017785; 
	Fri, 30 Nov 2012 10:37:29 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:51 -0500
Message-Id: <1354289830-24642-5-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: [Xen-devel] [PATCH 04/23] xsm/flask: Add checks on the domain
	performing the set_target operation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The existing domain__set_target check only verifies that the source and
target domains can be associated. We also need to check that the
privileged domain making this association is allowed to do so.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 tools/flask/policy/policy/flask/access_vectors | 2 ++
 xen/xsm/flask/hooks.c                          | 7 +++++++
 xen/xsm/flask/include/av_perm_to_string.h      | 2 ++
 xen/xsm/flask/include/av_permissions.h         | 2 ++
 4 files changed, 13 insertions(+)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index c7e29ab..11d02da 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -78,6 +78,8 @@ class domain2
 	relabelfrom
 	relabelto
 	relabelself
+	make_priv_for
+	set_as_target
 }
 
 class hvm
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index d4635d0..81ff5ac 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -577,6 +577,13 @@ static int flask_domain_settime(struct domain *d)
 
 static int flask_set_target(struct domain *d, struct domain *e)
 {
+    int rc;
+    rc = domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR);
+    if ( rc )
+        return rc;
+    rc = domain_has_perm(current->domain, e, SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET);
+    if ( rc )
+        return rc;
     return domain_has_perm(d, e, SECCLASS_DOMAIN, DOMAIN__SET_TARGET);
 }
 
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index e7e2058..10f8e80 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -64,6 +64,8 @@
    S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELFROM, "relabelfrom")
    S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELTO, "relabelto")
    S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELSELF, "relabelself")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR, "make_priv_for")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET, "set_as_target")
    S_(SECCLASS_HVM, HVM__SETHVMC, "sethvmc")
    S_(SECCLASS_HVM, HVM__GETHVMC, "gethvmc")
    S_(SECCLASS_HVM, HVM__SETPARAM, "setparam")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index cb1c5dc..f7cfee1 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -66,6 +66,8 @@
 #define DOMAIN2__RELABELFROM                      0x00000001UL
 #define DOMAIN2__RELABELTO                        0x00000002UL
 #define DOMAIN2__RELABELSELF                      0x00000004UL
+#define DOMAIN2__MAKE_PRIV_FOR                    0x00000008UL
+#define DOMAIN2__SET_AS_TARGET                    0x00000010UL
 
 #define HVM__SETHVMC                              0x00000001UL
 #define HVM__GETHVMC                              0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSet-0002Td-Rq; Fri, 30 Nov 2012 15:37:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSeq-0002PO-9a
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:40 +0000
Received: from [193.109.254.147:16862] by server-5.bemta-14.messagelabs.com id
	6F/FC-10257-3C2D8B05; Fri, 30 Nov 2012 15:37:39 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-27.messagelabs.com!1354289857!2114151!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 884 invoked from network); 30 Nov 2012 15:37:37 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-11.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:37 -0000
X-TM-IMSS-Message-ID: <d0a0f5df000589cd@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0f5df000589cd ;
	Fri, 30 Nov 2012 10:37:41 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSdE017785; 
	Fri, 30 Nov 2012 10:37:34 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:08 -0500
Message-Id: <1354289830-24642-22-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 21/23] xen: sysctl XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

A number of the sysctl XSM hooks have no parameters or only pass the
operation ID, making them redundant with the xsm_sysctl hook. Remove
these redundant hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/sysctl.c   |  13 -----
 xen/common/sysctl.c     |  44 -----------------
 xen/include/xsm/dummy.h |  45 -----------------
 xen/include/xsm/xsm.h   |  56 +---------------------
 xen/xsm/dummy.c         |   9 ----
 xen/xsm/flask/hooks.c   | 125 +++++++++++++++---------------------------------
 6 files changed, 39 insertions(+), 253 deletions(-)

diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index b84dd34..5b0c4b7 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -69,11 +69,6 @@ long arch_do_sysctl(
     {
         xen_sysctl_physinfo_t *pi = &sysctl->u.physinfo;
 
-        ret = xsm_physinfo();
-        if ( ret )
-            break;
-
-
         memset(pi, 0, sizeof(*pi));
         pi->threads_per_core =
             cpumask_weight(per_cpu(cpu_sibling_mask, 0));
@@ -103,10 +98,6 @@ long arch_do_sysctl(
         uint32_t i, max_cpu_index, last_online_cpu;
         xen_sysctl_topologyinfo_t *ti = &sysctl->u.topologyinfo;
 
-        ret = xsm_physinfo();
-        if ( ret )
-            break;
-
         last_online_cpu = cpumask_last(&cpu_online_map);
         max_cpu_index = min_t(uint32_t, ti->max_cpu_index, last_online_cpu);
         ti->max_cpu_index = last_online_cpu;
@@ -143,10 +134,6 @@ long arch_do_sysctl(
         uint32_t i, j, max_node_index, last_online_node;
         xen_sysctl_numainfo_t *ni = &sysctl->u.numainfo;
 
-        ret = xsm_physinfo();
-        if ( ret )
-            break;
-
         last_online_node = last_node(node_online_map);
         max_node_index = min_t(uint32_t, ni->max_node_index, last_online_node);
         ni->max_node_index = last_online_node;
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 599430e..cbefb0e 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -69,10 +69,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_tbuf_op:
     {
-        ret = xsm_tbufcontrol();
-        if ( ret )
-            break;
-
         ret = tb_control(&op->u.tbuf_op);
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -81,10 +77,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     
     case XEN_SYSCTL_sched_id:
     {
-        ret = xsm_sched_id();
-        if ( ret )
-            break;
-
         op->u.sched_id.sched_id = sched_id();
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -139,10 +131,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 #ifdef PERF_COUNTERS
     case XEN_SYSCTL_perfc_op:
     {
-        ret = xsm_perfcontrol();
-        if ( ret )
-            break;
-
         ret = perfc_control(&op->u.perfc_op);
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -153,10 +141,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 #ifdef LOCK_PROFILE
     case XEN_SYSCTL_lockprof_op:
     {
-        ret = xsm_lockprof();
-        if ( ret )
-            break;
-
         ret = spinlock_profile_control(&op->u.lockprof_op);
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -168,10 +152,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         char c;
         uint32_t i;
 
-        ret = xsm_debug_keys();
-        if ( ret )
-            break;
-
         ret = -EFAULT;
         for ( i = 0; i < op->u.debug_keys.nr_keys; i++ )
         {
@@ -190,10 +170,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
         nr_cpus = min(op->u.getcpuinfo.max_cpus, nr_cpu_ids);
 
-        ret = xsm_getcpuinfo();
-        if ( ret )
-            break;
-
         for ( i = 0; i < nr_cpus; i++ )
         {
             cpuinfo.idletime = get_cpu_idle_time(i);
@@ -210,10 +186,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_availheap:
     { 
-        ret = xsm_availheap();
-        if ( ret )
-            break;
-
         op->u.availheap.avail_bytes = avail_domheap_pages_region(
             op->u.availheap.node,
             op->u.availheap.min_bitwidth,
@@ -227,10 +199,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 #ifdef HAS_ACPI
     case XEN_SYSCTL_get_pmstat:
     {
-        ret = xsm_get_pmstat();
-        if ( ret )
-            break;
-
         ret = do_get_pm_info(&op->u.get_pmstat);
         if ( ret )
             break;
@@ -245,10 +213,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_pm_op:
     {
-        ret = xsm_pm_op();
-        if ( ret )
-            break;
-
         ret = do_pm_op(&op->u.pm_op);
         if ( ret && (ret != -EAGAIN) )
             break;
@@ -323,10 +287,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_cpupool_op:
     {
-        ret = xsm_cpupool_op();
-        if ( ret )
-            break;
-
         ret = cpupool_do_sysctl(&op->u.cpupool_op);
         if ( (ret == 0) && copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -335,10 +295,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_scheduler_op:
     {
-        ret = xsm_sched_op();
-        if ( ret )
-            break;
-
         ret = sched_adjust_global(&op->u.scheduler_op);
         if ( (ret == 0) && copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 9a5b34f..b680d61 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -58,41 +58,16 @@ static XSM_INLINE int xsm_sysctl(int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_tbufcontrol(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_readconsole(uint32_t clear)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_sched_id(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_perfcontrol(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_debug_keys(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_getcpuinfo(void)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_get_pmstat(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_setpminfo(void)
 {
     return 0;
@@ -110,11 +85,6 @@ static XSM_INLINE int xsm_do_mca(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_availheap(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
 {
     return 0;
@@ -358,16 +328,6 @@ static XSM_INLINE int xsm_lockprof(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_cpupool_op(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_sched_op(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_tmem_op(void)
 {
     return 0;
@@ -508,11 +468,6 @@ static XSM_INLINE int xsm_microcode(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_physinfo(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 903c7cb..f054dae 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -46,14 +46,8 @@ struct xsm_operations {
     int (*set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
     int (*sysctl) (int cmd);
-    int (*tbufcontrol) (void);
     int (*readconsole) (uint32_t clear);
-    int (*sched_id) (void);
-    int (*perfcontrol) (void);
-    int (*debug_keys) (void);
     int (*getcpuinfo) (void);
-    int (*availheap) (void);
-    int (*get_pmstat) (void);
     int (*setpminfo) (void);
     int (*pm_op) (void);
     int (*do_mca) (void);
@@ -117,8 +111,6 @@ struct xsm_operations {
 
     int (*page_offline)(uint32_t cmd);
     int (*lockprof)(void);
-    int (*cpupool_op)(void);
-    int (*sched_op)(void);
     int (*tmem_op)(void);
     int (*tmem_control)(void);
 
@@ -138,7 +130,6 @@ struct xsm_operations {
     int (*xen_settime) (void);
     int (*memtype) (uint32_t access);
     int (*microcode) (void);
-    int (*physinfo) (void);
     int (*platform_quirk) (uint32_t);
     int (*platform_op) (uint32_t cmd);
     int (*firmware_info) (void);
@@ -201,46 +192,16 @@ static inline int xsm_sysctl (int cmd)
     return xsm_ops->sysctl(cmd);
 }
 
-static inline int xsm_tbufcontrol (void)
-{
-    return xsm_ops->tbufcontrol();
-}
-
 static inline int xsm_readconsole (uint32_t clear)
 {
     return xsm_ops->readconsole(clear);
 }
 
-static inline int xsm_sched_id (void)
-{
-    return xsm_ops->sched_id();
-}
-
-static inline int xsm_perfcontrol (void)
-{
-    return xsm_ops->perfcontrol();
-}
-
-static inline int xsm_debug_keys (void)
-{
-    return xsm_ops->debug_keys();
-}
-
-static inline int xsm_availheap (void)
-{
-    return xsm_ops->availheap();
-}
-
-static inline int xsm_getcpuinfo (void)
+static inline int xsm_getcpuinfo(void)
 {
     return xsm_ops->getcpuinfo();
 }
 
-static inline int xsm_get_pmstat(void)
-{
-    return xsm_ops->get_pmstat();
-}
-
 static inline int xsm_setpminfo(void)
 {
     return xsm_ops->setpminfo();
@@ -502,16 +463,6 @@ static inline int xsm_lockprof(void)
     return xsm_ops->lockprof();
 }
 
-static inline int xsm_cpupool_op(void)
-{
-    return xsm_ops->cpupool_op();
-}
-
-static inline int xsm_sched_op(void)
-{
-    return xsm_ops->sched_op();
-}
-
 static inline int xsm_tmem_op(void)
 {
     return xsm_ops->tmem_op();
@@ -593,11 +544,6 @@ static inline int xsm_microcode (void)
     return xsm_ops->microcode();
 }
 
-static inline int xsm_physinfo (void)
-{
-    return xsm_ops->physinfo();
-}
-
 static inline int xsm_platform_quirk (uint32_t quirk)
 {
     return xsm_ops->platform_quirk(quirk);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 9bb86ef..0216b62 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -35,14 +35,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, set_target);
     set_to_dummy_if_null(ops, domctl);
     set_to_dummy_if_null(ops, sysctl);
-    set_to_dummy_if_null(ops, tbufcontrol);
     set_to_dummy_if_null(ops, readconsole);
-    set_to_dummy_if_null(ops, sched_id);
-    set_to_dummy_if_null(ops, perfcontrol);
-    set_to_dummy_if_null(ops, debug_keys);
     set_to_dummy_if_null(ops, getcpuinfo);
-    set_to_dummy_if_null(ops, availheap);
-    set_to_dummy_if_null(ops, get_pmstat);
     set_to_dummy_if_null(ops, setpminfo);
     set_to_dummy_if_null(ops, pm_op);
     set_to_dummy_if_null(ops, do_mca);
@@ -104,8 +98,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
 
     set_to_dummy_if_null(ops, page_offline);
     set_to_dummy_if_null(ops, lockprof);
-    set_to_dummy_if_null(ops, cpupool_op);
-    set_to_dummy_if_null(ops, sched_op);
     set_to_dummy_if_null(ops, tmem_op);
     set_to_dummy_if_null(ops, tmem_control);
 
@@ -125,7 +117,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, xen_settime);
     set_to_dummy_if_null(ops, memtype);
     set_to_dummy_if_null(ops, microcode);
-    set_to_dummy_if_null(ops, physinfo);
     set_to_dummy_if_null(ops, platform_quirk);
     set_to_dummy_if_null(ops, platform_op);
     set_to_dummy_if_null(ops, firmware_info);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index f0216e0..d72a807 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -702,37 +702,57 @@ static int flask_sysctl(int cmd)
     {
     /* These have individual XSM hooks */
     case XEN_SYSCTL_readconsole:
+    case XEN_SYSCTL_getdomaininfolist:
+    case XEN_SYSCTL_page_offline_op:
+#ifdef CONFIG_X86
+    case XEN_SYSCTL_cpu_hotplug:
+#endif
+        return 0;
+
     case XEN_SYSCTL_tbuf_op:
+        return domain_has_xen(current->domain, XEN__TBUFCONTROL);
+
     case XEN_SYSCTL_sched_id:
+        return domain_has_xen(current->domain, XEN__SCHEDULER);
+
     case XEN_SYSCTL_perfc_op:
-    case XEN_SYSCTL_getdomaininfolist:
+        return domain_has_xen(current->domain, XEN__PERFCONTROL);
+
     case XEN_SYSCTL_debug_keys:
+        return domain_has_xen(current->domain, XEN__DEBUG);
+
     case XEN_SYSCTL_getcpuinfo:
+        return domain_has_xen(current->domain, XEN__GETCPUINFO);
+
     case XEN_SYSCTL_availheap:
+        return domain_has_xen(current->domain, XEN__HEAP);
+
     case XEN_SYSCTL_get_pmstat:
+        return domain_has_xen(current->domain, XEN__PM_OP);
+
     case XEN_SYSCTL_pm_op:
-    case XEN_SYSCTL_page_offline_op:
+        return domain_has_xen(current->domain, XEN__PM_OP);
+
     case XEN_SYSCTL_lockprof_op:
+        return domain_has_xen(current->domain, XEN__LOCKPROF);
+
     case XEN_SYSCTL_cpupool_op:
+        return domain_has_xen(current->domain, XEN__CPUPOOL_OP);
+
     case XEN_SYSCTL_scheduler_op:
-#ifdef CONFIG_X86
+        return domain_has_xen(current->domain, XEN__SCHED_OP);
+
     case XEN_SYSCTL_physinfo:
-    case XEN_SYSCTL_cpu_hotplug:
     case XEN_SYSCTL_topologyinfo:
     case XEN_SYSCTL_numainfo:
-#endif
-        return 0;
+        return domain_has_xen(current->domain, XEN__PHYSINFO);
+
     default:
         printk("flask_sysctl: Unknown op %d\n", cmd);
         return -EPERM;
     }
 }
 
-static int flask_tbufcontrol(void)
-{
-    return domain_has_xen(current->domain, XEN__TBUFCONTROL);
-}
-
 static int flask_readconsole(uint32_t clear)
 {
     u32 perms = XEN__READCONSOLE;
@@ -743,41 +763,6 @@ static int flask_readconsole(uint32_t clear)
     return domain_has_xen(current->domain, perms);
 }
 
-static int flask_sched_id(void)
-{
-    return domain_has_xen(current->domain, XEN__SCHEDULER);
-}
-
-static int flask_debug_keys(void)
-{
-    return domain_has_xen(current->domain, XEN__DEBUG);
-}
-
-static int flask_getcpuinfo(void)
-{
-    return domain_has_xen(current->domain, XEN__GETCPUINFO);
-}
-
-static int flask_availheap(void)
-{
-    return domain_has_xen(current->domain, XEN__HEAP);
-}
-
-static int flask_get_pmstat(void)
-{
-    return domain_has_xen(current->domain, XEN__PM_OP);
-}
-
-static int flask_setpminfo(void)
-{
-    return domain_has_xen(current->domain, XEN__PM_OP);
-}
-
-static int flask_pm_op(void)
-{
-    return domain_has_xen(current->domain, XEN__PM_OP);
-}
-
 static int flask_do_mca(void)
 {
     return domain_has_xen(current->domain, XEN__MCA_OP);
@@ -1031,21 +1016,6 @@ static inline int flask_page_offline(uint32_t cmd)
     }
 }
 
-static inline int flask_lockprof(void)
-{
-    return domain_has_xen(current->domain, XEN__LOCKPROF);
-}
-
-static inline int flask_cpupool_op(void)
-{
-    return domain_has_xen(current->domain, XEN__CPUPOOL_OP);
-}
-
-static inline int flask_sched_op(void)
-{
-    return domain_has_xen(current->domain, XEN__SCHED_OP);
-}
-
 static inline int flask_tmem_op(void)
 {
     return domain_has_xen(current->domain, XEN__TMEM_OP);
@@ -1056,11 +1026,6 @@ static inline int flask_tmem_control(void)
     return domain_has_xen(current->domain, XEN__TMEM_CONTROL);
 }
 
-static int flask_perfcontrol(void)
-{
-    return domain_has_xen(current->domain, XEN__PERFCONTROL);
-}
-
 #ifdef CONFIG_X86
 static int flask_shadow_control(struct domain *d, uint32_t op)
 {
@@ -1253,11 +1218,6 @@ static int flask_microcode(void)
     return domain_has_xen(current->domain, XEN__MICROCODE);
 }
 
-static int flask_physinfo(void)
-{
-    return domain_has_xen(current->domain, XEN__PHYSINFO);
-}
-
 static int flask_platform_quirk(uint32_t quirk)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN, XEN__QUIRK, NULL);
@@ -1278,17 +1238,21 @@ static int flask_platform_op(uint32_t op)
     case XENPF_enter_acpi_sleep:
     case XENPF_change_freq:
     case XENPF_getidletime:
-    case XENPF_set_processor_pminfo:
-    case XENPF_get_cpuinfo:
-    case XENPF_get_cpu_version:
     case XENPF_cpu_online:
     case XENPF_cpu_offline:
     case XENPF_cpu_hotadd:
     case XENPF_mem_hotadd:
         /* These operations have their own XSM hooks */
         return 0;
+
+    case XENPF_set_processor_pminfo:
     case XENPF_core_parking:
         return domain_has_xen(current->domain, XEN__PM_OP);
+
+    case XENPF_get_cpu_version:
+    case XENPF_get_cpuinfo:
+        return domain_has_xen(current->domain, XEN__GETCPUINFO);
+
     default:
         printk("flask_platform_op: Unknown op %d\n", op);
         return -EPERM;
@@ -1484,16 +1448,7 @@ static struct xsm_operations flask_ops = {
     .set_target = flask_set_target,
     .domctl = flask_domctl,
     .sysctl = flask_sysctl,
-    .tbufcontrol = flask_tbufcontrol,
     .readconsole = flask_readconsole,
-    .sched_id = flask_sched_id,
-    .perfcontrol = flask_perfcontrol,
-    .debug_keys = flask_debug_keys,
-    .getcpuinfo = flask_getcpuinfo,
-    .availheap = flask_availheap,
-    .get_pmstat = flask_get_pmstat,
-    .setpminfo = flask_setpminfo,
-    .pm_op = flask_pm_op,
     .do_mca = flask_do_mca,
 
     .evtchn_unbound = flask_evtchn_unbound,
@@ -1548,9 +1503,6 @@ static struct xsm_operations flask_ops = {
     .resource_setup_misc = flask_resource_setup_misc,
 
     .page_offline = flask_page_offline,
-    .lockprof = flask_lockprof,
-    .cpupool_op = flask_cpupool_op,
-    .sched_op = flask_sched_op,
     .tmem_op = flask_tmem_op,
     .tmem_control = flask_tmem_control,
 
@@ -1570,7 +1522,6 @@ static struct xsm_operations flask_ops = {
     .xen_settime = flask_xen_settime,
     .memtype = flask_memtype,
     .microcode = flask_microcode,
-    .physinfo = flask_physinfo,
     .platform_quirk = flask_platform_quirk,
     .platform_op = flask_platform_op,
     .firmware_info = flask_firmware_info,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSen-0002Nv-Qp; Fri, 30 Nov 2012 15:37:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSel-0002MQ-Vg
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:36 +0000
Received: from [85.158.139.211:63794] by server-6.bemta-5.messagelabs.com id
	83/44-19321-FB2D8B05; Fri, 30 Nov 2012 15:37:35 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-3.tower-206.messagelabs.com!1354289853!18565534!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=2.5 required=7.0 tests=BODY_RANDOM_LONG,LONGWORDS
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21512 invoked from network); 30 Nov 2012 15:37:34 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-3.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:34 -0000
X-TM-IMSS-Message-ID: <33921cc200027ab4@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 33921cc200027ab4 ;
	Fri, 30 Nov 2012 10:36:26 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd5017785; 
	Fri, 30 Nov 2012 10:37:32 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:59 -0500
Message-Id: <1354289830-24642-13-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: [Xen-devel] [PATCH 12/23] xsm/flask: add missing hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The FLASK module was missing implementations of some hooks and did not
have access vectors defined for 10 domctls; define these now.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 tools/flask/policy/policy/flask/access_vectors |  5 ++
 tools/flask/policy/policy/modules/xen/xen.if   |  4 +-
 xen/xsm/flask/hooks.c                          | 66 +++++++++++++++++++++-----
 xen/xsm/flask/include/av_perm_to_string.h      |  5 ++
 xen/xsm/flask/include/av_permissions.h         |  5 ++
 5 files changed, 73 insertions(+), 12 deletions(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index 11d02da..ea65e45 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -80,6 +80,9 @@ class domain2
 	relabelself
 	make_priv_for
 	set_as_target
+	set_cpuid
+	gettsc
+	settsc
 }
 
 class hvm
@@ -97,6 +100,8 @@ class hvm
     hvmctl
     mem_event
     mem_sharing
+    audit_p2m
+    send_irq
 }
 
 class event
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 2ad11b2..59ba171 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -29,6 +29,7 @@ define(`create_domain_common', `
 			getdomaininfo hypercall setvcpucontext setextvcpucontext
 			scheduler getvcpuinfo getvcpuextstate getaddrsize
 			getvcpuaffinity setvcpuaffinity };
+	allow $1 $2:domain2 { set_cpuid settsc };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
 	allow $1 $2:mmu {map_read map_write adjust memorymap physmap pinpage};
@@ -67,6 +68,7 @@ define(`migrate_domain_out', `
 	allow $1 $2:hvm { gethvmc getparam irqlevel };
 	allow $1 $2:mmu { stat pageinfo map_read };
 	allow $1 $2:domain { getaddrsize getvcpucontext getextvcpucontext getvcpuextstate pause destroy };
+	allow $1 $2:domain2 gettsc;
 ')
 
 ################################################################################
@@ -112,7 +114,7 @@ define(`device_model', `
 	domain_comms($1, $2)
 	allow $1 $2:domain { set_target shutdown };
 	allow $1 $2:mmu { map_read map_write adjust physmap };
-	allow $1 $2:hvm { getparam setparam trackdirtyvram hvmctl irqlevel pciroute };
+	allow $1 $2:hvm { getparam setparam trackdirtyvram hvmctl irqlevel pciroute cacheattr send_irq };
 ')
 ################################################################################
 #
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index e25dd1c..dbbf34f 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -650,25 +650,32 @@ static int flask_domctl(struct domain *d, int cmd)
 #endif
         return 0;
 
+    case XEN_DOMCTL_debug_op:
+    case XEN_DOMCTL_gdbsx_guestmemio:
+    case XEN_DOMCTL_gdbsx_pausevcpu:
+    case XEN_DOMCTL_gdbsx_unpausevcpu:
+    case XEN_DOMCTL_gdbsx_domstatus:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
+                               DOMAIN__SETDEBUGGING);
+
     case XEN_DOMCTL_subscribe:
     case XEN_DOMCTL_disable_migrate:
+    case XEN_DOMCTL_suppress_spurious_page_faults:
         return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
                                DOMAIN__SET_MISC_INFO);
 
     case XEN_DOMCTL_set_cpuid:
-    case XEN_DOMCTL_suppress_spurious_page_faults:
-    case XEN_DOMCTL_debug_op:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID);
+
     case XEN_DOMCTL_gettscinfo:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__GETTSC);
+
     case XEN_DOMCTL_settscinfo:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__SETTSC);
+
     case XEN_DOMCTL_audit_p2m:
-    case XEN_DOMCTL_gdbsx_guestmemio:
-    case XEN_DOMCTL_gdbsx_pausevcpu:
-    case XEN_DOMCTL_gdbsx_unpausevcpu:
-    case XEN_DOMCTL_gdbsx_domstatus:
-        /* TODO add per-subfunction hooks */
-        if ( !IS_PRIV(current->domain) )
-            return -EPERM;
-        return 0;
+        return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__AUDIT_P2M);
+
     default:
         printk("flask_domctl: Unknown op %d\n", cmd);
         return -EPERM;
@@ -921,6 +928,11 @@ static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end
     return security_iterate_iomem_sids(start, end, _iomem_has_perm, &data);
 }
 
+static int flask_iomem_mapping(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
+{
+    return flask_iomem_permission(d, start, end, access);
+}
+
 static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
     u32 rsid;
@@ -1128,7 +1140,6 @@ static int _ioport_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-
 static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
 {
     int rc;
@@ -1151,6 +1162,11 @@ static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t en
     return security_iterate_ioport_sids(start, end, _ioport_has_perm, &data);
 }
 
+static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
+{
+    return flask_ioport_permission(d, start, end, access);
+}
+
 static int flask_getpageframeinfo(struct domain *d)
 {
     return domain_has_perm(current->domain, d, SECCLASS_MMU, MMU__PAGEINFO);
@@ -1209,6 +1225,25 @@ static int flask_address_size(struct domain *d, uint32_t cmd)
     return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
 }
 
+static int flask_machine_address_size(struct domain *d, uint32_t cmd)
+{
+    u32 perm;
+
+    switch ( cmd )
+    {
+    case XEN_DOMCTL_set_machine_address_size:
+        perm = DOMAIN__SETADDRSIZE;
+        break;
+    case XEN_DOMCTL_get_machine_address_size:
+        perm = DOMAIN__GETADDRSIZE;
+        break;
+    default:
+        return -EPERM;
+    }
+
+    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
+}
+
 static int flask_hvm_param(struct domain *d, unsigned long op)
 {
     u32 perm;
@@ -1246,6 +1281,11 @@ static int flask_hvm_set_pci_link_route(struct domain *d)
     return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__PCIROUTE);
 }
 
+static int flask_hvm_inject_msi(struct domain *d)
+{
+    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__SEND_IRQ);
+}
+
 static int flask_mem_event(struct domain *d)
 {
     return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__MEM_EVENT);
@@ -1689,6 +1729,7 @@ static struct xsm_operations flask_ops = {
     .unmap_domain_pirq = flask_unmap_domain_pirq,
     .irq_permission = flask_irq_permission,
     .iomem_permission = flask_iomem_permission,
+    .iomem_mapping = flask_iomem_mapping,
     .pci_config_permission = flask_pci_config_permission,
 
     .resource_plug_core = flask_resource_plug_core,
@@ -1713,10 +1754,12 @@ static struct xsm_operations flask_ops = {
     .hypercall_init = flask_hypercall_init,
     .hvmcontext = flask_hvmcontext,
     .address_size = flask_address_size,
+    .machine_address_size = flask_machine_address_size,
     .hvm_param = flask_hvm_param,
     .hvm_set_pci_intx_level = flask_hvm_set_pci_intx_level,
     .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
     .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
+    .hvm_inject_msi = flask_hvm_inject_msi,
     .mem_event = flask_mem_event,
     .mem_sharing = flask_mem_sharing,
     .apic = flask_apic,
@@ -1749,6 +1792,7 @@ static struct xsm_operations flask_ops = {
     .ext_vcpucontext = flask_ext_vcpucontext,
     .vcpuextstate = flask_vcpuextstate,
     .ioport_permission = flask_ioport_permission,
+    .ioport_mapping = flask_ioport_mapping,
 #endif
 };
 
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 10f8e80..894910c 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -66,6 +66,9 @@
    S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELSELF, "relabelself")
    S_(SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR, "make_priv_for")
    S_(SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET, "set_as_target")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID, "set_cpuid")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__GETTSC, "gettsc")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__SETTSC, "settsc")
    S_(SECCLASS_HVM, HVM__SETHVMC, "sethvmc")
    S_(SECCLASS_HVM, HVM__GETHVMC, "gethvmc")
    S_(SECCLASS_HVM, HVM__SETPARAM, "setparam")
@@ -79,6 +82,8 @@
    S_(SECCLASS_HVM, HVM__HVMCTL, "hvmctl")
    S_(SECCLASS_HVM, HVM__MEM_EVENT, "mem_event")
    S_(SECCLASS_HVM, HVM__MEM_SHARING, "mem_sharing")
+   S_(SECCLASS_HVM, HVM__AUDIT_P2M, "audit_p2m")
+   S_(SECCLASS_HVM, HVM__SEND_IRQ, "send_irq")
    S_(SECCLASS_EVENT, EVENT__BIND, "bind")
    S_(SECCLASS_EVENT, EVENT__SEND, "send")
    S_(SECCLASS_EVENT, EVENT__STATUS, "status")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index f7cfee1..1bdb515 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -68,6 +68,9 @@
 #define DOMAIN2__RELABELSELF                      0x00000004UL
 #define DOMAIN2__MAKE_PRIV_FOR                    0x00000008UL
 #define DOMAIN2__SET_AS_TARGET                    0x00000010UL
+#define DOMAIN2__SET_CPUID                        0x00000020UL
+#define DOMAIN2__GETTSC                           0x00000040UL
+#define DOMAIN2__SETTSC                           0x00000080UL
 
 #define HVM__SETHVMC                              0x00000001UL
 #define HVM__GETHVMC                              0x00000002UL
@@ -82,6 +85,8 @@
 #define HVM__HVMCTL                               0x00000400UL
 #define HVM__MEM_EVENT                            0x00000800UL
 #define HVM__MEM_SHARING                          0x00001000UL
+#define HVM__AUDIT_P2M                            0x00002000UL
+#define HVM__SEND_IRQ                             0x00004000UL
 
 #define EVENT__BIND                               0x00000001UL
 #define EVENT__SEND                               0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSel-0002Md-Tv; Fri, 30 Nov 2012 15:37:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSej-0002MC-UB
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:34 +0000
Received: from [85.158.139.211:63650] by server-2.bemta-5.messagelabs.com id
	00/6F-04892-DB2D8B05; Fri, 30 Nov 2012 15:37:33 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-8.tower-206.messagelabs.com!1354289851!18547804!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24237 invoked from network); 30 Nov 2012 15:37:32 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-8.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:32 -0000
X-TM-IMSS-Message-ID: <339210a100027aaa@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 339210a100027aaa ;
	Fri, 30 Nov 2012 10:36:23 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSct017785; 
	Fri, 30 Nov 2012 10:37:29 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:49 -0500
Message-Id: <1354289830-24642-3-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: [Xen-devel] [PATCH 02/23] flask/policy: Add domain relabel example
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This adds the nomigrate_t type to the example FLASK policy which allows
domains to be created that dom0 cannot access after building.

Example domain configuration snippet:
  seclabel='customer_1:vm_r:nomigrate_t'
  init_seclabel='customer_1:vm_r:nomigrate_t_building'

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 docs/misc/xsm-flask.txt                      |  2 +
 tools/flask/policy/policy/modules/xen/xen.if | 56 +++++++++++++++++++++-------
 tools/flask/policy/policy/modules/xen/xen.te | 10 +++++
 3 files changed, 55 insertions(+), 13 deletions(-)

diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index 6b0d327..0778a28 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -60,6 +60,8 @@ that can be used without dom0 disaggregation. The main types for domUs are:
  - domU_t is a domain that can communicate with any other domU_t
  - isolated_domU_t can only communicate with dom0
  - prot_domU_t is a domain type whose creation can be disabled with a boolean
+ - nomigrate_t is a domain that must be created via the nomigrate_t_building
+   type, and whose memory cannot be read by dom0 once created
 
 HVM domains with stubdomain device models use two types (one per domain):
  - domHVM_t is an HVM domain that uses a stubdomain device model
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 3f58909..2ad11b2 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -9,24 +9,47 @@
 #   Declare a type as a domain type, and allow basic domain setup
 define(`declare_domain', `
 	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
+	type $1_channel, event_type;
+	type_transition $1 domain_type:event $1_channel;
 	allow $1 $1:grant { query setup };
 	allow $1 $1:mmu { adjust physmap map_read map_write stat pinpage };
 	allow $1 $1:hvm { getparam setparam };
 ')
 
-# create_domain(priv, target)
-#   Allow a domain to be created
-define(`create_domain', `
+# declare_build_label(type)
+#   Declare a paired _building type for the given domain type
+define(`declare_build_label', `
+	type $1_building, domain_type;
+	type_transition $1_building domain_type:event $1_channel;
+	allow $1_building $1 : domain transition;
+')
+
+define(`create_domain_common', `
 	allow $1 $2:domain { create max_vcpus setdomainmaxmem setaddrsize
-			getdomaininfo hypercall setvcpucontext scheduler
-			unpause getvcpuinfo getvcpuextstate getaddrsize
-			getvcpuaffinity };
+			getdomaininfo hypercall setvcpucontext setextvcpucontext
+			scheduler getvcpuinfo getvcpuextstate getaddrsize
+			getvcpuaffinity setvcpuaffinity };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
 	allow $1 $2:mmu {map_read map_write adjust memorymap physmap pinpage};
 	allow $1 $2:grant setup;
-	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute setparam pcilevel trackdirtyvram };
-	allow $1 $2_$1_channel:event create;
+	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc setparam pcilevel trackdirtyvram };
+')
+
+# create_domain(priv, target)
+#   Allow a domain to be created directly
+define(`create_domain', `
+	create_domain_common($1, $2)
+	allow $1 $2_channel:event create;
+')
+
+# create_domain_build_label(priv, target)
+#   Allow a domain to be created via its domain build label
+define(`create_domain_build_label', `
+	create_domain_common($1, $2_building)
+	allow $1 $2_channel:event create;
+	allow $1 $2_building:domain2 relabelfrom;
+	allow $1 $2:domain2 relabelto;
 ')
 
 # manage_domain(priv, target)
@@ -37,6 +60,15 @@ define(`manage_domain', `
 			setvcpuaffinity setdomainmaxmem };
 ')
 
+# migrate_domain_out(priv, target)
+#   Allow creation of a snapshot or migration image from a domain
+#   (inbound migration is the same as domain creation)
+define(`migrate_domain_out', `
+	allow $1 $2:hvm { gethvmc getparam irqlevel };
+	allow $1 $2:mmu { stat pageinfo map_read };
+	allow $1 $2:domain { getaddrsize getvcpucontext getextvcpucontext getvcpuextstate pause destroy };
+')
+
 ################################################################################
 #
 # Inter-domain communication
@@ -47,8 +79,6 @@ define(`manage_domain', `
 #   This allows an event channel to be created from domains with labels
 #   <source> to <dest> and will label it <chan-label>
 define(`create_channel', `
-	type $3, event_type;
-	type_transition $1 $2:event $3;
 	allow $1 $3:event { create send status };
 	allow $3 $2:event { bind };
 ')
@@ -56,8 +86,8 @@ define(`create_channel', `
 # domain_event_comms(dom1, dom2)
 #   Allow two domain types to communicate using event channels
 define(`domain_event_comms', `
-	create_channel($1, $2, $1_$2_channel)
-	create_channel($2, $1, $2_$1_channel)
+	create_channel($1, $2, $1_channel)
+	create_channel($2, $1, $2_channel)
 ')
 
 # domain_comms(dom1, dom2)
@@ -72,7 +102,7 @@ define(`domain_comms', `
 #   Allow a domain types to communicate with others of its type using grants
 #   and event channels (this includes event channels to DOMID_SELF)
 define(`domain_self_comms', `
-	create_channel($1, $1, $1_self_channel)
+	create_channel($1, $1, $1_channel)
 	allow $1 $1:grant { map_read map_write copy unmap };
 ')
 
diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
index 9550397..1162153 100644
--- a/tools/flask/policy/policy/modules/xen/xen.te
+++ b/tools/flask/policy/policy/modules/xen/xen.te
@@ -90,6 +90,7 @@ create_domain(dom0_t, isolated_domU_t)
 manage_domain(dom0_t, isolated_domU_t)
 domain_comms(dom0_t, isolated_domU_t)
 
+# Declare a boolean that denies creation of prot_domU_t domains
 gen_bool(prot_doms_locked, false)
 declare_domain(prot_domU_t)
 if (!prot_doms_locked) {
@@ -111,6 +112,15 @@ manage_domain(dom0_t, dm_dom_t)
 domain_comms(dom0_t, dm_dom_t)
 device_model(dm_dom_t, domHVM_t)
 
+# nomigrate_t must be built via the nomigrate_t_building label; once built,
+# dom0 cannot read its memory.
+declare_domain(nomigrate_t)
+declare_build_label(nomigrate_t)
+create_domain_build_label(dom0_t, nomigrate_t)
+manage_domain(dom0_t, nomigrate_t)
+domain_comms(dom0_t, nomigrate_t)
+domain_self_comms(nomigrate_t)
+
 ###############################################################################
 #
 # Device delegation
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSeo-0002OK-JU; Fri, 30 Nov 2012 15:37:38 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSem-0002Mn-Ma
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:36 +0000
Received: from [193.109.254.147:14299] by server-13.bemta-14.messagelabs.com
	id 66/A7-11239-FB2D8B05; Fri, 30 Nov 2012 15:37:35 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-9.tower-27.messagelabs.com!1354289851!8908059!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5340 invoked from network); 30 Nov 2012 15:37:31 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-9.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:31 -0000
X-TM-IMSS-Message-ID: <d0a0da73000589b4@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0da73000589b4 ;
	Fri, 30 Nov 2012 10:37:34 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbScr017785
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 10:37:28 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:47 -0500
Message-Id: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
Subject: [Xen-devel] [PATCH v6] Merge IS_PRIV checks into XSM hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Changes from v5:
 * Add a few comments/docs
 * Remove CPP hackery so ctags can find dummy XSM hook implementations
 * Clean up XSM hooks that are redundant after the introduction of the
   generic domctl, sysctl, and platform_hypercall sub-operation hooks.
 * Add a parameter of type enum xsm_default to XSM hook invocations to
   document the default action of an XSM hook at the call site.

Changes from v4:
 * Removed patches that have been applied
 * Rename __do_xsm_op to do_xsm_op
 * Rebased on current xen-unstable
 * Policy headers moved under hypervisor

Changes from v3:
 * Moved x86-specific sysctls inside #ifdef CONFIG_X86
 * Removed pt_domain parameter from mmu_update hook when unused
 * Renamed xsm___do_xsm_op to xsm_do_xsm_op
 * Added struct domain* argument to arch_do_domctl
 * Cleaned up mem_event code duplication

Changes from v2:
 * Added overall hooks for domctl, sysctl, and platform_hypercall so
   that new sub-operations are protected by IS_PRIV checks
 * Reorganized the IS_PRIV additions to dummy.h so they are added in the
   same patch that removes the IS_PRIV they are replacing
 * Reworked hooks in the MM hotpath to increase efficiency
 * Dropped some unneeded XSM hook additions due to do_domctl hook
 * Dropped the rcu_lock*target_domain_by_id function removal patch
 * Restore IS_PRIV check in PHYSDEVOP_alloc_irq_vector
 * Use the existing hook function structure for tmem


Toolstack updates:
    [PATCH 01/23] libxl: introduce XSM relabel on build

Miscellaneous updates to FLASK:
    [PATCH 02/23] flask/policy: Add domain relabel example
    [PATCH 04/23] xsm/flask: Add checks on the domain performing the
    [PATCH 13/23] xsm/flask: add distinct SIDs for self/target access
    [PATCH 19/23] flask: move policy headers into hypervisor
    [PATCH 23/23] xen/xsm: Add xsm_default parameter to XSM hooks

IS_PRIV removal:
    [PATCH 05/23] xsm: Use the dummy XSM module if XSM is disabled
    [PATCH 06/23] xen: use XSM instead of IS_PRIV where duplicated
    [PATCH 07/23] xen: avoid calling rcu_lock_*target_domain when an XSM
    [PATCH 08/23] arch/x86: convert platform_hypercall to use XSM
    [PATCH 10/23] xen: convert do_domctl to use XSM
    [PATCH 11/23] xen: convert do_sysctl to use XSM

Refactoring not directly related to IS_PRIV:
    [PATCH 09/23] xen: lock target domain in do_domctl common code
    [PATCH 18/23] xen/arch/*: add struct domain parameter to arch_do_domctl

New or updated XSM hooks:
    [PATCH 03/23] arch/x86: add distinct XSM hooks for map/unmap
    [PATCH 12/23] xsm/flask: add missing hooks
    [PATCH 14/23] arch/x86: Add missing mem_sharing XSM hooks
    [PATCH 15/23] arch/x86: use XSM hooks for get_pg_owner access checks
    [PATCH 16/23] xen: Add XSM hook for XENMEM_exchange
    [PATCH 17/23] tmem: add XSM hooks

Deletion of now-redundant XSM hooks:
    [PATCH 20/23] xen: domctl XSM hook removal
    [PATCH 21/23] xen: sysctl XSM hook removal
    [PATCH 22/23] xen: platform_hypercall XSM hook removal

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSen-0002Nv-Qp; Fri, 30 Nov 2012 15:37:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSel-0002MQ-Vg
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:36 +0000
Received: from [85.158.139.211:63794] by server-6.bemta-5.messagelabs.com id
	83/44-19321-FB2D8B05; Fri, 30 Nov 2012 15:37:35 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-3.tower-206.messagelabs.com!1354289853!18565534!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=2.5 required=7.0 tests=BODY_RANDOM_LONG,LONGWORDS
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21512 invoked from network); 30 Nov 2012 15:37:34 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-3.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:34 -0000
X-TM-IMSS-Message-ID: <33921cc200027ab4@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 33921cc200027ab4 ;
	Fri, 30 Nov 2012 10:36:26 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd5017785; 
	Fri, 30 Nov 2012 10:37:32 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:59 -0500
Message-Id: <1354289830-24642-13-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: [Xen-devel] [PATCH 12/23] xsm/flask: add missing hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The FLASK module was missing implementations of some hooks and did not
have access vectors defined for 10 domctls; define these now.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 tools/flask/policy/policy/flask/access_vectors |  5 ++
 tools/flask/policy/policy/modules/xen/xen.if   |  4 +-
 xen/xsm/flask/hooks.c                          | 66 +++++++++++++++++++++-----
 xen/xsm/flask/include/av_perm_to_string.h      |  5 ++
 xen/xsm/flask/include/av_permissions.h         |  5 ++
 5 files changed, 73 insertions(+), 12 deletions(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index 11d02da..ea65e45 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -80,6 +80,9 @@ class domain2
 	relabelself
 	make_priv_for
 	set_as_target
+	set_cpuid
+	gettsc
+	settsc
 }
 
 class hvm
@@ -97,6 +100,8 @@ class hvm
     hvmctl
     mem_event
     mem_sharing
+    audit_p2m
+    send_irq
 }
 
 class event
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 2ad11b2..59ba171 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -29,6 +29,7 @@ define(`create_domain_common', `
 			getdomaininfo hypercall setvcpucontext setextvcpucontext
 			scheduler getvcpuinfo getvcpuextstate getaddrsize
 			getvcpuaffinity setvcpuaffinity };
+	allow $1 $2:domain2 { set_cpuid settsc };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
 	allow $1 $2:mmu {map_read map_write adjust memorymap physmap pinpage};
@@ -67,6 +68,7 @@ define(`migrate_domain_out', `
 	allow $1 $2:hvm { gethvmc getparam irqlevel };
 	allow $1 $2:mmu { stat pageinfo map_read };
 	allow $1 $2:domain { getaddrsize getvcpucontext getextvcpucontext getvcpuextstate pause destroy };
+	allow $1 $2:domain2 gettsc;
 ')
 
 ################################################################################
@@ -112,7 +114,7 @@ define(`device_model', `
 	domain_comms($1, $2)
 	allow $1 $2:domain { set_target shutdown };
 	allow $1 $2:mmu { map_read map_write adjust physmap };
-	allow $1 $2:hvm { getparam setparam trackdirtyvram hvmctl irqlevel pciroute };
+	allow $1 $2:hvm { getparam setparam trackdirtyvram hvmctl irqlevel pciroute cacheattr send_irq };
 ')
 ################################################################################
 #
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index e25dd1c..dbbf34f 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -650,25 +650,32 @@ static int flask_domctl(struct domain *d, int cmd)
 #endif
         return 0;
 
+    case XEN_DOMCTL_debug_op:
+    case XEN_DOMCTL_gdbsx_guestmemio:
+    case XEN_DOMCTL_gdbsx_pausevcpu:
+    case XEN_DOMCTL_gdbsx_unpausevcpu:
+    case XEN_DOMCTL_gdbsx_domstatus:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
+                               DOMAIN__SETDEBUGGING);
+
     case XEN_DOMCTL_subscribe:
     case XEN_DOMCTL_disable_migrate:
+    case XEN_DOMCTL_suppress_spurious_page_faults:
         return domain_has_perm(current->domain, d, SECCLASS_DOMAIN,
                                DOMAIN__SET_MISC_INFO);
 
     case XEN_DOMCTL_set_cpuid:
-    case XEN_DOMCTL_suppress_spurious_page_faults:
-    case XEN_DOMCTL_debug_op:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID);
+
     case XEN_DOMCTL_gettscinfo:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__GETTSC);
+
     case XEN_DOMCTL_settscinfo:
+        return domain_has_perm(current->domain, d, SECCLASS_DOMAIN2, DOMAIN2__SETTSC);
+
     case XEN_DOMCTL_audit_p2m:
-    case XEN_DOMCTL_gdbsx_guestmemio:
-    case XEN_DOMCTL_gdbsx_pausevcpu:
-    case XEN_DOMCTL_gdbsx_unpausevcpu:
-    case XEN_DOMCTL_gdbsx_domstatus:
-        /* TODO add per-subfunction hooks */
-        if ( !IS_PRIV(current->domain) )
-            return -EPERM;
-        return 0;
+        return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__AUDIT_P2M);
+
     default:
         printk("flask_domctl: Unknown op %d\n", cmd);
         return -EPERM;
@@ -921,6 +928,11 @@ static int flask_iomem_permission(struct domain *d, uint64_t start, uint64_t end
     return security_iterate_iomem_sids(start, end, _iomem_has_perm, &data);
 }
 
+static int flask_iomem_mapping(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
+{
+    return flask_iomem_permission(d, start, end, access);
+}
+
 static int flask_pci_config_permission(struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
     u32 rsid;
@@ -1128,7 +1140,6 @@ static int _ioport_has_perm(void *v, u32 sid, unsigned long start, unsigned long
     return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
 }
 
-
 static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
 {
     int rc;
@@ -1151,6 +1162,11 @@ static int flask_ioport_permission(struct domain *d, uint32_t start, uint32_t en
     return security_iterate_ioport_sids(start, end, _ioport_has_perm, &data);
 }
 
+static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
+{
+    return flask_ioport_permission(d, start, end, access);
+}
+
 static int flask_getpageframeinfo(struct domain *d)
 {
     return domain_has_perm(current->domain, d, SECCLASS_MMU, MMU__PAGEINFO);
@@ -1209,6 +1225,25 @@ static int flask_address_size(struct domain *d, uint32_t cmd)
     return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
 }
 
+static int flask_machine_address_size(struct domain *d, uint32_t cmd)
+{
+    u32 perm;
+
+    switch ( cmd )
+    {
+    case XEN_DOMCTL_set_machine_address_size:
+        perm = DOMAIN__SETADDRSIZE;
+        break;
+    case XEN_DOMCTL_get_machine_address_size:
+        perm = DOMAIN__GETADDRSIZE;
+        break;
+    default:
+        return -EPERM;
+    }
+
+    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
+}
+
 static int flask_hvm_param(struct domain *d, unsigned long op)
 {
     u32 perm;
@@ -1246,6 +1281,11 @@ static int flask_hvm_set_pci_link_route(struct domain *d)
     return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__PCIROUTE);
 }
 
+static int flask_hvm_inject_msi(struct domain *d)
+{
+    return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__SEND_IRQ);
+}
+
 static int flask_mem_event(struct domain *d)
 {
     return domain_has_perm(current->domain, d, SECCLASS_HVM, HVM__MEM_EVENT);
@@ -1689,6 +1729,7 @@ static struct xsm_operations flask_ops = {
     .unmap_domain_pirq = flask_unmap_domain_pirq,
     .irq_permission = flask_irq_permission,
     .iomem_permission = flask_iomem_permission,
+    .iomem_mapping = flask_iomem_mapping,
     .pci_config_permission = flask_pci_config_permission,
 
     .resource_plug_core = flask_resource_plug_core,
@@ -1713,10 +1754,12 @@ static struct xsm_operations flask_ops = {
     .hypercall_init = flask_hypercall_init,
     .hvmcontext = flask_hvmcontext,
     .address_size = flask_address_size,
+    .machine_address_size = flask_machine_address_size,
     .hvm_param = flask_hvm_param,
     .hvm_set_pci_intx_level = flask_hvm_set_pci_intx_level,
     .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
     .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
+    .hvm_inject_msi = flask_hvm_inject_msi,
     .mem_event = flask_mem_event,
     .mem_sharing = flask_mem_sharing,
     .apic = flask_apic,
@@ -1749,6 +1792,7 @@ static struct xsm_operations flask_ops = {
     .ext_vcpucontext = flask_ext_vcpucontext,
     .vcpuextstate = flask_vcpuextstate,
     .ioport_permission = flask_ioport_permission,
+    .ioport_mapping = flask_ioport_mapping,
 #endif
 };
 
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 10f8e80..894910c 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -66,6 +66,9 @@
    S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELSELF, "relabelself")
    S_(SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR, "make_priv_for")
    S_(SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET, "set_as_target")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID, "set_cpuid")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__GETTSC, "gettsc")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__SETTSC, "settsc")
    S_(SECCLASS_HVM, HVM__SETHVMC, "sethvmc")
    S_(SECCLASS_HVM, HVM__GETHVMC, "gethvmc")
    S_(SECCLASS_HVM, HVM__SETPARAM, "setparam")
@@ -79,6 +82,8 @@
    S_(SECCLASS_HVM, HVM__HVMCTL, "hvmctl")
    S_(SECCLASS_HVM, HVM__MEM_EVENT, "mem_event")
    S_(SECCLASS_HVM, HVM__MEM_SHARING, "mem_sharing")
+   S_(SECCLASS_HVM, HVM__AUDIT_P2M, "audit_p2m")
+   S_(SECCLASS_HVM, HVM__SEND_IRQ, "send_irq")
    S_(SECCLASS_EVENT, EVENT__BIND, "bind")
    S_(SECCLASS_EVENT, EVENT__SEND, "send")
    S_(SECCLASS_EVENT, EVENT__STATUS, "status")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index f7cfee1..1bdb515 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -68,6 +68,9 @@
 #define DOMAIN2__RELABELSELF                      0x00000004UL
 #define DOMAIN2__MAKE_PRIV_FOR                    0x00000008UL
 #define DOMAIN2__SET_AS_TARGET                    0x00000010UL
+#define DOMAIN2__SET_CPUID                        0x00000020UL
+#define DOMAIN2__GETTSC                           0x00000040UL
+#define DOMAIN2__SETTSC                           0x00000080UL
 
 #define HVM__SETHVMC                              0x00000001UL
 #define HVM__GETHVMC                              0x00000002UL
@@ -82,6 +85,8 @@
 #define HVM__HVMCTL                               0x00000400UL
 #define HVM__MEM_EVENT                            0x00000800UL
 #define HVM__MEM_SHARING                          0x00001000UL
+#define HVM__AUDIT_P2M                            0x00002000UL
+#define HVM__SEND_IRQ                             0x00004000UL
 
 #define EVENT__BIND                               0x00000001UL
 #define EVENT__SEND                               0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSet-0002Sk-0K; Fri, 30 Nov 2012 15:37:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSep-0002Ok-Lo
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:40 +0000
Received: from [85.158.139.211:30640] by server-10.bemta-5.messagelabs.com id
	ED/33-09257-2C2D8B05; Fri, 30 Nov 2012 15:37:38 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-4.tower-206.messagelabs.com!1354289856!18577945!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2808 invoked from network); 30 Nov 2012 15:37:37 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-4.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:37 -0000
X-TM-IMSS-Message-ID: <3392281700027ac4@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3392281700027ac4 ;
	Fri, 30 Nov 2012 10:36:29 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSdF017785; 
	Fri, 30 Nov 2012 10:37:35 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:09 -0500
Message-Id: <1354289830-24642-23-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 22/23] xen: platform_hypercall XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

A number of the platform_hypercall XSM hooks have no parameters or only
pass the operation ID, making them redundant with the xsm_platform_op
hook. Remove these redundant hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/platform_hypercall.c |  60 ---------------------
 xen/include/xsm/dummy.h           |  67 ------------------------
 xen/include/xsm/xsm.h             |  72 -------------------------
 xen/xsm/dummy.c                   |  13 -----
 xen/xsm/flask/hooks.c             | 107 +++++++++++---------------------------
 5 files changed, 30 insertions(+), 289 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 738bed0..e17d64f 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -90,10 +90,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
     case XENPF_settime:
     {
-        ret = xsm_xen_settime();
-        if ( ret )
-            break;
-
         do_settime(op->u.settime.secs, 
                    op->u.settime.nsecs, 
                    op->u.settime.system_time);
@@ -103,10 +99,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
     case XENPF_add_memtype:
     {
-        ret = xsm_memtype(op->cmd);
-        if ( ret )
-            break;
-
         ret = mtrr_add_page(
             op->u.add_memtype.mfn,
             op->u.add_memtype.nr_mfns,
@@ -125,10 +117,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
     case XENPF_del_memtype:
     {
-        ret = xsm_memtype(op->cmd);
-        if ( ret )
-            break;
-
         if (op->u.del_memtype.handle == 0
             /* mtrr/main.c otherwise does a lookup */
             && (int)op->u.del_memtype.reg >= 0)
@@ -147,10 +135,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         unsigned long mfn, nr_mfns;
         mtrr_type     type;
 
-        ret = xsm_memtype(op->cmd);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( op->u.read_memtype.reg < num_var_ranges )
         {
@@ -167,10 +151,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         XEN_GUEST_HANDLE(const_void) data;
 
-        ret = xsm_microcode();
-        if ( ret )
-            break;
-
         guest_from_compat_handle(data, op->u.microcode.data);
 
         /*
@@ -198,10 +178,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         int quirk_id = op->u.platform_quirk.quirk_id;
 
-        ret = xsm_platform_quirk(quirk_id);
-        if ( ret )
-            break;
-
         switch ( quirk_id )
         {
         case QUIRK_NOIRQBALANCING:
@@ -223,10 +199,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_firmware_info:
-        ret = xsm_firmware_info();
-        if ( ret )
-            break;
-
         switch ( op->u.firmware_info.type )
         {
         case XEN_FW_DISK_INFO: {
@@ -335,10 +307,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         break;
 
     case XENPF_efi_runtime_call:
-        ret = xsm_efi_call();
-        if ( ret )
-            break;
-
         ret = efi_runtime_call(&op->u.efi_runtime_call);
         if ( ret == 0 &&
              copy_field_to_guest(u_xenpf_op, op, u.efi_runtime_call) )
@@ -346,18 +314,10 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         break;
 
     case XENPF_enter_acpi_sleep:
-        ret = xsm_acpi_sleep();
-        if ( ret )
-            break;
-
         ret = acpi_enter_sleep(&op->u.enter_acpi_sleep);
         break;
 
     case XENPF_change_freq:
-        ret = xsm_change_freq();
-        if ( ret )
-            break;
-
         ret = -ENOSYS;
         if ( cpufreq_controller != FREQCTL_dom0_kernel )
             break;
@@ -379,10 +339,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         XEN_GUEST_HANDLE(uint8) cpumap_bitmap;
         XEN_GUEST_HANDLE(uint64) idletimes;
 
-        ret = xsm_getidletime();
-        if ( ret )
-            break;
-
         ret = -ENOSYS;
         if ( cpufreq_controller != FREQCTL_dom0_kernel )
             break;
@@ -419,10 +375,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_set_processor_pminfo:
-        ret = xsm_setpminfo();
-        if ( ret )
-            break;
-
         switch ( op->u.set_pminfo.type )
         {
         case XEN_PM_PX:
@@ -475,10 +427,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
         g_info = &op->u.pcpu_info;
 
-        ret = xsm_getcpuinfo();
-        if ( ret )
-            break;
-
         if ( !get_cpu_maps() )
         {
             ret = -EBUSY;
@@ -512,10 +460,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         struct xenpf_pcpu_version *ver = &op->u.pcpu_version;
 
-        ret = xsm_getcpuinfo();
-        if ( ret )
-            break;
-
         if ( !get_cpu_maps() )
         {
             ret = -EBUSY;
@@ -568,10 +512,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
             break;
         }
 
-        ret = xsm_resource_plug_core();
-        if ( ret )
-            break;
-
         ret = continue_hypercall_on_cpu(
             0, cpu_up_helper, (void *)(unsigned long)cpu);
         break;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index b680d61..019183e 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -63,21 +63,6 @@ static XSM_INLINE int xsm_readconsole(uint32_t clear)
     return 0;
 }
 
-static XSM_INLINE int xsm_getcpuinfo(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_setpminfo(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_pm_op(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_do_mca(void)
 {
     if ( !IS_PRIV(current->domain) )
@@ -323,11 +308,6 @@ static XSM_INLINE int xsm_page_offline(uint32_t cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_lockprof(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_tmem_op(void)
 {
     return 0;
@@ -453,26 +433,6 @@ static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_xen_settime(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_memtype(uint32_t access)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_microcode(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_platform_op(uint32_t op)
 {
     if ( !IS_PRIV(current->domain) )
@@ -480,33 +440,6 @@ static XSM_INLINE int xsm_platform_op(uint32_t op)
     return 0;
 }
 
-static XSM_INLINE int xsm_firmware_info(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_efi_call(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_acpi_sleep(void)
-{
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
-}
-
-static XSM_INLINE int xsm_change_freq(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getidletime(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_machine_memory_map(void)
 {
     if ( !IS_PRIV(current->domain) )
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index f054dae..105201e 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -47,9 +47,6 @@ struct xsm_operations {
     int (*domctl) (struct domain *d, int cmd);
     int (*sysctl) (int cmd);
     int (*readconsole) (uint32_t clear);
-    int (*getcpuinfo) (void);
-    int (*setpminfo) (void);
-    int (*pm_op) (void);
     int (*do_mca) (void);
 
     int (*evtchn_unbound) (struct domain *d, struct evtchn *chn, domid_t id2);
@@ -110,7 +107,6 @@ struct xsm_operations {
     int (*resource_setup_misc) (void);
 
     int (*page_offline)(uint32_t cmd);
-    int (*lockprof)(void);
     int (*tmem_op)(void);
     int (*tmem_control)(void);
 
@@ -127,16 +123,8 @@ struct xsm_operations {
     int (*mem_event_op) (struct domain *d, int op);
     int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
     int (*apic) (struct domain *d, int cmd);
-    int (*xen_settime) (void);
     int (*memtype) (uint32_t access);
-    int (*microcode) (void);
-    int (*platform_quirk) (uint32_t);
     int (*platform_op) (uint32_t cmd);
-    int (*firmware_info) (void);
-    int (*efi_call) (void);
-    int (*acpi_sleep) (void);
-    int (*change_freq) (void);
-    int (*getidletime) (void);
     int (*machine_memory_map) (void);
     int (*domain_memory_map) (struct domain *d);
 #define XSM_MMU_UPDATE_READ      1
@@ -197,21 +185,6 @@ static inline int xsm_readconsole (uint32_t clear)
     return xsm_ops->readconsole(clear);
 }
 
-static inline int xsm_getcpuinfo(void)
-{
-    return xsm_ops->getcpuinfo();
-}
-
-static inline int xsm_setpminfo(void)
-{
-    return xsm_ops->setpminfo();
-}
-
-static inline int xsm_pm_op(void)
-{
-    return xsm_ops->pm_op();
-}
-
 static inline int xsm_do_mca(void)
 {
     return xsm_ops->do_mca();
@@ -458,11 +431,6 @@ static inline int xsm_page_offline(uint32_t cmd)
     return xsm_ops->page_offline(cmd);
 }
 
-static inline int xsm_lockprof(void)
-{
-    return xsm_ops->lockprof();
-}
-
 static inline int xsm_tmem_op(void)
 {
     return xsm_ops->tmem_op();
@@ -529,56 +497,16 @@ static inline int xsm_apic (struct domain *d, int cmd)
     return xsm_ops->apic(d, cmd);
 }
 
-static inline int xsm_xen_settime (void)
-{
-    return xsm_ops->xen_settime();
-}
-
 static inline int xsm_memtype (uint32_t access)
 {
     return xsm_ops->memtype(access);
 }
 
-static inline int xsm_microcode (void)
-{
-    return xsm_ops->microcode();
-}
-
-static inline int xsm_platform_quirk (uint32_t quirk)
-{
-    return xsm_ops->platform_quirk(quirk);
-}
-
 static inline int xsm_platform_op (uint32_t op)
 {
     return xsm_ops->platform_op(op);
 }
 
-static inline int xsm_firmware_info (void)
-{
-    return xsm_ops->firmware_info();
-}
-
-static inline int xsm_efi_call (void)
-{
-    return xsm_ops->efi_call();
-}
-
-static inline int xsm_acpi_sleep (void)
-{
-    return xsm_ops->acpi_sleep();
-}
-
-static inline int xsm_change_freq (void)
-{
-    return xsm_ops->change_freq();
-}
-
-static inline int xsm_getidletime (void)
-{
-    return xsm_ops->getidletime();
-}
-
 static inline int xsm_machine_memory_map(void)
 {
     return xsm_ops->machine_memory_map();
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 0216b62..22c66e5 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -36,9 +36,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, domctl);
     set_to_dummy_if_null(ops, sysctl);
     set_to_dummy_if_null(ops, readconsole);
-    set_to_dummy_if_null(ops, getcpuinfo);
-    set_to_dummy_if_null(ops, setpminfo);
-    set_to_dummy_if_null(ops, pm_op);
     set_to_dummy_if_null(ops, do_mca);
 
     set_to_dummy_if_null(ops, evtchn_unbound);
@@ -97,7 +94,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, resource_setup_misc);
 
     set_to_dummy_if_null(ops, page_offline);
-    set_to_dummy_if_null(ops, lockprof);
     set_to_dummy_if_null(ops, tmem_op);
     set_to_dummy_if_null(ops, tmem_control);
 
@@ -114,16 +110,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, mem_event_op);
     set_to_dummy_if_null(ops, mem_sharing_op);
     set_to_dummy_if_null(ops, apic);
-    set_to_dummy_if_null(ops, xen_settime);
-    set_to_dummy_if_null(ops, memtype);
-    set_to_dummy_if_null(ops, microcode);
-    set_to_dummy_if_null(ops, platform_quirk);
     set_to_dummy_if_null(ops, platform_op);
-    set_to_dummy_if_null(ops, firmware_info);
-    set_to_dummy_if_null(ops, efi_call);
-    set_to_dummy_if_null(ops, acpi_sleep);
-    set_to_dummy_if_null(ops, change_freq);
-    set_to_dummy_if_null(ops, getidletime);
     set_to_dummy_if_null(ops, machine_memory_map);
     set_to_dummy_if_null(ops, domain_memory_map);
     set_to_dummy_if_null(ops, mmu_update);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index d72a807..03ea675 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1186,64 +1186,51 @@ static int flask_apic(struct domain *d, int cmd)
     return domain_has_xen(d, perm);
 }
 
-static int flask_xen_settime(void)
-{
-    return domain_has_xen(current->domain, XEN__SETTIME);
-}
-
-static int flask_memtype(uint32_t access)
-{
-    u32 perm;
-
-    switch ( access )
-    {
-    case XENPF_add_memtype:
-        perm = XEN__MTRR_ADD;
-        break;
-    case XENPF_del_memtype:
-        perm = XEN__MTRR_DEL;
-        break;
-    case XENPF_read_memtype:
-        perm = XEN__MTRR_READ;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return domain_has_xen(current->domain, perm);
-}
-
-static int flask_microcode(void)
-{
-    return domain_has_xen(current->domain, XEN__MICROCODE);
-}
-
-static int flask_platform_quirk(uint32_t quirk)
-{
-    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN, XEN__QUIRK, NULL);
-}
-
 static int flask_platform_op(uint32_t op)
 {
     switch ( op )
     {
+#ifdef CONFIG_X86
+    /* These operations have their own XSM hooks */
+    case XENPF_cpu_online:
+    case XENPF_cpu_offline:
+    case XENPF_cpu_hotadd:
+    case XENPF_mem_hotadd:
+        return 0;
+#endif
+
     case XENPF_settime:
+        return domain_has_xen(current->domain, XEN__SETTIME);
+
     case XENPF_add_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_ADD);
+
     case XENPF_del_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_DEL);
+
     case XENPF_read_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_READ);
+
     case XENPF_microcode_update:
+        return domain_has_xen(current->domain, XEN__MICROCODE);
+
     case XENPF_platform_quirk:
+        return domain_has_xen(current->domain, XEN__QUIRK);
+
     case XENPF_firmware_info:
+        return domain_has_xen(current->domain, XEN__FIRMWARE);
+
     case XENPF_efi_runtime_call:
+        return domain_has_xen(current->domain, XEN__FIRMWARE);
+
     case XENPF_enter_acpi_sleep:
+        return domain_has_xen(current->domain, XEN__SLEEP);
+
     case XENPF_change_freq:
+        return domain_has_xen(current->domain, XEN__FREQUENCY);
+
     case XENPF_getidletime:
-    case XENPF_cpu_online:
-    case XENPF_cpu_offline:
-    case XENPF_cpu_hotadd:
-    case XENPF_mem_hotadd:
-        /* These operations have their own XSM hooks */
-        return 0;
+        return domain_has_xen(current->domain, XEN__GETIDLE);
 
     case XENPF_set_processor_pminfo:
     case XENPF_core_parking:
@@ -1259,31 +1246,6 @@ static int flask_platform_op(uint32_t op)
     }
 }
 
-static int flask_firmware_info(void)
-{
-    return domain_has_xen(current->domain, XEN__FIRMWARE);
-}
-
-static int flask_efi_call(void)
-{
-    return domain_has_xen(current->domain, XEN__FIRMWARE);
-}
-
-static int flask_acpi_sleep(void)
-{
-    return domain_has_xen(current->domain, XEN__SLEEP);
-}
-
-static int flask_change_freq(void)
-{
-    return domain_has_xen(current->domain, XEN__FREQUENCY);
-}
-
-static int flask_getidletime(void)
-{
-    return domain_has_xen(current->domain, XEN__GETIDLE);
-}
-
 static int flask_machine_memory_map(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_MMU, MMU__MEMORYMAP, NULL);
@@ -1519,16 +1481,7 @@ static struct xsm_operations flask_ops = {
     .mem_event_op = flask_mem_event_op,
     .mem_sharing_op = flask_mem_sharing_op,
     .apic = flask_apic,
-    .xen_settime = flask_xen_settime,
-    .memtype = flask_memtype,
-    .microcode = flask_microcode,
-    .platform_quirk = flask_platform_quirk,
     .platform_op = flask_platform_op,
-    .firmware_info = flask_firmware_info,
-    .efi_call = flask_efi_call,
-    .acpi_sleep = flask_acpi_sleep,
-    .change_freq = flask_change_freq,
-    .getidletime = flask_getidletime,
     .machine_memory_map = flask_machine_memory_map,
     .domain_memory_map = flask_domain_memory_map,
     .mmu_update = flask_mmu_update,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSep-0002PT-UU; Fri, 30 Nov 2012 15:37:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSen-0002Mn-5G
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:37 +0000
Received: from [193.109.254.147:14316] by server-13.bemta-14.messagelabs.com
	id B6/A7-11239-0C2D8B05; Fri, 30 Nov 2012 15:37:36 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-16.tower-27.messagelabs.com!1354289851!8784701!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2288 invoked from network); 30 Nov 2012 15:37:31 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-16.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:31 -0000
X-TM-IMSS-Message-ID: <d0a0dd9f000589b7@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0dd9f000589b7 ;
	Fri, 30 Nov 2012 10:37:35 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbScs017785; 
	Fri, 30 Nov 2012 10:37:28 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:48 -0500
Message-Id: <1354289830-24642-2-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH 01/23] libxl: introduce XSM relabel on build
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Allow a domain to be built under one security label and run using a
different label. This can be used to prevent the domain builder or
control domain from having the ability to access a guest domain's memory
via map_foreign_range except during the build process where this is
required.

Note: this does not provide complete protection from a malicious dom0;
mappings created during the build process may persist after the relabel,
and could be used to indirectly access the guest's memory.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
---
 docs/man/xl.cfg.pod.5       |  9 +++++++++
 tools/libxc/xc_flask.c      | 10 ++++++++++
 tools/libxc/xenctrl.h       |  1 +
 tools/libxl/libxl_create.c  |  4 ++++
 tools/libxl/libxl_types.idl |  1 +
 tools/libxl/xl_cmdimpl.c    | 20 +++++++++++++++++++-
 6 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index fe4fac9..2b28966 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -270,6 +270,15 @@ UUID will be generated.
 
 Assign an XSM security label to this domain.
 
+=item B<init_seclabel="LABEL">
+
+Specify an XSM security label used for this domain temporarily during
+its build. The domain's XSM label will be changed to the execution
+seclabel (specified by "seclabel") once the build is complete, prior to
+unpausing the domain. With a properly constructed security policy (such
+as nomigrate_t in the example policy), this can be used to build a
+domain whose memory is not accessible to the toolstack domain.
+
 =item B<nomigrate=BOOLEAN>
 
 Disable migration of this domain.  This enables certain other features
diff --git a/tools/libxc/xc_flask.c b/tools/libxc/xc_flask.c
index 80c5a2d..face1e0 100644
--- a/tools/libxc/xc_flask.c
+++ b/tools/libxc/xc_flask.c
@@ -422,6 +422,16 @@ int xc_flask_setavc_threshold(xc_interface *xch, int threshold)
     return xc_flask_op(xch, &op);
 }
 
+int xc_flask_relabel_domain(xc_interface *xch, int domid, uint32_t sid)
+{
+    DECLARE_FLASK_OP;
+    op.cmd = FLASK_RELABEL_DOMAIN;
+    op.u.relabel.domid = domid;
+    op.u.relabel.sid = sid;
+
+    return xc_flask_op(xch, &op);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..60391c6 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -2158,6 +2158,7 @@ int xc_flask_policyvers(xc_interface *xc_handle);
 int xc_flask_avc_hashstats(xc_interface *xc_handle, char *buf, int size);
 int xc_flask_getavc_threshold(xc_interface *xc_handle);
 int xc_flask_setavc_threshold(xc_interface *xc_handle, int threshold);
+int xc_flask_relabel_domain(xc_interface *xch, int domid, uint32_t sid);
 
 struct elf_binary;
 void xc_elf_set_logfile(xc_interface *xch, struct elf_binary *elf,
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 9d20086..b183255 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -1182,6 +1182,10 @@ static void domcreate_complete(libxl__egc *egc,
                                int rc)
 {
     STATE_AO_GC(dcs->ao);
+    libxl_domain_config *const d_config = dcs->guest_config;
+
+    if (!rc && d_config->b_info.exec_ssidref)
+        rc = xc_flask_relabel_domain(CTX->xch, dcs->guest_domid, d_config->b_info.exec_ssidref);
 
     if (rc) {
         if (dcs->guest_domid) {
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 7eac4a8..93524f0 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -268,6 +268,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("video_memkb",     MemKB),
     ("shadow_memkb",    MemKB),
     ("rtc_timeoffset",  uint32),
+    ("exec_ssidref",    uint32),
     ("localtime",       libxl_defbool),
     ("disable_migrate", libxl_defbool),
     ("cpuid",           libxl_cpuid_policy_list),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 5d444a8..4d67fdf 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -596,16 +596,34 @@ static void parse_config_data(const char *config_source,
         exit(1);
     }
 
-    if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
+    if (!xlu_cfg_get_string (config, "init_seclabel", &buf, 0)) {
         e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
                                     &c_info->ssidref);
         if (e) {
             if (errno == ENOSYS) {
+                fprintf(stderr, "XSM Disabled: init_seclabel not supported\n");
+            } else {
+                fprintf(stderr, "Invalid init_seclabel: %s\n", buf);
+                exit(1);
+            }
+        }
+    }
+
+    if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
+        uint32_t ssidref;
+        e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
+                                    &ssidref);
+        if (e) {
+            if (errno == ENOSYS) {
                 fprintf(stderr, "XSM Disabled: seclabel not supported\n");
             } else {
                 fprintf(stderr, "Invalid seclabel: %s\n", buf);
                 exit(1);
             }
+        } else if (c_info->ssidref) {
+            b_info->exec_ssidref = ssidref;
+        } else {
+            c_info->ssidref = ssidref;
         }
     }
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSet-0002TE-El; Fri, 30 Nov 2012 15:37:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSep-0002OB-Tu
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:40 +0000
Received: from [85.158.139.211:64022] by server-15.bemta-5.messagelabs.com id
	6F/8B-26920-2C2D8B05; Fri, 30 Nov 2012 15:37:38 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-8.tower-206.messagelabs.com!1354289855!18547815!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24427 invoked from network); 30 Nov 2012 15:37:36 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-8.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:36 -0000
X-TM-IMSS-Message-ID: <339221f000027abe@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 339221f000027abe ;
	Fri, 30 Nov 2012 10:36:27 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSdB017785; 
	Fri, 30 Nov 2012 10:37:33 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:05 -0500
Message-Id: <1354289830-24642-19-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Tim Deegan <tim@xen.org>, Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 18/23] xen/arch/*: add struct domain parameter
	to arch_do_domctl
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Since the arch-independent do_domctl function now RCU locks the domain
specified by op->domain, pass the struct domain to the arch-specific
domctl function and remove the duplicate per-subfunction locking.

This also removes two get_domain/put_domain call pairs (in
XEN_DOMCTL_assign_device and XEN_DOMCTL_deassign_device), replacing them
with RCU locking.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@citrix.com>
Cc: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/domctl.c           |   2 +-
 xen/arch/x86/domctl.c           | 434 +++++++---------------------------------
 xen/common/domctl.c             |   2 +-
 xen/drivers/passthrough/iommu.c |  31 +--
 xen/include/xen/hypercall.h     |   2 +-
 xen/include/xen/iommu.h         |   3 +-
 6 files changed, 76 insertions(+), 398 deletions(-)

diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c
index cf16791..d54a387 100644
--- a/xen/arch/arm/domctl.c
+++ b/xen/arch/arm/domctl.c
@@ -10,7 +10,7 @@
 #include <xen/errno.h>
 #include <public/domctl.h>
 
-long arch_do_domctl(struct xen_domctl *domctl,
+long arch_do_domctl(struct xen_domctl *domctl, struct domain *d,
                     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     return -ENOSYS;
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 34e6223..5e224fc 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -47,7 +47,7 @@ static int gdbsx_guest_mem_io(
 }
 
 long arch_do_domctl(
-    struct xen_domctl *domctl,
+    struct xen_domctl *domctl, struct domain *d,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
@@ -57,23 +57,15 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_shadow_op:
     {
-        struct domain *d;
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = paging_domctl(d,
-                                &domctl->u.shadow_op,
-                                guest_handle_cast(u_domctl, void));
-            rcu_unlock_domain(d);
-            copy_to_guest(u_domctl, domctl, 1);
-        } 
+        ret = paging_domctl(d,
+                            &domctl->u.shadow_op,
+                            guest_handle_cast(u_domctl, void));
+        copy_to_guest(u_domctl, domctl, 1);
     }
     break;
 
     case XEN_DOMCTL_ioport_permission:
     {
-        struct domain *d;
         unsigned int fp = domctl->u.ioport_permission.first_port;
         unsigned int np = domctl->u.ioport_permission.nr_ports;
         int allow = domctl->u.ioport_permission.allow_access;
@@ -82,10 +74,6 @@ long arch_do_domctl(
         if ( (fp + np) > 65536 )
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
-            break;
-
         if ( np == 0 )
             ret = 0;
         else if ( xsm_ioport_permission(d, fp, fp + np - 1, allow) )
@@ -94,8 +82,6 @@ long arch_do_domctl(
             ret = ioports_permit_access(d, fp, fp + np - 1);
         else
             ret = ioports_deny_access(d, fp, fp + np - 1);
-
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -103,23 +89,16 @@ long arch_do_domctl(
     {
         struct page_info *page;
         unsigned long mfn = domctl->u.getpageframeinfo.gmfn;
-        domid_t dom = domctl->domain;
-        struct domain *d;
 
         ret = -EINVAL;
-
-        if ( unlikely(!mfn_valid(mfn)) ||
-             unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
+        if ( unlikely(!mfn_valid(mfn)) )
             break;
 
         page = mfn_to_page(mfn);
 
         ret = xsm_getpageframeinfo(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         if ( likely(get_page(page, d)) )
         {
@@ -149,8 +128,6 @@ long arch_do_domctl(
             put_page(page);
         }
 
-        rcu_unlock_domain(d);
-
         copy_to_guest(u_domctl, domctl, 1);
     }
     break;
@@ -160,27 +137,17 @@ long arch_do_domctl(
         {
             unsigned int n, j;
             unsigned int num = domctl->u.getpageframeinfo3.num;
-            domid_t dom = domctl->domain;
-            struct domain *d;
             struct page_info *page;
             xen_pfn_t *arr;
 
-            ret = -ESRCH;
-            if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-                break;
-
             ret = xsm_getpageframeinfo(d);
             if ( ret )
-            {
-                rcu_unlock_domain(d);
                 break;
-            }
 
             if ( unlikely(num > 1024) ||
                  unlikely(num != domctl->u.getpageframeinfo3.num) )
             {
                 ret = -E2BIG;
-                rcu_unlock_domain(d);
                 break;
             }
 
@@ -188,7 +155,6 @@ long arch_do_domctl(
             if ( !page )
             {
                 ret = -ENOMEM;
-                rcu_unlock_domain(d);
                 break;
             }
             arr = page_to_virt(page);
@@ -254,7 +220,6 @@ long arch_do_domctl(
 
             free_domheap_page(virt_to_page(arr));
 
-            rcu_unlock_domain(d);
             break;
         }
         /* fall thru */
@@ -262,25 +227,15 @@ long arch_do_domctl(
     {
         int n,j;
         int num = domctl->u.getpageframeinfo2.num;
-        domid_t dom = domctl->domain;
-        struct domain *d;
         uint32_t *arr32;
-        ret = -ESRCH;
-
-        if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-            break;
 
         ret = xsm_getpageframeinfo(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         if ( unlikely(num > 1024) )
         {
             ret = -E2BIG;
-            rcu_unlock_domain(d);
             break;
         }
 
@@ -288,7 +243,6 @@ long arch_do_domctl(
         if ( !arr32 )
         {
             ret = -ENOMEM;
-            rcu_unlock_domain(d);
             break;
         }
  
@@ -360,78 +314,58 @@ long arch_do_domctl(
         }
 
         free_xenheap_page(arr32);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_getmemlist:
     {
         int i;
-        struct domain *d = rcu_lock_domain_by_id(domctl->domain);
         unsigned long max_pfns = domctl->u.getmemlist.max_pfns;
         uint64_t mfn;
         struct page_info *page;
 
-        ret = -EINVAL;
-        if ( d != NULL )
-        {
-            ret = xsm_getmemlist(d);
-            if ( ret )
-            {
-                rcu_unlock_domain(d);
-                break;
-            }
+        ret = xsm_getmemlist(d);
+        if ( ret )
+            break;
 
-            spin_lock(&d->page_alloc_lock);
+        if ( unlikely(d->is_dying) ) {
+            ret = -EINVAL;
+            break;
+        }
 
-            if ( unlikely(d->is_dying) ) {
-                spin_unlock(&d->page_alloc_lock);
-                goto getmemlist_out;
-            }
+        spin_lock(&d->page_alloc_lock);
 
-            ret = i = 0;
-            page_list_for_each(page, &d->page_list)
+        ret = i = 0;
+        page_list_for_each(page, &d->page_list)
+        {
+            if ( i >= max_pfns )
+                break;
+            mfn = page_to_mfn(page);
+            if ( copy_to_guest_offset(domctl->u.getmemlist.buffer,
+                                      i, &mfn, 1) )
             {
-                if ( i >= max_pfns )
-                    break;
-                mfn = page_to_mfn(page);
-                if ( copy_to_guest_offset(domctl->u.getmemlist.buffer,
-                                          i, &mfn, 1) )
-                {
-                    ret = -EFAULT;
-                    break;
-                }
-                ++i;
+                ret = -EFAULT;
+                break;
             }
-            
-            spin_unlock(&d->page_alloc_lock);
-
-            domctl->u.getmemlist.num_pfns = i;
-            copy_to_guest(u_domctl, domctl, 1);
-        getmemlist_out:
-            rcu_unlock_domain(d);
+            ++i;
         }
+
+        spin_unlock(&d->page_alloc_lock);
+
+        domctl->u.getmemlist.num_pfns = i;
+        copy_to_guest(u_domctl, domctl, 1);
     }
     break;
 
     case XEN_DOMCTL_hypercall_init:
     {
-        struct domain *d = rcu_lock_domain_by_id(domctl->domain);
         unsigned long gmfn = domctl->u.hypercall_init.gmfn;
         struct page_info *page;
         void *hypercall_page;
 
-        ret = -ESRCH;
-        if ( unlikely(d == NULL) )
-            break;
-
         ret = xsm_hypercall_init(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
 
@@ -440,7 +374,6 @@ long arch_do_domctl(
         {
             if ( page )
                 put_page(page);
-            rcu_unlock_domain(d);
             break;
         }
 
@@ -451,19 +384,12 @@ long arch_do_domctl(
         unmap_domain_page(hypercall_page);
 
         put_page_and_type(page);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_sethvmcontext:
     { 
         struct hvm_domain_context c = { .size = domctl->u.hvmcontext.size };
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
 
         ret = xsm_hvmcontext(d, domctl->cmd);
         if ( ret )
@@ -488,19 +414,12 @@ long arch_do_domctl(
     sethvmcontext_out:
         if ( c.data != NULL )
             xfree(c.data);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gethvmcontext:
     { 
         struct hvm_domain_context c = { 0 };
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
 
         ret = xsm_hvmcontext(d, domctl->cmd);
         if ( ret )
@@ -544,53 +463,33 @@ long arch_do_domctl(
 
         if ( c.data != NULL )
             xfree(c.data);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gethvmcontext_partial:
     { 
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_hvmcontext(d, domctl->cmd);
         if ( ret )
-            goto gethvmcontext_partial_out;
+            break;
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
-            goto gethvmcontext_partial_out;
+            break;
 
         domain_pause(d);
         ret = hvm_save_one(d, domctl->u.hvmcontext_partial.type,
                            domctl->u.hvmcontext_partial.instance,
                            domctl->u.hvmcontext_partial.buffer);
         domain_unpause(d);
-
-    gethvmcontext_partial_out:
-        rcu_unlock_domain(d);
     }
     break;
 
 
     case XEN_DOMCTL_set_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_address_size(d, domctl->cmd);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         switch ( domctl->u.address_size.size )
         {
@@ -604,31 +503,19 @@ long arch_do_domctl(
             ret = (domctl->u.address_size.size == BITS_PER_LONG) ? 0 : -EINVAL;
             break;
         }
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_get_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_address_size(d, domctl->cmd);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domctl->u.address_size.size =
             is_pv_32on64_domain(d) ? 32 : BITS_PER_LONG;
 
         ret = 0;
-        rcu_unlock_domain(d);
 
         if ( copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
@@ -637,76 +524,51 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_machine_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_machine_address_size(d, domctl->cmd);
         if ( ret )
-            goto set_machine_address_size_out;
+            break;
 
         ret = -EBUSY;
         if ( d->tot_pages > 0 )
-            goto set_machine_address_size_out;
+            break;
 
         d->arch.physaddr_bitsize = domctl->u.address_size.size;
 
         ret = 0;
-    set_machine_address_size_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_get_machine_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_machine_address_size(d, domctl->cmd);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domctl->u.address_size.size = d->arch.physaddr_bitsize;
 
         ret = 0;
-        rcu_unlock_domain(d);
 
         if ( copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
-
-
     }
     break;
 
     case XEN_DOMCTL_sendtrigger:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_sendtrigger(d);
         if ( ret )
-            goto sendtrigger_out;
+            break;
 
         ret = -EINVAL;
         if ( domctl->u.sendtrigger.vcpu >= MAX_VIRT_CPUS )
-            goto sendtrigger_out;
+            break;
 
         ret = -ESRCH;
         if ( domctl->u.sendtrigger.vcpu >= d->max_vcpus ||
              (v = d->vcpu[domctl->u.sendtrigger.vcpu]) == NULL )
-            goto sendtrigger_out;
+            break;
 
         switch ( domctl->u.sendtrigger.trigger )
         {
@@ -743,34 +605,27 @@ long arch_do_domctl(
         default:
             ret = -ENOSYS;
         }
-
-    sendtrigger_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_bind_pt_irq:
     {
-        struct domain * d;
         xen_domctl_bind_pt_irq_t * bind;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
         bind = &(domctl->u.bind_pt_irq);
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d) )
-            goto bind_out;
+            break;
 
         ret = xsm_bind_pt_irq(d, bind);
         if ( ret )
-            goto bind_out;
+            break;
 
         ret = -EPERM;
         if ( !IS_PRIV(current->domain) &&
              !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto bind_out;
+            break;
 
         ret = -ESRCH;
         if ( iommu_enabled )
@@ -782,30 +637,23 @@ long arch_do_domctl(
         if ( ret < 0 )
             printk(XENLOG_G_ERR "pt_irq_create_bind failed (%ld) for dom%d\n",
                    ret, d->domain_id);
-
-    bind_out:
-        rcu_unlock_domain(d);
     }
     break;    
 
     case XEN_DOMCTL_unbind_pt_irq:
     {
-        struct domain * d;
         xen_domctl_bind_pt_irq_t * bind;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
         bind = &(domctl->u.bind_pt_irq);
 
         ret = -EPERM;
         if ( !IS_PRIV(current->domain) &&
              !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto unbind_out;
+            break;
 
         ret = xsm_unbind_pt_irq(d, bind);
         if ( ret )
-            goto unbind_out;
+            break;
 
         if ( iommu_enabled )
         {
@@ -816,15 +664,11 @@ long arch_do_domctl(
         if ( ret < 0 )
             printk(XENLOG_G_ERR "pt_irq_destroy_bind failed (%ld) for dom%d\n",
                    ret, d->domain_id);
-
-    unbind_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_memory_mapping:
     {
-        struct domain *d;
         unsigned long gfn = domctl->u.memory_mapping.first_gfn;
         unsigned long mfn = domctl->u.memory_mapping.first_mfn;
         unsigned long nr_mfns = domctl->u.memory_mapping.nr_mfns;
@@ -842,15 +686,9 @@ long arch_do_domctl(
              !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
-            break;
-
         ret = xsm_iomem_mapping(d, mfn, mfn + nr_mfns - 1, add);
-        if ( ret ) {
-            rcu_unlock_domain(d);
+        if ( ret )
             break;
-        }
 
         if ( add )
         {
@@ -897,15 +735,12 @@ long arch_do_domctl(
                        ret, add ? "removing" : "denying", d->domain_id,
                        mfn, mfn + nr_mfns - 1);
         }
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_ioport_mapping:
     {
 #define MAX_IOPORTS    0x10000
-        struct domain *d;
         struct hvm_iommu *hd;
         unsigned int fgp = domctl->u.ioport_mapping.first_gport;
         unsigned int fmp = domctl->u.ioport_mapping.first_mport;
@@ -929,15 +764,9 @@ long arch_do_domctl(
              !ioports_access_permitted(current->domain, fmp, fmp + np - 1) )
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
-            break;
-
         ret = xsm_ioport_mapping(d, fmp, fmp + np - 1, add);
-        if ( ret ) {
-            rcu_unlock_domain(d);
+        if ( ret )
             break;
-        }
 
         hd = domain_hvm_iommu(d);
         if ( add )
@@ -993,30 +822,19 @@ long arch_do_domctl(
                        "ioport_map: error %ld denying dom%d access to [%x,%x]\n",
                        ret, d->domain_id, fmp, fmp + np - 1);
         }
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_pin_mem_cacheattr:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_pin_mem_cacheattr(d);
         if ( ret )
-            goto pin_out;
+            break;
 
         ret = hvm_set_mem_pinned_cacheattr(
             d, domctl->u.pin_mem_cacheattr.start,
             domctl->u.pin_mem_cacheattr.end,
             domctl->u.pin_mem_cacheattr.type);
-
-    pin_out:
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -1024,19 +842,13 @@ long arch_do_domctl(
     case XEN_DOMCTL_get_ext_vcpucontext:
     {
         struct xen_domctl_ext_vcpucontext *evc;
-        struct domain *d;
         struct vcpu *v;
 
         evc = &domctl->u.ext_vcpucontext;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_ext_vcpucontext(d, domctl->cmd);
         if ( ret )
-            goto ext_vcpucontext_out;
+            break;
 
         ret = -ESRCH;
         if ( (evc->vcpu >= d->max_vcpus) ||
@@ -1127,7 +939,6 @@ long arch_do_domctl(
         ret = 0;
 
     ext_vcpucontext_out:
-        rcu_unlock_domain(d);
         if ( (domctl->cmd == XEN_DOMCTL_get_ext_vcpucontext) &&
              copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
@@ -1136,16 +947,10 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_cpuid:
     {
-        struct domain *d;
         xen_domctl_cpuid_t *ctl = &domctl->u.cpuid;
         cpuid_input_t *cpuid = NULL; 
         int i;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         for ( i = 0; i < MAX_CPUID_INPUT; i++ )
         {
             cpuid = &d->arch.cpuids[i];
@@ -1168,21 +973,13 @@ long arch_do_domctl(
             memcpy(cpuid, ctl, sizeof(cpuid_input_t));
             ret = 0;
         }
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gettscinfo:
     {
-        struct domain *d;
         xen_guest_tsc_info_t info;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         domain_pause(d);
         tsc_get_info(d, &info.tsc_mode,
                         &info.elapsed_nsec,
@@ -1193,20 +990,11 @@ long arch_do_domctl(
         else
             ret = 0;
         domain_unpause(d);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_settscinfo:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         domain_pause(d);
         tsc_set_info(d, domctl->u.tsc_info.info.tsc_mode,
                      domctl->u.tsc_info.info.elapsed_nsec,
@@ -1214,138 +1002,83 @@ long arch_do_domctl(
                      domctl->u.tsc_info.info.incarnation);
         domain_unpause(d);
 
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_suppress_spurious_page_faults:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            d->arch.suppress_spurious_page_faults = 1;
-            rcu_unlock_domain(d);
-            ret = 0;
-        }
+        d->arch.suppress_spurious_page_faults = 1;
+        ret = 0;
     }
     break;
 
     case XEN_DOMCTL_debug_op:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = -EINVAL;
         if ( (domctl->u.debug_op.vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[domctl->u.debug_op.vcpu]) == NULL) )
-            goto debug_op_out;
+            break;
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d))
-            goto debug_op_out;
+            break;
 
         ret = hvm_debug_op(v, domctl->u.debug_op.op);
-
-    debug_op_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_guestmemio:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         domctl->u.gdbsx_guest_memio.remain =
             domctl->u.gdbsx_guest_memio.len;
 
         ret = gdbsx_guest_mem_io(domctl->domain, &domctl->u.gdbsx_guest_memio);
         if ( !ret && copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_pausevcpu:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = -EBUSY;
         if ( !d->is_paused_by_controller )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         ret = -EINVAL;
         if ( domctl->u.gdbsx_pauseunp_vcpu.vcpu >= MAX_VIRT_CPUS ||
              (v = d->vcpu[domctl->u.gdbsx_pauseunp_vcpu.vcpu]) == NULL )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         vcpu_pause(v);
         ret = 0;
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_unpausevcpu:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = -EBUSY;
         if ( !d->is_paused_by_controller )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         ret = -EINVAL;
         if ( domctl->u.gdbsx_pauseunp_vcpu.vcpu >= MAX_VIRT_CPUS ||
              (v = d->vcpu[domctl->u.gdbsx_pauseunp_vcpu.vcpu]) == NULL )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         if ( !atomic_read(&v->pause_count) )
             printk("WARN: Unpausing vcpu:%d which is not paused\n", v->vcpu_id);
         vcpu_unpause(v);
         ret = 0;
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_domstatus:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         domctl->u.gdbsx_domstatus.vcpu_id = -1;
         domctl->u.gdbsx_domstatus.paused = d->is_paused_by_controller;
         if ( domctl->u.gdbsx_domstatus.paused )
@@ -1365,7 +1098,6 @@ long arch_do_domctl(
         ret = 0;
         if ( copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -1373,7 +1105,6 @@ long arch_do_domctl(
     case XEN_DOMCTL_getvcpuextstate:
     {
         struct xen_domctl_vcpuextstate *evc;
-        struct domain *d;
         struct vcpu *v;
         uint32_t offset = 0;
         uint64_t _xfeature_mask = 0;
@@ -1384,12 +1115,6 @@ long arch_do_domctl(
 
         evc = &domctl->u.vcpuextstate;
 
-        ret = -ESRCH;
-
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_vcpuextstate(d, domctl->cmd);
         if ( ret )
             goto vcpuextstate_out;
@@ -1488,7 +1213,6 @@ long arch_do_domctl(
         ret = 0;
 
     vcpuextstate_out:
-        rcu_unlock_domain(d);
         if ( (domctl->cmd == XEN_DOMCTL_getvcpuextstate) &&
              copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
@@ -1497,50 +1221,33 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_mem_event_op:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = mem_event_domctl(d, &domctl->u.mem_event_op,
-                                   guest_handle_cast(u_domctl, void));
-            rcu_unlock_domain(d);
-            copy_to_guest(u_domctl, domctl, 1);
-        } 
+        ret = mem_event_domctl(d, &domctl->u.mem_event_op,
+                               guest_handle_cast(u_domctl, void));
+        copy_to_guest(u_domctl, domctl, 1);
     }
     break;
 
     case XEN_DOMCTL_mem_sharing_op:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_mem_sharing(d);
-            if ( !ret )
-                ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
-            rcu_unlock_domain(d);
-        } 
+        ret = xsm_mem_sharing(d);
+        if ( !ret )
+            ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
     }
     break;
 
 #if P2M_AUDIT
     case XEN_DOMCTL_audit_p2m:
     {
-        struct domain *d;
-
-        ret = rcu_lock_remote_domain_by_id(domctl->domain, &d);
-        if ( ret != 0 )
+        if ( d == current->domain )
+        {
+            ret = -EPERM;
             break;
+        }
 
         audit_p2m(d,
                   &domctl->u.audit_p2m.orphans,
                   &domctl->u.audit_p2m.m2p_bad,
                   &domctl->u.audit_p2m.p2m_bad);
-        rcu_unlock_domain(d);
         if ( copy_to_guest(u_domctl, domctl, 1) ) 
             ret = -EFAULT;
     }
@@ -1549,29 +1256,22 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_access_required:
     {
-        struct domain *d;
         struct p2m_domain* p2m;
         
         ret = -EPERM;
-        if ( current->domain->domain_id == domctl->domain )
+        if ( current->domain == d )
             break;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_mem_event_setup(d);
-            if ( !ret ) {
-                p2m = p2m_get_hostp2m(d);
-                p2m->access_required = domctl->u.access_required.access_required;
-            }
-            rcu_unlock_domain(d);
-        } 
+        ret = xsm_mem_event_setup(d);
+        if ( !ret ) {
+            p2m = p2m_get_hostp2m(d);
+            p2m->access_required = domctl->u.access_required.access_required;
+        }
     }
     break;
 
     default:
-        ret = iommu_do_domctl(domctl, u_domctl);
+        ret = iommu_do_domctl(domctl, d, u_domctl);
         break;
     }
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 46bb0e3..2a42a5f 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -861,7 +861,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     break;
 
     default:
-        ret = arch_do_domctl(op, u_domctl);
+        ret = arch_do_domctl(op, d, u_domctl);
         break;
     }
 
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 47408f2..9d13185 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -538,10 +538,9 @@ void iommu_crash_shutdown(void)
 }
 
 int iommu_do_domctl(
-    struct xen_domctl *domctl,
+    struct xen_domctl *domctl, struct domain *d,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
-    struct domain *d;
     u16 seg;
     u8 bus, devfn;
     int ret = 0;
@@ -560,10 +559,6 @@ int iommu_do_domctl(
         if ( ret )
             break;
 
-        ret = -EINVAL;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         seg = domctl->u.get_device_group.machine_sbdf >> 16;
         bus = (domctl->u.get_device_group.machine_sbdf >> 8) & 0xff;
         devfn = domctl->u.get_device_group.machine_sbdf & 0xff;
@@ -584,7 +579,6 @@ int iommu_do_domctl(
         }
         if ( copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -607,20 +601,15 @@ int iommu_do_domctl(
         break;
 
     case XEN_DOMCTL_assign_device:
-        if ( unlikely((d = get_domain_by_id(domctl->domain)) == NULL) ||
-             unlikely(d->is_dying) )
+        if ( unlikely(d->is_dying) )
         {
-            printk(XENLOG_G_ERR
-                   "XEN_DOMCTL_assign_device: get_domain_by_id() failed\n");
             ret = -EINVAL;
-            if ( d )
-                goto assign_device_out;
             break;
         }
 
         ret = xsm_assign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
-            goto assign_device_out;
+            break;
 
         seg = domctl->u.get_device_group.machine_sbdf >> 16;
         bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff;
@@ -634,22 +623,12 @@ int iommu_do_domctl(
                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
                    d->domain_id, ret);
 
-    assign_device_out:
-        put_domain(d);
         break;
 
     case XEN_DOMCTL_deassign_device:
-        if ( unlikely((d = get_domain_by_id(domctl->domain)) == NULL) )
-        {
-            printk(XENLOG_G_ERR
-                   "XEN_DOMCTL_deassign_device: get_domain_by_id() failed\n");
-            ret = -EINVAL;
-            break;
-        }
-
         ret = xsm_deassign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
-            goto deassign_device_out;
+            break;
 
         seg = domctl->u.get_device_group.machine_sbdf >> 16;
         bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff;
@@ -664,8 +643,6 @@ int iommu_do_domctl(
                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
                    d->domain_id, ret);
 
-    deassign_device_out:
-        put_domain(d);
         break;
 
     default:
diff --git a/xen/include/xen/hypercall.h b/xen/include/xen/hypercall.h
index e315523..7c3d719 100644
--- a/xen/include/xen/hypercall.h
+++ b/xen/include/xen/hypercall.h
@@ -37,7 +37,7 @@ do_domctl(
 
 extern long
 arch_do_domctl(
-    struct xen_domctl *domctl,
+    struct xen_domctl *domctl, struct domain *d,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
 
 extern long
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 3026e54..55e5cc9 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -132,7 +132,8 @@ void iommu_crash_shutdown(void);
 void iommu_set_dom0_mapping(struct domain *d);
 void iommu_share_p2m_table(struct domain *d);
 
-int iommu_do_domctl(struct xen_domctl *, XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
+int iommu_do_domctl(struct xen_domctl *, struct domain *d,
+                    XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
 
 void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int page_count);
 void iommu_iotlb_flush_all(struct domain *d);
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSes-0002S1-8V; Fri, 30 Nov 2012 15:37:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSep-0002OM-1I
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:39 +0000
Received: from [193.109.254.147:42521] by server-14.bemta-14.messagelabs.com
	id 98/55-14517-2C2D8B05; Fri, 30 Nov 2012 15:37:38 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-16.tower-27.messagelabs.com!1354289853!8784708!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2529 invoked from network); 30 Nov 2012 15:37:34 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-16.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:34 -0000
X-TM-IMSS-Message-ID: <d0a0e858000589c0@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0e858000589c0 ;
	Fri, 30 Nov 2012 10:37:37 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd2017785; 
	Fri, 30 Nov 2012 10:37:31 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:56 -0500
Message-Id: <1354289830-24642-10-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 09/23] xen: lock target domain in do_domctl
	common code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Because almost all domctls need to lock the target domain, do this by
default instead of repeating it in each domctl. This is not currently
extended to the arch-specific domctls, but RCU locks are safe to take
recursively so this only causes duplicate but correct locking.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
---
 xen/common/domctl.c | 268 ++++++++++++----------------------------------------
 1 file changed, 59 insertions(+), 209 deletions(-)

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 2f49eb2..536bef5 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -243,6 +243,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
     struct xen_domctl curop, *op = &curop;
+    struct domain *d;
 
     if ( copy_from_guest(op, u_domctl, 1) )
         return -EFAULT;
@@ -252,19 +253,29 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     switch ( op->cmd )
     {
+    case XEN_DOMCTL_createdomain:
+    case XEN_DOMCTL_getdomaininfo:
+    case XEN_DOMCTL_test_assign_device:
+        d = NULL;
+        break;
+    default:
+        d = rcu_lock_domain_by_id(op->domain);
+        if ( d == NULL )
+            return -ESRCH;
+    }
+
+    switch ( op->cmd )
+    {
     case XEN_DOMCTL_ioport_mapping:
     case XEN_DOMCTL_memory_mapping:
     case XEN_DOMCTL_bind_pt_irq:
     case XEN_DOMCTL_unbind_pt_irq: {
-        struct domain *d;
-        bool_t is_priv = IS_PRIV(current->domain);
-        if ( !is_priv && ((d = rcu_lock_domain_by_id(op->domain)) != NULL) )
+        bool_t is_priv = IS_PRIV_FOR(current->domain, d);
+        if ( !is_priv )
         {
-            is_priv = IS_PRIV_FOR(current->domain, d);
-            rcu_unlock_domain(d);
+            ret = -EPERM;
+            goto domctl_out_unlock;
         }
-        if ( !is_priv )
-            return -EPERM;
         break;
     }
     case XEN_DOMCTL_getdomaininfo:
@@ -276,15 +287,18 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     }
 
     if ( !domctl_lock_acquire() )
+    {
+        if ( d )
+            rcu_unlock_domain(d);
         return hypercall_create_continuation(
             __HYPERVISOR_domctl, "h", u_domctl);
+    }
 
     switch ( op->cmd )
     {
 
     case XEN_DOMCTL_setvcpucontext:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
         vcpu_guest_context_u c = { .nat = NULL };
         unsigned int vcpu = op->u.vcpucontext.vcpu;
         struct vcpu *v;
@@ -338,77 +352,48 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     svc_out:
         free_vcpu_guest_context(c.nat);
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_pausedomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-        ret = -ESRCH;
-        if ( d != NULL )
-        {
-            ret = xsm_pausedomain(d);
-            if ( ret )
-                goto pausedomain_out;
+        ret = xsm_pausedomain(d);
+        if ( ret )
+            break;
 
-            ret = -EINVAL;
-            if ( d != current->domain )
-            {
-                domain_pause_by_systemcontroller(d);
-                ret = 0;
-            }
-        pausedomain_out:
-            rcu_unlock_domain(d);
+        ret = -EINVAL;
+        if ( d != current->domain )
+        {
+            domain_pause_by_systemcontroller(d);
+            ret = 0;
         }
     }
     break;
 
     case XEN_DOMCTL_unpausedomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-
-        ret = -ESRCH;
-        if ( d == NULL )
-            break;
-
         ret = xsm_unpausedomain(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domain_unpause_by_systemcontroller(d);
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_resumedomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-
-        ret = -ESRCH;
-        if ( d == NULL )
-            break;
-
         ret = xsm_resumedomain(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domain_resume(d);
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_createdomain:
     {
-        struct domain *d;
         domid_t        dom;
         static domid_t rover = 0;
         unsigned int domcr_flags;
@@ -458,6 +443,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( IS_ERR(d) )
         {
             ret = PTR_ERR(d);
+            d = NULL;
             break;
         }
 
@@ -469,39 +455,28 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         op->domain = d->domain_id;
         if ( copy_to_guest(u_domctl, op, 1) )
             ret = -EFAULT;
+        d = NULL;
     }
     break;
 
     case XEN_DOMCTL_max_vcpus:
     {
-        struct domain *d;
         unsigned int i, max = op->u.max_vcpus.max, cpu;
         cpumask_t *online;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = -EINVAL;
         if ( (d == current->domain) || /* no domain_pause() */
              (max > MAX_VIRT_CPUS) ||
              (is_hvm_domain(d) && (max > MAX_HVM_VCPUS)) )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         ret = xsm_max_vcpus(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         /* Until Xenoprof can dynamically grow its vcpu-s array... */
         if ( d->xenoprof )
         {
-            rcu_unlock_domain(d);
             ret = -EAGAIN;
             break;
         }
@@ -576,44 +551,31 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     maxvcpu_out_novcpulock:
         domain_unpause(d);
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_destroydomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-        ret = -ESRCH;
-        if ( d != NULL )
-        {
-            ret = xsm_destroydomain(d) ? : domain_kill(d);
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_destroydomain(d) ? : domain_kill(d);
     }
     break;
 
     case XEN_DOMCTL_setvcpuaffinity:
     case XEN_DOMCTL_getvcpuaffinity:
     {
-        domid_t dom = op->domain;
-        struct domain *d = rcu_lock_domain_by_id(dom);
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( d == NULL )
-            break;
-
         ret = xsm_vcpuaffinity(op->cmd, d);
         if ( ret )
-            goto vcpuaffinity_out;
+            break;
 
         ret = -EINVAL;
         if ( op->u.vcpuaffinity.vcpu >= d->max_vcpus )
-            goto vcpuaffinity_out;
+            break;
 
         ret = -ESRCH;
         if ( (v = d->vcpu[op->u.vcpuaffinity.vcpu]) == NULL )
-            goto vcpuaffinity_out;
+            break;
 
         if ( op->cmd == XEN_DOMCTL_setvcpuaffinity )
         {
@@ -632,36 +594,23 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             ret = cpumask_to_xenctl_cpumap(
                 &op->u.vcpuaffinity.cpumap, v->cpu_affinity);
         }
-
-    vcpuaffinity_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_scheduler_op:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = xsm_scheduler(d);
         if ( ret )
-            goto scheduler_op_out;
+            break;
 
         ret = sched_adjust(d, &op->u.scheduler_op);
         if ( copy_to_guest(u_domctl, op, 1) )
             ret = -EFAULT;
-
-    scheduler_op_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_getdomaininfo:
     { 
-        struct domain *d;
         domid_t dom = op->domain;
 
         rcu_read_lock(&domlist_read_lock);
@@ -689,19 +638,15 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     getdomaininfo_out:
         rcu_read_unlock(&domlist_read_lock);
+        d = NULL;
     }
     break;
 
     case XEN_DOMCTL_getvcpucontext:
     { 
         vcpu_guest_context_u c = { .nat = NULL };
-        struct domain       *d;
         struct vcpu         *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = xsm_getvcpucontext(d);
         if ( ret )
             goto getvcpucontext_out;
@@ -750,31 +695,25 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     getvcpucontext_out:
         xfree(c.nat);
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_getvcpuinfo:
     { 
-        struct domain *d;
         struct vcpu   *v;
         struct vcpu_runstate_info runstate;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = xsm_getvcpuinfo(d);
         if ( ret )
-            goto getvcpuinfo_out;
+            break;
 
         ret = -EINVAL;
         if ( op->u.getvcpuinfo.vcpu >= d->max_vcpus )
-            goto getvcpuinfo_out;
+            break;
 
         ret = -ESRCH;
         if ( (v = d->vcpu[op->u.getvcpuinfo.vcpu]) == NULL )
-            goto getvcpuinfo_out;
+            break;
 
         vcpu_runstate_get(v, &runstate);
 
@@ -787,25 +726,16 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
         if ( copy_to_guest(u_domctl, op, 1) )
             ret = -EFAULT;
-
-    getvcpuinfo_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_max_mem:
     {
-        struct domain *d;
         unsigned long new_max;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_setdomainmaxmem(d);
         if ( ret )
-            goto max_mem_out;
+            break;
 
         ret = -EINVAL;
         new_max = op->u.max_mem.max_memkb >> (PAGE_SHIFT-10);
@@ -819,77 +749,43 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         d->max_pages = new_max;
         ret = 0;
         spin_unlock(&d->page_alloc_lock);
-
-    max_mem_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_setdomainhandle:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_setdomainhandle(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         memcpy(d->handle, op->u.setdomainhandle.handle,
                sizeof(xen_domain_handle_t));
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_setdebugging:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = -EINVAL;
         if ( d == current->domain ) /* no domain_pause() */
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         ret = xsm_setdebugging(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domain_pause(d);
         d->debugger_attached = !!op->u.setdebugging.enable;
         domain_unpause(d); /* causes guest to latch new status */
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_irq_permission:
     {
-        struct domain *d;
         unsigned int pirq = op->u.irq_permission.pirq;
         int allow = op->u.irq_permission.allow_access;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         if ( pirq >= d->nr_pirqs )
             ret = -EINVAL;
         else if ( xsm_irq_permission(d, pirq, allow) )
@@ -898,14 +794,11 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             ret = irq_permit_access(d, pirq);
         else
             ret = irq_deny_access(d, pirq);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_iomem_permission:
     {
-        struct domain *d;
         unsigned long mfn = op->u.iomem_permission.first_mfn;
         unsigned long nr_mfns = op->u.iomem_permission.nr_mfns;
         int allow = op->u.iomem_permission.allow_access;
@@ -914,125 +807,78 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
             break;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         if ( xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
         else
             ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_settimeoffset:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_domain_settime(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domain_set_time_offset(d, op->u.settimeoffset.time_offset_seconds);
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_set_target:
     {
-        struct domain *d, *e;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
+        struct domain *e;
 
         ret = -ESRCH;
         e = get_domain_by_id(op->u.set_target.target);
         if ( e == NULL )
-            goto set_target_out;
+            break;
 
         ret = -EINVAL;
         if ( (d == e) || (d->target != NULL) )
         {
             put_domain(e);
-            goto set_target_out;
+            break;
         }
 
         ret = xsm_set_target(d, e);
         if ( ret ) {
             put_domain(e);
-            goto set_target_out;            
+            break;
         }
 
         /* Hold reference on @e until we destroy @d. */
         d->target = e;
 
         ret = 0;
-
-    set_target_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_subscribe:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_domctl(d, op->cmd);
-            if ( !ret )
-                d->suspend_evtchn = op->u.subscribe.port;
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_domctl(d, op->cmd);
+        if ( !ret )
+            d->suspend_evtchn = op->u.subscribe.port;
     }
     break;
 
     case XEN_DOMCTL_disable_migrate:
     {
-        struct domain *d;
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) != NULL )
-        {
-            ret = xsm_domctl(d, op->cmd);
-            if ( !ret )
-                d->disable_migrate = op->u.disable_migrate.disable;
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_domctl(d, op->cmd);
+        if ( !ret )
+            d->disable_migrate = op->u.disable_migrate.disable;
     }
     break;
 
     case XEN_DOMCTL_set_virq_handler:
     {
-        struct domain *d;
         uint32_t virq = op->u.set_virq_handler.virq;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_set_virq_handler(d, virq);
-            if ( !ret )
-                ret = set_global_virq_handler(d, virq);
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_set_virq_handler(d, virq);
+        if ( !ret )
+            ret = set_global_virq_handler(d, virq);
     }
     break;
 
@@ -1043,6 +889,10 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     domctl_lock_release();
 
+ domctl_out_unlock:
+    if ( d )
+        rcu_unlock_domain(d);
+
     return ret;
 }
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSeu-0002Tx-Oz; Fri, 30 Nov 2012 15:37:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSeq-0002Ok-EA
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:40 +0000
Received: from [85.158.139.211:64138] by server-10.bemta-5.messagelabs.com id
	D6/43-09257-4C2D8B05; Fri, 30 Nov 2012 15:37:40 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-3.tower-206.messagelabs.com!1354289856!18565546!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21676 invoked from network); 30 Nov 2012 15:37:37 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-3.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:37 -0000
X-TM-IMSS-Message-ID: <339226ef00027ac3@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 339226ef00027ac3 ;
	Fri, 30 Nov 2012 10:36:29 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSdD017785; 
	Fri, 30 Nov 2012 10:37:34 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:07 -0500
Message-Id: <1354289830-24642-21-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 20/23] xen: domctl XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

A number of the domctl XSM hooks do nothing except pass the domain and
operation ID, making them redundant with the xsm_domctl hook. Remove
these redundant hooks.

The remaining domctls all use individual hooks because they pass extra
details of the call to the XSM module in order to allow a more
fine-grained access decision to be made - for example, considering the
exact device or memory range being set up for guest access.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c   |  76 +---------
 xen/common/domctl.c     |  59 +-------
 xen/include/xsm/dummy.h | 135 -----------------
 xen/include/xsm/xsm.h   | 161 ---------------------
 xen/xsm/dummy.c         |  27 ----
 xen/xsm/flask/hooks.c   | 378 ++++++++++++------------------------------------
 6 files changed, 98 insertions(+), 738 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 5e224fc..2630bdb 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -96,10 +96,6 @@ long arch_do_domctl(
 
         page = mfn_to_page(mfn);
 
-        ret = xsm_getpageframeinfo(d);
-        if ( ret )
-            break;
-
         if ( likely(get_page(page, d)) )
         {
             ret = 0;
@@ -140,10 +136,6 @@ long arch_do_domctl(
             struct page_info *page;
             xen_pfn_t *arr;
 
-            ret = xsm_getpageframeinfo(d);
-            if ( ret )
-                break;
-
             if ( unlikely(num > 1024) ||
                  unlikely(num != domctl->u.getpageframeinfo3.num) )
             {
@@ -229,10 +221,6 @@ long arch_do_domctl(
         int num = domctl->u.getpageframeinfo2.num;
         uint32_t *arr32;
 
-        ret = xsm_getpageframeinfo(d);
-        if ( ret )
-            break;
-
         if ( unlikely(num > 1024) )
         {
             ret = -E2BIG;
@@ -324,10 +312,6 @@ long arch_do_domctl(
         uint64_t mfn;
         struct page_info *page;
 
-        ret = xsm_getmemlist(d);
-        if ( ret )
-            break;
-
         if ( unlikely(d->is_dying) ) {
             ret = -EINVAL;
             break;
@@ -363,10 +347,6 @@ long arch_do_domctl(
         struct page_info *page;
         void *hypercall_page;
 
-        ret = xsm_hypercall_init(d);
-        if ( ret )
-            break;
-
         page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
 
         ret = -EACCES;
@@ -391,10 +371,6 @@ long arch_do_domctl(
     { 
         struct hvm_domain_context c = { .size = domctl->u.hvmcontext.size };
 
-        ret = xsm_hvmcontext(d, domctl->cmd);
-        if ( ret )
-            goto sethvmcontext_out;
-
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
             goto sethvmcontext_out;
@@ -421,10 +397,6 @@ long arch_do_domctl(
     { 
         struct hvm_domain_context c = { 0 };
 
-        ret = xsm_hvmcontext(d, domctl->cmd);
-        if ( ret )
-            goto gethvmcontext_out;
-
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
             goto gethvmcontext_out;
@@ -468,10 +440,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_gethvmcontext_partial:
     { 
-        ret = xsm_hvmcontext(d, domctl->cmd);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
             break;
@@ -487,10 +455,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_address_size:
     {
-        ret = xsm_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         switch ( domctl->u.address_size.size )
         {
         case 32:
@@ -508,10 +472,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_get_address_size:
     {
-        ret = xsm_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         domctl->u.address_size.size =
             is_pv_32on64_domain(d) ? 32 : BITS_PER_LONG;
 
@@ -524,10 +484,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_machine_address_size:
     {
-        ret = xsm_machine_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         ret = -EBUSY;
         if ( d->tot_pages > 0 )
             break;
@@ -540,10 +496,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_get_machine_address_size:
     {
-        ret = xsm_machine_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         domctl->u.address_size.size = d->arch.physaddr_bitsize;
 
         ret = 0;
@@ -557,10 +509,6 @@ long arch_do_domctl(
     {
         struct vcpu *v;
 
-        ret = xsm_sendtrigger(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( domctl->u.sendtrigger.vcpu >= MAX_VIRT_CPUS )
             break;
@@ -827,10 +775,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_pin_mem_cacheattr:
     {
-        ret = xsm_pin_mem_cacheattr(d);
-        if ( ret )
-            break;
-
         ret = hvm_set_mem_pinned_cacheattr(
             d, domctl->u.pin_mem_cacheattr.start,
             domctl->u.pin_mem_cacheattr.end,
@@ -846,10 +790,6 @@ long arch_do_domctl(
 
         evc = &domctl->u.ext_vcpucontext;
 
-        ret = xsm_ext_vcpucontext(d, domctl->cmd);
-        if ( ret )
-            break;
-
         ret = -ESRCH;
         if ( (evc->vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[evc->vcpu]) == NULL) )
@@ -1115,10 +1055,6 @@ long arch_do_domctl(
 
         evc = &domctl->u.vcpuextstate;
 
-        ret = xsm_vcpuextstate(d, domctl->cmd);
-        if ( ret )
-            goto vcpuextstate_out;
-
         ret = -ESRCH;
         if ( (evc->vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[evc->vcpu]) == NULL) )
@@ -1229,9 +1165,7 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_mem_sharing_op:
     {
-        ret = xsm_mem_sharing(d);
-        if ( !ret )
-            ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
+        ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
     }
     break;
 
@@ -1262,11 +1196,9 @@ long arch_do_domctl(
         if ( current->domain == d )
             break;
 
-        ret = xsm_mem_event_setup(d);
-        if ( !ret ) {
-            p2m = p2m_get_hostp2m(d);
-            p2m->access_required = domctl->u.access_required.access_required;
-        }
+        ret = 0;
+        p2m = p2m_get_hostp2m(d);
+        p2m->access_required = domctl->u.access_required.access_required;
     }
     break;
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 2a42a5f..6f792e9 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -289,10 +289,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( d == NULL )
             break;
 
-        ret = xsm_setvcpucontext(d);
-        if ( ret )
-            goto svc_out;
-
         ret = -EINVAL;
         if ( (d == current->domain) || /* no domain_pause() */
              (vcpu >= d->max_vcpus) || ((v = d->vcpu[vcpu]) == NULL) )
@@ -339,10 +335,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_pausedomain:
     {
-        ret = xsm_pausedomain(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( d != current->domain )
         {
@@ -354,10 +346,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_unpausedomain:
     {
-        ret = xsm_unpausedomain(d);
-        if ( ret )
-            break;
-
         domain_unpause_by_systemcontroller(d);
         ret = 0;
     }
@@ -365,10 +353,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_resumedomain:
     {
-        ret = xsm_resumedomain(d);
-        if ( ret )
-            break;
-
         domain_resume(d);
         ret = 0;
     }
@@ -452,10 +436,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
              (is_hvm_domain(d) && (max > MAX_HVM_VCPUS)) )
             break;
 
-        ret = xsm_max_vcpus(d);
-        if ( ret )
-            break;
-
         /* Until Xenoprof can dynamically grow its vcpu-s array... */
         if ( d->xenoprof )
         {
@@ -538,7 +518,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_destroydomain:
     {
-        ret = xsm_destroydomain(d) ? : domain_kill(d);
+        ret = domain_kill(d);
     }
     break;
 
@@ -547,10 +527,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     {
         struct vcpu *v;
 
-        ret = xsm_vcpuaffinity(op->cmd, d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( op->u.vcpuaffinity.vcpu >= d->max_vcpus )
             break;
@@ -581,10 +557,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_scheduler_op:
     {
-        ret = xsm_scheduler(d);
-        if ( ret )
-            break;
-
         ret = sched_adjust(d, &op->u.scheduler_op);
         if ( copy_to_guest(u_domctl, op, 1) )
             ret = -EFAULT;
@@ -629,10 +601,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         vcpu_guest_context_u c = { .nat = NULL };
         struct vcpu         *v;
 
-        ret = xsm_getvcpucontext(d);
-        if ( ret )
-            goto getvcpucontext_out;
-
         ret = -EINVAL;
         if ( op->u.vcpucontext.vcpu >= d->max_vcpus )
             goto getvcpucontext_out;
@@ -685,10 +653,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         struct vcpu   *v;
         struct vcpu_runstate_info runstate;
 
-        ret = xsm_getvcpuinfo(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( op->u.getvcpuinfo.vcpu >= d->max_vcpus )
             break;
@@ -715,10 +679,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     {
         unsigned long new_max;
 
-        ret = xsm_setdomainmaxmem(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         new_max = op->u.max_mem.max_memkb >> (PAGE_SHIFT-10);
 
@@ -736,10 +696,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_setdomainhandle:
     {
-        ret = xsm_setdomainhandle(d);
-        if ( ret )
-            break;
-
         memcpy(d->handle, op->u.setdomainhandle.handle,
                sizeof(xen_domain_handle_t));
         ret = 0;
@@ -752,10 +708,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( d == current->domain ) /* no domain_pause() */
             break;
 
-        ret = xsm_setdebugging(d);
-        if ( ret )
-            break;
-
         domain_pause(d);
         d->debugger_attached = !!op->u.setdebugging.enable;
         domain_unpause(d); /* causes guest to latch new status */
@@ -800,10 +752,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_settimeoffset:
     {
-        ret = xsm_domain_settime(d);
-        if ( ret )
-            break;
-
         domain_set_time_offset(d, op->u.settimeoffset.time_offset_seconds);
         ret = 0;
     }
@@ -853,10 +801,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     case XEN_DOMCTL_set_virq_handler:
     {
         uint32_t virq = op->u.set_virq_handler.virq;
-
-        ret = xsm_set_virq_handler(d, virq);
-        if ( !ret )
-            ret = set_global_virq_handler(d, virq);
+        ret = set_global_virq_handler(d, virq);
     }
     break;
 
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 90682ae..9a5b34f 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -17,71 +17,16 @@ static XSM_INLINE void xsm_security_domaininfo(struct domain *d,
     return;
 }
 
-static XSM_INLINE int xsm_setvcpucontext(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_pausedomain(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_unpausedomain(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_resumedomain(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_domain_create(struct domain *d, u32 ssidref)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_max_vcpus(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_destroydomain(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_vcpuaffinity(int cmd, struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_scheduler(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_getvcpucontext(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getvcpuinfo(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_domain_settime(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
 {
     return 0;
@@ -113,11 +58,6 @@ static XSM_INLINE int xsm_sysctl(int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_set_virq_handler(struct domain *d, uint32_t virq)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_tbufcontrol(void)
 {
     return 0;
@@ -133,21 +73,6 @@ static XSM_INLINE int xsm_sched_id(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_setdomainmaxmem(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_setdomainhandle(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_setdebugging(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_perfcontrol(void)
 {
     return 0;
@@ -505,36 +430,6 @@ static XSM_INLINE int xsm_shadow_control(struct domain *d, uint32_t op)
     return 0;
 }
 
-static XSM_INLINE int xsm_getpageframeinfo(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getmemlist(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_hypercall_init(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_hvmcontext(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_address_size(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_machine_address_size(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
@@ -570,11 +465,6 @@ static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_event_setup(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_mem_event_control(struct domain *d, int mode, int op)
 {
     if ( !IS_PRIV(current->domain) )
@@ -589,11 +479,6 @@ static XSM_INLINE int xsm_mem_event_op(struct domain *d, int op)
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_sharing(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, cd) )
@@ -720,11 +605,6 @@ static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *
     return 0;
 }
 
-static XSM_INLINE int xsm_sendtrigger(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
@@ -735,21 +615,6 @@ static XSM_INLINE int xsm_unbind_pt_irq(struct domain *d, struct xen_domctl_bind
     return 0;
 }
 
-static XSM_INLINE int xsm_pin_mem_cacheattr(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index b2f33d6..903c7cb 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -41,29 +41,14 @@ extern xsm_initcall_t __xsm_initcall_start[], __xsm_initcall_end[];
 struct xsm_operations {
     void (*security_domaininfo) (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info);
-    int (*setvcpucontext) (struct domain *d);
-    int (*pausedomain) (struct domain *d);
-    int (*unpausedomain) (struct domain *d);
-    int (*resumedomain) (struct domain *d);
     int (*domain_create) (struct domain *d, u32 ssidref);
-    int (*max_vcpus) (struct domain *d);
-    int (*destroydomain) (struct domain *d);
-    int (*vcpuaffinity) (int cmd, struct domain *d);
-    int (*scheduler) (struct domain *d);
     int (*getdomaininfo) (struct domain *d);
-    int (*getvcpucontext) (struct domain *d);
-    int (*getvcpuinfo) (struct domain *d);
-    int (*domain_settime) (struct domain *d);
     int (*set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
     int (*sysctl) (int cmd);
-    int (*set_virq_handler) (struct domain *d, uint32_t virq);
     int (*tbufcontrol) (void);
     int (*readconsole) (uint32_t clear);
     int (*sched_id) (void);
-    int (*setdomainmaxmem) (struct domain *d);
-    int (*setdomainhandle) (struct domain *d);
-    int (*setdebugging) (struct domain *d);
     int (*perfcontrol) (void);
     int (*debug_keys) (void);
     int (*getcpuinfo) (void);
@@ -141,21 +126,13 @@ struct xsm_operations {
 
 #ifdef CONFIG_X86
     int (*shadow_control) (struct domain *d, uint32_t op);
-    int (*getpageframeinfo) (struct domain *d);
-    int (*getmemlist) (struct domain *d);
-    int (*hypercall_init) (struct domain *d);
-    int (*hvmcontext) (struct domain *d, uint32_t op);
-    int (*address_size) (struct domain *d, uint32_t op);
-    int (*machine_address_size) (struct domain *d, uint32_t op);
     int (*hvm_param) (struct domain *d, unsigned long op);
     int (*hvm_set_pci_intx_level) (struct domain *d);
     int (*hvm_set_isa_irq_level) (struct domain *d);
     int (*hvm_set_pci_link_route) (struct domain *d);
     int (*hvm_inject_msi) (struct domain *d);
-    int (*mem_event_setup) (struct domain *d);
     int (*mem_event_control) (struct domain *d, int mode, int op);
     int (*mem_event_op) (struct domain *d, int op);
-    int (*mem_sharing) (struct domain *d);
     int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
     int (*apic) (struct domain *d, int cmd);
     int (*xen_settime) (void);
@@ -180,12 +157,8 @@ struct xsm_operations {
     int (*mmuext_op) (struct domain *d, struct domain *f);
     int (*update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
-    int (*sendtrigger) (struct domain *d);
     int (*bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
     int (*unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*pin_mem_cacheattr) (struct domain *d);
-    int (*ext_vcpucontext) (struct domain *d, uint32_t cmd);
-    int (*vcpuextstate) (struct domain *d, uint32_t cmd);
     int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
     int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
 #endif
@@ -203,71 +176,16 @@ static inline void xsm_security_domaininfo (struct domain *d,
     xsm_ops->security_domaininfo(d, info);
 }
 
-static inline int xsm_setvcpucontext(struct domain *d)
-{
-    return xsm_ops->setvcpucontext(d);
-}
-
-static inline int xsm_pausedomain (struct domain *d)
-{
-    return xsm_ops->pausedomain(d);
-}
-
-static inline int xsm_unpausedomain (struct domain *d)
-{
-    return xsm_ops->unpausedomain(d);
-}
-
-static inline int xsm_resumedomain (struct domain *d)
-{
-    return xsm_ops->resumedomain(d);
-}
-
 static inline int xsm_domain_create (struct domain *d, u32 ssidref)
 {
     return xsm_ops->domain_create(d, ssidref);
 }
 
-static inline int xsm_max_vcpus(struct domain *d)
-{
-    return xsm_ops->max_vcpus(d);
-}
-
-static inline int xsm_destroydomain (struct domain *d)
-{
-    return xsm_ops->destroydomain(d);
-}
-
-static inline int xsm_vcpuaffinity (int cmd, struct domain *d)
-{
-    return xsm_ops->vcpuaffinity(cmd, d);
-}
-
-static inline int xsm_scheduler (struct domain *d)
-{
-    return xsm_ops->scheduler(d);
-}
-
 static inline int xsm_getdomaininfo (struct domain *d)
 {
     return xsm_ops->getdomaininfo(d);
 }
 
-static inline int xsm_getvcpucontext (struct domain *d)
-{
-    return xsm_ops->getvcpucontext(d);
-}
-
-static inline int xsm_getvcpuinfo (struct domain *d)
-{
-    return xsm_ops->getvcpuinfo(d);
-}
-
-static inline int xsm_domain_settime (struct domain *d)
-{
-    return xsm_ops->domain_settime(d);
-}
-
 static inline int xsm_set_target (struct domain *d, struct domain *e)
 {
     return xsm_ops->set_target(d, e);
@@ -283,11 +201,6 @@ static inline int xsm_sysctl (int cmd)
     return xsm_ops->sysctl(cmd);
 }
 
-static inline int xsm_set_virq_handler (struct domain *d, uint32_t virq)
-{
-    return xsm_ops->set_virq_handler(d, virq);
-}
-
 static inline int xsm_tbufcontrol (void)
 {
     return xsm_ops->tbufcontrol();
@@ -303,21 +216,6 @@ static inline int xsm_sched_id (void)
     return xsm_ops->sched_id();
 }
 
-static inline int xsm_setdomainmaxmem (struct domain *d)
-{
-    return xsm_ops->setdomainmaxmem(d);
-}
-
-static inline int xsm_setdomainhandle (struct domain *d)
-{
-    return xsm_ops->setdomainhandle(d);
-}
-
-static inline int xsm_setdebugging (struct domain *d)
-{
-    return xsm_ops->setdebugging(d);
-}
-
 static inline int xsm_perfcontrol (void)
 {
     return xsm_ops->perfcontrol();
@@ -635,36 +533,6 @@ static inline int xsm_shadow_control (struct domain *d, uint32_t op)
     return xsm_ops->shadow_control(d, op);
 }
 
-static inline int xsm_getpageframeinfo (struct domain *d)
-{
-    return xsm_ops->getpageframeinfo(d);
-}
-
-static inline int xsm_getmemlist (struct domain *d)
-{
-    return xsm_ops->getmemlist(d);
-}
-
-static inline int xsm_hypercall_init (struct domain *d)
-{
-    return xsm_ops->hypercall_init(d);
-}
-
-static inline int xsm_hvmcontext (struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->hvmcontext(d, cmd);
-}
-
-static inline int xsm_address_size (struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->address_size(d, cmd);
-}
-
-static inline int xsm_machine_address_size (struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->machine_address_size(d, cmd);
-}
-
 static inline int xsm_hvm_param (struct domain *d, unsigned long op)
 {
     return xsm_ops->hvm_param(d, op);
@@ -690,11 +558,6 @@ static inline int xsm_hvm_inject_msi (struct domain *d)
     return xsm_ops->hvm_inject_msi(d);
 }
 
-static inline int xsm_mem_event_setup (struct domain *d)
-{
-    return xsm_ops->mem_event_setup(d);
-}
-
 static inline int xsm_mem_event_control (struct domain *d, int mode, int op)
 {
     return xsm_ops->mem_event_control(d, mode, op);
@@ -705,11 +568,6 @@ static inline int xsm_mem_event_op (struct domain *d, int op)
     return xsm_ops->mem_event_op(d, op);
 }
 
-static inline int xsm_mem_sharing (struct domain *d)
-{
-    return xsm_ops->mem_sharing(d);
-}
-
 static inline int xsm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
 {
     return xsm_ops->mem_sharing_op(d, cd, op);
@@ -807,11 +665,6 @@ static inline int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
     return xsm_ops->add_to_physmap(d1, d2);
 }
 
-static inline int xsm_sendtrigger(struct domain *d)
-{
-    return xsm_ops->sendtrigger(d);
-}
-
 static inline int xsm_bind_pt_irq(struct domain *d, 
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
@@ -824,20 +677,6 @@ static inline int xsm_unbind_pt_irq(struct domain *d,
     return xsm_ops->unbind_pt_irq(d, bind);
 }
 
-static inline int xsm_pin_mem_cacheattr(struct domain *d)
-{
-    return xsm_ops->pin_mem_cacheattr(d);
-}
-
-static inline int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->ext_vcpucontext(d, cmd);
-}
-static inline int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->vcpuextstate(d, cmd);
-}
-
 static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return xsm_ops->ioport_permission(d, s, e, allow);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 3e6e5df..9bb86ef 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -30,29 +30,14 @@ struct xsm_operations dummy_xsm_ops;
 void xsm_fixup_ops (struct xsm_operations *ops)
 {
     set_to_dummy_if_null(ops, security_domaininfo);
-    set_to_dummy_if_null(ops, setvcpucontext);
-    set_to_dummy_if_null(ops, pausedomain);
-    set_to_dummy_if_null(ops, unpausedomain);
-    set_to_dummy_if_null(ops, resumedomain);
     set_to_dummy_if_null(ops, domain_create);
-    set_to_dummy_if_null(ops, max_vcpus);
-    set_to_dummy_if_null(ops, destroydomain);
-    set_to_dummy_if_null(ops, vcpuaffinity);
-    set_to_dummy_if_null(ops, scheduler);
     set_to_dummy_if_null(ops, getdomaininfo);
-    set_to_dummy_if_null(ops, getvcpucontext);
-    set_to_dummy_if_null(ops, getvcpuinfo);
-    set_to_dummy_if_null(ops, domain_settime);
     set_to_dummy_if_null(ops, set_target);
     set_to_dummy_if_null(ops, domctl);
     set_to_dummy_if_null(ops, sysctl);
-    set_to_dummy_if_null(ops, set_virq_handler);
     set_to_dummy_if_null(ops, tbufcontrol);
     set_to_dummy_if_null(ops, readconsole);
     set_to_dummy_if_null(ops, sched_id);
-    set_to_dummy_if_null(ops, setdomainmaxmem);
-    set_to_dummy_if_null(ops, setdomainhandle);
-    set_to_dummy_if_null(ops, setdebugging);
     set_to_dummy_if_null(ops, perfcontrol);
     set_to_dummy_if_null(ops, debug_keys);
     set_to_dummy_if_null(ops, getcpuinfo);
@@ -128,21 +113,13 @@ void xsm_fixup_ops (struct xsm_operations *ops)
 
 #ifdef CONFIG_X86
     set_to_dummy_if_null(ops, shadow_control);
-    set_to_dummy_if_null(ops, getpageframeinfo);
-    set_to_dummy_if_null(ops, getmemlist);
-    set_to_dummy_if_null(ops, hypercall_init);
-    set_to_dummy_if_null(ops, hvmcontext);
-    set_to_dummy_if_null(ops, address_size);
-    set_to_dummy_if_null(ops, machine_address_size);
     set_to_dummy_if_null(ops, hvm_param);
     set_to_dummy_if_null(ops, hvm_set_pci_intx_level);
     set_to_dummy_if_null(ops, hvm_set_isa_irq_level);
     set_to_dummy_if_null(ops, hvm_set_pci_link_route);
     set_to_dummy_if_null(ops, hvm_inject_msi);
-    set_to_dummy_if_null(ops, mem_event_setup);
     set_to_dummy_if_null(ops, mem_event_control);
     set_to_dummy_if_null(ops, mem_event_op);
-    set_to_dummy_if_null(ops, mem_sharing);
     set_to_dummy_if_null(ops, mem_sharing_op);
     set_to_dummy_if_null(ops, apic);
     set_to_dummy_if_null(ops, xen_settime);
@@ -163,12 +140,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, update_va_mapping);
     set_to_dummy_if_null(ops, add_to_physmap);
     set_to_dummy_if_null(ops, remove_from_physmap);
-    set_to_dummy_if_null(ops, sendtrigger);
     set_to_dummy_if_null(ops, bind_pt_irq);
     set_to_dummy_if_null(ops, unbind_pt_irq);
-    set_to_dummy_if_null(ops, pin_mem_cacheattr);
-    set_to_dummy_if_null(ops, ext_vcpucontext);
-    set_to_dummy_if_null(ops, vcpuextstate);
     set_to_dummy_if_null(ops, ioport_permission);
     set_to_dummy_if_null(ops, ioport_mapping);
 #endif
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index e815ea5..f0216e0 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -484,26 +484,6 @@ static void flask_security_domaininfo(struct domain *d,
     info->ssidref = domain_sid(d);
 }
 
-static int flask_setvcpucontext(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT);
-}
-
-static int flask_pausedomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
-}
-
-static int flask_unpausedomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
-}
-
-static int flask_resumedomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__RESUME);
-}
-
 static int flask_domain_create(struct domain *d, u32 ssidref)
 {
     int rc;
@@ -532,66 +512,11 @@ static int flask_domain_create(struct domain *d, u32 ssidref)
     return rc;
 }
 
-static int flask_max_vcpus(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS);
-}
-
-static int flask_destroydomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__DESTROY);
-}
-
-static int flask_vcpuaffinity(int cmd, struct domain *d)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_setvcpuaffinity:
-        perm = DOMAIN__SETVCPUAFFINITY;
-        break;
-    case XEN_DOMCTL_getvcpuaffinity:
-        perm = DOMAIN__GETVCPUAFFINITY;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm );
-}
-
-static int flask_scheduler(struct domain *d)
-{
-    int rc = 0;
-
-    rc = domain_has_xen(current->domain, XEN__SCHEDULER);
-    if ( rc )
-        return rc;
-
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SCHEDULER);
-}
-
 static int flask_getdomaininfo(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO);
 }
 
-static int flask_getvcpucontext(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT);
-}
-
-static int flask_getvcpuinfo(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO);
-}
-
-static int flask_domain_settime(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
-}
-
 static int flask_set_target(struct domain *d, struct domain *t)
 {
     int rc;
@@ -622,62 +547,121 @@ static int flask_domctl(struct domain *d, int cmd)
     {
     /* These have individual XSM hooks (common/domctl.c) */
     case XEN_DOMCTL_createdomain:
+    case XEN_DOMCTL_getdomaininfo:
+    case XEN_DOMCTL_irq_permission:
+    case XEN_DOMCTL_iomem_permission:
+    case XEN_DOMCTL_set_target:
+#ifdef CONFIG_X86
+    /* These have individual XSM hooks (arch/x86/domctl.c) */
+    case XEN_DOMCTL_shadow_op:
+    case XEN_DOMCTL_ioport_permission:
+    case XEN_DOMCTL_bind_pt_irq:
+    case XEN_DOMCTL_unbind_pt_irq:
+    case XEN_DOMCTL_memory_mapping:
+    case XEN_DOMCTL_ioport_mapping:
+    case XEN_DOMCTL_mem_event_op:
+    /* These have individual XSM hooks (drivers/passthrough/iommu.c) */
+    case XEN_DOMCTL_get_device_group:
+    case XEN_DOMCTL_test_assign_device:
+    case XEN_DOMCTL_assign_device:
+    case XEN_DOMCTL_deassign_device:
+#endif
+        return 0;
+
     case XEN_DOMCTL_destroydomain:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__DESTROY);
+
     case XEN_DOMCTL_pausedomain:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
+
     case XEN_DOMCTL_unpausedomain:
-    case XEN_DOMCTL_getdomaininfo:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
+
     case XEN_DOMCTL_setvcpuaffinity:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUAFFINITY);
+
+    case XEN_DOMCTL_getvcpuaffinity:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUAFFINITY);
+
+    case XEN_DOMCTL_resumedomain:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__RESUME);
+
+    case XEN_DOMCTL_scheduler_op:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SCHEDULER);
+
+    case XEN_DOMCTL_max_vcpus:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS);
+
     case XEN_DOMCTL_max_mem:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM);
+
+    case XEN_DOMCTL_setdomainhandle:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE);
+
     case XEN_DOMCTL_setvcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT);
+
     case XEN_DOMCTL_getvcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT);
+
     case XEN_DOMCTL_getvcpuinfo:
-    case XEN_DOMCTL_max_vcpus:
-    case XEN_DOMCTL_scheduler_op:
-    case XEN_DOMCTL_setdomainhandle:
-    case XEN_DOMCTL_setdebugging:
-    case XEN_DOMCTL_irq_permission:
-    case XEN_DOMCTL_iomem_permission:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO);
+
     case XEN_DOMCTL_settimeoffset:
-    case XEN_DOMCTL_getvcpuaffinity:
-    case XEN_DOMCTL_resumedomain:
-    case XEN_DOMCTL_set_target:
-    case XEN_DOMCTL_set_virq_handler:
-#ifdef CONFIG_X86
-    /* These have individual XSM hooks (arch/x86/domctl.c) */
-    case XEN_DOMCTL_shadow_op:
-    case XEN_DOMCTL_ioport_permission:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
+
+    case XEN_DOMCTL_setdebugging:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
+
     case XEN_DOMCTL_getpageframeinfo:
     case XEN_DOMCTL_getpageframeinfo2:
     case XEN_DOMCTL_getpageframeinfo3:
+        return current_has_perm(d, SECCLASS_MMU, MMU__PAGEINFO);
+
     case XEN_DOMCTL_getmemlist:
+        return current_has_perm(d, SECCLASS_MMU, MMU__PAGELIST);
+
     case XEN_DOMCTL_hypercall_init:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__HYPERCALL);
+
     case XEN_DOMCTL_sethvmcontext:
+        return current_has_perm(d, SECCLASS_HVM, HVM__SETHVMC);
+
     case XEN_DOMCTL_gethvmcontext:
     case XEN_DOMCTL_gethvmcontext_partial:
+        return current_has_perm(d, SECCLASS_HVM, HVM__GETHVMC);
+
     case XEN_DOMCTL_set_address_size:
-    case XEN_DOMCTL_get_address_size:
     case XEN_DOMCTL_set_machine_address_size:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETADDRSIZE);
+
+    case XEN_DOMCTL_get_address_size:
     case XEN_DOMCTL_get_machine_address_size:
-    case XEN_DOMCTL_sendtrigger:
-    case XEN_DOMCTL_bind_pt_irq:
-    case XEN_DOMCTL_unbind_pt_irq:
-    case XEN_DOMCTL_memory_mapping:
-    case XEN_DOMCTL_ioport_mapping:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETADDRSIZE);
+
+    case XEN_DOMCTL_mem_sharing_op:
+        return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
+
     case XEN_DOMCTL_pin_mem_cacheattr:
+        return current_has_perm(d, SECCLASS_HVM, HVM__CACHEATTR);
+
     case XEN_DOMCTL_set_ext_vcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETEXTVCPUCONTEXT);
+
     case XEN_DOMCTL_get_ext_vcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETEXTVCPUCONTEXT);
+
     case XEN_DOMCTL_setvcpuextstate:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUEXTSTATE);
+
     case XEN_DOMCTL_getvcpuextstate:
-    case XEN_DOMCTL_mem_event_op:
-    case XEN_DOMCTL_mem_sharing_op:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUEXTSTATE);
+
+    case XEN_DOMCTL_sendtrigger:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
+
     case XEN_DOMCTL_set_access_required:
-    /* These have individual XSM hooks (drivers/passthrough/iommu.c) */
-    case XEN_DOMCTL_get_device_group:
-    case XEN_DOMCTL_test_assign_device:
-    case XEN_DOMCTL_assign_device:
-    case XEN_DOMCTL_deassign_device:
-#endif
-        return 0;
+        return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 
     case XEN_DOMCTL_debug_op:
     case XEN_DOMCTL_gdbsx_guestmemio:
@@ -691,6 +675,9 @@ static int flask_domctl(struct domain *d, int cmd)
     case XEN_DOMCTL_suppress_spurious_page_faults:
         return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO);
 
+    case XEN_DOMCTL_set_virq_handler:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
+
     case XEN_DOMCTL_set_cpuid:
         return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID);
 
@@ -741,11 +728,6 @@ static int flask_sysctl(int cmd)
     }
 }
 
-static int flask_set_virq_handler(struct domain *d, uint32_t virq)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
-}
-
 static int flask_tbufcontrol(void)
 {
     return domain_has_xen(current->domain, XEN__TBUFCONTROL);
@@ -766,21 +748,6 @@ static int flask_sched_id(void)
     return domain_has_xen(current->domain, XEN__SCHEDULER);
 }
 
-static int flask_setdomainmaxmem(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM);
-}
-
-static int flask_setdomainhandle(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE);
-}
-
-static int flask_setdebugging(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
-}
-
 static int flask_debug_keys(void)
 {
     return domain_has_xen(current->domain, XEN__DEBUG);
@@ -1174,82 +1141,6 @@ static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end,
     return flask_ioport_permission(d, start, end, access);
 }
 
-static int flask_getpageframeinfo(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_MMU, MMU__PAGEINFO);
-}
-
-static int flask_getmemlist(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_MMU, MMU__PAGELIST);
-}
-
-static int flask_hypercall_init(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__HYPERCALL);
-}
-
-static int flask_hvmcontext(struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_sethvmcontext:
-        perm = HVM__SETHVMC;
-        break;
-    case XEN_DOMCTL_gethvmcontext:
-    case XEN_DOMCTL_gethvmcontext_partial:
-        perm = HVM__GETHVMC;
-        break;
-    case HVMOP_track_dirty_vram:
-        perm = HVM__TRACKDIRTYVRAM;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_HVM, perm);
-}
-
-static int flask_address_size(struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_set_address_size:
-        perm = DOMAIN__SETADDRSIZE;
-        break;
-    case XEN_DOMCTL_get_address_size:
-        perm = DOMAIN__GETADDRSIZE;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm);
-}
-
-static int flask_machine_address_size(struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_set_machine_address_size:
-        perm = DOMAIN__SETADDRSIZE;
-        break;
-    case XEN_DOMCTL_get_machine_address_size:
-        perm = DOMAIN__GETADDRSIZE;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
-}
-
 static int flask_hvm_param(struct domain *d, unsigned long op)
 {
     u32 perm;
@@ -1292,11 +1183,6 @@ static int flask_hvm_inject_msi(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
-static int flask_mem_event_setup(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
-}
-
 static int flask_mem_event_control(struct domain *d, int mode, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
@@ -1307,11 +1193,6 @@ static int flask_mem_event_op(struct domain *d, int op)
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
 
-static int flask_mem_sharing(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
-}
-
 static int flask_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     int rc = current_has_perm(cd, SECCLASS_HVM, HVM__MEM_SHARING);
@@ -1499,11 +1380,6 @@ static int flask_remove_from_physmap(struct domain *d1, struct domain *d2)
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP);
 }
 
-static int flask_sendtrigger(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
-}
-
 static int flask_get_device_group(uint32_t machine_bdf)
 {
     u32 rsid;
@@ -1597,78 +1473,20 @@ static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq
 {
     return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
-
-static int flask_pin_mem_cacheattr (struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__CACHEATTR);
-}
-
-static int flask_ext_vcpucontext (struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_set_ext_vcpucontext:
-        perm = DOMAIN__SETEXTVCPUCONTEXT;
-        break;
-    case XEN_DOMCTL_get_ext_vcpucontext:
-        perm = DOMAIN__GETEXTVCPUCONTEXT;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm);
-}
-
-static int flask_vcpuextstate (struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-        case XEN_DOMCTL_setvcpuextstate:
-            perm = DOMAIN__SETVCPUEXTSTATE;
-        break;
-        case XEN_DOMCTL_getvcpuextstate:
-            perm = DOMAIN__GETVCPUEXTSTATE;
-        break;
-        default:
-            return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm);
-}
 #endif
 
 long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
 
 static struct xsm_operations flask_ops = {
     .security_domaininfo = flask_security_domaininfo,
-    .setvcpucontext = flask_setvcpucontext,
-    .pausedomain = flask_pausedomain,
-    .unpausedomain = flask_unpausedomain,    
-    .resumedomain = flask_resumedomain,    
     .domain_create = flask_domain_create,
-    .max_vcpus = flask_max_vcpus,
-    .destroydomain = flask_destroydomain,
-    .vcpuaffinity = flask_vcpuaffinity,
-    .scheduler = flask_scheduler,
     .getdomaininfo = flask_getdomaininfo,
-    .getvcpucontext = flask_getvcpucontext,
-    .getvcpuinfo = flask_getvcpuinfo,
-    .domain_settime = flask_domain_settime,
     .set_target = flask_set_target,
     .domctl = flask_domctl,
     .sysctl = flask_sysctl,
-    .set_virq_handler = flask_set_virq_handler,
     .tbufcontrol = flask_tbufcontrol,
     .readconsole = flask_readconsole,
     .sched_id = flask_sched_id,
-    .setdomainmaxmem = flask_setdomainmaxmem,
-    .setdomainhandle = flask_setdomainhandle,
-    .setdebugging = flask_setdebugging,
     .perfcontrol = flask_perfcontrol,
     .debug_keys = flask_debug_keys,
     .getcpuinfo = flask_getcpuinfo,
@@ -1740,21 +1558,13 @@ static struct xsm_operations flask_ops = {
 
 #ifdef CONFIG_X86
     .shadow_control = flask_shadow_control,
-    .getpageframeinfo = flask_getpageframeinfo,
-    .getmemlist = flask_getmemlist,
-    .hypercall_init = flask_hypercall_init,
-    .hvmcontext = flask_hvmcontext,
-    .address_size = flask_address_size,
-    .machine_address_size = flask_machine_address_size,
     .hvm_param = flask_hvm_param,
     .hvm_set_pci_intx_level = flask_hvm_set_pci_intx_level,
     .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
     .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
     .hvm_inject_msi = flask_hvm_inject_msi,
-    .mem_event_setup = flask_mem_event_setup,
     .mem_event_control = flask_mem_event_control,
     .mem_event_op = flask_mem_event_op,
-    .mem_sharing = flask_mem_sharing,
     .mem_sharing_op = flask_mem_sharing_op,
     .apic = flask_apic,
     .xen_settime = flask_xen_settime,
@@ -1775,16 +1585,12 @@ static struct xsm_operations flask_ops = {
     .update_va_mapping = flask_update_va_mapping,
     .add_to_physmap = flask_add_to_physmap,
     .remove_from_physmap = flask_remove_from_physmap,
-    .sendtrigger = flask_sendtrigger,
     .get_device_group = flask_get_device_group,
     .test_assign_device = flask_test_assign_device,
     .assign_device = flask_assign_device,
     .deassign_device = flask_deassign_device,
     .bind_pt_irq = flask_bind_pt_irq,
     .unbind_pt_irq = flask_unbind_pt_irq,
-    .pin_mem_cacheattr = flask_pin_mem_cacheattr,
-    .ext_vcpucontext = flask_ext_vcpucontext,
-    .vcpuextstate = flask_vcpuextstate,
     .ioport_permission = flask_ioport_permission,
     .ioport_mapping = flask_ioport_mapping,
 #endif
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSep-0002Od-1J; Fri, 30 Nov 2012 15:37:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSem-0002MQ-Ph
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:36 +0000
Received: from [85.158.139.211:30451] by server-6.bemta-5.messagelabs.com id
	4B/44-19321-0C2D8B05; Fri, 30 Nov 2012 15:37:36 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354289854!18577851!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11555 invoked from network); 30 Nov 2012 15:37:35 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-6.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:35 -0000
X-TM-IMSS-Message-ID: <3392214400027abc@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3392214400027abc ;
	Fri, 30 Nov 2012 10:36:27 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSdA017785; 
	Fri, 30 Nov 2012 10:37:33 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:04 -0500
Message-Id: <1354289830-24642-18-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: [Xen-devel] [PATCH 17/23] tmem: add XSM hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This adds a pair of XSM hooks for tmem operations: xsm_tmem_op which
controls any use of tmem, and xsm_tmem_control which allows use of the
TMEM_CONTROL operations. By default, all domains can use tmem while only
IS_PRIV domains can use control operations.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
---
 tools/flask/policy/policy/flask/access_vectors |  2 ++
 xen/common/tmem.c                              |  3 +++
 xen/include/xen/tmem_xen.h                     |  8 +++++++-
 xen/include/xsm/dummy.h                        | 12 ++++++++++++
 xen/include/xsm/xsm.h                          | 12 ++++++++++++
 xen/xsm/dummy.c                                |  2 ++
 xen/xsm/flask/hooks.c                          | 12 ++++++++++++
 xen/xsm/flask/include/av_perm_to_string.h      |  2 ++
 xen/xsm/flask/include/av_permissions.h         |  2 ++
 9 files changed, 54 insertions(+), 1 deletion(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index caf65d2..7a7e253 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -35,6 +35,8 @@ class xen
 	lockprof
 	cpupool_op
 	sched_op
+	tmem_op
+	tmem_control
 }
 
 class domain
diff --git a/xen/common/tmem.c b/xen/common/tmem.c
index 44e2772..ca70e86 100644
--- a/xen/common/tmem.c
+++ b/xen/common/tmem.c
@@ -2644,6 +2644,9 @@ EXPORT long do_tmem_op(tmem_cli_op_t uops)
     if ( !tmem_initialized )
         return -ENODEV;
 
+    if ( !tmh_current_permitted() )
+        return -EPERM;
+
     total_tmem_ops++;
 
     if ( tmh_lock_all )
diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h
index 36a8d9f..8dec5aa 100644
--- a/xen/include/xen/tmem_xen.h
+++ b/xen/include/xen/tmem_xen.h
@@ -16,6 +16,7 @@
 #include <xen/guest_access.h> /* copy_from_guest */
 #include <xen/hash.h> /* hash_long */
 #include <xen/domain_page.h> /* __map_domain_page */
+#include <xsm/xsm.h> /* xsm_tmem_control */
 #include <public/tmem.h>
 #ifdef CONFIG_COMPAT
 #include <compat/tmem.h>
@@ -326,9 +327,14 @@ static inline bool_t tmh_set_client_from_id(
     return rc;
 }
 
+static inline bool_t tmh_current_permitted(void)
+{
+    return !xsm_tmem_op();
+}
+
 static inline bool_t tmh_current_is_privileged(void)
 {
-    return IS_PRIV(current->domain);
+    return !xsm_tmem_control();
 }
 
 static inline uint8_t tmh_get_first_byte(pfp_t *pfp)
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 9894d8d..90682ae 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -443,6 +443,18 @@ static XSM_INLINE int xsm_sched_op(void)
     return 0;
 }
 
+static XSM_INLINE int xsm_tmem_op(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_tmem_control(void)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
     return -ENOSYS;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index a8c1d87..b2f33d6 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -134,6 +134,8 @@ struct xsm_operations {
     int (*lockprof)(void);
     int (*cpupool_op)(void);
     int (*sched_op)(void);
+    int (*tmem_op)(void);
+    int (*tmem_control)(void);
 
     long (*do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
 
@@ -612,6 +614,16 @@ static inline int xsm_sched_op(void)
     return xsm_ops->sched_op();
 }
 
+static inline int xsm_tmem_op(void)
+{
+    return xsm_ops->tmem_op();
+}
+
+static inline int xsm_tmem_control(void)
+{
+    return xsm_ops->tmem_control();
+}
+
 static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
     return xsm_ops->do_xsm_op(op);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 71299d5..3e6e5df 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -121,6 +121,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, lockprof);
     set_to_dummy_if_null(ops, cpupool_op);
     set_to_dummy_if_null(ops, sched_op);
+    set_to_dummy_if_null(ops, tmem_op);
+    set_to_dummy_if_null(ops, tmem_control);
 
     set_to_dummy_if_null(ops, do_xsm_op);
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 167f8e6..e815ea5 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1079,6 +1079,16 @@ static inline int flask_sched_op(void)
     return domain_has_xen(current->domain, XEN__SCHED_OP);
 }
 
+static inline int flask_tmem_op(void)
+{
+    return domain_has_xen(current->domain, XEN__TMEM_OP);
+}
+
+static inline int flask_tmem_control(void)
+{
+    return domain_has_xen(current->domain, XEN__TMEM_CONTROL);
+}
+
 static int flask_perfcontrol(void)
 {
     return domain_has_xen(current->domain, XEN__PERFCONTROL);
@@ -1723,6 +1733,8 @@ static struct xsm_operations flask_ops = {
     .lockprof = flask_lockprof,
     .cpupool_op = flask_cpupool_op,
     .sched_op = flask_sched_op,
+    .tmem_op = flask_tmem_op,
+    .tmem_control = flask_tmem_control,
 
     .do_xsm_op = do_flask_op,
 
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 79d5939..c3f2370 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -29,6 +29,8 @@
    S_(SECCLASS_XEN, XEN__LOCKPROF, "lockprof")
    S_(SECCLASS_XEN, XEN__CPUPOOL_OP, "cpupool_op")
    S_(SECCLASS_XEN, XEN__SCHED_OP, "sched_op")
+   S_(SECCLASS_XEN, XEN__TMEM_OP, "tmem_op")
+   S_(SECCLASS_XEN, XEN__TMEM_CONTROL, "tmem_control")
    S_(SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT, "setvcpucontext")
    S_(SECCLASS_DOMAIN, DOMAIN__PAUSE, "pause")
    S_(SECCLASS_DOMAIN, DOMAIN__UNPAUSE, "unpause")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index d982328..65302e8 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -29,6 +29,8 @@
 #define XEN__LOCKPROF                             0x08000000UL
 #define XEN__CPUPOOL_OP                           0x10000000UL
 #define XEN__SCHED_OP                             0x20000000UL
+#define XEN__TMEM_OP                              0x40000000UL
+#define XEN__TMEM_CONTROL                         0x80000000UL
 
 #define DOMAIN__SETVCPUCONTEXT                    0x00000001UL
 #define DOMAIN__PAUSE                             0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSeo-0002OK-JU; Fri, 30 Nov 2012 15:37:38 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSem-0002Mn-Ma
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:36 +0000
Received: from [193.109.254.147:14299] by server-13.bemta-14.messagelabs.com
	id 66/A7-11239-FB2D8B05; Fri, 30 Nov 2012 15:37:35 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-9.tower-27.messagelabs.com!1354289851!8908059!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5340 invoked from network); 30 Nov 2012 15:37:31 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-9.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:31 -0000
X-TM-IMSS-Message-ID: <d0a0da73000589b4@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0da73000589b4 ;
	Fri, 30 Nov 2012 10:37:34 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbScr017785
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 10:37:28 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:47 -0500
Message-Id: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
Subject: [Xen-devel] [PATCH v6] Merge IS_PRIV checks into XSM hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Changes from v5:
 * Add a few comments/docs
 * Remove CPP hackery so ctags can find dummy XSM hook implementations
 * Clean up XSM hooks that are redundant after the introduction of the
   generic domctl, sysctl, and platform_hypercall sub-operation hooks.
 * Add a parameter of type enum xsm_default to XSM hook invocations to
   document the default action of an XSM hook at the call site.

Changes from v4:
 * Removed patches that have been applied
 * Rename __do_xsm_op to do_xsm_op
 * Rebased on current xen-unstable
 * Policy headers moved under hypervisor

Changes from v3:
 * Moved x86-specific sysctls inside #ifdef CONFIG_X86
 * Removed pt_domain parameter from mmu_update hook when unused
 * Renamed xsm___do_xsm_op to xsm_do_xsm_op
 * Added struct domain* argument to arch_do_domctl
 * Cleaned up mem_event code duplication

Changes from v2:
 * Added overall hooks for domctl, sysctl, and platform_hypercall so
   that new sub-operations are protected by IS_PRIV checks
 * Reorganized the IS_PRIV additions to dummy.h so they are added in the
   same patch that removes the IS_PRIV they are replacing
 * Reworked hooks in the MM hotpath to increase efficiency
 * Dropped some unneeded XSM hook additions due to do_domctl hook
 * Dropped the rcu_lock*target_domain_by_id function removal patch
 * Restore IS_PRIV check in PHYSDEVOP_alloc_irq_vector
 * Use the existing hook function structure for tmem


Toolstack updates:
    [PATCH 01/23] libxl: introduce XSM relabel on build

Miscellaneous updates to FLASK:
    [PATCH 02/23] flask/policy: Add domain relabel example
    [PATCH 04/23] xsm/flask: Add checks on the domain performing the
    [PATCH 13/23] xsm/flask: add distinct SIDs for self/target access
    [PATCH 19/23] flask: move policy headers into hypervisor
    [PATCH 23/23] xen/xsm: Add xsm_default parameter to XSM hooks

IS_PRIV removal:
    [PATCH 05/23] xsm: Use the dummy XSM module if XSM is disabled
    [PATCH 06/23] xen: use XSM instead of IS_PRIV where duplicated
    [PATCH 07/23] xen: avoid calling rcu_lock_*target_domain when an XSM
    [PATCH 08/23] arch/x86: convert platform_hypercall to use XSM
    [PATCH 10/23] xen: convert do_domctl to use XSM
    [PATCH 11/23] xen: convert do_sysctl to use XSM

Refactoring not directly related to IS_PRIV:
    [PATCH 09/23] xen: lock target domain in do_domctl common code
    [PATCH 18/23] xen/arch/*: add struct domain parameter to arch_do_domctl

New or updated XSM hooks:
    [PATCH 03/23] arch/x86: add distinct XSM hooks for map/unmap
    [PATCH 12/23] xsm/flask: add missing hooks
    [PATCH 14/23] arch/x86: Add missing mem_sharing XSM hooks
    [PATCH 15/23] arch/x86: use XSM hooks for get_pg_owner access checks
    [PATCH 16/23] xen: Add XSM hook for XENMEM_exchange
    [PATCH 17/23] tmem: add XSM hooks

Deletion of now-redundant XSM hooks:
    [PATCH 20/23] xen: domctl XSM hook removal
    [PATCH 21/23] xen: sysctl XSM hook removal
    [PATCH 22/23] xen: platform_hypercall XSM hook removal

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSet-0002Td-Rq; Fri, 30 Nov 2012 15:37:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSeq-0002PO-9a
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:40 +0000
Received: from [193.109.254.147:16862] by server-5.bemta-14.messagelabs.com id
	6F/FC-10257-3C2D8B05; Fri, 30 Nov 2012 15:37:39 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-27.messagelabs.com!1354289857!2114151!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 884 invoked from network); 30 Nov 2012 15:37:37 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-11.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:37 -0000
X-TM-IMSS-Message-ID: <d0a0f5df000589cd@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0f5df000589cd ;
	Fri, 30 Nov 2012 10:37:41 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSdE017785; 
	Fri, 30 Nov 2012 10:37:34 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:08 -0500
Message-Id: <1354289830-24642-22-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 21/23] xen: sysctl XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

A number of the sysctl XSM hooks have no parameters or only pass the
operation ID, making them redundant with the xsm_sysctl hook. Remove
these redundant hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/sysctl.c   |  13 -----
 xen/common/sysctl.c     |  44 -----------------
 xen/include/xsm/dummy.h |  45 -----------------
 xen/include/xsm/xsm.h   |  56 +---------------------
 xen/xsm/dummy.c         |   9 ----
 xen/xsm/flask/hooks.c   | 125 +++++++++++++++---------------------------------
 6 files changed, 39 insertions(+), 253 deletions(-)

diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index b84dd34..5b0c4b7 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -69,11 +69,6 @@ long arch_do_sysctl(
     {
         xen_sysctl_physinfo_t *pi = &sysctl->u.physinfo;
 
-        ret = xsm_physinfo();
-        if ( ret )
-            break;
-
-
         memset(pi, 0, sizeof(*pi));
         pi->threads_per_core =
             cpumask_weight(per_cpu(cpu_sibling_mask, 0));
@@ -103,10 +98,6 @@ long arch_do_sysctl(
         uint32_t i, max_cpu_index, last_online_cpu;
         xen_sysctl_topologyinfo_t *ti = &sysctl->u.topologyinfo;
 
-        ret = xsm_physinfo();
-        if ( ret )
-            break;
-
         last_online_cpu = cpumask_last(&cpu_online_map);
         max_cpu_index = min_t(uint32_t, ti->max_cpu_index, last_online_cpu);
         ti->max_cpu_index = last_online_cpu;
@@ -143,10 +134,6 @@ long arch_do_sysctl(
         uint32_t i, j, max_node_index, last_online_node;
         xen_sysctl_numainfo_t *ni = &sysctl->u.numainfo;
 
-        ret = xsm_physinfo();
-        if ( ret )
-            break;
-
         last_online_node = last_node(node_online_map);
         max_node_index = min_t(uint32_t, ni->max_node_index, last_online_node);
         ni->max_node_index = last_online_node;
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 599430e..cbefb0e 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -69,10 +69,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_tbuf_op:
     {
-        ret = xsm_tbufcontrol();
-        if ( ret )
-            break;
-
         ret = tb_control(&op->u.tbuf_op);
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -81,10 +77,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     
     case XEN_SYSCTL_sched_id:
     {
-        ret = xsm_sched_id();
-        if ( ret )
-            break;
-
         op->u.sched_id.sched_id = sched_id();
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -139,10 +131,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 #ifdef PERF_COUNTERS
     case XEN_SYSCTL_perfc_op:
     {
-        ret = xsm_perfcontrol();
-        if ( ret )
-            break;
-
         ret = perfc_control(&op->u.perfc_op);
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -153,10 +141,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 #ifdef LOCK_PROFILE
     case XEN_SYSCTL_lockprof_op:
     {
-        ret = xsm_lockprof();
-        if ( ret )
-            break;
-
         ret = spinlock_profile_control(&op->u.lockprof_op);
         if ( copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -168,10 +152,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         char c;
         uint32_t i;
 
-        ret = xsm_debug_keys();
-        if ( ret )
-            break;
-
         ret = -EFAULT;
         for ( i = 0; i < op->u.debug_keys.nr_keys; i++ )
         {
@@ -190,10 +170,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
         nr_cpus = min(op->u.getcpuinfo.max_cpus, nr_cpu_ids);
 
-        ret = xsm_getcpuinfo();
-        if ( ret )
-            break;
-
         for ( i = 0; i < nr_cpus; i++ )
         {
             cpuinfo.idletime = get_cpu_idle_time(i);
@@ -210,10 +186,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_availheap:
     { 
-        ret = xsm_availheap();
-        if ( ret )
-            break;
-
         op->u.availheap.avail_bytes = avail_domheap_pages_region(
             op->u.availheap.node,
             op->u.availheap.min_bitwidth,
@@ -227,10 +199,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 #ifdef HAS_ACPI
     case XEN_SYSCTL_get_pmstat:
     {
-        ret = xsm_get_pmstat();
-        if ( ret )
-            break;
-
         ret = do_get_pm_info(&op->u.get_pmstat);
         if ( ret )
             break;
@@ -245,10 +213,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_pm_op:
     {
-        ret = xsm_pm_op();
-        if ( ret )
-            break;
-
         ret = do_pm_op(&op->u.pm_op);
         if ( ret && (ret != -EAGAIN) )
             break;
@@ -323,10 +287,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_cpupool_op:
     {
-        ret = xsm_cpupool_op();
-        if ( ret )
-            break;
-
         ret = cpupool_do_sysctl(&op->u.cpupool_op);
         if ( (ret == 0) && copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
@@ -335,10 +295,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 
     case XEN_SYSCTL_scheduler_op:
     {
-        ret = xsm_sched_op();
-        if ( ret )
-            break;
-
         ret = sched_adjust_global(&op->u.scheduler_op);
         if ( (ret == 0) && copy_to_guest(u_sysctl, op, 1) )
             ret = -EFAULT;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 9a5b34f..b680d61 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -58,41 +58,16 @@ static XSM_INLINE int xsm_sysctl(int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_tbufcontrol(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_readconsole(uint32_t clear)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_sched_id(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_perfcontrol(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_debug_keys(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_getcpuinfo(void)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_get_pmstat(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_setpminfo(void)
 {
     return 0;
@@ -110,11 +85,6 @@ static XSM_INLINE int xsm_do_mca(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_availheap(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
 {
     return 0;
@@ -358,16 +328,6 @@ static XSM_INLINE int xsm_lockprof(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_cpupool_op(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_sched_op(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_tmem_op(void)
 {
     return 0;
@@ -508,11 +468,6 @@ static XSM_INLINE int xsm_microcode(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_physinfo(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 903c7cb..f054dae 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -46,14 +46,8 @@ struct xsm_operations {
     int (*set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
     int (*sysctl) (int cmd);
-    int (*tbufcontrol) (void);
     int (*readconsole) (uint32_t clear);
-    int (*sched_id) (void);
-    int (*perfcontrol) (void);
-    int (*debug_keys) (void);
     int (*getcpuinfo) (void);
-    int (*availheap) (void);
-    int (*get_pmstat) (void);
     int (*setpminfo) (void);
     int (*pm_op) (void);
     int (*do_mca) (void);
@@ -117,8 +111,6 @@ struct xsm_operations {
 
     int (*page_offline)(uint32_t cmd);
     int (*lockprof)(void);
-    int (*cpupool_op)(void);
-    int (*sched_op)(void);
     int (*tmem_op)(void);
     int (*tmem_control)(void);
 
@@ -138,7 +130,6 @@ struct xsm_operations {
     int (*xen_settime) (void);
     int (*memtype) (uint32_t access);
     int (*microcode) (void);
-    int (*physinfo) (void);
     int (*platform_quirk) (uint32_t);
     int (*platform_op) (uint32_t cmd);
     int (*firmware_info) (void);
@@ -201,46 +192,16 @@ static inline int xsm_sysctl (int cmd)
     return xsm_ops->sysctl(cmd);
 }
 
-static inline int xsm_tbufcontrol (void)
-{
-    return xsm_ops->tbufcontrol();
-}
-
 static inline int xsm_readconsole (uint32_t clear)
 {
     return xsm_ops->readconsole(clear);
 }
 
-static inline int xsm_sched_id (void)
-{
-    return xsm_ops->sched_id();
-}
-
-static inline int xsm_perfcontrol (void)
-{
-    return xsm_ops->perfcontrol();
-}
-
-static inline int xsm_debug_keys (void)
-{
-    return xsm_ops->debug_keys();
-}
-
-static inline int xsm_availheap (void)
-{
-    return xsm_ops->availheap();
-}
-
-static inline int xsm_getcpuinfo (void)
+static inline int xsm_getcpuinfo(void)
 {
     return xsm_ops->getcpuinfo();
 }
 
-static inline int xsm_get_pmstat(void)
-{
-    return xsm_ops->get_pmstat();
-}
-
 static inline int xsm_setpminfo(void)
 {
     return xsm_ops->setpminfo();
@@ -502,16 +463,6 @@ static inline int xsm_lockprof(void)
     return xsm_ops->lockprof();
 }
 
-static inline int xsm_cpupool_op(void)
-{
-    return xsm_ops->cpupool_op();
-}
-
-static inline int xsm_sched_op(void)
-{
-    return xsm_ops->sched_op();
-}
-
 static inline int xsm_tmem_op(void)
 {
     return xsm_ops->tmem_op();
@@ -593,11 +544,6 @@ static inline int xsm_microcode (void)
     return xsm_ops->microcode();
 }
 
-static inline int xsm_physinfo (void)
-{
-    return xsm_ops->physinfo();
-}
-
 static inline int xsm_platform_quirk (uint32_t quirk)
 {
     return xsm_ops->platform_quirk(quirk);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 9bb86ef..0216b62 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -35,14 +35,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, set_target);
     set_to_dummy_if_null(ops, domctl);
     set_to_dummy_if_null(ops, sysctl);
-    set_to_dummy_if_null(ops, tbufcontrol);
     set_to_dummy_if_null(ops, readconsole);
-    set_to_dummy_if_null(ops, sched_id);
-    set_to_dummy_if_null(ops, perfcontrol);
-    set_to_dummy_if_null(ops, debug_keys);
     set_to_dummy_if_null(ops, getcpuinfo);
-    set_to_dummy_if_null(ops, availheap);
-    set_to_dummy_if_null(ops, get_pmstat);
     set_to_dummy_if_null(ops, setpminfo);
     set_to_dummy_if_null(ops, pm_op);
     set_to_dummy_if_null(ops, do_mca);
@@ -104,8 +98,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
 
     set_to_dummy_if_null(ops, page_offline);
     set_to_dummy_if_null(ops, lockprof);
-    set_to_dummy_if_null(ops, cpupool_op);
-    set_to_dummy_if_null(ops, sched_op);
     set_to_dummy_if_null(ops, tmem_op);
     set_to_dummy_if_null(ops, tmem_control);
 
@@ -125,7 +117,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, xen_settime);
     set_to_dummy_if_null(ops, memtype);
     set_to_dummy_if_null(ops, microcode);
-    set_to_dummy_if_null(ops, physinfo);
     set_to_dummy_if_null(ops, platform_quirk);
     set_to_dummy_if_null(ops, platform_op);
     set_to_dummy_if_null(ops, firmware_info);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index f0216e0..d72a807 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -702,37 +702,57 @@ static int flask_sysctl(int cmd)
     {
     /* These have individual XSM hooks */
     case XEN_SYSCTL_readconsole:
+    case XEN_SYSCTL_getdomaininfolist:
+    case XEN_SYSCTL_page_offline_op:
+#ifdef CONFIG_X86
+    case XEN_SYSCTL_cpu_hotplug:
+#endif
+        return 0;
+
     case XEN_SYSCTL_tbuf_op:
+        return domain_has_xen(current->domain, XEN__TBUFCONTROL);
+
     case XEN_SYSCTL_sched_id:
+        return domain_has_xen(current->domain, XEN__SCHEDULER);
+
     case XEN_SYSCTL_perfc_op:
-    case XEN_SYSCTL_getdomaininfolist:
+        return domain_has_xen(current->domain, XEN__PERFCONTROL);
+
     case XEN_SYSCTL_debug_keys:
+        return domain_has_xen(current->domain, XEN__DEBUG);
+
     case XEN_SYSCTL_getcpuinfo:
+        return domain_has_xen(current->domain, XEN__GETCPUINFO);
+
     case XEN_SYSCTL_availheap:
+        return domain_has_xen(current->domain, XEN__HEAP);
+
     case XEN_SYSCTL_get_pmstat:
+        return domain_has_xen(current->domain, XEN__PM_OP);
+
     case XEN_SYSCTL_pm_op:
-    case XEN_SYSCTL_page_offline_op:
+        return domain_has_xen(current->domain, XEN__PM_OP);
+
     case XEN_SYSCTL_lockprof_op:
+        return domain_has_xen(current->domain, XEN__LOCKPROF);
+
     case XEN_SYSCTL_cpupool_op:
+        return domain_has_xen(current->domain, XEN__CPUPOOL_OP);
+
     case XEN_SYSCTL_scheduler_op:
-#ifdef CONFIG_X86
+        return domain_has_xen(current->domain, XEN__SCHED_OP);
+
     case XEN_SYSCTL_physinfo:
-    case XEN_SYSCTL_cpu_hotplug:
     case XEN_SYSCTL_topologyinfo:
     case XEN_SYSCTL_numainfo:
-#endif
-        return 0;
+        return domain_has_xen(current->domain, XEN__PHYSINFO);
+
     default:
         printk("flask_sysctl: Unknown op %d\n", cmd);
         return -EPERM;
     }
 }
 
-static int flask_tbufcontrol(void)
-{
-    return domain_has_xen(current->domain, XEN__TBUFCONTROL);
-}
-
 static int flask_readconsole(uint32_t clear)
 {
     u32 perms = XEN__READCONSOLE;
@@ -743,41 +763,6 @@ static int flask_readconsole(uint32_t clear)
     return domain_has_xen(current->domain, perms);
 }
 
-static int flask_sched_id(void)
-{
-    return domain_has_xen(current->domain, XEN__SCHEDULER);
-}
-
-static int flask_debug_keys(void)
-{
-    return domain_has_xen(current->domain, XEN__DEBUG);
-}
-
-static int flask_getcpuinfo(void)
-{
-    return domain_has_xen(current->domain, XEN__GETCPUINFO);
-}
-
-static int flask_availheap(void)
-{
-    return domain_has_xen(current->domain, XEN__HEAP);
-}
-
-static int flask_get_pmstat(void)
-{
-    return domain_has_xen(current->domain, XEN__PM_OP);
-}
-
-static int flask_setpminfo(void)
-{
-    return domain_has_xen(current->domain, XEN__PM_OP);
-}
-
-static int flask_pm_op(void)
-{
-    return domain_has_xen(current->domain, XEN__PM_OP);
-}
-
 static int flask_do_mca(void)
 {
     return domain_has_xen(current->domain, XEN__MCA_OP);
@@ -1031,21 +1016,6 @@ static inline int flask_page_offline(uint32_t cmd)
     }
 }
 
-static inline int flask_lockprof(void)
-{
-    return domain_has_xen(current->domain, XEN__LOCKPROF);
-}
-
-static inline int flask_cpupool_op(void)
-{
-    return domain_has_xen(current->domain, XEN__CPUPOOL_OP);
-}
-
-static inline int flask_sched_op(void)
-{
-    return domain_has_xen(current->domain, XEN__SCHED_OP);
-}
-
 static inline int flask_tmem_op(void)
 {
     return domain_has_xen(current->domain, XEN__TMEM_OP);
@@ -1056,11 +1026,6 @@ static inline int flask_tmem_control(void)
     return domain_has_xen(current->domain, XEN__TMEM_CONTROL);
 }
 
-static int flask_perfcontrol(void)
-{
-    return domain_has_xen(current->domain, XEN__PERFCONTROL);
-}
-
 #ifdef CONFIG_X86
 static int flask_shadow_control(struct domain *d, uint32_t op)
 {
@@ -1253,11 +1218,6 @@ static int flask_microcode(void)
     return domain_has_xen(current->domain, XEN__MICROCODE);
 }
 
-static int flask_physinfo(void)
-{
-    return domain_has_xen(current->domain, XEN__PHYSINFO);
-}
-
 static int flask_platform_quirk(uint32_t quirk)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN, XEN__QUIRK, NULL);
@@ -1278,17 +1238,21 @@ static int flask_platform_op(uint32_t op)
     case XENPF_enter_acpi_sleep:
     case XENPF_change_freq:
     case XENPF_getidletime:
-    case XENPF_set_processor_pminfo:
-    case XENPF_get_cpuinfo:
-    case XENPF_get_cpu_version:
     case XENPF_cpu_online:
     case XENPF_cpu_offline:
     case XENPF_cpu_hotadd:
     case XENPF_mem_hotadd:
         /* These operations have their own XSM hooks */
         return 0;
+
+    case XENPF_set_processor_pminfo:
     case XENPF_core_parking:
         return domain_has_xen(current->domain, XEN__PM_OP);
+
+    case XENPF_get_cpu_version:
+    case XENPF_get_cpuinfo:
+        return domain_has_xen(current->domain, XEN__GETCPUINFO);
+
     default:
         printk("flask_platform_op: Unknown op %d\n", op);
         return -EPERM;
@@ -1484,16 +1448,7 @@ static struct xsm_operations flask_ops = {
     .set_target = flask_set_target,
     .domctl = flask_domctl,
     .sysctl = flask_sysctl,
-    .tbufcontrol = flask_tbufcontrol,
     .readconsole = flask_readconsole,
-    .sched_id = flask_sched_id,
-    .perfcontrol = flask_perfcontrol,
-    .debug_keys = flask_debug_keys,
-    .getcpuinfo = flask_getcpuinfo,
-    .availheap = flask_availheap,
-    .get_pmstat = flask_get_pmstat,
-    .setpminfo = flask_setpminfo,
-    .pm_op = flask_pm_op,
     .do_mca = flask_do_mca,
 
     .evtchn_unbound = flask_evtchn_unbound,
@@ -1548,9 +1503,6 @@ static struct xsm_operations flask_ops = {
     .resource_setup_misc = flask_resource_setup_misc,
 
     .page_offline = flask_page_offline,
-    .lockprof = flask_lockprof,
-    .cpupool_op = flask_cpupool_op,
-    .sched_op = flask_sched_op,
     .tmem_op = flask_tmem_op,
     .tmem_control = flask_tmem_control,
 
@@ -1570,7 +1522,6 @@ static struct xsm_operations flask_ops = {
     .xen_settime = flask_xen_settime,
     .memtype = flask_memtype,
     .microcode = flask_microcode,
-    .physinfo = flask_physinfo,
     .platform_quirk = flask_platform_quirk,
     .platform_op = flask_platform_op,
     .firmware_info = flask_firmware_info,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSel-0002Md-Tv; Fri, 30 Nov 2012 15:37:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSej-0002MC-UB
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:34 +0000
Received: from [85.158.139.211:63650] by server-2.bemta-5.messagelabs.com id
	00/6F-04892-DB2D8B05; Fri, 30 Nov 2012 15:37:33 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-8.tower-206.messagelabs.com!1354289851!18547804!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24237 invoked from network); 30 Nov 2012 15:37:32 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-8.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:32 -0000
X-TM-IMSS-Message-ID: <339210a100027aaa@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 339210a100027aaa ;
	Fri, 30 Nov 2012 10:36:23 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSct017785; 
	Fri, 30 Nov 2012 10:37:29 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:49 -0500
Message-Id: <1354289830-24642-3-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: [Xen-devel] [PATCH 02/23] flask/policy: Add domain relabel example
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This adds the nomigrate_t type to the example FLASK policy which allows
domains to be created that dom0 cannot access after building.

Example domain configuration snippet:
  seclabel='customer_1:vm_r:nomigrate_t'
  init_seclabel='customer_1:vm_r:nomigrate_t_building'

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 docs/misc/xsm-flask.txt                      |  2 +
 tools/flask/policy/policy/modules/xen/xen.if | 56 +++++++++++++++++++++-------
 tools/flask/policy/policy/modules/xen/xen.te | 10 +++++
 3 files changed, 55 insertions(+), 13 deletions(-)

diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index 6b0d327..0778a28 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -60,6 +60,8 @@ that can be used without dom0 disaggregation. The main types for domUs are:
  - domU_t is a domain that can communicate with any other domU_t
  - isolated_domU_t can only communicate with dom0
  - prot_domU_t is a domain type whose creation can be disabled with a boolean
+ - nomigrate_t is a domain that must be created via the nomigrate_t_building
+   type, and whose memory cannot be read by dom0 once created
 
 HVM domains with stubdomain device models use two types (one per domain):
  - domHVM_t is an HVM domain that uses a stubdomain device model
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 3f58909..2ad11b2 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -9,24 +9,47 @@
 #   Declare a type as a domain type, and allow basic domain setup
 define(`declare_domain', `
 	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
+	type $1_channel, event_type;
+	type_transition $1 domain_type:event $1_channel;
 	allow $1 $1:grant { query setup };
 	allow $1 $1:mmu { adjust physmap map_read map_write stat pinpage };
 	allow $1 $1:hvm { getparam setparam };
 ')
 
-# create_domain(priv, target)
-#   Allow a domain to be created
-define(`create_domain', `
+# declare_build_label(type)
+#   Declare a paired _building type for the given domain type
+define(`declare_build_label', `
+	type $1_building, domain_type;
+	type_transition $1_building domain_type:event $1_channel;
+	allow $1_building $1 : domain transition;
+')
+
+define(`create_domain_common', `
 	allow $1 $2:domain { create max_vcpus setdomainmaxmem setaddrsize
-			getdomaininfo hypercall setvcpucontext scheduler
-			unpause getvcpuinfo getvcpuextstate getaddrsize
-			getvcpuaffinity };
+			getdomaininfo hypercall setvcpucontext setextvcpucontext
+			scheduler getvcpuinfo getvcpuextstate getaddrsize
+			getvcpuaffinity setvcpuaffinity };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
 	allow $1 $2:mmu {map_read map_write adjust memorymap physmap pinpage};
 	allow $1 $2:grant setup;
-	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute setparam pcilevel trackdirtyvram };
-	allow $1 $2_$1_channel:event create;
+	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc setparam pcilevel trackdirtyvram };
+')
+
+# create_domain(priv, target)
+#   Allow a domain to be created directly
+define(`create_domain', `
+	create_domain_common($1, $2)
+	allow $1 $2_channel:event create;
+')
+
+# create_domain_build_label(priv, target)
+#   Allow a domain to be created via its domain build label
+define(`create_domain_build_label', `
+	create_domain_common($1, $2_building)
+	allow $1 $2_channel:event create;
+	allow $1 $2_building:domain2 relabelfrom;
+	allow $1 $2:domain2 relabelto;
 ')
 
 # manage_domain(priv, target)
@@ -37,6 +60,15 @@ define(`manage_domain', `
 			setvcpuaffinity setdomainmaxmem };
 ')
 
+# migrate_domain_out(priv, target)
+#   Allow creation of a snapshot or migration image from a domain
+#   (inbound migration is the same as domain creation)
+define(`migrate_domain_out', `
+	allow $1 $2:hvm { gethvmc getparam irqlevel };
+	allow $1 $2:mmu { stat pageinfo map_read };
+	allow $1 $2:domain { getaddrsize getvcpucontext getextvcpucontext getvcpuextstate pause destroy };
+')
+
 ################################################################################
 #
 # Inter-domain communication
@@ -47,8 +79,6 @@ define(`manage_domain', `
 #   This allows an event channel to be created from domains with labels
 #   <source> to <dest> and will label it <chan-label>
 define(`create_channel', `
-	type $3, event_type;
-	type_transition $1 $2:event $3;
 	allow $1 $3:event { create send status };
 	allow $3 $2:event { bind };
 ')
@@ -56,8 +86,8 @@ define(`create_channel', `
 # domain_event_comms(dom1, dom2)
 #   Allow two domain types to communicate using event channels
 define(`domain_event_comms', `
-	create_channel($1, $2, $1_$2_channel)
-	create_channel($2, $1, $2_$1_channel)
+	create_channel($1, $2, $1_channel)
+	create_channel($2, $1, $2_channel)
 ')
 
 # domain_comms(dom1, dom2)
@@ -72,7 +102,7 @@ define(`domain_comms', `
 #   Allow a domain types to communicate with others of its type using grants
 #   and event channels (this includes event channels to DOMID_SELF)
 define(`domain_self_comms', `
-	create_channel($1, $1, $1_self_channel)
+	create_channel($1, $1, $1_channel)
 	allow $1 $1:grant { map_read map_write copy unmap };
 ')
 
diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
index 9550397..1162153 100644
--- a/tools/flask/policy/policy/modules/xen/xen.te
+++ b/tools/flask/policy/policy/modules/xen/xen.te
@@ -90,6 +90,7 @@ create_domain(dom0_t, isolated_domU_t)
 manage_domain(dom0_t, isolated_domU_t)
 domain_comms(dom0_t, isolated_domU_t)
 
+# Declare a boolean that denies creation of prot_domU_t domains
 gen_bool(prot_doms_locked, false)
 declare_domain(prot_domU_t)
 if (!prot_doms_locked) {
@@ -111,6 +112,15 @@ manage_domain(dom0_t, dm_dom_t)
 domain_comms(dom0_t, dm_dom_t)
 device_model(dm_dom_t, domHVM_t)
 
+# nomigrate_t must be built via the nomigrate_t_building label; once built,
+# dom0 cannot read its memory.
+declare_domain(nomigrate_t)
+declare_build_label(nomigrate_t)
+create_domain_build_label(dom0_t, nomigrate_t)
+manage_domain(dom0_t, nomigrate_t)
+domain_comms(dom0_t, nomigrate_t)
+domain_self_comms(nomigrate_t)
+
 ###############################################################################
 #
 # Device delegation
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSet-0002Sk-0K; Fri, 30 Nov 2012 15:37:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSep-0002Ok-Lo
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:40 +0000
Received: from [85.158.139.211:30640] by server-10.bemta-5.messagelabs.com id
	ED/33-09257-2C2D8B05; Fri, 30 Nov 2012 15:37:38 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-4.tower-206.messagelabs.com!1354289856!18577945!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2808 invoked from network); 30 Nov 2012 15:37:37 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-4.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:37 -0000
X-TM-IMSS-Message-ID: <3392281700027ac4@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3392281700027ac4 ;
	Fri, 30 Nov 2012 10:36:29 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSdF017785; 
	Fri, 30 Nov 2012 10:37:35 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:09 -0500
Message-Id: <1354289830-24642-23-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 22/23] xen: platform_hypercall XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

A number of the platform_hypercall XSM hooks have no parameters or only
pass the operation ID, making them redundant with the xsm_platform_op
hook. Remove these redundant hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/platform_hypercall.c |  60 ---------------------
 xen/include/xsm/dummy.h           |  67 ------------------------
 xen/include/xsm/xsm.h             |  72 -------------------------
 xen/xsm/dummy.c                   |  13 -----
 xen/xsm/flask/hooks.c             | 107 +++++++++++---------------------------
 5 files changed, 30 insertions(+), 289 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 738bed0..e17d64f 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -90,10 +90,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
     case XENPF_settime:
     {
-        ret = xsm_xen_settime();
-        if ( ret )
-            break;
-
         do_settime(op->u.settime.secs, 
                    op->u.settime.nsecs, 
                    op->u.settime.system_time);
@@ -103,10 +99,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
     case XENPF_add_memtype:
     {
-        ret = xsm_memtype(op->cmd);
-        if ( ret )
-            break;
-
         ret = mtrr_add_page(
             op->u.add_memtype.mfn,
             op->u.add_memtype.nr_mfns,
@@ -125,10 +117,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
     case XENPF_del_memtype:
     {
-        ret = xsm_memtype(op->cmd);
-        if ( ret )
-            break;
-
         if (op->u.del_memtype.handle == 0
             /* mtrr/main.c otherwise does a lookup */
             && (int)op->u.del_memtype.reg >= 0)
@@ -147,10 +135,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         unsigned long mfn, nr_mfns;
         mtrr_type     type;
 
-        ret = xsm_memtype(op->cmd);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( op->u.read_memtype.reg < num_var_ranges )
         {
@@ -167,10 +151,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         XEN_GUEST_HANDLE(const_void) data;
 
-        ret = xsm_microcode();
-        if ( ret )
-            break;
-
         guest_from_compat_handle(data, op->u.microcode.data);
 
         /*
@@ -198,10 +178,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         int quirk_id = op->u.platform_quirk.quirk_id;
 
-        ret = xsm_platform_quirk(quirk_id);
-        if ( ret )
-            break;
-
         switch ( quirk_id )
         {
         case QUIRK_NOIRQBALANCING:
@@ -223,10 +199,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_firmware_info:
-        ret = xsm_firmware_info();
-        if ( ret )
-            break;
-
         switch ( op->u.firmware_info.type )
         {
         case XEN_FW_DISK_INFO: {
@@ -335,10 +307,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         break;
 
     case XENPF_efi_runtime_call:
-        ret = xsm_efi_call();
-        if ( ret )
-            break;
-
         ret = efi_runtime_call(&op->u.efi_runtime_call);
         if ( ret == 0 &&
              copy_field_to_guest(u_xenpf_op, op, u.efi_runtime_call) )
@@ -346,18 +314,10 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         break;
 
     case XENPF_enter_acpi_sleep:
-        ret = xsm_acpi_sleep();
-        if ( ret )
-            break;
-
         ret = acpi_enter_sleep(&op->u.enter_acpi_sleep);
         break;
 
     case XENPF_change_freq:
-        ret = xsm_change_freq();
-        if ( ret )
-            break;
-
         ret = -ENOSYS;
         if ( cpufreq_controller != FREQCTL_dom0_kernel )
             break;
@@ -379,10 +339,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         XEN_GUEST_HANDLE(uint8) cpumap_bitmap;
         XEN_GUEST_HANDLE(uint64) idletimes;
 
-        ret = xsm_getidletime();
-        if ( ret )
-            break;
-
         ret = -ENOSYS;
         if ( cpufreq_controller != FREQCTL_dom0_kernel )
             break;
@@ -419,10 +375,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_set_processor_pminfo:
-        ret = xsm_setpminfo();
-        if ( ret )
-            break;
-
         switch ( op->u.set_pminfo.type )
         {
         case XEN_PM_PX:
@@ -475,10 +427,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
         g_info = &op->u.pcpu_info;
 
-        ret = xsm_getcpuinfo();
-        if ( ret )
-            break;
-
         if ( !get_cpu_maps() )
         {
             ret = -EBUSY;
@@ -512,10 +460,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         struct xenpf_pcpu_version *ver = &op->u.pcpu_version;
 
-        ret = xsm_getcpuinfo();
-        if ( ret )
-            break;
-
         if ( !get_cpu_maps() )
         {
             ret = -EBUSY;
@@ -568,10 +512,6 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
             break;
         }
 
-        ret = xsm_resource_plug_core();
-        if ( ret )
-            break;
-
         ret = continue_hypercall_on_cpu(
             0, cpu_up_helper, (void *)(unsigned long)cpu);
         break;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index b680d61..019183e 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -63,21 +63,6 @@ static XSM_INLINE int xsm_readconsole(uint32_t clear)
     return 0;
 }
 
-static XSM_INLINE int xsm_getcpuinfo(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_setpminfo(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_pm_op(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_do_mca(void)
 {
     if ( !IS_PRIV(current->domain) )
@@ -323,11 +308,6 @@ static XSM_INLINE int xsm_page_offline(uint32_t cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_lockprof(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_tmem_op(void)
 {
     return 0;
@@ -453,26 +433,6 @@ static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_xen_settime(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_memtype(uint32_t access)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_microcode(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_platform_op(uint32_t op)
 {
     if ( !IS_PRIV(current->domain) )
@@ -480,33 +440,6 @@ static XSM_INLINE int xsm_platform_op(uint32_t op)
     return 0;
 }
 
-static XSM_INLINE int xsm_firmware_info(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_efi_call(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_acpi_sleep(void)
-{
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
-}
-
-static XSM_INLINE int xsm_change_freq(void)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getidletime(void)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_machine_memory_map(void)
 {
     if ( !IS_PRIV(current->domain) )
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index f054dae..105201e 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -47,9 +47,6 @@ struct xsm_operations {
     int (*domctl) (struct domain *d, int cmd);
     int (*sysctl) (int cmd);
     int (*readconsole) (uint32_t clear);
-    int (*getcpuinfo) (void);
-    int (*setpminfo) (void);
-    int (*pm_op) (void);
     int (*do_mca) (void);
 
     int (*evtchn_unbound) (struct domain *d, struct evtchn *chn, domid_t id2);
@@ -110,7 +107,6 @@ struct xsm_operations {
     int (*resource_setup_misc) (void);
 
     int (*page_offline)(uint32_t cmd);
-    int (*lockprof)(void);
     int (*tmem_op)(void);
     int (*tmem_control)(void);
 
@@ -127,16 +123,8 @@ struct xsm_operations {
     int (*mem_event_op) (struct domain *d, int op);
     int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
     int (*apic) (struct domain *d, int cmd);
-    int (*xen_settime) (void);
     int (*memtype) (uint32_t access);
-    int (*microcode) (void);
-    int (*platform_quirk) (uint32_t);
     int (*platform_op) (uint32_t cmd);
-    int (*firmware_info) (void);
-    int (*efi_call) (void);
-    int (*acpi_sleep) (void);
-    int (*change_freq) (void);
-    int (*getidletime) (void);
     int (*machine_memory_map) (void);
     int (*domain_memory_map) (struct domain *d);
 #define XSM_MMU_UPDATE_READ      1
@@ -197,21 +185,6 @@ static inline int xsm_readconsole (uint32_t clear)
     return xsm_ops->readconsole(clear);
 }
 
-static inline int xsm_getcpuinfo(void)
-{
-    return xsm_ops->getcpuinfo();
-}
-
-static inline int xsm_setpminfo(void)
-{
-    return xsm_ops->setpminfo();
-}
-
-static inline int xsm_pm_op(void)
-{
-    return xsm_ops->pm_op();
-}
-
 static inline int xsm_do_mca(void)
 {
     return xsm_ops->do_mca();
@@ -458,11 +431,6 @@ static inline int xsm_page_offline(uint32_t cmd)
     return xsm_ops->page_offline(cmd);
 }
 
-static inline int xsm_lockprof(void)
-{
-    return xsm_ops->lockprof();
-}
-
 static inline int xsm_tmem_op(void)
 {
     return xsm_ops->tmem_op();
@@ -529,56 +497,16 @@ static inline int xsm_apic (struct domain *d, int cmd)
     return xsm_ops->apic(d, cmd);
 }
 
-static inline int xsm_xen_settime (void)
-{
-    return xsm_ops->xen_settime();
-}
-
 static inline int xsm_memtype (uint32_t access)
 {
     return xsm_ops->memtype(access);
 }
 
-static inline int xsm_microcode (void)
-{
-    return xsm_ops->microcode();
-}
-
-static inline int xsm_platform_quirk (uint32_t quirk)
-{
-    return xsm_ops->platform_quirk(quirk);
-}
-
 static inline int xsm_platform_op (uint32_t op)
 {
     return xsm_ops->platform_op(op);
 }
 
-static inline int xsm_firmware_info (void)
-{
-    return xsm_ops->firmware_info();
-}
-
-static inline int xsm_efi_call (void)
-{
-    return xsm_ops->efi_call();
-}
-
-static inline int xsm_acpi_sleep (void)
-{
-    return xsm_ops->acpi_sleep();
-}
-
-static inline int xsm_change_freq (void)
-{
-    return xsm_ops->change_freq();
-}
-
-static inline int xsm_getidletime (void)
-{
-    return xsm_ops->getidletime();
-}
-
 static inline int xsm_machine_memory_map(void)
 {
     return xsm_ops->machine_memory_map();
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 0216b62..22c66e5 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -36,9 +36,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, domctl);
     set_to_dummy_if_null(ops, sysctl);
     set_to_dummy_if_null(ops, readconsole);
-    set_to_dummy_if_null(ops, getcpuinfo);
-    set_to_dummy_if_null(ops, setpminfo);
-    set_to_dummy_if_null(ops, pm_op);
     set_to_dummy_if_null(ops, do_mca);
 
     set_to_dummy_if_null(ops, evtchn_unbound);
@@ -97,7 +94,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, resource_setup_misc);
 
     set_to_dummy_if_null(ops, page_offline);
-    set_to_dummy_if_null(ops, lockprof);
     set_to_dummy_if_null(ops, tmem_op);
     set_to_dummy_if_null(ops, tmem_control);
 
@@ -114,16 +110,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, mem_event_op);
     set_to_dummy_if_null(ops, mem_sharing_op);
     set_to_dummy_if_null(ops, apic);
-    set_to_dummy_if_null(ops, xen_settime);
-    set_to_dummy_if_null(ops, memtype);
-    set_to_dummy_if_null(ops, microcode);
-    set_to_dummy_if_null(ops, platform_quirk);
     set_to_dummy_if_null(ops, platform_op);
-    set_to_dummy_if_null(ops, firmware_info);
-    set_to_dummy_if_null(ops, efi_call);
-    set_to_dummy_if_null(ops, acpi_sleep);
-    set_to_dummy_if_null(ops, change_freq);
-    set_to_dummy_if_null(ops, getidletime);
     set_to_dummy_if_null(ops, machine_memory_map);
     set_to_dummy_if_null(ops, domain_memory_map);
     set_to_dummy_if_null(ops, mmu_update);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index d72a807..03ea675 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1186,64 +1186,51 @@ static int flask_apic(struct domain *d, int cmd)
     return domain_has_xen(d, perm);
 }
 
-static int flask_xen_settime(void)
-{
-    return domain_has_xen(current->domain, XEN__SETTIME);
-}
-
-static int flask_memtype(uint32_t access)
-{
-    u32 perm;
-
-    switch ( access )
-    {
-    case XENPF_add_memtype:
-        perm = XEN__MTRR_ADD;
-        break;
-    case XENPF_del_memtype:
-        perm = XEN__MTRR_DEL;
-        break;
-    case XENPF_read_memtype:
-        perm = XEN__MTRR_READ;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return domain_has_xen(current->domain, perm);
-}
-
-static int flask_microcode(void)
-{
-    return domain_has_xen(current->domain, XEN__MICROCODE);
-}
-
-static int flask_platform_quirk(uint32_t quirk)
-{
-    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN, XEN__QUIRK, NULL);
-}
-
 static int flask_platform_op(uint32_t op)
 {
     switch ( op )
     {
+#ifdef CONFIG_X86
+    /* These operations have their own XSM hooks */
+    case XENPF_cpu_online:
+    case XENPF_cpu_offline:
+    case XENPF_cpu_hotadd:
+    case XENPF_mem_hotadd:
+        return 0;
+#endif
+
     case XENPF_settime:
+        return domain_has_xen(current->domain, XEN__SETTIME);
+
     case XENPF_add_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_ADD);
+
     case XENPF_del_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_DEL);
+
     case XENPF_read_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_READ);
+
     case XENPF_microcode_update:
+        return domain_has_xen(current->domain, XEN__MICROCODE);
+
     case XENPF_platform_quirk:
+        return domain_has_xen(current->domain, XEN__QUIRK);
+
     case XENPF_firmware_info:
+        return domain_has_xen(current->domain, XEN__FIRMWARE);
+
     case XENPF_efi_runtime_call:
+        return domain_has_xen(current->domain, XEN__FIRMWARE);
+
     case XENPF_enter_acpi_sleep:
+        return domain_has_xen(current->domain, XEN__SLEEP);
+
     case XENPF_change_freq:
+        return domain_has_xen(current->domain, XEN__FREQUENCY);
+
     case XENPF_getidletime:
-    case XENPF_cpu_online:
-    case XENPF_cpu_offline:
-    case XENPF_cpu_hotadd:
-    case XENPF_mem_hotadd:
-        /* These operations have their own XSM hooks */
-        return 0;
+        return domain_has_xen(current->domain, XEN__GETIDLE);
 
     case XENPF_set_processor_pminfo:
     case XENPF_core_parking:
@@ -1259,31 +1246,6 @@ static int flask_platform_op(uint32_t op)
     }
 }
 
-static int flask_firmware_info(void)
-{
-    return domain_has_xen(current->domain, XEN__FIRMWARE);
-}
-
-static int flask_efi_call(void)
-{
-    return domain_has_xen(current->domain, XEN__FIRMWARE);
-}
-
-static int flask_acpi_sleep(void)
-{
-    return domain_has_xen(current->domain, XEN__SLEEP);
-}
-
-static int flask_change_freq(void)
-{
-    return domain_has_xen(current->domain, XEN__FREQUENCY);
-}
-
-static int flask_getidletime(void)
-{
-    return domain_has_xen(current->domain, XEN__GETIDLE);
-}
-
 static int flask_machine_memory_map(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_MMU, MMU__MEMORYMAP, NULL);
@@ -1519,16 +1481,7 @@ static struct xsm_operations flask_ops = {
     .mem_event_op = flask_mem_event_op,
     .mem_sharing_op = flask_mem_sharing_op,
     .apic = flask_apic,
-    .xen_settime = flask_xen_settime,
-    .memtype = flask_memtype,
-    .microcode = flask_microcode,
-    .platform_quirk = flask_platform_quirk,
     .platform_op = flask_platform_op,
-    .firmware_info = flask_firmware_info,
-    .efi_call = flask_efi_call,
-    .acpi_sleep = flask_acpi_sleep,
-    .change_freq = flask_change_freq,
-    .getidletime = flask_getidletime,
     .machine_memory_map = flask_machine_memory_map,
     .domain_memory_map = flask_domain_memory_map,
     .mmu_update = flask_mmu_update,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:50 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSep-0002PT-UU; Fri, 30 Nov 2012 15:37:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSen-0002Mn-5G
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:37 +0000
Received: from [193.109.254.147:14316] by server-13.bemta-14.messagelabs.com
	id B6/A7-11239-0C2D8B05; Fri, 30 Nov 2012 15:37:36 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-16.tower-27.messagelabs.com!1354289851!8784701!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2288 invoked from network); 30 Nov 2012 15:37:31 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-16.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:31 -0000
X-TM-IMSS-Message-ID: <d0a0dd9f000589b7@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0dd9f000589b7 ;
	Fri, 30 Nov 2012 10:37:35 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbScs017785; 
	Fri, 30 Nov 2012 10:37:28 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:48 -0500
Message-Id: <1354289830-24642-2-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH 01/23] libxl: introduce XSM relabel on build
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Allow a domain to be built under one security label and run using a
different label. This can be used to prevent the domain builder or
control domain from having the ability to access a guest domain's memory
via map_foreign_range except during the build process where this is
required.

Note: this does not provide complete protection from a malicious dom0;
mappings created during the build process may persist after the relabel,
and could be used to indirectly access the guest's memory.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
---
 docs/man/xl.cfg.pod.5       |  9 +++++++++
 tools/libxc/xc_flask.c      | 10 ++++++++++
 tools/libxc/xenctrl.h       |  1 +
 tools/libxl/libxl_create.c  |  4 ++++
 tools/libxl/libxl_types.idl |  1 +
 tools/libxl/xl_cmdimpl.c    | 20 +++++++++++++++++++-
 6 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index fe4fac9..2b28966 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -270,6 +270,15 @@ UUID will be generated.
 
 Assign an XSM security label to this domain.
 
+=item B<init_seclabel="LABEL">
+
+Specify an XSM security label used for this domain temporarily during
+its build. The domain's XSM label will be changed to the execution
+seclabel (specified by "seclabel") once the build is complete, prior to
+unpausing the domain. With a properly constructed security policy (such
+as nomigrate_t in the example policy), this can be used to build a
+domain whose memory is not accessible to the toolstack domain.
+
 =item B<nomigrate=BOOLEAN>
 
 Disable migration of this domain.  This enables certain other features
diff --git a/tools/libxc/xc_flask.c b/tools/libxc/xc_flask.c
index 80c5a2d..face1e0 100644
--- a/tools/libxc/xc_flask.c
+++ b/tools/libxc/xc_flask.c
@@ -422,6 +422,16 @@ int xc_flask_setavc_threshold(xc_interface *xch, int threshold)
     return xc_flask_op(xch, &op);
 }
 
+int xc_flask_relabel_domain(xc_interface *xch, int domid, uint32_t sid)
+{
+    DECLARE_FLASK_OP;
+    op.cmd = FLASK_RELABEL_DOMAIN;
+    op.u.relabel.domid = domid;
+    op.u.relabel.sid = sid;
+
+    return xc_flask_op(xch, &op);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 7eb5743..60391c6 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -2158,6 +2158,7 @@ int xc_flask_policyvers(xc_interface *xc_handle);
 int xc_flask_avc_hashstats(xc_interface *xc_handle, char *buf, int size);
 int xc_flask_getavc_threshold(xc_interface *xc_handle);
 int xc_flask_setavc_threshold(xc_interface *xc_handle, int threshold);
+int xc_flask_relabel_domain(xc_interface *xch, int domid, uint32_t sid);
 
 struct elf_binary;
 void xc_elf_set_logfile(xc_interface *xch, struct elf_binary *elf,
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 9d20086..b183255 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -1182,6 +1182,10 @@ static void domcreate_complete(libxl__egc *egc,
                                int rc)
 {
     STATE_AO_GC(dcs->ao);
+    libxl_domain_config *const d_config = dcs->guest_config;
+
+    if (!rc && d_config->b_info.exec_ssidref)
+        rc = xc_flask_relabel_domain(CTX->xch, dcs->guest_domid, d_config->b_info.exec_ssidref);
 
     if (rc) {
         if (dcs->guest_domid) {
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 7eac4a8..93524f0 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -268,6 +268,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("video_memkb",     MemKB),
     ("shadow_memkb",    MemKB),
     ("rtc_timeoffset",  uint32),
+    ("exec_ssidref",    uint32),
     ("localtime",       libxl_defbool),
     ("disable_migrate", libxl_defbool),
     ("cpuid",           libxl_cpuid_policy_list),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 5d444a8..4d67fdf 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -596,16 +596,34 @@ static void parse_config_data(const char *config_source,
         exit(1);
     }
 
-    if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
+    if (!xlu_cfg_get_string (config, "init_seclabel", &buf, 0)) {
         e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
                                     &c_info->ssidref);
         if (e) {
             if (errno == ENOSYS) {
+                fprintf(stderr, "XSM Disabled: init_seclabel not supported\n");
+            } else {
+                fprintf(stderr, "Invalid init_seclabel: %s\n", buf);
+                exit(1);
+            }
+        }
+    }
+
+    if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
+        uint32_t ssidref;
+        e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
+                                    &ssidref);
+        if (e) {
+            if (errno == ENOSYS) {
                 fprintf(stderr, "XSM Disabled: seclabel not supported\n");
             } else {
                 fprintf(stderr, "Invalid seclabel: %s\n", buf);
                 exit(1);
             }
+        } else if (c_info->ssidref) {
+            b_info->exec_ssidref = ssidref;
+        } else {
+            c_info->ssidref = ssidref;
         }
     }
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSes-0002S1-8V; Fri, 30 Nov 2012 15:37:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSep-0002OM-1I
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:39 +0000
Received: from [193.109.254.147:42521] by server-14.bemta-14.messagelabs.com
	id 98/55-14517-2C2D8B05; Fri, 30 Nov 2012 15:37:38 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-16.tower-27.messagelabs.com!1354289853!8784708!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2529 invoked from network); 30 Nov 2012 15:37:34 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-16.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:34 -0000
X-TM-IMSS-Message-ID: <d0a0e858000589c0@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0e858000589c0 ;
	Fri, 30 Nov 2012 10:37:37 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd2017785; 
	Fri, 30 Nov 2012 10:37:31 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:56 -0500
Message-Id: <1354289830-24642-10-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 09/23] xen: lock target domain in do_domctl
	common code
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Because almost all domctls need to lock the target domain, do this by
default instead of repeating it in each domctl. This is not currently
extended to the arch-specific domctls, but RCU locks are safe to take
recursively so this only causes duplicate but correct locking.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
---
 xen/common/domctl.c | 268 ++++++++++++----------------------------------------
 1 file changed, 59 insertions(+), 209 deletions(-)

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 2f49eb2..536bef5 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -243,6 +243,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
     struct xen_domctl curop, *op = &curop;
+    struct domain *d;
 
     if ( copy_from_guest(op, u_domctl, 1) )
         return -EFAULT;
@@ -252,19 +253,29 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     switch ( op->cmd )
     {
+    case XEN_DOMCTL_createdomain:
+    case XEN_DOMCTL_getdomaininfo:
+    case XEN_DOMCTL_test_assign_device:
+        d = NULL;
+        break;
+    default:
+        d = rcu_lock_domain_by_id(op->domain);
+        if ( d == NULL )
+            return -ESRCH;
+    }
+
+    switch ( op->cmd )
+    {
     case XEN_DOMCTL_ioport_mapping:
     case XEN_DOMCTL_memory_mapping:
     case XEN_DOMCTL_bind_pt_irq:
     case XEN_DOMCTL_unbind_pt_irq: {
-        struct domain *d;
-        bool_t is_priv = IS_PRIV(current->domain);
-        if ( !is_priv && ((d = rcu_lock_domain_by_id(op->domain)) != NULL) )
+        bool_t is_priv = IS_PRIV_FOR(current->domain, d);
+        if ( !is_priv )
         {
-            is_priv = IS_PRIV_FOR(current->domain, d);
-            rcu_unlock_domain(d);
+            ret = -EPERM;
+            goto domctl_out_unlock;
         }
-        if ( !is_priv )
-            return -EPERM;
         break;
     }
     case XEN_DOMCTL_getdomaininfo:
@@ -276,15 +287,18 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     }
 
     if ( !domctl_lock_acquire() )
+    {
+        if ( d )
+            rcu_unlock_domain(d);
         return hypercall_create_continuation(
             __HYPERVISOR_domctl, "h", u_domctl);
+    }
 
     switch ( op->cmd )
     {
 
     case XEN_DOMCTL_setvcpucontext:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
         vcpu_guest_context_u c = { .nat = NULL };
         unsigned int vcpu = op->u.vcpucontext.vcpu;
         struct vcpu *v;
@@ -338,77 +352,48 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     svc_out:
         free_vcpu_guest_context(c.nat);
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_pausedomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-        ret = -ESRCH;
-        if ( d != NULL )
-        {
-            ret = xsm_pausedomain(d);
-            if ( ret )
-                goto pausedomain_out;
+        ret = xsm_pausedomain(d);
+        if ( ret )
+            break;
 
-            ret = -EINVAL;
-            if ( d != current->domain )
-            {
-                domain_pause_by_systemcontroller(d);
-                ret = 0;
-            }
-        pausedomain_out:
-            rcu_unlock_domain(d);
+        ret = -EINVAL;
+        if ( d != current->domain )
+        {
+            domain_pause_by_systemcontroller(d);
+            ret = 0;
         }
     }
     break;
 
     case XEN_DOMCTL_unpausedomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-
-        ret = -ESRCH;
-        if ( d == NULL )
-            break;
-
         ret = xsm_unpausedomain(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domain_unpause_by_systemcontroller(d);
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_resumedomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-
-        ret = -ESRCH;
-        if ( d == NULL )
-            break;
-
         ret = xsm_resumedomain(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domain_resume(d);
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_createdomain:
     {
-        struct domain *d;
         domid_t        dom;
         static domid_t rover = 0;
         unsigned int domcr_flags;
@@ -458,6 +443,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( IS_ERR(d) )
         {
             ret = PTR_ERR(d);
+            d = NULL;
             break;
         }
 
@@ -469,39 +455,28 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         op->domain = d->domain_id;
         if ( copy_to_guest(u_domctl, op, 1) )
             ret = -EFAULT;
+        d = NULL;
     }
     break;
 
     case XEN_DOMCTL_max_vcpus:
     {
-        struct domain *d;
         unsigned int i, max = op->u.max_vcpus.max, cpu;
         cpumask_t *online;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = -EINVAL;
         if ( (d == current->domain) || /* no domain_pause() */
              (max > MAX_VIRT_CPUS) ||
              (is_hvm_domain(d) && (max > MAX_HVM_VCPUS)) )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         ret = xsm_max_vcpus(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         /* Until Xenoprof can dynamically grow its vcpu-s array... */
         if ( d->xenoprof )
         {
-            rcu_unlock_domain(d);
             ret = -EAGAIN;
             break;
         }
@@ -576,44 +551,31 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     maxvcpu_out_novcpulock:
         domain_unpause(d);
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_destroydomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-        ret = -ESRCH;
-        if ( d != NULL )
-        {
-            ret = xsm_destroydomain(d) ? : domain_kill(d);
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_destroydomain(d) ? : domain_kill(d);
     }
     break;
 
     case XEN_DOMCTL_setvcpuaffinity:
     case XEN_DOMCTL_getvcpuaffinity:
     {
-        domid_t dom = op->domain;
-        struct domain *d = rcu_lock_domain_by_id(dom);
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( d == NULL )
-            break;
-
         ret = xsm_vcpuaffinity(op->cmd, d);
         if ( ret )
-            goto vcpuaffinity_out;
+            break;
 
         ret = -EINVAL;
         if ( op->u.vcpuaffinity.vcpu >= d->max_vcpus )
-            goto vcpuaffinity_out;
+            break;
 
         ret = -ESRCH;
         if ( (v = d->vcpu[op->u.vcpuaffinity.vcpu]) == NULL )
-            goto vcpuaffinity_out;
+            break;
 
         if ( op->cmd == XEN_DOMCTL_setvcpuaffinity )
         {
@@ -632,36 +594,23 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             ret = cpumask_to_xenctl_cpumap(
                 &op->u.vcpuaffinity.cpumap, v->cpu_affinity);
         }
-
-    vcpuaffinity_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_scheduler_op:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = xsm_scheduler(d);
         if ( ret )
-            goto scheduler_op_out;
+            break;
 
         ret = sched_adjust(d, &op->u.scheduler_op);
         if ( copy_to_guest(u_domctl, op, 1) )
             ret = -EFAULT;
-
-    scheduler_op_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_getdomaininfo:
     { 
-        struct domain *d;
         domid_t dom = op->domain;
 
         rcu_read_lock(&domlist_read_lock);
@@ -689,19 +638,15 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     getdomaininfo_out:
         rcu_read_unlock(&domlist_read_lock);
+        d = NULL;
     }
     break;
 
     case XEN_DOMCTL_getvcpucontext:
     { 
         vcpu_guest_context_u c = { .nat = NULL };
-        struct domain       *d;
         struct vcpu         *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = xsm_getvcpucontext(d);
         if ( ret )
             goto getvcpucontext_out;
@@ -750,31 +695,25 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     getvcpucontext_out:
         xfree(c.nat);
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_getvcpuinfo:
     { 
-        struct domain *d;
         struct vcpu   *v;
         struct vcpu_runstate_info runstate;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = xsm_getvcpuinfo(d);
         if ( ret )
-            goto getvcpuinfo_out;
+            break;
 
         ret = -EINVAL;
         if ( op->u.getvcpuinfo.vcpu >= d->max_vcpus )
-            goto getvcpuinfo_out;
+            break;
 
         ret = -ESRCH;
         if ( (v = d->vcpu[op->u.getvcpuinfo.vcpu]) == NULL )
-            goto getvcpuinfo_out;
+            break;
 
         vcpu_runstate_get(v, &runstate);
 
@@ -787,25 +726,16 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
         if ( copy_to_guest(u_domctl, op, 1) )
             ret = -EFAULT;
-
-    getvcpuinfo_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_max_mem:
     {
-        struct domain *d;
         unsigned long new_max;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_setdomainmaxmem(d);
         if ( ret )
-            goto max_mem_out;
+            break;
 
         ret = -EINVAL;
         new_max = op->u.max_mem.max_memkb >> (PAGE_SHIFT-10);
@@ -819,77 +749,43 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         d->max_pages = new_max;
         ret = 0;
         spin_unlock(&d->page_alloc_lock);
-
-    max_mem_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_setdomainhandle:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_setdomainhandle(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         memcpy(d->handle, op->u.setdomainhandle.handle,
                sizeof(xen_domain_handle_t));
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_setdebugging:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = -EINVAL;
         if ( d == current->domain ) /* no domain_pause() */
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         ret = xsm_setdebugging(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domain_pause(d);
         d->debugger_attached = !!op->u.setdebugging.enable;
         domain_unpause(d); /* causes guest to latch new status */
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_irq_permission:
     {
-        struct domain *d;
         unsigned int pirq = op->u.irq_permission.pirq;
         int allow = op->u.irq_permission.allow_access;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         if ( pirq >= d->nr_pirqs )
             ret = -EINVAL;
         else if ( xsm_irq_permission(d, pirq, allow) )
@@ -898,14 +794,11 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             ret = irq_permit_access(d, pirq);
         else
             ret = irq_deny_access(d, pirq);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_iomem_permission:
     {
-        struct domain *d;
         unsigned long mfn = op->u.iomem_permission.first_mfn;
         unsigned long nr_mfns = op->u.iomem_permission.nr_mfns;
         int allow = op->u.iomem_permission.allow_access;
@@ -914,125 +807,78 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
             break;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         if ( xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
         else
             ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_settimeoffset:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_domain_settime(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domain_set_time_offset(d, op->u.settimeoffset.time_offset_seconds);
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_set_target:
     {
-        struct domain *d, *e;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
+        struct domain *e;
 
         ret = -ESRCH;
         e = get_domain_by_id(op->u.set_target.target);
         if ( e == NULL )
-            goto set_target_out;
+            break;
 
         ret = -EINVAL;
         if ( (d == e) || (d->target != NULL) )
         {
             put_domain(e);
-            goto set_target_out;
+            break;
         }
 
         ret = xsm_set_target(d, e);
         if ( ret ) {
             put_domain(e);
-            goto set_target_out;            
+            break;
         }
 
         /* Hold reference on @e until we destroy @d. */
         d->target = e;
 
         ret = 0;
-
-    set_target_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_subscribe:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_domctl(d, op->cmd);
-            if ( !ret )
-                d->suspend_evtchn = op->u.subscribe.port;
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_domctl(d, op->cmd);
+        if ( !ret )
+            d->suspend_evtchn = op->u.subscribe.port;
     }
     break;
 
     case XEN_DOMCTL_disable_migrate:
     {
-        struct domain *d;
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) != NULL )
-        {
-            ret = xsm_domctl(d, op->cmd);
-            if ( !ret )
-                d->disable_migrate = op->u.disable_migrate.disable;
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_domctl(d, op->cmd);
+        if ( !ret )
+            d->disable_migrate = op->u.disable_migrate.disable;
     }
     break;
 
     case XEN_DOMCTL_set_virq_handler:
     {
-        struct domain *d;
         uint32_t virq = op->u.set_virq_handler.virq;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_set_virq_handler(d, virq);
-            if ( !ret )
-                ret = set_global_virq_handler(d, virq);
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_set_virq_handler(d, virq);
+        if ( !ret )
+            ret = set_global_virq_handler(d, virq);
     }
     break;
 
@@ -1043,6 +889,10 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     domctl_lock_release();
 
+ domctl_out_unlock:
+    if ( d )
+        rcu_unlock_domain(d);
+
     return ret;
 }
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSeu-0002Tx-Oz; Fri, 30 Nov 2012 15:37:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSeq-0002Ok-EA
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:40 +0000
Received: from [85.158.139.211:64138] by server-10.bemta-5.messagelabs.com id
	D6/43-09257-4C2D8B05; Fri, 30 Nov 2012 15:37:40 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-3.tower-206.messagelabs.com!1354289856!18565546!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21676 invoked from network); 30 Nov 2012 15:37:37 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-3.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:37 -0000
X-TM-IMSS-Message-ID: <339226ef00027ac3@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 339226ef00027ac3 ;
	Fri, 30 Nov 2012 10:36:29 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSdD017785; 
	Fri, 30 Nov 2012 10:37:34 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:07 -0500
Message-Id: <1354289830-24642-21-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 20/23] xen: domctl XSM hook removal
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

A number of the domctl XSM hooks do nothing except pass the domain and
operation ID, making them redundant with the xsm_domctl hook. Remove
these redundant hooks.

The remaining domctls all use individual hooks because they pass extra
details of the call to the XSM module in order to allow a more
fine-grained access decision to be made - for example, considering the
exact device or memory range being set up for guest access.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c   |  76 +---------
 xen/common/domctl.c     |  59 +-------
 xen/include/xsm/dummy.h | 135 -----------------
 xen/include/xsm/xsm.h   | 161 ---------------------
 xen/xsm/dummy.c         |  27 ----
 xen/xsm/flask/hooks.c   | 378 ++++++++++++------------------------------------
 6 files changed, 98 insertions(+), 738 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 5e224fc..2630bdb 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -96,10 +96,6 @@ long arch_do_domctl(
 
         page = mfn_to_page(mfn);
 
-        ret = xsm_getpageframeinfo(d);
-        if ( ret )
-            break;
-
         if ( likely(get_page(page, d)) )
         {
             ret = 0;
@@ -140,10 +136,6 @@ long arch_do_domctl(
             struct page_info *page;
             xen_pfn_t *arr;
 
-            ret = xsm_getpageframeinfo(d);
-            if ( ret )
-                break;
-
             if ( unlikely(num > 1024) ||
                  unlikely(num != domctl->u.getpageframeinfo3.num) )
             {
@@ -229,10 +221,6 @@ long arch_do_domctl(
         int num = domctl->u.getpageframeinfo2.num;
         uint32_t *arr32;
 
-        ret = xsm_getpageframeinfo(d);
-        if ( ret )
-            break;
-
         if ( unlikely(num > 1024) )
         {
             ret = -E2BIG;
@@ -324,10 +312,6 @@ long arch_do_domctl(
         uint64_t mfn;
         struct page_info *page;
 
-        ret = xsm_getmemlist(d);
-        if ( ret )
-            break;
-
         if ( unlikely(d->is_dying) ) {
             ret = -EINVAL;
             break;
@@ -363,10 +347,6 @@ long arch_do_domctl(
         struct page_info *page;
         void *hypercall_page;
 
-        ret = xsm_hypercall_init(d);
-        if ( ret )
-            break;
-
         page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
 
         ret = -EACCES;
@@ -391,10 +371,6 @@ long arch_do_domctl(
     { 
         struct hvm_domain_context c = { .size = domctl->u.hvmcontext.size };
 
-        ret = xsm_hvmcontext(d, domctl->cmd);
-        if ( ret )
-            goto sethvmcontext_out;
-
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
             goto sethvmcontext_out;
@@ -421,10 +397,6 @@ long arch_do_domctl(
     { 
         struct hvm_domain_context c = { 0 };
 
-        ret = xsm_hvmcontext(d, domctl->cmd);
-        if ( ret )
-            goto gethvmcontext_out;
-
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
             goto gethvmcontext_out;
@@ -468,10 +440,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_gethvmcontext_partial:
     { 
-        ret = xsm_hvmcontext(d, domctl->cmd);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
             break;
@@ -487,10 +455,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_address_size:
     {
-        ret = xsm_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         switch ( domctl->u.address_size.size )
         {
         case 32:
@@ -508,10 +472,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_get_address_size:
     {
-        ret = xsm_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         domctl->u.address_size.size =
             is_pv_32on64_domain(d) ? 32 : BITS_PER_LONG;
 
@@ -524,10 +484,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_machine_address_size:
     {
-        ret = xsm_machine_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         ret = -EBUSY;
         if ( d->tot_pages > 0 )
             break;
@@ -540,10 +496,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_get_machine_address_size:
     {
-        ret = xsm_machine_address_size(d, domctl->cmd);
-        if ( ret )
-            break;
-
         domctl->u.address_size.size = d->arch.physaddr_bitsize;
 
         ret = 0;
@@ -557,10 +509,6 @@ long arch_do_domctl(
     {
         struct vcpu *v;
 
-        ret = xsm_sendtrigger(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( domctl->u.sendtrigger.vcpu >= MAX_VIRT_CPUS )
             break;
@@ -827,10 +775,6 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_pin_mem_cacheattr:
     {
-        ret = xsm_pin_mem_cacheattr(d);
-        if ( ret )
-            break;
-
         ret = hvm_set_mem_pinned_cacheattr(
             d, domctl->u.pin_mem_cacheattr.start,
             domctl->u.pin_mem_cacheattr.end,
@@ -846,10 +790,6 @@ long arch_do_domctl(
 
         evc = &domctl->u.ext_vcpucontext;
 
-        ret = xsm_ext_vcpucontext(d, domctl->cmd);
-        if ( ret )
-            break;
-
         ret = -ESRCH;
         if ( (evc->vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[evc->vcpu]) == NULL) )
@@ -1115,10 +1055,6 @@ long arch_do_domctl(
 
         evc = &domctl->u.vcpuextstate;
 
-        ret = xsm_vcpuextstate(d, domctl->cmd);
-        if ( ret )
-            goto vcpuextstate_out;
-
         ret = -ESRCH;
         if ( (evc->vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[evc->vcpu]) == NULL) )
@@ -1229,9 +1165,7 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_mem_sharing_op:
     {
-        ret = xsm_mem_sharing(d);
-        if ( !ret )
-            ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
+        ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
     }
     break;
 
@@ -1262,11 +1196,9 @@ long arch_do_domctl(
         if ( current->domain == d )
             break;
 
-        ret = xsm_mem_event_setup(d);
-        if ( !ret ) {
-            p2m = p2m_get_hostp2m(d);
-            p2m->access_required = domctl->u.access_required.access_required;
-        }
+        ret = 0;
+        p2m = p2m_get_hostp2m(d);
+        p2m->access_required = domctl->u.access_required.access_required;
     }
     break;
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 2a42a5f..6f792e9 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -289,10 +289,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( d == NULL )
             break;
 
-        ret = xsm_setvcpucontext(d);
-        if ( ret )
-            goto svc_out;
-
         ret = -EINVAL;
         if ( (d == current->domain) || /* no domain_pause() */
              (vcpu >= d->max_vcpus) || ((v = d->vcpu[vcpu]) == NULL) )
@@ -339,10 +335,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_pausedomain:
     {
-        ret = xsm_pausedomain(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( d != current->domain )
         {
@@ -354,10 +346,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_unpausedomain:
     {
-        ret = xsm_unpausedomain(d);
-        if ( ret )
-            break;
-
         domain_unpause_by_systemcontroller(d);
         ret = 0;
     }
@@ -365,10 +353,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_resumedomain:
     {
-        ret = xsm_resumedomain(d);
-        if ( ret )
-            break;
-
         domain_resume(d);
         ret = 0;
     }
@@ -452,10 +436,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
              (is_hvm_domain(d) && (max > MAX_HVM_VCPUS)) )
             break;
 
-        ret = xsm_max_vcpus(d);
-        if ( ret )
-            break;
-
         /* Until Xenoprof can dynamically grow its vcpu-s array... */
         if ( d->xenoprof )
         {
@@ -538,7 +518,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_destroydomain:
     {
-        ret = xsm_destroydomain(d) ? : domain_kill(d);
+        ret = domain_kill(d);
     }
     break;
 
@@ -547,10 +527,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     {
         struct vcpu *v;
 
-        ret = xsm_vcpuaffinity(op->cmd, d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( op->u.vcpuaffinity.vcpu >= d->max_vcpus )
             break;
@@ -581,10 +557,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_scheduler_op:
     {
-        ret = xsm_scheduler(d);
-        if ( ret )
-            break;
-
         ret = sched_adjust(d, &op->u.scheduler_op);
         if ( copy_to_guest(u_domctl, op, 1) )
             ret = -EFAULT;
@@ -629,10 +601,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         vcpu_guest_context_u c = { .nat = NULL };
         struct vcpu         *v;
 
-        ret = xsm_getvcpucontext(d);
-        if ( ret )
-            goto getvcpucontext_out;
-
         ret = -EINVAL;
         if ( op->u.vcpucontext.vcpu >= d->max_vcpus )
             goto getvcpucontext_out;
@@ -685,10 +653,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         struct vcpu   *v;
         struct vcpu_runstate_info runstate;
 
-        ret = xsm_getvcpuinfo(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         if ( op->u.getvcpuinfo.vcpu >= d->max_vcpus )
             break;
@@ -715,10 +679,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     {
         unsigned long new_max;
 
-        ret = xsm_setdomainmaxmem(d);
-        if ( ret )
-            break;
-
         ret = -EINVAL;
         new_max = op->u.max_mem.max_memkb >> (PAGE_SHIFT-10);
 
@@ -736,10 +696,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_setdomainhandle:
     {
-        ret = xsm_setdomainhandle(d);
-        if ( ret )
-            break;
-
         memcpy(d->handle, op->u.setdomainhandle.handle,
                sizeof(xen_domain_handle_t));
         ret = 0;
@@ -752,10 +708,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( d == current->domain ) /* no domain_pause() */
             break;
 
-        ret = xsm_setdebugging(d);
-        if ( ret )
-            break;
-
         domain_pause(d);
         d->debugger_attached = !!op->u.setdebugging.enable;
         domain_unpause(d); /* causes guest to latch new status */
@@ -800,10 +752,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_settimeoffset:
     {
-        ret = xsm_domain_settime(d);
-        if ( ret )
-            break;
-
         domain_set_time_offset(d, op->u.settimeoffset.time_offset_seconds);
         ret = 0;
     }
@@ -853,10 +801,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     case XEN_DOMCTL_set_virq_handler:
     {
         uint32_t virq = op->u.set_virq_handler.virq;
-
-        ret = xsm_set_virq_handler(d, virq);
-        if ( !ret )
-            ret = set_global_virq_handler(d, virq);
+        ret = set_global_virq_handler(d, virq);
     }
     break;
 
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 90682ae..9a5b34f 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -17,71 +17,16 @@ static XSM_INLINE void xsm_security_domaininfo(struct domain *d,
     return;
 }
 
-static XSM_INLINE int xsm_setvcpucontext(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_pausedomain(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_unpausedomain(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_resumedomain(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_domain_create(struct domain *d, u32 ssidref)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_max_vcpus(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_destroydomain(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_vcpuaffinity(int cmd, struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_scheduler(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE int xsm_getvcpucontext(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getvcpuinfo(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_domain_settime(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
 {
     return 0;
@@ -113,11 +58,6 @@ static XSM_INLINE int xsm_sysctl(int cmd)
     return 0;
 }
 
-static XSM_INLINE int xsm_set_virq_handler(struct domain *d, uint32_t virq)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_tbufcontrol(void)
 {
     return 0;
@@ -133,21 +73,6 @@ static XSM_INLINE int xsm_sched_id(void)
     return 0;
 }
 
-static XSM_INLINE int xsm_setdomainmaxmem(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_setdomainhandle(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_setdebugging(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_perfcontrol(void)
 {
     return 0;
@@ -505,36 +430,6 @@ static XSM_INLINE int xsm_shadow_control(struct domain *d, uint32_t op)
     return 0;
 }
 
-static XSM_INLINE int xsm_getpageframeinfo(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_getmemlist(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_hypercall_init(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_hvmcontext(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_address_size(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_machine_address_size(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
 {
     if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
@@ -570,11 +465,6 @@ static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_event_setup(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_mem_event_control(struct domain *d, int mode, int op)
 {
     if ( !IS_PRIV(current->domain) )
@@ -589,11 +479,6 @@ static XSM_INLINE int xsm_mem_event_op(struct domain *d, int op)
     return 0;
 }
 
-static XSM_INLINE int xsm_mem_sharing(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     if ( !IS_PRIV_FOR(current->domain, cd) )
@@ -720,11 +605,6 @@ static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *
     return 0;
 }
 
-static XSM_INLINE int xsm_sendtrigger(struct domain *d)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     return 0;
@@ -735,21 +615,6 @@ static XSM_INLINE int xsm_unbind_pt_irq(struct domain *d, struct xen_domctl_bind
     return 0;
 }
 
-static XSM_INLINE int xsm_pin_mem_cacheattr(struct domain *d)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
-static XSM_INLINE int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
-{
-    return 0;
-}
-
 static XSM_INLINE int xsm_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index b2f33d6..903c7cb 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -41,29 +41,14 @@ extern xsm_initcall_t __xsm_initcall_start[], __xsm_initcall_end[];
 struct xsm_operations {
     void (*security_domaininfo) (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info);
-    int (*setvcpucontext) (struct domain *d);
-    int (*pausedomain) (struct domain *d);
-    int (*unpausedomain) (struct domain *d);
-    int (*resumedomain) (struct domain *d);
     int (*domain_create) (struct domain *d, u32 ssidref);
-    int (*max_vcpus) (struct domain *d);
-    int (*destroydomain) (struct domain *d);
-    int (*vcpuaffinity) (int cmd, struct domain *d);
-    int (*scheduler) (struct domain *d);
     int (*getdomaininfo) (struct domain *d);
-    int (*getvcpucontext) (struct domain *d);
-    int (*getvcpuinfo) (struct domain *d);
-    int (*domain_settime) (struct domain *d);
     int (*set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
     int (*sysctl) (int cmd);
-    int (*set_virq_handler) (struct domain *d, uint32_t virq);
     int (*tbufcontrol) (void);
     int (*readconsole) (uint32_t clear);
     int (*sched_id) (void);
-    int (*setdomainmaxmem) (struct domain *d);
-    int (*setdomainhandle) (struct domain *d);
-    int (*setdebugging) (struct domain *d);
     int (*perfcontrol) (void);
     int (*debug_keys) (void);
     int (*getcpuinfo) (void);
@@ -141,21 +126,13 @@ struct xsm_operations {
 
 #ifdef CONFIG_X86
     int (*shadow_control) (struct domain *d, uint32_t op);
-    int (*getpageframeinfo) (struct domain *d);
-    int (*getmemlist) (struct domain *d);
-    int (*hypercall_init) (struct domain *d);
-    int (*hvmcontext) (struct domain *d, uint32_t op);
-    int (*address_size) (struct domain *d, uint32_t op);
-    int (*machine_address_size) (struct domain *d, uint32_t op);
     int (*hvm_param) (struct domain *d, unsigned long op);
     int (*hvm_set_pci_intx_level) (struct domain *d);
     int (*hvm_set_isa_irq_level) (struct domain *d);
     int (*hvm_set_pci_link_route) (struct domain *d);
     int (*hvm_inject_msi) (struct domain *d);
-    int (*mem_event_setup) (struct domain *d);
     int (*mem_event_control) (struct domain *d, int mode, int op);
     int (*mem_event_op) (struct domain *d, int op);
-    int (*mem_sharing) (struct domain *d);
     int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
     int (*apic) (struct domain *d, int cmd);
     int (*xen_settime) (void);
@@ -180,12 +157,8 @@ struct xsm_operations {
     int (*mmuext_op) (struct domain *d, struct domain *f);
     int (*update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
-    int (*sendtrigger) (struct domain *d);
     int (*bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
     int (*unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*pin_mem_cacheattr) (struct domain *d);
-    int (*ext_vcpucontext) (struct domain *d, uint32_t cmd);
-    int (*vcpuextstate) (struct domain *d, uint32_t cmd);
     int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
     int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
 #endif
@@ -203,71 +176,16 @@ static inline void xsm_security_domaininfo (struct domain *d,
     xsm_ops->security_domaininfo(d, info);
 }
 
-static inline int xsm_setvcpucontext(struct domain *d)
-{
-    return xsm_ops->setvcpucontext(d);
-}
-
-static inline int xsm_pausedomain (struct domain *d)
-{
-    return xsm_ops->pausedomain(d);
-}
-
-static inline int xsm_unpausedomain (struct domain *d)
-{
-    return xsm_ops->unpausedomain(d);
-}
-
-static inline int xsm_resumedomain (struct domain *d)
-{
-    return xsm_ops->resumedomain(d);
-}
-
 static inline int xsm_domain_create (struct domain *d, u32 ssidref)
 {
     return xsm_ops->domain_create(d, ssidref);
 }
 
-static inline int xsm_max_vcpus(struct domain *d)
-{
-    return xsm_ops->max_vcpus(d);
-}
-
-static inline int xsm_destroydomain (struct domain *d)
-{
-    return xsm_ops->destroydomain(d);
-}
-
-static inline int xsm_vcpuaffinity (int cmd, struct domain *d)
-{
-    return xsm_ops->vcpuaffinity(cmd, d);
-}
-
-static inline int xsm_scheduler (struct domain *d)
-{
-    return xsm_ops->scheduler(d);
-}
-
 static inline int xsm_getdomaininfo (struct domain *d)
 {
     return xsm_ops->getdomaininfo(d);
 }
 
-static inline int xsm_getvcpucontext (struct domain *d)
-{
-    return xsm_ops->getvcpucontext(d);
-}
-
-static inline int xsm_getvcpuinfo (struct domain *d)
-{
-    return xsm_ops->getvcpuinfo(d);
-}
-
-static inline int xsm_domain_settime (struct domain *d)
-{
-    return xsm_ops->domain_settime(d);
-}
-
 static inline int xsm_set_target (struct domain *d, struct domain *e)
 {
     return xsm_ops->set_target(d, e);
@@ -283,11 +201,6 @@ static inline int xsm_sysctl (int cmd)
     return xsm_ops->sysctl(cmd);
 }
 
-static inline int xsm_set_virq_handler (struct domain *d, uint32_t virq)
-{
-    return xsm_ops->set_virq_handler(d, virq);
-}
-
 static inline int xsm_tbufcontrol (void)
 {
     return xsm_ops->tbufcontrol();
@@ -303,21 +216,6 @@ static inline int xsm_sched_id (void)
     return xsm_ops->sched_id();
 }
 
-static inline int xsm_setdomainmaxmem (struct domain *d)
-{
-    return xsm_ops->setdomainmaxmem(d);
-}
-
-static inline int xsm_setdomainhandle (struct domain *d)
-{
-    return xsm_ops->setdomainhandle(d);
-}
-
-static inline int xsm_setdebugging (struct domain *d)
-{
-    return xsm_ops->setdebugging(d);
-}
-
 static inline int xsm_perfcontrol (void)
 {
     return xsm_ops->perfcontrol();
@@ -635,36 +533,6 @@ static inline int xsm_shadow_control (struct domain *d, uint32_t op)
     return xsm_ops->shadow_control(d, op);
 }
 
-static inline int xsm_getpageframeinfo (struct domain *d)
-{
-    return xsm_ops->getpageframeinfo(d);
-}
-
-static inline int xsm_getmemlist (struct domain *d)
-{
-    return xsm_ops->getmemlist(d);
-}
-
-static inline int xsm_hypercall_init (struct domain *d)
-{
-    return xsm_ops->hypercall_init(d);
-}
-
-static inline int xsm_hvmcontext (struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->hvmcontext(d, cmd);
-}
-
-static inline int xsm_address_size (struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->address_size(d, cmd);
-}
-
-static inline int xsm_machine_address_size (struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->machine_address_size(d, cmd);
-}
-
 static inline int xsm_hvm_param (struct domain *d, unsigned long op)
 {
     return xsm_ops->hvm_param(d, op);
@@ -690,11 +558,6 @@ static inline int xsm_hvm_inject_msi (struct domain *d)
     return xsm_ops->hvm_inject_msi(d);
 }
 
-static inline int xsm_mem_event_setup (struct domain *d)
-{
-    return xsm_ops->mem_event_setup(d);
-}
-
 static inline int xsm_mem_event_control (struct domain *d, int mode, int op)
 {
     return xsm_ops->mem_event_control(d, mode, op);
@@ -705,11 +568,6 @@ static inline int xsm_mem_event_op (struct domain *d, int op)
     return xsm_ops->mem_event_op(d, op);
 }
 
-static inline int xsm_mem_sharing (struct domain *d)
-{
-    return xsm_ops->mem_sharing(d);
-}
-
 static inline int xsm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
 {
     return xsm_ops->mem_sharing_op(d, cd, op);
@@ -807,11 +665,6 @@ static inline int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
     return xsm_ops->add_to_physmap(d1, d2);
 }
 
-static inline int xsm_sendtrigger(struct domain *d)
-{
-    return xsm_ops->sendtrigger(d);
-}
-
 static inline int xsm_bind_pt_irq(struct domain *d, 
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
@@ -824,20 +677,6 @@ static inline int xsm_unbind_pt_irq(struct domain *d,
     return xsm_ops->unbind_pt_irq(d, bind);
 }
 
-static inline int xsm_pin_mem_cacheattr(struct domain *d)
-{
-    return xsm_ops->pin_mem_cacheattr(d);
-}
-
-static inline int xsm_ext_vcpucontext(struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->ext_vcpucontext(d, cmd);
-}
-static inline int xsm_vcpuextstate(struct domain *d, uint32_t cmd)
-{
-    return xsm_ops->vcpuextstate(d, cmd);
-}
-
 static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return xsm_ops->ioport_permission(d, s, e, allow);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 3e6e5df..9bb86ef 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -30,29 +30,14 @@ struct xsm_operations dummy_xsm_ops;
 void xsm_fixup_ops (struct xsm_operations *ops)
 {
     set_to_dummy_if_null(ops, security_domaininfo);
-    set_to_dummy_if_null(ops, setvcpucontext);
-    set_to_dummy_if_null(ops, pausedomain);
-    set_to_dummy_if_null(ops, unpausedomain);
-    set_to_dummy_if_null(ops, resumedomain);
     set_to_dummy_if_null(ops, domain_create);
-    set_to_dummy_if_null(ops, max_vcpus);
-    set_to_dummy_if_null(ops, destroydomain);
-    set_to_dummy_if_null(ops, vcpuaffinity);
-    set_to_dummy_if_null(ops, scheduler);
     set_to_dummy_if_null(ops, getdomaininfo);
-    set_to_dummy_if_null(ops, getvcpucontext);
-    set_to_dummy_if_null(ops, getvcpuinfo);
-    set_to_dummy_if_null(ops, domain_settime);
     set_to_dummy_if_null(ops, set_target);
     set_to_dummy_if_null(ops, domctl);
     set_to_dummy_if_null(ops, sysctl);
-    set_to_dummy_if_null(ops, set_virq_handler);
     set_to_dummy_if_null(ops, tbufcontrol);
     set_to_dummy_if_null(ops, readconsole);
     set_to_dummy_if_null(ops, sched_id);
-    set_to_dummy_if_null(ops, setdomainmaxmem);
-    set_to_dummy_if_null(ops, setdomainhandle);
-    set_to_dummy_if_null(ops, setdebugging);
     set_to_dummy_if_null(ops, perfcontrol);
     set_to_dummy_if_null(ops, debug_keys);
     set_to_dummy_if_null(ops, getcpuinfo);
@@ -128,21 +113,13 @@ void xsm_fixup_ops (struct xsm_operations *ops)
 
 #ifdef CONFIG_X86
     set_to_dummy_if_null(ops, shadow_control);
-    set_to_dummy_if_null(ops, getpageframeinfo);
-    set_to_dummy_if_null(ops, getmemlist);
-    set_to_dummy_if_null(ops, hypercall_init);
-    set_to_dummy_if_null(ops, hvmcontext);
-    set_to_dummy_if_null(ops, address_size);
-    set_to_dummy_if_null(ops, machine_address_size);
     set_to_dummy_if_null(ops, hvm_param);
     set_to_dummy_if_null(ops, hvm_set_pci_intx_level);
     set_to_dummy_if_null(ops, hvm_set_isa_irq_level);
     set_to_dummy_if_null(ops, hvm_set_pci_link_route);
     set_to_dummy_if_null(ops, hvm_inject_msi);
-    set_to_dummy_if_null(ops, mem_event_setup);
     set_to_dummy_if_null(ops, mem_event_control);
     set_to_dummy_if_null(ops, mem_event_op);
-    set_to_dummy_if_null(ops, mem_sharing);
     set_to_dummy_if_null(ops, mem_sharing_op);
     set_to_dummy_if_null(ops, apic);
     set_to_dummy_if_null(ops, xen_settime);
@@ -163,12 +140,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, update_va_mapping);
     set_to_dummy_if_null(ops, add_to_physmap);
     set_to_dummy_if_null(ops, remove_from_physmap);
-    set_to_dummy_if_null(ops, sendtrigger);
     set_to_dummy_if_null(ops, bind_pt_irq);
     set_to_dummy_if_null(ops, unbind_pt_irq);
-    set_to_dummy_if_null(ops, pin_mem_cacheattr);
-    set_to_dummy_if_null(ops, ext_vcpucontext);
-    set_to_dummy_if_null(ops, vcpuextstate);
     set_to_dummy_if_null(ops, ioport_permission);
     set_to_dummy_if_null(ops, ioport_mapping);
 #endif
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index e815ea5..f0216e0 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -484,26 +484,6 @@ static void flask_security_domaininfo(struct domain *d,
     info->ssidref = domain_sid(d);
 }
 
-static int flask_setvcpucontext(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT);
-}
-
-static int flask_pausedomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
-}
-
-static int flask_unpausedomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
-}
-
-static int flask_resumedomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__RESUME);
-}
-
 static int flask_domain_create(struct domain *d, u32 ssidref)
 {
     int rc;
@@ -532,66 +512,11 @@ static int flask_domain_create(struct domain *d, u32 ssidref)
     return rc;
 }
 
-static int flask_max_vcpus(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS);
-}
-
-static int flask_destroydomain(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__DESTROY);
-}
-
-static int flask_vcpuaffinity(int cmd, struct domain *d)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_setvcpuaffinity:
-        perm = DOMAIN__SETVCPUAFFINITY;
-        break;
-    case XEN_DOMCTL_getvcpuaffinity:
-        perm = DOMAIN__GETVCPUAFFINITY;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm );
-}
-
-static int flask_scheduler(struct domain *d)
-{
-    int rc = 0;
-
-    rc = domain_has_xen(current->domain, XEN__SCHEDULER);
-    if ( rc )
-        return rc;
-
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SCHEDULER);
-}
-
 static int flask_getdomaininfo(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO);
 }
 
-static int flask_getvcpucontext(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT);
-}
-
-static int flask_getvcpuinfo(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO);
-}
-
-static int flask_domain_settime(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
-}
-
 static int flask_set_target(struct domain *d, struct domain *t)
 {
     int rc;
@@ -622,62 +547,121 @@ static int flask_domctl(struct domain *d, int cmd)
     {
     /* These have individual XSM hooks (common/domctl.c) */
     case XEN_DOMCTL_createdomain:
+    case XEN_DOMCTL_getdomaininfo:
+    case XEN_DOMCTL_irq_permission:
+    case XEN_DOMCTL_iomem_permission:
+    case XEN_DOMCTL_set_target:
+#ifdef CONFIG_X86
+    /* These have individual XSM hooks (arch/x86/domctl.c) */
+    case XEN_DOMCTL_shadow_op:
+    case XEN_DOMCTL_ioport_permission:
+    case XEN_DOMCTL_bind_pt_irq:
+    case XEN_DOMCTL_unbind_pt_irq:
+    case XEN_DOMCTL_memory_mapping:
+    case XEN_DOMCTL_ioport_mapping:
+    case XEN_DOMCTL_mem_event_op:
+    /* These have individual XSM hooks (drivers/passthrough/iommu.c) */
+    case XEN_DOMCTL_get_device_group:
+    case XEN_DOMCTL_test_assign_device:
+    case XEN_DOMCTL_assign_device:
+    case XEN_DOMCTL_deassign_device:
+#endif
+        return 0;
+
     case XEN_DOMCTL_destroydomain:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__DESTROY);
+
     case XEN_DOMCTL_pausedomain:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__PAUSE);
+
     case XEN_DOMCTL_unpausedomain:
-    case XEN_DOMCTL_getdomaininfo:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
+
     case XEN_DOMCTL_setvcpuaffinity:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUAFFINITY);
+
+    case XEN_DOMCTL_getvcpuaffinity:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUAFFINITY);
+
+    case XEN_DOMCTL_resumedomain:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__RESUME);
+
+    case XEN_DOMCTL_scheduler_op:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SCHEDULER);
+
+    case XEN_DOMCTL_max_vcpus:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS);
+
     case XEN_DOMCTL_max_mem:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM);
+
+    case XEN_DOMCTL_setdomainhandle:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE);
+
     case XEN_DOMCTL_setvcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT);
+
     case XEN_DOMCTL_getvcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT);
+
     case XEN_DOMCTL_getvcpuinfo:
-    case XEN_DOMCTL_max_vcpus:
-    case XEN_DOMCTL_scheduler_op:
-    case XEN_DOMCTL_setdomainhandle:
-    case XEN_DOMCTL_setdebugging:
-    case XEN_DOMCTL_irq_permission:
-    case XEN_DOMCTL_iomem_permission:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO);
+
     case XEN_DOMCTL_settimeoffset:
-    case XEN_DOMCTL_getvcpuaffinity:
-    case XEN_DOMCTL_resumedomain:
-    case XEN_DOMCTL_set_target:
-    case XEN_DOMCTL_set_virq_handler:
-#ifdef CONFIG_X86
-    /* These have individual XSM hooks (arch/x86/domctl.c) */
-    case XEN_DOMCTL_shadow_op:
-    case XEN_DOMCTL_ioport_permission:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETTIME);
+
+    case XEN_DOMCTL_setdebugging:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
+
     case XEN_DOMCTL_getpageframeinfo:
     case XEN_DOMCTL_getpageframeinfo2:
     case XEN_DOMCTL_getpageframeinfo3:
+        return current_has_perm(d, SECCLASS_MMU, MMU__PAGEINFO);
+
     case XEN_DOMCTL_getmemlist:
+        return current_has_perm(d, SECCLASS_MMU, MMU__PAGELIST);
+
     case XEN_DOMCTL_hypercall_init:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__HYPERCALL);
+
     case XEN_DOMCTL_sethvmcontext:
+        return current_has_perm(d, SECCLASS_HVM, HVM__SETHVMC);
+
     case XEN_DOMCTL_gethvmcontext:
     case XEN_DOMCTL_gethvmcontext_partial:
+        return current_has_perm(d, SECCLASS_HVM, HVM__GETHVMC);
+
     case XEN_DOMCTL_set_address_size:
-    case XEN_DOMCTL_get_address_size:
     case XEN_DOMCTL_set_machine_address_size:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETADDRSIZE);
+
+    case XEN_DOMCTL_get_address_size:
     case XEN_DOMCTL_get_machine_address_size:
-    case XEN_DOMCTL_sendtrigger:
-    case XEN_DOMCTL_bind_pt_irq:
-    case XEN_DOMCTL_unbind_pt_irq:
-    case XEN_DOMCTL_memory_mapping:
-    case XEN_DOMCTL_ioport_mapping:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETADDRSIZE);
+
+    case XEN_DOMCTL_mem_sharing_op:
+        return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
+
     case XEN_DOMCTL_pin_mem_cacheattr:
+        return current_has_perm(d, SECCLASS_HVM, HVM__CACHEATTR);
+
     case XEN_DOMCTL_set_ext_vcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETEXTVCPUCONTEXT);
+
     case XEN_DOMCTL_get_ext_vcpucontext:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETEXTVCPUCONTEXT);
+
     case XEN_DOMCTL_setvcpuextstate:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUEXTSTATE);
+
     case XEN_DOMCTL_getvcpuextstate:
-    case XEN_DOMCTL_mem_event_op:
-    case XEN_DOMCTL_mem_sharing_op:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUEXTSTATE);
+
+    case XEN_DOMCTL_sendtrigger:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
+
     case XEN_DOMCTL_set_access_required:
-    /* These have individual XSM hooks (drivers/passthrough/iommu.c) */
-    case XEN_DOMCTL_get_device_group:
-    case XEN_DOMCTL_test_assign_device:
-    case XEN_DOMCTL_assign_device:
-    case XEN_DOMCTL_deassign_device:
-#endif
-        return 0;
+        return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 
     case XEN_DOMCTL_debug_op:
     case XEN_DOMCTL_gdbsx_guestmemio:
@@ -691,6 +675,9 @@ static int flask_domctl(struct domain *d, int cmd)
     case XEN_DOMCTL_suppress_spurious_page_faults:
         return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO);
 
+    case XEN_DOMCTL_set_virq_handler:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
+
     case XEN_DOMCTL_set_cpuid:
         return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID);
 
@@ -741,11 +728,6 @@ static int flask_sysctl(int cmd)
     }
 }
 
-static int flask_set_virq_handler(struct domain *d, uint32_t virq)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
-}
-
 static int flask_tbufcontrol(void)
 {
     return domain_has_xen(current->domain, XEN__TBUFCONTROL);
@@ -766,21 +748,6 @@ static int flask_sched_id(void)
     return domain_has_xen(current->domain, XEN__SCHEDULER);
 }
 
-static int flask_setdomainmaxmem(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM);
-}
-
-static int flask_setdomainhandle(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE);
-}
-
-static int flask_setdebugging(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING);
-}
-
 static int flask_debug_keys(void)
 {
     return domain_has_xen(current->domain, XEN__DEBUG);
@@ -1174,82 +1141,6 @@ static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end,
     return flask_ioport_permission(d, start, end, access);
 }
 
-static int flask_getpageframeinfo(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_MMU, MMU__PAGEINFO);
-}
-
-static int flask_getmemlist(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_MMU, MMU__PAGELIST);
-}
-
-static int flask_hypercall_init(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__HYPERCALL);
-}
-
-static int flask_hvmcontext(struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_sethvmcontext:
-        perm = HVM__SETHVMC;
-        break;
-    case XEN_DOMCTL_gethvmcontext:
-    case XEN_DOMCTL_gethvmcontext_partial:
-        perm = HVM__GETHVMC;
-        break;
-    case HVMOP_track_dirty_vram:
-        perm = HVM__TRACKDIRTYVRAM;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_HVM, perm);
-}
-
-static int flask_address_size(struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_set_address_size:
-        perm = DOMAIN__SETADDRSIZE;
-        break;
-    case XEN_DOMCTL_get_address_size:
-        perm = DOMAIN__GETADDRSIZE;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm);
-}
-
-static int flask_machine_address_size(struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_set_machine_address_size:
-        perm = DOMAIN__SETADDRSIZE;
-        break;
-    case XEN_DOMCTL_get_machine_address_size:
-        perm = DOMAIN__GETADDRSIZE;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, perm);
-}
-
 static int flask_hvm_param(struct domain *d, unsigned long op)
 {
     u32 perm;
@@ -1292,11 +1183,6 @@ static int flask_hvm_inject_msi(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
-static int flask_mem_event_setup(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
-}
-
 static int flask_mem_event_control(struct domain *d, int mode, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
@@ -1307,11 +1193,6 @@ static int flask_mem_event_op(struct domain *d, int op)
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
 }
 
-static int flask_mem_sharing(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__MEM_SHARING);
-}
-
 static int flask_mem_sharing_op(struct domain *d, struct domain *cd, int op)
 {
     int rc = current_has_perm(cd, SECCLASS_HVM, HVM__MEM_SHARING);
@@ -1499,11 +1380,6 @@ static int flask_remove_from_physmap(struct domain *d1, struct domain *d2)
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP);
 }
 
-static int flask_sendtrigger(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__TRIGGER);
-}
-
 static int flask_get_device_group(uint32_t machine_bdf)
 {
     u32 rsid;
@@ -1597,78 +1473,20 @@ static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq
 {
     return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
-
-static int flask_pin_mem_cacheattr (struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__CACHEATTR);
-}
-
-static int flask_ext_vcpucontext (struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-    case XEN_DOMCTL_set_ext_vcpucontext:
-        perm = DOMAIN__SETEXTVCPUCONTEXT;
-        break;
-    case XEN_DOMCTL_get_ext_vcpucontext:
-        perm = DOMAIN__GETEXTVCPUCONTEXT;
-        break;
-    default:
-        return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm);
-}
-
-static int flask_vcpuextstate (struct domain *d, uint32_t cmd)
-{
-    u32 perm;
-
-    switch ( cmd )
-    {
-        case XEN_DOMCTL_setvcpuextstate:
-            perm = DOMAIN__SETVCPUEXTSTATE;
-        break;
-        case XEN_DOMCTL_getvcpuextstate:
-            perm = DOMAIN__GETVCPUEXTSTATE;
-        break;
-        default:
-            return -EPERM;
-    }
-
-    return current_has_perm(d, SECCLASS_DOMAIN, perm);
-}
 #endif
 
 long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
 
 static struct xsm_operations flask_ops = {
     .security_domaininfo = flask_security_domaininfo,
-    .setvcpucontext = flask_setvcpucontext,
-    .pausedomain = flask_pausedomain,
-    .unpausedomain = flask_unpausedomain,    
-    .resumedomain = flask_resumedomain,    
     .domain_create = flask_domain_create,
-    .max_vcpus = flask_max_vcpus,
-    .destroydomain = flask_destroydomain,
-    .vcpuaffinity = flask_vcpuaffinity,
-    .scheduler = flask_scheduler,
     .getdomaininfo = flask_getdomaininfo,
-    .getvcpucontext = flask_getvcpucontext,
-    .getvcpuinfo = flask_getvcpuinfo,
-    .domain_settime = flask_domain_settime,
     .set_target = flask_set_target,
     .domctl = flask_domctl,
     .sysctl = flask_sysctl,
-    .set_virq_handler = flask_set_virq_handler,
     .tbufcontrol = flask_tbufcontrol,
     .readconsole = flask_readconsole,
     .sched_id = flask_sched_id,
-    .setdomainmaxmem = flask_setdomainmaxmem,
-    .setdomainhandle = flask_setdomainhandle,
-    .setdebugging = flask_setdebugging,
     .perfcontrol = flask_perfcontrol,
     .debug_keys = flask_debug_keys,
     .getcpuinfo = flask_getcpuinfo,
@@ -1740,21 +1558,13 @@ static struct xsm_operations flask_ops = {
 
 #ifdef CONFIG_X86
     .shadow_control = flask_shadow_control,
-    .getpageframeinfo = flask_getpageframeinfo,
-    .getmemlist = flask_getmemlist,
-    .hypercall_init = flask_hypercall_init,
-    .hvmcontext = flask_hvmcontext,
-    .address_size = flask_address_size,
-    .machine_address_size = flask_machine_address_size,
     .hvm_param = flask_hvm_param,
     .hvm_set_pci_intx_level = flask_hvm_set_pci_intx_level,
     .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
     .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
     .hvm_inject_msi = flask_hvm_inject_msi,
-    .mem_event_setup = flask_mem_event_setup,
     .mem_event_control = flask_mem_event_control,
     .mem_event_op = flask_mem_event_op,
-    .mem_sharing = flask_mem_sharing,
     .mem_sharing_op = flask_mem_sharing_op,
     .apic = flask_apic,
     .xen_settime = flask_xen_settime,
@@ -1775,16 +1585,12 @@ static struct xsm_operations flask_ops = {
     .update_va_mapping = flask_update_va_mapping,
     .add_to_physmap = flask_add_to_physmap,
     .remove_from_physmap = flask_remove_from_physmap,
-    .sendtrigger = flask_sendtrigger,
     .get_device_group = flask_get_device_group,
     .test_assign_device = flask_test_assign_device,
     .assign_device = flask_assign_device,
     .deassign_device = flask_deassign_device,
     .bind_pt_irq = flask_bind_pt_irq,
     .unbind_pt_irq = flask_unbind_pt_irq,
-    .pin_mem_cacheattr = flask_pin_mem_cacheattr,
-    .ext_vcpucontext = flask_ext_vcpucontext,
-    .vcpuextstate = flask_vcpuextstate,
     .ioport_permission = flask_ioport_permission,
     .ioport_mapping = flask_ioport_mapping,
 #endif
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSet-0002TE-El; Fri, 30 Nov 2012 15:37:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSep-0002OB-Tu
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:40 +0000
Received: from [85.158.139.211:64022] by server-15.bemta-5.messagelabs.com id
	6F/8B-26920-2C2D8B05; Fri, 30 Nov 2012 15:37:38 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-8.tower-206.messagelabs.com!1354289855!18547815!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24427 invoked from network); 30 Nov 2012 15:37:36 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-8.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:36 -0000
X-TM-IMSS-Message-ID: <339221f000027abe@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 339221f000027abe ;
	Fri, 30 Nov 2012 10:36:27 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSdB017785; 
	Fri, 30 Nov 2012 10:37:33 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:05 -0500
Message-Id: <1354289830-24642-19-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Tim Deegan <tim@xen.org>, Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: [Xen-devel] [PATCH 18/23] xen/arch/*: add struct domain parameter
	to arch_do_domctl
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Since the arch-independent do_domctl function now RCU locks the domain
specified by op->domain, pass the struct domain to the arch-specific
domctl function and remove the duplicate per-subfunction locking.

This also removes two get_domain/put_domain call pairs (in
XEN_DOMCTL_assign_device and XEN_DOMCTL_deassign_device), replacing them
with RCU locking.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@citrix.com>
Cc: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/domctl.c           |   2 +-
 xen/arch/x86/domctl.c           | 434 +++++++---------------------------------
 xen/common/domctl.c             |   2 +-
 xen/drivers/passthrough/iommu.c |  31 +--
 xen/include/xen/hypercall.h     |   2 +-
 xen/include/xen/iommu.h         |   3 +-
 6 files changed, 76 insertions(+), 398 deletions(-)

diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c
index cf16791..d54a387 100644
--- a/xen/arch/arm/domctl.c
+++ b/xen/arch/arm/domctl.c
@@ -10,7 +10,7 @@
 #include <xen/errno.h>
 #include <public/domctl.h>
 
-long arch_do_domctl(struct xen_domctl *domctl,
+long arch_do_domctl(struct xen_domctl *domctl, struct domain *d,
                     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     return -ENOSYS;
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 34e6223..5e224fc 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -47,7 +47,7 @@ static int gdbsx_guest_mem_io(
 }
 
 long arch_do_domctl(
-    struct xen_domctl *domctl,
+    struct xen_domctl *domctl, struct domain *d,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
@@ -57,23 +57,15 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_shadow_op:
     {
-        struct domain *d;
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = paging_domctl(d,
-                                &domctl->u.shadow_op,
-                                guest_handle_cast(u_domctl, void));
-            rcu_unlock_domain(d);
-            copy_to_guest(u_domctl, domctl, 1);
-        } 
+        ret = paging_domctl(d,
+                            &domctl->u.shadow_op,
+                            guest_handle_cast(u_domctl, void));
+        copy_to_guest(u_domctl, domctl, 1);
     }
     break;
 
     case XEN_DOMCTL_ioport_permission:
     {
-        struct domain *d;
         unsigned int fp = domctl->u.ioport_permission.first_port;
         unsigned int np = domctl->u.ioport_permission.nr_ports;
         int allow = domctl->u.ioport_permission.allow_access;
@@ -82,10 +74,6 @@ long arch_do_domctl(
         if ( (fp + np) > 65536 )
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
-            break;
-
         if ( np == 0 )
             ret = 0;
         else if ( xsm_ioport_permission(d, fp, fp + np - 1, allow) )
@@ -94,8 +82,6 @@ long arch_do_domctl(
             ret = ioports_permit_access(d, fp, fp + np - 1);
         else
             ret = ioports_deny_access(d, fp, fp + np - 1);
-
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -103,23 +89,16 @@ long arch_do_domctl(
     {
         struct page_info *page;
         unsigned long mfn = domctl->u.getpageframeinfo.gmfn;
-        domid_t dom = domctl->domain;
-        struct domain *d;
 
         ret = -EINVAL;
-
-        if ( unlikely(!mfn_valid(mfn)) ||
-             unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
+        if ( unlikely(!mfn_valid(mfn)) )
             break;
 
         page = mfn_to_page(mfn);
 
         ret = xsm_getpageframeinfo(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         if ( likely(get_page(page, d)) )
         {
@@ -149,8 +128,6 @@ long arch_do_domctl(
             put_page(page);
         }
 
-        rcu_unlock_domain(d);
-
         copy_to_guest(u_domctl, domctl, 1);
     }
     break;
@@ -160,27 +137,17 @@ long arch_do_domctl(
         {
             unsigned int n, j;
             unsigned int num = domctl->u.getpageframeinfo3.num;
-            domid_t dom = domctl->domain;
-            struct domain *d;
             struct page_info *page;
             xen_pfn_t *arr;
 
-            ret = -ESRCH;
-            if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-                break;
-
             ret = xsm_getpageframeinfo(d);
             if ( ret )
-            {
-                rcu_unlock_domain(d);
                 break;
-            }
 
             if ( unlikely(num > 1024) ||
                  unlikely(num != domctl->u.getpageframeinfo3.num) )
             {
                 ret = -E2BIG;
-                rcu_unlock_domain(d);
                 break;
             }
 
@@ -188,7 +155,6 @@ long arch_do_domctl(
             if ( !page )
             {
                 ret = -ENOMEM;
-                rcu_unlock_domain(d);
                 break;
             }
             arr = page_to_virt(page);
@@ -254,7 +220,6 @@ long arch_do_domctl(
 
             free_domheap_page(virt_to_page(arr));
 
-            rcu_unlock_domain(d);
             break;
         }
         /* fall thru */
@@ -262,25 +227,15 @@ long arch_do_domctl(
     {
         int n,j;
         int num = domctl->u.getpageframeinfo2.num;
-        domid_t dom = domctl->domain;
-        struct domain *d;
         uint32_t *arr32;
-        ret = -ESRCH;
-
-        if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-            break;
 
         ret = xsm_getpageframeinfo(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         if ( unlikely(num > 1024) )
         {
             ret = -E2BIG;
-            rcu_unlock_domain(d);
             break;
         }
 
@@ -288,7 +243,6 @@ long arch_do_domctl(
         if ( !arr32 )
         {
             ret = -ENOMEM;
-            rcu_unlock_domain(d);
             break;
         }
  
@@ -360,78 +314,58 @@ long arch_do_domctl(
         }
 
         free_xenheap_page(arr32);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_getmemlist:
     {
         int i;
-        struct domain *d = rcu_lock_domain_by_id(domctl->domain);
         unsigned long max_pfns = domctl->u.getmemlist.max_pfns;
         uint64_t mfn;
         struct page_info *page;
 
-        ret = -EINVAL;
-        if ( d != NULL )
-        {
-            ret = xsm_getmemlist(d);
-            if ( ret )
-            {
-                rcu_unlock_domain(d);
-                break;
-            }
+        ret = xsm_getmemlist(d);
+        if ( ret )
+            break;
 
-            spin_lock(&d->page_alloc_lock);
+        if ( unlikely(d->is_dying) ) {
+            ret = -EINVAL;
+            break;
+        }
 
-            if ( unlikely(d->is_dying) ) {
-                spin_unlock(&d->page_alloc_lock);
-                goto getmemlist_out;
-            }
+        spin_lock(&d->page_alloc_lock);
 
-            ret = i = 0;
-            page_list_for_each(page, &d->page_list)
+        ret = i = 0;
+        page_list_for_each(page, &d->page_list)
+        {
+            if ( i >= max_pfns )
+                break;
+            mfn = page_to_mfn(page);
+            if ( copy_to_guest_offset(domctl->u.getmemlist.buffer,
+                                      i, &mfn, 1) )
             {
-                if ( i >= max_pfns )
-                    break;
-                mfn = page_to_mfn(page);
-                if ( copy_to_guest_offset(domctl->u.getmemlist.buffer,
-                                          i, &mfn, 1) )
-                {
-                    ret = -EFAULT;
-                    break;
-                }
-                ++i;
+                ret = -EFAULT;
+                break;
             }
-            
-            spin_unlock(&d->page_alloc_lock);
-
-            domctl->u.getmemlist.num_pfns = i;
-            copy_to_guest(u_domctl, domctl, 1);
-        getmemlist_out:
-            rcu_unlock_domain(d);
+            ++i;
         }
+
+        spin_unlock(&d->page_alloc_lock);
+
+        domctl->u.getmemlist.num_pfns = i;
+        copy_to_guest(u_domctl, domctl, 1);
     }
     break;
 
     case XEN_DOMCTL_hypercall_init:
     {
-        struct domain *d = rcu_lock_domain_by_id(domctl->domain);
         unsigned long gmfn = domctl->u.hypercall_init.gmfn;
         struct page_info *page;
         void *hypercall_page;
 
-        ret = -ESRCH;
-        if ( unlikely(d == NULL) )
-            break;
-
         ret = xsm_hypercall_init(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
 
@@ -440,7 +374,6 @@ long arch_do_domctl(
         {
             if ( page )
                 put_page(page);
-            rcu_unlock_domain(d);
             break;
         }
 
@@ -451,19 +384,12 @@ long arch_do_domctl(
         unmap_domain_page(hypercall_page);
 
         put_page_and_type(page);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_sethvmcontext:
     { 
         struct hvm_domain_context c = { .size = domctl->u.hvmcontext.size };
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
 
         ret = xsm_hvmcontext(d, domctl->cmd);
         if ( ret )
@@ -488,19 +414,12 @@ long arch_do_domctl(
     sethvmcontext_out:
         if ( c.data != NULL )
             xfree(c.data);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gethvmcontext:
     { 
         struct hvm_domain_context c = { 0 };
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
 
         ret = xsm_hvmcontext(d, domctl->cmd);
         if ( ret )
@@ -544,53 +463,33 @@ long arch_do_domctl(
 
         if ( c.data != NULL )
             xfree(c.data);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gethvmcontext_partial:
     { 
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_hvmcontext(d, domctl->cmd);
         if ( ret )
-            goto gethvmcontext_partial_out;
+            break;
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
-            goto gethvmcontext_partial_out;
+            break;
 
         domain_pause(d);
         ret = hvm_save_one(d, domctl->u.hvmcontext_partial.type,
                            domctl->u.hvmcontext_partial.instance,
                            domctl->u.hvmcontext_partial.buffer);
         domain_unpause(d);
-
-    gethvmcontext_partial_out:
-        rcu_unlock_domain(d);
     }
     break;
 
 
     case XEN_DOMCTL_set_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_address_size(d, domctl->cmd);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         switch ( domctl->u.address_size.size )
         {
@@ -604,31 +503,19 @@ long arch_do_domctl(
             ret = (domctl->u.address_size.size == BITS_PER_LONG) ? 0 : -EINVAL;
             break;
         }
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_get_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_address_size(d, domctl->cmd);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domctl->u.address_size.size =
             is_pv_32on64_domain(d) ? 32 : BITS_PER_LONG;
 
         ret = 0;
-        rcu_unlock_domain(d);
 
         if ( copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
@@ -637,76 +524,51 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_machine_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_machine_address_size(d, domctl->cmd);
         if ( ret )
-            goto set_machine_address_size_out;
+            break;
 
         ret = -EBUSY;
         if ( d->tot_pages > 0 )
-            goto set_machine_address_size_out;
+            break;
 
         d->arch.physaddr_bitsize = domctl->u.address_size.size;
 
         ret = 0;
-    set_machine_address_size_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_get_machine_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_machine_address_size(d, domctl->cmd);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domctl->u.address_size.size = d->arch.physaddr_bitsize;
 
         ret = 0;
-        rcu_unlock_domain(d);
 
         if ( copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
-
-
     }
     break;
 
     case XEN_DOMCTL_sendtrigger:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_sendtrigger(d);
         if ( ret )
-            goto sendtrigger_out;
+            break;
 
         ret = -EINVAL;
         if ( domctl->u.sendtrigger.vcpu >= MAX_VIRT_CPUS )
-            goto sendtrigger_out;
+            break;
 
         ret = -ESRCH;
         if ( domctl->u.sendtrigger.vcpu >= d->max_vcpus ||
              (v = d->vcpu[domctl->u.sendtrigger.vcpu]) == NULL )
-            goto sendtrigger_out;
+            break;
 
         switch ( domctl->u.sendtrigger.trigger )
         {
@@ -743,34 +605,27 @@ long arch_do_domctl(
         default:
             ret = -ENOSYS;
         }
-
-    sendtrigger_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_bind_pt_irq:
     {
-        struct domain * d;
         xen_domctl_bind_pt_irq_t * bind;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
         bind = &(domctl->u.bind_pt_irq);
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d) )
-            goto bind_out;
+            break;
 
         ret = xsm_bind_pt_irq(d, bind);
         if ( ret )
-            goto bind_out;
+            break;
 
         ret = -EPERM;
         if ( !IS_PRIV(current->domain) &&
              !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto bind_out;
+            break;
 
         ret = -ESRCH;
         if ( iommu_enabled )
@@ -782,30 +637,23 @@ long arch_do_domctl(
         if ( ret < 0 )
             printk(XENLOG_G_ERR "pt_irq_create_bind failed (%ld) for dom%d\n",
                    ret, d->domain_id);
-
-    bind_out:
-        rcu_unlock_domain(d);
     }
     break;    
 
     case XEN_DOMCTL_unbind_pt_irq:
     {
-        struct domain * d;
         xen_domctl_bind_pt_irq_t * bind;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
         bind = &(domctl->u.bind_pt_irq);
 
         ret = -EPERM;
         if ( !IS_PRIV(current->domain) &&
              !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto unbind_out;
+            break;
 
         ret = xsm_unbind_pt_irq(d, bind);
         if ( ret )
-            goto unbind_out;
+            break;
 
         if ( iommu_enabled )
         {
@@ -816,15 +664,11 @@ long arch_do_domctl(
         if ( ret < 0 )
             printk(XENLOG_G_ERR "pt_irq_destroy_bind failed (%ld) for dom%d\n",
                    ret, d->domain_id);
-
-    unbind_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_memory_mapping:
     {
-        struct domain *d;
         unsigned long gfn = domctl->u.memory_mapping.first_gfn;
         unsigned long mfn = domctl->u.memory_mapping.first_mfn;
         unsigned long nr_mfns = domctl->u.memory_mapping.nr_mfns;
@@ -842,15 +686,9 @@ long arch_do_domctl(
              !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
-            break;
-
         ret = xsm_iomem_mapping(d, mfn, mfn + nr_mfns - 1, add);
-        if ( ret ) {
-            rcu_unlock_domain(d);
+        if ( ret )
             break;
-        }
 
         if ( add )
         {
@@ -897,15 +735,12 @@ long arch_do_domctl(
                        ret, add ? "removing" : "denying", d->domain_id,
                        mfn, mfn + nr_mfns - 1);
         }
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_ioport_mapping:
     {
 #define MAX_IOPORTS    0x10000
-        struct domain *d;
         struct hvm_iommu *hd;
         unsigned int fgp = domctl->u.ioport_mapping.first_gport;
         unsigned int fmp = domctl->u.ioport_mapping.first_mport;
@@ -929,15 +764,9 @@ long arch_do_domctl(
              !ioports_access_permitted(current->domain, fmp, fmp + np - 1) )
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
-            break;
-
         ret = xsm_ioport_mapping(d, fmp, fmp + np - 1, add);
-        if ( ret ) {
-            rcu_unlock_domain(d);
+        if ( ret )
             break;
-        }
 
         hd = domain_hvm_iommu(d);
         if ( add )
@@ -993,30 +822,19 @@ long arch_do_domctl(
                        "ioport_map: error %ld denying dom%d access to [%x,%x]\n",
                        ret, d->domain_id, fmp, fmp + np - 1);
         }
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_pin_mem_cacheattr:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_pin_mem_cacheattr(d);
         if ( ret )
-            goto pin_out;
+            break;
 
         ret = hvm_set_mem_pinned_cacheattr(
             d, domctl->u.pin_mem_cacheattr.start,
             domctl->u.pin_mem_cacheattr.end,
             domctl->u.pin_mem_cacheattr.type);
-
-    pin_out:
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -1024,19 +842,13 @@ long arch_do_domctl(
     case XEN_DOMCTL_get_ext_vcpucontext:
     {
         struct xen_domctl_ext_vcpucontext *evc;
-        struct domain *d;
         struct vcpu *v;
 
         evc = &domctl->u.ext_vcpucontext;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_ext_vcpucontext(d, domctl->cmd);
         if ( ret )
-            goto ext_vcpucontext_out;
+            break;
 
         ret = -ESRCH;
         if ( (evc->vcpu >= d->max_vcpus) ||
@@ -1127,7 +939,6 @@ long arch_do_domctl(
         ret = 0;
 
     ext_vcpucontext_out:
-        rcu_unlock_domain(d);
         if ( (domctl->cmd == XEN_DOMCTL_get_ext_vcpucontext) &&
              copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
@@ -1136,16 +947,10 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_cpuid:
     {
-        struct domain *d;
         xen_domctl_cpuid_t *ctl = &domctl->u.cpuid;
         cpuid_input_t *cpuid = NULL; 
         int i;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         for ( i = 0; i < MAX_CPUID_INPUT; i++ )
         {
             cpuid = &d->arch.cpuids[i];
@@ -1168,21 +973,13 @@ long arch_do_domctl(
             memcpy(cpuid, ctl, sizeof(cpuid_input_t));
             ret = 0;
         }
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gettscinfo:
     {
-        struct domain *d;
         xen_guest_tsc_info_t info;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         domain_pause(d);
         tsc_get_info(d, &info.tsc_mode,
                         &info.elapsed_nsec,
@@ -1193,20 +990,11 @@ long arch_do_domctl(
         else
             ret = 0;
         domain_unpause(d);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_settscinfo:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         domain_pause(d);
         tsc_set_info(d, domctl->u.tsc_info.info.tsc_mode,
                      domctl->u.tsc_info.info.elapsed_nsec,
@@ -1214,138 +1002,83 @@ long arch_do_domctl(
                      domctl->u.tsc_info.info.incarnation);
         domain_unpause(d);
 
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_suppress_spurious_page_faults:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            d->arch.suppress_spurious_page_faults = 1;
-            rcu_unlock_domain(d);
-            ret = 0;
-        }
+        d->arch.suppress_spurious_page_faults = 1;
+        ret = 0;
     }
     break;
 
     case XEN_DOMCTL_debug_op:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = -EINVAL;
         if ( (domctl->u.debug_op.vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[domctl->u.debug_op.vcpu]) == NULL) )
-            goto debug_op_out;
+            break;
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d))
-            goto debug_op_out;
+            break;
 
         ret = hvm_debug_op(v, domctl->u.debug_op.op);
-
-    debug_op_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_guestmemio:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         domctl->u.gdbsx_guest_memio.remain =
             domctl->u.gdbsx_guest_memio.len;
 
         ret = gdbsx_guest_mem_io(domctl->domain, &domctl->u.gdbsx_guest_memio);
         if ( !ret && copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_pausevcpu:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = -EBUSY;
         if ( !d->is_paused_by_controller )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         ret = -EINVAL;
         if ( domctl->u.gdbsx_pauseunp_vcpu.vcpu >= MAX_VIRT_CPUS ||
              (v = d->vcpu[domctl->u.gdbsx_pauseunp_vcpu.vcpu]) == NULL )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         vcpu_pause(v);
         ret = 0;
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_unpausevcpu:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = -EBUSY;
         if ( !d->is_paused_by_controller )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         ret = -EINVAL;
         if ( domctl->u.gdbsx_pauseunp_vcpu.vcpu >= MAX_VIRT_CPUS ||
              (v = d->vcpu[domctl->u.gdbsx_pauseunp_vcpu.vcpu]) == NULL )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         if ( !atomic_read(&v->pause_count) )
             printk("WARN: Unpausing vcpu:%d which is not paused\n", v->vcpu_id);
         vcpu_unpause(v);
         ret = 0;
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_domstatus:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         domctl->u.gdbsx_domstatus.vcpu_id = -1;
         domctl->u.gdbsx_domstatus.paused = d->is_paused_by_controller;
         if ( domctl->u.gdbsx_domstatus.paused )
@@ -1365,7 +1098,6 @@ long arch_do_domctl(
         ret = 0;
         if ( copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -1373,7 +1105,6 @@ long arch_do_domctl(
     case XEN_DOMCTL_getvcpuextstate:
     {
         struct xen_domctl_vcpuextstate *evc;
-        struct domain *d;
         struct vcpu *v;
         uint32_t offset = 0;
         uint64_t _xfeature_mask = 0;
@@ -1384,12 +1115,6 @@ long arch_do_domctl(
 
         evc = &domctl->u.vcpuextstate;
 
-        ret = -ESRCH;
-
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_vcpuextstate(d, domctl->cmd);
         if ( ret )
             goto vcpuextstate_out;
@@ -1488,7 +1213,6 @@ long arch_do_domctl(
         ret = 0;
 
     vcpuextstate_out:
-        rcu_unlock_domain(d);
         if ( (domctl->cmd == XEN_DOMCTL_getvcpuextstate) &&
              copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
@@ -1497,50 +1221,33 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_mem_event_op:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = mem_event_domctl(d, &domctl->u.mem_event_op,
-                                   guest_handle_cast(u_domctl, void));
-            rcu_unlock_domain(d);
-            copy_to_guest(u_domctl, domctl, 1);
-        } 
+        ret = mem_event_domctl(d, &domctl->u.mem_event_op,
+                               guest_handle_cast(u_domctl, void));
+        copy_to_guest(u_domctl, domctl, 1);
     }
     break;
 
     case XEN_DOMCTL_mem_sharing_op:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_mem_sharing(d);
-            if ( !ret )
-                ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
-            rcu_unlock_domain(d);
-        } 
+        ret = xsm_mem_sharing(d);
+        if ( !ret )
+            ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
     }
     break;
 
 #if P2M_AUDIT
     case XEN_DOMCTL_audit_p2m:
     {
-        struct domain *d;
-
-        ret = rcu_lock_remote_domain_by_id(domctl->domain, &d);
-        if ( ret != 0 )
+        if ( d == current->domain )
+        {
+            ret = -EPERM;
             break;
+        }
 
         audit_p2m(d,
                   &domctl->u.audit_p2m.orphans,
                   &domctl->u.audit_p2m.m2p_bad,
                   &domctl->u.audit_p2m.p2m_bad);
-        rcu_unlock_domain(d);
         if ( copy_to_guest(u_domctl, domctl, 1) ) 
             ret = -EFAULT;
     }
@@ -1549,29 +1256,22 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_access_required:
     {
-        struct domain *d;
         struct p2m_domain* p2m;
         
         ret = -EPERM;
-        if ( current->domain->domain_id == domctl->domain )
+        if ( current->domain == d )
             break;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_mem_event_setup(d);
-            if ( !ret ) {
-                p2m = p2m_get_hostp2m(d);
-                p2m->access_required = domctl->u.access_required.access_required;
-            }
-            rcu_unlock_domain(d);
-        } 
+        ret = xsm_mem_event_setup(d);
+        if ( !ret ) {
+            p2m = p2m_get_hostp2m(d);
+            p2m->access_required = domctl->u.access_required.access_required;
+        }
     }
     break;
 
     default:
-        ret = iommu_do_domctl(domctl, u_domctl);
+        ret = iommu_do_domctl(domctl, d, u_domctl);
         break;
     }
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 46bb0e3..2a42a5f 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -861,7 +861,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     break;
 
     default:
-        ret = arch_do_domctl(op, u_domctl);
+        ret = arch_do_domctl(op, d, u_domctl);
         break;
     }
 
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 47408f2..9d13185 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -538,10 +538,9 @@ void iommu_crash_shutdown(void)
 }
 
 int iommu_do_domctl(
-    struct xen_domctl *domctl,
+    struct xen_domctl *domctl, struct domain *d,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
-    struct domain *d;
     u16 seg;
     u8 bus, devfn;
     int ret = 0;
@@ -560,10 +559,6 @@ int iommu_do_domctl(
         if ( ret )
             break;
 
-        ret = -EINVAL;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         seg = domctl->u.get_device_group.machine_sbdf >> 16;
         bus = (domctl->u.get_device_group.machine_sbdf >> 8) & 0xff;
         devfn = domctl->u.get_device_group.machine_sbdf & 0xff;
@@ -584,7 +579,6 @@ int iommu_do_domctl(
         }
         if ( copy_to_guest(u_domctl, domctl, 1) )
             ret = -EFAULT;
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -607,20 +601,15 @@ int iommu_do_domctl(
         break;
 
     case XEN_DOMCTL_assign_device:
-        if ( unlikely((d = get_domain_by_id(domctl->domain)) == NULL) ||
-             unlikely(d->is_dying) )
+        if ( unlikely(d->is_dying) )
         {
-            printk(XENLOG_G_ERR
-                   "XEN_DOMCTL_assign_device: get_domain_by_id() failed\n");
             ret = -EINVAL;
-            if ( d )
-                goto assign_device_out;
             break;
         }
 
         ret = xsm_assign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
-            goto assign_device_out;
+            break;
 
         seg = domctl->u.get_device_group.machine_sbdf >> 16;
         bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff;
@@ -634,22 +623,12 @@ int iommu_do_domctl(
                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
                    d->domain_id, ret);
 
-    assign_device_out:
-        put_domain(d);
         break;
 
     case XEN_DOMCTL_deassign_device:
-        if ( unlikely((d = get_domain_by_id(domctl->domain)) == NULL) )
-        {
-            printk(XENLOG_G_ERR
-                   "XEN_DOMCTL_deassign_device: get_domain_by_id() failed\n");
-            ret = -EINVAL;
-            break;
-        }
-
         ret = xsm_deassign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
-            goto deassign_device_out;
+            break;
 
         seg = domctl->u.get_device_group.machine_sbdf >> 16;
         bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff;
@@ -664,8 +643,6 @@ int iommu_do_domctl(
                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
                    d->domain_id, ret);
 
-    deassign_device_out:
-        put_domain(d);
         break;
 
     default:
diff --git a/xen/include/xen/hypercall.h b/xen/include/xen/hypercall.h
index e315523..7c3d719 100644
--- a/xen/include/xen/hypercall.h
+++ b/xen/include/xen/hypercall.h
@@ -37,7 +37,7 @@ do_domctl(
 
 extern long
 arch_do_domctl(
-    struct xen_domctl *domctl,
+    struct xen_domctl *domctl, struct domain *d,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
 
 extern long
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 3026e54..55e5cc9 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -132,7 +132,8 @@ void iommu_crash_shutdown(void);
 void iommu_set_dom0_mapping(struct domain *d);
 void iommu_share_p2m_table(struct domain *d);
 
-int iommu_do_domctl(struct xen_domctl *, XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
+int iommu_do_domctl(struct xen_domctl *, struct domain *d,
+                    XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
 
 void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int page_count);
 void iommu_iotlb_flush_all(struct domain *d);
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSep-0002Od-1J; Fri, 30 Nov 2012 15:37:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSem-0002MQ-Ph
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:36 +0000
Received: from [85.158.139.211:30451] by server-6.bemta-5.messagelabs.com id
	4B/44-19321-0C2D8B05; Fri, 30 Nov 2012 15:37:36 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354289854!18577851!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11555 invoked from network); 30 Nov 2012 15:37:35 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-6.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:35 -0000
X-TM-IMSS-Message-ID: <3392214400027abc@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3392214400027abc ;
	Fri, 30 Nov 2012 10:36:27 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSdA017785; 
	Fri, 30 Nov 2012 10:37:33 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:04 -0500
Message-Id: <1354289830-24642-18-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: [Xen-devel] [PATCH 17/23] tmem: add XSM hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This adds a pair of XSM hooks for tmem operations: xsm_tmem_op which
controls any use of tmem, and xsm_tmem_control which allows use of the
TMEM_CONTROL operations. By default, all domains can use tmem while only
IS_PRIV domains can use control operations.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
---
 tools/flask/policy/policy/flask/access_vectors |  2 ++
 xen/common/tmem.c                              |  3 +++
 xen/include/xen/tmem_xen.h                     |  8 +++++++-
 xen/include/xsm/dummy.h                        | 12 ++++++++++++
 xen/include/xsm/xsm.h                          | 12 ++++++++++++
 xen/xsm/dummy.c                                |  2 ++
 xen/xsm/flask/hooks.c                          | 12 ++++++++++++
 xen/xsm/flask/include/av_perm_to_string.h      |  2 ++
 xen/xsm/flask/include/av_permissions.h         |  2 ++
 9 files changed, 54 insertions(+), 1 deletion(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index caf65d2..7a7e253 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -35,6 +35,8 @@ class xen
 	lockprof
 	cpupool_op
 	sched_op
+	tmem_op
+	tmem_control
 }
 
 class domain
diff --git a/xen/common/tmem.c b/xen/common/tmem.c
index 44e2772..ca70e86 100644
--- a/xen/common/tmem.c
+++ b/xen/common/tmem.c
@@ -2644,6 +2644,9 @@ EXPORT long do_tmem_op(tmem_cli_op_t uops)
     if ( !tmem_initialized )
         return -ENODEV;
 
+    if ( !tmh_current_permitted() )
+        return -EPERM;
+
     total_tmem_ops++;
 
     if ( tmh_lock_all )
diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h
index 36a8d9f..8dec5aa 100644
--- a/xen/include/xen/tmem_xen.h
+++ b/xen/include/xen/tmem_xen.h
@@ -16,6 +16,7 @@
 #include <xen/guest_access.h> /* copy_from_guest */
 #include <xen/hash.h> /* hash_long */
 #include <xen/domain_page.h> /* __map_domain_page */
+#include <xsm/xsm.h> /* xsm_tmem_control */
 #include <public/tmem.h>
 #ifdef CONFIG_COMPAT
 #include <compat/tmem.h>
@@ -326,9 +327,14 @@ static inline bool_t tmh_set_client_from_id(
     return rc;
 }
 
+static inline bool_t tmh_current_permitted(void)
+{
+    return !xsm_tmem_op();
+}
+
 static inline bool_t tmh_current_is_privileged(void)
 {
-    return IS_PRIV(current->domain);
+    return !xsm_tmem_control();
 }
 
 static inline uint8_t tmh_get_first_byte(pfp_t *pfp)
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 9894d8d..90682ae 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -443,6 +443,18 @@ static XSM_INLINE int xsm_sched_op(void)
     return 0;
 }
 
+static XSM_INLINE int xsm_tmem_op(void)
+{
+    return 0;
+}
+
+static XSM_INLINE int xsm_tmem_control(void)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
     return -ENOSYS;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index a8c1d87..b2f33d6 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -134,6 +134,8 @@ struct xsm_operations {
     int (*lockprof)(void);
     int (*cpupool_op)(void);
     int (*sched_op)(void);
+    int (*tmem_op)(void);
+    int (*tmem_control)(void);
 
     long (*do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
 
@@ -612,6 +614,16 @@ static inline int xsm_sched_op(void)
     return xsm_ops->sched_op();
 }
 
+static inline int xsm_tmem_op(void)
+{
+    return xsm_ops->tmem_op();
+}
+
+static inline int xsm_tmem_control(void)
+{
+    return xsm_ops->tmem_control();
+}
+
 static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
     return xsm_ops->do_xsm_op(op);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 71299d5..3e6e5df 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -121,6 +121,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, lockprof);
     set_to_dummy_if_null(ops, cpupool_op);
     set_to_dummy_if_null(ops, sched_op);
+    set_to_dummy_if_null(ops, tmem_op);
+    set_to_dummy_if_null(ops, tmem_control);
 
     set_to_dummy_if_null(ops, do_xsm_op);
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 167f8e6..e815ea5 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1079,6 +1079,16 @@ static inline int flask_sched_op(void)
     return domain_has_xen(current->domain, XEN__SCHED_OP);
 }
 
+static inline int flask_tmem_op(void)
+{
+    return domain_has_xen(current->domain, XEN__TMEM_OP);
+}
+
+static inline int flask_tmem_control(void)
+{
+    return domain_has_xen(current->domain, XEN__TMEM_CONTROL);
+}
+
 static int flask_perfcontrol(void)
 {
     return domain_has_xen(current->domain, XEN__PERFCONTROL);
@@ -1723,6 +1733,8 @@ static struct xsm_operations flask_ops = {
     .lockprof = flask_lockprof,
     .cpupool_op = flask_cpupool_op,
     .sched_op = flask_sched_op,
+    .tmem_op = flask_tmem_op,
+    .tmem_control = flask_tmem_control,
 
     .do_xsm_op = do_flask_op,
 
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 79d5939..c3f2370 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -29,6 +29,8 @@
    S_(SECCLASS_XEN, XEN__LOCKPROF, "lockprof")
    S_(SECCLASS_XEN, XEN__CPUPOOL_OP, "cpupool_op")
    S_(SECCLASS_XEN, XEN__SCHED_OP, "sched_op")
+   S_(SECCLASS_XEN, XEN__TMEM_OP, "tmem_op")
+   S_(SECCLASS_XEN, XEN__TMEM_CONTROL, "tmem_control")
    S_(SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT, "setvcpucontext")
    S_(SECCLASS_DOMAIN, DOMAIN__PAUSE, "pause")
    S_(SECCLASS_DOMAIN, DOMAIN__UNPAUSE, "unpause")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index d982328..65302e8 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -29,6 +29,8 @@
 #define XEN__LOCKPROF                             0x08000000UL
 #define XEN__CPUPOOL_OP                           0x10000000UL
 #define XEN__SCHED_OP                             0x20000000UL
+#define XEN__TMEM_OP                              0x40000000UL
+#define XEN__TMEM_CONTROL                         0x80000000UL
 
 #define DOMAIN__SETVCPUCONTEXT                    0x00000001UL
 #define DOMAIN__PAUSE                             0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSev-0002V0-8u; Fri, 30 Nov 2012 15:37:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSeq-0002MP-JB
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:41 +0000
Received: from [193.109.254.147:42697] by server-16.bemta-14.messagelabs.com
	id 5A/27-09215-4C2D8B05; Fri, 30 Nov 2012 15:37:40 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-10.tower-27.messagelabs.com!1354289856!3771828!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25788 invoked from network); 30 Nov 2012 15:37:36 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-10.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:36 -0000
X-TM-IMSS-Message-ID: <d0a0f209000589c9@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0f209000589c9 ;
	Fri, 30 Nov 2012 10:37:40 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSdC017785; 
	Fri, 30 Nov 2012 10:37:34 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:06 -0500
Message-Id: <1354289830-24642-20-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: [Xen-devel] [PATCH 19/23] flask: move policy headers into hypervisor
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Rather than keeping around headers that are autogenerated in order to
avoid adding build dependencies from xen/ to files in tools/, move the
relevant parts of the FLASK policy into the hypervisor tree and generate
the headers as part of the hypervisor's build.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 .gitignore                                         |   5 +
 .hgignore                                          |   5 +
 tools/flask/policy/Makefile                        |   2 +-
 tools/flask/policy/policy/flask/Makefile           |  41 -----
 tools/flask/policy/policy/flask/access_vectors     | 190 ---------------------
 tools/flask/policy/policy/flask/initial_sids       |  16 --
 tools/flask/policy/policy/flask/mkaccess_vector.sh | 138 ---------------
 tools/flask/policy/policy/flask/mkflask.sh         |  95 -----------
 tools/flask/policy/policy/flask/security_classes   |  21 ---
 xen/xsm/flask/Makefile                             |  25 +++
 xen/xsm/flask/include/av_perm_to_string.h          | 147 ----------------
 xen/xsm/flask/include/av_permissions.h             | 157 -----------------
 xen/xsm/flask/include/class_to_string.h            |  15 --
 xen/xsm/flask/include/flask.h                      |  35 ----
 xen/xsm/flask/include/initial_sid_to_string.h      |  16 --
 xen/xsm/flask/policy/access_vectors                | 190 +++++++++++++++++++++
 xen/xsm/flask/policy/initial_sids                  |  16 ++
 xen/xsm/flask/policy/mkaccess_vector.sh            | 138 +++++++++++++++
 xen/xsm/flask/policy/mkflask.sh                    |  95 +++++++++++
 xen/xsm/flask/policy/security_classes              |  21 +++
 20 files changed, 496 insertions(+), 872 deletions(-)
 delete mode 100644 tools/flask/policy/policy/flask/Makefile
 delete mode 100644 tools/flask/policy/policy/flask/access_vectors
 delete mode 100644 tools/flask/policy/policy/flask/initial_sids
 delete mode 100644 tools/flask/policy/policy/flask/mkaccess_vector.sh
 delete mode 100644 tools/flask/policy/policy/flask/mkflask.sh
 delete mode 100644 tools/flask/policy/policy/flask/security_classes
 delete mode 100644 xen/xsm/flask/include/av_perm_to_string.h
 delete mode 100644 xen/xsm/flask/include/av_permissions.h
 delete mode 100644 xen/xsm/flask/include/class_to_string.h
 delete mode 100644 xen/xsm/flask/include/flask.h
 delete mode 100644 xen/xsm/flask/include/initial_sid_to_string.h
 create mode 100644 xen/xsm/flask/policy/access_vectors
 create mode 100644 xen/xsm/flask/policy/initial_sids
 create mode 100644 xen/xsm/flask/policy/mkaccess_vector.sh
 create mode 100644 xen/xsm/flask/policy/mkflask.sh
 create mode 100644 xen/xsm/flask/policy/security_classes

diff --git a/.gitignore b/.gitignore
index f6edc43..aac7a14 100644
--- a/.gitignore
+++ b/.gitignore
@@ -309,6 +309,11 @@ xen/include/xen/banner.h
 xen/include/xen/compile.h
 xen/tools/figlet/figlet
 xen/tools/symbols
+xen/xsm/flask/include/av_perm_to_string.h
+xen/xsm/flask/include/av_permissions.h
+xen/xsm/flask/include/class_to_string.h
+xen/xsm/flask/include/flask.h
+xen/xsm/flask/include/initial_sid_to_string.h
 xen/xen
 xen/xen-syms
 xen/xen.*
diff --git a/.hgignore b/.hgignore
index 344792a..5ed903f 100644
--- a/.hgignore
+++ b/.hgignore
@@ -339,6 +339,11 @@
 ^xen/include/xen/compile\.h$
 ^xen/tools/figlet/figlet$
 ^xen/tools/symbols$
+^xen/xsm/flask/include/av_perm_to_string\.h$
+^xen/xsm/flask/include/av_permissions\.h$
+^xen/xsm/flask/include/class_to_string\.h$
+^xen/xsm/flask/include/flask\.h$
+^xen/xsm/flask/include/initial_sid_to_string\.h$
 ^xen/xen$
 ^xen/xen-syms$
 ^xen/xen\..*$
diff --git a/tools/flask/policy/Makefile b/tools/flask/policy/Makefile
index 5c25cbe..3f5aa38 100644
--- a/tools/flask/policy/Makefile
+++ b/tools/flask/policy/Makefile
@@ -61,7 +61,7 @@ LOADPOLICY := $(SBINDIR)/flask-loadpolicy
 # policy source layout
 POLDIR := policy
 MODDIR := $(POLDIR)/modules
-FLASKDIR := $(POLDIR)/flask
+FLASKDIR := ../../../xen/xsm/flask/policy
 SECCLASS := $(FLASKDIR)/security_classes
 ISIDS := $(FLASKDIR)/initial_sids
 AVS := $(FLASKDIR)/access_vectors
diff --git a/tools/flask/policy/policy/flask/Makefile b/tools/flask/policy/policy/flask/Makefile
deleted file mode 100644
index 5f57e88..0000000
--- a/tools/flask/policy/policy/flask/Makefile
+++ /dev/null
@@ -1,41 +0,0 @@
-# flask needs to know where to export the libselinux headers.
-LIBSEL ?= ../../libselinux
-
-# flask needs to know where to export the kernel headers.
-LINUXDIR ?= ../../../linux-2.6
-
-AWK = awk
-
-CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
-          else if [ -x /bin/bash ]; then echo /bin/bash; \
-          else echo sh; fi ; fi)
-
-FLASK_H_DEPEND = security_classes initial_sids
-AV_H_DEPEND = access_vectors
-
-FLASK_H_FILES = class_to_string.h flask.h initial_sid_to_string.h
-AV_H_FILES = av_perm_to_string.h av_permissions.h
-ALL_H_FILES = $(FLASK_H_FILES) $(AV_H_FILES)
-
-all:  $(ALL_H_FILES)
-
-$(FLASK_H_FILES): $(FLASK_H_DEPEND)
-	$(CONFIG_SHELL) mkflask.sh $(AWK) $(FLASK_H_DEPEND)
-
-$(AV_H_FILES): $(AV_H_DEPEND)
-	$(CONFIG_SHELL) mkaccess_vector.sh $(AWK) $(AV_H_DEPEND)
-
-tolib: all
-	install -m 644 flask.h av_permissions.h $(LIBSEL)/include/selinux
-	install -m 644 class_to_string.h av_inherit.h common_perm_to_string.h av_perm_to_string.h $(LIBSEL)/src
-
-tokern: all
-	install -m 644 $(ALL_H_FILES) $(LINUXDIR)/security/selinux/include
-
-install: all
-
-relabel:
-
-clean:  
-	rm -f $(FLASK_H_FILES)
-	rm -f $(AV_H_FILES)
diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
deleted file mode 100644
index 7a7e253..0000000
--- a/tools/flask/policy/policy/flask/access_vectors
+++ /dev/null
@@ -1,190 +0,0 @@
-#
-# Define the access vectors.
-#
-# class class_name { permission_name ... }
-
-class xen
-{
-	scheduler
-	settime
-	tbufcontrol
-	readconsole
-	clearconsole
-	perfcontrol
-	mtrr_add
-	mtrr_del
-	mtrr_read
-	microcode
-	physinfo
-	quirk
-    writeconsole
-    readapic
-    writeapic
-    privprofile
-    nonprivprofile
-    kexec
-	firmware
-	sleep
-	frequency
-	getidle
-	debug
-	getcpuinfo
-	heap
-	pm_op
-	mca_op
-	lockprof
-	cpupool_op
-	sched_op
-	tmem_op
-	tmem_control
-}
-
-class domain
-{
-	setvcpucontext
-	pause
-	unpause
-    resume
-    create
-    transition
-    max_vcpus
-    destroy
-    setvcpuaffinity
-	getvcpuaffinity
-	scheduler
-	getdomaininfo
-	getvcpuinfo
-	getvcpucontext
-	setdomainmaxmem
-	setdomainhandle
-	setdebugging
-	hypercall
-    settime
-    set_target
-    shutdown
-    setaddrsize
-    getaddrsize
-	trigger
-	getextvcpucontext
-	setextvcpucontext
-	getvcpuextstate
-	setvcpuextstate
-	getpodtarget
-	setpodtarget
-	set_misc_info
-	set_virq_handler
-}
-
-class domain2
-{
-	relabelfrom
-	relabelto
-	relabelself
-	make_priv_for
-	set_as_target
-	set_cpuid
-	gettsc
-	settsc
-}
-
-class hvm
-{
-    sethvmc
-    gethvmc
-    setparam
-    getparam
-    pcilevel
-    irqlevel
-    pciroute
-	bind_irq
-	cacheattr
-    trackdirtyvram
-    hvmctl
-    mem_event
-    mem_sharing
-    audit_p2m
-    send_irq
-    share_mem
-}
-
-class event
-{
-	bind
-	send
-	status
-	notify
-	create
-    reset
-}
-
-class grant
-{
-	map_read
-	map_write
-	unmap
-	transfer
-	setup
-    copy
-    query
-}
-
-class mmu
-{
-	map_read
-	map_write
-	pageinfo
-	pagelist
-    adjust
-    stat
-    translategp
-	updatemp
-    physmap
-    pinpage
-    mfnlist
-    memorymap
-    remote_remap
-	mmuext_op
-	exchange
-}
-
-class shadow
-{
-	disable
-	enable
-    logdirty
-}
-
-class resource
-{
-	add
-	remove
-	use
-	add_irq
-	remove_irq
-	add_ioport
-	remove_ioport
-	add_iomem
-	remove_iomem
-	stat_device
-	add_device
-	remove_device
-	plug
-	unplug
-	setup
-}
-
-class security
-{
-	compute_av
-	compute_create
-	compute_member
-	check_context
-	load_policy
-	compute_relabel
-	compute_user
-	setenforce
-	setbool
-	setsecparam
-        add_ocontext
-        del_ocontext
-}
diff --git a/tools/flask/policy/policy/flask/initial_sids b/tools/flask/policy/policy/flask/initial_sids
deleted file mode 100644
index e508bde..0000000
--- a/tools/flask/policy/policy/flask/initial_sids
+++ /dev/null
@@ -1,16 +0,0 @@
-# FLASK
-
-#
-# Define initial security identifiers 
-#
-sid xen
-sid dom0
-sid domio
-sid domxen
-sid unlabeled
-sid security
-sid ioport
-sid iomem
-sid irq
-sid device
-# FLASK
diff --git a/tools/flask/policy/policy/flask/mkaccess_vector.sh b/tools/flask/policy/policy/flask/mkaccess_vector.sh
deleted file mode 100644
index 43a60a7..0000000
--- a/tools/flask/policy/policy/flask/mkaccess_vector.sh
+++ /dev/null
@@ -1,138 +0,0 @@
-#!/bin/sh -
-#
-
-# FLASK
-
-set -e
-
-awk=$1
-shift
-
-# output files
-av_permissions="av_permissions.h"
-av_perm_to_string="av_perm_to_string.h"
-
-cat $* | $awk "
-BEGIN	{
-		outfile = \"$av_permissions\"
-		avpermfile = \"$av_perm_to_string\"
-		"'
-		nextstate = "COMMON_OR_AV";
-		printf("/* This file is automatically generated.  Do not edit. */\n") > outfile;
-		printf("/* This file is automatically generated.  Do not edit. */\n") > avpermfile;
-;
-	}
-/^[ \t]*#/	{ 
-			next;
-		}
-$1 == "class"	{
-			if (nextstate != "COMMON_OR_AV" &&
-			    nextstate != "CLASS_OR_CLASS-OPENBRACKET")
-			{
-				printf("Parse error:  Unexpected class definition on line %d\n", NR);
-				next;	
-			}
-
-			tclass = $2;
-
-			if (tclass in av_defined)
-			{
-				printf("Duplicate access vector definition for %s on line %d\n", tclass, NR);
-				next;
-			} 
-			av_defined[tclass] = 1;
-
-			permission = 1;
-
-			nextstate = "INHERITS_OR_CLASS-OPENBRACKET";
-			next;
-		}
-$1 == "{"	{ 
-			if (nextstate != "INHERITS_OR_CLASS-OPENBRACKET" &&
-			    nextstate != "CLASS_OR_CLASS-OPENBRACKET" &&
-			    nextstate != "COMMON-OPENBRACKET")
-			{
-				printf("Parse error:  Unexpected { on line %d\n", NR);
-				next;
-			}
-
-			if (nextstate == "INHERITS_OR_CLASS-OPENBRACKET")
-				nextstate = "CLASS-CLOSEBRACKET";
-
-			if (nextstate == "CLASS_OR_CLASS-OPENBRACKET")
-				nextstate = "CLASS-CLOSEBRACKET";
-
-			if (nextstate == "COMMON-OPENBRACKET")
-				nextstate = "COMMON-CLOSEBRACKET";
-		}
-/[a-z][a-z_]*/	{
-			if (nextstate != "COMMON-CLOSEBRACKET" &&
-			    nextstate != "CLASS-CLOSEBRACKET")
-			{
-				printf("Parse error:  Unexpected symbol %s on line %d\n", $1, NR);		
-				next;
-			}
-
-			if (nextstate == "COMMON-CLOSEBRACKET")
-			{
-				if ((common_name,$1) in common_perms)
-				{
-					printf("Duplicate permission %s for common %s on line %d.\n", $1, common_name, NR);
-					next;
-				}
-
-				common_perms[common_name,$1] = permission;
-
-				printf("#define COMMON_%s__%s", toupper(common_name), toupper($1)) > outfile; 
-
-				printf("    S_(\"%s\")\n", $1) > cpermfile;
-			}
-			else
-			{
-				if ((tclass,$1) in av_perms)
-				{
-					printf("Duplicate permission %s for %s on line %d.\n", $1, tclass, NR);
-					next;
-				}
-
-				av_perms[tclass,$1] = permission;
-		
-				printf("#define %s__%s", toupper(tclass), toupper($1)) > outfile; 
-
-				printf("   S_(SECCLASS_%s, %s__%s, \"%s\")\n", toupper(tclass), toupper(tclass), toupper($1), $1) > avpermfile; 
-			}
-
-			spaces = 40 - (length($1) + length(tclass));
-			if (spaces < 1)
-			      spaces = 1;
-
-			for (i = 0; i < spaces; i++) 
-				printf(" ") > outfile; 
-			printf("0x%08xUL\n", permission) > outfile; 
-			permission = permission * 2;
-		}
-$1 == "}"	{
-			if (nextstate != "CLASS-CLOSEBRACKET" && 
-			    nextstate != "COMMON-CLOSEBRACKET")
-			{
-				printf("Parse error:  Unexpected } on line %d\n", NR);
-				next;
-			}
-
-			if (nextstate == "COMMON-CLOSEBRACKET")
-			{
-				common_base[common_name] = permission;
-				printf("TE_(common_%s_perm_to_string)\n\n", common_name) > cpermfile; 
-			}
-
-			printf("\n") > outfile;
-
-			nextstate = "COMMON_OR_AV";
-		}
-END	{
-		if (nextstate != "COMMON_OR_AV" && nextstate != "CLASS_OR_CLASS-OPENBRACKET")
-			printf("Parse error:  Unexpected end of file\n");
-
-	}'
-
-# FLASK
diff --git a/tools/flask/policy/policy/flask/mkflask.sh b/tools/flask/policy/policy/flask/mkflask.sh
deleted file mode 100644
index 9c84754..0000000
--- a/tools/flask/policy/policy/flask/mkflask.sh
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/bin/sh -
-#
-
-# FLASK
-
-set -e
-
-awk=$1
-shift 1
-
-# output file
-output_file="flask.h"
-debug_file="class_to_string.h"
-debug_file2="initial_sid_to_string.h"
-
-cat $* | $awk "
-BEGIN	{
-		outfile = \"$output_file\"
-		debugfile = \"$debug_file\"
-		debugfile2 = \"$debug_file2\"
-		"'
-		nextstate = "CLASS";
-
-		printf("/* This file is automatically generated.  Do not edit. */\n") > outfile;
-
-		printf("#ifndef _SELINUX_FLASK_H_\n") > outfile;
-		printf("#define _SELINUX_FLASK_H_\n") > outfile;
-		printf("\n/*\n * Security object class definitions\n */\n") > outfile;
-		printf("/* This file is automatically generated.  Do not edit. */\n") > debugfile;
-		printf("/*\n * Security object class definitions\n */\n") > debugfile;
-		printf("    S_(\"null\")\n") > debugfile;
-		printf("/* This file is automatically generated.  Do not edit. */\n") > debugfile2;
-		printf("static char *initial_sid_to_string[] =\n{\n") > debugfile2;
-		printf("    \"null\",\n") > debugfile2;
-	}
-/^[ \t]*#/	{ 
-			next;
-		}
-$1 == "class"	{ 
-			if (nextstate != "CLASS")
-			{
-				printf("Parse error:  Unexpected class definition on line %d\n", NR);
-				next;	
-			}
-
-			if ($2 in class_found)
-			{
-				printf("Duplicate class definition for %s on line %d.\n", $2, NR);
-				next;
-			}	
-			class_found[$2] = 1;
-
-			class_value++;
-
-			printf("#define SECCLASS_%s", toupper($2)) > outfile;
-			for (i = 0; i < 40 - length($2); i++) 
-				printf(" ") > outfile; 
-			printf("%d\n", class_value) > outfile; 
-
-			printf("    S_(\"%s\")\n", $2) > debugfile;
-		}
-$1 == "sid"	{ 
-			if (nextstate == "CLASS")
-			{
-			    nextstate = "SID";
-			    printf("\n/*\n * Security identifier indices for initial entities\n */\n") > outfile;			    
-			}
-
-			if ($2 in sid_found)
-			{
-				printf("Duplicate SID definition for %s on line %d.\n", $2, NR);
-				next;
-			}	
-			sid_found[$2] = 1;
-			sid_value++;
-
-			printf("#define SECINITSID_%s", toupper($2)) > outfile;
-			for (i = 0; i < 37 - length($2); i++) 
-				printf(" ") > outfile; 
-			printf("%d\n", sid_value) > outfile; 
-			printf("    \"%s\",\n", $2) > debugfile2;
-		}
-END	{
-		if (nextstate != "SID")
-			printf("Parse error:  Unexpected end of file\n");
-
-		printf("\n#define SECINITSID_NUM") > outfile;
-		for (i = 0; i < 34; i++) 
-			printf(" ") > outfile; 
-		printf("%d\n", sid_value) > outfile; 
-		printf("\n#endif\n") > outfile;
-		printf("};\n\n") > debugfile2;
-	}'
-
-# FLASK
diff --git a/tools/flask/policy/policy/flask/security_classes b/tools/flask/policy/policy/flask/security_classes
deleted file mode 100644
index ef134a7..0000000
--- a/tools/flask/policy/policy/flask/security_classes
+++ /dev/null
@@ -1,21 +0,0 @@
-# FLASK
-
-#
-# Define the security object classes 
-#
-
-# Classes marked as userspace are classes
-# for userspace object managers
-
-class xen
-class domain
-class domain2
-class hvm
-class mmu
-class resource
-class shadow
-class event
-class grant
-class security
-
-# FLASK
diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile
index 92fb410..1256512 100644
--- a/xen/xsm/flask/Makefile
+++ b/xen/xsm/flask/Makefile
@@ -5,3 +5,28 @@ obj-y += flask_op.o
 subdir-y += ss
 
 CFLAGS += -I./include
+
+AWK = awk
+
+CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
+          else if [ -x /bin/bash ]; then echo /bin/bash; \
+          else echo sh; fi ; fi)
+
+FLASK_H_DEPEND = policy/security_classes policy/initial_sids
+AV_H_DEPEND = policy/access_vectors
+
+FLASK_H_FILES = include/flask.h include/class_to_string.h include/initial_sid_to_string.h
+AV_H_FILES = include/av_perm_to_string.h include/av_permissions.h
+ALL_H_FILES = $(FLASK_H_FILES) $(AV_H_FILES)
+
+$(obj-y) ss/built_in.o: $(ALL_H_FILES)
+
+$(FLASK_H_FILES): $(FLASK_H_DEPEND)
+	$(CONFIG_SHELL) policy/mkflask.sh $(AWK) $(FLASK_H_DEPEND)
+
+$(AV_H_FILES): $(AV_H_DEPEND)
+	$(CONFIG_SHELL) policy/mkaccess_vector.sh $(AWK) $(AV_H_DEPEND)
+
+.PHONY: clean
+clean::
+	rm -f $(ALL_H_FILES) *.o $(DEPS)
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
deleted file mode 100644
index c3f2370..0000000
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-   S_(SECCLASS_XEN, XEN__SCHEDULER, "scheduler")
-   S_(SECCLASS_XEN, XEN__SETTIME, "settime")
-   S_(SECCLASS_XEN, XEN__TBUFCONTROL, "tbufcontrol")
-   S_(SECCLASS_XEN, XEN__READCONSOLE, "readconsole")
-   S_(SECCLASS_XEN, XEN__CLEARCONSOLE, "clearconsole")
-   S_(SECCLASS_XEN, XEN__PERFCONTROL, "perfcontrol")
-   S_(SECCLASS_XEN, XEN__MTRR_ADD, "mtrr_add")
-   S_(SECCLASS_XEN, XEN__MTRR_DEL, "mtrr_del")
-   S_(SECCLASS_XEN, XEN__MTRR_READ, "mtrr_read")
-   S_(SECCLASS_XEN, XEN__MICROCODE, "microcode")
-   S_(SECCLASS_XEN, XEN__PHYSINFO, "physinfo")
-   S_(SECCLASS_XEN, XEN__QUIRK, "quirk")
-   S_(SECCLASS_XEN, XEN__WRITECONSOLE, "writeconsole")
-   S_(SECCLASS_XEN, XEN__READAPIC, "readapic")
-   S_(SECCLASS_XEN, XEN__WRITEAPIC, "writeapic")
-   S_(SECCLASS_XEN, XEN__PRIVPROFILE, "privprofile")
-   S_(SECCLASS_XEN, XEN__NONPRIVPROFILE, "nonprivprofile")
-   S_(SECCLASS_XEN, XEN__KEXEC, "kexec")
-   S_(SECCLASS_XEN, XEN__FIRMWARE, "firmware")
-   S_(SECCLASS_XEN, XEN__SLEEP, "sleep")
-   S_(SECCLASS_XEN, XEN__FREQUENCY, "frequency")
-   S_(SECCLASS_XEN, XEN__GETIDLE, "getidle")
-   S_(SECCLASS_XEN, XEN__DEBUG, "debug")
-   S_(SECCLASS_XEN, XEN__GETCPUINFO, "getcpuinfo")
-   S_(SECCLASS_XEN, XEN__HEAP, "heap")
-   S_(SECCLASS_XEN, XEN__PM_OP, "pm_op")
-   S_(SECCLASS_XEN, XEN__MCA_OP, "mca_op")
-   S_(SECCLASS_XEN, XEN__LOCKPROF, "lockprof")
-   S_(SECCLASS_XEN, XEN__CPUPOOL_OP, "cpupool_op")
-   S_(SECCLASS_XEN, XEN__SCHED_OP, "sched_op")
-   S_(SECCLASS_XEN, XEN__TMEM_OP, "tmem_op")
-   S_(SECCLASS_XEN, XEN__TMEM_CONTROL, "tmem_control")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT, "setvcpucontext")
-   S_(SECCLASS_DOMAIN, DOMAIN__PAUSE, "pause")
-   S_(SECCLASS_DOMAIN, DOMAIN__UNPAUSE, "unpause")
-   S_(SECCLASS_DOMAIN, DOMAIN__RESUME, "resume")
-   S_(SECCLASS_DOMAIN, DOMAIN__CREATE, "create")
-   S_(SECCLASS_DOMAIN, DOMAIN__TRANSITION, "transition")
-   S_(SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS, "max_vcpus")
-   S_(SECCLASS_DOMAIN, DOMAIN__DESTROY, "destroy")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETVCPUAFFINITY, "setvcpuaffinity")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETVCPUAFFINITY, "getvcpuaffinity")
-   S_(SECCLASS_DOMAIN, DOMAIN__SCHEDULER, "scheduler")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO, "getdomaininfo")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO, "getvcpuinfo")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT, "getvcpucontext")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM, "setdomainmaxmem")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE, "setdomainhandle")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING, "setdebugging")
-   S_(SECCLASS_DOMAIN, DOMAIN__HYPERCALL, "hypercall")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETTIME, "settime")
-   S_(SECCLASS_DOMAIN, DOMAIN__SET_TARGET, "set_target")
-   S_(SECCLASS_DOMAIN, DOMAIN__SHUTDOWN, "shutdown")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETADDRSIZE, "setaddrsize")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETADDRSIZE, "getaddrsize")
-   S_(SECCLASS_DOMAIN, DOMAIN__TRIGGER, "trigger")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETEXTVCPUCONTEXT, "getextvcpucontext")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETEXTVCPUCONTEXT, "setextvcpucontext")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETVCPUEXTSTATE, "getvcpuextstate")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETVCPUEXTSTATE, "setvcpuextstate")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETPODTARGET, "getpodtarget")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETPODTARGET, "setpodtarget")
-   S_(SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO, "set_misc_info")
-   S_(SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER, "set_virq_handler")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELFROM, "relabelfrom")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELTO, "relabelto")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELSELF, "relabelself")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR, "make_priv_for")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET, "set_as_target")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID, "set_cpuid")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__GETTSC, "gettsc")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__SETTSC, "settsc")
-   S_(SECCLASS_HVM, HVM__SETHVMC, "sethvmc")
-   S_(SECCLASS_HVM, HVM__GETHVMC, "gethvmc")
-   S_(SECCLASS_HVM, HVM__SETPARAM, "setparam")
-   S_(SECCLASS_HVM, HVM__GETPARAM, "getparam")
-   S_(SECCLASS_HVM, HVM__PCILEVEL, "pcilevel")
-   S_(SECCLASS_HVM, HVM__IRQLEVEL, "irqlevel")
-   S_(SECCLASS_HVM, HVM__PCIROUTE, "pciroute")
-   S_(SECCLASS_HVM, HVM__BIND_IRQ, "bind_irq")
-   S_(SECCLASS_HVM, HVM__CACHEATTR, "cacheattr")
-   S_(SECCLASS_HVM, HVM__TRACKDIRTYVRAM, "trackdirtyvram")
-   S_(SECCLASS_HVM, HVM__HVMCTL, "hvmctl")
-   S_(SECCLASS_HVM, HVM__MEM_EVENT, "mem_event")
-   S_(SECCLASS_HVM, HVM__MEM_SHARING, "mem_sharing")
-   S_(SECCLASS_HVM, HVM__AUDIT_P2M, "audit_p2m")
-   S_(SECCLASS_HVM, HVM__SEND_IRQ, "send_irq")
-   S_(SECCLASS_HVM, HVM__SHARE_MEM, "share_mem")
-   S_(SECCLASS_EVENT, EVENT__BIND, "bind")
-   S_(SECCLASS_EVENT, EVENT__SEND, "send")
-   S_(SECCLASS_EVENT, EVENT__STATUS, "status")
-   S_(SECCLASS_EVENT, EVENT__NOTIFY, "notify")
-   S_(SECCLASS_EVENT, EVENT__CREATE, "create")
-   S_(SECCLASS_EVENT, EVENT__RESET, "reset")
-   S_(SECCLASS_GRANT, GRANT__MAP_READ, "map_read")
-   S_(SECCLASS_GRANT, GRANT__MAP_WRITE, "map_write")
-   S_(SECCLASS_GRANT, GRANT__UNMAP, "unmap")
-   S_(SECCLASS_GRANT, GRANT__TRANSFER, "transfer")
-   S_(SECCLASS_GRANT, GRANT__SETUP, "setup")
-   S_(SECCLASS_GRANT, GRANT__COPY, "copy")
-   S_(SECCLASS_GRANT, GRANT__QUERY, "query")
-   S_(SECCLASS_MMU, MMU__MAP_READ, "map_read")
-   S_(SECCLASS_MMU, MMU__MAP_WRITE, "map_write")
-   S_(SECCLASS_MMU, MMU__PAGEINFO, "pageinfo")
-   S_(SECCLASS_MMU, MMU__PAGELIST, "pagelist")
-   S_(SECCLASS_MMU, MMU__ADJUST, "adjust")
-   S_(SECCLASS_MMU, MMU__STAT, "stat")
-   S_(SECCLASS_MMU, MMU__TRANSLATEGP, "translategp")
-   S_(SECCLASS_MMU, MMU__UPDATEMP, "updatemp")
-   S_(SECCLASS_MMU, MMU__PHYSMAP, "physmap")
-   S_(SECCLASS_MMU, MMU__PINPAGE, "pinpage")
-   S_(SECCLASS_MMU, MMU__MFNLIST, "mfnlist")
-   S_(SECCLASS_MMU, MMU__MEMORYMAP, "memorymap")
-   S_(SECCLASS_MMU, MMU__REMOTE_REMAP, "remote_remap")
-   S_(SECCLASS_MMU, MMU__MMUEXT_OP, "mmuext_op")
-   S_(SECCLASS_MMU, MMU__EXCHANGE, "exchange")
-   S_(SECCLASS_SHADOW, SHADOW__DISABLE, "disable")
-   S_(SECCLASS_SHADOW, SHADOW__ENABLE, "enable")
-   S_(SECCLASS_SHADOW, SHADOW__LOGDIRTY, "logdirty")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD, "add")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE, "remove")
-   S_(SECCLASS_RESOURCE, RESOURCE__USE, "use")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD_IRQ, "add_irq")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, "remove_irq")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD_IOPORT, "add_ioport")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE_IOPORT, "remove_ioport")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD_IOMEM, "add_iomem")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE_IOMEM, "remove_iomem")
-   S_(SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, "stat_device")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD_DEVICE, "add_device")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE_DEVICE, "remove_device")
-   S_(SECCLASS_RESOURCE, RESOURCE__PLUG, "plug")
-   S_(SECCLASS_RESOURCE, RESOURCE__UNPLUG, "unplug")
-   S_(SECCLASS_RESOURCE, RESOURCE__SETUP, "setup")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_AV, "compute_av")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_CREATE, "compute_create")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_MEMBER, "compute_member")
-   S_(SECCLASS_SECURITY, SECURITY__CHECK_CONTEXT, "check_context")
-   S_(SECCLASS_SECURITY, SECURITY__LOAD_POLICY, "load_policy")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_RELABEL, "compute_relabel")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_USER, "compute_user")
-   S_(SECCLASS_SECURITY, SECURITY__SETENFORCE, "setenforce")
-   S_(SECCLASS_SECURITY, SECURITY__SETBOOL, "setbool")
-   S_(SECCLASS_SECURITY, SECURITY__SETSECPARAM, "setsecparam")
-   S_(SECCLASS_SECURITY, SECURITY__ADD_OCONTEXT, "add_ocontext")
-   S_(SECCLASS_SECURITY, SECURITY__DEL_OCONTEXT, "del_ocontext")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
deleted file mode 100644
index 65302e8..0000000
--- a/xen/xsm/flask/include/av_permissions.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-#define XEN__SCHEDULER                            0x00000001UL
-#define XEN__SETTIME                              0x00000002UL
-#define XEN__TBUFCONTROL                          0x00000004UL
-#define XEN__READCONSOLE                          0x00000008UL
-#define XEN__CLEARCONSOLE                         0x00000010UL
-#define XEN__PERFCONTROL                          0x00000020UL
-#define XEN__MTRR_ADD                             0x00000040UL
-#define XEN__MTRR_DEL                             0x00000080UL
-#define XEN__MTRR_READ                            0x00000100UL
-#define XEN__MICROCODE                            0x00000200UL
-#define XEN__PHYSINFO                             0x00000400UL
-#define XEN__QUIRK                                0x00000800UL
-#define XEN__WRITECONSOLE                         0x00001000UL
-#define XEN__READAPIC                             0x00002000UL
-#define XEN__WRITEAPIC                            0x00004000UL
-#define XEN__PRIVPROFILE                          0x00008000UL
-#define XEN__NONPRIVPROFILE                       0x00010000UL
-#define XEN__KEXEC                                0x00020000UL
-#define XEN__FIRMWARE                             0x00040000UL
-#define XEN__SLEEP                                0x00080000UL
-#define XEN__FREQUENCY                            0x00100000UL
-#define XEN__GETIDLE                              0x00200000UL
-#define XEN__DEBUG                                0x00400000UL
-#define XEN__GETCPUINFO                           0x00800000UL
-#define XEN__HEAP                                 0x01000000UL
-#define XEN__PM_OP                                0x02000000UL
-#define XEN__MCA_OP                               0x04000000UL
-#define XEN__LOCKPROF                             0x08000000UL
-#define XEN__CPUPOOL_OP                           0x10000000UL
-#define XEN__SCHED_OP                             0x20000000UL
-#define XEN__TMEM_OP                              0x40000000UL
-#define XEN__TMEM_CONTROL                         0x80000000UL
-
-#define DOMAIN__SETVCPUCONTEXT                    0x00000001UL
-#define DOMAIN__PAUSE                             0x00000002UL
-#define DOMAIN__UNPAUSE                           0x00000004UL
-#define DOMAIN__RESUME                            0x00000008UL
-#define DOMAIN__CREATE                            0x00000010UL
-#define DOMAIN__TRANSITION                        0x00000020UL
-#define DOMAIN__MAX_VCPUS                         0x00000040UL
-#define DOMAIN__DESTROY                           0x00000080UL
-#define DOMAIN__SETVCPUAFFINITY                   0x00000100UL
-#define DOMAIN__GETVCPUAFFINITY                   0x00000200UL
-#define DOMAIN__SCHEDULER                         0x00000400UL
-#define DOMAIN__GETDOMAININFO                     0x00000800UL
-#define DOMAIN__GETVCPUINFO                       0x00001000UL
-#define DOMAIN__GETVCPUCONTEXT                    0x00002000UL
-#define DOMAIN__SETDOMAINMAXMEM                   0x00004000UL
-#define DOMAIN__SETDOMAINHANDLE                   0x00008000UL
-#define DOMAIN__SETDEBUGGING                      0x00010000UL
-#define DOMAIN__HYPERCALL                         0x00020000UL
-#define DOMAIN__SETTIME                           0x00040000UL
-#define DOMAIN__SET_TARGET                        0x00080000UL
-#define DOMAIN__SHUTDOWN                          0x00100000UL
-#define DOMAIN__SETADDRSIZE                       0x00200000UL
-#define DOMAIN__GETADDRSIZE                       0x00400000UL
-#define DOMAIN__TRIGGER                           0x00800000UL
-#define DOMAIN__GETEXTVCPUCONTEXT                 0x01000000UL
-#define DOMAIN__SETEXTVCPUCONTEXT                 0x02000000UL
-#define DOMAIN__GETVCPUEXTSTATE                   0x04000000UL
-#define DOMAIN__SETVCPUEXTSTATE                   0x08000000UL
-#define DOMAIN__GETPODTARGET                      0x10000000UL
-#define DOMAIN__SETPODTARGET                      0x20000000UL
-#define DOMAIN__SET_MISC_INFO                     0x40000000UL
-#define DOMAIN__SET_VIRQ_HANDLER                  0x80000000UL
-
-#define DOMAIN2__RELABELFROM                      0x00000001UL
-#define DOMAIN2__RELABELTO                        0x00000002UL
-#define DOMAIN2__RELABELSELF                      0x00000004UL
-#define DOMAIN2__MAKE_PRIV_FOR                    0x00000008UL
-#define DOMAIN2__SET_AS_TARGET                    0x00000010UL
-#define DOMAIN2__SET_CPUID                        0x00000020UL
-#define DOMAIN2__GETTSC                           0x00000040UL
-#define DOMAIN2__SETTSC                           0x00000080UL
-
-#define HVM__SETHVMC                              0x00000001UL
-#define HVM__GETHVMC                              0x00000002UL
-#define HVM__SETPARAM                             0x00000004UL
-#define HVM__GETPARAM                             0x00000008UL
-#define HVM__PCILEVEL                             0x00000010UL
-#define HVM__IRQLEVEL                             0x00000020UL
-#define HVM__PCIROUTE                             0x00000040UL
-#define HVM__BIND_IRQ                             0x00000080UL
-#define HVM__CACHEATTR                            0x00000100UL
-#define HVM__TRACKDIRTYVRAM                       0x00000200UL
-#define HVM__HVMCTL                               0x00000400UL
-#define HVM__MEM_EVENT                            0x00000800UL
-#define HVM__MEM_SHARING                          0x00001000UL
-#define HVM__AUDIT_P2M                            0x00002000UL
-#define HVM__SEND_IRQ                             0x00004000UL
-#define HVM__SHARE_MEM                            0x00008000UL
-
-#define EVENT__BIND                               0x00000001UL
-#define EVENT__SEND                               0x00000002UL
-#define EVENT__STATUS                             0x00000004UL
-#define EVENT__NOTIFY                             0x00000008UL
-#define EVENT__CREATE                             0x00000010UL
-#define EVENT__RESET                              0x00000020UL
-
-#define GRANT__MAP_READ                           0x00000001UL
-#define GRANT__MAP_WRITE                          0x00000002UL
-#define GRANT__UNMAP                              0x00000004UL
-#define GRANT__TRANSFER                           0x00000008UL
-#define GRANT__SETUP                              0x00000010UL
-#define GRANT__COPY                               0x00000020UL
-#define GRANT__QUERY                              0x00000040UL
-
-#define MMU__MAP_READ                             0x00000001UL
-#define MMU__MAP_WRITE                            0x00000002UL
-#define MMU__PAGEINFO                             0x00000004UL
-#define MMU__PAGELIST                             0x00000008UL
-#define MMU__ADJUST                               0x00000010UL
-#define MMU__STAT                                 0x00000020UL
-#define MMU__TRANSLATEGP                          0x00000040UL
-#define MMU__UPDATEMP                             0x00000080UL
-#define MMU__PHYSMAP                              0x00000100UL
-#define MMU__PINPAGE                              0x00000200UL
-#define MMU__MFNLIST                              0x00000400UL
-#define MMU__MEMORYMAP                            0x00000800UL
-#define MMU__REMOTE_REMAP                         0x00001000UL
-#define MMU__MMUEXT_OP                            0x00002000UL
-#define MMU__EXCHANGE                             0x00004000UL
-
-#define SHADOW__DISABLE                           0x00000001UL
-#define SHADOW__ENABLE                            0x00000002UL
-#define SHADOW__LOGDIRTY                          0x00000004UL
-
-#define RESOURCE__ADD                             0x00000001UL
-#define RESOURCE__REMOVE                          0x00000002UL
-#define RESOURCE__USE                             0x00000004UL
-#define RESOURCE__ADD_IRQ                         0x00000008UL
-#define RESOURCE__REMOVE_IRQ                      0x00000010UL
-#define RESOURCE__ADD_IOPORT                      0x00000020UL
-#define RESOURCE__REMOVE_IOPORT                   0x00000040UL
-#define RESOURCE__ADD_IOMEM                       0x00000080UL
-#define RESOURCE__REMOVE_IOMEM                    0x00000100UL
-#define RESOURCE__STAT_DEVICE                     0x00000200UL
-#define RESOURCE__ADD_DEVICE                      0x00000400UL
-#define RESOURCE__REMOVE_DEVICE                   0x00000800UL
-#define RESOURCE__PLUG                            0x00001000UL
-#define RESOURCE__UNPLUG                          0x00002000UL
-#define RESOURCE__SETUP                           0x00004000UL
-
-#define SECURITY__COMPUTE_AV                      0x00000001UL
-#define SECURITY__COMPUTE_CREATE                  0x00000002UL
-#define SECURITY__COMPUTE_MEMBER                  0x00000004UL
-#define SECURITY__CHECK_CONTEXT                   0x00000008UL
-#define SECURITY__LOAD_POLICY                     0x00000010UL
-#define SECURITY__COMPUTE_RELABEL                 0x00000020UL
-#define SECURITY__COMPUTE_USER                    0x00000040UL
-#define SECURITY__SETENFORCE                      0x00000080UL
-#define SECURITY__SETBOOL                         0x00000100UL
-#define SECURITY__SETSECPARAM                     0x00000200UL
-#define SECURITY__ADD_OCONTEXT                    0x00000400UL
-#define SECURITY__DEL_OCONTEXT                    0x00000800UL
-
diff --git a/xen/xsm/flask/include/class_to_string.h b/xen/xsm/flask/include/class_to_string.h
deleted file mode 100644
index 7716645..0000000
--- a/xen/xsm/flask/include/class_to_string.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-/*
- * Security object class definitions
- */
-    S_("null")
-    S_("xen")
-    S_("domain")
-    S_("domain2")
-    S_("hvm")
-    S_("mmu")
-    S_("resource")
-    S_("shadow")
-    S_("event")
-    S_("grant")
-    S_("security")
diff --git a/xen/xsm/flask/include/flask.h b/xen/xsm/flask/include/flask.h
deleted file mode 100644
index 3bff998..0000000
--- a/xen/xsm/flask/include/flask.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-#ifndef _SELINUX_FLASK_H_
-#define _SELINUX_FLASK_H_
-
-/*
- * Security object class definitions
- */
-#define SECCLASS_XEN                                     1
-#define SECCLASS_DOMAIN                                  2
-#define SECCLASS_DOMAIN2                                 3
-#define SECCLASS_HVM                                     4
-#define SECCLASS_MMU                                     5
-#define SECCLASS_RESOURCE                                6
-#define SECCLASS_SHADOW                                  7
-#define SECCLASS_EVENT                                   8
-#define SECCLASS_GRANT                                   9
-#define SECCLASS_SECURITY                                10
-
-/*
- * Security identifier indices for initial entities
- */
-#define SECINITSID_XEN                                  1
-#define SECINITSID_DOM0                                 2
-#define SECINITSID_DOMIO                                3
-#define SECINITSID_DOMXEN                               4
-#define SECINITSID_UNLABELED                            5
-#define SECINITSID_SECURITY                             6
-#define SECINITSID_IOPORT                               7
-#define SECINITSID_IOMEM                                8
-#define SECINITSID_IRQ                                  9
-#define SECINITSID_DEVICE                               10
-
-#define SECINITSID_NUM                                  10
-
-#endif
diff --git a/xen/xsm/flask/include/initial_sid_to_string.h b/xen/xsm/flask/include/initial_sid_to_string.h
deleted file mode 100644
index 814f4bf..0000000
--- a/xen/xsm/flask/include/initial_sid_to_string.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-static char *initial_sid_to_string[] =
-{
-    "null",
-    "xen",
-    "dom0",
-    "domio",
-    "domxen",
-    "unlabeled",
-    "security",
-    "ioport",
-    "iomem",
-    "irq",
-    "device",
-};
-
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
new file mode 100644
index 0000000..7a7e253
--- /dev/null
+++ b/xen/xsm/flask/policy/access_vectors
@@ -0,0 +1,190 @@
+#
+# Define the access vectors.
+#
+# class class_name { permission_name ... }
+
+class xen
+{
+	scheduler
+	settime
+	tbufcontrol
+	readconsole
+	clearconsole
+	perfcontrol
+	mtrr_add
+	mtrr_del
+	mtrr_read
+	microcode
+	physinfo
+	quirk
+    writeconsole
+    readapic
+    writeapic
+    privprofile
+    nonprivprofile
+    kexec
+	firmware
+	sleep
+	frequency
+	getidle
+	debug
+	getcpuinfo
+	heap
+	pm_op
+	mca_op
+	lockprof
+	cpupool_op
+	sched_op
+	tmem_op
+	tmem_control
+}
+
+class domain
+{
+	setvcpucontext
+	pause
+	unpause
+    resume
+    create
+    transition
+    max_vcpus
+    destroy
+    setvcpuaffinity
+	getvcpuaffinity
+	scheduler
+	getdomaininfo
+	getvcpuinfo
+	getvcpucontext
+	setdomainmaxmem
+	setdomainhandle
+	setdebugging
+	hypercall
+    settime
+    set_target
+    shutdown
+    setaddrsize
+    getaddrsize
+	trigger
+	getextvcpucontext
+	setextvcpucontext
+	getvcpuextstate
+	setvcpuextstate
+	getpodtarget
+	setpodtarget
+	set_misc_info
+	set_virq_handler
+}
+
+class domain2
+{
+	relabelfrom
+	relabelto
+	relabelself
+	make_priv_for
+	set_as_target
+	set_cpuid
+	gettsc
+	settsc
+}
+
+class hvm
+{
+    sethvmc
+    gethvmc
+    setparam
+    getparam
+    pcilevel
+    irqlevel
+    pciroute
+	bind_irq
+	cacheattr
+    trackdirtyvram
+    hvmctl
+    mem_event
+    mem_sharing
+    audit_p2m
+    send_irq
+    share_mem
+}
+
+class event
+{
+	bind
+	send
+	status
+	notify
+	create
+    reset
+}
+
+class grant
+{
+	map_read
+	map_write
+	unmap
+	transfer
+	setup
+    copy
+    query
+}
+
+class mmu
+{
+	map_read
+	map_write
+	pageinfo
+	pagelist
+    adjust
+    stat
+    translategp
+	updatemp
+    physmap
+    pinpage
+    mfnlist
+    memorymap
+    remote_remap
+	mmuext_op
+	exchange
+}
+
+class shadow
+{
+	disable
+	enable
+    logdirty
+}
+
+class resource
+{
+	add
+	remove
+	use
+	add_irq
+	remove_irq
+	add_ioport
+	remove_ioport
+	add_iomem
+	remove_iomem
+	stat_device
+	add_device
+	remove_device
+	plug
+	unplug
+	setup
+}
+
+class security
+{
+	compute_av
+	compute_create
+	compute_member
+	check_context
+	load_policy
+	compute_relabel
+	compute_user
+	setenforce
+	setbool
+	setsecparam
+        add_ocontext
+        del_ocontext
+}
diff --git a/xen/xsm/flask/policy/initial_sids b/xen/xsm/flask/policy/initial_sids
new file mode 100644
index 0000000..e508bde
--- /dev/null
+++ b/xen/xsm/flask/policy/initial_sids
@@ -0,0 +1,16 @@
+# FLASK
+
+#
+# Define initial security identifiers 
+#
+sid xen
+sid dom0
+sid domio
+sid domxen
+sid unlabeled
+sid security
+sid ioport
+sid iomem
+sid irq
+sid device
+# FLASK
diff --git a/xen/xsm/flask/policy/mkaccess_vector.sh b/xen/xsm/flask/policy/mkaccess_vector.sh
new file mode 100644
index 0000000..8ec87f7
--- /dev/null
+++ b/xen/xsm/flask/policy/mkaccess_vector.sh
@@ -0,0 +1,138 @@
+#!/bin/sh -
+#
+
+# FLASK
+
+set -e
+
+awk=$1
+shift
+
+# output files
+av_permissions="include/av_permissions.h"
+av_perm_to_string="include/av_perm_to_string.h"
+
+cat $* | $awk "
+BEGIN	{
+		outfile = \"$av_permissions\"
+		avpermfile = \"$av_perm_to_string\"
+		"'
+		nextstate = "COMMON_OR_AV";
+		printf("/* This file is automatically generated.  Do not edit. */\n") > outfile;
+		printf("/* This file is automatically generated.  Do not edit. */\n") > avpermfile;
+;
+	}
+/^[ \t]*#/	{ 
+			next;
+		}
+$1 == "class"	{
+			if (nextstate != "COMMON_OR_AV" &&
+			    nextstate != "CLASS_OR_CLASS-OPENBRACKET")
+			{
+				printf("Parse error:  Unexpected class definition on line %d\n", NR);
+				next;	
+			}
+
+			tclass = $2;
+
+			if (tclass in av_defined)
+			{
+				printf("Duplicate access vector definition for %s on line %d\n", tclass, NR);
+				next;
+			} 
+			av_defined[tclass] = 1;
+
+			permission = 1;
+
+			nextstate = "INHERITS_OR_CLASS-OPENBRACKET";
+			next;
+		}
+$1 == "{"	{ 
+			if (nextstate != "INHERITS_OR_CLASS-OPENBRACKET" &&
+			    nextstate != "CLASS_OR_CLASS-OPENBRACKET" &&
+			    nextstate != "COMMON-OPENBRACKET")
+			{
+				printf("Parse error:  Unexpected { on line %d\n", NR);
+				next;
+			}
+
+			if (nextstate == "INHERITS_OR_CLASS-OPENBRACKET")
+				nextstate = "CLASS-CLOSEBRACKET";
+
+			if (nextstate == "CLASS_OR_CLASS-OPENBRACKET")
+				nextstate = "CLASS-CLOSEBRACKET";
+
+			if (nextstate == "COMMON-OPENBRACKET")
+				nextstate = "COMMON-CLOSEBRACKET";
+		}
+/[a-z][a-z_]*/	{
+			if (nextstate != "COMMON-CLOSEBRACKET" &&
+			    nextstate != "CLASS-CLOSEBRACKET")
+			{
+				printf("Parse error:  Unexpected symbol %s on line %d\n", $1, NR);		
+				next;
+			}
+
+			if (nextstate == "COMMON-CLOSEBRACKET")
+			{
+				if ((common_name,$1) in common_perms)
+				{
+					printf("Duplicate permission %s for common %s on line %d.\n", $1, common_name, NR);
+					next;
+				}
+
+				common_perms[common_name,$1] = permission;
+
+				printf("#define COMMON_%s__%s", toupper(common_name), toupper($1)) > outfile; 
+
+				printf("    S_(\"%s\")\n", $1) > cpermfile;
+			}
+			else
+			{
+				if ((tclass,$1) in av_perms)
+				{
+					printf("Duplicate permission %s for %s on line %d.\n", $1, tclass, NR);
+					next;
+				}
+
+				av_perms[tclass,$1] = permission;
+		
+				printf("#define %s__%s", toupper(tclass), toupper($1)) > outfile; 
+
+				printf("   S_(SECCLASS_%s, %s__%s, \"%s\")\n", toupper(tclass), toupper(tclass), toupper($1), $1) > avpermfile; 
+			}
+
+			spaces = 40 - (length($1) + length(tclass));
+			if (spaces < 1)
+			      spaces = 1;
+
+			for (i = 0; i < spaces; i++) 
+				printf(" ") > outfile; 
+			printf("0x%08xUL\n", permission) > outfile; 
+			permission = permission * 2;
+		}
+$1 == "}"	{
+			if (nextstate != "CLASS-CLOSEBRACKET" && 
+			    nextstate != "COMMON-CLOSEBRACKET")
+			{
+				printf("Parse error:  Unexpected } on line %d\n", NR);
+				next;
+			}
+
+			if (nextstate == "COMMON-CLOSEBRACKET")
+			{
+				common_base[common_name] = permission;
+				printf("TE_(common_%s_perm_to_string)\n\n", common_name) > cpermfile; 
+			}
+
+			printf("\n") > outfile;
+
+			nextstate = "COMMON_OR_AV";
+		}
+END	{
+		if (nextstate != "COMMON_OR_AV" && nextstate != "CLASS_OR_CLASS-OPENBRACKET")
+			printf("Parse error:  Unexpected end of file\n");
+
+	}'
+
+# FLASK
diff --git a/xen/xsm/flask/policy/mkflask.sh b/xen/xsm/flask/policy/mkflask.sh
new file mode 100644
index 0000000..e8d8fb5
--- /dev/null
+++ b/xen/xsm/flask/policy/mkflask.sh
@@ -0,0 +1,95 @@
+#!/bin/sh -
+#
+
+# FLASK
+
+set -e
+
+awk=$1
+shift 1
+
+# output file
+output_file="include/flask.h"
+debug_file="include/class_to_string.h"
+debug_file2="include/initial_sid_to_string.h"
+
+cat $* | $awk "
+BEGIN	{
+		outfile = \"$output_file\"
+		debugfile = \"$debug_file\"
+		debugfile2 = \"$debug_file2\"
+		"'
+		nextstate = "CLASS";
+
+		printf("/* This file is automatically generated.  Do not edit. */\n") > outfile;
+
+		printf("#ifndef _SELINUX_FLASK_H_\n") > outfile;
+		printf("#define _SELINUX_FLASK_H_\n") > outfile;
+		printf("\n/*\n * Security object class definitions\n */\n") > outfile;
+		printf("/* This file is automatically generated.  Do not edit. */\n") > debugfile;
+		printf("/*\n * Security object class definitions\n */\n") > debugfile;
+		printf("    S_(\"null\")\n") > debugfile;
+		printf("/* This file is automatically generated.  Do not edit. */\n") > debugfile2;
+		printf("static char *initial_sid_to_string[] =\n{\n") > debugfile2;
+		printf("    \"null\",\n") > debugfile2;
+	}
+/^[ \t]*#/	{ 
+			next;
+		}
+$1 == "class"	{ 
+			if (nextstate != "CLASS")
+			{
+				printf("Parse error:  Unexpected class definition on line %d\n", NR);
+				next;	
+			}
+
+			if ($2 in class_found)
+			{
+				printf("Duplicate class definition for %s on line %d.\n", $2, NR);
+				next;
+			}	
+			class_found[$2] = 1;
+
+			class_value++;
+
+			printf("#define SECCLASS_%s", toupper($2)) > outfile;
+			for (i = 0; i < 40 - length($2); i++) 
+				printf(" ") > outfile; 
+			printf("%d\n", class_value) > outfile; 
+
+			printf("    S_(\"%s\")\n", $2) > debugfile;
+		}
+$1 == "sid"	{ 
+			if (nextstate == "CLASS")
+			{
+			    nextstate = "SID";
+			    printf("\n/*\n * Security identifier indices for initial entities\n */\n") > outfile;			    
+			}
+
+			if ($2 in sid_found)
+			{
+				printf("Duplicate SID definition for %s on line %d.\n", $2, NR);
+				next;
+			}	
+			sid_found[$2] = 1;
+			sid_value++;
+
+			printf("#define SECINITSID_%s", toupper($2)) > outfile;
+			for (i = 0; i < 37 - length($2); i++) 
+				printf(" ") > outfile; 
+			printf("%d\n", sid_value) > outfile; 
+			printf("    \"%s\",\n", $2) > debugfile2;
+		}
+END	{
+		if (nextstate != "SID")
+			printf("Parse error:  Unexpected end of file\n");
+
+		printf("\n#define SECINITSID_NUM") > outfile;
+		for (i = 0; i < 34; i++) 
+			printf(" ") > outfile; 
+		printf("%d\n", sid_value) > outfile; 
+		printf("\n#endif\n") > outfile;
+		printf("};\n\n") > debugfile2;
+	}'
+
+# FLASK
diff --git a/xen/xsm/flask/policy/security_classes b/xen/xsm/flask/policy/security_classes
new file mode 100644
index 0000000..ef134a7
--- /dev/null
+++ b/xen/xsm/flask/policy/security_classes
@@ -0,0 +1,21 @@
+# FLASK
+
+#
+# Define the security object classes 
+#
+
+# Classes marked as userspace are classes
+# for userspace object managers
+
+class xen
+class domain
+class domain2
+class hvm
+class mmu
+class resource
+class shadow
+class event
+class grant
+class security
+
+# FLASK
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:53 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSev-0002V0-8u; Fri, 30 Nov 2012 15:37:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSeq-0002MP-JB
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:41 +0000
Received: from [193.109.254.147:42697] by server-16.bemta-14.messagelabs.com
	id 5A/27-09215-4C2D8B05; Fri, 30 Nov 2012 15:37:40 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-10.tower-27.messagelabs.com!1354289856!3771828!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25788 invoked from network); 30 Nov 2012 15:37:36 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-10.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:36 -0000
X-TM-IMSS-Message-ID: <d0a0f209000589c9@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0f209000589c9 ;
	Fri, 30 Nov 2012 10:37:40 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSdC017785; 
	Fri, 30 Nov 2012 10:37:34 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:06 -0500
Message-Id: <1354289830-24642-20-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: [Xen-devel] [PATCH 19/23] flask: move policy headers into hypervisor
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Rather than keeping around headers that are autogenerated in order to
avoid adding build dependencies from xen/ to files in tools/, move the
relevant parts of the FLASK policy into the hypervisor tree and generate
the headers as part of the hypervisor's build.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 .gitignore                                         |   5 +
 .hgignore                                          |   5 +
 tools/flask/policy/Makefile                        |   2 +-
 tools/flask/policy/policy/flask/Makefile           |  41 -----
 tools/flask/policy/policy/flask/access_vectors     | 190 ---------------------
 tools/flask/policy/policy/flask/initial_sids       |  16 --
 tools/flask/policy/policy/flask/mkaccess_vector.sh | 138 ---------------
 tools/flask/policy/policy/flask/mkflask.sh         |  95 -----------
 tools/flask/policy/policy/flask/security_classes   |  21 ---
 xen/xsm/flask/Makefile                             |  25 +++
 xen/xsm/flask/include/av_perm_to_string.h          | 147 ----------------
 xen/xsm/flask/include/av_permissions.h             | 157 -----------------
 xen/xsm/flask/include/class_to_string.h            |  15 --
 xen/xsm/flask/include/flask.h                      |  35 ----
 xen/xsm/flask/include/initial_sid_to_string.h      |  16 --
 xen/xsm/flask/policy/access_vectors                | 190 +++++++++++++++++++++
 xen/xsm/flask/policy/initial_sids                  |  16 ++
 xen/xsm/flask/policy/mkaccess_vector.sh            | 138 +++++++++++++++
 xen/xsm/flask/policy/mkflask.sh                    |  95 +++++++++++
 xen/xsm/flask/policy/security_classes              |  21 +++
 20 files changed, 496 insertions(+), 872 deletions(-)
 delete mode 100644 tools/flask/policy/policy/flask/Makefile
 delete mode 100644 tools/flask/policy/policy/flask/access_vectors
 delete mode 100644 tools/flask/policy/policy/flask/initial_sids
 delete mode 100644 tools/flask/policy/policy/flask/mkaccess_vector.sh
 delete mode 100644 tools/flask/policy/policy/flask/mkflask.sh
 delete mode 100644 tools/flask/policy/policy/flask/security_classes
 delete mode 100644 xen/xsm/flask/include/av_perm_to_string.h
 delete mode 100644 xen/xsm/flask/include/av_permissions.h
 delete mode 100644 xen/xsm/flask/include/class_to_string.h
 delete mode 100644 xen/xsm/flask/include/flask.h
 delete mode 100644 xen/xsm/flask/include/initial_sid_to_string.h
 create mode 100644 xen/xsm/flask/policy/access_vectors
 create mode 100644 xen/xsm/flask/policy/initial_sids
 create mode 100644 xen/xsm/flask/policy/mkaccess_vector.sh
 create mode 100644 xen/xsm/flask/policy/mkflask.sh
 create mode 100644 xen/xsm/flask/policy/security_classes

diff --git a/.gitignore b/.gitignore
index f6edc43..aac7a14 100644
--- a/.gitignore
+++ b/.gitignore
@@ -309,6 +309,11 @@ xen/include/xen/banner.h
 xen/include/xen/compile.h
 xen/tools/figlet/figlet
 xen/tools/symbols
+xen/xsm/flask/include/av_perm_to_string.h
+xen/xsm/flask/include/av_permissions.h
+xen/xsm/flask/include/class_to_string.h
+xen/xsm/flask/include/flask.h
+xen/xsm/flask/include/initial_sid_to_string.h
 xen/xen
 xen/xen-syms
 xen/xen.*
diff --git a/.hgignore b/.hgignore
index 344792a..5ed903f 100644
--- a/.hgignore
+++ b/.hgignore
@@ -339,6 +339,11 @@
 ^xen/include/xen/compile\.h$
 ^xen/tools/figlet/figlet$
 ^xen/tools/symbols$
+^xen/xsm/flask/include/av_perm_to_string\.h$
+^xen/xsm/flask/include/av_permissions\.h$
+^xen/xsm/flask/include/class_to_string\.h$
+^xen/xsm/flask/include/flask\.h$
+^xen/xsm/flask/include/initial_sid_to_string\.h$
 ^xen/xen$
 ^xen/xen-syms$
 ^xen/xen\..*$
diff --git a/tools/flask/policy/Makefile b/tools/flask/policy/Makefile
index 5c25cbe..3f5aa38 100644
--- a/tools/flask/policy/Makefile
+++ b/tools/flask/policy/Makefile
@@ -61,7 +61,7 @@ LOADPOLICY := $(SBINDIR)/flask-loadpolicy
 # policy source layout
 POLDIR := policy
 MODDIR := $(POLDIR)/modules
-FLASKDIR := $(POLDIR)/flask
+FLASKDIR := ../../../xen/xsm/flask/policy
 SECCLASS := $(FLASKDIR)/security_classes
 ISIDS := $(FLASKDIR)/initial_sids
 AVS := $(FLASKDIR)/access_vectors
diff --git a/tools/flask/policy/policy/flask/Makefile b/tools/flask/policy/policy/flask/Makefile
deleted file mode 100644
index 5f57e88..0000000
--- a/tools/flask/policy/policy/flask/Makefile
+++ /dev/null
@@ -1,41 +0,0 @@
-# flask needs to know where to export the libselinux headers.
-LIBSEL ?= ../../libselinux
-
-# flask needs to know where to export the kernel headers.
-LINUXDIR ?= ../../../linux-2.6
-
-AWK = awk
-
-CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
-          else if [ -x /bin/bash ]; then echo /bin/bash; \
-          else echo sh; fi ; fi)
-
-FLASK_H_DEPEND = security_classes initial_sids
-AV_H_DEPEND = access_vectors
-
-FLASK_H_FILES = class_to_string.h flask.h initial_sid_to_string.h
-AV_H_FILES = av_perm_to_string.h av_permissions.h
-ALL_H_FILES = $(FLASK_H_FILES) $(AV_H_FILES)
-
-all:  $(ALL_H_FILES)
-
-$(FLASK_H_FILES): $(FLASK_H_DEPEND)
-	$(CONFIG_SHELL) mkflask.sh $(AWK) $(FLASK_H_DEPEND)
-
-$(AV_H_FILES): $(AV_H_DEPEND)
-	$(CONFIG_SHELL) mkaccess_vector.sh $(AWK) $(AV_H_DEPEND)
-
-tolib: all
-	install -m 644 flask.h av_permissions.h $(LIBSEL)/include/selinux
-	install -m 644 class_to_string.h av_inherit.h common_perm_to_string.h av_perm_to_string.h $(LIBSEL)/src
-
-tokern: all
-	install -m 644 $(ALL_H_FILES) $(LINUXDIR)/security/selinux/include
-
-install: all
-
-relabel:
-
-clean:  
-	rm -f $(FLASK_H_FILES)
-	rm -f $(AV_H_FILES)
diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
deleted file mode 100644
index 7a7e253..0000000
--- a/tools/flask/policy/policy/flask/access_vectors
+++ /dev/null
@@ -1,190 +0,0 @@
-#
-# Define the access vectors.
-#
-# class class_name { permission_name ... }
-
-class xen
-{
-	scheduler
-	settime
-	tbufcontrol
-	readconsole
-	clearconsole
-	perfcontrol
-	mtrr_add
-	mtrr_del
-	mtrr_read
-	microcode
-	physinfo
-	quirk
-    writeconsole
-    readapic
-    writeapic
-    privprofile
-    nonprivprofile
-    kexec
-	firmware
-	sleep
-	frequency
-	getidle
-	debug
-	getcpuinfo
-	heap
-	pm_op
-	mca_op
-	lockprof
-	cpupool_op
-	sched_op
-	tmem_op
-	tmem_control
-}
-
-class domain
-{
-	setvcpucontext
-	pause
-	unpause
-    resume
-    create
-    transition
-    max_vcpus
-    destroy
-    setvcpuaffinity
-	getvcpuaffinity
-	scheduler
-	getdomaininfo
-	getvcpuinfo
-	getvcpucontext
-	setdomainmaxmem
-	setdomainhandle
-	setdebugging
-	hypercall
-    settime
-    set_target
-    shutdown
-    setaddrsize
-    getaddrsize
-	trigger
-	getextvcpucontext
-	setextvcpucontext
-	getvcpuextstate
-	setvcpuextstate
-	getpodtarget
-	setpodtarget
-	set_misc_info
-	set_virq_handler
-}
-
-class domain2
-{
-	relabelfrom
-	relabelto
-	relabelself
-	make_priv_for
-	set_as_target
-	set_cpuid
-	gettsc
-	settsc
-}
-
-class hvm
-{
-    sethvmc
-    gethvmc
-    setparam
-    getparam
-    pcilevel
-    irqlevel
-    pciroute
-	bind_irq
-	cacheattr
-    trackdirtyvram
-    hvmctl
-    mem_event
-    mem_sharing
-    audit_p2m
-    send_irq
-    share_mem
-}
-
-class event
-{
-	bind
-	send
-	status
-	notify
-	create
-    reset
-}
-
-class grant
-{
-	map_read
-	map_write
-	unmap
-	transfer
-	setup
-    copy
-    query
-}
-
-class mmu
-{
-	map_read
-	map_write
-	pageinfo
-	pagelist
-    adjust
-    stat
-    translategp
-	updatemp
-    physmap
-    pinpage
-    mfnlist
-    memorymap
-    remote_remap
-	mmuext_op
-	exchange
-}
-
-class shadow
-{
-	disable
-	enable
-    logdirty
-}
-
-class resource
-{
-	add
-	remove
-	use
-	add_irq
-	remove_irq
-	add_ioport
-	remove_ioport
-	add_iomem
-	remove_iomem
-	stat_device
-	add_device
-	remove_device
-	plug
-	unplug
-	setup
-}
-
-class security
-{
-	compute_av
-	compute_create
-	compute_member
-	check_context
-	load_policy
-	compute_relabel
-	compute_user
-	setenforce
-	setbool
-	setsecparam
-        add_ocontext
-        del_ocontext
-}
diff --git a/tools/flask/policy/policy/flask/initial_sids b/tools/flask/policy/policy/flask/initial_sids
deleted file mode 100644
index e508bde..0000000
--- a/tools/flask/policy/policy/flask/initial_sids
+++ /dev/null
@@ -1,16 +0,0 @@
-# FLASK
-
-#
-# Define initial security identifiers 
-#
-sid xen
-sid dom0
-sid domio
-sid domxen
-sid unlabeled
-sid security
-sid ioport
-sid iomem
-sid irq
-sid device
-# FLASK
diff --git a/tools/flask/policy/policy/flask/mkaccess_vector.sh b/tools/flask/policy/policy/flask/mkaccess_vector.sh
deleted file mode 100644
index 43a60a7..0000000
--- a/tools/flask/policy/policy/flask/mkaccess_vector.sh
+++ /dev/null
@@ -1,138 +0,0 @@
-#!/bin/sh -
-#
-
-# FLASK
-
-set -e
-
-awk=$1
-shift
-
-# output files
-av_permissions="av_permissions.h"
-av_perm_to_string="av_perm_to_string.h"
-
-cat $* | $awk "
-BEGIN	{
-		outfile = \"$av_permissions\"
-		avpermfile = \"$av_perm_to_string\"
-		"'
-		nextstate = "COMMON_OR_AV";
-		printf("/* This file is automatically generated.  Do not edit. */\n") > outfile;
-		printf("/* This file is automatically generated.  Do not edit. */\n") > avpermfile;
-;
-	}
-/^[ \t]*#/	{ 
-			next;
-		}
-$1 == "class"	{
-			if (nextstate != "COMMON_OR_AV" &&
-			    nextstate != "CLASS_OR_CLASS-OPENBRACKET")
-			{
-				printf("Parse error:  Unexpected class definition on line %d\n", NR);
-				next;	
-			}
-
-			tclass = $2;
-
-			if (tclass in av_defined)
-			{
-				printf("Duplicate access vector definition for %s on line %d\n", tclass, NR);
-				next;
-			} 
-			av_defined[tclass] = 1;
-
-			permission = 1;
-
-			nextstate = "INHERITS_OR_CLASS-OPENBRACKET";
-			next;
-		}
-$1 == "{"	{ 
-			if (nextstate != "INHERITS_OR_CLASS-OPENBRACKET" &&
-			    nextstate != "CLASS_OR_CLASS-OPENBRACKET" &&
-			    nextstate != "COMMON-OPENBRACKET")
-			{
-				printf("Parse error:  Unexpected { on line %d\n", NR);
-				next;
-			}
-
-			if (nextstate == "INHERITS_OR_CLASS-OPENBRACKET")
-				nextstate = "CLASS-CLOSEBRACKET";
-
-			if (nextstate == "CLASS_OR_CLASS-OPENBRACKET")
-				nextstate = "CLASS-CLOSEBRACKET";
-
-			if (nextstate == "COMMON-OPENBRACKET")
-				nextstate = "COMMON-CLOSEBRACKET";
-		}
-/[a-z][a-z_]*/	{
-			if (nextstate != "COMMON-CLOSEBRACKET" &&
-			    nextstate != "CLASS-CLOSEBRACKET")
-			{
-				printf("Parse error:  Unexpected symbol %s on line %d\n", $1, NR);		
-				next;
-			}
-
-			if (nextstate == "COMMON-CLOSEBRACKET")
-			{
-				if ((common_name,$1) in common_perms)
-				{
-					printf("Duplicate permission %s for common %s on line %d.\n", $1, common_name, NR);
-					next;
-				}
-
-				common_perms[common_name,$1] = permission;
-
-				printf("#define COMMON_%s__%s", toupper(common_name), toupper($1)) > outfile; 
-
-				printf("    S_(\"%s\")\n", $1) > cpermfile;
-			}
-			else
-			{
-				if ((tclass,$1) in av_perms)
-				{
-					printf("Duplicate permission %s for %s on line %d.\n", $1, tclass, NR);
-					next;
-				}
-
-				av_perms[tclass,$1] = permission;
-		
-				printf("#define %s__%s", toupper(tclass), toupper($1)) > outfile; 
-
-				printf("   S_(SECCLASS_%s, %s__%s, \"%s\")\n", toupper(tclass), toupper(tclass), toupper($1), $1) > avpermfile; 
-			}
-
-			spaces = 40 - (length($1) + length(tclass));
-			if (spaces < 1)
-			      spaces = 1;
-
-			for (i = 0; i < spaces; i++) 
-				printf(" ") > outfile; 
-			printf("0x%08xUL\n", permission) > outfile; 
-			permission = permission * 2;
-		}
-$1 == "}"	{
-			if (nextstate != "CLASS-CLOSEBRACKET" && 
-			    nextstate != "COMMON-CLOSEBRACKET")
-			{
-				printf("Parse error:  Unexpected } on line %d\n", NR);
-				next;
-			}
-
-			if (nextstate == "COMMON-CLOSEBRACKET")
-			{
-				common_base[common_name] = permission;
-				printf("TE_(common_%s_perm_to_string)\n\n", common_name) > cpermfile; 
-			}
-
-			printf("\n") > outfile;
-
-			nextstate = "COMMON_OR_AV";
-		}
-END	{
-		if (nextstate != "COMMON_OR_AV" && nextstate != "CLASS_OR_CLASS-OPENBRACKET")
-			printf("Parse error:  Unexpected end of file\n");
-
-	}'
-
-# FLASK
diff --git a/tools/flask/policy/policy/flask/mkflask.sh b/tools/flask/policy/policy/flask/mkflask.sh
deleted file mode 100644
index 9c84754..0000000
--- a/tools/flask/policy/policy/flask/mkflask.sh
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/bin/sh -
-#
-
-# FLASK
-
-set -e
-
-awk=$1
-shift 1
-
-# output file
-output_file="flask.h"
-debug_file="class_to_string.h"
-debug_file2="initial_sid_to_string.h"
-
-cat $* | $awk "
-BEGIN	{
-		outfile = \"$output_file\"
-		debugfile = \"$debug_file\"
-		debugfile2 = \"$debug_file2\"
-		"'
-		nextstate = "CLASS";
-
-		printf("/* This file is automatically generated.  Do not edit. */\n") > outfile;
-
-		printf("#ifndef _SELINUX_FLASK_H_\n") > outfile;
-		printf("#define _SELINUX_FLASK_H_\n") > outfile;
-		printf("\n/*\n * Security object class definitions\n */\n") > outfile;
-		printf("/* This file is automatically generated.  Do not edit. */\n") > debugfile;
-		printf("/*\n * Security object class definitions\n */\n") > debugfile;
-		printf("    S_(\"null\")\n") > debugfile;
-		printf("/* This file is automatically generated.  Do not edit. */\n") > debugfile2;
-		printf("static char *initial_sid_to_string[] =\n{\n") > debugfile2;
-		printf("    \"null\",\n") > debugfile2;
-	}
-/^[ \t]*#/	{ 
-			next;
-		}
-$1 == "class"	{ 
-			if (nextstate != "CLASS")
-			{
-				printf("Parse error:  Unexpected class definition on line %d\n", NR);
-				next;	
-			}
-
-			if ($2 in class_found)
-			{
-				printf("Duplicate class definition for %s on line %d.\n", $2, NR);
-				next;
-			}	
-			class_found[$2] = 1;
-
-			class_value++;
-
-			printf("#define SECCLASS_%s", toupper($2)) > outfile;
-			for (i = 0; i < 40 - length($2); i++) 
-				printf(" ") > outfile; 
-			printf("%d\n", class_value) > outfile; 
-
-			printf("    S_(\"%s\")\n", $2) > debugfile;
-		}
-$1 == "sid"	{ 
-			if (nextstate == "CLASS")
-			{
-			    nextstate = "SID";
-			    printf("\n/*\n * Security identifier indices for initial entities\n */\n") > outfile;			    
-			}
-
-			if ($2 in sid_found)
-			{
-				printf("Duplicate SID definition for %s on line %d.\n", $2, NR);
-				next;
-			}	
-			sid_found[$2] = 1;
-			sid_value++;
-
-			printf("#define SECINITSID_%s", toupper($2)) > outfile;
-			for (i = 0; i < 37 - length($2); i++) 
-				printf(" ") > outfile; 
-			printf("%d\n", sid_value) > outfile; 
-			printf("    \"%s\",\n", $2) > debugfile2;
-		}
-END	{
-		if (nextstate != "SID")
-			printf("Parse error:  Unexpected end of file\n");
-
-		printf("\n#define SECINITSID_NUM") > outfile;
-		for (i = 0; i < 34; i++) 
-			printf(" ") > outfile; 
-		printf("%d\n", sid_value) > outfile; 
-		printf("\n#endif\n") > outfile;
-		printf("};\n\n") > debugfile2;
-	}'
-
-# FLASK
diff --git a/tools/flask/policy/policy/flask/security_classes b/tools/flask/policy/policy/flask/security_classes
deleted file mode 100644
index ef134a7..0000000
--- a/tools/flask/policy/policy/flask/security_classes
+++ /dev/null
@@ -1,21 +0,0 @@
-# FLASK
-
-#
-# Define the security object classes 
-#
-
-# Classes marked as userspace are classes
-# for userspace object managers
-
-class xen
-class domain
-class domain2
-class hvm
-class mmu
-class resource
-class shadow
-class event
-class grant
-class security
-
-# FLASK
diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile
index 92fb410..1256512 100644
--- a/xen/xsm/flask/Makefile
+++ b/xen/xsm/flask/Makefile
@@ -5,3 +5,28 @@ obj-y += flask_op.o
 subdir-y += ss
 
 CFLAGS += -I./include
+
+AWK = awk
+
+CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
+          else if [ -x /bin/bash ]; then echo /bin/bash; \
+          else echo sh; fi ; fi)
+
+FLASK_H_DEPEND = policy/security_classes policy/initial_sids
+AV_H_DEPEND = policy/access_vectors
+
+FLASK_H_FILES = include/flask.h include/class_to_string.h include/initial_sid_to_string.h
+AV_H_FILES = include/av_perm_to_string.h include/av_permissions.h
+ALL_H_FILES = $(FLASK_H_FILES) $(AV_H_FILES)
+
+$(obj-y) ss/built_in.o: $(ALL_H_FILES)
+
+$(FLASK_H_FILES): $(FLASK_H_DEPEND)
+	$(CONFIG_SHELL) policy/mkflask.sh $(AWK) $(FLASK_H_DEPEND)
+
+$(AV_H_FILES): $(AV_H_DEPEND)
+	$(CONFIG_SHELL) policy/mkaccess_vector.sh $(AWK) $(AV_H_DEPEND)
+
+.PHONY: clean
+clean::
+	rm -f $(ALL_H_FILES) *.o $(DEPS)
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
deleted file mode 100644
index c3f2370..0000000
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-   S_(SECCLASS_XEN, XEN__SCHEDULER, "scheduler")
-   S_(SECCLASS_XEN, XEN__SETTIME, "settime")
-   S_(SECCLASS_XEN, XEN__TBUFCONTROL, "tbufcontrol")
-   S_(SECCLASS_XEN, XEN__READCONSOLE, "readconsole")
-   S_(SECCLASS_XEN, XEN__CLEARCONSOLE, "clearconsole")
-   S_(SECCLASS_XEN, XEN__PERFCONTROL, "perfcontrol")
-   S_(SECCLASS_XEN, XEN__MTRR_ADD, "mtrr_add")
-   S_(SECCLASS_XEN, XEN__MTRR_DEL, "mtrr_del")
-   S_(SECCLASS_XEN, XEN__MTRR_READ, "mtrr_read")
-   S_(SECCLASS_XEN, XEN__MICROCODE, "microcode")
-   S_(SECCLASS_XEN, XEN__PHYSINFO, "physinfo")
-   S_(SECCLASS_XEN, XEN__QUIRK, "quirk")
-   S_(SECCLASS_XEN, XEN__WRITECONSOLE, "writeconsole")
-   S_(SECCLASS_XEN, XEN__READAPIC, "readapic")
-   S_(SECCLASS_XEN, XEN__WRITEAPIC, "writeapic")
-   S_(SECCLASS_XEN, XEN__PRIVPROFILE, "privprofile")
-   S_(SECCLASS_XEN, XEN__NONPRIVPROFILE, "nonprivprofile")
-   S_(SECCLASS_XEN, XEN__KEXEC, "kexec")
-   S_(SECCLASS_XEN, XEN__FIRMWARE, "firmware")
-   S_(SECCLASS_XEN, XEN__SLEEP, "sleep")
-   S_(SECCLASS_XEN, XEN__FREQUENCY, "frequency")
-   S_(SECCLASS_XEN, XEN__GETIDLE, "getidle")
-   S_(SECCLASS_XEN, XEN__DEBUG, "debug")
-   S_(SECCLASS_XEN, XEN__GETCPUINFO, "getcpuinfo")
-   S_(SECCLASS_XEN, XEN__HEAP, "heap")
-   S_(SECCLASS_XEN, XEN__PM_OP, "pm_op")
-   S_(SECCLASS_XEN, XEN__MCA_OP, "mca_op")
-   S_(SECCLASS_XEN, XEN__LOCKPROF, "lockprof")
-   S_(SECCLASS_XEN, XEN__CPUPOOL_OP, "cpupool_op")
-   S_(SECCLASS_XEN, XEN__SCHED_OP, "sched_op")
-   S_(SECCLASS_XEN, XEN__TMEM_OP, "tmem_op")
-   S_(SECCLASS_XEN, XEN__TMEM_CONTROL, "tmem_control")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETVCPUCONTEXT, "setvcpucontext")
-   S_(SECCLASS_DOMAIN, DOMAIN__PAUSE, "pause")
-   S_(SECCLASS_DOMAIN, DOMAIN__UNPAUSE, "unpause")
-   S_(SECCLASS_DOMAIN, DOMAIN__RESUME, "resume")
-   S_(SECCLASS_DOMAIN, DOMAIN__CREATE, "create")
-   S_(SECCLASS_DOMAIN, DOMAIN__TRANSITION, "transition")
-   S_(SECCLASS_DOMAIN, DOMAIN__MAX_VCPUS, "max_vcpus")
-   S_(SECCLASS_DOMAIN, DOMAIN__DESTROY, "destroy")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETVCPUAFFINITY, "setvcpuaffinity")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETVCPUAFFINITY, "getvcpuaffinity")
-   S_(SECCLASS_DOMAIN, DOMAIN__SCHEDULER, "scheduler")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO, "getdomaininfo")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETVCPUINFO, "getvcpuinfo")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETVCPUCONTEXT, "getvcpucontext")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETDOMAINMAXMEM, "setdomainmaxmem")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETDOMAINHANDLE, "setdomainhandle")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING, "setdebugging")
-   S_(SECCLASS_DOMAIN, DOMAIN__HYPERCALL, "hypercall")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETTIME, "settime")
-   S_(SECCLASS_DOMAIN, DOMAIN__SET_TARGET, "set_target")
-   S_(SECCLASS_DOMAIN, DOMAIN__SHUTDOWN, "shutdown")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETADDRSIZE, "setaddrsize")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETADDRSIZE, "getaddrsize")
-   S_(SECCLASS_DOMAIN, DOMAIN__TRIGGER, "trigger")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETEXTVCPUCONTEXT, "getextvcpucontext")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETEXTVCPUCONTEXT, "setextvcpucontext")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETVCPUEXTSTATE, "getvcpuextstate")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETVCPUEXTSTATE, "setvcpuextstate")
-   S_(SECCLASS_DOMAIN, DOMAIN__GETPODTARGET, "getpodtarget")
-   S_(SECCLASS_DOMAIN, DOMAIN__SETPODTARGET, "setpodtarget")
-   S_(SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO, "set_misc_info")
-   S_(SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER, "set_virq_handler")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELFROM, "relabelfrom")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELTO, "relabelto")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELSELF, "relabelself")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__MAKE_PRIV_FOR, "make_priv_for")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__SET_AS_TARGET, "set_as_target")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__SET_CPUID, "set_cpuid")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__GETTSC, "gettsc")
-   S_(SECCLASS_DOMAIN2, DOMAIN2__SETTSC, "settsc")
-   S_(SECCLASS_HVM, HVM__SETHVMC, "sethvmc")
-   S_(SECCLASS_HVM, HVM__GETHVMC, "gethvmc")
-   S_(SECCLASS_HVM, HVM__SETPARAM, "setparam")
-   S_(SECCLASS_HVM, HVM__GETPARAM, "getparam")
-   S_(SECCLASS_HVM, HVM__PCILEVEL, "pcilevel")
-   S_(SECCLASS_HVM, HVM__IRQLEVEL, "irqlevel")
-   S_(SECCLASS_HVM, HVM__PCIROUTE, "pciroute")
-   S_(SECCLASS_HVM, HVM__BIND_IRQ, "bind_irq")
-   S_(SECCLASS_HVM, HVM__CACHEATTR, "cacheattr")
-   S_(SECCLASS_HVM, HVM__TRACKDIRTYVRAM, "trackdirtyvram")
-   S_(SECCLASS_HVM, HVM__HVMCTL, "hvmctl")
-   S_(SECCLASS_HVM, HVM__MEM_EVENT, "mem_event")
-   S_(SECCLASS_HVM, HVM__MEM_SHARING, "mem_sharing")
-   S_(SECCLASS_HVM, HVM__AUDIT_P2M, "audit_p2m")
-   S_(SECCLASS_HVM, HVM__SEND_IRQ, "send_irq")
-   S_(SECCLASS_HVM, HVM__SHARE_MEM, "share_mem")
-   S_(SECCLASS_EVENT, EVENT__BIND, "bind")
-   S_(SECCLASS_EVENT, EVENT__SEND, "send")
-   S_(SECCLASS_EVENT, EVENT__STATUS, "status")
-   S_(SECCLASS_EVENT, EVENT__NOTIFY, "notify")
-   S_(SECCLASS_EVENT, EVENT__CREATE, "create")
-   S_(SECCLASS_EVENT, EVENT__RESET, "reset")
-   S_(SECCLASS_GRANT, GRANT__MAP_READ, "map_read")
-   S_(SECCLASS_GRANT, GRANT__MAP_WRITE, "map_write")
-   S_(SECCLASS_GRANT, GRANT__UNMAP, "unmap")
-   S_(SECCLASS_GRANT, GRANT__TRANSFER, "transfer")
-   S_(SECCLASS_GRANT, GRANT__SETUP, "setup")
-   S_(SECCLASS_GRANT, GRANT__COPY, "copy")
-   S_(SECCLASS_GRANT, GRANT__QUERY, "query")
-   S_(SECCLASS_MMU, MMU__MAP_READ, "map_read")
-   S_(SECCLASS_MMU, MMU__MAP_WRITE, "map_write")
-   S_(SECCLASS_MMU, MMU__PAGEINFO, "pageinfo")
-   S_(SECCLASS_MMU, MMU__PAGELIST, "pagelist")
-   S_(SECCLASS_MMU, MMU__ADJUST, "adjust")
-   S_(SECCLASS_MMU, MMU__STAT, "stat")
-   S_(SECCLASS_MMU, MMU__TRANSLATEGP, "translategp")
-   S_(SECCLASS_MMU, MMU__UPDATEMP, "updatemp")
-   S_(SECCLASS_MMU, MMU__PHYSMAP, "physmap")
-   S_(SECCLASS_MMU, MMU__PINPAGE, "pinpage")
-   S_(SECCLASS_MMU, MMU__MFNLIST, "mfnlist")
-   S_(SECCLASS_MMU, MMU__MEMORYMAP, "memorymap")
-   S_(SECCLASS_MMU, MMU__REMOTE_REMAP, "remote_remap")
-   S_(SECCLASS_MMU, MMU__MMUEXT_OP, "mmuext_op")
-   S_(SECCLASS_MMU, MMU__EXCHANGE, "exchange")
-   S_(SECCLASS_SHADOW, SHADOW__DISABLE, "disable")
-   S_(SECCLASS_SHADOW, SHADOW__ENABLE, "enable")
-   S_(SECCLASS_SHADOW, SHADOW__LOGDIRTY, "logdirty")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD, "add")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE, "remove")
-   S_(SECCLASS_RESOURCE, RESOURCE__USE, "use")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD_IRQ, "add_irq")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, "remove_irq")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD_IOPORT, "add_ioport")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE_IOPORT, "remove_ioport")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD_IOMEM, "add_iomem")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE_IOMEM, "remove_iomem")
-   S_(SECCLASS_RESOURCE, RESOURCE__STAT_DEVICE, "stat_device")
-   S_(SECCLASS_RESOURCE, RESOURCE__ADD_DEVICE, "add_device")
-   S_(SECCLASS_RESOURCE, RESOURCE__REMOVE_DEVICE, "remove_device")
-   S_(SECCLASS_RESOURCE, RESOURCE__PLUG, "plug")
-   S_(SECCLASS_RESOURCE, RESOURCE__UNPLUG, "unplug")
-   S_(SECCLASS_RESOURCE, RESOURCE__SETUP, "setup")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_AV, "compute_av")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_CREATE, "compute_create")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_MEMBER, "compute_member")
-   S_(SECCLASS_SECURITY, SECURITY__CHECK_CONTEXT, "check_context")
-   S_(SECCLASS_SECURITY, SECURITY__LOAD_POLICY, "load_policy")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_RELABEL, "compute_relabel")
-   S_(SECCLASS_SECURITY, SECURITY__COMPUTE_USER, "compute_user")
-   S_(SECCLASS_SECURITY, SECURITY__SETENFORCE, "setenforce")
-   S_(SECCLASS_SECURITY, SECURITY__SETBOOL, "setbool")
-   S_(SECCLASS_SECURITY, SECURITY__SETSECPARAM, "setsecparam")
-   S_(SECCLASS_SECURITY, SECURITY__ADD_OCONTEXT, "add_ocontext")
-   S_(SECCLASS_SECURITY, SECURITY__DEL_OCONTEXT, "del_ocontext")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
deleted file mode 100644
index 65302e8..0000000
--- a/xen/xsm/flask/include/av_permissions.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-#define XEN__SCHEDULER                            0x00000001UL
-#define XEN__SETTIME                              0x00000002UL
-#define XEN__TBUFCONTROL                          0x00000004UL
-#define XEN__READCONSOLE                          0x00000008UL
-#define XEN__CLEARCONSOLE                         0x00000010UL
-#define XEN__PERFCONTROL                          0x00000020UL
-#define XEN__MTRR_ADD                             0x00000040UL
-#define XEN__MTRR_DEL                             0x00000080UL
-#define XEN__MTRR_READ                            0x00000100UL
-#define XEN__MICROCODE                            0x00000200UL
-#define XEN__PHYSINFO                             0x00000400UL
-#define XEN__QUIRK                                0x00000800UL
-#define XEN__WRITECONSOLE                         0x00001000UL
-#define XEN__READAPIC                             0x00002000UL
-#define XEN__WRITEAPIC                            0x00004000UL
-#define XEN__PRIVPROFILE                          0x00008000UL
-#define XEN__NONPRIVPROFILE                       0x00010000UL
-#define XEN__KEXEC                                0x00020000UL
-#define XEN__FIRMWARE                             0x00040000UL
-#define XEN__SLEEP                                0x00080000UL
-#define XEN__FREQUENCY                            0x00100000UL
-#define XEN__GETIDLE                              0x00200000UL
-#define XEN__DEBUG                                0x00400000UL
-#define XEN__GETCPUINFO                           0x00800000UL
-#define XEN__HEAP                                 0x01000000UL
-#define XEN__PM_OP                                0x02000000UL
-#define XEN__MCA_OP                               0x04000000UL
-#define XEN__LOCKPROF                             0x08000000UL
-#define XEN__CPUPOOL_OP                           0x10000000UL
-#define XEN__SCHED_OP                             0x20000000UL
-#define XEN__TMEM_OP                              0x40000000UL
-#define XEN__TMEM_CONTROL                         0x80000000UL
-
-#define DOMAIN__SETVCPUCONTEXT                    0x00000001UL
-#define DOMAIN__PAUSE                             0x00000002UL
-#define DOMAIN__UNPAUSE                           0x00000004UL
-#define DOMAIN__RESUME                            0x00000008UL
-#define DOMAIN__CREATE                            0x00000010UL
-#define DOMAIN__TRANSITION                        0x00000020UL
-#define DOMAIN__MAX_VCPUS                         0x00000040UL
-#define DOMAIN__DESTROY                           0x00000080UL
-#define DOMAIN__SETVCPUAFFINITY                   0x00000100UL
-#define DOMAIN__GETVCPUAFFINITY                   0x00000200UL
-#define DOMAIN__SCHEDULER                         0x00000400UL
-#define DOMAIN__GETDOMAININFO                     0x00000800UL
-#define DOMAIN__GETVCPUINFO                       0x00001000UL
-#define DOMAIN__GETVCPUCONTEXT                    0x00002000UL
-#define DOMAIN__SETDOMAINMAXMEM                   0x00004000UL
-#define DOMAIN__SETDOMAINHANDLE                   0x00008000UL
-#define DOMAIN__SETDEBUGGING                      0x00010000UL
-#define DOMAIN__HYPERCALL                         0x00020000UL
-#define DOMAIN__SETTIME                           0x00040000UL
-#define DOMAIN__SET_TARGET                        0x00080000UL
-#define DOMAIN__SHUTDOWN                          0x00100000UL
-#define DOMAIN__SETADDRSIZE                       0x00200000UL
-#define DOMAIN__GETADDRSIZE                       0x00400000UL
-#define DOMAIN__TRIGGER                           0x00800000UL
-#define DOMAIN__GETEXTVCPUCONTEXT                 0x01000000UL
-#define DOMAIN__SETEXTVCPUCONTEXT                 0x02000000UL
-#define DOMAIN__GETVCPUEXTSTATE                   0x04000000UL
-#define DOMAIN__SETVCPUEXTSTATE                   0x08000000UL
-#define DOMAIN__GETPODTARGET                      0x10000000UL
-#define DOMAIN__SETPODTARGET                      0x20000000UL
-#define DOMAIN__SET_MISC_INFO                     0x40000000UL
-#define DOMAIN__SET_VIRQ_HANDLER                  0x80000000UL
-
-#define DOMAIN2__RELABELFROM                      0x00000001UL
-#define DOMAIN2__RELABELTO                        0x00000002UL
-#define DOMAIN2__RELABELSELF                      0x00000004UL
-#define DOMAIN2__MAKE_PRIV_FOR                    0x00000008UL
-#define DOMAIN2__SET_AS_TARGET                    0x00000010UL
-#define DOMAIN2__SET_CPUID                        0x00000020UL
-#define DOMAIN2__GETTSC                           0x00000040UL
-#define DOMAIN2__SETTSC                           0x00000080UL
-
-#define HVM__SETHVMC                              0x00000001UL
-#define HVM__GETHVMC                              0x00000002UL
-#define HVM__SETPARAM                             0x00000004UL
-#define HVM__GETPARAM                             0x00000008UL
-#define HVM__PCILEVEL                             0x00000010UL
-#define HVM__IRQLEVEL                             0x00000020UL
-#define HVM__PCIROUTE                             0x00000040UL
-#define HVM__BIND_IRQ                             0x00000080UL
-#define HVM__CACHEATTR                            0x00000100UL
-#define HVM__TRACKDIRTYVRAM                       0x00000200UL
-#define HVM__HVMCTL                               0x00000400UL
-#define HVM__MEM_EVENT                            0x00000800UL
-#define HVM__MEM_SHARING                          0x00001000UL
-#define HVM__AUDIT_P2M                            0x00002000UL
-#define HVM__SEND_IRQ                             0x00004000UL
-#define HVM__SHARE_MEM                            0x00008000UL
-
-#define EVENT__BIND                               0x00000001UL
-#define EVENT__SEND                               0x00000002UL
-#define EVENT__STATUS                             0x00000004UL
-#define EVENT__NOTIFY                             0x00000008UL
-#define EVENT__CREATE                             0x00000010UL
-#define EVENT__RESET                              0x00000020UL
-
-#define GRANT__MAP_READ                           0x00000001UL
-#define GRANT__MAP_WRITE                          0x00000002UL
-#define GRANT__UNMAP                              0x00000004UL
-#define GRANT__TRANSFER                           0x00000008UL
-#define GRANT__SETUP                              0x00000010UL
-#define GRANT__COPY                               0x00000020UL
-#define GRANT__QUERY                              0x00000040UL
-
-#define MMU__MAP_READ                             0x00000001UL
-#define MMU__MAP_WRITE                            0x00000002UL
-#define MMU__PAGEINFO                             0x00000004UL
-#define MMU__PAGELIST                             0x00000008UL
-#define MMU__ADJUST                               0x00000010UL
-#define MMU__STAT                                 0x00000020UL
-#define MMU__TRANSLATEGP                          0x00000040UL
-#define MMU__UPDATEMP                             0x00000080UL
-#define MMU__PHYSMAP                              0x00000100UL
-#define MMU__PINPAGE                              0x00000200UL
-#define MMU__MFNLIST                              0x00000400UL
-#define MMU__MEMORYMAP                            0x00000800UL
-#define MMU__REMOTE_REMAP                         0x00001000UL
-#define MMU__MMUEXT_OP                            0x00002000UL
-#define MMU__EXCHANGE                             0x00004000UL
-
-#define SHADOW__DISABLE                           0x00000001UL
-#define SHADOW__ENABLE                            0x00000002UL
-#define SHADOW__LOGDIRTY                          0x00000004UL
-
-#define RESOURCE__ADD                             0x00000001UL
-#define RESOURCE__REMOVE                          0x00000002UL
-#define RESOURCE__USE                             0x00000004UL
-#define RESOURCE__ADD_IRQ                         0x00000008UL
-#define RESOURCE__REMOVE_IRQ                      0x00000010UL
-#define RESOURCE__ADD_IOPORT                      0x00000020UL
-#define RESOURCE__REMOVE_IOPORT                   0x00000040UL
-#define RESOURCE__ADD_IOMEM                       0x00000080UL
-#define RESOURCE__REMOVE_IOMEM                    0x00000100UL
-#define RESOURCE__STAT_DEVICE                     0x00000200UL
-#define RESOURCE__ADD_DEVICE                      0x00000400UL
-#define RESOURCE__REMOVE_DEVICE                   0x00000800UL
-#define RESOURCE__PLUG                            0x00001000UL
-#define RESOURCE__UNPLUG                          0x00002000UL
-#define RESOURCE__SETUP                           0x00004000UL
-
-#define SECURITY__COMPUTE_AV                      0x00000001UL
-#define SECURITY__COMPUTE_CREATE                  0x00000002UL
-#define SECURITY__COMPUTE_MEMBER                  0x00000004UL
-#define SECURITY__CHECK_CONTEXT                   0x00000008UL
-#define SECURITY__LOAD_POLICY                     0x00000010UL
-#define SECURITY__COMPUTE_RELABEL                 0x00000020UL
-#define SECURITY__COMPUTE_USER                    0x00000040UL
-#define SECURITY__SETENFORCE                      0x00000080UL
-#define SECURITY__SETBOOL                         0x00000100UL
-#define SECURITY__SETSECPARAM                     0x00000200UL
-#define SECURITY__ADD_OCONTEXT                    0x00000400UL
-#define SECURITY__DEL_OCONTEXT                    0x00000800UL
-
diff --git a/xen/xsm/flask/include/class_to_string.h b/xen/xsm/flask/include/class_to_string.h
deleted file mode 100644
index 7716645..0000000
--- a/xen/xsm/flask/include/class_to_string.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-/*
- * Security object class definitions
- */
-    S_("null")
-    S_("xen")
-    S_("domain")
-    S_("domain2")
-    S_("hvm")
-    S_("mmu")
-    S_("resource")
-    S_("shadow")
-    S_("event")
-    S_("grant")
-    S_("security")
diff --git a/xen/xsm/flask/include/flask.h b/xen/xsm/flask/include/flask.h
deleted file mode 100644
index 3bff998..0000000
--- a/xen/xsm/flask/include/flask.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-#ifndef _SELINUX_FLASK_H_
-#define _SELINUX_FLASK_H_
-
-/*
- * Security object class definitions
- */
-#define SECCLASS_XEN                                     1
-#define SECCLASS_DOMAIN                                  2
-#define SECCLASS_DOMAIN2                                 3
-#define SECCLASS_HVM                                     4
-#define SECCLASS_MMU                                     5
-#define SECCLASS_RESOURCE                                6
-#define SECCLASS_SHADOW                                  7
-#define SECCLASS_EVENT                                   8
-#define SECCLASS_GRANT                                   9
-#define SECCLASS_SECURITY                                10
-
-/*
- * Security identifier indices for initial entities
- */
-#define SECINITSID_XEN                                  1
-#define SECINITSID_DOM0                                 2
-#define SECINITSID_DOMIO                                3
-#define SECINITSID_DOMXEN                               4
-#define SECINITSID_UNLABELED                            5
-#define SECINITSID_SECURITY                             6
-#define SECINITSID_IOPORT                               7
-#define SECINITSID_IOMEM                                8
-#define SECINITSID_IRQ                                  9
-#define SECINITSID_DEVICE                               10
-
-#define SECINITSID_NUM                                  10
-
-#endif
diff --git a/xen/xsm/flask/include/initial_sid_to_string.h b/xen/xsm/flask/include/initial_sid_to_string.h
deleted file mode 100644
index 814f4bf..0000000
--- a/xen/xsm/flask/include/initial_sid_to_string.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
-static char *initial_sid_to_string[] =
-{
-    "null",
-    "xen",
-    "dom0",
-    "domio",
-    "domxen",
-    "unlabeled",
-    "security",
-    "ioport",
-    "iomem",
-    "irq",
-    "device",
-};
-
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
new file mode 100644
index 0000000..7a7e253
--- /dev/null
+++ b/xen/xsm/flask/policy/access_vectors
@@ -0,0 +1,190 @@
+#
+# Define the access vectors.
+#
+# class class_name { permission_name ... }
+
+class xen
+{
+	scheduler
+	settime
+	tbufcontrol
+	readconsole
+	clearconsole
+	perfcontrol
+	mtrr_add
+	mtrr_del
+	mtrr_read
+	microcode
+	physinfo
+	quirk
+    writeconsole
+    readapic
+    writeapic
+    privprofile
+    nonprivprofile
+    kexec
+	firmware
+	sleep
+	frequency
+	getidle
+	debug
+	getcpuinfo
+	heap
+	pm_op
+	mca_op
+	lockprof
+	cpupool_op
+	sched_op
+	tmem_op
+	tmem_control
+}
+
+class domain
+{
+	setvcpucontext
+	pause
+	unpause
+    resume
+    create
+    transition
+    max_vcpus
+    destroy
+    setvcpuaffinity
+	getvcpuaffinity
+	scheduler
+	getdomaininfo
+	getvcpuinfo
+	getvcpucontext
+	setdomainmaxmem
+	setdomainhandle
+	setdebugging
+	hypercall
+    settime
+    set_target
+    shutdown
+    setaddrsize
+    getaddrsize
+	trigger
+	getextvcpucontext
+	setextvcpucontext
+	getvcpuextstate
+	setvcpuextstate
+	getpodtarget
+	setpodtarget
+	set_misc_info
+	set_virq_handler
+}
+
+class domain2
+{
+	relabelfrom
+	relabelto
+	relabelself
+	make_priv_for
+	set_as_target
+	set_cpuid
+	gettsc
+	settsc
+}
+
+class hvm
+{
+    sethvmc
+    gethvmc
+    setparam
+    getparam
+    pcilevel
+    irqlevel
+    pciroute
+	bind_irq
+	cacheattr
+    trackdirtyvram
+    hvmctl
+    mem_event
+    mem_sharing
+    audit_p2m
+    send_irq
+    share_mem
+}
+
+class event
+{
+	bind
+	send
+	status
+	notify
+	create
+    reset
+}
+
+class grant
+{
+	map_read
+	map_write
+	unmap
+	transfer
+	setup
+    copy
+    query
+}
+
+class mmu
+{
+	map_read
+	map_write
+	pageinfo
+	pagelist
+    adjust
+    stat
+    translategp
+	updatemp
+    physmap
+    pinpage
+    mfnlist
+    memorymap
+    remote_remap
+	mmuext_op
+	exchange
+}
+
+class shadow
+{
+	disable
+	enable
+    logdirty
+}
+
+class resource
+{
+	add
+	remove
+	use
+	add_irq
+	remove_irq
+	add_ioport
+	remove_ioport
+	add_iomem
+	remove_iomem
+	stat_device
+	add_device
+	remove_device
+	plug
+	unplug
+	setup
+}
+
+class security
+{
+	compute_av
+	compute_create
+	compute_member
+	check_context
+	load_policy
+	compute_relabel
+	compute_user
+	setenforce
+	setbool
+	setsecparam
+        add_ocontext
+        del_ocontext
+}
diff --git a/xen/xsm/flask/policy/initial_sids b/xen/xsm/flask/policy/initial_sids
new file mode 100644
index 0000000..e508bde
--- /dev/null
+++ b/xen/xsm/flask/policy/initial_sids
@@ -0,0 +1,16 @@
+# FLASK
+
+#
+# Define initial security identifiers 
+#
+sid xen
+sid dom0
+sid domio
+sid domxen
+sid unlabeled
+sid security
+sid ioport
+sid iomem
+sid irq
+sid device
+# FLASK
diff --git a/xen/xsm/flask/policy/mkaccess_vector.sh b/xen/xsm/flask/policy/mkaccess_vector.sh
new file mode 100644
index 0000000..8ec87f7
--- /dev/null
+++ b/xen/xsm/flask/policy/mkaccess_vector.sh
@@ -0,0 +1,138 @@
+#!/bin/sh -
+#
+
+# FLASK
+
+set -e
+
+awk=$1
+shift
+
+# output files
+av_permissions="include/av_permissions.h"
+av_perm_to_string="include/av_perm_to_string.h"
+
+cat $* | $awk "
+BEGIN	{
+		outfile = \"$av_permissions\"
+		avpermfile = \"$av_perm_to_string\"
+		"'
+		nextstate = "COMMON_OR_AV";
+		printf("/* This file is automatically generated.  Do not edit. */\n") > outfile;
+		printf("/* This file is automatically generated.  Do not edit. */\n") > avpermfile;
+;
+	}
+/^[ \t]*#/	{ 
+			next;
+		}
+$1 == "class"	{
+			if (nextstate != "COMMON_OR_AV" &&
+			    nextstate != "CLASS_OR_CLASS-OPENBRACKET")
+			{
+				printf("Parse error:  Unexpected class definition on line %d\n", NR);
+				next;	
+			}
+
+			tclass = $2;
+
+			if (tclass in av_defined)
+			{
+				printf("Duplicate access vector definition for %s on line %d\n", tclass, NR);
+				next;
+			} 
+			av_defined[tclass] = 1;
+
+			permission = 1;
+
+			nextstate = "INHERITS_OR_CLASS-OPENBRACKET";
+			next;
+		}
+$1 == "{"	{ 
+			if (nextstate != "INHERITS_OR_CLASS-OPENBRACKET" &&
+			    nextstate != "CLASS_OR_CLASS-OPENBRACKET" &&
+			    nextstate != "COMMON-OPENBRACKET")
+			{
+				printf("Parse error:  Unexpected { on line %d\n", NR);
+				next;
+			}
+
+			if (nextstate == "INHERITS_OR_CLASS-OPENBRACKET")
+				nextstate = "CLASS-CLOSEBRACKET";
+
+			if (nextstate == "CLASS_OR_CLASS-OPENBRACKET")
+				nextstate = "CLASS-CLOSEBRACKET";
+
+			if (nextstate == "COMMON-OPENBRACKET")
+				nextstate = "COMMON-CLOSEBRACKET";
+		}
+/[a-z][a-z_]*/	{
+			if (nextstate != "COMMON-CLOSEBRACKET" &&
+			    nextstate != "CLASS-CLOSEBRACKET")
+			{
+				printf("Parse error:  Unexpected symbol %s on line %d\n", $1, NR);		
+				next;
+			}
+
+			if (nextstate == "COMMON-CLOSEBRACKET")
+			{
+				if ((common_name,$1) in common_perms)
+				{
+					printf("Duplicate permission %s for common %s on line %d.\n", $1, common_name, NR);
+					next;
+				}
+
+				common_perms[common_name,$1] = permission;
+
+				printf("#define COMMON_%s__%s", toupper(common_name), toupper($1)) > outfile; 
+
+				printf("    S_(\"%s\")\n", $1) > cpermfile;
+			}
+			else
+			{
+				if ((tclass,$1) in av_perms)
+				{
+					printf("Duplicate permission %s for %s on line %d.\n", $1, tclass, NR);
+					next;
+				}
+
+				av_perms[tclass,$1] = permission;
+		
+				printf("#define %s__%s", toupper(tclass), toupper($1)) > outfile; 
+
+				printf("   S_(SECCLASS_%s, %s__%s, \"%s\")\n", toupper(tclass), toupper(tclass), toupper($1), $1) > avpermfile; 
+			}
+
+			spaces = 40 - (length($1) + length(tclass));
+			if (spaces < 1)
+			      spaces = 1;
+
+			for (i = 0; i < spaces; i++) 
+				printf(" ") > outfile; 
+			printf("0x%08xUL\n", permission) > outfile; 
+			permission = permission * 2;
+		}
+$1 == "}"	{
+			if (nextstate != "CLASS-CLOSEBRACKET" && 
+			    nextstate != "COMMON-CLOSEBRACKET")
+			{
+				printf("Parse error:  Unexpected } on line %d\n", NR);
+				next;
+			}
+
+			if (nextstate == "COMMON-CLOSEBRACKET")
+			{
+				common_base[common_name] = permission;
+				printf("TE_(common_%s_perm_to_string)\n\n", common_name) > cpermfile; 
+			}
+
+			printf("\n") > outfile;
+
+			nextstate = "COMMON_OR_AV";
+		}
+END	{
+		if (nextstate != "COMMON_OR_AV" && nextstate != "CLASS_OR_CLASS-OPENBRACKET")
+			printf("Parse error:  Unexpected end of file\n");
+
+	}'
+
+# FLASK
diff --git a/xen/xsm/flask/policy/mkflask.sh b/xen/xsm/flask/policy/mkflask.sh
new file mode 100644
index 0000000..e8d8fb5
--- /dev/null
+++ b/xen/xsm/flask/policy/mkflask.sh
@@ -0,0 +1,95 @@
+#!/bin/sh -
+#
+
+# FLASK
+
+set -e
+
+awk=$1
+shift 1
+
+# output file
+output_file="include/flask.h"
+debug_file="include/class_to_string.h"
+debug_file2="include/initial_sid_to_string.h"
+
+cat $* | $awk "
+BEGIN	{
+		outfile = \"$output_file\"
+		debugfile = \"$debug_file\"
+		debugfile2 = \"$debug_file2\"
+		"'
+		nextstate = "CLASS";
+
+		printf("/* This file is automatically generated.  Do not edit. */\n") > outfile;
+
+		printf("#ifndef _SELINUX_FLASK_H_\n") > outfile;
+		printf("#define _SELINUX_FLASK_H_\n") > outfile;
+		printf("\n/*\n * Security object class definitions\n */\n") > outfile;
+		printf("/* This file is automatically generated.  Do not edit. */\n") > debugfile;
+		printf("/*\n * Security object class definitions\n */\n") > debugfile;
+		printf("    S_(\"null\")\n") > debugfile;
+		printf("/* This file is automatically generated.  Do not edit. */\n") > debugfile2;
+		printf("static char *initial_sid_to_string[] =\n{\n") > debugfile2;
+		printf("    \"null\",\n") > debugfile2;
+	}
+/^[ \t]*#/	{ 
+			next;
+		}
+$1 == "class"	{ 
+			if (nextstate != "CLASS")
+			{
+				printf("Parse error:  Unexpected class definition on line %d\n", NR);
+				next;	
+			}
+
+			if ($2 in class_found)
+			{
+				printf("Duplicate class definition for %s on line %d.\n", $2, NR);
+				next;
+			}	
+			class_found[$2] = 1;
+
+			class_value++;
+
+			printf("#define SECCLASS_%s", toupper($2)) > outfile;
+			for (i = 0; i < 40 - length($2); i++) 
+				printf(" ") > outfile; 
+			printf("%d\n", class_value) > outfile; 
+
+			printf("    S_(\"%s\")\n", $2) > debugfile;
+		}
+$1 == "sid"	{ 
+			if (nextstate == "CLASS")
+			{
+			    nextstate = "SID";
+			    printf("\n/*\n * Security identifier indices for initial entities\n */\n") > outfile;			    
+			}
+
+			if ($2 in sid_found)
+			{
+				printf("Duplicate SID definition for %s on line %d.\n", $2, NR);
+				next;
+			}	
+			sid_found[$2] = 1;
+			sid_value++;
+
+			printf("#define SECINITSID_%s", toupper($2)) > outfile;
+			for (i = 0; i < 37 - length($2); i++) 
+				printf(" ") > outfile; 
+			printf("%d\n", sid_value) > outfile; 
+			printf("    \"%s\",\n", $2) > debugfile2;
+		}
+END	{
+		if (nextstate != "SID")
+			printf("Parse error:  Unexpected end of file\n");
+
+		printf("\n#define SECINITSID_NUM") > outfile;
+		for (i = 0; i < 34; i++) 
+			printf(" ") > outfile; 
+		printf("%d\n", sid_value) > outfile; 
+		printf("\n#endif\n") > outfile;
+		printf("};\n\n") > debugfile2;
+	}'
+
+# FLASK
diff --git a/xen/xsm/flask/policy/security_classes b/xen/xsm/flask/policy/security_classes
new file mode 100644
index 0000000..ef134a7
--- /dev/null
+++ b/xen/xsm/flask/policy/security_classes
@@ -0,0 +1,21 @@
+# FLASK
+
+#
+# Define the security object classes 
+#
+
+# Classes marked as userspace are classes
+# for userspace object managers
+
+class xen
+class domain
+class domain2
+class hvm
+class mmu
+class resource
+class shadow
+class event
+class grant
+class security
+
+# FLASK
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSex-0002Zo-Od; Fri, 30 Nov 2012 15:37:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSes-0002Rv-J4
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:43 +0000
Received: from [85.158.139.211:30871] by server-11.bemta-5.messagelabs.com id
	77/46-03409-5C2D8B05; Fri, 30 Nov 2012 15:37:41 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354289856!18577856!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11674 invoked from network); 30 Nov 2012 15:37:37 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-6.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:37 -0000
X-TM-IMSS-Message-ID: <3392290100027ac6@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3392290100027ac6 ;
	Fri, 30 Nov 2012 10:36:29 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSdG017785; 
	Fri, 30 Nov 2012 10:37:35 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:10 -0500
Message-Id: <1354289830-24642-24-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>, Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Tim Deegan <tim@xen.org>, Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 23/23] xen/xsm: Add xsm_default parameter to XSM
	hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Include the default XSM hook action as the first argument of the hook to
facilitate quick understanding of how the call site is expected to be
used (dom0-only, arbitrary guest, or device model). This argument does
not solely define how a given hook is interpreted, since any changes to
the hook's default action need to be made identically to all callers of
a hook (if there are multiple callers; most hooks only have one), and
may also require changing the arguments of the hook.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Tim Deegan <tim@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/cpu/mcheck/mce.c     |   2 +-
 xen/arch/x86/domctl.c             |  10 +-
 xen/arch/x86/hvm/hvm.c            |  26 +-
 xen/arch/x86/irq.c                |   2 +-
 xen/arch/x86/mm.c                 |  20 +-
 xen/arch/x86/mm/mem_event.c       |   4 +-
 xen/arch/x86/mm/mem_sharing.c     |   4 +-
 xen/arch/x86/mm/paging.c          |   2 +-
 xen/arch/x86/msi.c                |   2 +-
 xen/arch/x86/physdev.c            |  12 +-
 xen/arch/x86/platform_hypercall.c |  10 +-
 xen/arch/x86/sysctl.c             |   4 +-
 xen/arch/x86/traps.c              |   2 +-
 xen/common/domain.c               |   2 +-
 xen/common/domctl.c               |  10 +-
 xen/common/event_channel.c        |  12 +-
 xen/common/grant_table.c          |  16 +-
 xen/common/kexec.c                |   2 +-
 xen/common/memory.c               |   8 +-
 xen/common/schedule.c             |   2 +-
 xen/common/sysctl.c               |   8 +-
 xen/common/xenoprof.c             |   2 +-
 xen/drivers/char/console.c        |   2 +-
 xen/drivers/passthrough/iommu.c   |  10 +-
 xen/drivers/passthrough/pci.c     |   4 +-
 xen/include/xen/tmem_xen.h        |   4 +-
 xen/include/xsm/dummy.h           | 507 +++++++++++++++++++++-----------------
 xen/include/xsm/xsm.h             | 155 ++++++------
 28 files changed, 455 insertions(+), 389 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 658774a..26273f9 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1293,7 +1293,7 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
     struct xen_mc_msrinject *mc_msrinject;
     struct xen_mc_mceinject *mc_mceinject;
 
-    ret = xsm_do_mca();
+    ret = xsm_do_mca(XSM_PRIV);
     if ( ret )
         return x86_mcerr(NULL, ret);
 
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 2630bdb..0117375 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -76,7 +76,7 @@ long arch_do_domctl(
 
         if ( np == 0 )
             ret = 0;
-        else if ( xsm_ioport_permission(d, fp, fp + np - 1, allow) )
+        else if ( xsm_ioport_permission(XSM_HOOK, d, fp, fp + np - 1, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = ioports_permit_access(d, fp, fp + np - 1);
@@ -566,7 +566,7 @@ long arch_do_domctl(
         if ( !is_hvm_domain(d) )
             break;
 
-        ret = xsm_bind_pt_irq(d, bind);
+        ret = xsm_bind_pt_irq(XSM_HOOK, d, bind);
         if ( ret )
             break;
 
@@ -599,7 +599,7 @@ long arch_do_domctl(
              !irq_access_permitted(current->domain, bind->machine_irq) )
             break;
 
-        ret = xsm_unbind_pt_irq(d, bind);
+        ret = xsm_unbind_pt_irq(XSM_HOOK, d, bind);
         if ( ret )
             break;
 
@@ -634,7 +634,7 @@ long arch_do_domctl(
              !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
             break;
 
-        ret = xsm_iomem_mapping(d, mfn, mfn + nr_mfns - 1, add);
+        ret = xsm_iomem_mapping(XSM_HOOK, d, mfn, mfn + nr_mfns - 1, add);
         if ( ret )
             break;
 
@@ -712,7 +712,7 @@ long arch_do_domctl(
              !ioports_access_permitted(current->domain, fmp, fmp + np - 1) )
             break;
 
-        ret = xsm_ioport_mapping(d, fmp, fmp + np - 1, add);
+        ret = xsm_ioport_mapping(XSM_HOOK, d, fmp, fmp + np - 1, add);
         if ( ret )
             break;
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 5bdde8d..eda715f 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3400,7 +3400,7 @@ static int hvmop_set_pci_intx_level(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_set_pci_intx_level(d);
+    rc = xsm_hvm_set_pci_intx_level(XSM_DM_PRIV, d);
     if ( rc )
         goto out;
 
@@ -3567,7 +3567,7 @@ static int hvmop_set_isa_irq_level(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_set_isa_irq_level(d);
+    rc = xsm_hvm_set_isa_irq_level(XSM_DM_PRIV, d);
     if ( rc )
         goto out;
 
@@ -3611,7 +3611,7 @@ static int hvmop_set_pci_link_route(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_set_pci_link_route(d);
+    rc = xsm_hvm_set_pci_link_route(XSM_DM_PRIV, d);
     if ( rc )
         goto out;
 
@@ -3641,7 +3641,7 @@ static int hvmop_inject_msi(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_inject_msi(d);
+    rc = xsm_hvm_inject_msi(XSM_DM_PRIV, d);
     if ( rc )
         goto out;
 
@@ -3738,7 +3738,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
         if ( rc )
             goto param_fail;
 
@@ -3984,7 +3984,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail2;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
         if ( rc )
             goto param_fail2;
 
@@ -4023,7 +4023,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail3;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
         if ( rc )
             goto param_fail3;
 
@@ -4069,7 +4069,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
         if ( rc )
             goto param_fail_getmemtype;
 
@@ -4124,7 +4124,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail4;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
         if ( rc )
             goto param_fail4;
 
@@ -4203,7 +4203,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail5;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
         if ( rc )
             goto param_fail5;
 
@@ -4238,7 +4238,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail6;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
         if ( rc )
             goto param_fail6;
 
@@ -4274,7 +4274,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) || !paging_mode_shadow(d) )
             goto param_fail7;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
         if ( rc )
             goto param_fail7;
 
@@ -4328,7 +4328,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail8;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
         if ( rc )
             goto param_fail8;
 
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 238600a..095c17d 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1874,7 +1874,7 @@ int map_domain_pirq(
         return 0;
     }
 
-    ret = xsm_map_domain_pirq(d, irq, data);
+    ret = xsm_map_domain_pirq(XSM_HOOK, d, irq, data);
     if ( ret )
     {
         dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq %d mapping to pirq %d\n",
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 9a2acca..f2cf7d9 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2716,7 +2716,7 @@ long do_mmuext_op(
         goto out;
     }
 
-    rc = xsm_mmuext_op(d, pg_owner);
+    rc = xsm_mmuext_op(XSM_TARGET, d, pg_owner);
     if ( rc )
     {
         rcu_unlock_domain(pg_owner);
@@ -2788,7 +2788,7 @@ long do_mmuext_op(
                 break;
             }
 
-            if ( (rc = xsm_memory_pin_page(d, pg_owner, page)) != 0 )
+            if ( (rc = xsm_memory_pin_page(XSM_HOOK, d, pg_owner, page)) != 0 )
             {
                 put_page_and_type(page);
                 okay = 0;
@@ -3245,7 +3245,7 @@ long do_mmu_update(
             }
             if ( xsm_needed != xsm_checked )
             {
-                rc = xsm_mmu_update(d, pt_owner, pg_owner, xsm_needed);
+                rc = xsm_mmu_update(XSM_TARGET, d, pt_owner, pg_owner, xsm_needed);
                 if ( rc )
                     break;
                 xsm_checked = xsm_needed;
@@ -3364,7 +3364,7 @@ long do_mmu_update(
             xsm_needed |= XSM_MMU_MACHPHYS_UPDATE;
             if ( xsm_needed != xsm_checked )
             {
-                rc = xsm_mmu_update(d, NULL, pg_owner, xsm_needed);
+                rc = xsm_mmu_update(XSM_TARGET, d, NULL, pg_owner, xsm_needed);
                 if ( rc )
                     break;
                 xsm_checked = xsm_needed;
@@ -3932,7 +3932,7 @@ static int __do_update_va_mapping(
 
     perfc_incr(calls_to_update_va);
 
-    rc = xsm_update_va_mapping(d, pg_owner, val);
+    rc = xsm_update_va_mapping(XSM_TARGET, d, pg_owner, val);
     if ( rc )
         return rc;
 
@@ -4403,7 +4403,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        if ( xsm_add_to_physmap(current->domain, d) )
+        if ( xsm_add_to_physmap(XSM_TARGET, current->domain, d) )
         {
             rcu_unlock_domain(d);
             return -EPERM;
@@ -4442,7 +4442,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        rc = xsm_domain_memory_map(d);
+        rc = xsm_domain_memory_map(XSM_TARGET, d);
         if ( rc )
         {
             rcu_unlock_domain(d);
@@ -4517,7 +4517,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         XEN_GUEST_HANDLE_PARAM(e820entry_t) buffer_param;
         unsigned int i;
 
-        rc = xsm_machine_memory_map();
+        rc = xsm_machine_memory_map(XSM_PRIV);
         if ( rc )
             return rc;
 
@@ -4601,9 +4601,9 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
             return -ESRCH;
 
         if ( op == XENMEM_set_pod_target )
-            rc = xsm_set_pod_target(d);
+            rc = xsm_set_pod_target(XSM_PRIV, d);
         else
-            rc = xsm_get_pod_target(d);
+            rc = xsm_get_pod_target(XSM_PRIV, d);
 
         if ( rc != 0 )
             goto pod_target_out_unlock;
diff --git a/xen/arch/x86/mm/mem_event.c b/xen/arch/x86/mm/mem_event.c
index c2b3670..4222248 100644
--- a/xen/arch/x86/mm/mem_event.c
+++ b/xen/arch/x86/mm/mem_event.c
@@ -449,7 +449,7 @@ int do_mem_event_op(int op, uint32_t domain, void *arg)
     if ( ret )
         return ret;
 
-    ret = xsm_mem_event_op(d, op);
+    ret = xsm_mem_event_op(XSM_TARGET, d, op);
     if ( ret )
         goto out;
 
@@ -502,7 +502,7 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
 {
     int rc;
 
-    rc = xsm_mem_event_control(d, mec->mode, mec->op);
+    rc = xsm_mem_event_control(XSM_PRIV, d, mec->mode, mec->op);
     if ( rc )
         return rc;
 
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 9229b83..5f3d319 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1351,7 +1351,7 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( rc )
                 return rc;
 
-            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            rc = xsm_mem_sharing_op(XSM_TARGET, d, cd, mec->op);
             if ( rc )
             {
                 rcu_unlock_domain(cd);
@@ -1415,7 +1415,7 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( rc )
                 return rc;
 
-            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            rc = xsm_mem_sharing_op(XSM_TARGET, d, cd, mec->op);
             if ( rc )
             {
                 rcu_unlock_domain(cd);
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index ea44e39..ff7b0c6 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -678,7 +678,7 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
         return -EINVAL;
     }
 
-    rc = xsm_shadow_control(d, sc->op);
+    rc = xsm_shadow_control(XSM_HOOK, d, sc->op);
     if ( rc )
         return rc;
 
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 62ed290..e3f91c6 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1016,7 +1016,7 @@ int pci_restore_msi_state(struct pci_dev *pdev)
     if (!pdev)
         return -EINVAL;
 
-    ret = xsm_resource_setup_pci((pdev->seg << 16) | (pdev->bus << 8) | pdev->devfn);
+    ret = xsm_resource_setup_pci(XSM_PRIV, (pdev->seg << 16) | (pdev->bus << 8) | pdev->devfn);
     if ( ret )
         return ret;
 
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 9c30245..9be1b47 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -232,7 +232,7 @@ int physdev_unmap_pirq(domid_t domid, int pirq)
             goto free_domain;
     }
 
-    ret = xsm_unmap_domain_pirq(d, domain_pirq_to_irq(d, pirq));
+    ret = xsm_unmap_domain_pirq(XSM_TARGET, d, domain_pirq_to_irq(d, pirq));
     if ( ret )
         goto free_domain;
 
@@ -423,7 +423,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = xsm_apic(v->domain, cmd);
+        ret = xsm_apic(XSM_PRIV, v->domain, cmd);
         if ( ret )
             break;
         ret = ioapic_guest_read(apic.apic_physbase, apic.reg, &apic.value);
@@ -437,7 +437,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = xsm_apic(v->domain, cmd);
+        ret = xsm_apic(XSM_PRIV, v->domain, cmd);
         if ( ret )
             break;
         ret = ioapic_guest_write(apic.apic_physbase, apic.reg, apic.value);
@@ -453,7 +453,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         /* Use the APIC check since this dummy hypercall should still only
          * be called by the domain with access to program the ioapic */
-        ret = xsm_apic(v->domain, cmd);
+        ret = xsm_apic(XSM_PRIV, v->domain, cmd);
         if ( ret )
             break;
 
@@ -578,7 +578,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_pci_mmcfg_reserved: {
         struct physdev_pci_mmcfg_reserved info;
 
-        ret = xsm_resource_setup_misc();
+        ret = xsm_resource_setup_misc(XSM_PRIV);
         if ( ret )
             break;
 
@@ -632,7 +632,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( setup_gsi.gsi < 0 || setup_gsi.gsi >= nr_irqs_gsi )
             break;
 
-        ret = xsm_resource_setup_gsi(setup_gsi.gsi);
+        ret = xsm_resource_setup_gsi(XSM_PRIV, setup_gsi.gsi);
         if ( ret )
             break;
 
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index e17d64f..cdbf8e4 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -72,7 +72,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     if ( op->interface_version != XENPF_INTERFACE_VERSION )
         return -EACCES;
 
-    ret = xsm_platform_op(op->cmd);
+    ret = xsm_platform_op(XSM_PRIV, op->cmd);
     if ( ret )
         return ret;
 
@@ -496,7 +496,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        ret = xsm_resource_plug_core();
+        ret = xsm_resource_plug_core(XSM_HOOK);
         if ( ret )
             break;
 
@@ -521,7 +521,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        ret = xsm_resource_unplug_core();
+        ret = xsm_resource_unplug_core(XSM_HOOK);
         if ( ret )
             break;
 
@@ -550,7 +550,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_cpu_hotadd:
-        ret = xsm_resource_plug_core();
+        ret = xsm_resource_plug_core(XSM_HOOK);
         if ( ret )
             break;
 
@@ -560,7 +560,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_mem_hotadd:
-        ret = xsm_resource_plug_core();
+        ret = xsm_resource_plug_core(XSM_HOOK);
         if ( ret )
             break;
 
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index 5b0c4b7..23d0db1 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -184,14 +184,14 @@ long arch_do_sysctl(
         switch ( sysctl->u.cpu_hotplug.op )
         {
         case XEN_SYSCTL_CPU_HOTPLUG_ONLINE:
-            ret = xsm_resource_plug_core();
+            ret = xsm_resource_plug_core(XSM_HOOK);
             if ( ret )
                 break;
             ret = continue_hypercall_on_cpu(
                 0, cpu_up_helper, (void *)(unsigned long)cpu);
             break;
         case XEN_SYSCTL_CPU_HOTPLUG_OFFLINE:
-            ret = xsm_resource_unplug_core();
+            ret = xsm_resource_unplug_core(XSM_HOOK);
             if ( ret )
                 break;
             ret = continue_hypercall_on_cpu(
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 44a866e..7c180ea 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1643,7 +1643,7 @@ static int pci_cfg_ok(struct domain *d, int write, int size)
             start |= (d->arch.pci_cf8 >> 16) & 0xF00;
     }
     end = start + size - 1;
-    if (xsm_pci_config_permission(d, machine_bdf, start, end, write))
+    if (xsm_pci_config_permission(XSM_HOOK, d, machine_bdf, start, end, write))
         return 0;
     return 1;
 }
diff --git a/xen/common/domain.c b/xen/common/domain.c
index fcf24e2..3f91f62 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -252,7 +252,7 @@ struct domain *domain_create(
 
     if ( !is_idle_domain(d) )
     {
-        if ( (err = xsm_domain_create(d, ssidref)) != 0 )
+        if ( (err = xsm_domain_create(XSM_HOOK, d, ssidref)) != 0 )
             goto fail;
 
         d->is_paused_by_controller = 1;
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 6f792e9..69e008a 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -264,7 +264,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             return -ESRCH;
     }
 
-    ret = xsm_domctl(d, op->cmd);
+    ret = xsm_domctl(XSM_OTHER, d, op->cmd);
     if ( ret )
         goto domctl_out_unlock;
 
@@ -580,7 +580,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             break;
         }
 
-        ret = xsm_getdomaininfo(d);
+        ret = xsm_getdomaininfo(XSM_HOOK, d);
         if ( ret )
             goto getdomaininfo_out;
 
@@ -722,7 +722,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
         if ( pirq >= d->nr_pirqs )
             ret = -EINVAL;
-        else if ( xsm_irq_permission(d, pirq, allow) )
+        else if ( xsm_irq_permission(XSM_HOOK, d, pirq, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = irq_permit_access(d, pirq);
@@ -741,7 +741,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
             break;
 
-        if ( xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, allow) )
+        if ( xsm_iomem_permission(XSM_HOOK, d, mfn, mfn + nr_mfns - 1, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
@@ -773,7 +773,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             break;
         }
 
-        ret = xsm_set_target(d, e);
+        ret = xsm_set_target(XSM_HOOK, d, e);
         if ( ret ) {
             put_domain(e);
             break;
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 37947a9..1dc3d0e 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -175,7 +175,7 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
         ERROR_EXIT_DOM(port, d);
     chn = evtchn_from_port(d, port);
 
-    rc = xsm_evtchn_unbound(d, chn, alloc->remote_dom);
+    rc = xsm_evtchn_unbound(XSM_TARGET, d, chn, alloc->remote_dom);
     if ( rc )
         goto out;
 
@@ -231,7 +231,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
          (rchn->u.unbound.remote_domid != ld->domain_id) )
         ERROR_EXIT_DOM(-EINVAL, rd);
 
-    rc = xsm_evtchn_interdomain(ld, lchn, rd, rchn);
+    rc = xsm_evtchn_interdomain(XSM_HOOK, ld, lchn, rd, rchn);
     if ( rc )
         goto out;
 
@@ -580,7 +580,7 @@ int evtchn_send(struct domain *d, unsigned int lport)
         return -EINVAL;
     }
 
-    ret = xsm_evtchn_send(ld, lchn);
+    ret = xsm_evtchn_send(XSM_HOOK, ld, lchn);
     if ( ret )
         goto out;
 
@@ -812,7 +812,7 @@ static long evtchn_status(evtchn_status_t *status)
 
     chn = evtchn_from_port(d, port);
 
-    rc = xsm_evtchn_status(d, chn);
+    rc = xsm_evtchn_status(XSM_TARGET, d, chn);
     if ( rc )
         goto out;
 
@@ -954,7 +954,7 @@ static long evtchn_reset(evtchn_reset_t *r)
     if ( d == NULL )
         return -ESRCH;
 
-    rc = xsm_evtchn_reset(current->domain, d);
+    rc = xsm_evtchn_reset(XSM_TARGET, current->domain, d);
     if ( rc )
         goto out;
 
@@ -1101,7 +1101,7 @@ int alloc_unbound_xen_event_channel(
         goto out;
     chn = evtchn_from_port(d, port);
 
-    rc = xsm_evtchn_unbound(d, chn, remote_domid);
+    rc = xsm_evtchn_unbound(XSM_TARGET, d, chn, remote_domid);
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index eae9518..c58ea1b 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -552,7 +552,7 @@ __gnttab_map_grant_ref(
         return;
     }
 
-    rc = xsm_grant_mapref(ld, rd, op->flags);
+    rc = xsm_grant_mapref(XSM_HOOK, ld, rd, op->flags);
     if ( rc )
     {
         rcu_unlock_domain(rd);
@@ -872,7 +872,7 @@ __gnttab_unmap_common(
         return;
     }
 
-    rc = xsm_grant_unmapref(ld, rd);
+    rc = xsm_grant_unmapref(XSM_HOOK, ld, rd);
     if ( rc )
     {
         rcu_unlock_domain(rd);
@@ -1326,7 +1326,7 @@ gnttab_setup_table(
         goto out2;
     }
 
-    if ( xsm_grant_setup(current->domain, d) )
+    if ( xsm_grant_setup(XSM_TARGET, current->domain, d) )
     {
         op.status = GNTST_permission_denied;
         goto out2;
@@ -1395,7 +1395,7 @@ gnttab_query_size(
         goto query_out;
     }
 
-    rc = xsm_grant_query_size(current->domain, d);
+    rc = xsm_grant_query_size(XSM_TARGET, current->domain, d);
     if ( rc )
     {
         op.status = GNTST_permission_denied;
@@ -1571,7 +1571,7 @@ gnttab_transfer(
             goto copyback;
         }
 
-        if ( xsm_grant_transfer(d, e) )
+        if ( xsm_grant_transfer(XSM_HOOK, d, e) )
         {
             put_gfn(d, gop.mfn);
             gop.status = GNTST_permission_denied;
@@ -2010,7 +2010,7 @@ __gnttab_copy(
         PIN_FAIL(error_out, GNTST_bad_domain,
                  "couldn't find %d\n", op->dest.domid);
 
-    rc = xsm_grant_copy(sd, dd);
+    rc = xsm_grant_copy(XSM_HOOK, sd, dd);
     if ( rc )
     {
         rc = GNTST_permission_denied;
@@ -2267,7 +2267,7 @@ gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop,
         op.status = GNTST_bad_domain;
         goto out1;
     }
-    rc = xsm_grant_setup(current->domain, d);
+    rc = xsm_grant_setup(XSM_TARGET, current->domain, d);
     if ( rc ) {
         op.status = GNTST_permission_denied;
         goto out1;
@@ -2318,7 +2318,7 @@ gnttab_get_version(XEN_GUEST_HANDLE_PARAM(gnttab_get_version_t uop))
     if ( d == NULL )
         return -ESRCH;
 
-    rc = xsm_grant_query_size(current->domain, d);
+    rc = xsm_grant_query_size(XSM_TARGET, current->domain, d);
     if ( rc )
     {
         rcu_unlock_domain(d);
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index d4f6332..6dd20c6 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -852,7 +852,7 @@ static int do_kexec_op_internal(unsigned long op,
     unsigned long flags;
     int ret = -EINVAL;
 
-    ret = xsm_kexec();
+    ret = xsm_kexec(XSM_PRIV);
     if ( ret )
         return ret;
 
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 7d3c326..c4d4ba8 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -336,7 +336,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
         goto fail_early;
     }
 
-    rc = xsm_memory_exchange(d);
+    rc = xsm_memory_exchange(XSM_TARGET, d);
     if ( rc )
     {
         rcu_unlock_domain(d);
@@ -585,7 +585,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return start_extent;
         args.domain = d;
 
-        rc = xsm_memory_adjust_reservation(current->domain, d);
+        rc = xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d);
         if ( rc )
         {
             rcu_unlock_domain(d);
@@ -634,7 +634,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        rc = xsm_memory_stat_reservation(current->domain, d);
+        rc = xsm_memory_stat_reservation(XSM_TARGET, current->domain, d);
         if ( rc )
         {
             rcu_unlock_domain(d);
@@ -672,7 +672,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        if ( xsm_remove_from_physmap(current->domain, d) )
+        if ( xsm_remove_from_physmap(XSM_TARGET, current->domain, d) )
         {
             rcu_unlock_domain(d);
             return -EPERM;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index cfd173d..009ae96 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -921,7 +921,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             break;
 
-        ret = xsm_schedop_shutdown(current->domain, d);
+        ret = xsm_schedop_shutdown(XSM_DM_PRIV, current->domain, d);
         if ( ret )
         {
             rcu_unlock_domain(d);
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index cbefb0e..2a53038 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -39,7 +39,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     if ( op->interface_version != XEN_SYSCTL_INTERFACE_VERSION )
         return -EACCES;
 
-    ret = xsm_sysctl(op->cmd);
+    ret = xsm_sysctl(XSM_PRIV, op->cmd);
     if ( ret )
         return ret;
 
@@ -57,7 +57,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     {
     case XEN_SYSCTL_readconsole:
     {
-        ret = xsm_readconsole(op->u.readconsole.clear);
+        ret = xsm_readconsole(XSM_HOOK, op->u.readconsole.clear);
         if ( ret )
             break;
 
@@ -100,7 +100,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
             if ( num_domains == op->u.getdomaininfolist.max_domains )
                 break;
 
-            ret = xsm_getdomaininfo(d);
+            ret = xsm_getdomaininfo(XSM_HOOK, d);
             if ( ret )
                 continue;
 
@@ -231,7 +231,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         uint32_t *status, *ptr;
         unsigned long pfn;
 
-        ret = xsm_page_offline(op->u.page_offline.cmd);
+        ret = xsm_page_offline(XSM_HOOK, op->u.page_offline.cmd);
         if ( ret )
             break;
 
diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index ae0435b..e834f3d 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -680,7 +680,7 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         return -EPERM;
     }
 
-    ret = xsm_profile(current->domain, op);
+    ret = xsm_profile(XSM_HOOK, current->domain, op);
     if ( ret )
         return ret;
 
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index b2c3ee3..e9f696d 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -406,7 +406,7 @@ long do_console_io(int cmd, int count, XEN_GUEST_HANDLE_PARAM(char) buffer)
     long rc;
     unsigned int idx, len;
 
-    rc = xsm_console_io(current->domain, cmd);
+    rc = xsm_console_io(XSM_OTHER, current->domain, cmd);
     if ( rc )
         return rc;
 
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 9d13185..6a0f8d6 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -452,7 +452,7 @@ static int iommu_get_device_group(
              ((pdev->bus == bus) && (pdev->devfn == devfn)) )
             continue;
 
-        if ( xsm_get_device_group((seg << 16) | (pdev->bus << 8) | pdev->devfn) )
+        if ( xsm_get_device_group(XSM_HOOK, (seg << 16) | (pdev->bus << 8) | pdev->devfn) )
             continue;
 
         sdev_id = ops->get_device_group_id(seg, pdev->bus, pdev->devfn);
@@ -555,7 +555,7 @@ int iommu_do_domctl(
         u32 max_sdevs;
         XEN_GUEST_HANDLE_64(uint32) sdevs;
 
-        ret = xsm_get_device_group(domctl->u.get_device_group.machine_sbdf);
+        ret = xsm_get_device_group(XSM_HOOK, domctl->u.get_device_group.machine_sbdf);
         if ( ret )
             break;
 
@@ -583,7 +583,7 @@ int iommu_do_domctl(
     break;
 
     case XEN_DOMCTL_test_assign_device:
-        ret = xsm_test_assign_device(domctl->u.assign_device.machine_sbdf);
+        ret = xsm_test_assign_device(XSM_HOOK, domctl->u.assign_device.machine_sbdf);
         if ( ret )
             break;
 
@@ -607,7 +607,7 @@ int iommu_do_domctl(
             break;
         }
 
-        ret = xsm_assign_device(d, domctl->u.assign_device.machine_sbdf);
+        ret = xsm_assign_device(XSM_HOOK, d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
             break;
 
@@ -626,7 +626,7 @@ int iommu_do_domctl(
         break;
 
     case XEN_DOMCTL_deassign_device:
-        ret = xsm_deassign_device(d, domctl->u.assign_device.machine_sbdf);
+        ret = xsm_deassign_device(XSM_HOOK, d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
             break;
 
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index a61a9ba..d75b7b7 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -380,7 +380,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn, const struct pci_dev_info *info)
         pdev_type = "device";
     }
 
-    ret = xsm_resource_plug_pci((seg << 16) | (bus << 8) | devfn);
+    ret = xsm_resource_plug_pci(XSM_PRIV, (seg << 16) | (bus << 8) | devfn);
     if ( ret )
         return ret;
 
@@ -496,7 +496,7 @@ int pci_remove_device(u16 seg, u8 bus, u8 devfn)
     struct pci_dev *pdev;
     int ret;
 
-    ret = xsm_resource_unplug_pci((seg << 16) | (bus << 8) | devfn);
+    ret = xsm_resource_unplug_pci(XSM_PRIV, (seg << 16) | (bus << 8) | devfn);
     if ( ret )
         return ret;
 
diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h
index 8dec5aa..ad1ddd5 100644
--- a/xen/include/xen/tmem_xen.h
+++ b/xen/include/xen/tmem_xen.h
@@ -329,12 +329,12 @@ static inline bool_t tmh_set_client_from_id(
 
 static inline bool_t tmh_current_permitted(void)
 {
-    return !xsm_tmem_op();
+    return !xsm_tmem_op(XSM_HOOK);
 }
 
 static inline bool_t tmh_current_is_privileged(void)
 {
-    return !xsm_tmem_control();
+    return !xsm_tmem_control(XSM_PRIV);
 }
 
 static inline uint8_t tmh_get_first_byte(pfp_t *pfp)
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 019183e..2c750de 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -6,68 +6,132 @@
  *  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.
+ *
+ *
+ *  Each XSM hook implementing an access check should have its first parameter
+ *  preceded by XSM_DEFAULT_ARG (or use XSM_DEFAULT_VOID if it has no
+ *  arguments). The first non-declaration statement shold be XSM_ASSERT_ACTION
+ *  with the expected type of the hook, which will either define or check the
+ *  value of action.
  */
 
 #include <xen/sched.h>
 #include <xsm/xsm.h>
 
+/* Cannot use BUILD_BUG_ON here because the expressions we check are not
+ * considered constant at compile time. Instead, rely on constant propagation to
+ * inline out the calls to this invalid function, which will cause linker errors
+ * if references remain at link time.
+ */
+#define LINKER_BUG_ON(x) do { if (x) __xsm_action_mismatch_detected(); } while (0)
+/* DO NOT implement this function; it is supposed to trigger link errors */
+void __xsm_action_mismatch_detected(void);
+
+#ifdef XSM_ENABLE
+
+/* In XSM_ENABLE builds, this header file is included from xsm/dummy.c, and
+ * contains static (not inline) functions compiled to the dummy XSM module.
+ * There is no xsm_default_t argument available, so the value from the assertion
+ * is used to initialize the variable.
+ */
+#define XSM_INLINE /* */
+#define XSM_DEFAULT_ARG /* */
+#define XSM_DEFAULT_VOID void
+#define XSM_ASSERT_ACTION(def) xsm_default_t action = def; (void)action
+
+#else /* XSM_ENABLE */
+
+/* In !XSM_ENABLE builds, this header file is included from xsm/xsm.h, and
+ * contains inline functions for each XSM hook. These functions also perform
+ * compile-time checks on the xsm_default_t argument to ensure that the behavior
+ * of the dummy XSM module is the same as the behavior with XSM disabled.
+ */
+#define XSM_INLINE inline
+#define XSM_DEFAULT_ARG xsm_default_t action,
+#define XSM_DEFAULT_VOID xsm_default_t action
+#define XSM_ASSERT_ACTION(def) LINKER_BUG_ON(def != action)
+
+#endif /* XSM_ENABLE */
+
+static inline int xsm_default_action(xsm_default_t action, struct domain *src,
+                                     struct domain *target)
+{
+    switch ( action ) {
+    case XSM_HOOK:
+        return 0;
+    case XSM_DM_PRIV:
+        if ( !IS_PRIV_FOR(src, target) )
+            return -EPERM;
+        return 0;
+    case XSM_TARGET:
+        if ( src != target && !IS_PRIV_FOR(src, target) )
+            return -EPERM;
+        return 0;
+    case XSM_PRIV:
+        if ( !IS_PRIV(src) )
+            return -EPERM;
+        return 0;
+    default:
+        LINKER_BUG_ON(1);
+        return -EPERM;
+    }
+}
+
 static XSM_INLINE void xsm_security_domaininfo(struct domain *d,
                                     struct xen_domctl_getdomaininfo *info)
 {
     return;
 }
 
-static XSM_INLINE int xsm_domain_create(struct domain *d, u32 ssidref)
+static XSM_INLINE int xsm_domain_create(XSM_DEFAULT_ARG struct domain *d, u32 ssidref)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
+static XSM_INLINE int xsm_getdomaininfo(XSM_DEFAULT_ARG struct domain *d)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
+static XSM_INLINE int xsm_set_target(XSM_DEFAULT_ARG struct domain *d, struct domain *e)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_domctl(struct domain *d, int cmd)
+static XSM_INLINE int xsm_domctl(XSM_DEFAULT_ARG struct domain *d, int cmd)
 {
+    XSM_ASSERT_ACTION(XSM_OTHER);
     switch ( cmd )
     {
     case XEN_DOMCTL_ioport_mapping:
     case XEN_DOMCTL_memory_mapping:
     case XEN_DOMCTL_bind_pt_irq:
-    case XEN_DOMCTL_unbind_pt_irq: {
-        if ( !IS_PRIV_FOR(current->domain, d) )
-            return -EPERM;
-        break;
-    }
+    case XEN_DOMCTL_unbind_pt_irq:
+        return xsm_default_action(XSM_DM_PRIV, current->domain, d);
     default:
-        if ( !IS_PRIV(current->domain) )
-            return -EPERM;
+        return xsm_default_action(XSM_PRIV, current->domain, d);
     }
-    return 0;
 }
 
-static XSM_INLINE int xsm_sysctl(int cmd)
+static XSM_INLINE int xsm_sysctl(XSM_DEFAULT_ARG int cmd)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_readconsole(uint32_t clear)
+static XSM_INLINE int xsm_readconsole(XSM_DEFAULT_ARG uint32_t clear)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_do_mca(void)
+static XSM_INLINE int xsm_do_mca(XSM_DEFAULT_VOID)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
 static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
@@ -80,109 +144,109 @@ static XSM_INLINE void xsm_free_security_domain(struct domain *d)
     return;
 }
 
-static XSM_INLINE int xsm_grant_mapref(struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_grant_mapref(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_grant_unmapref(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_unmapref(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_grant_setup(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_setup(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_grant_transfer(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_transfer(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_grant_copy(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_copy(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_grant_query_size(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_query_size(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_memory_exchange(struct domain *d)
+static XSM_INLINE int xsm_memory_exchange(XSM_DEFAULT_ARG struct domain *d)
 {
-    if ( d != current->domain && !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
+static XSM_INLINE int xsm_memory_adjust_reservation(XSM_DEFAULT_ARG struct domain *d1,
                                                             struct domain *d2)
 {
-    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_memory_stat_reservation(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_memory_stat_reservation(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_console_io(struct domain *d, int cmd)
+static XSM_INLINE int xsm_console_io(XSM_DEFAULT_ARG struct domain *d, int cmd)
 {
-#ifndef VERBOSE
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
+    XSM_ASSERT_ACTION(XSM_OTHER);
+#ifdef VERBOSE
+    return xsm_default_action(XSM_HOOK, current->domain, NULL);
+#else
+    return xsm_default_action(XSM_PRIV, current->domain, NULL);
 #endif
-    return 0;
 }
 
-static XSM_INLINE int xsm_profile(struct domain *d, int op)
+static XSM_INLINE int xsm_profile(XSM_DEFAULT_ARG struct domain *d, int op)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_kexec(void)
+static XSM_INLINE int xsm_kexec(XSM_DEFAULT_VOID)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_schedop_shutdown(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_schedop_shutdown(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    if ( !IS_PRIV_FOR(d1, d2) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_DM_PRIV);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_memory_pin_page(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2,
                                           struct page_info *page)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_evtchn_unbound(struct domain *d, struct evtchn *chn,
+static XSM_INLINE int xsm_evtchn_unbound(XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn,
                                          domid_t id2)
 {
-    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_evtchn_interdomain(struct domain *d1, struct evtchn
+static XSM_INLINE int xsm_evtchn_interdomain(XSM_DEFAULT_ARG struct domain *d1, struct evtchn
                                 *chan1, struct domain *d2, struct evtchn *chan2)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, d1, d2);
 }
 
 static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
@@ -190,23 +254,22 @@ static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
     return;
 }
 
-static XSM_INLINE int xsm_evtchn_send(struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_evtchn_send(XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_evtchn_status(struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_evtchn_status(XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
 {
-    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_evtchn_reset(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_evtchn_reset(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d1, d2);
 }
 
 static XSM_INLINE int xsm_alloc_security_evtchn(struct evtchn *chn)
@@ -224,100 +287,100 @@ static XSM_INLINE char *xsm_show_security_evtchn(struct domain *d, const struct
     return NULL;
 }
 
-static XSM_INLINE int xsm_get_pod_target(struct domain *d)
+static XSM_INLINE int xsm_get_pod_target(XSM_DEFAULT_ARG struct domain *d)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_set_pod_target(struct domain *d)
+static XSM_INLINE int xsm_set_pod_target(XSM_DEFAULT_ARG struct domain *d)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_get_device_group(uint32_t machine_bdf)
+static XSM_INLINE int xsm_get_device_group(XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_test_assign_device(uint32_t machine_bdf)
+static XSM_INLINE int xsm_test_assign_device(XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_assign_device(XSM_DEFAULT_ARG struct domain *d, uint32_t machine_bdf)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_deassign_device(XSM_DEFAULT_ARG struct domain *d, uint32_t machine_bdf)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_resource_plug_core(void)
+static XSM_INLINE int xsm_resource_plug_core(XSM_DEFAULT_VOID)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_resource_unplug_core(void)
+static XSM_INLINE int xsm_resource_unplug_core(XSM_DEFAULT_VOID)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_resource_plug_pci(uint32_t machine_bdf)
+static XSM_INLINE int xsm_resource_plug_pci(XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_resource_unplug_pci(uint32_t machine_bdf)
+static XSM_INLINE int xsm_resource_unplug_pci(XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_resource_setup_pci(uint32_t machine_bdf)
+static XSM_INLINE int xsm_resource_setup_pci(XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_resource_setup_gsi(int gsi)
+static XSM_INLINE int xsm_resource_setup_gsi(XSM_DEFAULT_ARG int gsi)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_resource_setup_misc(void)
+static XSM_INLINE int xsm_resource_setup_misc(XSM_DEFAULT_VOID)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_page_offline(uint32_t cmd)
+static XSM_INLINE int xsm_page_offline(XSM_DEFAULT_ARG uint32_t cmd)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_tmem_op(void)
+static XSM_INLINE int xsm_tmem_op(XSM_DEFAULT_VOID)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_tmem_control(void)
+static XSM_INLINE int xsm_tmem_control(XSM_DEFAULT_VOID)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
 static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
@@ -330,187 +393,179 @@ static XSM_INLINE char *xsm_show_irq_sid(int irq)
     return NULL;
 }
 
-static XSM_INLINE int xsm_map_domain_pirq(struct domain *d, int irq, void *data)
+static XSM_INLINE int xsm_map_domain_pirq(XSM_DEFAULT_ARG struct domain *d, int irq, void *data)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_unmap_domain_pirq(struct domain *d, int irq)
+static XSM_INLINE int xsm_unmap_domain_pirq(XSM_DEFAULT_ARG struct domain *d, int irq)
 {
-    if ( !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_irq_permission(struct domain *d, int pirq, uint8_t allow)
+static XSM_INLINE int xsm_irq_permission(XSM_DEFAULT_ARG struct domain *d, int pirq, uint8_t allow)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_iomem_permission(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_iomem_permission(XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_iomem_mapping(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_iomem_mapping(XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_pci_config_permission(struct domain *d, uint32_t machine_bdf,
+static XSM_INLINE int xsm_pci_config_permission(XSM_DEFAULT_ARG struct domain *d, uint32_t machine_bdf,
                                         uint16_t start, uint16_t end,
                                         uint8_t access)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
 #ifdef CONFIG_X86
-static XSM_INLINE int xsm_shadow_control(struct domain *d, uint32_t op)
+static XSM_INLINE int xsm_shadow_control(XSM_DEFAULT_ARG struct domain *d, uint32_t op)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
+static XSM_INLINE int xsm_hvm_param(XSM_DEFAULT_ARG struct domain *d, unsigned long op)
 {
-    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_hvm_set_pci_intx_level(struct domain *d)
+static XSM_INLINE int xsm_hvm_set_pci_intx_level(XSM_DEFAULT_ARG struct domain *d)
 {
-    if ( !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_DM_PRIV);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_hvm_set_isa_irq_level(struct domain *d)
+static XSM_INLINE int xsm_hvm_set_isa_irq_level(XSM_DEFAULT_ARG struct domain *d)
 {
-    if ( !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_DM_PRIV);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_hvm_set_pci_link_route(struct domain *d)
+static XSM_INLINE int xsm_hvm_set_pci_link_route(XSM_DEFAULT_ARG struct domain *d)
 {
-    if ( !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_DM_PRIV);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
+static XSM_INLINE int xsm_hvm_inject_msi(XSM_DEFAULT_ARG struct domain *d)
 {
-    if ( !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_DM_PRIV);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_mem_event_control(struct domain *d, int mode, int op)
+static XSM_INLINE int xsm_mem_event_control(XSM_DEFAULT_ARG struct domain *d, int mode, int op)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_mem_event_op(struct domain *d, int op)
+static XSM_INLINE int xsm_mem_event_op(XSM_DEFAULT_ARG struct domain *d, int op)
 {
-    if ( !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
+static XSM_INLINE int xsm_mem_sharing_op(XSM_DEFAULT_ARG struct domain *d, struct domain *cd, int op)
 {
-    if ( !IS_PRIV_FOR(current->domain, cd) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, current->domain, cd);
 }
 
-static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
+static XSM_INLINE int xsm_apic(XSM_DEFAULT_ARG struct domain *d, int cmd)
 {
-    if ( !IS_PRIV(d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, d, NULL);
 }
 
-static XSM_INLINE int xsm_platform_op(uint32_t op)
+static XSM_INLINE int xsm_platform_op(XSM_DEFAULT_ARG uint32_t op)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_machine_memory_map(void)
+static XSM_INLINE int xsm_machine_memory_map(XSM_DEFAULT_VOID)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_domain_memory_map(struct domain *d)
+static XSM_INLINE int xsm_domain_memory_map(XSM_DEFAULT_ARG struct domain *d)
 {
-    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_mmu_update(struct domain *d, struct domain *t,
+static XSM_INLINE int xsm_mmu_update(XSM_DEFAULT_ARG struct domain *d, struct domain *t,
                                      struct domain *f, uint32_t flags)
 {
+    XSM_ASSERT_ACTION(XSM_TARGET);
     if ( t && d != t && !IS_PRIV_FOR(d, t) )
         return -EPERM;
-    if ( d != f && !IS_PRIV_FOR(d, f) )
-        return -EPERM;
-    return 0;
+    return xsm_default_action(action, d, f);
 }
 
-static XSM_INLINE int xsm_mmuext_op(struct domain *d, struct domain *f)
+static XSM_INLINE int xsm_mmuext_op(XSM_DEFAULT_ARG struct domain *d, struct domain *f)
 {
-    if ( d != f && !IS_PRIV_FOR(d, f) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d, f);
 }
 
-static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f, 
+static XSM_INLINE int xsm_update_va_mapping(XSM_DEFAULT_ARG struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
-    if ( d != f && !IS_PRIV_FOR(d, f) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d, f);
 }
 
-static XSM_INLINE int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_add_to_physmap(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_remove_from_physmap(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_bind_pt_irq(XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_unbind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_unbind_pt_irq(XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_ioport_permission(XSM_DEFAULT_ARG struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_ioport_mapping(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_ioport_mapping(XSM_DEFAULT_ARG struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
 #endif
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 105201e..ce5ede8 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -27,6 +27,18 @@ typedef u32 xsm_magic_t;
 #define XSM_MAGIC 0x00000000
 #endif
 
+/* These annotations are used by callers and in dummy.h to document the
+ * default actions of XSM hooks. They should be compiled out otherwise.
+ */
+enum xsm_default {
+    XSM_HOOK,     /* Guests can normally access the hypercall */
+    XSM_DM_PRIV,  /* Device model can perform on its target domain */
+    XSM_TARGET,   /* Can perform on self or your target domain */
+    XSM_PRIV,     /* Privileged - normally restricted to dom0 */
+    XSM_OTHER     /* Something more complex */
+};
+typedef enum xsm_default xsm_default_t;
+
 extern char *policy_buffer;
 extern u32 policy_size;
 
@@ -155,48 +167,48 @@ static inline void xsm_security_domaininfo (struct domain *d,
     xsm_ops->security_domaininfo(d, info);
 }
 
-static inline int xsm_domain_create (struct domain *d, u32 ssidref)
+static inline int xsm_domain_create (xsm_default_t def, struct domain *d, u32 ssidref)
 {
     return xsm_ops->domain_create(d, ssidref);
 }
 
-static inline int xsm_getdomaininfo (struct domain *d)
+static inline int xsm_getdomaininfo (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->getdomaininfo(d);
 }
 
-static inline int xsm_set_target (struct domain *d, struct domain *e)
+static inline int xsm_set_target (xsm_default_t def, struct domain *d, struct domain *e)
 {
     return xsm_ops->set_target(d, e);
 }
 
-static inline int xsm_domctl (struct domain *d, int cmd)
+static inline int xsm_domctl (xsm_default_t def, struct domain *d, int cmd)
 {
     return xsm_ops->domctl(d, cmd);
 }
 
-static inline int xsm_sysctl (int cmd)
+static inline int xsm_sysctl (xsm_default_t def, int cmd)
 {
     return xsm_ops->sysctl(cmd);
 }
 
-static inline int xsm_readconsole (uint32_t clear)
+static inline int xsm_readconsole (xsm_default_t def, uint32_t clear)
 {
     return xsm_ops->readconsole(clear);
 }
 
-static inline int xsm_do_mca(void)
+static inline int xsm_do_mca(xsm_default_t def)
 {
     return xsm_ops->do_mca();
 }
 
-static inline int xsm_evtchn_unbound (struct domain *d1, struct evtchn *chn,
+static inline int xsm_evtchn_unbound (xsm_default_t def, struct domain *d1, struct evtchn *chn,
                                                                     domid_t id2)
 {
     return xsm_ops->evtchn_unbound(d1, chn, id2);
 }
 
-static inline int xsm_evtchn_interdomain (struct domain *d1, 
+static inline int xsm_evtchn_interdomain (xsm_default_t def, struct domain *d1,
                 struct evtchn *chan1, struct domain *d2, struct evtchn *chan2)
 {
     return xsm_ops->evtchn_interdomain(d1, chan1, d2, chan2);
@@ -207,48 +219,48 @@ static inline void xsm_evtchn_close_post (struct evtchn *chn)
     xsm_ops->evtchn_close_post(chn);
 }
 
-static inline int xsm_evtchn_send (struct domain *d, struct evtchn *chn)
+static inline int xsm_evtchn_send (xsm_default_t def, struct domain *d, struct evtchn *chn)
 {
     return xsm_ops->evtchn_send(d, chn);
 }
 
-static inline int xsm_evtchn_status (struct domain *d, struct evtchn *chn)
+static inline int xsm_evtchn_status (xsm_default_t def, struct domain *d, struct evtchn *chn)
 {
     return xsm_ops->evtchn_status(d, chn);
 }
 
-static inline int xsm_evtchn_reset (struct domain *d1, struct domain *d2)
+static inline int xsm_evtchn_reset (xsm_default_t def, struct domain *d1, struct domain *d2)
 {
     return xsm_ops->evtchn_reset(d1, d2);
 }
 
-static inline int xsm_grant_mapref (struct domain *d1, struct domain *d2,
+static inline int xsm_grant_mapref (xsm_default_t def, struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
     return xsm_ops->grant_mapref(d1, d2, flags);
 }
 
-static inline int xsm_grant_unmapref (struct domain *d1, struct domain *d2)
+static inline int xsm_grant_unmapref (xsm_default_t def, struct domain *d1, struct domain *d2)
 {
     return xsm_ops->grant_unmapref(d1, d2);
 }
 
-static inline int xsm_grant_setup (struct domain *d1, struct domain *d2)
+static inline int xsm_grant_setup (xsm_default_t def, struct domain *d1, struct domain *d2)
 {
     return xsm_ops->grant_setup(d1, d2);
 }
 
-static inline int xsm_grant_transfer (struct domain *d1, struct domain *d2)
+static inline int xsm_grant_transfer (xsm_default_t def, struct domain *d1, struct domain *d2)
 {
     return xsm_ops->grant_transfer(d1, d2);
 }
 
-static inline int xsm_grant_copy (struct domain *d1, struct domain *d2)
+static inline int xsm_grant_copy (xsm_default_t def, struct domain *d1, struct domain *d2)
 {
     return xsm_ops->grant_copy(d1, d2);
 }
 
-static inline int xsm_grant_query_size (struct domain *d1, struct domain *d2)
+static inline int xsm_grant_query_size (xsm_default_t def, struct domain *d1, struct domain *d2)
 {
     return xsm_ops->grant_query_size(d1, d2);
 }
@@ -278,60 +290,60 @@ static inline char *xsm_show_security_evtchn (struct domain *d, const struct evt
     return xsm_ops->show_security_evtchn(d, chn);
 }
 
-static inline int xsm_get_pod_target (struct domain *d)
+static inline int xsm_get_pod_target (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->get_pod_target(d);
 }
 
-static inline int xsm_set_pod_target (struct domain *d)
+static inline int xsm_set_pod_target (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->set_pod_target(d);
 }
 
-static inline int xsm_memory_exchange (struct domain *d)
+static inline int xsm_memory_exchange (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->memory_exchange(d);
 }
 
-static inline int xsm_memory_adjust_reservation (struct domain *d1, struct
+static inline int xsm_memory_adjust_reservation (xsm_default_t def, struct domain *d1, struct
                                                                     domain *d2)
 {
     return xsm_ops->memory_adjust_reservation(d1, d2);
 }
 
-static inline int xsm_memory_stat_reservation (struct domain *d1,
+static inline int xsm_memory_stat_reservation (xsm_default_t def, struct domain *d1,
                                                             struct domain *d2)
 {
     return xsm_ops->memory_stat_reservation(d1, d2);
 }
 
-static inline int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
+static inline int xsm_memory_pin_page(xsm_default_t def, struct domain *d1, struct domain *d2,
                                       struct page_info *page)
 {
     return xsm_ops->memory_pin_page(d1, d2, page);
 }
 
-static inline int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
+static inline int xsm_remove_from_physmap(xsm_default_t def, struct domain *d1, struct domain *d2)
 {
     return xsm_ops->remove_from_physmap(d1, d2);
 }
 
-static inline int xsm_console_io (struct domain *d, int cmd)
+static inline int xsm_console_io (xsm_default_t def, struct domain *d, int cmd)
 {
     return xsm_ops->console_io(d, cmd);
 }
 
-static inline int xsm_profile (struct domain *d, int op)
+static inline int xsm_profile (xsm_default_t def, struct domain *d, int op)
 {
     return xsm_ops->profile(d, op);
 }
 
-static inline int xsm_kexec (void)
+static inline int xsm_kexec (xsm_default_t def)
 {
     return xsm_ops->kexec();
 }
 
-static inline int xsm_schedop_shutdown (struct domain *d1, struct domain *d2)
+static inline int xsm_schedop_shutdown (xsm_default_t def, struct domain *d1, struct domain *d2)
 {
     return xsm_ops->schedop_shutdown(d1, d2);
 }
@@ -341,102 +353,102 @@ static inline char *xsm_show_irq_sid (int irq)
     return xsm_ops->show_irq_sid(irq);
 }
 
-static inline int xsm_map_domain_pirq (struct domain *d, int irq, void *data)
+static inline int xsm_map_domain_pirq (xsm_default_t def, struct domain *d, int irq, void *data)
 {
     return xsm_ops->map_domain_pirq(d, irq, data);
 }
 
-static inline int xsm_unmap_domain_pirq (struct domain *d, int irq)
+static inline int xsm_unmap_domain_pirq (xsm_default_t def, struct domain *d, int irq)
 {
     return xsm_ops->unmap_domain_pirq(d, irq);
 }
 
-static inline int xsm_irq_permission (struct domain *d, int pirq, uint8_t allow)
+static inline int xsm_irq_permission (xsm_default_t def, struct domain *d, int pirq, uint8_t allow)
 {
     return xsm_ops->irq_permission(d, pirq, allow);
 }
 
-static inline int xsm_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static inline int xsm_iomem_permission (xsm_default_t def, struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return xsm_ops->iomem_permission(d, s, e, allow);
 }
 
-static inline int xsm_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static inline int xsm_iomem_mapping (xsm_default_t def, struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return xsm_ops->iomem_mapping(d, s, e, allow);
 }
 
-static inline int xsm_pci_config_permission (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
+static inline int xsm_pci_config_permission (xsm_default_t def, struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
     return xsm_ops->pci_config_permission(d, machine_bdf, start, end, access);
 }
 
-static inline int xsm_get_device_group(uint32_t machine_bdf)
+static inline int xsm_get_device_group(xsm_default_t def, uint32_t machine_bdf)
 {
     return xsm_ops->get_device_group(machine_bdf);
 }
 
-static inline int xsm_test_assign_device(uint32_t machine_bdf)
+static inline int xsm_test_assign_device(xsm_default_t def, uint32_t machine_bdf)
 {
     return xsm_ops->test_assign_device(machine_bdf);
 }
 
-static inline int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
+static inline int xsm_assign_device(xsm_default_t def, struct domain *d, uint32_t machine_bdf)
 {
     return xsm_ops->assign_device(d, machine_bdf);
 }
 
-static inline int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
+static inline int xsm_deassign_device(xsm_default_t def, struct domain *d, uint32_t machine_bdf)
 {
     return xsm_ops->deassign_device(d, machine_bdf);
 }
 
-static inline int xsm_resource_plug_pci (uint32_t machine_bdf)
+static inline int xsm_resource_plug_pci (xsm_default_t def, uint32_t machine_bdf)
 {
     return xsm_ops->resource_plug_pci(machine_bdf);
 }
 
-static inline int xsm_resource_unplug_pci (uint32_t machine_bdf)
+static inline int xsm_resource_unplug_pci (xsm_default_t def, uint32_t machine_bdf)
 {
     return xsm_ops->resource_unplug_pci(machine_bdf);
 }
 
-static inline int xsm_resource_plug_core (void)
+static inline int xsm_resource_plug_core (xsm_default_t def)
 {
     return xsm_ops->resource_plug_core();
 }
 
-static inline int xsm_resource_unplug_core (void)
+static inline int xsm_resource_unplug_core (xsm_default_t def)
 {
     return xsm_ops->resource_unplug_core();
 }
 
-static inline int xsm_resource_setup_pci (uint32_t machine_bdf)
+static inline int xsm_resource_setup_pci (xsm_default_t def, uint32_t machine_bdf)
 {
     return xsm_ops->resource_setup_pci(machine_bdf);
 }
 
-static inline int xsm_resource_setup_gsi (int gsi)
+static inline int xsm_resource_setup_gsi (xsm_default_t def, int gsi)
 {
     return xsm_ops->resource_setup_gsi(gsi);
 }
 
-static inline int xsm_resource_setup_misc (void)
+static inline int xsm_resource_setup_misc (xsm_default_t def)
 {
     return xsm_ops->resource_setup_misc();
 }
 
-static inline int xsm_page_offline(uint32_t cmd)
+static inline int xsm_page_offline(xsm_default_t def, uint32_t cmd)
 {
     return xsm_ops->page_offline(cmd);
 }
 
-static inline int xsm_tmem_op(void)
+static inline int xsm_tmem_op(xsm_default_t def)
 {
     return xsm_ops->tmem_op();
 }
 
-static inline int xsm_tmem_control(void)
+static inline int xsm_tmem_control(xsm_default_t def)
 {
     return xsm_ops->tmem_control();
 }
@@ -447,116 +459,116 @@ static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 }
 
 #ifdef CONFIG_X86
-static inline int xsm_shadow_control (struct domain *d, uint32_t op)
+static inline int xsm_shadow_control (xsm_default_t def, struct domain *d, uint32_t op)
 {
     return xsm_ops->shadow_control(d, op);
 }
 
-static inline int xsm_hvm_param (struct domain *d, unsigned long op)
+static inline int xsm_hvm_param (xsm_default_t def, struct domain *d, unsigned long op)
 {
     return xsm_ops->hvm_param(d, op);
 }
 
-static inline int xsm_hvm_set_pci_intx_level (struct domain *d)
+static inline int xsm_hvm_set_pci_intx_level (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->hvm_set_pci_intx_level(d);
 }
 
-static inline int xsm_hvm_set_isa_irq_level (struct domain *d)
+static inline int xsm_hvm_set_isa_irq_level (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->hvm_set_isa_irq_level(d);
 }
 
-static inline int xsm_hvm_set_pci_link_route (struct domain *d)
+static inline int xsm_hvm_set_pci_link_route (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->hvm_set_pci_link_route(d);
 }
 
-static inline int xsm_hvm_inject_msi (struct domain *d)
+static inline int xsm_hvm_inject_msi (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->hvm_inject_msi(d);
 }
 
-static inline int xsm_mem_event_control (struct domain *d, int mode, int op)
+static inline int xsm_mem_event_control (xsm_default_t def, struct domain *d, int mode, int op)
 {
     return xsm_ops->mem_event_control(d, mode, op);
 }
 
-static inline int xsm_mem_event_op (struct domain *d, int op)
+static inline int xsm_mem_event_op (xsm_default_t def, struct domain *d, int op)
 {
     return xsm_ops->mem_event_op(d, op);
 }
 
-static inline int xsm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
+static inline int xsm_mem_sharing_op (xsm_default_t def, struct domain *d, struct domain *cd, int op)
 {
     return xsm_ops->mem_sharing_op(d, cd, op);
 }
 
-static inline int xsm_apic (struct domain *d, int cmd)
+static inline int xsm_apic (xsm_default_t def, struct domain *d, int cmd)
 {
     return xsm_ops->apic(d, cmd);
 }
 
-static inline int xsm_memtype (uint32_t access)
+static inline int xsm_memtype (xsm_default_t def, uint32_t access)
 {
     return xsm_ops->memtype(access);
 }
 
-static inline int xsm_platform_op (uint32_t op)
+static inline int xsm_platform_op (xsm_default_t def, uint32_t op)
 {
     return xsm_ops->platform_op(op);
 }
 
-static inline int xsm_machine_memory_map(void)
+static inline int xsm_machine_memory_map(xsm_default_t def)
 {
     return xsm_ops->machine_memory_map();
 }
 
-static inline int xsm_domain_memory_map(struct domain *d)
+static inline int xsm_domain_memory_map(xsm_default_t def, struct domain *d)
 {
     return xsm_ops->domain_memory_map(d);
 }
 
-static inline int xsm_mmu_update (struct domain *d, struct domain *t,
+static inline int xsm_mmu_update (xsm_default_t def, struct domain *d, struct domain *t,
                                   struct domain *f, uint32_t flags)
 {
     return xsm_ops->mmu_update(d, t, f, flags);
 }
 
-static inline int xsm_mmuext_op (struct domain *d, struct domain *f)
+static inline int xsm_mmuext_op (xsm_default_t def, struct domain *d, struct domain *f)
 {
     return xsm_ops->mmuext_op(d, f);
 }
 
-static inline int xsm_update_va_mapping(struct domain *d, struct domain *f, 
+static inline int xsm_update_va_mapping(xsm_default_t def, struct domain *d, struct domain *f,
                                                             l1_pgentry_t pte)
 {
     return xsm_ops->update_va_mapping(d, f, pte);
 }
 
-static inline int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
+static inline int xsm_add_to_physmap(xsm_default_t def, struct domain *d1, struct domain *d2)
 {
     return xsm_ops->add_to_physmap(d1, d2);
 }
 
-static inline int xsm_bind_pt_irq(struct domain *d, 
+static inline int xsm_bind_pt_irq(xsm_default_t def, struct domain *d,
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
     return xsm_ops->bind_pt_irq(d, bind);
 }
 
-static inline int xsm_unbind_pt_irq(struct domain *d,
+static inline int xsm_unbind_pt_irq(xsm_default_t def, struct domain *d,
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
     return xsm_ops->unbind_pt_irq(d, bind);
 }
 
-static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static inline int xsm_ioport_permission (xsm_default_t def, struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return xsm_ops->ioport_permission(d, s, e, allow);
 }
 
-static inline int xsm_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static inline int xsm_ioport_mapping (xsm_default_t def, struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return xsm_ops->ioport_mapping(d, s, e, allow);
 }
@@ -576,7 +588,6 @@ extern void xsm_fixup_ops(struct xsm_operations *ops);
 
 #else /* XSM_ENABLE */
 
-#define XSM_INLINE inline
 #include <xsm/dummy.h>
 
 static inline int xsm_init (unsigned long *module_map,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSex-0002Zo-Od; Fri, 30 Nov 2012 15:37:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSes-0002Rv-J4
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:43 +0000
Received: from [85.158.139.211:30871] by server-11.bemta-5.messagelabs.com id
	77/46-03409-5C2D8B05; Fri, 30 Nov 2012 15:37:41 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-6.tower-206.messagelabs.com!1354289856!18577856!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11674 invoked from network); 30 Nov 2012 15:37:37 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-6.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 15:37:37 -0000
X-TM-IMSS-Message-ID: <3392290100027ac6@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 3392290100027ac6 ;
	Fri, 30 Nov 2012 10:36:29 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSdG017785; 
	Fri, 30 Nov 2012 10:37:35 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:10 -0500
Message-Id: <1354289830-24642-24-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>, Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Tim Deegan <tim@xen.org>, Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 23/23] xen/xsm: Add xsm_default parameter to XSM
	hooks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Include the default XSM hook action as the first argument of the hook to
facilitate quick understanding of how the call site is expected to be
used (dom0-only, arbitrary guest, or device model). This argument does
not solely define how a given hook is interpreted, since any changes to
the hook's default action need to be made identically to all callers of
a hook (if there are multiple callers; most hooks only have one), and
may also require changing the arguments of the hook.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Tim Deegan <tim@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/cpu/mcheck/mce.c     |   2 +-
 xen/arch/x86/domctl.c             |  10 +-
 xen/arch/x86/hvm/hvm.c            |  26 +-
 xen/arch/x86/irq.c                |   2 +-
 xen/arch/x86/mm.c                 |  20 +-
 xen/arch/x86/mm/mem_event.c       |   4 +-
 xen/arch/x86/mm/mem_sharing.c     |   4 +-
 xen/arch/x86/mm/paging.c          |   2 +-
 xen/arch/x86/msi.c                |   2 +-
 xen/arch/x86/physdev.c            |  12 +-
 xen/arch/x86/platform_hypercall.c |  10 +-
 xen/arch/x86/sysctl.c             |   4 +-
 xen/arch/x86/traps.c              |   2 +-
 xen/common/domain.c               |   2 +-
 xen/common/domctl.c               |  10 +-
 xen/common/event_channel.c        |  12 +-
 xen/common/grant_table.c          |  16 +-
 xen/common/kexec.c                |   2 +-
 xen/common/memory.c               |   8 +-
 xen/common/schedule.c             |   2 +-
 xen/common/sysctl.c               |   8 +-
 xen/common/xenoprof.c             |   2 +-
 xen/drivers/char/console.c        |   2 +-
 xen/drivers/passthrough/iommu.c   |  10 +-
 xen/drivers/passthrough/pci.c     |   4 +-
 xen/include/xen/tmem_xen.h        |   4 +-
 xen/include/xsm/dummy.h           | 507 +++++++++++++++++++++-----------------
 xen/include/xsm/xsm.h             | 155 ++++++------
 28 files changed, 455 insertions(+), 389 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 658774a..26273f9 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1293,7 +1293,7 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
     struct xen_mc_msrinject *mc_msrinject;
     struct xen_mc_mceinject *mc_mceinject;
 
-    ret = xsm_do_mca();
+    ret = xsm_do_mca(XSM_PRIV);
     if ( ret )
         return x86_mcerr(NULL, ret);
 
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 2630bdb..0117375 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -76,7 +76,7 @@ long arch_do_domctl(
 
         if ( np == 0 )
             ret = 0;
-        else if ( xsm_ioport_permission(d, fp, fp + np - 1, allow) )
+        else if ( xsm_ioport_permission(XSM_HOOK, d, fp, fp + np - 1, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = ioports_permit_access(d, fp, fp + np - 1);
@@ -566,7 +566,7 @@ long arch_do_domctl(
         if ( !is_hvm_domain(d) )
             break;
 
-        ret = xsm_bind_pt_irq(d, bind);
+        ret = xsm_bind_pt_irq(XSM_HOOK, d, bind);
         if ( ret )
             break;
 
@@ -599,7 +599,7 @@ long arch_do_domctl(
              !irq_access_permitted(current->domain, bind->machine_irq) )
             break;
 
-        ret = xsm_unbind_pt_irq(d, bind);
+        ret = xsm_unbind_pt_irq(XSM_HOOK, d, bind);
         if ( ret )
             break;
 
@@ -634,7 +634,7 @@ long arch_do_domctl(
              !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
             break;
 
-        ret = xsm_iomem_mapping(d, mfn, mfn + nr_mfns - 1, add);
+        ret = xsm_iomem_mapping(XSM_HOOK, d, mfn, mfn + nr_mfns - 1, add);
         if ( ret )
             break;
 
@@ -712,7 +712,7 @@ long arch_do_domctl(
              !ioports_access_permitted(current->domain, fmp, fmp + np - 1) )
             break;
 
-        ret = xsm_ioport_mapping(d, fmp, fmp + np - 1, add);
+        ret = xsm_ioport_mapping(XSM_HOOK, d, fmp, fmp + np - 1, add);
         if ( ret )
             break;
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 5bdde8d..eda715f 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3400,7 +3400,7 @@ static int hvmop_set_pci_intx_level(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_set_pci_intx_level(d);
+    rc = xsm_hvm_set_pci_intx_level(XSM_DM_PRIV, d);
     if ( rc )
         goto out;
 
@@ -3567,7 +3567,7 @@ static int hvmop_set_isa_irq_level(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_set_isa_irq_level(d);
+    rc = xsm_hvm_set_isa_irq_level(XSM_DM_PRIV, d);
     if ( rc )
         goto out;
 
@@ -3611,7 +3611,7 @@ static int hvmop_set_pci_link_route(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_set_pci_link_route(d);
+    rc = xsm_hvm_set_pci_link_route(XSM_DM_PRIV, d);
     if ( rc )
         goto out;
 
@@ -3641,7 +3641,7 @@ static int hvmop_inject_msi(
     if ( !is_hvm_domain(d) )
         goto out;
 
-    rc = xsm_hvm_inject_msi(d);
+    rc = xsm_hvm_inject_msi(XSM_DM_PRIV, d);
     if ( rc )
         goto out;
 
@@ -3738,7 +3738,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
         if ( rc )
             goto param_fail;
 
@@ -3984,7 +3984,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail2;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
         if ( rc )
             goto param_fail2;
 
@@ -4023,7 +4023,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail3;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
         if ( rc )
             goto param_fail3;
 
@@ -4069,7 +4069,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
         if ( rc )
             goto param_fail_getmemtype;
 
@@ -4124,7 +4124,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail4;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
         if ( rc )
             goto param_fail4;
 
@@ -4203,7 +4203,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail5;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
         if ( rc )
             goto param_fail5;
 
@@ -4238,7 +4238,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail6;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
         if ( rc )
             goto param_fail6;
 
@@ -4274,7 +4274,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) || !paging_mode_shadow(d) )
             goto param_fail7;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
         if ( rc )
             goto param_fail7;
 
@@ -4328,7 +4328,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !is_hvm_domain(d) )
             goto param_fail8;
 
-        rc = xsm_hvm_param(d, op);
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
         if ( rc )
             goto param_fail8;
 
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 238600a..095c17d 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1874,7 +1874,7 @@ int map_domain_pirq(
         return 0;
     }
 
-    ret = xsm_map_domain_pirq(d, irq, data);
+    ret = xsm_map_domain_pirq(XSM_HOOK, d, irq, data);
     if ( ret )
     {
         dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq %d mapping to pirq %d\n",
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 9a2acca..f2cf7d9 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2716,7 +2716,7 @@ long do_mmuext_op(
         goto out;
     }
 
-    rc = xsm_mmuext_op(d, pg_owner);
+    rc = xsm_mmuext_op(XSM_TARGET, d, pg_owner);
     if ( rc )
     {
         rcu_unlock_domain(pg_owner);
@@ -2788,7 +2788,7 @@ long do_mmuext_op(
                 break;
             }
 
-            if ( (rc = xsm_memory_pin_page(d, pg_owner, page)) != 0 )
+            if ( (rc = xsm_memory_pin_page(XSM_HOOK, d, pg_owner, page)) != 0 )
             {
                 put_page_and_type(page);
                 okay = 0;
@@ -3245,7 +3245,7 @@ long do_mmu_update(
             }
             if ( xsm_needed != xsm_checked )
             {
-                rc = xsm_mmu_update(d, pt_owner, pg_owner, xsm_needed);
+                rc = xsm_mmu_update(XSM_TARGET, d, pt_owner, pg_owner, xsm_needed);
                 if ( rc )
                     break;
                 xsm_checked = xsm_needed;
@@ -3364,7 +3364,7 @@ long do_mmu_update(
             xsm_needed |= XSM_MMU_MACHPHYS_UPDATE;
             if ( xsm_needed != xsm_checked )
             {
-                rc = xsm_mmu_update(d, NULL, pg_owner, xsm_needed);
+                rc = xsm_mmu_update(XSM_TARGET, d, NULL, pg_owner, xsm_needed);
                 if ( rc )
                     break;
                 xsm_checked = xsm_needed;
@@ -3932,7 +3932,7 @@ static int __do_update_va_mapping(
 
     perfc_incr(calls_to_update_va);
 
-    rc = xsm_update_va_mapping(d, pg_owner, val);
+    rc = xsm_update_va_mapping(XSM_TARGET, d, pg_owner, val);
     if ( rc )
         return rc;
 
@@ -4403,7 +4403,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        if ( xsm_add_to_physmap(current->domain, d) )
+        if ( xsm_add_to_physmap(XSM_TARGET, current->domain, d) )
         {
             rcu_unlock_domain(d);
             return -EPERM;
@@ -4442,7 +4442,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        rc = xsm_domain_memory_map(d);
+        rc = xsm_domain_memory_map(XSM_TARGET, d);
         if ( rc )
         {
             rcu_unlock_domain(d);
@@ -4517,7 +4517,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         XEN_GUEST_HANDLE_PARAM(e820entry_t) buffer_param;
         unsigned int i;
 
-        rc = xsm_machine_memory_map();
+        rc = xsm_machine_memory_map(XSM_PRIV);
         if ( rc )
             return rc;
 
@@ -4601,9 +4601,9 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
             return -ESRCH;
 
         if ( op == XENMEM_set_pod_target )
-            rc = xsm_set_pod_target(d);
+            rc = xsm_set_pod_target(XSM_PRIV, d);
         else
-            rc = xsm_get_pod_target(d);
+            rc = xsm_get_pod_target(XSM_PRIV, d);
 
         if ( rc != 0 )
             goto pod_target_out_unlock;
diff --git a/xen/arch/x86/mm/mem_event.c b/xen/arch/x86/mm/mem_event.c
index c2b3670..4222248 100644
--- a/xen/arch/x86/mm/mem_event.c
+++ b/xen/arch/x86/mm/mem_event.c
@@ -449,7 +449,7 @@ int do_mem_event_op(int op, uint32_t domain, void *arg)
     if ( ret )
         return ret;
 
-    ret = xsm_mem_event_op(d, op);
+    ret = xsm_mem_event_op(XSM_TARGET, d, op);
     if ( ret )
         goto out;
 
@@ -502,7 +502,7 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
 {
     int rc;
 
-    rc = xsm_mem_event_control(d, mec->mode, mec->op);
+    rc = xsm_mem_event_control(XSM_PRIV, d, mec->mode, mec->op);
     if ( rc )
         return rc;
 
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 9229b83..5f3d319 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1351,7 +1351,7 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( rc )
                 return rc;
 
-            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            rc = xsm_mem_sharing_op(XSM_TARGET, d, cd, mec->op);
             if ( rc )
             {
                 rcu_unlock_domain(cd);
@@ -1415,7 +1415,7 @@ int mem_sharing_memop(struct domain *d, xen_mem_sharing_op_t *mec)
             if ( rc )
                 return rc;
 
-            rc = xsm_mem_sharing_op(d, cd, mec->op);
+            rc = xsm_mem_sharing_op(XSM_TARGET, d, cd, mec->op);
             if ( rc )
             {
                 rcu_unlock_domain(cd);
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index ea44e39..ff7b0c6 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -678,7 +678,7 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
         return -EINVAL;
     }
 
-    rc = xsm_shadow_control(d, sc->op);
+    rc = xsm_shadow_control(XSM_HOOK, d, sc->op);
     if ( rc )
         return rc;
 
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 62ed290..e3f91c6 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1016,7 +1016,7 @@ int pci_restore_msi_state(struct pci_dev *pdev)
     if (!pdev)
         return -EINVAL;
 
-    ret = xsm_resource_setup_pci((pdev->seg << 16) | (pdev->bus << 8) | pdev->devfn);
+    ret = xsm_resource_setup_pci(XSM_PRIV, (pdev->seg << 16) | (pdev->bus << 8) | pdev->devfn);
     if ( ret )
         return ret;
 
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 9c30245..9be1b47 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -232,7 +232,7 @@ int physdev_unmap_pirq(domid_t domid, int pirq)
             goto free_domain;
     }
 
-    ret = xsm_unmap_domain_pirq(d, domain_pirq_to_irq(d, pirq));
+    ret = xsm_unmap_domain_pirq(XSM_TARGET, d, domain_pirq_to_irq(d, pirq));
     if ( ret )
         goto free_domain;
 
@@ -423,7 +423,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = xsm_apic(v->domain, cmd);
+        ret = xsm_apic(XSM_PRIV, v->domain, cmd);
         if ( ret )
             break;
         ret = ioapic_guest_read(apic.apic_physbase, apic.reg, &apic.value);
@@ -437,7 +437,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         ret = -EFAULT;
         if ( copy_from_guest(&apic, arg, 1) != 0 )
             break;
-        ret = xsm_apic(v->domain, cmd);
+        ret = xsm_apic(XSM_PRIV, v->domain, cmd);
         if ( ret )
             break;
         ret = ioapic_guest_write(apic.apic_physbase, apic.reg, apic.value);
@@ -453,7 +453,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         /* Use the APIC check since this dummy hypercall should still only
          * be called by the domain with access to program the ioapic */
-        ret = xsm_apic(v->domain, cmd);
+        ret = xsm_apic(XSM_PRIV, v->domain, cmd);
         if ( ret )
             break;
 
@@ -578,7 +578,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_pci_mmcfg_reserved: {
         struct physdev_pci_mmcfg_reserved info;
 
-        ret = xsm_resource_setup_misc();
+        ret = xsm_resource_setup_misc(XSM_PRIV);
         if ( ret )
             break;
 
@@ -632,7 +632,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( setup_gsi.gsi < 0 || setup_gsi.gsi >= nr_irqs_gsi )
             break;
 
-        ret = xsm_resource_setup_gsi(setup_gsi.gsi);
+        ret = xsm_resource_setup_gsi(XSM_PRIV, setup_gsi.gsi);
         if ( ret )
             break;
 
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index e17d64f..cdbf8e4 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -72,7 +72,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     if ( op->interface_version != XENPF_INTERFACE_VERSION )
         return -EACCES;
 
-    ret = xsm_platform_op(op->cmd);
+    ret = xsm_platform_op(XSM_PRIV, op->cmd);
     if ( ret )
         return ret;
 
@@ -496,7 +496,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        ret = xsm_resource_plug_core();
+        ret = xsm_resource_plug_core(XSM_HOOK);
         if ( ret )
             break;
 
@@ -521,7 +521,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        ret = xsm_resource_unplug_core();
+        ret = xsm_resource_unplug_core(XSM_HOOK);
         if ( ret )
             break;
 
@@ -550,7 +550,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_cpu_hotadd:
-        ret = xsm_resource_plug_core();
+        ret = xsm_resource_plug_core(XSM_HOOK);
         if ( ret )
             break;
 
@@ -560,7 +560,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     break;
 
     case XENPF_mem_hotadd:
-        ret = xsm_resource_plug_core();
+        ret = xsm_resource_plug_core(XSM_HOOK);
         if ( ret )
             break;
 
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index 5b0c4b7..23d0db1 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -184,14 +184,14 @@ long arch_do_sysctl(
         switch ( sysctl->u.cpu_hotplug.op )
         {
         case XEN_SYSCTL_CPU_HOTPLUG_ONLINE:
-            ret = xsm_resource_plug_core();
+            ret = xsm_resource_plug_core(XSM_HOOK);
             if ( ret )
                 break;
             ret = continue_hypercall_on_cpu(
                 0, cpu_up_helper, (void *)(unsigned long)cpu);
             break;
         case XEN_SYSCTL_CPU_HOTPLUG_OFFLINE:
-            ret = xsm_resource_unplug_core();
+            ret = xsm_resource_unplug_core(XSM_HOOK);
             if ( ret )
                 break;
             ret = continue_hypercall_on_cpu(
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 44a866e..7c180ea 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1643,7 +1643,7 @@ static int pci_cfg_ok(struct domain *d, int write, int size)
             start |= (d->arch.pci_cf8 >> 16) & 0xF00;
     }
     end = start + size - 1;
-    if (xsm_pci_config_permission(d, machine_bdf, start, end, write))
+    if (xsm_pci_config_permission(XSM_HOOK, d, machine_bdf, start, end, write))
         return 0;
     return 1;
 }
diff --git a/xen/common/domain.c b/xen/common/domain.c
index fcf24e2..3f91f62 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -252,7 +252,7 @@ struct domain *domain_create(
 
     if ( !is_idle_domain(d) )
     {
-        if ( (err = xsm_domain_create(d, ssidref)) != 0 )
+        if ( (err = xsm_domain_create(XSM_HOOK, d, ssidref)) != 0 )
             goto fail;
 
         d->is_paused_by_controller = 1;
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 6f792e9..69e008a 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -264,7 +264,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             return -ESRCH;
     }
 
-    ret = xsm_domctl(d, op->cmd);
+    ret = xsm_domctl(XSM_OTHER, d, op->cmd);
     if ( ret )
         goto domctl_out_unlock;
 
@@ -580,7 +580,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             break;
         }
 
-        ret = xsm_getdomaininfo(d);
+        ret = xsm_getdomaininfo(XSM_HOOK, d);
         if ( ret )
             goto getdomaininfo_out;
 
@@ -722,7 +722,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
         if ( pirq >= d->nr_pirqs )
             ret = -EINVAL;
-        else if ( xsm_irq_permission(d, pirq, allow) )
+        else if ( xsm_irq_permission(XSM_HOOK, d, pirq, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = irq_permit_access(d, pirq);
@@ -741,7 +741,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
             break;
 
-        if ( xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, allow) )
+        if ( xsm_iomem_permission(XSM_HOOK, d, mfn, mfn + nr_mfns - 1, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
@@ -773,7 +773,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             break;
         }
 
-        ret = xsm_set_target(d, e);
+        ret = xsm_set_target(XSM_HOOK, d, e);
         if ( ret ) {
             put_domain(e);
             break;
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 37947a9..1dc3d0e 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -175,7 +175,7 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
         ERROR_EXIT_DOM(port, d);
     chn = evtchn_from_port(d, port);
 
-    rc = xsm_evtchn_unbound(d, chn, alloc->remote_dom);
+    rc = xsm_evtchn_unbound(XSM_TARGET, d, chn, alloc->remote_dom);
     if ( rc )
         goto out;
 
@@ -231,7 +231,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
          (rchn->u.unbound.remote_domid != ld->domain_id) )
         ERROR_EXIT_DOM(-EINVAL, rd);
 
-    rc = xsm_evtchn_interdomain(ld, lchn, rd, rchn);
+    rc = xsm_evtchn_interdomain(XSM_HOOK, ld, lchn, rd, rchn);
     if ( rc )
         goto out;
 
@@ -580,7 +580,7 @@ int evtchn_send(struct domain *d, unsigned int lport)
         return -EINVAL;
     }
 
-    ret = xsm_evtchn_send(ld, lchn);
+    ret = xsm_evtchn_send(XSM_HOOK, ld, lchn);
     if ( ret )
         goto out;
 
@@ -812,7 +812,7 @@ static long evtchn_status(evtchn_status_t *status)
 
     chn = evtchn_from_port(d, port);
 
-    rc = xsm_evtchn_status(d, chn);
+    rc = xsm_evtchn_status(XSM_TARGET, d, chn);
     if ( rc )
         goto out;
 
@@ -954,7 +954,7 @@ static long evtchn_reset(evtchn_reset_t *r)
     if ( d == NULL )
         return -ESRCH;
 
-    rc = xsm_evtchn_reset(current->domain, d);
+    rc = xsm_evtchn_reset(XSM_TARGET, current->domain, d);
     if ( rc )
         goto out;
 
@@ -1101,7 +1101,7 @@ int alloc_unbound_xen_event_channel(
         goto out;
     chn = evtchn_from_port(d, port);
 
-    rc = xsm_evtchn_unbound(d, chn, remote_domid);
+    rc = xsm_evtchn_unbound(XSM_TARGET, d, chn, remote_domid);
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index eae9518..c58ea1b 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -552,7 +552,7 @@ __gnttab_map_grant_ref(
         return;
     }
 
-    rc = xsm_grant_mapref(ld, rd, op->flags);
+    rc = xsm_grant_mapref(XSM_HOOK, ld, rd, op->flags);
     if ( rc )
     {
         rcu_unlock_domain(rd);
@@ -872,7 +872,7 @@ __gnttab_unmap_common(
         return;
     }
 
-    rc = xsm_grant_unmapref(ld, rd);
+    rc = xsm_grant_unmapref(XSM_HOOK, ld, rd);
     if ( rc )
     {
         rcu_unlock_domain(rd);
@@ -1326,7 +1326,7 @@ gnttab_setup_table(
         goto out2;
     }
 
-    if ( xsm_grant_setup(current->domain, d) )
+    if ( xsm_grant_setup(XSM_TARGET, current->domain, d) )
     {
         op.status = GNTST_permission_denied;
         goto out2;
@@ -1395,7 +1395,7 @@ gnttab_query_size(
         goto query_out;
     }
 
-    rc = xsm_grant_query_size(current->domain, d);
+    rc = xsm_grant_query_size(XSM_TARGET, current->domain, d);
     if ( rc )
     {
         op.status = GNTST_permission_denied;
@@ -1571,7 +1571,7 @@ gnttab_transfer(
             goto copyback;
         }
 
-        if ( xsm_grant_transfer(d, e) )
+        if ( xsm_grant_transfer(XSM_HOOK, d, e) )
         {
             put_gfn(d, gop.mfn);
             gop.status = GNTST_permission_denied;
@@ -2010,7 +2010,7 @@ __gnttab_copy(
         PIN_FAIL(error_out, GNTST_bad_domain,
                  "couldn't find %d\n", op->dest.domid);
 
-    rc = xsm_grant_copy(sd, dd);
+    rc = xsm_grant_copy(XSM_HOOK, sd, dd);
     if ( rc )
     {
         rc = GNTST_permission_denied;
@@ -2267,7 +2267,7 @@ gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop,
         op.status = GNTST_bad_domain;
         goto out1;
     }
-    rc = xsm_grant_setup(current->domain, d);
+    rc = xsm_grant_setup(XSM_TARGET, current->domain, d);
     if ( rc ) {
         op.status = GNTST_permission_denied;
         goto out1;
@@ -2318,7 +2318,7 @@ gnttab_get_version(XEN_GUEST_HANDLE_PARAM(gnttab_get_version_t uop))
     if ( d == NULL )
         return -ESRCH;
 
-    rc = xsm_grant_query_size(current->domain, d);
+    rc = xsm_grant_query_size(XSM_TARGET, current->domain, d);
     if ( rc )
     {
         rcu_unlock_domain(d);
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index d4f6332..6dd20c6 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -852,7 +852,7 @@ static int do_kexec_op_internal(unsigned long op,
     unsigned long flags;
     int ret = -EINVAL;
 
-    ret = xsm_kexec();
+    ret = xsm_kexec(XSM_PRIV);
     if ( ret )
         return ret;
 
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 7d3c326..c4d4ba8 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -336,7 +336,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
         goto fail_early;
     }
 
-    rc = xsm_memory_exchange(d);
+    rc = xsm_memory_exchange(XSM_TARGET, d);
     if ( rc )
     {
         rcu_unlock_domain(d);
@@ -585,7 +585,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return start_extent;
         args.domain = d;
 
-        rc = xsm_memory_adjust_reservation(current->domain, d);
+        rc = xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d);
         if ( rc )
         {
             rcu_unlock_domain(d);
@@ -634,7 +634,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        rc = xsm_memory_stat_reservation(current->domain, d);
+        rc = xsm_memory_stat_reservation(XSM_TARGET, current->domain, d);
         if ( rc )
         {
             rcu_unlock_domain(d);
@@ -672,7 +672,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -ESRCH;
 
-        if ( xsm_remove_from_physmap(current->domain, d) )
+        if ( xsm_remove_from_physmap(XSM_TARGET, current->domain, d) )
         {
             rcu_unlock_domain(d);
             return -EPERM;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index cfd173d..009ae96 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -921,7 +921,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             break;
 
-        ret = xsm_schedop_shutdown(current->domain, d);
+        ret = xsm_schedop_shutdown(XSM_DM_PRIV, current->domain, d);
         if ( ret )
         {
             rcu_unlock_domain(d);
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index cbefb0e..2a53038 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -39,7 +39,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     if ( op->interface_version != XEN_SYSCTL_INTERFACE_VERSION )
         return -EACCES;
 
-    ret = xsm_sysctl(op->cmd);
+    ret = xsm_sysctl(XSM_PRIV, op->cmd);
     if ( ret )
         return ret;
 
@@ -57,7 +57,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     {
     case XEN_SYSCTL_readconsole:
     {
-        ret = xsm_readconsole(op->u.readconsole.clear);
+        ret = xsm_readconsole(XSM_HOOK, op->u.readconsole.clear);
         if ( ret )
             break;
 
@@ -100,7 +100,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
             if ( num_domains == op->u.getdomaininfolist.max_domains )
                 break;
 
-            ret = xsm_getdomaininfo(d);
+            ret = xsm_getdomaininfo(XSM_HOOK, d);
             if ( ret )
                 continue;
 
@@ -231,7 +231,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         uint32_t *status, *ptr;
         unsigned long pfn;
 
-        ret = xsm_page_offline(op->u.page_offline.cmd);
+        ret = xsm_page_offline(XSM_HOOK, op->u.page_offline.cmd);
         if ( ret )
             break;
 
diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index ae0435b..e834f3d 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -680,7 +680,7 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         return -EPERM;
     }
 
-    ret = xsm_profile(current->domain, op);
+    ret = xsm_profile(XSM_HOOK, current->domain, op);
     if ( ret )
         return ret;
 
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index b2c3ee3..e9f696d 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -406,7 +406,7 @@ long do_console_io(int cmd, int count, XEN_GUEST_HANDLE_PARAM(char) buffer)
     long rc;
     unsigned int idx, len;
 
-    rc = xsm_console_io(current->domain, cmd);
+    rc = xsm_console_io(XSM_OTHER, current->domain, cmd);
     if ( rc )
         return rc;
 
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 9d13185..6a0f8d6 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -452,7 +452,7 @@ static int iommu_get_device_group(
              ((pdev->bus == bus) && (pdev->devfn == devfn)) )
             continue;
 
-        if ( xsm_get_device_group((seg << 16) | (pdev->bus << 8) | pdev->devfn) )
+        if ( xsm_get_device_group(XSM_HOOK, (seg << 16) | (pdev->bus << 8) | pdev->devfn) )
             continue;
 
         sdev_id = ops->get_device_group_id(seg, pdev->bus, pdev->devfn);
@@ -555,7 +555,7 @@ int iommu_do_domctl(
         u32 max_sdevs;
         XEN_GUEST_HANDLE_64(uint32) sdevs;
 
-        ret = xsm_get_device_group(domctl->u.get_device_group.machine_sbdf);
+        ret = xsm_get_device_group(XSM_HOOK, domctl->u.get_device_group.machine_sbdf);
         if ( ret )
             break;
 
@@ -583,7 +583,7 @@ int iommu_do_domctl(
     break;
 
     case XEN_DOMCTL_test_assign_device:
-        ret = xsm_test_assign_device(domctl->u.assign_device.machine_sbdf);
+        ret = xsm_test_assign_device(XSM_HOOK, domctl->u.assign_device.machine_sbdf);
         if ( ret )
             break;
 
@@ -607,7 +607,7 @@ int iommu_do_domctl(
             break;
         }
 
-        ret = xsm_assign_device(d, domctl->u.assign_device.machine_sbdf);
+        ret = xsm_assign_device(XSM_HOOK, d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
             break;
 
@@ -626,7 +626,7 @@ int iommu_do_domctl(
         break;
 
     case XEN_DOMCTL_deassign_device:
-        ret = xsm_deassign_device(d, domctl->u.assign_device.machine_sbdf);
+        ret = xsm_deassign_device(XSM_HOOK, d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
             break;
 
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index a61a9ba..d75b7b7 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -380,7 +380,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn, const struct pci_dev_info *info)
         pdev_type = "device";
     }
 
-    ret = xsm_resource_plug_pci((seg << 16) | (bus << 8) | devfn);
+    ret = xsm_resource_plug_pci(XSM_PRIV, (seg << 16) | (bus << 8) | devfn);
     if ( ret )
         return ret;
 
@@ -496,7 +496,7 @@ int pci_remove_device(u16 seg, u8 bus, u8 devfn)
     struct pci_dev *pdev;
     int ret;
 
-    ret = xsm_resource_unplug_pci((seg << 16) | (bus << 8) | devfn);
+    ret = xsm_resource_unplug_pci(XSM_PRIV, (seg << 16) | (bus << 8) | devfn);
     if ( ret )
         return ret;
 
diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h
index 8dec5aa..ad1ddd5 100644
--- a/xen/include/xen/tmem_xen.h
+++ b/xen/include/xen/tmem_xen.h
@@ -329,12 +329,12 @@ static inline bool_t tmh_set_client_from_id(
 
 static inline bool_t tmh_current_permitted(void)
 {
-    return !xsm_tmem_op();
+    return !xsm_tmem_op(XSM_HOOK);
 }
 
 static inline bool_t tmh_current_is_privileged(void)
 {
-    return !xsm_tmem_control();
+    return !xsm_tmem_control(XSM_PRIV);
 }
 
 static inline uint8_t tmh_get_first_byte(pfp_t *pfp)
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 019183e..2c750de 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -6,68 +6,132 @@
  *  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.
+ *
+ *
+ *  Each XSM hook implementing an access check should have its first parameter
+ *  preceded by XSM_DEFAULT_ARG (or use XSM_DEFAULT_VOID if it has no
+ *  arguments). The first non-declaration statement shold be XSM_ASSERT_ACTION
+ *  with the expected type of the hook, which will either define or check the
+ *  value of action.
  */
 
 #include <xen/sched.h>
 #include <xsm/xsm.h>
 
+/* Cannot use BUILD_BUG_ON here because the expressions we check are not
+ * considered constant at compile time. Instead, rely on constant propagation to
+ * inline out the calls to this invalid function, which will cause linker errors
+ * if references remain at link time.
+ */
+#define LINKER_BUG_ON(x) do { if (x) __xsm_action_mismatch_detected(); } while (0)
+/* DO NOT implement this function; it is supposed to trigger link errors */
+void __xsm_action_mismatch_detected(void);
+
+#ifdef XSM_ENABLE
+
+/* In XSM_ENABLE builds, this header file is included from xsm/dummy.c, and
+ * contains static (not inline) functions compiled to the dummy XSM module.
+ * There is no xsm_default_t argument available, so the value from the assertion
+ * is used to initialize the variable.
+ */
+#define XSM_INLINE /* */
+#define XSM_DEFAULT_ARG /* */
+#define XSM_DEFAULT_VOID void
+#define XSM_ASSERT_ACTION(def) xsm_default_t action = def; (void)action
+
+#else /* XSM_ENABLE */
+
+/* In !XSM_ENABLE builds, this header file is included from xsm/xsm.h, and
+ * contains inline functions for each XSM hook. These functions also perform
+ * compile-time checks on the xsm_default_t argument to ensure that the behavior
+ * of the dummy XSM module is the same as the behavior with XSM disabled.
+ */
+#define XSM_INLINE inline
+#define XSM_DEFAULT_ARG xsm_default_t action,
+#define XSM_DEFAULT_VOID xsm_default_t action
+#define XSM_ASSERT_ACTION(def) LINKER_BUG_ON(def != action)
+
+#endif /* XSM_ENABLE */
+
+static inline int xsm_default_action(xsm_default_t action, struct domain *src,
+                                     struct domain *target)
+{
+    switch ( action ) {
+    case XSM_HOOK:
+        return 0;
+    case XSM_DM_PRIV:
+        if ( !IS_PRIV_FOR(src, target) )
+            return -EPERM;
+        return 0;
+    case XSM_TARGET:
+        if ( src != target && !IS_PRIV_FOR(src, target) )
+            return -EPERM;
+        return 0;
+    case XSM_PRIV:
+        if ( !IS_PRIV(src) )
+            return -EPERM;
+        return 0;
+    default:
+        LINKER_BUG_ON(1);
+        return -EPERM;
+    }
+}
+
 static XSM_INLINE void xsm_security_domaininfo(struct domain *d,
                                     struct xen_domctl_getdomaininfo *info)
 {
     return;
 }
 
-static XSM_INLINE int xsm_domain_create(struct domain *d, u32 ssidref)
+static XSM_INLINE int xsm_domain_create(XSM_DEFAULT_ARG struct domain *d, u32 ssidref)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_getdomaininfo(struct domain *d)
+static XSM_INLINE int xsm_getdomaininfo(XSM_DEFAULT_ARG struct domain *d)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e)
+static XSM_INLINE int xsm_set_target(XSM_DEFAULT_ARG struct domain *d, struct domain *e)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_domctl(struct domain *d, int cmd)
+static XSM_INLINE int xsm_domctl(XSM_DEFAULT_ARG struct domain *d, int cmd)
 {
+    XSM_ASSERT_ACTION(XSM_OTHER);
     switch ( cmd )
     {
     case XEN_DOMCTL_ioport_mapping:
     case XEN_DOMCTL_memory_mapping:
     case XEN_DOMCTL_bind_pt_irq:
-    case XEN_DOMCTL_unbind_pt_irq: {
-        if ( !IS_PRIV_FOR(current->domain, d) )
-            return -EPERM;
-        break;
-    }
+    case XEN_DOMCTL_unbind_pt_irq:
+        return xsm_default_action(XSM_DM_PRIV, current->domain, d);
     default:
-        if ( !IS_PRIV(current->domain) )
-            return -EPERM;
+        return xsm_default_action(XSM_PRIV, current->domain, d);
     }
-    return 0;
 }
 
-static XSM_INLINE int xsm_sysctl(int cmd)
+static XSM_INLINE int xsm_sysctl(XSM_DEFAULT_ARG int cmd)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_readconsole(uint32_t clear)
+static XSM_INLINE int xsm_readconsole(XSM_DEFAULT_ARG uint32_t clear)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_do_mca(void)
+static XSM_INLINE int xsm_do_mca(XSM_DEFAULT_VOID)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
 static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
@@ -80,109 +144,109 @@ static XSM_INLINE void xsm_free_security_domain(struct domain *d)
     return;
 }
 
-static XSM_INLINE int xsm_grant_mapref(struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_grant_mapref(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_grant_unmapref(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_unmapref(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_grant_setup(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_setup(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_grant_transfer(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_transfer(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_grant_copy(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_copy(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_grant_query_size(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_grant_query_size(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_memory_exchange(struct domain *d)
+static XSM_INLINE int xsm_memory_exchange(XSM_DEFAULT_ARG struct domain *d)
 {
-    if ( d != current->domain && !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
+static XSM_INLINE int xsm_memory_adjust_reservation(XSM_DEFAULT_ARG struct domain *d1,
                                                             struct domain *d2)
 {
-    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_memory_stat_reservation(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_memory_stat_reservation(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_console_io(struct domain *d, int cmd)
+static XSM_INLINE int xsm_console_io(XSM_DEFAULT_ARG struct domain *d, int cmd)
 {
-#ifndef VERBOSE
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
+    XSM_ASSERT_ACTION(XSM_OTHER);
+#ifdef VERBOSE
+    return xsm_default_action(XSM_HOOK, current->domain, NULL);
+#else
+    return xsm_default_action(XSM_PRIV, current->domain, NULL);
 #endif
-    return 0;
 }
 
-static XSM_INLINE int xsm_profile(struct domain *d, int op)
+static XSM_INLINE int xsm_profile(XSM_DEFAULT_ARG struct domain *d, int op)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_kexec(void)
+static XSM_INLINE int xsm_kexec(XSM_DEFAULT_VOID)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_schedop_shutdown(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_schedop_shutdown(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    if ( !IS_PRIV_FOR(d1, d2) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_DM_PRIV);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
+static XSM_INLINE int xsm_memory_pin_page(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2,
                                           struct page_info *page)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_evtchn_unbound(struct domain *d, struct evtchn *chn,
+static XSM_INLINE int xsm_evtchn_unbound(XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn,
                                          domid_t id2)
 {
-    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_evtchn_interdomain(struct domain *d1, struct evtchn
+static XSM_INLINE int xsm_evtchn_interdomain(XSM_DEFAULT_ARG struct domain *d1, struct evtchn
                                 *chan1, struct domain *d2, struct evtchn *chan2)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, d1, d2);
 }
 
 static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
@@ -190,23 +254,22 @@ static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
     return;
 }
 
-static XSM_INLINE int xsm_evtchn_send(struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_evtchn_send(XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_evtchn_status(struct domain *d, struct evtchn *chn)
+static XSM_INLINE int xsm_evtchn_status(XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
 {
-    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_evtchn_reset(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_evtchn_reset(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d1, d2);
 }
 
 static XSM_INLINE int xsm_alloc_security_evtchn(struct evtchn *chn)
@@ -224,100 +287,100 @@ static XSM_INLINE char *xsm_show_security_evtchn(struct domain *d, const struct
     return NULL;
 }
 
-static XSM_INLINE int xsm_get_pod_target(struct domain *d)
+static XSM_INLINE int xsm_get_pod_target(XSM_DEFAULT_ARG struct domain *d)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_set_pod_target(struct domain *d)
+static XSM_INLINE int xsm_set_pod_target(XSM_DEFAULT_ARG struct domain *d)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_get_device_group(uint32_t machine_bdf)
+static XSM_INLINE int xsm_get_device_group(XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_test_assign_device(uint32_t machine_bdf)
+static XSM_INLINE int xsm_test_assign_device(XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_assign_device(XSM_DEFAULT_ARG struct domain *d, uint32_t machine_bdf)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
+static XSM_INLINE int xsm_deassign_device(XSM_DEFAULT_ARG struct domain *d, uint32_t machine_bdf)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_resource_plug_core(void)
+static XSM_INLINE int xsm_resource_plug_core(XSM_DEFAULT_VOID)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_resource_unplug_core(void)
+static XSM_INLINE int xsm_resource_unplug_core(XSM_DEFAULT_VOID)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_resource_plug_pci(uint32_t machine_bdf)
+static XSM_INLINE int xsm_resource_plug_pci(XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_resource_unplug_pci(uint32_t machine_bdf)
+static XSM_INLINE int xsm_resource_unplug_pci(XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_resource_setup_pci(uint32_t machine_bdf)
+static XSM_INLINE int xsm_resource_setup_pci(XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_resource_setup_gsi(int gsi)
+static XSM_INLINE int xsm_resource_setup_gsi(XSM_DEFAULT_ARG int gsi)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_resource_setup_misc(void)
+static XSM_INLINE int xsm_resource_setup_misc(XSM_DEFAULT_VOID)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_page_offline(uint32_t cmd)
+static XSM_INLINE int xsm_page_offline(XSM_DEFAULT_ARG uint32_t cmd)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_tmem_op(void)
+static XSM_INLINE int xsm_tmem_op(XSM_DEFAULT_VOID)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_tmem_control(void)
+static XSM_INLINE int xsm_tmem_control(XSM_DEFAULT_VOID)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
 static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
@@ -330,187 +393,179 @@ static XSM_INLINE char *xsm_show_irq_sid(int irq)
     return NULL;
 }
 
-static XSM_INLINE int xsm_map_domain_pirq(struct domain *d, int irq, void *data)
+static XSM_INLINE int xsm_map_domain_pirq(XSM_DEFAULT_ARG struct domain *d, int irq, void *data)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_unmap_domain_pirq(struct domain *d, int irq)
+static XSM_INLINE int xsm_unmap_domain_pirq(XSM_DEFAULT_ARG struct domain *d, int irq)
 {
-    if ( !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_irq_permission(struct domain *d, int pirq, uint8_t allow)
+static XSM_INLINE int xsm_irq_permission(XSM_DEFAULT_ARG struct domain *d, int pirq, uint8_t allow)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_iomem_permission(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_iomem_permission(XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_iomem_mapping(struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static XSM_INLINE int xsm_iomem_mapping(XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_pci_config_permission(struct domain *d, uint32_t machine_bdf,
+static XSM_INLINE int xsm_pci_config_permission(XSM_DEFAULT_ARG struct domain *d, uint32_t machine_bdf,
                                         uint16_t start, uint16_t end,
                                         uint8_t access)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
 #ifdef CONFIG_X86
-static XSM_INLINE int xsm_shadow_control(struct domain *d, uint32_t op)
+static XSM_INLINE int xsm_shadow_control(XSM_DEFAULT_ARG struct domain *d, uint32_t op)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
+static XSM_INLINE int xsm_hvm_param(XSM_DEFAULT_ARG struct domain *d, unsigned long op)
 {
-    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_hvm_set_pci_intx_level(struct domain *d)
+static XSM_INLINE int xsm_hvm_set_pci_intx_level(XSM_DEFAULT_ARG struct domain *d)
 {
-    if ( !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_DM_PRIV);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_hvm_set_isa_irq_level(struct domain *d)
+static XSM_INLINE int xsm_hvm_set_isa_irq_level(XSM_DEFAULT_ARG struct domain *d)
 {
-    if ( !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_DM_PRIV);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_hvm_set_pci_link_route(struct domain *d)
+static XSM_INLINE int xsm_hvm_set_pci_link_route(XSM_DEFAULT_ARG struct domain *d)
 {
-    if ( !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_DM_PRIV);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
+static XSM_INLINE int xsm_hvm_inject_msi(XSM_DEFAULT_ARG struct domain *d)
 {
-    if ( !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_DM_PRIV);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_mem_event_control(struct domain *d, int mode, int op)
+static XSM_INLINE int xsm_mem_event_control(XSM_DEFAULT_ARG struct domain *d, int mode, int op)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_mem_event_op(struct domain *d, int op)
+static XSM_INLINE int xsm_mem_event_op(XSM_DEFAULT_ARG struct domain *d, int op)
 {
-    if ( !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_mem_sharing_op(struct domain *d, struct domain *cd, int op)
+static XSM_INLINE int xsm_mem_sharing_op(XSM_DEFAULT_ARG struct domain *d, struct domain *cd, int op)
 {
-    if ( !IS_PRIV_FOR(current->domain, cd) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, current->domain, cd);
 }
 
-static XSM_INLINE int xsm_apic(struct domain *d, int cmd)
+static XSM_INLINE int xsm_apic(XSM_DEFAULT_ARG struct domain *d, int cmd)
 {
-    if ( !IS_PRIV(d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, d, NULL);
 }
 
-static XSM_INLINE int xsm_platform_op(uint32_t op)
+static XSM_INLINE int xsm_platform_op(XSM_DEFAULT_ARG uint32_t op)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_machine_memory_map(void)
+static XSM_INLINE int xsm_machine_memory_map(XSM_DEFAULT_VOID)
 {
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int xsm_domain_memory_map(struct domain *d)
+static XSM_INLINE int xsm_domain_memory_map(XSM_DEFAULT_ARG struct domain *d)
 {
-    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_mmu_update(struct domain *d, struct domain *t,
+static XSM_INLINE int xsm_mmu_update(XSM_DEFAULT_ARG struct domain *d, struct domain *t,
                                      struct domain *f, uint32_t flags)
 {
+    XSM_ASSERT_ACTION(XSM_TARGET);
     if ( t && d != t && !IS_PRIV_FOR(d, t) )
         return -EPERM;
-    if ( d != f && !IS_PRIV_FOR(d, f) )
-        return -EPERM;
-    return 0;
+    return xsm_default_action(action, d, f);
 }
 
-static XSM_INLINE int xsm_mmuext_op(struct domain *d, struct domain *f)
+static XSM_INLINE int xsm_mmuext_op(XSM_DEFAULT_ARG struct domain *d, struct domain *f)
 {
-    if ( d != f && !IS_PRIV_FOR(d, f) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d, f);
 }
 
-static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f, 
+static XSM_INLINE int xsm_update_va_mapping(XSM_DEFAULT_ARG struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
-    if ( d != f && !IS_PRIV_FOR(d, f) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d, f);
 }
 
-static XSM_INLINE int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_add_to_physmap(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
+static XSM_INLINE int xsm_remove_from_physmap(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
-    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
-        return -EPERM;
-    return 0;
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int xsm_bind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_bind_pt_irq(XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_unbind_pt_irq(struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static XSM_INLINE int xsm_unbind_pt_irq(XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_ioport_permission(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_ioport_permission(XSM_DEFAULT_ARG struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_ioport_mapping(struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static XSM_INLINE int xsm_ioport_mapping(XSM_DEFAULT_ARG struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
 #endif
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 105201e..ce5ede8 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -27,6 +27,18 @@ typedef u32 xsm_magic_t;
 #define XSM_MAGIC 0x00000000
 #endif
 
+/* These annotations are used by callers and in dummy.h to document the
+ * default actions of XSM hooks. They should be compiled out otherwise.
+ */
+enum xsm_default {
+    XSM_HOOK,     /* Guests can normally access the hypercall */
+    XSM_DM_PRIV,  /* Device model can perform on its target domain */
+    XSM_TARGET,   /* Can perform on self or your target domain */
+    XSM_PRIV,     /* Privileged - normally restricted to dom0 */
+    XSM_OTHER     /* Something more complex */
+};
+typedef enum xsm_default xsm_default_t;
+
 extern char *policy_buffer;
 extern u32 policy_size;
 
@@ -155,48 +167,48 @@ static inline void xsm_security_domaininfo (struct domain *d,
     xsm_ops->security_domaininfo(d, info);
 }
 
-static inline int xsm_domain_create (struct domain *d, u32 ssidref)
+static inline int xsm_domain_create (xsm_default_t def, struct domain *d, u32 ssidref)
 {
     return xsm_ops->domain_create(d, ssidref);
 }
 
-static inline int xsm_getdomaininfo (struct domain *d)
+static inline int xsm_getdomaininfo (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->getdomaininfo(d);
 }
 
-static inline int xsm_set_target (struct domain *d, struct domain *e)
+static inline int xsm_set_target (xsm_default_t def, struct domain *d, struct domain *e)
 {
     return xsm_ops->set_target(d, e);
 }
 
-static inline int xsm_domctl (struct domain *d, int cmd)
+static inline int xsm_domctl (xsm_default_t def, struct domain *d, int cmd)
 {
     return xsm_ops->domctl(d, cmd);
 }
 
-static inline int xsm_sysctl (int cmd)
+static inline int xsm_sysctl (xsm_default_t def, int cmd)
 {
     return xsm_ops->sysctl(cmd);
 }
 
-static inline int xsm_readconsole (uint32_t clear)
+static inline int xsm_readconsole (xsm_default_t def, uint32_t clear)
 {
     return xsm_ops->readconsole(clear);
 }
 
-static inline int xsm_do_mca(void)
+static inline int xsm_do_mca(xsm_default_t def)
 {
     return xsm_ops->do_mca();
 }
 
-static inline int xsm_evtchn_unbound (struct domain *d1, struct evtchn *chn,
+static inline int xsm_evtchn_unbound (xsm_default_t def, struct domain *d1, struct evtchn *chn,
                                                                     domid_t id2)
 {
     return xsm_ops->evtchn_unbound(d1, chn, id2);
 }
 
-static inline int xsm_evtchn_interdomain (struct domain *d1, 
+static inline int xsm_evtchn_interdomain (xsm_default_t def, struct domain *d1,
                 struct evtchn *chan1, struct domain *d2, struct evtchn *chan2)
 {
     return xsm_ops->evtchn_interdomain(d1, chan1, d2, chan2);
@@ -207,48 +219,48 @@ static inline void xsm_evtchn_close_post (struct evtchn *chn)
     xsm_ops->evtchn_close_post(chn);
 }
 
-static inline int xsm_evtchn_send (struct domain *d, struct evtchn *chn)
+static inline int xsm_evtchn_send (xsm_default_t def, struct domain *d, struct evtchn *chn)
 {
     return xsm_ops->evtchn_send(d, chn);
 }
 
-static inline int xsm_evtchn_status (struct domain *d, struct evtchn *chn)
+static inline int xsm_evtchn_status (xsm_default_t def, struct domain *d, struct evtchn *chn)
 {
     return xsm_ops->evtchn_status(d, chn);
 }
 
-static inline int xsm_evtchn_reset (struct domain *d1, struct domain *d2)
+static inline int xsm_evtchn_reset (xsm_default_t def, struct domain *d1, struct domain *d2)
 {
     return xsm_ops->evtchn_reset(d1, d2);
 }
 
-static inline int xsm_grant_mapref (struct domain *d1, struct domain *d2,
+static inline int xsm_grant_mapref (xsm_default_t def, struct domain *d1, struct domain *d2,
                                                                 uint32_t flags)
 {
     return xsm_ops->grant_mapref(d1, d2, flags);
 }
 
-static inline int xsm_grant_unmapref (struct domain *d1, struct domain *d2)
+static inline int xsm_grant_unmapref (xsm_default_t def, struct domain *d1, struct domain *d2)
 {
     return xsm_ops->grant_unmapref(d1, d2);
 }
 
-static inline int xsm_grant_setup (struct domain *d1, struct domain *d2)
+static inline int xsm_grant_setup (xsm_default_t def, struct domain *d1, struct domain *d2)
 {
     return xsm_ops->grant_setup(d1, d2);
 }
 
-static inline int xsm_grant_transfer (struct domain *d1, struct domain *d2)
+static inline int xsm_grant_transfer (xsm_default_t def, struct domain *d1, struct domain *d2)
 {
     return xsm_ops->grant_transfer(d1, d2);
 }
 
-static inline int xsm_grant_copy (struct domain *d1, struct domain *d2)
+static inline int xsm_grant_copy (xsm_default_t def, struct domain *d1, struct domain *d2)
 {
     return xsm_ops->grant_copy(d1, d2);
 }
 
-static inline int xsm_grant_query_size (struct domain *d1, struct domain *d2)
+static inline int xsm_grant_query_size (xsm_default_t def, struct domain *d1, struct domain *d2)
 {
     return xsm_ops->grant_query_size(d1, d2);
 }
@@ -278,60 +290,60 @@ static inline char *xsm_show_security_evtchn (struct domain *d, const struct evt
     return xsm_ops->show_security_evtchn(d, chn);
 }
 
-static inline int xsm_get_pod_target (struct domain *d)
+static inline int xsm_get_pod_target (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->get_pod_target(d);
 }
 
-static inline int xsm_set_pod_target (struct domain *d)
+static inline int xsm_set_pod_target (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->set_pod_target(d);
 }
 
-static inline int xsm_memory_exchange (struct domain *d)
+static inline int xsm_memory_exchange (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->memory_exchange(d);
 }
 
-static inline int xsm_memory_adjust_reservation (struct domain *d1, struct
+static inline int xsm_memory_adjust_reservation (xsm_default_t def, struct domain *d1, struct
                                                                     domain *d2)
 {
     return xsm_ops->memory_adjust_reservation(d1, d2);
 }
 
-static inline int xsm_memory_stat_reservation (struct domain *d1,
+static inline int xsm_memory_stat_reservation (xsm_default_t def, struct domain *d1,
                                                             struct domain *d2)
 {
     return xsm_ops->memory_stat_reservation(d1, d2);
 }
 
-static inline int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
+static inline int xsm_memory_pin_page(xsm_default_t def, struct domain *d1, struct domain *d2,
                                       struct page_info *page)
 {
     return xsm_ops->memory_pin_page(d1, d2, page);
 }
 
-static inline int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
+static inline int xsm_remove_from_physmap(xsm_default_t def, struct domain *d1, struct domain *d2)
 {
     return xsm_ops->remove_from_physmap(d1, d2);
 }
 
-static inline int xsm_console_io (struct domain *d, int cmd)
+static inline int xsm_console_io (xsm_default_t def, struct domain *d, int cmd)
 {
     return xsm_ops->console_io(d, cmd);
 }
 
-static inline int xsm_profile (struct domain *d, int op)
+static inline int xsm_profile (xsm_default_t def, struct domain *d, int op)
 {
     return xsm_ops->profile(d, op);
 }
 
-static inline int xsm_kexec (void)
+static inline int xsm_kexec (xsm_default_t def)
 {
     return xsm_ops->kexec();
 }
 
-static inline int xsm_schedop_shutdown (struct domain *d1, struct domain *d2)
+static inline int xsm_schedop_shutdown (xsm_default_t def, struct domain *d1, struct domain *d2)
 {
     return xsm_ops->schedop_shutdown(d1, d2);
 }
@@ -341,102 +353,102 @@ static inline char *xsm_show_irq_sid (int irq)
     return xsm_ops->show_irq_sid(irq);
 }
 
-static inline int xsm_map_domain_pirq (struct domain *d, int irq, void *data)
+static inline int xsm_map_domain_pirq (xsm_default_t def, struct domain *d, int irq, void *data)
 {
     return xsm_ops->map_domain_pirq(d, irq, data);
 }
 
-static inline int xsm_unmap_domain_pirq (struct domain *d, int irq)
+static inline int xsm_unmap_domain_pirq (xsm_default_t def, struct domain *d, int irq)
 {
     return xsm_ops->unmap_domain_pirq(d, irq);
 }
 
-static inline int xsm_irq_permission (struct domain *d, int pirq, uint8_t allow)
+static inline int xsm_irq_permission (xsm_default_t def, struct domain *d, int pirq, uint8_t allow)
 {
     return xsm_ops->irq_permission(d, pirq, allow);
 }
 
-static inline int xsm_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static inline int xsm_iomem_permission (xsm_default_t def, struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return xsm_ops->iomem_permission(d, s, e, allow);
 }
 
-static inline int xsm_iomem_mapping (struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static inline int xsm_iomem_mapping (xsm_default_t def, struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     return xsm_ops->iomem_mapping(d, s, e, allow);
 }
 
-static inline int xsm_pci_config_permission (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
+static inline int xsm_pci_config_permission (xsm_default_t def, struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access)
 {
     return xsm_ops->pci_config_permission(d, machine_bdf, start, end, access);
 }
 
-static inline int xsm_get_device_group(uint32_t machine_bdf)
+static inline int xsm_get_device_group(xsm_default_t def, uint32_t machine_bdf)
 {
     return xsm_ops->get_device_group(machine_bdf);
 }
 
-static inline int xsm_test_assign_device(uint32_t machine_bdf)
+static inline int xsm_test_assign_device(xsm_default_t def, uint32_t machine_bdf)
 {
     return xsm_ops->test_assign_device(machine_bdf);
 }
 
-static inline int xsm_assign_device(struct domain *d, uint32_t machine_bdf)
+static inline int xsm_assign_device(xsm_default_t def, struct domain *d, uint32_t machine_bdf)
 {
     return xsm_ops->assign_device(d, machine_bdf);
 }
 
-static inline int xsm_deassign_device(struct domain *d, uint32_t machine_bdf)
+static inline int xsm_deassign_device(xsm_default_t def, struct domain *d, uint32_t machine_bdf)
 {
     return xsm_ops->deassign_device(d, machine_bdf);
 }
 
-static inline int xsm_resource_plug_pci (uint32_t machine_bdf)
+static inline int xsm_resource_plug_pci (xsm_default_t def, uint32_t machine_bdf)
 {
     return xsm_ops->resource_plug_pci(machine_bdf);
 }
 
-static inline int xsm_resource_unplug_pci (uint32_t machine_bdf)
+static inline int xsm_resource_unplug_pci (xsm_default_t def, uint32_t machine_bdf)
 {
     return xsm_ops->resource_unplug_pci(machine_bdf);
 }
 
-static inline int xsm_resource_plug_core (void)
+static inline int xsm_resource_plug_core (xsm_default_t def)
 {
     return xsm_ops->resource_plug_core();
 }
 
-static inline int xsm_resource_unplug_core (void)
+static inline int xsm_resource_unplug_core (xsm_default_t def)
 {
     return xsm_ops->resource_unplug_core();
 }
 
-static inline int xsm_resource_setup_pci (uint32_t machine_bdf)
+static inline int xsm_resource_setup_pci (xsm_default_t def, uint32_t machine_bdf)
 {
     return xsm_ops->resource_setup_pci(machine_bdf);
 }
 
-static inline int xsm_resource_setup_gsi (int gsi)
+static inline int xsm_resource_setup_gsi (xsm_default_t def, int gsi)
 {
     return xsm_ops->resource_setup_gsi(gsi);
 }
 
-static inline int xsm_resource_setup_misc (void)
+static inline int xsm_resource_setup_misc (xsm_default_t def)
 {
     return xsm_ops->resource_setup_misc();
 }
 
-static inline int xsm_page_offline(uint32_t cmd)
+static inline int xsm_page_offline(xsm_default_t def, uint32_t cmd)
 {
     return xsm_ops->page_offline(cmd);
 }
 
-static inline int xsm_tmem_op(void)
+static inline int xsm_tmem_op(xsm_default_t def)
 {
     return xsm_ops->tmem_op();
 }
 
-static inline int xsm_tmem_control(void)
+static inline int xsm_tmem_control(xsm_default_t def)
 {
     return xsm_ops->tmem_control();
 }
@@ -447,116 +459,116 @@ static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 }
 
 #ifdef CONFIG_X86
-static inline int xsm_shadow_control (struct domain *d, uint32_t op)
+static inline int xsm_shadow_control (xsm_default_t def, struct domain *d, uint32_t op)
 {
     return xsm_ops->shadow_control(d, op);
 }
 
-static inline int xsm_hvm_param (struct domain *d, unsigned long op)
+static inline int xsm_hvm_param (xsm_default_t def, struct domain *d, unsigned long op)
 {
     return xsm_ops->hvm_param(d, op);
 }
 
-static inline int xsm_hvm_set_pci_intx_level (struct domain *d)
+static inline int xsm_hvm_set_pci_intx_level (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->hvm_set_pci_intx_level(d);
 }
 
-static inline int xsm_hvm_set_isa_irq_level (struct domain *d)
+static inline int xsm_hvm_set_isa_irq_level (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->hvm_set_isa_irq_level(d);
 }
 
-static inline int xsm_hvm_set_pci_link_route (struct domain *d)
+static inline int xsm_hvm_set_pci_link_route (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->hvm_set_pci_link_route(d);
 }
 
-static inline int xsm_hvm_inject_msi (struct domain *d)
+static inline int xsm_hvm_inject_msi (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->hvm_inject_msi(d);
 }
 
-static inline int xsm_mem_event_control (struct domain *d, int mode, int op)
+static inline int xsm_mem_event_control (xsm_default_t def, struct domain *d, int mode, int op)
 {
     return xsm_ops->mem_event_control(d, mode, op);
 }
 
-static inline int xsm_mem_event_op (struct domain *d, int op)
+static inline int xsm_mem_event_op (xsm_default_t def, struct domain *d, int op)
 {
     return xsm_ops->mem_event_op(d, op);
 }
 
-static inline int xsm_mem_sharing_op (struct domain *d, struct domain *cd, int op)
+static inline int xsm_mem_sharing_op (xsm_default_t def, struct domain *d, struct domain *cd, int op)
 {
     return xsm_ops->mem_sharing_op(d, cd, op);
 }
 
-static inline int xsm_apic (struct domain *d, int cmd)
+static inline int xsm_apic (xsm_default_t def, struct domain *d, int cmd)
 {
     return xsm_ops->apic(d, cmd);
 }
 
-static inline int xsm_memtype (uint32_t access)
+static inline int xsm_memtype (xsm_default_t def, uint32_t access)
 {
     return xsm_ops->memtype(access);
 }
 
-static inline int xsm_platform_op (uint32_t op)
+static inline int xsm_platform_op (xsm_default_t def, uint32_t op)
 {
     return xsm_ops->platform_op(op);
 }
 
-static inline int xsm_machine_memory_map(void)
+static inline int xsm_machine_memory_map(xsm_default_t def)
 {
     return xsm_ops->machine_memory_map();
 }
 
-static inline int xsm_domain_memory_map(struct domain *d)
+static inline int xsm_domain_memory_map(xsm_default_t def, struct domain *d)
 {
     return xsm_ops->domain_memory_map(d);
 }
 
-static inline int xsm_mmu_update (struct domain *d, struct domain *t,
+static inline int xsm_mmu_update (xsm_default_t def, struct domain *d, struct domain *t,
                                   struct domain *f, uint32_t flags)
 {
     return xsm_ops->mmu_update(d, t, f, flags);
 }
 
-static inline int xsm_mmuext_op (struct domain *d, struct domain *f)
+static inline int xsm_mmuext_op (xsm_default_t def, struct domain *d, struct domain *f)
 {
     return xsm_ops->mmuext_op(d, f);
 }
 
-static inline int xsm_update_va_mapping(struct domain *d, struct domain *f, 
+static inline int xsm_update_va_mapping(xsm_default_t def, struct domain *d, struct domain *f,
                                                             l1_pgentry_t pte)
 {
     return xsm_ops->update_va_mapping(d, f, pte);
 }
 
-static inline int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
+static inline int xsm_add_to_physmap(xsm_default_t def, struct domain *d1, struct domain *d2)
 {
     return xsm_ops->add_to_physmap(d1, d2);
 }
 
-static inline int xsm_bind_pt_irq(struct domain *d, 
+static inline int xsm_bind_pt_irq(xsm_default_t def, struct domain *d,
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
     return xsm_ops->bind_pt_irq(d, bind);
 }
 
-static inline int xsm_unbind_pt_irq(struct domain *d,
+static inline int xsm_unbind_pt_irq(xsm_default_t def, struct domain *d,
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
     return xsm_ops->unbind_pt_irq(d, bind);
 }
 
-static inline int xsm_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static inline int xsm_ioport_permission (xsm_default_t def, struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return xsm_ops->ioport_permission(d, s, e, allow);
 }
 
-static inline int xsm_ioport_mapping (struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static inline int xsm_ioport_mapping (xsm_default_t def, struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     return xsm_ops->ioport_mapping(d, s, e, allow);
 }
@@ -576,7 +588,6 @@ extern void xsm_fixup_ops(struct xsm_operations *ops);
 
 #else /* XSM_ENABLE */
 
-#define XSM_INLINE inline
 #include <xsm/dummy.h>
 
 static inline int xsm_init (unsigned long *module_map,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSew-0002WA-5R; Fri, 30 Nov 2012 15:37:46 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSer-0002QY-BB
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:41 +0000
Received: from [193.109.254.147:14611] by server-3.bemta-14.messagelabs.com id
	6A/64-01317-4C2D8B05; Fri, 30 Nov 2012 15:37:40 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-9.tower-27.messagelabs.com!1354289855!8908070!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5532 invoked from network); 30 Nov 2012 15:37:35 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-9.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:35 -0000
X-TM-IMSS-Message-ID: <d0a0ee80000589c7@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0ee80000589c7 ;
	Fri, 30 Nov 2012 10:37:39 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd8017785; 
	Fri, 30 Nov 2012 10:37:33 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:02 -0500
Message-Id: <1354289830-24642-16-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>, Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Tim Deegan <tim@xen.org>
Subject: [Xen-devel] [PATCH 15/23] arch/x86: use XSM hooks for get_pg_owner
	access checks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

There are three callers of get_pg_owner:
 * do_mmuext_op, which does not have XSM hooks on all subfunctions
 * do_mmu_update, which has hooks that are inefficient
 * do_update_va_mapping_otherdomain, which has a simple XSM hook

In order to preserve return values for the do_mmuext_op hypercall, an
additional XSM hook is required to check the operation even for those
subfunctions that do not use the pg_owner field. This also covers the
MMUEXT_UNPIN_TABLE operation which did previously have an XSM hook.

The XSM hooks in do_mmu_update were capable of replacing the checks in
get_pg_owner; however, the hooks are buried in the inner loop of the
function - not very good for performance when XSM is enabled and these
turn in to indirect function calls. This patch removes the PTE from the
hooks and replaces it with a bitfield describing what accesses are being
requested. The XSM hook can then be called only when additional bits are
set instead of once per iteration of the loop.

This patch results in a change in the FLASK permissions used for mapping
an MMIO page: the target for the permisison check on the memory mapping
is no longer resolved to the device-specific type, and is instead either
the domain's own type or domio_t (depending on if the domain uses
DOMID_SELF or DOMID_IO in the map command). Device-specific access is
still controlled via the "resource use" permisison checked at domain
creation (or device hotplug).

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
Cc: Tim Deegan <tim@xen.org>
Cc: Keir Fraser <keir@xen.org>
---
 tools/flask/policy/policy/flask/access_vectors |  1 +
 tools/flask/policy/policy/modules/xen/xen.if   |  6 +--
 tools/flask/policy/policy/modules/xen/xen.te   |  5 +-
 xen/arch/x86/mm.c                              | 53 +++++++++++--------
 xen/include/xsm/dummy.h                        | 15 ++++--
 xen/include/xsm/xsm.h                          | 25 +++++----
 xen/xsm/dummy.c                                |  4 +-
 xen/xsm/flask/hooks.c                          | 71 +++++++++-----------------
 xen/xsm/flask/include/av_perm_to_string.h      |  1 +
 xen/xsm/flask/include/av_permissions.h         |  1 +
 10 files changed, 91 insertions(+), 91 deletions(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index 45ac437..8324725 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -141,6 +141,7 @@ class mmu
     mfnlist
     memorymap
     remote_remap
+	mmuext_op
 }
 
 class shadow
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index d630f47..fda5cb5 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -7,7 +7,7 @@
 ################################################################################
 define(`declare_domain_common', `
 	allow $1 $2:grant { query setup };
-	allow $1 $2:mmu { adjust physmap map_read map_write stat pinpage updatemp };
+	allow $1 $2:mmu { adjust physmap map_read map_write stat pinpage updatemp mmuext_op };
 	allow $1 $2:hvm { getparam setparam };
 ')
 
@@ -51,7 +51,7 @@ define(`create_domain_common', `
 	allow $1 $2:domain2 { set_cpuid settsc };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
-	allow $1 $2:mmu {map_read map_write adjust memorymap physmap pinpage};
+	allow $1 $2:mmu { map_read map_write adjust memorymap physmap pinpage mmuext_op };
 	allow $1 $2:grant setup;
 	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc setparam pcilevel trackdirtyvram };
 ')
@@ -162,7 +162,7 @@ define(`make_device_model', `
 #   Allow a device to be used by a domain
 define(`use_device', `
     allow $1 $2:resource use;
-    allow $1 $2:mmu { map_read map_write };
+    allow $1 domio_t:mmu { map_read map_write };
 ')
 
 # admin_device(domain, device)
diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
index 8d33285..8c77e6b 100644
--- a/tools/flask/policy/policy/modules/xen/xen.te
+++ b/tools/flask/policy/policy/modules/xen/xen.te
@@ -29,10 +29,10 @@ type xen_t, xen_type, mls_priv;
 # Domain 0
 declare_singleton_domain(dom0_t, mls_priv);
 
-# Untracked I/O memory (pseudo-domain)
+# I/O memory (DOMID_IO pseudo-domain)
 type domio_t, xen_type;
 
-# Xen heap (pseudo-domain)
+# Xen heap (DOMID_XEN pseudo-domain)
 type domxen_t, xen_type;
 
 # Unlabeled objects
@@ -69,7 +69,6 @@ admin_device(dom0_t, device_t)
 admin_device(dom0_t, irq_t)
 admin_device(dom0_t, ioport_t)
 admin_device(dom0_t, iomem_t)
-allow dom0_t domio_t:mmu { map_read map_write };
 
 domain_comms(dom0_t, dom0_t)
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 8915848..9a2acca 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2621,11 +2621,6 @@ static struct domain *get_pg_owner(domid_t domid)
         pg_owner = rcu_lock_domain(dom_io);
         break;
     case DOMID_XEN:
-        if ( !IS_PRIV(curr) )
-        {
-            MEM_LOG("Cannot set foreign dom");
-            break;
-        }
         pg_owner = rcu_lock_domain(dom_xen);
         break;
     default:
@@ -2634,12 +2629,6 @@ static struct domain *get_pg_owner(domid_t domid)
             MEM_LOG("Unknown domain '%u'", domid);
             break;
         }
-        if ( !IS_PRIV_FOR(curr, pg_owner) )
-        {
-            MEM_LOG("Cannot set foreign dom");
-            rcu_unlock_domain(pg_owner);
-            pg_owner = NULL;
-        }
         break;
     }
 
@@ -2727,6 +2716,13 @@ long do_mmuext_op(
         goto out;
     }
 
+    rc = xsm_mmuext_op(d, pg_owner);
+    if ( rc )
+    {
+        rcu_unlock_domain(pg_owner);
+        goto out;
+    }
+
     for ( i = 0; i < count; i++ )
     {
         if ( hypercall_preempt_check() )
@@ -3168,6 +3164,8 @@ long do_mmu_update(
     struct vcpu *v = current;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     struct domain_mmap_cache mapcache;
+    uint32_t xsm_needed = 0;
+    uint32_t xsm_checked = 0;
 
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
@@ -3199,11 +3197,6 @@ long do_mmu_update(
             rc = -EINVAL;
             goto out;
         }
-        if ( !IS_PRIV_FOR(d, pt_owner) )
-        {
-            rc = -ESRCH;
-            goto out;
-        }
     }
 
     if ( (pg_owner = get_pg_owner((uint16_t)foreigndom)) == NULL )
@@ -3243,9 +3236,20 @@ long do_mmu_update(
         {
             p2m_type_t p2mt;
 
-            rc = xsm_mmu_normal_update(d, pt_owner, pg_owner, req.val);
-            if ( rc )
-                break;
+            xsm_needed |= XSM_MMU_NORMAL_UPDATE;
+            if ( get_pte_flags(req.val) & _PAGE_PRESENT )
+            {
+                xsm_needed |= XSM_MMU_UPDATE_READ;
+                if ( get_pte_flags(req.val) & _PAGE_RW )
+                    xsm_needed |= XSM_MMU_UPDATE_WRITE;
+            }
+            if ( xsm_needed != xsm_checked )
+            {
+                rc = xsm_mmu_update(d, pt_owner, pg_owner, xsm_needed);
+                if ( rc )
+                    break;
+                xsm_checked = xsm_needed;
+            }
             rc = -EINVAL;
 
             req.ptr -= cmd;
@@ -3357,9 +3361,14 @@ long do_mmu_update(
             mfn = req.ptr >> PAGE_SHIFT;
             gpfn = req.val;
 
-            rc = xsm_mmu_machphys_update(d, pg_owner, mfn);
-            if ( rc )
-                break;
+            xsm_needed |= XSM_MMU_MACHPHYS_UPDATE;
+            if ( xsm_needed != xsm_checked )
+            {
+                rc = xsm_mmu_update(d, NULL, pg_owner, xsm_needed);
+                if ( rc )
+                    break;
+                xsm_checked = xsm_needed;
+            }
 
             if ( unlikely(!get_page_from_pagenr(mfn, pg_owner)) )
             {
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 42b2285..6648739 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -662,21 +662,28 @@ static XSM_INLINE int xsm_domain_memory_map(struct domain *d)
     return 0;
 }
 
-static XSM_INLINE int xsm_mmu_normal_update(struct domain *d, struct domain *t,
-                                            struct domain *f, intpte_t fpte)
+static XSM_INLINE int xsm_mmu_update(struct domain *d, struct domain *t,
+                                     struct domain *f, uint32_t flags)
 {
+    if ( t && d != t && !IS_PRIV_FOR(d, t) )
+        return -EPERM;
+    if ( d != f && !IS_PRIV_FOR(d, f) )
+        return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_mmu_machphys_update(struct domain *d, struct domain *f,
-                                              unsigned long mfn)
+static XSM_INLINE int xsm_mmuext_op(struct domain *d, struct domain *f)
 {
+    if ( d != f && !IS_PRIV_FOR(d, f) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
+    if ( d != f && !IS_PRIV_FOR(d, f) )
+        return -EPERM;
     return 0;
 }
 
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 88aa95a..d41eb54 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -27,8 +27,6 @@ typedef u32 xsm_magic_t;
 #define XSM_MAGIC 0x00000000
 #endif
 
-#ifdef XSM_ENABLE
-
 extern char *policy_buffer;
 extern u32 policy_size;
 
@@ -170,9 +168,13 @@ struct xsm_operations {
     int (*getidletime) (void);
     int (*machine_memory_map) (void);
     int (*domain_memory_map) (struct domain *d);
-    int (*mmu_normal_update) (struct domain *d, struct domain *t,
-                              struct domain *f, intpte_t fpte);
-    int (*mmu_machphys_update) (struct domain *d1, struct domain *d2, unsigned long mfn);
+#define XSM_MMU_UPDATE_READ      1
+#define XSM_MMU_UPDATE_WRITE     2
+#define XSM_MMU_NORMAL_UPDATE    4
+#define XSM_MMU_MACHPHYS_UPDATE  8
+    int (*mmu_update) (struct domain *d, struct domain *t,
+                       struct domain *f, uint32_t flags);
+    int (*mmuext_op) (struct domain *d, struct domain *f);
     int (*update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
     int (*sendtrigger) (struct domain *d);
@@ -186,6 +188,8 @@ struct xsm_operations {
 #endif
 };
 
+#ifdef XSM_ENABLE
+
 extern struct xsm_operations *xsm_ops;
 
 #ifndef XSM_NO_WRAPPERS
@@ -763,16 +767,15 @@ static inline int xsm_domain_memory_map(struct domain *d)
     return xsm_ops->domain_memory_map(d);
 }
 
-static inline int xsm_mmu_normal_update (struct domain *d, struct domain *t,
-                                         struct domain *f, intpte_t fpte)
+static inline int xsm_mmu_update (struct domain *d, struct domain *t,
+                                  struct domain *f, uint32_t flags)
 {
-    return xsm_ops->mmu_normal_update(d, t, f, fpte);
+    return xsm_ops->mmu_update(d, t, f, flags);
 }
 
-static inline int xsm_mmu_machphys_update (struct domain *d1, struct domain *d2,
-                                           unsigned long mfn)
+static inline int xsm_mmuext_op (struct domain *d, struct domain *f)
 {
-    return xsm_ops->mmu_machphys_update(d1, d2, mfn);
+    return xsm_ops->mmuext_op(d, f);
 }
 
 static inline int xsm_update_va_mapping(struct domain *d, struct domain *f, 
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index bc9d30f..200cbc8 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -155,8 +155,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, getidletime);
     set_to_dummy_if_null(ops, machine_memory_map);
     set_to_dummy_if_null(ops, domain_memory_map);
-    set_to_dummy_if_null(ops, mmu_normal_update);
-    set_to_dummy_if_null(ops, mmu_machphys_update);
+    set_to_dummy_if_null(ops, mmu_update);
+    set_to_dummy_if_null(ops, mmuext_op);
     set_to_dummy_if_null(ops, update_va_mapping);
     set_to_dummy_if_null(ops, add_to_physmap);
     set_to_dummy_if_null(ops, remove_from_physmap);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 99d3e21..b2f00d8 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1434,65 +1434,44 @@ static int flask_domain_memory_map(struct domain *d)
     return current_has_perm(d, SECCLASS_MMU, MMU__MEMORYMAP);
 }
 
-static int domain_memory_perm(struct domain *d, struct domain *f, l1_pgentry_t pte)
+static int flask_mmu_update(struct domain *d, struct domain *t,
+                            struct domain *f, uint32_t flags)
 {
     int rc = 0;
-    u32 map_perms = MMU__MAP_READ;
-    unsigned long fgfn, fmfn;
-    p2m_type_t p2mt;
-
-    if ( !(l1e_get_flags(pte) & _PAGE_PRESENT) )
-        return 0;
-
-    if ( l1e_get_flags(pte) & _PAGE_RW )
-        map_perms |= MMU__MAP_WRITE;
-
-    fgfn = l1e_get_pfn(pte);
-    fmfn = mfn_x(get_gfn_query(f, fgfn, &p2mt));
-    put_gfn(f, fgfn);
+    u32 map_perms = 0;
 
-    if ( f->domain_id == DOMID_IO || !mfn_valid(fmfn) )
-    {
-        struct avc_audit_data ad;
-        u32 dsid, fsid;
-        rc = security_iomem_sid(fmfn, &fsid);
-        if ( rc )
-            return rc;
-        AVC_AUDIT_DATA_INIT(&ad, MEMORY);
-        ad.sdom = d;
-        ad.tdom = f;
-        ad.memory.pte = pte.l1;
-        ad.memory.mfn = fmfn;
-        dsid = domain_sid(d);
-        return avc_has_perm(dsid, fsid, SECCLASS_MMU, map_perms, &ad);
-    }
-
-    return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
-}
-
-static int flask_mmu_normal_update(struct domain *d, struct domain *t,
-                                   struct domain *f, intpte_t fpte)
-{
-    int rc = 0;
-
-    if (d != t)
+    if ( t && d != t )
         rc = domain_has_perm(d, t, SECCLASS_MMU, MMU__REMOTE_REMAP);
     if ( rc )
         return rc;
 
-    return domain_memory_perm(d, f, l1e_from_intpte(fpte));
+    if ( flags & XSM_MMU_UPDATE_READ )
+        map_perms |= MMU__MAP_READ;
+    if ( flags & XSM_MMU_UPDATE_WRITE )
+        map_perms |= MMU__MAP_WRITE;
+    if ( flags & XSM_MMU_MACHPHYS_UPDATE )
+        map_perms |= MMU__UPDATEMP;
+
+    if ( map_perms )
+        rc = domain_has_perm(d, f, SECCLASS_MMU, map_perms);
+    return rc;
 }
 
-static int flask_mmu_machphys_update(struct domain *d1, struct domain *d2,
-                                     unsigned long mfn)
+static int flask_mmuext_op(struct domain *d, struct domain *f)
 {
-    return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__UPDATEMP);
+    return domain_has_perm(d, f, SECCLASS_MMU, MMU__MMUEXT_OP);
 }
 
 static int flask_update_va_mapping(struct domain *d, struct domain *f,
                                    l1_pgentry_t pte)
 {
-    return domain_memory_perm(d, f, pte);
+    u32 map_perms = MMU__MAP_READ;
+    if ( !(l1e_get_flags(pte) & _PAGE_PRESENT) )
+        return 0;
+    if ( l1e_get_flags(pte) & _PAGE_RW )
+        map_perms |= MMU__MAP_WRITE;
+
+    return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
 }
 
 static int flask_add_to_physmap(struct domain *d1, struct domain *d2)
@@ -1773,8 +1752,8 @@ static struct xsm_operations flask_ops = {
     .getidletime = flask_getidletime,
     .machine_memory_map = flask_machine_memory_map,
     .domain_memory_map = flask_domain_memory_map,
-    .mmu_normal_update = flask_mmu_normal_update,
-    .mmu_machphys_update = flask_mmu_machphys_update,
+    .mmu_update = flask_mmu_update,
+    .mmuext_op = flask_mmuext_op,
     .update_va_mapping = flask_update_va_mapping,
     .add_to_physmap = flask_add_to_physmap,
     .remove_from_physmap = flask_remove_from_physmap,
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 186f1fa..8f65b96 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -111,6 +111,7 @@
    S_(SECCLASS_MMU, MMU__MFNLIST, "mfnlist")
    S_(SECCLASS_MMU, MMU__MEMORYMAP, "memorymap")
    S_(SECCLASS_MMU, MMU__REMOTE_REMAP, "remote_remap")
+   S_(SECCLASS_MMU, MMU__MMUEXT_OP, "mmuext_op")
    S_(SECCLASS_SHADOW, SHADOW__DISABLE, "disable")
    S_(SECCLASS_SHADOW, SHADOW__ENABLE, "enable")
    S_(SECCLASS_SHADOW, SHADOW__LOGDIRTY, "logdirty")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index b3831f6..18454fd 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -117,6 +117,7 @@
 #define MMU__MFNLIST                              0x00000400UL
 #define MMU__MEMORYMAP                            0x00000800UL
 #define MMU__REMOTE_REMAP                         0x00001000UL
+#define MMU__MMUEXT_OP                            0x00002000UL
 
 #define SHADOW__DISABLE                           0x00000001UL
 #define SHADOW__ENABLE                            0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:37:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:37:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSew-0002WA-5R; Fri, 30 Nov 2012 15:37:46 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSer-0002QY-BB
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:41 +0000
Received: from [193.109.254.147:14611] by server-3.bemta-14.messagelabs.com id
	6A/64-01317-4C2D8B05; Fri, 30 Nov 2012 15:37:40 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-9.tower-27.messagelabs.com!1354289855!8908070!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5532 invoked from network); 30 Nov 2012 15:37:35 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-9.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:35 -0000
X-TM-IMSS-Message-ID: <d0a0ee80000589c7@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0ee80000589c7 ;
	Fri, 30 Nov 2012 10:37:39 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd8017785; 
	Fri, 30 Nov 2012 10:37:33 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:37:02 -0500
Message-Id: <1354289830-24642-16-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>, Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Tim Deegan <tim@xen.org>
Subject: [Xen-devel] [PATCH 15/23] arch/x86: use XSM hooks for get_pg_owner
	access checks
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

There are three callers of get_pg_owner:
 * do_mmuext_op, which does not have XSM hooks on all subfunctions
 * do_mmu_update, which has hooks that are inefficient
 * do_update_va_mapping_otherdomain, which has a simple XSM hook

In order to preserve return values for the do_mmuext_op hypercall, an
additional XSM hook is required to check the operation even for those
subfunctions that do not use the pg_owner field. This also covers the
MMUEXT_UNPIN_TABLE operation which did previously have an XSM hook.

The XSM hooks in do_mmu_update were capable of replacing the checks in
get_pg_owner; however, the hooks are buried in the inner loop of the
function - not very good for performance when XSM is enabled and these
turn in to indirect function calls. This patch removes the PTE from the
hooks and replaces it with a bitfield describing what accesses are being
requested. The XSM hook can then be called only when additional bits are
set instead of once per iteration of the loop.

This patch results in a change in the FLASK permissions used for mapping
an MMIO page: the target for the permisison check on the memory mapping
is no longer resolved to the device-specific type, and is instead either
the domain's own type or domio_t (depending on if the domain uses
DOMID_SELF or DOMID_IO in the map command). Device-specific access is
still controlled via the "resource use" permisison checked at domain
creation (or device hotplug).

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
Cc: Tim Deegan <tim@xen.org>
Cc: Keir Fraser <keir@xen.org>
---
 tools/flask/policy/policy/flask/access_vectors |  1 +
 tools/flask/policy/policy/modules/xen/xen.if   |  6 +--
 tools/flask/policy/policy/modules/xen/xen.te   |  5 +-
 xen/arch/x86/mm.c                              | 53 +++++++++++--------
 xen/include/xsm/dummy.h                        | 15 ++++--
 xen/include/xsm/xsm.h                          | 25 +++++----
 xen/xsm/dummy.c                                |  4 +-
 xen/xsm/flask/hooks.c                          | 71 +++++++++-----------------
 xen/xsm/flask/include/av_perm_to_string.h      |  1 +
 xen/xsm/flask/include/av_permissions.h         |  1 +
 10 files changed, 91 insertions(+), 91 deletions(-)

diff --git a/tools/flask/policy/policy/flask/access_vectors b/tools/flask/policy/policy/flask/access_vectors
index 45ac437..8324725 100644
--- a/tools/flask/policy/policy/flask/access_vectors
+++ b/tools/flask/policy/policy/flask/access_vectors
@@ -141,6 +141,7 @@ class mmu
     mfnlist
     memorymap
     remote_remap
+	mmuext_op
 }
 
 class shadow
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index d630f47..fda5cb5 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -7,7 +7,7 @@
 ################################################################################
 define(`declare_domain_common', `
 	allow $1 $2:grant { query setup };
-	allow $1 $2:mmu { adjust physmap map_read map_write stat pinpage updatemp };
+	allow $1 $2:mmu { adjust physmap map_read map_write stat pinpage updatemp mmuext_op };
 	allow $1 $2:hvm { getparam setparam };
 ')
 
@@ -51,7 +51,7 @@ define(`create_domain_common', `
 	allow $1 $2:domain2 { set_cpuid settsc };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
-	allow $1 $2:mmu {map_read map_write adjust memorymap physmap pinpage};
+	allow $1 $2:mmu { map_read map_write adjust memorymap physmap pinpage mmuext_op };
 	allow $1 $2:grant setup;
 	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc setparam pcilevel trackdirtyvram };
 ')
@@ -162,7 +162,7 @@ define(`make_device_model', `
 #   Allow a device to be used by a domain
 define(`use_device', `
     allow $1 $2:resource use;
-    allow $1 $2:mmu { map_read map_write };
+    allow $1 domio_t:mmu { map_read map_write };
 ')
 
 # admin_device(domain, device)
diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
index 8d33285..8c77e6b 100644
--- a/tools/flask/policy/policy/modules/xen/xen.te
+++ b/tools/flask/policy/policy/modules/xen/xen.te
@@ -29,10 +29,10 @@ type xen_t, xen_type, mls_priv;
 # Domain 0
 declare_singleton_domain(dom0_t, mls_priv);
 
-# Untracked I/O memory (pseudo-domain)
+# I/O memory (DOMID_IO pseudo-domain)
 type domio_t, xen_type;
 
-# Xen heap (pseudo-domain)
+# Xen heap (DOMID_XEN pseudo-domain)
 type domxen_t, xen_type;
 
 # Unlabeled objects
@@ -69,7 +69,6 @@ admin_device(dom0_t, device_t)
 admin_device(dom0_t, irq_t)
 admin_device(dom0_t, ioport_t)
 admin_device(dom0_t, iomem_t)
-allow dom0_t domio_t:mmu { map_read map_write };
 
 domain_comms(dom0_t, dom0_t)
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 8915848..9a2acca 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2621,11 +2621,6 @@ static struct domain *get_pg_owner(domid_t domid)
         pg_owner = rcu_lock_domain(dom_io);
         break;
     case DOMID_XEN:
-        if ( !IS_PRIV(curr) )
-        {
-            MEM_LOG("Cannot set foreign dom");
-            break;
-        }
         pg_owner = rcu_lock_domain(dom_xen);
         break;
     default:
@@ -2634,12 +2629,6 @@ static struct domain *get_pg_owner(domid_t domid)
             MEM_LOG("Unknown domain '%u'", domid);
             break;
         }
-        if ( !IS_PRIV_FOR(curr, pg_owner) )
-        {
-            MEM_LOG("Cannot set foreign dom");
-            rcu_unlock_domain(pg_owner);
-            pg_owner = NULL;
-        }
         break;
     }
 
@@ -2727,6 +2716,13 @@ long do_mmuext_op(
         goto out;
     }
 
+    rc = xsm_mmuext_op(d, pg_owner);
+    if ( rc )
+    {
+        rcu_unlock_domain(pg_owner);
+        goto out;
+    }
+
     for ( i = 0; i < count; i++ )
     {
         if ( hypercall_preempt_check() )
@@ -3168,6 +3164,8 @@ long do_mmu_update(
     struct vcpu *v = current;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     struct domain_mmap_cache mapcache;
+    uint32_t xsm_needed = 0;
+    uint32_t xsm_checked = 0;
 
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
@@ -3199,11 +3197,6 @@ long do_mmu_update(
             rc = -EINVAL;
             goto out;
         }
-        if ( !IS_PRIV_FOR(d, pt_owner) )
-        {
-            rc = -ESRCH;
-            goto out;
-        }
     }
 
     if ( (pg_owner = get_pg_owner((uint16_t)foreigndom)) == NULL )
@@ -3243,9 +3236,20 @@ long do_mmu_update(
         {
             p2m_type_t p2mt;
 
-            rc = xsm_mmu_normal_update(d, pt_owner, pg_owner, req.val);
-            if ( rc )
-                break;
+            xsm_needed |= XSM_MMU_NORMAL_UPDATE;
+            if ( get_pte_flags(req.val) & _PAGE_PRESENT )
+            {
+                xsm_needed |= XSM_MMU_UPDATE_READ;
+                if ( get_pte_flags(req.val) & _PAGE_RW )
+                    xsm_needed |= XSM_MMU_UPDATE_WRITE;
+            }
+            if ( xsm_needed != xsm_checked )
+            {
+                rc = xsm_mmu_update(d, pt_owner, pg_owner, xsm_needed);
+                if ( rc )
+                    break;
+                xsm_checked = xsm_needed;
+            }
             rc = -EINVAL;
 
             req.ptr -= cmd;
@@ -3357,9 +3361,14 @@ long do_mmu_update(
             mfn = req.ptr >> PAGE_SHIFT;
             gpfn = req.val;
 
-            rc = xsm_mmu_machphys_update(d, pg_owner, mfn);
-            if ( rc )
-                break;
+            xsm_needed |= XSM_MMU_MACHPHYS_UPDATE;
+            if ( xsm_needed != xsm_checked )
+            {
+                rc = xsm_mmu_update(d, NULL, pg_owner, xsm_needed);
+                if ( rc )
+                    break;
+                xsm_checked = xsm_needed;
+            }
 
             if ( unlikely(!get_page_from_pagenr(mfn, pg_owner)) )
             {
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 42b2285..6648739 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -662,21 +662,28 @@ static XSM_INLINE int xsm_domain_memory_map(struct domain *d)
     return 0;
 }
 
-static XSM_INLINE int xsm_mmu_normal_update(struct domain *d, struct domain *t,
-                                            struct domain *f, intpte_t fpte)
+static XSM_INLINE int xsm_mmu_update(struct domain *d, struct domain *t,
+                                     struct domain *f, uint32_t flags)
 {
+    if ( t && d != t && !IS_PRIV_FOR(d, t) )
+        return -EPERM;
+    if ( d != f && !IS_PRIV_FOR(d, f) )
+        return -EPERM;
     return 0;
 }
 
-static XSM_INLINE int xsm_mmu_machphys_update(struct domain *d, struct domain *f,
-                                              unsigned long mfn)
+static XSM_INLINE int xsm_mmuext_op(struct domain *d, struct domain *f)
 {
+    if ( d != f && !IS_PRIV_FOR(d, f) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f, 
                                                             l1_pgentry_t pte)
 {
+    if ( d != f && !IS_PRIV_FOR(d, f) )
+        return -EPERM;
     return 0;
 }
 
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 88aa95a..d41eb54 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -27,8 +27,6 @@ typedef u32 xsm_magic_t;
 #define XSM_MAGIC 0x00000000
 #endif
 
-#ifdef XSM_ENABLE
-
 extern char *policy_buffer;
 extern u32 policy_size;
 
@@ -170,9 +168,13 @@ struct xsm_operations {
     int (*getidletime) (void);
     int (*machine_memory_map) (void);
     int (*domain_memory_map) (struct domain *d);
-    int (*mmu_normal_update) (struct domain *d, struct domain *t,
-                              struct domain *f, intpte_t fpte);
-    int (*mmu_machphys_update) (struct domain *d1, struct domain *d2, unsigned long mfn);
+#define XSM_MMU_UPDATE_READ      1
+#define XSM_MMU_UPDATE_WRITE     2
+#define XSM_MMU_NORMAL_UPDATE    4
+#define XSM_MMU_MACHPHYS_UPDATE  8
+    int (*mmu_update) (struct domain *d, struct domain *t,
+                       struct domain *f, uint32_t flags);
+    int (*mmuext_op) (struct domain *d, struct domain *f);
     int (*update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
     int (*sendtrigger) (struct domain *d);
@@ -186,6 +188,8 @@ struct xsm_operations {
 #endif
 };
 
+#ifdef XSM_ENABLE
+
 extern struct xsm_operations *xsm_ops;
 
 #ifndef XSM_NO_WRAPPERS
@@ -763,16 +767,15 @@ static inline int xsm_domain_memory_map(struct domain *d)
     return xsm_ops->domain_memory_map(d);
 }
 
-static inline int xsm_mmu_normal_update (struct domain *d, struct domain *t,
-                                         struct domain *f, intpte_t fpte)
+static inline int xsm_mmu_update (struct domain *d, struct domain *t,
+                                  struct domain *f, uint32_t flags)
 {
-    return xsm_ops->mmu_normal_update(d, t, f, fpte);
+    return xsm_ops->mmu_update(d, t, f, flags);
 }
 
-static inline int xsm_mmu_machphys_update (struct domain *d1, struct domain *d2,
-                                           unsigned long mfn)
+static inline int xsm_mmuext_op (struct domain *d, struct domain *f)
 {
-    return xsm_ops->mmu_machphys_update(d1, d2, mfn);
+    return xsm_ops->mmuext_op(d, f);
 }
 
 static inline int xsm_update_va_mapping(struct domain *d, struct domain *f, 
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index bc9d30f..200cbc8 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -155,8 +155,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, getidletime);
     set_to_dummy_if_null(ops, machine_memory_map);
     set_to_dummy_if_null(ops, domain_memory_map);
-    set_to_dummy_if_null(ops, mmu_normal_update);
-    set_to_dummy_if_null(ops, mmu_machphys_update);
+    set_to_dummy_if_null(ops, mmu_update);
+    set_to_dummy_if_null(ops, mmuext_op);
     set_to_dummy_if_null(ops, update_va_mapping);
     set_to_dummy_if_null(ops, add_to_physmap);
     set_to_dummy_if_null(ops, remove_from_physmap);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 99d3e21..b2f00d8 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1434,65 +1434,44 @@ static int flask_domain_memory_map(struct domain *d)
     return current_has_perm(d, SECCLASS_MMU, MMU__MEMORYMAP);
 }
 
-static int domain_memory_perm(struct domain *d, struct domain *f, l1_pgentry_t pte)
+static int flask_mmu_update(struct domain *d, struct domain *t,
+                            struct domain *f, uint32_t flags)
 {
     int rc = 0;
-    u32 map_perms = MMU__MAP_READ;
-    unsigned long fgfn, fmfn;
-    p2m_type_t p2mt;
-
-    if ( !(l1e_get_flags(pte) & _PAGE_PRESENT) )
-        return 0;
-
-    if ( l1e_get_flags(pte) & _PAGE_RW )
-        map_perms |= MMU__MAP_WRITE;
-
-    fgfn = l1e_get_pfn(pte);
-    fmfn = mfn_x(get_gfn_query(f, fgfn, &p2mt));
-    put_gfn(f, fgfn);
+    u32 map_perms = 0;
 
-    if ( f->domain_id == DOMID_IO || !mfn_valid(fmfn) )
-    {
-        struct avc_audit_data ad;
-        u32 dsid, fsid;
-        rc = security_iomem_sid(fmfn, &fsid);
-        if ( rc )
-            return rc;
-        AVC_AUDIT_DATA_INIT(&ad, MEMORY);
-        ad.sdom = d;
-        ad.tdom = f;
-        ad.memory.pte = pte.l1;
-        ad.memory.mfn = fmfn;
-        dsid = domain_sid(d);
-        return avc_has_perm(dsid, fsid, SECCLASS_MMU, map_perms, &ad);
-    }
-
-    return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
-}
-
-static int flask_mmu_normal_update(struct domain *d, struct domain *t,
-                                   struct domain *f, intpte_t fpte)
-{
-    int rc = 0;
-
-    if (d != t)
+    if ( t && d != t )
         rc = domain_has_perm(d, t, SECCLASS_MMU, MMU__REMOTE_REMAP);
     if ( rc )
         return rc;
 
-    return domain_memory_perm(d, f, l1e_from_intpte(fpte));
+    if ( flags & XSM_MMU_UPDATE_READ )
+        map_perms |= MMU__MAP_READ;
+    if ( flags & XSM_MMU_UPDATE_WRITE )
+        map_perms |= MMU__MAP_WRITE;
+    if ( flags & XSM_MMU_MACHPHYS_UPDATE )
+        map_perms |= MMU__UPDATEMP;
+
+    if ( map_perms )
+        rc = domain_has_perm(d, f, SECCLASS_MMU, map_perms);
+    return rc;
 }
 
-static int flask_mmu_machphys_update(struct domain *d1, struct domain *d2,
-                                     unsigned long mfn)
+static int flask_mmuext_op(struct domain *d, struct domain *f)
 {
-    return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__UPDATEMP);
+    return domain_has_perm(d, f, SECCLASS_MMU, MMU__MMUEXT_OP);
 }
 
 static int flask_update_va_mapping(struct domain *d, struct domain *f,
                                    l1_pgentry_t pte)
 {
-    return domain_memory_perm(d, f, pte);
+    u32 map_perms = MMU__MAP_READ;
+    if ( !(l1e_get_flags(pte) & _PAGE_PRESENT) )
+        return 0;
+    if ( l1e_get_flags(pte) & _PAGE_RW )
+        map_perms |= MMU__MAP_WRITE;
+
+    return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
 }
 
 static int flask_add_to_physmap(struct domain *d1, struct domain *d2)
@@ -1773,8 +1752,8 @@ static struct xsm_operations flask_ops = {
     .getidletime = flask_getidletime,
     .machine_memory_map = flask_machine_memory_map,
     .domain_memory_map = flask_domain_memory_map,
-    .mmu_normal_update = flask_mmu_normal_update,
-    .mmu_machphys_update = flask_mmu_machphys_update,
+    .mmu_update = flask_mmu_update,
+    .mmuext_op = flask_mmuext_op,
     .update_va_mapping = flask_update_va_mapping,
     .add_to_physmap = flask_add_to_physmap,
     .remove_from_physmap = flask_remove_from_physmap,
diff --git a/xen/xsm/flask/include/av_perm_to_string.h b/xen/xsm/flask/include/av_perm_to_string.h
index 186f1fa..8f65b96 100644
--- a/xen/xsm/flask/include/av_perm_to_string.h
+++ b/xen/xsm/flask/include/av_perm_to_string.h
@@ -111,6 +111,7 @@
    S_(SECCLASS_MMU, MMU__MFNLIST, "mfnlist")
    S_(SECCLASS_MMU, MMU__MEMORYMAP, "memorymap")
    S_(SECCLASS_MMU, MMU__REMOTE_REMAP, "remote_remap")
+   S_(SECCLASS_MMU, MMU__MMUEXT_OP, "mmuext_op")
    S_(SECCLASS_SHADOW, SHADOW__DISABLE, "disable")
    S_(SECCLASS_SHADOW, SHADOW__ENABLE, "enable")
    S_(SECCLASS_SHADOW, SHADOW__LOGDIRTY, "logdirty")
diff --git a/xen/xsm/flask/include/av_permissions.h b/xen/xsm/flask/include/av_permissions.h
index b3831f6..18454fd 100644
--- a/xen/xsm/flask/include/av_permissions.h
+++ b/xen/xsm/flask/include/av_permissions.h
@@ -117,6 +117,7 @@
 #define MMU__MFNLIST                              0x00000400UL
 #define MMU__MEMORYMAP                            0x00000800UL
 #define MMU__REMOTE_REMAP                         0x00001000UL
+#define MMU__MMUEXT_OP                            0x00002000UL
 
 #define SHADOW__DISABLE                           0x00000001UL
 #define SHADOW__ENABLE                            0x00000002UL
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:38:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:38:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSf9-0002vx-Bo; Fri, 30 Nov 2012 15:37:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSf6-0002ri-Ni
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:56 +0000
Received: from [193.109.254.147:17830] by server-13.bemta-14.messagelabs.com
	id 72/38-11239-3D2D8B05; Fri, 30 Nov 2012 15:37:55 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-3.tower-27.messagelabs.com!1354289853!9009623!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17897 invoked from network); 30 Nov 2012 15:37:34 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-3.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:34 -0000
X-TM-IMSS-Message-ID: <d0a0e74f000589bd@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0e74f000589bd ;
	Fri, 30 Nov 2012 10:37:37 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd1017785; 
	Fri, 30 Nov 2012 10:37:31 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:55 -0500
Message-Id: <1354289830-24642-9-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 08/23] arch/x86: convert platform_hypercall to
	use XSM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The newly introduced xsm_platform_op hook addresses new sub-ops, while
most ops already have their own XSM hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/platform_hypercall.c | 11 ++++++++---
 xen/include/xsm/dummy.h           |  7 +++++++
 xen/include/xsm/xsm.h             |  6 ++++++
 xen/xsm/dummy.c                   |  1 +
 xen/xsm/flask/hooks.c             | 33 +++++++++++++++++++++++++++++++++
 5 files changed, 55 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index a3b5a6b..738bed0 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -66,15 +66,16 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     ret_t ret = 0;
     struct xen_platform_op curop, *op = &curop;
 
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-
     if ( copy_from_guest(op, u_xenpf_op, 1) )
         return -EFAULT;
 
     if ( op->interface_version != XENPF_INTERFACE_VERSION )
         return -EACCES;
 
+    ret = xsm_platform_op(op->cmd);
+    if ( ret )
+        return ret;
+
     /*
      * Trylock here avoids deadlock with an existing platform critical section
      * which might (for some current or future reason) want to synchronise
@@ -511,6 +512,10 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         struct xenpf_pcpu_version *ver = &op->u.pcpu_version;
 
+        ret = xsm_getcpuinfo();
+        if ( ret )
+            break;
+
         if ( !get_cpu_maps() )
         {
             ret = -EBUSY;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index dc16684..ae7b4f6 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -574,6 +574,13 @@ static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
     return 0;
 }
 
+static XSM_INLINE int xsm_platform_op(uint32_t op)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_INLINE int xsm_firmware_info(void)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 662f233..d8bf4a0 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -158,6 +158,7 @@ struct xsm_operations {
     int (*microcode) (void);
     int (*physinfo) (void);
     int (*platform_quirk) (uint32_t);
+    int (*platform_op) (uint32_t cmd);
     int (*firmware_info) (void);
     int (*efi_call) (void);
     int (*acpi_sleep) (void);
@@ -698,6 +699,11 @@ static inline int xsm_platform_quirk (uint32_t quirk)
     return xsm_ops->platform_quirk(quirk);
 }
 
+static inline int xsm_platform_op (uint32_t op)
+{
+    return xsm_ops->platform_op(op);
+}
+
 static inline int xsm_firmware_info (void)
 {
     return xsm_ops->firmware_info();
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index b767cfe..578757f 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -143,6 +143,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, microcode);
     set_to_dummy_if_null(ops, physinfo);
     set_to_dummy_if_null(ops, platform_quirk);
+    set_to_dummy_if_null(ops, platform_op);
     set_to_dummy_if_null(ops, firmware_info);
     set_to_dummy_if_null(ops, efi_call);
     set_to_dummy_if_null(ops, acpi_sleep);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index cb8cf96..f9a2596 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1207,6 +1207,38 @@ static int flask_platform_quirk(uint32_t quirk)
                         XEN__QUIRK, NULL);
 }
 
+static int flask_platform_op(uint32_t op)
+{
+    switch ( op )
+    {
+    case XENPF_settime:
+    case XENPF_add_memtype:
+    case XENPF_del_memtype:
+    case XENPF_read_memtype:
+    case XENPF_microcode_update:
+    case XENPF_platform_quirk:
+    case XENPF_firmware_info:
+    case XENPF_efi_runtime_call:
+    case XENPF_enter_acpi_sleep:
+    case XENPF_change_freq:
+    case XENPF_getidletime:
+    case XENPF_set_processor_pminfo:
+    case XENPF_get_cpuinfo:
+    case XENPF_get_cpu_version:
+    case XENPF_cpu_online:
+    case XENPF_cpu_offline:
+    case XENPF_cpu_hotadd:
+    case XENPF_mem_hotadd:
+        /* These operations have their own XSM hooks */
+        return 0;
+    case XENPF_core_parking:
+        return domain_has_xen(current->domain, XEN__PM_OP);
+    default:
+        printk("flask_platform_op: Unknown op %d\n", op);
+        return -EPERM;
+    }
+}
+
 static int flask_firmware_info(void)
 {
     return domain_has_xen(current->domain, XEN__FIRMWARE);
@@ -1577,6 +1609,7 @@ static struct xsm_operations flask_ops = {
     .microcode = flask_microcode,
     .physinfo = flask_physinfo,
     .platform_quirk = flask_platform_quirk,
+    .platform_op = flask_platform_op,
     .firmware_info = flask_firmware_info,
     .efi_call = flask_efi_call,
     .acpi_sleep = flask_acpi_sleep,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:38:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:38:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSf9-0002vx-Bo; Fri, 30 Nov 2012 15:37:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSf6-0002ri-Ni
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:37:56 +0000
Received: from [193.109.254.147:17830] by server-13.bemta-14.messagelabs.com
	id 72/38-11239-3D2D8B05; Fri, 30 Nov 2012 15:37:55 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-3.tower-27.messagelabs.com!1354289853!9009623!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17897 invoked from network); 30 Nov 2012 15:37:34 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-3.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:34 -0000
X-TM-IMSS-Message-ID: <d0a0e74f000589bd@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0e74f000589bd ;
	Fri, 30 Nov 2012 10:37:37 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd1017785; 
	Fri, 30 Nov 2012 10:37:31 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:55 -0500
Message-Id: <1354289830-24642-9-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 08/23] arch/x86: convert platform_hypercall to
	use XSM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The newly introduced xsm_platform_op hook addresses new sub-ops, while
most ops already have their own XSM hooks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/platform_hypercall.c | 11 ++++++++---
 xen/include/xsm/dummy.h           |  7 +++++++
 xen/include/xsm/xsm.h             |  6 ++++++
 xen/xsm/dummy.c                   |  1 +
 xen/xsm/flask/hooks.c             | 33 +++++++++++++++++++++++++++++++++
 5 files changed, 55 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index a3b5a6b..738bed0 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -66,15 +66,16 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     ret_t ret = 0;
     struct xen_platform_op curop, *op = &curop;
 
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-
     if ( copy_from_guest(op, u_xenpf_op, 1) )
         return -EFAULT;
 
     if ( op->interface_version != XENPF_INTERFACE_VERSION )
         return -EACCES;
 
+    ret = xsm_platform_op(op->cmd);
+    if ( ret )
+        return ret;
+
     /*
      * Trylock here avoids deadlock with an existing platform critical section
      * which might (for some current or future reason) want to synchronise
@@ -511,6 +512,10 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         struct xenpf_pcpu_version *ver = &op->u.pcpu_version;
 
+        ret = xsm_getcpuinfo();
+        if ( ret )
+            break;
+
         if ( !get_cpu_maps() )
         {
             ret = -EBUSY;
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index dc16684..ae7b4f6 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -574,6 +574,13 @@ static XSM_INLINE int xsm_platform_quirk(uint32_t quirk)
     return 0;
 }
 
+static XSM_INLINE int xsm_platform_op(uint32_t op)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_INLINE int xsm_firmware_info(void)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 662f233..d8bf4a0 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -158,6 +158,7 @@ struct xsm_operations {
     int (*microcode) (void);
     int (*physinfo) (void);
     int (*platform_quirk) (uint32_t);
+    int (*platform_op) (uint32_t cmd);
     int (*firmware_info) (void);
     int (*efi_call) (void);
     int (*acpi_sleep) (void);
@@ -698,6 +699,11 @@ static inline int xsm_platform_quirk (uint32_t quirk)
     return xsm_ops->platform_quirk(quirk);
 }
 
+static inline int xsm_platform_op (uint32_t op)
+{
+    return xsm_ops->platform_op(op);
+}
+
 static inline int xsm_firmware_info (void)
 {
     return xsm_ops->firmware_info();
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index b767cfe..578757f 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -143,6 +143,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, microcode);
     set_to_dummy_if_null(ops, physinfo);
     set_to_dummy_if_null(ops, platform_quirk);
+    set_to_dummy_if_null(ops, platform_op);
     set_to_dummy_if_null(ops, firmware_info);
     set_to_dummy_if_null(ops, efi_call);
     set_to_dummy_if_null(ops, acpi_sleep);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index cb8cf96..f9a2596 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1207,6 +1207,38 @@ static int flask_platform_quirk(uint32_t quirk)
                         XEN__QUIRK, NULL);
 }
 
+static int flask_platform_op(uint32_t op)
+{
+    switch ( op )
+    {
+    case XENPF_settime:
+    case XENPF_add_memtype:
+    case XENPF_del_memtype:
+    case XENPF_read_memtype:
+    case XENPF_microcode_update:
+    case XENPF_platform_quirk:
+    case XENPF_firmware_info:
+    case XENPF_efi_runtime_call:
+    case XENPF_enter_acpi_sleep:
+    case XENPF_change_freq:
+    case XENPF_getidletime:
+    case XENPF_set_processor_pminfo:
+    case XENPF_get_cpuinfo:
+    case XENPF_get_cpu_version:
+    case XENPF_cpu_online:
+    case XENPF_cpu_offline:
+    case XENPF_cpu_hotadd:
+    case XENPF_mem_hotadd:
+        /* These operations have their own XSM hooks */
+        return 0;
+    case XENPF_core_parking:
+        return domain_has_xen(current->domain, XEN__PM_OP);
+    default:
+        printk("flask_platform_op: Unknown op %d\n", op);
+        return -EPERM;
+    }
+}
+
 static int flask_firmware_info(void)
 {
     return domain_has_xen(current->domain, XEN__FIRMWARE);
@@ -1577,6 +1609,7 @@ static struct xsm_operations flask_ops = {
     .microcode = flask_microcode,
     .physinfo = flask_physinfo,
     .platform_quirk = flask_platform_quirk,
+    .platform_op = flask_platform_op,
     .firmware_info = flask_firmware_info,
     .efi_call = flask_efi_call,
     .acpi_sleep = flask_acpi_sleep,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:38:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:38:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSfi-0003W6-VV; Fri, 30 Nov 2012 15:38:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSfg-0003T1-Uj
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:38:33 +0000
Received: from [193.109.254.147:32643] by server-15.bemta-14.messagelabs.com
	id 02/07-12105-8F2D8B05; Fri, 30 Nov 2012 15:38:32 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-27.messagelabs.com!1354289854!2070407!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4545 invoked from network); 30 Nov 2012 15:37:34 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-14.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:34 -0000
X-TM-IMSS-Message-ID: <d0a0eab9000589c4@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0eab9000589c4 ;
	Fri, 30 Nov 2012 10:37:38 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd4017785; 
	Fri, 30 Nov 2012 10:37:32 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:58 -0500
Message-Id: <1354289830-24642-12-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 11/23] xen: convert do_sysctl to use XSM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The xsm_sysctl hook now covers every sysctl, in addition to the more
fine-grained XSM hooks in most sub-functions.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/common/sysctl.c     |  7 ++++---
 xen/include/xsm/dummy.h |  7 +++++++
 xen/include/xsm/xsm.h   |  6 ++++++
 xen/xsm/dummy.c         |  1 +
 xen/xsm/flask/hooks.c   | 33 +++++++++++++++++++++++++++++++++
 5 files changed, 51 insertions(+), 3 deletions(-)

diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 47142f4..599430e 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -33,15 +33,16 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     struct xen_sysctl curop, *op = &curop;
     static DEFINE_SPINLOCK(sysctl_lock);
 
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-
     if ( copy_from_guest(op, u_sysctl, 1) )
         return -EFAULT;
 
     if ( op->interface_version != XEN_SYSCTL_INTERFACE_VERSION )
         return -EACCES;
 
+    ret = xsm_sysctl(op->cmd);
+    if ( ret )
+        return ret;
+
     /*
      * Trylock here avoids deadlock with an existing sysctl critical section
      * which might (for some current or future reason) want to synchronise
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 1c19e15..e42965c 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -106,6 +106,13 @@ static XSM_INLINE int xsm_domctl(struct domain *d, int cmd)
     return 0;
 }
 
+static XSM_INLINE int xsm_sysctl(int cmd)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_INLINE int xsm_set_virq_handler(struct domain *d, uint32_t virq)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index d8bf4a0..470e3c0 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -58,6 +58,7 @@ struct xsm_operations {
     int (*domain_settime) (struct domain *d);
     int (*set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
+    int (*sysctl) (int cmd);
     int (*set_virq_handler) (struct domain *d, uint32_t virq);
     int (*tbufcontrol) (void);
     int (*readconsole) (uint32_t clear);
@@ -267,6 +268,11 @@ static inline int xsm_domctl (struct domain *d, int cmd)
     return xsm_ops->domctl(d, cmd);
 }
 
+static inline int xsm_sysctl (int cmd)
+{
+    return xsm_ops->sysctl(cmd);
+}
+
 static inline int xsm_set_virq_handler (struct domain *d, uint32_t virq)
 {
     return xsm_ops->set_virq_handler(d, virq);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 578757f..1e7f42c 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -45,6 +45,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, domain_settime);
     set_to_dummy_if_null(ops, set_target);
     set_to_dummy_if_null(ops, domctl);
+    set_to_dummy_if_null(ops, sysctl);
     set_to_dummy_if_null(ops, set_virq_handler);
     set_to_dummy_if_null(ops, tbufcontrol);
     set_to_dummy_if_null(ops, readconsole);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 2e002f0..e25dd1c 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -675,6 +675,38 @@ static int flask_domctl(struct domain *d, int cmd)
     }
 }
 
+static int flask_sysctl(int cmd)
+{
+    switch ( cmd )
+    {
+    /* These have individual XSM hooks */
+    case XEN_SYSCTL_readconsole:
+    case XEN_SYSCTL_tbuf_op:
+    case XEN_SYSCTL_sched_id:
+    case XEN_SYSCTL_perfc_op:
+    case XEN_SYSCTL_getdomaininfolist:
+    case XEN_SYSCTL_debug_keys:
+    case XEN_SYSCTL_getcpuinfo:
+    case XEN_SYSCTL_availheap:
+    case XEN_SYSCTL_get_pmstat:
+    case XEN_SYSCTL_pm_op:
+    case XEN_SYSCTL_page_offline_op:
+    case XEN_SYSCTL_lockprof_op:
+    case XEN_SYSCTL_cpupool_op:
+    case XEN_SYSCTL_scheduler_op:
+#ifdef CONFIG_X86
+    case XEN_SYSCTL_physinfo:
+    case XEN_SYSCTL_cpu_hotplug:
+    case XEN_SYSCTL_topologyinfo:
+    case XEN_SYSCTL_numainfo:
+#endif
+        return 0;
+    default:
+        printk("flask_sysctl: Unknown op %d\n", cmd);
+        return -EPERM;
+    }
+}
+
 static int flask_set_virq_handler(struct domain *d, uint32_t virq)
 {
     return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
@@ -1601,6 +1633,7 @@ static struct xsm_operations flask_ops = {
     .domain_settime = flask_domain_settime,
     .set_target = flask_set_target,
     .domctl = flask_domctl,
+    .sysctl = flask_sysctl,
     .set_virq_handler = flask_set_virq_handler,
     .tbufcontrol = flask_tbufcontrol,
     .readconsole = flask_readconsole,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:38:36 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:38:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSfi-0003W6-VV; Fri, 30 Nov 2012 15:38:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSfg-0003T1-Uj
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:38:33 +0000
Received: from [193.109.254.147:32643] by server-15.bemta-14.messagelabs.com
	id 02/07-12105-8F2D8B05; Fri, 30 Nov 2012 15:38:32 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-14.tower-27.messagelabs.com!1354289854!2070407!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4545 invoked from network); 30 Nov 2012 15:37:34 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-14.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:34 -0000
X-TM-IMSS-Message-ID: <d0a0eab9000589c4@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0eab9000589c4 ;
	Fri, 30 Nov 2012 10:37:38 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd4017785; 
	Fri, 30 Nov 2012 10:37:32 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:58 -0500
Message-Id: <1354289830-24642-12-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 11/23] xen: convert do_sysctl to use XSM
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The xsm_sysctl hook now covers every sysctl, in addition to the more
fine-grained XSM hooks in most sub-functions.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/common/sysctl.c     |  7 ++++---
 xen/include/xsm/dummy.h |  7 +++++++
 xen/include/xsm/xsm.h   |  6 ++++++
 xen/xsm/dummy.c         |  1 +
 xen/xsm/flask/hooks.c   | 33 +++++++++++++++++++++++++++++++++
 5 files changed, 51 insertions(+), 3 deletions(-)

diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 47142f4..599430e 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -33,15 +33,16 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     struct xen_sysctl curop, *op = &curop;
     static DEFINE_SPINLOCK(sysctl_lock);
 
-    if ( !IS_PRIV(current->domain) )
-        return -EPERM;
-
     if ( copy_from_guest(op, u_sysctl, 1) )
         return -EFAULT;
 
     if ( op->interface_version != XEN_SYSCTL_INTERFACE_VERSION )
         return -EACCES;
 
+    ret = xsm_sysctl(op->cmd);
+    if ( ret )
+        return ret;
+
     /*
      * Trylock here avoids deadlock with an existing sysctl critical section
      * which might (for some current or future reason) want to synchronise
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 1c19e15..e42965c 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -106,6 +106,13 @@ static XSM_INLINE int xsm_domctl(struct domain *d, int cmd)
     return 0;
 }
 
+static XSM_INLINE int xsm_sysctl(int cmd)
+{
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
+    return 0;
+}
+
 static XSM_INLINE int xsm_set_virq_handler(struct domain *d, uint32_t virq)
 {
     return 0;
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index d8bf4a0..470e3c0 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -58,6 +58,7 @@ struct xsm_operations {
     int (*domain_settime) (struct domain *d);
     int (*set_target) (struct domain *d, struct domain *e);
     int (*domctl) (struct domain *d, int cmd);
+    int (*sysctl) (int cmd);
     int (*set_virq_handler) (struct domain *d, uint32_t virq);
     int (*tbufcontrol) (void);
     int (*readconsole) (uint32_t clear);
@@ -267,6 +268,11 @@ static inline int xsm_domctl (struct domain *d, int cmd)
     return xsm_ops->domctl(d, cmd);
 }
 
+static inline int xsm_sysctl (int cmd)
+{
+    return xsm_ops->sysctl(cmd);
+}
+
 static inline int xsm_set_virq_handler (struct domain *d, uint32_t virq)
 {
     return xsm_ops->set_virq_handler(d, virq);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 578757f..1e7f42c 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -45,6 +45,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, domain_settime);
     set_to_dummy_if_null(ops, set_target);
     set_to_dummy_if_null(ops, domctl);
+    set_to_dummy_if_null(ops, sysctl);
     set_to_dummy_if_null(ops, set_virq_handler);
     set_to_dummy_if_null(ops, tbufcontrol);
     set_to_dummy_if_null(ops, readconsole);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 2e002f0..e25dd1c 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -675,6 +675,38 @@ static int flask_domctl(struct domain *d, int cmd)
     }
 }
 
+static int flask_sysctl(int cmd)
+{
+    switch ( cmd )
+    {
+    /* These have individual XSM hooks */
+    case XEN_SYSCTL_readconsole:
+    case XEN_SYSCTL_tbuf_op:
+    case XEN_SYSCTL_sched_id:
+    case XEN_SYSCTL_perfc_op:
+    case XEN_SYSCTL_getdomaininfolist:
+    case XEN_SYSCTL_debug_keys:
+    case XEN_SYSCTL_getcpuinfo:
+    case XEN_SYSCTL_availheap:
+    case XEN_SYSCTL_get_pmstat:
+    case XEN_SYSCTL_pm_op:
+    case XEN_SYSCTL_page_offline_op:
+    case XEN_SYSCTL_lockprof_op:
+    case XEN_SYSCTL_cpupool_op:
+    case XEN_SYSCTL_scheduler_op:
+#ifdef CONFIG_X86
+    case XEN_SYSCTL_physinfo:
+    case XEN_SYSCTL_cpu_hotplug:
+    case XEN_SYSCTL_topologyinfo:
+    case XEN_SYSCTL_numainfo:
+#endif
+        return 0;
+    default:
+        printk("flask_sysctl: Unknown op %d\n", cmd);
+        return -EPERM;
+    }
+}
+
 static int flask_set_virq_handler(struct domain *d, uint32_t virq)
 {
     return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER);
@@ -1601,6 +1633,7 @@ static struct xsm_operations flask_ops = {
     .domain_settime = flask_domain_settime,
     .set_target = flask_set_target,
     .domctl = flask_domctl,
+    .sysctl = flask_sysctl,
     .set_virq_handler = flask_set_virq_handler,
     .tbufcontrol = flask_tbufcontrol,
     .readconsole = flask_readconsole,
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:39:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:39:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSgJ-00048q-Ev; Fri, 30 Nov 2012 15:39:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSgI-00047Z-4g
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:39:10 +0000
Received: from [193.109.254.147:27952] by server-11.bemta-14.messagelabs.com
	id 91/A7-29027-D13D8B05; Fri, 30 Nov 2012 15:39:09 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-5.tower-27.messagelabs.com!1354289853!6509201!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30619 invoked from network); 30 Nov 2012 15:37:34 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-5.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:34 -0000
X-TM-IMSS-Message-ID: <d0a0e675000589bc@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0e675000589bc ;
	Fri, 30 Nov 2012 10:37:37 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd0017785; 
	Fri, 30 Nov 2012 10:37:30 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:54 -0500
Message-Id: <1354289830-24642-8-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 07/23] xen: avoid calling
	rcu_lock_*target_domain when an XSM hook exists
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The rcu_lock_{,remote_}target_domain_by_id functions are wrappers around
an IS_PRIV_FOR check for the current domain. This is now redundant with
XSM hooks, so replace these calls with rcu_lock_domain_by_any_id or
rcu_lock_remote_domain_by_id to remove the duplicate permission checks.

When XSM_ENABLE is not defined or when the dummy XSM module is used,
this patch should not change any functionality. Because the locations of
privilege checks have sometimes moved below argument validation, error
returns of some functions may change from EPERM to EINVAL when called
with invalid arguments and from a domain without permission to perform
the operation.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/hvm/hvm.c     | 38 +++++++++++++++----------------
 xen/arch/x86/mm.c          | 22 ++++++++----------
 xen/common/event_channel.c | 18 +++++++--------
 xen/common/grant_table.c   | 57 +++++++++++++++-------------------------------
 xen/common/memory.c        | 15 ++++++------
 xen/include/xsm/dummy.h    | 34 +++++++++++++++++++++++++++
 6 files changed, 97 insertions(+), 87 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 34da2f5..5bdde8d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3392,7 +3392,7 @@ static int hvmop_set_pci_intx_level(
     if ( (op.domain > 0) || (op.bus > 0) || (op.device > 31) || (op.intx > 3) )
         return -EINVAL;
 
-    rc = rcu_lock_remote_target_domain_by_id(op.domid, &d);
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
     if ( rc != 0 )
         return rc;
 
@@ -3559,7 +3559,7 @@ static int hvmop_set_isa_irq_level(
     if ( op.isa_irq > 15 )
         return -EINVAL;
 
-    rc = rcu_lock_remote_target_domain_by_id(op.domid, &d);
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
     if ( rc != 0 )
         return rc;
 
@@ -3603,7 +3603,7 @@ static int hvmop_set_pci_link_route(
     if ( (op.link > 3) || (op.isa_irq > 15) )
         return -EINVAL;
 
-    rc = rcu_lock_remote_target_domain_by_id(op.domid, &d);
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
     if ( rc != 0 )
         return rc;
 
@@ -3633,7 +3633,7 @@ static int hvmop_inject_msi(
     if ( copy_from_guest(&op, uop, 1) )
         return -EFAULT;
 
-    rc = rcu_lock_remote_target_domain_by_id(op.domid, &d);
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
     if ( rc != 0 )
         return rc;
 
@@ -3730,9 +3730,9 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( a.index >= HVM_NR_PARAMS )
             return -EINVAL;
 
-        rc = rcu_lock_target_domain_by_id(a.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(a.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = -EINVAL;
         if ( !is_hvm_domain(d) )
@@ -3976,7 +3976,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4015,7 +4015,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4065,9 +4065,9 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(a.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(a.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = xsm_hvm_param(d, op);
         if ( rc )
@@ -4116,7 +4116,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4195,7 +4195,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4230,7 +4230,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4266,9 +4266,9 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(a.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(a.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = -EINVAL;
         if ( !is_hvm_domain(d) || !paging_mode_shadow(d) )
@@ -4320,7 +4320,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&tr, arg, 1 ) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(tr.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(tr.domid, &d);
         if ( rc != 0 )
             return rc;
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index e66c79d..8915848 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4390,9 +4390,9 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&xatp, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(xatp.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(xatp.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         if ( xsm_add_to_physmap(current->domain, d) )
         {
@@ -4429,9 +4429,9 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( fmap.map.nr_entries > E820MAX )
             return -EINVAL;
 
-        rc = rcu_lock_target_domain_by_id(fmap.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(fmap.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = xsm_domain_memory_map(d);
         if ( rc )
@@ -4584,16 +4584,12 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct domain *d;
         struct p2m_domain *p2m;
 
-        /* Support DOMID_SELF? */
-        if ( !IS_PRIV(current->domain) )
-            return -EPERM;
-
         if ( copy_from_guest(&target, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(target.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(target.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         if ( op == XENMEM_set_pod_target )
             rc = xsm_set_pod_target(d);
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index a80a0d1..37947a9 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -165,9 +165,9 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     domid_t        dom = alloc->dom;
     long           rc;
 
-    rc = rcu_lock_target_domain_by_id(dom, &d);
-    if ( rc )
-        return rc;
+    d = rcu_lock_domain_by_any_id(dom);
+    if ( d == NULL )
+        return -ESRCH;
 
     spin_lock(&d->event_lock);
 
@@ -798,9 +798,9 @@ static long evtchn_status(evtchn_status_t *status)
     struct evtchn   *chn;
     long             rc = 0;
 
-    rc = rcu_lock_target_domain_by_id(dom, &d);
-    if ( rc )
-        return rc;
+    d = rcu_lock_domain_by_any_id(dom);
+    if ( d == NULL )
+        return -ESRCH;
 
     spin_lock(&d->event_lock);
 
@@ -950,9 +950,9 @@ static long evtchn_reset(evtchn_reset_t *r)
     struct domain *d;
     int i, rc;
 
-    rc = rcu_lock_target_domain_by_id(dom, &d);
-    if ( rc )
-        return rc;
+    d = rcu_lock_domain_by_any_id(dom);
+    if ( d == NULL )
+        return -ESRCH;
 
     rc = xsm_evtchn_reset(current->domain, d);
     if ( rc )
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..eae9518 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -230,30 +230,6 @@ double_gt_unlock(struct grant_table *lgt, struct grant_table *rgt)
         spin_unlock(&rgt->lock);
 }
 
-static struct domain *gt_lock_target_domain_by_id(domid_t dom)
-{
-    struct domain *d;
-    int rc = GNTST_general_error;
-
-    switch ( rcu_lock_target_domain_by_id(dom, &d) )
-    {
-    case 0:
-        return d;
-
-    case -ESRCH:
-        gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
-        rc = GNTST_bad_domain;
-        break;
-
-    case -EPERM:
-        rc = GNTST_permission_denied;
-        break;
-    }
-
-    ASSERT(rc < 0 && -rc <= MAX_ERRNO);
-    return ERR_PTR(rc);
-}
-
 static inline int
 __get_maptrack_handle(
     struct grant_table *t)
@@ -1342,11 +1318,12 @@ gnttab_setup_table(
         goto out1;
     }
 
-    d = gt_lock_target_domain_by_id(op.dom);
-    if ( IS_ERR(d) )
+    d = rcu_lock_domain_by_any_id(op.dom);
+    if ( d == NULL )
     {
-        op.status = PTR_ERR(d);
-        goto out1;
+        gdprintk(XENLOG_INFO, "Bad domid %d.\n", op.dom);
+        op.status = GNTST_bad_domain;
+        goto out2;
     }
 
     if ( xsm_grant_setup(current->domain, d) )
@@ -1410,10 +1387,11 @@ gnttab_query_size(
         return -EFAULT;
     }
 
-    d = gt_lock_target_domain_by_id(op.dom);
-    if ( IS_ERR(d) )
+    d = rcu_lock_domain_by_any_id(op.dom);
+    if ( d == NULL )
     {
-        op.status = PTR_ERR(d);
+        gdprintk(XENLOG_INFO, "Bad domid %d.\n", op.dom);
+        op.status = GNTST_bad_domain;
         goto query_out;
     }
 
@@ -2283,10 +2261,10 @@ gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop,
         return -EFAULT;
     }
 
-    d = gt_lock_target_domain_by_id(op.dom);
-    if ( IS_ERR(d) )
+    d = rcu_lock_domain_by_any_id(op.dom);
+    if ( d == NULL )
     {
-        op.status = PTR_ERR(d);
+        op.status = GNTST_bad_domain;
         goto out1;
     }
     rc = xsm_grant_setup(current->domain, d);
@@ -2336,14 +2314,15 @@ gnttab_get_version(XEN_GUEST_HANDLE_PARAM(gnttab_get_version_t uop))
     if ( copy_from_guest(&op, uop, 1) )
         return -EFAULT;
 
-    rc = rcu_lock_target_domain_by_id(op.dom, &d);
-    if ( rc < 0 )
-        return rc;
+    d = rcu_lock_domain_by_any_id(op.dom);
+    if ( d == NULL )
+        return -ESRCH;
 
-    if ( xsm_grant_query_size(current->domain, d) )
+    rc = xsm_grant_query_size(current->domain, d);
+    if ( rc )
     {
         rcu_unlock_domain(d);
-        return -EPERM;
+        return rc;
     }
 
     op.version = d->grant_table->gt_version;
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..dd36b83 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -570,7 +570,8 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
              && (reservation.mem_flags & XENMEMF_populate_on_demand) )
             args.memflags |= MEMF_populate_on_demand;
 
-        if ( unlikely(rcu_lock_target_domain_by_id(reservation.domid, &d)) )
+        d = rcu_lock_domain_by_any_id(reservation.domid);
+        if ( d == NULL )
             return start_extent;
         args.domain = d;
 
@@ -619,9 +620,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&domid, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(domid, &d);
-        if ( rc )
-            return rc;
+        d = rcu_lock_domain_by_any_id(domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = xsm_memory_stat_reservation(current->domain, d);
         if ( rc )
@@ -657,9 +658,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&xrfp, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(xrfp.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(xrfp.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         if ( xsm_remove_from_physmap(current->domain, d) )
         {
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index fb00a01..dc16684 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -194,6 +194,8 @@ static XSM_INLINE int xsm_grant_unmapref(struct domain *d1, struct domain *d2)
 
 static XSM_INLINE int xsm_grant_setup(struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
@@ -209,17 +211,23 @@ static XSM_INLINE int xsm_grant_copy(struct domain *d1, struct domain *d2)
 
 static XSM_INLINE int xsm_grant_query_size(struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
                                                             struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_memory_stat_reservation(struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
@@ -260,6 +268,8 @@ static XSM_INLINE int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
 static XSM_INLINE int xsm_evtchn_unbound(struct domain *d, struct evtchn *chn,
                                          domid_t id2)
 {
+    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
@@ -281,11 +291,15 @@ static XSM_INLINE int xsm_evtchn_send(struct domain *d, struct evtchn *chn)
 
 static XSM_INLINE int xsm_evtchn_status(struct domain *d, struct evtchn *chn)
 {
+    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_evtchn_reset(struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
@@ -306,11 +320,15 @@ static XSM_INLINE char *xsm_show_security_evtchn(struct domain *d, const struct
 
 static XSM_INLINE int xsm_get_pod_target(struct domain *d)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_set_pod_target(struct domain *d)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
@@ -481,26 +499,36 @@ static XSM_INLINE int xsm_machine_address_size(struct domain *d, uint32_t cmd)
 
 static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
 {
+    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_hvm_set_pci_intx_level(struct domain *d)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_hvm_set_isa_irq_level(struct domain *d)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_hvm_set_pci_link_route(struct domain *d)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
@@ -582,6 +610,8 @@ static XSM_INLINE int xsm_machine_memory_map(void)
 
 static XSM_INLINE int xsm_domain_memory_map(struct domain *d)
 {
+    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
@@ -605,11 +635,15 @@ static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f,
 
 static XSM_INLINE int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:39:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:39:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSgJ-00048q-Ev; Fri, 30 Nov 2012 15:39:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeSgI-00047Z-4g
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 15:39:10 +0000
Received: from [193.109.254.147:27952] by server-11.bemta-14.messagelabs.com
	id 91/A7-29027-D13D8B05; Fri, 30 Nov 2012 15:39:09 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-5.tower-27.messagelabs.com!1354289853!6509201!1
X-Originating-IP: [63.239.67.9]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30619 invoked from network); 30 Nov 2012 15:37:34 -0000
Received: from emvm-gh1-uea08.nsa.gov (HELO nsa.gov) (63.239.67.9)
	by server-5.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 15:37:34 -0000
X-TM-IMSS-Message-ID: <d0a0e675000589bc@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov ([63.239.67.9])
	with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id d0a0e675000589bc ;
	Fri, 30 Nov 2012 10:37:37 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUFbSd0017785; 
	Fri, 30 Nov 2012 10:37:30 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: xen-devel@lists.xen.org
Date: Fri, 30 Nov 2012 10:36:54 -0500
Message-Id: <1354289830-24642-8-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
In-Reply-To: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
References: <1354289830-24642-1-git-send-email-dgdegra@tycho.nsa.gov>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, Keir Fraser <keir@xen.org>
Subject: [Xen-devel] [PATCH 07/23] xen: avoid calling
	rcu_lock_*target_domain when an XSM hook exists
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

The rcu_lock_{,remote_}target_domain_by_id functions are wrappers around
an IS_PRIV_FOR check for the current domain. This is now redundant with
XSM hooks, so replace these calls with rcu_lock_domain_by_any_id or
rcu_lock_remote_domain_by_id to remove the duplicate permission checks.

When XSM_ENABLE is not defined or when the dummy XSM module is used,
this patch should not change any functionality. Because the locations of
privilege checks have sometimes moved below argument validation, error
returns of some functions may change from EPERM to EINVAL when called
with invalid arguments and from a domain without permission to perform
the operation.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/hvm/hvm.c     | 38 +++++++++++++++----------------
 xen/arch/x86/mm.c          | 22 ++++++++----------
 xen/common/event_channel.c | 18 +++++++--------
 xen/common/grant_table.c   | 57 +++++++++++++++-------------------------------
 xen/common/memory.c        | 15 ++++++------
 xen/include/xsm/dummy.h    | 34 +++++++++++++++++++++++++++
 6 files changed, 97 insertions(+), 87 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 34da2f5..5bdde8d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3392,7 +3392,7 @@ static int hvmop_set_pci_intx_level(
     if ( (op.domain > 0) || (op.bus > 0) || (op.device > 31) || (op.intx > 3) )
         return -EINVAL;
 
-    rc = rcu_lock_remote_target_domain_by_id(op.domid, &d);
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
     if ( rc != 0 )
         return rc;
 
@@ -3559,7 +3559,7 @@ static int hvmop_set_isa_irq_level(
     if ( op.isa_irq > 15 )
         return -EINVAL;
 
-    rc = rcu_lock_remote_target_domain_by_id(op.domid, &d);
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
     if ( rc != 0 )
         return rc;
 
@@ -3603,7 +3603,7 @@ static int hvmop_set_pci_link_route(
     if ( (op.link > 3) || (op.isa_irq > 15) )
         return -EINVAL;
 
-    rc = rcu_lock_remote_target_domain_by_id(op.domid, &d);
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
     if ( rc != 0 )
         return rc;
 
@@ -3633,7 +3633,7 @@ static int hvmop_inject_msi(
     if ( copy_from_guest(&op, uop, 1) )
         return -EFAULT;
 
-    rc = rcu_lock_remote_target_domain_by_id(op.domid, &d);
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
     if ( rc != 0 )
         return rc;
 
@@ -3730,9 +3730,9 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( a.index >= HVM_NR_PARAMS )
             return -EINVAL;
 
-        rc = rcu_lock_target_domain_by_id(a.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(a.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = -EINVAL;
         if ( !is_hvm_domain(d) )
@@ -3976,7 +3976,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4015,7 +4015,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4065,9 +4065,9 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(a.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(a.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = xsm_hvm_param(d, op);
         if ( rc )
@@ -4116,7 +4116,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4195,7 +4195,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4230,7 +4230,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(a.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
         if ( rc != 0 )
             return rc;
 
@@ -4266,9 +4266,9 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(a.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(a.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = -EINVAL;
         if ( !is_hvm_domain(d) || !paging_mode_shadow(d) )
@@ -4320,7 +4320,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&tr, arg, 1 ) )
             return -EFAULT;
 
-        rc = rcu_lock_remote_target_domain_by_id(tr.domid, &d);
+        rc = rcu_lock_remote_domain_by_id(tr.domid, &d);
         if ( rc != 0 )
             return rc;
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index e66c79d..8915848 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4390,9 +4390,9 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&xatp, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(xatp.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(xatp.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         if ( xsm_add_to_physmap(current->domain, d) )
         {
@@ -4429,9 +4429,9 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( fmap.map.nr_entries > E820MAX )
             return -EINVAL;
 
-        rc = rcu_lock_target_domain_by_id(fmap.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(fmap.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = xsm_domain_memory_map(d);
         if ( rc )
@@ -4584,16 +4584,12 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct domain *d;
         struct p2m_domain *p2m;
 
-        /* Support DOMID_SELF? */
-        if ( !IS_PRIV(current->domain) )
-            return -EPERM;
-
         if ( copy_from_guest(&target, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(target.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(target.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         if ( op == XENMEM_set_pod_target )
             rc = xsm_set_pod_target(d);
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index a80a0d1..37947a9 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -165,9 +165,9 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     domid_t        dom = alloc->dom;
     long           rc;
 
-    rc = rcu_lock_target_domain_by_id(dom, &d);
-    if ( rc )
-        return rc;
+    d = rcu_lock_domain_by_any_id(dom);
+    if ( d == NULL )
+        return -ESRCH;
 
     spin_lock(&d->event_lock);
 
@@ -798,9 +798,9 @@ static long evtchn_status(evtchn_status_t *status)
     struct evtchn   *chn;
     long             rc = 0;
 
-    rc = rcu_lock_target_domain_by_id(dom, &d);
-    if ( rc )
-        return rc;
+    d = rcu_lock_domain_by_any_id(dom);
+    if ( d == NULL )
+        return -ESRCH;
 
     spin_lock(&d->event_lock);
 
@@ -950,9 +950,9 @@ static long evtchn_reset(evtchn_reset_t *r)
     struct domain *d;
     int i, rc;
 
-    rc = rcu_lock_target_domain_by_id(dom, &d);
-    if ( rc )
-        return rc;
+    d = rcu_lock_domain_by_any_id(dom);
+    if ( d == NULL )
+        return -ESRCH;
 
     rc = xsm_evtchn_reset(current->domain, d);
     if ( rc )
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 7912769..eae9518 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -230,30 +230,6 @@ double_gt_unlock(struct grant_table *lgt, struct grant_table *rgt)
         spin_unlock(&rgt->lock);
 }
 
-static struct domain *gt_lock_target_domain_by_id(domid_t dom)
-{
-    struct domain *d;
-    int rc = GNTST_general_error;
-
-    switch ( rcu_lock_target_domain_by_id(dom, &d) )
-    {
-    case 0:
-        return d;
-
-    case -ESRCH:
-        gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
-        rc = GNTST_bad_domain;
-        break;
-
-    case -EPERM:
-        rc = GNTST_permission_denied;
-        break;
-    }
-
-    ASSERT(rc < 0 && -rc <= MAX_ERRNO);
-    return ERR_PTR(rc);
-}
-
 static inline int
 __get_maptrack_handle(
     struct grant_table *t)
@@ -1342,11 +1318,12 @@ gnttab_setup_table(
         goto out1;
     }
 
-    d = gt_lock_target_domain_by_id(op.dom);
-    if ( IS_ERR(d) )
+    d = rcu_lock_domain_by_any_id(op.dom);
+    if ( d == NULL )
     {
-        op.status = PTR_ERR(d);
-        goto out1;
+        gdprintk(XENLOG_INFO, "Bad domid %d.\n", op.dom);
+        op.status = GNTST_bad_domain;
+        goto out2;
     }
 
     if ( xsm_grant_setup(current->domain, d) )
@@ -1410,10 +1387,11 @@ gnttab_query_size(
         return -EFAULT;
     }
 
-    d = gt_lock_target_domain_by_id(op.dom);
-    if ( IS_ERR(d) )
+    d = rcu_lock_domain_by_any_id(op.dom);
+    if ( d == NULL )
     {
-        op.status = PTR_ERR(d);
+        gdprintk(XENLOG_INFO, "Bad domid %d.\n", op.dom);
+        op.status = GNTST_bad_domain;
         goto query_out;
     }
 
@@ -2283,10 +2261,10 @@ gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop,
         return -EFAULT;
     }
 
-    d = gt_lock_target_domain_by_id(op.dom);
-    if ( IS_ERR(d) )
+    d = rcu_lock_domain_by_any_id(op.dom);
+    if ( d == NULL )
     {
-        op.status = PTR_ERR(d);
+        op.status = GNTST_bad_domain;
         goto out1;
     }
     rc = xsm_grant_setup(current->domain, d);
@@ -2336,14 +2314,15 @@ gnttab_get_version(XEN_GUEST_HANDLE_PARAM(gnttab_get_version_t uop))
     if ( copy_from_guest(&op, uop, 1) )
         return -EFAULT;
 
-    rc = rcu_lock_target_domain_by_id(op.dom, &d);
-    if ( rc < 0 )
-        return rc;
+    d = rcu_lock_domain_by_any_id(op.dom);
+    if ( d == NULL )
+        return -ESRCH;
 
-    if ( xsm_grant_query_size(current->domain, d) )
+    rc = xsm_grant_query_size(current->domain, d);
+    if ( rc )
     {
         rcu_unlock_domain(d);
-        return -EPERM;
+        return rc;
     }
 
     op.version = d->grant_table->gt_version;
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 83e2666..dd36b83 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -570,7 +570,8 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
              && (reservation.mem_flags & XENMEMF_populate_on_demand) )
             args.memflags |= MEMF_populate_on_demand;
 
-        if ( unlikely(rcu_lock_target_domain_by_id(reservation.domid, &d)) )
+        d = rcu_lock_domain_by_any_id(reservation.domid);
+        if ( d == NULL )
             return start_extent;
         args.domain = d;
 
@@ -619,9 +620,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&domid, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(domid, &d);
-        if ( rc )
-            return rc;
+        d = rcu_lock_domain_by_any_id(domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = xsm_memory_stat_reservation(current->domain, d);
         if ( rc )
@@ -657,9 +658,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&xrfp, arg, 1) )
             return -EFAULT;
 
-        rc = rcu_lock_target_domain_by_id(xrfp.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(xrfp.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         if ( xsm_remove_from_physmap(current->domain, d) )
         {
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index fb00a01..dc16684 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -194,6 +194,8 @@ static XSM_INLINE int xsm_grant_unmapref(struct domain *d1, struct domain *d2)
 
 static XSM_INLINE int xsm_grant_setup(struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
@@ -209,17 +211,23 @@ static XSM_INLINE int xsm_grant_copy(struct domain *d1, struct domain *d2)
 
 static XSM_INLINE int xsm_grant_query_size(struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_memory_adjust_reservation(struct domain *d1,
                                                             struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_memory_stat_reservation(struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
@@ -260,6 +268,8 @@ static XSM_INLINE int xsm_memory_pin_page(struct domain *d1, struct domain *d2,
 static XSM_INLINE int xsm_evtchn_unbound(struct domain *d, struct evtchn *chn,
                                          domid_t id2)
 {
+    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
@@ -281,11 +291,15 @@ static XSM_INLINE int xsm_evtchn_send(struct domain *d, struct evtchn *chn)
 
 static XSM_INLINE int xsm_evtchn_status(struct domain *d, struct evtchn *chn)
 {
+    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_evtchn_reset(struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
@@ -306,11 +320,15 @@ static XSM_INLINE char *xsm_show_security_evtchn(struct domain *d, const struct
 
 static XSM_INLINE int xsm_get_pod_target(struct domain *d)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_set_pod_target(struct domain *d)
 {
+    if ( !IS_PRIV(current->domain) )
+        return -EPERM;
     return 0;
 }
 
@@ -481,26 +499,36 @@ static XSM_INLINE int xsm_machine_address_size(struct domain *d, uint32_t cmd)
 
 static XSM_INLINE int xsm_hvm_param(struct domain *d, unsigned long op)
 {
+    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_hvm_set_pci_intx_level(struct domain *d)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_hvm_set_isa_irq_level(struct domain *d)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_hvm_set_pci_link_route(struct domain *d)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_hvm_inject_msi(struct domain *d)
 {
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
@@ -582,6 +610,8 @@ static XSM_INLINE int xsm_machine_memory_map(void)
 
 static XSM_INLINE int xsm_domain_memory_map(struct domain *d)
 {
+    if ( current->domain != d && !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
     return 0;
 }
 
@@ -605,11 +635,15 @@ static XSM_INLINE int xsm_update_va_mapping(struct domain *d, struct domain *f,
 
 static XSM_INLINE int xsm_add_to_physmap(struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
 static XSM_INLINE int xsm_remove_from_physmap(struct domain *d1, struct domain *d2)
 {
+    if ( d1 != d2 && !IS_PRIV_FOR(d1, d2) )
+        return -EPERM;
     return 0;
 }
 
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:49:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:49:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSqA-0006OS-U6; Fri, 30 Nov 2012 15:49:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeSq9-0006ON-2g
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 15:49:21 +0000
Received: from [193.109.254.147:63938] by server-2.bemta-14.messagelabs.com id
	D2/57-20829-085D8B05; Fri, 30 Nov 2012 15:49:20 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1354290559!2095077!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21343 invoked from network); 30 Nov 2012 15:49:19 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 15:49:19 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16095619"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 15:48:44 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 15:48:44 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeSpY-0006qA-H4;
	Fri, 30 Nov 2012 15:48:44 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeSpY-00053g-6x;
	Fri, 30 Nov 2012 15:48:44 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14506-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 15:48:44 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14506: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14506 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14506/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-pv           5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-qemuu-win7-amd64  5 xen-boot          fail REGR. vs. 14482
 build-i386                    4 xen-build                 fail REGR. vs. 14482
 build-i386-oldkern            4 xen-build                 fail REGR. vs. 14482
 test-amd64-amd64-pair         8 xen-boot/dst_host         fail REGR. vs. 14482
 test-amd64-amd64-pair         7 xen-boot/src_host         fail REGR. vs. 14482
 test-amd64-amd64-xl-win       5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-win7-amd64  5 xen-boot                fail REGR. vs. 14482
 test-amd64-amd64-qemut-win    5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-qemut-win  5 xen-boot                 fail REGR. vs. 14482
 test-amd64-amd64-xl-qemut-winxpsp3  5 xen-boot            fail REGR. vs. 14482
 test-amd64-i386-qemut-rhel6hvm-amd  5 xen-boot   fail in 14494 REGR. vs. 14482
 test-amd64-i386-xl-multivcpu  5 xen-boot         fail in 14494 REGR. vs. 14482
 test-amd64-i386-xl            5 xen-boot         fail in 14494 REGR. vs. 14482
 test-amd64-i386-qemuu-rhel6hvm-amd  5 xen-boot   fail in 14494 REGR. vs. 14482
 test-amd64-i386-pair         8 xen-boot/dst_host fail in 14494 REGR. vs. 14482
 test-amd64-i386-pair         7 xen-boot/src_host fail in 14494 REGR. vs. 14482
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 5 xen-boot fail in 14494 REGR. vs. 14482
 test-amd64-i386-xl-winxpsp3-vcpus1  5 xen-boot   fail in 14494 REGR. vs. 14482
 test-amd64-i386-xend-qemut-winxpsp3  5 xen-boot  fail in 14494 REGR. vs. 14482
 test-amd64-i386-qemut-win     5 xen-boot         fail in 14494 REGR. vs. 14482

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl           5 xen-boot                    fail pass in 14494

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin  5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14482

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-qemut-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-qemut-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win7-amd64  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1  1 xen-build-check(1)     blocked n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win-vcpus1  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-xend-qemut-winxpsp3  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-qemut-win     1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3 16 leak-check/check     fail in 14494 never pass
 test-amd64-i386-win          16 leak-check/check      fail in 14494 never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check  fail in 14494 never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop           fail in 14494 never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop     fail in 14494 never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop           fail in 14494 never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop     fail in 14494 never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check      fail in 14494 never pass

version targeted for testing:
 xen                  9d88ac6046d8
baseline version:
 xen                  1c69c938f641

------------------------------------------------------------
People who touched revisions under test:
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Kouya Shimura <kouya@jp.fujitsu.com>
  Roger Pau Monn? <roger.pau@citrix.com>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   fail    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           fail    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemut-rhel6hvm-amd                           blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemut-rhel6hvm-intel                         blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        fail    
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          fail    
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-qemut-win-vcpus1                             blocked 
 test-amd64-i386-xl-qemut-win-vcpus1                          blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    blocked 
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          blocked 
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26205:9d88ac6046d8
tag:         tip
user:        Roger Pau Monne <roger.pau@citrix.com>
date:        Thu Nov 29 11:28:18 2012 +0000
    
    docs: fix persistent grants doc typo
    
    Signed-off-by: Roger Pau Monn? <roger.pau@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- fix additional typo s/this grants/these grants/g ]
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26204:48e211812551
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 29 11:28:17 2012 +0000
    
    xen/arm: build as zImage
    
    The zImage format is extremely simple: it only consists of a magic
    number and 2 addresses in a specific position (see
    http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
    
    Some bootloaders expect a zImage; considering that it doesn't cost us
    much to build Xen compatible with the format, make it so.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- switch from 7*nop + nop to just 8*nop ]
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26203:b5cb6cccc32c
user:        Tim Deegan <tim@xen.org>
date:        Thu Nov 29 11:01:00 2012 +0000
    
    x86/hap: Fix memory leak of domain->arch.hvm_domain.dirty_vram
    
    Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    Committed-by: Tim Deegan <tim@xen.org>
    
    
changeset:   26202:9c6c13bf3803
user:        Tim Deegan <tim@xen.org>
date:        Thu Nov 29 10:49:53 2012 +0000
    
    x86/mm: Comment the definitions of _mfn(), _gfn() &c.
    
    It's not very easy to find them if you don't know to look for the
    TYPE_SAFE() macro.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Committed-by: Tim Deegan <tim@xen.org>
    
    
changeset:   26201:5d7e3c2742e8
user:        Jan Beulich <jbeulich@suse.com>
date:        Thu Nov 29 09:14:55 2012 +0100
    
    VT-d: make scope parsing code type safe
    
    Rather than requiring the scopes to be the first members of their
    respective structures (so that casts can be used to switch between the
    different views), properly use types and container_of().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by Xiantao Zhang <xiantao.zhang@intel.com>
    
    
changeset:   26200:836697b19746
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 17:00:56 2012 +0100
    
    IOMMU: imply "verbose" from "debug"
    
    I think that generally enabling debugging code without also enabling
    verbose output is rather pointless; if someone really wants this, they
    can always pass e.g. "iommu=debug,no-verbose".
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26199:1fce7522daa6
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:08:24 2012 +0100
    
    VT-d: adjust IOMMU interrupt affinities when all CPUs are online
    
    Since these interrupts get setup before APs get brought online, their
    affinities naturally could only ever point to CPU 0 alone so far.
    Adjust this to include potentially multiple CPUs in the target mask
    (when running in one of the cluster modes), and take into account NUMA
    information (to handle the interrupts on a CPU on the node where the
    respective IOMMU is).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26198:ba90ecb0231f
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:07:11 2012 +0100
    
    AMD IOMMU: include IOMMU interrupt information in 'M' debug key output
    
    Note that this also adds a few pieces missing from c/s
    25903:5e4a00b4114c (relevant only when the PCI MSI mask bit is
    supported by an IOMMU, which apparently isn't the case for existing
    implementations).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26197:0bc3a489018f
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:05:52 2012 +0100
    
    VT-d: include IOMMU interrupt information in 'M' debug key output
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26196:5faf5b8b702e
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:03:51 2012 +0100
    
    ACPI: fix return value of XEN_PM_PDC platform op
    
    Should return -EFAULT when copying to guest memory fails.
    
    Once touching this code, also switch to using the more relaxed copy
    function (copying from the same guest memory already validated the
    virtual address range).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26195:7670eabcbafc
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:02:26 2012 +0100
    
    x86: fix hypercall continuation cancellation in XENMAPSPACE_gmfn_range compat wrapper
    
    When no continuation was established, there must also not be an attempt
    to cancel it - hypercall_cancel_continuation(), in the non-HVM, non-
    multicall case, adjusts the guest mode return address in a way assuming
    that an earlier call hypercall_create_continuation() took place.
    
    Once touching this code, also restructure it slightly to improve
    readability and switch to using the more relaxed copy function (copying
    from the same guest memory already validated the virtual address
    range).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26194:0aa1c5136a54
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:01:33 2012 +0100
    
    README: adjust gcc version requirement
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26193:1c69c938f641
user:        George Dunlap <george.dunlap@eu.citrix.com>
date:        Tue Nov 27 14:13:41 2012 +0000
    
    libxl: Fix bug in libxl_cdrom_insert, make more robust against bad xenstore data
    
    libxl_cdrom_insert was failing to initialize the backend type,
    resulting in the wrong default backend.  The result was not only that
    the CD was not inserted properly, but also that some improper xenstore
    entries were created, causing further block commands to fail.
    
    This patch fixes the bug by setting the disk backend type based on the
    type of the existing device.
    
    It also makes the system more robust by checking to see that it has
    got a valid path before proceeding to write a partial xenstore entry.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 15:49:30 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 15:49:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeSqA-0006OS-U6; Fri, 30 Nov 2012 15:49:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeSq9-0006ON-2g
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 15:49:21 +0000
Received: from [193.109.254.147:63938] by server-2.bemta-14.messagelabs.com id
	D2/57-20829-085D8B05; Fri, 30 Nov 2012 15:49:20 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1354290559!2095077!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21343 invoked from network); 30 Nov 2012 15:49:19 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 15:49:19 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="16095619"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 15:48:44 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 15:48:44 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeSpY-0006qA-H4;
	Fri, 30 Nov 2012 15:48:44 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeSpY-00053g-6x;
	Fri, 30 Nov 2012 15:48:44 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14506-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 15:48:44 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14506: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14506 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14506/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-pv           5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-qemuu-win7-amd64  5 xen-boot          fail REGR. vs. 14482
 build-i386                    4 xen-build                 fail REGR. vs. 14482
 build-i386-oldkern            4 xen-build                 fail REGR. vs. 14482
 test-amd64-amd64-pair         8 xen-boot/dst_host         fail REGR. vs. 14482
 test-amd64-amd64-pair         7 xen-boot/src_host         fail REGR. vs. 14482
 test-amd64-amd64-xl-win       5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-win7-amd64  5 xen-boot                fail REGR. vs. 14482
 test-amd64-amd64-qemut-win    5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-qemut-win  5 xen-boot                 fail REGR. vs. 14482
 test-amd64-amd64-xl-qemut-winxpsp3  5 xen-boot            fail REGR. vs. 14482
 test-amd64-i386-qemut-rhel6hvm-amd  5 xen-boot   fail in 14494 REGR. vs. 14482
 test-amd64-i386-xl-multivcpu  5 xen-boot         fail in 14494 REGR. vs. 14482
 test-amd64-i386-xl            5 xen-boot         fail in 14494 REGR. vs. 14482
 test-amd64-i386-qemuu-rhel6hvm-amd  5 xen-boot   fail in 14494 REGR. vs. 14482
 test-amd64-i386-pair         8 xen-boot/dst_host fail in 14494 REGR. vs. 14482
 test-amd64-i386-pair         7 xen-boot/src_host fail in 14494 REGR. vs. 14482
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 5 xen-boot fail in 14494 REGR. vs. 14482
 test-amd64-i386-xl-winxpsp3-vcpus1  5 xen-boot   fail in 14494 REGR. vs. 14482
 test-amd64-i386-xend-qemut-winxpsp3  5 xen-boot  fail in 14494 REGR. vs. 14482
 test-amd64-i386-qemut-win     5 xen-boot         fail in 14494 REGR. vs. 14482

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl           5 xen-boot                    fail pass in 14494

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-sedf-pin  5 xen-boot                  fail REGR. vs. 14482
 test-amd64-amd64-xl-sedf      5 xen-boot                     fail   like 14482

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  9 guest-start                 fail never pass
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-qemut-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3 13 guest-stop               fail never pass
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win7-amd64 13 guest-stop             fail never pass
 test-amd64-i386-qemut-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-win         16 leak-check/check             fail   never pass
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win7-amd64  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3 13 guest-stop                   fail   never pass
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1  1 xen-build-check(1)     blocked n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win-vcpus1  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-xend-qemut-winxpsp3  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-qemut-win     1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3 16 leak-check/check     fail in 14494 never pass
 test-amd64-i386-win          16 leak-check/check      fail in 14494 never pass
 test-amd64-i386-qemut-win-vcpus1 16 leak-check/check  fail in 14494 never pass
 test-amd64-i386-xl-win-vcpus1 13 guest-stop           fail in 14494 never pass
 test-amd64-i386-xl-qemut-win7-amd64 13 guest-stop     fail in 14494 never pass
 test-amd64-i386-xl-win7-amd64 13 guest-stop           fail in 14494 never pass
 test-amd64-i386-xl-qemut-win-vcpus1 13 guest-stop     fail in 14494 never pass
 test-amd64-i386-win-vcpus1   16 leak-check/check      fail in 14494 never pass

version targeted for testing:
 xen                  9d88ac6046d8
baseline version:
 xen                  1c69c938f641

------------------------------------------------------------
People who touched revisions under test:
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Keir Fraser <keir@xen.org>
  Kouya Shimura <kouya@jp.fujitsu.com>
  Roger Pau Monn? <roger.pau@citrix.com>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
------------------------------------------------------------

jobs:
 build-amd64                                                  pass    
 build-i386                                                   fail    
 build-amd64-oldkern                                          pass    
 build-i386-oldkern                                           fail    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemut-rhel6hvm-amd                           blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-win7-amd64                               fail    
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              fail    
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemut-rhel6hvm-intel                         blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        fail    
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 fail    
 test-amd64-amd64-pv                                          fail    
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     fail    
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-qemut-win-vcpus1                             blocked 
 test-amd64-i386-xl-qemut-win-vcpus1                          blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         fail    
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-qemut-win                                   fail    
 test-amd64-i386-qemut-win                                    blocked 
 test-amd64-amd64-xl-qemut-win                                fail    
 test-amd64-amd64-xl-win                                      fail    
 test-amd64-i386-xend-qemut-winxpsp3                          blocked 
 test-amd64-amd64-xl-qemut-winxpsp3                           fail    
 test-amd64-amd64-xl-qemuu-winxpsp3                           fail    
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
changeset:   26205:9d88ac6046d8
tag:         tip
user:        Roger Pau Monne <roger.pau@citrix.com>
date:        Thu Nov 29 11:28:18 2012 +0000
    
    docs: fix persistent grants doc typo
    
    Signed-off-by: Roger Pau Monn? <roger.pau@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- fix additional typo s/this grants/these grants/g ]
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26204:48e211812551
user:        Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date:        Thu Nov 29 11:28:17 2012 +0000
    
    xen/arm: build as zImage
    
    The zImage format is extremely simple: it only consists of a magic
    number and 2 addresses in a specific position (see
    http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).
    
    Some bootloaders expect a zImage; considering that it doesn't cost us
    much to build Xen compatible with the format, make it so.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- switch from 7*nop + nop to just 8*nop ]
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
changeset:   26203:b5cb6cccc32c
user:        Tim Deegan <tim@xen.org>
date:        Thu Nov 29 11:01:00 2012 +0000
    
    x86/hap: Fix memory leak of domain->arch.hvm_domain.dirty_vram
    
    Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    Committed-by: Tim Deegan <tim@xen.org>
    
    
changeset:   26202:9c6c13bf3803
user:        Tim Deegan <tim@xen.org>
date:        Thu Nov 29 10:49:53 2012 +0000
    
    x86/mm: Comment the definitions of _mfn(), _gfn() &c.
    
    It's not very easy to find them if you don't know to look for the
    TYPE_SAFE() macro.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Committed-by: Tim Deegan <tim@xen.org>
    
    
changeset:   26201:5d7e3c2742e8
user:        Jan Beulich <jbeulich@suse.com>
date:        Thu Nov 29 09:14:55 2012 +0100
    
    VT-d: make scope parsing code type safe
    
    Rather than requiring the scopes to be the first members of their
    respective structures (so that casts can be used to switch between the
    different views), properly use types and container_of().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by Xiantao Zhang <xiantao.zhang@intel.com>
    
    
changeset:   26200:836697b19746
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 17:00:56 2012 +0100
    
    IOMMU: imply "verbose" from "debug"
    
    I think that generally enabling debugging code without also enabling
    verbose output is rather pointless; if someone really wants this, they
    can always pass e.g. "iommu=debug,no-verbose".
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26199:1fce7522daa6
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:08:24 2012 +0100
    
    VT-d: adjust IOMMU interrupt affinities when all CPUs are online
    
    Since these interrupts get setup before APs get brought online, their
    affinities naturally could only ever point to CPU 0 alone so far.
    Adjust this to include potentially multiple CPUs in the target mask
    (when running in one of the cluster modes), and take into account NUMA
    information (to handle the interrupts on a CPU on the node where the
    respective IOMMU is).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26198:ba90ecb0231f
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:07:11 2012 +0100
    
    AMD IOMMU: include IOMMU interrupt information in 'M' debug key output
    
    Note that this also adds a few pieces missing from c/s
    25903:5e4a00b4114c (relevant only when the PCI MSI mask bit is
    supported by an IOMMU, which apparently isn't the case for existing
    implementations).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26197:0bc3a489018f
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:05:52 2012 +0100
    
    VT-d: include IOMMU interrupt information in 'M' debug key output
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26196:5faf5b8b702e
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:03:51 2012 +0100
    
    ACPI: fix return value of XEN_PM_PDC platform op
    
    Should return -EFAULT when copying to guest memory fails.
    
    Once touching this code, also switch to using the more relaxed copy
    function (copying from the same guest memory already validated the
    virtual address range).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26195:7670eabcbafc
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:02:26 2012 +0100
    
    x86: fix hypercall continuation cancellation in XENMAPSPACE_gmfn_range compat wrapper
    
    When no continuation was established, there must also not be an attempt
    to cancel it - hypercall_cancel_continuation(), in the non-HVM, non-
    multicall case, adjusts the guest mode return address in a way assuming
    that an earlier call hypercall_create_continuation() took place.
    
    Once touching this code, also restructure it slightly to improve
    readability and switch to using the more relaxed copy function (copying
    from the same guest memory already validated the virtual address
    range).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26194:0aa1c5136a54
user:        Jan Beulich <jbeulich@suse.com>
date:        Wed Nov 28 10:01:33 2012 +0100
    
    README: adjust gcc version requirement
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    
changeset:   26193:1c69c938f641
user:        George Dunlap <george.dunlap@eu.citrix.com>
date:        Tue Nov 27 14:13:41 2012 +0000
    
    libxl: Fix bug in libxl_cdrom_insert, make more robust against bad xenstore data
    
    libxl_cdrom_insert was failing to initialize the backend type,
    resulting in the wrong default backend.  The result was not only that
    the CD was not inserted properly, but also that some improper xenstore
    entries were created, causing further block commands to fail.
    
    This patch fixes the bug by setting the disk backend type based on the
    type of the existing device.
    
    It also makes the system more robust by checking to see that it has
    got a valid path before proceeding to write a partial xenstore entry.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Committed-by: Ian Campbell <ian.campbell@citrix.com>
    
    
(qemu changes not included)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:07:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:07:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeT7U-0007NJ-LS; Fri, 30 Nov 2012 16:07:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <marmarek@invisiblethingslab.com>) id 1TeT7S-0007NE-NY
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 16:07:14 +0000
Received: from [193.109.254.147:12883] by server-1.bemta-14.messagelabs.com id
	4E/A4-25314-1B9D8B05; Fri, 30 Nov 2012 16:07:13 +0000
X-Env-Sender: marmarek@invisiblethingslab.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1354291630!1248264!1
X-Originating-IP: [66.111.4.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTExLjQuMjggPT4gOTc3Mg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27730 invoked from network); 30 Nov 2012 16:07:11 -0000
Received: from out4-smtp.messagingengine.com (HELO
	out4-smtp.messagingengine.com) (66.111.4.28)
	by server-7.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 30 Nov 2012 16:07:11 -0000
Received: from compute3.internal (compute3.nyi.mail.srv.osa [10.202.2.43])
	by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 8E99B2195F;
	Fri, 30 Nov 2012 11:07:10 -0500 (EST)
Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161])
	by compute3.internal (MEProxy); Fri, 30 Nov 2012 11:07:10 -0500
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=message-id:date:from:mime-version:to
	:cc:subject:references:in-reply-to:content-type; s=mesmtp; bh=li
	uZyKxDpfS8QqDUBjf09hVhlgE=; b=Yp+mmTmEq7xXGSzaEPtkqK1c05h3CGOOAU
	5qYlMBGPoyUeK5KuaTDnl0sFvpgPzYFgXVzAFVIUgzbVOWyEdADaOt8XL7LauIW7
	paNauI9p1lq0g8swtwCJ40E52FXVGIu/M9ze+oMYtYBj9fhBAlFnwqj6syGTLouq
	HcyF2EB6o=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	messagingengine.com; h=message-id:date:from:mime-version:to:cc
	:subject:references:in-reply-to:content-type; s=smtpout; bh=liuZ
	yKxDpfS8QqDUBjf09hVhlgE=; b=PcUTfrG+w/gIZ0j4lEkHbwt+um+o5MuqmI9i
	aztM54Ad7LOx3l3CZOIEmBgGjzZbT4pjbU/jALQXGgy8Nh7xm0CNnZXdHA/PT36/
	DveFwJkfx/if3oa4TTUKhUyABCFUzNNws4U/6bHIE8cPCzW57a5LxZ+WVEH1E3Dy
	wyPcx/U=
X-Sasl-enc: PE9vq9cYjsKksqOsFMIRVgpP5x5Q8ofD5ToQRg/Y2cdK 1354291630
Received: from [10.137.1.17] (unknown [93.157.76.159])
	by mail.messagingengine.com (Postfix) with ESMTPA id E9BB54827CD;
	Fri, 30 Nov 2012 11:07:09 -0500 (EST)
Message-ID: <50B8D9A9.60502@invisiblethingslab.com>
Date: Fri, 30 Nov 2012 17:07:05 +0100
From: Marek Marczykowski <marmarek@invisiblethingslab.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <50B7AF8A.5010304@invisiblethingslab.com>
	<50B88B8402000078000ACC4C@nat28.tlf.novell.com>
In-Reply-To: <50B88B8402000078000ACC4C@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Only CPU0 active after ACPI S3, xen 4.1.3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6056331424479770381=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============6056331424479770381==
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="------------enig294C97DFEFAF07894B7CFEF5"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig294C97DFEFAF07894B7CFEF5
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 30.11.2012 10:33, Jan Beulich wrote:
>>>> On 29.11.12 at 19:55, Marek Marczykowski <marmarek@invisiblethingsla=
b.com> wrote:
>> After resume from ACPI S3 system has only CPU0 enabled, every vCPU fro=
m=20
>> every
>> domain works on CPU0 [1].  When trying to pin some vCPU to CPU1 got er=
ror:
>> xl vcpu-pin testvm 1 1
>> libxl: error: libxl.c:2565:libxl_set_vcpuaffinity setting vcpu affinit=
y:
>> Invalid argument
>>
>> What went wrong? How can I reenable CPU1-CPU3?
>=20
> According to the "xl dmesg" output you sent, CPU1-3 are all
> online (their presence in the output following "Dumping timer
> queues:" confirms this). So I suppose you will need to go do
> some debugging to find out where and why the set-affinity
> operation fails, and/or why the scheduler puts everything on
> a single pCPU (if it really does, the output of "xl vcpu-list" is
> only a hint towards that). Rather than using 'c', 'r' might have
> been the more useful debug key.

That was the rare case when resume worked at all... in most cased I've go=
t
reboot, before anything appear on the screen (even backlight is off) - xe=
n
panic? dom0 kernel panic?
I've already rebooted the system, will try above debug key next time.

I don't have serial console, but have USB-to-serial port - is it possible=
 to
use it as xen console (in xen 4.1.3)?

--=20
Best Regards / Pozdrawiam,
Marek Marczykowski
Invisible Things Lab


--------------enig294C97DFEFAF07894B7CFEF5
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQEcBAEBAgAGBQJQuNmpAAoJENuP0xzK19cs9VYIAJn4wF1v3BuftMQIFeFuyKvi
WsFn2taQEKaJ77mODvv7gu5qHOAZU8qf8JWoouePKRvHfDtN5/iASHo8myLipCBX
qxGk1p9u6+rsHoRh7i65EthKc1fyIX9KWp5ZNLVHZSLH6imT8d+RcNH45Xv+HMX4
1jOgpO0lXi3JSvvsbRAvkAG/2ZNZdsonjplCty+hQCeWrNCeM+snWe+YOwaJMzT5
s3mp2XTR8lmJc7AZQHswA9pOgRu9Ym4lzV9njLScFQ5c2QZD6zexon8g+rAhIf+8
dKmo7t8cXkI0xrk+fZhstkEbgKdVFm/UkGMx/azfAN5mVklRYvfq1FZVUDzTcg4=
=rxGb
-----END PGP SIGNATURE-----

--------------enig294C97DFEFAF07894B7CFEF5--


--===============6056331424479770381==
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.xen.org
http://lists.xen.org/xen-devel

--===============6056331424479770381==--


From xen-devel-bounces@lists.xen.org Fri Nov 30 16:07:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:07:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeT7U-0007NJ-LS; Fri, 30 Nov 2012 16:07:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <marmarek@invisiblethingslab.com>) id 1TeT7S-0007NE-NY
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 16:07:14 +0000
Received: from [193.109.254.147:12883] by server-1.bemta-14.messagelabs.com id
	4E/A4-25314-1B9D8B05; Fri, 30 Nov 2012 16:07:13 +0000
X-Env-Sender: marmarek@invisiblethingslab.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1354291630!1248264!1
X-Originating-IP: [66.111.4.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTExLjQuMjggPT4gOTc3Mg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27730 invoked from network); 30 Nov 2012 16:07:11 -0000
Received: from out4-smtp.messagingengine.com (HELO
	out4-smtp.messagingengine.com) (66.111.4.28)
	by server-7.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 30 Nov 2012 16:07:11 -0000
Received: from compute3.internal (compute3.nyi.mail.srv.osa [10.202.2.43])
	by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 8E99B2195F;
	Fri, 30 Nov 2012 11:07:10 -0500 (EST)
Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161])
	by compute3.internal (MEProxy); Fri, 30 Nov 2012 11:07:10 -0500
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=message-id:date:from:mime-version:to
	:cc:subject:references:in-reply-to:content-type; s=mesmtp; bh=li
	uZyKxDpfS8QqDUBjf09hVhlgE=; b=Yp+mmTmEq7xXGSzaEPtkqK1c05h3CGOOAU
	5qYlMBGPoyUeK5KuaTDnl0sFvpgPzYFgXVzAFVIUgzbVOWyEdADaOt8XL7LauIW7
	paNauI9p1lq0g8swtwCJ40E52FXVGIu/M9ze+oMYtYBj9fhBAlFnwqj6syGTLouq
	HcyF2EB6o=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	messagingengine.com; h=message-id:date:from:mime-version:to:cc
	:subject:references:in-reply-to:content-type; s=smtpout; bh=liuZ
	yKxDpfS8QqDUBjf09hVhlgE=; b=PcUTfrG+w/gIZ0j4lEkHbwt+um+o5MuqmI9i
	aztM54Ad7LOx3l3CZOIEmBgGjzZbT4pjbU/jALQXGgy8Nh7xm0CNnZXdHA/PT36/
	DveFwJkfx/if3oa4TTUKhUyABCFUzNNws4U/6bHIE8cPCzW57a5LxZ+WVEH1E3Dy
	wyPcx/U=
X-Sasl-enc: PE9vq9cYjsKksqOsFMIRVgpP5x5Q8ofD5ToQRg/Y2cdK 1354291630
Received: from [10.137.1.17] (unknown [93.157.76.159])
	by mail.messagingengine.com (Postfix) with ESMTPA id E9BB54827CD;
	Fri, 30 Nov 2012 11:07:09 -0500 (EST)
Message-ID: <50B8D9A9.60502@invisiblethingslab.com>
Date: Fri, 30 Nov 2012 17:07:05 +0100
From: Marek Marczykowski <marmarek@invisiblethingslab.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Jan Beulich <JBeulich@suse.com>
References: <50B7AF8A.5010304@invisiblethingslab.com>
	<50B88B8402000078000ACC4C@nat28.tlf.novell.com>
In-Reply-To: <50B88B8402000078000ACC4C@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Only CPU0 active after ACPI S3, xen 4.1.3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6056331424479770381=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============6056331424479770381==
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="------------enig294C97DFEFAF07894B7CFEF5"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig294C97DFEFAF07894B7CFEF5
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 30.11.2012 10:33, Jan Beulich wrote:
>>>> On 29.11.12 at 19:55, Marek Marczykowski <marmarek@invisiblethingsla=
b.com> wrote:
>> After resume from ACPI S3 system has only CPU0 enabled, every vCPU fro=
m=20
>> every
>> domain works on CPU0 [1].  When trying to pin some vCPU to CPU1 got er=
ror:
>> xl vcpu-pin testvm 1 1
>> libxl: error: libxl.c:2565:libxl_set_vcpuaffinity setting vcpu affinit=
y:
>> Invalid argument
>>
>> What went wrong? How can I reenable CPU1-CPU3?
>=20
> According to the "xl dmesg" output you sent, CPU1-3 are all
> online (their presence in the output following "Dumping timer
> queues:" confirms this). So I suppose you will need to go do
> some debugging to find out where and why the set-affinity
> operation fails, and/or why the scheduler puts everything on
> a single pCPU (if it really does, the output of "xl vcpu-list" is
> only a hint towards that). Rather than using 'c', 'r' might have
> been the more useful debug key.

That was the rare case when resume worked at all... in most cased I've go=
t
reboot, before anything appear on the screen (even backlight is off) - xe=
n
panic? dom0 kernel panic?
I've already rebooted the system, will try above debug key next time.

I don't have serial console, but have USB-to-serial port - is it possible=
 to
use it as xen console (in xen 4.1.3)?

--=20
Best Regards / Pozdrawiam,
Marek Marczykowski
Invisible Things Lab


--------------enig294C97DFEFAF07894B7CFEF5
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQEcBAEBAgAGBQJQuNmpAAoJENuP0xzK19cs9VYIAJn4wF1v3BuftMQIFeFuyKvi
WsFn2taQEKaJ77mODvv7gu5qHOAZU8qf8JWoouePKRvHfDtN5/iASHo8myLipCBX
qxGk1p9u6+rsHoRh7i65EthKc1fyIX9KWp5ZNLVHZSLH6imT8d+RcNH45Xv+HMX4
1jOgpO0lXi3JSvvsbRAvkAG/2ZNZdsonjplCty+hQCeWrNCeM+snWe+YOwaJMzT5
s3mp2XTR8lmJc7AZQHswA9pOgRu9Ym4lzV9njLScFQ5c2QZD6zexon8g+rAhIf+8
dKmo7t8cXkI0xrk+fZhstkEbgKdVFm/UkGMx/azfAN5mVklRYvfq1FZVUDzTcg4=
=rxGb
-----END PGP SIGNATURE-----

--------------enig294C97DFEFAF07894B7CFEF5--


--===============6056331424479770381==
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.xen.org
http://lists.xen.org/xen-devel

--===============6056331424479770381==--


From xen-devel-bounces@lists.xen.org Fri Nov 30 16:12:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:12:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTC1-0007ex-0E; Fri, 30 Nov 2012 16:11:57 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TeTC0-0007es-Dm
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 16:11:56 +0000
Received: from [85.158.139.83:32825] by server-11.bemta-5.messagelabs.com id
	61/26-03409-BCAD8B05; Fri, 30 Nov 2012 16:11:55 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1354291913!27846308!1
X-Originating-IP: [209.85.160.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31672 invoked from network); 30 Nov 2012 16:11:54 -0000
Received: from mail-gh0-f173.google.com (HELO mail-gh0-f173.google.com)
	(209.85.160.173)
	by server-3.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:11:54 -0000
Received: by mail-gh0-f173.google.com with SMTP id 16so96509ghy.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 08:11:53 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=L8Gsqk6Es5/yZy4MkOmV4Rsgb7KFvmFlcUg6cRbljRU=;
	b=teYwTYs9rGBW/j85tn0G/ZBoGFm9YTM+UMefnephUFs1tAHhgUpVLTmG3pTMJgF4CJ
	9qlxA7URorqbEDBeaR8GCsoEN1Zhj+OqfnC0/9Mqt9SSH0xwoE0ODZbX2NtlQT9F3pWE
	MKpRjePHk74Vazz5bSvcgD+jap/2Y/wDbZAjfoRTd/Whf42ZJJbuG/F5ZuFGP8Nhol1l
	mkrdPKJ9547zKsd4cfJXt8pe8YCH4kGOenbka/K3FBh3L0qVMkvRFI8xvmxkkrcqweXH
	0gluIRTLwMk07rmJO/QgDfYurF1+xgvCJAz+xTbnzkSq2xwwn+Ytg+EyEbtd6br/3kCE
	mbfA==
Received: by 10.236.84.194 with SMTP id s42mr1779802yhe.17.1354291913549;
	Fri, 30 Nov 2012 08:11:53 -0800 (PST)
Received: from localhost.localdomain (mcb2536d0.tmodns.net. [208.54.37.203])
	by mx.google.com with ESMTPS id s21sm5245955yhb.5.2012.11.30.08.11.51
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 30 Nov 2012 08:11:53 -0800 (PST)
Date: Fri, 30 Nov 2012 11:11:40 -0500
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121130161134.GA5420@localhost.localdomain>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
	<1353668646.13542.228.camel@zakaz.uk.xensource.com>
	<20121128204630.GB3479@phenom.dumpdata.com>
	<50B68EC3.1070803@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B68EC3.1070803@jhuapl.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 05:22:59PM -0500, Matthew Fioravante wrote:
> On 11/28/2012 03:46 PM, Konrad Rzeszutek Wilk wrote:
> >On Fri, Nov 23, 2012 at 11:04:06AM +0000, Ian Campbell wrote:
> >>On Tue, 2012-11-20 at 16:16 +0000, Fioravante, Matthew E. wrote:
> >>>This was something I've been wanting to do for a while so I'm very
> >>>happy you went ahead and fixed it yourself. Once you submit the linux
> >>>version I'll test it on my system.
> >>>
> >>>Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> >>Do we need to synchronise with anything else (Linux drivers?) or I can I
> >>just throw this into the tree once it is done?
> >>
> >>Are we hanging any existing users of the tpm stuff out to dry? Could we
> >>get a feature-protocol-v2 flag in xenstore so users at least get an
> >>error message from either the front or backend to give a hint why it
> >>isn't working?
> >We could cop out and just name this new driver differently. Then
> >we would not have to deal with the older ones.
> I've already done that with my patch on the linux mailing list. The
> old frontend driver name was tpm_xenu.ko, the new one is
> xen-tpmfront.ko.

I meant the XenBus directory name. It is 'vtpm' - if it was called
'vtpm2' we would avoid the "older" drivers from even seeing this one.
> >
> >>>  void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)  {
> >>>-   tpmif_tx_request_t* tx;
> >>>-   int offset;
> >>>-   int i;
> >>>-   uint32_t domid;
> >>>-   int tocopy;
> >>>+   vtpm_shared_page_t* shr;
> >>>+   unsigned int offset;
> >>>     int flags;
> >>>+#ifdef TPMBACK_PRINT_DEBUG
> >>>+int i;
> >>>+#endif
> >>Dodgy indentation? (I saw a bunch of these)
> >>
> >>>- * Copyright (c) 2005, IBM Corporation
> >>>- *
> >>>- * Author: Stefan Berger, stefanb@us.ibm.com
> >>>- * Grant table support: Mahadevan Gomathisankaran
> >>Did you really remove everything these guys wrote?
> >>
> >>>- * This code has been derived from tools/libxc/xen/io/netif.h
> >>>- *
> >>>- * Copyright (c) 2003-2004, Keir Fraser
> >>I guess I can buy this bit no longer being true given that you reworked
> >>the whole protocol.
> >>
> >>Ian
> >>
> >>
> >>_______________________________________________
> >>Xen-devel mailing list
> >>Xen-devel@lists.xen.org
> >>http://lists.xen.org/xen-devel
> >>
> 
> 



> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:12:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:12:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTC1-0007ex-0E; Fri, 30 Nov 2012 16:11:57 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TeTC0-0007es-Dm
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 16:11:56 +0000
Received: from [85.158.139.83:32825] by server-11.bemta-5.messagelabs.com id
	61/26-03409-BCAD8B05; Fri, 30 Nov 2012 16:11:55 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1354291913!27846308!1
X-Originating-IP: [209.85.160.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31672 invoked from network); 30 Nov 2012 16:11:54 -0000
Received: from mail-gh0-f173.google.com (HELO mail-gh0-f173.google.com)
	(209.85.160.173)
	by server-3.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:11:54 -0000
Received: by mail-gh0-f173.google.com with SMTP id 16so96509ghy.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 08:11:53 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=L8Gsqk6Es5/yZy4MkOmV4Rsgb7KFvmFlcUg6cRbljRU=;
	b=teYwTYs9rGBW/j85tn0G/ZBoGFm9YTM+UMefnephUFs1tAHhgUpVLTmG3pTMJgF4CJ
	9qlxA7URorqbEDBeaR8GCsoEN1Zhj+OqfnC0/9Mqt9SSH0xwoE0ODZbX2NtlQT9F3pWE
	MKpRjePHk74Vazz5bSvcgD+jap/2Y/wDbZAjfoRTd/Whf42ZJJbuG/F5ZuFGP8Nhol1l
	mkrdPKJ9547zKsd4cfJXt8pe8YCH4kGOenbka/K3FBh3L0qVMkvRFI8xvmxkkrcqweXH
	0gluIRTLwMk07rmJO/QgDfYurF1+xgvCJAz+xTbnzkSq2xwwn+Ytg+EyEbtd6br/3kCE
	mbfA==
Received: by 10.236.84.194 with SMTP id s42mr1779802yhe.17.1354291913549;
	Fri, 30 Nov 2012 08:11:53 -0800 (PST)
Received: from localhost.localdomain (mcb2536d0.tmodns.net. [208.54.37.203])
	by mx.google.com with ESMTPS id s21sm5245955yhb.5.2012.11.30.08.11.51
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 30 Nov 2012 08:11:53 -0800 (PST)
Date: Fri, 30 Nov 2012 11:11:40 -0500
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Message-ID: <20121130161134.GA5420@localhost.localdomain>
References: <1353427860-17330-1-git-send-email-dgdegra@tycho.nsa.gov>
	<068F06DC4D106941B297C0C5F9F446EA48B7649849@aplesstripe.dom1.jhuapl.edu>
	<1353668646.13542.228.camel@zakaz.uk.xensource.com>
	<20121128204630.GB3479@phenom.dumpdata.com>
	<50B68EC3.1070803@jhuapl.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B68EC3.1070803@jhuapl.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH RFC] stubdom: Change vTPM shared page ABI
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Wed, Nov 28, 2012 at 05:22:59PM -0500, Matthew Fioravante wrote:
> On 11/28/2012 03:46 PM, Konrad Rzeszutek Wilk wrote:
> >On Fri, Nov 23, 2012 at 11:04:06AM +0000, Ian Campbell wrote:
> >>On Tue, 2012-11-20 at 16:16 +0000, Fioravante, Matthew E. wrote:
> >>>This was something I've been wanting to do for a while so I'm very
> >>>happy you went ahead and fixed it yourself. Once you submit the linux
> >>>version I'll test it on my system.
> >>>
> >>>Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
> >>Do we need to synchronise with anything else (Linux drivers?) or I can I
> >>just throw this into the tree once it is done?
> >>
> >>Are we hanging any existing users of the tpm stuff out to dry? Could we
> >>get a feature-protocol-v2 flag in xenstore so users at least get an
> >>error message from either the front or backend to give a hint why it
> >>isn't working?
> >We could cop out and just name this new driver differently. Then
> >we would not have to deal with the older ones.
> I've already done that with my patch on the linux mailing list. The
> old frontend driver name was tpm_xenu.ko, the new one is
> xen-tpmfront.ko.

I meant the XenBus directory name. It is 'vtpm' - if it was called
'vtpm2' we would avoid the "older" drivers from even seeing this one.
> >
> >>>  void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)  {
> >>>-   tpmif_tx_request_t* tx;
> >>>-   int offset;
> >>>-   int i;
> >>>-   uint32_t domid;
> >>>-   int tocopy;
> >>>+   vtpm_shared_page_t* shr;
> >>>+   unsigned int offset;
> >>>     int flags;
> >>>+#ifdef TPMBACK_PRINT_DEBUG
> >>>+int i;
> >>>+#endif
> >>Dodgy indentation? (I saw a bunch of these)
> >>
> >>>- * Copyright (c) 2005, IBM Corporation
> >>>- *
> >>>- * Author: Stefan Berger, stefanb@us.ibm.com
> >>>- * Grant table support: Mahadevan Gomathisankaran
> >>Did you really remove everything these guys wrote?
> >>
> >>>- * This code has been derived from tools/libxc/xen/io/netif.h
> >>>- *
> >>>- * Copyright (c) 2003-2004, Keir Fraser
> >>I guess I can buy this bit no longer being true given that you reworked
> >>the whole protocol.
> >>
> >>Ian
> >>
> >>
> >>_______________________________________________
> >>Xen-devel mailing list
> >>Xen-devel@lists.xen.org
> >>http://lists.xen.org/xen-devel
> >>
> 
> 



> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:14:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:14:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTDt-0007ps-M8; Fri, 30 Nov 2012 16:13:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jbeulich@suse.com>) id 1TeTDr-0007pf-VF
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 16:13:52 +0000
Received: from [85.158.143.35:3576] by server-2.bemta-4.messagelabs.com id
	69/32-28922-F3BD8B05; Fri, 30 Nov 2012 16:13:51 +0000
X-Env-Sender: jbeulich@suse.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354291948!15670715!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2999 invoked from network); 30 Nov 2012 16:12:28 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 16:12:28 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 16:12:27 +0000
Message-Id: <50B8DAEA0200007800090B69@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 16:12:26 +0000
From: "Jan Beulich" <jbeulich@suse.com>
To: <marmarek@invisiblethingslab.com>
References: <50B7AF8A.5010304@invisiblethingslab.com>
	<50B88B8402000078000ACC4C@nat28.tlf.novell.com>
	<50B8D9A9.60502@invisiblethingslab.com>
In-Reply-To: <50B8D9A9.60502@invisiblethingslab.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Only CPU0 active after ACPI S3, xen 4.1.3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> Marek Marczykowski <marmarek@invisiblethingslab.com> 11/30/12 5:07 PM >>>
>That was the rare case when resume worked at all... in most cased I've got
>reboot, before anything appear on the screen (even backlight is off) - xen
>panic? dom0 kernel panic?

Without serial console we won't get very far from here.

>I don't have serial console, but have USB-to-serial port - is it possible to
>use it as xen console (in xen 4.1.3)?

Not that I'm aware of. But 4.1.x isn't very interesting from a development
perspective anyway. If you had the same problems still with 4.3-unstable,
then that's be of much more interest to analyze, and you could use the
EHCI debug port (if one of your controllers has one) based serial console.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:14:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:14:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTDt-0007ps-M8; Fri, 30 Nov 2012 16:13:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jbeulich@suse.com>) id 1TeTDr-0007pf-VF
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 16:13:52 +0000
Received: from [85.158.143.35:3576] by server-2.bemta-4.messagelabs.com id
	69/32-28922-F3BD8B05; Fri, 30 Nov 2012 16:13:51 +0000
X-Env-Sender: jbeulich@suse.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354291948!15670715!1
X-Originating-IP: [130.57.49.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2999 invoked from network); 30 Nov 2012 16:12:28 -0000
Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28)
	by server-6.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 16:12:28 -0000
Received: from EMEA1-MTA by nat28.tlf.novell.com
	with Novell_GroupWise; Fri, 30 Nov 2012 16:12:27 +0000
Message-Id: <50B8DAEA0200007800090B69@nat28.tlf.novell.com>
X-Mailer: Novell GroupWise Internet Agent 12.0.1 
Date: Fri, 30 Nov 2012 16:12:26 +0000
From: "Jan Beulich" <jbeulich@suse.com>
To: <marmarek@invisiblethingslab.com>
References: <50B7AF8A.5010304@invisiblethingslab.com>
	<50B88B8402000078000ACC4C@nat28.tlf.novell.com>
	<50B8D9A9.60502@invisiblethingslab.com>
In-Reply-To: <50B8D9A9.60502@invisiblethingslab.com>
Mime-Version: 1.0
Content-Disposition: inline
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Only CPU0 active after ACPI S3, xen 4.1.3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>>> Marek Marczykowski <marmarek@invisiblethingslab.com> 11/30/12 5:07 PM >>>
>That was the rare case when resume worked at all... in most cased I've got
>reboot, before anything appear on the screen (even backlight is off) - xen
>panic? dom0 kernel panic?

Without serial console we won't get very far from here.

>I don't have serial console, but have USB-to-serial port - is it possible to
>use it as xen console (in xen 4.1.3)?

Not that I'm aware of. But 4.1.x isn't very interesting from a development
perspective anyway. If you had the same problems still with 4.3-unstable,
then that's be of much more interest to analyze, and you could use the
EHCI debug port (if one of your controllers has one) based serial console.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:18:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:18:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTIX-0008DW-Dt; Fri, 30 Nov 2012 16:18:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <marmarek@invisiblethingslab.com>) id 1TeTIV-0008DA-Ny
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 16:18:39 +0000
Received: from [85.158.139.211:22239] by server-14.bemta-5.messagelabs.com id
	42/75-21768-E5CD8B05; Fri, 30 Nov 2012 16:18:38 +0000
X-Env-Sender: marmarek@invisiblethingslab.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1354292317!18556790!1
X-Originating-IP: [66.111.4.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTExLjQuMjggPT4gOTc3Mg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24430 invoked from network); 30 Nov 2012 16:18:37 -0000
Received: from out4-smtp.messagingengine.com (HELO
	out4-smtp.messagingengine.com) (66.111.4.28)
	by server-2.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 30 Nov 2012 16:18:37 -0000
Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41])
	by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id DB38520CF9;
	Fri, 30 Nov 2012 11:18:36 -0500 (EST)
Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160])
	by compute1.internal (MEProxy); Fri, 30 Nov 2012 11:18:36 -0500
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=message-id:date:from:mime-version:to
	:cc:subject:references:in-reply-to:content-type; s=mesmtp; bh=K5
	a6qxrHw5znLkIxGmZQZ469PUA=; b=d8Ob0potcXjTJObVVxlq5aM9gRC+rklDL8
	rWZ2gxqloLdD3kJykqr8dDUZ95VQnSkt15EPzUI30TDAmPtfSQT3QPJnjdevURR3
	ordn+qpQd7cRyXGYWVUxXRXZej+4oC57sDtKw+oy9118MiKwVDINClLckHxE76Vo
	9D26JfJrM=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	messagingengine.com; h=message-id:date:from:mime-version:to:cc
	:subject:references:in-reply-to:content-type; s=smtpout; bh=K5a6
	qxrHw5znLkIxGmZQZ469PUA=; b=MoPteQLJZwY4VA9r6WUFsczYctfD9GptSu0U
	MGbd8rRsSzliZkpbLqNiZgszk5gXoUec031Ep88ArGWAHeS//GPXiq3MfYeAxVTC
	gQPh4+9jMC+1uRvBELvm36ZKDmKXIq5JlyGFzK2vRDHvkfIbnPiMl56DTZUC24Se
	jeUonbo=
X-Sasl-enc: FjC3wbd8q+6fT5Amwt3oJx3Lt1kZuzxqULwnopWIYzKI 1354292316
Received: from [10.137.1.17] (unknown [93.157.76.159])
	by mail.messagingengine.com (Postfix) with ESMTPA id 4E77D8E05B2;
	Fri, 30 Nov 2012 11:18:36 -0500 (EST)
Message-ID: <50B8DC55.8000308@invisiblethingslab.com>
Date: Fri, 30 Nov 2012 17:18:29 +0100
From: Marek Marczykowski <marmarek@invisiblethingslab.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Jan Beulich <jbeulich@suse.com>
References: <50B7AF8A.5010304@invisiblethingslab.com>
	<50B88B8402000078000ACC4C@nat28.tlf.novell.com>
	<50B8D9A9.60502@invisiblethingslab.com>
	<50B8DAEA0200007800090B69@nat28.tlf.novell.com>
In-Reply-To: <50B8DAEA0200007800090B69@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Only CPU0 active after ACPI S3, xen 4.1.3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5592382265226605842=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============5592382265226605842==
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="------------enig5CAC63FB70C107FACBF2E0D5"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig5CAC63FB70C107FACBF2E0D5
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 30.11.2012 17:12, Jan Beulich wrote:
>>>> Marek Marczykowski <marmarek@invisiblethingslab.com> 11/30/12 5:07 P=
M >>>
>> That was the rare case when resume worked at all... in most cased I've=
 got
>> reboot, before anything appear on the screen (even backlight is off) -=
 xen
>> panic? dom0 kernel panic?
>=20
> Without serial console we won't get very far from here.
>=20
>> I don't have serial console, but have USB-to-serial port - is it possi=
ble to
>> use it as xen console (in xen 4.1.3)?
>=20
> Not that I'm aware of. But 4.1.x isn't very interesting from a developm=
ent
> perspective anyway. If you had the same problems still with 4.3-unstabl=
e,
> then that's be of much more interest to analyze, and you could use the
> EHCI debug port (if one of your controllers has one) based serial conso=
le.

Is it possible to use libxl from xen 4.1 with newer hypervisor? My libxl =
is
somehow patched and porting it to newer version will require some effort.=


--=20
Best Regards / Pozdrawiam,
Marek Marczykowski
Invisible Things Lab


--------------enig5CAC63FB70C107FACBF2E0D5
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQEcBAEBAgAGBQJQuNxWAAoJENuP0xzK19csX4kH/AgZ1kbH8tVRsNDE3NOhhcwr
rIgFAbkbPSQee/pRUx8OiRh6UvOdWDTicRXiSQvCTpmr3/s9KSSw2Kumf3xd/kn9
otCH7bjAOpc+9SITDb6SzS7GM7G2uJfrO1i/fB0VQllGQ3oQewyUBy5x+48ADAEY
RbwlKP/ebrS0Kpf49W3rNg5NcNVWlOIVZXQ1ObHyUBQFQB/+Vwu7uj0lXiK0Mutd
PCxl0ZzVJM7BVYRSRjYQuTxCnkqmj/qpsOhobOEyTUPO2zIg2B/BeTY8sruygQ3s
+XHCQsB1s/ede1IzoTdYyN3D3ps6Kt2VKrPYHLENJamGNy/vImyscXhiyk1jpM4=
=umE2
-----END PGP SIGNATURE-----

--------------enig5CAC63FB70C107FACBF2E0D5--


--===============5592382265226605842==
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.xen.org
http://lists.xen.org/xen-devel

--===============5592382265226605842==--


From xen-devel-bounces@lists.xen.org Fri Nov 30 16:18:55 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:18:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTIX-0008DW-Dt; Fri, 30 Nov 2012 16:18:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <marmarek@invisiblethingslab.com>) id 1TeTIV-0008DA-Ny
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 16:18:39 +0000
Received: from [85.158.139.211:22239] by server-14.bemta-5.messagelabs.com id
	42/75-21768-E5CD8B05; Fri, 30 Nov 2012 16:18:38 +0000
X-Env-Sender: marmarek@invisiblethingslab.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1354292317!18556790!1
X-Originating-IP: [66.111.4.28]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTExLjQuMjggPT4gOTc3Mg==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24430 invoked from network); 30 Nov 2012 16:18:37 -0000
Received: from out4-smtp.messagingengine.com (HELO
	out4-smtp.messagingengine.com) (66.111.4.28)
	by server-2.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 30 Nov 2012 16:18:37 -0000
Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41])
	by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id DB38520CF9;
	Fri, 30 Nov 2012 11:18:36 -0500 (EST)
Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160])
	by compute1.internal (MEProxy); Fri, 30 Nov 2012 11:18:36 -0500
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=message-id:date:from:mime-version:to
	:cc:subject:references:in-reply-to:content-type; s=mesmtp; bh=K5
	a6qxrHw5znLkIxGmZQZ469PUA=; b=d8Ob0potcXjTJObVVxlq5aM9gRC+rklDL8
	rWZ2gxqloLdD3kJykqr8dDUZ95VQnSkt15EPzUI30TDAmPtfSQT3QPJnjdevURR3
	ordn+qpQd7cRyXGYWVUxXRXZej+4oC57sDtKw+oy9118MiKwVDINClLckHxE76Vo
	9D26JfJrM=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	messagingengine.com; h=message-id:date:from:mime-version:to:cc
	:subject:references:in-reply-to:content-type; s=smtpout; bh=K5a6
	qxrHw5znLkIxGmZQZ469PUA=; b=MoPteQLJZwY4VA9r6WUFsczYctfD9GptSu0U
	MGbd8rRsSzliZkpbLqNiZgszk5gXoUec031Ep88ArGWAHeS//GPXiq3MfYeAxVTC
	gQPh4+9jMC+1uRvBELvm36ZKDmKXIq5JlyGFzK2vRDHvkfIbnPiMl56DTZUC24Se
	jeUonbo=
X-Sasl-enc: FjC3wbd8q+6fT5Amwt3oJx3Lt1kZuzxqULwnopWIYzKI 1354292316
Received: from [10.137.1.17] (unknown [93.157.76.159])
	by mail.messagingengine.com (Postfix) with ESMTPA id 4E77D8E05B2;
	Fri, 30 Nov 2012 11:18:36 -0500 (EST)
Message-ID: <50B8DC55.8000308@invisiblethingslab.com>
Date: Fri, 30 Nov 2012 17:18:29 +0100
From: Marek Marczykowski <marmarek@invisiblethingslab.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Jan Beulich <jbeulich@suse.com>
References: <50B7AF8A.5010304@invisiblethingslab.com>
	<50B88B8402000078000ACC4C@nat28.tlf.novell.com>
	<50B8D9A9.60502@invisiblethingslab.com>
	<50B8DAEA0200007800090B69@nat28.tlf.novell.com>
In-Reply-To: <50B8DAEA0200007800090B69@nat28.tlf.novell.com>
X-Enigmail-Version: 1.4.6
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Only CPU0 active after ACPI S3, xen 4.1.3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5592382265226605842=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============5592382265226605842==
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="------------enig5CAC63FB70C107FACBF2E0D5"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig5CAC63FB70C107FACBF2E0D5
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 30.11.2012 17:12, Jan Beulich wrote:
>>>> Marek Marczykowski <marmarek@invisiblethingslab.com> 11/30/12 5:07 P=
M >>>
>> That was the rare case when resume worked at all... in most cased I've=
 got
>> reboot, before anything appear on the screen (even backlight is off) -=
 xen
>> panic? dom0 kernel panic?
>=20
> Without serial console we won't get very far from here.
>=20
>> I don't have serial console, but have USB-to-serial port - is it possi=
ble to
>> use it as xen console (in xen 4.1.3)?
>=20
> Not that I'm aware of. But 4.1.x isn't very interesting from a developm=
ent
> perspective anyway. If you had the same problems still with 4.3-unstabl=
e,
> then that's be of much more interest to analyze, and you could use the
> EHCI debug port (if one of your controllers has one) based serial conso=
le.

Is it possible to use libxl from xen 4.1 with newer hypervisor? My libxl =
is
somehow patched and porting it to newer version will require some effort.=


--=20
Best Regards / Pozdrawiam,
Marek Marczykowski
Invisible Things Lab


--------------enig5CAC63FB70C107FACBF2E0D5
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQEcBAEBAgAGBQJQuNxWAAoJENuP0xzK19csX4kH/AgZ1kbH8tVRsNDE3NOhhcwr
rIgFAbkbPSQee/pRUx8OiRh6UvOdWDTicRXiSQvCTpmr3/s9KSSw2Kumf3xd/kn9
otCH7bjAOpc+9SITDb6SzS7GM7G2uJfrO1i/fB0VQllGQ3oQewyUBy5x+48ADAEY
RbwlKP/ebrS0Kpf49W3rNg5NcNVWlOIVZXQ1ObHyUBQFQB/+Vwu7uj0lXiK0Mutd
PCxl0ZzVJM7BVYRSRjYQuTxCnkqmj/qpsOhobOEyTUPO2zIg2B/BeTY8sruygQ3s
+XHCQsB1s/ede1IzoTdYyN3D3ps6Kt2VKrPYHLENJamGNy/vImyscXhiyk1jpM4=
=umE2
-----END PGP SIGNATURE-----

--------------enig5CAC63FB70C107FACBF2E0D5--


--===============5592382265226605842==
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.xen.org
http://lists.xen.org/xen-devel

--===============5592382265226605842==--


From xen-devel-bounces@lists.xen.org Fri Nov 30 16:26:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:26:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTQH-0000kK-D6; Fri, 30 Nov 2012 16:26:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TeTQG-0000kF-Kk
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 16:26:40 +0000
Received: from [85.158.138.51:63376] by server-16.bemta-3.messagelabs.com id
	A6/CA-07461-F3ED8B05; Fri, 30 Nov 2012 16:26:39 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1354292797!32189620!1
X-Originating-IP: [209.85.160.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26222 invoked from network); 30 Nov 2012 16:26:38 -0000
Received: from mail-gh0-f173.google.com (HELO mail-gh0-f173.google.com)
	(209.85.160.173)
	by server-9.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:26:38 -0000
Received: by mail-gh0-f173.google.com with SMTP id 16so100410ghy.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 08:26:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:subject:message-id:references:mime-version
	:content-type:content-disposition:content-transfer-encoding
	:in-reply-to:user-agent;
	bh=28ss/yrhUIN39DEUNr7Uo2aJF+0TKdMmsKWrJyLakAs=;
	b=ZnurWi40bcG9Vovv8/buv8INZ84CoCXnbVgEgjcckfB4aw+p/W1WX7A8d6Vxjevho0
	A4LbhsLrML+XgYOyLlDNDk3oAdTFuzrxUFn+cuCv0RusW1UHqkQXLdxBuJ47SRyXKfL6
	EGuzXRkccYjGxvvHa+OfOL1dMW6WuF4QY8XmFLsWoGNrneqXOpwLF4MAendLVVchIVnz
	vfR0t3+q+dwc0Q8PhyxU1T0SKrTykkjE1XNUDGluWXGBKwfmMEAi/jKi5Aqrm2wwW4QB
	9qbQpPPEHIRqPvKLWfzVEcsmtz2Vp4x/BILJmNUb0O3CO8kwYLvmmPX+kJ84JMJSlgF3
	3bqw==
Received: by 10.236.77.229 with SMTP id d65mr1772182yhe.124.1354292796794;
	Fri, 30 Nov 2012 08:26:36 -0800 (PST)
Received: from localhost.localdomain (mcb2536d0.tmodns.net. [208.54.37.203])
	by mx.google.com with ESMTPS id w2sm5278552yhk.8.2012.11.30.08.26.33
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 30 Nov 2012 08:26:36 -0800 (PST)
Date: Fri, 30 Nov 2012 11:26:25 -0500
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: xen-devel@lists.xen.org, daniel.kiper@oracle.com
Message-ID: <20121130162623.GA5481@localhost.localdomain>
References: <CANchcZy0qiahQ86wGzW3YjfvkF1mW_KKNxkfruM0N+_ELzow4A@mail.gmail.com>
	<507C075302000078000A1593@nat28.tlf.novell.com>
	<CANchcZxqXDrsXEAnatWca+YWzoqB5b0nDWzfMk+6aj_SfPFBsw@mail.gmail.com>
	<CANchcZzCNbqPMF3rDpOy_irh+jGR+hHy61W78VtGeHzxFFS5KA@mail.gmail.com>
	<5081271C02000078000A2844@nat28.tlf.novell.com>
	<20121019173307.GT26830@phenom.dumpdata.com>
	<20121108084258.GA5544@jajo.eggsoft>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121108084258.GA5544@jajo.eggsoft>
User-Agent: Mutt/1.5.21 (2010-09-15)
Subject: Re: [Xen-devel] Xen 4.2 with EFI on IBM x3650 ACPI Bug
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVGh1LCBOb3YgMDgsIDIwMTIgYXQgMDk6NDI6NThBTSArMDEwMCwgSmFjZWsgS29uaWVjem55
IHdyb3RlOgo+IEhlbGxvLAo+IAo+IEkgYW0gZGlnZ2luZyB1cCB0aGUgb2xkIHRocmVhZCAganVz
dCB0byBzaG93IGEgd29ya2Fyb3VuZCBmb3IgdGhlCj4gSUJNIHhTZXJpZXMgQUNQSSBwcm9ibGVt
IHVuZGVyIEVGSeKApgoKR3JlYXQuIFRoeAo+IAo+IE9uIEZyaSwgT2N0IDE5LCAyMDEyIGF0IDAx
OjMzOjA3UE0gLTA0MDAsIEtvbnJhZCBSemVzenV0ZWsgV2lsayB3cm90ZToKPiA+IE9uIEZyaSwg
T2N0IDE5LCAyMDEyIGF0IDA5OjEwOjM2QU0gKzAxMDAsIEphbiBCZXVsaWNoIHdyb3RlOgo+ID4g
PiA+Pj4gT24gMTkuMTAuMTIgYXQgMDE6NDMsIEFsbGFuIFNjaGVpZCA8YXZzLjAwOUBnbWFpbC5j
b20+IHdyb3RlOgo+ID4gPiA+IEJhZCBuZXdzLCBpIGFtIHNlZWluZyB0aGUgbG9nIG91dHB1dCBh
bmQgYWZ0ZXIgdGhlIHhlbi5lZmkgYm9vdCB0aGlzIHN0aWxsCj4gPiA+ID4gYXBwZWFycyBvbiBs
b2c6Cj4gPiA+ID4gCj4gPiA+ID4gSW50byBtZXNzYWdlczoKPiA+ID4gPiBPY3QgMTggMjA6Mjc6
MzYgbGNhLWZ3IGtlcm5lbDogWyAgICAwLjAwMDAwMF0gQUNQSSBCSU9TIEJ1ZzogRXJy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hlbi5vcmcveGVuLWRldmVsCj4gCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54
ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:26:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:26:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTQH-0000kK-D6; Fri, 30 Nov 2012 16:26:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TeTQG-0000kF-Kk
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 16:26:40 +0000
Received: from [85.158.138.51:63376] by server-16.bemta-3.messagelabs.com id
	A6/CA-07461-F3ED8B05; Fri, 30 Nov 2012 16:26:39 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1354292797!32189620!1
X-Originating-IP: [209.85.160.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26222 invoked from network); 30 Nov 2012 16:26:38 -0000
Received: from mail-gh0-f173.google.com (HELO mail-gh0-f173.google.com)
	(209.85.160.173)
	by server-9.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:26:38 -0000
Received: by mail-gh0-f173.google.com with SMTP id 16so100410ghy.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 08:26:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:subject:message-id:references:mime-version
	:content-type:content-disposition:content-transfer-encoding
	:in-reply-to:user-agent;
	bh=28ss/yrhUIN39DEUNr7Uo2aJF+0TKdMmsKWrJyLakAs=;
	b=ZnurWi40bcG9Vovv8/buv8INZ84CoCXnbVgEgjcckfB4aw+p/W1WX7A8d6Vxjevho0
	A4LbhsLrML+XgYOyLlDNDk3oAdTFuzrxUFn+cuCv0RusW1UHqkQXLdxBuJ47SRyXKfL6
	EGuzXRkccYjGxvvHa+OfOL1dMW6WuF4QY8XmFLsWoGNrneqXOpwLF4MAendLVVchIVnz
	vfR0t3+q+dwc0Q8PhyxU1T0SKrTykkjE1XNUDGluWXGBKwfmMEAi/jKi5Aqrm2wwW4QB
	9qbQpPPEHIRqPvKLWfzVEcsmtz2Vp4x/BILJmNUb0O3CO8kwYLvmmPX+kJ84JMJSlgF3
	3bqw==
Received: by 10.236.77.229 with SMTP id d65mr1772182yhe.124.1354292796794;
	Fri, 30 Nov 2012 08:26:36 -0800 (PST)
Received: from localhost.localdomain (mcb2536d0.tmodns.net. [208.54.37.203])
	by mx.google.com with ESMTPS id w2sm5278552yhk.8.2012.11.30.08.26.33
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 30 Nov 2012 08:26:36 -0800 (PST)
Date: Fri, 30 Nov 2012 11:26:25 -0500
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: xen-devel@lists.xen.org, daniel.kiper@oracle.com
Message-ID: <20121130162623.GA5481@localhost.localdomain>
References: <CANchcZy0qiahQ86wGzW3YjfvkF1mW_KKNxkfruM0N+_ELzow4A@mail.gmail.com>
	<507C075302000078000A1593@nat28.tlf.novell.com>
	<CANchcZxqXDrsXEAnatWca+YWzoqB5b0nDWzfMk+6aj_SfPFBsw@mail.gmail.com>
	<CANchcZzCNbqPMF3rDpOy_irh+jGR+hHy61W78VtGeHzxFFS5KA@mail.gmail.com>
	<5081271C02000078000A2844@nat28.tlf.novell.com>
	<20121019173307.GT26830@phenom.dumpdata.com>
	<20121108084258.GA5544@jajo.eggsoft>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20121108084258.GA5544@jajo.eggsoft>
User-Agent: Mutt/1.5.21 (2010-09-15)
Subject: Re: [Xen-devel] Xen 4.2 with EFI on IBM x3650 ACPI Bug
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

T24gVGh1LCBOb3YgMDgsIDIwMTIgYXQgMDk6NDI6NThBTSArMDEwMCwgSmFjZWsgS29uaWVjem55
IHdyb3RlOgo+IEhlbGxvLAo+IAo+IEkgYW0gZGlnZ2luZyB1cCB0aGUgb2xkIHRocmVhZCAganVz
dCB0byBzaG93IGEgd29ya2Fyb3VuZCBmb3IgdGhlCj4gSUJNIHhTZXJpZXMgQUNQSSBwcm9ibGVt
IHVuZGVyIEVGSeKApgoKR3JlYXQuIFRoeAo+IAo+IE9uIEZyaSwgT2N0IDE5LCAyMDEyIGF0IDAx
OjMzOjA3UE0gLTA0MDAsIEtvbnJhZCBSemVzenV0ZWsgV2lsayB3cm90ZToKPiA+IE9uIEZyaSwg
T2N0IDE5LCAyMDEyIGF0IDA5OjEwOjM2QU0gKzAxMDAsIEphbiBCZXVsaWNoIHdyb3RlOgo+ID4g
PiA+Pj4g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3RpbGwgd29uJ3QgYmUgYSBwcm9wZXIgRUZJIGludGVyZmFjZSwgc28KPiB0aGUgJ2VmaXZhcnMn
IG1vZHVsZSBhbmQgJ2VmaWJvb3RtZ3InIHV0aWxpdHkgd29uJ3Qgd29yaywgYnV0IHRoaXMgaXMK
PiBub3QgYXMgY3JpdGljYWwgYXMgQUNQSS4KPiAKPiBHcmVldHMsCj4gICAgICAgICBKYWNlawo+
IAo+IF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCj4gWGVu
LWRldmVsIG1haWxpbmcgbGlzdAo+IFhlbi1kZXZlbEBsaXN0cy54ZW4ub3JnCj4gaHR0cDovL2xp
c3RzLnhlbi5vcmcveGVuLWRldmVsCj4gCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fXwpYZW4tZGV2ZWwgbWFpbGluZyBsaXN0Clhlbi1kZXZlbEBsaXN0cy54
ZW4ub3JnCmh0dHA6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZlbAo=

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:34:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:34:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTXD-0001Hh-9E; Fri, 30 Nov 2012 16:33:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TeTXB-0001Hb-Qw
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 16:33:50 +0000
Received: from [85.158.143.35:39391] by server-2.bemta-4.messagelabs.com id
	06/E8-28922-DEFD8B05; Fri, 30 Nov 2012 16:33:49 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354293227!15673222!1
X-Originating-IP: [209.85.161.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6635 invoked from network); 30 Nov 2012 16:33:48 -0000
Received: from mail-gg0-f173.google.com (HELO mail-gg0-f173.google.com)
	(209.85.161.173)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:33:48 -0000
Received: by mail-gg0-f173.google.com with SMTP id f2so100999ggn.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 08:33:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=pS5lmXIobiCILh4Zw+3CJAsS5OnfkY3LCj9J++TxgXE=;
	b=q1Dk1Vwji++zQtZB283TKAXZgt+rYaryTkj4zC5GA/jAuFM2l1aDKb4rgeFWx3Orp1
	9pqHizSeksUO1+QxxyHiNJjRIDZJ3VTzj+COVc3jf5TfLYFYcUCplyaRBdpOEKPIw+Id
	yyafx4qzbc9omZT3t9sOsQ+2LmjX7KzvdQJ5MuDT2F6zk5457+xArWdMcjXqWSuhqu8m
	PGHcMHGZpU8EXzdTuFM4GlRqEUcfKr7ISEwnlAXyP6wyKYLVBC/a/urpPL458sd+hqtk
	Qo313W/au4QsERukAEl00l9768izsvmbo2vjIcJMnV6JGkKRAhz8okuH/R7f5flLyYZS
	N9yg==
Received: by 10.236.181.225 with SMTP id l61mr1850277yhm.47.1354293226900;
	Fri, 30 Nov 2012 08:33:46 -0800 (PST)
Received: from localhost.localdomain (mcb2536d0.tmodns.net. [208.54.37.203])
	by mx.google.com with ESMTPS id u15sm4763996anq.14.2012.11.30.08.33.45
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 30 Nov 2012 08:33:46 -0800 (PST)
Date: Fri, 30 Nov 2012 11:33:42 -0500
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Killian De Volder <killian.de.volder@scarlet.be>
Message-ID: <20121130163339.GC5481@localhost.localdomain>
References: <50A25798.90100@scarlet.be>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A25798.90100@scarlet.be>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: annie.li@oracle.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] TCP Segment offloading + DF
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 13, 2012 at 03:22:16PM +0100, Killian De Volder wrote:
> Hello,
> 
> I don't know if TCO is supported for XEN_NETDEV_FRONTED in kernel 3.1.6,
> however I found an issue.
> 
> I had to track down an issue today:
> Packet from a local machine didn't get routed to the internet.
> After long searching I found the issue:
> 
> The TCP-Segmentation-offloading assembles fragments with Do Not Fragment set.
> This introduces issues when the packet is to be rerouted trough a router.
> 
> Situation:
> 
> DOM0
>  |->Bridge 1 - MTU 1500
>  |    |-> PHY - eth0
>  |    |-> VIF - Dom1
>  |    \-> VIF - Dom2 (router)
>  |
>  \->Bridge 2 - MTU 1500
>       |-> PHY - eth1
>       \-> VIF - Dom2 (router)
> 
> Dom 1 <-> VIF <--(bridge 1)--> VIF <-> dom2 <-> VIF <--(bridge 2)-->
> 
> Practical example:
> Dom1 generate 2 packet to be routed to bridge 2 from bridge 1.
> Packet 1: 1300 bytes DF (TCP)
> Packet 2: 400 bytes DF (TCP)
> 
> The TCP-offloading throws them together and passes 1 packet: 1700 bytes DF (TCP).
> Smart thing to do, reduces load etc.
> 
> HOWEVER
> Then it arrives at dom2, it looks at the packets, sees a 1700 byte packet, and sees the DF.
> Dom2 would put it on the bridge 2 network, fragmented, but it's not allowed, so instead it drops the packet.
> 
> I'm not sure if it's "working as designed" or if this is an unfortunate side effect.

That sounds like an unfortunate side effect. Is there a reason
that the bridge decides it is not allowed? Is that b/c of its MTU and
the 'DF' bit?

Or is the netback on the bridge the one that can't handle DF packets and
hence the bridge drops it?

> 
> Feedback welcome,
> (even "You are an idiot, of course it's  going to fail !" :) )
> Killian De Volder
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:34:02 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:34:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTXD-0001Hh-9E; Fri, 30 Nov 2012 16:33:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TeTXB-0001Hb-Qw
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 16:33:50 +0000
Received: from [85.158.143.35:39391] by server-2.bemta-4.messagelabs.com id
	06/E8-28922-DEFD8B05; Fri, 30 Nov 2012 16:33:49 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354293227!15673222!1
X-Originating-IP: [209.85.161.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6635 invoked from network); 30 Nov 2012 16:33:48 -0000
Received: from mail-gg0-f173.google.com (HELO mail-gg0-f173.google.com)
	(209.85.161.173)
	by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:33:48 -0000
Received: by mail-gg0-f173.google.com with SMTP id f2so100999ggn.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 08:33:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=pS5lmXIobiCILh4Zw+3CJAsS5OnfkY3LCj9J++TxgXE=;
	b=q1Dk1Vwji++zQtZB283TKAXZgt+rYaryTkj4zC5GA/jAuFM2l1aDKb4rgeFWx3Orp1
	9pqHizSeksUO1+QxxyHiNJjRIDZJ3VTzj+COVc3jf5TfLYFYcUCplyaRBdpOEKPIw+Id
	yyafx4qzbc9omZT3t9sOsQ+2LmjX7KzvdQJ5MuDT2F6zk5457+xArWdMcjXqWSuhqu8m
	PGHcMHGZpU8EXzdTuFM4GlRqEUcfKr7ISEwnlAXyP6wyKYLVBC/a/urpPL458sd+hqtk
	Qo313W/au4QsERukAEl00l9768izsvmbo2vjIcJMnV6JGkKRAhz8okuH/R7f5flLyYZS
	N9yg==
Received: by 10.236.181.225 with SMTP id l61mr1850277yhm.47.1354293226900;
	Fri, 30 Nov 2012 08:33:46 -0800 (PST)
Received: from localhost.localdomain (mcb2536d0.tmodns.net. [208.54.37.203])
	by mx.google.com with ESMTPS id u15sm4763996anq.14.2012.11.30.08.33.45
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 30 Nov 2012 08:33:46 -0800 (PST)
Date: Fri, 30 Nov 2012 11:33:42 -0500
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Killian De Volder <killian.de.volder@scarlet.be>
Message-ID: <20121130163339.GC5481@localhost.localdomain>
References: <50A25798.90100@scarlet.be>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50A25798.90100@scarlet.be>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: annie.li@oracle.com, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] TCP Segment offloading + DF
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Tue, Nov 13, 2012 at 03:22:16PM +0100, Killian De Volder wrote:
> Hello,
> 
> I don't know if TCO is supported for XEN_NETDEV_FRONTED in kernel 3.1.6,
> however I found an issue.
> 
> I had to track down an issue today:
> Packet from a local machine didn't get routed to the internet.
> After long searching I found the issue:
> 
> The TCP-Segmentation-offloading assembles fragments with Do Not Fragment set.
> This introduces issues when the packet is to be rerouted trough a router.
> 
> Situation:
> 
> DOM0
>  |->Bridge 1 - MTU 1500
>  |    |-> PHY - eth0
>  |    |-> VIF - Dom1
>  |    \-> VIF - Dom2 (router)
>  |
>  \->Bridge 2 - MTU 1500
>       |-> PHY - eth1
>       \-> VIF - Dom2 (router)
> 
> Dom 1 <-> VIF <--(bridge 1)--> VIF <-> dom2 <-> VIF <--(bridge 2)-->
> 
> Practical example:
> Dom1 generate 2 packet to be routed to bridge 2 from bridge 1.
> Packet 1: 1300 bytes DF (TCP)
> Packet 2: 400 bytes DF (TCP)
> 
> The TCP-offloading throws them together and passes 1 packet: 1700 bytes DF (TCP).
> Smart thing to do, reduces load etc.
> 
> HOWEVER
> Then it arrives at dom2, it looks at the packets, sees a 1700 byte packet, and sees the DF.
> Dom2 would put it on the bridge 2 network, fragmented, but it's not allowed, so instead it drops the packet.
> 
> I'm not sure if it's "working as designed" or if this is an unfortunate side effect.

That sounds like an unfortunate side effect. Is there a reason
that the bridge decides it is not allowed? Is that b/c of its MTU and
the 'DF' bit?

Or is the netback on the bridge the one that can't handle DF packets and
hence the bridge drops it?

> 
> Feedback welcome,
> (even "You are an idiot, of course it's  going to fail !" :) )
> Killian De Volder
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:35:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:35:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTYJ-0001Ly-3T; Fri, 30 Nov 2012 16:34:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TeTYH-0001Lb-Rz
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 16:34:57 +0000
Received: from [85.158.143.99:58790] by server-2.bemta-4.messagelabs.com id
	16/1A-28922-130E8B05; Fri, 30 Nov 2012 16:34:57 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354293294!22298147!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22937 invoked from network); 30 Nov 2012 16:34:56 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:34:56 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46186011"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 16:34:54 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 11:34:54 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TeTYD-00059Z-Tk;
	Fri, 30 Nov 2012 16:34:53 +0000
MIME-Version: 1.0
Message-ID: <patchbomb.1354292655@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 30 Nov 2012 16:24:15 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH 0 of 4 v2] Allow xl to build a domain with
	multiple USB devices
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

v2 adds two patches.  The first consoldates the device model
argument builder for qemu-traditional and qemu-upstream into
a single function, to make it easier to keep up to date.

Along the way, the first patch checks to make sure that the vnc
display is not set in both "vnclisten" and "vncdisplay"; if so,
it throws an error.

The second patch enforces this in libxl, so the user gets a 
friendly error message rather than an ugly libxl internal error.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:35:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:35:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTYJ-0001Ly-3T; Fri, 30 Nov 2012 16:34:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TeTYH-0001Lb-Rz
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 16:34:57 +0000
Received: from [85.158.143.99:58790] by server-2.bemta-4.messagelabs.com id
	16/1A-28922-130E8B05; Fri, 30 Nov 2012 16:34:57 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354293294!22298147!2
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22937 invoked from network); 30 Nov 2012 16:34:56 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:34:56 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46186011"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 16:34:54 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 11:34:54 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TeTYD-00059Z-Tk;
	Fri, 30 Nov 2012 16:34:53 +0000
MIME-Version: 1.0
Message-ID: <patchbomb.1354292655@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 30 Nov 2012 16:24:15 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH 0 of 4 v2] Allow xl to build a domain with
	multiple USB devices
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

v2 adds two patches.  The first consoldates the device model
argument builder for qemu-traditional and qemu-upstream into
a single function, to make it easier to keep up to date.

Along the way, the first patch checks to make sure that the vnc
display is not set in both "vnclisten" and "vncdisplay"; if so,
it throws an error.

The second patch enforces this in libxl, so the user gets a 
friendly error message rather than an ugly libxl internal error.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:35:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:35:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTYI-0001Lq-O6; Fri, 30 Nov 2012 16:34:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TeTYH-0001LZ-Bp
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 16:34:57 +0000
Received: from [85.158.143.99:58761] by server-3.bemta-4.messagelabs.com id
	BE/48-06841-030E8B05; Fri, 30 Nov 2012 16:34:56 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354293294!22298147!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22907 invoked from network); 30 Nov 2012 16:34:56 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:34:56 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46186010"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 16:34:54 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 11:34:54 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TeTYD-00059Z-Ua;
	Fri, 30 Nov 2012 16:34:53 +0000
MIME-Version: 1.0
X-Mercurial-Node: fa37bd276212a01e3c898b54a7f2385454c406a7
Message-ID: <fa37bd276212a01e3c89.1354292657@elijah>
In-Reply-To: <patchbomb.1354292655@elijah>
References: <patchbomb.1354292655@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 30 Nov 2012 16:24:17 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH 2 of 4 v2] xl: Check for duplicate vncdisplay
 options, and return an error
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354291984 0
# Node ID fa37bd276212a01e3c898b54a7f2385454c406a7
# Parent  722da032ac90c0e1a78b1154fa588bf295d1f009
xl: Check for duplicate vncdisplay options, and return an error

If the user has set a vnc display number both in vnclisten (with
"xxxx:yy"), and with vncdisplay, throw an error.

Update man pages to match.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -350,11 +350,17 @@ other VNC-related settings.  The default
 
 Specifies the IP address, and optionally VNC display number, to use.
 
+NB that if you specify the display number here, you should not use
+vncdisplay.
+
 =item C<vncdisplay=DISPLAYNUM>
 
 Specifies the VNC display number to use.  The actual TCP port number
 will be DISPLAYNUM+5900.
 
+NB that you should not use this option if you set the displaynum in the 
+vnclisten string.
+
 =item C<vncunused=BOOLEAN>
 
 Requests that the VNC display setup search for a free TCP port to use.
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1257,6 +1257,7 @@ skip_nic:
                     vfb->sdl.xauthority = strdup(p2 + 1);
                 }
             } while ((p = strtok(NULL, ",")) != NULL);
+
 skip_vfb:
             free(buf2);
             d_config->num_vfbs++;
@@ -1490,6 +1491,16 @@ skip_vfb:
         xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
         xlu_cfg_get_defbool(config, "xen_platform_pci",
                             &b_info->u.hvm.xen_platform_pci, 0);
+
+        if(b_info->u.hvm.vnc.listen
+           && b_info->u.hvm.vnc.display
+           && strchr(b_info->u.hvm.vnc.listen, ':') != NULL) {
+            fprintf(stderr,
+                    "ERROR: Display specified both in vnclisten"
+                    " and vncdisplay!\n");
+            exit (1);
+            
+        }
     }
 
     xlu_cfg_destroy(config);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:35:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:35:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTYI-0001Lq-O6; Fri, 30 Nov 2012 16:34:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TeTYH-0001LZ-Bp
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 16:34:57 +0000
Received: from [85.158.143.99:58761] by server-3.bemta-4.messagelabs.com id
	BE/48-06841-030E8B05; Fri, 30 Nov 2012 16:34:56 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354293294!22298147!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22907 invoked from network); 30 Nov 2012 16:34:56 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:34:56 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46186010"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 16:34:54 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 11:34:54 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TeTYD-00059Z-Ua;
	Fri, 30 Nov 2012 16:34:53 +0000
MIME-Version: 1.0
X-Mercurial-Node: fa37bd276212a01e3c898b54a7f2385454c406a7
Message-ID: <fa37bd276212a01e3c89.1354292657@elijah>
In-Reply-To: <patchbomb.1354292655@elijah>
References: <patchbomb.1354292655@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 30 Nov 2012 16:24:17 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH 2 of 4 v2] xl: Check for duplicate vncdisplay
 options, and return an error
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354291984 0
# Node ID fa37bd276212a01e3c898b54a7f2385454c406a7
# Parent  722da032ac90c0e1a78b1154fa588bf295d1f009
xl: Check for duplicate vncdisplay options, and return an error

If the user has set a vnc display number both in vnclisten (with
"xxxx:yy"), and with vncdisplay, throw an error.

Update man pages to match.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -350,11 +350,17 @@ other VNC-related settings.  The default
 
 Specifies the IP address, and optionally VNC display number, to use.
 
+NB that if you specify the display number here, you should not use
+vncdisplay.
+
 =item C<vncdisplay=DISPLAYNUM>
 
 Specifies the VNC display number to use.  The actual TCP port number
 will be DISPLAYNUM+5900.
 
+NB that you should not use this option if you set the displaynum in the 
+vnclisten string.
+
 =item C<vncunused=BOOLEAN>
 
 Requests that the VNC display setup search for a free TCP port to use.
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1257,6 +1257,7 @@ skip_nic:
                     vfb->sdl.xauthority = strdup(p2 + 1);
                 }
             } while ((p = strtok(NULL, ",")) != NULL);
+
 skip_vfb:
             free(buf2);
             d_config->num_vfbs++;
@@ -1490,6 +1491,16 @@ skip_vfb:
         xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
         xlu_cfg_get_defbool(config, "xen_platform_pci",
                             &b_info->u.hvm.xen_platform_pci, 0);
+
+        if(b_info->u.hvm.vnc.listen
+           && b_info->u.hvm.vnc.display
+           && strchr(b_info->u.hvm.vnc.listen, ':') != NULL) {
+            fprintf(stderr,
+                    "ERROR: Display specified both in vnclisten"
+                    " and vncdisplay!\n");
+            exit (1);
+            
+        }
     }
 
     xlu_cfg_destroy(config);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:35:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:35:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTYL-0001Ma-2l; Fri, 30 Nov 2012 16:35:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TeTYI-0001Lp-WE
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 16:34:59 +0000
Received: from [85.158.143.99:58851] by server-1.bemta-4.messagelabs.com id
	CC/05-27934-230E8B05; Fri, 30 Nov 2012 16:34:58 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1354293296!27430373!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25603 invoked from network); 30 Nov 2012 16:34:57 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:34:57 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46186013"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 16:34:54 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 11:34:54 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TeTYD-00059Z-VL;
	Fri, 30 Nov 2012 16:34:53 +0000
MIME-Version: 1.0
X-Mercurial-Node: 043d69be04c91eaead159e8e74999c59eb68f560
Message-ID: <043d69be04c91eaead15.1354292659@elijah>
In-Reply-To: <patchbomb.1354292655@elijah>
References: <patchbomb.1354292655@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 30 Nov 2012 16:24:19 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH 4 of 4 v2] xl: Accept a list for usbdevice in
	config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354291988 0
# Node ID 043d69be04c91eaead159e8e74999c59eb68f560
# Parent  af47b01d2dbe0e916e1014a264845c48d6ef8108
xl: Accept a list for usbdevice in config file

Allow the "usbdevice" key to accept a list of USB devices, and pass
them in using the new usbdevice_list domain build element.

For backwards compatibility, still accept singleton values.

Also update the xl.cfg manpage, adding information about how to pass
through host devices.

v2:
 - Add some verbiage to make it clear that "usb" is for emulated devices
 - Reference qemu manual for more usbdevice options

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1107,17 +1107,27 @@ device.
 
 =item B<usb=BOOLEAN>
 
-Enables or disables a USB bus in the guest.
+Enables or disables an emulated USB bus in the guest.
 
-=item B<usbdevice=DEVICE>
+=item B<usbdevice=[ "DEVICE", "DEVICE", ...]>
 
-Adds B<DEVICE> to the USB bus. The USB bus must also be enabled using
-B<usb=1>. The most common use for this option is B<usbdevice=tablet>
-which adds pointer device using absolute coordinates. Such devices
-function better than relative coordinate devices (such as a standard
-mouse) since many methods of exporting guest graphics (such as VNC)
-work better in this mode. Note that this is independent of the actual
-pointer device you are using on the host/client side.
+Adds B<DEVICE>s to the emulated USB bus. The USB bus must also be
+enabled using B<usb=1>. The most common use for this option is
+B<usbdevice=['tablet']> which adds pointer device using absolute
+coordinates. Such devices function better than relative coordinate
+devices (such as a standard mouse) since many methods of exporting
+guest graphics (such as VNC) work better in this mode. Note that this
+is independent of the actual pointer device you are using on the
+host/client side.
+
+Host devices can also be passed through in this way, by specifying
+host:USBID, where USBID is of the form xxxx:yyyy.  The USBID can 
+typically be found by using lsusb or usb-devices.
+
+The form usbdevice=DEVICE is also accepted for backwards compatibility.
+
+More valid options can be found in the "usbdevice" section of the qemu
+documentation.
 
 =back
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1486,8 +1486,23 @@ skip_vfb:
         xlu_cfg_replace_string (config, "serial", &b_info->u.hvm.serial, 0);
         xlu_cfg_replace_string (config, "boot", &b_info->u.hvm.boot, 0);
         xlu_cfg_get_defbool(config, "usb", &b_info->u.hvm.usb, 0);
-        xlu_cfg_replace_string (config, "usbdevice",
-                                &b_info->u.hvm.usbdevice, 0);
+        switch (xlu_cfg_get_list_as_string_list(config, "usbdevice",
+                                                &b_info->u.hvm.usbdevice_list,
+                                                1))
+        {
+
+        case 0: break; /* Success */
+        case ESRCH: break; /* Option not present */
+        case EINVAL:
+            /* If it's not a valid list, try reading it as an atom, falling through to
+             * an error if it fails */
+            if (!xlu_cfg_replace_string(config, "usbdevice", &b_info->u.hvm.usbdevice, 0)) 
+                break;
+            /* FALLTHRU */
+        default:
+            fprintf(stderr,"xl: Unable to parse usbdevice.\n");
+            exit(-ERROR_FAIL);
+        }
         xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
         xlu_cfg_get_defbool(config, "xen_platform_pci",
                             &b_info->u.hvm.xen_platform_pci, 0);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:35:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:35:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTYL-0001Ma-2l; Fri, 30 Nov 2012 16:35:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TeTYI-0001Lp-WE
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 16:34:59 +0000
Received: from [85.158.143.99:58851] by server-1.bemta-4.messagelabs.com id
	CC/05-27934-230E8B05; Fri, 30 Nov 2012 16:34:58 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1354293296!27430373!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25603 invoked from network); 30 Nov 2012 16:34:57 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-9.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:34:57 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46186013"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 16:34:54 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 11:34:54 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TeTYD-00059Z-VL;
	Fri, 30 Nov 2012 16:34:53 +0000
MIME-Version: 1.0
X-Mercurial-Node: 043d69be04c91eaead159e8e74999c59eb68f560
Message-ID: <043d69be04c91eaead15.1354292659@elijah>
In-Reply-To: <patchbomb.1354292655@elijah>
References: <patchbomb.1354292655@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 30 Nov 2012 16:24:19 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH 4 of 4 v2] xl: Accept a list for usbdevice in
	config file
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354291988 0
# Node ID 043d69be04c91eaead159e8e74999c59eb68f560
# Parent  af47b01d2dbe0e916e1014a264845c48d6ef8108
xl: Accept a list for usbdevice in config file

Allow the "usbdevice" key to accept a list of USB devices, and pass
them in using the new usbdevice_list domain build element.

For backwards compatibility, still accept singleton values.

Also update the xl.cfg manpage, adding information about how to pass
through host devices.

v2:
 - Add some verbiage to make it clear that "usb" is for emulated devices
 - Reference qemu manual for more usbdevice options

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1107,17 +1107,27 @@ device.
 
 =item B<usb=BOOLEAN>
 
-Enables or disables a USB bus in the guest.
+Enables or disables an emulated USB bus in the guest.
 
-=item B<usbdevice=DEVICE>
+=item B<usbdevice=[ "DEVICE", "DEVICE", ...]>
 
-Adds B<DEVICE> to the USB bus. The USB bus must also be enabled using
-B<usb=1>. The most common use for this option is B<usbdevice=tablet>
-which adds pointer device using absolute coordinates. Such devices
-function better than relative coordinate devices (such as a standard
-mouse) since many methods of exporting guest graphics (such as VNC)
-work better in this mode. Note that this is independent of the actual
-pointer device you are using on the host/client side.
+Adds B<DEVICE>s to the emulated USB bus. The USB bus must also be
+enabled using B<usb=1>. The most common use for this option is
+B<usbdevice=['tablet']> which adds pointer device using absolute
+coordinates. Such devices function better than relative coordinate
+devices (such as a standard mouse) since many methods of exporting
+guest graphics (such as VNC) work better in this mode. Note that this
+is independent of the actual pointer device you are using on the
+host/client side.
+
+Host devices can also be passed through in this way, by specifying
+host:USBID, where USBID is of the form xxxx:yyyy.  The USBID can 
+typically be found by using lsusb or usb-devices.
+
+The form usbdevice=DEVICE is also accepted for backwards compatibility.
+
+More valid options can be found in the "usbdevice" section of the qemu
+documentation.
 
 =back
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1486,8 +1486,23 @@ skip_vfb:
         xlu_cfg_replace_string (config, "serial", &b_info->u.hvm.serial, 0);
         xlu_cfg_replace_string (config, "boot", &b_info->u.hvm.boot, 0);
         xlu_cfg_get_defbool(config, "usb", &b_info->u.hvm.usb, 0);
-        xlu_cfg_replace_string (config, "usbdevice",
-                                &b_info->u.hvm.usbdevice, 0);
+        switch (xlu_cfg_get_list_as_string_list(config, "usbdevice",
+                                                &b_info->u.hvm.usbdevice_list,
+                                                1))
+        {
+
+        case 0: break; /* Success */
+        case ESRCH: break; /* Option not present */
+        case EINVAL:
+            /* If it's not a valid list, try reading it as an atom, falling through to
+             * an error if it fails */
+            if (!xlu_cfg_replace_string(config, "usbdevice", &b_info->u.hvm.usbdevice, 0)) 
+                break;
+            /* FALLTHRU */
+        default:
+            fprintf(stderr,"xl: Unable to parse usbdevice.\n");
+            exit(-ERROR_FAIL);
+        }
         xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
         xlu_cfg_get_defbool(config, "xen_platform_pci",
                             &b_info->u.hvm.xen_platform_pci, 0);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:35:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:35:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTYJ-0001MA-HP; Fri, 30 Nov 2012 16:34:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TeTYI-0001Lb-7d
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 16:34:58 +0000
Received: from [85.158.143.99:58830] by server-2.bemta-4.messagelabs.com id
	B8/1A-28922-130E8B05; Fri, 30 Nov 2012 16:34:57 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354293294!22298147!3
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22946 invoked from network); 30 Nov 2012 16:34:57 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:34:57 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46186012"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 16:34:54 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 11:34:54 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TeTYD-00059Z-Uz;
	Fri, 30 Nov 2012 16:34:53 +0000
MIME-Version: 1.0
X-Mercurial-Node: af47b01d2dbe0e916e1014a264845c48d6ef8108
Message-ID: <af47b01d2dbe0e916e10.1354292658@elijah>
In-Reply-To: <patchbomb.1354292655@elijah>
References: <patchbomb.1354292655@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 30 Nov 2012 16:24:18 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH 3 of 4 v2] libxl: Allow multiple USB devices on
 HVM domain creation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354291988 0
# Node ID af47b01d2dbe0e916e1014a264845c48d6ef8108
# Parent  fa37bd276212a01e3c898b54a7f2385454c406a7
libxl: Allow multiple USB devices on HVM domain creation

This patch allows an HVM domain to be created with multiple USB
devices.

Since the previous interface only allowed the passing of a single
device, this requires us to add a new element to the hvm struct of
libxl_domain_build_info -- usbdevice_list.  For API compatibility, the
old element, usbdevice, remains.

If hvm.usbdevice_list is set, each device listed will cause an extra
"-usbdevice [foo]" to be appended to the qemu command line.

Callers may set either hvm.usbdevice or hvm.usbdevice_list, but not
both; libxl will throw an error if both are set.

In order to allow users of libxl to write software compatible with
older versions of libxl, also define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST.
If this is defined, callers may use either hvm.usbdevice or
hvm.usbdevice_list; otherwise, only hvm.usbdevice will be available.

v2:
 - Throw an error if both usbdevice and usbdevice_list are set
 - Update and clarify definition based on feedback
 - Previous patches means this works for both traditional and upstream

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -266,6 +266,22 @@
 #endif
 #endif
 
+/* 
+ * LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
+ * 
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain hvm.usbdevice_list, a libxl_string_list type that contains
+ * a list of USB devices to specify on the qemu command-line.
+ *
+ * If it is set, callers may use either hvm.usbdevice or
+ * hvm.usbdevice_list, but not both; if both are set, libxl will
+ * throw an error.
+ *
+ * If this is not defined, callers can only use hvm.usbdevice.  Note
+ * that this means only one device can be added at domain build time.
+ */
+#define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST 1
+
 /* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
  * called from within libxl itself. Callers outside libxl, who
  * do not #include libxl_internal.h, are fine. */
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -322,11 +322,28 @@ static char ** libxl__build_device_model
 
         }
 
-        if (libxl_defbool_val(b_info->u.hvm.usb) || b_info->u.hvm.usbdevice) {
+        if (libxl_defbool_val(b_info->u.hvm.usb)
+            || b_info->u.hvm.usbdevice
+            || b_info->u.hvm.usbdevice_list) {
+            if ( b_info->u.hvm.usbdevice && b_info->u.hvm.usbdevice_list )
+            {
+                LOG(ERROR, "%s: Both usbdevice and usbdevice_list set",
+                    __func__);
+                return NULL;
+            }
             flexarray_append(dm_args, "-usb");
             if (b_info->u.hvm.usbdevice) {
                 flexarray_vappend(dm_args,
                                   "-usbdevice", b_info->u.hvm.usbdevice, NULL);
+            } else if (b_info->u.hvm.usbdevice_list) {
+                char **p;
+                for (p = b_info->u.hvm.usbdevice_list;
+                     *p;
+                     p++) {
+                    flexarray_vappend(dm_args,
+                                      "-usbdevice",
+                                      *p, NULL);
+                }
             }
         }
         if (b_info->u.hvm.soundhw) {
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -326,6 +326,7 @@ libxl_domain_build_info = Struct("domain
                                        ("usbdevice",        string),
                                        ("soundhw",          string),
                                        ("xen_platform_pci", libxl_defbool),
+                                       ("usbdevice_list",   libxl_string_list),
                                        ])),
                  ("pv", Struct(None, [("kernel", string),
                                       ("slack_memkb", MemKB),

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:35:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:35:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTYJ-0001MA-HP; Fri, 30 Nov 2012 16:34:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TeTYI-0001Lb-7d
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 16:34:58 +0000
Received: from [85.158.143.99:58830] by server-2.bemta-4.messagelabs.com id
	B8/1A-28922-130E8B05; Fri, 30 Nov 2012 16:34:57 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354293294!22298147!3
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22946 invoked from network); 30 Nov 2012 16:34:57 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-12.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:34:57 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="46186012"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 16:34:54 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 11:34:54 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TeTYD-00059Z-Uz;
	Fri, 30 Nov 2012 16:34:53 +0000
MIME-Version: 1.0
X-Mercurial-Node: af47b01d2dbe0e916e1014a264845c48d6ef8108
Message-ID: <af47b01d2dbe0e916e10.1354292658@elijah>
In-Reply-To: <patchbomb.1354292655@elijah>
References: <patchbomb.1354292655@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 30 Nov 2012 16:24:18 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH 3 of 4 v2] libxl: Allow multiple USB devices on
 HVM domain creation
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354291988 0
# Node ID af47b01d2dbe0e916e1014a264845c48d6ef8108
# Parent  fa37bd276212a01e3c898b54a7f2385454c406a7
libxl: Allow multiple USB devices on HVM domain creation

This patch allows an HVM domain to be created with multiple USB
devices.

Since the previous interface only allowed the passing of a single
device, this requires us to add a new element to the hvm struct of
libxl_domain_build_info -- usbdevice_list.  For API compatibility, the
old element, usbdevice, remains.

If hvm.usbdevice_list is set, each device listed will cause an extra
"-usbdevice [foo]" to be appended to the qemu command line.

Callers may set either hvm.usbdevice or hvm.usbdevice_list, but not
both; libxl will throw an error if both are set.

In order to allow users of libxl to write software compatible with
older versions of libxl, also define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST.
If this is defined, callers may use either hvm.usbdevice or
hvm.usbdevice_list; otherwise, only hvm.usbdevice will be available.

v2:
 - Throw an error if both usbdevice and usbdevice_list are set
 - Update and clarify definition based on feedback
 - Previous patches means this works for both traditional and upstream

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -266,6 +266,22 @@
 #endif
 #endif
 
+/* 
+ * LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
+ * 
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain hvm.usbdevice_list, a libxl_string_list type that contains
+ * a list of USB devices to specify on the qemu command-line.
+ *
+ * If it is set, callers may use either hvm.usbdevice or
+ * hvm.usbdevice_list, but not both; if both are set, libxl will
+ * throw an error.
+ *
+ * If this is not defined, callers can only use hvm.usbdevice.  Note
+ * that this means only one device can be added at domain build time.
+ */
+#define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST 1
+
 /* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
  * called from within libxl itself. Callers outside libxl, who
  * do not #include libxl_internal.h, are fine. */
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -322,11 +322,28 @@ static char ** libxl__build_device_model
 
         }
 
-        if (libxl_defbool_val(b_info->u.hvm.usb) || b_info->u.hvm.usbdevice) {
+        if (libxl_defbool_val(b_info->u.hvm.usb)
+            || b_info->u.hvm.usbdevice
+            || b_info->u.hvm.usbdevice_list) {
+            if ( b_info->u.hvm.usbdevice && b_info->u.hvm.usbdevice_list )
+            {
+                LOG(ERROR, "%s: Both usbdevice and usbdevice_list set",
+                    __func__);
+                return NULL;
+            }
             flexarray_append(dm_args, "-usb");
             if (b_info->u.hvm.usbdevice) {
                 flexarray_vappend(dm_args,
                                   "-usbdevice", b_info->u.hvm.usbdevice, NULL);
+            } else if (b_info->u.hvm.usbdevice_list) {
+                char **p;
+                for (p = b_info->u.hvm.usbdevice_list;
+                     *p;
+                     p++) {
+                    flexarray_vappend(dm_args,
+                                      "-usbdevice",
+                                      *p, NULL);
+                }
             }
         }
         if (b_info->u.hvm.soundhw) {
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -326,6 +326,7 @@ libxl_domain_build_info = Struct("domain
                                        ("usbdevice",        string),
                                        ("soundhw",          string),
                                        ("xen_platform_pci", libxl_defbool),
+                                       ("usbdevice_list",   libxl_string_list),
                                        ])),
                  ("pv", Struct(None, [("kernel", string),
                                       ("slack_memkb", MemKB),

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:36:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:36:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTZx-0001jP-JQ; Fri, 30 Nov 2012 16:36:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TeTZv-0001j4-LK
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 16:36:40 +0000
Received: from [85.158.143.35:56024] by server-1.bemta-4.messagelabs.com id
	A0/D6-27934-790E8B05; Fri, 30 Nov 2012 16:36:39 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1354293295!4722390!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10403 invoked from network); 30 Nov 2012 16:34:56 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:34:56 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="216021292"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 16:34:54 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 11:34:54 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TeTYD-00059Z-UA;
	Fri, 30 Nov 2012 16:34:53 +0000
MIME-Version: 1.0
X-Mercurial-Node: 722da032ac90c0e1a78b1154fa588bf295d1f009
Message-ID: <722da032ac90c0e1a78b.1354292656@elijah>
In-Reply-To: <patchbomb.1354292655@elijah>
References: <patchbomb.1354292655@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 30 Nov 2012 16:24:16 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH 1 of 4 v2] libxl: Combine device model arg build
	functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354287957 0
# Node ID 722da032ac90c0e1a78b1154fa588bf295d1f009
# Parent  ae6fb202b233af815466055d9f1a635802a50855
libxl: Combine device model arg build functions

qemu-traditional and qemu-upstream have some differences in the way
the arguments need to be passed.  At the moment, this is dealt with by
having two entirely separate functions, libxl__build_device_model_args_new
and libxl__build_device_model_args_old.

However, at least 80% of these are the same; this means that fixes or
additions to one may not make it into the other.  Furthermore, there
are some unaccounable differences in implementation.

This patch combines the two functions into one, choosing between old
and new implementations as necessary.

It also makes the following changes to the vnc generation code:
* Simplifies and comments it, making it easier to read and grok
* Throws an error if duplicate values of display are set, rather
  than the current very un-intuitive behavior.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -95,181 +95,6 @@ static const char *dm_keymap(const libxl
         return NULL;
 }
 
-static char ** libxl__build_device_model_args_old(libxl__gc *gc,
-                                        const char *dm, int domid,
-                                        const libxl_domain_config *guest_config,
-                                        const libxl__domain_build_state *state)
-{
-    const libxl_domain_create_info *c_info = &guest_config->c_info;
-    const libxl_domain_build_info *b_info = &guest_config->b_info;
-    const libxl_device_nic *nics = guest_config->nics;
-    const libxl_vnc_info *vnc = libxl__dm_vnc(guest_config);
-    const libxl_sdl_info *sdl = dm_sdl(guest_config);
-    const int num_nics = guest_config->num_nics;
-    const char *keymap = dm_keymap(guest_config);
-    int i;
-    flexarray_t *dm_args;
-    dm_args = flexarray_make(gc, 16, 1);
-
-    flexarray_vappend(dm_args, dm,
-                      "-d", libxl__sprintf(gc, "%d", domid), NULL);
-
-    if (c_info->name)
-        flexarray_vappend(dm_args, "-domain-name", c_info->name, NULL);
-
-    if (vnc) {
-        char *vncarg;
-        if (vnc->display) {
-            if (vnc->listen && strchr(vnc->listen, ':') == NULL) {
-                vncarg = libxl__sprintf(gc, "%s:%d",
-                                  vnc->listen,
-                                  vnc->display);
-            } else {
-                vncarg = libxl__sprintf(gc, "127.0.0.1:%d", vnc->display);
-            }
-        } else if (vnc->listen) {
-            if (strchr(vnc->listen, ':') != NULL) {
-                vncarg = vnc->listen;
-            } else {
-                vncarg = libxl__sprintf(gc, "%s:0", vnc->listen);
-            }
-        } else {
-            vncarg = "127.0.0.1:0";
-        }
-        if (vnc->passwd && (vnc->passwd[0] != '\0'))
-            vncarg = libxl__sprintf(gc, "%s,password", vncarg);
-        flexarray_append(dm_args, "-vnc");
-        flexarray_append(dm_args, vncarg);
-
-        if (libxl_defbool_val(vnc->findunused)) {
-            flexarray_append(dm_args, "-vncunused");
-        }
-    }
-    if (sdl) {
-        flexarray_append(dm_args, "-sdl");
-        if (!libxl_defbool_val(sdl->opengl)) {
-            flexarray_append(dm_args, "-disable-opengl");
-        }
-        /* XXX sdl->{display,xauthority} into $DISPLAY/$XAUTHORITY */
-    }
-    if (keymap) {
-        flexarray_vappend(dm_args, "-k", keymap, NULL);
-    }
-    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
-        int ioemu_nics = 0;
-        int nr_set_cpus = 0;
-        char *s;
-
-        if (b_info->u.hvm.serial) {
-            flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial, NULL);
-        }
-
-        if (libxl_defbool_val(b_info->u.hvm.nographic) && (!sdl && !vnc)) {
-            flexarray_append(dm_args, "-nographic");
-        }
-
-        if (b_info->video_memkb) {
-            flexarray_vappend(dm_args, "-videoram",
-                    libxl__sprintf(gc, "%d",
-                                   libxl__sizekb_to_mb(b_info->video_memkb)),
-                    NULL);
-        }
-
-        switch (b_info->u.hvm.vga.kind) {
-        case LIBXL_VGA_INTERFACE_TYPE_STD:
-            flexarray_append(dm_args, "-std-vga");
-            break;
-        case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
-            break;
-        }
-
-        if (b_info->u.hvm.boot) {
-            flexarray_vappend(dm_args, "-boot", b_info->u.hvm.boot, NULL);
-        }
-        if (libxl_defbool_val(b_info->u.hvm.usb) || b_info->u.hvm.usbdevice) {
-            flexarray_append(dm_args, "-usb");
-            if (b_info->u.hvm.usbdevice) {
-                flexarray_vappend(dm_args,
-                                  "-usbdevice", b_info->u.hvm.usbdevice, NULL);
-            }
-        }
-        if (b_info->u.hvm.soundhw) {
-            flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, NULL);
-        }
-        if (libxl_defbool_val(b_info->u.hvm.acpi)) {
-            flexarray_append(dm_args, "-acpi");
-        }
-        if (b_info->max_vcpus > 1) {
-            flexarray_vappend(dm_args, "-vcpus",
-                              libxl__sprintf(gc, "%d", b_info->max_vcpus),
-                              NULL);
-        }
-
-        nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
-        s = libxl_bitmap_to_hex_string(CTX, &b_info->avail_vcpus);
-        flexarray_vappend(dm_args, "-vcpu_avail",
-                              libxl__sprintf(gc, "%s", s), NULL);
-        free(s);
-
-        for (i = 0; i < num_nics; i++) {
-            if (nics[i].nictype == LIBXL_NIC_TYPE_VIF_IOEMU) {
-                char *smac = libxl__sprintf(gc,
-                                   LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nics[i].mac));
-                const char *ifname = libxl__device_nic_devname(gc,
-                                                domid, nics[i].devid,
-                                                LIBXL_NIC_TYPE_VIF_IOEMU);
-                flexarray_vappend(dm_args,
-                                  "-net",
-                                  GCSPRINTF(
-                                      "nic,vlan=%d,macaddr=%s,model=%s",
-                                      nics[i].devid, smac, nics[i].model),
-                                  "-net",
-                                  GCSPRINTF(
-                                      "tap,vlan=%d,ifname=%s,bridge=%s,"
-                                      "script=%s,downscript=%s",
-                                      nics[i].devid, ifname, nics[i].bridge,
-                                      libxl_tapif_script(gc),
-                                      libxl_tapif_script(gc)),
-                                  NULL);
-                ioemu_nics++;
-            }
-        }
-        /* If we have no emulated nics, tell qemu not to create any */
-        if ( ioemu_nics == 0 ) {
-            flexarray_vappend(dm_args, "-net", "none", NULL);
-        }
-        if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
-            flexarray_append(dm_args, "-gfx_passthru");
-        }
-    } else {
-        if (!sdl && !vnc)
-            flexarray_append(dm_args, "-nographic");
-    }
-
-    if (state->saved_state) {
-        flexarray_vappend(dm_args, "-loadvm", state->saved_state, NULL);
-    }
-    for (i = 0; b_info->extra && b_info->extra[i] != NULL; i++)
-        flexarray_append(dm_args, b_info->extra[i]);
-    flexarray_append(dm_args, "-M");
-    switch (b_info->type) {
-    case LIBXL_DOMAIN_TYPE_PV:
-        flexarray_append(dm_args, "xenpv");
-        for (i = 0; b_info->extra_pv && b_info->extra_pv[i] != NULL; i++)
-            flexarray_append(dm_args, b_info->extra_pv[i]);
-        break;
-    case LIBXL_DOMAIN_TYPE_HVM:
-        flexarray_append(dm_args, "xenfv");
-        for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL; i++)
-            flexarray_append(dm_args, b_info->extra_hvm[i]);
-        break;
-    default:
-        abort();
-    }
-    flexarray_append(dm_args, NULL);
-    return (char **) flexarray_contents(dm_args);
-}
-
 static const char *qemu_disk_format_string(libxl_disk_format format)
 {
     switch (format) {
@@ -318,7 +143,7 @@ static char *dm_spice_options(libxl__gc 
     return opt;
 }
 
-static char ** libxl__build_device_model_args_new(libxl__gc *gc,
+static char ** libxl__build_device_model_args(libxl__gc *gc,
                                         const char *dm, int guest_domid,
                                         const libxl_domain_config *guest_config,
                                         const libxl__domain_build_state *state)
@@ -336,62 +161,106 @@ static char ** libxl__build_device_model
     flexarray_t *dm_args;
     int i;
     uint64_t ram_size;
+    int dm_new;
+
+    switch (guest_config->b_info.device_model_version) {
+    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
+        dm_new = 0;
+        break;
+    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
+        dm_new = 1;
+        break;
+    default:
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "unknown device model version %d",
+                         guest_config->b_info.device_model_version);
+        return NULL;
+    }
+
 
     dm_args = flexarray_make(gc, 16, 1);
 
-    flexarray_vappend(dm_args, dm,
-                      "-xen-domid",
-                      libxl__sprintf(gc, "%d", guest_domid), NULL);
+    /* Domain ID */
+    if (dm_new) {
+        flexarray_vappend(dm_args, dm,
+                          "-xen-domid",
+                          libxl__sprintf(gc, "%d", guest_domid), NULL);
+    } else {
+        flexarray_vappend(dm_args, dm,
+                          "-d", libxl__sprintf(gc, "%d", guest_domid), NULL);
+    }
 
-    flexarray_append(dm_args, "-chardev");
-    flexarray_append(dm_args,
-                     libxl__sprintf(gc, "socket,id=libxl-cmd,"
-                                    "path=%s/qmp-libxl-%d,server,nowait",
-                                    libxl__run_dir_path(), guest_domid));
+    if (dm_new) {
+        flexarray_append(dm_args, "-chardev");
+        flexarray_append(dm_args,
+                         libxl__sprintf(gc, "socket,id=libxl-cmd,"
+                                        "path=%s/qmp-libxl-%d,server,nowait",
+                                        libxl__run_dir_path(), guest_domid));
 
-    flexarray_append(dm_args, "-mon");
-    flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
+        flexarray_append(dm_args, "-mon");
+        flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
 
-    if (b_info->type == LIBXL_DOMAIN_TYPE_PV) {
-        flexarray_append(dm_args, "-xen-attach");
+        if (b_info->type == LIBXL_DOMAIN_TYPE_PV) {
+            flexarray_append(dm_args, "-xen-attach");
+        }
     }
 
     if (c_info->name) {
-        flexarray_vappend(dm_args, "-name", c_info->name, NULL);
+        if ( dm_new )
+            flexarray_vappend(dm_args, "-name", c_info->name, NULL);
+        else
+            flexarray_vappend(dm_args, "-domain-name", c_info->name, NULL);
     }
+
     if (vnc) {
-        int display = 0;
-        const char *addr = "127.0.0.1";
         char *vncarg = NULL;
 
         flexarray_append(dm_args, "-vnc");
 
-        if (vnc->display) {
-            display = vnc->display;
-            if (vnc->listen && strchr(vnc->listen, ':') == NULL) {
-                addr = vnc->listen;
+        /*
+         * If vnc->listen is present and contains a :, and
+         *  - vnc->display is 0, use vnc->listen
+         *  - vnc->display is non-zero, be confused
+         * If vnc->listen is present but doesn't, use vnc->listen:vnc->display.
+         * If vnc->listen is not present, use 127.0.0.1:vnc->display
+         * (Remembering that vnc->display already defaults to 0.)
+         */
+        if (vnc->listen) {
+            if (strchr(vnc->listen, ':') != NULL) {
+                if (vnc->display) {
+                    LOG(ERROR, "vncdisplay set, vnclisten contains display");
+                    return NULL;
+                }
+                vncarg = vnc->listen;
+            } else {
+                vncarg = libxl__sprintf(gc, "%s:%d", vnc->listen,
+                                        vnc->display);
             }
-        } else if (vnc->listen) {
-            addr = vnc->listen;
-        }
+        } else
+            vncarg = libxl__sprintf(gc, "127.0.0.1:%d", vnc->display);
 
-        if (strchr(addr, ':') != NULL)
-            vncarg = libxl__sprintf(gc, "%s", addr);
-        else
-            vncarg = libxl__sprintf(gc, "%s:%d", addr, display);
         if (vnc->passwd && vnc->passwd[0]) {
             vncarg = libxl__sprintf(gc, "%s,password", vncarg);
         }
-        if (libxl_defbool_val(vnc->findunused)) {
+
+        if (dm_new && libxl_defbool_val(vnc->findunused)) {
             /* This option asks to QEMU to try this number of port before to
              * give up.  So QEMU will try ports between $display and $display +
              * 99.  This option needs to be the last one of the vnc options. */
             vncarg = libxl__sprintf(gc, "%s,to=99", vncarg);
         }
+
         flexarray_append(dm_args, vncarg);
+
+        if (!dm_new && libxl_defbool_val(vnc->findunused)) {
+            flexarray_append(dm_args, "-vncunused");
+        }
     }
     if (sdl) {
         flexarray_append(dm_args, "-sdl");
+        
+        if (!dm_new && !libxl_defbool_val(sdl->opengl)) {
+            flexarray_append(dm_args, "-disable-opengl");
+        }
         /* XXX sdl->{display,xauthority} into $DISPLAY/$XAUTHORITY */
     }
 
@@ -414,7 +283,7 @@ static char ** libxl__build_device_model
             flexarray_append(dm_args, "-nographic");
         }
 
-        if (libxl_defbool_val(b_info->u.hvm.spice.enable)) {
+        if (dm_new && libxl_defbool_val(b_info->u.hvm.spice.enable)) {
             const libxl_spice_info *spice = &b_info->u.hvm.spice;
             char *spiceoptions = dm_spice_options(gc, spice);
             if (!spiceoptions)
@@ -424,19 +293,35 @@ static char ** libxl__build_device_model
             flexarray_append(dm_args, spiceoptions);
         }
 
-        switch (b_info->u.hvm.vga.kind) {
-        case LIBXL_VGA_INTERFACE_TYPE_STD:
-            flexarray_vappend(dm_args, "-vga", "std", NULL);
-            break;
-        case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
-            flexarray_vappend(dm_args, "-vga", "cirrus", NULL);
-            break;
+        if ( dm_new ) {
+            switch (b_info->u.hvm.vga.kind) {
+            case LIBXL_VGA_INTERFACE_TYPE_STD:
+                flexarray_vappend(dm_args, "-vga", "std", NULL);
+                break;
+            case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
+                flexarray_vappend(dm_args, "-vga", "cirrus", NULL);
+                break;
+            }
+        } else {
+            switch (b_info->u.hvm.vga.kind) {
+            case LIBXL_VGA_INTERFACE_TYPE_STD:
+                flexarray_append(dm_args, "-std-vga");
+                break;
+            case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
+                break;
+            }
         }
 
         if (b_info->u.hvm.boot) {
-            flexarray_vappend(dm_args, "-boot",
-                    libxl__sprintf(gc, "order=%s", b_info->u.hvm.boot), NULL);
+            if (dm_new)
+                flexarray_vappend(dm_args, "-boot",
+                                  libxl__sprintf(gc, "order=%s",
+                                                 b_info->u.hvm.boot), NULL);
+            else
+                flexarray_vappend(dm_args, "-boot", b_info->u.hvm.boot, NULL);
+
         }
+
         if (libxl_defbool_val(b_info->u.hvm.usb) || b_info->u.hvm.usbdevice) {
             flexarray_append(dm_args, "-usb");
             if (b_info->u.hvm.usbdevice) {
@@ -450,19 +335,39 @@ static char ** libxl__build_device_model
         if (!libxl_defbool_val(b_info->u.hvm.acpi)) {
             flexarray_append(dm_args, "-no-acpi");
         }
-        if (b_info->max_vcpus > 1) {
-            flexarray_append(dm_args, "-smp");
-            if (b_info->avail_vcpus.size) {
-                int nr_set_cpus = 0;
-                nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
 
-                flexarray_append(dm_args, libxl__sprintf(gc, "%d,maxcpus=%d",
-                                                         b_info->max_vcpus,
-                                                         nr_set_cpus));
-            } else
-                flexarray_append(dm_args, libxl__sprintf(gc, "%d",
-                                                         b_info->max_vcpus));
+        if (dm_new)
+        {
+            if (b_info->max_vcpus > 1) {
+                flexarray_append(dm_args, "-smp");
+                if (b_info->avail_vcpus.size) {
+                    int nr_set_cpus = 0;
+                    nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
+                    
+                    flexarray_append(dm_args,
+                                     libxl__sprintf(gc, "%d,maxcpus=%d",
+                                                    b_info->max_vcpus,
+                                                    nr_set_cpus));
+                } else
+                    flexarray_append(dm_args,
+                                     libxl__sprintf(gc, "%d",
+                                                    b_info->max_vcpus));
+            }
+        } else {
+            int nr_set_cpus = 0;
+            char *s;
+            if (b_info->max_vcpus > 1) {
+                flexarray_vappend(dm_args, "-vcpus",
+                                  libxl__sprintf(gc, "%d", b_info->max_vcpus),
+                                  NULL);
+            }
+            nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
+            s = libxl_bitmap_to_hex_string(CTX, &b_info->avail_vcpus);
+            flexarray_vappend(dm_args, "-vcpu_avail",
+                              libxl__sprintf(gc, "%s", s), NULL);
+            free(s);
         }
+
         for (i = 0; i < num_nics; i++) {
             if (nics[i].nictype == LIBXL_NIC_TYPE_VIF_IOEMU) {
                 char *smac = libxl__sprintf(gc,
@@ -470,18 +375,35 @@ static char ** libxl__build_device_model
                 const char *ifname = libxl__device_nic_devname(gc,
                                                 guest_domid, nics[i].devid,
                                                 LIBXL_NIC_TYPE_VIF_IOEMU);
-                flexarray_append(dm_args, "-device");
-                flexarray_append(dm_args,
-                   libxl__sprintf(gc, "%s,id=nic%d,netdev=net%d,mac=%s",
-                                                nics[i].model, nics[i].devid,
-                                                nics[i].devid, smac));
-                flexarray_append(dm_args, "-netdev");
-                flexarray_append(dm_args, GCSPRINTF(
-                                          "type=tap,id=net%d,ifname=%s,"
+                if (dm_new) {
+                    flexarray_append(dm_args, "-device");
+                    flexarray_append(dm_args,
+                          libxl__sprintf(gc, "%s,id=nic%d,netdev=net%d,mac=%s",
+                                       nics[i].model, nics[i].devid,
+                                       nics[i].devid, smac));
+                    flexarray_append(dm_args, "-netdev");
+                    flexarray_append(dm_args, GCSPRINTF(
+                                         "type=tap,id=net%d,ifname=%s,"
+                                         "script=%s,downscript=%s",
+                                         nics[i].devid, ifname,
+                                         libxl_tapif_script(gc),
+                                         libxl_tapif_script(gc)));
+                } else {
+                    flexarray_vappend(dm_args,
+                                      "-net",
+                                      GCSPRINTF(
+                                          "nic,vlan=%d,macaddr=%s,model=%s",
+                                          nics[i].devid, smac, nics[i].model),
+                                      "-net",
+                                      GCSPRINTF(
+                                          "tap,vlan=%d,ifname=%s,bridge=%s,"
                                           "script=%s,downscript=%s",
                                           nics[i].devid, ifname,
+                                          nics[i].bridge,
                                           libxl_tapif_script(gc),
-                                          libxl_tapif_script(gc)));
+                                          libxl_tapif_script(gc)),
+                                      NULL);
+                }
                 ioemu_nics++;
             }
         }
@@ -500,10 +422,15 @@ static char ** libxl__build_device_model
     }
 
     if (state->saved_state) {
-        /* This file descriptor is meant to be used by QEMU */
-        int migration_fd = open(state->saved_state, O_RDONLY);
-        flexarray_append(dm_args, "-incoming");
-        flexarray_append(dm_args, libxl__sprintf(gc, "fd:%d", migration_fd));
+        if (dm_new) {
+            /* This file descriptor is meant to be used by QEMU */
+            int migration_fd = open(state->saved_state, O_RDONLY);
+            flexarray_append(dm_args, "-incoming");
+            flexarray_append(dm_args,
+                             libxl__sprintf(gc, "fd:%d", migration_fd));
+        } else {
+            flexarray_vappend(dm_args, "-loadvm", state->saved_state, NULL);
+        }
     }
     for (i = 0; b_info->extra && b_info->extra[i] != NULL; i++)
         flexarray_append(dm_args, b_info->extra[i]);
@@ -523,6 +450,9 @@ static char ** libxl__build_device_model
         abort();
     }
 
+    if (!dm_new)
+        goto finish;
+
     ram_size = libxl__sizekb_to_mb(b_info->max_memkb - b_info->video_memkb);
     flexarray_append(dm_args, "-m");
     flexarray_append(dm_args, libxl__sprintf(gc, "%"PRId64, ram_size));
@@ -585,33 +515,11 @@ static char ** libxl__build_device_model
             flexarray_append(dm_args, drive);
         }
     }
+finish:
     flexarray_append(dm_args, NULL);
     return (char **) flexarray_contents(dm_args);
 }
 
-static char ** libxl__build_device_model_args(libxl__gc *gc,
-                                        const char *dm, int guest_domid,
-                                        const libxl_domain_config *guest_config,
-                                        const libxl__domain_build_state *state)
-{
-    libxl_ctx *ctx = libxl__gc_owner(gc);
-
-    switch (guest_config->b_info.device_model_version) {
-    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
-        return libxl__build_device_model_args_old(gc, dm,
-                                                  guest_domid, guest_config,
-                                                  state);
-    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
-        return libxl__build_device_model_args_new(gc, dm,
-                                                  guest_domid, guest_config,
-                                                  state);
-    default:
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "unknown device model version %d",
-                         guest_config->b_info.device_model_version);
-        return NULL;
-    }
-}
-
 static void libxl__dm_vifs_from_hvm_guest_config(libxl__gc *gc,
                                     libxl_domain_config * const guest_config,
                                     libxl_domain_config *dm_config)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:36:48 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:36:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTZx-0001jP-JQ; Fri, 30 Nov 2012 16:36:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TeTZv-0001j4-LK
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 16:36:40 +0000
Received: from [85.158.143.35:56024] by server-1.bemta-4.messagelabs.com id
	A0/D6-27934-790E8B05; Fri, 30 Nov 2012 16:36:39 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1354293295!4722390!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10403 invoked from network); 30 Nov 2012 16:34:56 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-2.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:34:56 -0000
X-IronPort-AV: E=Sophos;i="4.84,191,1355097600"; d="scan'208";a="216021292"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 16:34:54 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 11:34:54 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TeTYD-00059Z-UA;
	Fri, 30 Nov 2012 16:34:53 +0000
MIME-Version: 1.0
X-Mercurial-Node: 722da032ac90c0e1a78b1154fa588bf295d1f009
Message-ID: <722da032ac90c0e1a78b.1354292656@elijah>
In-Reply-To: <patchbomb.1354292655@elijah>
References: <patchbomb.1354292655@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 30 Nov 2012 16:24:16 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH 1 of 4 v2] libxl: Combine device model arg build
	functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354287957 0
# Node ID 722da032ac90c0e1a78b1154fa588bf295d1f009
# Parent  ae6fb202b233af815466055d9f1a635802a50855
libxl: Combine device model arg build functions

qemu-traditional and qemu-upstream have some differences in the way
the arguments need to be passed.  At the moment, this is dealt with by
having two entirely separate functions, libxl__build_device_model_args_new
and libxl__build_device_model_args_old.

However, at least 80% of these are the same; this means that fixes or
additions to one may not make it into the other.  Furthermore, there
are some unaccounable differences in implementation.

This patch combines the two functions into one, choosing between old
and new implementations as necessary.

It also makes the following changes to the vnc generation code:
* Simplifies and comments it, making it easier to read and grok
* Throws an error if duplicate values of display are set, rather
  than the current very un-intuitive behavior.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -95,181 +95,6 @@ static const char *dm_keymap(const libxl
         return NULL;
 }
 
-static char ** libxl__build_device_model_args_old(libxl__gc *gc,
-                                        const char *dm, int domid,
-                                        const libxl_domain_config *guest_config,
-                                        const libxl__domain_build_state *state)
-{
-    const libxl_domain_create_info *c_info = &guest_config->c_info;
-    const libxl_domain_build_info *b_info = &guest_config->b_info;
-    const libxl_device_nic *nics = guest_config->nics;
-    const libxl_vnc_info *vnc = libxl__dm_vnc(guest_config);
-    const libxl_sdl_info *sdl = dm_sdl(guest_config);
-    const int num_nics = guest_config->num_nics;
-    const char *keymap = dm_keymap(guest_config);
-    int i;
-    flexarray_t *dm_args;
-    dm_args = flexarray_make(gc, 16, 1);
-
-    flexarray_vappend(dm_args, dm,
-                      "-d", libxl__sprintf(gc, "%d", domid), NULL);
-
-    if (c_info->name)
-        flexarray_vappend(dm_args, "-domain-name", c_info->name, NULL);
-
-    if (vnc) {
-        char *vncarg;
-        if (vnc->display) {
-            if (vnc->listen && strchr(vnc->listen, ':') == NULL) {
-                vncarg = libxl__sprintf(gc, "%s:%d",
-                                  vnc->listen,
-                                  vnc->display);
-            } else {
-                vncarg = libxl__sprintf(gc, "127.0.0.1:%d", vnc->display);
-            }
-        } else if (vnc->listen) {
-            if (strchr(vnc->listen, ':') != NULL) {
-                vncarg = vnc->listen;
-            } else {
-                vncarg = libxl__sprintf(gc, "%s:0", vnc->listen);
-            }
-        } else {
-            vncarg = "127.0.0.1:0";
-        }
-        if (vnc->passwd && (vnc->passwd[0] != '\0'))
-            vncarg = libxl__sprintf(gc, "%s,password", vncarg);
-        flexarray_append(dm_args, "-vnc");
-        flexarray_append(dm_args, vncarg);
-
-        if (libxl_defbool_val(vnc->findunused)) {
-            flexarray_append(dm_args, "-vncunused");
-        }
-    }
-    if (sdl) {
-        flexarray_append(dm_args, "-sdl");
-        if (!libxl_defbool_val(sdl->opengl)) {
-            flexarray_append(dm_args, "-disable-opengl");
-        }
-        /* XXX sdl->{display,xauthority} into $DISPLAY/$XAUTHORITY */
-    }
-    if (keymap) {
-        flexarray_vappend(dm_args, "-k", keymap, NULL);
-    }
-    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
-        int ioemu_nics = 0;
-        int nr_set_cpus = 0;
-        char *s;
-
-        if (b_info->u.hvm.serial) {
-            flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial, NULL);
-        }
-
-        if (libxl_defbool_val(b_info->u.hvm.nographic) && (!sdl && !vnc)) {
-            flexarray_append(dm_args, "-nographic");
-        }
-
-        if (b_info->video_memkb) {
-            flexarray_vappend(dm_args, "-videoram",
-                    libxl__sprintf(gc, "%d",
-                                   libxl__sizekb_to_mb(b_info->video_memkb)),
-                    NULL);
-        }
-
-        switch (b_info->u.hvm.vga.kind) {
-        case LIBXL_VGA_INTERFACE_TYPE_STD:
-            flexarray_append(dm_args, "-std-vga");
-            break;
-        case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
-            break;
-        }
-
-        if (b_info->u.hvm.boot) {
-            flexarray_vappend(dm_args, "-boot", b_info->u.hvm.boot, NULL);
-        }
-        if (libxl_defbool_val(b_info->u.hvm.usb) || b_info->u.hvm.usbdevice) {
-            flexarray_append(dm_args, "-usb");
-            if (b_info->u.hvm.usbdevice) {
-                flexarray_vappend(dm_args,
-                                  "-usbdevice", b_info->u.hvm.usbdevice, NULL);
-            }
-        }
-        if (b_info->u.hvm.soundhw) {
-            flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, NULL);
-        }
-        if (libxl_defbool_val(b_info->u.hvm.acpi)) {
-            flexarray_append(dm_args, "-acpi");
-        }
-        if (b_info->max_vcpus > 1) {
-            flexarray_vappend(dm_args, "-vcpus",
-                              libxl__sprintf(gc, "%d", b_info->max_vcpus),
-                              NULL);
-        }
-
-        nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
-        s = libxl_bitmap_to_hex_string(CTX, &b_info->avail_vcpus);
-        flexarray_vappend(dm_args, "-vcpu_avail",
-                              libxl__sprintf(gc, "%s", s), NULL);
-        free(s);
-
-        for (i = 0; i < num_nics; i++) {
-            if (nics[i].nictype == LIBXL_NIC_TYPE_VIF_IOEMU) {
-                char *smac = libxl__sprintf(gc,
-                                   LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nics[i].mac));
-                const char *ifname = libxl__device_nic_devname(gc,
-                                                domid, nics[i].devid,
-                                                LIBXL_NIC_TYPE_VIF_IOEMU);
-                flexarray_vappend(dm_args,
-                                  "-net",
-                                  GCSPRINTF(
-                                      "nic,vlan=%d,macaddr=%s,model=%s",
-                                      nics[i].devid, smac, nics[i].model),
-                                  "-net",
-                                  GCSPRINTF(
-                                      "tap,vlan=%d,ifname=%s,bridge=%s,"
-                                      "script=%s,downscript=%s",
-                                      nics[i].devid, ifname, nics[i].bridge,
-                                      libxl_tapif_script(gc),
-                                      libxl_tapif_script(gc)),
-                                  NULL);
-                ioemu_nics++;
-            }
-        }
-        /* If we have no emulated nics, tell qemu not to create any */
-        if ( ioemu_nics == 0 ) {
-            flexarray_vappend(dm_args, "-net", "none", NULL);
-        }
-        if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
-            flexarray_append(dm_args, "-gfx_passthru");
-        }
-    } else {
-        if (!sdl && !vnc)
-            flexarray_append(dm_args, "-nographic");
-    }
-
-    if (state->saved_state) {
-        flexarray_vappend(dm_args, "-loadvm", state->saved_state, NULL);
-    }
-    for (i = 0; b_info->extra && b_info->extra[i] != NULL; i++)
-        flexarray_append(dm_args, b_info->extra[i]);
-    flexarray_append(dm_args, "-M");
-    switch (b_info->type) {
-    case LIBXL_DOMAIN_TYPE_PV:
-        flexarray_append(dm_args, "xenpv");
-        for (i = 0; b_info->extra_pv && b_info->extra_pv[i] != NULL; i++)
-            flexarray_append(dm_args, b_info->extra_pv[i]);
-        break;
-    case LIBXL_DOMAIN_TYPE_HVM:
-        flexarray_append(dm_args, "xenfv");
-        for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL; i++)
-            flexarray_append(dm_args, b_info->extra_hvm[i]);
-        break;
-    default:
-        abort();
-    }
-    flexarray_append(dm_args, NULL);
-    return (char **) flexarray_contents(dm_args);
-}
-
 static const char *qemu_disk_format_string(libxl_disk_format format)
 {
     switch (format) {
@@ -318,7 +143,7 @@ static char *dm_spice_options(libxl__gc 
     return opt;
 }
 
-static char ** libxl__build_device_model_args_new(libxl__gc *gc,
+static char ** libxl__build_device_model_args(libxl__gc *gc,
                                         const char *dm, int guest_domid,
                                         const libxl_domain_config *guest_config,
                                         const libxl__domain_build_state *state)
@@ -336,62 +161,106 @@ static char ** libxl__build_device_model
     flexarray_t *dm_args;
     int i;
     uint64_t ram_size;
+    int dm_new;
+
+    switch (guest_config->b_info.device_model_version) {
+    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
+        dm_new = 0;
+        break;
+    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
+        dm_new = 1;
+        break;
+    default:
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "unknown device model version %d",
+                         guest_config->b_info.device_model_version);
+        return NULL;
+    }
+
 
     dm_args = flexarray_make(gc, 16, 1);
 
-    flexarray_vappend(dm_args, dm,
-                      "-xen-domid",
-                      libxl__sprintf(gc, "%d", guest_domid), NULL);
+    /* Domain ID */
+    if (dm_new) {
+        flexarray_vappend(dm_args, dm,
+                          "-xen-domid",
+                          libxl__sprintf(gc, "%d", guest_domid), NULL);
+    } else {
+        flexarray_vappend(dm_args, dm,
+                          "-d", libxl__sprintf(gc, "%d", guest_domid), NULL);
+    }
 
-    flexarray_append(dm_args, "-chardev");
-    flexarray_append(dm_args,
-                     libxl__sprintf(gc, "socket,id=libxl-cmd,"
-                                    "path=%s/qmp-libxl-%d,server,nowait",
-                                    libxl__run_dir_path(), guest_domid));
+    if (dm_new) {
+        flexarray_append(dm_args, "-chardev");
+        flexarray_append(dm_args,
+                         libxl__sprintf(gc, "socket,id=libxl-cmd,"
+                                        "path=%s/qmp-libxl-%d,server,nowait",
+                                        libxl__run_dir_path(), guest_domid));
 
-    flexarray_append(dm_args, "-mon");
-    flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
+        flexarray_append(dm_args, "-mon");
+        flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
 
-    if (b_info->type == LIBXL_DOMAIN_TYPE_PV) {
-        flexarray_append(dm_args, "-xen-attach");
+        if (b_info->type == LIBXL_DOMAIN_TYPE_PV) {
+            flexarray_append(dm_args, "-xen-attach");
+        }
     }
 
     if (c_info->name) {
-        flexarray_vappend(dm_args, "-name", c_info->name, NULL);
+        if ( dm_new )
+            flexarray_vappend(dm_args, "-name", c_info->name, NULL);
+        else
+            flexarray_vappend(dm_args, "-domain-name", c_info->name, NULL);
     }
+
     if (vnc) {
-        int display = 0;
-        const char *addr = "127.0.0.1";
         char *vncarg = NULL;
 
         flexarray_append(dm_args, "-vnc");
 
-        if (vnc->display) {
-            display = vnc->display;
-            if (vnc->listen && strchr(vnc->listen, ':') == NULL) {
-                addr = vnc->listen;
+        /*
+         * If vnc->listen is present and contains a :, and
+         *  - vnc->display is 0, use vnc->listen
+         *  - vnc->display is non-zero, be confused
+         * If vnc->listen is present but doesn't, use vnc->listen:vnc->display.
+         * If vnc->listen is not present, use 127.0.0.1:vnc->display
+         * (Remembering that vnc->display already defaults to 0.)
+         */
+        if (vnc->listen) {
+            if (strchr(vnc->listen, ':') != NULL) {
+                if (vnc->display) {
+                    LOG(ERROR, "vncdisplay set, vnclisten contains display");
+                    return NULL;
+                }
+                vncarg = vnc->listen;
+            } else {
+                vncarg = libxl__sprintf(gc, "%s:%d", vnc->listen,
+                                        vnc->display);
             }
-        } else if (vnc->listen) {
-            addr = vnc->listen;
-        }
+        } else
+            vncarg = libxl__sprintf(gc, "127.0.0.1:%d", vnc->display);
 
-        if (strchr(addr, ':') != NULL)
-            vncarg = libxl__sprintf(gc, "%s", addr);
-        else
-            vncarg = libxl__sprintf(gc, "%s:%d", addr, display);
         if (vnc->passwd && vnc->passwd[0]) {
             vncarg = libxl__sprintf(gc, "%s,password", vncarg);
         }
-        if (libxl_defbool_val(vnc->findunused)) {
+
+        if (dm_new && libxl_defbool_val(vnc->findunused)) {
             /* This option asks to QEMU to try this number of port before to
              * give up.  So QEMU will try ports between $display and $display +
              * 99.  This option needs to be the last one of the vnc options. */
             vncarg = libxl__sprintf(gc, "%s,to=99", vncarg);
         }
+
         flexarray_append(dm_args, vncarg);
+
+        if (!dm_new && libxl_defbool_val(vnc->findunused)) {
+            flexarray_append(dm_args, "-vncunused");
+        }
     }
     if (sdl) {
         flexarray_append(dm_args, "-sdl");
+        
+        if (!dm_new && !libxl_defbool_val(sdl->opengl)) {
+            flexarray_append(dm_args, "-disable-opengl");
+        }
         /* XXX sdl->{display,xauthority} into $DISPLAY/$XAUTHORITY */
     }
 
@@ -414,7 +283,7 @@ static char ** libxl__build_device_model
             flexarray_append(dm_args, "-nographic");
         }
 
-        if (libxl_defbool_val(b_info->u.hvm.spice.enable)) {
+        if (dm_new && libxl_defbool_val(b_info->u.hvm.spice.enable)) {
             const libxl_spice_info *spice = &b_info->u.hvm.spice;
             char *spiceoptions = dm_spice_options(gc, spice);
             if (!spiceoptions)
@@ -424,19 +293,35 @@ static char ** libxl__build_device_model
             flexarray_append(dm_args, spiceoptions);
         }
 
-        switch (b_info->u.hvm.vga.kind) {
-        case LIBXL_VGA_INTERFACE_TYPE_STD:
-            flexarray_vappend(dm_args, "-vga", "std", NULL);
-            break;
-        case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
-            flexarray_vappend(dm_args, "-vga", "cirrus", NULL);
-            break;
+        if ( dm_new ) {
+            switch (b_info->u.hvm.vga.kind) {
+            case LIBXL_VGA_INTERFACE_TYPE_STD:
+                flexarray_vappend(dm_args, "-vga", "std", NULL);
+                break;
+            case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
+                flexarray_vappend(dm_args, "-vga", "cirrus", NULL);
+                break;
+            }
+        } else {
+            switch (b_info->u.hvm.vga.kind) {
+            case LIBXL_VGA_INTERFACE_TYPE_STD:
+                flexarray_append(dm_args, "-std-vga");
+                break;
+            case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
+                break;
+            }
         }
 
         if (b_info->u.hvm.boot) {
-            flexarray_vappend(dm_args, "-boot",
-                    libxl__sprintf(gc, "order=%s", b_info->u.hvm.boot), NULL);
+            if (dm_new)
+                flexarray_vappend(dm_args, "-boot",
+                                  libxl__sprintf(gc, "order=%s",
+                                                 b_info->u.hvm.boot), NULL);
+            else
+                flexarray_vappend(dm_args, "-boot", b_info->u.hvm.boot, NULL);
+
         }
+
         if (libxl_defbool_val(b_info->u.hvm.usb) || b_info->u.hvm.usbdevice) {
             flexarray_append(dm_args, "-usb");
             if (b_info->u.hvm.usbdevice) {
@@ -450,19 +335,39 @@ static char ** libxl__build_device_model
         if (!libxl_defbool_val(b_info->u.hvm.acpi)) {
             flexarray_append(dm_args, "-no-acpi");
         }
-        if (b_info->max_vcpus > 1) {
-            flexarray_append(dm_args, "-smp");
-            if (b_info->avail_vcpus.size) {
-                int nr_set_cpus = 0;
-                nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
 
-                flexarray_append(dm_args, libxl__sprintf(gc, "%d,maxcpus=%d",
-                                                         b_info->max_vcpus,
-                                                         nr_set_cpus));
-            } else
-                flexarray_append(dm_args, libxl__sprintf(gc, "%d",
-                                                         b_info->max_vcpus));
+        if (dm_new)
+        {
+            if (b_info->max_vcpus > 1) {
+                flexarray_append(dm_args, "-smp");
+                if (b_info->avail_vcpus.size) {
+                    int nr_set_cpus = 0;
+                    nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
+                    
+                    flexarray_append(dm_args,
+                                     libxl__sprintf(gc, "%d,maxcpus=%d",
+                                                    b_info->max_vcpus,
+                                                    nr_set_cpus));
+                } else
+                    flexarray_append(dm_args,
+                                     libxl__sprintf(gc, "%d",
+                                                    b_info->max_vcpus));
+            }
+        } else {
+            int nr_set_cpus = 0;
+            char *s;
+            if (b_info->max_vcpus > 1) {
+                flexarray_vappend(dm_args, "-vcpus",
+                                  libxl__sprintf(gc, "%d", b_info->max_vcpus),
+                                  NULL);
+            }
+            nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
+            s = libxl_bitmap_to_hex_string(CTX, &b_info->avail_vcpus);
+            flexarray_vappend(dm_args, "-vcpu_avail",
+                              libxl__sprintf(gc, "%s", s), NULL);
+            free(s);
         }
+
         for (i = 0; i < num_nics; i++) {
             if (nics[i].nictype == LIBXL_NIC_TYPE_VIF_IOEMU) {
                 char *smac = libxl__sprintf(gc,
@@ -470,18 +375,35 @@ static char ** libxl__build_device_model
                 const char *ifname = libxl__device_nic_devname(gc,
                                                 guest_domid, nics[i].devid,
                                                 LIBXL_NIC_TYPE_VIF_IOEMU);
-                flexarray_append(dm_args, "-device");
-                flexarray_append(dm_args,
-                   libxl__sprintf(gc, "%s,id=nic%d,netdev=net%d,mac=%s",
-                                                nics[i].model, nics[i].devid,
-                                                nics[i].devid, smac));
-                flexarray_append(dm_args, "-netdev");
-                flexarray_append(dm_args, GCSPRINTF(
-                                          "type=tap,id=net%d,ifname=%s,"
+                if (dm_new) {
+                    flexarray_append(dm_args, "-device");
+                    flexarray_append(dm_args,
+                          libxl__sprintf(gc, "%s,id=nic%d,netdev=net%d,mac=%s",
+                                       nics[i].model, nics[i].devid,
+                                       nics[i].devid, smac));
+                    flexarray_append(dm_args, "-netdev");
+                    flexarray_append(dm_args, GCSPRINTF(
+                                         "type=tap,id=net%d,ifname=%s,"
+                                         "script=%s,downscript=%s",
+                                         nics[i].devid, ifname,
+                                         libxl_tapif_script(gc),
+                                         libxl_tapif_script(gc)));
+                } else {
+                    flexarray_vappend(dm_args,
+                                      "-net",
+                                      GCSPRINTF(
+                                          "nic,vlan=%d,macaddr=%s,model=%s",
+                                          nics[i].devid, smac, nics[i].model),
+                                      "-net",
+                                      GCSPRINTF(
+                                          "tap,vlan=%d,ifname=%s,bridge=%s,"
                                           "script=%s,downscript=%s",
                                           nics[i].devid, ifname,
+                                          nics[i].bridge,
                                           libxl_tapif_script(gc),
-                                          libxl_tapif_script(gc)));
+                                          libxl_tapif_script(gc)),
+                                      NULL);
+                }
                 ioemu_nics++;
             }
         }
@@ -500,10 +422,15 @@ static char ** libxl__build_device_model
     }
 
     if (state->saved_state) {
-        /* This file descriptor is meant to be used by QEMU */
-        int migration_fd = open(state->saved_state, O_RDONLY);
-        flexarray_append(dm_args, "-incoming");
-        flexarray_append(dm_args, libxl__sprintf(gc, "fd:%d", migration_fd));
+        if (dm_new) {
+            /* This file descriptor is meant to be used by QEMU */
+            int migration_fd = open(state->saved_state, O_RDONLY);
+            flexarray_append(dm_args, "-incoming");
+            flexarray_append(dm_args,
+                             libxl__sprintf(gc, "fd:%d", migration_fd));
+        } else {
+            flexarray_vappend(dm_args, "-loadvm", state->saved_state, NULL);
+        }
     }
     for (i = 0; b_info->extra && b_info->extra[i] != NULL; i++)
         flexarray_append(dm_args, b_info->extra[i]);
@@ -523,6 +450,9 @@ static char ** libxl__build_device_model
         abort();
     }
 
+    if (!dm_new)
+        goto finish;
+
     ram_size = libxl__sizekb_to_mb(b_info->max_memkb - b_info->video_memkb);
     flexarray_append(dm_args, "-m");
     flexarray_append(dm_args, libxl__sprintf(gc, "%"PRId64, ram_size));
@@ -585,33 +515,11 @@ static char ** libxl__build_device_model
             flexarray_append(dm_args, drive);
         }
     }
+finish:
     flexarray_append(dm_args, NULL);
     return (char **) flexarray_contents(dm_args);
 }
 
-static char ** libxl__build_device_model_args(libxl__gc *gc,
-                                        const char *dm, int guest_domid,
-                                        const libxl_domain_config *guest_config,
-                                        const libxl__domain_build_state *state)
-{
-    libxl_ctx *ctx = libxl__gc_owner(gc);
-
-    switch (guest_config->b_info.device_model_version) {
-    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
-        return libxl__build_device_model_args_old(gc, dm,
-                                                  guest_domid, guest_config,
-                                                  state);
-    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
-        return libxl__build_device_model_args_new(gc, dm,
-                                                  guest_domid, guest_config,
-                                                  state);
-    default:
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "unknown device model version %d",
-                         guest_config->b_info.device_model_version);
-        return NULL;
-    }
-}
-
 static void libxl__dm_vifs_from_hvm_guest_config(libxl__gc *gc,
                                     libxl_domain_config * const guest_config,
                                     libxl_domain_config *dm_config)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:43:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:43:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTgR-0002XG-KY; Fri, 30 Nov 2012 16:43:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeTgQ-0002XB-7J
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 16:43:22 +0000
Received: from [85.158.138.51:24827] by server-4.bemta-3.messagelabs.com id
	41/4D-30023-922E8B05; Fri, 30 Nov 2012 16:43:21 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1354293798!24283161!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30264 invoked from network); 30 Nov 2012 16:43:18 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:43:18 -0000
X-IronPort-AV: E=Sophos;i="4.84,192,1355097600"; d="scan'208";a="16096735"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 16:42:44 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 16:42:41 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeTfk-0007DH-Uu;
	Fri, 30 Nov 2012 16:42:40 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeTfk-0005Y3-TN;
	Fri, 30 Nov 2012 16:42:40 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <E1TeTfk-0005Y3-TN@woking.cam.xci-test.com>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 16:42:40 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com, keir@xen.org, stefano.stabellini@eu.citrix.com
Subject: [Xen-devel] [xen-unstable bisection] complete test-amd64-amd64-pv
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

branch xen-unstable
xen branch xen-unstable
job test-amd64-amd64-pv
test xen-boot

Tree: linux git://xenbits.xen.org/linux-pvops.git
Tree: qemu git://xenbits.xen.org/staging/qemu-xen-unstable.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-unstable.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-unstable.hg

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-unstable.hg
  Bug introduced:  ba90ecb0231f
  Bug not present: 0bc3a489018f


  changeset:   26198:ba90ecb0231f
  user:        Jan Beulich <jbeulich@suse.com>
  date:        Wed Nov 28 10:07:11 2012 +0100
      
      AMD IOMMU: include IOMMU interrupt information in 'M' debug key output
      
      Note that this also adds a few pieces missing from c/s
      25903:5e4a00b4114c (relevant only when the PCI MSI mask bit is
      supported by an IOMMU, which apparently isn't the case for existing
      implementations).
      
      Signed-off-by: Jan Beulich <jbeulich@suse.com>
      Acked-by: Keir Fraser <keir@xen.org>
      
      


For bisection revision-tuple graph see:
   http://www.chiark.greenend.org.uk/~xensrcts/results/bisect.xen-unstable.test-amd64-amd64-pv.xen-boot.html
Revision IDs in each graph node refer, respectively, to the Trees above.

----------------------------------------
Searching for failure / basis pass:
 14506 fail [host=moss-bug] / 14482 [host=gall-mite] 14480 [host=woodlouse] 14477 [host=potato-beetle] 14476 [host=earwig] 14475 [host=lace-bug] 14474 [host=field-cricket] 14473 [host=lake-frog] 14469 ok.
Failure / basis pass flights: 14506 / 14469
Tree: linux git://xenbits.xen.org/linux-pvops.git
Tree: qemu git://xenbits.xen.org/staging/qemu-xen-unstable.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-unstable.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-unstable.hg
Latest a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 9d88ac6046d8
Basis pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 0049de3827bc
Generating revisions with ./adhoc-revtuple-generator  git://xenbits.xen.org/linux-pvops.git#a938a246d34912423c560f475ccf1ce0c71d9d00-a938a246d34912423c560f475ccf1ce0c71d9d00 git://xenbits.xen.org/staging/qemu-xen-unstable.git#bacc0d302445c75f18f4c826750fb5853b60e7ca-bacc0d302445c75f18f4c826750fb5853b60e7ca git://xenbits.xen.org/staging/qemu-upstream-unstable.git#cdf4d2bb4006805f209712fbb8ed1f83127e9984-1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c http://xenbits.xen.org/hg/staging/xen-unstable.hg#0049de3827bc-9d88ac6046d8
using cache /export/home/osstest/repos/git-cache...
using cache /export/home/osstest/repos/git-cache...
locked cache /export/home/osstest/repos/git-cache...
processing ./cacheing-git clone --bare git://xenbits.xen.org/staging/qemu-upstream-unstable.git /export/home/osstest/repos/qemu-upstream-unstable...
Initialized empty Git repository in /export/home/osstest/repos/qemu-upstream-unstable/
updating cache /export/home/osstest/repos/git-cache qemu-upstream-unstable...
adhoc-revtuple-generator: tree discontiguous: qemu-upstream-unstable
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-unstable.hg
searching for changes
no changes found
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-unstable.hg
searching for changes
no changes found
Loaded 385 nodes in revision graph
Searching for test results:
 14469 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 0049de3827bc
 14473 [host=lake-frog]
 14474 [host=field-cricket]
 14475 [host=lace-bug]
 14476 [host=earwig]
 14477 [host=potato-beetle]
 14509 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 0bc3a489018f
 14480 [host=woodlouse]
 14513 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c ba90ecb0231f
 14506 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 9d88ac6046d8
 14482 [host=gall-mite]
 14514 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 0bc3a489018f
 14494 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 9d88ac6046d8
 14516 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c ba90ecb0231f
 14497 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 0049de3827bc
 14498 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 9d88ac6046d8
 14499 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 7670eabcbafc
 14500 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 836697b19746
 14503 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 0bc3a489018f
 14496 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 9d88ac6046d8
 14504 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c ba90ecb0231f
Searching for interesting versions
 Result found: flight 14469 (pass), for basis pass
 Result found: flight 14494 (fail), for basis failure
 Repro found: flight 14497 (pass), for basis pass
 Repro found: flight 14498 (fail), for basis failure
 0 revisions at a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 0bc3a489018f
No revisions left to test, checking graph state.
 Result found: flight 14503 (pass), for last pass
 Result found: flight 14504 (fail), for first failure
 Repro found: flight 14509 (pass), for last pass
 Repro found: flight 14513 (fail), for first failure
 Repro found: flight 14514 (pass), for last pass
 Repro found: flight 14516 (fail), for first failure

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-unstable.hg
  Bug introduced:  ba90ecb0231f
  Bug not present: 0bc3a489018f

pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-unstable.hg
searching for changes
no changes found

  changeset:   26198:ba90ecb0231f
  user:        Jan Beulich <jbeulich@suse.com>
  date:        Wed Nov 28 10:07:11 2012 +0100
      
      AMD IOMMU: include IOMMU interrupt information in 'M' debug key output
      
      Note that this also adds a few pieces missing from c/s
      25903:5e4a00b4114c (relevant only when the PCI MSI mask bit is
      supported by an IOMMU, which apparently isn't the case for existing
      implementations).
      
      Signed-off-by: Jan Beulich <jbeulich@suse.com>
      Acked-by: Keir Fraser <keir@xen.org>
      
      

Revision graph left in /home/xc_osstest/results/bisect.xen-unstable.test-amd64-amd64-pv.xen-boot.{dot,ps,png,html}.
----------------------------------------
14516: tolerable ALL FAIL

flight 14516 xen-unstable real-bisect [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14516/

Failures :-/ but no regressions.

Tests which did not succeed,
including tests which could not be run:
 test-amd64-amd64-pv           5 xen-boot                fail baseline untested


jobs:
 test-amd64-amd64-pv                                          fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:43:38 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:43:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTgR-0002XG-KY; Fri, 30 Nov 2012 16:43:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeTgQ-0002XB-7J
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 16:43:22 +0000
Received: from [85.158.138.51:24827] by server-4.bemta-3.messagelabs.com id
	41/4D-30023-922E8B05; Fri, 30 Nov 2012 16:43:21 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1354293798!24283161!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30264 invoked from network); 30 Nov 2012 16:43:18 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:43:18 -0000
X-IronPort-AV: E=Sophos;i="4.84,192,1355097600"; d="scan'208";a="16096735"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 16:42:44 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 16:42:41 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeTfk-0007DH-Uu;
	Fri, 30 Nov 2012 16:42:40 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeTfk-0005Y3-TN;
	Fri, 30 Nov 2012 16:42:40 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <E1TeTfk-0005Y3-TN@woking.cam.xci-test.com>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 16:42:40 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com, keir@xen.org, stefano.stabellini@eu.citrix.com
Subject: [Xen-devel] [xen-unstable bisection] complete test-amd64-amd64-pv
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

branch xen-unstable
xen branch xen-unstable
job test-amd64-amd64-pv
test xen-boot

Tree: linux git://xenbits.xen.org/linux-pvops.git
Tree: qemu git://xenbits.xen.org/staging/qemu-xen-unstable.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-unstable.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-unstable.hg

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-unstable.hg
  Bug introduced:  ba90ecb0231f
  Bug not present: 0bc3a489018f


  changeset:   26198:ba90ecb0231f
  user:        Jan Beulich <jbeulich@suse.com>
  date:        Wed Nov 28 10:07:11 2012 +0100
      
      AMD IOMMU: include IOMMU interrupt information in 'M' debug key output
      
      Note that this also adds a few pieces missing from c/s
      25903:5e4a00b4114c (relevant only when the PCI MSI mask bit is
      supported by an IOMMU, which apparently isn't the case for existing
      implementations).
      
      Signed-off-by: Jan Beulich <jbeulich@suse.com>
      Acked-by: Keir Fraser <keir@xen.org>
      
      


For bisection revision-tuple graph see:
   http://www.chiark.greenend.org.uk/~xensrcts/results/bisect.xen-unstable.test-amd64-amd64-pv.xen-boot.html
Revision IDs in each graph node refer, respectively, to the Trees above.

----------------------------------------
Searching for failure / basis pass:
 14506 fail [host=moss-bug] / 14482 [host=gall-mite] 14480 [host=woodlouse] 14477 [host=potato-beetle] 14476 [host=earwig] 14475 [host=lace-bug] 14474 [host=field-cricket] 14473 [host=lake-frog] 14469 ok.
Failure / basis pass flights: 14506 / 14469
Tree: linux git://xenbits.xen.org/linux-pvops.git
Tree: qemu git://xenbits.xen.org/staging/qemu-xen-unstable.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-unstable.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-unstable.hg
Latest a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 9d88ac6046d8
Basis pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 0049de3827bc
Generating revisions with ./adhoc-revtuple-generator  git://xenbits.xen.org/linux-pvops.git#a938a246d34912423c560f475ccf1ce0c71d9d00-a938a246d34912423c560f475ccf1ce0c71d9d00 git://xenbits.xen.org/staging/qemu-xen-unstable.git#bacc0d302445c75f18f4c826750fb5853b60e7ca-bacc0d302445c75f18f4c826750fb5853b60e7ca git://xenbits.xen.org/staging/qemu-upstream-unstable.git#cdf4d2bb4006805f209712fbb8ed1f83127e9984-1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c http://xenbits.xen.org/hg/staging/xen-unstable.hg#0049de3827bc-9d88ac6046d8
using cache /export/home/osstest/repos/git-cache...
using cache /export/home/osstest/repos/git-cache...
locked cache /export/home/osstest/repos/git-cache...
processing ./cacheing-git clone --bare git://xenbits.xen.org/staging/qemu-upstream-unstable.git /export/home/osstest/repos/qemu-upstream-unstable...
Initialized empty Git repository in /export/home/osstest/repos/qemu-upstream-unstable/
updating cache /export/home/osstest/repos/git-cache qemu-upstream-unstable...
adhoc-revtuple-generator: tree discontiguous: qemu-upstream-unstable
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-unstable.hg
searching for changes
no changes found
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-unstable.hg
searching for changes
no changes found
Loaded 385 nodes in revision graph
Searching for test results:
 14469 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 0049de3827bc
 14473 [host=lake-frog]
 14474 [host=field-cricket]
 14475 [host=lace-bug]
 14476 [host=earwig]
 14477 [host=potato-beetle]
 14509 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 0bc3a489018f
 14480 [host=woodlouse]
 14513 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c ba90ecb0231f
 14506 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 9d88ac6046d8
 14482 [host=gall-mite]
 14514 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 0bc3a489018f
 14494 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 9d88ac6046d8
 14516 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c ba90ecb0231f
 14497 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca cdf4d2bb4006805f209712fbb8ed1f83127e9984 0049de3827bc
 14498 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 9d88ac6046d8
 14499 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 7670eabcbafc
 14500 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 836697b19746
 14503 pass a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 0bc3a489018f
 14496 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 9d88ac6046d8
 14504 fail a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c ba90ecb0231f
Searching for interesting versions
 Result found: flight 14469 (pass), for basis pass
 Result found: flight 14494 (fail), for basis failure
 Repro found: flight 14497 (pass), for basis pass
 Repro found: flight 14498 (fail), for basis failure
 0 revisions at a938a246d34912423c560f475ccf1ce0c71d9d00 bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 0bc3a489018f
No revisions left to test, checking graph state.
 Result found: flight 14503 (pass), for last pass
 Result found: flight 14504 (fail), for first failure
 Repro found: flight 14509 (pass), for last pass
 Repro found: flight 14513 (fail), for first failure
 Repro found: flight 14514 (pass), for last pass
 Repro found: flight 14516 (fail), for first failure

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-unstable.hg
  Bug introduced:  ba90ecb0231f
  Bug not present: 0bc3a489018f

pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-unstable.hg
searching for changes
no changes found

  changeset:   26198:ba90ecb0231f
  user:        Jan Beulich <jbeulich@suse.com>
  date:        Wed Nov 28 10:07:11 2012 +0100
      
      AMD IOMMU: include IOMMU interrupt information in 'M' debug key output
      
      Note that this also adds a few pieces missing from c/s
      25903:5e4a00b4114c (relevant only when the PCI MSI mask bit is
      supported by an IOMMU, which apparently isn't the case for existing
      implementations).
      
      Signed-off-by: Jan Beulich <jbeulich@suse.com>
      Acked-by: Keir Fraser <keir@xen.org>
      
      

Revision graph left in /home/xc_osstest/results/bisect.xen-unstable.test-amd64-amd64-pv.xen-boot.{dot,ps,png,html}.
----------------------------------------
14516: tolerable ALL FAIL

flight 14516 xen-unstable real-bisect [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14516/

Failures :-/ but no regressions.

Tests which did not succeed,
including tests which could not be run:
 test-amd64-amd64-pv           5 xen-boot                fail baseline untested


jobs:
 test-amd64-amd64-pv                                          fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:46:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:46:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTik-0002d2-7t; Fri, 30 Nov 2012 16:45:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeTii-0002cx-R7
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 16:45:45 +0000
Received: from [85.158.137.99:26477] by server-10.bemta-3.messagelabs.com id
	28/8D-19806-3B2E8B05; Fri, 30 Nov 2012 16:45:39 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354293938!14208905!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27116 invoked from network); 30 Nov 2012 16:45:38 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:45:38 -0000
X-IronPort-AV: E=Sophos;i="4.84,192,1355097600"; d="scan'208";a="16096787"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 16:45:38 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 16:45:38 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeTib-0007EX-Rk;
	Fri, 30 Nov 2012 16:45:37 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeTib-0003hW-Q8;
	Fri, 30 Nov 2012 16:45:37 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14515-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 16:45:37 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14515: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14515 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14515/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-amd64                   4 xen-build                 fail REGR. vs. 14482
 build-amd64-oldkern           4 xen-build                 fail REGR. vs. 14482
 build-i386                    4 xen-build                 fail REGR. vs. 14482
 build-i386-oldkern            4 xen-build                 fail REGR. vs. 14482

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-qemut-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win7-amd64  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1  1 xen-build-check(1)     blocked n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win-vcpus1  1 xen-build-check(1)          blocked n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-qemut-winxpsp3  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-qemut-win     1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-qemut-win    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-winxpsp3  1 xen-build-check(1)           blocked n/a

version targeted for testing:
 xen                  8037099671f3
baseline version:
 xen                  1c69c938f641

------------------------------------------------------------
People who touched revisions under test:
  Acked-by: Tim Deegan <tim@xen.org>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Dongxiao Xu <dongxiao.xu@intel.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jun Nakajima <jun.nakajima@intel.com>
  Keir Fraser <keir@xen.org>
  Kouya Shimura <kouya@jp.fujitsu.com>
  Roger Pau Monn? <roger.pau@citrix.com>
  Samuel Thibault <samuel.thibault@ens-lyon.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
  Wei Liu <wei.liu2@citrix.com>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  fail    
 build-i386                                                   fail    
 build-amd64-oldkern                                          fail    
 build-i386-oldkern                                           fail    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemut-rhel6hvm-amd                           blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemut-win7-amd64                         blocked 
 test-amd64-i386-xl-qemut-win7-amd64                          blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemut-rhel6hvm-intel                         blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-qemut-win-vcpus1                             blocked 
 test-amd64-i386-xl-qemut-win-vcpus1                          blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-qemut-win                                   blocked 
 test-amd64-i386-qemut-win                                    blocked 
 test-amd64-amd64-xl-qemut-win                                blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-i386-xend-qemut-winxpsp3                          blocked 
 test-amd64-amd64-xl-qemut-winxpsp3                           blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 415 lines long.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:46:00 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:46:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTik-0002d2-7t; Fri, 30 Nov 2012 16:45:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeTii-0002cx-R7
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 16:45:45 +0000
Received: from [85.158.137.99:26477] by server-10.bemta-3.messagelabs.com id
	28/8D-19806-3B2E8B05; Fri, 30 Nov 2012 16:45:39 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354293938!14208905!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27116 invoked from network); 30 Nov 2012 16:45:38 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:45:38 -0000
X-IronPort-AV: E=Sophos;i="4.84,192,1355097600"; d="scan'208";a="16096787"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 16:45:38 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 16:45:38 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeTib-0007EX-Rk;
	Fri, 30 Nov 2012 16:45:37 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeTib-0003hW-Q8;
	Fri, 30 Nov 2012 16:45:37 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14515-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 16:45:37 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14515: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14515 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14515/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-amd64                   4 xen-build                 fail REGR. vs. 14482
 build-amd64-oldkern           4 xen-build                 fail REGR. vs. 14482
 build-i386                    4 xen-build                 fail REGR. vs. 14482
 build-i386-oldkern            4 xen-build                 fail REGR. vs. 14482

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-qemut-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win7-amd64  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1  1 xen-build-check(1)     blocked n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win-vcpus1  1 xen-build-check(1)          blocked n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-qemut-winxpsp3  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-qemut-win     1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-qemut-win    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-winxpsp3  1 xen-build-check(1)           blocked n/a

version targeted for testing:
 xen                  8037099671f3
baseline version:
 xen                  1c69c938f641

------------------------------------------------------------
People who touched revisions under test:
  Acked-by: Tim Deegan <tim@xen.org>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Dongxiao Xu <dongxiao.xu@intel.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jun Nakajima <jun.nakajima@intel.com>
  Keir Fraser <keir@xen.org>
  Kouya Shimura <kouya@jp.fujitsu.com>
  Roger Pau Monn? <roger.pau@citrix.com>
  Samuel Thibault <samuel.thibault@ens-lyon.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
  Wei Liu <wei.liu2@citrix.com>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  fail    
 build-i386                                                   fail    
 build-amd64-oldkern                                          fail    
 build-i386-oldkern                                           fail    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemut-rhel6hvm-amd                           blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemut-win7-amd64                         blocked 
 test-amd64-i386-xl-qemut-win7-amd64                          blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemut-rhel6hvm-intel                         blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-qemut-win-vcpus1                             blocked 
 test-amd64-i386-xl-qemut-win-vcpus1                          blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-qemut-win                                   blocked 
 test-amd64-i386-qemut-win                                    blocked 
 test-amd64-amd64-xl-qemut-win                                blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-i386-xend-qemut-winxpsp3                          blocked 
 test-amd64-amd64-xl-qemut-winxpsp3                           blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 415 lines long.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 16:53:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:53:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTqO-0003B3-6r; Fri, 30 Nov 2012 16:53:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TeTqL-0003Ay-Ms
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 16:53:38 +0000
Received: from [85.158.143.99:2166] by server-1.bemta-4.messagelabs.com id
	98/17-27934-F84E8B05; Fri, 30 Nov 2012 16:53:35 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1354294411!17781555!1
X-Originating-IP: [209.85.212.43]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32377 invoked from network); 30 Nov 2012 16:53:32 -0000
Received: from mail-vb0-f43.google.com (HELO mail-vb0-f43.google.com)
	(209.85.212.43)
	by server-8.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:53:32 -0000
Received: by mail-vb0-f43.google.com with SMTP id fr13so1092766vbb.30
	for <xen-devel@lists.xensource.com>;
	Fri, 30 Nov 2012 08:53:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=x0Kzr/gu4VCNEVwrVJH2uljvXI0NrDtZUIzl9SyfBoc=;
	b=j/XHpoxs9LfNwNlbvs5lUonSgthV5X2/v0TLhfIZyIZCEN3QVoxORGCAnokME1LmXx
	DwP/BwHgKh2t2I58ifAp59kzpQB9IX8FO8nMzgKLCQmXpjFH+oEhrj5reuGAqCcXBLGt
	DWKPBVTS+nXcB7XPKKj9qPj1lyAuXavCzLDbI1I2byhKfVwZrUAJpIwqUT6zZ/jUAqh+
	KM228k061x83+ZlncQA4bQQHtXzTPCZUJC7V9VecenhbUfVkjfHjK37qxf3ZjnTEEQV9
	KW5B+GPvD8oU6BWyJysQchaqSPuTf29qwroahpjUYmyPMT5zu1MWHATPYlcvf47Nh+1i
	SaUw==
MIME-Version: 1.0
Received: by 10.221.11.2 with SMTP id pc2mr1500516vcb.10.1354294411384; Fri,
	30 Nov 2012 08:53:31 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Fri, 30 Nov 2012 08:53:31 -0800 (PST)
In-Reply-To: <722da032ac90c0e1a78b.1354292656@elijah>
References: <patchbomb.1354292655@elijah>
	<722da032ac90c0e1a78b.1354292656@elijah>
Date: Fri, 30 Nov 2012 16:53:31 +0000
X-Google-Sender-Auth: Ng4HeGU6yO5wlS2dxosAwvDxoHY
Message-ID: <CAFLBxZYekXsegjnn9vv8MtH5JMvoj7pKmPLP_YQ0Ge68438BbA@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <ian.jackson@xen.org>
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 1 of 4 v2] libxl: Combine device model arg
 build functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2341031737812672154=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============2341031737812672154==
Content-Type: multipart/alternative; boundary=bcaec54eec404fd66a04cfb93d0c

--bcaec54eec404fd66a04cfb93d0c
Content-Type: text/plain; charset=ISO-8859-1

This patch also provides an easy way to trigger an interesting "failure to
handle failure" bug in libxl.

To reproduce:
* Apply *only* this patch, and not patch 2 in this series (which filters it
out at the xl level)
* Create a config file where vnclisten has a display number, and vncdisplay
is non-zero; e.g.:
 vnclisten="0.0.0.0:1"
 vncdisplay=1

(vncdisplay=0 is indistinguishable, to xl, from not having it set at all.)

The result is a set of error messages like this:

libxl: error: libxl_dm.c:231:libxl__build_device_model_args: vncdisplay
set, but vnclisten also contains adisplay number Too confused to continue.
libxl: error: libxl_dm.c:1113:device_model_spawn_outcome: (null): spawn
failed (rc=-3)
libxl: error: libxl_exec.c:118:libxl_report_child_exitstatus:
/etc/xen/scripts/vif-bridge add [21168] exited with error status 1
libxl: error: libxl_create.c:1117:domcreate_attach_vtpms: unable to add nic
devices
libxl: error: libxl_dm.c:1140:libxl__destroy_device_model: could not find
device-model's pid for dom 25
libxl: error: libxl.c:1414:libxl__destroy_domid:
libxl__destroy_device_model failed for 25

Obviously the failure in libxl__build_device_model_args() failed to abort
the domain-building process, and it continued to try to run vif and vtpm
setups.

 -George



On Fri, Nov 30, 2012 at 4:24 PM, George Dunlap
<george.dunlap@eu.citrix.com>wrote:

> # HG changeset patch
> # User George Dunlap <george.dunlap@eu.citrix.com>
> # Date 1354287957 0
> # Node ID 722da032ac90c0e1a78b1154fa588bf295d1f009
> # Parent  ae6fb202b233af815466055d9f1a635802a50855
> libxl: Combine device model arg build functions
>
> qemu-traditional and qemu-upstream have some differences in the way
> the arguments need to be passed.  At the moment, this is dealt with by
> having two entirely separate functions, libxl__build_device_model_args_new
> and libxl__build_device_model_args_old.
>
> However, at least 80% of these are the same; this means that fixes or
> additions to one may not make it into the other.  Furthermore, there
> are some unaccounable differences in implementation.
>
> This patch combines the two functions into one, choosing between old
> and new implementations as necessary.
>
> It also makes the following changes to the vnc generation code:
> * Simplifies and comments it, making it easier to read and grok
> * Throws an error if duplicate values of display are set, rather
>   than the current very un-intuitive behavior.
>
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
>
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -95,181 +95,6 @@ static const char *dm_keymap(const libxl
>          return NULL;
>  }
>
> -static char ** libxl__build_device_model_args_old(libxl__gc *gc,
> -                                        const char *dm, int domid,
> -                                        const libxl_domain_config
> *guest_config,
> -                                        const libxl__domain_build_state
> *state)
> -{
> -    const libxl_domain_create_info *c_info = &guest_config->c_info;
> -    const libxl_domain_build_info *b_info = &guest_config->b_info;
> -    const libxl_device_nic *nics = guest_config->nics;
> -    const libxl_vnc_info *vnc = libxl__dm_vnc(guest_config);
> -    const libxl_sdl_info *sdl = dm_sdl(guest_config);
> -    const int num_nics = guest_config->num_nics;
> -    const char *keymap = dm_keymap(guest_config);
> -    int i;
> -    flexarray_t *dm_args;
> -    dm_args = flexarray_make(gc, 16, 1);
> -
> -    flexarray_vappend(dm_args, dm,
> -                      "-d", libxl__sprintf(gc, "%d", domid), NULL);
> -
> -    if (c_info->name)
> -        flexarray_vappend(dm_args, "-domain-name", c_info->name, NULL);
> -
> -    if (vnc) {
> -        char *vncarg;
> -        if (vnc->display) {
> -            if (vnc->listen && strchr(vnc->listen, ':') == NULL) {
> -                vncarg = libxl__sprintf(gc, "%s:%d",
> -                                  vnc->listen,
> -                                  vnc->display);
> -            } else {
> -                vncarg = libxl__sprintf(gc, "127.0.0.1:%d",
> vnc->display);
> -            }
> -        } else if (vnc->listen) {
> -            if (strchr(vnc->listen, ':') != NULL) {
> -                vncarg = vnc->listen;
> -            } else {
> -                vncarg = libxl__sprintf(gc, "%s:0", vnc->listen);
> -            }
> -        } else {
> -            vncarg = "127.0.0.1:0";
> -        }
> -        if (vnc->passwd && (vnc->passwd[0] != '\0'))
> -            vncarg = libxl__sprintf(gc, "%s,password", vncarg);
> -        flexarray_append(dm_args, "-vnc");
> -        flexarray_append(dm_args, vncarg);
> -
> -        if (libxl_defbool_val(vnc->findunused)) {
> -            flexarray_append(dm_args, "-vncunused");
> -        }
> -    }
> -    if (sdl) {
> -        flexarray_append(dm_args, "-sdl");
> -        if (!libxl_defbool_val(sdl->opengl)) {
> -            flexarray_append(dm_args, "-disable-opengl");
> -        }
> -        /* XXX sdl->{display,xauthority} into $DISPLAY/$XAUTHORITY */
> -    }
> -    if (keymap) {
> -        flexarray_vappend(dm_args, "-k", keymap, NULL);
> -    }
> -    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
> -        int ioemu_nics = 0;
> -        int nr_set_cpus = 0;
> -        char *s;
> -
> -        if (b_info->u.hvm.serial) {
> -            flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial,
> NULL);
> -        }
> -
> -        if (libxl_defbool_val(b_info->u.hvm.nographic) && (!sdl && !vnc))
> {
> -            flexarray_append(dm_args, "-nographic");
> -        }
> -
> -        if (b_info->video_memkb) {
> -            flexarray_vappend(dm_args, "-videoram",
> -                    libxl__sprintf(gc, "%d",
> -
> libxl__sizekb_to_mb(b_info->video_memkb)),
> -                    NULL);
> -        }
> -
> -        switch (b_info->u.hvm.vga.kind) {
> -        case LIBXL_VGA_INTERFACE_TYPE_STD:
> -            flexarray_append(dm_args, "-std-vga");
> -            break;
> -        case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
> -            break;
> -        }
> -
> -        if (b_info->u.hvm.boot) {
> -            flexarray_vappend(dm_args, "-boot", b_info->u.hvm.boot, NULL);
> -        }
> -        if (libxl_defbool_val(b_info->u.hvm.usb) ||
> b_info->u.hvm.usbdevice) {
> -            flexarray_append(dm_args, "-usb");
> -            if (b_info->u.hvm.usbdevice) {
> -                flexarray_vappend(dm_args,
> -                                  "-usbdevice", b_info->u.hvm.usbdevice,
> NULL);
> -            }
> -        }
> -        if (b_info->u.hvm.soundhw) {
> -            flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw,
> NULL);
> -        }
> -        if (libxl_defbool_val(b_info->u.hvm.acpi)) {
> -            flexarray_append(dm_args, "-acpi");
> -        }
> -        if (b_info->max_vcpus > 1) {
> -            flexarray_vappend(dm_args, "-vcpus",
> -                              libxl__sprintf(gc, "%d", b_info->max_vcpus),
> -                              NULL);
> -        }
> -
> -        nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
> -        s = libxl_bitmap_to_hex_string(CTX, &b_info->avail_vcpus);
> -        flexarray_vappend(dm_args, "-vcpu_avail",
> -                              libxl__sprintf(gc, "%s", s), NULL);
> -        free(s);
> -
> -        for (i = 0; i < num_nics; i++) {
> -            if (nics[i].nictype == LIBXL_NIC_TYPE_VIF_IOEMU) {
> -                char *smac = libxl__sprintf(gc,
> -                                   LIBXL_MAC_FMT,
> LIBXL_MAC_BYTES(nics[i].mac));
> -                const char *ifname = libxl__device_nic_devname(gc,
> -                                                domid, nics[i].devid,
> -                                                LIBXL_NIC_TYPE_VIF_IOEMU);
> -                flexarray_vappend(dm_args,
> -                                  "-net",
> -                                  GCSPRINTF(
> -                                      "nic,vlan=%d,macaddr=%s,model=%s",
> -                                      nics[i].devid, smac, nics[i].model),
> -                                  "-net",
> -                                  GCSPRINTF(
> -                                      "tap,vlan=%d,ifname=%s,bridge=%s,"
> -                                      "script=%s,downscript=%s",
> -                                      nics[i].devid, ifname,
> nics[i].bridge,
> -                                      libxl_tapif_script(gc),
> -                                      libxl_tapif_script(gc)),
> -                                  NULL);
> -                ioemu_nics++;
> -            }
> -        }
> -        /* If we have no emulated nics, tell qemu not to create any */
> -        if ( ioemu_nics == 0 ) {
> -            flexarray_vappend(dm_args, "-net", "none", NULL);
> -        }
> -        if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
> -            flexarray_append(dm_args, "-gfx_passthru");
> -        }
> -    } else {
> -        if (!sdl && !vnc)
> -            flexarray_append(dm_args, "-nographic");
> -    }
> -
> -    if (state->saved_state) {
> -        flexarray_vappend(dm_args, "-loadvm", state->saved_state, NULL);
> -    }
> -    for (i = 0; b_info->extra && b_info->extra[i] != NULL; i++)
> -        flexarray_append(dm_args, b_info->extra[i]);
> -    flexarray_append(dm_args, "-M");
> -    switch (b_info->type) {
> -    case LIBXL_DOMAIN_TYPE_PV:
> -        flexarray_append(dm_args, "xenpv");
> -        for (i = 0; b_info->extra_pv && b_info->extra_pv[i] != NULL; i++)
> -            flexarray_append(dm_args, b_info->extra_pv[i]);
> -        break;
> -    case LIBXL_DOMAIN_TYPE_HVM:
> -        flexarray_append(dm_args, "xenfv");
> -        for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL;
> i++)
> -            flexarray_append(dm_args, b_info->extra_hvm[i]);
> -        break;
> -    default:
> -        abort();
> -    }
> -    flexarray_append(dm_args, NULL);
> -    return (char **) flexarray_contents(dm_args);
> -}
> -
>  static const char *qemu_disk_format_string(libxl_disk_format format)
>  {
>      switch (format) {
> @@ -318,7 +143,7 @@ static char *dm_spice_options(libxl__gc
>      return opt;
>  }
>
> -static char ** libxl__build_device_model_args_new(libxl__gc *gc,
> +static char ** libxl__build_device_model_args(libxl__gc *gc,
>                                          const char *dm, int guest_domid,
>                                          const libxl_domain_config
> *guest_config,
>                                          const libxl__domain_build_state
> *state)
> @@ -336,62 +161,106 @@ static char ** libxl__build_device_model
>      flexarray_t *dm_args;
>      int i;
>      uint64_t ram_size;
> +    int dm_new;
> +
> +    switch (guest_config->b_info.device_model_version) {
> +    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
> +        dm_new = 0;
> +        break;
> +    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
> +        dm_new = 1;
> +        break;
> +    default:
> +        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "unknown device model
> version %d",
> +                         guest_config->b_info.device_model_version);
> +        return NULL;
> +    }
> +
>
>      dm_args = flexarray_make(gc, 16, 1);
>
> -    flexarray_vappend(dm_args, dm,
> -                      "-xen-domid",
> -                      libxl__sprintf(gc, "%d", guest_domid), NULL);
> +    /* Domain ID */
> +    if (dm_new) {
> +        flexarray_vappend(dm_args, dm,
> +                          "-xen-domid",
> +                          libxl__sprintf(gc, "%d", guest_domid), NULL);
> +    } else {
> +        flexarray_vappend(dm_args, dm,
> +                          "-d", libxl__sprintf(gc, "%d", guest_domid),
> NULL);
> +    }
>
> -    flexarray_append(dm_args, "-chardev");
> -    flexarray_append(dm_args,
> -                     libxl__sprintf(gc, "socket,id=libxl-cmd,"
> -                                    "path=%s/qmp-libxl-%d,server,nowait",
> -                                    libxl__run_dir_path(), guest_domid));
> +    if (dm_new) {
> +        flexarray_append(dm_args, "-chardev");
> +        flexarray_append(dm_args,
> +                         libxl__sprintf(gc, "socket,id=libxl-cmd,"
> +
>  "path=%s/qmp-libxl-%d,server,nowait",
> +                                        libxl__run_dir_path(),
> guest_domid));
>
> -    flexarray_append(dm_args, "-mon");
> -    flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
> +        flexarray_append(dm_args, "-mon");
> +        flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
>
> -    if (b_info->type == LIBXL_DOMAIN_TYPE_PV) {
> -        flexarray_append(dm_args, "-xen-attach");
> +        if (b_info->type == LIBXL_DOMAIN_TYPE_PV) {
> +            flexarray_append(dm_args, "-xen-attach");
> +        }
>      }
>
>      if (c_info->name) {
> -        flexarray_vappend(dm_args, "-name", c_info->name, NULL);
> +        if ( dm_new )
> +            flexarray_vappend(dm_args, "-name", c_info->name, NULL);
> +        else
> +            flexarray_vappend(dm_args, "-domain-name", c_info->name,
> NULL);
>      }
> +
>      if (vnc) {
> -        int display = 0;
> -        const char *addr = "127.0.0.1";
>          char *vncarg = NULL;
>
>          flexarray_append(dm_args, "-vnc");
>
> -        if (vnc->display) {
> -            display = vnc->display;
> -            if (vnc->listen && strchr(vnc->listen, ':') == NULL) {
> -                addr = vnc->listen;
> +        /*
> +         * If vnc->listen is present and contains a :, and
> +         *  - vnc->display is 0, use vnc->listen
> +         *  - vnc->display is non-zero, be confused
> +         * If vnc->listen is present but doesn't, use
> vnc->listen:vnc->display.
> +         * If vnc->listen is not present, use 127.0.0.1:vnc->display
> +         * (Remembering that vnc->display already defaults to 0.)
> +         */
> +        if (vnc->listen) {
> +            if (strchr(vnc->listen, ':') != NULL) {
> +                if (vnc->display) {
> +                    LOG(ERROR, "vncdisplay set, vnclisten contains
> display");
> +                    return NULL;
> +                }
> +                vncarg = vnc->listen;
> +            } else {
> +                vncarg = libxl__sprintf(gc, "%s:%d", vnc->listen,
> +                                        vnc->display);
>              }
> -        } else if (vnc->listen) {
> -            addr = vnc->listen;
> -        }
> +        } else
> +            vncarg = libxl__sprintf(gc, "127.0.0.1:%d", vnc->display);
>
> -        if (strchr(addr, ':') != NULL)
> -            vncarg = libxl__sprintf(gc, "%s", addr);
> -        else
> -            vncarg = libxl__sprintf(gc, "%s:%d", addr, display);
>          if (vnc->passwd && vnc->passwd[0]) {
>              vncarg = libxl__sprintf(gc, "%s,password", vncarg);
>          }
> -        if (libxl_defbool_val(vnc->findunused)) {
> +
> +        if (dm_new && libxl_defbool_val(vnc->findunused)) {
>              /* This option asks to QEMU to try this number of port before
> to
>               * give up.  So QEMU will try ports between $display and
> $display +
>               * 99.  This option needs to be the last one of the vnc
> options. */
>              vncarg = libxl__sprintf(gc, "%s,to=99", vncarg);
>          }
> +
>          flexarray_append(dm_args, vncarg);
> +
> +        if (!dm_new && libxl_defbool_val(vnc->findunused)) {
> +            flexarray_append(dm_args, "-vncunused");
> +        }
>      }
>      if (sdl) {
>          flexarray_append(dm_args, "-sdl");
> +
> +        if (!dm_new && !libxl_defbool_val(sdl->opengl)) {
> +            flexarray_append(dm_args, "-disable-opengl");
> +        }
>          /* XXX sdl->{display,xauthority} into $DISPLAY/$XAUTHORITY */
>      }
>
> @@ -414,7 +283,7 @@ static char ** libxl__build_device_model
>              flexarray_append(dm_args, "-nographic");
>          }
>
> -        if (libxl_defbool_val(b_info->u.hvm.spice.enable)) {
> +        if (dm_new && libxl_defbool_val(b_info->u.hvm.spice.enable)) {
>              const libxl_spice_info *spice = &b_info->u.hvm.spice;
>              char *spiceoptions = dm_spice_options(gc, spice);
>              if (!spiceoptions)
> @@ -424,19 +293,35 @@ static char ** libxl__build_device_model
>              flexarray_append(dm_args, spiceoptions);
>          }
>
> -        switch (b_info->u.hvm.vga.kind) {
> -        case LIBXL_VGA_INTERFACE_TYPE_STD:
> -            flexarray_vappend(dm_args, "-vga", "std", NULL);
> -            break;
> -        case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
> -            flexarray_vappend(dm_args, "-vga", "cirrus", NULL);
> -            break;
> +        if ( dm_new ) {
> +            switch (b_info->u.hvm.vga.kind) {
> +            case LIBXL_VGA_INTERFACE_TYPE_STD:
> +                flexarray_vappend(dm_args, "-vga", "std", NULL);
> +                break;
> +            case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
> +                flexarray_vappend(dm_args, "-vga", "cirrus", NULL);
> +                break;
> +            }
> +        } else {
> +            switch (b_info->u.hvm.vga.kind) {
> +            case LIBXL_VGA_INTERFACE_TYPE_STD:
> +                flexarray_append(dm_args, "-std-vga");
> +                break;
> +            case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
> +                break;
> +            }
>          }
>
>          if (b_info->u.hvm.boot) {
> -            flexarray_vappend(dm_args, "-boot",
> -                    libxl__sprintf(gc, "order=%s", b_info->u.hvm.boot),
> NULL);
> +            if (dm_new)
> +                flexarray_vappend(dm_args, "-boot",
> +                                  libxl__sprintf(gc, "order=%s",
> +                                                 b_info->u.hvm.boot),
> NULL);
> +            else
> +                flexarray_vappend(dm_args, "-boot", b_info->u.hvm.boot,
> NULL);
> +
>          }
> +
>          if (libxl_defbool_val(b_info->u.hvm.usb) ||
> b_info->u.hvm.usbdevice) {
>              flexarray_append(dm_args, "-usb");
>              if (b_info->u.hvm.usbdevice) {
> @@ -450,19 +335,39 @@ static char ** libxl__build_device_model
>          if (!libxl_defbool_val(b_info->u.hvm.acpi)) {
>              flexarray_append(dm_args, "-no-acpi");
>          }
> -        if (b_info->max_vcpus > 1) {
> -            flexarray_append(dm_args, "-smp");
> -            if (b_info->avail_vcpus.size) {
> -                int nr_set_cpus = 0;
> -                nr_set_cpus =
> libxl_bitmap_count_set(&b_info->avail_vcpus);
>
> -                flexarray_append(dm_args, libxl__sprintf(gc,
> "%d,maxcpus=%d",
> -
> b_info->max_vcpus,
> -                                                         nr_set_cpus));
> -            } else
> -                flexarray_append(dm_args, libxl__sprintf(gc, "%d",
> -
> b_info->max_vcpus));
> +        if (dm_new)
> +        {
> +            if (b_info->max_vcpus > 1) {
> +                flexarray_append(dm_args, "-smp");
> +                if (b_info->avail_vcpus.size) {
> +                    int nr_set_cpus = 0;
> +                    nr_set_cpus =
> libxl_bitmap_count_set(&b_info->avail_vcpus);
> +
> +                    flexarray_append(dm_args,
> +                                     libxl__sprintf(gc, "%d,maxcpus=%d",
> +                                                    b_info->max_vcpus,
> +                                                    nr_set_cpus));
> +                } else
> +                    flexarray_append(dm_args,
> +                                     libxl__sprintf(gc, "%d",
> +                                                    b_info->max_vcpus));
> +            }
> +        } else {
> +            int nr_set_cpus = 0;
> +            char *s;
> +            if (b_info->max_vcpus > 1) {
> +                flexarray_vappend(dm_args, "-vcpus",
> +                                  libxl__sprintf(gc, "%d",
> b_info->max_vcpus),
> +                                  NULL);
> +            }
> +            nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
> +            s = libxl_bitmap_to_hex_string(CTX, &b_info->avail_vcpus);
> +            flexarray_vappend(dm_args, "-vcpu_avail",
> +                              libxl__sprintf(gc, "%s", s), NULL);
> +            free(s);
>          }
> +
>          for (i = 0; i < num_nics; i++) {
>              if (nics[i].nictype == LIBXL_NIC_TYPE_VIF_IOEMU) {
>                  char *smac = libxl__sprintf(gc,
> @@ -470,18 +375,35 @@ static char ** libxl__build_device_model
>                  const char *ifname = libxl__device_nic_devname(gc,
>                                                  guest_domid,
> nics[i].devid,
>                                                  LIBXL_NIC_TYPE_VIF_IOEMU);
> -                flexarray_append(dm_args, "-device");
> -                flexarray_append(dm_args,
> -                   libxl__sprintf(gc, "%s,id=nic%d,netdev=net%d,mac=%s",
> -                                                nics[i].model,
> nics[i].devid,
> -                                                nics[i].devid, smac));
> -                flexarray_append(dm_args, "-netdev");
> -                flexarray_append(dm_args, GCSPRINTF(
> -                                          "type=tap,id=net%d,ifname=%s,"
> +                if (dm_new) {
> +                    flexarray_append(dm_args, "-device");
> +                    flexarray_append(dm_args,
> +                          libxl__sprintf(gc,
> "%s,id=nic%d,netdev=net%d,mac=%s",
> +                                       nics[i].model, nics[i].devid,
> +                                       nics[i].devid, smac));
> +                    flexarray_append(dm_args, "-netdev");
> +                    flexarray_append(dm_args, GCSPRINTF(
> +                                         "type=tap,id=net%d,ifname=%s,"
> +                                         "script=%s,downscript=%s",
> +                                         nics[i].devid, ifname,
> +                                         libxl_tapif_script(gc),
> +                                         libxl_tapif_script(gc)));
> +                } else {
> +                    flexarray_vappend(dm_args,
> +                                      "-net",
> +                                      GCSPRINTF(
> +
>  "nic,vlan=%d,macaddr=%s,model=%s",
> +                                          nics[i].devid, smac,
> nics[i].model),
> +                                      "-net",
> +                                      GCSPRINTF(
> +
>  "tap,vlan=%d,ifname=%s,bridge=%s,"
>                                            "script=%s,downscript=%s",
>                                            nics[i].devid, ifname,
> +                                          nics[i].bridge,
>                                            libxl_tapif_script(gc),
> -                                          libxl_tapif_script(gc)));
> +                                          libxl_tapif_script(gc)),
> +                                      NULL);
> +                }
>                  ioemu_nics++;
>              }
>          }
> @@ -500,10 +422,15 @@ static char ** libxl__build_device_model
>      }
>
>      if (state->saved_state) {
> -        /* This file descriptor is meant to be used by QEMU */
> -        int migration_fd = open(state->saved_state, O_RDONLY);
> -        flexarray_append(dm_args, "-incoming");
> -        flexarray_append(dm_args, libxl__sprintf(gc, "fd:%d",
> migration_fd));
> +        if (dm_new) {
> +            /* This file descriptor is meant to be used by QEMU */
> +            int migration_fd = open(state->saved_state, O_RDONLY);
> +            flexarray_append(dm_args, "-incoming");
> +            flexarray_append(dm_args,
> +                             libxl__sprintf(gc, "fd:%d", migration_fd));
> +        } else {
> +            flexarray_vappend(dm_args, "-loadvm", state->saved_state,
> NULL);
> +        }
>      }
>      for (i = 0; b_info->extra && b_info->extra[i] != NULL; i++)
>          flexarray_append(dm_args, b_info->extra[i]);
> @@ -523,6 +450,9 @@ static char ** libxl__build_device_model
>          abort();
>      }
>
> +    if (!dm_new)
> +        goto finish;
> +
>      ram_size = libxl__sizekb_to_mb(b_info->max_memkb -
> b_info->video_memkb);
>      flexarray_append(dm_args, "-m");
>      flexarray_append(dm_args, libxl__sprintf(gc, "%"PRId64, ram_size));
> @@ -585,33 +515,11 @@ static char ** libxl__build_device_model
>              flexarray_append(dm_args, drive);
>          }
>      }
> +finish:
>      flexarray_append(dm_args, NULL);
>      return (char **) flexarray_contents(dm_args);
>  }
>
> -static char ** libxl__build_device_model_args(libxl__gc *gc,
> -                                        const char *dm, int guest_domid,
> -                                        const libxl_domain_config
> *guest_config,
> -                                        const libxl__domain_build_state
> *state)
> -{
> -    libxl_ctx *ctx = libxl__gc_owner(gc);
> -
> -    switch (guest_config->b_info.device_model_version) {
> -    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
> -        return libxl__build_device_model_args_old(gc, dm,
> -                                                  guest_domid,
> guest_config,
> -                                                  state);
> -    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
> -        return libxl__build_device_model_args_new(gc, dm,
> -                                                  guest_domid,
> guest_config,
> -                                                  state);
> -    default:
> -        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "unknown device model
> version %d",
> -                         guest_config->b_info.device_model_version);
> -        return NULL;
> -    }
> -}
> -
>  static void libxl__dm_vifs_from_hvm_guest_config(libxl__gc *gc,
>                                      libxl_domain_config * const
> guest_config,
>                                      libxl_domain_config *dm_config)
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>

--bcaec54eec404fd66a04cfb93d0c
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

This patch also provides an easy way to trigger an interesting &quot;failur=
e to handle failure&quot; bug in libxl.<br><br>To reproduce:<br>* Apply *on=
ly* this patch, and not patch 2 in this series (which filters it out at the=
 xl level)<br>
* Create a config file where vnclisten has a display number, and vncdisplay=
 is non-zero; e.g.:<br>=A0vnclisten=3D&quot;<a href=3D"http://0.0.0.0:1">0.=
0.0.0:1</a>&quot;<br>=A0vncdisplay=3D1<br><br>(vncdisplay=3D0 is indistingu=
ishable, to xl, from not having it set at all.)<br>
<br>The result is a set of error messages like this:<br><br>libxl: error: l=
ibxl_dm.c:231:libxl__build_device_model_args: vncdisplay set, but vnclisten=
 also contains adisplay number Too confused to continue.<br>libxl: error: l=
ibxl_dm.c:1113:device_model_spawn_outcome: (null): spawn failed (rc=3D-3)<b=
r>
libxl: error: libxl_exec.c:118:libxl_report_child_exitstatus: /etc/xen/scri=
pts/vif-bridge add [21168] exited with error status 1<br>libxl: error: libx=
l_create.c:1117:domcreate_attach_vtpms: unable to add nic devices<br>libxl:=
 error: libxl_dm.c:1140:libxl__destroy_device_model: could not find device-=
model&#39;s pid for dom 25<br>
libxl: error: libxl.c:1414:libxl__destroy_domid: libxl__destroy_device_mode=
l failed for 25<br><br>Obviously the failure in libxl__build_device_model_a=
rgs() failed to abort the domain-building process, and it continued to try =
to run vif and vtpm setups.<br>
<br>=A0-George<br><br><div class=3D"gmail_extra"><br><br><div class=3D"gmai=
l_quote">On Fri, Nov 30, 2012 at 4:24 PM, George Dunlap <span dir=3D"ltr">&=
lt;<a href=3D"mailto:george.dunlap@eu.citrix.com" target=3D"_blank">george.=
dunlap@eu.citrix.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">geo=
rge.dunlap@eu.citrix.com</a>&gt;<br>
# Date 1354287957 0<br>
# Node ID 722da032ac90c0e1a78b1154fa588bf295d1f009<br>
# Parent =A0ae6fb202b233af815466055d9f1a635802a50855<br>
libxl: Combine device model arg build functions<br>
<br>
qemu-traditional and qemu-upstream have some differences in the way<br>
the arguments need to be passed. =A0At the moment, this is dealt with by<br=
>
having two entirely separate functions, libxl__build_device_model_args_new<=
br>
and libxl__build_device_model_args_old.<br>
<br>
However, at least 80% of these are the same; this means that fixes or<br>
additions to one may not make it into the other. =A0Furthermore, there<br>
are some unaccounable differences in implementation.<br>
<br>
This patch combines the two functions into one, choosing between old<br>
and new implementations as necessary.<br>
<br>
It also makes the following changes to the vnc generation code:<br>
* Simplifies and comments it, making it easier to read and grok<br>
* Throws an error if duplicate values of display are set, rather<br>
=A0 than the current very un-intuitive behavior.<br>
<br>
Signed-off-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.=
com">george.dunlap@eu.citrix.com</a>&gt;<br>
<br>
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c<br>
--- a/tools/libxl/libxl_dm.c<br>
+++ b/tools/libxl/libxl_dm.c<br>
@@ -95,181 +95,6 @@ static const char *dm_keymap(const libxl<br>
=A0 =A0 =A0 =A0 =A0return NULL;<br>
=A0}<br>
<br>
-static char ** libxl__build_device_model_args_old(libxl__gc *gc,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0const char *dm, int domid,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0const libxl_domain_config *guest_config,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0const libxl__domain_build_state *state)<br>
-{<br>
- =A0 =A0const libxl_domain_create_info *c_info =3D &amp;guest_config-&gt;c=
_info;<br>
- =A0 =A0const libxl_domain_build_info *b_info =3D &amp;guest_config-&gt;b_=
info;<br>
- =A0 =A0const libxl_device_nic *nics =3D guest_config-&gt;nics;<br>
- =A0 =A0const libxl_vnc_info *vnc =3D libxl__dm_vnc(guest_config);<br>
- =A0 =A0const libxl_sdl_info *sdl =3D dm_sdl(guest_config);<br>
- =A0 =A0const int num_nics =3D guest_config-&gt;num_nics;<br>
- =A0 =A0const char *keymap =3D dm_keymap(guest_config);<br>
- =A0 =A0int i;<br>
- =A0 =A0flexarray_t *dm_args;<br>
- =A0 =A0dm_args =3D flexarray_make(gc, 16, 1);<br>
-<br>
- =A0 =A0flexarray_vappend(dm_args, dm,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;-d&quot;, libxl__sprintf=
(gc, &quot;%d&quot;, domid), NULL);<br>
-<br>
- =A0 =A0if (c_info-&gt;name)<br>
- =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-domain-name&quot;, c_inf=
o-&gt;name, NULL);<br>
-<br>
- =A0 =A0if (vnc) {<br>
- =A0 =A0 =A0 =A0char *vncarg;<br>
- =A0 =A0 =A0 =A0if (vnc-&gt;display) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0if (vnc-&gt;listen &amp;&amp; strchr(vnc-&gt;liste=
n, &#39;:&#39;) =3D=3D NULL) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;%s:%d&=
quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vnc-&g=
t;listen,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vnc-&g=
t;display);<br>
- =A0 =A0 =A0 =A0 =A0 =A0} else {<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;127.0.=
0.1:%d&quot;, vnc-&gt;display);<br>
- =A0 =A0 =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0} else if (vnc-&gt;listen) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0if (strchr(vnc-&gt;listen, &#39;:&#39;) !=3D NULL)=
 {<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D vnc-&gt;listen;<br>
- =A0 =A0 =A0 =A0 =A0 =A0} else {<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;%s:0&q=
uot;, vnc-&gt;listen);<br>
- =A0 =A0 =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0} else {<br>
- =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D &quot;<a href=3D"http://127.0.0.1:0" ta=
rget=3D"_blank">127.0.0.1:0</a>&quot;;<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0if (vnc-&gt;passwd &amp;&amp; (vnc-&gt;passwd[0] !=3D &#39=
;\0&#39;))<br>
- =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;%s,password&qu=
ot;, vncarg);<br>
- =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-vnc&quot;);<br>
- =A0 =A0 =A0 =A0flexarray_append(dm_args, vncarg);<br>
-<br>
- =A0 =A0 =A0 =A0if (libxl_defbool_val(vnc-&gt;findunused)) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-vncunused&quot;);=
<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0}<br>
- =A0 =A0if (sdl) {<br>
- =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-sdl&quot;);<br>
- =A0 =A0 =A0 =A0if (!libxl_defbool_val(sdl-&gt;opengl)) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-disable-opengl&qu=
ot;);<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0/* XXX sdl-&gt;{display,xauthority} into $DISPLAY/$XAUTHOR=
ITY */<br>
- =A0 =A0}<br>
- =A0 =A0if (keymap) {<br>
- =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-k&quot;, keymap, NULL);<=
br>
- =A0 =A0}<br>
- =A0 =A0if (b_info-&gt;type =3D=3D LIBXL_DOMAIN_TYPE_HVM) {<br>
- =A0 =A0 =A0 =A0int ioemu_nics =3D 0;<br>
- =A0 =A0 =A0 =A0int nr_set_cpus =3D 0;<br>
- =A0 =A0 =A0 =A0char *s;<br>
-<br>
- =A0 =A0 =A0 =A0if (b_info-&gt;u.hvm.serial) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-serial&quot;, b_=
info-&gt;u.hvm.serial, NULL);<br>
- =A0 =A0 =A0 =A0}<br>
-<br>
- =A0 =A0 =A0 =A0if (libxl_defbool_val(b_info-&gt;u.hvm.nographic) &amp;&am=
p; (!sdl &amp;&amp; !vnc)) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-nographic&quot;);=
<br>
- =A0 =A0 =A0 =A0}<br>
-<br>
- =A0 =A0 =A0 =A0if (b_info-&gt;video_memkb) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-videoram&quot;,<=
br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf(gc, &quot;%d&quot;,=
<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 libxl=
__sizekb_to_mb(b_info-&gt;video_memkb)),<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0NULL);<br>
- =A0 =A0 =A0 =A0}<br>
-<br>
- =A0 =A0 =A0 =A0switch (b_info-&gt;u.hvm.vga.kind) {<br>
- =A0 =A0 =A0 =A0case LIBXL_VGA_INTERFACE_TYPE_STD:<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-std-vga&quot;);<b=
r>
- =A0 =A0 =A0 =A0 =A0 =A0break;<br>
- =A0 =A0 =A0 =A0case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:<br>
- =A0 =A0 =A0 =A0 =A0 =A0break;<br>
- =A0 =A0 =A0 =A0}<br>
-<br>
- =A0 =A0 =A0 =A0if (b_info-&gt;u.hvm.boot) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-boot&quot;, b_in=
fo-&gt;u.hvm.boot, NULL);<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0if (libxl_defbool_val(b_info-&gt;u.hvm.usb) || b_info-&gt;=
u.hvm.usbdevice) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-usb&quot;);<br>
- =A0 =A0 =A0 =A0 =A0 =A0if (b_info-&gt;u.hvm.usbdevice) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;=
-usbdevice&quot;, b_info-&gt;u.hvm.usbdevice, NULL);<br>
- =A0 =A0 =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0if (b_info-&gt;u.hvm.soundhw) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-soundhw&quot;, b=
_info-&gt;u.hvm.soundhw, NULL);<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0if (libxl_defbool_val(b_info-&gt;u.hvm.acpi)) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-acpi&quot;);<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0if (b_info-&gt;max_vcpus &gt; 1) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-vcpus&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf=
(gc, &quot;%d&quot;, b_info-&gt;max_vcpus),<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0NULL);<br>
- =A0 =A0 =A0 =A0}<br>
-<br>
- =A0 =A0 =A0 =A0nr_set_cpus =3D libxl_bitmap_count_set(&amp;b_info-&gt;ava=
il_vcpus);<br>
- =A0 =A0 =A0 =A0s =3D libxl_bitmap_to_hex_string(CTX, &amp;b_info-&gt;avai=
l_vcpus);<br>
- =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-vcpu_avail&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf=
(gc, &quot;%s&quot;, s), NULL);<br>
- =A0 =A0 =A0 =A0free(s);<br>
-<br>
- =A0 =A0 =A0 =A0for (i =3D 0; i &lt; num_nics; i++) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0if (nics[i].nictype =3D=3D LIBXL_NIC_TYPE_VIF_IOEM=
U) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0char *smac =3D libxl__sprintf(gc,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 LIBXL=
_MAC_FMT, LIBXL_MAC_BYTES(nics[i].mac));<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0const char *ifname =3D libxl__device_nic_d=
evname(gc,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0domid, nics[i].devid,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0LIBXL_NIC_TYPE_VIF_IOEMU);<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;=
-net&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0GCSPRI=
NTF(<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0&quot;nic,vlan=3D%d,macaddr=3D%s,model=3D%s&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0nics[i].devid, smac, nics[i].model),<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;=
-net&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0GCSPRI=
NTF(<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0&quot;tap,vlan=3D%d,ifname=3D%s,bridge=3D%s,&quot;<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0&quot;script=3D%s,downscript=3D%s&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0nics[i].devid, ifname, nics[i].bridge,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0libxl_tapif_script(gc),<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0libxl_tapif_script(gc)),<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0NULL);=
<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ioemu_nics++;<br>
- =A0 =A0 =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0/* If we have no emulated nics, tell qemu not to create an=
y */<br>
- =A0 =A0 =A0 =A0if ( ioemu_nics =3D=3D 0 ) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-net&quot;, &quot=
;none&quot;, NULL);<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0if (libxl_defbool_val(b_info-&gt;u.hvm.gfx_passthru)) {<br=
>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-gfx_passthru&quot=
;);<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0} else {<br>
- =A0 =A0 =A0 =A0if (!sdl &amp;&amp; !vnc)<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-nographic&quot;);=
<br>
- =A0 =A0}<br>
-<br>
- =A0 =A0if (state-&gt;saved_state) {<br>
- =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-loadvm&quot;, state-&gt;=
saved_state, NULL);<br>
- =A0 =A0}<br>
- =A0 =A0for (i =3D 0; b_info-&gt;extra &amp;&amp; b_info-&gt;extra[i] !=3D=
 NULL; i++)<br>
- =A0 =A0 =A0 =A0flexarray_append(dm_args, b_info-&gt;extra[i]);<br>
- =A0 =A0flexarray_append(dm_args, &quot;-M&quot;);<br>
- =A0 =A0switch (b_info-&gt;type) {<br>
- =A0 =A0case LIBXL_DOMAIN_TYPE_PV:<br>
- =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;xenpv&quot;);<br>
- =A0 =A0 =A0 =A0for (i =3D 0; b_info-&gt;extra_pv &amp;&amp; b_info-&gt;ex=
tra_pv[i] !=3D NULL; i++)<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, b_info-&gt;extra_pv[i]);=
<br>
- =A0 =A0 =A0 =A0break;<br>
- =A0 =A0case LIBXL_DOMAIN_TYPE_HVM:<br>
- =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;xenfv&quot;);<br>
- =A0 =A0 =A0 =A0for (i =3D 0; b_info-&gt;extra_hvm &amp;&amp; b_info-&gt;e=
xtra_hvm[i] !=3D NULL; i++)<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, b_info-&gt;extra_hvm[i])=
;<br>
- =A0 =A0 =A0 =A0break;<br>
- =A0 =A0default:<br>
- =A0 =A0 =A0 =A0abort();<br>
- =A0 =A0}<br>
- =A0 =A0flexarray_append(dm_args, NULL);<br>
- =A0 =A0return (char **) flexarray_contents(dm_args);<br>
-}<br>
-<br>
=A0static const char *qemu_disk_format_string(libxl_disk_format format)<br>
=A0{<br>
=A0 =A0 =A0switch (format) {<br>
@@ -318,7 +143,7 @@ static char *dm_spice_options(libxl__gc<br>
=A0 =A0 =A0return opt;<br>
=A0}<br>
<br>
-static char ** libxl__build_device_model_args_new(libxl__gc *gc,<br>
+static char ** libxl__build_device_model_args(libxl__gc *gc,<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0const char *dm, int guest_domid,<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0const libxl_domain_config *guest_config,<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0const libxl__domain_build_state *state)<br>
@@ -336,62 +161,106 @@ static char ** libxl__build_device_model<br>
=A0 =A0 =A0flexarray_t *dm_args;<br>
=A0 =A0 =A0int i;<br>
=A0 =A0 =A0uint64_t ram_size;<br>
+ =A0 =A0int dm_new;<br>
+<br>
+ =A0 =A0switch (guest_config-&gt;b_info.device_model_version) {<br>
+ =A0 =A0case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:<br>
+ =A0 =A0 =A0 =A0dm_new =3D 0;<br>
+ =A0 =A0 =A0 =A0break;<br>
+ =A0 =A0case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:<br>
+ =A0 =A0 =A0 =A0dm_new =3D 1;<br>
+ =A0 =A0 =A0 =A0break;<br>
+ =A0 =A0default:<br>
+ =A0 =A0 =A0 =A0LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, &quot;unknown devi=
ce model version %d&quot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 guest_config-&gt;b_info.d=
evice_model_version);<br>
+ =A0 =A0 =A0 =A0return NULL;<br>
+ =A0 =A0}<br>
+<br>
<br>
=A0 =A0 =A0dm_args =3D flexarray_make(gc, 16, 1);<br>
<br>
- =A0 =A0flexarray_vappend(dm_args, dm,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;-xen-domid&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf(gc, &quot;%d&qu=
ot;, guest_domid), NULL);<br>
+ =A0 =A0/* Domain ID */<br>
+ =A0 =A0if (dm_new) {<br>
+ =A0 =A0 =A0 =A0flexarray_vappend(dm_args, dm,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;-xen-domid&quot;=
,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf(gc, &qu=
ot;%d&quot;, guest_domid), NULL);<br>
+ =A0 =A0} else {<br>
+ =A0 =A0 =A0 =A0flexarray_vappend(dm_args, dm,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;-d&quot;, libxl_=
_sprintf(gc, &quot;%d&quot;, guest_domid), NULL);<br>
+ =A0 =A0}<br>
<br>
- =A0 =A0flexarray_append(dm_args, &quot;-chardev&quot;);<br>
- =A0 =A0flexarray_append(dm_args,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 libxl__sprintf(gc, &quot;socket,i=
d=3Dlibxl-cmd,&quot;<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&q=
uot;path=3D%s/qmp-libxl-%d,server,nowait&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0li=
bxl__run_dir_path(), guest_domid));<br>
+ =A0 =A0if (dm_new) {<br>
+ =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-chardev&quot;);<br>
+ =A0 =A0 =A0 =A0flexarray_append(dm_args,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 libxl__sprintf(gc, &quot;=
socket,id=3Dlibxl-cmd,&quot;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0&quot;path=3D%s/qmp-libxl-%d,server,nowait&quot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0libxl__run_dir_path(), guest_domid));<br>
<br>
- =A0 =A0flexarray_append(dm_args, &quot;-mon&quot;);<br>
- =A0 =A0flexarray_append(dm_args, &quot;chardev=3Dlibxl-cmd,mode=3Dcontrol=
&quot;);<br>
+ =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-mon&quot;);<br>
+ =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;chardev=3Dlibxl-cmd,mode=
=3Dcontrol&quot;);<br>
<br>
- =A0 =A0if (b_info-&gt;type =3D=3D LIBXL_DOMAIN_TYPE_PV) {<br>
- =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-xen-attach&quot;);<br>
+ =A0 =A0 =A0 =A0if (b_info-&gt;type =3D=3D LIBXL_DOMAIN_TYPE_PV) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-xen-attach&quot;)=
;<br>
+ =A0 =A0 =A0 =A0}<br>
=A0 =A0 =A0}<br>
<br>
=A0 =A0 =A0if (c_info-&gt;name) {<br>
- =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-name&quot;, c_info-&gt;n=
ame, NULL);<br>
+ =A0 =A0 =A0 =A0if ( dm_new )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-name&quot;, c_in=
fo-&gt;name, NULL);<br>
+ =A0 =A0 =A0 =A0else<br>
+ =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-domain-name&quot=
;, c_info-&gt;name, NULL);<br>
=A0 =A0 =A0}<br>
+<br>
=A0 =A0 =A0if (vnc) {<br>
- =A0 =A0 =A0 =A0int display =3D 0;<br>
- =A0 =A0 =A0 =A0const char *addr =3D &quot;127.0.0.1&quot;;<br>
=A0 =A0 =A0 =A0 =A0char *vncarg =3D NULL;<br>
<br>
=A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-vnc&quot;);<br>
<br>
- =A0 =A0 =A0 =A0if (vnc-&gt;display) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0display =3D vnc-&gt;display;<br>
- =A0 =A0 =A0 =A0 =A0 =A0if (vnc-&gt;listen &amp;&amp; strchr(vnc-&gt;liste=
n, &#39;:&#39;) =3D=3D NULL) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0addr =3D vnc-&gt;listen;<br>
+ =A0 =A0 =A0 =A0/*<br>
+ =A0 =A0 =A0 =A0 * If vnc-&gt;listen is present and contains a :, and<br>
+ =A0 =A0 =A0 =A0 * =A0- vnc-&gt;display is 0, use vnc-&gt;listen<br>
+ =A0 =A0 =A0 =A0 * =A0- vnc-&gt;display is non-zero, be confused<br>
+ =A0 =A0 =A0 =A0 * If vnc-&gt;listen is present but doesn&#39;t, use vnc-&=
gt;listen:vnc-&gt;display.<br>
+ =A0 =A0 =A0 =A0 * If vnc-&gt;listen is not present, use 127.0.0.1:vnc-&gt=
;display<br>
+ =A0 =A0 =A0 =A0 * (Remembering that vnc-&gt;display already defaults to 0=
.)<br>
+ =A0 =A0 =A0 =A0 */<br>
+ =A0 =A0 =A0 =A0if (vnc-&gt;listen) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0if (strchr(vnc-&gt;listen, &#39;:&#39;) !=3D NULL)=
 {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (vnc-&gt;display) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0LOG(ERROR, &quot;vncdisplay set, v=
nclisten contains display&quot;);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return NULL;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D vnc-&gt;listen;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0} else {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;%s:%d&=
quot;, vnc-&gt;listen,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0vnc-&gt;display);<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0} else if (vnc-&gt;listen) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0addr =3D vnc-&gt;listen;<br>
- =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0} else<br>
+ =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;127.0.0.1:%d&q=
uot;, vnc-&gt;display);<br>
<br>
- =A0 =A0 =A0 =A0if (strchr(addr, &#39;:&#39;) !=3D NULL)<br>
- =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;%s&quot;, addr=
);<br>
- =A0 =A0 =A0 =A0else<br>
- =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;%s:%d&quot;, a=
ddr, display);<br>
=A0 =A0 =A0 =A0 =A0if (vnc-&gt;passwd &amp;&amp; vnc-&gt;passwd[0]) {<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;%s,password&=
quot;, vncarg);<br>
=A0 =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0if (libxl_defbool_val(vnc-&gt;findunused)) {<br>
+<br>
+ =A0 =A0 =A0 =A0if (dm_new &amp;&amp; libxl_defbool_val(vnc-&gt;findunused=
)) {<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0/* This option asks to QEMU to try this number o=
f port before to<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 * give up. =A0So QEMU will try ports between $d=
isplay and $display +<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 * 99. =A0This option needs to be the last one o=
f the vnc options. */<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;%s,to=3D99&q=
uot;, vncarg);<br>
=A0 =A0 =A0 =A0 =A0}<br>
+<br>
=A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, vncarg);<br>
+<br>
+ =A0 =A0 =A0 =A0if (!dm_new &amp;&amp; libxl_defbool_val(vnc-&gt;findunuse=
d)) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-vncunused&quot;);=
<br>
+ =A0 =A0 =A0 =A0}<br>
=A0 =A0 =A0}<br>
=A0 =A0 =A0if (sdl) {<br>
=A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-sdl&quot;);<br>
+<br>
+ =A0 =A0 =A0 =A0if (!dm_new &amp;&amp; !libxl_defbool_val(sdl-&gt;opengl))=
 {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-disable-opengl&qu=
ot;);<br>
+ =A0 =A0 =A0 =A0}<br>
=A0 =A0 =A0 =A0 =A0/* XXX sdl-&gt;{display,xauthority} into $DISPLAY/$XAUTH=
ORITY */<br>
=A0 =A0 =A0}<br>
<br>
@@ -414,7 +283,7 @@ static char ** libxl__build_device_model<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-nographic&quot;=
);<br>
=A0 =A0 =A0 =A0 =A0}<br>
<br>
- =A0 =A0 =A0 =A0if (libxl_defbool_val(b_info-&gt;u.hvm.spice.enable)) {<br=
>
+ =A0 =A0 =A0 =A0if (dm_new &amp;&amp; libxl_defbool_val(b_info-&gt;u.hvm.s=
pice.enable)) {<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0const libxl_spice_info *spice =3D &amp;b_info-&g=
t;u.hvm.spice;<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0char *spiceoptions =3D dm_spice_options(gc, spic=
e);<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0if (!spiceoptions)<br>
@@ -424,19 +293,35 @@ static char ** libxl__build_device_model<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, spiceoptions);<br>
=A0 =A0 =A0 =A0 =A0}<br>
<br>
- =A0 =A0 =A0 =A0switch (b_info-&gt;u.hvm.vga.kind) {<br>
- =A0 =A0 =A0 =A0case LIBXL_VGA_INTERFACE_TYPE_STD:<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-vga&quot;, &quot=
;std&quot;, NULL);<br>
- =A0 =A0 =A0 =A0 =A0 =A0break;<br>
- =A0 =A0 =A0 =A0case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-vga&quot;, &quot=
;cirrus&quot;, NULL);<br>
- =A0 =A0 =A0 =A0 =A0 =A0break;<br>
+ =A0 =A0 =A0 =A0if ( dm_new ) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0switch (b_info-&gt;u.hvm.vga.kind) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0case LIBXL_VGA_INTERFACE_TYPE_STD:<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-vga&quot=
;, &quot;std&quot;, NULL);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-vga&quot=
;, &quot;cirrus&quot;, NULL);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0} else {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0switch (b_info-&gt;u.hvm.vga.kind) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0case LIBXL_VGA_INTERFACE_TYPE_STD:<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-std-vga&q=
uot;);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0}<br>
=A0 =A0 =A0 =A0 =A0}<br>
<br>
=A0 =A0 =A0 =A0 =A0if (b_info-&gt;u.hvm.boot) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-boot&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf(gc, &quot;order=3D%=
s&quot;, b_info-&gt;u.hvm.boot), NULL);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0if (dm_new)<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-boot&quo=
t;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl_=
_sprintf(gc, &quot;order=3D%s&quot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 b_info-&gt;u.hvm.boot), NULL);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0else<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-boot&quo=
t;, b_info-&gt;u.hvm.boot, NULL);<br>
+<br>
=A0 =A0 =A0 =A0 =A0}<br>
+<br>
=A0 =A0 =A0 =A0 =A0if (libxl_defbool_val(b_info-&gt;u.hvm.usb) || b_info-&g=
t;u.hvm.usbdevice) {<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-usb&quot;);<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0if (b_info-&gt;u.hvm.usbdevice) {<br>
@@ -450,19 +335,39 @@ static char ** libxl__build_device_model<br>
=A0 =A0 =A0 =A0 =A0if (!libxl_defbool_val(b_info-&gt;u.hvm.acpi)) {<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-no-acpi&quot;);=
<br>
=A0 =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0if (b_info-&gt;max_vcpus &gt; 1) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-smp&quot;);<br>
- =A0 =A0 =A0 =A0 =A0 =A0if (b_info-&gt;avail_vcpus.size) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0int nr_set_cpus =3D 0;<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0nr_set_cpus =3D libxl_bitmap_count_set(&am=
p;b_info-&gt;avail_vcpus);<br>
<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, libxl__sprintf(g=
c, &quot;%d,maxcpus=3D%d&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 b_info-&gt;max_vcpus,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 nr_set_cpus));<br>
- =A0 =A0 =A0 =A0 =A0 =A0} else<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, libxl__sprintf(g=
c, &quot;%d&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 b_info-&gt;max_vcpus));<br>
+ =A0 =A0 =A0 =A0if (dm_new)<br>
+ =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0if (b_info-&gt;max_vcpus &gt; 1) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-smp&quot;=
);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (b_info-&gt;avail_vcpus.size) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0int nr_set_cpus =3D 0;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0nr_set_cpus =3D libxl_bitmap_count=
_set(&amp;b_info-&gt;avail_vcpus);<br>
+<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 l=
ibxl__sprintf(gc, &quot;%d,maxcpus=3D%d&quot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0b_info-&gt;max_vcpus,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0nr_set_cpus));<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 l=
ibxl__sprintf(gc, &quot;%d&quot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0b_info-&gt;max_vcpus));<br>
+ =A0 =A0 =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0} else {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0int nr_set_cpus =3D 0;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0char *s;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0if (b_info-&gt;max_vcpus &gt; 1) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-vcpus&qu=
ot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl_=
_sprintf(gc, &quot;%d&quot;, b_info-&gt;max_vcpus),<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0NULL);=
<br>
+ =A0 =A0 =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0 =A0 =A0nr_set_cpus =3D libxl_bitmap_count_set(&amp;b_info=
-&gt;avail_vcpus);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0s =3D libxl_bitmap_to_hex_string(CTX, &amp;b_info-=
&gt;avail_vcpus);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-vcpu_avail&quot;=
,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf=
(gc, &quot;%s&quot;, s), NULL);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0free(s);<br>
=A0 =A0 =A0 =A0 =A0}<br>
+<br>
=A0 =A0 =A0 =A0 =A0for (i =3D 0; i &lt; num_nics; i++) {<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0if (nics[i].nictype =3D=3D LIBXL_NIC_TYPE_VIF_IO=
EMU) {<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0char *smac =3D libxl__sprintf(gc,<br>
@@ -470,18 +375,35 @@ static char ** libxl__build_device_model<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0const char *ifname =3D libxl__device_nic=
_devname(gc,<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0guest_domid, nics[i].devid,<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0LIBXL_NIC_TYPE_VIF_IOEMU);<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-device&qu=
ot;);<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 libxl__sprintf(gc, &quot;%s,id=3Dnic%=
d,netdev=3Dnet%d,mac=3D%s&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0nics[i].model, nics[i].devid,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0nics[i].devid, smac));<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-netdev&qu=
ot;);<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, GCSPRINTF(<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0&quot;type=3Dtap,id=3Dnet%d,ifname=3D%s,&quot;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (dm_new) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-d=
evice&quot;);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf(gc, &qu=
ot;%s,id=3Dnic%d,netdev=3Dnet%d,mac=3D%s&quot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 nics[i].model, nics[i].devid,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 nics[i].devid, smac));<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-n=
etdev&quot;);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, GCSPRINT=
F(<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 &quot;type=3Dtap,id=3Dnet%d,ifname=3D%s,&quot;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 &quot;script=3D%s,downscript=3D%s&quot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 nics[i].devid, ifname,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 libxl_tapif_script(gc),<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 libxl_tapif_script(gc)));<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0&quot;-net&quot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A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apif_script(gc),<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0libxl_tapif_script(gc)));<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0libxl_tapif_script(gc)),<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0NULL);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ioemu_nics++;<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
=A0 =A0 =A0 =A0 =A0}<br>
@@ -500,10 +422,15 @@ static char ** libxl__build_device_model<br>
=A0 =A0 =A0}<br>
<br>
=A0 =A0 =A0if (state-&gt;saved_state) {<br>
- =A0 =A0 =A0 =A0/* This file descriptor is meant to be used by QEMU */<br>
- =A0 =A0 =A0 =A0int migration_fd =3D open(state-&gt;saved_state, O_RDONLY)=
;<br>
- =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-incoming&quot;);<br>
- =A0 =A0 =A0 =A0flexarray_append(dm_args, libxl__sprintf(gc, &quot;fd:%d&q=
uot;, migration_fd));<br>
+ =A0 =A0 =A0 =A0if (dm_new) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0/* This file descriptor is meant to be used by QEM=
U */<br>
+ =A0 =A0 =A0 =A0 =A0 =A0int migration_fd =3D open(state-&gt;saved_state, O=
_RDONLY);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-incoming&quot;);<=
br>
+ =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 libxl__sprintf(gc=
, &quot;fd:%d&quot;, migration_fd));<br>
+ =A0 =A0 =A0 =A0} else {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-loadvm&quot;, st=
ate-&gt;saved_state, NULL);<br>
+ =A0 =A0 =A0 =A0}<br>
=A0 =A0 =A0}<br>
=A0 =A0 =A0for (i =3D 0; b_info-&gt;extra &amp;&amp; b_info-&gt;extra[i] !=
=3D NULL; i++)<br>
=A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, b_info-&gt;extra[i]);<br>
@@ -523,6 +450,9 @@ static char ** libxl__build_device_model<br>
=A0 =A0 =A0 =A0 =A0abort();<br>
=A0 =A0 =A0}<br>
<br>
+ =A0 =A0if (!dm_new)<br>
+ =A0 =A0 =A0 =A0goto finish;<br>
+<br>
=A0 =A0 =A0ram_size =3D libxl__sizekb_to_mb(b_info-&gt;max_memkb - b_info-&=
gt;video_memkb);<br>
=A0 =A0 =A0flexarray_append(dm_args, &quot;-m&quot;);<br>
=A0 =A0 =A0flexarray_append(dm_args, libxl__sprintf(gc, &quot;%&quot;PRId64=
, ram_size));<br>
@@ -585,33 +515,11 @@ static char ** libxl__build_device_model<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, drive);<br>
=A0 =A0 =A0 =A0 =A0}<br>
=A0 =A0 =A0}<br>
+finish:<br>
=A0 =A0 =A0flexarray_append(dm_args, NULL);<br>
=A0 =A0 =A0return (char **) flexarray_contents(dm_args);<br>
=A0}<br>
<br>
-static char ** libxl__build_device_model_args(libxl__gc *gc,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0const char *dm, int guest_domid,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0const libxl_domain_config *guest_config,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0const libxl__domain_build_state *state)<br>
-{<br>
- =A0 =A0libxl_ctx *ctx =3D libxl__gc_owner(gc);<br>
-<br>
- =A0 =A0switch (guest_config-&gt;b_info.device_model_version) {<br>
- =A0 =A0case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:<br>
- =A0 =A0 =A0 =A0return libxl__build_device_model_args_old(gc, dm,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0guest_domid, guest_config,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0state);<br>
- =A0 =A0case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:<br>
- =A0 =A0 =A0 =A0return libxl__build_device_model_args_new(gc, dm,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0guest_domid, guest_config,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0state);<br>
- =A0 =A0default:<br>
- =A0 =A0 =A0 =A0LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, &quot;unknown devi=
ce model version %d&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 guest_config-&gt;b_info.d=
evice_model_version);<br>
- =A0 =A0 =A0 =A0return NULL;<br>
- =A0 =A0}<br>
-}<br>
-<br>
=A0static void libxl__dm_vifs_from_hvm_guest_config(libxl__gc *gc,<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
libxl_domain_config * const guest_config,<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
libxl_domain_config *dm_config)<br>
<br>
_______________________________________________<br>
Xen-devel mailing list<br>
<a href=3D"mailto:Xen-devel@lists.xen.org">Xen-devel@lists.xen.org</a><br>
<a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://lists.x=
en.org/xen-devel</a><br>
</blockquote></div><br></div>

--bcaec54eec404fd66a04cfb93d0c--


--===============2341031737812672154==
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.xen.org
http://lists.xen.org/xen-devel

--===============2341031737812672154==--


From xen-devel-bounces@lists.xen.org Fri Nov 30 16:53:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 16:53:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeTqO-0003B3-6r; Fri, 30 Nov 2012 16:53:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dunlapg@gmail.com>) id 1TeTqL-0003Ay-Ms
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 16:53:38 +0000
Received: from [85.158.143.99:2166] by server-1.bemta-4.messagelabs.com id
	98/17-27934-F84E8B05; Fri, 30 Nov 2012 16:53:35 +0000
X-Env-Sender: dunlapg@gmail.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1354294411!17781555!1
X-Originating-IP: [209.85.212.43]
X-SpamReason: No, hits=0.4 required=7.0 tests=HTML_30_40,HTML_MESSAGE,
	RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32377 invoked from network); 30 Nov 2012 16:53:32 -0000
Received: from mail-vb0-f43.google.com (HELO mail-vb0-f43.google.com)
	(209.85.212.43)
	by server-8.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 16:53:32 -0000
Received: by mail-vb0-f43.google.com with SMTP id fr13so1092766vbb.30
	for <xen-devel@lists.xensource.com>;
	Fri, 30 Nov 2012 08:53:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=x0Kzr/gu4VCNEVwrVJH2uljvXI0NrDtZUIzl9SyfBoc=;
	b=j/XHpoxs9LfNwNlbvs5lUonSgthV5X2/v0TLhfIZyIZCEN3QVoxORGCAnokME1LmXx
	DwP/BwHgKh2t2I58ifAp59kzpQB9IX8FO8nMzgKLCQmXpjFH+oEhrj5reuGAqCcXBLGt
	DWKPBVTS+nXcB7XPKKj9qPj1lyAuXavCzLDbI1I2byhKfVwZrUAJpIwqUT6zZ/jUAqh+
	KM228k061x83+ZlncQA4bQQHtXzTPCZUJC7V9VecenhbUfVkjfHjK37qxf3ZjnTEEQV9
	KW5B+GPvD8oU6BWyJysQchaqSPuTf29qwroahpjUYmyPMT5zu1MWHATPYlcvf47Nh+1i
	SaUw==
MIME-Version: 1.0
Received: by 10.221.11.2 with SMTP id pc2mr1500516vcb.10.1354294411384; Fri,
	30 Nov 2012 08:53:31 -0800 (PST)
Received: by 10.58.231.138 with HTTP; Fri, 30 Nov 2012 08:53:31 -0800 (PST)
In-Reply-To: <722da032ac90c0e1a78b.1354292656@elijah>
References: <patchbomb.1354292655@elijah>
	<722da032ac90c0e1a78b.1354292656@elijah>
Date: Fri, 30 Nov 2012 16:53:31 +0000
X-Google-Sender-Auth: Ng4HeGU6yO5wlS2dxosAwvDxoHY
Message-ID: <CAFLBxZYekXsegjnn9vv8MtH5JMvoj7pKmPLP_YQ0Ge68438BbA@mail.gmail.com>
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <ian.jackson@xen.org>
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH 1 of 4 v2] libxl: Combine device model arg
 build functions
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============2341031737812672154=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============2341031737812672154==
Content-Type: multipart/alternative; boundary=bcaec54eec404fd66a04cfb93d0c

--bcaec54eec404fd66a04cfb93d0c
Content-Type: text/plain; charset=ISO-8859-1

This patch also provides an easy way to trigger an interesting "failure to
handle failure" bug in libxl.

To reproduce:
* Apply *only* this patch, and not patch 2 in this series (which filters it
out at the xl level)
* Create a config file where vnclisten has a display number, and vncdisplay
is non-zero; e.g.:
 vnclisten="0.0.0.0:1"
 vncdisplay=1

(vncdisplay=0 is indistinguishable, to xl, from not having it set at all.)

The result is a set of error messages like this:

libxl: error: libxl_dm.c:231:libxl__build_device_model_args: vncdisplay
set, but vnclisten also contains adisplay number Too confused to continue.
libxl: error: libxl_dm.c:1113:device_model_spawn_outcome: (null): spawn
failed (rc=-3)
libxl: error: libxl_exec.c:118:libxl_report_child_exitstatus:
/etc/xen/scripts/vif-bridge add [21168] exited with error status 1
libxl: error: libxl_create.c:1117:domcreate_attach_vtpms: unable to add nic
devices
libxl: error: libxl_dm.c:1140:libxl__destroy_device_model: could not find
device-model's pid for dom 25
libxl: error: libxl.c:1414:libxl__destroy_domid:
libxl__destroy_device_model failed for 25

Obviously the failure in libxl__build_device_model_args() failed to abort
the domain-building process, and it continued to try to run vif and vtpm
setups.

 -George



On Fri, Nov 30, 2012 at 4:24 PM, George Dunlap
<george.dunlap@eu.citrix.com>wrote:

> # HG changeset patch
> # User George Dunlap <george.dunlap@eu.citrix.com>
> # Date 1354287957 0
> # Node ID 722da032ac90c0e1a78b1154fa588bf295d1f009
> # Parent  ae6fb202b233af815466055d9f1a635802a50855
> libxl: Combine device model arg build functions
>
> qemu-traditional and qemu-upstream have some differences in the way
> the arguments need to be passed.  At the moment, this is dealt with by
> having two entirely separate functions, libxl__build_device_model_args_new
> and libxl__build_device_model_args_old.
>
> However, at least 80% of these are the same; this means that fixes or
> additions to one may not make it into the other.  Furthermore, there
> are some unaccounable differences in implementation.
>
> This patch combines the two functions into one, choosing between old
> and new implementations as necessary.
>
> It also makes the following changes to the vnc generation code:
> * Simplifies and comments it, making it easier to read and grok
> * Throws an error if duplicate values of display are set, rather
>   than the current very un-intuitive behavior.
>
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
>
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -95,181 +95,6 @@ static const char *dm_keymap(const libxl
>          return NULL;
>  }
>
> -static char ** libxl__build_device_model_args_old(libxl__gc *gc,
> -                                        const char *dm, int domid,
> -                                        const libxl_domain_config
> *guest_config,
> -                                        const libxl__domain_build_state
> *state)
> -{
> -    const libxl_domain_create_info *c_info = &guest_config->c_info;
> -    const libxl_domain_build_info *b_info = &guest_config->b_info;
> -    const libxl_device_nic *nics = guest_config->nics;
> -    const libxl_vnc_info *vnc = libxl__dm_vnc(guest_config);
> -    const libxl_sdl_info *sdl = dm_sdl(guest_config);
> -    const int num_nics = guest_config->num_nics;
> -    const char *keymap = dm_keymap(guest_config);
> -    int i;
> -    flexarray_t *dm_args;
> -    dm_args = flexarray_make(gc, 16, 1);
> -
> -    flexarray_vappend(dm_args, dm,
> -                      "-d", libxl__sprintf(gc, "%d", domid), NULL);
> -
> -    if (c_info->name)
> -        flexarray_vappend(dm_args, "-domain-name", c_info->name, NULL);
> -
> -    if (vnc) {
> -        char *vncarg;
> -        if (vnc->display) {
> -            if (vnc->listen && strchr(vnc->listen, ':') == NULL) {
> -                vncarg = libxl__sprintf(gc, "%s:%d",
> -                                  vnc->listen,
> -                                  vnc->display);
> -            } else {
> -                vncarg = libxl__sprintf(gc, "127.0.0.1:%d",
> vnc->display);
> -            }
> -        } else if (vnc->listen) {
> -            if (strchr(vnc->listen, ':') != NULL) {
> -                vncarg = vnc->listen;
> -            } else {
> -                vncarg = libxl__sprintf(gc, "%s:0", vnc->listen);
> -            }
> -        } else {
> -            vncarg = "127.0.0.1:0";
> -        }
> -        if (vnc->passwd && (vnc->passwd[0] != '\0'))
> -            vncarg = libxl__sprintf(gc, "%s,password", vncarg);
> -        flexarray_append(dm_args, "-vnc");
> -        flexarray_append(dm_args, vncarg);
> -
> -        if (libxl_defbool_val(vnc->findunused)) {
> -            flexarray_append(dm_args, "-vncunused");
> -        }
> -    }
> -    if (sdl) {
> -        flexarray_append(dm_args, "-sdl");
> -        if (!libxl_defbool_val(sdl->opengl)) {
> -            flexarray_append(dm_args, "-disable-opengl");
> -        }
> -        /* XXX sdl->{display,xauthority} into $DISPLAY/$XAUTHORITY */
> -    }
> -    if (keymap) {
> -        flexarray_vappend(dm_args, "-k", keymap, NULL);
> -    }
> -    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
> -        int ioemu_nics = 0;
> -        int nr_set_cpus = 0;
> -        char *s;
> -
> -        if (b_info->u.hvm.serial) {
> -            flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial,
> NULL);
> -        }
> -
> -        if (libxl_defbool_val(b_info->u.hvm.nographic) && (!sdl && !vnc))
> {
> -            flexarray_append(dm_args, "-nographic");
> -        }
> -
> -        if (b_info->video_memkb) {
> -            flexarray_vappend(dm_args, "-videoram",
> -                    libxl__sprintf(gc, "%d",
> -
> libxl__sizekb_to_mb(b_info->video_memkb)),
> -                    NULL);
> -        }
> -
> -        switch (b_info->u.hvm.vga.kind) {
> -        case LIBXL_VGA_INTERFACE_TYPE_STD:
> -            flexarray_append(dm_args, "-std-vga");
> -            break;
> -        case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
> -            break;
> -        }
> -
> -        if (b_info->u.hvm.boot) {
> -            flexarray_vappend(dm_args, "-boot", b_info->u.hvm.boot, NULL);
> -        }
> -        if (libxl_defbool_val(b_info->u.hvm.usb) ||
> b_info->u.hvm.usbdevice) {
> -            flexarray_append(dm_args, "-usb");
> -            if (b_info->u.hvm.usbdevice) {
> -                flexarray_vappend(dm_args,
> -                                  "-usbdevice", b_info->u.hvm.usbdevice,
> NULL);
> -            }
> -        }
> -        if (b_info->u.hvm.soundhw) {
> -            flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw,
> NULL);
> -        }
> -        if (libxl_defbool_val(b_info->u.hvm.acpi)) {
> -            flexarray_append(dm_args, "-acpi");
> -        }
> -        if (b_info->max_vcpus > 1) {
> -            flexarray_vappend(dm_args, "-vcpus",
> -                              libxl__sprintf(gc, "%d", b_info->max_vcpus),
> -                              NULL);
> -        }
> -
> -        nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
> -        s = libxl_bitmap_to_hex_string(CTX, &b_info->avail_vcpus);
> -        flexarray_vappend(dm_args, "-vcpu_avail",
> -                              libxl__sprintf(gc, "%s", s), NULL);
> -        free(s);
> -
> -        for (i = 0; i < num_nics; i++) {
> -            if (nics[i].nictype == LIBXL_NIC_TYPE_VIF_IOEMU) {
> -                char *smac = libxl__sprintf(gc,
> -                                   LIBXL_MAC_FMT,
> LIBXL_MAC_BYTES(nics[i].mac));
> -                const char *ifname = libxl__device_nic_devname(gc,
> -                                                domid, nics[i].devid,
> -                                                LIBXL_NIC_TYPE_VIF_IOEMU);
> -                flexarray_vappend(dm_args,
> -                                  "-net",
> -                                  GCSPRINTF(
> -                                      "nic,vlan=%d,macaddr=%s,model=%s",
> -                                      nics[i].devid, smac, nics[i].model),
> -                                  "-net",
> -                                  GCSPRINTF(
> -                                      "tap,vlan=%d,ifname=%s,bridge=%s,"
> -                                      "script=%s,downscript=%s",
> -                                      nics[i].devid, ifname,
> nics[i].bridge,
> -                                      libxl_tapif_script(gc),
> -                                      libxl_tapif_script(gc)),
> -                                  NULL);
> -                ioemu_nics++;
> -            }
> -        }
> -        /* If we have no emulated nics, tell qemu not to create any */
> -        if ( ioemu_nics == 0 ) {
> -            flexarray_vappend(dm_args, "-net", "none", NULL);
> -        }
> -        if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
> -            flexarray_append(dm_args, "-gfx_passthru");
> -        }
> -    } else {
> -        if (!sdl && !vnc)
> -            flexarray_append(dm_args, "-nographic");
> -    }
> -
> -    if (state->saved_state) {
> -        flexarray_vappend(dm_args, "-loadvm", state->saved_state, NULL);
> -    }
> -    for (i = 0; b_info->extra && b_info->extra[i] != NULL; i++)
> -        flexarray_append(dm_args, b_info->extra[i]);
> -    flexarray_append(dm_args, "-M");
> -    switch (b_info->type) {
> -    case LIBXL_DOMAIN_TYPE_PV:
> -        flexarray_append(dm_args, "xenpv");
> -        for (i = 0; b_info->extra_pv && b_info->extra_pv[i] != NULL; i++)
> -            flexarray_append(dm_args, b_info->extra_pv[i]);
> -        break;
> -    case LIBXL_DOMAIN_TYPE_HVM:
> -        flexarray_append(dm_args, "xenfv");
> -        for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL;
> i++)
> -            flexarray_append(dm_args, b_info->extra_hvm[i]);
> -        break;
> -    default:
> -        abort();
> -    }
> -    flexarray_append(dm_args, NULL);
> -    return (char **) flexarray_contents(dm_args);
> -}
> -
>  static const char *qemu_disk_format_string(libxl_disk_format format)
>  {
>      switch (format) {
> @@ -318,7 +143,7 @@ static char *dm_spice_options(libxl__gc
>      return opt;
>  }
>
> -static char ** libxl__build_device_model_args_new(libxl__gc *gc,
> +static char ** libxl__build_device_model_args(libxl__gc *gc,
>                                          const char *dm, int guest_domid,
>                                          const libxl_domain_config
> *guest_config,
>                                          const libxl__domain_build_state
> *state)
> @@ -336,62 +161,106 @@ static char ** libxl__build_device_model
>      flexarray_t *dm_args;
>      int i;
>      uint64_t ram_size;
> +    int dm_new;
> +
> +    switch (guest_config->b_info.device_model_version) {
> +    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
> +        dm_new = 0;
> +        break;
> +    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
> +        dm_new = 1;
> +        break;
> +    default:
> +        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "unknown device model
> version %d",
> +                         guest_config->b_info.device_model_version);
> +        return NULL;
> +    }
> +
>
>      dm_args = flexarray_make(gc, 16, 1);
>
> -    flexarray_vappend(dm_args, dm,
> -                      "-xen-domid",
> -                      libxl__sprintf(gc, "%d", guest_domid), NULL);
> +    /* Domain ID */
> +    if (dm_new) {
> +        flexarray_vappend(dm_args, dm,
> +                          "-xen-domid",
> +                          libxl__sprintf(gc, "%d", guest_domid), NULL);
> +    } else {
> +        flexarray_vappend(dm_args, dm,
> +                          "-d", libxl__sprintf(gc, "%d", guest_domid),
> NULL);
> +    }
>
> -    flexarray_append(dm_args, "-chardev");
> -    flexarray_append(dm_args,
> -                     libxl__sprintf(gc, "socket,id=libxl-cmd,"
> -                                    "path=%s/qmp-libxl-%d,server,nowait",
> -                                    libxl__run_dir_path(), guest_domid));
> +    if (dm_new) {
> +        flexarray_append(dm_args, "-chardev");
> +        flexarray_append(dm_args,
> +                         libxl__sprintf(gc, "socket,id=libxl-cmd,"
> +
>  "path=%s/qmp-libxl-%d,server,nowait",
> +                                        libxl__run_dir_path(),
> guest_domid));
>
> -    flexarray_append(dm_args, "-mon");
> -    flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
> +        flexarray_append(dm_args, "-mon");
> +        flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
>
> -    if (b_info->type == LIBXL_DOMAIN_TYPE_PV) {
> -        flexarray_append(dm_args, "-xen-attach");
> +        if (b_info->type == LIBXL_DOMAIN_TYPE_PV) {
> +            flexarray_append(dm_args, "-xen-attach");
> +        }
>      }
>
>      if (c_info->name) {
> -        flexarray_vappend(dm_args, "-name", c_info->name, NULL);
> +        if ( dm_new )
> +            flexarray_vappend(dm_args, "-name", c_info->name, NULL);
> +        else
> +            flexarray_vappend(dm_args, "-domain-name", c_info->name,
> NULL);
>      }
> +
>      if (vnc) {
> -        int display = 0;
> -        const char *addr = "127.0.0.1";
>          char *vncarg = NULL;
>
>          flexarray_append(dm_args, "-vnc");
>
> -        if (vnc->display) {
> -            display = vnc->display;
> -            if (vnc->listen && strchr(vnc->listen, ':') == NULL) {
> -                addr = vnc->listen;
> +        /*
> +         * If vnc->listen is present and contains a :, and
> +         *  - vnc->display is 0, use vnc->listen
> +         *  - vnc->display is non-zero, be confused
> +         * If vnc->listen is present but doesn't, use
> vnc->listen:vnc->display.
> +         * If vnc->listen is not present, use 127.0.0.1:vnc->display
> +         * (Remembering that vnc->display already defaults to 0.)
> +         */
> +        if (vnc->listen) {
> +            if (strchr(vnc->listen, ':') != NULL) {
> +                if (vnc->display) {
> +                    LOG(ERROR, "vncdisplay set, vnclisten contains
> display");
> +                    return NULL;
> +                }
> +                vncarg = vnc->listen;
> +            } else {
> +                vncarg = libxl__sprintf(gc, "%s:%d", vnc->listen,
> +                                        vnc->display);
>              }
> -        } else if (vnc->listen) {
> -            addr = vnc->listen;
> -        }
> +        } else
> +            vncarg = libxl__sprintf(gc, "127.0.0.1:%d", vnc->display);
>
> -        if (strchr(addr, ':') != NULL)
> -            vncarg = libxl__sprintf(gc, "%s", addr);
> -        else
> -            vncarg = libxl__sprintf(gc, "%s:%d", addr, display);
>          if (vnc->passwd && vnc->passwd[0]) {
>              vncarg = libxl__sprintf(gc, "%s,password", vncarg);
>          }
> -        if (libxl_defbool_val(vnc->findunused)) {
> +
> +        if (dm_new && libxl_defbool_val(vnc->findunused)) {
>              /* This option asks to QEMU to try this number of port before
> to
>               * give up.  So QEMU will try ports between $display and
> $display +
>               * 99.  This option needs to be the last one of the vnc
> options. */
>              vncarg = libxl__sprintf(gc, "%s,to=99", vncarg);
>          }
> +
>          flexarray_append(dm_args, vncarg);
> +
> +        if (!dm_new && libxl_defbool_val(vnc->findunused)) {
> +            flexarray_append(dm_args, "-vncunused");
> +        }
>      }
>      if (sdl) {
>          flexarray_append(dm_args, "-sdl");
> +
> +        if (!dm_new && !libxl_defbool_val(sdl->opengl)) {
> +            flexarray_append(dm_args, "-disable-opengl");
> +        }
>          /* XXX sdl->{display,xauthority} into $DISPLAY/$XAUTHORITY */
>      }
>
> @@ -414,7 +283,7 @@ static char ** libxl__build_device_model
>              flexarray_append(dm_args, "-nographic");
>          }
>
> -        if (libxl_defbool_val(b_info->u.hvm.spice.enable)) {
> +        if (dm_new && libxl_defbool_val(b_info->u.hvm.spice.enable)) {
>              const libxl_spice_info *spice = &b_info->u.hvm.spice;
>              char *spiceoptions = dm_spice_options(gc, spice);
>              if (!spiceoptions)
> @@ -424,19 +293,35 @@ static char ** libxl__build_device_model
>              flexarray_append(dm_args, spiceoptions);
>          }
>
> -        switch (b_info->u.hvm.vga.kind) {
> -        case LIBXL_VGA_INTERFACE_TYPE_STD:
> -            flexarray_vappend(dm_args, "-vga", "std", NULL);
> -            break;
> -        case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
> -            flexarray_vappend(dm_args, "-vga", "cirrus", NULL);
> -            break;
> +        if ( dm_new ) {
> +            switch (b_info->u.hvm.vga.kind) {
> +            case LIBXL_VGA_INTERFACE_TYPE_STD:
> +                flexarray_vappend(dm_args, "-vga", "std", NULL);
> +                break;
> +            case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
> +                flexarray_vappend(dm_args, "-vga", "cirrus", NULL);
> +                break;
> +            }
> +        } else {
> +            switch (b_info->u.hvm.vga.kind) {
> +            case LIBXL_VGA_INTERFACE_TYPE_STD:
> +                flexarray_append(dm_args, "-std-vga");
> +                break;
> +            case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
> +                break;
> +            }
>          }
>
>          if (b_info->u.hvm.boot) {
> -            flexarray_vappend(dm_args, "-boot",
> -                    libxl__sprintf(gc, "order=%s", b_info->u.hvm.boot),
> NULL);
> +            if (dm_new)
> +                flexarray_vappend(dm_args, "-boot",
> +                                  libxl__sprintf(gc, "order=%s",
> +                                                 b_info->u.hvm.boot),
> NULL);
> +            else
> +                flexarray_vappend(dm_args, "-boot", b_info->u.hvm.boot,
> NULL);
> +
>          }
> +
>          if (libxl_defbool_val(b_info->u.hvm.usb) ||
> b_info->u.hvm.usbdevice) {
>              flexarray_append(dm_args, "-usb");
>              if (b_info->u.hvm.usbdevice) {
> @@ -450,19 +335,39 @@ static char ** libxl__build_device_model
>          if (!libxl_defbool_val(b_info->u.hvm.acpi)) {
>              flexarray_append(dm_args, "-no-acpi");
>          }
> -        if (b_info->max_vcpus > 1) {
> -            flexarray_append(dm_args, "-smp");
> -            if (b_info->avail_vcpus.size) {
> -                int nr_set_cpus = 0;
> -                nr_set_cpus =
> libxl_bitmap_count_set(&b_info->avail_vcpus);
>
> -                flexarray_append(dm_args, libxl__sprintf(gc,
> "%d,maxcpus=%d",
> -
> b_info->max_vcpus,
> -                                                         nr_set_cpus));
> -            } else
> -                flexarray_append(dm_args, libxl__sprintf(gc, "%d",
> -
> b_info->max_vcpus));
> +        if (dm_new)
> +        {
> +            if (b_info->max_vcpus > 1) {
> +                flexarray_append(dm_args, "-smp");
> +                if (b_info->avail_vcpus.size) {
> +                    int nr_set_cpus = 0;
> +                    nr_set_cpus =
> libxl_bitmap_count_set(&b_info->avail_vcpus);
> +
> +                    flexarray_append(dm_args,
> +                                     libxl__sprintf(gc, "%d,maxcpus=%d",
> +                                                    b_info->max_vcpus,
> +                                                    nr_set_cpus));
> +                } else
> +                    flexarray_append(dm_args,
> +                                     libxl__sprintf(gc, "%d",
> +                                                    b_info->max_vcpus));
> +            }
> +        } else {
> +            int nr_set_cpus = 0;
> +            char *s;
> +            if (b_info->max_vcpus > 1) {
> +                flexarray_vappend(dm_args, "-vcpus",
> +                                  libxl__sprintf(gc, "%d",
> b_info->max_vcpus),
> +                                  NULL);
> +            }
> +            nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
> +            s = libxl_bitmap_to_hex_string(CTX, &b_info->avail_vcpus);
> +            flexarray_vappend(dm_args, "-vcpu_avail",
> +                              libxl__sprintf(gc, "%s", s), NULL);
> +            free(s);
>          }
> +
>          for (i = 0; i < num_nics; i++) {
>              if (nics[i].nictype == LIBXL_NIC_TYPE_VIF_IOEMU) {
>                  char *smac = libxl__sprintf(gc,
> @@ -470,18 +375,35 @@ static char ** libxl__build_device_model
>                  const char *ifname = libxl__device_nic_devname(gc,
>                                                  guest_domid,
> nics[i].devid,
>                                                  LIBXL_NIC_TYPE_VIF_IOEMU);
> -                flexarray_append(dm_args, "-device");
> -                flexarray_append(dm_args,
> -                   libxl__sprintf(gc, "%s,id=nic%d,netdev=net%d,mac=%s",
> -                                                nics[i].model,
> nics[i].devid,
> -                                                nics[i].devid, smac));
> -                flexarray_append(dm_args, "-netdev");
> -                flexarray_append(dm_args, GCSPRINTF(
> -                                          "type=tap,id=net%d,ifname=%s,"
> +                if (dm_new) {
> +                    flexarray_append(dm_args, "-device");
> +                    flexarray_append(dm_args,
> +                          libxl__sprintf(gc,
> "%s,id=nic%d,netdev=net%d,mac=%s",
> +                                       nics[i].model, nics[i].devid,
> +                                       nics[i].devid, smac));
> +                    flexarray_append(dm_args, "-netdev");
> +                    flexarray_append(dm_args, GCSPRINTF(
> +                                         "type=tap,id=net%d,ifname=%s,"
> +                                         "script=%s,downscript=%s",
> +                                         nics[i].devid, ifname,
> +                                         libxl_tapif_script(gc),
> +                                         libxl_tapif_script(gc)));
> +                } else {
> +                    flexarray_vappend(dm_args,
> +                                      "-net",
> +                                      GCSPRINTF(
> +
>  "nic,vlan=%d,macaddr=%s,model=%s",
> +                                          nics[i].devid, smac,
> nics[i].model),
> +                                      "-net",
> +                                      GCSPRINTF(
> +
>  "tap,vlan=%d,ifname=%s,bridge=%s,"
>                                            "script=%s,downscript=%s",
>                                            nics[i].devid, ifname,
> +                                          nics[i].bridge,
>                                            libxl_tapif_script(gc),
> -                                          libxl_tapif_script(gc)));
> +                                          libxl_tapif_script(gc)),
> +                                      NULL);
> +                }
>                  ioemu_nics++;
>              }
>          }
> @@ -500,10 +422,15 @@ static char ** libxl__build_device_model
>      }
>
>      if (state->saved_state) {
> -        /* This file descriptor is meant to be used by QEMU */
> -        int migration_fd = open(state->saved_state, O_RDONLY);
> -        flexarray_append(dm_args, "-incoming");
> -        flexarray_append(dm_args, libxl__sprintf(gc, "fd:%d",
> migration_fd));
> +        if (dm_new) {
> +            /* This file descriptor is meant to be used by QEMU */
> +            int migration_fd = open(state->saved_state, O_RDONLY);
> +            flexarray_append(dm_args, "-incoming");
> +            flexarray_append(dm_args,
> +                             libxl__sprintf(gc, "fd:%d", migration_fd));
> +        } else {
> +            flexarray_vappend(dm_args, "-loadvm", state->saved_state,
> NULL);
> +        }
>      }
>      for (i = 0; b_info->extra && b_info->extra[i] != NULL; i++)
>          flexarray_append(dm_args, b_info->extra[i]);
> @@ -523,6 +450,9 @@ static char ** libxl__build_device_model
>          abort();
>      }
>
> +    if (!dm_new)
> +        goto finish;
> +
>      ram_size = libxl__sizekb_to_mb(b_info->max_memkb -
> b_info->video_memkb);
>      flexarray_append(dm_args, "-m");
>      flexarray_append(dm_args, libxl__sprintf(gc, "%"PRId64, ram_size));
> @@ -585,33 +515,11 @@ static char ** libxl__build_device_model
>              flexarray_append(dm_args, drive);
>          }
>      }
> +finish:
>      flexarray_append(dm_args, NULL);
>      return (char **) flexarray_contents(dm_args);
>  }
>
> -static char ** libxl__build_device_model_args(libxl__gc *gc,
> -                                        const char *dm, int guest_domid,
> -                                        const libxl_domain_config
> *guest_config,
> -                                        const libxl__domain_build_state
> *state)
> -{
> -    libxl_ctx *ctx = libxl__gc_owner(gc);
> -
> -    switch (guest_config->b_info.device_model_version) {
> -    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
> -        return libxl__build_device_model_args_old(gc, dm,
> -                                                  guest_domid,
> guest_config,
> -                                                  state);
> -    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
> -        return libxl__build_device_model_args_new(gc, dm,
> -                                                  guest_domid,
> guest_config,
> -                                                  state);
> -    default:
> -        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "unknown device model
> version %d",
> -                         guest_config->b_info.device_model_version);
> -        return NULL;
> -    }
> -}
> -
>  static void libxl__dm_vifs_from_hvm_guest_config(libxl__gc *gc,
>                                      libxl_domain_config * const
> guest_config,
>                                      libxl_domain_config *dm_config)
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>

--bcaec54eec404fd66a04cfb93d0c
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

This patch also provides an easy way to trigger an interesting &quot;failur=
e to handle failure&quot; bug in libxl.<br><br>To reproduce:<br>* Apply *on=
ly* this patch, and not patch 2 in this series (which filters it out at the=
 xl level)<br>
* Create a config file where vnclisten has a display number, and vncdisplay=
 is non-zero; e.g.:<br>=A0vnclisten=3D&quot;<a href=3D"http://0.0.0.0:1">0.=
0.0.0:1</a>&quot;<br>=A0vncdisplay=3D1<br><br>(vncdisplay=3D0 is indistingu=
ishable, to xl, from not having it set at all.)<br>
<br>The result is a set of error messages like this:<br><br>libxl: error: l=
ibxl_dm.c:231:libxl__build_device_model_args: vncdisplay set, but vnclisten=
 also contains adisplay number Too confused to continue.<br>libxl: error: l=
ibxl_dm.c:1113:device_model_spawn_outcome: (null): spawn failed (rc=3D-3)<b=
r>
libxl: error: libxl_exec.c:118:libxl_report_child_exitstatus: /etc/xen/scri=
pts/vif-bridge add [21168] exited with error status 1<br>libxl: error: libx=
l_create.c:1117:domcreate_attach_vtpms: unable to add nic devices<br>libxl:=
 error: libxl_dm.c:1140:libxl__destroy_device_model: could not find device-=
model&#39;s pid for dom 25<br>
libxl: error: libxl.c:1414:libxl__destroy_domid: libxl__destroy_device_mode=
l failed for 25<br><br>Obviously the failure in libxl__build_device_model_a=
rgs() failed to abort the domain-building process, and it continued to try =
to run vif and vtpm setups.<br>
<br>=A0-George<br><br><div class=3D"gmail_extra"><br><br><div class=3D"gmai=
l_quote">On Fri, Nov 30, 2012 at 4:24 PM, George Dunlap <span dir=3D"ltr">&=
lt;<a href=3D"mailto:george.dunlap@eu.citrix.com" target=3D"_blank">george.=
dunlap@eu.citrix.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.com">geo=
rge.dunlap@eu.citrix.com</a>&gt;<br>
# Date 1354287957 0<br>
# Node ID 722da032ac90c0e1a78b1154fa588bf295d1f009<br>
# Parent =A0ae6fb202b233af815466055d9f1a635802a50855<br>
libxl: Combine device model arg build functions<br>
<br>
qemu-traditional and qemu-upstream have some differences in the way<br>
the arguments need to be passed. =A0At the moment, this is dealt with by<br=
>
having two entirely separate functions, libxl__build_device_model_args_new<=
br>
and libxl__build_device_model_args_old.<br>
<br>
However, at least 80% of these are the same; this means that fixes or<br>
additions to one may not make it into the other. =A0Furthermore, there<br>
are some unaccounable differences in implementation.<br>
<br>
This patch combines the two functions into one, choosing between old<br>
and new implementations as necessary.<br>
<br>
It also makes the following changes to the vnc generation code:<br>
* Simplifies and comments it, making it easier to read and grok<br>
* Throws an error if duplicate values of display are set, rather<br>
=A0 than the current very un-intuitive behavior.<br>
<br>
Signed-off-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@eu.citrix.=
com">george.dunlap@eu.citrix.com</a>&gt;<br>
<br>
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c<br>
--- a/tools/libxl/libxl_dm.c<br>
+++ b/tools/libxl/libxl_dm.c<br>
@@ -95,181 +95,6 @@ static const char *dm_keymap(const libxl<br>
=A0 =A0 =A0 =A0 =A0return NULL;<br>
=A0}<br>
<br>
-static char ** libxl__build_device_model_args_old(libxl__gc *gc,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0const char *dm, int domid,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0const libxl_domain_config *guest_config,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0const libxl__domain_build_state *state)<br>
-{<br>
- =A0 =A0const libxl_domain_create_info *c_info =3D &amp;guest_config-&gt;c=
_info;<br>
- =A0 =A0const libxl_domain_build_info *b_info =3D &amp;guest_config-&gt;b_=
info;<br>
- =A0 =A0const libxl_device_nic *nics =3D guest_config-&gt;nics;<br>
- =A0 =A0const libxl_vnc_info *vnc =3D libxl__dm_vnc(guest_config);<br>
- =A0 =A0const libxl_sdl_info *sdl =3D dm_sdl(guest_config);<br>
- =A0 =A0const int num_nics =3D guest_config-&gt;num_nics;<br>
- =A0 =A0const char *keymap =3D dm_keymap(guest_config);<br>
- =A0 =A0int i;<br>
- =A0 =A0flexarray_t *dm_args;<br>
- =A0 =A0dm_args =3D flexarray_make(gc, 16, 1);<br>
-<br>
- =A0 =A0flexarray_vappend(dm_args, dm,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;-d&quot;, libxl__sprintf=
(gc, &quot;%d&quot;, domid), NULL);<br>
-<br>
- =A0 =A0if (c_info-&gt;name)<br>
- =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-domain-name&quot;, c_inf=
o-&gt;name, NULL);<br>
-<br>
- =A0 =A0if (vnc) {<br>
- =A0 =A0 =A0 =A0char *vncarg;<br>
- =A0 =A0 =A0 =A0if (vnc-&gt;display) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0if (vnc-&gt;listen &amp;&amp; strchr(vnc-&gt;liste=
n, &#39;:&#39;) =3D=3D NULL) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;%s:%d&=
quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vnc-&g=
t;listen,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vnc-&g=
t;display);<br>
- =A0 =A0 =A0 =A0 =A0 =A0} else {<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;127.0.=
0.1:%d&quot;, vnc-&gt;display);<br>
- =A0 =A0 =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0} else if (vnc-&gt;listen) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0if (strchr(vnc-&gt;listen, &#39;:&#39;) !=3D NULL)=
 {<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D vnc-&gt;listen;<br>
- =A0 =A0 =A0 =A0 =A0 =A0} else {<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;%s:0&q=
uot;, vnc-&gt;listen);<br>
- =A0 =A0 =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0} else {<br>
- =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D &quot;<a href=3D"http://127.0.0.1:0" ta=
rget=3D"_blank">127.0.0.1:0</a>&quot;;<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0if (vnc-&gt;passwd &amp;&amp; (vnc-&gt;passwd[0] !=3D &#39=
;\0&#39;))<br>
- =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;%s,password&qu=
ot;, vncarg);<br>
- =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-vnc&quot;);<br>
- =A0 =A0 =A0 =A0flexarray_append(dm_args, vncarg);<br>
-<br>
- =A0 =A0 =A0 =A0if (libxl_defbool_val(vnc-&gt;findunused)) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-vncunused&quot;);=
<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0}<br>
- =A0 =A0if (sdl) {<br>
- =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-sdl&quot;);<br>
- =A0 =A0 =A0 =A0if (!libxl_defbool_val(sdl-&gt;opengl)) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-disable-opengl&qu=
ot;);<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0/* XXX sdl-&gt;{display,xauthority} into $DISPLAY/$XAUTHOR=
ITY */<br>
- =A0 =A0}<br>
- =A0 =A0if (keymap) {<br>
- =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-k&quot;, keymap, NULL);<=
br>
- =A0 =A0}<br>
- =A0 =A0if (b_info-&gt;type =3D=3D LIBXL_DOMAIN_TYPE_HVM) {<br>
- =A0 =A0 =A0 =A0int ioemu_nics =3D 0;<br>
- =A0 =A0 =A0 =A0int nr_set_cpus =3D 0;<br>
- =A0 =A0 =A0 =A0char *s;<br>
-<br>
- =A0 =A0 =A0 =A0if (b_info-&gt;u.hvm.serial) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-serial&quot;, b_=
info-&gt;u.hvm.serial, NULL);<br>
- =A0 =A0 =A0 =A0}<br>
-<br>
- =A0 =A0 =A0 =A0if (libxl_defbool_val(b_info-&gt;u.hvm.nographic) &amp;&am=
p; (!sdl &amp;&amp; !vnc)) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-nographic&quot;);=
<br>
- =A0 =A0 =A0 =A0}<br>
-<br>
- =A0 =A0 =A0 =A0if (b_info-&gt;video_memkb) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-videoram&quot;,<=
br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf(gc, &quot;%d&quot;,=
<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 libxl=
__sizekb_to_mb(b_info-&gt;video_memkb)),<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0NULL);<br>
- =A0 =A0 =A0 =A0}<br>
-<br>
- =A0 =A0 =A0 =A0switch (b_info-&gt;u.hvm.vga.kind) {<br>
- =A0 =A0 =A0 =A0case LIBXL_VGA_INTERFACE_TYPE_STD:<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-std-vga&quot;);<b=
r>
- =A0 =A0 =A0 =A0 =A0 =A0break;<br>
- =A0 =A0 =A0 =A0case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:<br>
- =A0 =A0 =A0 =A0 =A0 =A0break;<br>
- =A0 =A0 =A0 =A0}<br>
-<br>
- =A0 =A0 =A0 =A0if (b_info-&gt;u.hvm.boot) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-boot&quot;, b_in=
fo-&gt;u.hvm.boot, NULL);<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0if (libxl_defbool_val(b_info-&gt;u.hvm.usb) || b_info-&gt;=
u.hvm.usbdevice) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-usb&quot;);<br>
- =A0 =A0 =A0 =A0 =A0 =A0if (b_info-&gt;u.hvm.usbdevice) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;=
-usbdevice&quot;, b_info-&gt;u.hvm.usbdevice, NULL);<br>
- =A0 =A0 =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0if (b_info-&gt;u.hvm.soundhw) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-soundhw&quot;, b=
_info-&gt;u.hvm.soundhw, NULL);<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0if (libxl_defbool_val(b_info-&gt;u.hvm.acpi)) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-acpi&quot;);<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0if (b_info-&gt;max_vcpus &gt; 1) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-vcpus&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf=
(gc, &quot;%d&quot;, b_info-&gt;max_vcpus),<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0NULL);<br>
- =A0 =A0 =A0 =A0}<br>
-<br>
- =A0 =A0 =A0 =A0nr_set_cpus =3D libxl_bitmap_count_set(&amp;b_info-&gt;ava=
il_vcpus);<br>
- =A0 =A0 =A0 =A0s =3D libxl_bitmap_to_hex_string(CTX, &amp;b_info-&gt;avai=
l_vcpus);<br>
- =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-vcpu_avail&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf=
(gc, &quot;%s&quot;, s), NULL);<br>
- =A0 =A0 =A0 =A0free(s);<br>
-<br>
- =A0 =A0 =A0 =A0for (i =3D 0; i &lt; num_nics; i++) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0if (nics[i].nictype =3D=3D LIBXL_NIC_TYPE_VIF_IOEM=
U) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0char *smac =3D libxl__sprintf(gc,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 LIBXL=
_MAC_FMT, LIBXL_MAC_BYTES(nics[i].mac));<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0const char *ifname =3D libxl__device_nic_d=
evname(gc,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0domid, nics[i].devid,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0LIBXL_NIC_TYPE_VIF_IOEMU);<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;=
-net&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0GCSPRI=
NTF(<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0&quot;nic,vlan=3D%d,macaddr=3D%s,model=3D%s&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0nics[i].devid, smac, nics[i].model),<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;=
-net&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0GCSPRI=
NTF(<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0&quot;tap,vlan=3D%d,ifname=3D%s,bridge=3D%s,&quot;<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0&quot;script=3D%s,downscript=3D%s&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0nics[i].devid, ifname, nics[i].bridge,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0libxl_tapif_script(gc),<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0libxl_tapif_script(gc)),<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0NULL);=
<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ioemu_nics++;<br>
- =A0 =A0 =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0/* If we have no emulated nics, tell qemu not to create an=
y */<br>
- =A0 =A0 =A0 =A0if ( ioemu_nics =3D=3D 0 ) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-net&quot;, &quot=
;none&quot;, NULL);<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0if (libxl_defbool_val(b_info-&gt;u.hvm.gfx_passthru)) {<br=
>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-gfx_passthru&quot=
;);<br>
- =A0 =A0 =A0 =A0}<br>
- =A0 =A0} else {<br>
- =A0 =A0 =A0 =A0if (!sdl &amp;&amp; !vnc)<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-nographic&quot;);=
<br>
- =A0 =A0}<br>
-<br>
- =A0 =A0if (state-&gt;saved_state) {<br>
- =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-loadvm&quot;, state-&gt;=
saved_state, NULL);<br>
- =A0 =A0}<br>
- =A0 =A0for (i =3D 0; b_info-&gt;extra &amp;&amp; b_info-&gt;extra[i] !=3D=
 NULL; i++)<br>
- =A0 =A0 =A0 =A0flexarray_append(dm_args, b_info-&gt;extra[i]);<br>
- =A0 =A0flexarray_append(dm_args, &quot;-M&quot;);<br>
- =A0 =A0switch (b_info-&gt;type) {<br>
- =A0 =A0case LIBXL_DOMAIN_TYPE_PV:<br>
- =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;xenpv&quot;);<br>
- =A0 =A0 =A0 =A0for (i =3D 0; b_info-&gt;extra_pv &amp;&amp; b_info-&gt;ex=
tra_pv[i] !=3D NULL; i++)<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, b_info-&gt;extra_pv[i]);=
<br>
- =A0 =A0 =A0 =A0break;<br>
- =A0 =A0case LIBXL_DOMAIN_TYPE_HVM:<br>
- =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;xenfv&quot;);<br>
- =A0 =A0 =A0 =A0for (i =3D 0; b_info-&gt;extra_hvm &amp;&amp; b_info-&gt;e=
xtra_hvm[i] !=3D NULL; i++)<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, b_info-&gt;extra_hvm[i])=
;<br>
- =A0 =A0 =A0 =A0break;<br>
- =A0 =A0default:<br>
- =A0 =A0 =A0 =A0abort();<br>
- =A0 =A0}<br>
- =A0 =A0flexarray_append(dm_args, NULL);<br>
- =A0 =A0return (char **) flexarray_contents(dm_args);<br>
-}<br>
-<br>
=A0static const char *qemu_disk_format_string(libxl_disk_format format)<br>
=A0{<br>
=A0 =A0 =A0switch (format) {<br>
@@ -318,7 +143,7 @@ static char *dm_spice_options(libxl__gc<br>
=A0 =A0 =A0return opt;<br>
=A0}<br>
<br>
-static char ** libxl__build_device_model_args_new(libxl__gc *gc,<br>
+static char ** libxl__build_device_model_args(libxl__gc *gc,<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0const char *dm, int guest_domid,<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0const libxl_domain_config *guest_config,<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0const libxl__domain_build_state *state)<br>
@@ -336,62 +161,106 @@ static char ** libxl__build_device_model<br>
=A0 =A0 =A0flexarray_t *dm_args;<br>
=A0 =A0 =A0int i;<br>
=A0 =A0 =A0uint64_t ram_size;<br>
+ =A0 =A0int dm_new;<br>
+<br>
+ =A0 =A0switch (guest_config-&gt;b_info.device_model_version) {<br>
+ =A0 =A0case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:<br>
+ =A0 =A0 =A0 =A0dm_new =3D 0;<br>
+ =A0 =A0 =A0 =A0break;<br>
+ =A0 =A0case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:<br>
+ =A0 =A0 =A0 =A0dm_new =3D 1;<br>
+ =A0 =A0 =A0 =A0break;<br>
+ =A0 =A0default:<br>
+ =A0 =A0 =A0 =A0LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, &quot;unknown devi=
ce model version %d&quot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 guest_config-&gt;b_info.d=
evice_model_version);<br>
+ =A0 =A0 =A0 =A0return NULL;<br>
+ =A0 =A0}<br>
+<br>
<br>
=A0 =A0 =A0dm_args =3D flexarray_make(gc, 16, 1);<br>
<br>
- =A0 =A0flexarray_vappend(dm_args, dm,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;-xen-domid&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf(gc, &quot;%d&qu=
ot;, guest_domid), NULL);<br>
+ =A0 =A0/* Domain ID */<br>
+ =A0 =A0if (dm_new) {<br>
+ =A0 =A0 =A0 =A0flexarray_vappend(dm_args, dm,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;-xen-domid&quot;=
,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf(gc, &qu=
ot;%d&quot;, guest_domid), NULL);<br>
+ =A0 =A0} else {<br>
+ =A0 =A0 =A0 =A0flexarray_vappend(dm_args, dm,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;-d&quot;, libxl_=
_sprintf(gc, &quot;%d&quot;, guest_domid), NULL);<br>
+ =A0 =A0}<br>
<br>
- =A0 =A0flexarray_append(dm_args, &quot;-chardev&quot;);<br>
- =A0 =A0flexarray_append(dm_args,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 libxl__sprintf(gc, &quot;socket,i=
d=3Dlibxl-cmd,&quot;<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&q=
uot;path=3D%s/qmp-libxl-%d,server,nowait&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0li=
bxl__run_dir_path(), guest_domid));<br>
+ =A0 =A0if (dm_new) {<br>
+ =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-chardev&quot;);<br>
+ =A0 =A0 =A0 =A0flexarray_append(dm_args,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 libxl__sprintf(gc, &quot;=
socket,id=3Dlibxl-cmd,&quot;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0&quot;path=3D%s/qmp-libxl-%d,server,nowait&quot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0libxl__run_dir_path(), guest_domid));<br>
<br>
- =A0 =A0flexarray_append(dm_args, &quot;-mon&quot;);<br>
- =A0 =A0flexarray_append(dm_args, &quot;chardev=3Dlibxl-cmd,mode=3Dcontrol=
&quot;);<br>
+ =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-mon&quot;);<br>
+ =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;chardev=3Dlibxl-cmd,mode=
=3Dcontrol&quot;);<br>
<br>
- =A0 =A0if (b_info-&gt;type =3D=3D LIBXL_DOMAIN_TYPE_PV) {<br>
- =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-xen-attach&quot;);<br>
+ =A0 =A0 =A0 =A0if (b_info-&gt;type =3D=3D LIBXL_DOMAIN_TYPE_PV) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-xen-attach&quot;)=
;<br>
+ =A0 =A0 =A0 =A0}<br>
=A0 =A0 =A0}<br>
<br>
=A0 =A0 =A0if (c_info-&gt;name) {<br>
- =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-name&quot;, c_info-&gt;n=
ame, NULL);<br>
+ =A0 =A0 =A0 =A0if ( dm_new )<br>
+ =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-name&quot;, c_in=
fo-&gt;name, NULL);<br>
+ =A0 =A0 =A0 =A0else<br>
+ =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-domain-name&quot=
;, c_info-&gt;name, NULL);<br>
=A0 =A0 =A0}<br>
+<br>
=A0 =A0 =A0if (vnc) {<br>
- =A0 =A0 =A0 =A0int display =3D 0;<br>
- =A0 =A0 =A0 =A0const char *addr =3D &quot;127.0.0.1&quot;;<br>
=A0 =A0 =A0 =A0 =A0char *vncarg =3D NULL;<br>
<br>
=A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-vnc&quot;);<br>
<br>
- =A0 =A0 =A0 =A0if (vnc-&gt;display) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0display =3D vnc-&gt;display;<br>
- =A0 =A0 =A0 =A0 =A0 =A0if (vnc-&gt;listen &amp;&amp; strchr(vnc-&gt;liste=
n, &#39;:&#39;) =3D=3D NULL) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0addr =3D vnc-&gt;listen;<br>
+ =A0 =A0 =A0 =A0/*<br>
+ =A0 =A0 =A0 =A0 * If vnc-&gt;listen is present and contains a :, and<br>
+ =A0 =A0 =A0 =A0 * =A0- vnc-&gt;display is 0, use vnc-&gt;listen<br>
+ =A0 =A0 =A0 =A0 * =A0- vnc-&gt;display is non-zero, be confused<br>
+ =A0 =A0 =A0 =A0 * If vnc-&gt;listen is present but doesn&#39;t, use vnc-&=
gt;listen:vnc-&gt;display.<br>
+ =A0 =A0 =A0 =A0 * If vnc-&gt;listen is not present, use 127.0.0.1:vnc-&gt=
;display<br>
+ =A0 =A0 =A0 =A0 * (Remembering that vnc-&gt;display already defaults to 0=
.)<br>
+ =A0 =A0 =A0 =A0 */<br>
+ =A0 =A0 =A0 =A0if (vnc-&gt;listen) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0if (strchr(vnc-&gt;listen, &#39;:&#39;) !=3D NULL)=
 {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (vnc-&gt;display) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0LOG(ERROR, &quot;vncdisplay set, v=
nclisten contains display&quot;);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return NULL;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D vnc-&gt;listen;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0} else {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;%s:%d&=
quot;, vnc-&gt;listen,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0vnc-&gt;display);<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0} else if (vnc-&gt;listen) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0addr =3D vnc-&gt;listen;<br>
- =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0} else<br>
+ =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;127.0.0.1:%d&q=
uot;, vnc-&gt;display);<br>
<br>
- =A0 =A0 =A0 =A0if (strchr(addr, &#39;:&#39;) !=3D NULL)<br>
- =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;%s&quot;, addr=
);<br>
- =A0 =A0 =A0 =A0else<br>
- =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;%s:%d&quot;, a=
ddr, display);<br>
=A0 =A0 =A0 =A0 =A0if (vnc-&gt;passwd &amp;&amp; vnc-&gt;passwd[0]) {<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;%s,password&=
quot;, vncarg);<br>
=A0 =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0if (libxl_defbool_val(vnc-&gt;findunused)) {<br>
+<br>
+ =A0 =A0 =A0 =A0if (dm_new &amp;&amp; libxl_defbool_val(vnc-&gt;findunused=
)) {<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0/* This option asks to QEMU to try this number o=
f port before to<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 * give up. =A0So QEMU will try ports between $d=
isplay and $display +<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 * 99. =A0This option needs to be the last one o=
f the vnc options. */<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0vncarg =3D libxl__sprintf(gc, &quot;%s,to=3D99&q=
uot;, vncarg);<br>
=A0 =A0 =A0 =A0 =A0}<br>
+<br>
=A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, vncarg);<br>
+<br>
+ =A0 =A0 =A0 =A0if (!dm_new &amp;&amp; libxl_defbool_val(vnc-&gt;findunuse=
d)) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-vncunused&quot;);=
<br>
+ =A0 =A0 =A0 =A0}<br>
=A0 =A0 =A0}<br>
=A0 =A0 =A0if (sdl) {<br>
=A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-sdl&quot;);<br>
+<br>
+ =A0 =A0 =A0 =A0if (!dm_new &amp;&amp; !libxl_defbool_val(sdl-&gt;opengl))=
 {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-disable-opengl&qu=
ot;);<br>
+ =A0 =A0 =A0 =A0}<br>
=A0 =A0 =A0 =A0 =A0/* XXX sdl-&gt;{display,xauthority} into $DISPLAY/$XAUTH=
ORITY */<br>
=A0 =A0 =A0}<br>
<br>
@@ -414,7 +283,7 @@ static char ** libxl__build_device_model<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-nographic&quot;=
);<br>
=A0 =A0 =A0 =A0 =A0}<br>
<br>
- =A0 =A0 =A0 =A0if (libxl_defbool_val(b_info-&gt;u.hvm.spice.enable)) {<br=
>
+ =A0 =A0 =A0 =A0if (dm_new &amp;&amp; libxl_defbool_val(b_info-&gt;u.hvm.s=
pice.enable)) {<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0const libxl_spice_info *spice =3D &amp;b_info-&g=
t;u.hvm.spice;<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0char *spiceoptions =3D dm_spice_options(gc, spic=
e);<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0if (!spiceoptions)<br>
@@ -424,19 +293,35 @@ static char ** libxl__build_device_model<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, spiceoptions);<br>
=A0 =A0 =A0 =A0 =A0}<br>
<br>
- =A0 =A0 =A0 =A0switch (b_info-&gt;u.hvm.vga.kind) {<br>
- =A0 =A0 =A0 =A0case LIBXL_VGA_INTERFACE_TYPE_STD:<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-vga&quot;, &quot=
;std&quot;, NULL);<br>
- =A0 =A0 =A0 =A0 =A0 =A0break;<br>
- =A0 =A0 =A0 =A0case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-vga&quot;, &quot=
;cirrus&quot;, NULL);<br>
- =A0 =A0 =A0 =A0 =A0 =A0break;<br>
+ =A0 =A0 =A0 =A0if ( dm_new ) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0switch (b_info-&gt;u.hvm.vga.kind) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0case LIBXL_VGA_INTERFACE_TYPE_STD:<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-vga&quot=
;, &quot;std&quot;, NULL);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-vga&quot=
;, &quot;cirrus&quot;, NULL);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0} else {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0switch (b_info-&gt;u.hvm.vga.kind) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0case LIBXL_VGA_INTERFACE_TYPE_STD:<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-std-vga&q=
uot;);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0}<br>
=A0 =A0 =A0 =A0 =A0}<br>
<br>
=A0 =A0 =A0 =A0 =A0if (b_info-&gt;u.hvm.boot) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-boot&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf(gc, &quot;order=3D%=
s&quot;, b_info-&gt;u.hvm.boot), NULL);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0if (dm_new)<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-boot&quo=
t;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl_=
_sprintf(gc, &quot;order=3D%s&quot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 b_info-&gt;u.hvm.boot), NULL);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0else<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-boot&quo=
t;, b_info-&gt;u.hvm.boot, NULL);<br>
+<br>
=A0 =A0 =A0 =A0 =A0}<br>
+<br>
=A0 =A0 =A0 =A0 =A0if (libxl_defbool_val(b_info-&gt;u.hvm.usb) || b_info-&g=
t;u.hvm.usbdevice) {<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-usb&quot;);<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0if (b_info-&gt;u.hvm.usbdevice) {<br>
@@ -450,19 +335,39 @@ static char ** libxl__build_device_model<br>
=A0 =A0 =A0 =A0 =A0if (!libxl_defbool_val(b_info-&gt;u.hvm.acpi)) {<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-no-acpi&quot;);=
<br>
=A0 =A0 =A0 =A0 =A0}<br>
- =A0 =A0 =A0 =A0if (b_info-&gt;max_vcpus &gt; 1) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-smp&quot;);<br>
- =A0 =A0 =A0 =A0 =A0 =A0if (b_info-&gt;avail_vcpus.size) {<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0int nr_set_cpus =3D 0;<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0nr_set_cpus =3D libxl_bitmap_count_set(&am=
p;b_info-&gt;avail_vcpus);<br>
<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, libxl__sprintf(g=
c, &quot;%d,maxcpus=3D%d&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 b_info-&gt;max_vcpus,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 nr_set_cpus));<br>
- =A0 =A0 =A0 =A0 =A0 =A0} else<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, libxl__sprintf(g=
c, &quot;%d&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 b_info-&gt;max_vcpus));<br>
+ =A0 =A0 =A0 =A0if (dm_new)<br>
+ =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0if (b_info-&gt;max_vcpus &gt; 1) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-smp&quot;=
);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (b_info-&gt;avail_vcpus.size) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0int nr_set_cpus =3D 0;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0nr_set_cpus =3D libxl_bitmap_count=
_set(&amp;b_info-&gt;avail_vcpus);<br>
+<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 l=
ibxl__sprintf(gc, &quot;%d,maxcpus=3D%d&quot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0b_info-&gt;max_vcpus,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0nr_set_cpus));<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 l=
ibxl__sprintf(gc, &quot;%d&quot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0b_info-&gt;max_vcpus));<br>
+ =A0 =A0 =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0} else {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0int nr_set_cpus =3D 0;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0char *s;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0if (b_info-&gt;max_vcpus &gt; 1) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-vcpus&qu=
ot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl_=
_sprintf(gc, &quot;%d&quot;, b_info-&gt;max_vcpus),<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0NULL);=
<br>
+ =A0 =A0 =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0 =A0 =A0nr_set_cpus =3D libxl_bitmap_count_set(&amp;b_info=
-&gt;avail_vcpus);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0s =3D libxl_bitmap_to_hex_string(CTX, &amp;b_info-=
&gt;avail_vcpus);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-vcpu_avail&quot;=
,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf=
(gc, &quot;%s&quot;, s), NULL);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0free(s);<br>
=A0 =A0 =A0 =A0 =A0}<br>
+<br>
=A0 =A0 =A0 =A0 =A0for (i =3D 0; i &lt; num_nics; i++) {<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0if (nics[i].nictype =3D=3D LIBXL_NIC_TYPE_VIF_IO=
EMU) {<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0char *smac =3D libxl__sprintf(gc,<br>
@@ -470,18 +375,35 @@ static char ** libxl__build_device_model<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0const char *ifname =3D libxl__device_nic=
_devname(gc,<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0guest_domid, nics[i].devid,<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0LIBXL_NIC_TYPE_VIF_IOEMU);<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-device&qu=
ot;);<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 libxl__sprintf(gc, &quot;%s,id=3Dnic%=
d,netdev=3Dnet%d,mac=3D%s&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0nics[i].model, nics[i].devid,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0nics[i].devid, smac));<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-netdev&qu=
ot;);<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, GCSPRINTF(<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0&quot;type=3Dtap,id=3Dnet%d,ifname=3D%s,&quot;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (dm_new) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-d=
evice&quot;);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf(gc, &qu=
ot;%s,id=3Dnic%d,netdev=3Dnet%d,mac=3D%s&quot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 nics[i].model, nics[i].devid,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 nics[i].devid, smac));<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-n=
etdev&quot;);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, GCSPRINT=
F(<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 &quot;type=3Dtap,id=3Dnet%d,ifname=3D%s,&quot;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 &quot;script=3D%s,downscript=3D%s&quot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 nics[i].devid, ifname,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 libxl_tapif_script(gc),<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 libxl_tapif_script(gc)));<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0&quot;-net&quot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0GCSPRINTF(<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0&quot;nic,vlan=3D%d,macaddr=3D%s,model=3D%s&quot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0nics[i].devid, smac, nics[i].model),<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0&quot;-net&quot;,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A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 static char ** libxl__build_device_model<br>
=A0 =A0 =A0}<br>
<br>
=A0 =A0 =A0if (state-&gt;saved_state) {<br>
- =A0 =A0 =A0 =A0/* This file descriptor is meant to be used by QEMU */<br>
- =A0 =A0 =A0 =A0int migration_fd =3D open(state-&gt;saved_state, O_RDONLY)=
;<br>
- =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-incoming&quot;);<br>
- =A0 =A0 =A0 =A0flexarray_append(dm_args, libxl__sprintf(gc, &quot;fd:%d&q=
uot;, migration_fd));<br>
+ =A0 =A0 =A0 =A0if (dm_new) {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0/* This file descriptor is meant to be used by QEM=
U */<br>
+ =A0 =A0 =A0 =A0 =A0 =A0int migration_fd =3D open(state-&gt;saved_state, O=
_RDONLY);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, &quot;-incoming&quot;);<=
br>
+ =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args,<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 libxl__sprintf(gc=
, &quot;fd:%d&quot;, migration_fd));<br>
+ =A0 =A0 =A0 =A0} else {<br>
+ =A0 =A0 =A0 =A0 =A0 =A0flexarray_vappend(dm_args, &quot;-loadvm&quot;, st=
ate-&gt;saved_state, NULL);<br>
+ =A0 =A0 =A0 =A0}<br>
=A0 =A0 =A0}<br>
=A0 =A0 =A0for (i =3D 0; b_info-&gt;extra &amp;&amp; b_info-&gt;extra[i] !=
=3D NULL; i++)<br>
=A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, b_info-&gt;extra[i]);<br>
@@ -523,6 +450,9 @@ static char ** libxl__build_device_model<br>
=A0 =A0 =A0 =A0 =A0abort();<br>
=A0 =A0 =A0}<br>
<br>
+ =A0 =A0if (!dm_new)<br>
+ =A0 =A0 =A0 =A0goto finish;<br>
+<br>
=A0 =A0 =A0ram_size =3D libxl__sizekb_to_mb(b_info-&gt;max_memkb - b_info-&=
gt;video_memkb);<br>
=A0 =A0 =A0flexarray_append(dm_args, &quot;-m&quot;);<br>
=A0 =A0 =A0flexarray_append(dm_args, libxl__sprintf(gc, &quot;%&quot;PRId64=
, ram_size));<br>
@@ -585,33 +515,11 @@ static char ** libxl__build_device_model<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, drive);<br>
=A0 =A0 =A0 =A0 =A0}<br>
=A0 =A0 =A0}<br>
+finish:<br>
=A0 =A0 =A0flexarray_append(dm_args, NULL);<br>
=A0 =A0 =A0return (char **) flexarray_contents(dm_args);<br>
=A0}<br>
<br>
-static char ** libxl__build_device_model_args(libxl__gc *gc,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0const char *dm, int guest_domid,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0const libxl_domain_config *guest_config,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0const libxl__domain_build_state *state)<br>
-{<br>
- =A0 =A0libxl_ctx *ctx =3D libxl__gc_owner(gc);<br>
-<br>
- =A0 =A0switch (guest_config-&gt;b_info.device_model_version) {<br>
- =A0 =A0case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:<br>
- =A0 =A0 =A0 =A0return libxl__build_device_model_args_old(gc, dm,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0guest_domid, guest_config,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0state);<br>
- =A0 =A0case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:<br>
- =A0 =A0 =A0 =A0return libxl__build_device_model_args_new(gc, dm,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0guest_domid, guest_config,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0state);<br>
- =A0 =A0default:<br>
- =A0 =A0 =A0 =A0LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, &quot;unknown devi=
ce model version %d&quot;,<br>
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 guest_config-&gt;b_info.d=
evice_model_version);<br>
- =A0 =A0 =A0 =A0return NULL;<br>
- =A0 =A0}<br>
-}<br>
-<br>
=A0static void libxl__dm_vifs_from_hvm_guest_config(libxl__gc *gc,<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
libxl_domain_config * const guest_config,<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
libxl_domain_config *dm_config)<br>
<br>
_______________________________________________<br>
Xen-devel mailing list<br>
<a href=3D"mailto:Xen-devel@lists.xen.org">Xen-devel@lists.xen.org</a><br>
<a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://lists.x=
en.org/xen-devel</a><br>
</blockquote></div><br></div>

--bcaec54eec404fd66a04cfb93d0c--


--===============2341031737812672154==
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.xen.org
http://lists.xen.org/xen-devel

--===============2341031737812672154==--


From xen-devel-bounces@lists.xen.org Fri Nov 30 17:14:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 17:14:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeUAA-000476-E5; Fri, 30 Nov 2012 17:14:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <anil@recoil.org>) id 1TeUA9-000471-3O
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 17:14:05 +0000
Received: from [193.109.254.147:35161] by server-12.bemta-14.messagelabs.com
	id 2B/30-00510-C59E8B05; Fri, 30 Nov 2012 17:14:04 +0000
X-Env-Sender: anil@recoil.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1354295643!8555364!1
X-Originating-IP: [89.16.177.154]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31960 invoked from network); 30 Nov 2012 17:14:03 -0000
Received: from recoil.dh.bytemark.co.uk (HELO dark.recoil.org) (89.16.177.154)
	by server-13.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 17:14:03 -0000
Received: (qmail 10239 invoked by uid 634); 30 Nov 2012 17:14:02 -0000
X-Spam-Level: *
X-Spam-Status: No, hits=-1.0 required=5.0
	tests=ALL_TRUSTED
X-Spam-Check-By: dark.recoil.org
Received: from volstagg-0.srg.cl.cam.ac.uk (HELO [10.0.0.83]) (128.232.32.232)
	(smtp-auth username remote@recoil.org, mechanism cram-md5)
	by dark.recoil.org (qpsmtpd/0.84) with ESMTPA;
	Fri, 30 Nov 2012 17:14:02 +0000
From: Anil Madhavapeddy <anil@recoil.org>
Date: Fri, 30 Nov 2012 17:14:01 +0000
Message-Id: <47152122-2636-48ED-BD08-B8C69B7F2D18@recoil.org>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Mime-Version: 1.0 (Mac OS X Mail 6.1 \(1498\))
X-Mailer: Apple Mail (2.1498)
X-Virus-Checked: Checked by ClamAV on dark.recoil.org
Cc: Balraj Singh <balraj.singh@cl.cam.ac.uk>,
	Steven Smith <steven.smith@cl.cam.ac.uk>
Subject: [Xen-devel] Initialising MXCSR in PV guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

We're seeing floating point exceptions on some (but not all) machines when doing FP operations inside MiniOS.

It looks like the FPU and SSE control registers are not set to good default values (which by default mask various FP exceptions) when MiniOS is started as a PV guest. If the call to fpu_init below is not made, the division generates a precision error and fails.  

Do PV guests all need to explicitly initialise MXCSR, or has something changed in Xen to trigger this now?  It seems to have been set in the past, and only happens on some hosts.

--- extras/mini-os/kernelorig.c    2012-11-30 15:59:46.308837388 +0000
+++ extras/mini-os/kernel.c    2012-11-30 16:02:12.532408020 +0000
@@ -64,10 +64,32 @@
     }
 }
 
+#define MXCSR_DEFAULT 0x1f80
+
+static void fpu_init(void)
+{
+  unsigned long val = MXCSR_DEFAULT;
+  asm volatile ( "fninit; ldmxcsr %0" : : "m" (val) );
+}
+
 /* This should be overridden by the application we are linked against. */
 __attribute__((weak)) int app_main(start_info_t *si)
 {
     printk("Dummy main: start_info=%p\n", si);
+
+    double x = 10.0;
+    double y = 3.0;
+
+    /* This division only works when the fpu_init call is made.
+     * The call sets the fpu and sse control registers to default values,
+     * which mask various exceptions including the precision exception.
+     * When the fpu_init call is not made the division below fails with
+     * a precision exception.
+     */
+    double z = x/y;
+
+    printk("x = %d, y = %d, z = %d\n", (int) x, (int) y, (int) z);
+
     return 0;
 }
 
@@ -98,6 +120,9 @@
     printk("    cmd_line: %s\n",  
            si->cmd_line ? (const char *)si->cmd_line : "NULL");
 
+    /* Initialize fpu and sse */
+    fpu_init();
+
     /* Set up events. */
     init_events();
     



The offending host is:

$ uname -a
Linux Monday 3.6.2 #1 SMP PREEMPT Wed Oct 17 22:22:30 BST 2012 x86_64 GNU/Linux

$ cat /proc/cpuinfo 
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model	 : 58
model name	: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
stepping	: 9
microcode	: 0x12
cpu MHz	 : 3392.428
cache size	: 8192 KB
physical id	: 0
siblings	: 8
core id	 : 0
cpu cores	: 4
apicid	 : 0
initial apicid	: 0
fpu	 : yes
fpu_exception	: yes
cpuid level	: 13
wp	 : yes
flags	 : fpu de tsc msr pae mce cx8 apic sep mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl nonstop_tsc pni pclmulqdq est ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm ida arat epb xsaveopt pln pts dtherm fsgsbase erms
bogomips	: 6784.85
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 17:14:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 17:14:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeUAA-000476-E5; Fri, 30 Nov 2012 17:14:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <anil@recoil.org>) id 1TeUA9-000471-3O
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 17:14:05 +0000
Received: from [193.109.254.147:35161] by server-12.bemta-14.messagelabs.com
	id 2B/30-00510-C59E8B05; Fri, 30 Nov 2012 17:14:04 +0000
X-Env-Sender: anil@recoil.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1354295643!8555364!1
X-Originating-IP: [89.16.177.154]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31960 invoked from network); 30 Nov 2012 17:14:03 -0000
Received: from recoil.dh.bytemark.co.uk (HELO dark.recoil.org) (89.16.177.154)
	by server-13.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 17:14:03 -0000
Received: (qmail 10239 invoked by uid 634); 30 Nov 2012 17:14:02 -0000
X-Spam-Level: *
X-Spam-Status: No, hits=-1.0 required=5.0
	tests=ALL_TRUSTED
X-Spam-Check-By: dark.recoil.org
Received: from volstagg-0.srg.cl.cam.ac.uk (HELO [10.0.0.83]) (128.232.32.232)
	(smtp-auth username remote@recoil.org, mechanism cram-md5)
	by dark.recoil.org (qpsmtpd/0.84) with ESMTPA;
	Fri, 30 Nov 2012 17:14:02 +0000
From: Anil Madhavapeddy <anil@recoil.org>
Date: Fri, 30 Nov 2012 17:14:01 +0000
Message-Id: <47152122-2636-48ED-BD08-B8C69B7F2D18@recoil.org>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Mime-Version: 1.0 (Mac OS X Mail 6.1 \(1498\))
X-Mailer: Apple Mail (2.1498)
X-Virus-Checked: Checked by ClamAV on dark.recoil.org
Cc: Balraj Singh <balraj.singh@cl.cam.ac.uk>,
	Steven Smith <steven.smith@cl.cam.ac.uk>
Subject: [Xen-devel] Initialising MXCSR in PV guests
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

We're seeing floating point exceptions on some (but not all) machines when doing FP operations inside MiniOS.

It looks like the FPU and SSE control registers are not set to good default values (which by default mask various FP exceptions) when MiniOS is started as a PV guest. If the call to fpu_init below is not made, the division generates a precision error and fails.  

Do PV guests all need to explicitly initialise MXCSR, or has something changed in Xen to trigger this now?  It seems to have been set in the past, and only happens on some hosts.

--- extras/mini-os/kernelorig.c    2012-11-30 15:59:46.308837388 +0000
+++ extras/mini-os/kernel.c    2012-11-30 16:02:12.532408020 +0000
@@ -64,10 +64,32 @@
     }
 }
 
+#define MXCSR_DEFAULT 0x1f80
+
+static void fpu_init(void)
+{
+  unsigned long val = MXCSR_DEFAULT;
+  asm volatile ( "fninit; ldmxcsr %0" : : "m" (val) );
+}
+
 /* This should be overridden by the application we are linked against. */
 __attribute__((weak)) int app_main(start_info_t *si)
 {
     printk("Dummy main: start_info=%p\n", si);
+
+    double x = 10.0;
+    double y = 3.0;
+
+    /* This division only works when the fpu_init call is made.
+     * The call sets the fpu and sse control registers to default values,
+     * which mask various exceptions including the precision exception.
+     * When the fpu_init call is not made the division below fails with
+     * a precision exception.
+     */
+    double z = x/y;
+
+    printk("x = %d, y = %d, z = %d\n", (int) x, (int) y, (int) z);
+
     return 0;
 }
 
@@ -98,6 +120,9 @@
     printk("    cmd_line: %s\n",  
            si->cmd_line ? (const char *)si->cmd_line : "NULL");
 
+    /* Initialize fpu and sse */
+    fpu_init();
+
     /* Set up events. */
     init_events();
     



The offending host is:

$ uname -a
Linux Monday 3.6.2 #1 SMP PREEMPT Wed Oct 17 22:22:30 BST 2012 x86_64 GNU/Linux

$ cat /proc/cpuinfo 
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model	 : 58
model name	: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
stepping	: 9
microcode	: 0x12
cpu MHz	 : 3392.428
cache size	: 8192 KB
physical id	: 0
siblings	: 8
core id	 : 0
cpu cores	: 4
apicid	 : 0
initial apicid	: 0
fpu	 : yes
fpu_exception	: yes
cpuid level	: 13
wp	 : yes
flags	 : fpu de tsc msr pae mce cx8 apic sep mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl nonstop_tsc pni pclmulqdq est ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm ida arat epb xsaveopt pln pts dtherm fsgsbase erms
bogomips	: 6784.85
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 17:20:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 17:20:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeUFd-0004GN-6q; Fri, 30 Nov 2012 17:19:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TeUFb-0004GI-NS
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 17:19:43 +0000
Received: from [85.158.139.211:55002] by server-4.bemta-5.messagelabs.com id
	56/7D-15011-EAAE8B05; Fri, 30 Nov 2012 17:19:42 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1354295980!18514164!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16087 invoked from network); 30 Nov 2012 17:19:42 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 17:19:42 -0000
X-IronPort-AV: E=Sophos;i="4.84,192,1355097600"; d="scan'208";a="216027148"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 17:19:40 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 12:19:39 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TeUFX-0005kr-Jt;
	Fri, 30 Nov 2012 17:19:39 +0000
MIME-Version: 1.0
X-Mercurial-Node: bc2a7645dc2be4a01f2b5ee30d7453cc3d7339aa
Message-ID: <bc2a7645dc2be4a01f2b.1354295635@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 30 Nov 2012 17:13:55 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH] libxl: Make an internal function explicitly
 check existence of expected paths
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354294821 0
# Node ID bc2a7645dc2be4a01f2b5ee30d7453cc3d7339aa
# Parent  bd041b7426fe10a730994edd98708ff98ae1cb74
libxl: Make an internal function explicitly check existence of expected paths

libxl__device_disk_from_xs_be() was failing without error for some
missing xenstore nodes in a backend, while assuming (without checking)
that other nodes were valid, causing a crash when another internal
error wrote these nodes in the wrong place.

Make this function consistent by:
* Checking the existence of all nodes before using
* Choosing a default only when the node is not written in device_disk_add()
* Failing with log msg if any node written by device_disk_add() is not present
* Returning an error on failure

Also make the callers of the function pay attention to the error and
behave appropriately.

v2:
 * Remove "Internal error", as the failure will most likely look internal
 * Use LOG(ERROR...) macros for incrased prettiness

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2168,9 +2168,9 @@ void libxl__device_disk_add(libxl__egc *
     device_disk_add(egc, domid, disk, aodev, NULL, NULL);
 }
 
-static void libxl__device_disk_from_xs_be(libxl__gc *gc,
-                                          const char *be_path,
-                                          libxl_device_disk *disk)
+static int libxl__device_disk_from_xs_be(libxl__gc *gc,
+                                         const char *be_path,
+                                         libxl_device_disk *disk)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     unsigned int len;
@@ -2178,6 +2178,7 @@ static void libxl__device_disk_from_xs_b
 
     libxl_device_disk_init(disk);
 
+    /* "params" may not be present; but everything else must be. */
     tmp = xs_read(ctx->xsh, XBT_NULL,
                   libxl__sprintf(gc, "%s/params", be_path), &len);
     if (tmp && strchr(tmp, ':')) {
@@ -2186,21 +2187,36 @@ static void libxl__device_disk_from_xs_b
     } else {
         disk->pdev_path = tmp;
     }
-    libxl_string_to_backend(ctx,
-                        libxl__xs_read(gc, XBT_NULL,
-                                       libxl__sprintf(gc, "%s/type", be_path)),
-                        &(disk->backend));
+
+    
+    tmp = libxl__xs_read(gc, XBT_NULL,
+                         libxl__sprintf(gc, "%s/type", be_path));
+    if (!tmp) {
+        LOG(ERROR, "Missing xenstore node %s/type", be_path);
+        return ERROR_FAIL;
+    }
+    libxl_string_to_backend(ctx, tmp, &(disk->backend));
+
     disk->vdev = xs_read(ctx->xsh, XBT_NULL,
                          libxl__sprintf(gc, "%s/dev", be_path), &len);
+    if (!disk->vdev) {
+        LOG(ERROR, "Missing xenstore node %s/dev", be_path);
+        return ERROR_FAIL;
+    }
+
     tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf
                          (gc, "%s/removable", be_path));
-
-    if (tmp)
-        disk->removable = atoi(tmp);
-    else
-        disk->removable = 0;
+    if (!tmp) {
+        LOG(ERROR, "Missing xenstore node %s/removable", be_path);
+        return ERROR_FAIL;
+    }
+    disk->removable = atoi(tmp);
 
     tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/mode", be_path));
+    if (!tmp) {
+        LOG(ERROR, "Missing xenstore node %s/mode", be_path);
+        return ERROR_FAIL;
+    }
     if (!strcmp(tmp, "w"))
         disk->readwrite = 1;
     else
@@ -2208,9 +2224,15 @@ static void libxl__device_disk_from_xs_b
 
     tmp = libxl__xs_read(gc, XBT_NULL,
                          libxl__sprintf(gc, "%s/device-type", be_path));
+    if (!tmp) {
+        LOG(ERROR, "Missing xenstore node %s/device-type", be_path);
+        return ERROR_FAIL;
+    }
     disk->is_cdrom = !strcmp(tmp, "cdrom");
 
     disk->format = LIBXL_DISK_FORMAT_UNKNOWN;
+
+    return 0;
 }
 
 int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid,
@@ -2236,9 +2258,7 @@ int libxl_vdev_to_device_disk(libxl_ctx 
     if (!path)
         goto out;
 
-    libxl__device_disk_from_xs_be(gc, path, disk);
-
-    rc = 0;
+    rc = libxl__device_disk_from_xs_be(gc, path, disk);
 out:
     GC_FREE;
     return rc;
@@ -2255,6 +2275,7 @@ static int libxl__append_disk_list_of_ty
     char **dir = NULL;
     unsigned int n = 0;
     libxl_device_disk *pdisk = NULL, *pdisk_end = NULL;
+    int rc=0;
 
     be_path = libxl__sprintf(gc, "%s/backend/%s/%d",
                              libxl__xs_get_dompath(gc, 0), type, domid);
@@ -2271,7 +2292,8 @@ static int libxl__append_disk_list_of_ty
         for (; pdisk < pdisk_end; pdisk++, dir++) {
             const char *p;
             p = libxl__sprintf(gc, "%s/%s", be_path, *dir);
-            libxl__device_disk_from_xs_be(gc, p, pdisk);
+            if ((rc=libxl__device_disk_from_xs_be(gc, p, pdisk)))
+                return rc;
             pdisk->backend_domid = 0;
         }
     }

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 17:20:21 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 17:20:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeUFd-0004GN-6q; Fri, 30 Nov 2012 17:19:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <George.Dunlap@eu.citrix.com>) id 1TeUFb-0004GI-NS
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 17:19:43 +0000
Received: from [85.158.139.211:55002] by server-4.bemta-5.messagelabs.com id
	56/7D-15011-EAAE8B05; Fri, 30 Nov 2012 17:19:42 +0000
X-Env-Sender: George.Dunlap@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1354295980!18514164!1
X-Originating-IP: [66.165.176.63]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAyODgxODU=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16087 invoked from network); 30 Nov 2012 17:19:42 -0000
Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63)
	by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 17:19:42 -0000
X-IronPort-AV: E=Sophos;i="4.84,192,1355097600"; d="scan'208";a="216027148"
Received: from ftlpmailmx01.citrite.net ([10.13.107.65])
	by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 17:19:40 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.65) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 12:19:39 -0500
Received: from elijah.uk.xensource.com ([10.80.2.24] helo=[127.0.1.1])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<george.dunlap@eu.citrix.com>)	id 1TeUFX-0005kr-Jt;
	Fri, 30 Nov 2012 17:19:39 +0000
MIME-Version: 1.0
X-Mercurial-Node: bc2a7645dc2be4a01f2b5ee30d7453cc3d7339aa
Message-ID: <bc2a7645dc2be4a01f2b.1354295635@elijah>
User-Agent: Mercurial-patchbomb/2.0.2
Date: Fri, 30 Nov 2012 17:13:55 +0000
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [Xen-devel] [PATCH] libxl: Make an internal function explicitly
 check existence of expected paths
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354294821 0
# Node ID bc2a7645dc2be4a01f2b5ee30d7453cc3d7339aa
# Parent  bd041b7426fe10a730994edd98708ff98ae1cb74
libxl: Make an internal function explicitly check existence of expected paths

libxl__device_disk_from_xs_be() was failing without error for some
missing xenstore nodes in a backend, while assuming (without checking)
that other nodes were valid, causing a crash when another internal
error wrote these nodes in the wrong place.

Make this function consistent by:
* Checking the existence of all nodes before using
* Choosing a default only when the node is not written in device_disk_add()
* Failing with log msg if any node written by device_disk_add() is not present
* Returning an error on failure

Also make the callers of the function pay attention to the error and
behave appropriately.

v2:
 * Remove "Internal error", as the failure will most likely look internal
 * Use LOG(ERROR...) macros for incrased prettiness

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2168,9 +2168,9 @@ void libxl__device_disk_add(libxl__egc *
     device_disk_add(egc, domid, disk, aodev, NULL, NULL);
 }
 
-static void libxl__device_disk_from_xs_be(libxl__gc *gc,
-                                          const char *be_path,
-                                          libxl_device_disk *disk)
+static int libxl__device_disk_from_xs_be(libxl__gc *gc,
+                                         const char *be_path,
+                                         libxl_device_disk *disk)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     unsigned int len;
@@ -2178,6 +2178,7 @@ static void libxl__device_disk_from_xs_b
 
     libxl_device_disk_init(disk);
 
+    /* "params" may not be present; but everything else must be. */
     tmp = xs_read(ctx->xsh, XBT_NULL,
                   libxl__sprintf(gc, "%s/params", be_path), &len);
     if (tmp && strchr(tmp, ':')) {
@@ -2186,21 +2187,36 @@ static void libxl__device_disk_from_xs_b
     } else {
         disk->pdev_path = tmp;
     }
-    libxl_string_to_backend(ctx,
-                        libxl__xs_read(gc, XBT_NULL,
-                                       libxl__sprintf(gc, "%s/type", be_path)),
-                        &(disk->backend));
+
+    
+    tmp = libxl__xs_read(gc, XBT_NULL,
+                         libxl__sprintf(gc, "%s/type", be_path));
+    if (!tmp) {
+        LOG(ERROR, "Missing xenstore node %s/type", be_path);
+        return ERROR_FAIL;
+    }
+    libxl_string_to_backend(ctx, tmp, &(disk->backend));
+
     disk->vdev = xs_read(ctx->xsh, XBT_NULL,
                          libxl__sprintf(gc, "%s/dev", be_path), &len);
+    if (!disk->vdev) {
+        LOG(ERROR, "Missing xenstore node %s/dev", be_path);
+        return ERROR_FAIL;
+    }
+
     tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf
                          (gc, "%s/removable", be_path));
-
-    if (tmp)
-        disk->removable = atoi(tmp);
-    else
-        disk->removable = 0;
+    if (!tmp) {
+        LOG(ERROR, "Missing xenstore node %s/removable", be_path);
+        return ERROR_FAIL;
+    }
+    disk->removable = atoi(tmp);
 
     tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/mode", be_path));
+    if (!tmp) {
+        LOG(ERROR, "Missing xenstore node %s/mode", be_path);
+        return ERROR_FAIL;
+    }
     if (!strcmp(tmp, "w"))
         disk->readwrite = 1;
     else
@@ -2208,9 +2224,15 @@ static void libxl__device_disk_from_xs_b
 
     tmp = libxl__xs_read(gc, XBT_NULL,
                          libxl__sprintf(gc, "%s/device-type", be_path));
+    if (!tmp) {
+        LOG(ERROR, "Missing xenstore node %s/device-type", be_path);
+        return ERROR_FAIL;
+    }
     disk->is_cdrom = !strcmp(tmp, "cdrom");
 
     disk->format = LIBXL_DISK_FORMAT_UNKNOWN;
+
+    return 0;
 }
 
 int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid,
@@ -2236,9 +2258,7 @@ int libxl_vdev_to_device_disk(libxl_ctx 
     if (!path)
         goto out;
 
-    libxl__device_disk_from_xs_be(gc, path, disk);
-
-    rc = 0;
+    rc = libxl__device_disk_from_xs_be(gc, path, disk);
 out:
     GC_FREE;
     return rc;
@@ -2255,6 +2275,7 @@ static int libxl__append_disk_list_of_ty
     char **dir = NULL;
     unsigned int n = 0;
     libxl_device_disk *pdisk = NULL, *pdisk_end = NULL;
+    int rc=0;
 
     be_path = libxl__sprintf(gc, "%s/backend/%s/%d",
                              libxl__xs_get_dompath(gc, 0), type, domid);
@@ -2271,7 +2292,8 @@ static int libxl__append_disk_list_of_ty
         for (; pdisk < pdisk_end; pdisk++, dir++) {
             const char *p;
             p = libxl__sprintf(gc, "%s/%s", be_path, *dir);
-            libxl__device_disk_from_xs_be(gc, p, pdisk);
+            if ((rc=libxl__device_disk_from_xs_be(gc, p, pdisk)))
+                return rc;
             pdisk->backend_domid = 0;
         }
     }

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 17:33:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 17:33:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeUSG-0005Dj-CG; Fri, 30 Nov 2012 17:32:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeUSE-0005DF-0V
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 17:32:46 +0000
Received: from [193.109.254.147:38254] by server-14.bemta-14.messagelabs.com
	id 8A/C8-14517-DBDE8B05; Fri, 30 Nov 2012 17:32:45 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1354296754!8942690!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2748 invoked from network); 30 Nov 2012 17:32:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 17:32:35 -0000
X-IronPort-AV: E=Sophos;i="4.84,192,1355097600"; d="scan'208";a="16097671"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 17:32:12 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 17:32:12 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeURg-0007UX-EB;
	Fri, 30 Nov 2012 17:32:12 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeURg-0006uQ-B8;
	Fri, 30 Nov 2012 17:32:12 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14518-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 17:32:12 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14518: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14518 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14518/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-amd64                   4 xen-build                 fail REGR. vs. 14482
 build-amd64-oldkern           4 xen-build                 fail REGR. vs. 14482
 build-i386                    4 xen-build                 fail REGR. vs. 14482
 build-i386-oldkern            4 xen-build                 fail REGR. vs. 14482

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-qemut-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win7-amd64  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1  1 xen-build-check(1)     blocked n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win-vcpus1  1 xen-build-check(1)          blocked n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-qemut-winxpsp3  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-qemut-win     1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-qemut-win    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-winxpsp3  1 xen-build-check(1)           blocked n/a

version targeted for testing:
 xen                  8037099671f3
baseline version:
 xen                  1c69c938f641

------------------------------------------------------------
People who touched revisions under test:
  Acked-by: Tim Deegan <tim@xen.org>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Dongxiao Xu <dongxiao.xu@intel.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jun Nakajima <jun.nakajima@intel.com>
  Keir Fraser <keir@xen.org>
  Kouya Shimura <kouya@jp.fujitsu.com>
  Roger Pau Monn? <roger.pau@citrix.com>
  Samuel Thibault <samuel.thibault@ens-lyon.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
  Wei Liu <wei.liu2@citrix.com>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  fail    
 build-i386                                                   fail    
 build-amd64-oldkern                                          fail    
 build-i386-oldkern                                           fail    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemut-rhel6hvm-amd                           blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemut-win7-amd64                         blocked 
 test-amd64-i386-xl-qemut-win7-amd64                          blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemut-rhel6hvm-intel                         blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-qemut-win-vcpus1                             blocked 
 test-amd64-i386-xl-qemut-win-vcpus1                          blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-qemut-win                                   blocked 
 test-amd64-i386-qemut-win                                    blocked 
 test-amd64-amd64-xl-qemut-win                                blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-i386-xend-qemut-winxpsp3                          blocked 
 test-amd64-amd64-xl-qemut-winxpsp3                           blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 415 lines long.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 17:33:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 17:33:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeUSG-0005Dj-CG; Fri, 30 Nov 2012 17:32:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeUSE-0005DF-0V
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 17:32:46 +0000
Received: from [193.109.254.147:38254] by server-14.bemta-14.messagelabs.com
	id 8A/C8-14517-DBDE8B05; Fri, 30 Nov 2012 17:32:45 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1354296754!8942690!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2748 invoked from network); 30 Nov 2012 17:32:35 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 17:32:35 -0000
X-IronPort-AV: E=Sophos;i="4.84,192,1355097600"; d="scan'208";a="16097671"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 17:32:12 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 17:32:12 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeURg-0007UX-EB;
	Fri, 30 Nov 2012 17:32:12 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeURg-0006uQ-B8;
	Fri, 30 Nov 2012 17:32:12 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14518-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 17:32:12 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14518: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14518 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14518/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-amd64                   4 xen-build                 fail REGR. vs. 14482
 build-amd64-oldkern           4 xen-build                 fail REGR. vs. 14482
 build-i386                    4 xen-build                 fail REGR. vs. 14482
 build-i386-oldkern            4 xen-build                 fail REGR. vs. 14482

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-qemut-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win7-amd64  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1  1 xen-build-check(1)     blocked n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win-vcpus1  1 xen-build-check(1)          blocked n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-qemut-winxpsp3  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-qemut-win     1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-qemut-win    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-winxpsp3  1 xen-build-check(1)           blocked n/a

version targeted for testing:
 xen                  8037099671f3
baseline version:
 xen                  1c69c938f641

------------------------------------------------------------
People who touched revisions under test:
  Acked-by: Tim Deegan <tim@xen.org>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Dongxiao Xu <dongxiao.xu@intel.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jun Nakajima <jun.nakajima@intel.com>
  Keir Fraser <keir@xen.org>
  Kouya Shimura <kouya@jp.fujitsu.com>
  Roger Pau Monn? <roger.pau@citrix.com>
  Samuel Thibault <samuel.thibault@ens-lyon.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
  Wei Liu <wei.liu2@citrix.com>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  fail    
 build-i386                                                   fail    
 build-amd64-oldkern                                          fail    
 build-i386-oldkern                                           fail    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemut-rhel6hvm-amd                           blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemut-win7-amd64                         blocked 
 test-amd64-i386-xl-qemut-win7-amd64                          blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemut-rhel6hvm-intel                         blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-qemut-win-vcpus1                             blocked 
 test-amd64-i386-xl-qemut-win-vcpus1                          blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-qemut-win                                   blocked 
 test-amd64-i386-qemut-win                                    blocked 
 test-amd64-amd64-xl-qemut-win                                blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-i386-xend-qemut-winxpsp3                          blocked 
 test-amd64-amd64-xl-qemut-winxpsp3                           blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 415 lines long.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 17:35:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 17:35:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeUUM-0005MJ-Ul; Fri, 30 Nov 2012 17:34:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TeUUL-0005MB-GE
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 17:34:57 +0000
Received: from [85.158.139.211:20412] by server-15.bemta-5.messagelabs.com id
	10/F7-26920-04EE8B05; Fri, 30 Nov 2012 17:34:56 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354296894!14336759!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4137 invoked from network); 30 Nov 2012 17:34:55 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 17:34:55 -0000
X-IronPort-AV: E=Sophos;i="4.84,192,1355097600"; d="scan'208";a="46193670"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 17:34:12 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 12:34:12 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TeUTb-0005yv-Sr;
	Fri, 30 Nov 2012 17:34:11 +0000
Message-ID: <50B8EE13.6070301@citrix.com>
Date: Fri, 30 Nov 2012 17:34:11 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, Tim Deegan
	<tim@xen.org>, Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>
X-Enigmail-Version: 1.4.6
Subject: [Xen-devel] Woes of NMIs and MCEs, and possibly how to fix
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

Yesterday, Tim and myself spent a very long time in front of a
whiteboard trying to develop a fix which covered all the problems, and
sadly it is very hard.  We managed to possibly come up with a long
solution which we think has no race conditions, but relies on very large
sections of reentrant code which cant use the stack or trash registers. 
As such, is it is not practical at all (assuming that any of us could
actually code it)


As a result, I thought instead that I would outline all the issues we
currently face.  We can then:
 * Decide which issues need fixing
 * Decide which issues need to at least be detected and crash gracefully
 * Decide which issues we are happy (or perhaps at least willing, if not
happy) to ignore

So, the issues are as follows.  (I have tried to list them in a logical
order, with 1 individual problem per number, but please do point out if
I have missed/miss-attributed entries)

1) Faults on the NMI path will re-enable NMIs before the handler
returns, leading to reentrant behaviour.  We should audit the NMI path
to try and remove any needless cases which might fault, but getting a
fault-free path will be hard (and is not going so solve the reentrant
behaviour itself).

2) Faults on the MCE path will re-enable NMIs, as will the iret of the
MCE itself if an MCE interrupts an NMI.

3) SMM mode executing an iret will re-enable NMIs.  There is nothing we
can do to prevent this, and as an SMI can interrupt NMIs and MCEs, no
way to predict if/when it may happen.  The best we can do is accept that
it might happen, and try to deal with the after effects.

4) "Fake NMIs" can be caused by hardware with access to the INTR pin
(very unlikely in modern systems with the LAPIC supporting virtual wire
mode), or by software executing an `int $0x2`.  This can cause the NMI
handler to run on the NMI stack, but without the normal hardware NMI
cessation logic being triggered.

5) "Fake MCEs" can be caused by software executing `int $0x18`, and by
any MSI/IOMMU/IOAPIC programmed to deliver vector 0x18.  Normally, this
could only be caused by a bug in Xen, although it is also possible on a
system with out interrupt remapping. (Where the host administrator has
accepted the documented security issue, and decided still to pass-though
a device to a trusted VM, and the VM in question has a buggy driver for
the passed-through hardware)

6) Because of interrupt stack tables, real NMIs/MCEs can race with their
fake alternatives, where the real interrupt interrupts the fake one and
corrupts the exception frame of the fake one, loosing the original
context to return to.  (This is one of the two core problem of
reentrancy with NMIs and MCEs)

7) Real MCEs can race with each other.  If two real MCEs occur too close
together, the processor shuts down (We cant avoid this).  However, there
is large race condition between the MCE handler clearing the MCIP bit of
IA32_MCG_STATUS and the handler returning during which a new MCE can
occur and the exception frame will be corrupted.


In addition to the above issues, we have two NMI related bugs in Xen
which need fixing (which shall be part of the series which fixes the above)

8) VMEXIT reason NMI on Intel calls self_nmi() while NMIs are latched,
causing the PCPU to fall into loop of VMEXITs until the VCPU timeslice
has expired, at which point the return-to-guest path decides to schedule
instead of resuming the guest.

9) The NMI handler when returning to ring3 will leave NMIs latched, as
it uses the sysret path.


As for 1 possible solution which we cant use:

If it were not for the sysret stupidness[1] of requiring the hypervisor
to move to the guest stack before executing the `sysret` instruction, we
could do away with the stack tables for NMIs and MCEs alltogether, and
the above crazyness would be easy to fix.  However, the overhead of
always using iret to return to ring3 is not likely to be acceptable,
meaning that we cannot "fix" the problem by discarding interrupt stacks
and doing everything properly on the main hypervisor stack.


Looking at the above problems, I believe there is a solution if we are
willing to ignore the problem to do with SMM re-enabling NMIs, and if we
are happy to crash gracefully when mixes of NMIs and MCEs interrupt each
other and trash their exception frames (in situations were we could
technically fix up correctly), which is based on the Linux NMI solution.

As questions to the community - have I missed, or misrepresented any
points above which might perhaps influence the design of the solution? 
I think the list is complete, but would not be supprised if there is a
case still not considered yet.

~Andrew


[1] In an effort to prevent a flamewar with my comment, the situation we
find outself in now is almost certainly the result of unforseen
interactions of individual features, but we are left to pick up the many
pieces in way which cant completely be solved.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 17:35:14 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 17:35:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeUUM-0005MJ-Ul; Fri, 30 Nov 2012 17:34:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TeUUL-0005MB-GE
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 17:34:57 +0000
Received: from [85.158.139.211:20412] by server-15.bemta-5.messagelabs.com id
	10/F7-26920-04EE8B05; Fri, 30 Nov 2012 17:34:56 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354296894!14336759!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4137 invoked from network); 30 Nov 2012 17:34:55 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 17:34:55 -0000
X-IronPort-AV: E=Sophos;i="4.84,192,1355097600"; d="scan'208";a="46193670"
Received: from ftlpmailmx02.citrite.net ([10.13.107.66])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 17:34:12 +0000
Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com
	(10.13.107.66) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 12:34:12 -0500
Received: from andrewcoop.uk.xensource.com ([10.80.2.18])	by
	ukmail1.uk.xensource.com with esmtp (Exim 4.69)	(envelope-from
	<andrew.cooper3@citrix.com>)	id 1TeUTb-0005yv-Sr;
	Fri, 30 Nov 2012 17:34:11 +0000
Message-ID: <50B8EE13.6070301@citrix.com>
Date: Fri, 30 Nov 2012 17:34:11 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, Tim Deegan
	<tim@xen.org>, Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>
X-Enigmail-Version: 1.4.6
Subject: [Xen-devel] Woes of NMIs and MCEs, and possibly how to fix
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hello,

Yesterday, Tim and myself spent a very long time in front of a
whiteboard trying to develop a fix which covered all the problems, and
sadly it is very hard.  We managed to possibly come up with a long
solution which we think has no race conditions, but relies on very large
sections of reentrant code which cant use the stack or trash registers. 
As such, is it is not practical at all (assuming that any of us could
actually code it)


As a result, I thought instead that I would outline all the issues we
currently face.  We can then:
 * Decide which issues need fixing
 * Decide which issues need to at least be detected and crash gracefully
 * Decide which issues we are happy (or perhaps at least willing, if not
happy) to ignore

So, the issues are as follows.  (I have tried to list them in a logical
order, with 1 individual problem per number, but please do point out if
I have missed/miss-attributed entries)

1) Faults on the NMI path will re-enable NMIs before the handler
returns, leading to reentrant behaviour.  We should audit the NMI path
to try and remove any needless cases which might fault, but getting a
fault-free path will be hard (and is not going so solve the reentrant
behaviour itself).

2) Faults on the MCE path will re-enable NMIs, as will the iret of the
MCE itself if an MCE interrupts an NMI.

3) SMM mode executing an iret will re-enable NMIs.  There is nothing we
can do to prevent this, and as an SMI can interrupt NMIs and MCEs, no
way to predict if/when it may happen.  The best we can do is accept that
it might happen, and try to deal with the after effects.

4) "Fake NMIs" can be caused by hardware with access to the INTR pin
(very unlikely in modern systems with the LAPIC supporting virtual wire
mode), or by software executing an `int $0x2`.  This can cause the NMI
handler to run on the NMI stack, but without the normal hardware NMI
cessation logic being triggered.

5) "Fake MCEs" can be caused by software executing `int $0x18`, and by
any MSI/IOMMU/IOAPIC programmed to deliver vector 0x18.  Normally, this
could only be caused by a bug in Xen, although it is also possible on a
system with out interrupt remapping. (Where the host administrator has
accepted the documented security issue, and decided still to pass-though
a device to a trusted VM, and the VM in question has a buggy driver for
the passed-through hardware)

6) Because of interrupt stack tables, real NMIs/MCEs can race with their
fake alternatives, where the real interrupt interrupts the fake one and
corrupts the exception frame of the fake one, loosing the original
context to return to.  (This is one of the two core problem of
reentrancy with NMIs and MCEs)

7) Real MCEs can race with each other.  If two real MCEs occur too close
together, the processor shuts down (We cant avoid this).  However, there
is large race condition between the MCE handler clearing the MCIP bit of
IA32_MCG_STATUS and the handler returning during which a new MCE can
occur and the exception frame will be corrupted.


In addition to the above issues, we have two NMI related bugs in Xen
which need fixing (which shall be part of the series which fixes the above)

8) VMEXIT reason NMI on Intel calls self_nmi() while NMIs are latched,
causing the PCPU to fall into loop of VMEXITs until the VCPU timeslice
has expired, at which point the return-to-guest path decides to schedule
instead of resuming the guest.

9) The NMI handler when returning to ring3 will leave NMIs latched, as
it uses the sysret path.


As for 1 possible solution which we cant use:

If it were not for the sysret stupidness[1] of requiring the hypervisor
to move to the guest stack before executing the `sysret` instruction, we
could do away with the stack tables for NMIs and MCEs alltogether, and
the above crazyness would be easy to fix.  However, the overhead of
always using iret to return to ring3 is not likely to be acceptable,
meaning that we cannot "fix" the problem by discarding interrupt stacks
and doing everything properly on the main hypervisor stack.


Looking at the above problems, I believe there is a solution if we are
willing to ignore the problem to do with SMM re-enabling NMIs, and if we
are happy to crash gracefully when mixes of NMIs and MCEs interrupt each
other and trash their exception frames (in situations were we could
technically fix up correctly), which is based on the Linux NMI solution.

As questions to the community - have I missed, or misrepresented any
points above which might perhaps influence the design of the solution? 
I think the list is complete, but would not be supprised if there is a
case still not considered yet.

~Andrew


[1] In an effort to prevent a flamewar with my comment, the situation we
find outself in now is almost certainly the result of unforseen
interactions of individual features, but we are left to pick up the many
pieces in way which cant completely be solved.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 17:57:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 17:57:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeUpm-0006Kw-B6; Fri, 30 Nov 2012 17:57:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TeUpl-0006Kr-0v
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 17:57:05 +0000
Received: from [85.158.143.35:38604] by server-3.bemta-4.messagelabs.com id
	33/AE-06841-073F8B05; Fri, 30 Nov 2012 17:57:04 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1354298168!13153967!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1384 invoked from network); 30 Nov 2012 17:56:11 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-3.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 17:56:11 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TeUom-000085-Mw; Fri, 30 Nov 2012 17:56:04 +0000
Date: Fri, 30 Nov 2012 17:56:04 +0000
From: Tim Deegan <tim@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121130175604.GB95877@ocelot.phlegethon.org>
References: <50B8EE13.6070301@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B8EE13.6070301@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Woes of NMIs and MCEs, and possibly how to fix
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 17:34 +0000 on 30 Nov (1354296851), Andrew Cooper wrote:
> Hello,
> 
> Yesterday, Tim and myself spent a very long time in front of a
> whiteboard trying to develop a fix which covered all the problems, and
> sadly it is very hard.  We managed to possibly come up with a long
> solution which we think has no race conditions, but relies on very large
> sections of reentrant code which cant use the stack or trash registers. 
> As such, is it is not practical at all (assuming that any of us could
> actually code it)

For the record, we also came up with a much simpler solution, which I
prefer:
 - The MCE handler should never return to Xen with IRET.
 - The NMI handler should always return with IRET.
 - There should be no faulting code in the NMI or MCE handlers.

That covers all the interesting cases except (3), (4) and (7) below, and
a simple per-cpu {nmi,mce}-in-progress flag will be enough to detect
(and crash) on _almost_ all cases where that bites us (the other cases
will crash less politely from their stacks being smashed).

Even if we go on to build some more bulletproof solution, I think we
should consider implementing that now, as the baseline.

Tim.

> As a result, I thought instead that I would outline all the issues we
> currently face.  We can then:
>  * Decide which issues need fixing
>  * Decide which issues need to at least be detected and crash gracefully
>  * Decide which issues we are happy (or perhaps at least willing, if not
> happy) to ignore
> 
> So, the issues are as follows.  (I have tried to list them in a logical
> order, with 1 individual problem per number, but please do point out if
> I have missed/miss-attributed entries)
> 
> 1) Faults on the NMI path will re-enable NMIs before the handler
> returns, leading to reentrant behaviour.  We should audit the NMI path
> to try and remove any needless cases which might fault, but getting a
> fault-free path will be hard (and is not going so solve the reentrant
> behaviour itself).
> 
> 2) Faults on the MCE path will re-enable NMIs, as will the iret of the
> MCE itself if an MCE interrupts an NMI.
> 
> 3) SMM mode executing an iret will re-enable NMIs.  There is nothing we
> can do to prevent this, and as an SMI can interrupt NMIs and MCEs, no
> way to predict if/when it may happen.  The best we can do is accept that
> it might happen, and try to deal with the after effects.
> 
> 4) "Fake NMIs" can be caused by hardware with access to the INTR pin
> (very unlikely in modern systems with the LAPIC supporting virtual wire
> mode), or by software executing an `int $0x2`.  This can cause the NMI
> handler to run on the NMI stack, but without the normal hardware NMI
> cessation logic being triggered.
> 
> 5) "Fake MCEs" can be caused by software executing `int $0x18`, and by
> any MSI/IOMMU/IOAPIC programmed to deliver vector 0x18.  Normally, this
> could only be caused by a bug in Xen, although it is also possible on a
> system with out interrupt remapping. (Where the host administrator has
> accepted the documented security issue, and decided still to pass-though
> a device to a trusted VM, and the VM in question has a buggy driver for
> the passed-through hardware)
> 
> 6) Because of interrupt stack tables, real NMIs/MCEs can race with their
> fake alternatives, where the real interrupt interrupts the fake one and
> corrupts the exception frame of the fake one, loosing the original
> context to return to.  (This is one of the two core problem of
> reentrancy with NMIs and MCEs)
> 
> 7) Real MCEs can race with each other.  If two real MCEs occur too close
> together, the processor shuts down (We cant avoid this).  However, there
> is large race condition between the MCE handler clearing the MCIP bit of
> IA32_MCG_STATUS and the handler returning during which a new MCE can
> occur and the exception frame will be corrupted.
> 
> 
> In addition to the above issues, we have two NMI related bugs in Xen
> which need fixing (which shall be part of the series which fixes the above)
> 
> 8) VMEXIT reason NMI on Intel calls self_nmi() while NMIs are latched,
> causing the PCPU to fall into loop of VMEXITs until the VCPU timeslice
> has expired, at which point the return-to-guest path decides to schedule
> instead of resuming the guest.
> 
> 9) The NMI handler when returning to ring3 will leave NMIs latched, as
> it uses the sysret path.
> 
> 
> As for 1 possible solution which we cant use:
> 
> If it were not for the sysret stupidness[1] of requiring the hypervisor
> to move to the guest stack before executing the `sysret` instruction, we
> could do away with the stack tables for NMIs and MCEs alltogether, and
> the above crazyness would be easy to fix.  However, the overhead of
> always using iret to return to ring3 is not likely to be acceptable,
> meaning that we cannot "fix" the problem by discarding interrupt stacks
> and doing everything properly on the main hypervisor stack.
> 
> 
> Looking at the above problems, I believe there is a solution if we are
> willing to ignore the problem to do with SMM re-enabling NMIs, and if we
> are happy to crash gracefully when mixes of NMIs and MCEs interrupt each
> other and trash their exception frames (in situations were we could
> technically fix up correctly), which is based on the Linux NMI solution.
> 
> As questions to the community - have I missed, or misrepresented any
> points above which might perhaps influence the design of the solution? 
> I think the list is complete, but would not be supprised if there is a
> case still not considered yet.
> 
> ~Andrew
> 
> 
> [1] In an effort to prevent a flamewar with my comment, the situation we
> find outself in now is almost certainly the result of unforseen
> interactions of individual features, but we are left to pick up the many
> pieces in way which cant completely be solved.
> 
> -- 
> Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
> T: +44 (0)1223 225 900, http://www.citrix.com
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 17:57:25 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 17:57:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeUpm-0006Kw-B6; Fri, 30 Nov 2012 17:57:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TeUpl-0006Kr-0v
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 17:57:05 +0000
Received: from [85.158.143.35:38604] by server-3.bemta-4.messagelabs.com id
	33/AE-06841-073F8B05; Fri, 30 Nov 2012 17:57:04 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1354298168!13153967!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1384 invoked from network); 30 Nov 2012 17:56:11 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-3.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 17:56:11 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TeUom-000085-Mw; Fri, 30 Nov 2012 17:56:04 +0000
Date: Fri, 30 Nov 2012 17:56:04 +0000
From: Tim Deegan <tim@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <20121130175604.GB95877@ocelot.phlegethon.org>
References: <50B8EE13.6070301@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B8EE13.6070301@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Woes of NMIs and MCEs, and possibly how to fix
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 17:34 +0000 on 30 Nov (1354296851), Andrew Cooper wrote:
> Hello,
> 
> Yesterday, Tim and myself spent a very long time in front of a
> whiteboard trying to develop a fix which covered all the problems, and
> sadly it is very hard.  We managed to possibly come up with a long
> solution which we think has no race conditions, but relies on very large
> sections of reentrant code which cant use the stack or trash registers. 
> As such, is it is not practical at all (assuming that any of us could
> actually code it)

For the record, we also came up with a much simpler solution, which I
prefer:
 - The MCE handler should never return to Xen with IRET.
 - The NMI handler should always return with IRET.
 - There should be no faulting code in the NMI or MCE handlers.

That covers all the interesting cases except (3), (4) and (7) below, and
a simple per-cpu {nmi,mce}-in-progress flag will be enough to detect
(and crash) on _almost_ all cases where that bites us (the other cases
will crash less politely from their stacks being smashed).

Even if we go on to build some more bulletproof solution, I think we
should consider implementing that now, as the baseline.

Tim.

> As a result, I thought instead that I would outline all the issues we
> currently face.  We can then:
>  * Decide which issues need fixing
>  * Decide which issues need to at least be detected and crash gracefully
>  * Decide which issues we are happy (or perhaps at least willing, if not
> happy) to ignore
> 
> So, the issues are as follows.  (I have tried to list them in a logical
> order, with 1 individual problem per number, but please do point out if
> I have missed/miss-attributed entries)
> 
> 1) Faults on the NMI path will re-enable NMIs before the handler
> returns, leading to reentrant behaviour.  We should audit the NMI path
> to try and remove any needless cases which might fault, but getting a
> fault-free path will be hard (and is not going so solve the reentrant
> behaviour itself).
> 
> 2) Faults on the MCE path will re-enable NMIs, as will the iret of the
> MCE itself if an MCE interrupts an NMI.
> 
> 3) SMM mode executing an iret will re-enable NMIs.  There is nothing we
> can do to prevent this, and as an SMI can interrupt NMIs and MCEs, no
> way to predict if/when it may happen.  The best we can do is accept that
> it might happen, and try to deal with the after effects.
> 
> 4) "Fake NMIs" can be caused by hardware with access to the INTR pin
> (very unlikely in modern systems with the LAPIC supporting virtual wire
> mode), or by software executing an `int $0x2`.  This can cause the NMI
> handler to run on the NMI stack, but without the normal hardware NMI
> cessation logic being triggered.
> 
> 5) "Fake MCEs" can be caused by software executing `int $0x18`, and by
> any MSI/IOMMU/IOAPIC programmed to deliver vector 0x18.  Normally, this
> could only be caused by a bug in Xen, although it is also possible on a
> system with out interrupt remapping. (Where the host administrator has
> accepted the documented security issue, and decided still to pass-though
> a device to a trusted VM, and the VM in question has a buggy driver for
> the passed-through hardware)
> 
> 6) Because of interrupt stack tables, real NMIs/MCEs can race with their
> fake alternatives, where the real interrupt interrupts the fake one and
> corrupts the exception frame of the fake one, loosing the original
> context to return to.  (This is one of the two core problem of
> reentrancy with NMIs and MCEs)
> 
> 7) Real MCEs can race with each other.  If two real MCEs occur too close
> together, the processor shuts down (We cant avoid this).  However, there
> is large race condition between the MCE handler clearing the MCIP bit of
> IA32_MCG_STATUS and the handler returning during which a new MCE can
> occur and the exception frame will be corrupted.
> 
> 
> In addition to the above issues, we have two NMI related bugs in Xen
> which need fixing (which shall be part of the series which fixes the above)
> 
> 8) VMEXIT reason NMI on Intel calls self_nmi() while NMIs are latched,
> causing the PCPU to fall into loop of VMEXITs until the VCPU timeslice
> has expired, at which point the return-to-guest path decides to schedule
> instead of resuming the guest.
> 
> 9) The NMI handler when returning to ring3 will leave NMIs latched, as
> it uses the sysret path.
> 
> 
> As for 1 possible solution which we cant use:
> 
> If it were not for the sysret stupidness[1] of requiring the hypervisor
> to move to the guest stack before executing the `sysret` instruction, we
> could do away with the stack tables for NMIs and MCEs alltogether, and
> the above crazyness would be easy to fix.  However, the overhead of
> always using iret to return to ring3 is not likely to be acceptable,
> meaning that we cannot "fix" the problem by discarding interrupt stacks
> and doing everything properly on the main hypervisor stack.
> 
> 
> Looking at the above problems, I believe there is a solution if we are
> willing to ignore the problem to do with SMM re-enabling NMIs, and if we
> are happy to crash gracefully when mixes of NMIs and MCEs interrupt each
> other and trash their exception frames (in situations were we could
> technically fix up correctly), which is based on the Linux NMI solution.
> 
> As questions to the community - have I missed, or misrepresented any
> points above which might perhaps influence the design of the solution? 
> I think the list is complete, but would not be supprised if there is a
> case still not considered yet.
> 
> ~Andrew
> 
> 
> [1] In an effort to prevent a flamewar with my comment, the situation we
> find outself in now is almost certainly the result of unforseen
> interactions of individual features, but we are left to pick up the many
> pieces in way which cant completely be solved.
> 
> -- 
> Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
> T: +44 (0)1223 225 900, http://www.citrix.com
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 18:12:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 18:12:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeV47-0007Hu-F1; Fri, 30 Nov 2012 18:11:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeV46-0007Hn-KB
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 18:11:54 +0000
Received: from [85.158.143.35:31419] by server-1.bemta-4.messagelabs.com id
	88/54-27934-9E6F8B05; Fri, 30 Nov 2012 18:11:53 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354299112!12418085!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2207 invoked from network); 30 Nov 2012 18:11:52 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 18:11:52 -0000
X-IronPort-AV: E=Sophos;i="4.84,192,1355097600"; d="scan'208";a="16098143"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 18:11:48 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 18:11:48 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeV40-0007hy-H9;
	Fri, 30 Nov 2012 18:11:48 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeV40-0004Me-GP;
	Fri, 30 Nov 2012 18:11:48 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14519-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 18:11:48 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14519: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14519 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14519/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-amd64                   4 xen-build                 fail REGR. vs. 14482
 build-amd64-oldkern           4 xen-build                 fail REGR. vs. 14482
 build-i386                    4 xen-build                 fail REGR. vs. 14482
 build-i386-oldkern            4 xen-build                 fail REGR. vs. 14482

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-qemut-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win7-amd64  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1  1 xen-build-check(1)     blocked n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win-vcpus1  1 xen-build-check(1)          blocked n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-qemut-winxpsp3  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-qemut-win     1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-qemut-win    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-winxpsp3  1 xen-build-check(1)           blocked n/a

version targeted for testing:
 xen                  8037099671f3
baseline version:
 xen                  1c69c938f641

------------------------------------------------------------
People who touched revisions under test:
  Acked-by: Tim Deegan <tim@xen.org>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Dongxiao Xu <dongxiao.xu@intel.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jun Nakajima <jun.nakajima@intel.com>
  Keir Fraser <keir@xen.org>
  Kouya Shimura <kouya@jp.fujitsu.com>
  Roger Pau Monn? <roger.pau@citrix.com>
  Samuel Thibault <samuel.thibault@ens-lyon.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
  Wei Liu <wei.liu2@citrix.com>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  fail    
 build-i386                                                   fail    
 build-amd64-oldkern                                          fail    
 build-i386-oldkern                                           fail    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemut-rhel6hvm-amd                           blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemut-win7-amd64                         blocked 
 test-amd64-i386-xl-qemut-win7-amd64                          blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemut-rhel6hvm-intel                         blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-qemut-win-vcpus1                             blocked 
 test-amd64-i386-xl-qemut-win-vcpus1                          blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-qemut-win                                   blocked 
 test-amd64-i386-qemut-win                                    blocked 
 test-amd64-amd64-xl-qemut-win                                blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-i386-xend-qemut-winxpsp3                          blocked 
 test-amd64-amd64-xl-qemut-winxpsp3                           blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 415 lines long.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 18:12:11 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 18:12:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeV47-0007Hu-F1; Fri, 30 Nov 2012 18:11:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeV46-0007Hn-KB
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 18:11:54 +0000
Received: from [85.158.143.35:31419] by server-1.bemta-4.messagelabs.com id
	88/54-27934-9E6F8B05; Fri, 30 Nov 2012 18:11:53 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354299112!12418085!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2207 invoked from network); 30 Nov 2012 18:11:52 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 18:11:52 -0000
X-IronPort-AV: E=Sophos;i="4.84,192,1355097600"; d="scan'208";a="16098143"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 18:11:48 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 18:11:48 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeV40-0007hy-H9;
	Fri, 30 Nov 2012 18:11:48 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeV40-0004Me-GP;
	Fri, 30 Nov 2012 18:11:48 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14519-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 18:11:48 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14519: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14519 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14519/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-amd64                   4 xen-build                 fail REGR. vs. 14482
 build-amd64-oldkern           4 xen-build                 fail REGR. vs. 14482
 build-i386                    4 xen-build                 fail REGR. vs. 14482
 build-i386-oldkern            4 xen-build                 fail REGR. vs. 14482

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-qemut-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win7-amd64  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1  1 xen-build-check(1)     blocked n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win-vcpus1  1 xen-build-check(1)          blocked n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-qemut-winxpsp3  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-qemut-win     1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-qemut-win    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-winxpsp3  1 xen-build-check(1)           blocked n/a

version targeted for testing:
 xen                  8037099671f3
baseline version:
 xen                  1c69c938f641

------------------------------------------------------------
People who touched revisions under test:
  Acked-by: Tim Deegan <tim@xen.org>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Dongxiao Xu <dongxiao.xu@intel.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jun Nakajima <jun.nakajima@intel.com>
  Keir Fraser <keir@xen.org>
  Kouya Shimura <kouya@jp.fujitsu.com>
  Roger Pau Monn? <roger.pau@citrix.com>
  Samuel Thibault <samuel.thibault@ens-lyon.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
  Wei Liu <wei.liu2@citrix.com>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  fail    
 build-i386                                                   fail    
 build-amd64-oldkern                                          fail    
 build-i386-oldkern                                           fail    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemut-rhel6hvm-amd                           blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemut-win7-amd64                         blocked 
 test-amd64-i386-xl-qemut-win7-amd64                          blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemut-rhel6hvm-intel                         blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-qemut-win-vcpus1                             blocked 
 test-amd64-i386-xl-qemut-win-vcpus1                          blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-qemut-win                                   blocked 
 test-amd64-i386-qemut-win                                    blocked 
 test-amd64-amd64-xl-qemut-win                                blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-i386-xend-qemut-winxpsp3                          blocked 
 test-amd64-amd64-xl-qemut-winxpsp3                           blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 415 lines long.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 18:51:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 18:51:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeVfg-0008Sy-Qb; Fri, 30 Nov 2012 18:50:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bhelgaas@google.com>) id 1TeVXU-0008Rz-UC
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 18:42:17 +0000
Received: from [85.158.143.99:55291] by server-3.bemta-4.messagelabs.com id
	01/E8-06841-80EF8B05; Fri, 30 Nov 2012 18:42:16 +0000
X-Env-Sender: bhelgaas@google.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1354300935!27231779!1
X-Originating-IP: [209.85.215.45]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23065 invoked from network); 30 Nov 2012 18:42:15 -0000
Received: from mail-la0-f45.google.com (HELO mail-la0-f45.google.com)
	(209.85.215.45)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 18:42:15 -0000
Received: by mail-la0-f45.google.com with SMTP id p9so740381laa.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 10:42:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type;
	bh=U7pWHd02FJB22IpSM/RIAI4qhrlGy620c8u4Db2RJiI=;
	b=oPelcZqT+6rbLP6d6yHoqkD+qSp4BHxoFYolRS6VavkVPaYzDbjlAgFLk2p8lmrt6v
	zFoVTgOzxMtftIYUoeuDamf373igqIIi0XZkBAMFmzjOJnrQmnxs/2YMlRk88MMMe21a
	N4YezyBMrVjpcUWySmZN2rjESUVptrot0V/TxRP5LO4P3lq6nkwahSJcxTOBYwWLLc7F
	lMVxe4VM7I2guKUG0AeZE7FcOqy+SzbJYVBPUsWq0+QwUa3odo9e5r3faclrqxllay3H
	gDQgJUa4zo1KTfb/rSD4V538JK6UiLgK2R81wVvA55LE5aWj69392pTq+t6I/5FMIwbn
	qxkg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type:x-gm-message-state;
	bh=U7pWHd02FJB22IpSM/RIAI4qhrlGy620c8u4Db2RJiI=;
	b=RqDnms7wpN7zgGcMXBysKBzUk9Iu2ioZuq9FnNLCBSA7CAXDUrJpX4FpgkvTwcBUUP
	hMuQsQqDUTCkrnsr3ZA2CdZt7kNiJW+2PSeLd2/eEBRduOiKMarisLfHv+OH6xbfM9KW
	aW4pLsGU+x1KYQgbNL56dYk+N+c9lwruNieZ2vA+/97ISu5aU/uBdXGwUI944NLaqSVu
	jEdMbiXbiFwzpWQ/RK14fqWKnUskjRWSfGLlyXPyKN8fHmsC9Ftf8KgeVrIJXIxDAsl1
	FtdWa/akwq7vIEbqchWxGBvys3MrYSVQjVxzm4vvdWRFjPjcvFoCZNXEXVe+pmo4Z1ks
	9ECw==
Received: by 10.112.13.232 with SMTP id k8mr1172953lbc.90.1354300934767; Fri,
	30 Nov 2012 10:42:14 -0800 (PST)
MIME-Version: 1.0
Received: by 10.112.80.232 with HTTP; Fri, 30 Nov 2012 10:41:53 -0800 (PST)
In-Reply-To: <20121019125919.GC26830@phenom.dumpdata.com>
References: <507FD39F.4060601@citrix.com>
	<1350554618-14582-3-git-send-email-david.vrabel@citrix.com>
	<20121019125919.GC26830@phenom.dumpdata.com>
From: Bjorn Helgaas <bhelgaas@google.com>
Date: Fri, 30 Nov 2012 11:41:53 -0700
Message-ID: <CAErSpo6jBTGQYdPK==u7zjDuhV+U5iUfUp_KZnxkhvZCU4difQ@mail.gmail.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
X-Gm-Message-State: ALoCoQmFWzup7dVWhsN3Kj5czgH6eFnrMHzi/oe/Y2/wJcao1n0gnTHsPUwArkQFRNL3L5e1TcujQX1yjpkg/QaEnMy0mPBIbCT+9qS2vfkJ0WUChouOD5f6skJMlvre8VQ6oDtTXm31MyYi7ioBZt92v+8XtEbvjpUuW/laQYfBWkvb7Pnuv5cpeEKGMsSohCq1tZVPhD4g
X-Mailman-Approved-At: Fri, 30 Nov 2012 18:50:43 +0000
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	David Vrabel <david.vrabel@citrix.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 3/5] xen-pcifront: handle backend CLOSED
	without CLOSING
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Oct 19, 2012 at 6:59 AM, Konrad Rzeszutek Wilk
<konrad.wilk@oracle.com> wrote:
> On Thu, Oct 18, 2012 at 11:03:36AM +0100, David Vrabel wrote:
>> From: David Vrabel <david.vrabel@citrix.com>
>>
>> Backend drivers shouldn't transistion to CLOSED unless the frontend is
>> CLOSED.  If a backend does transition to CLOSED too soon then the
>> frontend may not see the CLOSING state and will not properly shutdown.
>>
>> So, treat an unexpected backend CLOSED state the same as CLOSING.
>>
>> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
>> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> ---
>> Cc: linux-pci@vger.kernel.org
>> Cc: Bjorn Helgaas <bhelgaas@google.com>
>
> Bjorn, do you want me to prep a git pull with this patch
> or can I have your Ack to put it my tree and have it part of my
> git pull to Linus?

Sorry, I missed this.  I can put it in my -next branch for the v3.8
merge window.  Would that work for you?

>> ---
>>  drivers/pci/xen-pcifront.c |    5 ++++-
>>  1 files changed, 4 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
>> index 0aab85a..a0c7312 100644
>> --- a/drivers/pci/xen-pcifront.c
>> +++ b/drivers/pci/xen-pcifront.c
>> @@ -1068,13 +1068,16 @@ static void __init_refok pcifront_backend_changed(struct xenbus_device *xdev,
>>       case XenbusStateInitialising:
>>       case XenbusStateInitWait:
>>       case XenbusStateInitialised:
>> -     case XenbusStateClosed:
>>               break;
>>
>>       case XenbusStateConnected:
>>               pcifront_try_connect(pdev);
>>               break;
>>
>> +     case XenbusStateClosed:
>> +             if (xdev->state == XenbusStateClosed)
>> +                     break;
>> +             /* Missed the backend's CLOSING state -- fallthrough */
>>       case XenbusStateClosing:
>>               dev_warn(&xdev->dev, "backend going away!\n");
>>               pcifront_try_disconnect(pdev);
>> --
>> 1.7.2.5

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 18:51:12 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 18:51:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeVfg-0008Sy-Qb; Fri, 30 Nov 2012 18:50:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bhelgaas@google.com>) id 1TeVXU-0008Rz-UC
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 18:42:17 +0000
Received: from [85.158.143.99:55291] by server-3.bemta-4.messagelabs.com id
	01/E8-06841-80EF8B05; Fri, 30 Nov 2012 18:42:16 +0000
X-Env-Sender: bhelgaas@google.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1354300935!27231779!1
X-Originating-IP: [209.85.215.45]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23065 invoked from network); 30 Nov 2012 18:42:15 -0000
Received: from mail-la0-f45.google.com (HELO mail-la0-f45.google.com)
	(209.85.215.45)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 18:42:15 -0000
Received: by mail-la0-f45.google.com with SMTP id p9so740381laa.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 10:42:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type;
	bh=U7pWHd02FJB22IpSM/RIAI4qhrlGy620c8u4Db2RJiI=;
	b=oPelcZqT+6rbLP6d6yHoqkD+qSp4BHxoFYolRS6VavkVPaYzDbjlAgFLk2p8lmrt6v
	zFoVTgOzxMtftIYUoeuDamf373igqIIi0XZkBAMFmzjOJnrQmnxs/2YMlRk88MMMe21a
	N4YezyBMrVjpcUWySmZN2rjESUVptrot0V/TxRP5LO4P3lq6nkwahSJcxTOBYwWLLc7F
	lMVxe4VM7I2guKUG0AeZE7FcOqy+SzbJYVBPUsWq0+QwUa3odo9e5r3faclrqxllay3H
	gDQgJUa4zo1KTfb/rSD4V538JK6UiLgK2R81wVvA55LE5aWj69392pTq+t6I/5FMIwbn
	qxkg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type:x-gm-message-state;
	bh=U7pWHd02FJB22IpSM/RIAI4qhrlGy620c8u4Db2RJiI=;
	b=RqDnms7wpN7zgGcMXBysKBzUk9Iu2ioZuq9FnNLCBSA7CAXDUrJpX4FpgkvTwcBUUP
	hMuQsQqDUTCkrnsr3ZA2CdZt7kNiJW+2PSeLd2/eEBRduOiKMarisLfHv+OH6xbfM9KW
	aW4pLsGU+x1KYQgbNL56dYk+N+c9lwruNieZ2vA+/97ISu5aU/uBdXGwUI944NLaqSVu
	jEdMbiXbiFwzpWQ/RK14fqWKnUskjRWSfGLlyXPyKN8fHmsC9Ftf8KgeVrIJXIxDAsl1
	FtdWa/akwq7vIEbqchWxGBvys3MrYSVQjVxzm4vvdWRFjPjcvFoCZNXEXVe+pmo4Z1ks
	9ECw==
Received: by 10.112.13.232 with SMTP id k8mr1172953lbc.90.1354300934767; Fri,
	30 Nov 2012 10:42:14 -0800 (PST)
MIME-Version: 1.0
Received: by 10.112.80.232 with HTTP; Fri, 30 Nov 2012 10:41:53 -0800 (PST)
In-Reply-To: <20121019125919.GC26830@phenom.dumpdata.com>
References: <507FD39F.4060601@citrix.com>
	<1350554618-14582-3-git-send-email-david.vrabel@citrix.com>
	<20121019125919.GC26830@phenom.dumpdata.com>
From: Bjorn Helgaas <bhelgaas@google.com>
Date: Fri, 30 Nov 2012 11:41:53 -0700
Message-ID: <CAErSpo6jBTGQYdPK==u7zjDuhV+U5iUfUp_KZnxkhvZCU4difQ@mail.gmail.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
X-Gm-Message-State: ALoCoQmFWzup7dVWhsN3Kj5czgH6eFnrMHzi/oe/Y2/wJcao1n0gnTHsPUwArkQFRNL3L5e1TcujQX1yjpkg/QaEnMy0mPBIbCT+9qS2vfkJ0WUChouOD5f6skJMlvre8VQ6oDtTXm31MyYi7ioBZt92v+8XtEbvjpUuW/laQYfBWkvb7Pnuv5cpeEKGMsSohCq1tZVPhD4g
X-Mailman-Approved-At: Fri, 30 Nov 2012 18:50:43 +0000
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	David Vrabel <david.vrabel@citrix.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 3/5] xen-pcifront: handle backend CLOSED
	without CLOSING
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Oct 19, 2012 at 6:59 AM, Konrad Rzeszutek Wilk
<konrad.wilk@oracle.com> wrote:
> On Thu, Oct 18, 2012 at 11:03:36AM +0100, David Vrabel wrote:
>> From: David Vrabel <david.vrabel@citrix.com>
>>
>> Backend drivers shouldn't transistion to CLOSED unless the frontend is
>> CLOSED.  If a backend does transition to CLOSED too soon then the
>> frontend may not see the CLOSING state and will not properly shutdown.
>>
>> So, treat an unexpected backend CLOSED state the same as CLOSING.
>>
>> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
>> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> ---
>> Cc: linux-pci@vger.kernel.org
>> Cc: Bjorn Helgaas <bhelgaas@google.com>
>
> Bjorn, do you want me to prep a git pull with this patch
> or can I have your Ack to put it my tree and have it part of my
> git pull to Linus?

Sorry, I missed this.  I can put it in my -next branch for the v3.8
merge window.  Would that work for you?

>> ---
>>  drivers/pci/xen-pcifront.c |    5 ++++-
>>  1 files changed, 4 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
>> index 0aab85a..a0c7312 100644
>> --- a/drivers/pci/xen-pcifront.c
>> +++ b/drivers/pci/xen-pcifront.c
>> @@ -1068,13 +1068,16 @@ static void __init_refok pcifront_backend_changed(struct xenbus_device *xdev,
>>       case XenbusStateInitialising:
>>       case XenbusStateInitWait:
>>       case XenbusStateInitialised:
>> -     case XenbusStateClosed:
>>               break;
>>
>>       case XenbusStateConnected:
>>               pcifront_try_connect(pdev);
>>               break;
>>
>> +     case XenbusStateClosed:
>> +             if (xdev->state == XenbusStateClosed)
>> +                     break;
>> +             /* Missed the backend's CLOSING state -- fallthrough */
>>       case XenbusStateClosing:
>>               dev_warn(&xdev->dev, "backend going away!\n");
>>               pcifront_try_disconnect(pdev);
>> --
>> 1.7.2.5

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 18:54:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 18:54:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeVj7-0000Od-Fv; Fri, 30 Nov 2012 18:54:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TeVj6-0000OX-0J
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 18:54:16 +0000
Received: from [85.158.139.211:47262] by server-8.bemta-5.messagelabs.com id
	2A/97-06050-7D009B05; Fri, 30 Nov 2012 18:54:15 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1354301652!18589972!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4OTg3NQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13654 invoked from network); 30 Nov 2012 18:54:13 -0000
Received: from unknown (HELO mga11.intel.com) (192.55.52.93)
	by server-11.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 18:54:13 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 30 Nov 2012 10:52:08 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,192,1355126400"; d="scan'208";a="255668125"
Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37])
	by fmsmga001.fm.intel.com with ESMTP; 30 Nov 2012 10:52:02 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 30 Nov 2012 10:52:01 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Sat, 1 Dec 2012 02:52:00 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Thread-Topic: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNzhioH+TZqbearkyCq5DrDs2IGJgCq1rw
Date: Fri, 30 Nov 2012 18:51:59 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233539B85D@SHSMSX101.ccr.corp.intel.com>
References: <d3378692eece3e552ba2.1353630328@ljsromley.bj.intel.com>
	<CAFLBxZZ_W5PMLYiqEwdrpqkjgiMN9NoN2f33ErLriOwNOD9GgA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353996FF@SHSMSX101.ccr.corp.intel.com>
	<1354183356.25834.108.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354183356.25834.108.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell wrote:
> On Wed, 2012-11-28 at 14:37 +0000, Liu, Jinsong wrote:
>> Ping?
> 
> Sorry I've been meaning to reply but didn't manage to yet. Also you
> replied to V4 saying to ignore it, so I was half waiting for V5 but I
> see this should actually be labelled V5 anyway.
> 
> I'm afraid I still don't fully grok the reason for the loop that goes
> with:
> +            /*
> +             * At the last iter, count the number of broken pages
> after sending, +             * and if there are more than before
> sending, do one or more iter +             * to make sure the pages
> are marked broken on the receiving side. +             */
> 
> Can we go through it one more time? Sorry.

Sure, and I'm very much appreciated your kindly/patient review. Your comments help/force me to re-think it more detailed.

> 
> Let me outline the sequence of events and you can point out where I'm
> going wrong. I'm afraid this has turned out to be rather long, again
> I'm 
> sorry for that.
> 
> First we do some number of iterations with the guest live. If an MCE
> occurs during this phase then the page will be marked dirty and we
> will 
> pick this up on the next iteration and resend the page with the dirty
> type etc and all is fine. This all looks good to me, so we don't need
> to 
> worry about anything at this stage.

Hmm, seems not so safe. If the page is good and it's in dirty bitmap (get from step #2), while at the iteration it broken after #4, same issue occur as your analysis of last iteration --> migration process will read broken page (except this case I agree it's OK) --> so let's merge analysis of 'migration process read broken page' with last iteration B.I case.

> 
> Eventually we get to the last iteration, at which point we pause the
> guest. From here on in the guest itself is not going to cause an MCE
> (e.g. by touching its RAM) because it is not running but we must still
> account for the possibility of an asynchronous MCE of some sort e.g.
> triggered by the error detection mechanisms in the hardware, cosmic
> rays 
> and such like.
> 
> The final iteration proceeds roughly as follows.
> 
>      1. The domain is paused
>      2. We scan the dirty bitmap and add dirty pages to the batch of
>         pages to process (there may be several batches in the last
>         iteration, we only need to concern ourselves with any one
>         batch here).
>      3. We map all of the pages in the resulting batch with
>         xc_map_foreign_bulk
>      4. We query the types of all the pages in the batch with
>         xc_get_pfn_type_batch
>      5. We iterate over the batch, checking the type of each page, in
>         some cases we do some incidental processing.
>      6. We send the types of the pages in the batch over the wire.
>      7. We iterate over the batch again, and send any normal page (not
>         broken, xtab etc) over the wire. Actually we do this as runs
>         of normal pages, but the key point is we avoid touching any
>         special page (including ones marked as broken by #4)
> 
> Is this sequence of events accurate?

Yes, exactly.

> 
> Now lets consider the consequences of an MCE occurring at various
> stages 
> here.
> 
> Any MCE which happens before #4 is fine, we will pick that up in #4
> and 
> the following steps will do the right thing.
> 
> Note that I am assuming that the mapping step in #3 is safe even for a
> broken page, so long as we don't actually try and use the mapping
> (more 
> on that later), is this true?

I think so. #3 mmu mapping is safe itself.

> 
> If an MCE occurs after #4 then the page will be marked as dirty in the
> bitmap and Xen will internally mark it as broken, but we won't see
> either of those with the current algorithm. There are two cases to
> think 
> about here AFAICT,
>      A. The page was not already dirty at #2. In this case we know
>         that the guest hasn't dirtied the page since the previous
>         iteration and therefore the target has a good copy of this
>         page from that time. The page isn't even in the batch we are
>         processing So we don't particularly care about the MCE here
>         and can, from the PoV of migrating this guest, ignore it.
>      B. The page was already dirty (but not broken, we handled that
>         case above in "Any MCE which happens before #4...") at #2
>         which means we have do not have an up to date copy on the
>         target. This has two subcases:
>              I. The MCE occurs before (or during) #6 (sending the
>                 page) and therefore we do not have a good up to date
>                 copy of that data at either end.
>             II. The MCE occurs after #6, in which case we already
>                 have a good copy at the target end.
> 
> To fix B you have added an 8th step to the above:
> 
>         8. Query the types of the pages again, using
>         xc_get_pfn_type_batch, and if there are more pages dirty now
>         than we say at #4 (actually #5 when we scanned the array, but
>         that distinction doesn't matter) then a new MCE must have
>         occurred. Go back to #2 and try again.
> 
> This won't do anything for A since the page wasn't in the batch to
> start 
> with and so neither #4 or #8 will look at its type, this is good and
> proper.
> 
> So now we consider the two subcases of B. Lets consider B.II first
> since 
> it seems to be the more obvious case.
> 
> In case B.II the target end already has a good copy of the data page,
> there is no need to mark the page as broken on the far end, nor to
> arrange for a vMCE to be injected. I don't know if/how we arrange for
> vMCEs to be injected under these circumstances, however even if a vMCE
> does get injected into the guest when it eventually gets unpaused on
> the 
> target then all that will happen is that it will needlessly throw
> away a 
> good page. However this is a rare corner case which is not worth
> concerning ourselves with (it's largely indistinguishable from case
> A). 
> If the MCE had happened even a single cycle earlier then this would
> have 
> been a B.I event instead of a B.II one. In any case there is no need
> to 
> return to #2 and try again, everything will be just fine if we
> complete 
> the migration at this point.
> 
> In case B.I the MCE occurs before (or while) we send the page onto the
> wire. We will therefore try to read from this page because we haven't
> looked at the type since #4 and have no idea that it is now broken.

Right.

> Reading from the broken page will cause a fault, perhaps causing a
> vMCE 
> to be delivered to dom0, which causes the kernel to kill the process
> doing the migration. Or maybe it kills dom0 or the host entirely.

Not exactly I think. Reading the broken page will trigger a serious SRAR error. Under such case hypervisor will inject a vMCE to the guest which was migrating, not dom0. The reason of this injection is, guest is best one to handle it, w/ sufficient clue/status/information (other component like hypervisor/dom0 are not proper). For xl migration process, after return from MCE context, it *again* read the broken page ... this will kill system entirely --> so we definitely not care migration any more.

> Either 
> way the idea of looping again is rather moot.

Agree the conclusion, though a little different opinion about its reason. So let's remove step #8?

Thanks,
Jinsong

> 
> Have I missed a case which needs thinking about?
> 
> I suspect B.I is the case where you are most likely to find a flaw in
> my argument. Is there something else which is done in this case which
> would 
> allow us to continue?
> 
> Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 18:54:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 18:54:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeVj7-0000Od-Fv; Fri, 30 Nov 2012 18:54:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TeVj6-0000OX-0J
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 18:54:16 +0000
Received: from [85.158.139.211:47262] by server-8.bemta-5.messagelabs.com id
	2A/97-06050-7D009B05; Fri, 30 Nov 2012 18:54:15 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1354301652!18589972!1
X-Originating-IP: [192.55.52.93]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDI4OTg3NQ==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13654 invoked from network); 30 Nov 2012 18:54:13 -0000
Received: from unknown (HELO mga11.intel.com) (192.55.52.93)
	by server-11.tower-206.messagelabs.com with SMTP;
	30 Nov 2012 18:54:13 -0000
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
	by fmsmga102.fm.intel.com with ESMTP; 30 Nov 2012 10:52:08 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,192,1355126400"; d="scan'208";a="255668125"
Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37])
	by fmsmga001.fm.intel.com with ESMTP; 30 Nov 2012 10:52:02 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX106.amr.corp.intel.com (10.19.9.37) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 30 Nov 2012 10:52:01 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Sat, 1 Dec 2012 02:52:00 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Thread-Topic: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNzhioH+TZqbearkyCq5DrDs2IGJgCq1rw
Date: Fri, 30 Nov 2012 18:51:59 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233539B85D@SHSMSX101.ccr.corp.intel.com>
References: <d3378692eece3e552ba2.1353630328@ljsromley.bj.intel.com>
	<CAFLBxZZ_W5PMLYiqEwdrpqkjgiMN9NoN2f33ErLriOwNOD9GgA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353996FF@SHSMSX101.ccr.corp.intel.com>
	<1354183356.25834.108.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354183356.25834.108.camel@zakaz.uk.xensource.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell wrote:
> On Wed, 2012-11-28 at 14:37 +0000, Liu, Jinsong wrote:
>> Ping?
> 
> Sorry I've been meaning to reply but didn't manage to yet. Also you
> replied to V4 saying to ignore it, so I was half waiting for V5 but I
> see this should actually be labelled V5 anyway.
> 
> I'm afraid I still don't fully grok the reason for the loop that goes
> with:
> +            /*
> +             * At the last iter, count the number of broken pages
> after sending, +             * and if there are more than before
> sending, do one or more iter +             * to make sure the pages
> are marked broken on the receiving side. +             */
> 
> Can we go through it one more time? Sorry.

Sure, and I'm very much appreciated your kindly/patient review. Your comments help/force me to re-think it more detailed.

> 
> Let me outline the sequence of events and you can point out where I'm
> going wrong. I'm afraid this has turned out to be rather long, again
> I'm 
> sorry for that.
> 
> First we do some number of iterations with the guest live. If an MCE
> occurs during this phase then the page will be marked dirty and we
> will 
> pick this up on the next iteration and resend the page with the dirty
> type etc and all is fine. This all looks good to me, so we don't need
> to 
> worry about anything at this stage.

Hmm, seems not so safe. If the page is good and it's in dirty bitmap (get from step #2), while at the iteration it broken after #4, same issue occur as your analysis of last iteration --> migration process will read broken page (except this case I agree it's OK) --> so let's merge analysis of 'migration process read broken page' with last iteration B.I case.

> 
> Eventually we get to the last iteration, at which point we pause the
> guest. From here on in the guest itself is not going to cause an MCE
> (e.g. by touching its RAM) because it is not running but we must still
> account for the possibility of an asynchronous MCE of some sort e.g.
> triggered by the error detection mechanisms in the hardware, cosmic
> rays 
> and such like.
> 
> The final iteration proceeds roughly as follows.
> 
>      1. The domain is paused
>      2. We scan the dirty bitmap and add dirty pages to the batch of
>         pages to process (there may be several batches in the last
>         iteration, we only need to concern ourselves with any one
>         batch here).
>      3. We map all of the pages in the resulting batch with
>         xc_map_foreign_bulk
>      4. We query the types of all the pages in the batch with
>         xc_get_pfn_type_batch
>      5. We iterate over the batch, checking the type of each page, in
>         some cases we do some incidental processing.
>      6. We send the types of the pages in the batch over the wire.
>      7. We iterate over the batch again, and send any normal page (not
>         broken, xtab etc) over the wire. Actually we do this as runs
>         of normal pages, but the key point is we avoid touching any
>         special page (including ones marked as broken by #4)
> 
> Is this sequence of events accurate?

Yes, exactly.

> 
> Now lets consider the consequences of an MCE occurring at various
> stages 
> here.
> 
> Any MCE which happens before #4 is fine, we will pick that up in #4
> and 
> the following steps will do the right thing.
> 
> Note that I am assuming that the mapping step in #3 is safe even for a
> broken page, so long as we don't actually try and use the mapping
> (more 
> on that later), is this true?

I think so. #3 mmu mapping is safe itself.

> 
> If an MCE occurs after #4 then the page will be marked as dirty in the
> bitmap and Xen will internally mark it as broken, but we won't see
> either of those with the current algorithm. There are two cases to
> think 
> about here AFAICT,
>      A. The page was not already dirty at #2. In this case we know
>         that the guest hasn't dirtied the page since the previous
>         iteration and therefore the target has a good copy of this
>         page from that time. The page isn't even in the batch we are
>         processing So we don't particularly care about the MCE here
>         and can, from the PoV of migrating this guest, ignore it.
>      B. The page was already dirty (but not broken, we handled that
>         case above in "Any MCE which happens before #4...") at #2
>         which means we have do not have an up to date copy on the
>         target. This has two subcases:
>              I. The MCE occurs before (or during) #6 (sending the
>                 page) and therefore we do not have a good up to date
>                 copy of that data at either end.
>             II. The MCE occurs after #6, in which case we already
>                 have a good copy at the target end.
> 
> To fix B you have added an 8th step to the above:
> 
>         8. Query the types of the pages again, using
>         xc_get_pfn_type_batch, and if there are more pages dirty now
>         than we say at #4 (actually #5 when we scanned the array, but
>         that distinction doesn't matter) then a new MCE must have
>         occurred. Go back to #2 and try again.
> 
> This won't do anything for A since the page wasn't in the batch to
> start 
> with and so neither #4 or #8 will look at its type, this is good and
> proper.
> 
> So now we consider the two subcases of B. Lets consider B.II first
> since 
> it seems to be the more obvious case.
> 
> In case B.II the target end already has a good copy of the data page,
> there is no need to mark the page as broken on the far end, nor to
> arrange for a vMCE to be injected. I don't know if/how we arrange for
> vMCEs to be injected under these circumstances, however even if a vMCE
> does get injected into the guest when it eventually gets unpaused on
> the 
> target then all that will happen is that it will needlessly throw
> away a 
> good page. However this is a rare corner case which is not worth
> concerning ourselves with (it's largely indistinguishable from case
> A). 
> If the MCE had happened even a single cycle earlier then this would
> have 
> been a B.I event instead of a B.II one. In any case there is no need
> to 
> return to #2 and try again, everything will be just fine if we
> complete 
> the migration at this point.
> 
> In case B.I the MCE occurs before (or while) we send the page onto the
> wire. We will therefore try to read from this page because we haven't
> looked at the type since #4 and have no idea that it is now broken.

Right.

> Reading from the broken page will cause a fault, perhaps causing a
> vMCE 
> to be delivered to dom0, which causes the kernel to kill the process
> doing the migration. Or maybe it kills dom0 or the host entirely.

Not exactly I think. Reading the broken page will trigger a serious SRAR error. Under such case hypervisor will inject a vMCE to the guest which was migrating, not dom0. The reason of this injection is, guest is best one to handle it, w/ sufficient clue/status/information (other component like hypervisor/dom0 are not proper). For xl migration process, after return from MCE context, it *again* read the broken page ... this will kill system entirely --> so we definitely not care migration any more.

> Either 
> way the idea of looping again is rather moot.

Agree the conclusion, though a little different opinion about its reason. So let's remove step #8?

Thanks,
Jinsong

> 
> Have I missed a case which needs thinking about?
> 
> I suspect B.I is the case where you are most likely to find a flaw in
> my argument. Is there something else which is done in this case which
> would 
> allow us to continue?
> 
> Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 18:57:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 18:57:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeVm6-0000Z3-9J; Fri, 30 Nov 2012 18:57:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TeVm5-0000Yw-DQ
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 18:57:21 +0000
Received: from [85.158.143.99:35678] by server-2.bemta-4.messagelabs.com id
	10/BF-28922-09109B05; Fri, 30 Nov 2012 18:57:20 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1354301837!20032440!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjM1MDY4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12746 invoked from network); 30 Nov 2012 18:57:18 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-11.tower-216.messagelabs.com with SMTP;
	30 Nov 2012 18:57:18 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga101.ch.intel.com with ESMTP; 30 Nov 2012 10:57:16 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,192,1355126400"; d="scan'208";a="224877914"
Received: from fmsmsx107.amr.corp.intel.com ([10.19.9.54])
	by azsmga001.ch.intel.com with ESMTP; 30 Nov 2012 10:57:15 -0800
Received: from fmsmsx153.amr.corp.intel.com (10.19.17.7) by
	FMSMSX107.amr.corp.intel.com (10.19.9.54) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 30 Nov 2012 10:57:13 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX153.amr.corp.intel.com (10.19.17.7) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 30 Nov 2012 10:57:13 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Sat, 1 Dec 2012 02:57:11 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>, Ian Campbell
	<Ian.Campbell@citrix.com>
Thread-Topic: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNzh9lH+TZqbearkyCq5DrDs2IGJgCvApA
Date: Fri, 30 Nov 2012 18:57:11 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233539B881@SHSMSX101.ccr.corp.intel.com>
References: <d3378692eece3e552ba2.1353630328@ljsromley.bj.intel.com>
	<CAFLBxZZ_W5PMLYiqEwdrpqkjgiMN9NoN2f33ErLriOwNOD9GgA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353996FF@SHSMSX101.ccr.corp.intel.com>
	<1354183356.25834.108.camel@zakaz.uk.xensource.com>
	<50B73E0A.1080600@eu.citrix.com>
In-Reply-To: <50B73E0A.1080600@eu.citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> On 29/11/12 10:02, Ian Campbell wrote:
>> On Wed, 2012-11-28 at 14:37 +0000, Liu, Jinsong wrote:
>>> Ping?
>> Sorry I've been meaning to reply but didn't manage to yet. Also you
>> replied to V4 saying to ignore it, so I was half waiting for V5 but I
>> see this should actually be labelled V5 anyway.
>> 
>> I'm afraid I still don't fully grok the reason for the loop that goes
>> with:
>> +            /*
>> +             * At the last iter, count the number of broken pages
>> after sending, +             * and if there are more than before
>> sending, do one or more iter +             * to make sure the pages
>> are marked broken on the receiving side. +             */ 
>> 
>> Can we go through it one more time? Sorry.
>> 
>> Let me outline the sequence of events and you can point out where I'm
>> going wrong. I'm afraid this has turned out to be rather long, again
>> I'm 
>> sorry for that.
>> 
>> First we do some number of iterations with the guest live. If an MCE
>> occurs during this phase then the page will be marked dirty and we
>> will 
>> pick this up on the next iteration and resend the page with the dirty
>> type etc and all is fine. This all looks good to me, so we don't
>> need to 
>> worry about anything at this stage.
>> 
>> Eventually we get to the last iteration, at which point we pause the
>> guest. From here on in the guest itself is not going to cause an MCE
>> (e.g. by touching its RAM) because it is not running but we must
>> still 
>> account for the possibility of an asynchronous MCE of some sort e.g.
>> triggered by the error detection mechanisms in the hardware, cosmic
>> rays 
>> and such like.
>> 
>> The final iteration proceeds roughly as follows.
>> 
>>       1. The domain is paused
>>       2. We scan the dirty bitmap and add dirty pages to the batch of
>>          pages to process (there may be several batches in the last
>>          iteration, we only need to concern ourselves with any one
>> batch          here). 
>>       3. We map all of the pages in the resulting batch with        
>> xc_map_foreign_bulk 
>>       4. We query the types of all the pages in the batch with
>>          xc_get_pfn_type_batch
>>       5. We iterate over the batch, checking the type of each page,
>>          in some cases we do some incidental processing.
>>       6. We send the types of the pages in the batch over the wire.
>>       7. We iterate over the batch again, and send any normal page
>>          (not broken, xtab etc) over the wire. Actually we do this
>>          as runs of normal pages, but the key point is we avoid
>>          touching any special page (including ones marked as broken
>> by #4) 
>> 
>> Is this sequence of events accurate?
>> 
>> Now lets consider the consequences of an MCE occurring at various
>> stages 
>> here.
>> 
>> Any MCE which happens before #4 is fine, we will pick that up in #4
>> and 
>> the following steps will do the right thing.
>> 
>> Note that I am assuming that the mapping step in #3 is safe even for
>> a 
>> broken page, so long as we don't actually try and use the mapping
>> (more 
>> on that later), is this true?
>> 
>> If an MCE occurs after #4 then the page will be marked as dirty in
>> the 
>> bitmap and Xen will internally mark it as broken, but we won't see
>> either of those with the current algorithm. There are two cases to
>> think 
>> about here AFAICT,
>>       A. The page was not already dirty at #2. In this case we know
>>          that the guest hasn't dirtied the page since the previous
>>          iteration and therefore the target has a good copy of this
>>          page from that time. The page isn't even in the batch we
>>          are processing So we don't particularly care about the MCE
>>          here and can, from the PoV of migrating this guest, ignore
>>       it. B. The page was already dirty (but not broken, we handled
>>          that case above in "Any MCE which happens before #4...") at
>>          #2 which means we have do not have an up to date copy on
>>               the target. This has          two subcases: I. The MCE
>>                  occurs before (or during) #6 (sending the page) and
>>                  therefore we do not have a good up to date copy of
>>              that data at either end. II. The MCE occurs after #6,
>>                  in which case we already have a good copy at the
>> target end. 
>> 
>> To fix B you have added an 8th step to the above:
>> 
>>          8. Query the types of the pages again, using
>>          xc_get_pfn_type_batch, and if there are more pages dirty now
>>          than we say at #4 (actually #5 when we scanned the array,
>>          but that distinction doesn't matter) then a new MCE must
>>          have occurred. Go back to #2 and try again.
>> 
>> This won't do anything for A since the page wasn't in the batch to
>> start 
>> with and so neither #4 or #8 will look at its type, this is good and
>> proper.
>> 
>> So now we consider the two subcases of B. Lets consider B.II first
>> since 
>> it seems to be the more obvious case.
>> 
>> In case B.II the target end already has a good copy of the data page,
>> there is no need to mark the page as broken on the far end, nor to
>> arrange for a vMCE to be injected. I don't know if/how we arrange for
>> vMCEs to be injected under these circumstances, however even if a
>> vMCE 
>> does get injected into the guest when it eventually gets unpaused on
>> the 
>> target then all that will happen is that it will needlessly throw
>> away a 
>> good page. However this is a rare corner case which is not worth
>> concerning ourselves with (it's largely indistinguishable from case
>> A). 
>> If the MCE had happened even a single cycle earlier then this would
>> have 
>> been a B.I event instead of a B.II one. In any case there is no need
>> to 
>> return to #2 and try again, everything will be just fine if we
>> complete 
>> the migration at this point.
>> 
>> In case B.I the MCE occurs before (or while) we send the page onto
>> the 
>> wire. We will therefore try to read from this page because we haven't
>> looked at the type since #4 and have no idea that it is now broken.
>> Reading from the broken page will cause a fault, perhaps causing a
>> vMCE 
>> to be delivered to dom0, which causes the kernel to kill the process
>> doing the migration. Or maybe it kills dom0 or the host entirely.
>> Either 
>> way the idea of looping again is rather moot.
>> 
>> Have I missed a case which needs thinking about?
>> 
>> I suspect B.I is the case where you are most likely to find a flaw
>> in my argument. Is there something else which is done in this case
>> which would 
>> allow us to continue?
> 
> I think your analysis is correct -- the only question is whether B.I
> will 100% cause the migration to crash, or whether there's a chance of
> not crashing on the read.  I had tried to ask that question before,
> and understood Jinsong's response to be that it's not 100% sure that
> the read would cause an error.  However, looking back at the thread,
> I think I may have understood something that was not there. :-)
> 
> So I guess the question for Jinsong is this:
> 
> The only time this extra loop could help is if there is a page broken
> after being paused but before being sent the last time (B.I in Ian's
> analysis) -- in which case, the migration code is 100% guaranteed to
> read a now-broken page.  What are the chances that this read of a
> broken page will *not* cause a fault which will kill at least the
> migration process, if not dom0?  If the chances are "slim-to-none",
> then there is no point for the extra check.
> 
>   -George

Yes, the extra check is pointless, xl migration reading broken page will eventually kill system. See my reply IanC's email :-)

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 18:57:43 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 18:57:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeVm6-0000Z3-9J; Fri, 30 Nov 2012 18:57:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jinsong.liu@intel.com>) id 1TeVm5-0000Yw-DQ
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 18:57:21 +0000
Received: from [85.158.143.99:35678] by server-2.bemta-4.messagelabs.com id
	10/BF-28922-09109B05; Fri, 30 Nov 2012 18:57:20 +0000
X-Env-Sender: jinsong.liu@intel.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1354301837!20032440!1
X-Originating-IP: [143.182.124.21]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQzLjE4Mi4xMjQuMjEgPT4gMjM1MDY4\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12746 invoked from network); 30 Nov 2012 18:57:18 -0000
Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21)
	by server-11.tower-216.messagelabs.com with SMTP;
	30 Nov 2012 18:57:18 -0000
Received: from azsmga001.ch.intel.com ([10.2.17.19])
	by azsmga101.ch.intel.com with ESMTP; 30 Nov 2012 10:57:16 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.84,192,1355126400"; d="scan'208";a="224877914"
Received: from fmsmsx107.amr.corp.intel.com ([10.19.9.54])
	by azsmga001.ch.intel.com with ESMTP; 30 Nov 2012 10:57:15 -0800
Received: from fmsmsx153.amr.corp.intel.com (10.19.17.7) by
	FMSMSX107.amr.corp.intel.com (10.19.9.54) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 30 Nov 2012 10:57:13 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
	FMSMSX153.amr.corp.intel.com (10.19.17.7) with Microsoft SMTP Server
	(TLS) id 14.1.355.2; Fri, 30 Nov 2012 10:57:13 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.88]) by
	SHSMSX102.ccr.corp.intel.com ([169.254.2.85]) with mapi id
	14.01.0355.002; Sat, 1 Dec 2012 02:57:11 +0800
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: George Dunlap <george.dunlap@eu.citrix.com>, Ian Campbell
	<Ian.Campbell@citrix.com>
Thread-Topic: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with
	regard to migration
Thread-Index: AQHNzh9lH+TZqbearkyCq5DrDs2IGJgCvApA
Date: Fri, 30 Nov 2012 18:57:11 +0000
Message-ID: <DE8DF0795D48FD4CA783C40EC829233539B881@SHSMSX101.ccr.corp.intel.com>
References: <d3378692eece3e552ba2.1353630328@ljsromley.bj.intel.com>
	<CAFLBxZZ_W5PMLYiqEwdrpqkjgiMN9NoN2f33ErLriOwNOD9GgA@mail.gmail.com>
	<DE8DF0795D48FD4CA783C40EC82923353996FF@SHSMSX101.ccr.corp.intel.com>
	<1354183356.25834.108.camel@zakaz.uk.xensource.com>
	<50B73E0A.1080600@eu.citrix.com>
In-Reply-To: <50B73E0A.1080600@eu.citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
MIME-Version: 1.0
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH V4] X86/vMCE: handle broken page with regard
 to migration
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

George Dunlap wrote:
> On 29/11/12 10:02, Ian Campbell wrote:
>> On Wed, 2012-11-28 at 14:37 +0000, Liu, Jinsong wrote:
>>> Ping?
>> Sorry I've been meaning to reply but didn't manage to yet. Also you
>> replied to V4 saying to ignore it, so I was half waiting for V5 but I
>> see this should actually be labelled V5 anyway.
>> 
>> I'm afraid I still don't fully grok the reason for the loop that goes
>> with:
>> +            /*
>> +             * At the last iter, count the number of broken pages
>> after sending, +             * and if there are more than before
>> sending, do one or more iter +             * to make sure the pages
>> are marked broken on the receiving side. +             */ 
>> 
>> Can we go through it one more time? Sorry.
>> 
>> Let me outline the sequence of events and you can point out where I'm
>> going wrong. I'm afraid this has turned out to be rather long, again
>> I'm 
>> sorry for that.
>> 
>> First we do some number of iterations with the guest live. If an MCE
>> occurs during this phase then the page will be marked dirty and we
>> will 
>> pick this up on the next iteration and resend the page with the dirty
>> type etc and all is fine. This all looks good to me, so we don't
>> need to 
>> worry about anything at this stage.
>> 
>> Eventually we get to the last iteration, at which point we pause the
>> guest. From here on in the guest itself is not going to cause an MCE
>> (e.g. by touching its RAM) because it is not running but we must
>> still 
>> account for the possibility of an asynchronous MCE of some sort e.g.
>> triggered by the error detection mechanisms in the hardware, cosmic
>> rays 
>> and such like.
>> 
>> The final iteration proceeds roughly as follows.
>> 
>>       1. The domain is paused
>>       2. We scan the dirty bitmap and add dirty pages to the batch of
>>          pages to process (there may be several batches in the last
>>          iteration, we only need to concern ourselves with any one
>> batch          here). 
>>       3. We map all of the pages in the resulting batch with        
>> xc_map_foreign_bulk 
>>       4. We query the types of all the pages in the batch with
>>          xc_get_pfn_type_batch
>>       5. We iterate over the batch, checking the type of each page,
>>          in some cases we do some incidental processing.
>>       6. We send the types of the pages in the batch over the wire.
>>       7. We iterate over the batch again, and send any normal page
>>          (not broken, xtab etc) over the wire. Actually we do this
>>          as runs of normal pages, but the key point is we avoid
>>          touching any special page (including ones marked as broken
>> by #4) 
>> 
>> Is this sequence of events accurate?
>> 
>> Now lets consider the consequences of an MCE occurring at various
>> stages 
>> here.
>> 
>> Any MCE which happens before #4 is fine, we will pick that up in #4
>> and 
>> the following steps will do the right thing.
>> 
>> Note that I am assuming that the mapping step in #3 is safe even for
>> a 
>> broken page, so long as we don't actually try and use the mapping
>> (more 
>> on that later), is this true?
>> 
>> If an MCE occurs after #4 then the page will be marked as dirty in
>> the 
>> bitmap and Xen will internally mark it as broken, but we won't see
>> either of those with the current algorithm. There are two cases to
>> think 
>> about here AFAICT,
>>       A. The page was not already dirty at #2. In this case we know
>>          that the guest hasn't dirtied the page since the previous
>>          iteration and therefore the target has a good copy of this
>>          page from that time. The page isn't even in the batch we
>>          are processing So we don't particularly care about the MCE
>>          here and can, from the PoV of migrating this guest, ignore
>>       it. B. The page was already dirty (but not broken, we handled
>>          that case above in "Any MCE which happens before #4...") at
>>          #2 which means we have do not have an up to date copy on
>>               the target. This has          two subcases: I. The MCE
>>                  occurs before (or during) #6 (sending the page) and
>>                  therefore we do not have a good up to date copy of
>>              that data at either end. II. The MCE occurs after #6,
>>                  in which case we already have a good copy at the
>> target end. 
>> 
>> To fix B you have added an 8th step to the above:
>> 
>>          8. Query the types of the pages again, using
>>          xc_get_pfn_type_batch, and if there are more pages dirty now
>>          than we say at #4 (actually #5 when we scanned the array,
>>          but that distinction doesn't matter) then a new MCE must
>>          have occurred. Go back to #2 and try again.
>> 
>> This won't do anything for A since the page wasn't in the batch to
>> start 
>> with and so neither #4 or #8 will look at its type, this is good and
>> proper.
>> 
>> So now we consider the two subcases of B. Lets consider B.II first
>> since 
>> it seems to be the more obvious case.
>> 
>> In case B.II the target end already has a good copy of the data page,
>> there is no need to mark the page as broken on the far end, nor to
>> arrange for a vMCE to be injected. I don't know if/how we arrange for
>> vMCEs to be injected under these circumstances, however even if a
>> vMCE 
>> does get injected into the guest when it eventually gets unpaused on
>> the 
>> target then all that will happen is that it will needlessly throw
>> away a 
>> good page. However this is a rare corner case which is not worth
>> concerning ourselves with (it's largely indistinguishable from case
>> A). 
>> If the MCE had happened even a single cycle earlier then this would
>> have 
>> been a B.I event instead of a B.II one. In any case there is no need
>> to 
>> return to #2 and try again, everything will be just fine if we
>> complete 
>> the migration at this point.
>> 
>> In case B.I the MCE occurs before (or while) we send the page onto
>> the 
>> wire. We will therefore try to read from this page because we haven't
>> looked at the type since #4 and have no idea that it is now broken.
>> Reading from the broken page will cause a fault, perhaps causing a
>> vMCE 
>> to be delivered to dom0, which causes the kernel to kill the process
>> doing the migration. Or maybe it kills dom0 or the host entirely.
>> Either 
>> way the idea of looping again is rather moot.
>> 
>> Have I missed a case which needs thinking about?
>> 
>> I suspect B.I is the case where you are most likely to find a flaw
>> in my argument. Is there something else which is done in this case
>> which would 
>> allow us to continue?
> 
> I think your analysis is correct -- the only question is whether B.I
> will 100% cause the migration to crash, or whether there's a chance of
> not crashing on the read.  I had tried to ask that question before,
> and understood Jinsong's response to be that it's not 100% sure that
> the read would cause an error.  However, looking back at the thread,
> I think I may have understood something that was not there. :-)
> 
> So I guess the question for Jinsong is this:
> 
> The only time this extra loop could help is if there is a page broken
> after being paused but before being sent the last time (B.I in Ian's
> analysis) -- in which case, the migration code is 100% guaranteed to
> read a now-broken page.  What are the chances that this read of a
> broken page will *not* cause a fault which will kill at least the
> migration process, if not dom0?  If the chances are "slim-to-none",
> then there is no point for the extra check.
> 
>   -George

Yes, the extra check is pointless, xl migration reading broken page will eventually kill system. See my reply IanC's email :-)

Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 19:11:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 19:11:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeVz7-000141-Me; Fri, 30 Nov 2012 19:10:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeVz5-00013u-RC
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 19:10:48 +0000
Received: from [85.158.137.99:26365] by server-12.bemta-3.messagelabs.com id
	70/01-22757-6B409B05; Fri, 30 Nov 2012 19:10:46 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354302612!14223771!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32062 invoked from network); 30 Nov 2012 19:10:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 19:10:12 -0000
X-IronPort-AV: E=Sophos;i="4.84,192,1355097600"; d="scan'208";a="16098768"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 19:10:11 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 19:10:11 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeVyV-00080J-Gm;
	Fri, 30 Nov 2012 19:10:11 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeVyV-00017E-FA;
	Fri, 30 Nov 2012 19:10:11 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14520-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 19:10:11 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14520: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14520 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14520/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-amd64                   4 xen-build                 fail REGR. vs. 14482
 build-amd64-oldkern           4 xen-build                 fail REGR. vs. 14482
 build-i386                    4 xen-build                 fail REGR. vs. 14482
 build-i386-oldkern            4 xen-build                 fail REGR. vs. 14482

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-qemut-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win7-amd64  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1  1 xen-build-check(1)     blocked n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win-vcpus1  1 xen-build-check(1)          blocked n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-qemut-winxpsp3  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-qemut-win     1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-qemut-win    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-winxpsp3  1 xen-build-check(1)           blocked n/a

version targeted for testing:
 xen                  8037099671f3
baseline version:
 xen                  1c69c938f641

------------------------------------------------------------
People who touched revisions under test:
  Acked-by: Tim Deegan <tim@xen.org>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Dongxiao Xu <dongxiao.xu@intel.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jun Nakajima <jun.nakajima@intel.com>
  Keir Fraser <keir@xen.org>
  Kouya Shimura <kouya@jp.fujitsu.com>
  Roger Pau Monn? <roger.pau@citrix.com>
  Samuel Thibault <samuel.thibault@ens-lyon.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
  Wei Liu <wei.liu2@citrix.com>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  fail    
 build-i386                                                   fail    
 build-amd64-oldkern                                          fail    
 build-i386-oldkern                                           fail    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemut-rhel6hvm-amd                           blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemut-win7-amd64                         blocked 
 test-amd64-i386-xl-qemut-win7-amd64                          blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemut-rhel6hvm-intel                         blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-qemut-win-vcpus1                             blocked 
 test-amd64-i386-xl-qemut-win-vcpus1                          blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-qemut-win                                   blocked 
 test-amd64-i386-qemut-win                                    blocked 
 test-amd64-amd64-xl-qemut-win                                blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-i386-xend-qemut-winxpsp3                          blocked 
 test-amd64-amd64-xl-qemut-winxpsp3                           blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 415 lines long.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 19:11:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 19:11:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeVz7-000141-Me; Fri, 30 Nov 2012 19:10:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeVz5-00013u-RC
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 19:10:48 +0000
Received: from [85.158.137.99:26365] by server-12.bemta-3.messagelabs.com id
	70/01-22757-6B409B05; Fri, 30 Nov 2012 19:10:46 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354302612!14223771!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32062 invoked from network); 30 Nov 2012 19:10:12 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-9.tower-217.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 19:10:12 -0000
X-IronPort-AV: E=Sophos;i="4.84,192,1355097600"; d="scan'208";a="16098768"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 19:10:11 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 19:10:11 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeVyV-00080J-Gm;
	Fri, 30 Nov 2012 19:10:11 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeVyV-00017E-FA;
	Fri, 30 Nov 2012 19:10:11 +0000
To: xen-devel@lists.xensource.com
Message-ID: <osstest-14520-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 19:10:11 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14520: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14520 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14520/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-amd64                   4 xen-build                 fail REGR. vs. 14482
 build-amd64-oldkern           4 xen-build                 fail REGR. vs. 14482
 build-i386                    4 xen-build                 fail REGR. vs. 14482
 build-i386-oldkern            4 xen-build                 fail REGR. vs. 14482

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-qemut-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win7-amd64  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1  1 xen-build-check(1)     blocked n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win-vcpus1  1 xen-build-check(1)          blocked n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-qemut-winxpsp3  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-qemut-win     1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-qemut-win    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-winxpsp3  1 xen-build-check(1)           blocked n/a

version targeted for testing:
 xen                  8037099671f3
baseline version:
 xen                  1c69c938f641

------------------------------------------------------------
People who touched revisions under test:
  Acked-by: Tim Deegan <tim@xen.org>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Dongxiao Xu <dongxiao.xu@intel.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jun Nakajima <jun.nakajima@intel.com>
  Keir Fraser <keir@xen.org>
  Kouya Shimura <kouya@jp.fujitsu.com>
  Roger Pau Monn? <roger.pau@citrix.com>
  Samuel Thibault <samuel.thibault@ens-lyon.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
  Wei Liu <wei.liu2@citrix.com>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  fail    
 build-i386                                                   fail    
 build-amd64-oldkern                                          fail    
 build-i386-oldkern                                           fail    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemut-rhel6hvm-amd                           blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemut-win7-amd64                         blocked 
 test-amd64-i386-xl-qemut-win7-amd64                          blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemut-rhel6hvm-intel                         blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-qemut-win-vcpus1                             blocked 
 test-amd64-i386-xl-qemut-win-vcpus1                          blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-qemut-win                                   blocked 
 test-amd64-i386-qemut-win                                    blocked 
 test-amd64-amd64-xl-qemut-win                                blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-i386-xend-qemut-winxpsp3                          blocked 
 test-amd64-amd64-xl-qemut-winxpsp3                           blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 415 lines long.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 19:12:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 19:12:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeW0Y-0001Ob-6K; Fri, 30 Nov 2012 19:12:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TeW0W-0001OU-E4
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 19:12:16 +0000
Received: from [85.158.139.83:4801] by server-8.bemta-5.messagelabs.com id
	B0/A7-06050-F0509B05; Fri, 30 Nov 2012 19:12:15 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1354302733!23590586!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14958 invoked from network); 30 Nov 2012 19:12:14 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 19:12:14 -0000
X-IronPort-AV: E=Sophos;i="4.84,192,1355097600"; d="scan'208";a="46204771"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	30 Nov 2012 19:12:13 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 30 Nov 2012 14:12:12 -0500
Message-ID: <50B9050B.7090709@citrix.com>
Date: Fri, 30 Nov 2012 19:12:11 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <50B8EE13.6070301@citrix.com>
In-Reply-To: <50B8EE13.6070301@citrix.com>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] Woes of NMIs and MCEs, and possibly how to fix
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/12 17:34, Andrew Cooper wrote:
> Hello,
>
> Yesterday, Tim and myself spent a very long time in front of a
> whiteboard trying to develop a fix which covered all the problems, and
> sadly it is very hard.  We managed to possibly come up with a long
> solution which we think has no race conditions, but relies on very large
> sections of reentrant code which cant use the stack or trash registers.
> As such, is it is not practical at all (assuming that any of us could
> actually code it)
>
>
> As a result, I thought instead that I would outline all the issues we
> currently face.  We can then:
>   * Decide which issues need fixing
>   * Decide which issues need to at least be detected and crash gracefully
>   * Decide which issues we are happy (or perhaps at least willing, if not
> happy) to ignore
>
> So, the issues are as follows.  (I have tried to list them in a logical
> order, with 1 individual problem per number, but please do point out if
> I have missed/miss-attributed entries)
>
> 1) Faults on the NMI path will re-enable NMIs before the handler
> returns, leading to reentrant behaviour.  We should audit the NMI path
> to try and remove any needless cases which might fault, but getting a
> fault-free path will be hard (and is not going so solve the reentrant
> behaviour itself).

What sort of faults are we expecting on the NMI path? Surely the trap 
handler isn't paged out? Other faults would be that the code is cause GP 
fault or illegal instructions, divide by zero or similar - these should 
all cause hypervisor panic anyways, surely? I'm sure I've missed 
something really important here, but I don't really see what faults we 
can expect to see within the NMI handler, that are "recoverable".
>
> 2) Faults on the MCE path will re-enable NMIs, as will the iret of the
> MCE itself if an MCE interrupts an NMI.

The same questions apply as to #1 (just replace NMI with MCE)

>
> 3) SMM mode executing an iret will re-enable NMIs.  There is nothing we
> can do to prevent this, and as an SMI can interrupt NMIs and MCEs, no
> way to predict if/when it may happen.  The best we can do is accept that
> it might happen, and try to deal with the after effects.
SMM is a messy thing that can interfere with most things in a system. We 
will have to rely on the BIOS developers to not mess up here. We can't 
do anything else in our code (on AMD hardware, in a HVM guest you could 
trap SMI as a VMEXIT, and then "deal with it in a container", but that 
doesn't fix SMI that happen whilst in the hypervisor, or in a PV kernel, 
so doesn't really help much).
>
> 4) "Fake NMIs" can be caused by hardware with access to the INTR pin
> (very unlikely in modern systems with the LAPIC supporting virtual wire
> mode), or by software executing an `int $0x2`.  This can cause the NMI
> handler to run on the NMI stack, but without the normal hardware NMI
> cessation logic being triggered.
>
> 5) "Fake MCEs" can be caused by software executing `int $0x18`, and by
> any MSI/IOMMU/IOAPIC programmed to deliver vector 0x18.  Normally, this
> could only be caused by a bug in Xen, although it is also possible on a
> system with out interrupt remapping. (Where the host administrator has
> accepted the documented security issue, and decided still to pass-though
> a device to a trusted VM, and the VM in question has a buggy driver for
> the passed-through hardware)
Surely both 4 & 5 are "bad guest behaviour", and whilst it's a "nice to 
have" to catch that, it's no different from running on bare metal doing 
daft things with vectors or writing code that doesn't behave at all 
"friendly". (4 is only available to Xen developers, which we hope are 
most of the time sane enough not to try these crazy things in a "live" 
system that matters). 5 is only available if you have pass through 
enabled. I don't think either is a particularly likely cause of real, in 
the field, problems.

That said, if it's a trivial fix on top of something that fixes the 
other problems mentioned, I'm OK with that being added.

>
> 6) Because of interrupt stack tables, real NMIs/MCEs can race with their
> fake alternatives, where the real interrupt interrupts the fake one and
> corrupts the exception frame of the fake one, loosing the original
> context to return to.  (This is one of the two core problem of
> reentrancy with NMIs and MCEs)
>
> 7) Real MCEs can race with each other.  If two real MCEs occur too close
> together, the processor shuts down (We cant avoid this).  However, there
> is large race condition between the MCE handler clearing the MCIP bit of
> IA32_MCG_STATUS and the handler returning during which a new MCE can
> occur and the exception frame will be corrupted.
 From what I understand, the purpose of this bit is really to ensure 
that any data needed from the MCE status registers has been fetched 
before the processor issues another MCE - otherwise you have a big race 
of "what data are we reading, and which of the multiple, in short 
succession, MCEs does this belong to. If you get two MCEs in such a 
short time that the MCE handler doesn't have time to gather the data 
from the status registers, it's likely that the machine isn't going to 
do very well for much longer anyways. Now, if we have a common stack, we 
should not reset the MCIP bit until it is time to return from the MCE 
handler - ideally on the last instruction before that, but that may be a 
little difficult to achieve, seeing as at that point, no registers will 
be available [as we're restoring those to return back to previous 
context], but something close to that should make for a very minimal 
(but admittedly still existing) window for a race. It is questionable if 
the MCE logic and processor trapping mechanism will react quickly enough 
to the MCIP bit being set, without getting to the iret [or whatever 
instruction is ending the handler]. If it does, then we die. It is not 
much different from the case where a MCE happens while the MCIP bit is 
set, which will cause a processor shutdown - that's a reboot for 
anything with a "PC compatible chipset", as CPU shutdown is pretty much 
a useless dead state for the processor, and the chipset therefore pulls 
the reset pin as soon as this state is detected.

>
>
> In addition to the above issues, we have two NMI related bugs in Xen
> which need fixing (which shall be part of the series which fixes the above)
>
> 8) VMEXIT reason NMI on Intel calls self_nmi() while NMIs are latched,
> causing the PCPU to fall into loop of VMEXITs until the VCPU timeslice
> has expired, at which point the return-to-guest path decides to schedule
> instead of resuming the guest.
The solution to this bug is to call the nmi handler either via the INT 2 
instruction or via a call to do_nmi() or something similar. There are 
not many other options, and code to fix this has been posted a couple of 
weeks ago. No, it's not completely "safe", but it's a whole lot better 
than the current non-working code. And that applies regardless of other 
issues with MCE and NMI handling.
>
> 9) The NMI handler when returning to ring3 will leave NMIs latched, as
> it uses the sysret path.
That should also be relatively easy to fix, either by actually using an 
IRET at the end of NMI handler (and using the "INT 2" solution above), 
or by making a fake stackframe for the "next instruction after IRET" on 
the stack, and then performing an IRET.

>
>
> As for 1 possible solution which we cant use:
>
> If it were not for the sysret stupidness[1] of requiring the hypervisor
> to move to the guest stack before executing the `sysret` instruction, we
> could do away with the stack tables for NMIs and MCEs alltogether, and
> the above crazyness would be easy to fix.  However, the overhead of
> always using iret to return to ring3 is not likely to be acceptable,
> meaning that we cannot "fix" the problem by discarding interrupt stacks
> and doing everything properly on the main hypervisor stack.
>
>
> Looking at the above problems, I believe there is a solution if we are
> willing to ignore the problem to do with SMM re-enabling NMIs, and if we
> are happy to crash gracefully when mixes of NMIs and MCEs interrupt each
> other and trash their exception frames (in situations were we could
> technically fix up correctly), which is based on the Linux NMI solution.
>
> As questions to the community - have I missed, or misrepresented any
> points above which might perhaps influence the design of the solution?
> I think the list is complete, but would not be supprised if there is a
> case still not considered yet.
>
> ~Andrew
>
>
> [1] In an effort to prevent a flamewar with my comment, the situation we
> find outself in now is almost certainly the result of unforseen
> interactions of individual features, but we are left to pick up the many
> pieces in way which cant completely be solved.
>

Happy to have my comments completely shot down into little bits, but I'm 
worrying that we're looking to solve a problem that doesn't actually 
need solving - at least as long as the code in the respective handlers 
are "doing the right thing", and if that happens to be broken, then we 
should fix THAT, not build lots of extra code to recover from such a thing.

--
Mats

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 19:12:37 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 19:12:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeW0Y-0001Ob-6K; Fri, 30 Nov 2012 19:12:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <mats.petersson@citrix.com>) id 1TeW0W-0001OU-E4
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 19:12:16 +0000
Received: from [85.158.139.83:4801] by server-8.bemta-5.messagelabs.com id
	B0/A7-06050-F0509B05; Fri, 30 Nov 2012 19:12:15 +0000
X-Env-Sender: mats.petersson@citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1354302733!23590586!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAxODU3NDQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14958 invoked from network); 30 Nov 2012 19:12:14 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 19:12:14 -0000
X-IronPort-AV: E=Sophos;i="4.84,192,1355097600"; d="scan'208";a="46204771"
Received: from ftlpex01cl01.citrite.net ([10.13.107.78])
	by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA;
	30 Nov 2012 19:12:13 +0000
Received: from [10.80.3.146] (10.80.3.146) by FTLPEX01CL01.citrite.net
	(10.13.107.78) with Microsoft SMTP Server id 14.2.318.1;
	Fri, 30 Nov 2012 14:12:12 -0500
Message-ID: <50B9050B.7090709@citrix.com>
Date: Fri, 30 Nov 2012 19:12:11 +0000
From: Mats Petersson <mats.petersson@citrix.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version: 1.0
To: <xen-devel@lists.xen.org>
References: <50B8EE13.6070301@citrix.com>
In-Reply-To: <50B8EE13.6070301@citrix.com>
X-Originating-IP: [10.80.3.146]
Subject: Re: [Xen-devel] Woes of NMIs and MCEs, and possibly how to fix
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/12 17:34, Andrew Cooper wrote:
> Hello,
>
> Yesterday, Tim and myself spent a very long time in front of a
> whiteboard trying to develop a fix which covered all the problems, and
> sadly it is very hard.  We managed to possibly come up with a long
> solution which we think has no race conditions, but relies on very large
> sections of reentrant code which cant use the stack or trash registers.
> As such, is it is not practical at all (assuming that any of us could
> actually code it)
>
>
> As a result, I thought instead that I would outline all the issues we
> currently face.  We can then:
>   * Decide which issues need fixing
>   * Decide which issues need to at least be detected and crash gracefully
>   * Decide which issues we are happy (or perhaps at least willing, if not
> happy) to ignore
>
> So, the issues are as follows.  (I have tried to list them in a logical
> order, with 1 individual problem per number, but please do point out if
> I have missed/miss-attributed entries)
>
> 1) Faults on the NMI path will re-enable NMIs before the handler
> returns, leading to reentrant behaviour.  We should audit the NMI path
> to try and remove any needless cases which might fault, but getting a
> fault-free path will be hard (and is not going so solve the reentrant
> behaviour itself).

What sort of faults are we expecting on the NMI path? Surely the trap 
handler isn't paged out? Other faults would be that the code is cause GP 
fault or illegal instructions, divide by zero or similar - these should 
all cause hypervisor panic anyways, surely? I'm sure I've missed 
something really important here, but I don't really see what faults we 
can expect to see within the NMI handler, that are "recoverable".
>
> 2) Faults on the MCE path will re-enable NMIs, as will the iret of the
> MCE itself if an MCE interrupts an NMI.

The same questions apply as to #1 (just replace NMI with MCE)

>
> 3) SMM mode executing an iret will re-enable NMIs.  There is nothing we
> can do to prevent this, and as an SMI can interrupt NMIs and MCEs, no
> way to predict if/when it may happen.  The best we can do is accept that
> it might happen, and try to deal with the after effects.
SMM is a messy thing that can interfere with most things in a system. We 
will have to rely on the BIOS developers to not mess up here. We can't 
do anything else in our code (on AMD hardware, in a HVM guest you could 
trap SMI as a VMEXIT, and then "deal with it in a container", but that 
doesn't fix SMI that happen whilst in the hypervisor, or in a PV kernel, 
so doesn't really help much).
>
> 4) "Fake NMIs" can be caused by hardware with access to the INTR pin
> (very unlikely in modern systems with the LAPIC supporting virtual wire
> mode), or by software executing an `int $0x2`.  This can cause the NMI
> handler to run on the NMI stack, but without the normal hardware NMI
> cessation logic being triggered.
>
> 5) "Fake MCEs" can be caused by software executing `int $0x18`, and by
> any MSI/IOMMU/IOAPIC programmed to deliver vector 0x18.  Normally, this
> could only be caused by a bug in Xen, although it is also possible on a
> system with out interrupt remapping. (Where the host administrator has
> accepted the documented security issue, and decided still to pass-though
> a device to a trusted VM, and the VM in question has a buggy driver for
> the passed-through hardware)
Surely both 4 & 5 are "bad guest behaviour", and whilst it's a "nice to 
have" to catch that, it's no different from running on bare metal doing 
daft things with vectors or writing code that doesn't behave at all 
"friendly". (4 is only available to Xen developers, which we hope are 
most of the time sane enough not to try these crazy things in a "live" 
system that matters). 5 is only available if you have pass through 
enabled. I don't think either is a particularly likely cause of real, in 
the field, problems.

That said, if it's a trivial fix on top of something that fixes the 
other problems mentioned, I'm OK with that being added.

>
> 6) Because of interrupt stack tables, real NMIs/MCEs can race with their
> fake alternatives, where the real interrupt interrupts the fake one and
> corrupts the exception frame of the fake one, loosing the original
> context to return to.  (This is one of the two core problem of
> reentrancy with NMIs and MCEs)
>
> 7) Real MCEs can race with each other.  If two real MCEs occur too close
> together, the processor shuts down (We cant avoid this).  However, there
> is large race condition between the MCE handler clearing the MCIP bit of
> IA32_MCG_STATUS and the handler returning during which a new MCE can
> occur and the exception frame will be corrupted.
 From what I understand, the purpose of this bit is really to ensure 
that any data needed from the MCE status registers has been fetched 
before the processor issues another MCE - otherwise you have a big race 
of "what data are we reading, and which of the multiple, in short 
succession, MCEs does this belong to. If you get two MCEs in such a 
short time that the MCE handler doesn't have time to gather the data 
from the status registers, it's likely that the machine isn't going to 
do very well for much longer anyways. Now, if we have a common stack, we 
should not reset the MCIP bit until it is time to return from the MCE 
handler - ideally on the last instruction before that, but that may be a 
little difficult to achieve, seeing as at that point, no registers will 
be available [as we're restoring those to return back to previous 
context], but something close to that should make for a very minimal 
(but admittedly still existing) window for a race. It is questionable if 
the MCE logic and processor trapping mechanism will react quickly enough 
to the MCIP bit being set, without getting to the iret [or whatever 
instruction is ending the handler]. If it does, then we die. It is not 
much different from the case where a MCE happens while the MCIP bit is 
set, which will cause a processor shutdown - that's a reboot for 
anything with a "PC compatible chipset", as CPU shutdown is pretty much 
a useless dead state for the processor, and the chipset therefore pulls 
the reset pin as soon as this state is detected.

>
>
> In addition to the above issues, we have two NMI related bugs in Xen
> which need fixing (which shall be part of the series which fixes the above)
>
> 8) VMEXIT reason NMI on Intel calls self_nmi() while NMIs are latched,
> causing the PCPU to fall into loop of VMEXITs until the VCPU timeslice
> has expired, at which point the return-to-guest path decides to schedule
> instead of resuming the guest.
The solution to this bug is to call the nmi handler either via the INT 2 
instruction or via a call to do_nmi() or something similar. There are 
not many other options, and code to fix this has been posted a couple of 
weeks ago. No, it's not completely "safe", but it's a whole lot better 
than the current non-working code. And that applies regardless of other 
issues with MCE and NMI handling.
>
> 9) The NMI handler when returning to ring3 will leave NMIs latched, as
> it uses the sysret path.
That should also be relatively easy to fix, either by actually using an 
IRET at the end of NMI handler (and using the "INT 2" solution above), 
or by making a fake stackframe for the "next instruction after IRET" on 
the stack, and then performing an IRET.

>
>
> As for 1 possible solution which we cant use:
>
> If it were not for the sysret stupidness[1] of requiring the hypervisor
> to move to the guest stack before executing the `sysret` instruction, we
> could do away with the stack tables for NMIs and MCEs alltogether, and
> the above crazyness would be easy to fix.  However, the overhead of
> always using iret to return to ring3 is not likely to be acceptable,
> meaning that we cannot "fix" the problem by discarding interrupt stacks
> and doing everything properly on the main hypervisor stack.
>
>
> Looking at the above problems, I believe there is a solution if we are
> willing to ignore the problem to do with SMM re-enabling NMIs, and if we
> are happy to crash gracefully when mixes of NMIs and MCEs interrupt each
> other and trash their exception frames (in situations were we could
> technically fix up correctly), which is based on the Linux NMI solution.
>
> As questions to the community - have I missed, or misrepresented any
> points above which might perhaps influence the design of the solution?
> I think the list is complete, but would not be supprised if there is a
> case still not considered yet.
>
> ~Andrew
>
>
> [1] In an effort to prevent a flamewar with my comment, the situation we
> find outself in now is almost certainly the result of unforseen
> interactions of individual features, but we are left to pick up the many
> pieces in way which cant completely be solved.
>

Happy to have my comments completely shot down into little bits, but I'm 
worrying that we're looking to solve a problem that doesn't actually 
need solving - at least as long as the code in the respective handlers 
are "doing the right thing", and if that happens to be broken, then we 
should fix THAT, not build lots of extra code to recover from such a thing.

--
Mats

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 19:50:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 19:50:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeWbQ-0002ns-Ab; Fri, 30 Nov 2012 19:50:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <apxeng@gmail.com>) id 1TeWbO-0002nn-EC
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 19:50:22 +0000
Received: from [85.158.139.83:7677] by server-10.bemta-5.messagelabs.com id
	F5/BA-09257-DFD09B05; Fri, 30 Nov 2012 19:50:21 +0000
X-Env-Sender: apxeng@gmail.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1354305017!27190351!1
X-Originating-IP: [209.85.216.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19832 invoked from network); 30 Nov 2012 19:50:18 -0000
Received: from mail-qa0-f45.google.com (HELO mail-qa0-f45.google.com)
	(209.85.216.45)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 19:50:18 -0000
Received: by mail-qa0-f45.google.com with SMTP id j15so1776359qaq.11
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 11:50:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=eau+vXWA2VYc0w/0dKk0TH2d4KJ7YiigTgM+HQbl0Us=;
	b=KGX6ECirzqobTqC8QvRWfm+WyLayMYFJ4J/y1vvaU2q4o5JG9Cvz3laeRhvUUsJIe2
	PWDFI45u+h5iT4+y12krBf2xvGnCqtWim3t5F91sxfRdzSh7I0xHSEqwLPejuU8LUfIU
	Wu1Zewb9X9aeVv4iucYvt4ouBhRwMwcL5J384CHuK+odc5w7/AxSp6PC6QYvlHarVsUV
	0Z8fpY5PAVGVWzU4Ny1ChU+k8lcCN+XTDzEcR0l1zr6E6E7nibCweLSGTCX8vPYJrOSF
	Zws4HWxwuccL6D/ydmr1bHOzg3LlGC9E8pBExhVT6oic8cniE/cdqhMGkQ0X0i4hQ27U
	Yjjw==
MIME-Version: 1.0
Received: by 10.224.117.7 with SMTP id o7mr4707275qaq.34.1354305017639; Fri,
	30 Nov 2012 11:50:17 -0800 (PST)
Received: by 10.49.4.4 with HTTP; Fri, 30 Nov 2012 11:50:17 -0800 (PST)
In-Reply-To: <50B77CB8.1040606@gmail.com>
References: <50B77375.9070904@gmail.com>
	<50B77CB8.1040606@gmail.com>
Date: Fri, 30 Nov 2012 11:50:17 -0800
Message-ID: <CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
From: AP <apxeng@gmail.com>
To: Razvan Cojocaru <rzvncj@gmail.com>
Cc: jepstein98@gmail.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 7:18 AM, Razvan Cojocaru <rzvncj@gmail.com> wrote:
>>
>> 1. I haven't been able to find an example of how single-stepping via the
>> mem_event API might work. Can you point me to some code that does this
>> (or a paper, etc.)?
>
>
> This is what I got so far (assume the xen-access.c source code file):
>
> int main(int argc, char *argv[])
> {
> [...]
>     rc = xc_hvm_set_mem_access(xch, domain_id,
>                                default_access, ~0ull, 0);
>     rc = xc_hvm_set_mem_access(xch, domain_id,
>                                default_access, 0,
>                                xenaccess->domain_info->max_pages);
>     xc_set_hvm_param(xch, domain_id,
>                      HVM_PARAM_MEMORY_EVENT_SINGLE_STEP,
>                      HVMPME_mode_sync);
> [...]
>             case MEM_EVENT_REASON_SINGLESTEP:
>                 printf("SINGLESTEP: gla: %lx gfn %lx\n",
>                        req.gla, req.gfn);
>                 // If something to do with gfn/gfa,
>                 // stop single-stepping this domain and
>                 // start faulting again on page writes.
>                 break;
>
>             case MEM_EVENT_REASON_VIOLATION:
>                 [...]
>                 if ( default_access != after_first_access ) {
>                     rc = xc_hvm_set_mem_access(xch, domain_id,
>                                                after_first_access,
>                                                req.gfn, 1);
>                     xc_domain_debug_control(xch, domain_id,
>                          XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON,
>                          req.vcpu_id);
>                 }
> [...]
> }
>
> Not quite sure what to do with gla and gfn except print them out at this point, though. Again, the condition for stopping single-step mode is that a page write happened. Any help is appreciated.

After you set single stepping on for a VCPU and resume, you should see
a single step mem_event soon after. What is the behavior that you are
observing? Are you trying this on an UP or SMP guest?

Thanks,
AP

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 19:50:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 19:50:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeWbQ-0002ns-Ab; Fri, 30 Nov 2012 19:50:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <apxeng@gmail.com>) id 1TeWbO-0002nn-EC
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 19:50:22 +0000
Received: from [85.158.139.83:7677] by server-10.bemta-5.messagelabs.com id
	F5/BA-09257-DFD09B05; Fri, 30 Nov 2012 19:50:21 +0000
X-Env-Sender: apxeng@gmail.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1354305017!27190351!1
X-Originating-IP: [209.85.216.45]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19832 invoked from network); 30 Nov 2012 19:50:18 -0000
Received: from mail-qa0-f45.google.com (HELO mail-qa0-f45.google.com)
	(209.85.216.45)
	by server-9.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 19:50:18 -0000
Received: by mail-qa0-f45.google.com with SMTP id j15so1776359qaq.11
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 11:50:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=eau+vXWA2VYc0w/0dKk0TH2d4KJ7YiigTgM+HQbl0Us=;
	b=KGX6ECirzqobTqC8QvRWfm+WyLayMYFJ4J/y1vvaU2q4o5JG9Cvz3laeRhvUUsJIe2
	PWDFI45u+h5iT4+y12krBf2xvGnCqtWim3t5F91sxfRdzSh7I0xHSEqwLPejuU8LUfIU
	Wu1Zewb9X9aeVv4iucYvt4ouBhRwMwcL5J384CHuK+odc5w7/AxSp6PC6QYvlHarVsUV
	0Z8fpY5PAVGVWzU4Ny1ChU+k8lcCN+XTDzEcR0l1zr6E6E7nibCweLSGTCX8vPYJrOSF
	Zws4HWxwuccL6D/ydmr1bHOzg3LlGC9E8pBExhVT6oic8cniE/cdqhMGkQ0X0i4hQ27U
	Yjjw==
MIME-Version: 1.0
Received: by 10.224.117.7 with SMTP id o7mr4707275qaq.34.1354305017639; Fri,
	30 Nov 2012 11:50:17 -0800 (PST)
Received: by 10.49.4.4 with HTTP; Fri, 30 Nov 2012 11:50:17 -0800 (PST)
In-Reply-To: <50B77CB8.1040606@gmail.com>
References: <50B77375.9070904@gmail.com>
	<50B77CB8.1040606@gmail.com>
Date: Fri, 30 Nov 2012 11:50:17 -0800
Message-ID: <CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
From: AP <apxeng@gmail.com>
To: Razvan Cojocaru <rzvncj@gmail.com>
Cc: jepstein98@gmail.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 7:18 AM, Razvan Cojocaru <rzvncj@gmail.com> wrote:
>>
>> 1. I haven't been able to find an example of how single-stepping via the
>> mem_event API might work. Can you point me to some code that does this
>> (or a paper, etc.)?
>
>
> This is what I got so far (assume the xen-access.c source code file):
>
> int main(int argc, char *argv[])
> {
> [...]
>     rc = xc_hvm_set_mem_access(xch, domain_id,
>                                default_access, ~0ull, 0);
>     rc = xc_hvm_set_mem_access(xch, domain_id,
>                                default_access, 0,
>                                xenaccess->domain_info->max_pages);
>     xc_set_hvm_param(xch, domain_id,
>                      HVM_PARAM_MEMORY_EVENT_SINGLE_STEP,
>                      HVMPME_mode_sync);
> [...]
>             case MEM_EVENT_REASON_SINGLESTEP:
>                 printf("SINGLESTEP: gla: %lx gfn %lx\n",
>                        req.gla, req.gfn);
>                 // If something to do with gfn/gfa,
>                 // stop single-stepping this domain and
>                 // start faulting again on page writes.
>                 break;
>
>             case MEM_EVENT_REASON_VIOLATION:
>                 [...]
>                 if ( default_access != after_first_access ) {
>                     rc = xc_hvm_set_mem_access(xch, domain_id,
>                                                after_first_access,
>                                                req.gfn, 1);
>                     xc_domain_debug_control(xch, domain_id,
>                          XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON,
>                          req.vcpu_id);
>                 }
> [...]
> }
>
> Not quite sure what to do with gla and gfn except print them out at this point, though. Again, the condition for stopping single-step mode is that a page write happened. Any help is appreciated.

After you set single stepping on for a VCPU and resume, you should see
a single step mem_event soon after. What is the behavior that you are
observing? Are you trying this on an UP or SMP guest?

Thanks,
AP

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 20:09:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 20:09:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeWtv-0003ZM-1T; Fri, 30 Nov 2012 20:09:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TeWts-0003ZG-U5
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 20:09:29 +0000
Received: from [85.158.139.83:58725] by server-10.bemta-5.messagelabs.com id
	4D/49-09257-87219B05; Fri, 30 Nov 2012 20:09:28 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1354306167!25159578!1
X-Originating-IP: [209.85.214.45]
X-SpamReason: No, hits=0.5 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,RCVD_ILLEGAL_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19030 invoked from network); 30 Nov 2012 20:09:27 -0000
Received: from mail-bk0-f45.google.com (HELO mail-bk0-f45.google.com)
	(209.85.214.45)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 20:09:27 -0000
Received: by mail-bk0-f45.google.com with SMTP id jk13so438443bkc.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 12:09:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	bh=J+pGaiPS1WxIRXbWDp7Jf/myqjX8NyKTBPovdw3wTlE=;
	b=un7K5qDnQ6IvU7OdjkDjopqvxdYX36m6Vy0RfI02Cd9fkgCPp31UWQqgmfMbjaPcWt
	ajB15br0QpTfvZ9h9fLr1za/3HsiZ39yzL35Hy015s9CQkpDUCBVOip4GqlbATF8DXvN
	9ndjz+n9exgOT4vNX6W7FfdjmzPW5npHlfzgmvRbPn0SG1dNs1Bea3B3PSbLgtdIkfuT
	dffvFrMCwhraIMZm2pI4eNtcV5KG2GBhTgD0WeGBldNBTF0IGwWN80+XRtKKRUTAu1pW
	H5cz7ufk8+YNMqF06XJRmDRjcNQe6Vy46bQpM7We93Ihvybi7dnexPm3fVLB5qi6vvAd
	cnJw==
Received: by 10.204.11.78 with SMTP id s14mr796972bks.118.1354306167129;
	Fri, 30 Nov 2012 12:09:27 -0800 (PST)
Received: from [192.168.0.101] (5-14-149-81.residential.rdsnet.ro.
	[5.14.149.81])
	by mx.google.com with ESMTPS id z5sm4307794bkv.11.2012.11.30.12.09.25
	(version=SSLv3 cipher=OTHER); Fri, 30 Nov 2012 12:09:26 -0800 (PST)
Message-ID: <50B91273.6050606@gmail.com>
Date: Fri, 30 Nov 2012 22:09:23 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.11) Gecko/20121128 Thunderbird/10.0.11
MIME-Version: 1.0
To: AP <apxeng@gmail.com>
References: <50B77375.9070904@gmail.com> <50B77CB8.1040606@gmail.com>
	<CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
In-Reply-To: <CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
Cc: jepstein98@gmail.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> After you set single stepping on for a VCPU and resume, you should see
> a single step mem_event soon after. What is the behavior that you are
> observing? Are you trying this on an UP or SMP guest?

I do see single step mem_events after. I've tried it on a SMP HVM
Slackware guest. What behaviour am I observing? The gla and gfn values
are being printed out - but I don't know how to detect a write operation
based on them. Tim Deegan has kindly suggested that I pass those values
to a debugger API that I assume Xen has, but I don't think there have
been any replies on that topic since.

Unfortunately I don't have access to the computer I've written the test
code on, and it's a rather complicated setup that I can't easily
duplicate at home, so if you need specific details (gfn/gla values,
etc.) I'm afraid I'll only be able to provide them on Monday.

Thanks,
Razvan Cojocaru

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 20:09:51 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 20:09:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeWtv-0003ZM-1T; Fri, 30 Nov 2012 20:09:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TeWts-0003ZG-U5
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 20:09:29 +0000
Received: from [85.158.139.83:58725] by server-10.bemta-5.messagelabs.com id
	4D/49-09257-87219B05; Fri, 30 Nov 2012 20:09:28 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1354306167!25159578!1
X-Originating-IP: [209.85.214.45]
X-SpamReason: No, hits=0.5 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,RCVD_ILLEGAL_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19030 invoked from network); 30 Nov 2012 20:09:27 -0000
Received: from mail-bk0-f45.google.com (HELO mail-bk0-f45.google.com)
	(209.85.214.45)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 20:09:27 -0000
Received: by mail-bk0-f45.google.com with SMTP id jk13so438443bkc.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 12:09:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	bh=J+pGaiPS1WxIRXbWDp7Jf/myqjX8NyKTBPovdw3wTlE=;
	b=un7K5qDnQ6IvU7OdjkDjopqvxdYX36m6Vy0RfI02Cd9fkgCPp31UWQqgmfMbjaPcWt
	ajB15br0QpTfvZ9h9fLr1za/3HsiZ39yzL35Hy015s9CQkpDUCBVOip4GqlbATF8DXvN
	9ndjz+n9exgOT4vNX6W7FfdjmzPW5npHlfzgmvRbPn0SG1dNs1Bea3B3PSbLgtdIkfuT
	dffvFrMCwhraIMZm2pI4eNtcV5KG2GBhTgD0WeGBldNBTF0IGwWN80+XRtKKRUTAu1pW
	H5cz7ufk8+YNMqF06XJRmDRjcNQe6Vy46bQpM7We93Ihvybi7dnexPm3fVLB5qi6vvAd
	cnJw==
Received: by 10.204.11.78 with SMTP id s14mr796972bks.118.1354306167129;
	Fri, 30 Nov 2012 12:09:27 -0800 (PST)
Received: from [192.168.0.101] (5-14-149-81.residential.rdsnet.ro.
	[5.14.149.81])
	by mx.google.com with ESMTPS id z5sm4307794bkv.11.2012.11.30.12.09.25
	(version=SSLv3 cipher=OTHER); Fri, 30 Nov 2012 12:09:26 -0800 (PST)
Message-ID: <50B91273.6050606@gmail.com>
Date: Fri, 30 Nov 2012 22:09:23 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.11) Gecko/20121128 Thunderbird/10.0.11
MIME-Version: 1.0
To: AP <apxeng@gmail.com>
References: <50B77375.9070904@gmail.com> <50B77CB8.1040606@gmail.com>
	<CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
In-Reply-To: <CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
Cc: jepstein98@gmail.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> After you set single stepping on for a VCPU and resume, you should see
> a single step mem_event soon after. What is the behavior that you are
> observing? Are you trying this on an UP or SMP guest?

I do see single step mem_events after. I've tried it on a SMP HVM
Slackware guest. What behaviour am I observing? The gla and gfn values
are being printed out - but I don't know how to detect a write operation
based on them. Tim Deegan has kindly suggested that I pass those values
to a debugger API that I assume Xen has, but I don't think there have
been any replies on that topic since.

Unfortunately I don't have access to the computer I've written the test
code on, and it's a rather complicated setup that I can't easily
duplicate at home, so if you need specific details (gfn/gla values,
etc.) I'm afraid I'll only be able to provide them on Monday.

Thanks,
Razvan Cojocaru

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 20:24:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 20:24:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeX8M-0004AJ-H9; Fri, 30 Nov 2012 20:24:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TeX8K-0004AE-QZ
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 20:24:25 +0000
Received: from [193.109.254.147:46486] by server-13.bemta-14.messagelabs.com
	id 59/5D-11239-8F519B05; Fri, 30 Nov 2012 20:24:24 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1354307061!3795908!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11334 invoked from network); 30 Nov 2012 20:24:22 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-10.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 20:24:22 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TeX8G-0000Sc-3Y; Fri, 30 Nov 2012 20:24:20 +0000
Date: Fri, 30 Nov 2012 20:24:20 +0000
From: Tim Deegan <tim@xen.org>
To: Mats Petersson <mats.petersson@citrix.com>
Message-ID: <20121130202420.GC95877@ocelot.phlegethon.org>
References: <50B8EE13.6070301@citrix.com> <50B9050B.7090709@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B9050B.7090709@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Woes of NMIs and MCEs, and possibly how to fix
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 19:12 +0000 on 30 Nov (1354302731), Mats Petersson wrote:
> >1) Faults on the NMI path will re-enable NMIs before the handler
> >returns, leading to reentrant behaviour.  We should audit the NMI path
> >to try and remove any needless cases which might fault, but getting a
> >fault-free path will be hard (and is not going so solve the reentrant
> >behaviour itself).
> 
> What sort of faults are we expecting on the NMI path?

None, but we have to keep it that way, and if we accidentlly introduce
one there's no immediate indication that we've messed up.  Unless we add
'am I in the NMI handler?' to all the fixup code.

> >2) Faults on the MCE path will re-enable NMIs, as will the iret of the
> >MCE itself if an MCE interrupts an NMI.
> 
> The same questions apply as to #1 (just replace NMI with MCE)

Andrew pointed out that some MCE code uses rdmsr_safe().

FWIW, I think that constraining MCE and NMI code not to do anything that
can fault is perfectly reasonable.  The MCE code has grown a lot
recently and probably needs an audit to check for spinlocks, faults &c.

> >3) SMM mode executing an iret will re-enable NMIs.  There is nothing we
> >can do to prevent this, and as an SMI can interrupt NMIs and MCEs, no
> >way to predict if/when it may happen.  The best we can do is accept that
> >it might happen, and try to deal with the after effects.
> 
> SMM is a messy thing that can interfere with most things in a system. We 
> will have to rely on the BIOS developers to not mess up here. We can't 
> do anything else in our code (on AMD hardware, in a HVM guest you could 
> trap SMI as a VMEXIT, and then "deal with it in a container", but that 
> doesn't fix SMI that happen whilst in the hypervisor, or in a PV kernel, 
> so doesn't really help much).

You can't even do that any more -- some BIOSes turn on the SMM lock,
which disables the VMEXIT hook.

But yes, if BIOS vendors are executing IRET in SMM mode (and if 'fix
your BIOS' isn't an appropriate response), then the simple 'just don't
IRET anywhere that's rechable fom #NMI' solution can't prevent that, and
we need to handle nested NMIs.

But I'd be happy to cross that bridge when we come to it.

> Surely both 4 & 5 are "bad guest behaviour", and whilst it's a "nice to 
> have" to catch that, it's no different from running on bare metal doing 
> daft things with vectors or writing code that doesn't behave at all 
> "friendly". (4 is only available to Xen developers, which we hope are 
> most of the time sane enough not to try these crazy things in a "live" 
> system that matters). 5 is only available if you have pass through 
> enabled. I don't think either is a particularly likely cause of real, in 
> the field, problems.

AFAICS both are only available to Xen, unless there's a bug in Xen's MSI
handling, so they'd only be caused by Xen bugs or bad hardware.  And
both can be detected (in most cases) with the same simple flag that
would detect real nested NMI/MCEs.  Or more completely by a linux-style
solution.

> >7) Real MCEs can race with each other.  If two real MCEs occur too close
> >together, the processor shuts down (We cant avoid this).  However, there
> >is large race condition between the MCE handler clearing the MCIP bit of
> >IA32_MCG_STATUS and the handler returning during which a new MCE can
> >occur and the exception frame will be corrupted.
> 
> From what I understand, the purpose of this bit is really to ensure 
> that any data needed from the MCE status registers has been fetched 
> before the processor issues another MCE - otherwise you have a big race 
> of "what data are we reading, and which of the multiple, in short 
> succession, MCEs does this belong to. If you get two MCEs in such a 
> short time that the MCE handler doesn't have time to gather the data 
> from the status registers, it's likely that the machine isn't going to 
> do very well for much longer anyways. Now, if we have a common stack, we 
> should not reset the MCIP bit until it is time to return from the MCE 
> handler - ideally on the last instruction before that

We can do the equivalent with a 'mce-being-handled' flag, which allows
us to (try to) print a useful message intead of just losing a CPU. 

> >[1] In an effort to prevent a flamewar with my comment, the situation we
> >find outself in now is almost certainly the result of unforseen
> >interactions of individual features, but we are left to pick up the many
> >pieces in way which cant completely be solved.
> >
> 
> Happy to have my comments completely shot down into little bits, but I'm 
> worrying that we're looking to solve a problem that doesn't actually 
> need solving - at least as long as the code in the respective handlers 
> are "doing the right thing", and if that happens to be broken, then we 
> should fix THAT, not build lots of extra code to recover from such a thing.

I agree.  The only things we can't fix by DTRT in do_nmi() and do_mce()
are:
 - IRET in SMM mode re-enabling NMIs; and
 - detecting _every_ case where we get a nested NMI/MCE (all we can 
   do is detect _most_ cases, but the detection is just so we can print
   a message before the crash).

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 20:24:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 20:24:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeX8M-0004AJ-H9; Fri, 30 Nov 2012 20:24:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TeX8K-0004AE-QZ
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 20:24:25 +0000
Received: from [193.109.254.147:46486] by server-13.bemta-14.messagelabs.com
	id 59/5D-11239-8F519B05; Fri, 30 Nov 2012 20:24:24 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1354307061!3795908!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11334 invoked from network); 30 Nov 2012 20:24:22 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-10.tower-27.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 20:24:22 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TeX8G-0000Sc-3Y; Fri, 30 Nov 2012 20:24:20 +0000
Date: Fri, 30 Nov 2012 20:24:20 +0000
From: Tim Deegan <tim@xen.org>
To: Mats Petersson <mats.petersson@citrix.com>
Message-ID: <20121130202420.GC95877@ocelot.phlegethon.org>
References: <50B8EE13.6070301@citrix.com> <50B9050B.7090709@citrix.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B9050B.7090709@citrix.com>
User-Agent: Mutt/1.4.2.1i
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Woes of NMIs and MCEs, and possibly how to fix
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 19:12 +0000 on 30 Nov (1354302731), Mats Petersson wrote:
> >1) Faults on the NMI path will re-enable NMIs before the handler
> >returns, leading to reentrant behaviour.  We should audit the NMI path
> >to try and remove any needless cases which might fault, but getting a
> >fault-free path will be hard (and is not going so solve the reentrant
> >behaviour itself).
> 
> What sort of faults are we expecting on the NMI path?

None, but we have to keep it that way, and if we accidentlly introduce
one there's no immediate indication that we've messed up.  Unless we add
'am I in the NMI handler?' to all the fixup code.

> >2) Faults on the MCE path will re-enable NMIs, as will the iret of the
> >MCE itself if an MCE interrupts an NMI.
> 
> The same questions apply as to #1 (just replace NMI with MCE)

Andrew pointed out that some MCE code uses rdmsr_safe().

FWIW, I think that constraining MCE and NMI code not to do anything that
can fault is perfectly reasonable.  The MCE code has grown a lot
recently and probably needs an audit to check for spinlocks, faults &c.

> >3) SMM mode executing an iret will re-enable NMIs.  There is nothing we
> >can do to prevent this, and as an SMI can interrupt NMIs and MCEs, no
> >way to predict if/when it may happen.  The best we can do is accept that
> >it might happen, and try to deal with the after effects.
> 
> SMM is a messy thing that can interfere with most things in a system. We 
> will have to rely on the BIOS developers to not mess up here. We can't 
> do anything else in our code (on AMD hardware, in a HVM guest you could 
> trap SMI as a VMEXIT, and then "deal with it in a container", but that 
> doesn't fix SMI that happen whilst in the hypervisor, or in a PV kernel, 
> so doesn't really help much).

You can't even do that any more -- some BIOSes turn on the SMM lock,
which disables the VMEXIT hook.

But yes, if BIOS vendors are executing IRET in SMM mode (and if 'fix
your BIOS' isn't an appropriate response), then the simple 'just don't
IRET anywhere that's rechable fom #NMI' solution can't prevent that, and
we need to handle nested NMIs.

But I'd be happy to cross that bridge when we come to it.

> Surely both 4 & 5 are "bad guest behaviour", and whilst it's a "nice to 
> have" to catch that, it's no different from running on bare metal doing 
> daft things with vectors or writing code that doesn't behave at all 
> "friendly". (4 is only available to Xen developers, which we hope are 
> most of the time sane enough not to try these crazy things in a "live" 
> system that matters). 5 is only available if you have pass through 
> enabled. I don't think either is a particularly likely cause of real, in 
> the field, problems.

AFAICS both are only available to Xen, unless there's a bug in Xen's MSI
handling, so they'd only be caused by Xen bugs or bad hardware.  And
both can be detected (in most cases) with the same simple flag that
would detect real nested NMI/MCEs.  Or more completely by a linux-style
solution.

> >7) Real MCEs can race with each other.  If two real MCEs occur too close
> >together, the processor shuts down (We cant avoid this).  However, there
> >is large race condition between the MCE handler clearing the MCIP bit of
> >IA32_MCG_STATUS and the handler returning during which a new MCE can
> >occur and the exception frame will be corrupted.
> 
> From what I understand, the purpose of this bit is really to ensure 
> that any data needed from the MCE status registers has been fetched 
> before the processor issues another MCE - otherwise you have a big race 
> of "what data are we reading, and which of the multiple, in short 
> succession, MCEs does this belong to. If you get two MCEs in such a 
> short time that the MCE handler doesn't have time to gather the data 
> from the status registers, it's likely that the machine isn't going to 
> do very well for much longer anyways. Now, if we have a common stack, we 
> should not reset the MCIP bit until it is time to return from the MCE 
> handler - ideally on the last instruction before that

We can do the equivalent with a 'mce-being-handled' flag, which allows
us to (try to) print a useful message intead of just losing a CPU. 

> >[1] In an effort to prevent a flamewar with my comment, the situation we
> >find outself in now is almost certainly the result of unforseen
> >interactions of individual features, but we are left to pick up the many
> >pieces in way which cant completely be solved.
> >
> 
> Happy to have my comments completely shot down into little bits, but I'm 
> worrying that we're looking to solve a problem that doesn't actually 
> need solving - at least as long as the code in the respective handlers 
> are "doing the right thing", and if that happens to be broken, then we 
> should fix THAT, not build lots of extra code to recover from such a thing.

I agree.  The only things we can't fix by DTRT in do_nmi() and do_mce()
are:
 - IRET in SMM mode re-enabling NMIs; and
 - detecting _every_ case where we get a nested NMI/MCE (all we can 
   do is detect _most_ cases, but the detection is just so we can print
   a message before the crash).

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 20:25:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 20:25:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeX8g-0004BI-Ul; Fri, 30 Nov 2012 20:24:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <apxeng@gmail.com>) id 1TeX8f-0004Au-9f
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 20:24:45 +0000
Received: from [85.158.143.99:9927] by server-3.bemta-4.messagelabs.com id
	B0/82-06841-C0619B05; Fri, 30 Nov 2012 20:24:44 +0000
X-Env-Sender: apxeng@gmail.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1354307082!26667779!1
X-Originating-IP: [209.85.216.52]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30206 invoked from network); 30 Nov 2012 20:24:43 -0000
Received: from mail-qa0-f52.google.com (HELO mail-qa0-f52.google.com)
	(209.85.216.52)
	by server-13.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 20:24:43 -0000
Received: by mail-qa0-f52.google.com with SMTP id d13so943158qak.11
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 12:24:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=GtTB15TAXcF5bkHd98zaYIaS0SR8dW0GBXAEVyliYyY=;
	b=e4OLUtjO+Ga3NFHF1kGM1+Am//1AJdE7HLsEq3revDJNxH0bobgBKieGOrCs9zjO6Z
	svOqs95YVeV1nuWu2JpaP+QQJ4qUlvIj6Q3q2UBeKjsgvK+k0peDuJXNdRhB+UKrRCmt
	rDq8NtC+FU26vD/BGkmKB62U6GI97mgQMwBM08YST+Oum2wPrvvIDI6eh+YfyIPjstqt
	BXcuQbumzVihl9VMNguAw5ieLxfdxV/FTA0U72TRgKIPv7GT3SFzjSE0ols6Z2C3XXzo
	fYsx6Pu0XXlgr1AXBTXkUMLd+JXfQHkQqQTL/Pkw+dOvJBigHNUIqcYm2e8ahpZJG/aU
	Wjdw==
MIME-Version: 1.0
Received: by 10.49.128.38 with SMTP id nl6mr4287513qeb.47.1354307082669; Fri,
	30 Nov 2012 12:24:42 -0800 (PST)
Received: by 10.49.4.4 with HTTP; Fri, 30 Nov 2012 12:24:42 -0800 (PST)
In-Reply-To: <50B91273.6050606@gmail.com>
References: <50B77375.9070904@gmail.com> <50B77CB8.1040606@gmail.com>
	<CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
	<50B91273.6050606@gmail.com>
Date: Fri, 30 Nov 2012 12:24:42 -0800
Message-ID: <CAGU+ausjwgy+NO4RynjrdXyyPrHO6_MqrwXpqYHAOXrr0vmzrg@mail.gmail.com>
From: AP <apxeng@gmail.com>
To: Razvan Cojocaru <rzvncj@gmail.com>
Cc: jepstein98@gmail.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 12:09 PM, Razvan Cojocaru <rzvncj@gmail.com> wrote:
>> After you set single stepping on for a VCPU and resume, you should see
>> a single step mem_event soon after. What is the behavior that you are
>> observing? Are you trying this on an UP or SMP guest?
>
> I do see single step mem_events after. I've tried it on a SMP HVM
> Slackware guest. What behaviour am I observing? The gla and gfn values
> are being printed out - but I don't know how to detect a write operation
> based on them. Tim Deegan has kindly suggested that I pass those values

You will not be able to detect a write event based on them as you have
marked the page rwx. One option is to mark the page rx and continue
single stepping the page. The on the next write to that page should
give you a write violation and there you can stop single stepping the
page.

> to a debugger API that I assume Xen has, but I don't think there have
> been any replies on that topic since.
>
> Unfortunately I don't have access to the computer I've written the test
> code on, and it's a rather complicated setup that I can't easily
> duplicate at home, so if you need specific details (gfn/gla values,
> etc.) I'm afraid I'll only be able to provide them on Monday.
>
> Thanks,
> Razvan Cojocaru

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 20:25:07 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 20:25:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeX8g-0004BI-Ul; Fri, 30 Nov 2012 20:24:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <apxeng@gmail.com>) id 1TeX8f-0004Au-9f
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 20:24:45 +0000
Received: from [85.158.143.99:9927] by server-3.bemta-4.messagelabs.com id
	B0/82-06841-C0619B05; Fri, 30 Nov 2012 20:24:44 +0000
X-Env-Sender: apxeng@gmail.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1354307082!26667779!1
X-Originating-IP: [209.85.216.52]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30206 invoked from network); 30 Nov 2012 20:24:43 -0000
Received: from mail-qa0-f52.google.com (HELO mail-qa0-f52.google.com)
	(209.85.216.52)
	by server-13.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 20:24:43 -0000
Received: by mail-qa0-f52.google.com with SMTP id d13so943158qak.11
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 12:24:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=GtTB15TAXcF5bkHd98zaYIaS0SR8dW0GBXAEVyliYyY=;
	b=e4OLUtjO+Ga3NFHF1kGM1+Am//1AJdE7HLsEq3revDJNxH0bobgBKieGOrCs9zjO6Z
	svOqs95YVeV1nuWu2JpaP+QQJ4qUlvIj6Q3q2UBeKjsgvK+k0peDuJXNdRhB+UKrRCmt
	rDq8NtC+FU26vD/BGkmKB62U6GI97mgQMwBM08YST+Oum2wPrvvIDI6eh+YfyIPjstqt
	BXcuQbumzVihl9VMNguAw5ieLxfdxV/FTA0U72TRgKIPv7GT3SFzjSE0ols6Z2C3XXzo
	fYsx6Pu0XXlgr1AXBTXkUMLd+JXfQHkQqQTL/Pkw+dOvJBigHNUIqcYm2e8ahpZJG/aU
	Wjdw==
MIME-Version: 1.0
Received: by 10.49.128.38 with SMTP id nl6mr4287513qeb.47.1354307082669; Fri,
	30 Nov 2012 12:24:42 -0800 (PST)
Received: by 10.49.4.4 with HTTP; Fri, 30 Nov 2012 12:24:42 -0800 (PST)
In-Reply-To: <50B91273.6050606@gmail.com>
References: <50B77375.9070904@gmail.com> <50B77CB8.1040606@gmail.com>
	<CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
	<50B91273.6050606@gmail.com>
Date: Fri, 30 Nov 2012 12:24:42 -0800
Message-ID: <CAGU+ausjwgy+NO4RynjrdXyyPrHO6_MqrwXpqYHAOXrr0vmzrg@mail.gmail.com>
From: AP <apxeng@gmail.com>
To: Razvan Cojocaru <rzvncj@gmail.com>
Cc: jepstein98@gmail.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 12:09 PM, Razvan Cojocaru <rzvncj@gmail.com> wrote:
>> After you set single stepping on for a VCPU and resume, you should see
>> a single step mem_event soon after. What is the behavior that you are
>> observing? Are you trying this on an UP or SMP guest?
>
> I do see single step mem_events after. I've tried it on a SMP HVM
> Slackware guest. What behaviour am I observing? The gla and gfn values
> are being printed out - but I don't know how to detect a write operation
> based on them. Tim Deegan has kindly suggested that I pass those values

You will not be able to detect a write event based on them as you have
marked the page rwx. One option is to mark the page rx and continue
single stepping the page. The on the next write to that page should
give you a write violation and there you can stop single stepping the
page.

> to a debugger API that I assume Xen has, but I don't think there have
> been any replies on that topic since.
>
> Unfortunately I don't have access to the computer I've written the test
> code on, and it's a rather complicated setup that I can't easily
> duplicate at home, so if you need specific details (gfn/gla values,
> etc.) I'm afraid I'll only be able to provide them on Monday.
>
> Thanks,
> Razvan Cojocaru

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 20:45:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 20:45:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeXSS-00057i-0X; Fri, 30 Nov 2012 20:45:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeXSQ-00057a-58
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 20:45:10 +0000
Received: from [85.158.143.35:30371] by server-2.bemta-4.messagelabs.com id
	C6/68-28922-5DA19B05; Fri, 30 Nov 2012 20:45:09 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-21.messagelabs.com!1354308308!11328968!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7411 invoked from network); 30 Nov 2012 20:45:08 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-11.tower-21.messagelabs.com with SMTP;
	30 Nov 2012 20:45:08 -0000
X-TM-IMSS-Message-ID: <34ab79390002c509@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 34ab79390002c509 ;
	Fri, 30 Nov 2012 15:43:45 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUKiqZI007326; 
	Fri, 30 Nov 2012 15:44:52 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: samuel.thibault@ens-lyon.org, keir@xen.org
Date: Fri, 30 Nov 2012 15:44:49 -0500
Message-Id: <1354308289-667-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] mini-os: shutdown_thread depends on xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This fixes the build of the xenstore stub domain, which should never be
shut down and so does not need this feature.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/kernel.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/extras/mini-os/kernel.c b/extras/mini-os/kernel.c
index 378ce12..f2f70f6 100644
--- a/extras/mini-os/kernel.c
+++ b/extras/mini-os/kernel.c
@@ -68,6 +68,7 @@ void setup_xen_features(void)
     }
 }
 
+#ifdef CONFIG_XENBUS
 static void shutdown_thread(void *p)
 {
     const char *path = "control/shutdown";
@@ -96,6 +97,7 @@ static void shutdown_thread(void *p)
     wmb();
     wake_up(&shutdown_queue);
 }
+#endif
 
 
 /* This should be overridden by the application we are linked against. */
@@ -160,7 +162,9 @@ void start_kernel(start_info_t *si)
     /* Init XenBus */
     init_xenbus();
 
+#ifdef CONFIG_XENBUS
     create_thread("shutdown", shutdown_thread, NULL);
+#endif
 
     /* Call (possibly overridden) app_main() */
     app_main(&start_info);
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 20:45:32 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 20:45:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeXSS-00057i-0X; Fri, 30 Nov 2012 20:45:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <dgdegra@tycho.nsa.gov>) id 1TeXSQ-00057a-58
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 20:45:10 +0000
Received: from [85.158.143.35:30371] by server-2.bemta-4.messagelabs.com id
	C6/68-28922-5DA19B05; Fri, 30 Nov 2012 20:45:09 +0000
X-Env-Sender: dgdegra@tycho.nsa.gov
X-Msg-Ref: server-11.tower-21.messagelabs.com!1354308308!11328968!1
X-Originating-IP: [63.239.67.10]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7411 invoked from network); 30 Nov 2012 20:45:08 -0000
Received: from emvm-gh1-uea09.nsa.gov (HELO nsa.gov) (63.239.67.10)
	by server-11.tower-21.messagelabs.com with SMTP;
	30 Nov 2012 20:45:08 -0000
X-TM-IMSS-Message-ID: <34ab79390002c509@nsa.gov>
Received: from tarius.tycho.ncsc.mil ([144.51.3.1]) by nsa.gov
	([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1;
	TLSv1/SSLv3 DHE-RSA-AES256-SHA (256/256)) id 34ab79390002c509 ;
	Fri, 30 Nov 2012 15:43:45 -0500
Received: from moss-nexus.epoch.ncsc.mil (moss-nexus [144.51.25.48])
	by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id qAUKiqZI007326; 
	Fri, 30 Nov 2012 15:44:52 -0500
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: samuel.thibault@ens-lyon.org, keir@xen.org
Date: Fri, 30 Nov 2012 15:44:49 -0500
Message-Id: <1354308289-667-1-git-send-email-dgdegra@tycho.nsa.gov>
X-Mailer: git-send-email 1.7.11.7
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] mini-os: shutdown_thread depends on xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

This fixes the build of the xenstore stub domain, which should never be
shut down and so does not need this feature.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/kernel.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/extras/mini-os/kernel.c b/extras/mini-os/kernel.c
index 378ce12..f2f70f6 100644
--- a/extras/mini-os/kernel.c
+++ b/extras/mini-os/kernel.c
@@ -68,6 +68,7 @@ void setup_xen_features(void)
     }
 }
 
+#ifdef CONFIG_XENBUS
 static void shutdown_thread(void *p)
 {
     const char *path = "control/shutdown";
@@ -96,6 +97,7 @@ static void shutdown_thread(void *p)
     wmb();
     wake_up(&shutdown_queue);
 }
+#endif
 
 
 /* This should be overridden by the application we are linked against. */
@@ -160,7 +162,9 @@ void start_kernel(start_info_t *si)
     /* Init XenBus */
     init_xenbus();
 
+#ifdef CONFIG_XENBUS
     create_thread("shutdown", shutdown_thread, NULL);
+#endif
 
     /* Call (possibly overridden) app_main() */
     app_main(&start_info);
-- 
1.7.11.7


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 20:45:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 20:45:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeXSh-00058F-D5; Fri, 30 Nov 2012 20:45:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TeXSg-000586-H9
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 20:45:26 +0000
Received: from [85.158.138.51:36027] by server-2.bemta-3.messagelabs.com id
	1E/D1-04744-5EA19B05; Fri, 30 Nov 2012 20:45:25 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354308324!25860702!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.5 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,RCVD_ILLEGAL_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4701 invoked from network); 30 Nov 2012 20:45:25 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 20:45:25 -0000
Received: by mail-ee0-f45.google.com with SMTP id d49so648687eek.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 12:45:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	bh=EE5W+EoWvORKcwkFIKNN10GSqcVduiwlrKpEHZwLLZo=;
	b=SY6Ngw1n8fj9EPDmh6rvh10+Ou/pz7/NL5I5nwK/IYMpXWsl2rRuzSsmTmzpUyiIfe
	VXLXF9ULaeUfXQuEyWa8quI9KmorvI6BJYFsA8xcNCSaUb7uerffRXtG3JmLd4k9Ron3
	HhjGxml5OjgcuKIcTI3LsBY36cOz3sO6Q2CRQx7Cg5Ldig29ZOH+xmISi9BgzQcMUtUW
	m7UmwgxABKYUFVkRwRVmEA4ZrCJAcrp+aGM2WtBiG5Ek/vrp0nmujV9dPOBGGWvZswlh
	ETfYPL5W8LxFgR4esK/YUpdxRXRDE/wCWbAgMUeSo7A0NWpMGwoHEZQkCqLeSMnDr3JE
	BMeg==
Received: by 10.14.182.70 with SMTP id n46mr8389472eem.5.1354308324463;
	Fri, 30 Nov 2012 12:45:24 -0800 (PST)
Received: from [192.168.0.101] (5-14-149-81.residential.rdsnet.ro.
	[5.14.149.81])
	by mx.google.com with ESMTPS id 46sm12785172eeg.4.2012.11.30.12.45.23
	(version=SSLv3 cipher=OTHER); Fri, 30 Nov 2012 12:45:23 -0800 (PST)
Message-ID: <50B91AE0.1040206@gmail.com>
Date: Fri, 30 Nov 2012 22:45:20 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.11) Gecko/20121128 Thunderbird/10.0.11
MIME-Version: 1.0
To: AP <apxeng@gmail.com>
References: <50B77375.9070904@gmail.com> <50B77CB8.1040606@gmail.com>
	<CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
	<50B91273.6050606@gmail.com>
	<CAGU+ausjwgy+NO4RynjrdXyyPrHO6_MqrwXpqYHAOXrr0vmzrg@mail.gmail.com>
In-Reply-To: <CAGU+ausjwgy+NO4RynjrdXyyPrHO6_MqrwXpqYHAOXrr0vmzrg@mail.gmail.com>
Cc: jepstein98@gmail.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>> I do see single step mem_events after. I've tried it on a SMP HVM
>> Slackware guest. What behaviour am I observing? The gla and gfn values
>> are being printed out - but I don't know how to detect a write operation
>> based on them. Tim Deegan has kindly suggested that I pass those values
> 
> You will not be able to detect a write event based on them as you have
> marked the page rwx. One option is to mark the page rx and continue
> single stepping the page. The on the next write to that page should
> give you a write violation and there you can stop single stepping the
> page.

I'm not trying to detect a write event - the write event has already
been detected: before the "case MEM_EVENT_REASON_VIOLATION" part of the
code, I've put "xc_hvm_set_mem_access(xch, domain_id, default_access, 0,
xenaccess->domain_info->max_pages);". Default_access, in the
xen-access.c file, is rx, and after_first_access is rwx.

What I am trying to do is catch the first write operation (that's why
I'm single stepping), not the first write mem_event.

My scenario is this: I'd like to mark _all_ of the domain's pages rw,
then when I get a write mem_event, mark only one page rwx, allow that
write (single stepping), then mark that one page rw again. This would
allow me to catch more than one write per unique domain page, as
xen-access.c does. Xen-access.c does not catch subsequent writes to a
page once it received a write mem_event about it.

Thanks,
Razvan Cojocaru

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 20:45:41 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 20:45:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeXSh-00058F-D5; Fri, 30 Nov 2012 20:45:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TeXSg-000586-H9
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 20:45:26 +0000
Received: from [85.158.138.51:36027] by server-2.bemta-3.messagelabs.com id
	1E/D1-04744-5EA19B05; Fri, 30 Nov 2012 20:45:25 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1354308324!25860702!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.5 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,RCVD_ILLEGAL_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4701 invoked from network); 30 Nov 2012 20:45:25 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-14.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 20:45:25 -0000
Received: by mail-ee0-f45.google.com with SMTP id d49so648687eek.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 12:45:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	bh=EE5W+EoWvORKcwkFIKNN10GSqcVduiwlrKpEHZwLLZo=;
	b=SY6Ngw1n8fj9EPDmh6rvh10+Ou/pz7/NL5I5nwK/IYMpXWsl2rRuzSsmTmzpUyiIfe
	VXLXF9ULaeUfXQuEyWa8quI9KmorvI6BJYFsA8xcNCSaUb7uerffRXtG3JmLd4k9Ron3
	HhjGxml5OjgcuKIcTI3LsBY36cOz3sO6Q2CRQx7Cg5Ldig29ZOH+xmISi9BgzQcMUtUW
	m7UmwgxABKYUFVkRwRVmEA4ZrCJAcrp+aGM2WtBiG5Ek/vrp0nmujV9dPOBGGWvZswlh
	ETfYPL5W8LxFgR4esK/YUpdxRXRDE/wCWbAgMUeSo7A0NWpMGwoHEZQkCqLeSMnDr3JE
	BMeg==
Received: by 10.14.182.70 with SMTP id n46mr8389472eem.5.1354308324463;
	Fri, 30 Nov 2012 12:45:24 -0800 (PST)
Received: from [192.168.0.101] (5-14-149-81.residential.rdsnet.ro.
	[5.14.149.81])
	by mx.google.com with ESMTPS id 46sm12785172eeg.4.2012.11.30.12.45.23
	(version=SSLv3 cipher=OTHER); Fri, 30 Nov 2012 12:45:23 -0800 (PST)
Message-ID: <50B91AE0.1040206@gmail.com>
Date: Fri, 30 Nov 2012 22:45:20 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.11) Gecko/20121128 Thunderbird/10.0.11
MIME-Version: 1.0
To: AP <apxeng@gmail.com>
References: <50B77375.9070904@gmail.com> <50B77CB8.1040606@gmail.com>
	<CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
	<50B91273.6050606@gmail.com>
	<CAGU+ausjwgy+NO4RynjrdXyyPrHO6_MqrwXpqYHAOXrr0vmzrg@mail.gmail.com>
In-Reply-To: <CAGU+ausjwgy+NO4RynjrdXyyPrHO6_MqrwXpqYHAOXrr0vmzrg@mail.gmail.com>
Cc: jepstein98@gmail.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

>> I do see single step mem_events after. I've tried it on a SMP HVM
>> Slackware guest. What behaviour am I observing? The gla and gfn values
>> are being printed out - but I don't know how to detect a write operation
>> based on them. Tim Deegan has kindly suggested that I pass those values
> 
> You will not be able to detect a write event based on them as you have
> marked the page rwx. One option is to mark the page rx and continue
> single stepping the page. The on the next write to that page should
> give you a write violation and there you can stop single stepping the
> page.

I'm not trying to detect a write event - the write event has already
been detected: before the "case MEM_EVENT_REASON_VIOLATION" part of the
code, I've put "xc_hvm_set_mem_access(xch, domain_id, default_access, 0,
xenaccess->domain_info->max_pages);". Default_access, in the
xen-access.c file, is rx, and after_first_access is rwx.

What I am trying to do is catch the first write operation (that's why
I'm single stepping), not the first write mem_event.

My scenario is this: I'd like to mark _all_ of the domain's pages rw,
then when I get a write mem_event, mark only one page rwx, allow that
write (single stepping), then mark that one page rw again. This would
allow me to catch more than one write per unique domain page, as
xen-access.c does. Xen-access.c does not catch subsequent writes to a
page once it received a write mem_event about it.

Thanks,
Razvan Cojocaru

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 20:54:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 20:54:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeXb7-0005gZ-Ee; Fri, 30 Nov 2012 20:54:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeXb5-0005gU-Fz
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 20:54:07 +0000
Received: from [85.158.138.51:62613] by server-4.bemta-3.messagelabs.com id
	A8/AF-30023-EEC19B05; Fri, 30 Nov 2012 20:54:06 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1354308845!32302284!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8257 invoked from network); 30 Nov 2012 20:54:05 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 20:54:05 -0000
X-IronPort-AV: E=Sophos;i="4.84,194,1355097600"; d="scan'208";a="16099679"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 20:53:33 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 20:53:33 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeXaX-0008WR-38;
	Fri, 30 Nov 2012 20:53:33 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeXaX-0006PN-2I;
	Fri, 30 Nov 2012 20:53:33 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14526-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 20:53:33 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14526: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14526 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14526/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-amd64                   4 xen-build                 fail REGR. vs. 14482
 build-amd64-oldkern           4 xen-build                 fail REGR. vs. 14482
 build-i386                    4 xen-build                 fail REGR. vs. 14482
 build-i386-oldkern            4 xen-build                 fail REGR. vs. 14482

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-qemut-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win7-amd64  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1  1 xen-build-check(1)     blocked n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win-vcpus1  1 xen-build-check(1)          blocked n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-qemut-winxpsp3  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-qemut-win     1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-qemut-win    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-winxpsp3  1 xen-build-check(1)           blocked n/a

version targeted for testing:
 xen                  8037099671f3
baseline version:
 xen                  1c69c938f641

------------------------------------------------------------
People who touched revisions under test:
  Acked-by: Tim Deegan <tim@xen.org>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Dongxiao Xu <dongxiao.xu@intel.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jun Nakajima <jun.nakajima@intel.com>
  Keir Fraser <keir@xen.org>
  Kouya Shimura <kouya@jp.fujitsu.com>
  Roger Pau Monn? <roger.pau@citrix.com>
  Samuel Thibault <samuel.thibault@ens-lyon.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
  Wei Liu <wei.liu2@citrix.com>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  fail    
 build-i386                                                   fail    
 build-amd64-oldkern                                          fail    
 build-i386-oldkern                                           fail    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemut-rhel6hvm-amd                           blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemut-win7-amd64                         blocked 
 test-amd64-i386-xl-qemut-win7-amd64                          blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemut-rhel6hvm-intel                         blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-qemut-win-vcpus1                             blocked 
 test-amd64-i386-xl-qemut-win-vcpus1                          blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-qemut-win                                   blocked 
 test-amd64-i386-qemut-win                                    blocked 
 test-amd64-amd64-xl-qemut-win                                blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-i386-xend-qemut-winxpsp3                          blocked 
 test-amd64-amd64-xl-qemut-winxpsp3                           blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 415 lines long.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 20:54:28 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 20:54:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeXb7-0005gZ-Ee; Fri, 30 Nov 2012 20:54:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeXb5-0005gU-Fz
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 20:54:07 +0000
Received: from [85.158.138.51:62613] by server-4.bemta-3.messagelabs.com id
	A8/AF-30023-EEC19B05; Fri, 30 Nov 2012 20:54:06 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1354308845!32302284!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8257 invoked from network); 30 Nov 2012 20:54:05 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-5.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 20:54:05 -0000
X-IronPort-AV: E=Sophos;i="4.84,194,1355097600"; d="scan'208";a="16099679"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 20:53:33 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 20:53:33 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeXaX-0008WR-38;
	Fri, 30 Nov 2012 20:53:33 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeXaX-0006PN-2I;
	Fri, 30 Nov 2012 20:53:33 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <osstest-14526-mainreport@xen.org>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 20:53:33 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com
Subject: [Xen-devel] [xen-unstable test] 14526: regressions - FAIL
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

flight 14526 xen-unstable real [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14526/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-amd64                   4 xen-build                 fail REGR. vs. 14482
 build-amd64-oldkern           4 xen-build                 fail REGR. vs. 14482
 build-i386                    4 xen-build                 fail REGR. vs. 14482
 build-i386-oldkern            4 xen-build                 fail REGR. vs. 14482

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-pcipt-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf-pin  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-sedf      1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pv            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-amd64-pv           1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemut-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-multivcpu  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl            1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-amd  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-rhel6hvm-amd  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-winxpsp3  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-win           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-qemut-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-win          1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win-vcpus1  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-pair          1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win7-amd64  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-rhel6hvm-intel  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-qemuu-rhel6hvm-intel  1 xen-build-check(1)         blocked n/a
 test-amd64-i386-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl           1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-winxpsp3  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1  1 xen-build-check(1)     blocked n/a
 test-amd64-i386-xl-winxpsp3-vcpus1  1 xen-build-check(1)           blocked n/a
 test-amd64-i386-xl-credit2    1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xl-qemut-win-vcpus1  1 xen-build-check(1)          blocked n/a
 test-amd64-amd64-pair         1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-xend-qemut-winxpsp3  1 xen-build-check(1)          blocked n/a
 test-amd64-i386-qemut-win     1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win       1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-win7-amd64  1 xen-build-check(1)           blocked  n/a
 test-amd64-i386-win-vcpus1    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-qemut-win    1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-win  1 xen-build-check(1)           blocked  n/a
 test-amd64-amd64-xl-qemut-winxpsp3  1 xen-build-check(1)           blocked n/a

version targeted for testing:
 xen                  8037099671f3
baseline version:
 xen                  1c69c938f641

------------------------------------------------------------
People who touched revisions under test:
  Acked-by: Tim Deegan <tim@xen.org>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Dongxiao Xu <dongxiao.xu@intel.com>
  George Dunlap <george.dunlap@eu.citrix.com>
  Ian Campbell <ian.campbell@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jun Nakajima <jun.nakajima@intel.com>
  Keir Fraser <keir@xen.org>
  Kouya Shimura <kouya@jp.fujitsu.com>
  Roger Pau Monn? <roger.pau@citrix.com>
  Samuel Thibault <samuel.thibault@ens-lyon.org>
  Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Tim Deegan <tim@xen.org>
  Wei Liu <wei.liu2@citrix.com>
  Xiantao Zhang <xiantao.zhang@intel.com>
------------------------------------------------------------

jobs:
 build-amd64                                                  fail    
 build-i386                                                   fail    
 build-amd64-oldkern                                          fail    
 build-i386-oldkern                                           fail    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          blocked 
 test-amd64-i386-xl                                           blocked 
 test-amd64-i386-rhel6hvm-amd                                 blocked 
 test-amd64-i386-qemut-rhel6hvm-amd                           blocked 
 test-amd64-i386-qemuu-rhel6hvm-amd                           blocked 
 test-amd64-amd64-xl-qemut-win7-amd64                         blocked 
 test-amd64-i386-xl-qemut-win7-amd64                          blocked 
 test-amd64-amd64-xl-qemuu-win7-amd64                         blocked 
 test-amd64-amd64-xl-win7-amd64                               blocked 
 test-amd64-i386-xl-win7-amd64                                blocked 
 test-amd64-i386-xl-credit2                                   blocked 
 test-amd64-amd64-xl-pcipt-intel                              blocked 
 test-amd64-i386-rhel6hvm-intel                               blocked 
 test-amd64-i386-qemut-rhel6hvm-intel                         blocked 
 test-amd64-i386-qemuu-rhel6hvm-intel                         blocked 
 test-amd64-i386-xl-multivcpu                                 blocked 
 test-amd64-amd64-pair                                        blocked 
 test-amd64-i386-pair                                         blocked 
 test-amd64-amd64-xl-sedf-pin                                 blocked 
 test-amd64-amd64-pv                                          blocked 
 test-amd64-i386-pv                                           blocked 
 test-amd64-amd64-xl-sedf                                     blocked 
 test-amd64-i386-win-vcpus1                                   blocked 
 test-amd64-i386-qemut-win-vcpus1                             blocked 
 test-amd64-i386-xl-qemut-win-vcpus1                          blocked 
 test-amd64-i386-xl-win-vcpus1                                blocked 
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1                     blocked 
 test-amd64-i386-xl-winxpsp3-vcpus1                           blocked 
 test-amd64-amd64-win                                         blocked 
 test-amd64-i386-win                                          blocked 
 test-amd64-amd64-qemut-win                                   blocked 
 test-amd64-i386-qemut-win                                    blocked 
 test-amd64-amd64-xl-qemut-win                                blocked 
 test-amd64-amd64-xl-win                                      blocked 
 test-amd64-i386-xend-qemut-winxpsp3                          blocked 
 test-amd64-amd64-xl-qemut-winxpsp3                           blocked 
 test-amd64-amd64-xl-qemuu-winxpsp3                           blocked 
 test-amd64-i386-xend-winxpsp3                                blocked 
 test-amd64-amd64-xl-winxpsp3                                 blocked 


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 415 lines long.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 20:56:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 20:56:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeXdT-0005nj-8d; Fri, 30 Nov 2012 20:56:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <apxeng@gmail.com>) id 1TeXdQ-0005ne-VQ
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 20:56:33 +0000
Received: from [85.158.143.99:53278] by server-2.bemta-4.messagelabs.com id
	2D/0C-28922-08D19B05; Fri, 30 Nov 2012 20:56:32 +0000
X-Env-Sender: apxeng@gmail.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1354308990!27241727!1
X-Originating-IP: [209.85.216.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11749 invoked from network); 30 Nov 2012 20:56:31 -0000
Received: from mail-qc0-f173.google.com (HELO mail-qc0-f173.google.com)
	(209.85.216.173)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 20:56:31 -0000
Received: by mail-qc0-f173.google.com with SMTP id b12so570747qca.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 12:56:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=5PnsEgoKGoAG14rAyaJ47Qs9vm7dv8Qw18UZJeOLX5U=;
	b=V/ux7/XN9kMGiGYV8RWRjPoU5/CF6V8YOzTRDnYnbv+yylIVOIJQOO7ZwTFcYB+tyt
	ezASnVc3fvHM5iFMd4qHRZRTapM/5qv56bvVDlBlFO4wUp0bfJtE8aJR6P4WPRvXbBHw
	rS6eatQED5oDnTUdnTFMEADo3mh/wxS7SJAaS6V0n5xGs6zZJ4KjF5qnMi2w+S4SO6BX
	5MEWabu7Hkr+ARt5SYsPSKolpP9lfDI4ceNBYiEmQq7lw28baa8w40UzeTzlxDqSbLKa
	5lvQjOS/wKJVNQS1qDR/heaI6rHjKGLfpmSIUSD1qn4Nwhzbm7NIINjYEIYexciFvYWu
	xfYw==
MIME-Version: 1.0
Received: by 10.224.189.196 with SMTP id df4mr4906840qab.16.1354308990314;
	Fri, 30 Nov 2012 12:56:30 -0800 (PST)
Received: by 10.49.4.4 with HTTP; Fri, 30 Nov 2012 12:56:30 -0800 (PST)
In-Reply-To: <50B91AE0.1040206@gmail.com>
References: <50B77375.9070904@gmail.com> <50B77CB8.1040606@gmail.com>
	<CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
	<50B91273.6050606@gmail.com>
	<CAGU+ausjwgy+NO4RynjrdXyyPrHO6_MqrwXpqYHAOXrr0vmzrg@mail.gmail.com>
	<50B91AE0.1040206@gmail.com>
Date: Fri, 30 Nov 2012 12:56:30 -0800
Message-ID: <CAGU+autfQNe5V8rZ6z56NXUra2_jcRQmQHwMY454Xk=8dXpV+w@mail.gmail.com>
From: AP <apxeng@gmail.com>
To: Razvan Cojocaru <rzvncj@gmail.com>
Cc: jepstein98@gmail.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 12:45 PM, Razvan Cojocaru <rzvncj@gmail.com> wrote:
>>> I do see single step mem_events after. I've tried it on a SMP HVM
>>> Slackware guest. What behaviour am I observing? The gla and gfn values
>>> are being printed out - but I don't know how to detect a write operation
>>> based on them. Tim Deegan has kindly suggested that I pass those values
>>
>> You will not be able to detect a write event based on them as you have
>> marked the page rwx. One option is to mark the page rx and continue
>> single stepping the page. The on the next write to that page should
>> give you a write violation and there you can stop single stepping the
>> page.
>
> I'm not trying to detect a write event - the write event has already
> been detected: before the "case MEM_EVENT_REASON_VIOLATION" part of the
> code, I've put "xc_hvm_set_mem_access(xch, domain_id, default_access, 0,
> xenaccess->domain_info->max_pages);". Default_access, in the
> xen-access.c file, is rx, and after_first_access is rwx.
>
> What I am trying to do is catch the first write operation (that's why
> I'm single stepping), not the first write mem_event.

Not sure what the difference is between first write operation and
first write mem_event.

> My scenario is this: I'd like to mark _all_ of the domain's pages rw,
> then when I get a write mem_event, mark only one page rwx, allow that
> write (single stepping), then mark that one page rw again. This would

Do you mean rx? If you mark a page rw you will not get a write mem_event for it.

> allow me to catch more than one write per unique domain page, as
> xen-access.c does. Xen-access.c does not catch subsequent writes to a
> page once it received a write mem_event about it.

You could track the EIP and GFN and if you single step more than one
instruction you can mark the page RX and stop single stepping. You
will get control again on the next write. Though if there are jmp,
things could get tricky.

Thanks,
AP

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 20:56:52 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 20:56:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeXdT-0005nj-8d; Fri, 30 Nov 2012 20:56:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <apxeng@gmail.com>) id 1TeXdQ-0005ne-VQ
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 20:56:33 +0000
Received: from [85.158.143.99:53278] by server-2.bemta-4.messagelabs.com id
	2D/0C-28922-08D19B05; Fri, 30 Nov 2012 20:56:32 +0000
X-Env-Sender: apxeng@gmail.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1354308990!27241727!1
X-Originating-IP: [209.85.216.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11749 invoked from network); 30 Nov 2012 20:56:31 -0000
Received: from mail-qc0-f173.google.com (HELO mail-qc0-f173.google.com)
	(209.85.216.173)
	by server-5.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 20:56:31 -0000
Received: by mail-qc0-f173.google.com with SMTP id b12so570747qca.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 12:56:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=5PnsEgoKGoAG14rAyaJ47Qs9vm7dv8Qw18UZJeOLX5U=;
	b=V/ux7/XN9kMGiGYV8RWRjPoU5/CF6V8YOzTRDnYnbv+yylIVOIJQOO7ZwTFcYB+tyt
	ezASnVc3fvHM5iFMd4qHRZRTapM/5qv56bvVDlBlFO4wUp0bfJtE8aJR6P4WPRvXbBHw
	rS6eatQED5oDnTUdnTFMEADo3mh/wxS7SJAaS6V0n5xGs6zZJ4KjF5qnMi2w+S4SO6BX
	5MEWabu7Hkr+ARt5SYsPSKolpP9lfDI4ceNBYiEmQq7lw28baa8w40UzeTzlxDqSbLKa
	5lvQjOS/wKJVNQS1qDR/heaI6rHjKGLfpmSIUSD1qn4Nwhzbm7NIINjYEIYexciFvYWu
	xfYw==
MIME-Version: 1.0
Received: by 10.224.189.196 with SMTP id df4mr4906840qab.16.1354308990314;
	Fri, 30 Nov 2012 12:56:30 -0800 (PST)
Received: by 10.49.4.4 with HTTP; Fri, 30 Nov 2012 12:56:30 -0800 (PST)
In-Reply-To: <50B91AE0.1040206@gmail.com>
References: <50B77375.9070904@gmail.com> <50B77CB8.1040606@gmail.com>
	<CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
	<50B91273.6050606@gmail.com>
	<CAGU+ausjwgy+NO4RynjrdXyyPrHO6_MqrwXpqYHAOXrr0vmzrg@mail.gmail.com>
	<50B91AE0.1040206@gmail.com>
Date: Fri, 30 Nov 2012 12:56:30 -0800
Message-ID: <CAGU+autfQNe5V8rZ6z56NXUra2_jcRQmQHwMY454Xk=8dXpV+w@mail.gmail.com>
From: AP <apxeng@gmail.com>
To: Razvan Cojocaru <rzvncj@gmail.com>
Cc: jepstein98@gmail.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 12:45 PM, Razvan Cojocaru <rzvncj@gmail.com> wrote:
>>> I do see single step mem_events after. I've tried it on a SMP HVM
>>> Slackware guest. What behaviour am I observing? The gla and gfn values
>>> are being printed out - but I don't know how to detect a write operation
>>> based on them. Tim Deegan has kindly suggested that I pass those values
>>
>> You will not be able to detect a write event based on them as you have
>> marked the page rwx. One option is to mark the page rx and continue
>> single stepping the page. The on the next write to that page should
>> give you a write violation and there you can stop single stepping the
>> page.
>
> I'm not trying to detect a write event - the write event has already
> been detected: before the "case MEM_EVENT_REASON_VIOLATION" part of the
> code, I've put "xc_hvm_set_mem_access(xch, domain_id, default_access, 0,
> xenaccess->domain_info->max_pages);". Default_access, in the
> xen-access.c file, is rx, and after_first_access is rwx.
>
> What I am trying to do is catch the first write operation (that's why
> I'm single stepping), not the first write mem_event.

Not sure what the difference is between first write operation and
first write mem_event.

> My scenario is this: I'd like to mark _all_ of the domain's pages rw,
> then when I get a write mem_event, mark only one page rwx, allow that
> write (single stepping), then mark that one page rw again. This would

Do you mean rx? If you mark a page rw you will not get a write mem_event for it.

> allow me to catch more than one write per unique domain page, as
> xen-access.c does. Xen-access.c does not catch subsequent writes to a
> page once it received a write mem_event about it.

You could track the EIP and GFN and if you single step more than one
instruction you can mark the page RX and stop single stepping. You
will get control again on the next write. Though if there are jmp,
things could get tricky.

Thanks,
AP

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 21:05:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 21:05:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeXlU-0006Jc-7w; Fri, 30 Nov 2012 21:04:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TeXlT-0006JX-4B
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 21:04:51 +0000
Received: from [85.158.139.83:44460] by server-8.bemta-5.messagelabs.com id
	49/C4-06050-27F19B05; Fri, 30 Nov 2012 21:04:50 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1354309485!25163438!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.5 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,RCVD_ILLEGAL_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8720 invoked from network); 30 Nov 2012 21:04:45 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 21:04:45 -0000
Received: by mail-ee0-f45.google.com with SMTP id d49so659084eek.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 13:04:45 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	bh=avcN6lBUtXuC/LxyfQ6EYEC/9fljn52sJAw5qLC8TcE=;
	b=htGD440eQmD3r8S2T540WBTeNWpMjKZPTh42pWmdmhEHW/3WsEUdtTUqcI56XiWvwm
	y9ZVApTN4Qjk7g7ryqwqcQVsrgn6F29TZ+V3WT1JEriwKt09Fkdrbu4jRZxNNkKG+C7U
	mTEE0SQLKnwzjWr9zMWgUez6CkXpejDHOBlvHXa1c2Cywdz5lM+ZQWfYvuJjz6y0lvKG
	O6ShxsOFxKSN9+EzxNglNEeLlP97WlC48cMhgP/E8ZW+BekB18cXTRCzmKZm8dD8zHaK
	VVWW1HvzVlWcj6ry3F5gn1EQurYBZzIfUGHr0qkXRx2vvyH53Oyq2cu/iiMYZo/O92io
	3FTA==
Received: by 10.14.216.70 with SMTP id f46mr8532032eep.12.1354309485223;
	Fri, 30 Nov 2012 13:04:45 -0800 (PST)
Received: from [192.168.0.101] (5-14-149-81.residential.rdsnet.ro.
	[5.14.149.81])
	by mx.google.com with ESMTPS id g47sm12882856eeo.6.2012.11.30.13.04.43
	(version=SSLv3 cipher=OTHER); Fri, 30 Nov 2012 13:04:44 -0800 (PST)
Message-ID: <50B91F69.3040506@gmail.com>
Date: Fri, 30 Nov 2012 23:04:41 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.11) Gecko/20121128 Thunderbird/10.0.11
MIME-Version: 1.0
To: AP <apxeng@gmail.com>
References: <50B77375.9070904@gmail.com> <50B77CB8.1040606@gmail.com>
	<CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
	<50B91273.6050606@gmail.com>
	<CAGU+ausjwgy+NO4RynjrdXyyPrHO6_MqrwXpqYHAOXrr0vmzrg@mail.gmail.com>
	<50B91AE0.1040206@gmail.com>
	<CAGU+autfQNe5V8rZ6z56NXUra2_jcRQmQHwMY454Xk=8dXpV+w@mail.gmail.com>
In-Reply-To: <CAGU+autfQNe5V8rZ6z56NXUra2_jcRQmQHwMY454Xk=8dXpV+w@mail.gmail.com>
Cc: jepstein98@gmail.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> Not sure what the difference is between first write operation and
> first write mem_event.

The difference is this: a write operation will only trigger a write
event for a page marked rx. So if we're in single step mode and a write
happens on a page marked rwx, this will not trigger a write mem_event.

>> My scenario is this: I'd like to mark _all_ of the domain's pages rw,
>> then when I get a write mem_event, mark only one page rwx, allow that
>> write (single stepping), then mark that one page rw again. This would
> 
> Do you mean rx? If you mark a page rw you will not get a write mem_event for it.

Yes, I meant rx. Sorry (it's late where I'm writing from).

> You could track the EIP and GFN and if you single step more than one
> instruction you can mark the page RX and stop single stepping. You
> will get control again on the next write. Though if there are jmp,
> things could get tricky.

So if I understand you correctly, simply single-stepping for only the
duration of one MEM_EVENT_REASON_SINGLESTEP, which should be the write
operation (ignoring the gfn/gla fields of the mem_event), should do the
trick?

Thanks,
Razvan Cojocaru

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 21:05:08 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 21:05:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeXlU-0006Jc-7w; Fri, 30 Nov 2012 21:04:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TeXlT-0006JX-4B
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 21:04:51 +0000
Received: from [85.158.139.83:44460] by server-8.bemta-5.messagelabs.com id
	49/C4-06050-27F19B05; Fri, 30 Nov 2012 21:04:50 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1354309485!25163438!1
X-Originating-IP: [74.125.83.45]
X-SpamReason: No, hits=0.5 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,RCVD_ILLEGAL_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8720 invoked from network); 30 Nov 2012 21:04:45 -0000
Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com)
	(74.125.83.45)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 21:04:45 -0000
Received: by mail-ee0-f45.google.com with SMTP id d49so659084eek.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 13:04:45 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	bh=avcN6lBUtXuC/LxyfQ6EYEC/9fljn52sJAw5qLC8TcE=;
	b=htGD440eQmD3r8S2T540WBTeNWpMjKZPTh42pWmdmhEHW/3WsEUdtTUqcI56XiWvwm
	y9ZVApTN4Qjk7g7ryqwqcQVsrgn6F29TZ+V3WT1JEriwKt09Fkdrbu4jRZxNNkKG+C7U
	mTEE0SQLKnwzjWr9zMWgUez6CkXpejDHOBlvHXa1c2Cywdz5lM+ZQWfYvuJjz6y0lvKG
	O6ShxsOFxKSN9+EzxNglNEeLlP97WlC48cMhgP/E8ZW+BekB18cXTRCzmKZm8dD8zHaK
	VVWW1HvzVlWcj6ry3F5gn1EQurYBZzIfUGHr0qkXRx2vvyH53Oyq2cu/iiMYZo/O92io
	3FTA==
Received: by 10.14.216.70 with SMTP id f46mr8532032eep.12.1354309485223;
	Fri, 30 Nov 2012 13:04:45 -0800 (PST)
Received: from [192.168.0.101] (5-14-149-81.residential.rdsnet.ro.
	[5.14.149.81])
	by mx.google.com with ESMTPS id g47sm12882856eeo.6.2012.11.30.13.04.43
	(version=SSLv3 cipher=OTHER); Fri, 30 Nov 2012 13:04:44 -0800 (PST)
Message-ID: <50B91F69.3040506@gmail.com>
Date: Fri, 30 Nov 2012 23:04:41 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.11) Gecko/20121128 Thunderbird/10.0.11
MIME-Version: 1.0
To: AP <apxeng@gmail.com>
References: <50B77375.9070904@gmail.com> <50B77CB8.1040606@gmail.com>
	<CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
	<50B91273.6050606@gmail.com>
	<CAGU+ausjwgy+NO4RynjrdXyyPrHO6_MqrwXpqYHAOXrr0vmzrg@mail.gmail.com>
	<50B91AE0.1040206@gmail.com>
	<CAGU+autfQNe5V8rZ6z56NXUra2_jcRQmQHwMY454Xk=8dXpV+w@mail.gmail.com>
In-Reply-To: <CAGU+autfQNe5V8rZ6z56NXUra2_jcRQmQHwMY454Xk=8dXpV+w@mail.gmail.com>
Cc: jepstein98@gmail.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> Not sure what the difference is between first write operation and
> first write mem_event.

The difference is this: a write operation will only trigger a write
event for a page marked rx. So if we're in single step mode and a write
happens on a page marked rwx, this will not trigger a write mem_event.

>> My scenario is this: I'd like to mark _all_ of the domain's pages rw,
>> then when I get a write mem_event, mark only one page rwx, allow that
>> write (single stepping), then mark that one page rw again. This would
> 
> Do you mean rx? If you mark a page rw you will not get a write mem_event for it.

Yes, I meant rx. Sorry (it's late where I'm writing from).

> You could track the EIP and GFN and if you single step more than one
> instruction you can mark the page RX and stop single stepping. You
> will get control again on the next write. Though if there are jmp,
> things could get tricky.

So if I understand you correctly, simply single-stepping for only the
duration of one MEM_EVENT_REASON_SINGLESTEP, which should be the write
operation (ignoring the gfn/gla fields of the mem_event), should do the
trick?

Thanks,
Razvan Cojocaru

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 21:07:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 21:07:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeXnm-0006PF-Q0; Fri, 30 Nov 2012 21:07:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TeXnl-0006P7-5f
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 21:07:13 +0000
Received: from [85.158.143.35:50486] by server-2.bemta-4.messagelabs.com id
	D7/AF-28922-00029B05; Fri, 30 Nov 2012 21:07:12 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1354309629!15794569!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27732 invoked from network); 30 Nov 2012 21:07:10 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 21:07:10 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TeXng-0000Yb-AF; Fri, 30 Nov 2012 21:07:08 +0000
Date: Fri, 30 Nov 2012 21:07:08 +0000
From: Tim Deegan <tim@xen.org>
To: Razvan Cojocaru <rzvncj@gmail.com>
Message-ID: <20121130210708.GA2013@ocelot.phlegethon.org>
References: <50B77375.9070904@gmail.com> <50B77CB8.1040606@gmail.com>
	<CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
	<50B91273.6050606@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B91273.6050606@gmail.com>
User-Agent: Mutt/1.4.2.1i
Cc: jepstein98@gmail.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 22:09 +0200 on 30 Nov (1354313363), Razvan Cojocaru wrote:
> > After you set single stepping on for a VCPU and resume, you should see
> > a single step mem_event soon after. What is the behavior that you are
> > observing? Are you trying this on an UP or SMP guest?
> 
> I do see single step mem_events after. I've tried it on a SMP HVM
> Slackware guest. What behaviour am I observing? The gla and gfn values
> are being printed out - but I don't know how to detect a write operation
> based on them.

What more do you want to know?  The gla tells you what the address is
that's being written to.  If you want the rest of the register state &c,
then have a look at either tools/debugger/gdbsx (a full debugger stub
for guests; its maintainer is Mukesh Rathor <mukesh.rathor@oracle.com>)
or tools/xentrace/xenctx.c (which has some code to print registers, read
memory addresses, &c)

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 21:07:29 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 21:07:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeXnm-0006PF-Q0; Fri, 30 Nov 2012 21:07:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72) (envelope-from <tim@xen.org>)
	id 1TeXnl-0006P7-5f
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 21:07:13 +0000
Received: from [85.158.143.35:50486] by server-2.bemta-4.messagelabs.com id
	D7/AF-28922-00029B05; Fri, 30 Nov 2012 21:07:12 +0000
X-Env-Sender: tim@xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1354309629!15794569!1
X-Originating-IP: [81.29.64.94]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27732 invoked from network); 30 Nov 2012 21:07:10 -0000
Received: from ocelot.phlegethon.org (HELO mail.phlegethon.org) (81.29.64.94)
	by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 21:07:10 -0000
Received: from tjd by mail.phlegethon.org with local (Exim 4.67 (FreeBSD))
	(envelope-from <tim@xen.org>)
	id 1TeXng-0000Yb-AF; Fri, 30 Nov 2012 21:07:08 +0000
Date: Fri, 30 Nov 2012 21:07:08 +0000
From: Tim Deegan <tim@xen.org>
To: Razvan Cojocaru <rzvncj@gmail.com>
Message-ID: <20121130210708.GA2013@ocelot.phlegethon.org>
References: <50B77375.9070904@gmail.com> <50B77CB8.1040606@gmail.com>
	<CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
	<50B91273.6050606@gmail.com>
Mime-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B91273.6050606@gmail.com>
User-Agent: Mutt/1.4.2.1i
Cc: jepstein98@gmail.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

At 22:09 +0200 on 30 Nov (1354313363), Razvan Cojocaru wrote:
> > After you set single stepping on for a VCPU and resume, you should see
> > a single step mem_event soon after. What is the behavior that you are
> > observing? Are you trying this on an UP or SMP guest?
> 
> I do see single step mem_events after. I've tried it on a SMP HVM
> Slackware guest. What behaviour am I observing? The gla and gfn values
> are being printed out - but I don't know how to detect a write operation
> based on them.

What more do you want to know?  The gla tells you what the address is
that's being written to.  If you want the rest of the register state &c,
then have a look at either tools/debugger/gdbsx (a full debugger stub
for guests; its maintainer is Mukesh Rathor <mukesh.rathor@oracle.com>)
or tools/xentrace/xenctx.c (which has some code to print registers, read
memory addresses, &c)

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 21:14:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 21:14:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeXuj-0006sR-Ms; Fri, 30 Nov 2012 21:14:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TeXuh-0006sM-LI
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 21:14:23 +0000
Received: from [85.158.138.51:60934] by server-5.bemta-3.messagelabs.com id
	99/40-26311-EA129B05; Fri, 30 Nov 2012 21:14:22 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1354310052!32199532!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.5 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,RCVD_ILLEGAL_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12614 invoked from network); 30 Nov 2012 21:14:12 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 21:14:12 -0000
Received: by mail-ea0-f173.google.com with SMTP id i13so425106eaa.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 13:14:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	bh=HCxpmxsjaxHr0M+9MY6psfJNCP3+zGQEBLqBCHXyvtQ=;
	b=0boLAVt+aVBaste4lbf+6fGwW6YAZPVirdKiQ4JFdllUftFs4ebVjrwEfFBIoB2e9O
	dqwYlETTklGfxy1RpdmzwgM4ncUSg/STIf3CeORno53BYsSMBb6gFGHTPHvGggCKDPnS
	7usByL4RdCZIvi8uk7RU3lVn0axYeLbzRispVgmjjHNkyYgcCy0twa3NDa/fo7ziZ/xY
	jEHaNA8yAYJH5Alz31C6pcnPFFcm4dMAoY5S8Eyg1RaG8VNpWGnmvUImFKd3ho9RET1B
	b6kWX3nusgMZeC9BnWv5B3iFYrqgYLp7q8YH6wceIL0YaIbRcvIz2X4zLBjoKOz5mXVr
	VW5g==
Received: by 10.14.194.4 with SMTP id l4mr8358046een.42.1354310052466;
	Fri, 30 Nov 2012 13:14:12 -0800 (PST)
Received: from [192.168.0.101] (5-14-149-81.residential.rdsnet.ro.
	[5.14.149.81])
	by mx.google.com with ESMTPS id n7sm12944864eeo.2.2012.11.30.13.14.11
	(version=SSLv3 cipher=OTHER); Fri, 30 Nov 2012 13:14:11 -0800 (PST)
Message-ID: <50B921A0.5020205@gmail.com>
Date: Fri, 30 Nov 2012 23:14:08 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.11) Gecko/20121128 Thunderbird/10.0.11
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <50B77375.9070904@gmail.com> <50B77CB8.1040606@gmail.com>
	<CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
	<50B91273.6050606@gmail.com>
	<20121130210708.GA2013@ocelot.phlegethon.org>
In-Reply-To: <20121130210708.GA2013@ocelot.phlegethon.org>
Cc: jepstein98@gmail.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> What more do you want to know?  The gla tells you what the address is
> that's being written to.  If you want the rest of the register state &c,
> then have a look at either tools/debugger/gdbsx (a full debugger stub
> for guests; its maintainer is Mukesh Rathor <mukesh.rathor@oracle.com>)
> or tools/xentrace/xenctx.c (which has some code to print registers, read
> memory addresses, &c)

Excellent. Will look those up.

Thanks,
Razvan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 21:14:40 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 21:14:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeXuj-0006sR-Ms; Fri, 30 Nov 2012 21:14:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <rzvncj@gmail.com>) id 1TeXuh-0006sM-LI
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 21:14:23 +0000
Received: from [85.158.138.51:60934] by server-5.bemta-3.messagelabs.com id
	99/40-26311-EA129B05; Fri, 30 Nov 2012 21:14:22 +0000
X-Env-Sender: rzvncj@gmail.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1354310052!32199532!1
X-Originating-IP: [209.85.215.173]
X-SpamReason: No, hits=0.5 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,RCVD_ILLEGAL_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12614 invoked from network); 30 Nov 2012 21:14:12 -0000
Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com)
	(209.85.215.173)
	by server-4.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 21:14:12 -0000
Received: by mail-ea0-f173.google.com with SMTP id i13so425106eaa.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 13:14:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	bh=HCxpmxsjaxHr0M+9MY6psfJNCP3+zGQEBLqBCHXyvtQ=;
	b=0boLAVt+aVBaste4lbf+6fGwW6YAZPVirdKiQ4JFdllUftFs4ebVjrwEfFBIoB2e9O
	dqwYlETTklGfxy1RpdmzwgM4ncUSg/STIf3CeORno53BYsSMBb6gFGHTPHvGggCKDPnS
	7usByL4RdCZIvi8uk7RU3lVn0axYeLbzRispVgmjjHNkyYgcCy0twa3NDa/fo7ziZ/xY
	jEHaNA8yAYJH5Alz31C6pcnPFFcm4dMAoY5S8Eyg1RaG8VNpWGnmvUImFKd3ho9RET1B
	b6kWX3nusgMZeC9BnWv5B3iFYrqgYLp7q8YH6wceIL0YaIbRcvIz2X4zLBjoKOz5mXVr
	VW5g==
Received: by 10.14.194.4 with SMTP id l4mr8358046een.42.1354310052466;
	Fri, 30 Nov 2012 13:14:12 -0800 (PST)
Received: from [192.168.0.101] (5-14-149-81.residential.rdsnet.ro.
	[5.14.149.81])
	by mx.google.com with ESMTPS id n7sm12944864eeo.2.2012.11.30.13.14.11
	(version=SSLv3 cipher=OTHER); Fri, 30 Nov 2012 13:14:11 -0800 (PST)
Message-ID: <50B921A0.5020205@gmail.com>
Date: Fri, 30 Nov 2012 23:14:08 +0200
From: Razvan Cojocaru <rzvncj@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0.11) Gecko/20121128 Thunderbird/10.0.11
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <50B77375.9070904@gmail.com> <50B77CB8.1040606@gmail.com>
	<CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
	<50B91273.6050606@gmail.com>
	<20121130210708.GA2013@ocelot.phlegethon.org>
In-Reply-To: <20121130210708.GA2013@ocelot.phlegethon.org>
Cc: jepstein98@gmail.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

> What more do you want to know?  The gla tells you what the address is
> that's being written to.  If you want the rest of the register state &c,
> then have a look at either tools/debugger/gdbsx (a full debugger stub
> for guests; its maintainer is Mukesh Rathor <mukesh.rathor@oracle.com>)
> or tools/xentrace/xenctx.c (which has some code to print registers, read
> memory addresses, &c)

Excellent. Will look those up.

Thanks,
Razvan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 21:18:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 21:18:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeXyG-0006zR-Bp; Fri, 30 Nov 2012 21:18:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <apxeng@gmail.com>) id 1TeXyE-0006zL-RZ
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 21:18:03 +0000
Received: from [85.158.139.211:2985] by server-4.bemta-5.messagelabs.com id
	1E/85-15011-A8229B05; Fri, 30 Nov 2012 21:18:02 +0000
X-Env-Sender: apxeng@gmail.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354310280!14354098!1
X-Originating-IP: [209.85.216.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29744 invoked from network); 30 Nov 2012 21:18:01 -0000
Received: from mail-qc0-f173.google.com (HELO mail-qc0-f173.google.com)
	(209.85.216.173)
	by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 21:18:01 -0000
Received: by mail-qc0-f173.google.com with SMTP id b12so580820qca.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 13:18:00 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=BwaAh38LFOHec8l2YDrO815VMUKkNMGai3EkIppPy+I=;
	b=Lcmr2h9QyorO0euLuIs//r1cru2xi2emfAqh4aRjCRatR3FgWMpbFa/ZrkkXvkWp/3
	xCSyX8aPAtgW26KlBBrYXVsZzz20agZgxN078LLpROub2JsjxUUEjU2YRqiCUg7iNa6z
	XN5tMuPs57OTO6XiWl4Zsm835FSajIORIgjEPSU8tnkPH6TZkce8Ku+KitYJgzOmWNM8
	ZgVX87rkIv17plBMKNUn/9lIOW3fW8woYyV5w5VvW4uZo5LbHDr61isnsZkdT+8eYg5b
	WlibqwdG1IEvGq3spAL2CjQ1cR3gijLr5eB1ritMvo++ea4nu0yn6fHtFsqiWnnpkoay
	HUAQ==
MIME-Version: 1.0
Received: by 10.224.189.196 with SMTP id df4mr4992265qab.16.1354310280057;
	Fri, 30 Nov 2012 13:18:00 -0800 (PST)
Received: by 10.49.4.4 with HTTP; Fri, 30 Nov 2012 13:17:59 -0800 (PST)
In-Reply-To: <50B91F69.3040506@gmail.com>
References: <50B77375.9070904@gmail.com> <50B77CB8.1040606@gmail.com>
	<CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
	<50B91273.6050606@gmail.com>
	<CAGU+ausjwgy+NO4RynjrdXyyPrHO6_MqrwXpqYHAOXrr0vmzrg@mail.gmail.com>
	<50B91AE0.1040206@gmail.com>
	<CAGU+autfQNe5V8rZ6z56NXUra2_jcRQmQHwMY454Xk=8dXpV+w@mail.gmail.com>
	<50B91F69.3040506@gmail.com>
Date: Fri, 30 Nov 2012 13:17:59 -0800
Message-ID: <CAGU+ausXSpOtBRjp3XbRNc0Jei+sJ62H9Jh=Mwn_WEHdKtCZ=g@mail.gmail.com>
From: AP <apxeng@gmail.com>
To: Razvan Cojocaru <rzvncj@gmail.com>
Cc: jepstein98@gmail.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 1:04 PM, Razvan Cojocaru <rzvncj@gmail.com> wrote:
>> Not sure what the difference is between first write operation and
>> first write mem_event.
>
> The difference is this: a write operation will only trigger a write
> event for a page marked rx. So if we're in single step mode and a write
> happens on a page marked rwx, this will not trigger a write mem_event.
>
>>> My scenario is this: I'd like to mark _all_ of the domain's pages rw,
>>> then when I get a write mem_event, mark only one page rwx, allow that
>>> write (single stepping), then mark that one page rw again. This would
>>
>> Do you mean rx? If you mark a page rw you will not get a write mem_event for it.
>
> Yes, I meant rx. Sorry (it's late where I'm writing from).
>
>> You could track the EIP and GFN and if you single step more than one
>> instruction you can mark the page RX and stop single stepping. You
>> will get control again on the next write. Though if there are jmp,
>> things could get tricky.
>
> So if I understand you correctly, simply single-stepping for only the
> duration of one MEM_EVENT_REASON_SINGLESTEP, which should be the write
> operation (ignoring the gfn/gla fields of the mem_event), should do the
> trick?

That is correct. Let me know how it goes.

Cheers,
AP

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 21:18:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 21:18:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeXyG-0006zR-Bp; Fri, 30 Nov 2012 21:18:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <apxeng@gmail.com>) id 1TeXyE-0006zL-RZ
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 21:18:03 +0000
Received: from [85.158.139.211:2985] by server-4.bemta-5.messagelabs.com id
	1E/85-15011-A8229B05; Fri, 30 Nov 2012 21:18:02 +0000
X-Env-Sender: apxeng@gmail.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354310280!14354098!1
X-Originating-IP: [209.85.216.173]
X-SpamReason: No, hits=0.3 required=7.0 tests=ML_RADAR_SPEW_LINKS_14,
	RCVD_BY_IP,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29744 invoked from network); 30 Nov 2012 21:18:01 -0000
Received: from mail-qc0-f173.google.com (HELO mail-qc0-f173.google.com)
	(209.85.216.173)
	by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 21:18:01 -0000
Received: by mail-qc0-f173.google.com with SMTP id b12so580820qca.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 13:18:00 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=BwaAh38LFOHec8l2YDrO815VMUKkNMGai3EkIppPy+I=;
	b=Lcmr2h9QyorO0euLuIs//r1cru2xi2emfAqh4aRjCRatR3FgWMpbFa/ZrkkXvkWp/3
	xCSyX8aPAtgW26KlBBrYXVsZzz20agZgxN078LLpROub2JsjxUUEjU2YRqiCUg7iNa6z
	XN5tMuPs57OTO6XiWl4Zsm835FSajIORIgjEPSU8tnkPH6TZkce8Ku+KitYJgzOmWNM8
	ZgVX87rkIv17plBMKNUn/9lIOW3fW8woYyV5w5VvW4uZo5LbHDr61isnsZkdT+8eYg5b
	WlibqwdG1IEvGq3spAL2CjQ1cR3gijLr5eB1ritMvo++ea4nu0yn6fHtFsqiWnnpkoay
	HUAQ==
MIME-Version: 1.0
Received: by 10.224.189.196 with SMTP id df4mr4992265qab.16.1354310280057;
	Fri, 30 Nov 2012 13:18:00 -0800 (PST)
Received: by 10.49.4.4 with HTTP; Fri, 30 Nov 2012 13:17:59 -0800 (PST)
In-Reply-To: <50B91F69.3040506@gmail.com>
References: <50B77375.9070904@gmail.com> <50B77CB8.1040606@gmail.com>
	<CAGU+auuPUkYmccw9TEOut4T9JAxLduvEEMUc_unvnJExYECtEw@mail.gmail.com>
	<50B91273.6050606@gmail.com>
	<CAGU+ausjwgy+NO4RynjrdXyyPrHO6_MqrwXpqYHAOXrr0vmzrg@mail.gmail.com>
	<50B91AE0.1040206@gmail.com>
	<CAGU+autfQNe5V8rZ6z56NXUra2_jcRQmQHwMY454Xk=8dXpV+w@mail.gmail.com>
	<50B91F69.3040506@gmail.com>
Date: Fri, 30 Nov 2012 13:17:59 -0800
Message-ID: <CAGU+ausXSpOtBRjp3XbRNc0Jei+sJ62H9Jh=Mwn_WEHdKtCZ=g@mail.gmail.com>
From: AP <apxeng@gmail.com>
To: Razvan Cojocaru <rzvncj@gmail.com>
Cc: jepstein98@gmail.com, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Mem_event API and MEM_EVENT_REASON_SINGLESTEP
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 1:04 PM, Razvan Cojocaru <rzvncj@gmail.com> wrote:
>> Not sure what the difference is between first write operation and
>> first write mem_event.
>
> The difference is this: a write operation will only trigger a write
> event for a page marked rx. So if we're in single step mode and a write
> happens on a page marked rwx, this will not trigger a write mem_event.
>
>>> My scenario is this: I'd like to mark _all_ of the domain's pages rw,
>>> then when I get a write mem_event, mark only one page rwx, allow that
>>> write (single stepping), then mark that one page rw again. This would
>>
>> Do you mean rx? If you mark a page rw you will not get a write mem_event for it.
>
> Yes, I meant rx. Sorry (it's late where I'm writing from).
>
>> You could track the EIP and GFN and if you single step more than one
>> instruction you can mark the page RX and stop single stepping. You
>> will get control again on the next write. Though if there are jmp,
>> things could get tricky.
>
> So if I understand you correctly, simply single-stepping for only the
> duration of one MEM_EVENT_REASON_SINGLESTEP, which should be the write
> operation (ignoring the gfn/gla fields of the mem_event), should do the
> trick?

That is correct. Let me know how it goes.

Cheers,
AP

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 21:34:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 21:34:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeYDf-0007jN-Vo; Fri, 30 Nov 2012 21:33:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TeYDd-0007jI-H2
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 21:33:58 +0000
Received: from [85.158.139.83:53212] by server-12.bemta-5.messagelabs.com id
	B9/E2-02886-44629B05; Fri, 30 Nov 2012 21:33:56 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1354311230!27877415!1
X-Originating-IP: [209.85.213.41]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12136 invoked from network); 30 Nov 2012 21:33:51 -0000
Received: from mail-yh0-f41.google.com (HELO mail-yh0-f41.google.com)
	(209.85.213.41)
	by server-3.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 21:33:51 -0000
Received: by mail-yh0-f41.google.com with SMTP id 47so168834yhr.28
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 13:33:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=UquN6dEG7CmxfQqy9pmuhjccL4Mvwa+mrBSJnj0G+Do=;
	b=onxYyTGGaaMXucyCBygl1S9tdHO47gGyQp6mBxzW84r5bJkAfrA4uz89TAjyXBbezi
	2h1unTZFcsfCCkhBHILg47jYWqMSjnwZPMjj/AvDckNhSlMmSqnMuZ6AgxFjvS/fniNM
	a+7mHqBPSGntNurKBWQGkylOe35VGuJJNerP2c+G1pFNg0xbE+o4xYMd854hq+FVKsZ5
	qYOrp2TIS2tVtzxPjGMwjUJaHiAez/wHxo9Y+VQD24NmqalZgYfZm4bsOzSR9wkX49UF
	ZDpxyUgKVue6pAq1CF2SroUgYihCqVXG5Yn6YytIDTjBBMKEK6w5MBeiGtFa1COFtFEd
	5Czw==
Received: by 10.236.73.70 with SMTP id u46mr3041681yhd.59.1354311230432;
	Fri, 30 Nov 2012 13:33:50 -0800 (PST)
Received: from phenom.dumpdata.com
	(50-195-21-189-static.hfc.comcastbusiness.net. [50.195.21.189])
	by mx.google.com with ESMTPS id v8sm6094483yhi.15.2012.11.30.13.33.49
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 30 Nov 2012 13:33:49 -0800 (PST)
Date: Fri, 30 Nov 2012 16:33:47 -0500
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Marek Marczykowski <marmarek@invisiblethingslab.com>, ben@guthro.net
Message-ID: <20121130213345.GA4715@phenom.dumpdata.com>
References: <50B7AF8A.5010304@invisiblethingslab.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B7AF8A.5010304@invisiblethingslab.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Only CPU0 active after ACPI S3, xen 4.1.3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 07:55:06PM +0100, Marek Marczykowski wrote:
> Hi all,
> 
> After resume from ACPI S3 system has only CPU0 enabled, every vCPU from every
> domain works on CPU0 [1].  When trying to pin some vCPU to CPU1 got error:
> xl vcpu-pin testvm 1 1
> libxl: error: libxl.c:2565:libxl_set_vcpuaffinity setting vcpu affinity:
> Invalid argument
> 
> What went wrong? How can I reenable CPU1-CPU3?

I think Ben had found some issues with this in the past? CC-ing him
here. 
> 
> System info:
> xen 4.1.3
> linux 3.4.18 with acpi-s3 patches from Konrad's git
> Processor: Intel i5-2520M
> 
> dmesg from dom0 and hypervisor attached.
> 
> BTW Are there any plans to upstream acpi-s3 patches?
> 
> [1] xl vcpu-list:
> Name                                ID  VCPU   CPU State   Time(s) CPU Affinity
> dom0                                 0     0    0   r--    1347.8  any cpu
> dom0                                 0     1    0   -b-     594.4  any cpu
> dom0                                 0     2    0   -b-     421.1  any cpu
> dom0                                 0     3    0   -b-     432.6  any cpu
> netvm                                1     0    0   -b-     596.6  any cpu
> netvm                                1     1    0   -b-     363.7  any cpu
> firewallvm                           2     0    0   -b-     170.5  any cpu
> firewallvm                           2     1    0   -b-     122.5  any cpu
> devel17                              3     0    0   -b-     137.0  any cpu
> devel17                              3     1    0   -b-     112.9  any cpu
> devel17                              3     2    0   -b-      97.9  any cpu
> devel17                              3     3    0   -b-     116.0  any cpu
> vm2                                  4     0    0   -b-     418.6  any cpu
> vm2                                  4     1    0   -b-     390.2  any cpu
> private                              5     0    0   -b-     175.9  any cpu
> private                              5     1    0   -b-     161.6  any cpu
> mail                                 6     0    0   -b-    1587.1  any cpu
> mail                                 6     1    0   -b-    1717.5  any cpu
> testvm                               7     0    0   -b-      73.0  any cpu
> testvm                               7     1    0   -b-      68.9  any cpu
> testvm                               7     2    0   -b-      51.4  any cpu
> testvm                               7     3    0   -b-      67.1  any cpu
> disp1                                8     0    0   -b-     199.9  any cpu
> 
> 
> -- 
> Best Regards / Pozdrawiam,
> Marek Marczykowski
> Invisible Things Lab

> [    0.000000] Initializing cgroup subsys cpuset
> [    0.000000] Initializing cgroup subsys cpu
> [    0.000000] Linux version 3.4.18-2.pvops.qubes.x86_64 (user@nemezis.marmarek.net) (gcc version 4.4.5 20101112 (Red Hat 4.4.5-2) (GCC) ) #1 SMP Wed Nov 7 22:47:21 EST 2012
> [    0.000000] Command line: ro root=/dev/mapper/vg_dom0-lv_root rd_LUKS_UUID=luks-400336fa-c7c4-4be3-a244-c909aa16a18c rd_LVM_LV=vg_dom0/lv_root rd_LVM_LV=vg_dom0/lv_swap rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=pl2 rhgb quiet max_loop=255
> [    0.000000] Freeing  9a-100 pfn range: 102 pages freed
> [    0.000000] 1-1 mapping on 9a->100
> [    0.000000] Freeing  7eea-7f67 pfn range: 125 pages freed
> [    0.000000] 1-1 mapping on 7eea->7f67
> [    0.000000] Freeing  7f70-7f76 pfn range: 6 pages freed
> [    0.000000] 1-1 mapping on 7f70->7f76
> [    0.000000] Freeing  7f78-8000 pfn range: 136 pages freed
> [    0.000000] 1-1 mapping on 7f78->8000
> [    0.000000] Freeing  dffd-e000 pfn range: 3 pages freed
> [    0.000000] 1-1 mapping on dffd->e000
> [    0.000000] Freeing  20000-20200 pfn range: 512 pages freed
> [    0.000000] 1-1 mapping on 20000->20200
> [    0.000000] Freeing  40000-40200 pfn range: 512 pages freed
> [    0.000000] 1-1 mapping on 40000->40200
> [    0.000000] Freeing  c83b4-c840a pfn range: 86 pages freed
> [    0.000000] 1-1 mapping on c83b4->c840a
> [    0.000000] Freeing  c840e-c840f pfn range: 1 pages freed
> [    0.000000] 1-1 mapping on c840e->c840f
> [    0.000000] Freeing  c8411-c8414 pfn range: 3 pages freed
> [    0.000000] 1-1 mapping on c8411->c8414
> [    0.000000] Freeing  c841e-c8428 pfn range: 10 pages freed
> [    0.000000] 1-1 mapping on c841e->c8428
> [    0.000000] Freeing  c8432-c8436 pfn range: 4 pages freed
> [    0.000000] 1-1 mapping on c8432->c8436
> [    0.000000] Freeing  cac00-100000 pfn range: 218112 pages freed
> [    0.000000] 1-1 mapping on cac00->100000
> [    0.000000] Released 219612 pages of unused memory
> [    0.000000] Set 219612 page(s) to 1-1 mapping
> [    0.000000] BIOS-provided physical RAM map:
> [    0.000000]  Xen: 0000000000000000 - 000000000009a000 (usable)
> [    0.000000]  Xen: 000000000009a800 - 0000000000100000 (reserved)
> [    0.000000]  Xen: 0000000000100000 - 0000000007eea000 (usable)
> [    0.000000]  Xen: 0000000007eea000 - 0000000007f67000 (ACPI NVS)
> [    0.000000]  Xen: 0000000007f67000 - 0000000007f70000 (usable)
> [    0.000000]  Xen: 0000000007f70000 - 0000000007f76000 (ACPI NVS)
> [    0.000000]  Xen: 0000000007f76000 - 0000000007f78000 (usable)
> [    0.000000]  Xen: 0000000007f78000 - 0000000008000000 (ACPI NVS)
> [    0.000000]  Xen: 0000000008000000 - 000000000dffd000 (usable)
> [    0.000000]  Xen: 000000000dffd000 - 000000000e000000 (ACPI data)
> [    0.000000]  Xen: 000000000e000000 - 0000000020000000 (usable)
> [    0.000000]  Xen: 0000000020000000 - 0000000020200000 (reserved)
> [    0.000000]  Xen: 0000000020200000 - 0000000040000000 (usable)
> [    0.000000]  Xen: 0000000040000000 - 0000000040200000 (reserved)
> [    0.000000]  Xen: 0000000040200000 - 00000000c83b4000 (usable)
> [    0.000000]  Xen: 00000000c83b4000 - 00000000c840a000 (reserved)
> [    0.000000]  Xen: 00000000c840a000 - 00000000c840e000 (usable)
> [    0.000000]  Xen: 00000000c840e000 - 00000000c840f000 (reserved)
> [    0.000000]  Xen: 00000000c840f000 - 00000000c8411000 (usable)
> [    0.000000]  Xen: 00000000c8411000 - 00000000c8414000 (reserved)
> [    0.000000]  Xen: 00000000c8414000 - 00000000c841e000 (usable)
> [    0.000000]  Xen: 00000000c841e000 - 00000000c8428000 (reserved)
> [    0.000000]  Xen: 00000000c8428000 - 00000000c8432000 (usable)
> [    0.000000]  Xen: 00000000c8432000 - 00000000c8436000 (reserved)
> [    0.000000]  Xen: 00000000c8436000 - 00000000cac00000 (usable)
> [    0.000000]  Xen: 00000000cb800000 - 00000000cfa00000 (reserved)
> [    0.000000]  Xen: 00000000fec00000 - 00000000fec01000 (reserved)
> [    0.000000]  Xen: 00000000fed1c000 - 00000000fed20000 (reserved)
> [    0.000000]  Xen: 00000000fee00000 - 00000000fee01000 (reserved)
> [    0.000000]  Xen: 00000000ffc00000 - 00000000ffc20000 (reserved)
> [    0.000000]  Xen: 0000000100000000 - 000000042e000000 (usable)
> [    0.000000] NX (Execute Disable) protection: active
> [    0.000000] DMI 2.6 present.
> [    0.000000] DMI: Dell Inc. Latitude E6420/0K0DNP, BIOS A13 05/17/2012
> [    0.000000] e820 update range: 0000000000000000 - 0000000000010000 (usable) ==> (reserved)
> [    0.000000] e820 remove range: 00000000000a0000 - 0000000000100000 (usable)
> [    0.000000] No AGP bridge found
> [    0.000000] last_pfn = 0x42e000 max_arch_pfn = 0x400000000
> [    0.000000] x2apic enabled by BIOS, switching to x2apic ops
> [    0.000000] last_pfn = 0xcac00 max_arch_pfn = 0x400000000
> [    0.000000] found SMP MP-table at [ffff8800000f1ad0] f1ad0
> [    0.000000] initial memory mapped : 0 - 04ade000
> [    0.000000] Base memory trampoline at [ffff880000095000] 95000 size 20480
> [    0.000000] init_memory_mapping: 0000000000000000-00000000cac00000
> [    0.000000]  0000000000 - 00cac00000 page 4k
> [    0.000000] kernel direct mapping tables up to 0xcabfffff @ [mem 0x009a5000-0x00ffffff]
> [    0.000000] xen: setting RW the range fc4000 - 1000000
> [    0.000000] init_memory_mapping: 0000000100000000-000000042e000000
> [    0.000000]  0100000000 - 042e000000 page 4k
> [    0.000000] kernel direct mapping tables up to 0x42dffffff @ [mem 0xc9282000-0xcabfffff]
> [    0.000000] xen: setting RW the range cabff000 - cac00000
> [    0.000000] RAMDISK: 01e13000 - 04ade000
> [    0.000000] ACPI: RSDP 00000000000fe300 00024 (v02 DELL  )
> [    0.000000] ACPI: XSDT 000000000dffee18 0007C (v01 DELL    CBX3    06222004 MSFT 00010013)
> [    0.000000] ACPI: FACP 0000000007f90d98 000F4 (v04 DELL    CBX3    06222004 MSFT 00010013)
> [    0.000000] ACPI Warning: 32/64 FACS address mismatch in FADT - two FACS tables! (20120320/tbfadt-378)
> [    0.000000] ACPI Warning: 32/64X FACS address mismatch in FADT - 0x07FEDE40/0x0000000007FEDD40, using 32 (20120320/tbfadt-502)
> [    0.000000] ACPI: DSDT 0000000007f5e018 08834 (v02 INT430 SYSFexxx 00001001 INTL 20090903)
> [    0.000000] ACPI: FACS 0000000007fede40 00040
> [    0.000000] ACPI: APIC 000000000dffdf18 000CC (v02 DELL    CBX3    06222004 MSFT 00010013)
> [    0.000000] ACPI: TCPA 0000000007feed18 00032 (v02                 00000000      00000000)
> [    0.000000] ACPI: SSDT 0000000007f91a98 002F9 (v01 DELLTP      TPM 00003000 INTL 20090903)
> [    0.000000] ACPI: MCFG 0000000007feec98 0003C (v01 DELL   SNDYBRDG 06222004 MSFT 00000097)
> [    0.000000] ACPI: HPET 0000000007feec18 00038 (v01 A M I   PCHHPET 06222004 AMI. 00000003)
> [    0.000000] ACPI: BOOT 0000000007feeb98 00028 (v01 DELL   CBX3     06222004 AMI  00010013)
> [    0.000000] ACPI: SSDT 0000000007f75018 00804 (v01  PmRef  Cpu0Ist 00003000 INTL 20090903)
> [    0.000000] ACPI: SSDT 0000000007f74018 00996 (v01  PmRef    CpuPm 00003000 INTL 20090903)
> [    0.000000] ACPI: XMAR 0000000007f90c18 000E8 (v01 INTEL      SNB  00000001 INTL 00000001)
> [    0.000000] ACPI: SLIC 0000000007f7ec18 00176 (v03 DELL    CBX3    06222004 MSFT 00010013)
> [    0.000000] ACPI: Local APIC address 0xfee00000
> [    0.000000] Setting APIC routing to cluster x2apic.
> [    0.000000] Zone PFN ranges:
> [    0.000000]   DMA      0x00000010 -> 0x00001000
> [    0.000000]   DMA32    0x00001000 -> 0x00100000
> [    0.000000]   Normal   0x00100000 -> 0x0042e000
> [    0.000000] Movable zone start PFN for each node
> [    0.000000] Early memory PFN ranges
> [    0.000000]     0: 0x00000010 -> 0x0000009a
> [    0.000000]     0: 0x00000100 -> 0x00007eea
> [    0.000000]     0: 0x00007f67 -> 0x00007f70
> [    0.000000]     0: 0x00007f76 -> 0x00007f78
> [    0.000000]     0: 0x00008000 -> 0x0000dffd
> [    0.000000]     0: 0x0000e000 -> 0x00020000
> [    0.000000]     0: 0x00020200 -> 0x00040000
> [    0.000000]     0: 0x00040200 -> 0x000c83b4
> [    0.000000]     0: 0x000c840a -> 0x000c840e
> [    0.000000]     0: 0x000c840f -> 0x000c8411
> [    0.000000]     0: 0x000c8414 -> 0x000c841e
> [    0.000000]     0: 0x000c8428 -> 0x000c8432
> [    0.000000]     0: 0x000c8436 -> 0x000cac00
> [    0.000000]     0: 0x00100000 -> 0x0042e000
> [    0.000000] On node 0 totalpages: 4163092
> [    0.000000]   DMA zone: 56 pages used for memmap
> [    0.000000]   DMA zone: 1572 pages reserved
> [    0.000000]   DMA zone: 2350 pages, LIFO batch:0
> [    0.000000]   DMA32 zone: 14280 pages used for memmap
> [    0.000000]   DMA32 zone: 810690 pages, LIFO batch:31
> [    0.000000]   Normal zone: 45584 pages used for memmap
> [    0.000000]   Normal zone: 3288560 pages, LIFO batch:31
> [    0.000000] ACPI: PM-Timer IO Port: 0x408
> [    0.000000] ACPI: Local APIC address 0xfee00000
> [    0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x02] enabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x03] lapic_id[0x01] enabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x05] lapic_id[0x04] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x06] lapic_id[0x05] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x07] lapic_id[0x06] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x08] lapic_id[0x07] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x09] lapic_id[0x08] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x0a] lapic_id[0x09] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x0b] lapic_id[0x0a] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x0c] lapic_id[0x0b] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x0d] lapic_id[0x0c] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x0e] lapic_id[0x0d] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x0f] lapic_id[0x0e] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x10] lapic_id[0x0f] disabled)
> [    0.000000] ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])
> [    0.000000] IOAPIC[0]: apic_id 2, version 253, address 0xfec00000, GSI 0-253
> [    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
> [    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
> [    0.000000] ACPI: IRQ0 used by override.
> [    0.000000] ACPI: IRQ2 used by override.
> [    0.000000] ACPI: IRQ9 used by override.
> [    0.000000] Using ACPI (MADT) for SMP configuration information
> [    0.000000] ACPI: HPET id: 0x8086a701 base: 0xfed00000
> [    0.000000] SMP: Allowing 16 CPUs, 12 hotplug CPUs
> [    0.000000] nr_irqs_gsi: 270
> [    0.000000] Allocating PCI resources starting at cfa00000 (gap: cfa00000:2f200000)
> [    0.000000] Booting paravirtualized kernel on Xen
> [    0.000000] Xen version: 4.1.3 (preserve-AD)
> [    0.000000] setup_percpu: NR_CPUS:512 nr_cpumask_bits:512 nr_cpu_ids:16 nr_node_ids:1
> [    0.000000] PERCPU: Embedded 28 pages/cpu @ffff8803e2800000 s82176 r8192 d24320 u131072
> [    0.000000] pcpu-alloc: s82176 r8192 d24320 u131072 alloc=1*2097152
> [    0.000000] pcpu-alloc: [0] 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 
> [    4.119805] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 4101600
> [    4.119809] Kernel command line: ro root=/dev/mapper/vg_dom0-lv_root rd_LUKS_UUID=luks-400336fa-c7c4-4be3-a244-c909aa16a18c rd_LVM_LV=vg_dom0/lv_root rd_LVM_LV=vg_dom0/lv_swap rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=pl2 rhgb quiet max_loop=255
> [    4.119915] PID hash table entries: 4096 (order: 3, 32768 bytes)
> [    4.120928] Dentry cache hash table entries: 2097152 (order: 12, 16777216 bytes)
> [    4.124018] Inode-cache hash table entries: 1048576 (order: 11, 8388608 bytes)
> [    4.147064] Placing 64MB software IO TLB between ffff8803ce200000 - ffff8803d2200000
> [    4.147066] software IO TLB at phys 0x3ce200000 - 0x3d2200000
> [    4.181675] Memory: 14975940k/17530880k available (4557k kernel code, 878512k absent, 1676428k reserved, 4112k data, 552k init)
> [    4.181730] Hierarchical RCU implementation.
> [    4.181731] 	RCU dyntick-idle grace-period acceleration is enabled.
> [    4.181738] NR_IRQS:33024 nr_irqs:1024 16
> [    4.181799] xen: sci override: global_irq=9 trigger=0 polarity=0
> [    4.181801] xen: registering gsi 9 triggering 0 polarity 0
> [    4.181809] xen: --> pirq=9 -> irq=9 (gsi=9)
> [    4.181829] xen: acpi sci 9
> [    4.181831] xen: --> pirq=1 -> irq=1 (gsi=1)
> [    4.181834] xen: --> pirq=2 -> irq=2 (gsi=2)
> [    4.181836] xen: --> pirq=3 -> irq=3 (gsi=3)
> [    4.181838] xen: --> pirq=4 -> irq=4 (gsi=4)
> [    4.181840] xen: --> pirq=5 -> irq=5 (gsi=5)
> [    4.181843] xen: --> pirq=6 -> irq=6 (gsi=6)
> [    4.181845] xen: --> pirq=7 -> irq=7 (gsi=7)
> [    4.181847] xen: --> pirq=8 -> irq=8 (gsi=8)
> [    4.181849] xen: --> pirq=10 -> irq=10 (gsi=10)
> [    4.181851] xen: --> pirq=11 -> irq=11 (gsi=11)
> [    4.181854] xen: --> pirq=12 -> irq=12 (gsi=12)
> [    4.181856] xen: --> pirq=13 -> irq=13 (gsi=13)
> [    4.181858] xen: --> pirq=14 -> irq=14 (gsi=14)
> [    4.181860] xen: --> pirq=15 -> irq=15 (gsi=15)
> [    4.182986] Console: colour VGA+ 80x25
> [    4.183012] console [tty0] enabled
> [    4.183026] Xen: using vcpuop timer interface
> [    4.183030] installing Xen timer for CPU 0
> [    4.183048] Detected 2494.416 MHz processor.
> [    4.183052] Calibrating delay loop (skipped), value calculated using timer frequency.. 4988.83 BogoMIPS (lpj=9977664)
> [    4.183054] pid_max: default: 32768 minimum: 301
> [    4.183090] Mount-cache hash table entries: 256
> [    4.183222] Initializing cgroup subsys cpuacct
> [    4.183224] Initializing cgroup subsys devices
> [    4.183225] Initializing cgroup subsys freezer
> [    4.183227] Initializing cgroup subsys net_cls
> [    4.183228] Initializing cgroup subsys blkio
> [    4.183280] ENERGY_PERF_BIAS: Set to 'normal', was 'performance'
> [    4.183281] ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)
> [    4.183284] CPU: Physical Processor ID: 0
> [    4.183285] CPU: Processor Core ID: 0
> [    4.184454] ACPI: Core revision 20120320
> [    4.194658] Performance Events: unsupported p6 CPU model 42 no PMU driver, software events only.
> [    4.194796] installing Xen timer for CPU 1
> [    4.194988] installing Xen timer for CPU 2
> [    4.195140] installing Xen timer for CPU 3
> [    4.195232] Brought up 4 CPUs
> [    4.195477] devtmpfs: initialized
> [    4.199046] PM: Registering ACPI NVS region [mem 0x07eea000-0x07f66fff] (512000 bytes)
> [    4.199056] PM: Registering ACPI NVS region [mem 0x07f70000-0x07f75fff] (24576 bytes)
> [    4.199058] PM: Registering ACPI NVS region [mem 0x07f78000-0x07ffffff] (557056 bytes)
> [    4.199069] Dell Latitude E6420 series board detected. Selecting PCI-method for reboots.
> [    4.199104] Grant tables using version 2 layout.
> [    4.199114] Grant table initialized
> [    4.199158] dummy: 
> [    4.199205] RTC time:  1:19:35, date: 11/29/12
> [    4.199256] NET: Registered protocol family 16
> [    4.199465] ACPI FADT declares the system doesn't support PCIe ASPM, so disable it
> [    4.199467] ACPI: bus type pci registered
> [    4.199548] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem 0xf8000000-0xfbffffff] (base 0xf8000000)
> [    4.199550] PCI: not using MMCONFIG
> [    4.199552] PCI: Using configuration type 1 for base access
> [    4.199559] dmi type 0xB1 record - unknown flag
> [    4.200155] bio: create slab <bio-0> at 0
> [    4.200279] ACPI: Added _OSI(Module Device)
> [    4.200280] ACPI: Added _OSI(Processor Device)
> [    4.200282] ACPI: Added _OSI(3.0 _SCP Extensions)
> [    4.200283] ACPI: Added _OSI(Processor Aggregator Device)
> [    4.201815] ACPI: EC: Look up EC in DSDT
> [    4.206932] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignored
> [    4.219266] ACPI: SSDT 00000000c8412798 00727 (v01  PmRef  Cpu0Cst 00003001 INTL 20090903)
> [    4.219654] ACPI: Dynamic OEM Table Load:
> [    4.219657] ACPI: SSDT           (null) 00727 (v01  PmRef  Cpu0Cst 00003001 INTL 20090903)
> [    4.220118] ACPI: SSDT 00000000c8413a98 00303 (v01  PmRef    ApIst 00003000 INTL 20090903)
> [    4.220555] ACPI: Dynamic OEM Table Load:
> [    4.220558] ACPI: SSDT           (null) 00303 (v01  PmRef    ApIst 00003000 INTL 20090903)
> [    4.220754] ACPI: SSDT 00000000c8411d98 00119 (v01  PmRef    ApCst 00003000 INTL 20090903)
> [    4.221136] ACPI: Dynamic OEM Table Load:
> [    4.221138] ACPI: SSDT           (null) 00119 (v01  PmRef    ApCst 00003000 INTL 20090903)
> [    4.223275] ACPI: Interpreter enabled
> [    4.223278] ACPI: (supports S0 S3 S5)
> [    4.223294] ACPI: Using IOAPIC for interrupt routing
> [    4.223322] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem 0xf8000000-0xfbffffff] (base 0xf8000000)
> [    4.223846] PCI: MMCONFIG at [mem 0xf8000000-0xfbffffff] reserved in ACPI motherboard resources
> [    4.271283] ACPI: EC: GPE = 0x10, I/O: command/status = 0x934, data = 0x930
> [    4.272424] ACPI: No dock devices found.
> [    4.272428] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
> [    4.272988] \_SB_.PCI0:_OSC invalid UUID
> [    4.272989] _OSC request data:1 8 1f 
> [    4.272992] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-3e])
> [    4.273994] pci_root PNP0A08:00: host bridge window [io  0x0000-0x0cf7]
> [    4.273996] pci_root PNP0A08:00: host bridge window [io  0x0d00-0xffff]
> [    4.273998] pci_root PNP0A08:00: host bridge window [mem 0x000a0000-0x000bffff]
> [    4.274001] pci_root PNP0A08:00: host bridge window [mem 0xcfa00000-0xfeafffff]
> [    4.274003] pci_root PNP0A08:00: host bridge window [mem 0xfed40000-0xfed44fff]
> [    4.274031] PCI host bridge to bus 0000:00
> [    4.274033] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7]
> [    4.274034] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff]
> [    4.274036] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff]
> [    4.274038] pci_bus 0000:00: root bus resource [mem 0xcfa00000-0xfeafffff]
> [    4.274040] pci_bus 0000:00: root bus resource [mem 0xfed40000-0xfed44fff]
> [    4.274054] pci 0000:00:00.0: [8086:0104] type 00 class 0x060000
> [    4.274147] pci 0000:00:02.0: [8086:0126] type 00 class 0x030000
> [    4.274174] pci 0000:00:02.0: reg 10: [mem 0xe1400000-0xe17fffff 64bit]
> [    4.274189] pci 0000:00:02.0: reg 18: [mem 0xd0000000-0xdfffffff 64bit pref]
> [    4.274200] pci 0000:00:02.0: reg 20: [io  0x4000-0x403f]
> [    4.274344] pci 0000:00:16.0: [8086:1c3a] type 00 class 0x078000
> [    4.274394] pci 0000:00:16.0: reg 10: [mem 0xe2eb0000-0xe2eb000f 64bit]
> [    4.274563] pci 0000:00:16.0: PME# supported from D0 D3hot D3cold
> [    4.274636] pci 0000:00:19.0: [8086:1502] type 00 class 0x020000
> [    4.274681] pci 0000:00:19.0: reg 10: [mem 0xe2e00000-0xe2e1ffff]
> [    4.274700] pci 0000:00:19.0: reg 14: [mem 0xe2e80000-0xe2e80fff]
> [    4.274719] pci 0000:00:19.0: reg 18: [io  0x4080-0x409f]
> [    4.274883] pci 0000:00:19.0: PME# supported from D0 D3hot D3cold
> [    4.274939] pci 0000:00:1a.0: [8086:1c2d] type 00 class 0x0c0320
> [    4.274983] pci 0000:00:1a.0: reg 10: [mem 0xe2e70000-0xe2e703ff]
> [    4.275185] pci 0000:00:1a.0: PME# supported from D0 D3hot D3cold
> [    4.275243] pci 0000:00:1b.0: [8086:1c20] type 00 class 0x040300
> [    4.275278] pci 0000:00:1b.0: reg 10: [mem 0xe2e60000-0xe2e63fff 64bit]
> [    4.275456] pci 0000:00:1b.0: PME# supported from D0 D3hot D3cold
> [    4.275509] pci 0000:00:1c.0: [8086:1c10] type 01 class 0x060400
> [    4.275702] pci 0000:00:1c.0: PME# supported from D0 D3hot D3cold
> [    4.275760] pci 0000:00:1c.1: [8086:1c12] type 01 class 0x060400
> [    4.275953] pci 0000:00:1c.1: PME# supported from D0 D3hot D3cold
> [    4.276011] pci 0000:00:1c.2: [8086:1c14] type 01 class 0x060400
> [    4.276205] pci 0000:00:1c.2: PME# supported from D0 D3hot D3cold
> [    4.276264] pci 0000:00:1c.3: [8086:1c16] type 01 class 0x060400
> [    4.276458] pci 0000:00:1c.3: PME# supported from D0 D3hot D3cold
> [    4.276520] pci 0000:00:1c.5: [8086:1c1a] type 01 class 0x060400
> [    4.276711] pci 0000:00:1c.5: PME# supported from D0 D3hot D3cold
> [    4.276779] pci 0000:00:1d.0: [8086:1c26] type 00 class 0x0c0320
> [    4.276823] pci 0000:00:1d.0: reg 10: [mem 0xe2e50000-0xe2e503ff]
> [    4.277025] pci 0000:00:1d.0: PME# supported from D0 D3hot D3cold
> [    4.277086] pci 0000:00:1f.0: [8086:1c4f] type 00 class 0x060100
> [    4.277341] pci 0000:00:1f.2: [8086:1c03] type 00 class 0x010601
> [    4.277391] pci 0000:00:1f.2: reg 10: [io  0x40d0-0x40d7]
> [    4.277410] pci 0000:00:1f.2: reg 14: [io  0x40c0-0x40c3]
> [    4.277429] pci 0000:00:1f.2: reg 18: [io  0x40b0-0x40b7]
> [    4.277449] pci 0000:00:1f.2: reg 1c: [io  0x40a0-0x40a3]
> [    4.277468] pci 0000:00:1f.2: reg 20: [io  0x4060-0x407f]
> [    4.277486] pci 0000:00:1f.2: reg 24: [mem 0xe2e40000-0xe2e407ff]
> [    4.277613] pci 0000:00:1f.2: PME# supported from D3hot
> [    4.277657] pci 0000:00:1f.3: [8086:1c22] type 00 class 0x0c0500
> [    4.277694] pci 0000:00:1f.3: reg 10: [mem 0xe2e30000-0xe2e300ff 64bit]
> [    4.277749] pci 0000:00:1f.3: reg 20: [io  0x4040-0x405f]
> [    4.277920] pci 0000:00:1c.0: PCI bridge to [bus 01-01]
> [    4.278353] pci 0000:02:00.0: [8086:422b] type 00 class 0x028000
> [    4.278708] pci 0000:02:00.0: reg 10: [mem 0xe2d00000-0xe2d01fff 64bit]
> [    4.280508] pci 0000:02:00.0: PME# supported from D0 D3hot D3cold
> [    4.285361] pci 0000:00:1c.1: PCI bridge to [bus 02-02]
> [    4.285374] pci 0000:00:1c.1:   bridge window [mem 0xe2d00000-0xe2dfffff]
> [    4.285490] pci 0000:00:1c.2: PCI bridge to [bus 03-08]
> [    4.285498] pci 0000:00:1c.2:   bridge window [io  0x3000-0x3fff]
> [    4.285505] pci 0000:00:1c.2:   bridge window [mem 0xe2200000-0xe2bfffff]
> [    4.285517] pci 0000:00:1c.2:   bridge window [mem 0xe0a00000-0xe13fffff 64bit pref]
> [    4.285625] pci 0000:00:1c.3: PCI bridge to [bus 09-09]
> [    4.285632] pci 0000:00:1c.3:   bridge window [io  0x2000-0x2fff]
> [    4.285639] pci 0000:00:1c.3:   bridge window [mem 0xe1800000-0xe21fffff]
> [    4.285651] pci 0000:00:1c.3:   bridge window [mem 0xe0000000-0xe09fffff 64bit pref]
> [    4.285818] pci 0000:0a:00.0: [1217:8221] type 00 class 0x080501
> [    4.285872] pci 0000:0a:00.0: reg 10: [mem 0xe2c20000-0xe2c201ff]
> [    4.286294] pci 0000:0a:00.0: supports D1 D2
> [    4.286295] pci 0000:0a:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> [    4.286432] pci 0000:0a:00.1: [1217:8231] type 00 class 0x018000
> [    4.286486] pci 0000:0a:00.1: reg 10: [mem 0xe2c10000-0xe2c10fff]
> [    4.286563] pci 0000:0a:00.1: reg 18: [mem 0xe2c00000-0xe2c007ff]
> [    4.286908] pci 0000:0a:00.1: supports D1 D2
> [    4.286909] pci 0000:0a:00.1: PME# supported from D0 D1 D2 D3hot D3cold
> [    4.293400] pci 0000:00:1c.5: PCI bridge to [bus 0a-0a]
> [    4.293412] pci 0000:00:1c.5:   bridge window [mem 0xe2c00000-0xe2cfffff]
> [    4.293479] pci_bus 0000:00: on NUMA node 0
> [    4.293483] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
> [    4.293612] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP01._PRT]
> [    4.293647] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP02._PRT]
> [    4.293682] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP04._PRT]
> [    4.293717] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP06._PRT]
> [    4.293762] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP03._PRT]
> [    4.293857] \_SB_.PCI0:_OSC invalid UUID
> [    4.293858] _OSC request data:1 1f 1f 
> [    4.293861]  pci0000:00: Requesting ACPI _OSC control (0x1d)
> [    4.293906] \_SB_.PCI0:_OSC invalid UUID
> [    4.293907] _OSC request data:1 0 1d 
> [    4.293910]  pci0000:00: ACPI _OSC request failed (AE_ERROR), returned control mask: 0x1d
> [    4.293911] ACPI _OSC control for PCIe not granted, disabling ASPM
> [    4.297639] ACPI: PCI Interrupt Link [LNKA] (IRQs 1 3 4 5 6 7 10 12 14 15) *11
> [    4.297702] ACPI: PCI Interrupt Link [LNKB] (IRQs 1 3 4 5 6 7 11 12 14 15) *10
> [    4.297761] ACPI: PCI Interrupt Link [LNKC] (IRQs 1 3 4 5 6 7 10 12 14 15) *11
> [    4.297820] ACPI: PCI Interrupt Link [LNKD] (IRQs 1 3 4 5 6 7 11 12 14 15) *10
> [    4.297878] ACPI: PCI Interrupt Link [LNKE] (IRQs 1 3 4 *5 6 7 10 12 14 15)
> [    4.297937] ACPI: PCI Interrupt Link [LNKF] (IRQs 1 3 4 5 6 7 11 12 14 15) *0, disabled.
> [    4.297996] ACPI: PCI Interrupt Link [LNKG] (IRQs 1 *3 4 5 6 7 10 12 14 15)
> [    4.298054] ACPI: PCI Interrupt Link [LNKH] (IRQs 1 3 4 5 6 7 11 12 14 15) *0, disabled.
> [    4.298087] xen/balloon: Initialising balloon driver.
> [    4.301022] xen-balloon: Initialising balloon driver.
> [    4.301062] xen/balloon: Xen selfballooning driver disabled for domain0.
> [    4.301148] vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
> [    4.301157] vgaarb: loaded
> [    4.301157] vgaarb: bridge control possible 0000:00:02.0
> [    4.301279] PCI: Using ACPI for IRQ routing
> [    4.305930] PCI: pci_cache_line_size set to 64 bytes
> [    4.306106] reserve RAM buffer: 000000000009a000 - 000000000009ffff 
> [    4.306108] reserve RAM buffer: 0000000007eea000 - 0000000007ffffff 
> [    4.306110] reserve RAM buffer: 0000000007f70000 - 0000000007ffffff 
> [    4.306112] reserve RAM buffer: 0000000007f78000 - 0000000007ffffff 
> [    4.306113] reserve RAM buffer: 000000000dffd000 - 000000000fffffff 
> [    4.306115] reserve RAM buffer: 00000000c83b4000 - 00000000cbffffff 
> [    4.306118] reserve RAM buffer: 00000000c840e000 - 00000000cbffffff 
> [    4.306121] reserve RAM buffer: 00000000c8411000 - 00000000cbffffff 
> [    4.306123] reserve RAM buffer: 00000000c841e000 - 00000000cbffffff 
> [    4.306125] reserve RAM buffer: 00000000c8432000 - 00000000cbffffff 
> [    4.306127] reserve RAM buffer: 00000000cac00000 - 00000000cbffffff 
> [    4.306129] reserve RAM buffer: 000000042e000000 - 000000042fffffff 
> [    4.306235] Switching to clocksource xen
> [    4.307726] pnp: PnP ACPI init
> [    4.307738] ACPI: bus type pnp registered
> [    4.308287] pnp 00:00: [bus 00-3e]
> [    4.308289] pnp 00:00: [io  0x0000-0x0cf7 window]
> [    4.308291] pnp 00:00: [io  0x0cf8-0x0cff]
> [    4.308293] pnp 00:00: [io  0x0d00-0xffff window]
> [    4.308295] pnp 00:00: [mem 0x000a0000-0x000bffff window]
> [    4.308296] pnp 00:00: [mem 0x000c0000-0x000c3fff window]
> [    4.308298] pnp 00:00: [mem 0x000c4000-0x000c7fff window]
> [    4.308300] pnp 00:00: [mem 0x000c8000-0x000cbfff window]
> [    4.308301] pnp 00:00: [mem 0x000cc000-0x000cffff window]
> [    4.308303] pnp 00:00: [mem 0x000d0000-0x000d3fff window]
> [    4.308305] pnp 00:00: [mem 0x000d4000-0x000d7fff window]
> [    4.308307] pnp 00:00: [mem 0x000d8000-0x000dbfff window]
> [    4.308309] pnp 00:00: [mem 0x000dc000-0x000dffff window]
> [    4.308310] pnp 00:00: [mem 0x000e0000-0x000e3fff window]
> [    4.308312] pnp 00:00: [mem 0x000e4000-0x000e7fff window]
> [    4.308314] pnp 00:00: [mem 0x000e8000-0x000ebfff window]
> [    4.308315] pnp 00:00: [mem 0x000ec000-0x000effff window]
> [    4.308317] pnp 00:00: [mem 0x000f0000-0x000fffff window]
> [    4.308319] pnp 00:00: [mem 0xcfa00000-0xfeafffff window]
> [    4.308320] pnp 00:00: [mem 0xfed40000-0xfed44fff window]
> [    4.308385] pnp 00:00: Plug and Play ACPI device, IDs PNP0a08 PNP0a03 (active)
> [    4.308398] pnp 00:01: [io  0x0000-0x001f]
> [    4.308400] pnp 00:01: [io  0x0081-0x0091]
> [    4.308401] pnp 00:01: [io  0x0093-0x009f]
> [    4.308403] pnp 00:01: [io  0x00c0-0x00df]
> [    4.308404] pnp 00:01: [dma 4]
> [    4.308422] pnp 00:01: Plug and Play ACPI device, IDs PNP0200 (active)
> [    4.308429] pnp 00:02: [mem 0xff000000-0xffffffff]
> [    4.308445] pnp 00:02: Plug and Play ACPI device, IDs INT0800 (active)
> [    4.308540] pnp 00:03: [mem 0xfed00000-0xfed003ff]
> [    4.308572] system 00:03: [mem 0xfed00000-0xfed003ff] has been reserved
> [    4.308575] system 00:03: Plug and Play ACPI device, IDs PNP0103 PNP0c01 (active)
> [    4.308584] pnp 00:04: [io  0x00f0]
> [    4.308587] xen: registering gsi 13 triggering 1 polarity 0
> [    4.308609] pnp 00:04: [irq 13]
> [    4.308626] pnp 00:04: Plug and Play ACPI device, IDs PNP0c04 (active)
> [    4.308636] pnp 00:05: [io  0x002e-0x002f]
> [    4.308637] pnp 00:05: [io  0x004e-0x004f]
> [    4.308639] pnp 00:05: [io  0x0061]
> [    4.308640] pnp 00:05: [io  0x0063]
> [    4.308641] pnp 00:05: [io  0x0065]
> [    4.308642] pnp 00:05: [io  0x0067]
> [    4.308644] pnp 00:05: [io  0x0070]
> [    4.308645] pnp 00:05: [io  0x0080]
> [    4.308646] pnp 00:05: [io  0x0092]
> [    4.308648] pnp 00:05: [io  0x00b2-0x00b3]
> [    4.308649] pnp 00:05: [io  0x0680-0x069f]
> [    4.308651] pnp 00:05: [io  0x1000-0x100f]
> [    4.308653] pnp 00:05: [io  0xffff]
> [    4.308654] pnp 00:05: [io  0xffff]
> [    4.308655] pnp 00:05: [io  0x0400-0x047f]
> [    4.308656] pnp 00:05: [io  0x0500-0x057f]
> [    4.308658] pnp 00:05: [io  0x164e-0x164f]
> [    4.308689] system 00:05: [io  0x0680-0x069f] has been reserved
> [    4.308691] system 00:05: [io  0x1000-0x100f] has been reserved
> [    4.308693] system 00:05: [io  0xffff] has been reserved
> [    4.308695] system 00:05: [io  0xffff] has been reserved
> [    4.308697] system 00:05: [io  0x0400-0x047f] has been reserved
> [    4.308700] system 00:05: [io  0x0500-0x057f] has been reserved
> [    4.308701] system 00:05: [io  0x164e-0x164f] has been reserved
> [    4.308704] system 00:05: Plug and Play ACPI device, IDs PNP0c02 (active)
> [    4.308711] pnp 00:06: [io  0x0070-0x0077]
> [    4.308713] xen: registering gsi 8 triggering 1 polarity 0
> [    4.308730] pnp 00:06: [irq 8]
> [    4.308749] pnp 00:06: Plug and Play ACPI device, IDs PNP0b00 (active)
> [    4.308758] pnp 00:07: [io  0x0060]
> [    4.308759] pnp 00:07: [io  0x0064]
> [    4.308761] xen: registering gsi 1 triggering 1 polarity 0
> [    4.308777] pnp 00:07: [irq 1]
> [    4.308794] pnp 00:07: Plug and Play ACPI device, IDs PNP0303 (active)
> [    4.309984] pnp 00:08: Plug and Play ACPI device, IDs PNP0401 (disabled)
> [    4.309993] xen: registering gsi 12 triggering 1 polarity 0
> [    4.310011] pnp 00:09: [irq 12]
> [    4.310030] pnp 00:09: Plug and Play ACPI device, IDs DLL0493 PNP0f13 (active)
> [    4.310065] pnp 00:0a: [mem 0xfed40000-0xfed44fff]
> [    4.310086] pnp 00:0a: Plug and Play ACPI device, IDs BCM0102 PNP0c31 (active)
> [    4.310291] pnp 00:0b: [mem 0xfed1c000-0xfed1ffff]
> [    4.310292] pnp 00:0b: [mem 0xfed10000-0xfed17fff]
> [    4.310294] pnp 00:0b: [mem 0xfed18000-0xfed18fff]
> [    4.310296] pnp 00:0b: [mem 0xfed19000-0xfed19fff]
> [    4.310298] pnp 00:0b: [mem 0xf8000000-0xfbffffff]
> [    4.310309] pnp 00:0b: [mem 0xfed20000-0xfed3ffff]
> [    4.310310] pnp 00:0b: [mem 0xfed90000-0xfed93fff]
> [    4.310312] pnp 00:0b: [mem 0xfed45000-0xfed8ffff]
> [    4.310313] pnp 00:0b: [mem 0xff000000-0xffffffff]
> [    4.310315] pnp 00:0b: [mem 0xfee00000-0xfeefffff]
> [    4.310317] pnp 00:0b: [mem 0x00000000-0xffffffffffffffff disabled]
> [    4.310318] pnp 00:0b: [mem 0x00000000-0xffffffffffffffff disabled]
> [    4.310359] system 00:0b: [mem 0xfed1c000-0xfed1ffff] has been reserved
> [    4.310361] system 00:0b: [mem 0xfed10000-0xfed17fff] has been reserved
> [    4.310363] system 00:0b: [mem 0xfed18000-0xfed18fff] has been reserved
> [    4.310365] system 00:0b: [mem 0xfed19000-0xfed19fff] has been reserved
> [    4.310367] system 00:0b: [mem 0xf8000000-0xfbffffff] has been reserved
> [    4.310369] system 00:0b: [mem 0xfed20000-0xfed3ffff] has been reserved
> [    4.310371] system 00:0b: [mem 0xfed90000-0xfed93fff] has been reserved
> [    4.310373] system 00:0b: [mem 0xfed45000-0xfed8ffff] has been reserved
> [    4.310375] system 00:0b: [mem 0xff000000-0xffffffff] could not be reserved
> [    4.310377] system 00:0b: [mem 0xfee00000-0xfeefffff] could not be reserved
> [    4.310380] system 00:0b: Plug and Play ACPI device, IDs PNP0c02 (active)
> [    4.310956] xen: registering gsi 23 triggering 1 polarity 0
> [    4.310967] xen: --> pirq=23 -> irq=23 (gsi=23)
> [    4.310985] pnp 00:0c: [irq 23]
> [    4.311015] pnp 00:0c: Plug and Play ACPI device, IDs SMO8800 (active)
> [    4.315528] pnp 00:0d: [mem 0x20000000-0x201fffff]
> [    4.315531] pnp 00:0d: [mem 0x40000000-0x401fffff]
> [    4.339851] system 00:0d: [mem 0x20000000-0x201fffff] has been reserved
> [    4.339854] system 00:0d: [mem 0x40000000-0x401fffff] has been reserved
> [    4.339857] system 00:0d: Plug and Play ACPI device, IDs PNP0c01 (active)
> [    4.339865] pnp: PnP ACPI: found 14 devices
> [    4.339867] ACPI: ACPI bus type pnp unregistered
> [    4.346178] PM-Timer failed consistency check  (0x0xffffff) - aborting.
> [    4.346274] pci 0000:00:1c.0: PCI bridge to [bus 01-01]
> [    4.346306] pci 0000:00:1c.1: PCI bridge to [bus 02-02]
> [    4.346315] pci 0000:00:1c.1:   bridge window [mem 0xe2d00000-0xe2dfffff]
> [    4.346332] pci 0000:00:1c.2: PCI bridge to [bus 03-08]
> [    4.346336] pci 0000:00:1c.2:   bridge window [io  0x3000-0x3fff]
> [    4.346347] pci 0000:00:1c.2:   bridge window [mem 0xe2200000-0xe2bfffff]
> [    4.346354] pci 0000:00:1c.2:   bridge window [mem 0xe0a00000-0xe13fffff 64bit pref]
> [    4.346366] pci 0000:00:1c.3: PCI bridge to [bus 09-09]
> [    4.346370] pci 0000:00:1c.3:   bridge window [io  0x2000-0x2fff]
> [    4.346379] pci 0000:00:1c.3:   bridge window [mem 0xe1800000-0xe21fffff]
> [    4.346386] pci 0000:00:1c.3:   bridge window [mem 0xe0000000-0xe09fffff 64bit pref]
> [    4.346399] pci 0000:00:1c.5: PCI bridge to [bus 0a-0a]
> [    4.346408] pci 0000:00:1c.5:   bridge window [mem 0xe2c00000-0xe2cfffff]
> [    4.346434] xen: registering gsi 16 triggering 0 polarity 1
> [    4.346442] xen: --> pirq=16 -> irq=16 (gsi=16)
> [    4.346469] xen: registering gsi 17 triggering 0 polarity 1
> [    4.346473] xen: --> pirq=17 -> irq=17 (gsi=17)
> [    4.346498] xen: registering gsi 18 triggering 0 polarity 1
> [    4.346502] xen: --> pirq=18 -> irq=18 (gsi=18)
> [    4.346527] xen: registering gsi 19 triggering 0 polarity 1
> [    4.346531] xen: --> pirq=19 -> irq=19 (gsi=19)
> [    4.346556] xen: registering gsi 17 triggering 0 polarity 1
> [    4.346558] Already setup the GSI :17
> [    4.346563] pci_bus 0000:00: resource 4 [io  0x0000-0x0cf7]
> [    4.346565] pci_bus 0000:00: resource 5 [io  0x0d00-0xffff]
> [    4.346566] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff]
> [    4.346568] pci_bus 0000:00: resource 7 [mem 0xcfa00000-0xfeafffff]
> [    4.346570] pci_bus 0000:00: resource 8 [mem 0xfed40000-0xfed44fff]
> [    4.346572] pci_bus 0000:02: resource 1 [mem 0xe2d00000-0xe2dfffff]
> [    4.346574] pci_bus 0000:03: resource 0 [io  0x3000-0x3fff]
> [    4.346575] pci_bus 0000:03: resource 1 [mem 0xe2200000-0xe2bfffff]
> [    4.346577] pci_bus 0000:03: resource 2 [mem 0xe0a00000-0xe13fffff 64bit pref]
> [    4.346579] pci_bus 0000:09: resource 0 [io  0x2000-0x2fff]
> [    4.346581] pci_bus 0000:09: resource 1 [mem 0xe1800000-0xe21fffff]
> [    4.346582] pci_bus 0000:09: resource 2 [mem 0xe0000000-0xe09fffff 64bit pref]
> [    4.346584] pci_bus 0000:0a: resource 1 [mem 0xe2c00000-0xe2cfffff]
> [    4.346672] NET: Registered protocol family 2
> [    4.346732] IP route cache hash table entries: 524288 (order: 10, 4194304 bytes)
> [    4.347207] TCP established hash table entries: 262144 (order: 10, 4194304 bytes)
> [    4.347753] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
> [    4.347872] TCP: Hash tables configured (established 262144 bind 65536)
> [    4.347874] TCP: reno registered
> [    4.347877] UDP hash table entries: 8192 (order: 6, 262144 bytes)
> [    4.347921] UDP-Lite hash table entries: 8192 (order: 6, 262144 bytes)
> [    4.348067] NET: Registered protocol family 1
> [    4.348085] pci 0000:00:02.0: Boot video device
> [    4.348108] xen: registering gsi 16 triggering 0 polarity 1
> [    4.348112] Already setup the GSI :16
> [    4.348203] xen: registering gsi 17 triggering 0 polarity 1
> [    4.348205] Already setup the GSI :17
> [    4.348298] PCI: CLS 64 bytes, default 64
> [    4.348333] Unpacking initramfs...
> [    4.384265] Freeing initrd memory: 45868k freed
> [    4.392440] Simple Boot Flag at 0xf3 set to 0x1
> [    4.392900] audit: initializing netlink socket (disabled)
> [    4.392911] type=2000 audit(1354151975.383:1): initialized
> [    4.411688] VFS: Disk quotas dquot_6.5.2
> [    4.411715] Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
> [    4.411870] msgmni has been set to 29339
> [    4.412010] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
> [    4.412013] io scheduler noop registered
> [    4.412015] io scheduler deadline registered
> [    4.412036] io scheduler cfq registered (default)
> [    4.412666] intel_idle: does not run on family 6 model 42
> [    4.412741] ACPI: Requesting acpi_cpufreq
> [    4.459643] Non-volatile memory driver v1.3
> [    4.459654] ramoops: platform device not found, using module parameters
> [    4.459670] ramoops: The memory size and the record size must be non-zero
> [    4.459703] ramoops: probe of ramoops failed with error -22
> [    4.474892] loop: module loaded
> [    4.474922] Fixed MDIO Bus: probed
> [    4.474965] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2M] at 0x60,0x64 irq 1,12
> [    4.475166] i8042: Warning: Keylock active
> [    4.476434] serio: i8042 KBD port at 0x60,0x64 irq 1
> [    4.476439] serio: i8042 AUX port at 0x60,0x64 irq 12
> [    4.476551] mousedev: PS/2 mouse device common for all mice
> [    4.476707] rtc_cmos 00:06: RTC can wake from S4
> [    4.476940] rtc_cmos 00:06: rtc core: registered rtc_cmos as rtc0
> [    4.476998] rtc0: alarms up to one year, y3k, 242 bytes nvram
> [    4.477084] device-mapper: uevent: version 1.0.3
> [    4.477193] device-mapper: ioctl: 4.22.0-ioctl (2011-10-19) initialised: dm-devel@redhat.com
> [    4.477281] TCP: cubic registered
> [    4.477381] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
> [    4.477402] NET: Registered protocol family 10
> [    4.477644] Registering the dns_resolver key type
> [    4.477791] registered taskstats version 1
> [    4.478330]   Magic number: 4:584:307
> [    4.478403] tty tty36: hash matches
> [    4.478496] rtc_cmos 00:06: setting system clock to 2012-11-29 01:19:35 UTC (1354151975)
> [    4.478801] Freeing unused kernel memory: 552k freed
> [    4.478847] Write protecting the kernel read-only data: 8192k
> [    4.481908] Freeing unused kernel memory: 1568k freed
> [    4.482112] Freeing unused kernel memory: 24k freed
> [    4.524129] dracut: dracut-005-3.fc13
> [    4.552311] pciback 0000:00:19.0: seizing device
> [    4.552403] pciback 0000:02:00.0: seizing device
> [    4.552941] xen: registering gsi 17 triggering 0 polarity 1
> [    4.552952] Already setup the GSI :17
> [    4.553934] xen: registering gsi 20 triggering 0 polarity 1
> [    4.553964] xen: --> pirq=20 -> irq=20 (gsi=20)
> [    4.554574] xen-pciback: backend is vpci
> [    4.617471] udev: starting version 151
> [    4.617770] udevd (80): /proc/80/oom_adj is deprecated, please use /proc/80/oom_score_adj instead.
> [    4.654916] Linux agpgart interface v0.103
> [    4.655397] input: Lid Switch as /devices/LNXSYSTM:00/device:00/PNP0C0D:00/input/input1
> [    5.051184] ACPI: Lid Switch [LID]
> [    5.051436] input: Power Button as /devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input2
> [    5.051547] ACPI: Power Button [PBTN]
> [    5.051682] input: Sleep Button as /devices/LNXSYSTM:00/device:00/PNP0C0E:00/input/input3
> [    5.051760] ACPI: Sleep Button [SBTN]
> [    5.054141] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input4
> [    5.054421] ACPI: Power Button [PWRF]
> [    5.056887] agpgart-intel 0000:00:00.0: Intel Sandybridge Chipset
> [    5.058118] agpgart-intel 0000:00:00.0: detected gtt size: 2097152K total, 262144K mappable
> [    5.064439] agpgart-intel 0000:00:00.0: detected 65536K stolen memory
> [    5.064916] agpgart-intel 0000:00:00.0: AGP aperture is 256M @ 0xd0000000
> [    5.070296] [drm] Initialized drm 1.1.0 20060810
> [    5.080002] xen: registering gsi 16 triggering 0 polarity 1
> [    5.080015] Already setup the GSI :16
> [    5.080364] i915 0000:00:02.0: setting latency timer to 64
> [    5.190295] [drm] MTRR allocation failed.  Graphics performance may suffer.
> [    5.190491] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
> [    5.190493] [drm] Driver supports precise vblank timestamp query.
> [    5.190554] vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem
> [    5.548301] [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp off
> [    5.591093] input: DualPoint Stick as /devices/platform/i8042/serio1/input/input5
> [    5.606212] input: AlpsPS/2 ALPS DualPoint TouchPad as /devices/platform/i8042/serio1/input/input6
> [    5.806814] fbcon: inteldrmfb (fb0) is primary device
> [    6.095967] Console: switching to colour frame buffer device 200x56
> [    6.101477] fb0: inteldrmfb frame buffer device
> [    6.101478] drm: registered panic notifier
> [    6.130833] acpi device:38: registered as cooling_device4
> [    6.133713] input: Video Bus as /devices/LNXSYSTM:00/device:00/PNP0A08:00/LNXVIDEO:00/input/input7
> [    6.133915] ACPI: Video Device [VID] (multi-head: yes  rom: no  post: no)
> [    6.135082] [drm] Initialized i915 1.6.0 20080730 for 0000:00:02.0 on minor 0
> [    6.185946] dracut: Starting plymouth daemon
> [    6.479391] dracut: rd_NO_DM: removing DM RAID activation
> [    6.489309] dracut: rd_NO_MD: removing MD RAID activation
> [    6.542596] wmi: Mapper loaded
> [    6.564439] usbcore: registered new interface driver usbfs
> [    6.564463] usbcore: registered new interface driver hub
> [    6.568901] SCSI subsystem initialized
> [    6.569574] usbcore: registered new device driver usb
> [    6.570692] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
> [    6.570723] xen: registering gsi 16 triggering 0 polarity 1
> [    6.570728] Already setup the GSI :16
> [    6.570776] ehci_hcd 0000:00:1a.0: setting latency timer to 64
> [    6.570782] ehci_hcd 0000:00:1a.0: EHCI Host Controller
> [    6.570814] ehci_hcd 0000:00:1a.0: new USB bus registered, assigned bus number 1
> [    6.570879] ehci_hcd 0000:00:1a.0: debug port 2
> [    6.573720] libata version 3.00 loaded.
> [    6.574777] ehci_hcd 0000:00:1a.0: cache line size of 64 is not supported
> [    6.574832] ehci_hcd 0000:00:1a.0: irq 16, io mem 0xe2e70000
> [    6.586344] ehci_hcd 0000:00:1a.0: USB 2.0 started, EHCI 1.00
> [    6.586369] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
> [    6.586372] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
> [    6.586375] usb usb1: Product: EHCI Host Controller
> [    6.586376] usb usb1: Manufacturer: Linux 3.4.18-2.pvops.qubes.x86_64 ehci_hcd
> [    6.586378] usb usb1: SerialNumber: 0000:00:1a.0
> [    6.586506] hub 1-0:1.0: USB hub found
> [    6.586511] hub 1-0:1.0: 2 ports detected
> [    6.586604] xen: registering gsi 17 triggering 0 polarity 1
> [    6.586609] Already setup the GSI :17
> [    6.586663] ehci_hcd 0000:00:1d.0: setting latency timer to 64
> [    6.586668] ehci_hcd 0000:00:1d.0: EHCI Host Controller
> [    6.586678] ehci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 2
> [    6.586734] ehci_hcd 0000:00:1d.0: debug port 2
> [    6.590650] ehci_hcd 0000:00:1d.0: cache line size of 64 is not supported
> [    6.590709] ehci_hcd 0000:00:1d.0: irq 17, io mem 0xe2e50000
> [    6.606335] ehci_hcd 0000:00:1d.0: USB 2.0 started, EHCI 1.00
> [    6.606364] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
> [    6.606367] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
> [    6.606370] usb usb2: Product: EHCI Host Controller
> [    6.606371] usb usb2: Manufacturer: Linux 3.4.18-2.pvops.qubes.x86_64 ehci_hcd
> [    6.606373] usb usb2: SerialNumber: 0000:00:1d.0
> [    6.606519] hub 2-0:1.0: USB hub found
> [    6.606524] hub 2-0:1.0: 2 ports detected
> [    6.606620] ahci 0000:00:1f.2: version 3.0
> [    6.606641] xen: registering gsi 18 triggering 0 polarity 1
> [    6.606647] Already setup the GSI :18
> [    6.606896] ahci: SSS flag set, parallel bus scan disabled
> [    6.626400] ahci 0000:00:1f.2: AHCI 0001.0300 32 slots 6 ports 6 Gbps 0x3b impl SATA mode
> [    6.626405] ahci 0000:00:1f.2: flags: 64bit ncq sntf stag pm led clo pio slum part ems sxs apst 
> [    6.626414] ahci 0000:00:1f.2: setting latency timer to 64
> [    6.673732] scsi0 : ahci
> [    6.683363] scsi1 : ahci
> [    6.697268] scsi2 : ahci
> [    6.711526] scsi3 : ahci
> [    6.733931] scsi4 : ahci
> [    6.739603] scsi5 : ahci
> [    6.842106] ata1: SATA max UDMA/133 abar m2048@0xe2e40000 port 0xe2e40100 irq 293
> [    6.842118] ata2: SATA max UDMA/133 abar m2048@0xe2e40000 port 0xe2e40180 irq 293
> [    6.842124] ata3: DUMMY
> [    6.842129] ata4: SATA max UDMA/133 abar m2048@0xe2e40000 port 0xe2e40280 irq 293
> [    6.842136] ata5: SATA max UDMA/133 abar m2048@0xe2e40000 port 0xe2e40300 irq 293
> [    6.842143] ata6: SATA max UDMA/133 abar m2048@0xe2e40000 port 0xe2e40380 irq 293
> [    6.898480] usb 1-1: new high-speed USB device number 2 using ehci_hcd
> [    7.031312] usb 1-1: New USB device found, idVendor=8087, idProduct=0024
> [    7.031323] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
> [    7.032072] hub 1-1:1.0: USB hub found
> [    7.032344] hub 1-1:1.0: 6 ports detected
> [    7.142515] usb 2-1: new high-speed USB device number 2 using ehci_hcd
> [    7.162484] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
> [    7.268594] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by device (Stat=0x51 Err=0x04)
> [    7.268770] ata1.00: ATA-9: KINGSTON SV200S3256G, E111008a, max UDMA/100
> [    7.268778] ata1.00: 500118192 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
> [    7.272554] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by device (Stat=0x51 Err=0x04)
> [    7.272758] ata1.00: configured for UDMA/100
> [    7.273314] scsi 0:0:0:0: Direct-Access     ATA      KINGSTON SV200S3 E111 PQ: 0 ANSI: 5
> [    7.274861] usb 2-1: New USB device found, idVendor=8087, idProduct=0024
> [    7.274870] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
> [    7.275358] hub 2-1:1.0: USB hub found
> [    7.275521] hub 2-1:1.0: 8 ports detected
> [    7.346717] usb 1-1.4: new full-speed USB device number 3 using ehci_hcd
> [    7.443529] usb 1-1.4: New USB device found, idVendor=413c, idProduct=8187
> [    7.443539] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [    7.443546] usb 1-1.4: Product: DW375 Bluetooth Module
> [    7.443550] usb 1-1.4: Manufacturer: Dell Computer Corp
> [    7.443555] usb 1-1.4: SerialNumber: D0DF9A40FE60
> [    7.514736] usb 1-1.5: new high-speed USB device number 4 using ehci_hcd
> [    7.590440] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> [    7.593835] ata2.00: ATAPI: HL-DT-ST DVD+/-RW GU60N, A103, max UDMA/133
> [    7.604147] ata2.00: configured for UDMA/133
> [    7.614746] usb 1-1.5: New USB device found, idVendor=05ca, idProduct=181c
> [    7.614757] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
> [    7.614763] usb 1-1.5: Product: Laptop_Integrated_Webcam_FHD
> [    7.614768] usb 1-1.5: Manufacturer: CN0CJ3P27248717F040SA01
> [    7.618662] scsi 1:0:0:0: CD-ROM            HL-DT-ST DVD+-RW GU60N    A103 PQ: 0 ANSI: 5
> [    7.686581] usb 2-1.6: new high-speed USB device number 3 using ehci_hcd
> [    7.795399] usb 2-1.6: New USB device found, idVendor=413c, idProduct=818d
> [    7.795410] usb 2-1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [    7.795416] usb 2-1.6: Product: DW5550
> [    7.795420] usb 2-1.6: Manufacturer: Dell
> [    7.795425] usb 2-1.6: SerialNumber: 88FA653FDF944970
> [    7.902770] usb 2-1.8: new full-speed USB device number 4 using ehci_hcd
> [    7.938478] ata4: SATA link down (SStatus 0 SControl 300)
> [    8.017319] usb 2-1.8: New USB device found, idVendor=0a5c, idProduct=5801
> [    8.017330] usb 2-1.8: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [    8.017336] usb 2-1.8: Product: 5880
> [    8.017340] usb 2-1.8: Manufacturer: Broadcom Corp
> [    8.017344] usb 2-1.8: SerialNumber: 0123456789ABCD
> [    8.017794] usb 2-1.8: config 0 descriptor??
> [    8.258411] ata5: SATA link down (SStatus 0 SControl 300)
> [    8.578480] ata6: SATA link down (SStatus 0 SControl 300)
> [    8.588630] sd 0:0:0:0: [sda] 500118192 512-byte logical blocks: (256 GB/238 GiB)
> [    8.588846] sd 0:0:0:0: [sda] Write Protect is off
> [    8.588861] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
> [    8.588967] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
> [    8.590122]  sda: sda1 sda2
> [    8.591059] sd 0:0:0:0: [sda] Attached SCSI disk
> [    8.609438] sr0: scsi3-mmc drive: 24x/8x writer dvd-ram cd/rw xa/form2 cdda tray
> [    8.609451] cdrom: Uniform CD-ROM driver Revision: 3.20
> [    8.609737] sr 1:0:0:0: Attached scsi CD-ROM sr0
> [    8.714515] dracut: luksOpen /dev/sda2 luks-400336fa-c7c4-4be3-a244-c909aa16a18c
> [   13.862564] dracut: Scanning devices dm-0  for LVM logical volumes vg_dom0/lv_root vg_dom0/lv_swap 
> [   13.907639] dracut: inactive '/dev/vg_dom0/lv_root' [221.62 GiB] inherit
> [   13.907708] dracut: inactive '/dev/vg_dom0/lv_swap' [16.34 GiB] inherit
> [   14.162684] EXT4-fs (dm-1): INFO: recovery required on readonly filesystem
> [   14.162693] EXT4-fs (dm-1): write access will be enabled during recovery
> [   14.775779] EXT4-fs (dm-1): orphan cleanup on readonly fs
> [   14.775800] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767209
> [   14.775909] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767207
> [   14.776007] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767205
> [   14.776035] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767206
> [   14.776062] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767204
> [   14.776088] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767202
> [   14.776117] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767198
> [   14.776146] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767196
> [   14.776172] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767191
> [   14.776198] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767189
> [   14.776227] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767188
> [   14.776274] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767187
> [   14.777018] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767186
> [   14.777060] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767184
> [   14.777089] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767183
> [   14.777117] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767171
> [   14.777146] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767170
> [   14.777172] EXT4-fs (dm-1): 17 orphan inodes deleted
> [   14.777177] EXT4-fs (dm-1): recovery complete
> [   14.797124] EXT4-fs (dm-1): mounted filesystem with ordered data mode. Opts: (null)
> [   14.806762] dracut: Mounted root filesystem /dev/mapper/vg_dom0-lv_root
> [   14.957211] dracut: Switching root
> [   15.599261] udev: starting version 151
> [   15.673674] iTCO_vendor_support: vendor-support=0
> [   15.676374] mei: module is from the staging directory, the quality is unknown, you have been warned.
> [   15.676488] iTCO_wdt: Intel TCO WatchDog Timer Driver v1.07
> [   15.676679] iTCO_wdt: Found a Cougar Point TCO device (Version=2, TCOBASE=0x0460)
> [   15.676711] xen: registering gsi 16 triggering 0 polarity 1
> [   15.676716] Already setup the GSI :16
> [   15.676725] mei 0000:00:16.0: setting latency timer to 64
> [   15.676754] iTCO_wdt: initialized. heartbeat=30 sec (nowayout=0)
> [   15.712582] sd 0:0:0:0: Attached scsi generic sg0 type 0
> [   15.712620] sr 1:0:0:0: Attached scsi generic sg1 type 5
> [   15.730448] input: PC Speaker as /devices/platform/pcspkr/input/input8
> [   15.734494] xen: registering gsi 18 triggering 0 polarity 1
> [   15.734500] Already setup the GSI :18
> [   15.734506] ACPI Warning: 0x0000000000004040-0x000000000000405f SystemIO conflicts with Region \_SB_.PCI0.SBUS.SMBI 1 (20120320/utaddress-251)
> [   15.734512] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
> [   15.737002] microcode: CPU0 sig=0x206a7, pf=0x10, revision=0x23
> [   15.741412] watchdog: INTCAMT: cannot register miscdev on minor=130 (err=-16)
> [   15.741418] watchdog: error registering /dev/watchdog (err=-16)
> [   15.741422] mei 0000:00:16.0: unable to register watchdog device.
> [   15.790637] thermal LNXTHERM:00: registered as thermal_zone0
> [   15.790641] ACPI: Thermal Zone [THM] (25 C)
> [   15.814551] ACPI: Deprecated procfs I/F for battery is loaded, please retry with CONFIG_ACPI_PROCFS_POWER cleared
> [   15.814559] ACPI: Battery Slot [BAT0] (battery present)
> [   15.815037] ACPI: Deprecated procfs I/F for AC is loaded, please retry with CONFIG_ACPI_PROCFS_POWER cleared
> [   15.815521] ACPI: AC Adapter [AC] (on-line)
> [   15.867835] usbcore: registered new interface driver usbback
> [   15.975826] ACPI: Deprecated procfs I/F for battery is loaded, please retry with CONFIG_ACPI_PROCFS_POWER cleared
> [   15.975836] ACPI: Battery Slot [BAT1] (battery absent)
> [   16.102871] ACPI: Deprecated procfs I/F for battery is loaded, please retry with CONFIG_ACPI_PROCFS_POWER cleared
> [   16.102882] ACPI: Battery Slot [BAT2] (battery absent)
> [   16.106793] sdhci: Secure Digital Host Controller Interface driver
> [   16.106797] sdhci: Copyright(c) Pierre Ossman
> [   16.107131] parport_pc 00:08: [io  0x0378-0x037b]
> [   16.107296] parport_pc 00:08: [irq 5]
> [   16.107709] sdhci-pci 0000:0a:00.0: SDHCI controller found [1217:8221] (rev 5)
> [   16.159148] xen: registering gsi 17 triggering 0 polarity 1
> [   16.159156] Already setup the GSI :17
> [   16.159241] sdhci-pci 0000:0a:00.0: Invalid iomem size. You may experience problems.
> [   16.159319] 0000:0a:00.0 supply vmmc not found, using dummy regulator
> [   16.159384] Registered led device: mmc0::
> [   16.160442] mmc0: SDHCI controller on PCI [0000:0a:00.0] using DMA
> [   16.160928] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> [   16.171737] Linux video capture interface: v2.00
> [   16.192158] cdc_wdm 2-1.6:1.5: cdc-wdm0: USB WDM device
> [   16.192211] cdc_wdm 2-1.6:1.8: cdc-wdm1: USB WDM device
> [   16.192234] usbcore: registered new interface driver cdc_wdm
> [   16.195744] cdc_acm 2-1.6:1.1: ttyACM0: USB ACM device
> [   16.198739] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> [   16.220532] cdc_acm 2-1.6:1.3: ttyACM1: USB ACM device
> [   16.223728] cdc_acm 2-1.6:1.9: ttyACM2: USB ACM device
> [   16.235089] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> [   16.235234] usbcore: registered new interface driver cdc_acm
> [   16.235236] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
> [   16.240235] uvcvideo: Found UVC 1.00 device Laptop_Integrated_Webcam_FHD (05ca:181c)
> [   16.269474] input: Laptop_Integrated_Webcam_FHD as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/input/input9
> [   16.269579] usbcore: registered new interface driver uvcvideo
> [   16.269581] USB Video Class driver (1.1.1)
> [   16.277415] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> [   16.296646] usb 2-1.6: MAC-Address: 02:80:37:ec:02:00
> [   16.296810] cdc_ncm 2-1.6:1.6: usb0: register 'cdc_ncm' at usb-0000:00:1d.0-1.6, CDC NCM, 02:80:37:ec:02:00
> [   16.296847] usbcore: registered new interface driver cdc_ncm
> [   16.310604] parport_pc 00:08: activated
> [   16.310611] parport_pc 00:08: reported by Plug and Play ACPI
> [   16.310781] parport_pc 00:08: disabled
> [   16.311583] tpm_tis 00:0a: 1.2 TPM (device-id 0x2001, rev-id 32)
> [   16.399296] Bluetooth: Core ver 2.16
> [   16.399312] NET: Registered protocol family 31
> [   16.399314] Bluetooth: HCI device and connection manager initialized
> [   16.399317] Bluetooth: HCI socket layer initialized
> [   16.399318] Bluetooth: L2CAP socket layer initialized
> [   16.399325] Bluetooth: SCO socket layer initialized
> [   16.450583] xen: registering gsi 22 triggering 0 polarity 1
> [   16.450600] xen: --> pirq=22 -> irq=22 (gsi=22)
> [   16.567577] usbcore: registered new interface driver btusb
> [   16.739259] dcdbas dcdbas: Dell Systems Management Base Driver (version 5.6.0-3.2)
> [   16.819125] input: Dell WMI hotkeys as /devices/virtual/input/input10
> [   16.925000] microcode: CPU1 sig=0x206a7, pf=0x10, revision=0x23
> [   16.929246] ppdev: user-space parallel port driver
> [   16.954783] microcode: CPU2 sig=0x206a7, pf=0x10, revision=0x23
> [   16.975176] microcode: CPU3 sig=0x206a7, pf=0x10, revision=0x23
> [   17.004696] microcode: Microcode Update Driver: v2.00 <tigran@aivazian.fsnet.co.uk>, Peter Oruba
> [   17.067123] ALSA hda_codec.c:5101 autoconfig: line_outs=1 (0xe/0x0/0x0/0x0/0x0) type:line
> [   17.067127] ALSA hda_codec.c:5105    speaker_outs=1 (0xd/0x0/0x0/0x0/0x0)
> [   17.067129] ALSA hda_codec.c:5109    hp_outs=1 (0xb/0x0/0x0/0x0/0x0)
> [   17.067131] ALSA hda_codec.c:5110    mono: mono_out=0x0
> [   17.067133] ALSA hda_codec.c:5114    inputs:
> [   17.067135] ALSA hda_codec.c:5118  Mic=0xa
> [   17.067137] ALSA hda_codec.c:5118  Dock Mic=0xf
> [   17.067139] ALSA hda_codec.c:5120 
> [   17.067637] ALSA patch_sigmatel.c:3117 stac92xx: dac_nids=1 (0x13/0x0/0x0/0x0/0x0)
> [   17.081104] input: HDA Intel PCH HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input11
> [   17.081194] input: HDA Intel PCH HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input12
> [   17.081250] input: HDA Intel PCH HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input13
> [   17.081342] input: HDA Intel PCH Dock Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input14
> [   17.081432] input: HDA Intel PCH Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input15
> [   17.081522] input: HDA Intel PCH Headphone as /devices/pci0000:00/0000:00:1b.0/sound/card0/input16
> [   17.081610] input: HDA Intel PCH Dock Line Out as /devices/pci0000:00/0000:00:1b.0/sound/card0/input17
> [   17.265462] Event-channel device installed.
> [   17.661764] EXT4-fs (dm-1): re-mounted. Opts: (null)
> [   17.802446] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
> [   19.361631] Adding 17137660k swap on /dev/mapper/vg_dom0-lv_swap.  Priority:-1 extents:1 across:17137660k SS
> [   22.602549] ehci_hcd 0000:00:1a.0: remove, state 1
> [   22.602568] usb usb1: USB disconnect, device number 1
> [   22.602573] usb 1-1: USB disconnect, device number 2
> [   22.602578] usb 1-1.4: USB disconnect, device number 3
> [   22.605235] usb 1-1.5: USB disconnect, device number 4
> [   22.636910] ehci_hcd 0000:00:1a.0: USB bus 1 deregistered
> [   22.637183] pciback 0000:00:1a.0: seizing device
> [   22.637235] xen: registering gsi 16 triggering 0 polarity 1
> [   22.637241] Already setup the GSI :16
> [   22.662363] ehci_hcd 0000:00:1d.0: remove, state 1
> [   22.662371] usb usb2: USB disconnect, device number 1
> [   22.662373] usb 2-1: USB disconnect, device number 2
> [   22.662376] usb 2-1.6: USB disconnect, device number 3
> [   22.668531] cdc_ncm 2-1.6:1.6: usb0: unregister 'cdc_ncm' usb-0000:00:1d.0-1.6, CDC NCM
> [   22.694795] usb 2-1.8: USB disconnect, device number 4
> [   22.699298] ehci_hcd 0000:00:1d.0: USB bus 2 deregistered
> [   22.699577] pciback 0000:00:1d.0: seizing device
> [   22.699632] xen: registering gsi 17 triggering 0 polarity 1
> [   22.699637] Already setup the GSI :17
> [   23.684708] xen-pciback: vpci: 0000:00:19.0: assign to virtual slot 0
> [   23.685240] xen-pciback: vpci: 0000:00:1a.0: assign to virtual slot 1
> [   23.685722] xen-pciback: vpci: 0000:00:1d.0: assign to virtual slot 2
> [   23.686764] xen-pciback: vpci: 0000:02:00.0: assign to virtual slot 3
> [   23.909636] pciback 0000:00:19.0: Driver tried to write to a read-only configuration space field at offset 0xd2, size 2. This may be harmless, but if you have problems with your device:
> [   23.909638] 1) see permissive attribute in sysfs
> [   23.909638] 2) report problems to the xen-devel mailing list along with details of your device obtained from lspci.
> [   23.917523] pciback 0000:02:00.0: Driver tried to write to a read-only configuration space field at offset 0xd2, size 2. This may be harmless, but if you have problems with your device:
> [   23.917526] 1) see permissive attribute in sysfs
> [   23.917526] 2) report problems to the xen-devel mailing list along with details of your device obtained from lspci.
> [   24.123663] xen-blkback:ring-ref 9, event-channel 14, protocol 1 (x86_64-abi)
> [   24.140460] xen-blkback:ring-ref 10, event-channel 15, protocol 1 (x86_64-abi)
> [   24.151420] xen-blkback:ring-ref 11, event-channel 16, protocol 1 (x86_64-abi)
> [   24.158428] xen-blkback:ring-ref 12, event-channel 17, protocol 1 (x86_64-abi)
> [   28.697615] pciback 0000:00:1a.0: enabling device (0000 -> 0002)
> [   28.697628] xen: registering gsi 16 triggering 0 polarity 1
> [   28.697634] Already setup the GSI :16
> [   28.697805] pciback 0000:00:1a.0: setting latency timer to 64
> [   28.713578] pciback 0000:00:19.0: enabling device (0000 -> 0003)
> [   28.713591] xen: registering gsi 20 triggering 0 polarity 1
> [   28.713598] Already setup the GSI :20
> [   28.713858] pciback 0000:00:19.0: setting latency timer to 64
> [   29.021371] pciback 0000:00:1d.0: enabling device (0000 -> 0002)
> [   29.021389] xen: registering gsi 17 triggering 0 polarity 1
> [   29.021400] Already setup the GSI :17
> [   29.021805] pciback 0000:00:1d.0: setting latency timer to 64
> [   29.150053] pciback 0000:02:00.0: enabling device (0000 -> 0002)
> [   29.150122] xen: registering gsi 17 triggering 0 polarity 1
> [   29.150150] Already setup the GSI :17
> [   33.635416] xen-blkback:ring-ref 9, event-channel 14, protocol 1 (x86_64-abi)
> [   33.643330] xen-blkback:ring-ref 10, event-channel 15, protocol 1 (x86_64-abi)
> [   33.651561] xen-blkback:ring-ref 11, event-channel 16, protocol 1 (x86_64-abi)
> [   33.672105] xen-blkback:ring-ref 12, event-channel 17, protocol 1 (x86_64-abi)
> [  104.230911] xen-blkback:ring-ref 9, event-channel 24, protocol 1 (x86_64-abi)
> [  104.252421] xen-blkback:ring-ref 10, event-channel 25, protocol 1 (x86_64-abi)
> [  104.253177] xen-blkback:ring-ref 11, event-channel 26, protocol 1 (x86_64-abi)
> [  104.254220] xen-blkback:ring-ref 12, event-channel 27, protocol 1 (x86_64-abi)
> [  105.086732] xen-blkback:ring-ref 9, event-channel 14, protocol 1 (x86_64-abi)
> [  105.105505] xen-blkback:ring-ref 10, event-channel 15, protocol 1 (x86_64-abi)
> [  105.115951] xen-blkback:ring-ref 11, event-channel 16, protocol 1 (x86_64-abi)
> [  105.127384] xen-blkback:ring-ref 12, event-channel 17, protocol 1 (x86_64-abi)
> [  105.929760] xen-blkback:ring-ref 9, event-channel 14, protocol 1 (x86_64-abi)
> [  105.934841] xen-blkback:ring-ref 10, event-channel 15, protocol 1 (x86_64-abi)
> [  105.973920] xen-blkback:ring-ref 11, event-channel 16, protocol 1 (x86_64-abi)
> [  105.975320] xen-blkback:ring-ref 12, event-channel 17, protocol 1 (x86_64-abi)
> [  107.191781] xen-blkback:ring-ref 9, event-channel 14, protocol 1 (x86_64-abi)
> [  107.203711] xen-blkback:ring-ref 10, event-channel 15, protocol 1 (x86_64-abi)
> [  107.208481] xen-blkback:ring-ref 11, event-channel 16, protocol 1 (x86_64-abi)
> [  107.212081] xen-blkback:ring-ref 12, event-channel 17, protocol 1 (x86_64-abi)
> [  733.434608] PM: Syncing filesystems ... done.
> [  733.436228] PM: Preparing system for mem sleep
> [  733.514803] Freezing user space processes ... (elapsed 0.01 seconds) done.
> [  733.530594] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
> [  733.546589] PM: Entering mem sleep
> [  733.546741] Suspending console(s) (use no_console_suspend to debug)
> [  733.547431] sd 0:0:0:0: [sda] Synchronizing SCSI cache
> [  733.558336] sd 0:0:0:0: [sda] Stopping disk
> [  734.194656] PM: suspend of devices complete after 647.504 msecs
> [  734.195026] PM: late suspend of devices complete after 0.359 msecs
> [  734.210655] PM: noirq suspend of devices complete after 15.614 msecs
> [  734.211326] ACPI: Preparing to enter system sleep state S3
> [  734.235008] PM: Saving platform NVS memory
> [  734.328066] Disabling non-boot CPUs ...
> [  735.945491] ACPI: Low-level resume complete
> [  735.945579] PM: Restoring platform NVS memory
> [  736.000094] Enabling non-boot CPUs ...
> [  736.000256] installing Xen timer for CPU 1
> [  736.004594] CPU1 is up
> [  736.004819] installing Xen timer for CPU 2
> [  736.067516] CPU2 is up
> [  736.067770] installing Xen timer for CPU 3
> [  736.101535] CPU3 is up
> [  736.102470] ACPI: Waking up from system sleep state S3
> [  736.555932] PM: noirq resume of devices complete after 7.970 msecs
> [  736.556506] PM: early resume of devices complete after 0.387 msecs
> [  736.660336] i915 0000:00:02.0: setting latency timer to 64
> [  736.660404] pciback 0000:00:19.0: setting latency timer to 64
> [  736.660453] xen: registering gsi 16 triggering 0 polarity 1
> [  736.660460] Already setup the GSI :16
> [  736.660490] pciback 0000:00:1a.0: setting latency timer to 64
> [  736.660605] xen: registering gsi 17 triggering 0 polarity 1
> [  736.660610] Already setup the GSI :17
> [  736.660641] pciback 0000:00:1d.0: setting latency timer to 64
> [  736.660696] xen: registering gsi 22 triggering 0 polarity 1
> [  736.660701] Already setup the GSI :22
> [  736.661221] ahci 0000:00:1f.2: setting latency timer to 64
> [  736.689606] xen: registering gsi 18 triggering 0 polarity 1
> [  736.689608] Already setup the GSI :18
> [  736.689704] xen: registering gsi 17 triggering 0 polarity 1
> [  736.689706] Already setup the GSI :17
> [  736.711623] [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp off
> [  736.802676] watchdog: INTCAMT: cannot register miscdev on minor=130 (err=-16)
> [  736.802678] watchdog: error registering /dev/watchdog (err=-16)
> [  736.802680] mei 0000:00:16.0: unable to register watchdog device.
> [  737.060106] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> [  737.060330] ata4: SATA link down (SStatus 0 SControl 300)
> [  737.060372] ata5: SATA link down (SStatus 0 SControl 300)
> [  737.074123] ata2.00: configured for UDMA/133
> [  737.117629] ata6: SATA link down (SStatus 0 SControl 300)
> [  738.619036] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
> [  738.743565] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by device (Stat=0x51 Err=0x04)
> [  738.901088] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by device (Stat=0x51 Err=0x04)
> [  738.903441] ata1.00: configured for UDMA/100
> [  738.903843] sd 0:0:0:0: [sda] Starting disk
> [  738.905367] PM: resume of devices complete after 2348.851 msecs
> [  738.905922] PM: Finishing wakeup.
> [  738.905926] Restarting tasks ... done.
> [  738.911334] video LNXVIDEO:00: Restoring backlight state
> [  739.836250] dell_wmi: Received unknown WMI event (0x0)
> [  740.184759] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> [  740.239730] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> [  740.327711] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> [  740.373931] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> [  742.542022] hrtimer: interrupt took 102980031 ns
> [  757.609031] [sched_delayed] sched: RT throttling activated
> [  760.164427] hda-intel: IRQ timing workaround is activated for card #0. Suggest a bigger bdl_pos_adj.

> (XEN) Xen version 4.1.3 (user@marmarek.net) (gcc version 4.4.5 20101112 (Red Hat 4.4.5-2) (GCC) ) Mon Nov 26 15:25:32 EST 2012
> (XEN) Latest ChangeSet: unavailable
> (XEN) Bootloader: GNU GRUB 0.97
> (XEN) Command line: console=none cpufreq=verbose=1
> (XEN) Video information:
> (XEN)  VGA is text mode 80x25, font 8x16
> (XEN)  VBE/DDC methods: V2; EDID transfer time: 1 seconds
> (XEN) Disc information:
> (XEN)  Found 1 MBR signatures
> (XEN)  Found 1 EDD information structures
> (XEN) Xen-e820 RAM map:
> (XEN)  0000000000000000 - 000000000009a800 (usable)
> (XEN)  000000000009a800 - 00000000000a0000 (reserved)
> (XEN)  00000000000e0000 - 0000000000100000 (reserved)
> (XEN)  0000000000100000 - 0000000007eea000 (usable)
> (XEN)  0000000007eea000 - 0000000007f67000 (ACPI NVS)
> (XEN)  0000000007f67000 - 0000000007f70000 (usable)
> (XEN)  0000000007f70000 - 0000000007f76000 (ACPI NVS)
> (XEN)  0000000007f76000 - 0000000007f78000 (usable)
> (XEN)  0000000007f78000 - 0000000008000000 (ACPI NVS)
> (XEN)  0000000008000000 - 000000000dffd000 (usable)
> (XEN)  000000000dffd000 - 000000000e000000 (ACPI data)
> (XEN)  000000000e000000 - 0000000020000000 (usable)
> (XEN)  0000000020000000 - 0000000020200000 (reserved)
> (XEN)  0000000020200000 - 0000000040000000 (usable)
> (XEN)  0000000040000000 - 0000000040200000 (reserved)
> (XEN)  0000000040200000 - 00000000c83b4000 (usable)
> (XEN)  00000000c83b4000 - 00000000c840a000 (reserved)
> (XEN)  00000000c840a000 - 00000000c840e000 (usable)
> (XEN)  00000000c840e000 - 00000000c840f000 (reserved)
> (XEN)  00000000c840f000 - 00000000c8411000 (usable)
> (XEN)  00000000c8411000 - 00000000c8414000 (reserved)
> (XEN)  00000000c8414000 - 00000000c841e000 (usable)
> (XEN)  00000000c841e000 - 00000000c8428000 (reserved)
> (XEN)  00000000c8428000 - 00000000c8432000 (usable)
> (XEN)  00000000c8432000 - 00000000c8436000 (reserved)
> (XEN)  00000000c8436000 - 00000000cac00000 (usable)
> (XEN)  00000000cb800000 - 00000000cfa00000 (reserved)
> (XEN)  00000000fed1c000 - 00000000fed20000 (reserved)
> (XEN)  00000000ffc00000 - 00000000ffc20000 (reserved)
> (XEN)  0000000100000000 - 000000042e000000 (usable)
> (XEN) ACPI: RSDP 000FE300, 0024 (r2 DELL  )
> (XEN) ACPI: XSDT 0DFFEE18, 007C (r1 DELL    CBX3     6222004 MSFT    10013)
> (XEN) ACPI: FACP 07F90D98, 00F4 (r4 DELL    CBX3     6222004 MSFT    10013)
> (XEN) ACPI: DSDT 07F5E018, 8834 (r2 INT430 SYSFexxx     1001 INTL 20090903)
> (XEN) ACPI: FACS 07FEDD40, 0040
> (XEN) ACPI: APIC 0DFFDF18, 00CC (r2 DELL    CBX3     6222004 MSFT    10013)
> (XEN) ACPI: TCPA 07FEED18, 0032 (r2                        0             0)
> (XEN) ACPI: SSDT 07F91A98, 02F9 (r1 DELLTP      TPM     3000 INTL 20090903)
> (XEN) ACPI: MCFG 07FEEC98, 003C (r1 DELL   SNDYBRDG  6222004 MSFT       97)
> (XEN) ACPI: HPET 07FEEC18, 0038 (r1 A M I   PCHHPET  6222004 AMI.        3)
> (XEN) ACPI: BOOT 07FEEB98, 0028 (r1 DELL   CBX3      6222004 AMI     10013)
> (XEN) ACPI: SSDT 07F75018, 0804 (r1  PmRef  Cpu0Ist     3000 INTL 20090903)
> (XEN) ACPI: SSDT 07F74018, 0996 (r1  PmRef    CpuPm     3000 INTL 20090903)
> (XEN) ACPI: DMAR 07F90C18, 00E8 (r1 INTEL      SNB         1 INTL        1)
> (XEN) ACPI: SLIC 07F7EC18, 0176 (r3 DELL    CBX3     6222004 MSFT    10013)
> (XEN) System RAM: 16262MB (16652432kB)
> (XEN) Domain heap initialised
> (XEN) ACPI: 32/64X FACS address mismatch in FADT - 07fede40/0000000007fedd40, using 32
> (XEN) Processor #0 6:10 APIC version 21
> (XEN) Processor #2 6:10 APIC version 21
> (XEN) Processor #1 6:10 APIC version 21
> (XEN) Processor #3 6:10 APIC version 21
> (XEN) IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-23
> (XEN) Enabling APIC mode:  Flat.  Using 1 I/O APICs
> (XEN) Table is not found!
> (XEN) Switched to APIC driver x2apic_cluster.
> (XEN) Using scheduler: SMP Credit Scheduler (credit)
> (XEN) Detected 2494.416 MHz processor.
> (XEN) Initing memory sharing.
> (XEN) Intel VT-d supported page sizes: 4kB.
> (XEN) Intel VT-d supported page sizes: 4kB.
> (XEN) Intel VT-d Snoop Control not enabled.
> (XEN) Intel VT-d Dom0 DMA Passthrough not enabled.
> (XEN) Intel VT-d Queued Invalidation enabled.
> (XEN) Intel VT-d Interrupt Remapping enabled.
> (XEN) Intel VT-d Shared EPT tables not enabled.
> (XEN) I/O virtualisation enabled
> (XEN)  - Dom0 mode: Relaxed
> (XEN) Enabled directed EOI with ioapic_ack_old on!
> (XEN) ENABLING IO-APIC IRQs
> (XEN)  -> Using old ACK method
> (XEN) Platform timer appears to have unexpectedly wrapped 1 times.
> (XEN) Platform timer is 14.318MHz HPET
> (XEN) Allocated console ring of 16 KiB.
> (XEN) VMX: Supported advanced features:
> (XEN)  - APIC MMIO access virtualisation
> (XEN)  - APIC TPR shadow
> (XEN)  - Extended Page Tables (EPT)
> (XEN)  - Virtual-Processor Identifiers (VPID)
> (XEN)  - Virtual NMI
> (XEN)  - MSR direct-access bitmap
> (XEN)  - Unrestricted Guest
> (XEN) HVM: ASIDs enabled.
> (XEN) HVM: VMX enabled
> (XEN) HVM: Hardware Assisted Paging (HAP) detected
> (XEN) HVM: HAP page sizes: 4kB, 2MB
> (XEN) Brought up 4 CPUs
> (XEN) *** LOADING DOMAIN 0 ***
> (XEN)  Xen  kernel: 64-bit, lsb, compat32
> (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x1e13000
> (XEN) PHYSICAL MEMORY ARRANGEMENT:
> (XEN)  Dom0 alloc.:   0000000418000000->000000041c000000 (4046567 pages to be allocated)
> (XEN)  Init. ramdisk: 000000042b335000->000000042dfffc00
> (XEN) VIRTUAL MEMORY ARRANGEMENT:
> (XEN)  Loaded kernel: ffffffff81000000->ffffffff81e13000
> (XEN)  Init. ramdisk: ffffffff81e13000->ffffffff84addc00
> (XEN)  Phys-Mach map: ffffffff84ade000->ffffffff869f3d90
> (XEN)  Start info:    ffffffff869f4000->ffffffff869f44b4
> (XEN)  Page tables:   ffffffff869f5000->ffffffff86a2e000
> (XEN)  Boot stack:    ffffffff86a2e000->ffffffff86a2f000
> (XEN)  TOTAL:         ffffffff80000000->ffffffff86c00000
> (XEN)  ENTRY ADDRESS: ffffffff8188e200
> (XEN) Dom0 has maximum 4 VCPUs
> (XEN) Scrubbing Free RAM: .done.
> (XEN) Xen trace buffers: disabled
> (XEN) Std. Loglevel: Errors and warnings
> (XEN) Guest Loglevel: Nothing (Rate-limited: Errors and warnings)
> (XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to Xen)
> (XEN) Freed 216kB init memory.
> (XEN) no cpu_id for acpi_id 5
> (XEN) no cpu_id for acpi_id 6
> (XEN) no cpu_id for acpi_id 7
> (XEN) no cpu_id for acpi_id 8
> (XEN) physdev.c:171: dom0: wrong map_pirq type 3
> (XEN) traps.c:2488:d1 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc9000057b030.
> (XEN) traps.c:2488:d1 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc90000718030.
> (XEN) traps.c:2488:d2 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc900004f2030.
> (XEN) traps.c:2488:d2 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc900004fa030.
> (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc90000251030.
> (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc90000263030.
> (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc9000026b030.
> (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc90000273030.
> (XEN) traps.c:2488:d4 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc900004f2030.
> (XEN) traps.c:2488:d4 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc90000015030.
> (XEN) traps.c:2488:d5 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc900004f2030.
> (XEN) traps.c:2488:d5 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc90000015030.
> (XEN) traps.c:2488:d6 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc900004f2030.
> (XEN) traps.c:2488:d6 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc900004fa030.
> (XEN) Disabling non-boot CPUs ...
> (XEN) Broke affinity for irq 1
> (XEN) Broke affinity for irq 8
> (XEN) Broke affinity for irq 9
> (XEN) Broke affinity for irq 12
> (XEN) Broke affinity for irq 17
> (XEN) Broke affinity for irq 31
> (XEN) Broke affinity for irq 16
> (XEN) Broke affinity for irq 20
> (XEN) Entering ACPI S3 state.
> (XEN) mce_intel.c:1162: MCA Capability: BCAST 1 SER 0 CMCI 1 firstbank 0 extended MCE MSR 0
> (XEN) CPU0 CMCI LVT vector (0xf7) already installed
> (XEN) CPU0: Thermal LVT vector (0xfa) already installed
> (XEN) Finishing wakeup from ACPI S3 state.
> (XEN) Enabling non-boot CPUs  ...
> (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc90000524030.
> (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc9000052c030.
> (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc90000015030.
> (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc9000001d030.
> (XEN) Dumping timer queues:
> (XEN) CPU00:
> (XEN)   ex=     126us timer=ffff8300c83b0060 cb=ffff82c48011e420(ffff8300c83b0000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=    1778us timer=ffff8304222f9de8 cb=ffff82c480118250(0000000000000000) csched_tick+0x0/0x2e0
> (XEN)   ex=     126us timer=ffff8300c81fc060 cb=ffff82c48011e420(ffff8300c81fc000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   17227us timer=ffff82c4802bb980 cb=ffff82c480138ff0(ffff82c4802bb940) do_dbs_timer+0x0/0x250
> (XEN)   ex=   20744us timer=ffff830030094060 cb=ffff82c48011e420(ffff830030094000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   27945us timer=ffff8304222fdde0 cb=ffff82c480116f20(ffff8304222fddc0) csched_acct+0x0/0x460
> (XEN)   ex=   29949us timer=ffff82c4802bb760 cb=ffff82c48011ded0(0000000000000000) s_timer_fn+0x0/0x20
> (XEN)   ex=   87774us timer=ffff83008db6a060 cb=ffff82c48011e420(ffff83008db6a000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   79252us timer=ffff82c4802b3880 cb=ffff82c480177160(0000000000000000) time_calibration+0x0/0x60
> (XEN)   ex=  703146us timer=ffff8300a6b9c060 cb=ffff82c48011e420(ffff8300a6b9c000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   35612us timer=ffff8300330dc060 cb=ffff82c48011e420(ffff8300330dc000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   97688us timer=ffff8300a6b98060 cb=ffff82c48011e420(ffff8300a6b98000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   30003us timer=ffff8300b129a060 cb=ffff82c48011e420(ffff8300b129a000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   92679us timer=ffff8300c94a6060 cb=ffff82c48011e420(ffff8300c94a6000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex= 4135118us timer=ffff8300bdca6060 cb=ffff82c48011e420(ffff8300bdca6000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   96411us timer=ffff8300b128e060 cb=ffff82c48011e420(ffff8300b128e000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex= 1337866us timer=ffff8300a6b94060 cb=ffff82c48011e420(ffff8300a6b94000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   91194us timer=ffff830034b98060 cb=ffff82c48011e420(ffff830034b98000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   97955us timer=ffff83007d948060 cb=ffff82c48011e420(ffff83007d948000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex= 4135163us timer=ffff8300c5336060 cb=ffff82c48011e420(ffff8300c5336000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=123464409us timer=ffff82c4802b3980 cb=ffff82c480176ef0(0000000000000000) plt_overflow+0x0/0x190
> (XEN)   ex=   95968us timer=ffff8300a6b96060 cb=ffff82c48011e420(ffff8300a6b96000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=12401701us timer=ffff82c4802b65a0 cb=ffff82c48019eb10(0000000000000000) mce_work_fn+0x0/0xd0
> (XEN)   ex=   97804us timer=ffff8300301a8060 cb=ffff82c48011e420(ffff8300301a8000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   97841us timer=ffff8300bd810060 cb=ffff82c48011e420(ffff8300bd810000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   98039us timer=ffff83007d94c060 cb=ffff82c48011e420(ffff83007d94c000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   94727us timer=ffff83008db6e060 cb=ffff82c48011e420(ffff83008db6e000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=  319927us timer=ffff8300c840c060 cb=ffff82c48011e420(ffff8300c840c000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN) CPU01:
> (XEN) CPU02:
> (XEN) CPU03:
> (XEN) 'c' pressed -> printing ACPI Cx structures
> (XEN) ==cpu0==
> (XEN) active state:		C3
> (XEN) max_cstate:		C7
> (XEN) states:
> (XEN)     C1:	type[C1] latency[000] usage[00254665] method[ HALT] duration[62720099833]
> (XEN)     C2:	type[C2] latency[080] usage[00069505] method[SYSIO] duration[36499255195]
> (XEN)    *C3:	type[C3] latency[109] usage[01828952] method[SYSIO] duration[5562126933174]
> (XEN)     C0:	usage[02153122] duration[2042526389598]
> (XEN) PC3[0] PC6[0] PC7[0]
> (XEN) CC3[0] CC6[0]
> (XEN) ==cpu1==
> (XEN) active state:		C1
> (XEN) max_cstate:		C7
> (XEN) states:
> (XEN)    *C1:	type[C1] latency[000] usage[00808027] method[ HALT] duration[6978799306750]
> (XEN)     C0:	usage[00808027] duration[725073398104]
> (XEN) PC3[0] PC6[0] PC7[0]
> (XEN) CC3[0] CC6[0]
> (XEN) ==cpu2==
> (XEN) active state:		C1
> (XEN) max_cstate:		C7
> (XEN) states:
> (XEN)    *C1:	type[C1] latency[000] usage[00825022] method[ HALT] duration[6981527416097]
> (XEN)     C0:	usage[00825022] duration[722345319882]
> (XEN) PC3[0] PC6[0] PC7[0]
> (XEN) CC3[0] CC6[0]
> (XEN) ==cpu3==
> (XEN) active state:		C1
> (XEN) max_cstate:		C7
> (XEN) states:
> (XEN)    *C1:	type[C1] latency[000] usage[00810292] method[ HALT] duration[6980835907857]
> (XEN)     C0:	usage[00810292] duration[723036844779]
> (XEN) PC3[0] PC6[0] PC7[0]
> (XEN) CC3[0] CC6[0]




> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 21:34:17 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 21:34:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeYDf-0007jN-Vo; Fri, 30 Nov 2012 21:33:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ketuzsezr@gmail.com>) id 1TeYDd-0007jI-H2
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 21:33:58 +0000
Received: from [85.158.139.83:53212] by server-12.bemta-5.messagelabs.com id
	B9/E2-02886-44629B05; Fri, 30 Nov 2012 21:33:56 +0000
X-Env-Sender: ketuzsezr@gmail.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1354311230!27877415!1
X-Originating-IP: [209.85.213.41]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12136 invoked from network); 30 Nov 2012 21:33:51 -0000
Received: from mail-yh0-f41.google.com (HELO mail-yh0-f41.google.com)
	(209.85.213.41)
	by server-3.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 21:33:51 -0000
Received: by mail-yh0-f41.google.com with SMTP id 47so168834yhr.28
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 13:33:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=UquN6dEG7CmxfQqy9pmuhjccL4Mvwa+mrBSJnj0G+Do=;
	b=onxYyTGGaaMXucyCBygl1S9tdHO47gGyQp6mBxzW84r5bJkAfrA4uz89TAjyXBbezi
	2h1unTZFcsfCCkhBHILg47jYWqMSjnwZPMjj/AvDckNhSlMmSqnMuZ6AgxFjvS/fniNM
	a+7mHqBPSGntNurKBWQGkylOe35VGuJJNerP2c+G1pFNg0xbE+o4xYMd854hq+FVKsZ5
	qYOrp2TIS2tVtzxPjGMwjUJaHiAez/wHxo9Y+VQD24NmqalZgYfZm4bsOzSR9wkX49UF
	ZDpxyUgKVue6pAq1CF2SroUgYihCqVXG5Yn6YytIDTjBBMKEK6w5MBeiGtFa1COFtFEd
	5Czw==
Received: by 10.236.73.70 with SMTP id u46mr3041681yhd.59.1354311230432;
	Fri, 30 Nov 2012 13:33:50 -0800 (PST)
Received: from phenom.dumpdata.com
	(50-195-21-189-static.hfc.comcastbusiness.net. [50.195.21.189])
	by mx.google.com with ESMTPS id v8sm6094483yhi.15.2012.11.30.13.33.49
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 30 Nov 2012 13:33:49 -0800 (PST)
Date: Fri, 30 Nov 2012 16:33:47 -0500
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Marek Marczykowski <marmarek@invisiblethingslab.com>, ben@guthro.net
Message-ID: <20121130213345.GA4715@phenom.dumpdata.com>
References: <50B7AF8A.5010304@invisiblethingslab.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <50B7AF8A.5010304@invisiblethingslab.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Only CPU0 active after ACPI S3, xen 4.1.3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Thu, Nov 29, 2012 at 07:55:06PM +0100, Marek Marczykowski wrote:
> Hi all,
> 
> After resume from ACPI S3 system has only CPU0 enabled, every vCPU from every
> domain works on CPU0 [1].  When trying to pin some vCPU to CPU1 got error:
> xl vcpu-pin testvm 1 1
> libxl: error: libxl.c:2565:libxl_set_vcpuaffinity setting vcpu affinity:
> Invalid argument
> 
> What went wrong? How can I reenable CPU1-CPU3?

I think Ben had found some issues with this in the past? CC-ing him
here. 
> 
> System info:
> xen 4.1.3
> linux 3.4.18 with acpi-s3 patches from Konrad's git
> Processor: Intel i5-2520M
> 
> dmesg from dom0 and hypervisor attached.
> 
> BTW Are there any plans to upstream acpi-s3 patches?
> 
> [1] xl vcpu-list:
> Name                                ID  VCPU   CPU State   Time(s) CPU Affinity
> dom0                                 0     0    0   r--    1347.8  any cpu
> dom0                                 0     1    0   -b-     594.4  any cpu
> dom0                                 0     2    0   -b-     421.1  any cpu
> dom0                                 0     3    0   -b-     432.6  any cpu
> netvm                                1     0    0   -b-     596.6  any cpu
> netvm                                1     1    0   -b-     363.7  any cpu
> firewallvm                           2     0    0   -b-     170.5  any cpu
> firewallvm                           2     1    0   -b-     122.5  any cpu
> devel17                              3     0    0   -b-     137.0  any cpu
> devel17                              3     1    0   -b-     112.9  any cpu
> devel17                              3     2    0   -b-      97.9  any cpu
> devel17                              3     3    0   -b-     116.0  any cpu
> vm2                                  4     0    0   -b-     418.6  any cpu
> vm2                                  4     1    0   -b-     390.2  any cpu
> private                              5     0    0   -b-     175.9  any cpu
> private                              5     1    0   -b-     161.6  any cpu
> mail                                 6     0    0   -b-    1587.1  any cpu
> mail                                 6     1    0   -b-    1717.5  any cpu
> testvm                               7     0    0   -b-      73.0  any cpu
> testvm                               7     1    0   -b-      68.9  any cpu
> testvm                               7     2    0   -b-      51.4  any cpu
> testvm                               7     3    0   -b-      67.1  any cpu
> disp1                                8     0    0   -b-     199.9  any cpu
> 
> 
> -- 
> Best Regards / Pozdrawiam,
> Marek Marczykowski
> Invisible Things Lab

> [    0.000000] Initializing cgroup subsys cpuset
> [    0.000000] Initializing cgroup subsys cpu
> [    0.000000] Linux version 3.4.18-2.pvops.qubes.x86_64 (user@nemezis.marmarek.net) (gcc version 4.4.5 20101112 (Red Hat 4.4.5-2) (GCC) ) #1 SMP Wed Nov 7 22:47:21 EST 2012
> [    0.000000] Command line: ro root=/dev/mapper/vg_dom0-lv_root rd_LUKS_UUID=luks-400336fa-c7c4-4be3-a244-c909aa16a18c rd_LVM_LV=vg_dom0/lv_root rd_LVM_LV=vg_dom0/lv_swap rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=pl2 rhgb quiet max_loop=255
> [    0.000000] Freeing  9a-100 pfn range: 102 pages freed
> [    0.000000] 1-1 mapping on 9a->100
> [    0.000000] Freeing  7eea-7f67 pfn range: 125 pages freed
> [    0.000000] 1-1 mapping on 7eea->7f67
> [    0.000000] Freeing  7f70-7f76 pfn range: 6 pages freed
> [    0.000000] 1-1 mapping on 7f70->7f76
> [    0.000000] Freeing  7f78-8000 pfn range: 136 pages freed
> [    0.000000] 1-1 mapping on 7f78->8000
> [    0.000000] Freeing  dffd-e000 pfn range: 3 pages freed
> [    0.000000] 1-1 mapping on dffd->e000
> [    0.000000] Freeing  20000-20200 pfn range: 512 pages freed
> [    0.000000] 1-1 mapping on 20000->20200
> [    0.000000] Freeing  40000-40200 pfn range: 512 pages freed
> [    0.000000] 1-1 mapping on 40000->40200
> [    0.000000] Freeing  c83b4-c840a pfn range: 86 pages freed
> [    0.000000] 1-1 mapping on c83b4->c840a
> [    0.000000] Freeing  c840e-c840f pfn range: 1 pages freed
> [    0.000000] 1-1 mapping on c840e->c840f
> [    0.000000] Freeing  c8411-c8414 pfn range: 3 pages freed
> [    0.000000] 1-1 mapping on c8411->c8414
> [    0.000000] Freeing  c841e-c8428 pfn range: 10 pages freed
> [    0.000000] 1-1 mapping on c841e->c8428
> [    0.000000] Freeing  c8432-c8436 pfn range: 4 pages freed
> [    0.000000] 1-1 mapping on c8432->c8436
> [    0.000000] Freeing  cac00-100000 pfn range: 218112 pages freed
> [    0.000000] 1-1 mapping on cac00->100000
> [    0.000000] Released 219612 pages of unused memory
> [    0.000000] Set 219612 page(s) to 1-1 mapping
> [    0.000000] BIOS-provided physical RAM map:
> [    0.000000]  Xen: 0000000000000000 - 000000000009a000 (usable)
> [    0.000000]  Xen: 000000000009a800 - 0000000000100000 (reserved)
> [    0.000000]  Xen: 0000000000100000 - 0000000007eea000 (usable)
> [    0.000000]  Xen: 0000000007eea000 - 0000000007f67000 (ACPI NVS)
> [    0.000000]  Xen: 0000000007f67000 - 0000000007f70000 (usable)
> [    0.000000]  Xen: 0000000007f70000 - 0000000007f76000 (ACPI NVS)
> [    0.000000]  Xen: 0000000007f76000 - 0000000007f78000 (usable)
> [    0.000000]  Xen: 0000000007f78000 - 0000000008000000 (ACPI NVS)
> [    0.000000]  Xen: 0000000008000000 - 000000000dffd000 (usable)
> [    0.000000]  Xen: 000000000dffd000 - 000000000e000000 (ACPI data)
> [    0.000000]  Xen: 000000000e000000 - 0000000020000000 (usable)
> [    0.000000]  Xen: 0000000020000000 - 0000000020200000 (reserved)
> [    0.000000]  Xen: 0000000020200000 - 0000000040000000 (usable)
> [    0.000000]  Xen: 0000000040000000 - 0000000040200000 (reserved)
> [    0.000000]  Xen: 0000000040200000 - 00000000c83b4000 (usable)
> [    0.000000]  Xen: 00000000c83b4000 - 00000000c840a000 (reserved)
> [    0.000000]  Xen: 00000000c840a000 - 00000000c840e000 (usable)
> [    0.000000]  Xen: 00000000c840e000 - 00000000c840f000 (reserved)
> [    0.000000]  Xen: 00000000c840f000 - 00000000c8411000 (usable)
> [    0.000000]  Xen: 00000000c8411000 - 00000000c8414000 (reserved)
> [    0.000000]  Xen: 00000000c8414000 - 00000000c841e000 (usable)
> [    0.000000]  Xen: 00000000c841e000 - 00000000c8428000 (reserved)
> [    0.000000]  Xen: 00000000c8428000 - 00000000c8432000 (usable)
> [    0.000000]  Xen: 00000000c8432000 - 00000000c8436000 (reserved)
> [    0.000000]  Xen: 00000000c8436000 - 00000000cac00000 (usable)
> [    0.000000]  Xen: 00000000cb800000 - 00000000cfa00000 (reserved)
> [    0.000000]  Xen: 00000000fec00000 - 00000000fec01000 (reserved)
> [    0.000000]  Xen: 00000000fed1c000 - 00000000fed20000 (reserved)
> [    0.000000]  Xen: 00000000fee00000 - 00000000fee01000 (reserved)
> [    0.000000]  Xen: 00000000ffc00000 - 00000000ffc20000 (reserved)
> [    0.000000]  Xen: 0000000100000000 - 000000042e000000 (usable)
> [    0.000000] NX (Execute Disable) protection: active
> [    0.000000] DMI 2.6 present.
> [    0.000000] DMI: Dell Inc. Latitude E6420/0K0DNP, BIOS A13 05/17/2012
> [    0.000000] e820 update range: 0000000000000000 - 0000000000010000 (usable) ==> (reserved)
> [    0.000000] e820 remove range: 00000000000a0000 - 0000000000100000 (usable)
> [    0.000000] No AGP bridge found
> [    0.000000] last_pfn = 0x42e000 max_arch_pfn = 0x400000000
> [    0.000000] x2apic enabled by BIOS, switching to x2apic ops
> [    0.000000] last_pfn = 0xcac00 max_arch_pfn = 0x400000000
> [    0.000000] found SMP MP-table at [ffff8800000f1ad0] f1ad0
> [    0.000000] initial memory mapped : 0 - 04ade000
> [    0.000000] Base memory trampoline at [ffff880000095000] 95000 size 20480
> [    0.000000] init_memory_mapping: 0000000000000000-00000000cac00000
> [    0.000000]  0000000000 - 00cac00000 page 4k
> [    0.000000] kernel direct mapping tables up to 0xcabfffff @ [mem 0x009a5000-0x00ffffff]
> [    0.000000] xen: setting RW the range fc4000 - 1000000
> [    0.000000] init_memory_mapping: 0000000100000000-000000042e000000
> [    0.000000]  0100000000 - 042e000000 page 4k
> [    0.000000] kernel direct mapping tables up to 0x42dffffff @ [mem 0xc9282000-0xcabfffff]
> [    0.000000] xen: setting RW the range cabff000 - cac00000
> [    0.000000] RAMDISK: 01e13000 - 04ade000
> [    0.000000] ACPI: RSDP 00000000000fe300 00024 (v02 DELL  )
> [    0.000000] ACPI: XSDT 000000000dffee18 0007C (v01 DELL    CBX3    06222004 MSFT 00010013)
> [    0.000000] ACPI: FACP 0000000007f90d98 000F4 (v04 DELL    CBX3    06222004 MSFT 00010013)
> [    0.000000] ACPI Warning: 32/64 FACS address mismatch in FADT - two FACS tables! (20120320/tbfadt-378)
> [    0.000000] ACPI Warning: 32/64X FACS address mismatch in FADT - 0x07FEDE40/0x0000000007FEDD40, using 32 (20120320/tbfadt-502)
> [    0.000000] ACPI: DSDT 0000000007f5e018 08834 (v02 INT430 SYSFexxx 00001001 INTL 20090903)
> [    0.000000] ACPI: FACS 0000000007fede40 00040
> [    0.000000] ACPI: APIC 000000000dffdf18 000CC (v02 DELL    CBX3    06222004 MSFT 00010013)
> [    0.000000] ACPI: TCPA 0000000007feed18 00032 (v02                 00000000      00000000)
> [    0.000000] ACPI: SSDT 0000000007f91a98 002F9 (v01 DELLTP      TPM 00003000 INTL 20090903)
> [    0.000000] ACPI: MCFG 0000000007feec98 0003C (v01 DELL   SNDYBRDG 06222004 MSFT 00000097)
> [    0.000000] ACPI: HPET 0000000007feec18 00038 (v01 A M I   PCHHPET 06222004 AMI. 00000003)
> [    0.000000] ACPI: BOOT 0000000007feeb98 00028 (v01 DELL   CBX3     06222004 AMI  00010013)
> [    0.000000] ACPI: SSDT 0000000007f75018 00804 (v01  PmRef  Cpu0Ist 00003000 INTL 20090903)
> [    0.000000] ACPI: SSDT 0000000007f74018 00996 (v01  PmRef    CpuPm 00003000 INTL 20090903)
> [    0.000000] ACPI: XMAR 0000000007f90c18 000E8 (v01 INTEL      SNB  00000001 INTL 00000001)
> [    0.000000] ACPI: SLIC 0000000007f7ec18 00176 (v03 DELL    CBX3    06222004 MSFT 00010013)
> [    0.000000] ACPI: Local APIC address 0xfee00000
> [    0.000000] Setting APIC routing to cluster x2apic.
> [    0.000000] Zone PFN ranges:
> [    0.000000]   DMA      0x00000010 -> 0x00001000
> [    0.000000]   DMA32    0x00001000 -> 0x00100000
> [    0.000000]   Normal   0x00100000 -> 0x0042e000
> [    0.000000] Movable zone start PFN for each node
> [    0.000000] Early memory PFN ranges
> [    0.000000]     0: 0x00000010 -> 0x0000009a
> [    0.000000]     0: 0x00000100 -> 0x00007eea
> [    0.000000]     0: 0x00007f67 -> 0x00007f70
> [    0.000000]     0: 0x00007f76 -> 0x00007f78
> [    0.000000]     0: 0x00008000 -> 0x0000dffd
> [    0.000000]     0: 0x0000e000 -> 0x00020000
> [    0.000000]     0: 0x00020200 -> 0x00040000
> [    0.000000]     0: 0x00040200 -> 0x000c83b4
> [    0.000000]     0: 0x000c840a -> 0x000c840e
> [    0.000000]     0: 0x000c840f -> 0x000c8411
> [    0.000000]     0: 0x000c8414 -> 0x000c841e
> [    0.000000]     0: 0x000c8428 -> 0x000c8432
> [    0.000000]     0: 0x000c8436 -> 0x000cac00
> [    0.000000]     0: 0x00100000 -> 0x0042e000
> [    0.000000] On node 0 totalpages: 4163092
> [    0.000000]   DMA zone: 56 pages used for memmap
> [    0.000000]   DMA zone: 1572 pages reserved
> [    0.000000]   DMA zone: 2350 pages, LIFO batch:0
> [    0.000000]   DMA32 zone: 14280 pages used for memmap
> [    0.000000]   DMA32 zone: 810690 pages, LIFO batch:31
> [    0.000000]   Normal zone: 45584 pages used for memmap
> [    0.000000]   Normal zone: 3288560 pages, LIFO batch:31
> [    0.000000] ACPI: PM-Timer IO Port: 0x408
> [    0.000000] ACPI: Local APIC address 0xfee00000
> [    0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x02] enabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x03] lapic_id[0x01] enabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x05] lapic_id[0x04] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x06] lapic_id[0x05] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x07] lapic_id[0x06] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x08] lapic_id[0x07] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x09] lapic_id[0x08] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x0a] lapic_id[0x09] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x0b] lapic_id[0x0a] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x0c] lapic_id[0x0b] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x0d] lapic_id[0x0c] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x0e] lapic_id[0x0d] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x0f] lapic_id[0x0e] disabled)
> [    0.000000] ACPI: LAPIC (acpi_id[0x10] lapic_id[0x0f] disabled)
> [    0.000000] ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])
> [    0.000000] IOAPIC[0]: apic_id 2, version 253, address 0xfec00000, GSI 0-253
> [    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
> [    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
> [    0.000000] ACPI: IRQ0 used by override.
> [    0.000000] ACPI: IRQ2 used by override.
> [    0.000000] ACPI: IRQ9 used by override.
> [    0.000000] Using ACPI (MADT) for SMP configuration information
> [    0.000000] ACPI: HPET id: 0x8086a701 base: 0xfed00000
> [    0.000000] SMP: Allowing 16 CPUs, 12 hotplug CPUs
> [    0.000000] nr_irqs_gsi: 270
> [    0.000000] Allocating PCI resources starting at cfa00000 (gap: cfa00000:2f200000)
> [    0.000000] Booting paravirtualized kernel on Xen
> [    0.000000] Xen version: 4.1.3 (preserve-AD)
> [    0.000000] setup_percpu: NR_CPUS:512 nr_cpumask_bits:512 nr_cpu_ids:16 nr_node_ids:1
> [    0.000000] PERCPU: Embedded 28 pages/cpu @ffff8803e2800000 s82176 r8192 d24320 u131072
> [    0.000000] pcpu-alloc: s82176 r8192 d24320 u131072 alloc=1*2097152
> [    0.000000] pcpu-alloc: [0] 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 
> [    4.119805] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 4101600
> [    4.119809] Kernel command line: ro root=/dev/mapper/vg_dom0-lv_root rd_LUKS_UUID=luks-400336fa-c7c4-4be3-a244-c909aa16a18c rd_LVM_LV=vg_dom0/lv_root rd_LVM_LV=vg_dom0/lv_swap rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=pl2 rhgb quiet max_loop=255
> [    4.119915] PID hash table entries: 4096 (order: 3, 32768 bytes)
> [    4.120928] Dentry cache hash table entries: 2097152 (order: 12, 16777216 bytes)
> [    4.124018] Inode-cache hash table entries: 1048576 (order: 11, 8388608 bytes)
> [    4.147064] Placing 64MB software IO TLB between ffff8803ce200000 - ffff8803d2200000
> [    4.147066] software IO TLB at phys 0x3ce200000 - 0x3d2200000
> [    4.181675] Memory: 14975940k/17530880k available (4557k kernel code, 878512k absent, 1676428k reserved, 4112k data, 552k init)
> [    4.181730] Hierarchical RCU implementation.
> [    4.181731] 	RCU dyntick-idle grace-period acceleration is enabled.
> [    4.181738] NR_IRQS:33024 nr_irqs:1024 16
> [    4.181799] xen: sci override: global_irq=9 trigger=0 polarity=0
> [    4.181801] xen: registering gsi 9 triggering 0 polarity 0
> [    4.181809] xen: --> pirq=9 -> irq=9 (gsi=9)
> [    4.181829] xen: acpi sci 9
> [    4.181831] xen: --> pirq=1 -> irq=1 (gsi=1)
> [    4.181834] xen: --> pirq=2 -> irq=2 (gsi=2)
> [    4.181836] xen: --> pirq=3 -> irq=3 (gsi=3)
> [    4.181838] xen: --> pirq=4 -> irq=4 (gsi=4)
> [    4.181840] xen: --> pirq=5 -> irq=5 (gsi=5)
> [    4.181843] xen: --> pirq=6 -> irq=6 (gsi=6)
> [    4.181845] xen: --> pirq=7 -> irq=7 (gsi=7)
> [    4.181847] xen: --> pirq=8 -> irq=8 (gsi=8)
> [    4.181849] xen: --> pirq=10 -> irq=10 (gsi=10)
> [    4.181851] xen: --> pirq=11 -> irq=11 (gsi=11)
> [    4.181854] xen: --> pirq=12 -> irq=12 (gsi=12)
> [    4.181856] xen: --> pirq=13 -> irq=13 (gsi=13)
> [    4.181858] xen: --> pirq=14 -> irq=14 (gsi=14)
> [    4.181860] xen: --> pirq=15 -> irq=15 (gsi=15)
> [    4.182986] Console: colour VGA+ 80x25
> [    4.183012] console [tty0] enabled
> [    4.183026] Xen: using vcpuop timer interface
> [    4.183030] installing Xen timer for CPU 0
> [    4.183048] Detected 2494.416 MHz processor.
> [    4.183052] Calibrating delay loop (skipped), value calculated using timer frequency.. 4988.83 BogoMIPS (lpj=9977664)
> [    4.183054] pid_max: default: 32768 minimum: 301
> [    4.183090] Mount-cache hash table entries: 256
> [    4.183222] Initializing cgroup subsys cpuacct
> [    4.183224] Initializing cgroup subsys devices
> [    4.183225] Initializing cgroup subsys freezer
> [    4.183227] Initializing cgroup subsys net_cls
> [    4.183228] Initializing cgroup subsys blkio
> [    4.183280] ENERGY_PERF_BIAS: Set to 'normal', was 'performance'
> [    4.183281] ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)
> [    4.183284] CPU: Physical Processor ID: 0
> [    4.183285] CPU: Processor Core ID: 0
> [    4.184454] ACPI: Core revision 20120320
> [    4.194658] Performance Events: unsupported p6 CPU model 42 no PMU driver, software events only.
> [    4.194796] installing Xen timer for CPU 1
> [    4.194988] installing Xen timer for CPU 2
> [    4.195140] installing Xen timer for CPU 3
> [    4.195232] Brought up 4 CPUs
> [    4.195477] devtmpfs: initialized
> [    4.199046] PM: Registering ACPI NVS region [mem 0x07eea000-0x07f66fff] (512000 bytes)
> [    4.199056] PM: Registering ACPI NVS region [mem 0x07f70000-0x07f75fff] (24576 bytes)
> [    4.199058] PM: Registering ACPI NVS region [mem 0x07f78000-0x07ffffff] (557056 bytes)
> [    4.199069] Dell Latitude E6420 series board detected. Selecting PCI-method for reboots.
> [    4.199104] Grant tables using version 2 layout.
> [    4.199114] Grant table initialized
> [    4.199158] dummy: 
> [    4.199205] RTC time:  1:19:35, date: 11/29/12
> [    4.199256] NET: Registered protocol family 16
> [    4.199465] ACPI FADT declares the system doesn't support PCIe ASPM, so disable it
> [    4.199467] ACPI: bus type pci registered
> [    4.199548] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem 0xf8000000-0xfbffffff] (base 0xf8000000)
> [    4.199550] PCI: not using MMCONFIG
> [    4.199552] PCI: Using configuration type 1 for base access
> [    4.199559] dmi type 0xB1 record - unknown flag
> [    4.200155] bio: create slab <bio-0> at 0
> [    4.200279] ACPI: Added _OSI(Module Device)
> [    4.200280] ACPI: Added _OSI(Processor Device)
> [    4.200282] ACPI: Added _OSI(3.0 _SCP Extensions)
> [    4.200283] ACPI: Added _OSI(Processor Aggregator Device)
> [    4.201815] ACPI: EC: Look up EC in DSDT
> [    4.206932] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignored
> [    4.219266] ACPI: SSDT 00000000c8412798 00727 (v01  PmRef  Cpu0Cst 00003001 INTL 20090903)
> [    4.219654] ACPI: Dynamic OEM Table Load:
> [    4.219657] ACPI: SSDT           (null) 00727 (v01  PmRef  Cpu0Cst 00003001 INTL 20090903)
> [    4.220118] ACPI: SSDT 00000000c8413a98 00303 (v01  PmRef    ApIst 00003000 INTL 20090903)
> [    4.220555] ACPI: Dynamic OEM Table Load:
> [    4.220558] ACPI: SSDT           (null) 00303 (v01  PmRef    ApIst 00003000 INTL 20090903)
> [    4.220754] ACPI: SSDT 00000000c8411d98 00119 (v01  PmRef    ApCst 00003000 INTL 20090903)
> [    4.221136] ACPI: Dynamic OEM Table Load:
> [    4.221138] ACPI: SSDT           (null) 00119 (v01  PmRef    ApCst 00003000 INTL 20090903)
> [    4.223275] ACPI: Interpreter enabled
> [    4.223278] ACPI: (supports S0 S3 S5)
> [    4.223294] ACPI: Using IOAPIC for interrupt routing
> [    4.223322] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem 0xf8000000-0xfbffffff] (base 0xf8000000)
> [    4.223846] PCI: MMCONFIG at [mem 0xf8000000-0xfbffffff] reserved in ACPI motherboard resources
> [    4.271283] ACPI: EC: GPE = 0x10, I/O: command/status = 0x934, data = 0x930
> [    4.272424] ACPI: No dock devices found.
> [    4.272428] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
> [    4.272988] \_SB_.PCI0:_OSC invalid UUID
> [    4.272989] _OSC request data:1 8 1f 
> [    4.272992] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-3e])
> [    4.273994] pci_root PNP0A08:00: host bridge window [io  0x0000-0x0cf7]
> [    4.273996] pci_root PNP0A08:00: host bridge window [io  0x0d00-0xffff]
> [    4.273998] pci_root PNP0A08:00: host bridge window [mem 0x000a0000-0x000bffff]
> [    4.274001] pci_root PNP0A08:00: host bridge window [mem 0xcfa00000-0xfeafffff]
> [    4.274003] pci_root PNP0A08:00: host bridge window [mem 0xfed40000-0xfed44fff]
> [    4.274031] PCI host bridge to bus 0000:00
> [    4.274033] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7]
> [    4.274034] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff]
> [    4.274036] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff]
> [    4.274038] pci_bus 0000:00: root bus resource [mem 0xcfa00000-0xfeafffff]
> [    4.274040] pci_bus 0000:00: root bus resource [mem 0xfed40000-0xfed44fff]
> [    4.274054] pci 0000:00:00.0: [8086:0104] type 00 class 0x060000
> [    4.274147] pci 0000:00:02.0: [8086:0126] type 00 class 0x030000
> [    4.274174] pci 0000:00:02.0: reg 10: [mem 0xe1400000-0xe17fffff 64bit]
> [    4.274189] pci 0000:00:02.0: reg 18: [mem 0xd0000000-0xdfffffff 64bit pref]
> [    4.274200] pci 0000:00:02.0: reg 20: [io  0x4000-0x403f]
> [    4.274344] pci 0000:00:16.0: [8086:1c3a] type 00 class 0x078000
> [    4.274394] pci 0000:00:16.0: reg 10: [mem 0xe2eb0000-0xe2eb000f 64bit]
> [    4.274563] pci 0000:00:16.0: PME# supported from D0 D3hot D3cold
> [    4.274636] pci 0000:00:19.0: [8086:1502] type 00 class 0x020000
> [    4.274681] pci 0000:00:19.0: reg 10: [mem 0xe2e00000-0xe2e1ffff]
> [    4.274700] pci 0000:00:19.0: reg 14: [mem 0xe2e80000-0xe2e80fff]
> [    4.274719] pci 0000:00:19.0: reg 18: [io  0x4080-0x409f]
> [    4.274883] pci 0000:00:19.0: PME# supported from D0 D3hot D3cold
> [    4.274939] pci 0000:00:1a.0: [8086:1c2d] type 00 class 0x0c0320
> [    4.274983] pci 0000:00:1a.0: reg 10: [mem 0xe2e70000-0xe2e703ff]
> [    4.275185] pci 0000:00:1a.0: PME# supported from D0 D3hot D3cold
> [    4.275243] pci 0000:00:1b.0: [8086:1c20] type 00 class 0x040300
> [    4.275278] pci 0000:00:1b.0: reg 10: [mem 0xe2e60000-0xe2e63fff 64bit]
> [    4.275456] pci 0000:00:1b.0: PME# supported from D0 D3hot D3cold
> [    4.275509] pci 0000:00:1c.0: [8086:1c10] type 01 class 0x060400
> [    4.275702] pci 0000:00:1c.0: PME# supported from D0 D3hot D3cold
> [    4.275760] pci 0000:00:1c.1: [8086:1c12] type 01 class 0x060400
> [    4.275953] pci 0000:00:1c.1: PME# supported from D0 D3hot D3cold
> [    4.276011] pci 0000:00:1c.2: [8086:1c14] type 01 class 0x060400
> [    4.276205] pci 0000:00:1c.2: PME# supported from D0 D3hot D3cold
> [    4.276264] pci 0000:00:1c.3: [8086:1c16] type 01 class 0x060400
> [    4.276458] pci 0000:00:1c.3: PME# supported from D0 D3hot D3cold
> [    4.276520] pci 0000:00:1c.5: [8086:1c1a] type 01 class 0x060400
> [    4.276711] pci 0000:00:1c.5: PME# supported from D0 D3hot D3cold
> [    4.276779] pci 0000:00:1d.0: [8086:1c26] type 00 class 0x0c0320
> [    4.276823] pci 0000:00:1d.0: reg 10: [mem 0xe2e50000-0xe2e503ff]
> [    4.277025] pci 0000:00:1d.0: PME# supported from D0 D3hot D3cold
> [    4.277086] pci 0000:00:1f.0: [8086:1c4f] type 00 class 0x060100
> [    4.277341] pci 0000:00:1f.2: [8086:1c03] type 00 class 0x010601
> [    4.277391] pci 0000:00:1f.2: reg 10: [io  0x40d0-0x40d7]
> [    4.277410] pci 0000:00:1f.2: reg 14: [io  0x40c0-0x40c3]
> [    4.277429] pci 0000:00:1f.2: reg 18: [io  0x40b0-0x40b7]
> [    4.277449] pci 0000:00:1f.2: reg 1c: [io  0x40a0-0x40a3]
> [    4.277468] pci 0000:00:1f.2: reg 20: [io  0x4060-0x407f]
> [    4.277486] pci 0000:00:1f.2: reg 24: [mem 0xe2e40000-0xe2e407ff]
> [    4.277613] pci 0000:00:1f.2: PME# supported from D3hot
> [    4.277657] pci 0000:00:1f.3: [8086:1c22] type 00 class 0x0c0500
> [    4.277694] pci 0000:00:1f.3: reg 10: [mem 0xe2e30000-0xe2e300ff 64bit]
> [    4.277749] pci 0000:00:1f.3: reg 20: [io  0x4040-0x405f]
> [    4.277920] pci 0000:00:1c.0: PCI bridge to [bus 01-01]
> [    4.278353] pci 0000:02:00.0: [8086:422b] type 00 class 0x028000
> [    4.278708] pci 0000:02:00.0: reg 10: [mem 0xe2d00000-0xe2d01fff 64bit]
> [    4.280508] pci 0000:02:00.0: PME# supported from D0 D3hot D3cold
> [    4.285361] pci 0000:00:1c.1: PCI bridge to [bus 02-02]
> [    4.285374] pci 0000:00:1c.1:   bridge window [mem 0xe2d00000-0xe2dfffff]
> [    4.285490] pci 0000:00:1c.2: PCI bridge to [bus 03-08]
> [    4.285498] pci 0000:00:1c.2:   bridge window [io  0x3000-0x3fff]
> [    4.285505] pci 0000:00:1c.2:   bridge window [mem 0xe2200000-0xe2bfffff]
> [    4.285517] pci 0000:00:1c.2:   bridge window [mem 0xe0a00000-0xe13fffff 64bit pref]
> [    4.285625] pci 0000:00:1c.3: PCI bridge to [bus 09-09]
> [    4.285632] pci 0000:00:1c.3:   bridge window [io  0x2000-0x2fff]
> [    4.285639] pci 0000:00:1c.3:   bridge window [mem 0xe1800000-0xe21fffff]
> [    4.285651] pci 0000:00:1c.3:   bridge window [mem 0xe0000000-0xe09fffff 64bit pref]
> [    4.285818] pci 0000:0a:00.0: [1217:8221] type 00 class 0x080501
> [    4.285872] pci 0000:0a:00.0: reg 10: [mem 0xe2c20000-0xe2c201ff]
> [    4.286294] pci 0000:0a:00.0: supports D1 D2
> [    4.286295] pci 0000:0a:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> [    4.286432] pci 0000:0a:00.1: [1217:8231] type 00 class 0x018000
> [    4.286486] pci 0000:0a:00.1: reg 10: [mem 0xe2c10000-0xe2c10fff]
> [    4.286563] pci 0000:0a:00.1: reg 18: [mem 0xe2c00000-0xe2c007ff]
> [    4.286908] pci 0000:0a:00.1: supports D1 D2
> [    4.286909] pci 0000:0a:00.1: PME# supported from D0 D1 D2 D3hot D3cold
> [    4.293400] pci 0000:00:1c.5: PCI bridge to [bus 0a-0a]
> [    4.293412] pci 0000:00:1c.5:   bridge window [mem 0xe2c00000-0xe2cfffff]
> [    4.293479] pci_bus 0000:00: on NUMA node 0
> [    4.293483] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
> [    4.293612] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP01._PRT]
> [    4.293647] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP02._PRT]
> [    4.293682] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP04._PRT]
> [    4.293717] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP06._PRT]
> [    4.293762] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP03._PRT]
> [    4.293857] \_SB_.PCI0:_OSC invalid UUID
> [    4.293858] _OSC request data:1 1f 1f 
> [    4.293861]  pci0000:00: Requesting ACPI _OSC control (0x1d)
> [    4.293906] \_SB_.PCI0:_OSC invalid UUID
> [    4.293907] _OSC request data:1 0 1d 
> [    4.293910]  pci0000:00: ACPI _OSC request failed (AE_ERROR), returned control mask: 0x1d
> [    4.293911] ACPI _OSC control for PCIe not granted, disabling ASPM
> [    4.297639] ACPI: PCI Interrupt Link [LNKA] (IRQs 1 3 4 5 6 7 10 12 14 15) *11
> [    4.297702] ACPI: PCI Interrupt Link [LNKB] (IRQs 1 3 4 5 6 7 11 12 14 15) *10
> [    4.297761] ACPI: PCI Interrupt Link [LNKC] (IRQs 1 3 4 5 6 7 10 12 14 15) *11
> [    4.297820] ACPI: PCI Interrupt Link [LNKD] (IRQs 1 3 4 5 6 7 11 12 14 15) *10
> [    4.297878] ACPI: PCI Interrupt Link [LNKE] (IRQs 1 3 4 *5 6 7 10 12 14 15)
> [    4.297937] ACPI: PCI Interrupt Link [LNKF] (IRQs 1 3 4 5 6 7 11 12 14 15) *0, disabled.
> [    4.297996] ACPI: PCI Interrupt Link [LNKG] (IRQs 1 *3 4 5 6 7 10 12 14 15)
> [    4.298054] ACPI: PCI Interrupt Link [LNKH] (IRQs 1 3 4 5 6 7 11 12 14 15) *0, disabled.
> [    4.298087] xen/balloon: Initialising balloon driver.
> [    4.301022] xen-balloon: Initialising balloon driver.
> [    4.301062] xen/balloon: Xen selfballooning driver disabled for domain0.
> [    4.301148] vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
> [    4.301157] vgaarb: loaded
> [    4.301157] vgaarb: bridge control possible 0000:00:02.0
> [    4.301279] PCI: Using ACPI for IRQ routing
> [    4.305930] PCI: pci_cache_line_size set to 64 bytes
> [    4.306106] reserve RAM buffer: 000000000009a000 - 000000000009ffff 
> [    4.306108] reserve RAM buffer: 0000000007eea000 - 0000000007ffffff 
> [    4.306110] reserve RAM buffer: 0000000007f70000 - 0000000007ffffff 
> [    4.306112] reserve RAM buffer: 0000000007f78000 - 0000000007ffffff 
> [    4.306113] reserve RAM buffer: 000000000dffd000 - 000000000fffffff 
> [    4.306115] reserve RAM buffer: 00000000c83b4000 - 00000000cbffffff 
> [    4.306118] reserve RAM buffer: 00000000c840e000 - 00000000cbffffff 
> [    4.306121] reserve RAM buffer: 00000000c8411000 - 00000000cbffffff 
> [    4.306123] reserve RAM buffer: 00000000c841e000 - 00000000cbffffff 
> [    4.306125] reserve RAM buffer: 00000000c8432000 - 00000000cbffffff 
> [    4.306127] reserve RAM buffer: 00000000cac00000 - 00000000cbffffff 
> [    4.306129] reserve RAM buffer: 000000042e000000 - 000000042fffffff 
> [    4.306235] Switching to clocksource xen
> [    4.307726] pnp: PnP ACPI init
> [    4.307738] ACPI: bus type pnp registered
> [    4.308287] pnp 00:00: [bus 00-3e]
> [    4.308289] pnp 00:00: [io  0x0000-0x0cf7 window]
> [    4.308291] pnp 00:00: [io  0x0cf8-0x0cff]
> [    4.308293] pnp 00:00: [io  0x0d00-0xffff window]
> [    4.308295] pnp 00:00: [mem 0x000a0000-0x000bffff window]
> [    4.308296] pnp 00:00: [mem 0x000c0000-0x000c3fff window]
> [    4.308298] pnp 00:00: [mem 0x000c4000-0x000c7fff window]
> [    4.308300] pnp 00:00: [mem 0x000c8000-0x000cbfff window]
> [    4.308301] pnp 00:00: [mem 0x000cc000-0x000cffff window]
> [    4.308303] pnp 00:00: [mem 0x000d0000-0x000d3fff window]
> [    4.308305] pnp 00:00: [mem 0x000d4000-0x000d7fff window]
> [    4.308307] pnp 00:00: [mem 0x000d8000-0x000dbfff window]
> [    4.308309] pnp 00:00: [mem 0x000dc000-0x000dffff window]
> [    4.308310] pnp 00:00: [mem 0x000e0000-0x000e3fff window]
> [    4.308312] pnp 00:00: [mem 0x000e4000-0x000e7fff window]
> [    4.308314] pnp 00:00: [mem 0x000e8000-0x000ebfff window]
> [    4.308315] pnp 00:00: [mem 0x000ec000-0x000effff window]
> [    4.308317] pnp 00:00: [mem 0x000f0000-0x000fffff window]
> [    4.308319] pnp 00:00: [mem 0xcfa00000-0xfeafffff window]
> [    4.308320] pnp 00:00: [mem 0xfed40000-0xfed44fff window]
> [    4.308385] pnp 00:00: Plug and Play ACPI device, IDs PNP0a08 PNP0a03 (active)
> [    4.308398] pnp 00:01: [io  0x0000-0x001f]
> [    4.308400] pnp 00:01: [io  0x0081-0x0091]
> [    4.308401] pnp 00:01: [io  0x0093-0x009f]
> [    4.308403] pnp 00:01: [io  0x00c0-0x00df]
> [    4.308404] pnp 00:01: [dma 4]
> [    4.308422] pnp 00:01: Plug and Play ACPI device, IDs PNP0200 (active)
> [    4.308429] pnp 00:02: [mem 0xff000000-0xffffffff]
> [    4.308445] pnp 00:02: Plug and Play ACPI device, IDs INT0800 (active)
> [    4.308540] pnp 00:03: [mem 0xfed00000-0xfed003ff]
> [    4.308572] system 00:03: [mem 0xfed00000-0xfed003ff] has been reserved
> [    4.308575] system 00:03: Plug and Play ACPI device, IDs PNP0103 PNP0c01 (active)
> [    4.308584] pnp 00:04: [io  0x00f0]
> [    4.308587] xen: registering gsi 13 triggering 1 polarity 0
> [    4.308609] pnp 00:04: [irq 13]
> [    4.308626] pnp 00:04: Plug and Play ACPI device, IDs PNP0c04 (active)
> [    4.308636] pnp 00:05: [io  0x002e-0x002f]
> [    4.308637] pnp 00:05: [io  0x004e-0x004f]
> [    4.308639] pnp 00:05: [io  0x0061]
> [    4.308640] pnp 00:05: [io  0x0063]
> [    4.308641] pnp 00:05: [io  0x0065]
> [    4.308642] pnp 00:05: [io  0x0067]
> [    4.308644] pnp 00:05: [io  0x0070]
> [    4.308645] pnp 00:05: [io  0x0080]
> [    4.308646] pnp 00:05: [io  0x0092]
> [    4.308648] pnp 00:05: [io  0x00b2-0x00b3]
> [    4.308649] pnp 00:05: [io  0x0680-0x069f]
> [    4.308651] pnp 00:05: [io  0x1000-0x100f]
> [    4.308653] pnp 00:05: [io  0xffff]
> [    4.308654] pnp 00:05: [io  0xffff]
> [    4.308655] pnp 00:05: [io  0x0400-0x047f]
> [    4.308656] pnp 00:05: [io  0x0500-0x057f]
> [    4.308658] pnp 00:05: [io  0x164e-0x164f]
> [    4.308689] system 00:05: [io  0x0680-0x069f] has been reserved
> [    4.308691] system 00:05: [io  0x1000-0x100f] has been reserved
> [    4.308693] system 00:05: [io  0xffff] has been reserved
> [    4.308695] system 00:05: [io  0xffff] has been reserved
> [    4.308697] system 00:05: [io  0x0400-0x047f] has been reserved
> [    4.308700] system 00:05: [io  0x0500-0x057f] has been reserved
> [    4.308701] system 00:05: [io  0x164e-0x164f] has been reserved
> [    4.308704] system 00:05: Plug and Play ACPI device, IDs PNP0c02 (active)
> [    4.308711] pnp 00:06: [io  0x0070-0x0077]
> [    4.308713] xen: registering gsi 8 triggering 1 polarity 0
> [    4.308730] pnp 00:06: [irq 8]
> [    4.308749] pnp 00:06: Plug and Play ACPI device, IDs PNP0b00 (active)
> [    4.308758] pnp 00:07: [io  0x0060]
> [    4.308759] pnp 00:07: [io  0x0064]
> [    4.308761] xen: registering gsi 1 triggering 1 polarity 0
> [    4.308777] pnp 00:07: [irq 1]
> [    4.308794] pnp 00:07: Plug and Play ACPI device, IDs PNP0303 (active)
> [    4.309984] pnp 00:08: Plug and Play ACPI device, IDs PNP0401 (disabled)
> [    4.309993] xen: registering gsi 12 triggering 1 polarity 0
> [    4.310011] pnp 00:09: [irq 12]
> [    4.310030] pnp 00:09: Plug and Play ACPI device, IDs DLL0493 PNP0f13 (active)
> [    4.310065] pnp 00:0a: [mem 0xfed40000-0xfed44fff]
> [    4.310086] pnp 00:0a: Plug and Play ACPI device, IDs BCM0102 PNP0c31 (active)
> [    4.310291] pnp 00:0b: [mem 0xfed1c000-0xfed1ffff]
> [    4.310292] pnp 00:0b: [mem 0xfed10000-0xfed17fff]
> [    4.310294] pnp 00:0b: [mem 0xfed18000-0xfed18fff]
> [    4.310296] pnp 00:0b: [mem 0xfed19000-0xfed19fff]
> [    4.310298] pnp 00:0b: [mem 0xf8000000-0xfbffffff]
> [    4.310309] pnp 00:0b: [mem 0xfed20000-0xfed3ffff]
> [    4.310310] pnp 00:0b: [mem 0xfed90000-0xfed93fff]
> [    4.310312] pnp 00:0b: [mem 0xfed45000-0xfed8ffff]
> [    4.310313] pnp 00:0b: [mem 0xff000000-0xffffffff]
> [    4.310315] pnp 00:0b: [mem 0xfee00000-0xfeefffff]
> [    4.310317] pnp 00:0b: [mem 0x00000000-0xffffffffffffffff disabled]
> [    4.310318] pnp 00:0b: [mem 0x00000000-0xffffffffffffffff disabled]
> [    4.310359] system 00:0b: [mem 0xfed1c000-0xfed1ffff] has been reserved
> [    4.310361] system 00:0b: [mem 0xfed10000-0xfed17fff] has been reserved
> [    4.310363] system 00:0b: [mem 0xfed18000-0xfed18fff] has been reserved
> [    4.310365] system 00:0b: [mem 0xfed19000-0xfed19fff] has been reserved
> [    4.310367] system 00:0b: [mem 0xf8000000-0xfbffffff] has been reserved
> [    4.310369] system 00:0b: [mem 0xfed20000-0xfed3ffff] has been reserved
> [    4.310371] system 00:0b: [mem 0xfed90000-0xfed93fff] has been reserved
> [    4.310373] system 00:0b: [mem 0xfed45000-0xfed8ffff] has been reserved
> [    4.310375] system 00:0b: [mem 0xff000000-0xffffffff] could not be reserved
> [    4.310377] system 00:0b: [mem 0xfee00000-0xfeefffff] could not be reserved
> [    4.310380] system 00:0b: Plug and Play ACPI device, IDs PNP0c02 (active)
> [    4.310956] xen: registering gsi 23 triggering 1 polarity 0
> [    4.310967] xen: --> pirq=23 -> irq=23 (gsi=23)
> [    4.310985] pnp 00:0c: [irq 23]
> [    4.311015] pnp 00:0c: Plug and Play ACPI device, IDs SMO8800 (active)
> [    4.315528] pnp 00:0d: [mem 0x20000000-0x201fffff]
> [    4.315531] pnp 00:0d: [mem 0x40000000-0x401fffff]
> [    4.339851] system 00:0d: [mem 0x20000000-0x201fffff] has been reserved
> [    4.339854] system 00:0d: [mem 0x40000000-0x401fffff] has been reserved
> [    4.339857] system 00:0d: Plug and Play ACPI device, IDs PNP0c01 (active)
> [    4.339865] pnp: PnP ACPI: found 14 devices
> [    4.339867] ACPI: ACPI bus type pnp unregistered
> [    4.346178] PM-Timer failed consistency check  (0x0xffffff) - aborting.
> [    4.346274] pci 0000:00:1c.0: PCI bridge to [bus 01-01]
> [    4.346306] pci 0000:00:1c.1: PCI bridge to [bus 02-02]
> [    4.346315] pci 0000:00:1c.1:   bridge window [mem 0xe2d00000-0xe2dfffff]
> [    4.346332] pci 0000:00:1c.2: PCI bridge to [bus 03-08]
> [    4.346336] pci 0000:00:1c.2:   bridge window [io  0x3000-0x3fff]
> [    4.346347] pci 0000:00:1c.2:   bridge window [mem 0xe2200000-0xe2bfffff]
> [    4.346354] pci 0000:00:1c.2:   bridge window [mem 0xe0a00000-0xe13fffff 64bit pref]
> [    4.346366] pci 0000:00:1c.3: PCI bridge to [bus 09-09]
> [    4.346370] pci 0000:00:1c.3:   bridge window [io  0x2000-0x2fff]
> [    4.346379] pci 0000:00:1c.3:   bridge window [mem 0xe1800000-0xe21fffff]
> [    4.346386] pci 0000:00:1c.3:   bridge window [mem 0xe0000000-0xe09fffff 64bit pref]
> [    4.346399] pci 0000:00:1c.5: PCI bridge to [bus 0a-0a]
> [    4.346408] pci 0000:00:1c.5:   bridge window [mem 0xe2c00000-0xe2cfffff]
> [    4.346434] xen: registering gsi 16 triggering 0 polarity 1
> [    4.346442] xen: --> pirq=16 -> irq=16 (gsi=16)
> [    4.346469] xen: registering gsi 17 triggering 0 polarity 1
> [    4.346473] xen: --> pirq=17 -> irq=17 (gsi=17)
> [    4.346498] xen: registering gsi 18 triggering 0 polarity 1
> [    4.346502] xen: --> pirq=18 -> irq=18 (gsi=18)
> [    4.346527] xen: registering gsi 19 triggering 0 polarity 1
> [    4.346531] xen: --> pirq=19 -> irq=19 (gsi=19)
> [    4.346556] xen: registering gsi 17 triggering 0 polarity 1
> [    4.346558] Already setup the GSI :17
> [    4.346563] pci_bus 0000:00: resource 4 [io  0x0000-0x0cf7]
> [    4.346565] pci_bus 0000:00: resource 5 [io  0x0d00-0xffff]
> [    4.346566] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff]
> [    4.346568] pci_bus 0000:00: resource 7 [mem 0xcfa00000-0xfeafffff]
> [    4.346570] pci_bus 0000:00: resource 8 [mem 0xfed40000-0xfed44fff]
> [    4.346572] pci_bus 0000:02: resource 1 [mem 0xe2d00000-0xe2dfffff]
> [    4.346574] pci_bus 0000:03: resource 0 [io  0x3000-0x3fff]
> [    4.346575] pci_bus 0000:03: resource 1 [mem 0xe2200000-0xe2bfffff]
> [    4.346577] pci_bus 0000:03: resource 2 [mem 0xe0a00000-0xe13fffff 64bit pref]
> [    4.346579] pci_bus 0000:09: resource 0 [io  0x2000-0x2fff]
> [    4.346581] pci_bus 0000:09: resource 1 [mem 0xe1800000-0xe21fffff]
> [    4.346582] pci_bus 0000:09: resource 2 [mem 0xe0000000-0xe09fffff 64bit pref]
> [    4.346584] pci_bus 0000:0a: resource 1 [mem 0xe2c00000-0xe2cfffff]
> [    4.346672] NET: Registered protocol family 2
> [    4.346732] IP route cache hash table entries: 524288 (order: 10, 4194304 bytes)
> [    4.347207] TCP established hash table entries: 262144 (order: 10, 4194304 bytes)
> [    4.347753] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
> [    4.347872] TCP: Hash tables configured (established 262144 bind 65536)
> [    4.347874] TCP: reno registered
> [    4.347877] UDP hash table entries: 8192 (order: 6, 262144 bytes)
> [    4.347921] UDP-Lite hash table entries: 8192 (order: 6, 262144 bytes)
> [    4.348067] NET: Registered protocol family 1
> [    4.348085] pci 0000:00:02.0: Boot video device
> [    4.348108] xen: registering gsi 16 triggering 0 polarity 1
> [    4.348112] Already setup the GSI :16
> [    4.348203] xen: registering gsi 17 triggering 0 polarity 1
> [    4.348205] Already setup the GSI :17
> [    4.348298] PCI: CLS 64 bytes, default 64
> [    4.348333] Unpacking initramfs...
> [    4.384265] Freeing initrd memory: 45868k freed
> [    4.392440] Simple Boot Flag at 0xf3 set to 0x1
> [    4.392900] audit: initializing netlink socket (disabled)
> [    4.392911] type=2000 audit(1354151975.383:1): initialized
> [    4.411688] VFS: Disk quotas dquot_6.5.2
> [    4.411715] Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
> [    4.411870] msgmni has been set to 29339
> [    4.412010] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
> [    4.412013] io scheduler noop registered
> [    4.412015] io scheduler deadline registered
> [    4.412036] io scheduler cfq registered (default)
> [    4.412666] intel_idle: does not run on family 6 model 42
> [    4.412741] ACPI: Requesting acpi_cpufreq
> [    4.459643] Non-volatile memory driver v1.3
> [    4.459654] ramoops: platform device not found, using module parameters
> [    4.459670] ramoops: The memory size and the record size must be non-zero
> [    4.459703] ramoops: probe of ramoops failed with error -22
> [    4.474892] loop: module loaded
> [    4.474922] Fixed MDIO Bus: probed
> [    4.474965] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2M] at 0x60,0x64 irq 1,12
> [    4.475166] i8042: Warning: Keylock active
> [    4.476434] serio: i8042 KBD port at 0x60,0x64 irq 1
> [    4.476439] serio: i8042 AUX port at 0x60,0x64 irq 12
> [    4.476551] mousedev: PS/2 mouse device common for all mice
> [    4.476707] rtc_cmos 00:06: RTC can wake from S4
> [    4.476940] rtc_cmos 00:06: rtc core: registered rtc_cmos as rtc0
> [    4.476998] rtc0: alarms up to one year, y3k, 242 bytes nvram
> [    4.477084] device-mapper: uevent: version 1.0.3
> [    4.477193] device-mapper: ioctl: 4.22.0-ioctl (2011-10-19) initialised: dm-devel@redhat.com
> [    4.477281] TCP: cubic registered
> [    4.477381] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
> [    4.477402] NET: Registered protocol family 10
> [    4.477644] Registering the dns_resolver key type
> [    4.477791] registered taskstats version 1
> [    4.478330]   Magic number: 4:584:307
> [    4.478403] tty tty36: hash matches
> [    4.478496] rtc_cmos 00:06: setting system clock to 2012-11-29 01:19:35 UTC (1354151975)
> [    4.478801] Freeing unused kernel memory: 552k freed
> [    4.478847] Write protecting the kernel read-only data: 8192k
> [    4.481908] Freeing unused kernel memory: 1568k freed
> [    4.482112] Freeing unused kernel memory: 24k freed
> [    4.524129] dracut: dracut-005-3.fc13
> [    4.552311] pciback 0000:00:19.0: seizing device
> [    4.552403] pciback 0000:02:00.0: seizing device
> [    4.552941] xen: registering gsi 17 triggering 0 polarity 1
> [    4.552952] Already setup the GSI :17
> [    4.553934] xen: registering gsi 20 triggering 0 polarity 1
> [    4.553964] xen: --> pirq=20 -> irq=20 (gsi=20)
> [    4.554574] xen-pciback: backend is vpci
> [    4.617471] udev: starting version 151
> [    4.617770] udevd (80): /proc/80/oom_adj is deprecated, please use /proc/80/oom_score_adj instead.
> [    4.654916] Linux agpgart interface v0.103
> [    4.655397] input: Lid Switch as /devices/LNXSYSTM:00/device:00/PNP0C0D:00/input/input1
> [    5.051184] ACPI: Lid Switch [LID]
> [    5.051436] input: Power Button as /devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input2
> [    5.051547] ACPI: Power Button [PBTN]
> [    5.051682] input: Sleep Button as /devices/LNXSYSTM:00/device:00/PNP0C0E:00/input/input3
> [    5.051760] ACPI: Sleep Button [SBTN]
> [    5.054141] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input4
> [    5.054421] ACPI: Power Button [PWRF]
> [    5.056887] agpgart-intel 0000:00:00.0: Intel Sandybridge Chipset
> [    5.058118] agpgart-intel 0000:00:00.0: detected gtt size: 2097152K total, 262144K mappable
> [    5.064439] agpgart-intel 0000:00:00.0: detected 65536K stolen memory
> [    5.064916] agpgart-intel 0000:00:00.0: AGP aperture is 256M @ 0xd0000000
> [    5.070296] [drm] Initialized drm 1.1.0 20060810
> [    5.080002] xen: registering gsi 16 triggering 0 polarity 1
> [    5.080015] Already setup the GSI :16
> [    5.080364] i915 0000:00:02.0: setting latency timer to 64
> [    5.190295] [drm] MTRR allocation failed.  Graphics performance may suffer.
> [    5.190491] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
> [    5.190493] [drm] Driver supports precise vblank timestamp query.
> [    5.190554] vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem
> [    5.548301] [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp off
> [    5.591093] input: DualPoint Stick as /devices/platform/i8042/serio1/input/input5
> [    5.606212] input: AlpsPS/2 ALPS DualPoint TouchPad as /devices/platform/i8042/serio1/input/input6
> [    5.806814] fbcon: inteldrmfb (fb0) is primary device
> [    6.095967] Console: switching to colour frame buffer device 200x56
> [    6.101477] fb0: inteldrmfb frame buffer device
> [    6.101478] drm: registered panic notifier
> [    6.130833] acpi device:38: registered as cooling_device4
> [    6.133713] input: Video Bus as /devices/LNXSYSTM:00/device:00/PNP0A08:00/LNXVIDEO:00/input/input7
> [    6.133915] ACPI: Video Device [VID] (multi-head: yes  rom: no  post: no)
> [    6.135082] [drm] Initialized i915 1.6.0 20080730 for 0000:00:02.0 on minor 0
> [    6.185946] dracut: Starting plymouth daemon
> [    6.479391] dracut: rd_NO_DM: removing DM RAID activation
> [    6.489309] dracut: rd_NO_MD: removing MD RAID activation
> [    6.542596] wmi: Mapper loaded
> [    6.564439] usbcore: registered new interface driver usbfs
> [    6.564463] usbcore: registered new interface driver hub
> [    6.568901] SCSI subsystem initialized
> [    6.569574] usbcore: registered new device driver usb
> [    6.570692] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
> [    6.570723] xen: registering gsi 16 triggering 0 polarity 1
> [    6.570728] Already setup the GSI :16
> [    6.570776] ehci_hcd 0000:00:1a.0: setting latency timer to 64
> [    6.570782] ehci_hcd 0000:00:1a.0: EHCI Host Controller
> [    6.570814] ehci_hcd 0000:00:1a.0: new USB bus registered, assigned bus number 1
> [    6.570879] ehci_hcd 0000:00:1a.0: debug port 2
> [    6.573720] libata version 3.00 loaded.
> [    6.574777] ehci_hcd 0000:00:1a.0: cache line size of 64 is not supported
> [    6.574832] ehci_hcd 0000:00:1a.0: irq 16, io mem 0xe2e70000
> [    6.586344] ehci_hcd 0000:00:1a.0: USB 2.0 started, EHCI 1.00
> [    6.586369] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
> [    6.586372] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
> [    6.586375] usb usb1: Product: EHCI Host Controller
> [    6.586376] usb usb1: Manufacturer: Linux 3.4.18-2.pvops.qubes.x86_64 ehci_hcd
> [    6.586378] usb usb1: SerialNumber: 0000:00:1a.0
> [    6.586506] hub 1-0:1.0: USB hub found
> [    6.586511] hub 1-0:1.0: 2 ports detected
> [    6.586604] xen: registering gsi 17 triggering 0 polarity 1
> [    6.586609] Already setup the GSI :17
> [    6.586663] ehci_hcd 0000:00:1d.0: setting latency timer to 64
> [    6.586668] ehci_hcd 0000:00:1d.0: EHCI Host Controller
> [    6.586678] ehci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 2
> [    6.586734] ehci_hcd 0000:00:1d.0: debug port 2
> [    6.590650] ehci_hcd 0000:00:1d.0: cache line size of 64 is not supported
> [    6.590709] ehci_hcd 0000:00:1d.0: irq 17, io mem 0xe2e50000
> [    6.606335] ehci_hcd 0000:00:1d.0: USB 2.0 started, EHCI 1.00
> [    6.606364] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
> [    6.606367] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
> [    6.606370] usb usb2: Product: EHCI Host Controller
> [    6.606371] usb usb2: Manufacturer: Linux 3.4.18-2.pvops.qubes.x86_64 ehci_hcd
> [    6.606373] usb usb2: SerialNumber: 0000:00:1d.0
> [    6.606519] hub 2-0:1.0: USB hub found
> [    6.606524] hub 2-0:1.0: 2 ports detected
> [    6.606620] ahci 0000:00:1f.2: version 3.0
> [    6.606641] xen: registering gsi 18 triggering 0 polarity 1
> [    6.606647] Already setup the GSI :18
> [    6.606896] ahci: SSS flag set, parallel bus scan disabled
> [    6.626400] ahci 0000:00:1f.2: AHCI 0001.0300 32 slots 6 ports 6 Gbps 0x3b impl SATA mode
> [    6.626405] ahci 0000:00:1f.2: flags: 64bit ncq sntf stag pm led clo pio slum part ems sxs apst 
> [    6.626414] ahci 0000:00:1f.2: setting latency timer to 64
> [    6.673732] scsi0 : ahci
> [    6.683363] scsi1 : ahci
> [    6.697268] scsi2 : ahci
> [    6.711526] scsi3 : ahci
> [    6.733931] scsi4 : ahci
> [    6.739603] scsi5 : ahci
> [    6.842106] ata1: SATA max UDMA/133 abar m2048@0xe2e40000 port 0xe2e40100 irq 293
> [    6.842118] ata2: SATA max UDMA/133 abar m2048@0xe2e40000 port 0xe2e40180 irq 293
> [    6.842124] ata3: DUMMY
> [    6.842129] ata4: SATA max UDMA/133 abar m2048@0xe2e40000 port 0xe2e40280 irq 293
> [    6.842136] ata5: SATA max UDMA/133 abar m2048@0xe2e40000 port 0xe2e40300 irq 293
> [    6.842143] ata6: SATA max UDMA/133 abar m2048@0xe2e40000 port 0xe2e40380 irq 293
> [    6.898480] usb 1-1: new high-speed USB device number 2 using ehci_hcd
> [    7.031312] usb 1-1: New USB device found, idVendor=8087, idProduct=0024
> [    7.031323] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
> [    7.032072] hub 1-1:1.0: USB hub found
> [    7.032344] hub 1-1:1.0: 6 ports detected
> [    7.142515] usb 2-1: new high-speed USB device number 2 using ehci_hcd
> [    7.162484] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
> [    7.268594] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by device (Stat=0x51 Err=0x04)
> [    7.268770] ata1.00: ATA-9: KINGSTON SV200S3256G, E111008a, max UDMA/100
> [    7.268778] ata1.00: 500118192 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
> [    7.272554] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by device (Stat=0x51 Err=0x04)
> [    7.272758] ata1.00: configured for UDMA/100
> [    7.273314] scsi 0:0:0:0: Direct-Access     ATA      KINGSTON SV200S3 E111 PQ: 0 ANSI: 5
> [    7.274861] usb 2-1: New USB device found, idVendor=8087, idProduct=0024
> [    7.274870] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
> [    7.275358] hub 2-1:1.0: USB hub found
> [    7.275521] hub 2-1:1.0: 8 ports detected
> [    7.346717] usb 1-1.4: new full-speed USB device number 3 using ehci_hcd
> [    7.443529] usb 1-1.4: New USB device found, idVendor=413c, idProduct=8187
> [    7.443539] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [    7.443546] usb 1-1.4: Product: DW375 Bluetooth Module
> [    7.443550] usb 1-1.4: Manufacturer: Dell Computer Corp
> [    7.443555] usb 1-1.4: SerialNumber: D0DF9A40FE60
> [    7.514736] usb 1-1.5: new high-speed USB device number 4 using ehci_hcd
> [    7.590440] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> [    7.593835] ata2.00: ATAPI: HL-DT-ST DVD+/-RW GU60N, A103, max UDMA/133
> [    7.604147] ata2.00: configured for UDMA/133
> [    7.614746] usb 1-1.5: New USB device found, idVendor=05ca, idProduct=181c
> [    7.614757] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
> [    7.614763] usb 1-1.5: Product: Laptop_Integrated_Webcam_FHD
> [    7.614768] usb 1-1.5: Manufacturer: CN0CJ3P27248717F040SA01
> [    7.618662] scsi 1:0:0:0: CD-ROM            HL-DT-ST DVD+-RW GU60N    A103 PQ: 0 ANSI: 5
> [    7.686581] usb 2-1.6: new high-speed USB device number 3 using ehci_hcd
> [    7.795399] usb 2-1.6: New USB device found, idVendor=413c, idProduct=818d
> [    7.795410] usb 2-1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [    7.795416] usb 2-1.6: Product: DW5550
> [    7.795420] usb 2-1.6: Manufacturer: Dell
> [    7.795425] usb 2-1.6: SerialNumber: 88FA653FDF944970
> [    7.902770] usb 2-1.8: new full-speed USB device number 4 using ehci_hcd
> [    7.938478] ata4: SATA link down (SStatus 0 SControl 300)
> [    8.017319] usb 2-1.8: New USB device found, idVendor=0a5c, idProduct=5801
> [    8.017330] usb 2-1.8: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [    8.017336] usb 2-1.8: Product: 5880
> [    8.017340] usb 2-1.8: Manufacturer: Broadcom Corp
> [    8.017344] usb 2-1.8: SerialNumber: 0123456789ABCD
> [    8.017794] usb 2-1.8: config 0 descriptor??
> [    8.258411] ata5: SATA link down (SStatus 0 SControl 300)
> [    8.578480] ata6: SATA link down (SStatus 0 SControl 300)
> [    8.588630] sd 0:0:0:0: [sda] 500118192 512-byte logical blocks: (256 GB/238 GiB)
> [    8.588846] sd 0:0:0:0: [sda] Write Protect is off
> [    8.588861] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
> [    8.588967] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
> [    8.590122]  sda: sda1 sda2
> [    8.591059] sd 0:0:0:0: [sda] Attached SCSI disk
> [    8.609438] sr0: scsi3-mmc drive: 24x/8x writer dvd-ram cd/rw xa/form2 cdda tray
> [    8.609451] cdrom: Uniform CD-ROM driver Revision: 3.20
> [    8.609737] sr 1:0:0:0: Attached scsi CD-ROM sr0
> [    8.714515] dracut: luksOpen /dev/sda2 luks-400336fa-c7c4-4be3-a244-c909aa16a18c
> [   13.862564] dracut: Scanning devices dm-0  for LVM logical volumes vg_dom0/lv_root vg_dom0/lv_swap 
> [   13.907639] dracut: inactive '/dev/vg_dom0/lv_root' [221.62 GiB] inherit
> [   13.907708] dracut: inactive '/dev/vg_dom0/lv_swap' [16.34 GiB] inherit
> [   14.162684] EXT4-fs (dm-1): INFO: recovery required on readonly filesystem
> [   14.162693] EXT4-fs (dm-1): write access will be enabled during recovery
> [   14.775779] EXT4-fs (dm-1): orphan cleanup on readonly fs
> [   14.775800] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767209
> [   14.775909] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767207
> [   14.776007] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767205
> [   14.776035] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767206
> [   14.776062] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767204
> [   14.776088] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767202
> [   14.776117] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767198
> [   14.776146] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767196
> [   14.776172] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767191
> [   14.776198] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767189
> [   14.776227] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767188
> [   14.776274] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767187
> [   14.777018] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767186
> [   14.777060] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767184
> [   14.777089] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767183
> [   14.777117] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767171
> [   14.777146] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 5767170
> [   14.777172] EXT4-fs (dm-1): 17 orphan inodes deleted
> [   14.777177] EXT4-fs (dm-1): recovery complete
> [   14.797124] EXT4-fs (dm-1): mounted filesystem with ordered data mode. Opts: (null)
> [   14.806762] dracut: Mounted root filesystem /dev/mapper/vg_dom0-lv_root
> [   14.957211] dracut: Switching root
> [   15.599261] udev: starting version 151
> [   15.673674] iTCO_vendor_support: vendor-support=0
> [   15.676374] mei: module is from the staging directory, the quality is unknown, you have been warned.
> [   15.676488] iTCO_wdt: Intel TCO WatchDog Timer Driver v1.07
> [   15.676679] iTCO_wdt: Found a Cougar Point TCO device (Version=2, TCOBASE=0x0460)
> [   15.676711] xen: registering gsi 16 triggering 0 polarity 1
> [   15.676716] Already setup the GSI :16
> [   15.676725] mei 0000:00:16.0: setting latency timer to 64
> [   15.676754] iTCO_wdt: initialized. heartbeat=30 sec (nowayout=0)
> [   15.712582] sd 0:0:0:0: Attached scsi generic sg0 type 0
> [   15.712620] sr 1:0:0:0: Attached scsi generic sg1 type 5
> [   15.730448] input: PC Speaker as /devices/platform/pcspkr/input/input8
> [   15.734494] xen: registering gsi 18 triggering 0 polarity 1
> [   15.734500] Already setup the GSI :18
> [   15.734506] ACPI Warning: 0x0000000000004040-0x000000000000405f SystemIO conflicts with Region \_SB_.PCI0.SBUS.SMBI 1 (20120320/utaddress-251)
> [   15.734512] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
> [   15.737002] microcode: CPU0 sig=0x206a7, pf=0x10, revision=0x23
> [   15.741412] watchdog: INTCAMT: cannot register miscdev on minor=130 (err=-16)
> [   15.741418] watchdog: error registering /dev/watchdog (err=-16)
> [   15.741422] mei 0000:00:16.0: unable to register watchdog device.
> [   15.790637] thermal LNXTHERM:00: registered as thermal_zone0
> [   15.790641] ACPI: Thermal Zone [THM] (25 C)
> [   15.814551] ACPI: Deprecated procfs I/F for battery is loaded, please retry with CONFIG_ACPI_PROCFS_POWER cleared
> [   15.814559] ACPI: Battery Slot [BAT0] (battery present)
> [   15.815037] ACPI: Deprecated procfs I/F for AC is loaded, please retry with CONFIG_ACPI_PROCFS_POWER cleared
> [   15.815521] ACPI: AC Adapter [AC] (on-line)
> [   15.867835] usbcore: registered new interface driver usbback
> [   15.975826] ACPI: Deprecated procfs I/F for battery is loaded, please retry with CONFIG_ACPI_PROCFS_POWER cleared
> [   15.975836] ACPI: Battery Slot [BAT1] (battery absent)
> [   16.102871] ACPI: Deprecated procfs I/F for battery is loaded, please retry with CONFIG_ACPI_PROCFS_POWER cleared
> [   16.102882] ACPI: Battery Slot [BAT2] (battery absent)
> [   16.106793] sdhci: Secure Digital Host Controller Interface driver
> [   16.106797] sdhci: Copyright(c) Pierre Ossman
> [   16.107131] parport_pc 00:08: [io  0x0378-0x037b]
> [   16.107296] parport_pc 00:08: [irq 5]
> [   16.107709] sdhci-pci 0000:0a:00.0: SDHCI controller found [1217:8221] (rev 5)
> [   16.159148] xen: registering gsi 17 triggering 0 polarity 1
> [   16.159156] Already setup the GSI :17
> [   16.159241] sdhci-pci 0000:0a:00.0: Invalid iomem size. You may experience problems.
> [   16.159319] 0000:0a:00.0 supply vmmc not found, using dummy regulator
> [   16.159384] Registered led device: mmc0::
> [   16.160442] mmc0: SDHCI controller on PCI [0000:0a:00.0] using DMA
> [   16.160928] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> [   16.171737] Linux video capture interface: v2.00
> [   16.192158] cdc_wdm 2-1.6:1.5: cdc-wdm0: USB WDM device
> [   16.192211] cdc_wdm 2-1.6:1.8: cdc-wdm1: USB WDM device
> [   16.192234] usbcore: registered new interface driver cdc_wdm
> [   16.195744] cdc_acm 2-1.6:1.1: ttyACM0: USB ACM device
> [   16.198739] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> [   16.220532] cdc_acm 2-1.6:1.3: ttyACM1: USB ACM device
> [   16.223728] cdc_acm 2-1.6:1.9: ttyACM2: USB ACM device
> [   16.235089] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> [   16.235234] usbcore: registered new interface driver cdc_acm
> [   16.235236] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
> [   16.240235] uvcvideo: Found UVC 1.00 device Laptop_Integrated_Webcam_FHD (05ca:181c)
> [   16.269474] input: Laptop_Integrated_Webcam_FHD as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/input/input9
> [   16.269579] usbcore: registered new interface driver uvcvideo
> [   16.269581] USB Video Class driver (1.1.1)
> [   16.277415] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> [   16.296646] usb 2-1.6: MAC-Address: 02:80:37:ec:02:00
> [   16.296810] cdc_ncm 2-1.6:1.6: usb0: register 'cdc_ncm' at usb-0000:00:1d.0-1.6, CDC NCM, 02:80:37:ec:02:00
> [   16.296847] usbcore: registered new interface driver cdc_ncm
> [   16.310604] parport_pc 00:08: activated
> [   16.310611] parport_pc 00:08: reported by Plug and Play ACPI
> [   16.310781] parport_pc 00:08: disabled
> [   16.311583] tpm_tis 00:0a: 1.2 TPM (device-id 0x2001, rev-id 32)
> [   16.399296] Bluetooth: Core ver 2.16
> [   16.399312] NET: Registered protocol family 31
> [   16.399314] Bluetooth: HCI device and connection manager initialized
> [   16.399317] Bluetooth: HCI socket layer initialized
> [   16.399318] Bluetooth: L2CAP socket layer initialized
> [   16.399325] Bluetooth: SCO socket layer initialized
> [   16.450583] xen: registering gsi 22 triggering 0 polarity 1
> [   16.450600] xen: --> pirq=22 -> irq=22 (gsi=22)
> [   16.567577] usbcore: registered new interface driver btusb
> [   16.739259] dcdbas dcdbas: Dell Systems Management Base Driver (version 5.6.0-3.2)
> [   16.819125] input: Dell WMI hotkeys as /devices/virtual/input/input10
> [   16.925000] microcode: CPU1 sig=0x206a7, pf=0x10, revision=0x23
> [   16.929246] ppdev: user-space parallel port driver
> [   16.954783] microcode: CPU2 sig=0x206a7, pf=0x10, revision=0x23
> [   16.975176] microcode: CPU3 sig=0x206a7, pf=0x10, revision=0x23
> [   17.004696] microcode: Microcode Update Driver: v2.00 <tigran@aivazian.fsnet.co.uk>, Peter Oruba
> [   17.067123] ALSA hda_codec.c:5101 autoconfig: line_outs=1 (0xe/0x0/0x0/0x0/0x0) type:line
> [   17.067127] ALSA hda_codec.c:5105    speaker_outs=1 (0xd/0x0/0x0/0x0/0x0)
> [   17.067129] ALSA hda_codec.c:5109    hp_outs=1 (0xb/0x0/0x0/0x0/0x0)
> [   17.067131] ALSA hda_codec.c:5110    mono: mono_out=0x0
> [   17.067133] ALSA hda_codec.c:5114    inputs:
> [   17.067135] ALSA hda_codec.c:5118  Mic=0xa
> [   17.067137] ALSA hda_codec.c:5118  Dock Mic=0xf
> [   17.067139] ALSA hda_codec.c:5120 
> [   17.067637] ALSA patch_sigmatel.c:3117 stac92xx: dac_nids=1 (0x13/0x0/0x0/0x0/0x0)
> [   17.081104] input: HDA Intel PCH HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input11
> [   17.081194] input: HDA Intel PCH HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input12
> [   17.081250] input: HDA Intel PCH HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input13
> [   17.081342] input: HDA Intel PCH Dock Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input14
> [   17.081432] input: HDA Intel PCH Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input15
> [   17.081522] input: HDA Intel PCH Headphone as /devices/pci0000:00/0000:00:1b.0/sound/card0/input16
> [   17.081610] input: HDA Intel PCH Dock Line Out as /devices/pci0000:00/0000:00:1b.0/sound/card0/input17
> [   17.265462] Event-channel device installed.
> [   17.661764] EXT4-fs (dm-1): re-mounted. Opts: (null)
> [   17.802446] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
> [   19.361631] Adding 17137660k swap on /dev/mapper/vg_dom0-lv_swap.  Priority:-1 extents:1 across:17137660k SS
> [   22.602549] ehci_hcd 0000:00:1a.0: remove, state 1
> [   22.602568] usb usb1: USB disconnect, device number 1
> [   22.602573] usb 1-1: USB disconnect, device number 2
> [   22.602578] usb 1-1.4: USB disconnect, device number 3
> [   22.605235] usb 1-1.5: USB disconnect, device number 4
> [   22.636910] ehci_hcd 0000:00:1a.0: USB bus 1 deregistered
> [   22.637183] pciback 0000:00:1a.0: seizing device
> [   22.637235] xen: registering gsi 16 triggering 0 polarity 1
> [   22.637241] Already setup the GSI :16
> [   22.662363] ehci_hcd 0000:00:1d.0: remove, state 1
> [   22.662371] usb usb2: USB disconnect, device number 1
> [   22.662373] usb 2-1: USB disconnect, device number 2
> [   22.662376] usb 2-1.6: USB disconnect, device number 3
> [   22.668531] cdc_ncm 2-1.6:1.6: usb0: unregister 'cdc_ncm' usb-0000:00:1d.0-1.6, CDC NCM
> [   22.694795] usb 2-1.8: USB disconnect, device number 4
> [   22.699298] ehci_hcd 0000:00:1d.0: USB bus 2 deregistered
> [   22.699577] pciback 0000:00:1d.0: seizing device
> [   22.699632] xen: registering gsi 17 triggering 0 polarity 1
> [   22.699637] Already setup the GSI :17
> [   23.684708] xen-pciback: vpci: 0000:00:19.0: assign to virtual slot 0
> [   23.685240] xen-pciback: vpci: 0000:00:1a.0: assign to virtual slot 1
> [   23.685722] xen-pciback: vpci: 0000:00:1d.0: assign to virtual slot 2
> [   23.686764] xen-pciback: vpci: 0000:02:00.0: assign to virtual slot 3
> [   23.909636] pciback 0000:00:19.0: Driver tried to write to a read-only configuration space field at offset 0xd2, size 2. This may be harmless, but if you have problems with your device:
> [   23.909638] 1) see permissive attribute in sysfs
> [   23.909638] 2) report problems to the xen-devel mailing list along with details of your device obtained from lspci.
> [   23.917523] pciback 0000:02:00.0: Driver tried to write to a read-only configuration space field at offset 0xd2, size 2. This may be harmless, but if you have problems with your device:
> [   23.917526] 1) see permissive attribute in sysfs
> [   23.917526] 2) report problems to the xen-devel mailing list along with details of your device obtained from lspci.
> [   24.123663] xen-blkback:ring-ref 9, event-channel 14, protocol 1 (x86_64-abi)
> [   24.140460] xen-blkback:ring-ref 10, event-channel 15, protocol 1 (x86_64-abi)
> [   24.151420] xen-blkback:ring-ref 11, event-channel 16, protocol 1 (x86_64-abi)
> [   24.158428] xen-blkback:ring-ref 12, event-channel 17, protocol 1 (x86_64-abi)
> [   28.697615] pciback 0000:00:1a.0: enabling device (0000 -> 0002)
> [   28.697628] xen: registering gsi 16 triggering 0 polarity 1
> [   28.697634] Already setup the GSI :16
> [   28.697805] pciback 0000:00:1a.0: setting latency timer to 64
> [   28.713578] pciback 0000:00:19.0: enabling device (0000 -> 0003)
> [   28.713591] xen: registering gsi 20 triggering 0 polarity 1
> [   28.713598] Already setup the GSI :20
> [   28.713858] pciback 0000:00:19.0: setting latency timer to 64
> [   29.021371] pciback 0000:00:1d.0: enabling device (0000 -> 0002)
> [   29.021389] xen: registering gsi 17 triggering 0 polarity 1
> [   29.021400] Already setup the GSI :17
> [   29.021805] pciback 0000:00:1d.0: setting latency timer to 64
> [   29.150053] pciback 0000:02:00.0: enabling device (0000 -> 0002)
> [   29.150122] xen: registering gsi 17 triggering 0 polarity 1
> [   29.150150] Already setup the GSI :17
> [   33.635416] xen-blkback:ring-ref 9, event-channel 14, protocol 1 (x86_64-abi)
> [   33.643330] xen-blkback:ring-ref 10, event-channel 15, protocol 1 (x86_64-abi)
> [   33.651561] xen-blkback:ring-ref 11, event-channel 16, protocol 1 (x86_64-abi)
> [   33.672105] xen-blkback:ring-ref 12, event-channel 17, protocol 1 (x86_64-abi)
> [  104.230911] xen-blkback:ring-ref 9, event-channel 24, protocol 1 (x86_64-abi)
> [  104.252421] xen-blkback:ring-ref 10, event-channel 25, protocol 1 (x86_64-abi)
> [  104.253177] xen-blkback:ring-ref 11, event-channel 26, protocol 1 (x86_64-abi)
> [  104.254220] xen-blkback:ring-ref 12, event-channel 27, protocol 1 (x86_64-abi)
> [  105.086732] xen-blkback:ring-ref 9, event-channel 14, protocol 1 (x86_64-abi)
> [  105.105505] xen-blkback:ring-ref 10, event-channel 15, protocol 1 (x86_64-abi)
> [  105.115951] xen-blkback:ring-ref 11, event-channel 16, protocol 1 (x86_64-abi)
> [  105.127384] xen-blkback:ring-ref 12, event-channel 17, protocol 1 (x86_64-abi)
> [  105.929760] xen-blkback:ring-ref 9, event-channel 14, protocol 1 (x86_64-abi)
> [  105.934841] xen-blkback:ring-ref 10, event-channel 15, protocol 1 (x86_64-abi)
> [  105.973920] xen-blkback:ring-ref 11, event-channel 16, protocol 1 (x86_64-abi)
> [  105.975320] xen-blkback:ring-ref 12, event-channel 17, protocol 1 (x86_64-abi)
> [  107.191781] xen-blkback:ring-ref 9, event-channel 14, protocol 1 (x86_64-abi)
> [  107.203711] xen-blkback:ring-ref 10, event-channel 15, protocol 1 (x86_64-abi)
> [  107.208481] xen-blkback:ring-ref 11, event-channel 16, protocol 1 (x86_64-abi)
> [  107.212081] xen-blkback:ring-ref 12, event-channel 17, protocol 1 (x86_64-abi)
> [  733.434608] PM: Syncing filesystems ... done.
> [  733.436228] PM: Preparing system for mem sleep
> [  733.514803] Freezing user space processes ... (elapsed 0.01 seconds) done.
> [  733.530594] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
> [  733.546589] PM: Entering mem sleep
> [  733.546741] Suspending console(s) (use no_console_suspend to debug)
> [  733.547431] sd 0:0:0:0: [sda] Synchronizing SCSI cache
> [  733.558336] sd 0:0:0:0: [sda] Stopping disk
> [  734.194656] PM: suspend of devices complete after 647.504 msecs
> [  734.195026] PM: late suspend of devices complete after 0.359 msecs
> [  734.210655] PM: noirq suspend of devices complete after 15.614 msecs
> [  734.211326] ACPI: Preparing to enter system sleep state S3
> [  734.235008] PM: Saving platform NVS memory
> [  734.328066] Disabling non-boot CPUs ...
> [  735.945491] ACPI: Low-level resume complete
> [  735.945579] PM: Restoring platform NVS memory
> [  736.000094] Enabling non-boot CPUs ...
> [  736.000256] installing Xen timer for CPU 1
> [  736.004594] CPU1 is up
> [  736.004819] installing Xen timer for CPU 2
> [  736.067516] CPU2 is up
> [  736.067770] installing Xen timer for CPU 3
> [  736.101535] CPU3 is up
> [  736.102470] ACPI: Waking up from system sleep state S3
> [  736.555932] PM: noirq resume of devices complete after 7.970 msecs
> [  736.556506] PM: early resume of devices complete after 0.387 msecs
> [  736.660336] i915 0000:00:02.0: setting latency timer to 64
> [  736.660404] pciback 0000:00:19.0: setting latency timer to 64
> [  736.660453] xen: registering gsi 16 triggering 0 polarity 1
> [  736.660460] Already setup the GSI :16
> [  736.660490] pciback 0000:00:1a.0: setting latency timer to 64
> [  736.660605] xen: registering gsi 17 triggering 0 polarity 1
> [  736.660610] Already setup the GSI :17
> [  736.660641] pciback 0000:00:1d.0: setting latency timer to 64
> [  736.660696] xen: registering gsi 22 triggering 0 polarity 1
> [  736.660701] Already setup the GSI :22
> [  736.661221] ahci 0000:00:1f.2: setting latency timer to 64
> [  736.689606] xen: registering gsi 18 triggering 0 polarity 1
> [  736.689608] Already setup the GSI :18
> [  736.689704] xen: registering gsi 17 triggering 0 polarity 1
> [  736.689706] Already setup the GSI :17
> [  736.711623] [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp off
> [  736.802676] watchdog: INTCAMT: cannot register miscdev on minor=130 (err=-16)
> [  736.802678] watchdog: error registering /dev/watchdog (err=-16)
> [  736.802680] mei 0000:00:16.0: unable to register watchdog device.
> [  737.060106] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> [  737.060330] ata4: SATA link down (SStatus 0 SControl 300)
> [  737.060372] ata5: SATA link down (SStatus 0 SControl 300)
> [  737.074123] ata2.00: configured for UDMA/133
> [  737.117629] ata6: SATA link down (SStatus 0 SControl 300)
> [  738.619036] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
> [  738.743565] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by device (Stat=0x51 Err=0x04)
> [  738.901088] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by device (Stat=0x51 Err=0x04)
> [  738.903441] ata1.00: configured for UDMA/100
> [  738.903843] sd 0:0:0:0: [sda] Starting disk
> [  738.905367] PM: resume of devices complete after 2348.851 msecs
> [  738.905922] PM: Finishing wakeup.
> [  738.905926] Restarting tasks ... done.
> [  738.911334] video LNXVIDEO:00: Restoring backlight state
> [  739.836250] dell_wmi: Received unknown WMI event (0x0)
> [  740.184759] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> [  740.239730] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> [  740.327711] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> [  740.373931] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> [  742.542022] hrtimer: interrupt took 102980031 ns
> [  757.609031] [sched_delayed] sched: RT throttling activated
> [  760.164427] hda-intel: IRQ timing workaround is activated for card #0. Suggest a bigger bdl_pos_adj.

> (XEN) Xen version 4.1.3 (user@marmarek.net) (gcc version 4.4.5 20101112 (Red Hat 4.4.5-2) (GCC) ) Mon Nov 26 15:25:32 EST 2012
> (XEN) Latest ChangeSet: unavailable
> (XEN) Bootloader: GNU GRUB 0.97
> (XEN) Command line: console=none cpufreq=verbose=1
> (XEN) Video information:
> (XEN)  VGA is text mode 80x25, font 8x16
> (XEN)  VBE/DDC methods: V2; EDID transfer time: 1 seconds
> (XEN) Disc information:
> (XEN)  Found 1 MBR signatures
> (XEN)  Found 1 EDD information structures
> (XEN) Xen-e820 RAM map:
> (XEN)  0000000000000000 - 000000000009a800 (usable)
> (XEN)  000000000009a800 - 00000000000a0000 (reserved)
> (XEN)  00000000000e0000 - 0000000000100000 (reserved)
> (XEN)  0000000000100000 - 0000000007eea000 (usable)
> (XEN)  0000000007eea000 - 0000000007f67000 (ACPI NVS)
> (XEN)  0000000007f67000 - 0000000007f70000 (usable)
> (XEN)  0000000007f70000 - 0000000007f76000 (ACPI NVS)
> (XEN)  0000000007f76000 - 0000000007f78000 (usable)
> (XEN)  0000000007f78000 - 0000000008000000 (ACPI NVS)
> (XEN)  0000000008000000 - 000000000dffd000 (usable)
> (XEN)  000000000dffd000 - 000000000e000000 (ACPI data)
> (XEN)  000000000e000000 - 0000000020000000 (usable)
> (XEN)  0000000020000000 - 0000000020200000 (reserved)
> (XEN)  0000000020200000 - 0000000040000000 (usable)
> (XEN)  0000000040000000 - 0000000040200000 (reserved)
> (XEN)  0000000040200000 - 00000000c83b4000 (usable)
> (XEN)  00000000c83b4000 - 00000000c840a000 (reserved)
> (XEN)  00000000c840a000 - 00000000c840e000 (usable)
> (XEN)  00000000c840e000 - 00000000c840f000 (reserved)
> (XEN)  00000000c840f000 - 00000000c8411000 (usable)
> (XEN)  00000000c8411000 - 00000000c8414000 (reserved)
> (XEN)  00000000c8414000 - 00000000c841e000 (usable)
> (XEN)  00000000c841e000 - 00000000c8428000 (reserved)
> (XEN)  00000000c8428000 - 00000000c8432000 (usable)
> (XEN)  00000000c8432000 - 00000000c8436000 (reserved)
> (XEN)  00000000c8436000 - 00000000cac00000 (usable)
> (XEN)  00000000cb800000 - 00000000cfa00000 (reserved)
> (XEN)  00000000fed1c000 - 00000000fed20000 (reserved)
> (XEN)  00000000ffc00000 - 00000000ffc20000 (reserved)
> (XEN)  0000000100000000 - 000000042e000000 (usable)
> (XEN) ACPI: RSDP 000FE300, 0024 (r2 DELL  )
> (XEN) ACPI: XSDT 0DFFEE18, 007C (r1 DELL    CBX3     6222004 MSFT    10013)
> (XEN) ACPI: FACP 07F90D98, 00F4 (r4 DELL    CBX3     6222004 MSFT    10013)
> (XEN) ACPI: DSDT 07F5E018, 8834 (r2 INT430 SYSFexxx     1001 INTL 20090903)
> (XEN) ACPI: FACS 07FEDD40, 0040
> (XEN) ACPI: APIC 0DFFDF18, 00CC (r2 DELL    CBX3     6222004 MSFT    10013)
> (XEN) ACPI: TCPA 07FEED18, 0032 (r2                        0             0)
> (XEN) ACPI: SSDT 07F91A98, 02F9 (r1 DELLTP      TPM     3000 INTL 20090903)
> (XEN) ACPI: MCFG 07FEEC98, 003C (r1 DELL   SNDYBRDG  6222004 MSFT       97)
> (XEN) ACPI: HPET 07FEEC18, 0038 (r1 A M I   PCHHPET  6222004 AMI.        3)
> (XEN) ACPI: BOOT 07FEEB98, 0028 (r1 DELL   CBX3      6222004 AMI     10013)
> (XEN) ACPI: SSDT 07F75018, 0804 (r1  PmRef  Cpu0Ist     3000 INTL 20090903)
> (XEN) ACPI: SSDT 07F74018, 0996 (r1  PmRef    CpuPm     3000 INTL 20090903)
> (XEN) ACPI: DMAR 07F90C18, 00E8 (r1 INTEL      SNB         1 INTL        1)
> (XEN) ACPI: SLIC 07F7EC18, 0176 (r3 DELL    CBX3     6222004 MSFT    10013)
> (XEN) System RAM: 16262MB (16652432kB)
> (XEN) Domain heap initialised
> (XEN) ACPI: 32/64X FACS address mismatch in FADT - 07fede40/0000000007fedd40, using 32
> (XEN) Processor #0 6:10 APIC version 21
> (XEN) Processor #2 6:10 APIC version 21
> (XEN) Processor #1 6:10 APIC version 21
> (XEN) Processor #3 6:10 APIC version 21
> (XEN) IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-23
> (XEN) Enabling APIC mode:  Flat.  Using 1 I/O APICs
> (XEN) Table is not found!
> (XEN) Switched to APIC driver x2apic_cluster.
> (XEN) Using scheduler: SMP Credit Scheduler (credit)
> (XEN) Detected 2494.416 MHz processor.
> (XEN) Initing memory sharing.
> (XEN) Intel VT-d supported page sizes: 4kB.
> (XEN) Intel VT-d supported page sizes: 4kB.
> (XEN) Intel VT-d Snoop Control not enabled.
> (XEN) Intel VT-d Dom0 DMA Passthrough not enabled.
> (XEN) Intel VT-d Queued Invalidation enabled.
> (XEN) Intel VT-d Interrupt Remapping enabled.
> (XEN) Intel VT-d Shared EPT tables not enabled.
> (XEN) I/O virtualisation enabled
> (XEN)  - Dom0 mode: Relaxed
> (XEN) Enabled directed EOI with ioapic_ack_old on!
> (XEN) ENABLING IO-APIC IRQs
> (XEN)  -> Using old ACK method
> (XEN) Platform timer appears to have unexpectedly wrapped 1 times.
> (XEN) Platform timer is 14.318MHz HPET
> (XEN) Allocated console ring of 16 KiB.
> (XEN) VMX: Supported advanced features:
> (XEN)  - APIC MMIO access virtualisation
> (XEN)  - APIC TPR shadow
> (XEN)  - Extended Page Tables (EPT)
> (XEN)  - Virtual-Processor Identifiers (VPID)
> (XEN)  - Virtual NMI
> (XEN)  - MSR direct-access bitmap
> (XEN)  - Unrestricted Guest
> (XEN) HVM: ASIDs enabled.
> (XEN) HVM: VMX enabled
> (XEN) HVM: Hardware Assisted Paging (HAP) detected
> (XEN) HVM: HAP page sizes: 4kB, 2MB
> (XEN) Brought up 4 CPUs
> (XEN) *** LOADING DOMAIN 0 ***
> (XEN)  Xen  kernel: 64-bit, lsb, compat32
> (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x1e13000
> (XEN) PHYSICAL MEMORY ARRANGEMENT:
> (XEN)  Dom0 alloc.:   0000000418000000->000000041c000000 (4046567 pages to be allocated)
> (XEN)  Init. ramdisk: 000000042b335000->000000042dfffc00
> (XEN) VIRTUAL MEMORY ARRANGEMENT:
> (XEN)  Loaded kernel: ffffffff81000000->ffffffff81e13000
> (XEN)  Init. ramdisk: ffffffff81e13000->ffffffff84addc00
> (XEN)  Phys-Mach map: ffffffff84ade000->ffffffff869f3d90
> (XEN)  Start info:    ffffffff869f4000->ffffffff869f44b4
> (XEN)  Page tables:   ffffffff869f5000->ffffffff86a2e000
> (XEN)  Boot stack:    ffffffff86a2e000->ffffffff86a2f000
> (XEN)  TOTAL:         ffffffff80000000->ffffffff86c00000
> (XEN)  ENTRY ADDRESS: ffffffff8188e200
> (XEN) Dom0 has maximum 4 VCPUs
> (XEN) Scrubbing Free RAM: .done.
> (XEN) Xen trace buffers: disabled
> (XEN) Std. Loglevel: Errors and warnings
> (XEN) Guest Loglevel: Nothing (Rate-limited: Errors and warnings)
> (XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to Xen)
> (XEN) Freed 216kB init memory.
> (XEN) no cpu_id for acpi_id 5
> (XEN) no cpu_id for acpi_id 6
> (XEN) no cpu_id for acpi_id 7
> (XEN) no cpu_id for acpi_id 8
> (XEN) physdev.c:171: dom0: wrong map_pirq type 3
> (XEN) traps.c:2488:d1 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc9000057b030.
> (XEN) traps.c:2488:d1 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc90000718030.
> (XEN) traps.c:2488:d2 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc900004f2030.
> (XEN) traps.c:2488:d2 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc900004fa030.
> (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc90000251030.
> (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc90000263030.
> (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc9000026b030.
> (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc90000273030.
> (XEN) traps.c:2488:d4 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc900004f2030.
> (XEN) traps.c:2488:d4 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc90000015030.
> (XEN) traps.c:2488:d5 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc900004f2030.
> (XEN) traps.c:2488:d5 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc90000015030.
> (XEN) traps.c:2488:d6 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc900004f2030.
> (XEN) traps.c:2488:d6 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc900004fa030.
> (XEN) Disabling non-boot CPUs ...
> (XEN) Broke affinity for irq 1
> (XEN) Broke affinity for irq 8
> (XEN) Broke affinity for irq 9
> (XEN) Broke affinity for irq 12
> (XEN) Broke affinity for irq 17
> (XEN) Broke affinity for irq 31
> (XEN) Broke affinity for irq 16
> (XEN) Broke affinity for irq 20
> (XEN) Entering ACPI S3 state.
> (XEN) mce_intel.c:1162: MCA Capability: BCAST 1 SER 0 CMCI 1 firstbank 0 extended MCE MSR 0
> (XEN) CPU0 CMCI LVT vector (0xf7) already installed
> (XEN) CPU0: Thermal LVT vector (0xfa) already installed
> (XEN) Finishing wakeup from ACPI S3 state.
> (XEN) Enabling non-boot CPUs  ...
> (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc90000524030.
> (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc9000052c030.
> (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc90000015030.
> (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from 0x0000000000000000 to 0xffffc9000001d030.
> (XEN) Dumping timer queues:
> (XEN) CPU00:
> (XEN)   ex=     126us timer=ffff8300c83b0060 cb=ffff82c48011e420(ffff8300c83b0000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=    1778us timer=ffff8304222f9de8 cb=ffff82c480118250(0000000000000000) csched_tick+0x0/0x2e0
> (XEN)   ex=     126us timer=ffff8300c81fc060 cb=ffff82c48011e420(ffff8300c81fc000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   17227us timer=ffff82c4802bb980 cb=ffff82c480138ff0(ffff82c4802bb940) do_dbs_timer+0x0/0x250
> (XEN)   ex=   20744us timer=ffff830030094060 cb=ffff82c48011e420(ffff830030094000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   27945us timer=ffff8304222fdde0 cb=ffff82c480116f20(ffff8304222fddc0) csched_acct+0x0/0x460
> (XEN)   ex=   29949us timer=ffff82c4802bb760 cb=ffff82c48011ded0(0000000000000000) s_timer_fn+0x0/0x20
> (XEN)   ex=   87774us timer=ffff83008db6a060 cb=ffff82c48011e420(ffff83008db6a000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   79252us timer=ffff82c4802b3880 cb=ffff82c480177160(0000000000000000) time_calibration+0x0/0x60
> (XEN)   ex=  703146us timer=ffff8300a6b9c060 cb=ffff82c48011e420(ffff8300a6b9c000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   35612us timer=ffff8300330dc060 cb=ffff82c48011e420(ffff8300330dc000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   97688us timer=ffff8300a6b98060 cb=ffff82c48011e420(ffff8300a6b98000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   30003us timer=ffff8300b129a060 cb=ffff82c48011e420(ffff8300b129a000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   92679us timer=ffff8300c94a6060 cb=ffff82c48011e420(ffff8300c94a6000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex= 4135118us timer=ffff8300bdca6060 cb=ffff82c48011e420(ffff8300bdca6000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   96411us timer=ffff8300b128e060 cb=ffff82c48011e420(ffff8300b128e000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex= 1337866us timer=ffff8300a6b94060 cb=ffff82c48011e420(ffff8300a6b94000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   91194us timer=ffff830034b98060 cb=ffff82c48011e420(ffff830034b98000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   97955us timer=ffff83007d948060 cb=ffff82c48011e420(ffff83007d948000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex= 4135163us timer=ffff8300c5336060 cb=ffff82c48011e420(ffff8300c5336000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=123464409us timer=ffff82c4802b3980 cb=ffff82c480176ef0(0000000000000000) plt_overflow+0x0/0x190
> (XEN)   ex=   95968us timer=ffff8300a6b96060 cb=ffff82c48011e420(ffff8300a6b96000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=12401701us timer=ffff82c4802b65a0 cb=ffff82c48019eb10(0000000000000000) mce_work_fn+0x0/0xd0
> (XEN)   ex=   97804us timer=ffff8300301a8060 cb=ffff82c48011e420(ffff8300301a8000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   97841us timer=ffff8300bd810060 cb=ffff82c48011e420(ffff8300bd810000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   98039us timer=ffff83007d94c060 cb=ffff82c48011e420(ffff83007d94c000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=   94727us timer=ffff83008db6e060 cb=ffff82c48011e420(ffff83008db6e000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN)   ex=  319927us timer=ffff8300c840c060 cb=ffff82c48011e420(ffff8300c840c000) vcpu_singleshot_timer_fn+0x0/0x10
> (XEN) CPU01:
> (XEN) CPU02:
> (XEN) CPU03:
> (XEN) 'c' pressed -> printing ACPI Cx structures
> (XEN) ==cpu0==
> (XEN) active state:		C3
> (XEN) max_cstate:		C7
> (XEN) states:
> (XEN)     C1:	type[C1] latency[000] usage[00254665] method[ HALT] duration[62720099833]
> (XEN)     C2:	type[C2] latency[080] usage[00069505] method[SYSIO] duration[36499255195]
> (XEN)    *C3:	type[C3] latency[109] usage[01828952] method[SYSIO] duration[5562126933174]
> (XEN)     C0:	usage[02153122] duration[2042526389598]
> (XEN) PC3[0] PC6[0] PC7[0]
> (XEN) CC3[0] CC6[0]
> (XEN) ==cpu1==
> (XEN) active state:		C1
> (XEN) max_cstate:		C7
> (XEN) states:
> (XEN)    *C1:	type[C1] latency[000] usage[00808027] method[ HALT] duration[6978799306750]
> (XEN)     C0:	usage[00808027] duration[725073398104]
> (XEN) PC3[0] PC6[0] PC7[0]
> (XEN) CC3[0] CC6[0]
> (XEN) ==cpu2==
> (XEN) active state:		C1
> (XEN) max_cstate:		C7
> (XEN) states:
> (XEN)    *C1:	type[C1] latency[000] usage[00825022] method[ HALT] duration[6981527416097]
> (XEN)     C0:	usage[00825022] duration[722345319882]
> (XEN) PC3[0] PC6[0] PC7[0]
> (XEN) CC3[0] CC6[0]
> (XEN) ==cpu3==
> (XEN) active state:		C1
> (XEN) max_cstate:		C7
> (XEN) states:
> (XEN)    *C1:	type[C1] latency[000] usage[00810292] method[ HALT] duration[6980835907857]
> (XEN)     C0:	usage[00810292] duration[723036844779]
> (XEN) PC3[0] PC6[0] PC7[0]
> (XEN) CC3[0] CC6[0]




> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 21:42:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 21:42:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeYM3-0008BM-6x; Fri, 30 Nov 2012 21:42:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bhelgaas@google.com>) id 1TeYM1-0008BH-Bd
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 21:42:37 +0000
Received: from [85.158.139.83:26680] by server-8.bemta-5.messagelabs.com id
	47/1A-06050-C4829B05; Fri, 30 Nov 2012 21:42:36 +0000
X-Env-Sender: bhelgaas@google.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1354311755!25166267!1
X-Originating-IP: [209.85.217.173]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1143 invoked from network); 30 Nov 2012 21:42:35 -0000
Received: from mail-lb0-f173.google.com (HELO mail-lb0-f173.google.com)
	(209.85.217.173)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 21:42:35 -0000
Received: by mail-lb0-f173.google.com with SMTP id c1so1010588lbg.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 13:42:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type;
	bh=JAFq1MZ6tXL1x6AValG/iTYBaz+aNTR0leDxQ876gOs=;
	b=c0+5o/JW52++PuY6Y49+nOWcwCwMsLvt6UfB52vPn6S+eyzLLURAXnzpu7V0mwqMNU
	6po+4SYmUh5I3xIQEiqUn3Hi3AD0SKjDrtSBBMwenvRSM/4bPO/rdNGTcPucPm0c0pUv
	F63gwJrTcBPPW5OuTTvraVloGLHKXw2ZYwlF6A2iZAYPPysnMZkG8M1rvhSajjDfzra/
	o2abS3gb008NPCuHoyrtsQhY7EPDVKBK8bEAD0AIzgDSdldIxQzjAzW++Tas88uLqLxE
	ixUzOvPVfIqlGoBpQwtzgdAr7ONLVCpvYXSki85iZg4gl0sOYxJMVQGiTvxAS+dFzRI3
	CALA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type:x-gm-message-state;
	bh=JAFq1MZ6tXL1x6AValG/iTYBaz+aNTR0leDxQ876gOs=;
	b=af41VJqFA2h3x7ol8aPfQLoH2f4fIgAV/5sI/VeGXCYuBpqdntMb5VDr4quEohd+u2
	+OBymmSD6an0Kc1Heh0f6KcFjUo8V8wMoVsyVJVC5tSRrFo1aj1S91C0dBJqz53eCn1t
	5LXdVUbmhuL2PSf+8XcQYQspqucvqUQB2XXpr/GZPpBpozocxU73gEYcCPv8DbKME1+a
	yJXdM+lEch5Quhe4o8nptKnnhxSH+0yakjR5lnSN0Bhud1ikqDjBf0BX5XrcM0kF6kMp
	wsdhPD51nL6IUU28sAK5kV9YIbewBEvB7YvRV5L3noY3IrNh/E2cadCcS5fhduYjT8hk
	YZQg==
Received: by 10.112.13.232 with SMTP id k8mr1349139lbc.90.1354311754964; Fri,
	30 Nov 2012 13:42:34 -0800 (PST)
MIME-Version: 1.0
Received: by 10.112.80.232 with HTTP; Fri, 30 Nov 2012 13:42:14 -0800 (PST)
In-Reply-To: <CAErSpo6jBTGQYdPK==u7zjDuhV+U5iUfUp_KZnxkhvZCU4difQ@mail.gmail.com>
References: <507FD39F.4060601@citrix.com>
	<1350554618-14582-3-git-send-email-david.vrabel@citrix.com>
	<20121019125919.GC26830@phenom.dumpdata.com>
	<CAErSpo6jBTGQYdPK==u7zjDuhV+U5iUfUp_KZnxkhvZCU4difQ@mail.gmail.com>
From: Bjorn Helgaas <bhelgaas@google.com>
Date: Fri, 30 Nov 2012 14:42:14 -0700
Message-ID: <CAErSpo7Vob9CiRxK+E2nV2V7G4FCss6zLCPO93PMSDj9G55ywg@mail.gmail.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
X-Gm-Message-State: ALoCoQkblzEuWelxINgKrwc+Evj6NKf17pzzZsILltTBrEGeqQ6f/zNPPZK0bDI2ZIeRkUy6a2GQKcZ+xLFqSokIjejL5c6VOGRqyQew/x2z90130r8889AU4qs4hbuYvkwx4zh60dgtXxQD9X8oYK2Yk4hWpz5Bky10c5tarTo813Ee87Q6Hh03GzwOcgqzfURK+6XsYM1/
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	David Vrabel <david.vrabel@citrix.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 3/5] xen-pcifront: handle backend CLOSED
	without CLOSING
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 11:41 AM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> On Fri, Oct 19, 2012 at 6:59 AM, Konrad Rzeszutek Wilk
> <konrad.wilk@oracle.com> wrote:
>> On Thu, Oct 18, 2012 at 11:03:36AM +0100, David Vrabel wrote:
>>> From: David Vrabel <david.vrabel@citrix.com>
>>>
>>> Backend drivers shouldn't transistion to CLOSED unless the frontend is
>>> CLOSED.  If a backend does transition to CLOSED too soon then the
>>> frontend may not see the CLOSING state and will not properly shutdown.
>>>
>>> So, treat an unexpected backend CLOSED state the same as CLOSING.
>>>
>>> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
>>> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>>> ---
>>> Cc: linux-pci@vger.kernel.org
>>> Cc: Bjorn Helgaas <bhelgaas@google.com>
>>
>> Bjorn, do you want me to prep a git pull with this patch
>> or can I have your Ack to put it my tree and have it part of my
>> git pull to Linus?
>
> Sorry, I missed this.  I can put it in my -next branch for the v3.8
> merge window.  Would that work for you?

I put this in my -next branch, so we'll at least have a chance of
making a linux-next cycle before v3.7 pops.

>>> ---
>>>  drivers/pci/xen-pcifront.c |    5 ++++-
>>>  1 files changed, 4 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
>>> index 0aab85a..a0c7312 100644
>>> --- a/drivers/pci/xen-pcifront.c
>>> +++ b/drivers/pci/xen-pcifront.c
>>> @@ -1068,13 +1068,16 @@ static void __init_refok pcifront_backend_changed(struct xenbus_device *xdev,
>>>       case XenbusStateInitialising:
>>>       case XenbusStateInitWait:
>>>       case XenbusStateInitialised:
>>> -     case XenbusStateClosed:
>>>               break;
>>>
>>>       case XenbusStateConnected:
>>>               pcifront_try_connect(pdev);
>>>               break;
>>>
>>> +     case XenbusStateClosed:
>>> +             if (xdev->state == XenbusStateClosed)
>>> +                     break;
>>> +             /* Missed the backend's CLOSING state -- fallthrough */
>>>       case XenbusStateClosing:
>>>               dev_warn(&xdev->dev, "backend going away!\n");
>>>               pcifront_try_disconnect(pdev);
>>> --
>>> 1.7.2.5

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 21:42:54 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 21:42:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeYM3-0008BM-6x; Fri, 30 Nov 2012 21:42:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <bhelgaas@google.com>) id 1TeYM1-0008BH-Bd
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 21:42:37 +0000
Received: from [85.158.139.83:26680] by server-8.bemta-5.messagelabs.com id
	47/1A-06050-C4829B05; Fri, 30 Nov 2012 21:42:36 +0000
X-Env-Sender: bhelgaas@google.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1354311755!25166267!1
X-Originating-IP: [209.85.217.173]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
  RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1143 invoked from network); 30 Nov 2012 21:42:35 -0000
Received: from mail-lb0-f173.google.com (HELO mail-lb0-f173.google.com)
	(209.85.217.173)
	by server-4.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 21:42:35 -0000
Received: by mail-lb0-f173.google.com with SMTP id c1so1010588lbg.32
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 13:42:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type;
	bh=JAFq1MZ6tXL1x6AValG/iTYBaz+aNTR0leDxQ876gOs=;
	b=c0+5o/JW52++PuY6Y49+nOWcwCwMsLvt6UfB52vPn6S+eyzLLURAXnzpu7V0mwqMNU
	6po+4SYmUh5I3xIQEiqUn3Hi3AD0SKjDrtSBBMwenvRSM/4bPO/rdNGTcPucPm0c0pUv
	F63gwJrTcBPPW5OuTTvraVloGLHKXw2ZYwlF6A2iZAYPPysnMZkG8M1rvhSajjDfzra/
	o2abS3gb008NPCuHoyrtsQhY7EPDVKBK8bEAD0AIzgDSdldIxQzjAzW++Tas88uLqLxE
	ixUzOvPVfIqlGoBpQwtzgdAr7ONLVCpvYXSki85iZg4gl0sOYxJMVQGiTvxAS+dFzRI3
	CALA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type:x-gm-message-state;
	bh=JAFq1MZ6tXL1x6AValG/iTYBaz+aNTR0leDxQ876gOs=;
	b=af41VJqFA2h3x7ol8aPfQLoH2f4fIgAV/5sI/VeGXCYuBpqdntMb5VDr4quEohd+u2
	+OBymmSD6an0Kc1Heh0f6KcFjUo8V8wMoVsyVJVC5tSRrFo1aj1S91C0dBJqz53eCn1t
	5LXdVUbmhuL2PSf+8XcQYQspqucvqUQB2XXpr/GZPpBpozocxU73gEYcCPv8DbKME1+a
	yJXdM+lEch5Quhe4o8nptKnnhxSH+0yakjR5lnSN0Bhud1ikqDjBf0BX5XrcM0kF6kMp
	wsdhPD51nL6IUU28sAK5kV9YIbewBEvB7YvRV5L3noY3IrNh/E2cadCcS5fhduYjT8hk
	YZQg==
Received: by 10.112.13.232 with SMTP id k8mr1349139lbc.90.1354311754964; Fri,
	30 Nov 2012 13:42:34 -0800 (PST)
MIME-Version: 1.0
Received: by 10.112.80.232 with HTTP; Fri, 30 Nov 2012 13:42:14 -0800 (PST)
In-Reply-To: <CAErSpo6jBTGQYdPK==u7zjDuhV+U5iUfUp_KZnxkhvZCU4difQ@mail.gmail.com>
References: <507FD39F.4060601@citrix.com>
	<1350554618-14582-3-git-send-email-david.vrabel@citrix.com>
	<20121019125919.GC26830@phenom.dumpdata.com>
	<CAErSpo6jBTGQYdPK==u7zjDuhV+U5iUfUp_KZnxkhvZCU4difQ@mail.gmail.com>
From: Bjorn Helgaas <bhelgaas@google.com>
Date: Fri, 30 Nov 2012 14:42:14 -0700
Message-ID: <CAErSpo7Vob9CiRxK+E2nV2V7G4FCss6zLCPO93PMSDj9G55ywg@mail.gmail.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
X-Gm-Message-State: ALoCoQkblzEuWelxINgKrwc+Evj6NKf17pzzZsILltTBrEGeqQ6f/zNPPZK0bDI2ZIeRkUy6a2GQKcZ+xLFqSokIjejL5c6VOGRqyQew/x2z90130r8889AU4qs4hbuYvkwx4zh60dgtXxQD9X8oYK2Yk4hWpz5Bky10c5tarTo813Ee87Q6Hh03GzwOcgqzfURK+6XsYM1/
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	David Vrabel <david.vrabel@citrix.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 3/5] xen-pcifront: handle backend CLOSED
	without CLOSING
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 11:41 AM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> On Fri, Oct 19, 2012 at 6:59 AM, Konrad Rzeszutek Wilk
> <konrad.wilk@oracle.com> wrote:
>> On Thu, Oct 18, 2012 at 11:03:36AM +0100, David Vrabel wrote:
>>> From: David Vrabel <david.vrabel@citrix.com>
>>>
>>> Backend drivers shouldn't transistion to CLOSED unless the frontend is
>>> CLOSED.  If a backend does transition to CLOSED too soon then the
>>> frontend may not see the CLOSING state and will not properly shutdown.
>>>
>>> So, treat an unexpected backend CLOSED state the same as CLOSING.
>>>
>>> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
>>> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>>> ---
>>> Cc: linux-pci@vger.kernel.org
>>> Cc: Bjorn Helgaas <bhelgaas@google.com>
>>
>> Bjorn, do you want me to prep a git pull with this patch
>> or can I have your Ack to put it my tree and have it part of my
>> git pull to Linus?
>
> Sorry, I missed this.  I can put it in my -next branch for the v3.8
> merge window.  Would that work for you?

I put this in my -next branch, so we'll at least have a chance of
making a linux-next cycle before v3.7 pops.

>>> ---
>>>  drivers/pci/xen-pcifront.c |    5 ++++-
>>>  1 files changed, 4 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
>>> index 0aab85a..a0c7312 100644
>>> --- a/drivers/pci/xen-pcifront.c
>>> +++ b/drivers/pci/xen-pcifront.c
>>> @@ -1068,13 +1068,16 @@ static void __init_refok pcifront_backend_changed(struct xenbus_device *xdev,
>>>       case XenbusStateInitialising:
>>>       case XenbusStateInitWait:
>>>       case XenbusStateInitialised:
>>> -     case XenbusStateClosed:
>>>               break;
>>>
>>>       case XenbusStateConnected:
>>>               pcifront_try_connect(pdev);
>>>               break;
>>>
>>> +     case XenbusStateClosed:
>>> +             if (xdev->state == XenbusStateClosed)
>>> +                     break;
>>> +             /* Missed the backend's CLOSING state -- fallthrough */
>>>       case XenbusStateClosing:
>>>               dev_warn(&xdev->dev, "backend going away!\n");
>>>               pcifront_try_disconnect(pdev);
>>> --
>>> 1.7.2.5

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 21:59:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 21:59:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeYc2-0000BH-SE; Fri, 30 Nov 2012 21:59:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TeYc1-0000B9-Lf
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 21:59:10 +0000
Received: from [85.158.139.83:57981] by server-6.bemta-5.messagelabs.com id
	98/5F-19321-C2C29B05; Fri, 30 Nov 2012 21:59:08 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1354312748!23602518!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8330 invoked from network); 30 Nov 2012 21:59:08 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 21:59:08 -0000
X-IronPort-AV: E=Sophos;i="4.84,194,1355097600"; d="scan'208";a="16100050"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 21:59:08 +0000
Received: from [10.30.249.68] (10.30.249.68) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 21:59:07 +0000
Message-ID: <50B92C2B.4050606@citrix.com>
Date: Fri, 30 Nov 2012 21:59:07 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <50B8EE13.6070301@citrix.com>
	<20121130175604.GB95877@ocelot.phlegethon.org>
In-Reply-To: <20121130175604.GB95877@ocelot.phlegethon.org>
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Woes of NMIs and MCEs, and possibly how to fix
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/2012 17:56, Tim Deegan wrote:
> At 17:34 +0000 on 30 Nov (1354296851), Andrew Cooper wrote:
>> Hello,
>>
>> Yesterday, Tim and myself spent a very long time in front of a
>> whiteboard trying to develop a fix which covered all the problems, and
>> sadly it is very hard.  We managed to possibly come up with a long
>> solution which we think has no race conditions, but relies on very large
>> sections of reentrant code which cant use the stack or trash registers. 
>> As such, is it is not practical at all (assuming that any of us could
>> actually code it)
> For the record, we also came up with a much simpler solution, which I
> prefer:
>  - The MCE handler should never return to Xen with IRET.
>  - The NMI handler should always return with IRET.
>  - There should be no faulting code in the NMI or MCE handlers.
>
> That covers all the interesting cases except (3), (4) and (7) below, and
> a simple per-cpu {nmi,mce}-in-progress flag will be enough to detect
> (and crash) on _almost_ all cases where that bites us (the other cases
> will crash less politely from their stacks being smashed).
>
> Even if we go on to build some more bulletproof solution, I think we
> should consider implementing that now, as the baseline.
>
> Tim.

D'oh - I knew I forgot something.  Yes - the above solution does fix a
large number of the issues.

Having no faults on the NMI/MCE paths is a good thing all round, and we
should strive for it.  But that does not mean that they wont creep back
in in the future.

What I shall do (assuming no holes are shot in that idea by this thread)
is develop this solution first, along with the VMX NMI issue fix.  It is
substantially easier than the alternative.

I will then work on developing the further solution (assuming no holes
are shot in that idea).  As I alluded to in the parent post, I believe a
modification to the Linux solution should allow us to detect most of the
reentrant cases and deal with them correctly, and should allow us to
detect any smashed stacks and deal with them more politely than we
otherwise would.

~Andrew

>
>> As a result, I thought instead that I would outline all the issues we
>> currently face.  We can then:
>>  * Decide which issues need fixing
>>  * Decide which issues need to at least be detected and crash gracefully
>>  * Decide which issues we are happy (or perhaps at least willing, if not
>> happy) to ignore
>>
>> So, the issues are as follows.  (I have tried to list them in a logical
>> order, with 1 individual problem per number, but please do point out if
>> I have missed/miss-attributed entries)
>>
>> 1) Faults on the NMI path will re-enable NMIs before the handler
>> returns, leading to reentrant behaviour.  We should audit the NMI path
>> to try and remove any needless cases which might fault, but getting a
>> fault-free path will be hard (and is not going so solve the reentrant
>> behaviour itself).
>>
>> 2) Faults on the MCE path will re-enable NMIs, as will the iret of the
>> MCE itself if an MCE interrupts an NMI.
>>
>> 3) SMM mode executing an iret will re-enable NMIs.  There is nothing we
>> can do to prevent this, and as an SMI can interrupt NMIs and MCEs, no
>> way to predict if/when it may happen.  The best we can do is accept that
>> it might happen, and try to deal with the after effects.
>>
>> 4) "Fake NMIs" can be caused by hardware with access to the INTR pin
>> (very unlikely in modern systems with the LAPIC supporting virtual wire
>> mode), or by software executing an `int $0x2`.  This can cause the NMI
>> handler to run on the NMI stack, but without the normal hardware NMI
>> cessation logic being triggered.
>>
>> 5) "Fake MCEs" can be caused by software executing `int $0x18`, and by
>> any MSI/IOMMU/IOAPIC programmed to deliver vector 0x18.  Normally, this
>> could only be caused by a bug in Xen, although it is also possible on a
>> system with out interrupt remapping. (Where the host administrator has
>> accepted the documented security issue, and decided still to pass-though
>> a device to a trusted VM, and the VM in question has a buggy driver for
>> the passed-through hardware)
>>
>> 6) Because of interrupt stack tables, real NMIs/MCEs can race with their
>> fake alternatives, where the real interrupt interrupts the fake one and
>> corrupts the exception frame of the fake one, loosing the original
>> context to return to.  (This is one of the two core problem of
>> reentrancy with NMIs and MCEs)
>>
>> 7) Real MCEs can race with each other.  If two real MCEs occur too close
>> together, the processor shuts down (We cant avoid this).  However, there
>> is large race condition between the MCE handler clearing the MCIP bit of
>> IA32_MCG_STATUS and the handler returning during which a new MCE can
>> occur and the exception frame will be corrupted.
>>
>>
>> In addition to the above issues, we have two NMI related bugs in Xen
>> which need fixing (which shall be part of the series which fixes the above)
>>
>> 8) VMEXIT reason NMI on Intel calls self_nmi() while NMIs are latched,
>> causing the PCPU to fall into loop of VMEXITs until the VCPU timeslice
>> has expired, at which point the return-to-guest path decides to schedule
>> instead of resuming the guest.
>>
>> 9) The NMI handler when returning to ring3 will leave NMIs latched, as
>> it uses the sysret path.
>>
>>
>> As for 1 possible solution which we cant use:
>>
>> If it were not for the sysret stupidness[1] of requiring the hypervisor
>> to move to the guest stack before executing the `sysret` instruction, we
>> could do away with the stack tables for NMIs and MCEs alltogether, and
>> the above crazyness would be easy to fix.  However, the overhead of
>> always using iret to return to ring3 is not likely to be acceptable,
>> meaning that we cannot "fix" the problem by discarding interrupt stacks
>> and doing everything properly on the main hypervisor stack.
>>
>>
>> Looking at the above problems, I believe there is a solution if we are
>> willing to ignore the problem to do with SMM re-enabling NMIs, and if we
>> are happy to crash gracefully when mixes of NMIs and MCEs interrupt each
>> other and trash their exception frames (in situations were we could
>> technically fix up correctly), which is based on the Linux NMI solution.
>>
>> As questions to the community - have I missed, or misrepresented any
>> points above which might perhaps influence the design of the solution? 
>> I think the list is complete, but would not be supprised if there is a
>> case still not considered yet.
>>
>> ~Andrew
>>
>>
>> [1] In an effort to prevent a flamewar with my comment, the situation we
>> find outself in now is almost certainly the result of unforseen
>> interactions of individual features, but we are left to pick up the many
>> pieces in way which cant completely be solved.
>>
>> -- 
>> Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
>> T: +44 (0)1223 225 900, http://www.citrix.com
>>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 21:59:31 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 21:59:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeYc2-0000BH-SE; Fri, 30 Nov 2012 21:59:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TeYc1-0000B9-Lf
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 21:59:10 +0000
Received: from [85.158.139.83:57981] by server-6.bemta-5.messagelabs.com id
	98/5F-19321-C2C29B05; Fri, 30 Nov 2012 21:59:08 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1354312748!23602518!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8330 invoked from network); 30 Nov 2012 21:59:08 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-182.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 21:59:08 -0000
X-IronPort-AV: E=Sophos;i="4.84,194,1355097600"; d="scan'208";a="16100050"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 21:59:08 +0000
Received: from [10.30.249.68] (10.30.249.68) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 21:59:07 +0000
Message-ID: <50B92C2B.4050606@citrix.com>
Date: Fri, 30 Nov 2012 21:59:07 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <50B8EE13.6070301@citrix.com>
	<20121130175604.GB95877@ocelot.phlegethon.org>
In-Reply-To: <20121130175604.GB95877@ocelot.phlegethon.org>
Cc: "Keir \(Xen.org\)" <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Woes of NMIs and MCEs, and possibly how to fix
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/2012 17:56, Tim Deegan wrote:
> At 17:34 +0000 on 30 Nov (1354296851), Andrew Cooper wrote:
>> Hello,
>>
>> Yesterday, Tim and myself spent a very long time in front of a
>> whiteboard trying to develop a fix which covered all the problems, and
>> sadly it is very hard.  We managed to possibly come up with a long
>> solution which we think has no race conditions, but relies on very large
>> sections of reentrant code which cant use the stack or trash registers. 
>> As such, is it is not practical at all (assuming that any of us could
>> actually code it)
> For the record, we also came up with a much simpler solution, which I
> prefer:
>  - The MCE handler should never return to Xen with IRET.
>  - The NMI handler should always return with IRET.
>  - There should be no faulting code in the NMI or MCE handlers.
>
> That covers all the interesting cases except (3), (4) and (7) below, and
> a simple per-cpu {nmi,mce}-in-progress flag will be enough to detect
> (and crash) on _almost_ all cases where that bites us (the other cases
> will crash less politely from their stacks being smashed).
>
> Even if we go on to build some more bulletproof solution, I think we
> should consider implementing that now, as the baseline.
>
> Tim.

D'oh - I knew I forgot something.  Yes - the above solution does fix a
large number of the issues.

Having no faults on the NMI/MCE paths is a good thing all round, and we
should strive for it.  But that does not mean that they wont creep back
in in the future.

What I shall do (assuming no holes are shot in that idea by this thread)
is develop this solution first, along with the VMX NMI issue fix.  It is
substantially easier than the alternative.

I will then work on developing the further solution (assuming no holes
are shot in that idea).  As I alluded to in the parent post, I believe a
modification to the Linux solution should allow us to detect most of the
reentrant cases and deal with them correctly, and should allow us to
detect any smashed stacks and deal with them more politely than we
otherwise would.

~Andrew

>
>> As a result, I thought instead that I would outline all the issues we
>> currently face.  We can then:
>>  * Decide which issues need fixing
>>  * Decide which issues need to at least be detected and crash gracefully
>>  * Decide which issues we are happy (or perhaps at least willing, if not
>> happy) to ignore
>>
>> So, the issues are as follows.  (I have tried to list them in a logical
>> order, with 1 individual problem per number, but please do point out if
>> I have missed/miss-attributed entries)
>>
>> 1) Faults on the NMI path will re-enable NMIs before the handler
>> returns, leading to reentrant behaviour.  We should audit the NMI path
>> to try and remove any needless cases which might fault, but getting a
>> fault-free path will be hard (and is not going so solve the reentrant
>> behaviour itself).
>>
>> 2) Faults on the MCE path will re-enable NMIs, as will the iret of the
>> MCE itself if an MCE interrupts an NMI.
>>
>> 3) SMM mode executing an iret will re-enable NMIs.  There is nothing we
>> can do to prevent this, and as an SMI can interrupt NMIs and MCEs, no
>> way to predict if/when it may happen.  The best we can do is accept that
>> it might happen, and try to deal with the after effects.
>>
>> 4) "Fake NMIs" can be caused by hardware with access to the INTR pin
>> (very unlikely in modern systems with the LAPIC supporting virtual wire
>> mode), or by software executing an `int $0x2`.  This can cause the NMI
>> handler to run on the NMI stack, but without the normal hardware NMI
>> cessation logic being triggered.
>>
>> 5) "Fake MCEs" can be caused by software executing `int $0x18`, and by
>> any MSI/IOMMU/IOAPIC programmed to deliver vector 0x18.  Normally, this
>> could only be caused by a bug in Xen, although it is also possible on a
>> system with out interrupt remapping. (Where the host administrator has
>> accepted the documented security issue, and decided still to pass-though
>> a device to a trusted VM, and the VM in question has a buggy driver for
>> the passed-through hardware)
>>
>> 6) Because of interrupt stack tables, real NMIs/MCEs can race with their
>> fake alternatives, where the real interrupt interrupts the fake one and
>> corrupts the exception frame of the fake one, loosing the original
>> context to return to.  (This is one of the two core problem of
>> reentrancy with NMIs and MCEs)
>>
>> 7) Real MCEs can race with each other.  If two real MCEs occur too close
>> together, the processor shuts down (We cant avoid this).  However, there
>> is large race condition between the MCE handler clearing the MCIP bit of
>> IA32_MCG_STATUS and the handler returning during which a new MCE can
>> occur and the exception frame will be corrupted.
>>
>>
>> In addition to the above issues, we have two NMI related bugs in Xen
>> which need fixing (which shall be part of the series which fixes the above)
>>
>> 8) VMEXIT reason NMI on Intel calls self_nmi() while NMIs are latched,
>> causing the PCPU to fall into loop of VMEXITs until the VCPU timeslice
>> has expired, at which point the return-to-guest path decides to schedule
>> instead of resuming the guest.
>>
>> 9) The NMI handler when returning to ring3 will leave NMIs latched, as
>> it uses the sysret path.
>>
>>
>> As for 1 possible solution which we cant use:
>>
>> If it were not for the sysret stupidness[1] of requiring the hypervisor
>> to move to the guest stack before executing the `sysret` instruction, we
>> could do away with the stack tables for NMIs and MCEs alltogether, and
>> the above crazyness would be easy to fix.  However, the overhead of
>> always using iret to return to ring3 is not likely to be acceptable,
>> meaning that we cannot "fix" the problem by discarding interrupt stacks
>> and doing everything properly on the main hypervisor stack.
>>
>>
>> Looking at the above problems, I believe there is a solution if we are
>> willing to ignore the problem to do with SMM re-enabling NMIs, and if we
>> are happy to crash gracefully when mixes of NMIs and MCEs interrupt each
>> other and trash their exception frames (in situations were we could
>> technically fix up correctly), which is based on the Linux NMI solution.
>>
>> As questions to the community - have I missed, or misrepresented any
>> points above which might perhaps influence the design of the solution? 
>> I think the list is complete, but would not be supprised if there is a
>> case still not considered yet.
>>
>> ~Andrew
>>
>>
>> [1] In an effort to prevent a flamewar with my comment, the situation we
>> find outself in now is almost certainly the result of unforseen
>> interactions of individual features, but we are left to pick up the many
>> pieces in way which cant completely be solved.
>>
>> -- 
>> Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
>> T: +44 (0)1223 225 900, http://www.citrix.com
>>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 22:02:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 22:02:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeYej-0000WO-EO; Fri, 30 Nov 2012 22:01:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeYeh-0000WH-Na
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 22:01:56 +0000
Received: from [85.158.138.51:50389] by server-15.bemta-3.messagelabs.com id
	F5/95-23779-ECC29B05; Fri, 30 Nov 2012 22:01:50 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1354312909!28689384!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30750 invoked from network); 30 Nov 2012 22:01:49 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 22:01:49 -0000
X-IronPort-AV: E=Sophos;i="4.84,194,1355097600"; d="scan'208";a="16100064"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 22:01:49 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 22:01:48 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeYea-0000QR-La;
	Fri, 30 Nov 2012 22:01:48 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeYea-0000W5-KK;
	Fri, 30 Nov 2012 22:01:48 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <E1TeYea-0000W5-KK@woking.cam.xci-test.com>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 22:01:48 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com, keir@xen.org, stefano.stabellini@eu.citrix.com
Subject: [Xen-devel] [xen-unstable bisection] complete build-amd64
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

branch xen-unstable
xen branch xen-unstable
job build-amd64
test xen-build

Tree: qemu git://xenbits.xen.org/staging/qemu-xen-unstable.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-unstable.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-unstable.hg

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-unstable.hg
  Bug introduced:  07396f4fb476
  Bug not present: eb3bf80d8dac


  changeset:   26216:07396f4fb476
  user:        Samuel Thibault <samuel.thibault@ens-lyon.org>
  date:        Fri Nov 30 09:32:27 2012 +0000
      
      [minios] Add xenbus shutdown control support
      
      Add a thread watching the xenbus shutdown control path and notifies a
      wait queue.
      
      Add HYPERVISOR_shutdown convenient inline for minios shutdown.
      
      Add proper shutdown to the minios test application.
      
      Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
      Committed-by: Keir Fraser <keir@xen.org>
      
      


For bisection revision-tuple graph see:
   http://www.chiark.greenend.org.uk/~xensrcts/results/bisect.xen-unstable.build-amd64.xen-build.html
Revision IDs in each graph node refer, respectively, to the Trees above.

----------------------------------------
Searching for failure / basis pass:
 14526 fail [host=gall-mite] / 14506 ok.
Failure / basis pass flights: 14526 / 14506
Tree: qemu git://xenbits.xen.org/staging/qemu-xen-unstable.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-unstable.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-unstable.hg
Latest bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 8037099671f3
Basis pass bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 9d88ac6046d8
Generating revisions with ./adhoc-revtuple-generator  git://xenbits.xen.org/staging/qemu-xen-unstable.git#bacc0d302445c75f18f4c826750fb5853b60e7ca-bacc0d302445c75f18f4c826750fb5853b60e7ca git://xenbits.xen.org/staging/qemu-upstream-unstable.git#1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c-1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c http://xenbits.xen.org/hg/staging/xen-unstable.hg#9d88ac6046d8-8037099671f3
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-unstable.hg
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-unstable.hg
searching for changes
no changes found
Loaded 402 nodes in revision graph
Searching for test results:
 14530 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 07396f4fb476
 14506 pass bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 9d88ac6046d8
 14531 pass bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c eb3bf80d8dac
 14494 [host=lace-bug]
 14532 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 07396f4fb476
 14497 pass irrelevant
 14515 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 8037099671f3
 14498 [host=field-cricket]
 14499 pass irrelevant
 14518 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 8037099671f3
 14500 pass irrelevant
 14519 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 8037099671f3
 14517 pass irrelevant
 14503 [host=woodlouse]
 14496 [host=bush-cricket]
 14521 pass bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 9d88ac6046d8
 14504 pass irrelevant
 14522 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 8037099671f3
 14520 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 8037099671f3
 14523 pass bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 0cf1f79bc4f8
 14524 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c f3b6af40e79e
 14525 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 07396f4fb476
 14527 pass bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c eb3bf80d8dac
 14526 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 8037099671f3
 14528 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 07396f4fb476
 14529 pass bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c eb3bf80d8dac
Searching for interesting versions
 Result found: flight 14506 (pass), for basis pass
 Result found: flight 14515 (fail), for basis failure
 Repro found: flight 14521 (pass), for basis pass
 Repro found: flight 14522 (fail), for basis failure
 0 revisions at bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c eb3bf80d8dac
No revisions left to test, checking graph state.
 Result found: flight 14527 (pass), for last pass
 Result found: flight 14528 (fail), for first failure
 Repro found: flight 14529 (pass), for last pass
 Repro found: flight 14530 (fail), for first failure
 Repro found: flight 14531 (pass), for last pass
 Repro found: flight 14532 (fail), for first failure

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-unstable.hg
  Bug introduced:  07396f4fb476
  Bug not present: eb3bf80d8dac

pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-unstable.hg
searching for changes
no changes found

  changeset:   26216:07396f4fb476
  user:        Samuel Thibault <samuel.thibault@ens-lyon.org>
  date:        Fri Nov 30 09:32:27 2012 +0000
      
      [minios] Add xenbus shutdown control support
      
      Add a thread watching the xenbus shutdown control path and notifies a
      wait queue.
      
      Add HYPERVISOR_shutdown convenient inline for minios shutdown.
      
      Add proper shutdown to the minios test application.
      
      Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
      Committed-by: Keir Fraser <keir@xen.org>
      
      

Revision graph left in /home/xc_osstest/results/bisect.xen-unstable.build-amd64.xen-build.{dot,ps,png,html}.
----------------------------------------
14532: tolerable ALL FAIL

flight 14532 xen-unstable real-bisect [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14532/

Failures :-/ but no regressions.

Tests which did not succeed,
including tests which could not be run:
 build-amd64                   4 xen-build               fail baseline untested


jobs:
 build-amd64                                                  fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 22:02:15 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 22:02:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeYej-0000WO-EO; Fri, 30 Nov 2012 22:01:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Jackson@eu.citrix.com>) id 1TeYeh-0000WH-Na
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 22:01:56 +0000
Received: from [85.158.138.51:50389] by server-15.bemta-3.messagelabs.com id
	F5/95-23779-ECC29B05; Fri, 30 Nov 2012 22:01:50 +0000
X-Env-Sender: Ian.Jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1354312909!28689384!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30750 invoked from network); 30 Nov 2012 22:01:49 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-2.tower-174.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 22:01:49 -0000
X-IronPort-AV: E=Sophos;i="4.84,194,1355097600"; d="scan'208";a="16100064"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 22:01:49 +0000
Received: from norwich.cam.xci-test.com (10.80.248.129) by
	smtprelay.citrix.com (10.30.203.162) with Microsoft SMTP Server id
	8.3.279.1; Fri, 30 Nov 2012 22:01:48 +0000
Received: from [10.80.248.135] (helo=woking.cam.xci-test.com)	by
	norwich.cam.xci-test.com with esmtp (Exim 4.72)	(envelope-from
	<ian.jackson@eu.citrix.com>)	id 1TeYea-0000QR-La;
	Fri, 30 Nov 2012 22:01:48 +0000
Received: from osstest by woking.cam.xci-test.com with local (Exim 4.69)
	(envelope-from <ian.jackson@eu.citrix.com>)	id 1TeYea-0000W5-KK;
	Fri, 30 Nov 2012 22:01:48 +0000
To: <xen-devel@lists.xensource.com>
Message-ID: <E1TeYea-0000W5-KK@woking.cam.xci-test.com>
From: xen.org <ian.jackson@eu.citrix.com>
Date: Fri, 30 Nov 2012 22:01:48 +0000
MIME-Version: 1.0
Cc: ian.jackson@eu.citrix.com, keir@xen.org, stefano.stabellini@eu.citrix.com
Subject: [Xen-devel] [xen-unstable bisection] complete build-amd64
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

branch xen-unstable
xen branch xen-unstable
job build-amd64
test xen-build

Tree: qemu git://xenbits.xen.org/staging/qemu-xen-unstable.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-unstable.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-unstable.hg

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-unstable.hg
  Bug introduced:  07396f4fb476
  Bug not present: eb3bf80d8dac


  changeset:   26216:07396f4fb476
  user:        Samuel Thibault <samuel.thibault@ens-lyon.org>
  date:        Fri Nov 30 09:32:27 2012 +0000
      
      [minios] Add xenbus shutdown control support
      
      Add a thread watching the xenbus shutdown control path and notifies a
      wait queue.
      
      Add HYPERVISOR_shutdown convenient inline for minios shutdown.
      
      Add proper shutdown to the minios test application.
      
      Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
      Committed-by: Keir Fraser <keir@xen.org>
      
      


For bisection revision-tuple graph see:
   http://www.chiark.greenend.org.uk/~xensrcts/results/bisect.xen-unstable.build-amd64.xen-build.html
Revision IDs in each graph node refer, respectively, to the Trees above.

----------------------------------------
Searching for failure / basis pass:
 14526 fail [host=gall-mite] / 14506 ok.
Failure / basis pass flights: 14526 / 14506
Tree: qemu git://xenbits.xen.org/staging/qemu-xen-unstable.git
Tree: qemuu git://xenbits.xen.org/staging/qemu-upstream-unstable.git
Tree: xen http://xenbits.xen.org/hg/staging/xen-unstable.hg
Latest bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 8037099671f3
Basis pass bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 9d88ac6046d8
Generating revisions with ./adhoc-revtuple-generator  git://xenbits.xen.org/staging/qemu-xen-unstable.git#bacc0d302445c75f18f4c826750fb5853b60e7ca-bacc0d302445c75f18f4c826750fb5853b60e7ca git://xenbits.xen.org/staging/qemu-upstream-unstable.git#1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c-1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c http://xenbits.xen.org/hg/staging/xen-unstable.hg#9d88ac6046d8-8037099671f3
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-unstable.hg
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-unstable.hg
searching for changes
no changes found
Loaded 402 nodes in revision graph
Searching for test results:
 14530 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 07396f4fb476
 14506 pass bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 9d88ac6046d8
 14531 pass bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c eb3bf80d8dac
 14494 [host=lace-bug]
 14532 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 07396f4fb476
 14497 pass irrelevant
 14515 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 8037099671f3
 14498 [host=field-cricket]
 14499 pass irrelevant
 14518 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 8037099671f3
 14500 pass irrelevant
 14519 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 8037099671f3
 14517 pass irrelevant
 14503 [host=woodlouse]
 14496 [host=bush-cricket]
 14521 pass bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 9d88ac6046d8
 14504 pass irrelevant
 14522 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 8037099671f3
 14520 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 8037099671f3
 14523 pass bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 0cf1f79bc4f8
 14524 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c f3b6af40e79e
 14525 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 07396f4fb476
 14527 pass bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c eb3bf80d8dac
 14526 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 8037099671f3
 14528 fail bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 07396f4fb476
 14529 pass bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c eb3bf80d8dac
Searching for interesting versions
 Result found: flight 14506 (pass), for basis pass
 Result found: flight 14515 (fail), for basis failure
 Repro found: flight 14521 (pass), for basis pass
 Repro found: flight 14522 (fail), for basis failure
 0 revisions at bacc0d302445c75f18f4c826750fb5853b60e7ca 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c eb3bf80d8dac
No revisions left to test, checking graph state.
 Result found: flight 14527 (pass), for last pass
 Result found: flight 14528 (fail), for first failure
 Repro found: flight 14529 (pass), for last pass
 Repro found: flight 14530 (fail), for first failure
 Repro found: flight 14531 (pass), for last pass
 Repro found: flight 14532 (fail), for first failure

*** Found and reproduced problem changeset ***

  Bug is in tree:  xen http://xenbits.xen.org/hg/staging/xen-unstable.hg
  Bug introduced:  07396f4fb476
  Bug not present: eb3bf80d8dac

pulling from ssh://xen@xenbits.xen.org/HG/staging/xen-unstable.hg
searching for changes
no changes found

  changeset:   26216:07396f4fb476
  user:        Samuel Thibault <samuel.thibault@ens-lyon.org>
  date:        Fri Nov 30 09:32:27 2012 +0000
      
      [minios] Add xenbus shutdown control support
      
      Add a thread watching the xenbus shutdown control path and notifies a
      wait queue.
      
      Add HYPERVISOR_shutdown convenient inline for minios shutdown.
      
      Add proper shutdown to the minios test application.
      
      Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
      Committed-by: Keir Fraser <keir@xen.org>
      
      

Revision graph left in /home/xc_osstest/results/bisect.xen-unstable.build-amd64.xen-build.{dot,ps,png,html}.
----------------------------------------
14532: tolerable ALL FAIL

flight 14532 xen-unstable real-bisect [real]
http://www.chiark.greenend.org.uk/~xensrcts/logs/14532/

Failures :-/ but no regressions.

Tests which did not succeed,
including tests which could not be run:
 build-amd64                   4 xen-build               fail baseline untested


jobs:
 build-amd64                                                  fail    


------------------------------------------------------------
sg-report-flight on woking.cam.xci-test.com
logs: /home/xc_osstest/logs
images: /home/xc_osstest/images

Logs, config files, etc. are available at
    http://www.chiark.greenend.org.uk/~xensrcts/logs

Test harness code can be found at
    http://xenbits.xensource.com/gitweb?p=osstest.git;a=summary


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 22:07:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 22:07:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeYjd-0000hW-8H; Fri, 30 Nov 2012 22:07:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TeYjb-0000hQ-KS
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 22:06:59 +0000
Received: from [85.158.143.99:50646] by server-2.bemta-4.messagelabs.com id
	AE/C0-28922-30E29B05; Fri, 30 Nov 2012 22:06:59 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1354313216!27005148!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODc4NzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8677 invoked from network); 30 Nov 2012 22:06:58 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-3.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 30 Nov 2012 22:06:58 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAUM6pqH026872
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 30 Nov 2012 22:06:51 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAUM6oR2011442
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 30 Nov 2012 22:06:50 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAUM6oiQ015002; Fri, 30 Nov 2012 16:06:50 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 30 Nov 2012 14:06:50 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 1CFB81C056F; Fri, 30 Nov 2012 17:06:49 -0500 (EST)
Date: Fri, 30 Nov 2012 17:06:49 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: axboe@kernel.dk, linux-kernel@vger.kernel.org
Message-ID: <20121130220649.GA1893@phenom.dumpdata.com>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: xen-devel@lists.xensource.com
Subject: [Xen-devel] [GIT PULL] (xen) stable/for-jens-3.8 bug-fixes..
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hey Jens

Please git pull the following branch

 git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-jens-3.8

which has one cleanup and one tiny fix.

Please pull!

Roger Pau Monne (2):
      xen-blkback: move free persistent grants code
      xen-blkfront: free allocated page

 drivers/block/xen-blkback/blkback.c | 68 ++++++++++++++++++++-----------------
 drivers/block/xen-blkfront.c        |  1 +
 2 files changed, 38 insertions(+), 31 deletions(-)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 22:07:16 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 22:07:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeYjd-0000hW-8H; Fri, 30 Nov 2012 22:07:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TeYjb-0000hQ-KS
	for xen-devel@lists.xensource.com; Fri, 30 Nov 2012 22:06:59 +0000
Received: from [85.158.143.99:50646] by server-2.bemta-4.messagelabs.com id
	AE/C0-28922-30E29B05; Fri, 30 Nov 2012 22:06:59 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1354313216!27005148!1
X-Originating-IP: [141.146.126.69]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gODc4NzA=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8677 invoked from network); 30 Nov 2012 22:06:58 -0000
Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com)
	(141.146.126.69)
	by server-3.tower-216.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 30 Nov 2012 22:06:58 -0000
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAUM6pqH026872
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 30 Nov 2012 22:06:51 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAUM6oR2011442
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 30 Nov 2012 22:06:50 GMT
Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAUM6oiQ015002; Fri, 30 Nov 2012 16:06:50 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 30 Nov 2012 14:06:50 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 1CFB81C056F; Fri, 30 Nov 2012 17:06:49 -0500 (EST)
Date: Fri, 30 Nov 2012 17:06:49 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: axboe@kernel.dk, linux-kernel@vger.kernel.org
Message-ID: <20121130220649.GA1893@phenom.dumpdata.com>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
Cc: xen-devel@lists.xensource.com
Subject: [Xen-devel] [GIT PULL] (xen) stable/for-jens-3.8 bug-fixes..
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Hey Jens

Please git pull the following branch

 git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/for-jens-3.8

which has one cleanup and one tiny fix.

Please pull!

Roger Pau Monne (2):
      xen-blkback: move free persistent grants code
      xen-blkfront: free allocated page

 drivers/block/xen-blkback/blkback.c | 68 ++++++++++++++++++++-----------------
 drivers/block/xen-blkfront.c        |  1 +
 2 files changed, 38 insertions(+), 31 deletions(-)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 22:13:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 22:13:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeYpF-00013T-2q; Fri, 30 Nov 2012 22:12:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ben.guthro@gmail.com>) id 1TeYpB-00013M-TJ
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 22:12:46 +0000
Received: from [85.158.143.35:6637] by server-1.bemta-4.messagelabs.com id
	D6/3C-27934-D5F29B05; Fri, 30 Nov 2012 22:12:45 +0000
X-Env-Sender: ben.guthro@gmail.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1354313554!5291115!1
X-Originating-IP: [209.85.210.169]
X-SpamReason: No, hits=1.7 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_10_20,HTML_MESSAGE,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11830 invoked from network); 30 Nov 2012 22:12:36 -0000
Received: from mail-ia0-f169.google.com (HELO mail-ia0-f169.google.com)
	(209.85.210.169)
	by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 22:12:36 -0000
Received: by mail-ia0-f169.google.com with SMTP id r4so690537iaj.28
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 14:12:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=hMY2ti0Zwbiv55FxQkZZqfX5utBgmYbszxzrTlemIkk=;
	b=OH8ZzKpgTbrIyEA9HHtJNAh+69ce3aSBZ/yBnPO5s+nZnRgC/RSccEGYVhEzukyJZ6
	JZTlFpMI3vMFukcIRFilttOdBl6hqkzc18ZTtpp4cd5hi6phVVRAHDm4GIKTLavT/yJR
	Y7z3Xlrwb3wZcPDhh/lE1VYaTqNYKKTHqviQ2bCOf8/hXF8DosEMSOwFhOGPOW4fuioF
	6cM9MQU9z9ArZqBiYeXM4csWFtbR1JJe9/fuyjzvbaPB67Aesbe6hdqTToK6NkZvhMAN
	vHEtLyBQu03axpdQ2t8+s/AbZHNGakjn7JvnAVAlFpnUtNtaaFqG+IXZdOMbD2Jo5njh
	eKew==
MIME-Version: 1.0
Received: by 10.50.91.168 with SMTP id cf8mr13823igb.20.1354313553844; Fri, 30
	Nov 2012 14:12:33 -0800 (PST)
Received: by 10.231.17.13 with HTTP; Fri, 30 Nov 2012 14:12:33 -0800 (PST)
In-Reply-To: <20121130213345.GA4715@phenom.dumpdata.com>
References: <50B7AF8A.5010304@invisiblethingslab.com>
	<20121130213345.GA4715@phenom.dumpdata.com>
Date: Fri, 30 Nov 2012 17:12:33 -0500
X-Google-Sender-Auth: zGxg0Q97PiVhb149uShtEAzEvw0
Message-ID: <CAOvdn6VcR7i815jWac7ZcEZYAbB6an_Qz87=0jw+yohCtVsDhQ@mail.gmail.com>
From: Ben Guthro <ben@guthro.net>
To: Konrad Rzeszutek Wilk <konrad@kernel.org>
Cc: Marek Marczykowski <marmarek@invisiblethingslab.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Only CPU0 active after ACPI S3, xen 4.1.3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3744638461939860863=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============3744638461939860863==
Content-Type: multipart/alternative; boundary=e89a8f3b9d3d4a9abe04cfbdb242

--e89a8f3b9d3d4a9abe04cfbdb242
Content-Type: text/plain; charset=ISO-8859-1

I had similar, but (I think) different issues.

See the following thread:
http://markmail.org/search/?q=e4a31205766d518276d0fbc1780bcd63db1a502d#query:e4a31205766d518276d0fbc1780bcd63db1a502d+page:1+mid:udkd2qcvtyqj75re+state:results

I still have a patch reverting part of this changeset to get S3 working
with pinning CPU affinity... the affinity doesn't get restored on resume,
however.

I don't have much experience with this on Xen 4.1, as I ran into the issue
when bringing up Xen-4.2, from Xen 4.0

However, I could see how this could be related, since it is in the
scheduler...

On Fri, Nov 30, 2012 at 4:33 PM, Konrad Rzeszutek Wilk <konrad@kernel.org>wrote:

> On Thu, Nov 29, 2012 at 07:55:06PM +0100, Marek Marczykowski wrote:
> > Hi all,
> >
> > After resume from ACPI S3 system has only CPU0 enabled, every vCPU from
> every
> > domain works on CPU0 [1].  When trying to pin some vCPU to CPU1 got
> error:
> > xl vcpu-pin testvm 1 1
> > libxl: error: libxl.c:2565:libxl_set_vcpuaffinity setting vcpu affinity:
> > Invalid argument
> >
> > What went wrong? How can I reenable CPU1-CPU3?
>
> I think Ben had found some issues with this in the past? CC-ing him
> here.
> >
> > System info:
> > xen 4.1.3
> > linux 3.4.18 with acpi-s3 patches from Konrad's git
> > Processor: Intel i5-2520M
> >
> > dmesg from dom0 and hypervisor attached.
> >
> > BTW Are there any plans to upstream acpi-s3 patches?
> >
> > [1] xl vcpu-list:
> > Name                                ID  VCPU   CPU State   Time(s) CPU
> Affinity
> > dom0                                 0     0    0   r--    1347.8  any
> cpu
> > dom0                                 0     1    0   -b-     594.4  any
> cpu
> > dom0                                 0     2    0   -b-     421.1  any
> cpu
> > dom0                                 0     3    0   -b-     432.6  any
> cpu
> > netvm                                1     0    0   -b-     596.6  any
> cpu
> > netvm                                1     1    0   -b-     363.7  any
> cpu
> > firewallvm                           2     0    0   -b-     170.5  any
> cpu
> > firewallvm                           2     1    0   -b-     122.5  any
> cpu
> > devel17                              3     0    0   -b-     137.0  any
> cpu
> > devel17                              3     1    0   -b-     112.9  any
> cpu
> > devel17                              3     2    0   -b-      97.9  any
> cpu
> > devel17                              3     3    0   -b-     116.0  any
> cpu
> > vm2                                  4     0    0   -b-     418.6  any
> cpu
> > vm2                                  4     1    0   -b-     390.2  any
> cpu
> > private                              5     0    0   -b-     175.9  any
> cpu
> > private                              5     1    0   -b-     161.6  any
> cpu
> > mail                                 6     0    0   -b-    1587.1  any
> cpu
> > mail                                 6     1    0   -b-    1717.5  any
> cpu
> > testvm                               7     0    0   -b-      73.0  any
> cpu
> > testvm                               7     1    0   -b-      68.9  any
> cpu
> > testvm                               7     2    0   -b-      51.4  any
> cpu
> > testvm                               7     3    0   -b-      67.1  any
> cpu
> > disp1                                8     0    0   -b-     199.9  any
> cpu
> >
> >
> > --
> > Best Regards / Pozdrawiam,
> > Marek Marczykowski
> > Invisible Things Lab
>
> > [    0.000000] Initializing cgroup subsys cpuset
> > [    0.000000] Initializing cgroup subsys cpu
> > [    0.000000] Linux version 3.4.18-2.pvops.qubes.x86_64 (
> user@nemezis.marmarek.net) (gcc version 4.4.5 20101112 (Red Hat 4.4.5-2)
> (GCC) ) #1 SMP Wed Nov 7 22:47:21 EST 2012
> > [    0.000000] Command line: ro root=/dev/mapper/vg_dom0-lv_root
> rd_LUKS_UUID=luks-400336fa-c7c4-4be3-a244-c909aa16a18c
> rd_LVM_LV=vg_dom0/lv_root rd_LVM_LV=vg_dom0/lv_swap rd_NO_MD rd_NO_DM
> LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=pl2 rhgb quiet
> max_loop=255
> > [    0.000000] Freeing  9a-100 pfn range: 102 pages freed
> > [    0.000000] 1-1 mapping on 9a->100
> > [    0.000000] Freeing  7eea-7f67 pfn range: 125 pages freed
> > [    0.000000] 1-1 mapping on 7eea->7f67
> > [    0.000000] Freeing  7f70-7f76 pfn range: 6 pages freed
> > [    0.000000] 1-1 mapping on 7f70->7f76
> > [    0.000000] Freeing  7f78-8000 pfn range: 136 pages freed
> > [    0.000000] 1-1 mapping on 7f78->8000
> > [    0.000000] Freeing  dffd-e000 pfn range: 3 pages freed
> > [    0.000000] 1-1 mapping on dffd->e000
> > [    0.000000] Freeing  20000-20200 pfn range: 512 pages freed
> > [    0.000000] 1-1 mapping on 20000->20200
> > [    0.000000] Freeing  40000-40200 pfn range: 512 pages freed
> > [    0.000000] 1-1 mapping on 40000->40200
> > [    0.000000] Freeing  c83b4-c840a pfn range: 86 pages freed
> > [    0.000000] 1-1 mapping on c83b4->c840a
> > [    0.000000] Freeing  c840e-c840f pfn range: 1 pages freed
> > [    0.000000] 1-1 mapping on c840e->c840f
> > [    0.000000] Freeing  c8411-c8414 pfn range: 3 pages freed
> > [    0.000000] 1-1 mapping on c8411->c8414
> > [    0.000000] Freeing  c841e-c8428 pfn range: 10 pages freed
> > [    0.000000] 1-1 mapping on c841e->c8428
> > [    0.000000] Freeing  c8432-c8436 pfn range: 4 pages freed
> > [    0.000000] 1-1 mapping on c8432->c8436
> > [    0.000000] Freeing  cac00-100000 pfn range: 218112 pages freed
> > [    0.000000] 1-1 mapping on cac00->100000
> > [    0.000000] Released 219612 pages of unused memory
> > [    0.000000] Set 219612 page(s) to 1-1 mapping
> > [    0.000000] BIOS-provided physical RAM map:
> > [    0.000000]  Xen: 0000000000000000 - 000000000009a000 (usable)
> > [    0.000000]  Xen: 000000000009a800 - 0000000000100000 (reserved)
> > [    0.000000]  Xen: 0000000000100000 - 0000000007eea000 (usable)
> > [    0.000000]  Xen: 0000000007eea000 - 0000000007f67000 (ACPI NVS)
> > [    0.000000]  Xen: 0000000007f67000 - 0000000007f70000 (usable)
> > [    0.000000]  Xen: 0000000007f70000 - 0000000007f76000 (ACPI NVS)
> > [    0.000000]  Xen: 0000000007f76000 - 0000000007f78000 (usable)
> > [    0.000000]  Xen: 0000000007f78000 - 0000000008000000 (ACPI NVS)
> > [    0.000000]  Xen: 0000000008000000 - 000000000dffd000 (usable)
> > [    0.000000]  Xen: 000000000dffd000 - 000000000e000000 (ACPI data)
> > [    0.000000]  Xen: 000000000e000000 - 0000000020000000 (usable)
> > [    0.000000]  Xen: 0000000020000000 - 0000000020200000 (reserved)
> > [    0.000000]  Xen: 0000000020200000 - 0000000040000000 (usable)
> > [    0.000000]  Xen: 0000000040000000 - 0000000040200000 (reserved)
> > [    0.000000]  Xen: 0000000040200000 - 00000000c83b4000 (usable)
> > [    0.000000]  Xen: 00000000c83b4000 - 00000000c840a000 (reserved)
> > [    0.000000]  Xen: 00000000c840a000 - 00000000c840e000 (usable)
> > [    0.000000]  Xen: 00000000c840e000 - 00000000c840f000 (reserved)
> > [    0.000000]  Xen: 00000000c840f000 - 00000000c8411000 (usable)
> > [    0.000000]  Xen: 00000000c8411000 - 00000000c8414000 (reserved)
> > [    0.000000]  Xen: 00000000c8414000 - 00000000c841e000 (usable)
> > [    0.000000]  Xen: 00000000c841e000 - 00000000c8428000 (reserved)
> > [    0.000000]  Xen: 00000000c8428000 - 00000000c8432000 (usable)
> > [    0.000000]  Xen: 00000000c8432000 - 00000000c8436000 (reserved)
> > [    0.000000]  Xen: 00000000c8436000 - 00000000cac00000 (usable)
> > [    0.000000]  Xen: 00000000cb800000 - 00000000cfa00000 (reserved)
> > [    0.000000]  Xen: 00000000fec00000 - 00000000fec01000 (reserved)
> > [    0.000000]  Xen: 00000000fed1c000 - 00000000fed20000 (reserved)
> > [    0.000000]  Xen: 00000000fee00000 - 00000000fee01000 (reserved)
> > [    0.000000]  Xen: 00000000ffc00000 - 00000000ffc20000 (reserved)
> > [    0.000000]  Xen: 0000000100000000 - 000000042e000000 (usable)
> > [    0.000000] NX (Execute Disable) protection: active
> > [    0.000000] DMI 2.6 present.
> > [    0.000000] DMI: Dell Inc. Latitude E6420/0K0DNP, BIOS A13 05/17/2012
> > [    0.000000] e820 update range: 0000000000000000 - 0000000000010000
> (usable) ==> (reserved)
> > [    0.000000] e820 remove range: 00000000000a0000 - 0000000000100000
> (usable)
> > [    0.000000] No AGP bridge found
> > [    0.000000] last_pfn = 0x42e000 max_arch_pfn = 0x400000000
> > [    0.000000] x2apic enabled by BIOS, switching to x2apic ops
> > [    0.000000] last_pfn = 0xcac00 max_arch_pfn = 0x400000000
> > [    0.000000] found SMP MP-table at [ffff8800000f1ad0] f1ad0
> > [    0.000000] initial memory mapped : 0 - 04ade000
> > [    0.000000] Base memory trampoline at [ffff880000095000] 95000 size
> 20480
> > [    0.000000] init_memory_mapping: 0000000000000000-00000000cac00000
> > [    0.000000]  0000000000 - 00cac00000 page 4k
> > [    0.000000] kernel direct mapping tables up to 0xcabfffff @ [mem
> 0x009a5000-0x00ffffff]
> > [    0.000000] xen: setting RW the range fc4000 - 1000000
> > [    0.000000] init_memory_mapping: 0000000100000000-000000042e000000
> > [    0.000000]  0100000000 - 042e000000 page 4k
> > [    0.000000] kernel direct mapping tables up to 0x42dffffff @ [mem
> 0xc9282000-0xcabfffff]
> > [    0.000000] xen: setting RW the range cabff000 - cac00000
> > [    0.000000] RAMDISK: 01e13000 - 04ade000
> > [    0.000000] ACPI: RSDP 00000000000fe300 00024 (v02 DELL  )
> > [    0.000000] ACPI: XSDT 000000000dffee18 0007C (v01 DELL    CBX3
>  06222004 MSFT 00010013)
> > [    0.000000] ACPI: FACP 0000000007f90d98 000F4 (v04 DELL    CBX3
>  06222004 MSFT 00010013)
> > [    0.000000] ACPI Warning: 32/64 FACS address mismatch in FADT - two
> FACS tables! (20120320/tbfadt-378)
> > [    0.000000] ACPI Warning: 32/64X FACS address mismatch in FADT -
> 0x07FEDE40/0x0000000007FEDD40, using 32 (20120320/tbfadt-502)
> > [    0.000000] ACPI: DSDT 0000000007f5e018 08834 (v02 INT430 SYSFexxx
> 00001001 INTL 20090903)
> > [    0.000000] ACPI: FACS 0000000007fede40 00040
> > [    0.000000] ACPI: APIC 000000000dffdf18 000CC (v02 DELL    CBX3
>  06222004 MSFT 00010013)
> > [    0.000000] ACPI: TCPA 0000000007feed18 00032 (v02
> 00000000      00000000)
> > [    0.000000] ACPI: SSDT 0000000007f91a98 002F9 (v01 DELLTP      TPM
> 00003000 INTL 20090903)
> > [    0.000000] ACPI: MCFG 0000000007feec98 0003C (v01 DELL   SNDYBRDG
> 06222004 MSFT 00000097)
> > [    0.000000] ACPI: HPET 0000000007feec18 00038 (v01 A M I   PCHHPET
> 06222004 AMI. 00000003)
> > [    0.000000] ACPI: BOOT 0000000007feeb98 00028 (v01 DELL   CBX3
> 06222004 AMI  00010013)
> > [    0.000000] ACPI: SSDT 0000000007f75018 00804 (v01  PmRef  Cpu0Ist
> 00003000 INTL 20090903)
> > [    0.000000] ACPI: SSDT 0000000007f74018 00996 (v01  PmRef    CpuPm
> 00003000 INTL 20090903)
> > [    0.000000] ACPI: XMAR 0000000007f90c18 000E8 (v01 INTEL      SNB
>  00000001 INTL 00000001)
> > [    0.000000] ACPI: SLIC 0000000007f7ec18 00176 (v03 DELL    CBX3
>  06222004 MSFT 00010013)
> > [    0.000000] ACPI: Local APIC address 0xfee00000
> > [    0.000000] Setting APIC routing to cluster x2apic.
> > [    0.000000] Zone PFN ranges:
> > [    0.000000]   DMA      0x00000010 -> 0x00001000
> > [    0.000000]   DMA32    0x00001000 -> 0x00100000
> > [    0.000000]   Normal   0x00100000 -> 0x0042e000
> > [    0.000000] Movable zone start PFN for each node
> > [    0.000000] Early memory PFN ranges
> > [    0.000000]     0: 0x00000010 -> 0x0000009a
> > [    0.000000]     0: 0x00000100 -> 0x00007eea
> > [    0.000000]     0: 0x00007f67 -> 0x00007f70
> > [    0.000000]     0: 0x00007f76 -> 0x00007f78
> > [    0.000000]     0: 0x00008000 -> 0x0000dffd
> > [    0.000000]     0: 0x0000e000 -> 0x00020000
> > [    0.000000]     0: 0x00020200 -> 0x00040000
> > [    0.000000]     0: 0x00040200 -> 0x000c83b4
> > [    0.000000]     0: 0x000c840a -> 0x000c840e
> > [    0.000000]     0: 0x000c840f -> 0x000c8411
> > [    0.000000]     0: 0x000c8414 -> 0x000c841e
> > [    0.000000]     0: 0x000c8428 -> 0x000c8432
> > [    0.000000]     0: 0x000c8436 -> 0x000cac00
> > [    0.000000]     0: 0x00100000 -> 0x0042e000
> > [    0.000000] On node 0 totalpages: 4163092
> > [    0.000000]   DMA zone: 56 pages used for memmap
> > [    0.000000]   DMA zone: 1572 pages reserved
> > [    0.000000]   DMA zone: 2350 pages, LIFO batch:0
> > [    0.000000]   DMA32 zone: 14280 pages used for memmap
> > [    0.000000]   DMA32 zone: 810690 pages, LIFO batch:31
> > [    0.000000]   Normal zone: 45584 pages used for memmap
> > [    0.000000]   Normal zone: 3288560 pages, LIFO batch:31
> > [    0.000000] ACPI: PM-Timer IO Port: 0x408
> > [    0.000000] ACPI: Local APIC address 0xfee00000
> > [    0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x02] enabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x03] lapic_id[0x01] enabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x05] lapic_id[0x04] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x06] lapic_id[0x05] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x07] lapic_id[0x06] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x08] lapic_id[0x07] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x09] lapic_id[0x08] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x0a] lapic_id[0x09] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x0b] lapic_id[0x0a] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x0c] lapic_id[0x0b] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x0d] lapic_id[0x0c] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x0e] lapic_id[0x0d] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x0f] lapic_id[0x0e] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x10] lapic_id[0x0f] disabled)
> > [    0.000000] ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])
> > [    0.000000] IOAPIC[0]: apic_id 2, version 253, address 0xfec00000,
> GSI 0-253
> > [    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
> > [    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high
> level)
> > [    0.000000] ACPI: IRQ0 used by override.
> > [    0.000000] ACPI: IRQ2 used by override.
> > [    0.000000] ACPI: IRQ9 used by override.
> > [    0.000000] Using ACPI (MADT) for SMP configuration information
> > [    0.000000] ACPI: HPET id: 0x8086a701 base: 0xfed00000
> > [    0.000000] SMP: Allowing 16 CPUs, 12 hotplug CPUs
> > [    0.000000] nr_irqs_gsi: 270
> > [    0.000000] Allocating PCI resources starting at cfa00000 (gap:
> cfa00000:2f200000)
> > [    0.000000] Booting paravirtualized kernel on Xen
> > [    0.000000] Xen version: 4.1.3 (preserve-AD)
> > [    0.000000] setup_percpu: NR_CPUS:512 nr_cpumask_bits:512
> nr_cpu_ids:16 nr_node_ids:1
> > [    0.000000] PERCPU: Embedded 28 pages/cpu @ffff8803e2800000 s82176
> r8192 d24320 u131072
> > [    0.000000] pcpu-alloc: s82176 r8192 d24320 u131072 alloc=1*2097152
> > [    0.000000] pcpu-alloc: [0] 00 01 02 03 04 05 06 07 08 09 10 11 12 13
> 14 15
> > [    4.119805] Built 1 zonelists in Zone order, mobility grouping on.
>  Total pages: 4101600
> > [    4.119809] Kernel command line: ro root=/dev/mapper/vg_dom0-lv_root
> rd_LUKS_UUID=luks-400336fa-c7c4-4be3-a244-c909aa16a18c
> rd_LVM_LV=vg_dom0/lv_root rd_LVM_LV=vg_dom0/lv_swap rd_NO_MD rd_NO_DM
> LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=pl2 rhgb quiet
> max_loop=255
> > [    4.119915] PID hash table entries: 4096 (order: 3, 32768 bytes)
> > [    4.120928] Dentry cache hash table entries: 2097152 (order: 12,
> 16777216 bytes)
> > [    4.124018] Inode-cache hash table entries: 1048576 (order: 11,
> 8388608 bytes)
> > [    4.147064] Placing 64MB software IO TLB between ffff8803ce200000 -
> ffff8803d2200000
> > [    4.147066] software IO TLB at phys 0x3ce200000 - 0x3d2200000
> > [    4.181675] Memory: 14975940k/17530880k available (4557k kernel code,
> 878512k absent, 1676428k reserved, 4112k data, 552k init)
> > [    4.181730] Hierarchical RCU implementation.
> > [    4.181731]        RCU dyntick-idle grace-period acceleration is
> enabled.
> > [    4.181738] NR_IRQS:33024 nr_irqs:1024 16
> > [    4.181799] xen: sci override: global_irq=9 trigger=0 polarity=0
> > [    4.181801] xen: registering gsi 9 triggering 0 polarity 0
> > [    4.181809] xen: --> pirq=9 -> irq=9 (gsi=9)
> > [    4.181829] xen: acpi sci 9
> > [    4.181831] xen: --> pirq=1 -> irq=1 (gsi=1)
> > [    4.181834] xen: --> pirq=2 -> irq=2 (gsi=2)
> > [    4.181836] xen: --> pirq=3 -> irq=3 (gsi=3)
> > [    4.181838] xen: --> pirq=4 -> irq=4 (gsi=4)
> > [    4.181840] xen: --> pirq=5 -> irq=5 (gsi=5)
> > [    4.181843] xen: --> pirq=6 -> irq=6 (gsi=6)
> > [    4.181845] xen: --> pirq=7 -> irq=7 (gsi=7)
> > [    4.181847] xen: --> pirq=8 -> irq=8 (gsi=8)
> > [    4.181849] xen: --> pirq=10 -> irq=10 (gsi=10)
> > [    4.181851] xen: --> pirq=11 -> irq=11 (gsi=11)
> > [    4.181854] xen: --> pirq=12 -> irq=12 (gsi=12)
> > [    4.181856] xen: --> pirq=13 -> irq=13 (gsi=13)
> > [    4.181858] xen: --> pirq=14 -> irq=14 (gsi=14)
> > [    4.181860] xen: --> pirq=15 -> irq=15 (gsi=15)
> > [    4.182986] Console: colour VGA+ 80x25
> > [    4.183012] console [tty0] enabled
> > [    4.183026] Xen: using vcpuop timer interface
> > [    4.183030] installing Xen timer for CPU 0
> > [    4.183048] Detected 2494.416 MHz processor.
> > [    4.183052] Calibrating delay loop (skipped), value calculated using
> timer frequency.. 4988.83 BogoMIPS (lpj=9977664)
> > [    4.183054] pid_max: default: 32768 minimum: 301
> > [    4.183090] Mount-cache hash table entries: 256
> > [    4.183222] Initializing cgroup subsys cpuacct
> > [    4.183224] Initializing cgroup subsys devices
> > [    4.183225] Initializing cgroup subsys freezer
> > [    4.183227] Initializing cgroup subsys net_cls
> > [    4.183228] Initializing cgroup subsys blkio
> > [    4.183280] ENERGY_PERF_BIAS: Set to 'normal', was 'performance'
> > [    4.183281] ENERGY_PERF_BIAS: View and update with
> x86_energy_perf_policy(8)
> > [    4.183284] CPU: Physical Processor ID: 0
> > [    4.183285] CPU: Processor Core ID: 0
> > [    4.184454] ACPI: Core revision 20120320
> > [    4.194658] Performance Events: unsupported p6 CPU model 42 no PMU
> driver, software events only.
> > [    4.194796] installing Xen timer for CPU 1
> > [    4.194988] installing Xen timer for CPU 2
> > [    4.195140] installing Xen timer for CPU 3
> > [    4.195232] Brought up 4 CPUs
> > [    4.195477] devtmpfs: initialized
> > [    4.199046] PM: Registering ACPI NVS region [mem
> 0x07eea000-0x07f66fff] (512000 bytes)
> > [    4.199056] PM: Registering ACPI NVS region [mem
> 0x07f70000-0x07f75fff] (24576 bytes)
> > [    4.199058] PM: Registering ACPI NVS region [mem
> 0x07f78000-0x07ffffff] (557056 bytes)
> > [    4.199069] Dell Latitude E6420 series board detected. Selecting
> PCI-method for reboots.
> > [    4.199104] Grant tables using version 2 layout.
> > [    4.199114] Grant table initialized
> > [    4.199158] dummy:
> > [    4.199205] RTC time:  1:19:35, date: 11/29/12
> > [    4.199256] NET: Registered protocol family 16
> > [    4.199465] ACPI FADT declares the system doesn't support PCIe ASPM,
> so disable it
> > [    4.199467] ACPI: bus type pci registered
> > [    4.199548] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem
> 0xf8000000-0xfbffffff] (base 0xf8000000)
> > [    4.199550] PCI: not using MMCONFIG
> > [    4.199552] PCI: Using configuration type 1 for base access
> > [    4.199559] dmi type 0xB1 record - unknown flag
> > [    4.200155] bio: create slab <bio-0> at 0
> > [    4.200279] ACPI: Added _OSI(Module Device)
> > [    4.200280] ACPI: Added _OSI(Processor Device)
> > [    4.200282] ACPI: Added _OSI(3.0 _SCP Extensions)
> > [    4.200283] ACPI: Added _OSI(Processor Aggregator Device)
> > [    4.201815] ACPI: EC: Look up EC in DSDT
> > [    4.206932] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignored
> > [    4.219266] ACPI: SSDT 00000000c8412798 00727 (v01  PmRef  Cpu0Cst
> 00003001 INTL 20090903)
> > [    4.219654] ACPI: Dynamic OEM Table Load:
> > [    4.219657] ACPI: SSDT           (null) 00727 (v01  PmRef  Cpu0Cst
> 00003001 INTL 20090903)
> > [    4.220118] ACPI: SSDT 00000000c8413a98 00303 (v01  PmRef    ApIst
> 00003000 INTL 20090903)
> > [    4.220555] ACPI: Dynamic OEM Table Load:
> > [    4.220558] ACPI: SSDT           (null) 00303 (v01  PmRef    ApIst
> 00003000 INTL 20090903)
> > [    4.220754] ACPI: SSDT 00000000c8411d98 00119 (v01  PmRef    ApCst
> 00003000 INTL 20090903)
> > [    4.221136] ACPI: Dynamic OEM Table Load:
> > [    4.221138] ACPI: SSDT           (null) 00119 (v01  PmRef    ApCst
> 00003000 INTL 20090903)
> > [    4.223275] ACPI: Interpreter enabled
> > [    4.223278] ACPI: (supports S0 S3 S5)
> > [    4.223294] ACPI: Using IOAPIC for interrupt routing
> > [    4.223322] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem
> 0xf8000000-0xfbffffff] (base 0xf8000000)
> > [    4.223846] PCI: MMCONFIG at [mem 0xf8000000-0xfbffffff] reserved in
> ACPI motherboard resources
> > [    4.271283] ACPI: EC: GPE = 0x10, I/O: command/status = 0x934, data =
> 0x930
> > [    4.272424] ACPI: No dock devices found.
> > [    4.272428] PCI: Using host bridge windows from ACPI; if necessary,
> use "pci=nocrs" and report a bug
> > [    4.272988] \_SB_.PCI0:_OSC invalid UUID
> > [    4.272989] _OSC request data:1 8 1f
> > [    4.272992] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-3e])
> > [    4.273994] pci_root PNP0A08:00: host bridge window [io
>  0x0000-0x0cf7]
> > [    4.273996] pci_root PNP0A08:00: host bridge window [io
>  0x0d00-0xffff]
> > [    4.273998] pci_root PNP0A08:00: host bridge window [mem
> 0x000a0000-0x000bffff]
> > [    4.274001] pci_root PNP0A08:00: host bridge window [mem
> 0xcfa00000-0xfeafffff]
> > [    4.274003] pci_root PNP0A08:00: host bridge window [mem
> 0xfed40000-0xfed44fff]
> > [    4.274031] PCI host bridge to bus 0000:00
> > [    4.274033] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7]
> > [    4.274034] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff]
> > [    4.274036] pci_bus 0000:00: root bus resource [mem
> 0x000a0000-0x000bffff]
> > [    4.274038] pci_bus 0000:00: root bus resource [mem
> 0xcfa00000-0xfeafffff]
> > [    4.274040] pci_bus 0000:00: root bus resource [mem
> 0xfed40000-0xfed44fff]
> > [    4.274054] pci 0000:00:00.0: [8086:0104] type 00 class 0x060000
> > [    4.274147] pci 0000:00:02.0: [8086:0126] type 00 class 0x030000
> > [    4.274174] pci 0000:00:02.0: reg 10: [mem 0xe1400000-0xe17fffff
> 64bit]
> > [    4.274189] pci 0000:00:02.0: reg 18: [mem 0xd0000000-0xdfffffff
> 64bit pref]
> > [    4.274200] pci 0000:00:02.0: reg 20: [io  0x4000-0x403f]
> > [    4.274344] pci 0000:00:16.0: [8086:1c3a] type 00 class 0x078000
> > [    4.274394] pci 0000:00:16.0: reg 10: [mem 0xe2eb0000-0xe2eb000f
> 64bit]
> > [    4.274563] pci 0000:00:16.0: PME# supported from D0 D3hot D3cold
> > [    4.274636] pci 0000:00:19.0: [8086:1502] type 00 class 0x020000
> > [    4.274681] pci 0000:00:19.0: reg 10: [mem 0xe2e00000-0xe2e1ffff]
> > [    4.274700] pci 0000:00:19.0: reg 14: [mem 0xe2e80000-0xe2e80fff]
> > [    4.274719] pci 0000:00:19.0: reg 18: [io  0x4080-0x409f]
> > [    4.274883] pci 0000:00:19.0: PME# supported from D0 D3hot D3cold
> > [    4.274939] pci 0000:00:1a.0: [8086:1c2d] type 00 class 0x0c0320
> > [    4.274983] pci 0000:00:1a.0: reg 10: [mem 0xe2e70000-0xe2e703ff]
> > [    4.275185] pci 0000:00:1a.0: PME# supported from D0 D3hot D3cold
> > [    4.275243] pci 0000:00:1b.0: [8086:1c20] type 00 class 0x040300
> > [    4.275278] pci 0000:00:1b.0: reg 10: [mem 0xe2e60000-0xe2e63fff
> 64bit]
> > [    4.275456] pci 0000:00:1b.0: PME# supported from D0 D3hot D3cold
> > [    4.275509] pci 0000:00:1c.0: [8086:1c10] type 01 class 0x060400
> > [    4.275702] pci 0000:00:1c.0: PME# supported from D0 D3hot D3cold
> > [    4.275760] pci 0000:00:1c.1: [8086:1c12] type 01 class 0x060400
> > [    4.275953] pci 0000:00:1c.1: PME# supported from D0 D3hot D3cold
> > [    4.276011] pci 0000:00:1c.2: [8086:1c14] type 01 class 0x060400
> > [    4.276205] pci 0000:00:1c.2: PME# supported from D0 D3hot D3cold
> > [    4.276264] pci 0000:00:1c.3: [8086:1c16] type 01 class 0x060400
> > [    4.276458] pci 0000:00:1c.3: PME# supported from D0 D3hot D3cold
> > [    4.276520] pci 0000:00:1c.5: [8086:1c1a] type 01 class 0x060400
> > [    4.276711] pci 0000:00:1c.5: PME# supported from D0 D3hot D3cold
> > [    4.276779] pci 0000:00:1d.0: [8086:1c26] type 00 class 0x0c0320
> > [    4.276823] pci 0000:00:1d.0: reg 10: [mem 0xe2e50000-0xe2e503ff]
> > [    4.277025] pci 0000:00:1d.0: PME# supported from D0 D3hot D3cold
> > [    4.277086] pci 0000:00:1f.0: [8086:1c4f] type 00 class 0x060100
> > [    4.277341] pci 0000:00:1f.2: [8086:1c03] type 00 class 0x010601
> > [    4.277391] pci 0000:00:1f.2: reg 10: [io  0x40d0-0x40d7]
> > [    4.277410] pci 0000:00:1f.2: reg 14: [io  0x40c0-0x40c3]
> > [    4.277429] pci 0000:00:1f.2: reg 18: [io  0x40b0-0x40b7]
> > [    4.277449] pci 0000:00:1f.2: reg 1c: [io  0x40a0-0x40a3]
> > [    4.277468] pci 0000:00:1f.2: reg 20: [io  0x4060-0x407f]
> > [    4.277486] pci 0000:00:1f.2: reg 24: [mem 0xe2e40000-0xe2e407ff]
> > [    4.277613] pci 0000:00:1f.2: PME# supported from D3hot
> > [    4.277657] pci 0000:00:1f.3: [8086:1c22] type 00 class 0x0c0500
> > [    4.277694] pci 0000:00:1f.3: reg 10: [mem 0xe2e30000-0xe2e300ff
> 64bit]
> > [    4.277749] pci 0000:00:1f.3: reg 20: [io  0x4040-0x405f]
> > [    4.277920] pci 0000:00:1c.0: PCI bridge to [bus 01-01]
> > [    4.278353] pci 0000:02:00.0: [8086:422b] type 00 class 0x028000
> > [    4.278708] pci 0000:02:00.0: reg 10: [mem 0xe2d00000-0xe2d01fff
> 64bit]
> > [    4.280508] pci 0000:02:00.0: PME# supported from D0 D3hot D3cold
> > [    4.285361] pci 0000:00:1c.1: PCI bridge to [bus 02-02]
> > [    4.285374] pci 0000:00:1c.1:   bridge window [mem
> 0xe2d00000-0xe2dfffff]
> > [    4.285490] pci 0000:00:1c.2: PCI bridge to [bus 03-08]
> > [    4.285498] pci 0000:00:1c.2:   bridge window [io  0x3000-0x3fff]
> > [    4.285505] pci 0000:00:1c.2:   bridge window [mem
> 0xe2200000-0xe2bfffff]
> > [    4.285517] pci 0000:00:1c.2:   bridge window [mem
> 0xe0a00000-0xe13fffff 64bit pref]
> > [    4.285625] pci 0000:00:1c.3: PCI bridge to [bus 09-09]
> > [    4.285632] pci 0000:00:1c.3:   bridge window [io  0x2000-0x2fff]
> > [    4.285639] pci 0000:00:1c.3:   bridge window [mem
> 0xe1800000-0xe21fffff]
> > [    4.285651] pci 0000:00:1c.3:   bridge window [mem
> 0xe0000000-0xe09fffff 64bit pref]
> > [    4.285818] pci 0000:0a:00.0: [1217:8221] type 00 class 0x080501
> > [    4.285872] pci 0000:0a:00.0: reg 10: [mem 0xe2c20000-0xe2c201ff]
> > [    4.286294] pci 0000:0a:00.0: supports D1 D2
> > [    4.286295] pci 0000:0a:00.0: PME# supported from D0 D1 D2 D3hot
> D3cold
> > [    4.286432] pci 0000:0a:00.1: [1217:8231] type 00 class 0x018000
> > [    4.286486] pci 0000:0a:00.1: reg 10: [mem 0xe2c10000-0xe2c10fff]
> > [    4.286563] pci 0000:0a:00.1: reg 18: [mem 0xe2c00000-0xe2c007ff]
> > [    4.286908] pci 0000:0a:00.1: supports D1 D2
> > [    4.286909] pci 0000:0a:00.1: PME# supported from D0 D1 D2 D3hot
> D3cold
> > [    4.293400] pci 0000:00:1c.5: PCI bridge to [bus 0a-0a]
> > [    4.293412] pci 0000:00:1c.5:   bridge window [mem
> 0xe2c00000-0xe2cfffff]
> > [    4.293479] pci_bus 0000:00: on NUMA node 0
> > [    4.293483] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
> > [    4.293612] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP01._PRT]
> > [    4.293647] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP02._PRT]
> > [    4.293682] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP04._PRT]
> > [    4.293717] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP06._PRT]
> > [    4.293762] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP03._PRT]
> > [    4.293857] \_SB_.PCI0:_OSC invalid UUID
> > [    4.293858] _OSC request data:1 1f 1f
> > [    4.293861]  pci0000:00: Requesting ACPI _OSC control (0x1d)
> > [    4.293906] \_SB_.PCI0:_OSC invalid UUID
> > [    4.293907] _OSC request data:1 0 1d
> > [    4.293910]  pci0000:00: ACPI _OSC request failed (AE_ERROR),
> returned control mask: 0x1d
> > [    4.293911] ACPI _OSC control for PCIe not granted, disabling ASPM
> > [    4.297639] ACPI: PCI Interrupt Link [LNKA] (IRQs 1 3 4 5 6 7 10 12
> 14 15) *11
> > [    4.297702] ACPI: PCI Interrupt Link [LNKB] (IRQs 1 3 4 5 6 7 11 12
> 14 15) *10
> > [    4.297761] ACPI: PCI Interrupt Link [LNKC] (IRQs 1 3 4 5 6 7 10 12
> 14 15) *11
> > [    4.297820] ACPI: PCI Interrupt Link [LNKD] (IRQs 1 3 4 5 6 7 11 12
> 14 15) *10
> > [    4.297878] ACPI: PCI Interrupt Link [LNKE] (IRQs 1 3 4 *5 6 7 10 12
> 14 15)
> > [    4.297937] ACPI: PCI Interrupt Link [LNKF] (IRQs 1 3 4 5 6 7 11 12
> 14 15) *0, disabled.
> > [    4.297996] ACPI: PCI Interrupt Link [LNKG] (IRQs 1 *3 4 5 6 7 10 12
> 14 15)
> > [    4.298054] ACPI: PCI Interrupt Link [LNKH] (IRQs 1 3 4 5 6 7 11 12
> 14 15) *0, disabled.
> > [    4.298087] xen/balloon: Initialising balloon driver.
> > [    4.301022] xen-balloon: Initialising balloon driver.
> > [    4.301062] xen/balloon: Xen selfballooning driver disabled for
> domain0.
> > [    4.301148] vgaarb: device added:
> PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
> > [    4.301157] vgaarb: loaded
> > [    4.301157] vgaarb: bridge control possible 0000:00:02.0
> > [    4.301279] PCI: Using ACPI for IRQ routing
> > [    4.305930] PCI: pci_cache_line_size set to 64 bytes
> > [    4.306106] reserve RAM buffer: 000000000009a000 - 000000000009ffff
> > [    4.306108] reserve RAM buffer: 0000000007eea000 - 0000000007ffffff
> > [    4.306110] reserve RAM buffer: 0000000007f70000 - 0000000007ffffff
> > [    4.306112] reserve RAM buffer: 0000000007f78000 - 0000000007ffffff
> > [    4.306113] reserve RAM buffer: 000000000dffd000 - 000000000fffffff
> > [    4.306115] reserve RAM buffer: 00000000c83b4000 - 00000000cbffffff
> > [    4.306118] reserve RAM buffer: 00000000c840e000 - 00000000cbffffff
> > [    4.306121] reserve RAM buffer: 00000000c8411000 - 00000000cbffffff
> > [    4.306123] reserve RAM buffer: 00000000c841e000 - 00000000cbffffff
> > [    4.306125] reserve RAM buffer: 00000000c8432000 - 00000000cbffffff
> > [    4.306127] reserve RAM buffer: 00000000cac00000 - 00000000cbffffff
> > [    4.306129] reserve RAM buffer: 000000042e000000 - 000000042fffffff
> > [    4.306235] Switching to clocksource xen
> > [    4.307726] pnp: PnP ACPI init
> > [    4.307738] ACPI: bus type pnp registered
> > [    4.308287] pnp 00:00: [bus 00-3e]
> > [    4.308289] pnp 00:00: [io  0x0000-0x0cf7 window]
> > [    4.308291] pnp 00:00: [io  0x0cf8-0x0cff]
> > [    4.308293] pnp 00:00: [io  0x0d00-0xffff window]
> > [    4.308295] pnp 00:00: [mem 0x000a0000-0x000bffff window]
> > [    4.308296] pnp 00:00: [mem 0x000c0000-0x000c3fff window]
> > [    4.308298] pnp 00:00: [mem 0x000c4000-0x000c7fff window]
> > [    4.308300] pnp 00:00: [mem 0x000c8000-0x000cbfff window]
> > [    4.308301] pnp 00:00: [mem 0x000cc000-0x000cffff window]
> > [    4.308303] pnp 00:00: [mem 0x000d0000-0x000d3fff window]
> > [    4.308305] pnp 00:00: [mem 0x000d4000-0x000d7fff window]
> > [    4.308307] pnp 00:00: [mem 0x000d8000-0x000dbfff window]
> > [    4.308309] pnp 00:00: [mem 0x000dc000-0x000dffff window]
> > [    4.308310] pnp 00:00: [mem 0x000e0000-0x000e3fff window]
> > [    4.308312] pnp 00:00: [mem 0x000e4000-0x000e7fff window]
> > [    4.308314] pnp 00:00: [mem 0x000e8000-0x000ebfff window]
> > [    4.308315] pnp 00:00: [mem 0x000ec000-0x000effff window]
> > [    4.308317] pnp 00:00: [mem 0x000f0000-0x000fffff window]
> > [    4.308319] pnp 00:00: [mem 0xcfa00000-0xfeafffff window]
> > [    4.308320] pnp 00:00: [mem 0xfed40000-0xfed44fff window]
> > [    4.308385] pnp 00:00: Plug and Play ACPI device, IDs PNP0a08 PNP0a03
> (active)
> > [    4.308398] pnp 00:01: [io  0x0000-0x001f]
> > [    4.308400] pnp 00:01: [io  0x0081-0x0091]
> > [    4.308401] pnp 00:01: [io  0x0093-0x009f]
> > [    4.308403] pnp 00:01: [io  0x00c0-0x00df]
> > [    4.308404] pnp 00:01: [dma 4]
> > [    4.308422] pnp 00:01: Plug and Play ACPI device, IDs PNP0200 (active)
> > [    4.308429] pnp 00:02: [mem 0xff000000-0xffffffff]
> > [    4.308445] pnp 00:02: Plug and Play ACPI device, IDs INT0800 (active)
> > [    4.308540] pnp 00:03: [mem 0xfed00000-0xfed003ff]
> > [    4.308572] system 00:03: [mem 0xfed00000-0xfed003ff] has been
> reserved
> > [    4.308575] system 00:03: Plug and Play ACPI device, IDs PNP0103
> PNP0c01 (active)
> > [    4.308584] pnp 00:04: [io  0x00f0]
> > [    4.308587] xen: registering gsi 13 triggering 1 polarity 0
> > [    4.308609] pnp 00:04: [irq 13]
> > [    4.308626] pnp 00:04: Plug and Play ACPI device, IDs PNP0c04 (active)
> > [    4.308636] pnp 00:05: [io  0x002e-0x002f]
> > [    4.308637] pnp 00:05: [io  0x004e-0x004f]
> > [    4.308639] pnp 00:05: [io  0x0061]
> > [    4.308640] pnp 00:05: [io  0x0063]
> > [    4.308641] pnp 00:05: [io  0x0065]
> > [    4.308642] pnp 00:05: [io  0x0067]
> > [    4.308644] pnp 00:05: [io  0x0070]
> > [    4.308645] pnp 00:05: [io  0x0080]
> > [    4.308646] pnp 00:05: [io  0x0092]
> > [    4.308648] pnp 00:05: [io  0x00b2-0x00b3]
> > [    4.308649] pnp 00:05: [io  0x0680-0x069f]
> > [    4.308651] pnp 00:05: [io  0x1000-0x100f]
> > [    4.308653] pnp 00:05: [io  0xffff]
> > [    4.308654] pnp 00:05: [io  0xffff]
> > [    4.308655] pnp 00:05: [io  0x0400-0x047f]
> > [    4.308656] pnp 00:05: [io  0x0500-0x057f]
> > [    4.308658] pnp 00:05: [io  0x164e-0x164f]
> > [    4.308689] system 00:05: [io  0x0680-0x069f] has been reserved
> > [    4.308691] system 00:05: [io  0x1000-0x100f] has been reserved
> > [    4.308693] system 00:05: [io  0xffff] has been reserved
> > [    4.308695] system 00:05: [io  0xffff] has been reserved
> > [    4.308697] system 00:05: [io  0x0400-0x047f] has been reserved
> > [    4.308700] system 00:05: [io  0x0500-0x057f] has been reserved
> > [    4.308701] system 00:05: [io  0x164e-0x164f] has been reserved
> > [    4.308704] system 00:05: Plug and Play ACPI device, IDs PNP0c02
> (active)
> > [    4.308711] pnp 00:06: [io  0x0070-0x0077]
> > [    4.308713] xen: registering gsi 8 triggering 1 polarity 0
> > [    4.308730] pnp 00:06: [irq 8]
> > [    4.308749] pnp 00:06: Plug and Play ACPI device, IDs PNP0b00 (active)
> > [    4.308758] pnp 00:07: [io  0x0060]
> > [    4.308759] pnp 00:07: [io  0x0064]
> > [    4.308761] xen: registering gsi 1 triggering 1 polarity 0
> > [    4.308777] pnp 00:07: [irq 1]
> > [    4.308794] pnp 00:07: Plug and Play ACPI device, IDs PNP0303 (active)
> > [    4.309984] pnp 00:08: Plug and Play ACPI device, IDs PNP0401
> (disabled)
> > [    4.309993] xen: registering gsi 12 triggering 1 polarity 0
> > [    4.310011] pnp 00:09: [irq 12]
> > [    4.310030] pnp 00:09: Plug and Play ACPI device, IDs DLL0493 PNP0f13
> (active)
> > [    4.310065] pnp 00:0a: [mem 0xfed40000-0xfed44fff]
> > [    4.310086] pnp 00:0a: Plug and Play ACPI device, IDs BCM0102 PNP0c31
> (active)
> > [    4.310291] pnp 00:0b: [mem 0xfed1c000-0xfed1ffff]
> > [    4.310292] pnp 00:0b: [mem 0xfed10000-0xfed17fff]
> > [    4.310294] pnp 00:0b: [mem 0xfed18000-0xfed18fff]
> > [    4.310296] pnp 00:0b: [mem 0xfed19000-0xfed19fff]
> > [    4.310298] pnp 00:0b: [mem 0xf8000000-0xfbffffff]
> > [    4.310309] pnp 00:0b: [mem 0xfed20000-0xfed3ffff]
> > [    4.310310] pnp 00:0b: [mem 0xfed90000-0xfed93fff]
> > [    4.310312] pnp 00:0b: [mem 0xfed45000-0xfed8ffff]
> > [    4.310313] pnp 00:0b: [mem 0xff000000-0xffffffff]
> > [    4.310315] pnp 00:0b: [mem 0xfee00000-0xfeefffff]
> > [    4.310317] pnp 00:0b: [mem 0x00000000-0xffffffffffffffff disabled]
> > [    4.310318] pnp 00:0b: [mem 0x00000000-0xffffffffffffffff disabled]
> > [    4.310359] system 00:0b: [mem 0xfed1c000-0xfed1ffff] has been
> reserved
> > [    4.310361] system 00:0b: [mem 0xfed10000-0xfed17fff] has been
> reserved
> > [    4.310363] system 00:0b: [mem 0xfed18000-0xfed18fff] has been
> reserved
> > [    4.310365] system 00:0b: [mem 0xfed19000-0xfed19fff] has been
> reserved
> > [    4.310367] system 00:0b: [mem 0xf8000000-0xfbffffff] has been
> reserved
> > [    4.310369] system 00:0b: [mem 0xfed20000-0xfed3ffff] has been
> reserved
> > [    4.310371] system 00:0b: [mem 0xfed90000-0xfed93fff] has been
> reserved
> > [    4.310373] system 00:0b: [mem 0xfed45000-0xfed8ffff] has been
> reserved
> > [    4.310375] system 00:0b: [mem 0xff000000-0xffffffff] could not be
> reserved
> > [    4.310377] system 00:0b: [mem 0xfee00000-0xfeefffff] could not be
> reserved
> > [    4.310380] system 00:0b: Plug and Play ACPI device, IDs PNP0c02
> (active)
> > [    4.310956] xen: registering gsi 23 triggering 1 polarity 0
> > [    4.310967] xen: --> pirq=23 -> irq=23 (gsi=23)
> > [    4.310985] pnp 00:0c: [irq 23]
> > [    4.311015] pnp 00:0c: Plug and Play ACPI device, IDs SMO8800 (active)
> > [    4.315528] pnp 00:0d: [mem 0x20000000-0x201fffff]
> > [    4.315531] pnp 00:0d: [mem 0x40000000-0x401fffff]
> > [    4.339851] system 00:0d: [mem 0x20000000-0x201fffff] has been
> reserved
> > [    4.339854] system 00:0d: [mem 0x40000000-0x401fffff] has been
> reserved
> > [    4.339857] system 00:0d: Plug and Play ACPI device, IDs PNP0c01
> (active)
> > [    4.339865] pnp: PnP ACPI: found 14 devices
> > [    4.339867] ACPI: ACPI bus type pnp unregistered
> > [    4.346178] PM-Timer failed consistency check  (0x0xffffff) -
> aborting.
> > [    4.346274] pci 0000:00:1c.0: PCI bridge to [bus 01-01]
> > [    4.346306] pci 0000:00:1c.1: PCI bridge to [bus 02-02]
> > [    4.346315] pci 0000:00:1c.1:   bridge window [mem
> 0xe2d00000-0xe2dfffff]
> > [    4.346332] pci 0000:00:1c.2: PCI bridge to [bus 03-08]
> > [    4.346336] pci 0000:00:1c.2:   bridge window [io  0x3000-0x3fff]
> > [    4.346347] pci 0000:00:1c.2:   bridge window [mem
> 0xe2200000-0xe2bfffff]
> > [    4.346354] pci 0000:00:1c.2:   bridge window [mem
> 0xe0a00000-0xe13fffff 64bit pref]
> > [    4.346366] pci 0000:00:1c.3: PCI bridge to [bus 09-09]
> > [    4.346370] pci 0000:00:1c.3:   bridge window [io  0x2000-0x2fff]
> > [    4.346379] pci 0000:00:1c.3:   bridge window [mem
> 0xe1800000-0xe21fffff]
> > [    4.346386] pci 0000:00:1c.3:   bridge window [mem
> 0xe0000000-0xe09fffff 64bit pref]
> > [    4.346399] pci 0000:00:1c.5: PCI bridge to [bus 0a-0a]
> > [    4.346408] pci 0000:00:1c.5:   bridge window [mem
> 0xe2c00000-0xe2cfffff]
> > [    4.346434] xen: registering gsi 16 triggering 0 polarity 1
> > [    4.346442] xen: --> pirq=16 -> irq=16 (gsi=16)
> > [    4.346469] xen: registering gsi 17 triggering 0 polarity 1
> > [    4.346473] xen: --> pirq=17 -> irq=17 (gsi=17)
> > [    4.346498] xen: registering gsi 18 triggering 0 polarity 1
> > [    4.346502] xen: --> pirq=18 -> irq=18 (gsi=18)
> > [    4.346527] xen: registering gsi 19 triggering 0 polarity 1
> > [    4.346531] xen: --> pirq=19 -> irq=19 (gsi=19)
> > [    4.346556] xen: registering gsi 17 triggering 0 polarity 1
> > [    4.346558] Already setup the GSI :17
> > [    4.346563] pci_bus 0000:00: resource 4 [io  0x0000-0x0cf7]
> > [    4.346565] pci_bus 0000:00: resource 5 [io  0x0d00-0xffff]
> > [    4.346566] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff]
> > [    4.346568] pci_bus 0000:00: resource 7 [mem 0xcfa00000-0xfeafffff]
> > [    4.346570] pci_bus 0000:00: resource 8 [mem 0xfed40000-0xfed44fff]
> > [    4.346572] pci_bus 0000:02: resource 1 [mem 0xe2d00000-0xe2dfffff]
> > [    4.346574] pci_bus 0000:03: resource 0 [io  0x3000-0x3fff]
> > [    4.346575] pci_bus 0000:03: resource 1 [mem 0xe2200000-0xe2bfffff]
> > [    4.346577] pci_bus 0000:03: resource 2 [mem 0xe0a00000-0xe13fffff
> 64bit pref]
> > [    4.346579] pci_bus 0000:09: resource 0 [io  0x2000-0x2fff]
> > [    4.346581] pci_bus 0000:09: resource 1 [mem 0xe1800000-0xe21fffff]
> > [    4.346582] pci_bus 0000:09: resource 2 [mem 0xe0000000-0xe09fffff
> 64bit pref]
> > [    4.346584] pci_bus 0000:0a: resource 1 [mem 0xe2c00000-0xe2cfffff]
> > [    4.346672] NET: Registered protocol family 2
> > [    4.346732] IP route cache hash table entries: 524288 (order: 10,
> 4194304 bytes)
> > [    4.347207] TCP established hash table entries: 262144 (order: 10,
> 4194304 bytes)
> > [    4.347753] TCP bind hash table entries: 65536 (order: 8, 1048576
> bytes)
> > [    4.347872] TCP: Hash tables configured (established 262144 bind
> 65536)
> > [    4.347874] TCP: reno registered
> > [    4.347877] UDP hash table entries: 8192 (order: 6, 262144 bytes)
> > [    4.347921] UDP-Lite hash table entries: 8192 (order: 6, 262144 bytes)
> > [    4.348067] NET: Registered protocol family 1
> > [    4.348085] pci 0000:00:02.0: Boot video device
> > [    4.348108] xen: registering gsi 16 triggering 0 polarity 1
> > [    4.348112] Already setup the GSI :16
> > [    4.348203] xen: registering gsi 17 triggering 0 polarity 1
> > [    4.348205] Already setup the GSI :17
> > [    4.348298] PCI: CLS 64 bytes, default 64
> > [    4.348333] Unpacking initramfs...
> > [    4.384265] Freeing initrd memory: 45868k freed
> > [    4.392440] Simple Boot Flag at 0xf3 set to 0x1
> > [    4.392900] audit: initializing netlink socket (disabled)
> > [    4.392911] type=2000 audit(1354151975.383:1): initialized
> > [    4.411688] VFS: Disk quotas dquot_6.5.2
> > [    4.411715] Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
> > [    4.411870] msgmni has been set to 29339
> > [    4.412010] Block layer SCSI generic (bsg) driver version 0.4 loaded
> (major 253)
> > [    4.412013] io scheduler noop registered
> > [    4.412015] io scheduler deadline registered
> > [    4.412036] io scheduler cfq registered (default)
> > [    4.412666] intel_idle: does not run on family 6 model 42
> > [    4.412741] ACPI: Requesting acpi_cpufreq
> > [    4.459643] Non-volatile memory driver v1.3
> > [    4.459654] ramoops: platform device not found, using module
> parameters
> > [    4.459670] ramoops: The memory size and the record size must be
> non-zero
> > [    4.459703] ramoops: probe of ramoops failed with error -22
> > [    4.474892] loop: module loaded
> > [    4.474922] Fixed MDIO Bus: probed
> > [    4.474965] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2M]
> at 0x60,0x64 irq 1,12
> > [    4.475166] i8042: Warning: Keylock active
> > [    4.476434] serio: i8042 KBD port at 0x60,0x64 irq 1
> > [    4.476439] serio: i8042 AUX port at 0x60,0x64 irq 12
> > [    4.476551] mousedev: PS/2 mouse device common for all mice
> > [    4.476707] rtc_cmos 00:06: RTC can wake from S4
> > [    4.476940] rtc_cmos 00:06: rtc core: registered rtc_cmos as rtc0
> > [    4.476998] rtc0: alarms up to one year, y3k, 242 bytes nvram
> > [    4.477084] device-mapper: uevent: version 1.0.3
> > [    4.477193] device-mapper: ioctl: 4.22.0-ioctl (2011-10-19)
> initialised: dm-devel@redhat.com
> > [    4.477281] TCP: cubic registered
> > [    4.477381] input: AT Translated Set 2 keyboard as
> /devices/platform/i8042/serio0/input/input0
> > [    4.477402] NET: Registered protocol family 10
> > [    4.477644] Registering the dns_resolver key type
> > [    4.477791] registered taskstats version 1
> > [    4.478330]   Magic number: 4:584:307
> > [    4.478403] tty tty36: hash matches
> > [    4.478496] rtc_cmos 00:06: setting system clock to 2012-11-29
> 01:19:35 UTC (1354151975)
> > [    4.478801] Freeing unused kernel memory: 552k freed
> > [    4.478847] Write protecting the kernel read-only data: 8192k
> > [    4.481908] Freeing unused kernel memory: 1568k freed
> > [    4.482112] Freeing unused kernel memory: 24k freed
> > [    4.524129] dracut: dracut-005-3.fc13
> > [    4.552311] pciback 0000:00:19.0: seizing device
> > [    4.552403] pciback 0000:02:00.0: seizing device
> > [    4.552941] xen: registering gsi 17 triggering 0 polarity 1
> > [    4.552952] Already setup the GSI :17
> > [    4.553934] xen: registering gsi 20 triggering 0 polarity 1
> > [    4.553964] xen: --> pirq=20 -> irq=20 (gsi=20)
> > [    4.554574] xen-pciback: backend is vpci
> > [    4.617471] udev: starting version 151
> > [    4.617770] udevd (80): /proc/80/oom_adj is deprecated, please use
> /proc/80/oom_score_adj instead.
> > [    4.654916] Linux agpgart interface v0.103
> > [    4.655397] input: Lid Switch as
> /devices/LNXSYSTM:00/device:00/PNP0C0D:00/input/input1
> > [    5.051184] ACPI: Lid Switch [LID]
> > [    5.051436] input: Power Button as
> /devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input2
> > [    5.051547] ACPI: Power Button [PBTN]
> > [    5.051682] input: Sleep Button as
> /devices/LNXSYSTM:00/device:00/PNP0C0E:00/input/input3
> > [    5.051760] ACPI: Sleep Button [SBTN]
> > [    5.054141] input: Power Button as
> /devices/LNXSYSTM:00/LNXPWRBN:00/input/input4
> > [    5.054421] ACPI: Power Button [PWRF]
> > [    5.056887] agpgart-intel 0000:00:00.0: Intel Sandybridge Chipset
> > [    5.058118] agpgart-intel 0000:00:00.0: detected gtt size: 2097152K
> total, 262144K mappable
> > [    5.064439] agpgart-intel 0000:00:00.0: detected 65536K stolen memory
> > [    5.064916] agpgart-intel 0000:00:00.0: AGP aperture is 256M @
> 0xd0000000
> > [    5.070296] [drm] Initialized drm 1.1.0 20060810
> > [    5.080002] xen: registering gsi 16 triggering 0 polarity 1
> > [    5.080015] Already setup the GSI :16
> > [    5.080364] i915 0000:00:02.0: setting latency timer to 64
> > [    5.190295] [drm] MTRR allocation failed.  Graphics performance may
> suffer.
> > [    5.190491] [drm] Supports vblank timestamp caching Rev 1
> (10.10.2010).
> > [    5.190493] [drm] Driver supports precise vblank timestamp query.
> > [    5.190554] vgaarb: device changed decodes:
> PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem
> > [    5.548301] [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp off
> > [    5.591093] input: DualPoint Stick as
> /devices/platform/i8042/serio1/input/input5
> > [    5.606212] input: AlpsPS/2 ALPS DualPoint TouchPad as
> /devices/platform/i8042/serio1/input/input6
> > [    5.806814] fbcon: inteldrmfb (fb0) is primary device
> > [    6.095967] Console: switching to colour frame buffer device 200x56
> > [    6.101477] fb0: inteldrmfb frame buffer device
> > [    6.101478] drm: registered panic notifier
> > [    6.130833] acpi device:38: registered as cooling_device4
> > [    6.133713] input: Video Bus as
> /devices/LNXSYSTM:00/device:00/PNP0A08:00/LNXVIDEO:00/input/input7
> > [    6.133915] ACPI: Video Device [VID] (multi-head: yes  rom: no  post:
> no)
> > [    6.135082] [drm] Initialized i915 1.6.0 20080730 for 0000:00:02.0 on
> minor 0
> > [    6.185946] dracut: Starting plymouth daemon
> > [    6.479391] dracut: rd_NO_DM: removing DM RAID activation
> > [    6.489309] dracut: rd_NO_MD: removing MD RAID activation
> > [    6.542596] wmi: Mapper loaded
> > [    6.564439] usbcore: registered new interface driver usbfs
> > [    6.564463] usbcore: registered new interface driver hub
> > [    6.568901] SCSI subsystem initialized
> > [    6.569574] usbcore: registered new device driver usb
> > [    6.570692] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
> > [    6.570723] xen: registering gsi 16 triggering 0 polarity 1
> > [    6.570728] Already setup the GSI :16
> > [    6.570776] ehci_hcd 0000:00:1a.0: setting latency timer to 64
> > [    6.570782] ehci_hcd 0000:00:1a.0: EHCI Host Controller
> > [    6.570814] ehci_hcd 0000:00:1a.0: new USB bus registered, assigned
> bus number 1
> > [    6.570879] ehci_hcd 0000:00:1a.0: debug port 2
> > [    6.573720] libata version 3.00 loaded.
> > [    6.574777] ehci_hcd 0000:00:1a.0: cache line size of 64 is not
> supported
> > [    6.574832] ehci_hcd 0000:00:1a.0: irq 16, io mem 0xe2e70000
> > [    6.586344] ehci_hcd 0000:00:1a.0: USB 2.0 started, EHCI 1.00
> > [    6.586369] usb usb1: New USB device found, idVendor=1d6b,
> idProduct=0002
> > [    6.586372] usb usb1: New USB device strings: Mfr=3, Product=2,
> SerialNumber=1
> > [    6.586375] usb usb1: Product: EHCI Host Controller
> > [    6.586376] usb usb1: Manufacturer: Linux 3.4.18-2.pvops.qubes.x86_64
> ehci_hcd
> > [    6.586378] usb usb1: SerialNumber: 0000:00:1a.0
> > [    6.586506] hub 1-0:1.0: USB hub found
> > [    6.586511] hub 1-0:1.0: 2 ports detected
> > [    6.586604] xen: registering gsi 17 triggering 0 polarity 1
> > [    6.586609] Already setup the GSI :17
> > [    6.586663] ehci_hcd 0000:00:1d.0: setting latency timer to 64
> > [    6.586668] ehci_hcd 0000:00:1d.0: EHCI Host Controller
> > [    6.586678] ehci_hcd 0000:00:1d.0: new USB bus registered, assigned
> bus number 2
> > [    6.586734] ehci_hcd 0000:00:1d.0: debug port 2
> > [    6.590650] ehci_hcd 0000:00:1d.0: cache line size of 64 is not
> supported
> > [    6.590709] ehci_hcd 0000:00:1d.0: irq 17, io mem 0xe2e50000
> > [    6.606335] ehci_hcd 0000:00:1d.0: USB 2.0 started, EHCI 1.00
> > [    6.606364] usb usb2: New USB device found, idVendor=1d6b,
> idProduct=0002
> > [    6.606367] usb usb2: New USB device strings: Mfr=3, Product=2,
> SerialNumber=1
> > [    6.606370] usb usb2: Product: EHCI Host Controller
> > [    6.606371] usb usb2: Manufacturer: Linux 3.4.18-2.pvops.qubes.x86_64
> ehci_hcd
> > [    6.606373] usb usb2: SerialNumber: 0000:00:1d.0
> > [    6.606519] hub 2-0:1.0: USB hub found
> > [    6.606524] hub 2-0:1.0: 2 ports detected
> > [    6.606620] ahci 0000:00:1f.2: version 3.0
> > [    6.606641] xen: registering gsi 18 triggering 0 polarity 1
> > [    6.606647] Already setup the GSI :18
> > [    6.606896] ahci: SSS flag set, parallel bus scan disabled
> > [    6.626400] ahci 0000:00:1f.2: AHCI 0001.0300 32 slots 6 ports 6 Gbps
> 0x3b impl SATA mode
> > [    6.626405] ahci 0000:00:1f.2: flags: 64bit ncq sntf stag pm led clo
> pio slum part ems sxs apst
> > [    6.626414] ahci 0000:00:1f.2: setting latency timer to 64
> > [    6.673732] scsi0 : ahci
> > [    6.683363] scsi1 : ahci
> > [    6.697268] scsi2 : ahci
> > [    6.711526] scsi3 : ahci
> > [    6.733931] scsi4 : ahci
> > [    6.739603] scsi5 : ahci
> > [    6.842106] ata1: SATA max UDMA/133 abar m2048@0xe2e40000 port
> 0xe2e40100 irq 293
> > [    6.842118] ata2: SATA max UDMA/133 abar m2048@0xe2e40000 port
> 0xe2e40180 irq 293
> > [    6.842124] ata3: DUMMY
> > [    6.842129] ata4: SATA max UDMA/133 abar m2048@0xe2e40000 port
> 0xe2e40280 irq 293
> > [    6.842136] ata5: SATA max UDMA/133 abar m2048@0xe2e40000 port
> 0xe2e40300 irq 293
> > [    6.842143] ata6: SATA max UDMA/133 abar m2048@0xe2e40000 port
> 0xe2e40380 irq 293
> > [    6.898480] usb 1-1: new high-speed USB device number 2 using ehci_hcd
> > [    7.031312] usb 1-1: New USB device found, idVendor=8087,
> idProduct=0024
> > [    7.031323] usb 1-1: New USB device strings: Mfr=0, Product=0,
> SerialNumber=0
> > [    7.032072] hub 1-1:1.0: USB hub found
> > [    7.032344] hub 1-1:1.0: 6 ports detected
> > [    7.142515] usb 2-1: new high-speed USB device number 2 using ehci_hcd
> > [    7.162484] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
> > [    7.268594] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by
> device (Stat=0x51 Err=0x04)
> > [    7.268770] ata1.00: ATA-9: KINGSTON SV200S3256G, E111008a, max
> UDMA/100
> > [    7.268778] ata1.00: 500118192 sectors, multi 16: LBA48 NCQ (depth
> 31/32), AA
> > [    7.272554] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by
> device (Stat=0x51 Err=0x04)
> > [    7.272758] ata1.00: configured for UDMA/100
> > [    7.273314] scsi 0:0:0:0: Direct-Access     ATA      KINGSTON SV200S3
> E111 PQ: 0 ANSI: 5
> > [    7.274861] usb 2-1: New USB device found, idVendor=8087,
> idProduct=0024
> > [    7.274870] usb 2-1: New USB device strings: Mfr=0, Product=0,
> SerialNumber=0
> > [    7.275358] hub 2-1:1.0: USB hub found
> > [    7.275521] hub 2-1:1.0: 8 ports detected
> > [    7.346717] usb 1-1.4: new full-speed USB device number 3 using
> ehci_hcd
> > [    7.443529] usb 1-1.4: New USB device found, idVendor=413c,
> idProduct=8187
> > [    7.443539] usb 1-1.4: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> > [    7.443546] usb 1-1.4: Product: DW375 Bluetooth Module
> > [    7.443550] usb 1-1.4: Manufacturer: Dell Computer Corp
> > [    7.443555] usb 1-1.4: SerialNumber: D0DF9A40FE60
> > [    7.514736] usb 1-1.5: new high-speed USB device number 4 using
> ehci_hcd
> > [    7.590440] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> > [    7.593835] ata2.00: ATAPI: HL-DT-ST DVD+/-RW GU60N, A103, max
> UDMA/133
> > [    7.604147] ata2.00: configured for UDMA/133
> > [    7.614746] usb 1-1.5: New USB device found, idVendor=05ca,
> idProduct=181c
> > [    7.614757] usb 1-1.5: New USB device strings: Mfr=1, Product=2,
> SerialNumber=0
> > [    7.614763] usb 1-1.5: Product: Laptop_Integrated_Webcam_FHD
> > [    7.614768] usb 1-1.5: Manufacturer: CN0CJ3P27248717F040SA01
> > [    7.618662] scsi 1:0:0:0: CD-ROM            HL-DT-ST DVD+-RW GU60N
>  A103 PQ: 0 ANSI: 5
> > [    7.686581] usb 2-1.6: new high-speed USB device number 3 using
> ehci_hcd
> > [    7.795399] usb 2-1.6: New USB device found, idVendor=413c,
> idProduct=818d
> > [    7.795410] usb 2-1.6: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> > [    7.795416] usb 2-1.6: Product: DW5550
> > [    7.795420] usb 2-1.6: Manufacturer: Dell
> > [    7.795425] usb 2-1.6: SerialNumber: 88FA653FDF944970
> > [    7.902770] usb 2-1.8: new full-speed USB device number 4 using
> ehci_hcd
> > [    7.938478] ata4: SATA link down (SStatus 0 SControl 300)
> > [    8.017319] usb 2-1.8: New USB device found, idVendor=0a5c,
> idProduct=5801
> > [    8.017330] usb 2-1.8: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> > [    8.017336] usb 2-1.8: Product: 5880
> > [    8.017340] usb 2-1.8: Manufacturer: Broadcom Corp
> > [    8.017344] usb 2-1.8: SerialNumber: 0123456789ABCD
> > [    8.017794] usb 2-1.8: config 0 descriptor??
> > [    8.258411] ata5: SATA link down (SStatus 0 SControl 300)
> > [    8.578480] ata6: SATA link down (SStatus 0 SControl 300)
> > [    8.588630] sd 0:0:0:0: [sda] 500118192 512-byte logical blocks: (256
> GB/238 GiB)
> > [    8.588846] sd 0:0:0:0: [sda] Write Protect is off
> > [    8.588861] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
> > [    8.588967] sd 0:0:0:0: [sda] Write cache: enabled, read cache:
> enabled, doesn't support DPO or FUA
> > [    8.590122]  sda: sda1 sda2
> > [    8.591059] sd 0:0:0:0: [sda] Attached SCSI disk
> > [    8.609438] sr0: scsi3-mmc drive: 24x/8x writer dvd-ram cd/rw
> xa/form2 cdda tray
> > [    8.609451] cdrom: Uniform CD-ROM driver Revision: 3.20
> > [    8.609737] sr 1:0:0:0: Attached scsi CD-ROM sr0
> > [    8.714515] dracut: luksOpen /dev/sda2
> luks-400336fa-c7c4-4be3-a244-c909aa16a18c
> > [   13.862564] dracut: Scanning devices dm-0  for LVM logical volumes
> vg_dom0/lv_root vg_dom0/lv_swap
> > [   13.907639] dracut: inactive '/dev/vg_dom0/lv_root' [221.62 GiB]
> inherit
> > [   13.907708] dracut: inactive '/dev/vg_dom0/lv_swap' [16.34 GiB]
> inherit
> > [   14.162684] EXT4-fs (dm-1): INFO: recovery required on readonly
> filesystem
> > [   14.162693] EXT4-fs (dm-1): write access will be enabled during
> recovery
> > [   14.775779] EXT4-fs (dm-1): orphan cleanup on readonly fs
> > [   14.775800] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767209
> > [   14.775909] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767207
> > [   14.776007] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767205
> > [   14.776035] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767206
> > [   14.776062] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767204
> > [   14.776088] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767202
> > [   14.776117] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767198
> > [   14.776146] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767196
> > [   14.776172] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767191
> > [   14.776198] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767189
> > [   14.776227] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767188
> > [   14.776274] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767187
> > [   14.777018] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767186
> > [   14.777060] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767184
> > [   14.777089] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767183
> > [   14.777117] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767171
> > [   14.777146] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767170
> > [   14.777172] EXT4-fs (dm-1): 17 orphan inodes deleted
> > [   14.777177] EXT4-fs (dm-1): recovery complete
> > [   14.797124] EXT4-fs (dm-1): mounted filesystem with ordered data
> mode. Opts: (null)
> > [   14.806762] dracut: Mounted root filesystem
> /dev/mapper/vg_dom0-lv_root
> > [   14.957211] dracut: Switching root
> > [   15.599261] udev: starting version 151
> > [   15.673674] iTCO_vendor_support: vendor-support=0
> > [   15.676374] mei: module is from the staging directory, the quality is
> unknown, you have been warned.
> > [   15.676488] iTCO_wdt: Intel TCO WatchDog Timer Driver v1.07
> > [   15.676679] iTCO_wdt: Found a Cougar Point TCO device (Version=2,
> TCOBASE=0x0460)
> > [   15.676711] xen: registering gsi 16 triggering 0 polarity 1
> > [   15.676716] Already setup the GSI :16
> > [   15.676725] mei 0000:00:16.0: setting latency timer to 64
> > [   15.676754] iTCO_wdt: initialized. heartbeat=30 sec (nowayout=0)
> > [   15.712582] sd 0:0:0:0: Attached scsi generic sg0 type 0
> > [   15.712620] sr 1:0:0:0: Attached scsi generic sg1 type 5
> > [   15.730448] input: PC Speaker as /devices/platform/pcspkr/input/input8
> > [   15.734494] xen: registering gsi 18 triggering 0 polarity 1
> > [   15.734500] Already setup the GSI :18
> > [   15.734506] ACPI Warning: 0x0000000000004040-0x000000000000405f
> SystemIO conflicts with Region \_SB_.PCI0.SBUS.SMBI 1
> (20120320/utaddress-251)
> > [   15.734512] ACPI: If an ACPI driver is available for this device, you
> should use it instead of the native driver
> > [   15.737002] microcode: CPU0 sig=0x206a7, pf=0x10, revision=0x23
> > [   15.741412] watchdog: INTCAMT: cannot register miscdev on minor=130
> (err=-16)
> > [   15.741418] watchdog: error registering /dev/watchdog (err=-16)
> > [   15.741422] mei 0000:00:16.0: unable to register watchdog device.
> > [   15.790637] thermal LNXTHERM:00: registered as thermal_zone0
> > [   15.790641] ACPI: Thermal Zone [THM] (25 C)
> > [   15.814551] ACPI: Deprecated procfs I/F for battery is loaded, please
> retry with CONFIG_ACPI_PROCFS_POWER cleared
> > [   15.814559] ACPI: Battery Slot [BAT0] (battery present)
> > [   15.815037] ACPI: Deprecated procfs I/F for AC is loaded, please
> retry with CONFIG_ACPI_PROCFS_POWER cleared
> > [   15.815521] ACPI: AC Adapter [AC] (on-line)
> > [   15.867835] usbcore: registered new interface driver usbback
> > [   15.975826] ACPI: Deprecated procfs I/F for battery is loaded, please
> retry with CONFIG_ACPI_PROCFS_POWER cleared
> > [   15.975836] ACPI: Battery Slot [BAT1] (battery absent)
> > [   16.102871] ACPI: Deprecated procfs I/F for battery is loaded, please
> retry with CONFIG_ACPI_PROCFS_POWER cleared
> > [   16.102882] ACPI: Battery Slot [BAT2] (battery absent)
> > [   16.106793] sdhci: Secure Digital Host Controller Interface driver
> > [   16.106797] sdhci: Copyright(c) Pierre Ossman
> > [   16.107131] parport_pc 00:08: [io  0x0378-0x037b]
> > [   16.107296] parport_pc 00:08: [irq 5]
> > [   16.107709] sdhci-pci 0000:0a:00.0: SDHCI controller found
> [1217:8221] (rev 5)
> > [   16.159148] xen: registering gsi 17 triggering 0 polarity 1
> > [   16.159156] Already setup the GSI :17
> > [   16.159241] sdhci-pci 0000:0a:00.0: Invalid iomem size. You may
> experience problems.
> > [   16.159319] 0000:0a:00.0 supply vmmc not found, using dummy regulator
> > [   16.159384] Registered led device: mmc0::
> > [   16.160442] mmc0: SDHCI controller on PCI [0000:0a:00.0] using DMA
> > [   16.160928] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> > [   16.171737] Linux video capture interface: v2.00
> > [   16.192158] cdc_wdm 2-1.6:1.5: cdc-wdm0: USB WDM device
> > [   16.192211] cdc_wdm 2-1.6:1.8: cdc-wdm1: USB WDM device
> > [   16.192234] usbcore: registered new interface driver cdc_wdm
> > [   16.195744] cdc_acm 2-1.6:1.1: ttyACM0: USB ACM device
> > [   16.198739] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> > [   16.220532] cdc_acm 2-1.6:1.3: ttyACM1: USB ACM device
> > [   16.223728] cdc_acm 2-1.6:1.9: ttyACM2: USB ACM device
> > [   16.235089] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> > [   16.235234] usbcore: registered new interface driver cdc_acm
> > [   16.235236] cdc_acm: USB Abstract Control Model driver for USB modems
> and ISDN adapters
> > [   16.240235] uvcvideo: Found UVC 1.00 device
> Laptop_Integrated_Webcam_FHD (05ca:181c)
> > [   16.269474] input: Laptop_Integrated_Webcam_FHD as
> /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/input/input9
> > [   16.269579] usbcore: registered new interface driver uvcvideo
> > [   16.269581] USB Video Class driver (1.1.1)
> > [   16.277415] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> > [   16.296646] usb 2-1.6: MAC-Address: 02:80:37:ec:02:00
> > [   16.296810] cdc_ncm 2-1.6:1.6: usb0: register 'cdc_ncm' at
> usb-0000:00:1d.0-1.6, CDC NCM, 02:80:37:ec:02:00
> > [   16.296847] usbcore: registered new interface driver cdc_ncm
> > [   16.310604] parport_pc 00:08: activated
> > [   16.310611] parport_pc 00:08: reported by Plug and Play ACPI
> > [   16.310781] parport_pc 00:08: disabled
> > [   16.311583] tpm_tis 00:0a: 1.2 TPM (device-id 0x2001, rev-id 32)
> > [   16.399296] Bluetooth: Core ver 2.16
> > [   16.399312] NET: Registered protocol family 31
> > [   16.399314] Bluetooth: HCI device and connection manager initialized
> > [   16.399317] Bluetooth: HCI socket layer initialized
> > [   16.399318] Bluetooth: L2CAP socket layer initialized
> > [   16.399325] Bluetooth: SCO socket layer initialized
> > [   16.450583] xen: registering gsi 22 triggering 0 polarity 1
> > [   16.450600] xen: --> pirq=22 -> irq=22 (gsi=22)
> > [   16.567577] usbcore: registered new interface driver btusb
> > [   16.739259] dcdbas dcdbas: Dell Systems Management Base Driver
> (version 5.6.0-3.2)
> > [   16.819125] input: Dell WMI hotkeys as /devices/virtual/input/input10
> > [   16.925000] microcode: CPU1 sig=0x206a7, pf=0x10, revision=0x23
> > [   16.929246] ppdev: user-space parallel port driver
> > [   16.954783] microcode: CPU2 sig=0x206a7, pf=0x10, revision=0x23
> > [   16.975176] microcode: CPU3 sig=0x206a7, pf=0x10, revision=0x23
> > [   17.004696] microcode: Microcode Update Driver: v2.00 <
> tigran@aivazian.fsnet.co.uk>, Peter Oruba
> > [   17.067123] ALSA hda_codec.c:5101 autoconfig: line_outs=1
> (0xe/0x0/0x0/0x0/0x0) type:line
> > [   17.067127] ALSA hda_codec.c:5105    speaker_outs=1
> (0xd/0x0/0x0/0x0/0x0)
> > [   17.067129] ALSA hda_codec.c:5109    hp_outs=1 (0xb/0x0/0x0/0x0/0x0)
> > [   17.067131] ALSA hda_codec.c:5110    mono: mono_out=0x0
> > [   17.067133] ALSA hda_codec.c:5114    inputs:
> > [   17.067135] ALSA hda_codec.c:5118  Mic=0xa
> > [   17.067137] ALSA hda_codec.c:5118  Dock Mic=0xf
> > [   17.067139] ALSA hda_codec.c:5120
> > [   17.067637] ALSA patch_sigmatel.c:3117 stac92xx: dac_nids=1
> (0x13/0x0/0x0/0x0/0x0)
> > [   17.081104] input: HDA Intel PCH HDMI/DP,pcm=8 as
> /devices/pci0000:00/0000:00:1b.0/sound/card0/input11
> > [   17.081194] input: HDA Intel PCH HDMI/DP,pcm=7 as
> /devices/pci0000:00/0000:00:1b.0/sound/card0/input12
> > [   17.081250] input: HDA Intel PCH HDMI/DP,pcm=3 as
> /devices/pci0000:00/0000:00:1b.0/sound/card0/input13
> > [   17.081342] input: HDA Intel PCH Dock Mic as
> /devices/pci0000:00/0000:00:1b.0/sound/card0/input14
> > [   17.081432] input: HDA Intel PCH Mic as
> /devices/pci0000:00/0000:00:1b.0/sound/card0/input15
> > [   17.081522] input: HDA Intel PCH Headphone as
> /devices/pci0000:00/0000:00:1b.0/sound/card0/input16
> > [   17.081610] input: HDA Intel PCH Dock Line Out as
> /devices/pci0000:00/0000:00:1b.0/sound/card0/input17
> > [   17.265462] Event-channel device installed.
> > [   17.661764] EXT4-fs (dm-1): re-mounted. Opts: (null)
> > [   17.802446] EXT4-fs (sda1): mounted filesystem with ordered data
> mode. Opts: (null)
> > [   19.361631] Adding 17137660k swap on /dev/mapper/vg_dom0-lv_swap.
>  Priority:-1 extents:1 across:17137660k SS
> > [   22.602549] ehci_hcd 0000:00:1a.0: remove, state 1
> > [   22.602568] usb usb1: USB disconnect, device number 1
> > [   22.602573] usb 1-1: USB disconnect, device number 2
> > [   22.602578] usb 1-1.4: USB disconnect, device number 3
> > [   22.605235] usb 1-1.5: USB disconnect, device number 4
> > [   22.636910] ehci_hcd 0000:00:1a.0: USB bus 1 deregistered
> > [   22.637183] pciback 0000:00:1a.0: seizing device
> > [   22.637235] xen: registering gsi 16 triggering 0 polarity 1
> > [   22.637241] Already setup the GSI :16
> > [   22.662363] ehci_hcd 0000:00:1d.0: remove, state 1
> > [   22.662371] usb usb2: USB disconnect, device number 1
> > [   22.662373] usb 2-1: USB disconnect, device number 2
> > [   22.662376] usb 2-1.6: USB disconnect, device number 3
> > [   22.668531] cdc_ncm 2-1.6:1.6: usb0: unregister 'cdc_ncm'
> usb-0000:00:1d.0-1.6, CDC NCM
> > [   22.694795] usb 2-1.8: USB disconnect, device number 4
> > [   22.699298] ehci_hcd 0000:00:1d.0: USB bus 2 deregistered
> > [   22.699577] pciback 0000:00:1d.0: seizing device
> > [   22.699632] xen: registering gsi 17 triggering 0 polarity 1
> > [   22.699637] Already setup the GSI :17
> > [   23.684708] xen-pciback: vpci: 0000:00:19.0: assign to virtual slot 0
> > [   23.685240] xen-pciback: vpci: 0000:00:1a.0: assign to virtual slot 1
> > [   23.685722] xen-pciback: vpci: 0000:00:1d.0: assign to virtual slot 2
> > [   23.686764] xen-pciback: vpci: 0000:02:00.0: assign to virtual slot 3
> > [   23.909636] pciback 0000:00:19.0: Driver tried to write to a
> read-only configuration space field at offset 0xd2, size 2. This may be
> harmless, but if you have problems with your device:
> > [   23.909638] 1) see permissive attribute in sysfs
> > [   23.909638] 2) report problems to the xen-devel mailing list along
> with details of your device obtained from lspci.
> > [   23.917523] pciback 0000:02:00.0: Driver tried to write to a
> read-only configuration space field at offset 0xd2, size 2. This may be
> harmless, but if you have problems with your device:
> > [   23.917526] 1) see permissive attribute in sysfs
> > [   23.917526] 2) report problems to the xen-devel mailing list along
> with details of your device obtained from lspci.
> > [   24.123663] xen-blkback:ring-ref 9, event-channel 14, protocol 1
> (x86_64-abi)
> > [   24.140460] xen-blkback:ring-ref 10, event-channel 15, protocol 1
> (x86_64-abi)
> > [   24.151420] xen-blkback:ring-ref 11, event-channel 16, protocol 1
> (x86_64-abi)
> > [   24.158428] xen-blkback:ring-ref 12, event-channel 17, protocol 1
> (x86_64-abi)
> > [   28.697615] pciback 0000:00:1a.0: enabling device (0000 -> 0002)
> > [   28.697628] xen: registering gsi 16 triggering 0 polarity 1
> > [   28.697634] Already setup the GSI :16
> > [   28.697805] pciback 0000:00:1a.0: setting latency timer to 64
> > [   28.713578] pciback 0000:00:19.0: enabling device (0000 -> 0003)
> > [   28.713591] xen: registering gsi 20 triggering 0 polarity 1
> > [   28.713598] Already setup the GSI :20
> > [   28.713858] pciback 0000:00:19.0: setting latency timer to 64
> > [   29.021371] pciback 0000:00:1d.0: enabling device (0000 -> 0002)
> > [   29.021389] xen: registering gsi 17 triggering 0 polarity 1
> > [   29.021400] Already setup the GSI :17
> > [   29.021805] pciback 0000:00:1d.0: setting latency timer to 64
> > [   29.150053] pciback 0000:02:00.0: enabling device (0000 -> 0002)
> > [   29.150122] xen: registering gsi 17 triggering 0 polarity 1
> > [   29.150150] Already setup the GSI :17
> > [   33.635416] xen-blkback:ring-ref 9, event-channel 14, protocol 1
> (x86_64-abi)
> > [   33.643330] xen-blkback:ring-ref 10, event-channel 15, protocol 1
> (x86_64-abi)
> > [   33.651561] xen-blkback:ring-ref 11, event-channel 16, protocol 1
> (x86_64-abi)
> > [   33.672105] xen-blkback:ring-ref 12, event-channel 17, protocol 1
> (x86_64-abi)
> > [  104.230911] xen-blkback:ring-ref 9, event-channel 24, protocol 1
> (x86_64-abi)
> > [  104.252421] xen-blkback:ring-ref 10, event-channel 25, protocol 1
> (x86_64-abi)
> > [  104.253177] xen-blkback:ring-ref 11, event-channel 26, protocol 1
> (x86_64-abi)
> > [  104.254220] xen-blkback:ring-ref 12, event-channel 27, protocol 1
> (x86_64-abi)
> > [  105.086732] xen-blkback:ring-ref 9, event-channel 14, protocol 1
> (x86_64-abi)
> > [  105.105505] xen-blkback:ring-ref 10, event-channel 15, protocol 1
> (x86_64-abi)
> > [  105.115951] xen-blkback:ring-ref 11, event-channel 16, protocol 1
> (x86_64-abi)
> > [  105.127384] xen-blkback:ring-ref 12, event-channel 17, protocol 1
> (x86_64-abi)
> > [  105.929760] xen-blkback:ring-ref 9, event-channel 14, protocol 1
> (x86_64-abi)
> > [  105.934841] xen-blkback:ring-ref 10, event-channel 15, protocol 1
> (x86_64-abi)
> > [  105.973920] xen-blkback:ring-ref 11, event-channel 16, protocol 1
> (x86_64-abi)
> > [  105.975320] xen-blkback:ring-ref 12, event-channel 17, protocol 1
> (x86_64-abi)
> > [  107.191781] xen-blkback:ring-ref 9, event-channel 14, protocol 1
> (x86_64-abi)
> > [  107.203711] xen-blkback:ring-ref 10, event-channel 15, protocol 1
> (x86_64-abi)
> > [  107.208481] xen-blkback:ring-ref 11, event-channel 16, protocol 1
> (x86_64-abi)
> > [  107.212081] xen-blkback:ring-ref 12, event-channel 17, protocol 1
> (x86_64-abi)
> > [  733.434608] PM: Syncing filesystems ... done.
> > [  733.436228] PM: Preparing system for mem sleep
> > [  733.514803] Freezing user space processes ... (elapsed 0.01 seconds)
> done.
> > [  733.530594] Freezing remaining freezable tasks ... (elapsed 0.01
> seconds) done.
> > [  733.546589] PM: Entering mem sleep
> > [  733.546741] Suspending console(s) (use no_console_suspend to debug)
> > [  733.547431] sd 0:0:0:0: [sda] Synchronizing SCSI cache
> > [  733.558336] sd 0:0:0:0: [sda] Stopping disk
> > [  734.194656] PM: suspend of devices complete after 647.504 msecs
> > [  734.195026] PM: late suspend of devices complete after 0.359 msecs
> > [  734.210655] PM: noirq suspend of devices complete after 15.614 msecs
> > [  734.211326] ACPI: Preparing to enter system sleep state S3
> > [  734.235008] PM: Saving platform NVS memory
> > [  734.328066] Disabling non-boot CPUs ...
> > [  735.945491] ACPI: Low-level resume complete
> > [  735.945579] PM: Restoring platform NVS memory
> > [  736.000094] Enabling non-boot CPUs ...
> > [  736.000256] installing Xen timer for CPU 1
> > [  736.004594] CPU1 is up
> > [  736.004819] installing Xen timer for CPU 2
> > [  736.067516] CPU2 is up
> > [  736.067770] installing Xen timer for CPU 3
> > [  736.101535] CPU3 is up
> > [  736.102470] ACPI: Waking up from system sleep state S3
> > [  736.555932] PM: noirq resume of devices complete after 7.970 msecs
> > [  736.556506] PM: early resume of devices complete after 0.387 msecs
> > [  736.660336] i915 0000:00:02.0: setting latency timer to 64
> > [  736.660404] pciback 0000:00:19.0: setting latency timer to 64
> > [  736.660453] xen: registering gsi 16 triggering 0 polarity 1
> > [  736.660460] Already setup the GSI :16
> > [  736.660490] pciback 0000:00:1a.0: setting latency timer to 64
> > [  736.660605] xen: registering gsi 17 triggering 0 polarity 1
> > [  736.660610] Already setup the GSI :17
> > [  736.660641] pciback 0000:00:1d.0: setting latency timer to 64
> > [  736.660696] xen: registering gsi 22 triggering 0 polarity 1
> > [  736.660701] Already setup the GSI :22
> > [  736.661221] ahci 0000:00:1f.2: setting latency timer to 64
> > [  736.689606] xen: registering gsi 18 triggering 0 polarity 1
> > [  736.689608] Already setup the GSI :18
> > [  736.689704] xen: registering gsi 17 triggering 0 polarity 1
> > [  736.689706] Already setup the GSI :17
> > [  736.711623] [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp off
> > [  736.802676] watchdog: INTCAMT: cannot register miscdev on minor=130
> (err=-16)
> > [  736.802678] watchdog: error registering /dev/watchdog (err=-16)
> > [  736.802680] mei 0000:00:16.0: unable to register watchdog device.
> > [  737.060106] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> > [  737.060330] ata4: SATA link down (SStatus 0 SControl 300)
> > [  737.060372] ata5: SATA link down (SStatus 0 SControl 300)
> > [  737.074123] ata2.00: configured for UDMA/133
> > [  737.117629] ata6: SATA link down (SStatus 0 SControl 300)
> > [  738.619036] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
> > [  738.743565] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by
> device (Stat=0x51 Err=0x04)
> > [  738.901088] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by
> device (Stat=0x51 Err=0x04)
> > [  738.903441] ata1.00: configured for UDMA/100
> > [  738.903843] sd 0:0:0:0: [sda] Starting disk
> > [  738.905367] PM: resume of devices complete after 2348.851 msecs
> > [  738.905922] PM: Finishing wakeup.
> > [  738.905926] Restarting tasks ... done.
> > [  738.911334] video LNXVIDEO:00: Restoring backlight state
> > [  739.836250] dell_wmi: Received unknown WMI event (0x0)
> > [  740.184759] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> > [  740.239730] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> > [  740.327711] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> > [  740.373931] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> > [  742.542022] hrtimer: interrupt took 102980031 ns
> > [  757.609031] [sched_delayed] sched: RT throttling activated
> > [  760.164427] hda-intel: IRQ timing workaround is activated for card
> #0. Suggest a bigger bdl_pos_adj.
>
> > (XEN) Xen version 4.1.3 (user@marmarek.net) (gcc version 4.4.5 20101112
> (Red Hat 4.4.5-2) (GCC) ) Mon Nov 26 15:25:32 EST 2012
> > (XEN) Latest ChangeSet: unavailable
> > (XEN) Bootloader: GNU GRUB 0.97
> > (XEN) Command line: console=none cpufreq=verbose=1
> > (XEN) Video information:
> > (XEN)  VGA is text mode 80x25, font 8x16
> > (XEN)  VBE/DDC methods: V2; EDID transfer time: 1 seconds
> > (XEN) Disc information:
> > (XEN)  Found 1 MBR signatures
> > (XEN)  Found 1 EDD information structures
> > (XEN) Xen-e820 RAM map:
> > (XEN)  0000000000000000 - 000000000009a800 (usable)
> > (XEN)  000000000009a800 - 00000000000a0000 (reserved)
> > (XEN)  00000000000e0000 - 0000000000100000 (reserved)
> > (XEN)  0000000000100000 - 0000000007eea000 (usable)
> > (XEN)  0000000007eea000 - 0000000007f67000 (ACPI NVS)
> > (XEN)  0000000007f67000 - 0000000007f70000 (usable)
> > (XEN)  0000000007f70000 - 0000000007f76000 (ACPI NVS)
> > (XEN)  0000000007f76000 - 0000000007f78000 (usable)
> > (XEN)  0000000007f78000 - 0000000008000000 (ACPI NVS)
> > (XEN)  0000000008000000 - 000000000dffd000 (usable)
> > (XEN)  000000000dffd000 - 000000000e000000 (ACPI data)
> > (XEN)  000000000e000000 - 0000000020000000 (usable)
> > (XEN)  0000000020000000 - 0000000020200000 (reserved)
> > (XEN)  0000000020200000 - 0000000040000000 (usable)
> > (XEN)  0000000040000000 - 0000000040200000 (reserved)
> > (XEN)  0000000040200000 - 00000000c83b4000 (usable)
> > (XEN)  00000000c83b4000 - 00000000c840a000 (reserved)
> > (XEN)  00000000c840a000 - 00000000c840e000 (usable)
> > (XEN)  00000000c840e000 - 00000000c840f000 (reserved)
> > (XEN)  00000000c840f000 - 00000000c8411000 (usable)
> > (XEN)  00000000c8411000 - 00000000c8414000 (reserved)
> > (XEN)  00000000c8414000 - 00000000c841e000 (usable)
> > (XEN)  00000000c841e000 - 00000000c8428000 (reserved)
> > (XEN)  00000000c8428000 - 00000000c8432000 (usable)
> > (XEN)  00000000c8432000 - 00000000c8436000 (reserved)
> > (XEN)  00000000c8436000 - 00000000cac00000 (usable)
> > (XEN)  00000000cb800000 - 00000000cfa00000 (reserved)
> > (XEN)  00000000fed1c000 - 00000000fed20000 (reserved)
> > (XEN)  00000000ffc00000 - 00000000ffc20000 (reserved)
> > (XEN)  0000000100000000 - 000000042e000000 (usable)
> > (XEN) ACPI: RSDP 000FE300, 0024 (r2 DELL  )
> > (XEN) ACPI: XSDT 0DFFEE18, 007C (r1 DELL    CBX3     6222004 MSFT
>  10013)
> > (XEN) ACPI: FACP 07F90D98, 00F4 (r4 DELL    CBX3     6222004 MSFT
>  10013)
> > (XEN) ACPI: DSDT 07F5E018, 8834 (r2 INT430 SYSFexxx     1001 INTL
> 20090903)
> > (XEN) ACPI: FACS 07FEDD40, 0040
> > (XEN) ACPI: APIC 0DFFDF18, 00CC (r2 DELL    CBX3     6222004 MSFT
>  10013)
> > (XEN) ACPI: TCPA 07FEED18, 0032 (r2                        0
> 0)
> > (XEN) ACPI: SSDT 07F91A98, 02F9 (r1 DELLTP      TPM     3000 INTL
> 20090903)
> > (XEN) ACPI: MCFG 07FEEC98, 003C (r1 DELL   SNDYBRDG  6222004 MSFT
> 97)
> > (XEN) ACPI: HPET 07FEEC18, 0038 (r1 A M I   PCHHPET  6222004 AMI.
>  3)
> > (XEN) ACPI: BOOT 07FEEB98, 0028 (r1 DELL   CBX3      6222004 AMI
> 10013)
> > (XEN) ACPI: SSDT 07F75018, 0804 (r1  PmRef  Cpu0Ist     3000 INTL
> 20090903)
> > (XEN) ACPI: SSDT 07F74018, 0996 (r1  PmRef    CpuPm     3000 INTL
> 20090903)
> > (XEN) ACPI: DMAR 07F90C18, 00E8 (r1 INTEL      SNB         1 INTL
>  1)
> > (XEN) ACPI: SLIC 07F7EC18, 0176 (r3 DELL    CBX3     6222004 MSFT
>  10013)
> > (XEN) System RAM: 16262MB (16652432kB)
> > (XEN) Domain heap initialised
> > (XEN) ACPI: 32/64X FACS address mismatch in FADT -
> 07fede40/0000000007fedd40, using 32
> > (XEN) Processor #0 6:10 APIC version 21
> > (XEN) Processor #2 6:10 APIC version 21
> > (XEN) Processor #1 6:10 APIC version 21
> > (XEN) Processor #3 6:10 APIC version 21
> > (XEN) IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-23
> > (XEN) Enabling APIC mode:  Flat.  Using 1 I/O APICs
> > (XEN) Table is not found!
> > (XEN) Switched to APIC driver x2apic_cluster.
> > (XEN) Using scheduler: SMP Credit Scheduler (credit)
> > (XEN) Detected 2494.416 MHz processor.
> > (XEN) Initing memory sharing.
> > (XEN) Intel VT-d supported page sizes: 4kB.
> > (XEN) Intel VT-d supported page sizes: 4kB.
> > (XEN) Intel VT-d Snoop Control not enabled.
> > (XEN) Intel VT-d Dom0 DMA Passthrough not enabled.
> > (XEN) Intel VT-d Queued Invalidation enabled.
> > (XEN) Intel VT-d Interrupt Remapping enabled.
> > (XEN) Intel VT-d Shared EPT tables not enabled.
> > (XEN) I/O virtualisation enabled
> > (XEN)  - Dom0 mode: Relaxed
> > (XEN) Enabled directed EOI with ioapic_ack_old on!
> > (XEN) ENABLING IO-APIC IRQs
> > (XEN)  -> Using old ACK method
> > (XEN) Platform timer appears to have unexpectedly wrapped 1 times.
> > (XEN) Platform timer is 14.318MHz HPET
> > (XEN) Allocated console ring of 16 KiB.
> > (XEN) VMX: Supported advanced features:
> > (XEN)  - APIC MMIO access virtualisation
> > (XEN)  - APIC TPR shadow
> > (XEN)  - Extended Page Tables (EPT)
> > (XEN)  - Virtual-Processor Identifiers (VPID)
> > (XEN)  - Virtual NMI
> > (XEN)  - MSR direct-access bitmap
> > (XEN)  - Unrestricted Guest
> > (XEN) HVM: ASIDs enabled.
> > (XEN) HVM: VMX enabled
> > (XEN) HVM: Hardware Assisted Paging (HAP) detected
> > (XEN) HVM: HAP page sizes: 4kB, 2MB
> > (XEN) Brought up 4 CPUs
> > (XEN) *** LOADING DOMAIN 0 ***
> > (XEN)  Xen  kernel: 64-bit, lsb, compat32
> > (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x1e13000
> > (XEN) PHYSICAL MEMORY ARRANGEMENT:
> > (XEN)  Dom0 alloc.:   0000000418000000->000000041c000000 (4046567 pages
> to be allocated)
> > (XEN)  Init. ramdisk: 000000042b335000->000000042dfffc00
> > (XEN) VIRTUAL MEMORY ARRANGEMENT:
> > (XEN)  Loaded kernel: ffffffff81000000->ffffffff81e13000
> > (XEN)  Init. ramdisk: ffffffff81e13000->ffffffff84addc00
> > (XEN)  Phys-Mach map: ffffffff84ade000->ffffffff869f3d90
> > (XEN)  Start info:    ffffffff869f4000->ffffffff869f44b4
> > (XEN)  Page tables:   ffffffff869f5000->ffffffff86a2e000
> > (XEN)  Boot stack:    ffffffff86a2e000->ffffffff86a2f000
> > (XEN)  TOTAL:         ffffffff80000000->ffffffff86c00000
> > (XEN)  ENTRY ADDRESS: ffffffff8188e200
> > (XEN) Dom0 has maximum 4 VCPUs
> > (XEN) Scrubbing Free RAM: .done.
> > (XEN) Xen trace buffers: disabled
> > (XEN) Std. Loglevel: Errors and warnings
> > (XEN) Guest Loglevel: Nothing (Rate-limited: Errors and warnings)
> > (XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch
> input to Xen)
> > (XEN) Freed 216kB init memory.
> > (XEN) no cpu_id for acpi_id 5
> > (XEN) no cpu_id for acpi_id 6
> > (XEN) no cpu_id for acpi_id 7
> > (XEN) no cpu_id for acpi_id 8
> > (XEN) physdev.c:171: dom0: wrong map_pirq type 3
> > (XEN) traps.c:2488:d1 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc9000057b030.
> > (XEN) traps.c:2488:d1 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc90000718030.
> > (XEN) traps.c:2488:d2 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc900004f2030.
> > (XEN) traps.c:2488:d2 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc900004fa030.
> > (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc90000251030.
> > (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc90000263030.
> > (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc9000026b030.
> > (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc90000273030.
> > (XEN) traps.c:2488:d4 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc900004f2030.
> > (XEN) traps.c:2488:d4 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc90000015030.
> > (XEN) traps.c:2488:d5 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc900004f2030.
> > (XEN) traps.c:2488:d5 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc90000015030.
> > (XEN) traps.c:2488:d6 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc900004f2030.
> > (XEN) traps.c:2488:d6 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc900004fa030.
> > (XEN) Disabling non-boot CPUs ...
> > (XEN) Broke affinity for irq 1
> > (XEN) Broke affinity for irq 8
> > (XEN) Broke affinity for irq 9
> > (XEN) Broke affinity for irq 12
> > (XEN) Broke affinity for irq 17
> > (XEN) Broke affinity for irq 31
> > (XEN) Broke affinity for irq 16
> > (XEN) Broke affinity for irq 20
> > (XEN) Entering ACPI S3 state.
> > (XEN) mce_intel.c:1162: MCA Capability: BCAST 1 SER 0 CMCI 1 firstbank 0
> extended MCE MSR 0
> > (XEN) CPU0 CMCI LVT vector (0xf7) already installed
> > (XEN) CPU0: Thermal LVT vector (0xfa) already installed
> > (XEN) Finishing wakeup from ACPI S3 state.
> > (XEN) Enabling non-boot CPUs  ...
> > (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc90000524030.
> > (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc9000052c030.
> > (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc90000015030.
> > (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc9000001d030.
> > (XEN) Dumping timer queues:
> > (XEN) CPU00:
> > (XEN)   ex=     126us timer=ffff8300c83b0060
> cb=ffff82c48011e420(ffff8300c83b0000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=    1778us timer=ffff8304222f9de8
> cb=ffff82c480118250(0000000000000000) csched_tick+0x0/0x2e0
> > (XEN)   ex=     126us timer=ffff8300c81fc060
> cb=ffff82c48011e420(ffff8300c81fc000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   17227us timer=ffff82c4802bb980
> cb=ffff82c480138ff0(ffff82c4802bb940) do_dbs_timer+0x0/0x250
> > (XEN)   ex=   20744us timer=ffff830030094060
> cb=ffff82c48011e420(ffff830030094000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   27945us timer=ffff8304222fdde0
> cb=ffff82c480116f20(ffff8304222fddc0) csched_acct+0x0/0x460
> > (XEN)   ex=   29949us timer=ffff82c4802bb760
> cb=ffff82c48011ded0(0000000000000000) s_timer_fn+0x0/0x20
> > (XEN)   ex=   87774us timer=ffff83008db6a060
> cb=ffff82c48011e420(ffff83008db6a000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   79252us timer=ffff82c4802b3880
> cb=ffff82c480177160(0000000000000000) time_calibration+0x0/0x60
> > (XEN)   ex=  703146us timer=ffff8300a6b9c060
> cb=ffff82c48011e420(ffff8300a6b9c000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   35612us timer=ffff8300330dc060
> cb=ffff82c48011e420(ffff8300330dc000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   97688us timer=ffff8300a6b98060
> cb=ffff82c48011e420(ffff8300a6b98000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   30003us timer=ffff8300b129a060
> cb=ffff82c48011e420(ffff8300b129a000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   92679us timer=ffff8300c94a6060
> cb=ffff82c48011e420(ffff8300c94a6000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex= 4135118us timer=ffff8300bdca6060
> cb=ffff82c48011e420(ffff8300bdca6000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   96411us timer=ffff8300b128e060
> cb=ffff82c48011e420(ffff8300b128e000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex= 1337866us timer=ffff8300a6b94060
> cb=ffff82c48011e420(ffff8300a6b94000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   91194us timer=ffff830034b98060
> cb=ffff82c48011e420(ffff830034b98000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   97955us timer=ffff83007d948060
> cb=ffff82c48011e420(ffff83007d948000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex= 4135163us timer=ffff8300c5336060
> cb=ffff82c48011e420(ffff8300c5336000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=123464409us timer=ffff82c4802b3980
> cb=ffff82c480176ef0(0000000000000000) plt_overflow+0x0/0x190
> > (XEN)   ex=   95968us timer=ffff8300a6b96060
> cb=ffff82c48011e420(ffff8300a6b96000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=12401701us timer=ffff82c4802b65a0
> cb=ffff82c48019eb10(0000000000000000) mce_work_fn+0x0/0xd0
> > (XEN)   ex=   97804us timer=ffff8300301a8060
> cb=ffff82c48011e420(ffff8300301a8000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   97841us timer=ffff8300bd810060
> cb=ffff82c48011e420(ffff8300bd810000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   98039us timer=ffff83007d94c060
> cb=ffff82c48011e420(ffff83007d94c000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   94727us timer=ffff83008db6e060
> cb=ffff82c48011e420(ffff83008db6e000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=  319927us timer=ffff8300c840c060
> cb=ffff82c48011e420(ffff8300c840c000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN) CPU01:
> > (XEN) CPU02:
> > (XEN) CPU03:
> > (XEN) 'c' pressed -> printing ACPI Cx structures
> > (XEN) ==cpu0==
> > (XEN) active state:           C3
> > (XEN) max_cstate:             C7
> > (XEN) states:
> > (XEN)     C1: type[C1] latency[000] usage[00254665] method[ HALT]
> duration[62720099833]
> > (XEN)     C2: type[C2] latency[080] usage[00069505] method[SYSIO]
> duration[36499255195]
> > (XEN)    *C3: type[C3] latency[109] usage[01828952] method[SYSIO]
> duration[5562126933174]
> > (XEN)     C0: usage[02153122] duration[2042526389598]
> > (XEN) PC3[0] PC6[0] PC7[0]
> > (XEN) CC3[0] CC6[0]
> > (XEN) ==cpu1==
> > (XEN) active state:           C1
> > (XEN) max_cstate:             C7
> > (XEN) states:
> > (XEN)    *C1: type[C1] latency[000] usage[00808027] method[ HALT]
> duration[6978799306750]
> > (XEN)     C0: usage[00808027] duration[725073398104]
> > (XEN) PC3[0] PC6[0] PC7[0]
> > (XEN) CC3[0] CC6[0]
> > (XEN) ==cpu2==
> > (XEN) active state:           C1
> > (XEN) max_cstate:             C7
> > (XEN) states:
> > (XEN)    *C1: type[C1] latency[000] usage[00825022] method[ HALT]
> duration[6981527416097]
> > (XEN)     C0: usage[00825022] duration[722345319882]
> > (XEN) PC3[0] PC6[0] PC7[0]
> > (XEN) CC3[0] CC6[0]
> > (XEN) ==cpu3==
> > (XEN) active state:           C1
> > (XEN) max_cstate:             C7
> > (XEN) states:
> > (XEN)    *C1: type[C1] latency[000] usage[00810292] method[ HALT]
> duration[6980835907857]
> > (XEN)     C0: usage[00810292] duration[723036844779]
> > (XEN) PC3[0] PC6[0] PC7[0]
> > (XEN) CC3[0] CC6[0]
>
>
>
>
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
>
>

--e89a8f3b9d3d4a9abe04cfbdb242
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I had similar, but (I think) different issues.<div><br></div><div>See the f=
ollowing thread:</div><div><a href=3D"http://markmail.org/search/?q=3De4a31=
205766d518276d0fbc1780bcd63db1a502d#query:e4a31205766d518276d0fbc1780bcd63d=
b1a502d+page:1+mid:udkd2qcvtyqj75re+state:results">http://markmail.org/sear=
ch/?q=3De4a31205766d518276d0fbc1780bcd63db1a502d#query:e4a31205766d518276d0=
fbc1780bcd63db1a502d+page:1+mid:udkd2qcvtyqj75re+state:results</a></div>
<div><br></div><div>I still have a patch reverting part of this changeset t=
o get S3 working with pinning CPU affinity... the affinity doesn&#39;t get =
restored on resume, however.</div><div><br></div><div>I don&#39;t have much=
 experience with this on Xen 4.1, as I ran into the issue when bringing up =
Xen-4.2, from Xen 4.0</div>
<div><br></div><div>However, I could see how this could be related, since i=
t is in the scheduler...<br><br><div class=3D"gmail_quote">On Fri, Nov 30, =
2012 at 4:33 PM, Konrad Rzeszutek Wilk <span dir=3D"ltr">&lt;<a href=3D"mai=
lto:konrad@kernel.org" target=3D"_blank">konrad@kernel.org</a>&gt;</span> w=
rote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"im">On Thu, Nov 29, 2012 at 07=
:55:06PM +0100, Marek Marczykowski wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; After resume from ACPI S3 system has only CPU0 enabled, every vCPU fro=
m every<br>
&gt; domain works on CPU0 [1]. =A0When trying to pin some vCPU to CPU1 got =
error:<br>
&gt; xl vcpu-pin testvm 1 1<br>
&gt; libxl: error: libxl.c:2565:libxl_set_vcpuaffinity setting vcpu affinit=
y:<br>
&gt; Invalid argument<br>
&gt;<br>
&gt; What went wrong? How can I reenable CPU1-CPU3?<br>
<br>
</div>I think Ben had found some issues with this in the past? CC-ing him<b=
r>
here.<br>
<div><div class=3D"h5">&gt;<br>
&gt; System info:<br>
&gt; xen 4.1.3<br>
&gt; linux 3.4.18 with acpi-s3 patches from Konrad&#39;s git<br>
&gt; Processor: Intel i5-2520M<br>
&gt;<br>
&gt; dmesg from dom0 and hypervisor attached.<br>
&gt;<br>
&gt; BTW Are there any plans to upstream acpi-s3 patches?<br>
&gt;<br>
&gt; [1] xl vcpu-list:<br>
&gt; Name =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ID=
 =A0VCPU =A0 CPU State =A0 Time(s) CPU Affinity<br>
&gt; dom0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0=
 =A0 =A0 0 =A0 =A00 =A0 r-- =A0 =A01347.8 =A0any cpu<br>
&gt; dom0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0=
 =A0 =A0 1 =A0 =A00 =A0 -b- =A0 =A0 594.4 =A0any cpu<br>
&gt; dom0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0=
 =A0 =A0 2 =A0 =A00 =A0 -b- =A0 =A0 421.1 =A0any cpu<br>
&gt; dom0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0=
 =A0 =A0 3 =A0 =A00 =A0 -b- =A0 =A0 432.6 =A0any cpu<br>
&gt; netvm =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A01=
 =A0 =A0 0 =A0 =A00 =A0 -b- =A0 =A0 596.6 =A0any cpu<br>
&gt; netvm =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A01=
 =A0 =A0 1 =A0 =A00 =A0 -b- =A0 =A0 363.7 =A0any cpu<br>
&gt; firewallvm =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 2 =A0 =
=A0 0 =A0 =A00 =A0 -b- =A0 =A0 170.5 =A0any cpu<br>
&gt; firewallvm =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 2 =A0 =
=A0 1 =A0 =A00 =A0 -b- =A0 =A0 122.5 =A0any cpu<br>
&gt; devel17 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A03 =
=A0 =A0 0 =A0 =A00 =A0 -b- =A0 =A0 137.0 =A0any cpu<br>
&gt; devel17 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A03 =
=A0 =A0 1 =A0 =A00 =A0 -b- =A0 =A0 112.9 =A0any cpu<br>
&gt; devel17 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A03 =
=A0 =A0 2 =A0 =A00 =A0 -b- =A0 =A0 =A097.9 =A0any cpu<br>
&gt; devel17 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A03 =
=A0 =A0 3 =A0 =A00 =A0 -b- =A0 =A0 116.0 =A0any cpu<br>
&gt; vm2 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A04 =A0 =A0 0 =A0 =A00 =A0 -b- =A0 =A0 418.6 =A0any cpu<br>
&gt; vm2 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A04 =A0 =A0 1 =A0 =A00 =A0 -b- =A0 =A0 390.2 =A0any cpu<br>
&gt; private =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A05 =
=A0 =A0 0 =A0 =A00 =A0 -b- =A0 =A0 175.9 =A0any cpu<br>
&gt; private =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A05 =
=A0 =A0 1 =A0 =A00 =A0 -b- =A0 =A0 161.6 =A0any cpu<br>
&gt; mail =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 6=
 =A0 =A0 0 =A0 =A00 =A0 -b- =A0 =A01587.1 =A0any cpu<br>
&gt; mail =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 6=
 =A0 =A0 1 =A0 =A00 =A0 -b- =A0 =A01717.5 =A0any cpu<br>
&gt; testvm =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 7 =
=A0 =A0 0 =A0 =A00 =A0 -b- =A0 =A0 =A073.0 =A0any cpu<br>
&gt; testvm =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 7 =
=A0 =A0 1 =A0 =A00 =A0 -b- =A0 =A0 =A068.9 =A0any cpu<br>
&gt; testvm =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 7 =
=A0 =A0 2 =A0 =A00 =A0 -b- =A0 =A0 =A051.4 =A0any cpu<br>
&gt; testvm =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 7 =
=A0 =A0 3 =A0 =A00 =A0 -b- =A0 =A0 =A067.1 =A0any cpu<br>
&gt; disp1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A08=
 =A0 =A0 0 =A0 =A00 =A0 -b- =A0 =A0 199.9 =A0any cpu<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Best Regards / Pozdrawiam,<br>
&gt; Marek Marczykowski<br>
&gt; Invisible Things Lab<br>
<br>
</div></div>&gt; [ =A0 =A00.000000] Initializing cgroup subsys cpuset<br>
&gt; [ =A0 =A00.000000] Initializing cgroup subsys cpu<br>
&gt; [ =A0 =A00.000000] Linux version 3.4.18-2.pvops.qubes.x86_64 (<a href=
=3D"mailto:user@nemezis.marmarek.net">user@nemezis.marmarek.net</a>) (gcc v=
ersion 4.4.5 20101112 (Red Hat 4.4.5-2) (GCC) ) #1 SMP Wed Nov 7 22:47:21 E=
ST 2012<br>

&gt; [ =A0 =A00.000000] Command line: ro root=3D/dev/mapper/vg_dom0-lv_root=
 rd_LUKS_UUID=3Dluks-400336fa-c7c4-4be3-a244-c909aa16a18c rd_LVM_LV=3Dvg_do=
m0/lv_root rd_LVM_LV=3Dvg_dom0/lv_swap rd_NO_MD rd_NO_DM LANG=3Den_US.UTF-8=
 SYSFONT=3Dlatarcyrheb-sun16 KEYTABLE=3Dpl2 rhgb quiet max_loop=3D255<br>

&gt; [ =A0 =A00.000000] Freeing =A09a-100 pfn range: 102 pages freed<br>
&gt; [ =A0 =A00.000000] 1-1 mapping on 9a-&gt;100<br>
&gt; [ =A0 =A00.000000] Freeing =A07eea-7f67 pfn range: 125 pages freed<br>
&gt; [ =A0 =A00.000000] 1-1 mapping on 7eea-&gt;7f67<br>
&gt; [ =A0 =A00.000000] Freeing =A07f70-7f76 pfn range: 6 pages freed<br>
&gt; [ =A0 =A00.000000] 1-1 mapping on 7f70-&gt;7f76<br>
&gt; [ =A0 =A00.000000] Freeing =A07f78-8000 pfn range: 136 pages freed<br>
&gt; [ =A0 =A00.000000] 1-1 mapping on 7f78-&gt;8000<br>
&gt; [ =A0 =A00.000000] Freeing =A0dffd-e000 pfn range: 3 pages freed<br>
&gt; [ =A0 =A00.000000] 1-1 mapping on dffd-&gt;e000<br>
&gt; [ =A0 =A00.000000] Freeing =A020000-20200 pfn range: 512 pages freed<b=
r>
&gt; [ =A0 =A00.000000] 1-1 mapping on 20000-&gt;20200<br>
&gt; [ =A0 =A00.000000] Freeing =A040000-40200 pfn range: 512 pages freed<b=
r>
&gt; [ =A0 =A00.000000] 1-1 mapping on 40000-&gt;40200<br>
&gt; [ =A0 =A00.000000] Freeing =A0c83b4-c840a pfn range: 86 pages freed<br=
>
&gt; [ =A0 =A00.000000] 1-1 mapping on c83b4-&gt;c840a<br>
&gt; [ =A0 =A00.000000] Freeing =A0c840e-c840f pfn range: 1 pages freed<br>
&gt; [ =A0 =A00.000000] 1-1 mapping on c840e-&gt;c840f<br>
&gt; [ =A0 =A00.000000] Freeing =A0c8411-c8414 pfn range: 3 pages freed<br>
&gt; [ =A0 =A00.000000] 1-1 mapping on c8411-&gt;c8414<br>
&gt; [ =A0 =A00.000000] Freeing =A0c841e-c8428 pfn range: 10 pages freed<br=
>
&gt; [ =A0 =A00.000000] 1-1 mapping on c841e-&gt;c8428<br>
&gt; [ =A0 =A00.000000] Freeing =A0c8432-c8436 pfn range: 4 pages freed<br>
&gt; [ =A0 =A00.000000] 1-1 mapping on c8432-&gt;c8436<br>
&gt; [ =A0 =A00.000000] Freeing =A0cac00-100000 pfn range: 218112 pages fre=
ed<br>
&gt; [ =A0 =A00.000000] 1-1 mapping on cac00-&gt;100000<br>
&gt; [ =A0 =A00.000000] Released 219612 pages of unused memory<br>
&gt; [ =A0 =A00.000000] Set 219612 page(s) to 1-1 mapping<br>
&gt; [ =A0 =A00.000000] BIOS-provided physical RAM map:<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000000000000 - 000000000009a000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 000000000009a800 - 0000000000100000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000000100000 - 0000000007eea000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000007eea000 - 0000000007f67000 (ACPI N=
VS)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000007f67000 - 0000000007f70000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000007f70000 - 0000000007f76000 (ACPI N=
VS)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000007f76000 - 0000000007f78000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000007f78000 - 0000000008000000 (ACPI N=
VS)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000008000000 - 000000000dffd000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 000000000dffd000 - 000000000e000000 (ACPI d=
ata)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 000000000e000000 - 0000000020000000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000020000000 - 0000000020200000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000020200000 - 0000000040000000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000040000000 - 0000000040200000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000040200000 - 00000000c83b4000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c83b4000 - 00000000c840a000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c840a000 - 00000000c840e000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c840e000 - 00000000c840f000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c840f000 - 00000000c8411000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c8411000 - 00000000c8414000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c8414000 - 00000000c841e000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c841e000 - 00000000c8428000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c8428000 - 00000000c8432000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c8432000 - 00000000c8436000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c8436000 - 00000000cac00000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000cb800000 - 00000000cfa00000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000fec00000 - 00000000fec01000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000fed1c000 - 00000000fed20000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000fee00000 - 00000000fee01000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000ffc00000 - 00000000ffc20000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000100000000 - 000000042e000000 (usable=
)<br>
&gt; [ =A0 =A00.000000] NX (Execute Disable) protection: active<br>
&gt; [ =A0 =A00.000000] DMI 2.6 present.<br>
&gt; [ =A0 =A00.000000] DMI: Dell Inc. Latitude E6420/0K0DNP, BIOS A13 05/1=
7/2012<br>
&gt; [ =A0 =A00.000000] e820 update range: 0000000000000000 - 0000000000010=
000 (usable) =3D=3D&gt; (reserved)<br>
&gt; [ =A0 =A00.000000] e820 remove range: 00000000000a0000 - 0000000000100=
000 (usable)<br>
&gt; [ =A0 =A00.000000] No AGP bridge found<br>
&gt; [ =A0 =A00.000000] last_pfn =3D 0x42e000 max_arch_pfn =3D 0x400000000<=
br>
&gt; [ =A0 =A00.000000] x2apic enabled by BIOS, switching to x2apic ops<br>
&gt; [ =A0 =A00.000000] last_pfn =3D 0xcac00 max_arch_pfn =3D 0x400000000<b=
r>
&gt; [ =A0 =A00.000000] found SMP MP-table at [ffff8800000f1ad0] f1ad0<br>
&gt; [ =A0 =A00.000000] initial memory mapped : 0 - 04ade000<br>
&gt; [ =A0 =A00.000000] Base memory trampoline at [ffff880000095000] 95000 =
size 20480<br>
&gt; [ =A0 =A00.000000] init_memory_mapping: 0000000000000000-00000000cac00=
000<br>
&gt; [ =A0 =A00.000000] =A00000000000 - 00cac00000 page 4k<br>
&gt; [ =A0 =A00.000000] kernel direct mapping tables up to 0xcabfffff @ [me=
m 0x009a5000-0x00ffffff]<br>
&gt; [ =A0 =A00.000000] xen: setting RW the range fc4000 - 1000000<br>
&gt; [ =A0 =A00.000000] init_memory_mapping: 0000000100000000-000000042e000=
000<br>
&gt; [ =A0 =A00.000000] =A00100000000 - 042e000000 page 4k<br>
&gt; [ =A0 =A00.000000] kernel direct mapping tables up to 0x42dffffff @ [m=
em 0xc9282000-0xcabfffff]<br>
&gt; [ =A0 =A00.000000] xen: setting RW the range cabff000 - cac00000<br>
&gt; [ =A0 =A00.000000] RAMDISK: 01e13000 - 04ade000<br>
&gt; [ =A0 =A00.000000] ACPI: RSDP 00000000000fe300 00024 (v02 DELL =A0)<br=
>
&gt; [ =A0 =A00.000000] ACPI: XSDT 000000000dffee18 0007C (v01 DELL =A0 =A0=
CBX3 =A0 =A006222004 MSFT 00010013)<br>
&gt; [ =A0 =A00.000000] ACPI: FACP 0000000007f90d98 000F4 (v04 DELL =A0 =A0=
CBX3 =A0 =A006222004 MSFT 00010013)<br>
&gt; [ =A0 =A00.000000] ACPI Warning: 32/64 FACS address mismatch in FADT -=
 two FACS tables! (20120320/tbfadt-378)<br>
&gt; [ =A0 =A00.000000] ACPI Warning: 32/64X FACS address mismatch in FADT =
- 0x07FEDE40/0x0000000007FEDD40, using 32 (20120320/tbfadt-502)<br>
&gt; [ =A0 =A00.000000] ACPI: DSDT 0000000007f5e018 08834 (v02 INT430 SYSFe=
xxx 00001001 INTL 20090903)<br>
&gt; [ =A0 =A00.000000] ACPI: FACS 0000000007fede40 00040<br>
&gt; [ =A0 =A00.000000] ACPI: APIC 000000000dffdf18 000CC (v02 DELL =A0 =A0=
CBX3 =A0 =A006222004 MSFT 00010013)<br>
&gt; [ =A0 =A00.000000] ACPI: TCPA 0000000007feed18 00032 (v02 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 00000000 =A0 =A0 =A000000000)<br>
&gt; [ =A0 =A00.000000] ACPI: SSDT 0000000007f91a98 002F9 (v01 DELLTP =A0 =
=A0 =A0TPM 00003000 INTL 20090903)<br>
&gt; [ =A0 =A00.000000] ACPI: MCFG 0000000007feec98 0003C (v01 DELL =A0 SND=
YBRDG 06222004 MSFT 00000097)<br>
&gt; [ =A0 =A00.000000] ACPI: HPET 0000000007feec18 00038 (v01 A M I =A0 PC=
HHPET 06222004 AMI. 00000003)<br>
&gt; [ =A0 =A00.000000] ACPI: BOOT 0000000007feeb98 00028 (v01 DELL =A0 CBX=
3 =A0 =A0 06222004 AMI =A000010013)<br>
&gt; [ =A0 =A00.000000] ACPI: SSDT 0000000007f75018 00804 (v01 =A0PmRef =A0=
Cpu0Ist 00003000 INTL 20090903)<br>
&gt; [ =A0 =A00.000000] ACPI: SSDT 0000000007f74018 00996 (v01 =A0PmRef =A0=
 =A0CpuPm 00003000 INTL 20090903)<br>
&gt; [ =A0 =A00.000000] ACPI: XMAR 0000000007f90c18 000E8 (v01 INTEL =A0 =
=A0 =A0SNB =A000000001 INTL 00000001)<br>
&gt; [ =A0 =A00.000000] ACPI: SLIC 0000000007f7ec18 00176 (v03 DELL =A0 =A0=
CBX3 =A0 =A006222004 MSFT 00010013)<br>
&gt; [ =A0 =A00.000000] ACPI: Local APIC address 0xfee00000<br>
&gt; [ =A0 =A00.000000] Setting APIC routing to cluster x2apic.<br>
&gt; [ =A0 =A00.000000] Zone PFN ranges:<br>
&gt; [ =A0 =A00.000000] =A0 DMA =A0 =A0 =A00x00000010 -&gt; 0x00001000<br>
&gt; [ =A0 =A00.000000] =A0 DMA32 =A0 =A00x00001000 -&gt; 0x00100000<br>
&gt; [ =A0 =A00.000000] =A0 Normal =A0 0x00100000 -&gt; 0x0042e000<br>
&gt; [ =A0 =A00.000000] Movable zone start PFN for each node<br>
&gt; [ =A0 =A00.000000] Early memory PFN ranges<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x00000010 -&gt; 0x0000009a<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x00000100 -&gt; 0x00007eea<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x00007f67 -&gt; 0x00007f70<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x00007f76 -&gt; 0x00007f78<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x00008000 -&gt; 0x0000dffd<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x0000e000 -&gt; 0x00020000<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x00020200 -&gt; 0x00040000<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x00040200 -&gt; 0x000c83b4<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x000c840a -&gt; 0x000c840e<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x000c840f -&gt; 0x000c8411<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x000c8414 -&gt; 0x000c841e<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x000c8428 -&gt; 0x000c8432<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x000c8436 -&gt; 0x000cac00<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x00100000 -&gt; 0x0042e000<br>
&gt; [ =A0 =A00.000000] On node 0 totalpages: 4163092<br>
&gt; [ =A0 =A00.000000] =A0 DMA zone: 56 pages used for memmap<br>
&gt; [ =A0 =A00.000000] =A0 DMA zone: 1572 pages reserved<br>
&gt; [ =A0 =A00.000000] =A0 DMA zone: 2350 pages, LIFO batch:0<br>
&gt; [ =A0 =A00.000000] =A0 DMA32 zone: 14280 pages used for memmap<br>
&gt; [ =A0 =A00.000000] =A0 DMA32 zone: 810690 pages, LIFO batch:31<br>
&gt; [ =A0 =A00.000000] =A0 Normal zone: 45584 pages used for memmap<br>
&gt; [ =A0 =A00.000000] =A0 Normal zone: 3288560 pages, LIFO batch:31<br>
&gt; [ =A0 =A00.000000] ACPI: PM-Timer IO Port: 0x408<br>
&gt; [ =A0 =A00.000000] ACPI: Local APIC address 0xfee00000<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)<=
br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x02] enabled)<=
br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x03] lapic_id[0x01] enabled)<=
br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)<=
br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x05] lapic_id[0x04] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x06] lapic_id[0x05] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x07] lapic_id[0x06] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x08] lapic_id[0x07] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x09] lapic_id[0x08] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x0a] lapic_id[0x09] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x0b] lapic_id[0x0a] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x0c] lapic_id[0x0b] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x0d] lapic_id[0x0c] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x0e] lapic_id[0x0d] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x0f] lapic_id[0x0e] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x10] lapic_id[0x0f] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base=
[0])<br>
&gt; [ =A0 =A00.000000] IOAPIC[0]: apic_id 2, version 253, address 0xfec000=
00, GSI 0-253<br>
&gt; [ =A0 =A00.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl=
 dfl)<br>
&gt; [ =A0 =A00.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 hig=
h level)<br>
&gt; [ =A0 =A00.000000] ACPI: IRQ0 used by override.<br>
&gt; [ =A0 =A00.000000] ACPI: IRQ2 used by override.<br>
&gt; [ =A0 =A00.000000] ACPI: IRQ9 used by override.<br>
&gt; [ =A0 =A00.000000] Using ACPI (MADT) for SMP configuration information=
<br>
&gt; [ =A0 =A00.000000] ACPI: HPET id: 0x8086a701 base: 0xfed00000<br>
&gt; [ =A0 =A00.000000] SMP: Allowing 16 CPUs, 12 hotplug CPUs<br>
&gt; [ =A0 =A00.000000] nr_irqs_gsi: 270<br>
&gt; [ =A0 =A00.000000] Allocating PCI resources starting at cfa00000 (gap:=
 cfa00000:2f200000)<br>
&gt; [ =A0 =A00.000000] Booting paravirtualized kernel on Xen<br>
&gt; [ =A0 =A00.000000] Xen version: 4.1.3 (preserve-AD)<br>
&gt; [ =A0 =A00.000000] setup_percpu: NR_CPUS:512 nr_cpumask_bits:512 nr_cp=
u_ids:16 nr_node_ids:1<br>
&gt; [ =A0 =A00.000000] PERCPU: Embedded 28 pages/cpu @ffff8803e2800000 s82=
176 r8192 d24320 u131072<br>
&gt; [ =A0 =A00.000000] pcpu-alloc: s82176 r8192 d24320 u131072 alloc=3D1*2=
097152<br>
&gt; [ =A0 =A00.000000] pcpu-alloc: [0] 00 01 02 03 04 05 06 07 08 09 10 11=
 12 13 14 15<br>
&gt; [ =A0 =A04.119805] Built 1 zonelists in Zone order, mobility grouping =
on. =A0Total pages: 4101600<br>
&gt; [ =A0 =A04.119809] Kernel command line: ro root=3D/dev/mapper/vg_dom0-=
lv_root rd_LUKS_UUID=3Dluks-400336fa-c7c4-4be3-a244-c909aa16a18c rd_LVM_LV=
=3Dvg_dom0/lv_root rd_LVM_LV=3Dvg_dom0/lv_swap rd_NO_MD rd_NO_DM LANG=3Den_=
US.UTF-8 SYSFONT=3Dlatarcyrheb-sun16 KEYTABLE=3Dpl2 rhgb quiet max_loop=3D2=
55<br>

&gt; [ =A0 =A04.119915] PID hash table entries: 4096 (order: 3, 32768 bytes=
)<br>
&gt; [ =A0 =A04.120928] Dentry cache hash table entries: 2097152 (order: 12=
, 16777216 bytes)<br>
&gt; [ =A0 =A04.124018] Inode-cache hash table entries: 1048576 (order: 11,=
 8388608 bytes)<br>
&gt; [ =A0 =A04.147064] Placing 64MB software IO TLB between ffff8803ce2000=
00 - ffff8803d2200000<br>
&gt; [ =A0 =A04.147066] software IO TLB at phys 0x3ce200000 - 0x3d2200000<b=
r>
&gt; [ =A0 =A04.181675] Memory: 14975940k/17530880k available (4557k kernel=
 code, 878512k absent, 1676428k reserved, 4112k data, 552k init)<br>
&gt; [ =A0 =A04.181730] Hierarchical RCU implementation.<br>
&gt; [ =A0 =A04.181731] =A0 =A0 =A0 =A0RCU dyntick-idle grace-period accele=
ration is enabled.<br>
&gt; [ =A0 =A04.181738] NR_IRQS:33024 nr_irqs:1024 16<br>
&gt; [ =A0 =A04.181799] xen: sci override: global_irq=3D9 trigger=3D0 polar=
ity=3D0<br>
&gt; [ =A0 =A04.181801] xen: registering gsi 9 triggering 0 polarity 0<br>
&gt; [ =A0 =A04.181809] xen: --&gt; pirq=3D9 -&gt; irq=3D9 (gsi=3D9)<br>
&gt; [ =A0 =A04.181829] xen: acpi sci 9<br>
&gt; [ =A0 =A04.181831] xen: --&gt; pirq=3D1 -&gt; irq=3D1 (gsi=3D1)<br>
&gt; [ =A0 =A04.181834] xen: --&gt; pirq=3D2 -&gt; irq=3D2 (gsi=3D2)<br>
&gt; [ =A0 =A04.181836] xen: --&gt; pirq=3D3 -&gt; irq=3D3 (gsi=3D3)<br>
&gt; [ =A0 =A04.181838] xen: --&gt; pirq=3D4 -&gt; irq=3D4 (gsi=3D4)<br>
&gt; [ =A0 =A04.181840] xen: --&gt; pirq=3D5 -&gt; irq=3D5 (gsi=3D5)<br>
&gt; [ =A0 =A04.181843] xen: --&gt; pirq=3D6 -&gt; irq=3D6 (gsi=3D6)<br>
&gt; [ =A0 =A04.181845] xen: --&gt; pirq=3D7 -&gt; irq=3D7 (gsi=3D7)<br>
&gt; [ =A0 =A04.181847] xen: --&gt; pirq=3D8 -&gt; irq=3D8 (gsi=3D8)<br>
&gt; [ =A0 =A04.181849] xen: --&gt; pirq=3D10 -&gt; irq=3D10 (gsi=3D10)<br>
&gt; [ =A0 =A04.181851] xen: --&gt; pirq=3D11 -&gt; irq=3D11 (gsi=3D11)<br>
&gt; [ =A0 =A04.181854] xen: --&gt; pirq=3D12 -&gt; irq=3D12 (gsi=3D12)<br>
&gt; [ =A0 =A04.181856] xen: --&gt; pirq=3D13 -&gt; irq=3D13 (gsi=3D13)<br>
&gt; [ =A0 =A04.181858] xen: --&gt; pirq=3D14 -&gt; irq=3D14 (gsi=3D14)<br>
&gt; [ =A0 =A04.181860] xen: --&gt; pirq=3D15 -&gt; irq=3D15 (gsi=3D15)<br>
&gt; [ =A0 =A04.182986] Console: colour VGA+ 80x25<br>
&gt; [ =A0 =A04.183012] console [tty0] enabled<br>
&gt; [ =A0 =A04.183026] Xen: using vcpuop timer interface<br>
&gt; [ =A0 =A04.183030] installing Xen timer for CPU 0<br>
&gt; [ =A0 =A04.183048] Detected 2494.416 MHz processor.<br>
&gt; [ =A0 =A04.183052] Calibrating delay loop (skipped), value calculated =
using timer frequency.. 4988.83 BogoMIPS (lpj=3D9977664)<br>
&gt; [ =A0 =A04.183054] pid_max: default: 32768 minimum: 301<br>
&gt; [ =A0 =A04.183090] Mount-cache hash table entries: 256<br>
&gt; [ =A0 =A04.183222] Initializing cgroup subsys cpuacct<br>
&gt; [ =A0 =A04.183224] Initializing cgroup subsys devices<br>
&gt; [ =A0 =A04.183225] Initializing cgroup subsys freezer<br>
&gt; [ =A0 =A04.183227] Initializing cgroup subsys net_cls<br>
&gt; [ =A0 =A04.183228] Initializing cgroup subsys blkio<br>
&gt; [ =A0 =A04.183280] ENERGY_PERF_BIAS: Set to &#39;normal&#39;, was &#39=
;performance&#39;<br>
&gt; [ =A0 =A04.183281] ENERGY_PERF_BIAS: View and update with x86_energy_p=
erf_policy(8)<br>
&gt; [ =A0 =A04.183284] CPU: Physical Processor ID: 0<br>
&gt; [ =A0 =A04.183285] CPU: Processor Core ID: 0<br>
&gt; [ =A0 =A04.184454] ACPI: Core revision 20120320<br>
&gt; [ =A0 =A04.194658] Performance Events: unsupported p6 CPU model 42 no =
PMU driver, software events only.<br>
&gt; [ =A0 =A04.194796] installing Xen timer for CPU 1<br>
&gt; [ =A0 =A04.194988] installing Xen timer for CPU 2<br>
&gt; [ =A0 =A04.195140] installing Xen timer for CPU 3<br>
&gt; [ =A0 =A04.195232] Brought up 4 CPUs<br>
&gt; [ =A0 =A04.195477] devtmpfs: initialized<br>
&gt; [ =A0 =A04.199046] PM: Registering ACPI NVS region [mem 0x07eea000-0x0=
7f66fff] (512000 bytes)<br>
&gt; [ =A0 =A04.199056] PM: Registering ACPI NVS region [mem 0x07f70000-0x0=
7f75fff] (24576 bytes)<br>
&gt; [ =A0 =A04.199058] PM: Registering ACPI NVS region [mem 0x07f78000-0x0=
7ffffff] (557056 bytes)<br>
&gt; [ =A0 =A04.199069] Dell Latitude E6420 series board detected. Selectin=
g PCI-method for reboots.<br>
&gt; [ =A0 =A04.199104] Grant tables using version 2 layout.<br>
&gt; [ =A0 =A04.199114] Grant table initialized<br>
&gt; [ =A0 =A04.199158] dummy:<br>
&gt; [ =A0 =A04.199205] RTC time: =A01:19:35, date: 11/29/12<br>
&gt; [ =A0 =A04.199256] NET: Registered protocol family 16<br>
&gt; [ =A0 =A04.199465] ACPI FADT declares the system doesn&#39;t support P=
CIe ASPM, so disable it<br>
&gt; [ =A0 =A04.199467] ACPI: bus type pci registered<br>
&gt; [ =A0 =A04.199548] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem 0=
xf8000000-0xfbffffff] (base 0xf8000000)<br>
&gt; [ =A0 =A04.199550] PCI: not using MMCONFIG<br>
&gt; [ =A0 =A04.199552] PCI: Using configuration type 1 for base access<br>
&gt; [ =A0 =A04.199559] dmi type 0xB1 record - unknown flag<br>
&gt; [ =A0 =A04.200155] bio: create slab &lt;bio-0&gt; at 0<br>
&gt; [ =A0 =A04.200279] ACPI: Added _OSI(Module Device)<br>
&gt; [ =A0 =A04.200280] ACPI: Added _OSI(Processor Device)<br>
&gt; [ =A0 =A04.200282] ACPI: Added _OSI(3.0 _SCP Extensions)<br>
&gt; [ =A0 =A04.200283] ACPI: Added _OSI(Processor Aggregator Device)<br>
&gt; [ =A0 =A04.201815] ACPI: EC: Look up EC in DSDT<br>
&gt; [ =A0 =A04.206932] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignore=
d<br>
&gt; [ =A0 =A04.219266] ACPI: SSDT 00000000c8412798 00727 (v01 =A0PmRef =A0=
Cpu0Cst 00003001 INTL 20090903)<br>
&gt; [ =A0 =A04.219654] ACPI: Dynamic OEM Table Load:<br>
&gt; [ =A0 =A04.219657] ACPI: SSDT =A0 =A0 =A0 =A0 =A0 (null) 00727 (v01 =
=A0PmRef =A0Cpu0Cst 00003001 INTL 20090903)<br>
&gt; [ =A0 =A04.220118] ACPI: SSDT 00000000c8413a98 00303 (v01 =A0PmRef =A0=
 =A0ApIst 00003000 INTL 20090903)<br>
&gt; [ =A0 =A04.220555] ACPI: Dynamic OEM Table Load:<br>
&gt; [ =A0 =A04.220558] ACPI: SSDT =A0 =A0 =A0 =A0 =A0 (null) 00303 (v01 =
=A0PmRef =A0 =A0ApIst 00003000 INTL 20090903)<br>
&gt; [ =A0 =A04.220754] ACPI: SSDT 00000000c8411d98 00119 (v01 =A0PmRef =A0=
 =A0ApCst 00003000 INTL 20090903)<br>
&gt; [ =A0 =A04.221136] ACPI: Dynamic OEM Table Load:<br>
&gt; [ =A0 =A04.221138] ACPI: SSDT =A0 =A0 =A0 =A0 =A0 (null) 00119 (v01 =
=A0PmRef =A0 =A0ApCst 00003000 INTL 20090903)<br>
&gt; [ =A0 =A04.223275] ACPI: Interpreter enabled<br>
&gt; [ =A0 =A04.223278] ACPI: (supports S0 S3 S5)<br>
&gt; [ =A0 =A04.223294] ACPI: Using IOAPIC for interrupt routing<br>
&gt; [ =A0 =A04.223322] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem 0=
xf8000000-0xfbffffff] (base 0xf8000000)<br>
&gt; [ =A0 =A04.223846] PCI: MMCONFIG at [mem 0xf8000000-0xfbffffff] reserv=
ed in ACPI motherboard resources<br>
&gt; [ =A0 =A04.271283] ACPI: EC: GPE =3D 0x10, I/O: command/status =3D 0x9=
34, data =3D 0x930<br>
&gt; [ =A0 =A04.272424] ACPI: No dock devices found.<br>
&gt; [ =A0 =A04.272428] PCI: Using host bridge windows from ACPI; if necess=
ary, use &quot;pci=3Dnocrs&quot; and report a bug<br>
&gt; [ =A0 =A04.272988] \_SB_.PCI0:_OSC invalid UUID<br>
&gt; [ =A0 =A04.272989] _OSC request data:1 8 1f<br>
&gt; [ =A0 =A04.272992] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-3=
e])<br>
&gt; [ =A0 =A04.273994] pci_root PNP0A08:00: host bridge window [io =A00x00=
00-0x0cf7]<br>
&gt; [ =A0 =A04.273996] pci_root PNP0A08:00: host bridge window [io =A00x0d=
00-0xffff]<br>
&gt; [ =A0 =A04.273998] pci_root PNP0A08:00: host bridge window [mem 0x000a=
0000-0x000bffff]<br>
&gt; [ =A0 =A04.274001] pci_root PNP0A08:00: host bridge window [mem 0xcfa0=
0000-0xfeafffff]<br>
&gt; [ =A0 =A04.274003] pci_root PNP0A08:00: host bridge window [mem 0xfed4=
0000-0xfed44fff]<br>
&gt; [ =A0 =A04.274031] PCI host bridge to bus 0000:00<br>
&gt; [ =A0 =A04.274033] pci_bus 0000:00: root bus resource [io =A00x0000-0x=
0cf7]<br>
&gt; [ =A0 =A04.274034] pci_bus 0000:00: root bus resource [io =A00x0d00-0x=
ffff]<br>
&gt; [ =A0 =A04.274036] pci_bus 0000:00: root bus resource [mem 0x000a0000-=
0x000bffff]<br>
&gt; [ =A0 =A04.274038] pci_bus 0000:00: root bus resource [mem 0xcfa00000-=
0xfeafffff]<br>
&gt; [ =A0 =A04.274040] pci_bus 0000:00: root bus resource [mem 0xfed40000-=
0xfed44fff]<br>
&gt; [ =A0 =A04.274054] pci 0000:00:00.0: [8086:0104] type 00 class 0x06000=
0<br>
&gt; [ =A0 =A04.274147] pci 0000:00:02.0: [8086:0126] type 00 class 0x03000=
0<br>
&gt; [ =A0 =A04.274174] pci 0000:00:02.0: reg 10: [mem 0xe1400000-0xe17ffff=
f 64bit]<br>
&gt; [ =A0 =A04.274189] pci 0000:00:02.0: reg 18: [mem 0xd0000000-0xdffffff=
f 64bit pref]<br>
&gt; [ =A0 =A04.274200] pci 0000:00:02.0: reg 20: [io =A00x4000-0x403f]<br>
&gt; [ =A0 =A04.274344] pci 0000:00:16.0: [8086:1c3a] type 00 class 0x07800=
0<br>
&gt; [ =A0 =A04.274394] pci 0000:00:16.0: reg 10: [mem 0xe2eb0000-0xe2eb000=
f 64bit]<br>
&gt; [ =A0 =A04.274563] pci 0000:00:16.0: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.274636] pci 0000:00:19.0: [8086:1502] type 00 class 0x02000=
0<br>
&gt; [ =A0 =A04.274681] pci 0000:00:19.0: reg 10: [mem 0xe2e00000-0xe2e1fff=
f]<br>
&gt; [ =A0 =A04.274700] pci 0000:00:19.0: reg 14: [mem 0xe2e80000-0xe2e80ff=
f]<br>
&gt; [ =A0 =A04.274719] pci 0000:00:19.0: reg 18: [io =A00x4080-0x409f]<br>
&gt; [ =A0 =A04.274883] pci 0000:00:19.0: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.274939] pci 0000:00:1a.0: [8086:1c2d] type 00 class 0x0c032=
0<br>
&gt; [ =A0 =A04.274983] pci 0000:00:1a.0: reg 10: [mem 0xe2e70000-0xe2e703f=
f]<br>
&gt; [ =A0 =A04.275185] pci 0000:00:1a.0: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.275243] pci 0000:00:1b.0: [8086:1c20] type 00 class 0x04030=
0<br>
&gt; [ =A0 =A04.275278] pci 0000:00:1b.0: reg 10: [mem 0xe2e60000-0xe2e63ff=
f 64bit]<br>
&gt; [ =A0 =A04.275456] pci 0000:00:1b.0: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.275509] pci 0000:00:1c.0: [8086:1c10] type 01 class 0x06040=
0<br>
&gt; [ =A0 =A04.275702] pci 0000:00:1c.0: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.275760] pci 0000:00:1c.1: [8086:1c12] type 01 class 0x06040=
0<br>
&gt; [ =A0 =A04.275953] pci 0000:00:1c.1: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.276011] pci 0000:00:1c.2: [8086:1c14] type 01 class 0x06040=
0<br>
&gt; [ =A0 =A04.276205] pci 0000:00:1c.2: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.276264] pci 0000:00:1c.3: [8086:1c16] type 01 class 0x06040=
0<br>
&gt; [ =A0 =A04.276458] pci 0000:00:1c.3: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.276520] pci 0000:00:1c.5: [8086:1c1a] type 01 class 0x06040=
0<br>
&gt; [ =A0 =A04.276711] pci 0000:00:1c.5: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.276779] pci 0000:00:1d.0: [8086:1c26] type 00 class 0x0c032=
0<br>
&gt; [ =A0 =A04.276823] pci 0000:00:1d.0: reg 10: [mem 0xe2e50000-0xe2e503f=
f]<br>
&gt; [ =A0 =A04.277025] pci 0000:00:1d.0: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.277086] pci 0000:00:1f.0: [8086:1c4f] type 00 class 0x06010=
0<br>
&gt; [ =A0 =A04.277341] pci 0000:00:1f.2: [8086:1c03] type 00 class 0x01060=
1<br>
&gt; [ =A0 =A04.277391] pci 0000:00:1f.2: reg 10: [io =A00x40d0-0x40d7]<br>
&gt; [ =A0 =A04.277410] pci 0000:00:1f.2: reg 14: [io =A00x40c0-0x40c3]<br>
&gt; [ =A0 =A04.277429] pci 0000:00:1f.2: reg 18: [io =A00x40b0-0x40b7]<br>
&gt; [ =A0 =A04.277449] pci 0000:00:1f.2: reg 1c: [io =A00x40a0-0x40a3]<br>
&gt; [ =A0 =A04.277468] pci 0000:00:1f.2: reg 20: [io =A00x4060-0x407f]<br>
&gt; [ =A0 =A04.277486] pci 0000:00:1f.2: reg 24: [mem 0xe2e40000-0xe2e407f=
f]<br>
&gt; [ =A0 =A04.277613] pci 0000:00:1f.2: PME# supported from D3hot<br>
&gt; [ =A0 =A04.277657] pci 0000:00:1f.3: [8086:1c22] type 00 class 0x0c050=
0<br>
&gt; [ =A0 =A04.277694] pci 0000:00:1f.3: reg 10: [mem 0xe2e30000-0xe2e300f=
f 64bit]<br>
&gt; [ =A0 =A04.277749] pci 0000:00:1f.3: reg 20: [io =A00x4040-0x405f]<br>
&gt; [ =A0 =A04.277920] pci 0000:00:1c.0: PCI bridge to [bus 01-01]<br>
&gt; [ =A0 =A04.278353] pci 0000:02:00.0: [8086:422b] type 00 class 0x02800=
0<br>
&gt; [ =A0 =A04.278708] pci 0000:02:00.0: reg 10: [mem 0xe2d00000-0xe2d01ff=
f 64bit]<br>
&gt; [ =A0 =A04.280508] pci 0000:02:00.0: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.285361] pci 0000:00:1c.1: PCI bridge to [bus 02-02]<br>
&gt; [ =A0 =A04.285374] pci 0000:00:1c.1: =A0 bridge window [mem 0xe2d00000=
-0xe2dfffff]<br>
&gt; [ =A0 =A04.285490] pci 0000:00:1c.2: PCI bridge to [bus 03-08]<br>
&gt; [ =A0 =A04.285498] pci 0000:00:1c.2: =A0 bridge window [io =A00x3000-0=
x3fff]<br>
&gt; [ =A0 =A04.285505] pci 0000:00:1c.2: =A0 bridge window [mem 0xe2200000=
-0xe2bfffff]<br>
&gt; [ =A0 =A04.285517] pci 0000:00:1c.2: =A0 bridge window [mem 0xe0a00000=
-0xe13fffff 64bit pref]<br>
&gt; [ =A0 =A04.285625] pci 0000:00:1c.3: PCI bridge to [bus 09-09]<br>
&gt; [ =A0 =A04.285632] pci 0000:00:1c.3: =A0 bridge window [io =A00x2000-0=
x2fff]<br>
&gt; [ =A0 =A04.285639] pci 0000:00:1c.3: =A0 bridge window [mem 0xe1800000=
-0xe21fffff]<br>
&gt; [ =A0 =A04.285651] pci 0000:00:1c.3: =A0 bridge window [mem 0xe0000000=
-0xe09fffff 64bit pref]<br>
&gt; [ =A0 =A04.285818] pci 0000:0a:00.0: [1217:8221] type 00 class 0x08050=
1<br>
&gt; [ =A0 =A04.285872] pci 0000:0a:00.0: reg 10: [mem 0xe2c20000-0xe2c201f=
f]<br>
&gt; [ =A0 =A04.286294] pci 0000:0a:00.0: supports D1 D2<br>
&gt; [ =A0 =A04.286295] pci 0000:0a:00.0: PME# supported from D0 D1 D2 D3ho=
t D3cold<br>
&gt; [ =A0 =A04.286432] pci 0000:0a:00.1: [1217:8231] type 00 class 0x01800=
0<br>
&gt; [ =A0 =A04.286486] pci 0000:0a:00.1: reg 10: [mem 0xe2c10000-0xe2c10ff=
f]<br>
&gt; [ =A0 =A04.286563] pci 0000:0a:00.1: reg 18: [mem 0xe2c00000-0xe2c007f=
f]<br>
&gt; [ =A0 =A04.286908] pci 0000:0a:00.1: supports D1 D2<br>
&gt; [ =A0 =A04.286909] pci 0000:0a:00.1: PME# supported from D0 D1 D2 D3ho=
t D3cold<br>
&gt; [ =A0 =A04.293400] pci 0000:00:1c.5: PCI bridge to [bus 0a-0a]<br>
&gt; [ =A0 =A04.293412] pci 0000:00:1c.5: =A0 bridge window [mem 0xe2c00000=
-0xe2cfffff]<br>
&gt; [ =A0 =A04.293479] pci_bus 0000:00: on NUMA node 0<br>
&gt; [ =A0 =A04.293483] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]=
<br>
&gt; [ =A0 =A04.293612] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP01.=
_PRT]<br>
&gt; [ =A0 =A04.293647] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP02.=
_PRT]<br>
&gt; [ =A0 =A04.293682] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP04.=
_PRT]<br>
&gt; [ =A0 =A04.293717] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP06.=
_PRT]<br>
&gt; [ =A0 =A04.293762] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP03.=
_PRT]<br>
&gt; [ =A0 =A04.293857] \_SB_.PCI0:_OSC invalid UUID<br>
&gt; [ =A0 =A04.293858] _OSC request data:1 1f 1f<br>
&gt; [ =A0 =A04.293861] =A0pci0000:00: Requesting ACPI _OSC control (0x1d)<=
br>
&gt; [ =A0 =A04.293906] \_SB_.PCI0:_OSC invalid UUID<br>
&gt; [ =A0 =A04.293907] _OSC request data:1 0 1d<br>
&gt; [ =A0 =A04.293910] =A0pci0000:00: ACPI _OSC request failed (AE_ERROR),=
 returned control mask: 0x1d<br>
&gt; [ =A0 =A04.293911] ACPI _OSC control for PCIe not granted, disabling A=
SPM<br>
&gt; [ =A0 =A04.297639] ACPI: PCI Interrupt Link [LNKA] (IRQs 1 3 4 5 6 7 1=
0 12 14 15) *11<br>
&gt; [ =A0 =A04.297702] ACPI: PCI Interrupt Link [LNKB] (IRQs 1 3 4 5 6 7 1=
1 12 14 15) *10<br>
&gt; [ =A0 =A04.297761] ACPI: PCI Interrupt Link [LNKC] (IRQs 1 3 4 5 6 7 1=
0 12 14 15) *11<br>
&gt; [ =A0 =A04.297820] ACPI: PCI Interrupt Link [LNKD] (IRQs 1 3 4 5 6 7 1=
1 12 14 15) *10<br>
&gt; [ =A0 =A04.297878] ACPI: PCI Interrupt Link [LNKE] (IRQs 1 3 4 *5 6 7 =
10 12 14 15)<br>
&gt; [ =A0 =A04.297937] ACPI: PCI Interrupt Link [LNKF] (IRQs 1 3 4 5 6 7 1=
1 12 14 15) *0, disabled.<br>
&gt; [ =A0 =A04.297996] ACPI: PCI Interrupt Link [LNKG] (IRQs 1 *3 4 5 6 7 =
10 12 14 15)<br>
&gt; [ =A0 =A04.298054] ACPI: PCI Interrupt Link [LNKH] (IRQs 1 3 4 5 6 7 1=
1 12 14 15) *0, disabled.<br>
&gt; [ =A0 =A04.298087] xen/balloon: Initialising balloon driver.<br>
&gt; [ =A0 =A04.301022] xen-balloon: Initialising balloon driver.<br>
&gt; [ =A0 =A04.301062] xen/balloon: Xen selfballooning driver disabled for=
 domain0.<br>
&gt; [ =A0 =A04.301148] vgaarb: device added: PCI:0000:00:02.0,decodes=3Dio=
+mem,owns=3Dio+mem,locks=3Dnone<br>
&gt; [ =A0 =A04.301157] vgaarb: loaded<br>
&gt; [ =A0 =A04.301157] vgaarb: bridge control possible 0000:00:02.0<br>
&gt; [ =A0 =A04.301279] PCI: Using ACPI for IRQ routing<br>
&gt; [ =A0 =A04.305930] PCI: pci_cache_line_size set to 64 bytes<br>
&gt; [ =A0 =A04.306106] reserve RAM buffer: 000000000009a000 - 000000000009=
ffff<br>
&gt; [ =A0 =A04.306108] reserve RAM buffer: 0000000007eea000 - 0000000007ff=
ffff<br>
&gt; [ =A0 =A04.306110] reserve RAM buffer: 0000000007f70000 - 0000000007ff=
ffff<br>
&gt; [ =A0 =A04.306112] reserve RAM buffer: 0000000007f78000 - 0000000007ff=
ffff<br>
&gt; [ =A0 =A04.306113] reserve RAM buffer: 000000000dffd000 - 000000000fff=
ffff<br>
&gt; [ =A0 =A04.306115] reserve RAM buffer: 00000000c83b4000 - 00000000cbff=
ffff<br>
&gt; [ =A0 =A04.306118] reserve RAM buffer: 00000000c840e000 - 00000000cbff=
ffff<br>
&gt; [ =A0 =A04.306121] reserve RAM buffer: 00000000c8411000 - 00000000cbff=
ffff<br>
&gt; [ =A0 =A04.306123] reserve RAM buffer: 00000000c841e000 - 00000000cbff=
ffff<br>
&gt; [ =A0 =A04.306125] reserve RAM buffer: 00000000c8432000 - 00000000cbff=
ffff<br>
&gt; [ =A0 =A04.306127] reserve RAM buffer: 00000000cac00000 - 00000000cbff=
ffff<br>
&gt; [ =A0 =A04.306129] reserve RAM buffer: 000000042e000000 - 000000042fff=
ffff<br>
&gt; [ =A0 =A04.306235] Switching to clocksource xen<br>
&gt; [ =A0 =A04.307726] pnp: PnP ACPI init<br>
&gt; [ =A0 =A04.307738] ACPI: bus type pnp registered<br>
&gt; [ =A0 =A04.308287] pnp 00:00: [bus 00-3e]<br>
&gt; [ =A0 =A04.308289] pnp 00:00: [io =A00x0000-0x0cf7 window]<br>
&gt; [ =A0 =A04.308291] pnp 00:00: [io =A00x0cf8-0x0cff]<br>
&gt; [ =A0 =A04.308293] pnp 00:00: [io =A00x0d00-0xffff window]<br>
&gt; [ =A0 =A04.308295] pnp 00:00: [mem 0x000a0000-0x000bffff window]<br>
&gt; [ =A0 =A04.308296] pnp 00:00: [mem 0x000c0000-0x000c3fff window]<br>
&gt; [ =A0 =A04.308298] pnp 00:00: [mem 0x000c4000-0x000c7fff window]<br>
&gt; [ =A0 =A04.308300] pnp 00:00: [mem 0x000c8000-0x000cbfff window]<br>
&gt; [ =A0 =A04.308301] pnp 00:00: [mem 0x000cc000-0x000cffff window]<br>
&gt; [ =A0 =A04.308303] pnp 00:00: [mem 0x000d0000-0x000d3fff window]<br>
&gt; [ =A0 =A04.308305] pnp 00:00: [mem 0x000d4000-0x000d7fff window]<br>
&gt; [ =A0 =A04.308307] pnp 00:00: [mem 0x000d8000-0x000dbfff window]<br>
&gt; [ =A0 =A04.308309] pnp 00:00: [mem 0x000dc000-0x000dffff window]<br>
&gt; [ =A0 =A04.308310] pnp 00:00: [mem 0x000e0000-0x000e3fff window]<br>
&gt; [ =A0 =A04.308312] pnp 00:00: [mem 0x000e4000-0x000e7fff window]<br>
&gt; [ =A0 =A04.308314] pnp 00:00: [mem 0x000e8000-0x000ebfff window]<br>
&gt; [ =A0 =A04.308315] pnp 00:00: [mem 0x000ec000-0x000effff window]<br>
&gt; [ =A0 =A04.308317] pnp 00:00: [mem 0x000f0000-0x000fffff window]<br>
&gt; [ =A0 =A04.308319] pnp 00:00: [mem 0xcfa00000-0xfeafffff window]<br>
&gt; [ =A0 =A04.308320] pnp 00:00: [mem 0xfed40000-0xfed44fff window]<br>
&gt; [ =A0 =A04.308385] pnp 00:00: Plug and Play ACPI device, IDs PNP0a08 P=
NP0a03 (active)<br>
&gt; [ =A0 =A04.308398] pnp 00:01: [io =A00x0000-0x001f]<br>
&gt; [ =A0 =A04.308400] pnp 00:01: [io =A00x0081-0x0091]<br>
&gt; [ =A0 =A04.308401] pnp 00:01: [io =A00x0093-0x009f]<br>
&gt; [ =A0 =A04.308403] pnp 00:01: [io =A00x00c0-0x00df]<br>
&gt; [ =A0 =A04.308404] pnp 00:01: [dma 4]<br>
&gt; [ =A0 =A04.308422] pnp 00:01: Plug and Play ACPI device, IDs PNP0200 (=
active)<br>
&gt; [ =A0 =A04.308429] pnp 00:02: [mem 0xff000000-0xffffffff]<br>
&gt; [ =A0 =A04.308445] pnp 00:02: Plug and Play ACPI device, IDs INT0800 (=
active)<br>
&gt; [ =A0 =A04.308540] pnp 00:03: [mem 0xfed00000-0xfed003ff]<br>
&gt; [ =A0 =A04.308572] system 00:03: [mem 0xfed00000-0xfed003ff] has been =
reserved<br>
&gt; [ =A0 =A04.308575] system 00:03: Plug and Play ACPI device, IDs PNP010=
3 PNP0c01 (active)<br>
&gt; [ =A0 =A04.308584] pnp 00:04: [io =A00x00f0]<br>
&gt; [ =A0 =A04.308587] xen: registering gsi 13 triggering 1 polarity 0<br>
&gt; [ =A0 =A04.308609] pnp 00:04: [irq 13]<br>
&gt; [ =A0 =A04.308626] pnp 00:04: Plug and Play ACPI device, IDs PNP0c04 (=
active)<br>
&gt; [ =A0 =A04.308636] pnp 00:05: [io =A00x002e-0x002f]<br>
&gt; [ =A0 =A04.308637] pnp 00:05: [io =A00x004e-0x004f]<br>
&gt; [ =A0 =A04.308639] pnp 00:05: [io =A00x0061]<br>
&gt; [ =A0 =A04.308640] pnp 00:05: [io =A00x0063]<br>
&gt; [ =A0 =A04.308641] pnp 00:05: [io =A00x0065]<br>
&gt; [ =A0 =A04.308642] pnp 00:05: [io =A00x0067]<br>
&gt; [ =A0 =A04.308644] pnp 00:05: [io =A00x0070]<br>
&gt; [ =A0 =A04.308645] pnp 00:05: [io =A00x0080]<br>
&gt; [ =A0 =A04.308646] pnp 00:05: [io =A00x0092]<br>
&gt; [ =A0 =A04.308648] pnp 00:05: [io =A00x00b2-0x00b3]<br>
&gt; [ =A0 =A04.308649] pnp 00:05: [io =A00x0680-0x069f]<br>
&gt; [ =A0 =A04.308651] pnp 00:05: [io =A00x1000-0x100f]<br>
&gt; [ =A0 =A04.308653] pnp 00:05: [io =A00xffff]<br>
&gt; [ =A0 =A04.308654] pnp 00:05: [io =A00xffff]<br>
&gt; [ =A0 =A04.308655] pnp 00:05: [io =A00x0400-0x047f]<br>
&gt; [ =A0 =A04.308656] pnp 00:05: [io =A00x0500-0x057f]<br>
&gt; [ =A0 =A04.308658] pnp 00:05: [io =A00x164e-0x164f]<br>
&gt; [ =A0 =A04.308689] system 00:05: [io =A00x0680-0x069f] has been reserv=
ed<br>
&gt; [ =A0 =A04.308691] system 00:05: [io =A00x1000-0x100f] has been reserv=
ed<br>
&gt; [ =A0 =A04.308693] system 00:05: [io =A00xffff] has been reserved<br>
&gt; [ =A0 =A04.308695] system 00:05: [io =A00xffff] has been reserved<br>
&gt; [ =A0 =A04.308697] system 00:05: [io =A00x0400-0x047f] has been reserv=
ed<br>
&gt; [ =A0 =A04.308700] system 00:05: [io =A00x0500-0x057f] has been reserv=
ed<br>
&gt; [ =A0 =A04.308701] system 00:05: [io =A00x164e-0x164f] has been reserv=
ed<br>
&gt; [ =A0 =A04.308704] system 00:05: Plug and Play ACPI device, IDs PNP0c0=
2 (active)<br>
&gt; [ =A0 =A04.308711] pnp 00:06: [io =A00x0070-0x0077]<br>
&gt; [ =A0 =A04.308713] xen: registering gsi 8 triggering 1 polarity 0<br>
&gt; [ =A0 =A04.308730] pnp 00:06: [irq 8]<br>
&gt; [ =A0 =A04.308749] pnp 00:06: Plug and Play ACPI device, IDs PNP0b00 (=
active)<br>
&gt; [ =A0 =A04.308758] pnp 00:07: [io =A00x0060]<br>
&gt; [ =A0 =A04.308759] pnp 00:07: [io =A00x0064]<br>
&gt; [ =A0 =A04.308761] xen: registering gsi 1 triggering 1 polarity 0<br>
&gt; [ =A0 =A04.308777] pnp 00:07: [irq 1]<br>
&gt; [ =A0 =A04.308794] pnp 00:07: Plug and Play ACPI device, IDs PNP0303 (=
active)<br>
&gt; [ =A0 =A04.309984] pnp 00:08: Plug and Play ACPI device, IDs PNP0401 (=
disabled)<br>
&gt; [ =A0 =A04.309993] xen: registering gsi 12 triggering 1 polarity 0<br>
&gt; [ =A0 =A04.310011] pnp 00:09: [irq 12]<br>
&gt; [ =A0 =A04.310030] pnp 00:09: Plug and Play ACPI device, IDs DLL0493 P=
NP0f13 (active)<br>
&gt; [ =A0 =A04.310065] pnp 00:0a: [mem 0xfed40000-0xfed44fff]<br>
&gt; [ =A0 =A04.310086] pnp 00:0a: Plug and Play ACPI device, IDs BCM0102 P=
NP0c31 (active)<br>
&gt; [ =A0 =A04.310291] pnp 00:0b: [mem 0xfed1c000-0xfed1ffff]<br>
&gt; [ =A0 =A04.310292] pnp 00:0b: [mem 0xfed10000-0xfed17fff]<br>
&gt; [ =A0 =A04.310294] pnp 00:0b: [mem 0xfed18000-0xfed18fff]<br>
&gt; [ =A0 =A04.310296] pnp 00:0b: [mem 0xfed19000-0xfed19fff]<br>
&gt; [ =A0 =A04.310298] pnp 00:0b: [mem 0xf8000000-0xfbffffff]<br>
&gt; [ =A0 =A04.310309] pnp 00:0b: [mem 0xfed20000-0xfed3ffff]<br>
&gt; [ =A0 =A04.310310] pnp 00:0b: [mem 0xfed90000-0xfed93fff]<br>
&gt; [ =A0 =A04.310312] pnp 00:0b: [mem 0xfed45000-0xfed8ffff]<br>
&gt; [ =A0 =A04.310313] pnp 00:0b: [mem 0xff000000-0xffffffff]<br>
&gt; [ =A0 =A04.310315] pnp 00:0b: [mem 0xfee00000-0xfeefffff]<br>
&gt; [ =A0 =A04.310317] pnp 00:0b: [mem 0x00000000-0xffffffffffffffff disab=
led]<br>
&gt; [ =A0 =A04.310318] pnp 00:0b: [mem 0x00000000-0xffffffffffffffff disab=
led]<br>
&gt; [ =A0 =A04.310359] system 00:0b: [mem 0xfed1c000-0xfed1ffff] has been =
reserved<br>
&gt; [ =A0 =A04.310361] system 00:0b: [mem 0xfed10000-0xfed17fff] has been =
reserved<br>
&gt; [ =A0 =A04.310363] system 00:0b: [mem 0xfed18000-0xfed18fff] has been =
reserved<br>
&gt; [ =A0 =A04.310365] system 00:0b: [mem 0xfed19000-0xfed19fff] has been =
reserved<br>
&gt; [ =A0 =A04.310367] system 00:0b: [mem 0xf8000000-0xfbffffff] has been =
reserved<br>
&gt; [ =A0 =A04.310369] system 00:0b: [mem 0xfed20000-0xfed3ffff] has been =
reserved<br>
&gt; [ =A0 =A04.310371] system 00:0b: [mem 0xfed90000-0xfed93fff] has been =
reserved<br>
&gt; [ =A0 =A04.310373] system 00:0b: [mem 0xfed45000-0xfed8ffff] has been =
reserved<br>
&gt; [ =A0 =A04.310375] system 00:0b: [mem 0xff000000-0xffffffff] could not=
 be reserved<br>
&gt; [ =A0 =A04.310377] system 00:0b: [mem 0xfee00000-0xfeefffff] could not=
 be reserved<br>
&gt; [ =A0 =A04.310380] system 00:0b: Plug and Play ACPI device, IDs PNP0c0=
2 (active)<br>
&gt; [ =A0 =A04.310956] xen: registering gsi 23 triggering 1 polarity 0<br>
&gt; [ =A0 =A04.310967] xen: --&gt; pirq=3D23 -&gt; irq=3D23 (gsi=3D23)<br>
&gt; [ =A0 =A04.310985] pnp 00:0c: [irq 23]<br>
&gt; [ =A0 =A04.311015] pnp 00:0c: Plug and Play ACPI device, IDs SMO8800 (=
active)<br>
&gt; [ =A0 =A04.315528] pnp 00:0d: [mem 0x20000000-0x201fffff]<br>
&gt; [ =A0 =A04.315531] pnp 00:0d: [mem 0x40000000-0x401fffff]<br>
&gt; [ =A0 =A04.339851] system 00:0d: [mem 0x20000000-0x201fffff] has been =
reserved<br>
&gt; [ =A0 =A04.339854] system 00:0d: [mem 0x40000000-0x401fffff] has been =
reserved<br>
&gt; [ =A0 =A04.339857] system 00:0d: Plug and Play ACPI device, IDs PNP0c0=
1 (active)<br>
&gt; [ =A0 =A04.339865] pnp: PnP ACPI: found 14 devices<br>
&gt; [ =A0 =A04.339867] ACPI: ACPI bus type pnp unregistered<br>
&gt; [ =A0 =A04.346178] PM-Timer failed consistency check =A0(0x0xffffff) -=
 aborting.<br>
&gt; [ =A0 =A04.346274] pci 0000:00:1c.0: PCI bridge to [bus 01-01]<br>
&gt; [ =A0 =A04.346306] pci 0000:00:1c.1: PCI bridge to [bus 02-02]<br>
&gt; [ =A0 =A04.346315] pci 0000:00:1c.1: =A0 bridge window [mem 0xe2d00000=
-0xe2dfffff]<br>
&gt; [ =A0 =A04.346332] pci 0000:00:1c.2: PCI bridge to [bus 03-08]<br>
&gt; [ =A0 =A04.346336] pci 0000:00:1c.2: =A0 bridge window [io =A00x3000-0=
x3fff]<br>
&gt; [ =A0 =A04.346347] pci 0000:00:1c.2: =A0 bridge window [mem 0xe2200000=
-0xe2bfffff]<br>
&gt; [ =A0 =A04.346354] pci 0000:00:1c.2: =A0 bridge window [mem 0xe0a00000=
-0xe13fffff 64bit pref]<br>
&gt; [ =A0 =A04.346366] pci 0000:00:1c.3: PCI bridge to [bus 09-09]<br>
&gt; [ =A0 =A04.346370] pci 0000:00:1c.3: =A0 bridge window [io =A00x2000-0=
x2fff]<br>
&gt; [ =A0 =A04.346379] pci 0000:00:1c.3: =A0 bridge window [mem 0xe1800000=
-0xe21fffff]<br>
&gt; [ =A0 =A04.346386] pci 0000:00:1c.3: =A0 bridge window [mem 0xe0000000=
-0xe09fffff 64bit pref]<br>
&gt; [ =A0 =A04.346399] pci 0000:00:1c.5: PCI bridge to [bus 0a-0a]<br>
&gt; [ =A0 =A04.346408] pci 0000:00:1c.5: =A0 bridge window [mem 0xe2c00000=
-0xe2cfffff]<br>
&gt; [ =A0 =A04.346434] xen: registering gsi 16 triggering 0 polarity 1<br>
&gt; [ =A0 =A04.346442] xen: --&gt; pirq=3D16 -&gt; irq=3D16 (gsi=3D16)<br>
&gt; [ =A0 =A04.346469] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0 =A04.346473] xen: --&gt; pirq=3D17 -&gt; irq=3D17 (gsi=3D17)<br>
&gt; [ =A0 =A04.346498] xen: registering gsi 18 triggering 0 polarity 1<br>
&gt; [ =A0 =A04.346502] xen: --&gt; pirq=3D18 -&gt; irq=3D18 (gsi=3D18)<br>
&gt; [ =A0 =A04.346527] xen: registering gsi 19 triggering 0 polarity 1<br>
&gt; [ =A0 =A04.346531] xen: --&gt; pirq=3D19 -&gt; irq=3D19 (gsi=3D19)<br>
&gt; [ =A0 =A04.346556] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0 =A04.346558] Already setup the GSI :17<br>
&gt; [ =A0 =A04.346563] pci_bus 0000:00: resource 4 [io =A00x0000-0x0cf7]<b=
r>
&gt; [ =A0 =A04.346565] pci_bus 0000:00: resource 5 [io =A00x0d00-0xffff]<b=
r>
&gt; [ =A0 =A04.346566] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bf=
fff]<br>
&gt; [ =A0 =A04.346568] pci_bus 0000:00: resource 7 [mem 0xcfa00000-0xfeaff=
fff]<br>
&gt; [ =A0 =A04.346570] pci_bus 0000:00: resource 8 [mem 0xfed40000-0xfed44=
fff]<br>
&gt; [ =A0 =A04.346572] pci_bus 0000:02: resource 1 [mem 0xe2d00000-0xe2dff=
fff]<br>
&gt; [ =A0 =A04.346574] pci_bus 0000:03: resource 0 [io =A00x3000-0x3fff]<b=
r>
&gt; [ =A0 =A04.346575] pci_bus 0000:03: resource 1 [mem 0xe2200000-0xe2bff=
fff]<br>
&gt; [ =A0 =A04.346577] pci_bus 0000:03: resource 2 [mem 0xe0a00000-0xe13ff=
fff 64bit pref]<br>
&gt; [ =A0 =A04.346579] pci_bus 0000:09: resource 0 [io =A00x2000-0x2fff]<b=
r>
&gt; [ =A0 =A04.346581] pci_bus 0000:09: resource 1 [mem 0xe1800000-0xe21ff=
fff]<br>
&gt; [ =A0 =A04.346582] pci_bus 0000:09: resource 2 [mem 0xe0000000-0xe09ff=
fff 64bit pref]<br>
&gt; [ =A0 =A04.346584] pci_bus 0000:0a: resource 1 [mem 0xe2c00000-0xe2cff=
fff]<br>
&gt; [ =A0 =A04.346672] NET: Registered protocol family 2<br>
&gt; [ =A0 =A04.346732] IP route cache hash table entries: 524288 (order: 1=
0, 4194304 bytes)<br>
&gt; [ =A0 =A04.347207] TCP established hash table entries: 262144 (order: =
10, 4194304 bytes)<br>
&gt; [ =A0 =A04.347753] TCP bind hash table entries: 65536 (order: 8, 10485=
76 bytes)<br>
&gt; [ =A0 =A04.347872] TCP: Hash tables configured (established 262144 bin=
d 65536)<br>
&gt; [ =A0 =A04.347874] TCP: reno registered<br>
&gt; [ =A0 =A04.347877] UDP hash table entries: 8192 (order: 6, 262144 byte=
s)<br>
&gt; [ =A0 =A04.347921] UDP-Lite hash table entries: 8192 (order: 6, 262144=
 bytes)<br>
&gt; [ =A0 =A04.348067] NET: Registered protocol family 1<br>
&gt; [ =A0 =A04.348085] pci 0000:00:02.0: Boot video device<br>
&gt; [ =A0 =A04.348108] xen: registering gsi 16 triggering 0 polarity 1<br>
&gt; [ =A0 =A04.348112] Already setup the GSI :16<br>
&gt; [ =A0 =A04.348203] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0 =A04.348205] Already setup the GSI :17<br>
&gt; [ =A0 =A04.348298] PCI: CLS 64 bytes, default 64<br>
&gt; [ =A0 =A04.348333] Unpacking initramfs...<br>
&gt; [ =A0 =A04.384265] Freeing initrd memory: 45868k freed<br>
&gt; [ =A0 =A04.392440] Simple Boot Flag at 0xf3 set to 0x1<br>
&gt; [ =A0 =A04.392900] audit: initializing netlink socket (disabled)<br>
&gt; [ =A0 =A04.392911] type=3D2000 audit(1354151975.383:1): initialized<br=
>
&gt; [ =A0 =A04.411688] VFS: Disk quotas dquot_6.5.2<br>
&gt; [ =A0 =A04.411715] Dquot-cache hash table entries: 512 (order 0, 4096 =
bytes)<br>
&gt; [ =A0 =A04.411870] msgmni has been set to 29339<br>
&gt; [ =A0 =A04.412010] Block layer SCSI generic (bsg) driver version 0.4 l=
oaded (major 253)<br>
&gt; [ =A0 =A04.412013] io scheduler noop registered<br>
&gt; [ =A0 =A04.412015] io scheduler deadline registered<br>
&gt; [ =A0 =A04.412036] io scheduler cfq registered (default)<br>
&gt; [ =A0 =A04.412666] intel_idle: does not run on family 6 model 42<br>
&gt; [ =A0 =A04.412741] ACPI: Requesting acpi_cpufreq<br>
&gt; [ =A0 =A04.459643] Non-volatile memory driver v1.3<br>
&gt; [ =A0 =A04.459654] ramoops: platform device not found, using module pa=
rameters<br>
&gt; [ =A0 =A04.459670] ramoops: The memory size and the record size must b=
e non-zero<br>
&gt; [ =A0 =A04.459703] ramoops: probe of ramoops failed with error -22<br>
&gt; [ =A0 =A04.474892] loop: module loaded<br>
&gt; [ =A0 =A04.474922] Fixed MDIO Bus: probed<br>
&gt; [ =A0 =A04.474965] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:P=
S2M] at 0x60,0x64 irq 1,12<br>
&gt; [ =A0 =A04.475166] i8042: Warning: Keylock active<br>
&gt; [ =A0 =A04.476434] serio: i8042 KBD port at 0x60,0x64 irq 1<br>
&gt; [ =A0 =A04.476439] serio: i8042 AUX port at 0x60,0x64 irq 12<br>
&gt; [ =A0 =A04.476551] mousedev: PS/2 mouse device common for all mice<br>
&gt; [ =A0 =A04.476707] rtc_cmos 00:06: RTC can wake from S4<br>
&gt; [ =A0 =A04.476940] rtc_cmos 00:06: rtc core: registered rtc_cmos as rt=
c0<br>
&gt; [ =A0 =A04.476998] rtc0: alarms up to one year, y3k, 242 bytes nvram<b=
r>
&gt; [ =A0 =A04.477084] device-mapper: uevent: version 1.0.3<br>
&gt; [ =A0 =A04.477193] device-mapper: ioctl: 4.22.0-ioctl (2011-10-19) ini=
tialised: <a href=3D"mailto:dm-devel@redhat.com">dm-devel@redhat.com</a><br=
>
&gt; [ =A0 =A04.477281] TCP: cubic registered<br>
&gt; [ =A0 =A04.477381] input: AT Translated Set 2 keyboard as /devices/pla=
tform/i8042/serio0/input/input0<br>
&gt; [ =A0 =A04.477402] NET: Registered protocol family 10<br>
&gt; [ =A0 =A04.477644] Registering the dns_resolver key type<br>
&gt; [ =A0 =A04.477791] registered taskstats version 1<br>
&gt; [ =A0 =A04.478330] =A0 Magic number: 4:584:307<br>
&gt; [ =A0 =A04.478403] tty tty36: hash matches<br>
&gt; [ =A0 =A04.478496] rtc_cmos 00:06: setting system clock to 2012-11-29 =
01:19:35 UTC (1354151975)<br>
&gt; [ =A0 =A04.478801] Freeing unused kernel memory: 552k freed<br>
&gt; [ =A0 =A04.478847] Write protecting the kernel read-only data: 8192k<b=
r>
&gt; [ =A0 =A04.481908] Freeing unused kernel memory: 1568k freed<br>
&gt; [ =A0 =A04.482112] Freeing unused kernel memory: 24k freed<br>
&gt; [ =A0 =A04.524129] dracut: dracut-005-3.fc13<br>
&gt; [ =A0 =A04.552311] pciback 0000:00:19.0: seizing device<br>
&gt; [ =A0 =A04.552403] pciback 0000:02:00.0: seizing device<br>
&gt; [ =A0 =A04.552941] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0 =A04.552952] Already setup the GSI :17<br>
&gt; [ =A0 =A04.553934] xen: registering gsi 20 triggering 0 polarity 1<br>
&gt; [ =A0 =A04.553964] xen: --&gt; pirq=3D20 -&gt; irq=3D20 (gsi=3D20)<br>
&gt; [ =A0 =A04.554574] xen-pciback: backend is vpci<br>
&gt; [ =A0 =A04.617471] udev: starting version 151<br>
&gt; [ =A0 =A04.617770] udevd (80): /proc/80/oom_adj is deprecated, please =
use /proc/80/oom_score_adj instead.<br>
&gt; [ =A0 =A04.654916] Linux agpgart interface v0.103<br>
&gt; [ =A0 =A04.655397] input: Lid Switch as /devices/LNXSYSTM:00/device:00=
/PNP0C0D:00/input/input1<br>
&gt; [ =A0 =A05.051184] ACPI: Lid Switch [LID]<br>
&gt; [ =A0 =A05.051436] input: Power Button as /devices/LNXSYSTM:00/device:=
00/PNP0C0C:00/input/input2<br>
&gt; [ =A0 =A05.051547] ACPI: Power Button [PBTN]<br>
&gt; [ =A0 =A05.051682] input: Sleep Button as /devices/LNXSYSTM:00/device:=
00/PNP0C0E:00/input/input3<br>
&gt; [ =A0 =A05.051760] ACPI: Sleep Button [SBTN]<br>
&gt; [ =A0 =A05.054141] input: Power Button as /devices/LNXSYSTM:00/LNXPWRB=
N:00/input/input4<br>
&gt; [ =A0 =A05.054421] ACPI: Power Button [PWRF]<br>
&gt; [ =A0 =A05.056887] agpgart-intel 0000:00:00.0: Intel Sandybridge Chips=
et<br>
&gt; [ =A0 =A05.058118] agpgart-intel 0000:00:00.0: detected gtt size: 2097=
152K total, 262144K mappable<br>
&gt; [ =A0 =A05.064439] agpgart-intel 0000:00:00.0: detected 65536K stolen =
memory<br>
&gt; [ =A0 =A05.064916] agpgart-intel 0000:00:00.0: AGP aperture is 256M @ =
0xd0000000<br>
&gt; [ =A0 =A05.070296] [drm] Initialized drm 1.1.0 20060810<br>
&gt; [ =A0 =A05.080002] xen: registering gsi 16 triggering 0 polarity 1<br>
&gt; [ =A0 =A05.080015] Already setup the GSI :16<br>
&gt; [ =A0 =A05.080364] i915 0000:00:02.0: setting latency timer to 64<br>
&gt; [ =A0 =A05.190295] [drm] MTRR allocation failed. =A0Graphics performan=
ce may suffer.<br>
&gt; [ =A0 =A05.190491] [drm] Supports vblank timestamp caching Rev 1 (10.1=
0.2010).<br>
&gt; [ =A0 =A05.190493] [drm] Driver supports precise vblank timestamp quer=
y.<br>
&gt; [ =A0 =A05.190554] vgaarb: device changed decodes: PCI:0000:00:02.0,ol=
ddecodes=3Dio+mem,decodes=3Dio+mem:owns=3Dio+mem<br>
&gt; [ =A0 =A05.548301] [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp =
off<br>
&gt; [ =A0 =A05.591093] input: DualPoint Stick as /devices/platform/i8042/s=
erio1/input/input5<br>
&gt; [ =A0 =A05.606212] input: AlpsPS/2 ALPS DualPoint TouchPad as /devices=
/platform/i8042/serio1/input/input6<br>
&gt; [ =A0 =A05.806814] fbcon: inteldrmfb (fb0) is primary device<br>
&gt; [ =A0 =A06.095967] Console: switching to colour frame buffer device 20=
0x56<br>
&gt; [ =A0 =A06.101477] fb0: inteldrmfb frame buffer device<br>
&gt; [ =A0 =A06.101478] drm: registered panic notifier<br>
&gt; [ =A0 =A06.130833] acpi device:38: registered as cooling_device4<br>
&gt; [ =A0 =A06.133713] input: Video Bus as /devices/LNXSYSTM:00/device:00/=
PNP0A08:00/LNXVIDEO:00/input/input7<br>
&gt; [ =A0 =A06.133915] ACPI: Video Device [VID] (multi-head: yes =A0rom: n=
o =A0post: no)<br>
&gt; [ =A0 =A06.135082] [drm] Initialized i915 1.6.0 20080730 for 0000:00:0=
2.0 on minor 0<br>
&gt; [ =A0 =A06.185946] dracut: Starting plymouth daemon<br>
&gt; [ =A0 =A06.479391] dracut: rd_NO_DM: removing DM RAID activation<br>
&gt; [ =A0 =A06.489309] dracut: rd_NO_MD: removing MD RAID activation<br>
&gt; [ =A0 =A06.542596] wmi: Mapper loaded<br>
&gt; [ =A0 =A06.564439] usbcore: registered new interface driver usbfs<br>
&gt; [ =A0 =A06.564463] usbcore: registered new interface driver hub<br>
&gt; [ =A0 =A06.568901] SCSI subsystem initialized<br>
&gt; [ =A0 =A06.569574] usbcore: registered new device driver usb<br>
&gt; [ =A0 =A06.570692] ehci_hcd: USB 2.0 &#39;Enhanced&#39; Host Controlle=
r (EHCI) Driver<br>
&gt; [ =A0 =A06.570723] xen: registering gsi 16 triggering 0 polarity 1<br>
&gt; [ =A0 =A06.570728] Already setup the GSI :16<br>
&gt; [ =A0 =A06.570776] ehci_hcd 0000:00:1a.0: setting latency timer to 64<=
br>
&gt; [ =A0 =A06.570782] ehci_hcd 0000:00:1a.0: EHCI Host Controller<br>
&gt; [ =A0 =A06.570814] ehci_hcd 0000:00:1a.0: new USB bus registered, assi=
gned bus number 1<br>
&gt; [ =A0 =A06.570879] ehci_hcd 0000:00:1a.0: debug port 2<br>
&gt; [ =A0 =A06.573720] libata version 3.00 loaded.<br>
&gt; [ =A0 =A06.574777] ehci_hcd 0000:00:1a.0: cache line size of 64 is not=
 supported<br>
&gt; [ =A0 =A06.574832] ehci_hcd 0000:00:1a.0: irq 16, io mem 0xe2e70000<br=
>
&gt; [ =A0 =A06.586344] ehci_hcd 0000:00:1a.0: USB 2.0 started, EHCI 1.00<b=
r>
&gt; [ =A0 =A06.586369] usb usb1: New USB device found, idVendor=3D1d6b, id=
Product=3D0002<br>
&gt; [ =A0 =A06.586372] usb usb1: New USB device strings: Mfr=3D3, Product=
=3D2, SerialNumber=3D1<br>
&gt; [ =A0 =A06.586375] usb usb1: Product: EHCI Host Controller<br>
&gt; [ =A0 =A06.586376] usb usb1: Manufacturer: Linux 3.4.18-2.pvops.qubes.=
x86_64 ehci_hcd<br>
&gt; [ =A0 =A06.586378] usb usb1: SerialNumber: 0000:00:1a.0<br>
&gt; [ =A0 =A06.586506] hub 1-0:1.0: USB hub found<br>
&gt; [ =A0 =A06.586511] hub 1-0:1.0: 2 ports detected<br>
&gt; [ =A0 =A06.586604] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0 =A06.586609] Already setup the GSI :17<br>
&gt; [ =A0 =A06.586663] ehci_hcd 0000:00:1d.0: setting latency timer to 64<=
br>
&gt; [ =A0 =A06.586668] ehci_hcd 0000:00:1d.0: EHCI Host Controller<br>
&gt; [ =A0 =A06.586678] ehci_hcd 0000:00:1d.0: new USB bus registered, assi=
gned bus number 2<br>
&gt; [ =A0 =A06.586734] ehci_hcd 0000:00:1d.0: debug port 2<br>
&gt; [ =A0 =A06.590650] ehci_hcd 0000:00:1d.0: cache line size of 64 is not=
 supported<br>
&gt; [ =A0 =A06.590709] ehci_hcd 0000:00:1d.0: irq 17, io mem 0xe2e50000<br=
>
&gt; [ =A0 =A06.606335] ehci_hcd 0000:00:1d.0: USB 2.0 started, EHCI 1.00<b=
r>
&gt; [ =A0 =A06.606364] usb usb2: New USB device found, idVendor=3D1d6b, id=
Product=3D0002<br>
&gt; [ =A0 =A06.606367] usb usb2: New USB device strings: Mfr=3D3, Product=
=3D2, SerialNumber=3D1<br>
&gt; [ =A0 =A06.606370] usb usb2: Product: EHCI Host Controller<br>
&gt; [ =A0 =A06.606371] usb usb2: Manufacturer: Linux 3.4.18-2.pvops.qubes.=
x86_64 ehci_hcd<br>
&gt; [ =A0 =A06.606373] usb usb2: SerialNumber: 0000:00:1d.0<br>
&gt; [ =A0 =A06.606519] hub 2-0:1.0: USB hub found<br>
&gt; [ =A0 =A06.606524] hub 2-0:1.0: 2 ports detected<br>
&gt; [ =A0 =A06.606620] ahci 0000:00:1f.2: version 3.0<br>
&gt; [ =A0 =A06.606641] xen: registering gsi 18 triggering 0 polarity 1<br>
&gt; [ =A0 =A06.606647] Already setup the GSI :18<br>
&gt; [ =A0 =A06.606896] ahci: SSS flag set, parallel bus scan disabled<br>
&gt; [ =A0 =A06.626400] ahci 0000:00:1f.2: AHCI 0001.0300 32 slots 6 ports =
6 Gbps 0x3b impl SATA mode<br>
&gt; [ =A0 =A06.626405] ahci 0000:00:1f.2: flags: 64bit ncq sntf stag pm le=
d clo pio slum part ems sxs apst<br>
&gt; [ =A0 =A06.626414] ahci 0000:00:1f.2: setting latency timer to 64<br>
&gt; [ =A0 =A06.673732] scsi0 : ahci<br>
&gt; [ =A0 =A06.683363] scsi1 : ahci<br>
&gt; [ =A0 =A06.697268] scsi2 : ahci<br>
&gt; [ =A0 =A06.711526] scsi3 : ahci<br>
&gt; [ =A0 =A06.733931] scsi4 : ahci<br>
&gt; [ =A0 =A06.739603] scsi5 : ahci<br>
&gt; [ =A0 =A06.842106] ata1: SATA max UDMA/133 abar m2048@0xe2e40000 port =
0xe2e40100 irq 293<br>
&gt; [ =A0 =A06.842118] ata2: SATA max UDMA/133 abar m2048@0xe2e40000 port =
0xe2e40180 irq 293<br>
&gt; [ =A0 =A06.842124] ata3: DUMMY<br>
&gt; [ =A0 =A06.842129] ata4: SATA max UDMA/133 abar m2048@0xe2e40000 port =
0xe2e40280 irq 293<br>
&gt; [ =A0 =A06.842136] ata5: SATA max UDMA/133 abar m2048@0xe2e40000 port =
0xe2e40300 irq 293<br>
&gt; [ =A0 =A06.842143] ata6: SATA max UDMA/133 abar m2048@0xe2e40000 port =
0xe2e40380 irq 293<br>
&gt; [ =A0 =A06.898480] usb 1-1: new high-speed USB device number 2 using e=
hci_hcd<br>
&gt; [ =A0 =A07.031312] usb 1-1: New USB device found, idVendor=3D8087, idP=
roduct=3D0024<br>
&gt; [ =A0 =A07.031323] usb 1-1: New USB device strings: Mfr=3D0, Product=
=3D0, SerialNumber=3D0<br>
&gt; [ =A0 =A07.032072] hub 1-1:1.0: USB hub found<br>
&gt; [ =A0 =A07.032344] hub 1-1:1.0: 6 ports detected<br>
&gt; [ =A0 =A07.142515] usb 2-1: new high-speed USB device number 2 using e=
hci_hcd<br>
&gt; [ =A0 =A07.162484] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 3=
00)<br>
&gt; [ =A0 =A07.268594] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) reject=
ed by device (Stat=3D0x51 Err=3D0x04)<br>
&gt; [ =A0 =A07.268770] ata1.00: ATA-9: KINGSTON SV200S3256G, E111008a, max=
 UDMA/100<br>
&gt; [ =A0 =A07.268778] ata1.00: 500118192 sectors, multi 16: LBA48 NCQ (de=
pth 31/32), AA<br>
&gt; [ =A0 =A07.272554] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) reject=
ed by device (Stat=3D0x51 Err=3D0x04)<br>
&gt; [ =A0 =A07.272758] ata1.00: configured for UDMA/100<br>
&gt; [ =A0 =A07.273314] scsi 0:0:0:0: Direct-Access =A0 =A0 ATA =A0 =A0 =A0=
KINGSTON SV200S3 E111 PQ: 0 ANSI: 5<br>
&gt; [ =A0 =A07.274861] usb 2-1: New USB device found, idVendor=3D8087, idP=
roduct=3D0024<br>
&gt; [ =A0 =A07.274870] usb 2-1: New USB device strings: Mfr=3D0, Product=
=3D0, SerialNumber=3D0<br>
&gt; [ =A0 =A07.275358] hub 2-1:1.0: USB hub found<br>
&gt; [ =A0 =A07.275521] hub 2-1:1.0: 8 ports detected<br>
&gt; [ =A0 =A07.346717] usb 1-1.4: new full-speed USB device number 3 using=
 ehci_hcd<br>
&gt; [ =A0 =A07.443529] usb 1-1.4: New USB device found, idVendor=3D413c, i=
dProduct=3D8187<br>
&gt; [ =A0 =A07.443539] usb 1-1.4: New USB device strings: Mfr=3D1, Product=
=3D2, SerialNumber=3D3<br>
&gt; [ =A0 =A07.443546] usb 1-1.4: Product: DW375 Bluetooth Module<br>
&gt; [ =A0 =A07.443550] usb 1-1.4: Manufacturer: Dell Computer Corp<br>
&gt; [ =A0 =A07.443555] usb 1-1.4: SerialNumber: D0DF9A40FE60<br>
&gt; [ =A0 =A07.514736] usb 1-1.5: new high-speed USB device number 4 using=
 ehci_hcd<br>
&gt; [ =A0 =A07.590440] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 3=
00)<br>
&gt; [ =A0 =A07.593835] ata2.00: ATAPI: HL-DT-ST DVD+/-RW GU60N, A103, max =
UDMA/133<br>
&gt; [ =A0 =A07.604147] ata2.00: configured for UDMA/133<br>
&gt; [ =A0 =A07.614746] usb 1-1.5: New USB device found, idVendor=3D05ca, i=
dProduct=3D181c<br>
&gt; [ =A0 =A07.614757] usb 1-1.5: New USB device strings: Mfr=3D1, Product=
=3D2, SerialNumber=3D0<br>
&gt; [ =A0 =A07.614763] usb 1-1.5: Product: Laptop_Integrated_Webcam_FHD<br=
>
&gt; [ =A0 =A07.614768] usb 1-1.5: Manufacturer: CN0CJ3P27248717F040SA01<br=
>
&gt; [ =A0 =A07.618662] scsi 1:0:0:0: CD-ROM =A0 =A0 =A0 =A0 =A0 =A0HL-DT-S=
T DVD+-RW GU60N =A0 =A0A103 PQ: 0 ANSI: 5<br>
&gt; [ =A0 =A07.686581] usb 2-1.6: new high-speed USB device number 3 using=
 ehci_hcd<br>
&gt; [ =A0 =A07.795399] usb 2-1.6: New USB device found, idVendor=3D413c, i=
dProduct=3D818d<br>
&gt; [ =A0 =A07.795410] usb 2-1.6: New USB device strings: Mfr=3D1, Product=
=3D2, SerialNumber=3D3<br>
&gt; [ =A0 =A07.795416] usb 2-1.6: Product: DW5550<br>
&gt; [ =A0 =A07.795420] usb 2-1.6: Manufacturer: Dell<br>
&gt; [ =A0 =A07.795425] usb 2-1.6: SerialNumber: 88FA653FDF944970<br>
&gt; [ =A0 =A07.902770] usb 2-1.8: new full-speed USB device number 4 using=
 ehci_hcd<br>
&gt; [ =A0 =A07.938478] ata4: SATA link down (SStatus 0 SControl 300)<br>
&gt; [ =A0 =A08.017319] usb 2-1.8: New USB device found, idVendor=3D0a5c, i=
dProduct=3D5801<br>
&gt; [ =A0 =A08.017330] usb 2-1.8: New USB device strings: Mfr=3D1, Product=
=3D2, SerialNumber=3D3<br>
&gt; [ =A0 =A08.017336] usb 2-1.8: Product: 5880<br>
&gt; [ =A0 =A08.017340] usb 2-1.8: Manufacturer: Broadcom Corp<br>
&gt; [ =A0 =A08.017344] usb 2-1.8: SerialNumber: 0123456789ABCD<br>
&gt; [ =A0 =A08.017794] usb 2-1.8: config 0 descriptor??<br>
&gt; [ =A0 =A08.258411] ata5: SATA link down (SStatus 0 SControl 300)<br>
&gt; [ =A0 =A08.578480] ata6: SATA link down (SStatus 0 SControl 300)<br>
&gt; [ =A0 =A08.588630] sd 0:0:0:0: [sda] 500118192 512-byte logical blocks=
: (256 GB/238 GiB)<br>
&gt; [ =A0 =A08.588846] sd 0:0:0:0: [sda] Write Protect is off<br>
&gt; [ =A0 =A08.588861] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00<br>
&gt; [ =A0 =A08.588967] sd 0:0:0:0: [sda] Write cache: enabled, read cache:=
 enabled, doesn&#39;t support DPO or FUA<br>
&gt; [ =A0 =A08.590122] =A0sda: sda1 sda2<br>
&gt; [ =A0 =A08.591059] sd 0:0:0:0: [sda] Attached SCSI disk<br>
&gt; [ =A0 =A08.609438] sr0: scsi3-mmc drive: 24x/8x writer dvd-ram cd/rw x=
a/form2 cdda tray<br>
&gt; [ =A0 =A08.609451] cdrom: Uniform CD-ROM driver Revision: 3.20<br>
&gt; [ =A0 =A08.609737] sr 1:0:0:0: Attached scsi CD-ROM sr0<br>
&gt; [ =A0 =A08.714515] dracut: luksOpen /dev/sda2 luks-400336fa-c7c4-4be3-=
a244-c909aa16a18c<br>
&gt; [ =A0 13.862564] dracut: Scanning devices dm-0 =A0for LVM logical volu=
mes vg_dom0/lv_root vg_dom0/lv_swap<br>
&gt; [ =A0 13.907639] dracut: inactive &#39;/dev/vg_dom0/lv_root&#39; [221.=
62 GiB] inherit<br>
&gt; [ =A0 13.907708] dracut: inactive &#39;/dev/vg_dom0/lv_swap&#39; [16.3=
4 GiB] inherit<br>
&gt; [ =A0 14.162684] EXT4-fs (dm-1): INFO: recovery required on readonly f=
ilesystem<br>
&gt; [ =A0 14.162693] EXT4-fs (dm-1): write access will be enabled during r=
ecovery<br>
&gt; [ =A0 14.775779] EXT4-fs (dm-1): orphan cleanup on readonly fs<br>
&gt; [ =A0 14.775800] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767209<br>
&gt; [ =A0 14.775909] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767207<br>
&gt; [ =A0 14.776007] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767205<br>
&gt; [ =A0 14.776035] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767206<br>
&gt; [ =A0 14.776062] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767204<br>
&gt; [ =A0 14.776088] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767202<br>
&gt; [ =A0 14.776117] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767198<br>
&gt; [ =A0 14.776146] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767196<br>
&gt; [ =A0 14.776172] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767191<br>
&gt; [ =A0 14.776198] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767189<br>
&gt; [ =A0 14.776227] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767188<br>
&gt; [ =A0 14.776274] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767187<br>
&gt; [ =A0 14.777018] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767186<br>
&gt; [ =A0 14.777060] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767184<br>
&gt; [ =A0 14.777089] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767183<br>
&gt; [ =A0 14.777117] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767171<br>
&gt; [ =A0 14.777146] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767170<br>
&gt; [ =A0 14.777172] EXT4-fs (dm-1): 17 orphan inodes deleted<br>
&gt; [ =A0 14.777177] EXT4-fs (dm-1): recovery complete<br>
&gt; [ =A0 14.797124] EXT4-fs (dm-1): mounted filesystem with ordered data =
mode. Opts: (null)<br>
&gt; [ =A0 14.806762] dracut: Mounted root filesystem /dev/mapper/vg_dom0-l=
v_root<br>
&gt; [ =A0 14.957211] dracut: Switching root<br>
&gt; [ =A0 15.599261] udev: starting version 151<br>
&gt; [ =A0 15.673674] iTCO_vendor_support: vendor-support=3D0<br>
&gt; [ =A0 15.676374] mei: module is from the staging directory, the qualit=
y is unknown, you have been warned.<br>
&gt; [ =A0 15.676488] iTCO_wdt: Intel TCO WatchDog Timer Driver v1.07<br>
&gt; [ =A0 15.676679] iTCO_wdt: Found a Cougar Point TCO device (Version=3D=
2, TCOBASE=3D0x0460)<br>
&gt; [ =A0 15.676711] xen: registering gsi 16 triggering 0 polarity 1<br>
&gt; [ =A0 15.676716] Already setup the GSI :16<br>
&gt; [ =A0 15.676725] mei 0000:00:16.0: setting latency timer to 64<br>
&gt; [ =A0 15.676754] iTCO_wdt: initialized. heartbeat=3D30 sec (nowayout=
=3D0)<br>
&gt; [ =A0 15.712582] sd 0:0:0:0: Attached scsi generic sg0 type 0<br>
&gt; [ =A0 15.712620] sr 1:0:0:0: Attached scsi generic sg1 type 5<br>
&gt; [ =A0 15.730448] input: PC Speaker as /devices/platform/pcspkr/input/i=
nput8<br>
&gt; [ =A0 15.734494] xen: registering gsi 18 triggering 0 polarity 1<br>
&gt; [ =A0 15.734500] Already setup the GSI :18<br>
&gt; [ =A0 15.734506] ACPI Warning: 0x0000000000004040-0x000000000000405f S=
ystemIO conflicts with Region \_SB_.PCI0.SBUS.SMBI 1 (20120320/utaddress-25=
1)<br>
&gt; [ =A0 15.734512] ACPI: If an ACPI driver is available for this device,=
 you should use it instead of the native driver<br>
&gt; [ =A0 15.737002] microcode: CPU0 sig=3D0x206a7, pf=3D0x10, revision=3D=
0x23<br>
&gt; [ =A0 15.741412] watchdog: INTCAMT: cannot register miscdev on minor=
=3D130 (err=3D-16)<br>
&gt; [ =A0 15.741418] watchdog: error registering /dev/watchdog (err=3D-16)=
<br>
&gt; [ =A0 15.741422] mei 0000:00:16.0: unable to register watchdog device.=
<br>
&gt; [ =A0 15.790637] thermal LNXTHERM:00: registered as thermal_zone0<br>
&gt; [ =A0 15.790641] ACPI: Thermal Zone [THM] (25 C)<br>
&gt; [ =A0 15.814551] ACPI: Deprecated procfs I/F for battery is loaded, pl=
ease retry with CONFIG_ACPI_PROCFS_POWER cleared<br>
&gt; [ =A0 15.814559] ACPI: Battery Slot [BAT0] (battery present)<br>
&gt; [ =A0 15.815037] ACPI: Deprecated procfs I/F for AC is loaded, please =
retry with CONFIG_ACPI_PROCFS_POWER cleared<br>
&gt; [ =A0 15.815521] ACPI: AC Adapter [AC] (on-line)<br>
&gt; [ =A0 15.867835] usbcore: registered new interface driver usbback<br>
&gt; [ =A0 15.975826] ACPI: Deprecated procfs I/F for battery is loaded, pl=
ease retry with CONFIG_ACPI_PROCFS_POWER cleared<br>
&gt; [ =A0 15.975836] ACPI: Battery Slot [BAT1] (battery absent)<br>
&gt; [ =A0 16.102871] ACPI: Deprecated procfs I/F for battery is loaded, pl=
ease retry with CONFIG_ACPI_PROCFS_POWER cleared<br>
&gt; [ =A0 16.102882] ACPI: Battery Slot [BAT2] (battery absent)<br>
&gt; [ =A0 16.106793] sdhci: Secure Digital Host Controller Interface drive=
r<br>
&gt; [ =A0 16.106797] sdhci: Copyright(c) Pierre Ossman<br>
&gt; [ =A0 16.107131] parport_pc 00:08: [io =A00x0378-0x037b]<br>
&gt; [ =A0 16.107296] parport_pc 00:08: [irq 5]<br>
&gt; [ =A0 16.107709] sdhci-pci 0000:0a:00.0: SDHCI controller found [1217:=
8221] (rev 5)<br>
&gt; [ =A0 16.159148] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0 16.159156] Already setup the GSI :17<br>
&gt; [ =A0 16.159241] sdhci-pci 0000:0a:00.0: Invalid iomem size. You may e=
xperience problems.<br>
&gt; [ =A0 16.159319] 0000:0a:00.0 supply vmmc not found, using dummy regul=
ator<br>
&gt; [ =A0 16.159384] Registered led device: mmc0::<br>
&gt; [ =A0 16.160442] mmc0: SDHCI controller on PCI [0000:0a:00.0] using DM=
A<br>
&gt; [ =A0 16.160928] sdhci-pci 0000:0a:00.0: could not set regulator OCR (=
-22)<br>
&gt; [ =A0 16.171737] Linux video capture interface: v2.00<br>
&gt; [ =A0 16.192158] cdc_wdm 2-1.6:1.5: cdc-wdm0: USB WDM device<br>
&gt; [ =A0 16.192211] cdc_wdm 2-1.6:1.8: cdc-wdm1: USB WDM device<br>
&gt; [ =A0 16.192234] usbcore: registered new interface driver cdc_wdm<br>
&gt; [ =A0 16.195744] cdc_acm 2-1.6:1.1: ttyACM0: USB ACM device<br>
&gt; [ =A0 16.198739] sdhci-pci 0000:0a:00.0: could not set regulator OCR (=
-22)<br>
&gt; [ =A0 16.220532] cdc_acm 2-1.6:1.3: ttyACM1: USB ACM device<br>
&gt; [ =A0 16.223728] cdc_acm 2-1.6:1.9: ttyACM2: USB ACM device<br>
&gt; [ =A0 16.235089] sdhci-pci 0000:0a:00.0: could not set regulator OCR (=
-22)<br>
&gt; [ =A0 16.235234] usbcore: registered new interface driver cdc_acm<br>
&gt; [ =A0 16.235236] cdc_acm: USB Abstract Control Model driver for USB mo=
dems and ISDN adapters<br>
&gt; [ =A0 16.240235] uvcvideo: Found UVC 1.00 device Laptop_Integrated_Web=
cam_FHD (05ca:181c)<br>
&gt; [ =A0 16.269474] input: Laptop_Integrated_Webcam_FHD as /devices/pci00=
00:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/input/input9<br>
&gt; [ =A0 16.269579] usbcore: registered new interface driver uvcvideo<br>
&gt; [ =A0 16.269581] USB Video Class driver (1.1.1)<br>
&gt; [ =A0 16.277415] sdhci-pci 0000:0a:00.0: could not set regulator OCR (=
-22)<br>
&gt; [ =A0 16.296646] usb 2-1.6: MAC-Address: 02:80:37:ec:02:00<br>
&gt; [ =A0 16.296810] cdc_ncm 2-1.6:1.6: usb0: register &#39;cdc_ncm&#39; a=
t usb-0000:00:1d.0-1.6, CDC NCM, 02:80:37:ec:02:00<br>
&gt; [ =A0 16.296847] usbcore: registered new interface driver cdc_ncm<br>
&gt; [ =A0 16.310604] parport_pc 00:08: activated<br>
&gt; [ =A0 16.310611] parport_pc 00:08: reported by Plug and Play ACPI<br>
&gt; [ =A0 16.310781] parport_pc 00:08: disabled<br>
&gt; [ =A0 16.311583] tpm_tis 00:0a: 1.2 TPM (device-id 0x2001, rev-id 32)<=
br>
&gt; [ =A0 16.399296] Bluetooth: Core ver 2.16<br>
&gt; [ =A0 16.399312] NET: Registered protocol family 31<br>
&gt; [ =A0 16.399314] Bluetooth: HCI device and connection manager initiali=
zed<br>
&gt; [ =A0 16.399317] Bluetooth: HCI socket layer initialized<br>
&gt; [ =A0 16.399318] Bluetooth: L2CAP socket layer initialized<br>
&gt; [ =A0 16.399325] Bluetooth: SCO socket layer initialized<br>
&gt; [ =A0 16.450583] xen: registering gsi 22 triggering 0 polarity 1<br>
&gt; [ =A0 16.450600] xen: --&gt; pirq=3D22 -&gt; irq=3D22 (gsi=3D22)<br>
&gt; [ =A0 16.567577] usbcore: registered new interface driver btusb<br>
&gt; [ =A0 16.739259] dcdbas dcdbas: Dell Systems Management Base Driver (v=
ersion 5.6.0-3.2)<br>
&gt; [ =A0 16.819125] input: Dell WMI hotkeys as /devices/virtual/input/inp=
ut10<br>
&gt; [ =A0 16.925000] microcode: CPU1 sig=3D0x206a7, pf=3D0x10, revision=3D=
0x23<br>
&gt; [ =A0 16.929246] ppdev: user-space parallel port driver<br>
&gt; [ =A0 16.954783] microcode: CPU2 sig=3D0x206a7, pf=3D0x10, revision=3D=
0x23<br>
&gt; [ =A0 16.975176] microcode: CPU3 sig=3D0x206a7, pf=3D0x10, revision=3D=
0x23<br>
&gt; [ =A0 17.004696] microcode: Microcode Update Driver: v2.00 &lt;<a href=
=3D"mailto:tigran@aivazian.fsnet.co.uk">tigran@aivazian.fsnet.co.uk</a>&gt;=
, Peter Oruba<br>
&gt; [ =A0 17.067123] ALSA hda_codec.c:5101 autoconfig: line_outs=3D1 (0xe/=
0x0/0x0/0x0/0x0) type:line<br>
&gt; [ =A0 17.067127] ALSA hda_codec.c:5105 =A0 =A0speaker_outs=3D1 (0xd/0x=
0/0x0/0x0/0x0)<br>
&gt; [ =A0 17.067129] ALSA hda_codec.c:5109 =A0 =A0hp_outs=3D1 (0xb/0x0/0x0=
/0x0/0x0)<br>
&gt; [ =A0 17.067131] ALSA hda_codec.c:5110 =A0 =A0mono: mono_out=3D0x0<br>
&gt; [ =A0 17.067133] ALSA hda_codec.c:5114 =A0 =A0inputs:<br>
&gt; [ =A0 17.067135] ALSA hda_codec.c:5118 =A0Mic=3D0xa<br>
&gt; [ =A0 17.067137] ALSA hda_codec.c:5118 =A0Dock Mic=3D0xf<br>
&gt; [ =A0 17.067139] ALSA hda_codec.c:5120<br>
&gt; [ =A0 17.067637] ALSA patch_sigmatel.c:3117 stac92xx: dac_nids=3D1 (0x=
13/0x0/0x0/0x0/0x0)<br>
&gt; [ =A0 17.081104] input: HDA Intel PCH HDMI/DP,pcm=3D8 as /devices/pci0=
000:00/0000:00:1b.0/sound/card0/input11<br>
&gt; [ =A0 17.081194] input: HDA Intel PCH HDMI/DP,pcm=3D7 as /devices/pci0=
000:00/0000:00:1b.0/sound/card0/input12<br>
&gt; [ =A0 17.081250] input: HDA Intel PCH HDMI/DP,pcm=3D3 as /devices/pci0=
000:00/0000:00:1b.0/sound/card0/input13<br>
&gt; [ =A0 17.081342] input: HDA Intel PCH Dock Mic as /devices/pci0000:00/=
0000:00:1b.0/sound/card0/input14<br>
&gt; [ =A0 17.081432] input: HDA Intel PCH Mic as /devices/pci0000:00/0000:=
00:1b.0/sound/card0/input15<br>
&gt; [ =A0 17.081522] input: HDA Intel PCH Headphone as /devices/pci0000:00=
/0000:00:1b.0/sound/card0/input16<br>
&gt; [ =A0 17.081610] input: HDA Intel PCH Dock Line Out as /devices/pci000=
0:00/0000:00:1b.0/sound/card0/input17<br>
&gt; [ =A0 17.265462] Event-channel device installed.<br>
&gt; [ =A0 17.661764] EXT4-fs (dm-1): re-mounted. Opts: (null)<br>
&gt; [ =A0 17.802446] EXT4-fs (sda1): mounted filesystem with ordered data =
mode. Opts: (null)<br>
&gt; [ =A0 19.361631] Adding 17137660k swap on /dev/mapper/vg_dom0-lv_swap.=
 =A0Priority:-1 extents:1 across:17137660k SS<br>
&gt; [ =A0 22.602549] ehci_hcd 0000:00:1a.0: remove, state 1<br>
&gt; [ =A0 22.602568] usb usb1: USB disconnect, device number 1<br>
&gt; [ =A0 22.602573] usb 1-1: USB disconnect, device number 2<br>
&gt; [ =A0 22.602578] usb 1-1.4: USB disconnect, device number 3<br>
&gt; [ =A0 22.605235] usb 1-1.5: USB disconnect, device number 4<br>
&gt; [ =A0 22.636910] ehci_hcd 0000:00:1a.0: USB bus 1 deregistered<br>
&gt; [ =A0 22.637183] pciback 0000:00:1a.0: seizing device<br>
&gt; [ =A0 22.637235] xen: registering gsi 16 triggering 0 polarity 1<br>
&gt; [ =A0 22.637241] Already setup the GSI :16<br>
&gt; [ =A0 22.662363] ehci_hcd 0000:00:1d.0: remove, state 1<br>
&gt; [ =A0 22.662371] usb usb2: USB disconnect, device number 1<br>
&gt; [ =A0 22.662373] usb 2-1: USB disconnect, device number 2<br>
&gt; [ =A0 22.662376] usb 2-1.6: USB disconnect, device number 3<br>
&gt; [ =A0 22.668531] cdc_ncm 2-1.6:1.6: usb0: unregister &#39;cdc_ncm&#39;=
 usb-0000:00:1d.0-1.6, CDC NCM<br>
&gt; [ =A0 22.694795] usb 2-1.8: USB disconnect, device number 4<br>
&gt; [ =A0 22.699298] ehci_hcd 0000:00:1d.0: USB bus 2 deregistered<br>
&gt; [ =A0 22.699577] pciback 0000:00:1d.0: seizing device<br>
&gt; [ =A0 22.699632] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0 22.699637] Already setup the GSI :17<br>
&gt; [ =A0 23.684708] xen-pciback: vpci: 0000:00:19.0: assign to virtual sl=
ot 0<br>
&gt; [ =A0 23.685240] xen-pciback: vpci: 0000:00:1a.0: assign to virtual sl=
ot 1<br>
&gt; [ =A0 23.685722] xen-pciback: vpci: 0000:00:1d.0: assign to virtual sl=
ot 2<br>
&gt; [ =A0 23.686764] xen-pciback: vpci: 0000:02:00.0: assign to virtual sl=
ot 3<br>
&gt; [ =A0 23.909636] pciback 0000:00:19.0: Driver tried to write to a read=
-only configuration space field at offset 0xd2, size 2. This may be harmles=
s, but if you have problems with your device:<br>
&gt; [ =A0 23.909638] 1) see permissive attribute in sysfs<br>
&gt; [ =A0 23.909638] 2) report problems to the xen-devel mailing list alon=
g with details of your device obtained from lspci.<br>
&gt; [ =A0 23.917523] pciback 0000:02:00.0: Driver tried to write to a read=
-only configuration space field at offset 0xd2, size 2. This may be harmles=
s, but if you have problems with your device:<br>
&gt; [ =A0 23.917526] 1) see permissive attribute in sysfs<br>
&gt; [ =A0 23.917526] 2) report problems to the xen-devel mailing list alon=
g with details of your device obtained from lspci.<br>
&gt; [ =A0 24.123663] xen-blkback:ring-ref 9, event-channel 14, protocol 1 =
(x86_64-abi)<br>
&gt; [ =A0 24.140460] xen-blkback:ring-ref 10, event-channel 15, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0 24.151420] xen-blkback:ring-ref 11, event-channel 16, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0 24.158428] xen-blkback:ring-ref 12, event-channel 17, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0 28.697615] pciback 0000:00:1a.0: enabling device (0000 -&gt; 000=
2)<br>
&gt; [ =A0 28.697628] xen: registering gsi 16 triggering 0 polarity 1<br>
&gt; [ =A0 28.697634] Already setup the GSI :16<br>
&gt; [ =A0 28.697805] pciback 0000:00:1a.0: setting latency timer to 64<br>
&gt; [ =A0 28.713578] pciback 0000:00:19.0: enabling device (0000 -&gt; 000=
3)<br>
&gt; [ =A0 28.713591] xen: registering gsi 20 triggering 0 polarity 1<br>
&gt; [ =A0 28.713598] Already setup the GSI :20<br>
&gt; [ =A0 28.713858] pciback 0000:00:19.0: setting latency timer to 64<br>
&gt; [ =A0 29.021371] pciback 0000:00:1d.0: enabling device (0000 -&gt; 000=
2)<br>
&gt; [ =A0 29.021389] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0 29.021400] Already setup the GSI :17<br>
&gt; [ =A0 29.021805] pciback 0000:00:1d.0: setting latency timer to 64<br>
&gt; [ =A0 29.150053] pciback 0000:02:00.0: enabling device (0000 -&gt; 000=
2)<br>
&gt; [ =A0 29.150122] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0 29.150150] Already setup the GSI :17<br>
&gt; [ =A0 33.635416] xen-blkback:ring-ref 9, event-channel 14, protocol 1 =
(x86_64-abi)<br>
&gt; [ =A0 33.643330] xen-blkback:ring-ref 10, event-channel 15, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0 33.651561] xen-blkback:ring-ref 11, event-channel 16, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0 33.672105] xen-blkback:ring-ref 12, event-channel 17, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0104.230911] xen-blkback:ring-ref 9, event-channel 24, protocol 1 =
(x86_64-abi)<br>
&gt; [ =A0104.252421] xen-blkback:ring-ref 10, event-channel 25, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0104.253177] xen-blkback:ring-ref 11, event-channel 26, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0104.254220] xen-blkback:ring-ref 12, event-channel 27, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0105.086732] xen-blkback:ring-ref 9, event-channel 14, protocol 1 =
(x86_64-abi)<br>
&gt; [ =A0105.105505] xen-blkback:ring-ref 10, event-channel 15, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0105.115951] xen-blkback:ring-ref 11, event-channel 16, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0105.127384] xen-blkback:ring-ref 12, event-channel 17, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0105.929760] xen-blkback:ring-ref 9, event-channel 14, protocol 1 =
(x86_64-abi)<br>
&gt; [ =A0105.934841] xen-blkback:ring-ref 10, event-channel 15, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0105.973920] xen-blkback:ring-ref 11, event-channel 16, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0105.975320] xen-blkback:ring-ref 12, event-channel 17, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0107.191781] xen-blkback:ring-ref 9, event-channel 14, protocol 1 =
(x86_64-abi)<br>
&gt; [ =A0107.203711] xen-blkback:ring-ref 10, event-channel 15, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0107.208481] xen-blkback:ring-ref 11, event-channel 16, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0107.212081] xen-blkback:ring-ref 12, event-channel 17, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0733.434608] PM: Syncing filesystems ... done.<br>
&gt; [ =A0733.436228] PM: Preparing system for mem sleep<br>
&gt; [ =A0733.514803] Freezing user space processes ... (elapsed 0.01 secon=
ds) done.<br>
&gt; [ =A0733.530594] Freezing remaining freezable tasks ... (elapsed 0.01 =
seconds) done.<br>
&gt; [ =A0733.546589] PM: Entering mem sleep<br>
&gt; [ =A0733.546741] Suspending console(s) (use no_console_suspend to debu=
g)<br>
&gt; [ =A0733.547431] sd 0:0:0:0: [sda] Synchronizing SCSI cache<br>
&gt; [ =A0733.558336] sd 0:0:0:0: [sda] Stopping disk<br>
&gt; [ =A0734.194656] PM: suspend of devices complete after 647.504 msecs<b=
r>
&gt; [ =A0734.195026] PM: late suspend of devices complete after 0.359 msec=
s<br>
&gt; [ =A0734.210655] PM: noirq suspend of devices complete after 15.614 ms=
ecs<br>
&gt; [ =A0734.211326] ACPI: Preparing to enter system sleep state S3<br>
&gt; [ =A0734.235008] PM: Saving platform NVS memory<br>
&gt; [ =A0734.328066] Disabling non-boot CPUs ...<br>
&gt; [ =A0735.945491] ACPI: Low-level resume complete<br>
&gt; [ =A0735.945579] PM: Restoring platform NVS memory<br>
&gt; [ =A0736.000094] Enabling non-boot CPUs ...<br>
&gt; [ =A0736.000256] installing Xen timer for CPU 1<br>
&gt; [ =A0736.004594] CPU1 is up<br>
&gt; [ =A0736.004819] installing Xen timer for CPU 2<br>
&gt; [ =A0736.067516] CPU2 is up<br>
&gt; [ =A0736.067770] installing Xen timer for CPU 3<br>
&gt; [ =A0736.101535] CPU3 is up<br>
&gt; [ =A0736.102470] ACPI: Waking up from system sleep state S3<br>
&gt; [ =A0736.555932] PM: noirq resume of devices complete after 7.970 msec=
s<br>
&gt; [ =A0736.556506] PM: early resume of devices complete after 0.387 msec=
s<br>
&gt; [ =A0736.660336] i915 0000:00:02.0: setting latency timer to 64<br>
&gt; [ =A0736.660404] pciback 0000:00:19.0: setting latency timer to 64<br>
&gt; [ =A0736.660453] xen: registering gsi 16 triggering 0 polarity 1<br>
&gt; [ =A0736.660460] Already setup the GSI :16<br>
&gt; [ =A0736.660490] pciback 0000:00:1a.0: setting latency timer to 64<br>
&gt; [ =A0736.660605] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0736.660610] Already setup the GSI :17<br>
&gt; [ =A0736.660641] pciback 0000:00:1d.0: setting latency timer to 64<br>
&gt; [ =A0736.660696] xen: registering gsi 22 triggering 0 polarity 1<br>
&gt; [ =A0736.660701] Already setup the GSI :22<br>
&gt; [ =A0736.661221] ahci 0000:00:1f.2: setting latency timer to 64<br>
&gt; [ =A0736.689606] xen: registering gsi 18 triggering 0 polarity 1<br>
&gt; [ =A0736.689608] Already setup the GSI :18<br>
&gt; [ =A0736.689704] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0736.689706] Already setup the GSI :17<br>
&gt; [ =A0736.711623] [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp of=
f<br>
&gt; [ =A0736.802676] watchdog: INTCAMT: cannot register miscdev on minor=
=3D130 (err=3D-16)<br>
&gt; [ =A0736.802678] watchdog: error registering /dev/watchdog (err=3D-16)=
<br>
&gt; [ =A0736.802680] mei 0000:00:16.0: unable to register watchdog device.=
<br>
&gt; [ =A0737.060106] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300=
)<br>
&gt; [ =A0737.060330] ata4: SATA link down (SStatus 0 SControl 300)<br>
&gt; [ =A0737.060372] ata5: SATA link down (SStatus 0 SControl 300)<br>
&gt; [ =A0737.074123] ata2.00: configured for UDMA/133<br>
&gt; [ =A0737.117629] ata6: SATA link down (SStatus 0 SControl 300)<br>
&gt; [ =A0738.619036] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300=
)<br>
&gt; [ =A0738.743565] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected=
 by device (Stat=3D0x51 Err=3D0x04)<br>
&gt; [ =A0738.901088] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected=
 by device (Stat=3D0x51 Err=3D0x04)<br>
&gt; [ =A0738.903441] ata1.00: configured for UDMA/100<br>
&gt; [ =A0738.903843] sd 0:0:0:0: [sda] Starting disk<br>
&gt; [ =A0738.905367] PM: resume of devices complete after 2348.851 msecs<b=
r>
&gt; [ =A0738.905922] PM: Finishing wakeup.<br>
&gt; [ =A0738.905926] Restarting tasks ... done.<br>
&gt; [ =A0738.911334] video LNXVIDEO:00: Restoring backlight state<br>
&gt; [ =A0739.836250] dell_wmi: Received unknown WMI event (0x0)<br>
&gt; [ =A0740.184759] sdhci-pci 0000:0a:00.0: could not set regulator OCR (=
-22)<br>
&gt; [ =A0740.239730] sdhci-pci 0000:0a:00.0: could not set regulator OCR (=
-22)<br>
&gt; [ =A0740.327711] sdhci-pci 0000:0a:00.0: could not set regulator OCR (=
-22)<br>
&gt; [ =A0740.373931] sdhci-pci 0000:0a:00.0: could not set regulator OCR (=
-22)<br>
&gt; [ =A0742.542022] hrtimer: interrupt took 102980031 ns<br>
&gt; [ =A0757.609031] [sched_delayed] sched: RT throttling activated<br>
&gt; [ =A0760.164427] hda-intel: IRQ timing workaround is activated for car=
d #0. Suggest a bigger bdl_pos_adj.<br>
<br>
&gt; (XEN) Xen version 4.1.3 (<a href=3D"mailto:user@marmarek.net">user@mar=
marek.net</a>) (gcc version 4.4.5 20101112 (Red Hat 4.4.5-2) (GCC) ) Mon No=
v 26 15:25:32 EST 2012<br>
&gt; (XEN) Latest ChangeSet: unavailable<br>
&gt; (XEN) Bootloader: GNU GRUB 0.97<br>
&gt; (XEN) Command line: console=3Dnone cpufreq=3Dverbose=3D1<br>
&gt; (XEN) Video information:<br>
&gt; (XEN) =A0VGA is text mode 80x25, font 8x16<br>
&gt; (XEN) =A0VBE/DDC methods: V2; EDID transfer time: 1 seconds<br>
&gt; (XEN) Disc information:<br>
&gt; (XEN) =A0Found 1 MBR signatures<br>
&gt; (XEN) =A0Found 1 EDD information structures<br>
&gt; (XEN) Xen-e820 RAM map:<br>
&gt; (XEN) =A00000000000000000 - 000000000009a800 (usable)<br>
&gt; (XEN) =A0000000000009a800 - 00000000000a0000 (reserved)<br>
&gt; (XEN) =A000000000000e0000 - 0000000000100000 (reserved)<br>
&gt; (XEN) =A00000000000100000 - 0000000007eea000 (usable)<br>
&gt; (XEN) =A00000000007eea000 - 0000000007f67000 (ACPI NVS)<br>
&gt; (XEN) =A00000000007f67000 - 0000000007f70000 (usable)<br>
&gt; (XEN) =A00000000007f70000 - 0000000007f76000 (ACPI NVS)<br>
&gt; (XEN) =A00000000007f76000 - 0000000007f78000 (usable)<br>
&gt; (XEN) =A00000000007f78000 - 0000000008000000 (ACPI NVS)<br>
&gt; (XEN) =A00000000008000000 - 000000000dffd000 (usable)<br>
&gt; (XEN) =A0000000000dffd000 - 000000000e000000 (ACPI data)<br>
&gt; (XEN) =A0000000000e000000 - 0000000020000000 (usable)<br>
&gt; (XEN) =A00000000020000000 - 0000000020200000 (reserved)<br>
&gt; (XEN) =A00000000020200000 - 0000000040000000 (usable)<br>
&gt; (XEN) =A00000000040000000 - 0000000040200000 (reserved)<br>
&gt; (XEN) =A00000000040200000 - 00000000c83b4000 (usable)<br>
&gt; (XEN) =A000000000c83b4000 - 00000000c840a000 (reserved)<br>
&gt; (XEN) =A000000000c840a000 - 00000000c840e000 (usable)<br>
&gt; (XEN) =A000000000c840e000 - 00000000c840f000 (reserved)<br>
&gt; (XEN) =A000000000c840f000 - 00000000c8411000 (usable)<br>
&gt; (XEN) =A000000000c8411000 - 00000000c8414000 (reserved)<br>
&gt; (XEN) =A000000000c8414000 - 00000000c841e000 (usable)<br>
&gt; (XEN) =A000000000c841e000 - 00000000c8428000 (reserved)<br>
&gt; (XEN) =A000000000c8428000 - 00000000c8432000 (usable)<br>
&gt; (XEN) =A000000000c8432000 - 00000000c8436000 (reserved)<br>
&gt; (XEN) =A000000000c8436000 - 00000000cac00000 (usable)<br>
&gt; (XEN) =A000000000cb800000 - 00000000cfa00000 (reserved)<br>
&gt; (XEN) =A000000000fed1c000 - 00000000fed20000 (reserved)<br>
&gt; (XEN) =A000000000ffc00000 - 00000000ffc20000 (reserved)<br>
&gt; (XEN) =A00000000100000000 - 000000042e000000 (usable)<br>
&gt; (XEN) ACPI: RSDP 000FE300, 0024 (r2 DELL =A0)<br>
&gt; (XEN) ACPI: XSDT 0DFFEE18, 007C (r1 DELL =A0 =A0CBX3 =A0 =A0 6222004 M=
SFT =A0 =A010013)<br>
&gt; (XEN) ACPI: FACP 07F90D98, 00F4 (r4 DELL =A0 =A0CBX3 =A0 =A0 6222004 M=
SFT =A0 =A010013)<br>
&gt; (XEN) ACPI: DSDT 07F5E018, 8834 (r2 INT430 SYSFexxx =A0 =A0 1001 INTL =
20090903)<br>
&gt; (XEN) ACPI: FACS 07FEDD40, 0040<br>
&gt; (XEN) ACPI: APIC 0DFFDF18, 00CC (r2 DELL =A0 =A0CBX3 =A0 =A0 6222004 M=
SFT =A0 =A010013)<br>
&gt; (XEN) ACPI: TCPA 07FEED18, 0032 (r2 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A0 0)<br>
&gt; (XEN) ACPI: SSDT 07F91A98, 02F9 (r1 DELLTP =A0 =A0 =A0TPM =A0 =A0 3000=
 INTL 20090903)<br>
&gt; (XEN) ACPI: MCFG 07FEEC98, 003C (r1 DELL =A0 SNDYBRDG =A06222004 MSFT =
=A0 =A0 =A0 97)<br>
&gt; (XEN) ACPI: HPET 07FEEC18, 0038 (r1 A M I =A0 PCHHPET =A06222004 AMI. =
=A0 =A0 =A0 =A03)<br>
&gt; (XEN) ACPI: BOOT 07FEEB98, 0028 (r1 DELL =A0 CBX3 =A0 =A0 =A06222004 A=
MI =A0 =A0 10013)<br>
&gt; (XEN) ACPI: SSDT 07F75018, 0804 (r1 =A0PmRef =A0Cpu0Ist =A0 =A0 3000 I=
NTL 20090903)<br>
&gt; (XEN) ACPI: SSDT 07F74018, 0996 (r1 =A0PmRef =A0 =A0CpuPm =A0 =A0 3000=
 INTL 20090903)<br>
&gt; (XEN) ACPI: DMAR 07F90C18, 00E8 (r1 INTEL =A0 =A0 =A0SNB =A0 =A0 =A0 =
=A0 1 INTL =A0 =A0 =A0 =A01)<br>
&gt; (XEN) ACPI: SLIC 07F7EC18, 0176 (r3 DELL =A0 =A0CBX3 =A0 =A0 6222004 M=
SFT =A0 =A010013)<br>
&gt; (XEN) System RAM: 16262MB (16652432kB)<br>
&gt; (XEN) Domain heap initialised<br>
&gt; (XEN) ACPI: 32/64X FACS address mismatch in FADT - 07fede40/0000000007=
fedd40, using 32<br>
&gt; (XEN) Processor #0 6:10 APIC version 21<br>
&gt; (XEN) Processor #2 6:10 APIC version 21<br>
&gt; (XEN) Processor #1 6:10 APIC version 21<br>
&gt; (XEN) Processor #3 6:10 APIC version 21<br>
&gt; (XEN) IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-23<b=
r>
&gt; (XEN) Enabling APIC mode: =A0Flat. =A0Using 1 I/O APICs<br>
&gt; (XEN) Table is not found!<br>
&gt; (XEN) Switched to APIC driver x2apic_cluster.<br>
&gt; (XEN) Using scheduler: SMP Credit Scheduler (credit)<br>
&gt; (XEN) Detected 2494.416 MHz processor.<br>
&gt; (XEN) Initing memory sharing.<br>
&gt; (XEN) Intel VT-d supported page sizes: 4kB.<br>
&gt; (XEN) Intel VT-d supported page sizes: 4kB.<br>
&gt; (XEN) Intel VT-d Snoop Control not enabled.<br>
&gt; (XEN) Intel VT-d Dom0 DMA Passthrough not enabled.<br>
&gt; (XEN) Intel VT-d Queued Invalidation enabled.<br>
&gt; (XEN) Intel VT-d Interrupt Remapping enabled.<br>
&gt; (XEN) Intel VT-d Shared EPT tables not enabled.<br>
&gt; (XEN) I/O virtualisation enabled<br>
&gt; (XEN) =A0- Dom0 mode: Relaxed<br>
&gt; (XEN) Enabled directed EOI with ioapic_ack_old on!<br>
&gt; (XEN) ENABLING IO-APIC IRQs<br>
&gt; (XEN) =A0-&gt; Using old ACK method<br>
&gt; (XEN) Platform timer appears to have unexpectedly wrapped 1 times.<br>
&gt; (XEN) Platform timer is 14.318MHz HPET<br>
&gt; (XEN) Allocated console ring of 16 KiB.<br>
&gt; (XEN) VMX: Supported advanced features:<br>
&gt; (XEN) =A0- APIC MMIO access virtualisation<br>
&gt; (XEN) =A0- APIC TPR shadow<br>
&gt; (XEN) =A0- Extended Page Tables (EPT)<br>
&gt; (XEN) =A0- Virtual-Processor Identifiers (VPID)<br>
&gt; (XEN) =A0- Virtual NMI<br>
&gt; (XEN) =A0- MSR direct-access bitmap<br>
&gt; (XEN) =A0- Unrestricted Guest<br>
&gt; (XEN) HVM: ASIDs enabled.<br>
&gt; (XEN) HVM: VMX enabled<br>
&gt; (XEN) HVM: Hardware Assisted Paging (HAP) detected<br>
&gt; (XEN) HVM: HAP page sizes: 4kB, 2MB<br>
&gt; (XEN) Brought up 4 CPUs<br>
&gt; (XEN) *** LOADING DOMAIN 0 ***<br>
&gt; (XEN) =A0Xen =A0kernel: 64-bit, lsb, compat32<br>
&gt; (XEN) =A0Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -&gt; 0x1e1300=
0<br>
&gt; (XEN) PHYSICAL MEMORY ARRANGEMENT:<br>
&gt; (XEN) =A0Dom0 alloc.: =A0 0000000418000000-&gt;000000041c000000 (40465=
67 pages to be allocated)<br>
&gt; (XEN) =A0Init. ramdisk: 000000042b335000-&gt;000000042dfffc00<br>
&gt; (XEN) VIRTUAL MEMORY ARRANGEMENT:<br>
&gt; (XEN) =A0Loaded kernel: ffffffff81000000-&gt;ffffffff81e13000<br>
&gt; (XEN) =A0Init. ramdisk: ffffffff81e13000-&gt;ffffffff84addc00<br>
&gt; (XEN) =A0Phys-Mach map: ffffffff84ade000-&gt;ffffffff869f3d90<br>
&gt; (XEN) =A0Start info: =A0 =A0ffffffff869f4000-&gt;ffffffff869f44b4<br>
&gt; (XEN) =A0Page tables: =A0 ffffffff869f5000-&gt;ffffffff86a2e000<br>
&gt; (XEN) =A0Boot stack: =A0 =A0ffffffff86a2e000-&gt;ffffffff86a2f000<br>
&gt; (XEN) =A0TOTAL: =A0 =A0 =A0 =A0 ffffffff80000000-&gt;ffffffff86c00000<=
br>
&gt; (XEN) =A0ENTRY ADDRESS: ffffffff8188e200<br>
&gt; (XEN) Dom0 has maximum 4 VCPUs<br>
&gt; (XEN) Scrubbing Free RAM: .done.<br>
&gt; (XEN) Xen trace buffers: disabled<br>
&gt; (XEN) Std. Loglevel: Errors and warnings<br>
&gt; (XEN) Guest Loglevel: Nothing (Rate-limited: Errors and warnings)<br>
&gt; (XEN) *** Serial input -&gt; DOM0 (type &#39;CTRL-a&#39; three times t=
o switch input to Xen)<br>
&gt; (XEN) Freed 216kB init memory.<br>
&gt; (XEN) no cpu_id for acpi_id 5<br>
&gt; (XEN) no cpu_id for acpi_id 6<br>
&gt; (XEN) no cpu_id for acpi_id 7<br>
&gt; (XEN) no cpu_id for acpi_id 8<br>
&gt; (XEN) physdev.c:171: dom0: wrong map_pirq type 3<br>
&gt; (XEN) traps.c:2488:d1 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc9000057b030.<br>
&gt; (XEN) traps.c:2488:d1 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc90000718030.<br>
&gt; (XEN) traps.c:2488:d2 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc900004f2030.<br>
&gt; (XEN) traps.c:2488:d2 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc900004fa030.<br>
&gt; (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc90000251030.<br>
&gt; (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc90000263030.<br>
&gt; (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc9000026b030.<br>
&gt; (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc90000273030.<br>
&gt; (XEN) traps.c:2488:d4 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc900004f2030.<br>
&gt; (XEN) traps.c:2488:d4 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc90000015030.<br>
&gt; (XEN) traps.c:2488:d5 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc900004f2030.<br>
&gt; (XEN) traps.c:2488:d5 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc90000015030.<br>
&gt; (XEN) traps.c:2488:d6 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc900004f2030.<br>
&gt; (XEN) traps.c:2488:d6 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc900004fa030.<br>
&gt; (XEN) Disabling non-boot CPUs ...<br>
&gt; (XEN) Broke affinity for irq 1<br>
&gt; (XEN) Broke affinity for irq 8<br>
&gt; (XEN) Broke affinity for irq 9<br>
&gt; (XEN) Broke affinity for irq 12<br>
&gt; (XEN) Broke affinity for irq 17<br>
&gt; (XEN) Broke affinity for irq 31<br>
&gt; (XEN) Broke affinity for irq 16<br>
&gt; (XEN) Broke affinity for irq 20<br>
&gt; (XEN) Entering ACPI S3 state.<br>
&gt; (XEN) mce_intel.c:1162: MCA Capability: BCAST 1 SER 0 CMCI 1 firstbank=
 0 extended MCE MSR 0<br>
&gt; (XEN) CPU0 CMCI LVT vector (0xf7) already installed<br>
&gt; (XEN) CPU0: Thermal LVT vector (0xfa) already installed<br>
&gt; (XEN) Finishing wakeup from ACPI S3 state.<br>
&gt; (XEN) Enabling non-boot CPUs =A0...<br>
&gt; (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc90000524030.<br>
&gt; (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc9000052c030.<br>
&gt; (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc90000015030.<br>
&gt; (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc9000001d030.<br>
&gt; (XEN) Dumping timer queues:<br>
&gt; (XEN) CPU00:<br>
&gt; (XEN) =A0 ex=3D =A0 =A0 126us timer=3Dffff8300c83b0060 cb=3Dffff82c480=
11e420(ffff8300c83b0000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 =A01778us timer=3Dffff8304222f9de8 cb=3Dffff82c480=
118250(0000000000000000) csched_tick+0x0/0x2e0<br>
&gt; (XEN) =A0 ex=3D =A0 =A0 126us timer=3Dffff8300c81fc060 cb=3Dffff82c480=
11e420(ffff8300c81fc000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 17227us timer=3Dffff82c4802bb980 cb=3Dffff82c48013=
8ff0(ffff82c4802bb940) do_dbs_timer+0x0/0x250<br>
&gt; (XEN) =A0 ex=3D =A0 20744us timer=3Dffff830030094060 cb=3Dffff82c48011=
e420(ffff830030094000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 27945us timer=3Dffff8304222fdde0 cb=3Dffff82c48011=
6f20(ffff8304222fddc0) csched_acct+0x0/0x460<br>
&gt; (XEN) =A0 ex=3D =A0 29949us timer=3Dffff82c4802bb760 cb=3Dffff82c48011=
ded0(0000000000000000) s_timer_fn+0x0/0x20<br>
&gt; (XEN) =A0 ex=3D =A0 87774us timer=3Dffff83008db6a060 cb=3Dffff82c48011=
e420(ffff83008db6a000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 79252us timer=3Dffff82c4802b3880 cb=3Dffff82c48017=
7160(0000000000000000) time_calibration+0x0/0x60<br>
&gt; (XEN) =A0 ex=3D =A0703146us timer=3Dffff8300a6b9c060 cb=3Dffff82c48011=
e420(ffff8300a6b9c000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 35612us timer=3Dffff8300330dc060 cb=3Dffff82c48011=
e420(ffff8300330dc000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 97688us timer=3Dffff8300a6b98060 cb=3Dffff82c48011=
e420(ffff8300a6b98000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 30003us timer=3Dffff8300b129a060 cb=3Dffff82c48011=
e420(ffff8300b129a000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 92679us timer=3Dffff8300c94a6060 cb=3Dffff82c48011=
e420(ffff8300c94a6000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D 4135118us timer=3Dffff8300bdca6060 cb=3Dffff82c48011e4=
20(ffff8300bdca6000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 96411us timer=3Dffff8300b128e060 cb=3Dffff82c48011=
e420(ffff8300b128e000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D 1337866us timer=3Dffff8300a6b94060 cb=3Dffff82c48011e4=
20(ffff8300a6b94000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 91194us timer=3Dffff830034b98060 cb=3Dffff82c48011=
e420(ffff830034b98000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 97955us timer=3Dffff83007d948060 cb=3Dffff82c48011=
e420(ffff83007d948000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D 4135163us timer=3Dffff8300c5336060 cb=3Dffff82c48011e4=
20(ffff8300c5336000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D123464409us timer=3Dffff82c4802b3980 cb=3Dffff82c480176=
ef0(0000000000000000) plt_overflow+0x0/0x190<br>
&gt; (XEN) =A0 ex=3D =A0 95968us timer=3Dffff8300a6b96060 cb=3Dffff82c48011=
e420(ffff8300a6b96000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D12401701us timer=3Dffff82c4802b65a0 cb=3Dffff82c48019eb=
10(0000000000000000) mce_work_fn+0x0/0xd0<br>
&gt; (XEN) =A0 ex=3D =A0 97804us timer=3Dffff8300301a8060 cb=3Dffff82c48011=
e420(ffff8300301a8000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 97841us timer=3Dffff8300bd810060 cb=3Dffff82c48011=
e420(ffff8300bd810000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 98039us timer=3Dffff83007d94c060 cb=3Dffff82c48011=
e420(ffff83007d94c000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 94727us timer=3Dffff83008db6e060 cb=3Dffff82c48011=
e420(ffff83008db6e000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0319927us timer=3Dffff8300c840c060 cb=3Dffff82c48011=
e420(ffff8300c840c000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) CPU01:<br>
&gt; (XEN) CPU02:<br>
&gt; (XEN) CPU03:<br>
&gt; (XEN) &#39;c&#39; pressed -&gt; printing ACPI Cx structures<br>
&gt; (XEN) =3D=3Dcpu0=3D=3D<br>
&gt; (XEN) active state: =A0 =A0 =A0 =A0 =A0 C3<br>
&gt; (XEN) max_cstate: =A0 =A0 =A0 =A0 =A0 =A0 C7<br>
&gt; (XEN) states:<br>
&gt; (XEN) =A0 =A0 C1: type[C1] latency[000] usage[00254665] method[ HALT] =
duration[62720099833]<br>
&gt; (XEN) =A0 =A0 C2: type[C2] latency[080] usage[00069505] method[SYSIO] =
duration[36499255195]<br>
&gt; (XEN) =A0 =A0*C3: type[C3] latency[109] usage[01828952] method[SYSIO] =
duration[5562126933174]<br>
&gt; (XEN) =A0 =A0 C0: usage[02153122] duration[2042526389598]<br>
&gt; (XEN) PC3[0] PC6[0] PC7[0]<br>
&gt; (XEN) CC3[0] CC6[0]<br>
&gt; (XEN) =3D=3Dcpu1=3D=3D<br>
&gt; (XEN) active state: =A0 =A0 =A0 =A0 =A0 C1<br>
&gt; (XEN) max_cstate: =A0 =A0 =A0 =A0 =A0 =A0 C7<br>
&gt; (XEN) states:<br>
&gt; (XEN) =A0 =A0*C1: type[C1] latency[000] usage[00808027] method[ HALT] =
duration[6978799306750]<br>
&gt; (XEN) =A0 =A0 C0: usage[00808027] duration[725073398104]<br>
&gt; (XEN) PC3[0] PC6[0] PC7[0]<br>
&gt; (XEN) CC3[0] CC6[0]<br>
&gt; (XEN) =3D=3Dcpu2=3D=3D<br>
&gt; (XEN) active state: =A0 =A0 =A0 =A0 =A0 C1<br>
&gt; (XEN) max_cstate: =A0 =A0 =A0 =A0 =A0 =A0 C7<br>
&gt; (XEN) states:<br>
&gt; (XEN) =A0 =A0*C1: type[C1] latency[000] usage[00825022] method[ HALT] =
duration[6981527416097]<br>
&gt; (XEN) =A0 =A0 C0: usage[00825022] duration[722345319882]<br>
&gt; (XEN) PC3[0] PC6[0] PC7[0]<br>
&gt; (XEN) CC3[0] CC6[0]<br>
&gt; (XEN) =3D=3Dcpu3=3D=3D<br>
&gt; (XEN) active state: =A0 =A0 =A0 =A0 =A0 C1<br>
&gt; (XEN) max_cstate: =A0 =A0 =A0 =A0 =A0 =A0 C7<br>
&gt; (XEN) states:<br>
&gt; (XEN) =A0 =A0*C1: type[C1] latency[000] usage[00810292] method[ HALT] =
duration[6980835907857]<br>
&gt; (XEN) =A0 =A0 C0: usage[00810292] duration[723036844779]<br>
&gt; (XEN) PC3[0] PC6[0] PC7[0]<br>
&gt; (XEN) CC3[0] CC6[0]<br>
<div class=3D"HOEnZb"><div class=3D"h5"><br>
<br>
<br>
<br>
&gt; _______________________________________________<br>
&gt; Xen-devel mailing list<br>
&gt; <a href=3D"mailto:Xen-devel@lists.xen.org">Xen-devel@lists.xen.org</a>=
<br>
&gt; <a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://li=
sts.xen.org/xen-devel</a><br>
<br>
</div></div></blockquote></div><br></div>

--e89a8f3b9d3d4a9abe04cfbdb242--


--===============3744638461939860863==
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.xen.org
http://lists.xen.org/xen-devel

--===============3744638461939860863==--


From xen-devel-bounces@lists.xen.org Fri Nov 30 22:13:09 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 22:13:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeYpF-00013T-2q; Fri, 30 Nov 2012 22:12:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ben.guthro@gmail.com>) id 1TeYpB-00013M-TJ
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 22:12:46 +0000
Received: from [85.158.143.35:6637] by server-1.bemta-4.messagelabs.com id
	D6/3C-27934-D5F29B05; Fri, 30 Nov 2012 22:12:45 +0000
X-Env-Sender: ben.guthro@gmail.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1354313554!5291115!1
X-Originating-IP: [209.85.210.169]
X-SpamReason: No, hits=1.7 required=7.0 tests=BODY_RANDOM_LONG,
	HTML_10_20,HTML_MESSAGE,RCVD_BY_IP
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11830 invoked from network); 30 Nov 2012 22:12:36 -0000
Received: from mail-ia0-f169.google.com (HELO mail-ia0-f169.google.com)
	(209.85.210.169)
	by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 22:12:36 -0000
Received: by mail-ia0-f169.google.com with SMTP id r4so690537iaj.28
	for <xen-devel@lists.xen.org>; Fri, 30 Nov 2012 14:12:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=hMY2ti0Zwbiv55FxQkZZqfX5utBgmYbszxzrTlemIkk=;
	b=OH8ZzKpgTbrIyEA9HHtJNAh+69ce3aSBZ/yBnPO5s+nZnRgC/RSccEGYVhEzukyJZ6
	JZTlFpMI3vMFukcIRFilttOdBl6hqkzc18ZTtpp4cd5hi6phVVRAHDm4GIKTLavT/yJR
	Y7z3Xlrwb3wZcPDhh/lE1VYaTqNYKKTHqviQ2bCOf8/hXF8DosEMSOwFhOGPOW4fuioF
	6cM9MQU9z9ArZqBiYeXM4csWFtbR1JJe9/fuyjzvbaPB67Aesbe6hdqTToK6NkZvhMAN
	vHEtLyBQu03axpdQ2t8+s/AbZHNGakjn7JvnAVAlFpnUtNtaaFqG+IXZdOMbD2Jo5njh
	eKew==
MIME-Version: 1.0
Received: by 10.50.91.168 with SMTP id cf8mr13823igb.20.1354313553844; Fri, 30
	Nov 2012 14:12:33 -0800 (PST)
Received: by 10.231.17.13 with HTTP; Fri, 30 Nov 2012 14:12:33 -0800 (PST)
In-Reply-To: <20121130213345.GA4715@phenom.dumpdata.com>
References: <50B7AF8A.5010304@invisiblethingslab.com>
	<20121130213345.GA4715@phenom.dumpdata.com>
Date: Fri, 30 Nov 2012 17:12:33 -0500
X-Google-Sender-Auth: zGxg0Q97PiVhb149uShtEAzEvw0
Message-ID: <CAOvdn6VcR7i815jWac7ZcEZYAbB6an_Qz87=0jw+yohCtVsDhQ@mail.gmail.com>
From: Ben Guthro <ben@guthro.net>
To: Konrad Rzeszutek Wilk <konrad@kernel.org>
Cc: Marek Marczykowski <marmarek@invisiblethingslab.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Only CPU0 active after ACPI S3, xen 4.1.3
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============3744638461939860863=="
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

--===============3744638461939860863==
Content-Type: multipart/alternative; boundary=e89a8f3b9d3d4a9abe04cfbdb242

--e89a8f3b9d3d4a9abe04cfbdb242
Content-Type: text/plain; charset=ISO-8859-1

I had similar, but (I think) different issues.

See the following thread:
http://markmail.org/search/?q=e4a31205766d518276d0fbc1780bcd63db1a502d#query:e4a31205766d518276d0fbc1780bcd63db1a502d+page:1+mid:udkd2qcvtyqj75re+state:results

I still have a patch reverting part of this changeset to get S3 working
with pinning CPU affinity... the affinity doesn't get restored on resume,
however.

I don't have much experience with this on Xen 4.1, as I ran into the issue
when bringing up Xen-4.2, from Xen 4.0

However, I could see how this could be related, since it is in the
scheduler...

On Fri, Nov 30, 2012 at 4:33 PM, Konrad Rzeszutek Wilk <konrad@kernel.org>wrote:

> On Thu, Nov 29, 2012 at 07:55:06PM +0100, Marek Marczykowski wrote:
> > Hi all,
> >
> > After resume from ACPI S3 system has only CPU0 enabled, every vCPU from
> every
> > domain works on CPU0 [1].  When trying to pin some vCPU to CPU1 got
> error:
> > xl vcpu-pin testvm 1 1
> > libxl: error: libxl.c:2565:libxl_set_vcpuaffinity setting vcpu affinity:
> > Invalid argument
> >
> > What went wrong? How can I reenable CPU1-CPU3?
>
> I think Ben had found some issues with this in the past? CC-ing him
> here.
> >
> > System info:
> > xen 4.1.3
> > linux 3.4.18 with acpi-s3 patches from Konrad's git
> > Processor: Intel i5-2520M
> >
> > dmesg from dom0 and hypervisor attached.
> >
> > BTW Are there any plans to upstream acpi-s3 patches?
> >
> > [1] xl vcpu-list:
> > Name                                ID  VCPU   CPU State   Time(s) CPU
> Affinity
> > dom0                                 0     0    0   r--    1347.8  any
> cpu
> > dom0                                 0     1    0   -b-     594.4  any
> cpu
> > dom0                                 0     2    0   -b-     421.1  any
> cpu
> > dom0                                 0     3    0   -b-     432.6  any
> cpu
> > netvm                                1     0    0   -b-     596.6  any
> cpu
> > netvm                                1     1    0   -b-     363.7  any
> cpu
> > firewallvm                           2     0    0   -b-     170.5  any
> cpu
> > firewallvm                           2     1    0   -b-     122.5  any
> cpu
> > devel17                              3     0    0   -b-     137.0  any
> cpu
> > devel17                              3     1    0   -b-     112.9  any
> cpu
> > devel17                              3     2    0   -b-      97.9  any
> cpu
> > devel17                              3     3    0   -b-     116.0  any
> cpu
> > vm2                                  4     0    0   -b-     418.6  any
> cpu
> > vm2                                  4     1    0   -b-     390.2  any
> cpu
> > private                              5     0    0   -b-     175.9  any
> cpu
> > private                              5     1    0   -b-     161.6  any
> cpu
> > mail                                 6     0    0   -b-    1587.1  any
> cpu
> > mail                                 6     1    0   -b-    1717.5  any
> cpu
> > testvm                               7     0    0   -b-      73.0  any
> cpu
> > testvm                               7     1    0   -b-      68.9  any
> cpu
> > testvm                               7     2    0   -b-      51.4  any
> cpu
> > testvm                               7     3    0   -b-      67.1  any
> cpu
> > disp1                                8     0    0   -b-     199.9  any
> cpu
> >
> >
> > --
> > Best Regards / Pozdrawiam,
> > Marek Marczykowski
> > Invisible Things Lab
>
> > [    0.000000] Initializing cgroup subsys cpuset
> > [    0.000000] Initializing cgroup subsys cpu
> > [    0.000000] Linux version 3.4.18-2.pvops.qubes.x86_64 (
> user@nemezis.marmarek.net) (gcc version 4.4.5 20101112 (Red Hat 4.4.5-2)
> (GCC) ) #1 SMP Wed Nov 7 22:47:21 EST 2012
> > [    0.000000] Command line: ro root=/dev/mapper/vg_dom0-lv_root
> rd_LUKS_UUID=luks-400336fa-c7c4-4be3-a244-c909aa16a18c
> rd_LVM_LV=vg_dom0/lv_root rd_LVM_LV=vg_dom0/lv_swap rd_NO_MD rd_NO_DM
> LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=pl2 rhgb quiet
> max_loop=255
> > [    0.000000] Freeing  9a-100 pfn range: 102 pages freed
> > [    0.000000] 1-1 mapping on 9a->100
> > [    0.000000] Freeing  7eea-7f67 pfn range: 125 pages freed
> > [    0.000000] 1-1 mapping on 7eea->7f67
> > [    0.000000] Freeing  7f70-7f76 pfn range: 6 pages freed
> > [    0.000000] 1-1 mapping on 7f70->7f76
> > [    0.000000] Freeing  7f78-8000 pfn range: 136 pages freed
> > [    0.000000] 1-1 mapping on 7f78->8000
> > [    0.000000] Freeing  dffd-e000 pfn range: 3 pages freed
> > [    0.000000] 1-1 mapping on dffd->e000
> > [    0.000000] Freeing  20000-20200 pfn range: 512 pages freed
> > [    0.000000] 1-1 mapping on 20000->20200
> > [    0.000000] Freeing  40000-40200 pfn range: 512 pages freed
> > [    0.000000] 1-1 mapping on 40000->40200
> > [    0.000000] Freeing  c83b4-c840a pfn range: 86 pages freed
> > [    0.000000] 1-1 mapping on c83b4->c840a
> > [    0.000000] Freeing  c840e-c840f pfn range: 1 pages freed
> > [    0.000000] 1-1 mapping on c840e->c840f
> > [    0.000000] Freeing  c8411-c8414 pfn range: 3 pages freed
> > [    0.000000] 1-1 mapping on c8411->c8414
> > [    0.000000] Freeing  c841e-c8428 pfn range: 10 pages freed
> > [    0.000000] 1-1 mapping on c841e->c8428
> > [    0.000000] Freeing  c8432-c8436 pfn range: 4 pages freed
> > [    0.000000] 1-1 mapping on c8432->c8436
> > [    0.000000] Freeing  cac00-100000 pfn range: 218112 pages freed
> > [    0.000000] 1-1 mapping on cac00->100000
> > [    0.000000] Released 219612 pages of unused memory
> > [    0.000000] Set 219612 page(s) to 1-1 mapping
> > [    0.000000] BIOS-provided physical RAM map:
> > [    0.000000]  Xen: 0000000000000000 - 000000000009a000 (usable)
> > [    0.000000]  Xen: 000000000009a800 - 0000000000100000 (reserved)
> > [    0.000000]  Xen: 0000000000100000 - 0000000007eea000 (usable)
> > [    0.000000]  Xen: 0000000007eea000 - 0000000007f67000 (ACPI NVS)
> > [    0.000000]  Xen: 0000000007f67000 - 0000000007f70000 (usable)
> > [    0.000000]  Xen: 0000000007f70000 - 0000000007f76000 (ACPI NVS)
> > [    0.000000]  Xen: 0000000007f76000 - 0000000007f78000 (usable)
> > [    0.000000]  Xen: 0000000007f78000 - 0000000008000000 (ACPI NVS)
> > [    0.000000]  Xen: 0000000008000000 - 000000000dffd000 (usable)
> > [    0.000000]  Xen: 000000000dffd000 - 000000000e000000 (ACPI data)
> > [    0.000000]  Xen: 000000000e000000 - 0000000020000000 (usable)
> > [    0.000000]  Xen: 0000000020000000 - 0000000020200000 (reserved)
> > [    0.000000]  Xen: 0000000020200000 - 0000000040000000 (usable)
> > [    0.000000]  Xen: 0000000040000000 - 0000000040200000 (reserved)
> > [    0.000000]  Xen: 0000000040200000 - 00000000c83b4000 (usable)
> > [    0.000000]  Xen: 00000000c83b4000 - 00000000c840a000 (reserved)
> > [    0.000000]  Xen: 00000000c840a000 - 00000000c840e000 (usable)
> > [    0.000000]  Xen: 00000000c840e000 - 00000000c840f000 (reserved)
> > [    0.000000]  Xen: 00000000c840f000 - 00000000c8411000 (usable)
> > [    0.000000]  Xen: 00000000c8411000 - 00000000c8414000 (reserved)
> > [    0.000000]  Xen: 00000000c8414000 - 00000000c841e000 (usable)
> > [    0.000000]  Xen: 00000000c841e000 - 00000000c8428000 (reserved)
> > [    0.000000]  Xen: 00000000c8428000 - 00000000c8432000 (usable)
> > [    0.000000]  Xen: 00000000c8432000 - 00000000c8436000 (reserved)
> > [    0.000000]  Xen: 00000000c8436000 - 00000000cac00000 (usable)
> > [    0.000000]  Xen: 00000000cb800000 - 00000000cfa00000 (reserved)
> > [    0.000000]  Xen: 00000000fec00000 - 00000000fec01000 (reserved)
> > [    0.000000]  Xen: 00000000fed1c000 - 00000000fed20000 (reserved)
> > [    0.000000]  Xen: 00000000fee00000 - 00000000fee01000 (reserved)
> > [    0.000000]  Xen: 00000000ffc00000 - 00000000ffc20000 (reserved)
> > [    0.000000]  Xen: 0000000100000000 - 000000042e000000 (usable)
> > [    0.000000] NX (Execute Disable) protection: active
> > [    0.000000] DMI 2.6 present.
> > [    0.000000] DMI: Dell Inc. Latitude E6420/0K0DNP, BIOS A13 05/17/2012
> > [    0.000000] e820 update range: 0000000000000000 - 0000000000010000
> (usable) ==> (reserved)
> > [    0.000000] e820 remove range: 00000000000a0000 - 0000000000100000
> (usable)
> > [    0.000000] No AGP bridge found
> > [    0.000000] last_pfn = 0x42e000 max_arch_pfn = 0x400000000
> > [    0.000000] x2apic enabled by BIOS, switching to x2apic ops
> > [    0.000000] last_pfn = 0xcac00 max_arch_pfn = 0x400000000
> > [    0.000000] found SMP MP-table at [ffff8800000f1ad0] f1ad0
> > [    0.000000] initial memory mapped : 0 - 04ade000
> > [    0.000000] Base memory trampoline at [ffff880000095000] 95000 size
> 20480
> > [    0.000000] init_memory_mapping: 0000000000000000-00000000cac00000
> > [    0.000000]  0000000000 - 00cac00000 page 4k
> > [    0.000000] kernel direct mapping tables up to 0xcabfffff @ [mem
> 0x009a5000-0x00ffffff]
> > [    0.000000] xen: setting RW the range fc4000 - 1000000
> > [    0.000000] init_memory_mapping: 0000000100000000-000000042e000000
> > [    0.000000]  0100000000 - 042e000000 page 4k
> > [    0.000000] kernel direct mapping tables up to 0x42dffffff @ [mem
> 0xc9282000-0xcabfffff]
> > [    0.000000] xen: setting RW the range cabff000 - cac00000
> > [    0.000000] RAMDISK: 01e13000 - 04ade000
> > [    0.000000] ACPI: RSDP 00000000000fe300 00024 (v02 DELL  )
> > [    0.000000] ACPI: XSDT 000000000dffee18 0007C (v01 DELL    CBX3
>  06222004 MSFT 00010013)
> > [    0.000000] ACPI: FACP 0000000007f90d98 000F4 (v04 DELL    CBX3
>  06222004 MSFT 00010013)
> > [    0.000000] ACPI Warning: 32/64 FACS address mismatch in FADT - two
> FACS tables! (20120320/tbfadt-378)
> > [    0.000000] ACPI Warning: 32/64X FACS address mismatch in FADT -
> 0x07FEDE40/0x0000000007FEDD40, using 32 (20120320/tbfadt-502)
> > [    0.000000] ACPI: DSDT 0000000007f5e018 08834 (v02 INT430 SYSFexxx
> 00001001 INTL 20090903)
> > [    0.000000] ACPI: FACS 0000000007fede40 00040
> > [    0.000000] ACPI: APIC 000000000dffdf18 000CC (v02 DELL    CBX3
>  06222004 MSFT 00010013)
> > [    0.000000] ACPI: TCPA 0000000007feed18 00032 (v02
> 00000000      00000000)
> > [    0.000000] ACPI: SSDT 0000000007f91a98 002F9 (v01 DELLTP      TPM
> 00003000 INTL 20090903)
> > [    0.000000] ACPI: MCFG 0000000007feec98 0003C (v01 DELL   SNDYBRDG
> 06222004 MSFT 00000097)
> > [    0.000000] ACPI: HPET 0000000007feec18 00038 (v01 A M I   PCHHPET
> 06222004 AMI. 00000003)
> > [    0.000000] ACPI: BOOT 0000000007feeb98 00028 (v01 DELL   CBX3
> 06222004 AMI  00010013)
> > [    0.000000] ACPI: SSDT 0000000007f75018 00804 (v01  PmRef  Cpu0Ist
> 00003000 INTL 20090903)
> > [    0.000000] ACPI: SSDT 0000000007f74018 00996 (v01  PmRef    CpuPm
> 00003000 INTL 20090903)
> > [    0.000000] ACPI: XMAR 0000000007f90c18 000E8 (v01 INTEL      SNB
>  00000001 INTL 00000001)
> > [    0.000000] ACPI: SLIC 0000000007f7ec18 00176 (v03 DELL    CBX3
>  06222004 MSFT 00010013)
> > [    0.000000] ACPI: Local APIC address 0xfee00000
> > [    0.000000] Setting APIC routing to cluster x2apic.
> > [    0.000000] Zone PFN ranges:
> > [    0.000000]   DMA      0x00000010 -> 0x00001000
> > [    0.000000]   DMA32    0x00001000 -> 0x00100000
> > [    0.000000]   Normal   0x00100000 -> 0x0042e000
> > [    0.000000] Movable zone start PFN for each node
> > [    0.000000] Early memory PFN ranges
> > [    0.000000]     0: 0x00000010 -> 0x0000009a
> > [    0.000000]     0: 0x00000100 -> 0x00007eea
> > [    0.000000]     0: 0x00007f67 -> 0x00007f70
> > [    0.000000]     0: 0x00007f76 -> 0x00007f78
> > [    0.000000]     0: 0x00008000 -> 0x0000dffd
> > [    0.000000]     0: 0x0000e000 -> 0x00020000
> > [    0.000000]     0: 0x00020200 -> 0x00040000
> > [    0.000000]     0: 0x00040200 -> 0x000c83b4
> > [    0.000000]     0: 0x000c840a -> 0x000c840e
> > [    0.000000]     0: 0x000c840f -> 0x000c8411
> > [    0.000000]     0: 0x000c8414 -> 0x000c841e
> > [    0.000000]     0: 0x000c8428 -> 0x000c8432
> > [    0.000000]     0: 0x000c8436 -> 0x000cac00
> > [    0.000000]     0: 0x00100000 -> 0x0042e000
> > [    0.000000] On node 0 totalpages: 4163092
> > [    0.000000]   DMA zone: 56 pages used for memmap
> > [    0.000000]   DMA zone: 1572 pages reserved
> > [    0.000000]   DMA zone: 2350 pages, LIFO batch:0
> > [    0.000000]   DMA32 zone: 14280 pages used for memmap
> > [    0.000000]   DMA32 zone: 810690 pages, LIFO batch:31
> > [    0.000000]   Normal zone: 45584 pages used for memmap
> > [    0.000000]   Normal zone: 3288560 pages, LIFO batch:31
> > [    0.000000] ACPI: PM-Timer IO Port: 0x408
> > [    0.000000] ACPI: Local APIC address 0xfee00000
> > [    0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x02] enabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x03] lapic_id[0x01] enabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x05] lapic_id[0x04] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x06] lapic_id[0x05] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x07] lapic_id[0x06] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x08] lapic_id[0x07] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x09] lapic_id[0x08] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x0a] lapic_id[0x09] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x0b] lapic_id[0x0a] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x0c] lapic_id[0x0b] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x0d] lapic_id[0x0c] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x0e] lapic_id[0x0d] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x0f] lapic_id[0x0e] disabled)
> > [    0.000000] ACPI: LAPIC (acpi_id[0x10] lapic_id[0x0f] disabled)
> > [    0.000000] ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])
> > [    0.000000] IOAPIC[0]: apic_id 2, version 253, address 0xfec00000,
> GSI 0-253
> > [    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
> > [    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high
> level)
> > [    0.000000] ACPI: IRQ0 used by override.
> > [    0.000000] ACPI: IRQ2 used by override.
> > [    0.000000] ACPI: IRQ9 used by override.
> > [    0.000000] Using ACPI (MADT) for SMP configuration information
> > [    0.000000] ACPI: HPET id: 0x8086a701 base: 0xfed00000
> > [    0.000000] SMP: Allowing 16 CPUs, 12 hotplug CPUs
> > [    0.000000] nr_irqs_gsi: 270
> > [    0.000000] Allocating PCI resources starting at cfa00000 (gap:
> cfa00000:2f200000)
> > [    0.000000] Booting paravirtualized kernel on Xen
> > [    0.000000] Xen version: 4.1.3 (preserve-AD)
> > [    0.000000] setup_percpu: NR_CPUS:512 nr_cpumask_bits:512
> nr_cpu_ids:16 nr_node_ids:1
> > [    0.000000] PERCPU: Embedded 28 pages/cpu @ffff8803e2800000 s82176
> r8192 d24320 u131072
> > [    0.000000] pcpu-alloc: s82176 r8192 d24320 u131072 alloc=1*2097152
> > [    0.000000] pcpu-alloc: [0] 00 01 02 03 04 05 06 07 08 09 10 11 12 13
> 14 15
> > [    4.119805] Built 1 zonelists in Zone order, mobility grouping on.
>  Total pages: 4101600
> > [    4.119809] Kernel command line: ro root=/dev/mapper/vg_dom0-lv_root
> rd_LUKS_UUID=luks-400336fa-c7c4-4be3-a244-c909aa16a18c
> rd_LVM_LV=vg_dom0/lv_root rd_LVM_LV=vg_dom0/lv_swap rd_NO_MD rd_NO_DM
> LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=pl2 rhgb quiet
> max_loop=255
> > [    4.119915] PID hash table entries: 4096 (order: 3, 32768 bytes)
> > [    4.120928] Dentry cache hash table entries: 2097152 (order: 12,
> 16777216 bytes)
> > [    4.124018] Inode-cache hash table entries: 1048576 (order: 11,
> 8388608 bytes)
> > [    4.147064] Placing 64MB software IO TLB between ffff8803ce200000 -
> ffff8803d2200000
> > [    4.147066] software IO TLB at phys 0x3ce200000 - 0x3d2200000
> > [    4.181675] Memory: 14975940k/17530880k available (4557k kernel code,
> 878512k absent, 1676428k reserved, 4112k data, 552k init)
> > [    4.181730] Hierarchical RCU implementation.
> > [    4.181731]        RCU dyntick-idle grace-period acceleration is
> enabled.
> > [    4.181738] NR_IRQS:33024 nr_irqs:1024 16
> > [    4.181799] xen: sci override: global_irq=9 trigger=0 polarity=0
> > [    4.181801] xen: registering gsi 9 triggering 0 polarity 0
> > [    4.181809] xen: --> pirq=9 -> irq=9 (gsi=9)
> > [    4.181829] xen: acpi sci 9
> > [    4.181831] xen: --> pirq=1 -> irq=1 (gsi=1)
> > [    4.181834] xen: --> pirq=2 -> irq=2 (gsi=2)
> > [    4.181836] xen: --> pirq=3 -> irq=3 (gsi=3)
> > [    4.181838] xen: --> pirq=4 -> irq=4 (gsi=4)
> > [    4.181840] xen: --> pirq=5 -> irq=5 (gsi=5)
> > [    4.181843] xen: --> pirq=6 -> irq=6 (gsi=6)
> > [    4.181845] xen: --> pirq=7 -> irq=7 (gsi=7)
> > [    4.181847] xen: --> pirq=8 -> irq=8 (gsi=8)
> > [    4.181849] xen: --> pirq=10 -> irq=10 (gsi=10)
> > [    4.181851] xen: --> pirq=11 -> irq=11 (gsi=11)
> > [    4.181854] xen: --> pirq=12 -> irq=12 (gsi=12)
> > [    4.181856] xen: --> pirq=13 -> irq=13 (gsi=13)
> > [    4.181858] xen: --> pirq=14 -> irq=14 (gsi=14)
> > [    4.181860] xen: --> pirq=15 -> irq=15 (gsi=15)
> > [    4.182986] Console: colour VGA+ 80x25
> > [    4.183012] console [tty0] enabled
> > [    4.183026] Xen: using vcpuop timer interface
> > [    4.183030] installing Xen timer for CPU 0
> > [    4.183048] Detected 2494.416 MHz processor.
> > [    4.183052] Calibrating delay loop (skipped), value calculated using
> timer frequency.. 4988.83 BogoMIPS (lpj=9977664)
> > [    4.183054] pid_max: default: 32768 minimum: 301
> > [    4.183090] Mount-cache hash table entries: 256
> > [    4.183222] Initializing cgroup subsys cpuacct
> > [    4.183224] Initializing cgroup subsys devices
> > [    4.183225] Initializing cgroup subsys freezer
> > [    4.183227] Initializing cgroup subsys net_cls
> > [    4.183228] Initializing cgroup subsys blkio
> > [    4.183280] ENERGY_PERF_BIAS: Set to 'normal', was 'performance'
> > [    4.183281] ENERGY_PERF_BIAS: View and update with
> x86_energy_perf_policy(8)
> > [    4.183284] CPU: Physical Processor ID: 0
> > [    4.183285] CPU: Processor Core ID: 0
> > [    4.184454] ACPI: Core revision 20120320
> > [    4.194658] Performance Events: unsupported p6 CPU model 42 no PMU
> driver, software events only.
> > [    4.194796] installing Xen timer for CPU 1
> > [    4.194988] installing Xen timer for CPU 2
> > [    4.195140] installing Xen timer for CPU 3
> > [    4.195232] Brought up 4 CPUs
> > [    4.195477] devtmpfs: initialized
> > [    4.199046] PM: Registering ACPI NVS region [mem
> 0x07eea000-0x07f66fff] (512000 bytes)
> > [    4.199056] PM: Registering ACPI NVS region [mem
> 0x07f70000-0x07f75fff] (24576 bytes)
> > [    4.199058] PM: Registering ACPI NVS region [mem
> 0x07f78000-0x07ffffff] (557056 bytes)
> > [    4.199069] Dell Latitude E6420 series board detected. Selecting
> PCI-method for reboots.
> > [    4.199104] Grant tables using version 2 layout.
> > [    4.199114] Grant table initialized
> > [    4.199158] dummy:
> > [    4.199205] RTC time:  1:19:35, date: 11/29/12
> > [    4.199256] NET: Registered protocol family 16
> > [    4.199465] ACPI FADT declares the system doesn't support PCIe ASPM,
> so disable it
> > [    4.199467] ACPI: bus type pci registered
> > [    4.199548] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem
> 0xf8000000-0xfbffffff] (base 0xf8000000)
> > [    4.199550] PCI: not using MMCONFIG
> > [    4.199552] PCI: Using configuration type 1 for base access
> > [    4.199559] dmi type 0xB1 record - unknown flag
> > [    4.200155] bio: create slab <bio-0> at 0
> > [    4.200279] ACPI: Added _OSI(Module Device)
> > [    4.200280] ACPI: Added _OSI(Processor Device)
> > [    4.200282] ACPI: Added _OSI(3.0 _SCP Extensions)
> > [    4.200283] ACPI: Added _OSI(Processor Aggregator Device)
> > [    4.201815] ACPI: EC: Look up EC in DSDT
> > [    4.206932] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignored
> > [    4.219266] ACPI: SSDT 00000000c8412798 00727 (v01  PmRef  Cpu0Cst
> 00003001 INTL 20090903)
> > [    4.219654] ACPI: Dynamic OEM Table Load:
> > [    4.219657] ACPI: SSDT           (null) 00727 (v01  PmRef  Cpu0Cst
> 00003001 INTL 20090903)
> > [    4.220118] ACPI: SSDT 00000000c8413a98 00303 (v01  PmRef    ApIst
> 00003000 INTL 20090903)
> > [    4.220555] ACPI: Dynamic OEM Table Load:
> > [    4.220558] ACPI: SSDT           (null) 00303 (v01  PmRef    ApIst
> 00003000 INTL 20090903)
> > [    4.220754] ACPI: SSDT 00000000c8411d98 00119 (v01  PmRef    ApCst
> 00003000 INTL 20090903)
> > [    4.221136] ACPI: Dynamic OEM Table Load:
> > [    4.221138] ACPI: SSDT           (null) 00119 (v01  PmRef    ApCst
> 00003000 INTL 20090903)
> > [    4.223275] ACPI: Interpreter enabled
> > [    4.223278] ACPI: (supports S0 S3 S5)
> > [    4.223294] ACPI: Using IOAPIC for interrupt routing
> > [    4.223322] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem
> 0xf8000000-0xfbffffff] (base 0xf8000000)
> > [    4.223846] PCI: MMCONFIG at [mem 0xf8000000-0xfbffffff] reserved in
> ACPI motherboard resources
> > [    4.271283] ACPI: EC: GPE = 0x10, I/O: command/status = 0x934, data =
> 0x930
> > [    4.272424] ACPI: No dock devices found.
> > [    4.272428] PCI: Using host bridge windows from ACPI; if necessary,
> use "pci=nocrs" and report a bug
> > [    4.272988] \_SB_.PCI0:_OSC invalid UUID
> > [    4.272989] _OSC request data:1 8 1f
> > [    4.272992] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-3e])
> > [    4.273994] pci_root PNP0A08:00: host bridge window [io
>  0x0000-0x0cf7]
> > [    4.273996] pci_root PNP0A08:00: host bridge window [io
>  0x0d00-0xffff]
> > [    4.273998] pci_root PNP0A08:00: host bridge window [mem
> 0x000a0000-0x000bffff]
> > [    4.274001] pci_root PNP0A08:00: host bridge window [mem
> 0xcfa00000-0xfeafffff]
> > [    4.274003] pci_root PNP0A08:00: host bridge window [mem
> 0xfed40000-0xfed44fff]
> > [    4.274031] PCI host bridge to bus 0000:00
> > [    4.274033] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7]
> > [    4.274034] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff]
> > [    4.274036] pci_bus 0000:00: root bus resource [mem
> 0x000a0000-0x000bffff]
> > [    4.274038] pci_bus 0000:00: root bus resource [mem
> 0xcfa00000-0xfeafffff]
> > [    4.274040] pci_bus 0000:00: root bus resource [mem
> 0xfed40000-0xfed44fff]
> > [    4.274054] pci 0000:00:00.0: [8086:0104] type 00 class 0x060000
> > [    4.274147] pci 0000:00:02.0: [8086:0126] type 00 class 0x030000
> > [    4.274174] pci 0000:00:02.0: reg 10: [mem 0xe1400000-0xe17fffff
> 64bit]
> > [    4.274189] pci 0000:00:02.0: reg 18: [mem 0xd0000000-0xdfffffff
> 64bit pref]
> > [    4.274200] pci 0000:00:02.0: reg 20: [io  0x4000-0x403f]
> > [    4.274344] pci 0000:00:16.0: [8086:1c3a] type 00 class 0x078000
> > [    4.274394] pci 0000:00:16.0: reg 10: [mem 0xe2eb0000-0xe2eb000f
> 64bit]
> > [    4.274563] pci 0000:00:16.0: PME# supported from D0 D3hot D3cold
> > [    4.274636] pci 0000:00:19.0: [8086:1502] type 00 class 0x020000
> > [    4.274681] pci 0000:00:19.0: reg 10: [mem 0xe2e00000-0xe2e1ffff]
> > [    4.274700] pci 0000:00:19.0: reg 14: [mem 0xe2e80000-0xe2e80fff]
> > [    4.274719] pci 0000:00:19.0: reg 18: [io  0x4080-0x409f]
> > [    4.274883] pci 0000:00:19.0: PME# supported from D0 D3hot D3cold
> > [    4.274939] pci 0000:00:1a.0: [8086:1c2d] type 00 class 0x0c0320
> > [    4.274983] pci 0000:00:1a.0: reg 10: [mem 0xe2e70000-0xe2e703ff]
> > [    4.275185] pci 0000:00:1a.0: PME# supported from D0 D3hot D3cold
> > [    4.275243] pci 0000:00:1b.0: [8086:1c20] type 00 class 0x040300
> > [    4.275278] pci 0000:00:1b.0: reg 10: [mem 0xe2e60000-0xe2e63fff
> 64bit]
> > [    4.275456] pci 0000:00:1b.0: PME# supported from D0 D3hot D3cold
> > [    4.275509] pci 0000:00:1c.0: [8086:1c10] type 01 class 0x060400
> > [    4.275702] pci 0000:00:1c.0: PME# supported from D0 D3hot D3cold
> > [    4.275760] pci 0000:00:1c.1: [8086:1c12] type 01 class 0x060400
> > [    4.275953] pci 0000:00:1c.1: PME# supported from D0 D3hot D3cold
> > [    4.276011] pci 0000:00:1c.2: [8086:1c14] type 01 class 0x060400
> > [    4.276205] pci 0000:00:1c.2: PME# supported from D0 D3hot D3cold
> > [    4.276264] pci 0000:00:1c.3: [8086:1c16] type 01 class 0x060400
> > [    4.276458] pci 0000:00:1c.3: PME# supported from D0 D3hot D3cold
> > [    4.276520] pci 0000:00:1c.5: [8086:1c1a] type 01 class 0x060400
> > [    4.276711] pci 0000:00:1c.5: PME# supported from D0 D3hot D3cold
> > [    4.276779] pci 0000:00:1d.0: [8086:1c26] type 00 class 0x0c0320
> > [    4.276823] pci 0000:00:1d.0: reg 10: [mem 0xe2e50000-0xe2e503ff]
> > [    4.277025] pci 0000:00:1d.0: PME# supported from D0 D3hot D3cold
> > [    4.277086] pci 0000:00:1f.0: [8086:1c4f] type 00 class 0x060100
> > [    4.277341] pci 0000:00:1f.2: [8086:1c03] type 00 class 0x010601
> > [    4.277391] pci 0000:00:1f.2: reg 10: [io  0x40d0-0x40d7]
> > [    4.277410] pci 0000:00:1f.2: reg 14: [io  0x40c0-0x40c3]
> > [    4.277429] pci 0000:00:1f.2: reg 18: [io  0x40b0-0x40b7]
> > [    4.277449] pci 0000:00:1f.2: reg 1c: [io  0x40a0-0x40a3]
> > [    4.277468] pci 0000:00:1f.2: reg 20: [io  0x4060-0x407f]
> > [    4.277486] pci 0000:00:1f.2: reg 24: [mem 0xe2e40000-0xe2e407ff]
> > [    4.277613] pci 0000:00:1f.2: PME# supported from D3hot
> > [    4.277657] pci 0000:00:1f.3: [8086:1c22] type 00 class 0x0c0500
> > [    4.277694] pci 0000:00:1f.3: reg 10: [mem 0xe2e30000-0xe2e300ff
> 64bit]
> > [    4.277749] pci 0000:00:1f.3: reg 20: [io  0x4040-0x405f]
> > [    4.277920] pci 0000:00:1c.0: PCI bridge to [bus 01-01]
> > [    4.278353] pci 0000:02:00.0: [8086:422b] type 00 class 0x028000
> > [    4.278708] pci 0000:02:00.0: reg 10: [mem 0xe2d00000-0xe2d01fff
> 64bit]
> > [    4.280508] pci 0000:02:00.0: PME# supported from D0 D3hot D3cold
> > [    4.285361] pci 0000:00:1c.1: PCI bridge to [bus 02-02]
> > [    4.285374] pci 0000:00:1c.1:   bridge window [mem
> 0xe2d00000-0xe2dfffff]
> > [    4.285490] pci 0000:00:1c.2: PCI bridge to [bus 03-08]
> > [    4.285498] pci 0000:00:1c.2:   bridge window [io  0x3000-0x3fff]
> > [    4.285505] pci 0000:00:1c.2:   bridge window [mem
> 0xe2200000-0xe2bfffff]
> > [    4.285517] pci 0000:00:1c.2:   bridge window [mem
> 0xe0a00000-0xe13fffff 64bit pref]
> > [    4.285625] pci 0000:00:1c.3: PCI bridge to [bus 09-09]
> > [    4.285632] pci 0000:00:1c.3:   bridge window [io  0x2000-0x2fff]
> > [    4.285639] pci 0000:00:1c.3:   bridge window [mem
> 0xe1800000-0xe21fffff]
> > [    4.285651] pci 0000:00:1c.3:   bridge window [mem
> 0xe0000000-0xe09fffff 64bit pref]
> > [    4.285818] pci 0000:0a:00.0: [1217:8221] type 00 class 0x080501
> > [    4.285872] pci 0000:0a:00.0: reg 10: [mem 0xe2c20000-0xe2c201ff]
> > [    4.286294] pci 0000:0a:00.0: supports D1 D2
> > [    4.286295] pci 0000:0a:00.0: PME# supported from D0 D1 D2 D3hot
> D3cold
> > [    4.286432] pci 0000:0a:00.1: [1217:8231] type 00 class 0x018000
> > [    4.286486] pci 0000:0a:00.1: reg 10: [mem 0xe2c10000-0xe2c10fff]
> > [    4.286563] pci 0000:0a:00.1: reg 18: [mem 0xe2c00000-0xe2c007ff]
> > [    4.286908] pci 0000:0a:00.1: supports D1 D2
> > [    4.286909] pci 0000:0a:00.1: PME# supported from D0 D1 D2 D3hot
> D3cold
> > [    4.293400] pci 0000:00:1c.5: PCI bridge to [bus 0a-0a]
> > [    4.293412] pci 0000:00:1c.5:   bridge window [mem
> 0xe2c00000-0xe2cfffff]
> > [    4.293479] pci_bus 0000:00: on NUMA node 0
> > [    4.293483] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
> > [    4.293612] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP01._PRT]
> > [    4.293647] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP02._PRT]
> > [    4.293682] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP04._PRT]
> > [    4.293717] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP06._PRT]
> > [    4.293762] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP03._PRT]
> > [    4.293857] \_SB_.PCI0:_OSC invalid UUID
> > [    4.293858] _OSC request data:1 1f 1f
> > [    4.293861]  pci0000:00: Requesting ACPI _OSC control (0x1d)
> > [    4.293906] \_SB_.PCI0:_OSC invalid UUID
> > [    4.293907] _OSC request data:1 0 1d
> > [    4.293910]  pci0000:00: ACPI _OSC request failed (AE_ERROR),
> returned control mask: 0x1d
> > [    4.293911] ACPI _OSC control for PCIe not granted, disabling ASPM
> > [    4.297639] ACPI: PCI Interrupt Link [LNKA] (IRQs 1 3 4 5 6 7 10 12
> 14 15) *11
> > [    4.297702] ACPI: PCI Interrupt Link [LNKB] (IRQs 1 3 4 5 6 7 11 12
> 14 15) *10
> > [    4.297761] ACPI: PCI Interrupt Link [LNKC] (IRQs 1 3 4 5 6 7 10 12
> 14 15) *11
> > [    4.297820] ACPI: PCI Interrupt Link [LNKD] (IRQs 1 3 4 5 6 7 11 12
> 14 15) *10
> > [    4.297878] ACPI: PCI Interrupt Link [LNKE] (IRQs 1 3 4 *5 6 7 10 12
> 14 15)
> > [    4.297937] ACPI: PCI Interrupt Link [LNKF] (IRQs 1 3 4 5 6 7 11 12
> 14 15) *0, disabled.
> > [    4.297996] ACPI: PCI Interrupt Link [LNKG] (IRQs 1 *3 4 5 6 7 10 12
> 14 15)
> > [    4.298054] ACPI: PCI Interrupt Link [LNKH] (IRQs 1 3 4 5 6 7 11 12
> 14 15) *0, disabled.
> > [    4.298087] xen/balloon: Initialising balloon driver.
> > [    4.301022] xen-balloon: Initialising balloon driver.
> > [    4.301062] xen/balloon: Xen selfballooning driver disabled for
> domain0.
> > [    4.301148] vgaarb: device added:
> PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
> > [    4.301157] vgaarb: loaded
> > [    4.301157] vgaarb: bridge control possible 0000:00:02.0
> > [    4.301279] PCI: Using ACPI for IRQ routing
> > [    4.305930] PCI: pci_cache_line_size set to 64 bytes
> > [    4.306106] reserve RAM buffer: 000000000009a000 - 000000000009ffff
> > [    4.306108] reserve RAM buffer: 0000000007eea000 - 0000000007ffffff
> > [    4.306110] reserve RAM buffer: 0000000007f70000 - 0000000007ffffff
> > [    4.306112] reserve RAM buffer: 0000000007f78000 - 0000000007ffffff
> > [    4.306113] reserve RAM buffer: 000000000dffd000 - 000000000fffffff
> > [    4.306115] reserve RAM buffer: 00000000c83b4000 - 00000000cbffffff
> > [    4.306118] reserve RAM buffer: 00000000c840e000 - 00000000cbffffff
> > [    4.306121] reserve RAM buffer: 00000000c8411000 - 00000000cbffffff
> > [    4.306123] reserve RAM buffer: 00000000c841e000 - 00000000cbffffff
> > [    4.306125] reserve RAM buffer: 00000000c8432000 - 00000000cbffffff
> > [    4.306127] reserve RAM buffer: 00000000cac00000 - 00000000cbffffff
> > [    4.306129] reserve RAM buffer: 000000042e000000 - 000000042fffffff
> > [    4.306235] Switching to clocksource xen
> > [    4.307726] pnp: PnP ACPI init
> > [    4.307738] ACPI: bus type pnp registered
> > [    4.308287] pnp 00:00: [bus 00-3e]
> > [    4.308289] pnp 00:00: [io  0x0000-0x0cf7 window]
> > [    4.308291] pnp 00:00: [io  0x0cf8-0x0cff]
> > [    4.308293] pnp 00:00: [io  0x0d00-0xffff window]
> > [    4.308295] pnp 00:00: [mem 0x000a0000-0x000bffff window]
> > [    4.308296] pnp 00:00: [mem 0x000c0000-0x000c3fff window]
> > [    4.308298] pnp 00:00: [mem 0x000c4000-0x000c7fff window]
> > [    4.308300] pnp 00:00: [mem 0x000c8000-0x000cbfff window]
> > [    4.308301] pnp 00:00: [mem 0x000cc000-0x000cffff window]
> > [    4.308303] pnp 00:00: [mem 0x000d0000-0x000d3fff window]
> > [    4.308305] pnp 00:00: [mem 0x000d4000-0x000d7fff window]
> > [    4.308307] pnp 00:00: [mem 0x000d8000-0x000dbfff window]
> > [    4.308309] pnp 00:00: [mem 0x000dc000-0x000dffff window]
> > [    4.308310] pnp 00:00: [mem 0x000e0000-0x000e3fff window]
> > [    4.308312] pnp 00:00: [mem 0x000e4000-0x000e7fff window]
> > [    4.308314] pnp 00:00: [mem 0x000e8000-0x000ebfff window]
> > [    4.308315] pnp 00:00: [mem 0x000ec000-0x000effff window]
> > [    4.308317] pnp 00:00: [mem 0x000f0000-0x000fffff window]
> > [    4.308319] pnp 00:00: [mem 0xcfa00000-0xfeafffff window]
> > [    4.308320] pnp 00:00: [mem 0xfed40000-0xfed44fff window]
> > [    4.308385] pnp 00:00: Plug and Play ACPI device, IDs PNP0a08 PNP0a03
> (active)
> > [    4.308398] pnp 00:01: [io  0x0000-0x001f]
> > [    4.308400] pnp 00:01: [io  0x0081-0x0091]
> > [    4.308401] pnp 00:01: [io  0x0093-0x009f]
> > [    4.308403] pnp 00:01: [io  0x00c0-0x00df]
> > [    4.308404] pnp 00:01: [dma 4]
> > [    4.308422] pnp 00:01: Plug and Play ACPI device, IDs PNP0200 (active)
> > [    4.308429] pnp 00:02: [mem 0xff000000-0xffffffff]
> > [    4.308445] pnp 00:02: Plug and Play ACPI device, IDs INT0800 (active)
> > [    4.308540] pnp 00:03: [mem 0xfed00000-0xfed003ff]
> > [    4.308572] system 00:03: [mem 0xfed00000-0xfed003ff] has been
> reserved
> > [    4.308575] system 00:03: Plug and Play ACPI device, IDs PNP0103
> PNP0c01 (active)
> > [    4.308584] pnp 00:04: [io  0x00f0]
> > [    4.308587] xen: registering gsi 13 triggering 1 polarity 0
> > [    4.308609] pnp 00:04: [irq 13]
> > [    4.308626] pnp 00:04: Plug and Play ACPI device, IDs PNP0c04 (active)
> > [    4.308636] pnp 00:05: [io  0x002e-0x002f]
> > [    4.308637] pnp 00:05: [io  0x004e-0x004f]
> > [    4.308639] pnp 00:05: [io  0x0061]
> > [    4.308640] pnp 00:05: [io  0x0063]
> > [    4.308641] pnp 00:05: [io  0x0065]
> > [    4.308642] pnp 00:05: [io  0x0067]
> > [    4.308644] pnp 00:05: [io  0x0070]
> > [    4.308645] pnp 00:05: [io  0x0080]
> > [    4.308646] pnp 00:05: [io  0x0092]
> > [    4.308648] pnp 00:05: [io  0x00b2-0x00b3]
> > [    4.308649] pnp 00:05: [io  0x0680-0x069f]
> > [    4.308651] pnp 00:05: [io  0x1000-0x100f]
> > [    4.308653] pnp 00:05: [io  0xffff]
> > [    4.308654] pnp 00:05: [io  0xffff]
> > [    4.308655] pnp 00:05: [io  0x0400-0x047f]
> > [    4.308656] pnp 00:05: [io  0x0500-0x057f]
> > [    4.308658] pnp 00:05: [io  0x164e-0x164f]
> > [    4.308689] system 00:05: [io  0x0680-0x069f] has been reserved
> > [    4.308691] system 00:05: [io  0x1000-0x100f] has been reserved
> > [    4.308693] system 00:05: [io  0xffff] has been reserved
> > [    4.308695] system 00:05: [io  0xffff] has been reserved
> > [    4.308697] system 00:05: [io  0x0400-0x047f] has been reserved
> > [    4.308700] system 00:05: [io  0x0500-0x057f] has been reserved
> > [    4.308701] system 00:05: [io  0x164e-0x164f] has been reserved
> > [    4.308704] system 00:05: Plug and Play ACPI device, IDs PNP0c02
> (active)
> > [    4.308711] pnp 00:06: [io  0x0070-0x0077]
> > [    4.308713] xen: registering gsi 8 triggering 1 polarity 0
> > [    4.308730] pnp 00:06: [irq 8]
> > [    4.308749] pnp 00:06: Plug and Play ACPI device, IDs PNP0b00 (active)
> > [    4.308758] pnp 00:07: [io  0x0060]
> > [    4.308759] pnp 00:07: [io  0x0064]
> > [    4.308761] xen: registering gsi 1 triggering 1 polarity 0
> > [    4.308777] pnp 00:07: [irq 1]
> > [    4.308794] pnp 00:07: Plug and Play ACPI device, IDs PNP0303 (active)
> > [    4.309984] pnp 00:08: Plug and Play ACPI device, IDs PNP0401
> (disabled)
> > [    4.309993] xen: registering gsi 12 triggering 1 polarity 0
> > [    4.310011] pnp 00:09: [irq 12]
> > [    4.310030] pnp 00:09: Plug and Play ACPI device, IDs DLL0493 PNP0f13
> (active)
> > [    4.310065] pnp 00:0a: [mem 0xfed40000-0xfed44fff]
> > [    4.310086] pnp 00:0a: Plug and Play ACPI device, IDs BCM0102 PNP0c31
> (active)
> > [    4.310291] pnp 00:0b: [mem 0xfed1c000-0xfed1ffff]
> > [    4.310292] pnp 00:0b: [mem 0xfed10000-0xfed17fff]
> > [    4.310294] pnp 00:0b: [mem 0xfed18000-0xfed18fff]
> > [    4.310296] pnp 00:0b: [mem 0xfed19000-0xfed19fff]
> > [    4.310298] pnp 00:0b: [mem 0xf8000000-0xfbffffff]
> > [    4.310309] pnp 00:0b: [mem 0xfed20000-0xfed3ffff]
> > [    4.310310] pnp 00:0b: [mem 0xfed90000-0xfed93fff]
> > [    4.310312] pnp 00:0b: [mem 0xfed45000-0xfed8ffff]
> > [    4.310313] pnp 00:0b: [mem 0xff000000-0xffffffff]
> > [    4.310315] pnp 00:0b: [mem 0xfee00000-0xfeefffff]
> > [    4.310317] pnp 00:0b: [mem 0x00000000-0xffffffffffffffff disabled]
> > [    4.310318] pnp 00:0b: [mem 0x00000000-0xffffffffffffffff disabled]
> > [    4.310359] system 00:0b: [mem 0xfed1c000-0xfed1ffff] has been
> reserved
> > [    4.310361] system 00:0b: [mem 0xfed10000-0xfed17fff] has been
> reserved
> > [    4.310363] system 00:0b: [mem 0xfed18000-0xfed18fff] has been
> reserved
> > [    4.310365] system 00:0b: [mem 0xfed19000-0xfed19fff] has been
> reserved
> > [    4.310367] system 00:0b: [mem 0xf8000000-0xfbffffff] has been
> reserved
> > [    4.310369] system 00:0b: [mem 0xfed20000-0xfed3ffff] has been
> reserved
> > [    4.310371] system 00:0b: [mem 0xfed90000-0xfed93fff] has been
> reserved
> > [    4.310373] system 00:0b: [mem 0xfed45000-0xfed8ffff] has been
> reserved
> > [    4.310375] system 00:0b: [mem 0xff000000-0xffffffff] could not be
> reserved
> > [    4.310377] system 00:0b: [mem 0xfee00000-0xfeefffff] could not be
> reserved
> > [    4.310380] system 00:0b: Plug and Play ACPI device, IDs PNP0c02
> (active)
> > [    4.310956] xen: registering gsi 23 triggering 1 polarity 0
> > [    4.310967] xen: --> pirq=23 -> irq=23 (gsi=23)
> > [    4.310985] pnp 00:0c: [irq 23]
> > [    4.311015] pnp 00:0c: Plug and Play ACPI device, IDs SMO8800 (active)
> > [    4.315528] pnp 00:0d: [mem 0x20000000-0x201fffff]
> > [    4.315531] pnp 00:0d: [mem 0x40000000-0x401fffff]
> > [    4.339851] system 00:0d: [mem 0x20000000-0x201fffff] has been
> reserved
> > [    4.339854] system 00:0d: [mem 0x40000000-0x401fffff] has been
> reserved
> > [    4.339857] system 00:0d: Plug and Play ACPI device, IDs PNP0c01
> (active)
> > [    4.339865] pnp: PnP ACPI: found 14 devices
> > [    4.339867] ACPI: ACPI bus type pnp unregistered
> > [    4.346178] PM-Timer failed consistency check  (0x0xffffff) -
> aborting.
> > [    4.346274] pci 0000:00:1c.0: PCI bridge to [bus 01-01]
> > [    4.346306] pci 0000:00:1c.1: PCI bridge to [bus 02-02]
> > [    4.346315] pci 0000:00:1c.1:   bridge window [mem
> 0xe2d00000-0xe2dfffff]
> > [    4.346332] pci 0000:00:1c.2: PCI bridge to [bus 03-08]
> > [    4.346336] pci 0000:00:1c.2:   bridge window [io  0x3000-0x3fff]
> > [    4.346347] pci 0000:00:1c.2:   bridge window [mem
> 0xe2200000-0xe2bfffff]
> > [    4.346354] pci 0000:00:1c.2:   bridge window [mem
> 0xe0a00000-0xe13fffff 64bit pref]
> > [    4.346366] pci 0000:00:1c.3: PCI bridge to [bus 09-09]
> > [    4.346370] pci 0000:00:1c.3:   bridge window [io  0x2000-0x2fff]
> > [    4.346379] pci 0000:00:1c.3:   bridge window [mem
> 0xe1800000-0xe21fffff]
> > [    4.346386] pci 0000:00:1c.3:   bridge window [mem
> 0xe0000000-0xe09fffff 64bit pref]
> > [    4.346399] pci 0000:00:1c.5: PCI bridge to [bus 0a-0a]
> > [    4.346408] pci 0000:00:1c.5:   bridge window [mem
> 0xe2c00000-0xe2cfffff]
> > [    4.346434] xen: registering gsi 16 triggering 0 polarity 1
> > [    4.346442] xen: --> pirq=16 -> irq=16 (gsi=16)
> > [    4.346469] xen: registering gsi 17 triggering 0 polarity 1
> > [    4.346473] xen: --> pirq=17 -> irq=17 (gsi=17)
> > [    4.346498] xen: registering gsi 18 triggering 0 polarity 1
> > [    4.346502] xen: --> pirq=18 -> irq=18 (gsi=18)
> > [    4.346527] xen: registering gsi 19 triggering 0 polarity 1
> > [    4.346531] xen: --> pirq=19 -> irq=19 (gsi=19)
> > [    4.346556] xen: registering gsi 17 triggering 0 polarity 1
> > [    4.346558] Already setup the GSI :17
> > [    4.346563] pci_bus 0000:00: resource 4 [io  0x0000-0x0cf7]
> > [    4.346565] pci_bus 0000:00: resource 5 [io  0x0d00-0xffff]
> > [    4.346566] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff]
> > [    4.346568] pci_bus 0000:00: resource 7 [mem 0xcfa00000-0xfeafffff]
> > [    4.346570] pci_bus 0000:00: resource 8 [mem 0xfed40000-0xfed44fff]
> > [    4.346572] pci_bus 0000:02: resource 1 [mem 0xe2d00000-0xe2dfffff]
> > [    4.346574] pci_bus 0000:03: resource 0 [io  0x3000-0x3fff]
> > [    4.346575] pci_bus 0000:03: resource 1 [mem 0xe2200000-0xe2bfffff]
> > [    4.346577] pci_bus 0000:03: resource 2 [mem 0xe0a00000-0xe13fffff
> 64bit pref]
> > [    4.346579] pci_bus 0000:09: resource 0 [io  0x2000-0x2fff]
> > [    4.346581] pci_bus 0000:09: resource 1 [mem 0xe1800000-0xe21fffff]
> > [    4.346582] pci_bus 0000:09: resource 2 [mem 0xe0000000-0xe09fffff
> 64bit pref]
> > [    4.346584] pci_bus 0000:0a: resource 1 [mem 0xe2c00000-0xe2cfffff]
> > [    4.346672] NET: Registered protocol family 2
> > [    4.346732] IP route cache hash table entries: 524288 (order: 10,
> 4194304 bytes)
> > [    4.347207] TCP established hash table entries: 262144 (order: 10,
> 4194304 bytes)
> > [    4.347753] TCP bind hash table entries: 65536 (order: 8, 1048576
> bytes)
> > [    4.347872] TCP: Hash tables configured (established 262144 bind
> 65536)
> > [    4.347874] TCP: reno registered
> > [    4.347877] UDP hash table entries: 8192 (order: 6, 262144 bytes)
> > [    4.347921] UDP-Lite hash table entries: 8192 (order: 6, 262144 bytes)
> > [    4.348067] NET: Registered protocol family 1
> > [    4.348085] pci 0000:00:02.0: Boot video device
> > [    4.348108] xen: registering gsi 16 triggering 0 polarity 1
> > [    4.348112] Already setup the GSI :16
> > [    4.348203] xen: registering gsi 17 triggering 0 polarity 1
> > [    4.348205] Already setup the GSI :17
> > [    4.348298] PCI: CLS 64 bytes, default 64
> > [    4.348333] Unpacking initramfs...
> > [    4.384265] Freeing initrd memory: 45868k freed
> > [    4.392440] Simple Boot Flag at 0xf3 set to 0x1
> > [    4.392900] audit: initializing netlink socket (disabled)
> > [    4.392911] type=2000 audit(1354151975.383:1): initialized
> > [    4.411688] VFS: Disk quotas dquot_6.5.2
> > [    4.411715] Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
> > [    4.411870] msgmni has been set to 29339
> > [    4.412010] Block layer SCSI generic (bsg) driver version 0.4 loaded
> (major 253)
> > [    4.412013] io scheduler noop registered
> > [    4.412015] io scheduler deadline registered
> > [    4.412036] io scheduler cfq registered (default)
> > [    4.412666] intel_idle: does not run on family 6 model 42
> > [    4.412741] ACPI: Requesting acpi_cpufreq
> > [    4.459643] Non-volatile memory driver v1.3
> > [    4.459654] ramoops: platform device not found, using module
> parameters
> > [    4.459670] ramoops: The memory size and the record size must be
> non-zero
> > [    4.459703] ramoops: probe of ramoops failed with error -22
> > [    4.474892] loop: module loaded
> > [    4.474922] Fixed MDIO Bus: probed
> > [    4.474965] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2M]
> at 0x60,0x64 irq 1,12
> > [    4.475166] i8042: Warning: Keylock active
> > [    4.476434] serio: i8042 KBD port at 0x60,0x64 irq 1
> > [    4.476439] serio: i8042 AUX port at 0x60,0x64 irq 12
> > [    4.476551] mousedev: PS/2 mouse device common for all mice
> > [    4.476707] rtc_cmos 00:06: RTC can wake from S4
> > [    4.476940] rtc_cmos 00:06: rtc core: registered rtc_cmos as rtc0
> > [    4.476998] rtc0: alarms up to one year, y3k, 242 bytes nvram
> > [    4.477084] device-mapper: uevent: version 1.0.3
> > [    4.477193] device-mapper: ioctl: 4.22.0-ioctl (2011-10-19)
> initialised: dm-devel@redhat.com
> > [    4.477281] TCP: cubic registered
> > [    4.477381] input: AT Translated Set 2 keyboard as
> /devices/platform/i8042/serio0/input/input0
> > [    4.477402] NET: Registered protocol family 10
> > [    4.477644] Registering the dns_resolver key type
> > [    4.477791] registered taskstats version 1
> > [    4.478330]   Magic number: 4:584:307
> > [    4.478403] tty tty36: hash matches
> > [    4.478496] rtc_cmos 00:06: setting system clock to 2012-11-29
> 01:19:35 UTC (1354151975)
> > [    4.478801] Freeing unused kernel memory: 552k freed
> > [    4.478847] Write protecting the kernel read-only data: 8192k
> > [    4.481908] Freeing unused kernel memory: 1568k freed
> > [    4.482112] Freeing unused kernel memory: 24k freed
> > [    4.524129] dracut: dracut-005-3.fc13
> > [    4.552311] pciback 0000:00:19.0: seizing device
> > [    4.552403] pciback 0000:02:00.0: seizing device
> > [    4.552941] xen: registering gsi 17 triggering 0 polarity 1
> > [    4.552952] Already setup the GSI :17
> > [    4.553934] xen: registering gsi 20 triggering 0 polarity 1
> > [    4.553964] xen: --> pirq=20 -> irq=20 (gsi=20)
> > [    4.554574] xen-pciback: backend is vpci
> > [    4.617471] udev: starting version 151
> > [    4.617770] udevd (80): /proc/80/oom_adj is deprecated, please use
> /proc/80/oom_score_adj instead.
> > [    4.654916] Linux agpgart interface v0.103
> > [    4.655397] input: Lid Switch as
> /devices/LNXSYSTM:00/device:00/PNP0C0D:00/input/input1
> > [    5.051184] ACPI: Lid Switch [LID]
> > [    5.051436] input: Power Button as
> /devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input2
> > [    5.051547] ACPI: Power Button [PBTN]
> > [    5.051682] input: Sleep Button as
> /devices/LNXSYSTM:00/device:00/PNP0C0E:00/input/input3
> > [    5.051760] ACPI: Sleep Button [SBTN]
> > [    5.054141] input: Power Button as
> /devices/LNXSYSTM:00/LNXPWRBN:00/input/input4
> > [    5.054421] ACPI: Power Button [PWRF]
> > [    5.056887] agpgart-intel 0000:00:00.0: Intel Sandybridge Chipset
> > [    5.058118] agpgart-intel 0000:00:00.0: detected gtt size: 2097152K
> total, 262144K mappable
> > [    5.064439] agpgart-intel 0000:00:00.0: detected 65536K stolen memory
> > [    5.064916] agpgart-intel 0000:00:00.0: AGP aperture is 256M @
> 0xd0000000
> > [    5.070296] [drm] Initialized drm 1.1.0 20060810
> > [    5.080002] xen: registering gsi 16 triggering 0 polarity 1
> > [    5.080015] Already setup the GSI :16
> > [    5.080364] i915 0000:00:02.0: setting latency timer to 64
> > [    5.190295] [drm] MTRR allocation failed.  Graphics performance may
> suffer.
> > [    5.190491] [drm] Supports vblank timestamp caching Rev 1
> (10.10.2010).
> > [    5.190493] [drm] Driver supports precise vblank timestamp query.
> > [    5.190554] vgaarb: device changed decodes:
> PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem
> > [    5.548301] [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp off
> > [    5.591093] input: DualPoint Stick as
> /devices/platform/i8042/serio1/input/input5
> > [    5.606212] input: AlpsPS/2 ALPS DualPoint TouchPad as
> /devices/platform/i8042/serio1/input/input6
> > [    5.806814] fbcon: inteldrmfb (fb0) is primary device
> > [    6.095967] Console: switching to colour frame buffer device 200x56
> > [    6.101477] fb0: inteldrmfb frame buffer device
> > [    6.101478] drm: registered panic notifier
> > [    6.130833] acpi device:38: registered as cooling_device4
> > [    6.133713] input: Video Bus as
> /devices/LNXSYSTM:00/device:00/PNP0A08:00/LNXVIDEO:00/input/input7
> > [    6.133915] ACPI: Video Device [VID] (multi-head: yes  rom: no  post:
> no)
> > [    6.135082] [drm] Initialized i915 1.6.0 20080730 for 0000:00:02.0 on
> minor 0
> > [    6.185946] dracut: Starting plymouth daemon
> > [    6.479391] dracut: rd_NO_DM: removing DM RAID activation
> > [    6.489309] dracut: rd_NO_MD: removing MD RAID activation
> > [    6.542596] wmi: Mapper loaded
> > [    6.564439] usbcore: registered new interface driver usbfs
> > [    6.564463] usbcore: registered new interface driver hub
> > [    6.568901] SCSI subsystem initialized
> > [    6.569574] usbcore: registered new device driver usb
> > [    6.570692] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
> > [    6.570723] xen: registering gsi 16 triggering 0 polarity 1
> > [    6.570728] Already setup the GSI :16
> > [    6.570776] ehci_hcd 0000:00:1a.0: setting latency timer to 64
> > [    6.570782] ehci_hcd 0000:00:1a.0: EHCI Host Controller
> > [    6.570814] ehci_hcd 0000:00:1a.0: new USB bus registered, assigned
> bus number 1
> > [    6.570879] ehci_hcd 0000:00:1a.0: debug port 2
> > [    6.573720] libata version 3.00 loaded.
> > [    6.574777] ehci_hcd 0000:00:1a.0: cache line size of 64 is not
> supported
> > [    6.574832] ehci_hcd 0000:00:1a.0: irq 16, io mem 0xe2e70000
> > [    6.586344] ehci_hcd 0000:00:1a.0: USB 2.0 started, EHCI 1.00
> > [    6.586369] usb usb1: New USB device found, idVendor=1d6b,
> idProduct=0002
> > [    6.586372] usb usb1: New USB device strings: Mfr=3, Product=2,
> SerialNumber=1
> > [    6.586375] usb usb1: Product: EHCI Host Controller
> > [    6.586376] usb usb1: Manufacturer: Linux 3.4.18-2.pvops.qubes.x86_64
> ehci_hcd
> > [    6.586378] usb usb1: SerialNumber: 0000:00:1a.0
> > [    6.586506] hub 1-0:1.0: USB hub found
> > [    6.586511] hub 1-0:1.0: 2 ports detected
> > [    6.586604] xen: registering gsi 17 triggering 0 polarity 1
> > [    6.586609] Already setup the GSI :17
> > [    6.586663] ehci_hcd 0000:00:1d.0: setting latency timer to 64
> > [    6.586668] ehci_hcd 0000:00:1d.0: EHCI Host Controller
> > [    6.586678] ehci_hcd 0000:00:1d.0: new USB bus registered, assigned
> bus number 2
> > [    6.586734] ehci_hcd 0000:00:1d.0: debug port 2
> > [    6.590650] ehci_hcd 0000:00:1d.0: cache line size of 64 is not
> supported
> > [    6.590709] ehci_hcd 0000:00:1d.0: irq 17, io mem 0xe2e50000
> > [    6.606335] ehci_hcd 0000:00:1d.0: USB 2.0 started, EHCI 1.00
> > [    6.606364] usb usb2: New USB device found, idVendor=1d6b,
> idProduct=0002
> > [    6.606367] usb usb2: New USB device strings: Mfr=3, Product=2,
> SerialNumber=1
> > [    6.606370] usb usb2: Product: EHCI Host Controller
> > [    6.606371] usb usb2: Manufacturer: Linux 3.4.18-2.pvops.qubes.x86_64
> ehci_hcd
> > [    6.606373] usb usb2: SerialNumber: 0000:00:1d.0
> > [    6.606519] hub 2-0:1.0: USB hub found
> > [    6.606524] hub 2-0:1.0: 2 ports detected
> > [    6.606620] ahci 0000:00:1f.2: version 3.0
> > [    6.606641] xen: registering gsi 18 triggering 0 polarity 1
> > [    6.606647] Already setup the GSI :18
> > [    6.606896] ahci: SSS flag set, parallel bus scan disabled
> > [    6.626400] ahci 0000:00:1f.2: AHCI 0001.0300 32 slots 6 ports 6 Gbps
> 0x3b impl SATA mode
> > [    6.626405] ahci 0000:00:1f.2: flags: 64bit ncq sntf stag pm led clo
> pio slum part ems sxs apst
> > [    6.626414] ahci 0000:00:1f.2: setting latency timer to 64
> > [    6.673732] scsi0 : ahci
> > [    6.683363] scsi1 : ahci
> > [    6.697268] scsi2 : ahci
> > [    6.711526] scsi3 : ahci
> > [    6.733931] scsi4 : ahci
> > [    6.739603] scsi5 : ahci
> > [    6.842106] ata1: SATA max UDMA/133 abar m2048@0xe2e40000 port
> 0xe2e40100 irq 293
> > [    6.842118] ata2: SATA max UDMA/133 abar m2048@0xe2e40000 port
> 0xe2e40180 irq 293
> > [    6.842124] ata3: DUMMY
> > [    6.842129] ata4: SATA max UDMA/133 abar m2048@0xe2e40000 port
> 0xe2e40280 irq 293
> > [    6.842136] ata5: SATA max UDMA/133 abar m2048@0xe2e40000 port
> 0xe2e40300 irq 293
> > [    6.842143] ata6: SATA max UDMA/133 abar m2048@0xe2e40000 port
> 0xe2e40380 irq 293
> > [    6.898480] usb 1-1: new high-speed USB device number 2 using ehci_hcd
> > [    7.031312] usb 1-1: New USB device found, idVendor=8087,
> idProduct=0024
> > [    7.031323] usb 1-1: New USB device strings: Mfr=0, Product=0,
> SerialNumber=0
> > [    7.032072] hub 1-1:1.0: USB hub found
> > [    7.032344] hub 1-1:1.0: 6 ports detected
> > [    7.142515] usb 2-1: new high-speed USB device number 2 using ehci_hcd
> > [    7.162484] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
> > [    7.268594] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by
> device (Stat=0x51 Err=0x04)
> > [    7.268770] ata1.00: ATA-9: KINGSTON SV200S3256G, E111008a, max
> UDMA/100
> > [    7.268778] ata1.00: 500118192 sectors, multi 16: LBA48 NCQ (depth
> 31/32), AA
> > [    7.272554] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by
> device (Stat=0x51 Err=0x04)
> > [    7.272758] ata1.00: configured for UDMA/100
> > [    7.273314] scsi 0:0:0:0: Direct-Access     ATA      KINGSTON SV200S3
> E111 PQ: 0 ANSI: 5
> > [    7.274861] usb 2-1: New USB device found, idVendor=8087,
> idProduct=0024
> > [    7.274870] usb 2-1: New USB device strings: Mfr=0, Product=0,
> SerialNumber=0
> > [    7.275358] hub 2-1:1.0: USB hub found
> > [    7.275521] hub 2-1:1.0: 8 ports detected
> > [    7.346717] usb 1-1.4: new full-speed USB device number 3 using
> ehci_hcd
> > [    7.443529] usb 1-1.4: New USB device found, idVendor=413c,
> idProduct=8187
> > [    7.443539] usb 1-1.4: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> > [    7.443546] usb 1-1.4: Product: DW375 Bluetooth Module
> > [    7.443550] usb 1-1.4: Manufacturer: Dell Computer Corp
> > [    7.443555] usb 1-1.4: SerialNumber: D0DF9A40FE60
> > [    7.514736] usb 1-1.5: new high-speed USB device number 4 using
> ehci_hcd
> > [    7.590440] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> > [    7.593835] ata2.00: ATAPI: HL-DT-ST DVD+/-RW GU60N, A103, max
> UDMA/133
> > [    7.604147] ata2.00: configured for UDMA/133
> > [    7.614746] usb 1-1.5: New USB device found, idVendor=05ca,
> idProduct=181c
> > [    7.614757] usb 1-1.5: New USB device strings: Mfr=1, Product=2,
> SerialNumber=0
> > [    7.614763] usb 1-1.5: Product: Laptop_Integrated_Webcam_FHD
> > [    7.614768] usb 1-1.5: Manufacturer: CN0CJ3P27248717F040SA01
> > [    7.618662] scsi 1:0:0:0: CD-ROM            HL-DT-ST DVD+-RW GU60N
>  A103 PQ: 0 ANSI: 5
> > [    7.686581] usb 2-1.6: new high-speed USB device number 3 using
> ehci_hcd
> > [    7.795399] usb 2-1.6: New USB device found, idVendor=413c,
> idProduct=818d
> > [    7.795410] usb 2-1.6: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> > [    7.795416] usb 2-1.6: Product: DW5550
> > [    7.795420] usb 2-1.6: Manufacturer: Dell
> > [    7.795425] usb 2-1.6: SerialNumber: 88FA653FDF944970
> > [    7.902770] usb 2-1.8: new full-speed USB device number 4 using
> ehci_hcd
> > [    7.938478] ata4: SATA link down (SStatus 0 SControl 300)
> > [    8.017319] usb 2-1.8: New USB device found, idVendor=0a5c,
> idProduct=5801
> > [    8.017330] usb 2-1.8: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> > [    8.017336] usb 2-1.8: Product: 5880
> > [    8.017340] usb 2-1.8: Manufacturer: Broadcom Corp
> > [    8.017344] usb 2-1.8: SerialNumber: 0123456789ABCD
> > [    8.017794] usb 2-1.8: config 0 descriptor??
> > [    8.258411] ata5: SATA link down (SStatus 0 SControl 300)
> > [    8.578480] ata6: SATA link down (SStatus 0 SControl 300)
> > [    8.588630] sd 0:0:0:0: [sda] 500118192 512-byte logical blocks: (256
> GB/238 GiB)
> > [    8.588846] sd 0:0:0:0: [sda] Write Protect is off
> > [    8.588861] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
> > [    8.588967] sd 0:0:0:0: [sda] Write cache: enabled, read cache:
> enabled, doesn't support DPO or FUA
> > [    8.590122]  sda: sda1 sda2
> > [    8.591059] sd 0:0:0:0: [sda] Attached SCSI disk
> > [    8.609438] sr0: scsi3-mmc drive: 24x/8x writer dvd-ram cd/rw
> xa/form2 cdda tray
> > [    8.609451] cdrom: Uniform CD-ROM driver Revision: 3.20
> > [    8.609737] sr 1:0:0:0: Attached scsi CD-ROM sr0
> > [    8.714515] dracut: luksOpen /dev/sda2
> luks-400336fa-c7c4-4be3-a244-c909aa16a18c
> > [   13.862564] dracut: Scanning devices dm-0  for LVM logical volumes
> vg_dom0/lv_root vg_dom0/lv_swap
> > [   13.907639] dracut: inactive '/dev/vg_dom0/lv_root' [221.62 GiB]
> inherit
> > [   13.907708] dracut: inactive '/dev/vg_dom0/lv_swap' [16.34 GiB]
> inherit
> > [   14.162684] EXT4-fs (dm-1): INFO: recovery required on readonly
> filesystem
> > [   14.162693] EXT4-fs (dm-1): write access will be enabled during
> recovery
> > [   14.775779] EXT4-fs (dm-1): orphan cleanup on readonly fs
> > [   14.775800] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767209
> > [   14.775909] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767207
> > [   14.776007] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767205
> > [   14.776035] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767206
> > [   14.776062] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767204
> > [   14.776088] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767202
> > [   14.776117] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767198
> > [   14.776146] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767196
> > [   14.776172] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767191
> > [   14.776198] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767189
> > [   14.776227] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767188
> > [   14.776274] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767187
> > [   14.777018] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767186
> > [   14.777060] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767184
> > [   14.777089] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767183
> > [   14.777117] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767171
> > [   14.777146] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting
> unreferenced inode 5767170
> > [   14.777172] EXT4-fs (dm-1): 17 orphan inodes deleted
> > [   14.777177] EXT4-fs (dm-1): recovery complete
> > [   14.797124] EXT4-fs (dm-1): mounted filesystem with ordered data
> mode. Opts: (null)
> > [   14.806762] dracut: Mounted root filesystem
> /dev/mapper/vg_dom0-lv_root
> > [   14.957211] dracut: Switching root
> > [   15.599261] udev: starting version 151
> > [   15.673674] iTCO_vendor_support: vendor-support=0
> > [   15.676374] mei: module is from the staging directory, the quality is
> unknown, you have been warned.
> > [   15.676488] iTCO_wdt: Intel TCO WatchDog Timer Driver v1.07
> > [   15.676679] iTCO_wdt: Found a Cougar Point TCO device (Version=2,
> TCOBASE=0x0460)
> > [   15.676711] xen: registering gsi 16 triggering 0 polarity 1
> > [   15.676716] Already setup the GSI :16
> > [   15.676725] mei 0000:00:16.0: setting latency timer to 64
> > [   15.676754] iTCO_wdt: initialized. heartbeat=30 sec (nowayout=0)
> > [   15.712582] sd 0:0:0:0: Attached scsi generic sg0 type 0
> > [   15.712620] sr 1:0:0:0: Attached scsi generic sg1 type 5
> > [   15.730448] input: PC Speaker as /devices/platform/pcspkr/input/input8
> > [   15.734494] xen: registering gsi 18 triggering 0 polarity 1
> > [   15.734500] Already setup the GSI :18
> > [   15.734506] ACPI Warning: 0x0000000000004040-0x000000000000405f
> SystemIO conflicts with Region \_SB_.PCI0.SBUS.SMBI 1
> (20120320/utaddress-251)
> > [   15.734512] ACPI: If an ACPI driver is available for this device, you
> should use it instead of the native driver
> > [   15.737002] microcode: CPU0 sig=0x206a7, pf=0x10, revision=0x23
> > [   15.741412] watchdog: INTCAMT: cannot register miscdev on minor=130
> (err=-16)
> > [   15.741418] watchdog: error registering /dev/watchdog (err=-16)
> > [   15.741422] mei 0000:00:16.0: unable to register watchdog device.
> > [   15.790637] thermal LNXTHERM:00: registered as thermal_zone0
> > [   15.790641] ACPI: Thermal Zone [THM] (25 C)
> > [   15.814551] ACPI: Deprecated procfs I/F for battery is loaded, please
> retry with CONFIG_ACPI_PROCFS_POWER cleared
> > [   15.814559] ACPI: Battery Slot [BAT0] (battery present)
> > [   15.815037] ACPI: Deprecated procfs I/F for AC is loaded, please
> retry with CONFIG_ACPI_PROCFS_POWER cleared
> > [   15.815521] ACPI: AC Adapter [AC] (on-line)
> > [   15.867835] usbcore: registered new interface driver usbback
> > [   15.975826] ACPI: Deprecated procfs I/F for battery is loaded, please
> retry with CONFIG_ACPI_PROCFS_POWER cleared
> > [   15.975836] ACPI: Battery Slot [BAT1] (battery absent)
> > [   16.102871] ACPI: Deprecated procfs I/F for battery is loaded, please
> retry with CONFIG_ACPI_PROCFS_POWER cleared
> > [   16.102882] ACPI: Battery Slot [BAT2] (battery absent)
> > [   16.106793] sdhci: Secure Digital Host Controller Interface driver
> > [   16.106797] sdhci: Copyright(c) Pierre Ossman
> > [   16.107131] parport_pc 00:08: [io  0x0378-0x037b]
> > [   16.107296] parport_pc 00:08: [irq 5]
> > [   16.107709] sdhci-pci 0000:0a:00.0: SDHCI controller found
> [1217:8221] (rev 5)
> > [   16.159148] xen: registering gsi 17 triggering 0 polarity 1
> > [   16.159156] Already setup the GSI :17
> > [   16.159241] sdhci-pci 0000:0a:00.0: Invalid iomem size. You may
> experience problems.
> > [   16.159319] 0000:0a:00.0 supply vmmc not found, using dummy regulator
> > [   16.159384] Registered led device: mmc0::
> > [   16.160442] mmc0: SDHCI controller on PCI [0000:0a:00.0] using DMA
> > [   16.160928] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> > [   16.171737] Linux video capture interface: v2.00
> > [   16.192158] cdc_wdm 2-1.6:1.5: cdc-wdm0: USB WDM device
> > [   16.192211] cdc_wdm 2-1.6:1.8: cdc-wdm1: USB WDM device
> > [   16.192234] usbcore: registered new interface driver cdc_wdm
> > [   16.195744] cdc_acm 2-1.6:1.1: ttyACM0: USB ACM device
> > [   16.198739] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> > [   16.220532] cdc_acm 2-1.6:1.3: ttyACM1: USB ACM device
> > [   16.223728] cdc_acm 2-1.6:1.9: ttyACM2: USB ACM device
> > [   16.235089] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> > [   16.235234] usbcore: registered new interface driver cdc_acm
> > [   16.235236] cdc_acm: USB Abstract Control Model driver for USB modems
> and ISDN adapters
> > [   16.240235] uvcvideo: Found UVC 1.00 device
> Laptop_Integrated_Webcam_FHD (05ca:181c)
> > [   16.269474] input: Laptop_Integrated_Webcam_FHD as
> /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/input/input9
> > [   16.269579] usbcore: registered new interface driver uvcvideo
> > [   16.269581] USB Video Class driver (1.1.1)
> > [   16.277415] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> > [   16.296646] usb 2-1.6: MAC-Address: 02:80:37:ec:02:00
> > [   16.296810] cdc_ncm 2-1.6:1.6: usb0: register 'cdc_ncm' at
> usb-0000:00:1d.0-1.6, CDC NCM, 02:80:37:ec:02:00
> > [   16.296847] usbcore: registered new interface driver cdc_ncm
> > [   16.310604] parport_pc 00:08: activated
> > [   16.310611] parport_pc 00:08: reported by Plug and Play ACPI
> > [   16.310781] parport_pc 00:08: disabled
> > [   16.311583] tpm_tis 00:0a: 1.2 TPM (device-id 0x2001, rev-id 32)
> > [   16.399296] Bluetooth: Core ver 2.16
> > [   16.399312] NET: Registered protocol family 31
> > [   16.399314] Bluetooth: HCI device and connection manager initialized
> > [   16.399317] Bluetooth: HCI socket layer initialized
> > [   16.399318] Bluetooth: L2CAP socket layer initialized
> > [   16.399325] Bluetooth: SCO socket layer initialized
> > [   16.450583] xen: registering gsi 22 triggering 0 polarity 1
> > [   16.450600] xen: --> pirq=22 -> irq=22 (gsi=22)
> > [   16.567577] usbcore: registered new interface driver btusb
> > [   16.739259] dcdbas dcdbas: Dell Systems Management Base Driver
> (version 5.6.0-3.2)
> > [   16.819125] input: Dell WMI hotkeys as /devices/virtual/input/input10
> > [   16.925000] microcode: CPU1 sig=0x206a7, pf=0x10, revision=0x23
> > [   16.929246] ppdev: user-space parallel port driver
> > [   16.954783] microcode: CPU2 sig=0x206a7, pf=0x10, revision=0x23
> > [   16.975176] microcode: CPU3 sig=0x206a7, pf=0x10, revision=0x23
> > [   17.004696] microcode: Microcode Update Driver: v2.00 <
> tigran@aivazian.fsnet.co.uk>, Peter Oruba
> > [   17.067123] ALSA hda_codec.c:5101 autoconfig: line_outs=1
> (0xe/0x0/0x0/0x0/0x0) type:line
> > [   17.067127] ALSA hda_codec.c:5105    speaker_outs=1
> (0xd/0x0/0x0/0x0/0x0)
> > [   17.067129] ALSA hda_codec.c:5109    hp_outs=1 (0xb/0x0/0x0/0x0/0x0)
> > [   17.067131] ALSA hda_codec.c:5110    mono: mono_out=0x0
> > [   17.067133] ALSA hda_codec.c:5114    inputs:
> > [   17.067135] ALSA hda_codec.c:5118  Mic=0xa
> > [   17.067137] ALSA hda_codec.c:5118  Dock Mic=0xf
> > [   17.067139] ALSA hda_codec.c:5120
> > [   17.067637] ALSA patch_sigmatel.c:3117 stac92xx: dac_nids=1
> (0x13/0x0/0x0/0x0/0x0)
> > [   17.081104] input: HDA Intel PCH HDMI/DP,pcm=8 as
> /devices/pci0000:00/0000:00:1b.0/sound/card0/input11
> > [   17.081194] input: HDA Intel PCH HDMI/DP,pcm=7 as
> /devices/pci0000:00/0000:00:1b.0/sound/card0/input12
> > [   17.081250] input: HDA Intel PCH HDMI/DP,pcm=3 as
> /devices/pci0000:00/0000:00:1b.0/sound/card0/input13
> > [   17.081342] input: HDA Intel PCH Dock Mic as
> /devices/pci0000:00/0000:00:1b.0/sound/card0/input14
> > [   17.081432] input: HDA Intel PCH Mic as
> /devices/pci0000:00/0000:00:1b.0/sound/card0/input15
> > [   17.081522] input: HDA Intel PCH Headphone as
> /devices/pci0000:00/0000:00:1b.0/sound/card0/input16
> > [   17.081610] input: HDA Intel PCH Dock Line Out as
> /devices/pci0000:00/0000:00:1b.0/sound/card0/input17
> > [   17.265462] Event-channel device installed.
> > [   17.661764] EXT4-fs (dm-1): re-mounted. Opts: (null)
> > [   17.802446] EXT4-fs (sda1): mounted filesystem with ordered data
> mode. Opts: (null)
> > [   19.361631] Adding 17137660k swap on /dev/mapper/vg_dom0-lv_swap.
>  Priority:-1 extents:1 across:17137660k SS
> > [   22.602549] ehci_hcd 0000:00:1a.0: remove, state 1
> > [   22.602568] usb usb1: USB disconnect, device number 1
> > [   22.602573] usb 1-1: USB disconnect, device number 2
> > [   22.602578] usb 1-1.4: USB disconnect, device number 3
> > [   22.605235] usb 1-1.5: USB disconnect, device number 4
> > [   22.636910] ehci_hcd 0000:00:1a.0: USB bus 1 deregistered
> > [   22.637183] pciback 0000:00:1a.0: seizing device
> > [   22.637235] xen: registering gsi 16 triggering 0 polarity 1
> > [   22.637241] Already setup the GSI :16
> > [   22.662363] ehci_hcd 0000:00:1d.0: remove, state 1
> > [   22.662371] usb usb2: USB disconnect, device number 1
> > [   22.662373] usb 2-1: USB disconnect, device number 2
> > [   22.662376] usb 2-1.6: USB disconnect, device number 3
> > [   22.668531] cdc_ncm 2-1.6:1.6: usb0: unregister 'cdc_ncm'
> usb-0000:00:1d.0-1.6, CDC NCM
> > [   22.694795] usb 2-1.8: USB disconnect, device number 4
> > [   22.699298] ehci_hcd 0000:00:1d.0: USB bus 2 deregistered
> > [   22.699577] pciback 0000:00:1d.0: seizing device
> > [   22.699632] xen: registering gsi 17 triggering 0 polarity 1
> > [   22.699637] Already setup the GSI :17
> > [   23.684708] xen-pciback: vpci: 0000:00:19.0: assign to virtual slot 0
> > [   23.685240] xen-pciback: vpci: 0000:00:1a.0: assign to virtual slot 1
> > [   23.685722] xen-pciback: vpci: 0000:00:1d.0: assign to virtual slot 2
> > [   23.686764] xen-pciback: vpci: 0000:02:00.0: assign to virtual slot 3
> > [   23.909636] pciback 0000:00:19.0: Driver tried to write to a
> read-only configuration space field at offset 0xd2, size 2. This may be
> harmless, but if you have problems with your device:
> > [   23.909638] 1) see permissive attribute in sysfs
> > [   23.909638] 2) report problems to the xen-devel mailing list along
> with details of your device obtained from lspci.
> > [   23.917523] pciback 0000:02:00.0: Driver tried to write to a
> read-only configuration space field at offset 0xd2, size 2. This may be
> harmless, but if you have problems with your device:
> > [   23.917526] 1) see permissive attribute in sysfs
> > [   23.917526] 2) report problems to the xen-devel mailing list along
> with details of your device obtained from lspci.
> > [   24.123663] xen-blkback:ring-ref 9, event-channel 14, protocol 1
> (x86_64-abi)
> > [   24.140460] xen-blkback:ring-ref 10, event-channel 15, protocol 1
> (x86_64-abi)
> > [   24.151420] xen-blkback:ring-ref 11, event-channel 16, protocol 1
> (x86_64-abi)
> > [   24.158428] xen-blkback:ring-ref 12, event-channel 17, protocol 1
> (x86_64-abi)
> > [   28.697615] pciback 0000:00:1a.0: enabling device (0000 -> 0002)
> > [   28.697628] xen: registering gsi 16 triggering 0 polarity 1
> > [   28.697634] Already setup the GSI :16
> > [   28.697805] pciback 0000:00:1a.0: setting latency timer to 64
> > [   28.713578] pciback 0000:00:19.0: enabling device (0000 -> 0003)
> > [   28.713591] xen: registering gsi 20 triggering 0 polarity 1
> > [   28.713598] Already setup the GSI :20
> > [   28.713858] pciback 0000:00:19.0: setting latency timer to 64
> > [   29.021371] pciback 0000:00:1d.0: enabling device (0000 -> 0002)
> > [   29.021389] xen: registering gsi 17 triggering 0 polarity 1
> > [   29.021400] Already setup the GSI :17
> > [   29.021805] pciback 0000:00:1d.0: setting latency timer to 64
> > [   29.150053] pciback 0000:02:00.0: enabling device (0000 -> 0002)
> > [   29.150122] xen: registering gsi 17 triggering 0 polarity 1
> > [   29.150150] Already setup the GSI :17
> > [   33.635416] xen-blkback:ring-ref 9, event-channel 14, protocol 1
> (x86_64-abi)
> > [   33.643330] xen-blkback:ring-ref 10, event-channel 15, protocol 1
> (x86_64-abi)
> > [   33.651561] xen-blkback:ring-ref 11, event-channel 16, protocol 1
> (x86_64-abi)
> > [   33.672105] xen-blkback:ring-ref 12, event-channel 17, protocol 1
> (x86_64-abi)
> > [  104.230911] xen-blkback:ring-ref 9, event-channel 24, protocol 1
> (x86_64-abi)
> > [  104.252421] xen-blkback:ring-ref 10, event-channel 25, protocol 1
> (x86_64-abi)
> > [  104.253177] xen-blkback:ring-ref 11, event-channel 26, protocol 1
> (x86_64-abi)
> > [  104.254220] xen-blkback:ring-ref 12, event-channel 27, protocol 1
> (x86_64-abi)
> > [  105.086732] xen-blkback:ring-ref 9, event-channel 14, protocol 1
> (x86_64-abi)
> > [  105.105505] xen-blkback:ring-ref 10, event-channel 15, protocol 1
> (x86_64-abi)
> > [  105.115951] xen-blkback:ring-ref 11, event-channel 16, protocol 1
> (x86_64-abi)
> > [  105.127384] xen-blkback:ring-ref 12, event-channel 17, protocol 1
> (x86_64-abi)
> > [  105.929760] xen-blkback:ring-ref 9, event-channel 14, protocol 1
> (x86_64-abi)
> > [  105.934841] xen-blkback:ring-ref 10, event-channel 15, protocol 1
> (x86_64-abi)
> > [  105.973920] xen-blkback:ring-ref 11, event-channel 16, protocol 1
> (x86_64-abi)
> > [  105.975320] xen-blkback:ring-ref 12, event-channel 17, protocol 1
> (x86_64-abi)
> > [  107.191781] xen-blkback:ring-ref 9, event-channel 14, protocol 1
> (x86_64-abi)
> > [  107.203711] xen-blkback:ring-ref 10, event-channel 15, protocol 1
> (x86_64-abi)
> > [  107.208481] xen-blkback:ring-ref 11, event-channel 16, protocol 1
> (x86_64-abi)
> > [  107.212081] xen-blkback:ring-ref 12, event-channel 17, protocol 1
> (x86_64-abi)
> > [  733.434608] PM: Syncing filesystems ... done.
> > [  733.436228] PM: Preparing system for mem sleep
> > [  733.514803] Freezing user space processes ... (elapsed 0.01 seconds)
> done.
> > [  733.530594] Freezing remaining freezable tasks ... (elapsed 0.01
> seconds) done.
> > [  733.546589] PM: Entering mem sleep
> > [  733.546741] Suspending console(s) (use no_console_suspend to debug)
> > [  733.547431] sd 0:0:0:0: [sda] Synchronizing SCSI cache
> > [  733.558336] sd 0:0:0:0: [sda] Stopping disk
> > [  734.194656] PM: suspend of devices complete after 647.504 msecs
> > [  734.195026] PM: late suspend of devices complete after 0.359 msecs
> > [  734.210655] PM: noirq suspend of devices complete after 15.614 msecs
> > [  734.211326] ACPI: Preparing to enter system sleep state S3
> > [  734.235008] PM: Saving platform NVS memory
> > [  734.328066] Disabling non-boot CPUs ...
> > [  735.945491] ACPI: Low-level resume complete
> > [  735.945579] PM: Restoring platform NVS memory
> > [  736.000094] Enabling non-boot CPUs ...
> > [  736.000256] installing Xen timer for CPU 1
> > [  736.004594] CPU1 is up
> > [  736.004819] installing Xen timer for CPU 2
> > [  736.067516] CPU2 is up
> > [  736.067770] installing Xen timer for CPU 3
> > [  736.101535] CPU3 is up
> > [  736.102470] ACPI: Waking up from system sleep state S3
> > [  736.555932] PM: noirq resume of devices complete after 7.970 msecs
> > [  736.556506] PM: early resume of devices complete after 0.387 msecs
> > [  736.660336] i915 0000:00:02.0: setting latency timer to 64
> > [  736.660404] pciback 0000:00:19.0: setting latency timer to 64
> > [  736.660453] xen: registering gsi 16 triggering 0 polarity 1
> > [  736.660460] Already setup the GSI :16
> > [  736.660490] pciback 0000:00:1a.0: setting latency timer to 64
> > [  736.660605] xen: registering gsi 17 triggering 0 polarity 1
> > [  736.660610] Already setup the GSI :17
> > [  736.660641] pciback 0000:00:1d.0: setting latency timer to 64
> > [  736.660696] xen: registering gsi 22 triggering 0 polarity 1
> > [  736.660701] Already setup the GSI :22
> > [  736.661221] ahci 0000:00:1f.2: setting latency timer to 64
> > [  736.689606] xen: registering gsi 18 triggering 0 polarity 1
> > [  736.689608] Already setup the GSI :18
> > [  736.689704] xen: registering gsi 17 triggering 0 polarity 1
> > [  736.689706] Already setup the GSI :17
> > [  736.711623] [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp off
> > [  736.802676] watchdog: INTCAMT: cannot register miscdev on minor=130
> (err=-16)
> > [  736.802678] watchdog: error registering /dev/watchdog (err=-16)
> > [  736.802680] mei 0000:00:16.0: unable to register watchdog device.
> > [  737.060106] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> > [  737.060330] ata4: SATA link down (SStatus 0 SControl 300)
> > [  737.060372] ata5: SATA link down (SStatus 0 SControl 300)
> > [  737.074123] ata2.00: configured for UDMA/133
> > [  737.117629] ata6: SATA link down (SStatus 0 SControl 300)
> > [  738.619036] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
> > [  738.743565] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by
> device (Stat=0x51 Err=0x04)
> > [  738.901088] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by
> device (Stat=0x51 Err=0x04)
> > [  738.903441] ata1.00: configured for UDMA/100
> > [  738.903843] sd 0:0:0:0: [sda] Starting disk
> > [  738.905367] PM: resume of devices complete after 2348.851 msecs
> > [  738.905922] PM: Finishing wakeup.
> > [  738.905926] Restarting tasks ... done.
> > [  738.911334] video LNXVIDEO:00: Restoring backlight state
> > [  739.836250] dell_wmi: Received unknown WMI event (0x0)
> > [  740.184759] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> > [  740.239730] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> > [  740.327711] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> > [  740.373931] sdhci-pci 0000:0a:00.0: could not set regulator OCR (-22)
> > [  742.542022] hrtimer: interrupt took 102980031 ns
> > [  757.609031] [sched_delayed] sched: RT throttling activated
> > [  760.164427] hda-intel: IRQ timing workaround is activated for card
> #0. Suggest a bigger bdl_pos_adj.
>
> > (XEN) Xen version 4.1.3 (user@marmarek.net) (gcc version 4.4.5 20101112
> (Red Hat 4.4.5-2) (GCC) ) Mon Nov 26 15:25:32 EST 2012
> > (XEN) Latest ChangeSet: unavailable
> > (XEN) Bootloader: GNU GRUB 0.97
> > (XEN) Command line: console=none cpufreq=verbose=1
> > (XEN) Video information:
> > (XEN)  VGA is text mode 80x25, font 8x16
> > (XEN)  VBE/DDC methods: V2; EDID transfer time: 1 seconds
> > (XEN) Disc information:
> > (XEN)  Found 1 MBR signatures
> > (XEN)  Found 1 EDD information structures
> > (XEN) Xen-e820 RAM map:
> > (XEN)  0000000000000000 - 000000000009a800 (usable)
> > (XEN)  000000000009a800 - 00000000000a0000 (reserved)
> > (XEN)  00000000000e0000 - 0000000000100000 (reserved)
> > (XEN)  0000000000100000 - 0000000007eea000 (usable)
> > (XEN)  0000000007eea000 - 0000000007f67000 (ACPI NVS)
> > (XEN)  0000000007f67000 - 0000000007f70000 (usable)
> > (XEN)  0000000007f70000 - 0000000007f76000 (ACPI NVS)
> > (XEN)  0000000007f76000 - 0000000007f78000 (usable)
> > (XEN)  0000000007f78000 - 0000000008000000 (ACPI NVS)
> > (XEN)  0000000008000000 - 000000000dffd000 (usable)
> > (XEN)  000000000dffd000 - 000000000e000000 (ACPI data)
> > (XEN)  000000000e000000 - 0000000020000000 (usable)
> > (XEN)  0000000020000000 - 0000000020200000 (reserved)
> > (XEN)  0000000020200000 - 0000000040000000 (usable)
> > (XEN)  0000000040000000 - 0000000040200000 (reserved)
> > (XEN)  0000000040200000 - 00000000c83b4000 (usable)
> > (XEN)  00000000c83b4000 - 00000000c840a000 (reserved)
> > (XEN)  00000000c840a000 - 00000000c840e000 (usable)
> > (XEN)  00000000c840e000 - 00000000c840f000 (reserved)
> > (XEN)  00000000c840f000 - 00000000c8411000 (usable)
> > (XEN)  00000000c8411000 - 00000000c8414000 (reserved)
> > (XEN)  00000000c8414000 - 00000000c841e000 (usable)
> > (XEN)  00000000c841e000 - 00000000c8428000 (reserved)
> > (XEN)  00000000c8428000 - 00000000c8432000 (usable)
> > (XEN)  00000000c8432000 - 00000000c8436000 (reserved)
> > (XEN)  00000000c8436000 - 00000000cac00000 (usable)
> > (XEN)  00000000cb800000 - 00000000cfa00000 (reserved)
> > (XEN)  00000000fed1c000 - 00000000fed20000 (reserved)
> > (XEN)  00000000ffc00000 - 00000000ffc20000 (reserved)
> > (XEN)  0000000100000000 - 000000042e000000 (usable)
> > (XEN) ACPI: RSDP 000FE300, 0024 (r2 DELL  )
> > (XEN) ACPI: XSDT 0DFFEE18, 007C (r1 DELL    CBX3     6222004 MSFT
>  10013)
> > (XEN) ACPI: FACP 07F90D98, 00F4 (r4 DELL    CBX3     6222004 MSFT
>  10013)
> > (XEN) ACPI: DSDT 07F5E018, 8834 (r2 INT430 SYSFexxx     1001 INTL
> 20090903)
> > (XEN) ACPI: FACS 07FEDD40, 0040
> > (XEN) ACPI: APIC 0DFFDF18, 00CC (r2 DELL    CBX3     6222004 MSFT
>  10013)
> > (XEN) ACPI: TCPA 07FEED18, 0032 (r2                        0
> 0)
> > (XEN) ACPI: SSDT 07F91A98, 02F9 (r1 DELLTP      TPM     3000 INTL
> 20090903)
> > (XEN) ACPI: MCFG 07FEEC98, 003C (r1 DELL   SNDYBRDG  6222004 MSFT
> 97)
> > (XEN) ACPI: HPET 07FEEC18, 0038 (r1 A M I   PCHHPET  6222004 AMI.
>  3)
> > (XEN) ACPI: BOOT 07FEEB98, 0028 (r1 DELL   CBX3      6222004 AMI
> 10013)
> > (XEN) ACPI: SSDT 07F75018, 0804 (r1  PmRef  Cpu0Ist     3000 INTL
> 20090903)
> > (XEN) ACPI: SSDT 07F74018, 0996 (r1  PmRef    CpuPm     3000 INTL
> 20090903)
> > (XEN) ACPI: DMAR 07F90C18, 00E8 (r1 INTEL      SNB         1 INTL
>  1)
> > (XEN) ACPI: SLIC 07F7EC18, 0176 (r3 DELL    CBX3     6222004 MSFT
>  10013)
> > (XEN) System RAM: 16262MB (16652432kB)
> > (XEN) Domain heap initialised
> > (XEN) ACPI: 32/64X FACS address mismatch in FADT -
> 07fede40/0000000007fedd40, using 32
> > (XEN) Processor #0 6:10 APIC version 21
> > (XEN) Processor #2 6:10 APIC version 21
> > (XEN) Processor #1 6:10 APIC version 21
> > (XEN) Processor #3 6:10 APIC version 21
> > (XEN) IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-23
> > (XEN) Enabling APIC mode:  Flat.  Using 1 I/O APICs
> > (XEN) Table is not found!
> > (XEN) Switched to APIC driver x2apic_cluster.
> > (XEN) Using scheduler: SMP Credit Scheduler (credit)
> > (XEN) Detected 2494.416 MHz processor.
> > (XEN) Initing memory sharing.
> > (XEN) Intel VT-d supported page sizes: 4kB.
> > (XEN) Intel VT-d supported page sizes: 4kB.
> > (XEN) Intel VT-d Snoop Control not enabled.
> > (XEN) Intel VT-d Dom0 DMA Passthrough not enabled.
> > (XEN) Intel VT-d Queued Invalidation enabled.
> > (XEN) Intel VT-d Interrupt Remapping enabled.
> > (XEN) Intel VT-d Shared EPT tables not enabled.
> > (XEN) I/O virtualisation enabled
> > (XEN)  - Dom0 mode: Relaxed
> > (XEN) Enabled directed EOI with ioapic_ack_old on!
> > (XEN) ENABLING IO-APIC IRQs
> > (XEN)  -> Using old ACK method
> > (XEN) Platform timer appears to have unexpectedly wrapped 1 times.
> > (XEN) Platform timer is 14.318MHz HPET
> > (XEN) Allocated console ring of 16 KiB.
> > (XEN) VMX: Supported advanced features:
> > (XEN)  - APIC MMIO access virtualisation
> > (XEN)  - APIC TPR shadow
> > (XEN)  - Extended Page Tables (EPT)
> > (XEN)  - Virtual-Processor Identifiers (VPID)
> > (XEN)  - Virtual NMI
> > (XEN)  - MSR direct-access bitmap
> > (XEN)  - Unrestricted Guest
> > (XEN) HVM: ASIDs enabled.
> > (XEN) HVM: VMX enabled
> > (XEN) HVM: Hardware Assisted Paging (HAP) detected
> > (XEN) HVM: HAP page sizes: 4kB, 2MB
> > (XEN) Brought up 4 CPUs
> > (XEN) *** LOADING DOMAIN 0 ***
> > (XEN)  Xen  kernel: 64-bit, lsb, compat32
> > (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x1e13000
> > (XEN) PHYSICAL MEMORY ARRANGEMENT:
> > (XEN)  Dom0 alloc.:   0000000418000000->000000041c000000 (4046567 pages
> to be allocated)
> > (XEN)  Init. ramdisk: 000000042b335000->000000042dfffc00
> > (XEN) VIRTUAL MEMORY ARRANGEMENT:
> > (XEN)  Loaded kernel: ffffffff81000000->ffffffff81e13000
> > (XEN)  Init. ramdisk: ffffffff81e13000->ffffffff84addc00
> > (XEN)  Phys-Mach map: ffffffff84ade000->ffffffff869f3d90
> > (XEN)  Start info:    ffffffff869f4000->ffffffff869f44b4
> > (XEN)  Page tables:   ffffffff869f5000->ffffffff86a2e000
> > (XEN)  Boot stack:    ffffffff86a2e000->ffffffff86a2f000
> > (XEN)  TOTAL:         ffffffff80000000->ffffffff86c00000
> > (XEN)  ENTRY ADDRESS: ffffffff8188e200
> > (XEN) Dom0 has maximum 4 VCPUs
> > (XEN) Scrubbing Free RAM: .done.
> > (XEN) Xen trace buffers: disabled
> > (XEN) Std. Loglevel: Errors and warnings
> > (XEN) Guest Loglevel: Nothing (Rate-limited: Errors and warnings)
> > (XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch
> input to Xen)
> > (XEN) Freed 216kB init memory.
> > (XEN) no cpu_id for acpi_id 5
> > (XEN) no cpu_id for acpi_id 6
> > (XEN) no cpu_id for acpi_id 7
> > (XEN) no cpu_id for acpi_id 8
> > (XEN) physdev.c:171: dom0: wrong map_pirq type 3
> > (XEN) traps.c:2488:d1 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc9000057b030.
> > (XEN) traps.c:2488:d1 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc90000718030.
> > (XEN) traps.c:2488:d2 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc900004f2030.
> > (XEN) traps.c:2488:d2 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc900004fa030.
> > (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc90000251030.
> > (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc90000263030.
> > (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc9000026b030.
> > (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc90000273030.
> > (XEN) traps.c:2488:d4 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc900004f2030.
> > (XEN) traps.c:2488:d4 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc90000015030.
> > (XEN) traps.c:2488:d5 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc900004f2030.
> > (XEN) traps.c:2488:d5 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc90000015030.
> > (XEN) traps.c:2488:d6 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc900004f2030.
> > (XEN) traps.c:2488:d6 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc900004fa030.
> > (XEN) Disabling non-boot CPUs ...
> > (XEN) Broke affinity for irq 1
> > (XEN) Broke affinity for irq 8
> > (XEN) Broke affinity for irq 9
> > (XEN) Broke affinity for irq 12
> > (XEN) Broke affinity for irq 17
> > (XEN) Broke affinity for irq 31
> > (XEN) Broke affinity for irq 16
> > (XEN) Broke affinity for irq 20
> > (XEN) Entering ACPI S3 state.
> > (XEN) mce_intel.c:1162: MCA Capability: BCAST 1 SER 0 CMCI 1 firstbank 0
> extended MCE MSR 0
> > (XEN) CPU0 CMCI LVT vector (0xf7) already installed
> > (XEN) CPU0: Thermal LVT vector (0xfa) already installed
> > (XEN) Finishing wakeup from ACPI S3 state.
> > (XEN) Enabling non-boot CPUs  ...
> > (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc90000524030.
> > (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc9000052c030.
> > (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc90000015030.
> > (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from
> 0x0000000000000000 to 0xffffc9000001d030.
> > (XEN) Dumping timer queues:
> > (XEN) CPU00:
> > (XEN)   ex=     126us timer=ffff8300c83b0060
> cb=ffff82c48011e420(ffff8300c83b0000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=    1778us timer=ffff8304222f9de8
> cb=ffff82c480118250(0000000000000000) csched_tick+0x0/0x2e0
> > (XEN)   ex=     126us timer=ffff8300c81fc060
> cb=ffff82c48011e420(ffff8300c81fc000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   17227us timer=ffff82c4802bb980
> cb=ffff82c480138ff0(ffff82c4802bb940) do_dbs_timer+0x0/0x250
> > (XEN)   ex=   20744us timer=ffff830030094060
> cb=ffff82c48011e420(ffff830030094000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   27945us timer=ffff8304222fdde0
> cb=ffff82c480116f20(ffff8304222fddc0) csched_acct+0x0/0x460
> > (XEN)   ex=   29949us timer=ffff82c4802bb760
> cb=ffff82c48011ded0(0000000000000000) s_timer_fn+0x0/0x20
> > (XEN)   ex=   87774us timer=ffff83008db6a060
> cb=ffff82c48011e420(ffff83008db6a000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   79252us timer=ffff82c4802b3880
> cb=ffff82c480177160(0000000000000000) time_calibration+0x0/0x60
> > (XEN)   ex=  703146us timer=ffff8300a6b9c060
> cb=ffff82c48011e420(ffff8300a6b9c000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   35612us timer=ffff8300330dc060
> cb=ffff82c48011e420(ffff8300330dc000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   97688us timer=ffff8300a6b98060
> cb=ffff82c48011e420(ffff8300a6b98000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   30003us timer=ffff8300b129a060
> cb=ffff82c48011e420(ffff8300b129a000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   92679us timer=ffff8300c94a6060
> cb=ffff82c48011e420(ffff8300c94a6000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex= 4135118us timer=ffff8300bdca6060
> cb=ffff82c48011e420(ffff8300bdca6000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   96411us timer=ffff8300b128e060
> cb=ffff82c48011e420(ffff8300b128e000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex= 1337866us timer=ffff8300a6b94060
> cb=ffff82c48011e420(ffff8300a6b94000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   91194us timer=ffff830034b98060
> cb=ffff82c48011e420(ffff830034b98000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   97955us timer=ffff83007d948060
> cb=ffff82c48011e420(ffff83007d948000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex= 4135163us timer=ffff8300c5336060
> cb=ffff82c48011e420(ffff8300c5336000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=123464409us timer=ffff82c4802b3980
> cb=ffff82c480176ef0(0000000000000000) plt_overflow+0x0/0x190
> > (XEN)   ex=   95968us timer=ffff8300a6b96060
> cb=ffff82c48011e420(ffff8300a6b96000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=12401701us timer=ffff82c4802b65a0
> cb=ffff82c48019eb10(0000000000000000) mce_work_fn+0x0/0xd0
> > (XEN)   ex=   97804us timer=ffff8300301a8060
> cb=ffff82c48011e420(ffff8300301a8000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   97841us timer=ffff8300bd810060
> cb=ffff82c48011e420(ffff8300bd810000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   98039us timer=ffff83007d94c060
> cb=ffff82c48011e420(ffff83007d94c000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=   94727us timer=ffff83008db6e060
> cb=ffff82c48011e420(ffff83008db6e000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN)   ex=  319927us timer=ffff8300c840c060
> cb=ffff82c48011e420(ffff8300c840c000) vcpu_singleshot_timer_fn+0x0/0x10
> > (XEN) CPU01:
> > (XEN) CPU02:
> > (XEN) CPU03:
> > (XEN) 'c' pressed -> printing ACPI Cx structures
> > (XEN) ==cpu0==
> > (XEN) active state:           C3
> > (XEN) max_cstate:             C7
> > (XEN) states:
> > (XEN)     C1: type[C1] latency[000] usage[00254665] method[ HALT]
> duration[62720099833]
> > (XEN)     C2: type[C2] latency[080] usage[00069505] method[SYSIO]
> duration[36499255195]
> > (XEN)    *C3: type[C3] latency[109] usage[01828952] method[SYSIO]
> duration[5562126933174]
> > (XEN)     C0: usage[02153122] duration[2042526389598]
> > (XEN) PC3[0] PC6[0] PC7[0]
> > (XEN) CC3[0] CC6[0]
> > (XEN) ==cpu1==
> > (XEN) active state:           C1
> > (XEN) max_cstate:             C7
> > (XEN) states:
> > (XEN)    *C1: type[C1] latency[000] usage[00808027] method[ HALT]
> duration[6978799306750]
> > (XEN)     C0: usage[00808027] duration[725073398104]
> > (XEN) PC3[0] PC6[0] PC7[0]
> > (XEN) CC3[0] CC6[0]
> > (XEN) ==cpu2==
> > (XEN) active state:           C1
> > (XEN) max_cstate:             C7
> > (XEN) states:
> > (XEN)    *C1: type[C1] latency[000] usage[00825022] method[ HALT]
> duration[6981527416097]
> > (XEN)     C0: usage[00825022] duration[722345319882]
> > (XEN) PC3[0] PC6[0] PC7[0]
> > (XEN) CC3[0] CC6[0]
> > (XEN) ==cpu3==
> > (XEN) active state:           C1
> > (XEN) max_cstate:             C7
> > (XEN) states:
> > (XEN)    *C1: type[C1] latency[000] usage[00810292] method[ HALT]
> duration[6980835907857]
> > (XEN)     C0: usage[00810292] duration[723036844779]
> > (XEN) PC3[0] PC6[0] PC7[0]
> > (XEN) CC3[0] CC6[0]
>
>
>
>
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
>
>

--e89a8f3b9d3d4a9abe04cfbdb242
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I had similar, but (I think) different issues.<div><br></div><div>See the f=
ollowing thread:</div><div><a href=3D"http://markmail.org/search/?q=3De4a31=
205766d518276d0fbc1780bcd63db1a502d#query:e4a31205766d518276d0fbc1780bcd63d=
b1a502d+page:1+mid:udkd2qcvtyqj75re+state:results">http://markmail.org/sear=
ch/?q=3De4a31205766d518276d0fbc1780bcd63db1a502d#query:e4a31205766d518276d0=
fbc1780bcd63db1a502d+page:1+mid:udkd2qcvtyqj75re+state:results</a></div>
<div><br></div><div>I still have a patch reverting part of this changeset t=
o get S3 working with pinning CPU affinity... the affinity doesn&#39;t get =
restored on resume, however.</div><div><br></div><div>I don&#39;t have much=
 experience with this on Xen 4.1, as I ran into the issue when bringing up =
Xen-4.2, from Xen 4.0</div>
<div><br></div><div>However, I could see how this could be related, since i=
t is in the scheduler...<br><br><div class=3D"gmail_quote">On Fri, Nov 30, =
2012 at 4:33 PM, Konrad Rzeszutek Wilk <span dir=3D"ltr">&lt;<a href=3D"mai=
lto:konrad@kernel.org" target=3D"_blank">konrad@kernel.org</a>&gt;</span> w=
rote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"im">On Thu, Nov 29, 2012 at 07=
:55:06PM +0100, Marek Marczykowski wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; After resume from ACPI S3 system has only CPU0 enabled, every vCPU fro=
m every<br>
&gt; domain works on CPU0 [1]. =A0When trying to pin some vCPU to CPU1 got =
error:<br>
&gt; xl vcpu-pin testvm 1 1<br>
&gt; libxl: error: libxl.c:2565:libxl_set_vcpuaffinity setting vcpu affinit=
y:<br>
&gt; Invalid argument<br>
&gt;<br>
&gt; What went wrong? How can I reenable CPU1-CPU3?<br>
<br>
</div>I think Ben had found some issues with this in the past? CC-ing him<b=
r>
here.<br>
<div><div class=3D"h5">&gt;<br>
&gt; System info:<br>
&gt; xen 4.1.3<br>
&gt; linux 3.4.18 with acpi-s3 patches from Konrad&#39;s git<br>
&gt; Processor: Intel i5-2520M<br>
&gt;<br>
&gt; dmesg from dom0 and hypervisor attached.<br>
&gt;<br>
&gt; BTW Are there any plans to upstream acpi-s3 patches?<br>
&gt;<br>
&gt; [1] xl vcpu-list:<br>
&gt; Name =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ID=
 =A0VCPU =A0 CPU State =A0 Time(s) CPU Affinity<br>
&gt; dom0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0=
 =A0 =A0 0 =A0 =A00 =A0 r-- =A0 =A01347.8 =A0any cpu<br>
&gt; dom0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0=
 =A0 =A0 1 =A0 =A00 =A0 -b- =A0 =A0 594.4 =A0any cpu<br>
&gt; dom0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0=
 =A0 =A0 2 =A0 =A00 =A0 -b- =A0 =A0 421.1 =A0any cpu<br>
&gt; dom0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0=
 =A0 =A0 3 =A0 =A00 =A0 -b- =A0 =A0 432.6 =A0any cpu<br>
&gt; netvm =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A01=
 =A0 =A0 0 =A0 =A00 =A0 -b- =A0 =A0 596.6 =A0any cpu<br>
&gt; netvm =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A01=
 =A0 =A0 1 =A0 =A00 =A0 -b- =A0 =A0 363.7 =A0any cpu<br>
&gt; firewallvm =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 2 =A0 =
=A0 0 =A0 =A00 =A0 -b- =A0 =A0 170.5 =A0any cpu<br>
&gt; firewallvm =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 2 =A0 =
=A0 1 =A0 =A00 =A0 -b- =A0 =A0 122.5 =A0any cpu<br>
&gt; devel17 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A03 =
=A0 =A0 0 =A0 =A00 =A0 -b- =A0 =A0 137.0 =A0any cpu<br>
&gt; devel17 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A03 =
=A0 =A0 1 =A0 =A00 =A0 -b- =A0 =A0 112.9 =A0any cpu<br>
&gt; devel17 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A03 =
=A0 =A0 2 =A0 =A00 =A0 -b- =A0 =A0 =A097.9 =A0any cpu<br>
&gt; devel17 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A03 =
=A0 =A0 3 =A0 =A00 =A0 -b- =A0 =A0 116.0 =A0any cpu<br>
&gt; vm2 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A04 =A0 =A0 0 =A0 =A00 =A0 -b- =A0 =A0 418.6 =A0any cpu<br>
&gt; vm2 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A04 =A0 =A0 1 =A0 =A00 =A0 -b- =A0 =A0 390.2 =A0any cpu<br>
&gt; private =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A05 =
=A0 =A0 0 =A0 =A00 =A0 -b- =A0 =A0 175.9 =A0any cpu<br>
&gt; private =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A05 =
=A0 =A0 1 =A0 =A00 =A0 -b- =A0 =A0 161.6 =A0any cpu<br>
&gt; mail =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 6=
 =A0 =A0 0 =A0 =A00 =A0 -b- =A0 =A01587.1 =A0any cpu<br>
&gt; mail =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 6=
 =A0 =A0 1 =A0 =A00 =A0 -b- =A0 =A01717.5 =A0any cpu<br>
&gt; testvm =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 7 =
=A0 =A0 0 =A0 =A00 =A0 -b- =A0 =A0 =A073.0 =A0any cpu<br>
&gt; testvm =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 7 =
=A0 =A0 1 =A0 =A00 =A0 -b- =A0 =A0 =A068.9 =A0any cpu<br>
&gt; testvm =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 7 =
=A0 =A0 2 =A0 =A00 =A0 -b- =A0 =A0 =A051.4 =A0any cpu<br>
&gt; testvm =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 7 =
=A0 =A0 3 =A0 =A00 =A0 -b- =A0 =A0 =A067.1 =A0any cpu<br>
&gt; disp1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A08=
 =A0 =A0 0 =A0 =A00 =A0 -b- =A0 =A0 199.9 =A0any cpu<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Best Regards / Pozdrawiam,<br>
&gt; Marek Marczykowski<br>
&gt; Invisible Things Lab<br>
<br>
</div></div>&gt; [ =A0 =A00.000000] Initializing cgroup subsys cpuset<br>
&gt; [ =A0 =A00.000000] Initializing cgroup subsys cpu<br>
&gt; [ =A0 =A00.000000] Linux version 3.4.18-2.pvops.qubes.x86_64 (<a href=
=3D"mailto:user@nemezis.marmarek.net">user@nemezis.marmarek.net</a>) (gcc v=
ersion 4.4.5 20101112 (Red Hat 4.4.5-2) (GCC) ) #1 SMP Wed Nov 7 22:47:21 E=
ST 2012<br>

&gt; [ =A0 =A00.000000] Command line: ro root=3D/dev/mapper/vg_dom0-lv_root=
 rd_LUKS_UUID=3Dluks-400336fa-c7c4-4be3-a244-c909aa16a18c rd_LVM_LV=3Dvg_do=
m0/lv_root rd_LVM_LV=3Dvg_dom0/lv_swap rd_NO_MD rd_NO_DM LANG=3Den_US.UTF-8=
 SYSFONT=3Dlatarcyrheb-sun16 KEYTABLE=3Dpl2 rhgb quiet max_loop=3D255<br>

&gt; [ =A0 =A00.000000] Freeing =A09a-100 pfn range: 102 pages freed<br>
&gt; [ =A0 =A00.000000] 1-1 mapping on 9a-&gt;100<br>
&gt; [ =A0 =A00.000000] Freeing =A07eea-7f67 pfn range: 125 pages freed<br>
&gt; [ =A0 =A00.000000] 1-1 mapping on 7eea-&gt;7f67<br>
&gt; [ =A0 =A00.000000] Freeing =A07f70-7f76 pfn range: 6 pages freed<br>
&gt; [ =A0 =A00.000000] 1-1 mapping on 7f70-&gt;7f76<br>
&gt; [ =A0 =A00.000000] Freeing =A07f78-8000 pfn range: 136 pages freed<br>
&gt; [ =A0 =A00.000000] 1-1 mapping on 7f78-&gt;8000<br>
&gt; [ =A0 =A00.000000] Freeing =A0dffd-e000 pfn range: 3 pages freed<br>
&gt; [ =A0 =A00.000000] 1-1 mapping on dffd-&gt;e000<br>
&gt; [ =A0 =A00.000000] Freeing =A020000-20200 pfn range: 512 pages freed<b=
r>
&gt; [ =A0 =A00.000000] 1-1 mapping on 20000-&gt;20200<br>
&gt; [ =A0 =A00.000000] Freeing =A040000-40200 pfn range: 512 pages freed<b=
r>
&gt; [ =A0 =A00.000000] 1-1 mapping on 40000-&gt;40200<br>
&gt; [ =A0 =A00.000000] Freeing =A0c83b4-c840a pfn range: 86 pages freed<br=
>
&gt; [ =A0 =A00.000000] 1-1 mapping on c83b4-&gt;c840a<br>
&gt; [ =A0 =A00.000000] Freeing =A0c840e-c840f pfn range: 1 pages freed<br>
&gt; [ =A0 =A00.000000] 1-1 mapping on c840e-&gt;c840f<br>
&gt; [ =A0 =A00.000000] Freeing =A0c8411-c8414 pfn range: 3 pages freed<br>
&gt; [ =A0 =A00.000000] 1-1 mapping on c8411-&gt;c8414<br>
&gt; [ =A0 =A00.000000] Freeing =A0c841e-c8428 pfn range: 10 pages freed<br=
>
&gt; [ =A0 =A00.000000] 1-1 mapping on c841e-&gt;c8428<br>
&gt; [ =A0 =A00.000000] Freeing =A0c8432-c8436 pfn range: 4 pages freed<br>
&gt; [ =A0 =A00.000000] 1-1 mapping on c8432-&gt;c8436<br>
&gt; [ =A0 =A00.000000] Freeing =A0cac00-100000 pfn range: 218112 pages fre=
ed<br>
&gt; [ =A0 =A00.000000] 1-1 mapping on cac00-&gt;100000<br>
&gt; [ =A0 =A00.000000] Released 219612 pages of unused memory<br>
&gt; [ =A0 =A00.000000] Set 219612 page(s) to 1-1 mapping<br>
&gt; [ =A0 =A00.000000] BIOS-provided physical RAM map:<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000000000000 - 000000000009a000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 000000000009a800 - 0000000000100000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000000100000 - 0000000007eea000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000007eea000 - 0000000007f67000 (ACPI N=
VS)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000007f67000 - 0000000007f70000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000007f70000 - 0000000007f76000 (ACPI N=
VS)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000007f76000 - 0000000007f78000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000007f78000 - 0000000008000000 (ACPI N=
VS)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000008000000 - 000000000dffd000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 000000000dffd000 - 000000000e000000 (ACPI d=
ata)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 000000000e000000 - 0000000020000000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000020000000 - 0000000020200000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000020200000 - 0000000040000000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000040000000 - 0000000040200000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000040200000 - 00000000c83b4000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c83b4000 - 00000000c840a000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c840a000 - 00000000c840e000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c840e000 - 00000000c840f000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c840f000 - 00000000c8411000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c8411000 - 00000000c8414000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c8414000 - 00000000c841e000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c841e000 - 00000000c8428000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c8428000 - 00000000c8432000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c8432000 - 00000000c8436000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000c8436000 - 00000000cac00000 (usable=
)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000cb800000 - 00000000cfa00000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000fec00000 - 00000000fec01000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000fed1c000 - 00000000fed20000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000fee00000 - 00000000fee01000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 00000000ffc00000 - 00000000ffc20000 (reserv=
ed)<br>
&gt; [ =A0 =A00.000000] =A0Xen: 0000000100000000 - 000000042e000000 (usable=
)<br>
&gt; [ =A0 =A00.000000] NX (Execute Disable) protection: active<br>
&gt; [ =A0 =A00.000000] DMI 2.6 present.<br>
&gt; [ =A0 =A00.000000] DMI: Dell Inc. Latitude E6420/0K0DNP, BIOS A13 05/1=
7/2012<br>
&gt; [ =A0 =A00.000000] e820 update range: 0000000000000000 - 0000000000010=
000 (usable) =3D=3D&gt; (reserved)<br>
&gt; [ =A0 =A00.000000] e820 remove range: 00000000000a0000 - 0000000000100=
000 (usable)<br>
&gt; [ =A0 =A00.000000] No AGP bridge found<br>
&gt; [ =A0 =A00.000000] last_pfn =3D 0x42e000 max_arch_pfn =3D 0x400000000<=
br>
&gt; [ =A0 =A00.000000] x2apic enabled by BIOS, switching to x2apic ops<br>
&gt; [ =A0 =A00.000000] last_pfn =3D 0xcac00 max_arch_pfn =3D 0x400000000<b=
r>
&gt; [ =A0 =A00.000000] found SMP MP-table at [ffff8800000f1ad0] f1ad0<br>
&gt; [ =A0 =A00.000000] initial memory mapped : 0 - 04ade000<br>
&gt; [ =A0 =A00.000000] Base memory trampoline at [ffff880000095000] 95000 =
size 20480<br>
&gt; [ =A0 =A00.000000] init_memory_mapping: 0000000000000000-00000000cac00=
000<br>
&gt; [ =A0 =A00.000000] =A00000000000 - 00cac00000 page 4k<br>
&gt; [ =A0 =A00.000000] kernel direct mapping tables up to 0xcabfffff @ [me=
m 0x009a5000-0x00ffffff]<br>
&gt; [ =A0 =A00.000000] xen: setting RW the range fc4000 - 1000000<br>
&gt; [ =A0 =A00.000000] init_memory_mapping: 0000000100000000-000000042e000=
000<br>
&gt; [ =A0 =A00.000000] =A00100000000 - 042e000000 page 4k<br>
&gt; [ =A0 =A00.000000] kernel direct mapping tables up to 0x42dffffff @ [m=
em 0xc9282000-0xcabfffff]<br>
&gt; [ =A0 =A00.000000] xen: setting RW the range cabff000 - cac00000<br>
&gt; [ =A0 =A00.000000] RAMDISK: 01e13000 - 04ade000<br>
&gt; [ =A0 =A00.000000] ACPI: RSDP 00000000000fe300 00024 (v02 DELL =A0)<br=
>
&gt; [ =A0 =A00.000000] ACPI: XSDT 000000000dffee18 0007C (v01 DELL =A0 =A0=
CBX3 =A0 =A006222004 MSFT 00010013)<br>
&gt; [ =A0 =A00.000000] ACPI: FACP 0000000007f90d98 000F4 (v04 DELL =A0 =A0=
CBX3 =A0 =A006222004 MSFT 00010013)<br>
&gt; [ =A0 =A00.000000] ACPI Warning: 32/64 FACS address mismatch in FADT -=
 two FACS tables! (20120320/tbfadt-378)<br>
&gt; [ =A0 =A00.000000] ACPI Warning: 32/64X FACS address mismatch in FADT =
- 0x07FEDE40/0x0000000007FEDD40, using 32 (20120320/tbfadt-502)<br>
&gt; [ =A0 =A00.000000] ACPI: DSDT 0000000007f5e018 08834 (v02 INT430 SYSFe=
xxx 00001001 INTL 20090903)<br>
&gt; [ =A0 =A00.000000] ACPI: FACS 0000000007fede40 00040<br>
&gt; [ =A0 =A00.000000] ACPI: APIC 000000000dffdf18 000CC (v02 DELL =A0 =A0=
CBX3 =A0 =A006222004 MSFT 00010013)<br>
&gt; [ =A0 =A00.000000] ACPI: TCPA 0000000007feed18 00032 (v02 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 00000000 =A0 =A0 =A000000000)<br>
&gt; [ =A0 =A00.000000] ACPI: SSDT 0000000007f91a98 002F9 (v01 DELLTP =A0 =
=A0 =A0TPM 00003000 INTL 20090903)<br>
&gt; [ =A0 =A00.000000] ACPI: MCFG 0000000007feec98 0003C (v01 DELL =A0 SND=
YBRDG 06222004 MSFT 00000097)<br>
&gt; [ =A0 =A00.000000] ACPI: HPET 0000000007feec18 00038 (v01 A M I =A0 PC=
HHPET 06222004 AMI. 00000003)<br>
&gt; [ =A0 =A00.000000] ACPI: BOOT 0000000007feeb98 00028 (v01 DELL =A0 CBX=
3 =A0 =A0 06222004 AMI =A000010013)<br>
&gt; [ =A0 =A00.000000] ACPI: SSDT 0000000007f75018 00804 (v01 =A0PmRef =A0=
Cpu0Ist 00003000 INTL 20090903)<br>
&gt; [ =A0 =A00.000000] ACPI: SSDT 0000000007f74018 00996 (v01 =A0PmRef =A0=
 =A0CpuPm 00003000 INTL 20090903)<br>
&gt; [ =A0 =A00.000000] ACPI: XMAR 0000000007f90c18 000E8 (v01 INTEL =A0 =
=A0 =A0SNB =A000000001 INTL 00000001)<br>
&gt; [ =A0 =A00.000000] ACPI: SLIC 0000000007f7ec18 00176 (v03 DELL =A0 =A0=
CBX3 =A0 =A006222004 MSFT 00010013)<br>
&gt; [ =A0 =A00.000000] ACPI: Local APIC address 0xfee00000<br>
&gt; [ =A0 =A00.000000] Setting APIC routing to cluster x2apic.<br>
&gt; [ =A0 =A00.000000] Zone PFN ranges:<br>
&gt; [ =A0 =A00.000000] =A0 DMA =A0 =A0 =A00x00000010 -&gt; 0x00001000<br>
&gt; [ =A0 =A00.000000] =A0 DMA32 =A0 =A00x00001000 -&gt; 0x00100000<br>
&gt; [ =A0 =A00.000000] =A0 Normal =A0 0x00100000 -&gt; 0x0042e000<br>
&gt; [ =A0 =A00.000000] Movable zone start PFN for each node<br>
&gt; [ =A0 =A00.000000] Early memory PFN ranges<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x00000010 -&gt; 0x0000009a<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x00000100 -&gt; 0x00007eea<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x00007f67 -&gt; 0x00007f70<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x00007f76 -&gt; 0x00007f78<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x00008000 -&gt; 0x0000dffd<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x0000e000 -&gt; 0x00020000<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x00020200 -&gt; 0x00040000<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x00040200 -&gt; 0x000c83b4<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x000c840a -&gt; 0x000c840e<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x000c840f -&gt; 0x000c8411<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x000c8414 -&gt; 0x000c841e<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x000c8428 -&gt; 0x000c8432<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x000c8436 -&gt; 0x000cac00<br>
&gt; [ =A0 =A00.000000] =A0 =A0 0: 0x00100000 -&gt; 0x0042e000<br>
&gt; [ =A0 =A00.000000] On node 0 totalpages: 4163092<br>
&gt; [ =A0 =A00.000000] =A0 DMA zone: 56 pages used for memmap<br>
&gt; [ =A0 =A00.000000] =A0 DMA zone: 1572 pages reserved<br>
&gt; [ =A0 =A00.000000] =A0 DMA zone: 2350 pages, LIFO batch:0<br>
&gt; [ =A0 =A00.000000] =A0 DMA32 zone: 14280 pages used for memmap<br>
&gt; [ =A0 =A00.000000] =A0 DMA32 zone: 810690 pages, LIFO batch:31<br>
&gt; [ =A0 =A00.000000] =A0 Normal zone: 45584 pages used for memmap<br>
&gt; [ =A0 =A00.000000] =A0 Normal zone: 3288560 pages, LIFO batch:31<br>
&gt; [ =A0 =A00.000000] ACPI: PM-Timer IO Port: 0x408<br>
&gt; [ =A0 =A00.000000] ACPI: Local APIC address 0xfee00000<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)<=
br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x02] enabled)<=
br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x03] lapic_id[0x01] enabled)<=
br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)<=
br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x05] lapic_id[0x04] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x06] lapic_id[0x05] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x07] lapic_id[0x06] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x08] lapic_id[0x07] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x09] lapic_id[0x08] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x0a] lapic_id[0x09] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x0b] lapic_id[0x0a] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x0c] lapic_id[0x0b] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x0d] lapic_id[0x0c] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x0e] lapic_id[0x0d] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x0f] lapic_id[0x0e] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: LAPIC (acpi_id[0x10] lapic_id[0x0f] disabled)=
<br>
&gt; [ =A0 =A00.000000] ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base=
[0])<br>
&gt; [ =A0 =A00.000000] IOAPIC[0]: apic_id 2, version 253, address 0xfec000=
00, GSI 0-253<br>
&gt; [ =A0 =A00.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl=
 dfl)<br>
&gt; [ =A0 =A00.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 hig=
h level)<br>
&gt; [ =A0 =A00.000000] ACPI: IRQ0 used by override.<br>
&gt; [ =A0 =A00.000000] ACPI: IRQ2 used by override.<br>
&gt; [ =A0 =A00.000000] ACPI: IRQ9 used by override.<br>
&gt; [ =A0 =A00.000000] Using ACPI (MADT) for SMP configuration information=
<br>
&gt; [ =A0 =A00.000000] ACPI: HPET id: 0x8086a701 base: 0xfed00000<br>
&gt; [ =A0 =A00.000000] SMP: Allowing 16 CPUs, 12 hotplug CPUs<br>
&gt; [ =A0 =A00.000000] nr_irqs_gsi: 270<br>
&gt; [ =A0 =A00.000000] Allocating PCI resources starting at cfa00000 (gap:=
 cfa00000:2f200000)<br>
&gt; [ =A0 =A00.000000] Booting paravirtualized kernel on Xen<br>
&gt; [ =A0 =A00.000000] Xen version: 4.1.3 (preserve-AD)<br>
&gt; [ =A0 =A00.000000] setup_percpu: NR_CPUS:512 nr_cpumask_bits:512 nr_cp=
u_ids:16 nr_node_ids:1<br>
&gt; [ =A0 =A00.000000] PERCPU: Embedded 28 pages/cpu @ffff8803e2800000 s82=
176 r8192 d24320 u131072<br>
&gt; [ =A0 =A00.000000] pcpu-alloc: s82176 r8192 d24320 u131072 alloc=3D1*2=
097152<br>
&gt; [ =A0 =A00.000000] pcpu-alloc: [0] 00 01 02 03 04 05 06 07 08 09 10 11=
 12 13 14 15<br>
&gt; [ =A0 =A04.119805] Built 1 zonelists in Zone order, mobility grouping =
on. =A0Total pages: 4101600<br>
&gt; [ =A0 =A04.119809] Kernel command line: ro root=3D/dev/mapper/vg_dom0-=
lv_root rd_LUKS_UUID=3Dluks-400336fa-c7c4-4be3-a244-c909aa16a18c rd_LVM_LV=
=3Dvg_dom0/lv_root rd_LVM_LV=3Dvg_dom0/lv_swap rd_NO_MD rd_NO_DM LANG=3Den_=
US.UTF-8 SYSFONT=3Dlatarcyrheb-sun16 KEYTABLE=3Dpl2 rhgb quiet max_loop=3D2=
55<br>

&gt; [ =A0 =A04.119915] PID hash table entries: 4096 (order: 3, 32768 bytes=
)<br>
&gt; [ =A0 =A04.120928] Dentry cache hash table entries: 2097152 (order: 12=
, 16777216 bytes)<br>
&gt; [ =A0 =A04.124018] Inode-cache hash table entries: 1048576 (order: 11,=
 8388608 bytes)<br>
&gt; [ =A0 =A04.147064] Placing 64MB software IO TLB between ffff8803ce2000=
00 - ffff8803d2200000<br>
&gt; [ =A0 =A04.147066] software IO TLB at phys 0x3ce200000 - 0x3d2200000<b=
r>
&gt; [ =A0 =A04.181675] Memory: 14975940k/17530880k available (4557k kernel=
 code, 878512k absent, 1676428k reserved, 4112k data, 552k init)<br>
&gt; [ =A0 =A04.181730] Hierarchical RCU implementation.<br>
&gt; [ =A0 =A04.181731] =A0 =A0 =A0 =A0RCU dyntick-idle grace-period accele=
ration is enabled.<br>
&gt; [ =A0 =A04.181738] NR_IRQS:33024 nr_irqs:1024 16<br>
&gt; [ =A0 =A04.181799] xen: sci override: global_irq=3D9 trigger=3D0 polar=
ity=3D0<br>
&gt; [ =A0 =A04.181801] xen: registering gsi 9 triggering 0 polarity 0<br>
&gt; [ =A0 =A04.181809] xen: --&gt; pirq=3D9 -&gt; irq=3D9 (gsi=3D9)<br>
&gt; [ =A0 =A04.181829] xen: acpi sci 9<br>
&gt; [ =A0 =A04.181831] xen: --&gt; pirq=3D1 -&gt; irq=3D1 (gsi=3D1)<br>
&gt; [ =A0 =A04.181834] xen: --&gt; pirq=3D2 -&gt; irq=3D2 (gsi=3D2)<br>
&gt; [ =A0 =A04.181836] xen: --&gt; pirq=3D3 -&gt; irq=3D3 (gsi=3D3)<br>
&gt; [ =A0 =A04.181838] xen: --&gt; pirq=3D4 -&gt; irq=3D4 (gsi=3D4)<br>
&gt; [ =A0 =A04.181840] xen: --&gt; pirq=3D5 -&gt; irq=3D5 (gsi=3D5)<br>
&gt; [ =A0 =A04.181843] xen: --&gt; pirq=3D6 -&gt; irq=3D6 (gsi=3D6)<br>
&gt; [ =A0 =A04.181845] xen: --&gt; pirq=3D7 -&gt; irq=3D7 (gsi=3D7)<br>
&gt; [ =A0 =A04.181847] xen: --&gt; pirq=3D8 -&gt; irq=3D8 (gsi=3D8)<br>
&gt; [ =A0 =A04.181849] xen: --&gt; pirq=3D10 -&gt; irq=3D10 (gsi=3D10)<br>
&gt; [ =A0 =A04.181851] xen: --&gt; pirq=3D11 -&gt; irq=3D11 (gsi=3D11)<br>
&gt; [ =A0 =A04.181854] xen: --&gt; pirq=3D12 -&gt; irq=3D12 (gsi=3D12)<br>
&gt; [ =A0 =A04.181856] xen: --&gt; pirq=3D13 -&gt; irq=3D13 (gsi=3D13)<br>
&gt; [ =A0 =A04.181858] xen: --&gt; pirq=3D14 -&gt; irq=3D14 (gsi=3D14)<br>
&gt; [ =A0 =A04.181860] xen: --&gt; pirq=3D15 -&gt; irq=3D15 (gsi=3D15)<br>
&gt; [ =A0 =A04.182986] Console: colour VGA+ 80x25<br>
&gt; [ =A0 =A04.183012] console [tty0] enabled<br>
&gt; [ =A0 =A04.183026] Xen: using vcpuop timer interface<br>
&gt; [ =A0 =A04.183030] installing Xen timer for CPU 0<br>
&gt; [ =A0 =A04.183048] Detected 2494.416 MHz processor.<br>
&gt; [ =A0 =A04.183052] Calibrating delay loop (skipped), value calculated =
using timer frequency.. 4988.83 BogoMIPS (lpj=3D9977664)<br>
&gt; [ =A0 =A04.183054] pid_max: default: 32768 minimum: 301<br>
&gt; [ =A0 =A04.183090] Mount-cache hash table entries: 256<br>
&gt; [ =A0 =A04.183222] Initializing cgroup subsys cpuacct<br>
&gt; [ =A0 =A04.183224] Initializing cgroup subsys devices<br>
&gt; [ =A0 =A04.183225] Initializing cgroup subsys freezer<br>
&gt; [ =A0 =A04.183227] Initializing cgroup subsys net_cls<br>
&gt; [ =A0 =A04.183228] Initializing cgroup subsys blkio<br>
&gt; [ =A0 =A04.183280] ENERGY_PERF_BIAS: Set to &#39;normal&#39;, was &#39=
;performance&#39;<br>
&gt; [ =A0 =A04.183281] ENERGY_PERF_BIAS: View and update with x86_energy_p=
erf_policy(8)<br>
&gt; [ =A0 =A04.183284] CPU: Physical Processor ID: 0<br>
&gt; [ =A0 =A04.183285] CPU: Processor Core ID: 0<br>
&gt; [ =A0 =A04.184454] ACPI: Core revision 20120320<br>
&gt; [ =A0 =A04.194658] Performance Events: unsupported p6 CPU model 42 no =
PMU driver, software events only.<br>
&gt; [ =A0 =A04.194796] installing Xen timer for CPU 1<br>
&gt; [ =A0 =A04.194988] installing Xen timer for CPU 2<br>
&gt; [ =A0 =A04.195140] installing Xen timer for CPU 3<br>
&gt; [ =A0 =A04.195232] Brought up 4 CPUs<br>
&gt; [ =A0 =A04.195477] devtmpfs: initialized<br>
&gt; [ =A0 =A04.199046] PM: Registering ACPI NVS region [mem 0x07eea000-0x0=
7f66fff] (512000 bytes)<br>
&gt; [ =A0 =A04.199056] PM: Registering ACPI NVS region [mem 0x07f70000-0x0=
7f75fff] (24576 bytes)<br>
&gt; [ =A0 =A04.199058] PM: Registering ACPI NVS region [mem 0x07f78000-0x0=
7ffffff] (557056 bytes)<br>
&gt; [ =A0 =A04.199069] Dell Latitude E6420 series board detected. Selectin=
g PCI-method for reboots.<br>
&gt; [ =A0 =A04.199104] Grant tables using version 2 layout.<br>
&gt; [ =A0 =A04.199114] Grant table initialized<br>
&gt; [ =A0 =A04.199158] dummy:<br>
&gt; [ =A0 =A04.199205] RTC time: =A01:19:35, date: 11/29/12<br>
&gt; [ =A0 =A04.199256] NET: Registered protocol family 16<br>
&gt; [ =A0 =A04.199465] ACPI FADT declares the system doesn&#39;t support P=
CIe ASPM, so disable it<br>
&gt; [ =A0 =A04.199467] ACPI: bus type pci registered<br>
&gt; [ =A0 =A04.199548] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem 0=
xf8000000-0xfbffffff] (base 0xf8000000)<br>
&gt; [ =A0 =A04.199550] PCI: not using MMCONFIG<br>
&gt; [ =A0 =A04.199552] PCI: Using configuration type 1 for base access<br>
&gt; [ =A0 =A04.199559] dmi type 0xB1 record - unknown flag<br>
&gt; [ =A0 =A04.200155] bio: create slab &lt;bio-0&gt; at 0<br>
&gt; [ =A0 =A04.200279] ACPI: Added _OSI(Module Device)<br>
&gt; [ =A0 =A04.200280] ACPI: Added _OSI(Processor Device)<br>
&gt; [ =A0 =A04.200282] ACPI: Added _OSI(3.0 _SCP Extensions)<br>
&gt; [ =A0 =A04.200283] ACPI: Added _OSI(Processor Aggregator Device)<br>
&gt; [ =A0 =A04.201815] ACPI: EC: Look up EC in DSDT<br>
&gt; [ =A0 =A04.206932] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignore=
d<br>
&gt; [ =A0 =A04.219266] ACPI: SSDT 00000000c8412798 00727 (v01 =A0PmRef =A0=
Cpu0Cst 00003001 INTL 20090903)<br>
&gt; [ =A0 =A04.219654] ACPI: Dynamic OEM Table Load:<br>
&gt; [ =A0 =A04.219657] ACPI: SSDT =A0 =A0 =A0 =A0 =A0 (null) 00727 (v01 =
=A0PmRef =A0Cpu0Cst 00003001 INTL 20090903)<br>
&gt; [ =A0 =A04.220118] ACPI: SSDT 00000000c8413a98 00303 (v01 =A0PmRef =A0=
 =A0ApIst 00003000 INTL 20090903)<br>
&gt; [ =A0 =A04.220555] ACPI: Dynamic OEM Table Load:<br>
&gt; [ =A0 =A04.220558] ACPI: SSDT =A0 =A0 =A0 =A0 =A0 (null) 00303 (v01 =
=A0PmRef =A0 =A0ApIst 00003000 INTL 20090903)<br>
&gt; [ =A0 =A04.220754] ACPI: SSDT 00000000c8411d98 00119 (v01 =A0PmRef =A0=
 =A0ApCst 00003000 INTL 20090903)<br>
&gt; [ =A0 =A04.221136] ACPI: Dynamic OEM Table Load:<br>
&gt; [ =A0 =A04.221138] ACPI: SSDT =A0 =A0 =A0 =A0 =A0 (null) 00119 (v01 =
=A0PmRef =A0 =A0ApCst 00003000 INTL 20090903)<br>
&gt; [ =A0 =A04.223275] ACPI: Interpreter enabled<br>
&gt; [ =A0 =A04.223278] ACPI: (supports S0 S3 S5)<br>
&gt; [ =A0 =A04.223294] ACPI: Using IOAPIC for interrupt routing<br>
&gt; [ =A0 =A04.223322] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem 0=
xf8000000-0xfbffffff] (base 0xf8000000)<br>
&gt; [ =A0 =A04.223846] PCI: MMCONFIG at [mem 0xf8000000-0xfbffffff] reserv=
ed in ACPI motherboard resources<br>
&gt; [ =A0 =A04.271283] ACPI: EC: GPE =3D 0x10, I/O: command/status =3D 0x9=
34, data =3D 0x930<br>
&gt; [ =A0 =A04.272424] ACPI: No dock devices found.<br>
&gt; [ =A0 =A04.272428] PCI: Using host bridge windows from ACPI; if necess=
ary, use &quot;pci=3Dnocrs&quot; and report a bug<br>
&gt; [ =A0 =A04.272988] \_SB_.PCI0:_OSC invalid UUID<br>
&gt; [ =A0 =A04.272989] _OSC request data:1 8 1f<br>
&gt; [ =A0 =A04.272992] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-3=
e])<br>
&gt; [ =A0 =A04.273994] pci_root PNP0A08:00: host bridge window [io =A00x00=
00-0x0cf7]<br>
&gt; [ =A0 =A04.273996] pci_root PNP0A08:00: host bridge window [io =A00x0d=
00-0xffff]<br>
&gt; [ =A0 =A04.273998] pci_root PNP0A08:00: host bridge window [mem 0x000a=
0000-0x000bffff]<br>
&gt; [ =A0 =A04.274001] pci_root PNP0A08:00: host bridge window [mem 0xcfa0=
0000-0xfeafffff]<br>
&gt; [ =A0 =A04.274003] pci_root PNP0A08:00: host bridge window [mem 0xfed4=
0000-0xfed44fff]<br>
&gt; [ =A0 =A04.274031] PCI host bridge to bus 0000:00<br>
&gt; [ =A0 =A04.274033] pci_bus 0000:00: root bus resource [io =A00x0000-0x=
0cf7]<br>
&gt; [ =A0 =A04.274034] pci_bus 0000:00: root bus resource [io =A00x0d00-0x=
ffff]<br>
&gt; [ =A0 =A04.274036] pci_bus 0000:00: root bus resource [mem 0x000a0000-=
0x000bffff]<br>
&gt; [ =A0 =A04.274038] pci_bus 0000:00: root bus resource [mem 0xcfa00000-=
0xfeafffff]<br>
&gt; [ =A0 =A04.274040] pci_bus 0000:00: root bus resource [mem 0xfed40000-=
0xfed44fff]<br>
&gt; [ =A0 =A04.274054] pci 0000:00:00.0: [8086:0104] type 00 class 0x06000=
0<br>
&gt; [ =A0 =A04.274147] pci 0000:00:02.0: [8086:0126] type 00 class 0x03000=
0<br>
&gt; [ =A0 =A04.274174] pci 0000:00:02.0: reg 10: [mem 0xe1400000-0xe17ffff=
f 64bit]<br>
&gt; [ =A0 =A04.274189] pci 0000:00:02.0: reg 18: [mem 0xd0000000-0xdffffff=
f 64bit pref]<br>
&gt; [ =A0 =A04.274200] pci 0000:00:02.0: reg 20: [io =A00x4000-0x403f]<br>
&gt; [ =A0 =A04.274344] pci 0000:00:16.0: [8086:1c3a] type 00 class 0x07800=
0<br>
&gt; [ =A0 =A04.274394] pci 0000:00:16.0: reg 10: [mem 0xe2eb0000-0xe2eb000=
f 64bit]<br>
&gt; [ =A0 =A04.274563] pci 0000:00:16.0: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.274636] pci 0000:00:19.0: [8086:1502] type 00 class 0x02000=
0<br>
&gt; [ =A0 =A04.274681] pci 0000:00:19.0: reg 10: [mem 0xe2e00000-0xe2e1fff=
f]<br>
&gt; [ =A0 =A04.274700] pci 0000:00:19.0: reg 14: [mem 0xe2e80000-0xe2e80ff=
f]<br>
&gt; [ =A0 =A04.274719] pci 0000:00:19.0: reg 18: [io =A00x4080-0x409f]<br>
&gt; [ =A0 =A04.274883] pci 0000:00:19.0: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.274939] pci 0000:00:1a.0: [8086:1c2d] type 00 class 0x0c032=
0<br>
&gt; [ =A0 =A04.274983] pci 0000:00:1a.0: reg 10: [mem 0xe2e70000-0xe2e703f=
f]<br>
&gt; [ =A0 =A04.275185] pci 0000:00:1a.0: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.275243] pci 0000:00:1b.0: [8086:1c20] type 00 class 0x04030=
0<br>
&gt; [ =A0 =A04.275278] pci 0000:00:1b.0: reg 10: [mem 0xe2e60000-0xe2e63ff=
f 64bit]<br>
&gt; [ =A0 =A04.275456] pci 0000:00:1b.0: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.275509] pci 0000:00:1c.0: [8086:1c10] type 01 class 0x06040=
0<br>
&gt; [ =A0 =A04.275702] pci 0000:00:1c.0: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.275760] pci 0000:00:1c.1: [8086:1c12] type 01 class 0x06040=
0<br>
&gt; [ =A0 =A04.275953] pci 0000:00:1c.1: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.276011] pci 0000:00:1c.2: [8086:1c14] type 01 class 0x06040=
0<br>
&gt; [ =A0 =A04.276205] pci 0000:00:1c.2: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.276264] pci 0000:00:1c.3: [8086:1c16] type 01 class 0x06040=
0<br>
&gt; [ =A0 =A04.276458] pci 0000:00:1c.3: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.276520] pci 0000:00:1c.5: [8086:1c1a] type 01 class 0x06040=
0<br>
&gt; [ =A0 =A04.276711] pci 0000:00:1c.5: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.276779] pci 0000:00:1d.0: [8086:1c26] type 00 class 0x0c032=
0<br>
&gt; [ =A0 =A04.276823] pci 0000:00:1d.0: reg 10: [mem 0xe2e50000-0xe2e503f=
f]<br>
&gt; [ =A0 =A04.277025] pci 0000:00:1d.0: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.277086] pci 0000:00:1f.0: [8086:1c4f] type 00 class 0x06010=
0<br>
&gt; [ =A0 =A04.277341] pci 0000:00:1f.2: [8086:1c03] type 00 class 0x01060=
1<br>
&gt; [ =A0 =A04.277391] pci 0000:00:1f.2: reg 10: [io =A00x40d0-0x40d7]<br>
&gt; [ =A0 =A04.277410] pci 0000:00:1f.2: reg 14: [io =A00x40c0-0x40c3]<br>
&gt; [ =A0 =A04.277429] pci 0000:00:1f.2: reg 18: [io =A00x40b0-0x40b7]<br>
&gt; [ =A0 =A04.277449] pci 0000:00:1f.2: reg 1c: [io =A00x40a0-0x40a3]<br>
&gt; [ =A0 =A04.277468] pci 0000:00:1f.2: reg 20: [io =A00x4060-0x407f]<br>
&gt; [ =A0 =A04.277486] pci 0000:00:1f.2: reg 24: [mem 0xe2e40000-0xe2e407f=
f]<br>
&gt; [ =A0 =A04.277613] pci 0000:00:1f.2: PME# supported from D3hot<br>
&gt; [ =A0 =A04.277657] pci 0000:00:1f.3: [8086:1c22] type 00 class 0x0c050=
0<br>
&gt; [ =A0 =A04.277694] pci 0000:00:1f.3: reg 10: [mem 0xe2e30000-0xe2e300f=
f 64bit]<br>
&gt; [ =A0 =A04.277749] pci 0000:00:1f.3: reg 20: [io =A00x4040-0x405f]<br>
&gt; [ =A0 =A04.277920] pci 0000:00:1c.0: PCI bridge to [bus 01-01]<br>
&gt; [ =A0 =A04.278353] pci 0000:02:00.0: [8086:422b] type 00 class 0x02800=
0<br>
&gt; [ =A0 =A04.278708] pci 0000:02:00.0: reg 10: [mem 0xe2d00000-0xe2d01ff=
f 64bit]<br>
&gt; [ =A0 =A04.280508] pci 0000:02:00.0: PME# supported from D0 D3hot D3co=
ld<br>
&gt; [ =A0 =A04.285361] pci 0000:00:1c.1: PCI bridge to [bus 02-02]<br>
&gt; [ =A0 =A04.285374] pci 0000:00:1c.1: =A0 bridge window [mem 0xe2d00000=
-0xe2dfffff]<br>
&gt; [ =A0 =A04.285490] pci 0000:00:1c.2: PCI bridge to [bus 03-08]<br>
&gt; [ =A0 =A04.285498] pci 0000:00:1c.2: =A0 bridge window [io =A00x3000-0=
x3fff]<br>
&gt; [ =A0 =A04.285505] pci 0000:00:1c.2: =A0 bridge window [mem 0xe2200000=
-0xe2bfffff]<br>
&gt; [ =A0 =A04.285517] pci 0000:00:1c.2: =A0 bridge window [mem 0xe0a00000=
-0xe13fffff 64bit pref]<br>
&gt; [ =A0 =A04.285625] pci 0000:00:1c.3: PCI bridge to [bus 09-09]<br>
&gt; [ =A0 =A04.285632] pci 0000:00:1c.3: =A0 bridge window [io =A00x2000-0=
x2fff]<br>
&gt; [ =A0 =A04.285639] pci 0000:00:1c.3: =A0 bridge window [mem 0xe1800000=
-0xe21fffff]<br>
&gt; [ =A0 =A04.285651] pci 0000:00:1c.3: =A0 bridge window [mem 0xe0000000=
-0xe09fffff 64bit pref]<br>
&gt; [ =A0 =A04.285818] pci 0000:0a:00.0: [1217:8221] type 00 class 0x08050=
1<br>
&gt; [ =A0 =A04.285872] pci 0000:0a:00.0: reg 10: [mem 0xe2c20000-0xe2c201f=
f]<br>
&gt; [ =A0 =A04.286294] pci 0000:0a:00.0: supports D1 D2<br>
&gt; [ =A0 =A04.286295] pci 0000:0a:00.0: PME# supported from D0 D1 D2 D3ho=
t D3cold<br>
&gt; [ =A0 =A04.286432] pci 0000:0a:00.1: [1217:8231] type 00 class 0x01800=
0<br>
&gt; [ =A0 =A04.286486] pci 0000:0a:00.1: reg 10: [mem 0xe2c10000-0xe2c10ff=
f]<br>
&gt; [ =A0 =A04.286563] pci 0000:0a:00.1: reg 18: [mem 0xe2c00000-0xe2c007f=
f]<br>
&gt; [ =A0 =A04.286908] pci 0000:0a:00.1: supports D1 D2<br>
&gt; [ =A0 =A04.286909] pci 0000:0a:00.1: PME# supported from D0 D1 D2 D3ho=
t D3cold<br>
&gt; [ =A0 =A04.293400] pci 0000:00:1c.5: PCI bridge to [bus 0a-0a]<br>
&gt; [ =A0 =A04.293412] pci 0000:00:1c.5: =A0 bridge window [mem 0xe2c00000=
-0xe2cfffff]<br>
&gt; [ =A0 =A04.293479] pci_bus 0000:00: on NUMA node 0<br>
&gt; [ =A0 =A04.293483] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]=
<br>
&gt; [ =A0 =A04.293612] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP01.=
_PRT]<br>
&gt; [ =A0 =A04.293647] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP02.=
_PRT]<br>
&gt; [ =A0 =A04.293682] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP04.=
_PRT]<br>
&gt; [ =A0 =A04.293717] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP06.=
_PRT]<br>
&gt; [ =A0 =A04.293762] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP03.=
_PRT]<br>
&gt; [ =A0 =A04.293857] \_SB_.PCI0:_OSC invalid UUID<br>
&gt; [ =A0 =A04.293858] _OSC request data:1 1f 1f<br>
&gt; [ =A0 =A04.293861] =A0pci0000:00: Requesting ACPI _OSC control (0x1d)<=
br>
&gt; [ =A0 =A04.293906] \_SB_.PCI0:_OSC invalid UUID<br>
&gt; [ =A0 =A04.293907] _OSC request data:1 0 1d<br>
&gt; [ =A0 =A04.293910] =A0pci0000:00: ACPI _OSC request failed (AE_ERROR),=
 returned control mask: 0x1d<br>
&gt; [ =A0 =A04.293911] ACPI _OSC control for PCIe not granted, disabling A=
SPM<br>
&gt; [ =A0 =A04.297639] ACPI: PCI Interrupt Link [LNKA] (IRQs 1 3 4 5 6 7 1=
0 12 14 15) *11<br>
&gt; [ =A0 =A04.297702] ACPI: PCI Interrupt Link [LNKB] (IRQs 1 3 4 5 6 7 1=
1 12 14 15) *10<br>
&gt; [ =A0 =A04.297761] ACPI: PCI Interrupt Link [LNKC] (IRQs 1 3 4 5 6 7 1=
0 12 14 15) *11<br>
&gt; [ =A0 =A04.297820] ACPI: PCI Interrupt Link [LNKD] (IRQs 1 3 4 5 6 7 1=
1 12 14 15) *10<br>
&gt; [ =A0 =A04.297878] ACPI: PCI Interrupt Link [LNKE] (IRQs 1 3 4 *5 6 7 =
10 12 14 15)<br>
&gt; [ =A0 =A04.297937] ACPI: PCI Interrupt Link [LNKF] (IRQs 1 3 4 5 6 7 1=
1 12 14 15) *0, disabled.<br>
&gt; [ =A0 =A04.297996] ACPI: PCI Interrupt Link [LNKG] (IRQs 1 *3 4 5 6 7 =
10 12 14 15)<br>
&gt; [ =A0 =A04.298054] ACPI: PCI Interrupt Link [LNKH] (IRQs 1 3 4 5 6 7 1=
1 12 14 15) *0, disabled.<br>
&gt; [ =A0 =A04.298087] xen/balloon: Initialising balloon driver.<br>
&gt; [ =A0 =A04.301022] xen-balloon: Initialising balloon driver.<br>
&gt; [ =A0 =A04.301062] xen/balloon: Xen selfballooning driver disabled for=
 domain0.<br>
&gt; [ =A0 =A04.301148] vgaarb: device added: PCI:0000:00:02.0,decodes=3Dio=
+mem,owns=3Dio+mem,locks=3Dnone<br>
&gt; [ =A0 =A04.301157] vgaarb: loaded<br>
&gt; [ =A0 =A04.301157] vgaarb: bridge control possible 0000:00:02.0<br>
&gt; [ =A0 =A04.301279] PCI: Using ACPI for IRQ routing<br>
&gt; [ =A0 =A04.305930] PCI: pci_cache_line_size set to 64 bytes<br>
&gt; [ =A0 =A04.306106] reserve RAM buffer: 000000000009a000 - 000000000009=
ffff<br>
&gt; [ =A0 =A04.306108] reserve RAM buffer: 0000000007eea000 - 0000000007ff=
ffff<br>
&gt; [ =A0 =A04.306110] reserve RAM buffer: 0000000007f70000 - 0000000007ff=
ffff<br>
&gt; [ =A0 =A04.306112] reserve RAM buffer: 0000000007f78000 - 0000000007ff=
ffff<br>
&gt; [ =A0 =A04.306113] reserve RAM buffer: 000000000dffd000 - 000000000fff=
ffff<br>
&gt; [ =A0 =A04.306115] reserve RAM buffer: 00000000c83b4000 - 00000000cbff=
ffff<br>
&gt; [ =A0 =A04.306118] reserve RAM buffer: 00000000c840e000 - 00000000cbff=
ffff<br>
&gt; [ =A0 =A04.306121] reserve RAM buffer: 00000000c8411000 - 00000000cbff=
ffff<br>
&gt; [ =A0 =A04.306123] reserve RAM buffer: 00000000c841e000 - 00000000cbff=
ffff<br>
&gt; [ =A0 =A04.306125] reserve RAM buffer: 00000000c8432000 - 00000000cbff=
ffff<br>
&gt; [ =A0 =A04.306127] reserve RAM buffer: 00000000cac00000 - 00000000cbff=
ffff<br>
&gt; [ =A0 =A04.306129] reserve RAM buffer: 000000042e000000 - 000000042fff=
ffff<br>
&gt; [ =A0 =A04.306235] Switching to clocksource xen<br>
&gt; [ =A0 =A04.307726] pnp: PnP ACPI init<br>
&gt; [ =A0 =A04.307738] ACPI: bus type pnp registered<br>
&gt; [ =A0 =A04.308287] pnp 00:00: [bus 00-3e]<br>
&gt; [ =A0 =A04.308289] pnp 00:00: [io =A00x0000-0x0cf7 window]<br>
&gt; [ =A0 =A04.308291] pnp 00:00: [io =A00x0cf8-0x0cff]<br>
&gt; [ =A0 =A04.308293] pnp 00:00: [io =A00x0d00-0xffff window]<br>
&gt; [ =A0 =A04.308295] pnp 00:00: [mem 0x000a0000-0x000bffff window]<br>
&gt; [ =A0 =A04.308296] pnp 00:00: [mem 0x000c0000-0x000c3fff window]<br>
&gt; [ =A0 =A04.308298] pnp 00:00: [mem 0x000c4000-0x000c7fff window]<br>
&gt; [ =A0 =A04.308300] pnp 00:00: [mem 0x000c8000-0x000cbfff window]<br>
&gt; [ =A0 =A04.308301] pnp 00:00: [mem 0x000cc000-0x000cffff window]<br>
&gt; [ =A0 =A04.308303] pnp 00:00: [mem 0x000d0000-0x000d3fff window]<br>
&gt; [ =A0 =A04.308305] pnp 00:00: [mem 0x000d4000-0x000d7fff window]<br>
&gt; [ =A0 =A04.308307] pnp 00:00: [mem 0x000d8000-0x000dbfff window]<br>
&gt; [ =A0 =A04.308309] pnp 00:00: [mem 0x000dc000-0x000dffff window]<br>
&gt; [ =A0 =A04.308310] pnp 00:00: [mem 0x000e0000-0x000e3fff window]<br>
&gt; [ =A0 =A04.308312] pnp 00:00: [mem 0x000e4000-0x000e7fff window]<br>
&gt; [ =A0 =A04.308314] pnp 00:00: [mem 0x000e8000-0x000ebfff window]<br>
&gt; [ =A0 =A04.308315] pnp 00:00: [mem 0x000ec000-0x000effff window]<br>
&gt; [ =A0 =A04.308317] pnp 00:00: [mem 0x000f0000-0x000fffff window]<br>
&gt; [ =A0 =A04.308319] pnp 00:00: [mem 0xcfa00000-0xfeafffff window]<br>
&gt; [ =A0 =A04.308320] pnp 00:00: [mem 0xfed40000-0xfed44fff window]<br>
&gt; [ =A0 =A04.308385] pnp 00:00: Plug and Play ACPI device, IDs PNP0a08 P=
NP0a03 (active)<br>
&gt; [ =A0 =A04.308398] pnp 00:01: [io =A00x0000-0x001f]<br>
&gt; [ =A0 =A04.308400] pnp 00:01: [io =A00x0081-0x0091]<br>
&gt; [ =A0 =A04.308401] pnp 00:01: [io =A00x0093-0x009f]<br>
&gt; [ =A0 =A04.308403] pnp 00:01: [io =A00x00c0-0x00df]<br>
&gt; [ =A0 =A04.308404] pnp 00:01: [dma 4]<br>
&gt; [ =A0 =A04.308422] pnp 00:01: Plug and Play ACPI device, IDs PNP0200 (=
active)<br>
&gt; [ =A0 =A04.308429] pnp 00:02: [mem 0xff000000-0xffffffff]<br>
&gt; [ =A0 =A04.308445] pnp 00:02: Plug and Play ACPI device, IDs INT0800 (=
active)<br>
&gt; [ =A0 =A04.308540] pnp 00:03: [mem 0xfed00000-0xfed003ff]<br>
&gt; [ =A0 =A04.308572] system 00:03: [mem 0xfed00000-0xfed003ff] has been =
reserved<br>
&gt; [ =A0 =A04.308575] system 00:03: Plug and Play ACPI device, IDs PNP010=
3 PNP0c01 (active)<br>
&gt; [ =A0 =A04.308584] pnp 00:04: [io =A00x00f0]<br>
&gt; [ =A0 =A04.308587] xen: registering gsi 13 triggering 1 polarity 0<br>
&gt; [ =A0 =A04.308609] pnp 00:04: [irq 13]<br>
&gt; [ =A0 =A04.308626] pnp 00:04: Plug and Play ACPI device, IDs PNP0c04 (=
active)<br>
&gt; [ =A0 =A04.308636] pnp 00:05: [io =A00x002e-0x002f]<br>
&gt; [ =A0 =A04.308637] pnp 00:05: [io =A00x004e-0x004f]<br>
&gt; [ =A0 =A04.308639] pnp 00:05: [io =A00x0061]<br>
&gt; [ =A0 =A04.308640] pnp 00:05: [io =A00x0063]<br>
&gt; [ =A0 =A04.308641] pnp 00:05: [io =A00x0065]<br>
&gt; [ =A0 =A04.308642] pnp 00:05: [io =A00x0067]<br>
&gt; [ =A0 =A04.308644] pnp 00:05: [io =A00x0070]<br>
&gt; [ =A0 =A04.308645] pnp 00:05: [io =A00x0080]<br>
&gt; [ =A0 =A04.308646] pnp 00:05: [io =A00x0092]<br>
&gt; [ =A0 =A04.308648] pnp 00:05: [io =A00x00b2-0x00b3]<br>
&gt; [ =A0 =A04.308649] pnp 00:05: [io =A00x0680-0x069f]<br>
&gt; [ =A0 =A04.308651] pnp 00:05: [io =A00x1000-0x100f]<br>
&gt; [ =A0 =A04.308653] pnp 00:05: [io =A00xffff]<br>
&gt; [ =A0 =A04.308654] pnp 00:05: [io =A00xffff]<br>
&gt; [ =A0 =A04.308655] pnp 00:05: [io =A00x0400-0x047f]<br>
&gt; [ =A0 =A04.308656] pnp 00:05: [io =A00x0500-0x057f]<br>
&gt; [ =A0 =A04.308658] pnp 00:05: [io =A00x164e-0x164f]<br>
&gt; [ =A0 =A04.308689] system 00:05: [io =A00x0680-0x069f] has been reserv=
ed<br>
&gt; [ =A0 =A04.308691] system 00:05: [io =A00x1000-0x100f] has been reserv=
ed<br>
&gt; [ =A0 =A04.308693] system 00:05: [io =A00xffff] has been reserved<br>
&gt; [ =A0 =A04.308695] system 00:05: [io =A00xffff] has been reserved<br>
&gt; [ =A0 =A04.308697] system 00:05: [io =A00x0400-0x047f] has been reserv=
ed<br>
&gt; [ =A0 =A04.308700] system 00:05: [io =A00x0500-0x057f] has been reserv=
ed<br>
&gt; [ =A0 =A04.308701] system 00:05: [io =A00x164e-0x164f] has been reserv=
ed<br>
&gt; [ =A0 =A04.308704] system 00:05: Plug and Play ACPI device, IDs PNP0c0=
2 (active)<br>
&gt; [ =A0 =A04.308711] pnp 00:06: [io =A00x0070-0x0077]<br>
&gt; [ =A0 =A04.308713] xen: registering gsi 8 triggering 1 polarity 0<br>
&gt; [ =A0 =A04.308730] pnp 00:06: [irq 8]<br>
&gt; [ =A0 =A04.308749] pnp 00:06: Plug and Play ACPI device, IDs PNP0b00 (=
active)<br>
&gt; [ =A0 =A04.308758] pnp 00:07: [io =A00x0060]<br>
&gt; [ =A0 =A04.308759] pnp 00:07: [io =A00x0064]<br>
&gt; [ =A0 =A04.308761] xen: registering gsi 1 triggering 1 polarity 0<br>
&gt; [ =A0 =A04.308777] pnp 00:07: [irq 1]<br>
&gt; [ =A0 =A04.308794] pnp 00:07: Plug and Play ACPI device, IDs PNP0303 (=
active)<br>
&gt; [ =A0 =A04.309984] pnp 00:08: Plug and Play ACPI device, IDs PNP0401 (=
disabled)<br>
&gt; [ =A0 =A04.309993] xen: registering gsi 12 triggering 1 polarity 0<br>
&gt; [ =A0 =A04.310011] pnp 00:09: [irq 12]<br>
&gt; [ =A0 =A04.310030] pnp 00:09: Plug and Play ACPI device, IDs DLL0493 P=
NP0f13 (active)<br>
&gt; [ =A0 =A04.310065] pnp 00:0a: [mem 0xfed40000-0xfed44fff]<br>
&gt; [ =A0 =A04.310086] pnp 00:0a: Plug and Play ACPI device, IDs BCM0102 P=
NP0c31 (active)<br>
&gt; [ =A0 =A04.310291] pnp 00:0b: [mem 0xfed1c000-0xfed1ffff]<br>
&gt; [ =A0 =A04.310292] pnp 00:0b: [mem 0xfed10000-0xfed17fff]<br>
&gt; [ =A0 =A04.310294] pnp 00:0b: [mem 0xfed18000-0xfed18fff]<br>
&gt; [ =A0 =A04.310296] pnp 00:0b: [mem 0xfed19000-0xfed19fff]<br>
&gt; [ =A0 =A04.310298] pnp 00:0b: [mem 0xf8000000-0xfbffffff]<br>
&gt; [ =A0 =A04.310309] pnp 00:0b: [mem 0xfed20000-0xfed3ffff]<br>
&gt; [ =A0 =A04.310310] pnp 00:0b: [mem 0xfed90000-0xfed93fff]<br>
&gt; [ =A0 =A04.310312] pnp 00:0b: [mem 0xfed45000-0xfed8ffff]<br>
&gt; [ =A0 =A04.310313] pnp 00:0b: [mem 0xff000000-0xffffffff]<br>
&gt; [ =A0 =A04.310315] pnp 00:0b: [mem 0xfee00000-0xfeefffff]<br>
&gt; [ =A0 =A04.310317] pnp 00:0b: [mem 0x00000000-0xffffffffffffffff disab=
led]<br>
&gt; [ =A0 =A04.310318] pnp 00:0b: [mem 0x00000000-0xffffffffffffffff disab=
led]<br>
&gt; [ =A0 =A04.310359] system 00:0b: [mem 0xfed1c000-0xfed1ffff] has been =
reserved<br>
&gt; [ =A0 =A04.310361] system 00:0b: [mem 0xfed10000-0xfed17fff] has been =
reserved<br>
&gt; [ =A0 =A04.310363] system 00:0b: [mem 0xfed18000-0xfed18fff] has been =
reserved<br>
&gt; [ =A0 =A04.310365] system 00:0b: [mem 0xfed19000-0xfed19fff] has been =
reserved<br>
&gt; [ =A0 =A04.310367] system 00:0b: [mem 0xf8000000-0xfbffffff] has been =
reserved<br>
&gt; [ =A0 =A04.310369] system 00:0b: [mem 0xfed20000-0xfed3ffff] has been =
reserved<br>
&gt; [ =A0 =A04.310371] system 00:0b: [mem 0xfed90000-0xfed93fff] has been =
reserved<br>
&gt; [ =A0 =A04.310373] system 00:0b: [mem 0xfed45000-0xfed8ffff] has been =
reserved<br>
&gt; [ =A0 =A04.310375] system 00:0b: [mem 0xff000000-0xffffffff] could not=
 be reserved<br>
&gt; [ =A0 =A04.310377] system 00:0b: [mem 0xfee00000-0xfeefffff] could not=
 be reserved<br>
&gt; [ =A0 =A04.310380] system 00:0b: Plug and Play ACPI device, IDs PNP0c0=
2 (active)<br>
&gt; [ =A0 =A04.310956] xen: registering gsi 23 triggering 1 polarity 0<br>
&gt; [ =A0 =A04.310967] xen: --&gt; pirq=3D23 -&gt; irq=3D23 (gsi=3D23)<br>
&gt; [ =A0 =A04.310985] pnp 00:0c: [irq 23]<br>
&gt; [ =A0 =A04.311015] pnp 00:0c: Plug and Play ACPI device, IDs SMO8800 (=
active)<br>
&gt; [ =A0 =A04.315528] pnp 00:0d: [mem 0x20000000-0x201fffff]<br>
&gt; [ =A0 =A04.315531] pnp 00:0d: [mem 0x40000000-0x401fffff]<br>
&gt; [ =A0 =A04.339851] system 00:0d: [mem 0x20000000-0x201fffff] has been =
reserved<br>
&gt; [ =A0 =A04.339854] system 00:0d: [mem 0x40000000-0x401fffff] has been =
reserved<br>
&gt; [ =A0 =A04.339857] system 00:0d: Plug and Play ACPI device, IDs PNP0c0=
1 (active)<br>
&gt; [ =A0 =A04.339865] pnp: PnP ACPI: found 14 devices<br>
&gt; [ =A0 =A04.339867] ACPI: ACPI bus type pnp unregistered<br>
&gt; [ =A0 =A04.346178] PM-Timer failed consistency check =A0(0x0xffffff) -=
 aborting.<br>
&gt; [ =A0 =A04.346274] pci 0000:00:1c.0: PCI bridge to [bus 01-01]<br>
&gt; [ =A0 =A04.346306] pci 0000:00:1c.1: PCI bridge to [bus 02-02]<br>
&gt; [ =A0 =A04.346315] pci 0000:00:1c.1: =A0 bridge window [mem 0xe2d00000=
-0xe2dfffff]<br>
&gt; [ =A0 =A04.346332] pci 0000:00:1c.2: PCI bridge to [bus 03-08]<br>
&gt; [ =A0 =A04.346336] pci 0000:00:1c.2: =A0 bridge window [io =A00x3000-0=
x3fff]<br>
&gt; [ =A0 =A04.346347] pci 0000:00:1c.2: =A0 bridge window [mem 0xe2200000=
-0xe2bfffff]<br>
&gt; [ =A0 =A04.346354] pci 0000:00:1c.2: =A0 bridge window [mem 0xe0a00000=
-0xe13fffff 64bit pref]<br>
&gt; [ =A0 =A04.346366] pci 0000:00:1c.3: PCI bridge to [bus 09-09]<br>
&gt; [ =A0 =A04.346370] pci 0000:00:1c.3: =A0 bridge window [io =A00x2000-0=
x2fff]<br>
&gt; [ =A0 =A04.346379] pci 0000:00:1c.3: =A0 bridge window [mem 0xe1800000=
-0xe21fffff]<br>
&gt; [ =A0 =A04.346386] pci 0000:00:1c.3: =A0 bridge window [mem 0xe0000000=
-0xe09fffff 64bit pref]<br>
&gt; [ =A0 =A04.346399] pci 0000:00:1c.5: PCI bridge to [bus 0a-0a]<br>
&gt; [ =A0 =A04.346408] pci 0000:00:1c.5: =A0 bridge window [mem 0xe2c00000=
-0xe2cfffff]<br>
&gt; [ =A0 =A04.346434] xen: registering gsi 16 triggering 0 polarity 1<br>
&gt; [ =A0 =A04.346442] xen: --&gt; pirq=3D16 -&gt; irq=3D16 (gsi=3D16)<br>
&gt; [ =A0 =A04.346469] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0 =A04.346473] xen: --&gt; pirq=3D17 -&gt; irq=3D17 (gsi=3D17)<br>
&gt; [ =A0 =A04.346498] xen: registering gsi 18 triggering 0 polarity 1<br>
&gt; [ =A0 =A04.346502] xen: --&gt; pirq=3D18 -&gt; irq=3D18 (gsi=3D18)<br>
&gt; [ =A0 =A04.346527] xen: registering gsi 19 triggering 0 polarity 1<br>
&gt; [ =A0 =A04.346531] xen: --&gt; pirq=3D19 -&gt; irq=3D19 (gsi=3D19)<br>
&gt; [ =A0 =A04.346556] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0 =A04.346558] Already setup the GSI :17<br>
&gt; [ =A0 =A04.346563] pci_bus 0000:00: resource 4 [io =A00x0000-0x0cf7]<b=
r>
&gt; [ =A0 =A04.346565] pci_bus 0000:00: resource 5 [io =A00x0d00-0xffff]<b=
r>
&gt; [ =A0 =A04.346566] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bf=
fff]<br>
&gt; [ =A0 =A04.346568] pci_bus 0000:00: resource 7 [mem 0xcfa00000-0xfeaff=
fff]<br>
&gt; [ =A0 =A04.346570] pci_bus 0000:00: resource 8 [mem 0xfed40000-0xfed44=
fff]<br>
&gt; [ =A0 =A04.346572] pci_bus 0000:02: resource 1 [mem 0xe2d00000-0xe2dff=
fff]<br>
&gt; [ =A0 =A04.346574] pci_bus 0000:03: resource 0 [io =A00x3000-0x3fff]<b=
r>
&gt; [ =A0 =A04.346575] pci_bus 0000:03: resource 1 [mem 0xe2200000-0xe2bff=
fff]<br>
&gt; [ =A0 =A04.346577] pci_bus 0000:03: resource 2 [mem 0xe0a00000-0xe13ff=
fff 64bit pref]<br>
&gt; [ =A0 =A04.346579] pci_bus 0000:09: resource 0 [io =A00x2000-0x2fff]<b=
r>
&gt; [ =A0 =A04.346581] pci_bus 0000:09: resource 1 [mem 0xe1800000-0xe21ff=
fff]<br>
&gt; [ =A0 =A04.346582] pci_bus 0000:09: resource 2 [mem 0xe0000000-0xe09ff=
fff 64bit pref]<br>
&gt; [ =A0 =A04.346584] pci_bus 0000:0a: resource 1 [mem 0xe2c00000-0xe2cff=
fff]<br>
&gt; [ =A0 =A04.346672] NET: Registered protocol family 2<br>
&gt; [ =A0 =A04.346732] IP route cache hash table entries: 524288 (order: 1=
0, 4194304 bytes)<br>
&gt; [ =A0 =A04.347207] TCP established hash table entries: 262144 (order: =
10, 4194304 bytes)<br>
&gt; [ =A0 =A04.347753] TCP bind hash table entries: 65536 (order: 8, 10485=
76 bytes)<br>
&gt; [ =A0 =A04.347872] TCP: Hash tables configured (established 262144 bin=
d 65536)<br>
&gt; [ =A0 =A04.347874] TCP: reno registered<br>
&gt; [ =A0 =A04.347877] UDP hash table entries: 8192 (order: 6, 262144 byte=
s)<br>
&gt; [ =A0 =A04.347921] UDP-Lite hash table entries: 8192 (order: 6, 262144=
 bytes)<br>
&gt; [ =A0 =A04.348067] NET: Registered protocol family 1<br>
&gt; [ =A0 =A04.348085] pci 0000:00:02.0: Boot video device<br>
&gt; [ =A0 =A04.348108] xen: registering gsi 16 triggering 0 polarity 1<br>
&gt; [ =A0 =A04.348112] Already setup the GSI :16<br>
&gt; [ =A0 =A04.348203] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0 =A04.348205] Already setup the GSI :17<br>
&gt; [ =A0 =A04.348298] PCI: CLS 64 bytes, default 64<br>
&gt; [ =A0 =A04.348333] Unpacking initramfs...<br>
&gt; [ =A0 =A04.384265] Freeing initrd memory: 45868k freed<br>
&gt; [ =A0 =A04.392440] Simple Boot Flag at 0xf3 set to 0x1<br>
&gt; [ =A0 =A04.392900] audit: initializing netlink socket (disabled)<br>
&gt; [ =A0 =A04.392911] type=3D2000 audit(1354151975.383:1): initialized<br=
>
&gt; [ =A0 =A04.411688] VFS: Disk quotas dquot_6.5.2<br>
&gt; [ =A0 =A04.411715] Dquot-cache hash table entries: 512 (order 0, 4096 =
bytes)<br>
&gt; [ =A0 =A04.411870] msgmni has been set to 29339<br>
&gt; [ =A0 =A04.412010] Block layer SCSI generic (bsg) driver version 0.4 l=
oaded (major 253)<br>
&gt; [ =A0 =A04.412013] io scheduler noop registered<br>
&gt; [ =A0 =A04.412015] io scheduler deadline registered<br>
&gt; [ =A0 =A04.412036] io scheduler cfq registered (default)<br>
&gt; [ =A0 =A04.412666] intel_idle: does not run on family 6 model 42<br>
&gt; [ =A0 =A04.412741] ACPI: Requesting acpi_cpufreq<br>
&gt; [ =A0 =A04.459643] Non-volatile memory driver v1.3<br>
&gt; [ =A0 =A04.459654] ramoops: platform device not found, using module pa=
rameters<br>
&gt; [ =A0 =A04.459670] ramoops: The memory size and the record size must b=
e non-zero<br>
&gt; [ =A0 =A04.459703] ramoops: probe of ramoops failed with error -22<br>
&gt; [ =A0 =A04.474892] loop: module loaded<br>
&gt; [ =A0 =A04.474922] Fixed MDIO Bus: probed<br>
&gt; [ =A0 =A04.474965] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:P=
S2M] at 0x60,0x64 irq 1,12<br>
&gt; [ =A0 =A04.475166] i8042: Warning: Keylock active<br>
&gt; [ =A0 =A04.476434] serio: i8042 KBD port at 0x60,0x64 irq 1<br>
&gt; [ =A0 =A04.476439] serio: i8042 AUX port at 0x60,0x64 irq 12<br>
&gt; [ =A0 =A04.476551] mousedev: PS/2 mouse device common for all mice<br>
&gt; [ =A0 =A04.476707] rtc_cmos 00:06: RTC can wake from S4<br>
&gt; [ =A0 =A04.476940] rtc_cmos 00:06: rtc core: registered rtc_cmos as rt=
c0<br>
&gt; [ =A0 =A04.476998] rtc0: alarms up to one year, y3k, 242 bytes nvram<b=
r>
&gt; [ =A0 =A04.477084] device-mapper: uevent: version 1.0.3<br>
&gt; [ =A0 =A04.477193] device-mapper: ioctl: 4.22.0-ioctl (2011-10-19) ini=
tialised: <a href=3D"mailto:dm-devel@redhat.com">dm-devel@redhat.com</a><br=
>
&gt; [ =A0 =A04.477281] TCP: cubic registered<br>
&gt; [ =A0 =A04.477381] input: AT Translated Set 2 keyboard as /devices/pla=
tform/i8042/serio0/input/input0<br>
&gt; [ =A0 =A04.477402] NET: Registered protocol family 10<br>
&gt; [ =A0 =A04.477644] Registering the dns_resolver key type<br>
&gt; [ =A0 =A04.477791] registered taskstats version 1<br>
&gt; [ =A0 =A04.478330] =A0 Magic number: 4:584:307<br>
&gt; [ =A0 =A04.478403] tty tty36: hash matches<br>
&gt; [ =A0 =A04.478496] rtc_cmos 00:06: setting system clock to 2012-11-29 =
01:19:35 UTC (1354151975)<br>
&gt; [ =A0 =A04.478801] Freeing unused kernel memory: 552k freed<br>
&gt; [ =A0 =A04.478847] Write protecting the kernel read-only data: 8192k<b=
r>
&gt; [ =A0 =A04.481908] Freeing unused kernel memory: 1568k freed<br>
&gt; [ =A0 =A04.482112] Freeing unused kernel memory: 24k freed<br>
&gt; [ =A0 =A04.524129] dracut: dracut-005-3.fc13<br>
&gt; [ =A0 =A04.552311] pciback 0000:00:19.0: seizing device<br>
&gt; [ =A0 =A04.552403] pciback 0000:02:00.0: seizing device<br>
&gt; [ =A0 =A04.552941] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0 =A04.552952] Already setup the GSI :17<br>
&gt; [ =A0 =A04.553934] xen: registering gsi 20 triggering 0 polarity 1<br>
&gt; [ =A0 =A04.553964] xen: --&gt; pirq=3D20 -&gt; irq=3D20 (gsi=3D20)<br>
&gt; [ =A0 =A04.554574] xen-pciback: backend is vpci<br>
&gt; [ =A0 =A04.617471] udev: starting version 151<br>
&gt; [ =A0 =A04.617770] udevd (80): /proc/80/oom_adj is deprecated, please =
use /proc/80/oom_score_adj instead.<br>
&gt; [ =A0 =A04.654916] Linux agpgart interface v0.103<br>
&gt; [ =A0 =A04.655397] input: Lid Switch as /devices/LNXSYSTM:00/device:00=
/PNP0C0D:00/input/input1<br>
&gt; [ =A0 =A05.051184] ACPI: Lid Switch [LID]<br>
&gt; [ =A0 =A05.051436] input: Power Button as /devices/LNXSYSTM:00/device:=
00/PNP0C0C:00/input/input2<br>
&gt; [ =A0 =A05.051547] ACPI: Power Button [PBTN]<br>
&gt; [ =A0 =A05.051682] input: Sleep Button as /devices/LNXSYSTM:00/device:=
00/PNP0C0E:00/input/input3<br>
&gt; [ =A0 =A05.051760] ACPI: Sleep Button [SBTN]<br>
&gt; [ =A0 =A05.054141] input: Power Button as /devices/LNXSYSTM:00/LNXPWRB=
N:00/input/input4<br>
&gt; [ =A0 =A05.054421] ACPI: Power Button [PWRF]<br>
&gt; [ =A0 =A05.056887] agpgart-intel 0000:00:00.0: Intel Sandybridge Chips=
et<br>
&gt; [ =A0 =A05.058118] agpgart-intel 0000:00:00.0: detected gtt size: 2097=
152K total, 262144K mappable<br>
&gt; [ =A0 =A05.064439] agpgart-intel 0000:00:00.0: detected 65536K stolen =
memory<br>
&gt; [ =A0 =A05.064916] agpgart-intel 0000:00:00.0: AGP aperture is 256M @ =
0xd0000000<br>
&gt; [ =A0 =A05.070296] [drm] Initialized drm 1.1.0 20060810<br>
&gt; [ =A0 =A05.080002] xen: registering gsi 16 triggering 0 polarity 1<br>
&gt; [ =A0 =A05.080015] Already setup the GSI :16<br>
&gt; [ =A0 =A05.080364] i915 0000:00:02.0: setting latency timer to 64<br>
&gt; [ =A0 =A05.190295] [drm] MTRR allocation failed. =A0Graphics performan=
ce may suffer.<br>
&gt; [ =A0 =A05.190491] [drm] Supports vblank timestamp caching Rev 1 (10.1=
0.2010).<br>
&gt; [ =A0 =A05.190493] [drm] Driver supports precise vblank timestamp quer=
y.<br>
&gt; [ =A0 =A05.190554] vgaarb: device changed decodes: PCI:0000:00:02.0,ol=
ddecodes=3Dio+mem,decodes=3Dio+mem:owns=3Dio+mem<br>
&gt; [ =A0 =A05.548301] [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp =
off<br>
&gt; [ =A0 =A05.591093] input: DualPoint Stick as /devices/platform/i8042/s=
erio1/input/input5<br>
&gt; [ =A0 =A05.606212] input: AlpsPS/2 ALPS DualPoint TouchPad as /devices=
/platform/i8042/serio1/input/input6<br>
&gt; [ =A0 =A05.806814] fbcon: inteldrmfb (fb0) is primary device<br>
&gt; [ =A0 =A06.095967] Console: switching to colour frame buffer device 20=
0x56<br>
&gt; [ =A0 =A06.101477] fb0: inteldrmfb frame buffer device<br>
&gt; [ =A0 =A06.101478] drm: registered panic notifier<br>
&gt; [ =A0 =A06.130833] acpi device:38: registered as cooling_device4<br>
&gt; [ =A0 =A06.133713] input: Video Bus as /devices/LNXSYSTM:00/device:00/=
PNP0A08:00/LNXVIDEO:00/input/input7<br>
&gt; [ =A0 =A06.133915] ACPI: Video Device [VID] (multi-head: yes =A0rom: n=
o =A0post: no)<br>
&gt; [ =A0 =A06.135082] [drm] Initialized i915 1.6.0 20080730 for 0000:00:0=
2.0 on minor 0<br>
&gt; [ =A0 =A06.185946] dracut: Starting plymouth daemon<br>
&gt; [ =A0 =A06.479391] dracut: rd_NO_DM: removing DM RAID activation<br>
&gt; [ =A0 =A06.489309] dracut: rd_NO_MD: removing MD RAID activation<br>
&gt; [ =A0 =A06.542596] wmi: Mapper loaded<br>
&gt; [ =A0 =A06.564439] usbcore: registered new interface driver usbfs<br>
&gt; [ =A0 =A06.564463] usbcore: registered new interface driver hub<br>
&gt; [ =A0 =A06.568901] SCSI subsystem initialized<br>
&gt; [ =A0 =A06.569574] usbcore: registered new device driver usb<br>
&gt; [ =A0 =A06.570692] ehci_hcd: USB 2.0 &#39;Enhanced&#39; Host Controlle=
r (EHCI) Driver<br>
&gt; [ =A0 =A06.570723] xen: registering gsi 16 triggering 0 polarity 1<br>
&gt; [ =A0 =A06.570728] Already setup the GSI :16<br>
&gt; [ =A0 =A06.570776] ehci_hcd 0000:00:1a.0: setting latency timer to 64<=
br>
&gt; [ =A0 =A06.570782] ehci_hcd 0000:00:1a.0: EHCI Host Controller<br>
&gt; [ =A0 =A06.570814] ehci_hcd 0000:00:1a.0: new USB bus registered, assi=
gned bus number 1<br>
&gt; [ =A0 =A06.570879] ehci_hcd 0000:00:1a.0: debug port 2<br>
&gt; [ =A0 =A06.573720] libata version 3.00 loaded.<br>
&gt; [ =A0 =A06.574777] ehci_hcd 0000:00:1a.0: cache line size of 64 is not=
 supported<br>
&gt; [ =A0 =A06.574832] ehci_hcd 0000:00:1a.0: irq 16, io mem 0xe2e70000<br=
>
&gt; [ =A0 =A06.586344] ehci_hcd 0000:00:1a.0: USB 2.0 started, EHCI 1.00<b=
r>
&gt; [ =A0 =A06.586369] usb usb1: New USB device found, idVendor=3D1d6b, id=
Product=3D0002<br>
&gt; [ =A0 =A06.586372] usb usb1: New USB device strings: Mfr=3D3, Product=
=3D2, SerialNumber=3D1<br>
&gt; [ =A0 =A06.586375] usb usb1: Product: EHCI Host Controller<br>
&gt; [ =A0 =A06.586376] usb usb1: Manufacturer: Linux 3.4.18-2.pvops.qubes.=
x86_64 ehci_hcd<br>
&gt; [ =A0 =A06.586378] usb usb1: SerialNumber: 0000:00:1a.0<br>
&gt; [ =A0 =A06.586506] hub 1-0:1.0: USB hub found<br>
&gt; [ =A0 =A06.586511] hub 1-0:1.0: 2 ports detected<br>
&gt; [ =A0 =A06.586604] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0 =A06.586609] Already setup the GSI :17<br>
&gt; [ =A0 =A06.586663] ehci_hcd 0000:00:1d.0: setting latency timer to 64<=
br>
&gt; [ =A0 =A06.586668] ehci_hcd 0000:00:1d.0: EHCI Host Controller<br>
&gt; [ =A0 =A06.586678] ehci_hcd 0000:00:1d.0: new USB bus registered, assi=
gned bus number 2<br>
&gt; [ =A0 =A06.586734] ehci_hcd 0000:00:1d.0: debug port 2<br>
&gt; [ =A0 =A06.590650] ehci_hcd 0000:00:1d.0: cache line size of 64 is not=
 supported<br>
&gt; [ =A0 =A06.590709] ehci_hcd 0000:00:1d.0: irq 17, io mem 0xe2e50000<br=
>
&gt; [ =A0 =A06.606335] ehci_hcd 0000:00:1d.0: USB 2.0 started, EHCI 1.00<b=
r>
&gt; [ =A0 =A06.606364] usb usb2: New USB device found, idVendor=3D1d6b, id=
Product=3D0002<br>
&gt; [ =A0 =A06.606367] usb usb2: New USB device strings: Mfr=3D3, Product=
=3D2, SerialNumber=3D1<br>
&gt; [ =A0 =A06.606370] usb usb2: Product: EHCI Host Controller<br>
&gt; [ =A0 =A06.606371] usb usb2: Manufacturer: Linux 3.4.18-2.pvops.qubes.=
x86_64 ehci_hcd<br>
&gt; [ =A0 =A06.606373] usb usb2: SerialNumber: 0000:00:1d.0<br>
&gt; [ =A0 =A06.606519] hub 2-0:1.0: USB hub found<br>
&gt; [ =A0 =A06.606524] hub 2-0:1.0: 2 ports detected<br>
&gt; [ =A0 =A06.606620] ahci 0000:00:1f.2: version 3.0<br>
&gt; [ =A0 =A06.606641] xen: registering gsi 18 triggering 0 polarity 1<br>
&gt; [ =A0 =A06.606647] Already setup the GSI :18<br>
&gt; [ =A0 =A06.606896] ahci: SSS flag set, parallel bus scan disabled<br>
&gt; [ =A0 =A06.626400] ahci 0000:00:1f.2: AHCI 0001.0300 32 slots 6 ports =
6 Gbps 0x3b impl SATA mode<br>
&gt; [ =A0 =A06.626405] ahci 0000:00:1f.2: flags: 64bit ncq sntf stag pm le=
d clo pio slum part ems sxs apst<br>
&gt; [ =A0 =A06.626414] ahci 0000:00:1f.2: setting latency timer to 64<br>
&gt; [ =A0 =A06.673732] scsi0 : ahci<br>
&gt; [ =A0 =A06.683363] scsi1 : ahci<br>
&gt; [ =A0 =A06.697268] scsi2 : ahci<br>
&gt; [ =A0 =A06.711526] scsi3 : ahci<br>
&gt; [ =A0 =A06.733931] scsi4 : ahci<br>
&gt; [ =A0 =A06.739603] scsi5 : ahci<br>
&gt; [ =A0 =A06.842106] ata1: SATA max UDMA/133 abar m2048@0xe2e40000 port =
0xe2e40100 irq 293<br>
&gt; [ =A0 =A06.842118] ata2: SATA max UDMA/133 abar m2048@0xe2e40000 port =
0xe2e40180 irq 293<br>
&gt; [ =A0 =A06.842124] ata3: DUMMY<br>
&gt; [ =A0 =A06.842129] ata4: SATA max UDMA/133 abar m2048@0xe2e40000 port =
0xe2e40280 irq 293<br>
&gt; [ =A0 =A06.842136] ata5: SATA max UDMA/133 abar m2048@0xe2e40000 port =
0xe2e40300 irq 293<br>
&gt; [ =A0 =A06.842143] ata6: SATA max UDMA/133 abar m2048@0xe2e40000 port =
0xe2e40380 irq 293<br>
&gt; [ =A0 =A06.898480] usb 1-1: new high-speed USB device number 2 using e=
hci_hcd<br>
&gt; [ =A0 =A07.031312] usb 1-1: New USB device found, idVendor=3D8087, idP=
roduct=3D0024<br>
&gt; [ =A0 =A07.031323] usb 1-1: New USB device strings: Mfr=3D0, Product=
=3D0, SerialNumber=3D0<br>
&gt; [ =A0 =A07.032072] hub 1-1:1.0: USB hub found<br>
&gt; [ =A0 =A07.032344] hub 1-1:1.0: 6 ports detected<br>
&gt; [ =A0 =A07.142515] usb 2-1: new high-speed USB device number 2 using e=
hci_hcd<br>
&gt; [ =A0 =A07.162484] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 3=
00)<br>
&gt; [ =A0 =A07.268594] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) reject=
ed by device (Stat=3D0x51 Err=3D0x04)<br>
&gt; [ =A0 =A07.268770] ata1.00: ATA-9: KINGSTON SV200S3256G, E111008a, max=
 UDMA/100<br>
&gt; [ =A0 =A07.268778] ata1.00: 500118192 sectors, multi 16: LBA48 NCQ (de=
pth 31/32), AA<br>
&gt; [ =A0 =A07.272554] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) reject=
ed by device (Stat=3D0x51 Err=3D0x04)<br>
&gt; [ =A0 =A07.272758] ata1.00: configured for UDMA/100<br>
&gt; [ =A0 =A07.273314] scsi 0:0:0:0: Direct-Access =A0 =A0 ATA =A0 =A0 =A0=
KINGSTON SV200S3 E111 PQ: 0 ANSI: 5<br>
&gt; [ =A0 =A07.274861] usb 2-1: New USB device found, idVendor=3D8087, idP=
roduct=3D0024<br>
&gt; [ =A0 =A07.274870] usb 2-1: New USB device strings: Mfr=3D0, Product=
=3D0, SerialNumber=3D0<br>
&gt; [ =A0 =A07.275358] hub 2-1:1.0: USB hub found<br>
&gt; [ =A0 =A07.275521] hub 2-1:1.0: 8 ports detected<br>
&gt; [ =A0 =A07.346717] usb 1-1.4: new full-speed USB device number 3 using=
 ehci_hcd<br>
&gt; [ =A0 =A07.443529] usb 1-1.4: New USB device found, idVendor=3D413c, i=
dProduct=3D8187<br>
&gt; [ =A0 =A07.443539] usb 1-1.4: New USB device strings: Mfr=3D1, Product=
=3D2, SerialNumber=3D3<br>
&gt; [ =A0 =A07.443546] usb 1-1.4: Product: DW375 Bluetooth Module<br>
&gt; [ =A0 =A07.443550] usb 1-1.4: Manufacturer: Dell Computer Corp<br>
&gt; [ =A0 =A07.443555] usb 1-1.4: SerialNumber: D0DF9A40FE60<br>
&gt; [ =A0 =A07.514736] usb 1-1.5: new high-speed USB device number 4 using=
 ehci_hcd<br>
&gt; [ =A0 =A07.590440] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 3=
00)<br>
&gt; [ =A0 =A07.593835] ata2.00: ATAPI: HL-DT-ST DVD+/-RW GU60N, A103, max =
UDMA/133<br>
&gt; [ =A0 =A07.604147] ata2.00: configured for UDMA/133<br>
&gt; [ =A0 =A07.614746] usb 1-1.5: New USB device found, idVendor=3D05ca, i=
dProduct=3D181c<br>
&gt; [ =A0 =A07.614757] usb 1-1.5: New USB device strings: Mfr=3D1, Product=
=3D2, SerialNumber=3D0<br>
&gt; [ =A0 =A07.614763] usb 1-1.5: Product: Laptop_Integrated_Webcam_FHD<br=
>
&gt; [ =A0 =A07.614768] usb 1-1.5: Manufacturer: CN0CJ3P27248717F040SA01<br=
>
&gt; [ =A0 =A07.618662] scsi 1:0:0:0: CD-ROM =A0 =A0 =A0 =A0 =A0 =A0HL-DT-S=
T DVD+-RW GU60N =A0 =A0A103 PQ: 0 ANSI: 5<br>
&gt; [ =A0 =A07.686581] usb 2-1.6: new high-speed USB device number 3 using=
 ehci_hcd<br>
&gt; [ =A0 =A07.795399] usb 2-1.6: New USB device found, idVendor=3D413c, i=
dProduct=3D818d<br>
&gt; [ =A0 =A07.795410] usb 2-1.6: New USB device strings: Mfr=3D1, Product=
=3D2, SerialNumber=3D3<br>
&gt; [ =A0 =A07.795416] usb 2-1.6: Product: DW5550<br>
&gt; [ =A0 =A07.795420] usb 2-1.6: Manufacturer: Dell<br>
&gt; [ =A0 =A07.795425] usb 2-1.6: SerialNumber: 88FA653FDF944970<br>
&gt; [ =A0 =A07.902770] usb 2-1.8: new full-speed USB device number 4 using=
 ehci_hcd<br>
&gt; [ =A0 =A07.938478] ata4: SATA link down (SStatus 0 SControl 300)<br>
&gt; [ =A0 =A08.017319] usb 2-1.8: New USB device found, idVendor=3D0a5c, i=
dProduct=3D5801<br>
&gt; [ =A0 =A08.017330] usb 2-1.8: New USB device strings: Mfr=3D1, Product=
=3D2, SerialNumber=3D3<br>
&gt; [ =A0 =A08.017336] usb 2-1.8: Product: 5880<br>
&gt; [ =A0 =A08.017340] usb 2-1.8: Manufacturer: Broadcom Corp<br>
&gt; [ =A0 =A08.017344] usb 2-1.8: SerialNumber: 0123456789ABCD<br>
&gt; [ =A0 =A08.017794] usb 2-1.8: config 0 descriptor??<br>
&gt; [ =A0 =A08.258411] ata5: SATA link down (SStatus 0 SControl 300)<br>
&gt; [ =A0 =A08.578480] ata6: SATA link down (SStatus 0 SControl 300)<br>
&gt; [ =A0 =A08.588630] sd 0:0:0:0: [sda] 500118192 512-byte logical blocks=
: (256 GB/238 GiB)<br>
&gt; [ =A0 =A08.588846] sd 0:0:0:0: [sda] Write Protect is off<br>
&gt; [ =A0 =A08.588861] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00<br>
&gt; [ =A0 =A08.588967] sd 0:0:0:0: [sda] Write cache: enabled, read cache:=
 enabled, doesn&#39;t support DPO or FUA<br>
&gt; [ =A0 =A08.590122] =A0sda: sda1 sda2<br>
&gt; [ =A0 =A08.591059] sd 0:0:0:0: [sda] Attached SCSI disk<br>
&gt; [ =A0 =A08.609438] sr0: scsi3-mmc drive: 24x/8x writer dvd-ram cd/rw x=
a/form2 cdda tray<br>
&gt; [ =A0 =A08.609451] cdrom: Uniform CD-ROM driver Revision: 3.20<br>
&gt; [ =A0 =A08.609737] sr 1:0:0:0: Attached scsi CD-ROM sr0<br>
&gt; [ =A0 =A08.714515] dracut: luksOpen /dev/sda2 luks-400336fa-c7c4-4be3-=
a244-c909aa16a18c<br>
&gt; [ =A0 13.862564] dracut: Scanning devices dm-0 =A0for LVM logical volu=
mes vg_dom0/lv_root vg_dom0/lv_swap<br>
&gt; [ =A0 13.907639] dracut: inactive &#39;/dev/vg_dom0/lv_root&#39; [221.=
62 GiB] inherit<br>
&gt; [ =A0 13.907708] dracut: inactive &#39;/dev/vg_dom0/lv_swap&#39; [16.3=
4 GiB] inherit<br>
&gt; [ =A0 14.162684] EXT4-fs (dm-1): INFO: recovery required on readonly f=
ilesystem<br>
&gt; [ =A0 14.162693] EXT4-fs (dm-1): write access will be enabled during r=
ecovery<br>
&gt; [ =A0 14.775779] EXT4-fs (dm-1): orphan cleanup on readonly fs<br>
&gt; [ =A0 14.775800] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767209<br>
&gt; [ =A0 14.775909] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767207<br>
&gt; [ =A0 14.776007] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767205<br>
&gt; [ =A0 14.776035] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767206<br>
&gt; [ =A0 14.776062] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767204<br>
&gt; [ =A0 14.776088] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767202<br>
&gt; [ =A0 14.776117] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767198<br>
&gt; [ =A0 14.776146] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767196<br>
&gt; [ =A0 14.776172] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767191<br>
&gt; [ =A0 14.776198] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767189<br>
&gt; [ =A0 14.776227] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767188<br>
&gt; [ =A0 14.776274] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767187<br>
&gt; [ =A0 14.777018] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767186<br>
&gt; [ =A0 14.777060] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767184<br>
&gt; [ =A0 14.777089] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767183<br>
&gt; [ =A0 14.777117] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767171<br>
&gt; [ =A0 14.777146] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unrefer=
enced inode 5767170<br>
&gt; [ =A0 14.777172] EXT4-fs (dm-1): 17 orphan inodes deleted<br>
&gt; [ =A0 14.777177] EXT4-fs (dm-1): recovery complete<br>
&gt; [ =A0 14.797124] EXT4-fs (dm-1): mounted filesystem with ordered data =
mode. Opts: (null)<br>
&gt; [ =A0 14.806762] dracut: Mounted root filesystem /dev/mapper/vg_dom0-l=
v_root<br>
&gt; [ =A0 14.957211] dracut: Switching root<br>
&gt; [ =A0 15.599261] udev: starting version 151<br>
&gt; [ =A0 15.673674] iTCO_vendor_support: vendor-support=3D0<br>
&gt; [ =A0 15.676374] mei: module is from the staging directory, the qualit=
y is unknown, you have been warned.<br>
&gt; [ =A0 15.676488] iTCO_wdt: Intel TCO WatchDog Timer Driver v1.07<br>
&gt; [ =A0 15.676679] iTCO_wdt: Found a Cougar Point TCO device (Version=3D=
2, TCOBASE=3D0x0460)<br>
&gt; [ =A0 15.676711] xen: registering gsi 16 triggering 0 polarity 1<br>
&gt; [ =A0 15.676716] Already setup the GSI :16<br>
&gt; [ =A0 15.676725] mei 0000:00:16.0: setting latency timer to 64<br>
&gt; [ =A0 15.676754] iTCO_wdt: initialized. heartbeat=3D30 sec (nowayout=
=3D0)<br>
&gt; [ =A0 15.712582] sd 0:0:0:0: Attached scsi generic sg0 type 0<br>
&gt; [ =A0 15.712620] sr 1:0:0:0: Attached scsi generic sg1 type 5<br>
&gt; [ =A0 15.730448] input: PC Speaker as /devices/platform/pcspkr/input/i=
nput8<br>
&gt; [ =A0 15.734494] xen: registering gsi 18 triggering 0 polarity 1<br>
&gt; [ =A0 15.734500] Already setup the GSI :18<br>
&gt; [ =A0 15.734506] ACPI Warning: 0x0000000000004040-0x000000000000405f S=
ystemIO conflicts with Region \_SB_.PCI0.SBUS.SMBI 1 (20120320/utaddress-25=
1)<br>
&gt; [ =A0 15.734512] ACPI: If an ACPI driver is available for this device,=
 you should use it instead of the native driver<br>
&gt; [ =A0 15.737002] microcode: CPU0 sig=3D0x206a7, pf=3D0x10, revision=3D=
0x23<br>
&gt; [ =A0 15.741412] watchdog: INTCAMT: cannot register miscdev on minor=
=3D130 (err=3D-16)<br>
&gt; [ =A0 15.741418] watchdog: error registering /dev/watchdog (err=3D-16)=
<br>
&gt; [ =A0 15.741422] mei 0000:00:16.0: unable to register watchdog device.=
<br>
&gt; [ =A0 15.790637] thermal LNXTHERM:00: registered as thermal_zone0<br>
&gt; [ =A0 15.790641] ACPI: Thermal Zone [THM] (25 C)<br>
&gt; [ =A0 15.814551] ACPI: Deprecated procfs I/F for battery is loaded, pl=
ease retry with CONFIG_ACPI_PROCFS_POWER cleared<br>
&gt; [ =A0 15.814559] ACPI: Battery Slot [BAT0] (battery present)<br>
&gt; [ =A0 15.815037] ACPI: Deprecated procfs I/F for AC is loaded, please =
retry with CONFIG_ACPI_PROCFS_POWER cleared<br>
&gt; [ =A0 15.815521] ACPI: AC Adapter [AC] (on-line)<br>
&gt; [ =A0 15.867835] usbcore: registered new interface driver usbback<br>
&gt; [ =A0 15.975826] ACPI: Deprecated procfs I/F for battery is loaded, pl=
ease retry with CONFIG_ACPI_PROCFS_POWER cleared<br>
&gt; [ =A0 15.975836] ACPI: Battery Slot [BAT1] (battery absent)<br>
&gt; [ =A0 16.102871] ACPI: Deprecated procfs I/F for battery is loaded, pl=
ease retry with CONFIG_ACPI_PROCFS_POWER cleared<br>
&gt; [ =A0 16.102882] ACPI: Battery Slot [BAT2] (battery absent)<br>
&gt; [ =A0 16.106793] sdhci: Secure Digital Host Controller Interface drive=
r<br>
&gt; [ =A0 16.106797] sdhci: Copyright(c) Pierre Ossman<br>
&gt; [ =A0 16.107131] parport_pc 00:08: [io =A00x0378-0x037b]<br>
&gt; [ =A0 16.107296] parport_pc 00:08: [irq 5]<br>
&gt; [ =A0 16.107709] sdhci-pci 0000:0a:00.0: SDHCI controller found [1217:=
8221] (rev 5)<br>
&gt; [ =A0 16.159148] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0 16.159156] Already setup the GSI :17<br>
&gt; [ =A0 16.159241] sdhci-pci 0000:0a:00.0: Invalid iomem size. You may e=
xperience problems.<br>
&gt; [ =A0 16.159319] 0000:0a:00.0 supply vmmc not found, using dummy regul=
ator<br>
&gt; [ =A0 16.159384] Registered led device: mmc0::<br>
&gt; [ =A0 16.160442] mmc0: SDHCI controller on PCI [0000:0a:00.0] using DM=
A<br>
&gt; [ =A0 16.160928] sdhci-pci 0000:0a:00.0: could not set regulator OCR (=
-22)<br>
&gt; [ =A0 16.171737] Linux video capture interface: v2.00<br>
&gt; [ =A0 16.192158] cdc_wdm 2-1.6:1.5: cdc-wdm0: USB WDM device<br>
&gt; [ =A0 16.192211] cdc_wdm 2-1.6:1.8: cdc-wdm1: USB WDM device<br>
&gt; [ =A0 16.192234] usbcore: registered new interface driver cdc_wdm<br>
&gt; [ =A0 16.195744] cdc_acm 2-1.6:1.1: ttyACM0: USB ACM device<br>
&gt; [ =A0 16.198739] sdhci-pci 0000:0a:00.0: could not set regulator OCR (=
-22)<br>
&gt; [ =A0 16.220532] cdc_acm 2-1.6:1.3: ttyACM1: USB ACM device<br>
&gt; [ =A0 16.223728] cdc_acm 2-1.6:1.9: ttyACM2: USB ACM device<br>
&gt; [ =A0 16.235089] sdhci-pci 0000:0a:00.0: could not set regulator OCR (=
-22)<br>
&gt; [ =A0 16.235234] usbcore: registered new interface driver cdc_acm<br>
&gt; [ =A0 16.235236] cdc_acm: USB Abstract Control Model driver for USB mo=
dems and ISDN adapters<br>
&gt; [ =A0 16.240235] uvcvideo: Found UVC 1.00 device Laptop_Integrated_Web=
cam_FHD (05ca:181c)<br>
&gt; [ =A0 16.269474] input: Laptop_Integrated_Webcam_FHD as /devices/pci00=
00:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/input/input9<br>
&gt; [ =A0 16.269579] usbcore: registered new interface driver uvcvideo<br>
&gt; [ =A0 16.269581] USB Video Class driver (1.1.1)<br>
&gt; [ =A0 16.277415] sdhci-pci 0000:0a:00.0: could not set regulator OCR (=
-22)<br>
&gt; [ =A0 16.296646] usb 2-1.6: MAC-Address: 02:80:37:ec:02:00<br>
&gt; [ =A0 16.296810] cdc_ncm 2-1.6:1.6: usb0: register &#39;cdc_ncm&#39; a=
t usb-0000:00:1d.0-1.6, CDC NCM, 02:80:37:ec:02:00<br>
&gt; [ =A0 16.296847] usbcore: registered new interface driver cdc_ncm<br>
&gt; [ =A0 16.310604] parport_pc 00:08: activated<br>
&gt; [ =A0 16.310611] parport_pc 00:08: reported by Plug and Play ACPI<br>
&gt; [ =A0 16.310781] parport_pc 00:08: disabled<br>
&gt; [ =A0 16.311583] tpm_tis 00:0a: 1.2 TPM (device-id 0x2001, rev-id 32)<=
br>
&gt; [ =A0 16.399296] Bluetooth: Core ver 2.16<br>
&gt; [ =A0 16.399312] NET: Registered protocol family 31<br>
&gt; [ =A0 16.399314] Bluetooth: HCI device and connection manager initiali=
zed<br>
&gt; [ =A0 16.399317] Bluetooth: HCI socket layer initialized<br>
&gt; [ =A0 16.399318] Bluetooth: L2CAP socket layer initialized<br>
&gt; [ =A0 16.399325] Bluetooth: SCO socket layer initialized<br>
&gt; [ =A0 16.450583] xen: registering gsi 22 triggering 0 polarity 1<br>
&gt; [ =A0 16.450600] xen: --&gt; pirq=3D22 -&gt; irq=3D22 (gsi=3D22)<br>
&gt; [ =A0 16.567577] usbcore: registered new interface driver btusb<br>
&gt; [ =A0 16.739259] dcdbas dcdbas: Dell Systems Management Base Driver (v=
ersion 5.6.0-3.2)<br>
&gt; [ =A0 16.819125] input: Dell WMI hotkeys as /devices/virtual/input/inp=
ut10<br>
&gt; [ =A0 16.925000] microcode: CPU1 sig=3D0x206a7, pf=3D0x10, revision=3D=
0x23<br>
&gt; [ =A0 16.929246] ppdev: user-space parallel port driver<br>
&gt; [ =A0 16.954783] microcode: CPU2 sig=3D0x206a7, pf=3D0x10, revision=3D=
0x23<br>
&gt; [ =A0 16.975176] microcode: CPU3 sig=3D0x206a7, pf=3D0x10, revision=3D=
0x23<br>
&gt; [ =A0 17.004696] microcode: Microcode Update Driver: v2.00 &lt;<a href=
=3D"mailto:tigran@aivazian.fsnet.co.uk">tigran@aivazian.fsnet.co.uk</a>&gt;=
, Peter Oruba<br>
&gt; [ =A0 17.067123] ALSA hda_codec.c:5101 autoconfig: line_outs=3D1 (0xe/=
0x0/0x0/0x0/0x0) type:line<br>
&gt; [ =A0 17.067127] ALSA hda_codec.c:5105 =A0 =A0speaker_outs=3D1 (0xd/0x=
0/0x0/0x0/0x0)<br>
&gt; [ =A0 17.067129] ALSA hda_codec.c:5109 =A0 =A0hp_outs=3D1 (0xb/0x0/0x0=
/0x0/0x0)<br>
&gt; [ =A0 17.067131] ALSA hda_codec.c:5110 =A0 =A0mono: mono_out=3D0x0<br>
&gt; [ =A0 17.067133] ALSA hda_codec.c:5114 =A0 =A0inputs:<br>
&gt; [ =A0 17.067135] ALSA hda_codec.c:5118 =A0Mic=3D0xa<br>
&gt; [ =A0 17.067137] ALSA hda_codec.c:5118 =A0Dock Mic=3D0xf<br>
&gt; [ =A0 17.067139] ALSA hda_codec.c:5120<br>
&gt; [ =A0 17.067637] ALSA patch_sigmatel.c:3117 stac92xx: dac_nids=3D1 (0x=
13/0x0/0x0/0x0/0x0)<br>
&gt; [ =A0 17.081104] input: HDA Intel PCH HDMI/DP,pcm=3D8 as /devices/pci0=
000:00/0000:00:1b.0/sound/card0/input11<br>
&gt; [ =A0 17.081194] input: HDA Intel PCH HDMI/DP,pcm=3D7 as /devices/pci0=
000:00/0000:00:1b.0/sound/card0/input12<br>
&gt; [ =A0 17.081250] input: HDA Intel PCH HDMI/DP,pcm=3D3 as /devices/pci0=
000:00/0000:00:1b.0/sound/card0/input13<br>
&gt; [ =A0 17.081342] input: HDA Intel PCH Dock Mic as /devices/pci0000:00/=
0000:00:1b.0/sound/card0/input14<br>
&gt; [ =A0 17.081432] input: HDA Intel PCH Mic as /devices/pci0000:00/0000:=
00:1b.0/sound/card0/input15<br>
&gt; [ =A0 17.081522] input: HDA Intel PCH Headphone as /devices/pci0000:00=
/0000:00:1b.0/sound/card0/input16<br>
&gt; [ =A0 17.081610] input: HDA Intel PCH Dock Line Out as /devices/pci000=
0:00/0000:00:1b.0/sound/card0/input17<br>
&gt; [ =A0 17.265462] Event-channel device installed.<br>
&gt; [ =A0 17.661764] EXT4-fs (dm-1): re-mounted. Opts: (null)<br>
&gt; [ =A0 17.802446] EXT4-fs (sda1): mounted filesystem with ordered data =
mode. Opts: (null)<br>
&gt; [ =A0 19.361631] Adding 17137660k swap on /dev/mapper/vg_dom0-lv_swap.=
 =A0Priority:-1 extents:1 across:17137660k SS<br>
&gt; [ =A0 22.602549] ehci_hcd 0000:00:1a.0: remove, state 1<br>
&gt; [ =A0 22.602568] usb usb1: USB disconnect, device number 1<br>
&gt; [ =A0 22.602573] usb 1-1: USB disconnect, device number 2<br>
&gt; [ =A0 22.602578] usb 1-1.4: USB disconnect, device number 3<br>
&gt; [ =A0 22.605235] usb 1-1.5: USB disconnect, device number 4<br>
&gt; [ =A0 22.636910] ehci_hcd 0000:00:1a.0: USB bus 1 deregistered<br>
&gt; [ =A0 22.637183] pciback 0000:00:1a.0: seizing device<br>
&gt; [ =A0 22.637235] xen: registering gsi 16 triggering 0 polarity 1<br>
&gt; [ =A0 22.637241] Already setup the GSI :16<br>
&gt; [ =A0 22.662363] ehci_hcd 0000:00:1d.0: remove, state 1<br>
&gt; [ =A0 22.662371] usb usb2: USB disconnect, device number 1<br>
&gt; [ =A0 22.662373] usb 2-1: USB disconnect, device number 2<br>
&gt; [ =A0 22.662376] usb 2-1.6: USB disconnect, device number 3<br>
&gt; [ =A0 22.668531] cdc_ncm 2-1.6:1.6: usb0: unregister &#39;cdc_ncm&#39;=
 usb-0000:00:1d.0-1.6, CDC NCM<br>
&gt; [ =A0 22.694795] usb 2-1.8: USB disconnect, device number 4<br>
&gt; [ =A0 22.699298] ehci_hcd 0000:00:1d.0: USB bus 2 deregistered<br>
&gt; [ =A0 22.699577] pciback 0000:00:1d.0: seizing device<br>
&gt; [ =A0 22.699632] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0 22.699637] Already setup the GSI :17<br>
&gt; [ =A0 23.684708] xen-pciback: vpci: 0000:00:19.0: assign to virtual sl=
ot 0<br>
&gt; [ =A0 23.685240] xen-pciback: vpci: 0000:00:1a.0: assign to virtual sl=
ot 1<br>
&gt; [ =A0 23.685722] xen-pciback: vpci: 0000:00:1d.0: assign to virtual sl=
ot 2<br>
&gt; [ =A0 23.686764] xen-pciback: vpci: 0000:02:00.0: assign to virtual sl=
ot 3<br>
&gt; [ =A0 23.909636] pciback 0000:00:19.0: Driver tried to write to a read=
-only configuration space field at offset 0xd2, size 2. This may be harmles=
s, but if you have problems with your device:<br>
&gt; [ =A0 23.909638] 1) see permissive attribute in sysfs<br>
&gt; [ =A0 23.909638] 2) report problems to the xen-devel mailing list alon=
g with details of your device obtained from lspci.<br>
&gt; [ =A0 23.917523] pciback 0000:02:00.0: Driver tried to write to a read=
-only configuration space field at offset 0xd2, size 2. This may be harmles=
s, but if you have problems with your device:<br>
&gt; [ =A0 23.917526] 1) see permissive attribute in sysfs<br>
&gt; [ =A0 23.917526] 2) report problems to the xen-devel mailing list alon=
g with details of your device obtained from lspci.<br>
&gt; [ =A0 24.123663] xen-blkback:ring-ref 9, event-channel 14, protocol 1 =
(x86_64-abi)<br>
&gt; [ =A0 24.140460] xen-blkback:ring-ref 10, event-channel 15, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0 24.151420] xen-blkback:ring-ref 11, event-channel 16, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0 24.158428] xen-blkback:ring-ref 12, event-channel 17, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0 28.697615] pciback 0000:00:1a.0: enabling device (0000 -&gt; 000=
2)<br>
&gt; [ =A0 28.697628] xen: registering gsi 16 triggering 0 polarity 1<br>
&gt; [ =A0 28.697634] Already setup the GSI :16<br>
&gt; [ =A0 28.697805] pciback 0000:00:1a.0: setting latency timer to 64<br>
&gt; [ =A0 28.713578] pciback 0000:00:19.0: enabling device (0000 -&gt; 000=
3)<br>
&gt; [ =A0 28.713591] xen: registering gsi 20 triggering 0 polarity 1<br>
&gt; [ =A0 28.713598] Already setup the GSI :20<br>
&gt; [ =A0 28.713858] pciback 0000:00:19.0: setting latency timer to 64<br>
&gt; [ =A0 29.021371] pciback 0000:00:1d.0: enabling device (0000 -&gt; 000=
2)<br>
&gt; [ =A0 29.021389] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0 29.021400] Already setup the GSI :17<br>
&gt; [ =A0 29.021805] pciback 0000:00:1d.0: setting latency timer to 64<br>
&gt; [ =A0 29.150053] pciback 0000:02:00.0: enabling device (0000 -&gt; 000=
2)<br>
&gt; [ =A0 29.150122] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0 29.150150] Already setup the GSI :17<br>
&gt; [ =A0 33.635416] xen-blkback:ring-ref 9, event-channel 14, protocol 1 =
(x86_64-abi)<br>
&gt; [ =A0 33.643330] xen-blkback:ring-ref 10, event-channel 15, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0 33.651561] xen-blkback:ring-ref 11, event-channel 16, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0 33.672105] xen-blkback:ring-ref 12, event-channel 17, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0104.230911] xen-blkback:ring-ref 9, event-channel 24, protocol 1 =
(x86_64-abi)<br>
&gt; [ =A0104.252421] xen-blkback:ring-ref 10, event-channel 25, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0104.253177] xen-blkback:ring-ref 11, event-channel 26, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0104.254220] xen-blkback:ring-ref 12, event-channel 27, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0105.086732] xen-blkback:ring-ref 9, event-channel 14, protocol 1 =
(x86_64-abi)<br>
&gt; [ =A0105.105505] xen-blkback:ring-ref 10, event-channel 15, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0105.115951] xen-blkback:ring-ref 11, event-channel 16, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0105.127384] xen-blkback:ring-ref 12, event-channel 17, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0105.929760] xen-blkback:ring-ref 9, event-channel 14, protocol 1 =
(x86_64-abi)<br>
&gt; [ =A0105.934841] xen-blkback:ring-ref 10, event-channel 15, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0105.973920] xen-blkback:ring-ref 11, event-channel 16, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0105.975320] xen-blkback:ring-ref 12, event-channel 17, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0107.191781] xen-blkback:ring-ref 9, event-channel 14, protocol 1 =
(x86_64-abi)<br>
&gt; [ =A0107.203711] xen-blkback:ring-ref 10, event-channel 15, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0107.208481] xen-blkback:ring-ref 11, event-channel 16, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0107.212081] xen-blkback:ring-ref 12, event-channel 17, protocol 1=
 (x86_64-abi)<br>
&gt; [ =A0733.434608] PM: Syncing filesystems ... done.<br>
&gt; [ =A0733.436228] PM: Preparing system for mem sleep<br>
&gt; [ =A0733.514803] Freezing user space processes ... (elapsed 0.01 secon=
ds) done.<br>
&gt; [ =A0733.530594] Freezing remaining freezable tasks ... (elapsed 0.01 =
seconds) done.<br>
&gt; [ =A0733.546589] PM: Entering mem sleep<br>
&gt; [ =A0733.546741] Suspending console(s) (use no_console_suspend to debu=
g)<br>
&gt; [ =A0733.547431] sd 0:0:0:0: [sda] Synchronizing SCSI cache<br>
&gt; [ =A0733.558336] sd 0:0:0:0: [sda] Stopping disk<br>
&gt; [ =A0734.194656] PM: suspend of devices complete after 647.504 msecs<b=
r>
&gt; [ =A0734.195026] PM: late suspend of devices complete after 0.359 msec=
s<br>
&gt; [ =A0734.210655] PM: noirq suspend of devices complete after 15.614 ms=
ecs<br>
&gt; [ =A0734.211326] ACPI: Preparing to enter system sleep state S3<br>
&gt; [ =A0734.235008] PM: Saving platform NVS memory<br>
&gt; [ =A0734.328066] Disabling non-boot CPUs ...<br>
&gt; [ =A0735.945491] ACPI: Low-level resume complete<br>
&gt; [ =A0735.945579] PM: Restoring platform NVS memory<br>
&gt; [ =A0736.000094] Enabling non-boot CPUs ...<br>
&gt; [ =A0736.000256] installing Xen timer for CPU 1<br>
&gt; [ =A0736.004594] CPU1 is up<br>
&gt; [ =A0736.004819] installing Xen timer for CPU 2<br>
&gt; [ =A0736.067516] CPU2 is up<br>
&gt; [ =A0736.067770] installing Xen timer for CPU 3<br>
&gt; [ =A0736.101535] CPU3 is up<br>
&gt; [ =A0736.102470] ACPI: Waking up from system sleep state S3<br>
&gt; [ =A0736.555932] PM: noirq resume of devices complete after 7.970 msec=
s<br>
&gt; [ =A0736.556506] PM: early resume of devices complete after 0.387 msec=
s<br>
&gt; [ =A0736.660336] i915 0000:00:02.0: setting latency timer to 64<br>
&gt; [ =A0736.660404] pciback 0000:00:19.0: setting latency timer to 64<br>
&gt; [ =A0736.660453] xen: registering gsi 16 triggering 0 polarity 1<br>
&gt; [ =A0736.660460] Already setup the GSI :16<br>
&gt; [ =A0736.660490] pciback 0000:00:1a.0: setting latency timer to 64<br>
&gt; [ =A0736.660605] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0736.660610] Already setup the GSI :17<br>
&gt; [ =A0736.660641] pciback 0000:00:1d.0: setting latency timer to 64<br>
&gt; [ =A0736.660696] xen: registering gsi 22 triggering 0 polarity 1<br>
&gt; [ =A0736.660701] Already setup the GSI :22<br>
&gt; [ =A0736.661221] ahci 0000:00:1f.2: setting latency timer to 64<br>
&gt; [ =A0736.689606] xen: registering gsi 18 triggering 0 polarity 1<br>
&gt; [ =A0736.689608] Already setup the GSI :18<br>
&gt; [ =A0736.689704] xen: registering gsi 17 triggering 0 polarity 1<br>
&gt; [ =A0736.689706] Already setup the GSI :17<br>
&gt; [ =A0736.711623] [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp of=
f<br>
&gt; [ =A0736.802676] watchdog: INTCAMT: cannot register miscdev on minor=
=3D130 (err=3D-16)<br>
&gt; [ =A0736.802678] watchdog: error registering /dev/watchdog (err=3D-16)=
<br>
&gt; [ =A0736.802680] mei 0000:00:16.0: unable to register watchdog device.=
<br>
&gt; [ =A0737.060106] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300=
)<br>
&gt; [ =A0737.060330] ata4: SATA link down (SStatus 0 SControl 300)<br>
&gt; [ =A0737.060372] ata5: SATA link down (SStatus 0 SControl 300)<br>
&gt; [ =A0737.074123] ata2.00: configured for UDMA/133<br>
&gt; [ =A0737.117629] ata6: SATA link down (SStatus 0 SControl 300)<br>
&gt; [ =A0738.619036] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300=
)<br>
&gt; [ =A0738.743565] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected=
 by device (Stat=3D0x51 Err=3D0x04)<br>
&gt; [ =A0738.901088] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected=
 by device (Stat=3D0x51 Err=3D0x04)<br>
&gt; [ =A0738.903441] ata1.00: configured for UDMA/100<br>
&gt; [ =A0738.903843] sd 0:0:0:0: [sda] Starting disk<br>
&gt; [ =A0738.905367] PM: resume of devices complete after 2348.851 msecs<b=
r>
&gt; [ =A0738.905922] PM: Finishing wakeup.<br>
&gt; [ =A0738.905926] Restarting tasks ... done.<br>
&gt; [ =A0738.911334] video LNXVIDEO:00: Restoring backlight state<br>
&gt; [ =A0739.836250] dell_wmi: Received unknown WMI event (0x0)<br>
&gt; [ =A0740.184759] sdhci-pci 0000:0a:00.0: could not set regulator OCR (=
-22)<br>
&gt; [ =A0740.239730] sdhci-pci 0000:0a:00.0: could not set regulator OCR (=
-22)<br>
&gt; [ =A0740.327711] sdhci-pci 0000:0a:00.0: could not set regulator OCR (=
-22)<br>
&gt; [ =A0740.373931] sdhci-pci 0000:0a:00.0: could not set regulator OCR (=
-22)<br>
&gt; [ =A0742.542022] hrtimer: interrupt took 102980031 ns<br>
&gt; [ =A0757.609031] [sched_delayed] sched: RT throttling activated<br>
&gt; [ =A0760.164427] hda-intel: IRQ timing workaround is activated for car=
d #0. Suggest a bigger bdl_pos_adj.<br>
<br>
&gt; (XEN) Xen version 4.1.3 (<a href=3D"mailto:user@marmarek.net">user@mar=
marek.net</a>) (gcc version 4.4.5 20101112 (Red Hat 4.4.5-2) (GCC) ) Mon No=
v 26 15:25:32 EST 2012<br>
&gt; (XEN) Latest ChangeSet: unavailable<br>
&gt; (XEN) Bootloader: GNU GRUB 0.97<br>
&gt; (XEN) Command line: console=3Dnone cpufreq=3Dverbose=3D1<br>
&gt; (XEN) Video information:<br>
&gt; (XEN) =A0VGA is text mode 80x25, font 8x16<br>
&gt; (XEN) =A0VBE/DDC methods: V2; EDID transfer time: 1 seconds<br>
&gt; (XEN) Disc information:<br>
&gt; (XEN) =A0Found 1 MBR signatures<br>
&gt; (XEN) =A0Found 1 EDD information structures<br>
&gt; (XEN) Xen-e820 RAM map:<br>
&gt; (XEN) =A00000000000000000 - 000000000009a800 (usable)<br>
&gt; (XEN) =A0000000000009a800 - 00000000000a0000 (reserved)<br>
&gt; (XEN) =A000000000000e0000 - 0000000000100000 (reserved)<br>
&gt; (XEN) =A00000000000100000 - 0000000007eea000 (usable)<br>
&gt; (XEN) =A00000000007eea000 - 0000000007f67000 (ACPI NVS)<br>
&gt; (XEN) =A00000000007f67000 - 0000000007f70000 (usable)<br>
&gt; (XEN) =A00000000007f70000 - 0000000007f76000 (ACPI NVS)<br>
&gt; (XEN) =A00000000007f76000 - 0000000007f78000 (usable)<br>
&gt; (XEN) =A00000000007f78000 - 0000000008000000 (ACPI NVS)<br>
&gt; (XEN) =A00000000008000000 - 000000000dffd000 (usable)<br>
&gt; (XEN) =A0000000000dffd000 - 000000000e000000 (ACPI data)<br>
&gt; (XEN) =A0000000000e000000 - 0000000020000000 (usable)<br>
&gt; (XEN) =A00000000020000000 - 0000000020200000 (reserved)<br>
&gt; (XEN) =A00000000020200000 - 0000000040000000 (usable)<br>
&gt; (XEN) =A00000000040000000 - 0000000040200000 (reserved)<br>
&gt; (XEN) =A00000000040200000 - 00000000c83b4000 (usable)<br>
&gt; (XEN) =A000000000c83b4000 - 00000000c840a000 (reserved)<br>
&gt; (XEN) =A000000000c840a000 - 00000000c840e000 (usable)<br>
&gt; (XEN) =A000000000c840e000 - 00000000c840f000 (reserved)<br>
&gt; (XEN) =A000000000c840f000 - 00000000c8411000 (usable)<br>
&gt; (XEN) =A000000000c8411000 - 00000000c8414000 (reserved)<br>
&gt; (XEN) =A000000000c8414000 - 00000000c841e000 (usable)<br>
&gt; (XEN) =A000000000c841e000 - 00000000c8428000 (reserved)<br>
&gt; (XEN) =A000000000c8428000 - 00000000c8432000 (usable)<br>
&gt; (XEN) =A000000000c8432000 - 00000000c8436000 (reserved)<br>
&gt; (XEN) =A000000000c8436000 - 00000000cac00000 (usable)<br>
&gt; (XEN) =A000000000cb800000 - 00000000cfa00000 (reserved)<br>
&gt; (XEN) =A000000000fed1c000 - 00000000fed20000 (reserved)<br>
&gt; (XEN) =A000000000ffc00000 - 00000000ffc20000 (reserved)<br>
&gt; (XEN) =A00000000100000000 - 000000042e000000 (usable)<br>
&gt; (XEN) ACPI: RSDP 000FE300, 0024 (r2 DELL =A0)<br>
&gt; (XEN) ACPI: XSDT 0DFFEE18, 007C (r1 DELL =A0 =A0CBX3 =A0 =A0 6222004 M=
SFT =A0 =A010013)<br>
&gt; (XEN) ACPI: FACP 07F90D98, 00F4 (r4 DELL =A0 =A0CBX3 =A0 =A0 6222004 M=
SFT =A0 =A010013)<br>
&gt; (XEN) ACPI: DSDT 07F5E018, 8834 (r2 INT430 SYSFexxx =A0 =A0 1001 INTL =
20090903)<br>
&gt; (XEN) ACPI: FACS 07FEDD40, 0040<br>
&gt; (XEN) ACPI: APIC 0DFFDF18, 00CC (r2 DELL =A0 =A0CBX3 =A0 =A0 6222004 M=
SFT =A0 =A010013)<br>
&gt; (XEN) ACPI: TCPA 07FEED18, 0032 (r2 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A0 0)<br>
&gt; (XEN) ACPI: SSDT 07F91A98, 02F9 (r1 DELLTP =A0 =A0 =A0TPM =A0 =A0 3000=
 INTL 20090903)<br>
&gt; (XEN) ACPI: MCFG 07FEEC98, 003C (r1 DELL =A0 SNDYBRDG =A06222004 MSFT =
=A0 =A0 =A0 97)<br>
&gt; (XEN) ACPI: HPET 07FEEC18, 0038 (r1 A M I =A0 PCHHPET =A06222004 AMI. =
=A0 =A0 =A0 =A03)<br>
&gt; (XEN) ACPI: BOOT 07FEEB98, 0028 (r1 DELL =A0 CBX3 =A0 =A0 =A06222004 A=
MI =A0 =A0 10013)<br>
&gt; (XEN) ACPI: SSDT 07F75018, 0804 (r1 =A0PmRef =A0Cpu0Ist =A0 =A0 3000 I=
NTL 20090903)<br>
&gt; (XEN) ACPI: SSDT 07F74018, 0996 (r1 =A0PmRef =A0 =A0CpuPm =A0 =A0 3000=
 INTL 20090903)<br>
&gt; (XEN) ACPI: DMAR 07F90C18, 00E8 (r1 INTEL =A0 =A0 =A0SNB =A0 =A0 =A0 =
=A0 1 INTL =A0 =A0 =A0 =A01)<br>
&gt; (XEN) ACPI: SLIC 07F7EC18, 0176 (r3 DELL =A0 =A0CBX3 =A0 =A0 6222004 M=
SFT =A0 =A010013)<br>
&gt; (XEN) System RAM: 16262MB (16652432kB)<br>
&gt; (XEN) Domain heap initialised<br>
&gt; (XEN) ACPI: 32/64X FACS address mismatch in FADT - 07fede40/0000000007=
fedd40, using 32<br>
&gt; (XEN) Processor #0 6:10 APIC version 21<br>
&gt; (XEN) Processor #2 6:10 APIC version 21<br>
&gt; (XEN) Processor #1 6:10 APIC version 21<br>
&gt; (XEN) Processor #3 6:10 APIC version 21<br>
&gt; (XEN) IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-23<b=
r>
&gt; (XEN) Enabling APIC mode: =A0Flat. =A0Using 1 I/O APICs<br>
&gt; (XEN) Table is not found!<br>
&gt; (XEN) Switched to APIC driver x2apic_cluster.<br>
&gt; (XEN) Using scheduler: SMP Credit Scheduler (credit)<br>
&gt; (XEN) Detected 2494.416 MHz processor.<br>
&gt; (XEN) Initing memory sharing.<br>
&gt; (XEN) Intel VT-d supported page sizes: 4kB.<br>
&gt; (XEN) Intel VT-d supported page sizes: 4kB.<br>
&gt; (XEN) Intel VT-d Snoop Control not enabled.<br>
&gt; (XEN) Intel VT-d Dom0 DMA Passthrough not enabled.<br>
&gt; (XEN) Intel VT-d Queued Invalidation enabled.<br>
&gt; (XEN) Intel VT-d Interrupt Remapping enabled.<br>
&gt; (XEN) Intel VT-d Shared EPT tables not enabled.<br>
&gt; (XEN) I/O virtualisation enabled<br>
&gt; (XEN) =A0- Dom0 mode: Relaxed<br>
&gt; (XEN) Enabled directed EOI with ioapic_ack_old on!<br>
&gt; (XEN) ENABLING IO-APIC IRQs<br>
&gt; (XEN) =A0-&gt; Using old ACK method<br>
&gt; (XEN) Platform timer appears to have unexpectedly wrapped 1 times.<br>
&gt; (XEN) Platform timer is 14.318MHz HPET<br>
&gt; (XEN) Allocated console ring of 16 KiB.<br>
&gt; (XEN) VMX: Supported advanced features:<br>
&gt; (XEN) =A0- APIC MMIO access virtualisation<br>
&gt; (XEN) =A0- APIC TPR shadow<br>
&gt; (XEN) =A0- Extended Page Tables (EPT)<br>
&gt; (XEN) =A0- Virtual-Processor Identifiers (VPID)<br>
&gt; (XEN) =A0- Virtual NMI<br>
&gt; (XEN) =A0- MSR direct-access bitmap<br>
&gt; (XEN) =A0- Unrestricted Guest<br>
&gt; (XEN) HVM: ASIDs enabled.<br>
&gt; (XEN) HVM: VMX enabled<br>
&gt; (XEN) HVM: Hardware Assisted Paging (HAP) detected<br>
&gt; (XEN) HVM: HAP page sizes: 4kB, 2MB<br>
&gt; (XEN) Brought up 4 CPUs<br>
&gt; (XEN) *** LOADING DOMAIN 0 ***<br>
&gt; (XEN) =A0Xen =A0kernel: 64-bit, lsb, compat32<br>
&gt; (XEN) =A0Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -&gt; 0x1e1300=
0<br>
&gt; (XEN) PHYSICAL MEMORY ARRANGEMENT:<br>
&gt; (XEN) =A0Dom0 alloc.: =A0 0000000418000000-&gt;000000041c000000 (40465=
67 pages to be allocated)<br>
&gt; (XEN) =A0Init. ramdisk: 000000042b335000-&gt;000000042dfffc00<br>
&gt; (XEN) VIRTUAL MEMORY ARRANGEMENT:<br>
&gt; (XEN) =A0Loaded kernel: ffffffff81000000-&gt;ffffffff81e13000<br>
&gt; (XEN) =A0Init. ramdisk: ffffffff81e13000-&gt;ffffffff84addc00<br>
&gt; (XEN) =A0Phys-Mach map: ffffffff84ade000-&gt;ffffffff869f3d90<br>
&gt; (XEN) =A0Start info: =A0 =A0ffffffff869f4000-&gt;ffffffff869f44b4<br>
&gt; (XEN) =A0Page tables: =A0 ffffffff869f5000-&gt;ffffffff86a2e000<br>
&gt; (XEN) =A0Boot stack: =A0 =A0ffffffff86a2e000-&gt;ffffffff86a2f000<br>
&gt; (XEN) =A0TOTAL: =A0 =A0 =A0 =A0 ffffffff80000000-&gt;ffffffff86c00000<=
br>
&gt; (XEN) =A0ENTRY ADDRESS: ffffffff8188e200<br>
&gt; (XEN) Dom0 has maximum 4 VCPUs<br>
&gt; (XEN) Scrubbing Free RAM: .done.<br>
&gt; (XEN) Xen trace buffers: disabled<br>
&gt; (XEN) Std. Loglevel: Errors and warnings<br>
&gt; (XEN) Guest Loglevel: Nothing (Rate-limited: Errors and warnings)<br>
&gt; (XEN) *** Serial input -&gt; DOM0 (type &#39;CTRL-a&#39; three times t=
o switch input to Xen)<br>
&gt; (XEN) Freed 216kB init memory.<br>
&gt; (XEN) no cpu_id for acpi_id 5<br>
&gt; (XEN) no cpu_id for acpi_id 6<br>
&gt; (XEN) no cpu_id for acpi_id 7<br>
&gt; (XEN) no cpu_id for acpi_id 8<br>
&gt; (XEN) physdev.c:171: dom0: wrong map_pirq type 3<br>
&gt; (XEN) traps.c:2488:d1 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc9000057b030.<br>
&gt; (XEN) traps.c:2488:d1 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc90000718030.<br>
&gt; (XEN) traps.c:2488:d2 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc900004f2030.<br>
&gt; (XEN) traps.c:2488:d2 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc900004fa030.<br>
&gt; (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc90000251030.<br>
&gt; (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc90000263030.<br>
&gt; (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc9000026b030.<br>
&gt; (XEN) traps.c:2488:d3 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc90000273030.<br>
&gt; (XEN) traps.c:2488:d4 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc900004f2030.<br>
&gt; (XEN) traps.c:2488:d4 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc90000015030.<br>
&gt; (XEN) traps.c:2488:d5 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc900004f2030.<br>
&gt; (XEN) traps.c:2488:d5 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc90000015030.<br>
&gt; (XEN) traps.c:2488:d6 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc900004f2030.<br>
&gt; (XEN) traps.c:2488:d6 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc900004fa030.<br>
&gt; (XEN) Disabling non-boot CPUs ...<br>
&gt; (XEN) Broke affinity for irq 1<br>
&gt; (XEN) Broke affinity for irq 8<br>
&gt; (XEN) Broke affinity for irq 9<br>
&gt; (XEN) Broke affinity for irq 12<br>
&gt; (XEN) Broke affinity for irq 17<br>
&gt; (XEN) Broke affinity for irq 31<br>
&gt; (XEN) Broke affinity for irq 16<br>
&gt; (XEN) Broke affinity for irq 20<br>
&gt; (XEN) Entering ACPI S3 state.<br>
&gt; (XEN) mce_intel.c:1162: MCA Capability: BCAST 1 SER 0 CMCI 1 firstbank=
 0 extended MCE MSR 0<br>
&gt; (XEN) CPU0 CMCI LVT vector (0xf7) already installed<br>
&gt; (XEN) CPU0: Thermal LVT vector (0xfa) already installed<br>
&gt; (XEN) Finishing wakeup from ACPI S3 state.<br>
&gt; (XEN) Enabling non-boot CPUs =A0...<br>
&gt; (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc90000524030.<br>
&gt; (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc9000052c030.<br>
&gt; (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc90000015030.<br>
&gt; (XEN) traps.c:2488:d7 Domain attempted WRMSR 0000000000000079 from 0x0=
000000000000000 to 0xffffc9000001d030.<br>
&gt; (XEN) Dumping timer queues:<br>
&gt; (XEN) CPU00:<br>
&gt; (XEN) =A0 ex=3D =A0 =A0 126us timer=3Dffff8300c83b0060 cb=3Dffff82c480=
11e420(ffff8300c83b0000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 =A01778us timer=3Dffff8304222f9de8 cb=3Dffff82c480=
118250(0000000000000000) csched_tick+0x0/0x2e0<br>
&gt; (XEN) =A0 ex=3D =A0 =A0 126us timer=3Dffff8300c81fc060 cb=3Dffff82c480=
11e420(ffff8300c81fc000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 17227us timer=3Dffff82c4802bb980 cb=3Dffff82c48013=
8ff0(ffff82c4802bb940) do_dbs_timer+0x0/0x250<br>
&gt; (XEN) =A0 ex=3D =A0 20744us timer=3Dffff830030094060 cb=3Dffff82c48011=
e420(ffff830030094000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 27945us timer=3Dffff8304222fdde0 cb=3Dffff82c48011=
6f20(ffff8304222fddc0) csched_acct+0x0/0x460<br>
&gt; (XEN) =A0 ex=3D =A0 29949us timer=3Dffff82c4802bb760 cb=3Dffff82c48011=
ded0(0000000000000000) s_timer_fn+0x0/0x20<br>
&gt; (XEN) =A0 ex=3D =A0 87774us timer=3Dffff83008db6a060 cb=3Dffff82c48011=
e420(ffff83008db6a000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 79252us timer=3Dffff82c4802b3880 cb=3Dffff82c48017=
7160(0000000000000000) time_calibration+0x0/0x60<br>
&gt; (XEN) =A0 ex=3D =A0703146us timer=3Dffff8300a6b9c060 cb=3Dffff82c48011=
e420(ffff8300a6b9c000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 35612us timer=3Dffff8300330dc060 cb=3Dffff82c48011=
e420(ffff8300330dc000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 97688us timer=3Dffff8300a6b98060 cb=3Dffff82c48011=
e420(ffff8300a6b98000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 30003us timer=3Dffff8300b129a060 cb=3Dffff82c48011=
e420(ffff8300b129a000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 92679us timer=3Dffff8300c94a6060 cb=3Dffff82c48011=
e420(ffff8300c94a6000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D 4135118us timer=3Dffff8300bdca6060 cb=3Dffff82c48011e4=
20(ffff8300bdca6000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 96411us timer=3Dffff8300b128e060 cb=3Dffff82c48011=
e420(ffff8300b128e000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D 1337866us timer=3Dffff8300a6b94060 cb=3Dffff82c48011e4=
20(ffff8300a6b94000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 91194us timer=3Dffff830034b98060 cb=3Dffff82c48011=
e420(ffff830034b98000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 97955us timer=3Dffff83007d948060 cb=3Dffff82c48011=
e420(ffff83007d948000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D 4135163us timer=3Dffff8300c5336060 cb=3Dffff82c48011e4=
20(ffff8300c5336000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D123464409us timer=3Dffff82c4802b3980 cb=3Dffff82c480176=
ef0(0000000000000000) plt_overflow+0x0/0x190<br>
&gt; (XEN) =A0 ex=3D =A0 95968us timer=3Dffff8300a6b96060 cb=3Dffff82c48011=
e420(ffff8300a6b96000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D12401701us timer=3Dffff82c4802b65a0 cb=3Dffff82c48019eb=
10(0000000000000000) mce_work_fn+0x0/0xd0<br>
&gt; (XEN) =A0 ex=3D =A0 97804us timer=3Dffff8300301a8060 cb=3Dffff82c48011=
e420(ffff8300301a8000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 97841us timer=3Dffff8300bd810060 cb=3Dffff82c48011=
e420(ffff8300bd810000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 98039us timer=3Dffff83007d94c060 cb=3Dffff82c48011=
e420(ffff83007d94c000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0 94727us timer=3Dffff83008db6e060 cb=3Dffff82c48011=
e420(ffff83008db6e000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) =A0 ex=3D =A0319927us timer=3Dffff8300c840c060 cb=3Dffff82c48011=
e420(ffff8300c840c000) vcpu_singleshot_timer_fn+0x0/0x10<br>
&gt; (XEN) CPU01:<br>
&gt; (XEN) CPU02:<br>
&gt; (XEN) CPU03:<br>
&gt; (XEN) &#39;c&#39; pressed -&gt; printing ACPI Cx structures<br>
&gt; (XEN) =3D=3Dcpu0=3D=3D<br>
&gt; (XEN) active state: =A0 =A0 =A0 =A0 =A0 C3<br>
&gt; (XEN) max_cstate: =A0 =A0 =A0 =A0 =A0 =A0 C7<br>
&gt; (XEN) states:<br>
&gt; (XEN) =A0 =A0 C1: type[C1] latency[000] usage[00254665] method[ HALT] =
duration[62720099833]<br>
&gt; (XEN) =A0 =A0 C2: type[C2] latency[080] usage[00069505] method[SYSIO] =
duration[36499255195]<br>
&gt; (XEN) =A0 =A0*C3: type[C3] latency[109] usage[01828952] method[SYSIO] =
duration[5562126933174]<br>
&gt; (XEN) =A0 =A0 C0: usage[02153122] duration[2042526389598]<br>
&gt; (XEN) PC3[0] PC6[0] PC7[0]<br>
&gt; (XEN) CC3[0] CC6[0]<br>
&gt; (XEN) =3D=3Dcpu1=3D=3D<br>
&gt; (XEN) active state: =A0 =A0 =A0 =A0 =A0 C1<br>
&gt; (XEN) max_cstate: =A0 =A0 =A0 =A0 =A0 =A0 C7<br>
&gt; (XEN) states:<br>
&gt; (XEN) =A0 =A0*C1: type[C1] latency[000] usage[00808027] method[ HALT] =
duration[6978799306750]<br>
&gt; (XEN) =A0 =A0 C0: usage[00808027] duration[725073398104]<br>
&gt; (XEN) PC3[0] PC6[0] PC7[0]<br>
&gt; (XEN) CC3[0] CC6[0]<br>
&gt; (XEN) =3D=3Dcpu2=3D=3D<br>
&gt; (XEN) active state: =A0 =A0 =A0 =A0 =A0 C1<br>
&gt; (XEN) max_cstate: =A0 =A0 =A0 =A0 =A0 =A0 C7<br>
&gt; (XEN) states:<br>
&gt; (XEN) =A0 =A0*C1: type[C1] latency[000] usage[00825022] method[ HALT] =
duration[6981527416097]<br>
&gt; (XEN) =A0 =A0 C0: usage[00825022] duration[722345319882]<br>
&gt; (XEN) PC3[0] PC6[0] PC7[0]<br>
&gt; (XEN) CC3[0] CC6[0]<br>
&gt; (XEN) =3D=3Dcpu3=3D=3D<br>
&gt; (XEN) active state: =A0 =A0 =A0 =A0 =A0 C1<br>
&gt; (XEN) max_cstate: =A0 =A0 =A0 =A0 =A0 =A0 C7<br>
&gt; (XEN) states:<br>
&gt; (XEN) =A0 =A0*C1: type[C1] latency[000] usage[00810292] method[ HALT] =
duration[6980835907857]<br>
&gt; (XEN) =A0 =A0 C0: usage[00810292] duration[723036844779]<br>
&gt; (XEN) PC3[0] PC6[0] PC7[0]<br>
&gt; (XEN) CC3[0] CC6[0]<br>
<div class=3D"HOEnZb"><div class=3D"h5"><br>
<br>
<br>
<br>
&gt; _______________________________________________<br>
&gt; Xen-devel mailing list<br>
&gt; <a href=3D"mailto:Xen-devel@lists.xen.org">Xen-devel@lists.xen.org</a>=
<br>
&gt; <a href=3D"http://lists.xen.org/xen-devel" target=3D"_blank">http://li=
sts.xen.org/xen-devel</a><br>
<br>
</div></div></blockquote></div><br></div>

--e89a8f3b9d3d4a9abe04cfbdb242--


--===============3744638461939860863==
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.xen.org
http://lists.xen.org/xen-devel

--===============3744638461939860863==--


From xen-devel-bounces@lists.xen.org Fri Nov 30 22:13:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 22:13:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeYps-00016I-Tl; Fri, 30 Nov 2012 22:13:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jfehlig@suse.com>) id 1TeYpr-000166-B0
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 22:13:27 +0000
Received: from [193.109.254.147:18685] by server-14.bemta-14.messagelabs.com
	id F4/82-14517-68F29B05; Fri, 30 Nov 2012 22:13:26 +0000
X-Env-Sender: jfehlig@suse.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1354313602!8938673!1
X-Originating-IP: [137.65.248.124]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18099 invoked from network); 30 Nov 2012 22:13:23 -0000
Received: from inet-orm.provo.novell.com (HELO mail.novell.com)
	(137.65.248.124) by server-9.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 22:13:23 -0000
Received: from jfehlig1.provo.novell.com ([137.65.135.33])
	by mail.novell.com with ESMTP; Fri, 30 Nov 2012 15:13:19 -0700
From: Jim Fehlig <jfehlig@suse.com>
To: libvir-list@redhat.com
Date: Fri, 30 Nov 2012 15:13:13 -0700
Message-Id: <1354313593-13358-1-git-send-email-jfehlig@suse.com>
X-Mailer: git-send-email 1.7.10.4
Cc: xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] Convert libxl driver to Xen 4.2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Based on a patch originally authored by Daniel De Graaf

  http://lists.xen.org/archives/html/xen-devel/2012-05/msg00565.html

This patch converts the Xen libxl driver to support only Xen >= 4.2.
Support for Xen 4.1 libxl is dropped since that version of libxl is
designated 'technology preview' only and is incompatible with Xen 4.2
libxl.  Additionally, the default toolstack in Xen 4.1 is still xend,
for which libvirt has a stable, functional driver.
---
V2:
  Remove 128 vcpu limit.
  Remove split_string_into_string_list() function copied from xen
  sources since libvirt now has virStringSplit().

 configure.ac             |    8 +-
 docs/drvxen.html.in      |    8 +
 libvirt.spec.in          |    4 +-
 src/libxl/libxl_conf.c   |  321 +++++++++---------------------
 src/libxl/libxl_conf.h   |   16 +-
 src/libxl/libxl_driver.c |  488 +++++++++++++++++++++++++++-------------------
 6 files changed, 404 insertions(+), 441 deletions(-)

diff --git a/configure.ac b/configure.ac
index c888eb8..a695e52 100644
--- a/configure.ac
+++ b/configure.ac
@@ -718,16 +718,14 @@ if test "$with_libxl" != "no" ; then
     fi
     CFLAGS="$CFLAGS $LIBXL_CFLAGS"
     LIBS="$LIBS $LIBXL_LIBS"
-    AC_CHECK_LIB([xenlight], [libxl_domain_create_new], [
+    AC_CHECK_LIB([xenlight], [libxl_ctx_alloc], [
         with_libxl=yes
-        LIBXL_LIBS="$LIBXL_LIBS -lxenlight -lxenstore -lxenctrl -lxenguest -luuid -lutil -lblktapctl"
+        LIBXL_LIBS="$LIBXL_LIBS -lxenlight"
     ],[
         if test "$with_libxl" = "yes"; then
             fail=1
         fi
         with_libxl=no
-    ],[
-        -lxenstore -lxenctrl -lxenguest -luuid -lutil -lblktapctl
     ])
 fi
 
@@ -735,7 +733,7 @@ LIBS="$old_LIBS"
 CFLAGS="$old_CFLAGS"
 
 if test $fail = 1; then
-    AC_MSG_ERROR([You must install the libxl Library to compile libxenlight driver with -lxl])
+    AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.2 to compile libxenlight driver with -lxl])
 fi
 
 if test "$with_libxl" = "yes"; then
diff --git a/docs/drvxen.html.in b/docs/drvxen.html.in
index 0bca935..06bd911 100644
--- a/docs/drvxen.html.in
+++ b/docs/drvxen.html.in
@@ -53,6 +53,14 @@
         the <code>/etc/xen</code> directory. It is important not to place
         any other non-config files in this directory.
       </li>
+      <li>
+        <strong>libxl</strong>: Starting with Xen 4.2, the legacy XenD/xm
+        toolstack is deprecated in favor of libxl, also commonly called
+        libxenlight.  libvirt supports this new Xen toolstack via the
+        libxl driver.  If XenD is enabled, the legacy xen driver consisting
+        of the above mentioned channels will be used.  If XenD is disabled,
+        the libxl driver will be used.
+      </li>
     </ul>
 
     <h2><a name="uri">Connections to Xen driver</a></h2>
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 5b3f4e4..47cb087 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -189,8 +189,8 @@
 %endif
 %endif
 
-# Fedora doesn't have new enough Xen for libxl until F16
-%if 0%{?fedora} && 0%{?fedora} < 16
+# Fedora doesn't have new enough Xen for libxl until F18
+%if 0%{?fedora} && 0%{?fedora} < 18
 %define with_libxl 0
 %endif
 
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 1c3130b..b8b9ddb 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -36,11 +36,13 @@
 #include "virterror_internal.h"
 #include "datatypes.h"
 #include "virfile.h"
+#include "virstring.h"
 #include "memory.h"
 #include "uuid.h"
 #include "capabilities.h"
 #include "libxl_driver.h"
 #include "libxl_conf.h"
+#include "libxl_utils.h"
 #include "storage_file.h"
 
 
@@ -62,7 +64,6 @@ struct guest_arch {
 static const char *xen_cap_re = "(xen|hvm)-[[:digit:]]+\\.[[:digit:]]+-(x86_32|x86_64|ia64|powerpc64)(p|be)?";
 static regex_t xen_cap_rec;
 
-
 static int
 libxlNextFreeVncPort(libxlDriverPrivatePtr driver, int startPort)
 {
@@ -360,18 +361,36 @@ libxlMakeCapabilitiesInternal(const char *hostmachine,
 }
 
 static int
-libxlMakeDomCreateInfo(virDomainDefPtr def, libxl_domain_create_info *c_info)
+libxlMakeDomCreateInfo(libxlDriverPrivatePtr driver,
+                       virDomainDefPtr def,
+                       libxl_domain_create_info *c_info)
 {
     char uuidstr[VIR_UUID_STRING_BUFLEN];
 
-    libxl_init_create_info(c_info);
+    libxl_domain_create_info_init(c_info);
+
+    if (STREQ(def->os.type, "hvm"))
+        c_info->type = LIBXL_DOMAIN_TYPE_HVM;
+    else
+        c_info->type = LIBXL_DOMAIN_TYPE_PV;
 
-    c_info->hvm = STREQ(def->os.type, "hvm");
     if ((c_info->name = strdup(def->name)) == NULL) {
         virReportOOMError();
         goto error;
     }
 
+    if (def->nseclabels &&
+        def->seclabels[0]->type == VIR_DOMAIN_SECLABEL_STATIC) {
+        if (libxl_flask_context_to_sid(driver->ctx,
+                                       def->seclabels[0]->label,
+                                       strlen(def->seclabels[0]->label),
+                                       &c_info->ssidref)) {
+            virReportError(VIR_ERR_INTERNAL_ERROR,
+                           _("libxenlight failed to resolve security label '%s'"),
+                           def->seclabels[0]->label);
+        }
+    }
+
     virUUIDFormat(def->uuid, uuidstr);
     if (libxl_uuid_from_string(&c_info->uuid, uuidstr)) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -382,7 +401,7 @@ libxlMakeDomCreateInfo(virDomainDefPtr def, libxl_domain_create_info *c_info)
     return 0;
 
 error:
-    libxl_domain_create_info_destroy(c_info);
+    libxl_domain_create_info_dispose(c_info);
     return -1;
 }
 
@@ -393,26 +412,14 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
     int hvm = STREQ(def->os.type, "hvm");
     int i;
 
-    /* Currently, libxenlight only supports 32 vcpus per domain.
-     * cur_vcpus member of struct libxl_domain_build_info is defined
-     * as an int, but its semantic is a bitmap of online vcpus, so
-     * only 32 can be represented.
-     */
-    if (def->maxvcpus > 32 || def->vcpus > 32) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("This version of libxenlight only supports 32 "
-                         "vcpus per domain"));
-        return -1;
-    }
+    libxl_domain_build_info_init(b_info);
 
-    libxl_init_build_info(b_info, &d_config->c_info);
-
-    b_info->hvm = hvm;
-    b_info->max_vcpus = def->maxvcpus;
-    if (def->vcpus == 32)
-        b_info->cur_vcpus = (uint32_t) -1;
+    if (hvm)
+        libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_HVM);
     else
-        b_info->cur_vcpus = (1 << def->vcpus) - 1;
+        libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_PV);
+    b_info->max_vcpus = def->maxvcpus;
+    libxl_bitmap_set((&b_info->avail_vcpus), def->vcpus);
     if (def->clock.ntimers > 0 &&
         def->clock.timers[0]->name == VIR_DOMAIN_TIMER_NAME_TSC) {
         switch (def->clock.timers[0]->mode) {
@@ -426,16 +433,20 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
                 b_info->tsc_mode = 1;
         }
     }
+    b_info->sched_params.weight = 1000;
     b_info->max_memkb = def->mem.max_balloon;
     b_info->target_memkb = def->mem.cur_balloon;
     if (hvm) {
-        b_info->u.hvm.pae = def->features & (1 << VIR_DOMAIN_FEATURE_PAE);
-        b_info->u.hvm.apic = def->features & (1 << VIR_DOMAIN_FEATURE_APIC);
-        b_info->u.hvm.acpi = def->features & (1 << VIR_DOMAIN_FEATURE_ACPI);
+        libxl_defbool_set(&b_info->u.hvm.pae,
+                          def->features & (1 << VIR_DOMAIN_FEATURE_PAE));
+        libxl_defbool_set(&b_info->u.hvm.apic,
+                          def->features & (1 << VIR_DOMAIN_FEATURE_APIC));
+        libxl_defbool_set(&b_info->u.hvm.acpi,
+                          def->features & (1 << VIR_DOMAIN_FEATURE_ACPI));
         for (i = 0; i < def->clock.ntimers; i++) {
             if (def->clock.timers[i]->name == VIR_DOMAIN_TIMER_NAME_HPET &&
                 def->clock.timers[i]->present == 1) {
-                b_info->u.hvm.hpet = 1;
+                libxl_defbool_set(&b_info->u.hvm.hpet, 1);
             }
         }
 
@@ -446,7 +457,7 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
          * 256 pages (1MB) per vcpu, plus 1 page per MiB of RAM for the P2M map,
          * plus 1 page per MiB of RAM to shadow the resident processes.
          */
-        b_info->shadow_memkb = 4 * (256 * b_info->cur_vcpus +
+        b_info->shadow_memkb = 4 * (256 * libxl_bitmap_count_set(&b_info->avail_vcpus) +
                                     2 * (b_info->max_memkb / 1024));
     } else {
         if (def->os.bootloader) {
@@ -456,10 +467,9 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
             }
         }
         if (def->os.bootloaderArgs) {
-            if ((b_info->u.pv.bootloader_args = strdup(def->os.bootloaderArgs)) == NULL) {
-                virReportOOMError();
+            if (!(b_info->u.pv.bootloader_args =
+                  virStringSplit(def->os.bootloaderArgs, " \t\n", 0)))
                 goto error;
-            }
         }
         if (def->os.cmdline) {
             if ((b_info->u.pv.cmdline = strdup(def->os.cmdline)) == NULL) {
@@ -469,14 +479,14 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
         }
         if (def->os.kernel) {
             /* libxl_init_build_info() sets kernel.path = strdup("hvmloader") */
-            VIR_FREE(b_info->kernel.path);
-            if ((b_info->kernel.path = strdup(def->os.kernel)) == NULL) {
+            VIR_FREE(b_info->u.pv.kernel);
+            if ((b_info->u.pv.kernel = strdup(def->os.kernel)) == NULL) {
                 virReportOOMError();
                 goto error;
             }
         }
         if (def->os.initrd) {
-            if ((b_info->u.pv.ramdisk.path = strdup(def->os.initrd)) == NULL) {
+            if ((b_info->u.pv.ramdisk = strdup(def->os.initrd)) == NULL) {
                 virReportOOMError();
                 goto error;
             }
@@ -486,13 +496,12 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
     return 0;
 
 error:
-    libxl_domain_build_info_destroy(b_info);
+    libxl_domain_build_info_dispose(b_info);
     return -1;
 }
 
 int
-libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
-              libxl_device_disk *x_disk)
+libxlMakeDisk(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk)
 {
     if (l_disk->src && (x_disk->pdev_path = strdup(l_disk->src)) == NULL) {
         virReportOOMError();
@@ -509,22 +518,22 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
             STREQ(l_disk->driverName, "tap2")) {
             switch (l_disk->format) {
             case VIR_STORAGE_FILE_QCOW:
-                x_disk->format = DISK_FORMAT_QCOW;
-                x_disk->backend = DISK_BACKEND_QDISK;
+                x_disk->format = LIBXL_DISK_FORMAT_QCOW;
+                x_disk->backend = LIBXL_DISK_BACKEND_QDISK;
                 break;
             case VIR_STORAGE_FILE_QCOW2:
-                x_disk->format = DISK_FORMAT_QCOW2;
-                x_disk->backend = DISK_BACKEND_QDISK;
+                x_disk->format = LIBXL_DISK_FORMAT_QCOW2;
+                x_disk->backend = LIBXL_DISK_BACKEND_QDISK;
                 break;
             case VIR_STORAGE_FILE_VHD:
-                x_disk->format = DISK_FORMAT_VHD;
-                x_disk->backend = DISK_BACKEND_TAP;
+                x_disk->format = LIBXL_DISK_FORMAT_VHD;
+                x_disk->backend = LIBXL_DISK_BACKEND_TAP;
                 break;
             case VIR_STORAGE_FILE_NONE:
                 /* No subtype specified, default to raw/tap */
             case VIR_STORAGE_FILE_RAW:
-                x_disk->format = DISK_FORMAT_RAW;
-                x_disk->backend = DISK_BACKEND_TAP;
+                x_disk->format = LIBXL_DISK_FORMAT_RAW;
+                x_disk->backend = LIBXL_DISK_BACKEND_TAP;
                 break;
             default:
                 virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -533,11 +542,11 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
                 return -1;
             }
         } else if (STREQ(l_disk->driverName, "file")) {
-            x_disk->format = DISK_FORMAT_RAW;
-            x_disk->backend = DISK_BACKEND_TAP;
+            x_disk->format = LIBXL_DISK_FORMAT_RAW;
+            x_disk->backend = LIBXL_DISK_BACKEND_TAP;
         } else if (STREQ(l_disk->driverName, "phy")) {
-            x_disk->format = DISK_FORMAT_RAW;
-            x_disk->backend = DISK_BACKEND_PHY;
+            x_disk->format = LIBXL_DISK_FORMAT_RAW;
+            x_disk->backend = LIBXL_DISK_BACKEND_PHY;
         } else {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("libxenlight does not support disk driver %s"),
@@ -546,12 +555,12 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
         }
     } else {
         /* No driverName - default to raw/tap?? */
-        x_disk->format = DISK_FORMAT_RAW;
-        x_disk->backend = DISK_BACKEND_TAP;
+        x_disk->format = LIBXL_DISK_FORMAT_RAW;
+        x_disk->backend = LIBXL_DISK_BACKEND_TAP;
     }
 
-    /* How to set unpluggable? */
-    x_disk->unpluggable = 1;
+    /* XXX is this right? */
+    x_disk->removable = 1;
     x_disk->readwrite = !l_disk->readonly;
     x_disk->is_cdrom = l_disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM ? 1 : 0;
     if (l_disk->transient) {
@@ -560,8 +569,6 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
         return -1;
     }
 
-    x_disk->domid = def->id;
-
     return 0;
 }
 
@@ -579,7 +586,7 @@ libxlMakeDiskList(virDomainDefPtr def, libxl_domain_config *d_config)
     }
 
     for (i = 0; i < ndisks; i++) {
-        if (libxlMakeDisk(def, l_disks[i], &x_disks[i]) < 0)
+        if (libxlMakeDisk(l_disks[i], &x_disks[i]) < 0)
             goto error;
     }
 
@@ -590,19 +597,19 @@ libxlMakeDiskList(virDomainDefPtr def, libxl_domain_config *d_config)
 
 error:
     for (i = 0; i < ndisks; i++)
-        libxl_device_disk_destroy(&x_disks[i]);
+        libxl_device_disk_dispose(&x_disks[i]);
     VIR_FREE(x_disks);
     return -1;
 }
 
 int
-libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
-             libxl_device_nic *x_nic)
+libxlMakeNic(virDomainNetDefPtr l_nic, libxl_device_nic *x_nic)
 {
-    // TODO: Where is mtu stored?
-    //x_nics[i].mtu = 1492;
+    /* TODO: Where is mtu stored?
+     *
+     * x_nics[i].mtu = 1492;
+     */
 
-    x_nic->domid = def->id;
     virMacAddrGetRaw(&l_nic->mac, x_nic->mac);
 
     if (l_nic->model && !STREQ(l_nic->model, "netfront")) {
@@ -610,9 +617,9 @@ libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
             virReportOOMError();
             return -1;
         }
-        x_nic->nictype = NICTYPE_IOEMU;
+        x_nic->nictype = LIBXL_NIC_TYPE_VIF_IOEMU;
     } else {
-        x_nic->nictype = NICTYPE_VIF;
+        x_nic->nictype = LIBXL_NIC_TYPE_VIF;
     }
 
     if (l_nic->ifname && (x_nic->ifname = strdup(l_nic->ifname)) == NULL) {
@@ -659,48 +666,49 @@ libxlMakeNicList(virDomainDefPtr def,  libxl_domain_config *d_config)
     for (i = 0; i < nnics; i++) {
         x_nics[i].devid = i;
 
-        if (libxlMakeNic(def, l_nics[i], &x_nics[i]))
+        if (libxlMakeNic(l_nics[i], &x_nics[i]))
             goto error;
     }
 
-    d_config->vifs = x_nics;
-    d_config->num_vifs = nnics;
+    d_config->nics = x_nics;
+    d_config->num_nics = nnics;
 
     return 0;
 
 error:
     for (i = 0; i < nnics; i++)
-        libxl_device_nic_destroy(&x_nics[i]);
+        libxl_device_nic_dispose(&x_nics[i]);
     VIR_FREE(x_nics);
     return -1;
 }
 
 int
-libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
-             virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb)
+libxlMakeVfb(libxlDriverPrivatePtr driver,
+             virDomainGraphicsDefPtr l_vfb,
+             libxl_device_vfb *x_vfb)
 {
     int port;
     const char *listenAddr;
 
     switch (l_vfb->type) {
         case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
-            x_vfb->sdl = 1;
+            libxl_defbool_set(&x_vfb->sdl.enable, 1);
             if (l_vfb->data.sdl.display &&
-                (x_vfb->display = strdup(l_vfb->data.sdl.display)) == NULL) {
+                (x_vfb->sdl.display = strdup(l_vfb->data.sdl.display)) == NULL) {
                 virReportOOMError();
                 return -1;
             }
             if (l_vfb->data.sdl.xauth &&
-                (x_vfb->xauthority =
+                (x_vfb->sdl.xauthority =
                     strdup(l_vfb->data.sdl.xauth)) == NULL) {
                 virReportOOMError();
                 return -1;
             }
             break;
         case  VIR_DOMAIN_GRAPHICS_TYPE_VNC:
-            x_vfb->vnc = 1;
+            libxl_defbool_set(&x_vfb->vnc.enable, 1);
             /* driver handles selection of free port */
-            x_vfb->vncunused = 0;
+            libxl_defbool_set(&x_vfb->vnc.findunused, 0);
             if (l_vfb->data.vnc.autoport) {
                 port = libxlNextFreeVncPort(driver, LIBXL_VNC_PORT_MIN);
                 if (port < 0) {
@@ -710,13 +718,13 @@ libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
                 }
                 l_vfb->data.vnc.port = port;
             }
-            x_vfb->vncdisplay = l_vfb->data.vnc.port - LIBXL_VNC_PORT_MIN;
+            x_vfb->vnc.display = l_vfb->data.vnc.port - LIBXL_VNC_PORT_MIN;
 
             listenAddr = virDomainGraphicsListenGetAddress(l_vfb, 0);
             if (listenAddr) {
                 /* libxl_device_vfb_init() does strdup("127.0.0.1") */
-                VIR_FREE(x_vfb->vnclisten);
-                if ((x_vfb->vnclisten = strdup(listenAddr)) == NULL) {
+                VIR_FREE(x_vfb->vnc.listen);
+                if ((x_vfb->vnc.listen = strdup(listenAddr)) == NULL) {
                     virReportOOMError();
                     return -1;
                 }
@@ -729,13 +737,14 @@ libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
             }
             break;
     }
-    x_vfb->domid = def->id;
+
     return 0;
 }
 
 static int
 libxlMakeVfbList(libxlDriverPrivatePtr driver,
-                 virDomainDefPtr def, libxl_domain_config *d_config)
+                 virDomainDefPtr def,
+                 libxl_domain_config *d_config)
 {
     virDomainGraphicsDefPtr *l_vfbs = def->graphics;
     int nvfbs = def->ngraphics;
@@ -757,10 +766,10 @@ libxlMakeVfbList(libxlDriverPrivatePtr driver,
     }
 
     for (i = 0; i < nvfbs; i++) {
-        libxl_device_vfb_init(&x_vfbs[i], i);
-        libxl_device_vkb_init(&x_vkbs[i], i);
+        libxl_device_vfb_init(&x_vfbs[i]);
+        libxl_device_vkb_init(&x_vkbs[i]);
 
-        if (libxlMakeVfb(driver, def, l_vfbs[i], &x_vfbs[i]) < 0)
+        if (libxlMakeVfb(driver, l_vfbs[i], &x_vfbs[i]) < 0)
             goto error;
     }
 
@@ -772,148 +781,14 @@ libxlMakeVfbList(libxlDriverPrivatePtr driver,
 
 error:
     for (i = 0; i < nvfbs; i++) {
-        libxl_device_vfb_destroy(&x_vfbs[i]);
-        libxl_device_vkb_destroy(&x_vkbs[i]);
+        libxl_device_vfb_dispose(&x_vfbs[i]);
+        libxl_device_vkb_dispose(&x_vkbs[i]);
     }
     VIR_FREE(x_vfbs);
     VIR_FREE(x_vkbs);
     return -1;
 }
 
-static int
-libxlMakeChrdevStr(virDomainChrDefPtr def, char **buf)
-{
-    const char *type = virDomainChrTypeToString(def->source.type);
-
-    if (!type) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       "%s", _("unexpected chr device type"));
-        return -1;
-    }
-
-    switch (def->source.type) {
-        case VIR_DOMAIN_CHR_TYPE_NULL:
-        case VIR_DOMAIN_CHR_TYPE_STDIO:
-        case VIR_DOMAIN_CHR_TYPE_VC:
-        case VIR_DOMAIN_CHR_TYPE_PTY:
-            if (virAsprintf(buf, "%s", type) < 0) {
-                virReportOOMError();
-                return -1;
-            }
-            break;
-
-        case VIR_DOMAIN_CHR_TYPE_FILE:
-        case VIR_DOMAIN_CHR_TYPE_PIPE:
-            if (virAsprintf(buf, "%s:%s", type,
-                            def->source.data.file.path) < 0) {
-                virReportOOMError();
-                return -1;
-            }
-            break;
-
-        case VIR_DOMAIN_CHR_TYPE_DEV:
-            if (virAsprintf(buf, "%s", def->source.data.file.path) < 0) {
-                virReportOOMError();
-                return -1;
-            }
-            break;
-    }
-
-    return 0;
-}
-
-static int
-libxlMakeDeviceModelInfo(virDomainDefPtr def, libxl_domain_config *d_config)
-{
-    libxl_device_model_info *dm_info = &d_config->dm_info;
-    int i;
-    char b_order[VIR_DOMAIN_BOOT_LAST+1];
-
-    libxl_init_dm_info(dm_info, &d_config->c_info, &d_config->b_info);
-
-    if (d_config->b_info.hvm) {
-        /* HVM-specific device model info */
-        dm_info->type = XENFV;
-        if (def->os.nBootDevs > 0) {
-            VIR_FREE(dm_info->boot);
-            for (i = 0; i < def->os.nBootDevs; i++) {
-                switch (def->os.bootDevs[i]) {
-                    case VIR_DOMAIN_BOOT_FLOPPY:
-                        b_order[i] = 'a';
-                        break;
-                    default:
-                    case VIR_DOMAIN_BOOT_DISK:
-                        b_order[i] = 'c';
-                        break;
-                    case VIR_DOMAIN_BOOT_CDROM:
-                        b_order[i] = 'd';
-                        break;
-                    case VIR_DOMAIN_BOOT_NET:
-                        b_order[i] = 'n';
-                        break;
-                }
-            }
-            b_order[def->os.nBootDevs] = '\0';
-            if ((dm_info->boot = strdup(b_order)) == NULL) {
-                virReportOOMError();
-                goto error;
-            }
-        }
-        if (def->serials &&
-            (libxlMakeChrdevStr(def->serials[0], &dm_info->serial) < 0))
-            goto error;
-    } else {
-        /* PV-specific device model info */
-        dm_info->type = XENPV;
-    }
-
-    /* Build qemu graphics options from previously parsed vfb */
-    if (d_config->num_vfbs > 0) {
-        if (d_config->vfbs[0].vnc) {
-            dm_info->vnc = 1;
-            /* driver handles selection of free port */
-            dm_info->vncunused = 0;
-            if (d_config->vfbs[0].vnclisten) {
-                VIR_FREE(dm_info->vnclisten);
-                if ((dm_info->vnclisten =
-                     strdup(d_config->vfbs[0].vnclisten)) == NULL) {
-                    virReportOOMError();
-                    goto error;
-                }
-            }
-            if (d_config->vfbs[0].keymap &&
-                (dm_info->keymap = strdup(d_config->vfbs[0].keymap)) == NULL) {
-                virReportOOMError();
-                goto error;
-            }
-            dm_info->vncdisplay = d_config->vfbs[0].vncdisplay;
-            if (d_config->vfbs[0].vncpasswd &&
-                (dm_info->vncpasswd =
-                 strdup(d_config->vfbs[0].vncpasswd)) == NULL) {
-                virReportOOMError();
-                goto error;
-            }
-        } else if (d_config->vfbs[0].sdl) {
-            dm_info->sdl = 1;
-            dm_info->vnc = 0;
-        }
-    } else if (d_config->num_vfbs == 0) {
-        dm_info->nographic = 1;
-        dm_info->vnc = 0;
-    }
-
-    // TODO
-    //dm_info->usb = ;
-    //dm_info->usbdevice = ;
-    //dm_info->soundhw = ;
-
-    return 0;
-
-error:
-    libxl_device_model_info_destroy(dm_info);
-    return -1;
-}
-
 virCapsPtr
 libxlMakeCapabilities(libxl_ctx *ctx)
 {
@@ -947,7 +822,7 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
                        virDomainDefPtr def, libxl_domain_config *d_config)
 {
 
-    if (libxlMakeDomCreateInfo(def, &d_config->c_info) < 0)
+    if (libxlMakeDomCreateInfo(driver, def, &d_config->c_info) < 0)
         return -1;
 
     if (libxlMakeDomBuildInfo(def, d_config) < 0) {
@@ -966,10 +841,6 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
         goto error;
     }
 
-    if (libxlMakeDeviceModelInfo(def, d_config) < 0) {
-        goto error;
-    }
-
     d_config->on_reboot = def->onReboot;
     d_config->on_poweroff = def->onPoweroff;
     d_config->on_crash = def->onCrash;
@@ -977,6 +848,6 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
     return 0;
 
 error:
-    libxl_domain_config_destroy(d_config);
+    libxl_domain_config_dispose(d_config);
     return -1;
 }
diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
index 56bf85c..8b5a9e9 100644
--- a/src/libxl/libxl_conf.h
+++ b/src/libxl/libxl_conf.h
@@ -58,7 +58,7 @@ struct _libxlDriverPrivate {
     FILE *logger_file;
     xentoollog_logger *logger;
     /* libxl ctx for driver wide ops; getVersion, getNodeInfo, ... */
-    libxl_ctx ctx;
+    libxl_ctx *ctx;
 
     virBitmapPtr reservedVNCPorts;
     virDomainObjList domains;
@@ -77,10 +77,8 @@ typedef struct _libxlDomainObjPrivate libxlDomainObjPrivate;
 typedef libxlDomainObjPrivate *libxlDomainObjPrivatePtr;
 struct _libxlDomainObjPrivate {
     /* per domain libxl ctx */
-    libxl_ctx ctx;
-    libxl_waiter *dWaiter;
-    int waiterFD;
-    int eventHdl;
+    libxl_ctx *ctx;
+    libxl_evgen_domain_death *deathW;
 };
 
 # define LIBXL_SAVE_MAGIC "libvirt-xml\n \0 \r"
@@ -100,13 +98,11 @@ virCapsPtr
 libxlMakeCapabilities(libxl_ctx *ctx);
 
 int
-libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_dev,
-              libxl_device_disk *x_dev);
+libxlMakeDisk(virDomainDiskDefPtr l_dev, libxl_device_disk *x_dev);
 int
-libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
-             libxl_device_nic *x_nic);
+libxlMakeNic(virDomainNetDefPtr l_nic, libxl_device_nic *x_nic);
 int
-libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
+libxlMakeVfb(libxlDriverPrivatePtr driver,
              virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb);
 
 int
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index ae4451a..44d0781 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -40,6 +40,7 @@
 #include "memory.h"
 #include "uuid.h"
 #include "command.h"
+#include "libxl.h"
 #include "libxl_driver.h"
 #include "libxl_conf.h"
 #include "xen_xm.h"
@@ -59,6 +60,19 @@
 /* Number of Xen scheduler parameters */
 #define XEN_SCHED_CREDIT_NPARAM   2
 
+struct libxlOSEventHookFDInfo {
+    libxlDomainObjPrivatePtr priv;
+    void *xl_priv;
+    int watch;
+};
+
+struct libxlOSEventHookTimerInfo {
+    libxlDomainObjPrivatePtr priv;
+    void *xl_priv;
+    int id;
+};
+
+
 static void libxlDomainManagedSaveLoad(void *payload,
                                        const void *n ATTRIBUTE_UNUSED,
                                        void *opaque);
@@ -84,6 +98,163 @@ libxlDriverUnlock(libxlDriverPrivatePtr driver)
     virMutexUnlock(&driver->lock);
 }
 
+
+static void libxlFDEventCallback(int watch ATTRIBUTE_UNUSED,
+                                 int fd,
+                                 int vir_events,
+                                 void *fdinfo)
+{
+    struct libxlOSEventHookFDInfo *info = fdinfo;
+    int events = 0;
+
+    if (vir_events & VIR_EVENT_HANDLE_READABLE)
+        events |= POLLIN;
+    if (vir_events & VIR_EVENT_HANDLE_WRITABLE)
+        events |= POLLOUT;
+    if (vir_events & VIR_EVENT_HANDLE_ERROR)
+        events |= POLLERR;
+    if (vir_events & VIR_EVENT_HANDLE_HANGUP)
+        events |= POLLHUP;
+
+    libxl_osevent_occurred_fd(info->priv->ctx, info->xl_priv, fd, 0, events);
+}
+
+static void libxlFreeFDInfo(void *obj)
+{
+    VIR_FREE(obj);
+}
+
+static int libxlFDRegisterEventHook(void *priv, int fd, void **hndp,
+                                    short events, void *xl_priv)
+{
+    int vir_events = VIR_EVENT_HANDLE_ERROR;
+    struct libxlOSEventHookFDInfo *fdinfo;
+
+    if (VIR_ALLOC(fdinfo) < 0) {
+        virReportOOMError();
+        return -1;
+    }
+
+    fdinfo->priv = priv;
+    fdinfo->xl_priv = xl_priv;
+    *hndp = fdinfo;
+
+    if (events & POLLIN)
+        vir_events |= VIR_EVENT_HANDLE_READABLE;
+    if (events & POLLOUT)
+        vir_events |= VIR_EVENT_HANDLE_WRITABLE;
+    fdinfo->watch = virEventAddHandle(fd, vir_events, libxlFDEventCallback,
+                                      fdinfo, libxlFreeFDInfo);
+    if (fdinfo->watch < 0) {
+        VIR_FREE(fdinfo);
+        return fdinfo->watch;
+    }
+
+    return 0;
+}
+
+static int libxlFDModifyEventHook(void *priv ATTRIBUTE_UNUSED,
+                                  int fd ATTRIBUTE_UNUSED,
+                                  void **hndp,
+                                  short events)
+{
+    struct libxlOSEventHookFDInfo *fdinfo = *hndp;
+    int vir_events = VIR_EVENT_HANDLE_ERROR;
+
+    if (events & POLLIN)
+        vir_events |= VIR_EVENT_HANDLE_READABLE;
+    if (events & POLLOUT)
+        vir_events |= VIR_EVENT_HANDLE_WRITABLE;
+
+    virEventUpdateHandle(fdinfo->watch, vir_events);
+    return 0;
+}
+
+static void libxlFDDeregisterEventHook(void *priv ATTRIBUTE_UNUSED,
+                                       int fd ATTRIBUTE_UNUSED,
+                                       void *hnd)
+{
+    struct libxlOSEventHookFDInfo *fdinfo = hnd;
+
+    virEventRemoveHandle(fdinfo->watch);
+}
+
+
+static void libxlTimerCallback(int timer ATTRIBUTE_UNUSED, void *timer_v)
+{
+    struct libxlOSEventHookTimerInfo *timer_info = timer_v;
+
+    libxl_osevent_occurred_timeout(timer_info->priv->ctx, timer_info->xl_priv);
+}
+
+static void libxlTimerInfoFree(void* obj)
+{
+    VIR_FREE(obj);
+}
+
+static int libxlTimeoutRegisterEventHook(void *priv,
+                                         void **hndp,
+                                         struct timeval abs_t,
+                                         void *for_libxl)
+{
+    struct timeval now;
+    struct libxlOSEventHookTimerInfo *timer_info;
+    int timeout, timer_id;
+
+    if (VIR_ALLOC(timer_info) < 0) {
+        virReportOOMError();
+        return -1;
+    }
+
+    gettimeofday(&now, NULL);
+    timeout = (abs_t.tv_usec - now.tv_usec) / 1000;
+    timeout += (abs_t.tv_sec - now.tv_sec) * 1000;
+    timer_id = virEventAddTimeout(timeout, libxlTimerCallback,
+                                  timer_info, libxlTimerInfoFree);
+    if (timer_id < 0) {
+        VIR_FREE(timer_info);
+        return timer_id;
+    }
+
+    timer_info->priv = priv;
+    timer_info->xl_priv = for_libxl;
+    timer_info->id = timer_id;
+    *hndp = timer_info;
+    return 0;
+}
+
+static int libxlTimeoutModifyEventHook(void *priv ATTRIBUTE_UNUSED,
+                                       void **hndp,
+                                       struct timeval abs_t)
+{
+    struct timeval now;
+    int timeout;
+    struct libxlOSEventHookTimerInfo *timer_info = *hndp;
+
+    gettimeofday(&now, NULL);
+    timeout = (abs_t.tv_usec - now.tv_usec) / 1000;
+    timeout += (abs_t.tv_sec - now.tv_sec) * 1000;
+    virEventUpdateTimeout(timer_info->id, timeout);
+    return 0;
+}
+
+static void libxlTimeoutDeregisterEventHook(void *priv ATTRIBUTE_UNUSED,
+                                            void *hnd)
+{
+    struct libxlOSEventHookTimerInfo *timer_info = hnd;
+
+    virEventRemoveTimeout(timer_info->id);
+}
+
+static const libxl_osevent_hooks libxl_event_callbacks = {
+    .fd_register = libxlFDRegisterEventHook,
+    .fd_modify = libxlFDModifyEventHook,
+    .fd_deregister = libxlFDDeregisterEventHook,
+    .timeout_register = libxlTimeoutRegisterEventHook,
+    .timeout_modify = libxlTimeoutModifyEventHook,
+    .timeout_deregister = libxlTimeoutDeregisterEventHook,
+};
+
 static void *
 libxlDomainObjPrivateAlloc(void)
 {
@@ -92,9 +263,9 @@ libxlDomainObjPrivateAlloc(void)
     if (VIR_ALLOC(priv) < 0)
         return NULL;
 
-    libxl_ctx_init(&priv->ctx, LIBXL_VERSION, libxl_driver->logger);
-    priv->waiterFD = -1;
-    priv->eventHdl = -1;
+    libxl_ctx_alloc(&priv->ctx, LIBXL_VERSION, 0, libxl_driver->logger);
+    priv->deathW = NULL;
+    libxl_osevent_register_hooks(priv->ctx, &libxl_event_callbacks, priv);
 
     return priv;
 }
@@ -104,16 +275,12 @@ libxlDomainObjPrivateFree(void *data)
 {
     libxlDomainObjPrivatePtr priv = data;
 
-    if (priv->eventHdl >= 0)
-        virEventRemoveHandle(priv->eventHdl);
-
-    if (priv->dWaiter) {
-        libxl_stop_waiting(&priv->ctx, priv->dWaiter);
-        libxl_free_waiter(priv->dWaiter);
-        VIR_FREE(priv->dWaiter);
+    if (priv->deathW) {
+        libxl_evdisable_domain_death(priv->ctx, priv->deathW);
+        VIR_FREE(priv->deathW);
     }
 
-    libxl_ctx_free(&priv->ctx);
+    libxl_ctx_free(priv->ctx);
     VIR_FREE(priv);
 }
 
@@ -125,17 +292,6 @@ libxlDomainEventQueue(libxlDriverPrivatePtr driver, virDomainEventPtr event)
     virDomainEventStateQueue(driver->domainEventState, event);
 }
 
-/*
- * Remove reference to domain object.
- */
-static void
-libxlDomainObjUnref(void *data)
-{
-    virDomainObjPtr vm = data;
-
-    virObjectUnref(vm);
-}
-
 static void
 libxlAutostartDomain(void *payload, const void *name ATTRIBUTE_UNUSED,
                      void *opaque)
@@ -166,13 +322,13 @@ libxlDoNodeGetInfo(libxlDriverPrivatePtr driver, virNodeInfoPtr info)
     const libxl_version_info* ver_info;
     struct utsname utsname;
 
-    if (libxl_get_physinfo(&driver->ctx, &phy_info)) {
+    if (libxl_get_physinfo(driver->ctx, &phy_info)) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxl_get_physinfo_info failed"));
         return -1;
     }
 
-    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxl_get_version_info failed"));
         return -1;
@@ -296,15 +452,9 @@ libxlVmCleanup(libxlDriverPrivatePtr driver,
     char *file;
     int i;
 
-    if (priv->eventHdl >= 0) {
-        virEventRemoveHandle(priv->eventHdl);
-        priv->eventHdl = -1;
-    }
-
-    if (priv->dWaiter) {
-        libxl_stop_waiting(&priv->ctx, priv->dWaiter);
-        libxl_free_waiter(priv->dWaiter);
-        VIR_FREE(priv->dWaiter);
+    if (priv->deathW) {
+        libxl_evdisable_domain_death(priv->ctx, priv->deathW);
+        priv->deathW = NULL;
     }
 
     if (vm->persistent) {
@@ -355,12 +505,11 @@ libxlVmCleanup(libxlDriverPrivatePtr driver,
 static int
 libxlVmReap(libxlDriverPrivatePtr driver,
             virDomainObjPtr vm,
-            int force,
             virDomainShutoffReason reason)
 {
     libxlDomainObjPrivatePtr priv = vm->privateData;
 
-    if (libxl_domain_destroy(&priv->ctx, vm->def->id, force) < 0) {
+    if (libxl_domain_destroy(priv->ctx, vm->def->id, NULL) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Unable to cleanup domain %d"), vm->def->id);
         return -1;
@@ -373,56 +522,26 @@ libxlVmReap(libxlDriverPrivatePtr driver,
 /*
  * Handle previously registered event notification from libxenlight
  */
-static void libxlEventHandler(int watch,
-                              int fd,
-                              int events,
-                              void *data)
+static void libxlEventHandler(void *data, const libxl_event *event)
 {
     libxlDriverPrivatePtr driver = libxl_driver;
     virDomainObjPtr vm = data;
-    libxlDomainObjPrivatePtr priv;
     virDomainEventPtr dom_event = NULL;
-    libxl_event event;
-    libxl_dominfo info;
 
     libxlDriverLock(driver);
     virDomainObjLock(vm);
     libxlDriverUnlock(driver);
 
-    priv = vm->privateData;
-
-    memset(&event, 0, sizeof(event));
-    memset(&info, 0, sizeof(info));
-
-    if (priv->waiterFD != fd || priv->eventHdl != watch) {
-        virEventRemoveHandle(watch);
-        priv->eventHdl = -1;
-        goto cleanup;
-    }
-
-    if (!(events & VIR_EVENT_HANDLE_READABLE))
-        goto cleanup;
-
-    if (libxl_get_event(&priv->ctx, &event))
-        goto cleanup;
-
-    if (event.type == LIBXL_EVENT_DOMAIN_DEATH) {
+    if (event->type == LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN) {
         virDomainShutoffReason reason;
 
-        /* libxl_event_get_domain_death_info returns 1 if death
-         * event was for this domid */
-        if (libxl_event_get_domain_death_info(&priv->ctx,
-                                              vm->def->id,
-                                              &event,
-                                              &info) != 1)
+        if (event->domid != vm->def->id)
             goto cleanup;
 
-        virEventRemoveHandle(watch);
-        priv->eventHdl = -1;
-        switch (info.shutdown_reason) {
-            case SHUTDOWN_poweroff:
-            case SHUTDOWN_crash:
-                if (info.shutdown_reason == SHUTDOWN_crash) {
+        switch (event->u.domain_shutdown.shutdown_reason) {
+            case LIBXL_SHUTDOWN_REASON_POWEROFF:
+            case LIBXL_SHUTDOWN_REASON_CRASH:
+                if (event->u.domain_shutdown.shutdown_reason == LIBXL_SHUTDOWN_REASON_CRASH) {
                     dom_event = virDomainEventNewFromObj(vm,
                                               VIR_DOMAIN_EVENT_STOPPED,
                                               VIR_DOMAIN_EVENT_STOPPED_CRASHED);
@@ -430,18 +549,18 @@ static void libxlEventHandler(int watch,
                 } else {
                     reason = VIR_DOMAIN_SHUTOFF_SHUTDOWN;
                 }
-                libxlVmReap(driver, vm, 0, reason);
+                libxlVmReap(driver, vm, reason);
                 if (!vm->persistent) {
                     virDomainRemoveInactive(&driver->domains, vm);
                     vm = NULL;
                 }
                 break;
-            case SHUTDOWN_reboot:
-                libxlVmReap(driver, vm, 0, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
+            case LIBXL_SHUTDOWN_REASON_REBOOT:
+                libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
                 libxlVmStart(driver, vm, 0, -1);
                 break;
             default:
-                VIR_INFO("Unhandled shutdown_reason %d", info.shutdown_reason);
+                VIR_INFO("Unhandled shutdown_reason %d", event->u.domain_shutdown.shutdown_reason);
                 break;
         }
     }
@@ -454,9 +573,14 @@ cleanup:
         libxlDomainEventQueue(driver, dom_event);
         libxlDriverUnlock(driver);
     }
-    libxl_free_event(&event);
 }
 
+static const struct libxl_event_hooks ev_hooks = {
+    .event_occurs_mask = LIBXL_EVENTMASK_ALL,
+    .event_occurs = libxlEventHandler,
+    .disaster = NULL,
+};
+
 /*
  * Register domain events with libxenlight and insert event handles
  * in libvirt's event loop.
@@ -465,40 +589,18 @@ static int
 libxlCreateDomEvents(virDomainObjPtr vm)
 {
     libxlDomainObjPrivatePtr priv = vm->privateData;
-    int fd;
 
-    if (VIR_ALLOC(priv->dWaiter) < 0) {
-        virReportOOMError();
-        return -1;
-    }
-
-    if (libxl_wait_for_domain_death(&priv->ctx, vm->def->id, priv->dWaiter))
-        goto error;
-
-    libxl_get_wait_fd(&priv->ctx, &fd);
-    if (fd < 0)
-        goto error;
+    libxl_event_register_callbacks(priv->ctx, &ev_hooks, vm);
 
-    priv->waiterFD = fd;
-    /* Add a reference to the domain object while it is injected in
-     * the event loop.
-     */
-    virObjectRef(vm);
-    if ((priv->eventHdl = virEventAddHandle(
-             fd,
-             VIR_EVENT_HANDLE_READABLE | VIR_EVENT_HANDLE_ERROR,
-             libxlEventHandler,
-             vm, libxlDomainObjUnref)) < 0) {
-        virObjectUnref(vm);
+    if (libxl_evenable_domain_death(priv->ctx, vm->def->id, 0, &priv->deathW))
         goto error;
-    }
 
     return 0;
 
 error:
-    libxl_free_waiter(priv->dWaiter);
-    VIR_FREE(priv->dWaiter);
-    priv->eventHdl = -1;
+    if (priv->deathW)
+        libxl_evdisable_domain_death(priv->ctx, priv->deathW);
+    VIR_FREE(priv->deathW);
     return -1;
 }
 
@@ -507,7 +609,7 @@ libxlDomainSetVcpuAffinites(libxlDriverPrivatePtr driver, virDomainObjPtr vm)
 {
     libxlDomainObjPrivatePtr priv = vm->privateData;
     virDomainDefPtr def = vm->def;
-    libxl_cpumap map;
+    libxl_bitmap map;
     uint8_t *cpumask = NULL;
     uint8_t *cpumap = NULL;
     virNodeInfo nodeinfo;
@@ -539,7 +641,7 @@ libxlDomainSetVcpuAffinites(libxlDriverPrivatePtr driver, virDomainObjPtr vm)
         map.size = cpumaplen;
         map.map = cpumap;
 
-        if (libxl_set_vcpuaffinity(&priv->ctx, def->id, vcpu, &map) != 0) {
+        if (libxl_set_vcpuaffinity(priv->ctx, def->id, vcpu, &map) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to pin vcpu '%d' with libxenlight"), vcpu);
             goto cleanup;
@@ -565,11 +667,10 @@ libxlFreeMem(libxlDomainObjPrivatePtr priv, libxl_domain_config *d_config)
     int tries = 3;
     int wait_secs = 10;
 
-    if ((ret = libxl_domain_need_memory(&priv->ctx, &d_config->b_info,
-                                        &d_config->dm_info,
+    if ((ret = libxl_domain_need_memory(priv->ctx, &d_config->b_info,
                                         &needed_mem)) >= 0) {
         for (i = 0; i < tries; ++i) {
-            if ((ret = libxl_get_free_memory(&priv->ctx, &free_mem)) < 0)
+            if ((ret = libxl_get_free_memory(priv->ctx, &free_mem)) < 0)
                 break;
 
             if (free_mem >= needed_mem) {
@@ -577,17 +678,17 @@ libxlFreeMem(libxlDomainObjPrivatePtr priv, libxl_domain_config *d_config)
                 break;
             }
 
-            if ((ret = libxl_set_memory_target(&priv->ctx, 0,
+            if ((ret = libxl_set_memory_target(priv->ctx, 0,
                                                free_mem - needed_mem,
                                                /* relative */ 1, 0)) < 0)
                 break;
 
-            ret = libxl_wait_for_free_memory(&priv->ctx, 0, needed_mem,
+            ret = libxl_wait_for_free_memory(priv->ctx, 0, needed_mem,
                                              wait_secs);
             if (ret == 0 || ret != ERROR_NOMEM)
                 break;
 
-            if ((ret = libxl_wait_for_memory_target(&priv->ctx, 0, 1)) < 0)
+            if ((ret = libxl_wait_for_memory_target(priv->ctx, 0, 1)) < 0)
                 break;
         }
     }
@@ -613,7 +714,6 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
     char *dom_xml = NULL;
     char *managed_save_path = NULL;
     int managed_save_fd = -1;
-    pid_t child_console_pid = -1;
     libxlDomainObjPrivatePtr priv = vm->privateData;
 
     /* If there is a managed saved state restore it instead of starting
@@ -657,7 +757,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         VIR_FREE(managed_save_path);
     }
 
-    memset(&d_config, 0, sizeof(d_config));
+    libxl_domain_config_init(&d_config);
 
     if (libxlBuildDomainConfig(driver, vm->def, &d_config) < 0)
         return -1;
@@ -669,13 +769,14 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         goto error;
     }
 
+    /* use as synchronous operations => ao_how = NULL and no intermediate reports => ao_progress = NULL */
+
     if (restore_fd < 0)
-        ret = libxl_domain_create_new(&priv->ctx, &d_config,
-                                      NULL, &child_console_pid, &domid);
+        ret = libxl_domain_create_new(priv->ctx, &d_config,
+                                      &domid, NULL, NULL);
     else
-        ret = libxl_domain_create_restore(&priv->ctx, &d_config, NULL,
-                                          &child_console_pid, &domid,
-                                          restore_fd);
+        ret = libxl_domain_create_restore(priv->ctx, &d_config, &domid,
+                                          restore_fd, NULL, NULL);
 
     if (ret) {
         if (restore_fd < 0)
@@ -693,7 +794,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
     if ((dom_xml = virDomainDefFormat(vm->def, 0)) == NULL)
         goto error;
 
-    if (libxl_userdata_store(&priv->ctx, domid, "libvirt-xml",
+    if (libxl_userdata_store(priv->ctx, domid, "libvirt-xml",
                              (uint8_t *)dom_xml, strlen(dom_xml) + 1)) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxenlight failed to store userdata"));
@@ -707,7 +808,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         goto error;
 
     if (!start_paused) {
-        libxl_domain_unpause(&priv->ctx, domid);
+        libxl_domain_unpause(priv->ctx, domid);
         virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_BOOTED);
     } else {
         virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER);
@@ -723,18 +824,18 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
                                          VIR_DOMAIN_EVENT_STARTED_RESTORED);
     libxlDomainEventQueue(driver, event);
 
-    libxl_domain_config_destroy(&d_config);
+    libxl_domain_config_dispose(&d_config);
     VIR_FREE(dom_xml);
     VIR_FORCE_CLOSE(managed_save_fd);
     return 0;
 
 error:
     if (domid > 0) {
-        libxl_domain_destroy(&priv->ctx, domid, 0);
+        libxl_domain_destroy(priv->ctx, domid, NULL);
         vm->def->id = -1;
         virDomainObjSetState(vm, VIR_DOMAIN_SHUTOFF, VIR_DOMAIN_SHUTOFF_FAILED);
     }
-    libxl_domain_config_destroy(&d_config);
+    libxl_domain_config_dispose(&d_config);
     VIR_FREE(dom_xml);
     VIR_FREE(managed_save_path);
     virDomainDefFree(def);
@@ -762,7 +863,7 @@ libxlReconnectDomain(void *payload,
     virDomainObjLock(vm);
 
     /* Does domain still exist? */
-    rc = libxl_domain_info(&driver->ctx, &d_info, vm->def->id);
+    rc = libxl_domain_info(driver->ctx, &d_info, vm->def->id);
     if (rc == ERROR_INVAL) {
         goto out;
     } else if (rc != 0) {
@@ -772,7 +873,7 @@ libxlReconnectDomain(void *payload,
     }
 
     /* Is this a domain that was under libvirt control? */
-    if (libxl_userdata_retrieve(&driver->ctx, vm->def->id,
+    if (libxl_userdata_retrieve(driver->ctx, vm->def->id,
                                 "libvirt-xml", &data, &len)) {
         VIR_DEBUG("libxl_userdata_retrieve failed, ignoring domain %d", vm->def->id);
         goto out;
@@ -810,7 +911,7 @@ libxlShutdown(void)
     libxlDriverLock(libxl_driver);
     virCapabilitiesFree(libxl_driver->caps);
     virDomainObjListDeinit(&libxl_driver->domains);
-    libxl_ctx_free(&libxl_driver->ctx);
+    libxl_ctx_free(libxl_driver->ctx);
     xtl_logger_destroy(libxl_driver->logger);
     if (libxl_driver->logger_file)
         VIR_FORCE_FCLOSE(libxl_driver->logger_file);
@@ -943,14 +1044,14 @@ libxlStartup(bool privileged) {
         goto fail;
     }
 
-    if (libxl_ctx_init(&libxl_driver->ctx,
-                       LIBXL_VERSION,
+    if (libxl_ctx_alloc(&libxl_driver->ctx,
+                       LIBXL_VERSION, 0,
                        libxl_driver->logger)) {
         VIR_INFO("cannot initialize libxenlight context, probably not running in a Xen Dom0, disabling driver");
         goto fail;
     }
 
-    if ((ver_info = libxl_get_version_info(&libxl_driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(libxl_driver->ctx)) == NULL) {
         VIR_INFO("cannot version information from libxenlight, disabling driver");
         goto fail;
     }
@@ -958,7 +1059,7 @@ libxlStartup(bool privileged) {
             (ver_info->xen_version_minor * 1000);
 
     if ((libxl_driver->caps =
-         libxlMakeCapabilities(&libxl_driver->ctx)) == NULL) {
+         libxlMakeCapabilities(libxl_driver->ctx)) == NULL) {
         VIR_ERROR(_("cannot create capabilities for libxenlight"));
         goto error;
     }
@@ -1115,7 +1216,7 @@ libxlGetMaxVcpus(virConnectPtr conn, const char *type ATTRIBUTE_UNUSED)
     int ret;
     libxlDriverPrivatePtr driver = conn->privateData;
 
-    ret = libxl_get_max_cpus(&driver->ctx);
+    ret = libxl_get_max_cpus(driver->ctx);
     /* libxl_get_max_cpus() will return 0 if there were any failures,
        e.g. xc_physinfo() failing */
     if (ret == 0)
@@ -1320,7 +1421,7 @@ libxlDomainSuspend(virDomainPtr dom)
     priv = vm->privateData;
 
     if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_PAUSED) {
-        if (libxl_domain_pause(&priv->ctx, dom->id) != 0) {
+        if (libxl_domain_pause(priv->ctx, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to suspend domain '%d' with libxenlight"),
                            dom->id);
@@ -1379,7 +1480,7 @@ libxlDomainResume(virDomainPtr dom)
     priv = vm->privateData;
 
     if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
-        if (libxl_domain_unpause(&priv->ctx, dom->id) != 0) {
+        if (libxl_domain_unpause(priv->ctx, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to resume domain '%d' with libxenlight"),
                            dom->id);
@@ -1436,7 +1537,7 @@ libxlDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
     }
 
     priv = vm->privateData;
-    if (libxl_domain_shutdown(&priv->ctx, dom->id, LIBXL_DOM_REQ_POWEROFF) != 0) {
+    if (libxl_domain_shutdown(priv->ctx, dom->id) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to shutdown domain '%d' with libxenlight"),
                        dom->id);
@@ -1489,7 +1590,7 @@ libxlDomainReboot(virDomainPtr dom, unsigned int flags)
     }
 
     priv = vm->privateData;
-    if (libxl_domain_shutdown(&priv->ctx, dom->id, LIBXL_DOM_REQ_REBOOT) != 0) {
+    if (libxl_domain_reboot(priv->ctx, dom->id) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to reboot domain '%d' with libxenlight"),
                        dom->id);
@@ -1534,7 +1635,7 @@ libxlDomainDestroyFlags(virDomainPtr dom,
     event = virDomainEventNewFromObj(vm,VIR_DOMAIN_EVENT_STOPPED,
                                      VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
 
-    if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_DESTROYED) != 0) {
+    if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to destroy domain '%d'"), dom->id);
         goto cleanup;
@@ -1672,7 +1773,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
 
         if (flags & VIR_DOMAIN_MEM_LIVE) {
             priv = vm->privateData;
-            if (libxl_domain_setmaxmem(&priv->ctx, dom->id, newmem) < 0) {
+            if (libxl_domain_setmaxmem(priv->ctx, dom->id, newmem) < 0) {
                 virReportError(VIR_ERR_INTERNAL_ERROR,
                                _("Failed to set maximum memory for domain '%d'"
                                  " with libxenlight"), dom->id);
@@ -1701,7 +1802,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
 
         if (flags & VIR_DOMAIN_MEM_LIVE) {
             priv = vm->privateData;
-            if (libxl_set_memory_target(&priv->ctx, dom->id, newmem, 0,
+            if (libxl_set_memory_target(priv->ctx, dom->id, newmem, 0,
                                         /* force */ 1) < 0) {
                 virReportError(VIR_ERR_INTERNAL_ERROR,
                                _("Failed to set memory for domain '%d'"
@@ -1761,7 +1862,7 @@ libxlDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info)
         info->memory = vm->def->mem.cur_balloon;
         info->maxMem = vm->def->mem.max_balloon;
     } else {
-        if (libxl_domain_info(&driver->ctx, &d_info, dom->id) != 0) {
+        if (libxl_domain_info(driver->ctx, &d_info, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("libxl_domain_info failed for domain '%d'"), dom->id);
             goto cleanup;
@@ -1861,7 +1962,7 @@ libxlDoDomainSave(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         goto cleanup;
     }
 
-    if (libxl_domain_suspend(&priv->ctx, NULL, vm->def->id, fd) != 0) {
+    if (libxl_domain_suspend(priv->ctx, vm->def->id, fd, 0, NULL) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to save domain '%d' with libxenlight"),
                        vm->def->id);
@@ -1871,7 +1972,7 @@ libxlDoDomainSave(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
     event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
                                          VIR_DOMAIN_EVENT_STOPPED_SAVED);
 
-    if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_SAVED) != 0) {
+    if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_SAVED) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to destroy domain '%d'"), vm->def->id);
         goto cleanup;
@@ -2028,7 +2129,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
 
     if (!(flags & VIR_DUMP_LIVE) &&
         virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
-        if (libxl_domain_pause(&priv->ctx, dom->id) != 0) {
+        if (libxl_domain_pause(priv->ctx, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Before dumping core, failed to suspend domain '%d'"
                              " with libxenlight"),
@@ -2039,7 +2140,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
         paused = true;
     }
 
-    if (libxl_domain_core_dump(&priv->ctx, dom->id, to) != 0) {
+    if (libxl_domain_core_dump(priv->ctx, dom->id, to, NULL) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to dump core of domain '%d' with libxenlight"),
                        dom->id);
@@ -2048,7 +2149,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
 
     libxlDriverLock(driver);
     if (flags & VIR_DUMP_CRASH) {
-        if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_CRASHED) != 0) {
+        if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_CRASHED) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to destroy domain '%d'"), dom->id);
             goto cleanup_unlock;
@@ -2069,7 +2170,7 @@ cleanup_unlock:
     libxlDriverUnlock(driver);
 cleanup_unpause:
     if (virDomainObjIsActive(vm) && paused) {
-        if (libxl_domain_unpause(&priv->ctx, dom->id) != 0) {
+        if (libxl_domain_unpause(priv->ctx, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("After dumping core, failed to resume domain '%d' with"
                              " libxenlight"), dom->id);
@@ -2227,7 +2328,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
     libxlDomainObjPrivatePtr priv;
     virDomainDefPtr def;
     virDomainObjPtr vm;
-    libxl_cpumap map;
+    libxl_bitmap map;
     uint8_t *bitmask = NULL;
     unsigned int maplen;
     unsigned int i, pos;
@@ -2322,7 +2423,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
         break;
 
     case VIR_DOMAIN_VCPU_LIVE:
-        if (libxl_set_vcpuonline(&priv->ctx, dom->id, &map) != 0) {
+        if (libxl_set_vcpuonline(priv->ctx, dom->id, &map) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to set vcpus for domain '%d'"
                              " with libxenlight"), dom->id);
@@ -2331,7 +2432,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
         break;
 
     case VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG:
-        if (libxl_set_vcpuonline(&priv->ctx, dom->id, &map) != 0) {
+        if (libxl_set_vcpuonline(priv->ctx, dom->id, &map) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to set vcpus for domain '%d'"
                              " with libxenlight"), dom->id);
@@ -2427,7 +2528,7 @@ libxlDomainPinVcpu(virDomainPtr dom, unsigned int vcpu, unsigned char *cpumap,
     libxlDomainObjPrivatePtr priv;
     virDomainObjPtr vm;
     int ret = -1;
-    libxl_cpumap map;
+    libxl_bitmap map;
 
     libxlDriverLock(driver);
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
@@ -2448,7 +2549,7 @@ libxlDomainPinVcpu(virDomainPtr dom, unsigned int vcpu, unsigned char *cpumap,
 
     map.size = maplen;
     map.map = cpumap;
-    if (libxl_set_vcpuaffinity(&priv->ctx, dom->id, vcpu, &map) != 0) {
+    if (libxl_set_vcpuaffinity(priv->ctx, dom->id, vcpu, &map) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to pin vcpu '%d' with libxenlight"), vcpu);
         goto cleanup;
@@ -2511,7 +2612,7 @@ libxlDomainGetVcpus(virDomainPtr dom, virVcpuInfoPtr info, int maxinfo,
     }
 
     priv = vm->privateData;
-    if ((vcpuinfo = libxl_list_vcpu(&priv->ctx, dom->id, &maxcpu,
+    if ((vcpuinfo = libxl_list_vcpu(priv->ctx, dom->id, &maxcpu,
                                     &hostcpus)) == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to list vcpus for domain '%d' with libxenlight"),
@@ -2538,7 +2639,7 @@ libxlDomainGetVcpus(virDomainPtr dom, virVcpuInfoPtr info, int maxinfo,
                    MIN(maplen, vcpuinfo[i].cpumap.size));
         }
 
-        libxl_vcpuinfo_destroy(&vcpuinfo[i]);
+        libxl_vcpuinfo_dispose(&vcpuinfo[i]);
     }
     VIR_FREE(vcpuinfo);
 
@@ -2596,7 +2697,7 @@ libxlDomainXMLFromNative(virConnectPtr conn, const char * nativeFormat,
         goto cleanup;
     }
 
-    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
         VIR_ERROR(_("cannot get version information from libxenlight"));
         goto cleanup;
     }
@@ -2639,7 +2740,7 @@ libxlDomainXMLToNative(virConnectPtr conn, const char * nativeFormat,
         goto cleanup;
     }
 
-    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
         VIR_ERROR(_("cannot get version information from libxenlight"));
         goto cleanup;
     }
@@ -2899,10 +3000,10 @@ libxlDomainChangeEjectableMedia(libxlDomainObjPrivatePtr priv,
         return -1;
     }
 
-    if (libxlMakeDisk(vm->def, disk, &x_disk) < 0)
+    if (libxlMakeDisk(disk, &x_disk) < 0)
         goto cleanup;
 
-    if ((ret = libxl_cdrom_insert(&priv->ctx, vm->def->id, &x_disk)) < 0) {
+    if ((ret = libxl_cdrom_insert(priv->ctx, vm->def->id, &x_disk, NULL)) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("libxenlight failed to change media for disk '%s'"),
                        disk->dst);
@@ -2954,11 +3055,11 @@ libxlDomainAttachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
                     goto cleanup;
                 }
 
-                if (libxlMakeDisk(vm->def, l_disk, &x_disk) < 0)
+                if (libxlMakeDisk(l_disk, &x_disk) < 0)
                     goto cleanup;
 
-                if ((ret = libxl_device_disk_add(&priv->ctx, vm->def->id,
-                                                &x_disk)) < 0) {
+                if ((ret = libxl_device_disk_add(priv->ctx, vm->def->id,
+                                                &x_disk, NULL)) < 0) {
                     virReportError(VIR_ERR_INTERNAL_ERROR,
                                    _("libxenlight failed to attach disk '%s'"),
                                    l_disk->dst);
@@ -2991,7 +3092,6 @@ libxlDomainDetachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
     virDomainDiskDefPtr l_disk = NULL;
     libxl_device_disk x_disk;
     int i;
-    int wait_secs = 2;
     int ret = -1;
 
     switch (dev->data.disk->device)  {
@@ -3008,11 +3108,11 @@ libxlDomainDetachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
 
                 l_disk = vm->def->disks[i];
 
-                if (libxlMakeDisk(vm->def, l_disk, &x_disk) < 0)
+                if (libxlMakeDisk(l_disk, &x_disk) < 0)
                     goto cleanup;
 
-                if ((ret = libxl_device_disk_del(&priv->ctx, &x_disk,
-                                                 wait_secs)) < 0) {
+                if ((ret = libxl_device_disk_remove(priv->ctx, vm->def->id,
+                                                    &x_disk, NULL)) < 0) {
                     virReportError(VIR_ERR_INTERNAL_ERROR,
                                    _("libxenlight failed to detach disk '%s'"),
                                    l_disk->dst);
@@ -3383,13 +3483,13 @@ libxlNodeGetFreeMemory(virConnectPtr conn)
     const libxl_version_info* ver_info;
     libxlDriverPrivatePtr driver = conn->privateData;
 
-    if (libxl_get_physinfo(&driver->ctx, &phy_info)) {
+    if (libxl_get_physinfo(driver->ctx, &phy_info)) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxl_get_physinfo_info failed"));
         return 0;
     }
 
-    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxl_get_version_info failed"));
         return 0;
@@ -3536,7 +3636,7 @@ libxlDomainGetSchedulerType(virDomainPtr dom, int *nparams)
     libxlDomainObjPrivatePtr priv;
     virDomainObjPtr vm;
     char * ret = NULL;
-    int sched_id;
+    libxl_scheduler sched_id;
 
     libxlDriverLock(driver);
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
@@ -3553,31 +3653,29 @@ libxlDomainGetSchedulerType(virDomainPtr dom, int *nparams)
     }
 
     priv = vm->privateData;
-    if ((sched_id = libxl_get_sched_id(&priv->ctx)) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to get scheduler id for domain '%d'"
-                         " with libxenlight"), dom->id);
-        goto cleanup;
-    }
+    sched_id = libxl_get_scheduler(priv->ctx);
 
     if (nparams)
         *nparams = 0;
     switch (sched_id) {
-    case XEN_SCHEDULER_SEDF:
+    case LIBXL_SCHEDULER_SEDF:
         ret = strdup("sedf");
         break;
-    case XEN_SCHEDULER_CREDIT:
+    case LIBXL_SCHEDULER_CREDIT:
         ret = strdup("credit");
         if (nparams)
             *nparams = XEN_SCHED_CREDIT_NPARAM;
         break;
-    case XEN_SCHEDULER_CREDIT2:
+    case LIBXL_SCHEDULER_CREDIT2:
         ret = strdup("credit2");
         break;
-    case XEN_SCHEDULER_ARINC653:
+    case LIBXL_SCHEDULER_ARINC653:
         ret = strdup("arinc653");
         break;
     default:
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                   _("Failed to get scheduler id for domain '%d'"
+                     " with libxenlight"), dom->id);
         goto cleanup;
     }
 
@@ -3599,8 +3697,8 @@ libxlDomainGetSchedulerParametersFlags(virDomainPtr dom,
     libxlDriverPrivatePtr driver = dom->conn->privateData;
     libxlDomainObjPrivatePtr priv;
     virDomainObjPtr vm;
-    libxl_sched_credit sc_info;
-    int sched_id;
+    libxl_domain_sched_params sc_info;
+    libxl_scheduler sched_id;
     int ret = -1;
 
     virCheckFlags(0, -1);
@@ -3610,31 +3708,28 @@ libxlDomainGetSchedulerParametersFlags(virDomainPtr dom,
     libxlDriverUnlock(driver);
 
     if (!vm) {
-        virReportError(VIR_ERR_NO_DOMAIN, "%s", _("no domain with matching uuid"));
+        virReportError(VIR_ERR_NO_DOMAIN, "%s",
+                       _("no domain with matching uuid"));
         goto cleanup;
     }
 
     if (!virDomainObjIsActive(vm)) {
-        virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("Domain is not running"));
+        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+                       _("Domain is not running"));
         goto cleanup;
     }
 
     priv = vm->privateData;
 
-    if ((sched_id = libxl_get_sched_id(&priv->ctx)) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to get scheduler id for domain '%d'"
-                         " with libxenlight"), dom->id);
-        goto cleanup;
-    }
+    sched_id = libxl_get_scheduler(priv->ctx);
 
-    if (sched_id != XEN_SCHEDULER_CREDIT) {
+    if (sched_id != LIBXL_SCHEDULER_CREDIT) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("Only 'credit' scheduler is supported"));
         goto cleanup;
     }
 
-    if (libxl_sched_credit_domain_get(&priv->ctx, dom->id, &sc_info) != 0) {
+    if (libxl_domain_sched_params_get(priv->ctx, dom->id, &sc_info) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to get scheduler parameters for domain '%d'"
                          " with libxenlight"), dom->id);
@@ -3677,7 +3772,7 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
     libxlDriverPrivatePtr driver = dom->conn->privateData;
     libxlDomainObjPrivatePtr priv;
     virDomainObjPtr vm;
-    libxl_sched_credit sc_info;
+    libxl_domain_sched_params sc_info;
     int sched_id;
     int i;
     int ret = -1;
@@ -3707,20 +3802,15 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
 
     priv = vm->privateData;
 
-    if ((sched_id = libxl_get_sched_id(&priv->ctx)) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to get scheduler id for domain '%d'"
-                         " with libxenlight"), dom->id);
-        goto cleanup;
-    }
+    sched_id = libxl_get_scheduler(priv->ctx);
 
-    if (sched_id != XEN_SCHEDULER_CREDIT) {
+    if (sched_id != LIBXL_SCHEDULER_CREDIT) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("Only 'credit' scheduler is supported"));
         goto cleanup;
     }
 
-    if (libxl_sched_credit_domain_get(&priv->ctx, dom->id, &sc_info) != 0) {
+    if (libxl_domain_sched_params_get(priv->ctx, dom->id, &sc_info) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to get scheduler parameters for domain '%d'"
                          " with libxenlight"), dom->id);
@@ -3737,7 +3827,7 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
         }
     }
 
-    if (libxl_sched_credit_domain_set(&priv->ctx, dom->id, &sc_info) != 0) {
+    if (libxl_domain_sched_params_set(priv->ctx, dom->id, &sc_info) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to set scheduler parameters for domain '%d'"
                          " with libxenlight"), dom->id);
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 22:13:46 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 22:13:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeYps-00016I-Tl; Fri, 30 Nov 2012 22:13:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jfehlig@suse.com>) id 1TeYpr-000166-B0
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 22:13:27 +0000
Received: from [193.109.254.147:18685] by server-14.bemta-14.messagelabs.com
	id F4/82-14517-68F29B05; Fri, 30 Nov 2012 22:13:26 +0000
X-Env-Sender: jfehlig@suse.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1354313602!8938673!1
X-Originating-IP: [137.65.248.124]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18099 invoked from network); 30 Nov 2012 22:13:23 -0000
Received: from inet-orm.provo.novell.com (HELO mail.novell.com)
	(137.65.248.124) by server-9.tower-27.messagelabs.com with SMTP;
	30 Nov 2012 22:13:23 -0000
Received: from jfehlig1.provo.novell.com ([137.65.135.33])
	by mail.novell.com with ESMTP; Fri, 30 Nov 2012 15:13:19 -0700
From: Jim Fehlig <jfehlig@suse.com>
To: libvir-list@redhat.com
Date: Fri, 30 Nov 2012 15:13:13 -0700
Message-Id: <1354313593-13358-1-git-send-email-jfehlig@suse.com>
X-Mailer: git-send-email 1.7.10.4
Cc: xen-devel@lists.xen.org
Subject: [Xen-devel] [PATCH] Convert libxl driver to Xen 4.2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Based on a patch originally authored by Daniel De Graaf

  http://lists.xen.org/archives/html/xen-devel/2012-05/msg00565.html

This patch converts the Xen libxl driver to support only Xen >= 4.2.
Support for Xen 4.1 libxl is dropped since that version of libxl is
designated 'technology preview' only and is incompatible with Xen 4.2
libxl.  Additionally, the default toolstack in Xen 4.1 is still xend,
for which libvirt has a stable, functional driver.
---
V2:
  Remove 128 vcpu limit.
  Remove split_string_into_string_list() function copied from xen
  sources since libvirt now has virStringSplit().

 configure.ac             |    8 +-
 docs/drvxen.html.in      |    8 +
 libvirt.spec.in          |    4 +-
 src/libxl/libxl_conf.c   |  321 +++++++++---------------------
 src/libxl/libxl_conf.h   |   16 +-
 src/libxl/libxl_driver.c |  488 +++++++++++++++++++++++++++-------------------
 6 files changed, 404 insertions(+), 441 deletions(-)

diff --git a/configure.ac b/configure.ac
index c888eb8..a695e52 100644
--- a/configure.ac
+++ b/configure.ac
@@ -718,16 +718,14 @@ if test "$with_libxl" != "no" ; then
     fi
     CFLAGS="$CFLAGS $LIBXL_CFLAGS"
     LIBS="$LIBS $LIBXL_LIBS"
-    AC_CHECK_LIB([xenlight], [libxl_domain_create_new], [
+    AC_CHECK_LIB([xenlight], [libxl_ctx_alloc], [
         with_libxl=yes
-        LIBXL_LIBS="$LIBXL_LIBS -lxenlight -lxenstore -lxenctrl -lxenguest -luuid -lutil -lblktapctl"
+        LIBXL_LIBS="$LIBXL_LIBS -lxenlight"
     ],[
         if test "$with_libxl" = "yes"; then
             fail=1
         fi
         with_libxl=no
-    ],[
-        -lxenstore -lxenctrl -lxenguest -luuid -lutil -lblktapctl
     ])
 fi
 
@@ -735,7 +733,7 @@ LIBS="$old_LIBS"
 CFLAGS="$old_CFLAGS"
 
 if test $fail = 1; then
-    AC_MSG_ERROR([You must install the libxl Library to compile libxenlight driver with -lxl])
+    AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.2 to compile libxenlight driver with -lxl])
 fi
 
 if test "$with_libxl" = "yes"; then
diff --git a/docs/drvxen.html.in b/docs/drvxen.html.in
index 0bca935..06bd911 100644
--- a/docs/drvxen.html.in
+++ b/docs/drvxen.html.in
@@ -53,6 +53,14 @@
         the <code>/etc/xen</code> directory. It is important not to place
         any other non-config files in this directory.
       </li>
+      <li>
+        <strong>libxl</strong>: Starting with Xen 4.2, the legacy XenD/xm
+        toolstack is deprecated in favor of libxl, also commonly called
+        libxenlight.  libvirt supports this new Xen toolstack via the
+        libxl driver.  If XenD is enabled, the legacy xen driver consisting
+        of the above mentioned channels will be used.  If XenD is disabled,
+        the libxl driver will be used.
+      </li>
     </ul>
 
     <h2><a name="uri">Connections to Xen driver</a></h2>
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 5b3f4e4..47cb087 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -189,8 +189,8 @@
 %endif
 %endif
 
-# Fedora doesn't have new enough Xen for libxl until F16
-%if 0%{?fedora} && 0%{?fedora} < 16
+# Fedora doesn't have new enough Xen for libxl until F18
+%if 0%{?fedora} && 0%{?fedora} < 18
 %define with_libxl 0
 %endif
 
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 1c3130b..b8b9ddb 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -36,11 +36,13 @@
 #include "virterror_internal.h"
 #include "datatypes.h"
 #include "virfile.h"
+#include "virstring.h"
 #include "memory.h"
 #include "uuid.h"
 #include "capabilities.h"
 #include "libxl_driver.h"
 #include "libxl_conf.h"
+#include "libxl_utils.h"
 #include "storage_file.h"
 
 
@@ -62,7 +64,6 @@ struct guest_arch {
 static const char *xen_cap_re = "(xen|hvm)-[[:digit:]]+\\.[[:digit:]]+-(x86_32|x86_64|ia64|powerpc64)(p|be)?";
 static regex_t xen_cap_rec;
 
-
 static int
 libxlNextFreeVncPort(libxlDriverPrivatePtr driver, int startPort)
 {
@@ -360,18 +361,36 @@ libxlMakeCapabilitiesInternal(const char *hostmachine,
 }
 
 static int
-libxlMakeDomCreateInfo(virDomainDefPtr def, libxl_domain_create_info *c_info)
+libxlMakeDomCreateInfo(libxlDriverPrivatePtr driver,
+                       virDomainDefPtr def,
+                       libxl_domain_create_info *c_info)
 {
     char uuidstr[VIR_UUID_STRING_BUFLEN];
 
-    libxl_init_create_info(c_info);
+    libxl_domain_create_info_init(c_info);
+
+    if (STREQ(def->os.type, "hvm"))
+        c_info->type = LIBXL_DOMAIN_TYPE_HVM;
+    else
+        c_info->type = LIBXL_DOMAIN_TYPE_PV;
 
-    c_info->hvm = STREQ(def->os.type, "hvm");
     if ((c_info->name = strdup(def->name)) == NULL) {
         virReportOOMError();
         goto error;
     }
 
+    if (def->nseclabels &&
+        def->seclabels[0]->type == VIR_DOMAIN_SECLABEL_STATIC) {
+        if (libxl_flask_context_to_sid(driver->ctx,
+                                       def->seclabels[0]->label,
+                                       strlen(def->seclabels[0]->label),
+                                       &c_info->ssidref)) {
+            virReportError(VIR_ERR_INTERNAL_ERROR,
+                           _("libxenlight failed to resolve security label '%s'"),
+                           def->seclabels[0]->label);
+        }
+    }
+
     virUUIDFormat(def->uuid, uuidstr);
     if (libxl_uuid_from_string(&c_info->uuid, uuidstr)) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -382,7 +401,7 @@ libxlMakeDomCreateInfo(virDomainDefPtr def, libxl_domain_create_info *c_info)
     return 0;
 
 error:
-    libxl_domain_create_info_destroy(c_info);
+    libxl_domain_create_info_dispose(c_info);
     return -1;
 }
 
@@ -393,26 +412,14 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
     int hvm = STREQ(def->os.type, "hvm");
     int i;
 
-    /* Currently, libxenlight only supports 32 vcpus per domain.
-     * cur_vcpus member of struct libxl_domain_build_info is defined
-     * as an int, but its semantic is a bitmap of online vcpus, so
-     * only 32 can be represented.
-     */
-    if (def->maxvcpus > 32 || def->vcpus > 32) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("This version of libxenlight only supports 32 "
-                         "vcpus per domain"));
-        return -1;
-    }
+    libxl_domain_build_info_init(b_info);
 
-    libxl_init_build_info(b_info, &d_config->c_info);
-
-    b_info->hvm = hvm;
-    b_info->max_vcpus = def->maxvcpus;
-    if (def->vcpus == 32)
-        b_info->cur_vcpus = (uint32_t) -1;
+    if (hvm)
+        libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_HVM);
     else
-        b_info->cur_vcpus = (1 << def->vcpus) - 1;
+        libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_PV);
+    b_info->max_vcpus = def->maxvcpus;
+    libxl_bitmap_set((&b_info->avail_vcpus), def->vcpus);
     if (def->clock.ntimers > 0 &&
         def->clock.timers[0]->name == VIR_DOMAIN_TIMER_NAME_TSC) {
         switch (def->clock.timers[0]->mode) {
@@ -426,16 +433,20 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
                 b_info->tsc_mode = 1;
         }
     }
+    b_info->sched_params.weight = 1000;
     b_info->max_memkb = def->mem.max_balloon;
     b_info->target_memkb = def->mem.cur_balloon;
     if (hvm) {
-        b_info->u.hvm.pae = def->features & (1 << VIR_DOMAIN_FEATURE_PAE);
-        b_info->u.hvm.apic = def->features & (1 << VIR_DOMAIN_FEATURE_APIC);
-        b_info->u.hvm.acpi = def->features & (1 << VIR_DOMAIN_FEATURE_ACPI);
+        libxl_defbool_set(&b_info->u.hvm.pae,
+                          def->features & (1 << VIR_DOMAIN_FEATURE_PAE));
+        libxl_defbool_set(&b_info->u.hvm.apic,
+                          def->features & (1 << VIR_DOMAIN_FEATURE_APIC));
+        libxl_defbool_set(&b_info->u.hvm.acpi,
+                          def->features & (1 << VIR_DOMAIN_FEATURE_ACPI));
         for (i = 0; i < def->clock.ntimers; i++) {
             if (def->clock.timers[i]->name == VIR_DOMAIN_TIMER_NAME_HPET &&
                 def->clock.timers[i]->present == 1) {
-                b_info->u.hvm.hpet = 1;
+                libxl_defbool_set(&b_info->u.hvm.hpet, 1);
             }
         }
 
@@ -446,7 +457,7 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
          * 256 pages (1MB) per vcpu, plus 1 page per MiB of RAM for the P2M map,
          * plus 1 page per MiB of RAM to shadow the resident processes.
          */
-        b_info->shadow_memkb = 4 * (256 * b_info->cur_vcpus +
+        b_info->shadow_memkb = 4 * (256 * libxl_bitmap_count_set(&b_info->avail_vcpus) +
                                     2 * (b_info->max_memkb / 1024));
     } else {
         if (def->os.bootloader) {
@@ -456,10 +467,9 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
             }
         }
         if (def->os.bootloaderArgs) {
-            if ((b_info->u.pv.bootloader_args = strdup(def->os.bootloaderArgs)) == NULL) {
-                virReportOOMError();
+            if (!(b_info->u.pv.bootloader_args =
+                  virStringSplit(def->os.bootloaderArgs, " \t\n", 0)))
                 goto error;
-            }
         }
         if (def->os.cmdline) {
             if ((b_info->u.pv.cmdline = strdup(def->os.cmdline)) == NULL) {
@@ -469,14 +479,14 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
         }
         if (def->os.kernel) {
             /* libxl_init_build_info() sets kernel.path = strdup("hvmloader") */
-            VIR_FREE(b_info->kernel.path);
-            if ((b_info->kernel.path = strdup(def->os.kernel)) == NULL) {
+            VIR_FREE(b_info->u.pv.kernel);
+            if ((b_info->u.pv.kernel = strdup(def->os.kernel)) == NULL) {
                 virReportOOMError();
                 goto error;
             }
         }
         if (def->os.initrd) {
-            if ((b_info->u.pv.ramdisk.path = strdup(def->os.initrd)) == NULL) {
+            if ((b_info->u.pv.ramdisk = strdup(def->os.initrd)) == NULL) {
                 virReportOOMError();
                 goto error;
             }
@@ -486,13 +496,12 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
     return 0;
 
 error:
-    libxl_domain_build_info_destroy(b_info);
+    libxl_domain_build_info_dispose(b_info);
     return -1;
 }
 
 int
-libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
-              libxl_device_disk *x_disk)
+libxlMakeDisk(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk)
 {
     if (l_disk->src && (x_disk->pdev_path = strdup(l_disk->src)) == NULL) {
         virReportOOMError();
@@ -509,22 +518,22 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
             STREQ(l_disk->driverName, "tap2")) {
             switch (l_disk->format) {
             case VIR_STORAGE_FILE_QCOW:
-                x_disk->format = DISK_FORMAT_QCOW;
-                x_disk->backend = DISK_BACKEND_QDISK;
+                x_disk->format = LIBXL_DISK_FORMAT_QCOW;
+                x_disk->backend = LIBXL_DISK_BACKEND_QDISK;
                 break;
             case VIR_STORAGE_FILE_QCOW2:
-                x_disk->format = DISK_FORMAT_QCOW2;
-                x_disk->backend = DISK_BACKEND_QDISK;
+                x_disk->format = LIBXL_DISK_FORMAT_QCOW2;
+                x_disk->backend = LIBXL_DISK_BACKEND_QDISK;
                 break;
             case VIR_STORAGE_FILE_VHD:
-                x_disk->format = DISK_FORMAT_VHD;
-                x_disk->backend = DISK_BACKEND_TAP;
+                x_disk->format = LIBXL_DISK_FORMAT_VHD;
+                x_disk->backend = LIBXL_DISK_BACKEND_TAP;
                 break;
             case VIR_STORAGE_FILE_NONE:
                 /* No subtype specified, default to raw/tap */
             case VIR_STORAGE_FILE_RAW:
-                x_disk->format = DISK_FORMAT_RAW;
-                x_disk->backend = DISK_BACKEND_TAP;
+                x_disk->format = LIBXL_DISK_FORMAT_RAW;
+                x_disk->backend = LIBXL_DISK_BACKEND_TAP;
                 break;
             default:
                 virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -533,11 +542,11 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
                 return -1;
             }
         } else if (STREQ(l_disk->driverName, "file")) {
-            x_disk->format = DISK_FORMAT_RAW;
-            x_disk->backend = DISK_BACKEND_TAP;
+            x_disk->format = LIBXL_DISK_FORMAT_RAW;
+            x_disk->backend = LIBXL_DISK_BACKEND_TAP;
         } else if (STREQ(l_disk->driverName, "phy")) {
-            x_disk->format = DISK_FORMAT_RAW;
-            x_disk->backend = DISK_BACKEND_PHY;
+            x_disk->format = LIBXL_DISK_FORMAT_RAW;
+            x_disk->backend = LIBXL_DISK_BACKEND_PHY;
         } else {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("libxenlight does not support disk driver %s"),
@@ -546,12 +555,12 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
         }
     } else {
         /* No driverName - default to raw/tap?? */
-        x_disk->format = DISK_FORMAT_RAW;
-        x_disk->backend = DISK_BACKEND_TAP;
+        x_disk->format = LIBXL_DISK_FORMAT_RAW;
+        x_disk->backend = LIBXL_DISK_BACKEND_TAP;
     }
 
-    /* How to set unpluggable? */
-    x_disk->unpluggable = 1;
+    /* XXX is this right? */
+    x_disk->removable = 1;
     x_disk->readwrite = !l_disk->readonly;
     x_disk->is_cdrom = l_disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM ? 1 : 0;
     if (l_disk->transient) {
@@ -560,8 +569,6 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
         return -1;
     }
 
-    x_disk->domid = def->id;
-
     return 0;
 }
 
@@ -579,7 +586,7 @@ libxlMakeDiskList(virDomainDefPtr def, libxl_domain_config *d_config)
     }
 
     for (i = 0; i < ndisks; i++) {
-        if (libxlMakeDisk(def, l_disks[i], &x_disks[i]) < 0)
+        if (libxlMakeDisk(l_disks[i], &x_disks[i]) < 0)
             goto error;
     }
 
@@ -590,19 +597,19 @@ libxlMakeDiskList(virDomainDefPtr def, libxl_domain_config *d_config)
 
 error:
     for (i = 0; i < ndisks; i++)
-        libxl_device_disk_destroy(&x_disks[i]);
+        libxl_device_disk_dispose(&x_disks[i]);
     VIR_FREE(x_disks);
     return -1;
 }
 
 int
-libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
-             libxl_device_nic *x_nic)
+libxlMakeNic(virDomainNetDefPtr l_nic, libxl_device_nic *x_nic)
 {
-    // TODO: Where is mtu stored?
-    //x_nics[i].mtu = 1492;
+    /* TODO: Where is mtu stored?
+     *
+     * x_nics[i].mtu = 1492;
+     */
 
-    x_nic->domid = def->id;
     virMacAddrGetRaw(&l_nic->mac, x_nic->mac);
 
     if (l_nic->model && !STREQ(l_nic->model, "netfront")) {
@@ -610,9 +617,9 @@ libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
             virReportOOMError();
             return -1;
         }
-        x_nic->nictype = NICTYPE_IOEMU;
+        x_nic->nictype = LIBXL_NIC_TYPE_VIF_IOEMU;
     } else {
-        x_nic->nictype = NICTYPE_VIF;
+        x_nic->nictype = LIBXL_NIC_TYPE_VIF;
     }
 
     if (l_nic->ifname && (x_nic->ifname = strdup(l_nic->ifname)) == NULL) {
@@ -659,48 +666,49 @@ libxlMakeNicList(virDomainDefPtr def,  libxl_domain_config *d_config)
     for (i = 0; i < nnics; i++) {
         x_nics[i].devid = i;
 
-        if (libxlMakeNic(def, l_nics[i], &x_nics[i]))
+        if (libxlMakeNic(l_nics[i], &x_nics[i]))
             goto error;
     }
 
-    d_config->vifs = x_nics;
-    d_config->num_vifs = nnics;
+    d_config->nics = x_nics;
+    d_config->num_nics = nnics;
 
     return 0;
 
 error:
     for (i = 0; i < nnics; i++)
-        libxl_device_nic_destroy(&x_nics[i]);
+        libxl_device_nic_dispose(&x_nics[i]);
     VIR_FREE(x_nics);
     return -1;
 }
 
 int
-libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
-             virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb)
+libxlMakeVfb(libxlDriverPrivatePtr driver,
+             virDomainGraphicsDefPtr l_vfb,
+             libxl_device_vfb *x_vfb)
 {
     int port;
     const char *listenAddr;
 
     switch (l_vfb->type) {
         case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
-            x_vfb->sdl = 1;
+            libxl_defbool_set(&x_vfb->sdl.enable, 1);
             if (l_vfb->data.sdl.display &&
-                (x_vfb->display = strdup(l_vfb->data.sdl.display)) == NULL) {
+                (x_vfb->sdl.display = strdup(l_vfb->data.sdl.display)) == NULL) {
                 virReportOOMError();
                 return -1;
             }
             if (l_vfb->data.sdl.xauth &&
-                (x_vfb->xauthority =
+                (x_vfb->sdl.xauthority =
                     strdup(l_vfb->data.sdl.xauth)) == NULL) {
                 virReportOOMError();
                 return -1;
             }
             break;
         case  VIR_DOMAIN_GRAPHICS_TYPE_VNC:
-            x_vfb->vnc = 1;
+            libxl_defbool_set(&x_vfb->vnc.enable, 1);
             /* driver handles selection of free port */
-            x_vfb->vncunused = 0;
+            libxl_defbool_set(&x_vfb->vnc.findunused, 0);
             if (l_vfb->data.vnc.autoport) {
                 port = libxlNextFreeVncPort(driver, LIBXL_VNC_PORT_MIN);
                 if (port < 0) {
@@ -710,13 +718,13 @@ libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
                 }
                 l_vfb->data.vnc.port = port;
             }
-            x_vfb->vncdisplay = l_vfb->data.vnc.port - LIBXL_VNC_PORT_MIN;
+            x_vfb->vnc.display = l_vfb->data.vnc.port - LIBXL_VNC_PORT_MIN;
 
             listenAddr = virDomainGraphicsListenGetAddress(l_vfb, 0);
             if (listenAddr) {
                 /* libxl_device_vfb_init() does strdup("127.0.0.1") */
-                VIR_FREE(x_vfb->vnclisten);
-                if ((x_vfb->vnclisten = strdup(listenAddr)) == NULL) {
+                VIR_FREE(x_vfb->vnc.listen);
+                if ((x_vfb->vnc.listen = strdup(listenAddr)) == NULL) {
                     virReportOOMError();
                     return -1;
                 }
@@ -729,13 +737,14 @@ libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
             }
             break;
     }
-    x_vfb->domid = def->id;
+
     return 0;
 }
 
 static int
 libxlMakeVfbList(libxlDriverPrivatePtr driver,
-                 virDomainDefPtr def, libxl_domain_config *d_config)
+                 virDomainDefPtr def,
+                 libxl_domain_config *d_config)
 {
     virDomainGraphicsDefPtr *l_vfbs = def->graphics;
     int nvfbs = def->ngraphics;
@@ -757,10 +766,10 @@ libxlMakeVfbList(libxlDriverPrivatePtr driver,
     }
 
     for (i = 0; i < nvfbs; i++) {
-        libxl_device_vfb_init(&x_vfbs[i], i);
-        libxl_device_vkb_init(&x_vkbs[i], i);
+        libxl_device_vfb_init(&x_vfbs[i]);
+        libxl_device_vkb_init(&x_vkbs[i]);
 
-        if (libxlMakeVfb(driver, def, l_vfbs[i], &x_vfbs[i]) < 0)
+        if (libxlMakeVfb(driver, l_vfbs[i], &x_vfbs[i]) < 0)
             goto error;
     }
 
@@ -772,148 +781,14 @@ libxlMakeVfbList(libxlDriverPrivatePtr driver,
 
 error:
     for (i = 0; i < nvfbs; i++) {
-        libxl_device_vfb_destroy(&x_vfbs[i]);
-        libxl_device_vkb_destroy(&x_vkbs[i]);
+        libxl_device_vfb_dispose(&x_vfbs[i]);
+        libxl_device_vkb_dispose(&x_vkbs[i]);
     }
     VIR_FREE(x_vfbs);
     VIR_FREE(x_vkbs);
     return -1;
 }
 
-static int
-libxlMakeChrdevStr(virDomainChrDefPtr def, char **buf)
-{
-    const char *type = virDomainChrTypeToString(def->source.type);
-
-    if (!type) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       "%s", _("unexpected chr device type"));
-        return -1;
-    }
-
-    switch (def->source.type) {
-        case VIR_DOMAIN_CHR_TYPE_NULL:
-        case VIR_DOMAIN_CHR_TYPE_STDIO:
-        case VIR_DOMAIN_CHR_TYPE_VC:
-        case VIR_DOMAIN_CHR_TYPE_PTY:
-            if (virAsprintf(buf, "%s", type) < 0) {
-                virReportOOMError();
-                return -1;
-            }
-            break;
-
-        case VIR_DOMAIN_CHR_TYPE_FILE:
-        case VIR_DOMAIN_CHR_TYPE_PIPE:
-            if (virAsprintf(buf, "%s:%s", type,
-                            def->source.data.file.path) < 0) {
-                virReportOOMError();
-                return -1;
-            }
-            break;
-
-        case VIR_DOMAIN_CHR_TYPE_DEV:
-            if (virAsprintf(buf, "%s", def->source.data.file.path) < 0) {
-                virReportOOMError();
-                return -1;
-            }
-            break;
-    }
-
-    return 0;
-}
-
-static int
-libxlMakeDeviceModelInfo(virDomainDefPtr def, libxl_domain_config *d_config)
-{
-    libxl_device_model_info *dm_info = &d_config->dm_info;
-    int i;
-    char b_order[VIR_DOMAIN_BOOT_LAST+1];
-
-    libxl_init_dm_info(dm_info, &d_config->c_info, &d_config->b_info);
-
-    if (d_config->b_info.hvm) {
-        /* HVM-specific device model info */
-        dm_info->type = XENFV;
-        if (def->os.nBootDevs > 0) {
-            VIR_FREE(dm_info->boot);
-            for (i = 0; i < def->os.nBootDevs; i++) {
-                switch (def->os.bootDevs[i]) {
-                    case VIR_DOMAIN_BOOT_FLOPPY:
-                        b_order[i] = 'a';
-                        break;
-                    default:
-                    case VIR_DOMAIN_BOOT_DISK:
-                        b_order[i] = 'c';
-                        break;
-                    case VIR_DOMAIN_BOOT_CDROM:
-                        b_order[i] = 'd';
-                        break;
-                    case VIR_DOMAIN_BOOT_NET:
-                        b_order[i] = 'n';
-                        break;
-                }
-            }
-            b_order[def->os.nBootDevs] = '\0';
-            if ((dm_info->boot = strdup(b_order)) == NULL) {
-                virReportOOMError();
-                goto error;
-            }
-        }
-        if (def->serials &&
-            (libxlMakeChrdevStr(def->serials[0], &dm_info->serial) < 0))
-            goto error;
-    } else {
-        /* PV-specific device model info */
-        dm_info->type = XENPV;
-    }
-
-    /* Build qemu graphics options from previously parsed vfb */
-    if (d_config->num_vfbs > 0) {
-        if (d_config->vfbs[0].vnc) {
-            dm_info->vnc = 1;
-            /* driver handles selection of free port */
-            dm_info->vncunused = 0;
-            if (d_config->vfbs[0].vnclisten) {
-                VIR_FREE(dm_info->vnclisten);
-                if ((dm_info->vnclisten =
-                     strdup(d_config->vfbs[0].vnclisten)) == NULL) {
-                    virReportOOMError();
-                    goto error;
-                }
-            }
-            if (d_config->vfbs[0].keymap &&
-                (dm_info->keymap = strdup(d_config->vfbs[0].keymap)) == NULL) {
-                virReportOOMError();
-                goto error;
-            }
-            dm_info->vncdisplay = d_config->vfbs[0].vncdisplay;
-            if (d_config->vfbs[0].vncpasswd &&
-                (dm_info->vncpasswd =
-                 strdup(d_config->vfbs[0].vncpasswd)) == NULL) {
-                virReportOOMError();
-                goto error;
-            }
-        } else if (d_config->vfbs[0].sdl) {
-            dm_info->sdl = 1;
-            dm_info->vnc = 0;
-        }
-    } else if (d_config->num_vfbs == 0) {
-        dm_info->nographic = 1;
-        dm_info->vnc = 0;
-    }
-
-    // TODO
-    //dm_info->usb = ;
-    //dm_info->usbdevice = ;
-    //dm_info->soundhw = ;
-
-    return 0;
-
-error:
-    libxl_device_model_info_destroy(dm_info);
-    return -1;
-}
-
 virCapsPtr
 libxlMakeCapabilities(libxl_ctx *ctx)
 {
@@ -947,7 +822,7 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
                        virDomainDefPtr def, libxl_domain_config *d_config)
 {
 
-    if (libxlMakeDomCreateInfo(def, &d_config->c_info) < 0)
+    if (libxlMakeDomCreateInfo(driver, def, &d_config->c_info) < 0)
         return -1;
 
     if (libxlMakeDomBuildInfo(def, d_config) < 0) {
@@ -966,10 +841,6 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
         goto error;
     }
 
-    if (libxlMakeDeviceModelInfo(def, d_config) < 0) {
-        goto error;
-    }
-
     d_config->on_reboot = def->onReboot;
     d_config->on_poweroff = def->onPoweroff;
     d_config->on_crash = def->onCrash;
@@ -977,6 +848,6 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
     return 0;
 
 error:
-    libxl_domain_config_destroy(d_config);
+    libxl_domain_config_dispose(d_config);
     return -1;
 }
diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
index 56bf85c..8b5a9e9 100644
--- a/src/libxl/libxl_conf.h
+++ b/src/libxl/libxl_conf.h
@@ -58,7 +58,7 @@ struct _libxlDriverPrivate {
     FILE *logger_file;
     xentoollog_logger *logger;
     /* libxl ctx for driver wide ops; getVersion, getNodeInfo, ... */
-    libxl_ctx ctx;
+    libxl_ctx *ctx;
 
     virBitmapPtr reservedVNCPorts;
     virDomainObjList domains;
@@ -77,10 +77,8 @@ typedef struct _libxlDomainObjPrivate libxlDomainObjPrivate;
 typedef libxlDomainObjPrivate *libxlDomainObjPrivatePtr;
 struct _libxlDomainObjPrivate {
     /* per domain libxl ctx */
-    libxl_ctx ctx;
-    libxl_waiter *dWaiter;
-    int waiterFD;
-    int eventHdl;
+    libxl_ctx *ctx;
+    libxl_evgen_domain_death *deathW;
 };
 
 # define LIBXL_SAVE_MAGIC "libvirt-xml\n \0 \r"
@@ -100,13 +98,11 @@ virCapsPtr
 libxlMakeCapabilities(libxl_ctx *ctx);
 
 int
-libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_dev,
-              libxl_device_disk *x_dev);
+libxlMakeDisk(virDomainDiskDefPtr l_dev, libxl_device_disk *x_dev);
 int
-libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
-             libxl_device_nic *x_nic);
+libxlMakeNic(virDomainNetDefPtr l_nic, libxl_device_nic *x_nic);
 int
-libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
+libxlMakeVfb(libxlDriverPrivatePtr driver,
              virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb);
 
 int
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index ae4451a..44d0781 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -40,6 +40,7 @@
 #include "memory.h"
 #include "uuid.h"
 #include "command.h"
+#include "libxl.h"
 #include "libxl_driver.h"
 #include "libxl_conf.h"
 #include "xen_xm.h"
@@ -59,6 +60,19 @@
 /* Number of Xen scheduler parameters */
 #define XEN_SCHED_CREDIT_NPARAM   2
 
+struct libxlOSEventHookFDInfo {
+    libxlDomainObjPrivatePtr priv;
+    void *xl_priv;
+    int watch;
+};
+
+struct libxlOSEventHookTimerInfo {
+    libxlDomainObjPrivatePtr priv;
+    void *xl_priv;
+    int id;
+};
+
+
 static void libxlDomainManagedSaveLoad(void *payload,
                                        const void *n ATTRIBUTE_UNUSED,
                                        void *opaque);
@@ -84,6 +98,163 @@ libxlDriverUnlock(libxlDriverPrivatePtr driver)
     virMutexUnlock(&driver->lock);
 }
 
+
+static void libxlFDEventCallback(int watch ATTRIBUTE_UNUSED,
+                                 int fd,
+                                 int vir_events,
+                                 void *fdinfo)
+{
+    struct libxlOSEventHookFDInfo *info = fdinfo;
+    int events = 0;
+
+    if (vir_events & VIR_EVENT_HANDLE_READABLE)
+        events |= POLLIN;
+    if (vir_events & VIR_EVENT_HANDLE_WRITABLE)
+        events |= POLLOUT;
+    if (vir_events & VIR_EVENT_HANDLE_ERROR)
+        events |= POLLERR;
+    if (vir_events & VIR_EVENT_HANDLE_HANGUP)
+        events |= POLLHUP;
+
+    libxl_osevent_occurred_fd(info->priv->ctx, info->xl_priv, fd, 0, events);
+}
+
+static void libxlFreeFDInfo(void *obj)
+{
+    VIR_FREE(obj);
+}
+
+static int libxlFDRegisterEventHook(void *priv, int fd, void **hndp,
+                                    short events, void *xl_priv)
+{
+    int vir_events = VIR_EVENT_HANDLE_ERROR;
+    struct libxlOSEventHookFDInfo *fdinfo;
+
+    if (VIR_ALLOC(fdinfo) < 0) {
+        virReportOOMError();
+        return -1;
+    }
+
+    fdinfo->priv = priv;
+    fdinfo->xl_priv = xl_priv;
+    *hndp = fdinfo;
+
+    if (events & POLLIN)
+        vir_events |= VIR_EVENT_HANDLE_READABLE;
+    if (events & POLLOUT)
+        vir_events |= VIR_EVENT_HANDLE_WRITABLE;
+    fdinfo->watch = virEventAddHandle(fd, vir_events, libxlFDEventCallback,
+                                      fdinfo, libxlFreeFDInfo);
+    if (fdinfo->watch < 0) {
+        VIR_FREE(fdinfo);
+        return fdinfo->watch;
+    }
+
+    return 0;
+}
+
+static int libxlFDModifyEventHook(void *priv ATTRIBUTE_UNUSED,
+                                  int fd ATTRIBUTE_UNUSED,
+                                  void **hndp,
+                                  short events)
+{
+    struct libxlOSEventHookFDInfo *fdinfo = *hndp;
+    int vir_events = VIR_EVENT_HANDLE_ERROR;
+
+    if (events & POLLIN)
+        vir_events |= VIR_EVENT_HANDLE_READABLE;
+    if (events & POLLOUT)
+        vir_events |= VIR_EVENT_HANDLE_WRITABLE;
+
+    virEventUpdateHandle(fdinfo->watch, vir_events);
+    return 0;
+}
+
+static void libxlFDDeregisterEventHook(void *priv ATTRIBUTE_UNUSED,
+                                       int fd ATTRIBUTE_UNUSED,
+                                       void *hnd)
+{
+    struct libxlOSEventHookFDInfo *fdinfo = hnd;
+
+    virEventRemoveHandle(fdinfo->watch);
+}
+
+
+static void libxlTimerCallback(int timer ATTRIBUTE_UNUSED, void *timer_v)
+{
+    struct libxlOSEventHookTimerInfo *timer_info = timer_v;
+
+    libxl_osevent_occurred_timeout(timer_info->priv->ctx, timer_info->xl_priv);
+}
+
+static void libxlTimerInfoFree(void* obj)
+{
+    VIR_FREE(obj);
+}
+
+static int libxlTimeoutRegisterEventHook(void *priv,
+                                         void **hndp,
+                                         struct timeval abs_t,
+                                         void *for_libxl)
+{
+    struct timeval now;
+    struct libxlOSEventHookTimerInfo *timer_info;
+    int timeout, timer_id;
+
+    if (VIR_ALLOC(timer_info) < 0) {
+        virReportOOMError();
+        return -1;
+    }
+
+    gettimeofday(&now, NULL);
+    timeout = (abs_t.tv_usec - now.tv_usec) / 1000;
+    timeout += (abs_t.tv_sec - now.tv_sec) * 1000;
+    timer_id = virEventAddTimeout(timeout, libxlTimerCallback,
+                                  timer_info, libxlTimerInfoFree);
+    if (timer_id < 0) {
+        VIR_FREE(timer_info);
+        return timer_id;
+    }
+
+    timer_info->priv = priv;
+    timer_info->xl_priv = for_libxl;
+    timer_info->id = timer_id;
+    *hndp = timer_info;
+    return 0;
+}
+
+static int libxlTimeoutModifyEventHook(void *priv ATTRIBUTE_UNUSED,
+                                       void **hndp,
+                                       struct timeval abs_t)
+{
+    struct timeval now;
+    int timeout;
+    struct libxlOSEventHookTimerInfo *timer_info = *hndp;
+
+    gettimeofday(&now, NULL);
+    timeout = (abs_t.tv_usec - now.tv_usec) / 1000;
+    timeout += (abs_t.tv_sec - now.tv_sec) * 1000;
+    virEventUpdateTimeout(timer_info->id, timeout);
+    return 0;
+}
+
+static void libxlTimeoutDeregisterEventHook(void *priv ATTRIBUTE_UNUSED,
+                                            void *hnd)
+{
+    struct libxlOSEventHookTimerInfo *timer_info = hnd;
+
+    virEventRemoveTimeout(timer_info->id);
+}
+
+static const libxl_osevent_hooks libxl_event_callbacks = {
+    .fd_register = libxlFDRegisterEventHook,
+    .fd_modify = libxlFDModifyEventHook,
+    .fd_deregister = libxlFDDeregisterEventHook,
+    .timeout_register = libxlTimeoutRegisterEventHook,
+    .timeout_modify = libxlTimeoutModifyEventHook,
+    .timeout_deregister = libxlTimeoutDeregisterEventHook,
+};
+
 static void *
 libxlDomainObjPrivateAlloc(void)
 {
@@ -92,9 +263,9 @@ libxlDomainObjPrivateAlloc(void)
     if (VIR_ALLOC(priv) < 0)
         return NULL;
 
-    libxl_ctx_init(&priv->ctx, LIBXL_VERSION, libxl_driver->logger);
-    priv->waiterFD = -1;
-    priv->eventHdl = -1;
+    libxl_ctx_alloc(&priv->ctx, LIBXL_VERSION, 0, libxl_driver->logger);
+    priv->deathW = NULL;
+    libxl_osevent_register_hooks(priv->ctx, &libxl_event_callbacks, priv);
 
     return priv;
 }
@@ -104,16 +275,12 @@ libxlDomainObjPrivateFree(void *data)
 {
     libxlDomainObjPrivatePtr priv = data;
 
-    if (priv->eventHdl >= 0)
-        virEventRemoveHandle(priv->eventHdl);
-
-    if (priv->dWaiter) {
-        libxl_stop_waiting(&priv->ctx, priv->dWaiter);
-        libxl_free_waiter(priv->dWaiter);
-        VIR_FREE(priv->dWaiter);
+    if (priv->deathW) {
+        libxl_evdisable_domain_death(priv->ctx, priv->deathW);
+        VIR_FREE(priv->deathW);
     }
 
-    libxl_ctx_free(&priv->ctx);
+    libxl_ctx_free(priv->ctx);
     VIR_FREE(priv);
 }
 
@@ -125,17 +292,6 @@ libxlDomainEventQueue(libxlDriverPrivatePtr driver, virDomainEventPtr event)
     virDomainEventStateQueue(driver->domainEventState, event);
 }
 
-/*
- * Remove reference to domain object.
- */
-static void
-libxlDomainObjUnref(void *data)
-{
-    virDomainObjPtr vm = data;
-
-    virObjectUnref(vm);
-}
-
 static void
 libxlAutostartDomain(void *payload, const void *name ATTRIBUTE_UNUSED,
                      void *opaque)
@@ -166,13 +322,13 @@ libxlDoNodeGetInfo(libxlDriverPrivatePtr driver, virNodeInfoPtr info)
     const libxl_version_info* ver_info;
     struct utsname utsname;
 
-    if (libxl_get_physinfo(&driver->ctx, &phy_info)) {
+    if (libxl_get_physinfo(driver->ctx, &phy_info)) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxl_get_physinfo_info failed"));
         return -1;
     }
 
-    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxl_get_version_info failed"));
         return -1;
@@ -296,15 +452,9 @@ libxlVmCleanup(libxlDriverPrivatePtr driver,
     char *file;
     int i;
 
-    if (priv->eventHdl >= 0) {
-        virEventRemoveHandle(priv->eventHdl);
-        priv->eventHdl = -1;
-    }
-
-    if (priv->dWaiter) {
-        libxl_stop_waiting(&priv->ctx, priv->dWaiter);
-        libxl_free_waiter(priv->dWaiter);
-        VIR_FREE(priv->dWaiter);
+    if (priv->deathW) {
+        libxl_evdisable_domain_death(priv->ctx, priv->deathW);
+        priv->deathW = NULL;
     }
 
     if (vm->persistent) {
@@ -355,12 +505,11 @@ libxlVmCleanup(libxlDriverPrivatePtr driver,
 static int
 libxlVmReap(libxlDriverPrivatePtr driver,
             virDomainObjPtr vm,
-            int force,
             virDomainShutoffReason reason)
 {
     libxlDomainObjPrivatePtr priv = vm->privateData;
 
-    if (libxl_domain_destroy(&priv->ctx, vm->def->id, force) < 0) {
+    if (libxl_domain_destroy(priv->ctx, vm->def->id, NULL) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Unable to cleanup domain %d"), vm->def->id);
         return -1;
@@ -373,56 +522,26 @@ libxlVmReap(libxlDriverPrivatePtr driver,
 /*
  * Handle previously registered event notification from libxenlight
  */
-static void libxlEventHandler(int watch,
-                              int fd,
-                              int events,
-                              void *data)
+static void libxlEventHandler(void *data, const libxl_event *event)
 {
     libxlDriverPrivatePtr driver = libxl_driver;
     virDomainObjPtr vm = data;
-    libxlDomainObjPrivatePtr priv;
     virDomainEventPtr dom_event = NULL;
-    libxl_event event;
-    libxl_dominfo info;
 
     libxlDriverLock(driver);
     virDomainObjLock(vm);
     libxlDriverUnlock(driver);
 
-    priv = vm->privateData;
-
-    memset(&event, 0, sizeof(event));
-    memset(&info, 0, sizeof(info));
-
-    if (priv->waiterFD != fd || priv->eventHdl != watch) {
-        virEventRemoveHandle(watch);
-        priv->eventHdl = -1;
-        goto cleanup;
-    }
-
-    if (!(events & VIR_EVENT_HANDLE_READABLE))
-        goto cleanup;
-
-    if (libxl_get_event(&priv->ctx, &event))
-        goto cleanup;
-
-    if (event.type == LIBXL_EVENT_DOMAIN_DEATH) {
+    if (event->type == LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN) {
         virDomainShutoffReason reason;
 
-        /* libxl_event_get_domain_death_info returns 1 if death
-         * event was for this domid */
-        if (libxl_event_get_domain_death_info(&priv->ctx,
-                                              vm->def->id,
-                                              &event,
-                                              &info) != 1)
+        if (event->domid != vm->def->id)
             goto cleanup;
 
-        virEventRemoveHandle(watch);
-        priv->eventHdl = -1;
-        switch (info.shutdown_reason) {
-            case SHUTDOWN_poweroff:
-            case SHUTDOWN_crash:
-                if (info.shutdown_reason == SHUTDOWN_crash) {
+        switch (event->u.domain_shutdown.shutdown_reason) {
+            case LIBXL_SHUTDOWN_REASON_POWEROFF:
+            case LIBXL_SHUTDOWN_REASON_CRASH:
+                if (event->u.domain_shutdown.shutdown_reason == LIBXL_SHUTDOWN_REASON_CRASH) {
                     dom_event = virDomainEventNewFromObj(vm,
                                               VIR_DOMAIN_EVENT_STOPPED,
                                               VIR_DOMAIN_EVENT_STOPPED_CRASHED);
@@ -430,18 +549,18 @@ static void libxlEventHandler(int watch,
                 } else {
                     reason = VIR_DOMAIN_SHUTOFF_SHUTDOWN;
                 }
-                libxlVmReap(driver, vm, 0, reason);
+                libxlVmReap(driver, vm, reason);
                 if (!vm->persistent) {
                     virDomainRemoveInactive(&driver->domains, vm);
                     vm = NULL;
                 }
                 break;
-            case SHUTDOWN_reboot:
-                libxlVmReap(driver, vm, 0, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
+            case LIBXL_SHUTDOWN_REASON_REBOOT:
+                libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
                 libxlVmStart(driver, vm, 0, -1);
                 break;
             default:
-                VIR_INFO("Unhandled shutdown_reason %d", info.shutdown_reason);
+                VIR_INFO("Unhandled shutdown_reason %d", event->u.domain_shutdown.shutdown_reason);
                 break;
         }
     }
@@ -454,9 +573,14 @@ cleanup:
         libxlDomainEventQueue(driver, dom_event);
         libxlDriverUnlock(driver);
     }
-    libxl_free_event(&event);
 }
 
+static const struct libxl_event_hooks ev_hooks = {
+    .event_occurs_mask = LIBXL_EVENTMASK_ALL,
+    .event_occurs = libxlEventHandler,
+    .disaster = NULL,
+};
+
 /*
  * Register domain events with libxenlight and insert event handles
  * in libvirt's event loop.
@@ -465,40 +589,18 @@ static int
 libxlCreateDomEvents(virDomainObjPtr vm)
 {
     libxlDomainObjPrivatePtr priv = vm->privateData;
-    int fd;
 
-    if (VIR_ALLOC(priv->dWaiter) < 0) {
-        virReportOOMError();
-        return -1;
-    }
-
-    if (libxl_wait_for_domain_death(&priv->ctx, vm->def->id, priv->dWaiter))
-        goto error;
-
-    libxl_get_wait_fd(&priv->ctx, &fd);
-    if (fd < 0)
-        goto error;
+    libxl_event_register_callbacks(priv->ctx, &ev_hooks, vm);
 
-    priv->waiterFD = fd;
-    /* Add a reference to the domain object while it is injected in
-     * the event loop.
-     */
-    virObjectRef(vm);
-    if ((priv->eventHdl = virEventAddHandle(
-             fd,
-             VIR_EVENT_HANDLE_READABLE | VIR_EVENT_HANDLE_ERROR,
-             libxlEventHandler,
-             vm, libxlDomainObjUnref)) < 0) {
-        virObjectUnref(vm);
+    if (libxl_evenable_domain_death(priv->ctx, vm->def->id, 0, &priv->deathW))
         goto error;
-    }
 
     return 0;
 
 error:
-    libxl_free_waiter(priv->dWaiter);
-    VIR_FREE(priv->dWaiter);
-    priv->eventHdl = -1;
+    if (priv->deathW)
+        libxl_evdisable_domain_death(priv->ctx, priv->deathW);
+    VIR_FREE(priv->deathW);
     return -1;
 }
 
@@ -507,7 +609,7 @@ libxlDomainSetVcpuAffinites(libxlDriverPrivatePtr driver, virDomainObjPtr vm)
 {
     libxlDomainObjPrivatePtr priv = vm->privateData;
     virDomainDefPtr def = vm->def;
-    libxl_cpumap map;
+    libxl_bitmap map;
     uint8_t *cpumask = NULL;
     uint8_t *cpumap = NULL;
     virNodeInfo nodeinfo;
@@ -539,7 +641,7 @@ libxlDomainSetVcpuAffinites(libxlDriverPrivatePtr driver, virDomainObjPtr vm)
         map.size = cpumaplen;
         map.map = cpumap;
 
-        if (libxl_set_vcpuaffinity(&priv->ctx, def->id, vcpu, &map) != 0) {
+        if (libxl_set_vcpuaffinity(priv->ctx, def->id, vcpu, &map) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to pin vcpu '%d' with libxenlight"), vcpu);
             goto cleanup;
@@ -565,11 +667,10 @@ libxlFreeMem(libxlDomainObjPrivatePtr priv, libxl_domain_config *d_config)
     int tries = 3;
     int wait_secs = 10;
 
-    if ((ret = libxl_domain_need_memory(&priv->ctx, &d_config->b_info,
-                                        &d_config->dm_info,
+    if ((ret = libxl_domain_need_memory(priv->ctx, &d_config->b_info,
                                         &needed_mem)) >= 0) {
         for (i = 0; i < tries; ++i) {
-            if ((ret = libxl_get_free_memory(&priv->ctx, &free_mem)) < 0)
+            if ((ret = libxl_get_free_memory(priv->ctx, &free_mem)) < 0)
                 break;
 
             if (free_mem >= needed_mem) {
@@ -577,17 +678,17 @@ libxlFreeMem(libxlDomainObjPrivatePtr priv, libxl_domain_config *d_config)
                 break;
             }
 
-            if ((ret = libxl_set_memory_target(&priv->ctx, 0,
+            if ((ret = libxl_set_memory_target(priv->ctx, 0,
                                                free_mem - needed_mem,
                                                /* relative */ 1, 0)) < 0)
                 break;
 
-            ret = libxl_wait_for_free_memory(&priv->ctx, 0, needed_mem,
+            ret = libxl_wait_for_free_memory(priv->ctx, 0, needed_mem,
                                              wait_secs);
             if (ret == 0 || ret != ERROR_NOMEM)
                 break;
 
-            if ((ret = libxl_wait_for_memory_target(&priv->ctx, 0, 1)) < 0)
+            if ((ret = libxl_wait_for_memory_target(priv->ctx, 0, 1)) < 0)
                 break;
         }
     }
@@ -613,7 +714,6 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
     char *dom_xml = NULL;
     char *managed_save_path = NULL;
     int managed_save_fd = -1;
-    pid_t child_console_pid = -1;
     libxlDomainObjPrivatePtr priv = vm->privateData;
 
     /* If there is a managed saved state restore it instead of starting
@@ -657,7 +757,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         VIR_FREE(managed_save_path);
     }
 
-    memset(&d_config, 0, sizeof(d_config));
+    libxl_domain_config_init(&d_config);
 
     if (libxlBuildDomainConfig(driver, vm->def, &d_config) < 0)
         return -1;
@@ -669,13 +769,14 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         goto error;
     }
 
+    /* use as synchronous operations => ao_how = NULL and no intermediate reports => ao_progress = NULL */
+
     if (restore_fd < 0)
-        ret = libxl_domain_create_new(&priv->ctx, &d_config,
-                                      NULL, &child_console_pid, &domid);
+        ret = libxl_domain_create_new(priv->ctx, &d_config,
+                                      &domid, NULL, NULL);
     else
-        ret = libxl_domain_create_restore(&priv->ctx, &d_config, NULL,
-                                          &child_console_pid, &domid,
-                                          restore_fd);
+        ret = libxl_domain_create_restore(priv->ctx, &d_config, &domid,
+                                          restore_fd, NULL, NULL);
 
     if (ret) {
         if (restore_fd < 0)
@@ -693,7 +794,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
     if ((dom_xml = virDomainDefFormat(vm->def, 0)) == NULL)
         goto error;
 
-    if (libxl_userdata_store(&priv->ctx, domid, "libvirt-xml",
+    if (libxl_userdata_store(priv->ctx, domid, "libvirt-xml",
                              (uint8_t *)dom_xml, strlen(dom_xml) + 1)) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxenlight failed to store userdata"));
@@ -707,7 +808,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         goto error;
 
     if (!start_paused) {
-        libxl_domain_unpause(&priv->ctx, domid);
+        libxl_domain_unpause(priv->ctx, domid);
         virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_BOOTED);
     } else {
         virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER);
@@ -723,18 +824,18 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
                                          VIR_DOMAIN_EVENT_STARTED_RESTORED);
     libxlDomainEventQueue(driver, event);
 
-    libxl_domain_config_destroy(&d_config);
+    libxl_domain_config_dispose(&d_config);
     VIR_FREE(dom_xml);
     VIR_FORCE_CLOSE(managed_save_fd);
     return 0;
 
 error:
     if (domid > 0) {
-        libxl_domain_destroy(&priv->ctx, domid, 0);
+        libxl_domain_destroy(priv->ctx, domid, NULL);
         vm->def->id = -1;
         virDomainObjSetState(vm, VIR_DOMAIN_SHUTOFF, VIR_DOMAIN_SHUTOFF_FAILED);
     }
-    libxl_domain_config_destroy(&d_config);
+    libxl_domain_config_dispose(&d_config);
     VIR_FREE(dom_xml);
     VIR_FREE(managed_save_path);
     virDomainDefFree(def);
@@ -762,7 +863,7 @@ libxlReconnectDomain(void *payload,
     virDomainObjLock(vm);
 
     /* Does domain still exist? */
-    rc = libxl_domain_info(&driver->ctx, &d_info, vm->def->id);
+    rc = libxl_domain_info(driver->ctx, &d_info, vm->def->id);
     if (rc == ERROR_INVAL) {
         goto out;
     } else if (rc != 0) {
@@ -772,7 +873,7 @@ libxlReconnectDomain(void *payload,
     }
 
     /* Is this a domain that was under libvirt control? */
-    if (libxl_userdata_retrieve(&driver->ctx, vm->def->id,
+    if (libxl_userdata_retrieve(driver->ctx, vm->def->id,
                                 "libvirt-xml", &data, &len)) {
         VIR_DEBUG("libxl_userdata_retrieve failed, ignoring domain %d", vm->def->id);
         goto out;
@@ -810,7 +911,7 @@ libxlShutdown(void)
     libxlDriverLock(libxl_driver);
     virCapabilitiesFree(libxl_driver->caps);
     virDomainObjListDeinit(&libxl_driver->domains);
-    libxl_ctx_free(&libxl_driver->ctx);
+    libxl_ctx_free(libxl_driver->ctx);
     xtl_logger_destroy(libxl_driver->logger);
     if (libxl_driver->logger_file)
         VIR_FORCE_FCLOSE(libxl_driver->logger_file);
@@ -943,14 +1044,14 @@ libxlStartup(bool privileged) {
         goto fail;
     }
 
-    if (libxl_ctx_init(&libxl_driver->ctx,
-                       LIBXL_VERSION,
+    if (libxl_ctx_alloc(&libxl_driver->ctx,
+                       LIBXL_VERSION, 0,
                        libxl_driver->logger)) {
         VIR_INFO("cannot initialize libxenlight context, probably not running in a Xen Dom0, disabling driver");
         goto fail;
     }
 
-    if ((ver_info = libxl_get_version_info(&libxl_driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(libxl_driver->ctx)) == NULL) {
         VIR_INFO("cannot version information from libxenlight, disabling driver");
         goto fail;
     }
@@ -958,7 +1059,7 @@ libxlStartup(bool privileged) {
             (ver_info->xen_version_minor * 1000);
 
     if ((libxl_driver->caps =
-         libxlMakeCapabilities(&libxl_driver->ctx)) == NULL) {
+         libxlMakeCapabilities(libxl_driver->ctx)) == NULL) {
         VIR_ERROR(_("cannot create capabilities for libxenlight"));
         goto error;
     }
@@ -1115,7 +1216,7 @@ libxlGetMaxVcpus(virConnectPtr conn, const char *type ATTRIBUTE_UNUSED)
     int ret;
     libxlDriverPrivatePtr driver = conn->privateData;
 
-    ret = libxl_get_max_cpus(&driver->ctx);
+    ret = libxl_get_max_cpus(driver->ctx);
     /* libxl_get_max_cpus() will return 0 if there were any failures,
        e.g. xc_physinfo() failing */
     if (ret == 0)
@@ -1320,7 +1421,7 @@ libxlDomainSuspend(virDomainPtr dom)
     priv = vm->privateData;
 
     if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_PAUSED) {
-        if (libxl_domain_pause(&priv->ctx, dom->id) != 0) {
+        if (libxl_domain_pause(priv->ctx, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to suspend domain '%d' with libxenlight"),
                            dom->id);
@@ -1379,7 +1480,7 @@ libxlDomainResume(virDomainPtr dom)
     priv = vm->privateData;
 
     if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
-        if (libxl_domain_unpause(&priv->ctx, dom->id) != 0) {
+        if (libxl_domain_unpause(priv->ctx, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to resume domain '%d' with libxenlight"),
                            dom->id);
@@ -1436,7 +1537,7 @@ libxlDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
     }
 
     priv = vm->privateData;
-    if (libxl_domain_shutdown(&priv->ctx, dom->id, LIBXL_DOM_REQ_POWEROFF) != 0) {
+    if (libxl_domain_shutdown(priv->ctx, dom->id) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to shutdown domain '%d' with libxenlight"),
                        dom->id);
@@ -1489,7 +1590,7 @@ libxlDomainReboot(virDomainPtr dom, unsigned int flags)
     }
 
     priv = vm->privateData;
-    if (libxl_domain_shutdown(&priv->ctx, dom->id, LIBXL_DOM_REQ_REBOOT) != 0) {
+    if (libxl_domain_reboot(priv->ctx, dom->id) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to reboot domain '%d' with libxenlight"),
                        dom->id);
@@ -1534,7 +1635,7 @@ libxlDomainDestroyFlags(virDomainPtr dom,
     event = virDomainEventNewFromObj(vm,VIR_DOMAIN_EVENT_STOPPED,
                                      VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
 
-    if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_DESTROYED) != 0) {
+    if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to destroy domain '%d'"), dom->id);
         goto cleanup;
@@ -1672,7 +1773,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
 
         if (flags & VIR_DOMAIN_MEM_LIVE) {
             priv = vm->privateData;
-            if (libxl_domain_setmaxmem(&priv->ctx, dom->id, newmem) < 0) {
+            if (libxl_domain_setmaxmem(priv->ctx, dom->id, newmem) < 0) {
                 virReportError(VIR_ERR_INTERNAL_ERROR,
                                _("Failed to set maximum memory for domain '%d'"
                                  " with libxenlight"), dom->id);
@@ -1701,7 +1802,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
 
         if (flags & VIR_DOMAIN_MEM_LIVE) {
             priv = vm->privateData;
-            if (libxl_set_memory_target(&priv->ctx, dom->id, newmem, 0,
+            if (libxl_set_memory_target(priv->ctx, dom->id, newmem, 0,
                                         /* force */ 1) < 0) {
                 virReportError(VIR_ERR_INTERNAL_ERROR,
                                _("Failed to set memory for domain '%d'"
@@ -1761,7 +1862,7 @@ libxlDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info)
         info->memory = vm->def->mem.cur_balloon;
         info->maxMem = vm->def->mem.max_balloon;
     } else {
-        if (libxl_domain_info(&driver->ctx, &d_info, dom->id) != 0) {
+        if (libxl_domain_info(driver->ctx, &d_info, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("libxl_domain_info failed for domain '%d'"), dom->id);
             goto cleanup;
@@ -1861,7 +1962,7 @@ libxlDoDomainSave(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         goto cleanup;
     }
 
-    if (libxl_domain_suspend(&priv->ctx, NULL, vm->def->id, fd) != 0) {
+    if (libxl_domain_suspend(priv->ctx, vm->def->id, fd, 0, NULL) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to save domain '%d' with libxenlight"),
                        vm->def->id);
@@ -1871,7 +1972,7 @@ libxlDoDomainSave(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
     event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
                                          VIR_DOMAIN_EVENT_STOPPED_SAVED);
 
-    if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_SAVED) != 0) {
+    if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_SAVED) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to destroy domain '%d'"), vm->def->id);
         goto cleanup;
@@ -2028,7 +2129,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
 
     if (!(flags & VIR_DUMP_LIVE) &&
         virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
-        if (libxl_domain_pause(&priv->ctx, dom->id) != 0) {
+        if (libxl_domain_pause(priv->ctx, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Before dumping core, failed to suspend domain '%d'"
                              " with libxenlight"),
@@ -2039,7 +2140,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
         paused = true;
     }
 
-    if (libxl_domain_core_dump(&priv->ctx, dom->id, to) != 0) {
+    if (libxl_domain_core_dump(priv->ctx, dom->id, to, NULL) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to dump core of domain '%d' with libxenlight"),
                        dom->id);
@@ -2048,7 +2149,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
 
     libxlDriverLock(driver);
     if (flags & VIR_DUMP_CRASH) {
-        if (libxlVmReap(driver, vm, 1, VIR_DOMAIN_SHUTOFF_CRASHED) != 0) {
+        if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_CRASHED) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to destroy domain '%d'"), dom->id);
             goto cleanup_unlock;
@@ -2069,7 +2170,7 @@ cleanup_unlock:
     libxlDriverUnlock(driver);
 cleanup_unpause:
     if (virDomainObjIsActive(vm) && paused) {
-        if (libxl_domain_unpause(&priv->ctx, dom->id) != 0) {
+        if (libxl_domain_unpause(priv->ctx, dom->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("After dumping core, failed to resume domain '%d' with"
                              " libxenlight"), dom->id);
@@ -2227,7 +2328,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
     libxlDomainObjPrivatePtr priv;
     virDomainDefPtr def;
     virDomainObjPtr vm;
-    libxl_cpumap map;
+    libxl_bitmap map;
     uint8_t *bitmask = NULL;
     unsigned int maplen;
     unsigned int i, pos;
@@ -2322,7 +2423,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
         break;
 
     case VIR_DOMAIN_VCPU_LIVE:
-        if (libxl_set_vcpuonline(&priv->ctx, dom->id, &map) != 0) {
+        if (libxl_set_vcpuonline(priv->ctx, dom->id, &map) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to set vcpus for domain '%d'"
                              " with libxenlight"), dom->id);
@@ -2331,7 +2432,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
         break;
 
     case VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG:
-        if (libxl_set_vcpuonline(&priv->ctx, dom->id, &map) != 0) {
+        if (libxl_set_vcpuonline(priv->ctx, dom->id, &map) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to set vcpus for domain '%d'"
                              " with libxenlight"), dom->id);
@@ -2427,7 +2528,7 @@ libxlDomainPinVcpu(virDomainPtr dom, unsigned int vcpu, unsigned char *cpumap,
     libxlDomainObjPrivatePtr priv;
     virDomainObjPtr vm;
     int ret = -1;
-    libxl_cpumap map;
+    libxl_bitmap map;
 
     libxlDriverLock(driver);
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
@@ -2448,7 +2549,7 @@ libxlDomainPinVcpu(virDomainPtr dom, unsigned int vcpu, unsigned char *cpumap,
 
     map.size = maplen;
     map.map = cpumap;
-    if (libxl_set_vcpuaffinity(&priv->ctx, dom->id, vcpu, &map) != 0) {
+    if (libxl_set_vcpuaffinity(priv->ctx, dom->id, vcpu, &map) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to pin vcpu '%d' with libxenlight"), vcpu);
         goto cleanup;
@@ -2511,7 +2612,7 @@ libxlDomainGetVcpus(virDomainPtr dom, virVcpuInfoPtr info, int maxinfo,
     }
 
     priv = vm->privateData;
-    if ((vcpuinfo = libxl_list_vcpu(&priv->ctx, dom->id, &maxcpu,
+    if ((vcpuinfo = libxl_list_vcpu(priv->ctx, dom->id, &maxcpu,
                                     &hostcpus)) == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to list vcpus for domain '%d' with libxenlight"),
@@ -2538,7 +2639,7 @@ libxlDomainGetVcpus(virDomainPtr dom, virVcpuInfoPtr info, int maxinfo,
                    MIN(maplen, vcpuinfo[i].cpumap.size));
         }
 
-        libxl_vcpuinfo_destroy(&vcpuinfo[i]);
+        libxl_vcpuinfo_dispose(&vcpuinfo[i]);
     }
     VIR_FREE(vcpuinfo);
 
@@ -2596,7 +2697,7 @@ libxlDomainXMLFromNative(virConnectPtr conn, const char * nativeFormat,
         goto cleanup;
     }
 
-    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
         VIR_ERROR(_("cannot get version information from libxenlight"));
         goto cleanup;
     }
@@ -2639,7 +2740,7 @@ libxlDomainXMLToNative(virConnectPtr conn, const char * nativeFormat,
         goto cleanup;
     }
 
-    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
         VIR_ERROR(_("cannot get version information from libxenlight"));
         goto cleanup;
     }
@@ -2899,10 +3000,10 @@ libxlDomainChangeEjectableMedia(libxlDomainObjPrivatePtr priv,
         return -1;
     }
 
-    if (libxlMakeDisk(vm->def, disk, &x_disk) < 0)
+    if (libxlMakeDisk(disk, &x_disk) < 0)
         goto cleanup;
 
-    if ((ret = libxl_cdrom_insert(&priv->ctx, vm->def->id, &x_disk)) < 0) {
+    if ((ret = libxl_cdrom_insert(priv->ctx, vm->def->id, &x_disk, NULL)) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("libxenlight failed to change media for disk '%s'"),
                        disk->dst);
@@ -2954,11 +3055,11 @@ libxlDomainAttachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
                     goto cleanup;
                 }
 
-                if (libxlMakeDisk(vm->def, l_disk, &x_disk) < 0)
+                if (libxlMakeDisk(l_disk, &x_disk) < 0)
                     goto cleanup;
 
-                if ((ret = libxl_device_disk_add(&priv->ctx, vm->def->id,
-                                                &x_disk)) < 0) {
+                if ((ret = libxl_device_disk_add(priv->ctx, vm->def->id,
+                                                &x_disk, NULL)) < 0) {
                     virReportError(VIR_ERR_INTERNAL_ERROR,
                                    _("libxenlight failed to attach disk '%s'"),
                                    l_disk->dst);
@@ -2991,7 +3092,6 @@ libxlDomainDetachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
     virDomainDiskDefPtr l_disk = NULL;
     libxl_device_disk x_disk;
     int i;
-    int wait_secs = 2;
     int ret = -1;
 
     switch (dev->data.disk->device)  {
@@ -3008,11 +3108,11 @@ libxlDomainDetachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
 
                 l_disk = vm->def->disks[i];
 
-                if (libxlMakeDisk(vm->def, l_disk, &x_disk) < 0)
+                if (libxlMakeDisk(l_disk, &x_disk) < 0)
                     goto cleanup;
 
-                if ((ret = libxl_device_disk_del(&priv->ctx, &x_disk,
-                                                 wait_secs)) < 0) {
+                if ((ret = libxl_device_disk_remove(priv->ctx, vm->def->id,
+                                                    &x_disk, NULL)) < 0) {
                     virReportError(VIR_ERR_INTERNAL_ERROR,
                                    _("libxenlight failed to detach disk '%s'"),
                                    l_disk->dst);
@@ -3383,13 +3483,13 @@ libxlNodeGetFreeMemory(virConnectPtr conn)
     const libxl_version_info* ver_info;
     libxlDriverPrivatePtr driver = conn->privateData;
 
-    if (libxl_get_physinfo(&driver->ctx, &phy_info)) {
+    if (libxl_get_physinfo(driver->ctx, &phy_info)) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxl_get_physinfo_info failed"));
         return 0;
     }
 
-    if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
+    if ((ver_info = libxl_get_version_info(driver->ctx)) == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("libxl_get_version_info failed"));
         return 0;
@@ -3536,7 +3636,7 @@ libxlDomainGetSchedulerType(virDomainPtr dom, int *nparams)
     libxlDomainObjPrivatePtr priv;
     virDomainObjPtr vm;
     char * ret = NULL;
-    int sched_id;
+    libxl_scheduler sched_id;
 
     libxlDriverLock(driver);
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
@@ -3553,31 +3653,29 @@ libxlDomainGetSchedulerType(virDomainPtr dom, int *nparams)
     }
 
     priv = vm->privateData;
-    if ((sched_id = libxl_get_sched_id(&priv->ctx)) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to get scheduler id for domain '%d'"
-                         " with libxenlight"), dom->id);
-        goto cleanup;
-    }
+    sched_id = libxl_get_scheduler(priv->ctx);
 
     if (nparams)
         *nparams = 0;
     switch (sched_id) {
-    case XEN_SCHEDULER_SEDF:
+    case LIBXL_SCHEDULER_SEDF:
         ret = strdup("sedf");
         break;
-    case XEN_SCHEDULER_CREDIT:
+    case LIBXL_SCHEDULER_CREDIT:
         ret = strdup("credit");
         if (nparams)
             *nparams = XEN_SCHED_CREDIT_NPARAM;
         break;
-    case XEN_SCHEDULER_CREDIT2:
+    case LIBXL_SCHEDULER_CREDIT2:
         ret = strdup("credit2");
         break;
-    case XEN_SCHEDULER_ARINC653:
+    case LIBXL_SCHEDULER_ARINC653:
         ret = strdup("arinc653");
         break;
     default:
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                   _("Failed to get scheduler id for domain '%d'"
+                     " with libxenlight"), dom->id);
         goto cleanup;
     }
 
@@ -3599,8 +3697,8 @@ libxlDomainGetSchedulerParametersFlags(virDomainPtr dom,
     libxlDriverPrivatePtr driver = dom->conn->privateData;
     libxlDomainObjPrivatePtr priv;
     virDomainObjPtr vm;
-    libxl_sched_credit sc_info;
-    int sched_id;
+    libxl_domain_sched_params sc_info;
+    libxl_scheduler sched_id;
     int ret = -1;
 
     virCheckFlags(0, -1);
@@ -3610,31 +3708,28 @@ libxlDomainGetSchedulerParametersFlags(virDomainPtr dom,
     libxlDriverUnlock(driver);
 
     if (!vm) {
-        virReportError(VIR_ERR_NO_DOMAIN, "%s", _("no domain with matching uuid"));
+        virReportError(VIR_ERR_NO_DOMAIN, "%s",
+                       _("no domain with matching uuid"));
         goto cleanup;
     }
 
     if (!virDomainObjIsActive(vm)) {
-        virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("Domain is not running"));
+        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+                       _("Domain is not running"));
         goto cleanup;
     }
 
     priv = vm->privateData;
 
-    if ((sched_id = libxl_get_sched_id(&priv->ctx)) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to get scheduler id for domain '%d'"
-                         " with libxenlight"), dom->id);
-        goto cleanup;
-    }
+    sched_id = libxl_get_scheduler(priv->ctx);
 
-    if (sched_id != XEN_SCHEDULER_CREDIT) {
+    if (sched_id != LIBXL_SCHEDULER_CREDIT) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("Only 'credit' scheduler is supported"));
         goto cleanup;
     }
 
-    if (libxl_sched_credit_domain_get(&priv->ctx, dom->id, &sc_info) != 0) {
+    if (libxl_domain_sched_params_get(priv->ctx, dom->id, &sc_info) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to get scheduler parameters for domain '%d'"
                          " with libxenlight"), dom->id);
@@ -3677,7 +3772,7 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
     libxlDriverPrivatePtr driver = dom->conn->privateData;
     libxlDomainObjPrivatePtr priv;
     virDomainObjPtr vm;
-    libxl_sched_credit sc_info;
+    libxl_domain_sched_params sc_info;
     int sched_id;
     int i;
     int ret = -1;
@@ -3707,20 +3802,15 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
 
     priv = vm->privateData;
 
-    if ((sched_id = libxl_get_sched_id(&priv->ctx)) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to get scheduler id for domain '%d'"
-                         " with libxenlight"), dom->id);
-        goto cleanup;
-    }
+    sched_id = libxl_get_scheduler(priv->ctx);
 
-    if (sched_id != XEN_SCHEDULER_CREDIT) {
+    if (sched_id != LIBXL_SCHEDULER_CREDIT) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("Only 'credit' scheduler is supported"));
         goto cleanup;
     }
 
-    if (libxl_sched_credit_domain_get(&priv->ctx, dom->id, &sc_info) != 0) {
+    if (libxl_domain_sched_params_get(priv->ctx, dom->id, &sc_info) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to get scheduler parameters for domain '%d'"
                          " with libxenlight"), dom->id);
@@ -3737,7 +3827,7 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
         }
     }
 
-    if (libxl_sched_credit_domain_set(&priv->ctx, dom->id, &sc_info) != 0) {
+    if (libxl_domain_sched_params_set(priv->ctx, dom->id, &sc_info) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to set scheduler parameters for domain '%d'"
                          " with libxenlight"), dom->id);
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 22:18:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 22:18:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeYuh-0001Ly-TZ; Fri, 30 Nov 2012 22:18:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jfehlig@suse.com>) id 1TeYug-0001Lr-LB
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 22:18:26 +0000
Received: from [85.158.138.51:49332] by server-14.bemta-3.messagelabs.com id
	84/B2-31424-1B039B05; Fri, 30 Nov 2012 22:18:25 +0000
X-Env-Sender: jfehlig@suse.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1354313902!28190422!1
X-Originating-IP: [137.65.250.26]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24900 invoked from network); 30 Nov 2012 22:18:23 -0000
Received: from victor.provo.novell.com (HELO victor.provo.novell.com)
	(137.65.250.26)
	by server-10.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 22:18:23 -0000
Received: from [137.65.135.33] (prv-ext-foundry1int.gns.novell.com
	[137.65.251.240])
	by victor.provo.novell.com with ESMTP (TLS encrypted);
	Fri, 30 Nov 2012 15:17:20 -0700
Message-ID: <50B93070.7020302@suse.com>
Date: Fri, 30 Nov 2012 15:17:20 -0700
From: Jim Fehlig <jfehlig@suse.com>
User-Agent: Thunderbird 2.0.0.24 (X11/20100302)
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
	<1354013490.5830.181.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354013490.5830.181.camel@zakaz.uk.xensource.com>
Cc: "libvir-list@redhat.com" <libvir-list@redhat.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Convert libxl driver to Xen 4.2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell wrote:
> On Mon, 2012-11-26 at 22:28 +0000, Jim Fehlig wrote:
>   
>> @@ -62,6 +63,52 @@ struct guest_arch {
>>  static const char *xen_cap_re = "(xen|hvm)-[[:digit:]]+\
>> \.[[:digit:]]+-(x86_32|x86_64|ia64|powerpc64)(p|be)?";
>>  static regex_t xen_cap_rec;
>>
>> +/*
>> + * Copied from split_string_into_string_list() in
>> + * $xen-sources/tools/libxl/xl_cmdimpl.c, which is licensed LGPL v2.1.
>> + */
>>     
>
> Looks like I am the sole author of that original function
> (24250:71ecbef5645f xen-unstable.hg). I'd more than likely be happy to
> relicence under whatever terms would be suitable for libvirt -- what are
> they?
>
> In particular I'd be happy with LGPL v2.1+ if that's what it takes.
>   

In the meantime, Daniel introduced some string utilities in libvirt,
including virStringSplit(), so I've dropped the copied code.

>   
>> +static int
>> +libxlSplitStringIntoStringList(const char *str,
>> +                               const char *delim,
>> +                               libxl_string_list *psl) 
>>     
> [...]
>
>   
>> @@ -393,26 +458,25 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
>>      int hvm = STREQ(def->os.type, "hvm");
>>      int i;
>>
>> -    /* Currently, libxenlight only supports 32 vcpus per domain.
>> -     * cur_vcpus member of struct libxl_domain_build_info is defined
>> -     * as an int, but its semantic is a bitmap of online vcpus, so
>> -     * only 32 can be represented.
>> +    /*
>> +     * libxl in Xen 4.2 supports up to 128 vcpus, cur_vcpus was replaced
>> +     * by avail_vcpus of type libxl_bitmap
>>     
>
> Do you happen to know where the 128 number comes from? I think libxl is
> mostly agnostic about the size of this bitmap and should just be
> exposing whatever the hypervisor supports.
>   

I've also removed this check and sent a v2.

Regards,
Jim


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 22:18:42 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 22:18:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeYuh-0001Ly-TZ; Fri, 30 Nov 2012 22:18:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <jfehlig@suse.com>) id 1TeYug-0001Lr-LB
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 22:18:26 +0000
Received: from [85.158.138.51:49332] by server-14.bemta-3.messagelabs.com id
	84/B2-31424-1B039B05; Fri, 30 Nov 2012 22:18:25 +0000
X-Env-Sender: jfehlig@suse.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1354313902!28190422!1
X-Originating-IP: [137.65.250.26]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24900 invoked from network); 30 Nov 2012 22:18:23 -0000
Received: from victor.provo.novell.com (HELO victor.provo.novell.com)
	(137.65.250.26)
	by server-10.tower-174.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 22:18:23 -0000
Received: from [137.65.135.33] (prv-ext-foundry1int.gns.novell.com
	[137.65.251.240])
	by victor.provo.novell.com with ESMTP (TLS encrypted);
	Fri, 30 Nov 2012 15:17:20 -0700
Message-ID: <50B93070.7020302@suse.com>
Date: Fri, 30 Nov 2012 15:17:20 -0700
From: Jim Fehlig <jfehlig@suse.com>
User-Agent: Thunderbird 2.0.0.24 (X11/20100302)
MIME-Version: 1.0
To: Ian Campbell <Ian.Campbell@citrix.com>
References: <1353968895-16014-1-git-send-email-jfehlig@suse.com>
	<1354013490.5830.181.camel@zakaz.uk.xensource.com>
In-Reply-To: <1354013490.5830.181.camel@zakaz.uk.xensource.com>
Cc: "libvir-list@redhat.com" <libvir-list@redhat.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] Convert libxl driver to Xen 4.2
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Ian Campbell wrote:
> On Mon, 2012-11-26 at 22:28 +0000, Jim Fehlig wrote:
>   
>> @@ -62,6 +63,52 @@ struct guest_arch {
>>  static const char *xen_cap_re = "(xen|hvm)-[[:digit:]]+\
>> \.[[:digit:]]+-(x86_32|x86_64|ia64|powerpc64)(p|be)?";
>>  static regex_t xen_cap_rec;
>>
>> +/*
>> + * Copied from split_string_into_string_list() in
>> + * $xen-sources/tools/libxl/xl_cmdimpl.c, which is licensed LGPL v2.1.
>> + */
>>     
>
> Looks like I am the sole author of that original function
> (24250:71ecbef5645f xen-unstable.hg). I'd more than likely be happy to
> relicence under whatever terms would be suitable for libvirt -- what are
> they?
>
> In particular I'd be happy with LGPL v2.1+ if that's what it takes.
>   

In the meantime, Daniel introduced some string utilities in libvirt,
including virStringSplit(), so I've dropped the copied code.

>   
>> +static int
>> +libxlSplitStringIntoStringList(const char *str,
>> +                               const char *delim,
>> +                               libxl_string_list *psl) 
>>     
> [...]
>
>   
>> @@ -393,26 +458,25 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
>>      int hvm = STREQ(def->os.type, "hvm");
>>      int i;
>>
>> -    /* Currently, libxenlight only supports 32 vcpus per domain.
>> -     * cur_vcpus member of struct libxl_domain_build_info is defined
>> -     * as an int, but its semantic is a bitmap of online vcpus, so
>> -     * only 32 can be represented.
>> +    /*
>> +     * libxl in Xen 4.2 supports up to 128 vcpus, cur_vcpus was replaced
>> +     * by avail_vcpus of type libxl_bitmap
>>     
>
> Do you happen to know where the 128 number comes from? I think libxl is
> mostly agnostic about the size of this bitmap and should just be
> exposing whatever the hypervisor supports.
>   

I've also removed this check and sent a v2.

Regards,
Jim


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 22:40:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 22:40:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeZFO-0001zg-RU; Fri, 30 Nov 2012 22:39:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TeZFN-0001zb-4V
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 22:39:49 +0000
Received: from [85.158.137.99:5544] by server-9.bemta-3.messagelabs.com id
	A3/AB-02388-4B539B05; Fri, 30 Nov 2012 22:39:48 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1354315186!12518675!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA5NzA1Nw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5802 invoked from network); 30 Nov 2012 22:39:47 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-5.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 30 Nov 2012 22:39:47 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAUMdfFc028110
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 30 Nov 2012 22:39:42 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAUMdfkw023913
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 30 Nov 2012 22:39:41 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAUMdeVp003869; Fri, 30 Nov 2012 16:39:40 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 30 Nov 2012 14:39:40 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 5ECA41C0573; Fri, 30 Nov 2012 17:39:39 -0500 (EST)
Date: Fri, 30 Nov 2012 17:39:39 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Message-ID: <20121130223939.GA7749@phenom.dumpdata.com>
References: <507FD39F.4060601@citrix.com>
	<1350554618-14582-3-git-send-email-david.vrabel@citrix.com>
	<20121019125919.GC26830@phenom.dumpdata.com>
	<CAErSpo6jBTGQYdPK==u7zjDuhV+U5iUfUp_KZnxkhvZCU4difQ@mail.gmail.com>
	<CAErSpo7Vob9CiRxK+E2nV2V7G4FCss6zLCPO93PMSDj9G55ywg@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CAErSpo7Vob9CiRxK+E2nV2V7G4FCss6zLCPO93PMSDj9G55ywg@mail.gmail.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	David Vrabel <david.vrabel@citrix.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 3/5] xen-pcifront: handle backend CLOSED
	without CLOSING
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 02:42:14PM -0700, Bjorn Helgaas wrote:
> On Fri, Nov 30, 2012 at 11:41 AM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> > On Fri, Oct 19, 2012 at 6:59 AM, Konrad Rzeszutek Wilk
> > <konrad.wilk@oracle.com> wrote:
> >> On Thu, Oct 18, 2012 at 11:03:36AM +0100, David Vrabel wrote:
> >>> From: David Vrabel <david.vrabel@citrix.com>
> >>>
> >>> Backend drivers shouldn't transistion to CLOSED unless the frontend is
> >>> CLOSED.  If a backend does transition to CLOSED too soon then the
> >>> frontend may not see the CLOSING state and will not properly shutdown.
> >>>
> >>> So, treat an unexpected backend CLOSED state the same as CLOSING.
> >>>
> >>> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> >>> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> >>> ---
> >>> Cc: linux-pci@vger.kernel.org
> >>> Cc: Bjorn Helgaas <bhelgaas@google.com>
> >>
> >> Bjorn, do you want me to prep a git pull with this patch
> >> or can I have your Ack to put it my tree and have it part of my
> >> git pull to Linus?
> >
> > Sorry, I missed this.  I can put it in my -next branch for the v3.8
> > merge window.  Would that work for you?
> 
> I put this in my -next branch, so we'll at least have a chance of
> making a linux-next cycle before v3.7 pops.

Great. Thx!
> 
> >>> ---
> >>>  drivers/pci/xen-pcifront.c |    5 ++++-
> >>>  1 files changed, 4 insertions(+), 1 deletions(-)
> >>>
> >>> diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
> >>> index 0aab85a..a0c7312 100644
> >>> --- a/drivers/pci/xen-pcifront.c
> >>> +++ b/drivers/pci/xen-pcifront.c
> >>> @@ -1068,13 +1068,16 @@ static void __init_refok pcifront_backend_changed(struct xenbus_device *xdev,
> >>>       case XenbusStateInitialising:
> >>>       case XenbusStateInitWait:
> >>>       case XenbusStateInitialised:
> >>> -     case XenbusStateClosed:
> >>>               break;
> >>>
> >>>       case XenbusStateConnected:
> >>>               pcifront_try_connect(pdev);
> >>>               break;
> >>>
> >>> +     case XenbusStateClosed:
> >>> +             if (xdev->state == XenbusStateClosed)
> >>> +                     break;
> >>> +             /* Missed the backend's CLOSING state -- fallthrough */
> >>>       case XenbusStateClosing:
> >>>               dev_warn(&xdev->dev, "backend going away!\n");
> >>>               pcifront_try_disconnect(pdev);
> >>> --
> >>> 1.7.2.5

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 22:40:04 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 22:40:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeZFO-0001zg-RU; Fri, 30 Nov 2012 22:39:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <konrad.wilk@oracle.com>) id 1TeZFN-0001zb-4V
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 22:39:49 +0000
Received: from [85.158.137.99:5544] by server-9.bemta-3.messagelabs.com id
	A3/AB-02388-4B539B05; Fri, 30 Nov 2012 22:39:48 +0000
X-Env-Sender: konrad.wilk@oracle.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1354315186!12518675!1
X-Originating-IP: [156.151.31.81]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiA5NzA1Nw==\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5802 invoked from network); 30 Nov 2012 22:39:47 -0000
Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81)
	by server-5.tower-217.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 30 Nov 2012 22:39:47 -0000
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id qAUMdfFc028110
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 30 Nov 2012 22:39:42 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	qAUMdfkw023913
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 30 Nov 2012 22:39:41 GMT
Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	qAUMdeVp003869; Fri, 30 Nov 2012 16:39:40 -0600
Received: from phenom.dumpdata.com (/50.195.21.189)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 30 Nov 2012 14:39:40 -0800
Received: by phenom.dumpdata.com (Postfix, from userid 1000)
	id 5ECA41C0573; Fri, 30 Nov 2012 17:39:39 -0500 (EST)
Date: Fri, 30 Nov 2012 17:39:39 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Message-ID: <20121130223939.GA7749@phenom.dumpdata.com>
References: <507FD39F.4060601@citrix.com>
	<1350554618-14582-3-git-send-email-david.vrabel@citrix.com>
	<20121019125919.GC26830@phenom.dumpdata.com>
	<CAErSpo6jBTGQYdPK==u7zjDuhV+U5iUfUp_KZnxkhvZCU4difQ@mail.gmail.com>
	<CAErSpo7Vob9CiRxK+E2nV2V7G4FCss6zLCPO93PMSDj9G55ywg@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CAErSpo7Vob9CiRxK+E2nV2V7G4FCss6zLCPO93PMSDj9G55ywg@mail.gmail.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	David Vrabel <david.vrabel@citrix.com>, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH 3/5] xen-pcifront: handle backend CLOSED
	without CLOSING
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On Fri, Nov 30, 2012 at 02:42:14PM -0700, Bjorn Helgaas wrote:
> On Fri, Nov 30, 2012 at 11:41 AM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> > On Fri, Oct 19, 2012 at 6:59 AM, Konrad Rzeszutek Wilk
> > <konrad.wilk@oracle.com> wrote:
> >> On Thu, Oct 18, 2012 at 11:03:36AM +0100, David Vrabel wrote:
> >>> From: David Vrabel <david.vrabel@citrix.com>
> >>>
> >>> Backend drivers shouldn't transistion to CLOSED unless the frontend is
> >>> CLOSED.  If a backend does transition to CLOSED too soon then the
> >>> frontend may not see the CLOSING state and will not properly shutdown.
> >>>
> >>> So, treat an unexpected backend CLOSED state the same as CLOSING.
> >>>
> >>> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> >>> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> >>> ---
> >>> Cc: linux-pci@vger.kernel.org
> >>> Cc: Bjorn Helgaas <bhelgaas@google.com>
> >>
> >> Bjorn, do you want me to prep a git pull with this patch
> >> or can I have your Ack to put it my tree and have it part of my
> >> git pull to Linus?
> >
> > Sorry, I missed this.  I can put it in my -next branch for the v3.8
> > merge window.  Would that work for you?
> 
> I put this in my -next branch, so we'll at least have a chance of
> making a linux-next cycle before v3.7 pops.

Great. Thx!
> 
> >>> ---
> >>>  drivers/pci/xen-pcifront.c |    5 ++++-
> >>>  1 files changed, 4 insertions(+), 1 deletions(-)
> >>>
> >>> diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
> >>> index 0aab85a..a0c7312 100644
> >>> --- a/drivers/pci/xen-pcifront.c
> >>> +++ b/drivers/pci/xen-pcifront.c
> >>> @@ -1068,13 +1068,16 @@ static void __init_refok pcifront_backend_changed(struct xenbus_device *xdev,
> >>>       case XenbusStateInitialising:
> >>>       case XenbusStateInitWait:
> >>>       case XenbusStateInitialised:
> >>> -     case XenbusStateClosed:
> >>>               break;
> >>>
> >>>       case XenbusStateConnected:
> >>>               pcifront_try_connect(pdev);
> >>>               break;
> >>>
> >>> +     case XenbusStateClosed:
> >>> +             if (xdev->state == XenbusStateClosed)
> >>> +                     break;
> >>> +             /* Missed the backend's CLOSING state -- fallthrough */
> >>>       case XenbusStateClosing:
> >>>               dev_warn(&xdev->dev, "backend going away!\n");
> >>>               pcifront_try_disconnect(pdev);
> >>> --
> >>> 1.7.2.5

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 22:55:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 22:55:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeZUe-0002a7-Ge; Fri, 30 Nov 2012 22:55:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TeZUc-0002a2-EG
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 22:55:34 +0000
Received: from [85.158.143.99:37659] by server-1.bemta-4.messagelabs.com id
	56/16-27934-56939B05; Fri, 30 Nov 2012 22:55:33 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1354316132!17944280!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13774 invoked from network); 30 Nov 2012 22:55:32 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 22:55:32 -0000
X-IronPort-AV: E=Sophos;i="4.84,194,1355097600"; d="scan'208";a="16100366"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 22:55:32 +0000
Received: from [10.30.249.68] (10.30.249.68) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 22:55:32 +0000
Message-ID: <50B93964.4040609@citrix.com>
Date: Fri, 30 Nov 2012 22:55:32 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <50B8EE13.6070301@citrix.com> <50B9050B.7090709@citrix.com>
	<20121130202420.GC95877@ocelot.phlegethon.org>
In-Reply-To: <20121130202420.GC95877@ocelot.phlegethon.org>
Cc: Mats Petersson <mats.petersson@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Woes of NMIs and MCEs, and possibly how to fix
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/2012 20:24, Tim Deegan wrote:
> At 19:12 +0000 on 30 Nov (1354302731), Mats Petersson wrote:
>>> 1) Faults on the NMI path will re-enable NMIs before the handler
>>> returns, leading to reentrant behaviour.  We should audit the NMI path
>>> to try and remove any needless cases which might fault, but getting a
>>> fault-free path will be hard (and is not going so solve the reentrant
>>> behaviour itself).
>> What sort of faults are we expecting on the NMI path?
> None, but we have to keep it that way, and if we accidentlly introduce
> one there's no immediate indication that we've messed up.  Unless we add
> 'am I in the NMI handler?' to all the fixup code.

Any spinlocking whatsoever is out, until we completely fix the
re-entrant entry to do_{nmi,mce}(), at which point spinlocks which are
ok so long as they are exclusively used inside their respective
handlers.  This includes printk (unless preceded by a
console_force_unlock(), which is only safe to use on paths where we have
decided to crash).  There was an audit a little while ago to move
printk()s into soft tasks.

WARN()s, (and with the same logic BUG()s and ASSERT()s, although these
are fatal) are out, both because they directly printk, and make use of
ud2 to force a trap.

Use of {rd,wr}msr() are problematic, as they might fault if we have
buggy code referring to MSRs which are not implemented, and the _safe()
variants will still fault.

>
>>> 2) Faults on the MCE path will re-enable NMIs, as will the iret of the
>>> MCE itself if an MCE interrupts an NMI.
>> The same questions apply as to #1 (just replace NMI with MCE)
> Andrew pointed out that some MCE code uses rdmsr_safe().
>
> FWIW, I think that constraining MCE and NMI code not to do anything that
> can fault is perfectly reasonable.  The MCE code has grown a lot
> recently and probably needs an audit to check for spinlocks, faults &c.

Yes.  However, being able to deal gracefully with the case were we miss
things on code review which touches the NMI/MCE paths is certainly
better than crashing in subtle ways.

>
>>> 3) SMM mode executing an iret will re-enable NMIs.  There is nothing we
>>> can do to prevent this, and as an SMI can interrupt NMIs and MCEs, no
>>> way to predict if/when it may happen.  The best we can do is accept that
>>> it might happen, and try to deal with the after effects.
>> SMM is a messy thing that can interfere with most things in a system. We 
>> will have to rely on the BIOS developers to not mess up here. We can't 
>> do anything else in our code (on AMD hardware, in a HVM guest you could 
>> trap SMI as a VMEXIT, and then "deal with it in a container", but that 
>> doesn't fix SMI that happen whilst in the hypervisor, or in a PV kernel, 
>> so doesn't really help much).
> You can't even do that any more -- some BIOSes turn on the SMM lock,
> which disables the VMEXIT hook.
>
> But yes, if BIOS vendors are executing IRET in SMM mode (and if 'fix
> your BIOS' isn't an appropriate response), then the simple 'just don't
> IRET anywhere that's rechable fom #NMI' solution can't prevent that, and
> we need to handle nested NMIs.
>
> But I'd be happy to cross that bridge when we come to it.

I am fairly sure we the ability to discover this and crash gracefully
when we properly fix for the reentrant case.

>
>> Surely both 4 & 5 are "bad guest behaviour", and whilst it's a "nice to 
>> have" to catch that, it's no different from running on bare metal doing 
>> daft things with vectors or writing code that doesn't behave at all 
>> "friendly". (4 is only available to Xen developers, which we hope are 
>> most of the time sane enough not to try these crazy things in a "live" 
>> system that matters). 5 is only available if you have pass through 
>> enabled. I don't think either is a particularly likely cause of real, in 
>> the field, problems.
> AFAICS both are only available to Xen, unless there's a bug in Xen's MSI
> handling, so they'd only be caused by Xen bugs or bad hardware.  And
> both can be detected (in most cases) with the same simple flag that
> would detect real nested NMI/MCEs.  Or more completely by a linux-style
> solution.

Yes - the fake cases are exclusively buggy Xen or buggy hardware (with
the exception of the pci-passthough with no interrupt-remapping case, in
which one could argue that the host administrator gets to keep both
halves of his broken system after they decided to insecurely allow
passthrough in the first place)

>
>>> 7) Real MCEs can race with each other.  If two real MCEs occur too close
>>> together, the processor shuts down (We cant avoid this).  However, there
>>> is large race condition between the MCE handler clearing the MCIP bit of
>>> IA32_MCG_STATUS and the handler returning during which a new MCE can
>>> occur and the exception frame will be corrupted.
>> From what I understand, the purpose of this bit is really to ensure 
>> that any data needed from the MCE status registers has been fetched 
>> before the processor issues another MCE - otherwise you have a big race 
>> of "what data are we reading, and which of the multiple, in short 
>> succession, MCEs does this belong to. If you get two MCEs in such a 
>> short time that the MCE handler doesn't have time to gather the data 
>> from the status registers, it's likely that the machine isn't going to 
>> do very well for much longer anyways. Now, if we have a common stack, we 
>> should not reset the MCIP bit until it is time to return from the MCE 
>> handler - ideally on the last instruction before that
> We can do the equivalent with a 'mce-being-handled' flag, which allows
> us to (try to) print a useful message intead of just losing a CPU. 

At the moment, the clearing of the MCIP bit is quite early in a few of
the cpu family specific MCE handlers.  As it is an architectural MSR, I
was considering moving it outside the family specific handlers, and make
one of the last things on the MCE path, to help reduce the race
condition window until we properly fix reentrant MCEs.

>
>>> [1] In an effort to prevent a flamewar with my comment, the situation we
>>> find outself in now is almost certainly the result of unforseen
>>> interactions of individual features, but we are left to pick up the many
>>> pieces in way which cant completely be solved.
>>>
>> Happy to have my comments completely shot down into little bits, but I'm 
>> worrying that we're looking to solve a problem that doesn't actually 
>> need solving - at least as long as the code in the respective handlers 
>> are "doing the right thing", and if that happens to be broken, then we 
>> should fix THAT, not build lots of extra code to recover from such a thing.
> I agree.  The only things we can't fix by DTRT in do_nmi() and do_mce()
> are:
>  - IRET in SMM mode re-enabling NMIs; and
>  - detecting _every_ case where we get a nested NMI/MCE (all we can 
>    do is detect _most_ cases, but the detection is just so we can print
>    a message before the crash).
>
> Cheers,
>
> Tim.

We would need to modify the asm stubs to detect nesting.  I think it is
unreasonable to expect the C functions do_{nmi,mce}() to be reentrantly
safe.  With the proper solution, we can get the asm stubs to fixup
nested NMIs/MCEs without reentrantly calling into C (or crashing if we
detect the stack has been smashed)

~Andrew

>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 22:55:58 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 22:55:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeZUe-0002a7-Ge; Fri, 30 Nov 2012 22:55:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Andrew.Cooper3@citrix.com>) id 1TeZUc-0002a2-EG
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 22:55:34 +0000
Received: from [85.158.143.99:37659] by server-1.bemta-4.messagelabs.com id
	56/16-27934-56939B05; Fri, 30 Nov 2012 22:55:33 +0000
X-Env-Sender: Andrew.Cooper3@citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1354316132!17944280!1
X-Originating-IP: [46.33.159.39]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNDYuMzMuMTU5LjM5ID0+IDU5MjQ=\n
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13774 invoked from network); 30 Nov 2012 22:55:32 -0000
Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (46.33.159.39)
	by server-14.tower-216.messagelabs.com with RC4-SHA encrypted SMTP;
	30 Nov 2012 22:55:32 -0000
X-IronPort-AV: E=Sophos;i="4.84,194,1355097600"; d="scan'208";a="16100366"
Received: from lonpmailmx01.citrite.net ([10.30.203.162])
	by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5;
	30 Nov 2012 22:55:32 +0000
Received: from [10.30.249.68] (10.30.249.68) by LONPMAILMX01.citrite.net
	(10.30.203.162) with Microsoft SMTP Server id 8.3.279.1;
	Fri, 30 Nov 2012 22:55:32 +0000
Message-ID: <50B93964.4040609@citrix.com>
Date: Fri, 30 Nov 2012 22:55:32 +0000
From: Andrew Cooper <andrew.cooper3@citrix.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: Tim Deegan <tim@xen.org>
References: <50B8EE13.6070301@citrix.com> <50B9050B.7090709@citrix.com>
	<20121130202420.GC95877@ocelot.phlegethon.org>
In-Reply-To: <20121130202420.GC95877@ocelot.phlegethon.org>
Cc: Mats Petersson <mats.petersson@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Woes of NMIs and MCEs, and possibly how to fix
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

On 30/11/2012 20:24, Tim Deegan wrote:
> At 19:12 +0000 on 30 Nov (1354302731), Mats Petersson wrote:
>>> 1) Faults on the NMI path will re-enable NMIs before the handler
>>> returns, leading to reentrant behaviour.  We should audit the NMI path
>>> to try and remove any needless cases which might fault, but getting a
>>> fault-free path will be hard (and is not going so solve the reentrant
>>> behaviour itself).
>> What sort of faults are we expecting on the NMI path?
> None, but we have to keep it that way, and if we accidentlly introduce
> one there's no immediate indication that we've messed up.  Unless we add
> 'am I in the NMI handler?' to all the fixup code.

Any spinlocking whatsoever is out, until we completely fix the
re-entrant entry to do_{nmi,mce}(), at which point spinlocks which are
ok so long as they are exclusively used inside their respective
handlers.  This includes printk (unless preceded by a
console_force_unlock(), which is only safe to use on paths where we have
decided to crash).  There was an audit a little while ago to move
printk()s into soft tasks.

WARN()s, (and with the same logic BUG()s and ASSERT()s, although these
are fatal) are out, both because they directly printk, and make use of
ud2 to force a trap.

Use of {rd,wr}msr() are problematic, as they might fault if we have
buggy code referring to MSRs which are not implemented, and the _safe()
variants will still fault.

>
>>> 2) Faults on the MCE path will re-enable NMIs, as will the iret of the
>>> MCE itself if an MCE interrupts an NMI.
>> The same questions apply as to #1 (just replace NMI with MCE)
> Andrew pointed out that some MCE code uses rdmsr_safe().
>
> FWIW, I think that constraining MCE and NMI code not to do anything that
> can fault is perfectly reasonable.  The MCE code has grown a lot
> recently and probably needs an audit to check for spinlocks, faults &c.

Yes.  However, being able to deal gracefully with the case were we miss
things on code review which touches the NMI/MCE paths is certainly
better than crashing in subtle ways.

>
>>> 3) SMM mode executing an iret will re-enable NMIs.  There is nothing we
>>> can do to prevent this, and as an SMI can interrupt NMIs and MCEs, no
>>> way to predict if/when it may happen.  The best we can do is accept that
>>> it might happen, and try to deal with the after effects.
>> SMM is a messy thing that can interfere with most things in a system. We 
>> will have to rely on the BIOS developers to not mess up here. We can't 
>> do anything else in our code (on AMD hardware, in a HVM guest you could 
>> trap SMI as a VMEXIT, and then "deal with it in a container", but that 
>> doesn't fix SMI that happen whilst in the hypervisor, or in a PV kernel, 
>> so doesn't really help much).
> You can't even do that any more -- some BIOSes turn on the SMM lock,
> which disables the VMEXIT hook.
>
> But yes, if BIOS vendors are executing IRET in SMM mode (and if 'fix
> your BIOS' isn't an appropriate response), then the simple 'just don't
> IRET anywhere that's rechable fom #NMI' solution can't prevent that, and
> we need to handle nested NMIs.
>
> But I'd be happy to cross that bridge when we come to it.

I am fairly sure we the ability to discover this and crash gracefully
when we properly fix for the reentrant case.

>
>> Surely both 4 & 5 are "bad guest behaviour", and whilst it's a "nice to 
>> have" to catch that, it's no different from running on bare metal doing 
>> daft things with vectors or writing code that doesn't behave at all 
>> "friendly". (4 is only available to Xen developers, which we hope are 
>> most of the time sane enough not to try these crazy things in a "live" 
>> system that matters). 5 is only available if you have pass through 
>> enabled. I don't think either is a particularly likely cause of real, in 
>> the field, problems.
> AFAICS both are only available to Xen, unless there's a bug in Xen's MSI
> handling, so they'd only be caused by Xen bugs or bad hardware.  And
> both can be detected (in most cases) with the same simple flag that
> would detect real nested NMI/MCEs.  Or more completely by a linux-style
> solution.

Yes - the fake cases are exclusively buggy Xen or buggy hardware (with
the exception of the pci-passthough with no interrupt-remapping case, in
which one could argue that the host administrator gets to keep both
halves of his broken system after they decided to insecurely allow
passthrough in the first place)

>
>>> 7) Real MCEs can race with each other.  If two real MCEs occur too close
>>> together, the processor shuts down (We cant avoid this).  However, there
>>> is large race condition between the MCE handler clearing the MCIP bit of
>>> IA32_MCG_STATUS and the handler returning during which a new MCE can
>>> occur and the exception frame will be corrupted.
>> From what I understand, the purpose of this bit is really to ensure 
>> that any data needed from the MCE status registers has been fetched 
>> before the processor issues another MCE - otherwise you have a big race 
>> of "what data are we reading, and which of the multiple, in short 
>> succession, MCEs does this belong to. If you get two MCEs in such a 
>> short time that the MCE handler doesn't have time to gather the data 
>> from the status registers, it's likely that the machine isn't going to 
>> do very well for much longer anyways. Now, if we have a common stack, we 
>> should not reset the MCIP bit until it is time to return from the MCE 
>> handler - ideally on the last instruction before that
> We can do the equivalent with a 'mce-being-handled' flag, which allows
> us to (try to) print a useful message intead of just losing a CPU. 

At the moment, the clearing of the MCIP bit is quite early in a few of
the cpu family specific MCE handlers.  As it is an architectural MSR, I
was considering moving it outside the family specific handlers, and make
one of the last things on the MCE path, to help reduce the race
condition window until we properly fix reentrant MCEs.

>
>>> [1] In an effort to prevent a flamewar with my comment, the situation we
>>> find outself in now is almost certainly the result of unforseen
>>> interactions of individual features, but we are left to pick up the many
>>> pieces in way which cant completely be solved.
>>>
>> Happy to have my comments completely shot down into little bits, but I'm 
>> worrying that we're looking to solve a problem that doesn't actually 
>> need solving - at least as long as the code in the respective handlers 
>> are "doing the right thing", and if that happens to be broken, then we 
>> should fix THAT, not build lots of extra code to recover from such a thing.
> I agree.  The only things we can't fix by DTRT in do_nmi() and do_mce()
> are:
>  - IRET in SMM mode re-enabling NMIs; and
>  - detecting _every_ case where we get a nested NMI/MCE (all we can 
>    do is detect _most_ cases, but the detection is just so we can print
>    a message before the crash).
>
> Cheers,
>
> Tim.

We would need to modify the asm stubs to detect nesting.  I think it is
unreasonable to expect the C functions do_{nmi,mce}() to be reentrantly
safe.  With the proper solution, we can get the asm stubs to fixup
nested NMIs/MCEs without reentrantly calling into C (or crashing if we
detect the stack has been smashed)

~Andrew

>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 23:14:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 23:14:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeZmT-0003CS-KW; Fri, 30 Nov 2012 23:14:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TeZmR-0003CN-3X
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 23:13:59 +0000
Received: from [85.158.143.99:12640] by server-2.bemta-4.messagelabs.com id
	BA/31-28922-6BD39B05; Fri, 30 Nov 2012 23:13:58 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1354317237!27250012!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23784 invoked from network); 30 Nov 2012 23:13:58 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-5.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 23:13:58 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id A3CA984076;
	Sat,  1 Dec 2012 00:13:56 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id MqiEz89iiOWO; Sat,  1 Dec 2012 00:13:56 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id 5A2D584063;
	Sat,  1 Dec 2012 00:13:56 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TeZmN-0002An-0X; Sat, 01 Dec 2012 00:13:55 +0100
Date: Sat, 1 Dec 2012 00:13:55 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Message-ID: <20121130231354.GA5857@type.youpi.perso.aquilenet.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	xen-devel@lists.xen.org
References: <1354308289-667-1-git-send-email-dgdegra@tycho.nsa.gov>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354308289-667-1-git-send-email-dgdegra@tycho.nsa.gov>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] mini-os: shutdown_thread depends on xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Daniel De Graaf, le Fri 30 Nov 2012 15:44:49 -0500, a =E9crit :
> This fixes the build of the xenstore stub domain, which should never be
> shut down and so does not need this feature.

Oops, indeed.
We should probably also comment out the wait queue and variables, to
make sure no code references it?

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From xen-devel-bounces@lists.xen.org Fri Nov 30 23:14:26 2012
Return-path: <xen-devel-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Nov 2012 23:14:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-devel-bounces@lists.xen.org>)
	id 1TeZmT-0003CS-KW; Fri, 30 Nov 2012 23:14:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <samuel.thibault@ens-lyon.org>) id 1TeZmR-0003CN-3X
	for xen-devel@lists.xen.org; Fri, 30 Nov 2012 23:13:59 +0000
Received: from [85.158.143.99:12640] by server-2.bemta-4.messagelabs.com id
	BA/31-28922-6BD39B05; Fri, 30 Nov 2012 23:13:58 +0000
X-Env-Sender: samuel.thibault@ens-lyon.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1354317237!27250012!1
X-Originating-IP: [140.77.166.68]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23784 invoked from network); 30 Nov 2012 23:13:58 -0000
Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68)
	by server-5.tower-216.messagelabs.com with DHE-RSA-AES256-SHA
	encrypted SMTP; 30 Nov 2012 23:13:58 -0000
Received: from localhost (localhost [127.0.0.1])
	by toccata.ens-lyon.org (Postfix) with ESMTP id A3CA984076;
	Sat,  1 Dec 2012 00:13:56 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org
Received: from toccata.ens-lyon.org ([127.0.0.1])
	by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id MqiEz89iiOWO; Sat,  1 Dec 2012 00:13:56 +0100 (CET)
Received: from type.ipv6 (youpi.is-a-geek.org [80.67.176.89])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by toccata.ens-lyon.org (Postfix) with ESMTPSA id 5A2D584063;
	Sat,  1 Dec 2012 00:13:56 +0100 (CET)
Received: from samy by type.ipv6 with local (Exim 4.80)
	(envelope-from <samuel.thibault@ens-lyon.org>)
	id 1TeZmN-0002An-0X; Sat, 01 Dec 2012 00:13:55 +0100
Date: Sat, 1 Dec 2012 00:13:55 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Message-ID: <20121130231354.GA5857@type.youpi.perso.aquilenet.fr>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>, keir@xen.org,
	xen-devel@lists.xen.org
References: <1354308289-667-1-git-send-email-dgdegra@tycho.nsa.gov>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1354308289-667-1-git-send-email-dgdegra@tycho.nsa.gov>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
Cc: keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] mini-os: shutdown_thread depends on xenbus
X-BeenThere: xen-devel@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xen.org>
List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>,
	<mailto:xen-devel-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: xen-devel-bounces@lists.xen.org
Errors-To: xen-devel-bounces@lists.xen.org

Daniel De Graaf, le Fri 30 Nov 2012 15:44:49 -0500, a =E9crit :
> This fixes the build of the xenstore stub domain, which should never be
> shut down and so does not need this feature.

Oops, indeed.
We should probably also comment out the wait queue and variables, to
make sure no code references it?

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

